summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHideki Yamane <henrich@debian.org>2014-03-30 19:38:48 +0900
committerHideki Yamane <henrich@debian.org>2014-03-30 19:38:48 +0900
commit7769a9595c3da9a35f31b42451b1f6c3ed4004fa (patch)
tree009bf8fd68af6bb1129e07dd8c1ed205010d81f8
parent2e7891b0311204e0ecd5dc4a4334df01f3a6a1b4 (diff)
downloadpkg-net-snmp-7769a9595c3da9a35f31b42451b1f6c3ed4004fa.tar.gz
Imported Upstream version 5.7.2~dfsg
-rw-r--r--.gitignore114
-rw-r--r--AGENT.txt1171
-rw-r--r--CHANGES2470
-rw-r--r--COPYING294
-rw-r--r--ChangeLog195243
-rw-r--r--CodingStyle69
-rw-r--r--EXAMPLE.conf.def193
-rw-r--r--FAQ4060
-rw-r--r--INSTALL278
-rw-r--r--Makefile.am1
-rw-r--r--Makefile.in459
-rw-r--r--Makefile.rules475
-rw-r--r--Makefile.top120
-rw-r--r--NEWS1672
-rw-r--r--PORTING104
-rw-r--r--README357
-rw-r--r--README.Panasonic_AM3X.txt118
-rw-r--r--README.agent-mibs462
-rw-r--r--README.agentx47
-rw-r--r--README.aix78
-rw-r--r--README.hpux1122
-rw-r--r--README.irix56
-rw-r--r--README.krb5165
-rw-r--r--README.osX61
-rw-r--r--README.snmpv3105
-rw-r--r--README.solaris1311
-rw-r--r--README.sql29
-rw-r--r--README.thread343
-rw-r--r--README.tru6457
-rw-r--r--README.win321513
-rw-r--r--TODO60
-rw-r--r--acconfig.h831
-rw-r--r--aclocal.m424
-rw-r--r--agent/Makefile.depend5418
-rw-r--r--agent/Makefile.in345
-rw-r--r--agent/agent_handler.c1332
-rw-r--r--agent/agent_index.c872
-rw-r--r--agent/agent_read_config.c338
-rw-r--r--agent/agent_registry.c2421
-rw-r--r--agent/agent_sysORTable.c236
-rw-r--r--agent/agent_trap.c1309
-rw-r--r--agent/auto_nlist.c270
-rw-r--r--agent/autonlist.h10
-rw-r--r--agent/helpers/Makefile.depend2902
-rw-r--r--agent/helpers/Makefile.in38
-rw-r--r--agent/helpers/all_helpers.c58
-rw-r--r--agent/helpers/baby_steps.c565
-rw-r--r--agent/helpers/bulk_to_next.c139
-rw-r--r--agent/helpers/cache_handler.c771
-rw-r--r--agent/helpers/debug_handler.c166
-rw-r--r--agent/helpers/dummy.c1
-rw-r--r--agent/helpers/instance.c807
-rw-r--r--agent/helpers/mode_end_call.c127
-rw-r--r--agent/helpers/multiplexer.c119
-rw-r--r--agent/helpers/null.c65
-rw-r--r--agent/helpers/old_api.c461
-rw-r--r--agent/helpers/read_only.c80
-rw-r--r--agent/helpers/row_merge.c381
-rw-r--r--agent/helpers/scalar.c199
-rw-r--r--agent/helpers/scalar_group.c209
-rw-r--r--agent/helpers/serialize.c93
-rw-r--r--agent/helpers/snmp_get_statistic.c61
-rw-r--r--agent/helpers/stash_cache.c252
-rw-r--r--agent/helpers/stash_to_next.c129
-rw-r--r--agent/helpers/table.c1290
-rw-r--r--agent/helpers/table_array.c919
-rw-r--r--agent/helpers/table_container.c876
-rw-r--r--agent/helpers/table_data.c1069
-rw-r--r--agent/helpers/table_dataset.c1475
-rw-r--r--agent/helpers/table_generic.c347
-rw-r--r--agent/helpers/table_iterator.c1236
-rw-r--r--agent/helpers/table_row.c264
-rw-r--r--agent/helpers/table_tdata.c652
-rw-r--r--agent/helpers/watcher.c661
-rw-r--r--agent/kernel.c254
-rw-r--r--agent/kernel.h31
-rw-r--r--agent/m2m.h60
-rw-r--r--agent/mib_modules.c87
-rw-r--r--agent/mibgroup/Makefile.depend18122
-rw-r--r--agent/mibgroup/Makefile.in41
-rw-r--r--agent/mibgroup/README113
-rw-r--r--agent/mibgroup/README.smux52
-rw-r--r--agent/mibgroup/Rmon.h56
-rw-r--r--agent/mibgroup/Rmon/README30
-rw-r--r--agent/mibgroup/Rmon/agutil.c299
-rw-r--r--agent/mibgroup/Rmon/agutil.h26
-rw-r--r--agent/mibgroup/Rmon/agutil_api.h93
-rw-r--r--agent/mibgroup/Rmon/alarm.c722
-rw-r--r--agent/mibgroup/Rmon/alarm.h29
-rw-r--r--agent/mibgroup/Rmon/alarmTable.c842
-rw-r--r--agent/mibgroup/Rmon/alarmTable.h41
-rw-r--r--agent/mibgroup/Rmon/event.c819
-rw-r--r--agent/mibgroup/Rmon/event.h33
-rw-r--r--agent/mibgroup/Rmon/history.c727
-rw-r--r--agent/mibgroup/Rmon/history.h29
-rw-r--r--agent/mibgroup/Rmon/row_api.h187
-rw-r--r--agent/mibgroup/Rmon/rows.c878
-rw-r--r--agent/mibgroup/Rmon/rows.h26
-rw-r--r--agent/mibgroup/Rmon/statistics.c544
-rw-r--r--agent/mibgroup/Rmon/statistics.h30
-rwxr-xr-xagent/mibgroup/Rmon/test_alarm.sh82
-rwxr-xr-xagent/mibgroup/Rmon/test_hist.sh88
-rw-r--r--agent/mibgroup/agent/extend.c1556
-rw-r--r--agent/mibgroup/agent/extend.h70
-rw-r--r--agent/mibgroup/agent/nsCache.c428
-rw-r--r--agent/mibgroup/agent/nsCache.h22
-rw-r--r--agent/mibgroup/agent/nsDebug.c466
-rw-r--r--agent/mibgroup/agent/nsDebug.h23
-rw-r--r--agent/mibgroup/agent/nsLogging.c472
-rw-r--r--agent/mibgroup/agent/nsLogging.h16
-rw-r--r--agent/mibgroup/agent/nsModuleTable.c322
-rw-r--r--agent/mibgroup/agent/nsModuleTable.h27
-rw-r--r--agent/mibgroup/agent/nsTransactionTable.c247
-rw-r--r--agent/mibgroup/agent/nsTransactionTable.h21
-rw-r--r--agent/mibgroup/agent/nsVacmAccessTable.c355
-rw-r--r--agent/mibgroup/agent/nsVacmAccessTable.h27
-rw-r--r--agent/mibgroup/agent_mibs.h9
-rw-r--r--agent/mibgroup/agentx.h6
-rw-r--r--agent/mibgroup/agentx/agentx_config.c228
-rw-r--r--agent/mibgroup/agentx/agentx_config.h18
-rw-r--r--agent/mibgroup/agentx/client.c492
-rw-r--r--agent/mibgroup/agentx/client.h42
-rw-r--r--agent/mibgroup/agentx/master.c612
-rw-r--r--agent/mibgroup/agentx/master.h15
-rw-r--r--agent/mibgroup/agentx/master_admin.c595
-rw-r--r--agent/mibgroup/agentx/master_admin.h12
-rw-r--r--agent/mibgroup/agentx/protocol.c2058
-rw-r--r--agent/mibgroup/agentx/protocol.h112
-rw-r--r--agent/mibgroup/agentx/subagent.c1094
-rw-r--r--agent/mibgroup/agentx/subagent.h21
-rw-r--r--agent/mibgroup/default_modules.h56
-rw-r--r--agent/mibgroup/deliver/deliverByNotify.c475
-rw-r--r--agent/mibgroup/deliver/deliverByNotify.h40
-rw-r--r--agent/mibgroup/disman.h12
-rw-r--r--agent/mibgroup/disman/event-mib.h2
-rw-r--r--agent/mibgroup/disman/event.h34
-rw-r--r--agent/mibgroup/disman/event/mteEvent.c492
-rw-r--r--agent/mibgroup/disman/event/mteEvent.h87
-rw-r--r--agent/mibgroup/disman/event/mteEventConf.c588
-rw-r--r--agent/mibgroup/disman/event/mteEventConf.h20
-rw-r--r--agent/mibgroup/disman/event/mteEventNotificationTable.c266
-rw-r--r--agent/mibgroup/disman/event/mteEventNotificationTable.h21
-rw-r--r--agent/mibgroup/disman/event/mteEventSetTable.c310
-rw-r--r--agent/mibgroup/disman/event/mteEventSetTable.h24
-rw-r--r--agent/mibgroup/disman/event/mteEventTable.c375
-rw-r--r--agent/mibgroup/disman/event/mteEventTable.h23
-rw-r--r--agent/mibgroup/disman/event/mteObjects.c433
-rw-r--r--agent/mibgroup/disman/event/mteObjects.h60
-rw-r--r--agent/mibgroup/disman/event/mteObjectsConf.c179
-rw-r--r--agent/mibgroup/disman/event/mteObjectsConf.h12
-rw-r--r--agent/mibgroup/disman/event/mteObjectsTable.c347
-rw-r--r--agent/mibgroup/disman/event/mteObjectsTable.h23
-rw-r--r--agent/mibgroup/disman/event/mteScalars.c135
-rw-r--r--agent/mibgroup/disman/event/mteScalars.h14
-rw-r--r--agent/mibgroup/disman/event/mteTrigger.c1200
-rw-r--r--agent/mibgroup/disman/event/mteTrigger.h199
-rw-r--r--agent/mibgroup/disman/event/mteTriggerBooleanTable.c315
-rw-r--r--agent/mibgroup/disman/event/mteTriggerBooleanTable.h25
-rw-r--r--agent/mibgroup/disman/event/mteTriggerConf.c1489
-rw-r--r--agent/mibgroup/disman/event/mteTriggerConf.h23
-rw-r--r--agent/mibgroup/disman/event/mteTriggerDeltaTable.c273
-rw-r--r--agent/mibgroup/disman/event/mteTriggerDeltaTable.h20
-rw-r--r--agent/mibgroup/disman/event/mteTriggerExistenceTable.c290
-rw-r--r--agent/mibgroup/disman/event/mteTriggerExistenceTable.h23
-rw-r--r--agent/mibgroup/disman/event/mteTriggerTable.c508
-rw-r--r--agent/mibgroup/disman/event/mteTriggerTable.h35
-rw-r--r--agent/mibgroup/disman/event/mteTriggerThresholdTable.c389
-rw-r--r--agent/mibgroup/disman/event/mteTriggerThresholdTable.h34
-rw-r--r--agent/mibgroup/disman/expr/expErrorTable.c120
-rw-r--r--agent/mibgroup/disman/expr/expErrorTable.h21
-rw-r--r--agent/mibgroup/disman/expr/expExpression.c365
-rw-r--r--agent/mibgroup/disman/expr/expExpression.h91
-rw-r--r--agent/mibgroup/disman/expr/expExpressionConf.c292
-rw-r--r--agent/mibgroup/disman/expr/expExpressionConf.h10
-rw-r--r--agent/mibgroup/disman/expr/expExpressionTable.c364
-rw-r--r--agent/mibgroup/disman/expr/expExpressionTable.h26
-rw-r--r--agent/mibgroup/disman/expr/expObject.c345
-rw-r--r--agent/mibgroup/disman/expr/expObject.h77
-rw-r--r--agent/mibgroup/disman/expr/expObjectConf.c185
-rw-r--r--agent/mibgroup/disman/expr/expObjectConf.h9
-rw-r--r--agent/mibgroup/disman/expr/expObjectTable.c461
-rw-r--r--agent/mibgroup/disman/expr/expObjectTable.h27
-rw-r--r--agent/mibgroup/disman/expr/expScalars.c97
-rw-r--r--agent/mibgroup/disman/expr/expScalars.h13
-rw-r--r--agent/mibgroup/disman/expr/expValue.c808
-rw-r--r--agent/mibgroup/disman/expr/expValue.h12
-rw-r--r--agent/mibgroup/disman/expr/expValueTable.c329
-rw-r--r--agent/mibgroup/disman/expr/expValueTable.h23
-rw-r--r--agent/mibgroup/disman/expr/exp_enum.h60
-rw-r--r--agent/mibgroup/disman/expression-mib.h21
-rw-r--r--agent/mibgroup/disman/expression.h13
-rw-r--r--agent/mibgroup/disman/expression/expErrorTable.c144
-rw-r--r--agent/mibgroup/disman/expression/expErrorTable.h49
-rw-r--r--agent/mibgroup/disman/expression/expExpressionTable.c1177
-rw-r--r--agent/mibgroup/disman/expression/expExpressionTable.h139
-rw-r--r--agent/mibgroup/disman/expression/expObjectTable.c1465
-rw-r--r--agent/mibgroup/disman/expression/expObjectTable.h92
-rw-r--r--agent/mibgroup/disman/expression/expValueTable.c873
-rw-r--r--agent/mibgroup/disman/expression/expValueTable.h63
-rw-r--r--agent/mibgroup/disman/mteEventNotificationTable.c110
-rw-r--r--agent/mibgroup/disman/mteEventNotificationTable.h23
-rw-r--r--agent/mibgroup/disman/mteEventTable.c345
-rw-r--r--agent/mibgroup/disman/mteEventTable.h30
-rw-r--r--agent/mibgroup/disman/mteObjectsTable.c995
-rw-r--r--agent/mibgroup/disman/mteObjectsTable.h71
-rw-r--r--agent/mibgroup/disman/mteTriggerBooleanTable.c852
-rw-r--r--agent/mibgroup/disman/mteTriggerBooleanTable.h47
-rw-r--r--agent/mibgroup/disman/mteTriggerDeltaTable.c443
-rw-r--r--agent/mibgroup/disman/mteTriggerDeltaTable.h39
-rw-r--r--agent/mibgroup/disman/mteTriggerExistenceTable.c782
-rw-r--r--agent/mibgroup/disman/mteTriggerExistenceTable.h41
-rw-r--r--agent/mibgroup/disman/mteTriggerTable.c3814
-rw-r--r--agent/mibgroup/disman/mteTriggerTable.h253
-rw-r--r--agent/mibgroup/disman/mteTriggerThresholdTable.c1700
-rw-r--r--agent/mibgroup/disman/mteTriggerThresholdTable.h48
-rw-r--r--agent/mibgroup/disman/nslookup-mib.h20
-rw-r--r--agent/mibgroup/disman/nslookup/lookupCtlTable.c1415
-rw-r--r--agent/mibgroup/disman/nslookup/lookupCtlTable.h87
-rw-r--r--agent/mibgroup/disman/nslookup/lookupResultsTable.c306
-rw-r--r--agent/mibgroup/disman/nslookup/lookupResultsTable.h39
-rw-r--r--agent/mibgroup/disman/old-event-mib.h33
-rw-r--r--agent/mibgroup/disman/ping-mib.h20
-rw-r--r--agent/mibgroup/disman/ping/pingCtlTable.c5829
-rw-r--r--agent/mibgroup/disman/ping/pingCtlTable.h437
-rw-r--r--agent/mibgroup/disman/ping/pingProbeHistoryTable.c342
-rw-r--r--agent/mibgroup/disman/ping/pingProbeHistoryTable.h36
-rw-r--r--agent/mibgroup/disman/ping/pingResultsTable.c425
-rw-r--r--agent/mibgroup/disman/ping/pingResultsTable.h42
-rw-r--r--agent/mibgroup/disman/schedule.h3
-rw-r--r--agent/mibgroup/disman/schedule/schedConf.c437
-rw-r--r--agent/mibgroup/disman/schedule/schedConf.h17
-rw-r--r--agent/mibgroup/disman/schedule/schedCore.c515
-rw-r--r--agent/mibgroup/disman/schedule/schedCore.h85
-rw-r--r--agent/mibgroup/disman/schedule/schedTable.c540
-rw-r--r--agent/mibgroup/disman/schedule/schedTable.h39
-rw-r--r--agent/mibgroup/disman/traceroute-mib.h21
-rw-r--r--agent/mibgroup/disman/traceroute/traceRouteCtlTable.c6198
-rw-r--r--agent/mibgroup/disman/traceroute/traceRouteCtlTable.h613
-rw-r--r--agent/mibgroup/disman/traceroute/traceRouteHopsTable.c420
-rw-r--r--agent/mibgroup/disman/traceroute/traceRouteHopsTable.h41
-rw-r--r--agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c417
-rw-r--r--agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.h39
-rw-r--r--agent/mibgroup/disman/traceroute/traceRouteResultsTable.c421
-rw-r--r--agent/mibgroup/disman/traceroute/traceRouteResultsTable.h40
-rw-r--r--agent/mibgroup/etherlike-mib.h7
-rw-r--r--agent/mibgroup/etherlike-mib/data_access/dot3stats.h7
-rw-r--r--agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c928
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable.h11
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c215
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h271
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c417
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h79
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.c1450
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.h143
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.c28
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.h28
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h89
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c1187
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.h94
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h82
-rw-r--r--agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h65
-rw-r--r--agent/mibgroup/examples.h4
-rw-r--r--agent/mibgroup/examples/Makefile.dlmod34
-rw-r--r--agent/mibgroup/examples/data_set.c223
-rw-r--r--agent/mibgroup/examples/data_set.h16
-rw-r--r--agent/mibgroup/examples/delayed_instance.c258
-rw-r--r--agent/mibgroup/examples/delayed_instance.h16
-rw-r--r--agent/mibgroup/examples/example.c728
-rw-r--r--agent/mibgroup/examples/example.h67
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable.c567
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable.h40
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable_access.c365
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable_access.h48
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable_checkfns.c187
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable_checkfns.h47
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c117
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.h49
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable_columns.h16
-rw-r--r--agent/mibgroup/examples/netSnmpHostsTable_enums.h37
-rw-r--r--agent/mibgroup/examples/notification.c175
-rw-r--r--agent/mibgroup/examples/notification.h17
-rw-r--r--agent/mibgroup/examples/scalar_int.c84
-rw-r--r--agent/mibgroup/examples/scalar_int.h14
-rw-r--r--agent/mibgroup/examples/ucdDemoPublic.c222
-rwxr-xr-xagent/mibgroup/examples/ucdDemoPublic.cmds8
-rw-r--r--agent/mibgroup/examples/ucdDemoPublic.conf89
-rw-r--r--agent/mibgroup/examples/ucdDemoPublic.h38
-rw-r--r--agent/mibgroup/examples/watched.c98
-rw-r--r--agent/mibgroup/examples/watched.h14
-rw-r--r--agent/mibgroup/hardware/cpu.h35
-rw-r--r--agent/mibgroup/hardware/cpu/cpu.c274
-rw-r--r--agent/mibgroup/hardware/cpu/cpu.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_kerndata.c95
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_kerndata.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_kinfo.c75
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_kinfo.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_kstat.c161
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_kstat.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_linux.c333
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_linux.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_mach.c113
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_mach.h4
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_nlist.c112
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_nlist.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_null.c38
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_null.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_pcp.c191
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_pcp.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_perfstat.c110
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_perfstat.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_pstat.c109
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_pstat.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_sysctl.c220
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_sysctl.h2
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_sysinfo.c132
-rw-r--r--agent/mibgroup/hardware/cpu/cpu_sysinfo.h2
-rw-r--r--agent/mibgroup/hardware/fsys.h10
-rw-r--r--agent/mibgroup/hardware/fsys/fsys_getfsstats.c187
-rw-r--r--agent/mibgroup/hardware/fsys/fsys_mntctl.c179
-rw-r--r--agent/mibgroup/hardware/fsys/fsys_mntent.c258
-rw-r--r--agent/mibgroup/hardware/fsys/fsys_void.c24
-rw-r--r--agent/mibgroup/hardware/fsys/hw_fsys.c349
-rw-r--r--agent/mibgroup/hardware/fsys/hw_fsys.h2
-rw-r--r--agent/mibgroup/hardware/fsys/mnttypes.h175
-rw-r--r--agent/mibgroup/hardware/fsys/mounts.h159
-rw-r--r--agent/mibgroup/hardware/memory.h32
-rw-r--r--agent/mibgroup/hardware/memory/hw_mem.c104
-rw-r--r--agent/mibgroup/hardware/memory/hw_mem.h1
-rw-r--r--agent/mibgroup/hardware/memory/memory_aix.c81
-rw-r--r--agent/mibgroup/hardware/memory/memory_darwin.c215
-rw-r--r--agent/mibgroup/hardware/memory/memory_dynix.c117
-rw-r--r--agent/mibgroup/hardware/memory/memory_freebsd.c264
-rw-r--r--agent/mibgroup/hardware/memory/memory_hpux.c133
-rw-r--r--agent/mibgroup/hardware/memory/memory_irix.c87
-rw-r--r--agent/mibgroup/hardware/memory/memory_linux.c217
-rw-r--r--agent/mibgroup/hardware/memory/memory_linux.h1
-rw-r--r--agent/mibgroup/hardware/memory/memory_netbsd.c223
-rw-r--r--agent/mibgroup/hardware/memory/memory_null.c18
-rw-r--r--agent/mibgroup/hardware/memory/memory_solaris.c172
-rw-r--r--agent/mibgroup/hardware/memory/memory_win.c63
-rw-r--r--agent/mibgroup/hardware/sensors.h17
-rw-r--r--agent/mibgroup/hardware/sensors/dummy_sensors.c60
-rw-r--r--agent/mibgroup/hardware/sensors/dummy_sensors.h1
-rw-r--r--agent/mibgroup/hardware/sensors/hw_sensors.c189
-rw-r--r--agent/mibgroup/hardware/sensors/hw_sensors.h2
-rw-r--r--agent/mibgroup/hardware/sensors/kstat_sensors.c161
-rw-r--r--agent/mibgroup/hardware/sensors/kstat_sensors.h1
-rw-r--r--agent/mibgroup/hardware/sensors/lmsensors_v2.c74
-rw-r--r--agent/mibgroup/hardware/sensors/lmsensors_v2.h1
-rw-r--r--agent/mibgroup/hardware/sensors/lmsensors_v3.c102
-rw-r--r--agent/mibgroup/hardware/sensors/lmsensors_v3.h1
-rw-r--r--agent/mibgroup/hardware/sensors/picld_sensors.c334
-rw-r--r--agent/mibgroup/hardware/sensors/picld_sensors.h1
-rw-r--r--agent/mibgroup/header_complex.c638
-rw-r--r--agent/mibgroup/header_complex.h81
-rw-r--r--agent/mibgroup/host.h97
-rw-r--r--agent/mibgroup/host/data_access/swinst.c224
-rw-r--r--agent/mibgroup/host/data_access/swinst.h38
-rw-r--r--agent/mibgroup/host/data_access/swinst_apt.c102
-rw-r--r--agent/mibgroup/host/data_access/swinst_darwin.c396
-rw-r--r--agent/mibgroup/host/data_access/swinst_null.c51
-rw-r--r--agent/mibgroup/host/data_access/swinst_pkginfo.c151
-rw-r--r--agent/mibgroup/host/data_access/swinst_rpm.c156
-rw-r--r--agent/mibgroup/host/data_access/swrun.c353
-rw-r--r--agent/mibgroup/host/data_access/swrun.h54
-rw-r--r--agent/mibgroup/host/data_access/swrun_cygwin.c279
-rw-r--r--agent/mibgroup/host/data_access/swrun_darwin.c494
-rw-r--r--agent/mibgroup/host/data_access/swrun_kinfo.c331
-rw-r--r--agent/mibgroup/host/data_access/swrun_kvm_proc.c164
-rw-r--r--agent/mibgroup/host/data_access/swrun_nlist.c114
-rw-r--r--agent/mibgroup/host/data_access/swrun_null.c44
-rw-r--r--agent/mibgroup/host/data_access/swrun_procfs_psinfo.c147
-rw-r--r--agent/mibgroup/host/data_access/swrun_procfs_status.c218
-rw-r--r--agent/mibgroup/host/data_access/swrun_procinfo.c130
-rw-r--r--agent/mibgroup/host/data_access/swrun_prpsinfo.c107
-rw-r--r--agent/mibgroup/host/data_access/swrun_pstat.c117
-rw-r--r--agent/mibgroup/host/hrSWInstalledTable.c282
-rw-r--r--agent/mibgroup/host/hrSWInstalledTable.h26
-rw-r--r--agent/mibgroup/host/hrSWRunPerfTable.c198
-rw-r--r--agent/mibgroup/host/hrSWRunPerfTable.h34
-rw-r--r--agent/mibgroup/host/hrSWRunTable.c350
-rw-r--r--agent/mibgroup/host/hrSWRunTable.h39
-rw-r--r--agent/mibgroup/host/hr_device.c355
-rw-r--r--agent/mibgroup/host/hr_device.h11
-rw-r--r--agent/mibgroup/host/hr_disk.c1426
-rw-r--r--agent/mibgroup/host/hr_disk.h19
-rw-r--r--agent/mibgroup/host/hr_filesys.c1009
-rw-r--r--agent/mibgroup/host/hr_filesys.h18
-rw-r--r--agent/mibgroup/host/hr_network.c310
-rw-r--r--agent/mibgroup/host/hr_network.h14
-rw-r--r--agent/mibgroup/host/hr_other.c66
-rw-r--r--agent/mibgroup/host/hr_other.h12
-rw-r--r--agent/mibgroup/host/hr_partition.c342
-rw-r--r--agent/mibgroup/host/hr_partition.h14
-rw-r--r--agent/mibgroup/host/hr_print.c368
-rw-r--r--agent/mibgroup/host/hr_print.h15
-rw-r--r--agent/mibgroup/host/hr_proc.c233
-rw-r--r--agent/mibgroup/host/hr_proc.h14
-rw-r--r--agent/mibgroup/host/hr_storage.c793
-rw-r--r--agent/mibgroup/host/hr_storage.h43
-rw-r--r--agent/mibgroup/host/hr_swinst.c736
-rw-r--r--agent/mibgroup/host/hr_swinst.h12
-rw-r--r--agent/mibgroup/host/hr_swrun.c1656
-rw-r--r--agent/mibgroup/host/hr_swrun.h13
-rw-r--r--agent/mibgroup/host/hr_system.c731
-rw-r--r--agent/mibgroup/host/hr_system.h17
-rw-r--r--agent/mibgroup/host/hrh_filesys.c429
-rw-r--r--agent/mibgroup/host/hrh_filesys.h19
-rw-r--r--agent/mibgroup/host/hrh_storage.c520
-rw-r--r--agent/mibgroup/host/hrh_storage.h23
-rw-r--r--agent/mibgroup/host_res.h88
-rw-r--r--agent/mibgroup/if-mib.h7
-rw-r--r--agent/mibgroup/if-mib/data_access/interface.c873
-rw-r--r--agent/mibgroup/if-mib/data_access/interface.h58
-rw-r--r--agent/mibgroup/if-mib/data_access/interface_ioctl.c506
-rw-r--r--agent/mibgroup/if-mib/data_access/interface_ioctl.h52
-rw-r--r--agent/mibgroup/if-mib/data_access/interface_linux.c1213
-rw-r--r--agent/mibgroup/if-mib/data_access/interface_openbsd.c407
-rw-r--r--agent/mibgroup/if-mib/data_access/interface_solaris2.c363
-rw-r--r--agent/mibgroup/if-mib/data_access/interface_sysctl.c581
-rw-r--r--agent/mibgroup/if-mib/data_access/interface_sysctl.h31
-rw-r--r--agent/mibgroup/if-mib/ifTable.h5
-rw-r--r--agent/mibgroup/if-mib/ifTable/ifTable.c2363
-rw-r--r--agent/mibgroup/if-mib/ifTable/ifTable.h687
-rw-r--r--agent/mibgroup/if-mib/ifTable/ifTable_constants.h381
-rw-r--r--agent/mibgroup/if-mib/ifTable/ifTable_data_access.c729
-rw-r--r--agent/mibgroup/if-mib/ifTable/ifTable_data_access.h86
-rw-r--r--agent/mibgroup/if-mib/ifTable/ifTable_defs.h37
-rw-r--r--agent/mibgroup/if-mib/ifTable/ifTable_interface.c2019
-rw-r--r--agent/mibgroup/if-mib/ifTable/ifTable_interface.h101
-rw-r--r--agent/mibgroup/if-mib/ifXTable.h6
-rw-r--r--agent/mibgroup/if-mib/ifXTable/ifXTable.c2541
-rw-r--r--agent/mibgroup/if-mib/ifXTable/ifXTable.h458
-rw-r--r--agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h148
-rw-r--r--agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.c104
-rw-r--r--agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.h44
-rw-r--r--agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c2201
-rw-r--r--agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h105
-rw-r--r--agent/mibgroup/ip-forward-mib.h7
-rw-r--r--agent/mibgroup/ip-forward-mib/data_access/route.h31
-rw-r--r--agent/mibgroup/ip-forward-mib/data_access/route_common.c281
-rw-r--r--agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c193
-rw-r--r--agent/mibgroup/ip-forward-mib/data_access/route_ioctl.h8
-rw-r--r--agent/mibgroup/ip-forward-mib/data_access/route_linux.c415
-rw-r--r--agent/mibgroup/ip-forward-mib/data_access/route_linux.h0
-rw-r--r--agent/mibgroup/ip-forward-mib/inetCidrRouteTable.h5
-rw-r--r--agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c2688
-rw-r--r--agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h537
-rw-r--r--agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h216
-rw-r--r--agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c932
-rw-r--r--agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h86
-rw-r--r--agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c2402
-rw-r--r--agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h102
-rw-r--r--agent/mibgroup/ip-forward-mib/ipCidrRouteTable.h5
-rw-r--r--agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c3361
-rw-r--r--agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h501
-rw-r--r--agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h172
-rw-r--r--agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c671
-rw-r--r--agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h82
-rw-r--r--agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c2354
-rw-r--r--agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h100
-rw-r--r--agent/mibgroup/ip-mib.h15
-rw-r--r--agent/mibgroup/ip-mib/data_access/arp.h31
-rw-r--r--agent/mibgroup/ip-mib/data_access/arp_common.c83
-rw-r--r--agent/mibgroup/ip-mib/data_access/arp_linux.c214
-rw-r--r--agent/mibgroup/ip-mib/data_access/arp_netlink.c304
-rw-r--r--agent/mibgroup/ip-mib/data_access/defaultrouter.h28
-rw-r--r--agent/mibgroup/ip-mib/data_access/defaultrouter_common.c291
-rw-r--r--agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c328
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipaddress.h28
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipaddress_common.c519
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c746
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h64
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipaddress_linux.c600
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipaddress_linux.h21
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c291
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipv6scopezone.h30
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c155
-rw-r--r--agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c132
-rw-r--r--agent/mibgroup/ip-mib/data_access/scalars_common.h29
-rw-r--r--agent/mibgroup/ip-mib/data_access/scalars_linux.c148
-rw-r--r--agent/mibgroup/ip-mib/data_access/systemstats.h27
-rw-r--r--agent/mibgroup/ip-mib/data_access/systemstats_common.c602
-rw-r--r--agent/mibgroup/ip-mib/data_access/systemstats_linux.c685
-rw-r--r--agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c213
-rw-r--r--agent/mibgroup/ip-mib/inetNetToMediaTable.h8
-rw-r--r--agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c1817
-rw-r--r--agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h420
-rw-r--r--agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h161
-rw-r--r--agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c670
-rw-r--r--agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h84
-rw-r--r--agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c2032
-rw-r--r--agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h103
-rw-r--r--agent/mibgroup/ip-mib/ipAddressPrefixTable.h5
-rw-r--r--agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c675
-rw-r--r--agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h316
-rw-r--r--agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h153
-rw-r--r--agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c383
-rw-r--r--agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h76
-rw-r--r--agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c1065
-rw-r--r--agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h98
-rw-r--r--agent/mibgroup/ip-mib/ipAddressTable.h5
-rw-r--r--agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c2436
-rw-r--r--agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h457
-rw-r--r--agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h213
-rw-r--r--agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c706
-rw-r--r--agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h79
-rw-r--r--agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c2092
-rw-r--r--agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h100
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable.h5
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c218
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h212
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c423
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h76
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c325
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h84
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h93
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c1026
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h99
-rw-r--r--agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h39
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable.h8
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c222
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h200
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c410
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h70
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c3015
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h246
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h56
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c1420
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h99
-rw-r--r--agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h122
-rw-r--r--agent/mibgroup/ip-mib/ipSystemStatsTable.h8
-rw-r--r--agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c3321
-rw-r--r--agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h1205
-rw-r--r--agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h159
-rw-r--r--agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c400
-rw-r--r--agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h105
-rw-r--r--agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c1391
-rw-r--r--agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h173
-rw-r--r--agent/mibgroup/ip-mib/ip_scalars.c372
-rw-r--r--agent/mibgroup/ip-mib/ip_scalars.h7
-rw-r--r--agent/mibgroup/ip-mib/ipv4InterfaceTable.h5
-rw-r--r--agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c959
-rw-r--r--agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h276
-rw-r--r--agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h81
-rw-r--r--agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c302
-rw-r--r--agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h71
-rw-r--r--agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c1325
-rw-r--r--agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h106
-rw-r--r--agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c207
-rw-r--r--agent/mibgroup/ip-mib/ipv6InterfaceTable.h5
-rw-r--r--agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c1421
-rw-r--r--agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h971
-rw-r--r--agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h104
-rw-r--r--agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c390
-rw-r--r--agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h64
-rw-r--r--agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c1406
-rw-r--r--agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h178
-rw-r--r--agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h5
-rw-r--r--agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c1009
-rw-r--r--agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h269
-rw-r--r--agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c304
-rw-r--r--agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h70
-rw-r--r--agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h39
-rw-r--r--agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c1154
-rw-r--r--agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h98
-rw-r--r--agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h55
-rw-r--r--agent/mibgroup/ipfwchains/README4
-rw-r--r--agent/mibgroup/kernel_sunos5.c2079
-rw-r--r--agent/mibgroup/kernel_sunos5.h224
-rw-r--r--agent/mibgroup/mibII.h47
-rw-r--r--agent/mibgroup/mibII/at.c1279
-rw-r--r--agent/mibgroup/mibII/at.h49
-rw-r--r--agent/mibgroup/mibII/icmp.c1433
-rw-r--r--agent/mibgroup/mibII/icmp.h62
-rw-r--r--agent/mibgroup/mibII/ifTable.h10
-rw-r--r--agent/mibgroup/mibII/interfaces.c2950
-rw-r--r--agent/mibgroup/mibII/interfaces.h127
-rw-r--r--agent/mibgroup/mibII/ip.c1011
-rw-r--r--agent/mibgroup/mibII/ip.h85
-rw-r--r--agent/mibgroup/mibII/ipAddr.c1077
-rw-r--r--agent/mibgroup/mibII/ipAddr.h14
-rw-r--r--agent/mibgroup/mibII/ipCidrRouteTable.c1135
-rw-r--r--agent/mibgroup/mibII/ipCidrRouteTable.h34
-rw-r--r--agent/mibgroup/mibII/ipCidrRouteTable_access.c258
-rw-r--r--agent/mibgroup/mibII/ipCidrRouteTable_access.h57
-rw-r--r--agent/mibgroup/mibII/ipCidrRouteTable_checkfns.c267
-rw-r--r--agent/mibgroup/mibII/ipCidrRouteTable_checkfns.h33
-rw-r--r--agent/mibgroup/mibII/ipCidrRouteTable_columns.h27
-rw-r--r--agent/mibgroup/mibII/ipCidrRouteTable_enums.h46
-rw-r--r--agent/mibgroup/mibII/ipv6.c2301
-rw-r--r--agent/mibgroup/mibII/ipv6.h137
-rw-r--r--agent/mibgroup/mibII/kernel_linux.c628
-rw-r--r--agent/mibgroup/mibII/kernel_linux.h179
-rw-r--r--agent/mibgroup/mibII/kernel_netbsd.c198
-rw-r--r--agent/mibgroup/mibII/kernel_netbsd.h91
-rw-r--r--agent/mibgroup/mibII/mibII_common.h111
-rw-r--r--agent/mibgroup/mibII/mta_sendmail.c1510
-rw-r--r--agent/mibgroup/mibII/mta_sendmail.h9
-rw-r--r--agent/mibgroup/mibII/route_headers.h181
-rw-r--r--agent/mibgroup/mibII/route_write.c831
-rw-r--r--agent/mibgroup/mibII/route_write.h20
-rw-r--r--agent/mibgroup/mibII/setSerialNo.c84
-rw-r--r--agent/mibgroup/mibII/setSerialNo.h6
-rw-r--r--agent/mibgroup/mibII/snmp_mib.c133
-rw-r--r--agent/mibgroup/mibII/snmp_mib.h9
-rw-r--r--agent/mibgroup/mibII/snmp_mib_5_5.c128
-rw-r--r--agent/mibgroup/mibII/snmp_mib_5_5.h4
-rw-r--r--agent/mibgroup/mibII/sysORTable.c295
-rw-r--r--agent/mibgroup/mibII/sysORTable.h15
-rw-r--r--agent/mibgroup/mibII/system_mib.c586
-rw-r--r--agent/mibgroup/mibII/system_mib.h16
-rw-r--r--agent/mibgroup/mibII/tcp.c828
-rw-r--r--agent/mibgroup/mibII/tcp.h39
-rw-r--r--agent/mibgroup/mibII/tcpTable.c1058
-rw-r--r--agent/mibgroup/mibII/tcpTable.h38
-rw-r--r--agent/mibgroup/mibII/udp.c570
-rw-r--r--agent/mibgroup/mibII/udp.h27
-rw-r--r--agent/mibgroup/mibII/udpTable.c795
-rw-r--r--agent/mibgroup/mibII/udpTable.h21
-rw-r--r--agent/mibgroup/mibII/updates.c33
-rw-r--r--agent/mibgroup/mibII/updates.h16
-rw-r--r--agent/mibgroup/mibII/vacm_conf.c1494
-rw-r--r--agent/mibgroup/mibII/vacm_conf.h51
-rw-r--r--agent/mibgroup/mibII/vacm_context.c165
-rw-r--r--agent/mibgroup/mibII/vacm_context.h6
-rw-r--r--agent/mibgroup/mibII/vacm_vars.c1843
-rw-r--r--agent/mibgroup/mibII/vacm_vars.h94
-rw-r--r--agent/mibgroup/mibII/var_route.c2122
-rw-r--r--agent/mibgroup/mibII/var_route.h26
-rw-r--r--agent/mibgroup/mibdefs.h14
-rw-r--r--agent/mibgroup/mibincl.h48
-rw-r--r--agent/mibgroup/misc/ipfwacc.c365
-rw-r--r--agent/mibgroup/misc/ipfwacc.h54
-rw-r--r--agent/mibgroup/notification-log-mib.h2
-rw-r--r--agent/mibgroup/notification-log-mib/notification_log.c770
-rw-r--r--agent/mibgroup/notification-log-mib/notification_log.h20
-rw-r--r--agent/mibgroup/notification.h4
-rw-r--r--agent/mibgroup/notification/snmpNotifyFilterProfileTable.c847
-rw-r--r--agent/mibgroup/notification/snmpNotifyFilterProfileTable.h69
-rw-r--r--agent/mibgroup/notification/snmpNotifyTable.c1222
-rw-r--r--agent/mibgroup/notification/snmpNotifyTable.h76
-rw-r--r--agent/mibgroup/rmon-mib.h8
-rw-r--r--agent/mibgroup/rmon-mib/data_access/etherstats.h7
-rw-r--r--agent/mibgroup/rmon-mib/data_access/etherstats_linux.c315
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable.h11
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c233
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h303
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c525
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h80
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c1411
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h151
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c977
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h356
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h57
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c2232
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h98
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h107
-rw-r--r--agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h35
-rw-r--r--agent/mibgroup/sctp-mib.h3
-rw-r--r--agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c296
-rw-r--r--agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h61
-rw-r--r--agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c342
-rw-r--r--agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h72
-rw-r--r--agent/mibgroup/sctp-mib/sctpAssocTable.c529
-rw-r--r--agent/mibgroup/sctp-mib/sctpAssocTable.h100
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c281
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h60
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c287
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h65
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c286
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h64
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c276
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h58
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c292
-rw-r--r--agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h66
-rw-r--r--agent/mibgroup/sctp-mib/sctpScalars.c295
-rw-r--r--agent/mibgroup/sctp-mib/sctpScalars.h27
-rw-r--r--agent/mibgroup/sctp-mib/sctpScalars_common.c169
-rw-r--r--agent/mibgroup/sctp-mib/sctpScalars_common.h148
-rw-r--r--agent/mibgroup/sctp-mib/sctpScalars_freebsd.c93
-rw-r--r--agent/mibgroup/sctp-mib/sctpScalars_linux.c190
-rw-r--r--agent/mibgroup/sctp-mib/sctpScalars_solaris2.c95
-rw-r--r--agent/mibgroup/sctp-mib/sctpTables.h25
-rw-r--r--agent/mibgroup/sctp-mib/sctpTables_common.c451
-rw-r--r--agent/mibgroup/sctp-mib/sctpTables_common.h112
-rw-r--r--agent/mibgroup/sctp-mib/sctpTables_freebsd.c244
-rw-r--r--agent/mibgroup/sctp-mib/sctpTables_linux.c448
-rw-r--r--agent/mibgroup/sctp-mib/sctpTables_solaris2.c182
-rw-r--r--agent/mibgroup/smux.h4
-rw-r--r--agent/mibgroup/smux/smux.c2114
-rw-r--r--agent/mibgroup/smux/smux.h85
-rw-r--r--agent/mibgroup/smux/snmp_bgp.c208
-rw-r--r--agent/mibgroup/smux/snmp_bgp.h38
-rw-r--r--agent/mibgroup/smux/snmp_ospf.c378
-rw-r--r--agent/mibgroup/smux/snmp_ospf.h123
-rw-r--r--agent/mibgroup/smux/snmp_rip2.c206
-rw-r--r--agent/mibgroup/smux/snmp_rip2.h37
-rw-r--r--agent/mibgroup/smux_gated.h6
-rw-r--r--agent/mibgroup/snmp-notification-mib.h2
-rw-r--r--agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h1
-rw-r--r--agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c1933
-rw-r--r--agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h933
-rw-r--r--agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h131
-rw-r--r--agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c591
-rw-r--r--agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h133
-rw-r--r--agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c2464
-rw-r--r--agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h210
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib.h8
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters.h6
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c136
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.h17
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable.h6
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c225
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h226
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c330
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h74
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c614
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h109
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c1280
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h146
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_doxygen.conf51
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h39
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c1788
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h102
-rw-r--r--agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h46
-rw-r--r--agent/mibgroup/snmpv3/snmpEngine.c246
-rw-r--r--agent/mibgroup/snmpv3/snmpEngine.h33
-rw-r--r--agent/mibgroup/snmpv3/snmpMPDStats.c69
-rw-r--r--agent/mibgroup/snmpv3/snmpMPDStats.h30
-rw-r--r--agent/mibgroup/snmpv3/snmpMPDStats_5_5.c51
-rw-r--r--agent/mibgroup/snmpv3/snmpMPDStats_5_5.h10
-rw-r--r--agent/mibgroup/snmpv3/usmConf.c9
-rw-r--r--agent/mibgroup/snmpv3/usmConf.h8
-rw-r--r--agent/mibgroup/snmpv3/usmStats.c76
-rw-r--r--agent/mibgroup/snmpv3/usmStats.h35
-rw-r--r--agent/mibgroup/snmpv3/usmStats_5_5.c51
-rw-r--r--agent/mibgroup/snmpv3/usmStats_5_5.h10
-rw-r--r--agent/mibgroup/snmpv3/usmUser.c1608
-rw-r--r--agent/mibgroup/snmpv3/usmUser.h69
-rw-r--r--agent/mibgroup/snmpv3mibs.h16
-rw-r--r--agent/mibgroup/struct.h46
-rw-r--r--agent/mibgroup/target.h5
-rw-r--r--agent/mibgroup/target/snmpTargetAddrEntry.c1704
-rw-r--r--agent/mibgroup/target/snmpTargetAddrEntry.h98
-rw-r--r--agent/mibgroup/target/snmpTargetParamsEntry.c1407
-rw-r--r--agent/mibgroup/target/snmpTargetParamsEntry.h75
-rw-r--r--agent/mibgroup/target/target.c302
-rw-r--r--agent/mibgroup/target/target.h24
-rw-r--r--agent/mibgroup/target/target_counters.c81
-rw-r--r--agent/mibgroup/target/target_counters.h10
-rw-r--r--agent/mibgroup/target/target_counters_5_5.c31
-rw-r--r--agent/mibgroup/target/target_counters_5_5.h3
-rw-r--r--agent/mibgroup/tcp-mib.h7
-rw-r--r--agent/mibgroup/tcp-mib/data_access/Makefile26
-rw-r--r--agent/mibgroup/tcp-mib/data_access/tcpConn.h35
-rw-r--r--agent/mibgroup/tcp-mib/data_access/tcpConn_common.c275
-rw-r--r--agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c223
-rw-r--r--agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c392
-rw-r--r--agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c229
-rw-r--r--agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c211
-rw-r--r--agent/mibgroup/tcp-mib/data_access/tcpConn_private.h6
-rw-r--r--agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c184
-rw-r--r--agent/mibgroup/tcp-mib/tcpConnTable.h8
-rw-r--r--agent/mibgroup/tcp-mib/tcpConnectionTable.h6
-rw-r--r--agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c1135
-rw-r--r--agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h620
-rw-r--r--agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h138
-rw-r--r--agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c326
-rw-r--r--agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h105
-rw-r--r--agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c1825
-rw-r--r--agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h176
-rw-r--r--agent/mibgroup/tcp-mib/tcpListenerTable.h5
-rw-r--r--agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c445
-rw-r--r--agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h271
-rw-r--r--agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h78
-rw-r--r--agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c320
-rw-r--r--agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h73
-rw-r--r--agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c1009
-rw-r--r--agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h98
-rw-r--r--agent/mibgroup/testhandler.c425
-rw-r--r--agent/mibgroup/testhandler.h9
-rw-r--r--agent/mibgroup/tlstm-mib.h11
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h7
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c1438
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h37
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable.h6
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c1377
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h47
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmParamsTable.h6
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c1286
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h30
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmSession.h6
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.c49
-rw-r--r--agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h9
-rw-r--r--agent/mibgroup/tsm-mib.h6
-rw-r--r--agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.c110
-rw-r--r--agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.h14
-rw-r--r--agent/mibgroup/tsm-mib/snmpTsmStats.h6
-rw-r--r--agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c53
-rw-r--r--agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h8
-rw-r--r--agent/mibgroup/tunnel.h6
-rw-r--r--agent/mibgroup/tunnel/tunnel.c1001
-rw-r--r--agent/mibgroup/tunnel/tunnel.h46
-rw-r--r--agent/mibgroup/ucd-snmp/disk.c934
-rw-r--r--agent/mibgroup/ucd-snmp/disk.h31
-rw-r--r--agent/mibgroup/ucd-snmp/disk_hw.c421
-rw-r--r--agent/mibgroup/ucd-snmp/disk_hw.h32
-rw-r--r--agent/mibgroup/ucd-snmp/diskio.c1466
-rw-r--r--agent/mibgroup/ucd-snmp/diskio.h38
-rw-r--r--agent/mibgroup/ucd-snmp/dlmod.c614
-rw-r--r--agent/mibgroup/ucd-snmp/dlmod.h18
-rw-r--r--agent/mibgroup/ucd-snmp/errormib.c228
-rw-r--r--agent/mibgroup/ucd-snmp/errormib.h17
-rw-r--r--agent/mibgroup/ucd-snmp/extensible.c687
-rw-r--r--agent/mibgroup/ucd-snmp/extensible.h33
-rw-r--r--agent/mibgroup/ucd-snmp/file.c184
-rw-r--r--agent/mibgroup/ucd-snmp/file.h38
-rw-r--r--agent/mibgroup/ucd-snmp/hpux.c125
-rw-r--r--agent/mibgroup/ucd-snmp/hpux.h21
-rw-r--r--agent/mibgroup/ucd-snmp/lmSensors.c1071
-rw-r--r--agent/mibgroup/ucd-snmp/lmSensors.h16
-rw-r--r--agent/mibgroup/ucd-snmp/lmsensorsMib.c206
-rw-r--r--agent/mibgroup/ucd-snmp/lmsensorsMib.h23
-rw-r--r--agent/mibgroup/ucd-snmp/loadave.c496
-rw-r--r--agent/mibgroup/ucd-snmp/loadave.h26
-rw-r--r--agent/mibgroup/ucd-snmp/logmatch.c651
-rw-r--r--agent/mibgroup/ucd-snmp/logmatch.h13
-rw-r--r--agent/mibgroup/ucd-snmp/memory.c230
-rw-r--r--agent/mibgroup/ucd-snmp/memory.h37
-rw-r--r--agent/mibgroup/ucd-snmp/memory_aix4.c254
-rw-r--r--agent/mibgroup/ucd-snmp/memory_aix4.h14
-rw-r--r--agent/mibgroup/ucd-snmp/memory_darwin7.c411
-rw-r--r--agent/mibgroup/ucd-snmp/memory_darwin7.h14
-rw-r--r--agent/mibgroup/ucd-snmp/memory_dynix.c229
-rw-r--r--agent/mibgroup/ucd-snmp/memory_dynix.h29
-rw-r--r--agent/mibgroup/ucd-snmp/memory_freebsd2.c389
-rw-r--r--agent/mibgroup/ucd-snmp/memory_freebsd2.h12
-rw-r--r--agent/mibgroup/ucd-snmp/memory_hpux.c293
-rw-r--r--agent/mibgroup/ucd-snmp/memory_hpux.h12
-rw-r--r--agent/mibgroup/ucd-snmp/memory_netbsd1.c257
-rw-r--r--agent/mibgroup/ucd-snmp/memory_netbsd1.h14
-rw-r--r--agent/mibgroup/ucd-snmp/memory_solaris2.c280
-rw-r--r--agent/mibgroup/ucd-snmp/memory_solaris2.h14
-rw-r--r--agent/mibgroup/ucd-snmp/pass.c325
-rw-r--r--agent/mibgroup/ucd-snmp/pass.h26
-rw-r--r--agent/mibgroup/ucd-snmp/pass_common.c264
-rw-r--r--agent/mibgroup/ucd-snmp/pass_common.h20
-rw-r--r--agent/mibgroup/ucd-snmp/pass_persist.c730
-rw-r--r--agent/mibgroup/ucd-snmp/pass_persist.h25
-rw-r--r--agent/mibgroup/ucd-snmp/proc.c876
-rw-r--r--agent/mibgroup/ucd-snmp/proc.h28
-rw-r--r--agent/mibgroup/ucd-snmp/proxy.c705
-rw-r--r--agent/mibgroup/ucd-snmp/proxy.h22
-rw-r--r--agent/mibgroup/ucd-snmp/versioninfo.c219
-rw-r--r--agent/mibgroup/ucd-snmp/versioninfo.h35
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat.c279
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat.h43
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_aix4.c664
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_aix4.h47
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_bsdi4.c288
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_bsdi4.h14
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_darwin7.c324
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_darwin7.h14
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_dynix.c797
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_dynix.h51
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_freebsd2.c400
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_freebsd2.h14
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_hpux.c721
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_hpux.h55
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_linux.c582
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_linux.h41
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_netbsd1.c322
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_netbsd1.h14
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_solaris2.c782
-rw-r--r--agent/mibgroup/ucd-snmp/vmstat_solaris2.h60
-rw-r--r--agent/mibgroup/ucd_snmp.h19
-rw-r--r--agent/mibgroup/udp-mib.h5
-rw-r--r--agent/mibgroup/udp-mib/data_access/udp_endpoint.h34
-rw-r--r--agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c158
-rw-r--r--agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c194
-rw-r--r--agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c313
-rw-r--r--agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c207
-rw-r--r--agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c177
-rw-r--r--agent/mibgroup/udp-mib/data_access/udp_endpoint_private.h7
-rw-r--r--agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c205
-rw-r--r--agent/mibgroup/udp-mib/udpEndpointTable.h5
-rw-r--r--agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c426
-rw-r--r--agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h314
-rw-r--r--agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h85
-rw-r--r--agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c357
-rw-r--r--agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h73
-rw-r--r--agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c1099
-rw-r--r--agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h97
-rw-r--r--agent/mibgroup/util_funcs.c1129
-rw-r--r--agent/mibgroup/util_funcs.h97
-rw-r--r--agent/mibgroup/util_funcs/Exit.c23
-rw-r--r--agent/mibgroup/util_funcs/Exit.h17
-rw-r--r--agent/mibgroup/util_funcs/MIB_STATS_CACHE_TIMEOUT.h12
-rw-r--r--agent/mibgroup/util_funcs/get_pid_from_inode.c186
-rw-r--r--agent/mibgroup/util_funcs/get_pid_from_inode.h34
-rw-r--r--agent/mibgroup/util_funcs/header_generic.c64
-rw-r--r--agent/mibgroup/util_funcs/header_generic.h18
-rw-r--r--agent/mibgroup/util_funcs/header_simple_table.c110
-rw-r--r--agent/mibgroup/util_funcs/header_simple_table.h19
-rw-r--r--agent/mibgroup/util_funcs/restart.c93
-rw-r--r--agent/mibgroup/util_funcs/restart.h15
-rw-r--r--agent/mibgroup/utilities.h3
-rw-r--r--agent/mibgroup/utilities/execute.c408
-rw-r--r--agent/mibgroup/utilities/execute.h11
-rw-r--r--agent/mibgroup/utilities/iquery.c212
-rw-r--r--agent/mibgroup/utilities/iquery.h19
-rw-r--r--agent/mibgroup/utilities/override.c280
-rw-r--r--agent/mibgroup/utilities/override.h7
-rw-r--r--agent/mibgroup/winExtDLL.c1763
-rw-r--r--agent/mibgroup/winExtDLL.h26
-rw-r--r--agent/object_monitor.c757
-rw-r--r--agent/snmp_agent.c3838
-rw-r--r--agent/snmp_perl.c186
-rw-r--r--agent/snmp_perl.h15
-rw-r--r--agent/snmp_perl.pl8
-rw-r--r--agent/snmp_vars.c463
-rw-r--r--agent/snmpd.c1517
-rw-r--r--agent/snmpd.h27
-rw-r--r--apps/Makefile.depend2081
-rw-r--r--apps/Makefile.in230
-rw-r--r--apps/agentxtrap.c607
-rw-r--r--apps/encode_keychange.c803
-rw-r--r--apps/snmp_perl_trapd.pl15
-rw-r--r--apps/snmpbulkget.c250
-rw-r--r--apps/snmpbulkwalk.c386
-rw-r--r--apps/snmpdelta.c748
-rw-r--r--apps/snmpdf.c389
-rw-r--r--apps/snmpget.c255
-rw-r--r--apps/snmpgetnext.c236
-rw-r--r--apps/snmpnetstat/Makefile.depend425
-rw-r--r--apps/snmpnetstat/Makefile.in38
-rw-r--r--apps/snmpnetstat/ffs.c38
-rw-r--r--apps/snmpnetstat/if.c870
-rw-r--r--apps/snmpnetstat/inet.c649
-rw-r--r--apps/snmpnetstat/inet6.c516
-rw-r--r--apps/snmpnetstat/main.c539
-rw-r--r--apps/snmpnetstat/main.h23
-rw-r--r--apps/snmpnetstat/netstat.h94
-rw-r--r--apps/snmpnetstat/route.c487
-rw-r--r--apps/snmpnetstat/winstub.c285
-rw-r--r--apps/snmpnetstat/winstub.h50
-rw-r--r--apps/snmpset.c284
-rw-r--r--apps/snmpstatus.c382
-rw-r--r--apps/snmptable.c1010
-rw-r--r--apps/snmptest.c535
-rw-r--r--apps/snmptls.c559
-rw-r--r--apps/snmptranslate.c367
-rw-r--r--apps/snmptrap.c392
-rw-r--r--apps/snmptrapd.c1464
-rw-r--r--apps/snmptrapd_auth.c182
-rw-r--r--apps/snmptrapd_auth.h16
-rw-r--r--apps/snmptrapd_ds.h19
-rw-r--r--apps/snmptrapd_handlers.c1109
-rw-r--r--apps/snmptrapd_handlers.h68
-rw-r--r--apps/snmptrapd_log.c1802
-rw-r--r--apps/snmptrapd_log.h18
-rw-r--r--apps/snmptrapd_sql.c1118
-rw-r--r--apps/snmpusm.c1023
-rw-r--r--apps/snmpvacm.c711
-rw-r--r--apps/snmpwalk.c432
-rw-r--r--apps/sshtosnmp.c233
-rwxr-xr-xconfig.guess1505
-rwxr-xr-xconfig.sub1739
-rwxr-xr-xconfigure31649
-rw-r--r--configure.ac131
-rw-r--r--configure.d/config_modules_agent814
-rw-r--r--configure.d/config_modules_lib232
-rw-r--r--configure.d/config_modules_security_modules70
-rw-r--r--configure.d/config_modules_transports137
-rw-r--r--configure.d/config_os_functions324
-rw-r--r--configure.d/config_os_headers523
-rw-r--r--configure.d/config_os_libs195
-rw-r--r--configure.d/config_os_libs2487
-rw-r--r--configure.d/config_os_misc124
-rw-r--r--configure.d/config_os_misc2142
-rw-r--r--configure.d/config_os_misc320
-rw-r--r--configure.d/config_os_misc4319
-rw-r--r--configure.d/config_os_progs437
-rw-r--r--configure.d/config_os_struct_members754
-rw-r--r--configure.d/config_project_ipv6_types208
-rw-r--r--configure.d/config_project_manual170
-rw-r--r--configure.d/config_project_paths101
-rw-r--r--configure.d/config_project_perl_python379
-rw-r--r--configure.d/config_project_types57
-rw-r--r--configure.d/config_project_with_enable1150
-rw-r--r--dist/Makefile133
-rw-r--r--dist/README.build-scripts108
-rw-r--r--dist/RELEASE-INSTRUCTIONS1001
-rw-r--r--dist/autoconf-version1
-rwxr-xr-xdist/changelogfix94
-rwxr-xr-xdist/check-api-change54
-rwxr-xr-xdist/cvsshow69
-rwxr-xr-xdist/cvsup118
-rwxr-xr-xdist/extractnews183
-rwxr-xr-xdist/find-requires5
-rw-r--r--dist/generation-scripts/gen-security-headers.in29
-rw-r--r--dist/generation-scripts/gen-transport-headers.in27
-rw-r--r--dist/generation-scripts/gen-variables.in10
-rw-r--r--dist/makerelease.xml726
-rw-r--r--dist/net-snmp-solaris-build/DEVENV44
-rw-r--r--dist/net-snmp-solaris-build/README19
-rw-r--r--dist/net-snmp-solaris-build/buildpackage-solaris182
-rwxr-xr-xdist/net-snmp-solaris-build/elfdepend.sh87
-rw-r--r--dist/net-snmp.spec303
-rwxr-xr-xdist/nsb-config82
-rw-r--r--dist/nsb-functions508
-rwxr-xr-xdist/nsb-nightly188
-rwxr-xr-xdist/nsb-package137
-rwxr-xr-xdist/nsb-platform27
-rwxr-xr-xdist/patme351
-rw-r--r--dist/release8
-rwxr-xr-xdist/run-autoconf32
-rw-r--r--dist/schema-snmptrapd.sql31
-rwxr-xr-xdist/snmpd-init.d73
-rw-r--r--dist/snmptrapd-init.d73
-rwxr-xr-xdist/svnup130
-rw-r--r--dotgdbinit138
-rw-r--r--doxygen.conf838
-rw-r--r--include/net-snmp/agent/agent_callbacks.h21
-rw-r--r--include/net-snmp/agent/agent_handler.h283
-rw-r--r--include/net-snmp/agent/agent_index.h46
-rw-r--r--include/net-snmp/agent/agent_read_config.h31
-rw-r--r--include/net-snmp/agent/agent_registry.h184
-rw-r--r--include/net-snmp/agent/agent_sysORTable.h28
-rw-r--r--include/net-snmp/agent/agent_trap.h54
-rw-r--r--include/net-snmp/agent/all_helpers.h43
-rw-r--r--include/net-snmp/agent/auto_nlist.h28
-rw-r--r--include/net-snmp/agent/baby_steps.h117
-rw-r--r--include/net-snmp/agent/bulk_to_next.h28
-rw-r--r--include/net-snmp/agent/cache_handler.h130
-rw-r--r--include/net-snmp/agent/debug_handler.h16
-rw-r--r--include/net-snmp/agent/ds_agent.h74
-rw-r--r--include/net-snmp/agent/hardware/cpu.h68
-rw-r--r--include/net-snmp/agent/hardware/fsys.h109
-rw-r--r--include/net-snmp/agent/hardware/memory.h39
-rw-r--r--include/net-snmp/agent/hardware/sensors.h48
-rw-r--r--include/net-snmp/agent/instance.h145
-rw-r--r--include/net-snmp/agent/mfd.h84
-rw-r--r--include/net-snmp/agent/mib_modules.h23
-rw-r--r--include/net-snmp/agent/mode_end_call.h39
-rw-r--r--include/net-snmp/agent/multiplexer.h39
-rw-r--r--include/net-snmp/agent/net-snmp-agent-includes.h22
-rw-r--r--include/net-snmp/agent/null.h26
-rw-r--r--include/net-snmp/agent/object_monitor.h186
-rw-r--r--include/net-snmp/agent/old_api.h49
-rw-r--r--include/net-snmp/agent/read_only.h29
-rw-r--r--include/net-snmp/agent/row_merge.h38
-rw-r--r--include/net-snmp/agent/scalar.h36
-rw-r--r--include/net-snmp/agent/scalar_group.h36
-rw-r--r--include/net-snmp/agent/serialize.h24
-rw-r--r--include/net-snmp/agent/set_helper.h25
-rw-r--r--include/net-snmp/agent/snmp_agent.h322
-rw-r--r--include/net-snmp/agent/snmp_get_statistic.h20
-rw-r--r--include/net-snmp/agent/snmp_vars.h138
-rw-r--r--include/net-snmp/agent/stash_cache.h35
-rw-r--r--include/net-snmp/agent/stash_to_next.h24
-rw-r--r--include/net-snmp/agent/sysORTable.h62
-rw-r--r--include/net-snmp/agent/table.h200
-rw-r--r--include/net-snmp/agent/table_array.h158
-rw-r--r--include/net-snmp/agent/table_container.h108
-rw-r--r--include/net-snmp/agent/table_data.h124
-rw-r--r--include/net-snmp/agent/table_dataset.h196
-rw-r--r--include/net-snmp/agent/table_iterator.h165
-rw-r--r--include/net-snmp/agent/table_tdata.h147
-rw-r--r--include/net-snmp/agent/var_struct.h116
-rw-r--r--include/net-snmp/agent/watcher.h148
-rw-r--r--include/net-snmp/config_api.h100
-rw-r--r--include/net-snmp/data_access/arp.h146
-rw-r--r--include/net-snmp/data_access/defaultrouter.h114
-rw-r--r--include/net-snmp/data_access/interface.h306
-rw-r--r--include/net-snmp/data_access/ip_scalars.h19
-rw-r--r--include/net-snmp/data_access/ipaddress.h168
-rw-r--r--include/net-snmp/data_access/ipstats.h110
-rw-r--r--include/net-snmp/data_access/net-snmp-data-access-includes.h14
-rw-r--r--include/net-snmp/data_access/route.h158
-rw-r--r--include/net-snmp/data_access/scopezone.h68
-rw-r--r--include/net-snmp/data_access/swinst.h77
-rw-r--r--include/net-snmp/data_access/swrun.h104
-rw-r--r--include/net-snmp/data_access/systemstats.h106
-rw-r--r--include/net-snmp/data_access/tcpConn.h130
-rw-r--r--include/net-snmp/data_access/udp_endpoint.h100
-rw-r--r--include/net-snmp/definitions.h32
-rw-r--r--include/net-snmp/library/README67
-rw-r--r--include/net-snmp/library/asn1.h455
-rw-r--r--include/net-snmp/library/callback.h85
-rw-r--r--include/net-snmp/library/cert_util.h226
-rw-r--r--include/net-snmp/library/check_varbind.h53
-rw-r--r--include/net-snmp/library/container.h501
-rw-r--r--include/net-snmp/library/container_binary_array.h46
-rw-r--r--include/net-snmp/library/container_iterator.h62
-rw-r--r--include/net-snmp/library/container_list_ssll.h27
-rw-r--r--include/net-snmp/library/container_null.h21
-rw-r--r--include/net-snmp/library/data_list.h105
-rw-r--r--include/net-snmp/library/default_store.h214
-rw-r--r--include/net-snmp/library/dir_utils.h63
-rw-r--r--include/net-snmp/library/factory.h72
-rw-r--r--include/net-snmp/library/fd_event_manager.h134
-rw-r--r--include/net-snmp/library/file_utils.h88
-rw-r--r--include/net-snmp/library/getopt.h24
-rw-r--r--include/net-snmp/library/int64.h43
-rw-r--r--include/net-snmp/library/keytools.h64
-rw-r--r--include/net-snmp/library/large_fd_set.h171
-rw-r--r--include/net-snmp/library/lcd_time.h137
-rw-r--r--include/net-snmp/library/libsnmp.h174
-rw-r--r--include/net-snmp/library/md5.h71
-rw-r--r--include/net-snmp/library/mib.h518
-rw-r--r--include/net-snmp/library/mt_support.h89
-rw-r--r--include/net-snmp/library/oid.h18
-rw-r--r--include/net-snmp/library/oid_stash.h82
-rw-r--r--include/net-snmp/library/openssl_aes.h140
-rw-r--r--include/net-snmp/library/openssl_des.h236
-rw-r--r--include/net-snmp/library/openssl_md5.h116
-rw-r--r--include/net-snmp/library/openssl_sha.h199
-rw-r--r--include/net-snmp/library/parse.h250
-rw-r--r--include/net-snmp/library/read_config.h156
-rw-r--r--include/net-snmp/library/scapi.h107
-rw-r--r--include/net-snmp/library/snmp-tc.h66
-rw-r--r--include/net-snmp/library/snmp.h360
-rw-r--r--include/net-snmp/library/snmpAAL5PVCDomain.h39
-rw-r--r--include/net-snmp/library/snmpAliasDomain.h32
-rw-r--r--include/net-snmp/library/snmpCallbackDomain.h73
-rw-r--r--include/net-snmp/library/snmpDTLSUDPDomain.h41
-rw-r--r--include/net-snmp/library/snmpIPXDomain.h38
-rw-r--r--include/net-snmp/library/snmpIPv4BaseDomain.h37
-rw-r--r--include/net-snmp/library/snmpIPv6BaseDomain.h34
-rw-r--r--include/net-snmp/library/snmpSSHDomain.h41
-rw-r--r--include/net-snmp/library/snmpSTDDomain.h41
-rw-r--r--include/net-snmp/library/snmpSocketBaseDomain.h25
-rw-r--r--include/net-snmp/library/snmpTCPBaseDomain.h22
-rw-r--r--include/net-snmp/library/snmpTCPDomain.h41
-rw-r--r--include/net-snmp/library/snmpTCPIPv6Domain.h38
-rw-r--r--include/net-snmp/library/snmpTLSBaseDomain.h83
-rw-r--r--include/net-snmp/library/snmpTLSTCPDomain.h39
-rw-r--r--include/net-snmp/library/snmpUDPBaseDomain.h50
-rw-r--r--include/net-snmp/library/snmpUDPDomain.h63
-rw-r--r--include/net-snmp/library/snmpUDPIPv4BaseDomain.h44
-rw-r--r--include/net-snmp/library/snmpUDPIPv6Domain.h61
-rw-r--r--include/net-snmp/library/snmpUnixDomain.h65
-rw-r--r--include/net-snmp/library/snmp_alarm.h71
-rw-r--r--include/net-snmp/library/snmp_api.h713
-rw-r--r--include/net-snmp/library/snmp_assert.h127
-rw-r--r--include/net-snmp/library/snmp_client.h167
-rw-r--r--include/net-snmp/library/snmp_debug.h243
-rw-r--r--include/net-snmp/library/snmp_enum.h115
-rw-r--r--include/net-snmp/library/snmp_impl.h146
-rw-r--r--include/net-snmp/library/snmp_logging.h126
-rw-r--r--include/net-snmp/library/snmp_openssl.h46
-rw-r--r--include/net-snmp/library/snmp_parse_args.h93
-rw-r--r--include/net-snmp/library/snmp_secmod.h180
-rw-r--r--include/net-snmp/library/snmp_service.h39
-rw-r--r--include/net-snmp/library/snmp_transport.h317
-rw-r--r--include/net-snmp/library/snmpksm.h35
-rw-r--r--include/net-snmp/library/snmptsm.h33
-rw-r--r--include/net-snmp/library/snmpusm.h281
-rw-r--r--include/net-snmp/library/snmpv3.h61
-rw-r--r--include/net-snmp/library/system.h215
-rw-r--r--include/net-snmp/library/testing.h16
-rw-r--r--include/net-snmp/library/text_utils.h113
-rw-r--r--include/net-snmp/library/tools.h315
-rw-r--r--include/net-snmp/library/transform_oids.h39
-rw-r--r--include/net-snmp/library/types.h70
-rw-r--r--include/net-snmp/library/ucd_compat.h51
-rw-r--r--include/net-snmp/library/vacm.h266
-rw-r--r--include/net-snmp/library/winpipe.h44
-rw-r--r--include/net-snmp/library/winservice.h159
-rw-r--r--include/net-snmp/machine/generic.h3
-rw-r--r--include/net-snmp/mib_api.h113
-rw-r--r--include/net-snmp/net-snmp-config.h.in2442
-rw-r--r--include/net-snmp/net-snmp-features.h32
-rw-r--r--include/net-snmp/net-snmp-includes.h80
-rw-r--r--include/net-snmp/openssl_md5.h116
-rw-r--r--include/net-snmp/output_api.h157
-rw-r--r--include/net-snmp/pdu_api.h46
-rw-r--r--include/net-snmp/session_api.h311
-rw-r--r--include/net-snmp/snmpv3_api.h38
-rw-r--r--include/net-snmp/system/aix.h27
-rw-r--r--include/net-snmp/system/bsd.h20
-rw-r--r--include/net-snmp/system/bsdi.h3
-rw-r--r--include/net-snmp/system/bsdi3.h2
-rw-r--r--include/net-snmp/system/bsdi4.h11
-rw-r--r--include/net-snmp/system/cygwin.h12
-rw-r--r--include/net-snmp/system/darwin.h8
-rw-r--r--include/net-snmp/system/darwin10.h148
-rw-r--r--include/net-snmp/system/darwin11.h161
-rw-r--r--include/net-snmp/system/darwin12.h161
-rw-r--r--include/net-snmp/system/darwin7.h15
-rw-r--r--include/net-snmp/system/darwin8.h94
-rw-r--r--include/net-snmp/system/darwin9.h148
-rw-r--r--include/net-snmp/system/dragonfly.h25
-rw-r--r--include/net-snmp/system/dynix.h106
-rw-r--r--include/net-snmp/system/freebsd.h27
-rw-r--r--include/net-snmp/system/freebsd10.h3
-rw-r--r--include/net-snmp/system/freebsd2.h10
-rw-r--r--include/net-snmp/system/freebsd3.h11
-rw-r--r--include/net-snmp/system/freebsd4.h23
-rw-r--r--include/net-snmp/system/freebsd5.h8
-rw-r--r--include/net-snmp/system/freebsd6.h3
-rw-r--r--include/net-snmp/system/freebsd7.h3
-rw-r--r--include/net-snmp/system/freebsd8.h3
-rw-r--r--include/net-snmp/system/freebsd9.h3
-rw-r--r--include/net-snmp/system/generic.h78
-rw-r--r--include/net-snmp/system/hpux.h94
-rw-r--r--include/net-snmp/system/irix.h33
-rw-r--r--include/net-snmp/system/kfreebsd.h9
-rw-r--r--include/net-snmp/system/linux.h23
-rw-r--r--include/net-snmp/system/mingw32.h93
-rw-r--r--include/net-snmp/system/mingw32msvc.h10
-rw-r--r--include/net-snmp/system/mips.h4
-rw-r--r--include/net-snmp/system/netbsd.h75
-rw-r--r--include/net-snmp/system/nto-qnx6.h35
-rw-r--r--include/net-snmp/system/openbsd.h18
-rw-r--r--include/net-snmp/system/openbsd4.h3
-rw-r--r--include/net-snmp/system/openbsd5.h3
-rw-r--r--include/net-snmp/system/osf5.h28
-rw-r--r--include/net-snmp/system/solaris.h43
-rw-r--r--include/net-snmp/system/solaris2.3.h1
-rw-r--r--include/net-snmp/system/solaris2.4.h1
-rw-r--r--include/net-snmp/system/solaris2.5.h4
-rw-r--r--include/net-snmp/system/solaris2.6.h2
-rw-r--r--include/net-snmp/system/sunos.h12
-rw-r--r--include/net-snmp/system/svr5.h20
-rw-r--r--include/net-snmp/system/sysv.h2
-rw-r--r--include/net-snmp/system/ultrix4.h9
-rw-r--r--include/net-snmp/types.h427
-rw-r--r--include/net-snmp/utilities.h63
-rw-r--r--include/net-snmp/varbind_api.h105
-rw-r--r--include/net-snmp/version.h18
-rw-r--r--include/ucd-snmp/README3
-rw-r--r--include/ucd-snmp/agent_index.h9
-rw-r--r--include/ucd-snmp/agent_read_config.h9
-rw-r--r--include/ucd-snmp/agent_registry.h9
-rw-r--r--include/ucd-snmp/agent_trap.h9
-rw-r--r--include/ucd-snmp/asn1.h9
-rw-r--r--include/ucd-snmp/auto_nlist.h9
-rw-r--r--include/ucd-snmp/callback.h9
-rw-r--r--include/ucd-snmp/default_store.h88
-rw-r--r--include/ucd-snmp/ds_agent.h9
-rw-r--r--include/ucd-snmp/header_complex.h9
-rw-r--r--include/ucd-snmp/int64.h9
-rw-r--r--include/ucd-snmp/keytools.h9
-rw-r--r--include/ucd-snmp/mib.h9
-rw-r--r--include/ucd-snmp/mib_module_config.h9
-rw-r--r--include/ucd-snmp/mibincl.h9
-rw-r--r--include/ucd-snmp/parse.h9
-rw-r--r--include/ucd-snmp/read_config.h9
-rw-r--r--include/ucd-snmp/scapi.h9
-rw-r--r--include/ucd-snmp/snmp-tc.h9
-rw-r--r--include/ucd-snmp/snmp.h9
-rw-r--r--include/ucd-snmp/snmp_agent.h9
-rw-r--r--include/ucd-snmp/snmp_alarm.h9
-rw-r--r--include/ucd-snmp/snmp_api.h9
-rw-r--r--include/ucd-snmp/snmp_client.h9
-rw-r--r--include/ucd-snmp/snmp_debug.h9
-rw-r--r--include/ucd-snmp/snmp_impl.h11
-rw-r--r--include/ucd-snmp/snmp_logging.h9
-rw-r--r--include/ucd-snmp/snmp_parse_args.h9
-rw-r--r--include/ucd-snmp/snmp_vars.h9
-rw-r--r--include/ucd-snmp/snmpusm.h9
-rw-r--r--include/ucd-snmp/snmpv3.h9
-rw-r--r--include/ucd-snmp/struct.h9
-rw-r--r--include/ucd-snmp/system.h9
-rw-r--r--include/ucd-snmp/tools.h9
-rw-r--r--include/ucd-snmp/transform_oids.h9
-rw-r--r--include/ucd-snmp/ucd-snmp-agent-includes.h9
-rw-r--r--include/ucd-snmp/ucd-snmp-config.h2
-rw-r--r--include/ucd-snmp/ucd-snmp-includes.h9
-rw-r--r--include/ucd-snmp/util_funcs.h9
-rw-r--r--include/ucd-snmp/var_struct.h9
-rw-r--r--include/ucd-snmp/version.h11
-rwxr-xr-xinstall-sh524
-rwxr-xr-xlocal/FAQ2HTML113
-rw-r--r--local/Makefile.in173
-rw-r--r--local/README.mib2c224
-rwxr-xr-xlocal/Version-Munge.pl170
-rw-r--r--local/certgen-test.pl66
-rwxr-xr-xlocal/convertcode132
-rwxr-xr-xlocal/fixproc694
-rw-r--r--local/gittools/shell-functions443
-rwxr-xr-xlocal/html-add-header-footer.pl212
-rwxr-xr-xlocal/html-textfile-fix.pl62
-rwxr-xr-xlocal/ipf-mod.pl227
-rwxr-xr-xlocal/mib2c1275
-rw-r--r--local/mib2c-conf.d/default-mfd-top.m2c141
-rw-r--r--local/mib2c-conf.d/details-enums.m2i80
-rw-r--r--local/mib2c-conf.d/details-node.m2i102
-rw-r--r--local/mib2c-conf.d/details-table.m2i25
-rw-r--r--local/mib2c-conf.d/generic-ctx-copy.m2i33
-rw-r--r--local/mib2c-conf.d/generic-ctx-get.m2i106
-rw-r--r--local/mib2c-conf.d/generic-ctx-set.m2i29
-rw-r--r--local/mib2c-conf.d/generic-data-allocate.m2i62
-rw-r--r--local/mib2c-conf.d/generic-data-context.m2i51
-rw-r--r--local/mib2c-conf.d/generic-get-U64.m2i14
-rw-r--r--local/mib2c-conf.d/generic-get-char.m2i49
-rw-r--r--local/mib2c-conf.d/generic-get-decl-bot.m2i22
-rw-r--r--local/mib2c-conf.d/generic-get-decl.m2i43
-rw-r--r--local/mib2c-conf.d/generic-get-long.m2i14
-rw-r--r--local/mib2c-conf.d/generic-get-oid.m2i18
-rw-r--r--local/mib2c-conf.d/generic-header-bottom.m2i21
-rw-r--r--local/mib2c-conf.d/generic-header-top.m2i22
-rw-r--r--local/mib2c-conf.d/generic-source-includes.m2i24
-rw-r--r--local/mib2c-conf.d/generic-table-constants.m2c44
-rw-r--r--local/mib2c-conf.d/generic-table-enums.m2c63
-rw-r--r--local/mib2c-conf.d/generic-table-indexes-from-oid.m2i70
-rw-r--r--local/mib2c-conf.d/generic-table-indexes-set.m2i123
-rw-r--r--local/mib2c-conf.d/generic-table-indexes-to-oid.m2i52
-rw-r--r--local/mib2c-conf.d/generic-table-indexes-varbind-setup.m2i51
-rw-r--r--local/mib2c-conf.d/generic-table-indexes.m2i67
-rw-r--r--local/mib2c-conf.d/generic-table-oids.m2c113
-rw-r--r--local/mib2c-conf.d/generic-value-map-func.m2i104
-rw-r--r--local/mib2c-conf.d/generic-value-map-reverse.m2i49
-rw-r--r--local/mib2c-conf.d/generic-value-map.m2i46
-rw-r--r--local/mib2c-conf.d/m2c-internal-warning.m2i21
-rw-r--r--local/mib2c-conf.d/m2c_setup_enum.m2i24
-rw-r--r--local/mib2c-conf.d/m2c_setup_node.m2i260
-rw-r--r--local/mib2c-conf.d/m2c_setup_table.m2i48
-rw-r--r--local/mib2c-conf.d/m2c_table_save_defaults.m2i117
-rw-r--r--local/mib2c-conf.d/mfd-access-container-cached-defines.m2i576
-rw-r--r--local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i1198
-rw-r--r--local/mib2c-conf.d/mfd-data-access.m2c331
-rw-r--r--local/mib2c-conf.d/mfd-data-get.m2c168
-rw-r--r--local/mib2c-conf.d/mfd-data-set.m2c142
-rw-r--r--local/mib2c-conf.d/mfd-doxygen.m2c60
-rw-r--r--local/mib2c-conf.d/mfd-interactive-setup.m2c335
-rw-r--r--local/mib2c-conf.d/mfd-interface.m2c1718
-rw-r--r--local/mib2c-conf.d/mfd-makefile.m2m139
-rw-r--r--local/mib2c-conf.d/mfd-persistence.m2i478
-rw-r--r--local/mib2c-conf.d/mfd-readme.m2c846
-rw-r--r--local/mib2c-conf.d/mfd-top.m2c605
-rw-r--r--local/mib2c-conf.d/node-get.m2i107
-rw-r--r--local/mib2c-conf.d/node-set.m2i236
-rw-r--r--local/mib2c-conf.d/node-storage.m2i21
-rw-r--r--local/mib2c-conf.d/node-validate.m2i71
-rw-r--r--local/mib2c-conf.d/node-varbind-validate.m2i54
-rw-r--r--local/mib2c-conf.d/parent-dependencies.m2i63
-rw-r--r--local/mib2c-conf.d/parent-set.m2i417
-rw-r--r--local/mib2c-conf.d/subagent.m2c195
-rw-r--r--local/mib2c-conf.d/syntax-COUNTER64-get.m2i35
-rw-r--r--local/mib2c-conf.d/syntax-DateAndTime-get.m2d9
-rw-r--r--local/mib2c-conf.d/syntax-DateAndTime-get.m2i54
-rw-r--r--local/mib2c-conf.d/syntax-DateAndTime-readme.m2i4
-rw-r--r--local/mib2c-conf.d/syntax-InetAddress-get.m2i100
-rw-r--r--local/mib2c-conf.d/syntax-InetAddress-set.m2i22
-rw-r--r--local/mib2c-conf.d/syntax-InetAddressType-get.m2i25
-rw-r--r--local/mib2c-conf.d/syntax-InetAddressType-set.m2i25
-rw-r--r--local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i113
-rw-r--r--local/mib2c-conf.d/syntax-RowStatus-get.m2i65
-rw-r--r--local/mib2c-conf.d/syntax-RowStatus-varbind-validate.m2i16
-rw-r--r--local/mib2c-conf.d/syntax-StorageType-dependencies.m2i19
-rw-r--r--local/mib2c-conf.d/syntax-TestAndIncr-get.m2i22
-rwxr-xr-xlocal/mib2c-update366
-rw-r--r--local/mib2c.access_functions.conf183
-rw-r--r--local/mib2c.array-user.conf1305
-rw-r--r--local/mib2c.check_values.conf154
-rw-r--r--local/mib2c.check_values_local.conf72
-rw-r--r--local/mib2c.column_defines.conf15
-rw-r--r--local/mib2c.column_enums.conf34
-rw-r--r--local/mib2c.column_storage.conf23
-rw-r--r--local/mib2c.conf308
-rw-r--r--local/mib2c.container.conf864
-rw-r--r--local/mib2c.create-dataset.conf111
-rw-r--r--local/mib2c.emulation.conf246
-rw-r--r--local/mib2c.genhtml.conf370
-rw-r--r--local/mib2c.int_watch.conf106
-rw-r--r--local/mib2c.iterate.conf716
-rw-r--r--local/mib2c.iterate_access.conf424
-rw-r--r--local/mib2c.mfd.conf32
-rw-r--r--local/mib2c.notify.conf85
-rw-r--r--local/mib2c.old-api.conf349
-rwxr-xr-xlocal/mib2c.perl.conf314
-rw-r--r--local/mib2c.raw-table.conf612
-rwxr-xr-xlocal/mib2c.row.conf284
-rw-r--r--local/mib2c.scalar.conf142
-rw-r--r--local/mib2c.table_data.conf742
-rwxr-xr-xlocal/minimalist/feature-check126
-rw-r--r--local/minimalist/feature-makedocs221
-rwxr-xr-xlocal/minimalist/feature-remove128
-rwxr-xr-xlocal/minimalist/find-unused-code117
-rw-r--r--local/minimalist/ignore.regexp4
-rwxr-xr-xlocal/minimalist/remove-unneeded-modules130
-rwxr-xr-xlocal/minimalist/removeifdefcode.pl333
-rw-r--r--local/minimalist/sizetests359
-rwxr-xr-xlocal/net-snmp-cert2690
-rw-r--r--local/net-snmp-cert.conf72
-rwxr-xr-xlocal/pass_persisttest98
-rwxr-xr-xlocal/passtest82
-rwxr-xr-xlocal/passtest.pl74
-rw-r--r--local/snmp-bridge-mib1170
-rwxr-xr-xlocal/snmp-ucd.sh187
-rwxr-xr-xlocal/snmpcheck.def1224
-rwxr-xr-xlocal/snmpconf933
-rw-r--r--local/snmpconf.dir/snmp-data/authopts77
-rw-r--r--local/snmpconf.dir/snmp-data/debugging39
-rw-r--r--local/snmpconf.dir/snmp-data/mibs56
-rw-r--r--local/snmpconf.dir/snmp-data/output79
-rw-r--r--local/snmpconf.dir/snmp-data/snmpconf-config1
-rw-r--r--local/snmpconf.dir/snmpd-data/acl36
-rw-r--r--local/snmpconf.dir/snmpd-data/basic_setup17
-rw-r--r--local/snmpconf.dir/snmpd-data/extending68
-rw-r--r--local/snmpconf.dir/snmpd-data/monitor72
-rw-r--r--local/snmpconf.dir/snmpd-data/operation32
-rw-r--r--local/snmpconf.dir/snmpd-data/snmpconf-config1
-rw-r--r--local/snmpconf.dir/snmpd-data/system43
-rw-r--r--local/snmpconf.dir/snmpd-data/trapsinks46
-rw-r--r--local/snmpconf.dir/snmptrapd-data/authentication8
-rw-r--r--local/snmpconf.dir/snmptrapd-data/formatting15
-rw-r--r--local/snmpconf.dir/snmptrapd-data/logging26
-rw-r--r--local/snmpconf.dir/snmptrapd-data/runtime13
-rw-r--r--local/snmpconf.dir/snmptrapd-data/snmpconf-config1
-rw-r--r--local/snmpconf.dir/snmptrapd-data/traphandle17
-rwxr-xr-xlocal/snmpdump.pl107
-rwxr-xr-xlocal/tkmib994
-rwxr-xr-xlocal/traptoemail74
-rwxr-xr-xltmain.sh9637
-rw-r--r--m4/ac_add_search_path.m413
-rw-r--r--m4/ac_msg_cache.m424
-rw-r--r--m4/ac_msg_module_dbg.m47
-rw-r--r--m4/ac_prompt_user.m452
-rw-r--r--m4/libtool.m47831
-rw-r--r--m4/ltoptions.m4369
-rw-r--r--m4/ltsugar.m4123
-rw-r--r--m4/ltversion.m423
-rw-r--r--m4/lt~obsolete.m498
-rw-r--r--m4/netsnmp_arg.m427
-rw-r--r--m4/netsnmp_search_libs.m435
-rwxr-xr-xmaketarget63
-rw-r--r--man/Makefile.in278
-rw-r--r--man/agentxtrap.1.def110
-rw-r--r--man/default_store.3.bot120
-rw-r--r--man/default_store.3.top83
-rw-r--r--man/encode_keychange.1.def71
-rw-r--r--man/fixproc.1.def40
-rw-r--r--man/make_index.pl70
-rw-r--r--man/man_sections.txt158
-rw-r--r--man/mib2c-update.1.def28
-rw-r--r--man/mib2c.1.def227
-rw-r--r--man/mib2c.conf.5.in52
-rw-r--r--man/mib2c.extract.pl43
-rw-r--r--man/net-snmp-config.1.def87
-rw-r--r--man/net-snmp-create-v3-user.1.def28
-rw-r--r--man/netsnmp_agent_api.3.def132
-rw-r--r--man/netsnmp_config_api.3.def373
-rw-r--r--man/netsnmp_mib_api.3.def310
-rw-r--r--man/netsnmp_pdu_api.3.def30
-rw-r--r--man/netsnmp_sess_api.3.def235
-rw-r--r--man/netsnmp_session_api.3.def281
-rw-r--r--man/netsnmp_trap_api.3.def58
-rw-r--r--man/netsnmp_varbind_api.3.def216
-rw-r--r--man/snmp-bridge-mib.1208
-rw-r--r--man/snmp.conf.5.def414
-rw-r--r--man/snmp_alarm.3.def170
-rw-r--r--man/snmp_config.5.def202
-rw-r--r--man/snmpbulkget.1.def64
-rw-r--r--man/snmpbulkwalk.1.def134
-rw-r--r--man/snmpcmd.1.def916
-rw-r--r--man/snmpconf.1.def130
-rw-r--r--man/snmpd.8.def355
-rw-r--r--man/snmpd.conf.5.def1769
-rw-r--r--man/snmpd.examples.5.def655
-rw-r--r--man/snmpd.internal.5.def92
-rw-r--r--man/snmpdelta.1.def160
-rw-r--r--man/snmpdf.1.def71
-rw-r--r--man/snmpget.1.def118
-rw-r--r--man/snmpgetnext.1.def77
-rw-r--r--man/snmpinform.11
-rw-r--r--man/snmpnetstat.1.def314
-rw-r--r--man/snmpset.1.def110
-rw-r--r--man/snmpstatus.1.def112
-rw-r--r--man/snmptable.1.def167
-rw-r--r--man/snmptest.1.def278
-rw-r--r--man/snmptranslate.1.def288
-rw-r--r--man/snmptrap.1.def130
-rw-r--r--man/snmptrapd.8.def320
-rw-r--r--man/snmptrapd.conf.5.def266
-rw-r--r--man/snmpusm.1.def267
-rw-r--r--man/snmpvacm.1.def373
-rw-r--r--man/snmpwalk.1.def142
-rw-r--r--man/tkmib.1.def15
-rw-r--r--man/traptoemail.1.def22
-rw-r--r--man/variables.5.def178
-rw-r--r--mibs/LM-SENSORS-MIB.txt230
-rw-r--r--mibs/Makefile.in80
-rw-r--r--mibs/Makefile.mib225
-rw-r--r--mibs/NET-SNMP-AGENT-MIB.txt554
-rw-r--r--mibs/NET-SNMP-EXAMPLES-MIB.txt285
-rw-r--r--mibs/NET-SNMP-EXTEND-MIB.txt325
-rw-r--r--mibs/NET-SNMP-MIB.txt67
-rw-r--r--mibs/NET-SNMP-MONITOR-MIB.txt59
-rw-r--r--mibs/NET-SNMP-PASS-MIB.txt124
-rw-r--r--mibs/NET-SNMP-PERIODIC-NOTIFY-MIB.txt83
-rw-r--r--mibs/NET-SNMP-SYSTEM-MIB.txt63
-rw-r--r--mibs/NET-SNMP-TC.txt128
-rw-r--r--mibs/NET-SNMP-VACM-MIB.txt154
-rw-r--r--mibs/README.mibs47
-rw-r--r--mibs/UCD-DEMO-MIB.inc11
-rw-r--r--mibs/UCD-DEMO-MIB.txt74
-rw-r--r--mibs/UCD-DISKIO-MIB.inc11
-rw-r--r--mibs/UCD-DISKIO-MIB.txt171
-rw-r--r--mibs/UCD-DLMOD-MIB.inc8
-rw-r--r--mibs/UCD-DLMOD-MIB.txt124
-rw-r--r--mibs/UCD-IPFILTER-MIB.inc8
-rw-r--r--mibs/UCD-IPFILTER-MIB.txt261
-rw-r--r--mibs/UCD-IPFWACC-MIB.inc11
-rw-r--r--mibs/UCD-IPFWACC-MIB.txt327
-rw-r--r--mibs/UCD-SNMP-MIB-OLD.txt744
-rw-r--r--mibs/UCD-SNMP-MIB.inc9
-rw-r--r--mibs/UCD-SNMP-MIB.txt1768
-rw-r--r--mibs/ianalist15
-rw-r--r--mibs/makehtml.pl112
-rwxr-xr-xmibs/mibfetch51
-rw-r--r--mibs/nodemap6
-rw-r--r--mibs/rfclist265
-rw-r--r--mibs/rfcmibs.diff499
-rwxr-xr-xmibs/smistrip179
-rwxr-xr-xmkinstalldirs40
-rw-r--r--net-snmp-config.in700
-rw-r--r--net-snmp-create-v3-user.in168
-rw-r--r--ov/Makefile.in15
-rw-r--r--ov/README31
-rw-r--r--ov/UCD-Computer9
-rw-r--r--ov/UCD-fields32
-rw-r--r--ov/bitmaps/UCD.20.m8
-rw-r--r--ov/bitmaps/UCD.20.p8
-rw-r--r--ov/bitmaps/UCD.26.m12
-rw-r--r--ov/bitmaps/UCD.26.p12
-rw-r--r--ov/bitmaps/UCD.32.m14
-rw-r--r--ov/bitmaps/UCD.32.p14
-rw-r--r--ov/bitmaps/UCD.38.m19
-rw-r--r--ov/bitmaps/UCD.38.p19
-rw-r--r--ov/bitmaps/UCD.44.m25
-rw-r--r--ov/bitmaps/UCD.44.p25
-rw-r--r--ov/bitmaps/UCD.50.m33
-rw-r--r--ov/bitmaps/UCD.50.p33
-rw-r--r--ov/bitmaps/UCD.fields21
-rw-r--r--ov/oid_to_sym.in18
-rw-r--r--ov/oid_to_type.in18
-rw-r--r--perl/ASN/ASN.pm163
-rw-r--r--perl/ASN/ASN.xs177
-rw-r--r--perl/ASN/Changes6
-rw-r--r--perl/ASN/MANIFEST6
-rw-r--r--perl/ASN/Makefile.PL233
-rw-r--r--perl/ASN/netsnmp-feature-definitions.h0
-rw-r--r--perl/ASN/test.pl28
-rw-r--r--perl/AnyData_SNMP/Changes1
-rw-r--r--perl/AnyData_SNMP/DBD_AnyData.patch48
-rw-r--r--perl/AnyData_SNMP/Format.pm109
-rw-r--r--perl/AnyData_SNMP/INSTALL44
-rw-r--r--perl/AnyData_SNMP/MANIFEST7
-rw-r--r--perl/AnyData_SNMP/Makefile.PL14
-rw-r--r--perl/AnyData_SNMP/README21
-rw-r--r--perl/AnyData_SNMP/Storage.pm428
-rw-r--r--perl/AnyData_SNMP/configs/scli27
-rw-r--r--perl/AnyData_SNMP/configs/unix34
-rwxr-xr-xperl/AnyData_SNMP/netsh838
-rw-r--r--perl/Makefile.PL160
-rw-r--r--perl/Makefile.makefiles12
-rw-r--r--perl/Makefile.subs.pl136
-rw-r--r--perl/OID/Changes6
-rw-r--r--perl/OID/MANIFEST7
-rw-r--r--perl/OID/Makefile.PL234
-rw-r--r--perl/OID/OID.pm256
-rw-r--r--perl/OID/OID.xs442
-rw-r--r--perl/OID/README31
-rw-r--r--perl/OID/netsnmp-feature-definitions.h6
-rw-r--r--perl/OID/test.pl137
-rw-r--r--perl/OID/typemap2
-rw-r--r--perl/SNMP/BUG40
-rw-r--r--perl/SNMP/MANIFEST37
-rw-r--r--perl/SNMP/MANIFEST.SKIP11
-rw-r--r--perl/SNMP/Makefile.PL363
-rw-r--r--perl/SNMP/README896
-rw-r--r--perl/SNMP/SNMP.pm2680
-rw-r--r--perl/SNMP/SNMP.xs5473
-rw-r--r--perl/SNMP/TODO40
-rw-r--r--perl/SNMP/examples/async1.pl17
-rw-r--r--perl/SNMP/examples/async2.pl19
-rw-r--r--perl/SNMP/examples/bulkwalk.pl121
-rw-r--r--perl/SNMP/examples/ipforward.pl30
-rw-r--r--perl/SNMP/examples/mibtree.pl20
-rw-r--r--perl/SNMP/examples/mibwalk.pl17
-rwxr-xr-xperl/SNMP/examples/pingmib.pl46
-rw-r--r--perl/SNMP/examples/tablewalk.pl19
-rw-r--r--perl/SNMP/examples/testleak.pl19
-rw-r--r--perl/SNMP/examples/trap-example.pl94
-rw-r--r--perl/SNMP/hints/irix.pl2
-rw-r--r--perl/SNMP/hints/solaris.pl4
-rw-r--r--perl/SNMP/netsnmp-feature-definitions.h8
-rw-r--r--perl/SNMP/perlsnmp.h24
-rw-r--r--perl/SNMP/t/README81
-rw-r--r--perl/SNMP/t/async.t169
-rw-r--r--perl/SNMP/t/bulkwalk.t339
-rw-r--r--perl/SNMP/t/conf.t53
-rw-r--r--perl/SNMP/t/conftest.conf2
-rw-r--r--perl/SNMP/t/get.t216
-rw-r--r--perl/SNMP/t/getnext.t102
-rw-r--r--perl/SNMP/t/mib.t226
-rw-r--r--perl/SNMP/t/mib.txt4208
-rw-r--r--perl/SNMP/t/mibload.t95
-rw-r--r--perl/SNMP/t/notify.t106
-rw-r--r--perl/SNMP/t/session.t76
-rw-r--r--perl/SNMP/t/set.t224
-rw-r--r--perl/SNMP/t/snmptest.conf21
-rw-r--r--perl/SNMP/t/startagent.pl125
-rw-r--r--perl/SNMP/typemap2
-rw-r--r--perl/TrapReceiver/Changes8
-rw-r--r--perl/TrapReceiver/MANIFEST12
-rw-r--r--perl/TrapReceiver/Makefile.PL273
-rw-r--r--perl/TrapReceiver/README30
-rw-r--r--perl/TrapReceiver/TrapReceiver.pm286
-rw-r--r--perl/TrapReceiver/TrapReceiver.xs313
-rw-r--r--perl/TrapReceiver/fallback/const-c.inc146
-rw-r--r--perl/TrapReceiver/fallback/const-xs.inc88
-rw-r--r--perl/TrapReceiver/netsnmp-feature-definitions.h6
-rw-r--r--perl/TrapReceiver/perl_snmptrapd.h44
-rw-r--r--perl/TrapReceiver/ppport.h562
-rw-r--r--perl/TrapReceiver/t/1.t38
-rw-r--r--perl/TrapReceiver/typemap5
-rw-r--r--perl/agent/Changes6
-rw-r--r--perl/agent/MANIFEST15
-rw-r--r--perl/agent/Makefile.PL240
-rw-r--r--perl/agent/Support/Makefile.PL229
-rw-r--r--perl/agent/Support/Support.pm461
-rw-r--r--perl/agent/agent.pm563
-rw-r--r--perl/agent/agent.xs941
-rw-r--r--perl/agent/default_store/Makefile.PL228
-rw-r--r--perl/agent/default_store/default_store.pm370
-rw-r--r--perl/agent/default_store/default_store.xs705
-rwxr-xr-xperl/agent/default_store/gen118
-rw-r--r--perl/agent/default_store/test.pl69
-rw-r--r--perl/agent/netsnmp-feature-definitions.h6
-rw-r--r--perl/agent/netsnmp_request_infoPtr.pm23
-rw-r--r--perl/agent/test.pl122
-rw-r--r--perl/agent/typemap6
-rw-r--r--perl/default_store/Changes6
-rw-r--r--perl/default_store/MANIFEST8
-rw-r--r--perl/default_store/Makefile.PL227
-rw-r--r--perl/default_store/README14
-rw-r--r--perl/default_store/default_store.pm366
-rw-r--r--perl/default_store/default_store.xs1411
-rwxr-xr-xperl/default_store/gen131
-rw-r--r--perl/default_store/netsnmp-feature-definitions.h0
-rw-r--r--perl/default_store/test.pl124
-rw-r--r--perl/default_store/typemap1
-rw-r--r--perl/make-perl-makefiles23
-rw-r--r--perl/manager/INSTALL198
-rw-r--r--perl/manager/Makefile.PL16
-rw-r--r--perl/manager/displaytable.pm628
-rw-r--r--perl/manager/getValues.pm49
-rw-r--r--perl/manager/green.gifbin0 -> 870 bytes
-rw-r--r--perl/manager/manager.pm1051
-rw-r--r--perl/manager/red.gifbin0 -> 855 bytes
-rwxr-xr-xperl/manager/setupauth59
-rwxr-xr-xperl/manager/setupdb149
-rwxr-xr-xperl/manager/setupuser45
-rwxr-xr-xperl/manager/snmptosql523
-rw-r--r--python/LICENSE66
-rw-r--r--python/README365
-rw-r--r--python/netsnmp/__init__.py1
-rw-r--r--python/netsnmp/client.py266
-rw-r--r--python/netsnmp/client_intf.c2601
-rw-r--r--python/netsnmp/netsnmp-feature-definitions.h6
-rw-r--r--python/netsnmp/tests/__init__.py0
-rw-r--r--python/netsnmp/tests/snmpd.conf425
-rw-r--r--python/netsnmp/tests/test.py321
-rw-r--r--python/setup.py46
-rw-r--r--sedscript.in109
-rw-r--r--snmplib/MSG00001.binbin0 -> 32 bytes
-rw-r--r--snmplib/Makefile.depend3927
-rw-r--r--snmplib/Makefile.in245
-rw-r--r--snmplib/asn1.c3737
-rw-r--r--snmplib/callback.c585
-rw-r--r--snmplib/cert_util.c3367
-rw-r--r--snmplib/check_varbind.c283
-rw-r--r--snmplib/closedir.c20
-rw-r--r--snmplib/container.c714
-rw-r--r--snmplib/container_binary_array.c879
-rw-r--r--snmplib/container_iterator.c513
-rw-r--r--snmplib/container_list_ssll.c570
-rw-r--r--snmplib/container_null.c191
-rw-r--r--snmplib/data_list.c383
-rw-r--r--snmplib/default_store.c572
-rw-r--r--snmplib/dir_utils.c256
-rw-r--r--snmplib/fd_event_manager.c297
-rw-r--r--snmplib/file_utils.c263
-rw-r--r--snmplib/getopt.c122
-rw-r--r--snmplib/gettimeofday.c33
-rw-r--r--snmplib/inet_ntop.c210
-rw-r--r--snmplib/inet_ntop.h10
-rw-r--r--snmplib/inet_pton.c311
-rw-r--r--snmplib/inet_pton.h10
-rw-r--r--snmplib/int64.c461
-rw-r--r--snmplib/keytools.c666
-rw-r--r--snmplib/large_fd_set.c244
-rw-r--r--snmplib/lcd_time.c608
-rw-r--r--snmplib/md5.c536
-rw-r--r--snmplib/mib.c6800
-rw-r--r--snmplib/mt_support.c169
-rw-r--r--snmplib/oid_stash.c461
-rw-r--r--snmplib/opendir.c139
-rw-r--r--snmplib/openssl/OPENSSL-LICENSE127
-rw-r--r--snmplib/openssl/README19
-rw-r--r--snmplib/openssl/openssl_aes_cfb.c81
-rw-r--r--snmplib/openssl/openssl_aes_core.c1358
-rw-r--r--snmplib/openssl/openssl_aes_local.h87
-rw-r--r--snmplib/openssl/openssl_cbc_enc.c61
-rw-r--r--snmplib/openssl/openssl_cfb128.c250
-rw-r--r--snmplib/openssl/openssl_des_enc.c400
-rw-r--r--snmplib/openssl/openssl_des_local.h431
-rw-r--r--snmplib/openssl/openssl_md32_common.h408
-rw-r--r--snmplib/openssl/openssl_md5.c181
-rw-r--r--snmplib/openssl/openssl_md5_local.h129
-rw-r--r--snmplib/openssl/openssl_modes.h59
-rw-r--r--snmplib/openssl/openssl_ncbc_enc.c148
-rw-r--r--snmplib/openssl/openssl_set_key.c406
-rw-r--r--snmplib/openssl/openssl_sha.h199
-rw-r--r--snmplib/openssl/openssl_sha1.c65
-rw-r--r--snmplib/openssl/openssl_sha_local.h436
-rw-r--r--snmplib/openssl/openssl_spr.h204
-rw-r--r--snmplib/parse.c5681
-rw-r--r--snmplib/pkcs.c779
-rw-r--r--snmplib/read_config.c2357
-rw-r--r--snmplib/readdir.c51
-rw-r--r--snmplib/scapi.c1359
-rw-r--r--snmplib/snmp-tc.c476
-rw-r--r--snmplib/snmp.c462
-rw-r--r--snmplib/snmp_alarm.c489
-rw-r--r--snmplib/snmp_api.c7382
-rw-r--r--snmplib/snmp_auth.c240
-rw-r--r--snmplib/snmp_client.c1885
-rw-r--r--snmplib/snmp_debug.c578
-rw-r--r--snmplib/snmp_enum.c475
-rw-r--r--snmplib/snmp_logging.c1462
-rw-r--r--snmplib/snmp_openssl.c879
-rw-r--r--snmplib/snmp_parse_args.c832
-rw-r--r--snmplib/snmp_secmod.c206
-rw-r--r--snmplib/snmp_service.c432
-rw-r--r--snmplib/snmp_transport.c768
-rw-r--r--snmplib/snmp_version.c14
-rw-r--r--snmplib/snmpksm.c1884
-rw-r--r--snmplib/snmptsm.c627
-rw-r--r--snmplib/snmpusm.c4668
-rw-r--r--snmplib/snmpv3.c1273
-rw-r--r--snmplib/snprintf.c808
-rw-r--r--snmplib/strlcat.c67
-rw-r--r--snmplib/strlcpy.c43
-rw-r--r--snmplib/strtok_r.c94
-rw-r--r--snmplib/strtol.c125
-rw-r--r--snmplib/strtoul.c107
-rw-r--r--snmplib/strtoull.c158
-rw-r--r--snmplib/system.c1426
-rw-r--r--snmplib/text_utils.c526
-rw-r--r--snmplib/tools.c1376
-rw-r--r--snmplib/transports/snmpAAL5PVCDomain.c374
-rw-r--r--snmplib/transports/snmpAliasDomain.c116
-rw-r--r--snmplib/transports/snmpCallbackDomain.c628
-rw-r--r--snmplib/transports/snmpDTLSUDPDomain.c1788
-rw-r--r--snmplib/transports/snmpIPXDomain.c467
-rw-r--r--snmplib/transports/snmpIPv4BaseDomain.c223
-rw-r--r--snmplib/transports/snmpIPv6BaseDomain.c426
-rw-r--r--snmplib/transports/snmpSSHDomain.c1010
-rw-r--r--snmplib/transports/snmpSTDDomain.c285
-rw-r--r--snmplib/transports/snmpSocketBaseDomain.c362
-rw-r--r--snmplib/transports/snmpTCPBaseDomain.c99
-rw-r--r--snmplib/transports/snmpTCPDomain.c351
-rw-r--r--snmplib/transports/snmpTCPIPv6Domain.c374
-rw-r--r--snmplib/transports/snmpTLSBaseDomain.c1183
-rw-r--r--snmplib/transports/snmpTLSTCPDomain.c1041
-rw-r--r--snmplib/transports/snmpUDPBaseDomain.c354
-rw-r--r--snmplib/transports/snmpUDPDomain.c520
-rw-r--r--snmplib/transports/snmpUDPIPv4BaseDomain.c211
-rw-r--r--snmplib/transports/snmpUDPIPv6Domain.c788
-rw-r--r--snmplib/transports/snmpUnixDomain.c752
-rw-r--r--snmplib/ucd-snmp-includes.h26
-rw-r--r--snmplib/ucd_compat.c230
-rw-r--r--snmplib/vacm.c1163
-rw-r--r--snmplib/winpipe.c222
-rw-r--r--snmplib/winservice.c1108
-rw-r--r--snmplib/winservice.mc11
-rw-r--r--snmplib/winservice.rc2
-rw-r--r--snmplib/winservicerc.rc2
-rw-r--r--stamp-h1
-rw-r--r--stamp-h.in1
-rw-r--r--testing/Makefile.in120
-rw-r--r--testing/README16
-rwxr-xr-xtesting/RUNFULLTESTS813
-rwxr-xr-xtesting/RUNTESTS45
-rw-r--r--testing/fulltests/default/Sv1config4
-rw-r--r--testing/fulltests/default/Sv2cconfig4
-rw-r--r--testing/fulltests/default/Sv3config46
-rw-r--r--testing/fulltests/default/Sv3usmconfigagent23
-rw-r--r--testing/fulltests/default/Sv3usmconfigbase100
-rw-r--r--testing/fulltests/default/Sv3usmconfigtrapd19
-rw-r--r--testing/fulltests/default/Sv3vacmconfig29
-rw-r--r--testing/fulltests/default/Svacmconfig40
-rw-r--r--testing/fulltests/default/Svanyconfig29
-rw-r--r--testing/fulltests/default/T000configure_simple22
-rw-r--r--testing/fulltests/default/T001snmpv1get_simple37
-rw-r--r--testing/fulltests/default/T0141snmpv2cset_simple35
-rw-r--r--testing/fulltests/default/T014snmpv2cget_simple24
-rw-r--r--testing/fulltests/default/T015snmpv2cgetnext_simple25
-rwxr-xr-xtesting/fulltests/default/T0160snmpv2cbulkget_simple31
-rw-r--r--testing/fulltests/default/T016snmpv2cgetfail_simple30
-rw-r--r--testing/fulltests/default/T017snmpv2ctov1getfail_simple30
-rw-r--r--testing/fulltests/default/T018snmpv1tov2cgetfail_simple26
-rw-r--r--testing/fulltests/default/T019snmpv2cnosuch_simple25
-rw-r--r--testing/fulltests/default/T020snmpv3get_simple24
-rwxr-xr-xtesting/fulltests/default/T021snmpv3getnext_simple24
-rwxr-xr-xtesting/fulltests/default/T0220snmpv3bulkget_simple30
-rwxr-xr-xtesting/fulltests/default/T022snmpv3getMD5_simple25
-rw-r--r--testing/fulltests/default/T023snmpv3getMD5AES_simple29
-rwxr-xr-xtesting/fulltests/default/T023snmpv3getMD5DES_simple28
-rwxr-xr-xtesting/fulltests/default/T024snmpv3getSHA1_simple25
-rwxr-xr-xtesting/fulltests/default/T025snmpv3getSHADES_simple29
-rw-r--r--testing/fulltests/default/T026snmpv3getSHAAES_simple29
-rw-r--r--testing/fulltests/default/T027snmpv3Defaults_simple38
-rwxr-xr-xtesting/fulltests/default/T028snmpv3getfail_simple22
-rw-r--r--testing/fulltests/default/T030snmpv3usercreation_simple119
-rw-r--r--testing/fulltests/default/T035snmpv3trapdusermgmt_simple126
-rw-r--r--testing/fulltests/default/T049snmpv3inform_simple27
-rw-r--r--testing/fulltests/default/T049snmpv3informauth_simple27
-rw-r--r--testing/fulltests/default/T049snmpv3informpriv_simple28
-rw-r--r--testing/fulltests/default/T050snmpv3trap_simple36
-rw-r--r--testing/fulltests/default/T051snmpv2ctrap_simple27
-rw-r--r--testing/fulltests/default/T052snmpv2cinform_simple25
-rw-r--r--testing/fulltests/default/T053agentv1trap_simple34
-rw-r--r--testing/fulltests/default/T054agentv2ctrap_simple33
-rw-r--r--testing/fulltests/default/T055agentv1mintrap_simple33
-rw-r--r--testing/fulltests/default/T056agentv2cmintrap_simple34
-rw-r--r--testing/fulltests/default/T057trapdauthtest2_simple25
-rw-r--r--testing/fulltests/default/T057trapdauthtest3_simple25
-rw-r--r--testing/fulltests/default/T057trapdauthtest_simple25
-rw-r--r--testing/fulltests/default/T058agentauthtrap_simple36
-rwxr-xr-xtesting/fulltests/default/T059trapdtraphandle_simple71
-rwxr-xr-xtesting/fulltests/default/T060trapdperl_simple59
-rwxr-xr-xtesting/fulltests/default/T061agentperl_simple77
-rw-r--r--testing/fulltests/default/T065agentextend_simple54
-rw-r--r--testing/fulltests/default/T066pass_simple53
-rw-r--r--testing/fulltests/default/T067passpersist_simple63
-rw-r--r--testing/fulltests/default/T070com2sec_simple159
-rw-r--r--testing/fulltests/default/T071com2sec6_simple155
-rw-r--r--testing/fulltests/default/T072com2secunix_simple111
-rwxr-xr-xtesting/fulltests/default/T100agenthup_simple36
-rw-r--r--testing/fulltests/default/T110agentxget_simple59
-rw-r--r--testing/fulltests/default/T111agentxset_simple78
-rw-r--r--testing/fulltests/default/T112agentxsetfail_simple72
-rw-r--r--testing/fulltests/default/T113agentxtrap_simple79
-rw-r--r--testing/fulltests/default/T114agentxagentxtrap_simple44
-rwxr-xr-xtesting/fulltests/default/T115agentxperl_simple115
-rw-r--r--testing/fulltests/default/T120proxyget_simple67
-rw-r--r--testing/fulltests/default/T121proxyset_simple86
-rw-r--r--testing/fulltests/default/T122proxysetfail_simple86
-rw-r--r--testing/fulltests/default/T130snmpv1vacmget_simple32
-rw-r--r--testing/fulltests/default/T131snmpv2cvacmget_simple35
-rw-r--r--testing/fulltests/default/T132snmpv3vacmget_simple31
-rw-r--r--testing/fulltests/default/T140snmpv1vacmgetfail_simple35
-rw-r--r--testing/fulltests/default/T141snmpv2cvacmgetfail_simple48
-rw-r--r--testing/fulltests/default/T142snmpv3vacmgetfail_simple32
-rw-r--r--testing/fulltests/default/T150solarishostcpu_simple31
-rw-r--r--testing/fulltests/default/T151solarishostdisk_simple31
-rw-r--r--testing/fulltests/default/T152hostuptime_simple27
-rw-r--r--testing/fulltests/default/T153solarisswap_simple31
-rw-r--r--testing/fulltests/default/T154dismanpingmib_simple116
-rw-r--r--testing/fulltests/default/T160snmpnetstat_simple55
-rw-r--r--testing/fulltests/default/T200snmpv2cwalkall_simple38
-rw-r--r--testing/fulltests/perl/NetSNMPTestTransport.pm54
-rw-r--r--testing/fulltests/perl/T001basic.t93
-rw-r--r--testing/fulltests/perl/T101udp.t18
-rw-r--r--testing/fulltests/perl/T102tcp.t18
-rw-r--r--testing/fulltests/perl/T103udp6.t18
-rw-r--r--testing/fulltests/perl/T104tcp6.t18
-rw-r--r--testing/fulltests/perl/T105unix.t19
-rw-r--r--testing/fulltests/read-only/T0141snmpv2csetfail_simple32
-rw-r--r--testing/fulltests/snmpv3/T010scapitest_capp.c459
-rw-r--r--testing/fulltests/snmpv3/T020hashtests_capp.c117
-rw-r--r--testing/fulltests/snmpv3/T040keymanagetest_capp.c636
-rw-r--r--testing/fulltests/snmpv3/T050etimetest_capp.c420
-rw-r--r--testing/fulltests/support/NetSNMPTest.pm172
-rwxr-xr-xtesting/fulltests/support/cagentlib_build46
-rwxr-xr-xtesting/fulltests/support/cagentlib_run8
-rwxr-xr-xtesting/fulltests/support/capp_build4
-rwxr-xr-xtesting/fulltests/support/capp_run8
-rwxr-xr-xtesting/fulltests/support/clib_build62
-rwxr-xr-xtesting/fulltests/support/clib_run8
-rw-r--r--testing/fulltests/support/simple_TESTCONF.sh260
-rw-r--r--testing/fulltests/support/simple_eval_tools.sh695
-rwxr-xr-xtesting/fulltests/support/simple_run119
-rw-r--r--testing/fulltests/tls/S300tlsperl.pl54
-rw-r--r--testing/fulltests/tls/SCipherTests62
-rw-r--r--testing/fulltests/tls/SCrl98
-rw-r--r--testing/fulltests/tls/STlsAgentTrap66
-rw-r--r--testing/fulltests/tls/STlsCNSession6
-rw-r--r--testing/fulltests/tls/STlsName6
-rw-r--r--testing/fulltests/tls/STlsSan6
-rw-r--r--testing/fulltests/tls/STlsSanSession6
-rw-r--r--testing/fulltests/tls/STlsServer77
-rw-r--r--testing/fulltests/tls/STlsServerSession57
-rw-r--r--testing/fulltests/tls/STlsTrapdUser87
-rw-r--r--testing/fulltests/tls/STlsUsers262
-rw-r--r--testing/fulltests/tls/STlsVars56
-rw-r--r--testing/fulltests/tls/STsmPrefix86
-rwxr-xr-xtesting/fulltests/tls/T101DtlsUser_simple15
-rw-r--r--testing/fulltests/tls/T102TlsUser_simple15
-rw-r--r--testing/fulltests/tls/T111DtlsServer_simple15
-rw-r--r--testing/fulltests/tls/T112TlsServer_simple15
-rw-r--r--testing/fulltests/tls/T113DtlsSan_simple15
-rw-r--r--testing/fulltests/tls/T114TlsSan_simple15
-rw-r--r--testing/fulltests/tls/T115DtlsSanSession_simple15
-rw-r--r--testing/fulltests/tls/T116TlsSanSession_simple15
-rw-r--r--testing/fulltests/tls/T117DtlsCNSession_simple15
-rw-r--r--testing/fulltests/tls/T118TlsCNSession_simple15
-rw-r--r--testing/fulltests/tls/T121DtlsTrap_simple15
-rw-r--r--testing/fulltests/tls/T122TlsTrap_simple15
-rw-r--r--testing/fulltests/tls/T131DtlsAgentTrap_simple15
-rw-r--r--testing/fulltests/tls/T132TlsAgentTrap_simple15
-rw-r--r--testing/fulltests/tls/T141DtlsCrl_simple18
-rw-r--r--testing/fulltests/tls/T142TlsCrl_simple18
-rw-r--r--testing/fulltests/tls/T151DtlsCiphers_simple18
-rw-r--r--testing/fulltests/tls/T152TlsCiphers_simple18
-rw-r--r--testing/fulltests/tls/T200TlsIpv6_simple29
-rw-r--r--testing/fulltests/tls/T300TlsPerl.t8
-rw-r--r--testing/fulltests/tls/T301DtlsPerl.t8
-rw-r--r--testing/fulltests/tls/T401DtlsTsmPrefix_simple19
-rw-r--r--testing/fulltests/tls/T402TlsTsmPrefix_simple16
-rw-r--r--testing/fulltests/transports/Stlstests49
-rwxr-xr-xtesting/fulltests/transports/Stransport18
-rw-r--r--testing/fulltests/transports/T300udp_simple15
-rw-r--r--testing/fulltests/transports/T310tcp_simple15
-rw-r--r--testing/fulltests/transports/T320udpv6_simple16
-rw-r--r--testing/fulltests/transports/T330tcpv6_simple16
-rw-r--r--testing/fulltests/transports/T350unix_simple19
-rw-r--r--testing/fulltests/transports/T360dtlsudp_simple18
-rw-r--r--testing/fulltests/transports/T361tlstcp_simple18
-rw-r--r--testing/fulltests/transports/T399alias_simple24
-rw-r--r--testing/fulltests/transports/test-localhost.cert23
-rw-r--r--testing/fulltests/transports/test-localhost.priv27
-rw-r--r--testing/fulltests/transports/test-user.cert23
-rw-r--r--testing/fulltests/transports/test-user.priv27
-rw-r--r--testing/fulltests/unit-tests/T001defaultstore_clib.c35
-rw-r--r--testing/fulltests/unit-tests/T002containers_clib.c35
-rw-r--r--testing/fulltests/unit-tests/T003copy_nword_clib.c142
-rw-r--r--testing/fulltests/unit-tests/T004snmp_enum_clib.c105
-rw-r--r--testing/fulltests/unit-tests/T005table_dataset_cagentlib.c58
-rw-r--r--testing/fulltests/unit-tests/T006snmp_handler_registration_cagentlib.c46
-rw-r--r--testing/fulltests/unit-tests/T007inet_pton_clib.c60
-rw-r--r--testing/fulltests/unit-tests/T008asn1_clib.c182
-rw-r--r--testing/fulltests/unit-tests/T009large_fd_set_clib.c46
-rw-r--r--testing/fulltests/unit-tests/T010netsnmp_string_time_to_secs_clib.c45
-rw-r--r--testing/fulltests/unit-tests/T011snmp_old_api_registration_cagentlib.c46
-rw-r--r--testing/fulltests/unit-tests/T012binary_array_oid_clib.c72
-rw-r--r--testing/fulltests/unit-tests/T013binary_array_string_clib.c59
-rw-r--r--testing/fulltests/unit-tests/T014gethostbyaddr_clib.c55
-rw-r--r--testing/fulltests/unit-tests/T015int64_clib.c82
-rw-r--r--testing/fulltests/unit-tests/T016read_config_clib.c82
-rw-r--r--testing/fulltests/unit-tests/T017strtoull_clib.c94
-rw-r--r--testing/fulltests/unit-tests/T018read_config_capp.c129
-rw-r--r--testing/fulltests/unit-tests/T019_snmp_service_clib.c253
-rw-r--r--testing/fulltests/unit-tests/T101pdu_type_clib.c13
-rw-r--r--testing/fulltests/unit-tests/T102pdu_build_clib.c67
-rw-r--r--testing/fulltests/unit-tests/T103pdu_parse_clib.c22
-rw-r--r--testing/rfc1213/README25
-rwxr-xr-xtesting/rfc1213/run58
-rw-r--r--testing/rfc1213/snmpfun.sh78
-rw-r--r--testing/rfc1213/test_fun68
-rw-r--r--testing/rfc1213/testmib1.sh448
-rw-r--r--testing/rfc1213/testmib2.sh447
-rw-r--r--testing/rfc1213/testmib3.sh448
-rw-r--r--win32/Configure427
-rw-r--r--win32/EXAMPLE.conf.win32156
-rw-r--r--win32/Makefile-apps.in217
-rw-r--r--win32/Makefile.in503
-rw-r--r--win32/MgmtApi-winExtDLL.h77
-rw-r--r--win32/Snmp-winExtDLL.h278
-rw-r--r--win32/agent_module_dot_conf.h1
-rw-r--r--win32/agent_module_includes.h10
-rw-r--r--win32/agent_module_inits.h5
-rwxr-xr-xwin32/build.bat5
-rw-r--r--win32/build.pl338
-rw-r--r--win32/config.h.borland786
-rw-r--r--win32/encode_keychange/encode_keychange.dsp90
-rwxr-xr-xwin32/install-net-snmp.bat120
-rw-r--r--win32/libagent/Makefile.in297
-rw-r--r--win32/libagent/libagent.dsp316
-rw-r--r--win32/libnetsnmptrapd/Makefile.in202
-rw-r--r--win32/libnetsnmptrapd/libnetsnmptrapd.dsp124
-rw-r--r--win32/libsnmp/Makefile.in525
-rw-r--r--win32/libsnmp/libsnmp.dsp512
-rw-r--r--win32/libsnmp_dll/Makefile.in541
-rw-r--r--win32/libsnmp_dll/libsnmp.def2
-rw-r--r--win32/libsnmp_dll/libsnmp_dll.dsp523
-rw-r--r--win32/local/Makefile.in32
-rw-r--r--win32/local/mib2c.bat26
-rw-r--r--win32/local/snmpconf.bat26
-rw-r--r--win32/local/traptoemail.bat26
-rw-r--r--win32/mib_module_dot_conf.h1
-rw-r--r--win32/mib_module_includes.h177
-rw-r--r--win32/mib_module_inits.h120
-rw-r--r--win32/mib_module_shutdown.h11
-rw-r--r--win32/net-snmp/agent/agent_module_config.h32
-rw-r--r--win32/net-snmp/agent/mib_module_config.h335
-rw-r--r--win32/net-snmp/library/snmpv3-security-includes.h2
-rw-r--r--win32/net-snmp/net-snmp-config.h1811
-rw-r--r--win32/net-snmp/net-snmp-config.h.in1811
-rw-r--r--win32/netsnmpmibs/Makefile.in665
-rw-r--r--win32/netsnmpmibs/netsnmpmibs.dsp480
-rwxr-xr-xwin32/nmakeperl.bat59
-rw-r--r--win32/snmpbulkget/snmpbulkget.dsp90
-rw-r--r--win32/snmpbulkwalk/snmpbulkwalk.dsp90
-rw-r--r--win32/snmpd/Makefile.in124
-rw-r--r--win32/snmpd/snmpd.dsp134
-rw-r--r--win32/snmpdelta/snmpdelta.dsp90
-rw-r--r--win32/snmpdf/snmpdf.dsp90
-rw-r--r--win32/snmpget/snmpget.dsp90
-rw-r--r--win32/snmpgetnext/snmpgetnext.dsp90
-rw-r--r--win32/snmpnetstat/Makefile.in360
-rw-r--r--win32/snmpnetstat/snmpnetstat.dsp114
-rw-r--r--win32/snmpset/snmpset.dsp90
-rw-r--r--win32/snmpsm_init.h1
-rw-r--r--win32/snmpsm_shutdown.h1
-rw-r--r--win32/snmpstatus/snmpstatus.dsp90
-rw-r--r--win32/snmptable/snmptable.dsp90
-rw-r--r--win32/snmptest/snmptest.dsp90
-rw-r--r--win32/snmptranslate/snmptranslate.dsp90
-rw-r--r--win32/snmptrap/snmptrap.dsp90
-rw-r--r--win32/snmptrapd/Makefile.in295
-rw-r--r--win32/snmptrapd/snmptrapd.dsp102
-rw-r--r--win32/snmpusm/snmpusm.dsp90
-rw-r--r--win32/snmpv3-security-includes.h1
-rw-r--r--win32/snmpvacm/snmpvacm.dsp90
-rw-r--r--win32/snmpwalk/snmpwalk.dsp90
-rw-r--r--win32/transports/snmp_transport_inits.h15
-rw-r--r--win32/win32.dsw374
-rwxr-xr-xwin32/win32dll.dsw374
2037 files changed, 851867 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9cfb7a3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,114 @@
+*.bak
+*.bs
+*.ft
+*.ft.1
+*.la
+*.lo
+*.made
+*.o
+*.obj
+*.old
+*.orig
+*.out
+*.pdb
+*.rej
+.libs/
+agent/*.exe
+agent/mibgroup/agent_module_dot_conf.h
+agent/mibgroup/agent_module_includes.h
+agent/mibgroup/agent_module_inits.h
+agent/mibgroup/agent_module_shutdown.h
+agent/mibgroup/mib_module_dot_conf.h
+agent/mibgroup/mib_module_includes.h
+agent/mibgroup/mib_module_inits.h
+agent/mibgroup/mib_module_shutdown.h
+agent/snmpd
+apps/*.exe
+apps/agentxtrap
+apps/encode_keychange
+apps/snmpbulkget
+apps/snmpbulkwalk
+apps/snmpdelta
+apps/snmpdf
+apps/snmpget
+apps/snmpgetnext
+apps/snmpnetstat/*.exe
+apps/snmpnetstat/snmpnetstat
+apps/snmpset
+apps/snmpstatus
+apps/snmptable
+apps/snmptest
+apps/snmptls
+apps/snmptranslate
+apps/snmptrap
+apps/snmptrapd
+apps/snmpusm
+apps/snmpvacm
+apps/snmpwalk
+apps/sshtosnmp
+autom4te.cache/
+ChangeLog.add*
+ChangeLog.reallyadd
+CHANGES.new*
+confdefs.h
+config.cache
+config.log
+config.status
+configure-summary
+dist/generation-scripts/gen-variables
+docs/html
+docs/latex
+EXAMPLE.conf
+include/net-snmp/agent/agent_module_config.h
+include/net-snmp/agent/mib_module_config.h
+include/net-snmp/library/snmpv3-security-includes.h
+include/net-snmp/net-snmp-config.h
+libtool
+local/snmpcheck
+Makefile
+man/*.[1358]
+man/default_store.3.h
+man/manaliases
+mibs/.index
+mk/
+module_tmp_header.h
+net-snmp-5*
+net-snmp-6*
+net-snmp-config
+net-snmp-config-x
+net-snmp-create-v3-user
+NEWS.new*
+perl/*.yml
+perl/*/*.def
+perl/*/*.yml
+perl/*/*/*.yml
+perl/agent/agent.c
+perl/agent/default_store/default_store.c
+perl/agent/default_store/default_store.def
+perl/ASN/ASN.c
+perl/blib/
+perl/default_store/default_store.c
+perl/NetSNMP.c
+perl/OID/OID.c
+perl/SNMP/SNMP.c
+perl/SNMP/t/*.log
+perl/SNMP/t/*.pid
+perl/SNMP/t/*.stderr
+perl/SNMP/t/snmptest.cmd
+perl/TrapReceiver/const-c.inc
+perl/TrapReceiver/const-xs.inc
+perl/TrapReceiver/TrapReceiver.c
+pm_to_blib
+python/build
+sedscript
+snmplib/snmpsm_init.h
+snmplib/snmpsm_shutdown.h
+snmplib/transports/snmp_transport_inits.h
+stamp-h
+TAGS
+testing/failed_tests
+testing/testing/
+win32/*/debug
+win32/*/release
+win32/bin
+win32/lib
diff --git a/AGENT.txt b/AGENT.txt
new file mode 100644
index 0000000..37eb279
--- /dev/null
+++ b/AGENT.txt
@@ -0,0 +1,1171 @@
+Note, this is based on the text from a web page, which can be found in
+the documentation section of the http://www.net-snmp.org web page.
+
+Extending the UCD-SNMP agent
+============================
+
+This document describes the procedure for writing code to extend
+the functionality of the v4 UCD-SNMP network management agent.
+Modules written using this procedure should also work with the v5
+Net-SNMP agent, though such modules would not take advantage of the
+new handler-based helper mechanism. See the on-line documentation
+for more information and examples of the newer approach.
+We would be very interested in comment and feedback about how useful
+(or otherwise) you find this description, and ways in which it could
+be improved.
+
+The information is designed to be read in order - the structure being:
+
+ 1. Overview & Introduction
+ 2. MIB files, and how they relate to the agent implementation
+ 3. Header files
+ 4. The basic structure of module implementation code
+ 5. The details of non-table based implementations
+ 6. The details of simple table based implementations
+ 7. The details of more general table based implementations
+ 8. How to implement SET-able variables
+
+While the document is intended to be generally self-contained,
+it does occasionally refer to code files shipped with the main UCD
+distribution (in particular the example module), and it may prove
+useful to have these files available for reference.
+
+1. How to write a Mib module
+============================
+
+Introduction
+------------
+
+The design of the UCD SNMP agent has always been shaped by the desire to be
+able to extend its functionality by adding new modules. One of the earliest
+developments from the underlying CMU code base was the ability to call
+external scripts, and this is probably the simplest method of extending the
+agent.
+However, there are circumstances where such an approach is felt to be
+inappropriate - perhaps from considerations of speed, access to the
+necessary data, reliability or elegance. In such cases, the obvious solution
+is to provide C code that can be compiled into the agent itself to implement
+the desired module. Many of the more recent developments in the code
+structure have been intended to ease this process. In particular, one of the
+more recent additions to the suite is the tool mib2c. This is designed to
+take a portion of the MIB tree (as defined by a MIB file) and generate the
+code skeleton necessary to implement this. This document will cover the use
+mib2c, as well as describing the requirements and functionality of the code
+in more detail.
+
+In order to implement a new MIB module, three files are necessary, and these
+will be considered in turn. Note that, by the very nature of the task, this
+document cannot cover the details of precisely how to obtain the necessary
+information from the operating system or application. Instead, it describes
+the code framework that is needed, freeing the implementer from needing to
+understand the detailed internals of the agent, and allowing them to
+concentrate on the particular problem in hand.
+
+It may prove useful to examine some of the existing module implementations
+and examples in the light of this description, and suitable examples will be
+referred to at the appropriate points. However, it should be remembered that
+the UCD agent seeks to support a wide variety of systems, often with
+dramatically differing implementations and interfaces, and this is reflected
+in the complexity of the code. Also, the agent has developed gradually over
+the years, and there is often some measure of duplication or redundancy as a
+result.
+As the FAQ states, the official slogan of the UCD-SNMP developers is
+
+ The current implementation is non-obvious and may need to be
+ improved.
+
+This document describes the ideal, straightforward cases - real life is
+rarely so simple, and the example modules may prove easier to follow at a
+first reading.
+It is also advisable to have a compiled and installed implementation
+available before starting to extend the agent. This will make debugging and
+testing the agent much easier.
+
+A note regarding terminology - the word "module" is widely used throughout
+this document, with a number of different meanings.
+
+ * support for a new MIB,
+ i.e. the whole of the functionality that is required. This is usually
+ termed a MIB module;
+ * a self-contained subset of this, implemented as a single unit.
+ This is usually termed an implementation module (or simply "a module");
+ * the combination of such subsets, usually termed a module group.
+
+Note that the first and third of these are often synonymous - the
+difference being that a MIB module refers to the view from outside the
+agent, regarding this as a seamless whole and hiding the internal
+implementation. A "module group" is used where the internal structure is of
+more relevance, and recognises the fact that the functionality may be
+provided by a number of co-operating implementation modules.
+
+Anyway, enough waffle - on with the details: The three files needed are
+
+ * a MIB definition file;
+ * a C header file;
+ * a C implementation file.
+
+The next part looks at the MIB definition file, and how this impacts on the
+agent implementation.
+
+2. The MIB File
+===============
+
+The first file needed is the MIB file that defines the MIB module to be
+implemented.
+Strictly speaking, this is not absolutely necessary, as the agent itself
+does not make any direct use of the MIB definitions. However, it is
+advisable to start with this for three reasons:
+
+ * It provides an initial specification for what is to be implemented.
+ Code development is always easier if you know what you are meant to be
+ writing!
+ * If the new MIB file is read in with the other MIB files,
+ this lets the applications provided with the suite be used to test the
+ new agent, and report (hopefully meaningful) symbolic OIDs and values,
+ rather than the bare numeric forms.
+ (N.B: Remember to tell the application to load the new MIB. See the
+ relevant question in the FAQ)
+ * The tool mib2c uses this description to produce the two code files.
+ This is by far the easiest way to develop a new module.
+ (Note that the v5 version of mib2c is generally similar, but does
+ not correspond exactly to the v4 version described here)
+
+If the intention is to implement a 'standard' MIB module, or a
+vendor-specific one, then the construction of this file will have already
+been done for you. If the intention is to provide a totally new, private
+module, then you will need to write this yourself, in addition to the agent
+code files.
+A description of MIB file format and syntax is beyond the scope of this
+document, and most books on SNMP management should provide some information
+on this subject. One book which concentrates on this is
+
+ Understanding SNMP MIBS
+ (Perkins & McGinnis, Prentice Hall, ISBN 0-13-437708-7).
+
+This blatant plug is wholly unrelated to the fact that David Perkins is an
+active member of the development group, and is regarded as our resident
+"protocol guru and policeman". (In fact, this book concentrates on MIB
+files in rather more detail than is appropriate in more general SNMP works).
+Information on other books covering SNMP and Network Management more generally
+is available on the SimpleWeb site (among other places).
+See the FAQ for more details.
+
+Assigned OID numbers
+--------------------
+
+One word of advice - even if you are developing a totally private MIB
+module, you will still need to position this somewhere within the overall
+MIB tree. Please do NOT simply choose a location "at random". Any such is
+likely to have either been assigned to some other organisation, or may be so
+assigned some time in the future. However much you may regard your project
+as a totally internal affair, such projects have a tendency to exceed their
+expected scope, both in terms of lifetime and distribution (not to mention
+the potential OID clash if you subsequently need to use elements from the
+legitimate owner's tree).
+It is simple and cheap (i.e. free!) to obtain your own official segment of
+the MIB tree (see http://www.iana.org for an application form), and having
+done so, you then have complete global authority over it. If you have
+problems with this, it's worth contacting the development team (email:
+net-snmp-coders@lists.sourceforge.net) for advice. Please do think to the
+future, and be a good Net citizen by using a legitimately assigned OID as
+the root of your new MIB.
+
+MIB division
+------------
+
+The next point to consider, whether writing by hand or using mib2c,
+implementing an existing MIB, or writing a new one, is whether and how to
+divide up the MIB tree. This is a purely internal implementation decision,
+and will not be visible to management applications querying the agent. A
+sensible choice of partitioning will result in a simpler, clearer
+implementation, which should ease both the initial development and
+subsequent maintenance of the module.
+Unfortunately, this choice is one of the module-specific decisions, so must
+be made on a case-by-case basis. For a simple, self-contained module, it may
+well be reasonable to implement the module as a single block (examples
+include the SNMP statistics subtree RFC 1907 or the TCP subtree RFC 2011).
+More complex and diverse modules (such as the Host Resources MIB - RFC 1514)
+are more naturally considered as a number of individual sub-modules.
+Some guidelines to bear in mind when deciding on this division:
+
+ * A MIB sub-tree consisting purely of scalar objects with a common
+ OID prefix would normally be handled in a single implementation module;
+ * Separate scalar subtrees would normally be in different implementation
+ modules;
+ * A table can either be handled within the same implementation module
+ as related scalar objects in the same subtree, or in a separate
+ implementation module;
+ * Variables that rely on the same underlying data structure to retrieve
+ their values, should probably be in the same implementation module (and
+ conversely, (though less so) those that don't, shouldn't).
+
+As an initial rule of thumb, a good initial division is likely to be
+obtained by treating each table and each scalar sub-tree separately. This
+can be seen in the current agent, where most of the MIB-II modules (RFC
+1213) are implemented in separate files (see the files under mibgroup/mibII).
+Note that many of these combine scalar and table handling in the same file,
+though they are implemented using separate routines.
+ This is also the approach used by mib2c, which constructs a single pair of
+code files, but uses a separate routine for each table (and another for all
+the scalar variables).
+ Ultimately, the final consideration (concerning the underlying data) is
+the most important, and should guide the basic division. For example, the
+Host Resources Running Software and Running Software Performance modules,
+while separate in the MIB tree, use the same underlying kernel data and so
+are implemented together.
+
+MIB name
+--------
+
+The final requirement at this stage is to choose a name for each
+implementation module. This should be reasonably short, meaningful, unique
+and unlikely to clash with other (existing or future) modules. Mib2c uses
+the label of the root node of the MIB sub-tree as this name, and this is a
+reasonable choice in most cases.
+Recent changes to the agent code organisation have introduced the idea of
+module groups of related implementation modules. This is used, for example,
+to identify the constituent modules of a 'split' MIB (such as the Host
+Resources MIB), or those relating to a particular organisation (such as
+UCD).
+As with the division, this naming and grouping is a purely internal matter,
+and is really only visible when configuring and compiling the agent.
+
+So much for the MIB file. The next part considers the C header file.
+
+3. The C code header file
+=========================
+
+If the MIB file is the definition of the module for external network
+management applications (where applications includes network management
+personnel!), then the header file has traditionally served effectively the
+same purpose for the agent itself.
+Recent changes to the recommended code structure has resulted in the header
+file becoming increasingly simpler. It now simply contains definitions of the
+publically visible routines, and can be generated completely by mib2c.
+
+Function prototypes
+-------------------
+
+For those interested in the details of this file (for example, if coding a
+module by hand), then the details of these definitions are as follows. Every
+header file will have the following two function prototype definitions
+
+ extern void init_example (void);
+ extern FindVarMethod var_example;
+
+If the module includes any tables, or other collections of variables that
+are implemented in separate routines, then this second definition will be
+repeated for each of these.
+In addition, if any of the variables can be SET (and it is intended to
+implement them as such), there will be a function prototype definitions for
+each of these, of the form:
+
+ extern WriteMethod write_varName;
+
+These prototypes are in fact typedef'ed in <agent/snmp_vars.h>.
+
+Module dependencies
+-------------------
+
+This header file is also used to inform the compilation system of any
+dependancies between this module and any others. There is one utility module
+which is required by almost every module, and this is included using the
+directive
+
+ config_require( util_funcs )
+
+(which is produced automatically by mib2c). This same syntax can be used to
+trigger the inclusion of other related modules. An example of this can be
+seen in mibII/route_write.h which relies on the mibII/ip module, thus:
+
+ config_require( mibII/ip )
+
+One use of this directive is to define a module group, by supplying a header
+file consisting exclusively of such config_require directives. It can then
+be included or excluded from the agent very simply. Examples of this can be
+seen in mibgroup/mibII.h or mibgroup/host.h, which list the consituent
+sub-modules of the MIB-II and Host Resources MIBs respectively.
+
+MIB file information
+--------------------
+
+Most of the information in this file is (understandably) aimed at the network
+management agent itself. However, there is one common header file directive
+that is actually intended to affect the utility commands that are included
+within the full distribution:
+
+ config_add_mib( HOST-RESOURCES-MIB )
+
+ This is used to add the MIB file being implemented to the default list of
+MIBs loaded by such commands. This means that querying the agent will return
+informative names and values, rather than the raw numeric forms that SNMP
+actually works with. Of course, it is always possible for the utilities
+to specify that this MIB should be loaded anyway. But specifying this file
+within the module header file is a useful hint that a particular MIB should
+be loaded, without needing to ask for it explicitly.
+ Note that this will only affect the binaries compiled as part of the same
+configuration run. It will have no effect on pre-installed binaries, or
+those compiled following a different configuration specification.
+
+Magic Numbers
+-------------
+
+The other common element within the header file defines a set of "magic
+numbers" - one for each object within the implementation module. In fact,
+this can equally well appear within the main code file, as part of the
+variable structure (which will be described in the next part).
+ This is the technique used by mib2c, but most handcrafted modules have
+tended to define these as part of the header file, probably for clarity.
+
+ The only necessity is that the names and values are distinct (or more
+precisely, the values are distinct within a single variable handling routine).
+In practise, they tend to be defined using integers incrementing from 1,
+or as the same as the final sub-identifier of the corresponding MIB object
+(or indeed both, as these are frequently themselves successive integers).
+ This is not mandatory, and a counter-example can be seen in the
+example module, where two of the object form a sub-tree, and the corresponding
+magic numbers are based on the final *two* sub-identifiers (to ensure that
+the values are unique). But this construction is definitely unusual, and
+the majority of modules simply use successive integers.
+
+Header file protection
+----------------------
+
+Normally, the only other contents of the header file will be the
+#ifndef/#define/#endif statements surrounding the whole file. This is used
+to ensure that the header file is only included once by any source code file
+(or more accurately, that there is no effect if it is inadvertantly included
+a second time).
+Again, as with the rest of the header file, this is generated automatically
+by mib2c.
+
+Having finished all the preparatory work (or let mib2c deal with it), the
+next part starts to look at the code file that actually implements the
+module.
+
+4. Core structure of the implementation code
+============================================
+
+The core work of implementing the module is done in the C code file. As
+indicated earlier, much of the detail of this will be dependent on the
+particular module being implemented, and this can only be described by the
+individual programmer concerned.
+However, there is a fairly clearly defined framework that the implementation
+will need to follow, though this varies slightly depending on the style of
+the module being implemented (in particular whether it forms a table or a
+series of individual values). The differences will be covered in the
+following pages, but we first need to consider the overall shape of the
+framework, and the elements that are common to all styles. These are
+essentially the compulsory routines, the common header definitions, and
+assorted initialisation code.
+As with the header file, most of this will be generated automatically by
+mib2c.
+
+Standard includes
+-----------------
+
+Certain header files are either compulsory, or required so frequently that
+they should be included as a matter of course. These are as follows:
+
+ #include <config.h> // local SNMP configuration details
+ #include "mib_module_config.h" // list of which modules are supported
+ #if HAVE_STDLIB_H
+ #include <stdlib.h>
+ #endif
+ #if HAVE_STRING_H
+ #include <string.h>
+ #else
+ #include <strings.h>
+ #endif
+
+ #include <sys/types.h>
+
+All of these will usually be the first files to be included.
+
+ #include "mibincl.h" // Standard set of SNMP includes
+ #include "util_funcs.h" // utility function declarations
+ #include "read_config.h" // if the module uses run-time
+ // configuration controls
+ #include "auto_nlist.h" // structures for a BSD-based
+ // kernel using nlist
+ #include "system.h"
+
+ #include "name.h" // the module-specific header
+
+These conventionally come at the end of the list of includes. In between
+will come all the standard system-provided header files required for the
+library functions used in the file.
+
+Module definition
+-----------------
+
+Much of the code defining the contents of the MIB has traditionally been
+held in the header file. However, much of this has slowly migrated to the
+code file, and this is now the recommended location for it (as typified by
+the output of mib2c).
+ The main element of this is a variable structure specifying the details of
+the objects implemented. This takes the form of an unconstrained array of
+type struct variableN (where N is the length of the longest suffix in the
+table). Thus
+
+ struct variable2 example_variables[] = {
+ <individual entries go here>
+ };
+
+Each entry corresponds to one object in the MIB tree (or one column in the
+case of table entries), and these should be listed in increasing OID order.
+A single entry consists of six fields:
+
+ * a magic number (the #defined integer constant described above)
+ * a type indicator (from the values listed in <snmplib/snmp_impl.h>)
+ * an access indicator (essentially NETSNMP_OLDAPI_RWRITE or
+ NETSNMP_OLDAPI_RONLY)
+ * the name of the routine used to handle this entry
+ * the length of the OID suffix used, and
+ * an array of integers specifying this suffix (more on this in a moment)
+
+Thus a typical variable entry would look like:
+
+ { EXAMPLESTRING, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_example, 1, {1}}
+
+If the magic numbers have not been defined in the header file, then they
+should be defined here, usually comming immediately before the corresponding
+variable entry. This is the technique used by mib2c.
+
+Note that in practise, only certain sizes of the structure variableN
+are defined (listed in <agent/var_struct.h>), being sufficient to meet the
+common requirements. If your particular module needs a non-supported value,
+the easiest thing is simply to use the next largest value that is supported.
+
+The module also needs to declare the location within the MIB tree where
+it should be registered. This is done using a declaration of the form
+
+ oid example_variables_oid[] = { 1,3,6,1,4,1,2021,254 }
+
+where the contents of the array give the object identifier of the root of
+the module.
+
+Module initialisation
+---------------------
+
+Many modules require some form of initialisation before they can start
+providing the necessary information. This is done by providing a routine
+called init_{name} (where {name} is the name of the module).
+This routine is theoretically optional, but in practise is required to
+register this module with the main agent at the very least. This specifies
+the list of variables being implemented (from the variableN structure)
+and declare where these fit into the overall MIB tree.
+
+This is done by using the REGISTER_MIB macro, as follows:
+
+ REGISTER_MIB( "example", example_variables, variable2,
+ example_variables_oid );
+
+where "example" is used for identification purposed (and is usually the name
+being used for the module), example_variables is the structure defining the
+variables being implemented, variable2 is the type used for this structure,
+and example_variables_oid is the location of the root.
+
+In fact, this macro is simply a wrapper round the routine register_mib(),
+but the details of this can safely be ignored, unless more control over the
+registration is required.
+
+One common requirement, particularly on older operating systems or for the
+more obscure areas of the system, is to be able to read data directly from
+kernel memory. The preparation for this is typically done here by one or
+more statements of the form
+
+ #ifdef {NAME}_SYMBOL
+ auto_nlist( {NAME}_SYMBOL, 0, 0);
+ #endif
+
+where {NAME}_SYMBOL is defined as part of the system-specific configuration,
+to be the name of the appropriate kernel variable or data structure. (The
+two 0 values are because the kernel information is simply being primed at
+this point - this call will be reused later when the actual values are
+required). Note that this is probably the first thing described so far which
+isn't provided by mib2c!
+
+Other possibilities for initialisation may include registering config file
+directive handlers (which are documented in the read_config(5) man page), and
+registering the MIB module (either in whole or in part) in the sysOR table.
+The first of these is covered in the example module, and the second in many
+of the other modules within the main UCD distribution.
+
+Variable handling
+-----------------
+
+The other obligatory routine is that which actually handles a request for a
+particular variable instance. This is the routine that appeared in the
+variableN structure, so while the name is not fixed, it should be the same
+as was used there.
+This routine has six parameters, which will be described in turn.
+
+Four of these parameters are used for passing in information about the
+request, these being:
+
+ struct variable *vp;
+ // The entry in the variableN array from the
+ // header file, for the object under consideration.
+ // Note that the name field of this structure has been
+ // completed into a fully qualified OID, by prepending
+ // the prefix common to the whole array.
+ oid *name; // The OID from the request
+ int *length; // The length of this OID
+ int exact; // A flag to indicate whether this is an exact
+ // request (GET/SET) or an 'inexact' one (GETNEXT)
+
+Four of the parameters are used to return information about the answer.
+The function also returns a pointer to the actual data for the variable
+requested (or NULL if this data is not available for any reason).
+The other result parameters are:
+
+ oid *name; // The OID being returned
+ int *length; // The length of this OID
+ int *var_len; // The length of the answer being returned
+ WriteMethod **write_method;
+ // A pointer to the SET function for this variable
+
+Note that two of the parameters (name and length) serve a dual purpose,
+being used for both input and output.
+
+The first thing that this routine needs to do is to validate the request, to
+ensure that it does indeed lie in the range implemented by this particular
+module. This is done in slightly different ways, depending on the style of
+the module, so this will be discussed in more detail later.
+ At the same time, it is common to retrieve some of the information needed
+for answering the query.
+
+Then the routine uses the Magic Number field from the vp parameter to determine
+which of the possible variables being implemented is being requested. This is
+done using a switch statement, which should have as many cases as there are
+entries in the variableN array (or more precisely, as many as specify this
+routine as their handler), plus an additional default case to handle an
+erroneous call.
+Each branch of the switch statement needs to ensure that the return
+parameters are filled in correctly, set up a (static) return variable with
+the correct data, and then return a pointer to this value. These can be done
+separately for each branch, or once at the start, being overridden in
+particular branches if necessary.
+
+In fact, the default validation routines make the assumption that the
+variable is both read-only, and of integer type (which includes the COUNTER
+and GAUGE types among others), and set the return paramaters write_method and
+var_len appropriately. These settings can then be corrected for those cases
+when either or both of these assumptions are wrong. Examples of this can be
+seen in the example module.
+EXAMPLEINTEGER is writeable, so this branch sets the write_method parameter,
+and EXAMPLEOBJECTID is not an integer, so this branch sets the var_len
+parameter. In the case of EXAMPLESTRING, both assumptions are wrong, so this
+branch needs to set both these parameters explicitly.
+
+Note that because the routine returns a pointer to a static result, a
+suitable variable must be declared somewhere for this. Two global variables
+are provided for this purpose - long_return (for integer results) and
+return_buf (for other types). This latter is a generic array (of type
+u_char) that can contain up to 256 bytes of data. Alternatively, static
+variables can be declared, either within the code file, or local to this
+particular variable routine. This last is the approach adopted by mib2c,
+which defines four such local variables, (long_ret, string, objid and c64).
+
+Mib2c requirements
+------------------
+
+Most of the code described here is generated by mib2c. The main exceptions
+(which therefore need to be provided by the programmer) are
+
+ * Any initialisation, other than the basic registration
+ (including kernel data initialisation, config file handling, or sysOR
+ registration).
+ * Retrieving the necessary data, and setting the appropriate return
+ value correctly.
+ * The var_len (and possibly write_method) return parameters for variable
+ types that are not recognised by mib2c
+ * The contents of any write routines (see later).
+
+Everything else should be useable as generated.
+
+This concludes the preliminary walk-through of the general structure of the
+C implementation. To fill in the details, we will need to consider the
+various styles of module separately. The next part will look at scalar (i.e.
+non-table based) modules.
+
+5. Non-table-based modules
+==========================
+
+Having looked at the general structure of a module implementation, it's now
+time to look at this in more detail. We'll start with the simplest style of
+module - a collection of independent variables. This could easily be
+implemented as a series of completely separate modules - the main reason for
+combining them is to avoid the proliferation of multiple versions of very
+similar code.
+
+Recall that the variable handling routine needs to cover two distinct
+purposes - validation of the request, and provision of the answer. In this
+style of module, these are handled separately. Once again, mib2c does much
+of the donkey work, generating the whole of the request validation code (so
+the description of this section can be skipped if desired), and even
+providing a skeleton for returning the data. This latter still requires some
+input from the programmer, to actually return the correct results (rather
+than dummy values).
+
+Request Validation
+------------------
+
+This is done using a standard utility function header_generic. The
+parameters for this are exactly the same as for the main routine, and are
+simply passed through directly. It returns an integer result, as a flag to
+indicate whether the validation succeeded or not.
+If the validation fails, then the main routine should return immediately,
+leaving the parameters untouched, and indicate the failure by returning a
+NULL value. Thus the initial code fragment of a scalar-variable style
+implementation will typically look like:
+
+ u_char *
+ var_system(vp, name, length, exact, var_len, write_method)
+ {
+ if (header_generic(vp, name, length, exact, var_len, write_method)
+ == MATCH_FAILED )
+ return NULL;
+
+ [ etc, etc, etc ]
+ }
+
+Although the utility function can be used as a "black box", it's worth
+looking more closely at exactly what it does (since the table-handling
+modules will need to do something fairly similar). It has two (or possibly
+three) separate functions:
+
+ * checking that the request is valid,
+ * setting up the OID for the result,
+ * and (optionally) setting up default values for the other return
+ parameters.
+
+In order to actually validate the request, the header routine first needs to
+construct the OID under consideration, in order to compare it with that
+originally asked for. The driving code has already combined the OID prefix
+(constant throughout the module) with the entry-specific suffix, before
+calling the main variable handler. This is available via the name field of
+the parameter vp. For a scalar variable, completing the OID is therefore
+simply a matter of appending the instance identifier 0 to this. The full OID
+is built up in a local oid array newname defined for this purpose.
+This gives the following code fragment:
+
+ int
+ header_generic(vp, name, length, exact, var_len, write_method)
+ {
+ oid newname[MAX_OID_LEN];
+
+ memcpy((char *)newname, (char *)vp->name,
+ (int)vp->namelen * sizeof(oid));
+ newname[ vp->namelen ] = 0;
+
+ :
+ }
+
+Having formed the OID, this can then be compared against the variable
+specified in the original request, which is available as the name parameter.
+This comparison is done using the snmp_oid_compare function, which takes the
+two OIDs (together with their respective lengths), and returns -1, 0 or 1
+depending on whether the first OID precedes, matches or follows the second.
+
+In the case of an 'exact' match (i.e. a GET/SET/etc), then the request is
+only valid if the two OIDs are identical (snmp_oid_compare returns 0). In
+the case of a GETNEXT (or GETBULK) request, it's valid if the OID being
+considered comes after that of the original request (snmp_oid_compare
+returns -1).
+
+This gives the code fragment
+
+ result = snmp_oid_compare(name, *length, newname, (int)vp->namelen + 1);
+ // +1 because of the extra instance sub-identifier
+ if ((exact && (result != 0)) // GET match fails
+ || (!exact && (result >= 0))) // GETNEXT match fails
+ return(MATCH_FAILED);
+
+Note that in this case, we're only interested in the single variable
+indicated by the vp parameter. The fact that this module may well implement
+other variables as well is ignored. The 'lexically next' requirement of the
+GETNEXT request is handled by working through the variable entries in order
+until one matches. And yes, this is not the most efficient implementation
+possible!
+Note that in releases prior to 3.6, the snmp_oid_compare function was called
+simply compare.
+
+Finally, having determined that the request is valid, this routine must
+update the name and length parameters to return the OID being processed. It
+also sets default values for the other two return parameters.
+
+ memcpy( (char *)name,(char *)newname,
+ ((int)vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0; // Non-writeable
+ *var_len = sizeof(long); // default to integer results
+ return(MATCH_SUCCEEDED);
+
+These three code fragments combine to form the full header_generic code
+which can be seen in the file util_funcs.c
+
+Note: This validation used to be done using a separate function for each
+module (conventionally called header_{name}), and many modules may still be
+coded in this style. The code for these are to all intents and purposes
+identical to the header_generic routine described above.
+
+Data Retrieval
+--------------
+
+The other main job of the request handling routine is to retrieve any
+necessary data, and return the appropriate answer to the original request.
+This must be done even if mib2c is being used to generate the framework of
+the implementation. As has been indicated earlier, the different cases are
+handled using a switch statement, with the Magic Number field of the vp
+parameter being used to distinguish between them.
+The data necessary for answering the request can be retrieved for each
+variable individually in the relevant case statement (as is the case with
+the system group), or using a common block of data before processing the
+switch (as is done for the ICMP group, among others).
+
+With many of the modules implemented so far, this data is read from a kernel
+structure. This can be done using the auto_nlist routine already mentioned,
+providing a variable in which to store the results and an indication of its
+size (see the !HAVE_SYS_TCPIPSTATS_H case of the ICMP group for an example).
+Alternatively, there may be ioctl calls on suitable devices, specific system
+calls, or special files that can be read to provide the necessary
+information.
+
+If the available data provides the requested value immediately, then the
+individual branch becomes a simple assignment to the appropriate static
+return variable - either one of the global static variables (e.g. long_return)
+or the local equivalents (such as generated by mib2c).
+Otherwise, the requested value may need to be calculated by combining two or
+more items of data (e.g. IPINHDRERRORS in mibII/ip.c) or by applying a
+mapping or other calculation involving available information (e.g.
+IPFORWARDING from the same group).
+
+In each of these cases, the routine should return a pointer to the result
+value, casting this to the pseudo-generic (u_char *)
+
+So much for the scalar case. The next part looks at how to handle simple
+tables.
+
+6. Simple tables
+================
+
+Having considered the simplest style of module implementation, we now turn
+our attention to the next style - a simple table. The tabular nature of
+these is immediately apparent from the MIB definition file, but the
+qualifier "simple" deserves a word of explanation.
+A simple table, in this context, has four characteristics:
+
+ 1. It is indexed by a single integer value;
+ 2. Such indices run from 1 to a determinable maximum;
+ 3. All indices within this range are valid;
+ 4. The data for a particular index can be retrieved directly
+ (e.g. by indexing into an underlying data structure).
+
+If any of the conditions are not met, then the table is not a pure simple
+one, and the techniques described here are not applicable. The next section
+of this guide will cover the more general case. (In fact, it may be possible
+to use the bulk of the techniques covered here, though special handling will
+be needed to cope with the invalid assumption or assumptions). Note that
+mib2c assumes that all tables are simple.
+
+As with the scalar case, the variable routine needs to provide two basic
+functions - request validation and data retrieval.
+
+Validation
+----------
+
+This is provided by the shared utility routine header_simple_table. As with
+the scalar header routine, this takes the same parameters as the main
+variable routine, with one addition - the maximum valid index. Mib2c
+generates a dummy token for this, which must be replaced by the appropriate
+value.
+As with the header routine, it also returns an indication of whether the
+request was valid, as well as setting up the return parameters with the
+matching OID information, and defaults for var_len and write_method.
+Note that in releases prior to 3.6, this job was performed by the routine
+checkmib. However, the return values of this were the reverse of those for
+generic_header and header_simple_table. A version of checkmib is still
+available for compatability purposes, but you are encouraged to use
+header_simple_table instead.
+
+The basic code fragment (see ucd-snmp/disk.c) is therefore of the form:
+
+ unsigned char *
+ var_extensible_disk(vp, name, length, exact, var_len, write_method)
+ {
+ if (header_simple_table(vp,name,length,exact,var_len,write_method,numdisks)
+ == MATCH_FAILED)
+ return(NULL);
+
+ [ etc, etc, etc ]
+
+ }
+
+Note that the maximum index value parameter does not have to be a
+permanently fixed constant. It specifies the maximum valid index at the time
+the request is processed, and a subsequent request may have a different
+maximum.
+An example of this can be seen in mibII/sysORTable.c where the table is held
+purely internally to the agent code, including its size (and hence the
+maximum valid index). This maximum could also be retrieved via a system
+call, or via a kernel data variable.
+
+Data Retrieval
+--------------
+
+As with the scalar case, the other required function is to retrieve the data
+requested. However, given the definition of a simple table this is simply a
+matter of using the single, integer index sub-identifier to index into an
+existing data structure. This index will always be the last index of the OID
+returned by header_simple_table, so can be obtained as name[*length-1].
+A good example of this type of table can be seen in ucd-snmp/disk.c
+
+With some modules, this underlying table may be relatively large, or only
+accessible via a slow or cumbersome interface. The implementation described
+so far may prove unacceptably slow, particularly when walking a MIB tree
+requires the table to be loaded afresh for each variable requested.
+
+In these circumstances, a useful technique is to cache the table when it is
+first read in, and use that cache for subsequent requests. This can be done
+by having a separate routine to read in the table. This uses two static
+variables, one a structure or array for the data itself, and the other an
+additional timestamp to indicate when the table was last loaded. When a call
+is made to this routine to "read" the table, it can first check whether the
+cached table is "new enough". If so, it can return immediately, and the
+system will use the cached data.
+Only if the cached version is sufficiently old that it's probably out of
+date, is it necessary to retrieve the current data, updating the cached
+version and the timestamp value.
+This is particularly useful if the data itself is relatively static, such as
+a list of mounted filesystems. There is an example of this technique in the
+Host Resources implementation.
+
+As with the scalar case, mib2c simply provides placeholder dummy return
+values. It's up to the programmer to fill in the details.
+
+The next part concludes the examination of the detailed implementation by
+looking at more general tables.
+
+7. General Tables
+=================
+
+Some table structures are not suitable for the simple table approach, due to
+the failure of one or more of the assumptions listed earlier. Perhaps they
+are indexed by something other than a single integer (such as a 4-octet IP
+address), or the maximum index is not easily determinable (such as the
+interfaces table), or not all indices are valid (running software), or the
+necessary data is not directly accessible (interfaces again).
+In such circumstances, a more general approach is needed. In contrast with
+the two styles already covered, this style of module will commonly combine
+the two functions of request validation and data retrieval. Note that mib2c
+will assume the simple table case, and this will need to be corrected.
+
+General table algorithm
+-----------------------
+
+The basic algorithm is as follows:
+
+ Perform any necessary initialization, then walk through the
+ underlying instances, retrieving the data for each one, until the
+ desired instance is found. If no valid entry is found, return
+ failure.
+
+For an exact match (GET and similar), identifying the desired instance is
+trivial - construct the OID (from the 'vp' variable parameter and the index
+value or values), and see whether it matches the requested OID.
+For GETNEXT, the situation is not quite so simple. Depending on the
+underlying representation of the data, the entries may be returned in the
+same order as they should appear in the table (i.e. lexically increasing by
+index). However, this is not guaranteed, and the natural way of retrieving
+the data may be in some "random" order. In this case, then the whole table
+needs to be traversed for each request. in order to determine the
+appropriate successor.
+This random order is the worst case, and dictates the structure of the code
+used in most currently implemented tables. The ordered case can be regarded
+as a simplification of this more general one.
+
+The algorithm outlined above can now be expanded into the following
+pseudo-code:
+
+ Init_{Name}_Entry(); // Perform any necessary initialisation
+
+ while (( index = Get_Next_{Name}_Entry() ) != EndMarker ) {
+ // This steps through the underlying table,
+ // returning the current index,
+ // or some suitable end-marker when all
+ // the entries have been examined.
+ // Note that this routine should also return the
+ // data for this entry, either via a parameter
+ // or using some external location.
+
+ construct OID from vp->name and index
+ compare new OID and request
+ if valid {
+ save current data
+ if finished // exact match, or ordered table
+ break; // so don't look at any more entries
+
+ }
+
+ // Otherwise, we need to loop round, and examine
+ // the next entry in the table. Either because
+ // the entry wasn't valid for this request,
+ // or the entry was a possible "next" candidate,
+ // but we don't know that there isn't there's a
+ // better one later in the table.
+ }
+
+ if no saved data // Nothing matched
+ return failure
+
+ // Otherwise, go on to the switch handling
+ // we've already covered in the earlier styles.
+
+This is now very close to the actual code used in many current
+implementations (such as the the routine header_ifEntry in
+mibII/interfaces.c). Notice that the pseudo-code fragment if valid expands
+in practise to
+
+ if ((exact && (result == 0)) ||
+ // GET request, and identical OIDs
+ (!exact && (result < 0)) )
+ // GETNEXT, and candidate OID is later
+ // than requested OID.
+
+This is a very common expression, that can be seen in most of the table
+implementations.
+
+Notice also that the interfaces table returns immediately the first valid
+entry is found, even for GETNEXT requests. This is because entries are
+returned in lexical order, so the first succeeding entry will be the one
+that's required.
+(As an aside, this also means that the underlying data can be saved
+implicitly within the 'next entry' routine - not very clean, but it saves
+some unnecessary copying).
+
+The more general case can be seen in the TCP and UDP tables (see mibII/tcp.c
+and mibII/udp.c). Here, the if valid fragment expands to:
+
+ if ( exact && (result == 0)) {
+ // save results
+ break;
+ }
+ else if (!exact && (result < 0)) {
+ if ( .... ) { // no saved OID, or this OID
+ // precedes the saved OID
+ // save this OID into 'lowest'
+ // save the results into Lowinpcb
+ // don't break, since we still need to look
+ // at the rest of the table
+ }
+ }
+
+The GET match handling is just as we've already seen - is this the requested
+OID or not. If so, save the results and move on to the switch statement.
+ The GETNEXT case is more complicated. As well as considering whether this
+is a possible match (using the same test we've already seen), we also have to
+check whether this is a better match than anything we've already seen. This
+is done by comparing the current candidate (newname) with the best match found
+so far (lowest).
+ Only if this extra comparison shows that the new OID is earlier than the
+saved one, do we need to save both the new OID, and any associated data
+(such as the inpcb block, and state flag). But having found one better
+match, we don't know that there isn't an even better one later on. So we
+can't break out of the enclosing loop - we need to keep going and examine
+all the remaining entries of the table.
+
+These two cases (the TCP and UDP tables) also show a more general style of
+indexing. Rather than simply appending a single index value to the OID
+prefix, these routines have to add the local four-octet IP address plus port
+(and the same for the remote end in the case of the TCP table). This is the
+purpose of the op and cp section of code that precedes the comparison.
+
+These two are probably among the most complex cases you are likely to
+encounter. If you can follow the code here, then you've probably cracked the
+problem of understanding how the agent works.
+
+Finally, the next part discusses how to implement a writable (or SETable)
+object in a MIB module.
+
+8. How to implement a SETable object
+====================================
+
+Finally, the only remaining area to cover is that of setting data - the
+handling of SNMPSET. Particular care should be taken here for two reasons.
+
+Firstly, any errors in the earlier sections can have limited effect. The
+worst that is likely to happen is that the agent will either return invalid
+information, or possibly crash. Either way, this is unlikely to affect the
+operation of the workstation as a whole. If there are problems in the
+writing routine, the results could be catastrophic (particularly if writing
+data directly into kernel memory).
+
+Secondly, this is the least well understood area of the agent, at least by
+the author. There are relatively few variables that are defined as READ-WRITE
+in the relevant MIBs, and even fewer that have actually been implemented as
+such. I'm therefore describing this from a combination of my understanding
+of how SETs ought to work, personal experience of very simple SET handling
+and what's actually been done by others (which do not necessarily coincide).
+
+There are also subtle differences between the setting of simple scalar
+variables (or individual entries within a table), and the creation of a new
+row within a table. This will therefore be considered separately.
+
+With these caveats, and a healthy dose of caution, let us proceed. Note that
+the UCD-SNMP development team can accept no responsibility for any damage or
+loss resulting from either following or ignoring the information presented
+here. You coded it - you fix it!
+
+Write routine
+-------------
+
+The heart of SET handling is the write_method parameter from the variable
+handling routine. This is a pointer to the relevant routine for setting the
+variable in question. Mib2c will generate one such routine for each setable
+variable. This routine should be declared using the template
+
+ int
+ write_variable(
+ int action,
+ u_char *var_val,
+ u_char var_val_type,
+ int var_val_len,
+ u_char *statP,
+ oid *name,
+ int name_len );
+
+Most of these parameters are fairly self explanatory:
+The last two hold the OID to be set, just as was passed to the main variable
+routine.
+
+The second, third and fourth parameters provide information about the new
+desired value, both the type, value and length. This is very similar to the
+way that results are returned from the main variable routine.
+
+The return value of the routine is simply an indication of whether the
+current stage of the SET was successful or not. We'll come back to this in a
+minute. Note that it is the responsibility of this routine to check that the
+OID and value provided are appropriate for the variable being implemented.
+This includes (but is not limited to) checking:
+
+ * the OID is recognised as one this routine can handle
+ (this should be true if the routine only handles the one variable, and
+ there are no errors in the main variable routine or driving code, but
+ it does no harm to check).
+ * the value requested is the correct type expected for this OID
+ * the value requested is appropriate for this OID
+ (within particular ranges, suitable length, etc, etc)
+
+There are two parameters remaining to be considered.
+
+The fifth parameter, statP, is the value that would be returned from a GET
+request on this particular variable. It could be used to check that the
+requested new value is consistent with the current state, but its main use
+is to denote that a new table row is being created.
+In most cases (particularly when dealing with scalar values or single elements
+of tables), you can normally simply ignore this parameter.
+
+Actions
+-------
+
+The final parameter to consider is the first one - action. To understand
+this, it's necessary to know a bit about how SETs are implemented.
+The design of SNMP calls for all variables in a SET request to be done "as
+if simultaneously" - i.e. they should all succeed or all fail. However, in
+practise, the variables are handled in succession. Thus, if one fails, it
+must be possible to "undo" any changes made to the other variables in the
+request.
+This is a well understood requirement in the database world, and is usually
+implemented using a "multi-stage commit". This is certainly the mechanism
+expected within the SNMP community (and has been made explicit in the work
+of the AgentX extensibility group). In other words, the routine to handle
+setting a variable will be called more than once, and the routine must be
+able to perform the appropriate actions depending on how far through the
+process we currently are. This is determined by the value of the action
+parameter.
+
+This is implemented using three basic phases:
+
+RESERVE is used to check the syntax of all the variables provided, that the
+values being set are sensible and consistent, and to allocate any resources
+required for performing the SET. After this stage, the expectation is that
+the set ought to succeed, though this is not guaranteed.
+(In fact, with the UCD agent, this is done in two passes - RESERVE1, and
+RESERVE2, to allow for dependancies between variables).
+
+If any of these calls fail (in either pass) the write routines are called
+again with the FREE action, to release any resources that have been
+allocated. The agent will then return a failure response to the requesting
+application.
+
+Assuming that the RESERVE phase was successful, the next stage is indicated
+by the action value ACTION. This is used to actually implement the set
+operation. However, this must either be done into temporary (persistent)
+storage, or the previous value stored similarly, in case any of the
+subsequent ACTION calls fail.
+ This can be seen in the example module, where both write routines have
+static 'old' variables, to hold the previous value of the relevant object.
+
+If the ACTION phase does fail (for example due to an apparently valid, but
+unacceptable value, or an unforeseen problem), then the list of write
+routines are called again, with the UNDO action. This requires the routine
+to reset the value that was changed to its previous value (assuming it was
+actually changed), and then to release any resources that had been
+allocated. As with the FREE phase, the agent will then return an indication
+of the error to the requesting application.
+
+Only once the ACTION phase has completed successfully, can the final COMMIT
+phase be run. This is used to complete any writes that were done into
+temporary storage, and then release any allocated resources. Note that all
+the code in this phase should be "safe" code that cannot possibly fail (cue
+hysterical laughter). The whole intent of the ACTION/COMMIT division is that
+all of the fallible code should be done in the ACTION phase, so that it can
+be backed out if necessary.
+
+Table row creation
+------------------
+
+What about creating new rows in a table, I hear you ask. Good Question.
+This case can often be detected by the fact that a GET request would have
+failed, and hence the fifth parameter, statP, will be null. This contrasts
+with changing the values of an element of an existing row, when the statP
+parameter would hold the previous value.
+
+The details of precisely how to create a new row will clearly depend on the
+underlying format of the table. However, one implementation strategy would
+be as follows:
+
+ * The first column object to be SET would return a null value from the
+ var_name routine. This null statP parameter would be the signal
+ to create a new temporary instance of the underlying data structure,
+ filled with dummy values.
+ * Subsequent column objects would return pointers to the appropriate
+ field of this new data structure from the var_name routine,
+ which would then be filled in by the write routine.
+ * Once all the necessary fields had been SET, the completed temporary
+ instance could be moved into the "standard" structure (or copied,
+ or otherwise used to set things up appropriately).
+
+However, this is purely a theoretical strategy, and has not been tried
+by the author. No guarantees are given as to whether this would actually
+work. There are also questions regarding how to handle incomplete
+or overlapping SET requests.
+Anyone who has experience of doing this, please get in touch!
+
+ ------------------------------------------------------------------------
+And that's it. Congratulations for getting this far. If you understand
+everything that's been said, then you now know as much as the rest of us
+about the inner workings of the UCD-SNMP agent. (Well, very nearly).
+All that remains is to try putting this into practise. Good luck!
+
+And if you've found this helpful, gifts of money, chocolate, alcohol, and
+above all feedback, would be most appreciated :-)
+
+ ------------------------------------------------------------------------
+Copyright 1999, 2000 - D.T.Shield.
+This file may be distributed as part of a source or binary packaging
+of the Net-SNMP software suite. It may not be distributed independently
+without the explicit permission of the author.
diff --git a/CHANGES b/CHANGES
new file mode 100644
index 0000000..11f217f
--- /dev/null
+++ b/CHANGES
@@ -0,0 +1,2470 @@
+This file contains a list of specific bugs that have been fixed, and patches
+that have been applied in released versions. Please see the NEWS file for
+a summary of the major changes, and the ChangeLog file for a comprehensive
+listing of all changes made to the code.
+
+*5.7.2*
+
+ snmplib:
+ - Add Doxygen-style function header for
+ netsnmp_register_default_target() and
+ netsnmp_clear_default_target().
+ - Add netsnmp_setenv().
+ - Avoid that system clock changes (e.g. by ntpd) affect code that
+ needs relative time Make sure that the range of the SNMPv3 variable
+ snmpEngineTime is 0..2147483647 on all supported systems instead of
+ 0..42949672 on some systems (i.e. wraparound after 497 days) Add
+ netsnmp_get_monotonic_clock(), netsnmp_set_monotonic_marker(),
+ netsnmp_ready_monotonic(), netsnmp_get_agent_runtime()
+ - Avoid that system clock changes (e.g. by ntpd) affect code that
+ needs relative time Make sure that the range of the SNMPv3 variable
+ snmpEngineTime is 0..2147483647 on all supported systems instead of
+ 0..42949672 on some systems (i.e. wraparound after 497 days) Add
+ netsnmp_get_monotonic_clock(), netsnmp_set_monotonic_marker(),
+ netsnmp_ready_monotonic(), netsnmp_get_agent_runtime() Deprecate
+ atime_diff(), atime_newMarker(), atime_ready(), atime_setMarker(),
+ marker_tticks(), netsnmp_marker_uptime(), netsnmp_timeval_uptime(),
+ timeval_tticks(), uatime_diff(), uatime_hdiff() and uatime_ready().
+ - Avoid waiting indefinitely if a session has timeout zero
+ - Declare "type" argument of se_store_list() / se_store_slist() /
+ se_store_enum_list() const
+ - Make it explicit that MAX_SUBID is an unsigned constant
+ - Make netsnmp_callback_accept() return -1 (failure) instead of 0
+ (STDIN_FILENO)
+ - Make netsnmp_large_fd_set_resize() robust against memory allocation
+ failures. Make NETSNMP_LARGE_FD_ZERO() use memset() on Unix systems
+ instead of an explicit loop.
+ - Make netsnmp_large_fd_set_resize() robust against memory allocation
+ failures. Make NETSNMP_LARGE_FD_ZERO() use memset() on Unix systems
+ instead of an explicit loop. Make sure that on Unix systems
+ netsnmp_large_fd_clr() doesn't try to read memory it isn't allowed
+ to read if the first argument equals -1 (a value that shouldn't be
+ passed by the caller).
+ - Merge together the Linux and *BSD version of src port sending.
+ - Only transform the address to printable form when needed.
+ - PATCH 3510454: Allow the use of 0.0.0.0/0 as alias for default
+ - Prevent gcc ped-warning for NETSNMP_REMOVE_CONST git-svn-id:
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@1
+ 8052 06827809-a52a-0410-b366-d66718629ded
+ - Reduce overhead of config file parsing
+ - Remove obsolete snmp_get_fd_for_session() declaration
+ - Separate out the cmesg buffer size
+ - Set the rpath for libperl.so in libnetsnmpmibs.so such that the
+ dynamic linker can find libperl.so without requiring the user to
+ modify the dynamic linker settings. This change in
+ agent/Makefile.in is necessary on the 5.5 branch and later but not
+ on the 5.4 branch. That is because the 5.4 branch uses an older
+ version of libtool that propagates the rpath of dependent
+ libraries. This is called inter-library dependency tracking in the
+ libtool manual. This functionality is present in libtool version 1
+ but not in libtool version 2. For more background information about
+ dynamic libraries and rpaths, see also the document with the title
+ "RpathIssue" on the Debian wiki
+ (http://wiki.debian.org/RpathIssue).
+ - Simplify implementation of functions manipulating 64-bit numbers.
+ - Simplify the se_store_enum_list() implementation
+ - Use SNMP_ALLOC_TYPEDEF to allocate transports in order to avoid the
+ separate call to memset.
+ - [PATCH 3414773]: Encode integer value using ASN_INTEGER
+ - [PATCH 3526599]: Don't hang on retried failing SNMPv3 responses
+ - PATCH 3560473: from fenner: Handle TimeTicks when pretty-printing
+ OID Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+ - Add the symbol NETSNMP_PRIo to help in printing oid values.
+ - Do not crash from empty values in --token=value arguments
+ - Do not crash on incomplete configuration tokens.
+ - Do not truncate single default transport domains
+ - Move the check that the pdu variable is non-NULL to before the
+ first dereference of it.
+
+ snmplib + snmpd + snmpwalk:
+ - Avoid that system clock changes (e.g. by ntpd) affect code that
+ needs relative time
+
+ snmplib, snmpd, perl:
+ - Eliminate dead variables agent/mibgroup/agentx/master_admin.c
+ agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_acc
+ ess.c agent/mibgroup/host/data_access/swinst_pkginfo.c
+ agent/mibgroup/host/data_access/swrun_procfs_status.c
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c
+ agent/mibgroup/mibII/kernel_linux.c
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access
+ .c apps/snmptls.c apps/snmptrapd_log.c snmplib/dir_utils.c
+ snmplib/snmp_client.c snmplib/snmp_openssl.c
+ snmplib/transports/snmpTLSTCPDomain.c
+ - BUG: 3517030: Ensure large tables are walked properly
+ - BUG: 3541012: Fix handling of gettable columns
+ - [PATCH 3529541]: Don't refer to internal 'my' variables from
+ external scripts Fix provided by Lezz Giles
+
+ snmp:
+ - Bridge-mib: Fix index interpretation. This patch corrects a wrong
+ data interpretation. snmp-bridge-mib obtains the ifindex value from
+ the sysfs attribute 'ifindex' The value given by the sysfs
+ attribute is an integer, which is handled as hex and leads to
+ incorrect data displayed to the user. e.g. $ > snmpwalk localhost
+ BRIDGE-MIB::dot1dBasePortIfIndex.2
+ BRIDGE-MIB::dot1dBasePortIfIndex.2 = INTEGER: 54 according to the
+ sysfs attribute the value is 36 $ > cat
+ /sys/class/net/<device>/ifindex 36 Signed-off-by: Mijo Safradin
+ <safradin@linux.vnet.ibm.com>
+
+ snmpd:
+ - Lowered severity of 'Error expanding XXX to 64bits' messages.
+ - Removed error log messages when IPv6 is disabled.
+ - Add missing debug tag
+ - Add netsnmp_get_next_alarm_time()
+ - Avoid that system clock changes (e.g. by ntpd) affect code that
+ needs relative time Make sure that the range of the SNMPv3 variable
+ snmpEngineTime is 0..2147483647 on all supported systems instead of
+ 0..42949672 on some systems (i.e. wraparound after 497 days)
+ - BUG 3542188: Correct sysORDescr for snmpUsmMIB. Thanks to Dave
+ Vucich for reporting this.
+ - BUG 3542307: Correct sysORID for snmpMPDStats. Thanks to Dave
+ Vucich for reporting this.
+ - BUG: 3439234: Correct the dependencies of ucd-snmp/pass and
+ ucd-snmp/pass_persist
+ - BUG: 3439234: Move netsnmp_pass_str_to_errno to pass_common and
+ rename it to netsnmp_internal_pass_str_to_errno
+ - BUG: 3463767: Handle parsing subidentifiers > 2^31
+ - BUG: 3532090: Fix high ifIndex values crashing hrDeviceDescr
+ - Call snmp_oidtree_compare instead of snmp_oid_min_compare
+ - DISMAN-PING-MIB: Avoid dangling pointers (based on patch 3503259)
+ - DISMAN-PING-MIB: Avoid reading freed memory when deleting a row
+ from a table
+ - DISMAN-PING-MIB: Do not send the contents of the stack over the
+ network
+ - DISMAN-PING-MIB: Don't call exit() upon memory allocation failure
+ - DISMAN-PING-MIB: Fix IPv6 socket leak in error paths
+ - DISMAN-PING-MIB: Fix a socket leak triggered by pinging a remote
+ host
+ - DISMAN-PING-MIB: Fix more memory leaks
+ - DISMAN-PING-MIB: Fix several memory leaks
+ - DISMAN-PING-MIB: Make ping implementation independent of ntpd clock
+ jumps
+ - DISMAN-PING-MIB: Make pinging local interface addresses work
+ - DISMAN-SCHEDULER-MIB: Handle 32-character schedContextName values
+ correctly. See also commit
+ b3c4982542e0ab151fb3884754cdfbcb472da52d.
+ - Disable the support for integer64 in pass scripts if compiling
+ without opaque-special-types.
+ - Factor out asc2bin and bin2asc. Add a netsnmp_internal_ prefix to
+ them
+ - Fixed UCD-SNMP-MIB::systemStats after 30 days of uptime. After 30
+ days, values from /proc/stat (on Linux) can get bigger than 32bits
+ and snmpd calculations might render counters like ssCpuUser
+ negative or zero, while the real value is higher. Therefore the
+ counters should be tracked as the largest integer available.
+ - Fixed snmpd '-d' option. Now it dumps packets again.
+ - IF-MIB::ifType: Report type "infiniband (199)" for InfiniBand
+ interfaces instead of type "other (1)".
+ - Init_agent() + init_kmem(): Return an error value instead of
+ invoking exit() if access to kernel virtual memory is denied
+ - Make the configuration of the dlmod module fail rather than
+ generate a dummy module if the dlopen function isn't available.
+ - Match each getpwnam()/getpwuid() call with an endpwent() call and
+ each getgrent() call with an endgrent() call.
+ - PATCH 3402376: from Leonardo Chiquitto: Recognise ReiserFS Also
+ move various FSType definitions to the appropriate blocks
+ - PATCH 3453868: from "Bill Fenner <fenner@gmail.com>": Factor common
+ code into pass_common Move the code for pormatting and printing
+ values from pass and pass_persist into pass_common.
+ - PATCH: 3487867: Don't skip missing ifXTable entries
+ (ifConnectorPresent FALSE)
+ - Pass_persist: Fixes a race condition introduced in commit
+ 31fa07cd9ffde46d41d2b5838c3fc4d01548bfb5. The following race
+ condition could happen: - A system call fails and errno is set
+ accordingly by the C library. - SIGCHLD handler invokes a system
+ call that fails and hence overwrites errno. - SIGCHLD handler
+ leaves. - original context checks errno and finds the value from
+ the system call invoked by the SIGCHLD handler instead of the
+ system call that failed originally. Other fixes included in this
+ patch: - Renamed deinit_pass_persist() into shutdown_pass_persist()
+ such that this function gets called during agent shutdown. - Made
+ sure that shutdown_pass_persist() is called by the Windows
+ snmpd.exe too. - Windows: avoid calling
+ CloseHandle(INVALID_HANDLE_VALUE). - Windows: avoid that closing a
+ pass_persist pipe triggers a crash. - Windows: pass_persist: close
+ handles of finished processes.
+ agent/mibgroup/ucd-snmp/pass_persist.c win32/mib_module_shutdown.h
+ - Smux: simplify smux_list_detach()
+ - UDP-MIB: Report the proper address in udpLocalAddress instead of
+ 0.0.0.0. Makes test T160snmpnetstat pass again. Fixes a bug
+ introduced in commit c76fb96f65e33ba2fd212a921e8c386155ee5c7a.
+ - [BUG 3460364]: Fix use of block factor when detecting error
+ conditions
+ - [BUG 3489631]: Fix incorrect handling of UCD monitoring flag
+ - [PATCH 3410050]: Skip already-'processed' varbinds Based on mib2c
+ patch provided by Stephen Turner
+ - [PATCH 3410059]: Fix sparsely augmenting trigger tables Patch
+ provided by Stephen Turner
+ - [PATCH 3447444]: Fix SIG_PIPE handling Patch provided by Bill
+ Fenner
+ - [PATCH 3447671]: Fix override handling of OID values Patch supplied
+ by Phillip O'Donnell
+ - [PATCH 3479740]: Fix hrSWRunPerf statistics
+ - [PATCH 3487919]: Fix compilation when caching is disabled
+ - [PATCH 3495697]: Store persistent snmpTarget table changes
+ - BUG 3542188: Correct sysORDescr for snmpUsmMIB. Thanks to Dave
+ Vucich for reporting this.
+ - BUG 3542307: Correct sysORID for snmpMPDStats. Thanks to Dave
+ Vucich for reporting this.
+ - BUG: 3543864: Remove extraneous function type (and fix a related
+ typo)
+ - Removed limit of 'exec' and 'sh' entries in snmpd.conf Use dynamic
+ (re)allocation instead.
+ - [PATCH 3543000]: Various fixes to Rmon code Supplied by Patrick
+ Ritter
+
+ snmpdx:
+ - [PATCH 3445437]: Log AgentX disconnections (in line with
+ connections) Patch provided by Bill Fenner
+
+ snmptrapd:
+ - Avoid crash during shutdown due to invoking perl_destruct(NULL)
+ - Do not invoke shutdown_perl() from inside the SIGTERM handler since
+ that fails if SIGTERM is received while a Perl handler is active.
+ Based on a patch posted by Joel Avni <javni@arubanetworks.com>
+ - Eliminate an unused variable (Now)
+ - Move the main loop code into a new function
+ - Remove superfluous casts
+
+ snmptrapd_sql:
+ - Avoid that a linker error is triggered on systems where my_progname
+ is missing in libmysqlclient (e.g. Fedora 15 and 16). This is a
+ backport of commit 9f653f7.
+
+ aix:
+ - Eliminate configure warning regarding libperfstat.h on AIX 6.1 and
+ up
+ - PATCH 3403433: from blentz: Issues with hrSWRunName and Parameters
+ on AIX Signed-off-by: Wes Hardaker
+ <hardaker@users.sourceforge.net>
+
+ apps, snmplib:
+ - PATCH: 2835577: identified by "Bart Van Assche": Replace SNMP_ZERO
+ of arrays with a memset. git-svn-id:
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@1
+ 7797 06827809-a52a-0410-b366-d66718629ded
+ - BUG: 3529768: Be more careful when stripping off numeric suffixes
+
+ build:
+ - Do not generate an output file on failure make supposes that no
+ output is generated if the command failed. Change feature-remove to
+ follow that presumption.
+ - BUG: 3532234: Fix typo in libtool script (addressed properly in
+ libtool 2.4.2)
+
+ building:
+ - Add dependencies on @FEATURETARGS@ to make the subtarget work as
+ well.
+ - Add missing end comments to feature ifndefs.
+ - Add target to build agentxtrap from the toplevel
+ - Build fix for systems lacking field msg_flags in struct msghdr
+ (e.g. IRIX)
+ - Build fix for systems lacking fields msg_control/msg_flags in
+ struct msghdr (backport)
+ - Correct dependencies - since
+ bf74fea69f24dc6e85f908f3f41d1426b2e09688 snmpconf is located in
+ builddir, not srcdir
+ - Correct dependencies - since
+ bf74fea69f24dc6e85f908f3f41d1426b2e09688 snmpconf is located in
+ builddir, not srcdir" This reverts commit
+ 9efa467a972bb6e1c7fbdaf2e27429d29f4ab89e.
+ - Make the transport configuration code work again Previously the
+ transport inheritance processing code ran with
+ NETSNMP_FEATURE_CHECKING set. In this mode the file
+ net-snmp/feature-details.h is requiered. That file is created
+ during the first make run, and that happens after configure is run.
+ Change this to undefine NETSNMP_MINIMAL_CODE, effectively turning
+ off feature support during transport configuration in order to make
+ it work at all.
+ - Run libtool --mode=finish on the right directory
+
+ libnetsnmp:
+ - PATCH 3394586: from rwa-co: file descriptor leak in read_config
+ (+fix) Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+ libsnmp:
+ - Changed the type of the fourth argument of netsnmp_set_row_column()
+ from const char* to const void* such that no cast is necessary when
+ passing another datatype then char* or const char*.
+
+ man:
+ - [BUG 3490708]: Clarify use of common command-line options
+ - BUG: 3535269: Document use of [snmp] for client-side tools.
+
+ pass:
+
+ perl:
+ - Add agent::uptime()
+ - Enable sending SNMPv2 traps with an empty varbind list
+ - Fix spelling in the documentation of the SNMP module
+ - Fixed segmentation fault when handler registration fails. When
+ netsnmp_register_handler fails, it frees its reginfo ->
+ nsahr_DESTROY (and any other function) must not dereference it.
+ - Perl: Make sure that the constant SNMP_DEFAULT_RETRIES is
+ recognized. SNMP module: Add constants
+ NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE and
+ NETSNMP_CALLBACK_OP_TIMED_OUT. When the Net-SNMP Perl modules are
+ built on Windows with MSVC or MinGW it is possible that each these
+ are linked with another version of the MSVC runtime library than
+ the Perl interpreter itself. In that case the "errno" variable used
+ inside .xs source files is another variable than the $! variable in
+ .pm files. Or: assignments to "errno" in a .xs file do not modify
+ the "$!" Perl variable This patch avoids using "errno" by modifying
+ the different constant() functions such that these return a
+ two-element array instead of returning a scalar and setting errno.
+
+ python:
+ - Avoid that an SNMP set with UseEnums enabled causes a segmentation
+ fault
+ - [PATCH 3433846]: Fix for use with python 2.4
+ - BUG: 3535967: Fix memory leak - snmp_{sess_}error allocates the
+ output buffer
+
+ testing:
+ - Add a test for se_store_list()
+ - Add testing/fulltests/default/T154dismanpingmib_simple
+ - Avoid false negative for T114agentxagentxtrap_simple caused by the
+ test result being present in the hex dump ("mostly_harmless")
+ - Convert snmplib/test_binary_array.c into two unit tests
+ - Fix Perl regression test failures All Perl regression tests pass
+ now on Linux and on Windows (MSVC).
+ - Make the asn1 test pass even if support for opaque types are
+ removed.
+ - Perl regression tests: Don't fail skipped tests.
+ - Protect the use of $OSTYPE to ensure that 'test' get enough
+ parameters.
+ - Remove an incorrect comment from simple_eval_tools.sh
+ - Remove unused variable
+ - Require a semicolon after OK(), OKF() and PLAN() Also, let OKF()
+ emit a single line of output such that all output it produces is
+ visible in the output of "make test".
+ - [BUG 3474590]: Don't match underscores within the source root
+ filename
+ - Add test cases for snmp_service
+
+ unspecified:
+ - Added CVFS (CentraVision File System) to hrStorageTable and
+ hrFSTable.
+ - Removed counter-64 error messages. These messages do not say
+ enything useful, caller should check their return value and report
+ it.
+ - Added OCFS2 (Oracle Cluster FS) to hrStorageTable and hrFSTable
+ - [BUG 3444939]: BUG: 1796886: snmplib: Avoid that
+ sprint_realloc_octet_string() embeds unprintable control characters
+ or binary zeroes in its output. This behavior could cause truncated
+ output in snmptrapd.
+ - [BUG 3452069]: Fix snmptrap_oid declaration in mib2c generated code
+ This bug was introduced considerable time ago. It did already exist
+ at the time the 5.6 branch was created (see also commit
+ 0ec088afa27cfda4e6ea78aae7cfc5507564edde).
+ - [BUG 3454168]: configure: Fix building with --enable-read-only
+ - [PATCH 3418649]: HOST-RESOURCES-MIB: Use pclose() instead of
+ fclose() to close a pipe.
+ - [BUG 3540621]: dist: Add missing Provides: to net-snmp-perlmods RPM
+ spec
+
+ BSD:
+
+ Bug 3152841:
+ - Do not install the util_funcs subheaders that were removed in 5.7
+ - Install util_funcs subheaders
+ - Install util_funcs subheaders introduced in 5.6
+
+ Cygwin:
+ - Make date_n_time() produce time zone information
+
+ Cywin:
+ - Agent: Implement get_uptime() such that querying
+ HOST-RESOURCES-MIB::hrSystemUptime returns a non-zero value.
+
+ FreeBSD:
+ - Restore IP_RECVDSTADDR functionality.
+ - Snmpd + apps: Sending UDP packets works again for non-root users
+ - [PATCH 3489387]: Install FreeBSD 10 header file (plus other missing
+ versions)
+
+ Linux:
+ - PATCH: 3525998: Don't use an uninitialised value in error message
+ - [PATCH 3536420]: Ensure snd/rcv memory buffers are suitably aligned
+ Patch provided by Tyler Olmstead
+
+ MinGW:
+ - Net-SNMP Perl modules build again.
+ - Support the directory structure of recent Shining Light OpenSSL
+ binary distributions
+ - Testing: Fix a race condition in the test framework
+ - Testing: Fix a race condition in the test runner
+ - Testing: Make test T130snmpv1vacmget_simple pass
+ - Testing: Make those regression tests pass for which SNMPCONFPATH
+ and/or SNMP_PERSISTENT_DIR matter
+ - Testing: Make unit-tests/T014gethostbyaddr_clib pass
+ - Testing: Make unit-tests/T102pdu_build_clib pass.
+ - Testing: Obtain the MSYS path from the environment
+
+ Win32:
+ - Avoid that compiling the header file <net-snmp/net-snmp-config.h>
+ with the MinGW gcc compiler triggers warnings about "pragma
+ comment".
+ - Avoid that the PACKAGE_* macros defined in
+ <net-snmp/net-snmp-config.h> cause trouble when including this
+ header in a package that uses the GNU autotools.
+ - Building: Builds now correctly with a 64-bit compiler. git-svn-id:
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@1
+ 9458 06827809-a52a-0410-b366-d66718629ded
+ - Snmpd: Remove dlmod
+
+ Windows:
+ - Building (build.bat): Install netsnmp.dll before running the Perl
+ regression tests such that the regression tests are run with the
+ correct version of netsnmp.dll.
+ - MSVC: Avoid that the typedefs in <net-snmp/net-snmp-config.h>
+ conflict with those in <stdint.h> from the msinttypes project
+ - MSVC: Link with proper libeay32 library
+ - MSVC: When linking with OpenSSL, link with user32.lib too
+ - Make netsnmp_large_fd_set_resize() robust against memory allocation
+ failures. Make NETSNMP_LARGE_FD_ZERO() use memset() on Unix systems
+ instead of an explicit loop. Make sure that on Unix systems
+ netsnmp_large_fd_clr() doesn't try to read memory it isn't allowed
+ to read if the first argument equals -1 (a value that shouldn't be
+ passed by the caller). Make netsnmp_large_fd_is_set() return false
+ on Unix systems if the first argument equals -1 (a value that
+ shouldn't be passed by the caller). Make
+ netsnmp_large_fd_set_resize() shrink behavior correct.
+ - Perl (build.bat): When installing development files, install the
+ PDB files too.
+ - Remove superfluous link libraries from project files (*.dsp)
+ - Snmptrapd: Make the IP address to hostname conversion work
+ - Testing: perl: Fix an incorrect message printed while running the
+ Perl module regression tests
+
+
+
+
+*5.7.1*
+
+ snmplib:
+ - Fix a crash that could be
+ - tweak patch 3044888 to restore
+
+ snmpd:
+ - [PATCH 3386633]: fix integer overflow in disk percent calculations
+ - Make
+ - Restore storage tables on Linux
+ - run signal handlers when select()
+
+ snmptrapd:
+ - Add missing newline
+ - Invoke shutdown_perl() when
+
+ building:
+ - [PATCH 3383951]: Fix -Wunused compile warnings with FreeBSD/NetBSD
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+ - build fix
+ - build fix for systems lacking
+
+ libnetsnmp:
+ - [PATCH 3387139]: from
+
+ man:
+ - [PATCH 3312861]: Man pages
+
+ testing:
+ - Changed
+ - Check PID file existence after having read it instead of before.
+ This fixes the race condition where the PID file disappeared after
+ the existence check and before it was read.
+ - Make the SNMP_VERBOSE=1 output even more verbose.
+
+ unspecified:
+ - minor NEWS polish
+
+ Perl:
+ - Remove file perl/NetSNMP.xs
+
+ Win32:
+ - Add support for
+ - Document how to build 64-bit
+ - Documented how to use build.bat with
+ - winExtDLL: Invoke
+
+ Windows:
+ - Avoid that if
+ - Remove outdated instructions about
+
+*5.7*
+ snmplib:
+ - Added function netsnmp_delete_table_data_set().
+ - Added function netsnmp_delete_table_data_set(). Added declaration
+ for the function netsnmp_table_data_delete_table() in a public
+ agent header file.
+ - Added function netsnmp_delete_table_data_set(). Added declaration
+ for the function netsnmp_table_data_delete_table() in a public
+ agent header file. Fixed memory leak in
+ netsnmp_table_data_delete_table().
+ - Added function netsnmp_delete_table_data_set(). Added declaration
+ for the function netsnmp_table_data_delete_table() in a public
+ agent header file. Fixed memory leak in
+ netsnmp_table_data_delete_table(). Fixed memory leak triggered by
+ unregistering a table handler.
+ - Added macro netsnmp_static_assert().
+ - Added netsnmp_mib_handler.data_clone, a function pointer that
+ defines how to clone netsnmp_mib_handler.myvoid. Must be defined if
+ and only if data_free is set. The function netsnmp_handler_dup()
+ does now clone MIB handler private data if data_clone() is set.
+ Previously after duplicating a MIB handler and unregistering one of
+ the two MIB handlers, the private data pointer (myvoid) of the
+ other became a dangling pointer. Note: addition of
+ netsnmp_mib_handler.data_clone is an ABI change.
+ - Added snmp_sess_session_lookup().
+ - Added the function netsnmp_check_definedness(), which helps to find
+ the cause of undefined value errors as reported by Valgrind.
+ - Avoid that Valgrind complains about uninitialized data for the
+ buffers returned by netsnmp_callback_recv() and
+ netsnmp_callback_hook_build().
+ - Be const correct over calls to str* functions.
+ - Changed the argument type of debug_register_tokens() from char *
+ into const char *.
+ - Check that the argument to netsnmp_transport_copy is non-NULL
+ - Check the return value of strdup in netsnmp_create_data_list and
+ fail if strdup fails.
+ - Correct the extern "C" declarations to be consistent. Remove
+ commented out code.
+ - Fenner: fix sending of UDP responses from multihomed agents. Try to
+ send the response as it was before Net-SNMP 5.6 (assuming the
+ appropriate request was unicast) and only if it fails try to set
+ if_index (the request must be broadcast).
+ - Fixed bugs in asn_parse_unsigned_int64(),
+ asn_build_unsigned_int64(), asn_parse_signed_int64() and
+ asn_build_signed_int64(). Most but not all of these bugs were
+ specific to 64-bit systems. Fixes bug #3093199.
+ - Fixed memory leak triggered by calling se_add_pair_to_list() with a
+ value that already existed in the list.
+ - Invoking se_clear_slist() does no longer create a dangling pointer.
+ - Invoking se_clear_slist() does no longer create a dangling pointer.
+ Fixed leaks-at-exit triggered by using the snmp_enum code.
+ - Invoking se_clear_slist() does no longer create a dangling pointer.
+ Fixed leaks-at-exit triggered by using the snmp_enum code.
+ Documented behavior of se_add_pair(), se_add_pair_to_slist() and
+ clear_snmp_enum(). Made snmp_enum example consistent with the rest
+ of the code by adding strdup() calls and added a call to
+ se_clear_all_lists().
+ - Invoking se_clear_slist() does no longer create a dangling pointer.
+ Fixed leaks-at-exit triggered by using the snmp_enum code.
+ Documented behavior of se_add_pair(), se_add_pair_to_slist() and
+ clear_snmp_enum(). Made snmp_enum example consistent with the rest
+ of the code by adding strdup() calls and added a call to
+ se_clear_all_lists(). Fixed a memory corruption problem triggered
+ by the (undocumented) snmpd.conf "enum" keyword handler - storing
+ pointers to strings allocated on the stack in a global list does
+ not work.
+ - Remove the support for CMU compatibility since there is no way to
+ enable it and nobody have missed it.
+ - [BUG 3134323]: Fix crash when comparing invalid OIDs
+ - [PATCH 3165878]: Catch buffer overrun on 64-bit systems
+ - [PATCH 3195537]: Minor binary_array container sort optimization
+ - [PATCH 3203806]: Add the function netsnmp_large_select().
+ - [PATCH 3203806]: Make netsnmp_large_fd_set_resize() clear all
+ relevant file descriptors.
+ - [PATCH 3203806]: Minor performance optimization of
+ netsnmp_large_fd_set_resize().
+ - add IPv6 support to DTLSUDP transport
+ - add IPv6 support to DTLSUDP transport use new
+ netsnmp_sockaddr_storage in netsnmp_addr_pair
+ - add IPv6 support to DTLSUDP transport use new
+ netsnmp_sockaddr_storage in netsnmp_addr_pair add base_transport
+ ptr for tunneled transports
+ - add more openssl error cases where we check for local cert
+ - add new transport config tokens localCert/peerCert, deprecate
+ our_identity, their_identity
+ - add optional support for local DNSSEC validation of hostnames -
+ optional at configure time: --with-local-dnssec-validation -
+ requires DNSSEC-Tool validation libraries - initial support, for
+ systems with getaddrinfo. support for additional resolver
+ interfaces coming soon. - also TODO: flag for ignoring validatoin
+ errors (log & continue)
+ - dont return empty array
+ - force a ; at the end of the static_assert macro.
+ - introduce new localCert/peerCert, deprecate serverCert, clientCert,
+ defX509ServerPub, defX509ClientPub
+ - netsnmp_handler_dup(): freeing the duplicated handler no longer
+ causes a crash (double free) when handler->myvoid of the original
+ handler was non-NULL.
+ - realloc+init instead of calloc inspired by patch 3195532 from
+ Stephen Hemminger
+ - refine cert debugging; remove unused function
+ - remove inline versions of container funcs
+ - snmp_shutdown(): added call to netsnmp_certs_shutdown().
+ - 0 Applied the intent of patch 3044888 to allow applications to read
+ the error messages of a MIB parsing failure.
+ - Fixed a memory leak in snmp_free_session().
+ - [BUG 3184697]: Don't reference internal MD5 when it's explicitly
+ disabled
+ - [BUG 3234754]: Ensure old f_create_from_tstring hook is initialized
+ to NULL
+ - [BUG 3264852]: Recognise missing report types
+ (snmp{Unavailable,Unknown}Contexts,snmpUnknownPDUHandlers)
+ - _mibindex_add() no longer reads past the end of the dynamically
+ allocated array _mibindexes.
+ - [BUG 3151845]: fix multiple registrations of snmp transport handler
+
+ snmp:
+ - patch: 3096725: sysORTable registation for notification log mib
+ original patch fixed several issues, other parts applied earlier
+
+ snmpd:
+ - Add missing function declaration
+ - Added functions netsnmp_handler_owns_tabreq(),
+ netsnmp_registration_owns_tabreq(), netsnmp_iterator_clone().
+ Exported netsnmp_table_registration_info_clone().
+ - Added functions netsnmp_handler_owns_tabreq(),
+ netsnmp_registration_owns_tabreq(), netsnmp_iterator_clone().
+ Exported netsnmp_table_registration_info_clone(). Modified
+ netsnmp_iterator_delete_table() such that it frees the table
+ registration information stored in a table iterator too. Modified
+ netsnmp_get_table_iterator_handler() such that the table iterator
+ passed to this function is freed when the associated handler is
+ freed. Restored the behavior of netsnmp_get_table_handler() to that
+ of r19449, that is, not setting up the data_free pointer because
+ not all callers of netsnmp_get_table_handler() expect that table
+ registration information is freed when the associated handler is
+ freed.
+ - Added netsnmp_get_table_iterator2().
+ - Added netsnmp_get_table_iterator2(). Added
+ netsnmp_register_table_iterator2().
+ - Added netsnmp_get_table_iterator2(). Added
+ netsnmp_register_table_iterator2(). Added
+ netsnmp_handler_owns_iterator_info().
+ - Added netsnmp_get_table_iterator2(). Added
+ netsnmp_register_table_iterator2(). Added
+ netsnmp_handler_owns_iterator_info(). Fixed leak-at-exit triggered
+ by snmpNotifyTable.
+ - Added netsnmp_get_table_iterator2(). Added
+ netsnmp_register_table_iterator2(). Added
+ netsnmp_handler_owns_iterator_info(). Fixed leak-at-exit triggered
+ by snmpNotifyTable. Fixed leak-at-exit triggered by
+ snmpTargetAddrTable. Also, restored backwards compatibility of
+ netsnmp_register_table_iterator().
+ - Added netsnmp_register_watched_instance2(),
+ netsnmp_register_watched_scalar2(), netsnmp_clone_watcher_info()
+ and netsnmp_owns_watcher_info(). See also the Doxygen comments for
+ more info.
+ - Added netsnmp_unregister_auto_data_table().
+ - Added reference count in the netsnmp_baby_steps_modes data
+ structure and made sure that this data structure is automatically
+ freed when the handler that owns it is unregistered.
+ - Added snmp_sess_session_lookup(). Call shutdown_master_agent() and
+ shutdown_agent() during shutdown.
+ - Added snmp_sess_session_lookup(). Call shutdown_master_agent() and
+ shutdown_agent() during shutdown. The function clean_subtree() does
+ no longer trigger double frees and invalid memory reads. Note: this
+ function was already wrong at the time it was introduced (patch
+ #724925 / r8531, July 2003).
+ - Added snmp_sess_session_lookup(). Call shutdown_master_agent() and
+ shutdown_agent() during shutdown. The function clean_subtree() does
+ no longer trigger double frees and invalid memory reads. Note: this
+ function was already wrong at the time it was introduced (patch
+ #724925 / r8531, July 2003). Removed a comment in
+ netsnmp_handler_free() that is now obsolete because of the
+ clean_subtree() changes.
+ - Added snmp_sess_session_lookup(). Call shutdown_master_agent() and
+ shutdown_agent() during shutdown. The function clean_subtree() does
+ no longer trigger double frees and invalid memory reads. Note: this
+ function was already wrong at the time it was introduced (patch
+ #724925 / r8531, July 2003). Removed a comment in
+ netsnmp_handler_free() that is now obsolete because of the
+ clean_subtree() changes. Modified netsnmp_deregister_agent_nsap()
+ such that it never examines sessions that already have been closed.
+ It is for this change that it was necessary to introduce the new
+ function snmp_sess_session_lookup().
+ - Added the functions netsnmp_duplicate_variable() and
+ netsnmp_cache_handler_owns_cache().
+ - Added the functions netsnmp_duplicate_variable() and
+ netsnmp_cache_handler_owns_cache(). Memory allocated by
+ netsnmp_register_old_api() for storing SNMP variables is now freed
+ when the associated handler is unregistered.
+ - Added the functions netsnmp_duplicate_variable() and
+ netsnmp_cache_handler_owns_cache(). Memory allocated by
+ netsnmp_register_old_api() for storing SNMP variables is now freed
+ when the associated handler is unregistered. Callback function data
+ deallocation does no longer free the memory allocated for the
+ AgentX session - the memory that was allocated for AgentX sessions
+ is now deallocated just as that for any other session. This fixes a
+ leak-at-exit.
+ - Added the functions netsnmp_duplicate_variable() and
+ netsnmp_cache_handler_owns_cache(). Memory allocated by
+ netsnmp_register_old_api() for storing SNMP variables is now freed
+ when the associated handler is unregistered. Callback function data
+ deallocation does no longer free the memory allocated for the
+ AgentX session - the memory that was allocated for AgentX sessions
+ is now deallocated just as that for any other session. This fixes a
+ leak-at-exit. Notify filter table: Callback function data
+ deallocation does no longer free the data in *
+ *snmpNotifyFilterTable_if_ctx.container - this is now done by
+ shutdown_snmpNotifyFilterTable() and
+ - Automatically free the private data structure allocated by
+ netsnmp_container_table_handler_get().
+ - Builds with most recent MinGW (having #define localtime_r).
+ - Count the number of users of a netsnmp_cache data structure instead
+ of duplicating it.
+ - Declare the OID argument type of MIB registration functions as
+ 'const oid *' instead of 'oid *' since these functions do not
+ modify the OID.
+ - Do not leak the limits of scalar_group objects on shutdown.
+ - Extend the documentation for data_clone and data_free
+ - Factor out common config_add_mib statments
+ - Find out whether librpm is available before configuring the agent
+ modules because host/data/access/swinst needs symbol HAVE_LIBRPM.
+ As a result, configure has to be run only once instead of twice to
+ enable the hrSWInstalled table on systems that have librpm.
+ - Fixed a double free at exit that was triggered by cleaning up the
+ data structures used for embedded Perl support.
+ - Fixed a year-2038 bug in the implementation of ipRouteTable.
+ - Introduced netsnmp_pid_t.
+ - MIB-specific leak-at-exit fixes.
+ - Make it possible to copy watched data items without memory leaks.
+ - Make the setting of the argvrestart* variables optional on
+ USING_UTIL_FUNCS_RESTART_MODULE.
+ - Make the setting of the argvrestart* variables optional on
+ USING_UTIL_FUNCS_RESTART_MODULE. Remove util_funcs/restart from the
+ requirement sets of util_funcs and default_modules.
+ - Make the setting of the argvrestart* variables optional on
+ USING_UTIL_FUNCS_RESTART_MODULE. Remove util_funcs/restart from the
+ requirement sets of util_funcs and default_modules. Add
+ util_funcs/restart to the requirement set of ucd-snmp/versioninfo.
+ - Patch 3141462: from fenner: fix agentx subagent issues with
+ multiple-object requests
+ - Patch from Niels to fix VACM persistant storage.
+ - Remove unused variable cmp
+ - Remove util_funcs/Exit from the requirement sets of util_funcs and
+ default_modules.
+ - Remove util_funcs/Exit from the requirement sets of util_funcs and
+ default_modules. Never use Exit to terminate the agent.
+ - Removing the last cache via netsnmp_cache_remove() does no longer
+ trigger a crash.
+ - Update the length of sysObjectID as well as the data when it is set
+ from a configuration file.
+ - Use the same autoconf symbol to decide both if strcasecmp should be
+ declared and if it should be defined.
+ - [BUG 1840230]: Don't include the index object as
+ (pseudo-)accessible column.
+ - [BUG 3058101]: Writeable 'long' instances work on 64-bit systems,
+ but not writable 'int's
+ - [BUG 3062538]: Fix com2sec* handling of non-default contexts
+ - [BUG 3205765]: handle reconfig for certSecName token
+ - [BUG ]: enforce max length on TLS secName maps
+ - [BUG ]: enforce max length on TLS secName maps add priority to
+ secname debugging
+ - [PATCH 2119725]: Fix skipNFSInHostResources handling of
+ hrStorageTable
+ - [PATCH 2941811]: Handle successful requests with reqID 0
+ - [PATCH 2975254]: Avoid callback re-use of closed sessions Qn:
+ Should this also be applied when main session is NULL?
+ - [PATCH 3053436]: from: takevos: fix: tcpConnectionTable_data_access
+ invalid memory access
+ - [PATCH 3057090]: make ethtool support on linux use the high speed
+ struct info for 100G+.
+ - [PATCH 3057093]: allow linux to use libpci for creating useful
+ ifDescr strings
+ - [PATCH 3096725]: Don't register v1Trap callback, if SNMPv1 is not
+ supported
+ - [PATCH 3096725]: Include SNMPv1 trap OIDs in nlmLogNotificationID
+ column
+ - [PATCH 312596]: listen for netlink change events for the
+ arp-related tables
+ - [PATCH 3152412]: Handle (and report) problems reading /proc/vmstat
+ - [PATCH 3203806]: Avoid that the main agent processing loop - when
+ using more than FD_SETSIZE file descriptors - can cause memory
+ corruption by invoking select().
+ - [PATCH ]: optimizations for large route tables from Stephen
+ Hemminger applied parts 1-3 of 4 from him (msgs to coders on
+ 2/28/11; subject ip-forward-mib performance improvements; part 4
+ needs more work
+ - add debug for cert find hint as string/int
+ - add newly created/destroyed interfaces to ipv6IfTable The list of
+ interfaces was never refreshed, now it is reloaded every time the
+ table is accessed. I've also fixed a memory leak and optimized the
+ loading of the list a bit.
+ - com2sec6 directive: If configure has not found getaddrinfo(),
+ non-numeric IPv6 addresses do now trigger an error message.
+ - don't second-guess cache handler (waves hand) this is not the
+ function you are looking for. netsnmp_cache_is_valid() is not meant
+ for mib modules
+ - example MIB: Added shutdown function that frees all memory owned by
+ this MIB implementation.
+ - fix double free in TLS error handling
+ - fixed the agent writing 'looks like a 64bit wrap, but prev!=new' in
+ syslog when computing ipSystemStats Without the memcpy,
+ prev_vals->stats and new_vals->stats could get different, which
+ could much much later (when a counter gets bigger than 32 bits)
+ result in 'prev!=new' message in syslog. Typically this happens
+ after long time of uptime and it is very hard to reproduce.
+ - host/data_access/swinst_rpm: Fixed a memory leak in
+ netsnm_swinst_arch_init().
+ - host/data_access/swinst_rpm: Pass correct path to rpmdbOpen() such
+ that opening the database succeeds.
+ - host/data_access/swinst_rpm: Pass correct path to rpmdbOpen() such
+ that opening the database succeeds. host/data_access/swinst_rpm:
+ Log an error message if rpmdbOpen() fails.
+ - instead of relying on NETSNMP_DS_LIB_APPTYPE, break out cert table
+ inits to new agent cert init function, called from init_agent.
+ - netsnmp_cache_free(): A more detailed message is now logged when
+ attempting to free a cache that is still in the cache list.
+ - reworked hrStorageTable to support large filesystems. The
+ hrStorageAllocationUnits does not report real allocation unit size,
+ but some calculated value so hrStorageAllocationUnits *
+ hrStorageSize gives real size of the filesystem. This calculation
+ happens only when hrStorageSize is too small (32bits) for
+ filesystem size, e.g. filesystems larger than 8TB with 4096 bytes
+ block size. This calculation can be turned off by
+ 'realStorageUnits' config option.
+ - skip non-AF_INET interfaces when loading ipv4 addrs
+ - snmpd is again single-threaded. [PATCH 2959811]: Safranek:
+ Reimplement Linux Netlink IPv6 prefix listener.
+ - Fixed memory leak in TCP-MIB tables introduced by patch #3053436.
+ - Fixed memory leak in TCP-MIB tables introduced by patch #3053436."
+ [PATCH 3053436]: from: takevos: fix: tcpConnectionTable_data_access
+ invalid memory access" the bug 3053436 is fixing was introduced in
+ r17719, and fixed in r17861.
+ - Use proper format specifier in debug statements for printing values
+ of type 'oid'.
+ - [PATCH 3066862]: fix the agent for comparing unsigned large indexes
+ of the disk and extend tables.
+ - fixed hrSWRunPath of swapped-out processes on Linux. fgets()
+ returns NULL both when /proc/PID/cmdline is empty (= swapped out)
+ and when the process exited after fopen(), so check
+ /proc/PID/status in both cases.
+ - fixed race condition in hrSWRunTable Treat the reads from
+ /proc/<pid>/* carefuly, processes can exit in the middle of
+ processing. (already fixed in V5-5-patches and V5-4-patches in SVN
+ rev. 20115, dunno why I did not patch trunk)
+ - patch 3131397: from takevos: huge speedups of the TCP/UDP Tables
+ - patch 3299384: fix INFORMs so they retry probing for an engineID.
+ - patch 3306476: from tinypyramids: fix memory leak in the swrun
+ container loading
+ - ucd_snmp builds again on MinGW and Cygwin.
+ - patch 3310250: from fenner: misc fixes for debugging output of
+ agentx
+
+ snmptrapd:
+ - Fixed a double free at exit that was triggered by cleaning up the
+ data structures used for embedded Perl support. Fixed a double free
+ at exit that was triggered by cleaning up the data structures used
+ for embedded Perl support. Valgrind reported that double free as
+ follows: Invalid read of size 4 at 0x59D0501: perl_destruct (in
+ /usr/lib/perl5/5.12.1/x86_64-linux-thread-multi/CORE/libperl.so) by
+ 0x544DF8E: shutdown_perl (snmp_perl.c:166) by 0x403966:
+ term_handler (snmptrapd.c:318) by 0x6D43A5F: ??? (in
+ /lib64/libc-2.11.2.so) Address 0x7660f88 is 56 bytes inside a block
+ of size 2,912 free'd at 0x4C26496: free (vg_replace_malloc.c:366)
+ by 0x544DF9A: shutdown_perl (snmp_perl.c:167) by 0x6DDADF2:
+ __select_nocancel (in /lib64/libc-2.11.2.so) by 0x404E20: main
+ (snmptrapd.c:1258)
+
+ apps:
+ - [PATCH 3054817]: Adds per-variable timed output support to snmpwalk
+ using -CT
+ - add snmp.conf tokens for timeouts and retries
+
+ build:
+ - [BUG 3088360]: Ensure python modules are built against the correct
+ libraries
+
+ building:
+ - Fix --with-security-modules handling Allow repeated modules
+ (tsm,tsm) as well as defailt modules (usm) Move the generation of
+ the files after the checking
+ - Make it possible to regenerate using autoconf 2.68.
+ - Some systems do not support the -E flag to grep, use autoconf to
+ find the right egrep at all times.
+ - check for /dev/kmem instead of assuming it exists and hardcoding
+ when it is not there
+
+ libnetsnmp:
+ - made the SSH transport configurable as it should be.
+
+ libnetsnmpmibs:
+ - Make all functions in the dlmod module that don't have to be public
+ static
+
+ mib2c:
+ - [PATCH 3175323]: Fix handling of 'while (false)' blocks
+ - [PATCH 3204883]: Fix handling of non-table objects named fooTable
+ - [PATCH 3211484]: Support enumerations in notification varbinds
+ - make the mib2c foreach ranges work as advertised in the comments.
+
+ packaging:
+ - Enable micro-and-macro-feature management within Net-SNMP; this
+ adds a number of new flags to configure (--enable-minimalist and
+ --enable-read-only). These changes are designed to remove much of
+ the inline code that isn't always necessary or desired. Scripts
+ exist (and will be improved) to stip out unused components from the
+ code entirely to enable a shorter review process for upgrading to
+ new releases. This work was done by Wes Hardaker and Michael Baer
+ from SPARTA, Inc. but is being checked in as a large patch since
+ converting the micro patches from git to svn turend out to be
+ impossible
+
+ patch 3140833:
+ - fix proxy GETNEXT requests When OIDs requested are below the proxy
+ request remap, we need to not include any OIDs that might be in the
+ space between the original OID and the remapped OID. This patch
+ fudges the request so that it fixes the request OID so it's just
+ before the remapped proxy range.
+
+ patch 3184026:
+ - Avoid constant refresh of interface statistics
+
+ perl:
+ - patch 3049029: from fennec: fix a memory leak with snmp bulkwalks
+ - patch from Martin Buck: don't always open stderr as the calls to
+ snmp_log already do this and it messes up the agent when embedded
+
+ python:
+ - [PATCH 3185085]: Fix segfault on 64-bit systems
+ - [BUG 3295407]: Fix handling of void pointer
+
+ testing:
+ - Add missing preconditions
+ - Added function netsnmp_delete_table_data_set(). Added declaration
+ for the function netsnmp_table_data_delete_table() in a public
+ agent header file. Fixed memory leak in
+ netsnmp_table_data_delete_table(). Fixed memory leak triggered by
+ unregistering a table handler. Unit tests can now invoke functions
+ from libagent.
+ - Added function netsnmp_delete_table_data_set(). Added declaration
+ for the function netsnmp_table_data_delete_table() in a public
+ agent header file. Fixed memory leak in
+ netsnmp_table_data_delete_table(). Fixed memory leak triggered by
+ unregistering a table handler. Unit tests can now invoke functions
+ from libagent. Added unit test for table_dataset.
+ - Added inet_ntop() and inet_pton() unit test.
+ - Added netsnmp_mib_handler.data_clone, a function pointer that
+ defines how to clone netsnmp_mib_handler.myvoid. Must be defined if
+ and only if data_free is set. The function netsnmp_handler_dup()
+ does now clone MIB handler private data if data_clone() is set.
+ Previously after duplicating a MIB handler and unregistering one of
+ the two MIB handlers, the private data pointer (myvoid) of the
+ other became a dangling pointer. Note: addition of
+ netsnmp_mib_handler.data_clone is an ABI change. added more test
+ cases to the handler registration test.
+ - Generate a normal #line directive as per C99 instead of the
+ compiler-specific #<n>-directive.
+ - Introduced new test type next to capp and clib: cagentlib.
+ - It is again possible to run an individual test via the script
+ testing/RUNTESTS.
+ - It is now possible to analyze the unit tests with Valgrind by
+ setting the environment variables SNMP_SAVE_TMPDIR and
+ DYNAMIC_ANALYZER. An example: (export SNMP_SAVE_TMPDIR=yes
+ DYNAMIC_ANALYZER="valgrind --trace-children=yes --leak-check=full";
+ cd testing && ./RUNFULLTESTS -g unit-tests)
+ - Test 71 (com2sec6_simple) does now succeed even if IPv6 DNS
+ resolution is not available.
+ - Test T030 does now pass on MinGW.
+ - auto-create user specified SNMP_TMPDIR and SNMP_TMP_PERSISTENTDIR
+ too; default SNMP_TMP_PERSISTENDIR based on SNMP_TMPDIR for user
+ specified SNMP_TMPDIR
+
+ man:
+ - [BUG 3190725]: Document snmp{,_sess}synch_response and
+ snmp_async_send
+
+ Generic:
+ - Make it possible to build static applications using net-snmp-config
+ and the -*libs flags once more.
+ - [BUG 3102904]: All Net-SNMP C source files are now compiled with
+ -fno-st rict-aliasing, at least if the configured compiler supports
+ this flag.
+ - [PATCH 3074918]: from weizheng: check for CONTAINER_INSERT failures
+ and react appropriately to avoid memory leaks
+ - [PATCH 3167325]: from krisztoforo: UCD-SNMP/SystemStats: add
+ variables to report cpusteal, cpuguest, cpuguestnice
+
+ Cygwin:
+
+ Linux:
+ - [PATCH 3083027]: Fix RPM spec file to support CentOS
+ - [PATCH 3205811]: Option to skip fd/loop/ram devices in diskIOTable
+ - agent: ipNetToPhysicalTable: Do not log an error message if one or
+ more interfaces are present that do not have such information
+ (NUD_NOARP), e.g. tunnels. Reported by Stephen Hemminger. See also
+ patch #3107003.
+ - snmpd is again single-threaded.
+
+ MinGW:
+ - Made regression test output independent of the Net-SNMP variables
+ defined in the Windows registry. Some tests that failed previously
+ after the Net-SNMP binaries (MSVC build) had been installed do now
+ pass.
+ - configure: Detection of the functions gai_strerror(),
+ getaddrinfo(), gethostbyname() and gethostname() does now succeed.
+ - testing: If the agent has been asked to stop, wait until the snmpd
+ process disappeared before proceeding.
+ - Tests 025 and 026 pass on MinGW even if winExtDLL has been enabled.
+
+ NetBSD:
+ - DragonFly support [From NetBSD patch archive]
+
+ OpenBSD:
+ - Update SWRun code to use kvm_getproc2 [From OpenBSD patch archive]
+
+ Win32:
+ - Avoid that MSVC reports a warning message about redefinition of the
+ malloc() macro during building the Net-SNMP source code.
+ - Deprecated libsnmp.def - add NETSNMP_IMPORT to function
+ declarations instead to export a function from netsnmp.dll.
+ - Guard netsnmp_udp_recvfrom() etc. declarations consistently. Builds
+ with Visual Studio 2010.
+ - Introduced netsnmp_pid_t. Eliminated casts between int and HANDLE
+ in agent/mibgroup/util_funcs.c and
+ agent/mibgroup/ucd-snmp/pass_persist.c.
+ - When snmpd.exe is started in a command prompt window, the snmpd
+ process now stops upon the first key press. This makes it easier to
+ debug snmpd.exe for memory leaks.
+ - [PATCH 3085187]: Building via the Microsoft Visual Studio project
+ file (.dsw/.dsp) works again.
+ - [PATCH 3293842]: Eliminate registry argument limit of 127
+ characters (this limitation was reported by Sylvain Dery).
+ - building: Avoid that MSVC 2010 prints a warning message about
+ redefining EADDRINUSE.
+ - building: Builds now correctly with a 64-bit compiler.
+ - building: batch build with OpenSSL enabled and with recent OpenSSL
+ development files works again.
+ - header file <net-snmp/net-snmp-config.h> can now be used in the
+ MinGW environment.
+ - testing: Avoid that T200 fails on known Microsoft SNMP extension
+ DLL bugs.
+ - Build snmplib/transports/snmpIPv6BaseDomain.c only if
+ NETSNMP_ENABLE_IPV6 has been defined.
+ - Fixed a memory leak in the Net-SNMP (non-winExtDLL) implementation
+ of the MIB-II ipNetToMediaTable.
+ - Microsoft Visual Studio: Link with gdi32.lib if OpenSSL has been
+ enabled because gdi32.lib is a dependency of OpenSSL.
+
+*5.6*
+
+ snmplib:
+ - Add const declarations to the disabled versions of the debugging
+ code as well.
+ - Add missing dependencies between transports.
+ - Add missing symbol netsnmp_snmpSSHDomain_len, make
+ netsnmp_snmpSSHDomain const.
+ - Change oid to be a 32-bit type on ILP64 and LP64 platforms.
+ - Change the parsing of ranges to accept all valid values.
+ - Correct dependencies between transports. Remove unnecessary
+ includes.
+ - Correct the spelling of __cplusplus when checking if the file
+ should be wrapped in extern "C".
+ - Do not require that the UDP transport is included.
+ - Fix agent crash when sending encrypted SNMPv3 traps. Reported by
+ Srikapilan Gandhi
+ - Fix responding to broadcast requests. UDP responses are sent with
+ source IP address which was destination of appropriate requests
+ (implemented in SVN rev. 15215). But if the destination of a
+ request is broadcast IP address, the request was sent with the
+ broadcast address as source. sendmsg() on Linux does not support
+ this and returns error -> response is not sent. In order to send
+ responses from the same interface, interface index of the
+ appropriate interface must be used.
+ - Install library/oid.h. Thanks to "Tomasz Lis" who spotted the bug.
+ - Make the context argument of send_v3trap,
+ send_trap_vars_with_context and netsnmp_send_traps refer to a const
+ char*.
+ - Make the name argument to find_varbind_in_list const
+ - Prevent gcc ped-warning for NETSNMP_REMOVE_CONST
+ - Remove declarations of functions that don't exist or are declared
+ elsewhere.
+ - Remove the oid typedef from <net-snmp/library/asn1.h>. It is still
+ present in <net-snmp/types.h>, use that file.
+ - Replace the debugging functions with dummies when debugging is
+ disabled.
+ - Revert 17808, instead factor out the declaration of oid to it's own
+ file and include that file from both types.h and asn1.h
+ - Use a void argument for the data argument of xdump.
+ - [BUG 2919320]: Avoid accessing freed memory Reported by Tomasz Lis
+ - [BUG 2922390]: Fix test for missing contextName parameter
+ - [PATCH 2871747]: plug memory leak in OID processing. The memory
+ leaked when small OID, which could fit pre-allocated vp->name_loc,
+ was placed in different (allocated) one.
+ - [PATCH 2942940]: Add a new function, netsnmp_parse_args, that is
+ like snmp_parse_args but takes an additional bitmask, flags, to
+ affect the behaviour. Also remove the magic handling of some
+ application names.
+ - [PATCH 2971270]: refuse to parse ASN.1 tokens with wrong type
+ field. This may yield to problems with third-party applications
+ which may depend on parsing ugly ASN.1 data - we'll see...
+ - add function to validate RowStatus and StorageType varbinds - also
+ remove some duplicate code and fix comments indent mangled
+ - add functions to remove list/row data from request list
+ - add interface for duplicating a container
+ - add interface for duplicating a container container changes: add
+ flags field to container meta-data; chg binary_array container to
+ use container meta-data flags
+ - add remove function to container iterator; implement it for
+ binary_array
+ - added the functions netsnmp_malloc(), netsnmp_calloc(),
+ netsnmp_realloc(), netsnmp_strdup() and netsnmp_free().
+ - builds again when HAVE_GETADDRINFO is not defined.
+ - conf files can now include other conf files - also tweaked debug
+ tokens here and there
+ - create indexes for certificates in config path
+ - directory container enhancements - fix potential memory leak - add
+ filter callback to filter files returned - add option to return
+ relative and not full paths - add option to sort returned list -
+ add option to return empty container instead of NULL if no files
+ found - change default container name to directory that was scanned
+ - tweak debug/log messages
+ - enhance file utils and dir utils - add optional stats struct to
+ netsnmp_file - generalize dir container filter, add context to
+ callback - add option to store netsnmp_files (w/stats) in container
+ instead of just name
+ - fix potential double free in CONTAINER_FREE - also added several
+ compare routines
+ - netsnmp_container enhancements: - add free_item function; defaults
+ to netsnmp_container_simple_free - add CONTAINER_FREE_ALL
+ macro/function (like CONTAINER_CLEAR but calls container free_item
+ for each item in primary container) - add ability to set options on
+ binary_array containers
+ - new certificate api to support tls/dtls
+ - new snmp token logOption allows specifying log destinations vi conf
+ files - if stderr log enabled because of no log destination, turn
+ it off when a log destination is enabled - don't call
+ netsnmp_enable_stderrlog() from apps anymore
+ - obsoleted NETSNMP_DS_LIB_ALARM_DONT_USE_SIG. From now on using
+ SIGALRM to trigger Net-SNMP alarm handlers is no longer supported.
+ Motivation: as known libnetsnmp supports time-based alarms via the
+ functions snmp_alarm_register(), run_alarms() and other functions.
+ Two different ways to trigger the function run_alarms() are
+ supported inside libnetsnmp: 1. By making sure that the timeout
+ argument of select() is small enough such that select() returns
+ before the next alarm must be handled (when the variable
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG is set to one, which is the
+ default). 2. By making sure that the kernel fires SIGALRM at the
+ time when run_alarms() should be called (when the variable
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG is set to zero, which has to be
+ configured explicitly). The following issues are associated with
+ the second approach: 1. Alarm functions are used inside Net-SNMP to
+ e.g. refresh cached table contents. As far as I can see there is
+ nothing in the Net-SNMP source code that prevents the following
+ from happening: a table refresh triggered via SIGALRM while a row
+ is being removed from a cached table. This can result in dangling
+ pointer dereferences and even a crash. 2. POSIX restricts signal
+ handlers to calling functions that are either reentrant or
+ non-interruptible
+ (http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02
+ _04.html#tag_02_04). Standard I/O functions like printf() and
+ fprintf() are neither reentrant nor non-interruptible. run_alarms()
+ is called from inside a signal handler, which means that this
+ restriction applies to the function run_alarms() itself and all
+ functions called by it (which includes the alarm callback
+ functions). Or: e.g. snmp_log() and its callers must not be called
+ from inside run_alarms() when this function is invoked from inside
+ a signal handler. This is a severe restriction, and one that is
+ hard to work with. 3. Not all software developers know how to make
+ sure that signal delivery works correctly in a multithreaded
+ context. POSIX does not guarantee to which thread a signal like
+ SIGALRM will be delivered, unless that signal has been blocked
+ before thread creation and is unblocked after thread creation (see
+ also
+ http://www.opengroup.org/onlinepubs/009695399/functions/pthread_sig
+ mask.html). This is relevant for the Net-SNMP project not only
+ because a worker thread is created inside
+ agent/mibgroup/if-mib/data_access/interface_linux.c but also
+ because libnetsnmp is often used inside multithreaded software.
+ Currently no attempt is made to make sure that SIGALRM is processed
+ by the Net-SNMP event processing loop thread. If SIGALRM is
+ processed by another thread, this will result in one or more data
+ races. Because all the difficulties associated with processing
+ alarms from inside a signal handler function, and because fixing
+ these would require more effort than it is worth,
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG has been deprecated and from now
+ on approach (1) is the only supported approach to trigger alarm
+ handlers.
+ - plit snmpIPBaseDomain and move the IPv4 parts to IPv4Base and the
+ socket generic parts to SocketBase.
+ - when freeing a cache, stop timer and call cache free func - also
+ add netsnmp_cache_remove
+ - new experimental simple state machine
+ - new experimental simple state machine new experimental row creation
+ API which uses a state machine to try really hard to create a row
+ from a given varbind list
+ - fix issue with USM using inactive users
+ - fixed potential buffer overflow when generating temp. file names
+ - implemented a fix for the issue reported in patch #3042770. Created
+ a snmp_select_info_flags function, and similar, that allow for
+ alarms to not be run. This is then used in the synch_response
+ functions to avoid 100% CPU loops
+ - patch: 3042770: from mehaf: Made run_alarms() reentrant
+ - when displaying a byte as single digit hex value, default to
+ prefixing with 0 unless there is a seperator or addition hint data
+ - 0 patch 3058645: from jorisesaturnus: modified version of the patch
+ to use MSG_DONTWAIT for the unix domain socket
+ - [PATCH 3067540]: Fix IPv4 OID indexes on 64-bit big-endian systems.
+
+ snmplib, snmpd:
+ - Do not check if values of type size_t are less than 0.
+ - Make sure that a mask is given to open when O_CREAT is specified
+
+ snmplib, snmpd, snmpnetstat:
+ - Add correct size prefixes when printing variables of type oid.
+
+ snmpd:
+ - Add support of network interfaces with HW address bigger than 6
+ bytes to ipNetToMediaTable and ipNetToPhysicalTable. Some HW, like
+ InfiniBand, uses HW addresses with 9 and more bytes. Snmpd on Linux
+ was not able to parse /proc/net/arp then and produced ugly 'ioctl
+ 35123 returned -1' to log.
+ - Check the range of oid values towards the maximum oid value,
+ notULONG_MAX
+ - Extract the Exit and restart* subroutines from util_func in order
+ to make it possible to build less code for the minimal case.
+ - Fixed creation of views using snmpusm, OIDs with indexes > 255 are
+ allowed now. This reverts SVN commit #7492.
+ - Fixed invalid access to memory in TCP-MIB This partly reverts patch
+ 17719 - the entries *are* used after raw_data container is freed.
+ These entries should be freed when associated rowreq_ctx is freed.
+ - Fixed logging of 'truncating integer value > 32 bits' in IP-MIB and
+ TCP-MIB The counters, which grow fast are now cut to 32bits.
+ - Fixed udpTable indexes on big-endian 64bit Linux. The index was
+ always '0.0.0.0' instead of real local IP address.
+ - Made subtree_context_cache::context_name a const char*.
+ - Make all the oids and oid lengths in agent_trap.c const and use
+ them from everywhere.
+ - Make the enterprise argument of netsnmp_send_traps and
+ send_enterprise_trap_vars const
+ - Only enable hostSwInst rpm support on linux hosts with librpm. This
+ makes it possible to build on non-rpm linux distributions.
+ - Removed the unused function xx_tokenize_exec_command from
+ utilities/execute.
+ - [BUG 2822360]: Fix memory leak when building table OIDs
+ - [BUG 2841008]: Protect against crash following failed AgentX
+ response
+ - [BUG 2873858]: Fix handling of schedOwner index. Patch provided by
+ Max Schubert.
+ - [BUG 2894059]: Handle errors when counting interfaces
+ - [BUG 2897000]: Suppress 32-bit counter truncation warnings.
+ - [BUG 2900078]: Add support for OID variables with size in elements
+ instead of bytes, correct sysObjectID to use this.
+ - [PATCH 2835576]: Fix endianness issues in pass/pass_persist
+ - [PATCH 2877518]: Fix handling of scoped AgentX variables
+ - [PATCH 2883092]: Support monitoring processes that should not be
+ running. Patch provided by Christian (cg75). Qn: Should this
+ functionality be back-ported to earlier lines?
+ - [PATCH 2883220]: Fix compilation problems when ifXTable is not
+ included.
+ - [PATCH 2887816]: Protect against division-by-zero crash
+ - [PATCH 2901029]: Fix compiler warning on CloseHandle() Endian
+ problems already addressed by patch #2835576
+ - [PATCH 2903092]: Fix broken handling of broadcast entries.
+ - [PATCH 2911323]: Fix agent lockup when monitoring AgentX-delegated
+ information
+ - [PATCH 2911970]: Properly terminate linked list of registrations.
+ Patch provided by Mirko Deckert.
+ - [PATCH 2956657]: Handle over-length AgentX OIDs. Patch provided by
+ Rob West
+ - [PATCH 2967400]: Retrieve error counters for the EtherLike-MIB
+ Patch supplied by Josef Moellers.
+ - [PATCH 2968642]: Catch overflow of pass-through command buffer.
+ Patch from Andreas Jaeger/Leonardo Chiquitto
+ - agent will no longer call table handlers if a set request for the
+ handler has invalid indexes
+ - agent will no longer call table handlers if a set request for the
+ handler has invalid indexes don't call cleanup on first request on
+ bad indexes. instead, set actual error later, and free request data
+ sets on first request for sets
+ - define and use new NETSNMP_LOGONCE macro
+ - fix crash in IF-MIB and IP-MIB when there are some interfaces with
+ broadcast IP address and some without. Reset the bcastentry in the
+ loop, so it cannot be inserted to the twice. Without this patch,
+ when an interface without broadcast address is processed, the
+ bcastaddress from previous loop is inserted into the container.
+ This obviously fails and the bcastentry is freed, but the container
+ still contains reference to it -> SIGSEGV.
+ - fix memory leak in ipAddressPrefixTable -
+ net_snmp_search_update_prefix_info returns different code, when the
+ entry was not inserted to list and can be freed.
+ - fix rare race condition when reading RPM database. Old rpm versions
+ return NULL instead of Header when another RPM instance holds
+ database locks. I.e. snmpd sometimes crashes when reading hr_swInst
+ and rpm is installing/updating/removing another package. As a
+ solution, whole RPM cache is thrown away and re-read when we got an
+ error from librpm. The whole process is restarted only three times,
+ to prevent endless loop.
+ - fixed a memory leak in TCP-MIB.
+ - fixed filedescriptor leak in Etherlike-MIB and RMON-MIB
+ - fixed memory leak when reading sensors for LM-SENSORS-MIB.
+ - fixed one leak-at-exit.
+ - include local port number in packet dumps. An example: Received 36
+ byte packet from UDP: [127.0.0.1]:53909->[127.0.0.1]:1161 0000: 30
+ 22 02 01 01 04 06 70 75 62 6C 69 63 A1 15 02 0".....public... 0016:
+ 04 37 F2 D4 9B 02 01 00 02 01 00 30 07 30 05 06 .7.........0.0..
+ 0032: 01 01 05 00 .... Received SNMP packet(s) from UDP: GETNEXT
+ message -- ccitt.1 Sending 118 bytes to UDP:
+ [127.0.0.1]:53909->[127.0.0.1]:1161 0000: 30 74 02 01 01 04 06 70
+ 75 62 6C 69 63 A2 67 02 0t.....public.g. 0016: 04 37 F2 D4 9B 02 01
+ 00 02 01 00 30 59 30 57 06 .7.........0Y0W. 0032: 08 2B 06 01 02 01
+ 01 01 00 04 4B 4C 69 6E 75 78 .+........KLinux 0048: 20 61 73 75 73
+ 20 32 2E 36 2E 33 33 2E 32 2D 73 asus 2.6.33.2-s 0064: 63 73 74 20
+ 23 31 20 53 4D 50 20 50 52 45 45 4D cst #1 SMP PREEM 0080: 50 54 20
+ 53 61 74 20 41 70 72 20 33 20 32 31 3A PT Sat Apr 3 21: 0096: 31 30
+ 3A 35 38 20 43 45 53 54 20 32 30 31 30 20 10:58 CEST 2010 0112: 78
+ 38 36 5F 36 34 x86_64
+ - made sure that handler registration failure does not create
+ dangling pointers in the MIB subtree registry.
+ - report real ifSpeed of network interface even it is down. Some
+ interfaces can report their real speed, even they are down. And if
+ they can't, the fallback to 10Mbps is still there.
+ - table_data/tdata next handler will not be called during get
+ processing if no valid rows are found for the handler
+ - tdata helper now saves flags passed during creation; add tdata flag
+ to NOT create the table container
+ - translate NOSUCH*/ENDOFMIB errors during RESERVE1 to NOCREATION
+ - utilities/execute do not need anything from util_funcs, so stop
+ depending on it.
+ - fixed value of IP-MIB::ipv6InterfaceForwarding on Linux The value
+ was 0 (not forwarding) or 1 (forwarding), should be 2 and 1 instead
+ - netsnmp_interface_entry.forwarding_v6 is boolean, not TruthValue.
+ - new API for indicating that persistent store needs to be saved
+ after the current request finishes processing
+ - [BUG 3003981]: Protect against buffer overflow
+ - [BUG 3019243]: Register execFix compatability directive correctly.
+ - patch 2912520: from listom: Free kmem references on shutdown
+ - patch: 3028923: from jenso: new copy of the bridge-mib perl
+ implementation
+ - report gfs filesystems in hrStorageTable and hrFSTable.
+ - [PATCH 2904900]: Documentation plus assorted handler code fixes
+ - [PATCH 2911361]: Documentation (Provided by Tomasz Lis)
+ - [PATCH 2911361]: Re-order code to group related functions together
+ - [PATCH 2911361]: Remove redundant variables
+ - [PATCH 2931446]: make the load averages writable.
+ - [PATCH 3044512]: fix sysobjectid directive.
+ - patch 2790249: from willpwillp: reduce cache time for the iftable
+ to 3seconds to increase accuracy
+ - patch 2825653: from bru5ce: fix sendmail.cf parsing in certain
+ conditions
+ - Log before returning.
+ - [PATCH 3053428]: fix get_pid_from_inode when the inode is not
+ found.
+ - [PATCH 3058140]: check that inode is non-zero
+ - patch 3062526: from mariog85: fix security engineID setting in the
+ trapsess directive
+
+ snmpdlib:
+ - new functions to make stash ptr and newrow available to
+ table_dataset handlers nonews: fix typo; tabs to spaces; use sizeof
+ instead of constant
+
+ snmpdx:
+ - changed default TCP target from 0.0.0.0:705 to localhost:705. This
+ is not only a more secure choice but it also makes it possible on
+ Windows systems to let an AgentX subagent connect to an AgentX
+ master agent running on the same system without having to set the
+ variable NETSNMP_DS_AGENT_X_SOCKET.
+
+ snmptable:
+ - [BUG 2837998]: Handle missing instance subidentifiers in results
+ - [PATCH 2850067]: Suppress extraneous "index" header token Patch
+ supplied by Dan Nelson
+
+ snmpusm:
+ - Prefer to use a variable of the right type over an ugly cast.
+ Lessen the scope of the variable as well.
+ - patch from Martin Bjorklund to add a -Cw option to use
+ createAndWait for agents that are strict about not allowing a row
+ to be set to active until the authentication password has been
+ changed; plus white-space clean up, manual additions and help
+ output modifications by hardaker
+ - Correct ifdefs, remove dead variables.
+
+ man:
+ - clean up manual pages (from Debian patch 56_manpage)
+
+ snmpwalk:
+ - Handle the case when the end oid is longer than the current oid
+ correctly
+
+ apps:
+ - Add command to send AgentX notify requests to a master agent.
+ - Generic host-specific configuration snmp.conf files are now read.
+ See the HOST-SPECIFIC FILES section of the snmp.conf manual page.
+ - Only build agentxtrap if the agentx libraries are built. Add a test
+ case for agentxtrap. The enablement/disablement is inspired by
+ automake conditionals
+ - T command line flag can be used to configure transports
+ - A new 'snmptls' command for manipulating the agent's TLS configuration
+
+ apps, snmplib:
+ - [PATCH 2835577]: identified by "Bart Van Assche": Replace SNMP_ZERO
+ of arrays with a memset.
+
+ snmptranslate:
+ - fixed printing of ranges with UNSIGNED type.
+
+ build:
+ - [PATCH 2952020]: Explicitly set permission on temporary testing
+ output directories. Patch provided by Leonardo Chiquitto.
+ - run rpm configure checks for hr_swinst rewrite (rpm version only)
+ - Do not call vacm_standard_views() or init_vacm_config_tokens() if
+ the corresponding module was not compiled (from Debian patch
+ 61_vacm_missing_dependency_check)
+ - Fix ipv6 generic case so test matches verification
+
+ building:
+ - 'make test TESTOPTS="-P tcp"' works fine now
+ - 0 In case exec_prefix is unset then set it to '${prefix}' in order
+ to pick up overrides of $prefix in make install.
+ - Building Net-SNMP with dmalloc support enabled is again possible.
+ - Do not link with libnetsnmphelpers any more as it is empty.
+ - Fixed compilation with rpm-4.6. Turn on the legacy API when rpm-4.6
+ is detected.
+ - Introduced the variable 'with_socklib' in the configure script.
+ This variable is set to "winsock2" for MinGW and to "default" for
+ all other systems. Winsock2 tests are only run if this variable is
+ set to "winsock2" (MinGW).
+ - OS header detection check is now run before IPv6 stack detection.
+ - Use AC_REPLACE_FUNCS to handle code that is missing on some
+ platforms.
+ - Use autoconf to decide if inet_ntop.c and inet_pton.c are to be
+ compiled.
+ - Use the same compiler command and flags for building of tests as
+ for building of the code, thus enabling test of e.g. 32-bit code
+ compiled on a 64-bit platform.
+ - abort if the file program could not be found, since this is
+ essential for proper operation of libtool.
+ - added detection of lm_sensors version. I am not Autoconf guru, so I
+ hope I got it right. The goal is to define NETSNMP_USE_SENSORS_V3
+ *before* config_modules_agent processes
+ agent/mibgroup/hardware/sensors.h.
+ - made sure that the configure script does no longer invoke "tail
+ -1", which is not POSIX-compliant.
+ - save configure cache every once in while
+ - update Version-Munge for renamed configure.ac
+ - when generating a default value for the system location and no
+ domain name is found in /etc/resolv.conf, use "@no.where" instead
+ of "".
+ - Add new test* entries from the testing Makefile.in to the top-level
+ Makefile.in
+
+ building, Win32:
+ - Remove a few unused configure symbols
+
+ hpux:
+ - fix build error on HP-UX 10.20
+
+ libnetsnmp:
+ - Support for a stream-line stripped down version of internal OpenSSL
+ support using --with-openssl=internal
+
+ libnetsnmpagent, libnetsnmphelpers:
+ - moved the functions netsnmp_bulk_to_next_fix_requests(),
+ netsnmp_get_bulk_to_next_handler(), netsnmp_register_null(),
+ netsnmp_register_null_context() and netsnmp_register_old_api() from
+ libnetsnmphelpers to libnetsnmpagent. Notes: - This does not affect
+ backwards compatibility for applications that link with
+ $(net-snmp-config --agent-libs) since this involves linking with
+ both libnetsnmphelpers and libnetsnmpagent. - Functions have been
+ moved between libraries by moving entire source files.
+
+ library:
+ - [PATCH 2952140]: Overflow counter32 and gauge32 on 64bit systems
+ correctly Patch provided by Leonardo Chiquitto
+
+ libsnmp:
+ - changed the type of the fourth argument of netsnmp_set_row_column()
+ from const char* to const void* such that no cast is necessary when
+ passing another datatype then char* or const char*.
+
+ man:
+ - [BUG 2972860]: Update broken references
+
+ mib2c:
+ - Remove unnecessary casts to u_char*
+ - [BUG 2888569]: Fix generation of table columns array
+ - mib2c can now optionally run sed on generated code
+ - table_data template enhancements - add error checks during table
+ init - create cache earlier so we can bail on failure - add option
+ to create/delete row w/out adding/removing from container
+ - update inline documentation; add storagetype test for columns
+
+ mibs:
+ - [BUG 2973890]: Fix imports, DiskIOEntry list and revision histories
+ - patch 2974716: from bvassche: fix issues in the SMUX-MIB
+
+ misc:
+ - [PATCH 2836112]: Use the right modifier when printing size_t and
+ ssize_t variables.
+ - [PATCH 2952708]: Osterkamp: Added Perl implementation of BRIDGE-MIB
+
+ perl:
+ - NetSNMP::agent::netsnmp_request_infoPtr::getValue(): don't return a
+ pointer to a buffer on the stack. How can this have worked reliably
+ ?? NetSNMP::agent::netsnmp_request_infoPtr::setValue(),
+ ASN_COUNTER64: fixed bug that could cause this method to fail even
+ when a valid number was provided.
+ - [PATCH 2890931]: Better handling of Counter64 values. Patch
+ provided by Max Romanov.
+ - fixed a memory leak triggered by destroying a
+ NetSNMP::agent::netsnmp_handler_registration object.
+ - fixed a memory leak triggered by destroying a
+ NetSNMP::agent::netsnmp_handler_registration object. fixed a memory
+ leak triggered by failure of creating a NetSNMP::OID object.
+ - fixed a memory leak triggered by destroying a
+ NetSNMP::agent::netsnmp_handler_registration object. fixed a memory
+ leak triggered by failure of creating a NetSNMP::OID object. fixed
+ a memory leak triggered by the NetSNMP::OID::gettable() subroutine.
+ - fixed a memory leak triggered by destroying a
+ NetSNMP::agent::netsnmp_handler_registration object. fixed a memory
+ leak triggered by failure of creating a NetSNMP::OID object. fixed
+ a memory leak triggered by the NetSNMP::OID::gettable() subroutine.
+ fixed an out-of-bounds array access triggered by the implementation
+ of NetSNMP::SNMP. fixed a memory leak triggered by a PDU processing
+ error in NetSNMP::SNMP. fixed memory leaks triggered by creating an
+ SNMPv3 session via NetSNMP::SNMP. Also fixed the uninitialized
+ variable accesses triggered by adding a varbind to a PDU via
+ NetSNMP::SNMP introduced a few days ago. The bugs mentioned above
+ have been found by inspecting the output of the following shell
+ command: cd perl && valgrind --trace-children=yes --leak-check=full
+ make test
+
+ python:
+ - [BUG 2919379]: Initialise SNMP sessions properly Provided by Diego
+ Billi
+ - [PATCH 2001656]: Handle null-termination of string values properly.
+ Based on the principles of the patch from Tommy Beadle.
+ - Support null-bytes in octet strings Patch supplied by Tommy Beadle
+ - [PATCH 3035328]: from: sws: check the results of session creation
+ for a failure case.
+ - patch 3035578: from sws: keep error codes up to date
+
+ testing:
+ - Brand new test suite desigened to eventually test more
+ functionality, provide for support of unit-tests and support of API
+ tests
+ - Change the test suite to work even if mib lookup is disabled.
+ - Check the size of sun_path and use that to generate the maximal
+ size strings for stressing com2secunix.
+ - Make it possible to run the test suite from anywhere. Change the -D
+ option to expect the path of the top source directory. Add an
+ -srcdir option that is an alias for -D. Add an -builddir option to
+ designate the directory where the test object is. Put srcdir and
+ builddir in the environment for the test scripts Factor out the
+ grep part of SKIPIF and SKIPIFNOT to ISDEFINED Use more readable
+ keys in the opts hash in RUNFULLTESTS Adjust everything to use
+ srcdir and builddir
+ - Move the setting of MIBDIRS from the support script to the drivers
+ since it is needed for the C tests as well.
+ - Use olducd_run, not run_olducd. Change srcdir to refer to the top
+ directory and not the testing subdirectory as that is what is
+ expected in the test scripts.
+ - add the test name to the start of the file "invoked".
+ - made it possible to analyze all code covered by the regression
+ tests with a dynamic analyzer, at least if that analyzer supports
+ following child processes. An example: rm -rf /tmp/snmp-test-*
+ make -s SNMP_SAVE_TMPDIR=yes DYNAMIC_ANALYZER="valgrind
+ --trace-children=yes --track-origins=yes" make -s test grep -i
+ uninitialised /tmp/snmp-test-* | xargs less
+
+ unspecified:
+ - Change the types of the return values of netsnmp_*_getSecName from
+ char* to const char* since they point into internal structures.
+ - Hide most functions and variables in the logmatch module. Cleaned
+ up the header accordingly. Remove the need for forward declarations
+ by reordering the functions.
+ - Make the lists of com2Sec*Entries static
+ - [BUG 2838243]: Correct the output of unsigned values. Thanks to
+ Jack Huang of Qualcomm who pointed out this bug.
+ - [BUG 2969872]: made sure that SOCK_STARTUP is invoked before
+ init_agent() on Windows.
+ - [BUG 2971257]: Fixed winExtDLL handling of multi-varbind getNext
+ requests with OIDs in reverse lexicographical order.
+ - [PATCH 2926374]: from Ed Swierk: fixed reading of ipAddressTable
+ from /proc/net/if_inet6 on Linux The kernel might provide longer
+ fields, especially on 64-bit systems.
+ - [PATCH 2952034]: Return of the Great SuSE 'sprintf' Hunt... Patch
+ supplied by Leonardo Chiquitto
+ - add functions to get fingerprint from cert and log openssl errs
+ - added a new DEBUGTRACETOK() macro
+ - correctly calculate ifXTable.ifHCInUcastPkts on 32-bit Linux Linux
+ does not provide standalone counter for incoming unicast packets
+ (iucast) - it provides counter of all packets (iall) + separate
+ counter for the multicast ones (imcast). Previous implementation of
+ ifTable read these counters and calculated iucast = iall - imcast
+ *before* these values were expanded into 64bits. This produced
+ errors on 32bit systems when iall overflowed to zero and imcast was
+ nozero -> iucast got negative and 'c64 32 bit check failed' error
+ in snmpd log. Now the agent expands these values to 64bits first
+ and * *then* performs the calculation, using a new flag.
+ 2010-05-27 08:18 magfr
+ - fixed memory leak in RMON-MIB and ETHERLIKE-MIB when there are
+ multiple aliases of an network interface Rationale: the aliased
+ interfaces have the same ifIndex -> CONTAINER_INSERT fails, but the
+ rejected entry was not freed.
+ - generate the transport initialization function list dynamically and
+ use it
+ - moved all functions defined in libnetsnmphelpers to
+ libnetsnmpagent. libnetsnmphelpers is now an empty library.
+ - moved transport code into a separate subdirectory in snmplib
+ - [BUG 3027900]: when cross-compiling it is now assumed that memcmp()
+ is available instead of assuming that it is not available.
+ - Do no double declare the index values.
+ - Handle embedded %'s in the result message.
+ - ilence some compilation warnings from test cases.
+
+ Cygwin:
+ - IPv6 is only supported under Cygwin 1.7 or later. The old
+ implementation of IPv6 support in Net-SNMP under Cygwin involved a
+ strange mixture of Cygwin and Winsock2 socket calls, which was too
+ hard to maintain.
+ - IPv6 is only supported under Cygwin 1.7 or later. The old
+ implementation of IPv6 support in Net-SNMP under Cygwin involved a
+ strange mixture of Cygwin and Winsock2 socket calls, which was too
+ hard to maintain. builds again with IPv6 support enabled
+ (--enable-ipv6). At least Net-SNMP 5.5 doesn't build under Cygwin
+ with IPv6 support enabled. The configure script reported "checking
+ ipv6 stack type ... result: "unknown, no" ... error: IPv6
+ transports not available if IPv6 support is not enabled".
+ - [BUG 2939168]: byte order of udpLocalPort is now correct.
+ - [BUG 2939168]: fixed test infrastructure ("make test"). This has
+ been fixed by using the proper environment separator character and
+ by adding the path of the netstat executable for Cygwin in
+ testing/TESTCONF.sh.
+ - abort if the file program could not be found, since this is
+ essential for proper operation of libtool. neither compile nor link
+ winpipe.c.
+ - building with another OpenSSL package than the Cygwin-provided
+ packages openssl and openssl-devel is again possible.
+ - builds now also when the source files are located on a Samba
+ filesystem instead of a local filesystem.
+ - enabled Unix transport. (Forward-ported r18687 from the V5.5
+ branch).
+ - libnetsnmp does now build as a DLL when configured with
+ --enable-shared.
+ - libnetsnmp does now build as a DLL when configured with
+ --enable-shared. perl modules do now build (--with-perl-modules).
+ Note: the T060trapdperl_olducd, T061agentperl_olducd and
+ T115agentxperl_olducd tests still fail.
+ - libnetsnmpmibs, libnetsnmphelpers and libnetsnmpagent do now build
+ as a DLL when configured with --enable-shared.
+ - perl: building the Perl modules with the Cygwin Perl package is now
+ possible. (Forward-ported r18688 from the V5.5 branch.)
+ - the message "configure: WARNING: winsock.h: present but cannot be
+ compiled" does no longer appear when running the configure script.
+ Follow-up for r18050: re-enabled libiphlpapi and iphlpapi.h tests
+ for non-MinGW platforms since the Cygwin build needs these.
+ - corrected error handling in mibII/at.
+
+ Linux:
+ - Improved EtherLike-MIB support Patch supplied by Josef Moellers
+ - builds again with embedded Perl disabled (bug 2985915).
+
+ MinGW:
+ - building with another OpenSSL package than the Cygwin-provided
+ packages openssl and openssl-devel is again possible. building with
+ OpenSSL works again.
+ - running the regression test suite is again possible ('make test').
+ - struct sockaddr_in6.sin6_scope_id configure test does now work.
+ - winExtDLL compiles now under MinGW. building Net-SNMP works again.
+ Detailed overview: * Changes in the configure script:
+ - refuse to run the regression tests if kill.exe cannot be found.
+ - run_shell_command() with either input or output (but not both) does
+ now work. This did not work until now because on MinGW mkstemp()
+ generates a MinGW-style path (/tmp/...) while system() invokes
+ cmd.exe and hence expects a Windows-style path (C:\...).
+ - testing: skip the tests that require SIGHUP since MinGW does not
+ support SIGHUP.
+ - tests T059 and T065 do now pass.
+ - tests T110, T111, T112, T120, T121 and T122 do now pass when snmpd
+ is built with winExtDLL support enabled.
+
+ Solaris:
+ - OS header detection check is now run before IPv6 stack detection.
+ sockaddr_in6.sin6_addr configure test does now work.
+ - Protect against missing package version information crashing the
+ agent. Problem reported by Inyaven Sakarai.
+
+ Win32:
+ - Fix batch build using recent versions of Visual Studio. Partial
+ back port of SVN revisions 17573 and 17696.
+ - The header file <sys/timeb.h> is no longer included from
+ <net-snmp/types.h>. Or: the header file <sys/timeb.h> will have to
+ be included explicitly in source files that need the declaration of
+ the function ftime(). Note: compared to r18024 and before, this
+ change does not affect BSD systems -- <sys/timeb.h> was only
+ included from <net-snmp/types.h> on BSD systems in revisions
+ r18025..r18152.
+ - added #include <malloc.h> in win32/net-snmp/net-snmp-config.h such
+ that the MSVC compiler doesn't get confused by the malloc
+ redefinition when building libsnmp as a DLL.
+ - added the functions netsnmp_malloc(), netsnmp_calloc(),
+ netsnmp_realloc(), netsnmp_strdup() and netsnmp_free(). snmplib:
+ removed the troublesome #define malloc netsnmp_malloc etc. This
+ means that when calling functions from the Net-SNMP DLL from C or
+ C++ code that is being linked against another version of the MSVC
+ runtime DLL than the Net-SNMP DLL, and when allocating memory that
+ will be freed by the Net-SNMP DLL, you will either have to call the
+ Net-SNMP memory allocation functions explicitly or redefine
+ malloc() etc. yourself.
+ - batch build: replaced the obsolete /GX by the equivalent /EHsc.
+ - batch build: replaced the obsolete /GX by the equivalent /EHsc.
+ batch build: added /D "_CRT_SECURE_NO_WARNINGS" /D
+ "_CRT_NONSTDC_NO_WARNINGS" to make building with MSVC 2008 more
+ silent.
+ - batch build: replaced the obsolete /GX by the equivalent /EHsc.
+ batch build: added /D "_CRT_SECURE_NO_WARNINGS" /D
+ "_CRT_NONSTDC_NO_WARNINGS" to make building with MSVC 2008 more
+ silent. batch build: removed /Fp... and /YX. These options
+ influence how precompiled header files are generated, which are not
+ used inside the Net-SNMP project. /YX is not supported by MSVC
+ 2008.
+ - batch build: replaced the obsolete /GX by the equivalent /EHsc.
+ batch build: added /D "_CRT_SECURE_NO_WARNINGS" /D
+ "_CRT_NONSTDC_NO_WARNINGS" to make building with MSVC 2008 more
+ silent. batch build: removed /Fp... and /YX. These options
+ influence how precompiled header files are generated, which are not
+ used inside the Net-SNMP project. /YX is not supported by MSVC
+ 2008. batch build: removed a duplicate occurrence of strtoull.obj.
+ - building: Added libsnmp.def to the list of libsnmp_dll.dsp source
+ files such that the DLL is rebuilt when the .def file has been
+ modified.
+ - building: building NetSNMP.pm does no longer trigger compiler
+ warnings about redefining _WIN32_WINNT nor NTDDI_VERSION.
+ - building: converted .dsp/.dsw files to .vcproj/.sln files. This
+ implies that support for MSVC 6.0 has been dropped and the minimum
+ Microsoft Visual Studio version required to build the Net-SNMP
+ source code is Microsoft Visual Studio .NET (2002).
+ - building: made building NetSNMP.pm more silent by adding the MSVC
+ compiler flags -D_CRT_SECURE_NO_WARNINGS
+ -D_CRT_NONSTDC_NO_WARNINGS.
+ - building: made building more silent by not redefining malloc() or
+ free() during compilation of Perl extensions (resulted in warnings
+ about malloc() / free() redefinition in the Perl header
+ CORE/XSUB.h).
+ - building: renamed libsdll.dsw into win32dll.dsw.
+ - building: renamed libsdll.dsw into win32dll.dsw. building:
+ simplified linking the Net-SNMP applications with netsnmp.dll by
+ adding all application projects to the same workspace that is used
+ for building the DLL.
+ - building: renamed libsdll.dsw into win32dll.dsw. building:
+ simplified linking the Net-SNMP applications with netsnmp.dll by
+ adding all application projects to the same workspace that is used
+ for building the DLL. building: made building netsnmp.dll less
+ error prone by letting the compiler print an error message if the
+ preprocessor symbol NETSNMP_USE_DLL has not been defined.
+ - building: simplified the build process by removing the file
+ win32/libsnmp_dll/libsnmp.def.in. Which IPv6 functions are exported
+ from netsnmp.dll is now determined by which of the functions in
+ this DLL have been declared as NETSNMP_IMPORT.
+ - building: simplified the procedure for building with SNMPv3 support
+ enabled (OpenSSL).
+ - changed the type of the fourth argument of netsnmp_set_row_column()
+ from const char* to const void* such that no cast is necessary when
+ passing another datatype then char* or const char*. changed
+ in_addr_t from u_int to u_long such that it matches the datatype of
+ sockaddr_in::sin_addr. Also, fixed several compiler warnings
+ (mostly char * <> u_char * mismatches) and removed some casts.
+ - declared all functions that are exported from the Net-SNMP DLL as
+ NETSNMP_IMPORT. The result is a minor optimization: code that uses
+ the Net-SNMP DLL will now call the DLL-exported functions directly
+ instead of indirectly via the stub in the import library.
+ - exported netsnmp_read_module() from netsnmp.dll such that
+ NetSNMP.pm builds again.
+ - exported netsnmp_set_line_buffering() from netsnmp.dll.
+ - libsnmp builds again as a DLL when IPv6 is enabled.
+ - perl: fixed several "Free to wrong pool" errors. Note: since
+ calloc() is not redefined in <CORE/XSUB.h> using calloc() directly
+ or indirectly leads to "Free to wrong pool" errors, at least on
+ Windows.
+ - winExtDLL: don't trigger a netsnmp_assert() when no extension DLLs
+ have been loaded.
+ - winExtDLL: fixed a bug in getNext handling that could cause the MIB
+ output to be truncated.
+ - winExtDLL: multiple varbind set requests are now processed
+ correctly.
+ - winExtDLL: multiple varbind set requests are now processed
+ correctly. winExtDLL: made error codes in SNMP response PDUs as
+ RFC-compliant as possible.
+ - winExtDLL: multiple varbind set requests are now processed
+ correctly. winExtDLL: made error codes in SNMP response PDUs as
+ RFC-compliant as possible. winExtDLL: if loading an extension DLL
+ fails, the reason why loading failed is now logged.
+ - winExtDLL: multiple varbind set requests are now processed
+ correctly. winExtDLL: made error codes in SNMP response PDUs as
+ RFC-compliant as possible. winExtDLL: if loading an extension DLL
+ fails, the reason why loading failed is now logged. winExtDLL:
+ fixed a memory leak that occurred when SnmpExtensionQuery(Ex)
+ failed. This memory leak has been found via source reading. Note:
+ it is not clear whether it was possible to trigger this memory
+ leak. This leak is certainly not triggered by every request for
+ which a response with non-zero error status is sent back.
+ - Suppressed "implicit cast from int to u_char" warnings generated by
+ MSVC.
+ - made sure that accessing the mibII interfaces table does not
+ trigger out-of-range array accesses (was detected by
+ BoundsChecker).
+ - Fix build under MinGW back/forward port of revision 18631
+
+
+
+*5.5*
+
+ snmplib:
+ - [BUG 1171904]: fix recvfrom hangs (already closed)
+ - [BUG 1345296]: fix recvfrom hangs (already closed)
+ - [BUG 1600171]: Support longer community strings in VACM config.
+ - [BUG 1619827]: improve handling of link dependencies
+ - [BUG 1660061]: Validate engineIDs more strictly.
+ - [BUG 1795840]: Signed 32-bit truncation logged as debug message
+ - [BUG 1866655]: Handle parsing invalid OID subidentifiers
+ - [BUG 1898198]: Avoid a segfault when parsing broken mibs.
+ - [BUG 1958041]: Ensure IDs are not truncated.
+ - [BUG 1976772]: Changed mib parser to handle long binary/hex strings.
+ - [BUG 2001124]: Allow embedded NUL characters in usmUserPublic
+ - [BUG 2027834]: Extend string print buffer by the minimum necessary.
+ - [BUG 2099985]: Added const qualifiers to time conversion routins
+ - [PATCH 2827722]: Improve strtoull to be less MSVC-specific
+ - [BUG Coverity #183]: fix memory leak if IP_PKTINFO fails
+ - [PATCH 700681]: limited support for UDPv4 broadcast addresses
+ - [PATCH 1548670]: Fix range checks for unsigned integers
+ (Debian bug #383380)
+ - [PATCH 1592706]: Fix memory leak when cloning varbinds.
+ - [PATCH 1616912]: fix memory leak in snmp_udp_transport
+ - [PATCH 1620424]: Honor NETSNMP_DS_LIB_DEFAULT_PORT over the default system
+ - [PATCH 1627049]: New API to handle large numbers of file descriptors.
+ - [PATCH 1634620]: Fix leaks from create_user_from_session failure.
+ - [PATCH 1640114]: Don't store trailing null character.
+ - [PATCH 1641895]: Extend short view masks (as per RFC specs)
+ - [PATCH 1641972]: add missing const
+ - [PATCH 1642071]: Don't fiddle with the storage of pre-existing users.
+ - [PATCH 1645698]: fix 64-bit signed integer encoding
+ - [PATCH 1653670]: Consistent SNMPv3 behaviour when opening sessions.
+ - [PATCH 1665543]: Handle VACM checks correctly.
+ - [PATCH 1681030]: Better handling of empty apptype configs.
+ - [PATCH 1681977]: Add callbacks prior to reading config.
+ - [PATCH 1687316]: Don't drop const from casts.
+ - [PATCH 1687317]: Remove an unused local variable
+ - [PATCH 1687318]: Make _sess_selpol_info static.
+ - [PATCH 1687319]: Declare snmp_sess_read_extd()
+ - [PATCH 1687325]: Fix problem with operator precedence.
+ - [PATCH 1687337]: Implement _sess_open in terms of snmp_sess_add
+ - [PATCH 1728247]: Clean up int64 type checking and usage for building packets
+ - [PATCH 1737085]: fix the -M switch for mib parsing vs defaults
+ - [PATCH 1768285]: Count MIB files correctly in add_mibdir()
+ - [PATCH 1775124]: Fix clientaddr functionality
+ - [PATCH 1806336]: fix -LS option parsing
+ - [PATCH 1807489]: fix ignoring of display hints.
+ - [PATCH 1811469]: read_config_files_in_path() reads past malloc'd buffer
+ - [PATCH 1875022]: improve callback locking mechanisms
+ - [PATCH 1882069]: Add token for specifying an exact SNMPv3 engineID
+ - [PATCH 1895927]: change obsolete recv/send to recvfrom/sendto
+ - [PATCH 1898204]: Avoid a segfault when parsing broken mibs.
+ - [PATCH 1916840]: new config option to set SNMPv1 trap agent address
+ [PATCH 1916840]: introduce netsnmp_gethostbyname_v4
+ - [PATCH 1921861]: Avoid endless loop after truncating 64bit int
+ - [PATCH 2003450]: Fix a couple of 64-bit problems.
+ - [PATCH 2043018]: fix recvfrom hangs
+ - [PATCH 2258229]: Remove misleading comment
+ - [PATCH 2479700]: Fix zoned IP address used as table indices
+ - [PATCH 2492377]: Fix typo/bug in snmp_enable_callback()
+ - [PATCH 2505488]: Fix alarms not triggered due to large clock skews.
+ - [PATCH 2538169]: Prevent infinite retries for an invalid error-index.
+ - [PATCH 2689362]: Fix handling of IPv6 hostnames.
+ - [PATCH 2713841]: Fix runtime errors triggered by high-ASCII chars
+ - [PATCH 2772787]: Cleaner approach to handling large fd_sets.
+ - [PATCH 2780411]: Fix compiler warnings
+ - [FEATURES 454028]: Detect empty MIB index files.
+ - [FEATURES 851887]: Report range information for invalid SET requests.
+ - [FEATURES 1041888]: Check directory paths for config files.
+ - [FEATURES 1407476]: Rename 'strictCommentTerm' to reflect actual behaviour.
+ - Add GCC format checking attributes to the debug functions.
+ - Add iterator for singly linked lists
+ - Correct MAX_ENGINEID_LENGTH to 32 (as per SnmpEngineID TC)
+ - Correct registration of multiple premib config handlers.
+ - Deallocate various resources in shutdown_mib
+ - Do not leak memory whenever an udp address is formatted.
+ - Do not try to look up empty strings as hostnames for IPv6
+ - Fix forwarding encoding
+ - Fix potential buffer overflow in sprintf for UDP/IPv6
+ - Handle mapping complex transport strings to simple name definitions
+ - Hardcode default port numbers (rather than use getservbyname)
+ - Implement RFC5343 contextEngineID probing.
+ - Improve CONTAINER_INSERT handling of partial failure with multiple indexes
+ - Improve netsnmp_watcher_info to handle statically allocated data.
+ - Introduce printf-like versions of config_perror and config_pwarn
+ - Library layering improvements
+ - Read def{Target,Domain} from snmp.conf as well as <app>.conf
+ - rename MIB macro to NETSNMP_MIB2_OID, MIB is too generic and may
+ conflict with applications. The old MIB macro is kept for
+ backward compatibility, unless NETSNMP_NO_LEGACY_DEFINITIONS is
+ defined.
+
+ snmpd:
+ - [BUG 902610]: Don't discard pending data following a TRAP.
+ - [BUG 902801]: Fix ordering of SMUX-registered subtrees.
+ - [BUG 1046327]: Reset "includeAllDisks" flag when reloading.
+ - [BUG 1102058]: Skip non-mounted disks (e.g. swap partitions)
+ - [BUG 1397895]: include missing interface declarations
+ - [BUG 1400101]: remove deleted interfaces from ifTable
+ - [BUG 1413728]: Reference index values in debug output correctly.
+ - [BUG 1416276]: Handle dependency on MIB parsing API.
+ - [BUG 1546817]: Fix snmpEnterprise varbind when forwarding v1 traps.
+ - [BUG 1558823]: fix ipAddressTable memory leak
+ - [BUG 1600261]: Handle non-x86 /proc/cpuinfo format
+ - [BUG 1600432]: Handle signals properly when restarting the agent.
+ - [BUG 1602286]: Don't let table holes block later rows.
+ - [BUG 1628613]: Restore memTotalFree.0 on Solaris
+ - [BUG 1633595]: Fix AgentX handling of Counter64 values
+ - [BUG 1677063]: Check for failed malloc calls.
+ - [BUG 1685067]: More precise handling of SNMPv3-admin MIB tables.
+ - [BUG 1685081]: Check for valid OID on Free/Undo passes.
+ - [BUG 1693039]: be silent when insert fails.
+ - [BUG 1712988]: default/configurable max # varbinds returned by GETBULK
+ - [BUG 1745113]: Handle single-line output in UCD compatability mode.
+ - [BUG 1748206]: Protect against failures to open /etc/mtab (or equiv)
+ - [BUG 1758212]: Handle missing variable types (IpAddress,Counter,Opaque)
+ - [BUG 1760633]: fix typo in debug message
+ - [BUG 1771221]: Retain ifLastChange information on data reload.
+ - [BUG 1792890]: include CIFS mounts when skipping remote filesystems
+ - [BUG 1822360]: Fix spinlock helper error handling.
+ - [BUG 1912647]: Fix memory leak following failed requests.
+ - [BUG 1931391]: Fix reporting of Memory buffers and cached memory.
+ - [BUG 2001124]: Allow embedded NUL characters in usmUserPublic
+ - [BUG 2003144]: Increase size of AgentX packet build buffer
+ - [BUG 2006786]: Interface name can have more than 8 characters.
+ - [BUG 2018031]: Don't probe engineID in internal monitor sessions.
+ - [BUG 2693670]: Don't open (& clobber) AgentX socket if other transports fail
+ - [BUG 2822355]: Fix memory leaks on udpEndpointTable (linux) Patch
+ supplied by Frank Lichtenheld
+ - [PATCH 1225440]: Delay sighup till it is safe.
+ - [PATCH 1257347]: Non-fixed size connection buffer
+ - [PATCH 1550730]: Report errors from iterator-based handlers.
+ - [PATCH 1585146]: Extend range of available error codes
+ - [PATCH 1595568]: fix delegated SET requests from agentx subagents
+ - [PATCH 1601188]: Handle signals properly when restarting the agent.
+ - [PATCH 1601453]: Dynamic Memory failure handling improvements
+ - [PATCH 1617255]: fix length of the history array to match code.
+ - [PATCH 1620424]: Fix default port for sending notification
+ - [PATCH 1625069]: speed improvements for solaris routing table access
+ - [PATCH 1639282]: Save persistent snmpTargetParamsTable settings correctly.
+ - [PATCH 1639726]: Report physical memory correctly on *BSD
+ - [PATCH 1641332]: Include missing agent config definitions.
+ - [PATCH 1641685]: Handle unresponsive AgentX subagents more reliably.
+ - [PATCH 1641865]: Don't double check snmpTrapOID in the filter table.
+ - [PATCH 1642255]: Handle saving long snmpNotifyFilterTable entries.
+ - [PATCH 1644280]: Don't automatically probe for v3 EngineIDs.
+ - [PATCH 1644280]: Use the correct engineID when sending v3 traps.
+ - [PATCH 1644714]: replace last use of deprecated copy_word by copy_nword
+ - [PATCH 1654424]: Handle row deletion issues in dataset tables
+ - [PATCH 1657741]: Handle 64-bit types via pass mechanism.
+ - [PATCH 1659623]: Handle SMUX peers with an empty password.
+ - [PATCH 1665543]: Handle VACM checks correctly.
+ - [PATCH 1665549]: Handle creating VACM entries correctly.
+ - [PATCH 1665985]: Implement ipReasmTimeout
+ - [PATCH 1666737]: include IPv6 traffic in various UDP counters.
+ - [PATCH 1668193]: Fix check for v6 ReasmMaxSize support.
+ - [PATCH 1668193]: Update registration of ReasmMaxSize support.
+ - [PATCH 1668952]: Ignore zombie processes.
+ - [PATCH 1669048]: Add support for ipv6InterfaceIdentifier
+ - [PATCH 1676478]: fix udpEndpointRemoteAddress
+ - [PATCH 1678301]: Deallocate domain registry at shutdown
+ - [PATCH 1678305]: Deallocate cache in hardware/cpu/cpu on shutdown
+ - [PATCH 1678306]: Deallocate log in notification-log-mib/notification_log
+ - [PATCH 1678788]: Better handling of SMUX socket descriptors.
+ - [PATCH 1681043]: clean up helper includes
+ - [PATCH 1683054]: set udpEndpointInstance to identify different processes.
+ - [PATCH 1687336]: Start using the enhanced read_config interface
+ - [PATCH 1692768]: Fix copying of non-octet-aligned IP address prefixes.
+ - [PATCH 1692817]: Improved RFC 4293 support (inc. non-unicast/random IP addresses)
+ - [PATCH 1698184]: Register non-default context integers as writable.
+ - [PATCH 1700157]: Fix ordering of exec tokens in MIB output
+ - [PATCH 1700730]: Remove unused extern declaration.
+ - [PATCH 1700732]: Fix debug output statements.
+ - [PATCH 1700737]: Tidy up setSerialNo implementations.
+ - [PATCH 1702361]: Read stats from /proc/net/snmp6
+ - [PATCH 1702366]: Support for icmpStatsTable
+ - [PATCH 1703004]: Consolidate snmp6 handling.
+ - [PATCH 1710632]: fix memory leak on broken container insertions for the ipAddressTable
+ - [PATCH 1715395]: fix icmp table errors in new icmp code
+ - [PATCH 1715406]: registration ordering fixes for icmpStatsTable
+ - [PATCH 1716548]: Fix help output so no space is printed between -D and arguments.
+ - [PATCH 1719253]: fix skipNFSInHostResources for multiple walks
+ - [PATCH 1721096]: remove unused variable stats from kernel extraction for better portability.
+ - [PATCH 1723611]: New implementation of the RMON alarmTable
+ - [PATCH 1729629]: Fix memory leak in disman agent.
+ - [PATCH 1737439]: automatic link up/down traps on a walk
+ - [PATCH 1744157]: Report duplicate "extend/exec" identifiers.
+ - [PATCH 1746831]: fix process checking race condition under Linux and platform #ifdefs
+ - [PATCH 1752934]: Fix off-by-one qsort error in table utilities.
+ - [PATCH 1753437]: Fix error index on failing SET requests
+ - [PATCH 1753449]: Fix AgentX error propagation
+ - [PATCH 1753463]: Fix AgentX subagent ping alarm handling
+ - [PATCH 1758208]: Fix memory leak
+ - [PATCH 1783733]: Put the package version number into the hrSWInst table for solaris.
+ - [PATCH 1784747]: Fix long usage for ip adresses on 64 bit systems in various MIB-II tables.
+ - [PATCH 1797111]: implement IP-MIB::ipIfStatsTable
+ - [PATCH 1804445]: High order bits of HCInOctets not set on Solaris
+ - [PATCH 1806501]: Add API for sending traps with a snmpv3 context
+ - [PATCH 1823465]: fix icmp cache registration
+ - [PATCH 1823800]: release and reload all trap destinations on SIGHUP
+ - [PATCH 1826088]: Use the right interface to read the netmask
+ - [PATCH 1828839]: to provide better handling of disks mounted on paths with embedded spaces
+ - [PATCH 1849903]: do not spam log with asserts when XEN is used
+ - [PATCH 1866823]: truncate 32 bit counter values on 64 bit machines to avoid bogus warnings.
+ - [PATCH 1879261]: Add in inactive memory to the cached report for freebsd
+ - [PATCH 1882621]: Add LVM support to the partition table
+ - [PATCH 1893468]: fixed registration of OIDs with ranges
+ - [PATCH 1901764]: for supporting logwatch files that are date based
+ - [PATCH 1909813]: fix table_iterator handling of SORTED hint
+ - [PATCH 1916840]: new config option to set SNMPv1 trap agent address
+ - [PATCH 1944581]: Protect against core dumps with long string index values.
+ - [PATCH 1967194]: Recognise NFS4 mounts
+ - [PATCH 1977439]: Fix pass/_persist bug with SET oid value
+ - [PATCH 1995753]: minor cleanup agent/auto_nlist.c
+ - [PATCH 2012402]: don't fail on failure to look up interface error counters.
+ - [PATCH 2014204]: Support -g {groupname}
+ - [PATCH 2022936]: Fix AgentX Counter64 decoding on 64-bit architectures
+ - [PATCH 2082726]: correctly report NIC speeds higher than 4Gbit/s
+ - [PATCH 2103492]: implement RMON-MIB::etherStatsJabbers
+ - [PATCH 2124288]: Fix setting of usmUserPrivProtocol at creation.
+ - [PATCH 2162652]: patch to fix simple hrfs checks when NFS is in use.
+ - [PATCH 2384779]: Fix handling of GetBulk with N>0,M==0
+ - [PATCH 2406378]: Fix hrSWRunPerfMem on 64-bit Solaris systems
+ - [PATCH 2431353]: Make some C++ compilers happier
+ - [PATCH 2435681]: Enable if-mib rewrite (with sysctl backend) on NetBSD
+ - [PATCH 2435793]: Support 64-bit IF-MIB counters on sysctl (*BSD) system.
+ - [PATCH 2449210]: add 64-bit disk usage statistics to UCD-SNMP-MIB::dskTable
+ - [PATCH 2564552]: provide libnetlink support for loading the tcp table
+ - [PATCH 2686280]: Report duplicate registrations as an error
+ - [PATCH 2791417]: fix snmpd segfault when run with -DALL Patch
+ - [PATCH 2822337]: Fix memory leak in ipAddressPrefixTable
+ - [FEATURES 1019429]: Set supplementary groups via initgroups(3)
+ - Add missing function declarations & include files.
+ - Add support for a user provided length variable
+ and C string values to the watcher helper.
+ - Allow "monitor" to handle negative threshold values.
+ - Automatically reregister sysORTable entries from AgentX subagents.
+ - Clean up notification registrations during Event MIB cleanup
+ - Enforce the lower limit on scalar_groups
+ - Fix CVE-2008-4309 (GETBULK issue reported by Oscar Mira-Sanchez)
+ - Fix memory leak when multiple interfaces have the same IPv6 address
+ - Fix two bugs with smux password support.
+ - Handle device names with embedded spaces in UCD-SNMP-MIB::dskDevice
+ - Implement ipNetToPhysicalLastUpdated
+ - Implement ipAddressSpinLock
+ - Improve efficiency of scalar_group helper.
+ - Improve parsing of -LS command line argument
+ - Register CPU/memory hardware modules with nsCacheTable.
+ - Reimplementation of LM-SENSORS-MIB
+ - Reimplementation of snmpMPDStats.
+ - Reimplementation of usmStats.
+ - Remove unused variables.
+ - Suppress annoying "registration != duplicate" warning for root oids
+ - Unify all snmpd statistic variables with a common handler.
+ - Use the worker helpers from the register_*_instance helpers and
+ schedule the instance helpers for removal in 5.6
+ - Use static watcher_info for all watched variables and in int_watch.
+ - fix possible crash when 64-bit counters in ipSystemStatsTable get
+ bigger than 2^32
+
+ snmptrapd:
+ - [BUG 1638225]: Fix interpretation of transport address data.
+ - [BUG 1955227]: Memory leak for embedded Perl on x86_64
+ - [PATCH 1746992]: Improve snmptrapd access-control error messages.
+ - [PATCH 1767725]: Close all non standard file handles
+ - [PATCH 1908288]: Run perl END block on termination
+ - [PATCH 2726302]: Pass results of Perl trap handlers to trap daemon
+ - [PATCH 1225440]: Delay sighup till it is safe.
+ - [FEATURE 741375]: Extend -F flag to cover syslog/execute format strings.
+ - [FEATURE 1159947]: Allow control of traphandle data format
+ - Add trap handler for logging traps to a mysql database
+ - Support for forwarding traps by OID subtree.
+ - Support per-trap format specifications
+ - Withdraw deprecated options.
+
+ apps:
+ - [BUG 1964136]: Drop NULL type from snmpset usage message.
+ - [BUG 2811577]: Fix bug in GetBulk handling. Don't get confused by
+ index values that contain a ':' character.
+ - [PATCH 1529523]: Close SNMP session on failure.
+ - Improve parsing of -LS command line argument
+
+ snmpnetstat:
+ - [PATCH 2564538]: Support GETBULK in v2c+ snmp versions
+
+ snmpusm:
+ - [PATCH 1591355]: Allow cloning to arbitrary engineIDs
+
+ snmpwalk:
+ - [PATCH 1723620]: Specify an explicit end-point for the walk.
+
+ build:
+ - [BUG 1096166]: Handle --without-logfile correctly.
+ - [BUG 1567324]: Clarify prompting for user-supplied values.
+ - [BUG 1600093]: autoconf 2.60 breaks the build
+ - [BUG 1647976]: Cygwin/MinGW Windows build fails due to libtool error
+ - [BUG 1707469]: Win32: snmpv3-security-includes.h not installed
+ - [BUG 1802833]: Ensure snmptrapd builds with --disable-snmpv1/2c
+ - [BUG 1823381]: Use a sensible default MIBDIR path on Cygwin/MinGW
+ - [BUG 1823381]: Valid MIB directory search path on Windows
+ - [BUG 1872266]: PERLCC check fails for CC with options
+ - [BUG 1995172]: fix --without-elf configure usage message
+ - [BUG 2014526]: Win32: snmpv3-security-includes.h not installed
+ - [BUG 2023803]: Compilation problems on HP-UX 11.31
+ - [BUG 2095983]: fix syntax/permissing error in find-requires helper script
+ - [BUG 2168180]: Improve handling of various --enable/--disable options.
+ - [BUG 2782700]: build failure when using --with-pkcs on Solaris
+ - [PATCH 1577917]:Simplify makefile target references (patch from Apple)
+ - [PATCH 1600453]: Fix cross-compile builds in apples build environment.
+ - [PATCH 1624406]: option to hardcode location of mount table
+ - [PATCH 1625135]: configure location of python interpreter
+ - [PATCH 1678300]: compile-subagent doesn't call shutdown_ methods
+ - [PATCH 1681073]: #ifdef based config_error instead of special cases
+ - [PATCH 1728241]: Add configure check for <sys/uio.h>
+ - [PATCH 1728230]: add configure check for gai_strerror()
+ - [PATCH 1728233]: make sure type nfds_t is defined
+ - [PATCH 1728237]: Move variable declaration at the top of netsnmp_udp_sendto
+ - [PATCH 1728244]: Add configure check for sin6_scope_id
+ - [PATCH 1728247]: Add type check for int??_t and uint??_t
+ - [PATCH 1899762]: Tweak embedded_perl configure checks.
+ - [PATCH 2000874]: Cleanup transport selection.
+ - [PATCH 2091156]: correctly declare dependencies in Makefile. 'make -j <N>' should work now.
+ - [PATCH 2184039]: Fixes for freeing memory during error conditions.
+ - [PATCH 2797251]: Support multiple initialisation/shutdown, fix memory leaks
+ - Add a variation of AC_SEARCH_LIBS where the result is settable.
+ - Add "BuildRequires: perl-ExtUtils-Embed" to the spec file
+ - Add '--with-temp-file-pattern' configure option
+ - Assume target platform supports mem{cpy,move,set} & str{,r}chr
+ - Disable inlining on solaris (due to linking errors)
+ - Disable MIB-specific tests if the agent omits the necessary modules.
+ - '--disable-as-needed' reverts to linking system libs into applications
+ - Do not config_require(util_funcs) if nothing from util_funcs is used
+ - Do not require use of --with-endianness when cross-compiling.
+ - Fix build issues with ethtool (on RH9).
+ - Fix checks for support of static inline functions
+ - Fix compilation on IRIX
+ - Fix macro for '--with-features-of'
+ - Improve library layering & dependency handling when linking apps
+ - Improve robustness of sed/grep/etc commans (using autoconf macros)
+ - Improve RPM spec files, for consistency with vendor-provided packages.
+ - Mechanism for selecting build environment based on version
+ - New NETSNMP_ARG_WITH/ENABLE macros to catch incorrect 'with/enable' usage
+ - '--enable-ipv6' should only enable 'mibII/ipv6' on supported systems
+ - Remove Net-SNMP special-case handling of standard functionality.
+ - Restructure configure template
+ - Stricter checks on '--with-persistent-mask' values
+ - Update to autoconf 2.63 & libtool 2.2.6
+ - Use 'config_error' to generate error messages at configure time.
+ - Use LDFLAGS when building agent, helpers and mib lib
+ - Use "libtool clean" to ensure removal of all libtool temp files.
+ - allow building with Perl versions that lack PERL_EXIT_DESTRUCT_END
+ - build fix for Tru64 Unix and IRIX: move _XOPEN* definitions to
+ where they are in 5.4.x and earlier
+
+ documentation:
+ - [BUG 1247164]: Document use of OID macros
+ - [BUG 1407476]: Clarify MIB parsing toggle options & comment handling.
+ - [BUG 1614104]: broken snmpd(8) manual page in 5.4
+ - [BUG 2027129]: fix typo in snmpcmd.1
+ - [PATCH 1604580]: SNMP(3) manual page corrections
+ - [PATCH 1644735]: Add gcc build instructions for IRIX
+ - Fix minor documentation bugs (patch from Apple)
+
+ mib2c:
+ - [BUG 833673]: More focused size checks.
+ - [BUG 1429472]: Protect against missing instances (and invalid objects)
+ - [BUG 1582972]: Handle @while@/@end@ properly.
+ - [BUG 1737068]: Handle MIB objects with embedded hyphens
+ - [BUG 1874059]: Handle MIB objects with embedded hyphens
+ - [PATCH 1668171]: skip unknown cols in min/max range for tables
+ - [PATCH 1719244]: Fix mfd generating map function
+ - [PATCH 1914398]: install mib2c.perl.conf
+ - [PATCH 2136437]: Improve FLAG defines for huge tables on 64bit systems
+ - [PATCH 2316127]: Fix bug in iterate_access generated code.
+
+ misc:
+ - [PATCH 1737727]: Add a NETSNMP_OLDAPI_ prefix to old-api access macros.
+ - [PATCH 1737727]: Replace NETSNMP_CLEAN_NAMESPACE with NETSNMP_NO_LEGACY_DEFINITIONS
+ - Add config reread support to "net-snmp-config --compile-subagent" code.
+ - Avoid calling debug macros with wrong number of arguments.
+ - Don't use the legacy symbol SNMPTRAPD_DISABLE_AGENTX
+ - Preliminary (alpha) support for SNMP over SSH and DTLS/UDP.
+ - Preliminary (alpha) support for the TSM security model
+ - Separate user management into new net-snmp-create-v3-user script
+
+ unspecified:
+ - [BUG 1596638]: memory leak in ipCidrRouteTable, inetCidrRouteTable
+ - [BUG 1611524]: fix tcp connection table fd leak
+ - [BUG 1793545]: Take the name from the sockaddr_un in order to avoid
+ transport specifiers and other decorations.
+ - [BUG 1801835]: Multiple default transports for an application.
+ - [BUG 1851047]: Don't continue to process a corrupt watched value.
+ - [PATCH 1601453]: Dynamic Memory failure handling improvements
+ - [PATCH 1674298]: Remove unused sinkport variable
+ - [PATCH 1674299]: Lessen scope of zone variable in dump_realloc_oid_to_inetaddress
+ - [PATCH 1674302]: Lessen scope of len variable in convert_v2pdu_to_v1
+ - [PATCH 1678298]: compile-subagent checks for bad HAVE_SIGNAL_H
+ - [PATCH 1678302]: netsnmp_mibindex_load leaks memory
+ - [PATCH 1681035]: Improve net-snmp-config /bin/sh compatibility
+ - [PATCH 1902105]: Hide and improve debug log messages
+ - [PATCH 1902113]: Fix error log in inetNetToMediatable
+ - Fix for refs to OBJECT-GROUP in another MIB
+ - Initalize log subsystem
+ - Remove support for use of varargs.h.
+
+ perl:
+ - [BUG 1450669]: a perl agentx consumes memory
+ - [BUG 1554817]: Fix class assigment so getRootOID works properly.
+ - [BUG 1606062]: perl bulkwalk (async) coredump
+ - [BUG 1619827]: improve handling of link dependencies
+ - [BUG 1747733]: More robust handling of undefined values.
+ - [BUG 1834539]: Consistent handling of OID parsing.
+ - [PATCH 1627949]: a perl agentx consumes memory
+ - [PATCH 1725049]: Fix bulkwalk in cases of non-repeater usage.
+ - [PATCH 1811463]: perl async callback coredump
+ - [PATCH 1834983]: Consistent handling of OID parsing.
+ - [PATCH 1914393]: registerAgent can now be run multiple times
+ - [PATCH 1914643]: fix issues with embedded perl
+ - [PATCH 1914645]: better end of mib support
+ - [PATCH 1920390]: fix registration of tables with .0 as IIDs
+ - [PATCH 1956193]: beta threadable perl module code for SNMPv1/2c usage.
+ - [PATCH 2021444]: Support SNMPv2c in gettable processing
+ - [PATCH 2022948]: Fix for Counter64 in perl subagent
+ - [PATCH 2182079]: Fix various perl warnings & allow use of "use strict"
+ - [PATCH 2272347]: Implement "implied" in MIB hash
+ - [PATCH 2361712]: Fix getbulk optimization during walks
+ - [PATCH 2709705]: Retrieve src/target IP address in Perl-based agents
+ - [PATCH 2763717]: Allow perl to use OPAQUEs
+ - [PATCH 2793857]: Report failed asynchronous requests.
+ - fix SNMP SET for IP addresses on 64-bit
+ - fix prerequisites for NetSNMP::TrapReceiver
+ - fix syntax error in NetSNMP::agent::Support
+ - install embedded perl init files with correct permissions
+
+ python:
+ - [BUG 1826174]: Check for buffer overflow when printing values.
+ Addresses CVE-2008-2292
+ - [BUG 1868278]: Python segfault
+ - [BUG 2258935]: Python Extension Module fails on Solaris
+ - [PATCH 1716114]: Let python build in source tree (Debian patch#38)
+ - [PATCH 1862177]: made code more windows/cygwin compiler friendly
+ - [PATCH 1877840]: Fix MIB label and indexing due to sl, broken regexp
+ - [PATCH 2074817]: Fix regexp engine CPU performance issues
+ - [PATCH 2260828]: Fix python snmpwalk memory leak
+ - [PATCH 2580979]: Fix python session pointers on 64-bit systems.
+ - [PATCH 2667415]: Support "UseNumeric" option.
+ - [PATCH 2775800]: Allow threading to continue when a request is sent
+
+ test:
+ - enhance snmpnetstat test to check tcpTable in TCP mode
+ - support a -n flag to RUNTESTS to print the test number found in the
+ test file as opposed to the numerical count
+ - Do not terminate on SIGCHLD since dash and soume bourne shells will
+ exit the main shell when a subshell terminates in that case.
+
+ Ports:
+ - [BUG 1710910]: initial support for DragonFly BSD
+ - [PATCH 1623874]: add GNU/kFreeBSD support
+
+ AIX:
+ - [PATCH 1665079]: AIX patches for cpu stats and process monitoring
+ - Add support for AIX 6.x
+ - Build fixes for embedded Perl
+ - Fix default shared library building instead of forcing static
+ - Use "-Wl,-brtl" when compiling with gcc
+ - [PATCH 2886598]: Header fixes for compiling on AIX6
+
+ FreeBSD:
+ - [BUG 1073782]: Restore PerfStat values for FreeBSD 5.x systems.
+ - [BUG 1633483]: Support CPU HAL on FreeBSD4.x
+ - [PATCH 1951996]: Fix for CPU stats on FreeBSD
+ - [PATCH 2507249]: sctp-mib support for FreeBSD.
+ - Add initial support for upcoming FreeBSD 7
+ - Fix configure warning for sys/conf.h
+ - patch from Cezary Morga to fix a make test on freebsd
+
+ HP-UX:
+ - [BUG 2779472]: Filesystems missing in hrStorage table
+ - [PATCH 2088726]: Fix an issue reporting memory in negative values.
+ - Needs _REENTRANT defined to pick up strtok_r.
+
+ IRIX:
+ - [PATCH 1675869]: CPU statistics for IRIX based on PCP
+ - [PATCH 1709748]: Optimized IRIX cpu stats
+
+ Linux:
+ - [BUG 1666005]: Fail to walk ipv6InterfaceTable on Linux
+ - [PATCH 1581294]: host-resources improvements
+ - [PATCH 1969627]: Handle install with empty /etc/sysconfig/network file
+ - [PATCH 1704105]: Add IPv6 support to the inetNetToMediaTable
+ - [PATCH 1705594]: Various fixes to ipAddressPrefixTable reporting
+ - [PATCH 1708243]: Implement ipDefaultRouteTable
+ - [PATCH 1715405]: Implement ipv6ScopeZoneIndexTable
+ - [PATCH 1719254]: update HRFS_ignore list to current linux likelyhoods
+ - [PATCH 1724602]: MfD-based ipDefaultRouterTable implementation
+ - [PATCH 1783423]: return a correct ipv6InterfaceIdentifier of loopback
+ - [PATCH 1826102]: support longer interface names
+ - [PATCH 1828602]: Support ipDefaultTTL and ipForwarding SETs
+ - [PATCH 1896118]: Fix ifTable 32bit counters
+ - [PATCH 1927751]: Implement icmpMsgStatsTable
+ - [PATCH 2023633]: Implement SCTP-MIB
+ - [PATCH 2053273]: Implement EtherLike MIB
+
+ MacOSX:
+ - [PATCH 1600453]: OS X compile-time endian determination
+ - [PATCH 1600522]: CPU HAL implementation for mach/darwin
+ - Improve memory reporting (patch from Apple)
+ - Patch: 3514049 from twobits-github: fix compilation on darwin11
+
+ Solaris:
+ - [BUG 1626153]: No hrSWRun informations on Solaris zones
+ - [BUG 1810814]: tcpTable missing entries and wrong ports
+ - [BUG 1819189]: {ifOperStatus,ipAdEntIfIndex} reported incorrectly
+ - [BUG 1822275]: {ifOperStatus,ipAdEntIfIndex} reported incorrectly
+ - [PATCH 1623447]: Fix hrSWRun for terminated processes
+ - [PATCH 1719730]: Support for ipSystemStatsTable and ipAddressTable
+ - [PATCH 1824196]: {ifOperStatus,ipAdEntIfIndex} reported incorrectly
+ - [PATCH 1834699]: Fix 1833294: DLPI problems on Solaris 2.6
+ - [PATCH 2012404]: Deal with more than 10 interfaces.
+ - [PATCH 2751588]: Inconsistent data can be reported on Solaris 10U4+
+ - #define NEW_MIB_COMPLIANT to support Solaris 10U4+
+ - IF-MIB fix: add missing return at end of get_if_stats
+
+ Win32:
+ - [BUG 1662987]: compile error on Cygwin
+ - [BUG 2779541]: Fixed handle leak in pass_persist.
+ - [PATCH 1622080]: A: pass Win32 handles remain open.
+ - [PATCH 1706344]: Fix compilation with cygwin
+ - [PATCH 2686248]: Fix several winExtDLL bugs.
+ - [PATCH 2688342]: Fix VS2005 various compiler warning
+ - [PATCH 2691876]: Allow compiling the services using unicode.
+ - [PATCH 2693746]: improved socket startup support
+ - Add support for winExtDLL to build.bat
+ - Build fixes for MSVC 2008.
+ - fix AES support
+ - fix win32/Configure --with-ipv6
+
+*5.4*
+
+ build:
+ - [BUG 1416481]: Support specifying an explicit linker.
+ - enable-as-needed will try to link built libraries against needed
+ libraries at library link time, rather than application link time.
+
+ snmplib:
+ - [PATCH 1282566]: to rework transport creation to allow for
+ alternative interpretations of the address and a more flexible
+ transport registration system
+ - [BUGS: 1537459, BUGS: 1540745] Fix missing MIB parsing tokens
+ - [PATCH 1562168]: check for a sock fd less than 0.
+ - [PATCH 1570650]: create a logging shutdown function to propelry
+ clean up log registrations if needed.
+ - [PATCH 1565293]: UDPIPv6 transport reports wrong port number
+ - rename init_mib to netsnmp_init_mib to avoid symbol clash with
+ HP-UX's libnm
+ - [PATCH 1509943]: responses will get sent from the original dest IP
+ address when possible.
+
+ snmpd:
+ - [PATCH 1550725]: A new uint instance helper to match the existing
+ int, long and ulong helpers
+ - [BUG 1527930]: fix smux authentication
+ - [PATCH 1561277]: use net.ipv6.neigh.lo.base_reachable_time_ms
+ instead of deprecated base_reachable_time
+ - [BUG 1474468]: ifConnectorPresent always returns 0
+ - [PATCH 1524755]: to better support the UDPTable for unknown address
+ types
+ - [PATCH 1534877]: to add support for skipping NFS entries in the
+ host resources hrStorageTable. See the skipNFSInHostResources
+ token in the snmpd.conf file for details.
+ - [PATCH 1557514 ]: Do not attempt to collect data during SET
+ processing.
+ - [BUG 1535903]: Support spaces within security names
+ - Agent builds default module list from a default_mibs.h rather than
+ a hard coded configure list
+ - [BUG 1559358]: check scanf results for diskio scanning
+ - [BUG 1564233]: Have configure test for rpm headers not just the
+ libraries
+ - [PATCH 1579364]: Updated darwin patch to fix compilation on Tiger
+ and Leapord
+ - [PATCH 1565703]: patch to fix rapid registrations/deregistration
+ issues
+ - [PATCH 1562688]: fix ping/reattach agentx code
+ - [PATCH 1551948]: Make pass_persist usable on uClinux
+ - [PATCH 1568150]: Extend pass_persist error messages that can be
+ passed back from the script
+ - [PATCH 1570650]: make delete table function public
+ - [PATCH 1575984]: block SIGHUP during reconfig
+ - [PATCH 1570982 ]: Solaris IF-MIB: Support for IPv6-only interfaces
+ - memTotalFree should report total virtual instead of physical memory
+ - build fix for --without-kmem-usage
+ - [BUG 1585815]: fix mfd bits length calculation
+ - [BUG 1427410]: Set auth engineID for SNMPv3 traps.
+ - [BUG 1502267]: Build access list in the correct order.
+ - [PATCH 1554827]: from rtyle: fix handling of failed proxy SET
+ requests
+ - [PATCH 1598966]: Fix bug #1598927: #elif build fix
+
+ snmptrapd:
+ - the traphandle directive now supports a -t switch to indicate
+ matching any OID in the tree below the specified OID
+ - [PATCH 1536773]: support partial oid matching
+ - [PATCH 1598968]: Fix bug #1587759: snmptrapd doesn't recognize -A
+ option
+
+ snmpdf:
+ - [BUG 1515507]: Handle failed requests better
+
+ perl:
+ - Fixed the perl bulkwalk function
+ - [PATCH 1575937]: fix usenumeric output in async varbinds so they
+ return OIDs instead of empty strings.
+ - update default_store module to latest default_store c-binding
+ tokens
+ - make perltest fixes for Solaris 2.6 and earlier
+ - fixes for 64-bit platforms
+ - make perltest fixes for HP-UX
+ - make perltest fixes for IRIX
+ - [PATCH 2995098]: Fix creation of SNMPv3 sessions with API_SINGLE
+ - patch 3046371: from christophb4: Fix memory leak in SNMPv1 trap
+ handling.
+
+ mib2c:
+ - [BUG 1479916]: Restore consistency in row creation code.
+ - [BUG 2827269]: Suppress non-ordered TODO comments.
+
+ misc:
+ - Most net-snmp specific defines are now (also) available under a
+ proper NETSNMP_ prefix. The older, potentially conflicting names as
+ well as the autoconf variables can now be turned off by a special
+ define.
+ - [BUG 1585250]: don't use deprecated options in start script
+ - "make test" fixes for non-UDP transports
+ - [BUG 1577913]: add missing manual pages for executables, supplied
+ by Debian
+ - [PATCH 1596028]: from "Stephen J. Friedl": const fixes for the
+ mib_api(3) manual page
+ - RPM spec file fixes for 64-bit platforms
+
+ MacOSX:
+ - [PATCH 1566777]: build fixes for memory_darwin.c
+ - build fix for mibII/udpTable
+
+ Tru64:
+ - fix "auto_nlist failed on arptab_size at location 0" errors
+
+ IRIX:
+ - proper implementation for UCD-SNMP-MIB::laTable (avoiding nlist)
+
+ Solaris:
+ - [PATCH 1569537,1569539]: new UDP-MIB and TCP-MIB implementation
+ (enable through --with-mib-modules=udp-mib,tcp-mib)
+
+ AIX:
+ - use correct ARPTAB_SYMBOL and ARPTAB_SIZE_SYMBOL
+ - [BUG 1205300]: nlist err: neither nproc nor _nproc found (same for
+ rt_table, rthashsize, rthost, rtnet)
+
+ qnx6:
+ - [PATCH 2836895]: support for QNX6
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..d368331
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,294 @@
+Various copyrights apply to this package, listed in various separate
+parts below. Please make sure that you read all the parts.
+
+---- Part 1: CMU/UCD copyright notice: (BSD like) -----
+
+
+ Copyright 1989, 1991, 1992 by Carnegie Mellon University
+
+ Derivative Work - 1996, 1998-2000
+Copyright 1996, 1998-2000 The Regents of the University of California
+
+ 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 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.
+
+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 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.
+
+
+---- Part 2: Networks Associates Technology, Inc copyright notice (BSD) -----
+
+Copyright (c) 2001-2003, Networks Associates Technology, Inc
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* Neither the name of the Networks Associates Technology, Inc 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---- Part 3: Cambridge Broadband Ltd. copyright notice (BSD) -----
+
+Portions of this code are copyright (c) 2001-2003, Cambridge Broadband Ltd.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* The name of Cambridge Broadband Ltd. may not be used to endorse or
+ promote products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+---- Part 4: Sun Microsystems, Inc. copyright notice (BSD) -----
+
+Copyright © 2003 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+California 95054, U.S.A. All rights reserved.
+
+Use is subject to license terms below.
+
+This distribution may include materials developed by third parties.
+
+Sun, Sun Microsystems, the Sun logo and Solaris are trademarks or registered
+trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* Neither the name of the Sun Microsystems, Inc. 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---- Part 5: Sparta, Inc copyright notice (BSD) -----
+
+Copyright (c) 2003-2012, Sparta, Inc
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* Neither the name of Sparta, Inc 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---- Part 6: Cisco/BUPTNIC copyright notice (BSD) -----
+
+Copyright (c) 2004, Cisco, Inc and Information Network
+Center of Beijing University of Posts and Telecommunications.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* Neither the name of Cisco, Inc, Beijing University of Posts and
+ Telecommunications, nor the names of their contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---- Part 7: Fabasoft R&D Software GmbH & Co KG copyright notice (BSD) -----
+
+Copyright (c) Fabasoft R&D Software GmbH & Co KG, 2003
+oss@fabasoft.com
+Author: Bernhard Penz <bernhard.penz@fabasoft.com>
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* The name of Fabasoft R&D Software GmbH & Co KG or any of its subsidiaries,
+ brand or product names may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---- Part 8: Apple Inc. copyright notice (BSD) -----
+
+Copyright (c) 2007 Apple Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following
+disclaimer in the documentation and/or other materials provided
+with the distribution.
+3. Neither the name of Apple Inc. ("Apple") 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 BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+---- Part 9: ScienceLogic, LLC copyright notice (BSD) -----
+
+Copyright (c) 2009, ScienceLogic, LLC
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* Neither the name of ScienceLogic, LLC 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..684f240
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,195243 @@
+# -*- text -*-
+
+----------------------------------------------------------------------
+
+Changes: V5.7.2.rc3 -> V5.7.2
+
+commit 5054b570619df0a81958a045bef135b20205f036
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Oct 9 15:26:05 2012 -0700
+
+ make depend for 5.7.2
+
+commit 56a797ff3e71dc886467d17ce025b0237c8c1cc3
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Oct 9 14:42:23 2012 -0700
+
+ Version number update: 5.7.2
+
+commit 0813f8b62df0e8440ffef161ce134ff9455e7de9
+Author: Jan Safranek <jsafrane@redhat.com>
+Date: Tue Oct 9 06:33:58 2012 -0700
+
+ fix double-negative typo
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit a6a88927534684e275ccf0e780513094a73fc6bb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Oct 9 06:31:21 2012 -0700
+
+ AIX net-snmp5.7.1 hrSWRunPath not complete
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 58a4d8839021f772c35a732bd096d1e290dc0a62
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Oct 9 06:30:57 2012 -0700
+
+ AIX net-snmp5.7.1 hrSWRunPath not complete
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 626eabec4ea98e5359089790858479a59a26cdcb
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Sep 30 23:30:28 2012 +0200
+
+ CHANGES: snmplib: Move the check that the pdu variable is non-NULL to before the first dereference of it.
+
+commit 68aab572c2d2746b51a95eba110568c38b050808
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Sep 25 19:07:42 2012 -0700
+
+ Release Candidate for V5-7-patches
+
+commit 0a41533b1b49f00d7357a3d2bea5dfa75e8edcd7
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Sep 24 00:07:19 2012 +0200
+
+ CHANGES: testing: Add test cases for snmp_service
+
+commit a61b48d78e11d945def46fde0f7d55f7919c335a
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Sep 23 07:53:09 2012 +0200
+
+ Prefer copy_nword_const over copy_nword(NETSNMP_REMOVE_CONST
+
+commit 9bffc5413d0d882398b06f4109ac807af2f78347
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Sep 23 00:29:44 2012 +0200
+
+ Simplify logging through the use of netsnmp_config_error
+
+commit d09d53a0fa6df63b21e6f12731bee51a3624e85e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Sep 22 21:30:08 2012 +0200
+
+ CHANGES: snmplib: Do not crash on incomplete configuration tokens.
+
+commit 02dce6f43b99f85941627928c1a5022d6725d124
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Sep 22 21:28:51 2012 +0200
+
+ CHANGES: snmplib: Do not truncate single default transport domains
+
+commit 211e3c70625965441b2a029a6113802974673c43
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Sep 22 11:23:19 2012 +0200
+
+ CHANGES: snmplib: Do not crash from empty values in --token=value arguments
+
+commit af3d2d973b1e8e29d205d8a07acd82b1f854819e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Sep 22 10:30:16 2012 +0200
+
+ CHANGES: snmplib: Add the symbol NETSNMP_PRIo to help in printing oid values.
+
+----------------------------------------------------------------------
+
+Changes: V5.7.2.rc2 -> V5.7.2.rc3
+
+commit 8b45292301f0349ffb69d4fd8595f2d5b199e6b6
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Sep 25 19:35:39 2012 -0700
+
+ make depend for 5.7.2.rc3
+
+commit 0cbffb565e62aef937fc700d8d3c3b8c65ddfa65
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Sep 25 19:07:40 2012 -0700
+
+ Version number update: 5.7.2.rc3
+
+commit 40505971add6a3b6f5954cfbde532749bfbcb16a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Sep 17 13:34:37 2012 -0700
+
+ fix for hidden CMSG_xxx macros on AIX
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 60f0a9e983ab827c824e397d62aeff48a60f0133
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Sep 17 13:31:12 2012 -0700
+
+ Fix pstat memory leak on hpux 11i
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 13bd4d56baa9886018a00477e3214ebe02705ffe
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Sep 17 13:31:04 2012 -0700
+
+ Fix pstat memory leak on hpux 11i
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 0805420813de156c7fc5142534fb420a0fcc3572
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Sep 17 13:28:59 2012 -0700
+
+ fixes AT code on hpux 11i
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit bdb3b146380db1316cabd58b704436e7eecdd9f5
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Sep 17 13:28:50 2012 -0700
+
+ fixes AT code on hpux 11i
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit e936cf810a47379156d913a714e3816181a0d3db
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Sep 17 13:25:20 2012 -0700
+
+ fixes disAvail on FreeBSD ufs
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 608ab57887e5566e63509a3f7e5d0a3e2892f4a7
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Sep 17 13:25:02 2012 -0700
+
+ fixes disAvail on FreeBSD ufs
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+----------------------------------------------------------------------
+
+Changes: V5.7.2.rc1 -> V5.7.2.rc2
+
+commit 07f914564e097224d677515c2f5fd1f3c0c9eb42
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Sep 1 09:54:42 2012 -0700
+
+ Release Candidate for V5-7-patches
+
+commit aee217c07ea9f34a32268e966c7ecef036ec4a96
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Sep 1 09:54:38 2012 -0700
+
+ Version number update: 5.7.2.rc2
+
+commit 119b0d3cf12c97ca3c74d6d1e72319670a8378aa
+Author: Bill Fenner <fenner@users.sourceforge.net>
+Date: Sat Sep 1 09:51:08 2012 -0700
+
+ CHANGES: libnetsnmp: PATCH 3560473: from fenner: Handle TimeTicks when pretty-printing OID
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit c94c62ea0edcebbfbb73fab6ecddc679f7694dab
+Author: Bill Fenner <fenner@users.sourceforge.net>
+Date: Sat Sep 1 09:51:08 2012 -0700
+
+ CHANGES: libnetsnmp: PATCH 3560473: from fenner: Handle TimeTicks when pretty-printing OID
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 6d7f9eb0decdb9682836ffd03f19742197ad87db
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Aug 29 21:14:46 2012 +0200
+
+ Fix possible memory overrun in fsys_getfsstats.c (patch 3559417)
+
+commit f235ee8b32eed1de3f1e4202ef45b6377fbce163
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Aug 29 21:07:14 2012 +0200
+
+ Fix for hrStorageTable on AIX (bug 3557159)
+
+commit 78cc9d5ccd86b170622aac543c345c020755c78a
+Author: sthen <sthen23934@users.sourceforge.net>
+Date: Tue Aug 28 17:18:09 2012 -0700
+
+ add missing process status values under net/open-bsd
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 4ef9dcd80b0bda1e18b7e349a08bc0f22a7e755e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Aug 28 17:16:37 2012 -0700
+
+ CHANGES: OpenBSD: PATCH 3559414: from nba: support OpenBSD for hr_swinst
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 0b569fccea9414c50cfd6b0e83e1831ba1291ce2
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Aug 28 17:14:45 2012 -0700
+
+ add missing process status values under net/open-bsd
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 1d3c7be7fa7a38fd3fc39720bb5cb70f8bd71160
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Aug 28 17:14:22 2012 -0700
+
+ add missing process status values under net/open-bsd
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit ff438433aca096bbbea29dd30dfd5c5523761a72
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Aug 28 16:50:46 2012 -0700
+
+ Fix real memory reporting on BSD systems
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit c429a4f3984dae791e307df702251f96ef047d88
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Aug 28 16:49:10 2012 -0700
+
+ Fix real memory reporting on BSD systems
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 41d980c015564db7f22f763190f61ac0d56ba3b2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Aug 24 14:35:53 2012 +0000
+
+ Windows: Unbreak DLL build
+
+commit 2793923bfe2b026fcaeaf538ae503f105cb315bc
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 3 22:26:20 2011 +0000
+
+ added missing TLSTCP mention in the help output
+
+----------------------------------------------------------------------
+
+Changes: V5.7.2.pre3 -> V5.7.2.rc1
+
+commit 9ec5c599780251dcd3155f9ac9806ece7ed6ba22
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Aug 11 12:00:37 2012 -0700
+
+ make depend for 5.7.2.rc1
+
+commit 3358b65b11e2c0ee712f609f02071260f75f9bb3
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Aug 11 11:39:38 2012 -0700
+
+ Release Candidate for V5-7-patches
+
+commit 4849a430daafb91c7a61bfbbc17f9299e58fcf64
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Aug 11 11:39:35 2012 -0700
+
+ Version number update: 5.7.2.rc1
+
+commit 1bc268428e829852c9ef0a79552ca4045add28a3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Aug 9 22:42:52 2012 +0200
+
+ Make sure we have an initialized kvm structure when querying proc table on BSD.
+
+commit 7e67c5038b6aabfda1939ea81d940b24000cfb51
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Aug 9 14:27:08 2012 +0200
+
+ Removed error message when file cannot be opened.
+
+ This should be handled by caller, not in the function. There is only one caller now, udp_endpoint_linux.c.
+
+commit 59b0de0b8fa73eb403006cee75ff8651e1585e28
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Aug 9 14:23:14 2012 +0200
+
+ Fix compilation errors introduced by commit f95df6341b1d06249443e516b59a43cdfa3d4777.
+
+ This is embarassing, I compiled the sources without --enable-ipv6. Sorry for inconvenience.
+
+commit 5d7edadd4761680b66d1df3bfde7ca5b16ca5a16
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Aug 9 12:46:35 2012 +0200
+
+ Fix compilation error introduced by commit f95df6341b1d06249443e516b59a43cdfa3d4777.
+
+commit 43c97bbaaf211f4c7f7c704cfcb901dfbf834874
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Aug 9 12:30:09 2012 +0200
+
+ CHANGES: snmpd: Lowered severity of 'Error expanding XXX to 64bits' messages.
+
+commit 8e5cf2a72a46cd483d22e6290a6c8c4c26af6ad2
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Aug 9 12:25:48 2012 +0200
+
+ CHANGES: removed counter-64 error messages.
+
+ These messages do not say enything useful, caller should check their return value and report it.
+
+commit f95df6341b1d06249443e516b59a43cdfa3d4777
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Aug 9 12:01:25 2012 +0200
+
+ CHANGES: snmpd: removed error log messages when IPv6 is disabled.
+
+commit 18dace8e4a36b083d6ef717735c63e7f40224db8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Aug 9 10:41:45 2012 +0200
+
+ CHANGES: added CVFS (CentraVision File System) to hrStorageTable and hrFSTable.
+
+commit 90f431b45d21506427bc0bd1d4ee69e0b8ea30bc
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Aug 8 23:10:50 2012 +0200
+
+ Update to current MIB versions
+
+commit 9e7a0b9e580d3b1ea6198a7414c816c23b123b10
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Aug 8 22:27:16 2012 +0200
+
+ Use a wrking awk for Solaris
+
+commit 0e3922ae21e4b7ec538867afd22ce74d741e0f1c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Aug 8 22:17:34 2012 +0200
+
+ fix prototype for klookup
+
+commit a22109711a6d1ec14b6a3f1cac221d70263f104a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Aug 8 22:08:13 2012 +0200
+
+ fix prototypes for klookup
+
+commit ac062972c585174f95d7ba87aa5ec54c42fdec55
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Aug 8 22:00:26 2012 +0200
+
+ fix prototypes for klookup
+
+commit 7cdd8ebef9507fe766107ca9fee054c44cc0bac5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sun Aug 5 08:13:59 2012 +0000
+
+ Make snmp_alarm_reset() use the monotonic clock. Fixes a bug introduced in commit 37ba7e2.
+
+commit 023f61ea783bfcc53fe90aa66545c5aea2db8061
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Aug 8 16:26:54 2012 +0000
+
+ Fix build breakage caused by commit 028614ecf2d67398699dc3bd784029f3360f2e13
+
+commit cd820949a1491af103a8555f6bdae04851f3d285
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Aug 8 16:16:43 2012 +0000
+
+ Undo build breakage caused by commit 37ba7e20a521fbf0458a0c77eea2e5e36bd7ec0a
+
+commit f143008ccc57ea10cbb88ab3554822b17b6270aa
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sun Aug 5 08:45:42 2012 +0000
+
+ Make get_exec_output() work on big endian systems.
+
+ Undo API breakage introduced by commit 7374b84fe4c2ef8497fde3dae80a69aa89eba19c.
+
+----------------------------------------------------------------------
+
+Changes: V5.7.2.pre2 -> V5.7.2.pre3
+
+commit 84322e0dc2a8974646542d9881bc01b43dc3a12d
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Jul 31 16:24:07 2012 -0700
+
+ make depend for 5.7.2.pre3
+
+commit 8fec7a81d6133a5f05ed34a5af9806af5d128223
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Jul 31 15:57:56 2012 -0700
+
+ fix the assert check to allow for some known asserts
+
+commit dfde6d2ddd519c8c2ae1788774fdf90d8bea02b1
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jul 30 10:08:24 2012 -0700
+
+ include errno.h and don't use continue outside a loop
+
+commit 7cffe0222cd98a21e30f44c3df9f0d90bf096fe9
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Jul 31 14:13:50 2012 -0700
+
+ Version number update: 5.7.2.pre3
+
+commit 22af7fd46776a8db2362e88acb1b69b165c034b6
+Author: blentz <blentz@users.sourceforge.net>
+Date: Tue Jul 31 13:52:40 2012 -0700
+
+ CHANGES: aix: PATCH 3403433: from blentz: Issues with hrSWRunName and Parameters on AIX
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 516b9f8275b8db03cdc41078e65c2170309a3f8b
+Author: Julien Pinon <jpinon@users.sourceforge.net>
+Date: Tue Jul 31 13:25:31 2012 -0700
+
+ CHANGES: perl: PATCH 3412939: from jpinon: Repair tkmib
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 8f230f401c64d822883ac444624a2c2fd7128d8e
+Author: Harsha Shivanna <naanuhs@users.sourceforge.net>
+Date: Tue Jul 31 13:22:11 2012 -0700
+
+ CHANGES: libnetsnmp: PATCH 3552745: from naanuhs: fix to support 32 chars for VACM names as per RFC-2575
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 34008d32aef43d8bbe1000fb9bf94642c0514f6f
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Jul 31 13:20:31 2012 -0700
+
+ fix the agentx ping patch so it works with the newer alarm structure names
+
+commit 962676394d3fe557ead91057b4d780226dc0d6b3
+Author: Mijo Safradin <mijos@users.sourceforge.net>
+Date: Tue Jul 31 12:48:01 2012 -0700
+
+ CHANGES: agent: PATCH 3414051: from mijos: snmp-bridge-mib: fix for dot1dBaseTable
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 37ba7e20a521fbf0458a0c77eea2e5e36bd7ec0a
+Author: Vincent Bernat <vbernat@users.sourceforge.net>
+Date: Tue Jul 31 12:27:28 2012 -0700
+
+ CHANGES: agent: PATCH 3481686: from vbernat: Dont ping master agent unless there is no incoming traffic
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 2be5feadb0540846e0e3ada27efb97894a4cbd52
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Jul 31 07:29:17 2012 -0700
+
+ added a darwin 12 version
+
+commit 1f9bcd21e7c2d5effb62aa01b7b87e43dc86214c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jul 31 14:43:27 2012 +0200
+
+ Fixed SCTP-MIB::sctpAssocPrimProcess, the list of processes was not initialized.
+
+commit 48be5e89aa04adb0df7e094b2fe463015429fc98
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jul 31 13:48:31 2012 +0200
+
+ Added log message when ipTable misses some interfaces.
+
+commit 7523f0f01ba4db65ac1647a23228cf06c0b72a03
+Author: Mariusz Ceier <mceier@users.sourceforge.net>
+Date: Mon Jul 30 10:19:33 2012 -0700
+
+ CHANGES: libnetsnmp: PATCH 3536692: from mceier: create a unit test for read_config APIs
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit c07b8d9b3770b615c8e162dbdf7643805f372d75
+Author: Mariusz Ceier <mceier@users.sourceforge.net>
+Date: Mon Jul 30 10:18:42 2012 -0700
+
+ CHANGES: libnetsnmp: PATCH 3536692: from mceier: Fix for callback calling when unregistering config handler
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 5c2424f07d85c0c4f79d6c5faf64d7f3ee861726
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jul 30 10:08:42 2012 -0700
+
+ don't duplicate send_enterprise_trap_vars def
+
+commit 7374b84fe4c2ef8497fde3dae80a69aa89eba19c
+Author: Garrett Cooper <yaberauneya@users.sourceforge.net>
+Date: Mon Jul 30 09:41:17 2012 -0700
+
+ CHANGES: freebsd: PATCH 3383970: from yaberauneya: Fix compile error on FreeBSD 9.x/POSIXify auto_nlist, etc
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 670d96e786590fdd30a16a3300c0ed5bd6e53214
+Author: Mark Rusk <user_id=349895@users.sourceforge.net>
+Date: Sun Jul 29 23:39:22 2012 -0700
+
+ CHANGES: agent: PATCH 3424933: from user_id=349895: Use NETSNMP_DS_AGENT_AGENTX_TIMEOUT for the default timeout
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit f1eaec15ef603b8ce542932ffdbd8788c3d1acc5
+Author: Daniel Hobi <hobid@users.sourceforge.net>
+Date: Sun Jul 29 23:28:01 2012 -0700
+
+ CHANGES: agent: PATCH 3530794: from hobid: pass/pass_persist: unregister MIB with correct priority
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit d783ad990e914c0ee1c98d0a93a429eb2b2f4997
+Author: Doug Manley <tekkamanendless@users.sourceforge.net>
+Date: Sun Jul 29 23:25:40 2012 -0700
+
+ CHANGES: libnetsnmp: PATCH 3526599: from tekkamanendless: A buggy SNMPv3 agent can cause a net-snmp client to hang
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit e9851520c18d7ed172404a37dc0dc7a136bfaedd
+Author: Daniel Evers <daniel-evers@users.sourceforge.net>
+Date: Sun Jul 29 23:14:19 2012 -0700
+
+ CHANGES: libnetsnmp: PATCH 3548257: from daniel-evers: fix for recursive pthread mutexes
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit e7a37678c2b7359afd44a307e824c1f7d7a0c87d
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sun Jul 29 21:35:35 2012 -0700
+
+ NEWS: osx: patch: 3514049 from twobits-github: fix compilation on darwin11
+
+commit 1221426abad15b9b2fcee8f1e32ab52ef2692952
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jul 27 14:18:24 2012 +0100
+
+ CHANGES: perl: PATCHES: 3529541: Don't refer to internal 'my' variables from external scripts
+
+ Fix provided by Lezz Giles
+
+commit 9c06c2202dc056703c80959a0eca9a71684c28de
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jul 27 13:29:30 2012 +0100
+
+ CHANGES: Linux: PATCHES: 3536420: Ensure snd/rcv memory buffers are suitably aligned
+
+ Patch provided by Tyler Olmstead
+
+commit 89b82c55f9efd2e8ab8c6d65fa567c5b1fac1843
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jul 27 13:14:07 2012 +0100
+
+ "Idle" processes (i.e. in the process of being created) are probably
+ best regarded as "waiting for an event" to become runnable - i.e. 'notRunnable(3)'
+ That event being the completion of the creation process.
+ It's arguable whether or not they are strictly "loaded", but
+ this feels less misleading than reporting them as 'invalid(4)'
+
+commit 6e780a5bf0d64bf47dfbf479ae7f56c10ff8166e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jul 27 12:57:54 2012 +0100
+
+ Clarify meaning of hrSWRunStatus 'invalid(4)'
+ Ensure architecture-specific alternatives don't confuse code syntax
+
+commit 99b353f7253a5bb38b86f31c2708e16b34a46ce7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jul 27 12:50:51 2012 +0100
+
+ Additional patch from Patch ID #3543000
+
+commit d0e03fe4a236945daf42af7a47094e686f9bdb9e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jul 27 12:41:02 2012 +0100
+
+ CHANGES: snmpd: PATCHES: 3543000: Various fixes to Rmon code
+ Supplied by Patrick Ritter
+
+commit 6632a2b9b9fad1a0b0d6baedf2a2b391f5d4e914
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 14:39:42 2012 +0100
+
+ CHANGES: perl: BUG: 3517030: Ensure large tables are walked properly
+
+commit b8d16604dbb2f80ebe2852322aa83361a0323796
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 14:19:07 2012 +0100
+
+ CHANGES: apps: BUG: 3529768: Be more careful when stripping off numeric suffixes
+
+commit 0b3ad44ec4c1b9f41dc3ef70e6a38a53ef268ade
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 13:34:10 2012 +0100
+
+ Fix comments describing FreeBSD relationships
+
+commit 8cf7a89187a996faff040414986ffa5d78d5683e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 13:21:56 2012 +0100
+
+ CHANGES: build: BUG: 3532234: Fix typo in libtool script
+ (addressed properly in libtool 2.4.2)
+
+commit 4258d852ca7b6aeae93ad73064d43aa807eb6104
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 13:16:20 2012 +0100
+
+ CHANGES: doc: BUG: 3535269: Document use of [snmp] for client-side tools.
+
+commit 26ed40cbd07cf271a9cfc4517d964774712ad77c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 12:57:56 2012 +0100
+
+ Support local rollup of patches without first synchronising with extenal repo.
+
+commit 904c442d60c5b99aacd7f60307c28684efae854c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 12:53:37 2012 +0100
+
+ CHANGES: python: BUG: 3535967: Fix memory leak - snmp_{sess_}error allocates the output buffer
+
+commit 597ecda68ee2b580b666288977b04aa133207517
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 12:17:14 2012 +0100
+
+ CHANGES: BUG: 3540621: dist: Add missing Provides: to net-snmp-perlmods RPM spec
+
+commit 43d5ba224c3f29fd8e7fd1d060a17045aad7eff0
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 11:25:43 2012 +0100
+
+ CHANGES: perl: BUG: 3541012: Fix handling of gettable columns
+
+commit bc293acad8d3487cddef3c70cea74368f34d9354
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 26 11:20:20 2012 +0100
+
+ CHANGES: snmpd: BUG: 3543864: Remove extraneous function type
+ (and fix a related typo)
+
+commit 028614ecf2d67398699dc3bd784029f3360f2e13
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jul 24 15:37:16 2012 +0200
+
+ CHANGES: snmpd: fixed snmpd exiting shortly after start due to incoming signal.
+
+commit 4d38895f459a1df24f68c4a60e4caf6a778d8c1f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jun 27 09:35:44 2012 -0400
+
+ CHANGES: snmpd: removed limit of 'exec' and 'sh' entries in snmpd.conf
+
+ Use dynamic (re)allocation instead.
+
+commit dceeacc998fe2322882e7eedec0a71a79dc494ab
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Jul 24 09:00:23 2012 +0100
+
+ Don't be surprised if there are no changes to various files
+
+commit 56c3c078336cbf1bf09fd1b01078a9030717613e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Jul 11 08:47:13 2012 +0200
+
+ CHANGES: snmpd: BUG 3542307: Correct sysORID for snmpMPDStats. Thanks to Dave Vucich for reporting this.
+
+commit 61ecedc083f881db8a9a50d50bdeed36624ed307
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Jul 11 00:21:27 2012 +0200
+
+ CHANGES: snmpd: BUG 3542188: Correct sysORDescr for snmpUsmMIB. Thanks to Dave Vucich for reporting this.
+
+commit 2f9ede419f40e848a2425389288cac0e2331b992
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Jul 19 17:10:52 2012 +0100
+
+ Fix example 'rsync' command for full releases
+
+commit 6dd7884d99e756e2f22b688823ce1b1d526ad166
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Jul 18 15:59:59 2012 +0100
+
+ version update for 5.6.2
+
+commit 976696a128e57b512bf7ad400d002368b4a9a871
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Jul 18 14:34:31 2012 +0100
+
+ V5-6-patches out of Release Candidate
+
+commit 57c568d3d398172c5541fb31bb75d18fcce2e26f
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Jul 18 14:34:15 2012 +0100
+
+ Version number update: 5.6.2
+
+commit 73d906bc7c98506fa2b4d6d290f7b3beba2e4a0d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Jul 18 11:12:58 2012 +0100
+
+ version update for 5.5.2
+
+commit 42b5afb3cd6d06adb426f1dbaa98358f2b2e8a53
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Jul 18 10:46:47 2012 +0100
+
+ V5-5-patches out of Release Candidate
+
+commit 8bd440c43e365a0b77d47f582cade9f97c7bfce7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Jul 18 10:46:28 2012 +0100
+
+ Version number update: 5.5.2
+
+commit 6e0855a3157198499411ac52b46d5f32aad5b9fa
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Jul 18 09:51:32 2012 +0100
+
+ Add missing return type in function declaration
+
+commit 07d825e8bb35eea9ac6b1cb82cbb234fe66b1ab6
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Jul 18 09:51:32 2012 +0100
+
+ Add missing return type in function declaration
+
+commit 5db70036ef675635647e5b7c7253456838836647
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Jul 11 14:55:38 2012 -0700
+
+ don't use --rebase
+
+commit d4c1549593ce2c2caeb98e5f8abfd7a5ae5a0273
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jun 27 09:35:44 2012 -0400
+
+ CHANGES: snmpd: removed limit of 'exec' and 'sh' entries in snmpd.conf
+
+ Use dynamic (re)allocation instead.
+
+----------------------------------------------------------------------
+
+Changes: V5.7.2.pre1 -> V5.7.2.pre2
+
+commit ffce49fb1ab4a78d4f2947be06d620f1424528fd
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Jul 11 17:12:31 2012 -0700
+
+ Version number update: 5.7.2.pre2
+
+commit bd7c7297187818e5eef7327667e4a81f6c9fc89b
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Jul 11 14:55:38 2012 -0700
+
+ don't use --rebase
+
+commit a715312e2ce49d4da93fc140cc39fc100b0b7978
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Jul 11 15:47:22 2012 -0700
+
+ updated for the previous 5.7.2.pre1 release
+
+commit 17277689b629f4586d5d714d87ce6bc11f887668
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Jul 11 14:55:38 2012 -0700
+
+ don't use --rebase
+
+commit 6786ffc76facf746afb6af25158f7940656ab39c
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Jul 11 08:47:13 2012 +0200
+
+ CHANGES: snmpd: BUG 3542307: Correct sysORID for snmpMPDStats. Thanks to Dave Vucich for reporting this.
+
+commit f0e35d61f9258dc608da9bf718af1457a859fa19
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Jul 11 00:21:27 2012 +0200
+
+ CHANGES: snmpd: BUG 3542188: Correct sysORDescr for snmpUsmMIB. Thanks to Dave Vucich for reporting this.
+
+commit 5206d25d4cb94d4b0dd331a5a4113d4d87782c42
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jul 2 12:14:39 2012 -0700
+
+ better description of --disable-set-support
+
+commit f92853281477ee724a51a9967f37d3f1dd1b0f7e
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jul 2 12:09:50 2012 -0700
+
+ remove duplicate definitions causing a problem
+
+commit 5be27368751691fc1ab55fe62b4106d8d99b8704
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jul 2 12:06:58 2012 -0700
+
+ after pulling all the branches, switch back to the initial one
+
+commit 82596a69f5ce53d5a6f0af4215c98d6184dab4d4
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 14:04:50 2012 +0100
+
+ Unpick merge conflict.
+ (Not sure why this wasn't flagged up earlier - or maybe I just missed it!)
+ (cherry picked from commit b05bd78f9f234bb57a00b54c5bfb1de32a09f4a4)
+
+commit 6a075ae494c76b82eea96327cf5242df048743db
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 14:21:08 2012 +0100
+
+ version update for 5.6.2.rc3
+
+commit a37e7e02945147bfe6cadb9571706c6b2ec743bf
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 14:17:42 2012 +0100
+
+ version update for 5.6.2.rc3
+
+commit b05bd78f9f234bb57a00b54c5bfb1de32a09f4a4
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 14:04:50 2012 +0100
+
+ Unpick merge conflict.
+ (Not sure why this wasn't flagged up earlier - or maybe I just missed it!)
+
+commit 4d15742c750a96a4dbb3da874741ae152489f8d5
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 13:58:07 2012 +0100
+
+ Release Candidate for V5-6-patches
+
+commit f6b5e3376ed3a8e9eaf74b7d6822b3a765772ee8
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 13:57:56 2012 +0100
+
+ Version number update: 5.6.2.rc3
+
+commit 5cfb0811127a653dff0f4e53ad6029e2298a6c62
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 13:28:37 2012 +0100
+
+ Release Candidate for V5-5-patches
+
+commit e72e205fdcef787ef840c8c928ed27351a69544b
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 13:58:07 2012 +0100
+
+ Release Candidate for V5-6-patches
+
+commit f79a54f2472508b167d977f367c3864b5621e89d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 13:42:53 2012 +0100
+
+ version update for 5.5.2.rc3
+
+commit 56ef5f0db51cfd55226f82f94f3f3d2450e4feb5
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 13:39:32 2012 +0100
+
+ version update for 5.5.2.rc3
+
+commit af1d00ab0246275dadb5f0cd3a23a77d5f5598cd
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 13:28:37 2012 +0100
+
+ Release Candidate for V5-5-patches
+
+commit f18776d63a516020317e58875ab24352d5db8651
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 13:28:26 2012 +0100
+
+ Version number update: 5.5.2.rc3
+
+commit fe107794e7400d239e8af3da8b4a3fbef06b5da9
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 13:28:37 2012 +0100
+
+ Release Candidate for V5-5-patches
+
+commit 0f84fbcf71995bddafab500d87c9c5a6f461a734
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 12:29:34 2012 +0100
+
+ CHANGES: snmpd: PATCHES: 3479740: Fix hrSWRunPerf statistics
+
+commit 1e3bb6060be6156d3ff316c5a7e4fd7f05e37cff
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Jun 22 12:11:56 2012 +0100
+
+ NEWS: snmpd: BUG: 3532090: Fix high ifIndex values crashing hrDeviceDescr
+
+commit e8663fac8b88663282669726a08f16db16b5f4db
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Jun 18 13:30:25 2012 +0200
+
+ Revert "CHNAGES: snmpd: fixed snmpd exiting shortly after start due to incoming signal."
+
+ This reverts commit b11a4e93f50d8a544f835f376c3a4b8c0641a31a,
+ we're in RC-phase and code is frozen
+
+ (sorry for noise)
+
+commit b11a4e93f50d8a544f835f376c3a4b8c0641a31a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Jun 11 16:26:09 2012 +0200
+
+ CHNAGES: snmpd: fixed snmpd exiting shortly after start due to incoming signal.
+
+commit a570238d58eb5a996b56f01a27a18df6f37d0f60
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Jun 11 14:20:25 2012 +0200
+
+ More precisely describe -c option.
+
+commit 48cc39f1aa0fa6ce955ef76b25db8f9dca06b80d
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 09:27:10 2012 -0700
+
+ version update for 5.7.2.pre1
+
+commit 810185ae0b0cd2ad4d424a1ba775ef5ceaf50f03
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 09:24:19 2012 -0700
+
+ make depend for 5.7.2.pre1
+
+commit 6271471e01282f3675724eaf1358ceb0e95ddd4e
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 08:32:40 2012 -0700
+
+ Version number update: 5.7.2.pre1
+
+commit fcb782aa8893134c7414a926d9268594f725b915
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 08:32:18 2012 -0700
+
+ version update for 5.7.2.pre1
+
+commit e3bcd87c72fcea7706e868b5ace75296093f7497
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 14:09:42 2012 +0100
+
+ Fix dist/release format
+
+commit d813ce2eeefc68229cfcaf20603244cdd6d09d3c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 14:07:52 2012 +0100
+
+ Fix dist/release format
+
+commit fa7bd581e3783685db39c9b4eaf847be5ac86fd3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:53:10 2012 +0100
+
+ version update for 5.6.2.rc2
+
+commit 0739e2382d31146aca3205244cf70788b40a428d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:51:45 2012 +0100
+
+ version update for 5.6.2.rc2
+
+commit d9a15445aa74f5316bfc711c1558467872c2958c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:50:12 2012 +0100
+
+ make depend for 5.6.2.rc2
+
+commit bcabd2c9542dbebd1d319b4494413bdcca06614e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:38:38 2012 +0100
+
+ Release Candidate for V5-6-patches
+
+commit b473898c0c5ac9eb47c7c05a3f745e4ff2a76aaa
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:38:28 2012 +0100
+
+ Version number update: 5.6.2.rc2
+
+commit 131429e7062fbaa65b82affed1fb92df2c0cc813
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:38:38 2012 +0100
+
+ Release Candidate for V5-6-patches
+
+commit 1c8110b33b8105ca6190945a35fe7ae903252d68
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:21:38 2012 +0100
+
+ Avoid perl versioning problems when setting up the build environment
+
+commit 508ece16e6f6f49562da204792ae0644269994d1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:20:58 2012 +0100
+
+ Fix handling of dist/release merge
+
+commit 5b8a8547b1a47d2f5b207f48f2496e4241d902c6
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 11:10:48 2012 +0100
+
+ version update for 5.5.2.rc2
+
+commit 6c32914bf28d695df349dca269e488b501700316
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 11:07:22 2012 +0100
+
+ version update for 5.5.2.rc2
+
+commit 9f5a82a5afdbb3daeb2fd437a309f0b8d357cf4b
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 11:05:39 2012 +0100
+
+ make depend for 5.5.2.rc2
+
+commit 39203f29477a3bedf012d41135d8abd6bcad08b1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:54:27 2012 +0100
+
+ documentation update for 5.5.2.rc2
+
+commit 17e79ef0fad79609c5ba2feb4e8b9eb5d7db6886
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:46:11 2012 +0100
+
+ Release Candidate for V5-5-patches
+
+commit 5821be5bbb4018ded282fbbbd4830cf2eeadd9e1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:45:59 2012 +0100
+
+ Version number update: 5.5.2.rc2
+
+commit 3f2111de6733a04e12d910d306a34d671e008762
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:46:11 2012 +0100
+
+ Release Candidate for V5-5-patches
+
+commit ccf8ff2c4db60122d41302e4aeb700e0b868105f
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 28 10:18:43 2012 +0100
+
+ CHANGES: snmplib: PATCHES: 3526599: Don't hang on retried failing SNMPv3 responses
+
+commit c81c8483990911f47435d3005255d91c37ab92b2
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun May 27 14:09:26 2012 +0200
+
+ Fix BSD that downnot always like IP_SENDSRCADDR - so retry without
+
+commit ffce1f2dc2f8b31abd01f93b26da78f4726a1e64
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun May 27 14:03:58 2012 +0200
+
+ Fix OS missing MSG_DONTWAIT (AIX). Backport from 5.7
+
+commit c575216850185b56454dad0253e3164979e13513
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun May 27 13:56:01 2012 +0200
+
+ Fix missing include. Fixes SIGSEGV on FreeBSD9 x64
+
+commit 5805878749c08062debf0a9d798d08fb916caa2d
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun May 27 06:23:19 2012 +0200
+
+ CHANGES: snmpd: Add missing debug tag
+
+commit d1a42bbcc7b14730c9a6d99c4f047097843a549b
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri May 25 09:02:27 2012 +0200
+
+ CHANGES: building: Run libtool --mode=finish on the right directory
+
+commit 1fbf33711a19eac9739ad23f6f6251eacc41f1c4
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue May 22 14:54:45 2012 +0100
+
+ CHANGES: Linux: PATCH: 3525998: Don't use an uninitialised value in error message
+
+commit 32c1686b67dc85c4a189576363065609dfed5e61
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue May 22 14:52:56 2012 +0100
+
+ Attempt to mark release-candidate branches as such.
+ Omit final-release-only steps when preparing preN/rcN releases
+ (Relies on a tweak to the Makerelease perl modules)
+
+commit 4c5633f1603e4bd03ed05c37d782ec8911759c47
+Author: Robert Story <rstory@freesnmp.com>
+Date: Mon May 14 11:40:06 2012 -0400
+
+ NEWS: snmp: BUG: 3526549: CVE-2012-2141 Array index error leading to crash
+
+commit 65dd83c2255ee58edbf0e25863e55b58a4113679
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 20:30:42 2012 +0100
+
+ version update for 5.6.2.rc1
+
+commit ac4bc65e2909f3bd85f32f04b504fa65d2f64553
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 20:28:06 2012 +0100
+
+ make depend for 5.6.2.rc1
+
+commit b74994864195119edb6e19c85147fac00bcb93e3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 20:13:46 2012 +0100
+
+ Version number update: 5.6.2.rc1
+
+commit 91350092c46e66d06d74143f4816473db4d25160
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 19:56:33 2012 +0100
+
+ Mark version-specific changes _before_ pushing to central repository
+
+commit 7241accd70b82d0fcd44d5a5238b2ee9445900db
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:53:17 2012 +0100
+
+ version update for 5.5.2.rc1
+
+commit 7c796a15a1d1bb85feea940bd4e3516877920919
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:50:49 2012 +0100
+
+ version update for 5.5.2.rc1
+
+commit 07e268bfb64b0ec645b3f7e87266984f9217cf12
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:44:37 2012 +0100
+
+ make depend for 5.5.2.rc1
+
+commit 16eaaf6c3ba14596ca9efaf4b114f1b709f42b68
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:29:03 2012 +0100
+
+ documentation update for 5.5.2.rc1
+
+commit c729469ef12154930cf9d15967e16186fb445f30
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:27:20 2012 +0100
+
+ Version number update: 5.5.2.rc1
+
+commit 142571d3cea08f0c072d24c1d39a43c7446f8ce7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:01:03 2012 +0100
+
+ When building a new release, the installed version of the perl
+ modules may well be different to the version being built.
+ That should not break the build.
+
+commit eba86b6f7aff261ee0e61334df70de7156e5c3cb
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:01:03 2012 +0100
+
+ When building a new release, the installed version of the perl
+ modules may well be different to the version being built.
+ That should not break the build.
+
+commit 5c0f64d6db2b593f7cc0ed2d4f55b7c592b774a8
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:25:15 2012 +0200
+
+ Only output cpu warnings once.
+
+commit ee58e4827b9fa16e6635ca003e8a4f11dcb5fb7a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:17:42 2012 +0200
+
+ Fix speling in errormessage.
+
+commit 03f485df22f20e149cfae94c57cb82feecb5d74b
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:12:11 2012 +0200
+
+ Not all Linuxes use rpm (debian/ubuntu comes to mind)
+
+commit 930838224f781696bd35225f22569347416f1b16
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:10:15 2012 +0200
+
+ Check need for -lm to use round/exp
+
+commit a0609cf1f3a6917d263725732248cd937a45ad94
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Apr 7 08:40:44 2012 +0200
+
+ Remove limitation on configuration line length.
+
+commit 305973338a63ae54c5e02a8626fbe9a8064dcb7e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Apr 7 00:32:19 2012 +0200
+
+ Reduce variable scopes.
+
+commit ccab4e9d3ed424c39d0dc27be63fa76c7461ea81
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Apr 7 00:15:22 2012 +0200
+
+ Internalize the name and line number of the curret configuration file
+
+commit cf874ad7b9daf4fcc0d46cdd034474b478005341
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Apr 6 21:47:28 2012 +0200
+
+ Replace #if (A) B #else B #endif with B.
+
+commit ef9ea641bc290eec50685b60519b31bee8b14a69
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 9 21:04:06 2012 +0100
+
+ version update for 5.6.2.pre2
+
+commit 35aba1959de119f1fb89203c37109aa6f0e21c57
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 9 21:00:40 2012 +0100
+
+ version update for 5.6.2.pre2
+
+commit e41fbaff18ac9095cf4a739a06ec39a1a6ccfdc1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 9 20:35:35 2012 +0100
+
+ Version number update: 5.6.2.pre2
+
+commit 137fe582d6cc5611430dab46ef144efd84cfc803
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Apr 6 20:46:56 2012 +0100
+
+ Revert commit 1f4a829b18275e4956ca91e5ec370df015f06133
+ (snmp_store_needed() API is not available in 5.[45].x)
+
+commit 2b7e64288c01a8a062026c521ca31a5e885f30cc
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 16:12:12 2012 +0100
+
+ FreeBSD-9: Fix for 'const'ifyed nlist arguments
+ Backport of ed65eca6e7f9cfa7380a78d56c01ed314745b169 from V5-6-patches
+
+commit 7e95d80b698051259645c074a53ffd264a6fa916
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 16:06:56 2012 +0100
+
+ FreeBSD-9: Fix for 'const'ifyed nlist arguments
+ Backport of ed65eca6e7f9cfa7380a78d56c01ed314745b169 from V5-6-patches
+
+commit 1a9b7b7c02e2deefe994d595a7cc1dd2ffbeee1d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 15:51:20 2012 +0100
+
+ Fix compilation on FreeBSD 9.x with 'recent' header shuffling
+ Backport of c53d8c3525f590f2213d35b0da94123862f3e366 from V5-5-patches
+ (Patch #3363308 - omitting tweaks to configure)
+
+commit 3d9ddb41e263bc1a78f9f9440b8d4ad4f86c82e1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 10:36:18 2012 +0100
+
+ Fix typo
+ Backport of 5b702b024b60176d7f5699b92e55da50a8deae71 from V5-6-patches
+
+commit 0d35c609564b66a1ffe81556d37adf0503c389ce
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 10:15:08 2012 +0100
+
+ Provide missing definition of NETSNMP_PRIo
+ (used in agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c)
+
+commit a79141a419953d010a6989e8b88f4df127394d38
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 09:19:26 2012 +0100
+
+ Header fiddling for FreeBSD,OpenBSD,Dragonfly
+ Backport of f7b0de1518002c6e8f9b94ef3deb8882e1e9338e from V5-7-patches
+
+commit adf74bf753d3970357afd633803256241d9c7b87
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 08:20:46 2012 +0100
+
+ Fix IPv6 TCP & UDP tables, *BSD support (including OpenBSD)
+ Backport of commits 5cd1573625471c0583e9087aec6802b77157d5a2
+ and 50d73f0d56fe22c590530b3e305d41dcdac3ce00 from V5-6-patches
+
+commit d9555acb9f47c3aa8fde4bc20a44d7ca6181a8a9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sun Mar 25 18:48:12 2012 +0000
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Avoid dangling pointers (based on patch 3503259)
+
+commit 82a8b47ee96e5d29a2b7ac3ca00722d737d5b479
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Mar 29 22:31:56 2012 +0200
+
+ Running autoheader / autoconf
+
+commit 9ca8d939ab393306a1d0f146c9cb70ea0cb19d49
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Mar 29 22:30:38 2012 +0200
+
+ Running autoheader / autoconf
+
+commit cecd4869deb68f3d4c71e768d5b40dd576446925
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Mar 29 22:29:31 2012 +0200
+
+ Running autoheader / autoconf
+
+commit a1a4513bd3e4e614200f6db5a02f61d6c8eefb32
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 28 09:47:45 2012 +0100
+
+ Doxygen-style documentation fixes (backport of git commit c09903a42e9d97331fd9e48ee831a85afdf9c70a)
+
+commit 9bdbcca122c37da304fc6aa6939729475f90f5fd
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 28 09:30:49 2012 +0100
+
+ Doxygen-style documentation fixes (back-port of GIT commit c09903a42e9d97331fd9e48ee831a85afdf9c70a)
+
+commit 1f4a829b18275e4956ca91e5ec370df015f06133
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 27 21:41:24 2012 +0100
+
+ CHANGES: snmpd: PATCHES: 3495697: Store persistent snmpTarget table changes
+
+commit 1f75f377d0db01754c0c161dc44373081beef520
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 27 21:14:06 2012 +0100
+
+ CHANGES: FreeBSD: PATCHES: 3489387: Install FreeBSD 10 header file (plus other missing versions)
+
+commit 3d72c9e78f2ad817c9d1d82977327bbb20d63ab9
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 27 21:06:31 2012 +0100
+
+ CHANGES: snmpd: PATCH: 3487867: Don't skip missing ifXTable entries (ifConnectorPresent FALSE)
+
+commit 12906578ab30cf776d080c0ef3025b30334d7655
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 16:17:45 2012 +0200
+
+ DISMAN-PING-MIB: Fix even more memory leaks
+
+commit ccfd5ca6fe10313d6181d24bbb1797825a97da10
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 15:51:16 2012 +0200
+
+ DISMAN-PING-MIB: Eliminate duplicate code
+
+commit 9fda2668722f08ddbfdd67a2239d8b021db64a83
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 15:48:46 2012 +0200
+
+ DISMAN-PING-MIB: Write a loop as a loop
+
+commit cbc18eb763ba6df69ef70668a54d75bf35e79503
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 15:24:08 2012 +0200
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix more memory leaks
+
+commit c7725192478aec018fb4aefa60946e04a406c00c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 13:43:24 2012 +0200
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Avoid reading freed memory when deleting a row from a table
+
+commit a6be739566f310d7441fd7f54989e39446f7a143
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 13:42:28 2012 +0200
+
+ Extend DISMAN-PING-MIB test
+
+commit 8a9b57291453cb8aec28e766c594701ed19c4fc6
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 26 21:03:41 2012 +0200
+
+ Fix for DragonFly 3
+
+commit e5c9a32f79eac2e85527c9cf05087cdae9b35a6c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 26 20:59:53 2012 +0200
+
+ DragonFly needs _KERNEL_STRUCTURES to compile ipv6 code
+
+commit cd43bc09a39bd97ff5e719a2ce232ce424600a65
+Author: David Imhoff <dimhoff@users.sourceforge.net>
+Date: Sat Mar 24 15:47:17 2012 +0100
+
+ CHANGES: snmplib: PATCH 3510454: Allow the use of 0.0.0.0/0 as alias for default
+
+commit e2fc15f9e5a6e3e36be5f489601cbf6bf731917f
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 24 15:21:38 2012 +0100
+
+ Fix TCP state values for DragonFly
+
+commit 432fe3ddf54f2c98f936959469cb9b014d599f06
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 24 15:10:52 2012 +0100
+
+ Require perl to do pass_persist test
+
+commit 37d2770cf50c98023eeba90e25d372bff7316ada
+Author: Niels Baggesen <nba@user.sourceforge.net>
+Date: Sat Mar 24 15:06:40 2012 +0100
+
+ Fix TCP state values for DragonFly
+
+commit 86a948d8691e881d55591dcabddc2739ce72b30e
+Author: Niels Baggesen <nba@nba-linux.sb.statsbiblioteket.dk>
+Date: Sat Mar 24 15:01:37 2012 +0100
+
+ Properly find pass helpers for testing.
+
+commit fe26a3c4f29f046bf65ed52e9d94054b675fbc4b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Mar 22 09:04:42 2012 +0100
+
+ DISMAN-PING-MIB: Limit source code lines to 80 columns
+
+commit 745bafcdcc9c8e84616d4e274db2a384bf234da2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Mar 22 08:55:05 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Make ping implementation independent of ntpd clock jumps
+
+commit da6925e6763cadbe02f4a8bbfe68a362e535ad5e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 10:38:36 2012 +0100
+
+ CHANGES: testing: Add testing/fulltests/default/T154dismanpingmib_simple
+
+commit fa606dd7ca6aff9308d4e8b01bbcde148f441271
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 16:49:21 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Make pinging local interface addresses work
+
+commit 617a83ba799575c84c66f6b1c480ef633161a64c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 16:28:46 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix a socket leak triggered by pinging a remote host
+
+commit 625f55c272ec6281e38d8e30eb53fd51516b00ae
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Mar 22 09:54:55 2012 +0100
+
+ DISMAN-PING-MIB: Convert a dynamically allocated variable into a stack variable
+
+commit b48f19ad4b4aa68c3e16e2a72df37b9c0cd36c4a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 16:24:07 2012 +0100
+
+ DISMAN-PING-MIB: Add more debugging statements
+
+commit d74cb3966175892562f5e3a9b1683acba2c22e07
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 11:45:18 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix several memory leaks
+
+commit 0b1a77674678cc9a15be3e7700d3cef650ed02c7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 12:00:30 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Do not send the contents of the stack over the network
+
+commit 139023cd3ab51631cc10e2866d71abcf99ae4c1b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Mar 21 08:56:07 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Don't call exit() upon memory allocation failure
+
+commit 169b6aaa7b61827cc1ad0b3aeeae3a7229dd25d8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Mar 21 08:53:26 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix IPv6 socket leak in error paths
+
+commit a0be32ad053a71fa96134d55e542bb07d4f0297d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 11:43:46 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Avoid that host name resolution failure causes a crash
+
+commit bf9bff64556787d766ee2ef2d578afb920719f3a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Mar 21 08:51:55 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Convert printf() statements into snmp_log() and DEBUGMSG()-statements.
+
+commit 5d74c01245523a9d8db1eda27d1efae2ebc104fb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:40:02 2012 +0100
+
+ New MIB: VRRPV3-MIB
+
+commit 5b38f062b99b6ef36708e2c7de4965a3192612e9
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:34:48 2012 +0100
+
+ For safety, sizeof the right variable in memcpy
+
+commit e5f82782da05efa7c0e6dc2bf5a41ee11868f469
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:33:21 2012 +0100
+
+ Fix for hrSWRun data for FreeBSD
+
+commit 8327565e823270d10a4504568edbe5b5ae323a55
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:31:54 2012 +0100
+
+ Clean up variables for OpenBSD/NetBSD
+
+commit 170f6f027bf4f9174b7073530da4d07f400bba58
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:28:58 2012 +0100
+
+ Move declarations in front of statements
+
+commit dbb4573b69fae85cdc931b2892b5ce4e5b16b321
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:23:36 2012 +0100
+
+ Require kernel_netbsd for NetBSD6
+
+commit f11681f15aad7d9a52fa29812ecbb507f1b7fe24
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 21 12:36:38 2012 +0000
+
+ Check for old tarballs (and unpacked distributions) before starting.
+ These can confuse steps such as "make dependcheck", that do a 'find'
+ on the current tree, and would descend into such unpacked source trees.
+
+commit 470dcd4b6c3ff11ff0a3532a7340a56cffd69098
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 21 12:32:13 2012 +0000
+
+ Don't run "make docs; make mancp" if there's no Makefile present
+
+commit c9ac420343e16df2b7065f5bf2790df44e247fba
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 20 10:26:10 2012 +0000
+
+ Allow distribution as part of normal Net-SNMP packages.
+
+commit 5999f60c57723f23f3c254af57fdb10af301a8eb
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Mar 18 19:03:08 2012 +0100
+
+ Regenerate
+
+commit 275d204036a607e3df50e8447d4bc755e9db02fd
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Aug 28 21:29:03 2011 +0200
+
+ CHANGES: building: Make it possible to use --disable-applications/--disable-agent together with --enable-minimalist
+
+commit bdccc875710295aacf50f71eb1c1d2ee97f336fe
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Mar 16 20:10:58 2012 +0100
+
+ Do not declare the local variables for opaque_special_types unless that option is set.
+
+commit b80a67da052adca1b5a644db83a782e15c2237c3
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Mar 16 19:50:03 2012 +0100
+
+ Check that the data exist before trying to read it
+
+commit efae86bba5962491d42b77b935191a3eb25dd939
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Mar 14 01:05:33 2012 +0100
+
+ Partially revert "Merge remote branch 'origin/V5-7-patches' into V5-7-patches"
+
+ Commit d35a1860217e723e4f866dd98ef6621665934c4a accidentally reverted
+
+ 4a2e5bcd56cd2afb36eb15d754e2fee888dd50c0 (hrh_storage is a proper replacement for hr_storage)
+ 0dd1e54557d1ba498b55d017b0a93e8ccf9bd522 (CHANGES: snmpd: UDP-MIB: Report the proper address in udpLocalAddress)
+ 5116d48378ecf03e722f3010ad47bf22a3fbcb8c (Reduce scope of prefix_val such that the compiler doesn't warn about an unsed variable)
+ 10f566f4d4cbb3e205023c23669289e4bfd089cb (perl/SNMP/SNMP.xs: Fix a compiler warning)
+
+ and part of
+
+ 6e74d64f85a59d50e461db4c34ac76f9de468bfb (Avoid using grep options -q and -w because grep in Solaris)
+
+ This reverts those reverts.
+
+commit aaedd59cc2da701527dc2d261d4e9f85f16e7504
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Mar 11 20:57:38 2012 +0100
+
+ Allow make test where the source path contains the string Net-SNMP to succeed.
+
+commit 4b94d796918a4eeae68ab21aa53d444a8b5c2921
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Mar 9 08:04:59 2012 +0100
+
+ Unbreak compilation on FreeBSD 4
+
+commit 10fe6b83324ad37d18b937cc8c6de94de534d035
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 8 13:04:07 2012 +0000
+
+ version update for 5.6.2.pre1
+
+commit e1122edc1a5fe7976b065044134d39e7db5985ea
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 8 12:43:19 2012 +0000
+
+ version update for 5.6.2.pre1
+
+commit a613d3a834912206d1ba5971e441a3ea6b36af23
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 8 12:33:03 2012 +0000
+
+ make depend for 5.6.2.pre1
+
+commit 0ef34e6519dfcb82c97df8427547c08dcf81e69a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Mar 8 10:11:30 2012 +0100
+
+ CHANGES: snmpd: Fixed snmpd '-d' option.
+
+ Now it dumps packets again.
+
+commit 8e69742f143e4fc11196e5b2ed66c8f7f53fd02f
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 6 09:24:21 2012 +0000
+
+ Version number update: 5.6.2.pre1
+
+commit c4e00b8c3e1010cdcab5e6c02d60d75df9c6dcf2
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 6 09:24:05 2012 +0000
+
+ version update for 5.6.2.pre1
+
+commit 39490104a3ab58235aace2f9d871c266dc4485ee
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit 4a2e5bcd56cd2afb36eb15d754e2fee888dd50c0
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 5 20:59:38 2012 +0100
+
+ hrh_storage is a proper replacement for hr_storage
+
+commit ce85832932ccd916c42319114c40885a466a9d0e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 5 20:56:40 2012 +0100
+
+ More fixes for Solaris sh
+
+commit 0dd1e54557d1ba498b55d017b0a93e8ccf9bd522
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 15:08:26 2012 +0100
+
+ CHANGES: snmpd: UDP-MIB: Report the proper address in udpLocalAddress instead of 0.0.0.0. Makes test T160snmpnetstat pass again. Fixes a bug introduced in commit c76fb96f65e33ba2fd212a921e8c386155ee5c7a.
+
+commit 518917e9f39f7a9d3c3bf3a865e8ac0e3026d600
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 14:04:54 2012 +0100
+
+ snmplib/snmpUDPDomain.c: Fix source code indentation
+
+commit 2651909ccceabfcfadaf942c02450e28fe837dc9
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Tue Nov 9 12:04:04 2010 +0000
+
+ Passes now on MinGW too.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19653 06827809-a52a-0410-b366-d66718629ded
+
+commit e41f115e40304c941ba17d67e24710722d90741b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 13:39:17 2012 +0100
+
+ testing/fulltests/support/simple_eval_tools.sh: Avoid using grep options -w and -q because grep in Solaris' default path doesn't understand these.
+
+commit 5116d48378ecf03e722f3010ad47bf22a3fbcb8c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 10:47:20 2012 +0100
+
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c: Reduce scope of prefix_val such that the compiler doesn't warn about an unsed variable if it isn't needed.
+
+commit 6e74d64f85a59d50e461db4c34ac76f9de468bfb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 09:22:31 2012 +0100
+
+ testing/eval_tools.sh: Avoid using grep options -q and -w because grep in Solaris' default path doesn't understand these options.
+
+commit 10f566f4d4cbb3e205023c23669289e4bfd089cb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 10:47:39 2012 +0100
+
+ perl/SNMP/SNMP.xs: Fix a compiler warning
+
+commit 44aa265891cd563f7f4114ef25dcf7aaf3b14e9a
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit dae4e16be86117861f63d1a2f981ad361418f5c6
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit 28f6226f2e228b8ca248489735f86502b2cce0a1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit 40022a697958259ccfbb3fed44eb3c472f5e837e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun Mar 4 10:37:41 2012 +0100
+
+ Solaris sh does not understand "test -e"
+
+commit 773af0c42e077bebdaecf1c0caf393285a7688f1
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 3 17:19:30 2012 +0100
+
+ Clean up nsrollup complications
+
+commit ee71049c3e21c1d0e3424297136652bbe0e39d85
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 3 16:49:41 2012 +0100
+
+ mibgroup/icmp.c: adjust ifdefs to make it compile on BSD's
+
+commit ce9600361e665dde17af9d8ab16d7ce85dc05643
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:39:55 2012 +0100
+
+ dot3StatsTable has bugs :-(
+
+commit dffacf6fa0755e1700cbac25b844185abd807a0a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:38:10 2012 +0100
+
+ passpersist test needs /usr/bin/perl
+
+commit 8726995c7a8aef674c4f164b1871c37bbdcdad50
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:36:58 2012 +0100
+
+ grep -w fails with OpenBSD and Solaris 10-64
+
+commit 1eb4745b23cc3a839864e7f6ea28355b0566eb67
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:35:49 2012 +0100
+
+ Solaris needs /usr/xpg4/bin/grep to understand -q
+
+commit 9954b4b741fd8c63d6128bd0527298c8e4e989fc
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:34:45 2012 +0100
+
+ Make sure we have the proper srcdir for out-of-source builds
+
+commit 78369002be2711f0aa876b64a4e10b090cc241cd
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:33:31 2012 +0100
+
+ Not all make versions define $(RM)
+
+commit 94245b29a3cda89475c6eab5d9493c6657ff38e3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:24:24 2012 +0100
+
+ Make autoconf 2.68 happy
+
+commit 44acd6c285fb5614b4c9611b1abdeca9dd28e4bb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:12:47 2012 +0100
+
+ Fix spelling of mib module fsys_getfsstats
+
+commit 1fa1fee3693f67b820223806b3d73afd4c50ec18
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Mar 2 01:37:20 2012 +0100
+
+ Silence a clang warning.
+
+commit 93263b98a5db344cf2c4d489c43971e7b29cdb03
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 13:37:20 2012 +0000
+
+ version update for 5.5.2.pre1
+
+commit 5a175428b973d2ea8553e29fecf94cf1566aa858
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 11:48:18 2012 +0000
+
+ version update for 5.5.2.pre1
+
+commit 364276a1c5aa66caa23eb5b7f111fdeb5af71fa7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 11:45:10 2012 +0000
+
+ make depend for 5.5.2.pre1
+
+commit 73598340172eff75729a6d57192b8171d5bbf00e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 10:42:56 2012 +0000
+
+ Version number update: 5.5.2.pre1
+
+commit f3214402672ca199fd531e66122bf96c4d9a4eb7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 10:42:39 2012 +0000
+
+ version update for 5.5.2.pre1
+
+commit 2e74acb6f19e4729cede0ab43e931961cb23aaea
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Mar 1 09:18:39 2012 +0100
+
+ CHANGES: Bug 3152841: Do not install the util_funcs subheaders that were removed in 5.7
+
+commit b7109646b95a70713d1ad991d41bccd57c0bb3eb
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Mar 1 08:48:48 2012 +0100
+
+ CHANGES: Bug 3152841: Install util_funcs subheaders introduced in 5.6
+
+commit 432cbb7a5501ab90d66d0a83e731e7343bc04b37
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Feb 25 10:13:15 2012 +0100
+
+ Correct typos
+
+commit 6a6c9bbc7584f196a1185cc1935204f1206811ed
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Feb 29 08:55:35 2012 +0100
+
+ CHANGES: Bug 3152841: Install util_funcs subheaders
+
+commit d515e2a6e4c2a1c4d84734cc7b2d0b2fc5a894ad
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 15:56:21 2012 +0000
+
+ CHANGES: snmpd: PATCHES: 3487919: Fix compilation when caching is disabled
+
+commit af8368ed8898a78d0868b47af46bc9db07d1c764
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 15:50:56 2012 +0000
+
+ CHANGES: snmplib: PATCHES: 3414773: Encode integer value using ASN_INTEGER
+
+commit 19e2715807fe06fd0baedf88165011aee933e755
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 14:05:34 2012 +0000
+
+ CHANGES: man: BUGS: 3490708: Clarify use of common command-line options
+
+commit 65f7962f932c9b75c5bbbb047d1e26ae60978e53
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 12:23:34 2012 +0000
+
+ CHANGES: snmpd: BUGS: 3489631: Fix incorrect handling of UCD monitoring flag
+
+commit ac166051b6a092dd4a594326ec85e2f699b62547
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 11:57:41 2012 +0000
+
+ CHANGES: testing: BUGS: 3474590: Don't match underscores within the source root filename
+
+commit 879bf7079d34fa46f6fcf54a01c8500beaece59a
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 10:44:41 2012 +0000
+
+ CHANGES: snmpd: BUGS: 3460364: Fix use of block factor when detecting error conditions
+
+commit 034f1c572f683ea428583074471e5d5d13b51837
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 10:22:20 2012 +0000
+
+ Skip SET-based tests when configured using --enable-read-only
+
+commit 36423e210bfb65ef121c6a66aec438c7c237d3df
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 10:03:25 2012 +0000
+
+ CHANGES: BUG: 3454168: configure: Fix building with --enable-read-only
+
+commit eed0bcbc43fea18259f0f63b2081b6d10535a052
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 09:27:11 2012 +0000
+
+ Skip SET-based baby-steps when compiled with --disable-set-support.
+ Inspired by bug #3454168
+
+commit ec6a23030e5a2072c19c18c1d9c124387da56b7b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 27 18:42:58 2012 +0000
+
+ Add -lrt to NETSNMPLIBS such that clock_gettime() can be found
+
+commit f13320500294bb240f63c6dd7d2e9a2208eb740d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Feb 27 16:52:51 2012 +0000
+
+ Skip SET-based tests when compiled using --disable-set-support
+
+commit c4276b6232c29145c039884e6b5a6b6da4b93837
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Feb 27 15:54:45 2012 +0000
+
+ Omit SET-related code when compiling with --disable-set-support (inspired by patch #3424930)
+
+commit 01c930edcc25700d6b5fb0376f55a26425e13fb0
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Feb 27 15:17:22 2012 +0000
+
+ Omit SET-related code when compiling with --disable-set-support
+ (inspired by patch #3424930)
+
+commit 9484d83203c4e2d820416be665fa833aa70444d2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Feb 24 14:00:32 2012 +0100
+
+ Rework commit b4a19505a05816e94e01de97bf99ac37fcdc6d23.
+
+commit 2b7f13495228635d816e58b2174dc124dd0cf39f
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Fri Feb 24 07:43:22 2012 -0800
+
+ set MERGE_AUTOEDIT before merging to avoid the future git 1.7.10 forced msg
+
+commit e1b910b0be9343586ae9edba6f46040af315fcdd
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 10:27:54 2012 +0100
+
+ CHANGES: snmpd: init_agent() + init_kmem(): Return an error value instead of invoking exit() if access to kernel virtual memory is denied
+
+commit 463eed2120f9d191bc22673496a49e8174664e4b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 10:03:31 2012 +0100
+
+ Remove obsolete symbol NETSNMP_EXIT_ON_BAD_KLREAD
+
+commit c36ab71a4e096f16cc5a55533f080c9a94009914
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 08:53:56 2012 +0100
+
+ CHANGES: FreeBSD: snmpd + apps: Sending UDP packets works again for non-root users
+
+commit edebddba930f8b1472fa0bd20fc413ef8cf464a2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Feb 21 11:31:46 2012 +0100
+
+ testing/RUNTESTS: Fix a bashism
+
+commit b4a19505a05816e94e01de97bf99ac37fcdc6d23
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 20 16:58:47 2012 +0100
+
+ Fix compiler warnings about %ld versus time_t on systems where time_t is a synonym for long long instead of long.
+
+commit d8978ecc8211be7c1e7905f1e215bb06ded266b6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Feb 21 12:32:25 2012 +0100
+
+ Fix snmplib/transports/snmpSocketBaseDomain.c file header
+
+commit aa766d196e5287f6ca79b58a345b024260aba354
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 20 17:07:13 2012 +0100
+
+ IF-MIB: do not trigger undefined behavior (>> 32 of a 32-bit variable) when updating a counter and ifi_ipackets is a 32-bit variable
+
+commit c3fb6dd9e6b99e9542493188987871fc5017cb3c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 09:45:45 2012 +0100
+
+ Fix a compiler warning on systems where mode_t is unsigned
+
+commit f8a3ef0d3d4e530279900101049b8de98a44a6fb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:48:52 2012 +0100
+
+ CHANGES: snmplib + snmpd + snmpwalk: Avoid that system clock changes (e.g. by ntpd) affect code that needs relative time
+ CHANGES: snmpd: Make sure that the range of the SNMPv3 variable snmpEngineTime is 0..2147483647 on all supported systems instead of 0..42949672 on some systems (i.e. wraparound after 497 days)
+ CHANGES: snmplib: Add netsnmp_get_monotonic_clock(), netsnmp_set_monotonic_marker(), netsnmp_ready_monotonic(), netsnmp_get_agent_runtime()
+ CHANGES: snmplib: Deprecate atime_diff(), atime_newMarker(), atime_ready(), atime_setMarker(), marker_tticks(), netsnmp_marker_uptime(), netsnmp_timeval_uptime(), timeval_tticks(), uatime_diff(), uatime_hdiff() and uatime_ready().
+ CHANGES: snmplib: Change the names of the struct timeval members of data structures that were used to store a wall clock time but that do now contain a monotonic clock value
+
+commit c19760f3333c92fac5d50e9768cdf939218bc487
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Feb 15 09:45:03 2012 +0100
+
+ snmplib/snmpv3.c: Fix source code indentation
+
+commit a6db239945e195de5a90fa183700b27a6ecb28d3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Feb 7 00:11:14 2012 +0100
+
+ Fix possible memory leak from recent declarations patch
+
+commit 0fbbb9a9e2906a7af956957061d485874462aea9
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Feb 6 20:43:04 2012 +0100
+
+ Do not mix declarations and statements
+
+commit f308d5bafb05d78ed4030c4ecff324b6cbda680f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 15:25:30 2012 +0100
+
+ Fix two compiler warnings in agent/mibgroup/disman/ping/pingCtlTable.c
+
+commit 46f0fc1b7fc26a225763bc65cca520a1c59f0251
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Feb 6 20:54:32 2012 +0100
+
+ sendmsg does not like IP_SENDSRCADDR if addr is INADDR_ANY
+
+commit debac498fe8410110107a2fe64f8afb748edaa07
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Feb 6 16:48:09 2012 +0100
+
+ CHANGES: added OCFS2 (Oracle Cluster FS) to hrStorageTable and hrFSTable
+
+commit fafc99cd89e73ec7e00bf7360d0b4fa61944a4f4
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 11:18:34 2012 +0100
+
+ Simplify calculate_time_diff() and calculate_sectime_diff()
+
+commit 7af2013de8bf1b379c076db4e104508e17874d3e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:55:58 2012 +0100
+
+ Fix order of feature #ifndef and Doxygen comment block
+
+commit bbd67f63530f5ef0bfc948fc58dfe6a93f8f8679
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 15:25:30 2012 +0100
+
+ Fix two compiler warnings in agent/mibgroup/disman/ping/pingCtlTable.c
+
+commit 42a66aeff25b9e9ef635a404ad2f5212f9e8cf0d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:47:54 2012 +0100
+
+ Rename two function arguments
+
+commit 3fe72b3b99b7e4b2b982363dfc4f2d8d13f40592
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 13:49:22 2012 +0100
+
+ Convert snmp_select_info() documentation to Doxygen format
+
+commit e9db266ae48d05a7a6cb5d71b4bdea7ad808ef5e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 11:17:57 2012 +0100
+
+ CHANGES: snmpd: Add netsnmp_get_next_alarm_time()
+
+commit d08044cb9e5702fbf549e14425f42794259d8a21
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 09:38:07 2012 +0100
+
+ CHANGES: snmpd: Add netsnmp_get_agent_runtime()
+
+commit a05c27c2711cb41582a3b4c31e38b0e93530b62d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:51:33 2012 +0100
+
+ Fix spelling in a source code comment
+
+commit 910d7b0d99183609b9529b04c3f29330eb661021
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:38:12 2012 +0100
+
+ Replace netsnmp_timeval_uptime() by netsnmp_get_agent_uptime()
+
+commit 43a83f6c6a96cc2316b70eecacf127eb6913c7a7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 11:19:15 2012 +0100
+
+ Use the assignment operator instead of memcpy() for copying struct timeval
+
+commit 2fe579efb1cb3a74f82803ca323928f6b8e4b5c0
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Feb 3 14:04:02 2012 +0100
+
+ Make agent/mibgroup/mibII/icmp.c build again on non-Linux systems.
+
+ See also commit 345a1e4254812cb9edc1d274491b76681a9dba1e.
+
+commit 881de6ab7355277a5c116a008fbe513293b05039
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Feb 3 10:08:21 2012 +0100
+
+ Fix compiler warnings triggered by the Rmon MIB implementation
+
+commit 4629933c0d3b3f9f4ba583534f79a37fb9633817
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 20:05:31 2012 +0000
+
+ More compiler warning fixes
+
+commit e9b5a3dee6f9afab8b90a29392040632b075ad7a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 16:56:55 2012 +0100
+
+ Use SNMP_MIN() instead of min()
+
+commit ae452c77b411139d6b5800ffcf88d48e9b4792a8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 15:23:38 2012 +0100
+
+ Restore commit dbb8795a7df595f0603f2ec61704799f4c482667.
+
+commit c7d11fa00f9995ddb9fe3d4994a3e9790da2e189
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 15:18:40 2012 +0100
+
+ Restore commit dbb8795a7df595f0603f2ec61704799f4c482667 partially.
+
+commit 00fd62720ec454f5a690de4feba08223cfb2c3f8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 14:48:44 2012 +0100
+
+ CHANGES: snmptrapd: Avoid crash during shutdown due to invoking perl_destruct(NULL)
+
+commit d9e229d81abeaf191ef2ccb077842885c230d622
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 14:47:41 2012 +0100
+
+ Remove a superfluous declaration
+
+commit 1e2e2af6cae830f381e87a244d029eb86bf3fcce
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 13:20:37 2012 +0100
+
+ perl/SNMP/examples/pingmib.pl: Add error checking
+
+commit 241a141e31f1684fc6cf70cc4a00cce636fd3526
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 11:28:37 2012 +0100
+
+ Make configure-time EVP_MD_CTX_create() detection work on the 5.4 branch.
+
+ See also commit 46eac02e9a27bf4f3068e795cab891f05a848870.
+
+commit 6d9d14feaaa2d0fec68b4d158944d32cb04ff1bc
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 11:12:00 2012 +0100
+
+ Revert the changes that break the build on the 5.4 branch from commit dbb8795a7df595f0603f2ec61704799f4c482667.
+
+commit 8abe49e30c97c8983e83b45a35c716fe91f66bea
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Feb 1 11:56:58 2012 +0100
+
+ Fix several compiler warnings in the DISMAN MIB implementations.
+
+commit f9fb0a533375e14dc370025a0b2fbc761bf27be6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 09:56:02 2012 +0100
+
+ Revert "HOST-RESOURCES_MIB: fix a compiler warning" because it's wrong.
+
+ This reverts commit aa6b79bc124a7b7a885d7e5035ab06aa3ecef613.
+
+commit ca4a4fe25efd2714f8f1961b97856616563f42c9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 10:21:49 2012 +0100
+
+ .gitignore: Add python/build
+
+commit 13ada56558b44e28d1355c0dce1d921f3746d548
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:53:49 2012 +0100
+
+ Revert "Revert "Fix format specifiers to avoid warnings"" - there *is* NETSNMP_PRIo in V5-6+ branches
+
+ This reverts commit aa528bd22c7493ca8d67e678fbf615ca0f63ea6d.
+
+commit aa528bd22c7493ca8d67e678fbf615ca0f63ea6d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:13:18 2012 +0100
+
+ Revert "Fix format specifiers to avoid warnings" - there is no NETSNMP_PRIo in V5-4 or V5-5 branches
+
+ This reverts commit 390c0114c8ec0bdb27b08b6f74e3f6ef3a62981b.
+
+commit 2fb99be9aa86a6ca349b86d4ef8bc726ed9f2a82
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:58:35 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit e5c35589e0bf416bfd036bd468f42aaeab25e788
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:55:56 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 345a1e4254812cb9edc1d274491b76681a9dba1e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:51:26 2012 +0100
+
+ Fixed error handling in init_icmp().
+
+commit c303549a59fa8c2f20a9d8bf1e985fbc8abde6a8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:46:29 2012 +0100
+
+ Reworked _register_extend() error handling.
+
+commit 9c20e27a7026fc030da3b328b9a2e1b4f36670cd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:21:28 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 22fd0bfc2df0e1f6020dc3c50a753ddf28a4599c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:20:22 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 5d61e57baf580c78252c0abb0098c07bb05af17c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:17:05 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 3c3eeae80d796f27597c901e7ff2046c769ef4b8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:08:09 2012 +0100
+
+ Mark rowreq_ctx as freed so next iteration allocates new one instead of reusing the freed one.
+
+commit af9abd53c2337c90a691a7b044ff3f97c1003161
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:05:10 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit cf9465f54181e62e21a9b10219131107a3d2ebf6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:04:06 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 7871f2b09b8b52f34a9e57784266459053165bcb
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:02:50 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 7a37f33d310c9598607bc323d9bdbf91aaf72c95
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:00:51 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 3e45f7026249e45350edaac85337423aa0e95d8b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:13:18 2012 +0100
+
+ Revert "Fix format specifiers to avoid warnings" - there is no NETSNMP_PRIo in V5-4 or V5-5 branches
+
+ This reverts commit 390c0114c8ec0bdb27b08b6f74e3f6ef3a62981b.
+
+commit 61936762e641c18db75aa5125a33e776c677adc5
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 11:13:39 2012 +0100
+
+ Fixed freeing reginfo twice on error in a template and all its instances.
+
+commit 496437430415fbafeb1ccd4774f1ca00d627ea1f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 11:04:13 2012 +0100
+
+ python/netsnmp/client_intf.c: Fix compiler warnings introduced on V5.6 branch
+
+commit 5b4a24cdcee1bc3d82633ccafeb96fce95349c59
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 09:22:27 2012 +0100
+
+ unit tests: fix a 64-bit compiler warning
+
+commit cbf1c91baf7191be5fa27d81bcf8714331a2c12f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 09:20:42 2012 +0100
+
+ Use snmpTargetParamTable_dispose() to free a struct targetParamTable_struct.
+
+ Fixes a bug introduced in commit dbf26a05a04ef24c47346e5adda48e338498e71f.
+
+commit aa6b79bc124a7b7a885d7e5035ab06aa3ecef613
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 09:20:31 2012 +0100
+
+ HOST-RESOURCES_MIB: fix a compiler warning
+
+commit 3a76b43e11fffada632fccb848ab500e876ad48b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 18 16:21:05 2012 +0100
+
+ CHANGES: python: Avoid that an SNMP set with UseEnums enabled causes a segmentation fault
+
+commit 84dec9fa92b0aa2d58eb7020330f4f98e5154321
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 18 14:38:21 2012 +0100
+
+ python/netsnmp/client_intf.c: Fix most compiler warnings
+
+commit 38cf218c3f1a727786e227a5d3fb186fd0f1a15f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:50:13 2012 +0100
+
+ Fix a typo
+
+commit 454122244122bfdb6f67cab31256d7b46372e9e1
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:30:18 2012 +0100
+
+ Free tmStateRef on errors.
+
+commit 0119022daa59c73bfec0da2386d0628f14e6dab7
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:09:12 2012 +0100
+
+ Free fingerprint when it's not needed.
+
+commit 0e84cd303a08267dec78f6d81c9bb07e3d83a11f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:48:26 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 63dc846a7949ce697b3e28c543dc1105e63a2250
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:08:28 2012 +0100
+
+ Free certificate fingerprint.
+
+commit ce1f284a63eb81644b3e32606cbe39b67e1dff2a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:37:09 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 7e21413ca6f2efd7a3afb62c62b644881b8bd1e7
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:46:30 2012 +0100
+
+ Properly allocate and free engineID.
+
+commit 34c962882607c3638a2fa25a2ac531492d71c787
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:37:25 2012 +0100
+
+ Free locally allocated tmStateRef.
+
+commit f57ae531dc5658abcd65b1627615525238d16d2d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:20:24 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 536bc57556c3141561ea4a194810b16290a691ee
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:15:47 2012 +0100
+
+ Added check if the function actually does something.
+
+commit a0777d307dbcaf219ee0184a0fbab9d4e5d6aa0b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:01:45 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 8b97a71c8e7959428eb4d4e8d90e9096d43ff09f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 12:57:26 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 2c1507c22030549ae660c0e211fbdc5c75ec5c57
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 12:53:47 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 65f2b7bcd4fe03906aa1a115ab60a89b8ae933d5
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 12:51:36 2012 +0100
+
+ Close open files on error.
+
+commit 0e52e4f66d44766bea37473556c78e5219b95461
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:45:33 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit dbf26a05a04ef24c47346e5adda48e338498e71f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:42:17 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 748da84b1fd654e338bc701e8f9e5da229187f1c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:32:04 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit eb217146fd54036ea4202bfef78bbf774d7e382d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:23:10 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 9ba38eec66138ec1f613ea8d04e158130c7121bc
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:18:55 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit d9d938d3018c27f53277bc5e59578500490c1d09
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:16:38 2012 +0100
+
+ Close open file on error.
+
+commit d5e817d5bd518d9ac6a0d60e0e141dd64f27ad19
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:14:12 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 2ae68f059df9d74b074d12f59c1847466ed576cd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:03:17 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit a00f3d461121b545aed72ac12b2438791dcfc4ba
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 14:58:39 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 59884bb4d35ad13747ffa6723436dca587a9ab77
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 17:09:12 2012 +0100
+
+ In above code, olength is checked, so let's check it also here.
+
+commit ba5d5292b04393b0c7d7d7ed961241929418c6e4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 17:05:14 2012 +0100
+
+ Fixed dereferencing NULL.
+
+commit da2d6a7028a13b9edf3a5c84314d0f1feef76714
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:44:56 2012 +0100
+
+ Prevent dereferencing NULL.
+
+commit f88054a9b69b6de274f7a14a59b47323e5e4e4c6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:37:35 2012 +0100
+
+ Don't dereference context if it's NULL.
+
+commit 7c4d459e8f1f652cc2098c3d4c81de90a84ed710
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:30:09 2012 +0100
+
+ Don't deference NULL.
+
+commit fc19b7f33b587927d2a01e72d23d21b9b1696ab3
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:25:26 2012 +0100
+
+ Don't close NULL file.
+
+commit 5e95ca6790076b788072a801ee7c82969d995bcb
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:17:09 2012 +0100
+
+ Prevent dereferencing NULL when a transport does not have f_fmtaddr.
+
+commit eed6f5f9b9ae54d2ceab67ad85adde1f6a8a21d5
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:13:13 2012 +0100
+
+ Prevent dereferencing NULL.
+
+commit 41cde68b5fa4b38d81450cf91e082cdfa825e7cf
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:10:10 2012 +0100
+
+ Check if a registration was really found.
+
+commit 5b72a40853876a186efcc0090a4e32c235b9c05f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:03:58 2012 +0100
+
+ Don't dereference NULL when difflen is SMUX_MAX_PRIORITY (which is highly unlikely, but...)
+
+commit fa6a912e41c5d0fd2a636894e86b6426c07375ab
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 15:37:44 2012 +0100
+
+ Check for missing value in setEvent.
+
+commit 410b71da425389fecc25d14f49f23753581576ad
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 15:28:41 2012 +0100
+
+ Dereference ereg only if it is not NULL.
+
+commit 185272d1a0b913774186f1b9135aeaf637ebed52
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 15:17:21 2012 +0100
+
+ As per above code, template_v2pdu can be NULL, so check it before dereferencing.
+
+commit 48e5ead3fd2c2b385df6972c67526ff6bdc30768
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 14:42:22 2012 +0100
+
+ Updated last fix to new error reporting style.
+
+commit f33d33615d6d85d0073726473c4146cbcdf11ced
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 14:30:07 2012 +0100
+
+ Fixed sigsegv when empty config line is parsed.
+
+commit b5df1eeb47ed3559b6f4d9ecccdb242126e6c992
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 14:11:58 2012 +0100
+
+ Fixed (highly theoretical) sigsegv when sp->securityEngineID is NULL.
+
+commit 6feed629a71899c113096959d8549dc1201e8f9a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 13:43:37 2012 +0100
+
+ Added NULL and len check just in case someone provides value = NULL and nozero len (-> NULL is then dereferenced).
+
+commit 355c5ab264af2a6020a1d8a923f80f11b942295e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 13:36:41 2012 +0100
+
+ Extend the NULL check, i.e. return if there is nothing to remove.
+
+commit ddd7948acad938cd42974505ddca4f0372116709
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 11:11:29 2012 -0800
+
+ update sparta's copyright
+
+commit 41256086a7a5041453419cfd6e562c7b55c56b0a
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 10:32:04 2012 -0800
+
+ pulled full copy of extractnews from master
+
+commit 625a70dbdfd9902da79efa293fe6d2ac8ccf2b2e
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 10:24:19 2012 -0800
+
+ update to change to the newer log generating/parsing
+
+commit 62e32b13089b29edcf276f615da67e4508fe7bb5
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 09:29:42 2012 -0800
+
+ conflicting merge from master for extractnews
+
+commit 70084da61d2bcbd2cf1ed81bdc3bf6794c2affb6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 13 11:49:16 2012 +0100
+
+ CHANGES: snmpd: DISMAN-SCHEDULER-MIB: Handle 32-character schedContextName values correctly.
+
+ See also commit b3c4982542e0ab151fb3884754cdfbcb472da52d.
+
+commit 04bf3e288158ee880edf237e4007fee37d2044dd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:39:37 2012 +0100
+
+ Fixed endless loop when SSL_read returns error.
+
+commit c1526fccc0474c1db18caa9dbb833853cddde3cc
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:13:21 2012 +0100
+
+ Fixed a typo.
+
+commit a27aa19df283156c032c81eaee5e115859d38c17
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:11:32 2012 +0100
+
+ Don't replace 'rc' variable, it's value is needed outside the loop.
+
+commit 985dff2b0876d9483c414fccea3ef6bc63e14561
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:01:32 2012 +0100
+
+ Removed duplicate code.
+
+commit 2fd7818318e7a5dfe98f52ccf750c2a63e825ded
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:00:22 2012 +0100
+
+ Removed duplicate code.
+
+commit 15f21130ba33dc9afd164e52dfd74c9cec0e9232
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:58:14 2012 +0100
+
+ Removed duplicate code.
+
+commit 2a8a8f2ab7cd75826c5d41ec3cfd5ce3e9634cf3
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:39:28 2012 +0100
+
+ remove dead code, 'cp' is always != NULL here.
+
+commit 38fd6378cc3275180f63b8d9b9a4072b3dabf8e4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:25:06 2012 +0100
+
+ Fixed a typo.
+
+commit ebd92e19b10c0a38e17cde407864b45c26e17327
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:07:43 2012 +0100
+
+ Removed unnecessary if (value) check - value is checked few lines before.
+
+commit c5cacf5caf979d018ea6cae1c03b8fdf0b118dfd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 13:44:43 2012 +0100
+
+ Prevent double free(), 'dirname' is already freed inside se_add_pair_to_list() if it fails.
+
+commit acdceb50ea66d6b323c74ee021fb77e810e4e7af
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 13:43:19 2012 +0100
+
+ Prevent memory leak when malloc fails.
+
+commit 17053e34cfe9a8ab395fb50f5c3f1dafc7247aeb
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 13:32:57 2012 +0100
+
+ Fixed double fclose().
+ Linux man page for fclose(3) says: In either case any further access (including another call to fclose()) to the stream results in undefined behavior.
+
+commit a6641edb9cb74fc2236b42ce5554fc3329956552
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 15:22:34 2012 +0100
+
+ MinGW: Skip test T065 if not started from inside an MSYS shell
+
+commit a883ef1982f301b1485d227301674927330f5b67
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 11 15:14:53 2012 +0100
+
+ Moved debug oputput before return.
+
+commit 45751967287d97640efdcdf8e77e8d490939d8eb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 14:17:18 2012 +0100
+
+ Convert strtoull() unit test into a Net-SNMP unit test
+
+commit 2c2fa48336a4f1f177c2991d6515d29f39533c44
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 13:50:44 2012 +0100
+
+ Convert read_config_read_octet_string_const() unit test into a Net-SNMP unit test
+
+commit 07c666f6cea27f2b2ab9bc08aed0cb6133fe3758
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 11 13:17:45 2012 +0100
+
+ Fixed commit 73a523e468277f6df2e984891313b8be8bce1921:
+ Fidex dereferencing key->info when key is known to be NULL.
+
+commit 3b686566296dd87bc42b7f1169daacdb3c45cc58
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Mon Oct 18 06:25:56 2010 +0000
+
+ Win32: builds again without warnings with MSVC 6.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19489 06827809-a52a-0410-b366-d66718629ded
+
+commit f3a7d1b09609dad649f58bbdb5b7e10d39b398c1
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sun Oct 17 11:04:06 2010 +0000
+
+ Follow-up for r19476: fixed a typo.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19478 06827809-a52a-0410-b366-d66718629ded
+
+commit 2de73bd365a381b9c353ca5230769eefb1ac71ed
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 11:42:42 2012 +0100
+
+ local/passtest: Remove an incorrect PATH= statement
+
+commit 699513f1238e0adce1f1cec98e0d147293fc5047
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sun Oct 17 09:25:51 2010 +0000
+
+ NETSNMP_REMOVE_CONST()-related cleanup.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19476 06827809-a52a-0410-b366-d66718629ded
+
+commit 6358dee72fb347e2600a0a7bd21f23270d3a00f6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 10:58:15 2012 +0100
+
+ agent/mibgroup/ucd-snmp/versioninfo.c: Add a comment
+
+commit 5396bfe032c8cbc73c8ff5d4b085ebada9f59846
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 10:30:16 2012 +0100
+
+ Replace strncpy()/strncat() by strlcpy()/strlcat()
+
+commit feb3af28dcae22015ae865a2e5dd8c416e9991d8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 10:02:08 2012 +0100
+
+ Replace strncpy()/strncat() by strlcpy()/strlcat()
+
+commit b7e1aa255bae4a3453f9eca644a876634351f11d
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sat Mar 20 19:36:28 2010 +0000
+
+ CHANGES: libsnmp: changed the type of the fourth argument of netsnmp_set_row_column() from const char* to const void* such that no cast is necessary when passing another datatype then char* or const char*.
+ CHANGES: Win32: changed in_addr_t from u_int to u_long such that it matches the datatype of sockaddr_in::sin_addr.
+ Also, fixed several compiler warnings (mostly char * <> u_char * mismatches) and removed some casts.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@18345 06827809-a52a-0410-b366-d66718629ded
+
+ Conflicts:
+ agent/agent_registry.c
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
+ agent/mibgroup/mibII/interfaces.c
+ agent/mibgroup/ucd-snmp/disk.c
+ apps/snmptrapd.c
+ snmplib/snmpIPv6BaseDomain.c
+ snmplib/snmpUDPIPv6Domain.c
+ snmplib/system.c
+
+commit f47a3752849db075e6f2053b8595b7b792fb6462
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Fri Oct 15 10:56:09 2010 +0000
+
+ CHANGES: Win32: building: Builds now correctly with a 64-bit compiler.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19458 06827809-a52a-0410-b366-d66718629ded
+
+commit 02b6056df95da8b673034e39c2c7c386ed0f369c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 11:44:53 2012 +0100
+
+ Fix a compiler warning about casting away const
+
+commit a19865832fc77f4c048144d91a431b1e94d329f2
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Wed Oct 14 23:12:05 2009 +0000
+
+ CHANGES: apps, snmplib: PATCH: 2835577: identified by "Bart Van Assche": Replace SNMP_ZERO of arrays with a memset.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@17797 06827809-a52a-0410-b366-d66718629ded
+
+commit 67a3e2eccb95f9c9d0809efcbddcd866ee3062d5
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Wed Jan 6 14:27:15 2010 +0000
+
+ Fixed a compiler warning about discarding the const qualifier.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@17970 06827809-a52a-0410-b366-d66718629ded
+
+commit 3dcde2e8a595a527f06142c3b852de8433a1cf28
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Sun Jan 24 14:27:55 2010 +0000
+
+ CHANGES: snmplib: Prevent gcc ped-warning for NETSNMP_REMOVE_CONST
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@18052 06827809-a52a-0410-b366-d66718629ded
+
+commit c2e1525a85bda5299a3b9f241614f7e6509aeeba
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Wed Jan 6 13:35:11 2010 +0000
+
+ Backport commit 295f473c83546221b2a71d815c61e33a67f98ae3: refine NETSNMP_REMOVE_CONST() implementation.
+
+commit cb423b0ae9ed0059aa100dc4e2fd93ad1b97faf8
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Wed Jan 6 11:57:51 2010 +0000
+
+ Backport commit e2fb09e0093e2f648fe2638da2f3af18fdb32bf0 - introduce NETSNMP_REMOVE_CONST().
+
+ Conflicts:
+ agent/snmp_perl.c
+ snmplib/snmp_service.c
+
+commit afc396ab1618a8595a2519fbc25f7a498e174411
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 08:49:34 2012 +0100
+
+ Unbreak netsnmp_mktemp() and make_temp().
+
+ These were broken by commit bb8fcbb874998000f945f058d1aa6fe14e925899.
+ Also replace a strncpy() call by a call to strlcpy() and replace the
+ make_tempfile() implementation by a call to netsnmp_mktemp().
+
+commit 210185c15d0d65f0ea98b5e3c2e0776f6222d170
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 08:27:43 2012 +0100
+
+ Fix a crash during startup of snmpd introduced by commit 885061687d9caa38470979667d7d8ad6563cedad.
+
+ Also, make sure there is only a single copy of the cleanup code in function
+ mkdirhier().
+
+commit 8bb4e86abcf98ff28748af0af89c98e64d5cd961
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Jan 11 07:47:12 2012 +0100
+
+ Reduce the scope of the oldmask variable.
+
+commit 6680147b138ec114f81c5d128ac9350c8450d081
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 18:44:31 2012 +0000
+
+ Make test T015int64_clib pass on 64-bit systems
+
+commit 3aad15ae560ac857e73c90764e903e7ca02b3295
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:40:59 2012 +0100
+
+ Fixed buffer overflow for large OID names
+
+commit fba188ee82010b2f2d8ca2e426ba654499ab3d0a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:31:33 2012 +0100
+
+ fixed buffer overflow in __concat_oid_str
+
+commit 21d25d86b8e4904d798dc8c96dade9e5048457a8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:26:07 2012 +0100
+
+ Fixed buffer overflow when parsing port numbers.
+
+commit d36931841b2fc2cebc6364b2949129a0ad42ad1d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:05:51 2012 +0100
+
+ Fixed a buffer overflow when large SumFile is used.
+
+commit 0efdd022da09af1b5e16171fa7a2b523c5d6ec59
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:01:53 2012 +0100
+
+ Fixed buffer overflow when too big temp file pattern is used.
+
+commit 560bc6c09b751556efd6b4c4495751b109a93f92
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:59:24 2012 +0100
+
+ Fixed buffer overflow, just to be sure.
+
+commit 8291d7c5b92a31dd4f582b497d4b2a0853367a56
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:55:16 2012 +0100
+
+ Fixed buffer overflow.
+
+commit 88e1f34de7300575fa6dab857ecddb242a87de80
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:48:55 2012 +0100
+
+ Fixed buffer overflow when too long interface names are used.
+
+commit be1375a9926ebe0cd5b78a4045c3bd11c83664b1
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:46:49 2012 +0100
+
+ Fixed buffer overflow when a sensor name is too long.
+
+commit 1cb24625372062b14c71d7dd51e20fef773e2743
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:41:00 2012 +0100
+
+ Fixed buffer overflow when a CPU has too long name.
+
+commit 84c807ee03251e54856e83d62d06ea08b8df527a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:36:50 2012 +0100
+
+ Fixed buffer overflow when too long interface names are used.
+
+commit c310e390b5dd05f24be7eb1904c74e41259c93db
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:24:54 2012 +0100
+
+ Fixed buffer overflow when too big temp file pattern is used.
+
+commit 4600d11434e83b8653cf9f813a3d8b630455b42d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:17:08 2012 +0100
+
+ Fixed plausible string overflow before parsing command line options.
+
+commit 885061687d9caa38470979667d7d8ad6563cedad
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:11:02 2012 +0100
+
+ Get rid of (insecure) SNMP_MAXPATH in mkdirhier()
+
+commit 8016890a445f6a7e2a873a04873d4e27b6ee64e3
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:48:34 2012 +0100
+
+ Fixed wrong integer size on 64 bit platform.
+
+commit bb8fcbb874998000f945f058d1aa6fe14e925899
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:31:36 2012 +0100
+
+ Secure mkstemp() with umask() - on some implementations it does not set 0600 permissions automatically.
+
+commit 202523ca704bd722dc1ac0e1e6b0e4b4e5424495
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:11:57 2012 +0100
+
+ Fixed dereferencing 'c' before NULL check.
+
+commit 73a523e468277f6df2e984891313b8be8bce1921
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:08:24 2012 +0100
+
+ Fixed dereferencing key->info when key is known to be NULL.
+
+commit 2f4e6acd714183f015b763657f8f084593357e26
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 10:38:16 2012 +0100
+
+ .gitignore: Ignore perl/*.yml files
+
+commit c365d80c16c2d17b160011e8c1f9cb958954e9db
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 08:34:16 2012 +0100
+
+ CHANGES: snmptrapd: Do not invoke shutdown_perl() from inside the SIGTERM handler since that fails if SIGTERM is received while a Perl handler is active. Based on a patch posted by Joel Avni <javni@arubanetworks.com>
+
+commit d059fb878b1436599953cea5a077499ddcdcbcb5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 17:03:55 2012 +0000
+
+ CHANGES: BUG: 3440752: IF-MIB: Report interface speed correctly for Ethernet interfaces if other than 10 Mbps, 100 Mbps, 1 Gbps, 2.5 Gbps or 10 Gbps. Add support for NICs faster than 65 Gbps.
+
+commit c09903a42e9d97331fd9e48ee831a85afdf9c70a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Jan 9 13:26:17 2012 +0100
+
+ Doxygen-style documentation fixes
+
+commit e325ecbfce77f00ac5cf6fbd957f95495f61c59b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Jan 9 13:25:10 2012 +0100
+
+ Suppress uninteresting Doxygen warnings
+
+commit be9161d3a5898e863767f926613486126c2cbf67
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 12:35:39 2012 +0100
+
+ CHANGES: snmplib: Simplify implementation of functions manipulating 64-bit numbers.
+
+commit 86e4c2be0852a0a13b0603075720b3264ec70dde
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 12:29:11 2012 +0100
+
+ CHANGES: snmplib: Make it explicit that MAX_SUBID is an unsigned constant
+
+commit 37e272d8f7b7180ba140fa386a5ff058968a08a2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 18:21:48 2012 +0000
+
+ CHANGES: snmpd: IF-MIB::ifType: Report type "infiniband (199)" for InfiniBand interfaces instead of type "other (1)".
+
+commit 269932fa32c7cd47957489698e09bee31f63b7af
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 14:34:42 2012 +0100
+
+ Fix an MSVC compiler warning
+
+commit 0d1c21f9991d1309d057e3e4056d547df7d40ecf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 16:06:31 2012 +0100
+
+ Make declaration and definition of strlcat() consistent.
+
+commit 0c3d4dbb0a9cf5b359f70b2f19915495554f840f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 15:23:16 2012 +0100
+
+ CHANGES: Win32: snmpd: Remove dlmod
+
+commit 893ecc97b587661045becbe09a320c1bcbc71c7c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 14:36:59 2012 +0100
+
+ Add strlcat() to the MSVC build infrastructure.
+
+commit 3d126422e625702b9d3fa0676a97ec5cb20d9d10
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 15:01:06 2012 +0100
+
+ Make win32/net-snmp/net-snmp-config.h consistent with its .in file
+
+commit af53b76c2ffa751e3958d0fc5d8279f78c2c1c26
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 14:43:55 2012 +0100
+
+ Skip T066pass_simple and T067passpersist_simple on MinGW
+
+commit 35a92e693d133a5b11e9e9b599dbf47edef4933b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 08:16:36 2012 +0100
+
+ Remove snmplib/snmpDTLSUDPDomain.c again, which was added accidentally while resolving merge conflicts (commit 1d78f7d5b58aed2b52c4d386a7ba80a44711baca)
+
+commit a9b073ea3b6cedf713e305e7b15f28ae57bfdf1b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 17:47:11 2012 +0000
+
+ Fix 64-bit compiler warnings
+
+commit 7e890dad95f566069ee280215a4fea3f0e2e3980
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 16:38:50 2012 +0100
+
+ Avoid a SIGSEGV if cp == NULL. This is a follow-up for commit 089bcb360aa26790ad2a8ceddf583b7ba5ddfd48.
+
+commit 1f6200cfe1b0b27ebb093a1606b592f9e9684be8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 15:53:34 2012 +0100
+
+ Convert strncpy() calls introduced in v5.6
+
+commit c3126b143921fabeac442166eca5b5b742fd42c0
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 15:02:39 2012 +0100
+
+ Replace most strncpy() calls introduced in v5.5
+
+commit b24ee7c909657db43bd8c5d8c01055ca0883c9cf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 08:40:39 2012 +0100
+
+ Eliminate most strncpy() and strncat() calls
+
+ Using strncpy() and strncat() is error prone -- see also
+ http://www.gratisoft.us/todd/papers/strlcpy.html. Hence replace
+ all invocations of strncpy() and strncat(). Replace
+ strncpy(dst, src, n) calls by:
+ * strlcpy(dst, src, n) if the goal was to avoid output buffer overflow.
+ * sprintf(dst, "%.*s", n, src) to copy a prefix of src to dst or if src is
+ not '\0'-terminated.
+ * memcpy(dst, src, n) if strlen(src) >= n and n < size of dst.
+ * strcpy(dst, src) if n > strlen(src) and n < size of dst.
+
+commit 6d95bc4149472931005475c30a541fed5534da39
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 11:19:16 2012 +0100
+
+ Fix warnings triggered during compilation of the Perl xs source files
+
+commit bad0600f6ec944ef8455e327ce784b9b07d247c9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 10:00:13 2012 +0100
+
+ Add configure test for sockaddr_un.sun_path such that the com2sec test is run
+
+commit 92a32ac4866a5edc7f347d37942bf028de02762f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 10:00:29 2012 +0100
+
+ Get rid of a compiler warning
+
+commit 83e4c0e304f617ccac6610edd74d1706797bbf52
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 09:15:37 2012 +0100
+
+ CHANGES: testing: Add a test for se_store_list()
+
+commit 4fae5852103ec3893ad488bc0d905ca6914595ef
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 09:17:15 2012 +0100
+
+ CHANGES: snmplib: Simplify the se_store_enum_list() implementation
+
+commit b3222bb275f2f2346e0fd0478afa2efb600773e5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 09:16:45 2012 +0100
+
+ CHANGES: snmplib: Declare "type" argument of se_store_list() / se_store_slist() / se_store_enum_list() const
+
+commit 022f840fbfcb0e26b08f0e55728231f611495803
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 19:55:56 2012 +0000
+
+ Avoid that Valgrind complains about sending UDP data
+
+commit 672a809c228e9550b99b8910be75d0b161985402
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 17:33:09 2012 +0000
+
+ Fix a 64-bit compiler warning
+
+commit 24ff260ad89ce2aa361a55c7c72e916031defe35
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 17:11:24 2012 +0100
+
+ Change the type of the second argument of snmp_set_var_value() and snmp_set_var_typed_value() from u_char* to void*, like on more recent branches
+
+commit c6ca737fb46f90a4bda5d43734aac34e837a05f4
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sat Mar 13 19:07:37 2010 +0000
+
+ Backport commit f504ce2d74a4bc88f68cc9515fa7053373cb15b5.
+ (Fixed most compiler warnings triggered by the source code in the perl subdirectory. Note: these changes may contain some real bug fixes.)
+
+ Conflicts:
+
+ perl/ASN/ASN.xs
+ perl/OID/OID.xs
+ perl/SNMP/SNMP.xs
+ perl/agent/agent.xs
+
+commit d212dc984ec34e4d230625e46e58b0c628a50df5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 16:46:49 2012 +0100
+
+ SNMP.xs compiler warning fixes
+
+commit baceebb10d8caf5db63cc36935fed65ee931029d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 16:22:44 2012 +0100
+
+ Add declaration for shutdown_snmpNotifyTable()
+
+commit f7f966abd6d2849b1331252afe5c473e5c40b32d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 14:24:33 2012 +0100
+
+ Fix format specification mismatches.
+
+commit 303c015bcfe9af0b154e9881c7b4f449e08f30bb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed May 6 22:06:23 2009 +0000
+
+ Backport commit d3eb2b5ced22a8480053ce43acf9739729055404
+ (Sprinkle some const-ness where relevant / fix format string mismatches,
+ Niels Baggesen, May 2009)
+
+ Conflicts:
+
+ agent/agent_sysORTable.c
+ agent/helpers/instance.c
+ agent/mibgroup/disman/event/mteTriggerConf.c
+ include/net-snmp/agent/instance.h
+ include/net-snmp/agent/sysORTable.h
+
+commit d95b40406916bda5b48b5a6131bec27b866b0a79
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed May 6 21:59:20 2009 +0000
+
+ Backport a2a7316c310f0fcc3728673fa047051c23b71960
+ (Trivial warning fixes, Niels Baggesen, May 2009).
+
+ Conflicts:
+
+ agent/mibgroup/hardware/cpu/cpu_linux.c
+ agent/mibgroup/host/hr_swrun.c
+ agent/mibgroup/if-mib/data_access/interface_linux.c
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c
+ agent/mibgroup/mibII/sysORTable.c
+ agent/mibgroup/mibII/system_mib.c
+ agent/mibgroup/ucd-snmp/logmatch.c
+ agent/mibgroup/util_funcs/get_pid_from_inode.c
+ agent/snmpd.c
+ snmplib/container_list_ssll.c
+
+commit d86c47f003fdc192bce7b46ac4f06b09e387c12b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 13:29:08 2012 +0100
+
+ Fixed a typo
+
+commit bee4d79cf4eb7e0a45397f59b5298da633a8e1ba
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 13:14:57 2012 +0100
+
+ Fixed reading past end of buffer.
+
+commit 3dc0e00a2fd8e34fe1ae33ecabf36e146460a31f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 12:40:07 2012 +0100
+
+ Fixed buffer overflow when large 'token' is used.
+
+commit b3c4982542e0ab151fb3884754cdfbcb472da52d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 12:28:52 2012 +0100
+
+ Fixed off-by-one memset.
+
+commit 0f53695044dd3f0c3507753e3f8c29d97e96872d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Aug 3 21:38:26 2011 +0200
+
+ CHANGES: snmplib, snmpd, perl: Eliminate dead variables
+
+ Conflicts:
+
+ agent/mibgroup/agentx/master_admin.c
+ agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c
+ agent/mibgroup/host/data_access/swinst_pkginfo.c
+ agent/mibgroup/host/data_access/swrun_procfs_status.c
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c
+ agent/mibgroup/mibII/kernel_linux.c
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c
+ apps/snmptls.c
+ apps/snmptrapd_log.c
+ snmplib/dir_utils.c
+ snmplib/snmp_client.c
+ snmplib/snmp_openssl.c
+ snmplib/transports/snmpTLSTCPDomain.c
+
+commit 0153805c99b9197365935c5d11ae9c3d4bfaa0f3
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 09:48:41 2012 +0100
+
+ Fix a set-but-not-used warning
+
+commit 3f8885fbee9407748fc2f0573728a11ba2bc023a
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Tue Apr 28 05:51:13 2009 +0000
+
+ Return a value from sprint_realloc_value even if no subtree is located.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@17578 06827809-a52a-0410-b366-d66718629ded
+
+commit b1eaaf302369fd4552e8fee7b6a805091ec0a9b4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 11:38:51 2012 +0100
+
+ Added check of find_sec_mod() return value.
+
+commit aee4e895fe3bd5f4a61e34275bfca0368b560555
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 11:31:22 2012 +0100
+
+ Added check of snmp_sess_transport() return value.
+
+commit 5d1d0a744ab30c8e645c3b8506cbbd2cceb3d275
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 11:04:48 2012 +0100
+
+ Added check of netsnmp_extract_iterator_context() return value.
+
+commit 299ea9a89c3f1758a7748bb9b3411f62f2c70f88
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 10:54:55 2012 +0100
+
+ Added check of fopen() return value, just in case of some race.
+
+commit 90f1ae6757917481636eef77100caeeb53edfe01
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 3 10:06:56 2012 +0100
+
+ Add strlcat.c. Source: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/string/strlcat.c.
+
+commit 089bcb360aa26790ad2a8ceddf583b7ba5ddfd48
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 10:50:56 2012 +0100
+
+ Added strrchr return value check, just to be sure.
+
+commit 199a0511f6eb0ef3ff1d9f922b790ab67dfde01e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 10:31:26 2012 +0100
+
+ CHANGES: snmpd: smux: simplify smux_list_detach()
+
+commit d883573aa73e0f5fc188acedee6451f95dae900c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 10:23:06 2012 +0100
+
+ Fix a compiler warning introduced by commit a809fe5075c9f374715f7d1a682949a0730172c1.
+
+commit 7b7a3eb2500527eaa1699287a6ca6fcc4cc2e08a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 09:40:02 2012 +0100
+
+ Fix a build error caused by commit a809fe5075c9f374715f7d1a682949a0730172c1.
+
+commit 2b6c119fed4848da6663c11f0c2cbdc29921b5c6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:51:10 2012 +0100
+
+ Check for netsnmp_ds_get_int() errors.
+
+commit 6ce5360caa4c9de51ade57879e83f96bd04b4c5a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:42:23 2012 +0100
+
+ Check for missing view.
+
+commit b3bc54bed31690a85df2acfbf3296da93a9e89b4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:23:17 2012 +0100
+
+ Check socket() result.
+ Also close the socket on error.
+
+commit 92075f51cd45a38ca38760b3ffe82e16559e9c2e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:18:26 2012 +0100
+
+ Check open() result.
+
+commit 6665d5fe2fc569d6fa854d1d78e347bbac69e070
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:22:22 2012 +0100
+
+ Fixed missing break.
+
+commit a6648c5453e1ef8dac57a38efcc00cce53bf9e4f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:20:27 2012 +0100
+
+ Fixed missing break.
+
+commit d68dcae0f18d554571aef321944a5290548dde86
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:16:11 2012 +0100
+
+ Added 'fallthrough' comment for Coverity.
+
+commit fb6f80c0fe3ba36e56f5b911a47e3f6f32ba266e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:14:07 2012 +0100
+
+ Fixed exit code of encode_keychange with wrong arguments.
+ Also added a comment for Coverity.
+
+commit 3130e24fdc232464dd7bb216f46cafa2e0e775a6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:09:54 2012 +0100
+
+ Added missing break
+
+commit 18c126a9565cb4d69d7513b944a2105588045d35
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:07:29 2012 +0100
+
+ Added 'fallthrough' comment for Coverity.
+
+commit 6d31c82070a2c68fe3c519e9d56fa2779554d01f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:01:53 2012 +0100
+
+ Added 'fallthrough' comment for Coverity.
+
+commit dc6f0e2e549b4cd061ebc190084b1fc77a55f40f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:32:59 2012 +0100
+
+ Fixed wrong operator
+
+commit dab32867ed0b99301efd7b8d852ad1288a184be0
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:30:33 2012 +0100
+
+ Fixed QUITFUN usage.
+
+commit b1a2bcf64615eb66bc24d5be4950e45012962045
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:18:03 2012 +0100
+
+ Fixed wrong operator
+
+commit b2b1c851b94fed37c386eaa1bfead5c77696e3ef
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:14:52 2012 +0100
+
+ Fixed wrong operator
+
+commit a809fe5075c9f374715f7d1a682949a0730172c1
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 10:58:46 2012 +0100
+
+ Added check for failed register_mib.
+
+commit 5949f055c16ae650615aae7a1fee3f2d7b16d940
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 10:29:59 2012 +0100
+
+ Make MIB file parsing and detection more strict - LABEL is required at the beginning of MIB files.
+
+commit e4b673683c68ba8b3abc040b9125ec304643cc7c
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Jan 1 23:00:24 2012 +0100
+
+ Assume that libdl might be in AGENTLIBS or SNMPLIBS so preadd them.
+
+commit b13c1e57bedba79b806103c74f1921d53a706b38
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Jan 1 22:55:06 2012 +0100
+
+ Do not require ucd-snmp/dlmod unless it will work.
+
+commit 27dcea0d5f801df494ab2cb5c5c0ebe54eb0dcd3
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 14:48:29 2011 +0100
+
+ Adjust paths for test restructure
+
+commit 14b60e85a1b5700e93d126e2f291d5c485f34e36
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 14:14:29 2011 +0100
+
+ CHANGES: snmpd: Make the configuration of the dlmod module fail rather than generate a dummy module if the dlopen function isn't available.
+
+commit 98a97538fc1e9ff46b60d5d969347444578378c0
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 13:35:13 2011 +0100
+
+ Adjust the paths to support testing even if builddir != srcdir
+
+commit 88f0af3cfb916ae5863cc2986071d435f20c3064
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 11:37:52 2011 +0100
+
+ Reduce the scope of the variables 'p' and 'len'.
+
+commit 0815a7536c76f7e4842638683f674894a1a8ce14
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 29 14:42:54 2011 +0000
+
+ Report problems with SetUndo processing
+ Missed when applying patch #3445440
+
+commit eb2ab23742ca86c0b89ccfe91eb6ea374bf3acc1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 29 14:37:31 2011 +0000
+
+ Check for the expected error (EPIPE) on closure.
+ Missed when applying patch #3447444
+
+commit aac10bc4f053c014f382d6593fc32ab95e0b1a57
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 29 12:59:52 2011 +0000
+
+ CHANGES: snmpd: BUG: 3463767: Handle parsing subidentifiers > 2^31
+
+commit bbc02e36e90c1aab7898562f963f5cadb26e10bd
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Dec 28 17:15:16 2011 +0000
+
+ Move pass/pass_persist tests to the new location
+
+commit 3898c04fd6f89867062fdfebf36857ab619c0450
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Dec 28 16:53:24 2011 +0000
+
+ Add tests for pass/pass_persist, supplied by Bill Fenner
+
+commit d5ee3f0a1a63bb1752c74cbca55aa3d40bf9bf13
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 21:58:51 2011 +0000
+
+ CHANGES: snmpd: PATCHES: 3447444: Fix SIG_PIPE handling
+ Patch provided by Bill Fenner
+
+commit 2a17b37430c1852998c3588e547d7eb61c06da71
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 21:45:38 2011 +0000
+
+ CHANGES: agentx: PATCHES: 3445440: More robust handling of AgentX errors
+ Patch provided by Bill Fenner
+
+commit fe58a0e5f4d4e2e2ecbcb47382b08cb1e4df352c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 18:16:23 2011 +0000
+
+ CHANGES: snmplib: PATCHES: 3456770: Handle (obsolete) UInteger type properly
+ Patch provided by Bill Fenner
+
+commit 1be8cf08a67a91855fee1ec4a2d8e087c7812456
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 18:04:10 2011 +0000
+
+ CHANGES: agentx: PATCHES: 3445437: Log AgentX disconnections
+ (in line with connections) Patch provided by Bill Fenner
+
+commit 068037289107faa2ba3f5cd2fb00c19494bb9a04
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 17:27:46 2011 +0000
+
+ Handle any GETNEXT request OID, not just a simple walk.
+
+commit a74fa528983123d355a8cdcaa77dd4eb4b8c6959
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 17:00:18 2011 +0000
+
+ CHANGES: pass: PATCHES: 349394: Bring pass_persisttest script into line with passtest*
+ (i.e. using the legitimate structure of NET-SNMP-PASS-MIB)
+ Patch provided by Bill Fenner
+
+commit bbe649ebfa61ea22399170b36b99db30a1de8012
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 16:54:38 2011 +0000
+
+ Rework "passtest" example to fully validate GETNEXT requests
+ and use a legitimate structure for output. Backport of SVN
+ revision 17632 (which updated 'passtest.pl' but missed 'passtest')
+ Correct in branches 5.5 and above
+
+commit 82d06c7247b22c8b01d45bf55041d2f1e6427d49
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 13:45:18 2011 +0000
+
+ CHANGES: snmpd: PATCHES: 3447671: Fix override handling of OID values
+ Patch supplied by Phillip O'Donnell
+
+commit ba4a9ce51c9600f9fda168f1e6eff32a1db63cb9
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 13:24:26 2011 +0000
+
+ Tweak --disable-snmp-set changes
+
+commit 827c8b28830171faa9c61d53efca9eb6600561c2
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 11:25:43 2011 +0000
+
+ CHANGES: python: PATCHES: 3433846: Fix for use with python 2.4
+
+commit f98a54a99caf7b46b100a920db942cbca9c43926
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 10:10:36 2011 +0000
+
+ Skip SET-based tests when configured with --disable-set-support
+
+commit 230df14f94c3736ff34379a4e281eea353b47f80
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Dec 26 23:34:23 2011 +0100
+
+ Do not assign tmStateRef twice
+
+commit c96b3b4d8530ad5e0efb03f24dab5e5f1a460031
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 25 11:18:21 2011 +0100
+
+ Correct use-after-free.
+
+commit c5978c89cde2440f4d20dadbc9d1dd8db562d56e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 25 11:15:44 2011 +0100
+
+ Correct double-free.
+
+ netsnmp_tlstmAddr_add takes ownership of it's argument so calling free on the
+ argument on failure is incorrect.
+
+commit c139ca123b44bb3b9b6bf921e1609cc45f63a660
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Sat Dec 24 16:55:30 2011 +0000
+
+ CHANGES: snmpd: PATCHES 3410059: Fix sparsely augmenting trigger tables
+ Patch provided by Stephen Turner
+
+commit c4ae021b2e6384437081c5623f360c8896390188
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Sat Dec 24 16:29:54 2011 +0000
+
+ CHANGES: snmpd: PATCHES 3410050: Skip already-'processed' varbinds
+ Based on mib2c patch provided by Stephen Turner
+
+commit c6accf8c66254fa8c48767ed7dec795ddafc522e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Sat Dec 24 16:27:11 2011 +0000
+
+ CHANGES: mib2c: PATCHES 3410050: Skip already-'processed' varbinds
+ Patch provided by Stephen Turner
+
+commit a61826ad8ca54661d1d909712503bd3a8b32eed0
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Dec 22 18:35:46 2011 +0100
+
+ Remove unused variable.
+
+ myMatch is unused as nmatch is zero and also since regexBuffer is created
+ with REG_NOSUB set.
+
+commit ba4fc80fe2cfd5a5d89230d8f3703e4fe01e6019
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 22 19:24:40 2011 +0000
+
+ CHANGES: agent: PATCH 3402376: from Leonardo Chiquitto: Recognise ReiserFS
+ Also move various FSType definitions to the appropriate blocks
+
+commit b5ac4a04dcd5470d08d03321abcd1e982621e6e0
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:39:46 2011 +0100
+
+ Fixed unterminated strings after strncpy
+
+commit 2b37e4e8f250a0d8821199a74ac3f4e5b7b7baba
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:31:51 2011 +0100
+
+ Fixed unterminated strings after strncpy
+
+commit 3d08345156c419333de969f13d21fcec7e18e94d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:32:29 2011 +0100
+
+ Fixed unterminated strings after strncpy
+
+commit cd859ad51c4f18d5b0fc69dd669fcb051c798969
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:39:33 2011 +0100
+
+ Fixed wrong memmove size
+
+commit 30ff58d09d4c9d5438bb621054fd7ad7a2a597e4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:07:19 2011 +0100
+
+ Fixed wrong length of buffer when printing ASN_BIT_STR
+
+commit 6c1487e1d360d3d260a39cb1f5b15da978395053
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 15:47:34 2011 +0100
+
+ Fixed potential free of uninitialized pointer in error cases
+
+commit c76fb96f65e33ba2fd212a921e8c386155ee5c7a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 15:44:46 2011 +0100
+
+ Fixed unitialized values in udpTable
+
+commit c44608679b89751176f28a2e54d5282b46e2a05c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 14:56:13 2011 +0100
+
+ Use calloc instead of malloc and manual clearing
+
+commit a05c5f9513461824e7903ae9ae9a6c3386e33879
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 14:40:50 2011 +0100
+
+ Fixed printing of unitialized variable when sensors_get_label() fails
+
+commit e4a5edc72393bd3de9bf12bceba9d83bbf7de70b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 14:31:25 2011 +0100
+
+ Removed unused variable
+
+commit fae2e5b835b8df1eae47e4cebb4eb404d7282377
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 13:31:21 2011 +0100
+
+ Fixed dereferencing unitialized iid in error cases and with debug info enabled.
+
+commit 9d58f81a9239cfbcfc8ebce367d21e9b3dcb028b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 13:33:33 2011 +0100
+
+ Fixed dereferencing uninitialized variables in error cases
+
+commit 0bc8c08edeae7ae095f116258c20ae5767d60652
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 13:20:52 2011 +0100
+
+ Fixed returning uninitialized variable 'status' when ss == NULL
+
+commit 7304c53cf8adee8eccef1a8f26756fc07f098721
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 18 23:31:53 2011 +0100
+
+ On solaris 10 test in /bin/sh doesn't support the -e test. Replace it with -f
+
+commit 8cd3be60d693c9c36ffb97d3d9bcb49c1b4abe35
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 17 08:52:24 2011 +0100
+
+ Avoid repetition of the complex expression determining if it is possible to get the destination address.
+
+ This also makes it possible to build on platforms like Solaris 10 that define
+ IP_RECVDSTADDR but lack either of msghdr.msg_control and msghdr.msg_flags.
+
+commit 953f2e3d425ede3b863a2e7ccb0b4bc862928b57
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 5 22:13:07 2011 +0100
+
+ Move the use of _sendto and _recvfrom below their definitions.
+
+commit 68a1173c46cf77601426cf391d9a852794f2057e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Nov 20 20:05:18 2011 +0100
+
+ CHANGES: snmplib: Separate out the cmesg buffer size
+
+commit 461dd16f3b2647322cdce6363081cc44ba5a49b5
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 26 21:51:01 2011 +0100
+
+ CHANGES: snmplib: Merge together the Linux and *BSD version of src port sending.
+
+commit 7accb69baa1fc0b6a3439d2e549c86da3453bad2
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:30:31 2011 +0100
+
+ Use a bare struct iovec in instead of a one element array.
+
+ The purpose of this change is to make _recvfrom more similar to _sendto.
+
+commit 39852cd4c85ef2bfc75cdea2825261ee93e768c2
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:29:20 2011 +0100
+
+ Add comment describing the purpose of the call to getsockname after almost removing it.
+
+commit 1b292ca27eab5caa73feaaa83dc9c12abc0f2e70
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:27:59 2011 +0100
+
+ Reduce variable scope.
+
+commit bc879571eca9520bc132f840c3e659d3793144d7
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:25:36 2011 +0100
+
+ Introduce temporary variables to ease the extraction of the server address.
+
+commit b7eea6cffbd872932ce2c04fefb6f43de339f374
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:18:33 2011 +0100
+
+ Rename the cmesgptr variable to cm.
+
+ The purpose of this is to increase the readability of the code.
+
+commit 0a7461e728805c62a1cab9d87bfc74c7927a9fcc
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:15:22 2011 +0100
+
+ Factor out a common loop in recvmsg option processing.
+
+commit b3c6248d0201ab1610840d6d0e749b3b6c4ad792
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:13:43 2011 +0100
+
+ Unify the structure of Linux and BSD recvmsg option parsing somewhat.
+
+commit 356400d6290a423b52ebeea5a5e976fb15bb73b4
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:04:56 2011 +0100
+
+ Use CMSG_DATA on the result of CMSG_FIRST/NEXTHDR, not on the buffer.
+
+commit 3b351708c62de46aa1b90ed232cfd8c7c5b02231
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 12:00:32 2011 +0100
+
+ Remove a cast
+
+commit de9250d9dae9727a6cc7f647688dddf1b8597128
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 11:58:04 2011 +0100
+
+ CHANGES: snmpd: Make sprint_mib_oid() treat OID components as unsigned instead of signed integers
+
+commit 0e33b3b6d5854a4bac15d4ea5e016c53d161d0cd
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 10:02:28 2011 +0100
+
+ Fix recently introduced compiler warnings
+
+commit b7e50d5f9a6755982d2af3191473cb34643bc03f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 08:37:22 2011 +0100
+
+ CHANGES: snmplib: Reduce overhead of config file parsing
+
+commit 73c9ee42d28afe2e107a7d6616b6d011890c36ea
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 09:09:59 2011 +0100
+
+ Remove unused variables
+
+commit 3db97962b37eb12d254d61e6be234b06a391c8bb
+Author: Bill Fenner <fenner@gmail.com>
+Date: Thu Dec 8 07:43:45 2011 +0100
+
+ CHANGES: snmpd: PATCH 3453868: from "Bill Fenner <fenner@gmail.com>": Factor common code into pass_common
+
+ Move the code for pormatting and printing values from pass and pass_persist
+ into pass_common.
+
+commit b6568c83f1756e9a65434edeeeb40d23ddbbb652
+Author: ccchiu <ccchiu@sourceforge.net>
+Date: Wed Dec 7 16:25:27 2011 +0100
+
+ CHANGES: BUG: 3452069: Fix snmptrap_oid declaration in mib2c generated code
+
+ This bug was introduced considerable time ago. It did already exist at the
+ time the 5.6 branch was created (see also commit
+ 0ec088afa27cfda4e6ea78aae7cfc5507564edde).
+
+commit d494db64c208b4dc62813132f8863bd5c1a39d77
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:38:17 2011 +0100
+
+ CHANGES: snmptrapd: Eliminate an unused variable (Now)
+
+commit 28f2561bc2935d8e1cbf46d2820158173e7a4cf4
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:37:11 2011 +0100
+
+ CHANGES: snmptrapd: Move the main loop code into a new function
+
+commit 396e122ddc42a916f06a02884c0e8a258edbe238
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 09:32:16 2011 +0100
+
+ CHANGES: snmpd: Match each getpwnam()/getpwuid() call with an endpwent() call and each getgrent() call with an endgrent() call.
+
+commit 3efefbc0024399786f8b68b1e93b0a8fddddc7da
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:41:01 2011 +0100
+
+ CHANGES: snmptrapd: Remove superfluous casts
+
+commit 7f05daa8e0e0f533b0f12a3e1cf07641519909d6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 11:58:32 2011 +0100
+
+ CHANGES: BUG: 3444939: BUG: 1796886: snmplib: Avoid that sprint_realloc_octet_string() embeds unprintable control characters or binary zeroes in its output. This behavior could cause truncated output in snmptrapd.
+
+commit db8f558fd2f3b7c109ea3a1c2133b75b6f8cb2ad
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:04:41 2011 +0100
+
+ Compiler warning fix: pass unsigned chars to isprint() instead of signed chars.
+
+commit 800dc1028e7e0cd8cc14d84dd31723d47ac073db
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Dec 1 10:18:58 2011 +0100
+
+ Reduce the scope of the hint variable
+
+commit 83ea4a080c90a74b9743d3f24cf0d4b8a1e8c849
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Nov 27 21:16:52 2011 +0100
+
+ Reduce the scope of the variable qos
+
+commit 7b9e03441c3dc3a07670ed01f5d04791a82c750c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:04:01 2011 +0100
+
+ Remove #define val(x) __STRING(x) and change val(x) into __STRING(x).
+
+commit 2f379b0e4ecadfa4e541e3005c8fc8281882b741
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 15:58:47 2011 +0100
+
+ Follow-up for commit 1aa704e: unbreak the MSVC build
+
+commit 64ef0f71127617837027fb2cfaf174b95ba79e0d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:19:50 2011 +0100
+
+ Add SNMP::register_debug_tokens()
+
+commit 7bead9ca917c67566d5ed98ab507bbc02816217d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:08:08 2011 +0100
+
+ AgentX subagent: Reduce code duplication
+
+commit 0ed71541f87e7d78bc998eebda3217c59e1df830
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:03:19 2011 +0100
+
+ CHANGES: snmplib: Add Doxygen-style function header for netsnmp_register_default_target() and netsnmp_clear_default_target().
+
+commit 8c2972b61e40169b47c50988b6ae9e8c285f84f8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:02:54 2011 +0100
+
+ CHANGES: perl: Fix spelling in the documentation of the SNMP module
+
+commit 5df2bac6bd717799311f001ac7b73db88f11bdda
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Tue Nov 29 08:59:58 2011 +0100
+
+ CHANGES: snmplib: Only transform the address to printable form when needed.
+
+commit 171e8d48d4af04013cff8fd28f5341a2aef21d88
+Author: Mijo Safradin <safradin@linux.vnet.ibm.com>
+Date: Tue Nov 29 16:49:46 2011 +0100
+
+ CHANGES: snmp-bridge-mib: Fix index interpretation.
+
+ This patch corrects a wrong data interpretation.
+ snmp-bridge-mib obtains the ifindex value from the sysfs
+ attribute 'ifindex' The value given by the sysfs attribute
+ is an integer, which is handled as hex and leads to
+ incorrect data displayed to the user.
+
+ e.g.
+ $ > snmpwalk localhost BRIDGE-MIB::dot1dBasePortIfIndex.2
+ BRIDGE-MIB::dot1dBasePortIfIndex.2 = INTEGER: 54
+
+ according to the sysfs attribute the value is 36
+
+ $ > cat /sys/class/net/<device>/ifindex
+ 36
+
+ Signed-off-by: Mijo Safradin <safradin@linux.vnet.ibm.com>
+
+commit 82e39fb6706df90ecf2fc9e10ada2b962ee196f3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Nov 29 12:27:46 2011 +0000
+
+ Fix multi-line case testing of incoming OID
+
+commit b15da1a4516061105a1eac7450cf650ec44266b2
+Author: Nikolay Denev <ndenev@gmail.com>
+Date: Tue Nov 29 08:29:49 2011 +0100
+
+ CHANGES: FreeBSD: Restore IP_RECVDSTADDR functionality.
+
+commit 7f47f52e481baa9aafb5784244b0dd2653e7dcff
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Nov 28 08:51:39 2011 +0100
+
+ CHANGES: snmplib: Use SNMP_ALLOC_TYPEDEF to allocate transports in order to avoid the separate call to memset.
+
+commit cf86039e3086225c3085bb9adf088b8ba5ba6979
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Nov 22 15:02:58 2011 +0100
+
+ CHANGES: MinGW: testing: Make unit-tests/T102pdu_build_clib pass.
+
+commit 1a87e76e00ee3d5cd37a07bfc3d84490d3c2a4ec
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Nov 22 14:55:42 2011 +0100
+
+ CHANGES: MinGW: testing: Make unit-tests/T014gethostbyaddr_clib pass
+
+commit 8867fd1dcfe72b59d07322ff38a699b66ec4f326
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Nov 22 09:44:38 2011 +0100
+
+ CHANGES: snmplib: Make netsnmp_large_fd_set_resize() robust against memory allocation failures.
+
+ CHANGES: snmplib: Make NETSNMP_LARGE_FD_ZERO() use memset() on Unix systems instead of an explicit loop.
+ CHANGES: snmplib: Make sure that on Unix systems netsnmp_large_fd_clr() doesn't try to read memory it isn't allowed to read if the first argument equals -1 (a value that shouldn't be passed by the caller).
+ CHANGES: snmplib: Make netsnmp_large_fd_is_set() return false on Unix systems if the first argument equals -1 (a value that shouldn't be passed by the caller).
+ CHANGES: Windows: Make netsnmp_large_fd_set_resize() shrink behavior correct.
+
+commit 23db0cf09b8b0eab37b749ef0c3c3f306900245c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Nov 21 23:02:57 2011 +0100
+
+ Fix casting tv_usec to int which may be too short
+
+commit 80ee4022e534e64aad5a5f27192843b42acb85e0
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 09:14:02 2011 +0100
+
+ CHANGES: snmpd: BUG: 3439234: Move netsnmp_pass_str_to_errno to pass_common and rename it to netsnmp_internal_pass_str_to_errno
+
+commit 0baa9296c072bb3735760b0dd992f2d1d3ca27fa
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 09:05:24 2011 +0100
+
+ CHANGES: snmpd: BUG: 3439234: Correct the dependencies of ucd-snmp/pass and ucd-snmp/pass_persist
+
+commit 1aa704e4a294430b28e39b6f9e4683b8a48bce04
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 08:35:21 2011 +0100
+
+ CHANGES: snmpd: Factor out asc2bin and bin2asc. Add a netsnmp_internal_ prefix to them
+
+commit cda8fe91013f12cbf64a0775abb55720035af931
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 00:55:24 2011 +0100
+
+ CHANGES: snmpd: Call snmp_oidtree_compare instead of snmp_oid_min_compare
+ CHANGES: snmpd: Remove snmp_oid_min_compare since it is internal and unused
+
+commit 85f893e2b605e67f9bd0443c74e2ed269aa68564
+Author: Niki Denev <niki_d@users.sourceforge.net>
+Date: Thu Nov 17 22:42:32 2011 +0100
+
+ CHANGES: snmpd: PATCHES: 3175640: Use IP_RECVDSTADDR sockopt where available (*BSD)
+
+ This hunk fell of when the rest of the patch was merged.
+
+commit 5c913e54656ae0096b1feb6da98b5fc9ca81f276
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:33:07 2011 +0100
+
+ Define the full NetBSD hierarchy downwards
+
+commit b881841bd0493dd71d63259bdded449b06f02c32
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:30:33 2011 +0100
+
+ Fix size_t/int mismatches
+
+commit ca294cf75bbc8e90dbf44ee40478935e91db1487
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:18:03 2011 +0100
+
+ Remove unused variables
+
+commit cd32c2dff06b9b452cc18d552d2f2234092c829c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:17:09 2011 +0100
+
+ Fix format warning
+
+commit 883136c2b2fa0739f437a8cfb6614accc76e268e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:15:58 2011 +0100
+
+ More needs for NETSNMP_PRIo format specifier
+
+commit b8084a7ccc909b6d6db7c0e8e596d78671f5678b
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:14:26 2011 +0100
+
+ Fix using char as array index (ctype.h)
+
+commit 84529e6320a89d97f1314aebad806255d2a1b18c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:00:57 2011 +0100
+
+ Fix missing format for FreeBSD 4
+
+commit 4bd0352955a2551bfe02308dd134b9128c98b9e9
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 22:59:36 2011 +0100
+
+ Fix paranthesis problem
+
+commit fe6269b1900cf44dc27a199a761d15a01c3f3092
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 22:58:34 2011 +0100
+
+ Fix size_t/int mismatches
+
+commit a4db9f9fc13d21ecff488eb410376edda6c28232
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 13:43:34 2011 +0100
+
+ Remove unused variables
+
+commit 390c0114c8ec0bdb27b08b6f74e3f6ef3a62981b
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 13:37:49 2011 +0100
+
+ Fix format specifiers to avoid warnings
+
+commit 25cfc1962ae576ccb1558da1e3ef8b6c17f63c16
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 11:27:53 2011 +0100
+
+ Really up-to-date mibs
+
+commit 0e86c781f3989bf022c8993a118617b74a75420c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:17:19 2011 +0100
+
+ memory_linux: get Shmem from /proc/meminfo for 2.6 (or newer) kernels
+
+commit bf264d15ded7acbbf2e3871b98fd1fcef43d9ec3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:16:16 2011 +0100
+
+ memory_linux: close sockets in error situations
+
+commit 57ff8a40bae5d9bcad16089142a9cf328c9fa1f5
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:14:57 2011 +0100
+
+ disman/ping, disman/traceroute: Close sockets in error situations
+
+commit 8a2502a15c3217b95939a3c836167d230ac35f02
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:13:53 2011 +0100
+
+ Up-to-date list of RFCs wit mibs
+
+commit dcdd702111d8da5f53804cfcf0dfdad731468bde
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Nov 15 10:57:34 2011 +0000
+
+ Don't try to install an empty list of man pages (MAN3)
+
+commit ba619804e5978a8df754844efcca52b69b5015fa
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Nov 14 13:34:20 2011 +0100
+
+ MinGW: Make sure that the backslashes in the pskill message are displayed.
+
+commit 923eecc507f75043b60c5e68053a4f396ab0b0d2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Nov 14 12:36:38 2011 +0100
+
+ Compiler warning fix for systems where uint64_t = unsigned long (e.g. RHEL 6.1/x86_64)
+
+commit 434bfc1f7457550b6f87d5bcd511276b270b5964
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Nov 14 11:22:53 2011 +0100
+
+ CHANGES: snmpd: from Martin Wilck: fixed snmpd crashing with 'select: bad file descriptor'.
+
+ On 32-bit systems, snmpd dies with aforementioned message when using file descriptions > 32, e.g. when having >32 AgentX subagents.
+
+commit ed65eca6e7f9cfa7380a78d56c01ed314745b169
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 19:01:21 2011 +0100
+
+ FreeBSD-9: Fix for const'ifyed nlist arguments
+
+commit eaca7983e3655ab696fcc4461ca0cedbac6ce69a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 19:00:12 2011 +0100
+
+ NetBSD-6: One more instance of timespec replacing timeval
+
+commit 8ad6c53fdec5adeae4e52f1751ecec4a345bab05
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 18:59:01 2011 +0100
+
+ Fix buig #3436527: arp_netlink: fix dying reload of cache
+
+commit 378ffed03ba79a8346d6c62781e2ddf5ce92a478
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 18:55:43 2011 +0100
+
+ Fix bug #3436528: swinst_pkginfo: recover from NULL return from opendir
+
+commit d7ad8f5f9f3f67f16f65c2515d11e194d2cdd12c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 10 14:04:41 2011 +0100
+
+ CHANGES: Cygwin: Make date_n_time() produce time zone information
+
+commit ba35c50b2f459bd9c11ed59cc7d1b16215644fa3
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 10 14:17:04 2011 +0100
+
+ Replace AC_TRY_LINK() by AC_LINK_IFELSE()
+
+ Note: these changes do not affect the generated configure script.
+
+commit f615bf24f5d0f23ce9301da556184d6460740456
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 9 20:32:49 2011 +0100
+
+ Fis Bug #3434824: SIGSEGV when reading disk directive after SIGHUP
+
+commit a94a179d9340f51fa7c23431630bc0ffd6d759e8
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 9 20:30:51 2011 +0100
+
+ Fix bug #3433616: dont treat DateAndTime as a string
+
+commit b29e4164531d258fe34a6fe2b9e1ec60c56f9544
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Nov 7 01:25:57 2011 +0100
+
+ CHANGES: testing: Remove unused variable
+
+commit e221e65fdc1c68f1968651717dcc9ccfb6414783
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 3 15:05:00 2011 +0100
+
+ Fix warnings about converting sockaddr_in * into sockaddr *.
+
+ This is a follow-up for commit a0af385.
+
+commit 2e7e9eda0b0d62a7645a9a8f70ef3fb6f3dd6941
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 3 11:17:48 2011 +0100
+
+ Fix uninitialized variable warnings.
+
+commit 3462ebcdd0b7c298cb15c3099736f4f952257846
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 28 16:07:15 2011 +0200
+
+ Remove those superfluous parentheses that trigger a clang warning.
+
+commit 3e5fedd3e7d1ef31683604bf73dc56e944cad349
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Nov 3 09:45:27 2011 +0100
+
+ CHANGES: snmpd: fixed UCD-SNMP-MIB::systemStats after 30 days of uptime.
+
+ After 30 days, values from /proc/stat (on Linux) can get bigger than 32bits and snmpd calculations might render counters like ssCpuUser negative or zero, while the real value is higher. Therefore the counters should be tracked as the largest integer available.
+
+commit 0fc8221b24988c4ae6180ed42b86b9852fd586ad
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 2 22:59:08 2011 +0100
+
+ dskIndex was off by one
+
+commit a5b28829e64d5f3b87e4b9b1ef8cc204f33a61b7
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 2 21:25:07 2011 +0100
+
+ Solaris needs $AWK to get a usable nawk
+
+commit 2801a2139f27021e1ab15e362e2d3d624ffaa494
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Oct 31 22:55:53 2011 +0100
+
+ Patch #3406364: Fix unstable data for NetBSD.
+
+commit 821a58d112d7ac495149e262d704412ba2800438
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Oct 31 22:43:52 2011 +0100
+
+ Fix ipv6 statistics looping too far when scanning interfaces.
+ Fix TCP session table repeating data from first entry for all.
+
+commit 349591d03e17a55b43eacc6a687b02fd8d4e9528
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Oct 31 08:59:37 2011 +0100
+
+ CHANGES: perl: Make it possible to build perl support without support for opaque types.
+
+commit 1ec7110e72bce1561f746517459d6f043016b60e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 30 19:05:30 2011 +0100
+
+ CHANGES: testing: Make the asn1 test pass even if support for opaque types are removed.
+
+commit 6d26918af55aa3662a720542de77bbf39b0a3e91
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Oct 29 08:34:33 2011 +0200
+
+ CHANGES: snmpd: Disable the support for integer64 in pass scripts if compiling without opaque-special-types.
+
+commit 29bf69d70424f359d9c87f07a964a099415649a5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 13:02:25 2011 +0200
+
+ CHANGES: snmptrapd_sql: Avoid that a linker error is triggered on systems where my_progname is missing in libmysqlclient (e.g. Fedora 15 and 16).
+
+ This is a backport of commit 9f653f7.
+
+commit 2cc9504b9bb8625b94be6cda7e60993d059cd928
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 09:01:23 2011 +0200
+
+ CHANGES: snmplib: BUG: 3428506: Fix netsnmp_gethostbyaddr()
+
+ This patch should fix the regressions introduced by commit 85d96c4 (May 13, 2011).
+
+commit 9b427b353f1ceb8fe87e6fc8ed3b6cfab3ce7f20
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Oct 27 08:20:00 2011 +0200
+
+ MinGW: Avoid confusion between MinGW's kill.exe and the SysInternals pskill.exe
+
+commit 2c45f92cfcb5b05e049226a5a7883a0b106011ae
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 10:42:29 2011 +0200
+
+ Fix compiler warnings about passing a const pointer to a function accepting a non-const pointer.
+
+commit 275d23edfdebe0577b08421e4c6c936ae39b7fdc
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 09:33:09 2011 +0200
+
+ Fix compiler warnings about set-but-not-used variables
+
+commit 4495e17c078ac6997a9c7fa1a88db0644e919491
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 09:32:46 2011 +0200
+
+ Fix compiler warnings about casting away const
+
+commit 13952f6bee9f408867ab6d2fdfdde4f284074957
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Oct 26 14:05:16 2011 +0200
+
+ CHANGES: snmplib: from Siddhesh Poyarekar: properly clean up old requests in a subagent when we reconnect to master.
+
+ An snmp subagent linked against net-snmp-libs may crash if it handles a
+ response which has magic referring to an older disconnected main session. This
+ may happen when the subagent
+ attempts to clean up old requests on reconnection of the disconnected master
+ session.
+
+commit ae052472b22720d08369e85127db214245df2e3f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Oct 25 16:15:17 2011 +0200
+
+ CHANGES: perl: fixed segmentation fault when handler registration fails.
+
+ When netsnmp_register_handler fails, it frees its reginfo -> nsahr_DESTROY (and any other function) must not dereference it.
+
+commit c199bf91b6239f26b2aab34e8575e0f0df9cde9b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Oct 24 14:25:28 2011 +0200
+
+ CHANGES: snmpd: xfs, jfs and vxfs filesystems are now recognized in hrStorageTable
+
+commit 747fdc71e64d09e080928ebbb4d04cbde3906799
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Oct 5 15:57:59 2011 +0200
+
+ CHANGES: snmpd: Lowered severity of 'error finding row index in _ifXTable_container_row_restore' message.
+
+ The message is shows up when snmpd is started and there is different set of network interfaces than it was when snmpd wast last stopped. This is common on ppp-servers or virtual hosts.
+
+commit 250f698e59eab9f1ffd332ff59fdb72ea0df06ff
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 23 08:51:23 2011 +0200
+
+ CHANGES: building: Make the transport configuration code work again
+
+ Previously the transport inheritance processing code ran with
+ NETSNMP_FEATURE_CHECKING set. In this mode the file net-snmp/feature-details.h
+ is requiered. That file is created during the first make run, and that happens
+ after configure is run.
+ Change this to undefine NETSNMP_MINIMAL_CODE, effectively turning off feature
+ support during transport configuration in order to make it work at all.
+
+commit 6ef6907642247c663b9b8964b9fd44a211dbcaa7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Oct 20 20:30:54 2011 +0200
+
+ CHANGES: snmpd: BUG: 3408398: Fix a memory leak in agent/mibgroup/hardware/fsys.
+
+ This memory leak was introduced via commit
+ 9bf3d96d96a8ecd4a5fc35c326dc937467002b6c: Initial HAL
+ implementation of FileSystem information (March 7, 2008).
+
+commit cf82b894b2217c26edc6f1356351c932415604e2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Oct 15 14:45:08 2011 +0200
+
+ CHANGES: snmplib: BUG: 3423915: Change default number of retries back from 0 to 5
+
+ This patch fixes a bug introduced via commit 6cac050 (May 5, 2011,
+ added support for specifying the default number of retries in
+ snmpd.conf).
+
+commit c11adaa12915abfee629bb6c026c21f2185b216e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 17 10:24:46 2011 +0200
+
+ CHANGES: Win32: Avoid that compiling the header file <net-snmp/net-snmp-config.h> with the MinGW gcc compiler triggers warnings about "pragma comment".
+
+commit b17a72a793483aee4a5bb2f2e2c7f4fd869817e6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 17 10:22:20 2011 +0200
+
+ CHANGES: Win32: Avoid that the PACKAGE_* macros defined in <net-snmp/net-snmp-config.h> cause trouble when including this header in a package that uses the GNU autotools.
+
+commit 664d3ae107d754051b8c42279d459aa57a1be1c3
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 16:47:16 2011 +0200
+
+ MinGW, hw_fsys: Use proper format specifiers in a debug statement.
+
+ This patch fixes an issue introduced in commit 76ff25d.
+
+commit 211dcb49306561e35ba3c213be7cfa257b40a8e5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 15:52:43 2011 +0200
+
+ Avoid that gcc 4.6 complains about set but not used variables
+
+commit 9f653f73e5aa70f0bef1174632e95594f87f669f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 13:02:25 2011 +0200
+
+ CHANGES: snmptrapd_sql: Avoid that a linker error is triggered on systems where my_progname is missing in libmysqlclient (e.g. Fedora 15 and 16).
+
+commit 4c83b9229a7454f34f6ff75f69e67e4030c419b5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 7 15:58:45 2011 +0200
+
+ CHANGES: snmplib: Set the rpath for libperl.so in libnetsnmpmibs.so such that the dynamic linker can find libperl.so without requiring the user to modify the dynamic linker settings.
+
+ This change in agent/Makefile.in is necessary on the 5.5 branch and
+ later but not on the 5.4 branch. That is because the 5.4 branch uses
+ an older version of libtool that propagates the rpath of dependent
+ libraries. This is called inter-library dependency tracking in the
+ libtool manual. This functionality is present in libtool version 1
+ but not in libtool version 2. For more background information about
+ dynamic libraries and rpaths, see also the document with the title
+ "RpathIssue" on the Debian wiki (http://wiki.debian.org/RpathIssue).
+
+commit 8925c912d2639752a84bcffeef1b70a81026449b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 7 14:21:28 2011 +0200
+
+ CHANGES: agent: HOST-RESOURCES-MIB: Add missing brace in a debug statement
+
+commit 76ff25d9bf97579e7213102065fd5096f049a4c5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 7 14:13:18 2011 +0200
+
+ CHANGES: snmpd: HOST-RESOURCES-MIB::hrStorageTable: fix bug in handling large filesystems, where large means above 8 TB (= 2**31 * 4096 bytes).
+
+ This patch fixes a bug introduced in commit
+ 71d8293f387a6cd66bb0dbb13c0f50174d2e678b.
+ For the original bug report, see also
+ https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3419825&group_id=12694.
+
+commit 866033db9904ffb1203f283f838092e4cf68de6b
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Oct 6 07:33:27 2011 +0200
+
+ CHANGES: snmpd: Remove spurious #endif that seems to be the result of a mismerge.
+
+commit 20f4f3267ee20d55705b7a43789879c103f96620
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Oct 6 00:08:59 2011 +0200
+
+ CHANGES: building: Add missing end comments to feature ifndefs.
+
+commit e5de2cc57bf304f3320cad0034d2ea2d8aedc436
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 5 09:15:10 2011 +0200
+
+ CHANGES: agent: Log a more detailed error message if embedded perl initialization fails
+
+commit 5eef9990de28f63111e6c093be0f3c7ae2d513a1
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 5 08:45:49 2011 +0200
+
+ CHANGES: perl: Add agent::uptime()
+
+commit 6810ed42f9bc560750d6dbfb7e50b6e2ac11899c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 30 11:01:23 2011 +0200
+
+ CHANGES: Cywin: agent: Implement get_uptime() such that querying HOST-RESOURCES-MIB::hrSystemUptime returns a non-zero value.
+
+commit 97172b311d20f4441c7a7e90092b59c1e0da99f7
+Author: Thomas Jarosch <tjarosch@users.sourceforge.net>
+Date: Wed Oct 5 08:46:39 2011 +0200
+
+ CHANGES: PATCH: 3418649: HOST-RESOURCES-MIB: Use pclose() instead of fclose() to close a pipe.
+
+commit 6591937adb85000c27069c4be84cf4688838ebcd
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 16:18:03 2011 +0200
+
+ CHANGES: building: Add dependencies on @FEATURETARGS@ to make the subtarget work as well.
+
+commit b9c8012ec035bc084f175876fecc375195f9be81
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 14:02:58 2011 +0200
+
+ CHANGES: building: Add target to build agentxtrap from the toplevel
+
+commit 995647c0cfe00412262cc5797bdfae9d00b70c76
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 15:44:36 2011 +0200
+
+ CHANGES: building: Remove the use of -L flags for internal libraries as it confuses libtool.
+
+commit 93dc1235a0db58ffd29617cff00dc11263780202
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 11:31:46 2011 +0200
+
+ CHANGES: building: Make make apps work again
+
+ apps include snmptrapd and that require the agent libraries as well.
+
+commit ba41488ed44cd23c25963d4fc56c476853b2ab59
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 11:29:33 2011 +0200
+
+ CHANGES: building: When you say make libs you expect all the libs to be built.
+
+ This is demonstrated by the snmptrapd target at the top level which obviously
+ expected both libs to be built and so failed to compile before this patch.
+
+commit 3057c73e093473be46254bcdfb4ca788e432d1b8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Sep 30 07:32:52 2008 +0000
+
+ NEWS: building: PATCH: 2091156: correctly declare dependencies in Makefile.
+ 'make -j <N>' should work now.
+
+ Backport this to V5-4 as it is needed for correct operation in the single
+ threaded case of make miblib as well.
+
+commit 6eae340fa2a64086592982cc52735bc01487d978
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Oct 1 19:33:50 2011 +0200
+
+ CHANGES: building: Silence libbsd 0.3.0 nagging
+
+ If you have libbsd 0.3.0 installed then their version of nlist.h warns and
+ tries to make you include bsd/nlist.h instead. The problem is that we don't
+ need that compatibility library as we know how to do it ourself so it becomes
+ pure nagging. This patch adds a define that changes the warning into an
+ error and then figures out that there is no usable nlist.h and ignores it
+ for the future.
+
+commit ac38cb531bee50edc8d4c834f3005f5992c771d8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 19:03:02 2011 +0200
+
+ CHANGES: perl: Enable sending SNMPv2 traps with an empty varbind list
+
+commit a75de2971527ac2d2e812024298602bb2412f337
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 30 10:41:44 2011 +0200
+
+ perl/SNMP/SNMP.xs: Update emacs modeline
+
+commit 848f6300efe38492fb454451a030f0b7e6ff8c9d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 30 10:41:44 2011 +0200
+
+ perl/SNMP/SNMP.xs: Update emacs modeline
+
+commit c1374473ecd8ec9e0310013861ee18c83e5d6c5b
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Sep 30 03:29:36 2011 +0200
+
+ CHANGES: testing: Protect the use of $OSTYPE to ensure that 'test' get enough parameters.
+
+commit 7e97a20633a57eae39d015b23339463c32f5f848
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 10:22:08 2011 +0200
+
+ CHANGES: testing: Convert snmplib/test_binary_array.c into two unit tests
+
+commit 9c0dd98176457342fffaa5e74d802e3145ed70e7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 08:56:17 2011 +0200
+
+ CHANGES: testing: Add unit test for netsnmp_register_old_api()
+
+commit 5fd26e4fa3e000ea9c81c38ab975b7946efe2157
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Sep 28 17:49:55 2011 +0200
+
+ CHANGES: agent: Avoid that netsnmp_register_old_api() failure triggers a double free.
+
+ Fixes a regression introduced via commit
+ aa4d47c2609e52818c9cdf1a8e2205de9a335a0a (svn r19515).
+
+commit d2252d016693807326f72b66123649dea00af916
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 10:20:08 2011 +0200
+
+ CHANGES: testing: Require a semicolon after OK(), OKF() and PLAN()
+
+ Also, let OKF() emit a single line of output such that all output it
+ produces is visible in the output of "make test".
+
+commit 1421924b4852142192c5bb9e93ddbfed69e908fa
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Sep 21 22:20:08 2011 +0200
+
+ CHANGES: snmplib: Avoid waiting indefinitely if a session has timeout zero
+
+commit 5f27f4f74ae2bd5baf503cf306b4f9a2841a57cf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:32:03 2011 +0200
+
+ CHANGES: MinGW: testing: Fix a race condition in the test runner
+
+commit 09703958cc5ea845929ae19ef9e0804aecaa512e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 27 12:42:41 2011 +0200
+
+ CHANGES: testing: Avoid false negative for T114agentxagentxtrap_simple caused by the test result being present in the hex dump ("mostly_harmless")
+
+commit 439300279f6f31438638d2f222c24c3c841fa6ab
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 27 11:16:32 2011 +0200
+
+ CHANGES: building: Micro-optimize agent module dependency analysis
+
+ This makes the agent module dependency analysis carried out by the
+ configure script slightly faster, especially on those systems where
+ fork() is expensive (Cygwin).
+
+commit bbc680004a1376038dfdc4172dbe7b9e311fba68
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Sep 26 10:14:45 2011 +0200
+
+ CHANGES: MinGW: testing: Make test T130snmpv1vacmget_simple pass
+
+commit 70b06cf789208eaa890bfbcd638bdb775f817054
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 20 09:50:57 2011 +0000
+
+ CHANGES: Windows: testing: perl: Fix an incorrect message printed while running the Perl module regression tests
+
+commit 70bcc8de2d0fc92bbb8481823630fab9bc87af75
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 16 16:14:24 2011 +0200
+
+ CHANGES: MinGW: testing: Obtain the MSYS path from the environment
+
+commit 626275e2d1acafae7144a33ed301a40f596b37b0
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Sep 14 13:14:17 2011 +0200
+
+ CHANGES: Windows: Remove superfluous link libraries from project files (*.dsp)
+
+commit 38fc3caa9eeb3800254b4f6ad6f8f4764c0f83db
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 20 09:34:08 2011 +0200
+
+ CHANGES: snmplib: Make netsnmp_callback_accept() return -1 (failure) instead of 0 (STDIN_FILENO)
+
+commit 6c8c7e8aca8fc2eeb52010ae3e9fee6dd83ef780
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 13 09:58:26 2011 +0200
+
+ CHANGES: snmplib: Remove obsolete snmp_get_fd_for_session() declaration
+
+commit 0860d11fd8fc5dbdaaae2261fae2c07fb9c2c82d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 8 13:54:55 2011 +0200
+
+ CHANGES: Windows: MSVC: Avoid that the typedefs in <net-snmp/net-snmp-config.h> conflict with those in <stdint.h> from the msinttypes project
+
+commit f8a036f63ff68f083436120e0abd478b692a2f61
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 8 13:21:06 2011 +0200
+
+ CHANGES: Windows: MSVC: When linking with OpenSSL, link with user32.lib too
+
+commit 836a23e10ca810c3899902d32587616a9d1203df
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jul 14 18:38:13 2011 +0200
+
+ CHANGES: Windows: MSVC: Link with proper libeay32 library
+
+commit 7b07fd6cdef49ec7bb04b166e2a4fbb37b582840
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 11:10:38 2011 +0200
+
+ CHANGES: testing: Remove an incorrect comment from simple_eval_tools.sh
+
+commit 98f6d29d981ff8e607600c63dadb240535629807
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:49:03 2011 +0200
+
+ CHANGES: testing: Make ISDEFINED() check for an exact match instead of a prefix match
+
+commit 52cd0031a31f692f13263a94c335d06be1454803
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:12:59 2011 +0200
+
+ CHANGES: MinGW: testing: Make those regression tests pass for which SNMPCONFPATH and/or SNMP_PERSISTENT_DIR matter
+
+commit f5cd89bd3356dd74e1556c0b50966a643f192085
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:12:59 2011 +0200
+
+ CHANGES: MinGW: testing: Fix a race condition in the test framework
+
+commit deedd52c834a6448852a06785536e13865969694
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:12:58 2011 +0200
+
+ CHANGES: MinGW: Support the directory structure of recent Shining Light OpenSSL binary distributions
+
+commit d55bd4e0549f03b6fd32562c2aa7fe39272a9ef7
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Sep 28 06:55:19 2011 -0700
+
+ remove the v5.7 from the frozen list
+
+commit ac2aed3c94bb2ebb473af0a1e20f0561ad629956
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Sep 28 06:55:11 2011 -0700
+
+ remove the v5.7 from the frozen list
+
+commit 40079205967b8e5aeedb19fa3cb2e7b2f7988577
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Sep 27 21:53:47 2011 -0700
+
+ make depend
+
+commit cf14a228583aff3c5ab2f0d44c2f4c0fa5bd66af
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Sep 27 21:53:18 2011 -0700
+
+ version update for 5.7.1
+
+commit 1014dd8dfb48a5bd053f04541eb9728f0be07f47
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Sep 27 21:45:04 2011 -0700
+
+ version update for 5.7.1
+
+commit 18d116ba388c1dc949528884bb00698f1bacaa94
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Sep 27 21:11:52 2011 -0700
+
+ Version number update: 5.7.1
+
+commit 46eac02e9a27bf4f3068e795cab891f05a848870
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Sep 26 21:49:27 2011 +0200
+
+ CHANGES: snmpd: Avoid that snmpd crashes if started on a system with another OpenSSL library version than the one it has been built with.
+
+commit a5f064dd82996e2be3f1e9616703ad0395fb5aba
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Thu Sep 22 07:33:01 2011 -0700
+
+ version update for 5.7.1.rc3
+
+commit 569794fceb99eed7be817c64f85cd945caf99592
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Thu Sep 22 07:20:07 2011 -0700
+
+ Version number update: 5.7.1.rc3
+
+commit c55f608f16f160f5e79dc057f8878def462973e1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Sep 22 10:35:24 2011 +0100
+
+ Fix the code for populating the table_tdata cache,
+ and clarify areas needing MIB-specific additions.
+
+commit 13763cf2c71bf93fec096eee004857c15b2cffff
+Author: Steve Friedl <steve@unixwiz.net>
+Date: Thu Sep 22 10:06:45 2011 +0100
+
+ CHANGES: snmpd: 3409692: Calculate disk percentage usage via floating-point arithmetic
+ to avoid integer arithmetic errors.
+ (Code based on patch, rather than applied verbatim)
+
+commit ee0d3adb078291b743c9ecb76d20b591b7b15972
+Author: Steve Friedl <steve@unixwiz.net>
+Date: Thu Sep 22 09:58:39 2011 +0100
+
+ CHANGES: snmpd: 3409692: Calculate disk percentage usage via floating-point arithmetic
+ to avoid integer overflow errors.
+ (Code based on the submitted patch, rather than applied verbatim)
+
+commit 367da14fcdb146592de67c1d6997a09774259673
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 22 08:09:17 2011 +0200
+
+ The only change between V5.7.rc1 and V5.7.1.rc2 is the version number. Make this clear in the ChangeLog file.
+
+commit c276eeb8f0455a0870c4b478dde648e86529add3
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Sep 21 13:51:58 2011 -0700
+
+ changelog update
+
+commit 63050838666f645fc306dc2ee4f73f5efce63fed
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Sep 21 13:38:18 2011 -0700
+
+ Version number update: 5.7.1.rc2
+
+commit bbe2c19a01ecec024f741e2e54701ae6212f4c3e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Sep 4 14:44:38 2011 +0200
+
+ This should have gone only to master.
+
+ Revert "CHANGES: building: Correct dependencies - since bf74fea69f24dc6e85f908f3f41d1426b2e09688 snmpconf is located in builddir, not srcdir"
+
+ This reverts commit 9efa467a972bb6e1c7fbdaf2e27429d29f4ab89e.
+
+commit 9efa467a972bb6e1c7fbdaf2e27429d29f4ab89e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Sep 4 14:00:12 2011 +0200
+
+ CHANGES: building: Correct dependencies - since bf74fea69f24dc6e85f908f3f41d1426b2e09688 snmpconf is located in builddir, not srcdir
+
+commit 7835964d3593e5c6a1ae7de0b4114b7df1ae0fe1
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Aug 30 19:21:51 2011 -0700
+
+ version update for 5.7.1.rc1
+
+commit cb6a0c0bd6f8c2c7cd5fd86080dc6324e7f73858
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Aug 30 19:20:35 2011 -0700
+
+ make depend for 5.7.1.rc1
+
+commit e5ff2eb83bbbed92dac751c5a6643d78f837cf9c
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Aug 30 19:19:46 2011 -0700
+
+ fix C++ comment
+
+commit cb1f5cffc6fb52c2a6c0f7b408afeb47fcfe55e4
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Aug 30 19:09:56 2011 -0700
+
+ Version number update: 5.7.1.rc1
+
+commit 422b082a9593ca9c65aac449e6d128a9e97e94fb
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Aug 30 19:06:56 2011 -0700
+
+ added 7 as a rc series branch
+
+commit 71c0d7650493710631fa08d5dc4dad501a9aa771
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Aug 30 16:37:41 2011 -0700
+
+ deal properly with inverted error cases
+
+commit cf4cf7f32ad58f326ffed50494583231648d79d2
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Fri Aug 26 11:08:09 2011 -0700
+
+ added .ft and .ft.1 for feature files
+
+commit 41b2cde19d22209b483207614e027483c3706877
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Aug 30 11:03:15 2011 -0700
+
+ auto-determine patch arguments if possible for nspatchtry
+
+commit 96bb589c2e5054890e98705ab5f4308ae6a130bb
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Aug 30 10:13:06 2011 -0700
+
+ make it so the git commit line can be cut/paste without linebreaks
+
+commit 3fe36f7ad71c08e1286ce8e487e9352e27cd96cc
+Author: Ronald Wahl <rwa-co@users.sourceforge.net>
+Date: Tue Aug 30 10:12:11 2011 -0700
+
+ CHANGES: libnetsnmp: PATCH 3394586: from rwa-co: file descriptor leak in read_config (+fix)
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit 6e54c4131af731ff90467a75bcc817c957f8f72a
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Tue Aug 30 09:55:14 2011 -0700
+
+ describe that nsrollup needs to be run now.
+
+commit 86efee23432ccb0d2e0c736d34dc1051130cdc0f
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Aug 30 10:52:30 2011 +0100
+
+ Apparently IRIX has a different API for statfs
+
+commit f7e21f2633390b7a27c50227bee6d8696ae3fbcf
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Aug 29 16:01:31 2011 -0700
+
+ don't provide a feature when your a child of another feature
+
+commit cac23c0b2574e7280bd128c6226875ad0f6b4bfc
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Aug 28 09:38:14 2011 +0200
+
+ Make sure that feature-details.h exists before trying to include it
+
+commit 781f4ce2acb371560797d8b29a89ed0674e935f8
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Aug 28 09:36:36 2011 +0200
+
+ Use the feature target instead of the target when building the feature set
+
+commit 11bff472ca7b1fcff0c16187a1b8a13093bc91c4
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Mon Aug 29 00:33:55 2011 +0200
+
+ the irix6 build only defines irix6, not irix
+
+commit 3c73a1407a081d42ebdd91dfbcb1e4f152b7df4a
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Mon Aug 29 00:05:13 2011 +0200
+
+ re-add sockaddr_un.sun_path configure check (lost in previous commit)
+
+commit 2e3f02e03aed125384ba4fe3d83494d43f3a29e9
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Sun Aug 28 23:53:30 2011 +0200
+
+ agent/mibgroup/hardware/fsys/fsys_mntent.c doesn't build on IRIX yet
+
+commit f95aa31377d572b049b0b316dbb163bf7aca93d5
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Sun Aug 28 23:25:40 2011 +0200
+
+ CHANGES: building: build fix for systems lacking fields msg_control/msg_flags in struct msghdr (backport)
+
+commit 7f47d93765aa35a58687eb9b4f9f700e4343e13c
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Fri Aug 26 11:11:35 2011 -0700
+
+ added required features for mfd handling
+
+commit 9b2e42a6e0550fb789c607c3520880d4dbc0cf24
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Fri Aug 26 11:08:09 2011 -0700
+
+ added .ft and .ft.1 for feature files
+
+commit 33dcbf56fc0626a3e4f1359095bd217d1a567794
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Fri Aug 26 11:07:58 2011 -0700
+
+ no_write_support supported
+
+commit 97d42efd76937ce7e4bc48a72ed5a110e423102d
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Fri Aug 26 10:08:51 2011 -0700
+
+ handle no-write-support with ifdefs
+
+commit ea8bed79e81c42e33cbf37ca6f3c03c549987b22
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Thu Aug 25 06:56:22 2011 -0700
+
+ import stderr
+
+commit fd6d804dc3e703c4059dbe775001a3be9b93309f
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Thu Aug 25 06:55:38 2011 -0700
+
+ use >> to print to stderr
+
+commit cee0359c6fae2b85d7b931859e517d89ce0722bb
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Tue Aug 23 23:43:19 2011 +0200
+
+ CHANGES: build: Do not generate an output file on failure
+
+ make supposes that no output is generated if the command failed. Change
+ feature-remove to follow that presumption.
+
+commit fe39e7288ca930d2c9aaa8301cc9d95f0c38f36b
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Sun Aug 21 21:48:17 2011 +0200
+
+ Correct typo
+
+commit 1f082a31cd138f1f5e27be6d90a1d5790dc0ffe4
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Tue Aug 23 23:35:42 2011 +0200
+
+ make sure that _KERNEL is defined to 1 so that "#if _KERNEL" works on systems that need it (e.g. IRIX)
+
+commit 26bb2470c106f834442a2adbc7611bf16657fbdf
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Tue Aug 23 23:22:44 2011 +0200
+
+ make sure that _KERNEL is defined to 1 so that "#if _KERNEL" works on systems that need it (e.g. IRIX)
+
+commit fc5560c05f848321da0ca0c2e87001d5f2295167
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Mon Aug 22 18:54:30 2011 +0200
+
+ CHANGES: building: build fix for systems lacking field msg_flags in struct msghdr (e.g. IRIX)
+
+commit 96ea2d1a8ebffb348673a865d486f31e635e62bd
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Sun Aug 21 01:51:49 2011 +0200
+
+ autoreconf
+
+commit 1a2648eaf71cb018951596689c51588dca8063c5
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Sun Aug 21 01:48:57 2011 +0200
+
+ autoreconf
+
+commit 3f2f61b0e613d6105ecf2ceb395de0bde37f3ce3
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Sun Aug 21 01:47:13 2011 +0200
+
+ autoreconf
+
+commit b62cb0864f577ba85573d0d250d12a39387c07b4
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Sun Aug 21 00:55:33 2011 +0200
+
+ CHANGES: aix: eliminate configure warning regarding libperfstat.h on AIX 6.1 and up
+
+commit 71b90b6f217944b4ffc1836e5160d40e33b4423d
+Author: Thomas Anders <tanders@users.sourceforge.net>
+Date: Sun Aug 21 00:40:28 2011 +0200
+
+ fix broken line wrap
+
+commit 5b5900a4f7dfee6e1ec869e32310b80ca6fb23fe
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Thu Aug 18 12:28:07 2011 -0700
+
+ version update for 5.7.1.pre2
+
+commit 3b7e2e39949f88d9c56ed5f994028b94816ab75c
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Thu Aug 18 12:23:28 2011 -0700
+
+ make depend for 5.7.1.pre2
+
+commit ece63bfe499c630bdaae6200648d29180ce3a179
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Thu Aug 18 12:03:17 2011 -0700
+
+ Version number update: 5.7.1.pre2
+
+commit 28b54070514753e8d8abb718b224d657ab7a8ab8
+Author: Garrett Cooper <yaberauneya@users.sourceforge.net>
+Date: Thu Aug 18 11:49:56 2011 -0700
+
+ CHANGES: BSD: PATCH 3383965: from yaberauneya: Fix if-mib agent compile warnings on *BSD
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit f73e6364bb34070622e9f4488cd0487d2fb7402a
+Author: Vladimir Kondratiev <wulf2001@users.sourceforge.net>
+Date: Thu Aug 18 11:45:29 2011 -0700
+
+ CHANGES: agent: PATCH 3389228: from wulf2001: incomplete commit (patch 3386633: fix integer overflow)
+
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+commit e6cf8206f0c67650001e34b526b37f64e4a5929c
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Thu Aug 18 09:46:33 2011 -0700
+
+ Patch from Claus Klein on -coders for fixing man page typos
+
+commit 6a841d56518a727196e66b59e7e5b3304f54b0a1
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Thu Aug 18 08:31:06 2011 -0700
+
+ changed clientaddr so it registers as pre-mib to be picked up before the transports get created
+
+commit c02131e5b35d296755baec99bd363205a86307dd
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Aug 17 09:34:00 2011 -0700
+
+ detect really old versions of Long.pm
+
+commit 500d6de06aa4ff330aee4d749a4cc377bec89e09
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Aug 17 18:11:47 2011 +0200
+
+ Fix the log message that reports that gethostbyaddr() is missing
+
+commit 6580556cc7bd833af731b62ce1ed2017564fe7eb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Aug 17 18:08:01 2011 +0200
+
+ CHANGES: Windows: snmptrapd: Make the IP address to hostname conversion work
+
+commit 3cb3f1ede388d84e392e1d815d5994a4bf0f10f9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sun Aug 14 07:59:25 2011 +0200
+
+ Windows, build.bat: Restore original build and install order. Apparently the correct netsnmp.dll is used during the Perl tests by setting PATH properly.
+
+ This reverts commit c1b5a030d8f04876cd5b9af008c879cc468b212f.
+
+commit daff49d9b3369efcc87f05dc8591362e81a45fdf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 18:43:48 2011 +0200
+
+ Windows: Make the Perl agent module work again with the original SNMP_FREE() definition.
+
+commit 3c73b4838e605b150bc317313f14eb33444729f8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 17:38:27 2011 +0200
+
+ Revert the two most recent SNMP_FREE() changes (commits 47c8ef1b89c6ccb4247d9633477925908c68c1a5 and 7f42d0d93320484152271427cc9808cbda49bbd0).
+
+commit 3e50c3e00e9f321fb708bc579eb4dc1a0f1e7c4d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 11:31:40 2011 +0200
+
+ CHANGES: snmpd: pass_persist: Fixes a race condition introduced in commit 31fa07cd9ffde46d41d2b5838c3fc4d01548bfb5.
+
+ The following race condition could happen:
+ - A system call fails and errno is set accordingly by the C library.
+ - SIGCHLD handler invokes a system call that fails and hence overwrites errno.
+ - SIGCHLD handler leaves.
+ - original context checks errno and finds the value from the system call invoked
+ by the SIGCHLD handler instead of the system call that failed originally.
+
+ Other fixes included in this patch:
+ - Renamed deinit_pass_persist() into shutdown_pass_persist() such that this
+ function gets called during agent shutdown.
+ - Made sure that shutdown_pass_persist() is called by the Windows snmpd.exe too.
+ - Windows: avoid calling CloseHandle(INVALID_HANDLE_VALUE).
+ - Windows: avoid that closing a pass_persist pipe triggers a crash.
+ - Windows: pass_persist: close handles of finished processes.
+
+ Conflicts:
+
+ agent/mibgroup/ucd-snmp/pass_persist.c
+ win32/mib_module_shutdown.h
+
+commit e147e4b96755207de1ce30990d67b4b7c76dd483
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:39:14 2011 +0200
+
+ Unbreak the Windows build. This is a follow-up for commit 1e1000a8815921b5ec2e7997b53592a544b3dfc2.
+
+commit c1b5a030d8f04876cd5b9af008c879cc468b212f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:10:33 2011 +0200
+
+ CHANGES: Windows: building (build.bat): Install netsnmp.dll before running the Perl regression tests such that the regression tests are run with the correct version of netsnmp.dll.
+
+commit 1e9d2003baed227f68b68528f1e97e6f5ea86c1a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:10:33 2011 +0200
+
+ CHANGES: Windows: perl (build.bat): When installing development files, install the PDB files too.
+
+commit a8d94007e32d03710692c8f1b417d5bdfe3650fa
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:10:32 2011 +0200
+
+ CHANGES: testing: Fix Perl regression test failures
+
+ All Perl regression tests pass now on Linux and on Windows (MSVC).
+
+commit b6d0b490181c6df8c11ecf155f1e6eaf11b1ec58
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:10:33 2011 +0200
+
+ CHANGES: testing: Perl regression tests: Don't fail skipped tests.
+
+commit ca3acf2b07039d96a117f090f7ec76b6e8b541e9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:10:32 2011 +0200
+
+ CHANGES: perl: Add SNMP::getenv() and SNMP::setenv().
+
+commit 56759e5ad537f01b4a51e7ff9994ec4b55c32135
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:14:46 2011 +0200
+
+ CHANGES: snmplib: Add netsnmp_setenv().
+
+commit 9843e5bcf472877e85b031b5e5dafaa9d5fc63c5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:10:32 2011 +0200
+
+ local/pass_persisttest: document how to use on Windows
+
+commit 6057866b73a022771e90e9967dd25bdc7192fbdc
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:10:32 2011 +0200
+
+ Set execute flag on local/pass_persisttest such that the instructions in that file work
+
+commit c2daf5940f21a13e8989dd055b17f3181112f856
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Aug 13 08:10:32 2011 +0200
+
+ .gitignore: Fix a suppression pattern
+
+commit 1f0a928a2913cfa7f5ceaaf4696c69fbdc687621
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Fri Aug 12 09:09:11 2011 -0700
+
+ added the missing -e option to the createUser docs
+
+commit 1e1000a8815921b5ec2e7997b53592a544b3dfc2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Aug 11 15:46:32 2011 +0200
+
+ CHANGES: MinGW: Net-SNMP Perl modules build again.
+
+commit 97d6432f95e1cdcf6fd85e7ca1d0c5557eb6d919
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Aug 11 18:16:44 2011 +0200
+
+ CHANGES: Windows: perl: Make sure that the constant SNMP_DEFAULT_RETRIES is recognized.
+
+ CHANGES: perl: SNMP module: Add constants NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE and NETSNMP_CALLBACK_OP_TIMED_OUT.
+
+ When the Net-SNMP Perl modules are built on Windows with MSVC or MinGW it
+ is possible that each these are linked with another version of the MSVC
+ runtime library than the Perl interpreter itself. In that case the "errno"
+ variable used inside .xs source files is another variable than the $! variable
+ in .pm files. Or: assignments to "errno" in a .xs file do not modify the "$!"
+ Perl variable This patch avoids using "errno" by modifying the different
+ constant() functions such that these return a two-element array instead of
+ returning a scalar and setting errno.
+
+commit 7690894b7b8464f05c7c902bd7cf751cc269977a
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Aug 10 09:26:37 2011 -0700
+
+ don't assert on a double init; just don't do it twice
+
+commit 47c8ef1b89c6ccb4247d9633477925908c68c1a5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Aug 10 16:44:36 2011 +0200
+
+ SNMP_FREE(): cast argument to (void *) before passing it to netsnmp_free()
+
+commit 0220392d899a9cab701f74af12030bb1d4cc5e2e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jul 1 13:02:15 2011 +0200
+
+ .gitignore: Ignore *.exe files generated by the Win32 build
+
+commit 0344df92e462f3bec994608c3381fca5348abcdb
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Aug 8 15:12:55 2011 -0700
+
+ fix C++ comments
+
+commit 09a661d5dc60c730fe0384b02ed672830ef74e30
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Aug 8 15:12:55 2011 -0700
+
+ fix C++ comments
+
+commit 69cb42a4ea0583ce6f5ff8f8383516d34bc4c344
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Aug 8 15:12:55 2011 -0700
+
+ fix C++ comments
+
+commit 447ddc66d90dd9e5c3105b268b6a63bfc580b924
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Aug 8 22:03:58 2011 +0100
+
+ Define _BIND_TO_CURRENT_VCLIBS_VERSION token
+ (as per Alex' build instructions)
+
+commit b0a62eb19763ab4f0b776430242a6117ccae5dd3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Aug 8 21:59:17 2011 +0100
+
+ Define _BIND_TO_CURRENT_VCLIBS_VERSION token
+ (as per Alex' build instructions)
+
+----------------------------------------------------------------------
+
+Changes: V5.7.1 -> V5.7.2.pre1
+
+commit 810185ae0b0cd2ad4d424a1ba775ef5ceaf50f03
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 09:24:19 2012 -0700
+
+ make depend for 5.7.2.pre1
+
+commit 6271471e01282f3675724eaf1358ceb0e95ddd4e
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 08:32:40 2012 -0700
+
+ Version number update: 5.7.2.pre1
+
+commit fcb782aa8893134c7414a926d9268594f725b915
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 08:32:18 2012 -0700
+
+ version update for 5.7.2.pre1
+
+commit e3bcd87c72fcea7706e868b5ace75296093f7497
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 14:09:42 2012 +0100
+
+ Fix dist/release format
+
+commit d813ce2eeefc68229cfcaf20603244cdd6d09d3c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 14:07:52 2012 +0100
+
+ Fix dist/release format
+
+commit fa7bd581e3783685db39c9b4eaf847be5ac86fd3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:53:10 2012 +0100
+
+ version update for 5.6.2.rc2
+
+commit 0739e2382d31146aca3205244cf70788b40a428d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:51:45 2012 +0100
+
+ version update for 5.6.2.rc2
+
+commit d9a15445aa74f5316bfc711c1558467872c2958c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:50:12 2012 +0100
+
+ make depend for 5.6.2.rc2
+
+commit bcabd2c9542dbebd1d319b4494413bdcca06614e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:38:38 2012 +0100
+
+ Release Candidate for V5-6-patches
+
+commit b473898c0c5ac9eb47c7c05a3f745e4ff2a76aaa
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:38:28 2012 +0100
+
+ Version number update: 5.6.2.rc2
+
+commit 131429e7062fbaa65b82affed1fb92df2c0cc813
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:38:38 2012 +0100
+
+ Release Candidate for V5-6-patches
+
+commit 1c8110b33b8105ca6190945a35fe7ae903252d68
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:21:38 2012 +0100
+
+ Avoid perl versioning problems when setting up the build environment
+
+commit 508ece16e6f6f49562da204792ae0644269994d1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:20:58 2012 +0100
+
+ Fix handling of dist/release merge
+
+commit 5b8a8547b1a47d2f5b207f48f2496e4241d902c6
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 11:10:48 2012 +0100
+
+ version update for 5.5.2.rc2
+
+commit 6c32914bf28d695df349dca269e488b501700316
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 11:07:22 2012 +0100
+
+ version update for 5.5.2.rc2
+
+commit 9f5a82a5afdbb3daeb2fd437a309f0b8d357cf4b
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 11:05:39 2012 +0100
+
+ make depend for 5.5.2.rc2
+
+commit 39203f29477a3bedf012d41135d8abd6bcad08b1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:54:27 2012 +0100
+
+ documentation update for 5.5.2.rc2
+
+commit 17e79ef0fad79609c5ba2feb4e8b9eb5d7db6886
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:46:11 2012 +0100
+
+ Release Candidate for V5-5-patches
+
+commit 5821be5bbb4018ded282fbbbd4830cf2eeadd9e1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:45:59 2012 +0100
+
+ Version number update: 5.5.2.rc2
+
+commit 3f2111de6733a04e12d910d306a34d671e008762
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:46:11 2012 +0100
+
+ Release Candidate for V5-5-patches
+
+commit ccf8ff2c4db60122d41302e4aeb700e0b868105f
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 28 10:18:43 2012 +0100
+
+ CHANGES: snmplib: PATCHES: 3526599: Don't hang on retried failing SNMPv3 responses
+
+commit c81c8483990911f47435d3005255d91c37ab92b2
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun May 27 14:09:26 2012 +0200
+
+ Fix BSD that downnot always like IP_SENDSRCADDR - so retry without
+
+commit ffce1f2dc2f8b31abd01f93b26da78f4726a1e64
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun May 27 14:03:58 2012 +0200
+
+ Fix OS missing MSG_DONTWAIT (AIX). Backport from 5.7
+
+commit c575216850185b56454dad0253e3164979e13513
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun May 27 13:56:01 2012 +0200
+
+ Fix missing include. Fixes SIGSEGV on FreeBSD9 x64
+
+commit 5805878749c08062debf0a9d798d08fb916caa2d
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun May 27 06:23:19 2012 +0200
+
+ CHANGES: snmpd: Add missing debug tag
+
+commit d1a42bbcc7b14730c9a6d99c4f047097843a549b
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri May 25 09:02:27 2012 +0200
+
+ CHANGES: building: Run libtool --mode=finish on the right directory
+
+commit 1fbf33711a19eac9739ad23f6f6251eacc41f1c4
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue May 22 14:54:45 2012 +0100
+
+ CHANGES: Linux: PATCH: 3525998: Don't use an uninitialised value in error message
+
+commit 32c1686b67dc85c4a189576363065609dfed5e61
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue May 22 14:52:56 2012 +0100
+
+ Attempt to mark release-candidate branches as such.
+ Omit final-release-only steps when preparing preN/rcN releases
+ (Relies on a tweak to the Makerelease perl modules)
+
+commit 4c5633f1603e4bd03ed05c37d782ec8911759c47
+Author: Robert Story <rstory@freesnmp.com>
+Date: Mon May 14 11:40:06 2012 -0400
+
+ NEWS: snmp: BUG: 3526549: CVE-2012-2141 Array index error leading to crash
+
+commit 65dd83c2255ee58edbf0e25863e55b58a4113679
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 20:30:42 2012 +0100
+
+ version update for 5.6.2.rc1
+
+commit ac4bc65e2909f3bd85f32f04b504fa65d2f64553
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 20:28:06 2012 +0100
+
+ make depend for 5.6.2.rc1
+
+commit b74994864195119edb6e19c85147fac00bcb93e3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 20:13:46 2012 +0100
+
+ Version number update: 5.6.2.rc1
+
+commit 91350092c46e66d06d74143f4816473db4d25160
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 19:56:33 2012 +0100
+
+ Mark version-specific changes _before_ pushing to central repository
+
+commit 7241accd70b82d0fcd44d5a5238b2ee9445900db
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:53:17 2012 +0100
+
+ version update for 5.5.2.rc1
+
+commit 7c796a15a1d1bb85feea940bd4e3516877920919
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:50:49 2012 +0100
+
+ version update for 5.5.2.rc1
+
+commit 07e268bfb64b0ec645b3f7e87266984f9217cf12
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:44:37 2012 +0100
+
+ make depend for 5.5.2.rc1
+
+commit 16eaaf6c3ba14596ca9efaf4b114f1b709f42b68
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:29:03 2012 +0100
+
+ documentation update for 5.5.2.rc1
+
+commit c729469ef12154930cf9d15967e16186fb445f30
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:27:20 2012 +0100
+
+ Version number update: 5.5.2.rc1
+
+commit 142571d3cea08f0c072d24c1d39a43c7446f8ce7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:01:03 2012 +0100
+
+ When building a new release, the installed version of the perl
+ modules may well be different to the version being built.
+ That should not break the build.
+
+commit eba86b6f7aff261ee0e61334df70de7156e5c3cb
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:01:03 2012 +0100
+
+ When building a new release, the installed version of the perl
+ modules may well be different to the version being built.
+ That should not break the build.
+
+commit 5c0f64d6db2b593f7cc0ed2d4f55b7c592b774a8
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:25:15 2012 +0200
+
+ Only output cpu warnings once.
+
+commit ee58e4827b9fa16e6635ca003e8a4f11dcb5fb7a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:17:42 2012 +0200
+
+ Fix speling in errormessage.
+
+commit 03f485df22f20e149cfae94c57cb82feecb5d74b
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:12:11 2012 +0200
+
+ Not all Linuxes use rpm (debian/ubuntu comes to mind)
+
+commit 930838224f781696bd35225f22569347416f1b16
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:10:15 2012 +0200
+
+ Check need for -lm to use round/exp
+
+commit a0609cf1f3a6917d263725732248cd937a45ad94
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Apr 7 08:40:44 2012 +0200
+
+ Remove limitation on configuration line length.
+
+commit 305973338a63ae54c5e02a8626fbe9a8064dcb7e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Apr 7 00:32:19 2012 +0200
+
+ Reduce variable scopes.
+
+commit ccab4e9d3ed424c39d0dc27be63fa76c7461ea81
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Apr 7 00:15:22 2012 +0200
+
+ Internalize the name and line number of the curret configuration file
+
+commit cf874ad7b9daf4fcc0d46cdd034474b478005341
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Apr 6 21:47:28 2012 +0200
+
+ Replace #if (A) B #else B #endif with B.
+
+commit ef9ea641bc290eec50685b60519b31bee8b14a69
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 9 21:04:06 2012 +0100
+
+ version update for 5.6.2.pre2
+
+commit 35aba1959de119f1fb89203c37109aa6f0e21c57
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 9 21:00:40 2012 +0100
+
+ version update for 5.6.2.pre2
+
+commit e41fbaff18ac9095cf4a739a06ec39a1a6ccfdc1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 9 20:35:35 2012 +0100
+
+ Version number update: 5.6.2.pre2
+
+commit 137fe582d6cc5611430dab46ef144efd84cfc803
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Apr 6 20:46:56 2012 +0100
+
+ Revert commit 1f4a829b18275e4956ca91e5ec370df015f06133
+ (snmp_store_needed() API is not available in 5.[45].x)
+
+commit 2b7e64288c01a8a062026c521ca31a5e885f30cc
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 16:12:12 2012 +0100
+
+ FreeBSD-9: Fix for 'const'ifyed nlist arguments
+ Backport of ed65eca6e7f9cfa7380a78d56c01ed314745b169 from V5-6-patches
+
+commit 7e95d80b698051259645c074a53ffd264a6fa916
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 16:06:56 2012 +0100
+
+ FreeBSD-9: Fix for 'const'ifyed nlist arguments
+ Backport of ed65eca6e7f9cfa7380a78d56c01ed314745b169 from V5-6-patches
+
+commit 1a9b7b7c02e2deefe994d595a7cc1dd2ffbeee1d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 15:51:20 2012 +0100
+
+ Fix compilation on FreeBSD 9.x with 'recent' header shuffling
+ Backport of c53d8c3525f590f2213d35b0da94123862f3e366 from V5-5-patches
+ (Patch #3363308 - omitting tweaks to configure)
+
+commit 3d9ddb41e263bc1a78f9f9440b8d4ad4f86c82e1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 10:36:18 2012 +0100
+
+ Fix typo
+ Backport of 5b702b024b60176d7f5699b92e55da50a8deae71 from V5-6-patches
+
+commit 0d35c609564b66a1ffe81556d37adf0503c389ce
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 10:15:08 2012 +0100
+
+ Provide missing definition of NETSNMP_PRIo
+ (used in agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c)
+
+commit a79141a419953d010a6989e8b88f4df127394d38
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 09:19:26 2012 +0100
+
+ Header fiddling for FreeBSD,OpenBSD,Dragonfly
+ Backport of f7b0de1518002c6e8f9b94ef3deb8882e1e9338e from V5-7-patches
+
+commit adf74bf753d3970357afd633803256241d9c7b87
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 08:20:46 2012 +0100
+
+ Fix IPv6 TCP & UDP tables, *BSD support (including OpenBSD)
+ Backport of commits 5cd1573625471c0583e9087aec6802b77157d5a2
+ and 50d73f0d56fe22c590530b3e305d41dcdac3ce00 from V5-6-patches
+
+commit d9555acb9f47c3aa8fde4bc20a44d7ca6181a8a9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sun Mar 25 18:48:12 2012 +0000
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Avoid dangling pointers (based on patch 3503259)
+
+commit 82a8b47ee96e5d29a2b7ac3ca00722d737d5b479
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Mar 29 22:31:56 2012 +0200
+
+ Running autoheader / autoconf
+
+commit 9ca8d939ab393306a1d0f146c9cb70ea0cb19d49
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Mar 29 22:30:38 2012 +0200
+
+ Running autoheader / autoconf
+
+commit cecd4869deb68f3d4c71e768d5b40dd576446925
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Mar 29 22:29:31 2012 +0200
+
+ Running autoheader / autoconf
+
+commit a1a4513bd3e4e614200f6db5a02f61d6c8eefb32
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 28 09:47:45 2012 +0100
+
+ Doxygen-style documentation fixes (backport of git commit c09903a42e9d97331fd9e48ee831a85afdf9c70a)
+
+commit 9bdbcca122c37da304fc6aa6939729475f90f5fd
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 28 09:30:49 2012 +0100
+
+ Doxygen-style documentation fixes (back-port of GIT commit c09903a42e9d97331fd9e48ee831a85afdf9c70a)
+
+commit 1f4a829b18275e4956ca91e5ec370df015f06133
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 27 21:41:24 2012 +0100
+
+ CHANGES: snmpd: PATCHES: 3495697: Store persistent snmpTarget table changes
+
+commit 1f75f377d0db01754c0c161dc44373081beef520
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 27 21:14:06 2012 +0100
+
+ CHANGES: FreeBSD: PATCHES: 3489387: Install FreeBSD 10 header file (plus other missing versions)
+
+commit 3d72c9e78f2ad817c9d1d82977327bbb20d63ab9
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 27 21:06:31 2012 +0100
+
+ CHANGES: snmpd: PATCH: 3487867: Don't skip missing ifXTable entries (ifConnectorPresent FALSE)
+
+commit 12906578ab30cf776d080c0ef3025b30334d7655
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 16:17:45 2012 +0200
+
+ DISMAN-PING-MIB: Fix even more memory leaks
+
+commit ccfd5ca6fe10313d6181d24bbb1797825a97da10
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 15:51:16 2012 +0200
+
+ DISMAN-PING-MIB: Eliminate duplicate code
+
+commit 9fda2668722f08ddbfdd67a2239d8b021db64a83
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 15:48:46 2012 +0200
+
+ DISMAN-PING-MIB: Write a loop as a loop
+
+commit cbc18eb763ba6df69ef70668a54d75bf35e79503
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 15:24:08 2012 +0200
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix more memory leaks
+
+commit c7725192478aec018fb4aefa60946e04a406c00c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 13:43:24 2012 +0200
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Avoid reading freed memory when deleting a row from a table
+
+commit a6be739566f310d7441fd7f54989e39446f7a143
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 13:42:28 2012 +0200
+
+ Extend DISMAN-PING-MIB test
+
+commit 8a9b57291453cb8aec28e766c594701ed19c4fc6
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 26 21:03:41 2012 +0200
+
+ Fix for DragonFly 3
+
+commit e5c9a32f79eac2e85527c9cf05087cdae9b35a6c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 26 20:59:53 2012 +0200
+
+ DragonFly needs _KERNEL_STRUCTURES to compile ipv6 code
+
+commit cd43bc09a39bd97ff5e719a2ce232ce424600a65
+Author: David Imhoff <dimhoff@users.sourceforge.net>
+Date: Sat Mar 24 15:47:17 2012 +0100
+
+ CHANGES: snmplib: PATCH 3510454: Allow the use of 0.0.0.0/0 as alias for default
+
+commit e2fc15f9e5a6e3e36be5f489601cbf6bf731917f
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 24 15:21:38 2012 +0100
+
+ Fix TCP state values for DragonFly
+
+commit 432fe3ddf54f2c98f936959469cb9b014d599f06
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 24 15:10:52 2012 +0100
+
+ Require perl to do pass_persist test
+
+commit 37d2770cf50c98023eeba90e25d372bff7316ada
+Author: Niels Baggesen <nba@user.sourceforge.net>
+Date: Sat Mar 24 15:06:40 2012 +0100
+
+ Fix TCP state values for DragonFly
+
+commit 86a948d8691e881d55591dcabddc2739ce72b30e
+Author: Niels Baggesen <nba@nba-linux.sb.statsbiblioteket.dk>
+Date: Sat Mar 24 15:01:37 2012 +0100
+
+ Properly find pass helpers for testing.
+
+commit fe26a3c4f29f046bf65ed52e9d94054b675fbc4b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Mar 22 09:04:42 2012 +0100
+
+ DISMAN-PING-MIB: Limit source code lines to 80 columns
+
+commit 745bafcdcc9c8e84616d4e274db2a384bf234da2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Mar 22 08:55:05 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Make ping implementation independent of ntpd clock jumps
+
+commit da6925e6763cadbe02f4a8bbfe68a362e535ad5e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 10:38:36 2012 +0100
+
+ CHANGES: testing: Add testing/fulltests/default/T154dismanpingmib_simple
+
+commit fa606dd7ca6aff9308d4e8b01bbcde148f441271
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 16:49:21 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Make pinging local interface addresses work
+
+commit 617a83ba799575c84c66f6b1c480ef633161a64c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 16:28:46 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix a socket leak triggered by pinging a remote host
+
+commit 625f55c272ec6281e38d8e30eb53fd51516b00ae
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Mar 22 09:54:55 2012 +0100
+
+ DISMAN-PING-MIB: Convert a dynamically allocated variable into a stack variable
+
+commit b48f19ad4b4aa68c3e16e2a72df37b9c0cd36c4a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 16:24:07 2012 +0100
+
+ DISMAN-PING-MIB: Add more debugging statements
+
+commit d74cb3966175892562f5e3a9b1683acba2c22e07
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 11:45:18 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix several memory leaks
+
+commit 0b1a77674678cc9a15be3e7700d3cef650ed02c7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 12:00:30 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Do not send the contents of the stack over the network
+
+commit 139023cd3ab51631cc10e2866d71abcf99ae4c1b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Mar 21 08:56:07 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Don't call exit() upon memory allocation failure
+
+commit 169b6aaa7b61827cc1ad0b3aeeae3a7229dd25d8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Mar 21 08:53:26 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix IPv6 socket leak in error paths
+
+commit a0be32ad053a71fa96134d55e542bb07d4f0297d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 11:43:46 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Avoid that host name resolution failure causes a crash
+
+commit bf9bff64556787d766ee2ef2d578afb920719f3a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Mar 21 08:51:55 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Convert printf() statements into snmp_log() and DEBUGMSG()-statements.
+
+commit 5d74c01245523a9d8db1eda27d1efae2ebc104fb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:40:02 2012 +0100
+
+ New MIB: VRRPV3-MIB
+
+commit 5b38f062b99b6ef36708e2c7de4965a3192612e9
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:34:48 2012 +0100
+
+ For safety, sizeof the right variable in memcpy
+
+commit e5f82782da05efa7c0e6dc2bf5a41ee11868f469
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:33:21 2012 +0100
+
+ Fix for hrSWRun data for FreeBSD
+
+commit 8327565e823270d10a4504568edbe5b5ae323a55
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:31:54 2012 +0100
+
+ Clean up variables for OpenBSD/NetBSD
+
+commit 170f6f027bf4f9174b7073530da4d07f400bba58
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:28:58 2012 +0100
+
+ Move declarations in front of statements
+
+commit dbb4573b69fae85cdc931b2892b5ce4e5b16b321
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:23:36 2012 +0100
+
+ Require kernel_netbsd for NetBSD6
+
+commit f11681f15aad7d9a52fa29812ecbb507f1b7fe24
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 21 12:36:38 2012 +0000
+
+ Check for old tarballs (and unpacked distributions) before starting.
+ These can confuse steps such as "make dependcheck", that do a 'find'
+ on the current tree, and would descend into such unpacked source trees.
+
+commit 470dcd4b6c3ff11ff0a3532a7340a56cffd69098
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 21 12:32:13 2012 +0000
+
+ Don't run "make docs; make mancp" if there's no Makefile present
+
+commit c9ac420343e16df2b7065f5bf2790df44e247fba
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 20 10:26:10 2012 +0000
+
+ Allow distribution as part of normal Net-SNMP packages.
+
+commit 5999f60c57723f23f3c254af57fdb10af301a8eb
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Mar 18 19:03:08 2012 +0100
+
+ Regenerate
+
+commit 275d204036a607e3df50e8447d4bc755e9db02fd
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Aug 28 21:29:03 2011 +0200
+
+ CHANGES: building: Make it possible to use --disable-applications/--disable-agent together with --enable-minimalist
+
+commit bdccc875710295aacf50f71eb1c1d2ee97f336fe
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Mar 16 20:10:58 2012 +0100
+
+ Do not declare the local variables for opaque_special_types unless that option is set.
+
+commit b80a67da052adca1b5a644db83a782e15c2237c3
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Mar 16 19:50:03 2012 +0100
+
+ Check that the data exist before trying to read it
+
+commit efae86bba5962491d42b77b935191a3eb25dd939
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Mar 14 01:05:33 2012 +0100
+
+ Partially revert "Merge remote branch 'origin/V5-7-patches' into V5-7-patches"
+
+ Commit d35a1860217e723e4f866dd98ef6621665934c4a accidentally reverted
+
+ 4a2e5bcd56cd2afb36eb15d754e2fee888dd50c0 (hrh_storage is a proper replacement for hr_storage)
+ 0dd1e54557d1ba498b55d017b0a93e8ccf9bd522 (CHANGES: snmpd: UDP-MIB: Report the proper address in udpLocalAddress)
+ 5116d48378ecf03e722f3010ad47bf22a3fbcb8c (Reduce scope of prefix_val such that the compiler doesn't warn about an unsed variable)
+ 10f566f4d4cbb3e205023c23669289e4bfd089cb (perl/SNMP/SNMP.xs: Fix a compiler warning)
+
+ and part of
+
+ 6e74d64f85a59d50e461db4c34ac76f9de468bfb (Avoid using grep options -q and -w because grep in Solaris)
+
+ This reverts those reverts.
+
+commit aaedd59cc2da701527dc2d261d4e9f85f16e7504
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Mar 11 20:57:38 2012 +0100
+
+ Allow make test where the source path contains the string Net-SNMP to succeed.
+
+commit 4b94d796918a4eeae68ab21aa53d444a8b5c2921
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Mar 9 08:04:59 2012 +0100
+
+ Unbreak compilation on FreeBSD 4
+
+commit 10fe6b83324ad37d18b937cc8c6de94de534d035
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 8 13:04:07 2012 +0000
+
+ version update for 5.6.2.pre1
+
+commit e1122edc1a5fe7976b065044134d39e7db5985ea
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 8 12:43:19 2012 +0000
+
+ version update for 5.6.2.pre1
+
+commit a613d3a834912206d1ba5971e441a3ea6b36af23
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 8 12:33:03 2012 +0000
+
+ make depend for 5.6.2.pre1
+
+commit 0ef34e6519dfcb82c97df8427547c08dcf81e69a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Mar 8 10:11:30 2012 +0100
+
+ CHANGES: snmpd: Fixed snmpd '-d' option.
+
+ Now it dumps packets again.
+
+commit 8e69742f143e4fc11196e5b2ed66c8f7f53fd02f
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 6 09:24:21 2012 +0000
+
+ Version number update: 5.6.2.pre1
+
+commit c4e00b8c3e1010cdcab5e6c02d60d75df9c6dcf2
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 6 09:24:05 2012 +0000
+
+ version update for 5.6.2.pre1
+
+commit 39490104a3ab58235aace2f9d871c266dc4485ee
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit 4a2e5bcd56cd2afb36eb15d754e2fee888dd50c0
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 5 20:59:38 2012 +0100
+
+ hrh_storage is a proper replacement for hr_storage
+
+commit ce85832932ccd916c42319114c40885a466a9d0e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 5 20:56:40 2012 +0100
+
+ More fixes for Solaris sh
+
+commit 0dd1e54557d1ba498b55d017b0a93e8ccf9bd522
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 15:08:26 2012 +0100
+
+ CHANGES: snmpd: UDP-MIB: Report the proper address in udpLocalAddress instead of 0.0.0.0. Makes test T160snmpnetstat pass again. Fixes a bug introduced in commit c76fb96f65e33ba2fd212a921e8c386155ee5c7a.
+
+commit 518917e9f39f7a9d3c3bf3a865e8ac0e3026d600
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 14:04:54 2012 +0100
+
+ snmplib/snmpUDPDomain.c: Fix source code indentation
+
+commit 2651909ccceabfcfadaf942c02450e28fe837dc9
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Tue Nov 9 12:04:04 2010 +0000
+
+ Passes now on MinGW too.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19653 06827809-a52a-0410-b366-d66718629ded
+
+commit e41f115e40304c941ba17d67e24710722d90741b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 13:39:17 2012 +0100
+
+ testing/fulltests/support/simple_eval_tools.sh: Avoid using grep options -w and -q because grep in Solaris' default path doesn't understand these.
+
+commit 5116d48378ecf03e722f3010ad47bf22a3fbcb8c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 10:47:20 2012 +0100
+
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c: Reduce scope of prefix_val such that the compiler doesn't warn about an unsed variable if it isn't needed.
+
+commit 6e74d64f85a59d50e461db4c34ac76f9de468bfb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 09:22:31 2012 +0100
+
+ testing/eval_tools.sh: Avoid using grep options -q and -w because grep in Solaris' default path doesn't understand these options.
+
+commit 10f566f4d4cbb3e205023c23669289e4bfd089cb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 10:47:39 2012 +0100
+
+ perl/SNMP/SNMP.xs: Fix a compiler warning
+
+commit 44aa265891cd563f7f4114ef25dcf7aaf3b14e9a
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit dae4e16be86117861f63d1a2f981ad361418f5c6
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit 28f6226f2e228b8ca248489735f86502b2cce0a1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit 40022a697958259ccfbb3fed44eb3c472f5e837e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun Mar 4 10:37:41 2012 +0100
+
+ Solaris sh does not understand "test -e"
+
+commit 773af0c42e077bebdaecf1c0caf393285a7688f1
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 3 17:19:30 2012 +0100
+
+ Clean up nsrollup complications
+
+commit ee71049c3e21c1d0e3424297136652bbe0e39d85
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 3 16:49:41 2012 +0100
+
+ mibgroup/icmp.c: adjust ifdefs to make it compile on BSD's
+
+commit ce9600361e665dde17af9d8ab16d7ce85dc05643
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:39:55 2012 +0100
+
+ dot3StatsTable has bugs :-(
+
+commit dffacf6fa0755e1700cbac25b844185abd807a0a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:38:10 2012 +0100
+
+ passpersist test needs /usr/bin/perl
+
+commit 8726995c7a8aef674c4f164b1871c37bbdcdad50
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:36:58 2012 +0100
+
+ grep -w fails with OpenBSD and Solaris 10-64
+
+commit 1eb4745b23cc3a839864e7f6ea28355b0566eb67
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:35:49 2012 +0100
+
+ Solaris needs /usr/xpg4/bin/grep to understand -q
+
+commit 9954b4b741fd8c63d6128bd0527298c8e4e989fc
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:34:45 2012 +0100
+
+ Make sure we have the proper srcdir for out-of-source builds
+
+commit 78369002be2711f0aa876b64a4e10b090cc241cd
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:33:31 2012 +0100
+
+ Not all make versions define $(RM)
+
+commit 94245b29a3cda89475c6eab5d9493c6657ff38e3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:24:24 2012 +0100
+
+ Make autoconf 2.68 happy
+
+commit 44acd6c285fb5614b4c9611b1abdeca9dd28e4bb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:12:47 2012 +0100
+
+ Fix spelling of mib module fsys_getfsstats
+
+commit 1fa1fee3693f67b820223806b3d73afd4c50ec18
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Mar 2 01:37:20 2012 +0100
+
+ Silence a clang warning.
+
+commit 93263b98a5db344cf2c4d489c43971e7b29cdb03
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 13:37:20 2012 +0000
+
+ version update for 5.5.2.pre1
+
+commit 5a175428b973d2ea8553e29fecf94cf1566aa858
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 11:48:18 2012 +0000
+
+ version update for 5.5.2.pre1
+
+commit 364276a1c5aa66caa23eb5b7f111fdeb5af71fa7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 11:45:10 2012 +0000
+
+ make depend for 5.5.2.pre1
+
+commit 73598340172eff75729a6d57192b8171d5bbf00e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 10:42:56 2012 +0000
+
+ Version number update: 5.5.2.pre1
+
+commit f3214402672ca199fd531e66122bf96c4d9a4eb7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 10:42:39 2012 +0000
+
+ version update for 5.5.2.pre1
+
+commit 2e74acb6f19e4729cede0ab43e931961cb23aaea
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Mar 1 09:18:39 2012 +0100
+
+ CHANGES: Bug 3152841: Do not install the util_funcs subheaders that were removed in 5.7
+
+commit b7109646b95a70713d1ad991d41bccd57c0bb3eb
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Mar 1 08:48:48 2012 +0100
+
+ CHANGES: Bug 3152841: Install util_funcs subheaders introduced in 5.6
+
+commit 432cbb7a5501ab90d66d0a83e731e7343bc04b37
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Feb 25 10:13:15 2012 +0100
+
+ Correct typos
+
+commit 6a6c9bbc7584f196a1185cc1935204f1206811ed
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Feb 29 08:55:35 2012 +0100
+
+ CHANGES: Bug 3152841: Install util_funcs subheaders
+
+commit d515e2a6e4c2a1c4d84734cc7b2d0b2fc5a894ad
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 15:56:21 2012 +0000
+
+ CHANGES: snmpd: PATCHES: 3487919: Fix compilation when caching is disabled
+
+commit af8368ed8898a78d0868b47af46bc9db07d1c764
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 15:50:56 2012 +0000
+
+ CHANGES: snmplib: PATCHES: 3414773: Encode integer value using ASN_INTEGER
+
+commit 19e2715807fe06fd0baedf88165011aee933e755
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 14:05:34 2012 +0000
+
+ CHANGES: man: BUGS: 3490708: Clarify use of common command-line options
+
+commit 65f7962f932c9b75c5bbbb047d1e26ae60978e53
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 12:23:34 2012 +0000
+
+ CHANGES: snmpd: BUGS: 3489631: Fix incorrect handling of UCD monitoring flag
+
+commit ac166051b6a092dd4a594326ec85e2f699b62547
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 11:57:41 2012 +0000
+
+ CHANGES: testing: BUGS: 3474590: Don't match underscores within the source root filename
+
+commit 879bf7079d34fa46f6fcf54a01c8500beaece59a
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 10:44:41 2012 +0000
+
+ CHANGES: snmpd: BUGS: 3460364: Fix use of block factor when detecting error conditions
+
+commit 034f1c572f683ea428583074471e5d5d13b51837
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 10:22:20 2012 +0000
+
+ Skip SET-based tests when configured using --enable-read-only
+
+commit 36423e210bfb65ef121c6a66aec438c7c237d3df
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 10:03:25 2012 +0000
+
+ CHANGES: BUG: 3454168: configure: Fix building with --enable-read-only
+
+commit eed0bcbc43fea18259f0f63b2081b6d10535a052
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 09:27:11 2012 +0000
+
+ Skip SET-based baby-steps when compiled with --disable-set-support.
+ Inspired by bug #3454168
+
+commit ec6a23030e5a2072c19c18c1d9c124387da56b7b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 27 18:42:58 2012 +0000
+
+ Add -lrt to NETSNMPLIBS such that clock_gettime() can be found
+
+commit f13320500294bb240f63c6dd7d2e9a2208eb740d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Feb 27 16:52:51 2012 +0000
+
+ Skip SET-based tests when compiled using --disable-set-support
+
+commit c4276b6232c29145c039884e6b5a6b6da4b93837
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Feb 27 15:54:45 2012 +0000
+
+ Omit SET-related code when compiling with --disable-set-support (inspired by patch #3424930)
+
+commit 01c930edcc25700d6b5fb0376f55a26425e13fb0
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Feb 27 15:17:22 2012 +0000
+
+ Omit SET-related code when compiling with --disable-set-support
+ (inspired by patch #3424930)
+
+commit 9484d83203c4e2d820416be665fa833aa70444d2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Feb 24 14:00:32 2012 +0100
+
+ Rework commit b4a19505a05816e94e01de97bf99ac37fcdc6d23.
+
+commit 2b7f13495228635d816e58b2174dc124dd0cf39f
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Fri Feb 24 07:43:22 2012 -0800
+
+ set MERGE_AUTOEDIT before merging to avoid the future git 1.7.10 forced msg
+
+commit e1b910b0be9343586ae9edba6f46040af315fcdd
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 10:27:54 2012 +0100
+
+ CHANGES: snmpd: init_agent() + init_kmem(): Return an error value instead of invoking exit() if access to kernel virtual memory is denied
+
+commit 463eed2120f9d191bc22673496a49e8174664e4b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 10:03:31 2012 +0100
+
+ Remove obsolete symbol NETSNMP_EXIT_ON_BAD_KLREAD
+
+commit c36ab71a4e096f16cc5a55533f080c9a94009914
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 08:53:56 2012 +0100
+
+ CHANGES: FreeBSD: snmpd + apps: Sending UDP packets works again for non-root users
+
+commit edebddba930f8b1472fa0bd20fc413ef8cf464a2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Feb 21 11:31:46 2012 +0100
+
+ testing/RUNTESTS: Fix a bashism
+
+commit b4a19505a05816e94e01de97bf99ac37fcdc6d23
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 20 16:58:47 2012 +0100
+
+ Fix compiler warnings about %ld versus time_t on systems where time_t is a synonym for long long instead of long.
+
+commit d8978ecc8211be7c1e7905f1e215bb06ded266b6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Feb 21 12:32:25 2012 +0100
+
+ Fix snmplib/transports/snmpSocketBaseDomain.c file header
+
+commit aa766d196e5287f6ca79b58a345b024260aba354
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 20 17:07:13 2012 +0100
+
+ IF-MIB: do not trigger undefined behavior (>> 32 of a 32-bit variable) when updating a counter and ifi_ipackets is a 32-bit variable
+
+commit c3fb6dd9e6b99e9542493188987871fc5017cb3c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 09:45:45 2012 +0100
+
+ Fix a compiler warning on systems where mode_t is unsigned
+
+commit f8a3ef0d3d4e530279900101049b8de98a44a6fb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:48:52 2012 +0100
+
+ CHANGES: snmplib + snmpd + snmpwalk: Avoid that system clock changes (e.g. by ntpd) affect code that needs relative time
+ CHANGES: snmpd: Make sure that the range of the SNMPv3 variable snmpEngineTime is 0..2147483647 on all supported systems instead of 0..42949672 on some systems (i.e. wraparound after 497 days)
+ CHANGES: snmplib: Add netsnmp_get_monotonic_clock(), netsnmp_set_monotonic_marker(), netsnmp_ready_monotonic(), netsnmp_get_agent_runtime()
+ CHANGES: snmplib: Deprecate atime_diff(), atime_newMarker(), atime_ready(), atime_setMarker(), marker_tticks(), netsnmp_marker_uptime(), netsnmp_timeval_uptime(), timeval_tticks(), uatime_diff(), uatime_hdiff() and uatime_ready().
+ CHANGES: snmplib: Change the names of the struct timeval members of data structures that were used to store a wall clock time but that do now contain a monotonic clock value
+
+commit c19760f3333c92fac5d50e9768cdf939218bc487
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Feb 15 09:45:03 2012 +0100
+
+ snmplib/snmpv3.c: Fix source code indentation
+
+commit a6db239945e195de5a90fa183700b27a6ecb28d3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Feb 7 00:11:14 2012 +0100
+
+ Fix possible memory leak from recent declarations patch
+
+commit 0fbbb9a9e2906a7af956957061d485874462aea9
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Feb 6 20:43:04 2012 +0100
+
+ Do not mix declarations and statements
+
+commit f308d5bafb05d78ed4030c4ecff324b6cbda680f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 15:25:30 2012 +0100
+
+ Fix two compiler warnings in agent/mibgroup/disman/ping/pingCtlTable.c
+
+commit 46f0fc1b7fc26a225763bc65cca520a1c59f0251
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Feb 6 20:54:32 2012 +0100
+
+ sendmsg does not like IP_SENDSRCADDR if addr is INADDR_ANY
+
+commit debac498fe8410110107a2fe64f8afb748edaa07
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Feb 6 16:48:09 2012 +0100
+
+ CHANGES: added OCFS2 (Oracle Cluster FS) to hrStorageTable and hrFSTable
+
+commit fafc99cd89e73ec7e00bf7360d0b4fa61944a4f4
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 11:18:34 2012 +0100
+
+ Simplify calculate_time_diff() and calculate_sectime_diff()
+
+commit 7af2013de8bf1b379c076db4e104508e17874d3e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:55:58 2012 +0100
+
+ Fix order of feature #ifndef and Doxygen comment block
+
+commit bbd67f63530f5ef0bfc948fc58dfe6a93f8f8679
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 15:25:30 2012 +0100
+
+ Fix two compiler warnings in agent/mibgroup/disman/ping/pingCtlTable.c
+
+commit 42a66aeff25b9e9ef635a404ad2f5212f9e8cf0d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:47:54 2012 +0100
+
+ Rename two function arguments
+
+commit 3fe72b3b99b7e4b2b982363dfc4f2d8d13f40592
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 13:49:22 2012 +0100
+
+ Convert snmp_select_info() documentation to Doxygen format
+
+commit e9db266ae48d05a7a6cb5d71b4bdea7ad808ef5e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 11:17:57 2012 +0100
+
+ CHANGES: snmpd: Add netsnmp_get_next_alarm_time()
+
+commit d08044cb9e5702fbf549e14425f42794259d8a21
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 09:38:07 2012 +0100
+
+ CHANGES: snmpd: Add netsnmp_get_agent_runtime()
+
+commit a05c27c2711cb41582a3b4c31e38b0e93530b62d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:51:33 2012 +0100
+
+ Fix spelling in a source code comment
+
+commit 910d7b0d99183609b9529b04c3f29330eb661021
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:38:12 2012 +0100
+
+ Replace netsnmp_timeval_uptime() by netsnmp_get_agent_uptime()
+
+commit 43a83f6c6a96cc2316b70eecacf127eb6913c7a7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 11:19:15 2012 +0100
+
+ Use the assignment operator instead of memcpy() for copying struct timeval
+
+commit 2fe579efb1cb3a74f82803ca323928f6b8e4b5c0
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Feb 3 14:04:02 2012 +0100
+
+ Make agent/mibgroup/mibII/icmp.c build again on non-Linux systems.
+
+ See also commit 345a1e4254812cb9edc1d274491b76681a9dba1e.
+
+commit 881de6ab7355277a5c116a008fbe513293b05039
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Feb 3 10:08:21 2012 +0100
+
+ Fix compiler warnings triggered by the Rmon MIB implementation
+
+commit 4629933c0d3b3f9f4ba583534f79a37fb9633817
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 20:05:31 2012 +0000
+
+ More compiler warning fixes
+
+commit e9b5a3dee6f9afab8b90a29392040632b075ad7a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 16:56:55 2012 +0100
+
+ Use SNMP_MIN() instead of min()
+
+commit ae452c77b411139d6b5800ffcf88d48e9b4792a8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 15:23:38 2012 +0100
+
+ Restore commit dbb8795a7df595f0603f2ec61704799f4c482667.
+
+commit c7d11fa00f9995ddb9fe3d4994a3e9790da2e189
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 15:18:40 2012 +0100
+
+ Restore commit dbb8795a7df595f0603f2ec61704799f4c482667 partially.
+
+commit 00fd62720ec454f5a690de4feba08223cfb2c3f8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 14:48:44 2012 +0100
+
+ CHANGES: snmptrapd: Avoid crash during shutdown due to invoking perl_destruct(NULL)
+
+commit d9e229d81abeaf191ef2ccb077842885c230d622
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 14:47:41 2012 +0100
+
+ Remove a superfluous declaration
+
+commit 1e2e2af6cae830f381e87a244d029eb86bf3fcce
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 13:20:37 2012 +0100
+
+ perl/SNMP/examples/pingmib.pl: Add error checking
+
+commit 241a141e31f1684fc6cf70cc4a00cce636fd3526
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 11:28:37 2012 +0100
+
+ Make configure-time EVP_MD_CTX_create() detection work on the 5.4 branch.
+
+ See also commit 46eac02e9a27bf4f3068e795cab891f05a848870.
+
+commit 6d9d14feaaa2d0fec68b4d158944d32cb04ff1bc
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 11:12:00 2012 +0100
+
+ Revert the changes that break the build on the 5.4 branch from commit dbb8795a7df595f0603f2ec61704799f4c482667.
+
+commit 8abe49e30c97c8983e83b45a35c716fe91f66bea
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Feb 1 11:56:58 2012 +0100
+
+ Fix several compiler warnings in the DISMAN MIB implementations.
+
+commit f9fb0a533375e14dc370025a0b2fbc761bf27be6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 09:56:02 2012 +0100
+
+ Revert "HOST-RESOURCES_MIB: fix a compiler warning" because it's wrong.
+
+ This reverts commit aa6b79bc124a7b7a885d7e5035ab06aa3ecef613.
+
+commit ca4a4fe25efd2714f8f1961b97856616563f42c9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 10:21:49 2012 +0100
+
+ .gitignore: Add python/build
+
+commit 13ada56558b44e28d1355c0dce1d921f3746d548
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:53:49 2012 +0100
+
+ Revert "Revert "Fix format specifiers to avoid warnings"" - there *is* NETSNMP_PRIo in V5-6+ branches
+
+ This reverts commit aa528bd22c7493ca8d67e678fbf615ca0f63ea6d.
+
+commit aa528bd22c7493ca8d67e678fbf615ca0f63ea6d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:13:18 2012 +0100
+
+ Revert "Fix format specifiers to avoid warnings" - there is no NETSNMP_PRIo in V5-4 or V5-5 branches
+
+ This reverts commit 390c0114c8ec0bdb27b08b6f74e3f6ef3a62981b.
+
+commit 2fb99be9aa86a6ca349b86d4ef8bc726ed9f2a82
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:58:35 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit e5c35589e0bf416bfd036bd468f42aaeab25e788
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:55:56 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 345a1e4254812cb9edc1d274491b76681a9dba1e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:51:26 2012 +0100
+
+ Fixed error handling in init_icmp().
+
+commit c303549a59fa8c2f20a9d8bf1e985fbc8abde6a8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:46:29 2012 +0100
+
+ Reworked _register_extend() error handling.
+
+commit 9c20e27a7026fc030da3b328b9a2e1b4f36670cd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:21:28 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 22fd0bfc2df0e1f6020dc3c50a753ddf28a4599c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:20:22 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 5d61e57baf580c78252c0abb0098c07bb05af17c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:17:05 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 3c3eeae80d796f27597c901e7ff2046c769ef4b8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:08:09 2012 +0100
+
+ Mark rowreq_ctx as freed so next iteration allocates new one instead of reusing the freed one.
+
+commit af9abd53c2337c90a691a7b044ff3f97c1003161
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:05:10 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit cf9465f54181e62e21a9b10219131107a3d2ebf6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:04:06 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 7871f2b09b8b52f34a9e57784266459053165bcb
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:02:50 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 7a37f33d310c9598607bc323d9bdbf91aaf72c95
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:00:51 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 3e45f7026249e45350edaac85337423aa0e95d8b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:13:18 2012 +0100
+
+ Revert "Fix format specifiers to avoid warnings" - there is no NETSNMP_PRIo in V5-4 or V5-5 branches
+
+ This reverts commit 390c0114c8ec0bdb27b08b6f74e3f6ef3a62981b.
+
+commit 61936762e641c18db75aa5125a33e776c677adc5
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 11:13:39 2012 +0100
+
+ Fixed freeing reginfo twice on error in a template and all its instances.
+
+commit 496437430415fbafeb1ccd4774f1ca00d627ea1f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 11:04:13 2012 +0100
+
+ python/netsnmp/client_intf.c: Fix compiler warnings introduced on V5.6 branch
+
+commit 5b4a24cdcee1bc3d82633ccafeb96fce95349c59
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 09:22:27 2012 +0100
+
+ unit tests: fix a 64-bit compiler warning
+
+commit cbf1c91baf7191be5fa27d81bcf8714331a2c12f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 09:20:42 2012 +0100
+
+ Use snmpTargetParamTable_dispose() to free a struct targetParamTable_struct.
+
+ Fixes a bug introduced in commit dbf26a05a04ef24c47346e5adda48e338498e71f.
+
+commit aa6b79bc124a7b7a885d7e5035ab06aa3ecef613
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 09:20:31 2012 +0100
+
+ HOST-RESOURCES_MIB: fix a compiler warning
+
+commit 3a76b43e11fffada632fccb848ab500e876ad48b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 18 16:21:05 2012 +0100
+
+ CHANGES: python: Avoid that an SNMP set with UseEnums enabled causes a segmentation fault
+
+commit 84dec9fa92b0aa2d58eb7020330f4f98e5154321
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 18 14:38:21 2012 +0100
+
+ python/netsnmp/client_intf.c: Fix most compiler warnings
+
+commit 38cf218c3f1a727786e227a5d3fb186fd0f1a15f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:50:13 2012 +0100
+
+ Fix a typo
+
+commit 454122244122bfdb6f67cab31256d7b46372e9e1
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:30:18 2012 +0100
+
+ Free tmStateRef on errors.
+
+commit 0119022daa59c73bfec0da2386d0628f14e6dab7
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:09:12 2012 +0100
+
+ Free fingerprint when it's not needed.
+
+commit 0e84cd303a08267dec78f6d81c9bb07e3d83a11f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:48:26 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 63dc846a7949ce697b3e28c543dc1105e63a2250
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:08:28 2012 +0100
+
+ Free certificate fingerprint.
+
+commit ce1f284a63eb81644b3e32606cbe39b67e1dff2a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:37:09 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 7e21413ca6f2efd7a3afb62c62b644881b8bd1e7
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:46:30 2012 +0100
+
+ Properly allocate and free engineID.
+
+commit 34c962882607c3638a2fa25a2ac531492d71c787
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:37:25 2012 +0100
+
+ Free locally allocated tmStateRef.
+
+commit f57ae531dc5658abcd65b1627615525238d16d2d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:20:24 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 536bc57556c3141561ea4a194810b16290a691ee
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:15:47 2012 +0100
+
+ Added check if the function actually does something.
+
+commit a0777d307dbcaf219ee0184a0fbab9d4e5d6aa0b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:01:45 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 8b97a71c8e7959428eb4d4e8d90e9096d43ff09f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 12:57:26 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 2c1507c22030549ae660c0e211fbdc5c75ec5c57
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 12:53:47 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 65f2b7bcd4fe03906aa1a115ab60a89b8ae933d5
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 12:51:36 2012 +0100
+
+ Close open files on error.
+
+commit 0e52e4f66d44766bea37473556c78e5219b95461
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:45:33 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit dbf26a05a04ef24c47346e5adda48e338498e71f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:42:17 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 748da84b1fd654e338bc701e8f9e5da229187f1c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:32:04 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit eb217146fd54036ea4202bfef78bbf774d7e382d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:23:10 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 9ba38eec66138ec1f613ea8d04e158130c7121bc
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:18:55 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit d9d938d3018c27f53277bc5e59578500490c1d09
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:16:38 2012 +0100
+
+ Close open file on error.
+
+commit d5e817d5bd518d9ac6a0d60e0e141dd64f27ad19
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:14:12 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 2ae68f059df9d74b074d12f59c1847466ed576cd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:03:17 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit a00f3d461121b545aed72ac12b2438791dcfc4ba
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 14:58:39 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 59884bb4d35ad13747ffa6723436dca587a9ab77
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 17:09:12 2012 +0100
+
+ In above code, olength is checked, so let's check it also here.
+
+commit ba5d5292b04393b0c7d7d7ed961241929418c6e4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 17:05:14 2012 +0100
+
+ Fixed dereferencing NULL.
+
+commit da2d6a7028a13b9edf3a5c84314d0f1feef76714
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:44:56 2012 +0100
+
+ Prevent dereferencing NULL.
+
+commit f88054a9b69b6de274f7a14a59b47323e5e4e4c6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:37:35 2012 +0100
+
+ Don't dereference context if it's NULL.
+
+commit 7c4d459e8f1f652cc2098c3d4c81de90a84ed710
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:30:09 2012 +0100
+
+ Don't deference NULL.
+
+commit fc19b7f33b587927d2a01e72d23d21b9b1696ab3
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:25:26 2012 +0100
+
+ Don't close NULL file.
+
+commit 5e95ca6790076b788072a801ee7c82969d995bcb
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:17:09 2012 +0100
+
+ Prevent dereferencing NULL when a transport does not have f_fmtaddr.
+
+commit eed6f5f9b9ae54d2ceab67ad85adde1f6a8a21d5
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:13:13 2012 +0100
+
+ Prevent dereferencing NULL.
+
+commit 41cde68b5fa4b38d81450cf91e082cdfa825e7cf
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:10:10 2012 +0100
+
+ Check if a registration was really found.
+
+commit 5b72a40853876a186efcc0090a4e32c235b9c05f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:03:58 2012 +0100
+
+ Don't dereference NULL when difflen is SMUX_MAX_PRIORITY (which is highly unlikely, but...)
+
+commit fa6a912e41c5d0fd2a636894e86b6426c07375ab
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 15:37:44 2012 +0100
+
+ Check for missing value in setEvent.
+
+commit 410b71da425389fecc25d14f49f23753581576ad
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 15:28:41 2012 +0100
+
+ Dereference ereg only if it is not NULL.
+
+commit 185272d1a0b913774186f1b9135aeaf637ebed52
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 15:17:21 2012 +0100
+
+ As per above code, template_v2pdu can be NULL, so check it before dereferencing.
+
+commit 48e5ead3fd2c2b385df6972c67526ff6bdc30768
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 14:42:22 2012 +0100
+
+ Updated last fix to new error reporting style.
+
+commit f33d33615d6d85d0073726473c4146cbcdf11ced
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 14:30:07 2012 +0100
+
+ Fixed sigsegv when empty config line is parsed.
+
+commit b5df1eeb47ed3559b6f4d9ecccdb242126e6c992
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 14:11:58 2012 +0100
+
+ Fixed (highly theoretical) sigsegv when sp->securityEngineID is NULL.
+
+commit 6feed629a71899c113096959d8549dc1201e8f9a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 13:43:37 2012 +0100
+
+ Added NULL and len check just in case someone provides value = NULL and nozero len (-> NULL is then dereferenced).
+
+commit 355c5ab264af2a6020a1d8a923f80f11b942295e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 13:36:41 2012 +0100
+
+ Extend the NULL check, i.e. return if there is nothing to remove.
+
+commit ddd7948acad938cd42974505ddca4f0372116709
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 11:11:29 2012 -0800
+
+ update sparta's copyright
+
+commit 41256086a7a5041453419cfd6e562c7b55c56b0a
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 10:32:04 2012 -0800
+
+ pulled full copy of extractnews from master
+
+commit 625a70dbdfd9902da79efa293fe6d2ac8ccf2b2e
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 10:24:19 2012 -0800
+
+ update to change to the newer log generating/parsing
+
+commit 62e32b13089b29edcf276f615da67e4508fe7bb5
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 09:29:42 2012 -0800
+
+ conflicting merge from master for extractnews
+
+commit 70084da61d2bcbd2cf1ed81bdc3bf6794c2affb6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 13 11:49:16 2012 +0100
+
+ CHANGES: snmpd: DISMAN-SCHEDULER-MIB: Handle 32-character schedContextName values correctly.
+
+ See also commit b3c4982542e0ab151fb3884754cdfbcb472da52d.
+
+commit 04bf3e288158ee880edf237e4007fee37d2044dd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:39:37 2012 +0100
+
+ Fixed endless loop when SSL_read returns error.
+
+commit c1526fccc0474c1db18caa9dbb833853cddde3cc
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:13:21 2012 +0100
+
+ Fixed a typo.
+
+commit a27aa19df283156c032c81eaee5e115859d38c17
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:11:32 2012 +0100
+
+ Don't replace 'rc' variable, it's value is needed outside the loop.
+
+commit 985dff2b0876d9483c414fccea3ef6bc63e14561
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:01:32 2012 +0100
+
+ Removed duplicate code.
+
+commit 2fd7818318e7a5dfe98f52ccf750c2a63e825ded
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:00:22 2012 +0100
+
+ Removed duplicate code.
+
+commit 15f21130ba33dc9afd164e52dfd74c9cec0e9232
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:58:14 2012 +0100
+
+ Removed duplicate code.
+
+commit 2a8a8f2ab7cd75826c5d41ec3cfd5ce3e9634cf3
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:39:28 2012 +0100
+
+ remove dead code, 'cp' is always != NULL here.
+
+commit 38fd6378cc3275180f63b8d9b9a4072b3dabf8e4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:25:06 2012 +0100
+
+ Fixed a typo.
+
+commit ebd92e19b10c0a38e17cde407864b45c26e17327
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:07:43 2012 +0100
+
+ Removed unnecessary if (value) check - value is checked few lines before.
+
+commit c5cacf5caf979d018ea6cae1c03b8fdf0b118dfd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 13:44:43 2012 +0100
+
+ Prevent double free(), 'dirname' is already freed inside se_add_pair_to_list() if it fails.
+
+commit acdceb50ea66d6b323c74ee021fb77e810e4e7af
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 13:43:19 2012 +0100
+
+ Prevent memory leak when malloc fails.
+
+commit 17053e34cfe9a8ab395fb50f5c3f1dafc7247aeb
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 13:32:57 2012 +0100
+
+ Fixed double fclose().
+ Linux man page for fclose(3) says: In either case any further access (including another call to fclose()) to the stream results in undefined behavior.
+
+commit a6641edb9cb74fc2236b42ce5554fc3329956552
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 15:22:34 2012 +0100
+
+ MinGW: Skip test T065 if not started from inside an MSYS shell
+
+commit a883ef1982f301b1485d227301674927330f5b67
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 11 15:14:53 2012 +0100
+
+ Moved debug oputput before return.
+
+commit 45751967287d97640efdcdf8e77e8d490939d8eb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 14:17:18 2012 +0100
+
+ Convert strtoull() unit test into a Net-SNMP unit test
+
+commit 2c2fa48336a4f1f177c2991d6515d29f39533c44
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 13:50:44 2012 +0100
+
+ Convert read_config_read_octet_string_const() unit test into a Net-SNMP unit test
+
+commit 07c666f6cea27f2b2ab9bc08aed0cb6133fe3758
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 11 13:17:45 2012 +0100
+
+ Fixed commit 73a523e468277f6df2e984891313b8be8bce1921:
+ Fidex dereferencing key->info when key is known to be NULL.
+
+commit 3b686566296dd87bc42b7f1169daacdb3c45cc58
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Mon Oct 18 06:25:56 2010 +0000
+
+ Win32: builds again without warnings with MSVC 6.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19489 06827809-a52a-0410-b366-d66718629ded
+
+commit f3a7d1b09609dad649f58bbdb5b7e10d39b398c1
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sun Oct 17 11:04:06 2010 +0000
+
+ Follow-up for r19476: fixed a typo.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19478 06827809-a52a-0410-b366-d66718629ded
+
+commit 2de73bd365a381b9c353ca5230769eefb1ac71ed
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 11:42:42 2012 +0100
+
+ local/passtest: Remove an incorrect PATH= statement
+
+commit 699513f1238e0adce1f1cec98e0d147293fc5047
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sun Oct 17 09:25:51 2010 +0000
+
+ NETSNMP_REMOVE_CONST()-related cleanup.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19476 06827809-a52a-0410-b366-d66718629ded
+
+commit 6358dee72fb347e2600a0a7bd21f23270d3a00f6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 10:58:15 2012 +0100
+
+ agent/mibgroup/ucd-snmp/versioninfo.c: Add a comment
+
+commit 5396bfe032c8cbc73c8ff5d4b085ebada9f59846
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 10:30:16 2012 +0100
+
+ Replace strncpy()/strncat() by strlcpy()/strlcat()
+
+commit feb3af28dcae22015ae865a2e5dd8c416e9991d8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 10:02:08 2012 +0100
+
+ Replace strncpy()/strncat() by strlcpy()/strlcat()
+
+commit b7e1aa255bae4a3453f9eca644a876634351f11d
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sat Mar 20 19:36:28 2010 +0000
+
+ CHANGES: libsnmp: changed the type of the fourth argument of netsnmp_set_row_column() from const char* to const void* such that no cast is necessary when passing another datatype then char* or const char*.
+ CHANGES: Win32: changed in_addr_t from u_int to u_long such that it matches the datatype of sockaddr_in::sin_addr.
+ Also, fixed several compiler warnings (mostly char * <> u_char * mismatches) and removed some casts.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@18345 06827809-a52a-0410-b366-d66718629ded
+
+ Conflicts:
+ agent/agent_registry.c
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
+ agent/mibgroup/mibII/interfaces.c
+ agent/mibgroup/ucd-snmp/disk.c
+ apps/snmptrapd.c
+ snmplib/snmpIPv6BaseDomain.c
+ snmplib/snmpUDPIPv6Domain.c
+ snmplib/system.c
+
+commit f47a3752849db075e6f2053b8595b7b792fb6462
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Fri Oct 15 10:56:09 2010 +0000
+
+ CHANGES: Win32: building: Builds now correctly with a 64-bit compiler.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19458 06827809-a52a-0410-b366-d66718629ded
+
+commit 02b6056df95da8b673034e39c2c7c386ed0f369c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 11:44:53 2012 +0100
+
+ Fix a compiler warning about casting away const
+
+commit a19865832fc77f4c048144d91a431b1e94d329f2
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Wed Oct 14 23:12:05 2009 +0000
+
+ CHANGES: apps, snmplib: PATCH: 2835577: identified by "Bart Van Assche": Replace SNMP_ZERO of arrays with a memset.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@17797 06827809-a52a-0410-b366-d66718629ded
+
+commit 67a3e2eccb95f9c9d0809efcbddcd866ee3062d5
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Wed Jan 6 14:27:15 2010 +0000
+
+ Fixed a compiler warning about discarding the const qualifier.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@17970 06827809-a52a-0410-b366-d66718629ded
+
+commit 3dcde2e8a595a527f06142c3b852de8433a1cf28
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Sun Jan 24 14:27:55 2010 +0000
+
+ CHANGES: snmplib: Prevent gcc ped-warning for NETSNMP_REMOVE_CONST
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@18052 06827809-a52a-0410-b366-d66718629ded
+
+commit c2e1525a85bda5299a3b9f241614f7e6509aeeba
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Wed Jan 6 13:35:11 2010 +0000
+
+ Backport commit 295f473c83546221b2a71d815c61e33a67f98ae3: refine NETSNMP_REMOVE_CONST() implementation.
+
+commit cb423b0ae9ed0059aa100dc4e2fd93ad1b97faf8
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Wed Jan 6 11:57:51 2010 +0000
+
+ Backport commit e2fb09e0093e2f648fe2638da2f3af18fdb32bf0 - introduce NETSNMP_REMOVE_CONST().
+
+ Conflicts:
+ agent/snmp_perl.c
+ snmplib/snmp_service.c
+
+commit afc396ab1618a8595a2519fbc25f7a498e174411
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 08:49:34 2012 +0100
+
+ Unbreak netsnmp_mktemp() and make_temp().
+
+ These were broken by commit bb8fcbb874998000f945f058d1aa6fe14e925899.
+ Also replace a strncpy() call by a call to strlcpy() and replace the
+ make_tempfile() implementation by a call to netsnmp_mktemp().
+
+commit 210185c15d0d65f0ea98b5e3c2e0776f6222d170
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 08:27:43 2012 +0100
+
+ Fix a crash during startup of snmpd introduced by commit 885061687d9caa38470979667d7d8ad6563cedad.
+
+ Also, make sure there is only a single copy of the cleanup code in function
+ mkdirhier().
+
+commit 8bb4e86abcf98ff28748af0af89c98e64d5cd961
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Jan 11 07:47:12 2012 +0100
+
+ Reduce the scope of the oldmask variable.
+
+commit 6680147b138ec114f81c5d128ac9350c8450d081
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 18:44:31 2012 +0000
+
+ Make test T015int64_clib pass on 64-bit systems
+
+commit 3aad15ae560ac857e73c90764e903e7ca02b3295
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:40:59 2012 +0100
+
+ Fixed buffer overflow for large OID names
+
+commit fba188ee82010b2f2d8ca2e426ba654499ab3d0a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:31:33 2012 +0100
+
+ fixed buffer overflow in __concat_oid_str
+
+commit 21d25d86b8e4904d798dc8c96dade9e5048457a8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:26:07 2012 +0100
+
+ Fixed buffer overflow when parsing port numbers.
+
+commit d36931841b2fc2cebc6364b2949129a0ad42ad1d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:05:51 2012 +0100
+
+ Fixed a buffer overflow when large SumFile is used.
+
+commit 0efdd022da09af1b5e16171fa7a2b523c5d6ec59
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:01:53 2012 +0100
+
+ Fixed buffer overflow when too big temp file pattern is used.
+
+commit 560bc6c09b751556efd6b4c4495751b109a93f92
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:59:24 2012 +0100
+
+ Fixed buffer overflow, just to be sure.
+
+commit 8291d7c5b92a31dd4f582b497d4b2a0853367a56
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:55:16 2012 +0100
+
+ Fixed buffer overflow.
+
+commit 88e1f34de7300575fa6dab857ecddb242a87de80
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:48:55 2012 +0100
+
+ Fixed buffer overflow when too long interface names are used.
+
+commit be1375a9926ebe0cd5b78a4045c3bd11c83664b1
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:46:49 2012 +0100
+
+ Fixed buffer overflow when a sensor name is too long.
+
+commit 1cb24625372062b14c71d7dd51e20fef773e2743
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:41:00 2012 +0100
+
+ Fixed buffer overflow when a CPU has too long name.
+
+commit 84c807ee03251e54856e83d62d06ea08b8df527a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:36:50 2012 +0100
+
+ Fixed buffer overflow when too long interface names are used.
+
+commit c310e390b5dd05f24be7eb1904c74e41259c93db
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:24:54 2012 +0100
+
+ Fixed buffer overflow when too big temp file pattern is used.
+
+commit 4600d11434e83b8653cf9f813a3d8b630455b42d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:17:08 2012 +0100
+
+ Fixed plausible string overflow before parsing command line options.
+
+commit 885061687d9caa38470979667d7d8ad6563cedad
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:11:02 2012 +0100
+
+ Get rid of (insecure) SNMP_MAXPATH in mkdirhier()
+
+commit 8016890a445f6a7e2a873a04873d4e27b6ee64e3
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:48:34 2012 +0100
+
+ Fixed wrong integer size on 64 bit platform.
+
+commit bb8fcbb874998000f945f058d1aa6fe14e925899
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:31:36 2012 +0100
+
+ Secure mkstemp() with umask() - on some implementations it does not set 0600 permissions automatically.
+
+commit 202523ca704bd722dc1ac0e1e6b0e4b4e5424495
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:11:57 2012 +0100
+
+ Fixed dereferencing 'c' before NULL check.
+
+commit 73a523e468277f6df2e984891313b8be8bce1921
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:08:24 2012 +0100
+
+ Fixed dereferencing key->info when key is known to be NULL.
+
+commit 2f4e6acd714183f015b763657f8f084593357e26
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 10:38:16 2012 +0100
+
+ .gitignore: Ignore perl/*.yml files
+
+commit c365d80c16c2d17b160011e8c1f9cb958954e9db
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 08:34:16 2012 +0100
+
+ CHANGES: snmptrapd: Do not invoke shutdown_perl() from inside the SIGTERM handler since that fails if SIGTERM is received while a Perl handler is active. Based on a patch posted by Joel Avni <javni@arubanetworks.com>
+
+commit d059fb878b1436599953cea5a077499ddcdcbcb5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 17:03:55 2012 +0000
+
+ CHANGES: BUG: 3440752: IF-MIB: Report interface speed correctly for Ethernet interfaces if other than 10 Mbps, 100 Mbps, 1 Gbps, 2.5 Gbps or 10 Gbps. Add support for NICs faster than 65 Gbps.
+
+commit c09903a42e9d97331fd9e48ee831a85afdf9c70a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Jan 9 13:26:17 2012 +0100
+
+ Doxygen-style documentation fixes
+
+commit e325ecbfce77f00ac5cf6fbd957f95495f61c59b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Jan 9 13:25:10 2012 +0100
+
+ Suppress uninteresting Doxygen warnings
+
+commit be9161d3a5898e863767f926613486126c2cbf67
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 12:35:39 2012 +0100
+
+ CHANGES: snmplib: Simplify implementation of functions manipulating 64-bit numbers.
+
+commit 86e4c2be0852a0a13b0603075720b3264ec70dde
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 12:29:11 2012 +0100
+
+ CHANGES: snmplib: Make it explicit that MAX_SUBID is an unsigned constant
+
+commit 37e272d8f7b7180ba140fa386a5ff058968a08a2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 18:21:48 2012 +0000
+
+ CHANGES: snmpd: IF-MIB::ifType: Report type "infiniband (199)" for InfiniBand interfaces instead of type "other (1)".
+
+commit 269932fa32c7cd47957489698e09bee31f63b7af
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 14:34:42 2012 +0100
+
+ Fix an MSVC compiler warning
+
+commit 0d1c21f9991d1309d057e3e4056d547df7d40ecf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 16:06:31 2012 +0100
+
+ Make declaration and definition of strlcat() consistent.
+
+commit 0c3d4dbb0a9cf5b359f70b2f19915495554f840f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 15:23:16 2012 +0100
+
+ CHANGES: Win32: snmpd: Remove dlmod
+
+commit 893ecc97b587661045becbe09a320c1bcbc71c7c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 14:36:59 2012 +0100
+
+ Add strlcat() to the MSVC build infrastructure.
+
+commit 3d126422e625702b9d3fa0676a97ec5cb20d9d10
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 15:01:06 2012 +0100
+
+ Make win32/net-snmp/net-snmp-config.h consistent with its .in file
+
+commit af53b76c2ffa751e3958d0fc5d8279f78c2c1c26
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 14:43:55 2012 +0100
+
+ Skip T066pass_simple and T067passpersist_simple on MinGW
+
+commit 35a92e693d133a5b11e9e9b599dbf47edef4933b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 08:16:36 2012 +0100
+
+ Remove snmplib/snmpDTLSUDPDomain.c again, which was added accidentally while resolving merge conflicts (commit 1d78f7d5b58aed2b52c4d386a7ba80a44711baca)
+
+commit a9b073ea3b6cedf713e305e7b15f28ae57bfdf1b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 17:47:11 2012 +0000
+
+ Fix 64-bit compiler warnings
+
+commit 7e890dad95f566069ee280215a4fea3f0e2e3980
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 16:38:50 2012 +0100
+
+ Avoid a SIGSEGV if cp == NULL. This is a follow-up for commit 089bcb360aa26790ad2a8ceddf583b7ba5ddfd48.
+
+commit 1f6200cfe1b0b27ebb093a1606b592f9e9684be8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 15:53:34 2012 +0100
+
+ Convert strncpy() calls introduced in v5.6
+
+commit c3126b143921fabeac442166eca5b5b742fd42c0
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 15:02:39 2012 +0100
+
+ Replace most strncpy() calls introduced in v5.5
+
+commit b24ee7c909657db43bd8c5d8c01055ca0883c9cf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 08:40:39 2012 +0100
+
+ Eliminate most strncpy() and strncat() calls
+
+ Using strncpy() and strncat() is error prone -- see also
+ http://www.gratisoft.us/todd/papers/strlcpy.html. Hence replace
+ all invocations of strncpy() and strncat(). Replace
+ strncpy(dst, src, n) calls by:
+ * strlcpy(dst, src, n) if the goal was to avoid output buffer overflow.
+ * sprintf(dst, "%.*s", n, src) to copy a prefix of src to dst or if src is
+ not '\0'-terminated.
+ * memcpy(dst, src, n) if strlen(src) >= n and n < size of dst.
+ * strcpy(dst, src) if n > strlen(src) and n < size of dst.
+
+commit 6d95bc4149472931005475c30a541fed5534da39
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 11:19:16 2012 +0100
+
+ Fix warnings triggered during compilation of the Perl xs source files
+
+commit bad0600f6ec944ef8455e327ce784b9b07d247c9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 10:00:13 2012 +0100
+
+ Add configure test for sockaddr_un.sun_path such that the com2sec test is run
+
+commit 92a32ac4866a5edc7f347d37942bf028de02762f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 10:00:29 2012 +0100
+
+ Get rid of a compiler warning
+
+commit 83e4c0e304f617ccac6610edd74d1706797bbf52
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 09:15:37 2012 +0100
+
+ CHANGES: testing: Add a test for se_store_list()
+
+commit 4fae5852103ec3893ad488bc0d905ca6914595ef
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 09:17:15 2012 +0100
+
+ CHANGES: snmplib: Simplify the se_store_enum_list() implementation
+
+commit b3222bb275f2f2346e0fd0478afa2efb600773e5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 09:16:45 2012 +0100
+
+ CHANGES: snmplib: Declare "type" argument of se_store_list() / se_store_slist() / se_store_enum_list() const
+
+commit 022f840fbfcb0e26b08f0e55728231f611495803
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 19:55:56 2012 +0000
+
+ Avoid that Valgrind complains about sending UDP data
+
+commit 672a809c228e9550b99b8910be75d0b161985402
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 17:33:09 2012 +0000
+
+ Fix a 64-bit compiler warning
+
+commit 24ff260ad89ce2aa361a55c7c72e916031defe35
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 17:11:24 2012 +0100
+
+ Change the type of the second argument of snmp_set_var_value() and snmp_set_var_typed_value() from u_char* to void*, like on more recent branches
+
+commit c6ca737fb46f90a4bda5d43734aac34e837a05f4
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sat Mar 13 19:07:37 2010 +0000
+
+ Backport commit f504ce2d74a4bc88f68cc9515fa7053373cb15b5.
+ (Fixed most compiler warnings triggered by the source code in the perl subdirectory. Note: these changes may contain some real bug fixes.)
+
+ Conflicts:
+
+ perl/ASN/ASN.xs
+ perl/OID/OID.xs
+ perl/SNMP/SNMP.xs
+ perl/agent/agent.xs
+
+commit d212dc984ec34e4d230625e46e58b0c628a50df5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 16:46:49 2012 +0100
+
+ SNMP.xs compiler warning fixes
+
+commit baceebb10d8caf5db63cc36935fed65ee931029d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 16:22:44 2012 +0100
+
+ Add declaration for shutdown_snmpNotifyTable()
+
+commit f7f966abd6d2849b1331252afe5c473e5c40b32d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 14:24:33 2012 +0100
+
+ Fix format specification mismatches.
+
+commit 303c015bcfe9af0b154e9881c7b4f449e08f30bb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed May 6 22:06:23 2009 +0000
+
+ Backport commit d3eb2b5ced22a8480053ce43acf9739729055404
+ (Sprinkle some const-ness where relevant / fix format string mismatches,
+ Niels Baggesen, May 2009)
+
+ Conflicts:
+
+ agent/agent_sysORTable.c
+ agent/helpers/instance.c
+ agent/mibgroup/disman/event/mteTriggerConf.c
+ include/net-snmp/agent/instance.h
+ include/net-snmp/agent/sysORTable.h
+
+commit d95b40406916bda5b48b5a6131bec27b866b0a79
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed May 6 21:59:20 2009 +0000
+
+ Backport a2a7316c310f0fcc3728673fa047051c23b71960
+ (Trivial warning fixes, Niels Baggesen, May 2009).
+
+ Conflicts:
+
+ agent/mibgroup/hardware/cpu/cpu_linux.c
+ agent/mibgroup/host/hr_swrun.c
+ agent/mibgroup/if-mib/data_access/interface_linux.c
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c
+ agent/mibgroup/mibII/sysORTable.c
+ agent/mibgroup/mibII/system_mib.c
+ agent/mibgroup/ucd-snmp/logmatch.c
+ agent/mibgroup/util_funcs/get_pid_from_inode.c
+ agent/snmpd.c
+ snmplib/container_list_ssll.c
+
+commit d86c47f003fdc192bce7b46ac4f06b09e387c12b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 13:29:08 2012 +0100
+
+ Fixed a typo
+
+commit bee4d79cf4eb7e0a45397f59b5298da633a8e1ba
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 13:14:57 2012 +0100
+
+ Fixed reading past end of buffer.
+
+commit 3dc0e00a2fd8e34fe1ae33ecabf36e146460a31f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 12:40:07 2012 +0100
+
+ Fixed buffer overflow when large 'token' is used.
+
+commit b3c4982542e0ab151fb3884754cdfbcb472da52d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 12:28:52 2012 +0100
+
+ Fixed off-by-one memset.
+
+commit 0f53695044dd3f0c3507753e3f8c29d97e96872d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Aug 3 21:38:26 2011 +0200
+
+ CHANGES: snmplib, snmpd, perl: Eliminate dead variables
+
+ Conflicts:
+
+ agent/mibgroup/agentx/master_admin.c
+ agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c
+ agent/mibgroup/host/data_access/swinst_pkginfo.c
+ agent/mibgroup/host/data_access/swrun_procfs_status.c
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c
+ agent/mibgroup/mibII/kernel_linux.c
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c
+ apps/snmptls.c
+ apps/snmptrapd_log.c
+ snmplib/dir_utils.c
+ snmplib/snmp_client.c
+ snmplib/snmp_openssl.c
+ snmplib/transports/snmpTLSTCPDomain.c
+
+commit 0153805c99b9197365935c5d11ae9c3d4bfaa0f3
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 09:48:41 2012 +0100
+
+ Fix a set-but-not-used warning
+
+commit 3f8885fbee9407748fc2f0573728a11ba2bc023a
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Tue Apr 28 05:51:13 2009 +0000
+
+ Return a value from sprint_realloc_value even if no subtree is located.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@17578 06827809-a52a-0410-b366-d66718629ded
+
+commit b1eaaf302369fd4552e8fee7b6a805091ec0a9b4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 11:38:51 2012 +0100
+
+ Added check of find_sec_mod() return value.
+
+commit aee4e895fe3bd5f4a61e34275bfca0368b560555
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 11:31:22 2012 +0100
+
+ Added check of snmp_sess_transport() return value.
+
+commit 5d1d0a744ab30c8e645c3b8506cbbd2cceb3d275
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 11:04:48 2012 +0100
+
+ Added check of netsnmp_extract_iterator_context() return value.
+
+commit 299ea9a89c3f1758a7748bb9b3411f62f2c70f88
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 10:54:55 2012 +0100
+
+ Added check of fopen() return value, just in case of some race.
+
+commit 90f1ae6757917481636eef77100caeeb53edfe01
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 3 10:06:56 2012 +0100
+
+ Add strlcat.c. Source: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/string/strlcat.c.
+
+commit 089bcb360aa26790ad2a8ceddf583b7ba5ddfd48
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 10:50:56 2012 +0100
+
+ Added strrchr return value check, just to be sure.
+
+commit 199a0511f6eb0ef3ff1d9f922b790ab67dfde01e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 10:31:26 2012 +0100
+
+ CHANGES: snmpd: smux: simplify smux_list_detach()
+
+commit d883573aa73e0f5fc188acedee6451f95dae900c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 10:23:06 2012 +0100
+
+ Fix a compiler warning introduced by commit a809fe5075c9f374715f7d1a682949a0730172c1.
+
+commit 7b7a3eb2500527eaa1699287a6ca6fcc4cc2e08a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 09:40:02 2012 +0100
+
+ Fix a build error caused by commit a809fe5075c9f374715f7d1a682949a0730172c1.
+
+commit 2b6c119fed4848da6663c11f0c2cbdc29921b5c6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:51:10 2012 +0100
+
+ Check for netsnmp_ds_get_int() errors.
+
+commit 6ce5360caa4c9de51ade57879e83f96bd04b4c5a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:42:23 2012 +0100
+
+ Check for missing view.
+
+commit b3bc54bed31690a85df2acfbf3296da93a9e89b4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:23:17 2012 +0100
+
+ Check socket() result.
+ Also close the socket on error.
+
+commit 92075f51cd45a38ca38760b3ffe82e16559e9c2e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:18:26 2012 +0100
+
+ Check open() result.
+
+commit 6665d5fe2fc569d6fa854d1d78e347bbac69e070
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:22:22 2012 +0100
+
+ Fixed missing break.
+
+commit a6648c5453e1ef8dac57a38efcc00cce53bf9e4f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:20:27 2012 +0100
+
+ Fixed missing break.
+
+commit d68dcae0f18d554571aef321944a5290548dde86
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:16:11 2012 +0100
+
+ Added 'fallthrough' comment for Coverity.
+
+commit fb6f80c0fe3ba36e56f5b911a47e3f6f32ba266e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:14:07 2012 +0100
+
+ Fixed exit code of encode_keychange with wrong arguments.
+ Also added a comment for Coverity.
+
+commit 3130e24fdc232464dd7bb216f46cafa2e0e775a6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:09:54 2012 +0100
+
+ Added missing break
+
+commit 18c126a9565cb4d69d7513b944a2105588045d35
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:07:29 2012 +0100
+
+ Added 'fallthrough' comment for Coverity.
+
+commit 6d31c82070a2c68fe3c519e9d56fa2779554d01f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:01:53 2012 +0100
+
+ Added 'fallthrough' comment for Coverity.
+
+commit dc6f0e2e549b4cd061ebc190084b1fc77a55f40f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:32:59 2012 +0100
+
+ Fixed wrong operator
+
+commit dab32867ed0b99301efd7b8d852ad1288a184be0
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:30:33 2012 +0100
+
+ Fixed QUITFUN usage.
+
+commit b1a2bcf64615eb66bc24d5be4950e45012962045
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:18:03 2012 +0100
+
+ Fixed wrong operator
+
+commit b2b1c851b94fed37c386eaa1bfead5c77696e3ef
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:14:52 2012 +0100
+
+ Fixed wrong operator
+
+commit a809fe5075c9f374715f7d1a682949a0730172c1
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 10:58:46 2012 +0100
+
+ Added check for failed register_mib.
+
+commit 5949f055c16ae650615aae7a1fee3f2d7b16d940
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 10:29:59 2012 +0100
+
+ Make MIB file parsing and detection more strict - LABEL is required at the beginning of MIB files.
+
+commit e4b673683c68ba8b3abc040b9125ec304643cc7c
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Jan 1 23:00:24 2012 +0100
+
+ Assume that libdl might be in AGENTLIBS or SNMPLIBS so preadd them.
+
+commit b13c1e57bedba79b806103c74f1921d53a706b38
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Jan 1 22:55:06 2012 +0100
+
+ Do not require ucd-snmp/dlmod unless it will work.
+
+commit 27dcea0d5f801df494ab2cb5c5c0ebe54eb0dcd3
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 14:48:29 2011 +0100
+
+ Adjust paths for test restructure
+
+commit 14b60e85a1b5700e93d126e2f291d5c485f34e36
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 14:14:29 2011 +0100
+
+ CHANGES: snmpd: Make the configuration of the dlmod module fail rather than generate a dummy module if the dlopen function isn't available.
+
+commit 98a97538fc1e9ff46b60d5d969347444578378c0
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 13:35:13 2011 +0100
+
+ Adjust the paths to support testing even if builddir != srcdir
+
+commit 88f0af3cfb916ae5863cc2986071d435f20c3064
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 11:37:52 2011 +0100
+
+ Reduce the scope of the variables 'p' and 'len'.
+
+commit 0815a7536c76f7e4842638683f674894a1a8ce14
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 29 14:42:54 2011 +0000
+
+ Report problems with SetUndo processing
+ Missed when applying patch #3445440
+
+commit eb2ab23742ca86c0b89ccfe91eb6ea374bf3acc1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 29 14:37:31 2011 +0000
+
+ Check for the expected error (EPIPE) on closure.
+ Missed when applying patch #3447444
+
+commit aac10bc4f053c014f382d6593fc32ab95e0b1a57
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 29 12:59:52 2011 +0000
+
+ CHANGES: snmpd: BUG: 3463767: Handle parsing subidentifiers > 2^31
+
+commit bbc02e36e90c1aab7898562f963f5cadb26e10bd
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Dec 28 17:15:16 2011 +0000
+
+ Move pass/pass_persist tests to the new location
+
+commit 3898c04fd6f89867062fdfebf36857ab619c0450
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Dec 28 16:53:24 2011 +0000
+
+ Add tests for pass/pass_persist, supplied by Bill Fenner
+
+commit d5ee3f0a1a63bb1752c74cbca55aa3d40bf9bf13
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 21:58:51 2011 +0000
+
+ CHANGES: snmpd: PATCHES: 3447444: Fix SIG_PIPE handling
+ Patch provided by Bill Fenner
+
+commit 2a17b37430c1852998c3588e547d7eb61c06da71
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 21:45:38 2011 +0000
+
+ CHANGES: agentx: PATCHES: 3445440: More robust handling of AgentX errors
+ Patch provided by Bill Fenner
+
+commit fe58a0e5f4d4e2e2ecbcb47382b08cb1e4df352c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 18:16:23 2011 +0000
+
+ CHANGES: snmplib: PATCHES: 3456770: Handle (obsolete) UInteger type properly
+ Patch provided by Bill Fenner
+
+commit 1be8cf08a67a91855fee1ec4a2d8e087c7812456
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 18:04:10 2011 +0000
+
+ CHANGES: agentx: PATCHES: 3445437: Log AgentX disconnections
+ (in line with connections) Patch provided by Bill Fenner
+
+commit 068037289107faa2ba3f5cd2fb00c19494bb9a04
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 17:27:46 2011 +0000
+
+ Handle any GETNEXT request OID, not just a simple walk.
+
+commit a74fa528983123d355a8cdcaa77dd4eb4b8c6959
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 17:00:18 2011 +0000
+
+ CHANGES: pass: PATCHES: 349394: Bring pass_persisttest script into line with passtest*
+ (i.e. using the legitimate structure of NET-SNMP-PASS-MIB)
+ Patch provided by Bill Fenner
+
+commit bbe649ebfa61ea22399170b36b99db30a1de8012
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 16:54:38 2011 +0000
+
+ Rework "passtest" example to fully validate GETNEXT requests
+ and use a legitimate structure for output. Backport of SVN
+ revision 17632 (which updated 'passtest.pl' but missed 'passtest')
+ Correct in branches 5.5 and above
+
+commit 82d06c7247b22c8b01d45bf55041d2f1e6427d49
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 13:45:18 2011 +0000
+
+ CHANGES: snmpd: PATCHES: 3447671: Fix override handling of OID values
+ Patch supplied by Phillip O'Donnell
+
+commit ba4a9ce51c9600f9fda168f1e6eff32a1db63cb9
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 13:24:26 2011 +0000
+
+ Tweak --disable-snmp-set changes
+
+commit 827c8b28830171faa9c61d53efca9eb6600561c2
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 11:25:43 2011 +0000
+
+ CHANGES: python: PATCHES: 3433846: Fix for use with python 2.4
+
+commit f98a54a99caf7b46b100a920db942cbca9c43926
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 10:10:36 2011 +0000
+
+ Skip SET-based tests when configured with --disable-set-support
+
+commit 230df14f94c3736ff34379a4e281eea353b47f80
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Dec 26 23:34:23 2011 +0100
+
+ Do not assign tmStateRef twice
+
+commit c96b3b4d8530ad5e0efb03f24dab5e5f1a460031
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 25 11:18:21 2011 +0100
+
+ Correct use-after-free.
+
+commit c5978c89cde2440f4d20dadbc9d1dd8db562d56e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 25 11:15:44 2011 +0100
+
+ Correct double-free.
+
+ netsnmp_tlstmAddr_add takes ownership of it's argument so calling free on the
+ argument on failure is incorrect.
+
+commit c139ca123b44bb3b9b6bf921e1609cc45f63a660
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Sat Dec 24 16:55:30 2011 +0000
+
+ CHANGES: snmpd: PATCHES 3410059: Fix sparsely augmenting trigger tables
+ Patch provided by Stephen Turner
+
+commit c4ae021b2e6384437081c5623f360c8896390188
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Sat Dec 24 16:29:54 2011 +0000
+
+ CHANGES: snmpd: PATCHES 3410050: Skip already-'processed' varbinds
+ Based on mib2c patch provided by Stephen Turner
+
+commit c6accf8c66254fa8c48767ed7dec795ddafc522e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Sat Dec 24 16:27:11 2011 +0000
+
+ CHANGES: mib2c: PATCHES 3410050: Skip already-'processed' varbinds
+ Patch provided by Stephen Turner
+
+commit a61826ad8ca54661d1d909712503bd3a8b32eed0
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Dec 22 18:35:46 2011 +0100
+
+ Remove unused variable.
+
+ myMatch is unused as nmatch is zero and also since regexBuffer is created
+ with REG_NOSUB set.
+
+commit ba4fc80fe2cfd5a5d89230d8f3703e4fe01e6019
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 22 19:24:40 2011 +0000
+
+ CHANGES: agent: PATCH 3402376: from Leonardo Chiquitto: Recognise ReiserFS
+ Also move various FSType definitions to the appropriate blocks
+
+commit b5ac4a04dcd5470d08d03321abcd1e982621e6e0
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:39:46 2011 +0100
+
+ Fixed unterminated strings after strncpy
+
+commit 2b37e4e8f250a0d8821199a74ac3f4e5b7b7baba
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:31:51 2011 +0100
+
+ Fixed unterminated strings after strncpy
+
+commit 3d08345156c419333de969f13d21fcec7e18e94d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:32:29 2011 +0100
+
+ Fixed unterminated strings after strncpy
+
+commit cd859ad51c4f18d5b0fc69dd669fcb051c798969
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:39:33 2011 +0100
+
+ Fixed wrong memmove size
+
+commit 30ff58d09d4c9d5438bb621054fd7ad7a2a597e4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:07:19 2011 +0100
+
+ Fixed wrong length of buffer when printing ASN_BIT_STR
+
+commit 6c1487e1d360d3d260a39cb1f5b15da978395053
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 15:47:34 2011 +0100
+
+ Fixed potential free of uninitialized pointer in error cases
+
+commit c76fb96f65e33ba2fd212a921e8c386155ee5c7a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 15:44:46 2011 +0100
+
+ Fixed unitialized values in udpTable
+
+commit c44608679b89751176f28a2e54d5282b46e2a05c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 14:56:13 2011 +0100
+
+ Use calloc instead of malloc and manual clearing
+
+commit a05c5f9513461824e7903ae9ae9a6c3386e33879
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 14:40:50 2011 +0100
+
+ Fixed printing of unitialized variable when sensors_get_label() fails
+
+commit e4a5edc72393bd3de9bf12bceba9d83bbf7de70b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 14:31:25 2011 +0100
+
+ Removed unused variable
+
+commit fae2e5b835b8df1eae47e4cebb4eb404d7282377
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 13:31:21 2011 +0100
+
+ Fixed dereferencing unitialized iid in error cases and with debug info enabled.
+
+commit 9d58f81a9239cfbcfc8ebce367d21e9b3dcb028b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 13:33:33 2011 +0100
+
+ Fixed dereferencing uninitialized variables in error cases
+
+commit 0bc8c08edeae7ae095f116258c20ae5767d60652
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 13:20:52 2011 +0100
+
+ Fixed returning uninitialized variable 'status' when ss == NULL
+
+commit 7304c53cf8adee8eccef1a8f26756fc07f098721
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 18 23:31:53 2011 +0100
+
+ On solaris 10 test in /bin/sh doesn't support the -e test. Replace it with -f
+
+commit 8cd3be60d693c9c36ffb97d3d9bcb49c1b4abe35
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 17 08:52:24 2011 +0100
+
+ Avoid repetition of the complex expression determining if it is possible to get the destination address.
+
+ This also makes it possible to build on platforms like Solaris 10 that define
+ IP_RECVDSTADDR but lack either of msghdr.msg_control and msghdr.msg_flags.
+
+commit 953f2e3d425ede3b863a2e7ccb0b4bc862928b57
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 5 22:13:07 2011 +0100
+
+ Move the use of _sendto and _recvfrom below their definitions.
+
+commit 68a1173c46cf77601426cf391d9a852794f2057e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Nov 20 20:05:18 2011 +0100
+
+ CHANGES: snmplib: Separate out the cmesg buffer size
+
+commit 461dd16f3b2647322cdce6363081cc44ba5a49b5
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 26 21:51:01 2011 +0100
+
+ CHANGES: snmplib: Merge together the Linux and *BSD version of src port sending.
+
+commit 7accb69baa1fc0b6a3439d2e549c86da3453bad2
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:30:31 2011 +0100
+
+ Use a bare struct iovec in instead of a one element array.
+
+ The purpose of this change is to make _recvfrom more similar to _sendto.
+
+commit 39852cd4c85ef2bfc75cdea2825261ee93e768c2
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:29:20 2011 +0100
+
+ Add comment describing the purpose of the call to getsockname after almost removing it.
+
+commit 1b292ca27eab5caa73feaaa83dc9c12abc0f2e70
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:27:59 2011 +0100
+
+ Reduce variable scope.
+
+commit bc879571eca9520bc132f840c3e659d3793144d7
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:25:36 2011 +0100
+
+ Introduce temporary variables to ease the extraction of the server address.
+
+commit b7eea6cffbd872932ce2c04fefb6f43de339f374
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:18:33 2011 +0100
+
+ Rename the cmesgptr variable to cm.
+
+ The purpose of this is to increase the readability of the code.
+
+commit 0a7461e728805c62a1cab9d87bfc74c7927a9fcc
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:15:22 2011 +0100
+
+ Factor out a common loop in recvmsg option processing.
+
+commit b3c6248d0201ab1610840d6d0e749b3b6c4ad792
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:13:43 2011 +0100
+
+ Unify the structure of Linux and BSD recvmsg option parsing somewhat.
+
+commit 356400d6290a423b52ebeea5a5e976fb15bb73b4
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:04:56 2011 +0100
+
+ Use CMSG_DATA on the result of CMSG_FIRST/NEXTHDR, not on the buffer.
+
+commit 3b351708c62de46aa1b90ed232cfd8c7c5b02231
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 12:00:32 2011 +0100
+
+ Remove a cast
+
+commit de9250d9dae9727a6cc7f647688dddf1b8597128
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 11:58:04 2011 +0100
+
+ CHANGES: snmpd: Make sprint_mib_oid() treat OID components as unsigned instead of signed integers
+
+commit 0e33b3b6d5854a4bac15d4ea5e016c53d161d0cd
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 10:02:28 2011 +0100
+
+ Fix recently introduced compiler warnings
+
+commit b7e50d5f9a6755982d2af3191473cb34643bc03f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 08:37:22 2011 +0100
+
+ CHANGES: snmplib: Reduce overhead of config file parsing
+
+commit 73c9ee42d28afe2e107a7d6616b6d011890c36ea
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 09:09:59 2011 +0100
+
+ Remove unused variables
+
+commit 3db97962b37eb12d254d61e6be234b06a391c8bb
+Author: Bill Fenner <fenner@gmail.com>
+Date: Thu Dec 8 07:43:45 2011 +0100
+
+ CHANGES: snmpd: PATCH 3453868: from "Bill Fenner <fenner@gmail.com>": Factor common code into pass_common
+
+ Move the code for pormatting and printing values from pass and pass_persist
+ into pass_common.
+
+commit b6568c83f1756e9a65434edeeeb40d23ddbbb652
+Author: ccchiu <ccchiu@sourceforge.net>
+Date: Wed Dec 7 16:25:27 2011 +0100
+
+ CHANGES: BUG: 3452069: Fix snmptrap_oid declaration in mib2c generated code
+
+ This bug was introduced considerable time ago. It did already exist at the
+ time the 5.6 branch was created (see also commit
+ 0ec088afa27cfda4e6ea78aae7cfc5507564edde).
+
+commit d494db64c208b4dc62813132f8863bd5c1a39d77
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:38:17 2011 +0100
+
+ CHANGES: snmptrapd: Eliminate an unused variable (Now)
+
+commit 28f2561bc2935d8e1cbf46d2820158173e7a4cf4
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:37:11 2011 +0100
+
+ CHANGES: snmptrapd: Move the main loop code into a new function
+
+commit 396e122ddc42a916f06a02884c0e8a258edbe238
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 09:32:16 2011 +0100
+
+ CHANGES: snmpd: Match each getpwnam()/getpwuid() call with an endpwent() call and each getgrent() call with an endgrent() call.
+
+commit 3efefbc0024399786f8b68b1e93b0a8fddddc7da
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:41:01 2011 +0100
+
+ CHANGES: snmptrapd: Remove superfluous casts
+
+commit 7f05daa8e0e0f533b0f12a3e1cf07641519909d6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 11:58:32 2011 +0100
+
+ CHANGES: BUG: 3444939: BUG: 1796886: snmplib: Avoid that sprint_realloc_octet_string() embeds unprintable control characters or binary zeroes in its output. This behavior could cause truncated output in snmptrapd.
+
+commit db8f558fd2f3b7c109ea3a1c2133b75b6f8cb2ad
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:04:41 2011 +0100
+
+ Compiler warning fix: pass unsigned chars to isprint() instead of signed chars.
+
+commit 800dc1028e7e0cd8cc14d84dd31723d47ac073db
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Dec 1 10:18:58 2011 +0100
+
+ Reduce the scope of the hint variable
+
+commit 83ea4a080c90a74b9743d3f24cf0d4b8a1e8c849
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Nov 27 21:16:52 2011 +0100
+
+ Reduce the scope of the variable qos
+
+commit 7b9e03441c3dc3a07670ed01f5d04791a82c750c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:04:01 2011 +0100
+
+ Remove #define val(x) __STRING(x) and change val(x) into __STRING(x).
+
+commit 2f379b0e4ecadfa4e541e3005c8fc8281882b741
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 15:58:47 2011 +0100
+
+ Follow-up for commit 1aa704e: unbreak the MSVC build
+
+commit 64ef0f71127617837027fb2cfaf174b95ba79e0d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:19:50 2011 +0100
+
+ Add SNMP::register_debug_tokens()
+
+commit 7bead9ca917c67566d5ed98ab507bbc02816217d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:08:08 2011 +0100
+
+ AgentX subagent: Reduce code duplication
+
+commit 0ed71541f87e7d78bc998eebda3217c59e1df830
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:03:19 2011 +0100
+
+ CHANGES: snmplib: Add Doxygen-style function header for netsnmp_register_default_target() and netsnmp_clear_default_target().
+
+commit 8c2972b61e40169b47c50988b6ae9e8c285f84f8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:02:54 2011 +0100
+
+ CHANGES: perl: Fix spelling in the documentation of the SNMP module
+
+commit 5df2bac6bd717799311f001ac7b73db88f11bdda
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Tue Nov 29 08:59:58 2011 +0100
+
+ CHANGES: snmplib: Only transform the address to printable form when needed.
+
+commit 171e8d48d4af04013cff8fd28f5341a2aef21d88
+Author: Mijo Safradin <safradin@linux.vnet.ibm.com>
+Date: Tue Nov 29 16:49:46 2011 +0100
+
+ CHANGES: snmp-bridge-mib: Fix index interpretation.
+
+ This patch corrects a wrong data interpretation.
+ snmp-bridge-mib obtains the ifindex value from the sysfs
+ attribute 'ifindex' The value given by the sysfs attribute
+ is an integer, which is handled as hex and leads to
+ incorrect data displayed to the user.
+
+ e.g.
+ $ > snmpwalk localhost BRIDGE-MIB::dot1dBasePortIfIndex.2
+ BRIDGE-MIB::dot1dBasePortIfIndex.2 = INTEGER: 54
+
+ according to the sysfs attribute the value is 36
+
+ $ > cat /sys/class/net/<device>/ifindex
+ 36
+
+ Signed-off-by: Mijo Safradin <safradin@linux.vnet.ibm.com>
+
+commit 82e39fb6706df90ecf2fc9e10ada2b962ee196f3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Nov 29 12:27:46 2011 +0000
+
+ Fix multi-line case testing of incoming OID
+
+commit b15da1a4516061105a1eac7450cf650ec44266b2
+Author: Nikolay Denev <ndenev@gmail.com>
+Date: Tue Nov 29 08:29:49 2011 +0100
+
+ CHANGES: FreeBSD: Restore IP_RECVDSTADDR functionality.
+
+commit 7f47f52e481baa9aafb5784244b0dd2653e7dcff
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Nov 28 08:51:39 2011 +0100
+
+ CHANGES: snmplib: Use SNMP_ALLOC_TYPEDEF to allocate transports in order to avoid the separate call to memset.
+
+commit cf86039e3086225c3085bb9adf088b8ba5ba6979
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Nov 22 15:02:58 2011 +0100
+
+ CHANGES: MinGW: testing: Make unit-tests/T102pdu_build_clib pass.
+
+commit 1a87e76e00ee3d5cd37a07bfc3d84490d3c2a4ec
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Nov 22 14:55:42 2011 +0100
+
+ CHANGES: MinGW: testing: Make unit-tests/T014gethostbyaddr_clib pass
+
+commit 8867fd1dcfe72b59d07322ff38a699b66ec4f326
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Nov 22 09:44:38 2011 +0100
+
+ CHANGES: snmplib: Make netsnmp_large_fd_set_resize() robust against memory allocation failures.
+
+ CHANGES: snmplib: Make NETSNMP_LARGE_FD_ZERO() use memset() on Unix systems instead of an explicit loop.
+ CHANGES: snmplib: Make sure that on Unix systems netsnmp_large_fd_clr() doesn't try to read memory it isn't allowed to read if the first argument equals -1 (a value that shouldn't be passed by the caller).
+ CHANGES: snmplib: Make netsnmp_large_fd_is_set() return false on Unix systems if the first argument equals -1 (a value that shouldn't be passed by the caller).
+ CHANGES: Windows: Make netsnmp_large_fd_set_resize() shrink behavior correct.
+
+commit 23db0cf09b8b0eab37b749ef0c3c3f306900245c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Nov 21 23:02:57 2011 +0100
+
+ Fix casting tv_usec to int which may be too short
+
+commit 80ee4022e534e64aad5a5f27192843b42acb85e0
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 09:14:02 2011 +0100
+
+ CHANGES: snmpd: BUG: 3439234: Move netsnmp_pass_str_to_errno to pass_common and rename it to netsnmp_internal_pass_str_to_errno
+
+commit 0baa9296c072bb3735760b0dd992f2d1d3ca27fa
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 09:05:24 2011 +0100
+
+ CHANGES: snmpd: BUG: 3439234: Correct the dependencies of ucd-snmp/pass and ucd-snmp/pass_persist
+
+commit 1aa704e4a294430b28e39b6f9e4683b8a48bce04
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 08:35:21 2011 +0100
+
+ CHANGES: snmpd: Factor out asc2bin and bin2asc. Add a netsnmp_internal_ prefix to them
+
+commit cda8fe91013f12cbf64a0775abb55720035af931
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 00:55:24 2011 +0100
+
+ CHANGES: snmpd: Call snmp_oidtree_compare instead of snmp_oid_min_compare
+ CHANGES: snmpd: Remove snmp_oid_min_compare since it is internal and unused
+
+commit 85f893e2b605e67f9bd0443c74e2ed269aa68564
+Author: Niki Denev <niki_d@users.sourceforge.net>
+Date: Thu Nov 17 22:42:32 2011 +0100
+
+ CHANGES: snmpd: PATCHES: 3175640: Use IP_RECVDSTADDR sockopt where available (*BSD)
+
+ This hunk fell of when the rest of the patch was merged.
+
+commit 5c913e54656ae0096b1feb6da98b5fc9ca81f276
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:33:07 2011 +0100
+
+ Define the full NetBSD hierarchy downwards
+
+commit b881841bd0493dd71d63259bdded449b06f02c32
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:30:33 2011 +0100
+
+ Fix size_t/int mismatches
+
+commit ca294cf75bbc8e90dbf44ee40478935e91db1487
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:18:03 2011 +0100
+
+ Remove unused variables
+
+commit cd32c2dff06b9b452cc18d552d2f2234092c829c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:17:09 2011 +0100
+
+ Fix format warning
+
+commit 883136c2b2fa0739f437a8cfb6614accc76e268e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:15:58 2011 +0100
+
+ More needs for NETSNMP_PRIo format specifier
+
+commit b8084a7ccc909b6d6db7c0e8e596d78671f5678b
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:14:26 2011 +0100
+
+ Fix using char as array index (ctype.h)
+
+commit 84529e6320a89d97f1314aebad806255d2a1b18c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:00:57 2011 +0100
+
+ Fix missing format for FreeBSD 4
+
+commit 4bd0352955a2551bfe02308dd134b9128c98b9e9
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 22:59:36 2011 +0100
+
+ Fix paranthesis problem
+
+commit fe6269b1900cf44dc27a199a761d15a01c3f3092
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 22:58:34 2011 +0100
+
+ Fix size_t/int mismatches
+
+commit a4db9f9fc13d21ecff488eb410376edda6c28232
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 13:43:34 2011 +0100
+
+ Remove unused variables
+
+commit 390c0114c8ec0bdb27b08b6f74e3f6ef3a62981b
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 13:37:49 2011 +0100
+
+ Fix format specifiers to avoid warnings
+
+commit 25cfc1962ae576ccb1558da1e3ef8b6c17f63c16
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 11:27:53 2011 +0100
+
+ Really up-to-date mibs
+
+commit 0e86c781f3989bf022c8993a118617b74a75420c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:17:19 2011 +0100
+
+ memory_linux: get Shmem from /proc/meminfo for 2.6 (or newer) kernels
+
+commit bf264d15ded7acbbf2e3871b98fd1fcef43d9ec3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:16:16 2011 +0100
+
+ memory_linux: close sockets in error situations
+
+commit 57ff8a40bae5d9bcad16089142a9cf328c9fa1f5
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:14:57 2011 +0100
+
+ disman/ping, disman/traceroute: Close sockets in error situations
+
+commit 8a2502a15c3217b95939a3c836167d230ac35f02
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:13:53 2011 +0100
+
+ Up-to-date list of RFCs wit mibs
+
+commit dcdd702111d8da5f53804cfcf0dfdad731468bde
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Nov 15 10:57:34 2011 +0000
+
+ Don't try to install an empty list of man pages (MAN3)
+
+commit ba619804e5978a8df754844efcca52b69b5015fa
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Nov 14 13:34:20 2011 +0100
+
+ MinGW: Make sure that the backslashes in the pskill message are displayed.
+
+commit 923eecc507f75043b60c5e68053a4f396ab0b0d2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Nov 14 12:36:38 2011 +0100
+
+ Compiler warning fix for systems where uint64_t = unsigned long (e.g. RHEL 6.1/x86_64)
+
+commit 434bfc1f7457550b6f87d5bcd511276b270b5964
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Nov 14 11:22:53 2011 +0100
+
+ CHANGES: snmpd: from Martin Wilck: fixed snmpd crashing with 'select: bad file descriptor'.
+
+ On 32-bit systems, snmpd dies with aforementioned message when using file descriptions > 32, e.g. when having >32 AgentX subagents.
+
+commit ed65eca6e7f9cfa7380a78d56c01ed314745b169
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 19:01:21 2011 +0100
+
+ FreeBSD-9: Fix for const'ifyed nlist arguments
+
+commit eaca7983e3655ab696fcc4461ca0cedbac6ce69a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 19:00:12 2011 +0100
+
+ NetBSD-6: One more instance of timespec replacing timeval
+
+commit 8ad6c53fdec5adeae4e52f1751ecec4a345bab05
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 18:59:01 2011 +0100
+
+ Fix buig #3436527: arp_netlink: fix dying reload of cache
+
+commit 378ffed03ba79a8346d6c62781e2ddf5ce92a478
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 18:55:43 2011 +0100
+
+ Fix bug #3436528: swinst_pkginfo: recover from NULL return from opendir
+
+commit d7ad8f5f9f3f67f16f65c2515d11e194d2cdd12c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 10 14:04:41 2011 +0100
+
+ CHANGES: Cygwin: Make date_n_time() produce time zone information
+
+commit ba35c50b2f459bd9c11ed59cc7d1b16215644fa3
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 10 14:17:04 2011 +0100
+
+ Replace AC_TRY_LINK() by AC_LINK_IFELSE()
+
+ Note: these changes do not affect the generated configure script.
+
+commit f615bf24f5d0f23ce9301da556184d6460740456
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 9 20:32:49 2011 +0100
+
+ Fis Bug #3434824: SIGSEGV when reading disk directive after SIGHUP
+
+commit a94a179d9340f51fa7c23431630bc0ffd6d759e8
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 9 20:30:51 2011 +0100
+
+ Fix bug #3433616: dont treat DateAndTime as a string
+
+commit b29e4164531d258fe34a6fe2b9e1ec60c56f9544
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Nov 7 01:25:57 2011 +0100
+
+ CHANGES: testing: Remove unused variable
+
+commit e221e65fdc1c68f1968651717dcc9ccfb6414783
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 3 15:05:00 2011 +0100
+
+ Fix warnings about converting sockaddr_in * into sockaddr *.
+
+ This is a follow-up for commit a0af385.
+
+commit 2e7e9eda0b0d62a7645a9a8f70ef3fb6f3dd6941
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 3 11:17:48 2011 +0100
+
+ Fix uninitialized variable warnings.
+
+commit 3462ebcdd0b7c298cb15c3099736f4f952257846
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 28 16:07:15 2011 +0200
+
+ Remove those superfluous parentheses that trigger a clang warning.
+
+commit 3e5fedd3e7d1ef31683604bf73dc56e944cad349
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Nov 3 09:45:27 2011 +0100
+
+ CHANGES: snmpd: fixed UCD-SNMP-MIB::systemStats after 30 days of uptime.
+
+ After 30 days, values from /proc/stat (on Linux) can get bigger than 32bits and snmpd calculations might render counters like ssCpuUser negative or zero, while the real value is higher. Therefore the counters should be tracked as the largest integer available.
+
+commit 0fc8221b24988c4ae6180ed42b86b9852fd586ad
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 2 22:59:08 2011 +0100
+
+ dskIndex was off by one
+
+commit a5b28829e64d5f3b87e4b9b1ef8cc204f33a61b7
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 2 21:25:07 2011 +0100
+
+ Solaris needs $AWK to get a usable nawk
+
+commit 2801a2139f27021e1ab15e362e2d3d624ffaa494
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Oct 31 22:55:53 2011 +0100
+
+ Patch #3406364: Fix unstable data for NetBSD.
+
+commit 821a58d112d7ac495149e262d704412ba2800438
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Oct 31 22:43:52 2011 +0100
+
+ Fix ipv6 statistics looping too far when scanning interfaces.
+ Fix TCP session table repeating data from first entry for all.
+
+commit 349591d03e17a55b43eacc6a687b02fd8d4e9528
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Oct 31 08:59:37 2011 +0100
+
+ CHANGES: perl: Make it possible to build perl support without support for opaque types.
+
+commit 1ec7110e72bce1561f746517459d6f043016b60e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 30 19:05:30 2011 +0100
+
+ CHANGES: testing: Make the asn1 test pass even if support for opaque types are removed.
+
+commit 6d26918af55aa3662a720542de77bbf39b0a3e91
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Oct 29 08:34:33 2011 +0200
+
+ CHANGES: snmpd: Disable the support for integer64 in pass scripts if compiling without opaque-special-types.
+
+commit 29bf69d70424f359d9c87f07a964a099415649a5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 13:02:25 2011 +0200
+
+ CHANGES: snmptrapd_sql: Avoid that a linker error is triggered on systems where my_progname is missing in libmysqlclient (e.g. Fedora 15 and 16).
+
+ This is a backport of commit 9f653f7.
+
+commit 2cc9504b9bb8625b94be6cda7e60993d059cd928
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 09:01:23 2011 +0200
+
+ CHANGES: snmplib: BUG: 3428506: Fix netsnmp_gethostbyaddr()
+
+ This patch should fix the regressions introduced by commit 85d96c4 (May 13, 2011).
+
+commit 9b427b353f1ceb8fe87e6fc8ed3b6cfab3ce7f20
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Oct 27 08:20:00 2011 +0200
+
+ MinGW: Avoid confusion between MinGW's kill.exe and the SysInternals pskill.exe
+
+commit 2c45f92cfcb5b05e049226a5a7883a0b106011ae
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 10:42:29 2011 +0200
+
+ Fix compiler warnings about passing a const pointer to a function accepting a non-const pointer.
+
+commit 275d23edfdebe0577b08421e4c6c936ae39b7fdc
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 09:33:09 2011 +0200
+
+ Fix compiler warnings about set-but-not-used variables
+
+commit 4495e17c078ac6997a9c7fa1a88db0644e919491
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 09:32:46 2011 +0200
+
+ Fix compiler warnings about casting away const
+
+commit 13952f6bee9f408867ab6d2fdfdde4f284074957
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Oct 26 14:05:16 2011 +0200
+
+ CHANGES: snmplib: from Siddhesh Poyarekar: properly clean up old requests in a subagent when we reconnect to master.
+
+ An snmp subagent linked against net-snmp-libs may crash if it handles a
+ response which has magic referring to an older disconnected main session. This
+ may happen when the subagent
+ attempts to clean up old requests on reconnection of the disconnected master
+ session.
+
+commit ae052472b22720d08369e85127db214245df2e3f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Oct 25 16:15:17 2011 +0200
+
+ CHANGES: perl: fixed segmentation fault when handler registration fails.
+
+ When netsnmp_register_handler fails, it frees its reginfo -> nsahr_DESTROY (and any other function) must not dereference it.
+
+commit c199bf91b6239f26b2aab34e8575e0f0df9cde9b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Oct 24 14:25:28 2011 +0200
+
+ CHANGES: snmpd: xfs, jfs and vxfs filesystems are now recognized in hrStorageTable
+
+commit 747fdc71e64d09e080928ebbb4d04cbde3906799
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Oct 5 15:57:59 2011 +0200
+
+ CHANGES: snmpd: Lowered severity of 'error finding row index in _ifXTable_container_row_restore' message.
+
+ The message is shows up when snmpd is started and there is different set of network interfaces than it was when snmpd wast last stopped. This is common on ppp-servers or virtual hosts.
+
+commit 250f698e59eab9f1ffd332ff59fdb72ea0df06ff
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 23 08:51:23 2011 +0200
+
+ CHANGES: building: Make the transport configuration code work again
+
+ Previously the transport inheritance processing code ran with
+ NETSNMP_FEATURE_CHECKING set. In this mode the file net-snmp/feature-details.h
+ is requiered. That file is created during the first make run, and that happens
+ after configure is run.
+ Change this to undefine NETSNMP_MINIMAL_CODE, effectively turning off feature
+ support during transport configuration in order to make it work at all.
+
+commit 6ef6907642247c663b9b8964b9fd44a211dbcaa7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Oct 20 20:30:54 2011 +0200
+
+ CHANGES: snmpd: BUG: 3408398: Fix a memory leak in agent/mibgroup/hardware/fsys.
+
+ This memory leak was introduced via commit
+ 9bf3d96d96a8ecd4a5fc35c326dc937467002b6c: Initial HAL
+ implementation of FileSystem information (March 7, 2008).
+
+commit cf82b894b2217c26edc6f1356351c932415604e2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Oct 15 14:45:08 2011 +0200
+
+ CHANGES: snmplib: BUG: 3423915: Change default number of retries back from 0 to 5
+
+ This patch fixes a bug introduced via commit 6cac050 (May 5, 2011,
+ added support for specifying the default number of retries in
+ snmpd.conf).
+
+commit c11adaa12915abfee629bb6c026c21f2185b216e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 17 10:24:46 2011 +0200
+
+ CHANGES: Win32: Avoid that compiling the header file <net-snmp/net-snmp-config.h> with the MinGW gcc compiler triggers warnings about "pragma comment".
+
+commit b17a72a793483aee4a5bb2f2e2c7f4fd869817e6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 17 10:22:20 2011 +0200
+
+ CHANGES: Win32: Avoid that the PACKAGE_* macros defined in <net-snmp/net-snmp-config.h> cause trouble when including this header in a package that uses the GNU autotools.
+
+commit 664d3ae107d754051b8c42279d459aa57a1be1c3
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 16:47:16 2011 +0200
+
+ MinGW, hw_fsys: Use proper format specifiers in a debug statement.
+
+ This patch fixes an issue introduced in commit 76ff25d.
+
+commit 211dcb49306561e35ba3c213be7cfa257b40a8e5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 15:52:43 2011 +0200
+
+ Avoid that gcc 4.6 complains about set but not used variables
+
+commit 9f653f73e5aa70f0bef1174632e95594f87f669f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 13:02:25 2011 +0200
+
+ CHANGES: snmptrapd_sql: Avoid that a linker error is triggered on systems where my_progname is missing in libmysqlclient (e.g. Fedora 15 and 16).
+
+commit 4c83b9229a7454f34f6ff75f69e67e4030c419b5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 7 15:58:45 2011 +0200
+
+ CHANGES: snmplib: Set the rpath for libperl.so in libnetsnmpmibs.so such that the dynamic linker can find libperl.so without requiring the user to modify the dynamic linker settings.
+
+ This change in agent/Makefile.in is necessary on the 5.5 branch and
+ later but not on the 5.4 branch. That is because the 5.4 branch uses
+ an older version of libtool that propagates the rpath of dependent
+ libraries. This is called inter-library dependency tracking in the
+ libtool manual. This functionality is present in libtool version 1
+ but not in libtool version 2. For more background information about
+ dynamic libraries and rpaths, see also the document with the title
+ "RpathIssue" on the Debian wiki (http://wiki.debian.org/RpathIssue).
+
+commit 8925c912d2639752a84bcffeef1b70a81026449b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 7 14:21:28 2011 +0200
+
+ CHANGES: agent: HOST-RESOURCES-MIB: Add missing brace in a debug statement
+
+commit 76ff25d9bf97579e7213102065fd5096f049a4c5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 7 14:13:18 2011 +0200
+
+ CHANGES: snmpd: HOST-RESOURCES-MIB::hrStorageTable: fix bug in handling large filesystems, where large means above 8 TB (= 2**31 * 4096 bytes).
+
+ This patch fixes a bug introduced in commit
+ 71d8293f387a6cd66bb0dbb13c0f50174d2e678b.
+ For the original bug report, see also
+ https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3419825&group_id=12694.
+
+commit 866033db9904ffb1203f283f838092e4cf68de6b
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Oct 6 07:33:27 2011 +0200
+
+ CHANGES: snmpd: Remove spurious #endif that seems to be the result of a mismerge.
+
+commit 20f4f3267ee20d55705b7a43789879c103f96620
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Oct 6 00:08:59 2011 +0200
+
+ CHANGES: building: Add missing end comments to feature ifndefs.
+
+commit e5de2cc57bf304f3320cad0034d2ea2d8aedc436
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 5 09:15:10 2011 +0200
+
+ CHANGES: agent: Log a more detailed error message if embedded perl initialization fails
+
+commit 5eef9990de28f63111e6c093be0f3c7ae2d513a1
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 5 08:45:49 2011 +0200
+
+ CHANGES: perl: Add agent::uptime()
+
+commit 6810ed42f9bc560750d6dbfb7e50b6e2ac11899c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 30 11:01:23 2011 +0200
+
+ CHANGES: Cywin: agent: Implement get_uptime() such that querying HOST-RESOURCES-MIB::hrSystemUptime returns a non-zero value.
+
+commit 97172b311d20f4441c7a7e90092b59c1e0da99f7
+Author: Thomas Jarosch <tjarosch@users.sourceforge.net>
+Date: Wed Oct 5 08:46:39 2011 +0200
+
+ CHANGES: PATCH: 3418649: HOST-RESOURCES-MIB: Use pclose() instead of fclose() to close a pipe.
+
+commit 6591937adb85000c27069c4be84cf4688838ebcd
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 16:18:03 2011 +0200
+
+ CHANGES: building: Add dependencies on @FEATURETARGS@ to make the subtarget work as well.
+
+commit b9c8012ec035bc084f175876fecc375195f9be81
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 14:02:58 2011 +0200
+
+ CHANGES: building: Add target to build agentxtrap from the toplevel
+
+commit 995647c0cfe00412262cc5797bdfae9d00b70c76
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 15:44:36 2011 +0200
+
+ CHANGES: building: Remove the use of -L flags for internal libraries as it confuses libtool.
+
+commit 93dc1235a0db58ffd29617cff00dc11263780202
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 11:31:46 2011 +0200
+
+ CHANGES: building: Make make apps work again
+
+ apps include snmptrapd and that require the agent libraries as well.
+
+commit ba41488ed44cd23c25963d4fc56c476853b2ab59
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 11:29:33 2011 +0200
+
+ CHANGES: building: When you say make libs you expect all the libs to be built.
+
+ This is demonstrated by the snmptrapd target at the top level which obviously
+ expected both libs to be built and so failed to compile before this patch.
+
+commit 3057c73e093473be46254bcdfb4ca788e432d1b8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Sep 30 07:32:52 2008 +0000
+
+ NEWS: building: PATCH: 2091156: correctly declare dependencies in Makefile.
+ 'make -j <N>' should work now.
+
+ Backport this to V5-4 as it is needed for correct operation in the single
+ threaded case of make miblib as well.
+
+commit 6eae340fa2a64086592982cc52735bc01487d978
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Oct 1 19:33:50 2011 +0200
+
+ CHANGES: building: Silence libbsd 0.3.0 nagging
+
+ If you have libbsd 0.3.0 installed then their version of nlist.h warns and
+ tries to make you include bsd/nlist.h instead. The problem is that we don't
+ need that compatibility library as we know how to do it ourself so it becomes
+ pure nagging. This patch adds a define that changes the warning into an
+ error and then figures out that there is no usable nlist.h and ignores it
+ for the future.
+
+commit ac38cb531bee50edc8d4c834f3005f5992c771d8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 19:03:02 2011 +0200
+
+ CHANGES: perl: Enable sending SNMPv2 traps with an empty varbind list
+
+commit a75de2971527ac2d2e812024298602bb2412f337
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 30 10:41:44 2011 +0200
+
+ perl/SNMP/SNMP.xs: Update emacs modeline
+
+commit 848f6300efe38492fb454451a030f0b7e6ff8c9d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 30 10:41:44 2011 +0200
+
+ perl/SNMP/SNMP.xs: Update emacs modeline
+
+commit c1374473ecd8ec9e0310013861ee18c83e5d6c5b
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Sep 30 03:29:36 2011 +0200
+
+ CHANGES: testing: Protect the use of $OSTYPE to ensure that 'test' get enough parameters.
+
+commit 7e97a20633a57eae39d015b23339463c32f5f848
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 10:22:08 2011 +0200
+
+ CHANGES: testing: Convert snmplib/test_binary_array.c into two unit tests
+
+commit 9c0dd98176457342fffaa5e74d802e3145ed70e7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 08:56:17 2011 +0200
+
+ CHANGES: testing: Add unit test for netsnmp_register_old_api()
+
+commit 5fd26e4fa3e000ea9c81c38ab975b7946efe2157
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Sep 28 17:49:55 2011 +0200
+
+ CHANGES: agent: Avoid that netsnmp_register_old_api() failure triggers a double free.
+
+ Fixes a regression introduced via commit
+ aa4d47c2609e52818c9cdf1a8e2205de9a335a0a (svn r19515).
+
+commit d2252d016693807326f72b66123649dea00af916
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 10:20:08 2011 +0200
+
+ CHANGES: testing: Require a semicolon after OK(), OKF() and PLAN()
+
+ Also, let OKF() emit a single line of output such that all output it
+ produces is visible in the output of "make test".
+
+commit 1421924b4852142192c5bb9e93ddbfed69e908fa
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Sep 21 22:20:08 2011 +0200
+
+ CHANGES: snmplib: Avoid waiting indefinitely if a session has timeout zero
+
+commit 5f27f4f74ae2bd5baf503cf306b4f9a2841a57cf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:32:03 2011 +0200
+
+ CHANGES: MinGW: testing: Fix a race condition in the test runner
+
+commit 09703958cc5ea845929ae19ef9e0804aecaa512e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 27 12:42:41 2011 +0200
+
+ CHANGES: testing: Avoid false negative for T114agentxagentxtrap_simple caused by the test result being present in the hex dump ("mostly_harmless")
+
+commit 439300279f6f31438638d2f222c24c3c841fa6ab
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 27 11:16:32 2011 +0200
+
+ CHANGES: building: Micro-optimize agent module dependency analysis
+
+ This makes the agent module dependency analysis carried out by the
+ configure script slightly faster, especially on those systems where
+ fork() is expensive (Cygwin).
+
+commit bbc680004a1376038dfdc4172dbe7b9e311fba68
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Sep 26 10:14:45 2011 +0200
+
+ CHANGES: MinGW: testing: Make test T130snmpv1vacmget_simple pass
+
+commit 70b06cf789208eaa890bfbcd638bdb775f817054
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 20 09:50:57 2011 +0000
+
+ CHANGES: Windows: testing: perl: Fix an incorrect message printed while running the Perl module regression tests
+
+commit 70bcc8de2d0fc92bbb8481823630fab9bc87af75
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 16 16:14:24 2011 +0200
+
+ CHANGES: MinGW: testing: Obtain the MSYS path from the environment
+
+commit 626275e2d1acafae7144a33ed301a40f596b37b0
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Sep 14 13:14:17 2011 +0200
+
+ CHANGES: Windows: Remove superfluous link libraries from project files (*.dsp)
+
+commit 38fc3caa9eeb3800254b4f6ad6f8f4764c0f83db
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 20 09:34:08 2011 +0200
+
+ CHANGES: snmplib: Make netsnmp_callback_accept() return -1 (failure) instead of 0 (STDIN_FILENO)
+
+commit 6c8c7e8aca8fc2eeb52010ae3e9fee6dd83ef780
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 13 09:58:26 2011 +0200
+
+ CHANGES: snmplib: Remove obsolete snmp_get_fd_for_session() declaration
+
+commit 0860d11fd8fc5dbdaaae2261fae2c07fb9c2c82d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 8 13:54:55 2011 +0200
+
+ CHANGES: Windows: MSVC: Avoid that the typedefs in <net-snmp/net-snmp-config.h> conflict with those in <stdint.h> from the msinttypes project
+
+commit f8a036f63ff68f083436120e0abd478b692a2f61
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 8 13:21:06 2011 +0200
+
+ CHANGES: Windows: MSVC: When linking with OpenSSL, link with user32.lib too
+
+commit 836a23e10ca810c3899902d32587616a9d1203df
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jul 14 18:38:13 2011 +0200
+
+ CHANGES: Windows: MSVC: Link with proper libeay32 library
+
+commit 7b07fd6cdef49ec7bb04b166e2a4fbb37b582840
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 11:10:38 2011 +0200
+
+ CHANGES: testing: Remove an incorrect comment from simple_eval_tools.sh
+
+commit 98f6d29d981ff8e607600c63dadb240535629807
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:49:03 2011 +0200
+
+ CHANGES: testing: Make ISDEFINED() check for an exact match instead of a prefix match
+
+commit 52cd0031a31f692f13263a94c335d06be1454803
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:12:59 2011 +0200
+
+ CHANGES: MinGW: testing: Make those regression tests pass for which SNMPCONFPATH and/or SNMP_PERSISTENT_DIR matter
+
+commit f5cd89bd3356dd74e1556c0b50966a643f192085
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:12:59 2011 +0200
+
+ CHANGES: MinGW: testing: Fix a race condition in the test framework
+
+commit deedd52c834a6448852a06785536e13865969694
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:12:58 2011 +0200
+
+ CHANGES: MinGW: Support the directory structure of recent Shining Light OpenSSL binary distributions
+
+commit d55bd4e0549f03b6fd32562c2aa7fe39272a9ef7
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Sep 28 06:55:19 2011 -0700
+
+ remove the v5.7 from the frozen list
+
+commit ac2aed3c94bb2ebb473af0a1e20f0561ad629956
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Sep 28 06:55:11 2011 -0700
+
+ remove the v5.7 from the frozen list
+
+commit 46eac02e9a27bf4f3068e795cab891f05a848870
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Sep 26 21:49:27 2011 +0200
+
+ CHANGES: snmpd: Avoid that snmpd crashes if started on a system with another OpenSSL library version than the one it has been built with.
+
+----------------------------------------------------------------------
+
+Changes: V5.7.1 -> V5.7.2.pre2
+
+commit 810185ae0b0cd2ad4d424a1ba775ef5ceaf50f03
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 09:24:19 2012 -0700
+
+ make depend for 5.7.2.pre1
+
+commit 6271471e01282f3675724eaf1358ceb0e95ddd4e
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 08:32:40 2012 -0700
+
+ Version number update: 5.7.2.pre1
+
+commit fcb782aa8893134c7414a926d9268594f725b915
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Sat Jun 2 08:32:18 2012 -0700
+
+ version update for 5.7.2.pre1
+
+commit e3bcd87c72fcea7706e868b5ace75296093f7497
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 14:09:42 2012 +0100
+
+ Fix dist/release format
+
+commit d813ce2eeefc68229cfcaf20603244cdd6d09d3c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 14:07:52 2012 +0100
+
+ Fix dist/release format
+
+commit fa7bd581e3783685db39c9b4eaf847be5ac86fd3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:53:10 2012 +0100
+
+ version update for 5.6.2.rc2
+
+commit 0739e2382d31146aca3205244cf70788b40a428d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:51:45 2012 +0100
+
+ version update for 5.6.2.rc2
+
+commit d9a15445aa74f5316bfc711c1558467872c2958c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:50:12 2012 +0100
+
+ make depend for 5.6.2.rc2
+
+commit bcabd2c9542dbebd1d319b4494413bdcca06614e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:38:38 2012 +0100
+
+ Release Candidate for V5-6-patches
+
+commit b473898c0c5ac9eb47c7c05a3f745e4ff2a76aaa
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:38:28 2012 +0100
+
+ Version number update: 5.6.2.rc2
+
+commit 131429e7062fbaa65b82affed1fb92df2c0cc813
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:38:38 2012 +0100
+
+ Release Candidate for V5-6-patches
+
+commit 1c8110b33b8105ca6190945a35fe7ae903252d68
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:21:38 2012 +0100
+
+ Avoid perl versioning problems when setting up the build environment
+
+commit 508ece16e6f6f49562da204792ae0644269994d1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 13:20:58 2012 +0100
+
+ Fix handling of dist/release merge
+
+commit 5b8a8547b1a47d2f5b207f48f2496e4241d902c6
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 11:10:48 2012 +0100
+
+ version update for 5.5.2.rc2
+
+commit 6c32914bf28d695df349dca269e488b501700316
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 11:07:22 2012 +0100
+
+ version update for 5.5.2.rc2
+
+commit 9f5a82a5afdbb3daeb2fd437a309f0b8d357cf4b
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 11:05:39 2012 +0100
+
+ make depend for 5.5.2.rc2
+
+commit 39203f29477a3bedf012d41135d8abd6bcad08b1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:54:27 2012 +0100
+
+ documentation update for 5.5.2.rc2
+
+commit 17e79ef0fad79609c5ba2feb4e8b9eb5d7db6886
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:46:11 2012 +0100
+
+ Release Candidate for V5-5-patches
+
+commit 5821be5bbb4018ded282fbbbd4830cf2eeadd9e1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:45:59 2012 +0100
+
+ Version number update: 5.5.2.rc2
+
+commit 3f2111de6733a04e12d910d306a34d671e008762
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu May 31 10:46:11 2012 +0100
+
+ Release Candidate for V5-5-patches
+
+commit ccf8ff2c4db60122d41302e4aeb700e0b868105f
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 28 10:18:43 2012 +0100
+
+ CHANGES: snmplib: PATCHES: 3526599: Don't hang on retried failing SNMPv3 responses
+
+commit c81c8483990911f47435d3005255d91c37ab92b2
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun May 27 14:09:26 2012 +0200
+
+ Fix BSD that downnot always like IP_SENDSRCADDR - so retry without
+
+commit ffce1f2dc2f8b31abd01f93b26da78f4726a1e64
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun May 27 14:03:58 2012 +0200
+
+ Fix OS missing MSG_DONTWAIT (AIX). Backport from 5.7
+
+commit c575216850185b56454dad0253e3164979e13513
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun May 27 13:56:01 2012 +0200
+
+ Fix missing include. Fixes SIGSEGV on FreeBSD9 x64
+
+commit 5805878749c08062debf0a9d798d08fb916caa2d
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun May 27 06:23:19 2012 +0200
+
+ CHANGES: snmpd: Add missing debug tag
+
+commit d1a42bbcc7b14730c9a6d99c4f047097843a549b
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri May 25 09:02:27 2012 +0200
+
+ CHANGES: building: Run libtool --mode=finish on the right directory
+
+commit 1fbf33711a19eac9739ad23f6f6251eacc41f1c4
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue May 22 14:54:45 2012 +0100
+
+ CHANGES: Linux: PATCH: 3525998: Don't use an uninitialised value in error message
+
+commit 32c1686b67dc85c4a189576363065609dfed5e61
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue May 22 14:52:56 2012 +0100
+
+ Attempt to mark release-candidate branches as such.
+ Omit final-release-only steps when preparing preN/rcN releases
+ (Relies on a tweak to the Makerelease perl modules)
+
+commit 4c5633f1603e4bd03ed05c37d782ec8911759c47
+Author: Robert Story <rstory@freesnmp.com>
+Date: Mon May 14 11:40:06 2012 -0400
+
+ NEWS: snmp: BUG: 3526549: CVE-2012-2141 Array index error leading to crash
+
+commit 65dd83c2255ee58edbf0e25863e55b58a4113679
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 20:30:42 2012 +0100
+
+ version update for 5.6.2.rc1
+
+commit ac4bc65e2909f3bd85f32f04b504fa65d2f64553
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 20:28:06 2012 +0100
+
+ make depend for 5.6.2.rc1
+
+commit b74994864195119edb6e19c85147fac00bcb93e3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 20:13:46 2012 +0100
+
+ Version number update: 5.6.2.rc1
+
+commit 91350092c46e66d06d74143f4816473db4d25160
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 19:56:33 2012 +0100
+
+ Mark version-specific changes _before_ pushing to central repository
+
+commit 7241accd70b82d0fcd44d5a5238b2ee9445900db
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:53:17 2012 +0100
+
+ version update for 5.5.2.rc1
+
+commit 7c796a15a1d1bb85feea940bd4e3516877920919
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:50:49 2012 +0100
+
+ version update for 5.5.2.rc1
+
+commit 07e268bfb64b0ec645b3f7e87266984f9217cf12
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:44:37 2012 +0100
+
+ make depend for 5.5.2.rc1
+
+commit 16eaaf6c3ba14596ca9efaf4b114f1b709f42b68
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:29:03 2012 +0100
+
+ documentation update for 5.5.2.rc1
+
+commit c729469ef12154930cf9d15967e16186fb445f30
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:27:20 2012 +0100
+
+ Version number update: 5.5.2.rc1
+
+commit 142571d3cea08f0c072d24c1d39a43c7446f8ce7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:01:03 2012 +0100
+
+ When building a new release, the installed version of the perl
+ modules may well be different to the version being built.
+ That should not break the build.
+
+commit eba86b6f7aff261ee0e61334df70de7156e5c3cb
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon May 7 17:01:03 2012 +0100
+
+ When building a new release, the installed version of the perl
+ modules may well be different to the version being built.
+ That should not break the build.
+
+commit 5c0f64d6db2b593f7cc0ed2d4f55b7c592b774a8
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:25:15 2012 +0200
+
+ Only output cpu warnings once.
+
+commit ee58e4827b9fa16e6635ca003e8a4f11dcb5fb7a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:17:42 2012 +0200
+
+ Fix speling in errormessage.
+
+commit 03f485df22f20e149cfae94c57cb82feecb5d74b
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:12:11 2012 +0200
+
+ Not all Linuxes use rpm (debian/ubuntu comes to mind)
+
+commit 930838224f781696bd35225f22569347416f1b16
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Apr 23 22:10:15 2012 +0200
+
+ Check need for -lm to use round/exp
+
+commit a0609cf1f3a6917d263725732248cd937a45ad94
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Apr 7 08:40:44 2012 +0200
+
+ Remove limitation on configuration line length.
+
+commit 305973338a63ae54c5e02a8626fbe9a8064dcb7e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Apr 7 00:32:19 2012 +0200
+
+ Reduce variable scopes.
+
+commit ccab4e9d3ed424c39d0dc27be63fa76c7461ea81
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Apr 7 00:15:22 2012 +0200
+
+ Internalize the name and line number of the curret configuration file
+
+commit cf874ad7b9daf4fcc0d46cdd034474b478005341
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Apr 6 21:47:28 2012 +0200
+
+ Replace #if (A) B #else B #endif with B.
+
+commit ef9ea641bc290eec50685b60519b31bee8b14a69
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 9 21:04:06 2012 +0100
+
+ version update for 5.6.2.pre2
+
+commit 35aba1959de119f1fb89203c37109aa6f0e21c57
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 9 21:00:40 2012 +0100
+
+ version update for 5.6.2.pre2
+
+commit e41fbaff18ac9095cf4a739a06ec39a1a6ccfdc1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 9 20:35:35 2012 +0100
+
+ Version number update: 5.6.2.pre2
+
+commit 137fe582d6cc5611430dab46ef144efd84cfc803
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Fri Apr 6 20:46:56 2012 +0100
+
+ Revert commit 1f4a829b18275e4956ca91e5ec370df015f06133
+ (snmp_store_needed() API is not available in 5.[45].x)
+
+commit 2b7e64288c01a8a062026c521ca31a5e885f30cc
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 16:12:12 2012 +0100
+
+ FreeBSD-9: Fix for 'const'ifyed nlist arguments
+ Backport of ed65eca6e7f9cfa7380a78d56c01ed314745b169 from V5-6-patches
+
+commit 7e95d80b698051259645c074a53ffd264a6fa916
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 16:06:56 2012 +0100
+
+ FreeBSD-9: Fix for 'const'ifyed nlist arguments
+ Backport of ed65eca6e7f9cfa7380a78d56c01ed314745b169 from V5-6-patches
+
+commit 1a9b7b7c02e2deefe994d595a7cc1dd2ffbeee1d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 15:51:20 2012 +0100
+
+ Fix compilation on FreeBSD 9.x with 'recent' header shuffling
+ Backport of c53d8c3525f590f2213d35b0da94123862f3e366 from V5-5-patches
+ (Patch #3363308 - omitting tweaks to configure)
+
+commit 3d9ddb41e263bc1a78f9f9440b8d4ad4f86c82e1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 10:36:18 2012 +0100
+
+ Fix typo
+ Backport of 5b702b024b60176d7f5699b92e55da50a8deae71 from V5-6-patches
+
+commit 0d35c609564b66a1ffe81556d37adf0503c389ce
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 10:15:08 2012 +0100
+
+ Provide missing definition of NETSNMP_PRIo
+ (used in agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c)
+
+commit a79141a419953d010a6989e8b88f4df127394d38
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 09:19:26 2012 +0100
+
+ Header fiddling for FreeBSD,OpenBSD,Dragonfly
+ Backport of f7b0de1518002c6e8f9b94ef3deb8882e1e9338e from V5-7-patches
+
+commit adf74bf753d3970357afd633803256241d9c7b87
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Apr 2 08:20:46 2012 +0100
+
+ Fix IPv6 TCP & UDP tables, *BSD support (including OpenBSD)
+ Backport of commits 5cd1573625471c0583e9087aec6802b77157d5a2
+ and 50d73f0d56fe22c590530b3e305d41dcdac3ce00 from V5-6-patches
+
+commit d9555acb9f47c3aa8fde4bc20a44d7ca6181a8a9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sun Mar 25 18:48:12 2012 +0000
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Avoid dangling pointers (based on patch 3503259)
+
+commit 82a8b47ee96e5d29a2b7ac3ca00722d737d5b479
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Mar 29 22:31:56 2012 +0200
+
+ Running autoheader / autoconf
+
+commit 9ca8d939ab393306a1d0f146c9cb70ea0cb19d49
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Mar 29 22:30:38 2012 +0200
+
+ Running autoheader / autoconf
+
+commit cecd4869deb68f3d4c71e768d5b40dd576446925
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Thu Mar 29 22:29:31 2012 +0200
+
+ Running autoheader / autoconf
+
+commit a1a4513bd3e4e614200f6db5a02f61d6c8eefb32
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 28 09:47:45 2012 +0100
+
+ Doxygen-style documentation fixes (backport of git commit c09903a42e9d97331fd9e48ee831a85afdf9c70a)
+
+commit 9bdbcca122c37da304fc6aa6939729475f90f5fd
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 28 09:30:49 2012 +0100
+
+ Doxygen-style documentation fixes (back-port of GIT commit c09903a42e9d97331fd9e48ee831a85afdf9c70a)
+
+commit 1f4a829b18275e4956ca91e5ec370df015f06133
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 27 21:41:24 2012 +0100
+
+ CHANGES: snmpd: PATCHES: 3495697: Store persistent snmpTarget table changes
+
+commit 1f75f377d0db01754c0c161dc44373081beef520
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 27 21:14:06 2012 +0100
+
+ CHANGES: FreeBSD: PATCHES: 3489387: Install FreeBSD 10 header file (plus other missing versions)
+
+commit 3d72c9e78f2ad817c9d1d82977327bbb20d63ab9
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 27 21:06:31 2012 +0100
+
+ CHANGES: snmpd: PATCH: 3487867: Don't skip missing ifXTable entries (ifConnectorPresent FALSE)
+
+commit 12906578ab30cf776d080c0ef3025b30334d7655
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 16:17:45 2012 +0200
+
+ DISMAN-PING-MIB: Fix even more memory leaks
+
+commit ccfd5ca6fe10313d6181d24bbb1797825a97da10
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 15:51:16 2012 +0200
+
+ DISMAN-PING-MIB: Eliminate duplicate code
+
+commit 9fda2668722f08ddbfdd67a2239d8b021db64a83
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 15:48:46 2012 +0200
+
+ DISMAN-PING-MIB: Write a loop as a loop
+
+commit cbc18eb763ba6df69ef70668a54d75bf35e79503
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 15:24:08 2012 +0200
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix more memory leaks
+
+commit c7725192478aec018fb4aefa60946e04a406c00c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 13:43:24 2012 +0200
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Avoid reading freed memory when deleting a row from a table
+
+commit a6be739566f310d7441fd7f54989e39446f7a143
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 26 13:42:28 2012 +0200
+
+ Extend DISMAN-PING-MIB test
+
+commit 8a9b57291453cb8aec28e766c594701ed19c4fc6
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 26 21:03:41 2012 +0200
+
+ Fix for DragonFly 3
+
+commit e5c9a32f79eac2e85527c9cf05087cdae9b35a6c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 26 20:59:53 2012 +0200
+
+ DragonFly needs _KERNEL_STRUCTURES to compile ipv6 code
+
+commit cd43bc09a39bd97ff5e719a2ce232ce424600a65
+Author: David Imhoff <dimhoff@users.sourceforge.net>
+Date: Sat Mar 24 15:47:17 2012 +0100
+
+ CHANGES: snmplib: PATCH 3510454: Allow the use of 0.0.0.0/0 as alias for default
+
+commit e2fc15f9e5a6e3e36be5f489601cbf6bf731917f
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 24 15:21:38 2012 +0100
+
+ Fix TCP state values for DragonFly
+
+commit 432fe3ddf54f2c98f936959469cb9b014d599f06
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 24 15:10:52 2012 +0100
+
+ Require perl to do pass_persist test
+
+commit 37d2770cf50c98023eeba90e25d372bff7316ada
+Author: Niels Baggesen <nba@user.sourceforge.net>
+Date: Sat Mar 24 15:06:40 2012 +0100
+
+ Fix TCP state values for DragonFly
+
+commit 86a948d8691e881d55591dcabddc2739ce72b30e
+Author: Niels Baggesen <nba@nba-linux.sb.statsbiblioteket.dk>
+Date: Sat Mar 24 15:01:37 2012 +0100
+
+ Properly find pass helpers for testing.
+
+commit fe26a3c4f29f046bf65ed52e9d94054b675fbc4b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Mar 22 09:04:42 2012 +0100
+
+ DISMAN-PING-MIB: Limit source code lines to 80 columns
+
+commit 745bafcdcc9c8e84616d4e274db2a384bf234da2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Mar 22 08:55:05 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Make ping implementation independent of ntpd clock jumps
+
+commit da6925e6763cadbe02f4a8bbfe68a362e535ad5e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 10:38:36 2012 +0100
+
+ CHANGES: testing: Add testing/fulltests/default/T154dismanpingmib_simple
+
+commit fa606dd7ca6aff9308d4e8b01bbcde148f441271
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 16:49:21 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Make pinging local interface addresses work
+
+commit 617a83ba799575c84c66f6b1c480ef633161a64c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 16:28:46 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix a socket leak triggered by pinging a remote host
+
+commit 625f55c272ec6281e38d8e30eb53fd51516b00ae
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Mar 22 09:54:55 2012 +0100
+
+ DISMAN-PING-MIB: Convert a dynamically allocated variable into a stack variable
+
+commit b48f19ad4b4aa68c3e16e2a72df37b9c0cd36c4a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 16:24:07 2012 +0100
+
+ DISMAN-PING-MIB: Add more debugging statements
+
+commit d74cb3966175892562f5e3a9b1683acba2c22e07
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 11:45:18 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix several memory leaks
+
+commit 0b1a77674678cc9a15be3e7700d3cef650ed02c7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 12:00:30 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Do not send the contents of the stack over the network
+
+commit 139023cd3ab51631cc10e2866d71abcf99ae4c1b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Mar 21 08:56:07 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Don't call exit() upon memory allocation failure
+
+commit 169b6aaa7b61827cc1ad0b3aeeae3a7229dd25d8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Mar 21 08:53:26 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Fix IPv6 socket leak in error paths
+
+commit a0be32ad053a71fa96134d55e542bb07d4f0297d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Mar 20 11:43:46 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Avoid that host name resolution failure causes a crash
+
+commit bf9bff64556787d766ee2ef2d578afb920719f3a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Mar 21 08:51:55 2012 +0100
+
+ CHANGES: snmpd: DISMAN-PING-MIB: Convert printf() statements into snmp_log() and DEBUGMSG()-statements.
+
+commit 5d74c01245523a9d8db1eda27d1efae2ebc104fb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:40:02 2012 +0100
+
+ New MIB: VRRPV3-MIB
+
+commit 5b38f062b99b6ef36708e2c7de4965a3192612e9
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:34:48 2012 +0100
+
+ For safety, sizeof the right variable in memcpy
+
+commit e5f82782da05efa7c0e6dc2bf5a41ee11868f469
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:33:21 2012 +0100
+
+ Fix for hrSWRun data for FreeBSD
+
+commit 8327565e823270d10a4504568edbe5b5ae323a55
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:31:54 2012 +0100
+
+ Clean up variables for OpenBSD/NetBSD
+
+commit 170f6f027bf4f9174b7073530da4d07f400bba58
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:28:58 2012 +0100
+
+ Move declarations in front of statements
+
+commit dbb4573b69fae85cdc931b2892b5ce4e5b16b321
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Mar 21 18:23:36 2012 +0100
+
+ Require kernel_netbsd for NetBSD6
+
+commit f11681f15aad7d9a52fa29812ecbb507f1b7fe24
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 21 12:36:38 2012 +0000
+
+ Check for old tarballs (and unpacked distributions) before starting.
+ These can confuse steps such as "make dependcheck", that do a 'find'
+ on the current tree, and would descend into such unpacked source trees.
+
+commit 470dcd4b6c3ff11ff0a3532a7340a56cffd69098
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Mar 21 12:32:13 2012 +0000
+
+ Don't run "make docs; make mancp" if there's no Makefile present
+
+commit c9ac420343e16df2b7065f5bf2790df44e247fba
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 20 10:26:10 2012 +0000
+
+ Allow distribution as part of normal Net-SNMP packages.
+
+commit 5999f60c57723f23f3c254af57fdb10af301a8eb
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Mar 18 19:03:08 2012 +0100
+
+ Regenerate
+
+commit 275d204036a607e3df50e8447d4bc755e9db02fd
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Aug 28 21:29:03 2011 +0200
+
+ CHANGES: building: Make it possible to use --disable-applications/--disable-agent together with --enable-minimalist
+
+commit bdccc875710295aacf50f71eb1c1d2ee97f336fe
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Mar 16 20:10:58 2012 +0100
+
+ Do not declare the local variables for opaque_special_types unless that option is set.
+
+commit b80a67da052adca1b5a644db83a782e15c2237c3
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Mar 16 19:50:03 2012 +0100
+
+ Check that the data exist before trying to read it
+
+commit efae86bba5962491d42b77b935191a3eb25dd939
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Mar 14 01:05:33 2012 +0100
+
+ Partially revert "Merge remote branch 'origin/V5-7-patches' into V5-7-patches"
+
+ Commit d35a1860217e723e4f866dd98ef6621665934c4a accidentally reverted
+
+ 4a2e5bcd56cd2afb36eb15d754e2fee888dd50c0 (hrh_storage is a proper replacement for hr_storage)
+ 0dd1e54557d1ba498b55d017b0a93e8ccf9bd522 (CHANGES: snmpd: UDP-MIB: Report the proper address in udpLocalAddress)
+ 5116d48378ecf03e722f3010ad47bf22a3fbcb8c (Reduce scope of prefix_val such that the compiler doesn't warn about an unsed variable)
+ 10f566f4d4cbb3e205023c23669289e4bfd089cb (perl/SNMP/SNMP.xs: Fix a compiler warning)
+
+ and part of
+
+ 6e74d64f85a59d50e461db4c34ac76f9de468bfb (Avoid using grep options -q and -w because grep in Solaris)
+
+ This reverts those reverts.
+
+commit aaedd59cc2da701527dc2d261d4e9f85f16e7504
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Mar 11 20:57:38 2012 +0100
+
+ Allow make test where the source path contains the string Net-SNMP to succeed.
+
+commit 4b94d796918a4eeae68ab21aa53d444a8b5c2921
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Mar 9 08:04:59 2012 +0100
+
+ Unbreak compilation on FreeBSD 4
+
+commit 10fe6b83324ad37d18b937cc8c6de94de534d035
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 8 13:04:07 2012 +0000
+
+ version update for 5.6.2.pre1
+
+commit e1122edc1a5fe7976b065044134d39e7db5985ea
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 8 12:43:19 2012 +0000
+
+ version update for 5.6.2.pre1
+
+commit a613d3a834912206d1ba5971e441a3ea6b36af23
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 8 12:33:03 2012 +0000
+
+ make depend for 5.6.2.pre1
+
+commit 0ef34e6519dfcb82c97df8427547c08dcf81e69a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Mar 8 10:11:30 2012 +0100
+
+ CHANGES: snmpd: Fixed snmpd '-d' option.
+
+ Now it dumps packets again.
+
+commit 8e69742f143e4fc11196e5b2ed66c8f7f53fd02f
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 6 09:24:21 2012 +0000
+
+ Version number update: 5.6.2.pre1
+
+commit c4e00b8c3e1010cdcab5e6c02d60d75df9c6dcf2
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Mar 6 09:24:05 2012 +0000
+
+ version update for 5.6.2.pre1
+
+commit 39490104a3ab58235aace2f9d871c266dc4485ee
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit 4a2e5bcd56cd2afb36eb15d754e2fee888dd50c0
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 5 20:59:38 2012 +0100
+
+ hrh_storage is a proper replacement for hr_storage
+
+commit ce85832932ccd916c42319114c40885a466a9d0e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Mar 5 20:56:40 2012 +0100
+
+ More fixes for Solaris sh
+
+commit 0dd1e54557d1ba498b55d017b0a93e8ccf9bd522
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 15:08:26 2012 +0100
+
+ CHANGES: snmpd: UDP-MIB: Report the proper address in udpLocalAddress instead of 0.0.0.0. Makes test T160snmpnetstat pass again. Fixes a bug introduced in commit c76fb96f65e33ba2fd212a921e8c386155ee5c7a.
+
+commit 518917e9f39f7a9d3c3bf3a865e8ac0e3026d600
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 14:04:54 2012 +0100
+
+ snmplib/snmpUDPDomain.c: Fix source code indentation
+
+commit 2651909ccceabfcfadaf942c02450e28fe837dc9
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Tue Nov 9 12:04:04 2010 +0000
+
+ Passes now on MinGW too.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19653 06827809-a52a-0410-b366-d66718629ded
+
+commit e41f115e40304c941ba17d67e24710722d90741b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 13:39:17 2012 +0100
+
+ testing/fulltests/support/simple_eval_tools.sh: Avoid using grep options -w and -q because grep in Solaris' default path doesn't understand these.
+
+commit 5116d48378ecf03e722f3010ad47bf22a3fbcb8c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 10:47:20 2012 +0100
+
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c: Reduce scope of prefix_val such that the compiler doesn't warn about an unsed variable if it isn't needed.
+
+commit 6e74d64f85a59d50e461db4c34ac76f9de468bfb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 09:22:31 2012 +0100
+
+ testing/eval_tools.sh: Avoid using grep options -q and -w because grep in Solaris' default path doesn't understand these options.
+
+commit 10f566f4d4cbb3e205023c23669289e4bfd089cb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Mar 5 10:47:39 2012 +0100
+
+ perl/SNMP/SNMP.xs: Fix a compiler warning
+
+commit 44aa265891cd563f7f4114ef25dcf7aaf3b14e9a
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit dae4e16be86117861f63d1a2f981ad361418f5c6
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit 28f6226f2e228b8ca248489735f86502b2cce0a1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Mar 5 09:06:52 2012 +0000
+
+ Mark the changes make as part of the release process as specific to
+ the particular branch being released. Version tags, changelog entries
+ and the like shouldn't propagate to later branches.
+
+commit 40022a697958259ccfbb3fed44eb3c472f5e837e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sun Mar 4 10:37:41 2012 +0100
+
+ Solaris sh does not understand "test -e"
+
+commit 773af0c42e077bebdaecf1c0caf393285a7688f1
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 3 17:19:30 2012 +0100
+
+ Clean up nsrollup complications
+
+commit ee71049c3e21c1d0e3424297136652bbe0e39d85
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Sat Mar 3 16:49:41 2012 +0100
+
+ mibgroup/icmp.c: adjust ifdefs to make it compile on BSD's
+
+commit ce9600361e665dde17af9d8ab16d7ce85dc05643
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:39:55 2012 +0100
+
+ dot3StatsTable has bugs :-(
+
+commit dffacf6fa0755e1700cbac25b844185abd807a0a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:38:10 2012 +0100
+
+ passpersist test needs /usr/bin/perl
+
+commit 8726995c7a8aef674c4f164b1871c37bbdcdad50
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:36:58 2012 +0100
+
+ grep -w fails with OpenBSD and Solaris 10-64
+
+commit 1eb4745b23cc3a839864e7f6ea28355b0566eb67
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:35:49 2012 +0100
+
+ Solaris needs /usr/xpg4/bin/grep to understand -q
+
+commit 9954b4b741fd8c63d6128bd0527298c8e4e989fc
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:34:45 2012 +0100
+
+ Make sure we have the proper srcdir for out-of-source builds
+
+commit 78369002be2711f0aa876b64a4e10b090cc241cd
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:33:31 2012 +0100
+
+ Not all make versions define $(RM)
+
+commit 94245b29a3cda89475c6eab5d9493c6657ff38e3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:24:24 2012 +0100
+
+ Make autoconf 2.68 happy
+
+commit 44acd6c285fb5614b4c9611b1abdeca9dd28e4bb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Mar 2 21:12:47 2012 +0100
+
+ Fix spelling of mib module fsys_getfsstats
+
+commit 1fa1fee3693f67b820223806b3d73afd4c50ec18
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Mar 2 01:37:20 2012 +0100
+
+ Silence a clang warning.
+
+commit 93263b98a5db344cf2c4d489c43971e7b29cdb03
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 13:37:20 2012 +0000
+
+ version update for 5.5.2.pre1
+
+commit 5a175428b973d2ea8553e29fecf94cf1566aa858
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 11:48:18 2012 +0000
+
+ version update for 5.5.2.pre1
+
+commit 364276a1c5aa66caa23eb5b7f111fdeb5af71fa7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 11:45:10 2012 +0000
+
+ make depend for 5.5.2.pre1
+
+commit 73598340172eff75729a6d57192b8171d5bbf00e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 10:42:56 2012 +0000
+
+ Version number update: 5.5.2.pre1
+
+commit f3214402672ca199fd531e66122bf96c4d9a4eb7
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Mar 1 10:42:39 2012 +0000
+
+ version update for 5.5.2.pre1
+
+commit 2e74acb6f19e4729cede0ab43e931961cb23aaea
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Mar 1 09:18:39 2012 +0100
+
+ CHANGES: Bug 3152841: Do not install the util_funcs subheaders that were removed in 5.7
+
+commit b7109646b95a70713d1ad991d41bccd57c0bb3eb
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Mar 1 08:48:48 2012 +0100
+
+ CHANGES: Bug 3152841: Install util_funcs subheaders introduced in 5.6
+
+commit 432cbb7a5501ab90d66d0a83e731e7343bc04b37
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Feb 25 10:13:15 2012 +0100
+
+ Correct typos
+
+commit 6a6c9bbc7584f196a1185cc1935204f1206811ed
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Feb 29 08:55:35 2012 +0100
+
+ CHANGES: Bug 3152841: Install util_funcs subheaders
+
+commit d515e2a6e4c2a1c4d84734cc7b2d0b2fc5a894ad
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 15:56:21 2012 +0000
+
+ CHANGES: snmpd: PATCHES: 3487919: Fix compilation when caching is disabled
+
+commit af8368ed8898a78d0868b47af46bc9db07d1c764
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 15:50:56 2012 +0000
+
+ CHANGES: snmplib: PATCHES: 3414773: Encode integer value using ASN_INTEGER
+
+commit 19e2715807fe06fd0baedf88165011aee933e755
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 14:05:34 2012 +0000
+
+ CHANGES: man: BUGS: 3490708: Clarify use of common command-line options
+
+commit 65f7962f932c9b75c5bbbb047d1e26ae60978e53
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 12:23:34 2012 +0000
+
+ CHANGES: snmpd: BUGS: 3489631: Fix incorrect handling of UCD monitoring flag
+
+commit ac166051b6a092dd4a594326ec85e2f699b62547
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 11:57:41 2012 +0000
+
+ CHANGES: testing: BUGS: 3474590: Don't match underscores within the source root filename
+
+commit 879bf7079d34fa46f6fcf54a01c8500beaece59a
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 10:44:41 2012 +0000
+
+ CHANGES: snmpd: BUGS: 3460364: Fix use of block factor when detecting error conditions
+
+commit 034f1c572f683ea428583074471e5d5d13b51837
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 10:22:20 2012 +0000
+
+ Skip SET-based tests when configured using --enable-read-only
+
+commit 36423e210bfb65ef121c6a66aec438c7c237d3df
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 10:03:25 2012 +0000
+
+ CHANGES: BUG: 3454168: configure: Fix building with --enable-read-only
+
+commit eed0bcbc43fea18259f0f63b2081b6d10535a052
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Feb 28 09:27:11 2012 +0000
+
+ Skip SET-based baby-steps when compiled with --disable-set-support.
+ Inspired by bug #3454168
+
+commit ec6a23030e5a2072c19c18c1d9c124387da56b7b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 27 18:42:58 2012 +0000
+
+ Add -lrt to NETSNMPLIBS such that clock_gettime() can be found
+
+commit f13320500294bb240f63c6dd7d2e9a2208eb740d
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Feb 27 16:52:51 2012 +0000
+
+ Skip SET-based tests when compiled using --disable-set-support
+
+commit c4276b6232c29145c039884e6b5a6b6da4b93837
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Feb 27 15:54:45 2012 +0000
+
+ Omit SET-related code when compiling with --disable-set-support (inspired by patch #3424930)
+
+commit 01c930edcc25700d6b5fb0376f55a26425e13fb0
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Mon Feb 27 15:17:22 2012 +0000
+
+ Omit SET-related code when compiling with --disable-set-support
+ (inspired by patch #3424930)
+
+commit 9484d83203c4e2d820416be665fa833aa70444d2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Feb 24 14:00:32 2012 +0100
+
+ Rework commit b4a19505a05816e94e01de97bf99ac37fcdc6d23.
+
+commit 2b7f13495228635d816e58b2174dc124dd0cf39f
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Fri Feb 24 07:43:22 2012 -0800
+
+ set MERGE_AUTOEDIT before merging to avoid the future git 1.7.10 forced msg
+
+commit e1b910b0be9343586ae9edba6f46040af315fcdd
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 10:27:54 2012 +0100
+
+ CHANGES: snmpd: init_agent() + init_kmem(): Return an error value instead of invoking exit() if access to kernel virtual memory is denied
+
+commit 463eed2120f9d191bc22673496a49e8174664e4b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 10:03:31 2012 +0100
+
+ Remove obsolete symbol NETSNMP_EXIT_ON_BAD_KLREAD
+
+commit c36ab71a4e096f16cc5a55533f080c9a94009914
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 08:53:56 2012 +0100
+
+ CHANGES: FreeBSD: snmpd + apps: Sending UDP packets works again for non-root users
+
+commit edebddba930f8b1472fa0bd20fc413ef8cf464a2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Feb 21 11:31:46 2012 +0100
+
+ testing/RUNTESTS: Fix a bashism
+
+commit b4a19505a05816e94e01de97bf99ac37fcdc6d23
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 20 16:58:47 2012 +0100
+
+ Fix compiler warnings about %ld versus time_t on systems where time_t is a synonym for long long instead of long.
+
+commit d8978ecc8211be7c1e7905f1e215bb06ded266b6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Feb 21 12:32:25 2012 +0100
+
+ Fix snmplib/transports/snmpSocketBaseDomain.c file header
+
+commit aa766d196e5287f6ca79b58a345b024260aba354
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 20 17:07:13 2012 +0100
+
+ IF-MIB: do not trigger undefined behavior (>> 32 of a 32-bit variable) when updating a counter and ifi_ipackets is a 32-bit variable
+
+commit c3fb6dd9e6b99e9542493188987871fc5017cb3c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 23 09:45:45 2012 +0100
+
+ Fix a compiler warning on systems where mode_t is unsigned
+
+commit f8a3ef0d3d4e530279900101049b8de98a44a6fb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:48:52 2012 +0100
+
+ CHANGES: snmplib + snmpd + snmpwalk: Avoid that system clock changes (e.g. by ntpd) affect code that needs relative time
+ CHANGES: snmpd: Make sure that the range of the SNMPv3 variable snmpEngineTime is 0..2147483647 on all supported systems instead of 0..42949672 on some systems (i.e. wraparound after 497 days)
+ CHANGES: snmplib: Add netsnmp_get_monotonic_clock(), netsnmp_set_monotonic_marker(), netsnmp_ready_monotonic(), netsnmp_get_agent_runtime()
+ CHANGES: snmplib: Deprecate atime_diff(), atime_newMarker(), atime_ready(), atime_setMarker(), marker_tticks(), netsnmp_marker_uptime(), netsnmp_timeval_uptime(), timeval_tticks(), uatime_diff(), uatime_hdiff() and uatime_ready().
+ CHANGES: snmplib: Change the names of the struct timeval members of data structures that were used to store a wall clock time but that do now contain a monotonic clock value
+
+commit c19760f3333c92fac5d50e9768cdf939218bc487
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Feb 15 09:45:03 2012 +0100
+
+ snmplib/snmpv3.c: Fix source code indentation
+
+commit a6db239945e195de5a90fa183700b27a6ecb28d3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Tue Feb 7 00:11:14 2012 +0100
+
+ Fix possible memory leak from recent declarations patch
+
+commit 0fbbb9a9e2906a7af956957061d485874462aea9
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Feb 6 20:43:04 2012 +0100
+
+ Do not mix declarations and statements
+
+commit f308d5bafb05d78ed4030c4ecff324b6cbda680f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 15:25:30 2012 +0100
+
+ Fix two compiler warnings in agent/mibgroup/disman/ping/pingCtlTable.c
+
+commit 46f0fc1b7fc26a225763bc65cca520a1c59f0251
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Feb 6 20:54:32 2012 +0100
+
+ sendmsg does not like IP_SENDSRCADDR if addr is INADDR_ANY
+
+commit debac498fe8410110107a2fe64f8afb748edaa07
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Feb 6 16:48:09 2012 +0100
+
+ CHANGES: added OCFS2 (Oracle Cluster FS) to hrStorageTable and hrFSTable
+
+commit fafc99cd89e73ec7e00bf7360d0b4fa61944a4f4
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 11:18:34 2012 +0100
+
+ Simplify calculate_time_diff() and calculate_sectime_diff()
+
+commit 7af2013de8bf1b379c076db4e104508e17874d3e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:55:58 2012 +0100
+
+ Fix order of feature #ifndef and Doxygen comment block
+
+commit bbd67f63530f5ef0bfc948fc58dfe6a93f8f8679
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 15:25:30 2012 +0100
+
+ Fix two compiler warnings in agent/mibgroup/disman/ping/pingCtlTable.c
+
+commit 42a66aeff25b9e9ef635a404ad2f5212f9e8cf0d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:47:54 2012 +0100
+
+ Rename two function arguments
+
+commit 3fe72b3b99b7e4b2b982363dfc4f2d8d13f40592
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 13:49:22 2012 +0100
+
+ Convert snmp_select_info() documentation to Doxygen format
+
+commit e9db266ae48d05a7a6cb5d71b4bdea7ad808ef5e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 11:17:57 2012 +0100
+
+ CHANGES: snmpd: Add netsnmp_get_next_alarm_time()
+
+commit d08044cb9e5702fbf549e14425f42794259d8a21
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 09:38:07 2012 +0100
+
+ CHANGES: snmpd: Add netsnmp_get_agent_runtime()
+
+commit a05c27c2711cb41582a3b4c31e38b0e93530b62d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:51:33 2012 +0100
+
+ Fix spelling in a source code comment
+
+commit 910d7b0d99183609b9529b04c3f29330eb661021
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 14:38:12 2012 +0100
+
+ Replace netsnmp_timeval_uptime() by netsnmp_get_agent_uptime()
+
+commit 43a83f6c6a96cc2316b70eecacf127eb6913c7a7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Feb 6 11:19:15 2012 +0100
+
+ Use the assignment operator instead of memcpy() for copying struct timeval
+
+commit 2fe579efb1cb3a74f82803ca323928f6b8e4b5c0
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Feb 3 14:04:02 2012 +0100
+
+ Make agent/mibgroup/mibII/icmp.c build again on non-Linux systems.
+
+ See also commit 345a1e4254812cb9edc1d274491b76681a9dba1e.
+
+commit 881de6ab7355277a5c116a008fbe513293b05039
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Feb 3 10:08:21 2012 +0100
+
+ Fix compiler warnings triggered by the Rmon MIB implementation
+
+commit 4629933c0d3b3f9f4ba583534f79a37fb9633817
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 20:05:31 2012 +0000
+
+ More compiler warning fixes
+
+commit e9b5a3dee6f9afab8b90a29392040632b075ad7a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 16:56:55 2012 +0100
+
+ Use SNMP_MIN() instead of min()
+
+commit ae452c77b411139d6b5800ffcf88d48e9b4792a8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 15:23:38 2012 +0100
+
+ Restore commit dbb8795a7df595f0603f2ec61704799f4c482667.
+
+commit c7d11fa00f9995ddb9fe3d4994a3e9790da2e189
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 15:18:40 2012 +0100
+
+ Restore commit dbb8795a7df595f0603f2ec61704799f4c482667 partially.
+
+commit 00fd62720ec454f5a690de4feba08223cfb2c3f8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 14:48:44 2012 +0100
+
+ CHANGES: snmptrapd: Avoid crash during shutdown due to invoking perl_destruct(NULL)
+
+commit d9e229d81abeaf191ef2ccb077842885c230d622
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 14:47:41 2012 +0100
+
+ Remove a superfluous declaration
+
+commit 1e2e2af6cae830f381e87a244d029eb86bf3fcce
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 13:20:37 2012 +0100
+
+ perl/SNMP/examples/pingmib.pl: Add error checking
+
+commit 241a141e31f1684fc6cf70cc4a00cce636fd3526
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 11:28:37 2012 +0100
+
+ Make configure-time EVP_MD_CTX_create() detection work on the 5.4 branch.
+
+ See also commit 46eac02e9a27bf4f3068e795cab891f05a848870.
+
+commit 6d9d14feaaa2d0fec68b4d158944d32cb04ff1bc
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 11:12:00 2012 +0100
+
+ Revert the changes that break the build on the 5.4 branch from commit dbb8795a7df595f0603f2ec61704799f4c482667.
+
+commit 8abe49e30c97c8983e83b45a35c716fe91f66bea
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Feb 1 11:56:58 2012 +0100
+
+ Fix several compiler warnings in the DISMAN MIB implementations.
+
+commit f9fb0a533375e14dc370025a0b2fbc761bf27be6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 09:56:02 2012 +0100
+
+ Revert "HOST-RESOURCES_MIB: fix a compiler warning" because it's wrong.
+
+ This reverts commit aa6b79bc124a7b7a885d7e5035ab06aa3ecef613.
+
+commit ca4a4fe25efd2714f8f1961b97856616563f42c9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Feb 2 10:21:49 2012 +0100
+
+ .gitignore: Add python/build
+
+commit 13ada56558b44e28d1355c0dce1d921f3746d548
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:53:49 2012 +0100
+
+ Revert "Revert "Fix format specifiers to avoid warnings"" - there *is* NETSNMP_PRIo in V5-6+ branches
+
+ This reverts commit aa528bd22c7493ca8d67e678fbf615ca0f63ea6d.
+
+commit aa528bd22c7493ca8d67e678fbf615ca0f63ea6d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:13:18 2012 +0100
+
+ Revert "Fix format specifiers to avoid warnings" - there is no NETSNMP_PRIo in V5-4 or V5-5 branches
+
+ This reverts commit 390c0114c8ec0bdb27b08b6f74e3f6ef3a62981b.
+
+commit 2fb99be9aa86a6ca349b86d4ef8bc726ed9f2a82
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:58:35 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit e5c35589e0bf416bfd036bd468f42aaeab25e788
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:55:56 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 345a1e4254812cb9edc1d274491b76681a9dba1e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:51:26 2012 +0100
+
+ Fixed error handling in init_icmp().
+
+commit c303549a59fa8c2f20a9d8bf1e985fbc8abde6a8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:46:29 2012 +0100
+
+ Reworked _register_extend() error handling.
+
+commit 9c20e27a7026fc030da3b328b9a2e1b4f36670cd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:21:28 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 22fd0bfc2df0e1f6020dc3c50a753ddf28a4599c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:20:22 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 5d61e57baf580c78252c0abb0098c07bb05af17c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:17:05 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 3c3eeae80d796f27597c901e7ff2046c769ef4b8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:08:09 2012 +0100
+
+ Mark rowreq_ctx as freed so next iteration allocates new one instead of reusing the freed one.
+
+commit af9abd53c2337c90a691a7b044ff3f97c1003161
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:05:10 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit cf9465f54181e62e21a9b10219131107a3d2ebf6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:04:06 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 7871f2b09b8b52f34a9e57784266459053165bcb
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:02:50 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 7a37f33d310c9598607bc323d9bdbf91aaf72c95
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 15:00:51 2012 +0100
+
+ Don't touch reginfo when registration fails - it has been already freed.
+
+commit 3e45f7026249e45350edaac85337423aa0e95d8b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 14:13:18 2012 +0100
+
+ Revert "Fix format specifiers to avoid warnings" - there is no NETSNMP_PRIo in V5-4 or V5-5 branches
+
+ This reverts commit 390c0114c8ec0bdb27b08b6f74e3f6ef3a62981b.
+
+commit 61936762e641c18db75aa5125a33e776c677adc5
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Fri Jan 20 11:13:39 2012 +0100
+
+ Fixed freeing reginfo twice on error in a template and all its instances.
+
+commit 496437430415fbafeb1ccd4774f1ca00d627ea1f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 11:04:13 2012 +0100
+
+ python/netsnmp/client_intf.c: Fix compiler warnings introduced on V5.6 branch
+
+commit 5b4a24cdcee1bc3d82633ccafeb96fce95349c59
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 09:22:27 2012 +0100
+
+ unit tests: fix a 64-bit compiler warning
+
+commit cbf1c91baf7191be5fa27d81bcf8714331a2c12f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 09:20:42 2012 +0100
+
+ Use snmpTargetParamTable_dispose() to free a struct targetParamTable_struct.
+
+ Fixes a bug introduced in commit dbf26a05a04ef24c47346e5adda48e338498e71f.
+
+commit aa6b79bc124a7b7a885d7e5035ab06aa3ecef613
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 20 09:20:31 2012 +0100
+
+ HOST-RESOURCES_MIB: fix a compiler warning
+
+commit 3a76b43e11fffada632fccb848ab500e876ad48b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 18 16:21:05 2012 +0100
+
+ CHANGES: python: Avoid that an SNMP set with UseEnums enabled causes a segmentation fault
+
+commit 84dec9fa92b0aa2d58eb7020330f4f98e5154321
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 18 14:38:21 2012 +0100
+
+ python/netsnmp/client_intf.c: Fix most compiler warnings
+
+commit 38cf218c3f1a727786e227a5d3fb186fd0f1a15f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:50:13 2012 +0100
+
+ Fix a typo
+
+commit 454122244122bfdb6f67cab31256d7b46372e9e1
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:30:18 2012 +0100
+
+ Free tmStateRef on errors.
+
+commit 0119022daa59c73bfec0da2386d0628f14e6dab7
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:09:12 2012 +0100
+
+ Free fingerprint when it's not needed.
+
+commit 0e84cd303a08267dec78f6d81c9bb07e3d83a11f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:48:26 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 63dc846a7949ce697b3e28c543dc1105e63a2250
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:08:28 2012 +0100
+
+ Free certificate fingerprint.
+
+commit ce1f284a63eb81644b3e32606cbe39b67e1dff2a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 14:37:09 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 7e21413ca6f2efd7a3afb62c62b644881b8bd1e7
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:46:30 2012 +0100
+
+ Properly allocate and free engineID.
+
+commit 34c962882607c3638a2fa25a2ac531492d71c787
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:37:25 2012 +0100
+
+ Free locally allocated tmStateRef.
+
+commit f57ae531dc5658abcd65b1627615525238d16d2d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:20:24 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 536bc57556c3141561ea4a194810b16290a691ee
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:15:47 2012 +0100
+
+ Added check if the function actually does something.
+
+commit a0777d307dbcaf219ee0184a0fbab9d4e5d6aa0b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 13:01:45 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 8b97a71c8e7959428eb4d4e8d90e9096d43ff09f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 12:57:26 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 2c1507c22030549ae660c0e211fbdc5c75ec5c57
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 12:53:47 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 65f2b7bcd4fe03906aa1a115ab60a89b8ae933d5
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 19 12:51:36 2012 +0100
+
+ Close open files on error.
+
+commit 0e52e4f66d44766bea37473556c78e5219b95461
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:45:33 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit dbf26a05a04ef24c47346e5adda48e338498e71f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:42:17 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 748da84b1fd654e338bc701e8f9e5da229187f1c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:32:04 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit eb217146fd54036ea4202bfef78bbf774d7e382d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:23:10 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 9ba38eec66138ec1f613ea8d04e158130c7121bc
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:18:55 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit d9d938d3018c27f53277bc5e59578500490c1d09
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:16:38 2012 +0100
+
+ Close open file on error.
+
+commit d5e817d5bd518d9ac6a0d60e0e141dd64f27ad19
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:14:12 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 2ae68f059df9d74b074d12f59c1847466ed576cd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 15:03:17 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit a00f3d461121b545aed72ac12b2438791dcfc4ba
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 18 14:58:39 2012 +0100
+
+ Free previously allocated memory on errors.
+
+commit 59884bb4d35ad13747ffa6723436dca587a9ab77
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 17:09:12 2012 +0100
+
+ In above code, olength is checked, so let's check it also here.
+
+commit ba5d5292b04393b0c7d7d7ed961241929418c6e4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 17:05:14 2012 +0100
+
+ Fixed dereferencing NULL.
+
+commit da2d6a7028a13b9edf3a5c84314d0f1feef76714
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:44:56 2012 +0100
+
+ Prevent dereferencing NULL.
+
+commit f88054a9b69b6de274f7a14a59b47323e5e4e4c6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:37:35 2012 +0100
+
+ Don't dereference context if it's NULL.
+
+commit 7c4d459e8f1f652cc2098c3d4c81de90a84ed710
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:30:09 2012 +0100
+
+ Don't deference NULL.
+
+commit fc19b7f33b587927d2a01e72d23d21b9b1696ab3
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:25:26 2012 +0100
+
+ Don't close NULL file.
+
+commit 5e95ca6790076b788072a801ee7c82969d995bcb
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:17:09 2012 +0100
+
+ Prevent dereferencing NULL when a transport does not have f_fmtaddr.
+
+commit eed6f5f9b9ae54d2ceab67ad85adde1f6a8a21d5
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:13:13 2012 +0100
+
+ Prevent dereferencing NULL.
+
+commit 41cde68b5fa4b38d81450cf91e082cdfa825e7cf
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:10:10 2012 +0100
+
+ Check if a registration was really found.
+
+commit 5b72a40853876a186efcc0090a4e32c235b9c05f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 16:03:58 2012 +0100
+
+ Don't dereference NULL when difflen is SMUX_MAX_PRIORITY (which is highly unlikely, but...)
+
+commit fa6a912e41c5d0fd2a636894e86b6426c07375ab
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 15:37:44 2012 +0100
+
+ Check for missing value in setEvent.
+
+commit 410b71da425389fecc25d14f49f23753581576ad
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 15:28:41 2012 +0100
+
+ Dereference ereg only if it is not NULL.
+
+commit 185272d1a0b913774186f1b9135aeaf637ebed52
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 15:17:21 2012 +0100
+
+ As per above code, template_v2pdu can be NULL, so check it before dereferencing.
+
+commit 48e5ead3fd2c2b385df6972c67526ff6bdc30768
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 14:42:22 2012 +0100
+
+ Updated last fix to new error reporting style.
+
+commit f33d33615d6d85d0073726473c4146cbcdf11ced
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 14:30:07 2012 +0100
+
+ Fixed sigsegv when empty config line is parsed.
+
+commit b5df1eeb47ed3559b6f4d9ecccdb242126e6c992
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 14:11:58 2012 +0100
+
+ Fixed (highly theoretical) sigsegv when sp->securityEngineID is NULL.
+
+commit 6feed629a71899c113096959d8549dc1201e8f9a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 13:43:37 2012 +0100
+
+ Added NULL and len check just in case someone provides value = NULL and nozero len (-> NULL is then dereferenced).
+
+commit 355c5ab264af2a6020a1d8a923f80f11b942295e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 17 13:36:41 2012 +0100
+
+ Extend the NULL check, i.e. return if there is nothing to remove.
+
+commit ddd7948acad938cd42974505ddca4f0372116709
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 11:11:29 2012 -0800
+
+ update sparta's copyright
+
+commit 41256086a7a5041453419cfd6e562c7b55c56b0a
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 10:32:04 2012 -0800
+
+ pulled full copy of extractnews from master
+
+commit 625a70dbdfd9902da79efa293fe6d2ac8ccf2b2e
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 10:24:19 2012 -0800
+
+ update to change to the newer log generating/parsing
+
+commit 62e32b13089b29edcf276f615da67e4508fe7bb5
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Mon Jan 16 09:29:42 2012 -0800
+
+ conflicting merge from master for extractnews
+
+commit 70084da61d2bcbd2cf1ed81bdc3bf6794c2affb6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 13 11:49:16 2012 +0100
+
+ CHANGES: snmpd: DISMAN-SCHEDULER-MIB: Handle 32-character schedContextName values correctly.
+
+ See also commit b3c4982542e0ab151fb3884754cdfbcb472da52d.
+
+commit 04bf3e288158ee880edf237e4007fee37d2044dd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:39:37 2012 +0100
+
+ Fixed endless loop when SSL_read returns error.
+
+commit c1526fccc0474c1db18caa9dbb833853cddde3cc
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:13:21 2012 +0100
+
+ Fixed a typo.
+
+commit a27aa19df283156c032c81eaee5e115859d38c17
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:11:32 2012 +0100
+
+ Don't replace 'rc' variable, it's value is needed outside the loop.
+
+commit 985dff2b0876d9483c414fccea3ef6bc63e14561
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:01:32 2012 +0100
+
+ Removed duplicate code.
+
+commit 2fd7818318e7a5dfe98f52ccf750c2a63e825ded
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 15:00:22 2012 +0100
+
+ Removed duplicate code.
+
+commit 15f21130ba33dc9afd164e52dfd74c9cec0e9232
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:58:14 2012 +0100
+
+ Removed duplicate code.
+
+commit 2a8a8f2ab7cd75826c5d41ec3cfd5ce3e9634cf3
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:39:28 2012 +0100
+
+ remove dead code, 'cp' is always != NULL here.
+
+commit 38fd6378cc3275180f63b8d9b9a4072b3dabf8e4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:25:06 2012 +0100
+
+ Fixed a typo.
+
+commit ebd92e19b10c0a38e17cde407864b45c26e17327
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 14:07:43 2012 +0100
+
+ Removed unnecessary if (value) check - value is checked few lines before.
+
+commit c5cacf5caf979d018ea6cae1c03b8fdf0b118dfd
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 13:44:43 2012 +0100
+
+ Prevent double free(), 'dirname' is already freed inside se_add_pair_to_list() if it fails.
+
+commit acdceb50ea66d6b323c74ee021fb77e810e4e7af
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 13:43:19 2012 +0100
+
+ Prevent memory leak when malloc fails.
+
+commit 17053e34cfe9a8ab395fb50f5c3f1dafc7247aeb
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Jan 12 13:32:57 2012 +0100
+
+ Fixed double fclose().
+ Linux man page for fclose(3) says: In either case any further access (including another call to fclose()) to the stream results in undefined behavior.
+
+commit a6641edb9cb74fc2236b42ce5554fc3329956552
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 15:22:34 2012 +0100
+
+ MinGW: Skip test T065 if not started from inside an MSYS shell
+
+commit a883ef1982f301b1485d227301674927330f5b67
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 11 15:14:53 2012 +0100
+
+ Moved debug oputput before return.
+
+commit 45751967287d97640efdcdf8e77e8d490939d8eb
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 14:17:18 2012 +0100
+
+ Convert strtoull() unit test into a Net-SNMP unit test
+
+commit 2c2fa48336a4f1f177c2991d6515d29f39533c44
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 13:50:44 2012 +0100
+
+ Convert read_config_read_octet_string_const() unit test into a Net-SNMP unit test
+
+commit 07c666f6cea27f2b2ab9bc08aed0cb6133fe3758
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 11 13:17:45 2012 +0100
+
+ Fixed commit 73a523e468277f6df2e984891313b8be8bce1921:
+ Fidex dereferencing key->info when key is known to be NULL.
+
+commit 3b686566296dd87bc42b7f1169daacdb3c45cc58
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Mon Oct 18 06:25:56 2010 +0000
+
+ Win32: builds again without warnings with MSVC 6.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19489 06827809-a52a-0410-b366-d66718629ded
+
+commit f3a7d1b09609dad649f58bbdb5b7e10d39b398c1
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sun Oct 17 11:04:06 2010 +0000
+
+ Follow-up for r19476: fixed a typo.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19478 06827809-a52a-0410-b366-d66718629ded
+
+commit 2de73bd365a381b9c353ca5230769eefb1ac71ed
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 11:42:42 2012 +0100
+
+ local/passtest: Remove an incorrect PATH= statement
+
+commit 699513f1238e0adce1f1cec98e0d147293fc5047
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sun Oct 17 09:25:51 2010 +0000
+
+ NETSNMP_REMOVE_CONST()-related cleanup.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19476 06827809-a52a-0410-b366-d66718629ded
+
+commit 6358dee72fb347e2600a0a7bd21f23270d3a00f6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 10:58:15 2012 +0100
+
+ agent/mibgroup/ucd-snmp/versioninfo.c: Add a comment
+
+commit 5396bfe032c8cbc73c8ff5d4b085ebada9f59846
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 10:30:16 2012 +0100
+
+ Replace strncpy()/strncat() by strlcpy()/strlcat()
+
+commit feb3af28dcae22015ae865a2e5dd8c416e9991d8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 10:02:08 2012 +0100
+
+ Replace strncpy()/strncat() by strlcpy()/strlcat()
+
+commit b7e1aa255bae4a3453f9eca644a876634351f11d
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sat Mar 20 19:36:28 2010 +0000
+
+ CHANGES: libsnmp: changed the type of the fourth argument of netsnmp_set_row_column() from const char* to const void* such that no cast is necessary when passing another datatype then char* or const char*.
+ CHANGES: Win32: changed in_addr_t from u_int to u_long such that it matches the datatype of sockaddr_in::sin_addr.
+ Also, fixed several compiler warnings (mostly char * <> u_char * mismatches) and removed some casts.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@18345 06827809-a52a-0410-b366-d66718629ded
+
+ Conflicts:
+ agent/agent_registry.c
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
+ agent/mibgroup/mibII/interfaces.c
+ agent/mibgroup/ucd-snmp/disk.c
+ apps/snmptrapd.c
+ snmplib/snmpIPv6BaseDomain.c
+ snmplib/snmpUDPIPv6Domain.c
+ snmplib/system.c
+
+commit f47a3752849db075e6f2053b8595b7b792fb6462
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Fri Oct 15 10:56:09 2010 +0000
+
+ CHANGES: Win32: building: Builds now correctly with a 64-bit compiler.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19458 06827809-a52a-0410-b366-d66718629ded
+
+commit 02b6056df95da8b673034e39c2c7c386ed0f369c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 11:44:53 2012 +0100
+
+ Fix a compiler warning about casting away const
+
+commit a19865832fc77f4c048144d91a431b1e94d329f2
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Wed Oct 14 23:12:05 2009 +0000
+
+ CHANGES: apps, snmplib: PATCH: 2835577: identified by "Bart Van Assche": Replace SNMP_ZERO of arrays with a memset.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@17797 06827809-a52a-0410-b366-d66718629ded
+
+commit 67a3e2eccb95f9c9d0809efcbddcd866ee3062d5
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Wed Jan 6 14:27:15 2010 +0000
+
+ Fixed a compiler warning about discarding the const qualifier.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@17970 06827809-a52a-0410-b366-d66718629ded
+
+commit 3dcde2e8a595a527f06142c3b852de8433a1cf28
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Sun Jan 24 14:27:55 2010 +0000
+
+ CHANGES: snmplib: Prevent gcc ped-warning for NETSNMP_REMOVE_CONST
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@18052 06827809-a52a-0410-b366-d66718629ded
+
+commit c2e1525a85bda5299a3b9f241614f7e6509aeeba
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Wed Jan 6 13:35:11 2010 +0000
+
+ Backport commit 295f473c83546221b2a71d815c61e33a67f98ae3: refine NETSNMP_REMOVE_CONST() implementation.
+
+commit cb423b0ae9ed0059aa100dc4e2fd93ad1b97faf8
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Wed Jan 6 11:57:51 2010 +0000
+
+ Backport commit e2fb09e0093e2f648fe2638da2f3af18fdb32bf0 - introduce NETSNMP_REMOVE_CONST().
+
+ Conflicts:
+ agent/snmp_perl.c
+ snmplib/snmp_service.c
+
+commit afc396ab1618a8595a2519fbc25f7a498e174411
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 08:49:34 2012 +0100
+
+ Unbreak netsnmp_mktemp() and make_temp().
+
+ These were broken by commit bb8fcbb874998000f945f058d1aa6fe14e925899.
+ Also replace a strncpy() call by a call to strlcpy() and replace the
+ make_tempfile() implementation by a call to netsnmp_mktemp().
+
+commit 210185c15d0d65f0ea98b5e3c2e0776f6222d170
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 11 08:27:43 2012 +0100
+
+ Fix a crash during startup of snmpd introduced by commit 885061687d9caa38470979667d7d8ad6563cedad.
+
+ Also, make sure there is only a single copy of the cleanup code in function
+ mkdirhier().
+
+commit 8bb4e86abcf98ff28748af0af89c98e64d5cd961
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Wed Jan 11 07:47:12 2012 +0100
+
+ Reduce the scope of the oldmask variable.
+
+commit 6680147b138ec114f81c5d128ac9350c8450d081
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 18:44:31 2012 +0000
+
+ Make test T015int64_clib pass on 64-bit systems
+
+commit 3aad15ae560ac857e73c90764e903e7ca02b3295
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:40:59 2012 +0100
+
+ Fixed buffer overflow for large OID names
+
+commit fba188ee82010b2f2d8ca2e426ba654499ab3d0a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:31:33 2012 +0100
+
+ fixed buffer overflow in __concat_oid_str
+
+commit 21d25d86b8e4904d798dc8c96dade9e5048457a8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:26:07 2012 +0100
+
+ Fixed buffer overflow when parsing port numbers.
+
+commit d36931841b2fc2cebc6364b2949129a0ad42ad1d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:05:51 2012 +0100
+
+ Fixed a buffer overflow when large SumFile is used.
+
+commit 0efdd022da09af1b5e16171fa7a2b523c5d6ec59
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 15:01:53 2012 +0100
+
+ Fixed buffer overflow when too big temp file pattern is used.
+
+commit 560bc6c09b751556efd6b4c4495751b109a93f92
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:59:24 2012 +0100
+
+ Fixed buffer overflow, just to be sure.
+
+commit 8291d7c5b92a31dd4f582b497d4b2a0853367a56
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:55:16 2012 +0100
+
+ Fixed buffer overflow.
+
+commit 88e1f34de7300575fa6dab857ecddb242a87de80
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:48:55 2012 +0100
+
+ Fixed buffer overflow when too long interface names are used.
+
+commit be1375a9926ebe0cd5b78a4045c3bd11c83664b1
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:46:49 2012 +0100
+
+ Fixed buffer overflow when a sensor name is too long.
+
+commit 1cb24625372062b14c71d7dd51e20fef773e2743
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:41:00 2012 +0100
+
+ Fixed buffer overflow when a CPU has too long name.
+
+commit 84c807ee03251e54856e83d62d06ea08b8df527a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:36:50 2012 +0100
+
+ Fixed buffer overflow when too long interface names are used.
+
+commit c310e390b5dd05f24be7eb1904c74e41259c93db
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:24:54 2012 +0100
+
+ Fixed buffer overflow when too big temp file pattern is used.
+
+commit 4600d11434e83b8653cf9f813a3d8b630455b42d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:17:08 2012 +0100
+
+ Fixed plausible string overflow before parsing command line options.
+
+commit 885061687d9caa38470979667d7d8ad6563cedad
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 14:11:02 2012 +0100
+
+ Get rid of (insecure) SNMP_MAXPATH in mkdirhier()
+
+commit 8016890a445f6a7e2a873a04873d4e27b6ee64e3
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:48:34 2012 +0100
+
+ Fixed wrong integer size on 64 bit platform.
+
+commit bb8fcbb874998000f945f058d1aa6fe14e925899
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:31:36 2012 +0100
+
+ Secure mkstemp() with umask() - on some implementations it does not set 0600 permissions automatically.
+
+commit 202523ca704bd722dc1ac0e1e6b0e4b4e5424495
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:11:57 2012 +0100
+
+ Fixed dereferencing 'c' before NULL check.
+
+commit 73a523e468277f6df2e984891313b8be8bce1921
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 10 13:08:24 2012 +0100
+
+ Fixed dereferencing key->info when key is known to be NULL.
+
+commit 2f4e6acd714183f015b763657f8f084593357e26
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 10:38:16 2012 +0100
+
+ .gitignore: Ignore perl/*.yml files
+
+commit c365d80c16c2d17b160011e8c1f9cb958954e9db
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 10 08:34:16 2012 +0100
+
+ CHANGES: snmptrapd: Do not invoke shutdown_perl() from inside the SIGTERM handler since that fails if SIGTERM is received while a Perl handler is active. Based on a patch posted by Joel Avni <javni@arubanetworks.com>
+
+commit d059fb878b1436599953cea5a077499ddcdcbcb5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 17:03:55 2012 +0000
+
+ CHANGES: BUG: 3440752: IF-MIB: Report interface speed correctly for Ethernet interfaces if other than 10 Mbps, 100 Mbps, 1 Gbps, 2.5 Gbps or 10 Gbps. Add support for NICs faster than 65 Gbps.
+
+commit c09903a42e9d97331fd9e48ee831a85afdf9c70a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Jan 9 13:26:17 2012 +0100
+
+ Doxygen-style documentation fixes
+
+commit e325ecbfce77f00ac5cf6fbd957f95495f61c59b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Jan 9 13:25:10 2012 +0100
+
+ Suppress uninteresting Doxygen warnings
+
+commit be9161d3a5898e863767f926613486126c2cbf67
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 12:35:39 2012 +0100
+
+ CHANGES: snmplib: Simplify implementation of functions manipulating 64-bit numbers.
+
+commit 86e4c2be0852a0a13b0603075720b3264ec70dde
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 12:29:11 2012 +0100
+
+ CHANGES: snmplib: Make it explicit that MAX_SUBID is an unsigned constant
+
+commit 37e272d8f7b7180ba140fa386a5ff058968a08a2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 18:21:48 2012 +0000
+
+ CHANGES: snmpd: IF-MIB::ifType: Report type "infiniband (199)" for InfiniBand interfaces instead of type "other (1)".
+
+commit 269932fa32c7cd47957489698e09bee31f63b7af
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 14:34:42 2012 +0100
+
+ Fix an MSVC compiler warning
+
+commit 0d1c21f9991d1309d057e3e4056d547df7d40ecf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 16:06:31 2012 +0100
+
+ Make declaration and definition of strlcat() consistent.
+
+commit 0c3d4dbb0a9cf5b359f70b2f19915495554f840f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 15:23:16 2012 +0100
+
+ CHANGES: Win32: snmpd: Remove dlmod
+
+commit 893ecc97b587661045becbe09a320c1bcbc71c7c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 14:36:59 2012 +0100
+
+ Add strlcat() to the MSVC build infrastructure.
+
+commit 3d126422e625702b9d3fa0676a97ec5cb20d9d10
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 15:01:06 2012 +0100
+
+ Make win32/net-snmp/net-snmp-config.h consistent with its .in file
+
+commit af53b76c2ffa751e3958d0fc5d8279f78c2c1c26
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 14:43:55 2012 +0100
+
+ Skip T066pass_simple and T067passpersist_simple on MinGW
+
+commit 35a92e693d133a5b11e9e9b599dbf47edef4933b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Jan 6 08:16:36 2012 +0100
+
+ Remove snmplib/snmpDTLSUDPDomain.c again, which was added accidentally while resolving merge conflicts (commit 1d78f7d5b58aed2b52c4d386a7ba80a44711baca)
+
+commit a9b073ea3b6cedf713e305e7b15f28ae57bfdf1b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 17:47:11 2012 +0000
+
+ Fix 64-bit compiler warnings
+
+commit 7e890dad95f566069ee280215a4fea3f0e2e3980
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 16:38:50 2012 +0100
+
+ Avoid a SIGSEGV if cp == NULL. This is a follow-up for commit 089bcb360aa26790ad2a8ceddf583b7ba5ddfd48.
+
+commit 1f6200cfe1b0b27ebb093a1606b592f9e9684be8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 15:53:34 2012 +0100
+
+ Convert strncpy() calls introduced in v5.6
+
+commit c3126b143921fabeac442166eca5b5b742fd42c0
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 15:02:39 2012 +0100
+
+ Replace most strncpy() calls introduced in v5.5
+
+commit b24ee7c909657db43bd8c5d8c01055ca0883c9cf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 08:40:39 2012 +0100
+
+ Eliminate most strncpy() and strncat() calls
+
+ Using strncpy() and strncat() is error prone -- see also
+ http://www.gratisoft.us/todd/papers/strlcpy.html. Hence replace
+ all invocations of strncpy() and strncat(). Replace
+ strncpy(dst, src, n) calls by:
+ * strlcpy(dst, src, n) if the goal was to avoid output buffer overflow.
+ * sprintf(dst, "%.*s", n, src) to copy a prefix of src to dst or if src is
+ not '\0'-terminated.
+ * memcpy(dst, src, n) if strlen(src) >= n and n < size of dst.
+ * strcpy(dst, src) if n > strlen(src) and n < size of dst.
+
+commit 6d95bc4149472931005475c30a541fed5534da39
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 11:19:16 2012 +0100
+
+ Fix warnings triggered during compilation of the Perl xs source files
+
+commit bad0600f6ec944ef8455e327ce784b9b07d247c9
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 10:00:13 2012 +0100
+
+ Add configure test for sockaddr_un.sun_path such that the com2sec test is run
+
+commit 92a32ac4866a5edc7f347d37942bf028de02762f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 10:00:29 2012 +0100
+
+ Get rid of a compiler warning
+
+commit 83e4c0e304f617ccac6610edd74d1706797bbf52
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 09:15:37 2012 +0100
+
+ CHANGES: testing: Add a test for se_store_list()
+
+commit 4fae5852103ec3893ad488bc0d905ca6914595ef
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 09:17:15 2012 +0100
+
+ CHANGES: snmplib: Simplify the se_store_enum_list() implementation
+
+commit b3222bb275f2f2346e0fd0478afa2efb600773e5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jan 5 09:16:45 2012 +0100
+
+ CHANGES: snmplib: Declare "type" argument of se_store_list() / se_store_slist() / se_store_enum_list() const
+
+commit 022f840fbfcb0e26b08f0e55728231f611495803
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 19:55:56 2012 +0000
+
+ Avoid that Valgrind complains about sending UDP data
+
+commit 672a809c228e9550b99b8910be75d0b161985402
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 17:33:09 2012 +0000
+
+ Fix a 64-bit compiler warning
+
+commit 24ff260ad89ce2aa361a55c7c72e916031defe35
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 17:11:24 2012 +0100
+
+ Change the type of the second argument of snmp_set_var_value() and snmp_set_var_typed_value() from u_char* to void*, like on more recent branches
+
+commit c6ca737fb46f90a4bda5d43734aac34e837a05f4
+Author: Bart Van Assche <bvassche@users.sourceforge.net>
+Date: Sat Mar 13 19:07:37 2010 +0000
+
+ Backport commit f504ce2d74a4bc88f68cc9515fa7053373cb15b5.
+ (Fixed most compiler warnings triggered by the source code in the perl subdirectory. Note: these changes may contain some real bug fixes.)
+
+ Conflicts:
+
+ perl/ASN/ASN.xs
+ perl/OID/OID.xs
+ perl/SNMP/SNMP.xs
+ perl/agent/agent.xs
+
+commit d212dc984ec34e4d230625e46e58b0c628a50df5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 16:46:49 2012 +0100
+
+ SNMP.xs compiler warning fixes
+
+commit baceebb10d8caf5db63cc36935fed65ee931029d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 16:22:44 2012 +0100
+
+ Add declaration for shutdown_snmpNotifyTable()
+
+commit f7f966abd6d2849b1331252afe5c473e5c40b32d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 14:24:33 2012 +0100
+
+ Fix format specification mismatches.
+
+commit 303c015bcfe9af0b154e9881c7b4f449e08f30bb
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed May 6 22:06:23 2009 +0000
+
+ Backport commit d3eb2b5ced22a8480053ce43acf9739729055404
+ (Sprinkle some const-ness where relevant / fix format string mismatches,
+ Niels Baggesen, May 2009)
+
+ Conflicts:
+
+ agent/agent_sysORTable.c
+ agent/helpers/instance.c
+ agent/mibgroup/disman/event/mteTriggerConf.c
+ include/net-snmp/agent/instance.h
+ include/net-snmp/agent/sysORTable.h
+
+commit d95b40406916bda5b48b5a6131bec27b866b0a79
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed May 6 21:59:20 2009 +0000
+
+ Backport a2a7316c310f0fcc3728673fa047051c23b71960
+ (Trivial warning fixes, Niels Baggesen, May 2009).
+
+ Conflicts:
+
+ agent/mibgroup/hardware/cpu/cpu_linux.c
+ agent/mibgroup/host/hr_swrun.c
+ agent/mibgroup/if-mib/data_access/interface_linux.c
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c
+ agent/mibgroup/mibII/sysORTable.c
+ agent/mibgroup/mibII/system_mib.c
+ agent/mibgroup/ucd-snmp/logmatch.c
+ agent/mibgroup/util_funcs/get_pid_from_inode.c
+ agent/snmpd.c
+ snmplib/container_list_ssll.c
+
+commit d86c47f003fdc192bce7b46ac4f06b09e387c12b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 13:29:08 2012 +0100
+
+ Fixed a typo
+
+commit bee4d79cf4eb7e0a45397f59b5298da633a8e1ba
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 13:14:57 2012 +0100
+
+ Fixed reading past end of buffer.
+
+commit 3dc0e00a2fd8e34fe1ae33ecabf36e146460a31f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 12:40:07 2012 +0100
+
+ Fixed buffer overflow when large 'token' is used.
+
+commit b3c4982542e0ab151fb3884754cdfbcb472da52d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 12:28:52 2012 +0100
+
+ Fixed off-by-one memset.
+
+commit 0f53695044dd3f0c3507753e3f8c29d97e96872d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Aug 3 21:38:26 2011 +0200
+
+ CHANGES: snmplib, snmpd, perl: Eliminate dead variables
+
+ Conflicts:
+
+ agent/mibgroup/agentx/master_admin.c
+ agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c
+ agent/mibgroup/host/data_access/swinst_pkginfo.c
+ agent/mibgroup/host/data_access/swrun_procfs_status.c
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c
+ agent/mibgroup/mibII/kernel_linux.c
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c
+ apps/snmptls.c
+ apps/snmptrapd_log.c
+ snmplib/dir_utils.c
+ snmplib/snmp_client.c
+ snmplib/snmp_openssl.c
+ snmplib/transports/snmpTLSTCPDomain.c
+
+commit 0153805c99b9197365935c5d11ae9c3d4bfaa0f3
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 09:48:41 2012 +0100
+
+ Fix a set-but-not-used warning
+
+commit 3f8885fbee9407748fc2f0573728a11ba2bc023a
+Author: Magnus Fromreide <magfr@users.sourceforge.net>
+Date: Tue Apr 28 05:51:13 2009 +0000
+
+ Return a value from sprint_realloc_value even if no subtree is located.
+
+ git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@17578 06827809-a52a-0410-b366-d66718629ded
+
+commit b1eaaf302369fd4552e8fee7b6a805091ec0a9b4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 11:38:51 2012 +0100
+
+ Added check of find_sec_mod() return value.
+
+commit aee4e895fe3bd5f4a61e34275bfca0368b560555
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 11:31:22 2012 +0100
+
+ Added check of snmp_sess_transport() return value.
+
+commit 5d1d0a744ab30c8e645c3b8506cbbd2cceb3d275
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 11:04:48 2012 +0100
+
+ Added check of netsnmp_extract_iterator_context() return value.
+
+commit 299ea9a89c3f1758a7748bb9b3411f62f2c70f88
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 10:54:55 2012 +0100
+
+ Added check of fopen() return value, just in case of some race.
+
+commit 90f1ae6757917481636eef77100caeeb53edfe01
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Jan 3 10:06:56 2012 +0100
+
+ Add strlcat.c. Source: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/string/strlcat.c.
+
+commit 089bcb360aa26790ad2a8ceddf583b7ba5ddfd48
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Jan 4 10:50:56 2012 +0100
+
+ Added strrchr return value check, just to be sure.
+
+commit 199a0511f6eb0ef3ff1d9f922b790ab67dfde01e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 10:31:26 2012 +0100
+
+ CHANGES: snmpd: smux: simplify smux_list_detach()
+
+commit d883573aa73e0f5fc188acedee6451f95dae900c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 10:23:06 2012 +0100
+
+ Fix a compiler warning introduced by commit a809fe5075c9f374715f7d1a682949a0730172c1.
+
+commit 7b7a3eb2500527eaa1699287a6ca6fcc4cc2e08a
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Jan 4 09:40:02 2012 +0100
+
+ Fix a build error caused by commit a809fe5075c9f374715f7d1a682949a0730172c1.
+
+commit 2b6c119fed4848da6663c11f0c2cbdc29921b5c6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:51:10 2012 +0100
+
+ Check for netsnmp_ds_get_int() errors.
+
+commit 6ce5360caa4c9de51ade57879e83f96bd04b4c5a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:42:23 2012 +0100
+
+ Check for missing view.
+
+commit b3bc54bed31690a85df2acfbf3296da93a9e89b4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:23:17 2012 +0100
+
+ Check socket() result.
+ Also close the socket on error.
+
+commit 92075f51cd45a38ca38760b3ffe82e16559e9c2e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 15:18:26 2012 +0100
+
+ Check open() result.
+
+commit 6665d5fe2fc569d6fa854d1d78e347bbac69e070
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:22:22 2012 +0100
+
+ Fixed missing break.
+
+commit a6648c5453e1ef8dac57a38efcc00cce53bf9e4f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:20:27 2012 +0100
+
+ Fixed missing break.
+
+commit d68dcae0f18d554571aef321944a5290548dde86
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:16:11 2012 +0100
+
+ Added 'fallthrough' comment for Coverity.
+
+commit fb6f80c0fe3ba36e56f5b911a47e3f6f32ba266e
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:14:07 2012 +0100
+
+ Fixed exit code of encode_keychange with wrong arguments.
+ Also added a comment for Coverity.
+
+commit 3130e24fdc232464dd7bb216f46cafa2e0e775a6
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:09:54 2012 +0100
+
+ Added missing break
+
+commit 18c126a9565cb4d69d7513b944a2105588045d35
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:07:29 2012 +0100
+
+ Added 'fallthrough' comment for Coverity.
+
+commit 6d31c82070a2c68fe3c519e9d56fa2779554d01f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 14:01:53 2012 +0100
+
+ Added 'fallthrough' comment for Coverity.
+
+commit dc6f0e2e549b4cd061ebc190084b1fc77a55f40f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:32:59 2012 +0100
+
+ Fixed wrong operator
+
+commit dab32867ed0b99301efd7b8d852ad1288a184be0
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:30:33 2012 +0100
+
+ Fixed QUITFUN usage.
+
+commit b1a2bcf64615eb66bc24d5be4950e45012962045
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:18:03 2012 +0100
+
+ Fixed wrong operator
+
+commit b2b1c851b94fed37c386eaa1bfead5c77696e3ef
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 13:14:52 2012 +0100
+
+ Fixed wrong operator
+
+commit a809fe5075c9f374715f7d1a682949a0730172c1
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 10:58:46 2012 +0100
+
+ Added check for failed register_mib.
+
+commit 5949f055c16ae650615aae7a1fee3f2d7b16d940
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Jan 3 10:29:59 2012 +0100
+
+ Make MIB file parsing and detection more strict - LABEL is required at the beginning of MIB files.
+
+commit e4b673683c68ba8b3abc040b9125ec304643cc7c
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Jan 1 23:00:24 2012 +0100
+
+ Assume that libdl might be in AGENTLIBS or SNMPLIBS so preadd them.
+
+commit b13c1e57bedba79b806103c74f1921d53a706b38
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Jan 1 22:55:06 2012 +0100
+
+ Do not require ucd-snmp/dlmod unless it will work.
+
+commit 27dcea0d5f801df494ab2cb5c5c0ebe54eb0dcd3
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 14:48:29 2011 +0100
+
+ Adjust paths for test restructure
+
+commit 14b60e85a1b5700e93d126e2f291d5c485f34e36
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 14:14:29 2011 +0100
+
+ CHANGES: snmpd: Make the configuration of the dlmod module fail rather than generate a dummy module if the dlopen function isn't available.
+
+commit 98a97538fc1e9ff46b60d5d969347444578378c0
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 13:35:13 2011 +0100
+
+ Adjust the paths to support testing even if builddir != srcdir
+
+commit 88f0af3cfb916ae5863cc2986071d435f20c3064
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 31 11:37:52 2011 +0100
+
+ Reduce the scope of the variables 'p' and 'len'.
+
+commit 0815a7536c76f7e4842638683f674894a1a8ce14
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 29 14:42:54 2011 +0000
+
+ Report problems with SetUndo processing
+ Missed when applying patch #3445440
+
+commit eb2ab23742ca86c0b89ccfe91eb6ea374bf3acc1
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 29 14:37:31 2011 +0000
+
+ Check for the expected error (EPIPE) on closure.
+ Missed when applying patch #3447444
+
+commit aac10bc4f053c014f382d6593fc32ab95e0b1a57
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 29 12:59:52 2011 +0000
+
+ CHANGES: snmpd: BUG: 3463767: Handle parsing subidentifiers > 2^31
+
+commit bbc02e36e90c1aab7898562f963f5cadb26e10bd
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Dec 28 17:15:16 2011 +0000
+
+ Move pass/pass_persist tests to the new location
+
+commit 3898c04fd6f89867062fdfebf36857ab619c0450
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Wed Dec 28 16:53:24 2011 +0000
+
+ Add tests for pass/pass_persist, supplied by Bill Fenner
+
+commit d5ee3f0a1a63bb1752c74cbca55aa3d40bf9bf13
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 21:58:51 2011 +0000
+
+ CHANGES: snmpd: PATCHES: 3447444: Fix SIG_PIPE handling
+ Patch provided by Bill Fenner
+
+commit 2a17b37430c1852998c3588e547d7eb61c06da71
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 21:45:38 2011 +0000
+
+ CHANGES: agentx: PATCHES: 3445440: More robust handling of AgentX errors
+ Patch provided by Bill Fenner
+
+commit fe58a0e5f4d4e2e2ecbcb47382b08cb1e4df352c
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 18:16:23 2011 +0000
+
+ CHANGES: snmplib: PATCHES: 3456770: Handle (obsolete) UInteger type properly
+ Patch provided by Bill Fenner
+
+commit 1be8cf08a67a91855fee1ec4a2d8e087c7812456
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 18:04:10 2011 +0000
+
+ CHANGES: agentx: PATCHES: 3445437: Log AgentX disconnections
+ (in line with connections) Patch provided by Bill Fenner
+
+commit 068037289107faa2ba3f5cd2fb00c19494bb9a04
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 17:27:46 2011 +0000
+
+ Handle any GETNEXT request OID, not just a simple walk.
+
+commit a74fa528983123d355a8cdcaa77dd4eb4b8c6959
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 17:00:18 2011 +0000
+
+ CHANGES: pass: PATCHES: 349394: Bring pass_persisttest script into line with passtest*
+ (i.e. using the legitimate structure of NET-SNMP-PASS-MIB)
+ Patch provided by Bill Fenner
+
+commit bbe649ebfa61ea22399170b36b99db30a1de8012
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 16:54:38 2011 +0000
+
+ Rework "passtest" example to fully validate GETNEXT requests
+ and use a legitimate structure for output. Backport of SVN
+ revision 17632 (which updated 'passtest.pl' but missed 'passtest')
+ Correct in branches 5.5 and above
+
+commit 82d06c7247b22c8b01d45bf55041d2f1e6427d49
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 13:45:18 2011 +0000
+
+ CHANGES: snmpd: PATCHES: 3447671: Fix override handling of OID values
+ Patch supplied by Phillip O'Donnell
+
+commit ba4a9ce51c9600f9fda168f1e6eff32a1db63cb9
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 13:24:26 2011 +0000
+
+ Tweak --disable-snmp-set changes
+
+commit 827c8b28830171faa9c61d53efca9eb6600561c2
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 11:25:43 2011 +0000
+
+ CHANGES: python: PATCHES: 3433846: Fix for use with python 2.4
+
+commit f98a54a99caf7b46b100a920db942cbca9c43926
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Dec 27 10:10:36 2011 +0000
+
+ Skip SET-based tests when configured with --disable-set-support
+
+commit 230df14f94c3736ff34379a4e281eea353b47f80
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Dec 26 23:34:23 2011 +0100
+
+ Do not assign tmStateRef twice
+
+commit c96b3b4d8530ad5e0efb03f24dab5e5f1a460031
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 25 11:18:21 2011 +0100
+
+ Correct use-after-free.
+
+commit c5978c89cde2440f4d20dadbc9d1dd8db562d56e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 25 11:15:44 2011 +0100
+
+ Correct double-free.
+
+ netsnmp_tlstmAddr_add takes ownership of it's argument so calling free on the
+ argument on failure is incorrect.
+
+commit c139ca123b44bb3b9b6bf921e1609cc45f63a660
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Sat Dec 24 16:55:30 2011 +0000
+
+ CHANGES: snmpd: PATCHES 3410059: Fix sparsely augmenting trigger tables
+ Patch provided by Stephen Turner
+
+commit c4ae021b2e6384437081c5623f360c8896390188
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Sat Dec 24 16:29:54 2011 +0000
+
+ CHANGES: snmpd: PATCHES 3410050: Skip already-'processed' varbinds
+ Based on mib2c patch provided by Stephen Turner
+
+commit c6accf8c66254fa8c48767ed7dec795ddafc522e
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Sat Dec 24 16:27:11 2011 +0000
+
+ CHANGES: mib2c: PATCHES 3410050: Skip already-'processed' varbinds
+ Patch provided by Stephen Turner
+
+commit a61826ad8ca54661d1d909712503bd3a8b32eed0
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Dec 22 18:35:46 2011 +0100
+
+ Remove unused variable.
+
+ myMatch is unused as nmatch is zero and also since regexBuffer is created
+ with REG_NOSUB set.
+
+commit ba4fc80fe2cfd5a5d89230d8f3703e4fe01e6019
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Thu Dec 22 19:24:40 2011 +0000
+
+ CHANGES: agent: PATCH 3402376: from Leonardo Chiquitto: Recognise ReiserFS
+ Also move various FSType definitions to the appropriate blocks
+
+commit b5ac4a04dcd5470d08d03321abcd1e982621e6e0
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:39:46 2011 +0100
+
+ Fixed unterminated strings after strncpy
+
+commit 2b37e4e8f250a0d8821199a74ac3f4e5b7b7baba
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:31:51 2011 +0100
+
+ Fixed unterminated strings after strncpy
+
+commit 3d08345156c419333de969f13d21fcec7e18e94d
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:32:29 2011 +0100
+
+ Fixed unterminated strings after strncpy
+
+commit cd859ad51c4f18d5b0fc69dd669fcb051c798969
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:39:33 2011 +0100
+
+ Fixed wrong memmove size
+
+commit 30ff58d09d4c9d5438bb621054fd7ad7a2a597e4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Dec 22 14:07:19 2011 +0100
+
+ Fixed wrong length of buffer when printing ASN_BIT_STR
+
+commit 6c1487e1d360d3d260a39cb1f5b15da978395053
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 15:47:34 2011 +0100
+
+ Fixed potential free of uninitialized pointer in error cases
+
+commit c76fb96f65e33ba2fd212a921e8c386155ee5c7a
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 15:44:46 2011 +0100
+
+ Fixed unitialized values in udpTable
+
+commit c44608679b89751176f28a2e54d5282b46e2a05c
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 14:56:13 2011 +0100
+
+ Use calloc instead of malloc and manual clearing
+
+commit a05c5f9513461824e7903ae9ae9a6c3386e33879
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 14:40:50 2011 +0100
+
+ Fixed printing of unitialized variable when sensors_get_label() fails
+
+commit e4a5edc72393bd3de9bf12bceba9d83bbf7de70b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 14:31:25 2011 +0100
+
+ Removed unused variable
+
+commit fae2e5b835b8df1eae47e4cebb4eb404d7282377
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 13:31:21 2011 +0100
+
+ Fixed dereferencing unitialized iid in error cases and with debug info enabled.
+
+commit 9d58f81a9239cfbcfc8ebce367d21e9b3dcb028b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 13:33:33 2011 +0100
+
+ Fixed dereferencing uninitialized variables in error cases
+
+commit 0bc8c08edeae7ae095f116258c20ae5767d60652
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Dec 21 13:20:52 2011 +0100
+
+ Fixed returning uninitialized variable 'status' when ss == NULL
+
+commit 7304c53cf8adee8eccef1a8f26756fc07f098721
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 18 23:31:53 2011 +0100
+
+ On solaris 10 test in /bin/sh doesn't support the -e test. Replace it with -f
+
+commit 8cd3be60d693c9c36ffb97d3d9bcb49c1b4abe35
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Dec 17 08:52:24 2011 +0100
+
+ Avoid repetition of the complex expression determining if it is possible to get the destination address.
+
+ This also makes it possible to build on platforms like Solaris 10 that define
+ IP_RECVDSTADDR but lack either of msghdr.msg_control and msghdr.msg_flags.
+
+commit 953f2e3d425ede3b863a2e7ccb0b4bc862928b57
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 5 22:13:07 2011 +0100
+
+ Move the use of _sendto and _recvfrom below their definitions.
+
+commit 68a1173c46cf77601426cf391d9a852794f2057e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Nov 20 20:05:18 2011 +0100
+
+ CHANGES: snmplib: Separate out the cmesg buffer size
+
+commit 461dd16f3b2647322cdce6363081cc44ba5a49b5
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 26 21:51:01 2011 +0100
+
+ CHANGES: snmplib: Merge together the Linux and *BSD version of src port sending.
+
+commit 7accb69baa1fc0b6a3439d2e549c86da3453bad2
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:30:31 2011 +0100
+
+ Use a bare struct iovec in instead of a one element array.
+
+ The purpose of this change is to make _recvfrom more similar to _sendto.
+
+commit 39852cd4c85ef2bfc75cdea2825261ee93e768c2
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:29:20 2011 +0100
+
+ Add comment describing the purpose of the call to getsockname after almost removing it.
+
+commit 1b292ca27eab5caa73feaaa83dc9c12abc0f2e70
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:27:59 2011 +0100
+
+ Reduce variable scope.
+
+commit bc879571eca9520bc132f840c3e659d3793144d7
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:25:36 2011 +0100
+
+ Introduce temporary variables to ease the extraction of the server address.
+
+commit b7eea6cffbd872932ce2c04fefb6f43de339f374
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:18:33 2011 +0100
+
+ Rename the cmesgptr variable to cm.
+
+ The purpose of this is to increase the readability of the code.
+
+commit 0a7461e728805c62a1cab9d87bfc74c7927a9fcc
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:15:22 2011 +0100
+
+ Factor out a common loop in recvmsg option processing.
+
+commit b3c6248d0201ab1610840d6d0e749b3b6c4ad792
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:13:43 2011 +0100
+
+ Unify the structure of Linux and BSD recvmsg option parsing somewhat.
+
+commit 356400d6290a423b52ebeea5a5e976fb15bb73b4
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Dec 11 19:04:56 2011 +0100
+
+ Use CMSG_DATA on the result of CMSG_FIRST/NEXTHDR, not on the buffer.
+
+commit 3b351708c62de46aa1b90ed232cfd8c7c5b02231
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 12:00:32 2011 +0100
+
+ Remove a cast
+
+commit de9250d9dae9727a6cc7f647688dddf1b8597128
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 11:58:04 2011 +0100
+
+ CHANGES: snmpd: Make sprint_mib_oid() treat OID components as unsigned instead of signed integers
+
+commit 0e33b3b6d5854a4bac15d4ea5e016c53d161d0cd
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 10:02:28 2011 +0100
+
+ Fix recently introduced compiler warnings
+
+commit b7e50d5f9a6755982d2af3191473cb34643bc03f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 08:37:22 2011 +0100
+
+ CHANGES: snmplib: Reduce overhead of config file parsing
+
+commit 73c9ee42d28afe2e107a7d6616b6d011890c36ea
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 8 09:09:59 2011 +0100
+
+ Remove unused variables
+
+commit 3db97962b37eb12d254d61e6be234b06a391c8bb
+Author: Bill Fenner <fenner@gmail.com>
+Date: Thu Dec 8 07:43:45 2011 +0100
+
+ CHANGES: snmpd: PATCH 3453868: from "Bill Fenner <fenner@gmail.com>": Factor common code into pass_common
+
+ Move the code for pormatting and printing values from pass and pass_persist
+ into pass_common.
+
+commit b6568c83f1756e9a65434edeeeb40d23ddbbb652
+Author: ccchiu <ccchiu@sourceforge.net>
+Date: Wed Dec 7 16:25:27 2011 +0100
+
+ CHANGES: BUG: 3452069: Fix snmptrap_oid declaration in mib2c generated code
+
+ This bug was introduced considerable time ago. It did already exist at the
+ time the 5.6 branch was created (see also commit
+ 0ec088afa27cfda4e6ea78aae7cfc5507564edde).
+
+commit d494db64c208b4dc62813132f8863bd5c1a39d77
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:38:17 2011 +0100
+
+ CHANGES: snmptrapd: Eliminate an unused variable (Now)
+
+commit 28f2561bc2935d8e1cbf46d2820158173e7a4cf4
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:37:11 2011 +0100
+
+ CHANGES: snmptrapd: Move the main loop code into a new function
+
+commit 396e122ddc42a916f06a02884c0e8a258edbe238
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 09:32:16 2011 +0100
+
+ CHANGES: snmpd: Match each getpwnam()/getpwuid() call with an endpwent() call and each getgrent() call with an endgrent() call.
+
+commit 3efefbc0024399786f8b68b1e93b0a8fddddc7da
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:41:01 2011 +0100
+
+ CHANGES: snmptrapd: Remove superfluous casts
+
+commit 7f05daa8e0e0f533b0f12a3e1cf07641519909d6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 11:58:32 2011 +0100
+
+ CHANGES: BUG: 3444939: BUG: 1796886: snmplib: Avoid that sprint_realloc_octet_string() embeds unprintable control characters or binary zeroes in its output. This behavior could cause truncated output in snmptrapd.
+
+commit db8f558fd2f3b7c109ea3a1c2133b75b6f8cb2ad
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Dec 1 10:04:41 2011 +0100
+
+ Compiler warning fix: pass unsigned chars to isprint() instead of signed chars.
+
+commit 800dc1028e7e0cd8cc14d84dd31723d47ac073db
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Dec 1 10:18:58 2011 +0100
+
+ Reduce the scope of the hint variable
+
+commit 83ea4a080c90a74b9743d3f24cf0d4b8a1e8c849
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Nov 27 21:16:52 2011 +0100
+
+ Reduce the scope of the variable qos
+
+commit 7b9e03441c3dc3a07670ed01f5d04791a82c750c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:04:01 2011 +0100
+
+ Remove #define val(x) __STRING(x) and change val(x) into __STRING(x).
+
+commit 2f379b0e4ecadfa4e541e3005c8fc8281882b741
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 15:58:47 2011 +0100
+
+ Follow-up for commit 1aa704e: unbreak the MSVC build
+
+commit 64ef0f71127617837027fb2cfaf174b95ba79e0d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:19:50 2011 +0100
+
+ Add SNMP::register_debug_tokens()
+
+commit 7bead9ca917c67566d5ed98ab507bbc02816217d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:08:08 2011 +0100
+
+ AgentX subagent: Reduce code duplication
+
+commit 0ed71541f87e7d78bc998eebda3217c59e1df830
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:03:19 2011 +0100
+
+ CHANGES: snmplib: Add Doxygen-style function header for netsnmp_register_default_target() and netsnmp_clear_default_target().
+
+commit 8c2972b61e40169b47c50988b6ae9e8c285f84f8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Nov 30 14:02:54 2011 +0100
+
+ CHANGES: perl: Fix spelling in the documentation of the SNMP module
+
+commit 5df2bac6bd717799311f001ac7b73db88f11bdda
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Tue Nov 29 08:59:58 2011 +0100
+
+ CHANGES: snmplib: Only transform the address to printable form when needed.
+
+commit 171e8d48d4af04013cff8fd28f5341a2aef21d88
+Author: Mijo Safradin <safradin@linux.vnet.ibm.com>
+Date: Tue Nov 29 16:49:46 2011 +0100
+
+ CHANGES: snmp-bridge-mib: Fix index interpretation.
+
+ This patch corrects a wrong data interpretation.
+ snmp-bridge-mib obtains the ifindex value from the sysfs
+ attribute 'ifindex' The value given by the sysfs attribute
+ is an integer, which is handled as hex and leads to
+ incorrect data displayed to the user.
+
+ e.g.
+ $ > snmpwalk localhost BRIDGE-MIB::dot1dBasePortIfIndex.2
+ BRIDGE-MIB::dot1dBasePortIfIndex.2 = INTEGER: 54
+
+ according to the sysfs attribute the value is 36
+
+ $ > cat /sys/class/net/<device>/ifindex
+ 36
+
+ Signed-off-by: Mijo Safradin <safradin@linux.vnet.ibm.com>
+
+commit 82e39fb6706df90ecf2fc9e10ada2b962ee196f3
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Nov 29 12:27:46 2011 +0000
+
+ Fix multi-line case testing of incoming OID
+
+commit b15da1a4516061105a1eac7450cf650ec44266b2
+Author: Nikolay Denev <ndenev@gmail.com>
+Date: Tue Nov 29 08:29:49 2011 +0100
+
+ CHANGES: FreeBSD: Restore IP_RECVDSTADDR functionality.
+
+commit 7f47f52e481baa9aafb5784244b0dd2653e7dcff
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Nov 28 08:51:39 2011 +0100
+
+ CHANGES: snmplib: Use SNMP_ALLOC_TYPEDEF to allocate transports in order to avoid the separate call to memset.
+
+commit cf86039e3086225c3085bb9adf088b8ba5ba6979
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Nov 22 15:02:58 2011 +0100
+
+ CHANGES: MinGW: testing: Make unit-tests/T102pdu_build_clib pass.
+
+commit 1a87e76e00ee3d5cd37a07bfc3d84490d3c2a4ec
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Nov 22 14:55:42 2011 +0100
+
+ CHANGES: MinGW: testing: Make unit-tests/T014gethostbyaddr_clib pass
+
+commit 8867fd1dcfe72b59d07322ff38a699b66ec4f326
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Nov 22 09:44:38 2011 +0100
+
+ CHANGES: snmplib: Make netsnmp_large_fd_set_resize() robust against memory allocation failures.
+
+ CHANGES: snmplib: Make NETSNMP_LARGE_FD_ZERO() use memset() on Unix systems instead of an explicit loop.
+ CHANGES: snmplib: Make sure that on Unix systems netsnmp_large_fd_clr() doesn't try to read memory it isn't allowed to read if the first argument equals -1 (a value that shouldn't be passed by the caller).
+ CHANGES: snmplib: Make netsnmp_large_fd_is_set() return false on Unix systems if the first argument equals -1 (a value that shouldn't be passed by the caller).
+ CHANGES: Windows: Make netsnmp_large_fd_set_resize() shrink behavior correct.
+
+commit 23db0cf09b8b0eab37b749ef0c3c3f306900245c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Nov 21 23:02:57 2011 +0100
+
+ Fix casting tv_usec to int which may be too short
+
+commit 80ee4022e534e64aad5a5f27192843b42acb85e0
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 09:14:02 2011 +0100
+
+ CHANGES: snmpd: BUG: 3439234: Move netsnmp_pass_str_to_errno to pass_common and rename it to netsnmp_internal_pass_str_to_errno
+
+commit 0baa9296c072bb3735760b0dd992f2d1d3ca27fa
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 09:05:24 2011 +0100
+
+ CHANGES: snmpd: BUG: 3439234: Correct the dependencies of ucd-snmp/pass and ucd-snmp/pass_persist
+
+commit 1aa704e4a294430b28e39b6f9e4683b8a48bce04
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 08:35:21 2011 +0100
+
+ CHANGES: snmpd: Factor out asc2bin and bin2asc. Add a netsnmp_internal_ prefix to them
+
+commit cda8fe91013f12cbf64a0775abb55720035af931
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Nov 19 00:55:24 2011 +0100
+
+ CHANGES: snmpd: Call snmp_oidtree_compare instead of snmp_oid_min_compare
+ CHANGES: snmpd: Remove snmp_oid_min_compare since it is internal and unused
+
+commit 85f893e2b605e67f9bd0443c74e2ed269aa68564
+Author: Niki Denev <niki_d@users.sourceforge.net>
+Date: Thu Nov 17 22:42:32 2011 +0100
+
+ CHANGES: snmpd: PATCHES: 3175640: Use IP_RECVDSTADDR sockopt where available (*BSD)
+
+ This hunk fell of when the rest of the patch was merged.
+
+commit 5c913e54656ae0096b1feb6da98b5fc9ca81f276
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:33:07 2011 +0100
+
+ Define the full NetBSD hierarchy downwards
+
+commit b881841bd0493dd71d63259bdded449b06f02c32
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:30:33 2011 +0100
+
+ Fix size_t/int mismatches
+
+commit ca294cf75bbc8e90dbf44ee40478935e91db1487
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:18:03 2011 +0100
+
+ Remove unused variables
+
+commit cd32c2dff06b9b452cc18d552d2f2234092c829c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:17:09 2011 +0100
+
+ Fix format warning
+
+commit 883136c2b2fa0739f437a8cfb6614accc76e268e
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:15:58 2011 +0100
+
+ More needs for NETSNMP_PRIo format specifier
+
+commit b8084a7ccc909b6d6db7c0e8e596d78671f5678b
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:14:26 2011 +0100
+
+ Fix using char as array index (ctype.h)
+
+commit 84529e6320a89d97f1314aebad806255d2a1b18c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 23:00:57 2011 +0100
+
+ Fix missing format for FreeBSD 4
+
+commit 4bd0352955a2551bfe02308dd134b9128c98b9e9
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 22:59:36 2011 +0100
+
+ Fix paranthesis problem
+
+commit fe6269b1900cf44dc27a199a761d15a01c3f3092
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 22:58:34 2011 +0100
+
+ Fix size_t/int mismatches
+
+commit a4db9f9fc13d21ecff488eb410376edda6c28232
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 13:43:34 2011 +0100
+
+ Remove unused variables
+
+commit 390c0114c8ec0bdb27b08b6f74e3f6ef3a62981b
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 13:37:49 2011 +0100
+
+ Fix format specifiers to avoid warnings
+
+commit 25cfc1962ae576ccb1558da1e3ef8b6c17f63c16
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 11:27:53 2011 +0100
+
+ Really up-to-date mibs
+
+commit 0e86c781f3989bf022c8993a118617b74a75420c
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:17:19 2011 +0100
+
+ memory_linux: get Shmem from /proc/meminfo for 2.6 (or newer) kernels
+
+commit bf264d15ded7acbbf2e3871b98fd1fcef43d9ec3
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:16:16 2011 +0100
+
+ memory_linux: close sockets in error situations
+
+commit 57ff8a40bae5d9bcad16089142a9cf328c9fa1f5
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:14:57 2011 +0100
+
+ disman/ping, disman/traceroute: Close sockets in error situations
+
+commit 8a2502a15c3217b95939a3c836167d230ac35f02
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 16 09:13:53 2011 +0100
+
+ Up-to-date list of RFCs wit mibs
+
+commit dcdd702111d8da5f53804cfcf0dfdad731468bde
+Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
+Date: Tue Nov 15 10:57:34 2011 +0000
+
+ Don't try to install an empty list of man pages (MAN3)
+
+commit ba619804e5978a8df754844efcca52b69b5015fa
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Nov 14 13:34:20 2011 +0100
+
+ MinGW: Make sure that the backslashes in the pskill message are displayed.
+
+commit 923eecc507f75043b60c5e68053a4f396ab0b0d2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Nov 14 12:36:38 2011 +0100
+
+ Compiler warning fix for systems where uint64_t = unsigned long (e.g. RHEL 6.1/x86_64)
+
+commit 434bfc1f7457550b6f87d5bcd511276b270b5964
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Nov 14 11:22:53 2011 +0100
+
+ CHANGES: snmpd: from Martin Wilck: fixed snmpd crashing with 'select: bad file descriptor'.
+
+ On 32-bit systems, snmpd dies with aforementioned message when using file descriptions > 32, e.g. when having >32 AgentX subagents.
+
+commit ed65eca6e7f9cfa7380a78d56c01ed314745b169
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 19:01:21 2011 +0100
+
+ FreeBSD-9: Fix for const'ifyed nlist arguments
+
+commit eaca7983e3655ab696fcc4461ca0cedbac6ce69a
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 19:00:12 2011 +0100
+
+ NetBSD-6: One more instance of timespec replacing timeval
+
+commit 8ad6c53fdec5adeae4e52f1751ecec4a345bab05
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 18:59:01 2011 +0100
+
+ Fix buig #3436527: arp_netlink: fix dying reload of cache
+
+commit 378ffed03ba79a8346d6c62781e2ddf5ce92a478
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Fri Nov 11 18:55:43 2011 +0100
+
+ Fix bug #3436528: swinst_pkginfo: recover from NULL return from opendir
+
+commit d7ad8f5f9f3f67f16f65c2515d11e194d2cdd12c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 10 14:04:41 2011 +0100
+
+ CHANGES: Cygwin: Make date_n_time() produce time zone information
+
+commit ba35c50b2f459bd9c11ed59cc7d1b16215644fa3
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 10 14:17:04 2011 +0100
+
+ Replace AC_TRY_LINK() by AC_LINK_IFELSE()
+
+ Note: these changes do not affect the generated configure script.
+
+commit f615bf24f5d0f23ce9301da556184d6460740456
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 9 20:32:49 2011 +0100
+
+ Fis Bug #3434824: SIGSEGV when reading disk directive after SIGHUP
+
+commit a94a179d9340f51fa7c23431630bc0ffd6d759e8
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 9 20:30:51 2011 +0100
+
+ Fix bug #3433616: dont treat DateAndTime as a string
+
+commit b29e4164531d258fe34a6fe2b9e1ec60c56f9544
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Nov 7 01:25:57 2011 +0100
+
+ CHANGES: testing: Remove unused variable
+
+commit e221e65fdc1c68f1968651717dcc9ccfb6414783
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 3 15:05:00 2011 +0100
+
+ Fix warnings about converting sockaddr_in * into sockaddr *.
+
+ This is a follow-up for commit a0af385.
+
+commit 2e7e9eda0b0d62a7645a9a8f70ef3fb6f3dd6941
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Nov 3 11:17:48 2011 +0100
+
+ Fix uninitialized variable warnings.
+
+commit 3462ebcdd0b7c298cb15c3099736f4f952257846
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 28 16:07:15 2011 +0200
+
+ Remove those superfluous parentheses that trigger a clang warning.
+
+commit 3e5fedd3e7d1ef31683604bf73dc56e944cad349
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Thu Nov 3 09:45:27 2011 +0100
+
+ CHANGES: snmpd: fixed UCD-SNMP-MIB::systemStats after 30 days of uptime.
+
+ After 30 days, values from /proc/stat (on Linux) can get bigger than 32bits and snmpd calculations might render counters like ssCpuUser negative or zero, while the real value is higher. Therefore the counters should be tracked as the largest integer available.
+
+commit 0fc8221b24988c4ae6180ed42b86b9852fd586ad
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 2 22:59:08 2011 +0100
+
+ dskIndex was off by one
+
+commit a5b28829e64d5f3b87e4b9b1ef8cc204f33a61b7
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed Nov 2 21:25:07 2011 +0100
+
+ Solaris needs $AWK to get a usable nawk
+
+commit 2801a2139f27021e1ab15e362e2d3d624ffaa494
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Oct 31 22:55:53 2011 +0100
+
+ Patch #3406364: Fix unstable data for NetBSD.
+
+commit 821a58d112d7ac495149e262d704412ba2800438
+Author: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon Oct 31 22:43:52 2011 +0100
+
+ Fix ipv6 statistics looping too far when scanning interfaces.
+ Fix TCP session table repeating data from first entry for all.
+
+commit 349591d03e17a55b43eacc6a687b02fd8d4e9528
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Mon Oct 31 08:59:37 2011 +0100
+
+ CHANGES: perl: Make it possible to build perl support without support for opaque types.
+
+commit 1ec7110e72bce1561f746517459d6f043016b60e
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 30 19:05:30 2011 +0100
+
+ CHANGES: testing: Make the asn1 test pass even if support for opaque types are removed.
+
+commit 6d26918af55aa3662a720542de77bbf39b0a3e91
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Oct 29 08:34:33 2011 +0200
+
+ CHANGES: snmpd: Disable the support for integer64 in pass scripts if compiling without opaque-special-types.
+
+commit 29bf69d70424f359d9c87f07a964a099415649a5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 13:02:25 2011 +0200
+
+ CHANGES: snmptrapd_sql: Avoid that a linker error is triggered on systems where my_progname is missing in libmysqlclient (e.g. Fedora 15 and 16).
+
+ This is a backport of commit 9f653f7.
+
+commit 2cc9504b9bb8625b94be6cda7e60993d059cd928
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 09:01:23 2011 +0200
+
+ CHANGES: snmplib: BUG: 3428506: Fix netsnmp_gethostbyaddr()
+
+ This patch should fix the regressions introduced by commit 85d96c4 (May 13, 2011).
+
+commit 9b427b353f1ceb8fe87e6fc8ed3b6cfab3ce7f20
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Oct 27 08:20:00 2011 +0200
+
+ MinGW: Avoid confusion between MinGW's kill.exe and the SysInternals pskill.exe
+
+commit 2c45f92cfcb5b05e049226a5a7883a0b106011ae
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 10:42:29 2011 +0200
+
+ Fix compiler warnings about passing a const pointer to a function accepting a non-const pointer.
+
+commit 275d23edfdebe0577b08421e4c6c936ae39b7fdc
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 09:33:09 2011 +0200
+
+ Fix compiler warnings about set-but-not-used variables
+
+commit 4495e17c078ac6997a9c7fa1a88db0644e919491
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 26 09:32:46 2011 +0200
+
+ Fix compiler warnings about casting away const
+
+commit 13952f6bee9f408867ab6d2fdfdde4f284074957
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Oct 26 14:05:16 2011 +0200
+
+ CHANGES: snmplib: from Siddhesh Poyarekar: properly clean up old requests in a subagent when we reconnect to master.
+
+ An snmp subagent linked against net-snmp-libs may crash if it handles a
+ response which has magic referring to an older disconnected main session. This
+ may happen when the subagent
+ attempts to clean up old requests on reconnection of the disconnected master
+ session.
+
+commit ae052472b22720d08369e85127db214245df2e3f
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Oct 25 16:15:17 2011 +0200
+
+ CHANGES: perl: fixed segmentation fault when handler registration fails.
+
+ When netsnmp_register_handler fails, it frees its reginfo -> nsahr_DESTROY (and any other function) must not dereference it.
+
+commit c199bf91b6239f26b2aab34e8575e0f0df9cde9b
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Mon Oct 24 14:25:28 2011 +0200
+
+ CHANGES: snmpd: xfs, jfs and vxfs filesystems are now recognized in hrStorageTable
+
+commit 747fdc71e64d09e080928ebbb4d04cbde3906799
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Wed Oct 5 15:57:59 2011 +0200
+
+ CHANGES: snmpd: Lowered severity of 'error finding row index in _ifXTable_container_row_restore' message.
+
+ The message is shows up when snmpd is started and there is different set of network interfaces than it was when snmpd wast last stopped. This is common on ppp-servers or virtual hosts.
+
+commit 250f698e59eab9f1ffd332ff59fdb72ea0df06ff
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 23 08:51:23 2011 +0200
+
+ CHANGES: building: Make the transport configuration code work again
+
+ Previously the transport inheritance processing code ran with
+ NETSNMP_FEATURE_CHECKING set. In this mode the file net-snmp/feature-details.h
+ is requiered. That file is created during the first make run, and that happens
+ after configure is run.
+ Change this to undefine NETSNMP_MINIMAL_CODE, effectively turning off feature
+ support during transport configuration in order to make it work at all.
+
+commit 6ef6907642247c663b9b8964b9fd44a211dbcaa7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Oct 20 20:30:54 2011 +0200
+
+ CHANGES: snmpd: BUG: 3408398: Fix a memory leak in agent/mibgroup/hardware/fsys.
+
+ This memory leak was introduced via commit
+ 9bf3d96d96a8ecd4a5fc35c326dc937467002b6c: Initial HAL
+ implementation of FileSystem information (March 7, 2008).
+
+commit cf82b894b2217c26edc6f1356351c932415604e2
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Sat Oct 15 14:45:08 2011 +0200
+
+ CHANGES: snmplib: BUG: 3423915: Change default number of retries back from 0 to 5
+
+ This patch fixes a bug introduced via commit 6cac050 (May 5, 2011,
+ added support for specifying the default number of retries in
+ snmpd.conf).
+
+commit c11adaa12915abfee629bb6c026c21f2185b216e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 17 10:24:46 2011 +0200
+
+ CHANGES: Win32: Avoid that compiling the header file <net-snmp/net-snmp-config.h> with the MinGW gcc compiler triggers warnings about "pragma comment".
+
+commit b17a72a793483aee4a5bb2f2e2c7f4fd869817e6
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 17 10:22:20 2011 +0200
+
+ CHANGES: Win32: Avoid that the PACKAGE_* macros defined in <net-snmp/net-snmp-config.h> cause trouble when including this header in a package that uses the GNU autotools.
+
+commit 664d3ae107d754051b8c42279d459aa57a1be1c3
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 16:47:16 2011 +0200
+
+ MinGW, hw_fsys: Use proper format specifiers in a debug statement.
+
+ This patch fixes an issue introduced in commit 76ff25d.
+
+commit 211dcb49306561e35ba3c213be7cfa257b40a8e5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 15:52:43 2011 +0200
+
+ Avoid that gcc 4.6 complains about set but not used variables
+
+commit 9f653f73e5aa70f0bef1174632e95594f87f669f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Oct 10 13:02:25 2011 +0200
+
+ CHANGES: snmptrapd_sql: Avoid that a linker error is triggered on systems where my_progname is missing in libmysqlclient (e.g. Fedora 15 and 16).
+
+commit 4c83b9229a7454f34f6ff75f69e67e4030c419b5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 7 15:58:45 2011 +0200
+
+ CHANGES: snmplib: Set the rpath for libperl.so in libnetsnmpmibs.so such that the dynamic linker can find libperl.so without requiring the user to modify the dynamic linker settings.
+
+ This change in agent/Makefile.in is necessary on the 5.5 branch and
+ later but not on the 5.4 branch. That is because the 5.4 branch uses
+ an older version of libtool that propagates the rpath of dependent
+ libraries. This is called inter-library dependency tracking in the
+ libtool manual. This functionality is present in libtool version 1
+ but not in libtool version 2. For more background information about
+ dynamic libraries and rpaths, see also the document with the title
+ "RpathIssue" on the Debian wiki (http://wiki.debian.org/RpathIssue).
+
+commit 8925c912d2639752a84bcffeef1b70a81026449b
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 7 14:21:28 2011 +0200
+
+ CHANGES: agent: HOST-RESOURCES-MIB: Add missing brace in a debug statement
+
+commit 76ff25d9bf97579e7213102065fd5096f049a4c5
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Oct 7 14:13:18 2011 +0200
+
+ CHANGES: snmpd: HOST-RESOURCES-MIB::hrStorageTable: fix bug in handling large filesystems, where large means above 8 TB (= 2**31 * 4096 bytes).
+
+ This patch fixes a bug introduced in commit
+ 71d8293f387a6cd66bb0dbb13c0f50174d2e678b.
+ For the original bug report, see also
+ https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3419825&group_id=12694.
+
+commit 866033db9904ffb1203f283f838092e4cf68de6b
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Oct 6 07:33:27 2011 +0200
+
+ CHANGES: snmpd: Remove spurious #endif that seems to be the result of a mismerge.
+
+commit 20f4f3267ee20d55705b7a43789879c103f96620
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Thu Oct 6 00:08:59 2011 +0200
+
+ CHANGES: building: Add missing end comments to feature ifndefs.
+
+commit e5de2cc57bf304f3320cad0034d2ea2d8aedc436
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 5 09:15:10 2011 +0200
+
+ CHANGES: agent: Log a more detailed error message if embedded perl initialization fails
+
+commit 5eef9990de28f63111e6c093be0f3c7ae2d513a1
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Oct 5 08:45:49 2011 +0200
+
+ CHANGES: perl: Add agent::uptime()
+
+commit 6810ed42f9bc560750d6dbfb7e50b6e2ac11899c
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 30 11:01:23 2011 +0200
+
+ CHANGES: Cywin: agent: Implement get_uptime() such that querying HOST-RESOURCES-MIB::hrSystemUptime returns a non-zero value.
+
+commit 97172b311d20f4441c7a7e90092b59c1e0da99f7
+Author: Thomas Jarosch <tjarosch@users.sourceforge.net>
+Date: Wed Oct 5 08:46:39 2011 +0200
+
+ CHANGES: PATCH: 3418649: HOST-RESOURCES-MIB: Use pclose() instead of fclose() to close a pipe.
+
+commit 6591937adb85000c27069c4be84cf4688838ebcd
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 16:18:03 2011 +0200
+
+ CHANGES: building: Add dependencies on @FEATURETARGS@ to make the subtarget work as well.
+
+commit b9c8012ec035bc084f175876fecc375195f9be81
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 14:02:58 2011 +0200
+
+ CHANGES: building: Add target to build agentxtrap from the toplevel
+
+commit 995647c0cfe00412262cc5797bdfae9d00b70c76
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 15:44:36 2011 +0200
+
+ CHANGES: building: Remove the use of -L flags for internal libraries as it confuses libtool.
+
+commit 93dc1235a0db58ffd29617cff00dc11263780202
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 11:31:46 2011 +0200
+
+ CHANGES: building: Make make apps work again
+
+ apps include snmptrapd and that require the agent libraries as well.
+
+commit ba41488ed44cd23c25963d4fc56c476853b2ab59
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sun Oct 2 11:29:33 2011 +0200
+
+ CHANGES: building: When you say make libs you expect all the libs to be built.
+
+ This is demonstrated by the snmptrapd target at the top level which obviously
+ expected both libs to be built and so failed to compile before this patch.
+
+commit 3057c73e093473be46254bcdfb4ca788e432d1b8
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Sep 30 07:32:52 2008 +0000
+
+ NEWS: building: PATCH: 2091156: correctly declare dependencies in Makefile.
+ 'make -j <N>' should work now.
+
+ Backport this to V5-4 as it is needed for correct operation in the single
+ threaded case of make miblib as well.
+
+commit 6eae340fa2a64086592982cc52735bc01487d978
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Sat Oct 1 19:33:50 2011 +0200
+
+ CHANGES: building: Silence libbsd 0.3.0 nagging
+
+ If you have libbsd 0.3.0 installed then their version of nlist.h warns and
+ tries to make you include bsd/nlist.h instead. The problem is that we don't
+ need that compatibility library as we know how to do it ourself so it becomes
+ pure nagging. This patch adds a define that changes the warning into an
+ error and then figures out that there is no usable nlist.h and ignores it
+ for the future.
+
+commit ac38cb531bee50edc8d4c834f3005f5992c771d8
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 19:03:02 2011 +0200
+
+ CHANGES: perl: Enable sending SNMPv2 traps with an empty varbind list
+
+commit a75de2971527ac2d2e812024298602bb2412f337
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 30 10:41:44 2011 +0200
+
+ perl/SNMP/SNMP.xs: Update emacs modeline
+
+commit 848f6300efe38492fb454451a030f0b7e6ff8c9d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 30 10:41:44 2011 +0200
+
+ perl/SNMP/SNMP.xs: Update emacs modeline
+
+commit c1374473ecd8ec9e0310013861ee18c83e5d6c5b
+Author: Magnus Fromreide <magfr@lysator.liu.se>
+Date: Fri Sep 30 03:29:36 2011 +0200
+
+ CHANGES: testing: Protect the use of $OSTYPE to ensure that 'test' get enough parameters.
+
+commit 7e97a20633a57eae39d015b23339463c32f5f848
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 10:22:08 2011 +0200
+
+ CHANGES: testing: Convert snmplib/test_binary_array.c into two unit tests
+
+commit 9c0dd98176457342fffaa5e74d802e3145ed70e7
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 08:56:17 2011 +0200
+
+ CHANGES: testing: Add unit test for netsnmp_register_old_api()
+
+commit 5fd26e4fa3e000ea9c81c38ab975b7946efe2157
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Sep 28 17:49:55 2011 +0200
+
+ CHANGES: agent: Avoid that netsnmp_register_old_api() failure triggers a double free.
+
+ Fixes a regression introduced via commit
+ aa4d47c2609e52818c9cdf1a8e2205de9a335a0a (svn r19515).
+
+commit d2252d016693807326f72b66123649dea00af916
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 29 10:20:08 2011 +0200
+
+ CHANGES: testing: Require a semicolon after OK(), OKF() and PLAN()
+
+ Also, let OKF() emit a single line of output such that all output it
+ produces is visible in the output of "make test".
+
+commit 1421924b4852142192c5bb9e93ddbfed69e908fa
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Sep 21 22:20:08 2011 +0200
+
+ CHANGES: snmplib: Avoid waiting indefinitely if a session has timeout zero
+
+commit 5f27f4f74ae2bd5baf503cf306b4f9a2841a57cf
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:32:03 2011 +0200
+
+ CHANGES: MinGW: testing: Fix a race condition in the test runner
+
+commit 09703958cc5ea845929ae19ef9e0804aecaa512e
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 27 12:42:41 2011 +0200
+
+ CHANGES: testing: Avoid false negative for T114agentxagentxtrap_simple caused by the test result being present in the hex dump ("mostly_harmless")
+
+commit 439300279f6f31438638d2f222c24c3c841fa6ab
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 27 11:16:32 2011 +0200
+
+ CHANGES: building: Micro-optimize agent module dependency analysis
+
+ This makes the agent module dependency analysis carried out by the
+ configure script slightly faster, especially on those systems where
+ fork() is expensive (Cygwin).
+
+commit bbc680004a1376038dfdc4172dbe7b9e311fba68
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Sep 26 10:14:45 2011 +0200
+
+ CHANGES: MinGW: testing: Make test T130snmpv1vacmget_simple pass
+
+commit 70b06cf789208eaa890bfbcd638bdb775f817054
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 20 09:50:57 2011 +0000
+
+ CHANGES: Windows: testing: perl: Fix an incorrect message printed while running the Perl module regression tests
+
+commit 70bcc8de2d0fc92bbb8481823630fab9bc87af75
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Fri Sep 16 16:14:24 2011 +0200
+
+ CHANGES: MinGW: testing: Obtain the MSYS path from the environment
+
+commit 626275e2d1acafae7144a33ed301a40f596b37b0
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Wed Sep 14 13:14:17 2011 +0200
+
+ CHANGES: Windows: Remove superfluous link libraries from project files (*.dsp)
+
+commit 38fc3caa9eeb3800254b4f6ad6f8f4764c0f83db
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 20 09:34:08 2011 +0200
+
+ CHANGES: snmplib: Make netsnmp_callback_accept() return -1 (failure) instead of 0 (STDIN_FILENO)
+
+commit 6c8c7e8aca8fc2eeb52010ae3e9fee6dd83ef780
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 13 09:58:26 2011 +0200
+
+ CHANGES: snmplib: Remove obsolete snmp_get_fd_for_session() declaration
+
+commit 0860d11fd8fc5dbdaaae2261fae2c07fb9c2c82d
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 8 13:54:55 2011 +0200
+
+ CHANGES: Windows: MSVC: Avoid that the typedefs in <net-snmp/net-snmp-config.h> conflict with those in <stdint.h> from the msinttypes project
+
+commit f8a036f63ff68f083436120e0abd478b692a2f61
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Sep 8 13:21:06 2011 +0200
+
+ CHANGES: Windows: MSVC: When linking with OpenSSL, link with user32.lib too
+
+commit 836a23e10ca810c3899902d32587616a9d1203df
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Thu Jul 14 18:38:13 2011 +0200
+
+ CHANGES: Windows: MSVC: Link with proper libeay32 library
+
+commit 7b07fd6cdef49ec7bb04b166e2a4fbb37b582840
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 11:10:38 2011 +0200
+
+ CHANGES: testing: Remove an incorrect comment from simple_eval_tools.sh
+
+commit 98f6d29d981ff8e607600c63dadb240535629807
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:49:03 2011 +0200
+
+ CHANGES: testing: Make ISDEFINED() check for an exact match instead of a prefix match
+
+commit 52cd0031a31f692f13263a94c335d06be1454803
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:12:59 2011 +0200
+
+ CHANGES: MinGW: testing: Make those regression tests pass for which SNMPCONFPATH and/or SNMP_PERSISTENT_DIR matter
+
+commit f5cd89bd3356dd74e1556c0b50966a643f192085
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:12:59 2011 +0200
+
+ CHANGES: MinGW: testing: Fix a race condition in the test framework
+
+commit deedd52c834a6448852a06785536e13865969694
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Tue Sep 6 10:12:58 2011 +0200
+
+ CHANGES: MinGW: Support the directory structure of recent Shining Light OpenSSL binary distributions
+
+commit d55bd4e0549f03b6fd32562c2aa7fe39272a9ef7
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Sep 28 06:55:19 2011 -0700
+
+ remove the v5.7 from the frozen list
+
+commit ac2aed3c94bb2ebb473af0a1e20f0561ad629956
+Author: Wes Hardaker <hardaker@users.sourceforge.net>
+Date: Wed Sep 28 06:55:11 2011 -0700
+
+ remove the v5.7 from the frozen list
+
+commit 46eac02e9a27bf4f3068e795cab891f05a848870
+Author: Bart Van Assche <bvanassche@acm.org>
+Date: Mon Sep 26 21:49:27 2011 +0200
+
+ CHANGES: snmpd: Avoid that snmpd crashes if started on a system with another OpenSSL library version than the one it has been built with.
+
+----------------------------------------------------------------------
+
+Changes: V5.7.rc3 -> V5.7.1
+
+2011-09-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7.1
+
+
+2011-09-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * ChangeLog: version update for 5.7.1.rc3
+
+----------------------------------------------------------------------
+
+Changes: V5.7.rc2 -> V5.7.1.rc3
+
+2011-09-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7.1.rc3
+
+
+2011-09-22 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : commit 07f61a02a2409096e5c962cd211126396ad09d2b Merge: ee0d3ad
+
+ bda324b Author: Dave Shield <D.T.Shield@liverpool.ac.uk> Date: Thu
+ Sep 22 10:39:59 2011 +0100
+
+2011-09-22 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : commit c55f608f16f160f5e79dc057f8878def462973e1 Author: Dave
+
+ Shield <D.T.Shield@liverpool.ac.uk> Date: Thu Sep 22 10:35:24 2011
+ +0100
+
+2011-09-22 Steve Friedl <steve@unixwiz.net>
+
+ * agent/mibgroup/ucd-snmp/disk_hw.c: CHANGES: snmpd: 3409692:
+
+ Calculate disk percentage usage via floating-point arithmetic to
+ avoid integer arithmetic errors. (Code based on patch, rather than
+ applied verbatim)
+
+2011-09-22 Steve Friedl <steve@unixwiz.net>
+
+ * agent/mibgroup/ucd-snmp/disk_hw.c: CHANGES: snmpd: 3409692:
+
+ Calculate disk percentage usage via floating-point arithmetic to
+ avoid integer overflow errors. (Code based on the submitted patch,
+ rather than applied verbatim)
+
+2011-09-22 Bart Van Assche <bvanassche@acm.org>
+
+ * ChangeLog: The only change between V5.7.rc1 and V5.7.1.rc2 is the
+
+ version number. Make this clear in the ChangeLog file.
+
+2011-09-21 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * ChangeLog: changelog update
+
+----------------------------------------------------------------------
+
+Changes: V5.7.rc1 -> V5.7.1.rc2
+
+2011-09-21 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7.1.rc2
+
+
+2011-09-04 Magnus Fromreide <magfr@lysator.liu.se>
+
+ * : commit 4d6defdae72c35b1080076180313d2910568475b Merge: d3a758c
+
+ 3b7fdc4 Author: Magnus Fromreide <magfr@lysator.liu.se> Date: Sun
+ Sep 4 14:46:02 2011 +0200
+
+2011-09-04 Magnus Fromreide <magfr@lysator.liu.se>
+
+ * : commit bbe2c19a01ecec024f741e2e54701ae6212f4c3e Author: Magnus
+
+ Fromreide <magfr@lysator.liu.se> Date: Sun Sep 4 14:44:38 2011
+ +0200
+
+2011-09-04 Magnus Fromreide <magfr@lysator.liu.se>
+
+ * : commit d3a758cf30254b80706a43f191c15238b2cb73c9 Merge: c107ce0
+
+ 227dbd7 Author: Magnus Fromreide <magfr@lysator.liu.se> Date: Sun
+ Sep 4 14:08:35 2011 +0200
+
+2011-09-04 Magnus Fromreide <magfr@lysator.liu.se>
+
+ * : commit 9efa467a972bb6e1c7fbdaf2e27429d29f4ab89e Author: Magnus
+
+ Fromreide <magfr@lysator.liu.se> Date: Sun Sep 4 14:00:12 2011
+ +0200
+
+----------------------------------------------------------------------
+
+Changes: V5.7.pre2 -> V5.7.1.rc1
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend: make
+
+ depend for 5.7.1.rc1
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/read_config.c: fix C++ comment
+
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7.1.rc1
+
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit c107ce078409d265b9b218d49f3815b795db1dc3 Merge: ea4b3b2
+
+ 915aa8d Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Tue Aug 30 19:07:07 2011 -0700
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 422b082a9593ca9c65aac449e6d128a9e97e94fb Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Tue Aug 30
+ 19:06:56 2011 -0700
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit ea4b3b23f350583e5626328b5367e6c617255f95 Merge: bcf38b8
+
+ b34d5dc Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Tue Aug 30 16:38:25 2011 -0700
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 71c0d7650493710631fa08d5dc4dad501a9aa771 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Tue Aug 30
+ 16:37:41 2011 -0700
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit b13f4d8886b6a4e73bc07df2b90d1a6115cf3dfc Merge: f7e21f2
+
+ 64e9778 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Tue Aug 30 11:09:30 2011 -0700
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit b5d2a43f97a59858c944eba2290b59b93c230a6a Merge: 86efee2
+
+ cf4cf7f Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Tue Aug 30 11:09:29 2011 -0700
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-6-patches' into
+
+ V5-6-patches
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: auto-determine patch arguments if
+
+ possible for nspatchtry
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: make it so the git commit line can
+
+ be cut/paste without linebreaks
+
+2011-08-30 Ronald Wahl <rwa-co@users.sourceforge.net>
+
+ * snmplib/read_config.c: CHANGES: libnetsnmp: PATCH 3394586: from
+
+ rwa-co: file descriptor leak in read_config (+fix) Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-30 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: describe that nsrollup needs to be run now.
+
+
+2011-08-30 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : commit 2b92a0a1e3a0618c515ebd902271b95c08931afa Merge: a086347
+
+ 86efee2 Author: Dave Shield <D.T.Shield@liverpool.ac.uk> Date: Tue
+ Aug 30 11:28:14 2011 +0100
+
+2011-08-30 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c: Apparently IRIX has a
+
+ different API for statfs
+
+2011-08-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_tdata.c: don't provide a feature when your a
+
+ child of another feature
+
+2011-08-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-7-patches' into
+
+ V5-7-patches
+
+2011-08-28 Magnus Fromreide <magfr@lysator.liu.se>
+
+ * apps/Makefile.in: Use the feature target instead of the target
+
+ when building the feature set
+
+2011-08-29 Thomas Anders <tanders@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/fsys.h: the irix6 build only defines
+
+ irix6, not irix
+
+2011-08-29 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure, configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in: re-add sockaddr_un.sun_path
+
+ configure check (lost in previous commit)
+
+2011-08-28 Thomas Anders <tanders@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/fsys.h:
+
+ agent/mibgroup/hardware/fsys/fsys_mntent.c doesn't build on IRIX yet
+
+2011-08-28 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit a0863479d80962c652947dfdee11bdd136c0e013 Merge: 5250893
+
+ f95aa31 Author: Thomas Anders <tanders@users.sourceforge.net> Date:
+ Sun Aug 28 23:37:27 2011 +0200
+
+2011-08-28 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure, configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in, snmplib/snmpUDPDomain.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: building: build fix
+
+ for systems lacking fields msg_control/msg_flags in struct msghdr
+ (backport)
+
+2011-08-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interface.m2c: added required features for
+
+ mfd handling
+
+2011-08-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * .gitignore: added .ft and .ft.1 for feature files
+
+
+2011-08-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * perl/agent/agent.xs: no_write_support supported
+
+
+2011-08-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interface.m2c: handle no-write-support with
+
+ ifdefs
+
+2011-08-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 525089327aba7d01d633c634c6b6f06de42acbb8 Merge: 1bb234a
+
+ 04fd71a Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 25 06:57:21 2011 -0700
+
+2011-08-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit ea8bed79e81c42e33cbf37ca6f3c03c549987b22 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Thu Aug 25
+ 06:56:22 2011 -0700
+
+2011-08-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * python/netsnmp/client.py: use >> to print to stderr
+
+
+2011-08-23 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * local/minimalist/feature-remove: CHANGES: build: Do not generate
+
+ an output file on failure make supposes that no output is generated if the command failed.
+ Change feature-remove to follow that presumption.
+
+2011-08-21 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * local/minimalist/feature-remove: Correct typo
+
+
+2011-08-23 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 1bb234a6cc36e6a4efbe3fb29c480210dc2b9c13 Merge: 35a98c3
+
+ 1f082a3 Author: Thomas Anders <tanders@users.sourceforge.net> Date:
+ Tue Aug 23 23:38:07 2011 +0200
+
+2011-08-23 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure, configure.d/config_os_struct_members: make sure that
+
+ _KERNEL is defined to 1 so that "#if _KERNEL" works on systems that
+ need it (e.g. IRIX)
+
+2011-08-23 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 35a98c3d7c5a3c5df356add9e8b808287899b69a Merge: 1f37f57
+
+ a27f744 Author: Thomas Anders <tanders@users.sourceforge.net> Date:
+ Tue Aug 23 23:30:27 2011 +0200
+
+2011-08-23 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 26bb2470c106f834442a2adbc7611bf16657fbdf Author: Thomas
+
+ Anders <tanders@users.sourceforge.net> Date: Tue Aug 23 23:22:44
+ 2011 +0200
+
+2011-08-22 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : autoreconf
+
+
+2011-08-22 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure.d/config_os_struct_members,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: building: build fix
+
+ for systems lacking field msg_flags in struct msghdr (e.g. IRIX)
+
+2011-08-21 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure: autoreconf
+
+
+2011-08-21 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure: autoreconf
+
+
+2011-08-21 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure: autoreconf
+
+
+2011-08-21 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit b62cb0864f577ba85573d0d250d12a39387c07b4 Author: Thomas
+
+ Anders <tanders@users.sourceforge.net> Date: Sun Aug 21 00:55:33
+ 2011 +0200
+
+2011-08-21 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 71b90b6f217944b4ffc1836e5160d40e33b4423d Author: Thomas
+
+ Anders <tanders@users.sourceforge.net> Date: Sun Aug 21 00:40:28
+ 2011 +0200
+
+----------------------------------------------------------------------
+
+Changes: V5.7.pre1 -> V5.7.1.pre2
+
+2011-08-18 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend: make
+
+ depend for 5.7.1.pre2
+
+2011-08-18 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7.1.pre2
+
+
+2011-08-18 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 03053479604bc83efbea579b4562b1831cea1cb6 Merge: f73e636
+
+ d94df39 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 18 11:57:46 2011 -0700
+
+2011-08-18 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 28b54070514753e8d8abb718b224d657ab7a8ab8 Author: Garrett
+
+ Cooper <yaberauneya@users.sourceforge.net> Date: Thu Aug 18
+ 11:49:56 2011 -0700
+
+2011-08-18 Vladimir Kondratiev <wulf2001@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/disk_hw.c: CHANGES: agent: PATCH 3389228:
+
+ from wulf2001: incomplete commit (patch 3386633: fix integer
+ overflow) Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-18 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * man/snmp.conf.5.def: Patch from Claus Klein on -coders for fixing
+
+ man page typos
+
+2011-08-18 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: changed clientaddr so it registers as pre-mib
+
+ to be picked up before the transports get created
+
+2011-08-17 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit c02131e5b35d296755baec99bd363205a86307dd Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Wed Aug 17
+ 09:34:00 2011 -0700
+
+2011-08-17 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/system.c: Fix the log message that reports that
+
+ gethostbyaddr() is missing
+
+2011-08-17 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 182e1dc0c3eacfa4e9ccdb28600ff0f2370211ae Merge: 499b796
+
+ 517b6b0 Author: Bart Van Assche <bvanassche@acm.org> Date: Wed Aug
+ 17 18:09:30 2011 +0200
+
+2011-08-17 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 6580556cc7bd833af731b62ce1ed2017564fe7eb Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Wed Aug 17 18:08:01 2011 +0200
+
+2011-08-14 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 499b796cbd78065c3354779136bd3d9d1f548a58 Merge: 0418ff0
+
+ a9cb267 Author: Bart Van Assche <bvanassche@acm.org> Date: Sun Aug
+ 14 08:02:38 2011 +0200
+
+2011-08-14 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 3cb3f1ede388d84e392e1d815d5994a4bf0f10f9 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Sun Aug 14 07:59:25 2011 +0200
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * perl/OID/OID.xs, perl/SNMP/SNMP.xs, perl/agent/agent.xs: Windows:
+
+ Make the Perl agent module work again with the original SNMP_FREE()
+ definition.
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0418ff0cda21411a47fa8978c3e0d043a19d24b6 Merge: 26b0aa3
+
+ 3c73b48 Author: Bart Van Assche <bvanassche@acm.org> Date: Sat Aug
+ 13 18:42:05 2011 +0200
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * include/net-snmp/library/tools.h: Revert the two most recent
+
+ SNMP_FREE() changes (commits
+ 47c8ef1b89c6ccb4247d9633477925908c68c1a5 and
+ 7f42d0d93320484152271427cc9808cbda49bbd0).
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 26b0aa3010fa182b6039a8c2cad8ccb4571652de Merge: 2f3d607
+
+ 0c8e1a9 Author: Bart Van Assche <bvanassche@acm.org> Date: Sat Aug
+ 13 11:43:20 2011 +0200
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 3e50c3e00e9f321fb708bc579eb4dc1a0f1e7c4d Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Sat Aug 13 11:31:40 2011 +0200
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 2f3d6079dc36aad9559d91c5c324e2ce535573dd Merge: e32aa97
+
+ ff1734d Author: Bart Van Assche <bvanassche@acm.org> Date: Sat Aug
+ 13 09:08:06 2011 +0200
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit e147e4b96755207de1ce30990d67b4b7c76dd483 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Sat Aug 13 08:39:14 2011 +0200
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * win32/build.pl: CHANGES: Windows: building (build.bat): Install
+
+ netsnmp.dll before running the Perl regression tests such that the
+ regression tests are run with the correct version of netsnmp.dll.
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * win32/Makefile.in: CHANGES: Windows: perl (build.bat): When
+
+ installing development files, install the PDB files too.
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * perl/SNMP/t/async.t, perl/SNMP/t/conf.t, perl/SNMP/t/mib.t,
+ perl/agent/test.pl: CHANGES: testing: Fix Perl regression test
+
+ failures All Perl regression tests pass now on Linux and on Windows (MSVC).
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * perl/SNMP/t/async.t, perl/SNMP/t/bulkwalk.t: CHANGES: testing:
+
+ Perl regression tests: Don't fail skipped tests.
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs: CHANGES: perl: Add
+
+ SNMP::getenv() and SNMP::setenv().
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c: CHANGES:
+
+ snmplib: Add netsnmp_setenv().
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * local/pass_persisttest: local/pass_persisttest: document how to
+
+ use on Windows
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * local/pass_persisttest: Set execute flag on local/pass_persisttest
+
+ such that the instructions in that file work
+
+2011-08-13 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Fix a suppression pattern
+
+
+2011-08-12 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit e32aa97742232ced3a72f8b845ace5ce3d53b8df Merge: 4adfec8
+
+ 86fbd33 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Fri Aug 12 09:11:14 2011 -0700
+
+2011-08-12 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit a73eb40ec263a0fdf53a74e720ddf41c4a7ee3d4 Merge: 7690894
+
+ 2940ee3 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Fri Aug 12 09:11:13 2011 -0700
+
+2011-08-12 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 1f0a928a2913cfa7f5ceaaf4696c69fbdc687621 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Fri Aug 12
+ 09:09:11 2011 -0700
+
+2011-08-11 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 4adfec81216f6c5bf25c9ac6b2b7478d1be8e842 Merge: 281b869
+
+ 2940ee3 Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 11 18:57:29 2011 +0200
+
+2011-08-11 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 1e1000a8815921b5ec2e7997b53592a544b3dfc2 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Thu Aug 11 15:46:32 2011 +0200
+
+2011-08-11 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 281b86961b10266ddf3883942d4dc3b6b98d3227 Merge: d8d225c
+
+ f181099 Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 11 18:46:06 2011 +0200
+
+2011-08-11 Bart Van Assche <bvanassche@acm.org>
+
+ * : Merge V5-4-patches.
+
+
+2011-08-10 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swrun.c: don't assert on a double
+
+ init; just don't do it twice
+
+2011-08-10 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit d8d225ca34a8f22752153acb7944f9435f564d2c Merge: 06b4186
+
+ 47c8ef1 Author: Bart Van Assche <bvanassche@acm.org> Date: Wed Aug
+ 10 18:05:21 2011 +0200
+
+2011-08-10 Bart Van Assche <bvanassche@acm.org>
+
+ * include/net-snmp/library/tools.h: SNMP_FREE(): cast argument to
+
+ (void *) before passing it to netsnmp_free()
+
+2011-08-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 06b41865ec302c3931b1083d3fde89f9345ec06f Merge: 11426fb
+
+ a4f6ac7 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Tue Aug 9 06:44:41 2011 -0700
+
+2011-08-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 11426fb3c6f327820b9bb86a76ecc9e2c37e7934 Merge: 0344df9
+
+ 9bf0681 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Tue Aug 9 06:44:11 2011 -0700
+
+2011-08-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-4-patches' into
+
+ V5-4-patches
+
+2011-08-09 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 9bf0681218edf43cdb5fc68f172123bc4a2d0188 Merge: f9db611
+
+ ccb0eb6 Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Aug
+ 9 08:19:33 2011 +0200
+
+2011-08-09 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit de7e348ece03d2380c2a8806ebbad5d9b5487682 Merge: d538bcb
+
+ ccb0eb6 Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Aug
+ 9 08:07:22 2011 +0200
+
+2011-08-09 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0220392d899a9cab701f74af12030bb1d4cc5e2e Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Jul 1 13:02:15 2011 +0200
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * CHANGES, NEWS: version update for 5.7.1.pre1
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * ChangeLog: version update for 5.7.1.pre1
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/snmpd.c: fix C++ comments
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/snmpd.c: fix C++ comments
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/snmpd.c: fix C++ comments
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/snmpd.c: fix C++ comments
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, perl/ASN/ASN.pm, perl/AnyData_SNMP/Storage.pm,
+ perl/OID/OID.pm, perl/SNMP/SNMP.pm,
+ perl/TrapReceiver/TrapReceiver.pm, perl/agent/Support/Support.pm,
+ perl/agent/agent.pm, perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm: Version number update:
+
+ 5.7.1.pre1
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.top: version update for 5.7.1.pre1
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit cf4cce4c189cf47f4c489db43b7fa510f8906a1a Merge: df91a9f
+
+ 93e97dc Author: Dave Shield <D.T.Shield@liverpool.ac.uk> Date: Mon
+ Aug 8 22:15:28 2011 +0100
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : Merge remote-tracking branch 'origin/V5-6-patches' into
+
+ V5-6-patches
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : Merge remote-tracking branch 'origin/V5-4-patches' into
+
+ V5-4-patches
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * win32/Makefile-apps.in, win32/dist/README.build.win32.txt,
+ win32/libagent/Makefile.in, win32/libnetsnmptrapd/Makefile.in,
+ win32/libsnmp/Makefile.in, win32/libsnmp_dll/Makefile.in,
+ win32/netsnmpmibs/Makefile.in, win32/snmpd/Makefile.in,
+ win32/snmpnetstat/Makefile.in, win32/snmptrapd/Makefile.in: Define
+
+ _BIND_TO_CURRENT_VCLIBS_VERSION token (as per Alex' build
+ instructions)
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * win32/Makefile-apps.in, win32/libagent/Makefile.in,
+ win32/libhelpers/Makefile.in, win32/libnetsnmptrapd/Makefile.in,
+ win32/libsnmp/Makefile.in, win32/libsnmp_dll/Makefile.in,
+ win32/netsnmpmibs/Makefile.in, win32/snmpd/Makefile.in,
+ win32/snmpnetstat/Makefile.in, win32/snmptrapd/Makefile.in: Define
+
+ _BIND_TO_CURRENT_VCLIBS_VERSION token (as per Alex' build
+ instructions)
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-4-patches' into
+
+ V5-4-patches
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit df16dc2221e993dd3c66650d5e872577ffe6c01b Merge: 714bc82
+
+ 8e5a28d Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 13:56:43 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit ffa05b051ac3e2b197195a9989cc7a91fe8d9282 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Mon Aug 8 13:55:38
+ 2011 -0700
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : commit 714bc82fa01e21a3655824963fa54e9b8042ffb0 Merge: 6fe8fe5
+
+ 3ef1db5 Author: Dave Shield <D.T.Shield@liverpool.ac.uk> Date: Mon
+ Aug 8 21:21:46 2011 +0100
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : commit b451607dca015c111e96fdfeb2ddb0661fb4f724 Author: Dave
+
+ Shield <D.T.Shield@liverpool.ac.uk> Date: Mon Aug 8 21:20:32 2011
+ +0100
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 6fe8fe5294a45bc7e4ea3751a1ad7aa47b5cabb2 Merge: 364f8ff
+
+ f69abe3 Author: Bart Van Assche <bvanassche@acm.org> Date: Mon Aug
+ 8 22:02:38 2011 +0200
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit c94813044a4c4a608e98e80223075c6faf04ee11 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Mon Aug 8 21:56:15 2011 +0200
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 364f8ffaeb90b4eb0165fc855688cd0626632794 Merge: 3287295
+
+ 7abb926 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 11:24:26 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-6-patches' into
+
+ V5-6-patches
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: display the branch we'll commit to
+
+
+2011-08-08 Vladimir Kondratiev <wulf2001@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/disk_hw.c: CHANGES: snmpd: PATCH 3386633:
+
+ from wulf2001: fix integer overflow in disk percent calculations Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 84a775d0557fea97570e41715a3164970b4c03a2 Merge: 6fff1c1
+
+ d373c4f Author: Bart Van Assche <bvanassche@acm.org> Date: Mon Aug
+ 8 20:12:32 2011 +0200
+
+2011-08-08 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/agent_trap.c: CHANGES: libnetsnmp: PATCH 3387139: from
+
+ yaberauneya: Avoid segfault if trapsess transport element cant be
+ parsed Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: nssfpatchapply: split the
+
+ displayed git commit command into multiple segments
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/helpers/scalar_group.c: CHANGES: snmplib: PATCH: 3386961:
+
+ Make SNMP GET work in an AgentX subagent if write support is
+ disabled via NETSNMP_NO_WRITE_SUPPORT (Mark Rusk).
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/mib.c: CHANGES: snmplib: Fix a crash that could be
+
+ triggered by calling _mibindex_add() with the second argument not
+ equal to -1.
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 6fff1c1ae51b06c9d80faf15373a963d173f14e8 Merge: 837c52e
+
+ 8cc9004 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 10:58:59 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 8ca7ff1e692caec4186b788c9ae2d27be213290f Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Mon Aug 8 10:33:56
+ 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-4-patches' into
+
+ V5-4-patches
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit b8f529cba27c0114b4cb7340cfd449504fa07506 Merge: 0822f2d
+
+ 556e938 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 10:05:36 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: fix function name typo
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 29882a078a959a0f78b03e01968f1d17b7f6a299 Merge: 5e9bd2f
+
+ 0409c0a Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 10:03:34 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : manual merge of pull/push
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: make nspull/nspush check for a
+
+ clean repo
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: new function "nsmakeall" to test
+
+ building on every branch
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: default to merge
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-7-patches' into
+
+ V5-7-patches
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * include/net-snmp/library/tools.h: CHANGES: Windows: Avoid that if
+
+ the Net-SNMP Perl modules have been built with another version of
+ Microsoft Visual Studio than ActivePerl that using one of these Perl
+ modules triggers a "Free to wrong pool" crash. This regression was
+ caused by commit 3b14c59cf8278d410207ff42debda2636426a468 (the
+ netsnmp_free() into SNMP_FREE() changes in the *.xs files).
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit e109539930703cb3052d5241b18ac6fc062faaca Merge: 0c9b6cb
+
+ e46b170 Author: Bart Van Assche <bvanassche@acm.org> Date: Mon Aug
+ 8 18:34:11 2011 +0200
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/mib.c: CHANGES: snmplib: Fix a crash that could be
+
+ triggered by calling _mibindex_add() with the second argument not
+ equal to -1.
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 7f42d0d93320484152271427cc9808cbda49bbd0 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Mon Aug 8 09:50:51 2011 +0200
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0c9b6cbe9dbe2ec5217a95b6781fd7dc1f6ebda7 Merge: fa6cef5
+
+ 963320f Author: Bart Van Assche <bvanassche@acm.org> Date: Mon Aug
+ 8 18:14:36 2011 +0200
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit a3b8654a232c563bc97cc9925cd98590a30c5bc5 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Mon Aug 8 17:24:18 2011 +0200
+
+2011-08-07 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit fa6cef5ca91df3a0b03455b68559d2bee248101c Merge: f5fe536
+
+ 8add0da Author: Bart Van Assche <bvanassche@acm.org> Date: Sun Aug
+ 7 10:18:54 2011 +0200
+
+2011-08-07 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit a0dd3caf25926e43465718bf417a464c2fb36366 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Sun Aug 7 10:17:01 2011 +0200
+
+2011-08-05 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: 32 is too limited for
+
+ bigger tables; increase the max msg count to 128
+
+2011-08-05 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: make rollup and sync support
+
+ --rebase and change the default back to merge
+
+2011-08-05 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-4-patches' into
+
+ V5-4-patches
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * README.win32: CHANGES: Win32: Documented how to use build.bat with
+
+ OpenSSL enabled
+
+2011-07-15 Bart Van Assche <bvanassche@acm.org>
+
+ * README.win32: CHANGES: Windows: Remove outdated instructions about
+
+ editing win32\libsnmp_dll\libsnmp.def from README.win32
+
+2011-07-15 Bart Van Assche <bvanassche@acm.org>
+
+ * README.win32: CHANGES: Win32: Document how to build 64-bit
+
+ executables for the x64/amd64 architecture
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit f5fe536e8fd6c48fe243decd31fac9cf1c92f4cc Merge: 7850ea1
+
+ 80928a8 Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Aug
+ 5 15:13:27 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 80928a8909cfab37f01b39a071a3e8ad85956222 Merge: f16a094
+
+ 0dbc869 Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Aug
+ 5 13:57:30 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0dbc869fec07d8e90dbd1c95493ee7cbc623c95c Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Aug 5 12:40:31 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Add
+
+ perl/agent/default_store/default_store.def and perl/SNMP/t
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 86c1e2b9679fec2cd799ba76005c3d60e9d47634 Merge: bcd8635
+
+ f16a094 Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Aug
+ 5 12:20:50 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 2f8d4f5796cbc1c7e967acdaa8019b24f1520a36 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Aug 5 12:02:51 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/parse.c: Unbreak the V5-4-patches - revert commit
+
+ d2c4768bd2efb48664434a831425c2dda85d7133 (CHANGES: libnetsnmp: PATCH
+ 3362233: from yaberauneya: Mute unnecessary cannot find module
+ noise).
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/mibII/snmp_mib.c, agent/mibgroup/mibII/snmp_mib.h:
+
+ Unbreak the V5-4-patches branch - was broken by commit
+ bf7178b0b22587d43d1a80c269cd216bd5930214 (agent: change type of
+ snmp_enableauthentraps to long)
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * include/net-snmp/library/snmpusm.h: Unbreak the V5-4-patches
+
+ branch - was broken by commit
+ 0e6842fe080cec853b08cd2323015ababc381ce1 (CHANGES: snmptrapd: PATCH
+ 3383441: from sachinsurendran: Fix crash on 5.4.4 due to access of
+ freed memory).
+
+2011-08-05 Thomas Anders <tanders@users.sourceforge.net>
+
+ * NEWS: minor NEWS polish
+
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit bcd86350713822963d376eff582a92f43e426d6c Merge: 9c810a3
+
+ 7a20f71 Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Aug
+ 5 10:28:55 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 3aa949fbdfc1a94a8340ad8baf8b314756a0bb9d Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Aug 5 10:26:15 2011 +0200
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 9c810a3b37b68573c40337e246e2faf299b77d31 Merge: 71cb2e8
+
+ 610d63f Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 10:42:08 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 943930e1e124385fd94738b6dcda37d29dc7ac7f Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Thu Aug 4 10:41:41
+ 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-4-patches' into
+
+ V5-4-patches
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 4edcb88dae8b2e59dc683e80d414fa7ecec36885 Merge: 65f3eef
+
+ 2dd9ed0 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 10:24:11 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-5-patches' into
+
+ V5-5-patches
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit bc5ca03a04ab19c634a34d060b0b16b7484cb520 Merge: 88fddb7
+
+ 90c0e75 Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 4 19:13:07 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/snmp_client.c, snmplib/snmpusm.c: snmpusm: Fix recently
+
+ introduced compiler warnings
+
+2011-08-04 Stuart Henderson <t0jw2fu0kmg@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/memory/memory_netbsd.c: CHANGES: openbsd:
+
+ PATCH 3357932: from t0jw2fu0kmg: Cleaning in memory_netbsd.c Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Vladimir Kondratiev <wulf2001@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/fsys/fsys_getfsstats.c: CHANGES: agent:
+
+ PATCH 3386147: from wulf2001: fix UCD-SNMP-MIB::dskUsed Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 473d7e5cd4d411bba20eb85359d8728063301cbd Merge: a4e8b62
+
+ 88fddb7 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 09:28:22 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 2101bb2d7ad6db038c755aa9193c8ace0dbd4f58 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Thu Aug 4 09:28:06
+ 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * .gitignore: ignore *.orig and *.rej
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: help output describes rebase vs
+
+ merge better
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit f126a17c6a3063455a511940b023047abd9b48ee Merge: ad765f4
+
+ 77a4784 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 09:25:16 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 452e1707f209ec45e7c7f2a3040ef595fb9d1af6 Merge: dc755a6
+
+ b372e5a Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 09:25:03 2011 -0700
+
+2011-08-04 Stuart Henderson <t0jw2fu0kmg@users.sourceforge.net>
+
+ * Makefile.in, acconfig.h, agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/memory.h,
+ agent/mibgroup/if-mib/data_access/interface.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/openbsd.h,
+ include/net-snmp/system/openbsd4.h,
+ include/net-snmp/system/openbsd5.h: CHANGES: openbsd: PATCH
+ 3357927:
+
+ from t0jw2fu0kmg: Recognise openbsd5 Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: fix where arguments are set
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: split nssfpatchapply into two
+
+ parts: apply and commiting
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: patch using -N
+
+
+2011-08-04 David Arnold <dja@users.sourceforge.net>
+
+ * man/default_store.3.bot, man/encode_keychange.1.def,
+ man/fixproc.1.def, man/mib2c.conf.5.in, man/net-snmp-config.1.def,
+ man/netsnmp_agent_api.3.def, man/netsnmp_mib_api.3.def,
+ man/snmp.conf.5.def, man/snmpbulkget.1.def,
+ man/snmpbulkwalk.1.def, man/snmpcmd.1.def, man/snmpconf.1.def,
+ man/snmpd.8.def, man/snmpd.conf.5.def, man/snmpd.examples.5.def,
+ man/snmpdelta.1.def, man/snmpdf.1.def, man/snmpget.1.def,
+ man/snmpgetnext.1.def, man/snmpnetstat.1.def, man/snmpset.1.def,
+ man/snmpstatus.1.def, man/snmptable.1.def, man/snmptest.1.def,
+ man/snmptranslate.1.def, man/snmptrap.1.def, man/snmptrapd.8.def,
+ man/snmptrapd.conf.5.def, man/snmpusm.1.def, man/snmpvacm.1.def,
+ man/snmpwalk.1.def: CHANGES: man: PATCH 3312861: from dja: Man
+ pages
+
+ hyphen-vs-minus cleanup Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Detect (and reject) OpenSSL
+
+ 1.0.0
+
+2011-08-04 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Command-line options for silent
+
+ install
+
+2011-08-04 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Ensure Windows package
+
+ uninstalls completely.
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 81c63fb5c5e4abb9c29aca89bf9d694410086e97 Merge: 4a6920a
+
+ dc755a6 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 08:33:34 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_client.c: added spacing to match the later branches
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : manual merge
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_client.c: removed accidentially duplicated code
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : manual merge
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : manual merge
+
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * snmplib/parse.c: CHANGES: libnetsnmp: PATCH 3362233: from
+
+ yaberauneya: Mute unnecessary cannot find module noise Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/agent_read_config.c, agent/snmp_vars.c,
+ configure.d/config_os_headers: CHANGES: freebsd: PATCH 3363308:
+ from
+
+ yaberauneya: Fix compilation on FreeBSD 9.x with recent header
+ shuffling Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: allow nsrollup to take a --merge
+
+ flag for merging instead of rebasing
+
+2011-08-04 Sachin Surendran <sachinsurendran@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpusm.h, snmplib/snmp_client.c,
+ snmplib/snmpusm.c: CHANGES: snmptrapd: PATCH 3383441: from
+
+ sachinsurendran: Fix crash on 5.4.4 due to access of freed memory Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * Makefile.in: CHANGES: freebsd: PATCH 3363328: from yaberauneya:
+
+ Add FreeBSD 9.x to supported OSes list Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * snmplib/parse.c: CHANGES: libnetsnmp: PATCH 3362233: from
+
+ yaberauneya: Mute unnecessary cannot find module noise Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/agent_read_config.c, agent/snmp_vars.c,
+ configure.d/config_os_headers: CHANGES: freebsd: PATCH 3363308:
+ from
+
+ yaberauneya: Fix compilation on FreeBSD 9.x with recent header
+ shuffling Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: allow nsrollup to take a --merge
+
+ flag for merging instead of rebasing
+
+2011-08-04 Sachin Surendran <sachinsurendran@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpusm.h, snmplib/snmp_client.c,
+ snmplib/snmpusm.c: CHANGES: snmptrapd: PATCH 3383441: from
+
+ sachinsurendran: Fix crash on 5.4.4 due to access of freed memory Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * Makefile.in: CHANGES: freebsd: PATCH 3363328: from yaberauneya:
+
+ Add FreeBSD 9.x to supported OSes list Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * snmplib/parse.c: CHANGES: libnetsnmp: PATCH 3362233: from
+
+ yaberauneya: Mute unnecessary cannot find module noise Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/agent_read_config.c, agent/snmp_vars.c,
+ configure.d/config_os_headers: CHANGES: freebsd: PATCH 3363308:
+ from
+
+ yaberauneya: Fix compilation on FreeBSD 9.x with recent header
+ shuffling Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: allow nsrollup to take a --merge
+
+ flag for merging instead of rebasing
+
+2011-08-04 Sachin Surendran <sachinsurendran@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpusm.h, snmplib/snmp_client.c,
+ snmplib/snmpusm.c: CHANGES: snmptrapd: PATCH 3383441: from
+
+ sachinsurendran: Fix crash on 5.4.4 due to access of freed memory Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * snmplib/parse.c: CHANGES: libnetsnmp: PATCH 3362233: from
+
+ yaberauneya: Mute unnecessary cannot find module noise Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: allow nsrollup to take a --merge
+
+ flag for merging instead of rebasing
+
+2011-08-04 Sachin Surendran <sachinsurendran@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpusm.h, snmplib/snmp_client.c,
+ snmplib/snmpusm.c: CHANGES: snmptrapd: PATCH 3383441: from
+
+ sachinsurendran: Fix crash on 5.4.4 due to access of freed memory Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/memory/memory_freebsd.c,
+ agent/mibgroup/mibII/ipAddr.c, snmplib/keytools.c,
+ snmplib/scapi.c:
+
+ CHANGES: building: PATCH 3383951: from yaberauneya: Fix -Wunused
+ compile warnings with FreeBSD/NetBSD Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/memory/memory_freebsd.c,
+ agent/mibgroup/mibII/ipAddr.c, snmplib/keytools.c,
+ snmplib/scapi.c:
+
+ CHANGES: building: PATCH 3383951: from yaberauneya: Fix -Wunused
+ compile warnings with FreeBSD/NetBSD Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit e878abbdb1808ef83e0a8074536fb54e13219a8b Merge: 403de42
+
+ 878fbf4 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 07:55:00 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 250afa06892fd897ac31e3836a7ffc9e2b4cf7b9 Merge: 2c14c1c
+
+ 3afc5e0 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 07:51:33 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 578cd7cce351ae8d904ec3d80be9ba6d1d48a712 Merge: 25988be
+
+ f3bc551 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 07:50:56 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : autoconf
+
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * configure.d/config_os_struct_members: CHANGES: building: PATCH
+
+ 3383949: from yaberauneya: Fix autoconf tests for sys/mbuf.h Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: prompt for patch and an area, and
+
+ use the proper CHANGES line format
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: Use fetch --all and rebase as
+
+ suggested by Bart for speed improvements
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit d6a1a89e6f648951a9b831932d3cc230821f2d37 Merge: dcb712f
+
+ 872e013 Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 4 12:06:18 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 44969b4e57c27194e5bd357bc45275feb8695d22 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Jul 8 20:52:25 2011 +0200
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/winExtDLL.c: CHANGES: Win32: winExtDLL: Invoke
+
+ SnmpUtilOidFree() before SnmpUtilOidCpy(). It's not clear yet why
+ the original code did not make snmpwalk trigger a memory leak.
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit dcb712ffc86b33583000ef4ae9a51ced25cd15bf Merge: e85cfa5
+
+ 98623ef Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 4 11:36:17 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 8a01ec6423d400c4a13ccac68a3791d0218a0885 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Thu Aug 4 11:19:17 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit e85cfa599b23b76d97913c96b5d703bff6ba4944 Merge: b056ee6
+
+ e21eef2 Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 4 08:44:43 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/host/data_access/swinst_pkginfo.c: CHANGES: agent:
+
+ Avoid that a MIB walk on the host resources MIB triggers a crash on
+ Fedora 15
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit b056ee6eb53909ad04f16ec26d2690d7a083192a Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Thu Aug 4 07:59:04 2011 +0200
+
+2011-08-03 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/agent_trap.c, agent/helpers/table_array.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_acc
+ ess.c, agent/mibgroup/host/data_access/swinst_pkginfo.c,
+ agent/mibgroup/host/data_access/swrun_procfs_status.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access
+ .c, agent/mibgroup/smux/smux.c, agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c, agent/snmp_agent.c,
+ apps/snmpbulkget.c, apps/snmptls.c, apps/snmptrapd_log.c,
+ perl/SNMP/SNMP.xs, snmplib/container_iterator.c,
+ snmplib/dir_utils.c, snmplib/snmp_api.c, snmplib/snmp_client.c,
+ snmplib/snmp_enum.c, snmplib/snmp_openssl.c, snmplib/snmpusm.c,
+ snmplib/transports/snmpTLSTCPDomain.c: CHANGES: snmplib, snmpd:
+
+ perl: Eliminate dead variables
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit ae8e3ecd2df4cf37625944aded1dfe4735d44eea Merge: 73187ce
+
+ 9335e19 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Wed Aug 3 14:37:36 2011 -0700
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 794f9a69d7eb642268200b0a4b199151def66ed0 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Wed Aug 3 14:36:25
+ 2011 -0700
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a comment
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: at end of nsrollup mention that
+
+ now would be a good time to run nssync
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: a new nssync() function for
+
+ push/pulling active branches
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a comment
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: at end of nsrollup mention that
+
+ now would be a good time to run nssync
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: a new nssync() function for
+
+ push/pulling active branches
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: at end of nsrollup mention that
+
+ now would be a good time to run nssync
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: a new nssync() function for
+
+ push/pulling active branches
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a comment
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: at end of nsrollup mention that
+
+ now would be a good time to run nssync
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: a new nssync() function for
+
+ push/pulling active branches
+
+2011-08-03 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib.h: Reenable IP-MIB::ipDefaultRouterTable
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: A new function: nssfpatchapply
+
+ that auto-pulls git command line info from SF
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i: added variables names to
+
+ the generated error messages.
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c: Wording changes to
+
+ help describe contexts better
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/Makefile.in, local/mib2c-conf.d/generic-get-U64.m2i: Added
+
+ the missing U64 m2i file
+
+2011-08-03 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib.h: Reenable IP-MIB::ipDefaultRouterTable
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: A new function: nssfpatchapply
+
+ that auto-pulls git command line info from SF
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i: added variables names to
+
+ the generated error messages.
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c: Wording changes to
+
+ help describe contexts better
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/Makefile.in, local/mib2c-conf.d/generic-get-U64.m2i: Added
+
+ the missing U64 m2i file
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: A new function: nssfpatchapply
+
+ that auto-pulls git command line info from SF
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i: added variables names to
+
+ the generated error messages.
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c: Wording changes to
+
+ help describe contexts better
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/Makefile.in, local/mib2c-conf.d/generic-get-U64.m2i: Added
+
+ the missing U64 m2i file
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: A new function: nssfpatchapply
+
+ that auto-pulls git command line info from SF
+
+2011-07-18 Ilya Yanok <yanok@emcraft.com>
+
+ * agent/agent_trap.c, agent/mibgroup/mibII/snmp_mib.c: agent: change
+
+ type of snmp_enableauthentraps to long Type of snmp_enableauthentraps variable is changed from int to long.
+ This fixes the bug with writing to snmpEnableAuthenTraps if server
+ is compiled for 64bit (snmpset reports wrong length). This bug was
+ introduced a long time ago (by faeecd0 commit). Actually this is a 'less effort' type of fix but I wonder why we
+ need a long to store an INTEGER in the first place? Signed-off-by: Ilya Yanok <yanok@emcraft.com> Signed-off-by: Wes
+ Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i: added variables names to
+
+ the generated error messages.
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c: Wording changes to
+
+ help describe contexts better
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/Makefile.in, local/mib2c-conf.d/generic-get-U64.m2i: Added
+
+ the missing U64 m2i file
+
+2011-08-03 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 6ad7e28ff9e5e4ebc1358ee39cc9796a44a1bee7 Merge: f2832e3
+
+ 1e154ce Author: Bart Van Assche <bvanassche@acm.org> Date: Wed Aug
+ 3 19:15:24 2011 +0200
+
+2011-08-03 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 61b178f1ee8952aa03aa3b1ba51f4a6655e47f01 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Wed Aug 3 18:09:47 2011 +0200
+
+2011-08-03 Bart Van Assche <bvanassche@acm.org>
+
+ * include/net-snmp/types.h: Whitespace-only change: fix indentation
+
+ of an #include directive
+
+2011-08-02 Bart Van Assche <bvanassche@acm.org>
+
+ * perl/NetSNMP.xs: CHANGES: Perl: Remove file perl/NetSNMP.xs
+
+ because it breaks the Windows build. To Wes: if you can tell me how to reproduce the problem you observed
+ I'll try to find a portable fix. This reverts commit d54871f5293675c8058ecce88fed5b646c836323 ("Added
+ a bogus empty .xs file for bundling on newer perl that wants
+ "something"").
+
+2011-08-02 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0f489b199adab48b1633ebcaf5ff5a7c22c4cb89 Merge: f4eaa02
+
+ 72a59bc Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Aug
+ 2 10:11:53 2011 +0200
+
+2011-08-02 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 7fcc0b8032f8da5b7bc30059af0ba656eae71091 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Mon Aug 1 14:11:28 2011 +0200
+
+2011-08-02 Bart Van Assche <bvanassche@acm.org>
+
+ * *
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_dat
+ a_access.c: Fix a compiler warning in
+
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c
+
+2011-08-01 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Add file names and patterns for output
+
+ files generated during the Windows build
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Sort alphabetically
+
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Add apps/sshtosnmp
+
+
+2011-08-01 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore, perl/TrapReceiver/const-c.inc,
+ perl/TrapReceiver/const-xs.inc: Remove two generated Perl files.
+
+
+2011-08-02 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit f4eaa02d9b076a67d7272de7eef8e9dfbf189bbf Merge: 40125d8
+
+ adadcb9 Author: Thomas Anders <tanders@users.sourceforge.net> Date:
+ Tue Aug 2 00:57:51 2011 +0200
+
+2011-08-02 Thomas Anders <tanders@users.sourceforge.net>
+
+ * dist/nsb-functions: suppress "ok" test output in nsb
+
+
+2011-08-01 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit 40125d8539cd89f952fbc24588c5e81e9cd821fe Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Mon Aug 1
+ 13:58:33 2011 +0200
+
+2011-08-01 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 5acf0d2ceb3977964ed39f003073ba64138c2ebd Author: Thomas
+
+ Anders <tanders@users.sourceforge.net> Date: Sun Jul 31 23:57:41
+ 2011 +0200
+
+2011-07-31 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit a7722a81f9cb7aa8670e7c238601362a31087acc Merge: 242e179
+
+ ae9ac6c Author: Bart Van Assche <bvanassche@acm.org> Date: Sun Jul
+ 31 09:11:45 2011 +0200
+
+2011-07-31 Bart Van Assche <bvanassche@acm.org>
+
+ * apps/sshtosnmp.c: Fix an incorrect source code comment: there is
+
+ no requirement in the ANSI C standard that stack variables should be
+ initialized to zero.
+
+2011-07-31 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 242e1797b2694a0689856ae36d05d3413aaf8d77 Author: Thomas
+
+ Anders <tanders@users.sourceforge.net> Date: Sun Jul 31 01:44:09
+ 2011 +0200
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * snmplib/system.c: CHANGES: building: build fix for systems lacking
+
+ getaddrinfo() and EAI_FAIL (e.g. HP-UX 10.20/11.00)
+
+2011-07-30 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 18df759f19b975c449d010bb0a162119bb68360d Merge: 54a44cb
+
+ 7050718 Author: Bart Van Assche <bvanassche@acm.org> Date: Sat Jul
+ 30 16:39:13 2011 +0200
+
+2011-07-30 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 82d73fb11be3ae31f39c9d618d5388dc9b1006d7 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Jul 29 20:51:27 2011 +0200
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure, include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: autoreconf
+
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure, include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: autoreconf
+
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 109f6694d788f48ebd9fc0a1e90c45abc37bea20 Author: Thomas
+
+ Anders <tanders@users.sourceforge.net> Date: Sat Jul 30 14:22:19
+ 2011 +0200
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 7d8100eed459a1ff1a20c067364fa6cb47491309 Merge: 116c24f
+
+ 9e47ac4 Author: Thomas Anders <tanders@users.sourceforge.net> Date:
+ Sat Jul 30 00:20:01 2011 +0200
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * dist/nsb-functions, dist/nsb-nightly, dist/nsb-package: minor nsb
+
+ fixes/enhancements from my old svn tree
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 116c24f0f7fb3f99ba646730f61c56d1ae23ba41 Merge: 982fb7f
+
+ 4fc0b8b Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Jul
+ 29 11:31:20 2011 +0200
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit c48173c06a9eaadbf81e6b4962d55ef0a54db251 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Jul 29 10:27:39 2011 +0200
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * configure, ltmain.sh, m4/libtool.m4: Rerun autoreconf
+
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Sort alphabetically
+
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Add apps/sshtosnmp
+
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/host/hr_storage.h,
+ agent/mibgroup/host/hrh_storage.c: Fix two filenames in host mib
+
+ source code comments.
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit 982fb7fd8bab25c4322aa62c50437036ce296e3e Merge: 1eda675
+
+ 3458128 Author: Jan Safranek <jsafranek@users.sourceforge.net> Date:
+ Thu Jul 28 16:24:03 2011 +0200
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: Fix potential
+
+ sigsegv when an ifTable entry is removed as result of both
+ interface_replace_old and interface_fadeout at the same time.
+
+2011-07-28 Bart Van Assche <bvanassche@acm.org>
+
+ * apps/sshtosnmp.c: Make apps/sshtosnmp.c build again (was broken by
+
+ commit 612247cdf14c1e745c384cefe1f3fde3e445b347 that changed
+ MSG_NOSIGNAL into NETSNMP_NOSIGNAL)
+
+2011-07-28 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 1eda6753b7fe7d3b3f217c09254ec02d0ee1d0ce Merge: db8b860
+
+ a2f9ece Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Jul
+ 28 15:32:28 2011 +0200
+
+2011-07-28 Niels Baggesen <nba@users.sourceforge.net>
+
+ * configure.d/config_os_functions, configure.d/config_os_libs1:
+
+ CHANGES: snmpd: Restore storage tables on Linux
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * man/snmpd.conf.5.def: Document interface_replace_old option.
+
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: CHANGES:
+
+ snmpd: added 'interface_replace_old' option to remove old entries in
+ ifTable when an interface with the same name as already exising one
+ appears. E.g. remove old ppp0 interface when new ppp0 shows up.
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * man/snmpd.conf.5.def: Document the interface_fadeout option.
+
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: Allow ifTable
+
+ entries to be deleted immediately when appropriate interface
+ disappears (i.e. interface_fadeout = 0 works as expected).
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: CHANGES:
+
+ snmpd: added 'interface_fadeout' configuration option to set
+ lifetime of ifTable entries of removed interfaces. Previous lifetime was hardcoded 5 minutes, now it's configurable.
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit d62a0eb9070b4d8d9fe2bcfdb4d53d37ef814f9b Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Thu Jul 28
+ 14:49:08 2011 +0200
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: CHANGES:
+
+ snmpd: added 'interface_replace_old' option to remove old entries in
+ ifTable when an interface with the same name as already exising one
+ appears. E.g. remove old ppp0 interface when new ppp0 shows up.
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * man/snmpd.conf.5.def: Document the interface_fadeout option.
+
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: Allow ifTable
+
+ entries to be deleted immediately when appropriate interface
+ disappears (i.e. interface_fadeout = 0 works as expected).
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: CHANGES:
+
+ snmpd: added 'interface_fadeout' configuration option to set
+ lifetime of ifTable entries of removed interfaces. Previous lifetime was hardcoded 5 minutes, now it's configurable.
+
+2011-07-28 Thomas Anders <tanders@users.sourceforge.net>
+
+ * apps/sshtosnmp.c, include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/transports/snmpUDPBaseDomain.c: CHANGES: building: build
+ fix
+
+ for systems lacking MSG_DONTWAIT
+
+2011-07-27 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/mibII/tcp.c: CHANGES: snmpd: Make
+
+ TCP-MIB::tcpCurrEstab work again. Was broken in 5.7 by the
+ introduction of the "features" feature.
+
+2011-07-27 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit fb88074fbbc268c7f0509491535aec5fecb05684 Merge: a743ae5
+
+ 3821273 Author: Jan Safranek <jsafranek@users.sourceforge.net> Date:
+ Wed Jul 27 14:47:25 2011 +0200
+
+2011-07-27 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit 31fa07cd9ffde46d41d2b5838c3fc4d01548bfb5 Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Wed Jul 27
+ 14:45:47 2011 +0200
+
+2011-07-27 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/snmpd.c: CHANGES: snmpd: run signal handlers when select()
+
+ is interrupted. This behavior is indicated in comment on line 1244, but it was not
+ actually done.
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 2e9466d7f59d65d050277735e4ed9d30719ff752 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Tue Jul 26 13:10:04 2011 +0200
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 7708296760eaf5a80d8540746c9c249826fd1bfe Merge: ea11e5e
+
+ cd6e382 Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Jul
+ 26 16:21:41 2011 +0200
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/snmpUDPIPv6Domain.c: Clarify an IPv6 source code comment
+
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/agent_handler.c, man/netsnmp_handler.3: Spelling fix:
+
+ definedy -> defined
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/helpers/stash_cache.c, man/netsnmp_stash_cache.3: Spelling
+
+ fix: aleviate -> alleviate
+
+2011-07-26 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit dd2c47133493d5a00de6b3cdbcfac7e9d44b6ffe Merge: f9ccbc7
+
+ ea11e5e Author: Jan Safranek <jsafranek@users.sourceforge.net> Date:
+ Tue Jul 26 14:25:28 2011 +0200
+
+2011-07-26 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit c5a8464c42a94c250ee2dfa2a473109a734203d8 Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Tue Jul 26
+ 14:24:55 2011 +0200
+
+2011-07-25 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit f9ccbc772666134d1d178b505af9ddcdd9ed4244 Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Mon Jul 25
+ 15:02:15 2011 +0200
+
+2011-07-20 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit b0c0a355d5f601a11be4914fbf713716abd30a29 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Tue Jul 19
+ 18:36:11 2011 -0700
+
+2011-07-20 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit c14fc38614baf10d517136f0480907b7f03d8d74 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Wed Jul 20
+ 13:44:59 2011 -0700
+
+2011-07-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/testhandler.c: remove broken whitespace lines that
+
+ leads to reading confusion
+
+2011-07-20 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit ebdd216c074bf41cd3a084bd14689cf01c887b31 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Tue Jul 19
+ 18:36:11 2011 -0700
+
+2011-07-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * .gitignore: updated gitignore to ignore a number of auto-generated
+
+ files
+
+2011-07-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/testhandler.c: remove broken whitespace lines that
+
+ leads to reading confusion
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit df5f70055cf9be33f05fb50abe2f5a81eac092ad Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Tue Jul 19 11:07:19 2011 +0200
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit f596f18242dcdfd6cf49c88da1d836c16e260cac Merge: 0f309b4
+
+ 70dee4b Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Jul
+ 19 11:33:28 2011 +0200
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/agent_trap.c, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c: CHANGES: snmpd: PATCH:
+ 3369680:
+
+ from Ilya Yanok: change snmp_enableauthentraps from int to long such
+ that modifying the corresponding MIB object does not overwrite
+ memory in 64-bit builds.
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/agentx/subagent.c: CHANGES: snmpd: PATCH: 3370645:
+
+ from Bill Fenner: Fix AgentX subagent four byte leak
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test harness: do
+
+ not invoke ISRUNNING() on MinGW.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test harness:
+
+ cleanup - remove code that became superfluous.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: MinGW: Do not
+
+ assume that kill.exe reports via its exit status whether the
+ signalled process still exists.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ Remove the function WAITORDIE() from simple_eval_tools.sh since it
+ is never invoked.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ Simplify WAITFOR() in simple_eval_tools.sh. The code that handled
+ invocation of WAITFOR() with zero or one arguments has been dropped
+ since WAITFOR() is always invoked with two arguments.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test harness:
+
+ minor simplification.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/default/T059trapdtraphandle_simple: CHANGES:
+
+ testing: Skip test 59 if SIGHUP is not supported. Makes test 59 pass
+ on MinGW.
+
+2011-07-06 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: MinGW fix
+
+
+2011-07-06 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test framework
+
+ refactoring: Introduce WAITFORNOTCOND().
+
+2011-07-05 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ Make STOPPROG send SIGTERM repeatedly. This fixes a race where
+ SIGTERM could be sent before the SIGTERM signal handler was set up,
+ especially when running the regression tests under Valgrind.
+ CHANGES: testing: Make the SNMP_VERBOSE=1 output even more verbose.
+
+2011-07-05 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test harness
+
+ refactoring: introduce ECHOSENDSIGTERM() and ECHOSENDSIGKILL()
+
+2011-07-05 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Fix a bug in
+
+ testing/fulltests/support/simple_eval_tools.sh that was introduced
+ in commit 938d75c.
+
+2011-07-01 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Ignore *.exe files generated by the Win32
+
+ build
+
+2011-07-04 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ Test only once during a test whether the shell supports sub-second
+ sleeping instead of repeatedly.
+
+2011-07-04 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_run: CHANGES: testing: Changed
+
+ default timeout from 1s to 10s when the regression tests are run
+ under Valgrind
+
+2011-07-04 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ After having sent SIGTERM to snmpd or snmptrapd, wait until the
+ process has stopped before sending SIGKILL. This race condition was
+ hit most easily when running the regression tests under Valgrind.
+ CHANGES: testing: Check PID file existence after having read it
+ instead of before. This fixes the race condition where the PID file
+ disappeared after the existence check and before it was read.
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Fix a bug in a debug statement
+
+ introduced by patch 3310250 / r20494: use %ld to print a value of
+ type oid instead of %d. This patch is a combination of the following to V5.6 SVN patches: git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20511 06827809-a52a-0410-b366-d66718629dedgit-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20512 06827809-a52a-0410-b366-d66718629ded
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0f309b493c21d3c6914487514b41560754ffcdf9 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Tue Jul 19 08:37:50 2011 +0200
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 1b7454bc281568470a1300476d2edb4f411e6029 Merge: 8d9dcc8
+
+ 690ea7d Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Jul
+ 19 08:31:28 2011 +0200
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * apps/snmptrapd.c: CHANGES: snmptrapd: Add missing newline
+
+ character in a log message
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * apps/snmptrapd.c: CHANGES: snmptrapd: Invoke shutdown_perl() when
+
+ shutting down
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/snmpUDPIPv6Domain.c: Spelling fix: branket -> bracket
+
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * configure, include/net-snmp/net-snmp-config.h.in: Run autoreconf.
+
+ Fixes build breakage caused by patch
+ d588ec853bd0531f212fcbf51b962b96c6828b59 (RPM 4.9 support)
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit d617d84f83fa69ed9fa9f98efc4afaf880d121f2 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Thu Jul 14 16:43:47 2011 +0200
+
+2011-07-14 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/transports/snmpIPv6BaseDomain.c: CHANGES: snmplib: Make
+
+ netsnmp_ipv6_fmtaddr() show the IPv6 scope ID
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: Win32: Add support
+ for
+
+ IPv6 address scope ID
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * configure, include/net-snmp/net-snmp-config.h.in: Run autoreconf
+
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit a56721a3e7754e389daa7e8a3d5792899edc9de3 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Thu Jul 14 16:18:32 2011 +0200
+
+2011-07-15 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 844d4ce867bf3abe7b7536c5dbfba401937a8d4a Merge: eed0198
+
+ 61036a8 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Fri Jul 15 15:33:10 2011 -0700
+
+2011-07-15 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 851bcf53fcd13cdf0ba9f12e5d603e73f8bb9611 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Fri Jul 15
+ 15:32:49 2011 -0700
+
+2011-07-14 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/cache_handler.c: fix a typo
+
+
+2011-07-13 Robert Story <rstory@localhost>
+
+ * snmplib/parse.c: CHANGES: snmplib: tweak patch 3044888 to restore
+
+ proper non-error return during mib loading
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : added 5.7 patches to the branch list and fix the release file
+
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : added 5.7 patches to the branch list
+
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/release: a copy of the release file applied to the older
+
+ branches
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added 5.7 patches
+
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit c431231e8f0a39d1950bc72c32e3402f90fa8030 Merge: 56fee40
+
+ a2ac24d Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Jul 11 19:33:17 2011 -0700
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a copy of the
+
+ shell-functions to the older branch
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/release: a copy of the release file applied to the older
+
+ branches
+
+2011-07-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * ChangeLog: version update for 5.7
+
+
+2011-07-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7
+
+
+2011-07-01 Robert Story <rstory@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c: Revert "fix dtlsudp
+
+ transport address format function" This reverts commit 2ab3a6e6f2fcc1ff3e5f0fb5dc5d05e498820d89. - for some reason I saw 'rc' and my brain interpreted it as 'pre-release'. What can I say, it was late. :-/
+
+2011-07-01 Robert Story <rstory@localhost>
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c: fix dtlsudp transport
+
+ address format function - update ipv4 fmtaddr to handle sockaddr and to check size before assuming data is addr pair - move dtlsudp functions to extract addr(s) to tlsbase
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 56fee40118b21a9f4dc02a6f247f7da6fc69a005 Merge: d39194b
+
+ 9ff4714 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Wed Jun 29 23:18:13 2011 -0700
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: fix tag pushing
+
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: fix tag pushing
+
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: misc publication fixes found while
+
+ publishing
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * ChangeLog: version update for 5.7.rc3
+
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7.rc3
+
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: remove unneeded comment
+
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: misc publication fixes found while
+
+ publishing
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/net-snmp-config.h.in: ran autoheader to add the
+
+ missing template ifdefs
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * ChangeLog: version update for 5.7.rc2
+
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7.rc2
+
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 64b6c68a84930ab01e3e146c49f3ab5382efda3e Merge: 127eec2
+
+ d39194b Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Wed Jun 29 17:12:46 2011 -0700
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit df9cf9a1e293d05a24786694f68c05a2be13a9b3 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Wed Jun 29
+ 16:34:11 2011 -0700
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: use git2cl to generate the ChangeLog file;
+
+ needs much more work.
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: use the new run-autoconf script
+
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/run-autoconf: A script to invoke the correct version of the
+
+ autoconf tool
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: remaining command line changes for svn ->
+
+ git
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: make the branch echo output and svn update
+
+ converted to git equivalents
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: pull the branch info from git
+
+
+2011-06-29 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst_rpm.c,
+ agent/mibgroup/host/hr_swinst.c, configure.d/config_os_headers,
+ configure.d/config_os_libs1: Tweak RPM handling to work with
+ library
+
+ version 4.9
+
+2011-06-29 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit d588ec853bd0531f212fcbf51b962b96c6828b59 Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Wed Jun 29
+ 16:07:00 2011 +0200
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/release: noted that the master branch is in rc state
+
+
+2011-06-28 Wes Hardaker <opensource@hardakers.net>
+
+ * : commit 8b23b4c13923b8caf4d4aed32a450933934ff461 Merge: 153781d
+
+ 47f5048 Author: Wes Hardaker <opensource@hardakers.net> Date: Tue
+ Jun 28 13:14:52 2011 -0700
+
+2011-06-28 Wes Hardaker <opensource@hardakers.net>
+
+ * : commit af8b235234f72944a649a76f0d30cff95ac2e895 Author: Wes
+
+ Hardaker <opensource@hardakers.net> Date: Tue Jun 28 13:11:19 2011
+ -0700
+
+2011-06-28 Wes Hardaker <opensource@hardakers.net>
+
+ * local/gittools/shell-functions: use git merge with the --log
+
+ option
+
+2011-06-28 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 153781dbfb2afc0003ba4e58ffcca53001e486d6 Merge: b3e80de
+
+ 3c5a409 Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Jun
+ 28 19:43:13 2011 +0200
+
+2011-06-28 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 9bc82e4ca4837f00072dba86b9497a27186909f9 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Tue Jun 28 19:13:35 2011 +0200
+
+2011-06-28 Wes Hardaker <opensource@hardakers.net>
+
+ * FAQ: We're now using git!
+
+
+2011-06-27 Wes Hardaker <opensource@hardakers.net>
+
+ * : commit b3e80de9b07d282ff11af8b06a91d64279d3261d Merge: c4ad278
+
+ 6a5e5a6 Author: Wes Hardaker <opensource@hardakers.net> Date: Mon
+ Jun 27 21:34:59 2011 -0700
+
+2011-06-27 Wes Hardaker <opensource@hardakers.net>
+
+ * : commit 38fe8177d533135a6cc682724f16a91113bcd7f3 Merge: 7d917cf
+
+ dd58baf Author: Wes Hardaker <opensource@hardakers.net> Date: Mon
+ Jun 27 21:34:56 2011 -0700
+
+2011-06-27 Wes Hardaker <opensource@hardakers.net>
+
+ * : commit 5c177f517d16f05545b279d16f0e4fd5696be651 Merge: f0d6bf0
+
+ c2bcebc Author: Wes Hardaker <opensource@hardakers.net> Date: Mon
+ Jun 27 21:34:55 2011 -0700
+
+2011-06-27 Wes Hardaker <opensource@hardakers.net>
+
+ * : commit 9c9769572eb8c03b69556c1c5aab9b4d56c6d1d3 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Mon Jun 27
+ 14:11:14 2011 +0000
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a feature to not roll
+
+ branches currenly in rc phase git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20532 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a nsrollup function for
+
+ rolling branches upward. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20531 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: created an nspatchapply function
+
+ to apply a previously tested patch git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20530 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a nstrypatch function to
+
+ test patch application against various branches git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20529 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added verbose output git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20528 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: more prefix changes and better
+
+ setting of default values git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20527 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: use ns prefixes instead of generic
+
+ snmp prefixes git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20526 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20524 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in:
+
+ Missing check for rpmts.h git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20523 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * configure: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20522 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_agent.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3: documentation update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20521 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.in, dist/net-snmp.spec,
+ snmplib/snmp_version.c: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20520 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-23 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swinst.c, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in: Tweak RPM handling to work
+
+ with library version 4.9 Based on a patch by Jan Safranek git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20519 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swinst.c: Provide a framework for reading
+
+ RPM package information from a cache directory (rather than querying
+ the RPMdb directly). My apologies to Jeff Johnson for the delay in adding this
+ functionality. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20518 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20516 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * configure: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20515 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.in, dist/net-snmp.spec,
+ snmplib/snmp_version.c: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20514 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-21 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c: Provide a
+
+ framework for reading RPM package information from a cache directory
+ (rather than querying the RPMdb directly). My apologies to Jeff Johnson for the delay in adding this
+ functionality. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20513 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-21 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c: Provide a
+
+ framework for reading RPM package information from a cache directory
+ (rather than querying the RPMdb directly). My apologies to Jeff Johnson for the delay in adding this
+ functionality. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20513 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-21 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c: Provide a
+
+ framework for reading RPM package information from a cache directory
+ (rather than querying the RPMdb directly). My apologies to Jeff Johnson for the delay in adding this
+ functionality. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20513 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-19 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Follow-up for r20511: really use
+
+ the proper format specification. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20512 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-19 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Follow-up for r20511: really use
+
+ the proper format specification. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20512 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Fix a bug in a debug statement
+
+ introduced by patch 3310250 / r20494: use %ld to print a value of
+ type oid instead of %d. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20511 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Fix a bug in a debug statement
+
+ introduced by patch 3310250 / r20494: use %ld to print a value of
+ type oid instead of %d. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20511 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/helpers/cache_handler.c: Use %p to print a pointer instead
+
+ of %ld git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20510 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/helpers/cache_handler.c: Use %p to print a pointer instead
+
+ of %ld git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20510 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-13 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * CHANGES: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20508 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-13 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20507 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-13 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure: run correct version of autoconf git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20506 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-13 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20505 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-13 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure: ran autoconf git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20504 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-10 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/cert_util.c: Include stdlib.h to make dmalloc happy
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20502 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-10 Niels Baggesen <nba@users.sourceforge.net>
+
+ * configure.d/config_modules_security_modules: Fix build of snmpusm
+
+ when additional sec modules requested git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20501 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/cert_util.c: Include stdॆअआॆअ‡ib.h to make dmalloc happy
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20500 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-09 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/snmp_transport.c: CHANGES: BUG: 3151845: fix multiple
+
+ registrations of snmp transport handler git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20499 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-09 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/snmp_transport.c: CHANGES: BUG: 3151845: fix multiple
+
+ registrations of snmp transport handler git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20499 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-08 Robert Story <rstory@users.sourceforge.net>
+
+ * include/net-snmp/library/default_store.h, snmplib/snmp_api.c,
+ snmplib/system.c: more dnssec tweaks - create an app-global
+ validator context for use with all validation routines. mainly
+ useful for long-lived apps. - use the apptype as the validator
+ 'scope', allowing for app-specific configuration of validation
+ via libval's dnsval.conf git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20498 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-07 Robert Story <rstory@users.sourceforge.net>
+
+ * include/net-snmp/library/default_store.h: add a max define for
+
+ each default store type not actually used, just a helpful reminder for those adding new ids who might not think to check NETSNMP_DS_MAX_SUBIDS. (the bool list is rapidly approaching the current limit.) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20497 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-07 Robert Story <rstory@users.sourceforge.net>
+
+ * testing/fulltests/support/simple_run: mention builddir when
+
+ complaining about not being run from source tree git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20496 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * perl/SNMP/SNMP.xs: Reverted r20362: that patch makes sense on the
+
+ trunk and the 5.6 branch but not on the 5.5 nor on the 5.4 branch. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20495 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: snmpd: patch 3310250: from fenner: misc fixes for debugging
+ output of agentx git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20494 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: snmpd: patch 3310250: from fenner: misc fixes for debugging
+ output of agentx git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20494 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: snmpd: patch 3310250: from fenner: misc fixes for debugging
+ output of agentx git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20494 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * CHANGES, NEWS: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20492 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/Makefile.depend: make depend git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20491 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure: fixed autoconf version git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20490 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20489 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * CHANGES: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20487 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20486 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend: make
+
+ depend git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20485 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * perl/SNMP/SNMP.xs: Reinstate an "unused" label that is actually
+
+ still required. (referenced in line 2710) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20484 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/disk.c: Fix typo git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20483 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_agent.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3: documentation update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20482 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.in, dist/net-snmp.spec,
+ snmplib/snmp_version.c: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20481 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * CHANGES: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20479 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20478 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/helpers/Makefile.depend, agent/mibgroup/Makefile.depend,
+ apps/Makefile.depend, apps/snmpnetstat/Makefile.depend,
+ snmplib/Makefile.depend: make depend git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20477 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_agent.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3: documentation update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20476 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Dave Shield <dts12@users.sourceforge.net>
+
+ * CHANGES, FAQ, README, configure, configure.in,
+ dist/net-snmp.spec, snmplib/snmp_version.c: Version number update
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20475 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: fix xml quoting git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20474 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/parse.c: fix non existent malloc macro to use calloc
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20473 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/library/parse.h, snmplib/parse.c: CHANGES:
+
+ snmplib: Applied the intent of patch 3044888 to allow applications
+ to read the error messages of a MIB parsing failure. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20472 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: PATCH 3066862: from fhew: fix the agent for
+ comparing unsigned large indexes of the disk and extend tables. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20471 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: PATCH 3066862: from fhew: fix the agent for
+ comparing unsigned large indexes of the disk and extend tables. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20471 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: PATCH 3066862: from fhew: fix the agent for
+ comparing unsigned large indexes of the disk and extend tables. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20471 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: PATCH 3066862: from fhew: fix the agent for
+ comparing unsigned large indexes of the disk and extend tables. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20471 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: PATCH 3066862: from fhew: fix the agent for
+ comparing unsigned large indexes of the disk and extend tables. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20471 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swrun.c: CHANGES: snmpd: fixed hrSWRunPath
+
+ of swapped-out processes on Linux. fgets() returns NULL both when /proc/PID/cmdline is empty (= swapped
+ out) and when the process exited after fopen(), so check
+ /proc/PID/status in both cases. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20470 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swrun.c: CHANGES: snmpd: fixed hrSWRunPath
+
+ of swapped-out processes on Linux. fgets() returns NULL both when /proc/PID/cmdline is empty (= swapped
+ out) and when the process exited after fopen(), so check
+ /proc/PID/status in both cases. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20470 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swrun.c: CHANGES: snmpd: fixed hrSWRunPath
+
+ of swapped-out processes on Linux. fgets() returns NULL both when /proc/PID/cmdline is empty (= swapped
+ out) and when the process exited after fopen(), so check
+ /proc/PID/status in both cases. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20470 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-31 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swrun.c: CHANGES: snmpd: fixed hrSWRunPath
+
+ of swapped-out processes on Linux. fgets() returns NULL both when /proc/PID/cmdline is empty (= swapped
+ out) and when the process exited after fopen(), so check
+ /proc/PID/status in both cases. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20470 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: up the ante and run other test suites
+
+ besides just the default set git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20462 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmpusm.c: CHANGES: snmpd: patch 3299384: fix INFORMs so
+
+ they retry probing for an engineID. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20461 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmpusm.c: Applied (roughly) patch 3299370 to avoid
+
+ rewriting existing authkey/privkey/etcs git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20460 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/header_complex.c, agent/mibgroup/header_complex.h,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c: Applied the intent
+ of
+
+ patch 3299386 which fixes duplicate entries on a SIGHUP. To achieve
+ this some new header_complex functions needed to be created that
+ didn't change the behavior of the older ones. The notification code
+ now calls these newer functions. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20459 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmpd: patch 3299384: fix INFORMs so
+
+ they retry probing for an engineID. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20458 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmpd: patch 3299384: fix INFORMs so
+
+ they retry probing for an engineID. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20458 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmpd: patch 3299384: fix INFORMs so
+
+ they retry probing for an engineID. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20458 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmpd: patch 3299384: fix INFORMs so
+
+ they retry probing for an engineID. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20458 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: Applied (roughly) patch 3299370 to avoid
+
+ rewriting existing authkey/privkey/etcs git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20457 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: Applied (roughly) patch 3299370 to avoid
+
+ rewriting existing authkey/privkey/etcs git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20457 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: Applied (roughly) patch 3299370 to avoid
+
+ rewriting existing authkey/privkey/etcs git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20457 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: Applied (roughly) patch 3299370 to avoid
+
+ rewriting existing authkey/privkey/etcs git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20457 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/util_funcs/get_pid_from_inode.c,
+ agent/mibgroup/util_funcs/get_pid_from_inode.h, perl/Makefile.PL:
+
+ NEWS: snmpd: patch 3131397: from takevos: huge speedups of the
+ TCP/UDP Tables git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20456 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * perl/NetSNMP.xs: Added a bogus empty .xs file for bundling on
+
+ newer perl that wants "something" git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20455 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swrun_procfs_status.c: CHANGES:
+
+ snmpd: patch 3306476: from tinypyramids: fix memory leak in the
+ swrun container loading git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20454 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swrun_procfs_status.c: CHANGES:
+
+ snmpd: patch 3306476: from tinypyramids: fix memory leak in the
+ swrun container loading git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20454 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/tunnel/tunnel.c: Follow-up for r20449: use
+
+ NETSNMP_PRIo "u" for printing subids instead of only NETSNMP_PRIo. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20453 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/tunnel/tunnel.c: Follow-up for r20449: use
+
+ NETSNMP_PRIo "u" for printing subids instead of only NETSNMP_PRIo. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20453 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: Win32: Microsoft
+
+ Visual Studio: Link with gdi32.lib if OpenSSL has been enabled
+ because gdi32.lib is a dependency of OpenSSL. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20451 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: Win32: Microsoft
+
+ Visual Studio: Link with gdi32.lib if OpenSSL has been enabled
+ because gdi32.lib is a dependency of OpenSSL. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20451 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: Win32: Microsoft
+
+ Visual Studio: Link with gdi32.lib if OpenSSL has been enabled
+ because gdi32.lib is a dependency of OpenSSL. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20451 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/oid.h: Follow-up for r20448: since the
+
+ "oid" typedef has been changed back from uint32_t to u_long, change
+ NETSNMP_PRIo from NETSNMP_PRI32 into "l". git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20450 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/oid.h: Follow-up for r20448: since the
+
+ "oid" typedef has been changed back from uint32_t to u_long, change
+ NETSNMP_PRIo from NETSNMP_PRI32 into "l". git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20450 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/tunnel/tunnel.c: CHANGES: snmpd: Use proper format
+
+ specifier in debug statements for printing values of type 'oid'. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20449 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/tunnel/tunnel.c: CHANGES: snmpd: Use proper format
+
+ specifier in debug statements for printing values of type 'oid'. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20449 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/tunnel/tunnel.c: CHANGES: snmpd: Use proper format
+
+ specifier in debug statements for printing values of type 'oid'. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20449 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/tunnel/tunnel.c: CHANGES: snmpd: Use proper format
+
+ specifier in debug statements for printing values of type 'oid'. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20449 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-24 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/library/oid.h: revert OID typedef to u_long as
+
+ agreed to on -coders and in the admin meeting git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20448 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-24 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/library/oid.h: revert OID typedef to u_long as
+
+ agreed to on -coders and in the admin meeting git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20448 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-24 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/system.c: Remember to return info also without DNSSEC
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20447 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-24 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/arp_common.c: Added NULL-checks
+
+ after malloc git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20446 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-24 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/arp_common.c: Added NULL-checks
+
+ after malloc git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20446 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-24 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/arp_common.c: Added NULL-checks
+
+ after malloc git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20446 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-24 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/arp_common.c: Added NULL-checks
+
+ after malloc git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20446 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c: CHANGES:
+
+ agent: BUG: 3305157: Fix ipAddressPrefix handling of IPv6 addresses git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20445 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c: CHANGES:
+
+ agent: BUG: 3305157: Fix ipAddressPrefix handling of IPv6 addresses git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20445 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * python/netsnmp/client_intf.c: CHANGES: python: BUG: 3295407: Fix
+
+ handling of void pointer git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20444 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * python/netsnmp/client_intf.c: CHANGES: python: BUG: 3295407: Fix
+
+ handling of void pointer git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20444 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * python/netsnmp/client_intf.c: CHANGES: python: BUG: 3295407: Fix
+
+ handling of void pointer git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20444 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * python/netsnmp/client_intf.c: CHANGES: python: BUG: 3295407: Fix
+
+ handling of void pointer git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20444 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c: CHANGES:
+
+ snmplib: BUG: 3264852: Recognise missing report types
+ (snmp{Unavailable,Unknown}Contexts,snmpUnknownPDUHandlers) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20443 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c: CHANGES:
+
+ snmplib: BUG: 3264852: Recognise missing report types
+ (snmp{Unavailable,Unknown}Contexts,snmpUnknownPDUHandlers) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20443 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c: CHANGES:
+
+ snmplib: BUG: 3264852: Recognise missing report types
+ (snmp{Unavailable,Unknown}Contexts,snmpUnknownPDUHandlers) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20443 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c: CHANGES:
+
+ snmplib: BUG: 3264852: Recognise missing report types
+ (snmp{Unavailable,Unknown}Contexts,snmpUnknownPDUHandlers) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20443 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c: CHANGES:
+
+ snmplib: BUG: 3264852: Recognise missing report types
+ (snmp{Unavailable,Unknown}Contexts,snmpUnknownPDUHandlers) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20443 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-20 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmpAAL5PVCDomain.c, snmplib/snmpAliasDomain.c,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpIPXDomain.c,
+ snmplib/snmpSSHDomain.c, snmplib/snmpSTDDomain.c,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c: CHANGES: snmplib: BUG: 3234754: Ensure
+ old
+
+ f_create_from_tstring hook is initialized to NULL git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20442 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-20 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/transports/snmpAAL5PVCDomain.c,
+ snmplib/transports/snmpAliasDomain.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPXDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpSTDDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c,
+ snmplib/transports/snmpUnixDomain.c: CHANGES: snmplib: BUG:
+ 3234754:
+
+ Ensure old f_create_from_tstring hook is initialized to NULL git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20442 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-20 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/transports/snmpAAL5PVCDomain.c,
+ snmplib/transports/snmpAliasDomain.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPXDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpSTDDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c,
+ snmplib/transports/snmpUnixDomain.c: CHANGES: snmplib: BUG:
+ 3234754:
+
+ Ensure old f_create_from_tstring hook is initialized to NULL git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20442 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-20 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmpAAL5PVCDomain.c, snmplib/snmpIPXDomain.c,
+ snmplib/snmpSTDDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv6Domain.c, snmplib/snmpUnixDomain.c: CHANGES:
+
+ snmplib: BUG: 3234754: Ensure old f_create_from_tstring hook is
+ initialized to NULL git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20442 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in: use #ifdef
+
+ rather than #if for define checks. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20441 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in: use #ifdef
+
+ rather than #if for define checks. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20441 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in: use #ifdef
+
+ rather than #if for define checks. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20441 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in: use #ifdef
+
+ rather than #if for define checks. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20441 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in: use #ifdef
+
+ rather than #if for define checks. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20441 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/snmp_api.3.def, man/snmp_sess_api.3.def: CHANGES: man: BUG:
+
+ 3190725: Document snmp{,_sess}synch_response and snmp_async_send git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20440 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/session_api.3.def, man/snmp_sess_api.3.def: CHANGES: man: BUG:
+
+ 3190725: Document snmp{,_sess}synch_response and snmp_async_send git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20440 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_sess_api.3.def, man/netsnmp_session_api.3.def:
+
+ CHANGES: man: BUG: 3190725: Document snmp{,_sess}synch_response and
+ snmp_async_send git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20440 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_sess_api.3.def, man/netsnmp_session_api.3.def:
+
+ CHANGES: man: BUG: 3190725: Document snmp{,_sess}synch_response and
+ snmp_async_send git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20440 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/snmp_api.3.def, man/snmp_sess_api.3.def: CHANGES: man: BUG:
+
+ 3190725: Document snmp{,_sess}synch_response and snmp_async_send git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20440 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swrun.c: CHANGES: snmpd: fixed race
+
+ condition in hrSWRunTable Treat the reads from /proc/<pid>/*
+ carefuly, processes can exit in the middle of processing. (already
+ fixed in V5-5-patches and V5-4-patches in SVN rev. 20115, dunno why
+ I did not patch trunk) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20438 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swrun.c: CHANGES: snmpd: fixed race
+
+ condition in hrSWRunTable Treat the reads from /proc/<pid>/*
+ carefuly, processes can exit in the middle of processing. (already
+ fixed in V5-5-patches and V5-4-patches in SVN rev. 20115, dunno why
+ I did not patch trunk) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20438 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/keytools.c, snmplib/scapi.c: CHANGES: snmplib: BUG:
+
+ 3184697: Don't reference internal MD5 when it's explicitly disabled git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20437 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-19 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/keytools.c, snmplib/scapi.c: CHANGES: snmplib: BUG:
+
+ 3184697: Don't reference internal MD5 when it's explicitly disabled git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20437 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-16 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/system.c: make sure we get the hint git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20436 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-15 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/RUNTESTS: Follow-up for r20432: testing/RUNTESTS without
+
+ arguments works again as it should. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20435 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-15 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/RUNTESTS: Follow-up for r20432: testing/RUNTESTS without
+
+ arguments works again as it should. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20435 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-14 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/transports/snmpIPv6BaseDomain.c: Ran
+
+ snmplib/transports/snmpIPv6BaseDomain.c through dos2unix. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20434 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-14 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/fulltests/default/T071com2sec6_simple: Fixed a typo in a
+
+ comment. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20433 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-14 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/fulltests/default/T071com2sec6_simple: Fixed a typo in a
+
+ comment. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20433 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-14 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/RUNTESTS: RUNTESTS works again for tests with a four-digit
+
+ number. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20432 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-14 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/RUNTESTS: RUNTESTS works again for tests with a four-digit
+
+ number. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20432 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-14 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/system.c: Fixed a recently introduced bug in
+
+ netsnmp_getaddrinfo(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20431 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-14 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/diskio.c: Document that the ucd-snmp
+
+ diskio code still has to be modified such that diskio_free_config()
+ gets invoked upon SIGHUP. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20430 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-14 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/diskio.c: Document that the ucd-snmp
+
+ diskio code still has to be modified such that diskio_free_config()
+ gets invoked upon SIGHUP. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20430 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-13 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/system.c: fix cast git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20429 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-13 Robert Story <rstory@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_a
+ ccess.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_acces
+ s.c: Revert 20420 "CHANGES: snmpd: Fixed memory leak in TCP-MIB
+
+ tables introduced by patch #3053436." Revert 19708 "CHANGES: snmpd:
+ PATCH: 3053436: from: takevos: fix: tcpConnectionTable_data_access
+ invalid memory access" the bug 3053436 is fixing was introduced in r17719, and fixed in
+ r17861. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20428 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-13 Robert Story <rstory@users.sourceforge.net>
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/route.c,
+ apps/snmptrapd_log.c, configure, configure.d/config_os_functions,
+ configure.d/config_os_libs2, include/net-snmp/library/system.h,
+ include/net-snmp/net-snmp-config.h.in, snmplib/system.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c: more dns related tweaks -
+ add netsnmp_gethostbyaddr - always define netsnmp_* versions;
+ logonce if underlying function is not available - use new
+ functions in disman mibs git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20427 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-13 Robert Story <rstory@users.sourceforge.net>
+
+ * apps/snmpnetstat/inet6.c, snmplib/snmpv3.c,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c: use new netsnmp dns
+
+ functions in apps/snmplib git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20426 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-13 Robert Story <rstory@users.sourceforge.net>
+
+ * include/net-snmp/library/system.h, snmplib/system.c: move DNSSEC
+
+ validation into resolver wrapper functions - allows other code to benefit from validation - new netsnmp_gethostbyname, netsnmp_getaddrinfo git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20425 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-13 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/mib.c: Follow-up for r20417: replaced a malloc()/free()
+
+ pair by a call to realloc(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20424 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-13 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/mib.c: Follow-up for r20417: replaced a malloc()/free()
+
+ pair by a call to realloc(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20424 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-13 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/mib.c: Follow-up for r20417: replaced a malloc()/free()
+
+ pair by a call to realloc(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20424 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/arp_netlink.c: Fix for RHEL4
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20423 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_transport.h,
+ snmplib/transports/snmpUDPBaseDomain.c: Header fiddling for the
+
+ benefit of RHEL4, Solaris, OpenBSD git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20422 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_a
+ ccess.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_acces
+ s.c: CHANGES: snmpd: Fixed memory leak in TCP-MIB tables
+ introduced
+
+ by patch #3053436. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20421 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_a
+ ccess.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_acces
+ s.c: CHANGES: snmpd: Fixed memory leak in TCP-MIB tables
+ introduced
+
+ by patch #3053436. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20420 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/net-snmp/net-snmp-config.h: Reverted accidentally committed
+
+ changes of r20412. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20419 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmplib: Fixed a memory leak in
+
+ snmp_free_session(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20418 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmplib: Fixed a memory leak in
+
+ snmp_free_session(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20418 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmplib: Fixed a memory leak in
+
+ snmp_free_session(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20418 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmplib: Fixed a memory leak in
+
+ snmp_free_session(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20418 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/mib.c: CHANGES: snmplib: _mibindex_add() no longer reads
+
+ past the end of the dynamically allocated array _mibindexes. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20417 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/mib.c: CHANGES: snmplib: _mibindex_add() no longer reads
+
+ past the end of the dynamically allocated array _mibindexes. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20417 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/mib.c: CHANGES: snmplib: _mibindex_add() no longer reads
+
+ past the end of the dynamically allocated array _mibindexes. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20417 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/lcd_time.c: Avoid that MSVC triggers a compiler warning on
+
+ the code in snmplib/lcd_time.c. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20416 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/notification/snmpNotifyFilterProfileTable.c: Avoid
+
+ reading an uninitialized variable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20415 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/at.c: CHANGES: Win32: Fixed a memory leak in
+
+ the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ipNetToMediaTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20414 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/at.c: CHANGES: Win32: Fixed a memory leak in
+
+ the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ipNetToMediaTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20414 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/at.c: CHANGES: Win32: Fixed a memory leak in
+
+ the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ipNetToMediaTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20414 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/at.c: CHANGES: Win32: Fixed a memory leak in
+
+ the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ipNetToMediaTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20414 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/interfaces.c: CHANGES: Win32: Fixed a memory
+
+ leak in the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ifTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20413 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/interfaces.c: CHANGES: Win32: Fixed a memory
+
+ leak in the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ifTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20413 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/interfaces.c: CHANGES: Win32: Fixed a memory
+
+ leak in the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ifTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20413 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/interfaces.c: CHANGES: Win32: Fixed a memory
+
+ leak in the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ifTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20413 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/ipAddr.c: CHANGES: Win32: Fixed a memory leak
+
+ in the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ipAddrTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20412 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/ipAddr.c: CHANGES: Win32: Fixed a memory leak
+
+ in the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ipAddrTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20412 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/ipAddr.c: CHANGES: Win32: Fixed a memory leak
+
+ in the Net-SNMP (non-winExtDLL) implementation of the MIB-II
+ ipAddrTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20412 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/ipAddr.c, win32/net-snmp/net-snmp-config.h:
+
+ CHANGES: Win32: Fixed a memory leak in the Net-SNMP (non-winExtDLL)
+ implementation of the MIB-II ipAddrTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20412 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * ChangeLog: Documentation / source code comment spelling fix:
+
+ exitent -> existent. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20411 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * ChangeLog, snmplib/mib.c: Documentation / source code comment
+
+ spelling fix: exitent -> existent. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20411 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * ChangeLog, snmplib/mib.c: Documentation / source code comment
+
+ spelling fix: exitent -> existent. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20411 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * ChangeLog, snmplib/mib.c: Documentation / source code comment
+
+ spelling fix: exitent -> existent. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20411 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-12 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/transports/snmpIPv6BaseDomain.c: CHANGES: Win32: Build
+
+ snmplib/transports/snmpIPv6BaseDomain.c only if NETSNMP_ENABLE_IPV6
+ has been defined. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20410 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.in, Makefile.rules, configure,
+ configure.d/config_project_with_enable: install the built feature
+
+ headers too git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20409 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-11 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/fulltests/default/T025snmpv3getSHADES_simple,
+ testing/fulltests/default/T026snmpv3getSHAAES_simple: CHANGES:
+
+ testing: Tests 025 and 026 pass on MinGW even if winExtDLL has been
+ enabled. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20408 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-11 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/fulltests/default/T065agentextend_simple: T065 robustness
+
+ improvement. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20407 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-11 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/fsys.h,
+ agent/mibgroup/hardware/fsys/fsys_void.c,
+ agent/mibgroup/ucd-snmp/disk_hw.h: CHANGES: snmpd: ucd_snmp builds
+
+ again on MinGW and Cygwin. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20406 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.in: install the net-snmp-features.h file git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20405 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/fulltests/default/T0141snmpv2cset_simple: Improved test
+
+ robustness. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20404 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/smux/smux.c: Compiler warning fixes. git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20403 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: MinGW: avoid that gcc complains about pasing
+
+ a (char *) argument while (unsigned char *) is expected. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20402 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: MinGW: avoid that gcc complains about pasing
+
+ a (char *) argument while (unsigned char *) is expected. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20402 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: MinGW: avoid that gcc complains about pasing
+
+ a (char *) argument while (unsigned char *) is expected. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20402 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: MinGW: avoid that gcc complains about pasing
+
+ a (char *) argument while (unsigned char *) is expected. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20402 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/tools.c: Avoid out-of-bounds array access if the last char
+
+ of time_string is in the range 0x80..0xfe and char is a signed type. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20401 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/oid.h: Reverted r20380 because it breaks
+
+ all statements that print an OID sub-ID on any 64-bit platform. The
+ effect of r20380 on big endian architectures was that a "0" would be
+ printed instead of the OID sub-ID (at least with the LP64 and the
+ ILP64 models). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20400 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * CHANGES, NEWS: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20385 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20384 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend: make
+
+ depend git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20383 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c: C++ -> C comments
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20382 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-10 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * NEWS: NEWS update for 5.7 git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20381 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/library/oid.h: revert the oid typedef resizing
+
+ from r17809 because it broke backwards compat, as pointed out by
+ users on the -coders list git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20380 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure: use proper autoconf version git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20379 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, perl/ASN/ASN.pm, perl/AnyData_SNMP/Storage.pm,
+ perl/OID/OID.pm, perl/SNMP/SNMP.pm,
+ perl/TrapReceiver/TrapReceiver.pm, perl/agent/Support/Support.pm,
+ perl/agent/agent.pm, perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm: Version number update
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20378 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.top: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20377 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * mibs/UCD-SNMP-MIB.txt: added a missing 0 in the revision date
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20376 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c: Use symbolic
+
+ named for ifType values git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20375 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c: Use symbolic
+
+ named for ifType values git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20375 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c: Use symbolic
+
+ named for ifType values git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20375 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c: Use symbolic
+
+ named for ifType values git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20375 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c: Use symbolic
+
+ named for ifType values git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20375 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/rfcmibs.diff: IANA has fixed the
+
+ IANA-IPPM-METRICS-REGISTRY-MIB git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20374 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/rfcmibs.diff: IANA has fixed the
+
+ IANA-IPPM-METRICS-REGISTRY-MIB git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20374 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * mibs/UCD-SNMP-MIB.txt: added a new REVISION clause to list the
+
+ changes in the the recent update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20373 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * NEWS: added ping/traceroute mibs note git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20372 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/proxy.c: we actually want to use the base
+
+ OID as the starting point, not the reg OID. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20371 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/proxy.c: fixed the proxy support to do a
+
+ proper OID less than OID compare. We actually don't care about the
+ length of the original request, only that it was before the
+ registered rebase git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20370 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/proxy.c: CHANGES: patch 3140833: from
+
+ jsafranek: fix proxy GETNEXT requests When OIDs requested are below
+ the proxy request remap, we need to not include any OIDs that might
+ be in the space between the original OID and the remapped OID. This
+ patch fudges the request so that it fixes the request OID so it's
+ just before the remapped proxy range. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20369 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat.h,
+ include/net-snmp/agent/hardware/cpu.h, mibs/UCD-SNMP-MIB.txt:
+ NEWS:
+
+ PATCH 3167325: from krisztoforo: UCD-SNMP/SystemStats: add variables
+ to report cpusteal, cpuguest, cpuguestnice git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20368 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/data_access/interface.c: CHANGES: patch
+
+ 3184026: from eivnaes: Avoid constant refresh of interface
+ statistics git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20367 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/snmp_agent.c, apps/snmpdelta.c, snmplib/scapi.c,
+ snmplib/snmp_api.c, snmplib/system.c, snmplib/tools.c: Fixed
+ several
+
+ compiler warnings reported by the MSVC compiler. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20366 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/gettimeofday.c: Win32/MSVC: Fixed a compiler warning.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20365 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-09 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/var_route.c: CHANGES: agent: Fixed a
+
+ year-2038 bug in the implementation of ipRouteTable. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20364 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-08 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/ping/pingProbeHistoryTable.c,
+ agent/mibgroup/disman/ping/pingResultsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteHopsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c: Fix
+
+ warnings and data format for DateAndTime objects. These modules
+ work, but: - They are Linux only - Rows must be created with rowStatus createAndWait before they are
+ populated - Agent must run as root - Agent is blocked while tests run - Data format for InetAddress objects is wrong. It is ASCII, not
+ binary (making it easier to use from the command line, but ...) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20363 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-08 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/ping/pingProbeHistoryTable.c,
+ agent/mibgroup/disman/ping/pingResultsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteHopsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c: Fix
+
+ warnings and data format for DateAndTime objects. These modules
+ work, but: - They are Linux only - Rows must be created with rowStatus createAndWait before they are
+ populated - Agent must run as root - Agent is blocked while tests run - Data format for InetAddress objects is wrong. It is ASCII, not
+ binary (making it easier to use from the command line, but ...) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20363 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-08 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/ping/pingProbeHistoryTable.c,
+ agent/mibgroup/disman/ping/pingResultsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteHopsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c: Fix
+
+ warnings and data format for DateAndTime objects. These modules
+ work, but: - They are Linux only - Rows must be created with rowStatus createAndWait before they are
+ populated - Agent must run as root - Agent is blocked while tests run - Data format for InetAddress objects is wrong. It is ASCII, not
+ binary (making it easier to use from the command line, but ...) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20363 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-08 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/ping/pingProbeHistoryTable.c,
+ agent/mibgroup/disman/ping/pingResultsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteHopsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c: Fix
+
+ warnings and data format for DateAndTime objects. These modules
+ work, but: - They are Linux only - Rows must be created with rowStatus createAndWait before they are
+ populated - Agent must run as root - Agent is blocked while tests run - Data format for InetAddress objects is wrong. It is ASCII, not
+ binary (making it easier to use from the command line, but ...) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20363 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-08 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/ping/pingProbeHistoryTable.c,
+ agent/mibgroup/disman/ping/pingResultsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteHopsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c: Fix
+
+ warnings and data format for DateAndTime objects. These modules
+ work, but: - They are Linux only - Rows must be created with rowStatus createAndWait before they are
+ populated - Agent must run as root - Agent is blocked while tests run - Data format for InetAddress objects is wrong. It is ASCII, not
+ binary (making it easier to use from the command line, but ...) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20363 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * perl/SNMP/SNMP.xs: Removed an unused label from perl/SNMP/SNMP.xs.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20362 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * perl/SNMP/SNMP.xs: Removed an unused label from perl/SNMP/SNMP.xs.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20362 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * perl/SNMP/SNMP.xs: Removed an unused label from perl/SNMP/SNMP.xs.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20362 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * perl/SNMP/SNMP.xs: Removed an unused label from perl/SNMP/SNMP.xs.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20362 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/agent_registry.c, agent/helpers/old_api.c,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/old_api.h: CHANGES: snmpd: Declare the OID
+
+ argument type of MIB registration functions as 'const oid *' instead
+ of 'oid *' since these functions do not modify the OID. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20361 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_netlink.c,
+ include/net-snmp/data_access/arp.h: Use the correct data type for
+
+ the 'cache expired' variable: char instead of int. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20360 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/dlmod.c: Fixed a compiler warning that was
+
+ introduced in r20151. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20359 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: Win32: improved source code consistency by
+
+ using LPCTSTR instead of LPCSTR. Note: this does not mean that
+ Unicode builds are supported. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20358 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: Win32: improved source code consistency by
+
+ using LPCTSTR instead of LPCSTR. Note: this does not mean that
+ Unicode builds are supported. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20358 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/arp_netlink.c: Add file
+
+ forgotten in r20353 git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20357 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/net-snmp/net-snmp-config.h: Reverted a change that was
+
+ committed accidentally in r20276. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20356 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: Fixed two compiler
+
+ warnings. (Backported r20236 from the trunk.) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20355 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/diskio.c: Commented out an unused function
+
+ because the compiler complained about it. (Backported r20237 from
+ the trunk.) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20354 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/cache_handler.c,
+ agent/mibgroup/ip-mib/data_access/arp.h,
+ agent/mibgroup/ip-mib/data_access/arp_common.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_
+ access.c, include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/data_access/arp.h: CHANGES: snmpd: PATCH 312596:
+
+ from fabled80: listen for netlink change events for the arp-related
+ tables git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20353 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h: NEWS: PATCH
+
+ 3198781: from fenner: Get disman/ping and disman/traceroute to at
+ least compile git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20352 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h: NEWS: PATCH
+
+ 3198781: from fenner: Get disman/ping and disman/traceroute to at
+ least compile git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20352 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h: NEWS: PATCH
+
+ 3198781: from fenner: Get disman/ping and disman/traceroute to at
+ least compile git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20352 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h: NEWS: PATCH
+
+ 3198781: from fenner: Get disman/ping and disman/traceroute to at
+ least compile git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20352 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/system.c: NEWS: snmplib: add optional support for local
+
+ DNSSEC validation of hostnames - optional at configure time: --with-local-dnssec-validation - requires DNSSEC-Tool validation libraries - initial support, for systems with getaddrinfo. support for
+ additional resolver interfaces coming soon. - also TODO: flag for ignoring validatoin errors (log & continue) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20351 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Robert Story <rstory@users.sourceforge.net>
+
+ * include/net-snmp/library/parse.h: move unused (and too generic)
+
+ token within UCD_COMPATIBLE ifdef - MAXLABEL conflicts with <arpa/nameser.h> - added NETSNMP_MAXLABEL git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20350 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Robert Story <rstory@users.sourceforge.net>
+
+ * agent/Makefile.in, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in, configure,
+ configure.d/config_os_misc2,
+ configure.d/config_project_with_enable,
+ include/net-snmp/net-snmp-config.h.in: update configure/Makefiles
+
+ for DNSSEC local validation option git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20349 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * CHANGES: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20347 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20346 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/Makefile.depend: make depend git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20345 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_agent.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3: documentation update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20344 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.in, dist/net-snmp.spec,
+ snmplib/snmp_version.c: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20343 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/data_access/interface_sysctl.c: removed the
+
+ accidental broken feature require line that got half inserted git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20342 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * CHANGES: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20340 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20339 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/Makefile.depend: make depend git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20338 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_agent.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3: documentation update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20337 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.in, dist/net-snmp.spec,
+ snmplib/snmp_version.c: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20336 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Fix incomplete uninstall
+
+ configuration: - broken removal of Microsoft DLL - remove assorted new MIBs and header files git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20335 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Fix incomplete uninstall
+
+ configuration: - broken removal of Microsoft DLL - remove assorted new MIBs and header files git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20335 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Fix incomplete uninstall
+
+ configuration: - broken removal of Microsoft DLL - remove assorted new MIBs and header files git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20335 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Fix incomplete uninstall
+
+ configuration: - broken removal of Microsoft DLL - remove assorted new MIBs and header files git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20335 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Fix incomplete uninstall
+
+ configuration: - broken removal of Microsoft DLL - remove assorted new MIBs and header files git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20335 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/build-binary.pl: Support Tar/GZip command paths
+
+ containing spaces git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20334 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/build-binary.pl: Support Tar/GZip command paths
+
+ containing spaces git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20334 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/build-binary.pl: Support Tar/GZip command paths
+
+ containing spaces git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20334 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/build-binary.pl: Report GZip command correctly
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20333 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/build-binary.pl: Report GZip command correctly
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20333 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-06 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/build-binary.pl: Report GZip command correctly
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20333 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c: Fix for DragonFly BSD (does
+ not
+
+ define IP_SENDSRCADDR) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20332 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c: Fix for DragonFly BSD (does
+ not
+
+ define IP_SENDSRCADDR) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20332 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Niels Baggesen <nba@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h: Fix spelling of
+
+ SO_RECVDSTADDR git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20331 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Niels Baggesen <nba@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h: Fix spelling of
+
+ SO_RECVDSTADDR git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20331 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Robert Story <rstory@users.sourceforge.net>
+
+ * include/net-snmp/library/default_store.h, man/snmp.conf.5.def,
+ snmplib/snmp_api.c: NEWS: apps: add snmp.conf tokens for timeouts
+
+ and retries git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20330 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/tools.c, testing/TESTCONF.sh: CHANGES: MinGW: Made
+
+ regression test output independent of the Net-SNMP variables defined
+ in the Windows registry. Some tests that failed previously after the
+ Net-SNMP binaries (MSVC build) had been installed do now pass. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20329 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/tools.c, testing/TESTCONF.sh: CHANGES: MinGW: Made
+
+ regression test output independent of the Net-SNMP variables defined
+ in the Windows registry. Some tests that failed previously after the
+ Net-SNMP binaries (MSVC build) had been installed do now pass. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20329 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/tools.c, testing/fulltests/support/simple_TESTCONF.sh:
+
+ CHANGES: MinGW: Made regression test output independent of the
+ Net-SNMP variables defined in the Windows registry. Some tests that
+ failed previously after the Net-SNMP binaries (MSVC build) had been
+ installed do now pass. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20329 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/tools.c, testing/fulltests/support/simple_TESTCONF.sh:
+
+ CHANGES: MinGW: Made regression test output independent of the
+ Net-SNMP variables defined in the Windows registry. Some tests that
+ failed previously after the Net-SNMP binaries (MSVC build) had been
+ installed do now pass. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20329 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-05 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp/libsnmp.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj, win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj, win32/win32.sln,
+ win32/win32dll.sln:
+
+ Removed Visual Studio 2005 solution and project files again since
+ Visual Studio 2010 refuses to load these. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20328 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.in: clean the perl/python feature leftovers git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20327 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: fix mib module invocation git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20326 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c: fix ifdef
+
+ typo git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20325 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.in: fix perl/python feature dependencies git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20324 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/auto_nlist.c: reverted auto_nlist macro usage; the function
+
+ is used in headers git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20323 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: Add a -T option to run 'make test'
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20322 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * apps/Makefile.in: fix the encode_keychange .ft filename git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20321 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * perl/TrapReceiver/netsnmp-feature-definitions.h, snmplib/tools.c:
+
+ fix the features required by the TrapReceiver module git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20320 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.in: Add the TrapReceiver to the list of perl modules
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20319 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * perl/SNMP/SNMP.xs: use the newer Net-SNMP APIs, rather than the
+
+ older UCD ones git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20318 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * perl/SNMP/SNMP.xs: remove SET code when under --read-only mode
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20317 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/disman/event/mteTriggerTable.c: require
+
+ check_vb_uint git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20316 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagen
+ t.c, agent/snmp_agent.c, local/mib2c-conf.d/subagent.m2c,
+ python/netsnmp/netsnmp-feature-definitions.h,
+ snmplib/snmp_logging.c: last of the perl-used feature functions
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20315 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/Rmon/event.c, agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagen
+ t.c, agent/mibgroup/smux/smux.c, apps/snmptrapd_handlers.c,
+ local/mib2c-conf.d/subagent.m2c, snmplib/mib.c, snmplib/parse.c:
+
+ started the final set of function removals for features required by
+ perl/python git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20314 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/generic-source-includes.m2i: added the
+
+ net-snmp-features.h header git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20313 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * perl/OID/netsnmp-feature-definitions.h,
+ perl/SNMP/netsnmp-feature-definitions.h,
+ perl/TrapReceiver/netsnmp-feature-definitions.h,
+ perl/agent/netsnmp-feature-definitions.h: Added perl feature
+
+ requirements git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20312 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.in, Makefile.rules, configure,
+ configure.d/config_project_perl_python,
+ perl/ASN/netsnmp-feature-definitions.h,
+ perl/OID/netsnmp-feature-definitions.h,
+ perl/SNMP/netsnmp-feature-definitions.h,
+ perl/agent/netsnmp-feature-definitions.h,
+ perl/default_store/netsnmp-feature-definitions.h: hopefully
+ working
+
+ rules to apply feature requirements to perl and python git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20311 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c,
+ agent/snmp_agent.c: more changes to remove unneeded functions
+
+ primarily when write mode is turned off git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20310 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_logging.c: change the want invocation to only default
+
+ to exclude external hooks git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20309 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/find-unused-code: search through .xs files for
+
+ function invocations git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20308 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/auto_nlist.c: forgot a semicolon git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20307 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/expr/expExpressionTable.c: iquery pdu
+ sessions
+
+ are only needed in write mode. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20306 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * apps/Makefile.in: fix feature detection of sometimes-built
+
+ applications git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20305 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/auto_nlist.c: use the feature_unused macro for making an
+
+ empty file for consistency git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20304 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_dataset.c, agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_dat
+ a_access.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSN
+ Table.c, agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/utilities/iquery.c, apps/snmptls.c,
+ snmplib/cert_util.c, snmplib/mib.c, snmplib/snmp_openssl.c,
+ snmplib/transports/snmpDTLSUDPDomain.c: Another sweep for unused
+
+ functions when read_only mode is turned on git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20303 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_tdata.c, agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/agent/extend.c, agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/agent/nsVacmAccessTable.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/expr/expExpressionTable.c,
+ agent/mibgroup/disman/expr/expObjectTable.c,
+ agent/mibgroup/disman/expression/expExpressionTable.c,
+ agent/mibgroup/disman/expression/expObjectTable.c,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c
+ ,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_interface.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSN
+ Table.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.
+ c, snmplib/check_varbind.c: mark a slew of functions as features
+
+ that are only needed with write_support git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20302 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/find-unused-code: run grep with -n git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20301 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_transport.c, snmplib/transports/snmpDTLSUDPDomain.c:
+
+ featurize netsnmp_sockaddr_size git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20300 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c: remove a
+
+ feature_require not actually needed. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20299 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/cert_util.c, snmplib/container.c: mark SUBCONTAINER_FIND
+
+ as a feature git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20298 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_client.c, snmplib/snmptsm.c: the row creation API is
+
+ only used in the TSM implementation git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20297 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c, snmplib/snmptsm.c: the newer context engineID
+
+ probing is only needed iff TSM is in use git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20296 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/dir_utils.c: fix an ifdef typo git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20295 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_openssl.c: moved fetaure child_of statements to the
+
+ top of the file git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20294 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/cert_util.c, snmplib/container.c, snmplib/dir_utils.c,
+ snmplib/snmp_openssl.c: marked a couple of rarely used container
+
+ functions. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20293 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/util_funcs.c: split out the prefix_info feature
+ into
+
+ sub-features git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20292 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_int
+ erface.c: mark the accessor functions as unneeded git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20291 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.c: fix a child_of statement
+
+ with a copy/paste error git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20290 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_tdata.c: the container row-remove is only
+
+ needed if the tdata remove_row is needed git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20289 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_tdata.c, agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSN
+ Table.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.
+ c: feature marking of unused tdata functions
+ table_tdata_delete_table table_tdata_extract_table
+ table_tdata_remove_row git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20288 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_dataset.c,
+ agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/examples/data_set.c: removal of some rarely used
+
+ functions table_set_multi_add_default_row table_dataset_unregister_auto_data_table git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20287 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: Added a definition to incorporate
+
+ read_only/notify_only git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20286 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_data.c: added a missing feature definition
+
+ line git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20285 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/Makefile.in: added back in missing mibgroup feature
+
+ definition list git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20284 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: Include the original base flags to
+
+ ensure --with-defaults gets picked up git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20283 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: fix usage git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20282 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: Added a -b flag for base arguments to
+
+ start from git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20281 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: default to a linear seach of size
+
+ tests, rather than exponential git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20280 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpUDPDomain.h, snmplib/snmpUDPDomain.c:
+
+ CHANGES: snmplib: Guard netsnmp_udp_recvfrom() etc. declarations
+ consistently. CHANGES: Win32: Builds with Visual Studio 2010. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20279 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c: CHANGES: snmplib:
+ Guard
+
+ netsnmp_udp_recvfrom() etc. declarations consistently. CHANGES:
+ Win32: Builds with Visual Studio 2010. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20278 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c: CHANGES: snmplib:
+ Guard
+
+ netsnmp_udp_recvfrom() etc. declarations consistently. CHANGES:
+ Win32: Builds with Visual Studio 2010. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20278 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: CHANGES: Win32: PATCH: 3293842: Eliminate
+
+ registry argument limit of 127 characters (this limitation was
+ reported by Sylvain Dery). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20277 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: CHANGES: Win32: PATCH: 3293842: Eliminate
+
+ registry argument limit of 127 characters (this limitation was
+ reported by Sylvain Dery). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20277 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: CHANGES: Win32: PATCH: 3293842: Eliminate
+
+ registry argument limit of 127 characters (this limitation was
+ reported by Sylvain Dery). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20277 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: CHANGES: Win32: PATCH: 3293842: Eliminate
+
+ registry argument limit of 127 characters (this limitation was
+ reported by Sylvain Dery). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20277 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-02 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: Win32: header file
+
+ <net-snmp/net-snmp-config.h> can now be used in the MinGW
+ environment. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20276 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-02 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: Win32: header file
+
+ <net-snmp/net-snmp-config.h> can now be used in the MinGW
+ environment. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20276 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-02 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: Win32: header file
+
+ <net-snmp/net-snmp-config.h> can now be used in the MinGW
+ environment. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20276 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-02 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: Win32: header file
+
+ <net-snmp/net-snmp-config.h> can now be used in the MinGW
+ environment. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20276 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-02 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/getopt.h,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/net-snmp-includes.h: Win32 DLL build fixes.
+
+ (Backported r20184 from trunk.) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20275 06827809-a52a-0410-b366-d66718629ded
+
+2011-05-02 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/getopt.h,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/net-snmp-includes.h: Win32 DLL build fixes.
+
+ (Backported r20184 from trunk.) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20275 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: Spelling and grammar fixes for the source
+
+ code comments in snmplib/winservice.c. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20274 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: Spelling and grammar fixes for the source
+
+ code comments in snmplib/winservice.c. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20274 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: Spelling and grammar fixes for the source
+
+ code comments in snmplib/winservice.c. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20274 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/winservice.c: Spelling and grammar fixes for the source
+
+ code comments in snmplib/winservice.c. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20274 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * NEWS: added note about the new timing function git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20273 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * man/snmpd.conf.5.def: Update the manual page to reflect the new
+
+ timing options git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20272 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/tools.c: better documentation git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20271 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/schedule/schedConf.c: use the
+
+ netsnmp_string_time_to_secs() for parsing frequencies/time git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20270 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * testing/fulltests/unit-tests/T102pdu_build_clib.c: fix pdu
+
+ building tests under various disabled modes git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20269 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * testing/fulltests/unit-tests/T102pdu_build_clib.c: don't try to
+
+ build the GET pdu under notify_only git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20268 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c: fix a bug with
+
+ no-suffix strings and use a const input string git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20267 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * *
+ testing/fulltests/unit-tests/T010netsnmp_string_time_to_secs_clib.c:
+
+ A new unit test for the time conversion routine git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20266 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: use the
+
+ netsnmp_string_time_to_secs() function for computing interval
+ periods git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20265 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c: Added a
+
+ netsnmp_string_time_to_secs() functions to convert, e.g., 1h to 3600 git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20264 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: remove code to build/parse GET/etc requests
+
+ when NOTIFY_ONLY is turned on. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20263 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * NEWS: update the NEWS to reflect the new --enable-read-only and
+
+ --enable-notify-only git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20262 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c: minor
+
+ improvements for ronly vs rwrite handling git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20261 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_interface.c: still enable
+
+ RONLY when RWRITE isn't possible git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20260 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/cache_handler.c: fix GET support when no_write is
+
+ enabled git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20259 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: mark a future
+
+ modification need in a comment git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20258 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/old_api.c: fix handling of no_write support
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20257 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/agent_read_config.c, agent/snmp_agent.c, agent/snmpd.c:
+
+ don't open any listening transports when notify-only is specified git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20256 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure, configure.d/config_project_with_enable: set the
+
+ no-listen and read-only flags when --enable-notify-only is set git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20255 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/net-snmp-config.h.in: ran autoheader git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20254 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/transports/snmpAAL5PVCDomain.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPXDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c,
+ snmplib/transports/snmpUnixDomain.c: implement the
+
+ NETSNMP_NO_LISTEN_SUPPORT in these transports git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20253 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure: run autoconf git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20252 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure.d/config_project_with_enable: move the read-only flag
+
+ definition below the notify-only, since notify-only needs to imply
+ read-only git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20251 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure, configure.d/config_project_with_enable: Defined a new
+
+ --enable-notify-only flag for building a toolset that only allows
+ for notifications with no read/write support git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20250 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure, configure.d/config_project_with_enable: Defined a new
+
+ --no-listen flag to remove listening support git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20249 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/default_modules.h: the disman schedule mib is only
+
+ useful when SETs are turned on git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20248 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/disman.h: the disman schedule mib is only useful
+
+ when SETs are turned on git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20247 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _interface.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_int
+ erface.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_inter
+ face.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_int
+ erface.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interfa
+ ce.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le_interface.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interf
+ ace.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.
+ c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.
+ c: finished no_write support for common included tables
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20246 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_dataset.c: Add back in
+
+ 'netsnmp_set_row_column' when no_write support is enabled This
+ function is a generic data manipulation function, not SET specific git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20245 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_dataset.c: don't use mark_row_column_writable
+
+ when read-only support is enabled git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20244 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agent/nsCache.c, agent/mibgroup/agent/nsDebug.c,
+ agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/ip-mib/ip_scalars.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/utilities/override.c: fix no_write support
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20243 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/agent/extend.c: fix no_write support git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20242 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c: Don't free
+
+ the ifXTable row found on load failure as we don't own it git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20241 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c: Don't free
+
+ the ifXTable row found on load failure as we don't own it git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20241 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c: Don't free
+
+ the ifXTable row found on load failure as we don't own it git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20241 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c: Don't free
+
+ the ifXTable row found on load failure as we don't own it git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20241 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c: Don't free
+
+ the ifXTable row found on load failure as we don't own it git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20241 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: git bash-shell functions to enable
+
+ branch switching and external building These local shell functions
+ (snmpconfigure and snmpmake) let you configure and build the
+ Net-SNMP source code in external directories that are
+ auto-calculated based on the existing branch name (with an optional
+ suffix). This lets you run 'snmpmake' from within the source
+ directory and have it actually externally keep track of modified
+ files, etc, so building in multiple branches can be done from a
+ single git checkout. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20240 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: clean up the iterators
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20239 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: free varbinds after
+
+ sending git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20238 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/diskio.c: Commented out an unused function
+
+ because the compiler complained about it. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20237 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-25 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: Fixed two compiler
+
+ warnings. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20236 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-23 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/helpers/table_data.c: Remove unnecessary null check
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20235 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-23 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/helpers/table_container.c: Move pointer dereference to after
+
+ the check for successful allocation of the pointer git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20234 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-23 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/agent_registry.c: Reduce variable scope git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20233 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-23 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/agent_registry.c: Remove an unused variable git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20232 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-23 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/agent_registry.c: Reduce variable scope git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20231 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-23 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/agent_registry.c: Reduce variable scope git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20230 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/agent_trap.c: Reduce variable scope git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20229 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/agent_trap.c: Remove unused variable git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20228 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * man/snmpd.conf.5.def: mention which module is required when
+
+ building to get the deliver support git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20227 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: deleted an unneeded
+
+ debugging statement git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20226 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: properly update the max
+
+ count in the outgoing notifications git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20225 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: better packet estimation
+
+ to ensure we don't overrun. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20224 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: estimate the packet size
+
+ and break the notification up based on it git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20223 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: transform the
+
+ notification sending into a larger loop for later multi-notifs git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20222 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * NEWS: further information about feature marking/selection
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20221 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * NEWS: mention the new delivery by notifications git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20220 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * NEWS: document the minimalist support git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20219 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * man/snmpd.conf.5.def: document the new deliverByNotify config
+
+ tokens git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20218 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: allow run time
+
+ modifications of the OIDs to use git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20217 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h: add config flags to not
+
+ include the period config and msg count values git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20216 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: include the periodic
+
+ count, the message number and the max message number git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20215 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: deleted debugging
+
+ comment git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20214 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ mibs/NET-SNMP-PERIODIC-NOTIFY-MIB.txt: Move the notification
+
+ definition to within the sub-mib git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20213 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: delete an unused
+
+ variable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20212 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.h: load the MIB into the
+
+ default set git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20211 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * mibs/NET-SNMP-PERIODIC-NOTIFY-MIB.txt: A new mib to hold the
+
+ periodic notify objects git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20210 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: fill out the config free
+
+ routine git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20209 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: properly monitor the
+
+ whole container git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20208 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h: parse the conf files and
+
+ create and insert objects into the container git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20207 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: defined a container to
+
+ store a list of deliver objects in git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20206 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.h: added a next_run
+
+ timestamp git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20205 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: actually send a
+
+ notification with the results git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20204 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: make the walk on the
+
+ test object function. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20203 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: create a max packet size
+
+ config token and parse it git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20202 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h: minimal starting test
+
+ object git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20201 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h: added a function to
+
+ calculate the time until the next run git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20200 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: remove left in template
+
+ line git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20199 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h: use an alarm callback
+
+ prototype for execute git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20198 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h: beginning template code
+
+ for delivery of data by notifications git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20197 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/snmp_agent.c: Reduce variable scope git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20196 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/snmp_agent.c: Reduce variable scopes git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20195 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-22 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/snmp_agent.c: Remove unused variable git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20194 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-19 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/libsnmp/libsnmp.vcproj, win32/win32.sln: Added Visual Studio
+
+ 2005 project and solution file for building the Net-SNMP library as
+ a static library. Both the Win32 and the x64 configurations are
+ included. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20193 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-19 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj, win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj: More Visual Studio 2005 project
+ file
+
+ cleanup. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20191 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-18 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj, win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj: Cleaned up Win32 VS2005 project
+
+ files - removed superfluous library references. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20189 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-18 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj, win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj, win32/win32dll.sln: Added x64
+
+ configurations. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20188 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-18 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj, win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj, win32/win32dll.sln: Added
+
+ win32dll-related Visual Studio 2005 project and solution files. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20186 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-18 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/getopt.h,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/net-snmp-includes.h: Win32 DLL build fixes.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20184 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-17 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmpUDPDomain.c: CHANGES: snmpd: PATCHES: 3175640: Use
+
+ IP_RECVDSTADDR sockopt where available (*BSD) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20183 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-17 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c: CHANGES: snmpd:
+ PATCHES:
+
+ 3175640: Use IP_RECVDSTADDR sockopt where available (*BSD) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20183 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-17 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c: CHANGES: snmpd:
+ PATCHES:
+
+ 3175640: Use IP_RECVDSTADDR sockopt where available (*BSD) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20183 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmplib: PATCHES: 3183000: Fix
+
+ calculation of common OID prefix length CHANGES: snmplib: BUGS:
+ 3182985: Fix calculation of common OID prefix length git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20182 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmplib: PATCHES: 3183000: Fix
+
+ calculation of common OID prefix length CHANGES: snmplib: BUGS:
+ 3182985: Fix calculation of common OID prefix length git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20182 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmplib: PATCHES: 3183000: Fix
+
+ calculation of common OID prefix length CHANGES: snmplib: BUGS:
+ 3182985: Fix calculation of common OID prefix length git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20182 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmplib: PATCHES: 3183000: Fix
+
+ calculation of common OID prefix length CHANGES: snmplib: BUGS:
+ 3182985: Fix calculation of common OID prefix length git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20182 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp_api.c: CHANGES: snmplib: PATCHES: 3183000: Fix
+
+ calculation of common OID prefix length CHANGES: snmplib: BUGS:
+ 3182985: Fix calculation of common OID prefix length git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20182 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/diskio.c, apps/snmptrapd_ds.h,
+ include/net-snmp/agent/ds_agent.h, man/snmpd.conf.5.def: CHANGES:
+
+ Linux: PATCHES: 3205811: Option to skip fd/loop/ram devices in
+ diskIOTable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20181 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/diskio.c, apps/snmptrapd_ds.h,
+ include/net-snmp/agent/ds_agent.h, man/snmpd.conf.5.def: CHANGES:
+
+ Linux: PATCHES: 3205811: Option to skip fd/loop/ram devices in
+ diskIOTable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20181 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * python/netsnmp/client_intf.c: CHANGES: python: PATCHES: 3185085:
+
+ Fix segfault on 64-bit systems git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20180 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * python/netsnmp/client_intf.c: CHANGES: python: PATCHES: 3185085:
+
+ Fix segfault on 64-bit systems git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20180 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * python/netsnmp/client_intf.c: CHANGES: python: PATCHES: 3185085:
+
+ Fix segfault on 64-bit systems git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20180 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * python/netsnmp/client_intf.c: CHANGES: python: PATCHES: 3185085:
+
+ Fix segfault on 64-bit systems git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20180 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3175323: Fix handling of
+
+ 'while (false)' blocks git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20179 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3175323: Fix handling of
+
+ 'while (false)' blocks git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20179 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3175323: Fix handling of
+
+ 'while (false)' blocks git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20179 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3175323: Fix handling of
+
+ 'while (false)' blocks git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20179 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3175323: Fix handling of
+
+ 'while (false)' blocks git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20179 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3204883: Fix handling of
+
+ non-table objects named fooTable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20178 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3204883: Fix handling of
+
+ non-table objects named fooTable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20178 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3204883: Fix handling of
+
+ non-table objects named fooTable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20178 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3204883: Fix handling of
+
+ non-table objects named fooTable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20178 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3204883: Fix handling of
+
+ non-table objects named fooTable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20178 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3211484: Support
+
+ enumerations in notification varbinds git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20177 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3211484: Support
+
+ enumerations in notification varbinds git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20177 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3211484: Support
+
+ enumerations in notification varbinds git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20177 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3211484: Support
+
+ enumerations in notification varbinds git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20177 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * local/mib2c: CHANGES: mib2c: PATCHES: 3211484: Support
+
+ enumerations in notification varbinds git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20177 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/UCD-SNMP-MIB.txt: Add missing system oids to mib git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20176 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/UCD-SNMP-MIB.txt: Add missing system oids to mib git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20176 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/UCD-SNMP-MIB.txt: Add missing system oids to mib git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20176 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/UCD-SNMP-MIB.txt: Add missing system oids to mib git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20176 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/UCD-SNMP-MIB.txt: Add missing system oids to mib git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20176 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix for garbage output when agent presents more
+
+ columns in bulk response than our local MIB file specified. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20175 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix for garbage output when agent presents more
+
+ columns in bulk response than our local MIB file specified. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20175 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix for garbage output when agent presents more
+
+ columns in bulk response than our local MIB file specified. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20175 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix for garbage output when agent presents more
+
+ columns in bulk response than our local MIB file specified. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20175 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix for garbage output when agent presents more
+
+ columns in bulk response than our local MIB file specified. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20175 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * man/snmptrapd.8.def: Fix wrong name for config token
+
+ 'doNotRetainNotificationLogs' git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20174 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * man/snmptrapd.8.def: Fix wrong name for config token
+
+ 'doNotRetainNotificationLogs' git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20174 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * man/snmptrapd.8.def: Fix wrong name for config token
+
+ 'doNotRetainNotificationLogs' git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20174 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * man/snmptrapd.8.def: Fix wrong name for config token
+
+ 'doNotRetainNotificationLogs' git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20174 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-12 Niels Baggesen <nba@users.sourceforge.net>
+
+ * man/snmptrapd.8.def: Fix wrong name for config token
+
+ 'doNotRetainNotificationLogs' git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20174 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/sctp-mib/sctpScalars_freebsd.c: Remove bogus
+
+ (Linux) defines git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20173 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/sctp-mib/sctpScalars_freebsd.c: Remove bogus
+
+ (Linux) defines git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20173 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/sctp-mib/sctpScalars_freebsd.c: Remove bogus
+
+ (Linux) defines git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20173 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: HAVE_TM_TM_GMTOFF is HAVE_STRUCT_TM_TM_GMTOFF
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20172 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: HAVE_TM_TM_GMTOFF is HAVE_STRUCT_TM_TM_GMTOFF
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20172 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: HAVE_TM_TM_GMTOFF is HAVE_STRUCT_TM_TM_GMTOFF
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20172 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h, configure,
+ include/net-snmp/net-snmp-config.h.in: Bill Fenners patch to make
+
+ DISMAN PING and TRACEROUTE MIBS compile under Linux git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20171 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/kernel_sunos5.c, agent/mibgroup/kernel_sunos5.h,
+ agent/mibgroup/sctp-mib/sctpScalars.h,
+ agent/mibgroup/sctp-mib/sctpScalars_solaris2.c,
+ agent/mibgroup/sctp-mib/sctpTables.h,
+ agent/mibgroup/sctp-mib/sctpTables_solaris2.c: Solaris support for
+
+ SCTP-MIB git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20170 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/kernel_sunos5.c, agent/mibgroup/kernel_sunos5.h,
+ agent/mibgroup/sctp-mib/sctpScalars.h,
+ agent/mibgroup/sctp-mib/sctpScalars_solaris2.c,
+ agent/mibgroup/sctp-mib/sctpTables.h,
+ agent/mibgroup/sctp-mib/sctpTables_solaris2.c: Solaris support for
+
+ SCTP-MIB git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20170 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/kernel_sunos5.c, agent/mibgroup/kernel_sunos5.h,
+ agent/mibgroup/sctp-mib/sctpScalars.h,
+ agent/mibgroup/sctp-mib/sctpScalars_solaris2.c,
+ agent/mibgroup/sctp-mib/sctpTables.h,
+ agent/mibgroup/sctp-mib/sctpTables_solaris2.c: Solaris support for
+
+ SCTP-MIB git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20170 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: TZ is one hour off if HAVE_TM_TM_GMTOFF and
+
+ SYSV (such is Linux) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20169 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: TZ is one hour off if HAVE_TM_TM_GMTOFF and
+
+ SYSV (such is Linux) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20169 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-09 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: TZ is one hour off if HAVE_TM_TM_GMTOFF and
+
+ SYSV (such is Linux) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20169 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-01 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: CHANGES: snmplib: dtls:
+
+ overhaul of debug - drastic reduction in number of messages and msg complexity for basic dtlsudp token - previous level of detail available by adding 9:dtlsdup token git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20168 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-01 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: CHANGES: snmplib: dtls:
+
+ overhaul of debug - drastic reduction in number of messages and msg complexity for basic dtlsudp token - previous level of detail available by adding 9:dtlsdup token git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20168 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-01 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: CHANGES: snmplib: dtls:
+
+ clean up close; catch 'connect'/'disconnect' connect = we get successfully decoded snmp data disconnect = 0 byte read, ssh shutdown flag set add bio_cache flags for connected/disconnected check for null ptr before dereferencing close handling: - only send queued data if we got to connected state - seriously reduce timeout to wait for junk read. i think we shouldn't even bother - return early if cachep is NULL, so we don't have to test it repeatedly - use correct nfds value in select call git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20167 06827809-a52a-0410-b366-d66718629ded
+
+2011-04-01 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: CHANGES: snmplib: dtls:
+
+ clean up close; catch 'connect'/'disconnect' connect = we get successfully decoded snmp data disconnect = 0 byte read, ssh shutdown flag set add bio_cache flags for connected/disconnected check for null ptr before dereferencing close handling: - only send queued data if we got to connected state - seriously reduce timeout to wait for junk read. i think we shouldn't even bother - return early if cachep is NULL, so we don't have to test it repeatedly - use correct nfds value in select call git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20167 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-31 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: make trunk and
+
+ v5-6-patches closely aligned mostly changes in debug, cookie tracking git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20166 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-31 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: make trunk and
+
+ v5-6-patches closely aligned mostly changes in debug, cookie tracking git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20166 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-31 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: add cookie handling;
+
+ remove ifdef'd code git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20165 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-27 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/container_binary_array.c: Simplify array resizing somewhat
+
+ further git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20164 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-27 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/container_binary_array.c: Do not assign new_data if the
+
+ value won't be used. Reduce variable scopes. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20163 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-27 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/container_binary_array.c: It is not necessary to clear a
+
+ chunk of memory if the next action on it is to fill it so use malloc
+ instead of calloc. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20162 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-27 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/container_binary_array.c: ContainerBinaryArray really
+
+ can't hold anythng but pointers and that means the data_size field
+ is unnecessary so I removed it. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20161 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/memory/hw_mem.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/sysORTable.c, apps/snmptrapd.c,
+ snmplib/int64.c, snmplib/snmp_openssl.c, snmplib/snmp_secmod.c,
+ snmplib/snmpv3.c: Add missing include git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20160 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: Use the right feature
+
+ macro in order to make builds with --enable-ipv6
+ --with-out-transports=UDPIPv6 succeed. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20159 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c: Remove duplicate copies of
+
+ functions git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20158 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-25 Robert Story <rstory@users.sourceforge.net>
+
+ * local/net-snmp-cert: tweak debug message git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20157 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-25 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpTLSBaseDomain.c: CHANGES: snmplib: update
+
+ cert token handling - remove defX509 cert tokens (should have been removed before 5.6) - warnings for our/their tokens, recommend using local/peer git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20156 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-25 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpUDPBaseDomain.c: merge netsnmp_dtlsudp6
+ into
+
+ netsnmp_dtlsudp use addr size to tell them apart git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20155 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-25 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/snmp_transport.c: log (once) warning when deprecated
+
+ f_create_from_tstring transport function used git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20154 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-25 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpTCPDomain.c: reduce casting; make sure to
+
+ free the right pointer git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20153 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-25 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpUDPBaseDomain.c: reduce casting git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20152 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-24 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/dlmod.c: Replace a variable with a
+
+ constant. Make one more oid const. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20151 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-18 Dave Shield <dts12@users.sourceforge.net>
+
+ * CHANGES: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20147 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-18 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20146 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-18 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/snmpnetstat/Makefile.depend,
+ snmplib/Makefile.depend: make depend git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20145 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-18 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3: documentation
+
+ update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20144 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-18 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20143 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-17 Niels Baggesen <nba@users.sourceforge.net>
+
+ * man/snmpdelta.1.def: Formatting botch git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20142 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-17 Niels Baggesen <nba@users.sourceforge.net>
+
+ * man/snmpdelta.1.def: Formatting botch git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20142 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-17 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/Makefile.in: Install required mibs git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20141 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-17 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/Makefile.in: Install required mibs git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20141 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-17 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/rfclist: New RFC mibs git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20140 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-17 Niels Baggesen <nba@users.sourceforge.net>
+
+ * mibs/rfclist: New RFC mibs git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20140 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * CHANGES, NEWS: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20138 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20137 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend: make
+
+ depend git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20136 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.in, dist/net-snmp.spec,
+ perl/ASN/ASN.pm, perl/AnyData_SNMP/Storage.pm, perl/OID/OID.pm,
+ perl/SNMP/SNMP.pm, perl/TrapReceiver/TrapReceiver.pm,
+ perl/agent/Support/Support.pm, perl/agent/agent.pm,
+ perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm, snmplib/snmp_version.c:
+ Version
+
+ number update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20135 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Dave Shield <dts12@users.sourceforge.net>
+
+ * Makefile.top: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20134 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/cert_util.c: Spelling fix: reginerated -> regenerated.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20133 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/cert_util.c: Spelling fix: reginerated -> regenerated.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20133 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/cert_util.c: Simplified r19594 (leak-at-exit fix).
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20132 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/snmp_openssl.c: Fixed a compiler warning that was
+
+ introduced in r20113. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20131 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-15 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/snmp_openssl.c: Fixed a compiler warning that was
+
+ introduced in r20113. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20130 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * CHANGES, NEWS: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20128 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20127 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend: make
+
+ depend git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20126 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_agent.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3: documentation update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20125 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.in, dist/net-snmp.spec,
+ perl/ASN/ASN.pm, perl/AnyData_SNMP/Storage.pm, perl/OID/OID.pm,
+ perl/SNMP/SNMP.pm, perl/TrapReceiver/TrapReceiver.pm,
+ perl/agent/agent.pm, perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm, snmplib/snmp_version.c:
+ Version
+
+ number update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20124 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * Makefile.top: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20123 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/snmpd.c: Fix main agent select call to use the renamed API
+
+ routine. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20122 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-14 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/snmpd.c: Fix main agent select call to use the renamed API
+
+ routine. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20122 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-13 Dave Shield <dts12@users.sourceforge.net>
+
+ * include/net-snmp/library/large_fd_set.h, snmplib/large_fd_set.c:
+
+ Bring the naming of the large_fd_set select call into line with the
+ rest of the API. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20121 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-13 Dave Shield <dts12@users.sourceforge.net>
+
+ * include/net-snmp/library/large_fd_set.h, snmplib/large_fd_set.c:
+
+ Bring the naming of the large_fd_set select call into line with the
+ rest of the API. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20121 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-13 Dave Shield <dts12@users.sourceforge.net>
+
+ * include/net-snmp/library/large_fd_set.h, snmplib/large_fd_set.c:
+
+ Bring the naming of the large_fd_set select call into line with the
+ rest of the API. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20121 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-13 Dave Shield <dts12@users.sourceforge.net>
+
+ * include/net-snmp/library/large_fd_set.h, snmplib/large_fd_set.c:
+
+ CHANGES: snmplib: PATCH: 3203806: Add the function
+ netsnmp_large_select() (plus tweaks to netsnmp_large_fd_set_resize) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20120 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-12 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/container_binary_array.c: CHANGES: snmplib: realloc+init
+
+ instead of calloc inspired by patch 3195532 from Stephen Hemminger git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20119 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-12 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/container_binary_array.c: CHANGES: snmplib: realloc+init
+
+ instead of calloc inspired by patch 3195532 from Stephen Hemminger git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20119 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-12 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/container_binary_array.c: CHANGES: snmplib: realloc+init
+
+ instead of calloc inspired by patch 3195532 from Stephen Hemminger git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20119 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-12 Robert Story <rstory@users.sourceforge.net>
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _interface.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_int
+ erface.c, include/net-snmp/library/container_binary_array.h:
+
+ CHANGES: snmpd: PATCH: optimizations for large route tables from
+ Stephen Hemminger applied parts 1-3 of 4 from him (msgs to coders on 2/28/11; subject ip-forward-mib performance improvements; part 4 needs more work git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20118 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-12 Robert Story <rstory@users.sourceforge.net>
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _interface.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_int
+ erface.c: CHANGES: snmpd: PATCH: optimizations for large route
+
+ tables from Stephen Hemminger applied parts 1-3 of 4 from him (msgs to coders on 2/28/11; subject ip-forward-mib performance improvements; part 4 needs more work git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20118 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-12 Robert Story <rstory@users.sourceforge.net>
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _interface.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_int
+ erface.c: CHANGES: snmpd: PATCH: optimizations for large route
+
+ tables from Stephen Hemminger applied parts 1-3 of 4 from him (msgs to coders on 2/28/11; subject ip-forward-mib performance improvements; part 4 needs more work git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20118 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpTLSBaseDomain.c: CHANGES: snmplib: add more
+
+ openssl error cases where we check for local cert git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20117 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/transports/snmpTLSBaseDomain.c: CHANGES: snmplib: add more
+
+ openssl error cases where we check for local cert git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20117 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/disk.c: MinGW: dskTable: Report zero for
+
+ unimplemented fields instead of random data. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20116 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/disk.c: MinGW: dskTable: Report zero for
+
+ unimplemented fields instead of random data. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20116 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swrun.c: CHANGES: snmpd: fixed race
+
+ condition in hrSWRunTable Treat the reads from /proc/<pid>/*
+ carefuly, processes can exit in the middle of processing. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20115 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swrun.c: CHANGES: snmpd: fixed race
+
+ condition in hrSWRunTable Treat the reads from /proc/<pid>/*
+ carefuly, processes can exit in the middle of processing. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20115 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/disman/schedule/schedCore.c: CHANGES: snmpd: Builds
+
+ with most recent MinGW (having #define localtime_r). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20114 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/disman/schedule/schedCore.c: CHANGES: snmpd: Builds
+
+ with most recent MinGW (having #define localtime_r). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20114 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/cert_util.c, snmplib/snmp_openssl.c: CHANGES: snmplib:
+
+ refine cert debugging; remove unused function git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20113 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-11 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/cert_util.c, snmplib/snmp_openssl.c: CHANGES: snmplib:
+
+ refine cert debugging; remove unused function git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20113 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/cert_util.c: CHANGES: snmpd: BUG: 3205765: handle reconfig
+
+ for certSecName token git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20112 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Robert Story <rstory@users.sourceforge.net>
+
+ * snmplib/cert_util.c: CHANGES: snmpd: BUG: 3205765: handle reconfig
+
+ for certSecName token git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20112 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/snmpd.c: Spelling fix in a source code comment: messges ->
+
+ messages. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20111 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/snmpd.c: Spelling fix in a source code comment: messges ->
+
+ messages. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20111 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/large_fd_set.c: CHANGES: snmplib: PATCH: 3203806: Minor
+
+ performance optimization of netsnmp_large_fd_set_resize(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20110 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/large_fd_set.c: CHANGES: snmplib: PATCH: 3203806: Minor
+
+ performance optimization of netsnmp_large_fd_set_resize(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20110 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/snmpd.c: CHANGES: snmpd: PATCH: 3203806: Avoid that the main
+
+ agent processing loop - when using more than FD_SETSIZE file
+ descriptors - can cause memory corruption by invoking select(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20109 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/snmpd.c: CHANGES: snmpd: PATCH: 3203806: Avoid that the main
+
+ agent processing loop - when using more than FD_SETSIZE file
+ descriptors - can cause memory corruption by invoking select(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20109 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/large_fd_set.h, snmplib/large_fd_set.c:
+
+ CHANGES: snmplib: PATCH: 3203806: Add the function
+ netsnmp_large_select(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20108 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/large_fd_set.h, snmplib/large_fd_set.c:
+
+ CHANGES: snmplib: PATCH: 3203806: Add the function
+ netsnmp_large_select(). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20108 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c:
+
+ Fixed two compiler warnings (backported r20098 from the trunk). git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20107 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/fulltests/support/clib_build,
+ testing/fulltests/unit-tests/T009large_fd_set_clib.c: Added a
+
+ minimal unit test for netsnmp_large_fd_set. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20106 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * testing/fulltests/support/clib_build,
+ testing/fulltests/unit-tests/T009large_fd_set_clib.c: Added a
+
+ minimal unit test for netsnmp_large_fd_set. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20106 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/large_fd_set.c: CHANGES: snmplib: PATCH: 3203806: Make
+
+ netsnmp_large_fd_set_resize() clear all relevant file descriptors. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20105 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/large_fd_set.c: CHANGES: snmplib: PATCH: 3203806: Make
+
+ netsnmp_large_fd_set_resize() clear all relevant file descriptors. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20105 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: CHANGES: snmpd: BUG: 3178389: Fix inconsistent
+
+ handling of TZ offsets git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20104 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: CHANGES: snmpd: BUG: 3178389: Fix inconsistent
+
+ handling of TZ offsets git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20104 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: CHANGES: snmpd: BUG: 3178389: Fix inconsistent
+
+ handling of TZ offsets git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20104 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: CHANGES: snmpd: BUG: 3178389: Fix inconsistent
+
+ handling of TZ offsets git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20104 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmp-tc.c: CHANGES: snmpd: BUG: 3178389: Fix inconsistent
+
+ handling of TZ offsets git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20104 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * apps/Makefile.in, configure, configure.d/config_os_libs2: make
+
+ variable names match git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20099 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c:
+
+ Fixed two compiler warnings. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20098 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-10 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure, configure.d/config_os_libs2: fixed installation
+
+ variables for the optional SET programs git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20097 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/remove-unneeded-modules: chmod a+x git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20096 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/removeifdefcode.pl: print an error if the end of
+
+ a file was reached and we're not back into the state we can write;
+ otherwise a closing #ifdef is missing. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20095 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/transports/snmpUnixDomain.c: fix endif comment to match
+
+ the opening ifdef git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20094 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/removeifdefcode.pl: reset the canwrite flag for
+
+ every file git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20093 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/remove-unneeded-modules: temporarily leave in
+
+ header files git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20092 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure, configure.ac: change the unique file check to one that
+
+ is not in the mibgroup directory git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20091 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * testing/fulltests/read-only/T0141snmpv2csetfail_simple: a test for
+
+ ensuring the agent rejects SET requests with --enable-read-only git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20090 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * testing/fulltests/default/T0141snmpv2cset_simple: add back in the
+
+ stopagent command git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20089 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * testing/fulltests/unit-tests/T101pdu_type_clib.c,
+ testing/fulltests/unit-tests/T102pdu_build_clib.c,
+ testing/fulltests/unit-tests/T103pdu_parse_clib.c: unit tests
+ writen
+
+ for the read-only support converted to work with or without
+ read-only git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20088 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * testing/fulltests/default/T0141snmpv2cset_simple: don't run the
+
+ set test if no_write_support is turned on git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20087 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * testing/fulltests/default/T030snmpv3usercreation_simple: skip if
+
+ no_write_support git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20086 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * testing/fulltests/default/T0141snmpv2cset_simple: A new test to
+
+ check whether SNMPv2c SETs to sysContact work as expected git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20085 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * testing/fulltests/default/Svanyconfig: allow for v2c SET support
+
+ testing git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20084 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/vacm_conf.c: Allow for single quotes for vacm
+
+ context name quoting too git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20083 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-07 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure: fix the configure tests to include the word test in the
+
+ test git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20082 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-07 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure.d/config_os_libs2: fix the configure tests to include
+
+ the word test in the test git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20081 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-07 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/remove-unneeded-modules: Added an annoyingly long
+
+ list of exceptions that needs to be automated git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20080 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-07 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/remove-unneeded-modules: A quick perl script to
+
+ remove unneeded code modules from the modules directory git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20079 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-07 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/target/target.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+ snmplib/cert_util.c, snmplib/snmpusm.c, snmplib/vacm.c: more
+
+ improvements (removements) for featurization and read-only support git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20078 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/container_binary_array.c: CHANGES: snmplib: PATCH:
+
+ 3195537: Minor binary_array container sort optimization git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20077 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-07 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/container_binary_array.c: CHANGES: snmplib: PATCH:
+
+ 3195537: Minor binary_array container sort optimization git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20077 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-06 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c: Tabs to spaces
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20076 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-06 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c: Tabs to spaces
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20076 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-06 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ configure.d/config_os_functions: Configure check for gethostname2
+
+ Use getaddrinfo if available. Now works for Solaris (and Windows?) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20075 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-06 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ configure.d/config_os_functions: Configure check for gethostname2
+
+ Use getaddrinfo if available. Now works for Solaris (and Windows?) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20075 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-05 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * apps/snmptest.c: Add dropped ||'s from r20072 git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20074 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-05 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.h,
+ agent/mibgroup/disman/nslookup/lookupResultsTable.c: Clean up, and
+
+ cosolidate result table row creation into a new function. Saves 200
+ lines of code, with (hopefully) no functionality change git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20073 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-05 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.h,
+ agent/mibgroup/disman/nslookup/lookupResultsTable.c: Clean up, and
+
+ cosolidate result table row creation into a new function. Saves 200
+ lines of code, with (hopefully) no functionality change git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20073 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-05 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * apps/Makefile.in, apps/snmptest.c, configure,
+ configure.d/config_os_libs2: don't build SET related apps with
+
+ --enable-read-only git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20072 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-05 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/baby_steps.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/mibII/snmp_mib.c, agent/mibgroup/mibII/updates.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_interface.c, agent/mibgroup/target/target.c,
+ include/net-snmp/agent/baby_steps.h,
+ include/net-snmp/agent/snmp_agent.h, snmplib/snmp_client.c: fix
+
+ issues with combining --enable-minimalist and --enable-read-only git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20071 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-05 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/find-unused-code: better output for finding
+
+ object symbols. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20070 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Mike Baer <baerm@susers.sourceforge.net>
+
+ * local/minimalist/removeifdefcode.pl: last commit: changes to allow
+
+ parsing of featuers files to get all minimalist tags which are then
+ processed for removal this commit: changed comments/white space git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20069 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Mike Baer <baerm@susers.sourceforge.net>
+
+ * agent/mibgroup/agent/extend.c: added no_write support to extend.c
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20068 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Mike Baer <baerm@susers.sourceforge.net>
+
+ * agent/helpers/instance.c: Added missing #endif comment for remove
+
+ ifdef code support git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20067 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Mike Baer <baerm@susers.sourceforge.net>
+
+ * local/minimalist/removeifdefcode.pl: added changes to allow code
+
+ removal in-place (i.e. does not require creating a new file) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20066 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Mike Baer <baerm@susers.sourceforge.net>
+
+ * local/minimalist/ignore.regexp: adding a ignore.regexp file that
+
+ can be used with removeifdefcode.pl git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20065 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-makedocs: add a outgoing link to the
+
+ parent marking page git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20064 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-makedocs: Added a wiki output mode
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20063 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-makedocs: Note that the org output is the
+
+ default in the help output git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20062 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/vmstat_linux.c: CHANGES: snmpd: fixed
+
+ 'truncating integer value > 32 bits' in UCD-SNMP-MIB::systemStats on
+ Linux git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20061 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/vmstat_linux.c: CHANGES: snmpd: fixed
+
+ 'truncating integer value > 32 bits' in UCD-SNMP-MIB::systemStats on
+ Linux git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20061 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/vmstat_linux.c: CHANGES: snmpd: fixed
+
+ 'truncating integer value > 32 bits' in UCD-SNMP-MIB::systemStats on
+ Linux git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20061 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/vmstat_linux.c: CHANGES: snmpd: fixed
+
+ 'truncating integer value > 32 bits' in UCD-SNMP-MIB::systemStats on
+ Linux git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20061 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/agent_read_config.c, agent/helpers/watcher.c,
+ agent/mibgroup/agentx/master.c, agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_dat
+ a_access.c, agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/usmUser.c, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/utilities/iquery.c, snmplib/snmp_api.c:
+
+ reclassification of the remaining features into a hierarchy git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20060 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_openssl.c: don't double-declare cert_utils git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20059 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c: the
+
+ ipaddress_linux was incorrectly marked as needing cert_fingerprints git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20058 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/agent_registry.c: put the agent_registry feature in
+
+ libnetsnmpagent. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20057 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/libsnmp_dll/libsnmp.def: CHANGES: Win32: Deprecated
+
+ libsnmp.def - add NETSNMP_IMPORT to function declarations instead to
+ export a function from netsnmp.dll. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20056 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/libsnmp_dll/libsnmp.def: CHANGES: Win32: Deprecated
+
+ libsnmp.def - add NETSNMP_IMPORT to function declarations instead to
+ export a function from netsnmp.dll. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20056 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_debug.h: Moved a source code comment
+
+ such that it is again immediately above the function declarations it
+ applies to. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20055 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmp_debug.h: Added missing
+ NETSNMP_IMPORT
+
+ declarations. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20054 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmp_debug.h: Added missing
+ NETSNMP_IMPORT
+
+ declarations. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20054 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/libagent/libagent.def, win32/libucdmibs/libucdmibs.def:
+
+ Removed two obsolete Win32 files. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20053 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/libagent/libagent.def, win32/libucdmibs/libucdmibs.def:
+
+ Removed two obsolete Win32 files. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20053 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/transports/snmpIPv6BaseDomain.c: Trivial comment fix:
+
+ snmpIPv6BaseDomain.c contains IPv6 base transport support functions
+ instead of IPv4. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20052 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-03 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * snmplib/transports/snmpIPv6BaseDomain.c: Trivial comment fix:
+
+ snmpIPv6BaseDomain.c contains IPv6 base transport support functions
+ instead of IPv4. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20052 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/config.h: Removed an obsolete file. git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20050 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_secmod.h, win32/snmpsm_shutdown.h,
+ win32/snmpv3-security-includes.h: Builds again with Visual Studio
+
+ after the introduction of the "feature" feature. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20049 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * win32/snmpsm_init.h: Removed a misleading comment. git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20048 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * configure, configure.d/config_os_libs2: Correct the check of
+
+ wether usm security is enabled. Regenerate configure. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20047 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * include/net-snmp/net-snmp-config.h.in: Regenerate git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20046 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_dat
+ a_access.c: Add missing dependencies git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20045 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/snmpusm.c: Ignore the return value from
+
+ snmp_increment_statistic git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20044 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/container.c: Split the container_compare_functions feature
+
+ into container_compare_mem, container_compare_long,
+ container_compare_ulong, container_compare_int32 and
+ container_compare_uint32 Unify the structure of the compare
+ functions further. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20043 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/container.c: Change the spelling of the
+
+ container_compare_cstring feature to container_ncompare_cstring as
+ that is the function that is guarded by that attribute. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20042 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_api.h: Add the missing replacement
+
+ macro for snmp_init_statistics git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20041 06827809-a52a-0410-b366-d66718629ded
+
+2011-03-02 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * include/net-snmp/library/snmp_api.h: snmp_increment_statistic_by
+
+ takes two arguments so let the replacement macro take two arguments
+ as well. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20040 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-27 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c: Fix typo in
+
+ r19990 git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20039 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * local/minimalist/feature-check: Remove lines starting with #define
+
+ in the output of the preprocessor When gcc -E is called with -ggdb3
+ (or -dD) then all the macro definitions are passed through the
+ preprocessor and that messes up our processing. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20038 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * Makefile.rules: Put the generated file in the build tree, not the
+
+ source tree. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20037 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/agent_trap.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/memory/hw_mem.c,
+ agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _interface.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_int
+ erface.c, agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_inter
+ face.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interfa
+ ce.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le_interface.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_interface.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interf
+ ace.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.
+ c, agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.
+ c: moved a bunch of features into the libnetsnmpmibs feature set.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20036 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/agent_handler.c, agent/agent_index.c,
+ agent/agent_registry.c, agent/agent_trap.c,
+ agent/helpers/all_helpers.c, agent/helpers/cache_handler.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c, agent/helpers/table_row.c,
+ agent/snmp_agent.c, local/minimalist/sizetests, snmplib/mib.c:
+
+ classified libnetsnmpagent features git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20035 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: reverse the order of the libraries
+
+ (snmplib first) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20034 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: output cleanup and added agent-mibs
+
+ and logging options git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20033 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: add a default set of arguments
+
+ calculate resulting sizes git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20032 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/dir_utils.c: Added a missing ; git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20031 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: prefix the output files with a number
+
+ to indicate order git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20030 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: save the results of the system
+
+ executions git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20029 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: enable building of the resulting
+
+ combinations Add a -n flag for dry-runs git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20028 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: enable the -t tag for limiting types
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20027 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: Added argument parsing and arguments
+
+ for selecting and listing types git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20026 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: generate configure script arguments
+
+ from specs git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20025 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: added a bunch of new feature options
+
+ and cleaned up a bit git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20024 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/sizetests: added a new (not yet working) script
+
+ to test sizing of various argument sets git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20023 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/dlmod.c: Simplify the code. Unify some
+
+ debug logs. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20022 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/dlmod.c: Reduce the scope of a few
+
+ variables git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20021 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/dlmod.c: Remove some unused includes.
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20020 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/dlmod.c: Make it possible to
+
+ initialize/uninitialize modules with 64 character names and not
+ suffer wild writes. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20019 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/dlmod.c: Code restructuring - put the
+
+ managed routines before the managment code. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20018 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/dlmod.c, agent/mibgroup/ucd-snmp/dlmod.h:
+
+ CHANGES: libnetsnmpmibs: Make all functions in the dlmod module that
+ don't have to be public static git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20017 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-26 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/dlmod.c: Rename deinit_dlmod to
+
+ shutdown_dlmod as that is what it really is about. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20016 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Mike Baer <baerm@susers.sourceforge.net>
+
+ * agent/mibgroup/agent/nsVacmAccessTable.c: adding minimalist ifdefs
+
+ to net-snmp-vacm mib git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20015 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-makedocs: properly handle twin children;
+
+ also sort the child list alphabetically. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20014 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_logging.c: I suppose logging should probably default
+
+ to being a wanted option :-) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20013 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-makedocs: org-link the files in the
+
+ output git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20012 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.rules, agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ local/minimalist/feature-check, snmplib/Makefile.in: make the
+
+ features-check script track the full source path git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20011 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-makedocs: change the function names to
+
+ match that it's printing to org-mode at the moment. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20010 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/file_utils.c, snmplib/mib.c, snmplib/oid_stash.c,
+ snmplib/snmp_api.c, snmplib/snmp_logging.c, snmplib/tools.c: last
+ of
+
+ the feature classification in libnetsnmp git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20009 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/keytools.c, snmplib/lcd_time.c, snmplib/scapi.c: make the
+
+ usm_support utilities self-declare themselves as children to make
+ sure they're properly included during dependency ordering git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20008 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/callback.c, snmplib/cert_util.c, snmplib/check_varbind.c,
+ snmplib/container.c, snmplib/data_list.c, snmplib/default_store.c,
+ snmplib/fd_event_manager.c, snmplib/file_utils.c,
+ snmplib/keytools.c, snmplib/snmpusm.c: superstructuralizationizing
+
+ the features git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20007 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/read_config.c, snmplib/snmp-tc.c, snmplib/snmp_client.c,
+ snmplib/snmp_enum.c, snmplib/snmp_transport.c, snmplib/system.c,
+ snmplib/text_utils.c, snmplib/tools.c,
+ snmplib/transports/snmpUnixDomain.c, snmplib/ucd_compat.c:
+
+ significant parent/child feature classification git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20006 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_api.c, snmplib/snmpusm.c: classify a few components
+
+ into a top-level libnetsnmp component git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20005 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/keytools.c, snmplib/lcd_time.c, snmplib/scapi.c,
+ snmplib/snmpusm.c: structurize the usm features git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20004 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/container.c, snmplib/container_iterator.c,
+ snmplib/container_list_ssll.c, snmplib/container_null.c,
+ snmplib/dir_utils.c: structure the container features into a
+
+ hierarchy git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20003 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_logging.c: group the logging handlers under a parent
+
+ feature git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20002 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-makedocs: fix the expect argument count
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20001 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-makedocs: fix the name of the expected
+
+ input file git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20000 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-makedocs: argument parsing and usage()
+
+ output git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19999 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/stash_cache.c, agent/helpers/stash_to_next.c,
+ agent/helpers/table_dataset.c, agent/helpers/table_iterator.c,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/mibII/ipCidrRouteTable.c, snmplib/oid_stash.c: -
+ added two oid_stash functions as individual features - cleaned up
+ some warnings in the table_iterator code git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19998 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * dist/makerelease.xml: Fix the command to create a new SVN tag line
+ (Having brought the structure of the 5.5.x branch into line with
+ the other branches, the previous command is now wrong for *all*
+ branches, rather than just most of them!) git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19997 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * dist/makerelease.xml: Fix the command to create a new SVN tag line
+ (Having brought the structure of the 5.5.x branch into line with
+ the other branches, the previous command is now wrong for *all*
+ branches, rather than just most of them!) git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@19997 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * dist/makerelease.xml: Fix the command to create a new SVN tag line
+ (Having brought the structure of the 5.5.x branch into line with
+ the other branches, the previous command is now wrong for *all*
+ branches, rather than just most of them!) git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19997 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * dist/makerelease.xml: Fix the command to create a new SVN tag line
+ (Having brought the structure of the 5.5.x branch into line with
+ the other branches, the previous command is now wrong for *all*
+ branches, rather than just most of them!) git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19997 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3: documentation
+
+ update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19995 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, perl/ASN/ASN.pm, perl/AnyData_SNMP/Storage.pm,
+ perl/OID/OID.pm, perl/SNMP/SNMP.pm,
+ perl/TrapReceiver/TrapReceiver.pm, perl/agent/Support/Support.pm,
+ perl/agent/agent.pm, perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm: Version number update
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19994 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19993 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, perl/ASN/ASN.pm, perl/AnyData_SNMP/Storage.pm,
+ perl/OID/OID.pm, perl/SNMP/SNMP.pm,
+ perl/TrapReceiver/TrapReceiver.pm, perl/agent/Support/Support.pm,
+ perl/agent/agent.pm, perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm: Version number update
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19992 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmpv3.c: Avoid a possible crash if the engineID is not
+
+ available or set. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@19991 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmpv3.c: Avoid a possible crash if the engineID is not
+
+ available or set. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@19991 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmpv3.c: Avoid a possible crash if the engineID is not
+
+ available or set. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19991 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmpv3.c: Avoid a possible crash if the engineID is not
+
+ available or set. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19991 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Dave Shield <dts12@users.sourceforge.net>
+
+ * snmplib/snmpv3.c: Avoid a possible crash if the engineID is not
+
+ available or set. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19991 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-25 Mike Baer <baerm@susers.sourceforge.net>
+
+ * agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteObjectsTable.h,
+ agent/mibgroup/disman/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/mteTriggerBooleanTable.h,
+ agent/mibgroup/disman/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/mteTriggerDeltaTable.h,
+ agent/mibgroup/disman/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/mteTriggerExistenceTable.h,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerTable.h,
+ agent/mibgroup/disman/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/mteTriggerThresholdTable.h,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.h: adding ifdef code
+
+ for minimalist support of diffman mib git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19990 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-24 Mike Baer <baerm@susers.sourceforge.net>
+
+ * agent/mibgroup/host/hrSWRunTable.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/host/hr_system.h:
+
+ Adding minimalist ifdefs to host resource mib git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19989 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-24 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_iterator.c, snmplib/data_list.c: mark the
+
+ data_list function that's only used in stach_caching as a feature git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19988 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-24 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_iterator.c: whoops. git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19987 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-24 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_iterator.c: more missing stash references
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19986 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-24 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_iterator.c: ifdefed/featured out a missing
+
+ stash_cache section git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19985 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-24 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/util_funcs.c: make the prefix_info more
+
+ hierarchical and sub-feature the unused one git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19984 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-24 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/find-unused-code: do include the perl/python code
+
+ when searching for files git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19983 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-24 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/table_tdata.c: make the semi-used table_tdata
+
+ functions children of table_tdata_all instead of just table_tdata git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19982 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * agent/helpers/table_tdata.c: Correct typo git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19981 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Magnus Fromreide <magfr@users.sourceforge.net>
+
+ * snmplib/parse.c: Correct typo git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19980 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/snmp_vars.c: proper include of prototype git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19979 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * configure, configure.d/config_modules_agent,
+ configure.d/config_modules_transports,
+ configure.d/config_project_with_enable: compat some feature header
+
+ chicken and egg problems git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19978 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/snmp_vars.c: Include required prototype git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19977 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/snmpusm.c: unsigned juggling to remove warnings git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19976 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_dat
+ a_access.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c:
+
+ unsigned juggling to remove warnings git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19975 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_dat
+ a_access.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c:
+
+ unsigned juggling to remove warnings git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19975 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib.h: Enable (probably forgotten)
+
+ ipAddressPrefixTable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19974 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib.h: Enable (probably forgotten)
+
+ ipAddressPrefixTable git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19974 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/minimalist/feature-check,
+ local/minimalist/feature-makedocs,
+ local/minimalist/feature-remove,
+ local/minimalist/find-unused-code,
+ local/minimalist/removeifdefcode.pl: added other missing 'new'
+ files
+
+ not included in the minimalist patch file git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19973 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c: Loading
+
+ IPv6 data is a no-no when IPv6 not enabled git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19972 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c: Loading
+
+ IPv6 data is a no-no when IPv6 not enabled git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19972 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix bug 3118631: snmptable segfaults if index
+
+ contains : character git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@19971 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix bug 3118631: snmptable segfaults if index
+
+ contains : character git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@19971 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix bug 3118631: snmptable segfaults if index
+
+ contains : character git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19971 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix bug 3118631: snmptable segfaults if index
+
+ contains : character git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19971 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * apps/snmptable.c: Fix bug 3118631: snmptable segfaults if index
+
+ contains : character git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19971 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * include/net-snmp/system/freebsd8.h: FreeBSD 8 support git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@19970 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * include/net-snmp/system/freebsd8.h: FreeBSD 8 support git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19970 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * include/net-snmp/system/freebsd8.h: FreeBSD 8 support git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19970 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Niels Baggesen <nba@users.sourceforge.net>
+
+ * include/net-snmp/system/freebsd8.h: FreeBSD 8 support git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19970 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/net-snmp-features.h: added missing
+
+ net-snmp-features.h git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19969 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-23 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.in, Makefile.rules, Makefile.top, agent/Makefile.in,
+ agent/agent_handler.c, agent/agent_index.c,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/helpers/all_helpers.c,
+ agent/helpers/baby_steps.c, agent/helpers/cache_handler.c,
+ agent/helpers/instance.c, agent/helpers/mode_end_call.c,
+ agent/helpers/multiplexer.c, agent/helpers/old_api.c,
+ agent/helpers/read_only.c, agent/helpers/row_merge.c,
+ agent/helpers/scalar.c, agent/helpers/scalar_group.c,
+ agent/helpers/snmp_get_statistic.c, agent/helpers/stash_cache.c,
+ agent/helpers/stash_to_next.c, agent/helpers/table.c,
+ agent/helpers/table_array.c, agent/helpers/table_container.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c, agent/helpers/table_row.c,
+ agent/helpers/table_tdata.c, agent/helpers/watcher.c,
+ agent/mibgroup/Makefile.in, agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/agent/extend.c, agent/mibgroup/agent/nsCache.c,
+ agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/agent/nsModuleTable.c,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsVacmAccessTable.c,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/client.c, agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteEventConf.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/expr/expErrorTable.c,
+ agent/mibgroup/disman/expr/expExpressionConf.c,
+ agent/mibgroup/disman/expr/expExpressionTable.c,
+ agent/mibgroup/disman/expr/expObjectConf.c,
+ agent/mibgroup/disman/expr/expObjectTable.c,
+ agent/mibgroup/disman/expression/expExpressionTable.c,
+ agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interfac
+ e.c, agent/mibgroup/examples/data_set.c,
+ agent/mibgroup/examples/delayed_instance.c,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/examples/netSnmpHostsTable_checkfns.c,
+ agent/mibgroup/examples/scalar_int.c,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/cpu/cpu_kinfo.c,
+ agent/mibgroup/hardware/cpu/cpu_nlist.c,
+ agent/mibgroup/hardware/cpu/cpu_perfstat.c,
+ agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/memory/hw_mem.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/host/data_access/swinst_darwin.c,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c,
+ agent/mibgroup/host/data_access/swinst_rpm.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/hr_filesys.c, agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hrh_filesys.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ .c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _interface.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_int
+ erface.c, agent/mibgroup/ip-mib/data_access/arp_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_
+ access.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_inter
+ face.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_dat
+ a_access.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_int
+ erface.c, agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_dat
+ a_access.c,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_int
+ erface.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interfa
+ ce.c, agent/mibgroup/ip-mib/ip_scalars.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interfa
+ ce.c,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interfa
+ ce.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le_interface.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/ipCidrRouteTable.c,
+ agent/mibgroup/mibII/ipv6.c, agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/setSerialNo.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.h,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c
+ , agent/mibgroup/sctp-mib/sctpTables_common.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_data_access.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_interface.c,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_interface.c, agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.c,
+ agent/mibgroup/snmpv3/usmUser.c, agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/snmpv3mibs.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.h,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/target/target_counters.h,
+ agent/mibgroup/target/target_counters_5_5.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_common.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interf
+ ace.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.
+ c, agent/mibgroup/testhandler.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSN
+ Table.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.
+ c, agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c, agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.
+ c, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/utilities/iquery.c, agent/mibgroup/winExtDLL.c,
+ agent/snmp_agent.c, agent/snmp_vars.c, agent/snmpd.c,
+ apps/Makefile.in, apps/agentxtrap.c,
+ apps/snmpnetstat/Makefile.in, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/netstat.h, apps/snmpnetstat/route.c,
+ apps/snmptest.c, apps/snmptranslate.c, apps/snmptrapd.c,
+ apps/snmptrapd_handlers.c, apps/snmptrapd_sql.c, configure,
+ configure.ac, configure.d/config_modules_agent,
+ configure.d/config_modules_lib,
+ configure.d/config_modules_security_modules,
+ configure.d/config_modules_transports,
+ configure.d/config_os_libs2,
+ configure.d/config_project_perl_python,
+ configure.d/config_project_with_enable,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmpksm.h,
+ include/net-snmp/library/snmptsm.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/snmpv3.h,
+ include/net-snmp/net-snmp-config.h.in, perl/OID/OID.xs,
+ perl/SNMP/SNMP.xs, perl/agent/agent.xs, snmplib/Makefile.in,
+ snmplib/callback.c, snmplib/cert_util.c, snmplib/check_varbind.c,
+ snmplib/container.c, snmplib/container_iterator.c,
+ snmplib/container_list_ssll.c, snmplib/container_null.c,
+ snmplib/data_list.c, snmplib/default_store.c, snmplib/dir_utils.c,
+ snmplib/fd_event_manager.c, snmplib/file_utils.c,
+ snmplib/int64.c, snmplib/keytools.c, snmplib/lcd_time.c,
+ snmplib/mib.c, snmplib/oid_stash.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/scapi.c, snmplib/snmp-tc.c,
+ snmplib/snmp_api.c, snmplib/snmp_client.c, snmplib/snmp_enum.c,
+ snmplib/snmp_logging.c, snmplib/snmp_openssl.c,
+ snmplib/snmp_parse_args.c, snmplib/snmp_secmod.c,
+ snmplib/snmp_transport.c, snmplib/snmpksm.c, snmplib/snmptsm.c,
+ snmplib/snmpusm.c, snmplib/snmpv3.c, snmplib/system.c,
+ snmplib/text_utils.c, snmplib/tools.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUnixDomain.c, snmplib/ucd_compat.c,
+ testing/fulltests/default/Sv3config,
+ testing/fulltests/default/Sv3usmconfigbase,
+ testing/fulltests/default/Sv3vacmconfig,
+ testing/fulltests/default/T049snmpv3inform_simple,
+ testing/fulltests/default/T049snmpv3informauth_simple,
+ testing/fulltests/default/T057trapdauthtest2_simple,
+ testing/fulltests/default/T057trapdauthtest3_simple,
+ testing/fulltests/default/T057trapdauthtest_simple,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T113agentxtrap_simple,
+ testing/fulltests/default/T114agentxagentxtrap_simple: NEWS:
+
+ packaging: Enable micro-and-macro-feature management within
+ Net-SNMP; this adds a number of new flags to configure
+ (--enable-minimalist and --enable-read-only). These changes are
+ designed to remove much of the inline code that isn't always
+ necessary or desired. Scripts exist (and will be improved) to stip
+ out unused components from the code entirely to enable a shorter
+ review process for upgrading to new releases. This work was done by
+ Wes Hardaker and Michael Baer from SPARTA, Inc. but is being checked
+ in as a large patch since converting the micro patches from git to
+ svn turend out to be impossible git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19968 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-22 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ: use the wiki URL instead of the tutorial-5 URL for the
+
+ snmptrap tutorial git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19967 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swinst.c: Revert a bogus change that crept
+
+ into the code. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19966 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * AGENT.txt, CHANGES, COPYING, ChangeLog, CodingStyle,
+ EXAMPLE.conf.def, FAQ, INSTALL, Makefile.am, Makefile.in,
+ Makefile.rules, Makefile.top, NEWS, PORTING, README,
+ README.Panasonic_AM3X.txt, README.agent-mibs, README.agentx,
+ README.aix, README.hpux11, README.irix, README.krb5, README.osX,
+ README.snmpv3, README.solaris, README.sql, README.thread,
+ README.tru64, README.win32, TODO, acconfig.h, aclocal.m4,
+ agent/Makefile.depend, agent/Makefile.in, agent/agent_handler.c,
+ agent/agent_index.c, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/agent_sysORTable.c,
+ agent/agent_trap.c, agent/auto_nlist.c, agent/autonlist.h,
+ agent/helpers/Makefile.depend, agent/helpers/Makefile.in,
+ agent/helpers/all_helpers.c, agent/helpers/baby_steps.c,
+ agent/helpers/bulk_to_next.c, agent/helpers/cache_handler.c,
+ agent/helpers/debug_handler.c, agent/helpers/instance.c,
+ agent/helpers/mode_end_call.c, agent/helpers/multiplexer.c,
+ agent/helpers/null.c, agent/helpers/old_api.c,
+ agent/helpers/read_only.c, agent/helpers/row_merge.c,
+ agent/helpers/scalar.c, agent/helpers/scalar_group.c,
+ agent/helpers/serialize.c, agent/helpers/stash_cache.c,
+ agent/helpers/stash_to_next.c, agent/helpers/table.c,
+ agent/helpers/table_array.c, agent/helpers/table_container.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c,
+ agent/helpers/table_generic.c, agent/helpers/table_iterator.c,
+ agent/helpers/table_row.c, agent/helpers/table_tdata.c,
+ agent/helpers/watcher.c, agent/kernel.c, agent/kernel.h,
+ agent/m2m.h, agent/mib_modules.c, agent/mibgroup/Makefile.depend,
+ agent/mibgroup/Makefile.in, agent/mibgroup/README,
+ agent/mibgroup/README.smux, agent/mibgroup/Rmon.h,
+ agent/mibgroup/Rmon/README, agent/mibgroup/Rmon/agutil.c,
+ agent/mibgroup/Rmon/agutil.h, agent/mibgroup/Rmon/agutil_api.h,
+ agent/mibgroup/Rmon/alarm.c, agent/mibgroup/Rmon/alarm.h,
+ agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/Rmon/alarmTable.h, agent/mibgroup/Rmon/event.c,
+ agent/mibgroup/Rmon/event.h, agent/mibgroup/Rmon/history.c,
+ agent/mibgroup/Rmon/history.h, agent/mibgroup/Rmon/row_api.h,
+ agent/mibgroup/Rmon/rows.c, agent/mibgroup/Rmon/rows.h,
+ agent/mibgroup/Rmon/statistics.c,
+ agent/mibgroup/Rmon/statistics.h,
+ agent/mibgroup/Rmon/test_alarm.sh,
+ agent/mibgroup/Rmon/test_hist.sh, agent/mibgroup/agent/extend.c,
+ agent/mibgroup/agent/extend.h, agent/mibgroup/agent/nsCache.c,
+ agent/mibgroup/agent/nsCache.h, agent/mibgroup/agent/nsDebug.c,
+ agent/mibgroup/agent/nsDebug.h, agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/agent/nsLogging.h,
+ agent/mibgroup/agent/nsModuleTable.c,
+ agent/mibgroup/agent/nsModuleTable.h,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsTransactionTable.h,
+ agent/mibgroup/agent/nsVacmAccessTable.c,
+ agent/mibgroup/agent/nsVacmAccessTable.h,
+ agent/mibgroup/agent_mibs.h, agent/mibgroup/agentx.h,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/agentx_config.h,
+ agent/mibgroup/agentx/client.c, agent/mibgroup/agentx/client.h,
+ agent/mibgroup/agentx/master.c, agent/mibgroup/agentx/master.h,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_admin.h,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/protocol.h,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/agentx/subagent.h,
+ agent/mibgroup/default_modules.h, agent/mibgroup/disman.h,
+ agent/mibgroup/disman/event-mib.h, agent/mibgroup/disman/event.h,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteEvent.h,
+ agent/mibgroup/disman/event/mteEventConf.c,
+ agent/mibgroup/disman/event/mteEventConf.h,
+ agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.h,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.h,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteEventTable.h,
+ agent/mibgroup/disman/event/mteObjects.c,
+ agent/mibgroup/disman/event/mteObjects.h,
+ agent/mibgroup/disman/event/mteObjectsConf.c,
+ agent/mibgroup/disman/event/mteObjectsConf.h,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteObjectsTable.h,
+ agent/mibgroup/disman/event/mteScalars.c,
+ agent/mibgroup/disman/event/mteScalars.h,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/event/mteTrigger.h,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.h,
+ agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/event/mteTriggerConf.h,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.h,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.h,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.h,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.h,
+ agent/mibgroup/disman/expr/expErrorTable.c,
+ agent/mibgroup/disman/expr/expErrorTable.h,
+ agent/mibgroup/disman/expr/expExpression.c,
+ agent/mibgroup/disman/expr/expExpression.h,
+ agent/mibgroup/disman/expr/expExpressionConf.c,
+ agent/mibgroup/disman/expr/expExpressionConf.h,
+ agent/mibgroup/disman/expr/expExpressionTable.c,
+ agent/mibgroup/disman/expr/expExpressionTable.h,
+ agent/mibgroup/disman/expr/expObject.c,
+ agent/mibgroup/disman/expr/expObject.h,
+ agent/mibgroup/disman/expr/expObjectConf.c,
+ agent/mibgroup/disman/expr/expObjectConf.h,
+ agent/mibgroup/disman/expr/expObjectTable.c,
+ agent/mibgroup/disman/expr/expObjectTable.h,
+ agent/mibgroup/disman/expr/expScalars.c,
+ agent/mibgroup/disman/expr/expScalars.h,
+ agent/mibgroup/disman/expr/expValue.c,
+ agent/mibgroup/disman/expr/expValue.h,
+ agent/mibgroup/disman/expr/expValueTable.c,
+ agent/mibgroup/disman/expr/expValueTable.h,
+ agent/mibgroup/disman/expr/exp_enum.h,
+ agent/mibgroup/disman/expression-mib.h,
+ agent/mibgroup/disman/expression.h,
+ agent/mibgroup/disman/expression/expErrorTable.c,
+ agent/mibgroup/disman/expression/expErrorTable.h,
+ agent/mibgroup/disman/expression/expExpressionTable.c,
+ agent/mibgroup/disman/expression/expExpressionTable.h,
+ agent/mibgroup/disman/expression/expObjectTable.c,
+ agent/mibgroup/disman/expression/expObjectTable.h,
+ agent/mibgroup/disman/expression/expValueTable.c,
+ agent/mibgroup/disman/expression/expValueTable.h,
+ agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteEventNotificationTable.h,
+ agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/disman/mteEventTable.h,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteObjectsTable.h,
+ agent/mibgroup/disman/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/mteTriggerBooleanTable.h,
+ agent/mibgroup/disman/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/mteTriggerDeltaTable.h,
+ agent/mibgroup/disman/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/mteTriggerExistenceTable.h,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerTable.h,
+ agent/mibgroup/disman/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/mteTriggerThresholdTable.h,
+ agent/mibgroup/disman/nslookup-mib.h,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.h,
+ agent/mibgroup/disman/nslookup/lookupResultsTable.c,
+ agent/mibgroup/disman/nslookup/lookupResultsTable.h,
+ agent/mibgroup/disman/old-event-mib.h,
+ agent/mibgroup/disman/ping-mib.h,
+ agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/ping/pingProbeHistoryTable.c,
+ agent/mibgroup/disman/ping/pingProbeHistoryTable.h,
+ agent/mibgroup/disman/ping/pingResultsTable.c,
+ agent/mibgroup/disman/ping/pingResultsTable.h,
+ agent/mibgroup/disman/schedule.h,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/disman/schedule/schedConf.h,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/disman/schedule/schedCore.h,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/disman/schedule/schedTable.h,
+ agent/mibgroup/disman/traceroute-mib.h,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteHopsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteHopsTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.h,
+ agent/mibgroup/etherlike-mib.h,
+ agent/mibgroup/etherlike-mib/data_access/dot3stats.h,
+ agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable.h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_acc
+ ess.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_acc
+ ess.h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get
+ .c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get
+ .h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set
+ .c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set
+ .h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interfac
+ e.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interfac
+ e.h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h,
+ agent/mibgroup/examples.h, agent/mibgroup/examples/Makefile.dlmod,
+ agent/mibgroup/examples/data_set.c,
+ agent/mibgroup/examples/data_set.h,
+ agent/mibgroup/examples/delayed_instance.c,
+ agent/mibgroup/examples/delayed_instance.h,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/example.h,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/examples/netSnmpHostsTable.h,
+ agent/mibgroup/examples/netSnmpHostsTable_access.c,
+ agent/mibgroup/examples/netSnmpHostsTable_access.h,
+ agent/mibgroup/examples/netSnmpHostsTable_checkfns.c,
+ agent/mibgroup/examples/netSnmpHostsTable_checkfns.h,
+ agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c,
+ agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.h,
+ agent/mibgroup/examples/netSnmpHostsTable_columns.h,
+ agent/mibgroup/examples/netSnmpHostsTable_enums.h,
+ agent/mibgroup/examples/notification.c,
+ agent/mibgroup/examples/notification.h,
+ agent/mibgroup/examples/scalar_int.c,
+ agent/mibgroup/examples/scalar_int.h,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/examples/ucdDemoPublic.cmds,
+ agent/mibgroup/examples/ucdDemoPublic.conf,
+ agent/mibgroup/examples/ucdDemoPublic.h,
+ agent/mibgroup/examples/watched.c,
+ agent/mibgroup/examples/watched.h, agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/cpu/cpu.h,
+ agent/mibgroup/hardware/cpu/cpu_kerndata.c,
+ agent/mibgroup/hardware/cpu/cpu_kerndata.h,
+ agent/mibgroup/hardware/cpu/cpu_kinfo.c,
+ agent/mibgroup/hardware/cpu/cpu_kinfo.h,
+ agent/mibgroup/hardware/cpu/cpu_kstat.c,
+ agent/mibgroup/hardware/cpu/cpu_kstat.h,
+ agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.h,
+ agent/mibgroup/hardware/cpu/cpu_mach.c,
+ agent/mibgroup/hardware/cpu/cpu_mach.h,
+ agent/mibgroup/hardware/cpu/cpu_nlist.c,
+ agent/mibgroup/hardware/cpu/cpu_nlist.h,
+ agent/mibgroup/hardware/cpu/cpu_null.c,
+ agent/mibgroup/hardware/cpu/cpu_null.h,
+ agent/mibgroup/hardware/cpu/cpu_pcp.c,
+ agent/mibgroup/hardware/cpu/cpu_pcp.h,
+ agent/mibgroup/hardware/cpu/cpu_perfstat.c,
+ agent/mibgroup/hardware/cpu/cpu_perfstat.h,
+ agent/mibgroup/hardware/cpu/cpu_pstat.c,
+ agent/mibgroup/hardware/cpu/cpu_pstat.h,
+ agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/cpu/cpu_sysctl.h,
+ agent/mibgroup/hardware/cpu/cpu_sysinfo.c,
+ agent/mibgroup/hardware/cpu/cpu_sysinfo.h,
+ agent/mibgroup/hardware/fsys.h,
+ agent/mibgroup/hardware/fsys/fsys_getfsstats.c,
+ agent/mibgroup/hardware/fsys/fsys_mntctl.c,
+ agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.h,
+ agent/mibgroup/hardware/fsys/mnttypes.h,
+ agent/mibgroup/hardware/fsys/mounts.h,
+ agent/mibgroup/hardware/memory.h,
+ agent/mibgroup/hardware/memory/hw_mem.c,
+ agent/mibgroup/hardware/memory/hw_mem.h,
+ agent/mibgroup/hardware/memory/memory_aix.c,
+ agent/mibgroup/hardware/memory/memory_darwin.c,
+ agent/mibgroup/hardware/memory/memory_dynix.c,
+ agent/mibgroup/hardware/memory/memory_freebsd.c,
+ agent/mibgroup/hardware/memory/memory_hpux.c,
+ agent/mibgroup/hardware/memory/memory_irix.c,
+ agent/mibgroup/hardware/memory/memory_linux.c,
+ agent/mibgroup/hardware/memory/memory_linux.h,
+ agent/mibgroup/hardware/memory/memory_netbsd.c,
+ agent/mibgroup/hardware/memory/memory_null.c,
+ agent/mibgroup/hardware/memory/memory_solaris.c,
+ agent/mibgroup/hardware/memory/memory_win.c,
+ agent/mibgroup/hardware/sensors.h,
+ agent/mibgroup/hardware/sensors/dummy_sensors.c,
+ agent/mibgroup/hardware/sensors/dummy_sensors.h,
+ agent/mibgroup/hardware/sensors/hw_sensors.c,
+ agent/mibgroup/hardware/sensors/hw_sensors.h,
+ agent/mibgroup/hardware/sensors/kstat_sensors.c,
+ agent/mibgroup/hardware/sensors/kstat_sensors.h,
+ agent/mibgroup/hardware/sensors/lmsensors_v2.c,
+ agent/mibgroup/hardware/sensors/lmsensors_v2.h,
+ agent/mibgroup/hardware/sensors/lmsensors_v3.c,
+ agent/mibgroup/hardware/sensors/lmsensors_v3.h,
+ agent/mibgroup/hardware/sensors/picld_sensors.c,
+ agent/mibgroup/hardware/sensors/picld_sensors.h,
+ agent/mibgroup/header_complex.c, agent/mibgroup/header_complex.h,
+ agent/mibgroup/host.h, agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_darwin.c,
+ agent/mibgroup/host/data_access/swinst_null.c,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c,
+ agent/mibgroup/host/data_access/swinst_rpm.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/data_access/swrun.h,
+ agent/mibgroup/host/data_access/swrun_cygwin.c,
+ agent/mibgroup/host/data_access/swrun_darwin.c,
+ agent/mibgroup/host/data_access/swrun_kinfo.c,
+ agent/mibgroup/host/data_access/swrun_kvm_proc.c,
+ agent/mibgroup/host/data_access/swrun_nlist.c,
+ agent/mibgroup/host/data_access/swrun_null.c,
+ agent/mibgroup/host/data_access/swrun_procfs_psinfo.c,
+ agent/mibgroup/host/data_access/swrun_procfs_status.c,
+ agent/mibgroup/host/data_access/swrun_procinfo.c,
+ agent/mibgroup/host/data_access/swrun_prpsinfo.c,
+ agent/mibgroup/host/data_access/swrun_pstat.c,
+ agent/mibgroup/host/hrSWInstalledTable.c,
+ agent/mibgroup/host/hrSWInstalledTable.h,
+ agent/mibgroup/host/hrSWRunPerfTable.c,
+ agent/mibgroup/host/hrSWRunPerfTable.h,
+ agent/mibgroup/host/hrSWRunTable.c,
+ agent/mibgroup/host/hrSWRunTable.h,
+ agent/mibgroup/host/hr_device.c, agent/mibgroup/host/hr_device.h,
+ agent/mibgroup/host/hr_disk.c, agent/mibgroup/host/hr_disk.h,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_filesys.h,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_network.h, agent/mibgroup/host/hr_other.c,
+ agent/mibgroup/host/hr_other.h,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_partition.h,
+ agent/mibgroup/host/hr_print.c, agent/mibgroup/host/hr_print.h,
+ agent/mibgroup/host/hr_proc.c, agent/mibgroup/host/hr_proc.h,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_storage.h, agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swinst.h, agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_swrun.h, agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hr_system.h,
+ agent/mibgroup/host/hrh_filesys.c,
+ agent/mibgroup/host/hrh_filesys.h,
+ agent/mibgroup/host/hrh_storage.c,
+ agent/mibgroup/host/hrh_storage.h, agent/mibgroup/host_res.h,
+ agent/mibgroup/if-mib.h,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface.h,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.c,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.h,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.h,
+ agent/mibgroup/if-mib/ifTable.h,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_constants.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_defs.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.h,
+ agent/mibgroup/if-mib/ifXTable.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h,
+ agent/mibgroup/ip-forward-mib.h,
+ agent/mibgroup/ip-forward-mib/data_access/route.h,
+ agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_ioctl.h,
+ agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_linux.h,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable.h,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ .c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ .h,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _constants.h,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _data_access.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _data_access.h,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
+ _interface.h, agent/mibgroup/ip-forward-mib/ipCidrRouteTable.h,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_con
+ stants.h,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_dat
+ a_access.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_dat
+ a_access.h,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_int
+ erface.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_int
+ erface.h, agent/mibgroup/ip-mib.h,
+ agent/mibgroup/ip-mib/data_access/arp.h,
+ agent/mibgroup/ip-mib/data_access/arp_common.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/data_access/defaultrouter.h,
+ agent/mibgroup/ip-mib/data_access/defaultrouter_common.c,
+ agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c,
+ agent/mibgroup/ip-mib/data_access/ipv6scopezone.h,
+ agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c,
+ agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c,
+ agent/mibgroup/ip-mib/data_access/scalars_common.h,
+ agent/mibgroup/ip-mib/data_access/scalars_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats.h,
+ agent/mibgroup/ip-mib/data_access/systemstats_common.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable.h,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_const
+ ants.h,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_
+ access.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_
+ access.h,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_inter
+ face.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_inter
+ face.h, agent/mibgroup/ip-mib/ipAddressPrefixTable.h,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_con
+ stants.h,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_dat
+ a_access.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_dat
+ a_access.h,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_int
+ erface.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_int
+ erface.h, agent/mibgroup/ip-mib/ipAddressTable.h,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable.h,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_dat
+ a_access.c,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_dat
+ a_access.h,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_dat
+ a_get.c,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_dat
+ a_get.h,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enu
+ ms.h,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_int
+ erface.c,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_int
+ erface.h,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oid
+ s.h, agent/mibgroup/ip-mib/ipIfStatsTable.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h,
+ agent/mibgroup/ip-mib/ipSystemStatsTable.h,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constan
+ ts.h,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_ac
+ cess.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_ac
+ cess.h,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interfa
+ ce.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interfa
+ ce.h, agent/mibgroup/ip-mib/ip_scalars.c,
+ agent/mibgroup/ip-mib/ip_scalars.h,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable.h,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constan
+ ts.h,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_ac
+ cess.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_ac
+ cess.h,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interfa
+ ce.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interfa
+ ce.h,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagen
+ t.c, agent/mibgroup/ip-mib/ipv6InterfaceTable.h,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constan
+ ts.h,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_ac
+ cess.c,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_ac
+ cess.h,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interfa
+ ce.c,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interfa
+ ce.h, agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le.h,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le_data_access.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le_data_access.h,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le_enums.h,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le_interface.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le_interface.h,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTab
+ le_oids.h, agent/mibgroup/ipfwchains/README,
+ agent/mibgroup/kernel_sunos5.c, agent/mibgroup/kernel_sunos5.h,
+ agent/mibgroup/mibII.h, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/at.h, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/icmp.h, agent/mibgroup/mibII/ifTable.h,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/ip.h, agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/ipAddr.h,
+ agent/mibgroup/mibII/ipCidrRouteTable.c,
+ agent/mibgroup/mibII/ipCidrRouteTable.h,
+ agent/mibgroup/mibII/ipCidrRouteTable_access.c,
+ agent/mibgroup/mibII/ipCidrRouteTable_access.h,
+ agent/mibgroup/mibII/ipCidrRouteTable_checkfns.c,
+ agent/mibgroup/mibII/ipCidrRouteTable_checkfns.h,
+ agent/mibgroup/mibII/ipCidrRouteTable_columns.h,
+ agent/mibgroup/mibII/ipCidrRouteTable_enums.h,
+ agent/mibgroup/mibII/ipv6.c, agent/mibgroup/mibII/ipv6.h,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/kernel_linux.h,
+ agent/mibgroup/mibII/kernel_netbsd.c,
+ agent/mibgroup/mibII/kernel_netbsd.h,
+ agent/mibgroup/mibII/mibII_common.h,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/mta_sendmail.h,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/route_write.h,
+ agent/mibgroup/mibII/setSerialNo.c,
+ agent/mibgroup/mibII/setSerialNo.h,
+ agent/mibgroup/mibII/snmp_mib.c, agent/mibgroup/mibII/snmp_mib.h,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.h,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/system_mib.h, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcp.h, agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/tcpTable.h, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/udp.h, agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/udpTable.h, agent/mibgroup/mibII/updates.c,
+ agent/mibgroup/mibII/updates.h, agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_conf.h,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_context.h,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/mibII/var_route.h, agent/mibgroup/mibdefs.h,
+ agent/mibgroup/mibincl.h, agent/mibgroup/misc/ipfwacc.c,
+ agent/mibgroup/misc/ipfwacc.h,
+ agent/mibgroup/notification-log-mib.h,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/notification-log-mib/notification_log.h,
+ agent/mibgroup/notification.h,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.h,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.h,
+ agent/mibgroup/rmon-mib.h,
+ agent/mibgroup/rmon-mib/data_access/etherstats.h,
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c,
+ agent/mibgroup/rmon-mib/etherStatsTable.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access
+ .c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access
+ .h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c
+ ,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h
+ , agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h,
+ agent/mibgroup/sctp-mib.h,
+ agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpAssocTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpScalars.c,
+ agent/mibgroup/sctp-mib/sctpScalars.h,
+ agent/mibgroup/sctp-mib/sctpScalars_common.c,
+ agent/mibgroup/sctp-mib/sctpScalars_common.h,
+ agent/mibgroup/sctp-mib/sctpScalars_freebsd.c,
+ agent/mibgroup/sctp-mib/sctpScalars_linux.c,
+ agent/mibgroup/sctp-mib/sctpTables.h,
+ agent/mibgroup/sctp-mib/sctpTables_common.c,
+ agent/mibgroup/sctp-mib/sctpTables_common.h,
+ agent/mibgroup/sctp-mib/sctpTables_freebsd.c,
+ agent/mibgroup/sctp-mib/sctpTables_linux.c, agent/mibgroup/smux.h,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/smux/smux.h,
+ agent/mibgroup/smux/snmp_bgp.c, agent/mibgroup/smux/snmp_bgp.h,
+ agent/mibgroup/smux/snmp_ospf.c, agent/mibgroup/smux/snmp_ospf.h,
+ agent/mibgroup/smux/snmp_rip2.c, agent/mibgroup/smux/snmp_rip2.h,
+ agent/mibgroup/smux_gated.h,
+ agent/mibgroup/snmp-notification-mib.h,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable.h,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_constants.h,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_data_access.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_data_access.h,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_interface.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNoti
+ fyFilterTable_interface.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParamet
+ ers.c,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParamet
+ ers.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable.c,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_data_access.c,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_data_access.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_data_get.c,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_data_get.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_data_set.c,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_data_set.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_doxygen.conf,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_enums.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_interface.c,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_interface.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserK
+ eyTable_oids.h, agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpEngine.h,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.h,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.h,
+ agent/mibgroup/snmpv3/usmConf.c, agent/mibgroup/snmpv3/usmConf.h,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats.h,
+ agent/mibgroup/snmpv3/usmStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.h,
+ agent/mibgroup/snmpv3/usmUser.c, agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/snmpv3mibs.h, agent/mibgroup/struct.h,
+ agent/mibgroup/target.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.h,
+ agent/mibgroup/target/target.c, agent/mibgroup/target/target.h,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/target/target_counters.h,
+ agent/mibgroup/target/target_counters_5_5.c,
+ agent/mibgroup/target/target_counters_5_5.h,
+ agent/mibgroup/tcp-mib.h,
+ agent/mibgroup/tcp-mib/data_access/Makefile,
+ agent/mibgroup/tcp-mib/data_access/tcpConn.h,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_common.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_private.h,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c,
+ agent/mibgroup/tcp-mib/tcpConnTable.h,
+ agent/mibgroup/tcp-mib/tcpConnectionTable.h,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_consta
+ nts.h,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_a
+ ccess.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_a
+ ccess.h,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interf
+ ace.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interf
+ ace.h, agent/mibgroup/tcp-mib/tcpListenerTable.h,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.
+ h,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_acces
+ s.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_acces
+ s.h,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.
+ c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.
+ h, agent/mibgroup/testhandler.c, agent/mibgroup/testhandler.h,
+ agent/mibgroup/tunnel.h, agent/mibgroup/tunnel/tunnel.c,
+ agent/mibgroup/tunnel/tunnel.h, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/disk.h, agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/diskio.h, agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/dlmod.h,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/errormib.h,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/file.c, agent/mibgroup/ucd-snmp/file.h,
+ agent/mibgroup/ucd-snmp/hpux.c, agent/mibgroup/ucd-snmp/hpux.h,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ agent/mibgroup/ucd-snmp/lmSensors.h,
+ agent/mibgroup/ucd-snmp/lmsensorsMib.c,
+ agent/mibgroup/ucd-snmp/lmsensorsMib.h,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/loadave.h,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/logmatch.h,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h,
+ agent/mibgroup/ucd-snmp/memory_aix4.c,
+ agent/mibgroup/ucd-snmp/memory_aix4.h,
+ agent/mibgroup/ucd-snmp/memory_darwin7.c,
+ agent/mibgroup/ucd-snmp/memory_darwin7.h,
+ agent/mibgroup/ucd-snmp/memory_dynix.c,
+ agent/mibgroup/ucd-snmp/memory_dynix.h,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/memory_hpux.c,
+ agent/mibgroup/ucd-snmp/memory_hpux.h,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.h,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.h,
+ agent/mibgroup/ucd-snmp/pass.c, agent/mibgroup/ucd-snmp/pass.h,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/pass_persist.h,
+ agent/mibgroup/ucd-snmp/proc.c, agent/mibgroup/ucd-snmp/proc.h,
+ agent/mibgroup/ucd-snmp/proxy.c, agent/mibgroup/ucd-snmp/proxy.h,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/versioninfo.h,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat.h,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.c,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.h,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.h,
+ agent/mibgroup/ucd-snmp/vmstat_darwin7.c,
+ agent/mibgroup/ucd-snmp/vmstat_darwin7.h,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.c,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.h,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h,
+ agent/mibgroup/ucd-snmp/vmstat_hpux.c,
+ agent/mibgroup/ucd-snmp/vmstat_hpux.h,
+ agent/mibgroup/ucd-snmp/vmstat_linux.c,
+ agent/mibgroup/ucd-snmp/vmstat_linux.h,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.h,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.h,
+ agent/mibgroup/ucd_snmp.h, agent/mibgroup/udp-mib.h,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint.h,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_private.h,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c,
+ agent/mibgroup/udp-mib/udpEndpointTable.h,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.
+ h,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_acces
+ s.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_acces
+ s.h,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.
+ c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.
+ h, agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h,
+ agent/mibgroup/util_funcs/MIB_STATS_CACHE_TIMEOUT.h,
+ agent/mibgroup/util_funcs/get_pid_from_inode.c,
+ agent/mibgroup/util_funcs/get_pid_from_inode.h,
+ agent/mibgroup/util_funcs/header_generic.c,
+ agent/mibgroup/util_funcs/header_generic.h,
+ agent/mibgroup/util_funcs/header_simple_table.c,
+ agent/mibgroup/util_funcs/header_simple_table.h,
+ agent/mibgroup/utilities.h, agent/mibgroup/utilities/execute.c,
+ agent/mibgroup/utilities/execute.h,
+ agent/mibgroup/utilities/iquery.c,
+ agent/mibgroup/utilities/iquery.h,
+ agent/mibgroup/utilities/override.c,
+ agent/mibgroup/utilities/override.h,
+ agent/mibgroup/utilities/snmp_get_statistic.c,
+ agent/mibgroup/utilities/snmp_get_statistic.h,
+ agent/mibgroup/versiontag, agent/mibgroup/winExtDLL.c,
+ agent/mibgroup/winExtDLL.h, agent/object_monitor.c,
+ agent/snmp_agent.c, agent/snmp_perl.c, agent/snmp_perl.h,
+ agent/snmp_perl.pl, agent/snmp_vars.c, agent/snmpd.c,
+ agent/snmpd.h, apps/Makefile.depend, apps/Makefile.in,
+ apps/encode_keychange.c, apps/snmp_perl_trapd.pl,
+ apps/snmpbulkget.c, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpdf.c, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpnetstat/Makefile.depend, apps/snmpnetstat/Makefile.in,
+ apps/snmpnetstat/ffs.c, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/main.h,
+ apps/snmpnetstat/netstat.h, apps/snmpnetstat/route.c,
+ apps/snmpnetstat/winstub.c, apps/snmpnetstat/winstub.h,
+ apps/snmpset.c, apps/snmpstatus.c, apps/snmptable.c,
+ apps/snmptest.c, apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmptrapd_auth.c, apps/snmptrapd_auth.h,
+ apps/snmptrapd_ds.h, apps/snmptrapd_handlers.c,
+ apps/snmptrapd_handlers.h, apps/snmptrapd_log.c,
+ apps/snmptrapd_log.h, apps/snmptrapd_sql.c, apps/snmpusm.c,
+ apps/snmpvacm.c, apps/snmpwalk.c, apps/sshtosnmp.c, config.guess,
+ config.sub, configure, configure.ac,
+ configure.d/config_modules_agent, configure.d/config_modules_lib,
+ configure.d/config_os_functions, configure.d/config_os_headers,
+ configure.d/config_os_libs1, configure.d/config_os_libs2,
+ configure.d/config_os_misc1, configure.d/config_os_misc2,
+ configure.d/config_os_misc3, configure.d/config_os_misc4,
+ configure.d/config_os_progs, configure.d/config_os_struct_members,
+ configure.d/config_project_ipv6_types,
+ configure.d/config_project_manual,
+ configure.d/config_project_paths,
+ configure.d/config_project_perl_python,
+ configure.d/config_project_types,
+ configure.d/config_project_with_enable, dist/Makefile,
+ dist/README.build-scripts, dist/RELEASE-INSTRUCTIONS,
+ dist/autoconf-version, dist/changelogfix, dist/check-api-change,
+ dist/cvsshow, dist/cvsup, dist/extractnews, dist/find-requires,
+ dist/makerelease.xml, dist/net-snmp-solaris-build/DEVENV,
+ dist/net-snmp-solaris-build/README,
+ dist/net-snmp-solaris-build/buildpackage-solaris,
+ dist/net-snmp-solaris-build/elfdepend.sh, dist/net-snmp.spec,
+ dist/nsb-config, dist/nsb-functions, dist/nsb-nightly,
+ dist/nsb-package, dist/nsb-platform, dist/patme,
+ dist/schema-snmptrapd.sql, dist/snmpd-init.d,
+ dist/snmptrapd-init.d, dist/svnup, doc/rfc/agentx/rfc2741.txt,
+ doc/rfc/misc/rfc3512.txt, doc/rfc/misc/rfc3584.txt,
+ doc/rfc/smiV2/rfc2578.txt, doc/rfc/smiV2/rfc2579.errata,
+ doc/rfc/smiV2/rfc2579.txt, doc/rfc/smiV2/rfc2580.txt,
+ doc/rfc/snmpV1/rfc1155.txt, doc/rfc/snmpV1/rfc1157.txt,
+ doc/rfc/snmpV1/rfc1212.txt, doc/rfc/snmpV1/rfc1213.txt,
+ doc/rfc/snmpV2/rfc1901.txt, doc/rfc/snmpV2/rfc1902.txt,
+ doc/rfc/snmpV2/rfc1903.txt, doc/rfc/snmpV2/rfc1904.txt,
+ doc/rfc/snmpV2/rfc1905.txt, doc/rfc/snmpV2/rfc1906.txt,
+ doc/rfc/snmpV2/rfc1907.txt, doc/rfc/snmpV2/rfc1908.txt,
+ doc/rfc/snmpV2/rfc2089.txt, doc/rfc/snmpV3/rfc3410.errata,
+ doc/rfc/snmpV3/rfc3410.txt, doc/rfc/snmpV3/rfc3411.txt,
+ doc/rfc/snmpV3/rfc3412.txt, doc/rfc/snmpV3/rfc3413.errata,
+ doc/rfc/snmpV3/rfc3413.txt, doc/rfc/snmpV3/rfc3414.errata,
+ doc/rfc/snmpV3/rfc3414.txt, doc/rfc/snmpV3/rfc3415.errata,
+ doc/rfc/snmpV3/rfc3415.txt, doc/rfc/snmpV3/rfc3416.txt,
+ doc/rfc/snmpV3/rfc3417.txt, doc/rfc/snmpV3/rfc3418.errata,
+ doc/rfc/snmpV3/rfc3418.txt, dotgdbinit, doxygen.conf,
+ include/net-snmp/agent/agent_callbacks.h,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/agent_index.h,
+ include/net-snmp/agent/agent_read_config.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/agent_sysORTable.h,
+ include/net-snmp/agent/agent_trap.h,
+ include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/auto_nlist.h,
+ include/net-snmp/agent/baby_steps.h,
+ include/net-snmp/agent/bulk_to_next.h,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/agent/debug_handler.h,
+ include/net-snmp/agent/ds_agent.h,
+ include/net-snmp/agent/hardware/cpu.h,
+ include/net-snmp/agent/hardware/fsys.h,
+ include/net-snmp/agent/hardware/memory.h,
+ include/net-snmp/agent/hardware/sensors.h,
+ include/net-snmp/agent/instance.h, include/net-snmp/agent/mfd.h,
+ include/net-snmp/agent/mib_modules.h,
+ include/net-snmp/agent/mode_end_call.h,
+ include/net-snmp/agent/multiplexer.h,
+ include/net-snmp/agent/net-snmp-agent-includes.h,
+ include/net-snmp/agent/null.h,
+ include/net-snmp/agent/object_monitor.h,
+ include/net-snmp/agent/old_api.h,
+ include/net-snmp/agent/read_only.h,
+ include/net-snmp/agent/row_merge.h,
+ include/net-snmp/agent/scalar.h,
+ include/net-snmp/agent/scalar_group.h,
+ include/net-snmp/agent/serialize.h,
+ include/net-snmp/agent/set_helper.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/snmp_vars.h,
+ include/net-snmp/agent/stash_cache.h,
+ include/net-snmp/agent/stash_to_next.h,
+ include/net-snmp/agent/sysORTable.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/agent/table_container.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/agent/table_tdata.h,
+ include/net-snmp/agent/var_struct.h,
+ include/net-snmp/agent/watcher.h, include/net-snmp/config_api.h,
+ include/net-snmp/data_access/arp.h,
+ include/net-snmp/data_access/defaultrouter.h,
+ include/net-snmp/data_access/interface.h,
+ include/net-snmp/data_access/ip_scalars.h,
+ include/net-snmp/data_access/ipaddress.h,
+ include/net-snmp/data_access/ipstats.h,
+ include/net-snmp/data_access/net-snmp-data-access-includes.h,
+ include/net-snmp/data_access/route.h,
+ include/net-snmp/data_access/scopezone.h,
+ include/net-snmp/data_access/swinst.h,
+ include/net-snmp/data_access/swrun.h,
+ include/net-snmp/data_access/systemstats.h,
+ include/net-snmp/data_access/tcpConn.h,
+ include/net-snmp/data_access/udp_endpoint.h,
+ include/net-snmp/definitions.h, include/net-snmp/library/README,
+ include/net-snmp/library/asn1.h,
+ include/net-snmp/library/callback.h,
+ include/net-snmp/library/check_varbind.h,
+ include/net-snmp/library/cmu_compat.h,
+ include/net-snmp/library/container.h,
+ include/net-snmp/library/container_binary_array.h,
+ include/net-snmp/library/container_iterator.h,
+ include/net-snmp/library/container_list_ssll.h,
+ include/net-snmp/library/container_null.h,
+ include/net-snmp/library/data_list.h,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/dir_utils.h,
+ include/net-snmp/library/factory.h,
+ include/net-snmp/library/fd_event_manager.h,
+ include/net-snmp/library/file_utils.h,
+ include/net-snmp/library/getopt.h,
+ include/net-snmp/library/int64.h,
+ include/net-snmp/library/keytools.h,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/library/lcd_time.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/library/md5.h, include/net-snmp/library/mib.h,
+ include/net-snmp/library/mt_support.h,
+ include/net-snmp/library/oid_stash.h,
+ include/net-snmp/library/parse.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/scapi.h,
+ include/net-snmp/library/snmp-tc.h,
+ include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpAliasDomain.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpIPXDomain.h,
+ include/net-snmp/library/snmpSSHDomain.h,
+ include/net-snmp/library/snmpSTDDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_alarm.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_assert.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_enum.h,
+ include/net-snmp/library/snmp_impl.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/library/snmp_openssl.h,
+ include/net-snmp/library/snmp_parse_args.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmp_service.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/snmpksm.h,
+ include/net-snmp/library/snmptsm.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/snmpv3.h,
+ include/net-snmp/library/system.h,
+ include/net-snmp/library/text_utils.h,
+ include/net-snmp/library/tools.h,
+ include/net-snmp/library/transform_oids.h,
+ include/net-snmp/library/types.h,
+ include/net-snmp/library/ucd_compat.h,
+ include/net-snmp/library/vacm.h,
+ include/net-snmp/library/winpipe.h,
+ include/net-snmp/library/winservice.h,
+ include/net-snmp/machine/generic.h, include/net-snmp/mib_api.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/net-snmp-includes.h,
+ include/net-snmp/output_api.h, include/net-snmp/pdu_api.h,
+ include/net-snmp/session_api.h, include/net-snmp/snmpv3_api.h,
+ include/net-snmp/system/aix.h, include/net-snmp/system/bsd.h,
+ include/net-snmp/system/bsdi.h, include/net-snmp/system/bsdi3.h,
+ include/net-snmp/system/bsdi4.h, include/net-snmp/system/cygwin.h,
+ include/net-snmp/system/darwin.h,
+ include/net-snmp/system/darwin7.h,
+ include/net-snmp/system/darwin8.h,
+ include/net-snmp/system/darwin9.h,
+ include/net-snmp/system/dragonfly.h,
+ include/net-snmp/system/dynix.h,
+ include/net-snmp/system/freebsd.h,
+ include/net-snmp/system/freebsd2.h,
+ include/net-snmp/system/freebsd3.h,
+ include/net-snmp/system/freebsd4.h,
+ include/net-snmp/system/freebsd5.h,
+ include/net-snmp/system/freebsd6.h,
+ include/net-snmp/system/freebsd7.h,
+ include/net-snmp/system/generic.h, include/net-snmp/system/hpux.h,
+ include/net-snmp/system/irix.h,
+ include/net-snmp/system/kfreebsd.h,
+ include/net-snmp/system/linux.h,
+ include/net-snmp/system/mingw32.h,
+ include/net-snmp/system/mingw32msvc.h,
+ include/net-snmp/system/mips.h, include/net-snmp/system/netbsd.h,
+ include/net-snmp/system/openbsd.h, include/net-snmp/system/osf5.h,
+ include/net-snmp/system/solaris.h,
+ include/net-snmp/system/solaris2.3.h,
+ include/net-snmp/system/solaris2.4.h,
+ include/net-snmp/system/solaris2.5.h,
+ include/net-snmp/system/solaris2.6.h,
+ include/net-snmp/system/sunos.h, include/net-snmp/system/svr5.h,
+ include/net-snmp/system/sysv.h, include/net-snmp/system/ultrix4.h,
+ include/net-snmp/types.h, include/net-snmp/utilities.h,
+ include/net-snmp/varbind_api.h, include/net-snmp/version.h,
+ include/ucd-snmp/README, include/ucd-snmp/agent_index.h,
+ include/ucd-snmp/agent_read_config.h,
+ include/ucd-snmp/agent_registry.h, include/ucd-snmp/agent_trap.h,
+ include/ucd-snmp/asn1.h, include/ucd-snmp/auto_nlist.h,
+ include/ucd-snmp/callback.h, include/ucd-snmp/default_store.h,
+ include/ucd-snmp/ds_agent.h, include/ucd-snmp/header_complex.h,
+ include/ucd-snmp/int64.h, include/ucd-snmp/keytools.h,
+ include/ucd-snmp/mib.h, include/ucd-snmp/mib_module_config.h,
+ include/ucd-snmp/mibincl.h, include/ucd-snmp/parse.h,
+ include/ucd-snmp/read_config.h, include/ucd-snmp/scapi.h,
+ include/ucd-snmp/snmp-tc.h, include/ucd-snmp/snmp.h,
+ include/ucd-snmp/snmp_agent.h, include/ucd-snmp/snmp_alarm.h,
+ include/ucd-snmp/snmp_api.h, include/ucd-snmp/snmp_client.h,
+ include/ucd-snmp/snmp_debug.h, include/ucd-snmp/snmp_impl.h,
+ include/ucd-snmp/snmp_logging.h,
+ include/ucd-snmp/snmp_parse_args.h, include/ucd-snmp/snmp_vars.h,
+ include/ucd-snmp/snmpusm.h, include/ucd-snmp/snmpv3.h,
+ include/ucd-snmp/struct.h, include/ucd-snmp/system.h,
+ include/ucd-snmp/tools.h, include/ucd-snmp/transform_oids.h,
+ include/ucd-snmp/ucd-snmp-agent-includes.h,
+ include/ucd-snmp/ucd-snmp-config.h,
+ include/ucd-snmp/ucd-snmp-includes.h,
+ include/ucd-snmp/util_funcs.h, include/ucd-snmp/var_struct.h,
+ include/ucd-snmp/version.h, install-sh, local/FAQ2HTML,
+ local/Makefile.in, local/README.mib2c, local/Version-Munge.pl,
+ local/convertcode, local/fixproc, local/html-add-header-footer.pl,
+ local/html-textfile-fix.pl, local/ipf-mod.pl, local/mib2c,
+ local/mib2c-conf.d/default-mfd-top.m2c,
+ local/mib2c-conf.d/details-enums.m2i,
+ local/mib2c-conf.d/details-node.m2i,
+ local/mib2c-conf.d/details-table.m2i,
+ local/mib2c-conf.d/generic-ctx-copy.m2i,
+ local/mib2c-conf.d/generic-ctx-get.m2i,
+ local/mib2c-conf.d/generic-ctx-set.m2i,
+ local/mib2c-conf.d/generic-data-allocate.m2i,
+ local/mib2c-conf.d/generic-data-context.m2i,
+ local/mib2c-conf.d/generic-get-char.m2i,
+ local/mib2c-conf.d/generic-get-decl-bot.m2i,
+ local/mib2c-conf.d/generic-get-decl.m2i,
+ local/mib2c-conf.d/generic-get-long.m2i,
+ local/mib2c-conf.d/generic-get-oid.m2i,
+ local/mib2c-conf.d/generic-header-bottom.m2i,
+ local/mib2c-conf.d/generic-header-top.m2i,
+ local/mib2c-conf.d/generic-source-includes.m2i,
+ local/mib2c-conf.d/generic-table-constants.m2c,
+ local/mib2c-conf.d/generic-table-enums.m2c,
+ local/mib2c-conf.d/generic-table-indexes-from-oid.m2i,
+ local/mib2c-conf.d/generic-table-indexes-set.m2i,
+ local/mib2c-conf.d/generic-table-indexes-to-oid.m2i,
+ local/mib2c-conf.d/generic-table-indexes-varbind-setup.m2i,
+ local/mib2c-conf.d/generic-table-indexes.m2i,
+ local/mib2c-conf.d/generic-table-oids.m2c,
+ local/mib2c-conf.d/generic-value-map-func.m2i,
+ local/mib2c-conf.d/generic-value-map-reverse.m2i,
+ local/mib2c-conf.d/generic-value-map.m2i,
+ local/mib2c-conf.d/m2c-internal-warning.m2i,
+ local/mib2c-conf.d/m2c_setup_enum.m2i,
+ local/mib2c-conf.d/m2c_setup_node.m2i,
+ local/mib2c-conf.d/m2c_setup_table.m2i,
+ local/mib2c-conf.d/m2c_table_save_defaults.m2i,
+ local/mib2c-conf.d/mfd-access-container-cached-defines.m2i,
+ local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i,
+ local/mib2c-conf.d/mfd-data-access.m2c,
+ local/mib2c-conf.d/mfd-data-get.m2c,
+ local/mib2c-conf.d/mfd-data-set.m2c,
+ local/mib2c-conf.d/mfd-doxygen.m2c,
+ local/mib2c-conf.d/mfd-interactive-setup.m2c,
+ local/mib2c-conf.d/mfd-interface.m2c,
+ local/mib2c-conf.d/mfd-makefile.m2m,
+ local/mib2c-conf.d/mfd-persistence.m2i,
+ local/mib2c-conf.d/mfd-readme.m2c, local/mib2c-conf.d/mfd-top.m2c,
+ local/mib2c-conf.d/node-get.m2i, local/mib2c-conf.d/node-set.m2i,
+ local/mib2c-conf.d/node-storage.m2i,
+ local/mib2c-conf.d/node-validate.m2i,
+ local/mib2c-conf.d/node-varbind-validate.m2i,
+ local/mib2c-conf.d/parent-dependencies.m2i,
+ local/mib2c-conf.d/parent-set.m2i,
+ local/mib2c-conf.d/subagent.m2c,
+ local/mib2c-conf.d/syntax-COUNTER64-get.m2i,
+ local/mib2c-conf.d/syntax-DateAndTime-get.m2d,
+ local/mib2c-conf.d/syntax-DateAndTime-get.m2i,
+ local/mib2c-conf.d/syntax-DateAndTime-readme.m2i,
+ local/mib2c-conf.d/syntax-InetAddress-get.m2i,
+ local/mib2c-conf.d/syntax-InetAddress-set.m2i,
+ local/mib2c-conf.d/syntax-InetAddressType-get.m2i,
+ local/mib2c-conf.d/syntax-InetAddressType-set.m2i,
+ local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i,
+ local/mib2c-conf.d/syntax-RowStatus-get.m2i,
+ local/mib2c-conf.d/syntax-RowStatus-varbind-validate.m2i,
+ local/mib2c-conf.d/syntax-StorageType-dependencies.m2i,
+ local/mib2c-conf.d/syntax-TestAndIncr-get.m2i, local/mib2c-update,
+ local/mib2c.access_functions.conf, local/mib2c.array-user.conf,
+ local/mib2c.check_values.conf,
+ local/mib2c.check_values_local.conf,
+ local/mib2c.column_defines.conf, local/mib2c.column_enums.conf,
+ local/mib2c.column_storage.conf, local/mib2c.conf,
+ local/mib2c.container.conf, local/mib2c.create-dataset.conf,
+ local/mib2c.emulation.conf, local/mib2c.genhtml.conf,
+ local/mib2c.int_watch.conf, local/mib2c.iterate.conf,
+ local/mib2c.iterate_access.conf, local/mib2c.mfd.conf,
+ local/mib2c.notify.conf, local/mib2c.old-api.conf,
+ local/mib2c.perl.conf, local/mib2c.raw-table.conf,
+ local/mib2c.row.conf, local/mib2c.scalar.conf,
+ local/mib2c.table_data.conf, local/pass_persisttest,
+ local/passtest, local/passtest.pl, local/snmp-ucd.sh,
+ local/snmpcheck.def, local/snmpconf,
+ local/snmpconf.dir/snmp-data/authopts,
+ local/snmpconf.dir/snmp-data/debugging,
+ local/snmpconf.dir/snmp-data/mibs,
+ local/snmpconf.dir/snmp-data/output,
+ local/snmpconf.dir/snmp-data/snmpconf-config,
+ local/snmpconf.dir/snmpd-data/acl,
+ local/snmpconf.dir/snmpd-data/basic_setup,
+ local/snmpconf.dir/snmpd-data/extending,
+ local/snmpconf.dir/snmpd-data/monitor,
+ local/snmpconf.dir/snmpd-data/operation,
+ local/snmpconf.dir/snmpd-data/snmpconf-config,
+ local/snmpconf.dir/snmpd-data/system,
+ local/snmpconf.dir/snmpd-data/trapsinks,
+ local/snmpconf.dir/snmptrapd-data/authentication,
+ local/snmpconf.dir/snmptrapd-data/formatting,
+ local/snmpconf.dir/snmptrapd-data/logging,
+ local/snmpconf.dir/snmptrapd-data/runtime,
+ local/snmpconf.dir/snmptrapd-data/snmpconf-config,
+ local/snmpconf.dir/snmptrapd-data/traphandle, local/snmpdump.pl,
+ local/tkmib, local/traptoemail, ltmain.sh,
+ m4/ac_add_search_path.m4, m4/ac_msg_cache.m4,
+ m4/ac_msg_module_dbg.m4, m4/ac_prompt_user.m4, m4/libtool.m4,
+ m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4,
+ m4/lt~obsolete.m4, m4/netsnmp_arg.m4, m4/netsnmp_search_libs.m4,
+ makedepend.in, makefileindepend.pl, makenosysdepend.pl,
+ maketarget, man/Makefile.in, man/add_mibdir.3,
+ man/add_module_replacement.3, man/config_api.3.def,
+ man/default_store.3.bot, man/default_store.3.top,
+ man/encode_keychange.1.def, man/fixproc.1.def,
+ man/get_module_node.3, man/init_mib.3, man/init_mib_internals.3,
+ man/make_index.pl, man/man_sections.txt, man/mib2c-update.1.def,
+ man/mib2c.1.def, man/mib2c.conf.5.in, man/mib2c.extract.pl,
+ man/mib_api.3.def, man/net-snmp-config.1.def,
+ man/net-snmp-create-v3-user.1.def,
+ man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_example_scalar_int.3, man/netsnmp_handler.3,
+ man/netsnmp_instance.3, man/netsnmp_iterator_info_s.3,
+ man/netsnmp_leaf.3, man/netsnmp_library.3,
+ man/netsnmp_mib_handler_methods.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_set_data.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_row.3, man/netsnmp_table_rows.3,
+ man/netsnmp_tdata.3, man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3, man/pdu_api.3.def, man/print_description.3,
+ man/print_mib.3, man/print_objid.3, man/print_value.3,
+ man/print_variable.3, man/read_all_mibs.3, man/read_mib.3,
+ man/read_module.3, man/read_module_node.3, man/read_objid.3,
+ man/session_api.3.def, man/shutdown_mib.3, man/snmp.conf.5.def,
+ man/snmp_agent_api.3.def, man/snmp_alarm.3.def,
+ man/snmp_api_errstring.3, man/snmp_close.3, man/snmp_config.5.def,
+ man/snmp_error.3, man/snmp_free_pdu.3, man/snmp_open.3,
+ man/snmp_perror.3, man/snmp_read.3, man/snmp_select_info.3,
+ man/snmp_send.3, man/snmp_sess_api.3.def,
+ man/snmp_sess_async_send.3, man/snmp_sess_close.3,
+ man/snmp_sess_error.3, man/snmp_sess_init.3, man/snmp_sess_open.3,
+ man/snmp_sess_perror.3, man/snmp_sess_read.3,
+ man/snmp_sess_select_info.3, man/snmp_sess_send.3,
+ man/snmp_sess_session.3, man/snmp_sess_timeout.3,
+ man/snmp_set_mib_warnings.3, man/snmp_set_save_descriptions.3,
+ man/snmp_timeout.3, man/snmp_trap_api.3.def,
+ man/snmpbulkget.1.def, man/snmpbulkwalk.1.def, man/snmpcmd.1.def,
+ man/snmpconf.1.def, man/snmpd.8.def, man/snmpd.conf.5.def,
+ man/snmpd.examples.5.def, man/snmpd.internal.5.def,
+ man/snmpdelta.1.def, man/snmpdf.1.def, man/snmpget.1.def,
+ man/snmpgetnext.1.def, man/snmpinform.1, man/snmpnetstat.1.def,
+ man/snmpset.1.def, man/snmpstatus.1.def, man/snmptable.1.def,
+ man/snmptest.1.def, man/snmptranslate.1.def, man/snmptrap.1.def,
+ man/snmptrapd.8.def, man/snmptrapd.conf.5.def, man/snmpusm.1.def,
+ man/snmpvacm.1.def, man/snmpwalk.1.def, man/tkmib.1.def,
+ man/traptoemail.1.def, man/varbind_api.3.def,
+ man/variables.5.def, mibs/AGENTX-MIB.txt,
+ mibs/DISMAN-EVENT-MIB.txt, mibs/DISMAN-EXPRESSION-MIB.txt,
+ mibs/DISMAN-NSLOOKUP-MIB.txt, mibs/DISMAN-PING-MIB.txt,
+ mibs/DISMAN-SCHEDULE-MIB.txt, mibs/DISMAN-SCRIPT-MIB.txt,
+ mibs/DISMAN-TRACEROUTE-MIB.txt, mibs/EtherLike-MIB.txt,
+ mibs/HCNUM-TC.txt, mibs/HOST-RESOURCES-MIB.txt,
+ mibs/HOST-RESOURCES-TYPES.txt,
+ mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt,
+ mibs/IANA-LANGUAGE-MIB.txt, mibs/IANA-RTPROTO-MIB.txt,
+ mibs/IANAifType-MIB.txt, mibs/IF-INVERTED-STACK-MIB.txt,
+ mibs/IF-MIB.txt, mibs/INET-ADDRESS-MIB.txt,
+ mibs/IP-FORWARD-MIB.txt, mibs/IP-MIB.txt,
+ mibs/IPV6-FLOW-LABEL-MIB.txt, mibs/IPV6-ICMP-MIB.txt,
+ mibs/IPV6-MIB.txt, mibs/IPV6-TC.txt, mibs/IPV6-TCP-MIB.txt,
+ mibs/IPV6-UDP-MIB.txt, mibs/LM-SENSORS-MIB.txt, mibs/MTA-MIB.txt,
+ mibs/Makefile.in, mibs/Makefile.mib, mibs/NET-SNMP-AGENT-MIB.txt,
+ mibs/NET-SNMP-EXAMPLES-MIB.txt, mibs/NET-SNMP-EXTEND-MIB.txt,
+ mibs/NET-SNMP-MIB.txt, mibs/NET-SNMP-MONITOR-MIB.txt,
+ mibs/NET-SNMP-PASS-MIB.txt, mibs/NET-SNMP-SYSTEM-MIB.txt,
+ mibs/NET-SNMP-TC.txt, mibs/NET-SNMP-VACM-MIB.txt,
+ mibs/NETWORK-SERVICES-MIB.txt, mibs/NOTIFICATION-LOG-MIB.txt,
+ mibs/README.mibs, mibs/RFC-1215.txt, mibs/RFC1155-SMI.txt,
+ mibs/RFC1213-MIB.txt, mibs/RMON-MIB.txt, mibs/SCTP-MIB.txt,
+ mibs/SMUX-MIB.txt, mibs/SNMP-COMMUNITY-MIB.txt,
+ mibs/SNMP-FRAMEWORK-MIB.txt, mibs/SNMP-MPD-MIB.txt,
+ mibs/SNMP-NOTIFICATION-MIB.txt, mibs/SNMP-PROXY-MIB.txt,
+ mibs/SNMP-TARGET-MIB.txt, mibs/SNMP-USER-BASED-SM-MIB.txt,
+ mibs/SNMP-USM-AES-MIB.txt, mibs/SNMP-USM-DH-OBJECTS-MIB.txt,
+ mibs/SNMP-VIEW-BASED-ACM-MIB.txt, mibs/SNMPv2-CONF.txt,
+ mibs/SNMPv2-MIB.txt, mibs/SNMPv2-SMI.txt, mibs/SNMPv2-TC.txt,
+ mibs/SNMPv2-TM.txt, mibs/TCP-MIB.txt,
+ mibs/TRANSPORT-ADDRESS-MIB.txt, mibs/TUNNEL-MIB.txt,
+ mibs/UCD-DEMO-MIB.inc, mibs/UCD-DEMO-MIB.txt,
+ mibs/UCD-DISKIO-MIB.inc, mibs/UCD-DISKIO-MIB.txt,
+ mibs/UCD-DLMOD-MIB.inc, mibs/UCD-DLMOD-MIB.txt,
+ mibs/UCD-IPFILTER-MIB.inc, mibs/UCD-IPFILTER-MIB.txt,
+ mibs/UCD-IPFWACC-MIB.inc, mibs/UCD-IPFWACC-MIB.txt,
+ mibs/UCD-SNMP-MIB-OLD.txt, mibs/UCD-SNMP-MIB.inc,
+ mibs/UCD-SNMP-MIB.txt, mibs/UDP-MIB.txt, mibs/ianalist,
+ mibs/makehtml.pl, mibs/mibfetch, mibs/nodemap, mibs/rfclist,
+ mibs/rfcmibs.diff, mibs/smistrip, mkinstalldirs,
+ net-snmp-config.in, net-snmp-create-v3-user.in, ov/Makefile.in,
+ ov/README, ov/UCD-Computer, ov/UCD-fields, ov/bitmaps/UCD.20.m,
+ ov/bitmaps/UCD.20.p, ov/bitmaps/UCD.26.m, ov/bitmaps/UCD.26.p,
+ ov/bitmaps/UCD.32.m, ov/bitmaps/UCD.32.p, ov/bitmaps/UCD.38.m,
+ ov/bitmaps/UCD.38.p, ov/bitmaps/UCD.44.m, ov/bitmaps/UCD.44.p,
+ ov/bitmaps/UCD.50.m, ov/bitmaps/UCD.50.p, ov/bitmaps/UCD.fields,
+ ov/oid_to_sym.in, ov/oid_to_type.in, perl/ASN/ASN.pm,
+ perl/ASN/ASN.xs, perl/ASN/Changes, perl/ASN/MANIFEST,
+ perl/ASN/Makefile.PL, perl/ASN/test.pl, perl/AnyData_SNMP/Changes,
+ perl/AnyData_SNMP/DBD_AnyData.patch, perl/AnyData_SNMP/Format.pm,
+ perl/AnyData_SNMP/INSTALL, perl/AnyData_SNMP/MANIFEST,
+ perl/AnyData_SNMP/Makefile.PL, perl/AnyData_SNMP/README,
+ perl/AnyData_SNMP/Storage.pm, perl/AnyData_SNMP/configs/scli,
+ perl/AnyData_SNMP/configs/unix, perl/AnyData_SNMP/netsh,
+ perl/Makefile.PL, perl/Makefile.makefiles, perl/Makefile.subs.pl,
+ perl/OID/Changes, perl/OID/MANIFEST, perl/OID/Makefile.PL,
+ perl/OID/OID.pm, perl/OID/OID.xs, perl/OID/README,
+ perl/OID/test.pl, perl/OID/typemap, perl/SNMP/BUG,
+ perl/SNMP/MANIFEST, perl/SNMP/MANIFEST.SKIP,
+ perl/SNMP/Makefile.PL, perl/SNMP/README, perl/SNMP/SNMP.pm,
+ perl/SNMP/SNMP.xs, perl/SNMP/TODO, perl/SNMP/examples/async1.pl,
+ perl/SNMP/examples/async2.pl, perl/SNMP/examples/bulkwalk.pl,
+ perl/SNMP/examples/ipforward.pl, perl/SNMP/examples/mibtree.pl,
+ perl/SNMP/examples/mibwalk.pl, perl/SNMP/examples/pingmib.pl,
+ perl/SNMP/examples/tablewalk.pl, perl/SNMP/examples/testleak.pl,
+ perl/SNMP/examples/trap-example.pl, perl/SNMP/hints/irix.pl,
+ perl/SNMP/hints/solaris.pl, perl/SNMP/perlsnmp.h,
+ perl/SNMP/t/README, perl/SNMP/t/async.t, perl/SNMP/t/bulkwalk.t,
+ perl/SNMP/t/conf.t, perl/SNMP/t/conftest.conf, perl/SNMP/t/get.t,
+ perl/SNMP/t/getnext.t, perl/SNMP/t/mib.t, perl/SNMP/t/mib.txt,
+ perl/SNMP/t/mibload.t, perl/SNMP/t/notify.t,
+ perl/SNMP/t/session.t, perl/SNMP/t/set.t,
+ perl/SNMP/t/snmptest.conf, perl/SNMP/t/startagent.pl,
+ perl/SNMP/typemap, perl/TrapReceiver/Changes,
+ perl/TrapReceiver/MANIFEST, perl/TrapReceiver/Makefile.PL,
+ perl/TrapReceiver/README, perl/TrapReceiver/TrapReceiver.pm,
+ perl/TrapReceiver/TrapReceiver.xs, perl/TrapReceiver/const-c.inc,
+ perl/TrapReceiver/const-xs.inc,
+ perl/TrapReceiver/fallback/const-c.inc,
+ perl/TrapReceiver/fallback/const-xs.inc,
+ perl/TrapReceiver/perl_snmptrapd.h, perl/TrapReceiver/ppport.h,
+ perl/TrapReceiver/t/1.t, perl/TrapReceiver/typemap,
+ perl/agent/Changes, perl/agent/MANIFEST, perl/agent/Makefile.PL,
+ perl/agent/Support/Makefile.PL, perl/agent/Support/Support.pm,
+ perl/agent/agent.pm, perl/agent/agent.xs,
+ perl/agent/default_store/Makefile.PL,
+ perl/agent/default_store/default_store.pm,
+ perl/agent/default_store/default_store.xs,
+ perl/agent/default_store/gen, perl/agent/default_store/test.pl,
+ perl/agent/netsnmp_request_infoPtr.pm, perl/agent/test.pl,
+ perl/agent/typemap, perl/default_store/Changes,
+ perl/default_store/MANIFEST, perl/default_store/Makefile.PL,
+ perl/default_store/README, perl/default_store/default_store.pm,
+ perl/default_store/default_store.xs, perl/default_store/gen,
+ perl/default_store/test.pl, perl/default_store/typemap,
+ perl/make-perl-makefiles, perl/manager/INSTALL,
+ perl/manager/Makefile.PL, perl/manager/displaytable.pm,
+ perl/manager/getValues.pm, perl/manager/manager.pm,
+ perl/manager/setupauth, perl/manager/setupdb,
+ perl/manager/setupuser, perl/manager/snmptosql, python/LICENSE,
+ python/README, python/netsnmp/__init__.py,
+ python/netsnmp/client.py, python/netsnmp/client_intf.c,
+ python/netsnmp/tests/__init__.py, python/netsnmp/tests/snmpd.conf,
+ python/netsnmp/tests/test.py, python/setup.py, remove-files,
+ sedscript.in, snmplib/Makefile.depend, snmplib/Makefile.in,
+ snmplib/asn1.c, snmplib/callback.c, snmplib/check_varbind.c,
+ snmplib/cmu_compat.c, snmplib/container.c,
+ snmplib/container_binary_array.c, snmplib/container_iterator.c,
+ snmplib/container_list_ssll.c, snmplib/container_null.c,
+ snmplib/data_list.c, snmplib/default_store.c, snmplib/dir_utils.c,
+ snmplib/fd_event_manager.c, snmplib/file_utils.c,
+ snmplib/getopt.c, snmplib/inet_ntop.c, snmplib/inet_pton.c,
+ snmplib/int64.c, snmplib/keytools.c, snmplib/large_fd_set.c,
+ snmplib/lcd_time.c, snmplib/md5.c, snmplib/mib.c,
+ snmplib/mt_support.c, snmplib/oid_stash.c, snmplib/parse.c,
+ snmplib/pkcs.c, snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp-tc.c, snmplib/snmp.c, snmplib/snmpAAL5PVCDomain.c,
+ snmplib/snmpAliasDomain.c, snmplib/snmpCallbackDomain.c,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpIPXDomain.c,
+ snmplib/snmpSSHDomain.c, snmplib/snmpSTDDomain.c,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_debug.c, snmplib/snmp_enum.c,
+ snmplib/snmp_logging.c, snmplib/snmp_openssl.c,
+ snmplib/snmp_parse_args.c, snmplib/snmp_secmod.c,
+ snmplib/snmp_service.c, snmplib/snmp_transport.c,
+ snmplib/snmp_version.c, snmplib/snmpksm.c, snmplib/snmptsm.c,
+ snmplib/snmpusm.c, snmplib/snmpv3.c, snmplib/snprintf.c,
+ snmplib/strlcpy.c, snmplib/strtok_r.c, snmplib/strtol.c,
+ snmplib/strtoul.c, snmplib/strtoull.c, snmplib/system.c,
+ snmplib/test_binary_array.c, snmplib/text_utils.c,
+ snmplib/tools.c, snmplib/ucd-snmp-includes.h,
+ snmplib/ucd_compat.c, snmplib/vacm.c, snmplib/winpipe.c,
+ snmplib/winservice.c, snmplib/winservice.mc,
+ snmplib/winservice.rc, snmplib/winservicerc.rc, stamp-h,
+ stamp-h.in, testing/Makefile.in, testing/README,
+ testing/RUNTESTS, testing/T.c, testing/T2.sh,
+ testing/TESTCONF.sh, testing/data.keychange-md5,
+ testing/data.keychange-sha1, testing/data.keychange-sha1-des,
+ testing/data.kul-md5, testing/data.kul-sha1, testing/etimetest.c,
+ testing/eval_oneprogram.sh, testing/eval_onescript.sh,
+ testing/eval_suite.sh, testing/eval_testlist,
+ testing/eval_tools.sh, testing/keymanagetest.c,
+ testing/misctest.c, testing/rfc1213/README, testing/rfc1213/run,
+ testing/rfc1213/snmpfun.sh, testing/rfc1213/test_fun,
+ testing/rfc1213/testmib1.sh, testing/rfc1213/testmib2.sh,
+ testing/rfc1213/testmib3.sh, testing/scapitest.c,
+ testing/test_keychange.sh, testing/test_kul.sh,
+ testing/tests/Stransport, testing/tests/Sv1config,
+ testing/tests/Sv2cconfig, testing/tests/Sv3config,
+ testing/tests/Sv3usmconfigagent, testing/tests/Sv3usmconfigbase,
+ testing/tests/Sv3usmconfigtrapd, testing/tests/Sv3vacmconfig,
+ testing/tests/Svacmconfig, testing/tests/Svanyconfig,
+ testing/tests/T000configure, testing/tests/T001snmpv1get,
+ testing/tests/T014snmpv2cget, testing/tests/T015snmpv2cgetnext,
+ testing/tests/T0160snmpv2cbulkget,
+ testing/tests/T016snmpv2cgetfail,
+ testing/tests/T017snmpv2ctov1getfail,
+ testing/tests/T018snmpv1tov2cgetfail,
+ testing/tests/T019snmpv2cnosuch, testing/tests/T020snmpv3get,
+ testing/tests/T021snmpv3getnext, testing/tests/T0220snmpv3bulkget,
+ testing/tests/T022snmpv3getMD5,
+ testing/tests/T023snmpv3getMD5AES,
+ testing/tests/T023snmpv3getMD5DES,
+ testing/tests/T024snmpv3getSHA1,
+ testing/tests/T025snmpv3getSHADES,
+ testing/tests/T026snmpv3getSHAAES,
+ testing/tests/T028snmpv3getfail,
+ testing/tests/T030snmpv3usercreation,
+ testing/tests/T035snmpv3trapdusermgmt,
+ testing/tests/T049snmpv3inform,
+ testing/tests/T049snmpv3informauth,
+ testing/tests/T049snmpv3informpriv, testing/tests/T050snmpv3trap,
+ testing/tests/T051snmpv2ctrap, testing/tests/T052snmpv2cinform,
+ testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap,
+ testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap,
+ testing/tests/T057trapdauthtest,
+ testing/tests/T057trapdauthtest2,
+ testing/tests/T057trapdauthtest3,
+ testing/tests/T058agentauthtrap,
+ testing/tests/T059trapdtraphandle, testing/tests/T060trapdperl,
+ testing/tests/T061agentperl, testing/tests/T065agentextend,
+ testing/tests/T100agenthup, testing/tests/T110agentxget,
+ testing/tests/T111agentxset, testing/tests/T112agentxsetfail,
+ testing/tests/T113agentxtrap, testing/tests/T115agentxperl,
+ testing/tests/T120proxyget, testing/tests/T121proxyset,
+ testing/tests/T122proxysetfail, testing/tests/T130snmpv1vacmget,
+ testing/tests/T131snmpv2cvacmget,
+ testing/tests/T132snmpv3vacmget,
+ testing/tests/T140snmpv1vacmgetfail,
+ testing/tests/T141snmpv2cvacmgetfail,
+ testing/tests/T142snmpv3vacmgetfail,
+ testing/tests/T150solarishostcpu,
+ testing/tests/T151solarishostdisk, testing/tests/T152hostuptime,
+ testing/tests/T153solarisswap, testing/tests/T160snmpnetstat,
+ testing/tests/T200snmpv2cwalkall, testing/tests/T300udp,
+ testing/tests/T310tcp, testing/tests/T320udpv6,
+ testing/tests/T330tcpv6, testing/tests/T350unix,
+ testing/tests/T360dtlsudp, testing/tests/T399alias,
+ testing/tests/test-localhost.cert,
+ testing/tests/test-localhost.priv, testing/tests/test-user.cert,
+ testing/tests/test-user.priv, win32/Configure,
+ win32/EXAMPLE.conf.win32, win32/Makefile-apps.in,
+ win32/Makefile.in, win32/MgmtApi-winExtDLL.h,
+ win32/Snmp-winExtDLL.h, win32/agent_module_dot_conf.h,
+ win32/agent_module_includes.h, win32/agent_module_inits.h,
+ win32/build.bat, win32/build.pl, win32/config.h,
+ win32/config.h.borland, win32/dist/README.build.win32.txt,
+ win32/dist/README.txt, win32/dist/build-binary.bat,
+ win32/dist/build-binary.pl,
+ win32/dist/htmlhelp/Configuration_Overview.html,
+ win32/dist/htmlhelp/Developer_FAQ.html,
+ win32/dist/htmlhelp/FAQ.html,
+ win32/dist/htmlhelp/Help_Caveats.html,
+ win32/dist/htmlhelp/Introduction.html,
+ win32/dist/htmlhelp/Net-SNMP.hhc,
+ win32/dist/htmlhelp/Net-SNMP.hhp,
+ win32/dist/htmlhelp/snmp.conf.win32.html,
+ win32/dist/htmlhelp/snmpd.conf.win32.html,
+ win32/dist/htmlhelp/snmptrapd.conf.win32.html,
+ win32/dist/installer/Add2Path.nsi,
+ win32/dist/installer/SetEnVar.nsi,
+ win32/dist/installer/net-snmp.nsi, win32/dist/scripts/create-toc,
+ win32/dist/scripts/mandir2html,
+ win32/dist/scripts/net-snmp-perl-test.pl,
+ win32/dist/scripts/poddir2html, win32/dist/scripts/readme2html,
+ win32/dist/scripts/txt2html, win32/dist/tosock1.sh,
+ win32/encode_keychange/encode_keychange.dsp,
+ win32/install-net-snmp.bat, win32/libagent/Makefile.in,
+ win32/libagent/libagent.def, win32/libagent/libagent.dsp,
+ win32/libhelpers/Makefile.in, win32/libhelpers/libhelpers.dsp,
+ win32/libnetsnmptrapd/Makefile.in,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/libsnmp/Makefile.in, win32/libsnmp/libsnmp.dsp,
+ win32/libsnmp_dll/Makefile.in, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/libucdmibs/libucdmibs.def, win32/local/Makefile.in,
+ win32/local/mib2c.bat, win32/local/snmpconf.bat,
+ win32/local/traptoemail.bat, win32/mib_module_dot_conf.h,
+ win32/mib_module_includes.h, win32/mib_module_inits.h,
+ win32/mib_module_shutdown.h,
+ win32/net-snmp/agent/agent_module_config.h,
+ win32/net-snmp/agent/mib_module_config.h,
+ win32/net-snmp/library/snmpv3-security-includes.h,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in,
+ win32/netsnmpmibs/Makefile.in, win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/nmakeperl.bat, win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp, win32/snmpd/Makefile.in,
+ win32/snmpd/snmpd.dsp, win32/snmpdelta/snmpdelta.dsp,
+ win32/snmpdf/snmpdf.dsp, win32/snmpget/snmpget.dsp,
+ win32/snmpgetnext/snmpgetnext.dsp, win32/snmpnetstat/Makefile.in,
+ win32/snmpnetstat/snmpnetstat.dsp, win32/snmpset/snmpset.dsp,
+ win32/snmpsm_init.h, win32/snmpstatus/snmpstatus.dsp,
+ win32/snmptable/snmptable.dsp, win32/snmptest/snmptest.dsp,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrapd/Makefile.in,
+ win32/snmptrapd/snmptrapd.dsp, win32/snmpusm/snmpusm.dsp,
+ win32/snmpvacm/snmpvacm.dsp, win32/snmpwalk/snmpwalk.dsp,
+ win32/win32.dsw, win32/win32dll.dsw:
+
+ Fix 5.5.x branch structure (part 2) git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@19965 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swrun_kinfo.c: proper process
+
+ status values for netbsd git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19962 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swrun_kinfo.c: proper process
+
+ status values for netbsd git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19962 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/scapi.c: conditionalize variable git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19961 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * snmplib/scapi.c: conditionalize variable git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19961 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn.h: tcp-mib/udp-mib
+
+ support for the *bsds git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19960 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn.h: tcp-mib/udp-mib
+
+ support for the *bsds git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19960 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/mibII.h,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint.h,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.
+ c: tcp-mib/udp-mib support for the *bsds git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19959 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/mibII.h,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint.h,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.
+ c: tcp-mib/udp-mib support for the *bsds git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19959 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_a
+ ccess.c: Properly end debug message with newline git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19958 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_a
+ ccess.c: Properly end debug message with newline git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19958 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c: remove var
+
+ that shadows the useful one git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19957 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c: remove var
+
+ that shadows the useful one git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19957 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/ipv6.c: major fiddling to get things working
+
+ for openbsd too. This should really be reworked to use the
+ tcp-mib/udp-mib/data_access git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19956 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/ipv6.c: major fiddling to get things working
+
+ for openbsd too. This should really be reworked to use the
+ tcp-mib/udp-mib/data_access git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19956 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/tcpTable.c: fix tcp states for dragonflybsd
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@19955 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/mibII/tcpTable.c: fix tcp states for dragonflybsd
+ git-svn-id:
+
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@19955 06827809-a52a-0410-b366-d66718629ded
+
+2011-02-21 Niels Baggesen <nba@users.sourceforge.net>
+
+ * agent/mibgroup/mibII.h: enable new tcp/udp mibs for solaris
+ git-svn-id:
+
+
+
+----------------------------------------------------------------------
+
+Changes: V5.7 -> V5.7.1.pre1
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/snmpd.c: fix C++ comments
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, perl/ASN/ASN.pm, perl/AnyData_SNMP/Storage.pm,
+ perl/OID/OID.pm, perl/SNMP/SNMP.pm,
+ perl/TrapReceiver/TrapReceiver.pm, perl/agent/Support/Support.pm,
+ perl/agent/agent.pm, perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm: Version number update:
+
+ 5.7.1.pre1
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * Makefile.top: version update for 5.7.1.pre1
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit cf4cce4c189cf47f4c489db43b7fa510f8906a1a Merge: df91a9f
+
+ 93e97dc Author: Dave Shield <D.T.Shield@liverpool.ac.uk> Date: Mon
+ Aug 8 22:15:28 2011 +0100
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : Merge remote-tracking branch 'origin/V5-6-patches' into
+
+ V5-6-patches
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * win32/Makefile-apps.in, win32/dist/README.build.win32.txt,
+ win32/libagent/Makefile.in, win32/libnetsnmptrapd/Makefile.in,
+ win32/libsnmp/Makefile.in, win32/libsnmp_dll/Makefile.in,
+ win32/netsnmpmibs/Makefile.in, win32/snmpd/Makefile.in,
+ win32/snmpnetstat/Makefile.in, win32/snmptrapd/Makefile.in: Define
+
+ _BIND_TO_CURRENT_VCLIBS_VERSION token (as per Alex' build
+ instructions)
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit df16dc2221e993dd3c66650d5e872577ffe6c01b Merge: 714bc82
+
+ 8e5a28d Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 13:56:43 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit ffa05b051ac3e2b197195a9989cc7a91fe8d9282 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Mon Aug 8 13:55:38
+ 2011 -0700
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : commit 714bc82fa01e21a3655824963fa54e9b8042ffb0 Merge: 6fe8fe5
+
+ 3ef1db5 Author: Dave Shield <D.T.Shield@liverpool.ac.uk> Date: Mon
+ Aug 8 21:21:46 2011 +0100
+
+2011-08-08 Dave Shield <D.T.Shield@liverpool.ac.uk>
+
+ * : commit b451607dca015c111e96fdfeb2ddb0661fb4f724 Author: Dave
+
+ Shield <D.T.Shield@liverpool.ac.uk> Date: Mon Aug 8 21:20:32 2011
+ +0100
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 6fe8fe5294a45bc7e4ea3751a1ad7aa47b5cabb2 Merge: 364f8ff
+
+ f69abe3 Author: Bart Van Assche <bvanassche@acm.org> Date: Mon Aug
+ 8 22:02:38 2011 +0200
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit c94813044a4c4a608e98e80223075c6faf04ee11 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Mon Aug 8 21:56:15 2011 +0200
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 364f8ffaeb90b4eb0165fc855688cd0626632794 Merge: 3287295
+
+ 7abb926 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 11:24:26 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-6-patches' into
+
+ V5-6-patches
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: display the branch we'll commit to
+
+
+2011-08-08 Vladimir Kondratiev <wulf2001@users.sourceforge.net>
+
+ * agent/mibgroup/ucd-snmp/disk_hw.c: CHANGES: snmpd: PATCH 3386633:
+
+ from wulf2001: fix integer overflow in disk percent calculations Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 84a775d0557fea97570e41715a3164970b4c03a2 Merge: 6fff1c1
+
+ d373c4f Author: Bart Van Assche <bvanassche@acm.org> Date: Mon Aug
+ 8 20:12:32 2011 +0200
+
+2011-08-08 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/agent_trap.c: CHANGES: libnetsnmp: PATCH 3387139: from
+
+ yaberauneya: Avoid segfault if trapsess transport element cant be
+ parsed Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: nssfpatchapply: split the
+
+ displayed git commit command into multiple segments
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/helpers/scalar_group.c: CHANGES: snmplib: PATCH: 3386961:
+
+ Make SNMP GET work in an AgentX subagent if write support is
+ disabled via NETSNMP_NO_WRITE_SUPPORT (Mark Rusk).
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/mib.c: CHANGES: snmplib: Fix a crash that could be
+
+ triggered by calling _mibindex_add() with the second argument not
+ equal to -1.
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 6fff1c1ae51b06c9d80faf15373a963d173f14e8 Merge: 837c52e
+
+ 8cc9004 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 10:58:59 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 8ca7ff1e692caec4186b788c9ae2d27be213290f Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Mon Aug 8 10:33:56
+ 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-4-patches' into
+
+ V5-4-patches
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit b8f529cba27c0114b4cb7340cfd449504fa07506 Merge: 0822f2d
+
+ 556e938 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 10:05:36 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: fix function name typo
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 29882a078a959a0f78b03e01968f1d17b7f6a299 Merge: 5e9bd2f
+
+ 0409c0a Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Aug 8 10:03:34 2011 -0700
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : manual merge of pull/push
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: make nspull/nspush check for a
+
+ clean repo
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: new function "nsmakeall" to test
+
+ building on every branch
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: default to merge
+
+
+2011-08-08 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-7-patches' into
+
+ V5-7-patches
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * include/net-snmp/library/tools.h: CHANGES: Windows: Avoid that if
+
+ the Net-SNMP Perl modules have been built with another version of
+ Microsoft Visual Studio than ActivePerl that using one of these Perl
+ modules triggers a "Free to wrong pool" crash. This regression was
+ caused by commit 3b14c59cf8278d410207ff42debda2636426a468 (the
+ netsnmp_free() into SNMP_FREE() changes in the *.xs files).
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit e109539930703cb3052d5241b18ac6fc062faaca Merge: 0c9b6cb
+
+ e46b170 Author: Bart Van Assche <bvanassche@acm.org> Date: Mon Aug
+ 8 18:34:11 2011 +0200
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/mib.c: CHANGES: snmplib: Fix a crash that could be
+
+ triggered by calling _mibindex_add() with the second argument not
+ equal to -1.
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 7f42d0d93320484152271427cc9808cbda49bbd0 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Mon Aug 8 09:50:51 2011 +0200
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0c9b6cbe9dbe2ec5217a95b6781fd7dc1f6ebda7 Merge: fa6cef5
+
+ 963320f Author: Bart Van Assche <bvanassche@acm.org> Date: Mon Aug
+ 8 18:14:36 2011 +0200
+
+2011-08-08 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit a3b8654a232c563bc97cc9925cd98590a30c5bc5 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Mon Aug 8 17:24:18 2011 +0200
+
+2011-08-07 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit fa6cef5ca91df3a0b03455b68559d2bee248101c Merge: f5fe536
+
+ 8add0da Author: Bart Van Assche <bvanassche@acm.org> Date: Sun Aug
+ 7 10:18:54 2011 +0200
+
+2011-08-07 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit a0dd3caf25926e43465718bf417a464c2fb36366 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Sun Aug 7 10:17:01 2011 +0200
+
+2011-08-05 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/deliver/deliverByNotify.c: 32 is too limited for
+
+ bigger tables; increase the max msg count to 128
+
+2011-08-05 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: make rollup and sync support
+
+ --rebase and change the default back to merge
+
+2011-08-05 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-4-patches' into
+
+ V5-4-patches
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * README.win32: CHANGES: Win32: Documented how to use build.bat with
+
+ OpenSSL enabled
+
+2011-07-15 Bart Van Assche <bvanassche@acm.org>
+
+ * README.win32: CHANGES: Windows: Remove outdated instructions about
+
+ editing win32\libsnmp_dll\libsnmp.def from README.win32
+
+2011-07-15 Bart Van Assche <bvanassche@acm.org>
+
+ * README.win32: CHANGES: Win32: Document how to build 64-bit
+
+ executables for the x64/amd64 architecture
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit f5fe536e8fd6c48fe243decd31fac9cf1c92f4cc Merge: 7850ea1
+
+ 80928a8 Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Aug
+ 5 15:13:27 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 80928a8909cfab37f01b39a071a3e8ad85956222 Merge: f16a094
+
+ 0dbc869 Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Aug
+ 5 13:57:30 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0dbc869fec07d8e90dbd1c95493ee7cbc623c95c Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Aug 5 12:40:31 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Add
+
+ perl/agent/default_store/default_store.def and perl/SNMP/t
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 86c1e2b9679fec2cd799ba76005c3d60e9d47634 Merge: bcd8635
+
+ f16a094 Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Aug
+ 5 12:20:50 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 2f8d4f5796cbc1c7e967acdaa8019b24f1520a36 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Aug 5 12:02:51 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/parse.c: Unbreak the V5-4-patches - revert commit
+
+ d2c4768bd2efb48664434a831425c2dda85d7133 (CHANGES: libnetsnmp: PATCH
+ 3362233: from yaberauneya: Mute unnecessary cannot find module
+ noise).
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/mibII/snmp_mib.c, agent/mibgroup/mibII/snmp_mib.h:
+
+ Unbreak the V5-4-patches branch - was broken by commit
+ bf7178b0b22587d43d1a80c269cd216bd5930214 (agent: change type of
+ snmp_enableauthentraps to long)
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * include/net-snmp/library/snmpusm.h: Unbreak the V5-4-patches
+
+ branch - was broken by commit
+ 0e6842fe080cec853b08cd2323015ababc381ce1 (CHANGES: snmptrapd: PATCH
+ 3383441: from sachinsurendran: Fix crash on 5.4.4 due to access of
+ freed memory).
+
+2011-08-05 Thomas Anders <tanders@users.sourceforge.net>
+
+ * NEWS: minor NEWS polish
+
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit bcd86350713822963d376eff582a92f43e426d6c Merge: 9c810a3
+
+ 7a20f71 Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Aug
+ 5 10:28:55 2011 +0200
+
+2011-08-05 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 3aa949fbdfc1a94a8340ad8baf8b314756a0bb9d Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Aug 5 10:26:15 2011 +0200
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 9c810a3b37b68573c40337e246e2faf299b77d31 Merge: 71cb2e8
+
+ 610d63f Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 10:42:08 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 943930e1e124385fd94738b6dcda37d29dc7ac7f Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Thu Aug 4 10:41:41
+ 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-4-patches' into
+
+ V5-4-patches
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 4edcb88dae8b2e59dc683e80d414fa7ecec36885 Merge: 65f3eef
+
+ 2dd9ed0 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 10:24:11 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : Merge remote-tracking branch 'origin/V5-5-patches' into
+
+ V5-5-patches
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit bc5ca03a04ab19c634a34d060b0b16b7484cb520 Merge: 88fddb7
+
+ 90c0e75 Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 4 19:13:07 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/snmp_client.c, snmplib/snmpusm.c: snmpusm: Fix recently
+
+ introduced compiler warnings
+
+2011-08-04 Stuart Henderson <t0jw2fu0kmg@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/memory/memory_netbsd.c: CHANGES: openbsd:
+
+ PATCH 3357932: from t0jw2fu0kmg: Cleaning in memory_netbsd.c Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Vladimir Kondratiev <wulf2001@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/fsys/fsys_getfsstats.c: CHANGES: agent:
+
+ PATCH 3386147: from wulf2001: fix UCD-SNMP-MIB::dskUsed Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 473d7e5cd4d411bba20eb85359d8728063301cbd Merge: a4e8b62
+
+ 88fddb7 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 09:28:22 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 2101bb2d7ad6db038c755aa9193c8ace0dbd4f58 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Thu Aug 4 09:28:06
+ 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * .gitignore: ignore *.orig and *.rej
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: help output describes rebase vs
+
+ merge better
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit f126a17c6a3063455a511940b023047abd9b48ee Merge: ad765f4
+
+ 77a4784 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 09:25:16 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 452e1707f209ec45e7c7f2a3040ef595fb9d1af6 Merge: dc755a6
+
+ b372e5a Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 09:25:03 2011 -0700
+
+2011-08-04 Stuart Henderson <t0jw2fu0kmg@users.sourceforge.net>
+
+ * Makefile.in, acconfig.h, agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/memory.h,
+ agent/mibgroup/if-mib/data_access/interface.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/openbsd.h,
+ include/net-snmp/system/openbsd4.h,
+ include/net-snmp/system/openbsd5.h: CHANGES: openbsd: PATCH
+ 3357927:
+
+ from t0jw2fu0kmg: Recognise openbsd5 Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: fix where arguments are set
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: split nssfpatchapply into two
+
+ parts: apply and commiting
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: patch using -N
+
+
+2011-08-04 David Arnold <dja@users.sourceforge.net>
+
+ * man/default_store.3.bot, man/encode_keychange.1.def,
+ man/fixproc.1.def, man/mib2c.conf.5.in, man/net-snmp-config.1.def,
+ man/netsnmp_agent_api.3.def, man/netsnmp_mib_api.3.def,
+ man/snmp.conf.5.def, man/snmpbulkget.1.def,
+ man/snmpbulkwalk.1.def, man/snmpcmd.1.def, man/snmpconf.1.def,
+ man/snmpd.8.def, man/snmpd.conf.5.def, man/snmpd.examples.5.def,
+ man/snmpdelta.1.def, man/snmpdf.1.def, man/snmpget.1.def,
+ man/snmpgetnext.1.def, man/snmpnetstat.1.def, man/snmpset.1.def,
+ man/snmpstatus.1.def, man/snmptable.1.def, man/snmptest.1.def,
+ man/snmptranslate.1.def, man/snmptrap.1.def, man/snmptrapd.8.def,
+ man/snmptrapd.conf.5.def, man/snmpusm.1.def, man/snmpvacm.1.def,
+ man/snmpwalk.1.def: CHANGES: man: PATCH 3312861: from dja: Man
+ pages
+
+ hyphen-vs-minus cleanup Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Detect (and reject) OpenSSL
+
+ 1.0.0
+
+2011-08-04 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Command-line options for silent
+
+ install
+
+2011-08-04 Dave Shield <dts12@users.sourceforge.net>
+
+ * win32/dist/installer/net-snmp.nsi: Ensure Windows package
+
+ uninstalls completely.
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 81c63fb5c5e4abb9c29aca89bf9d694410086e97 Merge: 4a6920a
+
+ dc755a6 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 08:33:34 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_client.c: added spacing to match the later branches
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : manual merge
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * snmplib/snmp_client.c: removed accidentially duplicated code
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : manual merge
+
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : manual merge
+
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * snmplib/parse.c: CHANGES: libnetsnmp: PATCH 3362233: from
+
+ yaberauneya: Mute unnecessary cannot find module noise Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/agent_read_config.c, agent/snmp_vars.c,
+ configure.d/config_os_headers: CHANGES: freebsd: PATCH 3363308:
+ from
+
+ yaberauneya: Fix compilation on FreeBSD 9.x with recent header
+ shuffling Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: allow nsrollup to take a --merge
+
+ flag for merging instead of rebasing
+
+2011-08-04 Sachin Surendran <sachinsurendran@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpusm.h, snmplib/snmp_client.c,
+ snmplib/snmpusm.c: CHANGES: snmptrapd: PATCH 3383441: from
+
+ sachinsurendran: Fix crash on 5.4.4 due to access of freed memory Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * Makefile.in: CHANGES: freebsd: PATCH 3363328: from yaberauneya:
+
+ Add FreeBSD 9.x to supported OSes list Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * snmplib/parse.c: CHANGES: libnetsnmp: PATCH 3362233: from
+
+ yaberauneya: Mute unnecessary cannot find module noise Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/agent_read_config.c, agent/snmp_vars.c,
+ configure.d/config_os_headers: CHANGES: freebsd: PATCH 3363308:
+ from
+
+ yaberauneya: Fix compilation on FreeBSD 9.x with recent header
+ shuffling Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: allow nsrollup to take a --merge
+
+ flag for merging instead of rebasing
+
+2011-08-04 Sachin Surendran <sachinsurendran@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpusm.h, snmplib/snmp_client.c,
+ snmplib/snmpusm.c: CHANGES: snmptrapd: PATCH 3383441: from
+
+ sachinsurendran: Fix crash on 5.4.4 due to access of freed memory Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * Makefile.in: CHANGES: freebsd: PATCH 3363328: from yaberauneya:
+
+ Add FreeBSD 9.x to supported OSes list Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * snmplib/parse.c: CHANGES: libnetsnmp: PATCH 3362233: from
+
+ yaberauneya: Mute unnecessary cannot find module noise Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/agent_read_config.c, agent/snmp_vars.c,
+ configure.d/config_os_headers: CHANGES: freebsd: PATCH 3363308:
+ from
+
+ yaberauneya: Fix compilation on FreeBSD 9.x with recent header
+ shuffling Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: allow nsrollup to take a --merge
+
+ flag for merging instead of rebasing
+
+2011-08-04 Sachin Surendran <sachinsurendran@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpusm.h, snmplib/snmp_client.c,
+ snmplib/snmpusm.c: CHANGES: snmptrapd: PATCH 3383441: from
+
+ sachinsurendran: Fix crash on 5.4.4 due to access of freed memory Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * snmplib/parse.c: CHANGES: libnetsnmp: PATCH 3362233: from
+
+ yaberauneya: Mute unnecessary cannot find module noise Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: allow nsrollup to take a --merge
+
+ flag for merging instead of rebasing
+
+2011-08-04 Sachin Surendran <sachinsurendran@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpusm.h, snmplib/snmp_client.c,
+ snmplib/snmpusm.c: CHANGES: snmptrapd: PATCH 3383441: from
+
+ sachinsurendran: Fix crash on 5.4.4 due to access of freed memory Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/memory/memory_freebsd.c,
+ agent/mibgroup/mibII/ipAddr.c, snmplib/keytools.c,
+ snmplib/scapi.c:
+
+ CHANGES: building: PATCH 3383951: from yaberauneya: Fix -Wunused
+ compile warnings with FreeBSD/NetBSD Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/memory/memory_freebsd.c,
+ agent/mibgroup/mibII/ipAddr.c, snmplib/keytools.c,
+ snmplib/scapi.c:
+
+ CHANGES: building: PATCH 3383951: from yaberauneya: Fix -Wunused
+ compile warnings with FreeBSD/NetBSD Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit e878abbdb1808ef83e0a8074536fb54e13219a8b Merge: 403de42
+
+ 878fbf4 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 07:55:00 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 250afa06892fd897ac31e3836a7ffc9e2b4cf7b9 Merge: 2c14c1c
+
+ 3afc5e0 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 07:51:33 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 578cd7cce351ae8d904ec3d80be9ba6d1d48a712 Merge: 25988be
+
+ f3bc551 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Thu Aug 4 07:50:56 2011 -0700
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : autoconf
+
+
+2011-08-04 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * configure.d/config_os_struct_members: CHANGES: building: PATCH
+
+ 3383949: from yaberauneya: Fix autoconf tests for sys/mbuf.h Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: prompt for patch and an area, and
+
+ use the proper CHANGES line format
+
+2011-08-04 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: Use fetch --all and rebase as
+
+ suggested by Bart for speed improvements
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit d6a1a89e6f648951a9b831932d3cc230821f2d37 Merge: dcb712f
+
+ 872e013 Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 4 12:06:18 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 44969b4e57c27194e5bd357bc45275feb8695d22 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Jul 8 20:52:25 2011 +0200
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/winExtDLL.c: CHANGES: Win32: winExtDLL: Invoke
+
+ SnmpUtilOidFree() before SnmpUtilOidCpy(). It's not clear yet why
+ the original code did not make snmpwalk trigger a memory leak.
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit dcb712ffc86b33583000ef4ae9a51ced25cd15bf Merge: e85cfa5
+
+ 98623ef Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 4 11:36:17 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 8a01ec6423d400c4a13ccac68a3791d0218a0885 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Thu Aug 4 11:19:17 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit e85cfa599b23b76d97913c96b5d703bff6ba4944 Merge: b056ee6
+
+ e21eef2 Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Aug
+ 4 08:44:43 2011 +0200
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/host/data_access/swinst_pkginfo.c: CHANGES: agent:
+
+ Avoid that a MIB walk on the host resources MIB triggers a crash on
+ Fedora 15
+
+2011-08-04 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit b056ee6eb53909ad04f16ec26d2690d7a083192a Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Thu Aug 4 07:59:04 2011 +0200
+
+2011-08-03 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/agent_trap.c, agent/helpers/table_array.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_acc
+ ess.c, agent/mibgroup/host/data_access/swinst_pkginfo.c,
+ agent/mibgroup/host/data_access/swrun_procfs_status.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access
+ .c, agent/mibgroup/smux/smux.c, agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c, agent/snmp_agent.c,
+ apps/snmpbulkget.c, apps/snmptls.c, apps/snmptrapd_log.c,
+ perl/SNMP/SNMP.xs, snmplib/container_iterator.c,
+ snmplib/dir_utils.c, snmplib/snmp_api.c, snmplib/snmp_client.c,
+ snmplib/snmp_enum.c, snmplib/snmp_openssl.c, snmplib/snmpusm.c,
+ snmplib/transports/snmpTLSTCPDomain.c: CHANGES: snmplib, snmpd:
+
+ perl: Eliminate dead variables
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit ae8e3ecd2df4cf37625944aded1dfe4735d44eea Merge: 73187ce
+
+ 9335e19 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Wed Aug 3 14:37:36 2011 -0700
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 794f9a69d7eb642268200b0a4b199151def66ed0 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Wed Aug 3 14:36:25
+ 2011 -0700
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a comment
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: at end of nsrollup mention that
+
+ now would be a good time to run nssync
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: a new nssync() function for
+
+ push/pulling active branches
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a comment
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: at end of nsrollup mention that
+
+ now would be a good time to run nssync
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: a new nssync() function for
+
+ push/pulling active branches
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: at end of nsrollup mention that
+
+ now would be a good time to run nssync
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: a new nssync() function for
+
+ push/pulling active branches
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a comment
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: at end of nsrollup mention that
+
+ now would be a good time to run nssync
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: a new nssync() function for
+
+ push/pulling active branches
+
+2011-08-03 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib.h: Reenable IP-MIB::ipDefaultRouterTable
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: A new function: nssfpatchapply
+
+ that auto-pulls git command line info from SF
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i: added variables names to
+
+ the generated error messages.
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c: Wording changes to
+
+ help describe contexts better
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/Makefile.in, local/mib2c-conf.d/generic-get-U64.m2i: Added
+
+ the missing U64 m2i file
+
+2011-08-03 Garrett Cooper <yaberauneya@users.sourceforge.net>
+
+ * agent/mibgroup/ip-mib.h: Reenable IP-MIB::ipDefaultRouterTable
+ Signed-off-by: Wes Hardaker <hardaker@users.sourceforge.net>
+
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: A new function: nssfpatchapply
+
+ that auto-pulls git command line info from SF
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i: added variables names to
+
+ the generated error messages.
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c: Wording changes to
+
+ help describe contexts better
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/Makefile.in, local/mib2c-conf.d/generic-get-U64.m2i: Added
+
+ the missing U64 m2i file
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: A new function: nssfpatchapply
+
+ that auto-pulls git command line info from SF
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i: added variables names to
+
+ the generated error messages.
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c: Wording changes to
+
+ help describe contexts better
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/Makefile.in, local/mib2c-conf.d/generic-get-U64.m2i: Added
+
+ the missing U64 m2i file
+
+2011-08-03 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: A new function: nssfpatchapply
+
+ that auto-pulls git command line info from SF
+
+2011-07-18 Ilya Yanok <yanok@emcraft.com>
+
+ * agent/agent_trap.c, agent/mibgroup/mibII/snmp_mib.c: agent: change
+
+ type of snmp_enableauthentraps to long Type of snmp_enableauthentraps variable is changed from int to long.
+ This fixes the bug with writing to snmpEnableAuthenTraps if server
+ is compiled for 64bit (snmpset reports wrong length). This bug was
+ introduced a long time ago (by faeecd0 commit). Actually this is a 'less effort' type of fix but I wonder why we
+ need a long to store an INTEGER in the first place? Signed-off-by: Ilya Yanok <yanok@emcraft.com> Signed-off-by: Wes
+ Hardaker <hardaker@users.sourceforge.net>
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i: added variables names to
+
+ the generated error messages.
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c: Wording changes to
+
+ help describe contexts better
+
+2011-08-02 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/Makefile.in, local/mib2c-conf.d/generic-get-U64.m2i: Added
+
+ the missing U64 m2i file
+
+2011-08-03 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 6ad7e28ff9e5e4ebc1358ee39cc9796a44a1bee7 Merge: f2832e3
+
+ 1e154ce Author: Bart Van Assche <bvanassche@acm.org> Date: Wed Aug
+ 3 19:15:24 2011 +0200
+
+2011-08-03 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 61b178f1ee8952aa03aa3b1ba51f4a6655e47f01 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Wed Aug 3 18:09:47 2011 +0200
+
+2011-08-03 Bart Van Assche <bvanassche@acm.org>
+
+ * include/net-snmp/types.h: Whitespace-only change: fix indentation
+
+ of an #include directive
+
+2011-08-02 Bart Van Assche <bvanassche@acm.org>
+
+ * perl/NetSNMP.xs: CHANGES: Perl: Remove file perl/NetSNMP.xs
+
+ because it breaks the Windows build. To Wes: if you can tell me how to reproduce the problem you observed
+ I'll try to find a portable fix. This reverts commit d54871f5293675c8058ecce88fed5b646c836323 ("Added
+ a bogus empty .xs file for bundling on newer perl that wants
+ "something"").
+
+2011-08-02 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0f489b199adab48b1633ebcaf5ff5a7c22c4cb89 Merge: f4eaa02
+
+ 72a59bc Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Aug
+ 2 10:11:53 2011 +0200
+
+2011-08-02 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 7fcc0b8032f8da5b7bc30059af0ba656eae71091 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Mon Aug 1 14:11:28 2011 +0200
+
+2011-08-02 Bart Van Assche <bvanassche@acm.org>
+
+ * *
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_dat
+ a_access.c: Fix a compiler warning in
+
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c
+
+2011-08-01 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Add file names and patterns for output
+
+ files generated during the Windows build
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Sort alphabetically
+
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Add apps/sshtosnmp
+
+
+2011-08-01 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore, perl/TrapReceiver/const-c.inc,
+ perl/TrapReceiver/const-xs.inc: Remove two generated Perl files.
+
+
+2011-08-02 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit f4eaa02d9b076a67d7272de7eef8e9dfbf189bbf Merge: 40125d8
+
+ adadcb9 Author: Thomas Anders <tanders@users.sourceforge.net> Date:
+ Tue Aug 2 00:57:51 2011 +0200
+
+2011-08-02 Thomas Anders <tanders@users.sourceforge.net>
+
+ * dist/nsb-functions: suppress "ok" test output in nsb
+
+
+2011-08-01 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit 40125d8539cd89f952fbc24588c5e81e9cd821fe Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Mon Aug 1
+ 13:58:33 2011 +0200
+
+2011-08-01 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 5acf0d2ceb3977964ed39f003073ba64138c2ebd Author: Thomas
+
+ Anders <tanders@users.sourceforge.net> Date: Sun Jul 31 23:57:41
+ 2011 +0200
+
+2011-07-31 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit a7722a81f9cb7aa8670e7c238601362a31087acc Merge: 242e179
+
+ ae9ac6c Author: Bart Van Assche <bvanassche@acm.org> Date: Sun Jul
+ 31 09:11:45 2011 +0200
+
+2011-07-31 Bart Van Assche <bvanassche@acm.org>
+
+ * apps/sshtosnmp.c: Fix an incorrect source code comment: there is
+
+ no requirement in the ANSI C standard that stack variables should be
+ initialized to zero.
+
+2011-07-31 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 242e1797b2694a0689856ae36d05d3413aaf8d77 Author: Thomas
+
+ Anders <tanders@users.sourceforge.net> Date: Sun Jul 31 01:44:09
+ 2011 +0200
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * snmplib/system.c: CHANGES: building: build fix for systems lacking
+
+ getaddrinfo() and EAI_FAIL (e.g. HP-UX 10.20/11.00)
+
+2011-07-30 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 18df759f19b975c449d010bb0a162119bb68360d Merge: 54a44cb
+
+ 7050718 Author: Bart Van Assche <bvanassche@acm.org> Date: Sat Jul
+ 30 16:39:13 2011 +0200
+
+2011-07-30 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 82d73fb11be3ae31f39c9d618d5388dc9b1006d7 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Jul 29 20:51:27 2011 +0200
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure, include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: autoreconf
+
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * configure, include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: autoreconf
+
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 109f6694d788f48ebd9fc0a1e90c45abc37bea20 Author: Thomas
+
+ Anders <tanders@users.sourceforge.net> Date: Sat Jul 30 14:22:19
+ 2011 +0200
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * : commit 7d8100eed459a1ff1a20c067364fa6cb47491309 Merge: 116c24f
+
+ 9e47ac4 Author: Thomas Anders <tanders@users.sourceforge.net> Date:
+ Sat Jul 30 00:20:01 2011 +0200
+
+2011-07-30 Thomas Anders <tanders@users.sourceforge.net>
+
+ * dist/nsb-functions, dist/nsb-nightly, dist/nsb-package: minor nsb
+
+ fixes/enhancements from my old svn tree
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 116c24f0f7fb3f99ba646730f61c56d1ae23ba41 Merge: 982fb7f
+
+ 4fc0b8b Author: Bart Van Assche <bvanassche@acm.org> Date: Fri Jul
+ 29 11:31:20 2011 +0200
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit c48173c06a9eaadbf81e6b4962d55ef0a54db251 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Fri Jul 29 10:27:39 2011 +0200
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * configure, ltmain.sh, m4/libtool.m4: Rerun autoreconf
+
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Sort alphabetically
+
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Add apps/sshtosnmp
+
+
+2011-07-29 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/host/hr_storage.h,
+ agent/mibgroup/host/hrh_storage.c: Fix two filenames in host mib
+
+ source code comments.
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit 982fb7fd8bab25c4322aa62c50437036ce296e3e Merge: 1eda675
+
+ 3458128 Author: Jan Safranek <jsafranek@users.sourceforge.net> Date:
+ Thu Jul 28 16:24:03 2011 +0200
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: Fix potential
+
+ sigsegv when an ifTable entry is removed as result of both
+ interface_replace_old and interface_fadeout at the same time.
+
+2011-07-28 Bart Van Assche <bvanassche@acm.org>
+
+ * apps/sshtosnmp.c: Make apps/sshtosnmp.c build again (was broken by
+
+ commit 612247cdf14c1e745c384cefe1f3fde3e445b347 that changed
+ MSG_NOSIGNAL into NETSNMP_NOSIGNAL)
+
+2011-07-28 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 1eda6753b7fe7d3b3f217c09254ec02d0ee1d0ce Merge: db8b860
+
+ a2f9ece Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Jul
+ 28 15:32:28 2011 +0200
+
+2011-07-28 Niels Baggesen <nba@users.sourceforge.net>
+
+ * configure.d/config_os_functions, configure.d/config_os_libs1:
+
+ CHANGES: snmpd: Restore storage tables on Linux
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * man/snmpd.conf.5.def: Document interface_replace_old option.
+
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: CHANGES:
+
+ snmpd: added 'interface_replace_old' option to remove old entries in
+ ifTable when an interface with the same name as already exising one
+ appears. E.g. remove old ppp0 interface when new ppp0 shows up.
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * man/snmpd.conf.5.def: Document the interface_fadeout option.
+
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: Allow ifTable
+
+ entries to be deleted immediately when appropriate interface
+ disappears (i.e. interface_fadeout = 0 works as expected).
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: CHANGES:
+
+ snmpd: added 'interface_fadeout' configuration option to set
+ lifetime of ifTable entries of removed interfaces. Previous lifetime was hardcoded 5 minutes, now it's configurable.
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit d62a0eb9070b4d8d9fe2bcfdb4d53d37ef814f9b Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Thu Jul 28
+ 14:49:08 2011 +0200
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: CHANGES:
+
+ snmpd: added 'interface_replace_old' option to remove old entries in
+ ifTable when an interface with the same name as already exising one
+ appears. E.g. remove old ppp0 interface when new ppp0 shows up.
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * man/snmpd.conf.5.def: Document the interface_fadeout option.
+
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: Allow ifTable
+
+ entries to be deleted immediately when appropriate interface
+ disappears (i.e. interface_fadeout = 0 works as expected).
+
+2011-07-28 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c: CHANGES:
+
+ snmpd: added 'interface_fadeout' configuration option to set
+ lifetime of ifTable entries of removed interfaces. Previous lifetime was hardcoded 5 minutes, now it's configurable.
+
+2011-07-28 Thomas Anders <tanders@users.sourceforge.net>
+
+ * apps/sshtosnmp.c, include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/transports/snmpUDPBaseDomain.c: CHANGES: building: build
+ fix
+
+ for systems lacking MSG_DONTWAIT
+
+2011-07-27 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/mibII/tcp.c: CHANGES: snmpd: Make
+
+ TCP-MIB::tcpCurrEstab work again. Was broken in 5.7 by the
+ introduction of the "features" feature.
+
+2011-07-27 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit fb88074fbbc268c7f0509491535aec5fecb05684 Merge: a743ae5
+
+ 3821273 Author: Jan Safranek <jsafranek@users.sourceforge.net> Date:
+ Wed Jul 27 14:47:25 2011 +0200
+
+2011-07-27 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit 31fa07cd9ffde46d41d2b5838c3fc4d01548bfb5 Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Wed Jul 27
+ 14:45:47 2011 +0200
+
+2011-07-27 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * agent/snmpd.c: CHANGES: snmpd: run signal handlers when select()
+
+ is interrupted. This behavior is indicated in comment on line 1244, but it was not
+ actually done.
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 2e9466d7f59d65d050277735e4ed9d30719ff752 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Tue Jul 26 13:10:04 2011 +0200
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 7708296760eaf5a80d8540746c9c249826fd1bfe Merge: ea11e5e
+
+ cd6e382 Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Jul
+ 26 16:21:41 2011 +0200
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/snmpUDPIPv6Domain.c: Clarify an IPv6 source code comment
+
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/agent_handler.c, man/netsnmp_handler.3: Spelling fix:
+
+ definedy -> defined
+
+2011-07-26 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/helpers/stash_cache.c, man/netsnmp_stash_cache.3: Spelling
+
+ fix: aleviate -> alleviate
+
+2011-07-26 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit dd2c47133493d5a00de6b3cdbcfac7e9d44b6ffe Merge: f9ccbc7
+
+ ea11e5e Author: Jan Safranek <jsafranek@users.sourceforge.net> Date:
+ Tue Jul 26 14:25:28 2011 +0200
+
+2011-07-26 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit c5a8464c42a94c250ee2dfa2a473109a734203d8 Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Tue Jul 26
+ 14:24:55 2011 +0200
+
+2011-07-25 Jan Safranek <jsafranek@users.sourceforge.net>
+
+ * : commit f9ccbc772666134d1d178b505af9ddcdd9ed4244 Author: Jan
+
+ Safranek <jsafranek@users.sourceforge.net> Date: Mon Jul 25
+ 15:02:15 2011 +0200
+
+2011-07-20 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit b0c0a355d5f601a11be4914fbf713716abd30a29 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Tue Jul 19
+ 18:36:11 2011 -0700
+
+2011-07-20 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit c14fc38614baf10d517136f0480907b7f03d8d74 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Wed Jul 20
+ 13:44:59 2011 -0700
+
+2011-07-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/testhandler.c: remove broken whitespace lines that
+
+ leads to reading confusion
+
+2011-07-20 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit ebdd216c074bf41cd3a084bd14689cf01c887b31 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Tue Jul 19
+ 18:36:11 2011 -0700
+
+2011-07-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * .gitignore: updated gitignore to ignore a number of auto-generated
+
+ files
+
+2011-07-19 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/mibgroup/testhandler.c: remove broken whitespace lines that
+
+ leads to reading confusion
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit df5f70055cf9be33f05fb50abe2f5a81eac092ad Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Tue Jul 19 11:07:19 2011 +0200
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit f596f18242dcdfd6cf49c88da1d836c16e260cac Merge: 0f309b4
+
+ 70dee4b Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Jul
+ 19 11:33:28 2011 +0200
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/agent_trap.c, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c: CHANGES: snmpd: PATCH:
+ 3369680:
+
+ from Ilya Yanok: change snmp_enableauthentraps from int to long such
+ that modifying the corresponding MIB object does not overwrite
+ memory in 64-bit builds.
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * agent/mibgroup/agentx/subagent.c: CHANGES: snmpd: PATCH: 3370645:
+
+ from Bill Fenner: Fix AgentX subagent four byte leak
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test harness: do
+
+ not invoke ISRUNNING() on MinGW.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test harness:
+
+ cleanup - remove code that became superfluous.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: MinGW: Do not
+
+ assume that kill.exe reports via its exit status whether the
+ signalled process still exists.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ Remove the function WAITORDIE() from simple_eval_tools.sh since it
+ is never invoked.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ Simplify WAITFOR() in simple_eval_tools.sh. The code that handled
+ invocation of WAITFOR() with zero or one arguments has been dropped
+ since WAITFOR() is always invoked with two arguments.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test harness:
+
+ minor simplification.
+
+2011-07-08 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/default/T059trapdtraphandle_simple: CHANGES:
+
+ testing: Skip test 59 if SIGHUP is not supported. Makes test 59 pass
+ on MinGW.
+
+2011-07-06 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: MinGW fix
+
+
+2011-07-06 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test framework
+
+ refactoring: Introduce WAITFORNOTCOND().
+
+2011-07-05 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ Make STOPPROG send SIGTERM repeatedly. This fixes a race where
+ SIGTERM could be sent before the SIGTERM signal handler was set up,
+ especially when running the regression tests under Valgrind.
+ CHANGES: testing: Make the SNMP_VERBOSE=1 output even more verbose.
+
+2011-07-05 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Test harness
+
+ refactoring: introduce ECHOSENDSIGTERM() and ECHOSENDSIGKILL()
+
+2011-07-05 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: Fix a bug in
+
+ testing/fulltests/support/simple_eval_tools.sh that was introduced
+ in commit 938d75c.
+
+2011-07-01 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: .gitignore: Ignore *.exe files generated by the Win32
+
+ build
+
+2011-07-04 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ Test only once during a test whether the shell supports sub-second
+ sleeping instead of repeatedly.
+
+2011-07-04 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_run: CHANGES: testing: Changed
+
+ default timeout from 1s to 10s when the regression tests are run
+ under Valgrind
+
+2011-07-04 Bart Van Assche <bvanassche@acm.org>
+
+ * testing/fulltests/support/simple_eval_tools.sh: CHANGES: testing:
+
+ After having sent SIGTERM to snmpd or snmptrapd, wait until the
+ process has stopped before sending SIGKILL. This race condition was
+ hit most easily when running the regression tests under Valgrind.
+ CHANGES: testing: Check PID file existence after having read it
+ instead of before. This fixes the race condition where the PID file
+ disappeared after the existence check and before it was read.
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Fix a bug in a debug statement
+
+ introduced by patch 3310250 / r20494: use %ld to print a value of
+ type oid instead of %d. This patch is a combination of the following to V5.6 SVN patches: git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20511 06827809-a52a-0410-b366-d66718629dedgit-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20512 06827809-a52a-0410-b366-d66718629ded
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 0f309b493c21d3c6914487514b41560754ffcdf9 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Tue Jul 19 08:37:50 2011 +0200
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit 1b7454bc281568470a1300476d2edb4f411e6029 Merge: 8d9dcc8
+
+ 690ea7d Author: Bart Van Assche <bvanassche@acm.org> Date: Tue Jul
+ 19 08:31:28 2011 +0200
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * apps/snmptrapd.c: CHANGES: snmptrapd: Add missing newline
+
+ character in a log message
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * apps/snmptrapd.c: CHANGES: snmptrapd: Invoke shutdown_perl() when
+
+ shutting down
+
+2011-07-19 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/snmpUDPIPv6Domain.c: Spelling fix: branket -> bracket
+
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * configure, include/net-snmp/net-snmp-config.h.in: Run autoreconf.
+
+ Fixes build breakage caused by patch
+ d588ec853bd0531f212fcbf51b962b96c6828b59 (RPM 4.9 support)
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit d617d84f83fa69ed9fa9f98efc4afaf880d121f2 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Thu Jul 14 16:43:47 2011 +0200
+
+2011-07-14 Bart Van Assche <bvanassche@acm.org>
+
+ * snmplib/transports/snmpIPv6BaseDomain.c: CHANGES: snmplib: Make
+
+ netsnmp_ipv6_fmtaddr() show the IPv6 scope ID
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in: CHANGES: Win32: Add support
+ for
+
+ IPv6 address scope ID
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * configure, include/net-snmp/net-snmp-config.h.in: Run autoreconf
+
+
+2011-07-17 Bart Van Assche <bvanassche@acm.org>
+
+ * : commit a56721a3e7754e389daa7e8a3d5792899edc9de3 Author: Bart Van
+
+ Assche <bvanassche@acm.org> Date: Thu Jul 14 16:18:32 2011 +0200
+
+2011-07-15 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 844d4ce867bf3abe7b7536c5dbfba401937a8d4a Merge: eed0198
+
+ 61036a8 Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Fri Jul 15 15:33:10 2011 -0700
+
+2011-07-15 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit 851bcf53fcd13cdf0ba9f12e5d603e73f8bb9611 Author: Wes
+
+ Hardaker <hardaker@users.sourceforge.net> Date: Fri Jul 15
+ 15:32:49 2011 -0700
+
+2011-07-14 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * agent/helpers/cache_handler.c: fix a typo
+
+
+2011-07-13 Robert Story <rstory@localhost>
+
+ * snmplib/parse.c: CHANGES: snmplib: tweak patch 3044888 to restore
+
+ proper non-error return during mib loading
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : added 5.7 patches to the branch list and fix the release file
+
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : added 5.7 patches to the branch list
+
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/release: a copy of the release file applied to the older
+
+ branches
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added 5.7 patches
+
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * : commit c431231e8f0a39d1950bc72c32e3402f90fa8030 Merge: 56fee40
+
+ a2ac24d Author: Wes Hardaker <hardaker@users.sourceforge.net> Date:
+ Mon Jul 11 19:33:17 2011 -0700
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a copy of the
+
+ shell-functions to the older branch
+
+2011-07-11 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/release: a copy of the release file applied to the older
+
+ branches
+
+----------------------------------------------------------------------
+
+Changes: V5.7.rc3 -> V5.7
+
+2011-07-01 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7
+
+
+2011-07-01 Robert Story <rstory@users.sourceforge.net>
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c: Revert "fix dtlsudp
+
+ transport address format function" This reverts commit 2ab3a6e6f2fcc1ff3e5f0fb5dc5d05e498820d89. - for some reason I saw 'rc' and my brain interpreted it as 'pre-release'. What can I say, it was late. :-/
+
+2011-07-01 Robert Story <rstory@localhost>
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c: fix dtlsudp transport
+
+ address format function - update ipv4 fmtaddr to handle sockaddr and to check size before assuming data is addr pair - move dtlsudp functions to extract addr(s) to tlsbase
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: fix tag pushing
+
+----------------------------------------------------------------------
+
+Changes: V5.7.rc2 -> V5.7.rc3
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec: Version number update: 5.7.rc3
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: remove unneeded comment
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: misc publication fixes found while
+ publishing
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * include/net-snmp/net-snmp-config.h.in: ran autoheader to add the
+ missing template ifdefs
+
+----------------------------------------------------------------------
+
+Changes: V5.7.rc1 -> V5.7.rc2
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: use the new run-autoconf script
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/run-autoconf: A script to invoke the correct version of the
+ autoconf tool
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: remaining command line changes for svn ->
+ git
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: make the branch echo output and svn update
+ converted to git equivalents
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/makerelease.xml: pull the branch info from git
+
+2011-06-29 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * dist/release: noted that the master branch is in rc state
+
+2011-06-28 Wes Hardaker <opensource@hardakers.net>
+
+ * FAQ: Mention the Git wiki page
+
+2011-06-28 Wes Hardaker <opensource@hardakers.net>
+
+ * local/gittools/shell-functions: use git merge with the --log
+ option
+
+2011-06-28 Bart Van Assche <bvanassche@acm.org>
+
+ * .gitignore: Add .gitignore
+
+2011-06-28 Wes Hardaker <opensource@hardakers.net>
+
+ * FAQ: We're now using git!
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: use rebase to put local changes at
+ the top of the remote branches git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20533 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a feature to not roll
+ branches currenly in rc phase git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20532 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a nsrollup function for
+ rolling branches upward. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20531 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: created an nspatchapply function
+ to apply a previously tested patch git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20530 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added a nstrypatch function to
+ test patch application against various branches git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20529 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: added verbose output git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20528 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: more prefix changes and better
+ setting of default values git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20527 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-27 Wes Hardaker <hardaker@users.sourceforge.net>
+
+ * local/gittools/shell-functions: use ns prefixes instead of generic
+ snmp prefixes git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20526 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20524 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in:
+ Missing check for rpmts.h git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20523 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * configure: Version number update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20522 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * man/netsnmp_agent.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3: documentation update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20521 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-24 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.in, dist/net-snmp.spec,
+ snmplib/snmp_version.c: Version number update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20520 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-23 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swinst.c, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in: Tweak RPM handling to work
+ with library version 4.9 Based on a patch by Jan Safranek git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20519 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/hr_swinst.c: Provide a framework for reading
+ RPM package information from a cache directory (rather than querying
+ the RPMdb directly). My apologies to Jeff Johnson for the delay in adding this
+ functionality. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20518 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * ChangeLog: version update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20516 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * configure: Version number update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20515 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-22 Dave Shield <dts12@users.sourceforge.net>
+
+ * FAQ, README, configure, configure.in, dist/net-snmp.spec,
+ snmplib/snmp_version.c: Version number update git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@20514 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-21 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c: Provide a
+ framework for reading RPM package information from a cache directory
+ (rather than querying the RPMdb directly). My apologies to Jeff Johnson for the delay in adding this
+ functionality. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20513 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-21 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c: Provide a
+ framework for reading RPM package information from a cache directory
+ (rather than querying the RPMdb directly). My apologies to Jeff Johnson for the delay in adding this
+ functionality. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20513 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-21 Dave Shield <dts12@users.sourceforge.net>
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c: Provide a
+ framework for reading RPM package information from a cache directory
+ (rather than querying the RPMdb directly). My apologies to Jeff Johnson for the delay in adding this
+ functionality. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@20513 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-19 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Follow-up for r20511: really use
+ the proper format specification. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20512 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-19 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Follow-up for r20511: really use
+ the proper format specification. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20512 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Fix a bug in a debug statement
+ introduced by patch 3310250 / r20494: use %ld to print a value of
+ type oid instead of %d. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-6-patches@20511 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/mibgroup/agentx/protocol.c: Fix a bug in a debug statement
+ introduced by patch 3310250 / r20494: use %ld to print a value of
+ type oid instead of %d. git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20511 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/helpers/cache_handler.c: Use %p to print a pointer instead
+ of %ld git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-4-patches@20510 06827809-a52a-0410-b366-d66718629ded
+
+2011-06-17 Bart Van Assche <bvassche@users.sourceforge.net>
+
+ * agent/helpers/cache_handler.c: Use %p to print a pointer instead
+ of %ld git-svn-id:
+
+ file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-5-patches@20510 06827809-a52a-0410-b366-d66718629ded
+
+----------------------------------------------------------------------
+
+Changes: V5.7.pre2 -> V5.7.rc1
+
+2011-06-13 16:11 hardaker
+
+ * configure:
+
+ run correct version of autoconf
+
+2011-06-13 16:10 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2011-06-13 16:04 hardaker
+
+ * configure:
+
+ ran autoconf
+
+2011-06-10 06:03 nba
+
+ * configure.d/config_modules_security_modules:
+
+ Fix build of snmpusm when additional sec modules requested
+
+2011-06-09 21:13 nba
+
+ * snmplib/cert_util.c:
+
+ Include stdॆअआॆअ‡ib.h to make dmalloc happy
+
+2011-06-09 14:35 rstory
+
+ * snmplib/snmp_transport.c:
+
+ CHANGES: BUG: 3151845: fix multiple registrations of snmp
+ transport handler
+
+2011-06-08 16:34 rstory
+
+ * include/net-snmp/library/default_store.h, snmplib/snmp_api.c,
+ snmplib/system.c:
+
+ more dnssec tweaks
+
+ - create an app-global validator context for use with all
+ validation routines. mainly useful for long-lived apps.
+ - use the apptype as the validator 'scope', allowing
+ for app-specific configuration of validation via libval's
+ dnsval.conf
+
+2011-06-07 16:48 rstory
+
+ * include/net-snmp/library/default_store.h:
+
+ add a max define for each default store type
+
+ not actually used, just a helpful reminder for those adding
+ new ids who might not think to check NETSNMP_DS_MAX_SUBIDS.
+ (the bool list is rapidly approaching the current limit.)
+
+2011-06-07 16:46 rstory
+
+ * testing/fulltests/support/simple_run:
+
+ mention builddir when complaining about not being run from source
+ tree
+
+2011-06-01 22:24 hardaker
+
+ * agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: snmpd: patch 3310250: from fenner: misc fixes for
+ debugging output of agentx
+
+
+
+----------------------------------------------------------------------
+
+Changes: V5.6 -> V5.7.pre2
+
+2011-05-10 00:20 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2011-05-10 00:20 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ C++ -> C comments
+
+2011-05-10 00:17 hardaker
+
+ * NEWS:
+
+ NEWS update for 5.7
+
+2011-05-09 23:14 hardaker
+
+ * include/net-snmp/library/oid.h:
+
+ revert the oid typedef resizing from r17809 because it broke
+ backwards compat, as pointed out by users on the -coders list
+
+2011-05-09 22:51 hardaker
+
+ * configure:
+
+ use proper autoconf version
+
+2011-05-09 22:38 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, perl/ASN/ASN.pm,
+ perl/AnyData_SNMP/Storage.pm, perl/OID/OID.pm, perl/SNMP/SNMP.pm,
+ perl/TrapReceiver/TrapReceiver.pm,
+ perl/agent/Support/Support.pm, perl/agent/agent.pm,
+ perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm:
+
+ Version number update
+
+2011-05-09 22:38 hardaker
+
+ * Makefile.top:
+
+ version update
+
+2011-05-09 22:10 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ added a missing 0 in the revision date
+
+2011-05-09 20:52 nba
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c:
+
+ Use symbolic named for ifType values
+
+2011-05-09 20:43 nba
+
+ * mibs/rfcmibs.diff:
+
+ IANA has fixed the IANA-IPPM-METRICS-REGISTRY-MIB
+
+2011-05-09 15:24 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ added a new REVISION clause to list the changes in the the recent
+ update
+
+2011-05-09 14:19 hardaker
+
+ * NEWS:
+
+ added ping/traceroute mibs note
+
+2011-05-09 14:19 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ we actually want to use the base OID as the starting point, not
+ the reg OID.
+
+2011-05-09 14:18 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ fixed the proxy support to do a proper OID less than OID compare.
+ We actually don't care about the length of the original request,
+ only
+ that it was before the registered rebase
+
+2011-05-09 14:18 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ CHANGES: patch 3140833: from jsafranek: fix proxy GETNEXT
+ requests
+ When OIDs requested are below the proxy request remap, we need to
+ not
+ include any OIDs that might be in the space between the original
+ OID
+ and the remapped OID. This patch fudges the request so that it
+ fixes
+ the request OID so it's just before the remapped proxy range.
+
+2011-05-09 14:18 hardaker
+
+ * agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat.h,
+ include/net-snmp/agent/hardware/cpu.h, mibs/UCD-SNMP-MIB.txt:
+
+ NEWS: PATCH 3167325: from krisztoforo: UCD-SNMP/SystemStats: add
+ variables
+ to report cpusteal, cpuguest, cpuguestnice
+
+2011-05-09 14:17 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface.c:
+
+ CHANGES: patch 3184026: from eivnaes: Avoid constant refresh of
+ interface statistics
+
+2011-05-09 10:44 bvassche
+
+ * agent/snmp_agent.c, apps/snmpdelta.c, snmplib/scapi.c,
+ snmplib/snmp_api.c, snmplib/system.c, snmplib/tools.c:
+
+ Fixed several compiler warnings reported by the MSVC compiler.
+
+2011-05-09 10:35 bvassche
+
+ * snmplib/gettimeofday.c:
+
+ Win32/MSVC: Fixed a compiler warning.
+
+2011-05-09 10:33 bvassche
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ CHANGES: agent: Fixed a year-2038 bug in the implementation of
+ ipRouteTable.
+
+2011-05-08 20:01 nba
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/ping/pingProbeHistoryTable.c,
+ agent/mibgroup/disman/ping/pingResultsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteHopsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c:
+
+ Fix warnings and data format for DateAndTime objects.
+ These modules work, but:
+ - They are Linux only
+ - Rows must be created with rowStatus createAndWait before they
+ are populated
+ - Agent must run as root
+ - Agent is blocked while tests run
+ - Data format for InetAddress objects is wrong. It is ASCII, not
+ binary
+ (making it easier to use from the command line, but ...)
+
+2011-05-07 15:22 bvassche
+
+ * perl/SNMP/SNMP.xs:
+
+ Removed an unused label from perl/SNMP/SNMP.xs.
+
+2011-05-07 14:48 bvassche
+
+ * agent/agent_registry.c, agent/helpers/old_api.c,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/old_api.h:
+
+ CHANGES: snmpd: Declare the OID argument type of MIB registration
+ functions as 'const oid *' instead of 'oid *' since these
+ functions do not modify the OID.
+
+2011-05-07 14:44 bvassche
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_netlink.c,
+ include/net-snmp/data_access/arp.h:
+
+ Use the correct data type for the 'cache expired' variable: char
+ instead of int.
+
+2011-05-07 14:43 bvassche
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Fixed a compiler warning that was introduced in r20151.
+
+2011-05-07 13:15 bvassche
+
+ * snmplib/winservice.c:
+
+ Win32: improved source code consistency by using LPCTSTR instead
+ of LPCSTR. Note: this does not mean that Unicode builds are
+ supported.
+
+2011-05-07 13:14 nba
+
+ * agent/mibgroup/ip-mib/data_access/arp_netlink.c:
+
+ Add file forgotten in r20353
+
+2011-05-06 23:32 hardaker
+
+ * agent/helpers/cache_handler.c,
+ agent/mibgroup/ip-mib/data_access/arp.h,
+ agent/mibgroup/ip-mib/data_access/arp_common.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/data_access/arp.h:
+
+ CHANGES: snmpd: PATCH 312596: from fabled80: listen for netlink
+ change events for the arp-related tables
+
+2011-05-06 18:36 rstory
+
+ * snmplib/system.c:
+
+ NEWS: snmplib: add optional support for local DNSSEC validation
+ of hostnames
+
+ - optional at configure time: --with-local-dnssec-validation
+ - requires DNSSEC-Tool validation libraries
+ - initial support, for systems with getaddrinfo. support for
+ additional
+ resolver interfaces coming soon.
+ - also TODO: flag for ignoring validatoin errors (log & continue)
+
+2011-05-06 18:36 rstory
+
+ * include/net-snmp/library/parse.h:
+
+ move unused (and too generic) token within UCD_COMPATIBLE ifdef
+
+ - MAXLABEL conflicts with <arpa/nameser.h>
+ - added NETSNMP_MAXLABEL
+
+2011-05-06 18:36 rstory
+
+ * agent/Makefile.in, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in, configure,
+ configure.d/config_os_misc2,
+ configure.d/config_project_with_enable,
+ include/net-snmp/net-snmp-config.h.in:
+
+ update configure/Makefiles for DNSSEC local validation option
+
+2011-05-06 14:38 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_sysctl.c:
+
+ removed the accidental broken feature require line that got half
+ inserted
+
+2011-05-06 13:50 dts12
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Fix incomplete uninstall configuration:
+ - broken removal of Microsoft DLL
+ - remove assorted new MIBs and header files
+
+2011-05-06 12:58 dts12
+
+ * win32/dist/build-binary.pl:
+
+ Support Tar/GZip command paths containing spaces
+
+2011-05-06 12:57 dts12
+
+ * win32/dist/build-binary.pl:
+
+ Report GZip command correctly
+
+2011-05-05 21:48 nba
+
+ * snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c:
+
+ Fix for DragonFly BSD (does not define IP_SENDSRCADDR)
+
+2011-05-05 20:29 nba
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h:
+
+ Fix spelling of SO_RECVDSTADDR
+
+2011-05-05 18:54 rstory
+
+ * include/net-snmp/library/default_store.h, man/snmp.conf.5.def,
+ snmplib/snmp_api.c:
+
+ NEWS: apps: add snmp.conf tokens for timeouts and retries
+
+2011-05-05 06:07 bvassche
+
+ * snmplib/tools.c, testing/fulltests/support/simple_TESTCONF.sh:
+
+ CHANGES: MinGW: Made regression test output independent of the
+ Net-SNMP variables defined in the Windows registry. Some tests
+ that failed previously after the Net-SNMP binaries (MSVC build)
+ had been installed do now pass.
+
+2011-05-05 05:57 bvassche
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp/libsnmp.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj,
+ win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj, win32/win32.sln,
+ win32/win32dll.sln:
+
+ Removed Visual Studio 2005 solution and project files again since
+ Visual Studio 2010 refuses to load these.
+
+2011-05-04 23:43 hardaker
+
+ * Makefile.in:
+
+ clean the perl/python feature leftovers
+
+2011-05-04 23:42 hardaker
+
+ * local/minimalist/sizetests:
+
+ fix mib module invocation
+
+2011-05-04 20:57 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ fix ifdef typo
+
+2011-05-04 20:56 hardaker
+
+ * Makefile.in:
+
+ fix perl/python feature dependencies
+
+2011-05-04 20:56 hardaker
+
+ * agent/auto_nlist.c:
+
+ reverted auto_nlist macro usage; the function is used in headers
+
+2011-05-04 20:56 hardaker
+
+ * local/minimalist/sizetests:
+
+ Add a -T option to run 'make test'
+
+2011-05-04 20:56 hardaker
+
+ * apps/Makefile.in:
+
+ fix the encode_keychange .ft filename
+
+2011-05-04 16:20 hardaker
+
+ * perl/TrapReceiver/netsnmp-feature-definitions.h, snmplib/tools.c:
+
+ fix the features required by the TrapReceiver module
+
+2011-05-04 16:20 hardaker
+
+ * Makefile.in:
+
+ Add the TrapReceiver to the list of perl modules
+
+2011-05-04 14:42 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ use the newer Net-SNMP APIs, rather than the older UCD ones
+
+2011-05-04 14:41 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ remove SET code when under --read-only mode
+
+2011-05-04 14:41 hardaker
+
+ * agent/mibgroup/disman/event/mteTriggerTable.c:
+
+ require check_vb_uint
+
+2011-05-04 14:41 hardaker
+
+ *
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c,
+ agent/snmp_agent.c, local/mib2c-conf.d/subagent.m2c,
+ python/netsnmp/netsnmp-feature-definitions.h,
+ snmplib/snmp_logging.c:
+
+ last of the perl-used feature functions
+
+2011-05-04 14:40 hardaker
+
+ * agent/mibgroup/Rmon/event.c, agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c,
+ agent/mibgroup/smux/smux.c, apps/snmptrapd_handlers.c,
+ local/mib2c-conf.d/subagent.m2c, snmplib/mib.c, snmplib/parse.c:
+
+ started the final set of function removals for features required
+ by perl/python
+
+2011-05-04 14:39 hardaker
+
+ * local/mib2c-conf.d/generic-source-includes.m2i:
+
+ added the net-snmp-features.h header
+
+2011-05-04 14:39 hardaker
+
+ * perl/OID/netsnmp-feature-definitions.h,
+ perl/SNMP/netsnmp-feature-definitions.h,
+ perl/TrapReceiver/netsnmp-feature-definitions.h,
+ perl/agent/netsnmp-feature-definitions.h:
+
+ Added perl feature requirements
+
+2011-05-04 14:39 hardaker
+
+ * Makefile.in, Makefile.rules, configure,
+ configure.d/config_project_perl_python,
+ perl/ASN/netsnmp-feature-definitions.h,
+ perl/OID/netsnmp-feature-definitions.h,
+ perl/SNMP/netsnmp-feature-definitions.h,
+ perl/agent/netsnmp-feature-definitions.h,
+ perl/default_store/netsnmp-feature-definitions.h:
+
+ hopefully working rules to apply feature requirements to perl and
+ python
+
+2011-05-04 14:38 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c,
+ agent/snmp_agent.c:
+
+ more changes to remove unneeded functions primarily when write
+ mode is turned off
+
+2011-05-04 14:37 hardaker
+
+ * snmplib/snmp_logging.c:
+
+ change the want invocation to only default to exclude external
+ hooks
+
+2011-05-04 14:37 hardaker
+
+ * local/minimalist/find-unused-code:
+
+ search through .xs files for function invocations
+
+2011-05-04 14:37 hardaker
+
+ * agent/auto_nlist.c:
+
+ forgot a semicolon
+
+2011-05-04 14:37 hardaker
+
+ * agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/expr/expExpressionTable.c:
+
+ iquery pdu sessions are only needed in write mode.
+
+2011-05-04 14:36 hardaker
+
+ * apps/Makefile.in:
+
+ fix feature detection of sometimes-built applications
+
+2011-05-04 14:36 hardaker
+
+ * agent/auto_nlist.c:
+
+ use the feature_unused macro for making an empty file for
+ consistency
+
+2011-05-04 14:36 hardaker
+
+ * agent/helpers/table_dataset.c, agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/utilities/iquery.c, apps/snmptls.c,
+ snmplib/cert_util.c, snmplib/mib.c, snmplib/snmp_openssl.c,
+ snmplib/transports/snmpDTLSUDPDomain.c:
+
+ Another sweep for unused functions when read_only mode is turned
+ on
+
+2011-05-04 14:34 hardaker
+
+ * agent/helpers/table_tdata.c, agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/agent/extend.c, agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/agent/nsVacmAccessTable.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/expr/expExpressionTable.c,
+ agent/mibgroup/disman/expr/expObjectTable.c,
+ agent/mibgroup/disman/expression/expExpressionTable.c,
+ agent/mibgroup/disman/expression/expObjectTable.c,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+ snmplib/check_varbind.c:
+
+ mark a slew of functions as features that are only needed with
+ write_support
+
+2011-05-04 14:32 hardaker
+
+ * local/minimalist/find-unused-code:
+
+ run grep with -n
+
+2011-05-04 14:32 hardaker
+
+ * snmplib/snmp_transport.c, snmplib/transports/snmpDTLSUDPDomain.c:
+
+ featurize netsnmp_sockaddr_size
+
+2011-05-04 14:32 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ remove a feature_require not actually needed.
+
+2011-05-04 14:31 hardaker
+
+ * snmplib/cert_util.c, snmplib/container.c:
+
+ mark SUBCONTAINER_FIND as a feature
+
+2011-05-04 14:31 hardaker
+
+ * snmplib/snmp_client.c, snmplib/snmptsm.c:
+
+ the row creation API is only used in the TSM implementation
+
+2011-05-04 14:31 hardaker
+
+ * snmplib/snmp_api.c, snmplib/snmptsm.c:
+
+ the newer context engineID probing is only needed iff TSM is in
+ use
+
+2011-05-04 14:30 hardaker
+
+ * snmplib/dir_utils.c:
+
+ fix an ifdef typo
+
+2011-05-04 14:30 hardaker
+
+ * snmplib/snmp_openssl.c:
+
+ moved fetaure child_of statements to the top of the file
+
+2011-05-04 14:30 hardaker
+
+ * snmplib/cert_util.c, snmplib/container.c, snmplib/dir_utils.c,
+ snmplib/snmp_openssl.c:
+
+ marked a couple of rarely used container functions.
+
+2011-05-04 14:29 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/util_funcs.c:
+
+ split out the prefix_info feature into sub-features
+
+2011-05-04 14:29 hardaker
+
+ *
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c:
+
+ mark the accessor functions as unneeded
+
+2011-05-04 14:29 hardaker
+
+ * agent/mibgroup/host/data_access/swinst.c:
+
+ fix a child_of statement with a copy/paste error
+
+2011-05-04 14:28 hardaker
+
+ * agent/helpers/table_tdata.c:
+
+ the container row-remove is only needed if the tdata remove_row
+ is needed
+
+2011-05-04 14:28 hardaker
+
+ * agent/helpers/table_tdata.c, agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ feature marking of unused tdata functions
+ table_tdata_delete_table
+ table_tdata_extract_table
+ table_tdata_remove_row
+
+2011-05-04 14:27 hardaker
+
+ * agent/helpers/table_dataset.c,
+ agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/examples/data_set.c:
+
+ removal of some rarely used functions
+ table_set_multi_add_default_row
+ table_dataset_unregister_auto_data_table
+
+2011-05-04 14:27 hardaker
+
+ * local/minimalist/sizetests:
+
+ Added a definition to incorporate read_only/notify_only
+
+2011-05-04 14:27 hardaker
+
+ * agent/helpers/table_data.c:
+
+ added a missing feature definition line
+
+2011-05-04 14:26 hardaker
+
+ * agent/Makefile.in:
+
+ added back in missing mibgroup feature definition list
+
+2011-05-04 14:26 hardaker
+
+ * local/minimalist/sizetests:
+
+ Include the original base flags to ensure --with-defaults gets
+ picked up
+
+2011-05-04 14:26 hardaker
+
+ * local/minimalist/sizetests:
+
+ fix usage
+
+2011-05-04 14:26 hardaker
+
+ * local/minimalist/sizetests:
+
+ Added a -b flag for base arguments to start from
+
+2011-05-04 14:25 hardaker
+
+ * local/minimalist/sizetests:
+
+ default to a linear seach of size tests, rather than exponential
+
+2011-05-03 18:55 bvassche
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c:
+
+ CHANGES: snmplib: Guard netsnmp_udp_recvfrom() etc. declarations
+ consistently.
+ CHANGES: Win32: Builds with Visual Studio 2010.
+
+2011-05-03 15:29 bvassche
+
+ * snmplib/winservice.c:
+
+ CHANGES: Win32: PATCH: 3293842: Eliminate registry argument limit
+ of 127 characters (this limitation was reported by Sylvain Dery).
+
+2011-05-02 11:22 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: Win32: header file <net-snmp/net-snmp-config.h> can now
+ be used in the MinGW environment.
+
+2011-04-29 11:17 bvassche
+
+ * snmplib/winservice.c:
+
+ Spelling and grammar fixes for the source code comments in
+ snmplib/winservice.c.
+
+2011-04-29 00:23 hardaker
+
+ * NEWS:
+
+ added note about the new timing function
+
+2011-04-29 00:14 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ Update the manual page to reflect the new timing options
+
+2011-04-29 00:14 hardaker
+
+ * snmplib/tools.c:
+
+ better documentation
+
+2011-04-29 00:14 hardaker
+
+ * agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/schedule/schedConf.c:
+
+ use the netsnmp_string_time_to_secs() for parsing
+ frequencies/time
+
+2011-04-29 00:13 hardaker
+
+ * testing/fulltests/unit-tests/T102pdu_build_clib.c:
+
+ fix pdu building tests under various disabled modes
+
+2011-04-29 00:13 hardaker
+
+ * testing/fulltests/unit-tests/T102pdu_build_clib.c:
+
+ don't try to build the GET pdu under notify_only
+
+2011-04-29 00:12 hardaker
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ fix a bug with no-suffix strings and use a const input string
+
+2011-04-29 00:12 hardaker
+
+ * testing/fulltests/unit-tests/T010netsnmp_string_time_to_secs_clib.c:
+
+ A new unit test for the time conversion routine
+
+2011-04-29 00:12 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ use the netsnmp_string_time_to_secs() function for computing
+ interval periods
+
+2011-04-29 00:11 hardaker
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ Added a netsnmp_string_time_to_secs() functions to convert, e.g.,
+ 1h to 3600
+
+2011-04-29 00:11 hardaker
+
+ * snmplib/snmp_api.c:
+
+ remove code to build/parse GET/etc requests when NOTIFY_ONLY is
+ turned on.
+
+2011-04-27 21:33 hardaker
+
+ * NEWS:
+
+ update the NEWS to reflect the new --enable-read-only and
+ --enable-notify-only
+
+2011-04-27 21:33 hardaker
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ minor improvements for ronly vs rwrite handling
+
+2011-04-27 21:32 hardaker
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_interface.c:
+
+ still enable RONLY when RWRITE isn't possible
+
+2011-04-27 21:32 hardaker
+
+ * agent/helpers/cache_handler.c:
+
+ fix GET support when no_write is enabled
+
+2011-04-27 21:32 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ mark a future modification need in a comment
+
+2011-04-27 21:31 hardaker
+
+ * agent/helpers/old_api.c:
+
+ fix handling of no_write support
+
+2011-04-27 21:31 hardaker
+
+ * agent/agent_read_config.c, agent/snmp_agent.c, agent/snmpd.c:
+
+ don't open any listening transports when notify-only is specified
+
+2011-04-27 21:31 hardaker
+
+ * configure, configure.d/config_project_with_enable:
+
+ set the no-listen and read-only flags when --enable-notify-only
+ is set
+
+2011-04-27 21:30 hardaker
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ ran autoheader
+
+2011-04-27 21:30 hardaker
+
+ * snmplib/transports/snmpAAL5PVCDomain.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPXDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c,
+ snmplib/transports/snmpUnixDomain.c:
+
+ implement the NETSNMP_NO_LISTEN_SUPPORT in these transports
+
+2011-04-27 21:30 hardaker
+
+ * configure:
+
+ run autoconf
+
+2011-04-27 21:29 hardaker
+
+ * configure.d/config_project_with_enable:
+
+ move the read-only flag definition below the notify-only, since
+ notify-only needs to imply read-only
+
+2011-04-27 21:29 hardaker
+
+ * configure, configure.d/config_project_with_enable:
+
+ Defined a new --enable-notify-only flag for building a toolset
+ that only allows for notifications with no read/write support
+
+2011-04-27 21:29 hardaker
+
+ * configure, configure.d/config_project_with_enable:
+
+ Defined a new --no-listen flag to remove listening support
+
+2011-04-27 21:28 hardaker
+
+ * agent/mibgroup/default_modules.h:
+
+ the disman schedule mib is only useful when SETs are turned on
+
+2011-04-27 21:28 hardaker
+
+ * agent/mibgroup/disman.h:
+
+ the disman schedule mib is only useful when SETs are turned on
+
+2011-04-27 21:28 hardaker
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c:
+
+ finished no_write support for common included tables
+
+2011-04-27 21:27 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ Add back in 'netsnmp_set_row_column' when no_write support is
+ enabled
+ This function is a generic data manipulation function, not SET
+ specific
+
+2011-04-27 21:27 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ don't use mark_row_column_writable when read-only support is
+ enabled
+
+2011-04-27 21:26 hardaker
+
+ * agent/mibgroup/agent/nsCache.c, agent/mibgroup/agent/nsDebug.c,
+ agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/ip-mib/ip_scalars.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/utilities/override.c:
+
+ fix no_write support
+
+2011-04-27 21:26 hardaker
+
+ * agent/mibgroup/agent/extend.c:
+
+ fix no_write support
+
+2011-04-27 21:16 hardaker
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ Don't free the ifXTable row found on load failure as we don't own
+ it
+
+2011-04-26 18:16 hardaker
+
+ * local/gittools, local/gittools/shell-functions:
+
+ git bash-shell functions to enable branch switching and external
+ building
+ These local shell functions (snmpconfigure and snmpmake) let you
+ configure and build the Net-SNMP source code in external
+ directories
+ that are auto-calculated based on the existing branch name (with
+ an
+ optional suffix). This lets you run 'snmpmake' from within the
+ source
+ directory and have it actually externally keep track of modified
+ files, etc, so building in multiple branches can be done from a
+ single
+ git checkout.
+
+2011-04-25 20:57 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ clean up the iterators
+
+2011-04-25 20:57 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ free varbinds after sending
+
+2011-04-25 18:48 bvassche
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Commented out an unused function because the compiler complained
+ about it.
+
+2011-04-25 18:46 bvassche
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ Fixed two compiler warnings.
+
+2011-04-23 14:31 magfr
+
+ * agent/helpers/table_data.c:
+
+ Remove unnecessary null check
+
+2011-04-23 14:05 magfr
+
+ * agent/helpers/table_container.c:
+
+ Move pointer dereference to after the check for successful
+ allocation of the pointer
+
+2011-04-23 08:20 magfr
+
+ * agent/agent_registry.c:
+
+ Reduce variable scope
+
+2011-04-23 08:16 magfr
+
+ * agent/agent_registry.c:
+
+ Remove an unused variable
+
+2011-04-23 08:06 magfr
+
+ * agent/agent_registry.c:
+
+ Reduce variable scope
+
+2011-04-23 07:55 magfr
+
+ * agent/agent_registry.c:
+
+ Reduce variable scope
+
+2011-04-22 19:35 magfr
+
+ * agent/agent_trap.c:
+
+ Reduce variable scope
+
+2011-04-22 19:30 magfr
+
+ * agent/agent_trap.c:
+
+ Remove unused variable
+
+2011-04-22 17:29 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ mention which module is required when building to get the deliver
+ support
+
+2011-04-22 16:33 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ deleted an unneeded debugging statement
+
+2011-04-22 16:33 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ properly update the max count in the outgoing notifications
+
+2011-04-22 16:32 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ better packet estimation to ensure we don't overrun.
+
+2011-04-22 16:32 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ estimate the packet size and break the notification up based on
+ it
+
+2011-04-22 16:31 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ transform the notification sending into a larger loop for later
+ multi-notifs
+
+2011-04-22 16:31 hardaker
+
+ * NEWS:
+
+ further information about feature marking/selection
+
+2011-04-22 16:31 hardaker
+
+ * NEWS:
+
+ mention the new delivery by notifications
+
+2011-04-22 16:31 hardaker
+
+ * NEWS:
+
+ document the minimalist support
+
+2011-04-22 16:30 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document the new deliverByNotify config tokens
+
+2011-04-22 16:30 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ allow run time modifications of the OIDs to use
+
+2011-04-22 16:30 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h:
+
+ add config flags to not include the period config and msg count
+ values
+
+2011-04-22 16:29 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ include the periodic count, the message number and the max
+ message number
+
+2011-04-22 16:29 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ deleted debugging comment
+
+2011-04-22 16:29 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ mibs/NET-SNMP-PERIODIC-NOTIFY-MIB.txt:
+
+ Move the notification definition to within the sub-mib
+
+2011-04-22 16:28 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ delete an unused variable
+
+2011-04-22 16:28 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.h:
+
+ load the MIB into the default set
+
+2011-04-22 16:28 hardaker
+
+ * mibs/NET-SNMP-PERIODIC-NOTIFY-MIB.txt:
+
+ A new mib to hold the periodic notify objects
+
+2011-04-22 16:28 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ fill out the config free routine
+
+2011-04-22 16:27 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ properly monitor the whole container
+
+2011-04-22 16:27 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h:
+
+ parse the conf files and create and insert objects into the
+ container
+
+2011-04-22 16:27 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ defined a container to store a list of deliver objects in
+
+2011-04-22 16:27 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.h:
+
+ added a next_run timestamp
+
+2011-04-22 16:26 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ actually send a notification with the results
+
+2011-04-22 16:26 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ make the walk on the test object function.
+
+2011-04-22 16:26 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ create a max packet size config token and parse it
+
+2011-04-22 16:25 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h:
+
+ minimal starting test object
+
+2011-04-22 16:25 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h:
+
+ added a function to calculate the time until the next run
+
+2011-04-22 16:25 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c:
+
+ remove left in template line
+
+2011-04-22 16:25 hardaker
+
+ * agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h:
+
+ use an alarm callback prototype for execute
+
+2011-04-22 16:24 hardaker
+
+ * agent/mibgroup/deliver, agent/mibgroup/deliver/deliverByNotify.c,
+ agent/mibgroup/deliver/deliverByNotify.h:
+
+ beginning template code for delivery of data by notifications
+
+2011-04-22 09:13 magfr
+
+ * agent/snmp_agent.c:
+
+ Reduce variable scope
+
+2011-04-22 09:07 magfr
+
+ * agent/snmp_agent.c:
+
+ Reduce variable scopes
+
+2011-04-22 09:03 magfr
+
+ * agent/snmp_agent.c:
+
+ Remove unused variable
+
+2011-04-19 08:38 bvassche
+
+ * win32/libsnmp/libsnmp.vcproj, win32/win32.sln:
+
+ Added Visual Studio 2005 project and solution file for building
+ the Net-SNMP library as a static library. Both the Win32 and the
+ x64 configurations are included.
+
+2011-04-19 07:57 bvassche
+
+ * win32/libsnmp:
+
+ Updated Subversion ignore list.
+
+2011-04-19 07:39 bvassche
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj,
+ win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj:
+
+ More Visual Studio 2005 project file cleanup.
+
+2011-04-19 06:57 bvassche
+
+ * win32/bin:
+
+ Updated Subversion ignore list.
+
+2011-04-18 15:34 bvassche
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj,
+ win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj:
+
+ Cleaned up Win32 VS2005 project files - removed superfluous
+ library references.
+
+2011-04-18 15:25 bvassche
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj,
+ win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj, win32/win32dll.sln:
+
+ Added x64 configurations.
+
+2011-04-18 15:14 bvassche
+
+ * win32/lib:
+
+ Another Win32-related Subversion ignore list update.
+
+2011-04-18 15:13 bvassche
+
+ * win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.vcproj,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.vcproj,
+ win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.vcproj,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.vcproj,
+ win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.vcproj, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.vcproj, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.vcproj, win32/win32dll.sln:
+
+ Added win32dll-related Visual Studio 2005 project and solution
+ files.
+
+2011-04-18 13:37 bvassche
+
+ * win32, win32/encode_keychange, win32/lib, win32/libagent,
+ win32/libnetsnmptrapd, win32/libsnmp, win32/libsnmp_dll,
+ win32/libucdmibs, win32/net-snmp, win32/netsnmpmibs,
+ win32/snmpbulkget, win32/snmpbulkwalk, win32/snmpd,
+ win32/snmpdelta, win32/snmpdf, win32/snmpget, win32/snmpgetnext,
+ win32/snmpnetstat, win32/snmpset, win32/snmpstatus,
+ win32/snmptable, win32/snmptest, win32/snmptranslate,
+ win32/snmptrap, win32/snmptrapd, win32/snmpusm, win32/snmpvacm,
+ win32/snmpwalk:
+
+ Added *.vcproj.*.user and x64 to the win32 Subversion ignore
+ lists. Ran these through LC_ALL=C sort -fu too.
+
+2011-04-18 12:10 bvassche
+
+ * include/net-snmp/library/getopt.h,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/net-snmp-includes.h:
+
+ Win32 DLL build fixes.
+
+2011-04-17 20:56 dts12
+
+ * snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c:
+
+ CHANGES: snmpd: PATCHES: 3175640: Use IP_RECVDSTADDR sockopt
+ where available (*BSD)
+
+2011-04-15 13:42 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCHES: 3183000: Fix calculation of common OID
+ prefix length
+ CHANGES: snmplib: BUGS: 3182985: Fix calculation of common OID
+ prefix length
+
+2011-04-15 13:17 dts12
+
+ * agent/mibgroup/ucd-snmp/diskio.c, apps/snmptrapd_ds.h,
+ include/net-snmp/agent/ds_agent.h, man/snmpd.conf.5.def:
+
+ CHANGES: Linux: PATCHES: 3205811: Option to skip fd/loop/ram
+ devices in diskIOTable
+
+2011-04-14 21:31 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: PATCHES: 3185085: Fix segfault on 64-bit systems
+
+2011-04-14 21:10 dts12
+
+ * local/mib2c:
+
+ CHANGES: mib2c: PATCHES: 3175323: Fix handling of 'while (false)'
+ blocks
+
+2011-04-14 20:52 dts12
+
+ * local/mib2c:
+
+ CHANGES: mib2c: PATCHES: 3204883: Fix handling of non-table
+ objects named fooTable
+
+2011-04-14 20:44 dts12
+
+ * local/mib2c:
+
+ CHANGES: mib2c: PATCHES: 3211484: Support enumerations in
+ notification varbinds
+
+2011-04-12 20:01 nba
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ Add missing system oids to mib
+
+2011-04-12 19:53 nba
+
+ * apps/snmptable.c:
+
+ Fix for garbage output when agent presents more columns in bulk
+ response than our local MIB file specified.
+
+2011-04-12 19:50 nba
+
+ * man/snmptrapd.8.def:
+
+ Fix wrong name for config token 'doNotRetainNotificationLogs'
+
+2011-04-09 21:59 nba
+
+ * agent/mibgroup/sctp-mib/sctpScalars_freebsd.c:
+
+ Remove bogus (Linux) defines
+
+2011-04-09 21:56 nba
+
+ * snmplib/snmp-tc.c:
+
+ HAVE_TM_TM_GMTOFF is HAVE_STRUCT_TM_TM_GMTOFF
+
+2011-04-09 20:08 nba
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.h,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h, configure,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Bill Fenners patch to make DISMAN PING and TRACEROUTE MIBS
+ compile under Linux
+
+2011-04-09 20:04 nba
+
+ * agent/mibgroup/kernel_sunos5.c, agent/mibgroup/kernel_sunos5.h,
+ agent/mibgroup/sctp-mib/sctpScalars.h,
+ agent/mibgroup/sctp-mib/sctpScalars_solaris2.c,
+ agent/mibgroup/sctp-mib/sctpTables.h,
+ agent/mibgroup/sctp-mib/sctpTables_solaris2.c:
+
+ Solaris support for SCTP-MIB
+
+2011-04-09 19:50 nba
+
+ * snmplib/snmp-tc.c:
+
+ TZ is one hour off if HAVE_TM_TM_GMTOFF and SYSV (such is Linux)
+
+2011-04-01 01:11 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ CHANGES: snmplib: dtls: overhaul of debug
+
+ - drastic reduction in number of messages and msg complexity
+ for basic dtlsudp token
+ - previous level of detail available by adding 9:dtlsdup token
+
+2011-04-01 00:53 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ CHANGES: snmplib: dtls: clean up close; catch
+ 'connect'/'disconnect'
+
+ connect = we get successfully decoded snmp data
+ disconnect = 0 byte read, ssh shutdown flag set
+ add bio_cache flags for connected/disconnected
+ check for null ptr before dereferencing
+ close handling:
+ - only send queued data if we got to connected state
+ - seriously reduce timeout to wait for junk read. i think
+ we shouldn't even bother
+ - return early if cachep is NULL, so we don't have to test it
+ repeatedly
+ - use correct nfds value in select call
+
+2011-03-31 05:17 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ make trunk and v5-6-patches closely aligned
+
+ mostly changes in debug, cookie tracking
+
+2011-03-27 11:08 magfr
+
+ * snmplib/container_binary_array.c:
+
+ Simplify array resizing somewhat further
+
+2011-03-27 10:21 magfr
+
+ * snmplib/container_binary_array.c:
+
+ Do not assign new_data if the value won't be used.
+ Reduce variable scopes.
+
+2011-03-27 10:14 magfr
+
+ * snmplib/container_binary_array.c:
+
+ It is not necessary to clear a chunk of memory if the next action
+ on it is to
+ fill it so use malloc instead of calloc.
+
+2011-03-27 10:09 magfr
+
+ * snmplib/container_binary_array.c:
+
+ ContainerBinaryArray really can't hold anythng but pointers and
+ that means the
+ data_size field is unnecessary so I removed it.
+
+2011-03-26 19:55 magfr
+
+ * agent/mibgroup/hardware/memory/hw_mem.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/sysORTable.c, apps/snmptrapd.c,
+ snmplib/int64.c, snmplib/snmp_openssl.c, snmplib/snmp_secmod.c,
+ snmplib/snmpv3.c:
+
+ Add missing include
+
+2011-03-26 08:07 magfr
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ Use the right feature macro in order to make builds with
+ --enable-ipv6 --with-out-transports=UDPIPv6 succeed.
+
+2011-03-26 08:02 magfr
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ Remove duplicate copies of functions
+
+2011-03-25 20:35 rstory
+
+ * local/net-snmp-cert:
+
+ tweak debug message
+
+2011-03-25 20:32 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ CHANGES: snmplib: update cert token handling
+
+ - remove defX509 cert tokens (should have been removed before
+ 5.6)
+ - warnings for our/their tokens, recommend using local/peer
+
+2011-03-25 20:31 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpUDPBaseDomain.c:
+
+ merge netsnmp_dtlsudp6 into netsnmp_dtlsudp
+
+ use addr size to tell them apart
+
+2011-03-25 20:31 rstory
+
+ * snmplib/snmp_transport.c:
+
+ log (once) warning when deprecated f_create_from_tstring
+ transport function used
+
+2011-03-25 20:30 rstory
+
+ * snmplib/transports/snmpTCPDomain.c:
+
+ reduce casting; make sure to free the right pointer
+
+2011-03-25 20:29 rstory
+
+ * snmplib/transports/snmpUDPBaseDomain.c:
+
+ reduce casting
+
+2011-03-24 06:19 magfr
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Replace a variable with a constant. Make one more oid const.
+
+2011-03-17 21:09 nba
+
+ * man/snmpdelta.1.def:
+
+ Formatting botch
+
+2011-03-17 21:07 nba
+
+ * mibs/Makefile.in:
+
+ Install required mibs
+
+2011-03-17 21:05 nba
+
+ * mibs/rfclist:
+
+ New RFC mibs
+
+2011-03-15 10:31 bvassche
+
+ * snmplib/cert_util.c:
+
+ Spelling fix: reginerated -> regenerated.
+
+2011-03-15 10:19 bvassche
+
+ * snmplib/cert_util.c:
+
+ Simplified r19594 (leak-at-exit fix).
+
+2011-03-15 09:59 bvassche
+
+ * snmplib/snmp_openssl.c:
+
+ Fixed a compiler warning that was introduced in r20113.
+
+2011-03-14 09:31 dts12
+
+ * agent/snmpd.c:
+
+ Fix main agent select call to use the renamed API routine.
+
+2011-03-13 20:09 dts12
+
+ * include/net-snmp/library/large_fd_set.h, snmplib/large_fd_set.c:
+
+ Bring the naming of the large_fd_set select call into
+ line with the rest of the API.
+
+2011-03-12 06:59 rstory
+
+ * snmplib/container_binary_array.c:
+
+ CHANGES: snmplib: realloc+init instead of calloc
+
+ inspired by patch 3195532 from Stephen Hemminger
+
+2011-03-12 05:47 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c:
+
+ CHANGES: snmpd: PATCH: optimizations for large route tables from
+ Stephen Hemminger
+
+ applied parts 1-3 of 4 from him (msgs to coders on 2/28/11;
+ subject
+ ip-forward-mib performance improvements; part 4 needs more work
+
+2011-03-11 14:43 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ CHANGES: snmplib: add more openssl error cases where we check for
+ local cert
+
+2011-03-11 12:01 bvassche
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ MinGW: dskTable: Report zero for unimplemented fields instead of
+ random data.
+
+2011-03-11 08:42 bvassche
+
+ * agent/mibgroup/disman/schedule/schedCore.c:
+
+ CHANGES: snmpd: Builds with most recent MinGW (having #define
+ localtime_r).
+
+2011-03-11 03:08 rstory
+
+ * snmplib/cert_util.c, snmplib/snmp_openssl.c:
+
+ CHANGES: snmplib: refine cert debugging; remove unused function
+
+2011-03-10 21:21 rstory
+
+ * snmplib/cert_util.c:
+
+ CHANGES: snmpd: BUG: 3205765: handle reconfig for certSecName
+ token
+
+2011-03-10 20:01 bvassche
+
+ * agent/snmpd.c:
+
+ Spelling fix in a source code comment: messges -> messages.
+
+2011-03-10 19:55 bvassche
+
+ * snmplib/large_fd_set.c:
+
+ CHANGES: snmplib: PATCH: 3203806: Minor performance optimization
+ of netsnmp_large_fd_set_resize().
+
+2011-03-10 19:48 bvassche
+
+ * agent/snmpd.c:
+
+ CHANGES: snmpd: PATCH: 3203806: Avoid that the main agent
+ processing loop - when using more than FD_SETSIZE file
+ descriptors - can cause memory corruption by invoking select().
+
+2011-03-10 19:43 bvassche
+
+ * include/net-snmp/library/large_fd_set.h, snmplib/large_fd_set.c:
+
+ CHANGES: snmplib: PATCH: 3203806: Add the function
+ netsnmp_large_select().
+
+2011-03-10 18:55 bvassche
+
+ * testing/fulltests/support/clib_build,
+ testing/fulltests/unit-tests/T009large_fd_set_clib.c:
+
+ Added a minimal unit test for netsnmp_large_fd_set.
+
+2011-03-10 18:52 bvassche
+
+ * snmplib/large_fd_set.c:
+
+ CHANGES: snmplib: PATCH: 3203806: Make
+ netsnmp_large_fd_set_resize() clear all relevant file
+ descriptors.
+
+2011-03-10 15:51 dts12
+
+ * snmplib/snmp-tc.c:
+
+ CHANGES: snmpd: BUG: 3178389: Fix inconsistent handling of TZ
+ offsets
+
+2011-03-10 15:40 dts12
+
+ * agent/mibgroup/hardware/fsys,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable,
+ agent/mibgroup/ip-mib/ipIfStatsTable:
+
+ Ignore object files and libraries
+
+2011-03-10 15:05 dts12
+
+ * snmplib/transports:
+
+ Ignore object files and libraries
+
+2011-03-10 14:32 hardaker
+
+ * apps/Makefile.in, configure, configure.d/config_os_libs2:
+
+ make variable names match
+
+2011-03-10 14:28 bvassche
+
+ * agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c:
+
+ Fixed two compiler warnings.
+
+2011-03-10 14:24 hardaker
+
+ * configure, configure.d/config_os_libs2:
+
+ fixed installation variables for the optional SET programs
+
+2011-03-08 00:53 hardaker
+
+ * local/minimalist/remove-unneeded-modules:
+
+ chmod a+x
+
+2011-03-08 00:15 hardaker
+
+ * local/minimalist/removeifdefcode.pl:
+
+ print an error if the end of a file was reached and we're not
+ back
+ into the state we can write; otherwise a closing #ifdef is
+ missing.
+
+2011-03-08 00:15 hardaker
+
+ * snmplib/transports/snmpUnixDomain.c:
+
+ fix endif comment to match the opening ifdef
+
+2011-03-08 00:15 hardaker
+
+ * local/minimalist/removeifdefcode.pl:
+
+ reset the canwrite flag for every file
+
+2011-03-08 00:15 hardaker
+
+ * local/minimalist/remove-unneeded-modules:
+
+ temporarily leave in header files
+
+2011-03-08 00:14 hardaker
+
+ * configure, configure.ac:
+
+ change the unique file check to one that is not in the mibgroup
+ directory
+
+2011-03-08 00:14 hardaker
+
+ * testing/fulltests/read-only,
+ testing/fulltests/read-only/T0141snmpv2csetfail_simple:
+
+ a test for ensuring the agent rejects SET requests with
+ --enable-read-only
+
+2011-03-08 00:14 hardaker
+
+ * testing/fulltests/default/T0141snmpv2cset_simple:
+
+ add back in the stopagent command
+
+2011-03-08 00:14 hardaker
+
+ * testing/fulltests/unit-tests/T101pdu_type_clib.c,
+ testing/fulltests/unit-tests/T102pdu_build_clib.c,
+ testing/fulltests/unit-tests/T103pdu_parse_clib.c:
+
+ unit tests writen for the read-only support converted to work
+ with or without read-only
+
+2011-03-08 00:13 hardaker
+
+ * testing/fulltests/default/T0141snmpv2cset_simple:
+
+ don't run the set test if no_write_support is turned on
+
+2011-03-08 00:13 hardaker
+
+ * testing/fulltests/default/T030snmpv3usercreation_simple:
+
+ skip if no_write_support
+
+2011-03-08 00:13 hardaker
+
+ * testing/fulltests/default/T0141snmpv2cset_simple:
+
+ A new test to check whether SNMPv2c SETs to sysContact work as
+ expected
+
+2011-03-08 00:13 hardaker
+
+ * testing/fulltests/default/Svanyconfig:
+
+ allow for v2c SET support testing
+
+2011-03-08 00:12 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Allow for single quotes for vacm context name quoting too
+
+2011-03-07 19:19 hardaker
+
+ * configure:
+
+ fix the configure tests to include the word test in the test
+
+2011-03-07 19:18 hardaker
+
+ * configure.d/config_os_libs2:
+
+ fix the configure tests to include the word test in the test
+
+2011-03-07 19:18 hardaker
+
+ * local/minimalist/remove-unneeded-modules:
+
+ Added an annoyingly long list of exceptions that needs to be
+ automated
+
+2011-03-07 19:18 hardaker
+
+ * local/minimalist/remove-unneeded-modules:
+
+ A quick perl script to remove unneeded code modules from the
+ modules directory
+
+2011-03-07 19:18 hardaker
+
+ * agent/mibgroup/target/target.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+ snmplib/cert_util.c, snmplib/snmpusm.c, snmplib/vacm.c:
+
+ more improvements (removements) for featurization and read-only
+ support
+
+2011-03-07 17:19 bvassche
+
+ * snmplib/container_binary_array.c:
+
+ CHANGES: snmplib: PATCH: 3195537: Minor binary_array container
+ sort optimization
+
+2011-03-06 19:47 nba
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c:
+
+ Tabs to spaces
+
+2011-03-06 11:28 nba
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ configure.d/config_os_functions:
+
+ Configure check for gethostname2
+ Use getaddrinfo if available. Now works for Solaris (and
+ Windows?)
+
+2011-03-05 19:16 magfr
+
+ * apps/snmptest.c:
+
+ Add dropped ||'s from r20072
+
+2011-03-05 12:50 nba
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.h,
+ agent/mibgroup/disman/nslookup/lookupResultsTable.c:
+
+ Clean up, and cosolidate result table row creation into a new
+ function.
+ Saves 200 lines of code, with (hopefully) no functionality change
+
+2011-03-05 06:17 hardaker
+
+ * apps/Makefile.in, apps/snmptest.c, configure,
+ configure.d/config_os_libs2:
+
+ don't build SET related apps with --enable-read-only
+
+2011-03-05 06:16 hardaker
+
+ * agent/helpers/baby_steps.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/mibII/snmp_mib.c, agent/mibgroup/mibII/updates.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ agent/mibgroup/target/target.c,
+ include/net-snmp/agent/baby_steps.h,
+ include/net-snmp/agent/snmp_agent.h, snmplib/snmp_client.c:
+
+ fix issues with combining --enable-minimalist and
+ --enable-read-only
+
+2011-03-05 06:16 hardaker
+
+ * local/minimalist/find-unused-code:
+
+ better output for finding object symbols.
+
+2011-03-04 21:56 baerm
+
+ * local/minimalist/removeifdefcode.pl:
+
+ last commit: changes to allow parsing of featuers files to get
+ all minimalist tags which are then processed for removal
+
+ this commit: changed comments/white space
+
+2011-03-04 19:27 baerm
+
+ * agent/mibgroup/agent/extend.c:
+
+ added no_write support to extend.c
+
+2011-03-04 19:26 baerm
+
+ * agent/helpers/instance.c:
+
+ Added missing #endif comment for remove ifdef code support
+
+2011-03-04 19:24 baerm
+
+ * local/minimalist/removeifdefcode.pl:
+
+ added changes to allow code removal in-place
+ (i.e. does not require creating a new file)
+
+2011-03-04 19:23 baerm
+
+ * local/minimalist/ignore.regexp:
+
+ adding a ignore.regexp file that can be used with
+ removeifdefcode.pl
+
+2011-03-04 19:20 hardaker
+
+ * local/minimalist/feature-makedocs:
+
+ add a outgoing link to the parent marking page
+
+2011-03-04 19:19 hardaker
+
+ * local/minimalist/feature-makedocs:
+
+ Added a wiki output mode
+
+2011-03-04 19:19 hardaker
+
+ * local/minimalist/feature-makedocs:
+
+ Note that the org output is the default in the help output
+
+2011-03-04 15:09 jsafranek
+
+ * agent/mibgroup/ucd-snmp/vmstat_linux.c:
+
+ CHANGES: snmpd: fixed 'truncating integer value > 32 bits' in
+ UCD-SNMP-MIB::systemStats on Linux
+
+2011-03-04 14:49 hardaker
+
+ * agent/agent_read_config.c, agent/helpers/watcher.c,
+ agent/mibgroup/agentx/master.c, agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/usmUser.c, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/utilities/iquery.c, snmplib/snmp_api.c:
+
+ reclassification of the remaining features into a hierarchy
+
+2011-03-04 14:49 hardaker
+
+ * snmplib/snmp_openssl.c:
+
+ don't double-declare cert_utils
+
+2011-03-04 14:49 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ the ipaddress_linux was incorrectly marked as needing
+ cert_fingerprints
+
+2011-03-04 14:48 hardaker
+
+ * agent/agent_registry.c:
+
+ put the agent_registry feature in libnetsnmpagent.
+
+2011-03-03 10:56 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ CHANGES: Win32: Deprecated libsnmp.def - add NETSNMP_IMPORT to
+ function declarations instead to export a function from
+ netsnmp.dll.
+
+2011-03-03 10:48 bvassche
+
+ * include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmp_debug.h:
+
+ Added missing NETSNMP_IMPORT declarations.
+
+2011-03-03 10:24 bvassche
+
+ * win32/libagent/libagent.def, win32/libucdmibs/libucdmibs.def:
+
+ Removed two obsolete Win32 files.
+
+2011-03-03 10:09 bvassche
+
+ * snmplib/transports/snmpIPv6BaseDomain.c:
+
+ Trivial comment fix: snmpIPv6BaseDomain.c contains IPv6 base
+ transport support functions instead of IPv4.
+
+2011-03-02 19:10 bvassche
+
+ * snmplib:
+
+ Added snmpsm_shutdown.h to the Subversion ignore list because
+ it's a generated file.
+
+2011-03-02 15:58 bvassche
+
+ * win32/config.h:
+
+ Removed an obsolete file.
+
+2011-03-02 15:52 bvassche
+
+ * include/net-snmp/library/snmp_secmod.h, win32/snmpsm_shutdown.h,
+ win32/snmpv3-security-includes.h:
+
+ Builds again with Visual Studio after the introduction of the
+ "feature" feature.
+
+2011-03-02 15:48 bvassche
+
+ * win32/snmpsm_init.h:
+
+ Removed a misleading comment.
+
+2011-03-02 08:40 magfr
+
+ * configure, configure.d/config_os_libs2:
+
+ Correct the check of wether usm security is enabled.
+ Regenerate configure.
+
+2011-03-02 08:39 magfr
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Regenerate
+
+2011-03-02 08:21 magfr
+
+ *
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c:
+
+ Add missing dependencies
+
+2011-03-02 07:19 magfr
+
+ * snmplib/snmpusm.c:
+
+ Ignore the return value from snmp_increment_statistic
+
+2011-03-02 07:19 magfr
+
+ * snmplib/container.c:
+
+ Split the container_compare_functions feature into
+ container_compare_mem,
+ container_compare_long, container_compare_ulong,
+ container_compare_int32 and
+ container_compare_uint32
+ Unify the structure of the compare functions further.
+
+2011-03-02 07:19 magfr
+
+ * snmplib/container.c:
+
+ Change the spelling of the container_compare_cstring feature to
+ container_ncompare_cstring as that is the function that is
+ guarded by that
+ attribute.
+
+2011-03-02 07:17 magfr
+
+ * include/net-snmp/library/snmp_api.h:
+
+ Add the missing replacement macro for snmp_init_statistics
+
+2011-03-02 07:16 magfr
+
+ * include/net-snmp/library/snmp_api.h:
+
+ snmp_increment_statistic_by takes two arguments so let the
+ replacement macro
+ take two arguments as well.
+
+2011-02-27 13:55 nba
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c:
+
+ Fix typo in r19990
+
+2011-02-26 10:53 magfr
+
+ * local/minimalist/feature-check:
+
+ Remove lines starting with #define in the output of the
+ preprocessor
+ When gcc -E is called with -ggdb3 (or -dD) then all the macro
+ definitions are
+ passed through the preprocessor and that messes up our
+ processing.
+
+2011-02-26 10:52 magfr
+
+ * Makefile.rules:
+
+ Put the generated file in the build tree, not the source tree.
+
+2011-02-26 01:23 hardaker
+
+ * agent/agent_trap.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/memory/hw_mem.c,
+ agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+ agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c:
+
+ moved a bunch of features into the libnetsnmpmibs feature set.
+
+2011-02-26 01:22 hardaker
+
+ * agent/agent_handler.c, agent/agent_index.c,
+ agent/agent_registry.c, agent/agent_trap.c,
+ agent/helpers/all_helpers.c, agent/helpers/cache_handler.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c, agent/helpers/table_row.c,
+ agent/snmp_agent.c, local/minimalist/sizetests, snmplib/mib.c:
+
+ classified libnetsnmpagent features
+
+2011-02-26 01:21 hardaker
+
+ * local/minimalist/sizetests:
+
+ reverse the order of the libraries (snmplib first)
+
+2011-02-26 01:21 hardaker
+
+ * local/minimalist/sizetests:
+
+ output cleanup and added agent-mibs and logging options
+
+2011-02-26 01:21 hardaker
+
+ * local/minimalist/sizetests:
+
+ add a default set of arguments
+ calculate resulting sizes
+
+2011-02-26 01:21 hardaker
+
+ * snmplib/dir_utils.c:
+
+ Added a missing ;
+
+2011-02-26 01:20 hardaker
+
+ * local/minimalist/sizetests:
+
+ prefix the output files with a number to indicate order
+
+2011-02-26 01:20 hardaker
+
+ * local/minimalist/sizetests:
+
+ save the results of the system executions
+
+2011-02-26 01:20 hardaker
+
+ * local/minimalist/sizetests:
+
+ enable building of the resulting combinations
+ Add a -n flag for dry-runs
+
+2011-02-26 01:20 hardaker
+
+ * local/minimalist/sizetests:
+
+ enable the -t tag for limiting types
+
+2011-02-26 01:19 hardaker
+
+ * local/minimalist/sizetests:
+
+ Added argument parsing and arguments for selecting and listing
+ types
+
+2011-02-26 01:19 hardaker
+
+ * local/minimalist/sizetests:
+
+ generate configure script arguments from specs
+
+2011-02-26 01:19 hardaker
+
+ * local/minimalist/sizetests:
+
+ added a bunch of new feature options and cleaned up a bit
+
+2011-02-26 01:19 hardaker
+
+ * local/minimalist/sizetests:
+
+ added a new (not yet working) script to test sizing of various
+ argument sets
+
+2011-02-26 00:26 magfr
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Simplify the code. Unify some debug logs.
+
+2011-02-26 00:19 magfr
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Reduce the scope of a few variables
+
+2011-02-26 00:16 magfr
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Remove some unused includes.
+
+2011-02-26 00:15 magfr
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Make it possible to initialize/uninitialize modules with 64
+ character names and not suffer wild writes.
+
+2011-02-26 00:12 magfr
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Code restructuring - put the managed routines before the
+ managment code.
+
+2011-02-26 00:11 magfr
+
+ * agent/mibgroup/ucd-snmp/dlmod.c, agent/mibgroup/ucd-snmp/dlmod.h:
+
+ CHANGES: libnetsnmpmibs: Make all functions in the dlmod module
+ that don't have to be public static
+
+2011-02-26 00:07 magfr
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Rename deinit_dlmod to shutdown_dlmod as that is what it really
+ is about.
+
+2011-02-25 18:24 baerm
+
+ * agent/mibgroup/agent/nsVacmAccessTable.c:
+
+ adding minimalist ifdefs to net-snmp-vacm mib
+
+2011-02-25 16:09 hardaker
+
+ * local/minimalist/feature-makedocs:
+
+ properly handle twin children; also sort the child list
+ alphabetically.
+
+2011-02-25 16:09 hardaker
+
+ * snmplib/snmp_logging.c:
+
+ I suppose logging should probably default to being a wanted
+ option :-)
+
+2011-02-25 16:09 hardaker
+
+ * local/minimalist/feature-makedocs:
+
+ org-link the files in the output
+
+2011-02-25 16:08 hardaker
+
+ * Makefile.rules, agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ local/minimalist/feature-check, snmplib/Makefile.in:
+
+ make the features-check script track the full source path
+
+2011-02-25 16:08 hardaker
+
+ * local/minimalist/feature-makedocs:
+
+ change the function names to match that it's printing to org-mode
+ at the moment.
+
+2011-02-25 16:08 hardaker
+
+ * snmplib/file_utils.c, snmplib/mib.c, snmplib/oid_stash.c,
+ snmplib/snmp_api.c, snmplib/snmp_logging.c, snmplib/tools.c:
+
+ last of the feature classification in libnetsnmp
+
+2011-02-25 16:07 hardaker
+
+ * snmplib/keytools.c, snmplib/lcd_time.c, snmplib/scapi.c:
+
+ make the usm_support utilities self-declare themselves as
+ children to
+ make sure they're properly included during dependency ordering
+
+2011-02-25 16:07 hardaker
+
+ * snmplib/callback.c, snmplib/cert_util.c, snmplib/check_varbind.c,
+ snmplib/container.c, snmplib/data_list.c,
+ snmplib/default_store.c, snmplib/fd_event_manager.c,
+ snmplib/file_utils.c, snmplib/keytools.c, snmplib/snmpusm.c:
+
+ superstructuralizationizing the features
+
+2011-02-25 16:07 hardaker
+
+ * snmplib/read_config.c, snmplib/snmp-tc.c, snmplib/snmp_client.c,
+ snmplib/snmp_enum.c, snmplib/snmp_transport.c, snmplib/system.c,
+ snmplib/text_utils.c, snmplib/tools.c,
+ snmplib/transports/snmpUnixDomain.c, snmplib/ucd_compat.c:
+
+ significant parent/child feature classification
+
+2011-02-25 16:06 hardaker
+
+ * snmplib/snmp_api.c, snmplib/snmpusm.c:
+
+ classify a few components into a top-level libnetsnmp component
+
+2011-02-25 16:06 hardaker
+
+ * snmplib/keytools.c, snmplib/lcd_time.c, snmplib/scapi.c,
+ snmplib/snmpusm.c:
+
+ structurize the usm features
+
+2011-02-25 16:06 hardaker
+
+ * snmplib/container.c, snmplib/container_iterator.c,
+ snmplib/container_list_ssll.c, snmplib/container_null.c,
+ snmplib/dir_utils.c:
+
+ structure the container features into a hierarchy
+
+2011-02-25 16:05 hardaker
+
+ * snmplib/snmp_logging.c:
+
+ group the logging handlers under a parent feature
+
+2011-02-25 16:05 hardaker
+
+ * local/minimalist/feature-makedocs:
+
+ fix the expect argument count
+
+2011-02-25 16:05 hardaker
+
+ * local/minimalist/feature-makedocs:
+
+ fix the name of the expected input file
+
+2011-02-25 16:05 hardaker
+
+ * local/minimalist/feature-makedocs:
+
+ argument parsing and usage() output
+
+2011-02-25 16:04 hardaker
+
+ * agent/helpers/stash_cache.c, agent/helpers/stash_to_next.c,
+ agent/helpers/table_dataset.c, agent/helpers/table_iterator.c,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/mibII/ipCidrRouteTable.c, snmplib/oid_stash.c:
+
+ - added two oid_stash functions as individual features
+ - cleaned up some warnings in the table_iterator code
+
+2011-02-25 12:55 dts12
+
+ * dist/makerelease.xml:
+
+ Fix the command to create a new SVN tag line
+
+ (Having brought the structure of the 5.5.x branch
+ into line with the other branches, the previous
+ command is now wrong for *all* branches, rather
+ than just most of them!)
+
+2011-02-25 11:10 dts12
+
+ * snmplib/snmpv3.c:
+
+ Avoid a possible crash if the engineID is not available or set.
+
+2011-02-25 00:40 baerm
+
+ * agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteObjectsTable.h,
+ agent/mibgroup/disman/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/mteTriggerBooleanTable.h,
+ agent/mibgroup/disman/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/mteTriggerDeltaTable.h,
+ agent/mibgroup/disman/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/mteTriggerExistenceTable.h,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerTable.h,
+ agent/mibgroup/disman/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/mteTriggerThresholdTable.h,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.h:
+
+ adding ifdef code for minimalist support of diffman mib
+
+2011-02-24 19:21 baerm
+
+ * agent/mibgroup/host/hrSWRunTable.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/host/hr_system.h:
+
+ Adding minimalist ifdefs to host resource mib
+
+2011-02-24 05:46 hardaker
+
+ * agent/helpers/table_iterator.c, snmplib/data_list.c:
+
+ mark the data_list function that's only used in stach_caching as
+ a feature
+
+2011-02-24 05:46 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ whoops.
+
+2011-02-24 05:46 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ more missing stash references
+
+2011-02-24 05:45 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ ifdefed/featured out a missing stash_cache section
+
+2011-02-24 05:45 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ make the prefix_info more hierarchical and sub-feature the unused
+ one
+
+2011-02-24 05:45 hardaker
+
+ * local/minimalist/find-unused-code:
+
+ do include the perl/python code when searching for files
+
+2011-02-24 05:45 hardaker
+
+ * agent/helpers/table_tdata.c:
+
+ make the semi-used table_tdata functions children of
+ table_tdata_all
+ instead of just table_tdata
+
+2011-02-23 22:00 magfr
+
+ * agent/helpers/table_tdata.c:
+
+ Correct typo
+
+2011-02-23 21:54 magfr
+
+ * snmplib/parse.c:
+
+ Correct typo
+
+2011-02-23 21:10 nba
+
+ * agent/snmp_vars.c:
+
+ proper include of prototype
+
+2011-02-23 21:07 hardaker
+
+ * configure, configure.d/config_modules_agent,
+ configure.d/config_modules_transports,
+ configure.d/config_project_with_enable:
+
+ compat some feature header chicken and egg problems
+
+2011-02-23 15:27 nba
+
+ * snmplib/snmpusm.c:
+
+ unsigned juggling to remove warnings
+
+2011-02-23 15:23 nba
+
+ * agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c:
+
+ unsigned juggling to remove warnings
+
+2011-02-23 15:20 nba
+
+ * agent/mibgroup/ip-mib.h:
+
+ Enable (probably forgotten) ipAddressPrefixTable
+
+2011-02-23 14:30 hardaker
+
+ * local/minimalist, local/minimalist/feature-check,
+ local/minimalist/feature-makedocs,
+ local/minimalist/feature-remove,
+ local/minimalist/find-unused-code,
+ local/minimalist/removeifdefcode.pl:
+
+ added other missing 'new' files not included in the minimalist
+ patch file
+
+2011-02-23 09:54 nba
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c:
+
+ Loading IPv6 data is a no-no when IPv6 not enabled
+
+2011-02-23 09:36 nba
+
+ * apps/snmptable.c:
+
+ Fix bug 3118631: snmptable segfaults if index contains :
+ character
+
+2011-02-23 09:30 nba
+
+ * include/net-snmp/system/freebsd8.h:
+
+ FreeBSD 8 support
+
+2011-02-23 01:48 hardaker
+
+ * include/net-snmp/net-snmp-features.h:
+
+ added missing net-snmp-features.h
+
+2011-02-23 00:01 hardaker
+
+ * Makefile.in, Makefile.rules, Makefile.top, agent/Makefile.in,
+ agent/agent_handler.c, agent/agent_index.c,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/helpers/all_helpers.c,
+ agent/helpers/baby_steps.c, agent/helpers/cache_handler.c,
+ agent/helpers/instance.c, agent/helpers/mode_end_call.c,
+ agent/helpers/multiplexer.c, agent/helpers/old_api.c,
+ agent/helpers/read_only.c, agent/helpers/row_merge.c,
+ agent/helpers/scalar.c, agent/helpers/scalar_group.c,
+ agent/helpers/snmp_get_statistic.c, agent/helpers/stash_cache.c,
+ agent/helpers/stash_to_next.c, agent/helpers/table.c,
+ agent/helpers/table_array.c, agent/helpers/table_container.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c, agent/helpers/table_row.c,
+ agent/helpers/table_tdata.c, agent/helpers/watcher.c,
+ agent/mibgroup/Makefile.in, agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/agent/extend.c, agent/mibgroup/agent/nsCache.c,
+ agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/agent/nsModuleTable.c,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsVacmAccessTable.c,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/client.c, agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteEventConf.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/expr/expErrorTable.c,
+ agent/mibgroup/disman/expr/expExpressionConf.c,
+ agent/mibgroup/disman/expr/expExpressionTable.c,
+ agent/mibgroup/disman/expr/expObjectConf.c,
+ agent/mibgroup/disman/expr/expObjectTable.c,
+ agent/mibgroup/disman/expression/expExpressionTable.c,
+ agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c,
+ agent/mibgroup/examples/data_set.c,
+ agent/mibgroup/examples/delayed_instance.c,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/examples/netSnmpHostsTable_checkfns.c,
+ agent/mibgroup/examples/scalar_int.c,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/cpu/cpu_kinfo.c,
+ agent/mibgroup/hardware/cpu/cpu_nlist.c,
+ agent/mibgroup/hardware/cpu/cpu_perfstat.c,
+ agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/memory/hw_mem.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/host/data_access/swinst_darwin.c,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c,
+ agent/mibgroup/host/data_access/swinst_rpm.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_swinst.c, agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hrh_filesys.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c,
+
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+ agent/mibgroup/ip-mib/data_access/arp_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+ agent/mibgroup/ip-mib/ip_scalars.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/ipCidrRouteTable.c,
+ agent/mibgroup/mibII/ipv6.c, agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/setSerialNo.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.h,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c,
+ agent/mibgroup/sctp-mib/sctpTables_common.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.c,
+ agent/mibgroup/snmpv3/usmUser.c, agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/snmpv3mibs.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.h,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/target/target_counters.h,
+ agent/mibgroup/target/target_counters_5_5.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_common.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+ agent/mibgroup/testhandler.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+ agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c, agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/utilities/iquery.c,
+ agent/mibgroup/winExtDLL.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c, apps/Makefile.in,
+ apps/agentxtrap.c, apps/snmpnetstat/Makefile.in,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/netstat.h,
+ apps/snmpnetstat/route.c, apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrapd.c, apps/snmptrapd_handlers.c,
+ apps/snmptrapd_sql.c, configure, configure.ac,
+ configure.d/config_modules_agent, configure.d/config_modules_lib,
+ configure.d/config_modules_security_modules,
+ configure.d/config_modules_transports,
+ configure.d/config_os_libs2,
+ configure.d/config_project_perl_python,
+ configure.d/config_project_with_enable,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmpksm.h,
+ include/net-snmp/library/snmptsm.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/snmpv3.h,
+ include/net-snmp/net-snmp-config.h.in, perl/OID/OID.xs,
+ perl/SNMP/SNMP.xs, perl/agent/agent.xs, snmplib/Makefile.in,
+ snmplib/callback.c, snmplib/cert_util.c, snmplib/check_varbind.c,
+ snmplib/container.c, snmplib/container_iterator.c,
+ snmplib/container_list_ssll.c, snmplib/container_null.c,
+ snmplib/data_list.c, snmplib/default_store.c,
+ snmplib/dir_utils.c, snmplib/fd_event_manager.c,
+ snmplib/file_utils.c, snmplib/int64.c, snmplib/keytools.c,
+ snmplib/lcd_time.c, snmplib/mib.c, snmplib/oid_stash.c,
+ snmplib/parse.c, snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp-tc.c, snmplib/snmp_api.c, snmplib/snmp_client.c,
+ snmplib/snmp_enum.c, snmplib/snmp_logging.c,
+ snmplib/snmp_openssl.c, snmplib/snmp_parse_args.c,
+ snmplib/snmp_secmod.c, snmplib/snmp_transport.c,
+ snmplib/snmpksm.c, snmplib/snmptsm.c, snmplib/snmpusm.c,
+ snmplib/snmpv3.c, snmplib/system.c, snmplib/text_utils.c,
+ snmplib/tools.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUnixDomain.c, snmplib/ucd_compat.c,
+ testing/fulltests/default/Sv3config,
+ testing/fulltests/default/Sv3usmconfigbase,
+ testing/fulltests/default/Sv3vacmconfig,
+ testing/fulltests/default/T049snmpv3inform_simple,
+ testing/fulltests/default/T049snmpv3informauth_simple,
+ testing/fulltests/default/T057trapdauthtest2_simple,
+ testing/fulltests/default/T057trapdauthtest3_simple,
+ testing/fulltests/default/T057trapdauthtest_simple,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T113agentxtrap_simple,
+ testing/fulltests/default/T114agentxagentxtrap_simple:
+
+ NEWS: packaging: Enable micro-and-macro-feature management within
+ Net-SNMP; this adds a number of new flags to configure
+ (--enable-minimalist and --enable-read-only). These changes are
+ designed to remove much of the inline code that isn't always
+ necessary or desired. Scripts exist (and will be improved) to
+ stip out unused components from the code entirely to enable a
+ shorter review process for upgrading to new releases. This work
+ was done by Wes Hardaker and Michael Baer from SPARTA, Inc. but
+ is being checked in as a large patch since converting the micro
+ patches from git to svn turend out to be impossible
+
+2011-02-22 23:55 hardaker
+
+ * FAQ:
+
+ use the wiki URL instead of the tutorial-5 URL for the snmptrap
+ tutorial
+
+2011-02-21 22:40 nba
+
+ * agent/mibgroup/host/data_access/swrun_kinfo.c:
+
+ proper process status values for netbsd
+
+2011-02-21 22:39 nba
+
+ * snmplib/scapi.c:
+
+ conditionalize variable
+
+2011-02-21 22:20 nba
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn.h:
+
+ tcp-mib/udp-mib support for the *bsds
+
+2011-02-21 22:16 nba
+
+ * agent/mibgroup/mibII.h,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint.h,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c:
+
+ tcp-mib/udp-mib support for the *bsds
+
+2011-02-21 22:05 nba
+
+ *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c:
+
+ Properly end debug message with newline
+
+2011-02-21 22:04 nba
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c:
+
+ remove var that shadows the useful one
+
+2011-02-21 22:02 nba
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ major fiddling to get things working for openbsd too. This should
+ really be reworked to use the tcp-mib/udp-mib/data_access
+
+2011-02-21 21:59 nba
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ fix tcp states for dragonflybsd
+
+2011-02-21 21:57 nba
+
+ * agent/mibgroup/mibII.h:
+
+ enable new tcp/udp mibs for solaris
+
+2011-02-21 21:53 magfr
+
+ * agent/mibgroup/hardware/sensors/lmsensors_v3.c:
+
+ Do not use c99
+
+2011-02-21 19:08 hardaker
+
+ * dist/makerelease.xml:
+
+ Updated comment about where makerelease comes from (now github)
+
+2011-02-20 09:24 bvassche
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: BUG: 3185528: shutdown_master_agent doesn't close
+ UDP socket
+ (Fixes a bug introduced in r19511.)
+
+2011-02-18 14:43 jsafranek
+
+ * agent/mibgroup/hardware/fsys/fsys_getfsstats.c,
+ agent/mibgroup/hardware/fsys/fsys_mntctl.c,
+ agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.c,
+ agent/mibgroup/host/hrh_storage.c,
+ include/net-snmp/agent/ds_agent.h,
+ include/net-snmp/agent/hardware/fsys.h, man/snmpd.conf.5.def:
+
+ CHANGES: snmpd: reworked hrStorageTable to support large
+ filesystems.
+
+ The hrStorageAllocationUnits does not report real allocation unit
+ size,
+ but some calculated value so hrStorageAllocationUnits *
+ hrStorageSize
+ gives real size of the filesystem.
+
+ This calculation happens only when hrStorageSize is too small
+ (32bits)
+ for filesystem size, e.g. filesystems larger than 8TB with 4096
+ bytes
+ block size.
+
+ This calculation can be turned off by 'realStorageUnits' config
+ option.
+
+2011-02-18 14:29 jsafranek
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/mnttypes.h:
+
+ Add JFS and XFS to list of known filesustems
+
+2011-02-17 11:28 jsafranek
+
+ * local/snmp-bridge-mib:
+
+ Fixed snmp-bridge-mib in standalone (agentx) version.
+ Don't declare local variables inside block. Patch provided by
+ Jens Osterkamp.
+
+2011-02-16 14:56 jsafranek
+
+ * local/snmp-bridge-mib:
+
+ Fixed snmp-bridge-mib when working in the embedded perl.
+
+2011-02-16 13:16 jsafranek
+
+ * local/snmp-bridge-mib:
+
+ Fixed GETNEXT processing in snmp-bridge-mib.
+
+2011-02-15 22:24 nba
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ Properly save entries for NetBSD and DragonFly
+
+2011-02-15 22:18 nba
+
+ * agent/mibgroup/mibII/udp.c:
+
+ remove redundant includes
+
+2011-02-15 21:46 nba
+
+ * configure:
+
+ rerun autoheader/autoconf
+
+2011-02-15 21:33 nba
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ include sys/types.h before sys/socket.h
+
+2011-02-15 21:26 nba
+
+ * m4/netsnmp_search_libs.m4:
+
+ Too much quoting is bad
+
+2011-02-15 21:11 nba
+
+ * agent/mibgroup/mibII.h, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/ipv6.h:
+
+ Fix IPv6 TCP and UDP tables, *BSD support
+
+2011-02-15 20:45 nba
+
+ * agent/mibgroup/disman/expr/expObjectConf.c,
+ agent/mibgroup/disman/expr/expValue.c,
+ agent/mibgroup/disman/nslookup/lookupResultsTable.c:
+
+ Kill compiler warnings
+
+2011-02-15 20:44 nba
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ Filter IPv6 entries from IPv4 table
+
+2011-02-15 20:42 nba
+
+ * agent/mibgroup/host/data_access/swrun.h,
+ agent/mibgroup/host/data_access/swrun_kinfo.c:
+
+ Proper use of getproc2 and dragonfly support
+
+2011-02-15 20:41 nba
+
+ * agent/mibgroup/hardware/fsys/fsys_getfsstats.c:
+
+ getvfsstat is only for NetBSD
+
+2011-02-15 20:39 nba
+
+ * configure.d/config_os_libs1, configure.d/config_os_libs2:
+
+ Detect need for -lkvm in proper time
+
+2011-02-15 19:42 hardaker
+
+ * snmplib/snmp_logging.c:
+
+ remove the statement about enabling stderr by default.
+
+2011-02-15 19:42 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ remove 3 functions that as far as I can tell have possibly never
+ been used
+
+2011-02-14 14:38 bvassche
+
+ * agent/snmpd.c:
+
+ Fixed a MinGW-specific compiler warning.
+
+2011-02-13 16:28 magfr
+
+ * net-snmp-config.in:
+
+ CHANGES: Make it possible to build static applications using
+ net-snmp-config and the -*libs flags once more.
+
+2011-02-10 15:13 dts12
+
+ * snmplib/mib.c:
+
+ CHANGES: snmplib: PATCHES: 3165878: Catch buffer overrun on
+ 64-bit systems
+
+2011-02-10 15:06 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/ucd-snmp/vmstat_linux.c:
+
+ CHANGES: snmpd: PATCHES: 3152412: Handle (and report) problems
+ reading /proc/vmstat
+
+2011-02-09 07:34 bvassche
+
+ * include/net-snmp/library/container.h:
+
+ Building DLL and Perl modules with win32/build.bat works again.
+
+2011-02-08 19:38 hardaker
+
+ * agent/helpers/instance.c, include/net-snmp/agent/instance.h:
+
+ Remove the functions marked as deprecated and safe for removal in
+ 5.6.
+
+2011-02-08 17:41 hardaker
+
+ * perl/SNMP/SNMP.xs, perl/agent/agent.pm:
+
+ CHANGES: perl: patch from Martin Buck: don't always open stderr
+ as the calls to snmp_log already do this and it messes up the
+ agent when embedded
+
+2011-02-08 17:37 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ CHANGES: snmpd: Fix a strlen calculation as pointed out by
+ Konstantin Baydarov
+
+2011-02-07 20:07 hardaker
+
+ * man/snmp.conf.5.def:
+
+ document the 3 new SSH config tokens
+
+2011-02-07 20:07 hardaker
+
+ * snmplib/transports/snmpSSHDomain.c:
+
+ CHANGES: libnetsnmp: made the SSH transport configurable as it
+ should be.
+
+2011-02-07 20:07 hardaker
+
+ * include/net-snmp/library/default_store.h:
+
+ Added default_store strings for ssh: username, pubkey, privkey
+
+2011-02-06 06:34 magfr
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ Simplify the control flow to allow for more optimization.
+
+2011-02-03 22:42 tanders
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: BUG: 3171878: Using SNMPv3 context does not
+ work
+
+2011-02-02 07:09 magfr
+
+ * agent/snmpd.c:
+
+ Include the USING_ variables from the agent library as well, in
+ particular the
+ USING_AGENTX_* variables.
+
+2011-02-01 13:07 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_common.c:
+
+ Don't check for 32/64bit wrap in calculated entries.
+
+2011-02-01 09:41 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_common.c:
+
+ CHANGES: snmpd: fixed the agent writing 'looks like a 64bit wrap,
+ but prev!=new' in syslog when computing ipSystemStats
+
+ Without the memcpy, prev_vals->stats and new_vals->stats could
+ get different,
+ which could much much later (when a counter gets bigger than 32
+ bits) result
+ in 'prev!=new' message in syslog. Typically this happens after
+ long time of
+ uptime and it is very hard to reproduce.
+
+2011-02-01 07:19 magfr
+
+ * agent/snmpd.c:
+
+ Remove some unused includes
+
+2011-01-31 22:39 nba
+
+ * agent/mibgroup/disman/nslookup/lookupCtlTable.c:
+
+ addprototypes and remove unused vars
+
+2011-01-31 22:37 nba
+
+ * agent/mibgroup/disman/expr/expExpression.c,
+ agent/mibgroup/disman/expr/expExpression.h,
+ agent/mibgroup/disman/expr/expObject.c,
+ agent/mibgroup/disman/expr/expObject.h,
+ agent/mibgroup/disman/expr/expValueTable.c,
+ apps/snmpnetstat/inet6.c:
+
+ const juggling to remove warnings
+
+2011-01-31 22:30 nba
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ diskio for dragonfly
+
+2011-01-31 22:28 nba
+
+ * agent/mibgroup/hardware/cpu/cpu_kinfo.c:
+
+ properly name initalizer function for cpu_kinfo
+
+2011-01-30 15:21 magfr
+
+ * apps/agentxtrap.c:
+
+ Reduce the number of used include files.
+
+2011-01-30 09:35 magfr
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h:
+
+ CHANGES: snmpd: Add missing function declaration
+
+2011-01-30 01:06 tanders
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ CHANGES: snmpd: BUG: 3151897: fd leak w/ /proc/partitions
+ read in diskio
+
+2011-01-29 23:36 tanders
+
+ * agent/mibgroup/host/hr_system.c:
+
+ NEWS: snmpd: BUG: 3166568: hrSystemProcesses missing in 5.6/5.6.1
+
+2011-01-27 09:35 dts12
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c:
+
+ After ten years intensive use, an "experimental"
+ feature can probably be released for general use.
+
+2011-01-26 16:50 hardaker
+
+ * local/mib2c:
+
+ CHANGES: mib2c: make the mib2c foreach ranges work as advertised
+ in the comments.
+
+2011-01-26 16:49 hardaker
+
+ * testing/fulltests/default/T027snmpv3Defaults_simple:
+
+ a test to ensure v3/USM snmp.conf settings work
+
+2011-01-26 16:49 hardaker
+
+ * dist/makerelease.xml:
+
+ remove testopts
+
+2011-01-26 09:12 jsafranek
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ CHANGES: snmpd: fixed rare race condition when counting processes
+ for UCD-SNMP-MIB::prTable
+
+ The XX process can exit after fopen(/proc/XX/status) and before
+ fgets() from it. snmpd should continue with other processes and
+ not to stop.
+
+2011-01-19 13:57 jsafranek
+
+ * configure, configure.d/config_os_libs1:
+
+ Make us compatible with rpm-4.9, rpmGetFilesystemList does not
+ exist anymore, so the configure script should not check it.
+
+2011-01-19 06:31 nba
+
+ * configure.d/config_os_libs1:
+
+ diskIOLAx requires exp which may require -lm
+
+2011-01-18 22:39 nba
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ autoheader
+
+2011-01-18 22:37 nba
+
+ * agent/mibgroup/if-mib/data_access/interface.h:
+
+ Find proper if-mib interface for NetBSD
+
+2011-01-18 22:36 nba
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ typo
+
+2011-01-18 22:35 nba
+
+ * acconfig.h:
+
+ define dragonflyid
+
+2011-01-14 13:24 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c:
+
+ Add IPv6 support for creating rows in ipAddresstable.
+
+ Using SNMP SET, it is now possible to create and destroy IPv6
+ addresses on an interface.
+
+2011-01-14 12:28 jsafranek
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c:
+
+ CHANGES: snmpd: from Robert Story: fixed adding new addresses to
+ ipAddressTable
+
+ Long time ago, there was a bugreport[1] regarding ipAddressTable
+ on
+ net-snmp-coders list and rstory's experimental patch without any
+ feedback.
+ Now I've got few complaints that SNMP SET on ipAddressTable
+ produces the
+ same errors and guess what, the patch fixes them.
+
+ [1]:
+ http://sourceforge.net/mailarchive/forum.php?thread_name=20060920134935.35b36ed6%40dev.futz.org&forum_name=net-snmp-coders
+
+2011-01-14 06:25 rstory
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ remove completely useless and nonsensical code
+
+2011-01-13 17:24 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ allocate space for array NULL termination
+
+2011-01-13 15:56 dts12
+
+ * dist/makerelease.xml:
+
+ Ensure releases are installed to the correct path within the
+ /tags SVN tree
+
+2011-01-13 15:15 dts12
+
+ * agent/mibgroup/mibII/kernel_netbsd.c:
+
+ Remove C++ comments
+
+2011-01-13 13:17 dts12
+
+ * agent/auto_nlist.c:
+
+ Fix broken patch
+
+2011-01-13 12:14 dts12
+
+ * configure, configure.d/config_os_headers,
+ configure.d/config_os_libs1:
+
+ Configure fixes for DragonFly support
+
+2011-01-13 12:04 dts12
+
+ * agent/auto_nlist.c, agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/if-mib/data_access/interface.h,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/ip.h,
+ agent/mibgroup/mibII/tcp.c, include/net-snmp/system/dragonfly.h:
+
+ Code fixes for DragonFly support
+
+2011-01-13 11:33 dts12
+
+ * agent/mibgroup/hardware/memory/memory_netbsd.c:
+
+ Fix typo
+
+2011-01-12 21:23 rstory
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ merge duplicated shutdown functions
+
+2011-01-12 20:11 bvassche
+
+ * agent/helpers/table_iterator.c,
+ include/net-snmp/agent/table_iterator.h:
+
+ Reimplement netsnmp_register_table_iterator2() by adding the flag
+ NETSNMP_ITERATOR_OWNS_IINFO for
+ netsnmp_iterator_info. Remove
+ netsnmp_get_table_iterator_handler2() because it is now
+ superfluous.
+
+2011-01-12 19:22 bvassche
+
+ * agent/snmp_vars.c:
+
+ Avoid that the compiler complains about a missing declaration for
+ netsnmp_certs_agent_init().
+
+2011-01-12 19:20 bvassche
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c:
+
+ Get rid of a compiler warning in
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c.
+
+2011-01-12 19:04 bvassche
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Fixed a compiler warning (format specification mismatch) that was
+ introduced
+ in r19808 ("snmpd: PATCHES: 2975254: Avoid callback re-use of
+ closed sessions").
+
+2011-01-12 15:03 rstory
+
+ * agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/notification/snmpNotifyTable.c:
+
+ CHANGES: snmp: patch: 3096725: sysORTable registation for
+ notification log mib
+
+ original patch fixed several issues, other parts applied earlier
+
+2011-01-11 17:27 rstory
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ do not include ipv6 struct if ipv6 is not enabled
+
+2011-01-11 16:04 dts12
+
+ * ov/UCD-fields, ov/oid_to_sym.in, ov/oid_to_type.in:
+
+ Recognise Agent OID for DragonFly systems (and general tidying
+ up)
+ [From NetBSD patch archive]
+
+ Qn: Should these be updated to refer to Net-SNMP (rather than
+ UCD)?
+
+2011-01-11 16:01 dts12
+
+ * include/net-snmp/net-snmp-config.h.in, mibs/NET-SNMP-TC.txt,
+ mibs/UCD-SNMP-MIB.txt, sedscript.in:
+
+ Define Agent OID for DragonFly systems
+ (and general tidying up)
+ [From NetBSD patch archive]
+
+2011-01-11 15:27 dts12
+
+ * agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udpTable.c:
+
+ NetBSD DragonFly support for UDP & TCP tables
+ [From NetBSD patch archive]
+
+2011-01-11 14:41 dts12
+
+ * agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/cpu/cpu_kinfo.c,
+ agent/mibgroup/hardware/cpu/cpu_kinfo.h,
+ agent/mibgroup/host/hr_swrun.c, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c:
+
+ CHANGES: NetBSD: DragonFly support
+ [From NetBSD patch archive]
+
+2011-01-11 14:36 dts12
+
+ * configure, configure.d/config_os_struct_members:
+
+ NetBSD/DragonFly 'struct ifnet' requires KERNEL, but not _KERNEL
+ [From NetBSD patch archive]
+ (I hope I've got this one right!)
+
+2011-01-11 13:34 jsafranek
+
+ * snmplib/transports/snmpUDPBaseDomain.c:
+
+ CHANGES: snmplib: from Bill Fenner: fix sending of UDP responses
+ from multihomed agents.
+
+ Try to send the response as it was before Net-SNMP 5.6 (assuming
+ the appropriate request was unicast) and only if it fails try to
+ set if_index (the request must be broadcast).
+
+2011-01-11 13:22 dts12
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Really handle systems with 'struct timespec ifnet.if_lastchange'
+ (missing element from SVN revision 19841)
+
+2011-01-11 12:24 dts12
+
+ * configure, configure.d/config_os_headers:
+
+ Additional headers when testing for IPv6 headers
+ [From NetBSD patch archive]
+
+2011-01-11 12:14 dts12
+
+ * snmplib/transports/snmpUDPIPv6Domain.c:
+
+ Missing type under darwin
+ [From NetBSD patch archive]
+
+2011-01-11 12:10 dts12
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ NetBSD support for Disk I/O stats
+ [From NetBSD patch archive]
+
+2011-01-11 12:01 dts12
+
+ * configure, configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Handle systems with 'struct timespec ifnet.if_lastchange' (rather
+ than struct timeval)
+ [From NetBSD patch archive]
+
+2011-01-11 11:27 dts12
+
+ * agent/mibgroup/mibII/icmp.h, agent/mibgroup/mibII/ip.h,
+ agent/mibgroup/mibII/tcp.h, agent/mibgroup/mibII/udp.h:
+
+ Pull in kernel_netbsd module when required
+ [Based on fix from NetBSD patch archive]
+
+2011-01-11 10:36 dts12
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/kernel_netbsd.c,
+ agent/mibgroup/mibII/kernel_netbsd.h,
+ agent/mibgroup/mibII/mibII_common.h, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c, include/net-snmp/system/netbsd.h:
+
+ CHANGES: NetBSD: Retrieve MIB-II network statistics via sysctl
+ [From NetBSD patch archive]
+
+2011-01-11 07:04 nba
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Fix for pci_lookup_name and RHEL4
+
+2011-01-10 16:56 dts12
+
+ * agent/mibgroup/mibII/route_write.c:
+
+ Add support for darwin
+ (The patch from the NetBSD archive appears to be essentially the
+ same as the equivalent code from the OpenBSD patch archive)
+
+2011-01-10 16:54 dts12
+
+ * agent/mibgroup/host/hr_network.c:
+
+ Add support for darwin
+ [From NetBSD patch archive]
+
+2011-01-10 14:55 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/memory/memory_netbsd.c:
+
+ CHANGES: NetBSD: Update memory and CPU statistics handling
+ [From NetBSD patch archive]
+
+2011-01-10 14:22 dts12
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ Fix divide-by-zero error in CPU performance statistics
+ [From NetBSD patch archive]
+
+2011-01-09 22:54 dts12
+
+ * agent/mibgroup/host/data_access/swrun_kinfo.c,
+ agent/mibgroup/host/hr_swrun.c, configure,
+ configure.d/config_os_libs2:
+
+ CHANGES: OpenBSD: Update SWRun code to use kvm_getproc2
+ [From OpenBSD patch archive]
+
+2011-01-09 21:30 dts12
+
+ * configure, configure.d/config_os_headers:
+
+ CHANGES: build: OpenBSD: Fix order of headers when checking
+ <netinet/in_pcb.h>
+ [From OpenBSD patch archive]
+
+2011-01-09 19:44 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c:
+
+ Amend how multi-CPU statistics are retreived using sysctl on
+ OpenBSD systems
+ (if this block was active, which it isn't, but that's not
+ important right not)
+ [Based on OpenBSD patch archive, amended (probably wrongly) by
+ DTS]
+
+2011-01-09 18:13 dts12
+
+ * agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/ucd-snmp/diskio.c, agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c:
+
+ sysctl takes a 'size_t' variable for the size parameter
+
+2011-01-09 18:11 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_nlist.c,
+ agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/memory/memory_netbsd.c,
+ agent/mibgroup/host/data_access/swrun_kinfo.c:
+
+ sysctl takes a 'size_t' variable for the size parameter
+
+2011-01-08 08:30 magfr
+
+ * configure, configure.d/config_modules_security_modules:
+
+ CHANGES: building: Fix --with-security-modules handling
+ Allow repeated modules (tsm,tsm) as well as defailt modules (usm)
+ Move the generation of the files after the checking
+
+2011-01-08 00:47 magfr
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Update acconfig.h with changes from r19819.
+ Rerun autoheader.
+
+2011-01-07 20:56 dts12
+
+ * agent/mibgroup/mibII/route_write.c:
+
+ CHANGES: OpenBSD: Support updating the routing table
+ [From OpenBSD patch archive]
+
+2011-01-07 20:29 dts12
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ Set 'next' field for udp entry linked list on OpenBSD4
+ [From OpenBSD patch archive]
+
+ This should probably be set in <net-snmp/system/openbsd.h>
+
+2011-01-07 20:12 dts12
+
+ * agent/mibgroup/mibII/mta_sendmail.c:
+
+ Use a suitable constant for CWD buffer size
+ [Based on OpenBSD patch archive]
+
+2011-01-07 20:07 dts12
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Move global variable into the method where it's used.
+ [From OpenBSD patch archive]
+
+2011-01-07 16:48 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_sysctl.c:
+
+ Handle systems without IFM_TOKEN
+ [From OpenBSD patch archive]
+
+2011-01-07 14:38 dts12
+
+ * agent/mibgroup/hardware/memory/memory_freebsd.c:
+
+ Update retrieval of cache usage statistics on FreeBSD
+ [From FreeBSD patch archive]
+
+2011-01-07 14:20 dts12
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Increase maximum size of execute output cache
+ [From FreeBSD patch archive]
+
+2011-01-07 14:09 dts12
+
+ * agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c:
+
+ Remove duplicate include directives
+ [From FreeBSD patches archive]
+
+2011-01-07 13:47 dts12
+
+ * agent/mibgroup/mibII/at.c:
+
+ Handle systems where RTF_LLINFO is not defined
+ [From FreeBSD patch archive]
+
+2011-01-07 13:40 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Include zfs mount points for disk reports under FreeBSD
+ [From FreeBSD patch archive]
+
+2011-01-07 13:34 dts12
+
+ * include/net-snmp/system/generic.h:
+
+ Protect against multiple-inclusion
+ [From FreeBSD patches archive]
+
+2011-01-07 13:24 dts12
+
+ * snmplib/callback.c, snmplib/default_store.c, snmplib/keytools.c,
+ snmplib/lcd_time.c, snmplib/mib.c, snmplib/parse.c,
+ snmplib/scapi.c, snmplib/snmp_auth.c, snmplib/snmp_debug.c,
+ snmplib/snmp_logging.c, snmplib/snmp_transport.c,
+ snmplib/snmpusm.c, snmplib/tools.c:
+
+ Include <unistd.h>
+ [From BSD patches archive]
+
+2011-01-07 13:21 dts12
+
+ * snmplib/snmp_api.c:
+
+ Avoid callback re-use of closed sessions.
+ (Part of patch #2975254 - see SVN revision 19808)
+
+2011-01-07 12:55 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c:
+
+ FreeBSD uses a slightly different naming scheme for struct ifreq
+ [From FreeBSD patches archive]
+
+2011-01-07 12:22 dts12
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ Ensure TCP table information is loaded before counting
+ connections
+ [From FreeBSD patch archive]
+
+2011-01-06 19:35 hardaker
+
+ * perl/agent/agent.pm:
+
+ Fix documentation bug pointed out in cpan bug #52618
+
+2011-01-06 14:11 dts12
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: snmpd: PATCHES: 2975254: Avoid callback re-use of closed
+ sessions
+
+ Qn: Should this also be applied when main session is NULL?
+
+2011-01-06 13:21 dts12
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Fix misleading indentation
+
+ Qn: Should this call 'subagent_startup' rather than
+ 'agentx_reopen_session'?
+ Qn: Why doesn't this attempt to re-open the session if it was
+ originally NULL?
+
+2011-01-06 12:46 dts12
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: PATCHES: 2941811: Handle successful requests with
+ reqID 0
+
+2011-01-06 09:38 bvassche
+
+ * agent/mibgroup/agent/nsModuleTable.c,
+ agent/mibgroup/agent/nsTransactionTable.c:
+
+ Spelling fix: Initialzies -> Initializes.
+
+2011-01-06 09:35 bvassche
+
+ * agent/helpers/table_iterator.c, agent/mibgroup/agent/nsCache.c,
+ agent/mibgroup/agent/nsDebug.c, agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/agent/nsModuleTable.c,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsVacmAccessTable.c,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/ipCidrRouteTable.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ include/net-snmp/agent/table_iterator.h:
+
+ CHANGES: agent: Added netsnmp_get_table_iterator2().
+ CHANGES: agent: Added netsnmp_register_table_iterator2().
+ CHANGES: agent: Added netsnmp_handler_owns_iterator_info().
+ CHANGES: agent: Fixed leak-at-exit triggered by snmpNotifyTable.
+ CHANGES: agent: Fixed leak-at-exit triggered by
+ snmpTargetAddrTable.
+ Also, restored backwards compatibility of
+ netsnmp_register_table_iterator().
+
+2011-01-06 04:45 rstory
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ include sys/socket.h if available
+
+2011-01-05 14:06 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: BUGS: 3134323: Fix crash when comparing invalid
+ OIDs
+
+2011-01-05 14:04 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ CHANGES: snmptrapd: BUGS: 3151254: Fix crash with invalid
+ traphandle directive
+
+2011-01-05 09:55 dts12
+
+ * apps/snmpwalk.c:
+
+ Expand tab characters
+
+2011-01-04 22:06 magfr
+
+ * snmplib/snmp_transport.c:
+
+ CHANGES: snmplib: Check that the argument to
+ netsnmp_transport_copy is non-NULL
+
+2011-01-04 18:24 hardaker
+
+ * COPYING:
+
+ Copyright update for 2011
+
+2011-01-04 12:01 bvassche
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Fix compiler warnings triggered by the Win32 MIB-II
+ implementation.
+
+2011-01-03 19:48 bvassche
+
+ * agent/mibgroup/sctp-mib/sctpScalars.c:
+
+ Removed two unused variables.
+
+2011-01-03 19:47 bvassche
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ Fixed a recently introduced mismatch between format specification
+ and argument list.
+
+2011-01-03 19:47 bvassche
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ Get rid of recently introduced compiler warnings by adding two
+ #include directives and commenting out two unused functions.
+
+2011-01-02 05:48 rstory
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ don't free callers ptr
+
+2011-01-02 05:48 rstory
+
+ * agent/agent_registry.c, agent/helpers/table.c,
+ agent/helpers/table_data.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteObjects.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c,
+ agent/mibgroup/snmpv3/usmUser.c, agent/snmp_agent.c,
+ apps/snmpnetstat/if.c, snmplib/container_binary_array.c,
+ snmplib/keytools.c, snmplib/mib.c, snmplib/snmp_api.c,
+ snmplib/snmpv3.c, snmplib/tools.c,
+ snmplib/transports/snmpCallbackDomain.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c:
+
+ clean up SNMP_FREE usage
+
+2011-01-02 05:47 rstory
+
+ * snmplib/transports/snmpIPv6BaseDomain.c:
+
+ fix cut-n-paste error in debug token
+
+2011-01-02 05:47 rstory
+
+ * include/net-snmp/library/snmpUDPIPv6Domain.h:
+
+ fix function name in prototype
+
+2011-01-02 05:46 rstory
+
+ * agent/helpers/cache_handler.c:
+
+ fix compiler warning
+
+2011-01-02 05:46 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c:
+
+ CHANGES: snmplib: remove inline versions of container funcs
+
+2011-01-02 05:46 rstory
+
+ * snmplib/cert_util.c:
+
+ CHANGES: snmplib: dont return empty array
+
+2011-01-02 05:46 rstory
+
+ * man/snmpd.conf.5.def, snmplib/transports/snmpUDPIPv6Domain.c:
+
+ fix typos/grammar in man pages/comments (no code changes)
+
+2011-01-02 05:45 rstory
+
+ * agent/mibgroup/target/target.c, python/netsnmp/client_intf.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ NEWS: snmplib: add new transport config tokens
+ localCert/peerCert,
+ deprecate our_identity, their_identity
+
+2011-01-02 05:45 rstory
+
+ * include/net-snmp/library/default_store.h, man/snmpcmd.1.def,
+ man/snmpd.conf.5.def, snmplib/cert_util.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ NEWS: snmplib: introduce new localCert/peerCert, deprecate
+ serverCert, clientCert, defX509ServerPub, defX509ClientPub
+
+2011-01-02 05:44 rstory
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ snmplib/snmp_transport.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c:
+
+ NEWS: snmplib: add IPv6 support to DTLSUDP transport
+ CHANGES: snmplib: use new netsnmp_sockaddr_storage in
+ netsnmp_addr_pair
+ CHANGES: snmplib: add base_transport ptr for tunneled transports
+
+2011-01-02 05:42 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ CHANGES: snmpd: skip non-AF_INET interfaces when loading ipv4
+ addrs
+
+2010-12-29 01:37 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ NEWS: snmpd: Patch 3141462: from fenner: fix agentx subagent
+ issues with multiple-object requests
+
+2010-12-29 01:33 hardaker
+
+ * snmplib/vacm.c:
+
+ NEWS: snmpd: Patch from Niels to fix VACM persistant storage.
+
+2010-12-21 11:29 dts12
+
+ * dist/makerelease.xml:
+
+ Bring all versions of makerelease.xml into line
+
+2010-12-21 06:14 nba
+
+ * agent/mibgroup/agent_mibs.h:
+
+ fix configuring with --disable-debugging
+
+2010-12-20 23:27 hardaker
+
+ * testing/fulltests/default/T200snmpv2cwalkall_simple,
+ testing/fulltests/support/simple_eval_tools.sh,
+ testing/fulltests/support/simple_run:
+
+ Patch from Magnus to fix if ! tests on solaris
+
+2010-12-14 20:10 rstory
+
+ * man/snmpcmd.1.def:
+
+ fix typo in man page
+
+2010-12-10 15:50 hardaker
+
+ * agent/agent_trap.c, snmplib/snmpusm.c:
+
+ CHANGES: snmpd: Patch from Claus Klein to fix engineid generation
+ on outgoing v3 traps from the agent
+
+2010-12-08 13:17 jsafranek
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ CHANGES: snmpd: add newly created/destroyed interfaces to
+ ipv6IfTable
+
+ The list of interfaces was never refreshed, now it is reloaded
+ every time the
+ table is accessed. I've also fixed a memory leak and optimized
+ the loading
+ of the list a bit.
+
+2010-12-06 23:23 hardaker
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c:
+
+ Patch from Niels to remove extra headers from the linux dot3stats
+ implementation
+
+2010-12-06 22:08 hardaker
+
+ * configure, configure.d/config_os_functions:
+
+ Check for the minimum required function in OpenSSL for DTLS
+ support
+
+2010-12-06 16:34 rstory
+
+ * agent/snmp_vars.c:
+
+ call netsnmp_certs_agent_init sooner, fixing snmptrapd (D)TLS
+ support
+
+2010-12-06 16:24 hardaker
+
+ * apps/snmptrap.c:
+
+ fix contextEngineIDs for outgoing informs from snmpinform to be
+ the local engineID
+
+2010-12-01 21:18 nba
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Fix conflicting declarations
+
+2010-12-01 01:23 hardaker
+
+ * agent/snmp_vars.c:
+
+ Patch from magfr to fix building without openssl
+
+2010-12-01 01:06 hardaker
+
+ * agent/snmpd.c:
+
+ use netsnmp_assert instead of assert
+
+2010-11-30 23:43 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ implement DTLS cookies semi-properly (state is still saved, which
+ still needs to change)
+
+2010-11-30 23:27 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: patch 3049029: from fennec: fix a memory leak with
+ snmp bulkwalks
+
+2010-11-30 23:16 hardaker
+
+ *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c:
+
+ CHANGES: snmpd: PATCH: 3053436: from: takevos: fix:
+ tcpConnectionTable_data_access invalid memory access
+
+2010-11-30 23:12 hardaker
+
+ *
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c:
+
+ CHANGES: snmpd: PATCH: 3053436: from: takevos: fix:
+ tcpListenerTable_data_access invalid memory access
+
+2010-11-30 22:18 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c, configure,
+ configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in:
+
+ reverted 19701 (ethtool) as it broke things
+
+2010-11-30 21:08 nba
+
+ * apps/snmptls.c, apps/snmptrapd_sql.c:
+
+ u_int32_t is less portable than uint32_t (Solaris 11)
+
+2010-11-30 20:52 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ remove a compile warning about a nested if without a block
+
+2010-11-30 19:57 rstory
+
+ * snmplib/cert_util.c:
+
+ error check the right pointer after attempting allocation
+
+2010-11-30 05:58 hardaker
+
+ * apps/snmpwalk.c:
+
+ NEWS: apps: PATCH 3054817: from nightcoding: Adds per-variable
+ timed output support to snmpwalk using -CT
+
+2010-11-30 05:56 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c, configure,
+ configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmpd: PATCH: 3057090: from shemminger: make ethtool
+ support on linux use the high speed struct info for 100G+.
+
+2010-11-30 05:47 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c, configure,
+ configure.d/config_os_libs2,
+ include/net-snmp/net-snmp-config.h.in:
+
+ NEWS: snmpd: PATCH 3057093: from shemminger: allow linux to use
+ libpci for creating useful ifDescr strings
+
+2010-11-30 04:58 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ CHANGES: PATCH 3074918: from weizheng: check for CONTAINER_INSERT
+ failures and react appropriately to avoid memory leaks
+
+2010-11-30 04:34 rstory
+
+ * snmplib/cert_util.c:
+
+ CHANGES: snmpd: add debug for cert find hint as string/int
+
+2010-11-30 04:30 rstory
+
+ * agent/snmp_vars.c, include/net-snmp/library/cert_util.h,
+ snmplib/cert_util.c:
+
+ CHANGES: snmpd: instead of relying on NETSNMP_DS_LIB_APPTYPE,
+ break out
+ cert table inits to new agent cert init function, called from
+ init_agent.
+
+2010-11-30 04:21 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ CHANGES: snmpd: BUG: enforce max length on TLS secName maps
+ CHANGES: snmpd: add priority to secname debugging
+
+2010-11-29 22:20 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ CHANGES: snmpd: add debug for ssl ciphers, clarify fingerprint
+ match debug
+
+2010-11-29 22:18 rstory
+
+ * agent/helpers/cache_handler.c:
+
+ CHANGES: snmpd: use cache-unique id instead of handler name for
+ shared
+ cache reload protection
+
+2010-11-19 15:25 nba
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c:
+
+ Niels, Niels, you should know better than making last minute
+ changes to a
+ patch and then commit it without testing :-(
+
+2010-11-18 11:04 bvassche
+
+ * .,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c:
+
+ Applied r19688 on the trunk too (follow-up for r19685).
+
+2010-11-18 03:49 rstory
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/sctp-mib/sctpScalars.c:
+
+ CHANGES: agent: don't second-guess cache handler
+
+ (waves hand) this is not the function you are looking for.
+
+ netsnmp_cache_is_valid() is not meant for mib modules
+
+2010-11-17 19:59 nba
+
+ * agent/mibgroup/host/data_access/swinst_darwin.c,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c:
+
+ More proction against overflowing snprintf
+
+2010-11-17 19:57 nba
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c,
+ include/net-snmp/data_access/route.h:
+
+ Dont use first element of oid to save ifIndex - it can only be
+ 0..2
+ Second element is only 0..39, so we have to use a third element.
+
+2010-11-17 19:39 nba
+
+ * agent/mibgroup/hardware/fsys.h, configure.d/config_os_functions,
+ configure.d/config_os_libs1, configure.d/config_os_libs2:
+
+ Test getfsstat/getvfsstat in time for module selection
+
+2010-11-17 19:37 nba
+
+ * snmplib/file_utils.c:
+
+ Remove bogus test for flags==0 (O_RDONLY==0). Makes
+ udpEndpointTable work again
+
+2010-11-17 04:55 rstory
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ CHANGES: snmpd: fix double free in TLS error handling
+
+2010-11-16 10:39 bvassche
+
+ * testing/fulltests/default/T065agentextend_simple:
+
+ Reverted MinGW-specific changes from r19549 such that test T065
+ passes again on MinGW.
+
+2010-11-16 10:04 bvassche
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ CHANGES: Linux: agent: ipNetToPhysicalTable: Do not log an error
+ message if one or more interfaces are present that do not have
+ such information (NUD_NOARP), e.g. tunnels. Reported by Stephen
+ Hemminger. See also patch #3107003.
+
+2010-11-15 14:15 bvassche
+
+ * snmplib/asn1.c:
+
+ CHANGES: snmplib: Fixed bugs in asn_parse_unsigned_int64(),
+ asn_build_unsigned_int64(), asn_parse_signed_int64() and
+ asn_build_signed_int64(). Most but not all of these bugs were
+ specific to 64-bit systems. Fixes bug #3093199.
+
+2010-11-15 13:32 bvassche
+
+ * testing/fulltests/unit-tests/T008asn1_clib.c:
+
+ Avoid triggering truncation warnings.
+
+2010-11-15 13:16 bvassche
+
+ * testing/fulltests/unit-tests/T008asn1_clib.c:
+
+ Restricted all constants to 32 bits.
+
+2010-11-15 12:35 bvassche
+
+ * snmplib/snmp_debug.c:
+
+ Follow-up for r19665.
+
+2010-11-15 12:33 bvassche
+
+ * include/net-snmp/output_api.h, snmplib/snmp_debug.c:
+
+ CHANGES: snmplib: Changed the argument type of
+ debug_register_tokens() from char * into const char *.
+
+2010-11-15 10:56 bvassche
+
+ * testing/fulltests/unit-tests/T008asn1_clib.c:
+
+ Added unit test for ASN.1 encoding and decoding (only 32-bit and
+ 64-bit
+ integers so far).
+
+2010-11-11 22:48 nba
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ Fix r19636: TrapOID is not the first varbind in the converted v2
+ trap
+
+2010-11-11 08:38 bvassche
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h:
+
+ Cleanup: Removed superfluous references to the POSIX threads
+ library.
+
+2010-11-11 08:20 bvassche
+
+ * agent/mibgroup/util_funcs.h:
+
+ Follow-up for r19660: Use pid_t consistently.
+
+2010-11-10 16:36 bvassche
+
+ * agent/mibgroup/struct.h, agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h,
+ include/net-snmp/types.h:
+
+ CHANGES: agent: Introduced netsnmp_pid_t.
+ CHANGES: Win32: Eliminated casts between int and HANDLE in
+ agent/mibgroup/util_funcs.c and
+ agent/mibgroup/ucd-snmp/pass_persist.c.
+
+2010-11-10 15:49 bvassche
+
+ * win32/libsnmp/Makefile.in, win32/libsnmp/libsnmp.dsp,
+ win32/libsnmp_dll/Makefile.in, win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ Follow-up for r19606: cmu_compat removal.
+
+2010-11-10 12:31 bvassche
+
+ * configure, configure.d/config_os_progs:
+
+ CHANGES: BUG: 3102904: All Net-SNMP C source files are now
+ compiled with -fno-st
+ rict-aliasing, at least if the configured compiler supports this
+ flag.
+
+2010-11-09 13:47 bvassche
+
+ * testing/fulltests/default/T030snmpv3usercreation_simple:
+
+ CHANGES: testing: Test T030 does now pass on MinGW.
+
+2010-11-09 13:40 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ simple_eval_tools.sh: Removed a superfluous ISDEFINED invocation.
+
+2010-11-09 12:04 bvassche
+
+ * testing/fulltests/default/T160snmpnetstat_simple:
+
+ Passes now on MinGW too.
+
+2010-11-09 11:31 bvassche
+
+ * configure, configure.d/config_os_functions:
+
+ Follow-up for r19646.
+
+2010-11-09 11:30 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ CHANGES: MinGW: testing: If the agent has been asked to stop,
+ wait until the snmpd process disappeared before proceeding.
+
+2010-11-09 10:02 bvassche
+
+ * snmplib/transports/snmpUDPIPv6Domain.c:
+
+ CHANGES: agent: com2sec6 directive: If configure has not found
+ getaddrinfo(), non-numeric IPv6 addresses do now trigger an error
+ message.
+
+2010-11-08 15:36 bvassche
+
+ * testing/fulltests/default/T071com2sec6_simple:
+
+ CHANGES: testing: Test 71 (com2sec6_simple) does now succeed even
+ if IPv6 DNS resolution is not available.
+
+2010-11-08 15:02 bvassche
+
+ * testing/fulltests/support/clib_build:
+
+ MinGW, testing: clib tests build again without warnings.
+
+2010-11-08 14:52 bvassche
+
+ * configure, configure.d/config_os_functions,
+ configure.d/config_os_progs:
+
+ CHANGES: MinGW: configure: Detection of the functions
+ gai_strerror(), getaddrinfo(), gethostbyname() and gethostname()
+ does now succeed.
+
+2010-11-08 14:48 bvassche
+
+ * testing/fulltests/unit-tests/T007inet_pton_clib.c:
+
+ CHANGES: testing: Added inet_ntop() and inet_pton() unit test.
+
+2010-11-08 14:47 bvassche
+
+ * testing/fulltests/support/clib_build:
+
+ testing: clib_build: Added #include directives (<arpa/inet.h> and
+ <netinet/ip6.h>).
+
+2010-11-08 08:46 bvassche
+
+ * agent/mibgroup/struct.h, agent/mibgroup/util_funcs.c:
+
+ Win32: agent: eliminated casts from/to int for thread handles.
+
+2010-11-08 07:58 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ Removed NETSNMP_STATIC_INLINE from the declaration of
+ _build_cache_name - at least gcc is better than a human at
+ deciding which functions should be inlined and which ones not.
+
+2010-11-08 07:56 bvassche
+
+ * agent/helpers/table_data.c:
+
+ netsnmp_table_data_clone_row(): Added missing free() statement in
+ an error path.
+
+2010-11-07 21:15 dts12
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ CHANGES: snmpd: PATCHES: 2119725: Fix skipNFSInHostResources
+ handling of hrStorageTable
+
+2010-11-07 21:14 magfr
+
+ * snmplib/data_list.c:
+
+ CHANGES: snmplib: Check the return value of strdup in
+ netsnmp_create_data_list and fail if strdup fails.
+
+2010-11-07 19:44 dts12
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ CHANGES: snmpd: PATCHES: 3096725: Don't register v1Trap callback,
+ if SNMPv1 is not supported
+
+2010-11-07 19:38 dts12
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ CHANGES: snmpd: BUGS: 1840230: Don't include the index object as
+ (pseudo-)accessible column.
+
+2010-11-07 19:33 dts12
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ CHANGES: snmpd: PATCHES: 3096725: Include SNMPv1 trap OIDs in
+ nlmLogNotificationID column
+
+2010-11-07 16:35 magfr
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ CHANGES: snmplib: force a ; at the end of the static_assert
+ macro.
+
+2010-11-05 15:41 bvassche
+
+ * configure, configure.d/config_os_functions:
+
+ Made sure that rpmGetPath() can be found by configure.
+
+2010-11-05 14:50 bvassche
+
+ * configure, configure.d/config_os_libs1:
+
+ Removed superfluous -I/usr/include/rpm.
+
+2010-11-05 12:18 bvassche
+
+ * Makefile.in, configure, configure.ac,
+ configure.d/config_os_headers, configure.d/config_os_libs,
+ configure.d/config_os_libs1, configure.d/config_os_libs2:
+
+ CHANGES: agent: Find out whether librpm is available before
+ configuring the agent modules because host/data/access/swinst
+ needs symbol HAVE_LIBRPM. As a result, configure has to be run
+ only once instead of twice to enable the hrSWInstalled table on
+ systems that have librpm.
+
+2010-11-05 12:11 bvassche
+
+ * agent/mibgroup/disman/expression/expErrorTable.c:
+
+ Suppress a compiler warning.
+
+2010-11-05 10:00 bvassche
+
+ * agent/mibgroup/host/data_access/swinst_rpm.c:
+
+ CHANGES: agent: host/data_access/swinst_rpm: Fixed a memory leak
+ in netsnm_swinst_arch_init().
+
+2010-11-05 09:23 bvassche
+
+ * agent/mibgroup/host/data_access/swinst_rpm.c:
+
+ CHANGES: agent: host/data_access/swinst_rpm: Pass correct path to
+ rpmdbOpen() such that opening the database succeeds.
+ CHANGES: agent: host/data_access/swinst_rpm: Log an error message
+ if rpmdbOpen() fails.
+
+2010-11-05 08:50 bvassche
+
+ * agent/mibgroup/Rmon/alarmTable.c, agent/mibgroup/Rmon/event.c,
+ agent/mibgroup/Rmon/history.c, agent/mibgroup/Rmon/row_api.h,
+ agent/mibgroup/Rmon/rows.c, agent/mibgroup/Rmon/statistics.c,
+ agent/mibgroup/disman/expression/expExpressionTable.c,
+ agent/mibgroup/disman/expression/expObjectTable.c,
+ agent/mibgroup/disman/expression/expValueTable.c:
+
+ Rmon / disman compiler warning fixes.
+
+2010-11-05 08:48 bvassche
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ CHANGES: snmplib: Added macro netsnmp_static_assert().
+
+2010-11-05 08:40 bvassche
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Follow-up for r19566.
+
+2010-11-05 08:37 bvassche
+
+ * agent/mibgroup/host/data_access/swinst.h:
+
+ Removed a (harmless ?) circular reference.
+
+2010-11-04 13:09 dts12
+
+ * dist/net-snmp.spec:
+
+ CHANGES: Linux: PATCHES: 3083027: Fix RPM spec file to support
+ CentOS
+
+2010-11-03 13:22 rstory
+
+ * testing/fulltests/tls/T200TlsIpv6_simple:
+
+ skip tlsipv6 test if not tlstcp/tcpipv6 domains
+
+2010-11-01 23:03 magfr
+
+ * acconfig.h, include/net-snmp/library/cmu_compat.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/net-snmp-includes.h, snmplib/Makefile.in,
+ snmplib/cmu_compat.c, snmplib/mib.c,
+ win32/net-snmp/net-snmp-config.h:
+
+ NEWS: snmplib: Remove the support for CMU compatibility since
+ there is no way to enable it and nobody have missed it.
+
+2010-11-01 16:50 dts12
+
+ * man/variables.5.def:
+
+ Rework description of OID name handling to be
+ not quite so incredibly out of date.
+
+2010-11-01 16:47 dts12
+
+ * man/snmpget.1.def:
+
+ Document -Cf in the two man pages separately.
+
+2010-10-29 22:31 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ null out bio pointers after being freed; bail on connection
+ with no ssl pointer
+
+2010-10-29 14:35 bvassche
+
+ * agent/mibgroup/host/hrSWInstalledTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c:
+
+ Reverted incorrect changes from r19575.
+
+2010-10-29 14:21 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ Fixed a bug that was introduced in r19515.
+
+2010-10-29 14:00 bvassche
+
+ *
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c,
+ agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c:
+
+ Reverted the incorrect changes from r19593.
+
+2010-10-29 13:38 bvassche
+
+ * snmplib/cert_util.c:
+
+ Reduced number of leak-at-exit complaints triggered by
+ snmplib/cert_util.c.
+
+2010-10-29 13:37 bvassche
+
+ *
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c,
+ agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.h,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c:
+
+ More leak-at-exit fixes.
+
+2010-10-29 13:35 bvassche
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/agent/extend.h:
+
+ More leak-at-exit fixes.
+
+2010-10-29 12:18 bvassche
+
+ * snmplib/cert_util.c, snmplib/container_binary_array.c:
+
+ Spelling fix in log texts: containter -> container.
+
+2010-10-29 09:58 bvassche
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ Ran fillup_entry_info() through indent.
+
+2010-10-29 09:56 bvassche
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ Netlink IPv6 prefix processing: Added more debug statements.
+
+2010-10-29 09:54 bvassche
+
+ * agent/helpers/table.c:
+
+ Made argument checking of netsnmp_handler_owns_table_info() more
+ strict.
+
+2010-10-29 09:52 bvassche
+
+ * agent/mibgroup/agent/extend.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.h,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.h,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteEventTable.h,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteObjectsTable.h,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.h,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.h,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.h,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/disman/schedule/schedTable.h,
+ agent/mibgroup/host/hrSWRunPerfTable.c,
+ agent/mibgroup/host/hrSWRunPerfTable.h,
+ agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpAssocTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h:
+
+ More MIB-specific leak-at-exit fixes.
+
+2010-10-29 07:56 bvassche
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h,
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c:
+
+ More compiler warning fixes.
+
+2010-10-28 18:31 nba
+
+ * snmplib/snmp_openssl.c:
+
+ Fix const qualifier warning
+
+2010-10-28 17:53 nba
+
+ * agent/mibgroup/hardware/cpu/cpu_kstat.c,
+ agent/mibgroup/kernel_sunos5.c:
+
+ Clean out Solaris warnings
+
+2010-10-28 17:52 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ LVM is Linux only
+
+2010-10-28 17:51 nba
+
+ * agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ Avoid char subscripts (signed chars\!)
+
+2010-10-28 17:43 nba
+
+ * agent/mibgroup/host/data_access/swinst_pkginfo.c,
+ agent/mibgroup/host/data_access/swrun_procfs_psinfo.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c,
+ agent/mibgroup/mibII/at.c, snmplib/snmptsm.c:
+
+ casts and format specifiers in debug output
+
+2010-10-28 17:41 nba
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ Cast to sockaddr to avoid warning
+
+2010-10-28 17:40 nba
+
+ * agent/mibgroup/hardware/sensors/picld_sensors.c,
+ agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ Untangle picl from kstat access so it compiles on x86 Solrais
+ 10/OpenSolaris
+
+2010-10-28 15:15 bvassche
+
+ * agent/helpers/instance.c, agent/mibgroup/agent/extend.c,
+ agent/mibgroup/host/hrSWInstalledTable.c,
+ agent/mibgroup/host/hrSWInstalledTable.h,
+ agent/mibgroup/host/hrSWRunTable.c,
+ agent/mibgroup/host/hrSWRunTable.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ More leak-at-exit fixes.
+
+2010-10-28 15:13 bvassche
+
+ * agent/helpers/watcher.c, include/net-snmp/agent/watcher.h:
+
+ CHANGES: agent: Added netsnmp_register_watched_instance2(),
+ netsnmp_register_watched_scalar2(), netsnmp_clone_watcher_info()
+ and netsnmp_owns_watcher_info(). See also the Doxygen comments
+ for more info.
+
+2010-10-28 14:02 dts12
+
+ * local/mib2c.check_values.conf:
+
+ Fix logic of testing for out-of-range enum values.
+ Reported by Boris Zweimueller.
+
+2010-10-28 12:23 bvassche
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ Get rid of OpenSSL-related compilation warnings. Should work for
+ both OpenSSL versions 0.9.x and 1.0.x.
+
+2010-10-28 11:46 bvassche
+
+ * agent/mibgroup/examples/scalar_int.c:
+
+ Fixed a compiler warning (mismatch between format specification
+ and argument) that was introduced in r6562.
+
+2010-10-28 11:43 bvassche
+
+ * agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c:
+
+ Get rid of recently introduced memdup() compiler warnings.
+
+2010-10-28 11:41 bvassche
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Fixed a compiler warning that was introduced in r19550.
+
+2010-10-28 11:32 bvassche
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ Reverted r19565 because it caused gcc to report more warnings
+ instead of less.
+
+2010-10-28 11:18 bvassche
+
+ *
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c:
+
+ Fixed a compiler warning that was introduced in r19566.
+
+2010-10-28 10:40 bvassche
+
+ * agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ include/net-snmp/library/callback.h, snmplib/callback.c:
+
+ Partially reverted r19515: removed the newly introduced functions
+ and data members again, but without reintroducing the
+ leak-at-exit.
+
+2010-10-28 10:32 bvassche
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ Changed the type of the first two arguments such that it is no
+ longer necessary to cast these two arguments (has been reverted
+ via r19568).
+
+2010-10-28 09:47 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ Fixed yet another crash in netsnmp_cache_remove().
+
+2010-10-28 08:44 bvassche
+
+ * agent/snmpd.c:
+
+ Made it easier to enable the memory leak checker built-in in
+ MSVC's C runtime library.
+
+2010-10-27 20:37 nba
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c:
+
+ Sizeof has type size_t
+
+2010-10-27 20:35 nba
+
+ * snmplib/snmp_transport.c:
+
+ Remove superfluous cast
+
+2010-10-27 18:40 nba
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c:
+
+ Sprinkle some unsignedness so vars and params agree on type
+
+2010-10-27 18:38 nba
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ Initialize vars that gcc thinks are uninitialized
+
+2010-10-27 18:36 nba
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ A more meaningful test for MLD_LISTENER_QUERY
+
+2010-10-27 18:35 nba
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h,
+
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h:
+
+ prototypes and includes were missing
+
+2010-10-27 18:33 nba
+
+ * apps/encode_keychange.c, apps/snmptest.c:
+
+ Check fgets return
+
+2010-10-25 20:59 dts12
+
+ * Makefile.in:
+
+ CHANGES: build: BUG: 3088360: Ensure python modules are built
+ against the correct libraries
+
+2010-10-25 20:34 dts12
+
+ * agent/helpers/instance.c, agent/mibgroup/examples/scalar_int.c:
+
+ CHANGES: snmpd: BUG: 3058101: Writeable 'long' instances work on
+ 64-bit systems, but not writable 'int's
+
+2010-10-25 16:05 dts12
+
+ * snmplib/read_config.c:
+
+ Don't attempt to process unrecognised "ignore*" directives.
+ Pass these through to the appropriate registered config handlers
+ (if any)
+
+2010-10-25 15:56 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Fix a stupid typo
+
+2010-10-25 15:38 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ CHANGES: snmpd: BUG: 3062538: Fix com2sec* handling of
+ non-default contexts
+
+2010-10-25 12:54 bvassche
+
+ * testing/fulltests/default/T065agentextend_simple,
+ testing/fulltests/default/T200snmpv2cwalkall_simple:
+
+ CHANGES: Win32: testing: Avoid that T200 fails on known Microsoft
+ SNMP extension DLL bugs.
+
+2010-10-25 08:06 bvassche
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h,
+ configure, configure.d/config_os_libs:
+
+ NEWS: Linux: snmpd is again single-threaded.
+ CHANGES: agent: PATCH: 2959811: from Jan Safranek: Reimplement
+ Linux Netlink IPv6 prefix listener.
+
+2010-10-25 07:15 bvassche
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ Avoid that the compiler complains about casting away the 'const'
+ attribute for the first argument of sslctx_client_setup() and
+ sslctx_server_setup().
+
+2010-10-25 06:28 nba
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.h:
+
+ include needed prototypes
+
+2010-10-25 06:16 nba
+
+ * apps/snmptls.c, include/net-snmp/library/cert_util.h,
+ snmplib/cert_util.c:
+
+ Adjust types to better match usage
+
+2010-10-25 06:15 nba
+
+ * man/snmpcmd.1.def:
+
+ Reveal hidden -e and -u options
+
+2010-10-25 06:14 nba
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ include needed prototypes
+
+2010-10-25 06:01 nba
+
+ *
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+ agent/mibgroup/sctp-mib/sctpTables_freebsd.c, apps/snmptrapd.c,
+ snmplib/transports/snmpUnixDomain.c:
+
+ include needed prototypes
+
+2010-10-25 06:00 nba
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h,
+ apps/snmptrapd_sql.c:
+
+ const-juggling - we dont like warnings
+
+2010-10-23 11:56 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ Reenabled cache removal and freeing / moved cache refcount
+ incrementing to netsnmp_cache_owns_cache() / converted tabs to
+ spaces.
+
+2010-10-23 11:04 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ Fixed another crash in netsnmp_cache_remove().
+
+2010-10-23 11:00 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ CHANGES: agent: Removing the last cache via
+ netsnmp_cache_remove() does no longer trigger a crash.
+
+2010-10-23 10:57 bvassche
+
+ *
+ testing/fulltests/unit-tests/T006snmp_handler_registration_cagentlib.c:
+
+ T006snmp_handler_registration_cagentlib: Introduced
+ netsnmp_cache_create().
+
+2010-10-22 15:24 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ Disabled cache deallocation because it makes two unit tests fail
+ - to be analyzed further.
+
+2010-10-22 15:03 bvassche
+
+ *
+ testing/fulltests/unit-tests/T006snmp_handler_registration_cagentlib.c:
+
+ Builds again.
+
+2010-10-22 14:49 bvassche
+
+ * agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocTable.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c:
+
+ CHANGES: agent: MIB-specific leak-at-exit fixes.
+
+2010-10-22 14:42 bvassche
+
+ * agent/mibgroup/examples/data_set.c,
+ agent/mibgroup/examples/data_set.h:
+
+ CHANGES: agent: example MIB: Added shutdown function that frees
+ all memory owned by this MIB implementation.
+
+2010-10-22 14:40 bvassche
+
+ * agent/helpers/table_container.c:
+
+ CHANGES: agent: Automatically free the private data structure
+ allocated by netsnmp_container_table_handler_get().
+
+2010-10-22 14:38 bvassche
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ CHANGES: agent: Count the number of users of a netsnmp_cache data
+ structure instead of duplicating it.
+
+2010-10-22 14:36 bvassche
+
+ * agent/helpers/baby_steps.c, include/net-snmp/agent/baby_steps.h:
+
+ CHANGES: agent: Added reference count in the
+ netsnmp_baby_steps_modes data structure and made sure that this
+ data structure is automatically freed when the handler that owns
+ it is unregistered.
+
+2010-10-22 14:34 bvassche
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ CHANGES: agent: Added netsnmp_unregister_auto_data_table().
+
+2010-10-22 08:51 bvassche
+
+ * agent/agent_registry.c:
+
+ Follow-up for r19511: made sure that clean_subtree() deallocates
+ all context cache nodes.
+
+2010-10-22 08:49 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ CHANGES: agent: netsnmp_cache_free(): A more detailed message is
+ now logged when attempting to free a cache that is still in the
+ cache list.
+
+2010-10-22 06:39 bvassche
+
+ * ltmain.sh:
+
+ Reverted ltmain.sh changes from r19522.
+
+2010-10-22 06:34 bvassche
+
+ * configure, include/net-snmp/net-snmp-config.h.in, ltmain.sh:
+
+ Regenerated autoconf/automake/libtool-generated files by running
+ autoreconf -f.
+
+2010-10-21 07:51 bvassche
+
+ * ltmain.sh:
+
+ Reapplied r18726+r18766: make libtool support -fstack-protector*.
+ See also
+ http://blog.gmane.org/gmane.comp.gnu.libtool.bugs/month=20100601
+ for the confirmation that this is a libtool bug.
+
+2010-10-20 20:16 bvassche
+
+ * snmplib/tools.c:
+
+ Avoid that netsnmp_check_definedness() triggers a build failure
+ when compiled against old Valgrind headers. Note: the introduced
+ check is stricter than necessary - VALGRIND_PRINTF_BACKTRACE()
+ was introduced in Valgrind 3.5.0 or before (not sure which
+ version).
+
+2010-10-20 17:13 hardaker
+
+ * snmplib/tools.c:
+
+ added a comment in code note that this requires a fairly recent
+ valgrind
+
+2010-10-20 17:00 hardaker
+
+ * configure:
+
+ reran autoconf after updating libtool
+
+2010-10-20 16:59 hardaker
+
+ * config.guess, config.sub, install-sh, ltmain.sh, m4/libtool.m4,
+ m4/ltoptions.m4, m4/ltversion.m4, m4/lt~obsolete.m4:
+
+ update to libtool 2.4
+
+2010-10-20 16:59 hardaker
+
+ * configure, dist/autoconf-version:
+
+ updated to autoconf 2.68
+
+2010-10-20 14:26 bvassche
+
+ * agent/helpers/cache_handler.c, agent/helpers/old_api.c,
+ agent/helpers/stash_cache.c, agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/agent/snmp_vars.h,
+ include/net-snmp/library/callback.h, snmplib/callback.c,
+ win32/mib_module_shutdown.h:
+
+ CHANGES: agent: Added the functions netsnmp_duplicate_variable()
+ and netsnmp_cache_handler_owns_cache().
+ CHANGES: agent: Memory allocated by netsnmp_register_old_api()
+ for storing SNMP variables is now freed when the associated
+ handler is unregistered.
+ CHANGES: agent: Callback function data deallocation does no
+ longer free the memory allocated for the AgentX session - the
+ memory that was allocated for AgentX sessions is now deallocated
+ just as that for any other session. This fixes a leak-at-exit.
+ CHANGES: agent: Notify filter table: Callback function data
+ deallocation does no longer free the data in
+ * *snmpNotifyFilterTable_if_ctx.container - this is now done by
+ shutdown_snmpNotifyFilterTable(). CHANGES: Win32:
+ shutdown_snmpNotifyFilterTable() and
+
+ shutdown_winExtDLL() are now invoked when the Net-SNMP service is
+ stopped.
+
+2010-10-20 13:47 bvassche
+
+ * testing/fulltests/unit-tests/T005table_dataset_cagentlib.c:
+
+ Unit-testing, T005table_dataset_cagentlib: added init_agent() and
+ shutdown_agent() calls.
+
+2010-10-20 13:12 nba
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ Fix non-ANSI function heading
+
+2010-10-20 12:51 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c:
+
+ fix ipCidrRouteTable (mask) for little endian systems
+
+2010-10-20 10:34 bvassche
+
+ * agent/agent_handler.c, agent/agent_registry.c,
+ agent/snmp_agent.c, agent/snmpd.c,
+ include/net-snmp/session_api.h, snmplib/snmp_api.c:
+
+ CHANGES: snmplib: Added snmp_sess_session_lookup().
+ CHANGES: agent: Call shutdown_master_agent() and shutdown_agent()
+ during shutdown.
+ CHANGES: agent: The function clean_subtree() does no longer
+ trigger double frees and invalid memory reads. Note: this
+ function was already wrong at the time it was introduced (patch
+ #724925 / r8531, July 2003).
+ CHANGES: agent: Removed a comment in netsnmp_handler_free() that
+ is now obsolete because of the clean_subtree() changes.
+ CHANGES: agent: Modified netsnmp_deregister_agent_nsap() such
+ that it never examines sessions that already have been closed. It
+ is for this change that it was necessary to introduce the new
+ function snmp_sess_session_lookup().
+
+2010-10-19 23:49 magfr
+
+ * testing/fulltests/default/T016snmpv2cgetfail_simple,
+ testing/fulltests/default/T051snmpv2ctrap_simple,
+ testing/fulltests/default/T052snmpv2cinform_simple,
+ testing/fulltests/default/T141snmpv2cvacmgetfail_simple:
+
+ CHANGES: testing: Add missing preconditions
+
+2010-10-19 22:11 hardaker
+
+ * dist/patme:
+
+ don't default to applying to 5.2
+
+2010-10-19 22:10 hardaker
+
+ * dist/patme:
+
+ added the 5.6 branch
+
+2010-10-19 21:13 nba
+
+ * snmplib/parse.c:
+
+ BUG 3079072 from Dave Beal: fix buffer overflow from bad use of
+ strncat
+
+2010-10-19 20:55 nba
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ PATCH: 3085295 from Bill Fenner: recognize LISTEN state again
+
+2010-10-19 20:09 nba
+
+ * agent/mibgroup/host/data_access/swinst_rpm.c:
+
+ Fix compiler warnings
+
+2010-10-19 20:08 nba
+
+ * agent/mibgroup/host/data_access/swinst_rpm.c:
+
+ Fix returning garbage in hrSWInstalledName (see rev 19484 for
+ further notes)
+
+2010-10-19 19:58 nba
+
+ * agent/mibgroup/host/hrh_filesys.c:
+
+ Protect against unsafe (%) device names
+
+2010-10-19 19:57 nba
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Solaris does not use getstat, so dont declare it
+
+2010-10-19 19:56 nba
+
+ * snmplib/transports/snmpTCPIPv6Domain.c:
+
+ udp/tcp confusion in debug handle
+
+2010-10-19 19:54 nba
+
+ * apps/snmptable.c:
+
+ Abort after bad -C? option
+
+2010-10-19 19:53 nba
+
+ * apps/snmptrapd_handlers.c:
+
+ Delete redundant extern declarations
+
+2010-10-19 18:08 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: Win32: building: Avoid that MSVC 2010 prints a warning
+ message about redefining EADDRINUSE.
+
+2010-10-19 18:05 bvassche
+
+ * snmplib/tools.c:
+
+ CHANGES: Win32: Avoid that MSVC reports a warning message about
+ redefinition of the malloc() macro during building the Net-SNMP
+ source code.
+
+2010-10-19 07:04 magfr
+
+ * agent/mibgroup/default_modules.h:
+
+ CHANGES: agent: Factor out common config_add_mib statments
+
+2010-10-18 14:22 bvassche
+
+ * agent/helpers/table_dataset.c:
+
+ Mark the proper handler that owns the table registration
+ information.
+
+2010-10-18 10:54 bvassche
+
+ * agent/helpers/table.c, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_iterator.h:
+
+ CHANGES: agent: Added functions netsnmp_handler_owns_tabreq(),
+ netsnmp_registration_owns_tabreq(), netsnmp_iterator_clone().
+ Exported netsnmp_table_registration_info_clone().
+ CHANGES: agent: Modified netsnmp_iterator_delete_table() such
+ that it frees the table registration information stored in a
+ table iterator too.
+ CHANGES: agent: Modified netsnmp_get_table_iterator_handler()
+ such that the table iterator passed to this function is freed
+ when the associated handler is freed.
+
+ Restored the behavior of netsnmp_get_table_handler() to that of
+ r19449, that is, not setting up the data_free pointer because not
+ all callers of netsnmp_get_table_handler() expect that table
+ registration information is freed when the associated handler is
+ freed.
+
+2010-10-18 10:34 bvassche
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ Fixed a compiler warning about casting away constness.
+
+2010-10-18 08:52 bvassche
+
+ * agent/snmpd.c:
+
+ CHANGES: Win32: When snmpd.exe is started in a command prompt
+ window, the snmpd process now stops upon the first key press.
+ This makes it easier to debug snmpd.exe for memory leaks.
+
+2010-10-18 06:25 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32: builds again without warnings with MSVC 6.
+
+2010-10-18 06:15 magfr
+
+ * include/net-snmp/library/system.h:
+
+ CHANGES: snmpd: Use the same autoconf symbol to decide both if
+ strcasecmp should be declared and if it should be defined.
+
+2010-10-17 18:29 bvassche
+
+ * agent/snmp_perl.c:
+
+ CHANGES: snmpd: Fixed a double free at exit that was triggered by
+ cleaning up the data structures used for embedded Perl support.
+ CHANGES: snmptrapd: Fixed a double free at exit that was
+ triggered by cleaning up the data structures used for embedded
+ Perl support.
+
+ Valgrind reported that double free as follows:
+
+ Invalid read of size 4
+ at 0x59D0501: perl_destruct (in
+ /usr/lib/perl5/5.12.1/x86_64-linux-thread-multi/CORE/libperl.so)
+ by 0x544DF8E: shutdown_perl (snmp_perl.c:166)
+ by 0x403966: term_handler (snmptrapd.c:318)
+ by 0x6D43A5F: ??? (in /lib64/libc-2.11.2.so)
+ Address 0x7660f88 is 56 bytes inside a block of size 2,912 free'd
+ at 0x4C26496: free (vg_replace_malloc.c:366)
+ by 0x544DF9A: shutdown_perl (snmp_perl.c:167)
+ by 0x403966: term_handler (snmptrapd.c:318)
+ by 0x6D43A5F: ??? (in /lib64/libc-2.11.2.so)
+ by 0x6DDADF2: __select_nocancel (in /lib64/libc-2.11.2.so)
+ by 0x404E20: main (snmptrapd.c:1258)
+
+2010-10-17 17:33 bvassche
+
+ * snmplib/transports/snmpCallbackDomain.c:
+
+ CHANGES: snmplib: Avoid that Valgrind complains about
+ uninitialized data for the buffers returned by
+ netsnmp_callback_recv() and netsnmp_callback_hook_build().
+
+2010-10-17 16:57 bvassche
+
+ * agent/helpers/table.c:
+
+ CHANGES: agent: table_helper_handler(), 64-bit architectures:
+ avoid passing a pointer to a 32-bit value to a function that
+ expects a pointer to a 64-bit value (parse_one_oid_index()). Not
+ sure what the implications of this bug were. It might have caused
+ very strange table behavior on 64-bit big endian systems.
+ Found this via Valgrind.
+
+2010-10-17 16:51 bvassche
+
+ * agent/mibgroup/host/data_access/swrun_procfs_psinfo.c,
+ agent/mibgroup/host/data_access/swrun_procfs_status.c:
+
+ CHANGES: agent: Avoid that hrSWRunPath contains trailing garbage
+ characters on Linux systems.
+ Found this by analyzing a Valgrind complaint. For anyone who is
+ wondering why this patch makes sense, a quote from the glibc
+ snprintf() documentation
+ (http://www.gnu.org/software/libc/manual/html_node/Formatted-Output-Functions.html):
+ <quote>
+ The return value is the number of characters which would be
+ generated for the given input, excluding the trailing null. If
+ this value is greater or equal to size, not all characters from
+ the result have been stored in s.
+ </quote>
+ Please note that this differs from the standard behavior. A quote
+ from http://opengroup.org/onlinepubs/007908799/xsh/snprintf.html:
+ <quote>
+ RETURN VALUE
+ Upon successful completion, these functions return the number of
+ bytes transmitted excluding the terminating null in the case of
+ sprintf() or snprintf() or a negative value if an output error
+ was encountered.
+ </quote>
+
+2010-10-17 14:31 bvassche
+
+ * testing/RUNTESTS:
+
+ CHANGES: testing: It is again possible to run an individual test
+ via the script testing/RUNTESTS.
+
+2010-10-17 14:28 bvassche
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ CHANGES: snmplib: Added the function netsnmp_check_definedness(),
+ which helps to find the cause of undefined value errors as
+ reported by Valgrind.
+
+2010-10-17 14:24 bvassche
+
+ * agent/mibgroup/agentx/protocol.h:
+
+ Removed an obsolete declaration: the function agentx_build() has
+ been removed a long time ago.
+
+2010-10-17 14:05 bvassche
+
+ * configure, configure.d/config_os_headers,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Added configure test for the Valgrind header files.
+
+2010-10-17 12:01 bvassche
+
+ * snmplib/snmp_openssl.c:
+
+ Follow-up for r19477: made the inserted typecasts portable.
+
+2010-10-17 11:04 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Follow-up for r19476: fixed a typo.
+
+2010-10-17 09:36 bvassche
+
+ * agent/helpers/scalar_group.c, agent/helpers/watcher.c,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmp_openssl.c, snmplib/transports/snmpTLSBaseDomain.c:
+
+ Fixed a few compiler warnings by inserting appropriate casts.
+
+2010-10-17 09:25 bvassche
+
+ * include/net-snmp/library/tools.h,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ NETSNMP_REMOVE_CONST()-related cleanup.
+
+2010-10-17 01:41 magfr
+
+ * agent/mibgroup/default_modules.h, agent/mibgroup/util_funcs.h,
+ agent/snmpd.c:
+
+ NEWS: snmpd: Remove util_funcs/Exit from the requirement sets of
+ util_funcs and default_modules.
+ NEWS: snmpd: Never use Exit to terminate the agent.
+
+2010-10-16 22:32 magfr
+
+ * agent/mibgroup/default_modules.h,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/versioninfo.h,
+ agent/mibgroup/util_funcs.h, agent/snmpd.c:
+
+ CHANGES: snmpd: Make the setting of the argvrestart* variables
+ optional on USING_UTIL_FUNCS_RESTART_MODULE.
+ NEWS: snmpd: Remove util_funcs/restart from the requirement sets
+ of util_funcs and default_modules.
+ CHANGES: snmpd: Add util_funcs/restart to the requirement set of
+ ucd-snmp/versioninfo.
+
+2010-10-16 22:05 magfr
+
+ * include/net-snmp/agent/agent_handler.h:
+
+ CHANGES: snmpd: Extend the documentation for data_clone and
+ data_free
+
+2010-10-16 22:03 magfr
+
+ * agent/helpers/watcher.c:
+
+ CHANGES: snmpd: Make it possible to copy watched data items
+ without memory leaks.
+
+2010-10-16 22:01 magfr
+
+ * agent/helpers/watcher.c:
+
+ CHANGES: snmpd: Remove unused variable cmp
+
+2010-10-16 19:44 magfr
+
+ * agent/helpers/scalar_group.c:
+
+ CHANGES: snmpd: Do not leak the limits of scalar_group objects on
+ shutdown.
+
+2010-10-16 08:37 bvassche
+
+ * agent/agent_handler.c, configure,
+ configure.d/config_modules_agent:
+
+ Spelling fix: dulpicate -> duplicate.
+
+2010-10-16 08:34 bvassche
+
+ *
+ testing/fulltests/unit-tests/T006snmp_handler_registration_cagentlib.c:
+
+ Added more test code.
+
+2010-10-16 08:33 bvassche
+
+ * agent/agent_handler.c, agent/helpers/cache_handler.c,
+ agent/helpers/table.c:
+
+ Follow-up for r19465: handle out-of-memory properly / removed a
+ duplicate function.
+
+2010-10-15 19:17 bvassche
+
+ * testing/fulltests/support/cagentlib_build,
+ testing/fulltests/support/cagentlib_run,
+ testing/fulltests/support/clib_build,
+ testing/fulltests/unit-tests/T005table_dataset_cagentlib.c,
+ testing/fulltests/unit-tests/T005table_dataset_clib.c,
+ testing/fulltests/unit-tests/T006snmp_handler_registration_cagentlib.c,
+
+ testing/fulltests/unit-tests/T006snmp_handler_registration_clib.c:
+
+ CHANGES: testing: Introduced new test type next to capp and clib:
+ cagentlib.
+
+2010-10-15 18:56 bvassche
+
+ * agent/agent_handler.c, agent/helpers/cache_handler.c,
+ agent/helpers/stash_cache.c, agent/helpers/table.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/cache_handler.h,
+ testing/fulltests/unit-tests/T006snmp_handler_registration_clib.c:
+
+ NEWS: snmplib: Added netsnmp_mib_handler.data_clone, a function
+ pointer that defines how to clone netsnmp_mib_handler.myvoid.
+ Must be defined if and only if data_free is set. The function
+ netsnmp_handler_dup() does now clone MIB handler private data if
+ data_clone() is set. Previously after duplicating a MIB handler
+ and unregistering one of the two MIB handlers, the private data
+ pointer (myvoid) of the other became a dangling pointer. Note:
+ addition of netsnmp_mib_handler.data_clone is an ABI change.
+ CHANGES: testing: added more test cases to the handler
+ registration test.
+
+2010-10-15 18:32 bvassche
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ Fixed a compiler warning.
+
+2010-10-15 12:30 bvassche
+
+ * agent/agent_handler.c,
+ testing/fulltests/unit-tests/T006snmp_handler_registration_clib.c:
+
+ Reverted r19460 because it makes some regression tests fail
+ (T120proxyget_simple, T121proxyset_simple,
+ T122proxysetfail_simple, T200snmpv2cwalkall_simple). Disabled the
+ handler duplication test in T006 because it triggers a crash
+ without r19460.
+
+2010-10-15 11:37 bvassche
+
+ * agent/agent_handler.c:
+
+ CHANGES: snmplib: netsnmp_handler_dup(): freeing the duplicated
+ handler no longer causes a crash (double free) when
+ handler->myvoid of the original handler was non-NULL.
+
+2010-10-15 11:32 bvassche
+
+ * testing/fulltests/unit-tests/T006snmp_handler_registration_clib.c:
+
+ Added a unit test for handler registration and deregistration.
+
+2010-10-15 10:56 bvassche
+
+ * include/net-snmp/library/tools.h,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: Win32: building: Builds now correctly with a 64-bit
+ compiler.
+
+2010-10-15 09:45 bvassche
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: snmp_shutdown(): added call to
+ netsnmp_certs_shutdown().
+
+2010-10-15 06:45 bvassche
+
+ * agent/helpers/table_dataset.c:
+
+ Follow-up for r19450: let netsnmp_delete_table_data_set() free
+ all table_dataset-related memory.
+
+2010-10-14 23:15 magfr
+
+ * configure, configure.d/config_modules_agent,
+ configure.d/config_modules_transports,
+ configure.d/config_os_functions,
+ configure.d/config_os_struct_members:
+
+ CHANGES: building: Make it possible to regenerate using autoconf
+ 2.68.
+
+2010-10-14 23:01 magfr
+
+ * snmplib/snmp_logging.c, snmplib/snmp_transport.c,
+ snmplib/transports/snmpIPXDomain.c:
+
+ CHANGES: snmplib: Be const correct over calls to str* functions.
+
+2010-10-14 15:19 bvassche
+
+ * agent/helpers/table.c, agent/helpers/table_data.c,
+ agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ testing/fulltests/support/clib_build,
+ testing/fulltests/unit-tests/T005table_dataset_clib.c:
+
+ CHANGES: snmplib: Added function netsnmp_delete_table_data_set().
+ CHANGES: snmplib: Added declaration for the function
+ netsnmp_table_data_delete_table() in a public agent header file.
+ CHANGES: snmplib: Fixed memory leak in
+ netsnmp_table_data_delete_table().
+ CHANGES: snmplib: Fixed memory leak triggered by unregistering a
+ table handler.
+ CHANGES: testing: Unit tests can now invoke functions from
+ libagent.
+ CHANGES: testing: Added unit test for table_dataset.
+
+2010-10-14 14:05 bvassche
+
+ * testing/fulltests/unit-tests/T001defaultstore_clib.c:
+
+ Unit test T001defaultstore_clib.c: Fixed leaks-at-exit.
+
+2010-10-14 08:43 bvassche
+
+ * testing/fulltests/support/capp_run,
+ testing/fulltests/support/clib_run:
+
+ CHANGES: testing: It is now possible to analyze the unit tests
+ with Valgrind by setting the environment variables
+ SNMP_SAVE_TMPDIR and DYNAMIC_ANALYZER. An example: (export
+ SNMP_SAVE_TMPDIR=yes DYNAMIC_ANALYZER="valgrind
+ --trace-children=yes --leak-check=full"; cd testing &&
+ ./RUNFULLTESTS -g unit-tests)
+
+2010-10-14 08:40 bvassche
+
+ * testing/fulltests/unit-tests/T004snmp_enum_clib.c:
+
+ Unit test T004snmp_enum_clib.c: added test header / added a test
+ case.
+
+2010-10-14 08:39 bvassche
+
+ * testing/fulltests/unit-tests/T002containers_clib.c:
+
+ Fixed leaks-at-exit in unit test T002containers_clib.c.
+
+2010-10-14 08:38 bvassche
+
+ * testing/fulltests/unit-tests/T001defaultstore_clib.c:
+
+ Fixed a leak-at-exit in unit test T001defaultstore_clib.c.
+
+2010-10-14 08:36 bvassche
+
+ * snmplib/snmp_enum.c:
+
+ CHANGES: snmplib: Fixed memory leak triggered by calling
+ se_add_pair_to_list() with a value that already existed in the
+ list.
+
+2010-10-14 07:16 bvassche
+
+ * testing:
+
+ Updated Subversion ignore list.
+
+2010-10-14 07:12 bvassche
+
+ * testing/fulltests/default/T000configure,
+ testing/fulltests/default/T000configure_simple:
+
+ Made sure that the variable $SNMP_BASEDIR is available in the
+ T000configure test.
+
+2010-10-14 06:19 magfr
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ Regenerated
+
+2010-10-14 05:36 nba
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ Quell warnings
+
+2010-10-14 03:50 rstory
+
+ * configure.d/config_os_libs,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/darwin.h,
+ include/net-snmp/system/darwin10.h,
+ include/net-snmp/system/darwin7.h,
+ include/net-snmp/system/darwin8.h,
+ include/net-snmp/system/darwin9.h, snmplib/snmp_openssl.c:
+
+ test for openssl sha 224/256/385/512 support instead of
+ hardcoding
+
+2010-10-14 03:50 rstory
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ add OUTPUTENVVARS to save important environment variables; when
+ SNMP_VERBOSE
+ is set, save env vars and command to individual invoked file for
+ each test;
+ save env vars and command for each STARTPROG
+
+2010-10-14 03:50 rstory
+
+ * testing/fulltests/support/simple_TESTCONF.sh:
+
+ CHANGES: testing: auto-create user specified SNMP_TMPDIR and
+ SNMP_TMP_PERSISTENTDIR too; default SNMP_TMP_PERSISTENDIR based
+ on SNMP_TMPDIR
+ for user specified SNMP_TMPDIR
+
+2010-10-14 03:49 rstory
+
+ * acconfig.h, configure.d/config_os_misc4,
+ include/net-snmp/system/darwin10.h,
+ include/net-snmp/system/darwin8.h,
+ include/net-snmp/system/darwin9.h:
+
+ CHANGES: building: check for /dev/kmem instead of assuming it
+ exists and hardcoding when it is not there
+
+2010-10-14 03:28 rstory
+
+ * snmplib/snmptsm.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ set transportSecurityLevel based on ssl session algorithms
+
+2010-10-14 03:26 rstory
+
+ * include/net-snmp/library/snmp_openssl.h, snmplib/snmp_openssl.c:
+
+ add netsnmp_openssl_null_checks
+
+2010-10-14 03:23 rstory
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ cleanup ssl/bio on failed connection
+
+2010-10-14 03:21 rstory
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ quiet compiler warning
+
+2010-10-14 03:18 rstory
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ remove unused var
+
+2010-10-14 03:16 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix typo
+
+2010-10-14 03:12 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ check for null before deref
+
+2010-10-13 20:12 magfr
+
+ * testing/fulltests/support/clib_build:
+
+ CHANGES: testing: Generate a normal #line directive as per C99
+ instead of the compiler-specific #<n>-directive.
+
+2010-10-13 16:53 hardaker
+
+ * dist/autoconf-version, testing/fulltests/default/T000configure:
+
+ added a autoconf version checking test to catch developers and
+ scripts that fail to use the correct autoconf version
+
+2010-10-13 16:30 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ Patch from Bill Fenner to fix only including the session_api.h
+ file
+
+2010-10-13 16:29 bvassche
+
+ * testing/fulltests/support/clib_build:
+
+ Follow-up for r19421: Made sure that the compiler again reports
+ the proper filename and line number information while compiling
+ unit tests.
+
+2010-10-13 11:53 bvassche
+
+ * win32/Makefile-apps.in, win32/libsnmp_dll/Makefile.in,
+ win32/snmpd/Makefile.in, win32/snmpnetstat/Makefile.in,
+ win32/snmptrapd/Makefile.in:
+
+ CHANGES: Win32: building: batch build with OpenSSL enabled and
+ with recent OpenSSL development files works again.
+
+2010-10-13 09:58 bvassche
+
+ * net-snmp-config.in, testing/RUNFULLTESTS,
+ testing/fulltests/support/capp_build,
+ testing/fulltests/support/capp_run,
+ testing/fulltests/support/clib_build,
+ testing/fulltests/support/clib_run:
+
+ CHANGES: Cygwin: Running the unit tests does now work (cd testing
+ && ./RUNFULLTESTS -g unit-tests).
+ CHANGES: MinGW: Running the unit tests does now work (cd testing
+ && ./RUNFULLTESTS -g unit-tests).
+
+2010-10-13 08:00 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ Fixed a spelling error in a source code comment.
+
+2010-10-13 07:43 bvassche
+
+ * net-snmp-config.in:
+
+ Spelling fixes.
+
+2010-10-12 14:02 bvassche
+
+ * include/net-snmp/library/snmp_enum.h:
+
+ Added declaration for se_clear_slist().
+
+2010-10-12 11:12 bvassche
+
+ * testing/fulltests/unit-tests/T004snmp_enum_clib.c:
+
+ Added more test cases to
+ testing/fulltests/unit-tests/T004snmp_enum_clib.c.
+ Verified with Valgrind that everything does now work correctly
+ and that the
+ test program is free of leaks-at-exit.
+
+2010-10-12 11:11 bvassche
+
+ * include/net-snmp/library/snmp_enum.h, snmplib/snmp_enum.c:
+
+ CHANGES: snmplib: Invoking se_clear_slist() does no longer create
+ a dangling pointer.
+ CHANGES: snmplib: Fixed leaks-at-exit triggered by using the
+ snmp_enum code.
+ CHANGES: snmplib: Documented behavior of se_add_pair(),
+ se_add_pair_to_slist() and clear_snmp_enum(). Made snmp_enum
+ example consistent with the rest of the code by adding strdup()
+ calls and added a call to se_clear_all_lists().
+ CHANGES: snmplib: Fixed a memory corruption problem triggered by
+ the (undocumented) snmpd.conf "enum" keyword handler - storing
+ pointers to strings allocated on the stack in a global list does
+ not work.
+ CHANGES: snmplib:
+
+2010-10-12 06:27 bvassche
+
+ * README.win32, win32/libhelpers, win32/snmptrapd/snmptrapd.dsp,
+ win32/win32.dsw:
+
+ CHANGES: Win32: PATCH: 3085187: Building via the Microsoft Visual
+ Studio project file (.dsw/.dsp) works again.
+
+2010-10-12 05:35 magfr
+
+ * include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/output_api.h:
+
+ CHANGES: snmplib: Correct the extern "C" declarations to be
+ consistent. Remove commented out code.
+
+2010-10-11 21:41 nba
+
+ * configure:
+
+ run autoconf
+
+2010-10-11 21:39 nba
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_apt.c,
+ configure.d/config_os_progs:
+
+ Support for hrSWInstalledTable for dpkg/apt-based systems
+
+2010-10-11 20:46 nba
+
+ * mibs/Makefile.mib, mibs/rfclist:
+
+ Update sources for SNMP-TLS-TM-MIB
+
+2010-10-11 20:42 nba
+
+ * configure.d/config_os_headers:
+
+ Check early for picl.h
+
+2010-10-11 20:31 nba
+
+ * agent/mibgroup/hardware/sensors/hw_sensors.c,
+ agent/mibgroup/hardware/sensors/hw_sensors.h,
+ agent/mibgroup/ucd-snmp/lmsensorsMib.c,
+ include/net-snmp/agent/hardware/sensors.h:
+
+ Fix warnings from lmsensorMib
+
+2010-10-11 20:30 nba
+
+ * agent/mibgroup/hardware/sensors.h,
+ agent/mibgroup/hardware/sensors/picld_sensors.c:
+
+ Fix new style lmsensorMib for Solaris (was it ever compiled
+ before)
+
+2010-10-11 20:28 nba
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ Fix lmSensors for Solaris
+
+2010-10-11 20:27 nba
+
+ * agent/mibgroup/hardware/sensors/kstat_sensors.c:
+
+ Fix a Solaris file descriptor leak
+
+2010-10-11 20:25 nba
+
+ * configure.d/config_project_with_enable:
+
+ Make --disable-developer work
+
+2010-10-11 18:23 magfr
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ CHANGES: snmpd: Update the length of sysObjectID as well as the
+ data when it is set from a configuration file.
+
+2010-10-11 17:58 magfr
+
+ * man/Makefile.in:
+
+ CHANGES: building: from "Niels Baggesen": Some systems do not
+ support the -E flag to grep, use autoconf to find the right egrep
+ at all times.
+
+----------------------------------------------------------------------
+
+Changes: V5.6.RC3 -> V5.6
+
+2010-10-07 20:33 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-10-06 11:31 nba
+
+ * configure, configure.d/config_project_ipv6_types:
+
+ Fix ipv6 generic case so test matches verification
+
+2010-10-01 16:44 dts12
+
+ * man/variables.5.def:
+
+ Rework description of OID name handling to be
+ not quite so incredibly out of date.
+
+2010-09-22 14:02 hardaker
+
+ * configure:
+
+ erg... really use the right autoconf version by setting the path
+ right
+
+----------------------------------------------------------------------
+
+Changes: V5.6.rc2 -> V5.6.rc3
+
+2010-09-21 23:53 hardaker
+
+ * configure:
+
+ regenerated with proper autoconf version
+
+2010-09-21 23:49 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-09-21 23:45 hardaker
+
+ * snmplib/cert_util.c:
+
+ verified patch from rstory to fix certificate loading of
+ incomplete chains
+
+2010-09-21 18:07 hardaker
+
+ * snmplib/read_config.c:
+
+ CHANGES: snmplib: patch 3058388: from chrisbolt: don't parse
+ includeAllDisks in the main snmplib routines
+
+2010-09-21 18:06 hardaker
+
+ * agent/agent_trap.c:
+
+ CHANGES: snmpd: patch 3062526: from mariog85: fix security
+ engineID setting in the trapsess directive
+
+2010-09-21 15:13 bvassche
+
+ * README.win32:
+
+ Updated Win32 documentation.
+
+2010-09-20 23:20 hardaker
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ Patch from Fulko Hew to fix patch 2900078 which broke sysObjectID
+ lengths
+
+2010-09-20 21:32 dts12
+
+ * man/snmpget.1.def, man/snmpgetnext.1.def:
+
+ Document -Cf in the two man pages separately.
+
+2010-09-20 20:23 bvassche
+
+ * snmplib/mib.c:
+
+ CHANGES: snmplib: PATCH: 3067540: from joyceanmachine: Fix IPv4
+ OID indexes on 64-bit big-endian systems.
+
+2010-09-20 19:25 bvassche
+
+ * apps/snmpnetstat/main.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/ucd_compat.h, win32/Configure,
+ win32/Makefile.in, win32/libagent/Makefile.in,
+ win32/libagent/libagent.dsp, win32/libhelpers/Makefile.in,
+ win32/libhelpers/libhelpers.dsp, win32/netsnmpmibs/Makefile.in,
+ win32/snmpd/Makefile.in, win32/snmpd/snmpd.dsp,
+ win32/snmptrapd/Makefile.in, win32/snmptrapd/snmptrapd.dsp,
+ win32/win32.dsw, win32/win32dll.dsw:
+
+ Un-break the MSVC build.
+
+2010-09-20 09:18 bvassche
+
+ * dist/generation-scripts, man, testing, win32:
+
+ Updated Subversion ignore lists.
+
+2010-09-17 10:34 dts12
+
+ * man/agentxtrap.1.def, man/netsnmp_sess_api.3.def,
+ man/netsnmp_session_api.3.def, man/snmpbulkget.1.def,
+ man/snmpbulkwalk.1.def, man/snmpget.1.def, man/snmpgetnext.1.def,
+ man/snmpset.1.def, man/snmptrap.1.def, man/snmptrapd.8.def,
+ man/snmpwalk.1.def:
+
+ Remove CMU copyright notice from man pages that were not
+ inherited from CMU-SNMP (and qualify the copyright for
+ those that were).
+
+2010-09-17 09:51 dts12
+
+ * man/default_store.3.bot, man/netsnmp_agent_api.3.def,
+ man/snmp.conf.5.def, man/snmp_alarm.3.def, man/snmp_config.5.def,
+ man/snmpd.conf.5.def, man/snmpd.examples.5.def,
+ man/snmpd.internal.5.def, man/snmptrapd.conf.5.def:
+
+ Update man page references to reflect new API documentation
+ structure.
+
+2010-09-10 04:23 magfr
+
+ * Makefile.in:
+
+ CHANGES: building: Add new test* entries from the testing
+ Makefile.in to the top-level Makefile.in
+
+2010-09-08 15:41 dts12
+
+ * man/agentxtrap.1.def, man/default_store.3.top,
+ man/encode_keychange.1.def, man/fixproc.1.def,
+ man/mib2c-update.1.def, man/mib2c.1.def, man/mib2c.conf.5.in,
+ man/net-snmp-config.1.def, man/net-snmp-create-v3-user.1.def,
+ man/netsnmp_agent_api.3.def, man/netsnmp_config_api.3.def,
+ man/netsnmp_mib_api.3.def, man/netsnmp_pdu_api.3.def,
+ man/netsnmp_sess_api.3.def, man/netsnmp_session_api.3.def,
+ man/netsnmp_trap_api.3.def, man/netsnmp_varbind_api.3.def,
+ man/snmp-bridge-mib.1, man/snmp.conf.5.def, man/snmp_alarm.3.def,
+ man/snmp_config.5.def, man/snmpbulkget.1.def,
+ man/snmpbulkwalk.1.def, man/snmpcmd.1.def, man/snmpconf.1.def,
+ man/snmpd.8.def, man/snmpd.conf.5.def, man/snmpd.examples.5.def,
+ man/snmpd.internal.5.def, man/snmpdelta.1.def, man/snmpdf.1.def,
+ man/snmpget.1.def, man/snmpgetnext.1.def, man/snmpnetstat.1.def,
+ man/snmpset.1.def, man/snmpstatus.1.def, man/snmptable.1.def,
+ man/snmptest.1.def, man/snmptranslate.1.def, man/snmptrap.1.def,
+ man/snmptrapd.8.def, man/snmptrapd.conf.5.def,
+ man/snmpusm.1.def, man/snmpvacm.1.def, man/snmpwalk.1.def,
+ man/tkmib.1.def, man/traptoemail.1.def, man/variables.5.def:
+
+ Update man page datestamps to match the latest (non-trivial)
+ content change.
+ Suppress forcing of "Berkeley Distribution" footer
+ (Allows Net-SNMP version information to be displayed in the man
+ page)
+
+2010-09-08 05:37 magfr
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ Regenerated
+
+2010-09-04 06:38 bvassche
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ Fixed a compiler warning that was introduced in r19356 by
+ changing the return
+ type of netsnmp_tlsbase_free_tlsdata() from void* to void.
+
+2010-09-04 06:37 bvassche
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ Fixed a compiler warning that was introduced in r19322 (patch
+ 3044512).
+ The third argument passed to read_objid() was an int instead of
+ size_t.
+ This could have caused memory corruption on 64-bit systems.
+
+2010-09-04 03:09 hardaker
+
+ * CHANGES:
+
+ version update
+
+2010-09-04 03:08 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2010-09-04 01:57 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2010-09-04 00:59 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-09-03 22:14 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix tlstcp parsing of host names.
+
+2010-09-03 22:13 hardaker
+
+ * agent/mibgroup/host/data_access/swrun_procfs_status.c:
+
+ check the return code of fgets and fopen before inserting the
+ results.
+
+2010-09-03 22:12 hardaker
+
+ * snmplib/snmp_alarm.c:
+
+ Patch from tanders to fix broken alarms after the previous
+ re-entrant patch
+
+2010-09-03 22:05 hardaker
+
+ * snmplib/transports/snmpUnixDomain.c:
+
+ CHANGES: snmplib: patch 3058645: from jorisesaturnus: modified
+ version of the patch to use MSG_DONTWAIT for the unix domain
+ socket
+
+2010-09-03 21:56 hardaker
+
+ * agent/mibgroup/util_funcs/get_pid_from_inode.c:
+
+ CHANGES: snmpd: PATCH: 3058140: from takevos: check that inode is
+ non-zero
+
+2010-09-03 21:50 hardaker
+
+ * agent/mibgroup/util_funcs/get_pid_from_inode.c:
+
+ CHANGES: snmpd: PATCH: 3053428: from takevos: fix
+ get_pid_from_inode when the inode is not found.
+
+2010-09-03 20:20 hardaker
+
+ * snmplib/snmp_api.c:
+
+ remove the duplicate return before the error codes get set.
+
+2010-09-01 18:04 magfr
+
+ * agent/mibgroup/hardware/cpu/cpu.c:
+
+ CHANGES: snmpd: Log before returning.
+
+2010-09-01 02:43 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ TLS send_notify on closure and some memory clean-up patches
+
+2010-08-31 17:58 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Only print the security/context EngineID mismatch note under USM
+
+2010-08-25 15:13 rstory
+
+ * CHANGES:
+
+ remove reference to reverted patch 3042765
+
+2010-08-25 15:13 rstory
+
+ * acconfig.h:
+
+ add note on where to find content used to generate
+ net-snmp-config.h.in
+
+2010-08-25 02:45 rstory
+
+ * snmplib/snmp_client.c:
+
+ revert r19342, patch 3042765, which broke client tcp disconnect
+ handling
+
+2010-08-25 02:45 rstory
+
+ * snmplib/cert_util.c:
+
+ fix more code broken by 'compiler warning fix' in r19179
+
+2010-08-25 02:45 rstory
+
+ * testing/fulltests/tls/STlsUsers:
+
+ check for conf errors after agent startup; enable logTimestamp;
+ make sure
+ all cert name/tags are unique
+
+2010-08-24 21:04 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ fix error string to discuss the right failed openssl new
+ invocation
+
+2010-08-24 05:37 magfr
+
+ * apps/snmpusm.c:
+
+ CHANGES: snmpusm: Correct ifdefs, remove dead variables.
+
+2010-08-19 21:22 hardaker
+
+ * CHANGES, NEWS:
+
+ version update
+
+2010-08-19 21:20 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2010-08-19 21:11 hardaker
+
+ * agent/Makefile.depend, agent/mibgroup/Makefile.depend:
+
+ make depend
+
+2010-08-19 21:10 hardaker
+
+ * include/net-snmp/system/nto-qnx6.h:
+
+ // -> C comments
+
+2010-08-19 20:36 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-08-19 20:14 hardaker
+
+ * snmplib/snmp_client.c:
+
+ CHANGES: snmplib: PATCH 3042765: from mehaf: make
+ snmp_synch_response_cb() re-entrant
+
+2010-08-19 20:14 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ turn off cookie exchanges until a complete code set can be
+ written to support it based on the required function callbacks
+
+2010-08-17 18:31 rstory
+
+ * agent/snmpd.c:
+
+ add missing call to store persistent data as needed
+
+2010-08-17 18:31 rstory
+
+ * snmplib/mib.c:
+
+ CHANGES: snmplib: when displaying a byte as single digit hex
+ value, default to
+ prefixing with 0 unless there is a seperator or addition hint
+ data
+
+2010-08-17 10:31 bvassche
+
+ * apps/snmpusm.c:
+
+ Fixed a compiler warning about an unused label that was triggered
+ when
+ compiling without SSL support.
+
+2010-08-16 23:11 hardaker
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.h:
+
+ CHANGES: snmpd: patch 2790249: from willpwillp: reduce cache time
+ for the iftable to 3seconds to increase accuracy
+
+2010-08-16 16:26 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ CHANGES: perl: patch 3046371: from christophb4: Fix memory leak
+ in SNMPv1 trap handling.
+
+2010-08-16 16:03 hardaker
+
+ * agent/mibgroup/mibII/mta_sendmail.c:
+
+ CHANGES: snmpd: patch 2825653: from bru5ce: fix sendmail.cf
+ parsing in certain conditions
+
+2010-08-16 10:16 dts12
+
+ * man/Makefile.in:
+
+ Build netsnmp_agent_api.3 man page from template
+
+2010-08-16 09:20 dts12
+
+ * agent/agent_registry.c:
+
+ CHANGES: snmpd: PATCH: 2911361: Documentation (Provided by Tomasz
+ Lis)
+
+2010-08-16 08:06 dts12
+
+ * agent/agent_registry.c:
+
+ CHANGES: snmpd: PATCH: 2911361: Re-order code to group related
+ functions together
+
+2010-08-16 07:42 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: PATCH: 2995098: Fix creation of SNMPv3 sessions
+ with API_SINGLE
+
+2010-08-14 16:30 dts12
+
+ * agent/agent_read_config.c:
+
+ CHANGES: snmpd: PATCH: 2911361: Remove redundant variables
+
+2010-08-14 16:23 dts12
+
+ * agent/agent_handler.c:
+
+ CHANGES: snmpd: PATCH: 2904900: Documentation plus assorted
+ handler code fixes
+
+2010-08-14 09:28 dts12
+
+ * man/Makefile.in, man/netsnmp_config_api.3.def,
+ man/netsnmp_mib_api.3.def, man/netsnmp_pdu_api.3.def,
+ man/netsnmp_sess_api.3.def, man/netsnmp_session_api.3.def,
+ man/netsnmp_trap_api.3.def, man/netsnmp_varbind_api.3.def,
+ man/snmp_alarm.3.def:
+
+ Restore agent API man page
+ Don't try to extract multiple man page links per line
+ (which runs into problems with OS-specific line endings).
+ Instead, ensure the man page NAME section lists one
+ routine per line
+
+2010-08-13 23:50 hardaker
+
+ * man/Makefile.in:
+
+ fix broken Makefile after man page moves
+
+2010-08-13 23:50 hardaker
+
+ * mibs/SNMP-TLS-TM-MIB.txt, mibs/rfclist:
+
+ updated TLS MIB to current copy
+
+2010-08-13 23:50 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ replaced RFC comment number
+
+2010-08-13 23:50 hardaker
+
+ * include/net-snmp/library/snmp_alarm.h, snmplib/snmp_alarm.c:
+
+ CHANGES: snmplib: patch: 3042770: from mehaf: Made run_alarms()
+ reentrant
+
+2010-08-13 23:44 hardaker
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ CHANGES: snmpd: PATCH: 3044512: from philwebster: fix sysobjectid
+ directive.
+
+2010-08-13 19:00 rstory
+
+ * testing/fulltests/support/simple_TESTCONF.sh,
+ testing/fulltests/tls/STsmPrefix:
+
+ use 127.0.0.1 instead of localhost as default SNMP_TEST_DEST so
+ TLS tests work
+
+2010-08-13 18:50 hardaker
+
+ * include/net-snmp/session_api.h, snmplib/snmp_api.c,
+ snmplib/snmp_client.c:
+
+ CHANGES: snmplib: implemented a fix for the issue reported in
+ patch #3042770. Created a snmp_select_info_flags function, and
+ similar, that allow for alarms to not be run. This is then used
+ in the synch_response functions to avoid 100% CPU loops
+
+2010-08-13 18:50 hardaker
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h,
+ apps/snmptrapd.c:
+
+ make snmptrapd register the certtosecname table in the agentx
+ registrations
+
+2010-08-13 18:49 hardaker
+
+ * local/mib2c.conf:
+
+ minor wording additions
+
+2010-08-13 15:04 hardaker
+
+ * agent/mibgroup/hardware/cpu/cpu_perfstat.c,
+ agent/mibgroup/hardware/memory/memory_aix.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory_aix4.c,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.c:
+
+ CHANGES: aix: PATCH: 2886598: from exsnafu: Header fixes for
+ compiling on AIX6
+
+2010-08-13 15:04 hardaker
+
+ * agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c, apps/snmpnetstat/inet6.c,
+ configure, configure.d/config_os_functions,
+ configure.d/config_os_headers, configure.d/config_os_libs,
+ configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/nto-qnx6.h:
+
+ NEWS: ports: PATCH: 2836895: from seanboudreau: support for QNX6
+
+2010-08-13 14:33 dts12
+
+ * man/Makefile.in, man/netsnmp_agent_api.3.def,
+ man/netsnmp_config_api.3.def, man/netsnmp_mib_api.3.def,
+ man/netsnmp_pdu_api.3.def, man/netsnmp_sess_api.3.def,
+ man/netsnmp_session_api.3.def, man/netsnmp_trap_api.3.def,
+ man/netsnmp_varbind_api.3.def:
+
+ 'enforce netsnmp prefixes
+
+2010-08-13 14:29 dts12
+
+ * man/netsnmp_varbind_api.3.def, man/varbind_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:29 dts12
+
+ * man/netsnmp_trap_api.3.def, man/snmp_trap_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:28 dts12
+
+ * man/netsnmp_sess_api.3.def, man/snmp_sess_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:28 dts12
+
+ * man/netsnmp_agent_api.3.def, man/snmp_agent_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:28 dts12
+
+ * man/netsnmp_session_api.3.def, man/session_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:27 dts12
+
+ * man/netsnmp_pdu_api.3.def, man/pdu_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:27 dts12
+
+ * man/mib_api.3.def, man/netsnmp_mib_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:27 dts12
+
+ * man/config_api.3.def, man/netsnmp_config_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:20 dts12
+
+ * Makefile.in, doxygen.conf:
+
+ Don't automatically generate man pages
+
+2010-08-13 14:18 dts12
+
+ * man/snmp_api_errstring.3, man/snmp_close.3, man/snmp_error.3,
+ man/snmp_free_pdu.3, man/snmp_open.3, man/snmp_perror.3,
+ man/snmp_read.3, man/snmp_select_info.3, man/snmp_send.3,
+ man/snmp_sess_async_send.3, man/snmp_sess_close.3,
+ man/snmp_sess_error.3, man/snmp_sess_init.3,
+ man/snmp_sess_open.3, man/snmp_sess_perror.3,
+ man/snmp_sess_read.3, man/snmp_sess_select_info.3,
+ man/snmp_sess_send.3, man/snmp_sess_session.3,
+ man/snmp_sess_timeout.3, man/snmp_set_mib_warnings.3,
+ man/snmp_set_save_descriptions.3, man/snmp_timeout.3:
+
+ Remove redundant man page links
+ (Should be generated automatically, but don't exist any more
+ anyway)
+
+2010-08-13 14:13 dts12
+
+ * man/Makefile.in, man/add_mibdir.3, man/add_module_replacement.3,
+ man/get_module_node.3, man/init_mib.3, man/init_mib_internals.3,
+ man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_example_scalar_int.3, man/netsnmp_handler.3,
+ man/netsnmp_instance.3, man/netsnmp_iterator_info_s.3,
+ man/netsnmp_leaf.3, man/netsnmp_library.3,
+ man/netsnmp_mib_handler_methods.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_set_data.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_row.3, man/netsnmp_table_rows.3,
+ man/netsnmp_tdata.3, man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3, man/print_description.3, man/print_mib.3,
+ man/print_objid.3, man/print_value.3, man/print_variable.3,
+ man/read_all_mibs.3, man/read_mib.3, man/read_module.3,
+ man/read_module_node.3, man/read_objid.3, man/shutdown_mib.3:
+
+ Remove Doxygen-generated man pages, and those linking
+ individual routines to the appropriate man page.
+ (These are better generated dynamically)
+
+2010-08-13 12:19 dts12
+
+ * local/mib2c.iterate.conf, local/mib2c.table_data.conf:
+
+ Prompt for whether to generate caching code or not.
+
+2010-08-13 12:19 dts12
+
+ * local/mib2c.conf:
+
+ Rework guidance questions when selecting the best table framework
+ to use.
+ Ensure table handling code doesn't overwrite scalar handling
+ code.
+ Check that the starting point is suitable for MfD framework.
+
+2010-08-12 15:40 rstory
+
+ * snmplib/cert_util.c:
+
+ fix code broken by 'compiler warning fix' in r19179
+
+2010-08-12 15:39 rstory
+
+ * agent/mibgroup/snmpv3mibs.h:
+
+ fix typo in comment
+
+2010-08-11 22:08 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ remove a duplicate value check
+
+2010-08-11 22:08 hardaker
+
+ * testing/fulltests/tls/STlsUsers:
+
+ add a test where we can trust a CA-signed cert and we don't trust
+ the CA
+
+2010-08-11 22:08 hardaker
+
+ * testing/fulltests/tls/STlsUsers:
+
+ test a directly mapped CA certificate
+
+2010-08-11 22:08 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ change the laConfig to read-write to match the patch
+
+2010-08-11 22:07 hardaker
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ NEWS: snmpd: PATCH: 2931446: from ahmake: make the load averages
+ writable.
+
+2010-08-11 06:43 magfr
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T020hashtests_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c:
+
+ CHANGES: Silence some compilation warnings from test cases.
+
+2010-08-09 21:09 magfr
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: Handle embedded %'s in the result message.
+
+2010-08-09 21:07 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ CHANGES: Do no double declare the index values.
+
+2010-08-05 11:49 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Update "auth*" usage message with context support
+
+2010-08-02 20:08 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntctl.c:
+
+ Fix two silly mistakes.
+
+2010-08-02 14:18 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntctl.c:
+
+ AIX filesystem types are tagged as integers, not strings.
+
+2010-08-02 13:49 tanders
+
+ * configure, configure.d/config_os_progs:
+
+ fix Perl system() configure check to work reliably on systems
+ that lack
+ Perl
+
+2010-08-02 11:08 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ CHANGES: testing: made it possible to analyze all code covered by
+ the regression tests with a dynamic analyzer, at least if that
+ analyzer supports following child processes. An example:
+
+ rm -rf /tmp/snmp-test-*
+ make -s
+ SNMP_SAVE_TMPDIR=yes DYNAMIC_ANALYZER="valgrind
+ --trace-children=yes --track-origins=yes" make -s test
+ grep -i uninitialised /tmp/snmp-test-* | xargs less
+
+2010-08-02 11:02 bvassche
+
+ * snmplib/snmp_transport.c, snmplib/transports/snmpTCPDomain.c:
+
+ Fixed the following two Valgrind complaints:
+
+ Conditional jump or move depends on uninitialised value(s)
+ at 0x6D702E0: vfprintf (in /lib64/libc-2.11.2.so)
+ by 0x6D99D11: vsnprintf (in /lib64/libc-2.11.2.so)
+ by 0x6D7A412: snprintf (in /lib64/libc-2.11.2.so)
+ by 0x6E14437: inet_ntoa (in /lib64/libc-2.11.2.so)
+ by 0x5E5E219: netsnmp_ipv4_fmtaddr (snmpIPv4BaseDomain.c:215)
+ by 0x5E65717: netsnmp_tcp_fmtaddr (snmpTCPDomain.c:70)
+ by 0x5E567EC: netsnmp_transport_peer_string
+ (snmp_transport.c:224)
+ by 0x5E2479A: _sess_process_packet (snmp_api.c:5441)
+ by 0x5E25E37: _sess_read (snmp_api.c:6037)
+ by 0x5E261DA: snmp_sess_read2 (snmp_api.c:6149)
+ by 0x5E26282: snmp_read2 (snmp_api.c:5740)
+ by 0x404DE4: main (snmpd.c:1227)
+ Uninitialised value was created by a heap allocation
+ at 0x4C270A5: malloc (vg_replace_malloc.c:236)
+ by 0x5E65739: netsnmp_tcp_accept (snmpTCPDomain.c:82)
+ by 0x5E25383: _sess_read (snmp_api.c:5786)
+ by 0x5E261DA: snmp_sess_read2 (snmp_api.c:6149)
+ by 0x5E26282: snmp_read2 (snmp_api.c:5740)
+ by 0x404DE4: main (snmpd.c:1227)
+
+ Conditional jump or move depends on uninitialised value(s)
+ at 0x6F7B2E0: vfprintf (in /lib64/libc-2.11.2.so)
+ by 0x6FA4D11: vsnprintf (in /lib64/libc-2.11.2.so)
+ by 0x6F85412: snprintf (in /lib64/libc-2.11.2.so)
+ by 0x701F437: inet_ntoa (in /lib64/libc-2.11.2.so)
+ by 0x56FA219: netsnmp_ipv4_fmtaddr (snmpIPv4BaseDomain.c:215)
+ by 0x5701717: netsnmp_tcp_fmtaddr (snmpTCPDomain.c:70)
+ by 0x56F27EC: netsnmp_transport_peer_string
+ (snmp_transport.c:224)
+ by 0x56F294F: netsnmp_transport_send (snmp_transport.c:248)
+ by 0x56BC487: snmp_sess_async_send (snmp_api.c:5204)
+ by 0x56BC651: snmp_async_send (snmp_api.c:4998)
+ by 0x56BC677: snmp_send (snmp_api.c:4984)
+ by 0x5698440: snmp_synch_response_cb (snmp_client.c:1006)
+ Uninitialised value was created by a heap allocation
+ at 0x4C270A5: malloc (vg_replace_malloc.c:236)
+ by 0x5701B3E: netsnmp_tcp_transport (snmpTCPDomain.c:163)
+ by 0x5701E6F: netsnmp_tcp_create_tstring (snmpTCPDomain.c:305)
+ by 0x56F3804: netsnmp_tdomain_transport_full
+ (snmp_transport.c:601)
+ by 0x56F3ACC: netsnmp_transport_open_client
+ (snmp_transport.c:669)
+ by 0x54344F6: subagent_open_master_session (subagent.c:758)
+ by 0x54349C8: agentx_reopen_session (subagent.c:869)
+ by 0x5434D00: subagent_startup (subagent.c:99)
+ by 0x56EAEB7: snmp_call_callbacks (callback.c:338)
+ by 0x56DE6FB: read_configs (read_config.c:1018)
+ by 0x56C287E: init_snmp (snmp_api.c:850)
+ by 0x40477B: main (snmptrapd.c:1048)
+
+2010-08-01 06:11 bvassche
+
+ * CHANGES, NEWS:
+
+ Fixed spelling errors reported by ispell -l.
+
+2010-08-01 06:00 bvassche
+
+ * snmplib/snmp_enum.c,
+ testing/fulltests/unit-tests/T004snmp_enum_clib.c:
+
+ Fixed a typo in a text string in a unit test: resturant ->
+ restaurant.
+
+2010-08-01 05:53 bvassche
+
+ * include/net-snmp/library/snmp_enum.h:
+
+ Documented behavior of se_add_pair_to_slist().
+
+2010-07-31 23:50 tanders
+
+ * include/net-snmp/system/darwin10.h:
+
+ Follow-up for r19266: add missing header file to support Mac OS X
+ 10.6
+ (Snow Leopard - "darwin10")
+
+2010-07-31 20:38 hardaker
+
+ * CHANGES:
+
+ version update
+
+2010-07-31 20:35 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2010-07-31 20:31 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2010-07-31 20:24 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2010-07-31 20:16 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-07-31 20:11 hardaker
+
+ * dist/makerelease.xml:
+
+ changed the name of the readme section to call out NEWS-too
+
+2010-07-31 20:10 hardaker
+
+ * NEWS:
+
+ added missing news items
+
+2010-07-30 13:06 hardaker
+
+ * snmplib/snmp_client.c:
+
+ CHANGES: python: PATCH 3035328: from: sws: check the results of
+ session creation for a failure case.
+
+2010-07-30 13:00 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: patch 3035578: from sws: keep error codes up to
+ date
+
+2010-07-29 15:48 dts12
+
+ * configure:
+
+ Add support for Mac OS X 10.6 (Snow Leopard - "darwin10")
+ (On the assumption that this is the same as Mac OS X 10.5
+ (Leopard - "darwin9"))
+
+2010-07-29 15:47 dts12
+
+ * Makefile.in, configure.d/config_os_progs,
+ configure.d/config_project_perl_python:
+
+ Add support for Mac OS X 10.6 (Snow Leopard - "darwin10")
+ (On the assumption that this is the same as Mac OS X 10.5
+ (Leopard - "darwin9"))
+
+2010-07-29 15:03 dts12
+
+ * include/net-snmp/output_api.h:
+
+ Provide a definition of 'va_list' for varargs-based APIs
+
+2010-07-29 14:58 dts12
+
+ * acconfig.h, agent/auto_nlist.c, agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/fsys.h, agent/mibgroup/hardware/memory.h,
+ agent/mibgroup/host/data_access/swrun.h,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hrh_filesys.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/proc.c, configure,
+ configure.d/config_os_progs,
+ include/net-snmp/net-snmp-config.h.in, snmplib/system.c:
+
+ Add preliminary support for AIX 7
+ (on the assumption that this is identical to AIX 6)
+
+2010-07-29 14:56 dts12
+
+ * configure, configure.d/config_project_perl_python:
+
+ Disable embedded perl by default on architecures where
+ this seems to cause problems (HP-UX & Mac OS X)
+
+2010-07-29 11:13 dts12
+
+ * snmplib/read_config.c:
+
+ Guard against blank 'include*' lines.
+ Handle relative 'includeFile' paths
+
+2010-07-29 10:47 dts12
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c:
+
+ Return an indication of whether config files are actually
+ processed.
+ Report problems with failing to include config files.
+
+2010-07-28 14:44 dts12
+
+ * include/net-snmp/config_api.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/mib_api.h, include/net-snmp/output_api.h,
+ include/net-snmp/pdu_api.h, include/net-snmp/session_api.h,
+ include/net-snmp/varbind_api.h, man/config_api.3.def,
+ man/mib_api.3.def, man/session_api.3.def, man/varbind_api.3.def,
+ win32/libsnmp_dll/libsnmp.def:
+
+ Bring man page documentation, header files and Windows DLL
+ definitions
+ of top-level public API calls into line with each other.
+
+2010-07-28 14:40 dts12
+
+ * snmplib/snmp_api.c:
+
+ Fix misnamed comment
+
+2010-07-28 14:36 dts12
+
+ * agent/mibgroup/default_modules.h, configure,
+ configure.d/config_modules_agent,
+ configure.d/config_project_with_enable:
+
+ Don't mix SMIv1 and SMIv2 MIBs in the list of default MIBs to
+ load.
+ Use newer SMIv2 versions (which include suitable display hints)
+ rather than the original RFC1213 MIB (which doesn't)
+
+2010-07-28 14:10 dts12
+
+ * snmplib/read_config.c:
+
+ Fix indentation for 'includeSearch' processing code.
+
+2010-07-28 14:09 dts12
+
+ * snmplib/read_config.c:
+
+ Extend 'include' config file processing to cover three
+ different modes of working:
+ - look for the file on the config search path
+ - include the specified file by name
+ - ioad the contents of the specified directory
+ Use different config tokens to distinguish these cases.
+
+2010-07-27 11:12 hardaker
+
+ * agent/kernel.c, agent/kernel.h, agent/snmp_vars.c:
+
+ CHANGES: snmpd: patch 2912520: from listom: Free kmem references
+ on shutdown
+
+2010-07-27 10:54 hardaker
+
+ * mibs/SMUX-MIB.txt:
+
+ CHANGES: mibs: patch 2974716: from bvassche: fix issues in the
+ SMUX-MIB
+
+2010-07-27 08:54 hardaker
+
+ * configure.d/config_modules_lib:
+
+ include the new security-hedaers module
+
+2010-07-27 08:54 hardaker
+
+ * local/snmp-bridge-mib:
+
+ remote debugging/processing stderr output
+
+2010-07-27 08:54 hardaker
+
+ * local/snmp-bridge-mib:
+
+ CHANGES: snmpd: patch: 3028923: from jenso: new copy of the
+ bridge-mib perl implementation
+
+2010-07-27 08:31 hardaker
+
+ * Makefile.in, configure.d/config_modules_security_modules,
+ dist/generation-scripts/gen-security-headers.in:
+
+ separate out the security header/init generation
+
+2010-07-27 08:31 hardaker
+
+ * configure.d/config_modules_transports:
+
+ transport configure portion
+
+2010-07-27 08:30 hardaker
+
+ * Makefile.in, configure, configure.ac,
+ configure.d/config_modules_lib, dist/generation-scripts,
+ dist/generation-scripts/gen-transport-headers.in,
+ dist/generation-scripts/gen-variables.in:
+
+ move transport header generation to a separate file and create an
+ external separate script for generating it
+
+2010-07-27 08:14 jsafranek
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/mnttypes.h:
+
+ CHANGES: snmpd: report gfs filesystems in hrStorageTable and
+ hrFSTable.
+
+2010-07-24 15:42 dts12
+
+ * snmplib/read_config.c:
+
+ Don't lose track of which config file was being parsed,
+ when processing an included config file.
+ Fixes a bug with reporting later config errors.
+
+2010-07-24 15:36 dts12
+
+ * snmplib/snmp_transport.c:
+
+ Don't lose track of which config file is being parsed,
+ when opening a new SNMP session.
+ Fixes a bug with reporting later config errors.
+
+2010-07-23 03:12 hardaker
+
+ * dist/makerelease.xml:
+
+ add the TLS modules to the list of test modules
+
+2010-07-21 19:25 nba
+
+ * agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c:
+
+ Fix typo in doxygen comment
+
+2010-07-21 19:24 nba
+
+ * agent/mibgroup/if-mib/data_access/interface_sysctl.c:
+
+ Fix typo in speed computation
+
+2010-07-21 19:21 nba
+
+ * snmplib/snmp_secmod.c:
+
+ Include generated security-includes.h
+
+2010-07-21 19:20 nba
+
+ * include/net-snmp/library/snmpksm.h,
+ include/net-snmp/library/snmptsm.h:
+
+ Fix init func name (copy-paste glitch)
+
+2010-07-21 19:18 nba
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ Remove superfluous semicolon
+
+2010-07-21 19:18 nba
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ Out of order declaration
+
+2010-07-21 19:17 nba
+
+ * snmplib/snmp_logging.c:
+
+ Log error on file open error
+
+2010-07-21 19:16 nba
+
+ * configure.d/config_modules_lib:
+
+ Speling error
+
+2010-07-21 18:10 nba
+
+ * mibs/ianalist, mibs/rfclist, mibs/rfcmibs.diff:
+
+ Update for current RFCs
+
+2010-07-21 18:08 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ Current version from IANA
+
+2010-07-21 18:05 nba
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ r17495 erroneously disabled diskIOLAx for linux
+
+2010-07-20 10:38 jsafranek
+
+ * snmplib/system.c:
+
+ CHANGES: snmplib: fixed potential buffer overflow when generating
+ temp. file names
+
+2010-07-20 07:32 jsafranek
+
+ * agent/snmpd.c, apps/agentxtrap.c, apps/snmptranslate.c,
+ apps/snmptrapd.c, man/snmpcmd.1.def, man/snmptranslate.1.def,
+ man/snmptrapd.8.def, snmplib/snmp_parse_args.c:
+
+ Describe -D usage as -D[TOKEN] instead of -D [TOKEN]
+
+2010-07-17 15:10 rstory
+
+ * mibs/SNMP-TLS-TM-MIB.txt:
+
+ update display hint to some less ambiguous (and that works with
+ our lib)
+
+2010-07-17 04:13 rstory
+
+ * testing/Makefile.in:
+
+ fix testsimple for builddir!=srcdir
+
+2010-07-17 04:12 rstory
+
+ * testing/Makefile.in:
+
+ add testsimple target
+
+2010-07-16 19:21 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ release iterator when done with it
+
+2010-07-15 18:28 hardaker
+
+ * snmplib/snmpusm.c:
+
+ CHANGES: snmplib: fix issue with USM using inactive users
+
+2010-07-15 01:35 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c:
+
+ don't use strndup (portability)
+
+2010-07-15 01:35 rstory
+
+ * snmplib/cert_util.c:
+
+ include appropriate string header; define NAME_MAX if not already
+ defined;
+ don't use strndup (portability)
+
+2010-07-15 01:35 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ check that some newer openssl macros are defined before using
+ them; include
+ appropriate string header
+
+2010-07-15 01:35 rstory
+
+ * configure, configure.d/config_os_libs,
+ include/net-snmp/net-snmp-config.h.in:
+
+ check for dtls support in openssl
+
+2010-07-15 01:34 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ don't compile dtls domain if no dtls support in openssl
+
+2010-07-15 01:34 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ ifdef protection for later sha algorithms
+
+2010-07-15 01:34 rstory
+
+ * include/net-snmp/system/darwin.h,
+ include/net-snmp/system/darwin7.h,
+ include/net-snmp/system/darwin8.h,
+ include/net-snmp/system/darwin9.h:
+
+ darwin openssl does not support more recent sha algorithms
+
+2010-07-15 01:33 rstory
+
+ * agent/mibgroup/target/target.c:
+
+ fix typo in ifdef test
+
+2010-07-15 01:33 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ fix cut-n-paste error in included file name
+
+2010-07-14 15:08 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c:
+
+ fix the fix: put PRIz spec in correct place
+
+2010-07-14 15:03 rstory
+
+ * testing/fulltests/tls/STlsUsers:
+
+ specify SNMP version on commandline
+
+2010-07-14 15:03 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ quiet compiler
+
+2010-07-14 15:02 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ quiet compiler warnings
+
+2010-07-13 20:03 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+ apps/snmptls.c, include/net-snmp/library/cert_util.h:
+
+ include ssl.h before cert_util.h
+
+2010-07-13 20:03 rstory
+
+ * snmplib/cert_util.c:
+
+ add debug output for found cert
+
+2010-07-13 16:24 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix typo in log msg
+
+2010-07-12 10:26 bvassche
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ CHANGES: Win32 and Cygwin: made sure that accessing the mibII
+ interfaces table does not trigger out-of-range array accesses
+ (was detected by BoundsChecker).
+
+2010-07-12 10:21 bvassche
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Fixed a dangling-pointer-read that was introduced in r19018. In
+ r19018 the type of groupSubtreeLen was changed from int to
+ size_t, which changed the behavior of the loop "while
+ (groupSubtreeLen-- > 0) ...": instead of not executing the loop
+ body when groupSubtreeLen was negative, r19018 caused the body of
+ that loop to be executed. Detected by running snmpd under
+ BoundsChecker while performing a MIB walk.
+
+2010-07-12 10:12 bvassche
+
+ * agent/mibgroup/mibII/at.c:
+
+ Reverted r19047 (which was wrong) and implemented a proper fix
+ for the compiler warnings about signed/unsigned mismatches.
+
+2010-07-12 10:09 bvassche
+
+ * agent/snmp_agent.c:
+
+ Removed an obsolete comment.
+
+2010-07-12 10:08 bvassche
+
+ * agent/helpers/table_container.c, win32/mib_module_includes.h:
+
+ Suppressed more MSVC compiler warnings.
+
+2010-07-12 04:45 rstory
+
+ * testing/fulltests/tls/STlsVars:
+
+ add comment with object name for numeric ids
+
+2010-07-12 04:45 rstory
+
+ * agent/mibgroup/target/target.c,
+ include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ new function to get serverId from snmpTlstmAddrTable data; use
+ new api
+ to config serviceId for trap transport when sending traps
+
+2010-07-11 11:18 bvassche
+
+ * configure, configure.d/config_os_functions:
+
+ CHANGES: BUG: 3027900: when cross-compiling it is now assumed
+ that memcmp() is available instead of assuming that it is not
+ available.
+
+2010-07-11 10:30 bvassche
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Fixed compiler warnings triggered by r19197.
+
+2010-07-10 20:00 rstory
+
+ * testing/RUNFULLTESTS:
+
+ sync up help output and options processing
+
+2010-07-09 15:13 bvassche
+
+ * README.win32:
+
+ Updated Cygwin section in README.win32.
+
+2010-07-09 15:13 bvassche
+
+ * agent/helpers/instance.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ CHANGES: Win32: Suppressed "implicit cast from int to u_char"
+ warnings generated by MSVC.
+
+2010-07-09 15:11 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ Testing: made the debug output that appears in the "invoked" file
+ even more verbose.
+
+2010-07-09 15:10 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32 MSVC build fixes.
+
+2010-07-08 19:30 marz
+
+ * local/certgen-test.pl, local/net-snmp-cert,
+ local/net-snmp-cert.conf:
+
+ adds per identity configuration file support so defaults can be
+ customised on cmdline w -i <identity> - see net-snmp-cert.conf
+ for examples and some help info
+
+2010-07-08 12:17 dts12
+
+ * agent/agent_read_config.c:
+
+ CHANGES: snmpd: BUG: 3003981: Protect against buffer overflow
+
+2010-07-08 11:19 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ CHANGES: snmpd: BUG: 3019243: Register execFix compatability
+ directive correctly.
+
+2010-07-07 10:19 bvassche
+
+ * testing/fulltests/default/T110agentxget_simple,
+ testing/fulltests/default/T111agentxset_simple,
+ testing/fulltests/default/T112agentxsetfail_simple,
+ testing/fulltests/default/T120proxyget_simple,
+ testing/fulltests/default/T121proxyset_simple,
+ testing/fulltests/default/T122proxysetfail_simple:
+
+ CHANGES: Cygwin and MinGW: tests T110, T111, T112, T120, T121 and
+ T122 do now pass when snmpd is built with winExtDLL support
+ enabled.
+
+2010-07-06 18:59 bvassche
+
+ * ChangeLog, agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ local/mib2c-conf.d/mfd-persistence.m2i,
+ testing/fulltests/support/simple_eval_tools.sh:
+
+ Made regression tests easier to debug by including ok / not ok
+ status in the "invoked" file.
+ Spelling fixes: remeber -> remember; seperator -> separator.
+
+2010-07-06 15:04 bvassche
+
+ * testing/fulltests/default/T065agentextend_simple,
+ testing/fulltests/support/simple_TESTCONF.sh:
+
+ Test T065 does now really pass on MinGW.
+
+2010-07-05 10:01 bvassche
+
+ * testing/Makefile.in:
+
+ Added curly braces such that '||' and '&&' are evaluated in the
+ correct order.
+
+2010-07-04 11:37 bvassche
+
+ * apps:
+
+ Updated Subversion ignore list.
+
+2010-07-04 11:34 bvassche
+
+ * testing/Makefile.in:
+
+ Fall back from RUNFULLTESTS to RUNTESTS if neither TAP::Harness
+ nor Test::Harness is available.
+
+2010-07-04 11:21 bvassche
+
+ * testing/fulltests/support/simple_run:
+
+ Made sure that the test number in /tmp/snmp-tests-$testnum is set
+ to something more meaningful than just "0".
+
+2010-07-04 11:20 bvassche
+
+ * testing/RUNTESTS:
+
+ Split a long comment line.
+
+2010-07-04 10:52 bvassche
+
+ * testing/RUNTESTS:
+
+ Bug fix: made sure that srcdir is computed correctly if `dirname
+ $0` = .
+
+2010-07-02 16:27 bvassche
+
+ * apps/Makefile.in, configure, configure.d/config_os_libs:
+
+ Simplified r19181 (Fixed TLSTCP-enabled build for platforms with
+ non-empty $(EXEEXT), i.e. Cygwin and MinGW).
+
+2010-07-01 18:15 bvassche
+
+ * apps/Makefile.in, configure, configure.d/config_os_libs:
+
+ Fixed TLSTCP-enabled build for platforms with non-empty
+ $(EXEEXT), i.e. Cygwin and MinGW.
+
+2010-07-01 18:11 bvassche
+
+ * apps/snmptls.c:
+
+ Fixed yet another recently introduced compiler warning.
+
+2010-07-01 17:53 bvassche
+
+ * snmplib/cert_util.c:
+
+ Fixed two recently introduced compiler warnings.
+
+2010-07-01 00:19 hardaker
+
+ * CHANGES, NEWS:
+
+ version update
+
+2010-07-01 00:13 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2010-07-01 00:03 hardaker
+
+ * agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ snmplib/Makefile.depend:
+
+ make depend
+
+2010-06-30 23:55 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2010-06-30 23:48 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, python/netsnmp/tests/snmpd.conf:
+
+ Version number update
+
+2010-06-30 23:45 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ missed two tokens in the man pgaes
+
+2010-06-30 23:45 hardaker
+
+ * man/snmpcmd.1.def, man/snmpd.8.def,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/tls/SCipherTests, testing/fulltests/tls/SCrl,
+ testing/fulltests/tls/STlsAgentTrap,
+ testing/fulltests/tls/STlsServer,
+ testing/fulltests/tls/STlsServerSession,
+ testing/fulltests/tls/STlsTrapdUser,
+ testing/fulltests/tls/STlsUsers,
+ testing/fulltests/tls/STsmPrefix,
+ testing/fulltests/transports/Stlstests:
+
+ rename the defX509 tokens to something more friendly: clientCert
+ and serverCert
+
+2010-06-30 23:44 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ top-file comment updates
+
+2010-06-30 23:44 hardaker
+
+ * snmplib/cert_util.c:
+
+ don't call cert_find with a NULL argument
+
+2010-06-30 23:44 hardaker
+
+ * snmplib/cert_util.c:
+
+ allow def certs to be specified using a filename
+
+2010-06-30 23:41 tanders
+
+ * testing/fulltests/support/simple_run:
+
+ fix syntax error
+
+2010-06-30 23:01 hardaker
+
+ * snmplib/cert_util.c:
+
+ turn a couple of non-critical errors into debug statements per
+ discussion with rstory
+
+2010-06-30 23:00 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ make the regexp pattern match for tests to run case insensitive
+
+2010-06-30 23:00 hardaker
+
+ * python/netsnmp/client.py:
+
+ import stderr from sys, per discussion on -users
+
+2010-06-30 22:17 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ add back in the default port specifier
+
+2010-06-30 22:17 hardaker
+
+ * local/net-snmp-cert:
+
+ enable pulling the private key over http
+
+2010-06-30 22:17 hardaker
+
+ * local/net-snmp-cert:
+
+ move URL collection into a sub function
+
+2010-06-30 22:16 hardaker
+
+ * local/net-snmp-cert:
+
+ added ability to pull a cert from a URL
+
+2010-06-30 22:16 hardaker
+
+ * local/net-snmp-cert:
+
+ fix argument bug in the is_url function
+
+2010-06-30 20:49 hardaker
+
+ * apps/snmptls.c:
+
+ remove debugging code
+
+2010-06-30 20:27 hardaker
+
+ * testing/fulltests/tls/T117DtlsCNSession_simple,
+ testing/fulltests/tls/T117dtlsCNSession_simple:
+
+ rename file for consistency
+
+2010-06-30 20:01 rstory
+
+ * configure:
+
+ update for new snmptls app
+
+2010-06-30 20:00 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ remove accidentally checked int debug code
+
+2010-06-30 19:59 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h:
+
+ define OIDs based on SNMP_TLS_TM_BASE
+
+2010-06-30 19:59 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c:
+
+ auto-transistion between notReady/notInService
+
+2010-06-30 19:57 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h:
+
+ auto-transistion between notReady/notInService; add
+ snmp_store_needed on commit
+
+2010-06-30 19:56 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ use new fingerprint parse/build functions; remove bad length
+ check; auto
+ transition between notReady and notInService
+
+2010-06-30 19:55 rstory
+
+ * mibs/TLSTM-MIB.txt:
+
+ remove pre-rfc mib; see SNMP-TLS-TM-MIB.txt instead
+
+2010-06-30 19:54 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c:
+
+ consolidate multiple files
+
+2010-06-30 19:53 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ make hash type parse routine public; add routines to build/parse
+ SnmpTLSFingerprint
+
+2010-06-30 19:51 rstory
+
+ * Makefile.in, apps/Makefile.in, apps/snmptls.c,
+ configure.d/config_os_libs:
+
+ NEWS: snmptls: new app for managing (D)TLS config via
+ SNMP-TLS-TM-MIB tables
+
+2010-06-30 19:50 rstory
+
+ * agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/expression/expExpressionTable.c,
+ agent/mibgroup/disman/expression/expObjectTable.c,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c:
+
+ call new snmp_store_needed() function after a commit in tables
+ that
+ have persistent store
+
+2010-06-30 19:49 rstory
+
+ * include/net-snmp/library/snmp_client.h, snmplib/snmp_client.c:
+
+ NEWS: snmplib: new experimental simple state machine
+ NEWS: snmplib: new experimental row creation API which uses a
+ state machine
+ to try really hard to create a row from a given varbind list
+
+2010-06-30 19:48 rstory
+
+ * agent/snmp_agent.c, include/net-snmp/library/snmp_api.h,
+ snmplib/snmp_api.c:
+
+ NEWS: snmpd: new API for indicating that persistent store needs
+ to be saved after the current request finishes processing
+
+2010-06-30 19:46 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ add some new wrapper macros
+
+2010-06-30 15:59 hardaker
+
+ * testing/fulltests/tls/STlsCNSession,
+ testing/fulltests/tls/STlsSanSession,
+ testing/fulltests/tls/STlsServerSession,
+ testing/fulltests/tls/T115DtlsSanSession_simple,
+ testing/fulltests/tls/T116TlsSanSession_simple,
+ testing/fulltests/tls/T117dtlsCNSession_simple,
+ testing/fulltests/tls/T118TlsCNSession_simple:
+
+ added checks for checking direct passing of localhost to the
+ expected name
+
+2010-06-30 15:59 hardaker
+
+ * testing/fulltests/tls/STlsServer:
+
+ check for wildcard support
+
+2010-06-30 15:58 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ support SAN and CN wildcard matching per spec
+
+2010-06-30 15:00 hardaker
+
+ * testing/fulltests/tls/SCipherTests, testing/fulltests/tls/SCrl,
+ testing/fulltests/tls/STlsAgentTrap,
+ testing/fulltests/tls/STlsName, testing/fulltests/tls/STlsSan,
+ testing/fulltests/tls/STlsServer,
+ testing/fulltests/tls/STlsTrapdUser,
+ testing/fulltests/tls/STlsUsers, testing/fulltests/tls/STlsVars,
+ testing/fulltests/tls/STsmPrefix,
+ testing/fulltests/tls/ScipherTests,
+ testing/fulltests/tls/Scrltests,
+ testing/fulltests/tls/Stlsagenttraptests,
+ testing/fulltests/tls/Stlsnametests,
+ testing/fulltests/tls/Stlssantests,
+ testing/fulltests/tls/Stlsservertests,
+ testing/fulltests/tls/Stlstrapdusertests,
+ testing/fulltests/tls/Stlsuserstests,
+ testing/fulltests/tls/Stlsvars, testing/fulltests/tls/Stsmprefix,
+ testing/fulltests/tls/T101DtlsUser_simple,
+ testing/fulltests/tls/T101dtlsudpusertests_simple,
+ testing/fulltests/tls/T102TlsUser_simple,
+ testing/fulltests/tls/T102tlstcpusertests_simple,
+ testing/fulltests/tls/T111DtlsServer_simple,
+ testing/fulltests/tls/T111dtlsudpservertests_simple,
+ testing/fulltests/tls/T112TlsServer_simple,
+ testing/fulltests/tls/T112tlstcpservertests_simple,
+ testing/fulltests/tls/T113DtlsSan_simple,
+ testing/fulltests/tls/T113dtlsudpsan_simple,
+ testing/fulltests/tls/T114TlsSan_simple,
+ testing/fulltests/tls/T114tlstcpsan_simple,
+ testing/fulltests/tls/T121DtlsTrap_simple,
+ testing/fulltests/tls/T121dtlsudptraptests_simple,
+ testing/fulltests/tls/T122TlsTrap_simple,
+ testing/fulltests/tls/T122tlstcptraptests_simple,
+ testing/fulltests/tls/T131DtlsAgentTrap_simple,
+ testing/fulltests/tls/T131dtlsudpagenttraptests_simple,
+ testing/fulltests/tls/T132TlsAgentTrap_simple,
+ testing/fulltests/tls/T132tlstcpagenttraptests_simple,
+ testing/fulltests/tls/T141DtlsCrl_simple,
+ testing/fulltests/tls/T141dtlsudpcrl_simple,
+ testing/fulltests/tls/T142TlsCrl_simple,
+ testing/fulltests/tls/T142tlstcpcrl_simple,
+ testing/fulltests/tls/T151DtlsCiphers_simple,
+ testing/fulltests/tls/T151dtlsciphers_simple,
+ testing/fulltests/tls/T152TlsCiphers_simple,
+ testing/fulltests/tls/T152tlsciphers_simple,
+ testing/fulltests/tls/T200TlsIpv6_simple,
+ testing/fulltests/tls/T200tlsipv6_simple,
+ testing/fulltests/tls/T300TlsPerl.t,
+ testing/fulltests/tls/T300tlstcpperl.t,
+ testing/fulltests/tls/T301DtlsPerl.t,
+ testing/fulltests/tls/T301dtlsperl.t,
+ testing/fulltests/tls/T401DtlsTsmPrefix_simple,
+ testing/fulltests/tls/T401dtlstsmprefix_simple,
+ testing/fulltests/tls/T402TlsTsmPrefix_simple,
+ testing/fulltests/tls/T402tlstsmprefix_simple:
+
+ moved test files around for better naming
+
+2010-06-30 14:58 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ copy dtls transport address to the expected hostname
+
+2010-06-30 14:58 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ set the expected hostname from the transport string if possible
+
+2010-06-30 14:58 hardaker
+
+ * local/net-snmp-cert:
+
+ a bit more help output by default
+
+2010-06-29 22:29 tanders
+
+ * apps/snmptrapd_auth.c:
+
+ Follow-up for r19116: make sure we include agent config
+
+2010-06-29 22:18 magfr
+
+ * agent/mibgroup/host/hr_print.h,
+ agent/mibgroup/if-mib/data_access/interface.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.h,
+ agent/mibgroup/ucd-snmp/extensible.h:
+
+ Add missing config_requires
+
+2010-06-29 17:33 hardaker
+
+ * man/snmpcmd.1.def:
+
+ rework the snmpcmd manual page to separate out the flags into
+ sections appropriate for their usage type
+
+2010-06-29 16:51 marz
+
+ * local/net-snmp-cert:
+
+ pod docs, some default val fixes, info output normalized
+
+2010-06-29 16:32 hardaker
+
+ * agent/mibgroup/target/target.c:
+
+ added ssh.h include
+
+2010-06-29 16:27 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ reorganize the manual page a bit for SNMPv3 and TLS
+
+2010-06-29 16:27 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix default tls registrations
+
+2010-06-29 16:26 hardaker
+
+ * agent/snmp_agent.c:
+
+ check for NULL transports after an open fails
+
+2010-06-29 16:26 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ moving logging around so that openssl errors are printed on
+ failures
+
+2010-06-29 16:26 hardaker
+
+ * testing/fulltests/tls/Scrltests,
+ testing/fulltests/tls/Stsmprefix:
+
+ fix some non-interactive invocation issues
+
+2010-06-29 16:26 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ move some common code into a common function
+
+2010-06-28 19:13 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/tls/ScipherTests,
+ testing/fulltests/tls/T151dtlsciphers_simple,
+ testing/fulltests/tls/T152tlsciphers_simple:
+
+ cipher suite selection and tests for it
+
+2010-06-28 19:12 hardaker
+
+ * python/LICENSE:
+
+ license updates
+
+2010-06-28 19:12 hardaker
+
+ * python/README, python/netsnmp/client.py,
+ python/netsnmp/client_intf.c:
+
+ SNMPv3 over TLS support
+
+2010-06-28 19:12 hardaker
+
+ * python/netsnmp/tests/test.py:
+
+ better output showing test types
+
+2010-06-28 00:54 tanders
+
+ * man/mib_api.3.def, man/netsnmp_agent.3, man/netsnmp_container.3,
+ man/netsnmp_example_scalar_int.3, man/netsnmp_handler.3,
+ man/netsnmp_library.3, man/netsnmp_mib_utilities.3,
+ man/netsnmp_table.3, man/snmpcmd.1.def, man/snmptrapd.conf.5.def:
+
+ CHANGES: man: clean up manual pages
+ (from Debian patch 56_manpage)
+
+2010-06-27 23:29 tanders
+
+ * apps/snmptrapd.c, apps/snmptrapd_auth.c:
+
+ CHANGES: build: Do not call vacm_standard_views() or
+ init_vacm_config_tokens() if the corresponding module was not
+ compiled
+ (from Debian patch 61_vacm_missing_dependency_check)
+
+2010-06-27 03:23 marz
+
+ * local/net-snmp-cert:
+
+ fix app tag completions
+
+2010-06-27 00:56 marz
+
+ * local/net-snmp-cert, local/net-snmp-cert.conf:
+
+ handle config file setting interactive, true/false values handled
+ in config
+
+2010-06-26 20:58 marz
+
+ * local/net-snmp-cert:
+
+ fix some bugs w/ spaces in names and app tag help
+
+2010-06-26 19:38 marz
+
+ * testing/fulltests/tls/S300tlsperl.pl,
+ testing/fulltests/tls/Stlsvars,
+ testing/fulltests/transports/Stlstests:
+
+ fix tests to use non-interactive -I
+
+2010-06-26 17:46 marz
+
+ * local/certgen-test.pl, local/net-snmp-cert:
+
+ better interactive, ?=help, <tab> compl, more help, SAN loop
+ format and termination fix, tolerate spaces in fields and
+ filenames, more complete error output, embryonic import from url
+
+2010-06-26 13:48 bvassche
+
+ * snmplib/snmp_transport.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ More compiler warning fixes.
+
+2010-06-26 13:47 bvassche
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Fixed the errors in acconfig.h and regenerated
+ net-snmp-config.h.in.
+
+2010-06-26 13:44 bvassche
+
+ * agent/mibgroup/smux/smux.c:
+
+ Fixed compiler warnings triggered by SMUX MIB implementation.
+
+2010-06-26 00:45 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/tls/Stlssantests,
+ testing/fulltests/tls/T113dtlsudpsan_simple,
+ testing/fulltests/tls/T114tlstcpsan_simple:
+
+ fixes and testing for checking SAN DNS names from the server
+
+2010-06-26 00:44 hardaker
+
+ * testing/fulltests/tls/Stlsnametests,
+ testing/fulltests/tls/Stlsservertests,
+ testing/fulltests/tls/T111dtlsudpservertests_simple,
+ testing/fulltests/tls/T112tlstcpservertests_simple:
+
+ genericize the server name tests
+
+2010-06-25 23:01 hardaker
+
+ * agent/mibgroup/tsm-mib.h,
+ agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.c,
+ agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.h,
+ snmplib/snmptsm.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ testing/fulltests/tls/Scrltests,
+ testing/fulltests/tls/Stsmprefix,
+ testing/fulltests/tls/T401dtlstsmprefix_simple,
+ testing/fulltests/tls/T402tlstsmprefix_simple:
+
+ useprefix scalar testing and support
+
+2010-06-25 23:01 hardaker
+
+ * testing/fulltests/tls/Scrltests:
+
+ remove debugging lines
+
+2010-06-25 23:00 hardaker
+
+ * testing/fulltests/tls/Scrltests:
+
+ put in only minimial debug flags
+
+2010-06-25 23:00 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/cert_util.c, snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/tls/Scrltests,
+ testing/fulltests/tls/T141dtlsudpcrl_simple,
+ testing/fulltests/tls/T142tlstcpcrl_simple:
+
+ code and test cases for CRL handling
+
+2010-06-25 15:24 bvassche
+
+ * testing/fulltests/default/T060trapdperl_simple:
+
+ Added a newline at the end of each line printed by the Perl
+ interpreter.
+
+2010-06-25 13:08 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ reduce number of resend attempts and timeout
+
+2010-06-25 13:08 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h, snmplib/cert_util.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ warning fixes
+
+2010-06-25 13:08 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ remove logic typo from previous commit
+
+2010-06-25 13:08 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ testing/fulltests/tls/T200tlsipv6_simple:
+
+ IPv6 fixes for TCP
+
+2010-06-25 13:01 jsafranek
+
+ * snmplib/snmp_api.c:
+
+ Reverting 19095, it breaks tests
+
+2010-06-25 09:40 jsafranek
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmptranslate: fixed printing of ranges with UNSIGNED
+ type.
+
+2010-06-24 23:55 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix function names for stat increases
+
+2010-06-24 23:52 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ fix errors in comments
+
+2010-06-24 23:44 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ comments for 5.4 for dtls
+
+2010-06-24 23:44 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ comments for 5.3.2
+
+2010-06-24 23:43 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ client side connect comments
+
+2010-06-24 23:43 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ counter and comment improvements
+
+2010-06-24 23:43 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ update counter calls and comment text
+
+2010-06-24 19:03 bvassche
+
+ * testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T115agentxperl_simple,
+ testing/fulltests/support/simple_TESTCONF.sh:
+
+ Moved LD_LIBRARY_PATH setup from individual tests scripts to
+ simple_TESTCONF.sh.
+
+2010-06-24 19:02 bvassche
+
+ * testing/fulltests/support/simple_run:
+
+ Fixed a comment.
+
+2010-06-24 17:48 bvassche
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h:
+
+ Should have been included in r19084.
+
+2010-06-24 17:47 bvassche
+
+ * snmplib/cert_util.c, snmplib/snmp_transport.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ Fixed several recently introduced compiler warnings.
+
+2010-06-24 12:30 tanders
+
+ * configure, configure.d/config_os_progs:
+
+ "test -e" isn't portable; use "test -x" instead for the Perl
+ system()
+ check
+
+2010-06-23 11:14 jsafranek
+
+ * agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c:
+
+ CHANGES: snmpd: fixed value of IP-MIB::ipv6InterfaceForwarding on
+ Linux
+
+ The value was 0 (not forwarding) or 1 (forwarding), should be 2
+ and 1
+ instead - netsnmp_interface_entry.forwarding_v6 is boolean, not
+ TruthValue.
+
+2010-06-22 23:06 hardaker
+
+ * snmplib/cert_util.c, testing/fulltests/tls/Stlsuserstests:
+
+ support for certSecName mapping from a local cert file name and a
+ test for it
+
+2010-06-22 22:44 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ documenation update to clean up and include TLS parameters
+
+2010-06-22 22:44 hardaker
+
+ * perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs:
+
+ support for passing identities and full working version
+
+2010-06-22 22:44 hardaker
+
+ * testing/fulltests/tls/S300tlsperl.pl,
+ testing/fulltests/tls/T300tlstcpperl.t,
+ testing/fulltests/tls/T301dtlsperl.t:
+
+ perl TLS/DTLS tests
+
+2010-06-22 22:43 hardaker
+
+ * perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs:
+
+ first ptach on SNMP/TLS creating a new session function
+
+2010-06-22 22:43 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ first working support for a delayed close() to attempt to sending
+ outstanding packets in the queue; this is required for snmptrap
+ to work at all when sending traps (not informs) over DTLS
+
+2010-06-22 19:03 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_simple,
+ testing/fulltests/default/T065agentextend_simple,
+ testing/fulltests/support/simple_TESTCONF.sh:
+
+ CHANGES: MinGW: tests T059traphandle_simple and
+ T065agentextend_simple do now pass.
+
+2010-06-22 19:01 bvassche
+
+ * apps/snmpnetstat/inet6.c:
+
+ The width argument for %.*d must have type int, not size_t. This
+ bug was introduced in r19014.
+
+2010-06-22 18:57 bvassche
+
+ * agent/mibgroup/utilities/execute.c:
+
+ NEWS: MinGW: the snmpd.conf keyword extend does now work.
+ NEWS: MinGW: the snmptrapd.conf keyword traphandle does now work.
+ CHANGES: MinGW: run_shell_command() with either input or output
+ (but not both) does now work.
+ This did not work until now because on MinGW mkstemp() generates
+ a MinGW-style path (/tmp/...) while system() invokes cmd.exe and
+ hence expects a Windows-style path (C:\...).
+
+2010-06-22 17:39 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ Also report the port specification if [ $SNMP_VERBOSE -gt 0 ].
+
+2010-06-22 17:38 bvassche
+
+ * testing/fulltests/default/T053agentv1trap_simple,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T100agenthup_simple,
+ testing/fulltests/default/T115agentxperl_simple:
+
+ Replaced an explicit test for MinGW by a test on HAVE_SIGHUP.
+
+2010-06-22 17:36 bvassche
+
+ * configure, configure.d/config_os_misc4,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Added configure test for SIGHUP.
+
+2010-06-22 17:35 bvassche
+
+ * testing/RUNTESTS:
+
+ Report which tests failed, if any.
+
+2010-06-22 08:37 bvassche
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Fixed an error in a comment block.
+
+2010-06-21 19:26 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_simple:
+
+ Rearranged the implementation of this test such that it is no
+ longer necessary
+ to invoke simple_eval_tools.sh when this script is invoked as a
+ trap handler
+ by snmptrapd.
+
+2010-06-21 08:01 dts12
+
+ * snmplib/large_fd_set.c:
+
+ Ensure that fdset structure is resized sufficiently
+ to accomodate the specified socket ID.
+ Problem reported by Shiyalei.
+
+2010-06-20 19:32 dts12
+
+ * snmplib/cert_util.c, snmplib/cmu_compat.c, snmplib/pkcs.c,
+ snmplib/snprintf.c:
+
+ Avoid duplicate (unused) symbols.
+
+2010-06-20 19:31 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_simple:
+
+ Commented out debug code.
+
+2010-06-20 19:30 bvassche
+
+ * testing/RUNTESTS, testing/fulltests/support/simple_run:
+
+ Restored summary success/failure count reporting.
+ Also, moved kill.exe test back to RUNTESTS.
+
+2010-06-20 19:29 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ CHANGES: testing: add the test name to the start of the file
+ "invoked".
+
+2010-06-20 19:27 bvassche
+
+ * testing/fulltests/default/T053agentv1trap_simple,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T100agenthup_simple,
+ testing/fulltests/default/T115agentxperl_simple:
+
+ CHANGES: MinGW: testing: skip the tests that require SIGHUP since
+ MinGW does not support SIGHUP.
+
+2010-06-20 15:19 bvassche
+
+ * configure, configure.d/config_os_progs, testing/Makefile.in:
+
+ Added a configure test that detects whether or not Perl's
+ system() function
+ invokes a POSIX shell. "make test" does now fall back to RUNTESTS
+ if not.
+
+2010-06-20 15:16 bvassche
+
+ * snmplib/snmp_transport.c, snmplib/transports/snmpAliasDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ snmplib/transports/snmpSocketBaseDomain.c,
+ snmplib/transports/snmpTCPBaseDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c:
+
+ Builds again on MinGW -- added #include <net-snmp/types.h> where
+ necessary.
+ Note: although <net-snmp/types.h> is included indirectly from the
+ * *transport.h header files, these #include statements are
+ necessary because of a pesky circular dependence between
+ <net-snmp/types.h> and <net-snmp/library/snmp_api.h>.
+ 2010-06-20 15:12 bvassche
+
+
+ * testing/fulltests/support/simple_run:
+
+ CHANGES: MinGW: refuse to run the regression tests if kill.exe
+ cannot be found.
+
+2010-06-20 15:11 bvassche
+
+ * testing/RUNTESTS:
+
+ Shortened the srcdir path by making sure that it does not contain
+ /..
+
+2010-06-19 18:30 bvassche
+
+ * testing/RUNFULLTESTS:
+
+ Added support for running RUNFULLTESTS with Test::Harness in
+ another directory than the source directory.
+
+2010-06-19 16:41 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h:
+
+ complete rewrite of params to use table_dataset instead of
+ create-dataset
+
+2010-06-19 16:41 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c:
+
+ use text for hash type in persistent store
+
+2010-06-19 16:40 rstory
+
+ * agent/mibgroup/Rmon/rows.c,
+ agent/mibgroup/examples/ucdDemoPublic.c:
+
+ quiet compiler warnings
+
+2010-06-19 16:40 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix missing specifier in debug
+
+2010-06-19 16:39 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ use define instead of constant; fix check for rows to save
+
+2010-06-19 16:39 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ add remove/find function for maps/addrs/params; rename params
+ tag->name;
+ destroy -> free; group recent trust functions together in src;
+ don't store
+ params fp as binary; hand text args for hash type (e.g --sha1)
+
+2010-06-18 15:35 bvassche
+
+ * agent/mibgroup/mibII/at.c:
+
+ CHANGES: Cygwin: corrected error handling in mibII/at.
+
+2010-06-18 07:23 bvassche
+
+ * include/net-snmp/library/snmp_api.h:
+
+ Fixed a compiler warning.
+
+2010-06-18 01:42 magfr
+
+ * snmplib/keytools.c:
+
+ Do not define ret twice when NETSNMP_USE_INTERNAL_CRYPTO is set.
+
+2010-06-18 01:39 magfr
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ Corrected typo.
+
+2010-06-18 00:31 hardaker
+
+ * CHANGES, NEWS:
+
+ better NEWS and CHANGES files
+
+2010-06-17 20:39 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2010-06-17 20:31 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2010-06-17 18:59 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2010-06-17 18:55 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-06-17 18:54 hardaker
+
+ * Makefile.top:
+
+ version update
+
+2010-06-17 18:39 hardaker
+
+ * dist/makerelease.xml:
+
+ re-enable some commands
+
+2010-06-17 17:46 hardaker
+
+ * testing/fulltests/tls/Stlsvars:
+
+ forgot missing quotes in SET output
+
+2010-06-17 17:46 hardaker
+
+ * testing/fulltests/tls/Stlsagenttraptests,
+ testing/fulltests/tls/Stlsvars:
+
+ tls testing cleanup
+
+2010-06-17 17:45 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ more fixes for address printing; more to come
+
+2010-06-17 17:45 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ mostly properly set remote/local transport parameters
+
+2010-06-17 17:45 hardaker
+
+ * testing/fulltests/tls/Stlsagenttraptests,
+ testing/fulltests/tls/T131dtlsudpagenttraptests_simple,
+ testing/fulltests/tls/T132tlstcpagenttraptests_simple:
+
+ tests for agents sending of traps over (D)TLS
+
+2010-06-17 17:45 hardaker
+
+ * testing/fulltests/tls/Stlsvars,
+ testing/fulltests/tls/T101dtlsudpusertests_simple,
+ testing/fulltests/tls/T102tlstcpusertests_simple,
+ testing/fulltests/tls/T111dtlsudpservertests_simple,
+ testing/fulltests/tls/T112tlstcpservertests_simple,
+ testing/fulltests/tls/T121dtlsudptraptests_simple,
+ testing/fulltests/tls/T122tlstcptraptests_simple:
+
+ move export statements to the support file for simplicity
+
+2010-06-17 17:44 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ move tls bootstrapping to post_premib so other config tokens can
+ use the cert loading results
+
+2010-06-17 17:44 hardaker
+
+ * testing/fulltests/unit-tests/T004snmp_enum_clib.c:
+
+ added snmp_enum tests pulled from the main() test at the bottom
+ of the original .c file
+
+2010-06-17 16:00 dts12
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ Eliminate "differ in signedness" warning
+
+2010-06-17 00:14 hardaker
+
+ * snmplib/transports/snmpUDPBaseDomain.c:
+
+ revert UDP changes from r18984 since it broke the UDP transport;
+ the struct probably needs to match another struct somewhere else
+
+2010-06-16 23:26 hardaker
+
+ * snmplib/cert_util.c:
+
+ add a new KEYWORD output for debugging purposes
+
+2010-06-16 23:26 hardaker
+
+ * agent/agent_trap.c:
+
+ use config_and_open for opening the transport
+
+2010-06-16 23:26 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ extra debugging statements
+
+2010-06-16 22:14 hardaker
+
+ * testing/fulltests/tls/Stlsuserstests:
+
+ explicitly declare trust certificates to transport
+
+2010-06-16 22:14 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ cleanup some lost memory on closing
+
+2010-06-16 21:56 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix typos
+
+2010-06-16 21:34 dts12
+
+ * agent/agent_registry.c, agent/helpers/row_merge.c,
+ agent/helpers/table.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/agent/extend.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ip_scalars.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/pass.c, agent/mibgroup/ucd-snmp/proxy.c,
+ agent/snmp_agent.c:
+
+ Eliminate (most) "signed and unsigned comparison" warnings from
+ agent code [-Wsign-compare]
+
+2010-06-16 20:16 dts12
+
+ * snmplib/asn1.c, snmplib/check_varbind.c,
+ snmplib/container_binary_array.c, snmplib/dir_utils.c,
+ snmplib/keytools.c, snmplib/large_fd_set.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/scapi.c, snmplib/snmp_api.c,
+ snmplib/snmp_client.c, snmplib/snmpusm.c, snmplib/snmpv3.c,
+ snmplib/text_utils.c, snmplib/vacm.c:
+
+ Eliminate (most) "signed and unsigned comparison" warnings from
+ library code [-Wsign-compare]
+
+2010-06-16 19:36 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ remove older no-longer-needed-duplicate-config entries
+
+2010-06-16 19:14 dts12
+
+ * snmplib/vacm.c:
+
+ Fix processing of view masks (misplaced parentheses)
+
+2010-06-16 18:45 dts12
+
+ * apps/agentxtrap.c, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmptable.c, apps/snmptrapd_log.c, apps/snmpusm.c:
+
+ Eliminate "signed and unsigned comparison" from app code
+ [-Wsign-compare]
+
+2010-06-16 17:22 hardaker
+
+ * testing/fulltests/tls/Stlstrapdusertests:
+
+ check for informs sent over tls transports
+
+2010-06-16 17:22 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ copy other valuse from parent tlsbase data
+
+2010-06-16 17:21 hardaker
+
+ * testing/fulltests/tls/Stlstrapdusertests,
+ testing/fulltests/tls/Stlsvars,
+ testing/fulltests/tls/T121dtlsudptraptests_simple,
+ testing/fulltests/tls/T122tlstcptraptests_simple:
+
+ added basic trap sending and receiving tests
+
+2010-06-16 17:21 hardaker
+
+ * testing/fulltests/tls/Stlsuserstests:
+
+ remove no longer needed temp file touches
+
+2010-06-16 17:20 hardaker
+
+ * agent/snmp_agent.c, include/net-snmp/library/snmp_transport.h,
+ snmplib/cert_util.c, snmplib/snmp_api.c:
+
+ added a new function and transport flag to indicate if the f_open
+ call has been called yet
+
+2010-06-16 17:20 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ unused var warning cleanup
+
+2010-06-16 17:19 hardaker
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ added trustCert configuration token
+
+2010-06-16 17:19 hardaker
+
+ * testing/fulltests/tls/Stlsuserstests:
+
+ minor tweaks for testing clarity
+
+2010-06-16 17:18 hardaker
+
+ * testing/fulltests/tls/Stlsuserstests,
+ testing/fulltests/tls/T101dtlsudpusertests_simple,
+ testing/fulltests/tls/T102tlstcpusertests_simple,
+ testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests,
+ testing/fulltests/transports/T360dtlsudp_simple,
+ testing/fulltests/transports/T361tlstcp_simple:
+
+ moved complex (D)TLS to a separate section and made the transport
+ tests only test minimal support
+
+2010-06-16 17:17 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ add mechanisms for specifying and expecting the hostname of the
+ far side
+
+2010-06-16 17:17 hardaker
+
+ * testing/fulltests/tls/Stlsservertests,
+ testing/fulltests/tls/Stlsvars:
+
+ tests for verifying server certificate check failures
+
+2010-06-16 17:17 hardaker
+
+ * testing/fulltests/tls, testing/fulltests/tls/Stlsservertests,
+ testing/fulltests/tls/Stlsvars,
+ testing/fulltests/tls/T111dtlsudpservertests_simple,
+ testing/fulltests/tls/T112tlstcpservertests_simple:
+
+ testing for checking client side verification of server
+ certificates
+
+2010-06-16 17:16 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h:
+
+ setup for a hostname config option
+
+2010-06-16 17:16 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ setup for a hostname config option
+
+2010-06-16 17:15 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ check to make suer ssl pointer has been created via f_open call
+
+2010-06-16 15:02 dts12
+
+ * agent/snmp_perl.h, apps/snmptrapd.c:
+
+ Declare 'shutdown_perl' properly.
+
+2010-06-16 14:37 dts12
+
+ * agent/snmpd.c, snmplib/keytools.c, snmplib/lcd_time.c:
+
+ Eliminate "signed and unsigned type in conditional expression"
+ warnings [-Wsign-compare]
+
+2010-06-16 14:27 dts12
+
+ * agent/mibgroup/target/target.c:
+
+ Eliminate "unused variable" warning
+
+2010-06-16 14:22 dts12
+
+ * agent/helpers/old_api.c, agent/helpers/row_merge.c,
+ agent/helpers/table_dataset.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/snmpd.c, snmplib/transports/snmpUDPBaseDomain.c:
+
+ Eliminate various "implicit conversion" warnings [-Wc++-compat]
+
+2010-06-16 13:13 dts12
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/data_access/scalars_linux.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ apps/snmpvacm.c, snmplib/tools.c:
+
+ Eliminate (most) signed-vs-unsigned warnings from numeric scanf
+ processing [-pedantic]
+
+2010-06-16 03:28 rstory
+
+ * agent/helpers/table_tdata.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+ agent/mibgroup/ip-mib/data_access/arp_common.c,
+ agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_common.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+ snmplib/container.c:
+
+ the great un-named container hunt
+
+2010-06-16 03:27 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ share cache between table and count scalar; when reading config,
+ add to
+ library containers for active rows, table containers for inactive
+ rows;
+ user cert_util apis instead of direct container manipulation;
+ when
+ saving inactive map rows, skip all but nonVolatile
+
+2010-06-16 03:26 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ fix debug token typo
+
+2010-06-16 03:25 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ add api for adding entries to tltsm addr, params and cert map
+ containers;
+ register se slist pair earlier so they are available during
+ config parsing;
+ make sure config strings are null terminated
+
+2010-06-15 21:42 dts12
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ Suppress warnings:
+ 'struct nlmsghdr defined inside parameter list' and
+ 'function _load_v6 declared but never defined'
+
+2010-06-15 21:30 dts12
+
+ * agent/kernel.c, apps/snmptrapd_sql.c, snmplib/cert_util.c,
+ snmplib/cmu_compat.c, snmplib/pkcs.c, snmplib/snprintf.c:
+
+ Eliminate "empty translation unit" warnings [-pedantic]
+
+2010-06-15 07:07 magfr
+
+ * testing/fulltests/unit-tests/T003copy_nword_clib.c:
+
+ Add test of copy_nword
+
+2010-06-14 21:32 dts12
+
+ * agent/mibgroup/disman/event/mteEvent.h,
+ agent/mibgroup/disman/event/mteTrigger.h,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/disman/schedule/schedCore.c:
+
+ Eliminate "overflow in implicit constant conversion" warnings
+ [-Wc++-compat]
+
+2010-06-14 15:51 dts12
+
+ * agent/snmpd.c, apps/encode_keychange.c, snmplib/read_config.c:
+
+ Eliminate "string length greater than 509" warnings [-pedantic]
+
+2010-06-14 15:19 dts12
+
+ * snmplib/transports/snmpUDPBaseDomain.c:
+
+ Eliminate "initializer element is not computable" warnings
+ [-pedantic]
+
+2010-06-14 05:27 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ update count handlers to count non-active rows too
+
+2010-06-14 05:12 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ only tweak storageType for active rows; reset entry flags when
+ removing from
+ cert_util maps; when createing rows from cert_util maps, set
+ stragetType to
+ volatile if nonVolatile flag not set; dont free cache in
+ cache_load on err
+
+2010-06-14 05:10 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c:
+
+ move tlstmAddr table config parsing to cert_util; add cache to
+ merge cert_util
+ addrs (active) and non-active rows;
+
+2010-06-14 05:10 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ add nonVolatile flag to tlstmAddr table; set container name; skip
+ '0x' in fp
+
+2010-06-14 05:09 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ change LOG_ERR to LOG_INFO for non-error log msg
+
+2010-06-13 21:02 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.c,
+ agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c,
+ local/mib2c-conf.d/mfd-interface.m2c:
+
+ Eliminate (most) "implicit conversion" warnings from
+ MfD-based MIB module code, and MfD template [-Wc++-compat]
+
+2010-06-12 21:33 dts12
+
+ * agent/mibgroup/agent/extend.c,
+ agent/mibgroup/disman/event/mteEventConf.c,
+ agent/mibgroup/disman/event/mteObjectsConf.c,
+ agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/expr/expExpressionConf.c,
+ agent/mibgroup/disman/expr/expObjectConf.c,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/hardware/cpu/cpu_perfstat.c,
+ agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/fsys/fsys_getfsstats.c,
+ agent/mibgroup/hardware/memory/memory_linux.c,
+ agent/mibgroup/hardware/memory/memory_solaris.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/hr_disk.c, agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/ucd-snmp/disk.c, agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/utilities/override.c:
+
+ Eliminate (most) "implicit conversion" warnings from (non-MfD)
+ MIB module code. [-Wc++-compat]
+
+2010-06-12 10:26 dts12
+
+ * agent/agent_handler.c, agent/agent_index.c,
+ agent/agent_registry.c, agent/agent_sysORTable.c,
+ agent/helpers/baby_steps.c, agent/helpers/cache_handler.c,
+ agent/helpers/mode_end_call.c, agent/helpers/row_merge.c,
+ agent/helpers/scalar.c, agent/helpers/stash_cache.c,
+ agent/helpers/table_array.c, agent/helpers/table_container.c,
+ agent/helpers/table_dataset.c, agent/helpers/table_iterator.c,
+ agent/helpers/table_tdata.c, agent/helpers/watcher.c,
+ agent/snmp_agent.c, apps/snmptrapd.c, apps/snmptrapd_log.c,
+ snmplib/dir_utils.c, snmplib/file_utils.c,
+ snmplib/large_fd_set.c, snmplib/snmp_api.c:
+
+ Eliminate (most) "implicit conversion" warnings from library,
+ apps and agent framework+helpers code. [-Wc++-compat]
+
+2010-06-10 20:01 rstory
+
+ * agent/mibgroup/target/target.c:
+
+ lookup cert keys for tls domains; use SEC_MODEL define instead of
+ hardcoded
+ constant; add SEC_MODEL_TSM to allowed sec models for mpModel
+ SNMP_VERSION_3
+
+2010-06-10 20:00 rstory
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ default to readOnly/active for bad config
+
+2010-06-10 20:00 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ add debug; switch to SEC_MODEL_TSM and warn if other secmode set,
+ instead
+ of simply logging that it won't work
+
+2010-06-10 19:59 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ check ptrs before dereference
+
+2010-06-10 19:58 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ move snmpTlstmAddrTable data management to cert_util; implement
+ TARGET_ADDR
+ and TARGET_PARAMS lookup in cert API
+
+2010-06-10 19:47 rstory
+
+ * snmplib/snmp_api.c:
+
+ update sec model define missed in earlier checkin
+
+2010-06-10 19:46 rstory
+
+ * agent/agent_trap.c:
+
+ config trapsess transports on creation; simplify ifdefs for
+ DISABLE_SNMPV1
+
+2010-06-10 19:46 rstory
+
+ * include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmpusm.h, snmplib/snmpksm.c,
+ snmplib/snmptsm.c, snmplib/transports/snmpTLSBaseDomain.c:
+
+ auto switch to v3 for (d)tls sessions instead of logging that
+ others wont
+ work; define TSM sec model with other sec models; consistently
+ use
+ SNMP_SEC_MODEL_* in the code, using #defines for backwards
+ compatibility
+ w/*_SECURITY_MODEL
+
+2010-06-10 19:46 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+ include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ certToTSN: move mib related persistence back into mib module;
+ cert_util: add tlstmParams persistence; use slist for cert map
+ type name
+ mapping;
+
+2010-06-10 19:45 rstory
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix compiler warning (const)
+
+2010-06-10 04:58 magfr
+
+ * agent/agent_handler.c:
+
+ Add missing indentation of a do-while loop to make the code
+ readable.
+
+2010-06-09 22:57 hardaker
+
+ * local/net-snmp-cert:
+
+ comment out keyUsage so proper self-signed certs are generated
+
+2010-06-09 22:57 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ solidify certificate acceptance for the client side
+
+2010-06-09 22:57 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix array typo
+
+2010-06-09 22:56 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ log openssl errors on accept failure
+
+2010-06-09 22:56 hardaker
+
+ * snmplib/snmp_api.c:
+
+ register default ports for tls/dtls
+
+2010-06-09 22:56 hardaker
+
+ * snmplib/cert_util.c:
+
+ do proper STORE loading of trusted certificates rather than file
+ based loading
+
+2010-06-09 22:56 hardaker
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ added two new APIs: netsnmp_cert_trust and netsnmp_cert_trust_ca
+
+2010-06-09 22:55 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ added straight 'tls' transport name
+
+2010-06-09 22:55 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ added straight 'dtls' transport name
+
+2010-06-08 21:05 magfr
+
+ * agent/Makefile.in:
+
+ Install agent_read_config.h in 5.6 as well. It disappeared in
+ r18843.
+
+2010-06-08 09:25 dts12
+
+ * agent/mibgroup/hardware/fsys/hw_fsys.h,
+ agent/mibgroup/host/hrh_filesys.c,
+ agent/mibgroup/ucd-snmp/disk_hw.c:
+
+ Remove (or activate) unused variables.
+ Fix misnamed function declaration.
+
+2010-06-08 07:11 dts12
+
+ * include/net-snmp/agent/hardware/fsys.h:
+
+ API changes for preliminary HAL_based implementation of UCD disk
+ module.
+ (Omitted from revision 18932 checkin)
+
+2010-06-08 04:18 rstory
+
+ * agent/Makefile.in:
+
+ update makefile for moved helper headers
+
+2010-06-07 20:18 jsafranek
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Reverting rev. 17616, the necessary check is already in rev.
+ 17415.
+
+2010-06-06 03:45 magfr
+
+ * configure, configure.d/config_project_paths:
+
+ CHANGES: building: In case exec_prefix is unset then set it to
+ '${prefix}' in order to pick up overrides of $prefix in make
+ install.
+
+2010-06-04 04:06 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ do a better job of verifying fingerprints of remote servers
+ pulling fingerprints from a number of possible places
+
+2010-06-04 04:05 hardaker
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ go ahead and log output file for easier debugging in errors
+
+2010-06-04 04:05 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ fix typo
+
+2010-06-04 04:05 hardaker
+
+ * snmplib/scapi.c:
+
+ remove comment about random being inadequate; we're doing the
+ best we can based on what we have
+
+2010-06-04 04:04 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ use another user for testing snmpapp default certificate
+
+2010-06-04 04:04 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ run a default test without a local key to ensure the snmpapp type
+ is picked up
+
+2010-06-04 04:04 hardaker
+
+ * snmplib/cert_util.c:
+
+ add a special case for the local identity and pull it from a
+ filename of the init_snmp() registered type name
+
+2010-06-04 04:03 hardaker
+
+ * testing/fulltests/support/NetSNMPTest.pm:
+
+ doc update
+
+2010-06-04 04:03 hardaker
+
+ * testing/fulltests/perl/T105unix.t:
+
+ unix socket test
+
+2010-06-04 04:03 hardaker
+
+ * testing/fulltests/perl/T103udp6.t,
+ testing/fulltests/perl/T104tcp6.t:
+
+ ipv6 tests
+
+2010-06-04 04:02 hardaker
+
+ * testing/fulltests/perl/T101udp.t,
+ testing/fulltests/perl/T102tcp.t:
+
+ mention test name is IPv4
+
+2010-06-04 04:02 hardaker
+
+ * testing/fulltests/perl/T101udp.t,
+ testing/fulltests/perl/T102tcp.t:
+
+ check that transport was configured
+
+2010-06-04 04:02 hardaker
+
+ * testing/fulltests/support/NetSNMPTest.pm:
+
+ add support for net-snmp-config.h checks
+
+2010-06-04 04:01 hardaker
+
+ * testing/fulltests/perl/NetSNMPTestTransport.pm,
+ testing/fulltests/perl/T101udp.t,
+ testing/fulltests/perl/T102tcp.t:
+
+ some basic transport checking for perl: udp and tcp
+
+2010-06-04 04:01 hardaker
+
+ * testing/fulltests/perl, testing/fulltests/perl/T001basic.t:
+
+ basic tests for perl
+
+2010-06-04 04:01 hardaker
+
+ * testing/fulltests/support/NetSNMPTest.pm:
+
+ infrastructure module for testing perl support
+
+2010-06-03 15:56 dts12
+
+ * dist/makerelease.xml:
+
+ Point LIB{CURRENT,AGE,REVISION} documentation to the correct
+ file.
+ Warn about 'makedepend' picking up testing module code.
+ Emphasis update of 'download.html' page
+ Mention update of Official Patches
+ Suppress broken commands
+
+2010-06-03 15:16 dts12
+
+ * agent/mibgroup/ucd-snmp/disk_hw.c,
+ agent/mibgroup/ucd-snmp/disk_hw.h, agent/mibgroup/ucd_snmp.h:
+
+ Preliminary HAL_based implementation of UCD disk module.
+ Ensures consistent reporting between UCD and HostRes FSys usage
+ and extends 'skipNFSInHostResources' config to UCD disk stats.
+
+2010-06-03 15:13 dts12
+
+ * agent/mibgroup/hardware/fsys/hw_fsys.c:
+
+ Fix broken size calculations.
+ Support 64-bit size/usage values.
+
+2010-06-02 14:52 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ use --with-ca instead of --ca
+
+2010-06-02 14:51 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ use the new -brief option for fingerprint capturing
+
+2010-06-02 14:40 marz
+
+ * local/net-snmp-cert:
+
+ fix --with-ca handling, fix CA newcerts bookkeeping
+
+2010-06-02 10:57 jsafranek
+
+ * agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/utilities/override.c:
+
+ CHANGES: snmpd: fixed potential buffer overflow in parsing OIDs
+ in config files.
+
+2010-06-02 00:24 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ check that CA certificates created after snmpd starts are still
+ usable; check all output fingerprints to ensure they were
+ properly created
+
+2010-06-02 00:23 hardaker
+
+ * local/net-snmp-cert:
+
+ add missing directory and file suffix to ca invocations
+
+2010-06-02 00:21 hardaker
+
+ * testing/fulltests/transports/Stls:
+
+ check that certificate output fingerprints were found
+
+2010-06-02 00:20 hardaker
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ two new functions for value comparison test output
+
+2010-06-02 00:16 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/transports/Stls:
+
+ remove no-longer-used self-signed certificate token specifier (we
+ require a copy of the key)
+
+2010-06-02 00:08 hardaker
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/cert_util.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ testing/fulltests/transports/Stlstests:
+
+ - changed 'fingerprint' token to more generic 'identity' keyword
+ - added the ability for netsnmp_cert_find to try multiple types
+ (FP & file)
+ - and provide test suite test for it.
+
+2010-06-01 20:12 bvassche
+
+ * testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T115agentxperl_simple:
+
+ Made sure that the Perl extension modules can load the Net-SNMP
+ DLLs while running the Net-SNMP regression tests.
+
+2010-06-01 16:47 marz
+
+ * local/certgen-test.pl, local/net-snmp-cert:
+
+ major update bug fixes and features - interactive mode, separate
+ CA dirs, gen csr from cert, fingerprint display --brief,
+ eliminate sed, openssl.conf overwrite and templating
+
+2010-06-01 14:48 bvassche
+
+ * agent/helpers/table.c:
+
+ Fixed a typo in a source code comment.
+
+2010-06-01 14:25 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_common.c:
+
+ CHANGES: snmpd: fixed IP-MIB::ipIfStatsReasmReqds value.
+
+ Just fixing a stupid typo.
+
+2010-05-31 10:43 bvassche
+
+ * configure, configure.d/config_modules_lib:
+
+ CHANGES: Cygwin: enabled Unix transport.
+ (Forward-ported r18687 from the V5.5 branch).
+
+2010-05-30 22:52 tanders
+
+ * testing/RUNFULLTESTS:
+
+ enable to run with older Perl (e.g. Perl 5.00405 as shipped with
+ IRIX
+ 6.5)
+
+2010-05-30 22:49 tanders
+
+ * testing/RUNFULLTESTS:
+
+ polish documentation
+
+2010-05-30 20:19 magfr
+
+ * agent/Makefile.in, agent/helpers/Makefile.in, apps/Makefile.in,
+ net-snmp-config.in, net-snmp-create-v3-user.in,
+ perl/TrapReceiver/Makefile.PL, perl/agent/Makefile.PL:
+
+ CHANGES: building: Do not link with libnetsnmphelpers any more as
+ it is empty.
+
+2010-05-30 19:18 magfr
+
+ * include/net-snmp/library/snmp.h, snmplib/snmp.c:
+
+ CHANGES: snmplib: Use a void argument for the data argument of
+ xdump.
+
+2010-05-30 19:18 bvassche
+
+ * agent/snmp_perl.c:
+
+ CHANGES: BUG: 2051742: added missing PERL_SYS_INIT3() call (see
+ also man perlembed).
+
+2010-05-30 19:16 bvassche
+
+ * include/net-snmp/library/container.h:
+
+ Fixed a compiler warning (free() called without being declared
+ first).
+
+2010-05-30 16:56 magfr
+
+ * acconfig.h, agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/smux/smux.h, configure,
+ configure.d/config_modules_lib,
+ include/net-snmp/net-snmp-config.h.in:
+
+ NEWS: snmplib: Do not require that the UDP transport is included.
+
+2010-05-30 12:00 magfr
+
+ * include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpIPv4BaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpSSHDomain.h,
+ include/net-snmp/library/snmpSTDDomain.h,
+ include/net-snmp/library/snmpTCPBaseDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ snmplib/snmp_transport.c, snmplib/transports/snmpAAL5PVCDomain.c,
+ snmplib/transports/snmpAliasDomain.c,
+ snmplib/transports/snmpCallbackDomain.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPXDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpSTDDomain.c,
+ snmplib/transports/snmpSocketBaseDomain.c,
+ snmplib/transports/snmpTCPBaseDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c,
+ snmplib/transports/snmpUnixDomain.c:
+
+ CHANGES: snmplib: Correct dependencies between transports. Remove
+ unnecessary includes.
+
+2010-05-30 06:21 bvassche
+
+ * agent/helpers/Makefile.in, agent/helpers/dummy.c:
+
+ Made sure that libnetsnmphelpers is not empty such that building
+ Net-SNMP on AIX and IRIX is again possible.
+
+2010-05-29 09:52 bvassche
+
+ * testing/RUNFULLTESTS:
+
+ Follow-up for r18902: works again without TAP::Harness.
+
+2010-05-28 23:23 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix long-ago broken verbosity
+
+2010-05-28 23:05 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix more previously broken option renames; change -d to
+ master-directory and add as a real argument
+
+2010-05-28 23:05 hardaker
+
+ * testing/fulltests/default/T001snmpv1get_simple,
+ testing/fulltests/default/T014snmpv2cget_simple,
+ testing/fulltests/default/T015snmpv2cgetnext_simple,
+ testing/fulltests/default/T0160snmpv2cbulkget_simple,
+ testing/fulltests/default/T016snmpv2cgetfail_simple,
+ testing/fulltests/default/T017snmpv2ctov1getfail_simple,
+ testing/fulltests/default/T018snmpv1tov2cgetfail_simple,
+ testing/fulltests/default/T019snmpv2cnosuch_simple,
+ testing/fulltests/default/T020snmpv3get_simple,
+ testing/fulltests/default/T021snmpv3getnext_simple,
+ testing/fulltests/default/T0220snmpv3bulkget_simple,
+ testing/fulltests/default/T022snmpv3getMD5_simple,
+ testing/fulltests/default/T023snmpv3getMD5AES_simple,
+ testing/fulltests/default/T023snmpv3getMD5DES_simple,
+ testing/fulltests/default/T024snmpv3getSHA1_simple,
+ testing/fulltests/default/T025snmpv3getSHADES_simple,
+ testing/fulltests/default/T026snmpv3getSHAAES_simple,
+ testing/fulltests/default/T028snmpv3getfail_simple,
+ testing/fulltests/default/T030snmpv3usercreation_simple,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_simple,
+ testing/fulltests/default/T049snmpv3inform_simple,
+ testing/fulltests/default/T049snmpv3informauth_simple,
+ testing/fulltests/default/T049snmpv3informpriv_simple,
+ testing/fulltests/default/T050snmpv3trap_simple,
+ testing/fulltests/default/T051snmpv2ctrap_simple,
+ testing/fulltests/default/T052snmpv2cinform_simple,
+ testing/fulltests/default/T053agentv1trap_simple,
+ testing/fulltests/default/T054agentv2ctrap_simple,
+ testing/fulltests/default/T055agentv1mintrap_simple,
+ testing/fulltests/default/T056agentv2cmintrap_simple,
+ testing/fulltests/default/T057trapdauthtest2_simple,
+ testing/fulltests/default/T057trapdauthtest3_simple,
+ testing/fulltests/default/T057trapdauthtest_simple,
+ testing/fulltests/default/T058agentauthtrap_simple,
+ testing/fulltests/default/T059trapdtraphandle_simple,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T065agentextend_simple,
+ testing/fulltests/default/T070com2sec_simple,
+ testing/fulltests/default/T071com2sec6_simple,
+ testing/fulltests/default/T072com2secunix_simple,
+ testing/fulltests/default/T100agenthup_simple,
+ testing/fulltests/default/T110agentxget_simple,
+ testing/fulltests/default/T111agentxset_simple,
+ testing/fulltests/default/T112agentxsetfail_simple,
+ testing/fulltests/default/T113agentxtrap_simple,
+ testing/fulltests/default/T114agentxagentxtrap_simple,
+ testing/fulltests/default/T115agentxperl_simple,
+ testing/fulltests/default/T120proxyget_simple,
+ testing/fulltests/default/T121proxyset_simple,
+ testing/fulltests/default/T122proxysetfail_simple,
+ testing/fulltests/default/T130snmpv1vacmget_simple,
+ testing/fulltests/default/T131snmpv2cvacmget_simple,
+ testing/fulltests/default/T132snmpv3vacmget_simple,
+ testing/fulltests/default/T140snmpv1vacmgetfail_simple,
+ testing/fulltests/default/T141snmpv2cvacmgetfail_simple,
+ testing/fulltests/default/T142snmpv3vacmgetfail_simple,
+ testing/fulltests/default/T150solarishostcpu_simple,
+ testing/fulltests/default/T151solarishostdisk_simple,
+ testing/fulltests/default/T152hostuptime_simple,
+ testing/fulltests/default/T153solarisswap_simple,
+ testing/fulltests/default/T160snmpnetstat_simple,
+ testing/fulltests/default/T200snmpv2cwalkall_simple,
+ testing/fulltests/transports/T300udp_simple,
+ testing/fulltests/transports/T310tcp_simple,
+ testing/fulltests/transports/T320udpv6_simple,
+ testing/fulltests/transports/T330tcpv6_simple,
+ testing/fulltests/transports/T350unix_simple,
+ testing/fulltests/transports/T360dtlsudp_simple,
+ testing/fulltests/transports/T361tlstcp_simple,
+ testing/fulltests/transports/T399alias_simple:
+
+ more missing olducd renames
+
+2010-05-28 22:57 hardaker
+
+ * testing/RUNTESTS, testing/fulltests/default/T001snmpv1get_olducd,
+ testing/fulltests/default/T001snmpv1get_simple,
+ testing/fulltests/default/T014snmpv2cget_olducd,
+ testing/fulltests/default/T014snmpv2cget_simple,
+ testing/fulltests/default/T015snmpv2cgetnext_olducd,
+ testing/fulltests/default/T015snmpv2cgetnext_simple,
+ testing/fulltests/default/T0160snmpv2cbulkget_olducd,
+ testing/fulltests/default/T0160snmpv2cbulkget_simple,
+ testing/fulltests/default/T016snmpv2cgetfail_olducd,
+ testing/fulltests/default/T016snmpv2cgetfail_simple,
+ testing/fulltests/default/T017snmpv2ctov1getfail_olducd,
+ testing/fulltests/default/T017snmpv2ctov1getfail_simple,
+ testing/fulltests/default/T018snmpv1tov2cgetfail_olducd,
+ testing/fulltests/default/T018snmpv1tov2cgetfail_simple,
+ testing/fulltests/default/T019snmpv2cnosuch_olducd,
+ testing/fulltests/default/T019snmpv2cnosuch_simple,
+ testing/fulltests/default/T020snmpv3get_olducd,
+ testing/fulltests/default/T020snmpv3get_simple,
+ testing/fulltests/default/T021snmpv3getnext_olducd,
+ testing/fulltests/default/T021snmpv3getnext_simple,
+ testing/fulltests/default/T0220snmpv3bulkget_olducd,
+ testing/fulltests/default/T0220snmpv3bulkget_simple,
+ testing/fulltests/default/T022snmpv3getMD5_olducd,
+ testing/fulltests/default/T022snmpv3getMD5_simple,
+ testing/fulltests/default/T023snmpv3getMD5AES_olducd,
+ testing/fulltests/default/T023snmpv3getMD5AES_simple,
+ testing/fulltests/default/T023snmpv3getMD5DES_olducd,
+ testing/fulltests/default/T023snmpv3getMD5DES_simple,
+ testing/fulltests/default/T024snmpv3getSHA1_olducd,
+ testing/fulltests/default/T024snmpv3getSHA1_simple,
+ testing/fulltests/default/T025snmpv3getSHADES_olducd,
+ testing/fulltests/default/T025snmpv3getSHADES_simple,
+ testing/fulltests/default/T026snmpv3getSHAAES_olducd,
+ testing/fulltests/default/T026snmpv3getSHAAES_simple,
+ testing/fulltests/default/T028snmpv3getfail_olducd,
+ testing/fulltests/default/T028snmpv3getfail_simple,
+ testing/fulltests/default/T030snmpv3usercreation_olducd,
+ testing/fulltests/default/T030snmpv3usercreation_simple,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_olducd,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_simple,
+ testing/fulltests/default/T049snmpv3inform_olducd,
+ testing/fulltests/default/T049snmpv3inform_simple,
+ testing/fulltests/default/T049snmpv3informauth_olducd,
+ testing/fulltests/default/T049snmpv3informauth_simple,
+ testing/fulltests/default/T049snmpv3informpriv_olducd,
+ testing/fulltests/default/T049snmpv3informpriv_simple,
+ testing/fulltests/default/T050snmpv3trap_olducd,
+ testing/fulltests/default/T050snmpv3trap_simple,
+ testing/fulltests/default/T051snmpv2ctrap_olducd,
+ testing/fulltests/default/T051snmpv2ctrap_simple,
+ testing/fulltests/default/T052snmpv2cinform_olducd,
+ testing/fulltests/default/T052snmpv2cinform_simple,
+ testing/fulltests/default/T053agentv1trap_olducd,
+ testing/fulltests/default/T053agentv1trap_simple,
+ testing/fulltests/default/T054agentv2ctrap_olducd,
+ testing/fulltests/default/T054agentv2ctrap_simple,
+ testing/fulltests/default/T055agentv1mintrap_olducd,
+ testing/fulltests/default/T055agentv1mintrap_simple,
+ testing/fulltests/default/T056agentv2cmintrap_olducd,
+ testing/fulltests/default/T056agentv2cmintrap_simple,
+ testing/fulltests/default/T057trapdauthtest2_olducd,
+ testing/fulltests/default/T057trapdauthtest2_simple,
+ testing/fulltests/default/T057trapdauthtest3_olducd,
+ testing/fulltests/default/T057trapdauthtest3_simple,
+ testing/fulltests/default/T057trapdauthtest_olducd,
+ testing/fulltests/default/T057trapdauthtest_simple,
+ testing/fulltests/default/T058agentauthtrap_olducd,
+ testing/fulltests/default/T058agentauthtrap_simple,
+ testing/fulltests/default/T059trapdtraphandle_olducd,
+ testing/fulltests/default/T059trapdtraphandle_simple,
+ testing/fulltests/default/T060trapdperl_olducd,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_olducd,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T065agentextend_olducd,
+ testing/fulltests/default/T065agentextend_simple,
+ testing/fulltests/default/T070com2sec_olducd,
+ testing/fulltests/default/T070com2sec_simple,
+ testing/fulltests/default/T071com2sec6_olducd,
+ testing/fulltests/default/T071com2sec6_simple,
+ testing/fulltests/default/T072com2secunix_olducd,
+ testing/fulltests/default/T072com2secunix_simple,
+ testing/fulltests/default/T100agenthup_olducd,
+ testing/fulltests/default/T100agenthup_simple,
+ testing/fulltests/default/T110agentxget_olducd,
+ testing/fulltests/default/T110agentxget_simple,
+ testing/fulltests/default/T111agentxset_olducd,
+ testing/fulltests/default/T111agentxset_simple,
+ testing/fulltests/default/T112agentxsetfail_olducd,
+ testing/fulltests/default/T112agentxsetfail_simple,
+ testing/fulltests/default/T113agentxtrap_olducd,
+ testing/fulltests/default/T113agentxtrap_simple,
+ testing/fulltests/default/T114agentxagentxtrap_olducd,
+ testing/fulltests/default/T114agentxagentxtrap_simple,
+ testing/fulltests/default/T115agentxperl_olducd,
+ testing/fulltests/default/T115agentxperl_simple,
+ testing/fulltests/default/T120proxyget_olducd,
+ testing/fulltests/default/T120proxyget_simple,
+ testing/fulltests/default/T121proxyset_olducd,
+ testing/fulltests/default/T121proxyset_simple,
+ testing/fulltests/default/T122proxysetfail_olducd,
+ testing/fulltests/default/T122proxysetfail_simple,
+ testing/fulltests/default/T130snmpv1vacmget_olducd,
+ testing/fulltests/default/T130snmpv1vacmget_simple,
+ testing/fulltests/default/T131snmpv2cvacmget_olducd,
+ testing/fulltests/default/T131snmpv2cvacmget_simple,
+ testing/fulltests/default/T132snmpv3vacmget_olducd,
+ testing/fulltests/default/T132snmpv3vacmget_simple,
+ testing/fulltests/default/T140snmpv1vacmgetfail_olducd,
+ testing/fulltests/default/T140snmpv1vacmgetfail_simple,
+ testing/fulltests/default/T141snmpv2cvacmgetfail_olducd,
+ testing/fulltests/default/T141snmpv2cvacmgetfail_simple,
+ testing/fulltests/default/T142snmpv3vacmgetfail_olducd,
+ testing/fulltests/default/T142snmpv3vacmgetfail_simple,
+ testing/fulltests/default/T150solarishostcpu_olducd,
+ testing/fulltests/default/T150solarishostcpu_simple,
+ testing/fulltests/default/T151solarishostdisk_olducd,
+ testing/fulltests/default/T151solarishostdisk_simple,
+ testing/fulltests/default/T152hostuptime_olducd,
+ testing/fulltests/default/T152hostuptime_simple,
+ testing/fulltests/default/T153solarisswap_olducd,
+ testing/fulltests/default/T153solarisswap_simple,
+ testing/fulltests/default/T160snmpnetstat_olducd,
+ testing/fulltests/default/T160snmpnetstat_simple,
+ testing/fulltests/default/T200snmpv2cwalkall_olducd,
+ testing/fulltests/default/T200snmpv2cwalkall_simple,
+ testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_eval_tools.sh,
+ testing/fulltests/support/olducd_run,
+ testing/fulltests/support/simple_TESTCONF.sh,
+ testing/fulltests/support/simple_eval_tools.sh,
+ testing/fulltests/support/simple_run,
+ testing/fulltests/transports/T300udp_olducd,
+ testing/fulltests/transports/T300udp_simple,
+ testing/fulltests/transports/T310tcp_olducd,
+ testing/fulltests/transports/T310tcp_simple,
+ testing/fulltests/transports/T320udpv6_olducd,
+ testing/fulltests/transports/T320udpv6_simple,
+ testing/fulltests/transports/T330tcpv6_olducd,
+ testing/fulltests/transports/T330tcpv6_simple,
+ testing/fulltests/transports/T350unix_olducd,
+ testing/fulltests/transports/T350unix_simple,
+ testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T360dtlsudp_simple,
+ testing/fulltests/transports/T361tlstcp_olducd,
+ testing/fulltests/transports/T361tlstcp_simple,
+ testing/fulltests/transports/T399alias_olducd,
+ testing/fulltests/transports/T399alias_simple:
+
+ renamed 'olducd' to 'simple' to put a more positive spin on them
+
+2010-05-28 22:54 hardaker
+
+ * testing/README, testing/RUNFULLTESTS:
+
+ documentation for the test suite
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/tests/test.py:
+
+ revert unintentionanally committed test test
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/client_intf.c, python/netsnmp/tests/test.py:
+
+ free variables again
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ fix walks so that multiple walks terminate properly
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ patch to handle testing of looping of multiple varbinds in a walk
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ inital patch to prevent looping walks
+
+2010-05-28 20:53 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ implement cert lookup by filename
+
+2010-05-28 07:02 magfr
+
+ * snmplib/snmp_debug.c:
+
+ CHANGES: snmplib: Add const declarations to the disabled versions
+ of the debugging code as well.
+
+2010-05-28 02:12 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ add persistence; check for col mods while row active
+
+2010-05-28 02:11 rstory
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ CHANGES: agentlib: new functions to make stash ptr and newrow
+ available to
+ table_dataset handlers
+ nonews: fix typo; tabs to spaces; use sizeof instead of constant
+
+2010-05-27 18:59 bvassche
+
+ * include/net-snmp/library/check_varbind.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/snmp_client.h,
+ win32/libsnmp/Makefile.in, win32/libsnmp/libsnmp.dsp,
+ win32/libsnmp_dll/Makefile.in, win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ Win32 build fixes.
+
+2010-05-27 18:24 bvassche
+
+ * testing/RUNFULLTESTS:
+
+ "make test" without TAP::Harness (was broken by r18802).
+
+2010-05-27 15:15 bvassche
+
+ * agent/mibgroup/mibII/interfaces.c,
+ include/net-snmp/library/lcd_time.h,
+ include/net-snmp/library/md5.h, include/net-snmp/library/scapi.h,
+ include/net-snmp/library/snmp_debug.h, snmplib/lcd_time.c,
+ snmplib/md5.c, snmplib/scapi.c, snmplib/snmp_debug.c,
+ snmplib/transports/snmpIPv4BaseDomain.c:
+
+ Fixed several compiler warnings. Most fixes involved adding the
+ "const" keyword.
+
+2010-05-27 13:52 jsafranek
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ CHANGES: snmpd: BUG: 2972579: fixed checking of
+ snmpTargetAddrRowStatus SET requests.
+
+2010-05-27 13:41 hardaker
+
+ * testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_run:
+
+ revert part of 18885: test files should be able to be run by
+ themselves too
+
+2010-05-27 11:19 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ include/net-snmp/data_access/interface.h:
+
+ CHANGES: correctly calculate ifXTable.ifHCInUcastPkts on 32-bit
+ Linux
+
+ Linux does not provide standalone counter for incoming unicast
+ packets (iucast)
+ - it provides counter of all packets (iall) + separate counter
+ for the multicast
+ ones (imcast). Previous implementation of ifTable read these
+ counters and
+ calculated iucast = iall - imcast *before* these values were
+ expanded into
+ 64bits. This produced errors on 32bit systems when iall
+ overflowed to zero and
+ imcast was nozero -> iucast got negative and 'c64 32 bit check
+ failed' error in
+ snmpd log. Now the agent expands these values to 64bits first and
+ * *then* performs the calculation, using a new flag.
+ 2010-05-27 08:18 magfr
+
+
+ * testing/RUNFULLTESTS, testing/RUNTESTS,
+ testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_run:
+
+ CHANGES: testing: Move the setting of MIBDIRS from the support
+ script to the drivers since it is needed for the C tests as well.
+
+2010-05-27 08:09 magfr
+
+ * testing/RUNTESTS:
+
+ CHANGES: testing: Use olducd_run, not run_olducd. Change srcdir
+ to refer to the top directory and not the testing subdirectory as
+ that is what is expected in the test scripts.
+
+2010-05-27 05:17 hardaker
+
+ * testing/fulltests/snmpv3/T020hashtests_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ warning squashing
+
+2010-05-27 05:16 hardaker
+
+ * include/net-snmp/library/keytools.h,
+ include/net-snmp/library/lcd_time.h, snmplib/keytools.c,
+ snmplib/lcd_time.c:
+
+ more const correctness
+
+2010-05-27 04:18 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ tests for agent-not-known-user-certificates
+
+2010-05-27 04:16 hardaker
+
+ * README.snmpv3:
+
+ reference the itnernal support and related documentation
+
+2010-05-27 04:16 hardaker
+
+ * snmplib/openssl/OPENSSL-LICENSE, snmplib/openssl/README:
+
+ internal OpenSSL support documentation
+
+2010-05-27 04:16 hardaker
+
+ * configure, configure.d/config_project_with_enable:
+
+ NEWS: libnetsnmp: Support for a stream-line stripped down version
+ of internal OpenSSL support using --with-openssl=internal
+
+2010-05-27 04:15 hardaker
+
+ * include/net-snmp/library/openssl_aes.h,
+ include/net-snmp/library/openssl_des.h,
+ include/net-snmp/openssl_md5.h,
+ snmplib/openssl/openssl_aes_cfb.c,
+ snmplib/openssl/openssl_aes_local.h,
+ snmplib/openssl/openssl_des_local.h,
+ snmplib/openssl/openssl_set_key.c, snmplib/openssl/openssl_spr.h,
+ snmplib/scapi.c:
+
+ remove more dependencies for external openssl headers
+
+2010-05-27 04:15 hardaker
+
+ * configure, configure.d/config_os_libs, snmplib/openssl,
+ snmplib/openssl/openssl_aes_cfb.c,
+ snmplib/openssl/openssl_aes_core.c,
+ snmplib/openssl/openssl_aes_local.h,
+ snmplib/openssl/openssl_cbc_enc.c,
+ snmplib/openssl/openssl_cfb128.c,
+ snmplib/openssl/openssl_des_enc.c,
+ snmplib/openssl/openssl_des_local.h,
+ snmplib/openssl/openssl_md32_common.h,
+ snmplib/openssl/openssl_md5.c,
+ snmplib/openssl/openssl_md5_local.h,
+ snmplib/openssl/openssl_modes.h,
+ snmplib/openssl/openssl_ncbc_enc.c,
+ snmplib/openssl/openssl_set_key.c, snmplib/openssl/openssl_sha.h,
+ snmplib/openssl/openssl_sha1.c,
+ snmplib/openssl/openssl_sha_local.h,
+ snmplib/openssl/openssl_spr.h, snmplib/openssl_aes_cfb.c,
+ snmplib/openssl_aes_core.c, snmplib/openssl_aes_local.h,
+ snmplib/openssl_cbc_enc.c, snmplib/openssl_cfb128.c,
+ snmplib/openssl_des_enc.c, snmplib/openssl_des_local.h,
+ snmplib/openssl_md32_common.h, snmplib/openssl_md5.c,
+ snmplib/openssl_md5_local.h, snmplib/openssl_modes.h,
+ snmplib/openssl_ncbc_enc.c, snmplib/openssl_set_key.c,
+ snmplib/openssl_sha.h, snmplib/openssl_sha1.c,
+ snmplib/openssl_sha_local.h, snmplib/openssl_spr.h:
+
+ move openssl code into a subdirectory
+
+2010-05-27 04:13 hardaker
+
+ * testing/fulltests/default/Sv3usmconfigbase,
+ testing/fulltests/default/T023snmpv3getMD5AES_olducd,
+ testing/fulltests/default/T023snmpv3getMD5DES_olducd,
+ testing/fulltests/default/T024snmpv3getSHA1_olducd,
+ testing/fulltests/default/T025snmpv3getSHADES_olducd,
+ testing/fulltests/default/T026snmpv3getSHAAES_olducd,
+ testing/fulltests/default/T030snmpv3usercreation_olducd,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_olducd,
+ testing/fulltests/default/T049snmpv3informpriv_olducd,
+ testing/fulltests/default/T050snmpv3trap_olducd:
+
+ fix testing so it uses multiple types of crypto
+
+2010-05-27 04:13 hardaker
+
+ * acconfig.h, configure, configure.d/config_os_libs,
+ include/net-snmp/net-snmp-config.h.in:
+
+ definitions and files for doing internal crypto support
+
+2010-05-27 04:12 hardaker
+
+ * snmplib/scapi.c:
+
+ include internal aes/des headers
+
+2010-05-27 04:12 hardaker
+
+ * snmplib/openssl_cfb128.c:
+
+ localize
+
+2010-05-27 04:12 hardaker
+
+ * snmplib/openssl_cfb128.c, snmplib/openssl_modes.h:
+
+ inital copies of cfb128 modes from openssl
+
+2010-05-27 04:11 hardaker
+
+ * snmplib/openssl_aes_core.c:
+
+ localize
+
+2010-05-27 04:11 hardaker
+
+ * snmplib/openssl_aes_core.c, snmplib/openssl_aes_local.h:
+
+ initial versions of aes_core.c and aes_locl.h
+
+2010-05-27 04:10 hardaker
+
+ * include/net-snmp/library/openssl_aes.h:
+
+ initial copy of aes.h from openssl
+
+2010-05-27 04:10 hardaker
+
+ * snmplib/openssl_aes_cfb.c:
+
+ initial copy of the openssl aes_cfb.c file
+
+2010-05-27 04:10 hardaker
+
+ * snmplib/openssl_des_enc.c:
+
+ include localized copies of the files
+
+2010-05-27 04:09 hardaker
+
+ * snmplib/scapi.c:
+
+ use internal DES
+
+2010-05-27 04:09 hardaker
+
+ * snmplib/openssl_cbc_enc.c:
+
+ localized copy of the cbc_enc.c file from openssl
+
+2010-05-27 04:09 hardaker
+
+ * snmplib/openssl_spr.h:
+
+ des/spr.h from openssl
+
+2010-05-27 04:08 hardaker
+
+ * snmplib/openssl_des_enc.c:
+
+ added des_enc.c from openssl
+
+2010-05-27 04:08 hardaker
+
+ * include/net-snmp/library/openssl_des.h,
+ include/net-snmp/library/openssl_md5.h,
+ include/net-snmp/library/openssl_sha.h:
+
+ local copies of the openssl headers
+
+2010-05-27 04:07 hardaker
+
+ * include/net-snmp/library/openssl_des.h:
+
+ initial copy of openssl's des.h
+
+2010-05-27 04:07 hardaker
+
+ * snmplib/openssl_ncbc_enc.c, snmplib/openssl_set_key.c:
+
+ localized header files
+
+2010-05-27 04:07 hardaker
+
+ * snmplib/openssl_des_local.h, snmplib/openssl_ncbc_enc.c,
+ snmplib/openssl_set_key.c:
+
+ inital copies of some of the openssl DES files
+
+2010-05-27 04:06 hardaker
+
+ * snmplib/keytools.c, snmplib/scapi.c:
+
+ finishing porting of internal auth support
+
+2010-05-27 04:06 hardaker
+
+ * configure, configure.d/config_os_libs, snmplib/Makefile.in:
+
+ add internal crypto files to the check/use list
+
+2010-05-27 04:06 hardaker
+
+ * snmplib/md32_common.h, snmplib/md5_locl.h,
+ snmplib/openssl_md32_common.h, snmplib/openssl_md5.c,
+ snmplib/openssl_md5_local.h, snmplib/openssl_sha1.c,
+ snmplib/openssl_sha_local.h, snmplib/sha_locl.h:
+
+ localized file names with openssl prefixes
+
+2010-05-27 04:05 hardaker
+
+ * include/net-snmp/openssl_md5.h, snmplib/md5_locl.h,
+ snmplib/openssl_md5.c:
+
+ localize the md5 implementation
+
+2010-05-27 04:05 hardaker
+
+ * snmplib/openssl_sha.h, snmplib/openssl_sha1.c,
+ snmplib/sha_locl.h:
+
+ completely localize the openssl SHA support
+
+2010-05-27 04:04 hardaker
+
+ * snmplib/openssl_sha.h:
+
+ initial verison of sha.h copy
+
+2010-05-27 04:04 hardaker
+
+ * snmplib/md32_common.h, snmplib/md5_locl.h, snmplib/openssl_md5.c,
+ snmplib/openssl_sha1.c, snmplib/sha_locl.h:
+
+ added local copies of the openssl crypto functions
+
+2010-05-27 04:04 hardaker
+
+ * snmplib/keytools.c:
+
+ make use of internal crypto hash functions
+
+2010-05-27 04:03 hardaker
+
+ * configure, configure.d/config_os_libs,
+ configure.d/config_os_misc2,
+ configure.d/config_project_with_enable,
+ include/net-snmp/net-snmp-config.h.in:
+
+ configure checks for internal-crypto support
+
+2010-05-26 22:17 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmp_api.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/transports/Stlstests:
+
+ properly verify expected server certificates under DTLS; add a
+ new flag in tlsbase to indicate verification has occurred
+
+2010-05-26 21:02 hardaker
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ compiler warning squashing
+
+2010-05-26 21:02 hardaker
+
+ * include/net-snmp/library/lcd_time.h,
+ include/net-snmp/library/scapi.h, snmplib/lcd_time.c,
+ snmplib/scapi.c:
+
+ add const qualifiers to a few places
+
+2010-05-26 19:46 bvassche
+
+ * agent/Makefile.in, agent/helpers/Makefile.in,
+ snmplib/Makefile.in:
+
+ CHANGES: Cygwin: libnetsnmpmibs, libnetsnmphelpers and
+ libnetsnmpagent do now build as a DLL when configured with
+ --enable-shared.
+
+2010-05-26 17:47 bvassche
+
+ * agent/Makefile.in, agent/helpers/Makefile.in:
+
+ NEWS: moved all functions defined in libnetsnmphelpers to
+ libnetsnmpagent. libnetsnmphelpers is now an empty library.
+
+2010-05-26 17:20 bvassche
+
+ * agent/Makefile.in, agent/bulk_to_next.c,
+ agent/helpers/Makefile.in, agent/helpers/bulk_to_next.c,
+ agent/helpers/null.c, agent/helpers/old_api.c, agent/null.c,
+ agent/old_api.c:
+
+ Reverted r18829 in order to minimize diffs with older branches.
+
+2010-05-25 07:23 magfr
+
+ * testing/fulltests/transports/Stls:
+
+ Tell net-snmp-cert where net-snmp-config is located
+
+2010-05-25 07:14 magfr
+
+ * testing/fulltests/support/clib_build:
+
+ Correct the signature of main. Use #include instead of sourcing
+ to get the code under test in order to get better error messages
+
+2010-05-25 07:11 magfr
+
+ * testing/fulltests/unit-tests/T001defaultstore_clib.c:
+
+ Add arguments to sprintf statements to make the test work
+
+2010-05-25 07:07 magfr
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T020hashtests_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c,
+ testing/fulltests/unit-tests/T002containers_clib.c:
+
+ Remove unused variables and disabled code
+
+2010-05-25 05:20 magfr
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend,
+ include/net-snmp/library/snmpIPBaseDomain.h,
+ include/net-snmp/library/snmpIPv4BaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpSocketBaseDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/Makefile.depend, snmplib/transports/snmpIPBaseDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpSocketBaseDomain.c:
+
+ CHANGES: snmplib: Split snmpIPBaseDomain and move the IPv4 parts
+ to IPv4Base and the socket generic parts to SocketBase.
+
+2010-05-24 20:24 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ fix compiler warning; finish tlstmParamsTable lastChanged scalar
+
+2010-05-24 19:28 magfr
+
+ * testing/fulltests/support/capp_build,
+ testing/fulltests/support/clib_build:
+
+ Add --external-libs in order to support building the tests on
+ solaris
+
+2010-05-24 13:33 rstory
+
+ * agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ argh.. fix fallout from manually (mis)applying patch
+
+2010-05-24 12:59 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmParamsTable,
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h:
+
+ first pass at tlstmParamsTable
+
+2010-05-24 12:59 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h:
+
+ update defines to match MIB names, per grand-poobah
+
+2010-05-24 12:58 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.c:
+
+ update OID to match upcoming RFC
+
+2010-05-24 11:48 bvassche
+
+ * agent/Makefile.in, agent/bulk_to_next.c,
+ agent/helpers/Makefile.in, agent/helpers/bulk_to_next.c,
+ agent/helpers/null.c, agent/helpers/old_api.c, agent/null.c,
+ agent/old_api.c:
+
+ CHANGES: libnetsnmpagent, libnetsnmphelpers: moved the functions
+ netsnmp_bulk_to_next_fix_requests(),
+ netsnmp_get_bulk_to_next_handler(), netsnmp_register_null(),
+ netsnmp_register_null_context() and netsnmp_register_old_api()
+ from libnetsnmphelpers to libnetsnmpagent.
+ Notes:
+ - This does not affect backwards compatibility for applications
+ that link with $(net-snmp-config --agent-libs) since this
+ involves linking with both libnetsnmphelpers and libnetsnmpagent.
+ - Functions have been moved between libraries by moving entire
+ source files.
+
+2010-05-24 10:10 jsafranek
+
+ * agent/mibgroup/hardware/fsys/fsys_getfsstats.c,
+ agent/mibgroup/hardware/fsys/fsys_mntent.c:
+
+ Use proper string sizes and make sure strings are
+ zero-terminated.
+
+2010-05-24 08:01 bvassche
+
+ * configure, configure.d/config_os_progs, net-snmp-config.in,
+ snmplib/Makefile.in:
+
+ CHANGES: Cygwin: libnetsnmp does now build as a DLL when
+ configured with --enable-shared.
+ CHANGES: Cygwin: perl modules do now build (--with-perl-modules).
+ Note: the T060trapdperl_olducd, T061agentperl_olducd and
+ T115agentxperl_olducd tests still fail.
+
+2010-05-23 23:06 rstory
+
+ * agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c:
+
+ update filenames/patsh for recent file renames; fix typos
+
+2010-05-23 22:08 magfr
+
+ * net-snmp-config.in, testing/fulltests/support/capp_build,
+ testing/fulltests/support/clib_build:
+
+ CHANGES: building: Use the same compiler command and flags for
+ building of tests as for building of the code, thus enabling test
+ of e.g. 32-bit code compiled on a 64-bit platform.
+
+2010-05-23 21:41 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h:
+
+ update include/config file/paths for recent renames
+
+2010-05-23 21:31 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/tlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/tlstmAddrTable_persist.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/tlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/tlstmCertToTSNTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable.h:
+
+ rename files for MIB renames
+
+2010-05-23 21:25 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable:
+
+ rename directories to match renames in MIB
+
+2010-05-20 08:48 bvassche
+
+ * net-snmp-config.in:
+
+ Swapped link order of -lnetsnmphelpers -lnetsnmpmibs: netsnmpmibs
+ depends on netsnmphelpers and not the other way around.
+
+2010-05-20 08:42 bvassche
+
+ * apps/snmptrapd_log.c, snmplib/snmp_transport.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c:
+
+ Fixed more compiler warnings.
+
+2010-05-19 18:26 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix stashing
+
+2010-05-19 18:25 hardaker
+
+ * testing/RUNFULLTESTS,
+ testing/fulltests/transports/T361tlstcp_olducd,
+ testing/fulltests/unit-tests/T001defaultstore_clib.c,
+ testing/fulltests/unit-tests/T002containers_clib.c:
+
+ output filenames of failed tests
+
+2010-05-19 18:25 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ wipe trailing comment C marker if it exists
+
+2010-05-19 18:25 hardaker
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T020hashtests_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ title the SNMPv3 tests
+
+2010-05-19 18:25 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix testing of built titles
+
+2010-05-19 18:24 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ only print failure header if there was at least one
+
+2010-05-19 18:24 hardaker
+
+ * testing/RUNFULLTESTS,
+ testing/fulltests/default/T049snmpv3inform_olducd,
+ testing/fulltests/default/T049snmpv3informauth_olducd,
+ testing/fulltests/default/T049snmpv3informpriv_olducd:
+
+ make descriptive titles work again
+
+2010-05-19 18:24 hardaker
+
+ * testing/RUNFULLTESTS, testing/fulltests/support/build_capp,
+ testing/fulltests/support/build_clib,
+ testing/fulltests/support/capp_build,
+ testing/fulltests/support/clib_build,
+ testing/fulltests/support/olducd_run,
+ testing/fulltests/support/run_olducd:
+
+ rename files so prefixing is based on the suite name, not file
+ type
+
+2010-05-19 17:52 bvassche
+
+ * perl/ASN/Makefile.PL, perl/Makefile.PL, perl/Makefile.subs.pl,
+ perl/OID/Makefile.PL, perl/SNMP/Makefile.PL,
+ perl/TrapReceiver/Makefile.PL, perl/agent/Makefile.PL,
+ perl/agent/Support/Makefile.PL,
+ perl/agent/default_store/Makefile.PL,
+ perl/default_store/Makefile.PL:
+
+ CHANGES: Cygwin: perl: building the Perl modules with the Cygwin
+ Perl package is now possible.
+ (Forward-ported r18688 from the V5.5 branch.)
+
+2010-05-19 17:50 bvassche
+
+ * agent/mibgroup/examples/delayed_instance.c:
+
+ Fixed yet another compiler warning.
+
+2010-05-19 12:05 dts12
+
+ * agent/mibgroup/hardware/fsys.h,
+ agent/mibgroup/hardware/fsys/fsys_mntctl.c:
+
+ First-draft support for AIX filesystem HAL module (untested)
+
+2010-05-19 11:25 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c:
+
+ Support for Solaris-style 'getmntent' API.
+
+2010-05-19 09:57 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/mnttypes.h:
+
+ Simplify the handling of unknown/unwanted file systems.
+
+2010-05-19 09:30 dts12
+
+ * agent/mibgroup/hardware/fsys/hw_fsys.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.h,
+ agent/mibgroup/host/hrh_filesys.c,
+ include/net-snmp/agent/hardware/fsys.h:
+
+ Fix missing/broken API declarations.
+
+2010-05-19 08:46 bvassche
+
+ * testing/fulltests/support/run_olducd:
+
+ Made error messages more clear in case of failure or wrong
+ invocation.
+
+2010-05-19 00:01 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ added test for using a certificate signed by a CA certificate
+
+2010-05-18 23:31 tanders
+
+ * testing/Makefile.in:
+
+ make sure we call the right Perl
+
+2010-05-18 20:39 bvassche
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c:
+
+ CHANGES: agent: include local port number in packet dumps. An
+ example:
+
+ Received 36 byte packet from UDP:
+ [127.0.0.1]:53909->[127.0.0.1]:1161
+ 0000: 30 22 02 01 01 04 06 70 75 62 6C 69 63 A1 15 02
+ 0".....public...
+ 0016: 04 37 F2 D4 9B 02 01 00 02 01 00 30 07 30 05 06
+ .7.........0.0..
+ 0032: 01 01 05 00 ....
+
+ Received SNMP packet(s) from UDP:
+ [127.0.0.1]:53909->[127.0.0.1]:1161
+ GETNEXT message
+ -- ccitt.1
+
+ Sending 118 bytes to UDP: [127.0.0.1]:53909->[127.0.0.1]:1161
+ 0000: 30 74 02 01 01 04 06 70 75 62 6C 69 63 A2 67 02
+ 0t.....public.g.
+ 0016: 04 37 F2 D4 9B 02 01 00 02 01 00 30 59 30 57 06
+ .7.........0Y0W.
+ 0032: 08 2B 06 01 02 01 01 01 00 04 4B 4C 69 6E 75 78
+ .+........KLinux
+ 0048: 20 61 73 75 73 20 32 2E 36 2E 33 33 2E 32 2D 73 asus
+ 2.6.33.2-s
+ 0064: 63 73 74 20 23 31 20 53 4D 50 20 50 52 45 45 4D cst #1 SMP
+ PREEM
+ 0080: 50 54 20 53 61 74 20 41 70 72 20 33 20 32 31 3A PT Sat Apr
+ 3 21:
+ 0096: 31 30 3A 35 38 20 43 45 53 54 20 32 30 31 30 20 10:58 CEST
+ 2010
+ 0112: 78 38 36 5F 36 34 x86_64
+
+2010-05-18 19:42 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_persist.c,
+
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c:
+
+ update tlstmAddrTable
+ - deal with hash type properly for get/set and persistence
+ - add count and last changed scalars
+
+2010-05-18 19:08 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c:
+
+ update to offical OID from upcoming rfc
+
+2010-05-18 16:16 rstory
+
+ * agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c:
+
+ update to official OIDs from upcoming RFC; add count/last changed
+ scalars
+
+2010-05-18 14:56 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: PATCH: 2001656: Handle null-termination of
+ string values properly.
+ Based on the principles of the patch from Tommy Beadle.
+
+2010-05-18 14:38 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.c,
+ agent/mibgroup/hardware/fsys/mnttypes.h, agent/mibgroup/host.h,
+ agent/mibgroup/host/hrh_filesys.c,
+ agent/mibgroup/host/hrh_filesys.h,
+ agent/mibgroup/host/hrh_storage.c,
+ agent/mibgroup/host/hrh_storage.h,
+ include/net-snmp/agent/hardware/fsys.h:
+
+ Working(?) HAL-based version of hrFSTable.
+
+2010-05-18 14:12 bvassche
+
+ * snmplib/tools.c:
+
+ Fixed a compiler warning.
+
+2010-05-17 21:03 hardaker
+
+ * include/net-snmp/library/snmp_secmod.h:
+
+ use proper TSM security code (4) now that it's official
+
+2010-05-17 18:43 hardaker
+
+ * testing/fulltests/unit-tests/T002containers_clib.c:
+
+ beginning of a container unit test
+
+2010-05-17 18:43 hardaker
+
+ * include/net-snmp/library/testing.h:
+
+ a basic C-code based test reporting mechanism
+
+2010-05-17 18:42 hardaker
+
+ * testing/fulltests/unit-tests,
+ testing/fulltests/unit-tests/T001defaultstore_clib.c:
+
+ basic default_store tests
+
+2010-05-17 18:42 hardaker
+
+ * testing/fulltests/support/build_clib:
+
+ a build system for basic libnetsnmp tests
+
+2010-05-17 18:14 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c,
+ include/net-snmp/library/cert_util.h:
+
+ fix fingerprint bin/hex conversion; add/remove cert sec maps via
+ mib now works
+
+2010-05-17 18:13 rstory
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ new function netsnmp_binary_to_hex
+
+2010-05-17 18:13 rstory
+
+ * snmplib/snmptsm.c:
+
+ fprintf(stderr -> DEBUGMSGTL((
+
+2010-05-17 18:12 rstory
+
+ * snmplib/cert_util.c:
+
+ move check for hash type
+
+2010-05-17 16:34 hardaker
+
+ * testing/RUNTESTS:
+
+ make RUNTESTS work outside the sourcedir
+
+2010-05-17 15:37 hardaker
+
+ * testing/Makefile.in, testing/RUNTESTS:
+
+ made a limited run test possible again without perl
+
+2010-05-17 15:32 dts12
+
+ * win32/mib_module_includes.h, win32/mib_module_inits.h,
+ win32/net-snmp/agent/mib_module_config.h,
+ win32/netsnmpmibs/Makefile.in, win32/netsnmpmibs/netsnmpmibs.dsp:
+
+ Use newer DisMan Event MIB code for MSVC-based builds
+ (in line with all configure-based builds)
+
+2010-05-17 15:23 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ move the return outside the if statement
+
+2010-05-17 15:18 dts12
+
+ * agent/mibgroup/hardware/fsys/hw_fsys.c,
+ include/net-snmp/agent/hardware/fsys.h:
+
+ Provide missing public interface to HAL-based filestore module.
+
+2010-05-17 10:41 bvassche
+
+ * win32/transports/snmp_transport_inits.h:
+
+ Follow-up for r18754 (revert r18738): r18754 only partially
+ reverted r18738
+ and hence broke the Win32-build. Finished reversal of r18738 by
+ restoring
+ win32/transports/snmp_transport_inits.h.
+
+2010-05-16 18:17 bvassche
+
+ * ltmain.sh:
+
+ Follow-up for r18726: only pass -fstack-protector* flags to the
+ linker instead of all -f* flags such that it becomes less likely
+ that this modification causes trouble with non-GNU toolchains.
+
+2010-05-16 18:14 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_olducd:
+
+ Made shell code for converting a relative path to an absolute
+ path more
+ robust and converted "${...#...}" construct into echo + cut.
+
+2010-05-16 18:12 bvassche
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/util_funcs.c,
+ apps/snmptrapd_handlers.c:
+
+ More USING_UCD_SNMP_EXTENSIBLE_MODULE to
+ USING_UTILITIES_EXECUTE_MODULE substitutions, necessary to make
+ test 059 and 065 pass.
+
+2010-05-16 17:32 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ fix tests for checking shutdown of applications to not report
+ false negatives
+
+2010-05-16 12:15 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_olducd:
+
+ Made test T059 pass again. This test was recently broken by
+ passing arguments to it with absolute paths instead of relative
+ paths.
+
+2010-05-16 12:14 bvassche
+
+ * testing/fulltests/default/T065agentextend_olducd:
+
+ Added 'SKIPIFNOT USING_UTILITIES_EXECUTE_MODULE'.
+
+2010-05-16 11:42 bvassche
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmp_openssl.c:
+
+ Fixed several recently introduced compiler warnings.
+
+2010-05-16 11:41 bvassche
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c,
+ agent/mibgroup/host/hrSWInstalledTable.c,
+ agent/mibgroup/host/hrSWRunPerfTable.c,
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c,
+ apps/sshtosnmp.c:
+
+ Fixed several compiler warnings in old code.
+
+2010-05-16 09:59 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ CHANGES: Win32: winExtDLL: don't trigger a netsnmp_assert() when
+ no extension DLLs have been loaded.
+
+2010-05-15 17:31 tanders
+
+ * testing/RUNFULLTESTS:
+
+ stop-gap fix to unbreak "make test" for the nightly builds
+
+2010-05-15 10:59 bvassche
+
+ * agent/Makefile.in, agent/helpers/Makefile.in,
+ snmplib/Makefile.in:
+
+ Reverted r18727 because it caused build errors on Solaris, AIX
+ and HP-UX.
+
+2010-05-15 00:42 hardaker
+
+ * Makefile.in, configure, configure.d/config_modules_lib,
+ snmplib/Makefile.depend, snmplib/snmp_transport.c,
+ win32/build.pl:
+
+ revert r18738 since new transport require dynamicly built header
+ files
+
+2010-05-15 00:40 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ log env variables used to the invoked file
+
+2010-05-14 21:29 hardaker
+
+ * testing/fulltests/support/run_olducd:
+
+ fix script so it can be invoked outside the test environment
+ again
+
+2010-05-14 21:28 hardaker
+
+ * mibs/SNMP-TLS-TM-MIB.txt:
+
+ added the SNMP-TLS-TM-MIB with final IANA assignment slots
+
+2010-05-14 21:27 hardaker
+
+ * snmplib/snmptsm.c:
+
+ use final IANA assigned TSM prefixes
+
+2010-05-14 21:26 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h:
+
+ use final IANA assigned Domain numbers
+
+2010-05-14 21:25 hardaker
+
+ * snmplib/snmp_api.c, snmplib/transports/snmpTLSBaseDomain.c:
+
+ set default version and seclevel if tls/dtls
+
+2010-05-14 15:25 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ check rc from secname mapping; clarify comment
+
+2010-05-14 15:22 rstory
+
+ * snmplib/cert_util.c:
+
+ don't use unsorted container; don't free caller's container
+
+2010-05-14 15:22 rstory
+
+ * snmplib/container_binary_array.c:
+
+ add linear_search for unsorted containers
+
+2010-05-14 11:56 bvassche
+
+ * Makefile.in, configure, configure.d/config_modules_lib,
+ snmplib/Makefile.depend, snmplib/snmp_transport.c,
+ win32/build.pl, win32/transports/snmp_transport_inits.h:
+
+ Improved portability by removing the generated file
+ snmplib/transports/snmp_transport_inits.h.
+ Commented out the code in the configure script for generating
+ this header file.
+ Added configure-time code for checking whether the constructors
+ for all configured
+ transports are invoked from snmplib/snmp_transport.c.
+
+2010-05-14 11:00 bvassche
+
+ * README.win32:
+
+ Documentation: updated Cygwin build instructions.
+
+2010-05-14 09:15 bvassche
+
+ * agent/mibgroup/host/data_access/swinst_null.c,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/cert_util.c, snmplib/snmp_api.c, snmplib/snmp_openssl.c,
+ snmplib/snmpusm.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ Fixed several compiler warnings.
+
+2010-05-14 08:50 bvassche
+
+ * agent/Makefile.in, agent/helpers/Makefile.in,
+ snmplib/Makefile.in:
+
+ Added -no-undefined flag to library link commands such that
+ libtool can build DLLs on Win32.
+ Note: building DLLs on Win32 does not yet work because of the
+ circular dependency between
+ libnetsnmphelpers and libnetsnmpagent
+ (see also
+ http://www.net-snmp.org/wiki/index.php/Library_layering).
+
+2010-05-14 08:42 bvassche
+
+ * ltmain.sh:
+
+ libtool bug fix: also pass flags starting with -f to the linker
+ since these can affect linking. The flag -fstack-protector e.g.
+ triggers inclusion of libssp.
+
+2010-05-14 08:40 bvassche
+
+ * configure, configure.d/config_modules_lib,
+ configure.d/config_os_progs:
+
+ CHANGES: building: abort if the file program could not be found,
+ since this is essential for proper operation of libtool.
+ CHANGES: Cygwin: neither compile nor link winpipe.c.
+
+2010-05-13 08:58 bvassche
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ Ran autoreconf.
+
+2010-05-12 20:16 bvassche
+
+ * configure, configure.d/config_os_libs:
+
+ CHANGES: Linux: builds again with embedded Perl disabled (bug
+ 2985915).
+
+2010-05-12 19:47 bvassche
+
+ * agent/mibgroup/util_funcs/restart.c,
+ win32/netsnmpmibs/Makefile.in, win32/netsnmpmibs/netsnmpmibs.dsp:
+
+ Follow-up for r18684: un-break the Win32 MSVC build.
+
+2010-05-12 19:43 bvassche
+
+ * include/net-snmp/types.h:
+
+ Win32: fixed a typo and made indentation consistent.
+
+2010-05-12 19:11 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ construct temp build files in a separate directory
+
+2010-05-12 19:10 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix recently broken old perl functionality
+
+2010-05-12 18:01 hardaker
+
+ * local/net-snmp-cert:
+
+ added a --short option to shorten the show output to minimalistic
+
+2010-05-12 14:14 jsafranek
+
+ *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c:
+
+ CHANGES: snmpd: fixed a memory leak in TCP-MIB.
+
+2010-05-12 13:02 jsafranek
+
+ * agent/mibgroup/hardware/sensors/lmsensors_v3.c:
+
+ CHANGES: snmpd: fixed memory leak when reading sensors for
+ LM-SENSORS-MIB.
+
+2010-05-12 12:57 dts12
+
+ * perl/agent/agent.xs:
+
+ Revert revision 18689
+ Latest Win32 builds include support for strtoull.
+
+2010-05-12 12:05 jsafranek
+
+ * agent/mibgroup/hardware/sensors.h,
+ configure.d/config_modules_lib, configure.d/config_os_headers:
+
+ CHANGES: building: added detection of lm_sensors version.
+ I am not Autoconf guru, so I hope I got it right. The goal is to
+ define NETSNMP_USE_SENSORS_V3 *before* config_modules_agent
+ processes agent/mibgroup/hardware/sensors.h.
+
+2010-05-12 07:03 magfr
+
+ * include/net-snmp/library/snmpTLSTCPDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h:
+
+ CHANGES: snmplib: Add missing dependencies between transports.
+
+2010-05-12 03:08 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix title generation after change to what srcdir meant
+
+2010-05-12 02:30 hardaker
+
+ * local/net-snmp-cert:
+
+ undo last change which turned out to only cause errors if you had
+ a old .conf file around
+
+2010-05-12 02:13 hardaker
+
+ * local/net-snmp-cert:
+
+ fix v3_ca creation extension name
+
+2010-05-12 02:05 rstory
+
+ * snmplib/cert_util.c:
+
+ keep format version # in cert indexes; don't store hash type
+ string in index;
+
+2010-05-12 02:05 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ fix inverted conversion call; less verbose default debug
+
+2010-05-12 02:05 rstory
+
+ * snmplib/snmp_parse_args.c:
+
+ fix parsing of -T name/value pairs
+
+2010-05-11 23:33 tanders
+
+ * testing/RUNFULLTESTS:
+
+ bug fixing and better error messages for "make test" with
+ Test::Harness
+ (still doesn't work for me, though)
+
+2010-05-11 22:34 tanders
+
+ * testing/RUNFULLTESTS:
+
+ Do NOT hardcode /usr/bin/perl as the Perl path
+
+2010-05-11 20:16 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix stash file handling
+
+2010-05-11 20:16 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ long options suck ;-). prefer double dashes for long options to
+ match the rest of the Net-SNMP code base
+
+2010-05-11 20:16 hardaker
+
+ * testing/Makefile.in, testing/RUNFULLTESTS:
+
+ added ability to run only the failed tests from the last run
+
+2010-05-11 20:16 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ don't force color
+
+2010-05-11 20:16 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ cleanup of older
+
+2010-05-11 20:15 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ Minimally support the older Test::Harness perl module for running
+ the older tests at least
+
+2010-05-11 20:15 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmp_transport.h, snmplib/snmp_api.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ set a default securityName and securityModel if TLS or DTLS is in
+ use on the client side
+
+2010-05-11 20:15 hardaker
+
+ * include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmpusm.h, snmplib/snmp_api.c,
+ snmplib/snmpusm.c:
+
+ allow security models to perform more of the session setup; moved
+ more USM specific setup into it's setup routine
+
+2010-05-11 18:02 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix param to lookup peer cert
+
+2010-05-11 16:10 rstory
+
+ * snmplib/snmp_transport.c:
+
+ allow '-' in fqdn; add debug output for host specific config
+
+2010-05-11 15:46 dts12
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Ensure 'netsnmp_read_module' is available for perl build.
+
+2010-05-11 15:44 dts12
+
+ * perl/agent/agent.xs:
+
+ Fix perl build under Windows (strtoull not available)
+
+2010-05-10 07:07 magfr
+
+ * include/net-snmp/library/snmpSSHDomain.h,
+ snmplib/transports/snmpSSHDomain.c:
+
+ CHANGES: snmplib: Add missing symbol netsnmp_snmpSSHDomain_len,
+ make netsnmp_snmpSSHDomain const.
+
+2010-05-09 22:03 magfr
+
+ * testing/fulltests/default/T150solarishostcpu_olducd:
+
+ Do not require quotes around the CPU string as that depends on
+ how the agent is configured.
+
+2010-05-09 21:43 magfr
+
+ * agent/mibgroup/default_modules.h, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/util_funcs.h, agent/mibgroup/util_funcs/Exit.c,
+ agent/mibgroup/util_funcs/Exit.h,
+ agent/mibgroup/util_funcs/restart.c,
+ agent/mibgroup/util_funcs/restart.h:
+
+ CHANGES: snmpd: Extract the Exit and restart* subroutines from
+ util_func in order to make it possible to build less code for the
+ minimal case.
+
+2010-05-09 16:47 bvassche
+
+ * agent/mibgroup/util_funcs.c:
+
+ Fixed a compiler warning: made sure that the function
+ get_exec_output() returns a value when the preprocessor symbol
+ USING_UCD_SNMP_EXTENSIBLE_MODULE has not been defined.
+
+2010-05-09 16:45 bvassche
+
+ * configure, configure.d/config_modules_agent,
+ configure.d/config_modules_lib:
+
+ CHANGES: Cygwin: builds now also when the source files are
+ located on a Samba filesystem instead of a local filesystem.
+
+2010-05-09 13:05 magfr
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ Correct the if that tries to figure out if a sufficiently new gcc
+ is in use.
+
+2010-05-09 12:50 magfr
+
+ * apps/snmptrapd_handlers.c:
+
+ Check for the needed module and not some other one.
+ Log the correct missing symbol.
+
+2010-05-09 09:21 magfr
+
+ * agent/mibgroup/utilities/execute.c,
+ agent/mibgroup/utilities/execute.h:
+
+ CHANGES: snmpd: utilities/execute do not need anything from
+ util_funcs, so stop depending on it.
+
+2010-05-09 09:12 magfr
+
+ * agent/mibgroup/utilities/execute.c:
+
+ NEWS: snmpd: Removed the unused function xx_tokenize_exec_command
+ from utilities/execute.
+
+2010-05-09 09:01 magfr
+
+ * include/net-snmp/library/snmp_debug.h, snmplib/snmp_debug.c:
+
+ CHANGES: snmplib: Replace the debugging functions with dummies
+ when debugging is disabled.
+
+2010-05-09 08:02 magfr
+
+ * testing/fulltests/transports/T300udp_olducd:
+
+ Check that the UDP transport is enabled
+
+2010-05-09 08:01 magfr
+
+ * testing/fulltests/transports/Stransport,
+ testing/fulltests/transports/T300udp_olducd,
+ testing/fulltests/transports/T310tcp_olducd,
+ testing/fulltests/transports/T320udpv6_olducd,
+ testing/fulltests/transports/T330tcpv6_olducd,
+ testing/fulltests/transports/T350unix_olducd,
+ testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T361tlstcp_olducd:
+
+ Factor out check for mibII/system_mib
+
+2010-05-09 07:59 magfr
+
+ * testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ Add missing includes
+
+2010-05-08 23:16 magfr
+
+ * testing/RUNFULLTESTS:
+
+ Additionally fix make test for the uncommon case where builddir
+ == srcdir
+
+2010-05-08 22:55 magfr
+
+ * testing/Makefile.in, testing/RUNFULLTESTS,
+ testing/fulltests/support/build_capp,
+ testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_eval_tools.sh,
+ testing/fulltests/support/run_olducd:
+
+ CHANGES: testing: Make it possible to run the test suite from
+ anywhere.
+ Change the -D option to expect the path of the top source
+ directory.
+ Add an -srcdir option that is an alias for -D.
+ Add an -builddir option to designate the directory where the test
+ object is.
+ Put srcdir and builddir in the environment for the test scripts
+ Factor out the grep part of SKIPIF and SKIPIFNOT to ISDEFINED
+ Use more readable keys in the opts hash in RUNFULLTESTS
+ Adjust everything to use srcdir and builddir
+
+2010-05-08 22:42 magfr
+
+ * testing/fulltests/snmpv3/T040keymanagetest_capp.c:
+
+ Use correct argument types
+
+2010-05-08 22:07 magfr
+
+ * Makefile.in:
+
+ Consolidate the test and test-mibs targets.
+ Expose the testall target in the top makefile.
+
+2010-05-08 22:05 magfr
+
+ * snmplib/snmp_transport.c:
+
+ Do not abort when str is NULL as that is a perfectly valid input.
+
+2010-05-08 22:03 magfr
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c:
+
+ Use correct argument types
+
+2010-05-08 22:02 magfr
+
+ * testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ Add missing newline
+
+2010-05-07 21:11 rstory
+
+ * configure:
+
+ update for new configure.ac
+
+2010-05-07 19:21 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c:
+
+ fix handling of cert algorithm in fingerprints; convert in/out
+ fingerpints
+ from/to hex
+
+2010-05-07 19:21 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ dont specify hash type for fingerprint
+
+2010-05-07 19:21 rstory
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmp_openssl.h, snmplib/cert_util.c,
+ snmplib/snmp_openssl.c:
+
+ handle fingerprint types; drop san fields from cert struct;
+ consider directory
+ when partnering keys/certs
+
+2010-05-07 19:20 rstory
+
+ * configure.ac:
+
+ move default prompts earlier
+
+2010-05-06 15:40 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ better SAN extraction; tweak dubgus messages; quiet compiler
+ warnings
+
+2010-05-06 15:39 rstory
+
+ * snmplib/cert_util.c:
+
+ reduce cert debug output; debug instead of log_info in dumps
+
+2010-05-06 14:49 dts12
+
+ * snmplib/inet_ntop.c, snmplib/inet_pton.c:
+
+ Don't assume the presence of <string.h>
+ (bring into line with all other occurances)
+
+2010-05-06 14:41 dts12
+
+ * apps/snmptrapd.c, apps/snmptrapd_log.c, snmplib/callback.c:
+
+ CHANGES: Windows: Fix build under MinGW
+ back/forward port of revision 18631
+
+2010-05-05 17:43 rstory
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix type in log msg
+
+2010-05-05 17:43 rstory
+
+ * local/net-snmp-cert:
+
+ remove import for unused function
+
+2010-05-04 07:12 magfr
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ Negate reason given from SKIPIF
+
+2010-05-03 22:38 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ fix len in email cmp; more extract debugging
+
+2010-05-03 22:38 rstory
+
+ * snmplib/cert_util.c:
+
+ copy ocert to addional maps
+
+2010-05-03 14:20 marz
+
+ * local/net-snmp-cert:
+
+ remove dependency on perl module not present in CentOS
+
+2010-05-03 03:49 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ don't access struct internals directly
+
+2010-05-03 03:48 rstory
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/util_funcs.c,
+ apps/snmptrapd_handlers.c:
+
+ fix compiling with-out-mibmodules=utilities/execute
+
+2010-05-01 19:08 magfr
+
+ * testing/fulltests/default/T150solarishostcpu_olducd:
+
+ Correct the sought string to make the test pass when ok.
+
+2010-05-01 17:15 marz
+
+ * local/net-snmp-cert:
+
+ more consistent treatment of keyUsage, basicConstraints, other
+ x509v3 options
+
+2010-04-30 23:37 marz
+
+ * local/certgen-test.pl:
+
+ lame test script but covers a chunk of the code
+
+2010-04-30 23:00 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ mkinstalldirs instead instead of File::Path
+
+2010-04-30 23:00 hardaker
+
+ * testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/run_olducd:
+
+ ensure net-snmp-config script can be run from the build dir
+
+2010-04-30 21:31 marz
+
+ * local/net-snmp-cert:
+
+ handle gencert --ca
+
+2010-04-30 21:01 rstory
+
+ * snmplib/cert_util.c:
+
+ add help for certSecName; continue building cert indexes even if
+ we cant save
+ to persistent dir
+
+2010-04-30 20:48 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ fix check count for 822 names in the snmpd.log
+
+2010-04-30 20:48 hardaker
+
+ * snmplib/snmp_openssl.c, testing/fulltests/transports/Stlstests:
+
+ fix malloc unnderlength by 1 error
+
+2010-04-30 20:48 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ comment out the 822 tests; they're broken at the moment
+
+2010-04-30 19:36 marz
+
+ * local/net-snmp-cert:
+
+ don't lose SAN when signing w/ CA
+
+2010-04-30 18:46 hardaker
+
+ * snmplib/cert_util.c:
+
+ make name change to rfc822 from typoed 8220
+
+2010-04-30 18:46 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ added tests to do other subjectAltName mapping
+
+2010-04-30 17:31 marz
+
+ * local/net-snmp-cert:
+
+ fix issues 1,2,4 and -C handling
+
+2010-04-29 03:32 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c:
+
+ update tlstmCertToTSNTable to use cache + cert_util maps
+ container
+
+2010-04-29 03:31 rstory
+
+ * agent/helpers/table_tdata.c:
+
+ check insert return
+
+2010-04-29 03:31 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container_binary_array.c:
+
+ NEWS: snmplib: add remove function to container iterator;
+ implement it for
+ binary_array
+
+2010-04-29 03:31 rstory
+
+ * snmplib/container_binary_array.c:
+
+ make sure container sync incremented on sort, insert and remove
+
+2010-04-28 07:20 bvassche
+
+ * snmplib/inet_ntop.c:
+
+ Removed an obsolete comment.
+
+2010-04-28 00:33 hardaker
+
+ * testing/Makefile.in:
+
+ fix makefile for test target
+
+2010-04-28 00:33 hardaker
+
+ * testing/Makefile.in, testing/RUNFULLTESTS,
+ testing/fulltests/support/build_capp:
+
+ make the test suite run outside the source directory again.
+
+2010-04-28 00:33 hardaker
+
+ * testing/fulltests/transports/Stls:
+
+ deal with out-of-source tree building
+
+2010-04-28 00:32 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ testing to check certificate to securityname mappings and denials
+
+2010-04-28 00:32 hardaker
+
+ * testing/fulltests/transports/Stls:
+
+ created a mapped user
+
+2010-04-28 00:32 hardaker
+
+ * testing/fulltests/support/build_capp:
+
+ generate object code with -g debugging
+
+2010-04-28 00:32 hardaker
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c:
+
+ more accurate current API usage for scapi code
+
+2010-04-27 21:13 rstory
+
+ * snmplib/cert_util.c:
+
+ fix cert init duplicate call check
+
+2010-04-27 20:58 rstory
+
+ * snmplib/cert_util.c, snmplib/snmp_api.c:
+
+ convert user fingerprint to lower and strip colons; add extern
+ prototype
+ for cert init so we don't need header
+
+2010-04-27 20:15 rstory
+
+ * include/net-snmp/library/cert_util.h, man/snmpd.conf.5.def,
+ snmplib/cert_util.c, snmplib/snmp_api.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ separate cert init and cert loading; add certSecName config token
+
+2010-04-27 03:18 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ merge NETSNMP_FUNCTION and !NETSNMP_FUNCTION assert cases
+
+2010-04-27 03:02 rstory
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmp_openssl.h, snmplib/cert_util.c,
+ snmplib/snmp_openssl.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ lots of new cert functionality
+ - add ssl funcs for cert extensions and ssl cert chains
+ - functions and new netsmp_cert_map struct for looking up cert
+ mappings
+ - add certificate mapping for secname
+ - add code to build cert chains
+ - add subject to cert index cache
+ - rebuild indexes if any error while parsing index
+ - reformat dump output
+ - add NS_CERT_CA allowed_use flag
+ - add subject, issuer and issuer_cert to netsnmp_cert
+ - move cert container setup to its own function
+ - add cert subject name subcontainer
+
+2010-04-27 03:02 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c:
+
+ move ipv6 specific var decl inside ifdef
+
+2010-04-27 03:02 rstory
+
+ * agent/helpers/table_tdata.c,
+ include/net-snmp/agent/table_tdata.h:
+
+ CHANGES: agent: tdata helper now saves flags passed during
+ creation; add tdata
+ flag to NOT create the table container
+
+2010-04-27 03:01 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c,
+ snmplib/container_binary_array.c:
+
+ NEWS: snmplib: add interface for duplicating a container
+ CHANGES: snmplib: container changes: add flags field to container
+ meta-data;
+ chg binary_array container to use container meta-data flags
+
+2010-04-26 22:32 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ added a test to verify that when the transport is configured with
+ a remote certificate fingerprint the connection is denied
+
+2010-04-26 22:32 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests,
+ testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T361tlstcp_olducd:
+
+ added tests for -T flag usage and invalid user usage
+
+2010-04-26 20:54 hardaker
+
+ * testing/fulltests/transports/T399alias_olducd:
+
+ have the alias transport source the right Sv3config file
+
+2010-04-26 20:50 hardaker
+
+ * testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T361tlstcp_olducd:
+
+ working support of TLS/DTLS testing including cert generation
+
+2010-04-26 20:49 hardaker
+
+ * local/net-snmp-cert:
+
+ honor the config dir if specified via -C
+
+2010-04-26 20:49 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ fix realloc call for buffered packets
+
+2010-04-26 20:49 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ proper skip output for reporting reason
+
+2010-04-26 20:49 hardaker
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ remove trailing whitespace after backslash in macro
+
+2010-04-26 20:48 hardaker
+
+ * testing/fulltests/transports,
+ testing/fulltests/transports/Stransport,
+ testing/fulltests/transports/T300udp_olducd,
+ testing/fulltests/transports/T310tcp_olducd,
+ testing/fulltests/transports/T320udpv6_olducd,
+ testing/fulltests/transports/T330tcpv6_olducd,
+ testing/fulltests/transports/T350unix_olducd,
+ testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T361tlstcp_olducd,
+ testing/fulltests/transports/T399alias_olducd,
+ testing/fulltests/transports/test-localhost.cert,
+ testing/fulltests/transports/test-localhost.priv,
+ testing/fulltests/transports/test-user.cert,
+ testing/fulltests/transports/test-user.priv:
+
+ tests for minimally testing all the transports
+
+2010-04-26 20:48 hardaker
+
+ * testing/README:
+
+ minimally document new RUNFULLTESTS script
+
+2010-04-26 20:48 hardaker
+
+ * testing/T.c, testing/T2.sh, testing/data.keychange-md5,
+ testing/data.keychange-sha1, testing/data.keychange-sha1-des,
+ testing/data.kul-md5, testing/data.kul-sha1, testing/misctest.c,
+ testing/test_keychange.sh, testing/test_kul.sh:
+
+ deleted old files not worth restoring
+
+2010-04-26 20:48 hardaker
+
+ * testing/eval_testlist:
+
+ remove obsolute test list
+
+2010-04-26 20:47 hardaker
+
+ * testing/fulltests/snmpv3/T020hashtests_capp.c:
+
+ a hash-testing .c file I had laying around
+
+2010-04-26 20:47 hardaker
+
+ * testing/Makefile.in:
+
+ make testall target
+
+2010-04-26 20:47 hardaker
+
+ * testing/RUNFULLTESTS, testing/etimetest.c,
+ testing/fulltests/snmpv3,
+ testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c,
+ testing/fulltests/support/build_capp,
+ testing/fulltests/support/olducd_eval_tools.sh,
+ testing/keymanagetest.c, testing/scapitest.c:
+
+ move old C-code tests in place
+
+2010-04-26 20:47 hardaker
+
+ * testing/fulltests/default/T150solarishostcpu_olducd,
+ testing/fulltests/default/T151solarishostdisk_olducd,
+ testing/fulltests/default/T153solarisswap_olducd:
+
+ skip solaris comments
+
+2010-04-26 20:46 hardaker
+
+ * testing/Makefile.in:
+
+ fix invocation of RUNFULLTESTS
+
+2010-04-26 20:46 hardaker
+
+ * testing/Makefile.in, testing/fulltests/default,
+ testing/fulltests/default/Sv1config,
+ testing/fulltests/default/Sv2cconfig,
+ testing/fulltests/default/Sv3config,
+ testing/fulltests/default/Sv3usmconfigagent,
+ testing/fulltests/default/Sv3usmconfigbase,
+ testing/fulltests/default/Sv3usmconfigtrapd,
+ testing/fulltests/default/Sv3vacmconfig,
+ testing/fulltests/default/Svacmconfig,
+ testing/fulltests/default/Svanyconfig,
+ testing/fulltests/default/T001snmpv1get_olducd,
+ testing/fulltests/default/T014snmpv2cget_olducd,
+ testing/fulltests/default/T015snmpv2cgetnext_olducd,
+ testing/fulltests/default/T0160snmpv2cbulkget_olducd,
+ testing/fulltests/default/T016snmpv2cgetfail_olducd,
+ testing/fulltests/default/T017snmpv2ctov1getfail_olducd,
+ testing/fulltests/default/T018snmpv1tov2cgetfail_olducd,
+ testing/fulltests/default/T019snmpv2cnosuch_olducd,
+ testing/fulltests/default/T020snmpv3get_olducd,
+ testing/fulltests/default/T021snmpv3getnext_olducd,
+ testing/fulltests/default/T0220snmpv3bulkget_olducd,
+ testing/fulltests/default/T022snmpv3getMD5_olducd,
+ testing/fulltests/default/T023snmpv3getMD5AES_olducd,
+ testing/fulltests/default/T023snmpv3getMD5DES_olducd,
+ testing/fulltests/default/T024snmpv3getSHA1_olducd,
+ testing/fulltests/default/T025snmpv3getSHADES_olducd,
+ testing/fulltests/default/T026snmpv3getSHAAES_olducd,
+ testing/fulltests/default/T028snmpv3getfail_olducd,
+ testing/fulltests/default/T030snmpv3usercreation_olducd,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_olducd,
+ testing/fulltests/default/T049snmpv3inform_olducd,
+ testing/fulltests/default/T049snmpv3informauth_olducd,
+ testing/fulltests/default/T049snmpv3informpriv_olducd,
+ testing/fulltests/default/T050snmpv3trap_olducd,
+ testing/fulltests/default/T051snmpv2ctrap_olducd,
+ testing/fulltests/default/T052snmpv2cinform_olducd,
+ testing/fulltests/default/T053agentv1trap_olducd,
+ testing/fulltests/default/T054agentv2ctrap_olducd,
+ testing/fulltests/default/T055agentv1mintrap_olducd,
+ testing/fulltests/default/T056agentv2cmintrap_olducd,
+ testing/fulltests/default/T057trapdauthtest2_olducd,
+ testing/fulltests/default/T057trapdauthtest3_olducd,
+ testing/fulltests/default/T057trapdauthtest_olducd,
+ testing/fulltests/default/T058agentauthtrap_olducd,
+ testing/fulltests/default/T059trapdtraphandle_olducd,
+ testing/fulltests/default/T060trapdperl_olducd,
+ testing/fulltests/default/T061agentperl_olducd,
+ testing/fulltests/default/T065agentextend_olducd,
+ testing/fulltests/default/T070com2sec_olducd,
+ testing/fulltests/default/T071com2sec6_olducd,
+ testing/fulltests/default/T072com2secunix_olducd,
+ testing/fulltests/default/T100agenthup_olducd,
+ testing/fulltests/default/T110agentxget_olducd,
+ testing/fulltests/default/T111agentxset_olducd,
+ testing/fulltests/default/T112agentxsetfail_olducd,
+ testing/fulltests/default/T113agentxtrap_olducd,
+ testing/fulltests/default/T114agentxagentxtrap_olducd,
+ testing/fulltests/default/T115agentxperl_olducd,
+ testing/fulltests/default/T120proxyget_olducd,
+ testing/fulltests/default/T121proxyset_olducd,
+ testing/fulltests/default/T122proxysetfail_olducd,
+ testing/fulltests/default/T130snmpv1vacmget_olducd,
+ testing/fulltests/default/T131snmpv2cvacmget_olducd,
+ testing/fulltests/default/T132snmpv3vacmget_olducd,
+ testing/fulltests/default/T140snmpv1vacmgetfail_olducd,
+ testing/fulltests/default/T141snmpv2cvacmgetfail_olducd,
+ testing/fulltests/default/T142snmpv3vacmgetfail_olducd,
+ testing/fulltests/default/T150solarishostcpu_olducd,
+ testing/fulltests/default/T151solarishostdisk_olducd,
+ testing/fulltests/default/T152hostuptime_olducd,
+ testing/fulltests/default/T153solarisswap_olducd,
+ testing/fulltests/default/T160snmpnetstat_olducd,
+ testing/fulltests/default/T200snmpv2cwalkall_olducd,
+ testing/tests/Stransport, testing/tests/Sv1config,
+ testing/tests/Sv2cconfig, testing/tests/Sv3config,
+ testing/tests/Sv3usmconfigagent, testing/tests/Sv3usmconfigbase,
+ testing/tests/Sv3usmconfigtrapd, testing/tests/Sv3vacmconfig,
+ testing/tests/Svacmconfig, testing/tests/Svanyconfig,
+ testing/tests/T001snmpv1get, testing/tests/T014snmpv2cget,
+ testing/tests/T015snmpv2cgetnext,
+ testing/tests/T0160snmpv2cbulkget,
+ testing/tests/T016snmpv2cgetfail,
+ testing/tests/T017snmpv2ctov1getfail,
+ testing/tests/T018snmpv1tov2cgetfail,
+ testing/tests/T019snmpv2cnosuch, testing/tests/T020snmpv3get,
+ testing/tests/T021snmpv3getnext,
+ testing/tests/T0220snmpv3bulkget, testing/tests/T022snmpv3getMD5,
+ testing/tests/T023snmpv3getMD5AES,
+ testing/tests/T023snmpv3getMD5DES,
+ testing/tests/T024snmpv3getSHA1,
+ testing/tests/T025snmpv3getSHADES,
+ testing/tests/T026snmpv3getSHAAES,
+ testing/tests/T028snmpv3getfail,
+ testing/tests/T030snmpv3usercreation,
+ testing/tests/T035snmpv3trapdusermgmt,
+ testing/tests/T049snmpv3inform,
+ testing/tests/T049snmpv3informauth,
+ testing/tests/T049snmpv3informpriv, testing/tests/T050snmpv3trap,
+ testing/tests/T051snmpv2ctrap, testing/tests/T052snmpv2cinform,
+ testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap,
+ testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap,
+ testing/tests/T057trapdauthtest,
+ testing/tests/T057trapdauthtest2,
+ testing/tests/T057trapdauthtest3,
+ testing/tests/T058agentauthtrap,
+ testing/tests/T059trapdtraphandle, testing/tests/T060trapdperl,
+ testing/tests/T061agentperl, testing/tests/T065agentextend,
+ testing/tests/T070com2sec, testing/tests/T071com2sec6,
+ testing/tests/T072com2secunix, testing/tests/T100agenthup,
+ testing/tests/T110agentxget, testing/tests/T111agentxset,
+ testing/tests/T112agentxsetfail, testing/tests/T113agentxtrap,
+ testing/tests/T114agentxagentxtrap, testing/tests/T115agentxperl,
+ testing/tests/T120proxyget, testing/tests/T121proxyset,
+ testing/tests/T122proxysetfail, testing/tests/T130snmpv1vacmget,
+ testing/tests/T131snmpv2cvacmget,
+ testing/tests/T132snmpv3vacmget,
+ testing/tests/T140snmpv1vacmgetfail,
+ testing/tests/T141snmpv2cvacmgetfail,
+ testing/tests/T142snmpv3vacmgetfail,
+ testing/tests/T150solarishostcpu,
+ testing/tests/T151solarishostdisk, testing/tests/T152hostuptime,
+ testing/tests/T153solarisswap, testing/tests/T160snmpnetstat,
+ testing/tests/T200snmpv2cwalkall,
+ testing/tests/test-localhost.cert,
+ testing/tests/test-localhost.priv, testing/tests/test-user.cert,
+ testing/tests/test-user.priv:
+
+ NEWS: testing: Brand new test suite desigened to eventually test
+ more functionality, provide for support of unit-tests and support
+ of API tests
+
+2010-04-26 20:43 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ removed a debugging echo
+
+2010-04-26 20:43 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ more bug fixes for string searches
+
+2010-04-26 20:43 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ added a new macro to check a trapd count
+
+2010-04-26 20:42 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ use individual output files and fix some tests
+
+2010-04-26 20:42 hardaker
+
+ * testing/RUNFULLTESTS,
+ testing/fulltests/support/olducd_eval_tools.sh:
+
+ made existing test suite put out TAP output
+
+2010-04-26 20:42 hardaker
+
+ * testing/RUNTESTS, testing/TESTCONF.sh,
+ testing/eval_oneprogram.sh, testing/eval_onescript.sh,
+ testing/eval_suite.sh, testing/eval_tools.sh, testing/fulltests,
+ testing/fulltests/support,
+ testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_eval_tools.sh,
+ testing/fulltests/support/run_olducd:
+
+ beginning of moving UCD test suite into a larger subdirectory
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ allow running tests that match a regexp
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ summarize tests that failed
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ created the ability to have run_ scripts for executing certain
+ types
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ made the build-script-check routine generic
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ support for build scripts
+
+2010-04-26 20:40 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ provide infrastructure for building and renaming tests
+
+2010-04-26 20:40 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ more test infrastructure setup
+
+2010-04-26 20:40 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ support the keyword 'all'
+
+2010-04-26 20:40 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ enable group gathering
+
+2010-04-26 20:39 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ creatino of a new testing harness
+
+2010-04-25 17:37 bvassche
+
+ * README.win32:
+
+ Documentation update.
+
+2010-04-25 15:21 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32: reverted a recent unnecessary modification.
+
+2010-04-25 15:00 marz
+
+ * local/net-snmp-cert:
+
+ handle multiple --san args, check error codes on openssl cmds and
+ die on failure
+
+2010-04-25 14:18 bvassche
+
+ * win32/net-snmp/agent/mib_module_config.h:
+
+ Win32: builds again with SDK support disabled.
+
+2010-04-25 14:18 bvassche
+
+ * win32/libnetsnmptrapd/Makefile.in, win32/netsnmpmibs/Makefile.in,
+ win32/snmpd/Makefile.in, win32/snmptrapd/Makefile.in:
+
+ Win32: restored consistency between workspace-build and batch
+ build -- made sure that notification_log.c is only included in
+ the netsnmpmibs project.
+
+2010-04-25 13:58 bvassche
+
+ * include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ win32/libsnmp_dll/libsnmp.def, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in,
+ win32/transports/snmp_transport_inits.h:
+
+ Win32: fixes for recently introduced build breakage.
+
+2010-04-25 13:51 bvassche
+
+ * win32/libsnmp/Makefile.in, win32/libsnmp_dll/Makefile.in:
+
+ Win32: builds again with SDK support disabled.
+
+2010-04-25 13:48 bvassche
+
+ * include/net-snmp/types.h, snmplib/closedir.c, snmplib/opendir.c,
+ snmplib/readdir.c, snmplib/winservice.c:
+
+ Made sure that the Win32 MSVC 6 non-SDK build works again.
+
+2010-04-25 13:42 bvassche
+
+ * win32/Configure:
+
+ Removed an obsolete transformation rule.
+
+2010-04-25 12:05 bvassche
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ Made it again possible to disable HAVE_WIN32_PLATFORM_SDK when
+ building via win32/build.bat.
+
+2010-04-23 13:14 marz
+
+ * local/net-snmp-cert:
+
+ added --san DNS:a.b.c handling, help text fixes, other bug fixes.
+ Note multiple --san not supported yet
+
+2010-04-21 22:31 hardaker
+
+ * local/Makefile.in:
+
+ build the .made version of net-snmp-cert
+
+2010-04-21 22:31 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend after moving all the files around
+
+2010-04-21 20:16 rstory
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmp_openssl.h, snmplib/cert_util.c,
+ snmplib/snmp_openssl.c, snmplib/transports/snmpTLSBaseDomain.c:
+
+ build trust chain for client cert; add subject to index cache;
+ rebuild indexes
+ if any error while parsing index; reformat dump output
+ - add NS_CERT_CA allowed_use flag
+ - add subject, issuer and issuer_cert to netsnmp_cert
+ - move certToTSN_entry to cert_util header
+ - move container setup to its own function
+ - add subject name subcontainer
+ - add netsnmp_openssl_cert_dump_extensions,
+ netsnmp_openssl_cert_issued_by
+
+2010-04-21 16:16 hardaker
+
+ * man/snmpcmd.1.def:
+
+ document the single-dash / snmp.conf / double-dash precidence
+
+2010-04-21 16:15 hardaker
+
+ * man/snmp.conf.5.def:
+
+ document in the snmp.conf file that the tokens can be used for
+ command line applications too
+
+2010-04-21 16:15 hardaker
+
+ * man/snmp.conf.5.def:
+
+ document the file loading order and how to turn off host-specific
+ config
+
+2010-04-21 15:52 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/snmp_transport.h, man/snmp.conf.5.def,
+ snmplib/read_config.c, snmplib/snmp_api.c,
+ snmplib/snmp_transport.c:
+
+ NEWS: apps: Generic host-specific configuration snmp.conf files
+ are now read. See the HOST-SPECIFIC FILES section of the
+ snmp.conf manual page.
+
+2010-04-20 12:44 jsafranek
+
+ * snmplib/asn1.c:
+
+ CHANGES: snmplib: PATCH: 2971270: refuse to parse ASN.1 tokens
+ with wrong type field.
+ This may yield to problems with third-party applications which
+ may depend on parsing ugly ASN.1 data - we'll see...
+
+2010-04-20 00:12 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ combine remote fingerprint checking and check both sides
+
+2010-04-20 00:05 hardaker
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ if the remote fingerprint is specified, require an exact match
+
+2010-04-19 23:44 hardaker
+
+ * snmplib/fd_event_manager.c, snmplib/snmp_api.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix various minor bugs, especially in output messages
+
+2010-04-19 21:14 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more documentation and prototyping of needed RFC steps
+
+2010-04-19 21:14 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ convert if error check to return immediately so other code can be
+ outdented
+
+2010-04-19 21:13 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more comments from the RFC text
+
+2010-04-18 15:25 bvassche
+
+ * include/net-snmp/library/snmp_api.h, snmplib/transports,
+ win32/build.pl, win32/libsnmp/Makefile.in,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/Makefile.in,
+ win32/libsnmp_dll/libsnmp_dll.dsp, win32/netsnmpmibs/Makefile.in,
+ win32/transports, win32/transports/snmp_transport_inits.h:
+
+ Win32: builds again.
+
+2010-04-16 18:53 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ created a function to extract the securityName from the cert
+
+2010-04-16 18:53 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ don't need to set the accept state for TLS (just DTLS)
+
+2010-04-16 18:53 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more TLS comment documentation and steps taken from the RFC
+
+2010-04-16 13:55 marz
+
+ * local/net-snmp-cert:
+
+ numerous fixes, more verbose default output, additive show flags,
+ arbitrary config param handling, better help text
+
+2010-04-16 13:08 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ don't double declare a struct
+
+2010-04-16 03:30 rstory
+
+ * snmplib/cert_util.c:
+
+ cert util fixes
+ - remove unused vars and duplicate code
+ - check prt before free
+ - new func for type from filename
+ - new functions for finding subsets from filename
+ - fix types in key search function but then ifdef if (unused
+ function)
+
+2010-04-15 22:57 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ use a structure reference to predeclare the structure
+
+2010-04-15 21:25 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ correct declaration of the f_open command now requiring returning
+ a transport
+
+2010-04-15 21:02 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ remove unneeded config container
+
+2010-04-15 21:02 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ copy fingerprint transport information into new tls structure
+ within DTLSUDP so per-transport fingerprints can be specified
+
+2010-04-15 21:01 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ properly check for tlsbase pointers in dtlsudp_send()
+
+2010-04-15 21:01 hardaker
+
+ * configure.d/config_os_libs:
+
+ grep the transport list for TLS not just DTLS for checking for
+ -lssl
+
+2010-04-15 21:01 hardaker
+
+ * snmplib/snmp_api.c, snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more bug fixes and made TLSTCP work with the -T flag
+
+2010-04-15 21:01 hardaker
+
+ * snmplib/snmp_api.c, snmplib/transports/snmpTLSTCPDomain.c:
+
+ make the f_open call assign the new transport pointer to use (and
+ check if NULL as a failure condition
+
+2010-04-15 21:00 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c:
+
+ begin work moving DTLS config routine in place
+
+2010-04-15 21:00 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ pass the entire tlsbase to the client_setup
+
+2010-04-15 21:00 hardaker
+
+ * include/net-snmp/library/container.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h, snmplib/snmp_api.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ starting the storing of config data into the tlsbase
+
+2010-04-15 20:59 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ change client ssl setup to allow for direct fingerprint
+ specification of my/their certs
+
+2010-04-15 20:59 hardaker
+
+ * agent/snmp_agent.c, include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmp_api.c, snmplib/transports/snmpTLSTCPDomain.c:
+
+ split TLS into creation/close functions for eventual config
+ passing support
+
+2010-04-15 20:59 hardaker
+
+ * include/net-snmp/library/snmp_transport.h, snmplib/snmp_api.c:
+
+ pass transport config data to the transport f_config() function
+
+2010-04-15 20:59 hardaker
+
+ * snmplib/snmp_api.c:
+
+ return NULL on transport config error
+
+2010-04-15 20:58 hardaker
+
+ * include/net-snmp/library/snmp_transport.h,
+ snmplib/snmp_parse_args.c, snmplib/snmp_transport.c:
+
+ NEWS: apps: -T command line flag can be used to configure
+ transports
+
+2010-04-15 20:58 hardaker
+
+ * snmplib/snmp_api.c:
+
+ check transport NULLness before using
+
+2010-04-15 20:58 hardaker
+
+ * include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/types.h, snmplib/snmp_api.c:
+
+ beginning of work to make transports configurable with
+ supplimental configuration data and new calls for f_open/f_config
+
+2010-04-15 20:58 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ added text in comments from future RFC to document the
+ implementation
+
+2010-04-15 18:51 rstory
+
+ * snmplib/cert_util.c:
+
+ mark pem w/key as identity; tweak partner debug; compare file
+ ctime against index too
+
+2010-04-15 17:09 rstory
+
+ * snmplib/cert_util.c:
+
+ use local space to reformat cert for search
+
+2010-04-15 16:55 bvassche
+
+ * win32/net-snmp/agent/mib_module_config.h:
+
+ Partially reverted r18496:
+ - Commented out #define NETSNMP_USE_DLL again in file
+ win32/net-snmp/net-snmp-config.h on the 5.4 branch. This change
+ had been committed unintentionally.
+ - Re-enabled #define
+ USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE in
+ win32/net-snmp/agent/mib_module_config.h on the trunk and the
+ V5.5 branch. While build.bat reports an error on earlier branches
+ with this symbol enabled, there is no such problem on the trunk
+ or V5.5 branches and hence there was no reason to disable this
+ preprocessor symbol.
+
+2010-04-15 15:08 marz
+
+ * local/Makefile.in:
+
+ add net-snmp-cert to make/install
+
+2010-04-15 10:52 jsafranek
+
+ * testing/tests/T120proxyget, testing/tests/T121proxyset:
+
+ Tests not working for TCP should be skipped also for TCP6.
+
+2010-04-14 18:13 rstory
+
+ * snmplib/cert_util.c:
+
+ fix vars/text from cut-n-paste
+
+2010-04-14 17:45 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ fix comments
+
+2010-04-14 17:45 rstory
+
+ * snmplib/cert_util.c:
+
+ lots of cert updates
+ - change cert subdir searching to match net-snmp-cert
+ - update key type handling
+ - ignore world readable keys
+ - keep type in indexes
+ - tweak cert/key print format
+
+2010-04-14 17:44 rstory
+
+ * local/net-snmp-cert:
+
+ make net-snmp-cert executable
+
+2010-04-14 13:12 jsafranek
+
+ * testing/tests/Svacmconfig, testing/tests/T120proxyget,
+ testing/tests/T121proxyset, testing/tests/T122proxysetfail:
+
+ Fixed tests 'Proxy GET/SET support' and 'SNMPv2 vacm denial
+ support' with udp6 transport.
+
+2010-04-14 09:47 dts12
+
+ * win32, win32/bin, win32/dist, win32/dist/htmlhelp,
+ win32/dist/installer, win32/dist/scripts, win32/encode_keychange,
+ win32/lib, win32/libagent, win32/libhelpers,
+ win32/libnetsnmptrapd, win32/libsnmp, win32/libsnmp_dll,
+ win32/libucdmibs, win32/local, win32/net-snmp,
+ win32/net-snmp/agent, win32/net-snmp/library, win32/netsnmpmibs,
+ win32/snmpbulkget, win32/snmpbulkwalk, win32/snmpd,
+ win32/snmpdelta, win32/snmpdf, win32/snmpget, win32/snmpgetnext,
+ win32/snmpnetstat, win32/snmpset, win32/snmpstatus,
+ win32/snmptable, win32/snmptest, win32/snmptranslate,
+ win32/snmptrap, win32/snmptrapd, win32/snmpusm, win32/snmpvacm,
+ win32/snmpwalk:
+
+ Don't try to SVN-manage the Windows batch build infrastructure
+ (add release, debug, Makefile to the previous ignore list)
+
+2010-04-14 08:16 dts12
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Fix Windows batch build using Visual Studio with dynamic linking.
+ Unreferenced symbol introduced by SVN revision 18393
+
+2010-04-14 08:08 dts12
+
+ * win32/net-snmp/agent/mib_module_config.h:
+
+ CHANGES: Win32: Fix batch build using recent versions of Visual
+ Studio.
+ Partial back port of SVN revisions 17573 and 17696.
+
+2010-04-14 01:47 marz
+
+ * local/net-snmp-cert:
+
+ fix perms on created files -rw-------, umask(077)
+
+2010-04-13 22:15 marz
+
+ * local/net-snmp-cert, local/net-snmp-cert.conf:
+
+ fix perms, add --cn/-c, better dates defaults, snmp-tls org_unit,
+ added initial dummy config file
+
+2010-04-13 14:21 marz
+
+ * local/net-snmp-cert:
+
+ fixes for show cmds, cmdline, help
+
+2010-04-13 02:17 rstory
+
+ * snmplib/cert_util.c:
+
+ add support for key+cert in .pem files; misc tweaks
+
+2010-04-10 23:24 tanders
+
+ * snmplib/read_config.c:
+
+ build fix for C89 compilers (e.g. on HP-UX 10.20)
+
+2010-04-10 22:25 rstory
+
+ * agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable.h,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.h:
+
+ initial cut at tlstmCertToTSNTable
+
+2010-04-10 22:24 rstory
+
+ * include/net-snmp/library/cert_util.h:
+
+ add define of max hash constant
+
+2010-04-10 22:24 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c:
+
+ use cert util check for fingerprint len/algorithm
+
+2010-04-10 12:59 marz
+
+ * local/net-snmp-cert:
+
+ show cmd fixes
+
+2010-04-09 21:32 marz
+
+ * local/net-snmp-cert:
+
+ fairly functional (non-interactive) - be it known: there are bugs
+
+2010-04-09 20:54 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_internal.h:
+
+ merge some table_data.conf changes; remove unused code and a
+ bunch of verbose comments
+
+2010-04-08 14:57 rstory
+
+ * local/mib2c-update:
+
+ use full path
+
+2010-04-08 10:55 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_common.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c,
+ agent/mibgroup/sctp-mib/sctpScalars_common.c,
+ include/net-snmp/data_access/systemstats.h:
+
+ Check results of calls to netsnmp_c64_check32_and_update and log
+ an error.
+ This allows users to relate various 'c64 32 bit check failed'
+ errors with specific counter.
+
+2010-04-08 01:09 rstory
+
+ * include/net-snmp/agent/table_tdata.h:
+
+ add prototype for new function
+
+2010-04-08 01:05 rstory
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: translate NOSUCH*/ENDOFMIB errors during RESERVE1
+ to NOCREATION
+
+2010-04-08 00:56 rstory
+
+ * agent/helpers/table_tdata.c:
+
+ NEWS: snmpd: table_data/tdata next handler will not be called
+ during get
+ processing if no valid rows are found for the handler
+
+2010-04-08 00:56 rstory
+
+ * agent/helpers/table.c:
+
+ NEWS: snmpd: agent will no longer call table handlers if a set
+ request for
+ the handler has invalid indexes
+ CHANGES: snmpd: don't call cleanup on first request on bad
+ indexes. instead,
+ set actual error later, and free request data sets on first
+ request for sets
+
+2010-04-08 00:56 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ add function to validate fingerprint varbind
+
+2010-04-07 22:56 magfr
+
+ * configure, configure.d/config_modules_lib:
+
+ Solaris tr doesn't support character ranges reliably (see the
+ autoconf manual), change the expression to one that is simple
+ enough to b supported.
+
+2010-04-07 14:05 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Insert the cache helper correctly.
+
+2010-04-07 10:40 rstory
+
+ * agent/helpers/table_container.c, agent/helpers/table_tdata.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/table_container.h:
+
+ CHANGES: snmplib: add functions to remove list/row data from
+ request list
+
+2010-04-07 10:40 rstory
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ ifdef var decl for vars only used in later ifdef block
+
+2010-04-07 10:40 rstory
+
+ * include/net-snmp/library/check_varbind.h,
+ include/net-snmp/library/snmp-tc.h, snmplib/check_varbind.c,
+ snmplib/snmp-tc.c:
+
+ CHANGES: snmplib: add function to validate RowStatus and
+ StorageType varbinds
+ - also remove some duplicate code and fix comments indent mangled
+
+2010-04-07 10:39 rstory
+
+ * local/mib2c-update, man/mib2c-update.1.def:
+
+ update man page; fix shell redirect; create example rcfile if
+ missing
+
+2010-04-07 07:15 magfr
+
+ * apps/agentxtrap.c:
+
+ Use NETSNMP_DISABLE_MIB_LOADING instead of DISABLE_MIB_LOADING
+
+2010-04-07 00:38 magfr
+
+ * agent/mibgroup/host/data_access/swinst.h:
+
+ CHANGES: snmpd: Only enable hostSwInst rpm support on linux hosts
+ with librpm. This makes it possible to build on non-rpm linux
+ distributions.
+
+2010-04-07 00:14 magfr
+
+ * testing/tests/T021snmpv3getnext,
+ testing/tests/T035snmpv3trapdusermgmt,
+ testing/tests/T049snmpv3inform,
+ testing/tests/T049snmpv3informauth,
+ testing/tests/T049snmpv3informpriv, testing/tests/T050snmpv3trap,
+ testing/tests/T051snmpv2ctrap, testing/tests/T052snmpv2cinform,
+ testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap,
+ testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap,
+ testing/tests/T059trapdtraphandle, testing/tests/T100agenthup,
+ testing/tests/T111agentxset, testing/tests/T112agentxsetfail,
+ testing/tests/T113agentxtrap, testing/tests/T120proxyget,
+ testing/tests/T121proxyset, testing/tests/T122proxysetfail,
+ testing/tests/T141snmpv2cvacmgetfail:
+
+ CHANGES: testing: Change the test suite to work even if mib
+ lookup is disabled.
+
+2010-04-07 00:11 magfr
+
+ * testing/tests/T071com2sec6:
+
+ Check for com2sec6, not com2sec.
+
+2010-04-06 22:51 magfr
+
+ * configure, configure.d/config_modules_lib:
+
+ Move directory creation before the directories are used.
+
+2010-04-06 11:03 dts12
+
+ * FAQ:
+
+ Python is apparently client-side only.
+
+2010-04-06 10:06 dts12
+
+ * agent/snmpd.c:
+
+ Set supplementary groups before changing UID
+ (which probably involves giving up privileges)
+
+2010-04-06 08:57 dts12
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ Document large-disk statistics as latching at 2Tb (rather than
+ wrapping).
+
+2010-04-06 01:52 rstory
+
+ * local/mib2c, man/mib2c.1.def:
+
+ NEWS: mib2c: mib2c can now optionally run sed on generated code
+
+2010-04-06 01:49 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ convert C++ comments to C comments
+
+2010-04-06 01:49 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ move ptr check before prt use
+
+2010-04-06 01:49 rstory
+
+ * snmplib/cert_util.c:
+
+ add filename to debug on new certs; make static func to return
+ mode names
+
+2010-04-06 00:47 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ allow a found fingerprint self-signed cert for now; eventually
+ need to respect the MIB config table
+
+2010-04-06 00:12 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ mkdir snmplib/transports when DNE for building outside the source
+ dir
+
+2010-04-06 00:11 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ remove unused vars
+
+2010-04-06 00:11 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ remove unused variable
+
+2010-04-06 00:11 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ error code cleanup for tlsbase_wrapup_recv
+
+2010-04-05 23:12 hardaker
+
+ * snmplib/cert_util.c:
+
+ more better error/debug codes
+
+2010-04-05 23:08 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more comments from the future-RFC about the implementation; use
+ flags for server/client specification for expansion
+
+2010-04-05 23:08 hardaker
+
+ * snmplib/cert_util.c:
+
+ better error messages for usage constraints
+
+2010-04-05 23:08 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ move function protection logic in a top-level check
+
+2010-04-02 16:36 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ fix init ordering
+
+2010-04-02 16:36 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ mv tlsbase init function to a proper ctor for auto-calling
+
+2010-04-02 16:36 hardaker
+
+ * Makefile.in, configure, configure.d/config_modules_lib,
+ snmplib/snmp_transport.c, snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c:
+
+ CHANGES: generate the transport initialization function list
+ dynamically and use it
+
+2010-04-02 16:35 hardaker
+
+ * configure, configure.d/config_modules_lib,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpAliasDomain.c,
+ snmplib/snmpCallbackDomain.c, snmplib/snmpDTLSUDPDomain.c,
+ snmplib/snmpIPBaseDomain.c, snmplib/snmpIPXDomain.c,
+ snmplib/snmpIPv4BaseDomain.c, snmplib/snmpIPv6BaseDomain.c,
+ snmplib/snmpSSHDomain.c, snmplib/snmpSTDDomain.c,
+ snmplib/snmpSocketBaseDomain.c, snmplib/snmpTCPBaseDomain.c,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpTLSBaseDomain.c, snmplib/snmpTLSTCPDomain.c,
+ snmplib/snmpUDPBaseDomain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv4BaseDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c, snmplib/transports,
+ snmplib/transports/snmpAAL5PVCDomain.c,
+ snmplib/transports/snmpAliasDomain.c,
+ snmplib/transports/snmpCallbackDomain.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPBaseDomain.c,
+ snmplib/transports/snmpIPXDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpSTDDomain.c,
+ snmplib/transports/snmpSocketBaseDomain.c,
+ snmplib/transports/snmpTCPBaseDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c,
+ snmplib/transports/snmpUnixDomain.c:
+
+ CHANGES: moved transport code into a separate subdirectory in
+ snmplib
+
+2010-04-02 09:02 magfr
+
+ * agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c:
+
+ Do not attempt to check sizeof void to obtain the amount of
+ memory to copy.
+
+2010-04-01 17:11 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ include/net-snmp/library/cert_util.h:
+
+ instead of fwd declares, require other header
+
+2010-04-01 17:10 rstory
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ fix compiler warning
+
+2010-04-01 17:10 rstory
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ remove outdated debug msg
+
+2010-04-01 17:09 rstory
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ use certapi to find certs/keys
+
+2010-04-01 14:40 rstory
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ register extraX509SubDir token
+
+2010-04-01 14:18 rstory
+
+ * local/mib2c.table_data.conf:
+
+ check ptr before use
+
+2010-04-01 14:18 rstory
+
+ * agent/helpers/table_tdata.c:
+
+ check ptr before use
+
+2010-04-01 13:13 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_persist.c:
+
+ add persistent storage; token for creating entries in snmpd.conf;
+ fix index
+
+2010-04-01 13:12 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ NEWS: snmplib: new certificate api to support tls/dtls
+
+2010-04-01 13:12 rstory
+
+ * include/net-snmp/library/snmp_openssl.h, snmplib/snmp_openssl.c:
+
+ CHANGES: add functions to get fingerprint from cert and log
+ openssl errs
+
+2010-04-01 12:46 rstory
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ fix typo
+
+2010-04-01 10:33 bvassche
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ Builds again with pre-C90 compilers.
+
+2010-04-01 10:01 rstory
+
+ * local/mib2c.table_data.conf:
+
+ CHANGES: mib2c: table_data template enhancements
+ - add error checks during table init
+ - create cache earlier so we can bail on failure
+ - add option to create/delete row w/out adding/removing from
+ container
+
+2010-04-01 10:00 rstory
+
+ * include/net-snmp/agent/agent_read_config.h:
+
+ add helpful param names as hints in prototype
+
+2010-04-01 10:00 rstory
+
+ * agent/helpers/table_tdata.c:
+
+ search for container specific container before generic
+
+2010-04-01 10:00 rstory
+
+ * include/net-snmp/library/dir_utils.h,
+ include/net-snmp/library/file_utils.h, snmplib/dir_utils.c,
+ snmplib/file_utils.c:
+
+ NEWS: snmplib: enhance file utils and dir utils
+ - add optional stats struct to netsnmp_file
+ - generalize dir container filter, add context to callback
+ - add option to store netsnmp_files (w/stats) in container
+ instead of just name
+
+2010-04-01 10:00 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container_binary_array.c:
+
+ add prototype to header; check ptr before dereferencing
+
+2010-03-31 15:34 jsafranek
+
+ * local/Makefile.in, local/snmp-bridge-mib, man/Makefile.in,
+ man/snmp-bridge-mib.1, mibs/BRIDGE-MIB.txt, mibs/Makefile.in,
+ mibs/Makefile.mib:
+
+ NEWS: misc: PATCH: 2952708: from Jens Osterkamp: Added Perl
+ implementation of BRIDGE-MIB
+
+2010-03-31 02:12 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c:
+
+ proper packet labeling for DTLSUDP
+
+2010-03-31 02:11 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c:
+
+ use common context creation code
+
+2010-03-30 23:24 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ change TLS method to TLSv1 from SSLv23
+
+2010-03-30 23:23 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c,
+ snmplib/snmpTLSTCPDomain.c:
+
+ move more common data and functionality into the TLS base
+
+2010-03-30 23:20 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ minor TLS code cleanup
+
+2010-03-30 20:28 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ rework if() wrapping for less confusion in error handling
+
+2010-03-30 20:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ code consolidation in start_new_cached_connectio
+
+2010-03-30 20:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ rename generic 'bio' pointer to 'read_bio' for better readability
+
+2010-03-30 20:26 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ move buffered data creation to a separate function for reuse
+
+2010-03-30 17:52 marz
+
+ * local/net-snmp-cert:
+
+ initial cert gen wrapper script - not working
+
+2010-03-30 17:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ clean up error output so it doesn't report want_read and
+ want_write errors
+
+2010-03-30 17:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ renaming of sending function for clarity and check one more
+ location for needed outgoing packets
+
+2010-03-30 17:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ added dtlsudp tracing tokens
+
+2010-03-30 17:27 hardaker
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ CHANGES: added a new DEBUGTRACETOK() macro
+
+2010-03-30 17:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ better comments and more work on sending buffered data in the
+ right spots
+
+2010-03-30 17:26 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ fix arguments to get_commonName
+
+2010-03-30 17:26 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ beginning of caching of packets before they can be sent via DTLS
+
+2010-03-30 17:26 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ handle SSL_WANT_READ/WRITE better; still need to buffer outgoing
+ write data
+
+2010-03-30 17:26 hardaker
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ minor change to output error printing
+
+2010-03-29 15:20 dts12
+
+ * snmplib/vacm.c:
+
+ NEWS: snmpd: Fix handling of multiple matching VACM entries.
+ (Use the "best" match, rather than the first one).
+ Reported by Adam Lewis.
+ Note that this could potentially affect the behaviour of
+ existing access control configurations.
+
+2010-03-29 15:16 bvassche
+
+ * perl/agent/agent.xs:
+
+ CHANGES: perl:
+ NetSNMP::agent::netsnmp_request_infoPtr::getValue(): don't return
+ a pointer to a buffer on the stack. How can this have worked
+ reliably ??
+ CHANGES: perl:
+ NetSNMP::agent::netsnmp_request_infoPtr::setValue(),
+ ASN_COUNTER64: fixed bug that could cause this method to fail
+ even when a valid number was provided.
+
+2010-03-29 15:15 dts12
+
+ * snmplib/snmpusm.c:
+
+ CHANGES: snmplib: Fix agent crash when sending encrypted SNMPv3
+ traps.
+ Reported by Srikapilan Gandhi
+
+2010-03-29 12:46 bvassche
+
+ * perl/SNMP/t/startagent.pl:
+
+ Catch stderr on Windows too.
+
+2010-03-29 11:48 bvassche
+
+ * perl/agent/agent.xs:
+
+ Builds again with pre-C90 compilers.
+
+2010-03-29 11:19 bvassche
+
+ * include/net-snmp/library/snmp_api.h, perl/OID/OID.xs,
+ perl/SNMP/SNMP.xs, perl/agent/agent.xs:
+
+ CHANGES: perl: fixed a memory leak triggered by destroying a
+ NetSNMP::agent::netsnmp_handler_registration object.
+ CHANGES: perl: fixed a memory leak triggered by failure of
+ creating a NetSNMP::OID object.
+ CHANGES: perl: fixed a memory leak triggered by the
+ NetSNMP::OID::gettable() subroutine.
+ CHANGES: perl: fixed an out-of-bounds array access triggered by
+ the implementation of NetSNMP::SNMP.
+ CHANGES: perl: fixed a memory leak triggered by a PDU processing
+ error in NetSNMP::SNMP.
+ CHANGES: perl: fixed memory leaks triggered by creating an SNMPv3
+ session via NetSNMP::SNMP.
+
+ Also fixed the uninitialized variable accesses triggered by
+ adding a varbind to a PDU via NetSNMP::SNMP introduced a few days
+ ago.
+
+ The bugs mentioned above have been found by inspecting the output
+ of the following shell command:
+ cd perl && valgrind --trace-children=yes --leak-check=full make
+ test
+
+2010-03-29 10:59 bvassche
+
+ * perl/SNMP/t/startagent.pl:
+
+ Switched back to the previous way of starting processes
+ asynchronously because it is more reliable.
+
+2010-03-29 09:27 bvassche
+
+ * perl/SNMP/t/startagent.pl:
+
+ Do not only save snmpd / snmptrapd logs but also the stdout /
+ stderr output generated by these processes.
+
+2010-03-28 16:09 bvassche
+
+ * perl/SNMP/t/startagent.pl:
+
+ Changes in perl/SNMP/t/startagent.pl:
+ - Added command-line option -d for snmpd and snmptrapd.
+ - snmpd and snmptrapd output is now saved to a log file (one per
+ test).
+ - Rewrote Perl code for starting the snmpd/snmptrapd processes
+ such that the same code works on Unix and on Windows.
+
+2010-03-28 13:37 bvassche
+
+ * include/net-snmp/library/snmp_api.h, snmplib/tools.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmplib: added the functions netsnmp_malloc(),
+ netsnmp_calloc(), netsnmp_realloc(), netsnmp_strdup() and
+ netsnmp_free().
+ CHANGES: Win32: snmplib: removed the troublesome #define malloc
+ netsnmp_malloc etc. This means that when calling functions from
+ the Net-SNMP DLL from C or C++ code that is being linked against
+ another version of the MSVC runtime DLL than the Net-SNMP DLL,
+ and when allocating memory that will be freed by the Net-SNMP
+ DLL, you will either have to call the Net-SNMP memory allocation
+ functions explicitly or redefine malloc() etc. yourself.
+
+2010-03-28 12:46 bvassche
+
+ * perl/SNMP/SNMP.xs:
+
+ Fixed a recently reintroduced compiler warning.
+
+2010-03-27 18:42 bvassche
+
+ * Makefile.in:
+
+ Added a check for invocation of calloc() from XSUBs.
+
+2010-03-26 19:16 bvassche
+
+ * include/net-snmp/library/snmp_api.h, perl/OID/OID.xs,
+ perl/SNMP/SNMP.xs, perl/TrapReceiver/TrapReceiver.xs:
+
+ Follow-up for r18368 and r18369: made sure that the Net-SNMP Perl
+ extensions compile without triggering preprocessor warnings about
+ redefining malloc etc. nor trigger "Free to wrong pool" errors on
+ Windows.
+
+2010-03-26 14:44 bvassche
+
+ * include/net-snmp/library/snmpIPBaseDomain.h,
+ snmplib/snmpIPBaseDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c:
+
+ Refactoring: introduced a new function:
+ netsnmp_set_non_blocking_mode().
+
+2010-03-26 11:58 bvassche
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/utilities/execute.c,
+ apps/snmpbulkget.c, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmptest.c, apps/snmptrapd_handlers.c, apps/snmptrapd_log.c,
+ snmplib/int64.c, snmplib/mib.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/snmp_logging.c,
+ snmplib/snmp_parse_args.c, snmplib/snmpv3.c,
+ snmplib/text_utils.c:
+
+ Fixed compiler warnings about using variables of type char as an
+ array subscript. Note: as far as I know these warnings are only
+ reported when using the Cygwin glibc headers.
+
+2010-03-26 10:41 bvassche
+
+ * snmplib/strtoull.c:
+
+ Added missing #include directive (on Windows MSVC was complaining
+ about size_t while processing <net-snmp/library/system.h>).
+
+2010-03-25 20:07 bvassche
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ CHANGES: agentx: changed default TCP target from 0.0.0.0:705 to
+ localhost:705. This is not only a more secure choice but it also
+ makes it possible on Windows systems to let an AgentX subagent
+ connect to an AgentX master agent running on the same system
+ without having to set the variable NETSNMP_DS_AGENT_X_SOCKET.
+
+2010-03-25 16:11 bvassche
+
+ * perl/OID/OID.xs, perl/SNMP/SNMP.xs,
+ perl/TrapReceiver/TrapReceiver.xs, perl/agent/agent.xs:
+
+ CHANGES: Win32: perl: fixed several "Free to wrong pool" errors.
+ Note: since calloc() is not redefined in <CORE/XSUB.h> using
+ calloc() directly or indirectly leads to "Free to wrong pool"
+ errors, at least on Windows.
+
+2010-03-25 16:04 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: Win32: building: made building more silent by not
+ redefining malloc() or free() during compilation of Perl
+ extensions (resulted in warnings about malloc() / free()
+ redefinition in the Perl header CORE/XSUB.h).
+
+2010-03-25 15:06 bvassche
+
+ * include/net-snmp/library/system.h, perl/SNMP/SNMP.xs,
+ perl/agent/agent.xs:
+
+ CHANGES: BUG: 2969872: made sure that SOCK_STARTUP is invoked
+ before init_agent() on Windows.
+
+2010-03-25 13:39 jsafranek
+
+ * apps/snmpbulkget.c, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpdf.c, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpnetstat/main.c, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c, apps/snmptrap.c,
+ apps/snmpusm.c, apps/snmpvacm.c, apps/snmpwalk.c,
+ include/net-snmp/library/snmp_parse_args.h,
+ snmplib/snmp_parse_args.c:
+
+ Use macros instead of magic numbers as netsnmp_parse_args return
+ codes.
+
+2010-03-25 13:30 bvassche
+
+ * win32/Configure, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in:
+
+ CHANGES: Win32: building: simplified the build process by
+ removing the file win32/libsnmp_dll/libsnmp.def.in. Which IPv6
+ functions are exported from netsnmp.dll is now determined by
+ which of the functions in this DLL have been declared as
+ NETSNMP_IMPORT.
+
+2010-03-24 20:11 rstory
+
+ * snmplib/snmp_enum.c:
+
+ don't use passed ptr as temp var; use snmp_enum_lists in init
+ test
+
+2010-03-24 20:10 rstory
+
+ * include/net-snmp/library/default_store.h:
+
+ add NETSNMP_DS_LIB_CERT_EXTRA_SUBDIR
+
+2010-03-24 20:10 rstory
+
+ * snmplib/snmpTLSBaseDomain.c, snmplib/snmp_api.c:
+
+ move cert init earlier (have tls_bootstrap call it)
+
+2010-03-24 20:10 rstory
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ fix compiler warnings; add cert debug msgs in server setup; free
+ ssl log data
+
+2010-03-24 10:47 jsafranek
+
+ * apps/snmpbulkget.c, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpdf.c, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpnetstat/main.c, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c, apps/snmptrap.c,
+ apps/snmpusm.c, apps/snmpvacm.c, apps/snmpwalk.c,
+ include/net-snmp/library/snmp_parse_args.h,
+ snmplib/snmp_parse_args.c:
+
+ CHANGES: apps: return nozero exit code when parsing of certain
+ parameter fails.
+ E.g. '-A' parameter with too short passphrase or Ku key
+ generation in general.
+
+2010-03-24 07:11 magfr
+
+ * apps/agentxtrap.c:
+
+ Correct the type of the id/description of the Open-PDU.
+
+2010-03-22 18:29 bvassche
+
+ * Makefile.in:
+
+ Updates for "make checks":
+ - Made sure that exit code 0 is generated when the check is
+ successful and that
+ exit code 1 is generated when the check failed.
+ - Made "makefilecheck" skip Subversion bookkeeping files and also
+ the makefile
+ that contains "makefilecheck".
+
+2010-03-22 16:10 dts12
+
+ * mibs/NET-SNMP-PASS-MIB.txt:
+
+ Fix typo in default IpAddress value
+ (See Bug #2972141)
+
+2010-03-22 15:44 rstory
+
+ * Makefile.in, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/winExtDLL.c, agent/snmp_agent.c,
+ apps/snmpnetstat/main.c, snmplib/callback.c,
+ snmplib/read_config.c, snmplib/strtok_r.c, snmplib/strtoull.c:
+
+ change all assert() to netsnmp_assert(); add assertcheck to top
+ level makefile
+
+2010-03-22 15:24 bvassche
+
+ * mibs/UCD-DISKIO-MIB.txt:
+
+ Follow-up for r18349: added missing comma such that it is again
+ possible to compile UCD-DISKIO-MIB.
+
+2010-03-22 14:36 dts12
+
+ * agent/snmpd.c, snmplib/snmp_parse_args.c:
+
+ Fix build when MIB loading is disabled (broken by SVN revision
+ 18341)
+ Report default MIB path for client apps too.
+
+2010-03-22 13:59 dts12
+
+ * man/snmp_api_errstring.3, man/snmp_close.3, man/snmp_error.3,
+ man/snmp_free_pdu.3, man/snmp_open.3, man/snmp_perror.3,
+ man/snmp_read.3, man/snmp_select_info.3, man/snmp_send.3,
+ man/snmp_sess_perror.3, man/snmp_timeout.3:
+
+ CHANGES: man: BUG: 2972860: Update broken references
+
+2010-03-22 13:49 dts12
+
+ * mibs/UCD-DISKIO-MIB.txt, mibs/UCD-DLMOD-MIB.txt,
+ mibs/UCD-IPFILTER-MIB.txt, mibs/UCD-SNMP-MIB.txt:
+
+ CHANGES: mibs: BUG: 2973890: Fix imports, DiskIOEntry list and
+ revision histories
+
+2010-03-22 11:55 bvassche
+
+ * agent/mibgroup/winExtDLL.c, include/net-snmp/library/snmp_api.h:
+
+ Win32, winExtDLL: solved the mystery of "ASN type zero". The
+ winExtDLL code does now no longer trigger conversions of Windows
+ ASN varbinds with ASN type zero. Note: this code change does not
+ change the agent behavior.
+
+2010-03-20 20:21 bvassche
+
+ * include/net-snmp/library/mib.h,
+ include/net-snmp/library/read_config.h:
+
+ Builds again with MSVC.
+
+2010-03-20 20:20 bvassche
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ Added a trailing backslash (should have been added in the
+ previous commit).
+
+2010-03-20 19:36 bvassche
+
+ * agent/agent_registry.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/agent/extend.c, agent/mibgroup/agent/nsDebug.c,
+ agent/mibgroup/agent/nsLogging.c, agent/mibgroup/agentx/master.c,
+
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/vacm_conf.c, agent/mibgroup/misc/ipfwacc.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c,
+ agent/mibgroup/util_funcs.c, agent/snmpd.c,
+ apps/snmpnetstat/route.c, apps/snmptrapd.c,
+ include/net-snmp/agent/table_dataset.h, include/net-snmp/types.h,
+ snmplib/snmpIPv6BaseDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv6Domain.c, snmplib/system.c, snmplib/tools.c,
+ snmplib/winpipe.c, snmplib/winservice.c:
+
+ CHANGES: libsnmp: changed the type of the fourth argument of
+ netsnmp_set_row_column() from const char* to const void* such
+ that no cast is necessary when passing another datatype then
+ char* or const char*.
+ CHANGES: Win32: changed in_addr_t from u_int to u_long such that
+ it matches the datatype of sockaddr_in::sin_addr.
+ Also, fixed several compiler warnings (mostly char * <> u_char *
+ mismatches) and removed some casts.
+
+2010-03-20 19:16 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Fixed the compiler warnings reported by gcc (MinGW).
+
+2010-03-20 19:05 bvassche
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Added configure test for sigprocmask.
+
+2010-03-20 09:14 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Refactoring: moved duplicated code into a new function.
+
+2010-03-19 22:56 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c, agent/snmpd.c, snmplib/parse.c:
+
+ Report MIB and config directories search paths on errors
+ (and in the help message)
+
+2010-03-19 13:12 bvassche
+
+ * agent/agent_registry.c:
+
+ CHANGES: snmpd: made the error message that is logged when
+ duplicate registration is attempted more detailed.
+
+ An example:
+ (before)
+ duplicate registration (mibII/snmp,
+ C:\WINDOWS\System32\snmpmib.dll)
+ handler registration failed.
+ (after)
+ duplicate registration: MIB modules mibII/snmp and
+ C:\WINDOWS\System32\snmpmib.dll (oid .1.3.6.1.2.1.11).
+ handler registration failed.
+
+2010-03-19 12:40 bvassche
+
+ * agent/mibgroup/winExtDLL.c, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in:
+
+ CHANGES: Win32: winExtDLL: multiple varbind set requests are now
+ processed correctly.
+ CHANGES: Win32: winExtDLL: made error codes in SNMP response PDUs
+ as RFC-compliant as possible.
+ CHANGES: Win32: winExtDLL: if loading an extension DLL fails, the
+ reason why loading failed is now logged.
+ CHANGES: Win32: winExtDLL: fixed a memory leak that occurred when
+ SnmpExtensionQuery(Ex) failed. This memory leak has been found
+ via source reading. Note: it is not clear whether it was possible
+ to trigger this memory leak. This leak is certainly not triggered
+ by every request for which a response with non-zero error status
+ is sent back.
+
+2010-03-18 16:29 rstory
+
+ * agent/mibgroup/agent/nsLogging.c,
+ include/net-snmp/library/snmp_logging.h, snmplib/snmp_logging.c:
+
+ keep count of enabled logs; use this count to determine when to
+ log to stderr
+
+2010-03-18 16:28 rstory
+
+ * apps/snmptranslate.c, apps/snmptrapd.c, snmplib/cert_util.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c:
+
+ NEWS: snmplib: new snmp token logOption allows specifying log
+ destinations vi conf files
+ - if stderr log enabled because of no log destination, turn it
+ off when a
+ log destination is enabled
+ - don't call netsnmp_enable_stderrlog() from apps anymore
+
+2010-03-18 15:31 rstory
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpUDPBaseDomain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv4BaseDomain.c:
+
+ udp transport inheritance tweaks
+ - move basic udp recvfrom/sendto code from UDPDomain to
+ UDPBaseDomain
+ - tweak upd recvfrom/sendto to call udpbase verstion
+ - tweak udpipv4 recvfrom/sendto to call udpbase version
+ - also fixed netsnmp_ipv4_* -> netsnmp_udpipv4_*
+ - tweak DTLSUDPDomain ot use udpbase_* instead of udp_*
+
+2010-03-18 15:21 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/snmp_api.c:
+
+ protect cert header and init call with ifdefs
+
+2010-03-17 19:01 rstory
+
+ * snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSTCPDomain.c:
+
+ use new utility routine for cert names
+
+2010-03-17 19:01 rstory
+
+ * snmplib/cert_util.c:
+
+ move snmp_openssl header after openssl headers
+
+2010-03-17 19:00 rstory
+
+ * include/net-snmp/library/snmp_openssl.h, snmplib/snmp_openssl.c:
+
+ add routines to pull/dump names from X509 certs
+
+2010-03-17 19:00 rstory
+
+ * snmplib/cert_util.c:
+
+ use enum lists to manage directory indexes
+
+2010-03-17 19:00 rstory
+
+ * snmplib/snmp_enum.c:
+
+ initialize static storage before use; protect enum init from
+ multiple calls
+
+2010-03-17 18:54 rstory
+
+ * README.agent-mibs:
+
+ add info about new tsm/tls mibs
+
+2010-03-17 18:54 rstory
+
+ * snmplib/snmpTLSBaseDomain.c, snmplib/snmp_api.c:
+
+ move cert init to snmp init
+
+2010-03-17 13:37 bvassche
+
+ * mibs/NET-SNMP-AGENT-MIB.txt, mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Updated MIB revision history.
+
+2010-03-17 13:29 bvassche
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: fixed one leak-at-exit.
+
+2010-03-17 12:44 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ CHANGES: BUG: 2971257: Fixed winExtDLL handling of multi-varbind
+ getNext requests with OIDs in reverse lexicographical order.
+
+2010-03-17 10:25 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ More winExtDLL debug output tuning.
+
+2010-03-16 19:31 bvassche
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ Compiles now with MIB compilers that do not recognize a double
+ dash as the end of a MIB comment.
+
+2010-03-16 19:27 bvassche
+
+ * mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Fixed two syntax errors.
+
+2010-03-16 19:18 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ CHANGES: Win32: winExtDLL: fixed a bug in getNext handling that
+ could cause the MIB output to be truncated.
+
+2010-03-16 18:50 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Made winExtDLL debug output more detailed.
+
+2010-03-16 15:24 bvassche
+
+ * include/net-snmp/library/snmpSocketBaseDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h:
+
+ Made sure that C++ programs that include Net-SNMP header files
+ compile again.
+
+2010-03-15 07:20 magfr
+
+ * agent/helpers/instance.c:
+
+ Make it compile with --disable-deprecated again.
+
+2010-03-15 07:19 magfr
+
+ * agent/helpers/debug_handler.c:
+
+ Disable all the printing if debug output is off.
+
+2010-03-15 00:17 tanders
+
+ * perl/TrapReceiver/TrapReceiver.xs, perl/agent/agent.xs:
+
+ fix compiler warnings regarding printf format
+
+2010-03-15 00:07 tanders
+
+ *
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+ agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ fix compiler warnings regarding printf format
+
+2010-03-14 21:05 rstory
+
+ * agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h:
+
+ make sure header ifdef name is unique
+
+2010-03-14 21:04 rstory
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swrun.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h,
+ agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h:
+
+ add missing init/shutdown prototypes to fix compiler warnings
+
+2010-03-14 21:03 rstory
+
+ * snmplib/data_list.c:
+
+ move debug message earlier
+
+2010-03-14 21:02 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container_list_ssll.c:
+
+ add prototype for netsnmp_init_container; fix compler warning
+
+2010-03-14 20:51 magfr
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ Correct netsnmp_assert_or_return and netsnmp_assert_or_msgreturn
+ for the NETSNMP_NO_DEBUGGING case
+
+2010-03-14 19:10 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c,
+ snmplib/snmpTLSBaseDomain.c:
+
+ rename cert init/shutdown funcs; only compile cert_utils if
+ using/have SSL; init certs from tls base
+
+2010-03-14 19:09 rstory
+
+ * snmplib/cert_util.c:
+
+ call netsnmp_init_openssl instead of netsnmp_init_tlsbase
+
+2010-03-14 19:09 rstory
+
+ * include/net-snmp/library/snmp_api.h:
+
+ update for renamed objects in version 08 of the dtls draft
+
+2010-03-14 19:08 rstory
+
+ * agent/mibgroup/tlstm-mib, agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.h,
+ agent/mibgroup/tsm-mib, agent/mibgroup/tsm-mib.h,
+ agent/mibgroup/tsm-mib/snmpTsmStats,
+ agent/mibgroup/tsm-mib/snmpTsmStats.h,
+ agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c,
+ agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h:
+
+ import initial code for dtls mibs
+
+2010-03-14 19:08 rstory
+
+ * mibs/TLSTM-MIB.txt:
+
+ TLSTM-MIB from draft-ietf-isms-dtls-tm-09.txt
+
+2010-03-14 17:21 bvassche
+
+ * agent/helpers/snmp_get_statistic.c, agent/mibgroup/mibII/icmp.c:
+
+ Fixed a few more compiler warnings.
+
+2010-03-14 14:10 bvassche
+
+ * perl/default_store/test.pl:
+
+ Follow-up for r17384: changed NETSNMP_DS_MAX_SUBIDS from 40 to
+ 48.
+
+2010-03-14 13:53 bvassche
+
+ * configure, configure.d/config_os_progs:
+
+ Changes:
+ - Removed -Wno-char-subscripts from DEVFLAGS. Using a variable or
+ expression of
+ type char as an array index is almost always an error.
+ Furthermore,
+ -Wchar-subscript does not trigger any warnings on the Net-SNMP
+ code base.
+ - Removed -Winline from DEVFLAGS. Not only was nobody paying
+ attention to the
+ messages triggered by -Winline, but recent versions of the gcc
+ compiler are
+ better than humans at deciding which functions should be inlined
+ and which
+ ones not.
+
+2010-03-14 13:39 bvassche
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Reran autoreconf.
+
+2010-03-14 13:39 bvassche
+
+ * agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/data_access/swrun_procfs_status.c,
+ agent/mibgroup/host/hrSWRunPerfTable.c,
+ agent/mibgroup/host/hrSWRunTable.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c:
+
+ Fixed several compiler warnings.
+
+2010-03-14 13:36 bvassche
+
+ * perl/SNMP/SNMP.xs:
+
+ Removed the '0x' prefix again from a debug statement that was
+ introduced in r18282.
+
+2010-03-13 19:07 bvassche
+
+ * perl/ASN/ASN.xs, perl/OID/OID.xs, perl/SNMP/SNMP.xs,
+ perl/TrapReceiver/TrapReceiver.xs, perl/TrapReceiver/ppport.h,
+ perl/agent/agent.xs:
+
+ Fixed most compiler warnings triggered by the source code in the
+ perl subdirectory.
+ Note: these changes may contain some real bug fixes.
+
+2010-03-13 09:57 bvassche
+
+ * snmplib/cert_util.c, snmplib/snmp_api.c:
+
+ Fixed several recently introduced compiler warnings.
+
+2010-03-13 01:16 hardaker
+
+ * acconfig.h, configure, include/net-snmp/net-snmp-config.h.in:
+
+ define the TLSTCP DOMAIN
+
+2010-03-13 01:16 hardaker
+
+ * snmplib/snmp_transport.c:
+
+ fix ifdef typo
+
+2010-03-12 20:26 hardaker
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ change debugging symbol names to a generic tls string
+
+2010-03-12 20:22 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ initial working SNMP over TLS over TCP connection
+
+2010-03-12 20:22 hardaker
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ print a more complete OpenSSL stack
+
+2010-03-12 20:22 hardaker
+
+ * snmplib/snmptsm.c:
+
+ fix assert statements
+
+2010-03-12 20:21 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h:
+
+ added an accepted_bio pointer for the bio after SSL_accept
+
+2010-03-12 20:21 hardaker
+
+ * snmplib/snmp_transport.c:
+
+ add the ability for f_copy and f_config
+
+2010-03-12 20:21 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ missing ;
+
+2010-03-12 20:21 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ add a f_copy pointer
+
+2010-03-12 20:20 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ return int not int * on error
+
+2010-03-12 20:20 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ added a f_config function for transports
+
+2010-03-12 11:53 dts12
+
+ * apps/snmptable.c:
+
+ CHANGES: snmptable: PATCH: 2850067: Suppress extraneous "index"
+ header token
+ Patch supplied by Dan Nelson
+
+2010-03-12 11:43 dts12
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c:
+
+ Remove duplicate definition of
+ getulongfromsysclassnetstatistics()
+
+2010-03-11 16:52 dts12
+
+ * man/snmpcmd.1.def:
+
+ Document the format of the -e/-E command line options.
+
+2010-03-11 16:47 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Remove mention of the (abandoned) 'dataset2' helper.
+
+2010-03-11 15:59 dts12
+
+ * snmplib/cert_util.c:
+
+ Don't initialise the TLS transport unless it's actually been
+ configured in.
+
+2010-03-11 15:47 rstory
+
+ * testing/eval_suite.sh:
+
+ use SNMP_TMPDIR instead of TMPDIR
+
+2010-03-11 15:31 rstory
+
+ * snmplib/snmptsm.c:
+
+ query right bool (tsm prefix is lib bool, not app)
+
+2010-03-11 15:08 dts12
+
+ * agent/auto_nlist.c, agent/mibgroup/examples/ucdDemoPublic.c,
+ apps/snmptest.c, snmplib/parse.c, snmplib/tools.c:
+
+ CHANGES: PATCH: 2952034: Return of the Great SuSE 'sprintf'
+ Hunt...
+ Patch supplied by Leonardo Chiquitto
+
+2010-03-11 14:55 dts12
+
+ * local/traptoemail:
+
+ CHANGES: PATCH: 2937996: Add Date: header to email send by
+ traptoemail
+
+2010-03-11 14:50 dts12
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c:
+
+ CHANGES: snmpd: PATCH: 2967400: Retrieve error counters for the
+ EtherLike-MIB
+ Patch supplied by Josef Moellers.
+
+2010-03-11 14:23 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ CHANGES: snmpd: PATCH: 2968642: Catch overflow of pass-through
+ command buffer.
+ Patch from Andreas Jaeger/Leonardo Chiquitto
+
+2010-03-11 12:37 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ CHANGES: snmpd: PATCH: 2956657: Handle over-length AgentX OIDs.
+ Patch provided by Rob West
+
+2010-03-11 12:23 dts12
+
+ * agent/mibgroup/ip-mib/data_access/defaultrouter_common.c:
+
+ Provide missing debug parameter.
+ Patch provided by Andreas Jaeger.
+
+2010-03-11 12:21 dts12
+
+ * agent/mibgroup/hardware/sensors/hw_sensors.c:
+
+ Provide missing (dummy) return value, to suppress compiler
+ warning.
+ Patch provided by Andreas Jaeger.
+
+2010-03-11 12:19 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ Suppress warnings of possible buffer overflow.
+ This doesn't _actually_ protect against such an overflow,
+ since the target buffer is non-empty, so strncat can't
+ use it all anyway. But this should at least mislead the
+ compiler sufficiently to shut it up!
+
+ Patch provided by Andreas Jaeger.
+
+2010-03-11 11:57 dts12
+
+ * configure, configure.d/config_os_misc4:
+
+ Replace backquote with single quote in configure output message.
+ While this change is probably not strictly necessary, it feels
+ sensible to avoid this particular use of backquotes, Just In
+ Case.
+ See discussion in Patch #2952169
+
+2010-03-11 11:43 dts12
+
+ * snmplib/mib.c:
+
+ CHANGES: library: PATCH: 2952140: Overflow counter32 and gauge32
+ on 64bit systems correctly
+ Patch provided by Leonardo Chiquitto
+
+2010-03-11 11:36 dts12
+
+ * testing/TESTCONF.sh, testing/eval_suite.sh:
+
+ CHANGES: build: PATCH: 2952020: Explicitly set permission on
+ temporary testing output directories.
+ Patch provided by Leonardo Chiquitto.
+
+2010-03-11 11:26 dts12
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ CHANGES: snmpd: PATCH: 2950845: Fix ifHighSpeed calculation
+ Patch provided by Leonardo Chiquitto
+
+2010-03-11 08:26 bvassche
+
+ * perl/ASN/ASN.xs, perl/ASN/Makefile.PL, perl/OID/Makefile.PL,
+ perl/OID/OID.xs, perl/TrapReceiver/Makefile.PL,
+ perl/TrapReceiver/TrapReceiver.xs, perl/agent/Makefile.PL,
+ perl/agent/Support/Makefile.PL, perl/agent/agent.xs,
+ perl/agent/default_store/Makefile.PL,
+ perl/agent/default_store/default_store.xs,
+ perl/default_store/Makefile.PL,
+ perl/default_store/default_store.xs:
+
+ Made compilation of the Perl module NetSNMP.pm on Windows more
+ silent: added compiler flags -D_CRT_SECURE_NO_WARNINGS
+ -D_CRT_NONSTDC_NO_WARNINGS and made sure that #include
+ <net-snmp/net-snmp-config.h> occurs before any other include file
+ that defines _WIN32_WINNT.
+
+2010-03-10 23:31 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/Makefile.in,
+ snmplib/cert_util.c:
+
+ NEWS: snmplib: create indexes for certificates in config path
+
+2010-03-10 18:48 bvassche
+
+ * snmplib/snmpSocketBaseDomain.c:
+
+ Added "#include <unistd.h>" such that on Unix systems the
+ compiler does not print a warning about a missing declaration for
+ the function close().
+
+2010-03-10 18:30 rstory
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, perl/ASN/ASN.pm,
+ perl/AnyData_SNMP/Storage.pm, perl/OID/OID.pm, perl/SNMP/SNMP.pm,
+ perl/TrapReceiver/TrapReceiver.pm,
+ perl/agent/Support/Support.pm, perl/agent/agent.pm,
+ perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm:
+
+ update version to 5.6.dev
+
+2010-03-10 18:29 rstory
+
+ * local/Version-Munge.pl:
+
+ CHANGES: building: update Version-Munge for renamed configure.ac
+
+2010-03-10 18:29 rstory
+
+ * configure.ac:
+
+ CHANGES: building: save configure cache every once in while
+
+2010-03-10 16:12 bvassche
+
+ * win32/libsnmp/Makefile.in:
+
+ Reordered some of the Makefile rules in order to minimize the
+ diffs with libsnmp_dll/Makefile.in.
+
+2010-03-10 16:10 bvassche
+
+ * win32/libsnmp_dll/Makefile.in:
+
+ Win32, batch building: DLL builds again.
+
+2010-03-10 16:07 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ Fixed a recently introduced compiler warning by adding a forward
+ declaration for the function _cache_free().
+
+2010-03-10 16:06 bvassche
+
+ * snmplib/container.c:
+
+ Builds again on Win32.
+
+2010-03-10 04:17 rstory
+
+ * README:
+
+ add missing contributors
+
+2010-03-10 04:17 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c:
+
+ CHANGES: snmplib: fix potential double free in CONTAINER_FREE
+ - also added several compare routines
+
+2010-03-10 04:17 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ CHANGES: snmplib: when freeing a cache, stop timer and call cache
+ free func
+ - also add netsnmp_cache_remove
+
+2010-03-10 03:52 rstory
+
+ * README, agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/container.h, snmplib/Makefile.in,
+ snmplib/cert_util.c, snmplib/container.c:
+
+ undo commit 18234
+
+2010-03-10 03:41 rstory
+
+ * README, agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/container.h, snmplib/Makefile.in,
+ snmplib/cert_util.c, snmplib/container.c:
+
+ Merge branch 'pullme' of ../trunk-staging
+
+2010-03-09 17:48 bvassche
+
+ * include/net-snmp/mib_api.h:
+
+ CHANGES: Win32: exported netsnmp_read_module() from netsnmp.dll
+ such that NetSNMP.pm builds again.
+
+2010-03-09 17:47 bvassche
+
+ * win32/libagent/Makefile.in, win32/libsnmp_dll/Makefile.in:
+
+ Simplified two makefiles used by build.bat (Win32).
+
+2010-03-09 17:24 bvassche
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: Win32: building: building NetSNMP.pm does no longer
+ trigger compiler warnings about redefining _WIN32_WINNT nor
+ NTDDI_VERSION.
+
+2010-03-09 17:22 bvassche
+
+ * perl/SNMP/Makefile.PL:
+
+ CHANGES: Win32: building: made building NetSNMP.pm more silent by
+ adding the MSVC compiler flags -D_CRT_SECURE_NO_WARNINGS
+ -D_CRT_NONSTDC_NO_WARNINGS.
+
+2010-03-09 17:09 rstory
+
+ * snmplib/read_config.c:
+
+ remove debug msg used during debugging
+
+2010-03-09 17:02 marz
+
+ * local/net-snmp-cert:
+
+ initial cert wrapper - testing repo write privs
+
+2010-03-09 10:20 bvassche
+
+ * win32/netsnmpmibs/Makefile.in:
+
+ Removed duplicate build rules. These duplicate rules were
+ harmless but triggered a warning.
+
+2010-03-09 02:38 rstory
+
+ * include/net-snmp/library/dir_utils.h, snmplib/dir_utils.c:
+
+ CHANGES: snmplib: directory container enhancements
+ - fix potential memory leak
+ - add filter callback to filter files returned
+ - add option to return relative and not full paths
+ - add option to sort returned list
+ - add option to return empty container instead of NULL if no
+ files found
+ - change default container name to directory that was scanned
+ - tweak debug/log messages
+
+2010-03-08 23:07 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/util_funcs/get_pid_from_inode.c,
+ include/net-snmp/library/snmp_logging.h:
+
+ CHANGES: snmpd: define and use new NETSNMP_LOGONCE macro
+
+2010-03-08 22:44 rstory
+
+ * man/snmp_config.5.def, snmplib/read_config.c:
+
+ NEWS: snmplib: conf files can now include other conf files
+ - also tweaked debug tokens here and there
+
+2010-03-08 22:43 rstory
+
+ * snmplib/snmp_transport.c:
+
+ fix typo (caused external reference when DTLSUDP configured
+ without dtlstcp)
+
+2010-03-06 02:27 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c,
+ snmplib/container_binary_array.c, snmplib/container_list_ssll.c:
+
+ NEWS: snmplib: netsnmp_container enhancements:
+ - add free_item function; defaults to
+ netsnmp_container_simple_free
+ - add CONTAINER_FREE_ALL macro/function (like CONTAINER_CLEAR but
+ calls container free_item for each item in primary container)
+ - add ability to set options on binary_array containers
+
+2010-03-02 17:55 bvassche
+
+ * win32/libsnmp/Makefile.in:
+
+ Made sure that win32/build.bat works again by adding missing
+ source file names. Sorted source file names alphabetically too.
+
+2010-03-02 16:54 bvassche
+
+ * win32/Configure, win32/netsnmpmibs/Makefile.in,
+ win32/snmpd/Makefile.in:
+
+ Follow-up for r18167 (merge of snmpd and snmpdsdk and also of
+ netsnmpmibs and netsnmpmibssdk): the batch file win32/build.bat
+ works again with the Platform SDK enabled.
+
+2010-03-02 16:52 bvassche
+
+ * win32/Makefile-apps.in:
+
+ Follow-up for r18215 (replaced the obsolete cl.exe option /GX by
+ the equivalent /EHsc; added /D "_CRT_SECURE_NO_WARNINGS", added
+ /D "_CRT_NONSTDC_NO_WARNINGS" and removed /Fp... and /YX).
+
+2010-02-28 15:56 bvassche
+
+ * snmplib/winservice.c:
+
+ Win32: fixed a compiler warning about redefinition of
+ _WIN32_WINNT by making sure that <net-snmp/net-snmp-config.h> is
+ included before <windows.h>.
+
+2010-02-28 15:24 bvassche
+
+ * win32/libagent/Makefile.in, win32/libhelpers/Makefile.in,
+ win32/libnetsnmptrapd/Makefile.in, win32/libsnmp/Makefile.in,
+ win32/libsnmp_dll/Makefile.in, win32/netsnmpmibs/Makefile.in,
+ win32/snmpd/Makefile.in, win32/snmpnetstat/Makefile.in,
+ win32/snmptrapd/Makefile.in:
+
+ CHANGES: Win32: batch build: replaced the obsolete /GX by the
+ equivalent /EHsc.
+ CHANGES: Win32: batch build: added /D "_CRT_SECURE_NO_WARNINGS"
+ /D "_CRT_NONSTDC_NO_WARNINGS" to make building with MSVC 2008
+ more silent.
+ CHANGES: Win32: batch build: removed /Fp... and /YX. These
+ options influence how precompiled header files are generated,
+ which are not used inside the Net-SNMP project. /YX is not
+ supported by MSVC 2008.
+ CHANGES: Win32: batch build: removed a duplicate occurrence of
+ strtoull.obj.
+
+2010-02-28 14:11 bvassche
+
+ * win32/Configure, win32/Makefile.in:
+
+ Follow-up for r18167 (merge of snmpd and snmpdsdk and also of
+ netsnmpmibs and netsnmpmibssdk): applied the necessary changes to
+ the win32/Configure script and win32/Makefile.in.
+
+2010-02-27 13:11 bvassche
+
+ * agent/mibgroup/agent/nsCache.c, include/net-snmp/config_api.h,
+ include/net-snmp/library/asn1.h,
+ include/net-snmp/library/callback.h,
+ include/net-snmp/library/check_varbind.h,
+ include/net-snmp/library/container.h,
+ include/net-snmp/library/container_list_ssll.h,
+ include/net-snmp/library/container_null.h,
+ include/net-snmp/library/data_list.h,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/fd_event_manager.h,
+ include/net-snmp/library/int64.h,
+ include/net-snmp/library/keytools.h,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/library/md5.h, include/net-snmp/library/mib.h,
+ include/net-snmp/library/mt_support.h,
+ include/net-snmp/library/oid_stash.h,
+ include/net-snmp/library/parse.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/scapi.h,
+ include/net-snmp/library/snmp-tc.h,
+ include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmp_alarm.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_enum.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/library/snmp_parse_args.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmp_service.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/snmpv3.h,
+ include/net-snmp/library/system.h,
+ include/net-snmp/library/tools.h,
+ include/net-snmp/library/ucd_compat.h,
+ include/net-snmp/library/vacm.h,
+ include/net-snmp/library/winpipe.h, include/net-snmp/mib_api.h,
+ include/net-snmp/pdu_api.h, include/net-snmp/session_api.h,
+ include/net-snmp/varbind_api.h, include/net-snmp/version.h,
+ snmplib/getopt.c, snmplib/gettimeofday.c, snmplib/mib.c,
+ snmplib/parse.c, snmplib/snmp_alarm.c, snmplib/snmp_api.c,
+ snmplib/snmp_client.c, snmplib/snmp_debug.c, snmplib/snmpv3.c,
+ snmplib/strlcpy.c, snmplib/strtok_r.c, snmplib/strtoull.c,
+ snmplib/tools.c, snmplib/ucd_compat.c, snmplib/winpipe.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: Win32: declared all functions that are exported from the
+ Net-SNMP DLL as NETSNMP_IMPORT. The result is a minor
+ optimization: code that uses the Net-SNMP DLL will now call the
+ DLL-exported functions directly instead of indirectly via the
+ stub in the import library.
+
+2010-02-27 11:50 bvassche
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Removed a redundant strncasecmp() declaration.
+
+2010-02-27 09:57 bvassche
+
+ * snmplib/strtok_r.c:
+
+ Fixed a typo in a source code comment.
+
+2010-02-27 09:56 bvassche
+
+ * snmplib/snmp_transport.c:
+
+ Follow-up for r18189 (rstory): builds again on Windows.
+
+2010-02-25 17:53 bvassche
+
+ * win32/encode_keychange/encode_keychange.dsp,
+ win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.dsp, win32/libagent/libagent.vcproj,
+ win32/libhelpers/libhelpers.dsp,
+ win32/libhelpers/libhelpers.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp/libsnmp.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.dsp,
+ win32/snmpd/snmpd.vcproj, win32/snmpdelta/snmpdelta.dsp,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.dsp,
+ win32/snmpdf/snmpdf.vcproj, win32/snmpget/snmpget.dsp,
+ win32/snmpget/snmpget.vcproj, win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.dsp,
+ win32/snmpnetstat/snmpnetstat.vcproj, win32/snmpset/snmpset.dsp,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.dsp,
+ win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.dsp, win32/snmptable/snmptable.vcproj,
+ win32/snmptest/snmptest.dsp, win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrap/snmptrap.vcproj,
+ win32/snmptrapd/snmptrapd.dsp, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.dsp, win32/snmpusm/snmpusm.vcproj,
+ win32/snmpvacm/snmpvacm.dsp, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.dsp, win32/snmpwalk/snmpwalk.vcproj,
+ win32/win32.dsw, win32/win32.sln, win32/win32dll.dsw,
+ win32/win32dll.sln:
+
+ Reverted r18207 (dsp/dsw to vcproj/sln conversion) except the
+ suppression
+ list changes. The goal of this conversion was twofold: not only
+ to be able
+ to load the project files in MSVC 2002 - 2008 but also to be able
+ to commit
+ changes made from inside the MSVC 2008 IDE. Unfortunately
+ converting dsp/dsw
+ files to vcproj/sln files with MSVC 2008 makes it impossible to
+ load the
+ vcproj/sln files with earlier MSVC versions. Why on earth did
+ Microsoft
+ decide to put a version number in XML files ?
+
+2010-02-24 19:41 bvassche
+
+ * win32, win32/encode_keychange,
+ win32/encode_keychange/encode_keychange.dsp,
+ win32/encode_keychange/encode_keychange.vcproj, win32/libagent,
+ win32/libagent/libagent.dsp, win32/libagent/libagent.vcproj,
+ win32/libhelpers, win32/libhelpers/libhelpers.dsp,
+ win32/libhelpers/libhelpers.vcproj, win32/libnetsnmptrapd,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj, win32/libsnmp,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp/libsnmp.vcproj,
+ win32/libsnmp_dll, win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/libsnmp_dll/libsnmp_dll.vcproj, win32/netsnmpmibs,
+ win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibs/netsnmpmibs.vcproj, win32/snmpbulkget,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkget/snmpbulkget.vcproj, win32/snmpbulkwalk,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd,
+ win32/snmpd/snmpd.dsp, win32/snmpd/snmpd.vcproj, win32/snmpdelta,
+ win32/snmpdelta/snmpdelta.dsp, win32/snmpdelta/snmpdelta.vcproj,
+ win32/snmpdf, win32/snmpdf/snmpdf.dsp,
+ win32/snmpdf/snmpdf.vcproj, win32/snmpget,
+ win32/snmpget/snmpget.dsp, win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext, win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpgetnext/snmpgetnext.vcproj, win32/snmpnetstat,
+ win32/snmpnetstat/snmpnetstat.dsp,
+ win32/snmpnetstat/snmpnetstat.vcproj, win32/snmpset,
+ win32/snmpset/snmpset.dsp, win32/snmpset/snmpset.vcproj,
+ win32/snmpstatus, win32/snmpstatus/snmpstatus.dsp,
+ win32/snmpstatus/snmpstatus.vcproj, win32/snmptable,
+ win32/snmptable/snmptable.dsp, win32/snmptable/snmptable.vcproj,
+ win32/snmptest, win32/snmptest/snmptest.dsp,
+ win32/snmptest/snmptest.vcproj, win32/snmptranslate,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptranslate/snmptranslate.vcproj, win32/snmptrap,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrap/snmptrap.vcproj,
+ win32/snmptrapd, win32/snmptrapd/snmptrapd.dsp,
+ win32/snmptrapd/snmptrapd.vcproj, win32/snmpusm,
+ win32/snmpusm/snmpusm.dsp, win32/snmpusm/snmpusm.vcproj,
+ win32/snmpvacm, win32/snmpvacm/snmpvacm.dsp,
+ win32/snmpvacm/snmpvacm.vcproj, win32/snmpwalk,
+ win32/snmpwalk/snmpwalk.dsp, win32/snmpwalk/snmpwalk.vcproj,
+ win32/win32.dsw, win32/win32.sln, win32/win32dll.dsw,
+ win32/win32dll.sln:
+
+ (reverted) CHANGES: Win32: building: converted .dsp/.dsw files to
+ .vcproj/.sln files. This implies that support for MSVC 6.0 has
+ been dropped and the minimum Microsoft Visual Studio version
+ required to build the Net-SNMP source code is Microsoft Visual
+ Studio .NET (2002).
+
+2010-02-23 19:03 bvassche
+
+ * configure, configure.d/config_project_manual:
+
+ CHANGES: building: when generating a default value for the system
+ location and no domain name is found in /etc/resolv.conf, use
+ "@no.where" instead of "".
+
+2010-02-23 18:50 bvassche
+
+ * configure, m4/ac_prompt_user.m4:
+
+ CHANGES: building: made sure that the configure script does no
+ longer invoke "tail -1", which is not POSIX-compliant.
+
+2010-02-23 18:45 hardaker
+
+ * testing/tests/T300udp, testing/tests/T310tcp,
+ testing/tests/T320udpv6, testing/tests/T330tcpv6,
+ testing/tests/T350unix, testing/tests/T360dtlsudp,
+ testing/tests/T399alias:
+
+ Removed all transport tests since it's impossible to determine
+ where they can safely operate (was stopping tanders' nightly
+ tests from succeeding)
+
+2010-02-23 18:41 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ more error and debugging output
+
+2010-02-23 18:40 hardaker
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ fix the server context generator to actually, um, return the
+ context.
+
+2010-02-23 18:40 hardaker
+
+ * agent/agent_trap.c:
+
+ initialize the 'res' variable since it's checked
+
+2010-02-23 18:39 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ more progress toward a real implementation
+
+2010-02-23 18:38 hardaker
+
+ * snmplib/snmp_transport.c:
+
+ tlstcp ctor invocation
+
+2010-02-23 18:38 hardaker
+
+ * include/net-snmp/library/snmpTLSTCPDomain.h:
+
+ require TLSBase
+
+2010-02-23 18:37 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ added host identifier as output
+
+2010-02-23 18:35 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpTLSTCPDomain.c:
+
+ significant more work on the TLS TCP domain
+
+2010-02-23 17:43 bvassche
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ Follow-up for r18193 (jsafranek): reran autoreconf for the trunk
+ and the 5.5 branch.
+
+2010-02-23 14:58 rstory
+
+ * snmplib/snmp_api.c:
+
+ use NETSNMP_PRIz instead of %z
+
+2010-02-23 12:27 jsafranek
+
+ * configure.d/config_os_libs:
+
+ CHANGES: building: Fixed compilation with rpm-4.6.
+ Turn on the legacy API when rpm-4.6 is detected.
+
+2010-02-23 07:38 bvassche
+
+ * snmplib/snmp_alarm.c, snmplib/snmp_api.c:
+
+ Reverted r18000 (disabling SIGALRM support) because this involves
+ a backwards-incompatible change.
+
+2010-02-23 00:36 rstory
+
+ * snmplib/snmpTCPDomain.c:
+
+ fix typo in comment
+
+2010-02-23 00:34 rstory
+
+ * snmplib/snmp_api.c:
+
+ debug msg tweaks; use new tranport functions
+ - add debug header for snmp version
+ - add length to debug send/receive messages
+ - use new tranport functions for send/recv/finding peer address
+
+2010-02-23 00:25 rstory
+
+ * include/net-snmp/library/snmp_transport.h,
+ snmplib/snmp_transport.c:
+
+ add netsnmp_transport_peer_string, netsnmp_transport_send &
+ netsnmp_transport_recv
+ - moves transport manipulation into transport code
+ - central place for logging/debugging sent/received data
+
+2010-02-22 19:33 bvassche
+
+ * configure, configure.d/config_modules_agent,
+ configure.d/config_project_manual:
+
+ CHANGES: building: made sure that the configure script does no
+ longer invoke "tail -1", which is not POSIX-compliant.
+
+2010-02-22 19:21 bvassche
+
+ * agent/agent_registry.c:
+
+ Follow-up for r18186. Regression test 34 (whether authentication
+ failure traps are sent by snmpd) passes now again.
+
+2010-02-22 09:18 bvassche
+
+ * agent/agent_registry.c:
+
+ CHANGES: snmpd: made sure that handler registration failure does
+ not create dangling pointers in the MIB subtree registry.
+
+2010-02-22 09:11 bvassche
+
+ * agent, apps, apps/snmpnetstat:
+
+ Updated Subversion ignore list.
+
+2010-02-22 08:42 bvassche
+
+ * configure:
+
+ Follow-up for r18084: fixed libeay32 (OpenSSL) configure test for
+ MinGW.
+
+2010-02-22 08:31 bvassche
+
+ * configure.d/config_os_libs:
+
+ Follow-up for r18084: fixed libeay32 (OpenSSL) configure test for
+ MinGW.
+
+2010-02-22 08:13 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Builds again with MinGW when IPv6 support is enabled.
+
+2010-02-21 18:58 bvassche
+
+ * README.win32, win32/libsdll.dsw,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in, win32/win32dll.dsw:
+
+ CHANGES: Win32: building: renamed libsdll.dsw into win32dll.dsw.
+ CHANGES: Win32: building: simplified linking the Net-SNMP
+ applications with netsnmp.dll by adding all application projects
+ to the same workspace that is used for building the DLL.
+ CHANGES: Win32: building: made building netsnmp.dll less error
+ prone by letting the compiler print an error message if the
+ preprocessor symbol NETSNMP_USE_DLL has not been defined.
+
+2010-02-21 18:51 bvassche
+
+ * win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ CHANGES: Win32: building: Added libsnmp.def to the list of
+ libsnmp_dll.dsp source files such that the DLL is rebuilt when
+ the .def file has been modified.
+
+2010-02-21 18:45 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ CHANGES: Win32: exported netsnmp_set_line_buffering() from
+ netsnmp.dll.
+
+2010-02-21 17:39 bvassche
+
+ * snmplib/snmpIPv6BaseDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ More Win32 IPv6 source code consistency improvements:
+ - Moved #undef HAVE_IF_NAMETOINDEX from snmplib/*.c to
+ win32/net-snmp/net-snmp-config.h.
+ - Changed the global in6addr_any variable into a static variable
+ such that
+ multiple definitions do not trigger a linker error.
+ - Added typedefs for uint8_t, int8_t, uint16_t and int16_t.
+ - Replaced '#if NETSNMP_ENABLE_IPV6' by '#ifdef
+ NETSNMP_ENABLE_IPV6'.
+
+2010-02-21 08:30 tanders
+
+ * snmplib/snmpIPBaseDomain.c:
+
+ make sure that INADDR_NONE is defined (fixes build error on
+ Solaris)
+
+2010-02-19 19:39 bvassche
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ Synchronized win32/net-snmp/net-snmp-config.h and
+ win32/net-snmp/net-snmp-config.h.in.
+
+2010-02-19 14:18 bvassche
+
+ * include/net-snmp/library/system.h:
+
+ CHANGES: Win32: libsnmp builds again as a DLL when IPv6 is
+ enabled.
+
+2010-02-19 13:22 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def.in:
+
+ Follow up for r18164: synchronized libsnmp.def.in with
+ libsnmp.def
+
+2010-02-19 09:05 bvassche
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ CHANGES: Win32: added #include <malloc.h> in
+ win32/net-snmp/net-snmp-config.h such that the MSVC compiler
+ doesn't get confused by the malloc redefinition when building
+ libsnmp as a DLL.
+
+2010-02-19 08:59 bvassche
+
+ * include/net-snmp/library/snmp_parse_args.h,
+ win32/libsnmp_dll/libsnmp.def:
+
+ Exported netsnmp_parse_args() such that the Net-SNMP applications
+ build again when libsnmp is built as a DLL.
+
+2010-02-19 08:56 bvassche
+
+ * snmplib/keytools.c, win32/net-snmp/net-snmp-config.h:
+
+ CHANGES: Win32: building: moved MSVC OpenSSL linker settings from
+ snmplib/keytools.c to win32/net-snmp/net-snmp-config.h such that
+ these settings are not only effective when building snmplib as a
+ static library but also when any Net-SNMP application is built
+ that links with snmplib as a static library or as a DLL.
+
+2010-02-19 08:32 bvassche
+
+ * snmplib/keytools.c:
+
+ Win32 cleanup: MSVC / DLL tests now use the officially endorsed
+ macro names.
+
+2010-02-19 07:50 bvassche
+
+ * win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ Builds again.
+
+2010-02-19 06:47 magfr
+
+ * agent/agent_trap.c, agent/mibgroup/ucd-snmp/proxy.c,
+ include/net-snmp/library/snmp_parse_args.h,
+ snmplib/snmp_parse_args.c:
+
+ NEWS: snmplib: PATCH: 2942940: from "Bill Fenner": Add a new
+ function, netsnmp_parse_args, that is like snmp_parse_args but
+ takes an additional bitmask, flags, to affect the behaviour. Also
+ remove the magic handling of some application names.
+
+2010-02-18 14:22 bvassche
+
+ * win32/bin:
+
+ Updated Subversion ignore list.
+
+2010-02-18 14:20 bvassche
+
+ * win32/libhelpers/libhelpers.dsp,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/libsnmp/libsnmp.dsp, win32/netsnmpmibs/netsnmpmibs.dsp:
+
+ Sorted names of source files alphabetically.
+
+2010-02-18 13:03 bvassche
+
+ * README.win32, snmplib/winservice.c, win32/libsnmp/libsnmp.dsp,
+ win32/net-snmp/net-snmp-config.h,
+ win32/netsnmpmibs/netsnmpmibs.dsp, win32/netsnmpmibssdk,
+ win32/snmpdsdk, win32/snmpnetstat/snmpnetstat.dsp,
+ win32/win32.dsw, win32/win32sdk.dsw:
+
+ CHANGES: Win32: dropped support for building Net-SNMP with
+ Microsoft Visual Studio 6.0 without platform SDK. Building
+ Net-SNMP with Microsoft Visual Studio 6.0 + PSDK or any later
+ version of MSVC is still possible however.
+
+ Note: if in the future for whatever reason it should become
+ necessary again to be able to build Net-SNMP with MSVC without
+ relying on the platform SDK headers, please #ifdef out the MIB
+ code that relies on the PSDK headers instead of splitting the
+ workspace files again.
+
+2010-02-18 12:57 bvassche
+
+ * snmplib/snmpIPv6BaseDomain.c:
+
+ dos2unix.
+
+2010-02-18 09:45 bvassche
+
+ * include/net-snmp/library/types.h:
+
+ Source code cleanup:
+ - Moved documentation of netsnmp_large_fd_set members to the
+ comment
+ block just above the definition of this type.
+ - Removed superfluous 'extern "C"' specifier: this linkage
+ specifier
+ only has an effect on declarations of variables of functions and
+ not
+ on typedefs or struct definitions.
+ - Ran this header file through indent.
+
+2010-02-18 09:26 bvassche
+
+ * snmplib/snmpIPBaseDomain.c, snmplib/snmpIPV6BaseDomain.c,
+ snmplib/snmpIPv6BaseDomain.c, snmplib/snmpTLSBaseDomain.c,
+ win32/libsnmp/libsnmp.dsp:
+
+ Changes:
+ - Builds again with MSVC.
+ - Fixed a few compiler warnings reported by MSVC (passing int
+ instead of u_short to htons() / function declarations that were
+ missing because of missing #include directives).
+
+2010-02-16 17:16 bvassche
+
+ * include/net-snmp/types.h:
+
+ CHANGES: Win32: The header file <sys/timeb.h> is no longer
+ included from <net-snmp/types.h>. Or: the header file
+ <sys/timeb.h> will have to be included explicitly in source files
+ that need the declaration of the function ftime().
+
+ Note: compared to r18024 and before, this change does not affect
+ BSD systems -- <sys/timeb.h> was only included from
+ <net-snmp/types.h> on BSD systems in revisions r18025..r18152.
+
+2010-02-14 19:29 bvassche
+
+ * include/net-snmp/system/freebsd8.h:
+
+ Builds now on FreeBSD version 8.0.
+
+2010-02-13 20:59 magfr
+
+ * include/net-snmp/library/snmpIPv4BaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpTCPBaseDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h:
+
+ Adjust the placement of ;'s in order to
+ a) Avoid warnings about spurious semicolons
+ b) Not have unterminated declarations in headers
+
+2010-02-12 02:57 rstory
+
+ * local/mib2c:
+
+ CHANGES: mib2c: update inline documentation; add storagetype test
+ for columns
+
+2010-02-12 01:50 rstory
+
+ * include/net-snmp/library/snmp_api.h:
+
+ fix typo in define
+
+2010-02-12 01:05 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ fix sed processing on white-space adding solaris machines
+
+2010-02-10 23:56 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ add top srcdir to cpp search path
+
+2010-02-10 23:52 hardaker
+
+ * include/net-snmp/types.h:
+
+ freebsd needs time.h above timeb.h
+
+2010-02-10 23:37 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ use sed with multireplace on a line to fix possible whitespace
+ issue on solaris
+
+2010-02-10 23:22 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c,
+ snmplib/snmpTLSTCPDomain.c:
+
+ beginning work for TLS separation into separate files with a base
+ file
+
+2010-02-10 23:21 hardaker
+
+ * include/net-snmp/library/snmpUDPIPv4BaseDomain.h:
+
+ move base transport creation function out of linux ifdefs
+
+2010-02-10 23:21 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c:
+
+ moved another error logging function
+
+2010-02-10 23:20 hardaker
+
+ * mibs/NET-SNMP-TC.txt:
+
+ added TLS over TCP
+
+2010-02-10 16:39 dts12
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c:
+
+ CHANGES: Linux: Improved EtherLike-MIB support
+ Patch supplied by Josef Moellers
+
+2010-02-10 10:04 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: Support null-bytes in octet strings
+ Patch supplied by Tommy Beadle
+
+2010-02-10 00:59 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c:
+
+ moved TLS infrastructure into a base domain file
+
+2010-02-10 00:04 hardaker
+
+ * include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ snmplib/snmpIPv6BaseDomain.c, snmplib/snmpUDPIPv6Domain.c:
+
+ moved socket6 functions to the ipv6 base
+
+2010-02-10 00:03 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ white space formatting
+
+2010-02-10 00:03 hardaker
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ snmplib/snmpUDPBaseDomain.c, snmplib/snmpUDPDomain.c:
+
+ moved udp_send/recv to udpbase
+
+2010-02-10 00:02 hardaker
+
+ * include/net-snmp/library/snmpSocketBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpSocketBaseDomain.c, snmplib/snmpUDPDomain.c:
+
+ move netsnmp_sock_buffer_set into socketbase
+
+2010-02-10 00:02 hardaker
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpUDPBaseDomain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv4BaseDomain.c:
+
+ move ipv4 specific UDP transport creation to udpipv4 base
+
+2010-02-10 00:01 hardaker
+
+ * snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c:
+
+ made common functions be referenced directly by the transports
+ and removed original functionality; they were static so there is
+ no backwards compat issues
+
+2010-02-10 00:00 hardaker
+
+ * include/net-snmp/library/snmpSocketBaseDomain.h,
+ include/net-snmp/library/snmpTCPBaseDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpSocketBaseDomain.c,
+ snmplib/snmpTCPDomain.c, snmplib/snmpUDPBaseDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ moved socket based close to a socket based domain common to many
+ things
+
+2010-02-09 23:59 hardaker
+
+ * include/net-snmp/library/snmpTCPBaseDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ snmplib/snmpTCPBaseDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c:
+
+ move TCP common functions to a TCPBase domain implementation
+
+2010-02-09 23:57 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c:
+
+ warning cleanup
+
+2010-02-09 23:56 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ tmStateReference should be using the indexed addr_pair
+
+2010-02-09 23:56 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ make netsnmp_dtlsudp_close make use of netsnmp_baseudp_close
+
+2010-02-09 23:55 hardaker
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpUDPBaseDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ moved base UDP socket creation into a common base function and
+ made use of it
+
+2010-02-09 23:54 hardaker
+
+ * include/net-snmp/library/snmpIPBaseDomain.h:
+
+ proper _H ifdef checks
+
+2010-02-09 23:54 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/snmpUDPBaseDomain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv4BaseDomain.c:
+
+ added a raw UDP base domain
+
+2010-02-09 23:53 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpIPBaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpIPBaseDomain.c,
+ snmplib/snmpIPv4BaseDomain.c, snmplib/snmpIPv6BaseDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv4BaseDomain.c, snmplib/snmpUDPIPv6Domain.c:
+
+ created a UDP IPv4 base; moved and reused more infrastructure
+
+2010-02-09 23:51 hardaker
+
+ * include/net-snmp/library/snmpIPv4BaseDomain.h,
+ snmplib/snmpIPv4BaseDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ moved ipv4 address formatting into snmpIPv4BaseDomain
+
+2010-02-09 23:51 hardaker
+
+ * snmplib/snmpIPv6BaseDomain.c:
+
+ v6 domain infrastructure files
+
+2010-02-09 23:51 hardaker
+
+ * include/net-snmp/library/snmpIPV4BaseDomain.h,
+ include/net-snmp/library/snmpIPv4BaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ snmplib/snmpIPV4BaseDomain.c, snmplib/snmpIPV6BaseDomain.c,
+ snmplib/snmpIPv4BaseDomain.c:
+
+ v6 domain infrastructure files
+
+2010-02-09 23:50 hardaker
+
+ * configure, include/net-snmp/library/snmpIPBaseDomain.h,
+ include/net-snmp/library/snmpIPV4BaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpIPBaseDomain.c, snmplib/snmpIPV4BaseDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ New IPv4 and IP base transport files
+
+2010-02-09 23:48 hardaker
+
+ * configure.d/config_modules_lib:
+
+ don't double include transport modules
+
+2010-02-09 23:48 hardaker
+
+ * include/net-snmp/library/snmpIPXDomain.h:
+
+ moved architecture tests into the header files using config_error
+ for signaling problems
+
+2010-02-09 23:46 hardaker
+
+ * configure.d/config_modules_lib:
+
+ moved architecture tests into the header files using config_error
+ for signaling problems
+
+2010-02-09 23:45 hardaker
+
+ * include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUnixDomain.h:
+
+ moved architecture tests into the header files using config_error
+ for signaling problems
+
+2010-02-09 23:43 hardaker
+
+ * configure.d/config_modules_lib:
+
+ check for and report config_errors in transport headers
+
+2010-02-09 23:43 hardaker
+
+ * configure.d/config_os_headers:
+
+ allow a NETSNMP_QUICK_CHECK env variable to bypass header checks
+
+2010-02-09 23:42 hardaker
+
+ * configure.d/config_modules_lib:
+
+ better comments
+
+2010-02-09 23:42 hardaker
+
+ * configure.d/config_modules_lib:
+
+ check for config_require macros in transport headers for
+ force-including of other things
+
+2010-02-09 23:41 hardaker
+
+ * include/net-snmp/library/snmp_transport.h, perl/agent/agent.xs,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ define a standardized indexed addr_pair instead of using one
+ labeled only for UDP everywhere
+
+2010-02-09 23:40 hardaker
+
+ * snmplib/snmptsm.c:
+
+ fix transport prefix list for incoming messages
+
+2010-02-09 23:40 hardaker
+
+ * include/net-snmp/library/snmptsm.h, snmplib/snmptsm.c:
+
+ remove the security level from the TSM cache; previous existence
+ from from a draft copy of the TSM RFC and is now stored entirely
+ in the tm reference
+
+2010-02-09 23:39 hardaker
+
+ * snmplib/snmptsm.c:
+
+ implement incoming TSM procedures according to RFC text
+
+2010-02-09 23:39 hardaker
+
+ * snmplib/snmptsm.c:
+
+ implement outgoing TSM procedures according to RFC text
+
+2010-02-09 23:39 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h:
+
+ create defined sized array and length variable
+
+2010-02-05 09:52 jsafranek
+
+ *
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c:
+
+ CHANGES: snmpd: fixed filedescriptior leak in Etherlike-MIB and
+ RMON-MIB
+
+2010-02-04 15:57 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/mibII/interfaces.c,
+ include/net-snmp/data_access/interface.h:
+
+ CHANGES: snmpd: report real ifSpeed of network interface even it
+ is down.
+ Some interfaces can report their real speed, even they are down.
+ And if they can't, the fallback to 10Mbps is still there.
+
+2010-02-01 14:47 bvassche
+
+ * agent/mibgroup/examples/example.c:
+
+ Fixed the compiler warnings triggered by the source file
+ agent/mibgroup/examples/example.c.
+
+2010-02-01 14:45 bvassche
+
+ * README.win32, snmplib/keytools.c:
+
+ CHANGES: Win32: building: simplified the procedure for building
+ with SNMPv3 support enabled (OpenSSL).
+
+2010-02-01 14:34 bvassche
+
+ * agent/helpers/cache_handler.c, agent/helpers/instance.c,
+ agent/helpers/old_api.c, agent/helpers/stash_cache.c,
+ agent/helpers/watcher.c, agent/mibgroup/winExtDLL.c,
+ snmplib/large_fd_set.c, snmplib/md5.c, snmplib/snmpAliasDomain.c,
+ snmplib/snmp_parse_args.c:
+
+ Made sure that all calls to free() are intercepted when building
+ with dmalloc
+ support enabled. Included <dmalloc.h> in those source files where
+ it was not
+ yet included, and provided a wrapper function for free() where
+ the address of
+ this function was taken (Dmalloc can only intercept free() when
+ it is called
+ directly but not when it is called through a function pointer).
+
+2010-02-01 10:49 bvassche
+
+ * include/net-snmp/library/system.h:
+
+ NEWS: building: Building Net-SNMP with dmalloc support enabled is
+ again possible.
+
+2010-02-01 01:05 tanders
+
+ * testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap,
+ testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap, testing/tests/T113agentxtrap,
+ testing/tests/T114agentxagentxtrap:
+
+ CHANGES: building: 'make test TESTOPTS="-P tcp"' works fine now
+
+2010-01-31 08:02 bvassche
+
+ * configure, configure.d/config_os_misc2:
+
+ Follow-up for r18084: fixed an sh syntax error in the configure
+ script
+ that was triggered on systems without libcrypto and without
+ libeay32.
+ The following error was reported:
+ configure[33136]: x: unknown test operator
+
+2010-01-29 20:07 jsafranek
+
+ * testing/tests/T059trapdtraphandle:
+
+ Elaborate on rev. 18089 and adjust the temporary directory to the
+ * *really working one*. 2010-01-29 19:11 jsafranek
+
+
+ * testing/tests/T059trapdtraphandle:
+
+ Fix test 35 when configure option '--with-temp-file-pattern' was
+ used and the directory for temp. files does not exist yet.
+
+2010-01-29 15:07 bvassche
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/library/system.h,
+ include/net-snmp/net-snmp-config.h.in, snmplib/closedir.c,
+ snmplib/gettimeofday.c, snmplib/opendir.c, snmplib/readdir.c,
+ snmplib/system.c, win32/libsnmp/libsnmp.dsp:
+
+ Moved the source code of the opendir(), readdir(), closedir() and
+ gettimeofday() replacements for MSVC from snmplib/system.c to
+ separate source files in snmplib.
+
+2010-01-29 08:57 bvassche
+
+ * configure, configure.d/config_os_libs:
+
+ Configure script consistency improvement: renamed the variable
+ "saved_LIBS" into "netsnmp_save_LIBS".
+
+2010-01-29 06:39 magfr
+
+ * configure, configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in,
+ testing/tests/T072com2secunix:
+
+ CHANGES: testing: Check the size of sun_path and use that to
+ generate the maximal size strings for stressing com2secunix.
+
+2010-01-27 15:16 bvassche
+
+ * testing/eval_tools.sh:
+
+ NEWS: MinGW: running the regression test suite is again possible
+ ('make test').
+
+2010-01-27 14:43 bvassche
+
+ * configure, configure.d/config_os_libs,
+ configure.d/config_os_misc2,
+ include/net-snmp/net-snmp-config.h.in:
+
+ NEWS: Cygwin: building with another OpenSSL package than the
+ Cygwin-provided packages openssl and openssl-devel is again
+ possible.
+ NEWS: MinGW: building with OpenSSL works again.
+
+2010-01-26 21:27 magfr
+
+ * agent/agent_trap.c, include/net-snmp/agent/agent_trap.h:
+
+ CHANGES: snmplib: Make the context argument of send_v3trap,
+ send_trap_vars_with_context and netsnmp_send_traps refer to a
+ const char*.
+
+2010-01-26 21:24 magfr
+
+ * agent/mibgroup/host/data_access/swinst_pkginfo.c:
+
+ Correct misspelling - #elsif to #elif
+
+2010-01-26 21:21 magfr
+
+ * snmplib/snmpUDPDomain.c:
+
+ Apparently not all systems define INET_ADDRSTRLEN so add it if it
+ is missing.
+
+2010-01-26 15:46 bvassche
+
+ * testing/TESTCONF.sh:
+
+ Added netstat path for MinGW.
+
+2010-01-26 15:00 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ fix stat names
+
+2010-01-26 15:00 hardaker
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ define netsnmp_assert_or_msgreturn
+
+2010-01-26 14:59 hardaker
+
+ * snmplib/snmptsm.c:
+
+ use netsnmp_assert_or_return
+
+2010-01-26 14:58 hardaker
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ define netsnmp_assert_or_return
+
+2010-01-26 14:58 hardaker
+
+ * snmplib/snmptsm.c:
+
+ update comments to reflect RFC5591 as the document describing the
+ implementation
+
+2010-01-26 11:43 bvassche
+
+ * include/net-snmp/system/cygwin.h:
+
+ NEWS: Cygwin: BUG: 2939168: byte order of udpLocalPort is now
+ correct.
+
+2010-01-26 10:46 bvassche
+
+ * net-snmp-config.in, testing/TESTCONF.sh,
+ testing/tests/T030snmpv3usercreation,
+ testing/tests/T115agentxperl:
+
+ NEWS: Cygwin: BUG: 2939168: fixed test infrastructure ("make
+ test"). This has been fixed by using the proper environment
+ separator character and by adding the path of the netstat
+ executable for Cygwin in testing/TESTCONF.sh.
+
+2010-01-26 09:27 jsafranek
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ CHANGES: snmpd: fix rare race condition when reading RPM
+ database.
+ Old rpm versions return NULL instead of Header when another RPM
+ instance holds
+ database locks. I.e. snmpd sometimes crashes when reading
+ hr_swInst and rpm is
+ installing/updating/removing another package. As a solution,
+ whole RPM cache
+ is thrown away and re-read when we got an error from librpm. The
+ whole process
+ is restarted only three times, to prevent endless loop.
+
+2010-01-25 22:16 magfr
+
+ * agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/disk.c, snmplib/scapi.c,
+ snmplib/snmp_api.c:
+
+ CHANGES: snmplib, snmpd: Do not check if values of type size_t
+ are less than 0.
+
+2010-01-25 22:11 magfr
+
+ * agent/mibgroup/util_funcs/header_simple_table.c:
+
+ CHANGES: snmpd: Check the range of oid values towards the maximum
+ oid value, notULONG_MAX
+
+2010-01-25 20:01 rstory
+
+ * configure, configure.d/config_os_libs:
+
+ only bail on missing libiphlpapi for xwinsock2
+
+2010-01-25 19:57 rstory
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c:
+
+ rename MAX_STATS to NETSNMP_STAT_MAX_STATS
+
+2010-01-25 19:53 rstory
+
+ * agent/helpers/snmp_get_statistic.c:
+
+ update for new path to snmp_get_statistics; check for index
+ overflow
+
+2010-01-25 19:44 rstory
+
+ * agent/helpers/Makefile.in, agent/mibgroup/Makefile.depend,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.h,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.h,
+ agent/mibgroup/snmpv3/usmStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.h,
+ agent/mibgroup/target/target_counters_5_5.c,
+ agent/mibgroup/target/target_counters_5_5.h:
+
+ update for new path to snmp_get_statistics
+
+2010-01-25 16:03 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ use *current* copy of the MIB when generating stats
+
+2010-01-25 16:01 rstory
+
+ * agent/helpers/snmp_get_statistic.c,
+ agent/mibgroup/utilities/snmp_get_statistic.c,
+ agent/mibgroup/utilities/snmp_get_statistic.h,
+ include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/snmp_get_statistic.h:
+
+ move snmp_get_statistic helper to helpers dir; update all_helpers
+ header
+
+2010-01-25 14:34 bvassche
+
+ * apps/agentxtrap.c:
+
+ Replaced explicit declarations of optind, optopt and optarg by
+ #include <unistd.h> because explicitly declaring these variables
+ is not compatible with Cygwin.
+
+2010-01-25 14:25 bvassche
+
+ * snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPIPv6Domain.c:
+
+ NEWS: Cygwin: IPv6 is only supported under Cygwin 1.7 or later.
+ The old implementation of IPv6 support in Net-SNMP under Cygwin
+ involved a strange mixture of Cygwin and Winsock2 socket calls,
+ which was too hard to maintain.
+ NEWS: Cygwin: builds again with IPv6 support enabled
+ (--enable-ipv6). At least Net-SNMP 5.5 doesn't build under Cygwin
+ with IPv6 support enabled. The configure script reported
+ "checking ipv6 stack type ... result: "unknown, no" ... error:
+ IPv6 transports not available if IPv6 support is not enabled".
+
+2010-01-25 14:13 bvassche
+
+ * snmplib/inet_ntop.c, snmplib/inet_pton.c:
+
+ Added missing #include <string.h>.
+
+2010-01-25 14:10 bvassche
+
+ * configure, configure.d/config_project_ipv6_types:
+
+ Added configure test for the IPv6 stack included in Cygwin
+ version 1.7.
+ IPv6 support is one of the new features of Cygwin 1.7. For more
+ information,
+ see also http://cygwin.com/cygwin-ug-net/ov-new1.7.html.
+
+2010-01-25 12:40 bvassche
+
+ * configure, configure.d/config_os_headers,
+ configure.d/config_os_libs:
+
+ CHANGES: Cygwin: the message "configure: WARNING: winsock.h:
+ present but cannot be compiled" does no longer appear when
+ running the configure script.
+ Follow-up for r18050: re-enabled libiphlpapi and iphlpapi.h tests
+ for non-MinGW platforms since the Cygwin build needs these.
+
+2010-01-25 07:28 magfr
+
+ * configure, configure.d/config_os_functions, snmplib/inet_ntop.c,
+ snmplib/inet_pton.c:
+
+ CHANGES: building: Use autoconf to decide if inet_ntop.c and
+ inet_pton.c are to be compiled.
+
+2010-01-25 07:09 bvassche
+
+ * configure, configure.d/config_os_struct_members:
+
+ CHANGES: MinGW: struct sockaddr_in6.sin6_scope_id configure test
+ does now work.
+
+2010-01-25 05:14 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ TLSTM counter stats
+
+2010-01-25 05:13 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ add in TSM needed counter definitions
+
+2010-01-25 05:12 hardaker
+
+ * mibs/SNMP-TSM-MIB.txt, mibs/rfclist:
+
+ added the SNMP-TSM-MIB
+
+2010-01-24 14:43 magfr
+
+ * agent/agent_registry.c, include/net-snmp/agent/agent_registry.h:
+
+ NEWS: snmpd: Made subtree_context_cache::context_name a const
+ char*.
+
+2010-01-24 14:27 magfr
+
+ * include/net-snmp/library/tools.h:
+
+ CHANGES: snmplib: Prevent gcc ped-warning for
+ NETSNMP_REMOVE_CONST
+
+2010-01-24 13:27 magfr
+
+ * apps/snmpusm.c:
+
+ CHANGES: snmpusm: Prefer to use a variable of the right type over
+ an ugly cast. Lessen the scope of the variable as well.
+
+2010-01-24 12:59 bvassche
+
+ * configure, configure.d/config_os_headers,
+ configure.d/config_os_libs, configure.d/config_os_progs:
+
+ CHANGES: building: Introduced the variable 'with_socklib' in the
+ configure script. This variable is set to "winsock2" for MinGW
+ and to "default" for all other systems. Winsock2 tests are only
+ run if this variable is set to "winsock2" (MinGW).
+
+2010-01-24 12:53 magfr
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Remove superfluous debug logs.
+
+2010-01-24 12:45 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Windows, compiler warning fixes: fixed warnings about char * /
+ unsigned char *
+ mismatches.
+
+2010-01-24 12:44 bvassche
+
+ * snmplib/snmpUDPDomain.c:
+
+ Windows, compiler warning fix: make inet_ntop() and inet_pton()
+ declarations
+ available to the compiler.
+
+2010-01-24 12:44 bvassche
+
+ * snmplib/snmp_logging.c:
+
+ Windows, compiler warning fix: made sure that <ws2tcpip.h> will
+ be included
+ from <net-snmp/types.h> such that the compiler doesn't complain
+ about struct
+ sockaddr_in6 being used before being defined.
+
+2010-01-24 11:42 bvassche
+
+ * man:
+
+ Updated Subversion ignore list.
+
+2010-01-24 11:41 bvassche
+
+ * agent/agent_index.c, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/agent_trap.c, agent/mib_modules.c,
+ agent/mibgroup/Rmon/alarm.c, agent/mibgroup/Rmon/event.c,
+ agent/mibgroup/Rmon/history.c, agent/mibgroup/Rmon/statistics.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/vacm_vars.c, agent/mibgroup/mibincl.h,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/util_funcs.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c, apps/snmpbulkget.c,
+ apps/snmpbulkwalk.c, apps/snmpdelta.c, apps/snmpdf.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c,
+ apps/snmpstatus.c, apps/snmptable.c, apps/snmptest.c,
+ apps/snmptrap.c, apps/snmpusm.c, apps/snmpvacm.c,
+ apps/snmpwalk.c, include/net-snmp/library/libsnmp.h,
+ include/net-snmp/net-snmp-includes.h, snmplib/lcd_time.c,
+ snmplib/mib.c, snmplib/parse.c, snmplib/read_config.c,
+ snmplib/scapi.c, snmplib/snmp-tc.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c,
+ snmplib/snmpksm.c, snmplib/snmpusm.c, snmplib/snmpv3.c,
+ snmplib/system.c, snmplib/tools.c, snmplib/vacm.c:
+
+ Cleanup (Windows): removed superfluous #include <sys/timeb.h>
+ directives. This header file
+ has only to be included from snmplib/system.c because of the
+ _ftime() call in that file.
+
+2010-01-24 10:43 bvassche
+
+ * apps/snmpnetstat/inet.c:
+
+ The macro 'C()' now casts its result from unsigned long to
+ unsigned int.
+ This change fixes a compiler warnings about format specification
+ mismatches
+ and fixes a bug (incorrect snmpnetstat output) on big endian
+ systems.
+
+2010-01-24 10:33 bvassche
+
+ * man/config_api.3:
+
+ Follow-up for r17946: removed generated man pages from
+ repository.
+
+2010-01-24 10:31 bvassche
+
+ * include/net-snmp/library/winservice.h, snmplib/winservice.c:
+
+ Moved two declarations of static functions from .h to .c.
+
+2010-01-24 10:21 magfr
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ Remove unnecessary casts.
+
+2010-01-24 10:19 bvassche
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ CHANGES: snmplib: builds again when HAVE_GETADDRINFO is not
+ defined.
+
+2010-01-24 10:03 bvassche
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in, snmplib/inet_ntop.c,
+ snmplib/inet_ntop.h, snmplib/inet_pton.c, snmplib/inet_pton.h,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv6Domain.c:
+
+ Changes:
+ - Added configure tests for inet_ntop() and inet_pton().
+ - Added header files snmplib/inet_ntop.h and snmplib/inet_pton.h.
+ - Replaced "extern inet_ntop(...);" and "extern inet_pton(...);"
+ by #include "inet_ntop/pton.h".
+ - Converted snmplib/inet_ntop.c and snmplib/inet_pton.c from K&R
+ C to ANSI C.
+ - Replaced the inet_aton() calls that were introduced in r18033
+ in snmplib/snmpUDPDomain.c by inet_pton() calls such that it is
+ again possible to build Net-SNMP on Windows.
+
+2010-01-24 06:08 magfr
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h:
+
+ CHANGES: snmplib: Remove declarations of functions that don't
+ exist or are declared elsewhere.
+
+2010-01-24 05:48 magfr
+
+ * agent/agent_trap.c:
+
+ NEWS: snmplib: Removed the unused variables warm_start_oid,
+ link_down_oid, link_up_oid, auth_fail_oid and egp_xxx_oid.
+
+2010-01-23 22:06 magfr
+
+ * testing/tests/T070com2sec, testing/tests/T071com2sec6,
+ testing/tests/T072com2secunix:
+
+ Better set of SKIPIF/SKIPIFNOTS
+
+2010-01-23 20:31 magfr
+
+ * testing/tests/T071com2sec6, testing/tests/T072com2secunix:
+
+ Be correct in what it is that is tested in the header.
+
+2010-01-23 20:27 magfr
+
+ * snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ CHANGES: snmplib: Changed the com2sec directives to fail if there
+ are too few arguments. Additionally changed the storage structure
+ to not allocate more space than necessary.
+
+2010-01-23 20:22 magfr
+
+ * testing/tests/T070com2sec, testing/tests/T071com2sec6,
+ testing/tests/T072com2secunix:
+
+ new tests checking the error handling of the com2sec* directives
+
+2010-01-23 19:17 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Follow-up for r18025: builds again with Microsoft Visual Studio.
+
+2010-01-23 17:51 bvassche
+
+ * configure, configure.ac:
+
+ CHANGES: building: OS header detection check is now run before
+ IPv6 stack detection.
+ CHANGES: Solaris: sockaddr_in6.sin6_addr configure test does now
+ work.
+
+2010-01-23 17:42 bvassche
+
+ * snmplib/large_fd_set.c:
+
+ Fixed a Solaris-specific compiler warning.
+
+2010-01-23 17:00 bvassche
+
+ * configure, configure.d/config_os_headers,
+ configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/mingw32.h:
+
+ MinGW: added configure test for <sys/timeb.h> and also for struct
+ timezone.
+
+2010-01-23 16:32 bvassche
+
+ * include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ snmplib/snmpUDPIPv6Domain.c:
+
+ MinGW: made sure that the IPv6-related datatypes are available
+ before being used.
+
+2010-01-23 16:30 bvassche
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Added #undef HAVE_WINDOWS_H.
+
+2010-01-23 16:28 bvassche
+
+ * include/net-snmp/types.h:
+
+ MinGW: made gettimeofday() declaration available for the
+ compiler.
+
+2010-01-23 16:27 bvassche
+
+ * snmplib/snmp_api.c:
+
+ MinGW: made gettimeofday() declaration available for the
+ compiler.
+
+2010-01-23 16:26 bvassche
+
+ * snmplib/inet_pton.c:
+
+ Made sure that the compiler does not complain about a missing
+ prototype for isdigit().
+
+2010-01-23 16:24 bvassche
+
+ * configure, configure.d/config_os_headers:
+
+ MinGW: iphlpapi.h configure test does now work.
+
+2010-01-23 15:10 bvassche
+
+ * configure, configure.d/config_project_ipv6_types:
+
+ Renamed the Winsock2 IPv6 stack from 'mingw' into 'winsock2'.
+
+2010-01-23 15:07 bvassche
+
+ * agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/route_write.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c, agent/snmpd.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmpnetstat/winstub.h, configure,
+ configure.d/config_os_headers,
+ include/net-snmp/net-snmp-config.h.in, include/net-snmp/types.h,
+ snmplib/inet_ntop.c, snmplib/inet_pton.c,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpSSHDomain.c,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Improved portability between the supported Win32 compilation
+ environments as follows:
+ - Made sure that the <winsock2.h> and <ws2tcpip.h> header files
+ are only included from <net-snmp/types.h>.
+ - Added configure check for <iphlpapi.h>.
+ - Replaced several WIN32 / cygwin tests by a HAVE_IPHLPAPI_H
+ test.
+ - Documented that win32/net-snmp/net-snmp-config.h is only used
+ for the MSVC build.
+
+2010-01-22 16:46 bvassche
+
+ * snmplib/tools.c:
+
+ Follow-up for r17910: builds again with Microsoft Visual Studio
+ 6.
+
+2010-01-22 16:41 bvassche
+
+ * agent/mibgroup/winExtDLL.c, win32/MgmtApi-winExtDLL.h:
+
+ Follow up for r18016: builds again with Microsoft Visual Studio.
+
+2010-01-22 14:13 bvassche
+
+ * configure, configure.d/config_os_libs:
+
+ Follow-up for r18016: made MinGW libiphlpapi check more robust.
+
+2010-01-22 13:32 bvassche
+
+ * README.win32, aclocal.m4, agent/agent_index.c,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/mib_modules.c,
+ agent/mibgroup/agentx/client.c, agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/header_complex.c, agent/mibgroup/host_res.h,
+ agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/mibII_common.h,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmUser.c, agent/mibgroup/struct.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/target.c, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c, agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/winExtDLL.c,
+ agent/mibgroup/winExtDLL.h, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c, apps/encode_keychange.c,
+ apps/snmpbulkget.c, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpdf.c, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpnetstat/winstub.c, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmptrapd_auth.c,
+ apps/snmptrapd_handlers.c, apps/snmptrapd_log.c,
+ apps/snmptrapd_sql.c, apps/snmpusm.c, apps/snmpvacm.c,
+ apps/snmpwalk.c, configure, configure.d/config_os_functions,
+ configure.d/config_os_headers, configure.d/config_os_libs,
+ configure.d/config_os_struct_members,
+ configure.d/config_project_ipv6_types,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/mingw32.h, include/net-snmp/types.h,
+ snmplib/asn1.c, snmplib/callback.c, snmplib/default_store.c,
+ snmplib/int64.c, snmplib/keytools.c, snmplib/large_fd_set.c,
+ snmplib/lcd_time.c, snmplib/md5.c, snmplib/mib.c,
+ snmplib/parse.c, snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp.c, snmplib/snmp_alarm.c, snmplib/snmp_api.c,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c, snmplib/snmp_debug.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c,
+ snmplib/snmpksm.c, snmplib/snmpusm.c, snmplib/snmpv3.c,
+ snmplib/system.c, snmplib/tools.c, snmplib/vacm.c,
+ snmplib/winpipe.c, win32/Snmp-winExtDLL.h,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ NEWS: MinGW: winExtDLL compiles now under MinGW.
+ CHANGES: MinGW: building Net-SNMP works again.
+
+ Detailed overview:
+ * Changes in the configure script:
+
+ - socket() library check passes again on MinGW.
+ - Added library checks for libws2_32, libregex and libsnmpapi.
+ - Added check for the winsock2.h and ws2tcpip.h header files.
+ - Added check for the chown() and localtime_r() functions.
+ - sockaddr_in6.sin6_scope_id check does now work on MinGW.
+ - Added IPv6 stack type called "mingw".
+ * Source code changes:
+
+ - Include <winsock2.h> from <net-snmp/types.h> instead of
+ <winsock.h>
+ under MinGW such that IPv6 support is available.
+ - Moved #include <winsock.h> from .c files to <net-snmp/types.h>.
+ - Added a copy of the MinGW header file <snmp.h> (which is not
+ copyrighted)
+ as win32/Snmp-winExtDLL.h.
+ - agent: only call chown() when available (HAVE_CHOWN).
+ * Documentation changes: updated README.win32.
+
+
+2010-01-22 08:34 magfr
+
+ * snmplib/read_config.c:
+
+ CHANGES: snmplib: Do not cast from char* to char*
+
+2010-01-22 00:39 hardaker
+
+ * COPYING:
+
+ Copyright file update for SPARTA, Inc.
+
+2010-01-22 00:22 hardaker
+
+ * snmplib/snmptsm.c:
+
+ add proper prefixes in TSM for SSH, DTLS, etc, based on the
+ domain
+
+2010-01-22 00:20 hardaker
+
+ * dist/patme:
+
+ added 5.5 branch
+
+2010-01-22 00:20 hardaker
+
+ * dist/makerelease.xml:
+
+ minor echo output change
+
+2010-01-21 20:51 rstory
+
+ * snmplib/snmp_api.c:
+
+ move comment next to code it is talking about; No code change
+
+2010-01-21 14:55 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ CHANGES: PATCH: 2926374: from Ed Swierk: fixed reading of
+ ipAddressTable from /proc/net/if_inet6 on Linux
+
+ The kernel might provide longer fields, especially on 64-bit
+ systems.
+
+2010-01-20 12:42 bvassche
+
+ * PORTING, local/snmpcheck.def:
+
+ Fixed typo: replaced 'necissary' by 'necessary'.
+
+2010-01-20 08:53 jsafranek
+
+ * man/snmpnetstat.1.def:
+
+ Fix minor typo in man page, it's snmpnetstat -Cp, not -CP.
+
+2010-01-14 12:34 jsafranek
+
+ *
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c:
+
+ CHANGES: fixed memory leak in RMON-MIB and ETHERLIKE-MIB when
+ there are multiple aliases of an network interface
+ Rationale: the aliased interfaces have the same ifIndex ->
+ CONTAINER_INSERT fails, but the rejected entry was not freed.
+
+2010-01-13 11:21 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ CHANGES: snmpd: fix memory leak in ipAddressPrefixTable
+ - net_snmp_search_update_prefix_info returns different code, when
+ the entry was not inserted to list and can be freed.
+
+2010-01-12 00:52 tanders
+
+ * configure, configure.d/config_os_libs:
+
+ CHANGES: build: run rpm configure checks for hr_swinst rewrite
+ (rpm
+ version only)
+
+2010-01-11 23:58 tanders
+
+ * apps/Makefile.in:
+
+ add PERLLDOPTS_FOR_APPS to agentxtrap link line (fixes
+ "libperl.so not
+ found" errors)
+
+2010-01-11 00:11 tanders
+
+ * testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap,
+ testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap, testing/tests/T113agentxtrap,
+ testing/tests/T114agentxagentxtrap:
+
+ get rid of using deprecated syntax for trap/inform sinks
+
+2010-01-08 08:42 bvassche
+
+ * snmplib/snmp_alarm.c, snmplib/snmp_api.c:
+
+ CHANGES: snmplib: obsoleted NETSNMP_DS_LIB_ALARM_DONT_USE_SIG.
+ From now on using SIGALRM to trigger Net-SNMP alarm handlers is
+ no longer supported.
+
+ Motivation: as known libnetsnmp supports time-based alarms via
+ the functions
+ snmp_alarm_register(), run_alarms() and other functions. Two
+ different ways to
+ trigger the function run_alarms() are supported inside
+ libnetsnmp:
+ 1. By making sure that the timeout argument of select() is small
+ enough such
+ that select() returns before the next alarm must be handled (when
+ the
+ variable NETSNMP_DS_LIB_ALARM_DONT_USE_SIG is set to one, which
+ is the
+ default).
+ 2. By making sure that the kernel fires SIGALRM at the time when
+ run_alarms()
+ should be called (when the variable
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG is set
+ to zero, which has to be configured explicitly).
+
+ The following issues are associated with the second approach:
+ 1. Alarm functions are used inside Net-SNMP to e.g. refresh
+ cached table
+ contents. As far as I can see there is nothing in the Net-SNMP
+ source code
+ that prevents the following from happening: a table refresh
+ triggered via
+ SIGALRM while a row is being removed from a cached table. This
+ can result
+ in dangling pointer dereferences and even a crash.
+ 2. POSIX restricts signal handlers to calling functions that are
+ either reentrant
+ or non-interruptible
+ (http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04).
+ Standard I/O functions like printf() and fprintf() are neither
+ reentrant nor
+ non-interruptible. run_alarms() is called from inside a signal
+ handler, which
+ means that this restriction applies to the function run_alarms()
+ itself and
+ all functions called by it (which includes the alarm callback
+ functions).
+ Or: e.g. snmp_log() and its callers must not be called from
+ inside run_alarms()
+ when this function is invoked from inside a signal handler. This
+ is a severe
+ restriction, and one that is hard to work with.
+ 3. Not all software developers know how to make sure that signal
+ delivery works
+ correctly in a multithreaded context. POSIX does not guarantee to
+ which thread
+ a signal like SIGALRM will be delivered, unless that signal has
+ been blocked
+ before thread creation and is unblocked after thread creation
+ (see also
+ http://www.opengroup.org/onlinepubs/009695399/functions/pthread_sigmask.html).
+ This is relevant for the Net-SNMP project not only because a
+ worker thread is
+ created inside
+ agent/mibgroup/if-mib/data_access/interface_linux.c but also
+ because libnetsnmp is often used inside multithreaded software.
+ Currently no
+ attempt is made to make sure that SIGALRM is processed by the
+ Net-SNMP event
+ processing loop thread. If SIGALRM is processed by another
+ thread, this will
+ result in one or more data races.
+
+ Because all the difficulties associated with processing alarms
+ from inside a
+ signal handler function, and because fixing these would require
+ more effort than
+ it is worth, NETSNMP_DS_LIB_ALARM_DONT_USE_SIG has been
+ deprecated and from now
+ on approach (1) is the only supported approach to trigger alarm
+ handlers.
+
+2010-01-07 19:42 hardaker
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c:
+
+ Patch from Stephen Hemminger to fix a minor memleak in cpu
+ sysctrl fetching
+
+2010-01-07 16:21 bvassche
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c,
+ snmplib/snmpusm.c, snmplib/vacm.c:
+
+ Removed read_config_read_ascii_string(), and made sure that
+ read_config_read_octet_string() '\0'-terminates the output buffer
+ in all cases.
+ Updated documentation and unit tests.
+
+2010-01-07 14:41 bvassche
+
+ * snmplib/snmpusm.c:
+
+ Removed three superfluous casts because these triggered a
+ compiler warning
+ when compiled with MSVC.
+
+2010-01-07 13:28 bvassche
+
+ * snmplib/read_config.c:
+
+ Reverted the read_config_read_octet_string() changes from r17992
+ because these
+ caused the following Valgrind complaint during snmpd startup:
+
+ ==25201== Conditional jump or move depends on uninitialised
+ value(s)
+ ==25201== at 0x4047B14: netsnmp_send_traps (agent_trap.c:798)
+ ==25201== by 0x4048128: send_enterprise_trap_vars
+ (agent_trap.c:853)
+ ==25201== by 0x404819D: send_trap_vars (agent_trap.c:963)
+ ==25201== by 0x404825B: send_easy_trap (agent_trap.c:1011)
+ ==25201== by 0x804B5D2: main (snmpd.c:394)
+
+2010-01-07 12:30 bvassche
+
+ *
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c:
+
+ Fixed a format specification mismatch.
+
+2010-01-07 12:19 bvassche
+
+ * include/net-snmp/agent/sysORTable.h:
+
+ Depending on the context, assigning a char * pointer to
+ sysORTable::OR_descr does or does not transfer
+ ownership. So whether OR_descr is declared as char * or as const
+ char *, there will always be at
+ least one statement on which the compiler complains about a char
+ * / const char * mismatch. The only solution is to cast away
+ const where appropriate to make sure that the compiler does not
+ complain, as implemented in this patch. 2010-01-07 11:46
+ bvassche
+
+
+ * snmplib/snmpusm.c:
+
+ usm_save_user(): when writing user->name and user->secName, only
+ write the ASCII data and not the
+ terminating '\0'. Since both items are read by calling
+ read_config_read_ascii_string(), writing
+ the terminating '\0' is not necessary to guarantee that the data
+ read back is terminated properly.
+
+2010-01-07 09:13 bvassche
+
+ * snmplib/read_config.c:
+
+ Changed the behavior of read_config_read_octet_string(): until
+ now this
+ function terminated the output buffer in some cases with '\0'
+ (when the
+ input was in the format 0x... and a buffer overflow occurred and
+ also
+ when the input was in ASCII format, but not when the input was in
+ format
+ 0x... and no buffer overflow occurred). Changed this such that
+ this
+ function does no longer terminate the input buffer with '\0'.
+ This
+ change was possible because inside the Net-SNMP project all
+ callers that
+ needed a '\0' terminated string have been converted to use
+ read_config_read_ascii_string() instead.
+
+2010-01-06 17:52 bvassche
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.c,
+ agent/mibgroup/tunnel/tunnel.c:
+
+ Reverted r17968 and r17972.
+
+2010-01-06 15:40 bvassche
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/mibII/vacm_conf.c:
+
+ Fixed more compiler warnings related to the use of the const
+ keyword.
+
+2010-01-06 15:38 bvassche
+
+ * agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c:
+
+ Fixed a format specification mismatch.
+
+2010-01-06 15:36 bvassche
+
+ * include/net-snmp/library/snmpusm.h:
+
+ Changed argument type from char * into const char *. Should have
+ been included in r17975.
+
+2010-01-06 15:33 bvassche
+
+ * agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/utilities/override.c:
+
+ Fixed several compiler warnings about char * / u_char *
+ mismatches.
+
+2010-01-06 15:31 bvassche
+
+ * agent/agent_read_config.c,
+ include/net-snmp/agent/agent_read_config.h,
+ include/net-snmp/config_api.h, snmplib/read_config.c:
+
+ Added the functions register_const_config_handler() and
+ snmpd_register_const_config_handler(), which
+ accept a parser function that does not modify the string that it
+ parses. Using these functions results
+ in easier to read code than using the non-const handler
+ registration functions and casting the parser
+ function explicitly from (void(*)(const char*, const char*)) to
+ (void(*)(const char*, char*)).
+
+2010-01-06 15:27 bvassche
+
+ * snmplib/snmpusm.c:
+
+ Fixed a compiler warning about discarding the const qualifier.
+
+2010-01-06 14:48 bvassche
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c:
+
+ Added read_config_read_objid_const().
+
+2010-01-06 14:42 bvassche
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ Duplicated the second argument of REGISTER_SYSOR_TABLE() /
+ REGISTER_SYSOR_ENTRY()
+ since that argument is freed while unregistering such an entry.
+ Not sure whether
+ this could actually trigger a call of free() with a constant
+ string as argument
+ and I'm neither sure about whether or not this could have
+ triggered a crash.
+
+2010-01-06 14:34 bvassche
+
+ * include/net-snmp/library/vacm.h, snmplib/vacm.c:
+
+ For those VACM functions that do not modify the strings passed as
+ arguments,
+ changed the argument type from char * to const char *.
+
+2010-01-06 14:27 bvassche
+
+ * snmplib/snmp_logging.c:
+
+ Fixed a compiler warning about discarding the const qualifier.
+
+2010-01-06 14:26 bvassche
+
+ * agent/mibgroup/sctp-mib/sctpScalars_common.c:
+
+ Removed an unused variable.
+
+2010-01-06 14:14 bvassche
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.c:
+
+ Duplicated the second argument of REGISTER_SYSOR_TABLE() /
+ REGISTER_SYSOR_ENTRY()
+ since that argument is freed while unregistering such an entry.
+ Not sure whether
+ this could actually trigger a call of free() with a constant
+ string as argument
+ and I'm neither sure about whether or not this could have
+ triggered a crash.
+
+2010-01-06 14:08 bvassche
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/event/mteTriggerConf.h:
+
+ Fixed several compiler warnings about discarding the const
+ qualifier.
+
+2010-01-06 14:06 bvassche
+
+ * agent/helpers/table.c, agent/helpers/table_dataset.c:
+
+ Fixed several compiler warnings about char * / u_char *
+ mismatches.
+
+2010-01-06 14:04 bvassche
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c:
+
+ Changes:
+ - Added new functions skip_white_const(), skip_not_white_const(),
+ skip_token_const(), copy_nword_const() and
+ read_config_read_octet_string_const().
+ - Changed return type of read_config_read_ascii_string() from
+ char * to
+ const char *. Note: this does not affect backwards compatibility
+ since this
+ function has not yet been included in any release.
+ - Fixed documentation of read_config_read_octet_string() and
+ read_config_read_ascii_string().
+ - Reduced number of cast-away-const constructs in read_config.c.
+
+2010-01-06 13:35 bvassche
+
+ * include/net-snmp/library/tools.h:
+
+ Refined the implementation of the macro NETSNMP_REMOVE_CONST():
+ when using
+ the gcc compiler, it is now verified whether the types (const t)
+ and typeof(e)
+ are compatible, where t is the first argument and e the second
+ argument of
+ this macro.
+
+2010-01-06 13:33 jsafranek
+
+ * agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/at.h:
+
+ Add support of network interfaces with HW address bigger than 6
+ bytes to atTable. Some HW, like InfiniBand, uses HW addresses
+ with 9 and more bytes.
+
+2010-01-06 12:45 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_kstat.c:
+
+ CHANGES: snmpd: BUGS: 2924140: Fix termination of CPU/FPU types
+
+2010-01-06 12:33 dts12
+
+ * snmplib/snmpUnixDomain.c:
+
+ CHANGES: snmplib: BUGS: 2922390: Fix test for missing contextName
+ parameter
+
+2010-01-06 11:57 bvassche
+
+ * agent/snmp_perl.c, include/net-snmp/library/tools.h,
+ snmplib/container.c, snmplib/container_binary_array.c,
+ snmplib/container_list_ssll.c, snmplib/parse.c,
+ snmplib/snmp_service.c:
+
+ Changes:
+ - Introduced a new macro NETSNMP_REMOVE_CONST() that allows to
+ cast
+ away constness without that gcc -Wcast-qual reports a warning.
+ - Made casting away constness explicit by introducing the
+ NETSNMP_REMOVE_CONST() macro. This suppresses the warning
+ gcc -Wcast-qual printed for these statements.
+
+2010-01-06 11:46 bvassche
+
+ * agent/mibgroup/tunnel/tunnel.c, snmplib/snmpUDPIPv6Domain.c:
+
+ Fixed compiler warnings about discarding the const qualifier.
+
+2010-01-06 09:14 magfr
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/dlmod.c, agent/snmp_agent.c,
+ apps/agentxtrap.c, snmplib/large_fd_set.c, snmplib/snmp_api.c:
+
+ Do not use 0 when referring to NULL.
+
+2010-01-06 08:26 bvassche
+
+ * include/net-snmp/library/system.h, snmplib/system.c:
+
+ Changed argument types of calculate_time_diff() and
+ calculate_sectime_diff()
+ from struct timeval * to const struct timeval *. Note: this does
+ not affect
+ backwards compatibility.
+
+2010-01-06 08:23 bvassche
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Changes (no functionality has been modified):
+ - Removed diskio_parse_config() declaration because that function
+ is neither called nor defined in the source file diskio.c.
+ - Added declaration for getstats() such that gcc does not
+ complain about a missing declaration.
+ - Linux: changed visibility of getstats() from global to static
+ for consistency with the BSD and Darwin implementations of
+ getstats().
+
+2010-01-06 08:00 bvassche
+
+ * agent/agent_trap.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/utilities/iquery.c:
+
+ Fixed compiler warnings about char * / u_char * mismatches.
+
+2010-01-06 02:18 magfr
+
+ * apps/Makefile.in, configure, configure.d/config_modules_agent,
+ man/Makefile.in, testing/tests/T114agentxagentxtrap:
+
+ CHANGES: apps: Only build agentxtrap if the agentx libraries are
+ built. Add a test case for agentxtrap.
+
+ The enablement/disablement is inspiered by automake conditionals
+
+2010-01-06 01:59 magfr
+
+ * agent/mibgroup/agentx/client.c:
+
+ Remove unused variable starttime.
+
+2010-01-05 22:54 magfr
+
+ * agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/logmatch.h:
+
+ CHANGES: Hide most functions and variables in the logmatch
+ module. Cleaned up the header accordingly. Remove the need for
+ forward declarations by reordering the functions.
+
+2010-01-05 22:33 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: BUGS: 2919379: Initialise SNMP sessions properly
+ Provided by Diego Billi
+
+2010-01-05 22:20 dts12
+
+ * snmplib/snmpCallbackDomain.c:
+
+ CHANGES: snmplib: BUGS: 2919320: Avoid accessing freed memory
+ Reported by Tomasz Lis
+
+2010-01-05 18:58 dts12
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ CHANGES: snmpd: BUGS: 2914410: Fix crash on empty command lines
+
+2010-01-05 15:31 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ CHANGES: snmpd: PATCH: 2912584: Fix null OID handling in Agentx
+ on 64bit
+ Patch supplied by Lutz Jaenicke
+
+2010-01-05 10:11 tanders
+
+ * include/net-snmp/system/hpux.h:
+
+ CHANGES: hpux: fix build error on HP-UX 10.20
+
+2010-01-05 08:42 jsafranek
+
+ * man, man/pdu_api.3, man/session_api.3, man/varbind_api.3:
+
+ Remove generated man pages from repository.
+
+2010-01-04 16:44 bvassche
+
+ * snmplib/read_config.c:
+
+ Fixed a past-end-of-buffer read that occurred when an ASCII
+ string was
+ passed as the first argument of read_config_read_octet_string() /
+ read_config_read_ascii_string() and the third argument (*len)
+ equals 0.
+
+2010-01-04 16:41 bvassche
+
+ * snmplib/read_config.c:
+
+ Fixed compiler warnings about casting away 'const'.
+
+2010-01-04 16:27 bvassche
+
+ * snmplib/read_config.c:
+
+ Added unit test for read_config_read_octet_string() and
+ read_config_read_ascii_string().
+
+2010-01-04 10:45 jsafranek
+
+ * snmplib/mib.c:
+
+ Use correct oid length in table indexes.
+
+2010-01-04 08:10 bvassche
+
+ * snmplib/snmp_alarm.c:
+
+ Made sure that snmp_alarm.c can be compiled again with C89
+ compilers: for C89
+ it is required that initializers are constant expressions.
+
+2010-01-03 16:28 magfr
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_common.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c:
+
+ Rename netsnmp_arch_tcpconn_delete to
+ netsnmp_arch_tcpconn_entry_delete in order to be consistent with
+ the header file and all the other functions in the module.
+
+2010-01-03 16:26 magfr
+
+ * agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+ include/net-snmp/data_access/ip_scalars.h,
+ include/net-snmp/data_access/systemstats.h:
+
+ Add missing declarations.
+
+2009-12-30 12:49 bvassche
+
+ * include/net-snmp/library/tools.h,
+ include/net-snmp/library/types.h:
+
+ Follow-up for r17933: fixed the issue that including the header
+ file
+ <net-snmp/library/types.h> from <net-snmp/library/tools.h>
+ triggers
+ compiler errors during the configure process (complaints about
+ <netsnmp/net-snmp-config.h> not being included before
+ <net-snmp/types.h>).
+ Note: this does not solve the underlying problem that MIB code
+ must not
+ include the header file <net-snmp/types.h> because doing so would
+ trigger a
+ circular dependency during the configure step (MIB code is
+ compiled during
+ the configure step, while the configure step generates
+ <netsnmp/net-snmp-config.h> and <net-snmp/types.h> needs
+ <netsnmp/net-snmp-config.h>).
+
+2009-12-30 11:48 bvassche
+
+ * apps, man:
+
+ Follow-up for r17919: updated Subversion ignore lists.
+
+2009-12-28 18:03 bvassche
+
+ * agent/agent_index.c:
+
+ Fixed a past-end-of-buffer read. Found this by analyzing compiler
+ warnings.
+ Note: the affected function, register_string_index(), isn't
+ called from
+ anywhere inside the Net-SNMP project itself.
+
+2009-12-23 09:49 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ Fix invalid read reported by valgrind:
+ Invalid read of size 1
+ memcpy (mc_replace_strmem.c:402)
+ _netsnmp_ioctl_ipaddress_container_load_v4
+ (ipaddress_ioctl.c:240)
+ netsnmp_arch_ipaddress_container_load (ipaddress_linux.c:158)
+ netsnmp_access_ipaddress_container_load (ipaddress_common.c:112)
+
+ Returning structure with pointers inside is not the best thing to
+ do.
+
+2009-12-22 16:05 bvassche
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c,
+ snmplib/snmpusm.c, snmplib/vacm.c:
+
+ Fixed several past-end-of-buffer reads.
+
+2009-12-22 12:02 bvassche
+
+ * agent/mibgroup/Rmon/agutil.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/mibII/interfaces.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/library/system.h,
+ include/net-snmp/library/tools.h,
+ include/net-snmp/library/types.h, man/netsnmp_util.3,
+ snmplib/system.c, snmplib/tools.c, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in:
+
+ Reverted the backwards-incompatible changes of r17913:
+ - Restored the definition of the DIFFTIMEVAL() macro.
+ - Restored the definitions of the functions
+ calculate_time_diff(),
+ uatime_ready(), marker_tticks() and timeval_tticks().
+ - starttime is again a global variable instead of a static one.
+ Also implemented the following changes:
+ - Moved the marker_t typedef from net-snmp/library/tools.h to
+ net-snmp/library/types.h.
+ - Added a new typedef, const_marker_t.
+ - For those atime_*() / uatime_*() / *_tticks() functions that do
+ not change
+ their arguments, declared these arguments const_marker_t instead
+ of marker_t.
+ - Renamed netsnmp_get_starttime() and netsnmp_set_starttime() to
+ netsnmp_get_agent_starttime() and netsnmp_set_agent_starttime()
+ respectively. Moved these functions from tools.c to system.c.
+ - Removed the function atime_hsubtract() (was introduced in
+ r17913) and
+ introduced a new function, netsnmp_set_agent_uptime().
+
+2009-12-22 07:59 bvassche
+
+ * snmplib/read_config.c:
+
+ Reverted r17926, which made the string returned by
+ read_config_read_octet_string() zero-terminated. A new patch will
+ follow
+ that fixes the callers of read_config_read_octet_string() that
+ were
+ assuming that read_config_read_octet_string() zero-terminates the
+ string
+ read by this function.
+
+2009-12-21 14:29 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ CHANGES: snmpd: fix crash in IF-MIB and IP-MIB when there are
+ some interfaces with broadcast IP address and some without.
+
+ Reset the bcastentry in the loop, so it cannot be inserted to the
+ container
+ twice.
+
+ Without this patch, when an interface without broadcast address
+ is processed,
+ the bcastaddress from previous loop is inserted into the
+ container. This
+ obviously fails and the bcastentry is freed, but the container
+ still contains
+ reference to it -> SIGSEGV.
+
+2009-12-21 13:52 bvassche
+
+ * snmplib/read_config.c:
+
+ Follow-up for r17928: while r17928 fixed a dangling pointer
+ dereference
+ detected by running the Net-SNMP software on Windows, that patch
+ introduced
+ a dangling pointer dereference about which only Valgrind on Linux
+ complained.
+ This follow-up patch fixes both dangling pointer dereferences
+ triggered by
+ parsing the persistentDir keyword.
+
+2009-12-21 13:32 bvassche
+
+ * agent/helpers/table_dataset.c:
+
+ Applied a slightly modified version of patch #2901122. Changes:
+ - New feature: specifying ASN type SNMP_NOSUCHINSTANCE as the
+ third argument
+ of netsnmp_set_row_column() will cause an SNMP GetRequest /
+ GetNextRequest to
+ return the error code noSuchInstance (SNMPv2) or noSuchName
+ (SNMPv1). This
+ makes it possible to have a cached table with one or more
+ "holes".
+ - Performance optimization: do not free() / malloc() the memory
+ for storing
+ the cached value if the value has not been modified.
+ - Performance optimization: do not free() / malloc() the memory
+ for storing
+ the cached value if the length of the value has not been
+ modified.
+ - Performance optimization: if the size of the cached value
+ shrunk, use
+ realloc() instead of free() and malloc().
+
+2009-12-21 12:23 bvassche
+
+ * snmplib/read_config.c:
+
+ Applied a slightly modified version of patch #2912055: make sure
+ that
+ parsing the "persistentDir" keyword in snmp.conf does not trigger
+ a
+ dangling pointer. To my surprise BoundsChecker complained about
+ this
+ (on Windows), but Valgrind did not report this issue (on Linux).
+
+2009-12-21 12:08 bvassche
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ Follow-up for r17925 (fix memory leak during startup): while
+ r17925 fixed
+ only the leak triggered from inside the for-loop, this patch does
+ now also
+ fix the leak triggered by the netsnmp_table_dataset_add_row()
+ call near
+ the end of log_notification().
+
+2009-12-21 12:01 bvassche
+
+ * snmplib/read_config.c:
+
+ Applied patch #2912062: make sure that the string returned by
+ read_config_read_octet_string() is properly terminated, such that
+ the
+ callers of this function do not trigger past-end-of-buffer reads.
+ Found
+ this issue via BoundsChecker.
+
+2009-12-21 11:06 bvassche
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ Applied patch #2912068, which fixes a memory leak during startup.
+ The
+ function log_notification() adds a row to the table
+ nlmLogVarTable, but
+ this function can be called before that table has been
+ initialized. If
+ that happens, memory is allocated for a row but that memory is
+ never
+ added to the cached table data. The BoundsChecker tool reported
+ this as
+ a "memory leak leaving scope".
+
+2009-12-21 10:54 bvassche
+
+ * README.win32:
+
+ Added the following text to the "Limitations" section of
+ README.win32:
+ "When using winExtDLL, there is an offset of up to one second
+ between the
+ value of the sysUpTime varbind included in the traps generated by
+ SNMP
+ extension DLLs (e.g. linkUp and linkDown) and the value of the
+ sysUpTime
+ varbind included in traps generated by Net-SNMP itself (e.g.
+ coldStart)."
+
+2009-12-21 10:09 bvassche
+
+ * agent/agent_trap.c, man/netsnmp_agent_trap.3,
+ snmplib/snmp_alarm.c:
+
+ Spelling fix: replaced all occurrences of 'specifc' by
+ 'specific'.
+
+2009-12-21 10:06 bvassche
+
+ * snmplib/snmp_alarm.c:
+
+ Refactoring: eliminated duplicated code by reimplementing
+ snmp_alarm_register() using snmp_alarm_register_hr(). Neither the
+ Net-SNMP API nor the behavior of snmp_alarm_register() has been
+ changed.
+
+2009-12-20 11:10 magfr
+
+ * apps/Makefile.in, apps/agentxtrap.c, man/Makefile.in,
+ man/agentxtrap.1.def:
+
+ NEWS: apps: Add command to send AgentX notify requests to a
+ master agent.
+
+2009-12-17 16:44 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Follow-up for r17917 -- builds again on Windows systems.
+
+2009-12-17 16:03 bvassche
+
+ * agent/mibgroup/utilities/iquery.c,
+ include/net-snmp/library/snmp_client.h, snmplib/snmp_client.c:
+
+ Follow-up for r17903 / patch 2911323 "Fix agent lockup when
+ monitoring
+ AgentX-delegated information" (submitted by myself). That patch
+ did not only
+ fix the lockup but also made snmpd print a warning during startup
+ when
+ iquerySecName was not configured. This warning was printed even
+ when no
+ internal queries were performed. This warning is now only printed
+ just before
+ the first internal query is made (during the first call of
+ netsnmp_query_get_default_session() instead of during creation of
+ the internal
+ session).
+
+2009-12-17 13:55 bvassche
+
+ * agent/mibgroup/Rmon/agutil.c:
+
+ RMON MIB source code compiles again -- should have been included
+ in r17913.
+
+2009-12-17 13:18 bvassche
+
+ * agent/mibgroup/Rmon/agutil.c, snmplib/system.c:
+
+ Modified the implementation of calculate_sectime_diff() and
+ AGUTIL_sys_up_time() such that these functions normalize the
+ tv_usec field of
+ struct timeval properly. Note: this source code modification does
+ not affect
+ the return value of the aforementioned two functions.
+
+2009-12-17 13:11 bvassche
+
+ * man/netsnmp_util.3:
+
+ Removed documentation of the DIFFTIMEVAL() macro -- should have
+ been included
+ in r17913.
+
+2009-12-17 13:05 bvassche
+
+ * agent/agent_trap.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/snmpv3/snmpEngine.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, include/net-snmp/library/system.h,
+ include/net-snmp/library/tools.h, man/netsnmp_util.3,
+ snmplib/snmp_alarm.c, snmplib/system.c, snmplib/tools.c,
+ win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Converted starttime from a global variable into a static variable
+ and applied the following changes:
+ - Added two new macros: NETSNMP_TIMERADD() and
+ NETSNMP_TIMERSUB().
+ - Added three new functions: netsnmp_get_starttime(),
+ netsnmp_set_starttime() and atime_hsubtract().
+ - Replaced gettimeofday() + calculate_time_diff() calls by a call
+ to netsnmp_get_agent_uptime().
+ - Removed the macro DIFFTIMEVAL() because it was not used inside
+ the Net-SNMP project and because it contained a bug.
+ - Removed the functions calculate_time_diff(), uatime_ready(),
+ marker_tticks() and timeval_tticks().
+
+2009-12-17 12:44 bvassche
+
+ * agent/mibgroup/agentx/master_admin.c,
+ win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Bug fix: according to RFC 2571 the unit of snmpEngineTime is one
+ second,
+ not one hundredth of a second.
+
+2009-12-17 10:03 dts12
+
+ * man/snmptest.1.def:
+
+ Fix typo.
+
+2009-12-16 12:30 bvassche
+
+ * snmplib/tools.c, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Windows-only bug fixes:
+ - Fixed the strange build errors that occurred when compiling
+ libnetsnmp as a DLL and when either <stdlib.h> or <string.h> was
+ included after <net-snmp-config.h> instead of before.
+ - For debug builds with Microsoft Visual Studio, fixed the
+ mismatches between the _malloc_dbg() call invoked by strdup() and
+ free()-ing strdup()-ed memory by including the <crtdbg.h> header
+ in tools.c and by defining the preprocessor symbol
+ _CRTDBG_MAP_ALLOC. Detected via the memory checker included in
+ Intel Parallel Studio.
+
+2009-12-14 17:23 tanders
+
+ * perl/agent/agent.xs, snmplib/snmpTCPDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ sync definition of netsnmp_udp_addr_pair in Perl with the changes
+ in
+ r17855 and r17908
+
+2009-12-14 13:55 jsafranek
+
+ * snmplib/snmpTCPDomain.c:
+
+ Fix TCP transport broken by rev. 17855 - copies of
+ netsnmp_udp_addr_pair in snmpTCPDomain.c and snmpUDPDomain.c must
+ be the same.
+
+2009-12-11 14:43 hardaker
+
+ * apps/snmpusm.c, man/snmpusm.1.def:
+
+ CHANGES: snmpusm: patch from Martin Bjorklund to add a -Cw option
+ to use createAndWait for agents that are strict about not
+ allowing a row to be set to active until the authentication
+ password has been changed; plus white-space clean up, manual
+ additions and help output modifications by hardaker
+
+2009-12-11 14:35 bvassche
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Fixed a compiler warning about a format specifier mismatch.
+
+2009-12-11 14:06 bvassche
+
+ * README.win32, agent/mibgroup/winExtDLL.c:
+
+ winExtDLL bugs fixed:
+ - sysUpTime.0 does now report the correct value.
+ - a linkUp or linkDown trap is now sent after the status of a
+ network interface
+ has changed.
+ - the value of the sysUpTime.0 varbind in linkUp and linkDown
+ traps is now
+ correct.
+
+2009-12-10 15:52 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ CHANGES: agent: PATCHES: 2911970: Properly terminate linked list
+ of registrations.
+ Patch provided by Mirko Deckert.
+
+2009-12-10 15:43 dts12
+
+ * agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/utilities/iquery.c:
+
+ CHANGES: snmpd: PATCHES: 2911323: Fix agent lockup when
+ monitoring AgentX-delegated information
+
+2009-12-10 13:59 bvassche
+
+ * README.win32:
+
+ Changes:
+ - Added information about Microsoft's implementation of
+ hrSystemUptime.0.
+ - Fixed a few typos.
+
+2009-12-10 13:01 bvassche
+
+ * agent/agent_registry.c:
+
+ Added missing newline in a logging statement.
+
+2009-12-10 12:54 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Fixed the following winExtDLL bugs:
+ - Fixed bug in trap forwarding: linkDown traps were sent as
+ warmStart traps
+ and linkUp traps were sent as linkDown traps.
+ - Fixed a memory leak triggered by extension DLL loading.
+ - A debug trace statement is now invoked whenever a serious error
+ has been
+ detected.
+
+2009-12-10 12:37 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ OIDs in debug messages generated by the winExtDLL module are now
+ printed in
+ symbolic form instead of numeric form.
+
+2009-12-10 08:57 bvassche
+
+ * win32/win32sdk.dsw:
+
+ Project dependencies should now really be correct. Should have
+ been included
+ in r17873.
+
+2009-12-10 08:41 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Changes (only source code comments have been changed):
+ - Removed a note that contradicted the instructions in
+ README.win32.
+ - Updated build instructions after the addition of the file
+ win32/Snmp-winExtDLL.h in r17830.
+
+2009-12-10 08:17 bvassche
+
+ * apps/snmpdf.c, apps/snmpstatus.c:
+
+ Made file header comments consistent with the descriptions in the
+ respective man pages.
+
+2009-12-10 03:04 magfr
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Made sure that agent_sysOR_callback won't trigger a warning when
+ registered as a callback. Change agentx_reopen_sysORTable in
+ order to avoid warnings of const removal.
+
+2009-12-09 15:05 bvassche
+
+ * snmplib/snmp_logging.c:
+
+ - Moved the declaration of the variable 'newline' inside the
+ function
+ log_handler_stdouterr() because this variable is only used by
+ that function.
+ - Documented the purpose of the variable 'newline'.
+ - Bug fix: made sure that the call log_handler_stdouterr() does
+ not trigger an
+ invalid memory access (str[-1]) when an empty string is passed to
+ this function.
+
+2009-12-09 14:37 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ include/net-snmp/data_access/arp.h:
+
+ CHANGES: snmpd: Add support of network interfaces with HW address
+ bigger than 6 bytes to ipNetToMediaTable and
+ ipNetToPhysicalTable.
+ Some HW, like InfiniBand, uses HW addresses with 9 and more
+ bytes. Snmpd on Linux was not able to parse /proc/net/arp then
+ and produced ugly 'ioctl 35123 returned -1' to log.
+
+2009-12-09 12:27 bvassche
+
+ * README.win32:
+
+ Added missing -Lo in a command line example.
+
+2009-12-09 12:16 bvassche
+
+ * win32/snmpdsdk/snmpd.dsp:
+
+ Added snmpapi.lib to the linker input list of snmpd.exe.
+ Apparently Visual
+ Studio 2005 and 2008 need this library in the linker input list
+ when linking
+ the exe, while for Visual Studio 6 it is sufficient when this
+ library is
+ present in the linker input list of netsnmpmibs.lib.
+
+2009-12-09 08:45 bvassche
+
+ * README.win32:
+
+ Updated README.win32: because of r17884 and r17873, the build
+ process became simpler.
+
+2009-12-09 08:22 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def.in:
+
+ Export strtoull -- should have been included in r17886.
+
+2009-12-09 08:21 bvassche
+
+ * README.win32:
+
+ Reverted r17700 for README.win32: because of r17886, modifying
+ the
+ strtoull line in win32/libsnmp_dll/libsnmp.def is no longer
+ necessary.
+
+2009-12-09 08:12 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Windows: switched from _strtoui64() to strtoull() for Microsoft
+ Visual Studio
+ 2002 and later because the former is not fully POSIX compliant.
+ The strtoull()
+ unit test produces the following output for _strtoui64() with
+ MSVC 2008:
+ test 14 failed (input "0x"): expected end 1, got end 0
+ test 16 failed (input "0x"): expected end 1, got end 0
+
+2009-12-08 21:54 magfr
+
+ * agent/mibgroup/util_funcs.c, snmplib/system.c:
+
+ CHANGES: snmplib, snmpd: Make sure that a mask is given to open
+ when O_CREAT is specified
+
+2009-12-08 16:20 bvassche
+
+ * win32/win32.dsw:
+
+ Made dependencies between exe's and lib's explicit such that
+ Visual
+ Studio can figure out the proper build order instead of the user
+ having
+ to figure this out.
+
+2009-12-08 15:47 bvassche
+
+ * apps/snmptable.c:
+
+ Builds again on Unix systems (fixed a typo introduced in r17881).
+
+2009-12-08 15:37 bvassche
+
+ * win32/snmpnetstat/snmpnetstat.dsp:
+
+ Added missing #define HAVE_WIN32_PLATFORM_SDK. Without this
+ define the Microsoft
+ Visual Studio compiler complains about a benign redefinition of
+ type socklen_t.
+
+2009-12-08 15:28 bvassche
+
+ * agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/snmpd.c, apps/snmptable.c, apps/snmptrapd.c,
+ include/net-snmp/library/snmp_logging.h, snmplib/snmp_logging.c:
+
+ Cleaned up the code for setting line buffering:
+ - Instead of having calls to setvbuf() in multiple files, there
+ is now one call
+ to setvbuf() from the new function netsnmp_set_filelog. These
+ source files
+ are: snmplib/snmp_logging.c, agent/snmpd.c, apps/snmptrapd.c,
+ apps/snmptable.c
+ and agent\mibgroup\disman\traceroute\traceRouteCtlTable.c.
+ - Using -Lo / -Le does now enable line buffering for stdout /
+ stderr respectively.
+ - Removed code in snmpd.c and snmptrapd.c for setting line
+ buffering on stdout
+ since setting line buffering on stdout is now triggered by the
+ command-line
+ option -Lo.
+ Bugs fixed:
+ - Line buffering mode is now also set for stderr when the
+ command-line option
+ -Le has been specified.
+ - Line buffering mode is now set correctly for stdout on Windows
+ systems
+ (command-line option -Lo).
+
+2009-12-08 12:32 bvassche
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ Fixed a compiler warning about local variables that were defined
+ but
+ not used by only enabling the local variable definitions on the
+ platform that uses these variables (Linux).
+
+2009-12-08 12:26 bvassche
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Added #include "mibgroup/util_funcs.h". Fixes a compiler warning.
+
+2009-12-08 12:25 bvassche
+
+ * apps/snmpnetstat/main.c:
+
+ Include the gethostent() / sethostent() declarations before using
+ these
+ functions. Fixes a compiler warning on Windows systems.
+
+2009-12-08 12:11 bvassche
+
+ * apps/snmptrapd_handlers.c:
+
+ Fixed an inconsistency (which is allowed by the ANSI C standard)
+ between
+ function declaration and function definition of
+ netsnmp_add_global_traphandler and
+ netsnmp_add_default_traphandler such
+ that the Microsoft Visual Studio compiler does no longer complain
+ about
+ this.
+
+2009-12-08 12:08 bvassche
+
+ * snmplib/snmp_service.c:
+
+ Fixed a compiler warning: made sure that the compiler does not
+ complain about implicitly casting away constness.
+
+2009-12-08 12:07 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Only compile the winExtDLL source code if the preprocessor macro
+ USING_WINEXTDLL_MODULE has been defined.
+
+2009-12-08 12:03 bvassche
+
+ * win32/libsnmp/libsnmp.dsp:
+
+ Added missing #define HAVE_WIN32_PLATFORM_SDK.
+
+2009-12-08 12:01 bvassche
+
+ * win32/win32sdk.dsw:
+
+ Made dependencies between exe's and lib's explicit such that
+ Visual
+ Studio can figure out the proper build order instead of the user
+ having
+ to figure out the build order.
+
+2009-12-08 09:46 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Windows / Microsoft Visual Studio: disabled the compiler warning
+ about
+ signed/unsigned mismatches (4018) because this warning does not
+ yield
+ any useful information.
+
+2009-12-08 09:17 bvassche
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ Follow-up for r17639 (patch 2780411 -- fix compiler warnings):
+ applied
+ this patch to net-snmp-config.h.in too such that
+ net-snmp-config.h and
+ net-snmp-config.h.in match again.
+
+2009-12-08 08:16 bvassche
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Made sure that agentx_sysOR_callback() does not trigger a
+ compiler
+ warning when the third argument passed to this function has been
+ declared const.
+
+2009-12-08 08:14 bvassche
+
+ * include/net-snmp/library/system.h:
+
+ Changed the return type of strtoull() from 'unsigned long long'
+ (which
+ is not valid C89) to 'uint64_t' (declared in
+ <net-snmp/net-snmp-config.h>).
+ This change makes the Net-SNMP source code compile again with
+ MSVC 6.0.
+
+2009-12-07 10:46 dts12
+
+ * apps/snmptable.c:
+
+ Tweak missing subidentifier processing to be more type-aware.
+ (An issue with AIX, at least)
+
+2009-12-06 18:38 magfr
+
+ * snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ CHANGES: Make the lists of com2Sec*Entries static
+
+2009-12-06 18:34 magfr
+
+ * snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ Make the iterator variable in netsnmp_*_getSecName const
+
+2009-12-06 18:29 magfr
+
+ * agent/mibgroup/mibII/vacm_conf.c,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ CHANGES: Change the types of the return values of
+ netsnmp_*_getSecName from char* to const char* since they point
+ into internal structures.
+
+2009-12-05 20:19 tanders
+
+ * include/net-snmp/library/system.h:
+
+ fix declaration of strtoull
+
+2009-12-05 17:42 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ call netsnmp_read_module instead of read_module to make it
+ compile with
+ NETSNMP_CLEAN_NAMESPACE
+
+2009-12-02 15:39 jsafranek
+
+ * agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c:
+
+ CHANGES: snmpd: Fixed invalid access to memory in TCP-MIB
+ This partly reverts patch 17719 - the entries *are* used after
+ raw_data container is freed. These entries should be freed when
+ associated rowreq_ctx is freed.
+
+2009-12-02 08:30 jsafranek
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ CHANGES: snmpd: Fixed udpTable indexes on big-endian 64bit Linux.
+ The index was always '0.0.0.0' instead of real local IP address.
+
+2009-12-01 12:36 dts12
+
+ * include/net-snmp/types.h:
+
+ Update a redundant (and probably inaccurate) comment.
+
+2009-12-01 12:31 dts12
+
+ * agent/helpers/table.c:
+
+ CHANGES: agent: BUGS: 2822360: Fix memory leak when building
+ table OIDs
+
+2009-12-01 12:08 dts12
+
+ * apps/snmptable.c:
+
+ CHANGES: snmptable: BUGS: 2837998: Handle missing instance
+ subidentifiers in results
+
+2009-12-01 11:56 dts12
+
+ * agent/mibgroup/agentx/client.c:
+
+ CHANGES: agent: BUGS: 2841008: Protect against crash following
+ failed AgentX response
+
+2009-12-01 07:34 jsafranek
+
+ * include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpUDPDomain.c:
+
+ CHANGES: snmplib: Fix responding to broadcast requests.
+ UDP responses are sent with source IP address which was
+ destination of
+ appropriate requests (implemented in SVN rev. 15215). But if the
+ destination
+ of a request is broadcast IP address, the request was sent with
+ the broadcast
+ address as source. sendmsg() on Linux does not support this and
+ returns error
+ -> response is not sent. In order to send responses from the same
+ interface,
+ interface index of the appropriate interface must be used.
+
+2009-12-01 00:29 magfr
+
+ * agent/mibgroup/disman/schedule/schedCore.c:
+
+ Make it possible to actually compile after 17852.
+
+2009-12-01 00:24 magfr
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ Make it possible to actually compile after 17842.
+
+2009-11-30 16:55 dts12
+
+ * agent/mibgroup/disman/schedule/schedCore.c:
+
+ CHANGES: agent: BUGS: 2873858: Fix handling of schedOwner index.
+ Patch provided by Max Schubert.
+
+2009-11-30 16:46 dts12
+
+ * local/mib2c.old-api.conf:
+
+ CHANGES: mib2c: BUGS: 2888569: Fix generation of table columns
+ array
+
+2009-11-30 16:30 dts12
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ CHANGES: agent: BUGS: 2894059: Handle errors when counting
+ interfaces
+
+2009-11-30 16:07 dts12
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ CHANGES: agent: BUG: 2897000: Suppress 32-bit counter truncation
+ warnings.
+
+2009-11-30 15:34 dts12
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ CHANGES: agent: PATCH: 2903092: Fix broken handling of broadcast
+ entries.
+
+2009-11-30 15:19 dts12
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ CHANGES: agent: PATCH: 2901029: Fix compiler warning on
+ CloseHandle()
+ Endian problems already addressed by patch #2835576
+
+2009-11-30 15:13 dts12
+
+ * perl/agent/agent.xs:
+
+ CHANGES: perl: PATCH: 2890931: Better handling of Counter64
+ values.
+ Patch provided by Max Romanov.
+
+2009-11-30 15:07 dts12
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ CHANGES: agent: PATCH: 2887816: Protect against division-by-zero
+ crash
+
+2009-11-30 15:03 dts12
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ CHANGES: agent: PATCH: 2883220: Fix compilation problems when
+ ifXTable is not included.
+
+2009-11-30 14:49 dts12
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ CHANGES: agent: PATCH: 2883155: Fix memory leak in proxy
+ handling.
+ Patch supplied by Gowtham Thommandra.
+
+2009-11-30 14:32 dts12
+
+ * agent/mibgroup/ucd-snmp/proc.c, man/snmpd.conf.5.def:
+
+ CHANGES: agent: PATCH: 2883092: Support monitoring processes that
+ should not be running.
+ Patch provided by Christian (cg75).
+
+ Qn: Should this functionality be back-ported to earlier lines?
+
+2009-11-30 14:12 dts12
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: agent: PATCH: 2877518: Fix handling of scoped AgentX
+ variables
+
+2009-11-30 14:01 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ CHANGES: agent: PATCH: 2835576: Fix endianness issues in
+ pass/pass_persist
+
+2009-11-27 08:54 jsafranek
+
+ * agent/helpers/table_row.c:
+
+ Remove executable attribute from source files.
+
+2009-11-25 20:35 magfr
+
+ * agent/agent_trap.c, agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ local/mib2c.notify.conf:
+
+ CHANGES: snmpd: Make all the oids and oid lengths in agent_trap.c
+ const and use them from everywhere.
+
+2009-11-25 20:27 magfr
+
+ * snmplib/Makefile.in:
+
+ CHANGES: snmplib: Install library/oid.h. Thanks to "Tomasz Lis"
+ who spotted the bug.
+
+2009-11-25 09:47 bvassche
+
+ * include/net-snmp/agent/instance.h:
+
+ Comment-only change: changed the name in the file header from
+ testhandler.h
+ to instance.h such that it now matches the filename.
+
+2009-11-24 07:49 magfr
+
+ * agent/agent_trap.c:
+
+ Remove unnecessary cast
+
+2009-11-23 07:07 magfr
+
+ * agent/agent_trap.c, include/net-snmp/agent/agent_trap.h:
+
+ CHANGES: snmpd: Make the enterprise argument of
+ netsnmp_send_traps and send_enterprise_trap_vars const
+
+2009-11-23 07:02 magfr
+
+ * include/net-snmp/library/snmp_client.h, snmplib/snmp_client.c:
+
+ CHANGES: snmplib: Make the name argument to find_varbind_in_list
+ const
+
+2009-11-22 23:25 magfr
+
+ * agent/mibgroup/Rmon/event.c, agent/mibgroup/smux/smux.h:
+
+ Remove some local redeclarations of functions
+
+2009-11-22 01:03 magfr
+
+ * win32/config.h.borland, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: building, Win32: Remove a few unused configure symbols
+
+2009-11-21 08:01 bvassche
+
+ * win32/Snmp-winExtDLL.h, win32/snmp-winextdll.h:
+
+ Replaced an accidentally committed file by the proper contents.
+
+2009-11-20 16:29 bvassche
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ Reverted accidentally merged changes.
+
+2009-11-20 16:26 bvassche
+
+ * win32/lib, win32/net-snmp/net-snmp-config.h,
+ win32/snmp-winextdll.h:
+
+ Updated Subversion ignore list.
+
+2009-11-20 16:18 bvassche
+
+ * agent/helpers/table_iterator.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/examples/netSnmpHostsTable_access.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ipCidrRouteTable.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c,
+ local/mib2c-conf.d/mfd-interface.m2c,
+ local/mib2c.access_functions.conf,
+ local/mib2c.iterate_access.conf, snmplib/read_config.c:
+
+ Spelling fix in C source code comments: replaced 'retrival' by
+ 'retrieval'.
+
+2009-11-20 16:15 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Fixed a naming inconsistency: replaced two occurrences winExtDll
+ by winExtDLL in source code comments.
+
+2009-11-19 22:52 magfr
+
+ * agent/helpers/watcher.c, agent/mibgroup/mibII/system_mib.c,
+ include/net-snmp/agent/watcher.h:
+
+ CHANGES: snmpd: BUG: 2900078: Add support for OID variables with
+ size in elements instead of bytes, correct sysObjectID to use
+ this.
+
+2009-11-13 12:59 jsafranek
+
+ * agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/tcp.c:
+
+ CHANGES: snmpd: Fixed logging of 'truncating integer value > 32
+ bits' in IP-MIB and TCP-MIB
+ The counters, which grow fast are now cut to 32bits.
+
+2009-11-12 08:26 magfr
+
+ * agent/snmpd.c:
+
+ Use big printf's instead of many small ones to save a few hundred
+ bytes on the final executable size.
+
+2009-11-12 02:24 magfr
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in, snmplib/Makefile.in,
+ snmplib/strlcpy.c, snmplib/strtok_r.c, snmplib/strtol.c,
+ snmplib/strtoul.c, snmplib/strtoull.c:
+
+ CHANGES: building: Use AC_REPLACE_FUNCS to handle code that is
+ missing on some platforms.
+
+2009-11-11 09:00 dts12
+
+ * local/mib2c.iterate.conf, local/mib2c.table_data.conf:
+
+ Fix cache free routine to match header declaration.
+ Return success/failure values from cache load routine.
+ Problem identified by Xuan.
+
+2009-10-30 09:51 magfr
+
+ * include/net-snmp/library/asn1.h, include/net-snmp/library/oid.h,
+ include/net-snmp/types.h:
+
+ NEWS: snmplib: Revert 17808, instead factor out the declaration
+ of oid to it's own file and include that file from both types.h
+ and asn1.h
+
+2009-10-30 08:28 magfr
+
+ * agent/helpers/table.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/struct.h, agent/mibgroup/ucd-snmp/memory.c,
+ apps/snmpnetstat/if.c, configure,
+ configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in, include/net-snmp/types.h,
+ snmplib/mib.c, snmplib/oid_stash.c, snmplib/read_config.c,
+ snmplib/snmp_debug.c, snmplib/snmpusm.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmplib, snmpd, snmpnetstat: Add correct size prefixes
+ when printing variables of type oid.
+
+2009-10-30 08:07 magfr
+
+ * include/net-snmp/types.h:
+
+ CHANGES: snmplib: Change oid to be a 32-bit type on ILP64 and
+ LP64 platforms.
+
+2009-10-30 08:05 magfr
+
+ * include/net-snmp/library/asn1.h:
+
+ NEWS: snmplib: Remove the oid typedef from
+ <net-snmp/library/asn1.h>. It is still present in
+ <net-snmp/types.h>, use that file.
+
+2009-10-28 16:48 hardaker
+
+ * agent/snmp_vars.c:
+
+ don't require subagent_init() if not only building master agent
+ code
+
+2009-10-27 06:44 magfr
+
+ * local/mib2c-conf.d/generic-table-indexes-to-oid.m2i,
+ local/mib2c.access_functions.conf, local/mib2c.container.conf,
+ local/mib2c.iterate.conf, local/mib2c.iterate_access.conf,
+ local/mib2c.row.conf, local/mib2c.scalar.conf,
+ local/mib2c.table_data.conf:
+
+ CHANGES: mib2c: Remove unnecessary casts to u_char*
+
+2009-10-14 23:12 magfr
+
+ * apps/encode_keychange.c, snmplib/scapi.c:
+
+ CHANGES: apps, snmplib: PATCH: 2835577: identified by "Bart Van
+ Assche": Replace SNMP_ZERO of arrays with a memset.
+
+2009-10-12 20:28 magfr
+
+ * snmplib/parse.c:
+
+ Lessen the scope of the rp variable to the smallest possible one.
+
+2009-10-09 12:38 jsafranek
+
+ * snmplib/snmp_client.c:
+
+ CHANGES: snmplib: PATCH:2871747: plug memory leak in OID
+ processing.
+ The memory leaked when small OID, which could fit pre-allocated
+ vp->name_loc, was placed in different (allocated) one.
+
+2009-10-09 05:31 magfr
+
+ * snmplib/mib.c, snmplib/parse.c:
+
+ CHANGES: BUG: 2838243: Correct the output of unsigned values.
+ Thanks to Jack Huang of Qualcomm who pointed out this bug.
+
+2009-10-09 05:00 magfr
+
+ * snmplib/parse.c:
+
+ CHANGES: snmplib: Change the parsing of ranges to accept all
+ valid values.
+
+2009-10-07 22:24 magfr
+
+ * agent/mibgroup/examples/example.c, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: misc: PATCH: 2836112: Use the right modifier when
+ printing size_t and ssize_t variables.
+
+2009-10-07 12:50 jsafranek
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ CHANGES: snmpd: Fixed creation of views using snmpusm, OIDs with
+ indexes > 255 are allowed now.
+ This reverts SVN commit #7492.
+
+2009-10-05 19:19 magfr
+
+ * include/net-snmp/library/dir_utils.h,
+ include/net-snmp/library/file_utils.h,
+ include/net-snmp/library/text_utils.h:
+
+ CHANGES: snmplib: Correct the spelling of __cplusplus when
+ checking if the file should be wrapped in extern "C".
+
+2009-10-05 06:13 magfr
+
+ * apps/snmpwalk.c:
+
+ CHANGES: snmpwalk: Handle the case when the end oid is longer
+ than the current oid correctly
+
+2009-09-30 10:12 dts12
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ CHANGES: Solaris: Protect against missing package version
+ information crashing the agent.
+ Problem reported by Inyaven Sakarai.
+
+2009-09-27 14:59 alex_b
+
+ * win32/dist/README.build.win32.txt, win32/dist/build-binary.pl,
+ win32/dist/scripts/mandir2html:
+
+ Win32: Binary build instructions and script updates.
+
+2009-09-24 00:08 hardaker
+
+ * NEWS:
+
+ version update
+
+2009-09-23 23:54 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2009-09-23 23:42 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-09-23 23:40 hardaker
+
+ * FAQ:
+
+ remove SVN branch wording
+
+2009-09-23 23:36 hardaker
+
+ * FAQ:
+
+ proper project capitalization
+
+2009-09-23 23:35 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2009-09-23 23:30 hardaker
+
+ * man/pdu_api.3, man/session_api.3, man/varbind_api.3:
+
+ version update
+
+2009-09-22 21:51 tanders
+
+ * README.solaris:
+
+ fix typos
+
+2009-09-14 22:49 hardaker
+
+ * CHANGES:
+
+ version update
+
+2009-09-14 22:48 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2009-09-14 22:39 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-09-14 22:36 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, man/pdu_api.3, man/session_api.3,
+ man/varbind_api.3:
+
+ Version number update
+
+2009-09-14 22:18 hardaker
+
+ * README.aix, apps/snmpnetstat/if.c, include/net-snmp/system/aix.h:
+
+ Patch from magfr for 5.5 specific aix build fixes
+
+2009-09-02 07:12 jsafranek
+
+ * agent/mibgroup/smux/snmp_bgp.c, agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_rip2.c, include/net-snmp/library/mib.h:
+
+ CHANGES: snmplib: rename MIB macro to NETSNMP_MIB2_OID, MIB is
+ too generic and may conflict with applications.
+
+ The old MIB macro is kept for backward compatibility, unless
+ NETSNMP_NO_LEGACY_DEFINITIONS is defined.
+
+2009-08-31 19:38 nba
+
+ * mibs/rfclist:
+
+ Additional RFC mibs
+
+2009-08-31 19:37 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ IANA fixed a bug
+
+2009-08-29 07:29 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Remove unneeded casts.
+
+2009-08-29 07:28 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: ret is only used in settable tables so only declare it
+ then.
+
+2009-08-29 07:24 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Replace the _oid_len variable with an explicit call of
+ OID_LENGTH.
+
+2009-08-29 07:21 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Make every function that can be static static. Remove the
+ declarations of the static functions and the private defines from
+ the header.
+
+2009-08-29 07:19 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Reorder the functions in order to avoid the need for
+ forward declarations.
+
+2009-08-29 07:16 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: netsnmp_table_register should be netsnmp_register_table
+ and take only two argments.
+
+2009-08-29 07:14 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: build_oid expects a pointer to allocated oid. Change to
+ use build_oid_noalloc and remove one copy of the indices.
+
+2009-08-29 07:10 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: There is no index_oid_len member in struct entry. Use the
+ intended local variable index_oid_len.
+
+2009-08-29 07:06 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Correct the return type of ${i}_get*entry to match the
+ returned type.
+
+2009-08-26 22:37 hardaker
+
+ * ChangeLog:
+
+ whwoops; blew the changelog for rc2
+
+2009-08-26 17:38 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-08-26 17:29 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2009-08-26 17:28 hardaker
+
+ * dist/makerelease.xml:
+
+ updated based on new SF upload methods; no longer as automatable
+
+2009-08-26 17:26 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c:
+
+ CHANGES: snmpd: patch from Jan to endless loop in default routes
+ on linux
+
+2009-08-26 17:25 hardaker
+
+ * include/net-snmp/library/types.h:
+
+ apply patch from Jan to fix C++ wrapper
+
+2009-08-26 14:53 dts12
+
+ * local/Makefile.in, local/mib2c.raw-table.conf:
+
+ Initial stab at a minimal-helper (raw) table template,
+ leaving most of the work to the user-provided MIB handler.
+
+2009-08-26 14:50 dts12
+
+ * snmplib/snmp_api.c:
+
+ Protect against bogus failures (returning 0) and subsequent
+ double-frees,
+ due to 15-/31-bit masking when selecting request IDs. Identified
+ by kromesky.
+
+2009-08-20 13:30 jsafranek
+
+ * agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c:
+
+ CHANGES: snmpd: plug leaks in ipIfStatsTable,
+ ipv6ScopeZoneIndexTable, ipSystemStatsTable and
+ ipDefaultRouterTable.
+
+ It seems to me the tables were wrongly generated with
+ m2c_data_allocate or
+ someone forgot to release the user provided data.
+
+2009-08-12 15:00 tanders
+
+ * NEWS:
+
+ fix libtool version in NEWS
+
+2009-08-11 00:42 hardaker
+
+ * CHANGES, ChangeLog:
+
+ whoops; add real changelog enteries for .rc1
+
+2009-08-10 23:10 hardaker
+
+ * dist/makerelease.xml:
+
+ fix typo in svn2cl line
+
+2009-08-10 23:05 hardaker
+
+ * snmplib/Makefile.depend:
+
+ make depend
+
+2009-08-10 21:32 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-08-10 21:21 hardaker
+
+ * dist/makerelease.xml, man/pdu_api.3, man/session_api.3,
+ man/varbind_api.3:
+
+ Version number update
+
+2009-08-07 10:32 dts12
+
+ * CHANGES, NEWS:
+
+ Correct, consolidate, clarify and cleanup the catalog of current
+ changes.
+
+2009-08-06 07:57 dts12
+
+ * FAQ:
+
+ Expand on exec vs extend.
+
+2009-08-05 20:07 dts12
+
+ * agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ snmplib/file_utils.c:
+
+ CHANGES: snmpd: BUG: 2822355: Fix memory leaks on
+ udpEndpointTable (linux)
+ Patch supplied by Frank Lichtenheld
+
+2009-08-05 19:05 dts12
+
+ *
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c:
+
+ CHANGES: snmpd: PATCHES: 2822337: Fix memory leak in
+ ipAddressPrefixTable
+
+2009-08-05 15:16 jsafranek
+
+ * agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c:
+
+ Fix memory leak in NetToMediaTable.
+ When deleting row context, delete also associated data.
+
+2009-08-05 15:15 jsafranek
+
+ *
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c:
+
+ Fix memory leak in NetToMediaTable.
+ The container used to track entries to delete from cache should
+ be released when it's not needed.
+
+2009-08-05 15:12 jsafranek
+
+ *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c:
+
+ Fix memory leak in UDP- and TCP-MIB.
+ The data from raw_data are copied to cache, so it should be
+ freed.
+
+2009-08-05 10:16 dts12
+
+ * apps/snmptable.c:
+
+ CHANGES: apps: BUG: 2811577: Fix bug in GetBulk handling.
+ Don't get confused by index values that contain a ':' character.
+
+2009-08-04 21:59 dts12
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i:
+
+ CHANGES: mib2c: BUG: 2827269: Suppress non-ordered TODO comments.
+
+2009-08-04 21:35 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Handle generating code for a single table,
+ as well as a larger group.
+ Also addresses bug 2150285
+
+2009-08-04 21:16 magfr
+
+ * snmplib/strtoull.c:
+
+ snmplib: from "Bart van Assche & Magnus Fromreide": More updates
+ to strtoull.c
+
+2009-08-04 10:57 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_common.c:
+
+ CHANGES: snmpd: from "Marcus Rॆअआॆअžckert": fix possible crash when
+ 64-bit counters in ipSystemStatsTable get bigger than 2^32
+
+2009-08-03 19:27 magfr
+
+ * configure, configure.d/config_os_headers,
+ include/net-snmp/net-snmp-config.h.in, snmplib/strtoull.c:
+
+ CHANGES: snmplib: PATCH: 2827722: from "Bart Van Assche": Improve
+ strtoull to be less MSVC-specific
+
+2009-08-03 18:38 magfr
+
+ * man/Makefile.in:
+
+ remove an obsolete manual page from the set of files that should
+ be installed
+
+2009-07-27 12:41 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2009-07-27 12:11 hardaker
+
+ * man/netsnmp_Container_iterator.3:
+
+ remove an obsolete manual page
+
+2009-07-27 12:03 hardaker
+
+ * perl/SNMP/t/bulkwalk.t:
+
+ CHANGES: freebsd: patch from Cezary Morga to fix a make test on
+ freebsd
+
+2009-07-27 12:02 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-07-27 11:52 hardaker
+
+ * FAQ, NEWS, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2009-07-27 08:39 hardaker
+
+ * testing/tests/T350unix:
+
+ revert accidentially applied patch
+
+2009-07-27 08:37 hardaker
+
+ * testing/tests/T350unix, testing/tests/T360dtlsudp,
+ testing/tests/test-localhost.cert,
+ testing/tests/test-localhost.priv, testing/tests/test-user.cert,
+ testing/tests/test-user.priv:
+
+ added a test case for udp/dtls
+
+2009-07-27 08:36 hardaker
+
+ * snmplib/snmp_api.c:
+
+ don't require a session to carry a secName
+
+2009-07-26 21:34 alex_b
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Win32: MSVC 6 compile fixes for Workspace build.
+
+2009-07-26 18:20 alex_b
+
+ * README.win32, configure, configure.d/config_os_functions,
+ include/net-snmp/library/system.h,
+ include/net-snmp/net-snmp-config.h.in, snmplib/strtoull.c,
+ win32/dist/build-binary.bat, win32/dist/build-binary.pl,
+ win32/dist/installer/net-snmp.nsi, win32/libsnmp/Makefile.in,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/Makefile.in,
+ win32/libsnmp_dll/libsnmp.def.in,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ -Added strtoull function and configure check for systems without
+ it such as Win32 MSVC 6
+ -Win32: MSVC 6 compile fixes - requires new strtoull.c file
+ -Win32: New build-binary script to simplify building the Windows
+ binary package.
+
+2009-07-25 05:31 magfr
+
+ * testing/tests/T160snmpnetstat:
+
+ Make sure a message is written if the relevant table is missing.
+
+2009-07-23 21:29 alex_b
+
+ * README:
+
+ Update email address in README.
+
+2009-07-23 01:07 alex_b
+
+ * win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Win32 MSVC 2008+ fixes.
+
+2009-07-23 00:55 alex_b
+
+ * include/net-snmp/library/snmp_logging.h,
+ win32/netsnmpmibssdk/Makefile.in,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Win32 MSVC 2005+ build fixes. Thanks to Bart Van Assche.
+
+2009-07-21 12:22 dts12
+
+ * local/mib2c.container.conf, local/mib2c.iterate.conf,
+ local/mib2c.iterate_access.conf, local/mib2c.row.conf,
+ local/mib2c.table_data.conf:
+
+ Add simple debug output to mib2c templates.
+
+2009-07-21 12:13 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Fix missing semicolon typos.
+
+2009-07-21 09:15 dts12
+
+ * FAQ:
+
+ New suggested entries.
+
+2009-07-20 19:24 dts12
+
+ * FAQ:
+
+ Updates to CODING section.
+
+2009-07-20 11:09 jsafranek
+
+ * agent/mibgroup/etherlike-mib.h:
+
+ Add missing header file from patch #2053273.
+
+2009-07-19 15:09 dts12
+
+ * FAQ:
+
+ Updates to COMPILING section.
+
+2009-07-16 12:38 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ Add IPv6 octet counters.
+ New Linux kernels (e.g. 2.6.31-rc2, maybe some earlier) provide
+ counters for
+ incoming/outgoing IPv6 traffic for ipSystemStatsTable and
+ ipIfStatsTable.
+
+2009-07-15 22:46 tanders
+
+ * testing/tests/T350unix:
+
+ put temporary data to where they belong
+
+2009-07-11 21:50 tanders
+
+ * configure:
+
+ regenerate configure
+
+2009-07-11 21:04 tanders
+
+ * configure.d/config_os_libs:
+
+ build fix (e.g. for FreeBSD): adjust kvm configure tests
+
+2009-07-10 12:35 jsafranek
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Check IPv6 port ranges in the same way as IPv4 ports are checked.
+
+2009-07-10 07:46 jsafranek
+
+ *
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+ local/mib2c:
+
+ Fix another IPv4 address size - long has 8 bytes on 64bit Linux.
+ Also fix the default type fo^CASN_IPADDRESS in mib2c, so the
+ ipCidrRouteTable_interface.c can be safely regenerated.
+
+2009-07-09 23:42 hardaker
+
+ * testing/tests/T300udp, testing/tests/T310tcp,
+ testing/tests/T320udpv6, testing/tests/T330tcpv6,
+ testing/tests/T350unix:
+
+ cleanup of testing cases to remove double include and double
+ exports
+
+2009-07-09 23:07 tanders
+
+ * testing/tests/T300udp:
+
+ be consistent with the TCP/IPv4 test
+
+2009-07-09 22:18 hardaker
+
+ * testing/tests/Stransport, testing/tests/T300udp,
+ testing/tests/T310tcp, testing/tests/T320udpv6,
+ testing/tests/T330tcpv6, testing/tests/T350unix,
+ testing/tests/T399alias:
+
+ new tests for testing defined transports
+
+2009-07-09 22:17 hardaker
+
+ * testing/TESTCONF.sh, testing/eval_tools.sh:
+
+ a CONFIGAPP macro for adding stuff to snmp.conf
+
+2009-07-08 15:12 jsafranek
+
+ * snmplib/snmpUDPDomain.c:
+
+ Fix gethostbyaddr parameter, netsnmp_udp_fmtaddr never returned a
+ hostname.
+
+2009-07-07 15:46 jsafranek
+
+ * agent/mibgroup/mibII/ipCidrRouteTable_access.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ Fix IP address length on 64 bit systems in mibII, pass and
+ pass_persist modules.
+
+2009-07-07 15:24 jsafranek
+
+ * agent/mibgroup/mibII/at.c:
+
+ Use correctly sized IP addresses in address translation table
+ processing - u_long can make problems on bin endian 64 bit
+ systems
+
+2009-06-29 13:52 hardaker
+
+ * CHANGES:
+
+ remove entry for a patch that got reverted
+
+2009-06-25 15:24 dts12
+
+ * include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/library/types.h, include/net-snmp/types.h,
+ snmplib/Makefile.in:
+
+ Move non-core data types into a separate (library internals)
+ header file.
+ Move the large_fd_set data structure into this header file.
+
+2009-06-18 22:29 tanders
+
+ * agent/snmp_perl.c:
+
+ CHANGES: build: allow building with Perl versions that lack
+ PERL_EXIT_DESTRUCT_END
+
+2009-06-18 22:13 tanders
+
+ * apps/snmpnetstat/if.c:
+
+ CHANGES: build: build fix for Tru64 Unix and IRIX: move _XOPEN*
+ definitions to where they are in 5.4.x and earlier
+
+2009-06-18 06:02 magfr
+
+ * configure, configure.d/config_os_libs,
+ configure.d/config_project_with_enable,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Clean up --with-nl configuration
+ * Move the _ARG_WITH to config_project_with_enable 2009-06-16 15:17
+ rstory
+
+
+ * snmplib/container.c:
+
+ check for null pointer before deref
+
+2009-06-15 23:52 rstory
+
+ * snmplib/snmp_client.c:
+
+ add comment explaining not quite obvious lack of memmove
+
+2009-06-15 19:32 magfr
+
+ * include/net-snmp/types.h:
+
+ Remove #if 0 commented code
+
+2009-06-15 15:25 dts12
+
+ * FAQ:
+
+ Updates to AGENT section.
+
+
+
+----------------------------------------------------------------------
+
+Changes: V5.6.rc1 -> V5.6.rc2
+
+2010-09-04 01:57 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2010-09-04 00:59 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-09-03 22:14 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix tlstcp parsing of host names.
+
+2010-09-03 22:13 hardaker
+
+ * agent/mibgroup/host/data_access/swrun_procfs_status.c:
+
+ check the return code of fgets and fopen before inserting the
+ results.
+
+2010-09-03 22:12 hardaker
+
+ * snmplib/snmp_alarm.c:
+
+ Patch from tanders to fix broken alarms after the previous
+ re-entrant patch
+
+2010-09-03 22:05 hardaker
+
+ * snmplib/transports/snmpUnixDomain.c:
+
+ CHANGES: snmplib: patch 3058645: from jorisesaturnus: modified
+ version of the patch to use MSG_DONTWAIT for the unix domain
+ socket
+
+2010-09-03 21:56 hardaker
+
+ * agent/mibgroup/util_funcs/get_pid_from_inode.c:
+
+ CHANGES: snmpd: PATCH: 3058140: from takevos: check that inode is
+ non-zero
+
+2010-09-03 21:50 hardaker
+
+ * agent/mibgroup/util_funcs/get_pid_from_inode.c:
+
+ CHANGES: snmpd: PATCH: 3053428: from takevos: fix
+ get_pid_from_inode when the inode is not found.
+
+2010-09-03 20:20 hardaker
+
+ * snmplib/snmp_api.c:
+
+ remove the duplicate return before the error codes get set.
+
+2010-09-01 18:04 magfr
+
+ * agent/mibgroup/hardware/cpu/cpu.c:
+
+ CHANGES: snmpd: Log before returning.
+
+2010-09-01 02:43 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ TLS send_notify on closure and some memory clean-up patches
+
+2010-08-31 17:58 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Only print the security/context EngineID mismatch note under USM
+
+2010-08-25 15:13 rstory
+
+ * CHANGES:
+
+ remove reference to reverted patch 3042765
+
+2010-08-25 15:13 rstory
+
+ * acconfig.h:
+
+ add note on where to find content used to generate
+ net-snmp-config.h.in
+
+2010-08-25 02:45 rstory
+
+ * snmplib/snmp_client.c:
+
+ revert r19342, patch 3042765, which broke client tcp disconnect
+ handling
+
+2010-08-25 02:45 rstory
+
+ * snmplib/cert_util.c:
+
+ fix more code broken by 'compiler warning fix' in r19179
+
+2010-08-25 02:45 rstory
+
+ * testing/fulltests/tls/STlsUsers:
+
+ check for conf errors after agent startup; enable logTimestamp;
+ make sure
+ all cert name/tags are unique
+
+2010-08-24 21:04 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ fix error string to discuss the right failed openssl new
+ invocation
+
+2010-08-24 05:37 magfr
+
+ * apps/snmpusm.c:
+
+ CHANGES: snmpusm: Correct ifdefs, remove dead variables.
+
+
+----------------------------------------------------------------------
+
+Changes: V5.6.pre3 -> V5.6.rc1
+
+2010-08-19 21:11 hardaker
+
+ * agent/Makefile.depend, agent/mibgroup/Makefile.depend:
+
+ make depend
+
+2010-08-19 21:10 hardaker
+
+ * include/net-snmp/system/nto-qnx6.h:
+
+ // -> C comments
+
+2010-08-19 20:36 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-08-19 20:14 hardaker
+
+ * snmplib/snmp_client.c:
+
+ CHANGES: snmplib: PATCH 3042765: from mehaf: make
+ snmp_synch_response_cb() re-entrant
+
+2010-08-19 20:14 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ turn off cookie exchanges until a complete code set can be
+ written to support it based on the required function callbacks
+
+2010-08-17 18:31 rstory
+
+ * agent/snmpd.c:
+
+ add missing call to store persistent data as needed
+
+2010-08-17 18:31 rstory
+
+ * snmplib/mib.c:
+
+ CHANGES: snmplib: when displaying a byte as single digit hex
+ value, default to
+ prefixing with 0 unless there is a seperator or addition hint
+ data
+
+2010-08-17 10:31 bvassche
+
+ * apps/snmpusm.c:
+
+ Fixed a compiler warning about an unused label that was triggered
+ when
+ compiling without SSL support.
+
+2010-08-16 23:11 hardaker
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.h:
+
+ CHANGES: snmpd: patch 2790249: from willpwillp: reduce cache time
+ for the iftable to 3seconds to increase accuracy
+
+2010-08-16 16:26 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ CHANGES: perl: patch 3046371: from christophb4: Fix memory leak
+ in SNMPv1 trap handling.
+
+2010-08-16 16:03 hardaker
+
+ * agent/mibgroup/mibII/mta_sendmail.c:
+
+ CHANGES: snmpd: patch 2825653: from bru5ce: fix sendmail.cf
+ parsing in certain conditions
+
+2010-08-16 10:16 dts12
+
+ * man/Makefile.in:
+
+ Build netsnmp_agent_api.3 man page from template
+
+2010-08-16 09:20 dts12
+
+ * agent/agent_registry.c:
+
+ CHANGES: snmpd: PATCH: 2911361: Documentation (Provided by Tomasz
+ Lis)
+
+2010-08-16 08:06 dts12
+
+ * agent/agent_registry.c:
+
+ CHANGES: snmpd: PATCH: 2911361: Re-order code to group related
+ functions together
+
+2010-08-16 07:42 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: PATCH: 2995098: Fix creation of SNMPv3 sessions
+ with API_SINGLE
+
+2010-08-14 16:30 dts12
+
+ * agent/agent_read_config.c:
+
+ CHANGES: snmpd: PATCH: 2911361: Remove redundant variables
+
+2010-08-14 16:23 dts12
+
+ * agent/agent_handler.c:
+
+ CHANGES: snmpd: PATCH: 2904900: Documentation plus assorted
+ handler code fixes
+
+2010-08-14 09:28 dts12
+
+ * man/Makefile.in, man/netsnmp_config_api.3.def,
+ man/netsnmp_mib_api.3.def, man/netsnmp_pdu_api.3.def,
+ man/netsnmp_sess_api.3.def, man/netsnmp_session_api.3.def,
+ man/netsnmp_trap_api.3.def, man/netsnmp_varbind_api.3.def,
+ man/snmp_alarm.3.def:
+
+ Restore agent API man page
+ Don't try to extract multiple man page links per line
+ (which runs into problems with OS-specific line endings).
+ Instead, ensure the man page NAME section lists one
+ routine per line
+
+2010-08-13 23:50 hardaker
+
+ * man/Makefile.in:
+
+ fix broken Makefile after man page moves
+
+2010-08-13 23:50 hardaker
+
+ * mibs/SNMP-TLS-TM-MIB.txt, mibs/rfclist:
+
+ updated TLS MIB to current copy
+
+2010-08-13 23:50 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ replaced RFC comment number
+
+2010-08-13 23:50 hardaker
+
+ * include/net-snmp/library/snmp_alarm.h, snmplib/snmp_alarm.c:
+
+ CHANGES: snmplib: patch: 3042770: from mehaf: Made run_alarms()
+ reentrant
+
+2010-08-13 23:44 hardaker
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ CHANGES: snmpd: PATCH: 3044512: from philwebster: fix sysobjectid
+ directive.
+
+2010-08-13 19:00 rstory
+
+ * testing/fulltests/support/simple_TESTCONF.sh,
+ testing/fulltests/tls/STsmPrefix:
+
+ use 127.0.0.1 instead of localhost as default SNMP_TEST_DEST so
+ TLS tests work
+
+2010-08-13 18:50 hardaker
+
+ * include/net-snmp/session_api.h, snmplib/snmp_api.c,
+ snmplib/snmp_client.c:
+
+ CHANGES: snmplib: implemented a fix for the issue reported in
+ patch #3042770. Created a snmp_select_info_flags function, and
+ similar, that allow for alarms to not be run. This is then used
+ in the synch_response functions to avoid 100% CPU loops
+
+2010-08-13 18:50 hardaker
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h,
+ apps/snmptrapd.c:
+
+ make snmptrapd register the certtosecname table in the agentx
+ registrations
+
+2010-08-13 18:49 hardaker
+
+ * local/mib2c.conf:
+
+ minor wording additions
+
+2010-08-13 15:04 hardaker
+
+ * agent/mibgroup/hardware/cpu/cpu_perfstat.c,
+ agent/mibgroup/hardware/memory/memory_aix.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory_aix4.c,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.c:
+
+ CHANGES: aix: PATCH: 2886598: from exsnafu: Header fixes for
+ compiling on AIX6
+
+2010-08-13 15:04 hardaker
+
+ * agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c, apps/snmpnetstat/inet6.c,
+ configure, configure.d/config_os_functions,
+ configure.d/config_os_headers, configure.d/config_os_libs,
+ configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/nto-qnx6.h:
+
+ NEWS: ports: PATCH: 2836895: from seanboudreau: support for QNX6
+
+2010-08-13 14:33 dts12
+
+ * man/Makefile.in, man/netsnmp_agent_api.3.def,
+ man/netsnmp_config_api.3.def, man/netsnmp_mib_api.3.def,
+ man/netsnmp_pdu_api.3.def, man/netsnmp_sess_api.3.def,
+ man/netsnmp_session_api.3.def, man/netsnmp_trap_api.3.def,
+ man/netsnmp_varbind_api.3.def:
+
+ 'enforce netsnmp prefixes
+
+2010-08-13 14:29 dts12
+
+ * man/netsnmp_varbind_api.3.def, man/varbind_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:29 dts12
+
+ * man/netsnmp_trap_api.3.def, man/snmp_trap_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:28 dts12
+
+ * man/netsnmp_sess_api.3.def, man/snmp_sess_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:28 dts12
+
+ * man/netsnmp_agent_api.3.def, man/snmp_agent_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:28 dts12
+
+ * man/netsnmp_session_api.3.def, man/session_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:27 dts12
+
+ * man/netsnmp_pdu_api.3.def, man/pdu_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:27 dts12
+
+ * man/mib_api.3.def, man/netsnmp_mib_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:27 dts12
+
+ * man/config_api.3.def, man/netsnmp_config_api.3.def:
+
+ enforce netsnmp prefix
+
+2010-08-13 14:20 dts12
+
+ * Makefile.in, doxygen.conf:
+
+ Don't automatically generate man pages
+
+2010-08-13 14:18 dts12
+
+ * man/snmp_api_errstring.3, man/snmp_close.3, man/snmp_error.3,
+ man/snmp_free_pdu.3, man/snmp_open.3, man/snmp_perror.3,
+ man/snmp_read.3, man/snmp_select_info.3, man/snmp_send.3,
+ man/snmp_sess_async_send.3, man/snmp_sess_close.3,
+ man/snmp_sess_error.3, man/snmp_sess_init.3,
+ man/snmp_sess_open.3, man/snmp_sess_perror.3,
+ man/snmp_sess_read.3, man/snmp_sess_select_info.3,
+ man/snmp_sess_send.3, man/snmp_sess_session.3,
+ man/snmp_sess_timeout.3, man/snmp_set_mib_warnings.3,
+ man/snmp_set_save_descriptions.3, man/snmp_timeout.3:
+
+ Remove redundant man page links
+ (Should be generated automatically, but don't exist any more
+ anyway)
+
+2010-08-13 14:13 dts12
+
+ * man/Makefile.in, man/add_mibdir.3, man/add_module_replacement.3,
+ man/get_module_node.3, man/init_mib.3, man/init_mib_internals.3,
+ man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_example_scalar_int.3, man/netsnmp_handler.3,
+ man/netsnmp_instance.3, man/netsnmp_iterator_info_s.3,
+ man/netsnmp_leaf.3, man/netsnmp_library.3,
+ man/netsnmp_mib_handler_methods.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_set_data.3,
+ man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3,
+ man/netsnmp_snmp_client.3, man/netsnmp_snmp_logging.3,
+ man/netsnmp_snmp_pdu.3, man/netsnmp_snmp_session.3,
+ man/netsnmp_stash_cache.3, man/netsnmp_stash_to_next.3,
+ man/netsnmp_table.3, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_generic.3,
+ man/netsnmp_table_indexes.3, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3, man/netsnmp_table_maintenance.3,
+ man/netsnmp_table_row.3, man/netsnmp_table_rows.3,
+ man/netsnmp_tdata.3, man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3, man/print_description.3, man/print_mib.3,
+ man/print_objid.3, man/print_value.3, man/print_variable.3,
+ man/read_all_mibs.3, man/read_mib.3, man/read_module.3,
+ man/read_module_node.3, man/read_objid.3, man/shutdown_mib.3:
+
+ Remove Doxygen-generated man pages, and those linking
+ individual routines to the appropriate man page.
+ (These are better generated dynamically)
+
+2010-08-13 12:19 dts12
+
+ * local/mib2c.iterate.conf, local/mib2c.table_data.conf:
+
+ Prompt for whether to generate caching code or not.
+
+2010-08-13 12:19 dts12
+
+ * local/mib2c.conf:
+
+ Rework guidance questions when selecting the best table framework
+ to use.
+ Ensure table handling code doesn't overwrite scalar handling
+ code.
+ Check that the starting point is suitable for MfD framework.
+
+2010-08-12 15:40 rstory
+
+ * snmplib/cert_util.c:
+
+ fix code broken by 'compiler warning fix' in r19179
+
+2010-08-12 15:39 rstory
+
+ * agent/mibgroup/snmpv3mibs.h:
+
+ fix typo in comment
+
+2010-08-11 22:08 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ remove a duplicate value check
+
+2010-08-11 22:08 hardaker
+
+ * testing/fulltests/tls/STlsUsers:
+
+ add a test where we can trust a CA-signed cert and we don't trust
+ the CA
+
+2010-08-11 22:08 hardaker
+
+ * testing/fulltests/tls/STlsUsers:
+
+ test a directly mapped CA certificate
+
+2010-08-11 22:08 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ change the laConfig to read-write to match the patch
+
+2010-08-11 22:07 hardaker
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ NEWS: snmpd: PATCH: 2931446: from ahmake: make the load averages
+ writable.
+
+2010-08-11 06:43 magfr
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T020hashtests_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c:
+
+ CHANGES: Silence some compilation warnings from test cases.
+
+2010-08-09 21:09 magfr
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: Handle embedded %'s in the result message.
+
+2010-08-09 21:07 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ CHANGES: Do no double declare the index values.
+
+2010-08-05 11:49 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Update "auth*" usage message with context support
+
+2010-08-02 20:08 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntctl.c:
+
+ Fix two silly mistakes.
+
+2010-08-02 14:18 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntctl.c:
+
+ AIX filesystem types are tagged as integers, not strings.
+
+2010-08-02 13:49 tanders
+
+ * configure, configure.d/config_os_progs:
+
+ fix Perl system() configure check to work reliably on systems
+ that lack
+ Perl
+
+2010-08-02 11:08 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ CHANGES: testing: made it possible to analyze all code covered by
+ the regression tests with a dynamic analyzer, at least if that
+ analyzer supports following child processes. An example:
+
+ rm -rf /tmp/snmp-test-*
+ make -s
+ SNMP_SAVE_TMPDIR=yes DYNAMIC_ANALYZER="valgrind
+ --trace-children=yes --track-origins=yes" make -s test
+ grep -i uninitialised /tmp/snmp-test-* | xargs less
+
+2010-08-02 11:02 bvassche
+
+ * snmplib/snmp_transport.c, snmplib/transports/snmpTCPDomain.c:
+
+ Fixed the following two Valgrind complaints:
+
+ Conditional jump or move depends on uninitialised value(s)
+ at 0x6D702E0: vfprintf (in /lib64/libc-2.11.2.so)
+ by 0x6D99D11: vsnprintf (in /lib64/libc-2.11.2.so)
+ by 0x6D7A412: snprintf (in /lib64/libc-2.11.2.so)
+ by 0x6E14437: inet_ntoa (in /lib64/libc-2.11.2.so)
+ by 0x5E5E219: netsnmp_ipv4_fmtaddr (snmpIPv4BaseDomain.c:215)
+ by 0x5E65717: netsnmp_tcp_fmtaddr (snmpTCPDomain.c:70)
+ by 0x5E567EC: netsnmp_transport_peer_string
+ (snmp_transport.c:224)
+ by 0x5E2479A: _sess_process_packet (snmp_api.c:5441)
+ by 0x5E25E37: _sess_read (snmp_api.c:6037)
+ by 0x5E261DA: snmp_sess_read2 (snmp_api.c:6149)
+ by 0x5E26282: snmp_read2 (snmp_api.c:5740)
+ by 0x404DE4: main (snmpd.c:1227)
+ Uninitialised value was created by a heap allocation
+ at 0x4C270A5: malloc (vg_replace_malloc.c:236)
+ by 0x5E65739: netsnmp_tcp_accept (snmpTCPDomain.c:82)
+ by 0x5E25383: _sess_read (snmp_api.c:5786)
+ by 0x5E261DA: snmp_sess_read2 (snmp_api.c:6149)
+ by 0x5E26282: snmp_read2 (snmp_api.c:5740)
+ by 0x404DE4: main (snmpd.c:1227)
+
+ Conditional jump or move depends on uninitialised value(s)
+ at 0x6F7B2E0: vfprintf (in /lib64/libc-2.11.2.so)
+ by 0x6FA4D11: vsnprintf (in /lib64/libc-2.11.2.so)
+ by 0x6F85412: snprintf (in /lib64/libc-2.11.2.so)
+ by 0x701F437: inet_ntoa (in /lib64/libc-2.11.2.so)
+ by 0x56FA219: netsnmp_ipv4_fmtaddr (snmpIPv4BaseDomain.c:215)
+ by 0x5701717: netsnmp_tcp_fmtaddr (snmpTCPDomain.c:70)
+ by 0x56F27EC: netsnmp_transport_peer_string
+ (snmp_transport.c:224)
+ by 0x56F294F: netsnmp_transport_send (snmp_transport.c:248)
+ by 0x56BC487: snmp_sess_async_send (snmp_api.c:5204)
+ by 0x56BC651: snmp_async_send (snmp_api.c:4998)
+ by 0x56BC677: snmp_send (snmp_api.c:4984)
+ by 0x5698440: snmp_synch_response_cb (snmp_client.c:1006)
+ Uninitialised value was created by a heap allocation
+ at 0x4C270A5: malloc (vg_replace_malloc.c:236)
+ by 0x5701B3E: netsnmp_tcp_transport (snmpTCPDomain.c:163)
+ by 0x5701E6F: netsnmp_tcp_create_tstring (snmpTCPDomain.c:305)
+ by 0x56F3804: netsnmp_tdomain_transport_full
+ (snmp_transport.c:601)
+ by 0x56F3ACC: netsnmp_transport_open_client
+ (snmp_transport.c:669)
+ by 0x54344F6: subagent_open_master_session (subagent.c:758)
+ by 0x54349C8: agentx_reopen_session (subagent.c:869)
+ by 0x5434D00: subagent_startup (subagent.c:99)
+ by 0x56EAEB7: snmp_call_callbacks (callback.c:338)
+ by 0x56DE6FB: read_configs (read_config.c:1018)
+ by 0x56C287E: init_snmp (snmp_api.c:850)
+ by 0x40477B: main (snmptrapd.c:1048)
+
+2010-08-01 06:11 bvassche
+
+ * CHANGES, NEWS:
+
+ Fixed spelling errors reported by ispell -l.
+
+2010-08-01 06:00 bvassche
+
+ * snmplib/snmp_enum.c,
+ testing/fulltests/unit-tests/T004snmp_enum_clib.c:
+
+ Fixed a typo in a text string in a unit test: resturant ->
+ restaurant.
+
+2010-08-01 05:53 bvassche
+
+ * include/net-snmp/library/snmp_enum.h:
+
+ Documented behavior of se_add_pair_to_slist().
+
+2010-07-31 23:50 tanders
+
+ * include/net-snmp/system/darwin10.h:
+
+ Follow-up for r19266: add missing header file to support Mac OS X
+ 10.6
+ (Snow Leopard - "darwin10")
+
+
+
+----------------------------------------------------------------------
+
+Changes: V5.6.pre2 -> V5.6.pre3
+
+2010-07-31 20:31 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2010-07-31 20:24 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2010-07-31 20:16 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-07-31 20:11 hardaker
+
+ * dist/makerelease.xml:
+
+ changed the name of the readme section to call out NEWS-too
+
+2010-07-31 20:10 hardaker
+
+ * NEWS:
+
+ added missing news items
+
+2010-07-30 13:06 hardaker
+
+ * snmplib/snmp_client.c:
+
+ CHANGES: python: PATCH 3035328: from: sws: check the results of
+ session creation for a failure case.
+
+2010-07-30 13:00 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: patch 3035578: from sws: keep error codes up to
+ date
+
+2010-07-29 15:48 dts12
+
+ * configure:
+
+ Add support for Mac OS X 10.6 (Snow Leopard - "darwin10")
+ (On the assumption that this is the same as Mac OS X 10.5
+ (Leopard - "darwin9"))
+
+2010-07-29 15:47 dts12
+
+ * Makefile.in, configure.d/config_os_progs,
+ configure.d/config_project_perl_python:
+
+ Add support for Mac OS X 10.6 (Snow Leopard - "darwin10")
+ (On the assumption that this is the same as Mac OS X 10.5
+ (Leopard - "darwin9"))
+
+2010-07-29 15:03 dts12
+
+ * include/net-snmp/output_api.h:
+
+ Provide a definition of 'va_list' for varargs-based APIs
+
+2010-07-29 14:58 dts12
+
+ * acconfig.h, agent/auto_nlist.c, agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/fsys.h, agent/mibgroup/hardware/memory.h,
+ agent/mibgroup/host/data_access/swrun.h,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hrh_filesys.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/proc.c, configure,
+ configure.d/config_os_progs,
+ include/net-snmp/net-snmp-config.h.in, snmplib/system.c:
+
+ Add preliminary support for AIX 7
+ (on the assumption that this is identical to AIX 6)
+
+2010-07-29 14:56 dts12
+
+ * configure, configure.d/config_project_perl_python:
+
+ Disable embedded perl by default on architecures where
+ this seems to cause problems (HP-UX & Mac OS X)
+
+2010-07-29 11:13 dts12
+
+ * snmplib/read_config.c:
+
+ Guard against blank 'include*' lines.
+ Handle relative 'includeFile' paths
+
+2010-07-29 10:47 dts12
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c:
+
+ Return an indication of whether config files are actually
+ processed.
+ Report problems with failing to include config files.
+
+2010-07-28 14:44 dts12
+
+ * include/net-snmp/config_api.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/mib_api.h, include/net-snmp/output_api.h,
+ include/net-snmp/pdu_api.h, include/net-snmp/session_api.h,
+ include/net-snmp/varbind_api.h, man/config_api.3.def,
+ man/mib_api.3.def, man/session_api.3.def, man/varbind_api.3.def,
+ win32/libsnmp_dll/libsnmp.def:
+
+ Bring man page documentation, header files and Windows DLL
+ definitions
+ of top-level public API calls into line with each other.
+
+2010-07-28 14:40 dts12
+
+ * snmplib/snmp_api.c:
+
+ Fix misnamed comment
+
+2010-07-28 14:36 dts12
+
+ * agent/mibgroup/default_modules.h, configure,
+ configure.d/config_modules_agent,
+ configure.d/config_project_with_enable:
+
+ Don't mix SMIv1 and SMIv2 MIBs in the list of default MIBs to
+ load.
+ Use newer SMIv2 versions (which include suitable display hints)
+ rather than the original RFC1213 MIB (which doesn't)
+
+2010-07-28 14:10 dts12
+
+ * snmplib/read_config.c:
+
+ Fix indentation for 'includeSearch' processing code.
+
+2010-07-28 14:09 dts12
+
+ * snmplib/read_config.c:
+
+ Extend 'include' config file processing to cover three
+ different modes of working:
+ - look for the file on the config search path
+ - include the specified file by name
+ - ioad the contents of the specified directory
+ Use different config tokens to distinguish these cases.
+
+2010-07-27 11:12 hardaker
+
+ * agent/kernel.c, agent/kernel.h, agent/snmp_vars.c:
+
+ CHANGES: snmpd: patch 2912520: from listom: Free kmem references
+ on shutdown
+
+2010-07-27 10:54 hardaker
+
+ * mibs/SMUX-MIB.txt:
+
+ CHANGES: mibs: patch 2974716: from bvassche: fix issues in the
+ SMUX-MIB
+
+2010-07-27 08:54 hardaker
+
+ * configure.d/config_modules_lib:
+
+ include the new security-hedaers module
+
+2010-07-27 08:54 hardaker
+
+ * local/snmp-bridge-mib:
+
+ remote debugging/processing stderr output
+
+2010-07-27 08:54 hardaker
+
+ * local/snmp-bridge-mib:
+
+ CHANGES: snmpd: patch: 3028923: from jenso: new copy of the
+ bridge-mib perl implementation
+
+2010-07-27 08:31 hardaker
+
+ * Makefile.in, configure.d/config_modules_security_modules,
+ dist/generation-scripts/gen-security-headers.in:
+
+ separate out the security header/init generation
+
+2010-07-27 08:31 hardaker
+
+ * configure.d/config_modules_transports:
+
+ transport configure portion
+
+2010-07-27 08:30 hardaker
+
+ * Makefile.in, configure, configure.ac,
+ configure.d/config_modules_lib, dist/generation-scripts,
+ dist/generation-scripts/gen-transport-headers.in,
+ dist/generation-scripts/gen-variables.in:
+
+ move transport header generation to a separate file and create an
+ external separate script for generating it
+
+2010-07-27 08:14 jsafranek
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/mnttypes.h:
+
+ CHANGES: snmpd: report gfs filesystems in hrStorageTable and
+ hrFSTable.
+
+2010-07-24 15:42 dts12
+
+ * snmplib/read_config.c:
+
+ Don't lose track of which config file was being parsed,
+ when processing an included config file.
+ Fixes a bug with reporting later config errors.
+
+2010-07-24 15:36 dts12
+
+ * snmplib/snmp_transport.c:
+
+ Don't lose track of which config file is being parsed,
+ when opening a new SNMP session.
+ Fixes a bug with reporting later config errors.
+
+2010-07-23 03:12 hardaker
+
+ * dist/makerelease.xml:
+
+ add the TLS modules to the list of test modules
+
+2010-07-21 19:25 nba
+
+ * agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c:
+
+ Fix typo in doxygen comment
+
+2010-07-21 19:24 nba
+
+ * agent/mibgroup/if-mib/data_access/interface_sysctl.c:
+
+ Fix typo in speed computation
+
+2010-07-21 19:21 nba
+
+ * snmplib/snmp_secmod.c:
+
+ Include generated security-includes.h
+
+2010-07-21 19:20 nba
+
+ * include/net-snmp/library/snmpksm.h,
+ include/net-snmp/library/snmptsm.h:
+
+ Fix init func name (copy-paste glitch)
+
+2010-07-21 19:18 nba
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ Remove superfluous semicolon
+
+2010-07-21 19:18 nba
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ Out of order declaration
+
+2010-07-21 19:17 nba
+
+ * snmplib/snmp_logging.c:
+
+ Log error on file open error
+
+2010-07-21 19:16 nba
+
+ * configure.d/config_modules_lib:
+
+ Speling error
+
+2010-07-21 18:10 nba
+
+ * mibs/ianalist, mibs/rfclist, mibs/rfcmibs.diff:
+
+ Update for current RFCs
+
+2010-07-21 18:08 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ Current version from IANA
+
+2010-07-21 18:05 nba
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ r17495 erroneously disabled diskIOLAx for linux
+
+2010-07-20 10:38 jsafranek
+
+ * snmplib/system.c:
+
+ CHANGES: snmplib: fixed potential buffer overflow when generating
+ temp. file names
+
+2010-07-20 07:32 jsafranek
+
+ * agent/snmpd.c, apps/agentxtrap.c, apps/snmptranslate.c,
+ apps/snmptrapd.c, man/snmpcmd.1.def, man/snmptranslate.1.def,
+ man/snmptrapd.8.def, snmplib/snmp_parse_args.c:
+
+ Describe -D usage as -D[TOKEN] instead of -D [TOKEN]
+
+2010-07-17 15:10 rstory
+
+ * mibs/SNMP-TLS-TM-MIB.txt:
+
+ update display hint to some less ambiguous (and that works with
+ our lib)
+
+2010-07-17 04:13 rstory
+
+ * testing/Makefile.in:
+
+ fix testsimple for builddir!=srcdir
+
+2010-07-17 04:12 rstory
+
+ * testing/Makefile.in:
+
+ add testsimple target
+
+2010-07-16 19:21 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ release iterator when done with it
+
+2010-07-15 18:28 hardaker
+
+ * snmplib/snmpusm.c:
+
+ CHANGES: snmplib: fix issue with USM using inactive users
+
+2010-07-15 01:35 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c:
+
+ don't use strndup (portability)
+
+2010-07-15 01:35 rstory
+
+ * snmplib/cert_util.c:
+
+ include appropriate string header; define NAME_MAX if not already
+ defined;
+ don't use strndup (portability)
+
+2010-07-15 01:35 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ check that some newer openssl macros are defined before using
+ them; include
+ appropriate string header
+
+2010-07-15 01:35 rstory
+
+ * configure, configure.d/config_os_libs,
+ include/net-snmp/net-snmp-config.h.in:
+
+ check for dtls support in openssl
+
+2010-07-15 01:34 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ don't compile dtls domain if no dtls support in openssl
+
+2010-07-15 01:34 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ ifdef protection for later sha algorithms
+
+2010-07-15 01:34 rstory
+
+ * include/net-snmp/system/darwin.h,
+ include/net-snmp/system/darwin7.h,
+ include/net-snmp/system/darwin8.h,
+ include/net-snmp/system/darwin9.h:
+
+ darwin openssl does not support more recent sha algorithms
+
+2010-07-15 01:33 rstory
+
+ * agent/mibgroup/target/target.c:
+
+ fix typo in ifdef test
+
+2010-07-15 01:33 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ fix cut-n-paste error in included file name
+
+2010-07-14 15:08 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c:
+
+ fix the fix: put PRIz spec in correct place
+
+2010-07-14 15:03 rstory
+
+ * testing/fulltests/tls/STlsUsers:
+
+ specify SNMP version on commandline
+
+2010-07-14 15:03 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ quiet compiler
+
+2010-07-14 15:02 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ quiet compiler warnings
+
+2010-07-13 20:03 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+ apps/snmptls.c, include/net-snmp/library/cert_util.h:
+
+ include ssl.h before cert_util.h
+
+2010-07-13 20:03 rstory
+
+ * snmplib/cert_util.c:
+
+ add debug output for found cert
+
+2010-07-13 16:24 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix typo in log msg
+
+2010-07-12 10:26 bvassche
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ CHANGES: Win32 and Cygwin: made sure that accessing the mibII
+ interfaces table does not trigger out-of-range array accesses
+ (was detected by BoundsChecker).
+
+2010-07-12 10:21 bvassche
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Fixed a dangling-pointer-read that was introduced in r19018. In
+ r19018 the type of groupSubtreeLen was changed from int to
+ size_t, which changed the behavior of the loop "while
+ (groupSubtreeLen-- > 0) ...": instead of not executing the loop
+ body when groupSubtreeLen was negative, r19018 caused the body of
+ that loop to be executed. Detected by running snmpd under
+ BoundsChecker while performing a MIB walk.
+
+2010-07-12 10:12 bvassche
+
+ * agent/mibgroup/mibII/at.c:
+
+ Reverted r19047 (which was wrong) and implemented a proper fix
+ for the compiler warnings about signed/unsigned mismatches.
+
+2010-07-12 10:09 bvassche
+
+ * agent/snmp_agent.c:
+
+ Removed an obsolete comment.
+
+2010-07-12 10:08 bvassche
+
+ * agent/helpers/table_container.c, win32/mib_module_includes.h:
+
+ Suppressed more MSVC compiler warnings.
+
+2010-07-12 04:45 rstory
+
+ * testing/fulltests/tls/STlsVars:
+
+ add comment with object name for numeric ids
+
+2010-07-12 04:45 rstory
+
+ * agent/mibgroup/target/target.c,
+ include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ new function to get serverId from snmpTlstmAddrTable data; use
+ new api
+ to config serviceId for trap transport when sending traps
+
+2010-07-11 11:18 bvassche
+
+ * configure, configure.d/config_os_functions:
+
+ CHANGES: BUG: 3027900: when cross-compiling it is now assumed
+ that memcmp() is available instead of assuming that it is not
+ available.
+
+2010-07-11 10:30 bvassche
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Fixed compiler warnings triggered by r19197.
+
+2010-07-10 20:00 rstory
+
+ * testing/RUNFULLTESTS:
+
+ sync up help output and options processing
+
+2010-07-09 15:13 bvassche
+
+ * README.win32:
+
+ Updated Cygwin section in README.win32.
+
+2010-07-09 15:13 bvassche
+
+ * agent/helpers/instance.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ CHANGES: Win32: Suppressed "implicit cast from int to u_char"
+ warnings generated by MSVC.
+
+2010-07-09 15:11 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ Testing: made the debug output that appears in the "invoked" file
+ even more verbose.
+
+2010-07-09 15:10 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32 MSVC build fixes.
+
+2010-07-08 19:30 marz
+
+ * local/certgen-test.pl, local/net-snmp-cert,
+ local/net-snmp-cert.conf:
+
+ adds per identity configuration file support so defaults can be
+ customised on cmdline w -i <identity> - see net-snmp-cert.conf
+ for examples and some help info
+
+2010-07-08 12:17 dts12
+
+ * agent/agent_read_config.c:
+
+ CHANGES: snmpd: BUG: 3003981: Protect against buffer overflow
+
+2010-07-08 11:19 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ CHANGES: snmpd: BUG: 3019243: Register execFix compatability
+ directive correctly.
+
+2010-07-07 10:19 bvassche
+
+ * testing/fulltests/default/T110agentxget_simple,
+ testing/fulltests/default/T111agentxset_simple,
+ testing/fulltests/default/T112agentxsetfail_simple,
+ testing/fulltests/default/T120proxyget_simple,
+ testing/fulltests/default/T121proxyset_simple,
+ testing/fulltests/default/T122proxysetfail_simple:
+
+ CHANGES: Cygwin and MinGW: tests T110, T111, T112, T120, T121 and
+ T122 do now pass when snmpd is built with winExtDLL support
+ enabled.
+
+2010-07-06 18:59 bvassche
+
+ * ChangeLog, agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ local/mib2c-conf.d/mfd-persistence.m2i,
+ testing/fulltests/support/simple_eval_tools.sh:
+
+ Made regression tests easier to debug by including ok / not ok
+ status in the "invoked" file.
+ Spelling fixes: remeber -> remember; seperator -> separator.
+
+2010-07-06 15:04 bvassche
+
+ * testing/fulltests/default/T065agentextend_simple,
+ testing/fulltests/support/simple_TESTCONF.sh:
+
+ Test T065 does now really pass on MinGW.
+
+2010-07-05 10:01 bvassche
+
+ * testing/Makefile.in:
+
+ Added curly braces such that '||' and '&&' are evaluated in the
+ correct order.
+
+2010-07-04 11:37 bvassche
+
+ * apps:
+
+ Updated Subversion ignore list.
+
+2010-07-04 11:34 bvassche
+
+ * testing/Makefile.in:
+
+ Fall back from RUNFULLTESTS to RUNTESTS if neither TAP::Harness
+ nor Test::Harness is available.
+
+2010-07-04 11:21 bvassche
+
+ * testing/fulltests/support/simple_run:
+
+ Made sure that the test number in /tmp/snmp-tests-$testnum is set
+ to something more meaningful than just "0".
+
+2010-07-04 11:20 bvassche
+
+ * testing/RUNTESTS:
+
+ Split a long comment line.
+
+2010-07-04 10:52 bvassche
+
+ * testing/RUNTESTS:
+
+ Bug fix: made sure that srcdir is computed correctly if `dirname
+ $0` = .
+
+2010-07-02 16:27 bvassche
+
+ * apps/Makefile.in, configure, configure.d/config_os_libs:
+
+ Simplified r19181 (Fixed TLSTCP-enabled build for platforms with
+ non-empty $(EXEEXT), i.e. Cygwin and MinGW).
+
+2010-07-01 18:15 bvassche
+
+ * apps/Makefile.in, configure, configure.d/config_os_libs:
+
+ Fixed TLSTCP-enabled build for platforms with non-empty
+ $(EXEEXT), i.e. Cygwin and MinGW.
+
+2010-07-01 18:11 bvassche
+
+ * apps/snmptls.c:
+
+ Fixed yet another recently introduced compiler warning.
+
+2010-07-01 17:53 bvassche
+
+ * snmplib/cert_util.c:
+
+ Fixed two recently introduced compiler warnings.
+
+2010-07-01 00:19 hardaker
+
+ * CHANGES, NEWS:
+
+ version update
+
+2010-07-01 00:13 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2010-07-01 00:03 hardaker
+
+ * agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ snmplib/Makefile.depend:
+
+ make depend
+
+2010-06-30 23:55 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+----------------------------------------------------------------------
+
+Changes: V5.6.pre1 -> V5.6.pre2
+
+2010-06-30 23:55 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2010-06-30 23:48 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, python/netsnmp/tests/snmpd.conf:
+
+ Version number update
+
+2010-06-30 23:45 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ missed two tokens in the man pgaes
+
+2010-06-30 23:45 hardaker
+
+ * man/snmpcmd.1.def, man/snmpd.8.def,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/tls/SCipherTests, testing/fulltests/tls/SCrl,
+ testing/fulltests/tls/STlsAgentTrap,
+ testing/fulltests/tls/STlsServer,
+ testing/fulltests/tls/STlsServerSession,
+ testing/fulltests/tls/STlsTrapdUser,
+ testing/fulltests/tls/STlsUsers,
+ testing/fulltests/tls/STsmPrefix,
+ testing/fulltests/transports/Stlstests:
+
+ rename the defX509 tokens to something more friendly: clientCert
+ and serverCert
+
+2010-06-30 23:44 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ top-file comment updates
+
+2010-06-30 23:44 hardaker
+
+ * snmplib/cert_util.c:
+
+ don't call cert_find with a NULL argument
+
+2010-06-30 23:44 hardaker
+
+ * snmplib/cert_util.c:
+
+ allow def certs to be specified using a filename
+
+2010-06-30 23:41 tanders
+
+ * testing/fulltests/support/simple_run:
+
+ fix syntax error
+
+2010-06-30 23:01 hardaker
+
+ * snmplib/cert_util.c:
+
+ turn a couple of non-critical errors into debug statements per
+ discussion with rstory
+
+2010-06-30 23:00 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ make the regexp pattern match for tests to run case insensitive
+
+2010-06-30 23:00 hardaker
+
+ * python/netsnmp/client.py:
+
+ import stderr from sys, per discussion on -users
+
+2010-06-30 22:17 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ add back in the default port specifier
+
+2010-06-30 22:17 hardaker
+
+ * local/net-snmp-cert:
+
+ enable pulling the private key over http
+
+2010-06-30 22:17 hardaker
+
+ * local/net-snmp-cert:
+
+ move URL collection into a sub function
+
+2010-06-30 22:16 hardaker
+
+ * local/net-snmp-cert:
+
+ added ability to pull a cert from a URL
+
+2010-06-30 22:16 hardaker
+
+ * local/net-snmp-cert:
+
+ fix argument bug in the is_url function
+
+2010-06-30 20:49 hardaker
+
+ * apps/snmptls.c:
+
+ remove debugging code
+
+2010-06-30 20:27 hardaker
+
+ * testing/fulltests/tls/T117DtlsCNSession_simple,
+ testing/fulltests/tls/T117dtlsCNSession_simple:
+
+ rename file for consistency
+
+2010-06-30 20:01 rstory
+
+ * configure:
+
+ update for new snmptls app
+
+2010-06-30 20:00 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ remove accidentally checked int debug code
+
+2010-06-30 19:59 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h:
+
+ define OIDs based on SNMP_TLS_TM_BASE
+
+2010-06-30 19:59 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c:
+
+ auto-transistion between notReady/notInService
+
+2010-06-30 19:57 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h:
+
+ auto-transistion between notReady/notInService; add
+ snmp_store_needed on commit
+
+2010-06-30 19:56 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ use new fingerprint parse/build functions; remove bad length
+ check; auto
+ transition between notReady and notInService
+
+2010-06-30 19:55 rstory
+
+ * mibs/TLSTM-MIB.txt:
+
+ remove pre-rfc mib; see SNMP-TLS-TM-MIB.txt instead
+
+2010-06-30 19:54 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c:
+
+ consolidate multiple files
+
+2010-06-30 19:53 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ make hash type parse routine public; add routines to build/parse
+ SnmpTLSFingerprint
+
+2010-06-30 19:51 rstory
+
+ * Makefile.in, apps/Makefile.in, apps/snmptls.c,
+ configure.d/config_os_libs:
+
+ NEWS: snmptls: new app for managing (D)TLS config via
+ SNMP-TLS-TM-MIB tables
+
+2010-06-30 19:50 rstory
+
+ * agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/expression/expExpressionTable.c,
+ agent/mibgroup/disman/expression/expObjectTable.c,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c:
+
+ call new snmp_store_needed() function after a commit in tables
+ that
+ have persistent store
+
+2010-06-30 19:49 rstory
+
+ * include/net-snmp/library/snmp_client.h, snmplib/snmp_client.c:
+
+ NEWS: snmplib: new experimental simple state machine
+ NEWS: snmplib: new experimental row creation API which uses a
+ state machine
+ to try really hard to create a row from a given varbind list
+
+2010-06-30 19:48 rstory
+
+ * agent/snmp_agent.c, include/net-snmp/library/snmp_api.h,
+ snmplib/snmp_api.c:
+
+ NEWS: snmpd: new API for indicating that persistent store needs
+ to be saved after the current request finishes processing
+
+2010-06-30 19:46 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ add some new wrapper macros
+
+2010-06-30 15:59 hardaker
+
+ * testing/fulltests/tls/STlsCNSession,
+ testing/fulltests/tls/STlsSanSession,
+ testing/fulltests/tls/STlsServerSession,
+ testing/fulltests/tls/T115DtlsSanSession_simple,
+ testing/fulltests/tls/T116TlsSanSession_simple,
+ testing/fulltests/tls/T117dtlsCNSession_simple,
+ testing/fulltests/tls/T118TlsCNSession_simple:
+
+ added checks for checking direct passing of localhost to the
+ expected name
+
+2010-06-30 15:59 hardaker
+
+ * testing/fulltests/tls/STlsServer:
+
+ check for wildcard support
+
+2010-06-30 15:58 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ support SAN and CN wildcard matching per spec
+
+2010-06-30 15:00 hardaker
+
+ * testing/fulltests/tls/SCipherTests, testing/fulltests/tls/SCrl,
+ testing/fulltests/tls/STlsAgentTrap,
+ testing/fulltests/tls/STlsName, testing/fulltests/tls/STlsSan,
+ testing/fulltests/tls/STlsServer,
+ testing/fulltests/tls/STlsTrapdUser,
+ testing/fulltests/tls/STlsUsers, testing/fulltests/tls/STlsVars,
+ testing/fulltests/tls/STsmPrefix,
+ testing/fulltests/tls/ScipherTests,
+ testing/fulltests/tls/Scrltests,
+ testing/fulltests/tls/Stlsagenttraptests,
+ testing/fulltests/tls/Stlsnametests,
+ testing/fulltests/tls/Stlssantests,
+ testing/fulltests/tls/Stlsservertests,
+ testing/fulltests/tls/Stlstrapdusertests,
+ testing/fulltests/tls/Stlsuserstests,
+ testing/fulltests/tls/Stlsvars, testing/fulltests/tls/Stsmprefix,
+ testing/fulltests/tls/T101DtlsUser_simple,
+ testing/fulltests/tls/T101dtlsudpusertests_simple,
+ testing/fulltests/tls/T102TlsUser_simple,
+ testing/fulltests/tls/T102tlstcpusertests_simple,
+ testing/fulltests/tls/T111DtlsServer_simple,
+ testing/fulltests/tls/T111dtlsudpservertests_simple,
+ testing/fulltests/tls/T112TlsServer_simple,
+ testing/fulltests/tls/T112tlstcpservertests_simple,
+ testing/fulltests/tls/T113DtlsSan_simple,
+ testing/fulltests/tls/T113dtlsudpsan_simple,
+ testing/fulltests/tls/T114TlsSan_simple,
+ testing/fulltests/tls/T114tlstcpsan_simple,
+ testing/fulltests/tls/T121DtlsTrap_simple,
+ testing/fulltests/tls/T121dtlsudptraptests_simple,
+ testing/fulltests/tls/T122TlsTrap_simple,
+ testing/fulltests/tls/T122tlstcptraptests_simple,
+ testing/fulltests/tls/T131DtlsAgentTrap_simple,
+ testing/fulltests/tls/T131dtlsudpagenttraptests_simple,
+ testing/fulltests/tls/T132TlsAgentTrap_simple,
+ testing/fulltests/tls/T132tlstcpagenttraptests_simple,
+ testing/fulltests/tls/T141DtlsCrl_simple,
+ testing/fulltests/tls/T141dtlsudpcrl_simple,
+ testing/fulltests/tls/T142TlsCrl_simple,
+ testing/fulltests/tls/T142tlstcpcrl_simple,
+ testing/fulltests/tls/T151DtlsCiphers_simple,
+ testing/fulltests/tls/T151dtlsciphers_simple,
+ testing/fulltests/tls/T152TlsCiphers_simple,
+ testing/fulltests/tls/T152tlsciphers_simple,
+ testing/fulltests/tls/T200TlsIpv6_simple,
+ testing/fulltests/tls/T200tlsipv6_simple,
+ testing/fulltests/tls/T300TlsPerl.t,
+ testing/fulltests/tls/T300tlstcpperl.t,
+ testing/fulltests/tls/T301DtlsPerl.t,
+ testing/fulltests/tls/T301dtlsperl.t,
+ testing/fulltests/tls/T401DtlsTsmPrefix_simple,
+ testing/fulltests/tls/T401dtlstsmprefix_simple,
+ testing/fulltests/tls/T402TlsTsmPrefix_simple,
+ testing/fulltests/tls/T402tlstsmprefix_simple:
+
+ moved test files around for better naming
+
+2010-06-30 14:58 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ copy dtls transport address to the expected hostname
+
+2010-06-30 14:58 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ set the expected hostname from the transport string if possible
+
+2010-06-30 14:58 hardaker
+
+ * local/net-snmp-cert:
+
+ a bit more help output by default
+
+2010-06-29 22:29 tanders
+
+ * apps/snmptrapd_auth.c:
+
+ Follow-up for r19116: make sure we include agent config
+
+2010-06-29 22:18 magfr
+
+ * agent/mibgroup/host/hr_print.h,
+ agent/mibgroup/if-mib/data_access/interface.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.h,
+ agent/mibgroup/ucd-snmp/extensible.h:
+
+ Add missing config_requires
+
+2010-06-29 17:33 hardaker
+
+ * man/snmpcmd.1.def:
+
+ rework the snmpcmd manual page to separate out the flags into
+ sections appropriate for their usage type
+
+2010-06-29 16:51 marz
+
+ * local/net-snmp-cert:
+
+ pod docs, some default val fixes, info output normalized
+
+2010-06-29 16:32 hardaker
+
+ * agent/mibgroup/target/target.c:
+
+ added ssh.h include
+
+2010-06-29 16:27 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ reorganize the manual page a bit for SNMPv3 and TLS
+
+2010-06-29 16:27 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix default tls registrations
+
+2010-06-29 16:26 hardaker
+
+ * agent/snmp_agent.c:
+
+ check for NULL transports after an open fails
+
+2010-06-29 16:26 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ moving logging around so that openssl errors are printed on
+ failures
+
+2010-06-29 16:26 hardaker
+
+ * testing/fulltests/tls/Scrltests,
+ testing/fulltests/tls/Stsmprefix:
+
+ fix some non-interactive invocation issues
+
+2010-06-29 16:26 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ move some common code into a common function
+
+2010-06-28 19:13 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/tls/ScipherTests,
+ testing/fulltests/tls/T151dtlsciphers_simple,
+ testing/fulltests/tls/T152tlsciphers_simple:
+
+ cipher suite selection and tests for it
+
+2010-06-28 19:12 hardaker
+
+ * python/LICENSE:
+
+ license updates
+
+2010-06-28 19:12 hardaker
+
+ * python/README, python/netsnmp/client.py,
+ python/netsnmp/client_intf.c:
+
+ SNMPv3 over TLS support
+
+2010-06-28 19:12 hardaker
+
+ * python/netsnmp/tests/test.py:
+
+ better output showing test types
+
+2010-06-28 00:54 tanders
+
+ * man/mib_api.3.def, man/netsnmp_agent.3, man/netsnmp_container.3,
+ man/netsnmp_example_scalar_int.3, man/netsnmp_handler.3,
+ man/netsnmp_library.3, man/netsnmp_mib_utilities.3,
+ man/netsnmp_table.3, man/snmpcmd.1.def, man/snmptrapd.conf.5.def:
+
+ CHANGES: man: clean up manual pages
+ (from Debian patch 56_manpage)
+
+2010-06-27 23:29 tanders
+
+ * apps/snmptrapd.c, apps/snmptrapd_auth.c:
+
+ CHANGES: build: Do not call vacm_standard_views() or
+ init_vacm_config_tokens() if the corresponding module was not
+ compiled
+ (from Debian patch 61_vacm_missing_dependency_check)
+
+2010-06-27 03:23 marz
+
+ * local/net-snmp-cert:
+
+ fix app tag completions
+
+2010-06-27 00:56 marz
+
+ * local/net-snmp-cert, local/net-snmp-cert.conf:
+
+ handle config file setting interactive, true/false values handled
+ in config
+
+2010-06-26 20:58 marz
+
+ * local/net-snmp-cert:
+
+ fix some bugs w/ spaces in names and app tag help
+
+2010-06-26 19:38 marz
+
+ * testing/fulltests/tls/S300tlsperl.pl,
+ testing/fulltests/tls/Stlsvars,
+ testing/fulltests/transports/Stlstests:
+
+ fix tests to use non-interactive -I
+
+2010-06-26 17:46 marz
+
+ * local/certgen-test.pl, local/net-snmp-cert:
+
+ better interactive, ?=help, <tab> compl, more help, SAN loop
+ format and termination fix, tolerate spaces in fields and
+ filenames, more complete error output, embryonic import from url
+
+2010-06-26 13:48 bvassche
+
+ * snmplib/snmp_transport.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ More compiler warning fixes.
+
+2010-06-26 13:47 bvassche
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Fixed the errors in acconfig.h and regenerated
+ net-snmp-config.h.in.
+
+2010-06-26 13:44 bvassche
+
+ * agent/mibgroup/smux/smux.c:
+
+ Fixed compiler warnings triggered by SMUX MIB implementation.
+
+2010-06-26 00:45 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/tls/Stlssantests,
+ testing/fulltests/tls/T113dtlsudpsan_simple,
+ testing/fulltests/tls/T114tlstcpsan_simple:
+
+ fixes and testing for checking SAN DNS names from the server
+
+2010-06-26 00:44 hardaker
+
+ * testing/fulltests/tls/Stlsnametests,
+ testing/fulltests/tls/Stlsservertests,
+ testing/fulltests/tls/T111dtlsudpservertests_simple,
+ testing/fulltests/tls/T112tlstcpservertests_simple:
+
+ genericize the server name tests
+
+2010-06-25 23:01 hardaker
+
+ * agent/mibgroup/tsm-mib.h,
+ agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.c,
+ agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.h,
+ snmplib/snmptsm.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ testing/fulltests/tls/Scrltests,
+ testing/fulltests/tls/Stsmprefix,
+ testing/fulltests/tls/T401dtlstsmprefix_simple,
+ testing/fulltests/tls/T402tlstsmprefix_simple:
+
+ useprefix scalar testing and support
+
+2010-06-25 23:01 hardaker
+
+ * testing/fulltests/tls/Scrltests:
+
+ remove debugging lines
+
+2010-06-25 23:00 hardaker
+
+ * testing/fulltests/tls/Scrltests:
+
+ put in only minimial debug flags
+
+2010-06-25 23:00 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/cert_util.c, snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/tls/Scrltests,
+ testing/fulltests/tls/T141dtlsudpcrl_simple,
+ testing/fulltests/tls/T142tlstcpcrl_simple:
+
+ code and test cases for CRL handling
+
+2010-06-25 15:24 bvassche
+
+ * testing/fulltests/default/T060trapdperl_simple:
+
+ Added a newline at the end of each line printed by the Perl
+ interpreter.
+
+2010-06-25 13:08 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ reduce number of resend attempts and timeout
+
+2010-06-25 13:08 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h, snmplib/cert_util.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ warning fixes
+
+2010-06-25 13:08 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ remove logic typo from previous commit
+
+2010-06-25 13:08 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ testing/fulltests/tls/T200tlsipv6_simple:
+
+ IPv6 fixes for TCP
+
+2010-06-25 13:01 jsafranek
+
+ * snmplib/snmp_api.c:
+
+ Reverting 19095, it breaks tests
+
+2010-06-25 09:40 jsafranek
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmptranslate: fixed printing of ranges with UNSIGNED
+ type.
+
+2010-06-24 23:55 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix function names for stat increases
+
+2010-06-24 23:52 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ fix errors in comments
+
+2010-06-24 23:44 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ comments for 5.4 for dtls
+
+2010-06-24 23:44 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ comments for 5.3.2
+
+2010-06-24 23:43 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ client side connect comments
+
+2010-06-24 23:43 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ counter and comment improvements
+
+2010-06-24 23:43 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ update counter calls and comment text
+
+2010-06-24 19:03 bvassche
+
+ * testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T115agentxperl_simple,
+ testing/fulltests/support/simple_TESTCONF.sh:
+
+ Moved LD_LIBRARY_PATH setup from individual tests scripts to
+ simple_TESTCONF.sh.
+
+2010-06-24 19:02 bvassche
+
+ * testing/fulltests/support/simple_run:
+
+ Fixed a comment.
+
+2010-06-24 17:48 bvassche
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h:
+
+ Should have been included in r19084.
+
+2010-06-24 17:47 bvassche
+
+ * snmplib/cert_util.c, snmplib/snmp_transport.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ Fixed several recently introduced compiler warnings.
+
+2010-06-24 12:30 tanders
+
+ * configure, configure.d/config_os_progs:
+
+ "test -e" isn't portable; use "test -x" instead for the Perl
+ system()
+ check
+
+2010-06-23 11:14 jsafranek
+
+ * agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c:
+
+ CHANGES: snmpd: fixed value of IP-MIB::ipv6InterfaceForwarding on
+ Linux
+
+ The value was 0 (not forwarding) or 1 (forwarding), should be 2
+ and 1
+ instead - netsnmp_interface_entry.forwarding_v6 is boolean, not
+ TruthValue.
+
+2010-06-22 23:06 hardaker
+
+ * snmplib/cert_util.c, testing/fulltests/tls/Stlsuserstests:
+
+ support for certSecName mapping from a local cert file name and a
+ test for it
+
+2010-06-22 22:44 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ documenation update to clean up and include TLS parameters
+
+2010-06-22 22:44 hardaker
+
+ * perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs:
+
+ support for passing identities and full working version
+
+2010-06-22 22:44 hardaker
+
+ * testing/fulltests/tls/S300tlsperl.pl,
+ testing/fulltests/tls/T300tlstcpperl.t,
+ testing/fulltests/tls/T301dtlsperl.t:
+
+ perl TLS/DTLS tests
+
+2010-06-22 22:43 hardaker
+
+ * perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs:
+
+ first ptach on SNMP/TLS creating a new session function
+
+2010-06-22 22:43 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ first working support for a delayed close() to attempt to sending
+ outstanding packets in the queue; this is required for snmptrap
+ to work at all when sending traps (not informs) over DTLS
+
+2010-06-22 19:03 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_simple,
+ testing/fulltests/default/T065agentextend_simple,
+ testing/fulltests/support/simple_TESTCONF.sh:
+
+ CHANGES: MinGW: tests T059 and T065 do now pass.
+
+2010-06-22 19:01 bvassche
+
+ * apps/snmpnetstat/inet6.c:
+
+ The width argument for %.*d must have type int, not size_t. This
+ bug was introduced in r19014.
+
+2010-06-22 18:57 bvassche
+
+ * agent/mibgroup/utilities/execute.c:
+
+ CHANGES: MinGW: run_shell_command() with either input or output
+ (but not both) does now work.
+ This did not work until now because on MinGW mkstemp() generates
+ a MinGW-style path (/tmp/...) while system() invokes cmd.exe and
+ hence expects a Windows-style path (C:\...).
+
+2010-06-22 17:39 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ Also report the port specification if [ $SNMP_VERBOSE -gt 0 ].
+
+2010-06-22 17:38 bvassche
+
+ * testing/fulltests/default/T053agentv1trap_simple,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T100agenthup_simple,
+ testing/fulltests/default/T115agentxperl_simple:
+
+ Replaced an explicit test for MinGW by a test on HAVE_SIGHUP.
+
+2010-06-22 17:36 bvassche
+
+ * configure, configure.d/config_os_misc4,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Added configure test for SIGHUP.
+
+2010-06-22 17:35 bvassche
+
+ * testing/RUNTESTS:
+
+ Report which tests failed, if any.
+
+2010-06-22 08:37 bvassche
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Fixed an error in a comment block.
+
+2010-06-21 19:26 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_simple:
+
+ Rearranged the implementation of this test such that it is no
+ longer necessary
+ to invoke simple_eval_tools.sh when this script is invoked as a
+ trap handler
+ by snmptrapd.
+
+2010-06-21 08:01 dts12
+
+ * snmplib/large_fd_set.c:
+
+ Ensure that fdset structure is resized sufficiently
+ to accomodate the specified socket ID.
+ Problem reported by Shiyalei.
+
+2010-06-20 19:32 dts12
+
+ * snmplib/cert_util.c, snmplib/cmu_compat.c, snmplib/pkcs.c,
+ snmplib/snprintf.c:
+
+ Avoid duplicate (unused) symbols.
+
+2010-06-20 19:31 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_simple:
+
+ Commented out debug code.
+
+2010-06-20 19:30 bvassche
+
+ * testing/RUNTESTS, testing/fulltests/support/simple_run:
+
+ Restored summary success/failure count reporting.
+ Also, moved kill.exe test back to RUNTESTS.
+
+2010-06-20 19:29 bvassche
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ CHANGES: testing: add the test name to the start of the file
+ "invoked".
+
+2010-06-20 19:27 bvassche
+
+ * testing/fulltests/default/T053agentv1trap_simple,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T100agenthup_simple,
+ testing/fulltests/default/T115agentxperl_simple:
+
+ CHANGES: MinGW: testing: skip the tests that require SIGHUP since
+ MinGW does not support SIGHUP.
+
+2010-06-20 15:19 bvassche
+
+ * configure, configure.d/config_os_progs, testing/Makefile.in:
+
+ Added a configure test that detects whether or not Perl's
+ system() function
+ invokes a POSIX shell. "make test" does now fall back to RUNTESTS
+ if not.
+
+2010-06-20 15:16 bvassche
+
+ * snmplib/snmp_transport.c, snmplib/transports/snmpAliasDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ snmplib/transports/snmpSocketBaseDomain.c,
+ snmplib/transports/snmpTCPBaseDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c:
+
+ Builds again on MinGW -- added #include <net-snmp/types.h> where
+ necessary.
+ Note: although <net-snmp/types.h> is included indirectly from the
+ * *transport.h header files, these #include statements are
+ necessary because of a pesky circular dependence between
+ <net-snmp/types.h> and <net-snmp/library/snmp_api.h>.
+ 2010-06-20 15:12 bvassche
+
+
+ * testing/fulltests/support/simple_run:
+
+ CHANGES: MinGW: refuse to run the regression tests if kill.exe
+ cannot be found.
+
+2010-06-20 15:11 bvassche
+
+ * testing/RUNTESTS:
+
+ Shortened the srcdir path by making sure that it does not contain
+ /..
+
+2010-06-19 18:30 bvassche
+
+ * testing/RUNFULLTESTS:
+
+ Added support for running RUNFULLTESTS with Test::Harness in
+ another directory than the source directory.
+
+2010-06-19 16:41 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h:
+
+ complete rewrite of params to use table_dataset instead of
+ create-dataset
+
+2010-06-19 16:41 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c:
+
+ use text for hash type in persistent store
+
+2010-06-19 16:40 rstory
+
+ * agent/mibgroup/Rmon/rows.c,
+ agent/mibgroup/examples/ucdDemoPublic.c:
+
+ quiet compiler warnings
+
+2010-06-19 16:40 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix missing specifier in debug
+
+2010-06-19 16:39 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ use define instead of constant; fix check for rows to save
+
+2010-06-19 16:39 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ add remove/find function for maps/addrs/params; rename params
+ tag->name;
+ destroy -> free; group recent trust functions together in src;
+ don't store
+ params fp as binary; hand text args for hash type (e.g --sha1)
+
+2010-06-18 15:35 bvassche
+
+ * agent/mibgroup/mibII/at.c:
+
+ CHANGES: Cygwin: corrected error handling in mibII/at.
+
+2010-06-18 07:23 bvassche
+
+ * include/net-snmp/library/snmp_api.h:
+
+ Fixed a compiler warning.
+
+2010-06-18 01:42 magfr
+
+ * snmplib/keytools.c:
+
+ Do not define ret twice when NETSNMP_USE_INTERNAL_CRYPTO is set.
+
+2010-06-18 01:39 magfr
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ Corrected typo.
+
+2010-06-18 00:31 hardaker
+
+ * CHANGES, NEWS:
+
+ better NEWS and CHANGES files
+
+2010-06-17 20:39 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2010-06-17 20:31 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2010-06-17 18:59 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+
+
+----------------------------------------------------------------------
+
+Changes: V5.5 -> V5.6.pre1
+
+2010-06-17 20:31 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2010-06-17 18:59 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2010-06-17 18:55 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2010-06-17 18:54 hardaker
+
+ * Makefile.top:
+
+ version update
+
+2010-06-17 18:39 hardaker
+
+ * dist/makerelease.xml:
+
+ re-enable some commands
+
+2010-06-17 17:46 hardaker
+
+ * testing/fulltests/tls/Stlsvars:
+
+ forgot missing quotes in SET output
+
+2010-06-17 17:46 hardaker
+
+ * testing/fulltests/tls/Stlsagenttraptests,
+ testing/fulltests/tls/Stlsvars:
+
+ tls testing cleanup
+
+2010-06-17 17:45 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ more fixes for address printing; more to come
+
+2010-06-17 17:45 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ mostly properly set remote/local transport parameters
+
+2010-06-17 17:45 hardaker
+
+ * testing/fulltests/tls/Stlsagenttraptests,
+ testing/fulltests/tls/T131dtlsudpagenttraptests_simple,
+ testing/fulltests/tls/T132tlstcpagenttraptests_simple:
+
+ tests for agents sending of traps over (D)TLS
+
+2010-06-17 17:45 hardaker
+
+ * testing/fulltests/tls/Stlsvars,
+ testing/fulltests/tls/T101dtlsudpusertests_simple,
+ testing/fulltests/tls/T102tlstcpusertests_simple,
+ testing/fulltests/tls/T111dtlsudpservertests_simple,
+ testing/fulltests/tls/T112tlstcpservertests_simple,
+ testing/fulltests/tls/T121dtlsudptraptests_simple,
+ testing/fulltests/tls/T122tlstcptraptests_simple:
+
+ move export statements to the support file for simplicity
+
+2010-06-17 17:44 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ move tls bootstrapping to post_premib so other config tokens can
+ use the cert loading results
+
+2010-06-17 17:44 hardaker
+
+ * testing/fulltests/unit-tests/T004snmp_enum_clib.c:
+
+ added snmp_enum tests pulled from the main() test at the bottom
+ of the original .c file
+
+2010-06-17 16:00 dts12
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ Eliminate "differ in signedness" warning
+
+2010-06-17 00:14 hardaker
+
+ * snmplib/transports/snmpUDPBaseDomain.c:
+
+ revert UDP changes from r18984 since it broke the UDP transport;
+ the struct probably needs to match another struct somewhere else
+
+2010-06-16 23:26 hardaker
+
+ * snmplib/cert_util.c:
+
+ add a new KEYWORD output for debugging purposes
+
+2010-06-16 23:26 hardaker
+
+ * agent/agent_trap.c:
+
+ use config_and_open for opening the transport
+
+2010-06-16 23:26 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ extra debugging statements
+
+2010-06-16 22:14 hardaker
+
+ * testing/fulltests/tls/Stlsuserstests:
+
+ explicitly declare trust certificates to transport
+
+2010-06-16 22:14 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ cleanup some lost memory on closing
+
+2010-06-16 21:56 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix typos
+
+2010-06-16 21:34 dts12
+
+ * agent/agent_registry.c, agent/helpers/row_merge.c,
+ agent/helpers/table.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/agent/extend.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ip_scalars.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/pass.c, agent/mibgroup/ucd-snmp/proxy.c,
+ agent/snmp_agent.c:
+
+ Eliminate (most) "signed and unsigned comparison" warnings from
+ agent code [-Wsign-compare]
+
+2010-06-16 20:16 dts12
+
+ * snmplib/asn1.c, snmplib/check_varbind.c,
+ snmplib/container_binary_array.c, snmplib/dir_utils.c,
+ snmplib/keytools.c, snmplib/large_fd_set.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/scapi.c, snmplib/snmp_api.c,
+ snmplib/snmp_client.c, snmplib/snmpusm.c, snmplib/snmpv3.c,
+ snmplib/text_utils.c, snmplib/vacm.c:
+
+ Eliminate (most) "signed and unsigned comparison" warnings from
+ library code [-Wsign-compare]
+
+2010-06-16 19:36 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ remove older no-longer-needed-duplicate-config entries
+
+2010-06-16 19:14 dts12
+
+ * snmplib/vacm.c:
+
+ Fix processing of view masks (misplaced parentheses)
+
+2010-06-16 18:45 dts12
+
+ * apps/agentxtrap.c, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmptable.c, apps/snmptrapd_log.c, apps/snmpusm.c:
+
+ Eliminate "signed and unsigned comparison" from app code
+ [-Wsign-compare]
+
+2010-06-16 17:22 hardaker
+
+ * testing/fulltests/tls/Stlstrapdusertests:
+
+ check for informs sent over tls transports
+
+2010-06-16 17:22 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ copy other valuse from parent tlsbase data
+
+2010-06-16 17:21 hardaker
+
+ * testing/fulltests/tls/Stlstrapdusertests,
+ testing/fulltests/tls/Stlsvars,
+ testing/fulltests/tls/T121dtlsudptraptests_simple,
+ testing/fulltests/tls/T122tlstcptraptests_simple:
+
+ added basic trap sending and receiving tests
+
+2010-06-16 17:21 hardaker
+
+ * testing/fulltests/tls/Stlsuserstests:
+
+ remove no longer needed temp file touches
+
+2010-06-16 17:20 hardaker
+
+ * agent/snmp_agent.c, include/net-snmp/library/snmp_transport.h,
+ snmplib/cert_util.c, snmplib/snmp_api.c:
+
+ added a new function and transport flag to indicate if the f_open
+ call has been called yet
+
+2010-06-16 17:20 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ unused var warning cleanup
+
+2010-06-16 17:19 hardaker
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ added trustCert configuration token
+
+2010-06-16 17:19 hardaker
+
+ * testing/fulltests/tls/Stlsuserstests:
+
+ minor tweaks for testing clarity
+
+2010-06-16 17:18 hardaker
+
+ * testing/fulltests/tls/Stlsuserstests,
+ testing/fulltests/tls/T101dtlsudpusertests_simple,
+ testing/fulltests/tls/T102tlstcpusertests_simple,
+ testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests,
+ testing/fulltests/transports/T360dtlsudp_simple,
+ testing/fulltests/transports/T361tlstcp_simple:
+
+ moved complex (D)TLS to a separate section and made the transport
+ tests only test minimal support
+
+2010-06-16 17:17 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ add mechanisms for specifying and expecting the hostname of the
+ far side
+
+2010-06-16 17:17 hardaker
+
+ * testing/fulltests/tls/Stlsservertests,
+ testing/fulltests/tls/Stlsvars:
+
+ tests for verifying server certificate check failures
+
+2010-06-16 17:17 hardaker
+
+ * testing/fulltests/tls, testing/fulltests/tls/Stlsservertests,
+ testing/fulltests/tls/Stlsvars,
+ testing/fulltests/tls/T111dtlsudpservertests_simple,
+ testing/fulltests/tls/T112tlstcpservertests_simple:
+
+ testing for checking client side verification of server
+ certificates
+
+2010-06-16 17:16 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h:
+
+ setup for a hostname config option
+
+2010-06-16 17:16 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ setup for a hostname config option
+
+2010-06-16 17:15 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ check to make suer ssl pointer has been created via f_open call
+
+2010-06-16 15:02 dts12
+
+ * agent/snmp_perl.h, apps/snmptrapd.c:
+
+ Declare 'shutdown_perl' properly.
+
+2010-06-16 14:37 dts12
+
+ * agent/snmpd.c, snmplib/keytools.c, snmplib/lcd_time.c:
+
+ Eliminate "signed and unsigned type in conditional expression"
+ warnings [-Wsign-compare]
+
+2010-06-16 14:27 dts12
+
+ * agent/mibgroup/target/target.c:
+
+ Eliminate "unused variable" warning
+
+2010-06-16 14:22 dts12
+
+ * agent/helpers/old_api.c, agent/helpers/row_merge.c,
+ agent/helpers/table_dataset.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/snmpd.c, snmplib/transports/snmpUDPBaseDomain.c:
+
+ Eliminate various "implicit conversion" warnings [-Wc++-compat]
+
+2010-06-16 13:13 dts12
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/data_access/scalars_linux.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ apps/snmpvacm.c, snmplib/tools.c:
+
+ Eliminate (most) signed-vs-unsigned warnings from numeric scanf
+ processing [-pedantic]
+
+2010-06-16 03:28 rstory
+
+ * agent/helpers/table_tdata.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+ agent/mibgroup/ip-mib/data_access/arp_common.c,
+ agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_common.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+ snmplib/container.c:
+
+ the great un-named container hunt
+
+2010-06-16 03:27 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ share cache between table and count scalar; when reading config,
+ add to
+ library containers for active rows, table containers for inactive
+ rows;
+ user cert_util apis instead of direct container manipulation;
+ when
+ saving inactive map rows, skip all but nonVolatile
+
+2010-06-16 03:26 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ fix debug token typo
+
+2010-06-16 03:25 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ add api for adding entries to tltsm addr, params and cert map
+ containers;
+ register se slist pair earlier so they are available during
+ config parsing;
+ make sure config strings are null terminated
+
+2010-06-15 21:42 dts12
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ Suppress warnings:
+ 'struct nlmsghdr defined inside parameter list' and
+ 'function _load_v6 declared but never defined'
+
+2010-06-15 21:30 dts12
+
+ * agent/kernel.c, apps/snmptrapd_sql.c, snmplib/cert_util.c,
+ snmplib/cmu_compat.c, snmplib/pkcs.c, snmplib/snprintf.c:
+
+ Eliminate "empty translation unit" warnings [-pedantic]
+
+2010-06-15 07:07 magfr
+
+ * testing/fulltests/unit-tests/T003copy_nword_clib.c:
+
+ Add test of copy_nword
+
+2010-06-14 21:32 dts12
+
+ * agent/mibgroup/disman/event/mteEvent.h,
+ agent/mibgroup/disman/event/mteTrigger.h,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/disman/schedule/schedCore.c:
+
+ Eliminate "overflow in implicit constant conversion" warnings
+ [-Wc++-compat]
+
+2010-06-14 15:51 dts12
+
+ * agent/snmpd.c, apps/encode_keychange.c, snmplib/read_config.c:
+
+ Eliminate "string length greater than 509" warnings [-pedantic]
+
+2010-06-14 15:19 dts12
+
+ * snmplib/transports/snmpUDPBaseDomain.c:
+
+ Eliminate "initializer element is not computable" warnings
+ [-pedantic]
+
+2010-06-14 05:27 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ update count handlers to count non-active rows too
+
+2010-06-14 05:12 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c:
+
+ only tweak storageType for active rows; reset entry flags when
+ removing from
+ cert_util maps; when createing rows from cert_util maps, set
+ stragetType to
+ volatile if nonVolatile flag not set; dont free cache in
+ cache_load on err
+
+2010-06-14 05:10 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c:
+
+ move tlstmAddr table config parsing to cert_util; add cache to
+ merge cert_util
+ addrs (active) and non-active rows;
+
+2010-06-14 05:10 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ add nonVolatile flag to tlstmAddr table; set container name; skip
+ '0x' in fp
+
+2010-06-14 05:09 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ change LOG_ERR to LOG_INFO for non-error log msg
+
+2010-06-13 21:02 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.c,
+ agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c,
+ local/mib2c-conf.d/mfd-interface.m2c:
+
+ Eliminate (most) "implicit conversion" warnings from
+ MfD-based MIB module code, and MfD template [-Wc++-compat]
+
+2010-06-12 21:33 dts12
+
+ * agent/mibgroup/agent/extend.c,
+ agent/mibgroup/disman/event/mteEventConf.c,
+ agent/mibgroup/disman/event/mteObjectsConf.c,
+ agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/expr/expExpressionConf.c,
+ agent/mibgroup/disman/expr/expObjectConf.c,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/hardware/cpu/cpu_perfstat.c,
+ agent/mibgroup/hardware/cpu/cpu_sysctl.c,
+ agent/mibgroup/hardware/fsys/fsys_getfsstats.c,
+ agent/mibgroup/hardware/memory/memory_linux.c,
+ agent/mibgroup/hardware/memory/memory_solaris.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/hr_disk.c, agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/ucd-snmp/disk.c, agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/utilities/override.c:
+
+ Eliminate (most) "implicit conversion" warnings from (non-MfD)
+ MIB module code. [-Wc++-compat]
+
+2010-06-12 10:26 dts12
+
+ * agent/agent_handler.c, agent/agent_index.c,
+ agent/agent_registry.c, agent/agent_sysORTable.c,
+ agent/helpers/baby_steps.c, agent/helpers/cache_handler.c,
+ agent/helpers/mode_end_call.c, agent/helpers/row_merge.c,
+ agent/helpers/scalar.c, agent/helpers/stash_cache.c,
+ agent/helpers/table_array.c, agent/helpers/table_container.c,
+ agent/helpers/table_dataset.c, agent/helpers/table_iterator.c,
+ agent/helpers/table_tdata.c, agent/helpers/watcher.c,
+ agent/snmp_agent.c, apps/snmptrapd.c, apps/snmptrapd_log.c,
+ snmplib/dir_utils.c, snmplib/file_utils.c,
+ snmplib/large_fd_set.c, snmplib/snmp_api.c:
+
+ Eliminate (most) "implicit conversion" warnings from library,
+ apps and agent framework+helpers code. [-Wc++-compat]
+
+2010-06-10 20:01 rstory
+
+ * agent/mibgroup/target/target.c:
+
+ lookup cert keys for tls domains; use SEC_MODEL define instead of
+ hardcoded
+ constant; add SEC_MODEL_TSM to allowed sec models for mpModel
+ SNMP_VERSION_3
+
+2010-06-10 20:00 rstory
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ default to readOnly/active for bad config
+
+2010-06-10 20:00 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ add debug; switch to SEC_MODEL_TSM and warn if other secmode set,
+ instead
+ of simply logging that it won't work
+
+2010-06-10 19:59 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ check ptrs before dereference
+
+2010-06-10 19:58 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ move snmpTlstmAddrTable data management to cert_util; implement
+ TARGET_ADDR
+ and TARGET_PARAMS lookup in cert API
+
+2010-06-10 19:47 rstory
+
+ * snmplib/snmp_api.c:
+
+ update sec model define missed in earlier checkin
+
+2010-06-10 19:46 rstory
+
+ * agent/agent_trap.c:
+
+ config trapsess transports on creation; simplify ifdefs for
+ DISABLE_SNMPV1
+
+2010-06-10 19:46 rstory
+
+ * include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmpusm.h, snmplib/snmpksm.c,
+ snmplib/snmptsm.c, snmplib/transports/snmpTLSBaseDomain.c:
+
+ auto switch to v3 for (d)tls sessions instead of logging that
+ others wont
+ work; define TSM sec model with other sec models; consistently
+ use
+ SNMP_SEC_MODEL_* in the code, using #defines for backwards
+ compatibility
+ w/*_SECURITY_MODEL
+
+2010-06-10 19:46 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+ include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ certToTSN: move mib related persistence back into mib module;
+ cert_util: add tlstmParams persistence; use slist for cert map
+ type name
+ mapping;
+
+2010-06-10 19:45 rstory
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix compiler warning (const)
+
+2010-06-10 04:58 magfr
+
+ * agent/agent_handler.c:
+
+ Add missing indentation of a do-while loop to make the code
+ readable.
+
+2010-06-09 22:57 hardaker
+
+ * local/net-snmp-cert:
+
+ comment out keyUsage so proper self-signed certs are generated
+
+2010-06-09 22:57 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ solidify certificate acceptance for the client side
+
+2010-06-09 22:57 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix array typo
+
+2010-06-09 22:56 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ log openssl errors on accept failure
+
+2010-06-09 22:56 hardaker
+
+ * snmplib/snmp_api.c:
+
+ register default ports for tls/dtls
+
+2010-06-09 22:56 hardaker
+
+ * snmplib/cert_util.c:
+
+ do proper STORE loading of trusted certificates rather than file
+ based loading
+
+2010-06-09 22:56 hardaker
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ added two new APIs: netsnmp_cert_trust and netsnmp_cert_trust_ca
+
+2010-06-09 22:55 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ added straight 'tls' transport name
+
+2010-06-09 22:55 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ added straight 'dtls' transport name
+
+2010-06-08 21:05 magfr
+
+ * agent/Makefile.in:
+
+ Install agent_read_config.h in 5.6 as well. It disappeared in
+ r18843.
+
+2010-06-08 09:25 dts12
+
+ * agent/mibgroup/hardware/fsys/hw_fsys.h,
+ agent/mibgroup/host/hrh_filesys.c,
+ agent/mibgroup/ucd-snmp/disk_hw.c:
+
+ Remove (or activate) unused variables.
+ Fix misnamed function declaration.
+
+2010-06-08 07:11 dts12
+
+ * include/net-snmp/agent/hardware/fsys.h:
+
+ API changes for preliminary HAL_based implementation of UCD disk
+ module.
+ (Omitted from revision 18932 checkin)
+
+2010-06-08 04:18 rstory
+
+ * agent/Makefile.in:
+
+ update makefile for moved helper headers
+
+2010-06-07 20:18 jsafranek
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Reverting rev. 17616, the necessary check is already in rev.
+ 17415.
+
+2010-06-06 03:45 magfr
+
+ * configure, configure.d/config_project_paths:
+
+ CHANGES: building: In case exec_prefix is unset then set it to
+ '${prefix}' in order to pick up overrides of $prefix in make
+ install.
+
+2010-06-04 04:06 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ do a better job of verifying fingerprints of remote servers
+ pulling fingerprints from a number of possible places
+
+2010-06-04 04:05 hardaker
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ go ahead and log output file for easier debugging in errors
+
+2010-06-04 04:05 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ fix typo
+
+2010-06-04 04:05 hardaker
+
+ * snmplib/scapi.c:
+
+ remove comment about random being inadequate; we're doing the
+ best we can based on what we have
+
+2010-06-04 04:04 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ use another user for testing snmpapp default certificate
+
+2010-06-04 04:04 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ run a default test without a local key to ensure the snmpapp type
+ is picked up
+
+2010-06-04 04:04 hardaker
+
+ * snmplib/cert_util.c:
+
+ add a special case for the local identity and pull it from a
+ filename of the init_snmp() registered type name
+
+2010-06-04 04:03 hardaker
+
+ * testing/fulltests/support/NetSNMPTest.pm:
+
+ doc update
+
+2010-06-04 04:03 hardaker
+
+ * testing/fulltests/perl/T105unix.t:
+
+ unix socket test
+
+2010-06-04 04:03 hardaker
+
+ * testing/fulltests/perl/T103udp6.t,
+ testing/fulltests/perl/T104tcp6.t:
+
+ ipv6 tests
+
+2010-06-04 04:02 hardaker
+
+ * testing/fulltests/perl/T101udp.t,
+ testing/fulltests/perl/T102tcp.t:
+
+ mention test name is IPv4
+
+2010-06-04 04:02 hardaker
+
+ * testing/fulltests/perl/T101udp.t,
+ testing/fulltests/perl/T102tcp.t:
+
+ check that transport was configured
+
+2010-06-04 04:02 hardaker
+
+ * testing/fulltests/support/NetSNMPTest.pm:
+
+ add support for net-snmp-config.h checks
+
+2010-06-04 04:01 hardaker
+
+ * testing/fulltests/perl/NetSNMPTestTransport.pm,
+ testing/fulltests/perl/T101udp.t,
+ testing/fulltests/perl/T102tcp.t:
+
+ some basic transport checking for perl: udp and tcp
+
+2010-06-04 04:01 hardaker
+
+ * testing/fulltests/perl, testing/fulltests/perl/T001basic.t:
+
+ basic tests for perl
+
+2010-06-04 04:01 hardaker
+
+ * testing/fulltests/support/NetSNMPTest.pm:
+
+ infrastructure module for testing perl support
+
+2010-06-03 15:56 dts12
+
+ * dist/makerelease.xml:
+
+ Point LIB{CURRENT,AGE,REVISION} documentation to the correct
+ file.
+ Warn about 'makedepend' picking up testing module code.
+ Emphasis update of 'download.html' page
+ Mention update of Official Patches
+ Suppress broken commands
+
+2010-06-03 15:16 dts12
+
+ * agent/mibgroup/ucd-snmp/disk_hw.c,
+ agent/mibgroup/ucd-snmp/disk_hw.h, agent/mibgroup/ucd_snmp.h:
+
+ Preliminary HAL_based implementation of UCD disk module.
+ Ensures consistent reporting between UCD and HostRes FSys usage
+ and extends 'skipNFSInHostResources' config to UCD disk stats.
+
+2010-06-03 15:13 dts12
+
+ * agent/mibgroup/hardware/fsys/hw_fsys.c:
+
+ Fix broken size calculations.
+ Support 64-bit size/usage values.
+
+2010-06-02 14:52 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ use --with-ca instead of --ca
+
+2010-06-02 14:51 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ use the new -brief option for fingerprint capturing
+
+2010-06-02 14:40 marz
+
+ * local/net-snmp-cert:
+
+ fix --with-ca handling, fix CA newcerts bookkeeping
+
+2010-06-02 10:57 jsafranek
+
+ * agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/utilities/override.c:
+
+ CHANGES: snmpd: fixed potential buffer overflow in parsing OIDs
+ in config files.
+
+2010-06-02 00:24 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ check that CA certificates created after snmpd starts are still
+ usable; check all output fingerprints to ensure they were
+ properly created
+
+2010-06-02 00:23 hardaker
+
+ * local/net-snmp-cert:
+
+ add missing directory and file suffix to ca invocations
+
+2010-06-02 00:21 hardaker
+
+ * testing/fulltests/transports/Stls:
+
+ check that certificate output fingerprints were found
+
+2010-06-02 00:20 hardaker
+
+ * testing/fulltests/support/simple_eval_tools.sh:
+
+ two new functions for value comparison test output
+
+2010-06-02 00:16 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/transports/Stls:
+
+ remove no-longer-used self-signed certificate token specifier (we
+ require a copy of the key)
+
+2010-06-02 00:08 hardaker
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/cert_util.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ testing/fulltests/transports/Stlstests:
+
+ - changed 'fingerprint' token to more generic 'identity' keyword
+ - added the ability for netsnmp_cert_find to try multiple types
+ (FP & file)
+ - and provide test suite test for it.
+
+2010-06-01 20:12 bvassche
+
+ * testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T115agentxperl_simple:
+
+ Made sure that the Perl extension modules can load the Net-SNMP
+ DLLs while running the Net-SNMP regression tests.
+
+2010-06-01 16:47 marz
+
+ * local/certgen-test.pl, local/net-snmp-cert:
+
+ major update bug fixes and features - interactive mode, separate
+ CA dirs, gen csr from cert, fingerprint display --brief,
+ eliminate sed, openssl.conf overwrite and templating
+
+2010-06-01 14:48 bvassche
+
+ * agent/helpers/table.c:
+
+ Fixed a typo in a source code comment.
+
+2010-06-01 14:25 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_common.c:
+
+ CHANGES: snmpd: fixed IP-MIB::ipIfStatsReasmReqds value.
+
+ Just fixing a stupid typo.
+
+2010-05-31 10:43 bvassche
+
+ * configure, configure.d/config_modules_lib:
+
+ CHANGES: Cygwin: enabled Unix transport.
+ (Forward-ported r18687 from the V5.5 branch).
+
+2010-05-30 22:52 tanders
+
+ * testing/RUNFULLTESTS:
+
+ enable to run with older Perl (e.g. Perl 5.00405 as shipped with
+ IRIX
+ 6.5)
+
+2010-05-30 22:49 tanders
+
+ * testing/RUNFULLTESTS:
+
+ polish documentation
+
+2010-05-30 20:19 magfr
+
+ * agent/Makefile.in, agent/helpers/Makefile.in, apps/Makefile.in,
+ net-snmp-config.in, net-snmp-create-v3-user.in,
+ perl/TrapReceiver/Makefile.PL, perl/agent/Makefile.PL:
+
+ CHANGES: building: Do not link with libnetsnmphelpers any more as
+ it is empty.
+
+2010-05-30 19:18 magfr
+
+ * include/net-snmp/library/snmp.h, snmplib/snmp.c:
+
+ CHANGES: snmplib: Use a void argument for the data argument of
+ xdump.
+
+2010-05-30 19:18 bvassche
+
+ * agent/snmp_perl.c:
+
+ CHANGES: BUG: 2051742: added missing PERL_SYS_INIT3() call (see
+ also man perlembed).
+
+2010-05-30 19:16 bvassche
+
+ * include/net-snmp/library/container.h:
+
+ Fixed a compiler warning (free() called without being declared
+ first).
+
+2010-05-30 16:56 magfr
+
+ * acconfig.h, agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/smux/smux.h, configure,
+ configure.d/config_modules_lib,
+ include/net-snmp/net-snmp-config.h.in:
+
+ NEWS: snmplib: Do not require that the UDP transport is included.
+
+2010-05-30 12:00 magfr
+
+ * include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpIPv4BaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpSSHDomain.h,
+ include/net-snmp/library/snmpSTDDomain.h,
+ include/net-snmp/library/snmpTCPBaseDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ snmplib/snmp_transport.c, snmplib/transports/snmpAAL5PVCDomain.c,
+ snmplib/transports/snmpAliasDomain.c,
+ snmplib/transports/snmpCallbackDomain.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPXDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpSTDDomain.c,
+ snmplib/transports/snmpSocketBaseDomain.c,
+ snmplib/transports/snmpTCPBaseDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c,
+ snmplib/transports/snmpUnixDomain.c:
+
+ CHANGES: snmplib: Correct dependencies between transports. Remove
+ unnecessary includes.
+
+2010-05-30 06:21 bvassche
+
+ * agent/helpers/Makefile.in, agent/helpers/dummy.c:
+
+ Made sure that libnetsnmphelpers is not empty such that building
+ Net-SNMP on AIX and IRIX is again possible.
+
+2010-05-29 09:52 bvassche
+
+ * testing/RUNFULLTESTS:
+
+ Follow-up for r18902: works again without TAP::Harness.
+
+2010-05-28 23:23 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix long-ago broken verbosity
+
+2010-05-28 23:05 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix more previously broken option renames; change -d to
+ master-directory and add as a real argument
+
+2010-05-28 23:05 hardaker
+
+ * testing/fulltests/default/T001snmpv1get_simple,
+ testing/fulltests/default/T014snmpv2cget_simple,
+ testing/fulltests/default/T015snmpv2cgetnext_simple,
+ testing/fulltests/default/T0160snmpv2cbulkget_simple,
+ testing/fulltests/default/T016snmpv2cgetfail_simple,
+ testing/fulltests/default/T017snmpv2ctov1getfail_simple,
+ testing/fulltests/default/T018snmpv1tov2cgetfail_simple,
+ testing/fulltests/default/T019snmpv2cnosuch_simple,
+ testing/fulltests/default/T020snmpv3get_simple,
+ testing/fulltests/default/T021snmpv3getnext_simple,
+ testing/fulltests/default/T0220snmpv3bulkget_simple,
+ testing/fulltests/default/T022snmpv3getMD5_simple,
+ testing/fulltests/default/T023snmpv3getMD5AES_simple,
+ testing/fulltests/default/T023snmpv3getMD5DES_simple,
+ testing/fulltests/default/T024snmpv3getSHA1_simple,
+ testing/fulltests/default/T025snmpv3getSHADES_simple,
+ testing/fulltests/default/T026snmpv3getSHAAES_simple,
+ testing/fulltests/default/T028snmpv3getfail_simple,
+ testing/fulltests/default/T030snmpv3usercreation_simple,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_simple,
+ testing/fulltests/default/T049snmpv3inform_simple,
+ testing/fulltests/default/T049snmpv3informauth_simple,
+ testing/fulltests/default/T049snmpv3informpriv_simple,
+ testing/fulltests/default/T050snmpv3trap_simple,
+ testing/fulltests/default/T051snmpv2ctrap_simple,
+ testing/fulltests/default/T052snmpv2cinform_simple,
+ testing/fulltests/default/T053agentv1trap_simple,
+ testing/fulltests/default/T054agentv2ctrap_simple,
+ testing/fulltests/default/T055agentv1mintrap_simple,
+ testing/fulltests/default/T056agentv2cmintrap_simple,
+ testing/fulltests/default/T057trapdauthtest2_simple,
+ testing/fulltests/default/T057trapdauthtest3_simple,
+ testing/fulltests/default/T057trapdauthtest_simple,
+ testing/fulltests/default/T058agentauthtrap_simple,
+ testing/fulltests/default/T059trapdtraphandle_simple,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T065agentextend_simple,
+ testing/fulltests/default/T070com2sec_simple,
+ testing/fulltests/default/T071com2sec6_simple,
+ testing/fulltests/default/T072com2secunix_simple,
+ testing/fulltests/default/T100agenthup_simple,
+ testing/fulltests/default/T110agentxget_simple,
+ testing/fulltests/default/T111agentxset_simple,
+ testing/fulltests/default/T112agentxsetfail_simple,
+ testing/fulltests/default/T113agentxtrap_simple,
+ testing/fulltests/default/T114agentxagentxtrap_simple,
+ testing/fulltests/default/T115agentxperl_simple,
+ testing/fulltests/default/T120proxyget_simple,
+ testing/fulltests/default/T121proxyset_simple,
+ testing/fulltests/default/T122proxysetfail_simple,
+ testing/fulltests/default/T130snmpv1vacmget_simple,
+ testing/fulltests/default/T131snmpv2cvacmget_simple,
+ testing/fulltests/default/T132snmpv3vacmget_simple,
+ testing/fulltests/default/T140snmpv1vacmgetfail_simple,
+ testing/fulltests/default/T141snmpv2cvacmgetfail_simple,
+ testing/fulltests/default/T142snmpv3vacmgetfail_simple,
+ testing/fulltests/default/T150solarishostcpu_simple,
+ testing/fulltests/default/T151solarishostdisk_simple,
+ testing/fulltests/default/T152hostuptime_simple,
+ testing/fulltests/default/T153solarisswap_simple,
+ testing/fulltests/default/T160snmpnetstat_simple,
+ testing/fulltests/default/T200snmpv2cwalkall_simple,
+ testing/fulltests/transports/T300udp_simple,
+ testing/fulltests/transports/T310tcp_simple,
+ testing/fulltests/transports/T320udpv6_simple,
+ testing/fulltests/transports/T330tcpv6_simple,
+ testing/fulltests/transports/T350unix_simple,
+ testing/fulltests/transports/T360dtlsudp_simple,
+ testing/fulltests/transports/T361tlstcp_simple,
+ testing/fulltests/transports/T399alias_simple:
+
+ more missing olducd renames
+
+2010-05-28 22:57 hardaker
+
+ * testing/RUNTESTS, testing/fulltests/default/T001snmpv1get_olducd,
+ testing/fulltests/default/T001snmpv1get_simple,
+ testing/fulltests/default/T014snmpv2cget_olducd,
+ testing/fulltests/default/T014snmpv2cget_simple,
+ testing/fulltests/default/T015snmpv2cgetnext_olducd,
+ testing/fulltests/default/T015snmpv2cgetnext_simple,
+ testing/fulltests/default/T0160snmpv2cbulkget_olducd,
+ testing/fulltests/default/T0160snmpv2cbulkget_simple,
+ testing/fulltests/default/T016snmpv2cgetfail_olducd,
+ testing/fulltests/default/T016snmpv2cgetfail_simple,
+ testing/fulltests/default/T017snmpv2ctov1getfail_olducd,
+ testing/fulltests/default/T017snmpv2ctov1getfail_simple,
+ testing/fulltests/default/T018snmpv1tov2cgetfail_olducd,
+ testing/fulltests/default/T018snmpv1tov2cgetfail_simple,
+ testing/fulltests/default/T019snmpv2cnosuch_olducd,
+ testing/fulltests/default/T019snmpv2cnosuch_simple,
+ testing/fulltests/default/T020snmpv3get_olducd,
+ testing/fulltests/default/T020snmpv3get_simple,
+ testing/fulltests/default/T021snmpv3getnext_olducd,
+ testing/fulltests/default/T021snmpv3getnext_simple,
+ testing/fulltests/default/T0220snmpv3bulkget_olducd,
+ testing/fulltests/default/T0220snmpv3bulkget_simple,
+ testing/fulltests/default/T022snmpv3getMD5_olducd,
+ testing/fulltests/default/T022snmpv3getMD5_simple,
+ testing/fulltests/default/T023snmpv3getMD5AES_olducd,
+ testing/fulltests/default/T023snmpv3getMD5AES_simple,
+ testing/fulltests/default/T023snmpv3getMD5DES_olducd,
+ testing/fulltests/default/T023snmpv3getMD5DES_simple,
+ testing/fulltests/default/T024snmpv3getSHA1_olducd,
+ testing/fulltests/default/T024snmpv3getSHA1_simple,
+ testing/fulltests/default/T025snmpv3getSHADES_olducd,
+ testing/fulltests/default/T025snmpv3getSHADES_simple,
+ testing/fulltests/default/T026snmpv3getSHAAES_olducd,
+ testing/fulltests/default/T026snmpv3getSHAAES_simple,
+ testing/fulltests/default/T028snmpv3getfail_olducd,
+ testing/fulltests/default/T028snmpv3getfail_simple,
+ testing/fulltests/default/T030snmpv3usercreation_olducd,
+ testing/fulltests/default/T030snmpv3usercreation_simple,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_olducd,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_simple,
+ testing/fulltests/default/T049snmpv3inform_olducd,
+ testing/fulltests/default/T049snmpv3inform_simple,
+ testing/fulltests/default/T049snmpv3informauth_olducd,
+ testing/fulltests/default/T049snmpv3informauth_simple,
+ testing/fulltests/default/T049snmpv3informpriv_olducd,
+ testing/fulltests/default/T049snmpv3informpriv_simple,
+ testing/fulltests/default/T050snmpv3trap_olducd,
+ testing/fulltests/default/T050snmpv3trap_simple,
+ testing/fulltests/default/T051snmpv2ctrap_olducd,
+ testing/fulltests/default/T051snmpv2ctrap_simple,
+ testing/fulltests/default/T052snmpv2cinform_olducd,
+ testing/fulltests/default/T052snmpv2cinform_simple,
+ testing/fulltests/default/T053agentv1trap_olducd,
+ testing/fulltests/default/T053agentv1trap_simple,
+ testing/fulltests/default/T054agentv2ctrap_olducd,
+ testing/fulltests/default/T054agentv2ctrap_simple,
+ testing/fulltests/default/T055agentv1mintrap_olducd,
+ testing/fulltests/default/T055agentv1mintrap_simple,
+ testing/fulltests/default/T056agentv2cmintrap_olducd,
+ testing/fulltests/default/T056agentv2cmintrap_simple,
+ testing/fulltests/default/T057trapdauthtest2_olducd,
+ testing/fulltests/default/T057trapdauthtest2_simple,
+ testing/fulltests/default/T057trapdauthtest3_olducd,
+ testing/fulltests/default/T057trapdauthtest3_simple,
+ testing/fulltests/default/T057trapdauthtest_olducd,
+ testing/fulltests/default/T057trapdauthtest_simple,
+ testing/fulltests/default/T058agentauthtrap_olducd,
+ testing/fulltests/default/T058agentauthtrap_simple,
+ testing/fulltests/default/T059trapdtraphandle_olducd,
+ testing/fulltests/default/T059trapdtraphandle_simple,
+ testing/fulltests/default/T060trapdperl_olducd,
+ testing/fulltests/default/T060trapdperl_simple,
+ testing/fulltests/default/T061agentperl_olducd,
+ testing/fulltests/default/T061agentperl_simple,
+ testing/fulltests/default/T065agentextend_olducd,
+ testing/fulltests/default/T065agentextend_simple,
+ testing/fulltests/default/T070com2sec_olducd,
+ testing/fulltests/default/T070com2sec_simple,
+ testing/fulltests/default/T071com2sec6_olducd,
+ testing/fulltests/default/T071com2sec6_simple,
+ testing/fulltests/default/T072com2secunix_olducd,
+ testing/fulltests/default/T072com2secunix_simple,
+ testing/fulltests/default/T100agenthup_olducd,
+ testing/fulltests/default/T100agenthup_simple,
+ testing/fulltests/default/T110agentxget_olducd,
+ testing/fulltests/default/T110agentxget_simple,
+ testing/fulltests/default/T111agentxset_olducd,
+ testing/fulltests/default/T111agentxset_simple,
+ testing/fulltests/default/T112agentxsetfail_olducd,
+ testing/fulltests/default/T112agentxsetfail_simple,
+ testing/fulltests/default/T113agentxtrap_olducd,
+ testing/fulltests/default/T113agentxtrap_simple,
+ testing/fulltests/default/T114agentxagentxtrap_olducd,
+ testing/fulltests/default/T114agentxagentxtrap_simple,
+ testing/fulltests/default/T115agentxperl_olducd,
+ testing/fulltests/default/T115agentxperl_simple,
+ testing/fulltests/default/T120proxyget_olducd,
+ testing/fulltests/default/T120proxyget_simple,
+ testing/fulltests/default/T121proxyset_olducd,
+ testing/fulltests/default/T121proxyset_simple,
+ testing/fulltests/default/T122proxysetfail_olducd,
+ testing/fulltests/default/T122proxysetfail_simple,
+ testing/fulltests/default/T130snmpv1vacmget_olducd,
+ testing/fulltests/default/T130snmpv1vacmget_simple,
+ testing/fulltests/default/T131snmpv2cvacmget_olducd,
+ testing/fulltests/default/T131snmpv2cvacmget_simple,
+ testing/fulltests/default/T132snmpv3vacmget_olducd,
+ testing/fulltests/default/T132snmpv3vacmget_simple,
+ testing/fulltests/default/T140snmpv1vacmgetfail_olducd,
+ testing/fulltests/default/T140snmpv1vacmgetfail_simple,
+ testing/fulltests/default/T141snmpv2cvacmgetfail_olducd,
+ testing/fulltests/default/T141snmpv2cvacmgetfail_simple,
+ testing/fulltests/default/T142snmpv3vacmgetfail_olducd,
+ testing/fulltests/default/T142snmpv3vacmgetfail_simple,
+ testing/fulltests/default/T150solarishostcpu_olducd,
+ testing/fulltests/default/T150solarishostcpu_simple,
+ testing/fulltests/default/T151solarishostdisk_olducd,
+ testing/fulltests/default/T151solarishostdisk_simple,
+ testing/fulltests/default/T152hostuptime_olducd,
+ testing/fulltests/default/T152hostuptime_simple,
+ testing/fulltests/default/T153solarisswap_olducd,
+ testing/fulltests/default/T153solarisswap_simple,
+ testing/fulltests/default/T160snmpnetstat_olducd,
+ testing/fulltests/default/T160snmpnetstat_simple,
+ testing/fulltests/default/T200snmpv2cwalkall_olducd,
+ testing/fulltests/default/T200snmpv2cwalkall_simple,
+ testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_eval_tools.sh,
+ testing/fulltests/support/olducd_run,
+ testing/fulltests/support/simple_TESTCONF.sh,
+ testing/fulltests/support/simple_eval_tools.sh,
+ testing/fulltests/support/simple_run,
+ testing/fulltests/transports/T300udp_olducd,
+ testing/fulltests/transports/T300udp_simple,
+ testing/fulltests/transports/T310tcp_olducd,
+ testing/fulltests/transports/T310tcp_simple,
+ testing/fulltests/transports/T320udpv6_olducd,
+ testing/fulltests/transports/T320udpv6_simple,
+ testing/fulltests/transports/T330tcpv6_olducd,
+ testing/fulltests/transports/T330tcpv6_simple,
+ testing/fulltests/transports/T350unix_olducd,
+ testing/fulltests/transports/T350unix_simple,
+ testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T360dtlsudp_simple,
+ testing/fulltests/transports/T361tlstcp_olducd,
+ testing/fulltests/transports/T361tlstcp_simple,
+ testing/fulltests/transports/T399alias_olducd,
+ testing/fulltests/transports/T399alias_simple:
+
+ renamed 'olducd' to 'simple' to put a more positive spin on them
+
+2010-05-28 22:54 hardaker
+
+ * testing/README, testing/RUNFULLTESTS:
+
+ documentation for the test suite
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/tests/test.py:
+
+ revert unintentionanally committed test test
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/client_intf.c, python/netsnmp/tests/test.py:
+
+ free variables again
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ fix walks so that multiple walks terminate properly
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ patch to handle testing of looping of multiple varbinds in a walk
+
+2010-05-28 22:53 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ inital patch to prevent looping walks
+
+2010-05-28 20:53 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ implement cert lookup by filename
+
+2010-05-28 07:02 magfr
+
+ * snmplib/snmp_debug.c:
+
+ CHANGES: snmplib: Add const declarations to the disabled versions
+ of the debugging code as well.
+
+2010-05-28 02:12 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ add persistence; check for col mods while row active
+
+2010-05-28 02:11 rstory
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ CHANGES: agentlib: new functions to make stash ptr and newrow
+ available to
+ table_dataset handlers
+ nonews: fix typo; tabs to spaces; use sizeof instead of constant
+
+2010-05-27 18:59 bvassche
+
+ * include/net-snmp/library/check_varbind.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/snmp_client.h,
+ win32/libsnmp/Makefile.in, win32/libsnmp/libsnmp.dsp,
+ win32/libsnmp_dll/Makefile.in, win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ Win32 build fixes.
+
+2010-05-27 18:24 bvassche
+
+ * testing/RUNFULLTESTS:
+
+ "make test" without TAP::Harness (was broken by r18802).
+
+2010-05-27 15:15 bvassche
+
+ * agent/mibgroup/mibII/interfaces.c,
+ include/net-snmp/library/lcd_time.h,
+ include/net-snmp/library/md5.h, include/net-snmp/library/scapi.h,
+ include/net-snmp/library/snmp_debug.h, snmplib/lcd_time.c,
+ snmplib/md5.c, snmplib/scapi.c, snmplib/snmp_debug.c,
+ snmplib/transports/snmpIPv4BaseDomain.c:
+
+ Fixed several compiler warnings. Most fixes involved adding the
+ "const" keyword.
+
+2010-05-27 13:52 jsafranek
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ CHANGES: snmpd: BUG: 2972579: fixed checking of
+ snmpTargetAddrRowStatus SET requests.
+
+2010-05-27 13:41 hardaker
+
+ * testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_run:
+
+ revert part of 18885: test files should be able to be run by
+ themselves too
+
+2010-05-27 11:19 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ include/net-snmp/data_access/interface.h:
+
+ CHANGES: correctly calculate ifXTable.ifHCInUcastPkts on 32-bit
+ Linux
+
+ Linux does not provide standalone counter for incoming unicast
+ packets (iucast)
+ - it provides counter of all packets (iall) + separate counter
+ for the multicast
+ ones (imcast). Previous implementation of ifTable read these
+ counters and
+ calculated iucast = iall - imcast *before* these values were
+ expanded into
+ 64bits. This produced errors on 32bit systems when iall
+ overflowed to zero and
+ imcast was nozero -> iucast got negative and 'c64 32 bit check
+ failed' error in
+ snmpd log. Now the agent expands these values to 64bits first and
+ * *then* performs the calculation, using a new flag.
+ 2010-05-27 08:18 magfr
+
+
+ * testing/RUNFULLTESTS, testing/RUNTESTS,
+ testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_run:
+
+ CHANGES: testing: Move the setting of MIBDIRS from the support
+ script to the drivers since it is needed for the C tests as well.
+
+2010-05-27 08:09 magfr
+
+ * testing/RUNTESTS:
+
+ CHANGES: testing: Use olducd_run, not run_olducd. Change srcdir
+ to refer to the top directory and not the testing subdirectory as
+ that is what is expected in the test scripts.
+
+2010-05-27 05:17 hardaker
+
+ * testing/fulltests/snmpv3/T020hashtests_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ warning squashing
+
+2010-05-27 05:16 hardaker
+
+ * include/net-snmp/library/keytools.h,
+ include/net-snmp/library/lcd_time.h, snmplib/keytools.c,
+ snmplib/lcd_time.c:
+
+ more const correctness
+
+2010-05-27 04:18 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ tests for agent-not-known-user-certificates
+
+2010-05-27 04:16 hardaker
+
+ * README.snmpv3:
+
+ reference the itnernal support and related documentation
+
+2010-05-27 04:16 hardaker
+
+ * snmplib/openssl/OPENSSL-LICENSE, snmplib/openssl/README:
+
+ internal OpenSSL support documentation
+
+2010-05-27 04:16 hardaker
+
+ * configure, configure.d/config_project_with_enable:
+
+ NEWS: libnetsnmp: Support for a stream-line stripped down version
+ of internal OpenSSL support using --with-openssl=internal
+
+2010-05-27 04:15 hardaker
+
+ * include/net-snmp/library/openssl_aes.h,
+ include/net-snmp/library/openssl_des.h,
+ include/net-snmp/openssl_md5.h,
+ snmplib/openssl/openssl_aes_cfb.c,
+ snmplib/openssl/openssl_aes_local.h,
+ snmplib/openssl/openssl_des_local.h,
+ snmplib/openssl/openssl_set_key.c, snmplib/openssl/openssl_spr.h,
+ snmplib/scapi.c:
+
+ remove more dependencies for external openssl headers
+
+2010-05-27 04:15 hardaker
+
+ * configure, configure.d/config_os_libs, snmplib/openssl,
+ snmplib/openssl/openssl_aes_cfb.c,
+ snmplib/openssl/openssl_aes_core.c,
+ snmplib/openssl/openssl_aes_local.h,
+ snmplib/openssl/openssl_cbc_enc.c,
+ snmplib/openssl/openssl_cfb128.c,
+ snmplib/openssl/openssl_des_enc.c,
+ snmplib/openssl/openssl_des_local.h,
+ snmplib/openssl/openssl_md32_common.h,
+ snmplib/openssl/openssl_md5.c,
+ snmplib/openssl/openssl_md5_local.h,
+ snmplib/openssl/openssl_modes.h,
+ snmplib/openssl/openssl_ncbc_enc.c,
+ snmplib/openssl/openssl_set_key.c, snmplib/openssl/openssl_sha.h,
+ snmplib/openssl/openssl_sha1.c,
+ snmplib/openssl/openssl_sha_local.h,
+ snmplib/openssl/openssl_spr.h, snmplib/openssl_aes_cfb.c,
+ snmplib/openssl_aes_core.c, snmplib/openssl_aes_local.h,
+ snmplib/openssl_cbc_enc.c, snmplib/openssl_cfb128.c,
+ snmplib/openssl_des_enc.c, snmplib/openssl_des_local.h,
+ snmplib/openssl_md32_common.h, snmplib/openssl_md5.c,
+ snmplib/openssl_md5_local.h, snmplib/openssl_modes.h,
+ snmplib/openssl_ncbc_enc.c, snmplib/openssl_set_key.c,
+ snmplib/openssl_sha.h, snmplib/openssl_sha1.c,
+ snmplib/openssl_sha_local.h, snmplib/openssl_spr.h:
+
+ move openssl code into a subdirectory
+
+2010-05-27 04:13 hardaker
+
+ * testing/fulltests/default/Sv3usmconfigbase,
+ testing/fulltests/default/T023snmpv3getMD5AES_olducd,
+ testing/fulltests/default/T023snmpv3getMD5DES_olducd,
+ testing/fulltests/default/T024snmpv3getSHA1_olducd,
+ testing/fulltests/default/T025snmpv3getSHADES_olducd,
+ testing/fulltests/default/T026snmpv3getSHAAES_olducd,
+ testing/fulltests/default/T030snmpv3usercreation_olducd,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_olducd,
+ testing/fulltests/default/T049snmpv3informpriv_olducd,
+ testing/fulltests/default/T050snmpv3trap_olducd:
+
+ fix testing so it uses multiple types of crypto
+
+2010-05-27 04:13 hardaker
+
+ * acconfig.h, configure, configure.d/config_os_libs,
+ include/net-snmp/net-snmp-config.h.in:
+
+ definitions and files for doing internal crypto support
+
+2010-05-27 04:12 hardaker
+
+ * snmplib/scapi.c:
+
+ include internal aes/des headers
+
+2010-05-27 04:12 hardaker
+
+ * snmplib/openssl_cfb128.c:
+
+ localize
+
+2010-05-27 04:12 hardaker
+
+ * snmplib/openssl_cfb128.c, snmplib/openssl_modes.h:
+
+ inital copies of cfb128 modes from openssl
+
+2010-05-27 04:11 hardaker
+
+ * snmplib/openssl_aes_core.c:
+
+ localize
+
+2010-05-27 04:11 hardaker
+
+ * snmplib/openssl_aes_core.c, snmplib/openssl_aes_local.h:
+
+ initial versions of aes_core.c and aes_locl.h
+
+2010-05-27 04:10 hardaker
+
+ * include/net-snmp/library/openssl_aes.h:
+
+ initial copy of aes.h from openssl
+
+2010-05-27 04:10 hardaker
+
+ * snmplib/openssl_aes_cfb.c:
+
+ initial copy of the openssl aes_cfb.c file
+
+2010-05-27 04:10 hardaker
+
+ * snmplib/openssl_des_enc.c:
+
+ include localized copies of the files
+
+2010-05-27 04:09 hardaker
+
+ * snmplib/scapi.c:
+
+ use internal DES
+
+2010-05-27 04:09 hardaker
+
+ * snmplib/openssl_cbc_enc.c:
+
+ localized copy of the cbc_enc.c file from openssl
+
+2010-05-27 04:09 hardaker
+
+ * snmplib/openssl_spr.h:
+
+ des/spr.h from openssl
+
+2010-05-27 04:08 hardaker
+
+ * snmplib/openssl_des_enc.c:
+
+ added des_enc.c from openssl
+
+2010-05-27 04:08 hardaker
+
+ * include/net-snmp/library/openssl_des.h,
+ include/net-snmp/library/openssl_md5.h,
+ include/net-snmp/library/openssl_sha.h:
+
+ local copies of the openssl headers
+
+2010-05-27 04:07 hardaker
+
+ * include/net-snmp/library/openssl_des.h:
+
+ initial copy of openssl's des.h
+
+2010-05-27 04:07 hardaker
+
+ * snmplib/openssl_ncbc_enc.c, snmplib/openssl_set_key.c:
+
+ localized header files
+
+2010-05-27 04:07 hardaker
+
+ * snmplib/openssl_des_local.h, snmplib/openssl_ncbc_enc.c,
+ snmplib/openssl_set_key.c:
+
+ inital copies of some of the openssl DES files
+
+2010-05-27 04:06 hardaker
+
+ * snmplib/keytools.c, snmplib/scapi.c:
+
+ finishing porting of internal auth support
+
+2010-05-27 04:06 hardaker
+
+ * configure, configure.d/config_os_libs, snmplib/Makefile.in:
+
+ add internal crypto files to the check/use list
+
+2010-05-27 04:06 hardaker
+
+ * snmplib/md32_common.h, snmplib/md5_locl.h,
+ snmplib/openssl_md32_common.h, snmplib/openssl_md5.c,
+ snmplib/openssl_md5_local.h, snmplib/openssl_sha1.c,
+ snmplib/openssl_sha_local.h, snmplib/sha_locl.h:
+
+ localized file names with openssl prefixes
+
+2010-05-27 04:05 hardaker
+
+ * include/net-snmp/openssl_md5.h, snmplib/md5_locl.h,
+ snmplib/openssl_md5.c:
+
+ localize the md5 implementation
+
+2010-05-27 04:05 hardaker
+
+ * snmplib/openssl_sha.h, snmplib/openssl_sha1.c,
+ snmplib/sha_locl.h:
+
+ completely localize the openssl SHA support
+
+2010-05-27 04:04 hardaker
+
+ * snmplib/openssl_sha.h:
+
+ initial verison of sha.h copy
+
+2010-05-27 04:04 hardaker
+
+ * snmplib/md32_common.h, snmplib/md5_locl.h, snmplib/openssl_md5.c,
+ snmplib/openssl_sha1.c, snmplib/sha_locl.h:
+
+ added local copies of the openssl crypto functions
+
+2010-05-27 04:04 hardaker
+
+ * snmplib/keytools.c:
+
+ make use of internal crypto hash functions
+
+2010-05-27 04:03 hardaker
+
+ * configure, configure.d/config_os_libs,
+ configure.d/config_os_misc2,
+ configure.d/config_project_with_enable,
+ include/net-snmp/net-snmp-config.h.in:
+
+ configure checks for internal-crypto support
+
+2010-05-26 22:17 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmp_api.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ testing/fulltests/transports/Stlstests:
+
+ properly verify expected server certificates under DTLS; add a
+ new flag in tlsbase to indicate verification has occurred
+
+2010-05-26 21:02 hardaker
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ compiler warning squashing
+
+2010-05-26 21:02 hardaker
+
+ * include/net-snmp/library/lcd_time.h,
+ include/net-snmp/library/scapi.h, snmplib/lcd_time.c,
+ snmplib/scapi.c:
+
+ add const qualifiers to a few places
+
+2010-05-26 19:46 bvassche
+
+ * agent/Makefile.in, agent/helpers/Makefile.in,
+ snmplib/Makefile.in:
+
+ CHANGES: Cygwin: libnetsnmpmibs, libnetsnmphelpers and
+ libnetsnmpagent do now build as a DLL when configured with
+ --enable-shared.
+
+2010-05-26 17:47 bvassche
+
+ * agent/Makefile.in, agent/helpers/Makefile.in:
+
+ NEWS: moved all functions defined in libnetsnmphelpers to
+ libnetsnmpagent. libnetsnmphelpers is now an empty library.
+
+2010-05-26 17:20 bvassche
+
+ * agent/Makefile.in, agent/bulk_to_next.c,
+ agent/helpers/Makefile.in, agent/helpers/bulk_to_next.c,
+ agent/helpers/null.c, agent/helpers/old_api.c, agent/null.c,
+ agent/old_api.c:
+
+ Reverted r18829 in order to minimize diffs with older branches.
+
+2010-05-25 07:23 magfr
+
+ * testing/fulltests/transports/Stls:
+
+ Tell net-snmp-cert where net-snmp-config is located
+
+2010-05-25 07:14 magfr
+
+ * testing/fulltests/support/clib_build:
+
+ Correct the signature of main. Use #include instead of sourcing
+ to get the code under test in order to get better error messages
+
+2010-05-25 07:11 magfr
+
+ * testing/fulltests/unit-tests/T001defaultstore_clib.c:
+
+ Add arguments to sprintf statements to make the test work
+
+2010-05-25 07:07 magfr
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T020hashtests_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c,
+ testing/fulltests/unit-tests/T002containers_clib.c:
+
+ Remove unused variables and disabled code
+
+2010-05-25 05:20 magfr
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend,
+ include/net-snmp/library/snmpIPBaseDomain.h,
+ include/net-snmp/library/snmpIPv4BaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpSocketBaseDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/Makefile.depend, snmplib/transports/snmpIPBaseDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpSocketBaseDomain.c:
+
+ CHANGES: snmplib: Split snmpIPBaseDomain and move the IPv4 parts
+ to IPv4Base and the socket generic parts to SocketBase.
+
+2010-05-24 20:24 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ fix compiler warning; finish tlstmParamsTable lastChanged scalar
+
+2010-05-24 19:28 magfr
+
+ * testing/fulltests/support/capp_build,
+ testing/fulltests/support/clib_build:
+
+ Add --external-libs in order to support building the tests on
+ solaris
+
+2010-05-24 13:33 rstory
+
+ * agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c:
+
+ argh.. fix fallout from manually (mis)applying patch
+
+2010-05-24 12:59 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmParamsTable,
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h:
+
+ first pass at tlstmParamsTable
+
+2010-05-24 12:59 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h:
+
+ update defines to match MIB names, per grand-poobah
+
+2010-05-24 12:58 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.c:
+
+ update OID to match upcoming RFC
+
+2010-05-24 11:48 bvassche
+
+ * agent/Makefile.in, agent/bulk_to_next.c,
+ agent/helpers/Makefile.in, agent/helpers/bulk_to_next.c,
+ agent/helpers/null.c, agent/helpers/old_api.c, agent/null.c,
+ agent/old_api.c:
+
+ CHANGES: libnetsnmpagent, libnetsnmphelpers: moved the functions
+ netsnmp_bulk_to_next_fix_requests(),
+ netsnmp_get_bulk_to_next_handler(), netsnmp_register_null(),
+ netsnmp_register_null_context() and netsnmp_register_old_api()
+ from libnetsnmphelpers to libnetsnmpagent.
+ Notes:
+ - This does not affect backwards compatibility for applications
+ that link with $(net-snmp-config --agent-libs) since this
+ involves linking with both libnetsnmphelpers and libnetsnmpagent.
+ - Functions have been moved between libraries by moving entire
+ source files.
+
+2010-05-24 10:10 jsafranek
+
+ * agent/mibgroup/hardware/fsys/fsys_getfsstats.c,
+ agent/mibgroup/hardware/fsys/fsys_mntent.c:
+
+ Use proper string sizes and make sure strings are
+ zero-terminated.
+
+2010-05-24 08:01 bvassche
+
+ * configure, configure.d/config_os_progs, net-snmp-config.in,
+ snmplib/Makefile.in:
+
+ CHANGES: Cygwin: libnetsnmp does now build as a DLL when
+ configured with --enable-shared.
+ CHANGES: Cygwin: perl modules do now build (--with-perl-modules).
+ Note: the T060trapdperl_olducd, T061agentperl_olducd and
+ T115agentxperl_olducd tests still fail.
+
+2010-05-23 23:06 rstory
+
+ * agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c:
+
+ update filenames/patsh for recent file renames; fix typos
+
+2010-05-23 22:08 magfr
+
+ * net-snmp-config.in, testing/fulltests/support/capp_build,
+ testing/fulltests/support/clib_build:
+
+ CHANGES: building: Use the same compiler command and flags for
+ building of tests as for building of the code, thus enabling test
+ of e.g. 32-bit code compiled on a 64-bit platform.
+
+2010-05-23 21:41 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h:
+
+ update include/config file/paths for recent renames
+
+2010-05-23 21:31 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable_persist.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/tlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/tlstmAddrTable_persist.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/tlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/tlstmCertToTSNTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable.h:
+
+ rename files for MIB renames
+
+2010-05-23 21:25 rstory
+
+ * agent/mibgroup/tlstm-mib/snmpTlstmAddrTable,
+ agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable:
+
+ rename directories to match renames in MIB
+
+2010-05-20 08:48 bvassche
+
+ * net-snmp-config.in:
+
+ Swapped link order of -lnetsnmphelpers -lnetsnmpmibs: netsnmpmibs
+ depends on netsnmphelpers and not the other way around.
+
+2010-05-20 08:42 bvassche
+
+ * apps/snmptrapd_log.c, snmplib/snmp_transport.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c:
+
+ Fixed more compiler warnings.
+
+2010-05-19 18:26 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix stashing
+
+2010-05-19 18:25 hardaker
+
+ * testing/RUNFULLTESTS,
+ testing/fulltests/transports/T361tlstcp_olducd,
+ testing/fulltests/unit-tests/T001defaultstore_clib.c,
+ testing/fulltests/unit-tests/T002containers_clib.c:
+
+ output filenames of failed tests
+
+2010-05-19 18:25 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ wipe trailing comment C marker if it exists
+
+2010-05-19 18:25 hardaker
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T020hashtests_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ title the SNMPv3 tests
+
+2010-05-19 18:25 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix testing of built titles
+
+2010-05-19 18:24 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ only print failure header if there was at least one
+
+2010-05-19 18:24 hardaker
+
+ * testing/RUNFULLTESTS,
+ testing/fulltests/default/T049snmpv3inform_olducd,
+ testing/fulltests/default/T049snmpv3informauth_olducd,
+ testing/fulltests/default/T049snmpv3informpriv_olducd:
+
+ make descriptive titles work again
+
+2010-05-19 18:24 hardaker
+
+ * testing/RUNFULLTESTS, testing/fulltests/support/build_capp,
+ testing/fulltests/support/build_clib,
+ testing/fulltests/support/capp_build,
+ testing/fulltests/support/clib_build,
+ testing/fulltests/support/olducd_run,
+ testing/fulltests/support/run_olducd:
+
+ rename files so prefixing is based on the suite name, not file
+ type
+
+2010-05-19 17:52 bvassche
+
+ * perl/ASN/Makefile.PL, perl/Makefile.PL, perl/Makefile.subs.pl,
+ perl/OID/Makefile.PL, perl/SNMP/Makefile.PL,
+ perl/TrapReceiver/Makefile.PL, perl/agent/Makefile.PL,
+ perl/agent/Support/Makefile.PL,
+ perl/agent/default_store/Makefile.PL,
+ perl/default_store/Makefile.PL:
+
+ CHANGES: Cygwin: perl: building the Perl modules with the Cygwin
+ Perl package is now possible.
+ (Forward-ported r18688 from the V5.5 branch.)
+
+2010-05-19 17:50 bvassche
+
+ * agent/mibgroup/examples/delayed_instance.c:
+
+ Fixed yet another compiler warning.
+
+2010-05-19 12:05 dts12
+
+ * agent/mibgroup/hardware/fsys.h,
+ agent/mibgroup/hardware/fsys/fsys_mntctl.c:
+
+ First-draft support for AIX filesystem HAL module (untested)
+
+2010-05-19 11:25 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c:
+
+ Support for Solaris-style 'getmntent' API.
+
+2010-05-19 09:57 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/mnttypes.h:
+
+ Simplify the handling of unknown/unwanted file systems.
+
+2010-05-19 09:30 dts12
+
+ * agent/mibgroup/hardware/fsys/hw_fsys.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.h,
+ agent/mibgroup/host/hrh_filesys.c,
+ include/net-snmp/agent/hardware/fsys.h:
+
+ Fix missing/broken API declarations.
+
+2010-05-19 08:46 bvassche
+
+ * testing/fulltests/support/run_olducd:
+
+ Made error messages more clear in case of failure or wrong
+ invocation.
+
+2010-05-19 00:01 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ added test for using a certificate signed by a CA certificate
+
+2010-05-18 23:31 tanders
+
+ * testing/Makefile.in:
+
+ make sure we call the right Perl
+
+2010-05-18 20:39 bvassche
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c:
+
+ CHANGES: agent: include local port number in packet dumps. An
+ example:
+
+ Received 36 byte packet from UDP:
+ [127.0.0.1]:53909->[127.0.0.1]:1161
+ 0000: 30 22 02 01 01 04 06 70 75 62 6C 69 63 A1 15 02
+ 0".....public...
+ 0016: 04 37 F2 D4 9B 02 01 00 02 01 00 30 07 30 05 06
+ .7.........0.0..
+ 0032: 01 01 05 00 ....
+
+ Received SNMP packet(s) from UDP:
+ [127.0.0.1]:53909->[127.0.0.1]:1161
+ GETNEXT message
+ -- ccitt.1
+
+ Sending 118 bytes to UDP: [127.0.0.1]:53909->[127.0.0.1]:1161
+ 0000: 30 74 02 01 01 04 06 70 75 62 6C 69 63 A2 67 02
+ 0t.....public.g.
+ 0016: 04 37 F2 D4 9B 02 01 00 02 01 00 30 59 30 57 06
+ .7.........0Y0W.
+ 0032: 08 2B 06 01 02 01 01 01 00 04 4B 4C 69 6E 75 78
+ .+........KLinux
+ 0048: 20 61 73 75 73 20 32 2E 36 2E 33 33 2E 32 2D 73 asus
+ 2.6.33.2-s
+ 0064: 63 73 74 20 23 31 20 53 4D 50 20 50 52 45 45 4D cst #1 SMP
+ PREEM
+ 0080: 50 54 20 53 61 74 20 41 70 72 20 33 20 32 31 3A PT Sat Apr
+ 3 21:
+ 0096: 31 30 3A 35 38 20 43 45 53 54 20 32 30 31 30 20 10:58 CEST
+ 2010
+ 0112: 78 38 36 5F 36 34 x86_64
+
+2010-05-18 19:42 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_persist.c,
+
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c:
+
+ update tlstmAddrTable
+ - deal with hash type properly for get/set and persistence
+ - add count and last changed scalars
+
+2010-05-18 19:08 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c:
+
+ update to offical OID from upcoming rfc
+
+2010-05-18 16:16 rstory
+
+ * agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c:
+
+ update to official OIDs from upcoming RFC; add count/last changed
+ scalars
+
+2010-05-18 14:56 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: PATCH: 2001656: Handle null-termination of
+ string values properly.
+ Based on the principles of the patch from Tommy Beadle.
+
+2010-05-18 14:38 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.c,
+ agent/mibgroup/hardware/fsys/mnttypes.h, agent/mibgroup/host.h,
+ agent/mibgroup/host/hrh_filesys.c,
+ agent/mibgroup/host/hrh_filesys.h,
+ agent/mibgroup/host/hrh_storage.c,
+ agent/mibgroup/host/hrh_storage.h,
+ include/net-snmp/agent/hardware/fsys.h:
+
+ Working(?) HAL-based version of hrFSTable.
+
+2010-05-18 14:12 bvassche
+
+ * snmplib/tools.c:
+
+ Fixed a compiler warning.
+
+2010-05-17 21:03 hardaker
+
+ * include/net-snmp/library/snmp_secmod.h:
+
+ use proper TSM security code (4) now that it's official
+
+2010-05-17 18:43 hardaker
+
+ * testing/fulltests/unit-tests/T002containers_clib.c:
+
+ beginning of a container unit test
+
+2010-05-17 18:43 hardaker
+
+ * include/net-snmp/library/testing.h:
+
+ a basic C-code based test reporting mechanism
+
+2010-05-17 18:42 hardaker
+
+ * testing/fulltests/unit-tests,
+ testing/fulltests/unit-tests/T001defaultstore_clib.c:
+
+ basic default_store tests
+
+2010-05-17 18:42 hardaker
+
+ * testing/fulltests/support/build_clib:
+
+ a build system for basic libnetsnmp tests
+
+2010-05-17 18:14 rstory
+
+ *
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c,
+ include/net-snmp/library/cert_util.h:
+
+ fix fingerprint bin/hex conversion; add/remove cert sec maps via
+ mib now works
+
+2010-05-17 18:13 rstory
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ new function netsnmp_binary_to_hex
+
+2010-05-17 18:13 rstory
+
+ * snmplib/snmptsm.c:
+
+ fprintf(stderr -> DEBUGMSGTL((
+
+2010-05-17 18:12 rstory
+
+ * snmplib/cert_util.c:
+
+ move check for hash type
+
+2010-05-17 16:34 hardaker
+
+ * testing/RUNTESTS:
+
+ make RUNTESTS work outside the sourcedir
+
+2010-05-17 15:37 hardaker
+
+ * testing/Makefile.in, testing/RUNTESTS:
+
+ made a limited run test possible again without perl
+
+2010-05-17 15:32 dts12
+
+ * win32/mib_module_includes.h, win32/mib_module_inits.h,
+ win32/net-snmp/agent/mib_module_config.h,
+ win32/netsnmpmibs/Makefile.in, win32/netsnmpmibs/netsnmpmibs.dsp:
+
+ Use newer DisMan Event MIB code for MSVC-based builds
+ (in line with all configure-based builds)
+
+2010-05-17 15:23 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ move the return outside the if statement
+
+2010-05-17 15:18 dts12
+
+ * agent/mibgroup/hardware/fsys/hw_fsys.c,
+ include/net-snmp/agent/hardware/fsys.h:
+
+ Provide missing public interface to HAL-based filestore module.
+
+2010-05-17 10:41 bvassche
+
+ * win32/transports/snmp_transport_inits.h:
+
+ Follow-up for r18754 (revert r18738): r18754 only partially
+ reverted r18738
+ and hence broke the Win32-build. Finished reversal of r18738 by
+ restoring
+ win32/transports/snmp_transport_inits.h.
+
+2010-05-16 18:17 bvassche
+
+ * ltmain.sh:
+
+ Follow-up for r18726: only pass -fstack-protector* flags to the
+ linker instead of all -f* flags such that it becomes less likely
+ that this modification causes trouble with non-GNU toolchains.
+
+2010-05-16 18:14 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_olducd:
+
+ Made shell code for converting a relative path to an absolute
+ path more
+ robust and converted "${...#...}" construct into echo + cut.
+
+2010-05-16 18:12 bvassche
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/util_funcs.c,
+ apps/snmptrapd_handlers.c:
+
+ More USING_UCD_SNMP_EXTENSIBLE_MODULE to
+ USING_UTILITIES_EXECUTE_MODULE substitutions, necessary to make
+ test 059 and 065 pass.
+
+2010-05-16 17:32 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ fix tests for checking shutdown of applications to not report
+ false negatives
+
+2010-05-16 12:15 bvassche
+
+ * testing/fulltests/default/T059trapdtraphandle_olducd:
+
+ Made test T059 pass again. This test was recently broken by
+ passing arguments to it with absolute paths instead of relative
+ paths.
+
+2010-05-16 12:14 bvassche
+
+ * testing/fulltests/default/T065agentextend_olducd:
+
+ Added 'SKIPIFNOT USING_UTILITIES_EXECUTE_MODULE'.
+
+2010-05-16 11:42 bvassche
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmp_openssl.c:
+
+ Fixed several recently introduced compiler warnings.
+
+2010-05-16 11:41 bvassche
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c,
+ agent/mibgroup/host/hrSWInstalledTable.c,
+ agent/mibgroup/host/hrSWRunPerfTable.c,
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c,
+ apps/sshtosnmp.c:
+
+ Fixed several compiler warnings in old code.
+
+2010-05-16 09:59 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ CHANGES: Win32: winExtDLL: don't trigger a netsnmp_assert() when
+ no extension DLLs have been loaded.
+
+2010-05-15 17:31 tanders
+
+ * testing/RUNFULLTESTS:
+
+ stop-gap fix to unbreak "make test" for the nightly builds
+
+2010-05-15 10:59 bvassche
+
+ * agent/Makefile.in, agent/helpers/Makefile.in,
+ snmplib/Makefile.in:
+
+ Reverted r18727 because it caused build errors on Solaris, AIX
+ and HP-UX.
+
+2010-05-15 00:42 hardaker
+
+ * Makefile.in, configure, configure.d/config_modules_lib,
+ snmplib/Makefile.depend, snmplib/snmp_transport.c,
+ win32/build.pl:
+
+ revert r18738 since new transport require dynamicly built header
+ files
+
+2010-05-15 00:40 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ log env variables used to the invoked file
+
+2010-05-14 21:29 hardaker
+
+ * testing/fulltests/support/run_olducd:
+
+ fix script so it can be invoked outside the test environment
+ again
+
+2010-05-14 21:28 hardaker
+
+ * mibs/SNMP-TLS-TM-MIB.txt:
+
+ added the SNMP-TLS-TM-MIB with final IANA assignment slots
+
+2010-05-14 21:27 hardaker
+
+ * snmplib/snmptsm.c:
+
+ use final IANA assigned TSM prefixes
+
+2010-05-14 21:26 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h:
+
+ use final IANA assigned Domain numbers
+
+2010-05-14 21:25 hardaker
+
+ * snmplib/snmp_api.c, snmplib/transports/snmpTLSBaseDomain.c:
+
+ set default version and seclevel if tls/dtls
+
+2010-05-14 15:25 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ check rc from secname mapping; clarify comment
+
+2010-05-14 15:22 rstory
+
+ * snmplib/cert_util.c:
+
+ don't use unsorted container; don't free caller's container
+
+2010-05-14 15:22 rstory
+
+ * snmplib/container_binary_array.c:
+
+ add linear_search for unsorted containers
+
+2010-05-14 11:56 bvassche
+
+ * Makefile.in, configure, configure.d/config_modules_lib,
+ snmplib/Makefile.depend, snmplib/snmp_transport.c,
+ win32/build.pl, win32/transports/snmp_transport_inits.h:
+
+ Improved portability by removing the generated file
+ snmplib/transports/snmp_transport_inits.h.
+ Commented out the code in the configure script for generating
+ this header file.
+ Added configure-time code for checking whether the constructors
+ for all configured
+ transports are invoked from snmplib/snmp_transport.c.
+
+2010-05-14 11:00 bvassche
+
+ * README.win32:
+
+ Documentation: updated Cygwin build instructions.
+
+2010-05-14 09:15 bvassche
+
+ * agent/mibgroup/host/data_access/swinst_null.c,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/cert_util.c, snmplib/snmp_api.c, snmplib/snmp_openssl.c,
+ snmplib/snmpusm.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ Fixed several compiler warnings.
+
+2010-05-14 08:50 bvassche
+
+ * agent/Makefile.in, agent/helpers/Makefile.in,
+ snmplib/Makefile.in:
+
+ Added -no-undefined flag to library link commands such that
+ libtool can build DLLs on Win32.
+ Note: building DLLs on Win32 does not yet work because of the
+ circular dependency between
+ libnetsnmphelpers and libnetsnmpagent
+ (see also
+ http://www.net-snmp.org/wiki/index.php/Library_layering).
+
+2010-05-14 08:42 bvassche
+
+ * ltmain.sh:
+
+ libtool bug fix: also pass flags starting with -f to the linker
+ since these can affect linking. The flag -fstack-protector e.g.
+ triggers inclusion of libssp.
+
+2010-05-14 08:40 bvassche
+
+ * configure, configure.d/config_modules_lib,
+ configure.d/config_os_progs:
+
+ CHANGES: building: abort if the file program could not be found,
+ since this is essential for proper operation of libtool.
+ CHANGES: Cygwin: neither compile nor link winpipe.c.
+
+2010-05-13 08:58 bvassche
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ Ran autoreconf.
+
+2010-05-12 20:16 bvassche
+
+ * configure, configure.d/config_os_libs:
+
+ CHANGES: Linux: builds again with embedded Perl disabled (bug
+ 2985915).
+
+2010-05-12 19:47 bvassche
+
+ * agent/mibgroup/util_funcs/restart.c,
+ win32/netsnmpmibs/Makefile.in, win32/netsnmpmibs/netsnmpmibs.dsp:
+
+ Follow-up for r18684: un-break the Win32 MSVC build.
+
+2010-05-12 19:43 bvassche
+
+ * include/net-snmp/types.h:
+
+ Win32: fixed a typo and made indentation consistent.
+
+2010-05-12 19:11 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ construct temp build files in a separate directory
+
+2010-05-12 19:10 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix recently broken old perl functionality
+
+2010-05-12 18:01 hardaker
+
+ * local/net-snmp-cert:
+
+ added a --short option to shorten the show output to minimalistic
+
+2010-05-12 14:14 jsafranek
+
+ *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c:
+
+ CHANGES: snmpd: fixed a memory leak in TCP-MIB.
+
+2010-05-12 13:02 jsafranek
+
+ * agent/mibgroup/hardware/sensors/lmsensors_v3.c:
+
+ CHANGES: snmpd: fixed memory leak when reading sensors for
+ LM-SENSORS-MIB.
+
+2010-05-12 12:57 dts12
+
+ * perl/agent/agent.xs:
+
+ Revert revision 18689
+ Latest Win32 builds include support for strtoull.
+
+2010-05-12 12:05 jsafranek
+
+ * agent/mibgroup/hardware/sensors.h,
+ configure.d/config_modules_lib, configure.d/config_os_headers:
+
+ CHANGES: building: added detection of lm_sensors version.
+ I am not Autoconf guru, so I hope I got it right. The goal is to
+ define NETSNMP_USE_SENSORS_V3 *before* config_modules_agent
+ processes agent/mibgroup/hardware/sensors.h.
+
+2010-05-12 07:03 magfr
+
+ * include/net-snmp/library/snmpTLSTCPDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h:
+
+ CHANGES: snmplib: Add missing dependencies between transports.
+
+2010-05-12 03:08 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix title generation after change to what srcdir meant
+
+2010-05-12 02:30 hardaker
+
+ * local/net-snmp-cert:
+
+ undo last change which turned out to only cause errors if you had
+ a old .conf file around
+
+2010-05-12 02:13 hardaker
+
+ * local/net-snmp-cert:
+
+ fix v3_ca creation extension name
+
+2010-05-12 02:05 rstory
+
+ * snmplib/cert_util.c:
+
+ keep format version # in cert indexes; don't store hash type
+ string in index;
+
+2010-05-12 02:05 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ fix inverted conversion call; less verbose default debug
+
+2010-05-12 02:05 rstory
+
+ * snmplib/snmp_parse_args.c:
+
+ fix parsing of -T name/value pairs
+
+2010-05-11 23:33 tanders
+
+ * testing/RUNFULLTESTS:
+
+ bug fixing and better error messages for "make test" with
+ Test::Harness
+ (still doesn't work for me, though)
+
+2010-05-11 22:34 tanders
+
+ * testing/RUNFULLTESTS:
+
+ Do NOT hardcode /usr/bin/perl as the Perl path
+
+2010-05-11 20:16 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ fix stash file handling
+
+2010-05-11 20:16 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ long options suck ;-). prefer double dashes for long options to
+ match the rest of the Net-SNMP code base
+
+2010-05-11 20:16 hardaker
+
+ * testing/Makefile.in, testing/RUNFULLTESTS:
+
+ added ability to run only the failed tests from the last run
+
+2010-05-11 20:16 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ don't force color
+
+2010-05-11 20:16 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ cleanup of older
+
+2010-05-11 20:15 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ Minimally support the older Test::Harness perl module for running
+ the older tests at least
+
+2010-05-11 20:15 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmp_transport.h, snmplib/snmp_api.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ set a default securityName and securityModel if TLS or DTLS is in
+ use on the client side
+
+2010-05-11 20:15 hardaker
+
+ * include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmpusm.h, snmplib/snmp_api.c,
+ snmplib/snmpusm.c:
+
+ allow security models to perform more of the session setup; moved
+ more USM specific setup into it's setup routine
+
+2010-05-11 18:02 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ fix param to lookup peer cert
+
+2010-05-11 16:10 rstory
+
+ * snmplib/snmp_transport.c:
+
+ allow '-' in fqdn; add debug output for host specific config
+
+2010-05-11 15:46 dts12
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Ensure 'netsnmp_read_module' is available for perl build.
+
+2010-05-11 15:44 dts12
+
+ * perl/agent/agent.xs:
+
+ Fix perl build under Windows (strtoull not available)
+
+2010-05-10 07:07 magfr
+
+ * include/net-snmp/library/snmpSSHDomain.h,
+ snmplib/transports/snmpSSHDomain.c:
+
+ CHANGES: snmplib: Add missing symbol netsnmp_snmpSSHDomain_len,
+ make netsnmp_snmpSSHDomain const.
+
+2010-05-09 22:03 magfr
+
+ * testing/fulltests/default/T150solarishostcpu_olducd:
+
+ Do not require quotes around the CPU string as that depends on
+ how the agent is configured.
+
+2010-05-09 21:43 magfr
+
+ * agent/mibgroup/default_modules.h, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/util_funcs.h, agent/mibgroup/util_funcs/Exit.c,
+ agent/mibgroup/util_funcs/Exit.h,
+ agent/mibgroup/util_funcs/restart.c,
+ agent/mibgroup/util_funcs/restart.h:
+
+ CHANGES: snmpd: Extract the Exit and restart* subroutines from
+ util_func in order to make it possible to build less code for the
+ minimal case.
+
+2010-05-09 16:47 bvassche
+
+ * agent/mibgroup/util_funcs.c:
+
+ Fixed a compiler warning: made sure that the function
+ get_exec_output() returns a value when the preprocessor symbol
+ USING_UCD_SNMP_EXTENSIBLE_MODULE has not been defined.
+
+2010-05-09 16:45 bvassche
+
+ * configure, configure.d/config_modules_agent,
+ configure.d/config_modules_lib:
+
+ CHANGES: Cygwin: builds now also when the source files are
+ located on a Samba filesystem instead of a local filesystem.
+
+2010-05-09 13:05 magfr
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ Correct the if that tries to figure out if a sufficiently new gcc
+ is in use.
+
+2010-05-09 12:50 magfr
+
+ * apps/snmptrapd_handlers.c:
+
+ Check for the needed module and not some other one.
+ Log the correct missing symbol.
+
+2010-05-09 09:21 magfr
+
+ * agent/mibgroup/utilities/execute.c,
+ agent/mibgroup/utilities/execute.h:
+
+ CHANGES: snmpd: utilities/execute do not need anything from
+ util_funcs, so stop depending on it.
+
+2010-05-09 09:12 magfr
+
+ * agent/mibgroup/utilities/execute.c:
+
+ NEWS: snmpd: Removed the unused function xx_tokenize_exec_command
+ from utilities/execute.
+
+2010-05-09 09:01 magfr
+
+ * include/net-snmp/library/snmp_debug.h, snmplib/snmp_debug.c:
+
+ CHANGES: snmplib: Replace the debugging functions with dummies
+ when debugging is disabled.
+
+2010-05-09 08:02 magfr
+
+ * testing/fulltests/transports/T300udp_olducd:
+
+ Check that the UDP transport is enabled
+
+2010-05-09 08:01 magfr
+
+ * testing/fulltests/transports/Stransport,
+ testing/fulltests/transports/T300udp_olducd,
+ testing/fulltests/transports/T310tcp_olducd,
+ testing/fulltests/transports/T320udpv6_olducd,
+ testing/fulltests/transports/T330tcpv6_olducd,
+ testing/fulltests/transports/T350unix_olducd,
+ testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T361tlstcp_olducd:
+
+ Factor out check for mibII/system_mib
+
+2010-05-09 07:59 magfr
+
+ * testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ Add missing includes
+
+2010-05-08 23:16 magfr
+
+ * testing/RUNFULLTESTS:
+
+ Additionally fix make test for the uncommon case where builddir
+ == srcdir
+
+2010-05-08 22:55 magfr
+
+ * testing/Makefile.in, testing/RUNFULLTESTS,
+ testing/fulltests/support/build_capp,
+ testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_eval_tools.sh,
+ testing/fulltests/support/run_olducd:
+
+ CHANGES: testing: Make it possible to run the test suite from
+ anywhere.
+ Change the -D option to expect the path of the top source
+ directory.
+ Add an -srcdir option that is an alias for -D.
+ Add an -builddir option to designate the directory where the test
+ object is.
+ Put srcdir and builddir in the environment for the test scripts
+ Factor out the grep part of SKIPIF and SKIPIFNOT to ISDEFINED
+ Use more readable keys in the opts hash in RUNFULLTESTS
+ Adjust everything to use srcdir and builddir
+
+2010-05-08 22:42 magfr
+
+ * testing/fulltests/snmpv3/T040keymanagetest_capp.c:
+
+ Use correct argument types
+
+2010-05-08 22:07 magfr
+
+ * Makefile.in:
+
+ Consolidate the test and test-mibs targets.
+ Expose the testall target in the top makefile.
+
+2010-05-08 22:05 magfr
+
+ * snmplib/snmp_transport.c:
+
+ Do not abort when str is NULL as that is a perfectly valid input.
+
+2010-05-08 22:03 magfr
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c:
+
+ Use correct argument types
+
+2010-05-08 22:02 magfr
+
+ * testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ Add missing newline
+
+2010-05-07 21:11 rstory
+
+ * configure:
+
+ update for new configure.ac
+
+2010-05-07 19:21 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c:
+
+ fix handling of cert algorithm in fingerprints; convert in/out
+ fingerpints
+ from/to hex
+
+2010-05-07 19:21 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ dont specify hash type for fingerprint
+
+2010-05-07 19:21 rstory
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmp_openssl.h, snmplib/cert_util.c,
+ snmplib/snmp_openssl.c:
+
+ handle fingerprint types; drop san fields from cert struct;
+ consider directory
+ when partnering keys/certs
+
+2010-05-07 19:20 rstory
+
+ * configure.ac:
+
+ move default prompts earlier
+
+2010-05-06 15:40 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ better SAN extraction; tweak dubgus messages; quiet compiler
+ warnings
+
+2010-05-06 15:39 rstory
+
+ * snmplib/cert_util.c:
+
+ reduce cert debug output; debug instead of log_info in dumps
+
+2010-05-06 14:49 dts12
+
+ * snmplib/inet_ntop.c, snmplib/inet_pton.c:
+
+ Don't assume the presence of <string.h>
+ (bring into line with all other occurances)
+
+2010-05-06 14:41 dts12
+
+ * apps/snmptrapd.c, apps/snmptrapd_log.c, snmplib/callback.c:
+
+ CHANGES: Windows: Fix build under MinGW
+ back/forward port of revision 18631
+
+2010-05-05 17:43 rstory
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix type in log msg
+
+2010-05-05 17:43 rstory
+
+ * local/net-snmp-cert:
+
+ remove import for unused function
+
+2010-05-04 07:12 magfr
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ Negate reason given from SKIPIF
+
+2010-05-03 22:38 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ fix len in email cmp; more extract debugging
+
+2010-05-03 22:38 rstory
+
+ * snmplib/cert_util.c:
+
+ copy ocert to addional maps
+
+2010-05-03 14:20 marz
+
+ * local/net-snmp-cert:
+
+ remove dependency on perl module not present in CentOS
+
+2010-05-03 03:49 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ don't access struct internals directly
+
+2010-05-03 03:48 rstory
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/util_funcs.c,
+ apps/snmptrapd_handlers.c:
+
+ fix compiling with-out-mibmodules=utilities/execute
+
+2010-05-01 19:08 magfr
+
+ * testing/fulltests/default/T150solarishostcpu_olducd:
+
+ Correct the sought string to make the test pass when ok.
+
+2010-05-01 17:15 marz
+
+ * local/net-snmp-cert:
+
+ more consistent treatment of keyUsage, basicConstraints, other
+ x509v3 options
+
+2010-04-30 23:37 marz
+
+ * local/certgen-test.pl:
+
+ lame test script but covers a chunk of the code
+
+2010-04-30 23:00 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ mkinstalldirs instead instead of File::Path
+
+2010-04-30 23:00 hardaker
+
+ * testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/run_olducd:
+
+ ensure net-snmp-config script can be run from the build dir
+
+2010-04-30 21:31 marz
+
+ * local/net-snmp-cert:
+
+ handle gencert --ca
+
+2010-04-30 21:01 rstory
+
+ * snmplib/cert_util.c:
+
+ add help for certSecName; continue building cert indexes even if
+ we cant save
+ to persistent dir
+
+2010-04-30 20:48 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ fix check count for 822 names in the snmpd.log
+
+2010-04-30 20:48 hardaker
+
+ * snmplib/snmp_openssl.c, testing/fulltests/transports/Stlstests:
+
+ fix malloc unnderlength by 1 error
+
+2010-04-30 20:48 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ comment out the 822 tests; they're broken at the moment
+
+2010-04-30 19:36 marz
+
+ * local/net-snmp-cert:
+
+ don't lose SAN when signing w/ CA
+
+2010-04-30 18:46 hardaker
+
+ * snmplib/cert_util.c:
+
+ make name change to rfc822 from typoed 8220
+
+2010-04-30 18:46 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ added tests to do other subjectAltName mapping
+
+2010-04-30 17:31 marz
+
+ * local/net-snmp-cert:
+
+ fix issues 1,2,4 and -C handling
+
+2010-04-29 03:32 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c:
+
+ update tlstmCertToTSNTable to use cache + cert_util maps
+ container
+
+2010-04-29 03:31 rstory
+
+ * agent/helpers/table_tdata.c:
+
+ check insert return
+
+2010-04-29 03:31 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container_binary_array.c:
+
+ NEWS: snmplib: add remove function to container iterator;
+ implement it for
+ binary_array
+
+2010-04-29 03:31 rstory
+
+ * snmplib/container_binary_array.c:
+
+ make sure container sync incremented on sort, insert and remove
+
+2010-04-28 07:20 bvassche
+
+ * snmplib/inet_ntop.c:
+
+ Removed an obsolete comment.
+
+2010-04-28 00:33 hardaker
+
+ * testing/Makefile.in:
+
+ fix makefile for test target
+
+2010-04-28 00:33 hardaker
+
+ * testing/Makefile.in, testing/RUNFULLTESTS,
+ testing/fulltests/support/build_capp:
+
+ make the test suite run outside the source directory again.
+
+2010-04-28 00:33 hardaker
+
+ * testing/fulltests/transports/Stls:
+
+ deal with out-of-source tree building
+
+2010-04-28 00:32 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests:
+
+ testing to check certificate to securityname mappings and denials
+
+2010-04-28 00:32 hardaker
+
+ * testing/fulltests/transports/Stls:
+
+ created a mapped user
+
+2010-04-28 00:32 hardaker
+
+ * testing/fulltests/support/build_capp:
+
+ generate object code with -g debugging
+
+2010-04-28 00:32 hardaker
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c:
+
+ more accurate current API usage for scapi code
+
+2010-04-27 21:13 rstory
+
+ * snmplib/cert_util.c:
+
+ fix cert init duplicate call check
+
+2010-04-27 20:58 rstory
+
+ * snmplib/cert_util.c, snmplib/snmp_api.c:
+
+ convert user fingerprint to lower and strip colons; add extern
+ prototype
+ for cert init so we don't need header
+
+2010-04-27 20:15 rstory
+
+ * include/net-snmp/library/cert_util.h, man/snmpd.conf.5.def,
+ snmplib/cert_util.c, snmplib/snmp_api.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ separate cert init and cert loading; add certSecName config token
+
+2010-04-27 03:18 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ merge NETSNMP_FUNCTION and !NETSNMP_FUNCTION assert cases
+
+2010-04-27 03:02 rstory
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmp_openssl.h, snmplib/cert_util.c,
+ snmplib/snmp_openssl.c, snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ lots of new cert functionality
+ - add ssl funcs for cert extensions and ssl cert chains
+ - functions and new netsmp_cert_map struct for looking up cert
+ mappings
+ - add certificate mapping for secname
+ - add code to build cert chains
+ - add subject to cert index cache
+ - rebuild indexes if any error while parsing index
+ - reformat dump output
+ - add NS_CERT_CA allowed_use flag
+ - add subject, issuer and issuer_cert to netsnmp_cert
+ - move cert container setup to its own function
+ - add cert subject name subcontainer
+
+2010-04-27 03:02 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c:
+
+ move ipv6 specific var decl inside ifdef
+
+2010-04-27 03:02 rstory
+
+ * agent/helpers/table_tdata.c,
+ include/net-snmp/agent/table_tdata.h:
+
+ CHANGES: agent: tdata helper now saves flags passed during
+ creation; add tdata
+ flag to NOT create the table container
+
+2010-04-27 03:01 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c,
+ snmplib/container_binary_array.c:
+
+ NEWS: snmplib: add interface for duplicating a container
+ CHANGES: snmplib: container changes: add flags field to container
+ meta-data;
+ chg binary_array container to use container meta-data flags
+
+2010-04-26 22:32 hardaker
+
+ * testing/fulltests/transports/Stlstests:
+
+ added a test to verify that when the transport is configured with
+ a remote certificate fingerprint the connection is denied
+
+2010-04-26 22:32 hardaker
+
+ * testing/fulltests/transports/Stls,
+ testing/fulltests/transports/Stlstests,
+ testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T361tlstcp_olducd:
+
+ added tests for -T flag usage and invalid user usage
+
+2010-04-26 20:54 hardaker
+
+ * testing/fulltests/transports/T399alias_olducd:
+
+ have the alias transport source the right Sv3config file
+
+2010-04-26 20:50 hardaker
+
+ * testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T361tlstcp_olducd:
+
+ working support of TLS/DTLS testing including cert generation
+
+2010-04-26 20:49 hardaker
+
+ * local/net-snmp-cert:
+
+ honor the config dir if specified via -C
+
+2010-04-26 20:49 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ fix realloc call for buffered packets
+
+2010-04-26 20:49 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ proper skip output for reporting reason
+
+2010-04-26 20:49 hardaker
+
+ * testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c:
+
+ remove trailing whitespace after backslash in macro
+
+2010-04-26 20:48 hardaker
+
+ * testing/fulltests/transports,
+ testing/fulltests/transports/Stransport,
+ testing/fulltests/transports/T300udp_olducd,
+ testing/fulltests/transports/T310tcp_olducd,
+ testing/fulltests/transports/T320udpv6_olducd,
+ testing/fulltests/transports/T330tcpv6_olducd,
+ testing/fulltests/transports/T350unix_olducd,
+ testing/fulltests/transports/T360dtlsudp_olducd,
+ testing/fulltests/transports/T361tlstcp_olducd,
+ testing/fulltests/transports/T399alias_olducd,
+ testing/fulltests/transports/test-localhost.cert,
+ testing/fulltests/transports/test-localhost.priv,
+ testing/fulltests/transports/test-user.cert,
+ testing/fulltests/transports/test-user.priv:
+
+ tests for minimally testing all the transports
+
+2010-04-26 20:48 hardaker
+
+ * testing/README:
+
+ minimally document new RUNFULLTESTS script
+
+2010-04-26 20:48 hardaker
+
+ * testing/T.c, testing/T2.sh, testing/data.keychange-md5,
+ testing/data.keychange-sha1, testing/data.keychange-sha1-des,
+ testing/data.kul-md5, testing/data.kul-sha1, testing/misctest.c,
+ testing/test_keychange.sh, testing/test_kul.sh:
+
+ deleted old files not worth restoring
+
+2010-04-26 20:48 hardaker
+
+ * testing/eval_testlist:
+
+ remove obsolute test list
+
+2010-04-26 20:47 hardaker
+
+ * testing/fulltests/snmpv3/T020hashtests_capp.c:
+
+ a hash-testing .c file I had laying around
+
+2010-04-26 20:47 hardaker
+
+ * testing/Makefile.in:
+
+ make testall target
+
+2010-04-26 20:47 hardaker
+
+ * testing/RUNFULLTESTS, testing/etimetest.c,
+ testing/fulltests/snmpv3,
+ testing/fulltests/snmpv3/T010scapitest_capp.c,
+ testing/fulltests/snmpv3/T040keymanagetest_capp.c,
+ testing/fulltests/snmpv3/T050etimetest_capp.c,
+ testing/fulltests/support/build_capp,
+ testing/fulltests/support/olducd_eval_tools.sh,
+ testing/keymanagetest.c, testing/scapitest.c:
+
+ move old C-code tests in place
+
+2010-04-26 20:47 hardaker
+
+ * testing/fulltests/default/T150solarishostcpu_olducd,
+ testing/fulltests/default/T151solarishostdisk_olducd,
+ testing/fulltests/default/T153solarisswap_olducd:
+
+ skip solaris comments
+
+2010-04-26 20:46 hardaker
+
+ * testing/Makefile.in:
+
+ fix invocation of RUNFULLTESTS
+
+2010-04-26 20:46 hardaker
+
+ * testing/Makefile.in, testing/fulltests/default,
+ testing/fulltests/default/Sv1config,
+ testing/fulltests/default/Sv2cconfig,
+ testing/fulltests/default/Sv3config,
+ testing/fulltests/default/Sv3usmconfigagent,
+ testing/fulltests/default/Sv3usmconfigbase,
+ testing/fulltests/default/Sv3usmconfigtrapd,
+ testing/fulltests/default/Sv3vacmconfig,
+ testing/fulltests/default/Svacmconfig,
+ testing/fulltests/default/Svanyconfig,
+ testing/fulltests/default/T001snmpv1get_olducd,
+ testing/fulltests/default/T014snmpv2cget_olducd,
+ testing/fulltests/default/T015snmpv2cgetnext_olducd,
+ testing/fulltests/default/T0160snmpv2cbulkget_olducd,
+ testing/fulltests/default/T016snmpv2cgetfail_olducd,
+ testing/fulltests/default/T017snmpv2ctov1getfail_olducd,
+ testing/fulltests/default/T018snmpv1tov2cgetfail_olducd,
+ testing/fulltests/default/T019snmpv2cnosuch_olducd,
+ testing/fulltests/default/T020snmpv3get_olducd,
+ testing/fulltests/default/T021snmpv3getnext_olducd,
+ testing/fulltests/default/T0220snmpv3bulkget_olducd,
+ testing/fulltests/default/T022snmpv3getMD5_olducd,
+ testing/fulltests/default/T023snmpv3getMD5AES_olducd,
+ testing/fulltests/default/T023snmpv3getMD5DES_olducd,
+ testing/fulltests/default/T024snmpv3getSHA1_olducd,
+ testing/fulltests/default/T025snmpv3getSHADES_olducd,
+ testing/fulltests/default/T026snmpv3getSHAAES_olducd,
+ testing/fulltests/default/T028snmpv3getfail_olducd,
+ testing/fulltests/default/T030snmpv3usercreation_olducd,
+ testing/fulltests/default/T035snmpv3trapdusermgmt_olducd,
+ testing/fulltests/default/T049snmpv3inform_olducd,
+ testing/fulltests/default/T049snmpv3informauth_olducd,
+ testing/fulltests/default/T049snmpv3informpriv_olducd,
+ testing/fulltests/default/T050snmpv3trap_olducd,
+ testing/fulltests/default/T051snmpv2ctrap_olducd,
+ testing/fulltests/default/T052snmpv2cinform_olducd,
+ testing/fulltests/default/T053agentv1trap_olducd,
+ testing/fulltests/default/T054agentv2ctrap_olducd,
+ testing/fulltests/default/T055agentv1mintrap_olducd,
+ testing/fulltests/default/T056agentv2cmintrap_olducd,
+ testing/fulltests/default/T057trapdauthtest2_olducd,
+ testing/fulltests/default/T057trapdauthtest3_olducd,
+ testing/fulltests/default/T057trapdauthtest_olducd,
+ testing/fulltests/default/T058agentauthtrap_olducd,
+ testing/fulltests/default/T059trapdtraphandle_olducd,
+ testing/fulltests/default/T060trapdperl_olducd,
+ testing/fulltests/default/T061agentperl_olducd,
+ testing/fulltests/default/T065agentextend_olducd,
+ testing/fulltests/default/T070com2sec_olducd,
+ testing/fulltests/default/T071com2sec6_olducd,
+ testing/fulltests/default/T072com2secunix_olducd,
+ testing/fulltests/default/T100agenthup_olducd,
+ testing/fulltests/default/T110agentxget_olducd,
+ testing/fulltests/default/T111agentxset_olducd,
+ testing/fulltests/default/T112agentxsetfail_olducd,
+ testing/fulltests/default/T113agentxtrap_olducd,
+ testing/fulltests/default/T114agentxagentxtrap_olducd,
+ testing/fulltests/default/T115agentxperl_olducd,
+ testing/fulltests/default/T120proxyget_olducd,
+ testing/fulltests/default/T121proxyset_olducd,
+ testing/fulltests/default/T122proxysetfail_olducd,
+ testing/fulltests/default/T130snmpv1vacmget_olducd,
+ testing/fulltests/default/T131snmpv2cvacmget_olducd,
+ testing/fulltests/default/T132snmpv3vacmget_olducd,
+ testing/fulltests/default/T140snmpv1vacmgetfail_olducd,
+ testing/fulltests/default/T141snmpv2cvacmgetfail_olducd,
+ testing/fulltests/default/T142snmpv3vacmgetfail_olducd,
+ testing/fulltests/default/T150solarishostcpu_olducd,
+ testing/fulltests/default/T151solarishostdisk_olducd,
+ testing/fulltests/default/T152hostuptime_olducd,
+ testing/fulltests/default/T153solarisswap_olducd,
+ testing/fulltests/default/T160snmpnetstat_olducd,
+ testing/fulltests/default/T200snmpv2cwalkall_olducd,
+ testing/tests/Stransport, testing/tests/Sv1config,
+ testing/tests/Sv2cconfig, testing/tests/Sv3config,
+ testing/tests/Sv3usmconfigagent, testing/tests/Sv3usmconfigbase,
+ testing/tests/Sv3usmconfigtrapd, testing/tests/Sv3vacmconfig,
+ testing/tests/Svacmconfig, testing/tests/Svanyconfig,
+ testing/tests/T001snmpv1get, testing/tests/T014snmpv2cget,
+ testing/tests/T015snmpv2cgetnext,
+ testing/tests/T0160snmpv2cbulkget,
+ testing/tests/T016snmpv2cgetfail,
+ testing/tests/T017snmpv2ctov1getfail,
+ testing/tests/T018snmpv1tov2cgetfail,
+ testing/tests/T019snmpv2cnosuch, testing/tests/T020snmpv3get,
+ testing/tests/T021snmpv3getnext,
+ testing/tests/T0220snmpv3bulkget, testing/tests/T022snmpv3getMD5,
+ testing/tests/T023snmpv3getMD5AES,
+ testing/tests/T023snmpv3getMD5DES,
+ testing/tests/T024snmpv3getSHA1,
+ testing/tests/T025snmpv3getSHADES,
+ testing/tests/T026snmpv3getSHAAES,
+ testing/tests/T028snmpv3getfail,
+ testing/tests/T030snmpv3usercreation,
+ testing/tests/T035snmpv3trapdusermgmt,
+ testing/tests/T049snmpv3inform,
+ testing/tests/T049snmpv3informauth,
+ testing/tests/T049snmpv3informpriv, testing/tests/T050snmpv3trap,
+ testing/tests/T051snmpv2ctrap, testing/tests/T052snmpv2cinform,
+ testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap,
+ testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap,
+ testing/tests/T057trapdauthtest,
+ testing/tests/T057trapdauthtest2,
+ testing/tests/T057trapdauthtest3,
+ testing/tests/T058agentauthtrap,
+ testing/tests/T059trapdtraphandle, testing/tests/T060trapdperl,
+ testing/tests/T061agentperl, testing/tests/T065agentextend,
+ testing/tests/T070com2sec, testing/tests/T071com2sec6,
+ testing/tests/T072com2secunix, testing/tests/T100agenthup,
+ testing/tests/T110agentxget, testing/tests/T111agentxset,
+ testing/tests/T112agentxsetfail, testing/tests/T113agentxtrap,
+ testing/tests/T114agentxagentxtrap, testing/tests/T115agentxperl,
+ testing/tests/T120proxyget, testing/tests/T121proxyset,
+ testing/tests/T122proxysetfail, testing/tests/T130snmpv1vacmget,
+ testing/tests/T131snmpv2cvacmget,
+ testing/tests/T132snmpv3vacmget,
+ testing/tests/T140snmpv1vacmgetfail,
+ testing/tests/T141snmpv2cvacmgetfail,
+ testing/tests/T142snmpv3vacmgetfail,
+ testing/tests/T150solarishostcpu,
+ testing/tests/T151solarishostdisk, testing/tests/T152hostuptime,
+ testing/tests/T153solarisswap, testing/tests/T160snmpnetstat,
+ testing/tests/T200snmpv2cwalkall,
+ testing/tests/test-localhost.cert,
+ testing/tests/test-localhost.priv, testing/tests/test-user.cert,
+ testing/tests/test-user.priv:
+
+ NEWS: testing: Brand new test suite desigened to eventually test
+ more functionality, provide for support of unit-tests and support
+ of API tests
+
+2010-04-26 20:43 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ removed a debugging echo
+
+2010-04-26 20:43 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ more bug fixes for string searches
+
+2010-04-26 20:43 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ added a new macro to check a trapd count
+
+2010-04-26 20:42 hardaker
+
+ * testing/fulltests/support/olducd_eval_tools.sh:
+
+ use individual output files and fix some tests
+
+2010-04-26 20:42 hardaker
+
+ * testing/RUNFULLTESTS,
+ testing/fulltests/support/olducd_eval_tools.sh:
+
+ made existing test suite put out TAP output
+
+2010-04-26 20:42 hardaker
+
+ * testing/RUNTESTS, testing/TESTCONF.sh,
+ testing/eval_oneprogram.sh, testing/eval_onescript.sh,
+ testing/eval_suite.sh, testing/eval_tools.sh, testing/fulltests,
+ testing/fulltests/support,
+ testing/fulltests/support/olducd_TESTCONF.sh,
+ testing/fulltests/support/olducd_eval_tools.sh,
+ testing/fulltests/support/run_olducd:
+
+ beginning of moving UCD test suite into a larger subdirectory
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ allow running tests that match a regexp
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ summarize tests that failed
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ created the ability to have run_ scripts for executing certain
+ types
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ made the build-script-check routine generic
+
+2010-04-26 20:41 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ support for build scripts
+
+2010-04-26 20:40 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ provide infrastructure for building and renaming tests
+
+2010-04-26 20:40 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ more test infrastructure setup
+
+2010-04-26 20:40 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ support the keyword 'all'
+
+2010-04-26 20:40 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ enable group gathering
+
+2010-04-26 20:39 hardaker
+
+ * testing/RUNFULLTESTS:
+
+ creatino of a new testing harness
+
+2010-04-25 17:37 bvassche
+
+ * README.win32:
+
+ Documentation update.
+
+2010-04-25 15:21 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32: reverted a recent unnecessary modification.
+
+2010-04-25 15:00 marz
+
+ * local/net-snmp-cert:
+
+ handle multiple --san args, check error codes on openssl cmds and
+ die on failure
+
+2010-04-25 14:18 bvassche
+
+ * win32/net-snmp/agent/mib_module_config.h:
+
+ Win32: builds again with SDK support disabled.
+
+2010-04-25 14:18 bvassche
+
+ * win32/libnetsnmptrapd/Makefile.in, win32/netsnmpmibs/Makefile.in,
+ win32/snmpd/Makefile.in, win32/snmptrapd/Makefile.in:
+
+ Win32: restored consistency between workspace-build and batch
+ build -- made sure that notification_log.c is only included in
+ the netsnmpmibs project.
+
+2010-04-25 13:58 bvassche
+
+ * include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ win32/libsnmp_dll/libsnmp.def, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in,
+ win32/transports/snmp_transport_inits.h:
+
+ Win32: fixes for recently introduced build breakage.
+
+2010-04-25 13:51 bvassche
+
+ * win32/libsnmp/Makefile.in, win32/libsnmp_dll/Makefile.in:
+
+ Win32: builds again with SDK support disabled.
+
+2010-04-25 13:48 bvassche
+
+ * include/net-snmp/types.h, snmplib/closedir.c, snmplib/opendir.c,
+ snmplib/readdir.c, snmplib/winservice.c:
+
+ Made sure that the Win32 MSVC 6 non-SDK build works again.
+
+2010-04-25 13:42 bvassche
+
+ * win32/Configure:
+
+ Removed an obsolete transformation rule.
+
+2010-04-25 12:05 bvassche
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ Made it again possible to disable HAVE_WIN32_PLATFORM_SDK when
+ building via win32/build.bat.
+
+2010-04-23 13:14 marz
+
+ * local/net-snmp-cert:
+
+ added --san DNS:a.b.c handling, help text fixes, other bug fixes.
+ Note multiple --san not supported yet
+
+2010-04-21 22:31 hardaker
+
+ * local/Makefile.in:
+
+ build the .made version of net-snmp-cert
+
+2010-04-21 22:31 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend after moving all the files around
+
+2010-04-21 20:16 rstory
+
+ * include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/snmp_openssl.h, snmplib/cert_util.c,
+ snmplib/snmp_openssl.c, snmplib/transports/snmpTLSBaseDomain.c:
+
+ build trust chain for client cert; add subject to index cache;
+ rebuild indexes
+ if any error while parsing index; reformat dump output
+ - add NS_CERT_CA allowed_use flag
+ - add subject, issuer and issuer_cert to netsnmp_cert
+ - move certToTSN_entry to cert_util header
+ - move container setup to its own function
+ - add subject name subcontainer
+ - add netsnmp_openssl_cert_dump_extensions,
+ netsnmp_openssl_cert_issued_by
+
+2010-04-21 16:16 hardaker
+
+ * man/snmpcmd.1.def:
+
+ document the single-dash / snmp.conf / double-dash precidence
+
+2010-04-21 16:15 hardaker
+
+ * man/snmp.conf.5.def:
+
+ document in the snmp.conf file that the tokens can be used for
+ command line applications too
+
+2010-04-21 16:15 hardaker
+
+ * man/snmp.conf.5.def:
+
+ document the file loading order and how to turn off host-specific
+ config
+
+2010-04-21 15:52 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/snmp_transport.h, man/snmp.conf.5.def,
+ snmplib/read_config.c, snmplib/snmp_api.c,
+ snmplib/snmp_transport.c:
+
+ NEWS: apps: Generic host-specific configuration snmp.conf files
+ are now read. See the HOST-SPECIFIC FILES section of the
+ snmp.conf manual page.
+
+2010-04-20 12:44 jsafranek
+
+ * snmplib/asn1.c:
+
+ CHANGES: snmplib: PATCH: 2971270: refuse to parse ASN.1 tokens
+ with wrong type field.
+ This may yield to problems with third-party applications which
+ may depend on parsing ugly ASN.1 data - we'll see...
+
+2010-04-20 00:12 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ combine remote fingerprint checking and check both sides
+
+2010-04-20 00:05 hardaker
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ if the remote fingerprint is specified, require an exact match
+
+2010-04-19 23:44 hardaker
+
+ * snmplib/fd_event_manager.c, snmplib/snmp_api.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ fix various minor bugs, especially in output messages
+
+2010-04-19 21:14 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more documentation and prototyping of needed RFC steps
+
+2010-04-19 21:14 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ convert if error check to return immediately so other code can be
+ outdented
+
+2010-04-19 21:13 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more comments from the RFC text
+
+2010-04-18 15:25 bvassche
+
+ * include/net-snmp/library/snmp_api.h, snmplib/transports,
+ win32/build.pl, win32/libsnmp/Makefile.in,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/Makefile.in,
+ win32/libsnmp_dll/libsnmp_dll.dsp, win32/netsnmpmibs/Makefile.in,
+ win32/transports, win32/transports/snmp_transport_inits.h:
+
+ Win32: builds again.
+
+2010-04-16 18:53 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ created a function to extract the securityName from the cert
+
+2010-04-16 18:53 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ don't need to set the accept state for TLS (just DTLS)
+
+2010-04-16 18:53 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more TLS comment documentation and steps taken from the RFC
+
+2010-04-16 13:55 marz
+
+ * local/net-snmp-cert:
+
+ numerous fixes, more verbose default output, additive show flags,
+ arbitrary config param handling, better help text
+
+2010-04-16 13:08 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ don't double declare a struct
+
+2010-04-16 03:30 rstory
+
+ * snmplib/cert_util.c:
+
+ cert util fixes
+ - remove unused vars and duplicate code
+ - check prt before free
+ - new func for type from filename
+ - new functions for finding subsets from filename
+ - fix types in key search function but then ifdef if (unused
+ function)
+
+2010-04-15 22:57 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ use a structure reference to predeclare the structure
+
+2010-04-15 21:25 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ correct declaration of the f_open command now requiring returning
+ a transport
+
+2010-04-15 21:02 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ remove unneeded config container
+
+2010-04-15 21:02 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ copy fingerprint transport information into new tls structure
+ within DTLSUDP so per-transport fingerprints can be specified
+
+2010-04-15 21:01 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ properly check for tlsbase pointers in dtlsudp_send()
+
+2010-04-15 21:01 hardaker
+
+ * configure.d/config_os_libs:
+
+ grep the transport list for TLS not just DTLS for checking for
+ -lssl
+
+2010-04-15 21:01 hardaker
+
+ * snmplib/snmp_api.c, snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more bug fixes and made TLSTCP work with the -T flag
+
+2010-04-15 21:01 hardaker
+
+ * snmplib/snmp_api.c, snmplib/transports/snmpTLSTCPDomain.c:
+
+ make the f_open call assign the new transport pointer to use (and
+ check if NULL as a failure condition
+
+2010-04-15 21:00 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c:
+
+ begin work moving DTLS config routine in place
+
+2010-04-15 21:00 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ pass the entire tlsbase to the client_setup
+
+2010-04-15 21:00 hardaker
+
+ * include/net-snmp/library/container.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h, snmplib/snmp_api.c,
+ snmplib/transports/snmpTLSBaseDomain.c:
+
+ starting the storing of config data into the tlsbase
+
+2010-04-15 20:59 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ change client ssl setup to allow for direct fingerprint
+ specification of my/their certs
+
+2010-04-15 20:59 hardaker
+
+ * agent/snmp_agent.c, include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmp_api.c, snmplib/transports/snmpTLSTCPDomain.c:
+
+ split TLS into creation/close functions for eventual config
+ passing support
+
+2010-04-15 20:59 hardaker
+
+ * include/net-snmp/library/snmp_transport.h, snmplib/snmp_api.c:
+
+ pass transport config data to the transport f_config() function
+
+2010-04-15 20:59 hardaker
+
+ * snmplib/snmp_api.c:
+
+ return NULL on transport config error
+
+2010-04-15 20:58 hardaker
+
+ * include/net-snmp/library/snmp_transport.h,
+ snmplib/snmp_parse_args.c, snmplib/snmp_transport.c:
+
+ NEWS: apps: -T command line flag can be used to configure
+ transports
+
+2010-04-15 20:58 hardaker
+
+ * snmplib/snmp_api.c:
+
+ check transport NULLness before using
+
+2010-04-15 20:58 hardaker
+
+ * include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/types.h, snmplib/snmp_api.c:
+
+ beginning of work to make transports configurable with
+ supplimental configuration data and new calls for f_open/f_config
+
+2010-04-15 20:58 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ added text in comments from future RFC to document the
+ implementation
+
+2010-04-15 18:51 rstory
+
+ * snmplib/cert_util.c:
+
+ mark pem w/key as identity; tweak partner debug; compare file
+ ctime against index too
+
+2010-04-15 17:09 rstory
+
+ * snmplib/cert_util.c:
+
+ use local space to reformat cert for search
+
+2010-04-15 16:55 bvassche
+
+ * win32/net-snmp/agent/mib_module_config.h:
+
+ Partially reverted r18496:
+ - Commented out #define NETSNMP_USE_DLL again in file
+ win32/net-snmp/net-snmp-config.h on the 5.4 branch. This change
+ had been committed unintentionally.
+ - Re-enabled #define
+ USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE in
+ win32/net-snmp/agent/mib_module_config.h on the trunk and the
+ V5.5 branch. While build.bat reports an error on earlier branches
+ with this symbol enabled, there is no such problem on the trunk
+ or V5.5 branches and hence there was no reason to disable this
+ preprocessor symbol.
+
+2010-04-15 15:08 marz
+
+ * local/Makefile.in:
+
+ add net-snmp-cert to make/install
+
+2010-04-15 10:52 jsafranek
+
+ * testing/tests/T120proxyget, testing/tests/T121proxyset:
+
+ Tests not working for TCP should be skipped also for TCP6.
+
+2010-04-14 18:13 rstory
+
+ * snmplib/cert_util.c:
+
+ fix vars/text from cut-n-paste
+
+2010-04-14 17:45 rstory
+
+ * snmplib/snmp_openssl.c:
+
+ fix comments
+
+2010-04-14 17:45 rstory
+
+ * snmplib/cert_util.c:
+
+ lots of cert updates
+ - change cert subdir searching to match net-snmp-cert
+ - update key type handling
+ - ignore world readable keys
+ - keep type in indexes
+ - tweak cert/key print format
+
+2010-04-14 17:44 rstory
+
+ * local/net-snmp-cert:
+
+ make net-snmp-cert executable
+
+2010-04-14 13:12 jsafranek
+
+ * testing/tests/Svacmconfig, testing/tests/T120proxyget,
+ testing/tests/T121proxyset, testing/tests/T122proxysetfail:
+
+ Fixed tests 'Proxy GET/SET support' and 'SNMPv2 vacm denial
+ support' with udp6 transport.
+
+2010-04-14 09:47 dts12
+
+ * win32, win32/bin, win32/dist, win32/dist/htmlhelp,
+ win32/dist/installer, win32/dist/scripts, win32/encode_keychange,
+ win32/lib, win32/libagent, win32/libhelpers,
+ win32/libnetsnmptrapd, win32/libsnmp, win32/libsnmp_dll,
+ win32/libucdmibs, win32/local, win32/net-snmp,
+ win32/net-snmp/agent, win32/net-snmp/library, win32/netsnmpmibs,
+ win32/snmpbulkget, win32/snmpbulkwalk, win32/snmpd,
+ win32/snmpdelta, win32/snmpdf, win32/snmpget, win32/snmpgetnext,
+ win32/snmpnetstat, win32/snmpset, win32/snmpstatus,
+ win32/snmptable, win32/snmptest, win32/snmptranslate,
+ win32/snmptrap, win32/snmptrapd, win32/snmpusm, win32/snmpvacm,
+ win32/snmpwalk:
+
+ Don't try to SVN-manage the Windows batch build infrastructure
+ (add release, debug, Makefile to the previous ignore list)
+
+2010-04-14 08:16 dts12
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Fix Windows batch build using Visual Studio with dynamic linking.
+ Unreferenced symbol introduced by SVN revision 18393
+
+2010-04-14 08:08 dts12
+
+ * win32/net-snmp/agent/mib_module_config.h:
+
+ CHANGES: Win32: Fix batch build using recent versions of Visual
+ Studio.
+ Partial back port of SVN revisions 17573 and 17696.
+
+2010-04-14 01:47 marz
+
+ * local/net-snmp-cert:
+
+ fix perms on created files -rw-------, umask(077)
+
+2010-04-13 22:15 marz
+
+ * local/net-snmp-cert, local/net-snmp-cert.conf:
+
+ fix perms, add --cn/-c, better dates defaults, snmp-tls org_unit,
+ added initial dummy config file
+
+2010-04-13 14:21 marz
+
+ * local/net-snmp-cert:
+
+ fixes for show cmds, cmdline, help
+
+2010-04-13 02:17 rstory
+
+ * snmplib/cert_util.c:
+
+ add support for key+cert in .pem files; misc tweaks
+
+2010-04-10 23:24 tanders
+
+ * snmplib/read_config.c:
+
+ build fix for C89 compilers (e.g. on HP-UX 10.20)
+
+2010-04-10 22:25 rstory
+
+ * agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable.h,
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.c,
+
+ agent/mibgroup/tlstm-mib/tlstmCertToTSNTable/tlstmCertToTSNTable.h:
+
+ initial cut at tlstmCertToTSNTable
+
+2010-04-10 22:24 rstory
+
+ * include/net-snmp/library/cert_util.h:
+
+ add define of max hash constant
+
+2010-04-10 22:24 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c:
+
+ use cert util check for fingerprint len/algorithm
+
+2010-04-10 12:59 marz
+
+ * local/net-snmp-cert:
+
+ show cmd fixes
+
+2010-04-09 21:32 marz
+
+ * local/net-snmp-cert:
+
+ fairly functional (non-interactive) - be it known: there are bugs
+
+2010-04-09 20:54 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_internal.h:
+
+ merge some table_data.conf changes; remove unused code and a
+ bunch of verbose comments
+
+2010-04-08 14:57 rstory
+
+ * local/mib2c-update:
+
+ use full path
+
+2010-04-08 10:55 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_common.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c,
+ agent/mibgroup/sctp-mib/sctpScalars_common.c,
+ include/net-snmp/data_access/systemstats.h:
+
+ Check results of calls to netsnmp_c64_check32_and_update and log
+ an error.
+ This allows users to relate various 'c64 32 bit check failed'
+ errors with specific counter.
+
+2010-04-08 01:09 rstory
+
+ * include/net-snmp/agent/table_tdata.h:
+
+ add prototype for new function
+
+2010-04-08 01:05 rstory
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: translate NOSUCH*/ENDOFMIB errors during RESERVE1
+ to NOCREATION
+
+2010-04-08 00:56 rstory
+
+ * agent/helpers/table_tdata.c:
+
+ NEWS: snmpd: table_data/tdata next handler will not be called
+ during get
+ processing if no valid rows are found for the handler
+
+2010-04-08 00:56 rstory
+
+ * agent/helpers/table.c:
+
+ NEWS: snmpd: agent will no longer call table handlers if a set
+ request for
+ the handler has invalid indexes
+ CHANGES: snmpd: don't call cleanup on first request on bad
+ indexes. instead,
+ set actual error later, and free request data sets on first
+ request for sets
+
+2010-04-08 00:56 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ add function to validate fingerprint varbind
+
+2010-04-07 22:56 magfr
+
+ * configure, configure.d/config_modules_lib:
+
+ Solaris tr doesn't support character ranges reliably (see the
+ autoconf manual), change the expression to one that is simple
+ enough to b supported.
+
+2010-04-07 14:05 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Insert the cache helper correctly.
+
+2010-04-07 10:40 rstory
+
+ * agent/helpers/table_container.c, agent/helpers/table_tdata.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/table_container.h:
+
+ CHANGES: snmplib: add functions to remove list/row data from
+ request list
+
+2010-04-07 10:40 rstory
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ ifdef var decl for vars only used in later ifdef block
+
+2010-04-07 10:40 rstory
+
+ * include/net-snmp/library/check_varbind.h,
+ include/net-snmp/library/snmp-tc.h, snmplib/check_varbind.c,
+ snmplib/snmp-tc.c:
+
+ CHANGES: snmplib: add function to validate RowStatus and
+ StorageType varbinds
+ - also remove some duplicate code and fix comments indent mangled
+
+2010-04-07 10:39 rstory
+
+ * local/mib2c-update, man/mib2c-update.1.def:
+
+ update man page; fix shell redirect; create example rcfile if
+ missing
+
+2010-04-07 07:15 magfr
+
+ * apps/agentxtrap.c:
+
+ Use NETSNMP_DISABLE_MIB_LOADING instead of DISABLE_MIB_LOADING
+
+2010-04-07 00:38 magfr
+
+ * agent/mibgroup/host/data_access/swinst.h:
+
+ CHANGES: snmpd: Only enable hostSwInst rpm support on linux hosts
+ with librpm. This makes it possible to build on non-rpm linux
+ distributions.
+
+2010-04-07 00:14 magfr
+
+ * testing/tests/T021snmpv3getnext,
+ testing/tests/T035snmpv3trapdusermgmt,
+ testing/tests/T049snmpv3inform,
+ testing/tests/T049snmpv3informauth,
+ testing/tests/T049snmpv3informpriv, testing/tests/T050snmpv3trap,
+ testing/tests/T051snmpv2ctrap, testing/tests/T052snmpv2cinform,
+ testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap,
+ testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap,
+ testing/tests/T059trapdtraphandle, testing/tests/T100agenthup,
+ testing/tests/T111agentxset, testing/tests/T112agentxsetfail,
+ testing/tests/T113agentxtrap, testing/tests/T120proxyget,
+ testing/tests/T121proxyset, testing/tests/T122proxysetfail,
+ testing/tests/T141snmpv2cvacmgetfail:
+
+ CHANGES: testing: Change the test suite to work even if mib
+ lookup is disabled.
+
+2010-04-07 00:11 magfr
+
+ * testing/tests/T071com2sec6:
+
+ Check for com2sec6, not com2sec.
+
+2010-04-06 22:51 magfr
+
+ * configure, configure.d/config_modules_lib:
+
+ Move directory creation before the directories are used.
+
+2010-04-06 11:03 dts12
+
+ * FAQ:
+
+ Python is apparently client-side only.
+
+2010-04-06 10:06 dts12
+
+ * agent/snmpd.c:
+
+ Set supplementary groups before changing UID
+ (which probably involves giving up privileges)
+
+2010-04-06 08:57 dts12
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ Document large-disk statistics as latching at 2Tb (rather than
+ wrapping).
+
+2010-04-06 01:52 rstory
+
+ * local/mib2c, man/mib2c.1.def:
+
+ NEWS: mib2c: mib2c can now optionally run sed on generated code
+
+2010-04-06 01:49 rstory
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ convert C++ comments to C comments
+
+2010-04-06 01:49 rstory
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ move ptr check before prt use
+
+2010-04-06 01:49 rstory
+
+ * snmplib/cert_util.c:
+
+ add filename to debug on new certs; make static func to return
+ mode names
+
+2010-04-06 00:47 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ allow a found fingerprint self-signed cert for now; eventually
+ need to respect the MIB config table
+
+2010-04-06 00:12 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ mkdir snmplib/transports when DNE for building outside the source
+ dir
+
+2010-04-06 00:11 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c:
+
+ remove unused vars
+
+2010-04-06 00:11 hardaker
+
+ * snmplib/transports/snmpTLSBaseDomain.c:
+
+ remove unused variable
+
+2010-04-06 00:11 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ error code cleanup for tlsbase_wrapup_recv
+
+2010-04-05 23:12 hardaker
+
+ * snmplib/cert_util.c:
+
+ more better error/debug codes
+
+2010-04-05 23:08 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ more comments from the future-RFC about the implementation; use
+ flags for server/client specification for expansion
+
+2010-04-05 23:08 hardaker
+
+ * snmplib/cert_util.c:
+
+ better error messages for usage constraints
+
+2010-04-05 23:08 hardaker
+
+ * snmplib/transports/snmpTLSTCPDomain.c:
+
+ move function protection logic in a top-level check
+
+2010-04-02 16:36 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ fix init ordering
+
+2010-04-02 16:36 hardaker
+
+ * snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c:
+
+ mv tlsbase init function to a proper ctor for auto-calling
+
+2010-04-02 16:36 hardaker
+
+ * Makefile.in, configure, configure.d/config_modules_lib,
+ snmplib/snmp_transport.c, snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c:
+
+ CHANGES: generate the transport initialization function list
+ dynamically and use it
+
+2010-04-02 16:35 hardaker
+
+ * configure, configure.d/config_modules_lib,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpAliasDomain.c,
+ snmplib/snmpCallbackDomain.c, snmplib/snmpDTLSUDPDomain.c,
+ snmplib/snmpIPBaseDomain.c, snmplib/snmpIPXDomain.c,
+ snmplib/snmpIPv4BaseDomain.c, snmplib/snmpIPv6BaseDomain.c,
+ snmplib/snmpSSHDomain.c, snmplib/snmpSTDDomain.c,
+ snmplib/snmpSocketBaseDomain.c, snmplib/snmpTCPBaseDomain.c,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpTLSBaseDomain.c, snmplib/snmpTLSTCPDomain.c,
+ snmplib/snmpUDPBaseDomain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv4BaseDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c, snmplib/transports,
+ snmplib/transports/snmpAAL5PVCDomain.c,
+ snmplib/transports/snmpAliasDomain.c,
+ snmplib/transports/snmpCallbackDomain.c,
+ snmplib/transports/snmpDTLSUDPDomain.c,
+ snmplib/transports/snmpIPBaseDomain.c,
+ snmplib/transports/snmpIPXDomain.c,
+ snmplib/transports/snmpIPv4BaseDomain.c,
+ snmplib/transports/snmpIPv6BaseDomain.c,
+ snmplib/transports/snmpSSHDomain.c,
+ snmplib/transports/snmpSTDDomain.c,
+ snmplib/transports/snmpSocketBaseDomain.c,
+ snmplib/transports/snmpTCPBaseDomain.c,
+ snmplib/transports/snmpTCPDomain.c,
+ snmplib/transports/snmpTCPIPv6Domain.c,
+ snmplib/transports/snmpTLSBaseDomain.c,
+ snmplib/transports/snmpTLSTCPDomain.c,
+ snmplib/transports/snmpUDPBaseDomain.c,
+ snmplib/transports/snmpUDPDomain.c,
+ snmplib/transports/snmpUDPIPv4BaseDomain.c,
+ snmplib/transports/snmpUDPIPv6Domain.c,
+ snmplib/transports/snmpUnixDomain.c:
+
+ CHANGES: moved transport code into a separate subdirectory in
+ snmplib
+
+2010-04-02 09:02 magfr
+
+ * agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c:
+
+ Do not attempt to check sizeof void to obtain the amount of
+ memory to copy.
+
+2010-04-01 17:11 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ include/net-snmp/library/cert_util.h:
+
+ instead of fwd declares, require other header
+
+2010-04-01 17:10 rstory
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ fix compiler warning
+
+2010-04-01 17:10 rstory
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ remove outdated debug msg
+
+2010-04-01 17:09 rstory
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ use certapi to find certs/keys
+
+2010-04-01 14:40 rstory
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ register extraX509SubDir token
+
+2010-04-01 14:18 rstory
+
+ * local/mib2c.table_data.conf:
+
+ check ptr before use
+
+2010-04-01 14:18 rstory
+
+ * agent/helpers/table_tdata.c:
+
+ check ptr before use
+
+2010-04-01 13:13 rstory
+
+ * agent/mibgroup/tlstm-mib/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_internal.h,
+
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable_persist.c:
+
+ add persistent storage; token for creating entries in snmpd.conf;
+ fix index
+
+2010-04-01 13:12 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c:
+
+ NEWS: snmplib: new certificate api to support tls/dtls
+
+2010-04-01 13:12 rstory
+
+ * include/net-snmp/library/snmp_openssl.h, snmplib/snmp_openssl.c:
+
+ CHANGES: add functions to get fingerprint from cert and log
+ openssl errs
+
+2010-04-01 12:46 rstory
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ fix typo
+
+2010-04-01 10:33 bvassche
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ Builds again with pre-C90 compilers.
+
+2010-04-01 10:01 rstory
+
+ * local/mib2c.table_data.conf:
+
+ CHANGES: mib2c: table_data template enhancements
+ - add error checks during table init
+ - create cache earlier so we can bail on failure
+ - add option to create/delete row w/out adding/removing from
+ container
+
+2010-04-01 10:00 rstory
+
+ * include/net-snmp/agent/agent_read_config.h:
+
+ add helpful param names as hints in prototype
+
+2010-04-01 10:00 rstory
+
+ * agent/helpers/table_tdata.c:
+
+ search for container specific container before generic
+
+2010-04-01 10:00 rstory
+
+ * include/net-snmp/library/dir_utils.h,
+ include/net-snmp/library/file_utils.h, snmplib/dir_utils.c,
+ snmplib/file_utils.c:
+
+ NEWS: snmplib: enhance file utils and dir utils
+ - add optional stats struct to netsnmp_file
+ - generalize dir container filter, add context to callback
+ - add option to store netsnmp_files (w/stats) in container
+ instead of just name
+
+2010-04-01 10:00 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container_binary_array.c:
+
+ add prototype to header; check ptr before dereferencing
+
+2010-03-31 15:34 jsafranek
+
+ * local/Makefile.in, local/snmp-bridge-mib, man/Makefile.in,
+ man/snmp-bridge-mib.1, mibs/BRIDGE-MIB.txt, mibs/Makefile.in,
+ mibs/Makefile.mib:
+
+ NEWS: misc: PATCH: 2952708: from Jens Osterkamp: Added Perl
+ implementation of BRIDGE-MIB
+
+2010-03-31 02:12 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c:
+
+ proper packet labeling for DTLSUDP
+
+2010-03-31 02:11 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c:
+
+ use common context creation code
+
+2010-03-30 23:24 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ change TLS method to TLSv1 from SSLv23
+
+2010-03-30 23:23 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c,
+ snmplib/snmpTLSTCPDomain.c:
+
+ move more common data and functionality into the TLS base
+
+2010-03-30 23:20 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ minor TLS code cleanup
+
+2010-03-30 20:28 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ rework if() wrapping for less confusion in error handling
+
+2010-03-30 20:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ code consolidation in start_new_cached_connectio
+
+2010-03-30 20:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ rename generic 'bio' pointer to 'read_bio' for better readability
+
+2010-03-30 20:26 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ move buffered data creation to a separate function for reuse
+
+2010-03-30 17:52 marz
+
+ * local/net-snmp-cert:
+
+ initial cert gen wrapper script - not working
+
+2010-03-30 17:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ clean up error output so it doesn't report want_read and
+ want_write errors
+
+2010-03-30 17:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ renaming of sending function for clarity and check one more
+ location for needed outgoing packets
+
+2010-03-30 17:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ added dtlsudp tracing tokens
+
+2010-03-30 17:27 hardaker
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ CHANGES: added a new DEBUGTRACETOK() macro
+
+2010-03-30 17:27 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ better comments and more work on sending buffered data in the
+ right spots
+
+2010-03-30 17:26 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ fix arguments to get_commonName
+
+2010-03-30 17:26 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ beginning of caching of packets before they can be sent via DTLS
+
+2010-03-30 17:26 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ handle SSL_WANT_READ/WRITE better; still need to buffer outgoing
+ write data
+
+2010-03-30 17:26 hardaker
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ minor change to output error printing
+
+2010-03-29 15:20 dts12
+
+ * snmplib/vacm.c:
+
+ NEWS: snmpd: Fix handling of multiple matching VACM entries.
+ (Use the "best" match, rather than the first one).
+ Reported by Adam Lewis.
+ Note that this could potentially affect the behaviour of
+ existing access control configurations.
+
+2010-03-29 15:16 bvassche
+
+ * perl/agent/agent.xs:
+
+ CHANGES: perl:
+ NetSNMP::agent::netsnmp_request_infoPtr::getValue(): don't return
+ a pointer to a buffer on the stack. How can this have worked
+ reliably ??
+ CHANGES: perl:
+ NetSNMP::agent::netsnmp_request_infoPtr::setValue(),
+ ASN_COUNTER64: fixed bug that could cause this method to fail
+ even when a valid number was provided.
+
+2010-03-29 15:15 dts12
+
+ * snmplib/snmpusm.c:
+
+ CHANGES: snmplib: Fix agent crash when sending encrypted SNMPv3
+ traps.
+ Reported by Srikapilan Gandhi
+
+2010-03-29 12:46 bvassche
+
+ * perl/SNMP/t/startagent.pl:
+
+ Catch stderr on Windows too.
+
+2010-03-29 11:48 bvassche
+
+ * perl/agent/agent.xs:
+
+ Builds again with pre-C90 compilers.
+
+2010-03-29 11:19 bvassche
+
+ * include/net-snmp/library/snmp_api.h, perl/OID/OID.xs,
+ perl/SNMP/SNMP.xs, perl/agent/agent.xs:
+
+ CHANGES: perl: fixed a memory leak triggered by destroying a
+ NetSNMP::agent::netsnmp_handler_registration object.
+ CHANGES: perl: fixed a memory leak triggered by failure of
+ creating a NetSNMP::OID object.
+ CHANGES: perl: fixed a memory leak triggered by the
+ NetSNMP::OID::gettable() subroutine.
+ CHANGES: perl: fixed an out-of-bounds array access triggered by
+ the implementation of NetSNMP::SNMP.
+ CHANGES: perl: fixed a memory leak triggered by a PDU processing
+ error in NetSNMP::SNMP.
+ CHANGES: perl: fixed memory leaks triggered by creating an SNMPv3
+ session via NetSNMP::SNMP.
+
+ Also fixed the uninitialized variable accesses triggered by
+ adding a varbind to a PDU via NetSNMP::SNMP introduced a few days
+ ago.
+
+ The bugs mentioned above have been found by inspecting the output
+ of the following shell command:
+ cd perl && valgrind --trace-children=yes --leak-check=full make
+ test
+
+2010-03-29 10:59 bvassche
+
+ * perl/SNMP/t/startagent.pl:
+
+ Switched back to the previous way of starting processes
+ asynchronously because it is more reliable.
+
+2010-03-29 09:27 bvassche
+
+ * perl/SNMP/t/startagent.pl:
+
+ Do not only save snmpd / snmptrapd logs but also the stdout /
+ stderr output generated by these processes.
+
+2010-03-28 16:09 bvassche
+
+ * perl/SNMP/t/startagent.pl:
+
+ Changes in perl/SNMP/t/startagent.pl:
+ - Added command-line option -d for snmpd and snmptrapd.
+ - snmpd and snmptrapd output is now saved to a log file (one per
+ test).
+ - Rewrote Perl code for starting the snmpd/snmptrapd processes
+ such that the same code works on Unix and on Windows.
+
+2010-03-28 13:37 bvassche
+
+ * include/net-snmp/library/snmp_api.h, snmplib/tools.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmplib: added the functions netsnmp_malloc(),
+ netsnmp_calloc(), netsnmp_realloc(), netsnmp_strdup() and
+ netsnmp_free().
+ CHANGES: Win32: snmplib: removed the troublesome #define malloc
+ netsnmp_malloc etc. This means that when calling functions from
+ the Net-SNMP DLL from C or C++ code that is being linked against
+ another version of the MSVC runtime DLL than the Net-SNMP DLL,
+ and when allocating memory that will be freed by the Net-SNMP
+ DLL, you will either have to call the Net-SNMP memory allocation
+ functions explicitly or redefine malloc() etc. yourself.
+
+2010-03-28 12:46 bvassche
+
+ * perl/SNMP/SNMP.xs:
+
+ Fixed a recently reintroduced compiler warning.
+
+2010-03-27 18:42 bvassche
+
+ * Makefile.in:
+
+ Added a check for invocation of calloc() from XSUBs.
+
+2010-03-26 19:16 bvassche
+
+ * include/net-snmp/library/snmp_api.h, perl/OID/OID.xs,
+ perl/SNMP/SNMP.xs, perl/TrapReceiver/TrapReceiver.xs:
+
+ Follow-up for r18368 and r18369: made sure that the Net-SNMP Perl
+ extensions compile without triggering preprocessor warnings about
+ redefining malloc etc. nor trigger "Free to wrong pool" errors on
+ Windows.
+
+2010-03-26 14:44 bvassche
+
+ * include/net-snmp/library/snmpIPBaseDomain.h,
+ snmplib/snmpIPBaseDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c:
+
+ Refactoring: introduced a new function:
+ netsnmp_set_non_blocking_mode().
+
+2010-03-26 11:58 bvassche
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/utilities/execute.c,
+ apps/snmpbulkget.c, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmptest.c, apps/snmptrapd_handlers.c, apps/snmptrapd_log.c,
+ snmplib/int64.c, snmplib/mib.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/snmp_logging.c,
+ snmplib/snmp_parse_args.c, snmplib/snmpv3.c,
+ snmplib/text_utils.c:
+
+ Fixed compiler warnings about using variables of type char as an
+ array subscript. Note: as far as I know these warnings are only
+ reported when using the Cygwin glibc headers.
+
+2010-03-26 10:41 bvassche
+
+ * snmplib/strtoull.c:
+
+ Added missing #include directive (on Windows MSVC was complaining
+ about size_t while processing <net-snmp/library/system.h>).
+
+2010-03-25 20:07 bvassche
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ CHANGES: agentx: changed default TCP target from 0.0.0.0:705 to
+ localhost:705. This is not only a more secure choice but it also
+ makes it possible on Windows systems to let an AgentX subagent
+ connect to an AgentX master agent running on the same system
+ without having to set the variable NETSNMP_DS_AGENT_X_SOCKET.
+
+2010-03-25 16:11 bvassche
+
+ * perl/OID/OID.xs, perl/SNMP/SNMP.xs,
+ perl/TrapReceiver/TrapReceiver.xs, perl/agent/agent.xs:
+
+ CHANGES: Win32: perl: fixed several "Free to wrong pool" errors.
+ Note: since calloc() is not redefined in <CORE/XSUB.h> using
+ calloc() directly or indirectly leads to "Free to wrong pool"
+ errors, at least on Windows.
+
+2010-03-25 16:04 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: Win32: building: made building more silent by not
+ redefining malloc() or free() during compilation of Perl
+ extensions (resulted in warnings about malloc() / free()
+ redefinition in the Perl header CORE/XSUB.h).
+
+2010-03-25 15:06 bvassche
+
+ * include/net-snmp/library/system.h, perl/SNMP/SNMP.xs,
+ perl/agent/agent.xs:
+
+ CHANGES: BUG: 2969872: made sure that SOCK_STARTUP is invoked
+ before init_agent() on Windows.
+
+2010-03-25 13:39 jsafranek
+
+ * apps/snmpbulkget.c, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpdf.c, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpnetstat/main.c, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c, apps/snmptrap.c,
+ apps/snmpusm.c, apps/snmpvacm.c, apps/snmpwalk.c,
+ include/net-snmp/library/snmp_parse_args.h,
+ snmplib/snmp_parse_args.c:
+
+ Use macros instead of magic numbers as netsnmp_parse_args return
+ codes.
+
+2010-03-25 13:30 bvassche
+
+ * win32/Configure, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in:
+
+ CHANGES: Win32: building: simplified the build process by
+ removing the file win32/libsnmp_dll/libsnmp.def.in. Which IPv6
+ functions are exported from netsnmp.dll is now determined by
+ which of the functions in this DLL have been declared as
+ NETSNMP_IMPORT.
+
+2010-03-24 20:11 rstory
+
+ * snmplib/snmp_enum.c:
+
+ don't use passed ptr as temp var; use snmp_enum_lists in init
+ test
+
+2010-03-24 20:10 rstory
+
+ * include/net-snmp/library/default_store.h:
+
+ add NETSNMP_DS_LIB_CERT_EXTRA_SUBDIR
+
+2010-03-24 20:10 rstory
+
+ * snmplib/snmpTLSBaseDomain.c, snmplib/snmp_api.c:
+
+ move cert init earlier (have tls_bootstrap call it)
+
+2010-03-24 20:10 rstory
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ fix compiler warnings; add cert debug msgs in server setup; free
+ ssl log data
+
+2010-03-24 10:47 jsafranek
+
+ * apps/snmpbulkget.c, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpdf.c, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpnetstat/main.c, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c, apps/snmptrap.c,
+ apps/snmpusm.c, apps/snmpvacm.c, apps/snmpwalk.c,
+ include/net-snmp/library/snmp_parse_args.h,
+ snmplib/snmp_parse_args.c:
+
+ CHANGES: apps: return nozero exit code when parsing of certain
+ parameter fails.
+ E.g. '-A' parameter with too short passphrase or Ku key
+ generation in general.
+
+2010-03-24 07:11 magfr
+
+ * apps/agentxtrap.c:
+
+ Correct the type of the id/description of the Open-PDU.
+
+2010-03-22 18:29 bvassche
+
+ * Makefile.in:
+
+ Updates for "make checks":
+ - Made sure that exit code 0 is generated when the check is
+ successful and that
+ exit code 1 is generated when the check failed.
+ - Made "makefilecheck" skip Subversion bookkeeping files and also
+ the makefile
+ that contains "makefilecheck".
+
+2010-03-22 16:10 dts12
+
+ * mibs/NET-SNMP-PASS-MIB.txt:
+
+ Fix typo in default IpAddress value
+ (See Bug #2972141)
+
+2010-03-22 15:44 rstory
+
+ * Makefile.in, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/winExtDLL.c, agent/snmp_agent.c,
+ apps/snmpnetstat/main.c, snmplib/callback.c,
+ snmplib/read_config.c, snmplib/strtok_r.c, snmplib/strtoull.c:
+
+ change all assert() to netsnmp_assert(); add assertcheck to top
+ level makefile
+
+2010-03-22 15:24 bvassche
+
+ * mibs/UCD-DISKIO-MIB.txt:
+
+ Follow-up for r18349: added missing comma such that it is again
+ possible to compile UCD-DISKIO-MIB.
+
+2010-03-22 14:36 dts12
+
+ * agent/snmpd.c, snmplib/snmp_parse_args.c:
+
+ Fix build when MIB loading is disabled (broken by SVN revision
+ 18341)
+ Report default MIB path for client apps too.
+
+2010-03-22 13:59 dts12
+
+ * man/snmp_api_errstring.3, man/snmp_close.3, man/snmp_error.3,
+ man/snmp_free_pdu.3, man/snmp_open.3, man/snmp_perror.3,
+ man/snmp_read.3, man/snmp_select_info.3, man/snmp_send.3,
+ man/snmp_sess_perror.3, man/snmp_timeout.3:
+
+ CHANGES: man: BUG: 2972860: Update broken references
+
+2010-03-22 13:49 dts12
+
+ * mibs/UCD-DISKIO-MIB.txt, mibs/UCD-DLMOD-MIB.txt,
+ mibs/UCD-IPFILTER-MIB.txt, mibs/UCD-SNMP-MIB.txt:
+
+ CHANGES: mibs: BUG: 2973890: Fix imports, DiskIOEntry list and
+ revision histories
+
+2010-03-22 11:55 bvassche
+
+ * agent/mibgroup/winExtDLL.c, include/net-snmp/library/snmp_api.h:
+
+ Win32, winExtDLL: solved the mystery of "ASN type zero". The
+ winExtDLL code does now no longer trigger conversions of Windows
+ ASN varbinds with ASN type zero. Note: this code change does not
+ change the agent behavior.
+
+2010-03-20 20:21 bvassche
+
+ * include/net-snmp/library/mib.h,
+ include/net-snmp/library/read_config.h:
+
+ Builds again with MSVC.
+
+2010-03-20 20:20 bvassche
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ Added a trailing backslash (should have been added in the
+ previous commit).
+
+2010-03-20 19:36 bvassche
+
+ * agent/agent_registry.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/agent/extend.c, agent/mibgroup/agent/nsDebug.c,
+ agent/mibgroup/agent/nsLogging.c, agent/mibgroup/agentx/master.c,
+
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/vacm_conf.c, agent/mibgroup/misc/ipfwacc.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c,
+ agent/mibgroup/util_funcs.c, agent/snmpd.c,
+ apps/snmpnetstat/route.c, apps/snmptrapd.c,
+ include/net-snmp/agent/table_dataset.h, include/net-snmp/types.h,
+ snmplib/snmpIPv6BaseDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv6Domain.c, snmplib/system.c, snmplib/tools.c,
+ snmplib/winpipe.c, snmplib/winservice.c:
+
+ CHANGES: libsnmp: changed the type of the fourth argument of
+ netsnmp_set_row_column() from const char* to const void* such
+ that no cast is necessary when passing another datatype then
+ char* or const char*.
+ CHANGES: Win32: changed in_addr_t from u_int to u_long such that
+ it matches the datatype of sockaddr_in::sin_addr.
+ Also, fixed several compiler warnings (mostly char * <> u_char *
+ mismatches) and removed some casts.
+
+2010-03-20 19:16 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Fixed the compiler warnings reported by gcc (MinGW).
+
+2010-03-20 19:05 bvassche
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Added configure test for sigprocmask.
+
+2010-03-20 09:14 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Refactoring: moved duplicated code into a new function.
+
+2010-03-19 22:56 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c, agent/snmpd.c, snmplib/parse.c:
+
+ Report MIB and config directories search paths on errors
+ (and in the help message)
+
+2010-03-19 13:12 bvassche
+
+ * agent/agent_registry.c:
+
+ CHANGES: snmpd: made the error message that is logged when
+ duplicate registration is attempted more detailed.
+
+ An example:
+ (before)
+ duplicate registration (mibII/snmp,
+ C:\WINDOWS\System32\snmpmib.dll)
+ handler registration failed.
+ (after)
+ duplicate registration: MIB modules mibII/snmp and
+ C:\WINDOWS\System32\snmpmib.dll (oid .1.3.6.1.2.1.11).
+ handler registration failed.
+
+2010-03-19 12:40 bvassche
+
+ * agent/mibgroup/winExtDLL.c, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in:
+
+ CHANGES: Win32: winExtDLL: multiple varbind set requests are now
+ processed correctly.
+ CHANGES: Win32: winExtDLL: made error codes in SNMP response PDUs
+ as RFC-compliant as possible.
+ CHANGES: Win32: winExtDLL: if loading an extension DLL fails, the
+ reason why loading failed is now logged.
+ CHANGES: Win32: winExtDLL: fixed a memory leak that occurred when
+ SnmpExtensionQuery(Ex) failed. This memory leak has been found
+ via source reading. Note: it is not clear whether it was possible
+ to trigger this memory leak. This leak is certainly not triggered
+ by every request for which a response with non-zero error status
+ is sent back.
+
+2010-03-18 16:29 rstory
+
+ * agent/mibgroup/agent/nsLogging.c,
+ include/net-snmp/library/snmp_logging.h, snmplib/snmp_logging.c:
+
+ keep count of enabled logs; use this count to determine when to
+ log to stderr
+
+2010-03-18 16:28 rstory
+
+ * apps/snmptranslate.c, apps/snmptrapd.c, snmplib/cert_util.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c:
+
+ NEWS: snmplib: new snmp token logOption allows specifying log
+ destinations vi conf files
+ - if stderr log enabled because of no log destination, turn it
+ off when a
+ log destination is enabled
+ - don't call netsnmp_enable_stderrlog() from apps anymore
+
+2010-03-18 15:31 rstory
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpUDPBaseDomain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv4BaseDomain.c:
+
+ udp transport inheritance tweaks
+ - move basic udp recvfrom/sendto code from UDPDomain to
+ UDPBaseDomain
+ - tweak upd recvfrom/sendto to call udpbase verstion
+ - tweak udpipv4 recvfrom/sendto to call udpbase version
+ - also fixed netsnmp_ipv4_* -> netsnmp_udpipv4_*
+ - tweak DTLSUDPDomain ot use udpbase_* instead of udp_*
+
+2010-03-18 15:21 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/snmp_api.c:
+
+ protect cert header and init call with ifdefs
+
+2010-03-17 19:01 rstory
+
+ * snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSTCPDomain.c:
+
+ use new utility routine for cert names
+
+2010-03-17 19:01 rstory
+
+ * snmplib/cert_util.c:
+
+ move snmp_openssl header after openssl headers
+
+2010-03-17 19:00 rstory
+
+ * include/net-snmp/library/snmp_openssl.h, snmplib/snmp_openssl.c:
+
+ add routines to pull/dump names from X509 certs
+
+2010-03-17 19:00 rstory
+
+ * snmplib/cert_util.c:
+
+ use enum lists to manage directory indexes
+
+2010-03-17 19:00 rstory
+
+ * snmplib/snmp_enum.c:
+
+ initialize static storage before use; protect enum init from
+ multiple calls
+
+2010-03-17 18:54 rstory
+
+ * README.agent-mibs:
+
+ add info about new tsm/tls mibs
+
+2010-03-17 18:54 rstory
+
+ * snmplib/snmpTLSBaseDomain.c, snmplib/snmp_api.c:
+
+ move cert init to snmp init
+
+2010-03-17 13:37 bvassche
+
+ * mibs/NET-SNMP-AGENT-MIB.txt, mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Updated MIB revision history.
+
+2010-03-17 13:29 bvassche
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: fixed one leak-at-exit.
+
+2010-03-17 12:44 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ CHANGES: BUG: 2971257: Fixed winExtDLL handling of multi-varbind
+ getNext requests with OIDs in reverse lexicographical order.
+
+2010-03-17 10:25 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ More winExtDLL debug output tuning.
+
+2010-03-16 19:31 bvassche
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ Compiles now with MIB compilers that do not recognize a double
+ dash as the end of a MIB comment.
+
+2010-03-16 19:27 bvassche
+
+ * mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Fixed two syntax errors.
+
+2010-03-16 19:18 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ CHANGES: Win32: winExtDLL: fixed a bug in getNext handling that
+ could cause the MIB output to be truncated.
+
+2010-03-16 18:50 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Made winExtDLL debug output more detailed.
+
+2010-03-16 15:24 bvassche
+
+ * include/net-snmp/library/snmpSocketBaseDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h:
+
+ Made sure that C++ programs that include Net-SNMP header files
+ compile again.
+
+2010-03-15 07:20 magfr
+
+ * agent/helpers/instance.c:
+
+ Make it compile with --disable-deprecated again.
+
+2010-03-15 07:19 magfr
+
+ * agent/helpers/debug_handler.c:
+
+ Disable all the printing if debug output is off.
+
+2010-03-15 00:17 tanders
+
+ * perl/TrapReceiver/TrapReceiver.xs, perl/agent/agent.xs:
+
+ fix compiler warnings regarding printf format
+
+2010-03-15 00:07 tanders
+
+ *
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+ agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ fix compiler warnings regarding printf format
+
+2010-03-14 21:05 rstory
+
+ * agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h:
+
+ make sure header ifdef name is unique
+
+2010-03-14 21:04 rstory
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swrun.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h,
+ agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h:
+
+ add missing init/shutdown prototypes to fix compiler warnings
+
+2010-03-14 21:03 rstory
+
+ * snmplib/data_list.c:
+
+ move debug message earlier
+
+2010-03-14 21:02 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container_list_ssll.c:
+
+ add prototype for netsnmp_init_container; fix compler warning
+
+2010-03-14 20:51 magfr
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ Correct netsnmp_assert_or_return and netsnmp_assert_or_msgreturn
+ for the NETSNMP_NO_DEBUGGING case
+
+2010-03-14 19:10 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/cert_util.c,
+ snmplib/snmpTLSBaseDomain.c:
+
+ rename cert init/shutdown funcs; only compile cert_utils if
+ using/have SSL; init certs from tls base
+
+2010-03-14 19:09 rstory
+
+ * snmplib/cert_util.c:
+
+ call netsnmp_init_openssl instead of netsnmp_init_tlsbase
+
+2010-03-14 19:09 rstory
+
+ * include/net-snmp/library/snmp_api.h:
+
+ update for renamed objects in version 08 of the dtls draft
+
+2010-03-14 19:08 rstory
+
+ * agent/mibgroup/tlstm-mib, agent/mibgroup/tlstm-mib.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession.h,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.c,
+ agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable.h,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.c,
+ agent/mibgroup/tlstm-mib/tlstmAddrTable/tlstmAddrTable.h,
+ agent/mibgroup/tsm-mib, agent/mibgroup/tsm-mib.h,
+ agent/mibgroup/tsm-mib/snmpTsmStats,
+ agent/mibgroup/tsm-mib/snmpTsmStats.h,
+ agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c,
+ agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h:
+
+ import initial code for dtls mibs
+
+2010-03-14 19:08 rstory
+
+ * mibs/TLSTM-MIB.txt:
+
+ TLSTM-MIB from draft-ietf-isms-dtls-tm-09.txt
+
+2010-03-14 17:21 bvassche
+
+ * agent/helpers/snmp_get_statistic.c, agent/mibgroup/mibII/icmp.c:
+
+ Fixed a few more compiler warnings.
+
+2010-03-14 14:10 bvassche
+
+ * perl/default_store/test.pl:
+
+ Follow-up for r17384: changed NETSNMP_DS_MAX_SUBIDS from 40 to
+ 48.
+
+2010-03-14 13:53 bvassche
+
+ * configure, configure.d/config_os_progs:
+
+ Changes:
+ - Removed -Wno-char-subscripts from DEVFLAGS. Using a variable or
+ expression of
+ type char as an array index is almost always an error.
+ Furthermore,
+ -Wchar-subscript does not trigger any warnings on the Net-SNMP
+ code base.
+ - Removed -Winline from DEVFLAGS. Not only was nobody paying
+ attention to the
+ messages triggered by -Winline, but recent versions of the gcc
+ compiler are
+ better than humans at deciding which functions should be inlined
+ and which
+ ones not.
+
+2010-03-14 13:39 bvassche
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Reran autoreconf.
+
+2010-03-14 13:39 bvassche
+
+ * agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/data_access/swrun_procfs_status.c,
+ agent/mibgroup/host/hrSWRunPerfTable.c,
+ agent/mibgroup/host/hrSWRunTable.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c:
+
+ Fixed several compiler warnings.
+
+2010-03-14 13:36 bvassche
+
+ * perl/SNMP/SNMP.xs:
+
+ Removed the '0x' prefix again from a debug statement that was
+ introduced in r18282.
+
+2010-03-13 19:07 bvassche
+
+ * perl/ASN/ASN.xs, perl/OID/OID.xs, perl/SNMP/SNMP.xs,
+ perl/TrapReceiver/TrapReceiver.xs, perl/TrapReceiver/ppport.h,
+ perl/agent/agent.xs:
+
+ Fixed most compiler warnings triggered by the source code in the
+ perl subdirectory.
+ Note: these changes may contain some real bug fixes.
+
+2010-03-13 09:57 bvassche
+
+ * snmplib/cert_util.c, snmplib/snmp_api.c:
+
+ Fixed several recently introduced compiler warnings.
+
+2010-03-13 01:16 hardaker
+
+ * acconfig.h, configure, include/net-snmp/net-snmp-config.h.in:
+
+ define the TLSTCP DOMAIN
+
+2010-03-13 01:16 hardaker
+
+ * snmplib/snmp_transport.c:
+
+ fix ifdef typo
+
+2010-03-12 20:26 hardaker
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ change debugging symbol names to a generic tls string
+
+2010-03-12 20:22 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ initial working SNMP over TLS over TCP connection
+
+2010-03-12 20:22 hardaker
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ print a more complete OpenSSL stack
+
+2010-03-12 20:22 hardaker
+
+ * snmplib/snmptsm.c:
+
+ fix assert statements
+
+2010-03-12 20:21 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h:
+
+ added an accepted_bio pointer for the bio after SSL_accept
+
+2010-03-12 20:21 hardaker
+
+ * snmplib/snmp_transport.c:
+
+ add the ability for f_copy and f_config
+
+2010-03-12 20:21 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ missing ;
+
+2010-03-12 20:21 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ add a f_copy pointer
+
+2010-03-12 20:20 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ return int not int * on error
+
+2010-03-12 20:20 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ added a f_config function for transports
+
+2010-03-12 11:53 dts12
+
+ * apps/snmptable.c:
+
+ CHANGES: snmptable: PATCH: 2850067: Suppress extraneous "index"
+ header token
+ Patch supplied by Dan Nelson
+
+2010-03-12 11:43 dts12
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c:
+
+ Remove duplicate definition of
+ getulongfromsysclassnetstatistics()
+
+2010-03-11 16:52 dts12
+
+ * man/snmpcmd.1.def:
+
+ Document the format of the -e/-E command line options.
+
+2010-03-11 16:47 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Remove mention of the (abandoned) 'dataset2' helper.
+
+2010-03-11 15:59 dts12
+
+ * snmplib/cert_util.c:
+
+ Don't initialise the TLS transport unless it's actually been
+ configured in.
+
+2010-03-11 15:47 rstory
+
+ * testing/eval_suite.sh:
+
+ use SNMP_TMPDIR instead of TMPDIR
+
+2010-03-11 15:31 rstory
+
+ * snmplib/snmptsm.c:
+
+ query right bool (tsm prefix is lib bool, not app)
+
+2010-03-11 15:08 dts12
+
+ * agent/auto_nlist.c, agent/mibgroup/examples/ucdDemoPublic.c,
+ apps/snmptest.c, snmplib/parse.c, snmplib/tools.c:
+
+ CHANGES: PATCH: 2952034: Return of the Great SuSE 'sprintf'
+ Hunt...
+ Patch supplied by Leonardo Chiquitto
+
+2010-03-11 14:55 dts12
+
+ * local/traptoemail:
+
+ CHANGES: PATCH: 2937996: Add Date: header to email send by
+ traptoemail
+
+2010-03-11 14:50 dts12
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c:
+
+ CHANGES: snmpd: PATCH: 2967400: Retrieve error counters for the
+ EtherLike-MIB
+ Patch supplied by Josef Moellers.
+
+2010-03-11 14:23 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ CHANGES: snmpd: PATCH: 2968642: Catch overflow of pass-through
+ command buffer.
+ Patch from Andreas Jaeger/Leonardo Chiquitto
+
+2010-03-11 12:37 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ CHANGES: snmpd: PATCH: 2956657: Handle over-length AgentX OIDs.
+ Patch provided by Rob West
+
+2010-03-11 12:23 dts12
+
+ * agent/mibgroup/ip-mib/data_access/defaultrouter_common.c:
+
+ Provide missing debug parameter.
+ Patch provided by Andreas Jaeger.
+
+2010-03-11 12:21 dts12
+
+ * agent/mibgroup/hardware/sensors/hw_sensors.c:
+
+ Provide missing (dummy) return value, to suppress compiler
+ warning.
+ Patch provided by Andreas Jaeger.
+
+2010-03-11 12:19 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ Suppress warnings of possible buffer overflow.
+ This doesn't _actually_ protect against such an overflow,
+ since the target buffer is non-empty, so strncat can't
+ use it all anyway. But this should at least mislead the
+ compiler sufficiently to shut it up!
+
+ Patch provided by Andreas Jaeger.
+
+2010-03-11 11:57 dts12
+
+ * configure, configure.d/config_os_misc4:
+
+ Replace backquote with single quote in configure output message.
+ While this change is probably not strictly necessary, it feels
+ sensible to avoid this particular use of backquotes, Just In
+ Case.
+ See discussion in Patch #2952169
+
+2010-03-11 11:43 dts12
+
+ * snmplib/mib.c:
+
+ CHANGES: library: PATCH: 2952140: Overflow counter32 and gauge32
+ on 64bit systems correctly
+ Patch provided by Leonardo Chiquitto
+
+2010-03-11 11:36 dts12
+
+ * testing/TESTCONF.sh, testing/eval_suite.sh:
+
+ CHANGES: build: PATCH: 2952020: Explicitly set permission on
+ temporary testing output directories.
+ Patch provided by Leonardo Chiquitto.
+
+2010-03-11 11:26 dts12
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ CHANGES: snmpd: PATCH: 2950845: Fix ifHighSpeed calculation
+ Patch provided by Leonardo Chiquitto
+
+2010-03-11 08:26 bvassche
+
+ * perl/ASN/ASN.xs, perl/ASN/Makefile.PL, perl/OID/Makefile.PL,
+ perl/OID/OID.xs, perl/TrapReceiver/Makefile.PL,
+ perl/TrapReceiver/TrapReceiver.xs, perl/agent/Makefile.PL,
+ perl/agent/Support/Makefile.PL, perl/agent/agent.xs,
+ perl/agent/default_store/Makefile.PL,
+ perl/agent/default_store/default_store.xs,
+ perl/default_store/Makefile.PL,
+ perl/default_store/default_store.xs:
+
+ Made compilation of the Perl module NetSNMP.pm on Windows more
+ silent: added compiler flags -D_CRT_SECURE_NO_WARNINGS
+ -D_CRT_NONSTDC_NO_WARNINGS and made sure that #include
+ <net-snmp/net-snmp-config.h> occurs before any other include file
+ that defines _WIN32_WINNT.
+
+2010-03-10 23:31 rstory
+
+ * include/net-snmp/library/cert_util.h, snmplib/Makefile.in,
+ snmplib/cert_util.c:
+
+ NEWS: snmplib: create indexes for certificates in config path
+
+2010-03-10 18:48 bvassche
+
+ * snmplib/snmpSocketBaseDomain.c:
+
+ Added "#include <unistd.h>" such that on Unix systems the
+ compiler does not print a warning about a missing declaration for
+ the function close().
+
+2010-03-10 18:30 rstory
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, perl/ASN/ASN.pm,
+ perl/AnyData_SNMP/Storage.pm, perl/OID/OID.pm, perl/SNMP/SNMP.pm,
+ perl/TrapReceiver/TrapReceiver.pm,
+ perl/agent/Support/Support.pm, perl/agent/agent.pm,
+ perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm:
+
+ update version to 5.6.dev
+
+2010-03-10 18:29 rstory
+
+ * local/Version-Munge.pl:
+
+ CHANGES: building: update Version-Munge for renamed configure.ac
+
+2010-03-10 18:29 rstory
+
+ * configure.ac:
+
+ CHANGES: building: save configure cache every once in while
+
+2010-03-10 16:12 bvassche
+
+ * win32/libsnmp/Makefile.in:
+
+ Reordered some of the Makefile rules in order to minimize the
+ diffs with libsnmp_dll/Makefile.in.
+
+2010-03-10 16:10 bvassche
+
+ * win32/libsnmp_dll/Makefile.in:
+
+ Win32, batch building: DLL builds again.
+
+2010-03-10 16:07 bvassche
+
+ * agent/helpers/cache_handler.c:
+
+ Fixed a recently introduced compiler warning by adding a forward
+ declaration for the function _cache_free().
+
+2010-03-10 16:06 bvassche
+
+ * snmplib/container.c:
+
+ Builds again on Win32.
+
+2010-03-10 04:17 rstory
+
+ * README:
+
+ add missing contributors
+
+2010-03-10 04:17 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c:
+
+ CHANGES: snmplib: fix potential double free in CONTAINER_FREE
+ - also added several compare routines
+
+2010-03-10 04:17 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ CHANGES: snmplib: when freeing a cache, stop timer and call cache
+ free func
+ - also add netsnmp_cache_remove
+
+2010-03-10 03:52 rstory
+
+ * README, agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/container.h, snmplib/Makefile.in,
+ snmplib/cert_util.c, snmplib/container.c:
+
+ undo commit 18234
+
+2010-03-10 03:41 rstory
+
+ * README, agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/library/cert_util.h,
+ include/net-snmp/library/container.h, snmplib/Makefile.in,
+ snmplib/cert_util.c, snmplib/container.c:
+
+ Merge branch 'pullme' of ../trunk-staging
+
+2010-03-09 17:48 bvassche
+
+ * include/net-snmp/mib_api.h:
+
+ CHANGES: Win32: exported netsnmp_read_module() from netsnmp.dll
+ such that NetSNMP.pm builds again.
+
+2010-03-09 17:47 bvassche
+
+ * win32/libagent/Makefile.in, win32/libsnmp_dll/Makefile.in:
+
+ Simplified two makefiles used by build.bat (Win32).
+
+2010-03-09 17:24 bvassche
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: Win32: building: building NetSNMP.pm does no longer
+ trigger compiler warnings about redefining _WIN32_WINNT nor
+ NTDDI_VERSION.
+
+2010-03-09 17:22 bvassche
+
+ * perl/SNMP/Makefile.PL:
+
+ CHANGES: Win32: building: made building NetSNMP.pm more silent by
+ adding the MSVC compiler flags -D_CRT_SECURE_NO_WARNINGS
+ -D_CRT_NONSTDC_NO_WARNINGS.
+
+2010-03-09 17:09 rstory
+
+ * snmplib/read_config.c:
+
+ remove debug msg used during debugging
+
+2010-03-09 17:02 marz
+
+ * local/net-snmp-cert:
+
+ initial cert wrapper - testing repo write privs
+
+2010-03-09 10:20 bvassche
+
+ * win32/netsnmpmibs/Makefile.in:
+
+ Removed duplicate build rules. These duplicate rules were
+ harmless but triggered a warning.
+
+2010-03-09 02:38 rstory
+
+ * include/net-snmp/library/dir_utils.h, snmplib/dir_utils.c:
+
+ CHANGES: snmplib: directory container enhancements
+ - fix potential memory leak
+ - add filter callback to filter files returned
+ - add option to return relative and not full paths
+ - add option to sort returned list
+ - add option to return empty container instead of NULL if no
+ files found
+ - change default container name to directory that was scanned
+ - tweak debug/log messages
+
+2010-03-08 23:07 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/util_funcs/get_pid_from_inode.c,
+ include/net-snmp/library/snmp_logging.h:
+
+ CHANGES: snmpd: define and use new NETSNMP_LOGONCE macro
+
+2010-03-08 22:44 rstory
+
+ * man/snmp_config.5.def, snmplib/read_config.c:
+
+ NEWS: snmplib: conf files can now include other conf files
+ - also tweaked debug tokens here and there
+
+2010-03-08 22:43 rstory
+
+ * snmplib/snmp_transport.c:
+
+ fix typo (caused external reference when DTLSUDP configured
+ without dtlstcp)
+
+2010-03-06 02:27 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c,
+ snmplib/container_binary_array.c, snmplib/container_list_ssll.c:
+
+ NEWS: snmplib: netsnmp_container enhancements:
+ - add free_item function; defaults to
+ netsnmp_container_simple_free
+ - add CONTAINER_FREE_ALL macro/function (like CONTAINER_CLEAR but
+ calls container free_item for each item in primary container)
+ - add ability to set options on binary_array containers
+
+2010-03-02 17:55 bvassche
+
+ * win32/libsnmp/Makefile.in:
+
+ Made sure that win32/build.bat works again by adding missing
+ source file names. Sorted source file names alphabetically too.
+
+2010-03-02 16:54 bvassche
+
+ * win32/Configure, win32/netsnmpmibs/Makefile.in,
+ win32/snmpd/Makefile.in:
+
+ Follow-up for r18167 (merge of snmpd and snmpdsdk and also of
+ netsnmpmibs and netsnmpmibssdk): the batch file win32/build.bat
+ works again with the Platform SDK enabled.
+
+2010-03-02 16:52 bvassche
+
+ * win32/Makefile-apps.in:
+
+ Follow-up for r18215 (replaced the obsolete cl.exe option /GX by
+ the equivalent /EHsc; added /D "_CRT_SECURE_NO_WARNINGS", added
+ /D "_CRT_NONSTDC_NO_WARNINGS" and removed /Fp... and /YX).
+
+2010-02-28 15:56 bvassche
+
+ * snmplib/winservice.c:
+
+ Win32: fixed a compiler warning about redefinition of
+ _WIN32_WINNT by making sure that <net-snmp/net-snmp-config.h> is
+ included before <windows.h>.
+
+2010-02-28 15:24 bvassche
+
+ * win32/libagent/Makefile.in, win32/libhelpers/Makefile.in,
+ win32/libnetsnmptrapd/Makefile.in, win32/libsnmp/Makefile.in,
+ win32/libsnmp_dll/Makefile.in, win32/netsnmpmibs/Makefile.in,
+ win32/snmpd/Makefile.in, win32/snmpnetstat/Makefile.in,
+ win32/snmptrapd/Makefile.in:
+
+ CHANGES: Win32: batch build: replaced the obsolete /GX by the
+ equivalent /EHsc.
+ CHANGES: Win32: batch build: added /D "_CRT_SECURE_NO_WARNINGS"
+ /D "_CRT_NONSTDC_NO_WARNINGS" to make building with MSVC 2008
+ more silent.
+ CHANGES: Win32: batch build: removed /Fp... and /YX. These
+ options influence how precompiled header files are generated,
+ which are not used inside the Net-SNMP project. /YX is not
+ supported by MSVC 2008.
+ CHANGES: Win32: batch build: removed a duplicate occurrence of
+ strtoull.obj.
+
+2010-02-28 14:11 bvassche
+
+ * win32/Configure, win32/Makefile.in:
+
+ Follow-up for r18167 (merge of snmpd and snmpdsdk and also of
+ netsnmpmibs and netsnmpmibssdk): applied the necessary changes to
+ the win32/Configure script and win32/Makefile.in.
+
+2010-02-27 13:11 bvassche
+
+ * agent/mibgroup/agent/nsCache.c, include/net-snmp/config_api.h,
+ include/net-snmp/library/asn1.h,
+ include/net-snmp/library/callback.h,
+ include/net-snmp/library/check_varbind.h,
+ include/net-snmp/library/container.h,
+ include/net-snmp/library/container_list_ssll.h,
+ include/net-snmp/library/container_null.h,
+ include/net-snmp/library/data_list.h,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/fd_event_manager.h,
+ include/net-snmp/library/int64.h,
+ include/net-snmp/library/keytools.h,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/library/md5.h, include/net-snmp/library/mib.h,
+ include/net-snmp/library/mt_support.h,
+ include/net-snmp/library/oid_stash.h,
+ include/net-snmp/library/parse.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/scapi.h,
+ include/net-snmp/library/snmp-tc.h,
+ include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmp_alarm.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_enum.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/library/snmp_parse_args.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmp_service.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/snmpv3.h,
+ include/net-snmp/library/system.h,
+ include/net-snmp/library/tools.h,
+ include/net-snmp/library/ucd_compat.h,
+ include/net-snmp/library/vacm.h,
+ include/net-snmp/library/winpipe.h, include/net-snmp/mib_api.h,
+ include/net-snmp/pdu_api.h, include/net-snmp/session_api.h,
+ include/net-snmp/varbind_api.h, include/net-snmp/version.h,
+ snmplib/getopt.c, snmplib/gettimeofday.c, snmplib/mib.c,
+ snmplib/parse.c, snmplib/snmp_alarm.c, snmplib/snmp_api.c,
+ snmplib/snmp_client.c, snmplib/snmp_debug.c, snmplib/snmpv3.c,
+ snmplib/strlcpy.c, snmplib/strtok_r.c, snmplib/strtoull.c,
+ snmplib/tools.c, snmplib/ucd_compat.c, snmplib/winpipe.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: Win32: declared all functions that are exported from the
+ Net-SNMP DLL as NETSNMP_IMPORT. The result is a minor
+ optimization: code that uses the Net-SNMP DLL will now call the
+ DLL-exported functions directly instead of indirectly via the
+ stub in the import library.
+
+2010-02-27 11:50 bvassche
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Removed a redundant strncasecmp() declaration.
+
+2010-02-27 09:57 bvassche
+
+ * snmplib/strtok_r.c:
+
+ Fixed a typo in a source code comment.
+
+2010-02-27 09:56 bvassche
+
+ * snmplib/snmp_transport.c:
+
+ Follow-up for r18189 (rstory): builds again on Windows.
+
+2010-02-25 17:53 bvassche
+
+ * win32/encode_keychange/encode_keychange.dsp,
+ win32/encode_keychange/encode_keychange.vcproj,
+ win32/libagent/libagent.dsp, win32/libagent/libagent.vcproj,
+ win32/libhelpers/libhelpers.dsp,
+ win32/libhelpers/libhelpers.vcproj,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp/libsnmp.vcproj,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/libsnmp_dll/libsnmp_dll.vcproj,
+ win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibs/netsnmpmibs.vcproj,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkget/snmpbulkget.vcproj,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd/snmpd.dsp,
+ win32/snmpd/snmpd.vcproj, win32/snmpdelta/snmpdelta.dsp,
+ win32/snmpdelta/snmpdelta.vcproj, win32/snmpdf/snmpdf.dsp,
+ win32/snmpdf/snmpdf.vcproj, win32/snmpget/snmpget.dsp,
+ win32/snmpget/snmpget.vcproj, win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpgetnext/snmpgetnext.vcproj,
+ win32/snmpnetstat/snmpnetstat.dsp,
+ win32/snmpnetstat/snmpnetstat.vcproj, win32/snmpset/snmpset.dsp,
+ win32/snmpset/snmpset.vcproj, win32/snmpstatus/snmpstatus.dsp,
+ win32/snmpstatus/snmpstatus.vcproj,
+ win32/snmptable/snmptable.dsp, win32/snmptable/snmptable.vcproj,
+ win32/snmptest/snmptest.dsp, win32/snmptest/snmptest.vcproj,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptranslate/snmptranslate.vcproj,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrap/snmptrap.vcproj,
+ win32/snmptrapd/snmptrapd.dsp, win32/snmptrapd/snmptrapd.vcproj,
+ win32/snmpusm/snmpusm.dsp, win32/snmpusm/snmpusm.vcproj,
+ win32/snmpvacm/snmpvacm.dsp, win32/snmpvacm/snmpvacm.vcproj,
+ win32/snmpwalk/snmpwalk.dsp, win32/snmpwalk/snmpwalk.vcproj,
+ win32/win32.dsw, win32/win32.sln, win32/win32dll.dsw,
+ win32/win32dll.sln:
+
+ Reverted r18207 (dsp/dsw to vcproj/sln conversion) except the
+ suppression
+ list changes. The goal of this conversion was twofold: not only
+ to be able
+ to load the project files in MSVC 2002 - 2008 but also to be able
+ to commit
+ changes made from inside the MSVC 2008 IDE. Unfortunately
+ converting dsp/dsw
+ files to vcproj/sln files with MSVC 2008 makes it impossible to
+ load the
+ vcproj/sln files with earlier MSVC versions. Why on earth did
+ Microsoft
+ decide to put a version number in XML files ?
+
+2010-02-24 19:41 bvassche
+
+ * win32, win32/encode_keychange,
+ win32/encode_keychange/encode_keychange.dsp,
+ win32/encode_keychange/encode_keychange.vcproj, win32/libagent,
+ win32/libagent/libagent.dsp, win32/libagent/libagent.vcproj,
+ win32/libhelpers, win32/libhelpers/libhelpers.dsp,
+ win32/libhelpers/libhelpers.vcproj, win32/libnetsnmptrapd,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/libnetsnmptrapd/libnetsnmptrapd.vcproj, win32/libsnmp,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp/libsnmp.vcproj,
+ win32/libsnmp_dll, win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/libsnmp_dll/libsnmp_dll.vcproj, win32/netsnmpmibs,
+ win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibs/netsnmpmibs.vcproj, win32/snmpbulkget,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkget/snmpbulkget.vcproj, win32/snmpbulkwalk,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.vcproj, win32/snmpd,
+ win32/snmpd/snmpd.dsp, win32/snmpd/snmpd.vcproj, win32/snmpdelta,
+ win32/snmpdelta/snmpdelta.dsp, win32/snmpdelta/snmpdelta.vcproj,
+ win32/snmpdf, win32/snmpdf/snmpdf.dsp,
+ win32/snmpdf/snmpdf.vcproj, win32/snmpget,
+ win32/snmpget/snmpget.dsp, win32/snmpget/snmpget.vcproj,
+ win32/snmpgetnext, win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpgetnext/snmpgetnext.vcproj, win32/snmpnetstat,
+ win32/snmpnetstat/snmpnetstat.dsp,
+ win32/snmpnetstat/snmpnetstat.vcproj, win32/snmpset,
+ win32/snmpset/snmpset.dsp, win32/snmpset/snmpset.vcproj,
+ win32/snmpstatus, win32/snmpstatus/snmpstatus.dsp,
+ win32/snmpstatus/snmpstatus.vcproj, win32/snmptable,
+ win32/snmptable/snmptable.dsp, win32/snmptable/snmptable.vcproj,
+ win32/snmptest, win32/snmptest/snmptest.dsp,
+ win32/snmptest/snmptest.vcproj, win32/snmptranslate,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptranslate/snmptranslate.vcproj, win32/snmptrap,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrap/snmptrap.vcproj,
+ win32/snmptrapd, win32/snmptrapd/snmptrapd.dsp,
+ win32/snmptrapd/snmptrapd.vcproj, win32/snmpusm,
+ win32/snmpusm/snmpusm.dsp, win32/snmpusm/snmpusm.vcproj,
+ win32/snmpvacm, win32/snmpvacm/snmpvacm.dsp,
+ win32/snmpvacm/snmpvacm.vcproj, win32/snmpwalk,
+ win32/snmpwalk/snmpwalk.dsp, win32/snmpwalk/snmpwalk.vcproj,
+ win32/win32.dsw, win32/win32.sln, win32/win32dll.dsw,
+ win32/win32dll.sln:
+
+ (reverted) CHANGES: Win32: building: converted .dsp/.dsw files to
+ .vcproj/.sln files. This implies that support for MSVC 6.0 has
+ been dropped and the minimum Microsoft Visual Studio version
+ required to build the Net-SNMP source code is Microsoft Visual
+ Studio .NET (2002).
+
+2010-02-23 19:03 bvassche
+
+ * configure, configure.d/config_project_manual:
+
+ CHANGES: building: when generating a default value for the system
+ location and no domain name is found in /etc/resolv.conf, use
+ "@no.where" instead of "".
+
+2010-02-23 18:50 bvassche
+
+ * configure, m4/ac_prompt_user.m4:
+
+ CHANGES: building: made sure that the configure script does no
+ longer invoke "tail -1", which is not POSIX-compliant.
+
+2010-02-23 18:45 hardaker
+
+ * testing/tests/T300udp, testing/tests/T310tcp,
+ testing/tests/T320udpv6, testing/tests/T330tcpv6,
+ testing/tests/T350unix, testing/tests/T360dtlsudp,
+ testing/tests/T399alias:
+
+ Removed all transport tests since it's impossible to determine
+ where they can safely operate (was stopping tanders' nightly
+ tests from succeeding)
+
+2010-02-23 18:41 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ more error and debugging output
+
+2010-02-23 18:40 hardaker
+
+ * snmplib/snmpTLSBaseDomain.c:
+
+ fix the server context generator to actually, um, return the
+ context.
+
+2010-02-23 18:40 hardaker
+
+ * agent/agent_trap.c:
+
+ initialize the 'res' variable since it's checked
+
+2010-02-23 18:39 hardaker
+
+ * snmplib/snmpTLSTCPDomain.c:
+
+ more progress toward a real implementation
+
+2010-02-23 18:38 hardaker
+
+ * snmplib/snmp_transport.c:
+
+ tlstcp ctor invocation
+
+2010-02-23 18:38 hardaker
+
+ * include/net-snmp/library/snmpTLSTCPDomain.h:
+
+ require TLSBase
+
+2010-02-23 18:37 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ added host identifier as output
+
+2010-02-23 18:35 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpTLSTCPDomain.c:
+
+ significant more work on the TLS TCP domain
+
+2010-02-23 17:43 bvassche
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ Follow-up for r18193 (jsafranek): reran autoreconf for the trunk
+ and the 5.5 branch.
+
+2010-02-23 14:58 rstory
+
+ * snmplib/snmp_api.c:
+
+ use NETSNMP_PRIz instead of %z
+
+2010-02-23 12:27 jsafranek
+
+ * configure.d/config_os_libs:
+
+ CHANGES: building: Fixed compilation with rpm-4.6.
+ Turn on the legacy API when rpm-4.6 is detected.
+
+2010-02-23 07:38 bvassche
+
+ * snmplib/snmp_alarm.c, snmplib/snmp_api.c:
+
+ Reverted r18000 (disabling SIGALRM support) because this involves
+ a backwards-incompatible change.
+
+2010-02-23 00:36 rstory
+
+ * snmplib/snmpTCPDomain.c:
+
+ fix typo in comment
+
+2010-02-23 00:34 rstory
+
+ * snmplib/snmp_api.c:
+
+ debug msg tweaks; use new tranport functions
+ - add debug header for snmp version
+ - add length to debug send/receive messages
+ - use new tranport functions for send/recv/finding peer address
+
+2010-02-23 00:25 rstory
+
+ * include/net-snmp/library/snmp_transport.h,
+ snmplib/snmp_transport.c:
+
+ add netsnmp_transport_peer_string, netsnmp_transport_send &
+ netsnmp_transport_recv
+ - moves transport manipulation into transport code
+ - central place for logging/debugging sent/received data
+
+2010-02-22 19:33 bvassche
+
+ * configure, configure.d/config_modules_agent,
+ configure.d/config_project_manual:
+
+ CHANGES: building: made sure that the configure script does no
+ longer invoke "tail -1", which is not POSIX-compliant.
+
+2010-02-22 19:21 bvassche
+
+ * agent/agent_registry.c:
+
+ Follow-up for r18186. Regression test 34 (whether authentication
+ failure traps are sent by snmpd) passes now again.
+
+2010-02-22 09:18 bvassche
+
+ * agent/agent_registry.c:
+
+ CHANGES: snmpd: made sure that handler registration failure does
+ not create dangling pointers in the MIB subtree registry.
+
+2010-02-22 09:11 bvassche
+
+ * agent, apps, apps/snmpnetstat:
+
+ Updated Subversion ignore list.
+
+2010-02-22 08:42 bvassche
+
+ * configure:
+
+ Follow-up for r18084: fixed libeay32 (OpenSSL) configure test for
+ MinGW.
+
+2010-02-22 08:31 bvassche
+
+ * configure.d/config_os_libs:
+
+ Follow-up for r18084: fixed libeay32 (OpenSSL) configure test for
+ MinGW.
+
+2010-02-22 08:13 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Builds again with MinGW when IPv6 support is enabled.
+
+2010-02-21 18:58 bvassche
+
+ * README.win32, win32/libsdll.dsw,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in, win32/win32dll.dsw:
+
+ CHANGES: Win32: building: renamed libsdll.dsw into win32dll.dsw.
+ CHANGES: Win32: building: simplified linking the Net-SNMP
+ applications with netsnmp.dll by adding all application projects
+ to the same workspace that is used for building the DLL.
+ CHANGES: Win32: building: made building netsnmp.dll less error
+ prone by letting the compiler print an error message if the
+ preprocessor symbol NETSNMP_USE_DLL has not been defined.
+
+2010-02-21 18:51 bvassche
+
+ * win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ CHANGES: Win32: building: Added libsnmp.def to the list of
+ libsnmp_dll.dsp source files such that the DLL is rebuilt when
+ the .def file has been modified.
+
+2010-02-21 18:45 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ CHANGES: Win32: exported netsnmp_set_line_buffering() from
+ netsnmp.dll.
+
+2010-02-21 17:39 bvassche
+
+ * snmplib/snmpIPv6BaseDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ More Win32 IPv6 source code consistency improvements:
+ - Moved #undef HAVE_IF_NAMETOINDEX from snmplib/*.c to
+ win32/net-snmp/net-snmp-config.h.
+ - Changed the global in6addr_any variable into a static variable
+ such that
+ multiple definitions do not trigger a linker error.
+ - Added typedefs for uint8_t, int8_t, uint16_t and int16_t.
+ - Replaced '#if NETSNMP_ENABLE_IPV6' by '#ifdef
+ NETSNMP_ENABLE_IPV6'.
+
+2010-02-21 08:30 tanders
+
+ * snmplib/snmpIPBaseDomain.c:
+
+ make sure that INADDR_NONE is defined (fixes build error on
+ Solaris)
+
+2010-02-19 19:39 bvassche
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ Synchronized win32/net-snmp/net-snmp-config.h and
+ win32/net-snmp/net-snmp-config.h.in.
+
+2010-02-19 14:18 bvassche
+
+ * include/net-snmp/library/system.h:
+
+ CHANGES: Win32: libsnmp builds again as a DLL when IPv6 is
+ enabled.
+
+2010-02-19 13:22 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def.in:
+
+ Follow up for r18164: synchronized libsnmp.def.in with
+ libsnmp.def
+
+2010-02-19 09:05 bvassche
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ CHANGES: Win32: added #include <malloc.h> in
+ win32/net-snmp/net-snmp-config.h such that the MSVC compiler
+ doesn't get confused by the malloc redefinition when building
+ libsnmp as a DLL.
+
+2010-02-19 08:59 bvassche
+
+ * include/net-snmp/library/snmp_parse_args.h,
+ win32/libsnmp_dll/libsnmp.def:
+
+ Exported netsnmp_parse_args() such that the Net-SNMP applications
+ build again when libsnmp is built as a DLL.
+
+2010-02-19 08:56 bvassche
+
+ * snmplib/keytools.c, win32/net-snmp/net-snmp-config.h:
+
+ CHANGES: Win32: building: moved MSVC OpenSSL linker settings from
+ snmplib/keytools.c to win32/net-snmp/net-snmp-config.h such that
+ these settings are not only effective when building snmplib as a
+ static library but also when any Net-SNMP application is built
+ that links with snmplib as a static library or as a DLL.
+
+2010-02-19 08:32 bvassche
+
+ * snmplib/keytools.c:
+
+ Win32 cleanup: MSVC / DLL tests now use the officially endorsed
+ macro names.
+
+2010-02-19 07:50 bvassche
+
+ * win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ Builds again.
+
+2010-02-19 06:47 magfr
+
+ * agent/agent_trap.c, agent/mibgroup/ucd-snmp/proxy.c,
+ include/net-snmp/library/snmp_parse_args.h,
+ snmplib/snmp_parse_args.c:
+
+ NEWS: snmplib: PATCH: 2942940: from "Bill Fenner": Add a new
+ function, netsnmp_parse_args, that is like snmp_parse_args but
+ takes an additional bitmask, flags, to affect the behaviour. Also
+ remove the magic handling of some application names.
+
+2010-02-18 14:22 bvassche
+
+ * win32/bin:
+
+ Updated Subversion ignore list.
+
+2010-02-18 14:20 bvassche
+
+ * win32/libhelpers/libhelpers.dsp,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/libsnmp/libsnmp.dsp, win32/netsnmpmibs/netsnmpmibs.dsp:
+
+ Sorted names of source files alphabetically.
+
+2010-02-18 13:03 bvassche
+
+ * README.win32, snmplib/winservice.c, win32/libsnmp/libsnmp.dsp,
+ win32/net-snmp/net-snmp-config.h,
+ win32/netsnmpmibs/netsnmpmibs.dsp, win32/netsnmpmibssdk,
+ win32/snmpdsdk, win32/snmpnetstat/snmpnetstat.dsp,
+ win32/win32.dsw, win32/win32sdk.dsw:
+
+ CHANGES: Win32: dropped support for building Net-SNMP with
+ Microsoft Visual Studio 6.0 without platform SDK. Building
+ Net-SNMP with Microsoft Visual Studio 6.0 + PSDK or any later
+ version of MSVC is still possible however.
+
+ Note: if in the future for whatever reason it should become
+ necessary again to be able to build Net-SNMP with MSVC without
+ relying on the platform SDK headers, please #ifdef out the MIB
+ code that relies on the PSDK headers instead of splitting the
+ workspace files again.
+
+2010-02-18 12:57 bvassche
+
+ * snmplib/snmpIPv6BaseDomain.c:
+
+ dos2unix.
+
+2010-02-18 09:45 bvassche
+
+ * include/net-snmp/library/types.h:
+
+ Source code cleanup:
+ - Moved documentation of netsnmp_large_fd_set members to the
+ comment
+ block just above the definition of this type.
+ - Removed superfluous 'extern "C"' specifier: this linkage
+ specifier
+ only has an effect on declarations of variables of functions and
+ not
+ on typedefs or struct definitions.
+ - Ran this header file through indent.
+
+2010-02-18 09:26 bvassche
+
+ * snmplib/snmpIPBaseDomain.c, snmplib/snmpIPV6BaseDomain.c,
+ snmplib/snmpIPv6BaseDomain.c, snmplib/snmpTLSBaseDomain.c,
+ win32/libsnmp/libsnmp.dsp:
+
+ Changes:
+ - Builds again with MSVC.
+ - Fixed a few compiler warnings reported by MSVC (passing int
+ instead of u_short to htons() / function declarations that were
+ missing because of missing #include directives).
+
+2010-02-16 17:16 bvassche
+
+ * include/net-snmp/types.h:
+
+ CHANGES: Win32: The header file <sys/timeb.h> is no longer
+ included from <net-snmp/types.h>. Or: the header file
+ <sys/timeb.h> will have to be included explicitly in source files
+ that need the declaration of the function ftime().
+
+ Note: compared to r18024 and before, this change does not affect
+ BSD systems -- <sys/timeb.h> was only included from
+ <net-snmp/types.h> on BSD systems in revisions r18025..r18152.
+
+2010-02-14 19:29 bvassche
+
+ * include/net-snmp/system/freebsd8.h:
+
+ Builds now on FreeBSD version 8.0.
+
+2010-02-13 20:59 magfr
+
+ * include/net-snmp/library/snmpIPv4BaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpTCPBaseDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h:
+
+ Adjust the placement of ;'s in order to
+ a) Avoid warnings about spurious semicolons
+ b) Not have unterminated declarations in headers
+
+2010-02-12 02:57 rstory
+
+ * local/mib2c:
+
+ CHANGES: mib2c: update inline documentation; add storagetype test
+ for columns
+
+2010-02-12 01:50 rstory
+
+ * include/net-snmp/library/snmp_api.h:
+
+ fix typo in define
+
+2010-02-12 01:05 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ fix sed processing on white-space adding solaris machines
+
+2010-02-10 23:56 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ add top srcdir to cpp search path
+
+2010-02-10 23:52 hardaker
+
+ * include/net-snmp/types.h:
+
+ freebsd needs time.h above timeb.h
+
+2010-02-10 23:37 hardaker
+
+ * configure, configure.d/config_modules_lib:
+
+ use sed with multireplace on a line to fix possible whitespace
+ issue on solaris
+
+2010-02-10 23:22 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ include/net-snmp/library/snmpTLSTCPDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c,
+ snmplib/snmpTLSTCPDomain.c:
+
+ beginning work for TLS separation into separate files with a base
+ file
+
+2010-02-10 23:21 hardaker
+
+ * include/net-snmp/library/snmpUDPIPv4BaseDomain.h:
+
+ move base transport creation function out of linux ifdefs
+
+2010-02-10 23:21 hardaker
+
+ * include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c:
+
+ moved another error logging function
+
+2010-02-10 23:20 hardaker
+
+ * mibs/NET-SNMP-TC.txt:
+
+ added TLS over TCP
+
+2010-02-10 16:39 dts12
+
+ * agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c:
+
+ CHANGES: Linux: Improved EtherLike-MIB support
+ Patch supplied by Josef Moellers
+
+2010-02-10 10:04 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: Support null-bytes in octet strings
+ Patch supplied by Tommy Beadle
+
+2010-02-10 00:59 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpTLSBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTLSBaseDomain.c:
+
+ moved TLS infrastructure into a base domain file
+
+2010-02-10 00:04 hardaker
+
+ * include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ snmplib/snmpIPv6BaseDomain.c, snmplib/snmpUDPIPv6Domain.c:
+
+ moved socket6 functions to the ipv6 base
+
+2010-02-10 00:03 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ white space formatting
+
+2010-02-10 00:03 hardaker
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ snmplib/snmpUDPBaseDomain.c, snmplib/snmpUDPDomain.c:
+
+ moved udp_send/recv to udpbase
+
+2010-02-10 00:02 hardaker
+
+ * include/net-snmp/library/snmpSocketBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpSocketBaseDomain.c, snmplib/snmpUDPDomain.c:
+
+ move netsnmp_sock_buffer_set into socketbase
+
+2010-02-10 00:02 hardaker
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpUDPBaseDomain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv4BaseDomain.c:
+
+ move ipv4 specific UDP transport creation to udpipv4 base
+
+2010-02-10 00:01 hardaker
+
+ * snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c:
+
+ made common functions be referenced directly by the transports
+ and removed original functionality; they were static so there is
+ no backwards compat issues
+
+2010-02-10 00:00 hardaker
+
+ * include/net-snmp/library/snmpSocketBaseDomain.h,
+ include/net-snmp/library/snmpTCPBaseDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpSocketBaseDomain.c,
+ snmplib/snmpTCPDomain.c, snmplib/snmpUDPBaseDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ moved socket based close to a socket based domain common to many
+ things
+
+2010-02-09 23:59 hardaker
+
+ * include/net-snmp/library/snmpTCPBaseDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ snmplib/snmpTCPBaseDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c:
+
+ move TCP common functions to a TCPBase domain implementation
+
+2010-02-09 23:57 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c:
+
+ warning cleanup
+
+2010-02-09 23:56 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ tmStateReference should be using the indexed addr_pair
+
+2010-02-09 23:56 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ make netsnmp_dtlsudp_close make use of netsnmp_baseudp_close
+
+2010-02-09 23:55 hardaker
+
+ * include/net-snmp/library/snmpUDPBaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpUDPBaseDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ moved base UDP socket creation into a common base function and
+ made use of it
+
+2010-02-09 23:54 hardaker
+
+ * include/net-snmp/library/snmpIPBaseDomain.h:
+
+ proper _H ifdef checks
+
+2010-02-09 23:54 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpUDPBaseDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/snmpUDPBaseDomain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv4BaseDomain.c:
+
+ added a raw UDP base domain
+
+2010-02-09 23:53 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmpIPBaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv4BaseDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpIPBaseDomain.c,
+ snmplib/snmpIPv4BaseDomain.c, snmplib/snmpIPv6BaseDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv4BaseDomain.c, snmplib/snmpUDPIPv6Domain.c:
+
+ created a UDP IPv4 base; moved and reused more infrastructure
+
+2010-02-09 23:51 hardaker
+
+ * include/net-snmp/library/snmpIPv4BaseDomain.h,
+ snmplib/snmpIPv4BaseDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ moved ipv4 address formatting into snmpIPv4BaseDomain
+
+2010-02-09 23:51 hardaker
+
+ * snmplib/snmpIPv6BaseDomain.c:
+
+ v6 domain infrastructure files
+
+2010-02-09 23:51 hardaker
+
+ * include/net-snmp/library/snmpIPV4BaseDomain.h,
+ include/net-snmp/library/snmpIPv4BaseDomain.h,
+ include/net-snmp/library/snmpIPv6BaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ snmplib/snmpIPV4BaseDomain.c, snmplib/snmpIPV6BaseDomain.c,
+ snmplib/snmpIPv4BaseDomain.c:
+
+ v6 domain infrastructure files
+
+2010-02-09 23:50 hardaker
+
+ * configure, include/net-snmp/library/snmpIPBaseDomain.h,
+ include/net-snmp/library/snmpIPV4BaseDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpIPBaseDomain.c, snmplib/snmpIPV4BaseDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ New IPv4 and IP base transport files
+
+2010-02-09 23:48 hardaker
+
+ * configure.d/config_modules_lib:
+
+ don't double include transport modules
+
+2010-02-09 23:48 hardaker
+
+ * include/net-snmp/library/snmpIPXDomain.h:
+
+ moved architecture tests into the header files using config_error
+ for signaling problems
+
+2010-02-09 23:46 hardaker
+
+ * configure.d/config_modules_lib:
+
+ moved architecture tests into the header files using config_error
+ for signaling problems
+
+2010-02-09 23:45 hardaker
+
+ * include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUnixDomain.h:
+
+ moved architecture tests into the header files using config_error
+ for signaling problems
+
+2010-02-09 23:43 hardaker
+
+ * configure.d/config_modules_lib:
+
+ check for and report config_errors in transport headers
+
+2010-02-09 23:43 hardaker
+
+ * configure.d/config_os_headers:
+
+ allow a NETSNMP_QUICK_CHECK env variable to bypass header checks
+
+2010-02-09 23:42 hardaker
+
+ * configure.d/config_modules_lib:
+
+ better comments
+
+2010-02-09 23:42 hardaker
+
+ * configure.d/config_modules_lib:
+
+ check for config_require macros in transport headers for
+ force-including of other things
+
+2010-02-09 23:41 hardaker
+
+ * include/net-snmp/library/snmp_transport.h, perl/agent/agent.xs,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ define a standardized indexed addr_pair instead of using one
+ labeled only for UDP everywhere
+
+2010-02-09 23:40 hardaker
+
+ * snmplib/snmptsm.c:
+
+ fix transport prefix list for incoming messages
+
+2010-02-09 23:40 hardaker
+
+ * include/net-snmp/library/snmptsm.h, snmplib/snmptsm.c:
+
+ remove the security level from the TSM cache; previous existence
+ from from a draft copy of the TSM RFC and is now stored entirely
+ in the tm reference
+
+2010-02-09 23:39 hardaker
+
+ * snmplib/snmptsm.c:
+
+ implement incoming TSM procedures according to RFC text
+
+2010-02-09 23:39 hardaker
+
+ * snmplib/snmptsm.c:
+
+ implement outgoing TSM procedures according to RFC text
+
+2010-02-09 23:39 hardaker
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h:
+
+ create defined sized array and length variable
+
+2010-02-05 09:52 jsafranek
+
+ *
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c:
+
+ CHANGES: snmpd: fixed filedescriptior leak in Etherlike-MIB and
+ RMON-MIB
+
+2010-02-04 15:57 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/mibII/interfaces.c,
+ include/net-snmp/data_access/interface.h:
+
+ CHANGES: snmpd: report real ifSpeed of network interface even it
+ is down.
+ Some interfaces can report their real speed, even they are down.
+ And if they can't, the fallback to 10Mbps is still there.
+
+2010-02-01 14:47 bvassche
+
+ * agent/mibgroup/examples/example.c:
+
+ Fixed the compiler warnings triggered by the source file
+ agent/mibgroup/examples/example.c.
+
+2010-02-01 14:45 bvassche
+
+ * README.win32, snmplib/keytools.c:
+
+ CHANGES: Win32: building: simplified the procedure for building
+ with SNMPv3 support enabled (OpenSSL).
+
+2010-02-01 14:34 bvassche
+
+ * agent/helpers/cache_handler.c, agent/helpers/instance.c,
+ agent/helpers/old_api.c, agent/helpers/stash_cache.c,
+ agent/helpers/watcher.c, agent/mibgroup/winExtDLL.c,
+ snmplib/large_fd_set.c, snmplib/md5.c, snmplib/snmpAliasDomain.c,
+ snmplib/snmp_parse_args.c:
+
+ Made sure that all calls to free() are intercepted when building
+ with dmalloc
+ support enabled. Included <dmalloc.h> in those source files where
+ it was not
+ yet included, and provided a wrapper function for free() where
+ the address of
+ this function was taken (Dmalloc can only intercept free() when
+ it is called
+ directly but not when it is called through a function pointer).
+
+2010-02-01 10:49 bvassche
+
+ * include/net-snmp/library/system.h:
+
+ NEWS: building: Building Net-SNMP with dmalloc support enabled is
+ again possible.
+
+2010-02-01 01:05 tanders
+
+ * testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap,
+ testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap, testing/tests/T113agentxtrap,
+ testing/tests/T114agentxagentxtrap:
+
+ CHANGES: building: 'make test TESTOPTS="-P tcp"' works fine now
+
+2010-01-31 08:02 bvassche
+
+ * configure, configure.d/config_os_misc2:
+
+ Follow-up for r18084: fixed an sh syntax error in the configure
+ script
+ that was triggered on systems without libcrypto and without
+ libeay32.
+ The following error was reported:
+ configure[33136]: x: unknown test operator
+
+2010-01-29 20:07 jsafranek
+
+ * testing/tests/T059trapdtraphandle:
+
+ Elaborate on rev. 18089 and adjust the temporary directory to the
+ * *really working one*. 2010-01-29 19:11 jsafranek
+
+
+ * testing/tests/T059trapdtraphandle:
+
+ Fix test 35 when configure option '--with-temp-file-pattern' was
+ used and the directory for temp. files does not exist yet.
+
+2010-01-29 15:07 bvassche
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/library/system.h,
+ include/net-snmp/net-snmp-config.h.in, snmplib/closedir.c,
+ snmplib/gettimeofday.c, snmplib/opendir.c, snmplib/readdir.c,
+ snmplib/system.c, win32/libsnmp/libsnmp.dsp:
+
+ Moved the source code of the opendir(), readdir(), closedir() and
+ gettimeofday() replacements for MSVC from snmplib/system.c to
+ separate source files in snmplib.
+
+2010-01-29 08:57 bvassche
+
+ * configure, configure.d/config_os_libs:
+
+ Configure script consistency improvement: renamed the variable
+ "saved_LIBS" into "netsnmp_save_LIBS".
+
+2010-01-29 06:39 magfr
+
+ * configure, configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in,
+ testing/tests/T072com2secunix:
+
+ CHANGES: testing: Check the size of sun_path and use that to
+ generate the maximal size strings for stressing com2secunix.
+
+2010-01-27 15:16 bvassche
+
+ * testing/eval_tools.sh:
+
+ NEWS: MinGW: running the regression test suite is again possible
+ ('make test').
+
+2010-01-27 14:43 bvassche
+
+ * configure, configure.d/config_os_libs,
+ configure.d/config_os_misc2,
+ include/net-snmp/net-snmp-config.h.in:
+
+ NEWS: Cygwin: building with another OpenSSL package than the
+ Cygwin-provided packages openssl and openssl-devel is again
+ possible.
+ NEWS: MinGW: building with OpenSSL works again.
+
+2010-01-26 21:27 magfr
+
+ * agent/agent_trap.c, include/net-snmp/agent/agent_trap.h:
+
+ CHANGES: snmplib: Make the context argument of send_v3trap,
+ send_trap_vars_with_context and netsnmp_send_traps refer to a
+ const char*.
+
+2010-01-26 21:24 magfr
+
+ * agent/mibgroup/host/data_access/swinst_pkginfo.c:
+
+ Correct misspelling - #elsif to #elif
+
+2010-01-26 21:21 magfr
+
+ * snmplib/snmpUDPDomain.c:
+
+ Apparently not all systems define INET_ADDRSTRLEN so add it if it
+ is missing.
+
+2010-01-26 15:46 bvassche
+
+ * testing/TESTCONF.sh:
+
+ Added netstat path for MinGW.
+
+2010-01-26 15:00 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ fix stat names
+
+2010-01-26 15:00 hardaker
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ define netsnmp_assert_or_msgreturn
+
+2010-01-26 14:59 hardaker
+
+ * snmplib/snmptsm.c:
+
+ use netsnmp_assert_or_return
+
+2010-01-26 14:58 hardaker
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ define netsnmp_assert_or_return
+
+2010-01-26 14:58 hardaker
+
+ * snmplib/snmptsm.c:
+
+ update comments to reflect RFC5591 as the document describing the
+ implementation
+
+2010-01-26 11:43 bvassche
+
+ * include/net-snmp/system/cygwin.h:
+
+ NEWS: Cygwin: BUG: 2939168: byte order of udpLocalPort is now
+ correct.
+
+2010-01-26 10:46 bvassche
+
+ * net-snmp-config.in, testing/TESTCONF.sh,
+ testing/tests/T030snmpv3usercreation,
+ testing/tests/T115agentxperl:
+
+ NEWS: Cygwin: BUG: 2939168: fixed test infrastructure ("make
+ test"). This has been fixed by using the proper environment
+ separator character and by adding the path of the netstat
+ executable for Cygwin in testing/TESTCONF.sh.
+
+2010-01-26 09:27 jsafranek
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ CHANGES: snmpd: fix rare race condition when reading RPM
+ database.
+ Old rpm versions return NULL instead of Header when another RPM
+ instance holds
+ database locks. I.e. snmpd sometimes crashes when reading
+ hr_swInst and rpm is
+ installing/updating/removing another package. As a solution,
+ whole RPM cache
+ is thrown away and re-read when we got an error from librpm. The
+ whole process
+ is restarted only three times, to prevent endless loop.
+
+2010-01-25 22:16 magfr
+
+ * agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/disk.c, snmplib/scapi.c,
+ snmplib/snmp_api.c:
+
+ CHANGES: snmplib, snmpd: Do not check if values of type size_t
+ are less than 0.
+
+2010-01-25 22:11 magfr
+
+ * agent/mibgroup/util_funcs/header_simple_table.c:
+
+ CHANGES: snmpd: Check the range of oid values towards the maximum
+ oid value, notULONG_MAX
+
+2010-01-25 20:01 rstory
+
+ * configure, configure.d/config_os_libs:
+
+ only bail on missing libiphlpapi for xwinsock2
+
+2010-01-25 19:57 rstory
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c:
+
+ rename MAX_STATS to NETSNMP_STAT_MAX_STATS
+
+2010-01-25 19:53 rstory
+
+ * agent/helpers/snmp_get_statistic.c:
+
+ update for new path to snmp_get_statistics; check for index
+ overflow
+
+2010-01-25 19:44 rstory
+
+ * agent/helpers/Makefile.in, agent/mibgroup/Makefile.depend,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.h,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.h,
+ agent/mibgroup/snmpv3/usmStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.h,
+ agent/mibgroup/target/target_counters_5_5.c,
+ agent/mibgroup/target/target_counters_5_5.h:
+
+ update for new path to snmp_get_statistics
+
+2010-01-25 16:03 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ use *current* copy of the MIB when generating stats
+
+2010-01-25 16:01 rstory
+
+ * agent/helpers/snmp_get_statistic.c,
+ agent/mibgroup/utilities/snmp_get_statistic.c,
+ agent/mibgroup/utilities/snmp_get_statistic.h,
+ include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/snmp_get_statistic.h:
+
+ move snmp_get_statistic helper to helpers dir; update all_helpers
+ header
+
+2010-01-25 14:34 bvassche
+
+ * apps/agentxtrap.c:
+
+ Replaced explicit declarations of optind, optopt and optarg by
+ #include <unistd.h> because explicitly declaring these variables
+ is not compatible with Cygwin.
+
+2010-01-25 14:25 bvassche
+
+ * snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPIPv6Domain.c:
+
+ NEWS: Cygwin: IPv6 is only supported under Cygwin 1.7 or later.
+ The old implementation of IPv6 support in Net-SNMP under Cygwin
+ involved a strange mixture of Cygwin and Winsock2 socket calls,
+ which was too hard to maintain.
+ NEWS: Cygwin: builds again with IPv6 support enabled
+ (--enable-ipv6). At least Net-SNMP 5.5 doesn't build under Cygwin
+ with IPv6 support enabled. The configure script reported
+ "checking ipv6 stack type ... result: "unknown, no" ... error:
+ IPv6 transports not available if IPv6 support is not enabled".
+
+2010-01-25 14:13 bvassche
+
+ * snmplib/inet_ntop.c, snmplib/inet_pton.c:
+
+ Added missing #include <string.h>.
+
+2010-01-25 14:10 bvassche
+
+ * configure, configure.d/config_project_ipv6_types:
+
+ Added configure test for the IPv6 stack included in Cygwin
+ version 1.7.
+ IPv6 support is one of the new features of Cygwin 1.7. For more
+ information,
+ see also http://cygwin.com/cygwin-ug-net/ov-new1.7.html.
+
+2010-01-25 12:40 bvassche
+
+ * configure, configure.d/config_os_headers,
+ configure.d/config_os_libs:
+
+ CHANGES: Cygwin: the message "configure: WARNING: winsock.h:
+ present but cannot be compiled" does no longer appear when
+ running the configure script.
+ Follow-up for r18050: re-enabled libiphlpapi and iphlpapi.h tests
+ for non-MinGW platforms since the Cygwin build needs these.
+
+2010-01-25 07:28 magfr
+
+ * configure, configure.d/config_os_functions, snmplib/inet_ntop.c,
+ snmplib/inet_pton.c:
+
+ CHANGES: building: Use autoconf to decide if inet_ntop.c and
+ inet_pton.c are to be compiled.
+
+2010-01-25 07:09 bvassche
+
+ * configure, configure.d/config_os_struct_members:
+
+ CHANGES: MinGW: struct sockaddr_in6.sin6_scope_id configure test
+ does now work.
+
+2010-01-25 05:14 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ TLSTM counter stats
+
+2010-01-25 05:13 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ add in TSM needed counter definitions
+
+2010-01-25 05:12 hardaker
+
+ * mibs/SNMP-TSM-MIB.txt, mibs/rfclist:
+
+ added the SNMP-TSM-MIB
+
+2010-01-24 14:43 magfr
+
+ * agent/agent_registry.c, include/net-snmp/agent/agent_registry.h:
+
+ NEWS: snmpd: Made subtree_context_cache::context_name a const
+ char*.
+
+2010-01-24 14:27 magfr
+
+ * include/net-snmp/library/tools.h:
+
+ CHANGES: snmplib: Prevent gcc ped-warning for
+ NETSNMP_REMOVE_CONST
+
+2010-01-24 13:27 magfr
+
+ * apps/snmpusm.c:
+
+ CHANGES: snmpusm: Prefer to use a variable of the right type over
+ an ugly cast. Lessen the scope of the variable as well.
+
+2010-01-24 12:59 bvassche
+
+ * configure, configure.d/config_os_headers,
+ configure.d/config_os_libs, configure.d/config_os_progs:
+
+ CHANGES: building: Introduced the variable 'with_socklib' in the
+ configure script. This variable is set to "winsock2" for MinGW
+ and to "default" for all other systems. Winsock2 tests are only
+ run if this variable is set to "winsock2" (MinGW).
+
+2010-01-24 12:53 magfr
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Remove superfluous debug logs.
+
+2010-01-24 12:45 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Windows, compiler warning fixes: fixed warnings about char * /
+ unsigned char *
+ mismatches.
+
+2010-01-24 12:44 bvassche
+
+ * snmplib/snmpUDPDomain.c:
+
+ Windows, compiler warning fix: make inet_ntop() and inet_pton()
+ declarations
+ available to the compiler.
+
+2010-01-24 12:44 bvassche
+
+ * snmplib/snmp_logging.c:
+
+ Windows, compiler warning fix: made sure that <ws2tcpip.h> will
+ be included
+ from <net-snmp/types.h> such that the compiler doesn't complain
+ about struct
+ sockaddr_in6 being used before being defined.
+
+2010-01-24 11:42 bvassche
+
+ * man:
+
+ Updated Subversion ignore list.
+
+2010-01-24 11:41 bvassche
+
+ * agent/agent_index.c, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/agent_trap.c, agent/mib_modules.c,
+ agent/mibgroup/Rmon/alarm.c, agent/mibgroup/Rmon/event.c,
+ agent/mibgroup/Rmon/history.c, agent/mibgroup/Rmon/statistics.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/vacm_vars.c, agent/mibgroup/mibincl.h,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/util_funcs.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c, apps/snmpbulkget.c,
+ apps/snmpbulkwalk.c, apps/snmpdelta.c, apps/snmpdf.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c,
+ apps/snmpstatus.c, apps/snmptable.c, apps/snmptest.c,
+ apps/snmptrap.c, apps/snmpusm.c, apps/snmpvacm.c,
+ apps/snmpwalk.c, include/net-snmp/library/libsnmp.h,
+ include/net-snmp/net-snmp-includes.h, snmplib/lcd_time.c,
+ snmplib/mib.c, snmplib/parse.c, snmplib/read_config.c,
+ snmplib/scapi.c, snmplib/snmp-tc.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c,
+ snmplib/snmpksm.c, snmplib/snmpusm.c, snmplib/snmpv3.c,
+ snmplib/system.c, snmplib/tools.c, snmplib/vacm.c:
+
+ Cleanup (Windows): removed superfluous #include <sys/timeb.h>
+ directives. This header file
+ has only to be included from snmplib/system.c because of the
+ _ftime() call in that file.
+
+2010-01-24 10:43 bvassche
+
+ * apps/snmpnetstat/inet.c:
+
+ The macro 'C()' now casts its result from unsigned long to
+ unsigned int.
+ This change fixes a compiler warnings about format specification
+ mismatches
+ and fixes a bug (incorrect snmpnetstat output) on big endian
+ systems.
+
+2010-01-24 10:33 bvassche
+
+ * man/config_api.3:
+
+ Follow-up for r17946: removed generated man pages from
+ repository.
+
+2010-01-24 10:31 bvassche
+
+ * include/net-snmp/library/winservice.h, snmplib/winservice.c:
+
+ Moved two declarations of static functions from .h to .c.
+
+2010-01-24 10:21 magfr
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ Remove unnecessary casts.
+
+2010-01-24 10:19 bvassche
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ CHANGES: snmplib: builds again when HAVE_GETADDRINFO is not
+ defined.
+
+2010-01-24 10:03 bvassche
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in, snmplib/inet_ntop.c,
+ snmplib/inet_ntop.h, snmplib/inet_pton.c, snmplib/inet_pton.h,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv6Domain.c:
+
+ Changes:
+ - Added configure tests for inet_ntop() and inet_pton().
+ - Added header files snmplib/inet_ntop.h and snmplib/inet_pton.h.
+ - Replaced "extern inet_ntop(...);" and "extern inet_pton(...);"
+ by #include "inet_ntop/pton.h".
+ - Converted snmplib/inet_ntop.c and snmplib/inet_pton.c from K&R
+ C to ANSI C.
+ - Replaced the inet_aton() calls that were introduced in r18033
+ in snmplib/snmpUDPDomain.c by inet_pton() calls such that it is
+ again possible to build Net-SNMP on Windows.
+
+2010-01-24 06:08 magfr
+
+ * include/net-snmp/library/snmpDTLSUDPDomain.h:
+
+ CHANGES: snmplib: Remove declarations of functions that don't
+ exist or are declared elsewhere.
+
+2010-01-24 05:48 magfr
+
+ * agent/agent_trap.c:
+
+ NEWS: snmplib: Removed the unused variables warm_start_oid,
+ link_down_oid, link_up_oid, auth_fail_oid and egp_xxx_oid.
+
+2010-01-23 22:06 magfr
+
+ * testing/tests/T070com2sec, testing/tests/T071com2sec6,
+ testing/tests/T072com2secunix:
+
+ Better set of SKIPIF/SKIPIFNOTS
+
+2010-01-23 20:31 magfr
+
+ * testing/tests/T071com2sec6, testing/tests/T072com2secunix:
+
+ Be correct in what it is that is tested in the header.
+
+2010-01-23 20:27 magfr
+
+ * snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ CHANGES: snmplib: Changed the com2sec directives to fail if there
+ are too few arguments. Additionally changed the storage structure
+ to not allocate more space than necessary.
+
+2010-01-23 20:22 magfr
+
+ * testing/tests/T070com2sec, testing/tests/T071com2sec6,
+ testing/tests/T072com2secunix:
+
+ new tests checking the error handling of the com2sec* directives
+
+2010-01-23 19:17 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Follow-up for r18025: builds again with Microsoft Visual Studio.
+
+2010-01-23 17:51 bvassche
+
+ * configure, configure.ac:
+
+ CHANGES: building: OS header detection check is now run before
+ IPv6 stack detection.
+ CHANGES: Solaris: sockaddr_in6.sin6_addr configure test does now
+ work.
+
+2010-01-23 17:42 bvassche
+
+ * snmplib/large_fd_set.c:
+
+ Fixed a Solaris-specific compiler warning.
+
+2010-01-23 17:00 bvassche
+
+ * configure, configure.d/config_os_headers,
+ configure.d/config_os_struct_members,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/mingw32.h:
+
+ MinGW: added configure test for <sys/timeb.h> and also for struct
+ timezone.
+
+2010-01-23 16:32 bvassche
+
+ * include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ snmplib/snmpUDPIPv6Domain.c:
+
+ MinGW: made sure that the IPv6-related datatypes are available
+ before being used.
+
+2010-01-23 16:30 bvassche
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Added #undef HAVE_WINDOWS_H.
+
+2010-01-23 16:28 bvassche
+
+ * include/net-snmp/types.h:
+
+ MinGW: made gettimeofday() declaration available for the
+ compiler.
+
+2010-01-23 16:27 bvassche
+
+ * snmplib/snmp_api.c:
+
+ MinGW: made gettimeofday() declaration available for the
+ compiler.
+
+2010-01-23 16:26 bvassche
+
+ * snmplib/inet_pton.c:
+
+ Made sure that the compiler does not complain about a missing
+ prototype for isdigit().
+
+2010-01-23 16:24 bvassche
+
+ * configure, configure.d/config_os_headers:
+
+ MinGW: iphlpapi.h configure test does now work.
+
+2010-01-23 15:10 bvassche
+
+ * configure, configure.d/config_project_ipv6_types:
+
+ Renamed the Winsock2 IPv6 stack from 'mingw' into 'winsock2'.
+
+2010-01-23 15:07 bvassche
+
+ * agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/route_write.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c, agent/snmpd.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmpnetstat/winstub.h, configure,
+ configure.d/config_os_headers,
+ include/net-snmp/net-snmp-config.h.in, include/net-snmp/types.h,
+ snmplib/inet_ntop.c, snmplib/inet_pton.c,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpSSHDomain.c,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Improved portability between the supported Win32 compilation
+ environments as follows:
+ - Made sure that the <winsock2.h> and <ws2tcpip.h> header files
+ are only included from <net-snmp/types.h>.
+ - Added configure check for <iphlpapi.h>.
+ - Replaced several WIN32 / cygwin tests by a HAVE_IPHLPAPI_H
+ test.
+ - Documented that win32/net-snmp/net-snmp-config.h is only used
+ for the MSVC build.
+
+2010-01-22 16:46 bvassche
+
+ * snmplib/tools.c:
+
+ Follow-up for r17910: builds again with Microsoft Visual Studio
+ 6.
+
+2010-01-22 16:41 bvassche
+
+ * agent/mibgroup/winExtDLL.c, win32/MgmtApi-winExtDLL.h:
+
+ Follow up for r18016: builds again with Microsoft Visual Studio.
+
+2010-01-22 14:13 bvassche
+
+ * configure, configure.d/config_os_libs:
+
+ Follow-up for r18016: made MinGW libiphlpapi check more robust.
+
+2010-01-22 13:32 bvassche
+
+ * README.win32, aclocal.m4, agent/agent_index.c,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/mib_modules.c,
+ agent/mibgroup/agentx/client.c, agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/header_complex.c, agent/mibgroup/host_res.h,
+ agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/mibII_common.h,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmUser.c, agent/mibgroup/struct.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/target.c, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c, agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/winExtDLL.c,
+ agent/mibgroup/winExtDLL.h, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c, apps/encode_keychange.c,
+ apps/snmpbulkget.c, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpdf.c, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpnetstat/winstub.c, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmptrapd_auth.c,
+ apps/snmptrapd_handlers.c, apps/snmptrapd_log.c,
+ apps/snmptrapd_sql.c, apps/snmpusm.c, apps/snmpvacm.c,
+ apps/snmpwalk.c, configure, configure.d/config_os_functions,
+ configure.d/config_os_headers, configure.d/config_os_libs,
+ configure.d/config_os_struct_members,
+ configure.d/config_project_ipv6_types,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/mingw32.h, include/net-snmp/types.h,
+ snmplib/asn1.c, snmplib/callback.c, snmplib/default_store.c,
+ snmplib/int64.c, snmplib/keytools.c, snmplib/large_fd_set.c,
+ snmplib/lcd_time.c, snmplib/md5.c, snmplib/mib.c,
+ snmplib/parse.c, snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp.c, snmplib/snmp_alarm.c, snmplib/snmp_api.c,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c, snmplib/snmp_debug.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c,
+ snmplib/snmpksm.c, snmplib/snmpusm.c, snmplib/snmpv3.c,
+ snmplib/system.c, snmplib/tools.c, snmplib/vacm.c,
+ snmplib/winpipe.c, win32/Snmp-winExtDLL.h,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ NEWS: MinGW: winExtDLL compiles now under MinGW.
+ CHANGES: MinGW: building Net-SNMP works again.
+
+ Detailed overview:
+ * Changes in the configure script:
+
+ - socket() library check passes again on MinGW.
+ - Added library checks for libws2_32, libregex and libsnmpapi.
+ - Added check for the winsock2.h and ws2tcpip.h header files.
+ - Added check for the chown() and localtime_r() functions.
+ - sockaddr_in6.sin6_scope_id check does now work on MinGW.
+ - Added IPv6 stack type called "mingw".
+ * Source code changes:
+
+ - Include <winsock2.h> from <net-snmp/types.h> instead of
+ <winsock.h>
+ under MinGW such that IPv6 support is available.
+ - Moved #include <winsock.h> from .c files to <net-snmp/types.h>.
+ - Added a copy of the MinGW header file <snmp.h> (which is not
+ copyrighted)
+ as win32/Snmp-winExtDLL.h.
+ - agent: only call chown() when available (HAVE_CHOWN).
+ * Documentation changes: updated README.win32.
+
+
+2010-01-22 08:34 magfr
+
+ * snmplib/read_config.c:
+
+ CHANGES: snmplib: Do not cast from char* to char*
+
+2010-01-22 00:39 hardaker
+
+ * COPYING:
+
+ Copyright file update for SPARTA, Inc.
+
+2010-01-22 00:22 hardaker
+
+ * snmplib/snmptsm.c:
+
+ add proper prefixes in TSM for SSH, DTLS, etc, based on the
+ domain
+
+2010-01-22 00:20 hardaker
+
+ * dist/patme:
+
+ added 5.5 branch
+
+2010-01-22 00:20 hardaker
+
+ * dist/makerelease.xml:
+
+ minor echo output change
+
+2010-01-21 20:51 rstory
+
+ * snmplib/snmp_api.c:
+
+ move comment next to code it is talking about; No code change
+
+2010-01-21 14:55 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ CHANGES: PATCH: 2926374: from Ed Swierk: fixed reading of
+ ipAddressTable from /proc/net/if_inet6 on Linux
+
+ The kernel might provide longer fields, especially on 64-bit
+ systems.
+
+2010-01-20 12:42 bvassche
+
+ * PORTING, local/snmpcheck.def:
+
+ Fixed typo: replaced 'necissary' by 'necessary'.
+
+2010-01-20 08:53 jsafranek
+
+ * man/snmpnetstat.1.def:
+
+ Fix minor typo in man page, it's snmpnetstat -Cp, not -CP.
+
+2010-01-14 12:34 jsafranek
+
+ *
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c:
+
+ CHANGES: fixed memory leak in RMON-MIB and ETHERLIKE-MIB when
+ there are multiple aliases of an network interface
+ Rationale: the aliased interfaces have the same ifIndex ->
+ CONTAINER_INSERT fails, but the rejected entry was not freed.
+
+2010-01-13 11:21 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ CHANGES: snmpd: fix memory leak in ipAddressPrefixTable
+ - net_snmp_search_update_prefix_info returns different code, when
+ the entry was not inserted to list and can be freed.
+
+2010-01-12 00:52 tanders
+
+ * configure, configure.d/config_os_libs:
+
+ CHANGES: build: run rpm configure checks for hr_swinst rewrite
+ (rpm
+ version only)
+
+2010-01-11 23:58 tanders
+
+ * apps/Makefile.in:
+
+ add PERLLDOPTS_FOR_APPS to agentxtrap link line (fixes
+ "libperl.so not
+ found" errors)
+
+2010-01-11 00:11 tanders
+
+ * testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap,
+ testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap, testing/tests/T113agentxtrap,
+ testing/tests/T114agentxagentxtrap:
+
+ get rid of using deprecated syntax for trap/inform sinks
+
+2010-01-08 08:42 bvassche
+
+ * snmplib/snmp_alarm.c, snmplib/snmp_api.c:
+
+ CHANGES: snmplib: obsoleted NETSNMP_DS_LIB_ALARM_DONT_USE_SIG.
+ From now on using SIGALRM to trigger Net-SNMP alarm handlers is
+ no longer supported.
+
+ Motivation: as known libnetsnmp supports time-based alarms via
+ the functions
+ snmp_alarm_register(), run_alarms() and other functions. Two
+ different ways to
+ trigger the function run_alarms() are supported inside
+ libnetsnmp:
+ 1. By making sure that the timeout argument of select() is small
+ enough such
+ that select() returns before the next alarm must be handled (when
+ the
+ variable NETSNMP_DS_LIB_ALARM_DONT_USE_SIG is set to one, which
+ is the
+ default).
+ 2. By making sure that the kernel fires SIGALRM at the time when
+ run_alarms()
+ should be called (when the variable
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG is set
+ to zero, which has to be configured explicitly).
+
+ The following issues are associated with the second approach:
+ 1. Alarm functions are used inside Net-SNMP to e.g. refresh
+ cached table
+ contents. As far as I can see there is nothing in the Net-SNMP
+ source code
+ that prevents the following from happening: a table refresh
+ triggered via
+ SIGALRM while a row is being removed from a cached table. This
+ can result
+ in dangling pointer dereferences and even a crash.
+ 2. POSIX restricts signal handlers to calling functions that are
+ either reentrant
+ or non-interruptible
+ (http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04).
+ Standard I/O functions like printf() and fprintf() are neither
+ reentrant nor
+ non-interruptible. run_alarms() is called from inside a signal
+ handler, which
+ means that this restriction applies to the function run_alarms()
+ itself and
+ all functions called by it (which includes the alarm callback
+ functions).
+ Or: e.g. snmp_log() and its callers must not be called from
+ inside run_alarms()
+ when this function is invoked from inside a signal handler. This
+ is a severe
+ restriction, and one that is hard to work with.
+ 3. Not all software developers know how to make sure that signal
+ delivery works
+ correctly in a multithreaded context. POSIX does not guarantee to
+ which thread
+ a signal like SIGALRM will be delivered, unless that signal has
+ been blocked
+ before thread creation and is unblocked after thread creation
+ (see also
+ http://www.opengroup.org/onlinepubs/009695399/functions/pthread_sigmask.html).
+ This is relevant for the Net-SNMP project not only because a
+ worker thread is
+ created inside
+ agent/mibgroup/if-mib/data_access/interface_linux.c but also
+ because libnetsnmp is often used inside multithreaded software.
+ Currently no
+ attempt is made to make sure that SIGALRM is processed by the
+ Net-SNMP event
+ processing loop thread. If SIGALRM is processed by another
+ thread, this will
+ result in one or more data races.
+
+ Because all the difficulties associated with processing alarms
+ from inside a
+ signal handler function, and because fixing these would require
+ more effort than
+ it is worth, NETSNMP_DS_LIB_ALARM_DONT_USE_SIG has been
+ deprecated and from now
+ on approach (1) is the only supported approach to trigger alarm
+ handlers.
+
+2010-01-07 19:42 hardaker
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c:
+
+ Patch from Stephen Hemminger to fix a minor memleak in cpu
+ sysctrl fetching
+
+2010-01-07 16:21 bvassche
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c,
+ snmplib/snmpusm.c, snmplib/vacm.c:
+
+ Removed read_config_read_ascii_string(), and made sure that
+ read_config_read_octet_string() '\0'-terminates the output buffer
+ in all cases.
+ Updated documentation and unit tests.
+
+2010-01-07 14:41 bvassche
+
+ * snmplib/snmpusm.c:
+
+ Removed three superfluous casts because these triggered a
+ compiler warning
+ when compiled with MSVC.
+
+2010-01-07 13:28 bvassche
+
+ * snmplib/read_config.c:
+
+ Reverted the read_config_read_octet_string() changes from r17992
+ because these
+ caused the following Valgrind complaint during snmpd startup:
+
+ ==25201== Conditional jump or move depends on uninitialised
+ value(s)
+ ==25201== at 0x4047B14: netsnmp_send_traps (agent_trap.c:798)
+ ==25201== by 0x4048128: send_enterprise_trap_vars
+ (agent_trap.c:853)
+ ==25201== by 0x404819D: send_trap_vars (agent_trap.c:963)
+ ==25201== by 0x404825B: send_easy_trap (agent_trap.c:1011)
+ ==25201== by 0x804B5D2: main (snmpd.c:394)
+
+2010-01-07 12:30 bvassche
+
+ *
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c:
+
+ Fixed a format specification mismatch.
+
+2010-01-07 12:19 bvassche
+
+ * include/net-snmp/agent/sysORTable.h:
+
+ Depending on the context, assigning a char * pointer to
+ sysORTable::OR_descr does or does not transfer
+ ownership. So whether OR_descr is declared as char * or as const
+ char *, there will always be at
+ least one statement on which the compiler complains about a char
+ * / const char * mismatch. The only solution is to cast away
+ const where appropriate to make sure that the compiler does not
+ complain, as implemented in this patch. 2010-01-07 11:46
+ bvassche
+
+
+ * snmplib/snmpusm.c:
+
+ usm_save_user(): when writing user->name and user->secName, only
+ write the ASCII data and not the
+ terminating '\0'. Since both items are read by calling
+ read_config_read_ascii_string(), writing
+ the terminating '\0' is not necessary to guarantee that the data
+ read back is terminated properly.
+
+2010-01-07 09:13 bvassche
+
+ * snmplib/read_config.c:
+
+ Changed the behavior of read_config_read_octet_string(): until
+ now this
+ function terminated the output buffer in some cases with '\0'
+ (when the
+ input was in the format 0x... and a buffer overflow occurred and
+ also
+ when the input was in ASCII format, but not when the input was in
+ format
+ 0x... and no buffer overflow occurred). Changed this such that
+ this
+ function does no longer terminate the input buffer with '\0'.
+ This
+ change was possible because inside the Net-SNMP project all
+ callers that
+ needed a '\0' terminated string have been converted to use
+ read_config_read_ascii_string() instead.
+
+2010-01-06 17:52 bvassche
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.c,
+ agent/mibgroup/tunnel/tunnel.c:
+
+ Reverted r17968 and r17972.
+
+2010-01-06 15:40 bvassche
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/mibII/vacm_conf.c:
+
+ Fixed more compiler warnings related to the use of the const
+ keyword.
+
+2010-01-06 15:38 bvassche
+
+ * agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c:
+
+ Fixed a format specification mismatch.
+
+2010-01-06 15:36 bvassche
+
+ * include/net-snmp/library/snmpusm.h:
+
+ Changed argument type from char * into const char *. Should have
+ been included in r17975.
+
+2010-01-06 15:33 bvassche
+
+ * agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/utilities/override.c:
+
+ Fixed several compiler warnings about char * / u_char *
+ mismatches.
+
+2010-01-06 15:31 bvassche
+
+ * agent/agent_read_config.c,
+ include/net-snmp/agent/agent_read_config.h,
+ include/net-snmp/config_api.h, snmplib/read_config.c:
+
+ Added the functions register_const_config_handler() and
+ snmpd_register_const_config_handler(), which
+ accept a parser function that does not modify the string that it
+ parses. Using these functions results
+ in easier to read code than using the non-const handler
+ registration functions and casting the parser
+ function explicitly from (void(*)(const char*, const char*)) to
+ (void(*)(const char*, char*)).
+
+2010-01-06 15:27 bvassche
+
+ * snmplib/snmpusm.c:
+
+ Fixed a compiler warning about discarding the const qualifier.
+
+2010-01-06 14:48 bvassche
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c:
+
+ Added read_config_read_objid_const().
+
+2010-01-06 14:42 bvassche
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ Duplicated the second argument of REGISTER_SYSOR_TABLE() /
+ REGISTER_SYSOR_ENTRY()
+ since that argument is freed while unregistering such an entry.
+ Not sure whether
+ this could actually trigger a call of free() with a constant
+ string as argument
+ and I'm neither sure about whether or not this could have
+ triggered a crash.
+
+2010-01-06 14:34 bvassche
+
+ * include/net-snmp/library/vacm.h, snmplib/vacm.c:
+
+ For those VACM functions that do not modify the strings passed as
+ arguments,
+ changed the argument type from char * to const char *.
+
+2010-01-06 14:27 bvassche
+
+ * snmplib/snmp_logging.c:
+
+ Fixed a compiler warning about discarding the const qualifier.
+
+2010-01-06 14:26 bvassche
+
+ * agent/mibgroup/sctp-mib/sctpScalars_common.c:
+
+ Removed an unused variable.
+
+2010-01-06 14:14 bvassche
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.c:
+
+ Duplicated the second argument of REGISTER_SYSOR_TABLE() /
+ REGISTER_SYSOR_ENTRY()
+ since that argument is freed while unregistering such an entry.
+ Not sure whether
+ this could actually trigger a call of free() with a constant
+ string as argument
+ and I'm neither sure about whether or not this could have
+ triggered a crash.
+
+2010-01-06 14:08 bvassche
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/event/mteTriggerConf.h:
+
+ Fixed several compiler warnings about discarding the const
+ qualifier.
+
+2010-01-06 14:06 bvassche
+
+ * agent/helpers/table.c, agent/helpers/table_dataset.c:
+
+ Fixed several compiler warnings about char * / u_char *
+ mismatches.
+
+2010-01-06 14:04 bvassche
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c:
+
+ Changes:
+ - Added new functions skip_white_const(), skip_not_white_const(),
+ skip_token_const(), copy_nword_const() and
+ read_config_read_octet_string_const().
+ - Changed return type of read_config_read_ascii_string() from
+ char * to
+ const char *. Note: this does not affect backwards compatibility
+ since this
+ function has not yet been included in any release.
+ - Fixed documentation of read_config_read_octet_string() and
+ read_config_read_ascii_string().
+ - Reduced number of cast-away-const constructs in read_config.c.
+
+2010-01-06 13:35 bvassche
+
+ * include/net-snmp/library/tools.h:
+
+ Refined the implementation of the macro NETSNMP_REMOVE_CONST():
+ when using
+ the gcc compiler, it is now verified whether the types (const t)
+ and typeof(e)
+ are compatible, where t is the first argument and e the second
+ argument of
+ this macro.
+
+2010-01-06 13:33 jsafranek
+
+ * agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/at.h:
+
+ Add support of network interfaces with HW address bigger than 6
+ bytes to atTable. Some HW, like InfiniBand, uses HW addresses
+ with 9 and more bytes.
+
+2010-01-06 12:45 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_kstat.c:
+
+ CHANGES: snmpd: BUGS: 2924140: Fix termination of CPU/FPU types
+
+2010-01-06 12:33 dts12
+
+ * snmplib/snmpUnixDomain.c:
+
+ CHANGES: snmplib: BUGS: 2922390: Fix test for missing contextName
+ parameter
+
+2010-01-06 11:57 bvassche
+
+ * agent/snmp_perl.c, include/net-snmp/library/tools.h,
+ snmplib/container.c, snmplib/container_binary_array.c,
+ snmplib/container_list_ssll.c, snmplib/parse.c,
+ snmplib/snmp_service.c:
+
+ Changes:
+ - Introduced a new macro NETSNMP_REMOVE_CONST() that allows to
+ cast
+ away constness without that gcc -Wcast-qual reports a warning.
+ - Made casting away constness explicit by introducing the
+ NETSNMP_REMOVE_CONST() macro. This suppresses the warning
+ gcc -Wcast-qual printed for these statements.
+
+2010-01-06 11:46 bvassche
+
+ * agent/mibgroup/tunnel/tunnel.c, snmplib/snmpUDPIPv6Domain.c:
+
+ Fixed compiler warnings about discarding the const qualifier.
+
+2010-01-06 09:14 magfr
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/dlmod.c, agent/snmp_agent.c,
+ apps/agentxtrap.c, snmplib/large_fd_set.c, snmplib/snmp_api.c:
+
+ Do not use 0 when referring to NULL.
+
+2010-01-06 08:26 bvassche
+
+ * include/net-snmp/library/system.h, snmplib/system.c:
+
+ Changed argument types of calculate_time_diff() and
+ calculate_sectime_diff()
+ from struct timeval * to const struct timeval *. Note: this does
+ not affect
+ backwards compatibility.
+
+2010-01-06 08:23 bvassche
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Changes (no functionality has been modified):
+ - Removed diskio_parse_config() declaration because that function
+ is neither called nor defined in the source file diskio.c.
+ - Added declaration for getstats() such that gcc does not
+ complain about a missing declaration.
+ - Linux: changed visibility of getstats() from global to static
+ for consistency with the BSD and Darwin implementations of
+ getstats().
+
+2010-01-06 08:00 bvassche
+
+ * agent/agent_trap.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/utilities/iquery.c:
+
+ Fixed compiler warnings about char * / u_char * mismatches.
+
+2010-01-06 02:18 magfr
+
+ * apps/Makefile.in, configure, configure.d/config_modules_agent,
+ man/Makefile.in, testing/tests/T114agentxagentxtrap:
+
+ CHANGES: apps: Only build agentxtrap if the agentx libraries are
+ built. Add a test case for agentxtrap.
+
+ The enablement/disablement is inspiered by automake conditionals
+
+2010-01-06 01:59 magfr
+
+ * agent/mibgroup/agentx/client.c:
+
+ Remove unused variable starttime.
+
+2010-01-05 22:54 magfr
+
+ * agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/logmatch.h:
+
+ CHANGES: Hide most functions and variables in the logmatch
+ module. Cleaned up the header accordingly. Remove the need for
+ forward declarations by reordering the functions.
+
+2010-01-05 22:33 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: BUGS: 2919379: Initialise SNMP sessions properly
+ Provided by Diego Billi
+
+2010-01-05 22:20 dts12
+
+ * snmplib/snmpCallbackDomain.c:
+
+ CHANGES: snmplib: BUGS: 2919320: Avoid accessing freed memory
+ Reported by Tomasz Lis
+
+2010-01-05 18:58 dts12
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ CHANGES: snmpd: BUGS: 2914410: Fix crash on empty command lines
+
+2010-01-05 15:31 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ CHANGES: snmpd: PATCH: 2912584: Fix null OID handling in Agentx
+ on 64bit
+ Patch supplied by Lutz Jaenicke
+
+2010-01-05 10:11 tanders
+
+ * include/net-snmp/system/hpux.h:
+
+ CHANGES: hpux: fix build error on HP-UX 10.20
+
+2010-01-05 08:42 jsafranek
+
+ * man, man/pdu_api.3, man/session_api.3, man/varbind_api.3:
+
+ Remove generated man pages from repository.
+
+2010-01-04 16:44 bvassche
+
+ * snmplib/read_config.c:
+
+ Fixed a past-end-of-buffer read that occurred when an ASCII
+ string was
+ passed as the first argument of read_config_read_octet_string() /
+ read_config_read_ascii_string() and the third argument (*len)
+ equals 0.
+
+2010-01-04 16:41 bvassche
+
+ * snmplib/read_config.c:
+
+ Fixed compiler warnings about casting away 'const'.
+
+2010-01-04 16:27 bvassche
+
+ * snmplib/read_config.c:
+
+ Added unit test for read_config_read_octet_string() and
+ read_config_read_ascii_string().
+
+2010-01-04 10:45 jsafranek
+
+ * snmplib/mib.c:
+
+ Use correct oid length in table indexes.
+
+2010-01-04 08:10 bvassche
+
+ * snmplib/snmp_alarm.c:
+
+ Made sure that snmp_alarm.c can be compiled again with C89
+ compilers: for C89
+ it is required that initializers are constant expressions.
+
+2010-01-03 16:28 magfr
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_common.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c:
+
+ Rename netsnmp_arch_tcpconn_delete to
+ netsnmp_arch_tcpconn_entry_delete in order to be consistent with
+ the header file and all the other functions in the module.
+
+2010-01-03 16:26 magfr
+
+ * agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+ include/net-snmp/data_access/ip_scalars.h,
+ include/net-snmp/data_access/systemstats.h:
+
+ Add missing declarations.
+
+2009-12-30 12:49 bvassche
+
+ * include/net-snmp/library/tools.h,
+ include/net-snmp/library/types.h:
+
+ Follow-up for r17933: fixed the issue that including the header
+ file
+ <net-snmp/library/types.h> from <net-snmp/library/tools.h>
+ triggers
+ compiler errors during the configure process (complaints about
+ <netsnmp/net-snmp-config.h> not being included before
+ <net-snmp/types.h>).
+ Note: this does not solve the underlying problem that MIB code
+ must not
+ include the header file <net-snmp/types.h> because doing so would
+ trigger a
+ circular dependency during the configure step (MIB code is
+ compiled during
+ the configure step, while the configure step generates
+ <netsnmp/net-snmp-config.h> and <net-snmp/types.h> needs
+ <netsnmp/net-snmp-config.h>).
+
+2009-12-30 11:48 bvassche
+
+ * apps, man:
+
+ Follow-up for r17919: updated Subversion ignore lists.
+
+2009-12-28 18:03 bvassche
+
+ * agent/agent_index.c:
+
+ Fixed a past-end-of-buffer read. Found this by analyzing compiler
+ warnings.
+ Note: the affected function, register_string_index(), isn't
+ called from
+ anywhere inside the Net-SNMP project itself.
+
+2009-12-23 09:49 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ Fix invalid read reported by valgrind:
+ Invalid read of size 1
+ memcpy (mc_replace_strmem.c:402)
+ _netsnmp_ioctl_ipaddress_container_load_v4
+ (ipaddress_ioctl.c:240)
+ netsnmp_arch_ipaddress_container_load (ipaddress_linux.c:158)
+ netsnmp_access_ipaddress_container_load (ipaddress_common.c:112)
+
+ Returning structure with pointers inside is not the best thing to
+ do.
+
+2009-12-22 16:05 bvassche
+
+ * include/net-snmp/library/read_config.h, snmplib/read_config.c,
+ snmplib/snmpusm.c, snmplib/vacm.c:
+
+ Fixed several past-end-of-buffer reads.
+
+2009-12-22 12:02 bvassche
+
+ * agent/mibgroup/Rmon/agutil.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/mibII/interfaces.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/library/system.h,
+ include/net-snmp/library/tools.h,
+ include/net-snmp/library/types.h, man/netsnmp_util.3,
+ snmplib/system.c, snmplib/tools.c, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in:
+
+ Reverted the backwards-incompatible changes of r17913:
+ - Restored the definition of the DIFFTIMEVAL() macro.
+ - Restored the definitions of the functions
+ calculate_time_diff(),
+ uatime_ready(), marker_tticks() and timeval_tticks().
+ - starttime is again a global variable instead of a static one.
+ Also implemented the following changes:
+ - Moved the marker_t typedef from net-snmp/library/tools.h to
+ net-snmp/library/types.h.
+ - Added a new typedef, const_marker_t.
+ - For those atime_*() / uatime_*() / *_tticks() functions that do
+ not change
+ their arguments, declared these arguments const_marker_t instead
+ of marker_t.
+ - Renamed netsnmp_get_starttime() and netsnmp_set_starttime() to
+ netsnmp_get_agent_starttime() and netsnmp_set_agent_starttime()
+ respectively. Moved these functions from tools.c to system.c.
+ - Removed the function atime_hsubtract() (was introduced in
+ r17913) and
+ introduced a new function, netsnmp_set_agent_uptime().
+
+2009-12-22 07:59 bvassche
+
+ * snmplib/read_config.c:
+
+ Reverted r17926, which made the string returned by
+ read_config_read_octet_string() zero-terminated. A new patch will
+ follow
+ that fixes the callers of read_config_read_octet_string() that
+ were
+ assuming that read_config_read_octet_string() zero-terminates the
+ string
+ read by this function.
+
+2009-12-21 14:29 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ CHANGES: snmpd: fix crash in IF-MIB and IP-MIB when there are
+ some interfaces with broadcast IP address and some without.
+
+ Reset the bcastentry in the loop, so it cannot be inserted to the
+ container
+ twice.
+
+ Without this patch, when an interface without broadcast address
+ is processed,
+ the bcastaddress from previous loop is inserted into the
+ container. This
+ obviously fails and the bcastentry is freed, but the container
+ still contains
+ reference to it -> SIGSEGV.
+
+2009-12-21 13:52 bvassche
+
+ * snmplib/read_config.c:
+
+ Follow-up for r17928: while r17928 fixed a dangling pointer
+ dereference
+ detected by running the Net-SNMP software on Windows, that patch
+ introduced
+ a dangling pointer dereference about which only Valgrind on Linux
+ complained.
+ This follow-up patch fixes both dangling pointer dereferences
+ triggered by
+ parsing the persistentDir keyword.
+
+2009-12-21 13:32 bvassche
+
+ * agent/helpers/table_dataset.c:
+
+ Applied a slightly modified version of patch #2901122. Changes:
+ - New feature: specifying ASN type SNMP_NOSUCHINSTANCE as the
+ third argument
+ of netsnmp_set_row_column() will cause an SNMP GetRequest /
+ GetNextRequest to
+ return the error code noSuchInstance (SNMPv2) or noSuchName
+ (SNMPv1). This
+ makes it possible to have a cached table with one or more
+ "holes".
+ - Performance optimization: do not free() / malloc() the memory
+ for storing
+ the cached value if the value has not been modified.
+ - Performance optimization: do not free() / malloc() the memory
+ for storing
+ the cached value if the length of the value has not been
+ modified.
+ - Performance optimization: if the size of the cached value
+ shrunk, use
+ realloc() instead of free() and malloc().
+
+2009-12-21 12:23 bvassche
+
+ * snmplib/read_config.c:
+
+ Applied a slightly modified version of patch #2912055: make sure
+ that
+ parsing the "persistentDir" keyword in snmp.conf does not trigger
+ a
+ dangling pointer. To my surprise BoundsChecker complained about
+ this
+ (on Windows), but Valgrind did not report this issue (on Linux).
+
+2009-12-21 12:08 bvassche
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ Follow-up for r17925 (fix memory leak during startup): while
+ r17925 fixed
+ only the leak triggered from inside the for-loop, this patch does
+ now also
+ fix the leak triggered by the netsnmp_table_dataset_add_row()
+ call near
+ the end of log_notification().
+
+2009-12-21 12:01 bvassche
+
+ * snmplib/read_config.c:
+
+ Applied patch #2912062: make sure that the string returned by
+ read_config_read_octet_string() is properly terminated, such that
+ the
+ callers of this function do not trigger past-end-of-buffer reads.
+ Found
+ this issue via BoundsChecker.
+
+2009-12-21 11:06 bvassche
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ Applied patch #2912068, which fixes a memory leak during startup.
+ The
+ function log_notification() adds a row to the table
+ nlmLogVarTable, but
+ this function can be called before that table has been
+ initialized. If
+ that happens, memory is allocated for a row but that memory is
+ never
+ added to the cached table data. The BoundsChecker tool reported
+ this as
+ a "memory leak leaving scope".
+
+2009-12-21 10:54 bvassche
+
+ * README.win32:
+
+ Added the following text to the "Limitations" section of
+ README.win32:
+ "When using winExtDLL, there is an offset of up to one second
+ between the
+ value of the sysUpTime varbind included in the traps generated by
+ SNMP
+ extension DLLs (e.g. linkUp and linkDown) and the value of the
+ sysUpTime
+ varbind included in traps generated by Net-SNMP itself (e.g.
+ coldStart)."
+
+2009-12-21 10:09 bvassche
+
+ * agent/agent_trap.c, man/netsnmp_agent_trap.3,
+ snmplib/snmp_alarm.c:
+
+ Spelling fix: replaced all occurrences of 'specifc' by
+ 'specific'.
+
+2009-12-21 10:06 bvassche
+
+ * snmplib/snmp_alarm.c:
+
+ Refactoring: eliminated duplicated code by reimplementing
+ snmp_alarm_register() using snmp_alarm_register_hr(). Neither the
+ Net-SNMP API nor the behavior of snmp_alarm_register() has been
+ changed.
+
+2009-12-20 11:10 magfr
+
+ * apps/Makefile.in, apps/agentxtrap.c, man/Makefile.in,
+ man/agentxtrap.1.def:
+
+ NEWS: apps: Add command to send AgentX notify requests to a
+ master agent.
+
+2009-12-17 16:44 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Follow-up for r17917 -- builds again on Windows systems.
+
+2009-12-17 16:03 bvassche
+
+ * agent/mibgroup/utilities/iquery.c,
+ include/net-snmp/library/snmp_client.h, snmplib/snmp_client.c:
+
+ Follow-up for r17903 / patch 2911323 "Fix agent lockup when
+ monitoring
+ AgentX-delegated information" (submitted by myself). That patch
+ did not only
+ fix the lockup but also made snmpd print a warning during startup
+ when
+ iquerySecName was not configured. This warning was printed even
+ when no
+ internal queries were performed. This warning is now only printed
+ just before
+ the first internal query is made (during the first call of
+ netsnmp_query_get_default_session() instead of during creation of
+ the internal
+ session).
+
+2009-12-17 13:55 bvassche
+
+ * agent/mibgroup/Rmon/agutil.c:
+
+ RMON MIB source code compiles again -- should have been included
+ in r17913.
+
+2009-12-17 13:18 bvassche
+
+ * agent/mibgroup/Rmon/agutil.c, snmplib/system.c:
+
+ Modified the implementation of calculate_sectime_diff() and
+ AGUTIL_sys_up_time() such that these functions normalize the
+ tv_usec field of
+ struct timeval properly. Note: this source code modification does
+ not affect
+ the return value of the aforementioned two functions.
+
+2009-12-17 13:11 bvassche
+
+ * man/netsnmp_util.3:
+
+ Removed documentation of the DIFFTIMEVAL() macro -- should have
+ been included
+ in r17913.
+
+2009-12-17 13:05 bvassche
+
+ * agent/agent_trap.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/snmpv3/snmpEngine.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, include/net-snmp/library/system.h,
+ include/net-snmp/library/tools.h, man/netsnmp_util.3,
+ snmplib/snmp_alarm.c, snmplib/system.c, snmplib/tools.c,
+ win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Converted starttime from a global variable into a static variable
+ and applied the following changes:
+ - Added two new macros: NETSNMP_TIMERADD() and
+ NETSNMP_TIMERSUB().
+ - Added three new functions: netsnmp_get_starttime(),
+ netsnmp_set_starttime() and atime_hsubtract().
+ - Replaced gettimeofday() + calculate_time_diff() calls by a call
+ to netsnmp_get_agent_uptime().
+ - Removed the macro DIFFTIMEVAL() because it was not used inside
+ the Net-SNMP project and because it contained a bug.
+ - Removed the functions calculate_time_diff(), uatime_ready(),
+ marker_tticks() and timeval_tticks().
+
+2009-12-17 12:44 bvassche
+
+ * agent/mibgroup/agentx/master_admin.c,
+ win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Bug fix: according to RFC 2571 the unit of snmpEngineTime is one
+ second,
+ not one hundredth of a second.
+
+2009-12-17 10:03 dts12
+
+ * man/snmptest.1.def:
+
+ Fix typo.
+
+2009-12-16 12:30 bvassche
+
+ * snmplib/tools.c, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Windows-only bug fixes:
+ - Fixed the strange build errors that occurred when compiling
+ libnetsnmp as a DLL and when either <stdlib.h> or <string.h> was
+ included after <net-snmp-config.h> instead of before.
+ - For debug builds with Microsoft Visual Studio, fixed the
+ mismatches between the _malloc_dbg() call invoked by strdup() and
+ free()-ing strdup()-ed memory by including the <crtdbg.h> header
+ in tools.c and by defining the preprocessor symbol
+ _CRTDBG_MAP_ALLOC. Detected via the memory checker included in
+ Intel Parallel Studio.
+
+2009-12-14 17:23 tanders
+
+ * perl/agent/agent.xs, snmplib/snmpTCPDomain.c,
+ snmplib/snmpUDPDomain.c:
+
+ sync definition of netsnmp_udp_addr_pair in Perl with the changes
+ in
+ r17855 and r17908
+
+2009-12-14 13:55 jsafranek
+
+ * snmplib/snmpTCPDomain.c:
+
+ Fix TCP transport broken by rev. 17855 - copies of
+ netsnmp_udp_addr_pair in snmpTCPDomain.c and snmpUDPDomain.c must
+ be the same.
+
+2009-12-11 14:43 hardaker
+
+ * apps/snmpusm.c, man/snmpusm.1.def:
+
+ CHANGES: snmpusm: patch from Martin Bjorklund to add a -Cw option
+ to use createAndWait for agents that are strict about not
+ allowing a row to be set to active until the authentication
+ password has been changed; plus white-space clean up, manual
+ additions and help output modifications by hardaker
+
+2009-12-11 14:35 bvassche
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Fixed a compiler warning about a format specifier mismatch.
+
+2009-12-11 14:06 bvassche
+
+ * README.win32, agent/mibgroup/winExtDLL.c:
+
+ winExtDLL bugs fixed:
+ - sysUpTime.0 does now report the correct value.
+ - a linkUp or linkDown trap is now sent after the status of a
+ network interface
+ has changed.
+ - the value of the sysUpTime.0 varbind in linkUp and linkDown
+ traps is now
+ correct.
+
+2009-12-10 15:52 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ CHANGES: agent: PATCHES: 2911970: Properly terminate linked list
+ of registrations.
+ Patch provided by Mirko Deckert.
+
+2009-12-10 15:43 dts12
+
+ * agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/utilities/iquery.c:
+
+ CHANGES: snmpd: PATCHES: 2911323: Fix agent lockup when
+ monitoring AgentX-delegated information
+
+2009-12-10 13:59 bvassche
+
+ * README.win32:
+
+ Changes:
+ - Added information about Microsoft's implementation of
+ hrSystemUptime.0.
+ - Fixed a few typos.
+
+2009-12-10 13:01 bvassche
+
+ * agent/agent_registry.c:
+
+ Added missing newline in a logging statement.
+
+2009-12-10 12:54 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Fixed the following winExtDLL bugs:
+ - Fixed bug in trap forwarding: linkDown traps were sent as
+ warmStart traps
+ and linkUp traps were sent as linkDown traps.
+ - Fixed a memory leak triggered by extension DLL loading.
+ - A debug trace statement is now invoked whenever a serious error
+ has been
+ detected.
+
+2009-12-10 12:37 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ OIDs in debug messages generated by the winExtDLL module are now
+ printed in
+ symbolic form instead of numeric form.
+
+2009-12-10 08:57 bvassche
+
+ * win32/win32sdk.dsw:
+
+ Project dependencies should now really be correct. Should have
+ been included
+ in r17873.
+
+2009-12-10 08:41 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Changes (only source code comments have been changed):
+ - Removed a note that contradicted the instructions in
+ README.win32.
+ - Updated build instructions after the addition of the file
+ win32/Snmp-winExtDLL.h in r17830.
+
+2009-12-10 08:17 bvassche
+
+ * apps/snmpdf.c, apps/snmpstatus.c:
+
+ Made file header comments consistent with the descriptions in the
+ respective man pages.
+
+2009-12-10 03:04 magfr
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Made sure that agent_sysOR_callback won't trigger a warning when
+ registered as a callback. Change agentx_reopen_sysORTable in
+ order to avoid warnings of const removal.
+
+2009-12-09 15:05 bvassche
+
+ * snmplib/snmp_logging.c:
+
+ - Moved the declaration of the variable 'newline' inside the
+ function
+ log_handler_stdouterr() because this variable is only used by
+ that function.
+ - Documented the purpose of the variable 'newline'.
+ - Bug fix: made sure that the call log_handler_stdouterr() does
+ not trigger an
+ invalid memory access (str[-1]) when an empty string is passed to
+ this function.
+
+2009-12-09 14:37 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ include/net-snmp/data_access/arp.h:
+
+ CHANGES: snmpd: Add support of network interfaces with HW address
+ bigger than 6 bytes to ipNetToMediaTable and
+ ipNetToPhysicalTable.
+ Some HW, like InfiniBand, uses HW addresses with 9 and more
+ bytes. Snmpd on Linux was not able to parse /proc/net/arp then
+ and produced ugly 'ioctl 35123 returned -1' to log.
+
+2009-12-09 12:27 bvassche
+
+ * README.win32:
+
+ Added missing -Lo in a command line example.
+
+2009-12-09 12:16 bvassche
+
+ * win32/snmpdsdk/snmpd.dsp:
+
+ Added snmpapi.lib to the linker input list of snmpd.exe.
+ Apparently Visual
+ Studio 2005 and 2008 need this library in the linker input list
+ when linking
+ the exe, while for Visual Studio 6 it is sufficient when this
+ library is
+ present in the linker input list of netsnmpmibs.lib.
+
+2009-12-09 08:45 bvassche
+
+ * README.win32:
+
+ Updated README.win32: because of r17884 and r17873, the build
+ process became simpler.
+
+2009-12-09 08:22 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def.in:
+
+ Export strtoull -- should have been included in r17886.
+
+2009-12-09 08:21 bvassche
+
+ * README.win32:
+
+ Reverted r17700 for README.win32: because of r17886, modifying
+ the
+ strtoull line in win32/libsnmp_dll/libsnmp.def is no longer
+ necessary.
+
+2009-12-09 08:12 bvassche
+
+ * win32/libsnmp_dll/libsnmp.def, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Windows: switched from _strtoui64() to strtoull() for Microsoft
+ Visual Studio
+ 2002 and later because the former is not fully POSIX compliant.
+ The strtoull()
+ unit test produces the following output for _strtoui64() with
+ MSVC 2008:
+ test 14 failed (input "0x"): expected end 1, got end 0
+ test 16 failed (input "0x"): expected end 1, got end 0
+
+2009-12-08 21:54 magfr
+
+ * agent/mibgroup/util_funcs.c, snmplib/system.c:
+
+ CHANGES: snmplib, snmpd: Make sure that a mask is given to open
+ when O_CREAT is specified
+
+2009-12-08 16:20 bvassche
+
+ * win32/win32.dsw:
+
+ Made dependencies between exe's and lib's explicit such that
+ Visual
+ Studio can figure out the proper build order instead of the user
+ having
+ to figure this out.
+
+2009-12-08 15:47 bvassche
+
+ * apps/snmptable.c:
+
+ Builds again on Unix systems (fixed a typo introduced in r17881).
+
+2009-12-08 15:37 bvassche
+
+ * win32/snmpnetstat/snmpnetstat.dsp:
+
+ Added missing #define HAVE_WIN32_PLATFORM_SDK. Without this
+ define the Microsoft
+ Visual Studio compiler complains about a benign redefinition of
+ type socklen_t.
+
+2009-12-08 15:28 bvassche
+
+ * agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/snmpd.c, apps/snmptable.c, apps/snmptrapd.c,
+ include/net-snmp/library/snmp_logging.h, snmplib/snmp_logging.c:
+
+ Cleaned up the code for setting line buffering:
+ - Instead of having calls to setvbuf() in multiple files, there
+ is now one call
+ to setvbuf() from the new function netsnmp_set_filelog. These
+ source files
+ are: snmplib/snmp_logging.c, agent/snmpd.c, apps/snmptrapd.c,
+ apps/snmptable.c
+ and agent\mibgroup\disman\traceroute\traceRouteCtlTable.c.
+ - Using -Lo / -Le does now enable line buffering for stdout /
+ stderr respectively.
+ - Removed code in snmpd.c and snmptrapd.c for setting line
+ buffering on stdout
+ since setting line buffering on stdout is now triggered by the
+ command-line
+ option -Lo.
+ Bugs fixed:
+ - Line buffering mode is now also set for stderr when the
+ command-line option
+ -Le has been specified.
+ - Line buffering mode is now set correctly for stdout on Windows
+ systems
+ (command-line option -Lo).
+
+2009-12-08 12:32 bvassche
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ Fixed a compiler warning about local variables that were defined
+ but
+ not used by only enabling the local variable definitions on the
+ platform that uses these variables (Linux).
+
+2009-12-08 12:26 bvassche
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Added #include "mibgroup/util_funcs.h". Fixes a compiler warning.
+
+2009-12-08 12:25 bvassche
+
+ * apps/snmpnetstat/main.c:
+
+ Include the gethostent() / sethostent() declarations before using
+ these
+ functions. Fixes a compiler warning on Windows systems.
+
+2009-12-08 12:11 bvassche
+
+ * apps/snmptrapd_handlers.c:
+
+ Fixed an inconsistency (which is allowed by the ANSI C standard)
+ between
+ function declaration and function definition of
+ netsnmp_add_global_traphandler and
+ netsnmp_add_default_traphandler such
+ that the Microsoft Visual Studio compiler does no longer complain
+ about
+ this.
+
+2009-12-08 12:08 bvassche
+
+ * snmplib/snmp_service.c:
+
+ Fixed a compiler warning: made sure that the compiler does not
+ complain about implicitly casting away constness.
+
+2009-12-08 12:07 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Only compile the winExtDLL source code if the preprocessor macro
+ USING_WINEXTDLL_MODULE has been defined.
+
+2009-12-08 12:03 bvassche
+
+ * win32/libsnmp/libsnmp.dsp:
+
+ Added missing #define HAVE_WIN32_PLATFORM_SDK.
+
+2009-12-08 12:01 bvassche
+
+ * win32/win32sdk.dsw:
+
+ Made dependencies between exe's and lib's explicit such that
+ Visual
+ Studio can figure out the proper build order instead of the user
+ having
+ to figure out the build order.
+
+2009-12-08 09:46 bvassche
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Windows / Microsoft Visual Studio: disabled the compiler warning
+ about
+ signed/unsigned mismatches (4018) because this warning does not
+ yield
+ any useful information.
+
+2009-12-08 09:17 bvassche
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ Follow-up for r17639 (patch 2780411 -- fix compiler warnings):
+ applied
+ this patch to net-snmp-config.h.in too such that
+ net-snmp-config.h and
+ net-snmp-config.h.in match again.
+
+2009-12-08 08:16 bvassche
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Made sure that agentx_sysOR_callback() does not trigger a
+ compiler
+ warning when the third argument passed to this function has been
+ declared const.
+
+2009-12-08 08:14 bvassche
+
+ * include/net-snmp/library/system.h:
+
+ Changed the return type of strtoull() from 'unsigned long long'
+ (which
+ is not valid C89) to 'uint64_t' (declared in
+ <net-snmp/net-snmp-config.h>).
+ This change makes the Net-SNMP source code compile again with
+ MSVC 6.0.
+
+2009-12-07 10:46 dts12
+
+ * apps/snmptable.c:
+
+ Tweak missing subidentifier processing to be more type-aware.
+ (An issue with AIX, at least)
+
+2009-12-06 18:38 magfr
+
+ * snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ CHANGES: Make the lists of com2Sec*Entries static
+
+2009-12-06 18:34 magfr
+
+ * snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ Make the iterator variable in netsnmp_*_getSecName const
+
+2009-12-06 18:29 magfr
+
+ * agent/mibgroup/mibII/vacm_conf.c,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ CHANGES: Change the types of the return values of
+ netsnmp_*_getSecName from char* to const char* since they point
+ into internal structures.
+
+2009-12-05 20:19 tanders
+
+ * include/net-snmp/library/system.h:
+
+ fix declaration of strtoull
+
+2009-12-05 17:42 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ call netsnmp_read_module instead of read_module to make it
+ compile with
+ NETSNMP_CLEAN_NAMESPACE
+
+2009-12-02 15:39 jsafranek
+
+ * agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c:
+
+ CHANGES: snmpd: Fixed invalid access to memory in TCP-MIB
+ This partly reverts patch 17719 - the entries *are* used after
+ raw_data container is freed. These entries should be freed when
+ associated rowreq_ctx is freed.
+
+2009-12-02 08:30 jsafranek
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ CHANGES: snmpd: Fixed udpTable indexes on big-endian 64bit Linux.
+ The index was always '0.0.0.0' instead of real local IP address.
+
+2009-12-01 12:36 dts12
+
+ * include/net-snmp/types.h:
+
+ Update a redundant (and probably inaccurate) comment.
+
+2009-12-01 12:31 dts12
+
+ * agent/helpers/table.c:
+
+ CHANGES: agent: BUGS: 2822360: Fix memory leak when building
+ table OIDs
+
+2009-12-01 12:08 dts12
+
+ * apps/snmptable.c:
+
+ CHANGES: snmptable: BUGS: 2837998: Handle missing instance
+ subidentifiers in results
+
+2009-12-01 11:56 dts12
+
+ * agent/mibgroup/agentx/client.c:
+
+ CHANGES: agent: BUGS: 2841008: Protect against crash following
+ failed AgentX response
+
+2009-12-01 07:34 jsafranek
+
+ * include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmpUDPDomain.c:
+
+ CHANGES: snmplib: Fix responding to broadcast requests.
+ UDP responses are sent with source IP address which was
+ destination of
+ appropriate requests (implemented in SVN rev. 15215). But if the
+ destination
+ of a request is broadcast IP address, the request was sent with
+ the broadcast
+ address as source. sendmsg() on Linux does not support this and
+ returns error
+ -> response is not sent. In order to send responses from the same
+ interface,
+ interface index of the appropriate interface must be used.
+
+2009-12-01 00:29 magfr
+
+ * agent/mibgroup/disman/schedule/schedCore.c:
+
+ Make it possible to actually compile after 17852.
+
+2009-12-01 00:24 magfr
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ Make it possible to actually compile after 17842.
+
+2009-11-30 16:55 dts12
+
+ * agent/mibgroup/disman/schedule/schedCore.c:
+
+ CHANGES: agent: BUGS: 2873858: Fix handling of schedOwner index.
+ Patch provided by Max Schubert.
+
+2009-11-30 16:46 dts12
+
+ * local/mib2c.old-api.conf:
+
+ CHANGES: mib2c: BUGS: 2888569: Fix generation of table columns
+ array
+
+2009-11-30 16:30 dts12
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ CHANGES: agent: BUGS: 2894059: Handle errors when counting
+ interfaces
+
+2009-11-30 16:07 dts12
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ CHANGES: agent: BUG: 2897000: Suppress 32-bit counter truncation
+ warnings.
+
+2009-11-30 15:34 dts12
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ CHANGES: agent: PATCH: 2903092: Fix broken handling of broadcast
+ entries.
+
+2009-11-30 15:19 dts12
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ CHANGES: agent: PATCH: 2901029: Fix compiler warning on
+ CloseHandle()
+ Endian problems already addressed by patch #2835576
+
+2009-11-30 15:13 dts12
+
+ * perl/agent/agent.xs:
+
+ CHANGES: perl: PATCH: 2890931: Better handling of Counter64
+ values.
+ Patch provided by Max Romanov.
+
+2009-11-30 15:07 dts12
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ CHANGES: agent: PATCH: 2887816: Protect against division-by-zero
+ crash
+
+2009-11-30 15:03 dts12
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ CHANGES: agent: PATCH: 2883220: Fix compilation problems when
+ ifXTable is not included.
+
+2009-11-30 14:49 dts12
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ CHANGES: agent: PATCH: 2883155: Fix memory leak in proxy
+ handling.
+ Patch supplied by Gowtham Thommandra.
+
+2009-11-30 14:32 dts12
+
+ * agent/mibgroup/ucd-snmp/proc.c, man/snmpd.conf.5.def:
+
+ CHANGES: agent: PATCH: 2883092: Support monitoring processes that
+ should not be running.
+ Patch provided by Christian (cg75).
+
+ Qn: Should this functionality be back-ported to earlier lines?
+
+2009-11-30 14:12 dts12
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: agent: PATCH: 2877518: Fix handling of scoped AgentX
+ variables
+
+2009-11-30 14:01 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ CHANGES: agent: PATCH: 2835576: Fix endianness issues in
+ pass/pass_persist
+
+2009-11-27 08:54 jsafranek
+
+ * agent/helpers/table_row.c:
+
+ Remove executable attribute from source files.
+
+2009-11-25 20:35 magfr
+
+ * agent/agent_trap.c, agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ local/mib2c.notify.conf:
+
+ CHANGES: snmpd: Make all the oids and oid lengths in agent_trap.c
+ const and use them from everywhere.
+
+2009-11-25 20:27 magfr
+
+ * snmplib/Makefile.in:
+
+ CHANGES: snmplib: Install library/oid.h. Thanks to "Tomasz Lis"
+ who spotted the bug.
+
+2009-11-25 09:47 bvassche
+
+ * include/net-snmp/agent/instance.h:
+
+ Comment-only change: changed the name in the file header from
+ testhandler.h
+ to instance.h such that it now matches the filename.
+
+2009-11-24 07:49 magfr
+
+ * agent/agent_trap.c:
+
+ Remove unnecessary cast
+
+2009-11-23 07:07 magfr
+
+ * agent/agent_trap.c, include/net-snmp/agent/agent_trap.h:
+
+ CHANGES: snmpd: Make the enterprise argument of
+ netsnmp_send_traps and send_enterprise_trap_vars const
+
+2009-11-23 07:02 magfr
+
+ * include/net-snmp/library/snmp_client.h, snmplib/snmp_client.c:
+
+ CHANGES: snmplib: Make the name argument to find_varbind_in_list
+ const
+
+2009-11-22 23:25 magfr
+
+ * agent/mibgroup/Rmon/event.c, agent/mibgroup/smux/smux.h:
+
+ Remove some local redeclarations of functions
+
+2009-11-22 01:03 magfr
+
+ * win32/config.h.borland, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: building, Win32: Remove a few unused configure symbols
+
+2009-11-21 08:01 bvassche
+
+ * win32/Snmp-winExtDLL.h, win32/snmp-winextdll.h:
+
+ Replaced an accidentally committed file by the proper contents.
+
+2009-11-20 16:29 bvassche
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ Reverted accidentally merged changes.
+
+2009-11-20 16:26 bvassche
+
+ * win32/lib, win32/net-snmp/net-snmp-config.h,
+ win32/snmp-winextdll.h:
+
+ Updated Subversion ignore list.
+
+2009-11-20 16:18 bvassche
+
+ * agent/helpers/table_iterator.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/examples/netSnmpHostsTable_access.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ipCidrRouteTable.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c,
+ local/mib2c-conf.d/mfd-interface.m2c,
+ local/mib2c.access_functions.conf,
+ local/mib2c.iterate_access.conf, snmplib/read_config.c:
+
+ Spelling fix in C source code comments: replaced 'retrival' by
+ 'retrieval'.
+
+2009-11-20 16:15 bvassche
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Fixed a naming inconsistency: replaced two occurrences winExtDll
+ by winExtDLL in source code comments.
+
+2009-11-19 22:52 magfr
+
+ * agent/helpers/watcher.c, agent/mibgroup/mibII/system_mib.c,
+ include/net-snmp/agent/watcher.h:
+
+ CHANGES: snmpd: BUG: 2900078: Add support for OID variables with
+ size in elements instead of bytes, correct sysObjectID to use
+ this.
+
+2009-11-13 12:59 jsafranek
+
+ * agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/tcp.c:
+
+ CHANGES: snmpd: Fixed logging of 'truncating integer value > 32
+ bits' in IP-MIB and TCP-MIB
+ The counters, which grow fast are now cut to 32bits.
+
+2009-11-12 08:26 magfr
+
+ * agent/snmpd.c:
+
+ Use big printf's instead of many small ones to save a few hundred
+ bytes on the final executable size.
+
+2009-11-12 02:24 magfr
+
+ * configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in, snmplib/Makefile.in,
+ snmplib/strlcpy.c, snmplib/strtok_r.c, snmplib/strtol.c,
+ snmplib/strtoul.c, snmplib/strtoull.c:
+
+ CHANGES: building: Use AC_REPLACE_FUNCS to handle code that is
+ missing on some platforms.
+
+2009-11-11 09:00 dts12
+
+ * local/mib2c.iterate.conf, local/mib2c.table_data.conf:
+
+ Fix cache free routine to match header declaration.
+ Return success/failure values from cache load routine.
+ Problem identified by Xuan.
+
+2009-10-30 09:51 magfr
+
+ * include/net-snmp/library/asn1.h, include/net-snmp/library/oid.h,
+ include/net-snmp/types.h:
+
+ NEWS: snmplib: Revert 17808, instead factor out the declaration
+ of oid to it's own file and include that file from both types.h
+ and asn1.h
+
+2009-10-30 08:28 magfr
+
+ * agent/helpers/table.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/struct.h, agent/mibgroup/ucd-snmp/memory.c,
+ apps/snmpnetstat/if.c, configure,
+ configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in, include/net-snmp/types.h,
+ snmplib/mib.c, snmplib/oid_stash.c, snmplib/read_config.c,
+ snmplib/snmp_debug.c, snmplib/snmpusm.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmplib, snmpd, snmpnetstat: Add correct size prefixes
+ when printing variables of type oid.
+
+2009-10-30 08:07 magfr
+
+ * include/net-snmp/types.h:
+
+ CHANGES: snmplib: Change oid to be a 32-bit type on ILP64 and
+ LP64 platforms.
+
+2009-10-30 08:05 magfr
+
+ * include/net-snmp/library/asn1.h:
+
+ NEWS: snmplib: Remove the oid typedef from
+ <net-snmp/library/asn1.h>. It is still present in
+ <net-snmp/types.h>, use that file.
+
+2009-10-28 16:48 hardaker
+
+ * agent/snmp_vars.c:
+
+ don't require subagent_init() if not only building master agent
+ code
+
+2009-10-27 06:44 magfr
+
+ * local/mib2c-conf.d/generic-table-indexes-to-oid.m2i,
+ local/mib2c.access_functions.conf, local/mib2c.container.conf,
+ local/mib2c.iterate.conf, local/mib2c.iterate_access.conf,
+ local/mib2c.row.conf, local/mib2c.scalar.conf,
+ local/mib2c.table_data.conf:
+
+ CHANGES: mib2c: Remove unnecessary casts to u_char*
+
+2009-10-14 23:12 magfr
+
+ * apps/encode_keychange.c, snmplib/scapi.c:
+
+ CHANGES: apps, snmplib: PATCH: 2835577: identified by "Bart Van
+ Assche": Replace SNMP_ZERO of arrays with a memset.
+
+2009-10-12 20:28 magfr
+
+ * snmplib/parse.c:
+
+ Lessen the scope of the rp variable to the smallest possible one.
+
+2009-10-09 12:38 jsafranek
+
+ * snmplib/snmp_client.c:
+
+ CHANGES: snmplib: PATCH:2871747: plug memory leak in OID
+ processing.
+ The memory leaked when small OID, which could fit pre-allocated
+ vp->name_loc, was placed in different (allocated) one.
+
+2009-10-09 05:31 magfr
+
+ * snmplib/mib.c, snmplib/parse.c:
+
+ CHANGES: BUG: 2838243: Correct the output of unsigned values.
+ Thanks to Jack Huang of Qualcomm who pointed out this bug.
+
+2009-10-09 05:00 magfr
+
+ * snmplib/parse.c:
+
+ CHANGES: snmplib: Change the parsing of ranges to accept all
+ valid values.
+
+2009-10-07 22:24 magfr
+
+ * agent/mibgroup/examples/example.c, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ configure, configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: misc: PATCH: 2836112: Use the right modifier when
+ printing size_t and ssize_t variables.
+
+2009-10-07 12:50 jsafranek
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ CHANGES: snmpd: Fixed creation of views using snmpusm, OIDs with
+ indexes > 255 are allowed now.
+ This reverts SVN commit #7492.
+
+2009-10-05 19:19 magfr
+
+ * include/net-snmp/library/dir_utils.h,
+ include/net-snmp/library/file_utils.h,
+ include/net-snmp/library/text_utils.h:
+
+ CHANGES: snmplib: Correct the spelling of __cplusplus when
+ checking if the file should be wrapped in extern "C".
+
+2009-10-05 06:13 magfr
+
+ * apps/snmpwalk.c:
+
+ CHANGES: snmpwalk: Handle the case when the end oid is longer
+ than the current oid correctly
+
+2009-09-30 10:12 dts12
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ CHANGES: Solaris: Protect against missing package version
+ information crashing the agent.
+ Problem reported by Inyaven Sakarai.
+
+2009-09-27 14:59 alex_b
+
+ * win32/dist/README.build.win32.txt, win32/dist/build-binary.pl,
+ win32/dist/scripts/mandir2html:
+
+ Win32: Binary build instructions and script updates.
+
+
+
+
+----------------------------------------------------------------------
+
+Changes: V5.5.rc3 -> V5.5
+
+2009-09-23 23:42 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-09-23 23:40 hardaker
+
+ * FAQ:
+
+ remove SVN branch wording
+
+2009-09-23 23:36 hardaker
+
+ * FAQ:
+
+ proper project capitalization
+
+2009-09-23 23:35 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2009-09-23 23:30 hardaker
+
+ * man/pdu_api.3, man/session_api.3, man/varbind_api.3:
+
+ version update
+
+2009-09-22 21:51 tanders
+
+ * README.solaris:
+
+ fix typos
+
+
+
+----------------------------------------------------------------------
+
+Changes: V5.5.rc2 -> V5.5.rc3
+
+2009-09-14 22:39 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-09-14 22:36 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec, man/pdu_api.3, man/session_api.3,
+ man/varbind_api.3:
+
+ Version number update
+
+2009-09-14 22:18 hardaker
+
+ * README.aix, apps/snmpnetstat/if.c, include/net-snmp/system/aix.h:
+
+ Patch from magfr for 5.5 specific aix build fixes
+
+2009-09-02 07:12 jsafranek
+
+ * agent/mibgroup/smux/snmp_bgp.c, agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_rip2.c, include/net-snmp/library/mib.h:
+
+ CHANGES: snmplib: rename MIB macro to NETSNMP_MIB2_OID, MIB is
+ too generic and may conflict with applications.
+
+ The old MIB macro is kept for backward compatibility, unless
+ NETSNMP_NO_LEGACY_DEFINITIONS is defined.
+
+2009-08-31 19:38 nba
+
+ * mibs/rfclist:
+
+ Additional RFC mibs
+
+2009-08-31 19:37 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ IANA fixed a bug
+
+2009-08-29 07:29 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Remove unneeded casts.
+
+2009-08-29 07:28 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: ret is only used in settable tables so only declare it
+ then.
+
+2009-08-29 07:24 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Replace the _oid_len variable with an explicit call of
+ OID_LENGTH.
+
+2009-08-29 07:21 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Make every function that can be static static. Remove the
+ declarations of the static functions and the private defines from
+ the header.
+
+2009-08-29 07:19 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Reorder the functions in order to avoid the need for
+ forward declarations.
+
+2009-08-29 07:16 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: netsnmp_table_register should be netsnmp_register_table
+ and take only two argments.
+
+2009-08-29 07:14 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: build_oid expects a pointer to allocated oid. Change to
+ use build_oid_noalloc and remove one copy of the indices.
+
+2009-08-29 07:10 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: There is no index_oid_len member in struct entry. Use the
+ intended local variable index_oid_len.
+
+2009-08-29 07:06 magfr
+
+ * local/mib2c.raw-table.conf:
+
+ mib2c: Correct the return type of ${i}_get*entry to match the
+ returned type.
+
+2009-08-26 22:37 hardaker
+
+ * ChangeLog:
+
+ whwoops; blew the changelog for rc2
+
+2009-08-26 17:38 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-08-26 17:29 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+----------------------------------------------------------------------
+
+Changes: V5.5.rc1 -> V5.5.rc2
+
+2009-08-26 17:38 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-08-26 17:29 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2009-08-26 17:28 hardaker
+
+ * dist/makerelease.xml:
+
+ updated based on new SF upload methods; no longer as automatable
+
+2009-08-26 17:26 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c:
+
+ CHANGES: snmpd: patch from Jan to endless loop in default routes
+ on linux
+
+2009-08-26 17:25 hardaker
+
+ * include/net-snmp/library/types.h:
+
+ apply patch from Jan to fix C++ wrapper
+
+2009-08-26 14:53 dts12
+
+ * local/Makefile.in, local/mib2c.raw-table.conf:
+
+ Initial stab at a minimal-helper (raw) table template,
+ leaving most of the work to the user-provided MIB handler.
+
+2009-08-26 14:50 dts12
+
+ * snmplib/snmp_api.c:
+
+ Protect against bogus failures (returning 0) and subsequent
+ double-frees,
+ due to 15-/31-bit masking when selecting request IDs. Identified
+ by kromesky.
+
+2009-08-20 13:30 jsafranek
+
+ * agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c:
+
+ CHANGES: snmpd: plug leaks in ipIfStatsTable,
+ ipv6ScopeZoneIndexTable, ipSystemStatsTable and
+ ipDefaultRouterTable.
+
+ It seems to me the tables were wrongly generated with
+ m2c_data_allocate or
+ someone forgot to release the user provided data.
+
+2009-08-12 15:00 tanders
+
+ * NEWS:
+
+ fix libtool version in NEWS
+
+2009-08-11 00:42 hardaker
+
+ * CHANGES, ChangeLog:
+
+ whoops; add real changelog enteries for .rc1
+
+2009-08-10 23:10 hardaker
+
+ * dist/makerelease.xml:
+
+ fix typo in svn2cl line
+
+2009-08-10 23:05 hardaker
+
+ * snmplib/Makefile.depend:
+
+ make depend
+
+2009-08-10 21:32 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+-------------------------------------------------------------------------------
+
+Changes: V5.5.pre3 -> V5.5.rc1
+
+2009-08-10 23:10 hardaker
+
+ * dist/makerelease.xml:
+
+ fix typo in svn2cl line
+
+2009-08-10 23:05 hardaker
+
+ * snmplib/Makefile.depend:
+
+ make depend
+
+2009-08-10 21:32 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-08-10 21:21 hardaker
+
+ * dist/makerelease.xml, man/pdu_api.3, man/session_api.3,
+ man/varbind_api.3:
+
+ Version number update
+
+2009-08-07 10:32 dts12
+
+ * CHANGES, NEWS:
+
+ Correct, consolidate, clarify and cleanup the catalog of current
+ changes.
+
+2009-08-06 07:57 dts12
+
+ * FAQ:
+
+ Expand on exec vs extend.
+
+2009-08-05 20:07 dts12
+
+ * agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ snmplib/file_utils.c:
+
+ CHANGES: snmpd: BUG: 2822355: Fix memory leaks on
+ udpEndpointTable (linux)
+ Patch supplied by Frank Lichtenheld
+
+2009-08-05 19:05 dts12
+
+ *
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c:
+
+ CHANGES: snmpd: PATCHES: 2822337: Fix memory leak in
+ ipAddressPrefixTable
+
+2009-08-05 15:16 jsafranek
+
+ * agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c:
+
+ Fix memory leak in NetToMediaTable.
+ When deleting row context, delete also associated data.
+
+2009-08-05 15:15 jsafranek
+
+ *
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c:
+
+ Fix memory leak in NetToMediaTable.
+ The container used to track entries to delete from cache should
+ be released when it's not needed.
+
+2009-08-05 15:12 jsafranek
+
+ *
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c,
+
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c:
+
+ Fix memory leak in UDP- and TCP-MIB.
+ The data from raw_data are copied to cache, so it should be
+ freed.
+
+2009-08-05 10:16 dts12
+
+ * apps/snmptable.c:
+
+ CHANGES: apps: BUG: 2811577: Fix bug in GetBulk handling.
+ Don't get confused by index values that contain a ':' character.
+
+2009-08-04 21:59 dts12
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i:
+
+ CHANGES: mib2c: BUG: 2827269: Suppress non-ordered TODO comments.
+
+2009-08-04 21:35 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Handle generating code for a single table,
+ as well as a larger group.
+ Also addresses bug 2150285
+
+2009-08-04 21:16 magfr
+
+ * snmplib/strtoull.c:
+
+ snmplib: from "Bart van Assche & Magnus Fromreide": More updates
+ to strtoull.c
+
+2009-08-04 10:57 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_common.c:
+
+ CHANGES: snmpd: from "Marcus Rॆअआॆअžckert": fix possible crash when
+ 64-bit counters in ipSystemStatsTable get bigger than 2^32
+
+2009-08-03 19:27 magfr
+
+ * configure, configure.d/config_os_headers,
+ include/net-snmp/net-snmp-config.h.in, snmplib/strtoull.c:
+
+ CHANGES: snmplib: PATCH: 2827722: from "Bart Van Assche": Improve
+ strtoull to be less MSVC-specific
+
+2009-08-03 18:38 magfr
+
+ * man/Makefile.in:
+
+ remove an obsolete manual page from the set of files that should
+ be installed
+
+2009-07-27 12:41 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2009-07-27 12:11 hardaker
+
+ * man/netsnmp_Container_iterator.3:
+
+ remove an obsolete manual page
+
+2009-07-27 12:03 hardaker
+
+ * perl/SNMP/t/bulkwalk.t:
+
+ CHANGES: freebsd: patch from Cezary Morga to fix a make test on
+ freebsd
+
+2009-07-27 12:02 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-07-27 11:52 hardaker
+
+ * FAQ, NEWS, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2009-07-27 08:39 hardaker
+
+ * testing/tests/T350unix:
+
+ revert accidentially applied patch
+
+2009-07-27 08:37 hardaker
+
+ * testing/tests/T350unix, testing/tests/T360dtlsudp,
+ testing/tests/test-localhost.cert,
+ testing/tests/test-localhost.priv, testing/tests/test-user.cert,
+ testing/tests/test-user.priv:
+
+ added a test case for udp/dtls
+
+2009-07-27 08:36 hardaker
+
+ * snmplib/snmp_api.c:
+
+ don't require a session to carry a secName
+
+2009-07-26 21:34 alex_b
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Win32: MSVC 6 compile fixes for Workspace build.
+
+2009-07-26 18:20 alex_b
+
+ * README.win32, configure, configure.d/config_os_functions,
+ include/net-snmp/library/system.h,
+ include/net-snmp/net-snmp-config.h.in, snmplib/strtoull.c,
+ win32/dist/build-binary.bat, win32/dist/build-binary.pl,
+ win32/dist/installer/net-snmp.nsi, win32/libsnmp/Makefile.in,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/Makefile.in,
+ win32/libsnmp_dll/libsnmp.def.in,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ -Added strtoull function and configure check for systems without
+ it such as Win32 MSVC 6
+ -Win32: MSVC 6 compile fixes - requires new strtoull.c file
+ -Win32: New build-binary script to simplify building the Windows
+ binary package.
+
+2009-07-25 05:31 magfr
+
+ * testing/tests/T160snmpnetstat:
+
+ Make sure a message is written if the relevant table is missing.
+
+2009-07-23 21:29 alex_b
+
+ * README:
+
+ Update email address in README.
+
+2009-07-23 01:07 alex_b
+
+ * win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Win32 MSVC 2008+ fixes.
+
+2009-07-23 00:55 alex_b
+
+ * include/net-snmp/library/snmp_logging.h,
+ win32/netsnmpmibssdk/Makefile.in,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Win32 MSVC 2005+ build fixes. Thanks to Bart Van Assche.
+
+2009-07-21 12:22 dts12
+
+ * local/mib2c.container.conf, local/mib2c.iterate.conf,
+ local/mib2c.iterate_access.conf, local/mib2c.row.conf,
+ local/mib2c.table_data.conf:
+
+ Add simple debug output to mib2c templates.
+
+2009-07-21 12:13 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Fix missing semicolon typos.
+
+2009-07-21 09:15 dts12
+
+ * FAQ:
+
+ New suggested entries.
+
+2009-07-20 19:24 dts12
+
+ * FAQ:
+
+ Updates to CODING section.
+
+2009-07-20 11:09 jsafranek
+
+ * agent/mibgroup/etherlike-mib.h:
+
+ Add missing header file from patch #2053273.
+
+2009-07-19 15:09 dts12
+
+ * FAQ:
+
+ Updates to COMPILING section.
+
+2009-07-16 12:38 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ Add IPv6 octet counters.
+ New Linux kernels (e.g. 2.6.31-rc2, maybe some earlier) provide
+ counters for
+ incoming/outgoing IPv6 traffic for ipSystemStatsTable and
+ ipIfStatsTable.
+
+2009-07-15 22:46 tanders
+
+ * testing/tests/T350unix:
+
+ put temporary data to where they belong
+
+2009-07-11 21:50 tanders
+
+ * configure:
+
+ regenerate configure
+
+2009-07-11 21:04 tanders
+
+ * configure.d/config_os_libs:
+
+ build fix (e.g. for FreeBSD): adjust kvm configure tests
+
+2009-07-10 12:35 jsafranek
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Check IPv6 port ranges in the same way as IPv4 ports are checked.
+
+2009-07-10 07:46 jsafranek
+
+ *
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+ local/mib2c:
+
+ Fix another IPv4 address size - long has 8 bytes on 64bit Linux.
+ Also fix the default type fo^CASN_IPADDRESS in mib2c, so the
+ ipCidrRouteTable_interface.c can be safely regenerated.
+
+2009-07-09 23:42 hardaker
+
+ * testing/tests/T300udp, testing/tests/T310tcp,
+ testing/tests/T320udpv6, testing/tests/T330tcpv6,
+ testing/tests/T350unix:
+
+ cleanup of testing cases to remove double include and double
+ exports
+
+2009-07-09 23:07 tanders
+
+ * testing/tests/T300udp:
+
+ be consistent with the TCP/IPv4 test
+
+2009-07-09 22:18 hardaker
+
+ * testing/tests/Stransport, testing/tests/T300udp,
+ testing/tests/T310tcp, testing/tests/T320udpv6,
+ testing/tests/T330tcpv6, testing/tests/T350unix,
+ testing/tests/T399alias:
+
+ new tests for testing defined transports
+
+2009-07-09 22:17 hardaker
+
+ * testing/TESTCONF.sh, testing/eval_tools.sh:
+
+ a CONFIGAPP macro for adding stuff to snmp.conf
+
+2009-07-08 15:12 jsafranek
+
+ * snmplib/snmpUDPDomain.c:
+
+ Fix gethostbyaddr parameter, netsnmp_udp_fmtaddr never returned a
+ hostname.
+
+2009-07-07 15:46 jsafranek
+
+ * agent/mibgroup/mibII/ipCidrRouteTable_access.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ Fix IP address length on 64 bit systems in mibII, pass and
+ pass_persist modules.
+
+2009-07-07 15:24 jsafranek
+
+ * agent/mibgroup/mibII/at.c:
+
+ Use correctly sized IP addresses in address translation table
+ processing - u_long can make problems on bin endian 64 bit
+ systems
+
+2009-06-29 13:52 hardaker
+
+ * CHANGES:
+
+ remove entry for a patch that got reverted
+
+2009-06-25 15:24 dts12
+
+ * include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/library/types.h, include/net-snmp/types.h,
+ snmplib/Makefile.in:
+
+ Move non-core data types into a separate (library internals)
+ header file.
+ Move the large_fd_set data structure into this header file.
+
+2009-06-18 22:29 tanders
+
+ * agent/snmp_perl.c:
+
+ CHANGES: build: allow building with Perl versions that lack
+ PERL_EXIT_DESTRUCT_END
+
+2009-06-18 22:13 tanders
+
+ * apps/snmpnetstat/if.c:
+
+ CHANGES: build: build fix for Tru64 Unix and IRIX: move _XOPEN*
+ definitions to where they are in 5.4.x and earlier
+
+2009-06-18 06:02 magfr
+
+ * configure, configure.d/config_os_libs,
+ configure.d/config_project_with_enable,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Clean up --with-nl configuration
+ * Move the _ARG_WITH to config_project_with_enable 2009-06-16 15:17
+ rstory
+
+
+ * snmplib/container.c:
+
+ check for null pointer before deref
+
+2009-06-15 23:52 rstory
+
+ * snmplib/snmp_client.c:
+
+ add comment explaining not quite obvious lack of memmove
+
+2009-06-15 19:32 magfr
+
+ * include/net-snmp/types.h:
+
+ Remove #if 0 commented code
+
+2009-06-15 15:25 dts12
+
+ * FAQ:
+
+ Updates to AGENT section.
+
+-------------------------------------------------------------------------------
+
+Changes: V5.5.pre2 -> V5.5.pre3
+
+2009-06-13 01:12 hardaker
+
+ * agent/mibgroup/mibII/tcpTable.c, configure,
+ configure.d/config_os_libs,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmpd: PATCH: 2564552: from ahmake: provide libnetlink
+ support for loading the tcp table
+
+2009-06-12 19:02 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.h:
+
+ CHANGES: snmpd: BUG: 1400101: remove deleted interfaces from
+ ifTable
+
+2009-06-11 23:09 hardaker
+
+ * apps/snmptrapd.c, snmplib/winpipe.c,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/net-snmp/agent/mib_module_config.h,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ CHANGES: win32: PATCH: 2693746: from bvassche: improved socket
+ startup support
+
+2009-06-11 22:57 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ CHANGES: snmpd: PATCH: 2012402: don't fail on failure to look up
+ interface error counters.
+
+2009-06-11 22:03 hardaker
+
+ * include/net-snmp/types.h:
+
+ revert previous commit to make circular dependencies back to
+ their regular insane ordering; I don't like this situation at all
+
+2009-06-11 21:42 hardaker
+
+ * include/net-snmp/types.h:
+
+ include large_fd_set.h before typedefing something based on the
+ structure
+
+2009-06-03 12:35 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: PATCHES: 2793857: Report failed asynchronous
+ requests.
+
+2009-06-03 11:46 dts12
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ Remove patch #2182592 - revert to SVN revision 17646
+ The cleanup routines don't appear to exist.
+
+2009-06-03 10:16 dts12
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ CHANGES: snmpd: PATCH: 2182592: Clean up vacmContextTable after
+ unregistrations
+ Patch supplied by John Forsyth
+
+2009-06-03 10:12 dts12
+
+ * agent/agent_handler.c, agent/helpers/stash_cache.c,
+ agent/mibgroup/agentx/subagent.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/snmp_agent.h, snmplib/snmpUDPDomain.c,
+ snmplib/snmp_api.c, snmplib/snmpv3.c:
+
+ CHANGES: PATCH: 2797251: Support multiple initialisation and
+ shutdown, fix memory leaks
+ Patch supplied by Ivosh
+
+2009-06-01 15:53 dts12
+
+ * man/snmpd.conf.5.def:
+
+ CHANEGS: docs: PATCHES: 2788072: Document 'logmatch'
+ functionality.
+
+2009-06-01 15:50 dts12
+
+ * agent/mibgroup/utilities/iquery.c, snmplib/mib.c,
+ snmplib/parse.c, snmplib/snmp_api.c, snmplib/snmp_parse_args.c,
+ snmplib/system.c, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmplib: PATCHES: 2780411: Fix compiler warnings
+
+2009-06-01 15:37 dts12
+
+ * agent/mibgroup/host/data_access/swrun_kinfo.c,
+ agent/mibgroup/host/data_access/swrun_kvm_proc.c,
+ agent/mibgroup/host/data_access/swrun_procfs_psinfo.c,
+ agent/mibgroup/host/data_access/swrun_procfs_status.c,
+ agent/mibgroup/host/data_access/swrun_procinfo.c,
+ agent/mibgroup/host/data_access/swrun_prpsinfo.c,
+ agent/mibgroup/host/data_access/swrun_pstat.c, configure,
+ local/snmpconf.dir/snmpd-data/monitor, m4/libtool.m4,
+ man/snmpd.conf.5.def, man/snmpd.examples.5.def:
+
+ CHANGES: docs: PATCH: 2795739: Fix incorrect disk/file size
+ descriptions & unit specifiers
+
+2009-06-01 13:11 dts12
+
+ * EXAMPLE.conf.def:
+
+ Rework example configuration file to match current snmpd.conf(5)
+ structure,
+ and more clearly illustrate current best practise.
+
+2009-05-30 06:58 magfr
+
+ * agent/mib_modules.c:
+
+ Remove unused include.
+
+2009-05-29 09:14 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.h:
+
+ Automatically load the example passtest MIB
+
+2009-05-29 09:08 dts12
+
+ * local/passtest, local/passtest.pl, mibs/Makefile.in,
+ mibs/NET-SNMP-PASS-MIB.txt:
+
+ Rework "passtest" examples to fully validate GETNEXT requests,
+ and use a legitimate MIB structure for output.
+ Add an example MIB to define that structure.
+
+2009-05-28 12:41 dts12
+
+ * FAQ:
+
+ Updates to MIBs section
+
+2009-05-28 11:56 dts12
+
+ * FAQ:
+
+ Tweak phrasing of an (overlong) question in the Perl section
+
+2009-05-28 11:31 dts12
+
+ * FAQ:
+
+ New entry in the Applications section
+
+2009-05-28 10:41 dts12
+
+ * FAQ:
+
+ Updates to Applications section
+
+2009-05-27 15:26 dts12
+
+ * FAQ:
+
+ Updates to GENERAL section.
+
+2009-05-19 17:50 alex_b
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ Update Perl TrapReceiver example to properly output the
+ securityEngineID and contextEngineID.
+
+2009-05-18 10:03 jsafranek
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Avoid division by zero.
+
+2009-05-15 19:22 tanders
+
+ * snmplib/scapi.c:
+
+ CHANGES: build: BUG: 2782700: build failure when using
+ --with-pkcs on
+ Solaris
+
+2009-05-15 14:59 jsafranek
+
+ * dist/net-snmp.spec:
+
+ Fix compilation of rpm packages on Fedora >= 10 - it has newer
+ RPM and the old API needs to be explicitly enabled by a macro.
+
+2009-05-14 13:39 jsafranek
+
+ * snmplib/snmp_logging.c:
+
+ The snmpcmd man page is not specific how range of log priorities
+ should be specified on command line,
+ i.e. both -LO 4-0 and -LO 0-4 are valid. All snmp commands (incl.
+ snmpd) should recognize that.
+
+2009-05-14 08:30 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ CHANGES: snmpd: Allow "monitor" to handle negative threshold
+ values.
+ Reported by Richard Gipps.
+
+2009-05-13 22:32 tanders
+
+ * snmplib/vacm.c:
+
+ CHANGES: snmpd: PATCH: 2791417: fix snmpd segfault when run with
+ -DALL
+ Patch supplied by Ron Roskens.
+
+2009-05-13 08:02 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Bring documentation of notificationEvent syntax into line with
+ reality.
+ (Uses "-m" rather than "-n" to register standard MIB payload
+ objects)
+ Inconsistency reported by Richard Gipps.
+
+2009-05-10 21:12 alex_b
+
+ * win32/Makefile-apps.in, win32/Makefile.in,
+ win32/libsnmp_dll/Makefile.in, win32/snmpd/Makefile.in,
+ win32/snmpdsdk/Makefile.in, win32/snmpnetstat/Makefile.in,
+ win32/snmptrapd/Makefile.in:
+
+ Win32: Added automatic manifest merging with mt.exe for MSVC 2008
+ etc.
+
+2009-05-08 13:12 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Changes: Win32: Add support for Windows 7, Vista and 2008 for
+ winExtDLL.
+
+2009-05-08 02:07 alex_b
+
+ * win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Win32: Build fixes for DLL.
+
+2009-05-07 23:00 tanders
+
+ * agent/mibgroup/hardware/memory/memory_hpux.c:
+
+ build fix for HP-UX: include <sys/param.h> for DEV_BSIZE
+
+2009-05-07 05:11 nba
+
+ * agent/snmp_perl.h:
+
+ Ups, missed a new prototype header
+
+2009-05-06 22:26 nba
+
+ * man/snmpd.conf.5.def:
+
+ A man line cannot start with a '
+
+2009-05-06 22:07 nba
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ IPv6 adresses are a bit more complicated then 32bits
+
+2009-05-06 22:06 nba
+
+ * agent/agent_sysORTable.c, agent/helpers/instance.c,
+ agent/mibgroup/agentx/client.c, agent/mibgroup/agentx/client.h,
+ agent/mibgroup/disman/event/mteObjects.c,
+ agent/mibgroup/disman/event/mteObjects.h,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/event/mteTrigger.h,
+ agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ include/net-snmp/agent/instance.h,
+ include/net-snmp/agent/sysORTable.h,
+ include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c:
+
+ Sprinkle some const-ness where relevant
+
+2009-05-06 22:02 nba
+
+ * snmplib/scapi.c, snmplib/snmpUDPDomain.c:
+
+ Trivial warning fixes
+
+2009-05-06 22:00 nba
+
+ * mibs/rfcmibs.diff:
+
+ Hmmm, IANA fixed their bug too
+
+2009-05-06 21:59 nba
+
+ * README:
+
+ Update email to current
+
+2009-05-06 21:59 nba
+
+ * agent/agent_trap.c, agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/util_funcs/get_pid_from_inode.c,
+ agent/snmp_agent.c, agent/snmp_perl.c, agent/snmp_vars.c,
+ agent/snmpd.c, perl/SNMP/SNMP.xs,
+ perl/TrapReceiver/TrapReceiver.xs, snmplib/container_list_ssll.c,
+ snmplib/snmp_service.c:
+
+ Trivial warning fixes
+
+2009-05-06 21:49 nba
+
+ * apps/snmptrapd_log.c:
+
+ contextEngineID is a hexstring, not an object identifier
+
+2009-05-06 21:45 nba
+
+ * agent/agent_registry.c, agent/helpers/cache_handler.c,
+ agent/helpers/table.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/agent/extend.c, agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/event/mteObjectsConf.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c,
+ agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c,
+
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c,
+ agent/mibgroup/utilities/execute.c, apps/encode_keychange.c,
+ snmplib/asn1.c, snmplib/dir_utils.c, snmplib/int64.c,
+ snmplib/mib.c, snmplib/read_config.c,
+ snmplib/snmpCallbackDomain.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_client.c, snmplib/snmpusm.c,
+ snmplib/snmpv3.c:
+
+ Fix format warnings from debug output
+
+2009-05-06 20:45 nba
+
+ * mibs/smistrip:
+
+ Properly recognize message syntax modules (to be able to ignore
+ them)
+
+2009-05-06 20:36 nba
+
+ * mibs/rfclist:
+
+ RFC updates
+
+2009-05-06 20:35 nba
+
+ * mibs/rfcmibs.diff:
+
+ Syntax fix for current IANA-PRINTER-MIB
+
+2009-05-06 20:34 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ Update to current IANA version
+
+2009-05-04 13:47 alex_b
+
+ * win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Win32: Build fixes for DLL.
+
+2009-05-01 15:43 magfr
+
+ * include/net-snmp/library/snmp_debug.h, snmplib/snmp_debug.c:
+
+ NEWS: snmplib: Stop using a fixed string for indentation. Remove
+ the DEBUGINDENT() macro (that did nothing). Change the meaning of
+ the internal __DBGINDENT() macro to return the number of spaces
+ to indent instead of a string that represent the indentation
+ level. Deprecate the debug_indent function.
+
+2009-04-30 06:57 magfr
+
+ * agent/mibgroup/examples/watched.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, local/mib2c.int_watch.conf:
+
+ CHANGES: snmpd: Use static watcher_info for all watched variables
+ and in int_watch.
+
+2009-04-30 06:41 magfr
+
+ * agent/helpers/watcher.c, include/net-snmp/agent/watcher.h:
+
+ CHANGES: snmplib: Separate initialization from allocation for
+ netsnmp_watcher_info structures to make it possible to use
+ statically allocated data.
+
+2009-04-30 06:34 magfr
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ Add missing return value.
+
+2009-04-30 00:18 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document the DTLS support; semi document the SSH support and
+ document the -s switch to many VACM settings
+
+2009-04-29 23:54 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ protect against connection opening errors and free memory on
+ failures
+
+2009-04-29 12:19 alex_b
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32: Update defines for _WIN32_WINNT and NTDDI_VERSION to
+ support Windows 2000 and higher and add IPV6 define to allow IPV6
+ code to compile.
+
+2009-04-28 06:34 magfr
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ snmpd, Linux: Remove some unused variables.
+
+2009-04-28 06:07 magfr
+
+ * agent/mibgroup/ip-mib/data_access/scalars_linux.c:
+
+ snmpd: Add missing argument to printf-like call.
+
+2009-04-28 05:53 magfr
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ snmpd: Mark more oids as const.
+
+2009-04-28 05:51 magfr
+
+ * snmplib/mib.c:
+
+ Return a value from sprint_realloc_value even if no subtree is
+ located.
+
+2009-04-28 01:12 alex_b
+
+ * agent/mibgroup/winExtDLL.c, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32: MSVC: Only use Windows API functions available on WinXP or
+ before (IPV6) or 2000 or before (no IPV6).
+
+2009-04-26 23:30 alex_b
+
+ * win32/Makefile-apps.in, win32/libsnmp_dll/Makefile.in,
+ win32/snmpd/Makefile.in, win32/snmpdsdk/Makefile.in,
+ win32/snmpnetstat/Makefile.in, win32/snmptrapd/Makefile.in:
+
+ Win32: Remove machine type of I386 from LINK32_FLAGS to allow
+ compiling with MSVC 2008 as either 32 or 64-bit.
+
+2009-04-26 17:38 alex_b
+
+ * win32/Makefile-apps.in, win32/Makefile.in,
+ win32/libsnmp_dll/Makefile.in, win32/snmpd/Makefile.in,
+ win32/snmpdsdk/Makefile.in, win32/snmpnetstat/Makefile.in,
+ win32/snmptrapd/Makefile.in:
+
+ CHANGES: Win32: Build fixes for MSVC 2008. Copy and cleanup
+ manifest files.
+
+2009-04-26 15:21 alex_b
+
+ * agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32: Re-enable pass and pass_persist Counter64 for MSVC.
+
+2009-04-26 14:34 alex_b
+
+ * agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPIPv6Domain.c, win32/build.pl,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: Win32: Build fixes for MSVC 2008. IFTYPE is defined by
+ MSVC 2008, so interfaces.c variables were changed to NETSNMP_.
+
+2009-04-26 13:06 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Win32: Update build instructions in comments.
+
+2009-04-24 13:28 hardaker
+
+ * perl/agent/agent.xs:
+
+ fix the ASN_OPAQUE patch that was commited without proper diff
+ context
+
+2009-04-24 07:31 tanders
+
+ * configure, configure.d/config_os_misc4:
+
+ CHANGES: HP-UX: BUG: 2779472: Filesystems missing in hrStorage
+ table on HP-UX 11.31
+ (allow for mnttab that is a character special device)
+
+2009-04-24 01:36 alex_b
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/util_funcs.c:
+
+ CHANGES: Win32: BUG: 2779541 Fixed handle leak in pass_persist.
+
+-------------------------------------------------------------------------------
+
+Changes: V5.5.pre1 -> V5.5.pre2
+
+2009-04-23 22:53 hardaker
+
+ * agent/mibgroup/hardware/sensors.h, snmplib/snmp_alarm.c:
+
+ fix C++ style comments
+
+2009-04-23 22:25 hardaker
+
+ * man/netsnmp_access_multiplexer.3, man/netsnmp_agent.3,
+ man/netsnmp_agent_handler.h.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3,
+ man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3,
+ man/netsnmp_cache_handler.3, man/netsnmp_callback.3,
+ man/netsnmp_container.3, man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-04-23 22:23 hardaker
+
+ * man/config_api.3, man/pdu_api.3, man/session_api.3,
+ man/varbind_api.3:
+
+ initial doxygen extracts for the new headers
+
+2009-04-23 22:19 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/net-snmp.spec:
+
+ Version number update
+
+2009-04-23 22:16 tanders
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ improve error message when failing to open mnttab
+
+2009-04-23 22:10 tanders
+
+ * configure, configure.d/config_os_misc4:
+
+ CHANGES: HP-UX: BUG: 2779472: Filesystems missing in hrStorage
+ table on
+ HP-UX 11.31
+
+2009-04-23 21:48 tanders
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ CHANGES: Solaris: PATCH: 2751588: Inconsistent data (e.g. UDP/TCP
+ MIB
+ scalar values of zero) can be reported on Solaris 10U4+
+ Patch provided by Anders Persson
+
+2009-04-23 17:30 hardaker
+
+ * agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/logmatch.h:
+
+ NEWS: snmpd: PATCH: 1901764: from krisztoforo for supporting
+ logwatch files that are date based
+
+2009-04-23 17:22 hardaker
+
+ * perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs:
+
+ NEWS: perl: PATCH 1956193: from cacoyle: beta threadable perl
+ module code for SNMPv1/SNMPv2c usage.
+
+2009-04-23 16:57 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ CHANGES: solaris: PATCH: 2012404: deal with more than 10
+ interfaces. New hardcoded limit is 50. A better scaling patch
+ would be appreciated :-)
+
+2009-04-23 16:47 hardaker
+
+ * README.agent-mibs, configure,
+ configure.d/config_project_with_enable:
+
+ document that the etherlike-mib has an implementation
+
+2009-04-23 16:40 hardaker
+
+ * agent/mibgroup/etherlike-mib,
+ agent/mibgroup/etherlike-mib/data_access,
+ agent/mibgroup/etherlike-mib/data_access/dot3stats.h,
+ agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable,
+ agent/mibgroup/etherlike-mib/dot3StatsTable.h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.c,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.h,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.c,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.h,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.h,
+
+ agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h,
+ agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h:
+
+ NEWS: snmpd: PATCH: 2053273: from narendra_k_dell to imlpement
+ the etherlike mib (at least on linux)
+
+2009-04-23 16:35 hardaker
+
+ * local/mib2c-conf.d/generic-table-oids.m2c:
+
+ CHANGES: mib2c: PATCH: 2136437: make FLAG defines more 64bit
+ friendly when huge tables are encountered
+
+2009-04-23 16:27 hardaker
+
+ * agent/mibgroup/hardware/memory/memory_hpux.c:
+
+ CHANGES: hpux: PATCH: 2088726: from ravindra1103 to fix an issue
+ with hpux reporting memory in negative values.
+
+2009-04-23 16:21 hardaker
+
+ * python/netsnmp/client.py:
+
+ CHANGES: python: PATCH: 2074817: from fenner to fix regexp engine
+ CPU performance issues
+
+2009-04-23 16:14 hardaker
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ CHANGES: snmpd: PATCH: 2162652: patch to fix simple hrfs checks
+ when NFS is in use.
+
+2009-04-23 16:11 hardaker
+
+ * perl/ASN/ASN.pm, perl/AnyData_SNMP/Format.pm,
+ perl/AnyData_SNMP/Storage.pm, perl/OID/OID.pm, perl/SNMP/SNMP.pm,
+ perl/agent/Support/Support.pm, perl/agent/agent.pm,
+ perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm, perl/manager/manager.pm:
+
+ CHANGES: perl: PATCH: 2182079: apply patch from int32 to fix a
+ number of perl warnings and fix the modules so that use strict is
+ possible
+
+2009-04-23 15:58 hardaker
+
+ * agent/helpers/table_data.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/mibII/ipv6.c, agent/mibgroup/mibII/vacm_context.c,
+ apps/encode_keychange.c, snmplib/container_binary_array.c,
+ snmplib/keytools.c, snmplib/mib.c, snmplib/parse.c,
+ snmplib/snmpUDPIPv6Domain.c, snmplib/snmpv3.c:
+
+ CHANGES: build: PATCH: 2184039: misc fixes for freeing memory
+ during error conditions.
+
+2009-04-23 15:47 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: PATCH: 2361712: from kbrint to fix getbulk
+ optimization during walks where end conditionns are met on middle
+ OIDs first.
+
+2009-04-23 15:35 alex_b
+
+ * README:
+
+ README Thanks update
+
+2009-04-23 15:04 hardaker
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ CHANGES: snmpd: patch from Tushar Gohad to clean up notification
+ registerations during disman event mib cleanup processing.
+
+2009-04-23 14:55 jsafranek
+
+ * agent/mibgroup/sctp-mib/sctpTables_common.c:
+
+ Fix memory leak in SCTP containers.
+
+2009-04-23 08:29 dts12
+
+ * include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/types.h:
+
+ netsnmp_large_fd_set is probably best regarded as an "opaque"
+ data
+ structure, and isn't really intended for direct manipulation.
+ Move it back into the <library/large_fd_set.h> header file.
+ (Like it was before Dave stuck his oar in....)
+
+2009-04-23 08:19 dts12
+
+ * include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/session_api.h, include/net-snmp/types.h,
+ snmplib/fd_event_manager.c, snmplib/large_fd_set.c,
+ snmplib/snmp_api.c:
+
+ Fuerther improvements to the large FD set support
+ (See patch #2772787)
+
+2009-04-23 06:45 magfr
+
+ * agent/mibgroup/sctp-mib/sctpTables.h:
+
+ building: Use config_error(...) instead of
+ config_require(non-existing) to get better error messages.
+
+2009-04-23 06:41 magfr
+
+ * agent/mibgroup/sctp-mib/sctpTables.h,
+ agent/mibgroup/sctp-mib/sctpTables_linux.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn.h,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint.h,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h,
+ agent/mibgroup/util_funcs/get_pid_from_inode.c,
+ agent/mibgroup/util_funcs/get_pid_from_inode.h:
+
+ snmplib, Linux: Move get_pid_from_inode to it's own file and only
+ compile it if needed, also rename it to
+ netsnmp_get_pid_from_inode.
+
+2009-04-23 04:33 hardaker
+
+ * agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/system_mib.h, agent/snmpd.h:
+
+ CHANGES: snmpd: PATCH: 2431353 from hnrose to make some C++
+ compilers happier
+
+2009-04-23 03:27 hardaker
+
+ * snmplib/snmp_alarm.c:
+
+ CHANGES: snmplib: PATCH: 2505488: from dabokey to fix alarms not
+ being triggered at the right times due to large clock skews.
+
+2009-04-23 00:01 hardaker
+
+ * apps/snmpnetstat/inet.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/netstat.h, man/snmpnetstat.1.def:
+
+ NEWS: snmpnetstat: PATCH: 2564538: from ahmake to support GETBULK
+ in v2c+ snmp versions
+
+2009-04-22 23:49 hardaker
+
+ * agent/mibgroup/agent/extend.c, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/route.c, snmplib/system.c:
+
+ CHANGES: ports: PATCH: 2688342: from ahmake to fix various
+ compiler warning
+
+2009-04-22 23:23 hardaker
+
+ * perl/agent/agent.xs:
+
+ CHANGES: perl: PATCH: 276371: from fhew to allow perl to use
+ OPAQUEs
+
+2009-04-22 23:17 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: PATCH: 2775800: from Adam Romanek to allow
+ python threading to continue when a request is sent
+
+2009-04-22 22:11 alex_b
+
+ * README, README.win32:
+
+ Update THANKS section.
+
+2009-04-22 21:21 magfr
+
+ * agent/mibgroup/util_funcs.c:
+
+ Fold the function extract_inode. with only one user, into it's
+ user.
+ Remove the #define FILE_DISP, with only one user, with the actual
+ value.
+
+2009-04-22 21:03 magfr
+
+ * agent/snmpd.c:
+
+ Make it possible to build with SMUX enabled.
+
+2009-04-22 13:43 jsafranek
+
+ * README.agent-mibs:
+
+ Add a note how the new RMON-MIB implementaion works
+
+2009-04-22 13:41 dts12
+
+ * man/varbind_api.3.def:
+
+ Fill out the documentation of the Varbind-related API calls.
+
+2009-04-22 13:37 jsafranek
+
+ * README.agent-mibs, agent/mibgroup/rmon-mib,
+ agent/mibgroup/rmon-mib.h, agent/mibgroup/rmon-mib/data_access,
+ agent/mibgroup/rmon-mib/data_access/etherstats.h,
+ agent/mibgroup/rmon-mib/data_access/etherstats_linux.c,
+ agent/mibgroup/rmon-mib/etherStatsTable,
+ agent/mibgroup/rmon-mib/etherStatsTable.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c,
+
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h,
+ agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h:
+
+ NEWS: snmpd: PATCH: 2103492: implement
+ RMON-MIB::etherStatsJabbers
+ Patch from Narendra K., Sandeep K. Shandilya and Shyam Iyer
+
+2009-04-22 10:08 dts12
+
+ * man/mib_api.3.def:
+
+ Correct a seriously misleading (i.e. wrong) description of the
+ purpose
+ and behaviour of the print_description family of calls.
+
+2009-04-22 09:32 dts12
+
+ * man/mib_api.3.def:
+
+ Further polishing of the descriptions of MIB-related API calls.
+
+2009-04-22 07:39 dts12
+
+ * snmplib/snmp_api.c:
+
+ Remove unnecessary range checks.
+ (These are handled within the large_fd_set routines themselves).
+
+2009-04-21 23:27 alex_b
+
+ * win32/libsnmp/Makefile.in, win32/libsnmp/libsnmp.dsp,
+ win32/libsnmp_dll/Makefile.in, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in,
+ win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ win32: Fix Windows build environment to support patch 2772787.
+
+2009-04-21 15:33 dts12
+
+ * agent/snmpd.c, include/net-snmp/library/fd_event_manager.h,
+ include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/session_api.h, include/net-snmp/types.h,
+ snmplib/Makefile.in, snmplib/fd_event_manager.c,
+ snmplib/large_fd_set.c, snmplib/snmp_api.c:
+
+ Revised version of patch #2772787
+
+2009-04-21 15:15 dts12
+
+ * include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/session_api.h, include/net-snmp/types.h,
+ snmplib/Makefile.in, snmplib/large_fd_set.c, snmplib/snmp_api.c,
+ win32/libsnmp/libsnmp.dsp:
+
+ Undo revision 17515
+ (broken/incomplete patch)
+
+2009-04-21 14:37 dts12
+
+ * include/net-snmp/library/large_fd_set.h,
+ include/net-snmp/session_api.h, include/net-snmp/types.h,
+ snmplib/Makefile.in, snmplib/large_fd_set.c, snmplib/snmp_api.c,
+ win32/libsnmp/libsnmp.dsp:
+
+ CHANGES: snmplib: PATCH: 2772787: Cleaner approach to handling
+ large fd_sets.
+ Based on patch supplied by Bart Van Assche.
+
+2009-04-21 14:34 dts12
+
+ * man/Makefile.in:
+
+ Properly generate new core API man pages.
+
+2009-04-21 09:38 dts12
+
+ * include/net-snmp/config_api.h, include/net-snmp/library/mib.h,
+ include/net-snmp/library/parse.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/mib_api.h, include/net-snmp/pdu_api.h,
+ include/net-snmp/session_api.h, include/net-snmp/types.h,
+ include/net-snmp/varbind_api.h:
+
+ First-cut at identifying the core Net-SNMP API calls.
+ Move these into the appropriate top-level header files.
+
+2009-04-21 09:36 dts12
+
+ * man/Makefile.in, man/config_api.3.def, man/read_config.3.def,
+ man/session_api.3.def, man/snmp_api.3.def:
+
+ Rename config/session API man pages, in line with other core API
+ structure.
+
+2009-04-21 09:32 dts12
+
+ * man/Makefile.in, man/mib_api.3.def, man/pdu_api.3.def,
+ man/read_config.3.def, man/snmp_api.3.def, man/varbind_api.3.def:
+
+ Document (or restructure) the core API elements.
+ Align this organisation with the first-cut restructuring
+ of the main header files.
+
+2009-04-20 10:23 dts12
+
+ * snmplib/snmp_api.c:
+
+ Skip file handles that are too large for fd_set to cope with.
+ A simple fix for the immediate problem addressed by patch
+ #1627049.
+
+2009-04-20 10:19 dts12
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c:
+
+ Revert patch #1627049 (extension to deal with large file
+ handlers).
+ See the discussion on that tracker entry for background as to
+ why.
+
+2009-04-20 00:59 alex_b
+
+ * README.win32, agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/util_funcs.h,
+ include/net-snmp/data_access/interface.h,
+ include/net-snmp/library/snmpUDPDomain.h, perl/agent/agent.xs,
+ win32/Configure, win32/libagent/Makefile.in,
+ win32/libagent/libagent.dsp, win32/libsnmp_dll/libsnmp.def.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in,
+ win32/netsnmpmibs/Makefile.in, win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibssdk/Makefile.in,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ win32: Build fixes for Windows. pass and pass_persist still need
+ to be fixed to support Counter64 on Windows.
+
+2009-04-20 00:48 alex_b
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ win32: Sync net-snmp-config.h.in and net-snmp-config.h
+
+2009-04-17 21:21 magfr
+
+ * configure, configure.d/config_os_progs, ltmain.sh, m4/libtool.m4,
+ m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4:
+
+ CHANGES: build: Upgrade libtool version to 2.2.6 in order to work
+ around a buglet that made autoreconf -vif erase config.sub and
+ config.guess.
+
+2009-04-14 21:59 magfr
+
+ * snmplib/parse.c:
+
+ CHANGES: snmplib: BUG: 1976772: Changed the mib parser to handle
+ long binary and hex strings.
+
+2009-04-11 12:52 rstory
+
+ * dist/makerelease.xml:
+
+ suggest truncation of ChangeLog.reallyadd
+
+2009-04-10 23:18 alex_b
+
+ * include/net-snmp/library/winservice.h, snmplib/winservice.c:
+
+ CHANGES: Win32: PATCH 2691876: Applied patch by rdiez to allow
+ compiling the services using unicode.
+
+2009-04-10 22:55 alex_b
+
+ * win32/encode_keychange/encode_keychange.dsp,
+ win32/libagent/libagent.dsp, win32/libhelpers/libhelpers.dsp,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp, win32/snmpd/snmpd.dsp,
+ win32/snmpdelta/snmpdelta.dsp, win32/snmpdf/snmpdf.dsp,
+ win32/snmpdsdk/snmpd.dsp, win32/snmpget/snmpget.dsp,
+ win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpnetstat/snmpnetstat.dsp, win32/snmpset/snmpset.dsp,
+ win32/snmpstatus/snmpstatus.dsp, win32/snmptable/snmptable.dsp,
+ win32/snmptest/snmptest.dsp,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrapd/snmptrapd.dsp,
+ win32/snmpusm/snmpusm.dsp, win32/snmpvacm/snmpvacm.dsp,
+ win32/snmpwalk/snmpwalk.dsp:
+
+ Win32: PATCH 2688309: Applied patch by Bart Van Assche to remove
+ MSVC 2005/2008 compiler warnings.
+
+2009-04-10 21:45 alex_b
+
+ * win32/Configure, win32/dist/README.build.win32.txt,
+ win32/dist/README.txt:
+
+ Win32: Minor build and readme updates.
+
+2009-04-10 21:38 alex_b
+
+ * agent/mibgroup/winExtDLL.c, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in:
+
+ NEWS: Win32: PATCH 2686248: Applied patch by Bart Van Assche
+ which fixes several winExtDLL bugs.
+
+2009-04-10 20:17 rstory
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ restore annoying log message, but fix cause of it on !freebsd
+ systems
+
+2009-04-09 12:28 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ CHANGES: snmpd: PATCH: 1550730: Report errors from iterator-based
+ handlers.
+ Based on a patch provided by Wayne Glantz
+
+2009-04-09 11:41 dts12
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ CHANGES: snmpd: PATCH: 2124288: Fix setting of
+ usmUserPrivProtocol at creation.
+ Logic bug, reported by Ramesh Kotabagi
+
+2009-04-09 09:12 dts12
+
+ * snmplib/snmpusm.c:
+
+ CHANGES: snmplib: PATCH: 2258229: Remove misleading comment
+ Patch provided by Dan Anderson
+
+2009-04-09 09:08 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: PATCH: 2260828: Fix python snmpwalk memory leak
+ Patch provided by Gabriele Messineo
+
+2009-04-09 08:58 dts12
+
+ * perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: PATCH: 2272347: Implement "implied" in MIB hash
+ Patch provided by Bill Fenner
+
+2009-04-09 08:54 dts12
+
+ * local/mib2c.iterate_access.conf:
+
+ CHANGES: mib2c: PATCH: 2316127: Fix bug in iterate_access
+ generated code.
+
+2009-04-09 08:48 dts12
+
+ * include/net-snmp/system/netbsd.h:
+
+ CHANGES: snmpd: PATCH: 2435681: Enable if-mib rewrite (with
+ sysctl backend) on NetBSD
+
+2009-04-09 08:44 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_sysctl.c:
+
+ CHANGES: snmpd: PATCH: 2435793: Support 64-bit IF-MIB counters on
+ sysctl (*BSD) systems.
+ Patch provided by Jan Andres
+
+2009-04-09 08:00 tanders
+
+ * perl/agent/agent.xs:
+
+ fix compilation warnings
+
+2009-04-08 23:17 tanders
+
+ * perl/agent/agent.xs:
+
+ move comments to a place where they are legal
+
+2009-04-08 23:03 tanders
+
+ * perl/agent/agent.pm, perl/agent/agent.xs:
+
+ - rename new getRequestorIp to getSourceIP and getTargetIp to
+ getDestIp
+ - remind that this is fully transport-specific, i.e. UDP/IPv4
+ only!
+
+2009-04-08 16:00 dts12
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: PATCH: 2384779: Fix handling of GetBulk with
+ N>0,M==0
+ Patch provided by Angus Salkeld
+
+2009-04-08 15:52 dts12
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ CHANGES: snmpd: PATCH: 2406378: Fix hrSWRunPerfMem on 64-bit
+ Solaris systems
+ Patch provided by NTwoO
+
+2009-04-08 15:48 dts12
+
+ * snmplib/mib.c:
+
+ CHANGES: snmplib: PATCH: 2479700: Fix zoned IP address used as
+ table indices
+ Patch provided by Brian Retford.
+
+2009-04-08 15:33 dts12
+
+ * snmplib/snmp_logging.c:
+
+ CHANGES: snmplib: PATCH: 2492377: Fix typo/bug in
+ snmp_enable_callback()
+ Reported by joyceanmachine
+
+2009-04-08 15:29 dts12
+
+ * agent/mibgroup/sctp-mib/sctpScalars.h,
+ agent/mibgroup/sctp-mib/sctpScalars_freebsd.c,
+ agent/mibgroup/sctp-mib/sctpTables.h,
+ agent/mibgroup/sctp-mib/sctpTables_common.h,
+ agent/mibgroup/sctp-mib/sctpTables_freebsd.c:
+
+ CHANGES: snmpd: PATCH: 2507249: sctp-mib support for FreeBSD.
+
+2009-04-08 15:16 dts12
+
+ * snmplib/snmp_client.c:
+
+ CHANGES: snmplib: PATCH: 2538169: Prevent infinite retries for an
+ invalid error-index.
+ Patch provided by Doug Manley
+
+2009-04-08 14:58 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: PATCH: 2580979: Fix python session pointers on
+ 64-bit systems.
+ Patch provided by John Khvatov.
+
+2009-04-08 14:49 dts12
+
+ * python/netsnmp/client.py:
+
+ CHANGES: python: PATCH: 2667415: Support "UseNumeric" option.
+ Remove debugging output in "snmpwalk" command.
+ Patch provided by Diego Billi
+
+2009-04-08 14:34 dts12
+
+ * perl/TrapReceiver/TrapReceiver.pm,
+ perl/TrapReceiver/TrapReceiver.xs:
+
+ CHANGES: snmptrapd: PATCH: 2726302: Pass results of Perl trap
+ handlers to trap daemon
+ Patch provided by Michael Schmitz
+
+2009-04-08 14:30 dts12
+
+ * snmplib/read_config.c, snmplib/snmpUDPIPv6Domain.c:
+
+ CHANGES: snmplib: PATCH: 2713841: Fix runtime errors triggered by
+ high-ASCII chars
+ Patch provided by Bart Van Assche
+
+2009-04-08 14:24 dts12
+
+ * perl/agent/agent.pm, perl/agent/agent.xs:
+
+ CHANGES: perl: PATCH: 2709705: Retrieve src/target IP address in
+ Perl-based agents
+ Patch provided by fhew
+
+2009-04-08 14:16 dts12
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ CHANGES: snmplib: PATCH: 2689362: Fix handling of IPv6 hostnames.
+ Patch provided by Nestor Melo.
+
+2009-04-08 14:05 dts12
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ CHANGES: library: PATCH: 2688345: Fix netsnmp_assert() for Visual
+ Studio
+ Patch provided by Bart Van Assche
+
+2009-04-08 13:35 dts12
+
+ * agent/agent_registry.c:
+
+ CHANGES: snmpd: PATCH: 2686280: Report duplicate registrations as
+ an error (rather than a failed assertion).
+ Fix provided by Bart Van Assche
+
+ Qn: Does this even qualify as an error? Wouldn't a warning be
+ sufficient?
+
+2009-04-06 19:33 magfr
+
+ * include/net-snmp/library/parse.h, snmplib/parse.c:
+
+ snmplib: Make the node struct private. Hide the orhan_nodes
+ variable.
+
+2009-04-06 18:45 magfr
+
+ * agent/snmp_perl.c:
+
+ snmpd,perl: If my_perl is NULL when passed to perl_destruct then
+ that function crashes for some perl versions so check that it is
+ non-null before destroying it.
+
+2009-04-06 18:42 magfr
+
+ * perl/agent/agent.xs:
+
+ perl: Avoid surprises if the perl string contains printf escape
+ characters.
+
+2009-04-06 18:22 dts12
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Proper check for empty process status file.
+ (Avoids truncated walk of hrSWRunPath on SuSE systems)
+ Reported by Kamil Kisiel.
+
+2009-04-06 11:58 tanders
+
+ * perl/agent/agent.xs, perl/agent/typemap:
+
+ CHANGES: perl: BUG 1554817: from xanco: revised fix for the class
+ assigment so
+ getRootOID works properly. Now passes "make test" and "make
+ perltest".
+
+2009-04-05 10:05 magfr
+
+ * agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_common.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/smux/smux.c:
+
+ Remove unused variables.
+
+2009-04-05 09:53 magfr
+
+ * agent/helpers/table_dataset.c,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/mibII/ipCidrRouteTable.c,
+ local/mib2c.iterate_access.conf, local/mib2c.notify.conf:
+
+ Make even more variables and templates const.
+
+2009-04-04 22:13 magfr
+
+ * agent/mibgroup/agent/nsCache.c, agent/mibgroup/agent/nsDebug.c,
+ agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/agent/nsModuleTable.c,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsVacmAccessTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.h,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c,
+
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/updates.c,
+ agent/mibgroup/mibII/updates.h,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h:
+
+ snmpd: Make more local variables const and local.
+
+2009-04-04 10:07 magfr
+
+ * agent/snmpd.c, apps/snmptrapd.c, net-snmp-config.in:
+
+ Mark the reconfig variable as static since it is private to the
+ module.
+
+2009-04-04 10:03 magfr
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ Mark the file scope private variable minimum_swap as static.
+
+2009-04-04 09:58 magfr
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/ucd-snmp/lmsensorsMib.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/vmstat.c:
+
+ snmplib: Make more symbols const in order to move them to
+ readonly memory.
+
+2009-04-02 21:24 hardaker
+
+ * agent/snmp_agent.c:
+
+ CHANGES: BUG 112694: Patch from Bill Fenner: don't open (and
+ clobber) an agentx socket if the other transports fail to open
+
+2009-04-01 23:41 hardaker
+
+ * CHANGES, NEWS:
+
+ version update
+
+2009-04-01 23:19 hardaker
+
+ * ChangeLog:
+
+ version update
+
+2009-04-01 23:04 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2009-04-01 23:03 hardaker
+
+ * snmplib/parse.c, snmplib/snmpDTLSUDPDomain.c, snmplib/snmptsm.c:
+
+ convert comments to ANSI comments
+
+2009-04-01 22:21 hardaker
+
+ * man/Makefile.in, man/netsnmp_access_multiplexer.3,
+ man/netsnmp_agent.3, man/netsnmp_agent_handler.h.3,
+ man/netsnmp_agent_registry.3, man/netsnmp_agent_trap.3,
+ man/netsnmp_asn1_packet_parse.3, man/netsnmp_baby_steps.3,
+ man/netsnmp_bulk_to_next.3, man/netsnmp_cache_handler.3,
+ man/netsnmp_callback.3, man/netsnmp_container.3,
+ man/netsnmp_container_iterator.3,
+ man/netsnmp_container_iterator.h.3, man/netsnmp_data_list.3,
+ man/netsnmp_debug.3, man/netsnmp_default_store.3,
+ man/netsnmp_handler.3, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_monitor_callback_header_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_null_container.3, man/netsnmp_oid_stash.3,
+ man/netsnmp_old_api.3, man/netsnmp_read_config.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3,
+ man/netsnmp_serialize.3, man/netsnmp_snmp_agent.3,
+ man/netsnmp_snmp_alarm.3, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3,
+ man/netsnmp_stash_to_next.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3,
+ man/netsnmp_table_iterator.3, man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_row.3,
+ man/netsnmp_table_rows.3, man/netsnmp_tdata.3,
+ man/netsnmp_tools.h.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3,
+ man/netsnmp_watcher.3:
+
+ documentation update
+
+2009-04-01 22:03 hardaker
+
+ * FAQ, README, configure, configure.ac, dist/Makefile,
+ dist/makerelease.xml, dist/net-snmp.spec:
+
+ Version number update
+
+-------------------------------------------------------------------------------
+
+Changes: V5.4 -> V5.5.pre1
+
+2009-04-01 21:58 hardaker
+
+ * man/snmp.conf.5.def, man/snmpd.8.def:
+
+ updates for SSH
+
+2009-04-01 19:39 magfr
+
+ * include/net-snmp/library/snmp_client.h, snmplib/snmp_client.c:
+
+ Make the src pointer of snmp_clone_mem a pointer to constant.
+
+2009-04-01 18:23 hardaker
+
+ * apps:
+
+ ignore 'sshtosnmp'
+
+2009-04-01 17:31 hardaker
+
+ * apps/sshtosnmp.c, include/net-snmp/library/default_store.h,
+ man/snmpd.8.def, snmplib/snmpSSHDomain.c:
+
+ Make ssh transport support use a unix socket with proper
+ credential passing
+
+2009-04-01 17:29 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ make the exec cache readable only by the user
+
+2009-04-01 17:28 hardaker
+
+ * agent/mibgroup/agentx/agentx_config.c,
+ include/net-snmp/library/system.h, snmplib/system.c:
+
+ move string to uid/gid functionality to snmplib for reuse
+
+2009-03-31 15:12 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Balance parentheses in cache-based registration code.
+
+2009-03-31 15:07 dts12
+
+ * local/mib2c.table_data.conf:
+
+ But they're not C comments at all, Dave.
+ They are mib2c template comments,
+ and should be omitted from the generated code.
+ <sigh>
+
+2009-03-31 15:00 dts12
+
+ * local/mib2c.table_data.conf:
+
+ C comments use /* ... */, not #
+
+2009-03-31 08:05 jsafranek
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ Fix compilation with glibc < 2.4, ICMPv6 message types starting
+ with MLD_* have different name there.
+
+2009-03-24 06:04 magfr
+
+ * snmplib/snmp_openssl.c:
+
+ Do not compile the parts that depend on libssl if libssl is
+ missing.
+
+2009-03-23 09:21 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/arp_common.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+ include/net-snmp/data_access/arp.h:
+
+ NEWS: snmpd: ipNetToPhysicalLastUpdated OID implemented
+
+ The value is estimated with every cache reload, which is once in
+ 60 seconds by default.
+ That means the value reported by snmpd may differ from reality by
+ one minute.
+ If anybody needs better precision, the cache timeout can be
+ configured by setting
+ NET-SNMP-AGENT-MIB::nsCacheTimeout.1.3.6.1.2.1.4.35 to
+ appropriate value by snmpset.
+
+2009-03-20 19:38 hardaker
+
+ * dist/extractnews:
+
+ fix lack of wrapping lines problem
+
+2009-03-20 18:31 hardaker
+
+ * NEWS, configure, configure.d/config_project_with_enable:
+
+ config options, etc, for SSH and DTLS
+
+2009-03-20 18:24 hardaker
+
+ * man/snmpcmd.1.def, man/snmpd.8.def:
+
+ currently minimal documentation on dtls and ssh
+
+2009-03-20 16:50 hardaker
+
+ * apps/Makefile.in, apps/sshtosnmp.c, configure,
+ configure.d/config_os_libs,
+ include/net-snmp/library/snmpSSHDomain.h,
+ include/net-snmp/net-snmp-config.h.in, snmplib/snmpSSHDomain.c,
+ snmplib/snmp_transport.c:
+
+ Added alpha snmp over ssh support
+
+2009-03-20 16:16 hardaker
+
+ * snmplib/snmpDTLSUDPDomain.c:
+
+ check the sec name length, not just the contents
+
+2009-03-20 16:01 hardaker
+
+ * snmplib/snmptsm.c:
+
+ sequence parsing fix
+
+2009-03-20 15:53 hardaker
+
+ * include/net-snmp/library/snmp_transport.h, snmplib/snmp_api.c:
+
+ added a new flag to allow for signalling of legal empty packets
+ from a transport
+
+2009-03-18 19:42 magfr
+
+ * agent/mibgroup/hardware/memory/memory_linux.c:
+
+ Make it possible to compile again.
+
+2009-03-18 10:52 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_linux.c:
+
+ cpu_linux: avoid reading past end of buffer
+ Patch provided by Stephen Hemminger
+
+2009-03-18 10:43 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/hardware/memory/memory_linux.c:
+
+ linux: increase size of initial proc i/o buffer
+ Patch provided by Stephen Hemmings
+
+2009-03-18 10:31 dts12
+
+ * agent/mibgroup/hardware/memory/memory_linux.c:
+
+ memory_linux: avoid reading past end of buffer.
+ Patch provided by Stephen Hemminger
+
+2009-03-18 10:25 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Fix valgrind warning.
+ Patch provided by Stephen Hemminger
+
+2009-03-17 22:57 magfr
+
+ * apps/snmptrapd_handlers.c, apps/snmptrapd_handlers.h:
+
+ PATCH: 2688342: from "Bart Van Assche": Use proper function
+ pointers
+
+2009-03-13 21:26 dts12
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Process hrMemorySize (scalar) separately from hrStorageTable.
+ This simplifies the handler code structure.
+
+2009-03-13 21:23 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/memory/hw_mem.c:
+
+ CHANGES: snmpd: Register CPU/memory hardware modules with
+ nsCacheTable.
+ Allows monitoring frequency to be configured dynamically.
+
+2009-03-13 21:20 dts12
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Avoid div0 crash.
+ Problem reported by Nick Hindley
+
+2009-03-13 21:17 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_kstat.c:
+
+ Skip new CPUs, that have appeared since the agent first started.
+ (An alternative might be to create a new entry instead).
+ Problem reported by Nick Hindley
+
+2009-03-10 15:25 jsafranek
+
+ * README.agent-mibs, agent/mibgroup/ip-mib/ip_scalars.c:
+
+ NEWS: snmpd: ipAddressSpinLock implemented
+
+2009-03-02 11:23 dts12
+
+ * COPYING:
+
+ Fix attribution of latest copyright notice.
+
+2009-02-28 18:21 magfr
+
+ * acconfig.h, configure, configure.d/config_modules_agent,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Move the #define config_*(...) from acconfig.h to the configure
+ script so that they are next to the code that handle the
+ corresponding config_* token.
+
+2009-02-27 13:20 jsafranek
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Get rid of annoying 'diskio.c: don't know how to handle 9
+ request' in log.
+ It's being written to log everytime someone queries
+ UCD-SNMP-DISKIO MIB.
+
+2009-02-25 06:41 magfr
+
+ * apps/snmpnetstat/if.c:
+
+ Use the feature test macros to set what is needed.
+ Do not use the internal GNU libc macros that are set by setting
+ the feature test macros.
+
+2009-02-25 06:38 magfr
+
+ * snmplib/snmpUnixDomain.c:
+
+ Add missing include.
+
+2009-02-24 07:26 magfr
+
+ * snmplib/snmp_logging.c:
+
+ CHANGES: Make -LN stop dumping core. Make bad debug levels report
+ the offending symbol.
+
+2009-02-24 06:50 magfr
+
+ * agent/mibgroup/agentx/master.c,
+ include/net-snmp/library/snmpUnixDomain.h,
+ snmplib/snmpUnixDomain.c:
+
+ Move the directory creation code to happen after the domain
+ selection code so that the directory creation code knows what
+ directory to create.
+
+2009-02-24 06:47 magfr
+
+ * configure, configure.d/config_project_with_enable:
+
+ Change the error checking option --enable-mysql to suggest that
+ that --with-mysql is used rather that --with-openssl.
+
+2009-02-24 06:44 magfr
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ Regenerate autoconf artifacts.
+
+2009-02-23 18:43 rstory
+
+ * apps/snmptrapd_sql.c:
+
+ add forgotten file
+
+2009-02-20 04:41 hardaker
+
+ * configure.d/config_modules_agent, configure.d/config_modules_lib,
+ configure.d/config_os_functions, configure.d/config_os_libs,
+ configure.d/config_os_misc1, configure.d/config_os_misc2,
+ configure.d/config_os_misc3, configure.d/config_os_misc4,
+ configure.d/config_os_progs,
+ configure.d/config_os_struct_members,
+ configure.d/config_project_ipv6_types,
+ configure.d/config_project_manual,
+ configure.d/config_project_paths,
+ configure.d/config_project_perl_python,
+ configure.d/config_project_types,
+ configure.d/config_project_with_enable:
+
+ added emacs autoconf mode specifier
+
+2009-02-19 18:32 rstory
+
+ * README.sql, man/snmptrapd.conf.5.def:
+
+ document new sql trap logging
+
+2009-02-19 18:20 rstory
+
+ * COPYING, NEWS, apps/Makefile.in, apps/snmptrapd.c,
+ apps/snmptrapd_handlers.c, apps/snmptrapd_handlers.h, configure,
+ configure.d/config_os_libs,
+ configure.d/config_project_with_enable,
+ dist/schema-snmptrapd.sql, include/net-snmp/net-snmp-config.h.in:
+
+ NEWS: snmptrapd: add trap handler for logging traps to a mysql
+ database
+
+2009-02-19 17:58 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c,
+ snmplib/container_list_ssll.c:
+
+ NEWS: snmplib: added iterator for singly linked lists; add
+ container name in more error msgs
+
+2009-02-18 18:52 rstory
+
+ * apps/snmpusm.c, include/net-snmp/library/snmpv3.h:
+
+ CHANGES: snmplib: change MAX_ENGINEID_LENGTH to 32, per
+ SNMP-FRAMEWORK-MIB SnmpEngineID TC
+
+2009-02-18 14:41 jsafranek
+
+ * agent/mibgroup/sctp-mib/sctpTables_common.c,
+ agent/mibgroup/sctp-mib/sctpTables_common.h,
+ agent/mibgroup/sctp-mib/sctpTables_linux.c:
+
+ Configure script does not like net-snmp-config.h being included
+ from header
+ files, which are added by --with-mib-modules=, let's remove it
+ from there.
+
+2009-02-16 21:24 hardaker
+
+ * perl/agent/agent.xs:
+
+ CHANGES: perl: BUG 1554817: Patch from xanco: fix the class
+ assigment so getRootOID works properly.
+
+2009-02-15 07:20 magfr
+
+ * acconfig.h:
+
+ Correct copy/paste mistake
+
+2009-02-12 00:25 hardaker
+
+ * acconfig.h, include/net-snmp/library/default_store.h,
+ include/net-snmp/library/snmpDTLSUDPDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/net-snmp-config.h.in, mibs/NET-SNMP-TC.txt,
+ snmplib/snmpDTLSUDPDomain.c, snmplib/snmp_transport.c,
+ snmplib/snmptsm.c:
+
+ An early experimental implementation of the DTLS over UDP
+ transport from the IETF ISMS working group
+
+2009-02-11 23:30 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ updated release instructions
+
+2009-02-06 21:36 magfr
+
+ * snmplib/read_config.c:
+
+ Make it possible to build as C++ again.
+
+2009-02-05 22:56 magfr
+
+ * acconfig.h, agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.h,
+ agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c,
+ agent/mibgroup/ucd-snmp/diskio.c, configure,
+ configure.d/config_os_functions,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/svr5.h:
+
+ CHANGES: build: Assume that the target platform supports memcpy,
+ memmove, memset, strchr and strrchr.
+
+2009-02-04 06:57 magfr
+
+ * agent/helpers/table.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/mibII/mta_sendmail.c, configure,
+ configure.d/config_os_headers, include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/net-snmp-config.h.in, snmplib/snmp_debug.c,
+ snmplib/snmp_logging.c, snmplib/snprintf.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ NEWS: Remove support for use of varargs.h. Now assumes that
+ stdarg.h is available.
+
+2009-02-04 06:49 magfr
+
+ * agent/agent_handler.c, agent/agent_trap.c,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/utilities/iquery.c, apps/snmptrapd_handlers.c,
+ include/net-snmp/library/read_config.h, snmplib/read_config.c,
+ snmplib/snmpv3.c:
+
+ NEWS: snmplib: Introduce printf-like versions of config_perror
+ and config_pwarn (netsnmp_config_error and netsnmp_config_warn).
+ Replace many instances of { tmpbuf[...]; sprintf(tmpbuf, ...);
+ config_p*(tmpbuf); } with netsnmp_config_*(...);
+
+2009-02-03 16:14 hardaker
+
+ * agent/agent_registry.c, include/net-snmp/agent/agent_registry.h:
+
+ add the reginfo and and session pointer to the REGISTER_OID
+ callback
+
+2009-02-03 00:18 hardaker
+
+ * configure, configure.d/config_os_libs:
+
+ fixed -lssl check
+
+2009-01-29 08:38 dts12
+
+ * snmplib/snmp_api.c:
+
+ Return a less misleading error when adding an unrecognised value.
+
+2009-01-28 10:10 dts12
+
+ * snmplib/snmpUDPDomain.c:
+
+ Fix src/dst confusion
+ Patch provided by Krzysztof Olॆअइ™dzki
+
+2009-01-28 09:29 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ CHANGES: Fix two bugs with smux password support.
+ Patch supplied by Krzysztof Olॆअइ™dzki
+
+2009-01-23 14:53 jsafranek
+
+ * snmplib/snmp_logging.c:
+
+ Fix parsing of level ranges in '-L<capital>'.
+
+2009-01-20 14:51 dts12
+
+ * agent/mibgroup/host/hr_swinst.c, configure,
+ configure.d/config_os_headers:
+
+ Check for the existence of <rpm/rpmfileutil.h> before including
+ it.
+
+2009-01-19 20:50 magfr
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ Make it possible to build without IPv6 again.
+
+2009-01-19 15:01 jsafranek
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/icmp.h,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/kernel_linux.h, configure,
+ configure.d/config_os_headers,
+ include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ NEWS: snmpd: PATCH: 1927751: from Mitsuru Chinen: implement
+ icmpMsgStatsTable on Linux
+
+2009-01-19 09:41 jsafranek
+
+ * agent/mibgroup/ucd-snmp/disk.c, agent/mibgroup/ucd-snmp/disk.h,
+ mibs/UCD-SNMP-MIB.txt:
+
+ NEWS: snmpd: PATCH: 2449210: add 64-bit disk usage statistics to
+ UCD-SNMP-MIB::dskTable
+
+2009-01-18 07:40 magfr
+
+ * configure, configure.d/config_project_with_enable:
+
+ CHANGES: BUG: 2168180: Changed --disable-reentrant to not
+ activate the reentrant code and made --enable-reentrant accept no
+ values other than yes and no. Did the same for
+ --enable-mib-config-checks, --enable-mib-config-debug,
+ --with-defaults, --enable-developer and --enable-testing-code as
+ well.
+
+2009-01-13 09:17 jsafranek
+
+ * snmplib/asn1.c:
+
+ Check encoding of OIDs.
+
+ BER encoded OIDs should have high bit clear in the last byte of
+ each subidentifier. This is now checked and parsing of OID fails,
+ if this condition is not met.
+
+2009-01-11 21:54 magfr
+
+ * configure, configure.d/config_project_with_enable:
+
+ CHANGES: building: Check that the temp-file-pattern ends in 6 X's
+ as mkstemp and mktemp require that.
+
+2009-01-11 21:38 magfr
+
+ * acconfig.h, configure, configure.d/config_project_with_enable,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: building: Be a lot more strict on the values that are
+ acceptable for --with-persistent-mask (only allow three octal
+ digits)
+
+2009-01-11 20:42 magfr
+
+ * aclocal.m4, configure, configure.d/config_project_with_enable,
+ m4/netsnmp_arg.m4:
+
+ CHANGES: building: We are currently using the practice of adding
+ a mirroring AC_ARG_WITH/ENABLE to each AC_ARG_ENABLE/WITH. This
+ patch adds NETSNMP_ARG_WITH/ENABLE macros that automatically adds
+ the mirror variable and then converts the configure machinery to
+ use them.
+
+2009-01-11 20:36 magfr
+
+ * configure, configure.d/config_project_with_enable:
+
+ Move AC_DEFINES in config_project_with_enable to be located next
+ to the AC_ARG_... they depend on.
+
+2009-01-11 20:34 magfr
+
+ * configure, configure.d/config_project_manual,
+ configure.d/config_project_with_enable:
+
+ Change the default version number checking to be easier to read
+
+2009-01-11 19:19 magfr
+
+ * configure, configure.d/config_os_libs,
+ configure.d/config_os_misc4,
+ configure.d/config_project_with_enable:
+
+ Move the last AC_ARG_...'s to config_project_with_enable.
+
+2009-01-11 19:08 magfr
+
+ * configure, configure.d/config_project_with_enable:
+
+ CHANGES: building: Change the macro for --with-features-of from
+ AC_ARG_ENABLE to AC_ARG_WITH in order to make the option be
+ --with-features-of.
+
+2009-01-08 10:45 jsafranek
+
+ * snmplib/snmp_logging.c:
+
+ CHANGES: snmpd, apps: Parser of -LS command line argument now
+ accepts both '-LS <level> <facility>' and '-LS
+ <level><facility>'.
+
+ Before patch #1806336 the first syntax was the only one
+ supported. The patch
+ changed the syntax to the second one, causing incompatibilities
+ in stable
+ branches. We now support both of them.
+
+2009-01-08 03:51 magfr
+
+ * Makefile.top:
+
+ Do not depend on the existance of /bin/sh. Also follow the advice
+ of the autoconf manual and finally allow for libtool that adopts
+ the generated script after the capabilities of SHELL.
+
+2009-01-07 16:02 jsafranek
+
+ * configure, configure.d/config_os_headers:
+
+ Reorder the netinet/icmp_var.h and netinet/ip_icmp.h, the later
+ one must be checked first on FreeBSD 7
+
+2009-01-06 22:23 hardaker
+
+ * COPYING:
+
+ update SPARTA for 2009
+
+2009-01-03 20:23 magfr
+
+ * configure, m4/ac_prompt_user.m4:
+
+ Upgrade the AC_PROMPT_USER macros to autoconf 2.63 where
+ AC_FD_MSG is deprecated and AS_MESSAGE_FD is recommended.
+
+2009-01-03 14:20 magfr
+
+ * acinclude.m4, aclocal.m4, configure, m4/ac_add_search_path.m4,
+ m4/ac_msg_cache.m4, m4/ac_msg_module_dbg.m4,
+ m4/ac_prompt_user.m4, m4/netsnmp_search_libs.m4:
+
+ Split acinclude.m4 into smaller parts by function.
+
+2009-01-03 14:15 magfr
+
+ * Makefile.am:
+
+ Make autoreconf work again.
+
+2009-01-03 14:11 magfr
+
+ * aclocal.m4, config.guess, configure, configure.ac,
+ configure.d/config_os_progs,
+ include/net-snmp/net-snmp-config.h.in, install-sh, ltmain.sh, m4,
+ m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4,
+ m4/lt~obsolete.m4:
+
+ Update to libtool-2.2.4
+
+2009-01-03 13:28 magfr
+
+ * configure, configure.d/config_os_libs:
+
+ configure.d/config_os_libs: Check for a function, not a macro.
+ configure: Regenerate
+
+2009-01-03 01:03 hardaker
+
+ * configure.d/config_os_libs:
+
+ require -lssl; will be changed later to do 'if needed'
+
+2009-01-03 00:19 magfr
+
+ * README.agent-mibs, agent/mibgroup/mibII.h,
+ agent/mibgroup/mibII/snmp_mib.h,
+ agent/mibgroup/mibII/snmp_mib_5_5.c,
+ agent/mibgroup/mibII/snmp_mib_5_5.h,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.h,
+ agent/mibgroup/snmpv3/usmStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.h, agent/mibgroup/target.h,
+ agent/mibgroup/target/target_counters.h,
+ agent/mibgroup/target/target_counters_5_5.c,
+ agent/mibgroup/target/target_counters_5_5.h,
+ agent/mibgroup/utilities/snmp_get_statistic.c,
+ agent/mibgroup/utilities/snmp_get_statistic.h:
+
+ CHANGES: snmpd: Unify all snmpd statistic variables and make the
+ handlers instances of a common handler.
+
+2009-01-01 17:26 hardaker
+
+ * snmplib/snmptsm.c:
+
+ clean up a few comments and remove unused function
+
+2009-01-01 17:25 hardaker
+
+ * snmplib/snmptsm.c:
+
+ fix various minor memory leak issues
+
+2009-01-01 14:28 magfr
+
+ * agent/agent_handler.c, agent/helpers/cache_handler.c,
+ agent/helpers/instance.c, agent/helpers/watcher.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/agent/instance.h,
+ include/net-snmp/agent/watcher.h, local/mib2c-conf.d/mfd-top.m2c,
+ local/mib2c.array-user.conf, local/mib2c.container.conf,
+ local/mib2c.create-dataset.conf, local/mib2c.int_watch.conf,
+ local/mib2c.iterate.conf, local/mib2c.iterate_access.conf,
+ local/mib2c.row.conf, local/mib2c.scalar.conf,
+ local/mib2c.table_data.conf:
+
+ NEWS: snmplib: Change the type of the oid arguments from oid* to
+ const oid*. Update mib2c to take advantage of the change.
+
+2009-01-01 13:56 magfr
+
+ * agent/agent_handler.c:
+
+ Check return values and free allocated resources on error.
+
+2009-01-01 12:54 magfr
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ Do not leak alias_list on return from _next_alias.
+
+2009-01-01 11:26 magfr
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ Make variable const as it never is changed.
+
+2009-01-01 11:25 magfr
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ Remove an unused variable.
+
+2008-12-31 21:41 hardaker
+
+ * snmplib/snmp_openssl.c:
+
+ don't use the functions if we're not linked with openssl
+
+2008-12-31 20:56 hardaker
+
+ * perl/TrapReceiver/const-c.inc, perl/TrapReceiver/const-xs.inc:
+
+ newer perl generated updates
+
+2008-12-31 18:02 hardaker
+
+ * snmplib/snmp_api.c:
+
+ added a few more recv/send debugging statements
+
+2008-12-31 18:02 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Allow quoted security names for ones containing spaces
+
+2008-12-31 18:01 hardaker
+
+ * include/net-snmp/library/snmp_openssl.h, snmplib/Makefile.in,
+ snmplib/snmp_openssl.c:
+
+ an openssl initialization wrapper
+
+2008-12-30 00:03 magfr
+
+ * apps/snmptest.c, python/netsnmp/client_intf.c:
+
+ Use snmp_duplicate_objid instead of various malloc+memcpy
+ variants in order to make clearer code.
+
+2008-12-29 23:34 magfr
+
+ * agent/mibgroup/examples/example.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ include/net-snmp/library/snmp_debug.h, snmplib/asn1.c:
+
+ Use format strings for printf-like functions.
+ Prefer strcpy over sprintf(dest, "%s", src)
+ Prefer DEBUGMSGTL((format, args)) over sprintf(local, format,
+ args); DEBUGMSGTL(("%s", local))
+
+2008-12-18 17:04 hardaker
+
+ * include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpUDPDomain.c:
+
+ export out of the file some helpful generic udp functions
+
+2008-12-16 00:13 hardaker
+
+ * include/net-snmp/library/snmp_secmod.h:
+
+ change localsm security model to tsm (and add 1)
+
+2008-12-15 23:25 hardaker
+
+ * agent/mibgroup/disman/expression/expValueTable.c:
+
+ Patch to change a typedef name from link to nodelink to avoid
+ naming conflict issues.
+
+2008-12-09 01:41 hardaker
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ use int32_t instead of int_32 which doesn't work at all on F10
+
+2008-12-09 01:07 hardaker
+
+ * NEWS:
+
+ remove the note that we moved to svn... obsolete at this point,
+ to say the least
+
+2008-12-09 01:05 hardaker
+
+ * NEWS:
+
+ mention the TSM implementation
+
+2008-12-09 00:58 hardaker
+
+ * dist/makerelease.xml:
+
+ flag some steps and mandatory
+
+2008-12-09 00:57 hardaker
+
+ * include/net-snmp/library/default_store.h:
+
+ remove accidential new defines that aren't needed yet
+
+2008-12-09 00:56 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/snmplocalsm.h,
+ include/net-snmp/library/snmptsm.h, snmplib/snmplocalsm.c,
+ snmplib/snmptsm.c:
+
+ remove older localsm security model and replace with a newer TSM
+ based on the upcoming IETF spec
+
+2008-12-09 00:50 hardaker
+
+ * snmplib/snmp_api.c:
+
+ fix issue with context probing
+
+2008-12-04 12:33 jsafranek
+
+ * agent/snmpd.c, apps/snmptrapd.c:
+
+ Daemonize after transports are created and listening sockets are
+ bound to appropriate ports. This allows to exit with nozero exit
+ code when the binding fails.
+
+2008-12-04 11:44 jsafranek
+
+ * snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPDomain.c:
+
+ Print ports as unsigned numbers.
+
+2008-11-24 19:09 tanders
+
+ * include/net-snmp/system/solaris.h:
+
+ __EXTENSIONS__ is now handled by configure
+
+2008-11-22 18:36 magfr
+
+ * configure, configure.d/config_modules_agent:
+
+ Do not try to use the module list as a file that should be
+ included in the build, thus making it possible to build on
+ Solaris.
+
+2008-11-20 22:30 magfr
+
+ * agent/agent_handler.c, agent/agent_trap.c,
+ agent/helpers/table_data.c, agent/helpers/table_row.c,
+ agent/helpers/table_tdata.c, agent/mibgroup/utilities/override.c,
+ apps/snmptrapd_handlers.c:
+
+ Replace memdup((u_char**)&x, (u_char*)y, z * sizeof(oid)) with x
+ = snmp_duplicat
+ e_objid(y, z) since the later is easier to read and expresses the
+ intention of t
+ he code clearer.
+
+2008-11-20 22:01 magfr
+
+ * snmplib/snmp_api.c:
+
+ Use memcpy instead of memmove to copy oids as it is known that
+ the areas are nonoverlapping.
+
+2008-11-20 20:51 magfr
+
+ * snmplib/snmpSTDDomain.c:
+
+ Make log refer to the right function.
+
+2008-11-20 20:46 magfr
+
+ * apps/snmptrapd.c:
+
+ CHANGES: Do not use %m in printf-formatted strings since %m in
+ printf is a glibc extension.
+
+2008-11-16 22:01 magfr
+
+ * configure.ac:
+
+ Bump the required autoconf version to 2.63 as per 17301.
+
+2008-11-16 21:55 magfr
+
+ * configure, configure.d/config_os_functions:
+
+ Remove an unused function from the configure test for __func__.
+
+2008-11-16 21:51 magfr
+
+ * configure, configure.d/config_os_functions,
+ configure.d/config_os_headers, configure.d/config_os_misc4,
+ include/net-snmp/net-snmp-config.h.in:
+
+ M4 uses dnl, not \ for line concatenation.
+ \ introduced a spurious define in net-snmp-config.h.in, thus this
+ change.
+ Reran autoconf and autoheader.
+
+2008-11-13 22:14 tanders
+
+ * configure:
+
+ NEWS: build: update to autoconf 2.63
+
+2008-11-13 00:30 tanders
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: BUG: 2258935: Python Extension Module fails on
+ Solaris
+
+2008-11-13 00:26 tanders
+
+ * configure.d/config_modules_agent:
+
+ fix typo
+
+2008-11-13 00:26 tanders
+
+ * configure.d/config_modules_agent:
+
+ fix typo
+
+2008-11-13 00:19 tanders
+
+ * dist/extractnews:
+
+ make scripts executable
+
+2008-11-12 17:38 hardaker
+
+ * agent/snmp_perl.c:
+
+ fix typo/spelling in an embedded perl error message
+
+2008-11-11 13:13 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Fix compilation on older Linuxes without SPEED_10000 and
+ SPEED_2500.
+
+2008-11-01 19:25 hardaker
+
+ * agent/snmp_agent.c:
+
+ NEWS: snmpd: Applying patch from Magnus Fromreide to fix the
+ getbulk issue reported by Oscar Mira-Sanchez
+
+2008-10-30 22:34 hardaker
+
+ * dist/makerelease:
+
+ remove the older (obsolete) makerelease script
+
+2008-10-22 17:24 magfr
+
+ * snmplib/snmp_api.c, snmplib/snmp_client.c:
+
+ Make it possible to build the lib using a C++ compiler once more.
+
+2008-10-22 07:29 dts12
+
+ * snmplib/snmp_client.c:
+
+ Don't clear session flags when testing one bit.
+
+2008-10-21 21:10 magfr
+
+ * AGENT.txt, agent/mibgroup/Rmon/alarm.c,
+ agent/mibgroup/Rmon/event.c, agent/mibgroup/Rmon/history.c,
+ agent/mibgroup/Rmon/statistics.c, agent/mibgroup/agent/extend.c,
+ agent/mibgroup/disman/expression/expErrorTable.c,
+ agent/mibgroup/disman/expression/expExpressionTable.c,
+ agent/mibgroup/disman/expression/expObjectTable.c,
+ agent/mibgroup/disman/expression/expValueTable.c,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/nslookup/lookupCtlTable.c,
+ agent/mibgroup/disman/nslookup/lookupResultsTable.c,
+ agent/mibgroup/disman/ping/pingCtlTable.c,
+ agent/mibgroup/disman/ping/pingProbeHistoryTable.c,
+ agent/mibgroup/disman/ping/pingResultsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteCtlTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteHopsTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c,
+ agent/mibgroup/disman/traceroute/traceRouteResultsTable.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/host/hr_device.c, agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c, agent/mibgroup/host/hr_proc.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c, agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hrh_filesys.c, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/ipv6.c, agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/vacm_vars.c, agent/mibgroup/misc/ipfwacc.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/smux/snmp_bgp.c,
+ agent/mibgroup/smux/snmp_ospf.c, agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/tunnel/tunnel.c, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c, agent/mibgroup/ucd-snmp/hpux.c,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/memory_aix4.c,
+ agent/mibgroup/ucd-snmp/memory_darwin7.c,
+ agent/mibgroup/ucd-snmp/memory_dynix.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_hpux.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_darwin7.c,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_hpux.c,
+ agent/mibgroup/ucd-snmp/vmstat_linux.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ include/net-snmp/library/snmp_impl.h, local/mib2c.old-api.conf,
+ win32/dist/htmlhelp/FAQ.html:
+
+ NEWS: misc: PATCH: 1737727: from joyceanmachine: Add a
+ NETSNMP_OLDAPI_ prefix to the access macros that are used in the
+ old-api helper.
+ I did add the prefix to all users in our code.
+
+2008-10-21 21:00 magfr
+
+ * include/net-snmp/library/mib.h, include/net-snmp/library/parse.h,
+ snmplib/mib.c, snmplib/parse.c:
+
+ NEWS: misc: PATCH: 1737727: from joyceanmachine: Replace all uses
+ of NETSNMP_CLEAN_NAMESPACE with NETSNMP_NO_LEGACY_DEFINITIONS
+
+2008-10-16 09:56 jsafranek
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ include/net-snmp/data_access/interface.h:
+
+ CHANGES: snmpd: PATCH: 2082726: correctly report NIC speeds
+ higher than 4Gbit/s
+
+2008-10-16 08:00 jsafranek
+
+ * man:
+
+ Scratch previous commit, net-snmp-create-v3-user.1 to be ignored.
+
+2008-10-16 07:37 jsafranek
+
+ * man:
+
+ Add compiled net-snmp-config.1 to svn:ignore list
+
+2008-10-15 12:57 jsafranek
+
+ * README.agent-mibs, agent/mibgroup/ip-mib.h,
+ agent/mibgroup/ip-mib/data_access/systemstats_common.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable,
+ agent/mibgroup/ip-mib/ipIfStatsTable.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h,
+ agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+ include/net-snmp/data_access/ipstats.h,
+ include/net-snmp/data_access/systemstats.h:
+
+ CHANGES: snmpd: PATCH 1797111: implement IP-MIB::ipIfStatsTable
+
+2008-10-15 09:27 tanders
+
+ * snmplib/snmp_api.c:
+
+ portability fix: avoid variable declarations in the middle of
+ code
+
+2008-10-14 18:55 dts12
+
+ * snmplib/snmpUDPDomain.c:
+
+ CHANGES: snmplib: PATCH: 2043018: fix recvfrom hangs
+ Also addresses (closed) bugs 1171904 and 1345296
+
+2008-10-14 09:44 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ CHANGES: snmpd: fix memory leak when multiple interfaces have the
+ same IPv6 address
+
+2008-10-14 09:37 jsafranek
+
+ * include/net-snmp/library/container.h, snmplib/container.c:
+
+ CHANGES: snmpd: BUG: 1693039: be silent when insert fails.
+
+2008-10-13 19:01 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ CHANGES: snmpd: PATCH: 1977439: Fix pass/_persist bug with SET
+ oid value
+
+2008-10-12 17:24 magfr
+
+ * README.agent-mibs, agent/mibgroup/snmpv3/snmpMPDStats.h,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.c,
+ agent/mibgroup/snmpv3/snmpMPDStats_5_5.h,
+ agent/mibgroup/snmpv3mibs.h:
+
+ CHANGES: snmpd: Reimplementation of snmpMPDStats.
+
+2008-10-10 21:13 dts12
+
+ * configure, configure.d/config_os_functions,
+ configure.d/config_os_misc1, configure.d/config_os_misc2,
+ configure.d/config_os_misc3, configure.d/config_os_misc4:
+
+ Consolidate checks on general O/S characteristics
+
+2008-10-07 08:50 jsafranek
+
+ * dist/find-requires:
+
+ CHANGES: building: BUG: 2095983: fix syntax error in
+ find-requires helper script and make it executable
+
+2008-10-06 19:31 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ ifdef sys/poll
+
+2008-10-03 14:16 hardaker
+
+ * configure, configure.ac:
+
+ patch from Shachar Schemesh to fix a quote escaping
+
+2008-09-30 22:19 hardaker
+
+ * apps/snmptrapd.c:
+
+ added a needed trailing newline
+
+2008-09-30 22:11 dts12
+
+ * perl/agent/agent.xs:
+
+ CHANGES: perl: PATCH: 2022948: Fix for Counter64 in perl subagent
+
+2008-09-30 21:40 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c:
+
+ - NEWS: snmplib: Implemented RFC5343 contextEngineID probing.
+ This allows for probing of the contextEngineID without requiring
+ the USM security model.
+ - implemented entirely within the library for both clients and
+ servers.
+
+2008-09-30 21:33 hardaker
+
+ * include/net-snmp/library/snmp_secmod.h:
+
+ Add a local definition for having security models define their
+ own
+ contextEngineID probe
+
+2008-09-30 21:31 hardaker
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Add a definition for the SSH domain
+
+2008-09-30 21:08 dts12
+
+ * agent/snmp_agent.c:
+
+ CHANGES: agent: PATCH: 1257347: Non-fixed size connection buffer
+
+2008-09-30 07:32 jsafranek
+
+ * agent/Makefile.in:
+
+ NEWS: building: PATCH: 2091156: correctly declare dependencies in
+ Makefile.
+ 'make -j <N>' should work now.
+
+2008-09-24 20:58 dts12
+
+ * configure, configure.d/config_os_functions,
+ configure.d/config_os_headers, configure.d/config_os_libs,
+ configure.d/config_os_struct_members:
+
+ Identify where particular checks are actually used
+ (library, agent, applications or not at all)
+
+2008-09-24 12:53 jsafranek
+
+ * agent/mibgroup/sctp-mib/sctpScalars_linux.c,
+ agent/mibgroup/sctp-mib/sctpTables_linux.c:
+
+ Use the longest integer for inode numbers and (possibly 64 bit)
+ counters.
+
+2008-09-20 09:01 magfr
+
+ * configure, configure.d/config_os_misc3:
+
+ NEWS: build: Do not require use of --with-endianness when
+ cross-compiling.
+
+2008-09-19 15:19 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Correct location of documentation files.
+
+2008-09-19 05:28 magfr
+
+ * configure, configure.d/config_os_misc2,
+ include/net-snmp/net-snmp-config.h.in:
+
+ And add the chunk that I lost.
+
+2008-09-19 05:23 magfr
+
+ * acconfig.h, configure, configure.ac,
+ configure.d/config_modules_lib, configure.d/config_os_libs,
+ configure.d/config_os_misc1,
+ configure.d/config_project_perl_python,
+ configure.d/config_project_with_enable,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Move more things from acconfig.h to the templates in the
+ configure input files.
+
+2008-09-17 13:31 jsafranek
+
+ * dist/find-requires:
+
+ make find-requires executable so it's actually usable by the
+ net-snmp.spec
+
+2008-09-17 12:08 jsafranek
+
+ * man/Makefile.in, man/net-snmp-create-v3-user.1.def:
+
+ add man page for net-snmp-create-v3-user
+
+2008-09-16 18:02 magfr
+
+ * acconfig.h, configure, configure.d/config_os_functions,
+ configure.d/config_os_libs, configure.d/config_os_misc1,
+ configure.d/config_os_misc2, configure.d/config_os_misc4,
+ configure.d/config_project_with_enable,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Further minimization of acconfig.h
+
+2008-09-11 22:28 magfr
+
+ * acconfig.h, configure, configure.d/config_os_misc3,
+ configure.d/config_os_progs,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Move a few more variables out of acconfig.h
+
+2008-09-11 20:37 hardaker
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ NEWS: snmpd: PATCH: 1737439: from emiy: automatic link up/down
+ traps on a walk; still need a better interface for manually doing
+ things on an occasional basis
+
+2008-09-11 20:25 hardaker
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmpUDPDomain.c,
+ snmplib/snmp_api.c:
+
+ NEWS: snmplib: PATCH: 700681: limited support for UDPv4 broadcast
+ addresses
+
+2008-09-10 06:39 magfr
+
+ * acconfig.h, configure, configure.d/config_project_types,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: building: Use AC_CHECK_TYPES instead of a homegrown
+ alternative to check for types
+
+2008-09-09 20:27 magfr
+
+ * Makefile.in:
+
+ Add all the parts of configure.ac to the dependency list
+
+2008-09-09 18:13 hardaker
+
+ * Makefile.in:
+
+ update to reflect configure.in -> configure.ac change
+
+2008-09-09 16:15 hardaker
+
+ * dist/patme:
+
+ default to -p0
+
+2008-09-08 23:41 hardaker
+
+ * snmplib/snmplocalsm.c:
+
+ check for a session tunneled flag before returning an
+ authentication failure
+
+2008-09-08 23:39 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Set the tunneled flag when dealing with a tunnel-based transport;
+ don't require a securityEngineID if the security model doesn't
+ have one (just USM needs it)
+
+2008-09-08 20:24 magfr
+
+ * include/net-snmp/library/snmp-tc.h, snmplib/snmp-tc.c:
+
+ CHANGES: snmplib: BUG: 2099985: Added const qualifiers to time
+ conversion routins
+
+2008-09-05 07:51 dts12
+
+ * dist/makerelease:
+
+ Update release instructions, in line with makerelease.xml
+ (Qn: Why isn't makerelease.xml being picked up here?)
+
+2008-09-04 22:52 tanders
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: BUG: 1868278: Python segfault (introduced by
+ r16962)
+
+2008-09-03 13:43 dts12
+
+ * configure, configure.d/config_modules_lib,
+ configure.d/config_project_with_enable:
+
+ CHANGES: build: PATCH: 2000874: Cleanup transport selection.
+
+2008-09-03 13:29 dts12
+
+ * configure, configure.d/config_os_struct_members,
+ configure.d/config_project_perl_python:
+
+ Tidy up perl/python and O/S data structure tests.
+
+2008-08-31 18:14 dts12
+
+ * configure, configure.d/config_os_functions,
+ configure.d/config_os_headers, configure.d/config_os_libs,
+ configure.d/config_os_misc1, configure.d/config_os_misc2,
+ configure.d/config_os_misc3, configure.d/config_os_misc4,
+ configure.d/config_os_progs,
+ configure.d/config_project_ipv6_types,
+ configure.d/config_project_paths,
+ configure.d/config_project_types,
+ configure.d/config_project_with_enable:
+
+ Tidy up (most of) the individual components of the configure
+ framework.
+ This is mostly re-indentation, re-commenting, and a certain
+ amount
+ of judicious re-ordering of the tests within individual
+ sub-script.
+
+2008-08-31 17:30 dts12
+
+ * configure, configure.ac:
+
+ Annotate configure template with suggested best practice
+ structure.
+ Note that none of these changes has altered the code within
+ 'configure' itself (other than affecting line numbers)
+
+2008-08-31 17:26 dts12
+
+ * configure, configure.ac, configure.d,
+ configure.d/config_modules_agent, configure.d/config_modules_lib,
+ configure.d/config_os_functions, configure.d/config_os_headers,
+ configure.d/config_os_libs, configure.d/config_os_misc1,
+ configure.d/config_os_misc2, configure.d/config_os_misc3,
+ configure.d/config_os_misc4, configure.d/config_os_progs,
+ configure.d/config_os_struct_members,
+ configure.d/config_project_ipv6_types,
+ configure.d/config_project_manual,
+ configure.d/config_project_paths,
+ configure.d/config_project_perl_python,
+ configure.d/config_project_types,
+ configure.d/config_project_with_enable:
+
+ NEWS: build: split configure template into separate pieces.
+ (Mostly) self-contained, and significantly less confusing!
+
+2008-08-31 17:23 dts12
+
+ * configure.ac, configure.in:
+
+ Rename configure template in line with current best practice.
+
+2008-08-29 19:54 dts12
+
+ * dist/changelogfix:
+
+ Retain filenames which don't include the expected prefix.
+
+2008-08-27 21:55 tanders
+
+ * agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable,
+ agent/mibgroup/util_funcs:
+
+ ignore .libs directories
+
+2008-08-27 13:39 jsafranek
+
+ * agent/mibgroup/hardware/cpu/cpu_linux.c:
+
+ S/390 uses slightly different format of the /proc/cpuinfo file:
+ processor 0: version = FF, identification = 060AFE, machine =
+ 2094
+
+2008-08-22 23:47 tanders
+
+ * FAQ:
+
+ update list of supported operating systems
+
+2008-08-22 23:27 tanders
+
+ * configure, configure.in:
+
+ NEWS: build: BUG: 2023803: Compilation problems on HP-UX 11.31
+ CHANGES: build: Limit the use of _KERNEL definitions in configure
+ tests to match the use
+ of _KERNEL in our codebase
+
+2008-08-22 00:18 tanders
+
+ * agent/mibgroup/host/data_access/swrun_pstat.c,
+ agent/mibgroup/host/hr_swrun.c:
+
+ Fix build failure on HP-UX 11.31: use getpagesize() instead of
+ PGSHIFT.
+ Successfully tested on HP-UX 10.20, 11.00, 11.11, 11.23 and
+ 11.31.
+
+2008-08-21 10:03 jsafranek
+
+ * configure.in:
+
+ add SCTP-MIB
+
+2008-08-20 17:37 magfr
+
+ * agent/mibgroup/smux/smux.c:
+
+ Have only one variable named passwd in smux_auth_peer.
+
+2008-08-19 23:22 tanders
+
+ * README.tru64:
+
+ update README for Tru64 after the sendto/recvfrom fixes
+
+2008-08-19 20:27 tanders
+
+ * agent/mibgroup/host/data_access/swrun.h:
+
+ fix significant typo
+
+2008-08-19 13:25 dts12
+
+ * agent/mibgroup/host/data_access/swrun.h:
+
+ Force use of /proc/%d/psinfo interface on Solaris.
+ Temporary hack while we investigate the issues with
+ the kvm_proc() code.
+
+ The 'config_require' processing doesn't currently
+ pick up the full #ifdef environment, so defaults
+ to using kvm_proc(). I'm not convinced this was
+ working before anyway,
+
+2008-08-19 13:17 dts12
+
+ * agent/mibgroup/host/data_access/swrun_procfs_psinfo.c:
+
+ Fix problems in /proc/%d/psinfo interface processing.
+
+2008-08-19 08:47 dts12
+
+ * agent/mibgroup/hardware/sensors, agent/mibgroup/host/data_access:
+
+ Ignore library and object files
+
+2008-08-19 08:36 dts12
+
+ *
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c:
+
+ Activate statistics that are supported on Solaris and/or Linux
+ IPv6
+
+2008-08-19 08:11 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ Improved tracing of SMUX authentication problems.
+
+2008-08-19 08:08 dts12
+
+ * agent/mibgroup/disman/event/mteObjects.c:
+
+ Better tracing of DisMan object processing.
+
+2008-08-18 22:43 tanders
+
+ * agent/mibgroup/sctp-mib/sctpScalars.h:
+
+ remove bogus white space
+
+2008-08-18 22:01 dts12
+
+ * perl/SNMP/SNMP.pm:
+
+ CHANGES: perl: PATCH: 2021444: Support SNMPv2c in gettable
+ processing
+
+2008-08-18 21:44 dts12
+
+ * snmplib/snmpksm.c:
+
+ CHANGES: snmplib: PATCH: 2003450: Fix a couple of 64-bit
+ problems.
+
+2008-08-18 14:30 hardaker
+
+ * apps/snmpusm.c:
+
+ revert 17157 since it broke something
+
+2008-08-18 07:06 jsafranek
+
+ * README.agent-mibs:
+
+ add SCTP-MIB implementation (Linux only)
+
+2008-08-17 21:08 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ CHANGES: snmpd: PATCH: 2022936: Fix AgentX Counter64 decoding on
+ 64-bit architectures
+
+2008-08-17 20:50 dts12
+
+ * agent/snmpd.c:
+
+ CHANGES: snmpd: PATCH: 2014204: Support -g {groupname}
+
+2008-08-15 13:45 hardaker
+
+ * apps/snmpusm.c:
+
+ NEWS: snmpusm: PATCH: 1591355: from ppassera: Allow cloning to
+ engineIDs that are different from the agent's engineID
+
+2008-08-14 15:54 dts12
+
+ * agent/mibgroup/host/data_access/swrun_kvm_proc.c:
+
+ SWRun processing needs access to the internals of 'struct user'
+ (Solaris)
+
+2008-08-13 13:02 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c:
+
+ Correctly parse interface indexes higher than 0xff.
+
+2008-08-12 08:27 jsafranek
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Close file when parsing of /proc/XXX/status fails.
+
+2008-08-12 07:27 jsafranek
+
+ * agent/mibgroup/sctp-mib, agent/mibgroup/sctp-mib.h,
+ agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpAssocTable.c,
+ agent/mibgroup/sctp-mib/sctpAssocTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h,
+ agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c,
+ agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h,
+ agent/mibgroup/sctp-mib/sctpScalars.c,
+ agent/mibgroup/sctp-mib/sctpScalars.h,
+ agent/mibgroup/sctp-mib/sctpScalars_common.c,
+ agent/mibgroup/sctp-mib/sctpScalars_common.h,
+ agent/mibgroup/sctp-mib/sctpScalars_linux.c,
+ agent/mibgroup/sctp-mib/sctpTables.h,
+ agent/mibgroup/sctp-mib/sctpTables_common.c,
+ agent/mibgroup/sctp-mib/sctpTables_common.h,
+ agent/mibgroup/sctp-mib/sctpTables_linux.c, mibs/Makefile.in,
+ mibs/Makefile.mib, mibs/SCTP-MIB.txt:
+
+ NEWS: snmpd: PATCH: 2023633: add SCTP-MIB implementation (Linux
+ only)
+
+2008-08-07 10:03 jsafranek
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ Fix inetNetToMediaTable table processing - continue with next
+ entry when fillup_entry_info() fails.
+
+2008-08-07 09:00 jsafranek
+
+ * man/snmpd.conf.5.def:
+
+ Fix documentation of exec statament - it does not cache results
+ anymore. Related to bug 883134
+
+2008-07-31 23:39 dts12
+
+ * agent/mibgroup/host/data_access/swrun_procinfo.c:
+
+ Fix a typo, and a bogus field name in the AIX procinfo structure.
+
+2008-07-31 23:35 dts12
+
+ * agent/mibgroup/host/data_access/swrun_kvm_proc.c:
+
+ Include missing headers, and fix one bogus field name in Solaris
+ proc structure.
+
+2008-07-30 17:40 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ CHANGES: agent: BUG: 2003144: Increase size of AgentX packet
+ build buffer
+
+2008-07-30 07:57 dts12
+
+ * snmplib/mib.c:
+
+ CHANGES: snmplib: BUG: 2027834: Extend string print buffer by the
+ minimum necessary.
+
+2008-07-29 23:34 dts12
+
+ * agent/mibgroup/host/data_access/swrun_cygwin.c,
+ agent/mibgroup/host/data_access/swrun_kvm_proc.c,
+ agent/mibgroup/host/data_access/swrun_nlist.c,
+ agent/mibgroup/host/data_access/swrun_procfs_psinfo.c,
+ agent/mibgroup/host/data_access/swrun_procinfo.c,
+ agent/mibgroup/host/data_access/swrun_prpsinfo.c,
+ agent/mibgroup/host/data_access/swrun_pstat.c:
+
+ Fix assorted silly typos - unbalanced parentheses
+ and the wrong type enumeration value names.
+
+2008-07-29 23:31 dts12
+
+ * agent/mibgroup/host/data_access/swrun.c:
+
+ Ensure swrun data is available for the prTable calls,
+ rather than relying on hrSWRunTable to trigger this.
+
+2008-07-29 16:19 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ a) Fix the size of the buffer in just one place
+ (makes it easier to change if necessary)
+ b) Fix various unfortunate line-breaks (within "pdu->flags")
+
+2008-07-29 16:05 dts12
+
+ * agent/mibgroup/ucd-snmp/proc.c,
+ include/net-snmp/data_access/swrun.h:
+
+ If the re-written SWRun module if available, then use it for
+ the UCD-specific prTable as well as the hrSWRunTable.
+ Consistency is good....
+
+2008-07-29 15:23 dts12
+
+ * agent/mibgroup/host/data_access/swrun_procfs_status.c:
+
+ Suppress junk in hrSWRunName & hrSWRunParameters values
+
+2008-07-29 10:27 dts12
+
+ * agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/data_access/swrun.h,
+ agent/mibgroup/host/hrSWRunPerfTable.c,
+ agent/mibgroup/host/hrSWRunTable.c:
+
+ The cache/container relate to the data itself, so should
+ more naturally be handled by the data_access module,
+ rather than a particular MIB table module.
+
+2008-07-28 21:18 dts12
+
+ * agent/mibgroup/hardware/fsys/fsys_mntent.c:
+
+ 'used' and 'free' are not the same thing, Dave. Pay attention at
+ the back....
+
+2008-07-28 14:39 dts12
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ CHANGES: agent: BUG: 2023803: Ensure compilation is not dependent
+ on an irrelevant configure characteristic for HP-UX 11
+
+2008-07-28 10:56 dts12
+
+ * apps/snmpset.c:
+
+ CHANGES: apps: BUG: 1964136: Drop NULL type from snmpset usage
+ message.
+
+2008-07-25 14:19 dts12
+
+ * agent/mibgroup/host.h, agent/mibgroup/host/hrSWRunTable.h:
+
+ Use '--enable-new-features' mechanism to include hrSW* re-writes
+
+2008-07-25 14:13 dts12
+
+ * agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_null.c,
+ agent/mibgroup/host/data_access/swinst_pkginfo.c,
+ agent/mibgroup/host/data_access/swinst_rpm.c,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/data_access/swrun.h,
+ agent/mibgroup/host/data_access/swrun_cygwin.c,
+ agent/mibgroup/host/data_access/swrun_darwin.c,
+ agent/mibgroup/host/data_access/swrun_kinfo.c,
+ agent/mibgroup/host/data_access/swrun_kvm_proc.c,
+ agent/mibgroup/host/data_access/swrun_nlist.c,
+ agent/mibgroup/host/data_access/swrun_null.c,
+ agent/mibgroup/host/data_access/swrun_procfs_psinfo.c,
+ agent/mibgroup/host/data_access/swrun_procfs_status.c,
+ agent/mibgroup/host/data_access/swrun_procinfo.c,
+ agent/mibgroup/host/data_access/swrun_prpsinfo.c,
+ agent/mibgroup/host/data_access/swrun_pstat.c:
+
+ Preliminary OS-specific implementations of Running and Installed
+ Software data access.
+
+2008-07-24 23:22 tanders
+
+ * man/snmpcmd.1.def:
+
+ CHANGES: documentation: BUG: 2027129: fix typo in snmpcmd.1
+
+2008-07-24 10:00 jsafranek
+
+ * man/snmp.conf.5.def, sedscript.in:
+
+ reflect default temp file pattern in man page if it's modified by
+ ./configure script
+
+2008-07-24 08:36 jsafranek
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in:
+
+ NEWS: building: add --with-temp-file-pattern configure option
+
+2008-07-24 06:53 jsafranek
+
+ * agent/agent_read_config.c:
+
+ CHANGES: snmpd: PATCH: 1823800: release and reload all trap
+ destinations on SIGHUP
+
+2008-07-22 14:33 jsafranek
+
+ * net-snmp-create-v3-user.in:
+
+ fix net-snmp-create-v3-user to run without arguments
+
+2008-07-22 14:21 jsafranek
+
+ * ., Makefile.in, configure, configure.in, net-snmp-config.in,
+ net-snmp-create-v3-user.in:
+
+ NEWS: misc: separate user management from net-snmp-config into
+ new net-snmp-create-v3-user script
+
+2008-07-21 13:44 dts12
+
+ * agent/helpers/old_api.c:
+
+ CHANGES: agent: PATCH 1944581: Protect against core dumps with
+ long string index values.
+
+2008-07-18 15:19 hardaker
+
+ * dist/makerelease.xml:
+
+ new signing key
+
+2008-07-17 10:05 jsafranek
+
+ * agent/mibgroup/utilities/iquery.c:
+
+ CHANGES: snmpd: BUG: 2018031: Don't probe engineID in internal
+ monitor sessions.
+
+2008-07-10 19:33 hardaker
+
+ * dist/makerelease.xml:
+
+ fix a regexp quote
+
+2008-07-10 14:12 tanders
+
+ * snmplib/system.c:
+
+ build fix for systems that don't have getaddrinfo (e.g. HP-UX
+ 11.0 and earlier, Solaris 7 and earlier)
+
+2008-07-10 13:50 alex_b
+
+ * win32/Makefile.in:
+
+ CHANGES: building: BUG: 2014526: Win32:
+ snmpv3-security-includes.h not installed
+
+2008-07-06 15:05 alex_b
+
+ * README.win32, win32/Configure, win32/build.pl,
+ win32/dist/README.build.win32.txt,
+ win32/netsnmpmibssdk/Makefile.in:
+
+ CHANGES: bulding: Add support for winExtDLL to build.bat (win32)
+
+2008-07-06 12:38 alex_b
+
+ * win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Win32 build fixes - add missing function for DLL build.
+
+2008-07-02 12:39 jsafranek
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c:
+
+ CHANGES: snmpd: BUG: 2006786: Interface name can have more than 8
+ characters.
+
+2008-06-25 17:39 tanders
+
+ * agent/agent_read_config.c, agent/agent_trap.c, apps/snmptrap.c,
+ include/net-snmp/agent/ds_agent.h,
+ include/net-snmp/library/system.h, man/snmpd.conf.5.def,
+ perl/SNMP/SNMP.xs, python/netsnmp/client_intf.c,
+ snmplib/snmpUDPDomain.c, snmplib/system.c:
+
+ NEWS: snmpd: PATCH: 1916840: new config option to set SNMPv1 trap
+ agent address
+ CHANGES: snmplib: PATCH: 1916840: introduce
+ netsnmp_gethostbyname_v4
+
+2008-06-25 15:16 jsafranek
+
+ * perl/SNMP/SNMP.xs:
+
+ fix assertion when used with perl 5.10
+
+2008-06-24 05:01 magfr
+
+ * agent/mibgroup/snmpv3/usmUser.c,
+ include/net-snmp/library/snmpusm.h, snmplib/snmpusm.c:
+
+ CHANGES: snmplib, snmpd: BUG: 2001124: Allow embedded NUL
+ characters in usmUserPublic
+
+2008-06-23 19:57 magfr
+
+ * snmplib/snmp_client.c:
+
+ Only reserve space for the extra \0 after the data for OCTET
+ STRING valued entities
+
+2008-06-23 19:13 magfr
+
+ * testing/tests/T001snmpv1get, testing/tests/T014snmpv2cget,
+ testing/tests/T015snmpv2cgetnext,
+ testing/tests/T0160snmpv2cbulkget,
+ testing/tests/T016snmpv2cgetfail,
+ testing/tests/T017snmpv2ctov1getfail,
+ testing/tests/T018snmpv1tov2cgetfail,
+ testing/tests/T019snmpv2cnosuch, testing/tests/T020snmpv3get,
+ testing/tests/T021snmpv3getnext,
+ testing/tests/T0220snmpv3bulkget:
+
+ CHANGES: building: Disable tests if the agent is built without
+ the mib module they depend on.
+
+2008-06-21 12:14 magfr
+
+ * configure, configure.in:
+
+ Remove spurious AC_MSG_RESULT inside an AC_CACHE_CHECK
+
+2008-06-18 05:07 magfr
+
+ * configure, configure.in:
+
+ Handle solaris awk as well.
+
+2008-06-17 16:01 tanders
+
+ * agent/auto_nlist.c:
+
+ CHANGES: snmpd: PATCH: 1995753: from volkov_peter: minor cleanup
+ agent/auto_nlist.c
+
+2008-06-17 08:57 dts12
+
+ * snmplib/snmpTCPIPv6Domain.c:
+
+ Fix potential buffer overflow in sprintf for TCP/IPv6
+ Cross-port of revision 16668
+
+2008-06-16 23:55 tanders
+
+ * configure.in:
+
+ CHANGES: build: BUG: 1995172: fix --without-elf configure usage
+ message
+
+2008-06-13 22:16 dts12
+
+ * dist/find-requires, dist/net-snmp.spec:
+
+ CHANGES: build: Improved RPM spec files, for better consistency
+ with vendor-provided packages.
+ Provided by Jan Safranek
+
+2008-06-13 21:03 dts12
+
+ * configure, configure.in:
+
+ CHANGES: build: PATCH: 1899762: Tweak embedded_perl configure
+ checks.
+
+2008-06-13 05:43 magfr
+
+ * acconfig.h, agent/mibgroup/snmpv3mibs.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ NEWS: building: Retire the config_old/new_require feature and
+ replace it with config_version_require that compares version
+ numbers to achieve a similar thing
+
+2008-06-12 12:50 dts12
+
+ * dist/makerelease:
+
+ Only add non-default MIB modules to the test builds.
+ Specifying the host module is not needed on Linux systems,
+ and may break on other O/Ss. Specifying the disman/event
+ MIB is unnecessary on any system.
+
+2008-06-11 10:16 dts12
+
+ * dist/makerelease:
+
+ Only enable IPX transport on Linux systems
+
+2008-06-10 14:37 dts12
+
+ * agent/mibgroup/utilities/iquery.c,
+ include/net-snmp/library/snmp_api.h, snmplib/snmp_client.c:
+
+ snmpd: PATCH: 1918383: Fix DisMan monitoring of AgentX subagents
+ Note that this doesn't actually use the code submitted in that
+ patch.
+ Instead it inserts a callback hook into the
+ snmp_synch_response_cb
+ routine (using the myvoid pointer and a new session flag), which
+ has
+ the same effect without needing to duplicate any code.
+
+2008-06-10 12:52 dts12
+
+ * agent/mibgroup/disman/event/mteTrigger.c:
+
+ Fix logic errors in handling of old/current varbind lists.
+ Reported by Fred Gao in patch #1918383
+
+2008-06-09 19:08 hardaker
+
+ * snmplib/scapi.c:
+
+ update to match published release
+
+2008-06-09 16:58 hardaker
+
+ * dist/makerelease.xml:
+
+ added snmp_version.c
+
+2008-06-09 09:05 dts12
+
+ * apps/snmptrap.c, apps/snmpusm.c:
+
+ A couple more missing error checks.
+ Based on those reported by Boya Sun
+
+2008-06-06 12:02 dts12
+
+ * configure, configure.in:
+
+ Better handling of embedded perl on Mac OS/X
+ (nearly working on Leopard now)
+
+2008-06-03 23:14 tanders
+
+ * acconfig.h, agent/auto_nlist.c, agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/memory.h,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hrh_filesys.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/proc.c, configure.in,
+ include/net-snmp/net-snmp-config.h.in, snmplib/system.c:
+
+ NEWS: aix: Add support for AIX 6.x
+
+2008-06-03 22:46 tanders
+
+ * aclocal.m4, config.guess, config.sub, configure, ltmain.sh:
+
+ NEWS: build: Update to libtool 1.5.26 (from 1.5.24), e.g. to
+ better support AIX 6.1 and Mac OS X Leopard
+
+2008-06-03 22:39 tanders
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ why add legacy definitions for new stuff?
+
+2008-06-03 09:03 dts12
+
+ * agent/mibgroup/utilities/iquery.c:
+
+ Ensure the default internal query session has a valid engineID,
+ to avoid having to probe for it on the first use.
+
+2008-06-02 22:17 magfr
+
+ * include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/tools.h, snmplib/snmp_api.c,
+ snmplib/snmp_client.c, snmplib/tools.c:
+
+ NEWS: snmplib: Convert generic source arguments from const
+ u_char* to const void* for snmp_pdu_add_variable,
+ snmp_varlist_add_variable, snmp_set_var_value,
+ snmp_set_var_typed_value and memdup.
+
+2008-06-02 13:28 dts12
+
+ * agent/mibgroup/disman/event/mteTrigger.c:
+
+ Ensure that the "trigger armed" flag is cleared whenever the
+ matching
+ expression is found to hold - even if the trigger doesn't
+ actually fire.
+ This affects the behaviour of initially-true expressions, when
+ this
+ initial firing is suppressed using the mteTrigger*Startup object.
+ Without this tweak, the trigger will fire on the second sampling
+ (as if the expression had evaluated false first time round).
+
+2008-06-01 20:02 dts12
+
+ * agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteObjects.c,
+ agent/mibgroup/disman/event/mteObjects.h:
+
+ Handle varbind payload for internal linkUp/Down notifications.
+
+2008-06-01 06:45 tanders
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ NEWS: snmptrapd: BUG: 1955227: Memory leak for embedded Perl on
+ x86_64
+
+2008-05-31 12:08 magfr
+
+ * agent/helpers/scalar_group.c:
+
+ CHANGES: snmpd: The scalar helper that was called from the
+ scalar_group helper did nothing save adding a trailing 0 to the
+ argument. Remove the use of the scalar helper from the
+ scalar_group and add the trailing 0 in the scalar_group helper.
+
+2008-05-30 13:56 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Tweak list of on-line software directories to be updated.
+
+2008-05-29 09:59 dts12
+
+ * agent/agent_registry.c, agent/helpers/stash_cache.c,
+ agent/mibgroup/agent/extend.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/disman/event/mteTrigger.c, apps/snmptest.c,
+ apps/snmptrap.c, apps/snmpusm.c, snmplib/snmpusm.c:
+
+ Various missing error checks, etc.
+ Reported by Boya Sun.
+
+2008-05-28 11:48 dts12
+
+ * agent/mibgroup/hardware/memory/memory_freebsd.c,
+ agent/mibgroup/ucd-snmp/memory.c:
+
+ Report cached memory size/usage properly (particularly on
+ FreeBSD).
+
+2008-05-28 11:21 dts12
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ Bring memBuffer code into line with revision 16975.
+
+2008-05-28 11:10 dts12
+
+ * agent/mibgroup/hardware/memory/memory_linux.c:
+
+ Linux 2.6 kernel does not report shared memory information.
+
+2008-05-28 09:18 dts12
+
+ * agent/mibgroup/hardware/memory/memory_linux.c:
+
+ CHANGES: snmpd: BUG: 1931391: Fix reporting of Memory buffers and
+ cached memory.
+ Problem reported by doconeill.
+
+2008-05-28 08:30 dts12
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Tweak the fix for bug #1912647
+
+2008-05-28 06:56 magfr
+
+ * agent/helpers/scalar_group.c:
+
+ CHANGES: snmpd: Enforce the lower limit on scalar_groups
+ This fixes the case of getnext icmp.0 returning icmp.0.0 instead
+ of the
+ expected icmpInMsgs.0
+
+2008-05-27 22:03 dts12
+
+ * agent/mibgroup/agentx/master.c, agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: snmpd: BUG: 1912647: Fix memory leak following failed
+ requests.
+ Fix provided by Anton Pak
+
+2008-05-27 21:22 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: BUG: 1958041: Ensure IDs are not truncated.
+
+2008-05-27 14:18 dts12
+
+ * agent/mibgroup/hardware/memory/memory_freebsd.c:
+
+ Monitor memory buffers on FreeBSD systems.
+ API suggested by Chris
+
+2008-05-27 12:47 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c:
+
+ Fix careless typo when applying Maxim's patch.
+
+2008-05-25 21:37 magfr
+
+ * README.agent-mibs, agent/mibgroup/snmpv3/usmStats.h,
+ agent/mibgroup/snmpv3/usmStats_5_5.c,
+ agent/mibgroup/snmpv3/usmStats_5_5.h,
+ agent/mibgroup/snmpv3mibs.h:
+
+ CHANGES: snmpd: Reimplementation of usmStats.
+
+2008-05-25 07:24 magfr
+
+ * agent/mibgroup/disman/event/mteEventConf.c:
+
+ Remove a local variable only used to track a local string
+ constant and replace t with a direct reference to the string
+ constant.
+ Mark two local functions static as well.
+
+2008-05-25 07:17 magfr
+
+ * agent/mibgroup/utilities/iquery.c:
+
+ Reorder to avoid one strlen call.
+ Add missing cast.
+
+2008-05-25 07:14 magfr
+
+ * agent/mibgroup/ip-mib/data_access/scalars_linux.c:
+
+ Make ipfw_name a static array instead of a pointer as it is
+ private to this module.
+
+2008-05-25 07:05 magfr
+
+ * agent/helpers/instance.c:
+
+ When casting, cast to the right type.
+
+2008-05-25 06:08 magfr
+
+ * agent/helpers/cache_handler.c, agent/helpers/read_only.c,
+ agent/helpers/stash_cache.c, agent/mibgroup/agent/extend.c,
+ agent/mibgroup/agent/nsCache.c, agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/host/hr_print.c, agent/mibgroup/host/hr_swinst.c,
+ agent/snmp_agent.c, apps/snmptest.c, snmplib/read_config.c,
+ snmplib/snmp_client.c:
+
+ Remove warnings about unreachable code on solaris.
+
+2008-05-24 20:30 dts12
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: BUG: 1826174: Check for buffer overflow when
+ printing values.
+ Addresses CVE-2008-2292
+
+2008-05-24 13:11 magfr
+
+ * configure, configure.in:
+
+ On AIX netinet/in_pcb.h depends on net/route.h. Add the include
+ for configure.
+
+2008-05-24 09:06 magfr
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Make the checks for netinet/in_pcb.h and sys/disklabel.h use the
+ normal
+ machinery.
+ Add a netsnmp prefix to the cache variable
+ cv_sys_ioctl_h_has_SIOCGIFADDR to
+ pacify aclocal.
+
+2008-05-23 20:27 dts12
+
+ * agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/cpu/cpu_sysctl.c:
+
+ CHANGES: snmpd: PATCH: Fix for CPU stats on FreeBSD
+ Provided by Maxim Sobolev
+
+2008-05-23 20:12 dts12
+
+ * dist/snmpd-init.d, dist/snmptrapd-init.d:
+
+ CHANGES: install: PATCH: 1969627: Handle empty
+ /etc/sysconfig/network file
+ Fix provided by Josh Wilmes
+
+2008-05-23 20:07 dts12
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ CHANGES: snmpd: PATCH: 1967194: Recognise NFS4 mounts
+ Submitted by Fabrice Bacchella
+
+2008-05-22 20:55 dts12
+
+ * snmplib/asn1.c:
+
+ Don't change length of OID buffer if parsing the OID fails.
+ Reported by saifulla Mohd Abdul.
+
+2008-05-22 13:34 hardaker
+
+ * dist/makerelease.xml:
+
+ update the advertising section and change note about how to
+ upload files (adding an automatted rsync command)
+
+2008-05-22 04:08 magfr
+
+ * agent/mibgroup/util_funcs/header_simple_table.c:
+
+ Add missing include.
+
+2008-05-21 20:27 magfr
+
+ * snmplib/snmpAliasDomain.c:
+
+ Make it possible to build the alias module with a C++ compiler.
+
+2008-05-21 13:40 hardaker
+
+ * dist/makerelease.xml:
+
+ added FSF directory info
+
+2008-05-21 09:21 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Add Free Software Directory to the list of places to be updated.
+
+2008-05-20 23:00 magfr
+
+ * agent/mibgroup/agent/extend.c, agent/mibgroup/agent/extend.h,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/example.h,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/examples/ucdDemoPublic.h,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h, agent/mibgroup/misc/ipfwacc.c,
+ agent/mibgroup/misc/ipfwacc.h,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpEngine.h,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.h,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats.h,
+ agent/mibgroup/snmpv3/usmUser.c, agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/ucd-snmp/disk.c, agent/mibgroup/ucd-snmp/disk.h,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/diskio.h,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/errormib.h,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/file.c, agent/mibgroup/ucd-snmp/file.h,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ agent/mibgroup/ucd-snmp/lmSensors.h,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/loadave.h,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/logmatch.h,
+ agent/mibgroup/ucd-snmp/memory_aix4.c,
+ agent/mibgroup/ucd-snmp/memory_aix4.h,
+ agent/mibgroup/ucd-snmp/memory_darwin7.c,
+ agent/mibgroup/ucd-snmp/memory_darwin7.h,
+ agent/mibgroup/ucd-snmp/memory_dynix.c,
+ agent/mibgroup/ucd-snmp/memory_dynix.h,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.h,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.h,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.c,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.h,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.h,
+ agent/mibgroup/ucd-snmp/vmstat_darwin7.c,
+ agent/mibgroup/ucd-snmp/vmstat_darwin7.h,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.c,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.h,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h,
+ agent/mibgroup/ucd-snmp/vmstat_hpux.c,
+ agent/mibgroup/ucd-snmp/vmstat_hpux.h,
+ agent/mibgroup/ucd-snmp/vmstat_linux.c,
+ agent/mibgroup/ucd-snmp/vmstat_linux.h,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.h,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.h,
+ agent/mibgroup/util_funcs, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/util_funcs.h,
+ agent/mibgroup/util_funcs/MIB_STATS_CACHE_TIMEOUT.h,
+ agent/mibgroup/util_funcs/header_generic.c,
+ agent/mibgroup/util_funcs/header_generic.h,
+ agent/mibgroup/util_funcs/header_simple_table.c,
+ agent/mibgroup/util_funcs/header_simple_table.h:
+
+ CHANGES: snmpd: The majority of the dependencies on util_funcs is
+ for the header_* functions. Factor out the header_* functions and
+ adjust the requirements.
+
+2008-05-20 22:40 magfr
+
+ * agent/mibgroup/Rmon/agutil.c, agent/mibgroup/Rmon/alarm.c,
+ agent/mibgroup/Rmon/alarm.h, agent/mibgroup/Rmon/event.c,
+ agent/mibgroup/Rmon/event.h, agent/mibgroup/Rmon/history.c,
+ agent/mibgroup/Rmon/history.h, agent/mibgroup/Rmon/rows.c,
+ agent/mibgroup/Rmon/statistics.c,
+ agent/mibgroup/Rmon/statistics.h, agent/mibgroup/agent/nsCache.c,
+ agent/mibgroup/agent/nsDebug.c,
+ agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/hardware/sensors/kstat_sensors.c,
+ agent/mibgroup/hardware/sensors/lmsensors_v2.c,
+ agent/mibgroup/hardware/sensors/lmsensors_v3.c,
+ agent/mibgroup/hardware/sensors/picld_sensors.c,
+ agent/mibgroup/mibII/ipAddr.h, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/snmp_mib.c, agent/mibgroup/mibII/tcp.h,
+ agent/mibgroup/mibII/tcpTable.h, agent/mibgroup/mibII/udp.h,
+ agent/mibgroup/mibII/udpTable.h,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_conf.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/mibII/var_route.h, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.h,
+ agent/mibgroup/tunnel/tunnel.c,
+ agent/mibgroup/utilities/override.c, agent/mibgroup/winExtDLL.c,
+ agent/mibgroup/winExtDLL.h, agent/snmp_agent.c:
+
+ CHANGES: Do not config_require(util_funcs) if nothing from
+ util_funcs is used
+
+2008-05-14 13:35 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ fix build failures with earlier Linux kernels (e.g. with RH7.1)
+ introduced by r16909
+
+2008-05-13 18:56 hardaker
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ fix comment typo
+
+2008-05-13 15:46 hardaker
+
+ * NEWS:
+
+ document the -t switch change
+
+2008-05-13 15:45 hardaker
+
+ * man/snmpcmd.1.def:
+
+ document the alias keyword
+
+2008-05-13 15:41 hardaker
+
+ * man/snmpcmd.1.def, snmplib/snmp_parse_args.c:
+
+ allow floating point numbers to be used for timeout values
+
+2008-05-12 21:11 hardaker
+
+ * mibs/NET-SNMP-TC.txt, snmplib/snmpAliasDomain.c:
+
+ Added a real snmpAliasDomain OID definition
+
+2008-05-12 21:07 hardaker
+
+ * NEWS:
+
+ updated NEWS with new alias blurb
+
+2008-05-12 21:07 hardaker
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/library/snmpAliasDomain.h,
+ include/net-snmp/net-snmp-config.h.in, man/snmp.conf.5.def,
+ snmplib/snmpAliasDomain.c, snmplib/snmp_transport.c:
+
+ NEWS: snmplib: Added a alias transport for mapping complex
+ transport strings to simple name definitions
+
+2008-05-12 19:38 hardaker
+
+ * dist/makerelease.xml:
+
+ strip off trailing module name
+
+2008-05-12 06:03 magfr
+
+ * agent/mibgroup/mibII/snmp_mib.c:
+
+ Make mibII/snmp work again.
+
+2008-05-10 21:47 magfr
+
+ * agent/mibgroup/ip-mib/ip_scalars.c,
+ agent/mibgroup/ucd-snmp/diskio.c:
+
+ CHANGES: snmpd: Remove unused variables.
+
+2008-05-10 09:55 magfr
+
+ * agent/agent_index.c, agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/ucd-snmp/proxy.c, agent/snmp_agent.c,
+ snmplib/asn1.c:
+
+ CHANGES: snmpd, snmplib: Replace the invalid %08p format
+ specifier with the correct %8p.
+
+2008-05-10 09:51 magfr
+
+ * agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/ipAddr.c, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c, apps/snmpdelta.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmpnetstat/main.c, apps/snmptrapd.c,
+ apps/snmptrapd_handlers.c:
+
+ CHANGES: snmpd, snmpnetstat, snmptrapd, snmpdelta: Use NULL
+ instead of 0 for NULL pointers. Use casted 0's instead of 0 for
+ NULL function pointers.
+
+2008-05-10 09:40 magfr
+
+ * agent/mibgroup/host/hr_disk.h,
+ include/net-snmp/agent/agent_sysORTable.h,
+ include/net-snmp/agent/stash_cache.h:
+
+ CHANGES: snmpd: Add missing function declarations.
+
+2008-05-10 09:39 magfr
+
+ * agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/expr/expExpressionConf.c,
+ agent/mibgroup/ucd-snmp/diskio.c, agent/snmp_vars.c:
+
+ CHANGES: snmpd: Add missing include files.
+
+2008-05-10 09:33 magfr
+
+ * agent/agent_registry.c, agent/helpers/table_data.c,
+ agent/helpers/table_dataset.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c,
+
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c,
+
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c,
+ agent/snmp_agent.c, local/mib2c-conf.d/mfd-interface.m2c,
+ snmplib/data_list.c:
+
+ CHANGES: snmpd, snmplib, mib2c: Move the definition of inline
+ functions so that the compiler sees them before it sees uses of
+ them.
+
+2008-05-10 09:30 magfr
+
+ * agent/agent_handler.c, agent/helpers/table_dataset.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/library/data_list.h:
+
+ CHANGES: snmpd, snmplib: Remove the inline declarations for
+ functions that lack an inline definition.
+
+2008-05-09 21:35 magfr
+
+ * agent/agent_index.c, agent/agent_registry.c, agent/agent_trap.c,
+ agent/helpers/table.c, agent/mibgroup/Rmon/rows.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/expr/expValueTable.c,
+ agent/mibgroup/host/hr_device.c, agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c, agent/mibgroup/host/hr_proc.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c, agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/mibII/vacm_conf.c, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/utilities/execute.c,
+ agent/snmp_agent.c, snmplib/container_binary_array.c,
+ snmplib/container_null.c, snmplib/lcd_time.c, snmplib/md5.c,
+ snmplib/mib.c, snmplib/parse.c, snmplib/snmpAAL5PVCDomain.c,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_client.c, snmplib/snmp_debug.c,
+ snmplib/snmp_logging.c, snmplib/snmpusm.c, snmplib/tools.c:
+
+ CHANGES: snmpd, snmplib: Use NULL instead of 0 for NULL pointers.
+ Use casted 0's instead of 0 for NULL function pointers.
+
+2008-05-09 21:27 magfr
+
+ * agent/helpers/old_api.c, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/smux/smux.c, agent/snmp_agent.c,
+ snmplib/default_store.c, snmplib/parse.c, snmplib/read_config.c,
+ snmplib/snmp_version.c:
+
+ CHANGES: snmpd, snmplib: fixups for prototype [(void) replacing
+ ()].
+
+2008-05-09 21:23 magfr
+
+ * agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c:
+
+ Remove dead code.
+
+2008-05-09 19:16 dts12
+
+ * dist/makerelease:
+
+ Missing MD5 signature file for zip release
+
+2008-05-09 19:15 dts12
+
+ * dist/makerelease:
+
+ Basic documentation and help/usage messages.
+
+2008-05-08 14:00 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Drop support for the interim SIOCDEVPRIVATE-based ioctl calls.
+ SIOCGMIIPHY/SIOCGMIIREG have been defined since at least Sept
+ 2001 (kernel 2.4.10),
+ so the risk of calling an inappropriate private ioctl is probably
+ greater than
+ that of missing information from an ancient system.
+
+2008-05-08 09:02 dts12
+
+ * snmplib/snmp_api.c:
+
+ Don't try to automatically create anonymous users.
+ (An invalid trapsess directive may crash the agent)
+
+2008-05-06 08:38 jsafranek
+
+ * dist/net-snmp.spec:
+
+ - remove %{libcurrent}
+ - add openssl-devel to build requirements
+ - don't use Provides: unless necessary, let rpmbuild compute the
+ provided libraries
+ - don't specify PREFIX for perl
+
+2008-05-06 08:38 jsafranek
+
+ * agent/agent_read_config.c, agent/agent_trap.c:
+
+ reverting accidentaly commited files
+
+2008-05-06 08:34 jsafranek
+
+ * agent/agent_read_config.c, agent/agent_trap.c:
+
+ - remove %{libcurrent}
+ - add openssl-devel to build requirements
+ - don't use Provides: unless necessary, let rpmbuild compute the
+ provided libraries
+ - don't specify PREFIX for perl
+
+2008-05-05 21:43 dts12
+
+ * configure, configure.in:
+
+ Mechanism to select upcoming module re-writes and/or
+ recently-deprecated modules.
+
+2008-05-02 10:19 dts12
+
+ * include/net-snmp/system/darwin9.h:
+
+ Handle udpTable indexing on both PPC and Intel hardware.
+
+2008-04-30 19:45 magfr
+
+ * snmplib/snmp_debug.c:
+
+ CHANGES: snmplib: Remove the support for generation of statistics
+ of how often a certain debug log level is triggered.
+
+2008-04-30 19:41 magfr
+
+ * snmplib/snmp_debug.c:
+
+ NEWS: snmplib: Remove the variable debug_num_excluded.
+ There is nothing that sets debug_num_excluded and there is no way
+ to for it
+ to affect the result of any function.
+
+2008-04-30 05:28 magfr
+
+ * snmplib/snmp_debug.c:
+
+ Remove unncessary prototypes
+
+2008-04-23 16:39 hardaker
+
+ * dist/makerelease.xml:
+
+ actually use the branch path, don't just say you're going to
+
+2008-04-19 22:20 tanders
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ don't depend on OID resolution for disman linkUpDownNotifications
+
+2008-04-08 20:43 magfr
+
+ * include/net-snmp/agent/sysORTable.h:
+
+ Accept that people will try to compile this code with pre-ANSI
+ compilers and change it to handle that case.
+
+2008-04-08 20:38 hardaker
+
+ * perl/agent/agent.pm:
+
+ CHANGES: perl: fixed an extra brace in the docs pointed out by
+ Jason Martin
+
+2008-04-08 20:34 hardaker
+
+ * dist/makerelease.xml:
+
+ update and restructure a bit to fix a few problems
+
+2008-04-07 20:06 magfr
+
+ * agent/helpers/null.c:
+
+ CHANGES: snmpd: As the null handler is perfectly capable of
+ handling GET_BULK requests it is now marked as such in the
+ registration.
+
+2008-04-07 14:00 dts12
+
+ * snmplib/parse.c:
+
+ Another over-short DESCRIPTION buffer.
+
+2008-04-07 13:57 dts12
+
+ * snmplib/parse.c:
+
+ Handle longer DESCRIPTION/REFERENCE strings in Capabilities
+ statements.
+ (Consistent processing with other MIB definition macros).
+ Fix provided by Aleksandr Lomanov.
+
+2008-04-02 19:35 hardaker
+
+ * FAQ:
+
+ mention libelf package rename
+
+2008-03-29 09:29 magfr
+
+ * README.agent-mibs, agent/Makefile.in, agent/agent_sysORTable.c,
+ agent/mibgroup/agentx/master.h,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/ipAddr.c, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/usmStats.c, agent/mibgroup/tunnel/tunnel.c,
+ agent/snmp_vars.c, include/net-snmp/agent/agent_sysORTable.h,
+ include/net-snmp/agent/sysORTable.h:
+
+ NEWS: snmpd: Enable automatic reregistering of sysORTable entries
+ from AgentX subagents. Add the sysORTable interface to the
+ include directory. Rewrite the sysORTable module to use the
+ table_container handler.
+
+2008-03-27 03:21 hardaker
+
+ * dist/makerelease, dist/net-snmp.spec, dist/patme:
+
+ uncommit 3 accidental multiple file commits
+
+2008-03-27 03:18 hardaker
+
+ * dist/makerelease, dist/makerelease.xml, dist/net-snmp.spec,
+ dist/patme:
+
+ various rewording, restructuring and proper file replacement
+ scheme
+
+2008-03-26 07:52 magfr
+
+ * snmplib/read_config.c:
+
+ NEWS: snmplib: from "Aleksandr Lomanov": Corrected registering of
+ multiple premib config handlers so that all of them get
+ registered as premib handlers as opposed to the earlier behaviour
+ where they always got registered as normal config items.
+
+2008-03-26 07:16 magfr
+
+ * agent/helpers/table_container.c:
+
+ CHANGES: snmpd: Get the table_container data from the right
+ handler when unregistering a table_container.
+
+2008-03-25 06:07 magfr
+
+ * agent/agent_registry.c:
+
+ Remove spurious printf from unregister_mib_context
+
+2008-03-24 17:54 dts12
+
+ * local/mib2c:
+
+ CHANGES: mib2c: BUG: 1874059,1737068: Handle MIB objects with
+ embedded hyphens
+
+2008-03-24 17:29 dts12
+
+ * snmplib/asn1.c:
+
+ CHANGES: snmplib: BUG: 1866655: Handle parsing invalid OID
+ subidentifiers
+
+2008-03-24 16:53 dts12
+
+ * snmplib/asn1.c:
+
+ CHANGES: library: PATCH: 1921861: Avoid endless loop after
+ truncating 64bit int
+
+2008-03-24 15:00 dts12
+
+ * configure, configure.in:
+
+ CHANGES: build: BUG: 1823381: Valid MIB directory search path on
+ Windows
+
+2008-03-22 08:42 magfr
+
+ * apps/snmptrapd.c:
+
+ Make it possible to build snmptrapd without embedded perl again.
+
+2008-03-21 17:55 hardaker
+
+ * agent/mibgroup/smux/smux.c, snmplib/snmpAAL5PVCDomain.c,
+ snmplib/snmpCallbackDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUnixDomain.c,
+ snmplib/winpipe.c:
+
+ NEWS: libsnmp: PATCH: 1895927: from jhum8111: change obsolete
+ recv/send to recvfrom/sendto
+
+2008-03-21 17:49 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ CHANGES: python: PATCH: 1862177: from wafflesouffle: made code
+ more windows/cygwin compiler friendl
+
+2008-03-21 17:45 hardaker
+
+ * python/netsnmp/client.py:
+
+ CHANGES: python: PATCH: 1877840: fix MIB label and indexing due
+ to slightly broken regexp
+
+2008-03-21 17:39 hardaker
+
+ * perl/agent/Support/Support.pm:
+
+ CHANGES: perl: PATCH: 1920390: from wilmesj: fix registration of
+ tables with .0 as IIDs
+
+2008-03-21 17:32 hardaker
+
+ * perl/agent/Support/Support.pm:
+
+ CHANGES: perl: PATCH: 1914645: from wilmesj: better end of mib
+ support
+
+2008-03-21 17:28 hardaker
+
+ * perl/agent/agent.xs:
+
+ CHANGES: perl: PATCH: 1914643: from wilmesj: fix issues with
+ embedded perl returning 0 being reclassified as a wrong data type
+ when an int works.
+
+2008-03-21 17:22 hardaker
+
+ * local/Makefile.in:
+
+ CHANGES: mib2c: PATCH 1914398: from wilmesj: install
+ mib2c.perl.conf
+
+2008-03-21 17:02 hardaker
+
+ * perl/agent/Support/Support.pm:
+
+ CHANGES: perl: PATCH: 1914393: from wilmesj: registerAgent can
+ now be run multiple times
+
+2008-03-21 16:35 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ NEWS: snmpd: PATCH: 1909813: fix table_iterator hint to get_first
+ when SORTED flag is set
+
+2008-03-21 16:24 hardaker
+
+ * agent/snmp_perl.c, apps/snmptrapd.c:
+
+ NEWS: snmptrapd: PATCH: 1908288: from anedel: If snmptrapd -f
+ interrupted with ctrl-C run perl END block
+
+2008-03-21 16:16 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ CHANGES: PATCH: 1902113: from jsafranek: fix error log in
+ inetNetToMediatable
+
+2008-03-21 16:12 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/util_funcs.c:
+
+ CHANGES: PATCH: 1902105: from jsafranek: hide and improve debug
+ log messages created by patch 1705594
+
+2008-03-07 15:42 dts12
+
+ * agent/mibgroup/host/hr_storage.h,
+ agent/mibgroup/host/hrh_filesys.c,
+ agent/mibgroup/host/hrh_filesys.h:
+
+ HAL-based implementation of the hrFSTable.
+
+2008-03-07 15:40 dts12
+
+ * agent/mibgroup/hardware/fsys, agent/mibgroup/hardware/fsys.h,
+ agent/mibgroup/hardware/fsys/fsys_getfsstats.c,
+ agent/mibgroup/hardware/fsys/fsys_mntent.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.c,
+ agent/mibgroup/hardware/fsys/hw_fsys.h,
+ agent/mibgroup/hardware/fsys/mnttypes.h,
+ agent/mibgroup/hardware/fsys/mounts.h:
+
+ Initial HAL implementation of FileSystem information
+
+2008-03-07 15:35 dts12
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in:
+
+ Check for getvfsstat()
+
+2008-03-07 15:34 dts12
+
+ * configure, configure.in:
+
+ CHANGES: build: BUG: 1823381: Use a sensible default MIBDIR path
+ on Cygwin/MinGW
+ (Should this be applied to other branches? If so, which?)
+
+2008-02-27 22:12 hardaker
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ Fix C++ style comment
+
+2008-02-27 07:49 magfr
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ The LVM disk patch introduced a memory leak. This removes the
+ leak.
+
+2008-02-26 23:27 hardaker
+
+ * dist/makerelease.xml:
+
+ make the script more hierarchial/structured
+
+2008-02-26 21:36 nba
+
+ * apps/snmptranslate.c:
+
+ CHANGES: Initalize log subsystem
+
+2008-02-26 21:34 nba
+
+ * snmplib/parse.c:
+
+ CHANGES: Fix for refs to OBJECT-GROUP in another MIB
+
+2008-02-26 21:23 nba
+
+ * mibs/DISMAN-EVENT-MIB.txt, mibs/DISMAN-EXPRESSION-MIB.txt,
+ mibs/IP-FORWARD-MIB.txt, mibs/IP-MIB.txt,
+ mibs/IPV6-FLOW-LABEL-MIB.txt, mibs/NOTIFICATION-LOG-MIB.txt,
+ mibs/SNMP-USM-AES-MIB.txt, mibs/SNMP-USM-DH-OBJECTS-MIB.txt,
+ mibs/TRANSPORT-ADDRESS-MIB.txt, mibs/TUNNEL-MIB.txt:
+
+ Update to autoextracted mib files (blank line chanmges)
+
+2008-02-26 20:46 nba
+
+ * mibs/Makefile.mib, mibs/ianalist, mibs/rfclist:
+
+ Update for currently released RFC MIBS
+
+2008-02-26 20:45 nba
+
+ * mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt,
+ mibs/IANA-LANGUAGE-MIB.txt, mibs/IANA-RTPROTO-MIB.txt,
+ mibs/IANAifType-MIB.txt:
+
+ Update IANA MIBS to current version
+
+2008-02-25 22:21 tanders
+
+ * agent/mibgroup/util_funcs.h:
+
+ add missing #include<pthread.h> for pthread_mutex_t
+
+2008-02-25 22:06 tanders
+
+ * agent/mibgroup/Rmon/alarmTable.c:
+
+ a better portability fix
+
+2008-02-23 00:59 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h,
+
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h,
+ include/net-snmp/data_access/ipaddress.h:
+
+ NEWS: snmpd: PATCH: 1705594: from c_varun: Fix various aspects of
+ linux ipAddressPrefixTable reporting.
+
+2008-02-22 23:52 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface.c:
+
+ CHANGES: snmpd: PATCH: 1896118: patch from jsafranek: fix ifTable
+ 32bit counters on linux
+
+2008-02-22 23:49 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c:
+
+ patch from jsafranek: Create ipv6ScopeZoneEntry only for
+ link-local addresses and only once per interface.
+
+2008-02-22 23:44 hardaker
+
+ * snmplib/parse.c:
+
+ CHANGES: libsnmp: PATCH: 1898204: from Mike Wescott: fix bug
+ 1898198 in parse.c to avoid a segfault when parsing broken mibs.
+
+2008-02-18 12:11 dts12
+
+ * man/mib_api.3.def:
+
+ Clarify the need to reset buffer length when calling 'read_objid'
+ repeatedly.
+
+2008-02-18 10:32 tanders
+
+ * agent/mibgroup/Rmon/alarmTable.c:
+
+ portability fix
+
+2008-02-18 07:39 tanders
+
+ * agent/mibgroup/Rmon/alarmTable.c:
+
+ make sure that netsnmp_iquery_user_session et al. are properly
+ declared
+
+2008-02-17 18:01 tanders
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ fix typo in variable name
+
+2008-02-17 08:38 tanders
+
+ * agent/agent_registry.c:
+
+ portability fix
+
+2008-02-15 17:45 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ lowered failure message to insert to debug; removed CVS ID from
+ top of line
+
+2008-02-15 17:39 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ don't insert empty entries
+
+2008-02-15 17:31 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ patch from jsafrane on irc: make ipv6 entries work on 64 bit
+ machines
+
+2008-02-15 16:24 hardaker
+
+ * dist/makerelease.xml:
+
+ pass 1 at a new makerelease script; currently just converted code
+ mostly
+
+2008-02-15 16:22 hardaker
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ remove linux checks
+
+2008-02-15 15:45 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ remove references to RDA_RTA
+
+2008-02-15 15:37 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ don't compile in the ipv6 code if NDA_RTA isn't defined
+
+2008-02-15 13:00 tanders
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ portability fix
+
+2008-02-15 06:19 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ minor bug update from c_varun
+
+2008-02-15 05:13 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c,
+ configure, configure.in:
+
+ NEWS: snmpd: PATCH: 1704105: from c_varun: Add IPv6 support to
+ the inetNetToMediaTable for linux
+
+2008-02-15 05:12 hardaker
+
+ * agent/mibgroup/ip-mib.h:
+
+ require new ipv6ScopeZoneIndexTable table
+
+2008-02-15 05:00 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/ipv6scopezone.h,
+ agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c,
+ agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h,
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h,
+
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h,
+ include/net-snmp/data_access/scopezone.h:
+
+ NEWS: snmpd: PATCH: 1715405: from c_varun: Implement the
+ ipv6ScopeZoneIndexTable on linux
+
+2008-02-15 04:39 hardaker
+
+ * agent/snmpd.c:
+
+ CHANGES: snmpd: PATCH: 1716548: from myamato: Fix help output so
+ no space is printed between -D and arguments.
+
+2008-02-15 04:27 hardaker
+
+ * agent/mibgroup/Rmon.h, agent/mibgroup/Rmon/alarmTable.c,
+ agent/mibgroup/Rmon/alarmTable.h:
+
+ NEWS: snmpd: PATCH: 1723611: from Emi Yanagi: New implementation
+ of the rmon alarmTable
+
+2008-02-15 03:44 hardaker
+
+ * agent/agent_registry.c:
+
+ NEWS: snmpd: PATCH: 1893468: from gkoenig: fixed registration of
+ OIDs with ranges
+
+2008-02-14 21:40 tanders
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ fix typo in variable declaration (unbreaks the build on a few
+ systems)
+
+2008-02-14 00:29 hardaker
+
+ * COPYING:
+
+ year update for sparta
+
+2008-02-13 23:37 magfr
+
+ * include/net-snmp/library/container.h, snmplib/container.c:
+
+ NEWS: snmplib: Change CONTAINER_INSERT to not do partial inserts
+ in containers with multiple indices when one insert fails.
+
+2008-02-13 23:11 hardaker
+
+ * snmplib/snmpusm.c:
+
+ Fixed the createUser line to specify the -e flag (responding to a
+ complaint about it be missing)
+
+2008-02-13 17:42 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ NEWS: snmpd: PATCH: 1779558: from brumbs: Implement the
+ diskIOLA1,5,10 objections in the diskio-mib under linux
+
+2008-02-13 17:15 hardaker
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ CHANGES: snmpd: PATCH: 1783733: Put the package version number
+ into the hrSWInst table for solaris.
+
+2008-02-13 16:58 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ CHANGES: snmpd: PATCH: 1783423: from jsafranek: return a correct
+ ipv6InterfaceIdentifier of loopback on linux
+
+2008-02-13 16:12 hardaker
+
+ * agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c:
+
+ CHANGES: snmpd: PATCH: 1784747: from jsafranek: Fix long usage
+ for ip adresses on 64 bit systems in various MIB-II tables.
+
+2008-02-13 16:07 hardaker
+
+ * agent/agent_trap.c, agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ include/net-snmp/agent/agent_trap.h:
+
+ NEWS: snmpd: PATCH: 1806501: from jmagder: Add a snmp_v3trap
+ function for sending traps with a snmpv3 context
+
+2008-02-13 16:02 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ include/net-snmp/library/tools.h:
+
+ CHANGES: snmpd: PATCH: 1826102: from jsafranek: support longer
+ interface names on linux
+
+2008-02-12 23:23 hardaker
+
+ * snmplib/mib.c:
+
+ CHANGES: libsnmp: PATCH: 1807489: fix ignoring of display hints.
+
+2008-02-12 23:19 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+
+
+2008-02-12 23:16 hardaker
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ CHANGES: snmpd: patch 1823465 from jsafranek: fix icmp cache
+ registration
+
+2008-02-12 22:16 hardaker
+
+ * README.agent-mibs,
+ agent/mibgroup/ip-mib/data_access/scalars_linux.c,
+ agent/mibgroup/ip-mib/ip_scalars.c:
+
+ NEWS: snmpd: PATCH: 1828602: from tgohad: Support ipDefaultTTL
+ and ipForwarding SETs on linux
+
+2008-02-12 22:09 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ CHANGES: snmpd: PATCH: 1866823: from jsafranek: truncate 32 bit
+ counter values on 64 bit machines to avoid bogus warnings.
+
+2008-02-12 19:05 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ CHANGES: snmpd: PATCH: 1849903: from jsafranek: do not spam log
+ with asserts when XEN is used
+
+2008-02-12 18:50 hardaker
+
+ * snmplib/callback.c:
+
+ CHANGES: libsnmp: PATCH: 1875022: from sem_prg: improve callback
+ locking mechanisms
+
+2008-02-12 17:40 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory_freebsd2.c:
+
+ CHANGES: snmpd: PATCH: 1879261: from amesbury: Add in inactive
+ memory to the cached report for freebsd
+
+2008-02-12 15:32 hardaker
+
+ * include/net-snmp/library/snmpv3.h, snmplib/snmpv3.c:
+
+ NEWS: libsnmp: Patch: 1882069: from nschrenk: Add a exactEngineID
+ token for specifying an exact SNMPv3 engineID to use
+
+2008-02-12 15:18 hardaker
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ minor cleanups from reviewing parts of the code
+
+2008-02-12 15:17 hardaker
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ NEWS: snmpd: PATCH: 1882621: from jsafranek: Add LVM support to
+ the partition table
+
+2008-02-11 22:26 hardaker
+
+ * configure, configure.in:
+
+ fix quoted strings in help output
+
+2008-01-30 17:29 hardaker
+
+ * configure, configure.in:
+
+ added vacm_conf to existing configure files (for trapd too)
+
+2008-01-20 07:55 tanders
+
+ * configure, configure.in:
+
+ CHANGES: build: BUG: 1872266: PERLCC check fails for CC with
+ options
+
+2008-01-17 01:13 hardaker
+
+ * agent/mibgroup/default_modules.h:
+
+ fix default mibs to include vacm_conf too
+
+2008-01-17 00:09 magfr
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ CHANGES: snmpd: PATCH: 1826088: from Jan Safranek: Use the right
+ interface t read the netmask
+
+2008-01-16 21:54 magfr
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: Handle device names with embedded spaces in
+ UCD-SNMP-MIB::dskDevice
+
+2008-01-16 00:47 magfr
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: PATCH: 1828839: from jsafranek to provide better
+ handling of disks mounted on paths with embedded spaces
+
+2008-01-15 16:47 hardaker
+
+ * snmplib/default_store.c:
+
+ coverity bug 205: double check pointer that should never be null
+
+2008-01-14 23:55 magfr
+
+ * README.agent-mibs, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib.h,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/system_mib.h,
+ agent/mibgroup/mibII/updates.c, agent/mibgroup/mibII/updates.h:
+
+ Update the snmp and system mibs to be handler based
+
+2008-01-13 00:00 magfr
+
+ * Makefile.in, configure, configure.in, dist/RELEASE-INSTRUCTIONS,
+ doxygen.conf, local/Version-Munge.pl, sedscript.in,
+ snmplib/snmp_version.c:
+
+ Lessen the number of places that need to be changed in order to
+ do a release.
+ Change to use the configure version number as the package version
+ number.
+
+2008-01-09 21:58 magfr
+
+ * snmplib/container_binary_array.c:
+
+ Delete unused static functions
+
+2008-01-06 13:01 magfr
+
+ * snmplib/snmp_client.c:
+
+ Make error_string private and readonly
+
+2007-12-22 19:22 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: BUG: 1826174: Check for buffer overflow when
+ printing values.
+
+2007-12-21 23:19 dts12
+
+ * perl/SNMP/SNMP.pm:
+
+ CHANGES: perl: BUG: 1747733: More robust handling of undefined
+ values.
+ Patch supplied by Matti Linnanvuori
+
+2007-12-21 21:33 dts12
+
+ * agent/mibgroup/host/hr_filesys.c, agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: BUG: 1748206: Protect against failures to open
+ /etc/mtab (or equiv)
+
+2007-12-21 18:42 dts12
+
+ * net-snmp-config.in:
+
+ Bring order of agent library linking into line with agent
+ Makefile.
+ Problem reported by Steve McCarthy.
+ Qn: Should 5.2.x and 5.3.x also use the same order?
+ (for both agent Makefile and net-snmp-config)
+
+2007-12-21 13:11 dts12
+
+ * apps/snmptrapd_log.c:
+
+ CHANGES: build: BUG: 1802833: Ensure snmptrapd builds with
+ --disable-snmpv1/2c
+
+2007-12-20 16:26 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: BUG: 1834539: Consistent handling of OID parsing.
+ Applies patch #1834983, provided by Dmitry Karasik
+
+2007-12-20 16:05 dts12
+
+ * snmplib/snmp_client.c:
+
+ More internal query debugging output.
+
+2007-12-20 14:20 dts12
+
+ * agent/helpers/watcher.c:
+
+ CHANGES: snmpd: BUG: 1822360: Fix spinlock helper error handling.
+
+2007-12-20 14:18 dts12
+
+ * snmplib/asn1.c:
+
+ CHANGES: snmplib: BUG: 1795840: Signed 32-bit truncation logged
+ as debug message rather then error.
+
+2007-12-20 14:14 dts12
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ CHANGES: snmpd: BUG: 1792890: include CIFS mounts when skipping
+ remote filesystems
+
+2007-12-20 14:12 dts12
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ CHANGES: snmpd: BUG: 1771221: Retain ifLastChange information on
+ data reload.
+
+2007-12-20 14:08 dts12
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ CHANGES: snmpd: BUG: 1758212: Handling missing variable types
+ (IpAddress,Counter,Opaque)
+
+2007-12-19 22:39 magfr
+
+ * snmplib/container.c, snmplib/container_iterator.c,
+ snmplib/container_null.c, snmplib/data_list.c,
+ snmplib/read_config.c:
+
+ Correct doxygen warnings
+
+2007-12-19 22:31 magfr
+
+ * testing/tests/Sv3vacmconfig, testing/tests/T001snmpv1get,
+ testing/tests/T014snmpv2cget, testing/tests/T015snmpv2cgetnext,
+ testing/tests/T0160snmpv2cbulkget,
+ testing/tests/T016snmpv2cgetfail,
+ testing/tests/T017snmpv2ctov1getfail,
+ testing/tests/T018snmpv1tov2cgetfail,
+ testing/tests/T019snmpv2cnosuch, testing/tests/T022snmpv3getMD5,
+ testing/tests/T023snmpv3getMD5AES,
+ testing/tests/T023snmpv3getMD5DES,
+ testing/tests/T025snmpv3getSHADES,
+ testing/tests/T030snmpv3usercreation,
+ testing/tests/T051snmpv2ctrap, testing/tests/T052snmpv2cinform,
+ testing/tests/T058agentauthtrap,
+ testing/tests/T059trapdtraphandle, testing/tests/T060trapdperl,
+ testing/tests/T061agentperl, testing/tests/T065agentextend,
+ testing/tests/T100agenthup, testing/tests/T115agentxperl,
+ testing/tests/T120proxyget, testing/tests/T121proxyset,
+ testing/tests/T122proxysetfail, testing/tests/T130snmpv1vacmget,
+ testing/tests/T131snmpv2cvacmget,
+ testing/tests/T140snmpv1vacmgetfail,
+ testing/tests/T141snmpv2cvacmgetfail,
+ testing/tests/T150solarishostcpu,
+ testing/tests/T151solarishostdisk, testing/tests/T152hostuptime,
+ testing/tests/T153solarisswap, testing/tests/T160snmpnetstat,
+ testing/tests/T200snmpv2cwalkall:
+
+ Use NETSNMP_-prefixed symbols when deciding what tests to run as
+ the compat symbols aren't defined.
+
+2007-12-19 22:06 magfr
+
+ * snmplib/snmp_api.c:
+
+ BUG 1831568: strdup might fail and return NULL - take care of it
+ in this case at least.
+
+2007-12-19 21:49 magfr
+
+ * agent/mibgroup/utilities/override.c, snmplib/snmp_api.c:
+
+ BUG 1824883: Remove memory leak
+
+2007-12-19 20:46 magfr
+
+ * agent/helpers/watcher.c:
+
+ CHANGES: BUG: 1851047: Do not try to do more handling of a value
+ once it is found to be corrupt by the watcher helper, thus
+ avoiding code that counts on getting the right type. This bug was
+ found by Charlie Miller, Independent Security Evaluators.
+
+2007-11-27 09:56 dts12
+
+ * man/snmptrapd.8.def:
+
+ Clarify use of the -A (log append) option.
+
+2007-11-22 15:42 rstory
+
+ * agent/mibgroup/agent/nsCache.c, agent/mibgroup/agent/nsDebug.c:
+
+ check request, not requests. reported by ulim on irc
+
+2007-11-22 15:17 rstory
+
+ * agent/mibgroup/agent/nsLogging.c:
+
+ check request, not requests. reported by ulim on irc
+
+2007-11-19 21:34 tanders
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ CHANGES: Solaris: PATCH: 1834699: from apersson: Fix 1833294:
+ DLPI problems on Solaris 2.6
+
+2007-11-17 16:26 magfr
+
+ * agent/helpers/instance.c, configure, configure.in,
+ include/net-snmp/agent/instance.h,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmpd: Use the worker helpers from the
+ register_*_instance helpers and schedule the instance helpers for
+ removal in 5.6
+
+2007-11-14 12:21 dts12
+
+ * agent/mibgroup/hardware/sensors/lmsensors_v3.c,
+ agent/mibgroup/hardware/sensors/lmsensors_v3.h:
+
+ Support v3 lmsensors API.
+
+2007-11-14 12:19 dts12
+
+ * agent/mibgroup/hardware/sensors/hw_sensors.c:
+
+ Fix misleading debug output message.
+
+2007-11-13 13:59 dts12
+
+ * agent/mibgroup/hardware/sensors,
+ agent/mibgroup/hardware/sensors.h,
+ agent/mibgroup/hardware/sensors/dummy_sensors.c,
+ agent/mibgroup/hardware/sensors/dummy_sensors.h,
+ agent/mibgroup/hardware/sensors/hw_sensors.c,
+ agent/mibgroup/hardware/sensors/hw_sensors.h,
+ agent/mibgroup/hardware/sensors/kstat_sensors.c,
+ agent/mibgroup/hardware/sensors/kstat_sensors.h,
+ agent/mibgroup/hardware/sensors/lmsensors_v2.c,
+ agent/mibgroup/hardware/sensors/lmsensors_v2.h,
+ agent/mibgroup/hardware/sensors/picld_sensors.c,
+ agent/mibgroup/hardware/sensors/picld_sensors.h,
+ agent/mibgroup/ucd-snmp/lmsensorsMib.c,
+ agent/mibgroup/ucd-snmp/lmsensorsMib.h, configure, configure.in,
+ include/net-snmp/agent/hardware/sensors.h:
+
+ Preliminary re-working of the LM-SENSORS-MIB, to separate out
+ the sensor hardware processing from the MIB tables themselves.
+
+2007-11-08 23:17 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/kernel_sunos5.c, agent/mibgroup/kernel_sunos5.h,
+ agent/mibgroup/mibII/interfaces.c:
+
+ CHANGES: Solaris: PATCH: 1824196: {ifOperStatus,ipAdEntIfIndex}
+ reported incorrectly
+ Patch supplied by Anders Persson. Fixes Bugs 1822275 and 1819189.
+
+2007-10-26 21:22 magfr
+
+ * agent/helpers/watcher.c, agent/mibgroup/examples/watched.c,
+ include/net-snmp/agent/watcher.h:
+
+ NEWS: snmpd: Added support for a user provided length variable
+ and C string values to the watcher helper.
+
+2007-10-16 22:39 magfr
+
+ * agent/agent_trap.c, agent/helpers/debug_handler.c,
+ agent/helpers/table_iterator.c, agent/helpers/table_tdata.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/expr/expErrorTable.c,
+ agent/mibgroup/disman/expr/expExpression.c,
+ agent/mibgroup/disman/expr/expExpressionTable.c,
+ agent/mibgroup/disman/expr/expObject.c,
+ agent/mibgroup/disman/expr/expObjectTable.c,
+ agent/mibgroup/disman/expr/expValueTable.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ apps/snmptrapd_handlers.c, snmplib/default_store.c,
+ snmplib/snmpSTDDomain.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmp_client.c:
+
+ Use %p to print pointers. Do not use %p to print numbers.
+
+2007-10-16 07:31 magfr
+
+ * snmplib/snmp_api.c:
+
+ Make the library buildable as C again.
+
+2007-10-16 07:17 magfr
+
+ * agent/helpers/instance.c, agent/helpers/scalar.c,
+ agent/helpers/watcher.c, agent/mibgroup/examples/example.c,
+ agent/mibgroup/smux/smux.c:
+
+ CHANGES: misc: avoid calling debug macros with too many
+ arguments.
+
+2007-10-16 06:18 magfr
+
+ * snmplib/snmp_api.c, snmplib/snmp_service.c,
+ snmplib/snmp_transport.c:
+
+ Make the library buildable as C++ again.
+
+2007-10-15 20:52 rstory
+
+ * include/net-snmp/library/container_binary_array.h,
+ snmplib/dir_utils.c:
+
+ declare netsnmp_binary_array_options_set; include header for it
+ as needed
+
+2007-10-15 20:39 magfr
+
+ * agent/mibgroup/disman/expr/expValueTable.c:
+
+ Convert an infinite loop to a finite one.
+ Remove an unused variable.
+
+2007-10-14 22:10 magfr
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/scalars_linux.c,
+ agent/mibgroup/smux/smux.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_common.c:
+
+ CHANGES: misc: Avoid calling debug macros with too few arguments.
+
+2007-10-14 20:51 tanders
+
+ * snmplib/read_config.c:
+
+ CHANGES: snmplib: PATCH: 1811469: read_config_files_in_path()
+ reads past malloc'd buffer
+
+2007-10-14 20:41 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: PATCH: 1811463: perl async callback coredump
+ CHANGES: perl: BUG: 1606062: perl bulkwalk (async) coredump
+
+2007-10-14 19:07 tanders
+
+ * snmplib/snmp_logging.c:
+
+ CHANGES: snmplib: PATCH: 1806336: fix -LS option parsing
+
+2007-10-14 12:12 tanders
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ fix comment
+
+2007-10-13 23:28 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ CHANGES: test: enhance snmpnetstat test to check tcpTable in TCP
+ mode
+
+2007-10-13 22:28 tanders
+
+ * agent/mibgroup/mibII/tcpTable.c,
+ include/net-snmp/system/solaris.h:
+
+ CHANGES: Solaris: BUG: 1810814: tcpTable missing entries and
+ wrong ports
+
+2007-10-12 21:46 tanders
+
+ * include/net-snmp/system/solaris.h:
+
+ CHANGES: Solaris: #define NEW_MIB_COMPLIANT to support Solaris
+ 10U4+
+
+2007-10-11 20:46 magfr
+
+ * snmplib/snmpUDPDomain.c:
+
+ CHANGES: snmplib: Do not leak memory whenever an udp address is
+ formatted.
+
+2007-10-03 01:02 alex_b
+
+ * win32/dist/README.build.win32.txt, win32/dist/README.txt,
+ win32/dist/installer/Add2Path.nsi,
+ win32/dist/installer/net-snmp.nsi:
+
+ -Fix for bug 1768797. NSIS Installer script now warns the user if
+ the PATH
+ is > 1024 as NSIS can not handle variables larger than 1024.
+ -Updates to build instructions.
+
+2007-09-30 20:59 magfr
+
+ * agent/mibgroup/agentx/agentx_config.c,
+ include/net-snmp/library/snmp_service.h, snmplib/snmp_api.c,
+ snmplib/snmp_service.c, snmplib/snmp_transport.c:
+
+ CHANGES: BUG: 1801835: Added the ability to have multiple default
+ transports for an application. On open the different transports
+ will be tried in order. As a consequence snmp and snmptrap now
+ will try first udp and then udp6 and agentx wil try first unix
+ and then tcp.
+
+2007-09-29 13:10 magfr
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ CHANGES: snmplib: Do not try to look up empty strings as
+ hostnames for IPv6
+ Additinally, print what string filed to resolve using getaddrinfo
+ for IPv6
+
+2007-09-29 06:26 tanders
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c:
+
+ CHANGES: snmpd: PATCH: 1804445: from apersson: High order bits of
+ HCInOctets not set on Solaris
+
+2007-09-24 20:43 hardaker
+
+ * COPYING:
+
+ year update
+
+2007-09-23 06:03 tanders
+
+ * snmplib/dir_utils.c:
+
+ fix #elif
+
+2007-09-21 22:04 tanders
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in,
+ snmplib/dir_utils.c:
+
+ CHANGES: snmplib: attempt to fix build for Solaris/AIX/HP-UX
+ broken by r16684
+
+2007-09-20 21:55 tanders
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ CHANGES: snmpd: PATCH: 1746831: from cunnijd: fix process
+ checking race
+ condition under Linux and platform #ifdefs
+
+2007-09-19 21:09 tanders
+
+ * snmplib/snmpUDPDomain.c:
+
+ CHANGES: snmplib: BUG: Coverity #183: fix memory leak if
+ IP_PKTINFO fails
+
+2007-09-19 19:57 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Fix misnumberings of steps.
+ It is *so* difficult to find properly numerate staff these
+ days....
+
+2007-09-16 09:51 magfr
+
+ * local/mib2c-update:
+
+ Remove bashisms. This is netbsd patch-et from bug 1745404.
+
+2007-09-16 09:45 magfr
+
+ * agent/mibgroup/host/hr_device.c:
+
+ Use const char* for temporary constant string variable. This is
+ netbsd patch-ea from bug 1745404.
+
+2007-09-16 09:40 magfr
+
+ * snmplib/snmp_api.c:
+
+ Use the natural type of in_addr_t's for comparisions. This is
+ netbsd patch-ea from bug 1745404.
+
+2007-09-16 07:06 magfr
+
+ * agent/mibgroup/agentx/master.c:
+
+ CHANGES: BUG: 1793545: Take the name from the sockaddr_un in
+ order to avoid transport specifiers and other decorations.
+
+2007-09-14 13:18 rstory
+
+ * include/net-snmp/data_access/swrun.h:
+
+ Apple patches
+ - header for swrun rewrite
+
+2007-09-14 13:16 rstory
+
+ * include/net-snmp/system/darwin9.h:
+
+ Apple patches
+ - add utility macro
+ - activate new host resource rewrites
+
+2007-09-14 13:13 rstory
+
+ * agent/mibgroup/host.h:
+
+ Apple patches
+ - config_require for new rewrites, if enabled
+
+2007-09-14 13:11 rstory
+
+ * agent/mibgroup/host/hr_disk.c, agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_partition.c:
+
+ Apple patches
+ - add/fix disk/partition tables on darwin
+
+2007-09-14 13:09 rstory
+
+ * agent/mibgroup/host/data_access/swinst.c,
+ agent/mibgroup/host/data_access/swinst.h,
+ agent/mibgroup/host/data_access/swinst_darwin.c,
+ agent/mibgroup/host/hrSWInstalledTable.c,
+ agent/mibgroup/host/hrSWInstalledTable.h,
+ include/net-snmp/data_access/swinst.h:
+
+ Apple patches
+ - add hrSWInstalledTable for darwin
+
+2007-09-14 08:44 dts12
+
+ * dist/makerelease:
+
+ Protect against unexpected command arguments.
+
+2007-09-14 08:00 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Document use of "svn export" rather than "svn checkout".
+ Cover generation of the zip archive as well as the tarball.
+
+2007-09-13 21:25 tanders
+
+ * README:
+
+ drop obsolete mirrors
+
+2007-09-13 17:29 rstory
+
+ * agent/mibgroup/host/data_access,
+ agent/mibgroup/host/data_access/swrun.c,
+ agent/mibgroup/host/data_access/swrun.h,
+ agent/mibgroup/host/data_access/swrun_darwin.c,
+ agent/mibgroup/host/hrSWRunPerfTable.c,
+ agent/mibgroup/host/hrSWRunPerfTable.h,
+ agent/mibgroup/host/hrSWRunTable.c,
+ agent/mibgroup/host/hrSWRunTable.h:
+
+ Apple patches
+ - host resources SWRun and SWRunPerf Table for darwin9
+
+2007-09-13 17:22 rstory
+
+ * agent/helpers/table.c, include/net-snmp/agent/table.h:
+
+ Apple patches
+ - improve error handling and cleanup in registration functions
+
+2007-09-13 17:19 rstory
+
+ * snmplib/system.c:
+
+ Apple patches
+ - for darwin9, rexec after fork to avoid problems with some mach
+ calls
+
+2007-09-12 18:51 rstory
+
+ * include/net-snmp/library/dir_utils.h, snmplib/Makefile.in,
+ snmplib/dir_utils.c:
+
+ Apple patches
+ - new utility function to read a directory hierarcy into a
+ container
+
+2007-09-12 17:55 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c:
+
+ Apple patches
+ - new string compare callback
+
+2007-09-12 17:53 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ Apple patches
+ - new netsnmp_cache_free function
+
+2007-09-12 17:46 rstory
+
+ * snmplib/snmpUDPDomain.c:
+
+ add missing newline in debug msg
+
+2007-09-12 17:42 rstory
+
+ * local/mib2c.container.conf:
+
+ Patches from Apple
+ - add optional cache
+ - check/handle errors for all functions in init func
+ - typedef generated struct
+ - skip processed requests
+ - check for null when extracting row
+
+2007-09-12 17:35 rstory
+
+ * COPYING:
+
+ add new copyright/contributor
+
+2007-09-05 20:12 magfr
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ Combine system_parse_config_sys{loc,con,name} into one function
+ since they all do the same thing
+
+2007-08-25 14:24 magfr
+
+ * agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/notification-log-mib/notification_log.h:
+
+ Make most of notification_log static. Minimize the header file.
+
+2007-08-22 21:56 tanders
+
+ * agent/agent_registry.c:
+
+ NEWS: agent: suppress annoying "registration != duplicate"
+ warning for root oids
+ (otherwise, you'll get this message on almost every startup)
+
+2007-08-20 08:06 tanders
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ NEWS: snmplib: fix potential buffer overflow in sprintf for
+ UDP/IPv6
+
+2007-08-17 09:10 dts12
+
+ * FAQ:
+
+ Subversion, not CVS.
+
+2007-08-17 08:59 dts12
+
+ * FAQ:
+
+ Clarify handling of unknown communities
+
+2007-08-16 15:36 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Don't just report the problem - it might be sensible to avoid
+ crashing the agent as well!
+
+2007-08-16 15:35 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ CHANGES: snmpd: PATCH: 1744157: Report duplicate "extend/exec"
+ identifiers.
+
+2007-08-16 15:24 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c, apps/snmptrapd_ds.h:
+
+ CHANGES: snmptrapd: PATCH: 1746992: Improve snmptrapd
+ access-control error messages.
+
+2007-08-16 14:12 dts12
+
+ * agent/mibgroup/util_funcs.c:
+
+ CHANGES: snmpd: PATCH: 1752934: Fix off-by-one qsort error in
+ table utilities.
+
+2007-08-16 13:31 dts12
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: PATCH: 1753437: Fix error index on failing SET
+ requests
+
+2007-08-16 13:25 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ CHANGES: snmpd: PATCH: 1753449: Fix AgentX error propagation
+
+2007-08-16 12:34 dts12
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: snmpd: PATCH: 1753463: Fix AgentX subagent ping alarm
+ handling
+
+2007-08-16 12:13 dts12
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ CHANGES: snmpd: PATCH: 1758208: Fix memory leak
+
+2007-08-16 12:03 dts12
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ CHANGES: snmpd: PATCH: 1774612: More resilient process status
+ handling
+
+2007-08-16 11:58 dts12
+
+ * snmplib/snmpUDPDomain.c:
+
+ CHANGES: snmplib: PATCH: 1775124: Fix clientaddr functionality
+
+2007-08-16 09:38 dts12
+
+ * snmplib/parse.c:
+
+ CHANGES: snmplib: PATCH: 1768285: Count MIB files correctly in
+ add_mibdir()
+
+2007-08-16 09:35 dts12
+
+ * apps/snmptrapd.c:
+
+ CHANGES: snmptrapd: PATCH: 1767725: Close all non standard file
+ handles
+
+2007-08-16 09:00 dts12
+
+ * agent/mibgroup/disman/expr/expValue.c:
+
+ Declare initialisation routine correctly, and omit unused
+ variables.
+ Patch from Magnus Fromreide.
+
+2007-08-16 08:55 dts12
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ Read in agent configuration settings *before* the header
+ files that might rely on them.
+
+2007-08-05 16:16 alex_b
+
+ * win32/dist/README.build.win32.txt, win32/dist/README.txt:
+
+ Change win32 build readme files to CRLF.
+
+2007-08-05 14:16 alex_b
+
+ * win32/dist/README.build.win32.txt:
+
+ Win32: Change build docs to use dynamic (DLL) instead of static.
+
+2007-08-02 13:46 dts12
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ It might be slightly less confusing if the netSnmpExampleString
+ MIB object did actually take string values. Picky, I know....
+
+2007-07-28 13:02 rstory
+
+ * dist/svnup:
+
+ fix tag extraction; check for empty tag earlier
+
+2007-07-25 22:41 tanders
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ CHANGES: snmpd: BUG: 1760633: fix typo in debug message
+
+2007-07-21 21:36 tanders
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: fix forwarding encoding
+
+2007-07-20 08:21 dts12
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Tweak warning message for (old-style, invalid format) "exec OID"
+ directives.
+
+2007-07-16 23:59 hardaker
+
+ * agent/agent_registry.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c,
+ snmplib/data_list.c:
+
+ Apply (correct) patch from Marcus Rueckert to remove asserts
+ using sort-o-illegal C string compares
+
+2007-07-16 23:59 hardaker
+
+ * agent/agent_registry.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c,
+ snmplib/data_list.c:
+
+ Remove previous patch which was the wrong version
+
+2007-07-16 23:57 hardaker
+
+ * agent/agent_registry.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c,
+ snmplib/data_list.c:
+
+ Apply patch from Marcus Rueckert to remove asserts using
+ sort-o-illegal C string compares
+
+2007-07-13 19:27 hardaker
+
+ * dist/makerelease:
+
+ generate zip files
+
+2007-07-12 21:51 tanders
+
+ * perl/agent/agent.pm:
+
+ fix subagent example (documentation)
+
+2007-07-12 21:27 tanders
+
+ * man/snmp_sess_api.3.def:
+
+ snmp_sess_read returns int, not void
+
+2007-07-06 23:39 hardaker
+
+ * Makefile.rules, Makefile.top:
+
+ CHANGES: build: use libtool clean for removing files to ensure we
+ delete all libtool temporary files.
+
+2007-07-06 23:34 hardaker
+
+ * dist/patme:
+
+ use a recursive revert instead of rm/update; remove double / from
+ editing calls
+
+2007-07-06 21:22 rstory
+
+ * snmplib/read_config.c:
+
+ stop searching paths when done
+
+2007-07-06 21:14 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ do not free interface entry just because we can not get stats for
+ it
+
+2007-07-06 15:32 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ CHANGES: snmpd: BUG 1745113: Handle single-line (and zero-line)
+ output in UCD compatability mode.
+
+2007-07-06 09:08 dts12
+
+ * configure, configure.in, snmplib/snmp_client.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: library: PATCH 1728247: from Mitsuru Chinen: cleans up
+ the int64 type checking and usage for building packets especially
+ under MSVC.
+
+2007-07-05 14:45 rstory
+
+ * ., README.osX:
+
+ r20044@dhcp211: rstory | 2007-07-05 10:44:01 -0400
+ remove disable-static from recommended options
+
+2007-07-05 11:05 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ skip stats parsing on interfaces with no statistics
+
+2007-07-05 11:01 rstory
+
+ * dist/check-api-change:
+
+ check for dir existence
+
+2007-07-04 23:26 tanders
+
+ * agent/Makefile.in, apps/Makefile.in:
+
+ CHANGES: perl: install embedded perl init files for
+ snmpd/snmptrapd with mode 644 instead of 755
+
+2007-07-04 21:42 tanders
+
+ * README.osX:
+
+ Perl problems (believed to be) fixed
+
+2007-07-03 12:56 tanders
+
+ * perl/agent/Support/Support.pm:
+
+ remove executable flag from SVN properties
+
+2007-07-02 06:53 magfr
+
+ * apps/snmptrapd.c, apps/snmpvacm.c:
+
+ Remove unused oid declarations
+
+2007-07-02 06:02 magfr
+
+ * agent/mibgroup/disman/event/mteEvent.c:
+
+ Add missing return value to _mteEvent_fire_notify.
+
+2007-07-02 05:31 magfr
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_common.c:
+
+ Remove the declaration of an undefined static function.
+
+2007-07-01 20:32 tanders
+
+ * dist/nsb-nightly, dist/nsb-package:
+
+ make getopts work on Tru64 by respawning in Posix mode
+
+2007-07-01 19:56 tanders
+
+ * agent/Makefile.in, apps/Makefile.in, configure, configure.in,
+ net-snmp-config.in:
+
+ CHANGES: build: --disable-as-needed now allows to revert to the
+ former default behaviour of linking libperl to applications
+ rather than Net-SNMP Libraries (in case of any problems)
+
+2007-06-30 06:17 hardaker
+
+ * dist/makerelease:
+
+ actually call removefiles
+
+2007-06-28 23:50 magfr
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ NEWS: snmplib: Added GCC format checking attributes to the debug
+ functions.
+
+2007-06-28 23:37 magfr
+
+ * agent/mibgroup/host/hr_disk.c, agent/mibgroup/host/hr_system.c:
+
+ Remove casts of unused values
+
+2007-06-28 23:36 magfr
+
+ * agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/host/hr_storage.c:
+
+ Remove unused variables
+
+2007-06-28 22:09 tanders
+
+ * net-snmp-config.in:
+
+ rename last occurence of DEFAULT_MIB[DIR]S to
+ NETSNMP_DEFAULT_MIB[DIR]S
+
+2007-06-28 08:15 magfr
+
+ * apps/snmptrapd_handlers.c:
+
+ Do not transform the ignored result of realloc_format_trap
+
+2007-06-26 22:12 tanders
+
+ * apps/Makefile.in:
+
+ CHANGES: build: work around libnetsnmpagent/libnetsnmphelpers
+ dependency issues when linking snmptrapd
+
+2007-06-26 21:45 tanders
+
+ * agent/Makefile.in, agent/helpers/Makefile.in:
+
+ CHANGES: build: use LDFLAGS when building agent, helpers and mib
+ lib to be consistent with libnetnmp
+
+2007-06-26 21:28 tanders
+
+ * INSTALL:
+
+ minor updates
+
+2007-06-26 15:10 rstory
+
+ * apps/snmptrapd.c, apps/snmptrapd_handlers.c:
+
+ don't initialize var in extern decl; instead, initialize actual
+ var
+
+2007-06-25 21:29 tanders
+
+ * aclocal.m4, config.guess, config.sub, configure, ltmain.sh:
+
+ NEWS: build: update to libtool 1.5.24 (from 1.5.22)
+
+2007-06-24 12:57 tanders
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ HAVE_SSIZE_T cleanup
+
+2007-06-23 22:56 tanders
+
+ * README.hpux11:
+
+ don't suggest --with-libs=-lnm
+
+2007-06-22 15:05 dts12
+
+ * win32/encode_keychange/encode_keychange.dsp,
+ win32/libagent/libagent.dsp, win32/libhelpers/libhelpers.dsp,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp, win32/libsdll.dsw,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp, win32/snmpd/snmpd.dsp,
+ win32/snmpdelta/snmpdelta.dsp, win32/snmpdf/snmpdf.dsp,
+ win32/snmpdsdk/snmpd.dsp, win32/snmpget/snmpget.dsp,
+ win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpnetstat/snmpnetstat.dsp, win32/snmpset/snmpset.dsp,
+ win32/snmpstatus/snmpstatus.dsp, win32/snmptable/snmptable.dsp,
+ win32/snmptest/snmptest.dsp,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrapd/snmptrapd.dsp,
+ win32/snmpusm/snmpusm.dsp, win32/snmpvacm/snmpvacm.dsp,
+ win32/snmpwalk/snmpwalk.dsp, win32/win32.dsw, win32/win32sdk.dsw:
+
+ Enforce DOS-style line endings, to keep Visual Studio happy.
+
+2007-06-21 14:01 rstory
+
+ * include/net-snmp/system/freebsd.h,
+ include/net-snmp/system/openbsd.h,
+ include/net-snmp/system/solaris.h:
+
+ default to using ifTable rewrites
+
+2007-06-20 21:34 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_openbsd.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c:
+
+ fix typo
+
+2007-06-19 22:23 tanders
+
+ * configure, configure.in:
+
+ fix Perl-related autoconf messages
+
+2007-06-19 15:08 tanders
+
+ * dist/net-snmp.spec:
+
+ CHANGES: build: add "BuildRequires: perl-ExtUtils-Embed" to the
+ spec file, e.g. for Fedora 7
+
+2007-06-18 22:28 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ fix broken comment.
+
+2007-06-18 21:54 hardaker
+
+ * agent/helpers/Makefile.in:
+
+ revert double linking of libnetsmnp part of patch that was
+ supposed to be pulled bofer applying in r16538 (thanks tanders
+ for catching it)
+
+2007-06-18 21:34 hardaker
+
+ * agent/helpers/Makefile.in, apps/Makefile.in, snmplib/Makefile.in:
+
+ CHANGES: build: patch from apple to simplify makefile target
+ references in some rules.
+
+2007-06-18 21:17 hardaker
+
+ * man/snmp_config.5.def, man/snmpget.1.def:
+
+ CHANGES: patch from apple to fix minor documentation bugs.
+
+2007-06-18 21:13 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface.h,
+ include/net-snmp/system/darwin9.h:
+
+
+
+2007-06-18 21:12 hardaker
+
+ * agent/mibgroup/hardware/memory/memory_darwin.c:
+
+ CHANGES: patch from apple to improve memory reporting
+
+2007-06-18 21:09 hardaker
+
+ * include/net-snmp/system/darwin9.h:
+
+ CHANGES: patch from apple to fix cross-compile builds in apples
+ build environment.
+
+2007-06-18 20:54 hardaker
+
+ * snmplib/snmp_parse_args.c:
+
+ CHANGES: patch: 1737085: from jsafranek: fix the -M switch for
+ mib parsing by loading defaults first before performing the set
+ so it does not get overwritten by the defaults later.
+
+2007-06-18 20:50 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ NEWS: perl: patch: 1725049: fix bulkwalk in cases of non-repeater
+ usage.
+
+2007-06-18 14:10 tanders
+
+ * perl/TrapReceiver/Makefile.PL:
+
+ CHANGES: perl: fix prerequisites for NetSNMP::TrapReceiver
+
+2007-06-18 13:39 tanders
+
+ * perl/agent/Support/Support.pm:
+
+ CHANGES: perl: fix syntax error in NetSNMP::agent::Support
+
+2007-06-16 23:01 tanders
+
+ * agent/Makefile.in, apps/Makefile.in, configure, configure.in,
+ net-snmp-config.in:
+
+ NEWS: perl: BUG: 1619827: link libnetsnmpagent/libnetsnmptrapd
+ (rather than snmpd/snmptrapd) against libperl.
+
+2007-06-14 15:41 rstory
+
+ * local/mib2c.conf:
+
+ fix typo in user output, as noted on coders
+
+2007-06-14 15:36 rstory
+
+ * dist/cvsshow:
+
+ use 'svn info' to query for url
+
+2007-06-14 04:37 magfr
+
+ * agent/mibgroup/smux/smux.h:
+
+ Add missing argument type in order to silence a gcc warning
+
+2007-06-13 06:37 magfr
+
+ * configure, configure.in:
+
+ Do not try to be clever in the handing of -lkvm in LAGENTLIBS.
+ Include it if any sought function is in it.
+
+2007-06-11 10:11 tanders
+
+ * README.aix:
+
+ document xlc<->cc_r compiler issues with Perl on AIX (see bug
+ #1600099)
+
+2007-06-10 22:29 tanders
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/types.h:
+
+ CHANGES: build: PATCH: 1728247: from mitsuru_chinen: Add type
+ check for int??_t and uint??_t
+
+2007-06-10 22:22 tanders
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in,
+ snmplib/snmpUDPIPv6Domain.c:
+
+ CHANGES: build: PATCH: 1728244: from mitsuru_chinen: Add
+ configure check for sin6_scope_id
+
+2007-06-10 22:15 tanders
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in,
+ snmplib/snmpUDPDomain.c:
+
+ CHANGES: PATCH: 1728241: from mitsuru_chinen: add configure check
+ for <sys/uio.h> (make sure iov structure is declared)
+
+2007-06-10 06:33 magfr
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Use NETSNMP_SEARCH_LIBS to simplify searching for system specific
+ libraries
+
+2007-06-10 06:26 magfr
+
+ * configure, configure.in:
+
+ Use NETSNMP_SEARCH_LIBS to simplify searching for -lsensors
+
+2007-06-10 06:18 magfr
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Use NETSNMP_SEARCH_LIBS to simplify searching for -ldevstat
+
+2007-06-10 06:13 magfr
+
+ * agent/mibgroup/ucd-snmp/dlmod.c, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Use NETSNMP_SEARCH_LIBS to simplify searching for -ldl
+
+2007-06-09 08:58 magfr
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in,
+ win32/config.h.borland, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Use NETSNMP_SEARCH_LIBS to simplify searching for -lkvm
+
+2007-06-08 20:32 tanders
+
+ * Makefile.in, dist/makerelease:
+
+ Fix regression introduced by r16479: 'make test TESTOPTS="-T
+ tcp"' now
+ works again. makerelease now uses the right option.
+
+2007-06-08 10:46 dts12
+
+ * apps/snmptrapd.c, apps/snmptrapd_handlers.c:
+
+ CHANGES: snmptrapd: FEATURE: 741375: Extend -F flag to cover
+ syslog/execute format strings.
+
+2007-06-08 10:44 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Improve memory handling of style-specific format strings.
+
+2007-06-08 10:33 dts12
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Default to reporting NFS mounts as NetworkDisk.
+
+2007-06-08 06:02 magfr
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Use NETSNMP_SEARCH_LIBS to simplify searching for -lrpm and
+ things it depends
+ on
+
+2007-06-08 05:59 magfr
+
+ * agent/helpers/Makefile.in:
+
+ Add missing \
+
+2007-06-08 05:31 magfr
+
+ * configure, configure.in:
+
+ Use NETSNMP_SEARCH_LIBS to simplify searching for -lkstat
+
+2007-06-08 05:28 magfr
+
+ * acinclude.m4:
+
+ CHANGES: building: Add a variation of AC_SEARCH_LIBS where the
+ result variable is settable.
+
+2007-06-08 05:16 magfr
+
+ * win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Remove the unused undef HAVE_PERL_EVAL_PV.
+ The Perl_eval_pv functions are handled by the
+ HAVE_PERL_EVAL_PV_[UL]C defines,
+ this one is never set by our configure script.
+
+2007-06-07 16:02 dts12
+
+ * .cvsignore, agent/.cvsignore, agent/helpers/.cvsignore,
+ agent/mibgroup/.cvsignore, agent/mibgroup/Rmon/.cvsignore,
+ agent/mibgroup/agent/.cvsignore,
+ agent/mibgroup/agentx/.cvsignore,
+ agent/mibgroup/disman/.cvsignore,
+ agent/mibgroup/disman/event/.cvsignore,
+ agent/mibgroup/disman/expr/.cvsignore,
+ agent/mibgroup/disman/schedule/.cvsignore,
+ agent/mibgroup/examples/.cvsignore,
+ agent/mibgroup/hardware/cpu/.cvsignore,
+ agent/mibgroup/hardware/memory/.cvsignore,
+ agent/mibgroup/host/.cvsignore,
+ agent/mibgroup/if-mib/data_access/.cvsignore,
+ agent/mibgroup/if-mib/ifTable/.cvsignore,
+ agent/mibgroup/if-mib/ifXTable/.cvsignore,
+ agent/mibgroup/ip-forward-mib/data_access/.cvsignore,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/.cvsignore,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/.cvsignore,
+ agent/mibgroup/ip-mib/.cvsignore,
+ agent/mibgroup/ip-mib/data_access/.cvsignore,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/.cvsignore,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/.cvsignore,
+ agent/mibgroup/ip-mib/ipAddressTable/.cvsignore,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/.cvsignore,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/.cvsignore,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/.cvsignore,
+ agent/mibgroup/ipfwchains/.cvsignore,
+ agent/mibgroup/mibII/.cvsignore, agent/mibgroup/misc/.cvsignore,
+ agent/mibgroup/notification-log-mib/.cvsignore,
+ agent/mibgroup/notification/.cvsignore,
+ agent/mibgroup/smux/.cvsignore,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/.cvsignore,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/.cvsignore,
+
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/.cvsignore,
+ agent/mibgroup/snmpv3/.cvsignore,
+ agent/mibgroup/target/.cvsignore,
+ agent/mibgroup/tcp-mib/data_access/.cvsignore,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/.cvsignore,
+ agent/mibgroup/tcp-mib/tcpListenerTable/.cvsignore,
+ agent/mibgroup/ucd-snmp/.cvsignore,
+ agent/mibgroup/udp-mib/data_access/.cvsignore,
+ agent/mibgroup/udp-mib/udpEndpointTable/.cvsignore,
+ agent/mibgroup/utilities/.cvsignore, apps/.cvsignore,
+ apps/snmpnetstat/.cvsignore, dist/.cvsignore,
+ include/net-snmp/.cvsignore, include/net-snmp/agent/.cvsignore,
+ include/net-snmp/library/.cvsignore, include/ucd-snmp/.cvsignore,
+ local/.cvsignore, man/.cvsignore, mibs/.cvsignore,
+ ov/.cvsignore, perl/.cvsignore, perl/ASN/.cvsignore,
+ perl/AnyData_SNMP/.cvsignore, perl/OID/.cvsignore,
+ perl/SNMP/.cvsignore, perl/SNMP/t/.cvsignore,
+ perl/TrapReceiver/.cvsignore, perl/agent/.cvsignore,
+ perl/agent/Support/.cvsignore,
+ perl/agent/default_store/.cvsignore,
+ perl/default_store/.cvsignore, perl/manager/.cvsignore,
+ snmplib/.cvsignore, testing/.cvsignore, win32/.cvsignore,
+ win32/bin/.cvsignore, win32/encode_keychange/.cvsignore,
+ win32/lib/.cvsignore, win32/libagent/.cvsignore,
+ win32/libhelpers/.cvsignore, win32/libnetsnmptrapd/.cvsignore,
+ win32/libsnmp/.cvsignore, win32/libsnmp_dll/.cvsignore,
+ win32/libucdmibs/.cvsignore, win32/net-snmp/.cvsignore,
+ win32/net-snmp/agent/.cvsignore,
+ win32/net-snmp/library/.cvsignore, win32/netsnmpmibs/.cvsignore,
+ win32/netsnmpmibssdk/.cvsignore, win32/snmpbulkget/.cvsignore,
+ win32/snmpbulkwalk/.cvsignore, win32/snmpd/.cvsignore,
+ win32/snmpdelta/.cvsignore, win32/snmpdf/.cvsignore,
+ win32/snmpdsdk/.cvsignore, win32/snmpget/.cvsignore,
+ win32/snmpgetnext/.cvsignore, win32/snmpnetstat/.cvsignore,
+ win32/snmpset/.cvsignore, win32/snmpstatus/.cvsignore,
+ win32/snmptable/.cvsignore, win32/snmptest/.cvsignore,
+ win32/snmptranslate/.cvsignore, win32/snmptrap/.cvsignore,
+ win32/snmptrapd/.cvsignore, win32/snmpusm/.cvsignore,
+ win32/snmpvacm/.cvsignore, win32/snmpwalk/.cvsignore:
+
+ Remove redundant CVS-admin files.
+
+2007-06-07 12:56 dts12
+
+ * snmplib/snmp_secmod.c:
+
+ Handle unregistering the first Security Model in the list.
+ Reported by Aleksandr Lomanov.
+
+2007-06-07 09:13 dts12
+
+ * agent/helpers/Makefile.in:
+
+ Install header files for stash_cache and stash_to_next helpers.
+
+2007-06-07 09:07 dts12
+
+ * agent/helpers/Makefile.in:
+
+ Separate out header files that don't have a corresponding C
+ source file.
+
+2007-06-07 08:59 dts12
+
+ * agent/helpers/Makefile.in:
+
+ Sort lists of helpers (source code, object files and headers).
+ This should make it easier to spot files that have been omitted.
+
+2007-06-07 08:42 dts12
+
+ * snmplib/read_config.c:
+
+ Protect against systems without S_ISDIR.
+
+2007-06-06 22:36 magfr
+
+ * configure, configure.in:
+
+ We aren't using libtools dlopen support, so there is no need to
+ configure for it
+
+2007-06-06 12:37 tanders
+
+ * configure, configure.in:
+
+ CHANGES: AIX: use "-Wl,-brtl" when compiling with gcc
+
+2007-06-06 10:26 magfr
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Remove the unused undef HAVE_PERL_EVAL_PV.
+ The Perl_eval_pv functions are handled by the
+ HAVE_PERL_EVAL_PV_[UL]C defines,
+ this one is never set by our configure script.
+
+2007-06-06 10:20 dts12
+
+ * apps/snmptrapd.c:
+
+ Ensure output is properly directed to syslog.
+ Otherwise, problems in the config environment can trigger
+ errors being directed to stderr, and subsequent logging
+ output gets lost.
+
+2007-06-06 10:13 dts12
+
+ * snmplib/snmp_client.c:
+
+ More helpful debugging output.
+
+2007-06-06 05:53 magfr
+
+ * apps/snmptrapd.c, apps/snmptrapd_handlers.c,
+ testing/tests/T035snmpv3trapdusermgmt:
+
+ CHANGES: misc: Don't use the legacy symbol
+ SNMPTRAPD_DISABLE_AGENTX
+
+2007-06-05 17:49 magfr
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: building: Remove explicit definitions of items that
+ autoheader also defines
+
+2007-06-05 15:59 dts12
+
+ * agent/mibgroup/disman/event/mteEvent.c:
+
+ CHANGES: snmpd: PATCHES: 1729629: Fix memory leak in disman
+ agent.
+
+2007-06-05 14:52 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ CHANGES: snmptrapd: Support per-trap format specifications
+
+2007-06-05 06:57 magfr
+
+ * net-snmp-config.in:
+
+ NEWS: misc: Add config rereading support to the subagent
+ generated by net-snmp-config --compile-subagent
+
+2007-06-04 22:29 magfr
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: building: Simplify the detection of libraries needed for
+ gethostbyname
+
+2007-06-04 22:06 magfr
+
+ * snmplib/snmp_api.c:
+
+ NEWS: snmplib: Change snmp_sess_add_ex to consistently close and
+ delete the transport argument on failure, earlier the liveness of
+ the transport argument was undecided.
+
+2007-06-04 14:36 hardaker
+
+ * Makefile.in, dist/makerelease, testing/RUNTESTS:
+
+ CHANGES: test: support a -n flag to RUNTESTS to print the test
+ number found in the test file as opposed to the numerical count
+
+2007-06-04 13:09 tanders
+
+ * snmplib/snmpUDPDomain.c:
+
+ CHANGES: build: PATCH: 1728237: from mitsuru_chinen: Move
+ variable declaration at the top of netsnmp_udp_sendto
+
+2007-06-04 12:52 tanders
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/types.h:
+
+ CHANGES: build: PATCH: 1728233: from mitsuru_chinen: make sure
+ type nfds_t is defined
+
+2007-06-04 12:13 tanders
+
+ * agent/mibgroup/disman/ping/pingCtlTable.c, configure,
+ configure.in, include/net-snmp/net-snmp-config.h.in,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c:
+
+ CHANGES: build: PATCH: 1728230: from mitsuru_chinen: add
+ configure check for gai_strerror()
+
+2007-06-04 10:35 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ CHANGES: build: PATCH: 1728226: from mitsuru_chinen: make sure
+ IF_NAMESIZE is defined
+
+2007-06-04 10:28 tanders
+
+ * agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c, configure,
+ configure.in, include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: build: PATCH: 1728223: from mitsuru_chinen: add
+ configure check for netlink socket
+
+2007-06-04 09:47 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ also skip this test on IRIX64
+
+2007-06-02 16:13 magfr
+
+ * configure, configure.in:
+
+ CHANGES: building: Fix compilation on IRIX
+
+2007-06-02 08:24 magfr
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/dynix.h,
+ include/net-snmp/system/mingw32.h, snmplib/snmp_api.c,
+ win32/config.h.borland, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmpapi: Do not use getservbyname to find default port
+ numbers, just hardcode them and let the user override them if
+ needed.
+
+2007-06-01 22:55 tanders
+
+ * configure, configure.in:
+
+ CHANGES: build: Link libdl against libnetsnmpmibs instead of
+ snmpd.
+ Fixes the build on (some) Solaris systems.
+
+2007-06-01 22:34 tanders
+
+ * configure, configure.in:
+
+ fix NETSNMP_IFNET_NEEDS_KERNEL configure check on IRIX
+ (regression from r16451)
+
+2007-06-01 14:33 dts12
+
+ * apps/snmptrapd.c:
+
+ NEWS: snmptrapd: Withdraw deprecated options.
+ (Three and a half years' warning should be enough for anyone!)
+
+2007-05-31 23:51 tanders
+
+ * agent/Makefile.in, apps/Makefile.in, configure, configure.in,
+ net-snmp-config.in:
+
+ CHANGES: build: Link libkvm and libwrap to libnetsnmpagent
+ instead of snmpd.
+ Fixes test #44 (Perl subagent) on systems using one of those
+ libraries.
+
+2007-05-31 23:42 magfr
+
+ * README.agent-mibs, agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/system_mib.h:
+
+ CHANGES: snmpd: Move sysORLastChange from mibII/system_mib to
+ mibII/sysORTable in order to keep the data and the use together.
+
+2007-05-31 14:39 dts12
+
+ * apps/snmptrapd_log.c:
+
+ Fix logging of authentication information.
+
+2007-05-31 10:10 dts12
+
+ * apps/snmptrapd_log.c:
+
+ Remove bogus debug output.
+
+2007-05-31 09:48 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Remove redundant code.
+
+2007-05-31 09:43 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ CHANGES: snmptrapd: FEATURE: 1159947: Allow control of traphandle
+ data format
+
+2007-05-30 22:53 tanders
+
+ * configure, configure.in, perl/ASN/Makefile.PL,
+ perl/OID/Makefile.PL, perl/SNMP/Makefile.PL,
+ perl/TrapReceiver/Makefile.PL, perl/agent/Makefile.PL,
+ perl/default_store/Makefile.PL:
+
+ CHANGES: AIX: build fixes for embedded Perl
+
+2007-05-30 22:34 tanders
+
+ * configure, configure.in:
+
+ HP-UX 11.x and IRIX 6.5 build fix (regression introduced by
+ r16451)
+
+2007-05-29 23:04 tanders
+
+ * configure, configure.in:
+
+ CHANGES: build: make use of AC_PROG_SED/AC_PROG_GREP and / to
+ further minimize sed/grep problems
+
+2007-05-29 22:42 magfr
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ CHANGES: snmplib: Use the default_target argument if it is
+ non-NULL, not if it is NULL.
+
+2007-05-29 10:30 tanders
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: building: Remove more net-snmp specials in the configure
+ scripts to ease maintenance.
+ Also change recently added STRUCT_SOCKADDR_STORAGE_HAS_SS_FAMILY.
+
+2007-05-29 10:27 tanders
+
+ * README.agent-mibs:
+
+ add recent mfd rewrites
+
+2007-05-29 10:22 tanders
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ CHANGES: building: Remove more net-snmp specials in the configure
+ scripts to ease maintenance.
+ Also change win32/net-snmp/net-snmp-config.h for consistency.
+
+2007-05-28 23:30 magfr
+
+ * PORTING, acconfig.h, acinclude.m4,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/host_res.h,
+ agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ipAddr.c, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/mibII_common.h,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/route_write.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/freebsd5.h,
+ include/net-snmp/system/irix.h, include/net-snmp/system/svr5.h,
+ snmplib/scapi.c, snmplib/snmp-tc.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/system.c:
+
+ CHANGES: building: Remove more net-snmp specials in the configure
+ scripts to ease maintenance.
+
+2007-05-28 16:31 dts12
+
+ * man/snmp.conf.5.def, man/snmpcmd.1.def, snmplib/mib.c:
+
+ CHANGES: library: FEATURES: 1407476: Rename 'strictCommentTerm'
+ to reflect the actual behaviour.
+
+2007-05-28 15:25 dts12
+
+ * snmplib/read_config.c:
+
+ CHANGES: library: FEATURES: 1041888: Check directory paths for
+ config files.
+
+2007-05-28 13:13 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: library: FEATURES: 851887: Report range information for
+ invalid SET requests.
+
+2007-05-28 12:08 tanders
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c:
+
+ NEWS: Solaris: PATCH: 1719730: from apersson: support for
+ ipSystemStatsTable and ipAddressTable
+ Part 2 (Solaris-specific new files)
+
+2007-05-28 12:02 tanders
+
+ * include/net-snmp/data_access/defaultrouter.h:
+
+ NEWS: Linux: PATCH: 1724602: from mitsuru_chinen: mfd-based
+ ipDefaultRouterTable implementation
+
+2007-05-28 12:00 tanders
+
+ * agent/mibgroup/ip-mib/data_access/defaultrouter.h,
+ agent/mibgroup/ip-mib/data_access/defaultrouter_common.c,
+ agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable.h,
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h,
+
+ agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h:
+
+ NEWS: Linux: PATCH: 1724602: from mitsuru_chinen: mfd-based
+ ipDefaultRouterTable implementation
+
+2007-05-28 11:59 tanders
+
+ * agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/ip.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/mibII/var_route.h:
+
+ NEWS: Linux: PATCH: 1724602: from mitsuru_chinen: mfd-based
+ ipDefaultRouterTable implementation
+
+2007-05-28 10:09 dts12
+
+ * apps/snmpwalk.c, man/snmpwalk.1.def:
+
+ Document the -CE option.
+
+2007-05-27 21:42 tanders
+
+ * perl/TrapReceiver/Makefile.PL, perl/agent/Makefile.PL:
+
+ Some lame linkers (e.g. on HP-UX 11.23/IA64) need quite a bit of
+ help to successfully link the Perl modules.
+
+2007-05-27 21:33 dts12
+
+ * apps/snmpwalk.c:
+
+ CHANGES: snmpwalk: PATCH: 1723620: Specify an explicit end-point
+ for the walk.
+ An alternative (more flexible) approach to the proposed patch,
+ but one that
+ provides equivalent functionality. Also addresses Feature Request
+ #722784.
+
+2007-05-27 20:52 tanders
+
+ * configure, configure.in, include/net-snmp/net-snmp-config.h.in:
+
+ Add descriptions to AC_DEFINE; drop obsolete AC_CHECK_LIB(m,
+ asin).
+
+2007-05-27 19:28 dts12
+
+ * snmplib/mib.c:
+
+ CHANGES: library: FEATURES: 454028: Detect empty MIB index files.
+
+2007-05-27 19:06 dts12
+
+ * agent/snmpd.c, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmpd: FEATURES: 1019429: Set supplementary groups via
+ initgroups(3)
+
+2007-05-27 06:27 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress.h,
+ agent/mibgroup/ip-mib/data_access/systemstats.h,
+ agent/mibgroup/kernel_sunos5.c, agent/mibgroup/kernel_sunos5.h,
+ agent/mibgroup/mibII.h, configure, configure.in,
+ include/net-snmp/system/solaris.h:
+
+ NEWS: Solaris: PATCH: 1719730: from apersson: support for
+ ipSystemStatsTable and ipAddressTable
+
+2007-05-27 06:20 tanders
+
+ * README.aix:
+
+ grammar fix
+
+2007-05-26 16:41 alex_b
+
+ * README.win32, win32/Configure, win32/build.pl,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32 IPv6 build fixes. IPv6 now requires PSDK.
+
+2007-05-26 15:16 alex_b
+
+ * README.win32, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ IPv6 build fixes for build.bat, Configure and README.win32.
+
+2007-05-25 23:03 tanders
+
+ * README.aix, README.solaris, README.tru64:
+
+ Documentation update w.r.t. recent changes (mibII/ipv6 and AIX
+ shared library building).
+
+2007-05-25 18:54 rstory
+
+ * dist/cvsshow:
+
+ update for new url format in svn entries
+
+2007-05-25 15:28 tanders
+
+ * perl/default_store/Makefile.PL:
+
+ Some systems (e.g. HP-UX 11.23/IA64) currently still need
+ "net-snmp-config --libs" (instead of just --netsnmp-libs) for
+ linking
+ libnetsnmp to a Perl module.
+
+2007-05-24 23:55 tanders
+
+ * agent/mibgroup/mibII.h, configure, configure.in:
+
+ CHANGES: build: only enable mibII/ipv6 through --enable-ipv6 on
+ systems it builds properly on (Linux and *BSD)
+
+2007-05-24 23:15 tanders
+
+ * perl/agent/default_store/Makefile.PL:
+
+ Some systems (e.g. HP-UX 11.23/IA64) currently still need
+ "net-snmp-config --libs" (instead of just --netsnmp-libs) for
+ linking libsnmpagent to a Perl module.
+
+2007-05-24 22:01 magfr
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ Correct obviously broken use of the KLOOKUP macro to be
+ consistent at least
+
+2007-05-24 20:51 tanders
+
+ * include/net-snmp/system/freebsd7.h:
+
+ CHANGES: FreeBSD: add initial support for upcoming FreeBSD 7
+
+2007-05-24 14:06 rstory
+
+ * Makefile.top:
+
+ bump libcurrent to 20 to leave space for 5.4.x releases
+
+2007-05-24 12:48 tanders
+
+ * agent/Makefile.in, apps/Makefile.in:
+
+ fix library linking on HP-UX 11.23/IA64
+
+2007-05-23 19:05 tanders
+
+ * Makefile.in, Makefile.rules, agent/Makefile.in,
+ agent/helpers/Makefile.in, apps/Makefile.in, configure,
+ configure.in, perl/TrapReceiver/Makefile.PL,
+ perl/agent/Makefile.PL, perl/agent/default_store/Makefile.PL,
+ perl/default_store/Makefile.PL, snmplib/Makefile.in:
+
+ NEWS: snmplib: BUG: 1619827: link net-snmp libraries and binaries
+ against the net-snmp libraries they really depend on
+ - reflect library interdependencies at link time
+ - fix dependencies on libcrypto, libpkcs11 and libkstat
+ - install libraries in correct order (important for libtool
+ relinking)
+ NEWS: Perl: link Perl modules against the exact set of libraries
+ they depend on
+
+2007-05-22 16:26 hardaker
+
+ * dist/makerelease:
+
+ use svn export instead of checkout
+
+2007-05-22 00:00 hardaker
+
+ * Makefile.in:
+
+ ignore winExtDLL in comment check
+
+2007-05-21 23:54 hardaker
+
+ * agent/mibgroup/hardware/cpu/cpu_sysinfo.c:
+
+ // -> C comment
+
+2007-05-21 23:33 tanders
+
+ * include/net-snmp/system/solaris2.10.h,
+ include/net-snmp/system/solaris2.7.h,
+ include/net-snmp/system/solaris2.8.h,
+ include/net-snmp/system/solaris2.9.h:
+
+ sync with 5.4, these are obsolete now
+
+2007-05-21 23:11 magfr
+
+ * configure, configure.in:
+
+ CHANGES: building: Disable inlining on solaris as there are some
+ linking errors that show up if the inline support is left
+ enabled.
+
+2007-05-21 06:05 magfr
+
+ * configure, configure.in:
+
+ CHANGES: building: At least Sun C 5.7 fails if one tries to
+ access __func__ in a extern inline function, so test for that
+ case.
+
+2007-05-20 21:34 tanders
+
+ * agent/Makefile.in, configure, configure.in:
+
+ NEWS: snmplib: BUG: 1619827: link against needed external
+ libraries at library link time (where they are referenced),
+ rather than application link time.
+ Already covers most of libnetsnmpmibs' external dependencies.
+ Fixes build issues on some platforms (e.g. building with shared
+ libraries on AIX). Tested on different versions of Linux,
+ Solaris, HP-UX, AIX and IRIX.
+
+2007-05-19 15:27 magfr
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: building: Check for support of static inline functions
+ instead of nested static inline functions when determining if
+ static inline functions work
+
+2007-05-19 08:40 magfr
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/library/snmp_assert.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/net-snmp-config.h.in, win32/config.h.borland,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmplib: Make use of the C99 predefined variable
+ __func__ in addition to the GCC symbol __FUNCTION__ to get the
+ name of the current function
+
+2007-05-18 18:12 hardaker
+
+ * agent/mibgroup/mibII/kernel_linux.h:
+
+ CHANGES: snmpd: patch: 1721096: from mitsuru_chinen: remove
+ unused variable stats from kernel extraction for better
+ portability.
+
+2007-05-18 18:08 hardaker
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ CHANGES: snmpd: patch: 1719254: from "Christan Jung": update
+ HRFS_ignore list to current linux likelyhoods
+
+2007-05-18 18:02 hardaker
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ NEWS: snmpd: patch: 1719253: from "Christian Jung": fix
+ skipNFSInHostResources so it does not break on the second walk of
+ the table.
+
+2007-05-18 17:55 magfr
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Reran autoheader and adjusted acconfig.h after changes in r16387
+
+2007-05-18 17:54 hardaker
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ CHANGES: snmpd: patch: 1715406: from mitsuru_chinen: registration
+ ordering fixes for icmpStatsTable
+
+2007-05-18 17:46 hardaker
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ CHANGES: snmpd: patch: 1715395: fix icmp table errors in new icmp
+ code
+
+2007-05-18 17:45 hardaker
+
+ * agent/mibgroup/mibII/icmp.c:
+
+
+
+2007-05-18 15:05 tanders
+
+ * configure, configure.in:
+
+ NEWS: AIX: fix default shared library building instead of forcing
+ static
+
+2007-05-18 14:18 magfr
+
+ * acconfig.h, agent/mibgroup/mibII/ip.c, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: building: Use AC_CHECK_MEMBERS instead of
+ AC_CHECK_STRUCT_FOR when checking for struct ipstat members in
+ order to make configure.in smaller
+
+2007-05-18 10:22 magfr
+
+ * agent/mibgroup/host/hr_storage.h:
+
+ CHANGES: snmpd: Correct the dependency information for
+ host/hr_storage
+
+2007-05-18 09:57 magfr
+
+ * testing/RUNTESTS:
+
+ CHANGES: testing: Do not terminate on SIGCHLD since dash and
+ soume bourne shells will exit the main shell when a subshell
+ terminates in that case.
+
+2007-05-18 09:22 tanders
+
+ * apps/snmpusm.c:
+
+ Undoing accidental change committed in r16373.
+
+2007-05-17 23:21 magfr
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCH: 1687337: Implement _sess_open in terms
+ of snmp_sess_add
+
+2007-05-17 22:16 magfr
+
+ * agent/agent_trap.c, apps/snmptrap.c, apps/snmptrapd.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmp_api.c:
+
+ CHANGES: snmpd: PATCH: 1620424: Fix notification sending so that
+ explicit specification of port 162 should be unnecessary
+ CHANGES: snmptrapd: PATCH: 1620424: Fix notification reception so
+ that explicit specification of port 162 should be unnecessary
+ CHANGES: apps: PATCH: 1620424: Fix notification sending so that
+ explicit specification of port 162 should be unnecessary
+ CHANGES: snmplib: PATCH: 1620424: Honor
+ NETSNMP_DS_LIB_DEFAULT_PORT over the default system
+
+2007-05-17 21:53 hardaker
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c:
+
+ CHANGES: snmpd: patch: 1710632: from mavarley: fix memory leak on
+ broken container insertions for the ipAddressTable
+
+2007-05-17 18:06 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ CHANGES: PATCH: 1719244: fix mfd generating map function
+
+2007-05-17 17:46 hardaker
+
+ * agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/ip.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/mibII/var_route.h:
+
+ NEWS: snmpd: patch: 1708243: from nhorman: implement the
+ ipDefaultRouteTable on linux
+
+2007-05-17 16:31 hardaker
+
+ * configure.in:
+
+ NEWS: ports: patch: 1706344: from naylor: fix compilation with
+ cygwin
+
+2007-05-17 16:22 hardaker
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ NEWS: snmpd: patch: 1700157: from afrika: fixes ordering of exec
+ tokens in the resulting mib tree
+
+2007-05-17 15:53 hardaker
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ CHANGES: snmpd: patch: 1617255: fix length of the history array
+ to match code.
+
+2007-05-17 13:53 hardaker
+
+ * agent/snmpd.c, apps/snmptrapd.c:
+
+ CHANGES: snmpd: patch: 1225440: Apply intent of patch: to delay
+ sighup till it is safe.
+ CHANGES: snmptrapd: patch: 1225440: Apply intent of patch: to
+ delay sighup till it is safe.
+
+2007-05-17 13:35 magfr
+
+ * agent/mibgroup/ip-forward-mib/data_access/route.h,
+ agent/mibgroup/ip-mib/data_access/arp.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress.h,
+ agent/mibgroup/ip-mib/data_access/systemstats.h:
+
+ CHANGES: building: Use config_error instead of config_require of
+ a bogus file/#error to generate error messages at configure time.
+
+2007-05-17 04:39 hardaker
+
+ * apps/snmpusm.c, snmplib/asn1.c:
+
+ CHANGES: snmplib: patch: 1645698: fix 64-bit signed integer
+ encoding
+
+2007-05-16 23:53 tanders
+
+ * include/net-snmp/system/hpux.h:
+
+ CHANGES: HP-UX: HP-UX needs _REENTRANT defined to pick up
+ strtok_r.
+ Otherwise, at least for 64-bit code, strtok_r will not work
+ and will make net-snmp segfault.
+
+2007-05-16 23:39 tanders
+
+ * agent/mibgroup/mibII/route_headers.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ fix patch 1625069 (r16365) to not break the build on Solaris
+ 2.6/7
+
+2007-05-15 17:33 rstory
+
+ * dist/svnup:
+
+ - add warning if star not available
+ - fix pattern to exclude .svn dirs from tarballs
+
+2007-05-15 15:55 rstory
+
+ * dist/cvsup:
+
+ warn if star not available
+
+2007-05-15 14:36 tanders
+
+ * agent/mibgroup/hardware/memory/memory_solaris.c:
+
+ fix typo
+
+2007-05-14 21:49 tanders
+
+ * apps/Makefile.in:
+
+ add missing CFLAGS to link line
+
+2007-05-14 21:48 tanders
+
+ * apps/snmpnetstat/Makefile.in:
+
+ add missing CFLAGS to link line
+
+2007-05-14 15:57 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/var_route.c, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: snmpd: patch: 1625069: speed improvements for solaris
+ routing table access
+
+2007-05-14 14:50 hardaker
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: patch: 1595568: from cyril_margaria: fix
+ delegated SET requests from agentx subagents
+
+2007-05-14 14:04 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ update to point to wiki and a few more cvs -> svn changes
+
+2007-05-13 14:27 magfr
+
+ * snmplib/snmp_service.c:
+
+ CHANGES: snmplib: Read the config parameters defTarget and
+ defDomain from snmp.conf as well as from <application>.conf
+
+2007-05-12 11:17 magfr
+
+ * snmplib/mib.c:
+
+ CHANGES: snmplib: Deallocate the _mibindexes cache in
+ shutdown_mib to make for a cleaner exit of the library
+
+2007-05-12 11:14 magfr
+
+ * snmplib/mib.c:
+
+ CHANGES: snmplib: Deallocate the confmibs and confmibdirs
+ variables in shutdown_mib to make for a cleaner exit of the
+ library
+
+2007-05-11 21:06 magfr
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ CHANGES: snmpd: PATCH: 1687336: Start using the enhanced
+ read_config interface
+
+2007-05-11 20:33 magfr
+
+ * snmplib/read_config.c:
+
+ PATCH 1687329: Applied part 2 of the patch - When registering
+ multiple premib handlers only the last one was registered premib,
+ the others were registerd at the normal time. This patch puts all
+ registration in one function that takes the problematic value as
+ an argument and makes the old functions thin wrappers of the new
+ one
+
+2007-05-11 20:24 magfr
+
+ * snmplib/read_config.c:
+
+ CHANGE: snmplib: PATCH 1687329: Applied part 3 of the patch - use
+ the same algorithm to determine what to unregister as is used to
+ determine what to regster
+
+2007-05-11 16:32 magfr
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Don't log host/hr_proc events in the snmpd domain
+
+2007-05-11 16:27 magfr
+
+ * agent/helpers/cache_handler.c:
+
+ Decorate more debug lines with the tag that controls the log
+
+2007-05-11 15:07 dts12
+
+ * agent/mibgroup/hardware/memory/memory_solaris.c:
+
+ CHANGES: snmpd: BUG: 1628613: Restore memTotalFree.0 on Solaris
+
+2007-05-10 21:52 tanders
+
+ * Makefile.in, python/setup.py:
+
+ NEWS: python: PATCH: 1716114: Let python build in source tree
+ Patch provided by Jochen Friedrich (Debian patch #38).
+
+2007-05-10 05:18 magfr
+
+ * snmplib/read_config.c:
+
+ PATCH 1687329: Applied part 1 of the patch - lessens the scope of
+ the ltmp2 variable
+
+2007-05-09 23:57 tanders
+
+ * README.irix:
+
+ document optimized IRIX cpu stats
+
+2007-05-09 23:49 tanders
+
+ * agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/cpu/cpu_sysinfo.c,
+ agent/mibgroup/hardware/cpu/cpu_sysinfo.h:
+
+ NEWS: irix: PATCH: 1709748: Optimized IRIX cpu stats
+
+2007-05-09 21:23 rstory
+
+ * dist/cvsshow:
+
+ update to show svn repo too
+
+2007-05-09 15:39 tanders
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ icmpStatsTable is only implemented for Linux
+
+2007-05-08 19:48 magfr
+
+ * agent/snmp_agent.c:
+
+ Revert mistakenly committed extra trace logs
+
+2007-05-07 20:46 hardaker
+
+ * perl/agent/default_store/default_store.pm,
+ perl/agent/default_store/default_store.xs,
+ perl/agent/default_store/test.pl:
+
+ update agent::default_store perl module for new defs
+
+2007-05-07 20:24 hardaker
+
+ * dist/patme:
+
+ more svn conversion fixes
+
+2007-05-07 20:23 hardaker
+
+ * agent/agent_read_config.c, agent/snmp_agent.c,
+ include/net-snmp/agent/ds_agent.h, man/snmpd.conf.5.def:
+
+ NEWS: snmpd: BUG: 1712988: default and configurable maximum
+ number of varbinds returnable to a GETBULK request
+
+2007-05-07 20:05 hardaker
+
+ * dist/patme:
+
+ rename of branch dirs
+
+2007-05-07 16:14 hardaker
+
+ * dist/patme:
+
+ attempted (untested) update
+
+2007-05-07 13:55 rstory
+
+ * dist/svnup:
+
+ don't delete tarball if scp fails
+
+2007-05-04 20:27 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: fix SNMP SET for IP addresses on 64-bit
+
+2007-05-04 10:22 tanders
+
+ * Makefile.in:
+
+ install dragonfly.h
+
+2007-05-03 23:01 tanders
+
+ * include/net-snmp/system/dragonfly.h:
+
+ CHANGES: BUG: 1710910: initial support for DragonFly BSD
+
+2007-05-03 22:10 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: fix SNMP SET for IP addresses on 64-bit
+ Patch proposed by Jeff Lange.
+
+2007-05-03 16:00 tanders
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ build fix (e.g. for early AIX): use uint32_t i.s.o. __uint32_t
+
+2007-05-02 13:13 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Fix problems with single-line extend scripts.
+
+2007-05-01 19:51 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ - test for IFA_F_TEMPORARY before using
+ - remove redundant ifdef
+
+2007-05-01 11:34 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ CHANGES: snmptrapd: Support for forwarding traps by OID subtree.
+ (Consistent with subtree-based script processing).
+
+2007-04-30 14:51 dts12
+
+ * agent/mibgroup/mibII/kernel_linux.c:
+
+ CHANGES: snmpd: PATCH: 1703004: Consolidate snmp6 handling.
+ Patch supplied by Neil Horman, plus some extra tidying up.
+
+2007-04-30 14:33 dts12
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/icmp.h:
+
+ CHANGES: snmpd: PATCH: 1702366: Support for icmpStatsTable
+ Patch provided by Neil Horman
+
+2007-04-30 14:31 dts12
+
+ * agent/mibgroup/mibII/ipv6.c, agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/kernel_linux.h:
+
+ CHANGES: snmpd: PATCH: 1702361: Read stats from /proc/net/snmp6
+
+2007-04-30 14:14 dts12
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ Fix compilation problems when IPv6 support is not enabled.
+
+2007-04-30 13:26 dts12
+
+ * README.agent-mibs, agent/mibgroup/mibII/setSerialNo.c,
+ agent/mibgroup/mibII/setSerialNo.h:
+
+ CHANGES: snmpd: PATCH: 1700737: Tidy up setSerialNo
+ implementations.
+
+2007-04-30 13:06 dts12
+
+ * agent/helpers/cache_handler.c:
+
+ CHANGES: snmpd: PATCH: 1700732: Fix debug output statements.
+
+2007-04-30 13:02 dts12
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ CHANGES: snmpd: PATCH: 1700730: Remove unused extern declaration.
+
+2007-04-30 11:32 dts12
+
+ * agent/helpers/instance.c:
+
+ CHANGES: snmpd: PATCH: 1698184: Register non-default context
+ integers as writable.
+ Patch provided by Mark Naylor.
+
+2007-04-30 11:26 dts12
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c:
+
+ CHANGES: snmpd: PATCH: 169817: Improved RFC 4293 support.
+ Includes non-unicast and randomly chosen IP addresses.
+ Patch provided by Varun Chandramohan
+
+2007-04-30 11:04 dts12
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c:
+
+ CHANGES: snmpd: PATCH: 1692768: Fix copying of non-octet-aligned
+ IP address prefixes.
+
+2007-04-30 10:50 dts12
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h,
+ include/net-snmp/data_access/udp_endpoint.h:
+
+ CHANGES: snmpd: PATCH: 1670511: Implement network connection
+ process ID objects.
+ Patch provided by Varun Chandramohan
+
+2007-04-30 10:46 dts12
+
+ * include/net-snmp/library/snmp_api.h:
+
+ Fix declaration of snmp_sess_read_extd()
+
+2007-04-30 10:25 dts12
+
+ * snmplib/fd_event_manager.c:
+
+ CHANGES: snmplib: PATCH: 1687325: Fix problem with operator
+ precedence.
+
+2007-04-30 10:21 dts12
+
+ * include/net-snmp/library/snmp_api.h:
+
+ CHANGES: snmplib: PATCH: 1687319: Declare snmp_sess_read_extd()
+
+2007-04-30 10:14 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCH: 1687318: Make _sess_selpol_info static.
+
+2007-04-30 10:09 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCH: 1687317: Remove an unused local variable
+
+2007-04-30 10:07 dts12
+
+ * snmplib/snmpUnixDomain.c, snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCH: 1687316: Don't drop const from casts.
+
+2007-04-27 10:21 dts12
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Bring dynamic module unload processing more into line with
+ "normal" MIB modules. Suggested by Magnus Fromreide.
+ See coders thread "shutdown_foo or deinit_foo".
+
+2007-04-27 10:17 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Update post-release announcement instructions.
+
+2007-04-24 12:35 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Fix incomplete OID handling of single-line extend scripts.
+ Reported by Max on coders list, 7th April. See thread
+ "... segfault .. when attempting SNMP GET on extend or exec item"
+
+2007-04-20 08:30 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Document the behaviour of a load threshold of 0.
+ Reported by Fong Tsui.
+
+2007-04-20 08:21 dts12
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ Long-term load average is calculated over 15 minutes, not 10.
+ Reported by Fong Tsui
+
+2007-04-19 12:53 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Tweak ChangeLog instructions for SVN
+
+2007-04-10 14:16 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ Detect OID retracking (as well as simple repetitions) when
+ bulkwalking an OID tree.
+ See users thread "missing indices in bulkwalk result".
+
+2007-04-10 11:49 dts12
+
+ * include/net-snmp/system/mingw32.h:
+
+ Clarify copyright status of Win32 API definitions.
+
+2007-04-10 11:27 dts12
+
+ * include/net-snmp/system/dynix.h:
+
+ Clarify copyright status of BSD-derived TCPTV* definitions.
+
+2007-04-09 14:02 rstory
+
+ * dist/svnup:
+
+ - remove debugging
+ - check rc for tar, gzip and scp steps
+
+2007-04-06 18:38 rstory
+
+ * dist/svnup:
+
+ svn equivalent of cvsup
+
+2007-04-03 08:54 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Emphasise the use of SNMPv3 in DisMan monitoring.
+ Fix the syntax of non-existance/value-change tests.
+
+2007-04-02 14:55 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: BUG: 1046327: Reset "includeAllDisks" flag when
+ reloading.
+
+2007-04-02 14:45 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: BUG: 1602286: Don't let table holes block later
+ rows.
+
+2007-04-02 13:51 dts12
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ CHANGES: snmpd: BUG: 1073782: Restore PerfStat values for FreeBSD
+ 5.x systems.
+ It's unclear why the "new" calculation was a) proposed, b)
+ withdrawn,
+ and c) what was wrong with the previous calculation (which seems
+ to
+ match the output of 'ps')
+
+2007-04-02 13:06 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ CHANGES: snmpd: BUG: 902610: Don't discard pending data following
+ a TRAP.
+
+2007-04-02 12:56 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ CHANGES: snmpd: BUG: 902801: Fix ordering of SMUX-registered
+ subtrees.
+
+2007-04-02 12:35 dts12
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ CHANGES: snmpd: BUG: 1685067: More precise handling of
+ SNMPv3-admin MIB tables.
+ This actually fixes three separate problems:
+ * A GET request for 'vacmAccessStatus."group"."".3.4' will
+ succeed (since VACM checks accept the given security level
+ *or*higher*) 2007-04-02 12:26 dts12
+
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Check that GET requests match a valid OID.
+ (Otherwise a request for hrStorage{Column}.{index}.{anything}
+ will ignore the extra subids, and return success)
+
+2007-04-02 12:21 dts12
+
+ * agent/mibgroup/disman/event/mteObjectsTable.c:
+
+ Prevent crash when walking (invalid?) Event-MIB Objects Table.
+
+2007-04-02 11:30 dts12
+
+ * dist/makerelease:
+
+ Fix a couple of typos in the re-worked makerelease script.
+
+2007-03-29 12:14 tanders
+
+ * configure, configure.in:
+
+ fix syntax error ("==" is bad)
+
+2007-03-27 08:55 dts12
+
+ * acinclude.m4, configure, configure.in:
+
+ Read user-prompted values from original stdin (not /dev/null)
+
+2007-03-27 08:38 dts12
+
+ * configure, configure.in:
+
+ Accept '2c' as a valid response when choosing the default version
+
+2007-03-27 08:29 dts12
+
+ * configure, configure.in:
+
+ CHANGES: configure: BUG: 1567324: Clarify prompting for
+ user-supplied values.
+ Now only remembers (and uses) previous values when explicitly
+ told to do so,
+ e.g. configure -C
+
+2007-03-27 08:23 dts12
+
+ * configure, configure.in:
+
+ Fix inconsistency in patch #1627049 - <poll.h> vs <sys/poll.h>
+
+2007-03-25 22:31 dts12
+
+ * local/mib2c.container.conf, local/mib2c.iterate.conf,
+ local/mib2c.table_data.conf:
+
+ Variable-length string values are more likely than fixed length.
+
+2007-03-25 22:28 dts12
+
+ * local/mib2c.array-user.conf:
+
+ CHANGES: mib2c: BUG: 833673: More focused size checks.
+
+2007-03-25 21:25 dts12
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: BUG: 1677063: Check for failed malloc calls.
+
+2007-03-25 19:03 dts12
+
+ * agent/mibgroup/mibII/route_write.c:
+
+ Check SET requests against the correct type (IP Address != Octet
+ Str)
+
+2007-03-25 18:55 dts12
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ CHANGES: snmpd: BUG: 1685081: Check for valid OID on Free/Undo
+ passes.
+
+2007-03-23 09:44 dts12
+
+ * include/net-snmp/library/snmp_api.h:
+
+ CHANEGS: snmplib: BUG: 1686384: Document non-use of 'remote_port'
+ field.
+
+2007-03-23 09:19 dts12
+
+ * local/mib2c-conf.d/mfd-persistence.m2i:
+
+ Allow space for external indexes when saving table entries.
+ (See patch #1642255)
+
+2007-03-23 09:14 dts12
+
+ *
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c:
+
+ CHANGES: snmpd: PATCH: 1642255: Handle saving long
+ snmpNotifyFilterTable entries.
+
+2007-03-23 09:09 dts12
+
+ * agent/agent_read_config.c, agent/mibgroup/mibII/vacm_conf.c,
+ include/net-snmp/library/callback.h, snmplib/read_config.c:
+
+ CHANGES: snmplib: PATCH: 1681977: Add callbacks prior to reading
+ config.
+
+2007-03-23 09:06 dts12
+
+ * agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c:
+
+ CHANGES: snmpd: PATCH: 1676478: fix udpEndpointRemoteAddress
+ CHANGES: snmpd: BUG: 1676476: fix udpEndpointRemoteAddress
+
+2007-03-23 09:01 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCH: 1653670: Consistent SNMPv3 behaviour
+ when opening sessions.
+
+2007-03-23 08:57 dts12
+
+ * configure, configure.in, include/net-snmp/library/snmp_api.h,
+ include/net-snmp/net-snmp-config.h.in, snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCH: 1627049: New API to handle large numbers
+ of file descriptors.
+
+2007-03-22 19:14 dts12
+
+ * snmplib/read_config.c:
+
+ CHANGES: snmplib: PATCH: 1681030: Better handling of empty
+ apptype configs.
+
+2007-03-22 19:12 dts12
+
+ * agent/mibgroup/smux/smux.c, agent/mibgroup/smux/smux.h,
+ agent/snmpd.c:
+
+ CHANGES: snmpd: PATCH: 1678788: Better handling of SMUX socket
+ descriptors.
+
+2007-03-22 19:09 dts12
+
+ * agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c:
+
+ CHANGES: snmpd: PATCH: 1683054: set udpEndpointInstance to
+ identify different processes.
+
+2007-03-21 12:35 dts12
+
+ * win32/libsnmp_dll/libsnmp.def, win32/libsnmp_dll/libsnmp.def.in:
+
+ Declare OID constants as such (rather than API calls).
+ Proposed by Alex Burger
+
+2007-03-20 20:07 rstory
+
+ * agent/mibgroup/mibII/kernel_linux.c:
+
+ NEWS: snmpd: PATCH: 1666737: include ipv6 counts in
+ udpInDatagrams, udpNoPorts, udpInErrors, udpOutDatagrams
+
+2007-03-19 22:09 tanders
+
+ * agent/mibgroup/hardware/cpu/cpu_pcp.c:
+
+ use pmFreeResult() instead of free()
+
+2007-03-19 09:39 tanders
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ get rid of C++ comments
+
+2007-03-16 14:04 dts12
+
+ * dist/RELEASE-INSTRUCTIONS, dist/changelogfix, dist/makerelease,
+ local/Version-Munge.pl:
+
+ Convert build system to SVN version.
+
+2007-03-15 10:59 tanders
+
+ * agent/mibgroup/agentx/subagent.h,
+ agent/mibgroup/disman/mteTriggerTable.h,
+ agent/mibgroup/utilities/iquery.h, configure, configure.in:
+
+ CHANGES: build: PATCH: 1681073: #ifdef based config_error instead
+ of special cases in configure
+
+2007-03-15 10:47 tanders
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ get rid of C++ comments
+
+2007-03-14 23:31 tanders
+
+ * README.irix, agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/cpu/cpu_pcp.c,
+ agent/mibgroup/hardware/cpu/cpu_pcp.h:
+
+ NEWS: IRIX: PATCH: 1675869: from bbice: CPU statistics for IRIX
+ based on PCP
+
+2007-03-14 22:09 tanders
+
+ * agent/helpers/all_helpers.c, agent/helpers/bulk_to_next.c,
+ agent/helpers/cache_handler.c, agent/helpers/debug_handler.c,
+ agent/helpers/instance.c, agent/helpers/null.c,
+ agent/helpers/old_api.c, agent/helpers/read_only.c,
+ agent/helpers/row_merge.c, agent/helpers/scalar.c,
+ agent/helpers/scalar_group.c, agent/helpers/serialize.c,
+ agent/helpers/stash_cache.c, agent/helpers/stash_to_next.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ agent/helpers/table_container.c, agent/helpers/table_data.c,
+ agent/helpers/table_dataset.c, agent/helpers/table_iterator.c,
+ agent/helpers/table_tdata.c, agent/helpers/watcher.c:
+
+ CHANGES: snmpd: PATCH: 1681043: from magfr: clean up helper
+ includes
+
+2007-03-14 21:54 tanders
+
+ * net-snmp-config.in:
+
+ CHANGES: PATCH: 1681035: from magfr: improve net-snmp-config
+ /bin/sh compatibility
+
+2007-03-14 18:31 tanders
+
+ * net-snmp-config.in:
+
+ CHANGES: build: PATCH: 1678300: from magfr: compile-subagent
+ doesn't call shutdown_ methods
+
+2007-03-14 16:12 dts12
+
+ * agent/mibgroup/target/target.c:
+
+ CHANGES: snmpd: PATCHES: 1644280: Don't automatically probe for
+ v3 EngineIDs.
+
+2007-03-13 10:26 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Check for zero-size pseudo-filesystems. Report them as empty
+ rather than full, so they won't be treated as an error.
+
+2007-03-13 05:59 tanders
+
+ * agent/mibgroup/hardware/cpu/cpu.h:
+
+ CHANGES: PATCH: 1678305: from magfr: Deallocate the cache in
+ hardware/cpu/cpu on shutdown (header part)
+
+2007-03-12 23:09 tanders
+
+ * agent/mibgroup/notification-log-mib/notification_log.c,
+ agent/mibgroup/notification-log-mib/notification_log.h:
+
+ CHANGES: PATCH: 1678306: from magfr: Deallocate the log in
+ notification-log-mib/notification_log
+
+2007-03-12 23:04 tanders
+
+ * agent/mibgroup/hardware/cpu/cpu.c:
+
+ CHANGES: PATCH: 1678305: from magfr: Deallocate the cache in
+ hardware/cpu/cpu on shutdown
+
+2007-03-12 22:57 tanders
+
+ * snmplib/mib.c:
+
+ CHANGES: PATCH: 1678302: from magfr: netsnmp_mibindex_load leaks
+ memory
+
+2007-03-12 22:50 tanders
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: PATCH: 1678301: from magfr: deallocate domain registry
+ at shutdown
+
+2007-03-12 22:31 tanders
+
+ * net-snmp-config.in:
+
+ CHANGES: PATCH: 1678298: from magfr: compile-subagent checks for
+ bad HAVE_SIGNAL_H
+
+2007-03-12 21:47 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ CHANGES: snmpd: PATCHES: 1669048: Add support for
+ ipv6InterfaceIdentifier
+
+2007-03-12 21:37 dts12
+
+ * agent/helpers/table.c:
+
+ CHANGES: snmpd: BUG: 1413728: Reference index values in debug
+ output correctly.
+
+2007-03-12 21:34 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: BUG: 1102058: Skip non-mounted disks (e.g. swap
+ partitions)
+
+2007-03-12 21:30 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/data_access/interface_solaris2.c,
+ agent/mibgroup/if-mib/data_access/interface_sysctl.c:
+
+ CHANGES: snmpd: PATCHES: 1668193: Update registration of
+ ReasmMaxSize support.
+
+2007-03-12 21:28 dts12
+
+ * agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c:
+
+ CHANGES: snmpd: PATCHES: 1668193: Fix check for v6 ReasmMaxSize
+ support.
+
+2007-03-12 19:56 dts12
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ CHANGES: snmpd: PATCHES: 1668952: Ignore zombie processes.
+
+2007-03-12 19:54 dts12
+
+ * agent/mibgroup/ip-mib/ip_scalars.c:
+
+ CHANGES: snmpd: PATCHES: 1665985: Implement ipReasmTimeout
+ Though this registers an instance, rather than the full scalar
+ object
+
+2007-03-12 19:51 dts12
+
+ * agent/mibgroup/mibII/vacm_vars.c, snmplib/vacm.c:
+
+ CHANGES: library: PATCHES: 1665543: Handle VACM checks correctly.
+ CHANGES: snmpd: PATCHES: 1665549: Handle creating VACM entries
+ correctly.
+ [Both patches are required for correct operation]
+
+2007-03-12 19:47 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ CHANGES: snmpd: PATCHES: 1659623: Handle SMUX peers with an empty
+ password.
+
+2007-03-12 19:44 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ CHANGES: snmpd: PATCHES: 1657741: Handle 64-bit types via pass
+ mechanism.
+
+2007-03-12 19:40 dts12
+
+ * agent/agent_trap.c:
+
+ CHANGES: snmpd: PATCHES: 1644280: Use the correct engineID when
+ sending v3 traps.
+
+2007-03-12 19:32 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: library: PATCHES: 1642071: Don't fiddle with the storage
+ of pre-existing users.
+
+2007-03-12 19:30 dts12
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ CHANGES: snmpd: PATCHES: 1641865: Don't double check snmpTrapOID
+ in the filter table.
+
+2007-03-12 19:25 dts12
+
+ * agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c:
+
+ CHANGES: snmpd: PATCHES: 1639726: Report physical memory
+ correctly on *BSD
+
+2007-03-09 21:31 tanders
+
+ * snmplib/mib.c:
+
+ CHANGES: PATCH: 1674299: from magfr: Lessen the scope of the zone
+ variable in dump_realloc_oid_to_inetaddress
+
+2007-03-09 21:29 tanders
+
+ * agent/agent_trap.c:
+
+ CHANGES: PATCH: 1674302: from magfr: Lessen the scope of the len
+ variable in convert_v2pdu_to_v1
+
+2007-03-08 15:52 dts12
+
+ * include/net-snmp/system/netbsd.h,
+ include/net-snmp/system/openbsd.h:
+
+ Include Host Resources MIB on NetBSD and OpenBSD
+
+2007-03-07 09:43 tanders
+
+ * agent/agent_trap.c:
+
+ CHANGES: PATCH: 1674298: from magfr: Remove unused sinkport
+ variable
+
+2007-03-06 13:51 dts12
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: BUG: 1159908: Fix memory leak
+
+2007-03-02 22:40 tanders
+
+ * snmplib/MSG00001.bin:
+
+ no eol-style for binary files
+
+2007-03-02 22:26 tanders
+
+ * doc/rfc/smiV2/rfc2579.errata~:
+
+ don't ship editor backup copies
+
+2007-03-02 16:20 tanders
+
+ * snmplib/MSG00001.bin:
+
+ flag as binary
+
+2007-03-02 12:44 tanders
+
+ * CodingStyle:
+
+ fix typo
+
+2007-03-02 09:57 dts12
+
+ * TODO:
+
+ Minor tweak - playing with SVN as much as anything....
+
+2007-03-01 23:57 hardaker
+
+ * NEWS:
+
+ mention that we moved to SVN
+
+2007-02-28 15:27 dts12
+
+ * CHANGES, ChangeLog, NEWS:
+
+ Checkpoint summary of CVS changes, preparatory for the SVN
+ switch.
+
+2007-02-27 13:36 rstory
+
+ * agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c:
+
+ CHANGES: Linux: BUG: 1666005: Fail to walk ipv6InterfaceTable on Linux
+
+2007-02-27 13:08 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ CHANGES: mib2c: PATCH: 1668171: skip unknown cols in min/max range for tables, instead of error
+
+2007-02-27 12:34 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressPrefixTable.h:
+
+ add header for easier configure --with-mib-module
+
+2007-02-26 14:54 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ Re-correct interpretation of "null OID" in the AgentX specs.
+ (for the last time, I trust!)
+
+2007-02-26 14:37 dts12
+
+ * include/ucd-snmp/util_funcs.h:
+
+ Fix reference to Net-SNMP include locations
+
+2007-02-26 12:47 dts12
+
+ * perl/: ASN/Makefile.PL, OID/Makefile.PL,
+ SNMP/Makefile.PL, TrapReceiver/Makefile.PL,
+ agent/Makefile.PL, agent/default_store/Makefile.PL,
+ default_store/Makefile.PL:
+
+ Prompting for a single directory, not an array.
+
+2007-02-26 11:32 dts12
+
+ * local/: mib2c.container.conf, mib2c.iterate.conf,
+ mib2c.table_data.conf:
+
+ CHANGES: mib2c: BUG: 1429472: Protect against missing instances (and invalid objects)
+
+2007-02-26 11:29 dts12
+
+ * local/mib2c.mfd.conf:
+
+ Fix invalid mib2c directive.
+
+2007-02-26 11:18 dts12
+
+ * agent/mibgroup/disman/event/mteEventConf.c:
+
+ CHANGES: snmpd: BUG: 1416276: Handle dependency on MIB parsing API.
+
+2007-02-23 21:53 tanders
+
+ * configure.in, configure:
+
+ add quotes to fix shell syntax error when empty
+
+2007-02-22 22:35 tanders
+
+ * configure, configure.in:
+
+ Last commit broke the build. Now escape backslashes properly.
+
+2007-02-22 15:38 dts12
+
+ * README.solaris:
+
+ CHANGES: documentation: BUG: 1247164: Document use of OID macros
+
+2007-02-22 00:28 tanders
+
+ * agent/mibgroup/: hardware/cpu/cpu_perfstat.c,
+ ucd-snmp/proc.c:
+
+ CHANGES: AIX: PATCH: 1665079: from "Michael Kukat": AIX patches for cpu stats and process monitoring
+
+2007-02-21 16:36 hardaker
+
+ * configure, configure.in:
+
+ fix lame-make systems that can't handle whitespace terminating wrapped lines
+
+2007-02-21 15:33 tanders
+
+ * Makefile.top:
+
+ CHANGES: Win32: BUG: 1662987: compile error on Cygwin
+
+2007-02-21 13:56 dts12
+
+ * snmplib/: snmp_parse_args.c, tools.c:
+
+ CHANGES: snmplib: BUG: 1660061: Validate engineIDs more strictly.
+
+2007-02-21 13:49 dts12
+
+ * man/: snmpcmd.1.def, snmp.conf.5.def:
+
+ CHANGES: documentation: BUG: 1407476: Clarify MIB parsing toggle options and MIB comment handling.
+
+2007-02-21 13:37 dts12
+
+ * configure.in, configure:
+
+ CHANGES: build: BUG: 1096166: Handle --without-logfile correctly.
+
+2007-02-19 16:34 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Mention removal from CVS of deleted files
+
+2007-02-19 15:56 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Rework release instructions to take account of "makerelease" script
+
+2007-02-19 10:49 dts12
+
+ * dist/makerelease:
+
+ Don't assume local usernames match CVS account names.
+
+2007-02-19 10:41 dts12
+
+ * dist/extractnews:
+
+ Improve layout of CHANGES information.
+
+2007-02-19 10:06 dts12
+
+ * Makefile.in:
+
+ Don't invoke 'versiontag' for tagging the CVS tree.
+ It doesn't handle this any more. (Use 'makerelease' instead)
+
+2007-02-19 10:02 dts12
+
+ * agent/mibgroup/versiontag:
+
+ Don't fail silently when called to tag the CVS tree.
+ Return indication of failure to the calling application (e.g. make)
+
+2007-02-16 12:03 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ Revert to previous "null OID" interpretation (but with the correct encoding).
+
+2007-02-15 11:09 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_linux.c:
+
+ CHANGES: snmpd: BUG: 1600261: Handle non-x86 /proc/cpuinfo format
+ (A workaround, rather than a fix - we really need to parse these
+ other formats properly in the init routine)
+
+2007-02-15 10:06 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ Correct misinterpretation of "null OID" in AgentX specs.
+
+2007-02-15 09:47 dts12
+
+ * agent/agent_trap.c:
+
+ Reject overly-short Trap OIDs.
+ Don't crash out completely on failed v1<->v2 trap conversions.
+
+2007-02-12 12:31 dts12
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ CHANGES: snmpd: BUG: 1633595: Fix AgentX handling of Counter64 values
+
+2007-02-09 21:15 dts12
+
+ * agent/mib_modules.c:
+
+ CHANGES: snmpd: BUG: 1397895: include missing interface declarations
+
+2007-02-08 17:39 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ NEWS: snmpd: patch from Wojtek Jawor to handle row deletion issues in dataset tables
+
+2007-02-07 17:17 hardaker
+
+ * agent/mibgroup/tunnel.h, mibs/IPV6-FLOW-LABEL-MIB.txt
+:
+
+ added the flow lable mib, which the tunnel-mib refers to
+
+2007-02-05 23:02 tanders
+
+ * dist/nsb-functions:
+
+ more portability fixes
+
+2007-02-05 22:50 tanders
+
+ * dist/check-api-change:
+
+ use /bin/sh unless bash features are really needed
+
+2007-02-05 21:52 rstory
+
+ * Makefile.top:
+
+ note that current should be bumped by 5 when bumped
+
+2007-02-05 21:49 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ - note that current should be bumped by 5 when updated
+ - add pointer to new check-api-changes script
+
+2007-02-05 21:46 rstory
+
+ * dist/check-api-change:
+
+ simplistic new script to help check for api changes between releases
+
+2007-02-05 21:38 rstory
+
+ * agent/mibgroup/struct.h:
+
+ make new struct member conditional, since use is conditional
+
+2007-02-05 21:20 tanders
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ move function call out of assert
+
+2007-02-05 15:16 dts12
+
+ * snmplib/vacm.c:
+
+ CHANGES: snmplib: PATCH: 1641895: Extend short view masks (as per RFC specs)
+ Patch supplied by Michael Kirkham.
+
+2007-02-05 14:31 dts12
+
+ * agent/mibgroup/notification/snmpNotifyFilterProfileTable.c:
+
+ CHANGES: snmpd: PATCH: 1639360: Fix snmpNotifyFilterProfileTable row creation.
+ Patch supplied by Michael Kirkham.
+
+2007-02-05 11:01 dts12
+
+ * snmplib/callback.c:
+
+ Fix compilation if LOCK_PER_CALLBACK_SUBID not defined.
+ Reported by Emi Yanagi
+
+2007-02-05 09:48 dts12
+
+ * FAQ:
+
+ Spelling correction: 'superceded' -> 'superseded'
+ (Oh, the shame of it!)
+
+2007-01-31 13:51 tanders
+
+ * Makefile.top:
+
+ CHANGES: build: BUG: 1647976: Cygwin/MinGW Windows build fails due to libtool error
+
+2007-01-30 13:39 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ CHANGES: build: yet another fix to address build issues with ethtool (on RH9).
+ Patch provided by Magnus Fromreide.
+
+2007-01-30 09:10 dts12
+
+ * FAQ:
+
+ Clarify when symlink fix is/isn't appropriate. Synch with Wiki.
+
+2007-01-29 11:12 dts12
+
+ * FAQ:
+
+ Authenticated SNMPv3 requests still need a username. (Synch with Wiki)
+
+2007-01-29 11:03 tanders
+
+ * python/netsnmp/client_intf.c, agent/helpers/table.c
+:
+
+ get rid of C++ comments
+
+2007-01-28 13:36 tanders
+
+ * dist/nsb-functions:
+
+ fix bad test
+
+2007-01-28 13:06 tanders
+
+ * dist/nsb-functions:
+
+ rename variable to resolve name clash and to unbreak nightly builds on Solaris
+
+2007-01-28 12:52 tanders
+
+ * agent/helpers/table_tdata.c:
+
+ get rid of C++ comments
+
+2007-01-27 14:40 tanders
+
+ * dist/nsb-nightly:
+
+ fix typo
+
+2007-01-27 14:23 tanders
+
+ * agent/helpers/table_data.c:
+
+ get rid of C++ comments
+
+2007-01-26 11:15 tanders
+
+ * dist/: nsb-config, nsb-functions, nsb-nightly
+, nsb-package:
+
+ more Bourne shell compatibility fixes
+
+2007-01-25 22:41 tanders
+
+ * configure, configure.in:
+
+ CHANGES: FreeBSD: fix configure warning for sys/conf.h
+
+2007-01-25 22:22 tanders
+
+ * agent/mibgroup/ip-mib/ipv4InterfaceTable/.cvsignore:
+
+ replace by more reasonable content
+
+2007-01-25 22:05 tanders
+
+ *
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c
+, local/mib2c-conf.d/subagent.m2c:
+
+ fix typo
+
+2007-01-25 21:31 tanders
+
+ * README.irix:
+
+ CHANGES: documentation: PATCH: 1644735: from "Brent Bice": add gcc build instructions for IRIX
+
+2007-01-25 21:11 tanders
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: snmpd: PATCH: 1644714: from "Leland Wallace": replace last remaining instance of deprecated copy_word by copy_nword
+
+2007-01-25 15:30 tanders
+
+ * dist/: nsb-config, nsb-functions, nsb-nightly
+, nsb-package, nsb-platform:
+
+ many Bourne shell portability fixes
+
+2007-01-24 16:39 dts12
+
+ * dist/: nsb-config, nsb-functions, nsb-nightly
+, nsb-package, nsb-platform:
+
+ Pre-Posix Bourne shell compatability.
+
+2007-01-24 14:02 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Tweak debug output
+
+2007-01-24 13:58 dts12
+
+ * local/mib2c-update:
+
+ Shellscript portability. (Everything has /bin/sh)
+
+2007-01-24 13:49 dts12
+
+ * dist/: cvsshow, cvsup, nsb-config,
+ nsb-functions, nsb-nightly, nsb-package,
+ nsb-platform:
+
+ Improve shell-script portability. (Everything has /bin/sh!)
+
+2007-01-24 13:40 dts12
+
+ * snmplib/: snmpUDPDomain.c, snmp_client.c:
+
+ Extra debugging output
+
+2007-01-24 13:38 dts12
+
+ * agent/helpers/table.c, agent/helpers/table_container.c
+, agent/helpers/table_data.c,
+ agent/helpers/table_tdata.c, include/net-snmp/agent/table.h
+, include/net-snmp/agent/table_container.h,
+ include/net-snmp/agent/table_tdata.h:
+
+ Preliminary table unregistration API.
+
+2007-01-24 13:11 dts12
+
+ * apps/snmptrapd_log.c:
+
+ Move hostname translation into the transport-specific library routines.
+ (Where it belongs!)
+
+2007-01-24 13:04 dts12
+
+ * include/net-snmp/library/snmp_transport.h,
+ snmplib/snmpUDPDomain.c:
+
+ Basic framework for transport-specific translation of hostnames.
+
+2007-01-24 12:27 dts12
+
+ * apps/snmptrapd_log.c:
+
+ Suppress assorted warnings.
+
+2007-01-24 12:18 tanders
+
+ * include/net-snmp/types.h:
+
+ make sure uintptr_t is always defined as unsigned. Spotted by David Ford.
+
+2007-01-23 22:50 rstory
+
+ * agent/mibgroup/:
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
+, ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
+,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
+:
+
+ don't try to remove a row that was never inserted
+
+2007-01-23 22:38 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ don't try to remove a row that was never inserted
+
+2007-01-23 16:22 dts12
+
+ * agent/mibgroup/target/snmpTargetParamsEntry.c:
+
+ CHANGES: snmpd: PATCH: 1639282: Save persistent snmpTargetParamsTable settings correctly.
+ Fix provided by Michael Kirkham.
+
+2007-01-23 16:12 dts12
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ CHANGES: snmpd: PATCH: 1637287: Handle multiple target tags correctly.
+ Fix provided by Michael Kirkham.
+
+2007-01-23 16:12 dts12
+
+ * agent/mibgroup/target/target.c:
+
+ NEWS: snmpd: PATCH: 1637287: Handle multiple target tags correctly.
+ Fix provided by Michael Kirkham.
+
+2007-01-23 15:44 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCH: 1634620: Fix leaks from create_user_from_session failure.
+ Patch provided by Michael Kirkham.
+
+2007-01-23 14:51 dts12
+
+ * apps/snmptrapd_log.c:
+
+ CHANGES: snmptrapd: BUG: 1638225: Fix interpretation of transport address data.
+ (Keep this consistent with snmpUDPDomain.c)
+ This does not feel the right way to handle this!
+
+2007-01-23 14:10 dts12
+
+ * agent/agent_trap.c:
+
+ Bring trap handling in line with RFC 2576/3584 - drop SNMPv1 traps
+ containing Counter64 varbinds. Requested by Magnus Fromreide.
+
+2007-01-22 22:30 tanders
+
+ * snmplib/read_config.c:
+
+ CHANGES: snmplib: PATCH: 1641972: from magfr: add missing const
+
+2007-01-22 16:40 dts12
+
+ * agent/agent_trap.c:
+
+ CHANGES: snmpd: PATCH: 1641332: Include missing agent config definitions.
+
+2007-01-22 16:18 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.c:
+
+ fix typo overwriting container name
+
+2007-01-22 16:16 dts12
+
+ * agent/mibgroup/agentx/: master.c, master_admin.c:
+
+ CHANGES: snmpd: PATCH: 1641685: Handle unresponsive AgentX subagents more reliably.
+ Fix provided by Josef Moellers
+
+2007-01-22 15:51 dts12
+
+ * snmplib/vacm.c:
+
+ CHANGES: snmplib: PATCH: 1640114: Don't store trailing null character.
+ Reported by Michael Kirkham.
+
+2007-01-19 16:53 dts12
+
+ * include/net-snmp/net-snmp-config.h.in,
+ agent/mibgroup/hardware/cpu/cpu_nlist.c:
+
+ NEWS: BUGS 1633483: Support CPU HAL on FreeBSD4.x
+ (before CPU definitions were moved to <sys/resource.h>)
+
+2007-01-19 16:53 dts12
+
+ * configure, configure.in:
+
+ CHANGES: FreeBSD: BUG: 1633483: Support CPU HAL on FreeBSD4.x
+ (before CPU definitions were moved to <sys/resource.h>)
+
+2007-01-19 16:15 dts12
+
+ * apps/snmptrapd.c:
+
+ library layering improvements: *move* (rather than copy) global variables
+ from snmptrapd to libnetsnmptrapd
+
+2007-01-19 14:18 tanders
+
+ * configure, configure.in,
+ agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ CHANGES: Linux: fix ethtool configure check for recent systems (e.g. FC6, RHEL5).
+ Patch provided by Magnus Fromreide.
+
+2007-01-19 11:25 tanders
+
+ * configure.in, configure,
+ include/net-snmp/net-snmp-config.h.in,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c:
+
+ CHANGES: build: add configure check for hasmntopt to fix the build on systems that lack it
+
+2007-01-18 12:50 tanders
+
+ * apps/snmptrapd_handlers.c:
+
+ library layering improvements: move global variables from snmptrapd to libnetsnmptrapd
+
+2007-01-18 11:13 tanders
+
+ * apps/snmptrapd.c, apps/snmptrapd_handlers.c,
+ man/snmptrapd.8.def, man/snmptrapd.conf.5.def:
+
+ drop "-e"/printEventNumbers support for snmptrapd (obsolete, deprecated and breaks library layering)
+
+2007-01-16 10:04 dts12
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ Reset 'send' flag to consider each sink individually.
+ Reported by Michael Kirkham.
+
+2007-01-16 10:02 dts12
+
+ * agent/agent_trap.c:
+
+ Protect against sending mismatched traps (v1 trap on v2 sink).
+ Reported by Michael Kirkham.
+
+2007-01-16 09:53 dts12
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Don't hardcode the size of counter64 structure (may be wrong on 64-bit boxes)
+
+2007-01-16 09:00 dts12
+
+ * agent/agent_trap.c:
+
+ Extra debugging output.
+
+2007-01-11 22:13 tanders
+
+ * agent/mibgroup/util_funcs.c,
+ agent/mibgroup/utilities/execute.c,
+ include/net-snmp/library/system.h, snmplib/system.c
+:
+
+ CHANGES: snmplib: library layering improvements: introduce netsnmp_mktemp to prevent libnetsnmpagent from depending on libnetsnmpmibs
+
+2007-01-11 21:35 hardaker
+
+ * configure.in:
+
+ changed autoconf req to 2.61
+
+2007-01-11 21:28 hardaker
+
+ * snmplib/: snmpAAL5PVCDomain.c, snmpIPXDomain.c,
+ snmpSTDDomain.c, snmpTCPDomain.c,
+ snmpTCPIPv6Domain.c, snmpUDPDomain.c,
+ snmpUDPIPv6Domain.c, snmp_service.c,
+ snmp_transport.c:
+
+ Patch from Magnus Fromreide to make the transport systems C++ compatible
+
+2007-01-11 09:17 dts12
+
+ * man/snmptrapd.8.def:
+
+ Fix some mangled text.
+
+2007-01-10 20:58 tanders
+
+ * man/snmpd.8.def:
+
+ CHANGES: documentation: BUG: 1614104: broken snmpd(8) manual page in 5.4
+
+2007-01-09 21:50 tanders
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ CHANGES: Solaris: IF-MIB fix: add missing return at end of get_if_stats
+
+2007-01-08 08:30 tanders
+
+ * agent/Makefile.in:
+
+ CHANGES: build: library layering improvements: build libraries in the correct order (libnetsnmpagent before libnetsnmphelpers before libnetsnmpmibs)
+
+2007-01-07 19:47 tanders
+
+ * include/net-snmp/library/snmp_service.h:
+
+ add missing declaration for netsnmp_register_service_handlers (from magfr)
+
+2007-01-06 00:54 tanders
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ CHANGES: Solaris: BUG: 1626153: no hrSWRun informations on Solaris zones
+ Patch provided by Klaus Muehlfeld
+
+2007-01-06 00:30 tanders
+
+ * perl/agent/agent.xs:
+
+ CHANGES: perl: BUG: 1450669: PATCH: 1627949: from martin987: a perl agentx consumes memory
+
+2007-01-03 22:42 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ get rid of C++ comments
+
+2007-01-02 23:33 tanders
+
+ * agent/agent_registry.c:
+
+ BUG: Coverity #173: remove superfluous NULL check (already dereferenced earlier anyway)
+
+2007-01-02 23:08 tanders
+
+ * snmplib/system.c:
+
+ only log a message when the mib_indexes directory is *really* created
+
+2007-01-02 22:53 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ BUG: Coverity #178: never pass a NULL oid_arr_len pointer to __concat_oid_str (which dereferences it)
+
+2007-01-02 22:08 tanders
+
+ * agent/mibgroup/agentx/master.c:
+
+ BUG: Coverity #193: properly initialize session pointer before use
+
+2007-01-02 20:13 tanders
+
+ * agent/agent_registry.c:
+
+ back out previous bad change to agent registry
+
+2007-01-02 19:52 tanders
+
+ * agent/snmp_agent.c:
+
+ CHANGES: snmpd: PATCH: 1601453: from "Robert Wilcox": Dynamic Memory failure handling improvements
+
+2007-01-02 19:52 tanders
+
+ * snmplib/default_store.c, snmplib/read_config.c,
+ agent/agent_registry.c, agent/helpers/null.c,
+ agent/helpers/old_api.c, agent/helpers/stash_cache.c
+, agent/helpers/table.c, agent/helpers/table_array.c
+, agent/helpers/table_dataset.c,
+ snmplib/snmpCallbackDomain.c, snmplib/snmpusm.c,
+ agent/helpers/table_iterator.c, agent/helpers/watcher.c
+, agent/mibgroup/header_complex.c,
+ agent/mibgroup/testhandler.c,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/utilities/override.c:
+
+ CHANGES: PATCH: 1601453: from "Robert Wilcox": Dynamic Memory failure handling improvements
+
+2007-01-02 17:56 tanders
+
+ * Makefile.in:
+
+ remove LD_RUN_PATH comment for python
+
+2007-01-02 17:38 tanders
+
+ * Makefile.top, configure, net-snmp-config.in
+:
+
+ CHANGES: build: update to autoconf 2.61
+
+2007-01-02 17:23 tanders
+
+ * Makefile.in, include/net-snmp/system/kfreebsd.h:
+
+ NEWS: Ports: PATCH: 1623874: from "Petr Salinger": add GNU/kFreeBSD support
+
+2007-01-02 17:17 tanders
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ CHANGES: build: add workaround for AC_FUNC_GETMNTENT() bug in autoconf 2.60b and 2.61 (see Debian bugs #403243, #403079)
+
+2007-01-02 16:48 dts12
+
+ * local/mib2c:
+
+ CHANGES: mib2c: BUG: 1582972: Handle @while@/@end@ properly.
+ Patch provided by Douglas Dean
+
+2007-01-02 16:00 dts12
+
+ * snmplib/: snmpUDPDomain.c, snmpUDPIPv6Domain.c,
+ snmpUnixDomain.c:
+
+ CHANGES: snmplib: BUG: 1600171: Support longer community strings in VACM config.
+ Patch provided by Robert Wilcox
+
+2007-01-02 11:24 dts12
+
+ * agent/agent_trap.c:
+
+ CHANGES: snmpd: BUG: 1546817: Fix snmpEnterprise varbind when forwarding v1 traps.
+ Patch provided by Pablo Passera.
+
+2007-01-02 10:34 dts12
+
+ * configure, configure.in:
+
+ CHANGES: build: PATCH: 1625135: configure location of python interpreter
+ Provided by Andrew Langmead
+
+2007-01-02 10:34 dts12
+
+ * Makefile.in, Makefile.top:
+
+ NEWS: configure: PATCH 1625135: configure location of python interpreter
+ Provided by Andrew Langmead
+
+2007-01-02 10:22 dts12
+
+ * configure.in, configure:
+
+ CHANGES: build: PATCH: 1624406: option to hardcode location of mount table
+ Submitted by Jochen
+
+2007-01-01 17:44 dts12
+
+ * agent/mibgroup/util_funcs.c:
+
+ CHANGES: snmpd: PATCH: 1601188, BUG: 1600432: Handle signals properly when restarting the agent.
+ Fix provided by Loic Domaigne.
+
+2007-01-01 17:35 dts12
+
+ * snmplib/mib.c:
+
+ Handle non-writable MIB indexes (e.g. run as non-privileged user)
+
+2007-01-01 16:09 dts12
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_client.c
+:
+
+ NEWS: snmplib: PATCHES 1592706: Fix memory leak when cloning varbinds.
+ Based on a suggestion by Steven Dorigotti.
+
+2007-01-01 16:09 dts12
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCH: 1592706: Fix memory leak when cloning varbinds.
+ Based on a suggestion by Steven Dorigotti.
+
+2007-01-01 15:48 dts12
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ NEWS: agent: PATCH 1585146: Extend range of available error codes
+ Submitted by Anthony Novatsis.
+
+2007-01-01 15:29 dts12
+
+ * snmplib/mib.c:
+
+ CHANGES: snmplib: PATCH: 1548670: Fix range checks for unsigned integers
+ From Kevin Humphries. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=383380
+
+2007-01-01 15:16 dts12
+
+ * apps/: snmpdf.c, snmpget.c, snmpgetnext.c,
+ snmpset.c:
+
+ Move global 'failures' variable closer to where it is used.
+ CHANGES: apps: PATCH: 1529523: Close SNMP session on failure.
+
+2007-01-01 14:38 dts12
+
+ * snmplib/snmp_service.c:
+
+ Protect against potential double delete.
+ Patch provided by Magnus Fromreide.
+
+2007-01-01 14:22 dts12
+
+ * include/net-snmp/library/mib.h, snmplib/mib.c,
+ snmplib/parse.c:
+
+ Maintain MIB directory index files under /var/net-snmp
+ (in line with File Hierarchy Standard specifications)
+ See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=389434
+ and discussion "MIBs in net-snmp" on coders list (Oct 2006)
+
+2007-01-01 11:28 dts12
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ Ensure sysORDescriptions are null-terminated, so they can be
+ safely passed to 'strdup()'. Reported by Wolfgang Pedot.
+
+2006-12-29 17:25 dts12
+
+ * FAQ:
+
+ Synchronise with Wiki version.
+
+2006-12-28 23:29 tanders
+
+ * snmplib/snmpUDPDomain.c:
+
+ CHANGES: snmplib: PATCH: 1616912: from "Magnus Fromreide": fix memory leak in snmp_udp_transport
+
+2006-12-28 23:00 tanders
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ CHANGES: Solaris: PATCH: 1623447: from "Hrvoje Habjanic": hrSWRun fix: <exited> instead of endOfTable for terminated processes
+
+2006-12-27 19:17 rstory
+
+ * agent/mibgroup/mibII/at.c:
+
+ fix external reference to NETSNMP_KLOOKUP on HP-UX 10.20 (maybe others)
+
+2006-12-26 16:52 alex_b
+
+ * agent/mibgroup/struct.h, agent/mibgroup/util_funcs.c
+, agent/mibgroup/utilities/execute.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ CHANGES: Win32: PATCH: 1622080: from Grueninger A: pass Win32 handles remain open.
+
+2006-12-17 18:01 alex_b
+
+ * win32/: Makefile-apps.in, libsnmp_dll/Makefile.in,
+ snmpd/Makefile.in, snmpdsdk/Makefile.in,
+ snmpnetstat/Makefile.in, snmptrapd/Makefile.in:
+
+ Add gdi32.lib to fix linking problem when using the static version of the
+ SSL libraries. Thanks to Simon Edwards for the fix.
+
+2006-12-17 16:51 alex_b
+
+ * FAQ:
+
+ Update Windows info in the FAQ
+
+2006-12-12 23:53 tanders
+
+ * agent/mibgroup/host/: hr_filesys.c, hr_storage.c,
+ hr_swinst.c:
+
+ CHANGES: Linux: PATCH: 1581294: from "Michael Tatarinov": host-resources improvements
+
+2006-12-12 21:27 tanders
+
+ * win32/net-snmp/: net-snmp-config.h, net-snmp-config.h.in
+:
+
+ re-add UDP_ADDRESSES_IN_HOST_ORDER
+
+2006-12-12 21:01 tanders
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ sync with win32/net-snmp/net-snmp-config.h
+
+2006-12-12 20:31 tanders
+
+ * win32/Configure:
+
+ CHANGES: Win32: fix win32/Configure --with-ipv6
+
+2006-12-12 18:10 tanders
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ NEWS: Win32: fix AES support
+
+2006-12-12 03:01 alex_b
+
+ * local/FAQ2HTML:
+
+ Add version to FAQ.html.
+
+2006-12-09 17:11 alex_b
+
+ * man/: Makefile.in, make_index.pl, man_sections.txt
+:
+
+ -Create html pages for ALL man pages.
+ -Improve error message when creating the index.html file.
+
+2006-12-09 17:06 alex_b
+
+ * local/: html-add-header-footer.pl, html-textfile-fix.pl
+:
+
+ Add tidy command line option and add missing README files.
+
+2006-12-09 00:16 tanders
+
+ * include/net-snmp/system/: darwin8.h, darwin9.h:
+
+ CHANGES: MacOSX: PATCH: 1600453: from "Chris Jalbert": OS X compile-time endian determination
+
+2006-12-08 22:47 tanders
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ document some more post-release tasks
+
+2006-12-08 22:26 tanders
+
+ * man/netsnmp_agent.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3
+, man/netsnmp_baby_steps.3,
+ man/netsnmp_bulk_to_next.3, man/netsnmp_cache_handler.3
+, man/netsnmp_callback.3, man/netsnmp_container.3
+, man/netsnmp_data_list.3, man/netsnmp_debug.3
+, man/netsnmp_default_store.3, man/netsnmp_handler.3
+, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, man/netsnmp_mib_maintenance.3
+, man/netsnmp_mib_utilities.3,
+ man/netsnmp_mode_end_call.3, man/netsnmp_multiplexer.3
+, man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3
+, man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3
+, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3
+, man/netsnmp_stash_to_next.3, man/netsnmp_table.3
+, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3
+, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3
+, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_iterator.h.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_rows.3
+, man/netsnmp_tdata.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3
+, man/netsnmp_watcher.3, perl/ASN/ASN.pm,
+ perl/AnyData_SNMP/Storage.pm, perl/OID/OID.pm,
+ perl/SNMP/SNMP.pm, perl/TrapReceiver/TrapReceiver.pm
+, perl/agent/agent.pm, perl/agent/Support/Support.pm
+, perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm, configure,
+ configure.in, doxygen.conf, sedscript.in,
+ dist/Makefile, dist/net-snmp.spec,
+ snmplib/snmp_version.c, FAQ, README:
+
+ - version tag ( 5.5.dev )
+
+2006-12-08 22:20 tanders
+
+ * local/Version-Munge.pl:
+
+ fix dist/Makefile munging
+
+2006-12-08 14:30 rstory
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c:
+
+ NEWS: BUG: 1611524: fix tcp connection table fd leak
+
+2006-12-08 13:17 marz
+
+ * perl/SNMP/: Makefile.PL, SNMP.pm:
+
+ revert uninformed version change
+
+2006-12-07 21:50 uid39039
+
+ * perl/SNMP/: Makefile.PL, SNMP.pm, SNMP.xs,
+ t/conf.t:
+
+ clean up compile and fix tests
+
+2006-12-07 16:48 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ comment fix
+
+2006-12-07 15:52 tanders
+
+ * agent/mibgroup/hardware/: cpu.h, cpu/cpu_mach.c,
+ cpu/cpu_mach.h:
+
+ NEWS: MacOSX: PATCH: 1600522: from "Bill Fenner": CPU HAL implementation for mach/darwin
+
+2006-12-07 13:10 tanders
+
+ * perl/SNMP/SNMP.pm:
+
+ CHANGES: documentation: PATCH: 1604580: SNMP(3) manual page corrections (spotted by tek-ops)
+
+2006-12-06 20:30 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ document various aspects of post-release things to do
+
+2006-12-06 15:34 rstory
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ add needed header
+
+2006-12-06 15:10 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c:
+
+ NEWS: snmpd: BUG: 1558823: fix ipAddressTable memory leak
+
+2006-12-06 15:01 rstory
+
+ * agent/mibgroup/ip-forward-mib/:
+ inetCidrRouteTable/inetCidrRouteTable.c,
+ ipCidrRouteTable/ipCidrRouteTable.c:
+
+ NEWS: BUG: 1596638: memory leak in ipCidrRouteTable, inetCidrRouteTable
+
+2006-12-06 14:34 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c:
+
+ tweak/add debug msgs in netsnmp_access_interface_ioctl_ifindex_get
+
+2006-12-05 23:47 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c:
+
+ fix debug message
+
+2006-12-05 23:28 tanders
+
+ * agent/mibgroup/Makefile.in:
+
+ CHANGES: BUG: 1600093: autoconf 2.60 breaks the build
+
+2006-12-04 17:49 hardaker
+
+ * COPYING:
+
+ change top text to remove history section which was out of date
+
+2006-12-03 23:20 alex_b
+
+ * win32/: dist/README.build.win32.txt,
+ netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Win32: Workspace compile fix, build instructions update.
+
+2006-11-24 17:53 hardaker
+
+ * FAQ, README, configure, configure.in
+, sedscript.in, snmplib/snmp_version.c,
+ dist/net-snmp.spec:
+
+ - version tag ( 5.4 )
+
+2006-11-24 17:52 hardaker
+
+ * CHANGES, NEWS:
+
+ version update
+
+2006-11-24 17:48 hardaker
+
+ * ChangeLog:
+
+ version update
+
+-------------------------------------------------------------------------------
+
+Changes: V5.4.rc3 -> V5.4
+
+2006-11-24 09:44 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_agent_registry.3,
+ netsnmp_agent_trap.3, netsnmp_asn1_packet_parse.3,
+ netsnmp_baby_steps.3, netsnmp_bulk_to_next.3,
+ netsnmp_cache_handler.3, netsnmp_callback.3,
+ netsnmp_container.3, netsnmp_data_list.3,
+ netsnmp_debug.3, netsnmp_default_store.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_iterator_info_s.3, netsnmp_leaf.3,
+ netsnmp_library.3, netsnmp_mib_maintenance.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_stash_to_next.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_generic.3,
+ netsnmp_table_indexes.3, netsnmp_table_iterator.3,
+ netsnmp_table_iterator.h.3, netsnmp_table_maintenance.3
+, netsnmp_table_rows.3, netsnmp_tdata.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2006-11-24 09:43 hardaker
+
+ * doxygen.conf:
+
+ - version tag ( 5.4 )
+
+2006-11-24 09:19 hardaker
+
+ * README.win32, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ patch from Alex Burger to fix MSVC issues
+
+2006-11-24 08:09 dts12
+
+ * FAQ:
+
+ Updates to the CODING section.
+ I'm sure there are more changes that could usefully be made,
+ but Life's Too Short. OK, Wes - it's all yours....
+
+2006-11-24 07:38 dts12
+
+ * README:
+
+ Tweak web links slightly, and mention the Wiki.
+
+2006-11-24 07:09 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ doc update based on perl changes
+
+2006-11-24 06:26 dts12
+
+ * FAQ:
+
+ Drop obsolete entries.
+
+2006-11-24 06:23 dts12
+
+ * FAQ:
+
+ Updates to the COMPILING section.
+
+2006-11-24 06:02 dts12
+
+ * FAQ:
+
+ Updates to the rest of the AGENTS section.
+
+2006-11-24 05:41 dts12
+
+ * FAQ:
+
+ Commit revisions to the MIBS and (most of) the AGENTS sections.
+ 43 pages down, 18 to go....
+
+2006-11-24 05:13 tanders
+
+ * FAQ:
+
+ add some more working platforms; perl -> Perl
+
+2006-11-24 03:21 dts12
+
+ * FAQ:
+
+ Revision of the first three sections (GENERAL, APPLICATIONS, PERL).
+ Probably racing a losing battle against packaging the upcoming release!
+
+2006-11-23 19:30 tanders
+
+ * README.solaris:
+
+ updates and cleanup for 5.4
+
+2006-11-23 17:11 tanders
+
+ * agent/mibgroup/README.smux:
+
+ CHANGES: documentation: PATCH: 1601261: from "Stephen J. Friedl": update README.smux
+
+2006-11-23 16:38 tanders
+
+ * dist/net-snmp.spec:
+
+ CHANGES: misc: RPM spec file fixes for 64-bit platforms
+
+2006-11-23 01:07 dts12
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ Remove irrelevant comments (left over from the development phase).
+
+2006-11-22 16:06 hardaker
+
+ * dist/Makefile:
+
+ use --without for perl now if off
+
+2006-11-22 15:54 hardaker
+
+ * dist/Makefile:
+
+ final verison change
+
+2006-11-22 15:25 tanders
+
+ * dist/net-snmp.spec:
+
+ revert to correct version
+
+2006-11-22 15:23 tanders
+
+ * dist/net-snmp.spec:
+
+ - remove bad patch reference
+ - enable Perl by default, but allow for --without perl_modules|embedded_perl
+ - add netsnmp_ prefix for local defines
+
+2006-11-22 08:49 dts12
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ Clarification of the behaviour of objects in the memory & systemStats groups,
+ and objects used for reporting/fixing errors.
+
+2006-11-22 07:07 hardaker
+
+ * man/: .cvsignore, Makefile.in:
+
+ manalias always-made fix; now touches a temp file (and cleans later)
+
+2006-11-22 05:25 tanders
+
+ * .cvsignore:
+
+ add new 'mk' subdir
+
+2006-11-22 05:24 tanders
+
+ * man/.cvsignore:
+
+ add new manual pages
+
+2006-11-22 05:03 tanders
+
+ * snmplib/system.c:
+
+ CHANGES: snmpd: PATCH: 1598966: from "Peter Eckel": Fix bug #1598927: #elif build fix
+
+2006-11-22 04:58 tanders
+
+ * apps/snmptrapd.c:
+
+ CHANGES: snmptrapd: PATCH: 1598968: from "Peter Eckel": Fix bug #1587759: snmptrapd doesn't recognize -A option
+
+2006-11-18 09:56 marz
+
+ * python/netsnmp/client_intf.c:
+
+ fixes for None return tpye and octet val handling
+
+2006-11-18 07:28 hardaker
+
+ * FAQ, README, configure, configure.in
+, sedscript.in, snmplib/snmp_version.c,
+ dist/net-snmp.spec:
+
+ - version tag ( 5.4.rc3 )
+
+-------------------------------------------------------------------------------
+
+Changes: V5.4.rc2 -> V5.4.rc3
+
+2006-11-18 07:14 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_agent_registry.3,
+ netsnmp_agent_trap.3, netsnmp_asn1_packet_parse.3,
+ netsnmp_baby_steps.3, netsnmp_bulk_to_next.3,
+ netsnmp_cache_handler.3, netsnmp_callback.3,
+ netsnmp_container.3, netsnmp_data_list.3,
+ netsnmp_debug.3, netsnmp_default_store.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_iterator_info_s.3, netsnmp_leaf.3,
+ netsnmp_library.3, netsnmp_mib_maintenance.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_stash_to_next.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_generic.3,
+ netsnmp_table_indexes.3, netsnmp_table_iterator.3,
+ netsnmp_table_iterator.h.3, netsnmp_table_maintenance.3
+, netsnmp_table_rows.3, netsnmp_tdata.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2006-11-18 07:13 hardaker
+
+ * doxygen.conf:
+
+ - version tag ( 5.4.rc3 )
+
+2006-11-18 06:31 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ fix missing memCached.0 patch from Thomas Anders
+
+2006-11-16 20:47 hardaker
+
+ * configure:
+
+ patch from Thomas Anders to fix perl CC extraction to allow for paths
+
+2006-11-16 20:43 hardaker
+
+ * configure.in:
+
+ patch from Thomas Anders to fix perl CC extraction to allow for paths
+
+2006-11-16 13:38 tanders
+
+ * man/Makefile.in:
+
+ add new manual pages to the build process
+
+2006-11-16 01:36 tanders
+
+ * snmplib/system.c:
+
+ properly protect nlist code to fix build issues w/ --without-kmem-usage
+
+2006-11-15 16:22 tanders
+
+ * man/: encode_keychange.1.def, fixproc.1.def,
+ mib2c-update.1.def, net-snmp-config.1.def,
+ tkmib.1.def, traptoemail.1.def:
+
+ CHANGES: documentation: BUG: 1577913: add missing manual pages for executables, supplied by Debian
+
+2006-11-15 15:35 tanders
+
+ * man/snmpnetstat.1.def:
+
+ Update to the new syntax of the snmpnetstat rewrite. Inspired by Debian.
+
+2006-11-15 14:45 tanders
+
+ * man/snmpset.1.def:
+
+ format fix (from Debian patch 07_docfiles.patch)
+
+2006-11-15 11:35 tanders
+
+ * man/snmp_trap_api.3.def:
+
+ Put description on a single line. Taken from Debian patch 07_docfiles.patch
+
+2006-11-14 16:01 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_nlist.c:
+
+ Fix initialisation problem (which results in the agent failing
+ to start on FreeBSD systems, when run as an unprivileged user).
+
+2006-11-14 15:44 tanders
+
+ * doc/rfc/smiV2/rfc2579.errata~:
+
+ do we agree to not ship editor backup copies?
+
+2006-11-14 03:18 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ udpTable requires /dev/kmem access on IRIX and Tru64 Unix
+
+2006-11-14 01:56 tanders
+
+ * man/mib_api.3.def:
+
+ CHANGES: PATCH: 1596028: from "Stephen J. Friedl": const fixes for the mib_api(3) manual page
+
+2006-11-13 16:17 tanders
+
+ * perl/agent/test.pl:
+
+ CHANGES: perl: make perltest fixes for Solaris 2.6 and earlier
+
+2006-11-13 15:54 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ NEWS: perl: SNMP.pm fixes for 64-bit platforms
+
+2006-11-13 15:49 tanders
+
+ * perl/SNMP/t/bulkwalk.t:
+
+ CHANGES: perl: make perltest fixes for HP-UX
+
+2006-11-13 15:26 tanders
+
+ * perl/agent/test.pl:
+
+ Drop Data::Dumper since Perl 5.00405 as shipped with IRIX 6.5 doesn't include it.
+
+2006-11-13 14:51 tanders
+
+ * perl/OID/test.pl:
+
+ Drop unneeded dependency on Data::Dumper.
+
+2006-11-13 14:46 tanders
+
+ * perl/SNMP/t/bulkwalk.t:
+
+ CHANGES: perl: make perltest fixes for IRIX
+
+2006-11-12 17:53 alex_b
+
+ * README.win32, win32/Makefile-apps.in,
+ win32/Makefile.in, win32/snmpd/Makefile.in,
+ win32/snmpdsdk/Makefile.in, win32/snmpnetstat/Makefile.in
+, win32/snmptrapd/Makefile.in:
+
+ Remove warnings about compiling with the SNMP library DLL.
+
+2006-11-10 03:24 tanders
+
+ * README.osX:
+
+ remove --enable-mini-agent recommendation because --without-kmem-usage no longer requires it
+
+2006-11-10 01:21 dts12
+
+ * man/Makefile.in:
+
+ Reference the correct man page for snmp_trap_api aliases.
+ Reported and fixed by Chris Jalbert.
+
+2006-11-08 08:24 hardaker
+
+ * FAQ, README, snmplib/snmp_version.c,
+ configure, configure.in, sedscript.in,
+ dist/net-snmp.spec:
+
+ - version tag ( 5.4.rc2 )
+
+-------------------------------------------------------------------------------
+
+Changes: V5.4.rc1 -> V5.4.rc2
+
+2006-11-08 07:56 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_agent_registry.3,
+ netsnmp_agent_trap.3, netsnmp_asn1_packet_parse.3,
+ netsnmp_baby_steps.3, netsnmp_bulk_to_next.3,
+ netsnmp_cache_handler.3, netsnmp_callback.3,
+ netsnmp_container.3, netsnmp_data_list.3,
+ netsnmp_debug.3, netsnmp_default_store.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_iterator_info_s.3, netsnmp_leaf.3,
+ netsnmp_library.3, netsnmp_mib_maintenance.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_stash_to_next.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_generic.3,
+ netsnmp_table_indexes.3, netsnmp_table_iterator.3,
+ netsnmp_table_iterator.h.3, netsnmp_table_maintenance.3
+, netsnmp_table_rows.3, netsnmp_tdata.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2006-11-08 07:55 hardaker
+
+ * doxygen.conf:
+
+ - version tag ( 5.4.rc2 )
+
+2006-11-08 07:27 hardaker
+
+ * agent/helpers/row_merge.c:
+
+ Patch from Robert to check processed flag before proceeding
+
+2006-11-07 15:33 dts12
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ Fix duplicate case statements (and indicate which are the deprecated objects)
+
+2006-11-07 14:14 dts12
+
+ * agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h, mibs/UCD-SNMP-MIB.txt
+:
+
+ Clarify meaning of mem*Text objects (and define new consistent versions).
+
+2006-11-07 06:54 hardaker
+
+ * mibs/NET-SNMP-TC.txt:
+
+ add a missing paren to a description field
+
+2006-11-07 06:54 hardaker
+
+ * configure.in, configure, Makefile.in,
+ net-snmp-config.in, agent/Makefile.in:
+
+ patch to fix sed usage on systems with a very old sed
+
+2006-11-06 15:50 tanders
+
+ * README.irix:
+
+ mention --without-kmem-usage
+
+2006-11-06 15:43 tanders
+
+ * agent/mibgroup/mibII/: at.c, interfaces.c, ipAddr.c
+, ipv6.c, tcpTable.c, udpTable.c,
+ var_route.c:
+
+ improved klookup error handling
+
+2006-11-06 15:41 tanders
+
+ * configure, README.aix, configure.in,
+ agent/kernel.h:
+
+ CHANGES: snmpd: build fix for --without-kmem-usage
+
+2006-11-06 07:16 tanders
+
+ * testing/tests/: T120proxyget, T121proxyset,
+ T122proxysetfail:
+
+ sh doesn't like "==", of course.
+
+2006-11-06 03:16 tanders
+
+ * testing/tests/: T120proxyget, T121proxyset,
+ T122proxysetfail:
+
+ skip proxy tests for TCP because the proxy code doesn't support TCP yet
+
+2006-11-03 17:39 tanders
+
+ * testing/tests/: T058agentauthtrap, T065agentextend,
+ T200snmpv2cwalkall:
+
+ CHANGES: misc: "make test" fixes for non-UDP transports
+
+2006-11-03 08:40 marz
+
+ * python/netsnmp/: client.py, client_intf.c:
+
+ memory leak fixes for python interface
+
+2006-11-02 15:30 tanders
+
+ * man/.cvsignore:
+
+ add new man page aliases
+
+2006-11-01 15:53 tanders
+
+ * ChangeLog:
+
+ ChangeLog shall only document changes of the branch it's contained in
+
+2006-11-01 08:36 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ CHANGES: BUG: 1585815: fix mfd bits length calculation
+
+2006-10-31 14:29 hardaker
+
+ * FAQ, README, configure, configure.in
+, sedscript.in, snmplib/snmp_version.c,
+ dist/net-snmp.spec:
+
+ - version tag ( 5.4.rc1 )
+
+-------------------------------------------------------------------------------
+
+Changes: V5.4.pre4 -> V5.4.rc1
+
+2006-10-31 12:51 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_agent_registry.3,
+ netsnmp_agent_trap.3, netsnmp_asn1_packet_parse.3,
+ netsnmp_baby_steps.3, netsnmp_bulk_to_next.3,
+ netsnmp_cache_handler.3, netsnmp_callback.3,
+ netsnmp_container.3, netsnmp_data_list.3,
+ netsnmp_debug.3, netsnmp_default_store.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_iterator_info_s.3, netsnmp_leaf.3,
+ netsnmp_library.3, netsnmp_mib_maintenance.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_stash_to_next.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_generic.3,
+ netsnmp_table_indexes.3, netsnmp_table_iterator.3,
+ netsnmp_table_iterator.h.3, netsnmp_table_maintenance.3
+, netsnmp_table_rows.3, netsnmp_tdata.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2006-10-31 12:51 hardaker
+
+ * doxygen.conf:
+
+ - version tag ( 5.4.rc1 )
+
+2006-10-31 12:35 hardaker
+
+ * agent/kernel.h:
+
+ remove the klookup define as (0) since Dave found definite spots where this was unsafe
+
+2006-10-31 07:32 hardaker
+
+ * agent/kernel.h:
+
+ Patch from Thomas Anders to attempt to fix lack of kmem support for various platforms when kmem isn't available
+
+2006-10-31 07:27 hardaker
+
+ * man/Makefile.in:
+
+ fix a problem with the man generation patch as pointed out by Chris Jalbert
+
+2006-10-31 07:16 hardaker
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ minor patch from Bruce Shaw to fix lmsensors 240 class machines
+
+2006-10-30 13:43 tanders
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ CHANGES: snmpd: memTotalFree should report total virtual instead of physical memory
+
+2006-10-30 09:52 tanders
+
+ * agent/mibgroup/hardware/memory/memory_irix.c:
+
+ mem HAL fixes for IRIX
+
+2006-10-30 07:40 hardaker
+
+ * man/Makefile.in:
+
+ use generated alias man pages
+
+2006-10-28 18:23 alex_b
+
+ * README.win32:
+
+ Added --disable-embedded-perl --without-perl-modules for MinGW / Cygwin.
+
+2006-10-27 13:19 alex_b
+
+ * include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/transform_oids.h,
+ win32/Makefile-apps.in, win32/build.pl,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in, win32/snmpd/Makefile.in
+, win32/snmpdsdk/Makefile.in,
+ win32/snmpnetstat/Makefile.in, win32/snmptrapd/Makefile.in
+:
+
+ -Allow building of applications with library DLL in build.bat build system.
+ -Fix DLL export/import variables for library DLL
+
+2006-10-27 07:47 hardaker
+
+ * python/netsnmp/client_intf.c:
+
+ fix walking off of a cliff
+
+2006-10-27 07:32 marz
+
+ * python/netsnmp/client.py:
+
+ client.py
+
+2006-10-27 02:04 tanders
+
+ * local/snmp-ucd.sh:
+
+ CHANGES: misc: BUGS: 1585250: don't use deprecated options in start script
+
+2006-10-26 17:50 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Win32: Add a couple DEBUG lines.
+
+2006-10-26 17:15 alex_b
+
+ * README.win32, win32/dist/README.build.win32.txt:
+
+ Win32: README update, build steps update.
+
+2006-10-26 09:21 tanders
+
+ * CodingStyle:
+
+ minor updates
+
+2006-10-26 04:14 tanders
+
+ * configure, configure.in:
+
+ minor fixes for "configure --help" output, especially for MIB modules
+
+2006-10-26 03:24 tanders
+
+ * include/net-snmp/system/: darwin8.h, darwin9.h:
+
+ CHANGES: MacOSX: build fix for mibII/udpTable
+
+2006-10-25 11:51 alex_b
+
+ * win32/net-snmp/: net-snmp-config.h, net-snmp-config.h.in
+:
+
+ NETSNMP_ prefix missing for OPENSSL.
+
+2006-10-25 09:16 tanders
+
+ * include/net-snmp/library/mib.h,
+ include/net-snmp/library/parse.h, perl/OID/OID.xs,
+ perl/SNMP/README, perl/SNMP/SNMP.xs,
+ perl/agent/agent.xs, snmplib/mib.c,
+ snmplib/parse.c, snmplib/snmp_api.c:
+
+ CHANGES: library: rename init_mib to netsnmp_init_mib to avoid symbol clash with HP-UX's libnm
+
+2006-10-23 14:00 tanders
+
+ * NEWS:
+
+ AIX ships host by default
+
+2006-10-22 18:01 alex_b
+
+ * win32/dist/: README.build.win32.txt,
+ htmlhelp/Developer_FAQ.html, htmlhelp/FAQ.html,
+ htmlhelp/snmp.conf.win32.html,
+ htmlhelp/snmpd.conf.win32.html,
+ htmlhelp/snmptrapd.conf.win32.html, installer/net-snmp.nsi
+:
+
+ Update Windows binary build files.
+
+2006-10-21 09:42 alex_b
+
+ * README.win32:
+
+ winExtDLL update.
+
+2006-10-21 09:36 alex_b
+
+ * README.win32, win32/dist/installer/net-snmp.nsi:
+
+ Readme update for winExtDLL, change command line for winExtDLL.
+
+2006-10-21 07:07 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Code cleanup. Add support for xSnmpExtensionQueryEx for SET/GETNEXT.
+
+2006-10-21 05:45 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Win32: winExtDLL: snmpset string, DLL loading and snmpwalk fixes.
+
+2006-10-21 05:09 hardaker
+
+ * perl/default_store/test.pl:
+
+ remove not-existent SBSM definition from test cases
+
+2006-10-20 17:17 hardaker
+
+ * configure:
+
+ - version tag ( 5.4.pre4 )
+
+-------------------------------------------------------------------------------
+
+Changes: V5.4.pre3 -> V5.4.pre4
+
+2006-10-20 16:59 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Patch from Anders Persson to change t_uscalar_t to something more portable (uint32_t)
+
+2006-10-20 13:43 dts12
+
+ * include/net-snmp/: agent/ds_agent.h,
+ library/default_store.h:
+
+ Document the need to update the corresponding perl interfaces
+ when changes are made.
+
+2006-10-20 08:51 rstory
+
+ * agent/mibgroup/hardware/cpu.h:
+
+ use cpu_null for all darwin, until code works
+
+2006-10-20 08:18 dts12
+
+ * agent/mibgroup/hardware/cpu/: cpu_nlist.c, cpu_sysctl.c
+:
+
+ Clarify comments to reflect reality.
+
+2006-10-20 08:13 tanders
+
+ * agent/mibgroup/hardware/cpu.h:
+
+ fix syntax error; make sure we get cpu_null for darwin6/7, cpu_sysctl for darwin8+
+
+2006-10-20 07:46 rstory
+
+ * agent/mibgroup/hardware/cpu.h:
+
+ use cpu_null for darwin7 and darwin6
+
+2006-10-20 01:44 tanders
+
+ * agent/mibgroup/hardware/cpu.h:
+
+ openbsd4 and darwin should use cpu_sysctl
+
+2006-10-19 22:10 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_agent_registry.3,
+ netsnmp_agent_trap.3, netsnmp_asn1_packet_parse.3,
+ netsnmp_baby_steps.3, netsnmp_bulk_to_next.3,
+ netsnmp_cache_handler.3, netsnmp_callback.3,
+ netsnmp_container.3, netsnmp_data_list.3,
+ netsnmp_debug.3, netsnmp_default_store.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_iterator_info_s.3, netsnmp_leaf.3,
+ netsnmp_library.3, netsnmp_mib_maintenance.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_stash_to_next.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_generic.3,
+ netsnmp_table_indexes.3, netsnmp_table_iterator.3,
+ netsnmp_table_iterator.h.3, netsnmp_table_maintenance.3
+, netsnmp_table_rows.3, netsnmp_tdata.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2006-10-19 22:10 hardaker
+
+ * doxygen.conf:
+
+ - version tag ( 5.4.pre4 )
+
+2006-10-19 16:44 tanders
+
+ * agent/mibgroup/hardware/cpu/cpu_nlist.c:
+
+ fix up header inclusion a bit
+
+2006-10-19 15:38 rstory
+
+ * agent/mibgroup/hardware/memory.h:
+
+ test for darwing before freebsd, since darwin defines freebsd
+
+2006-10-19 14:42 hardaker
+
+ * agent/mibgroup/if-mib/ifXTable/: ifXTable.c,
+ ifXTable_data_access.c, ifXTable_interface.c:
+
+ fix broken bad evil ifTable.h usage
+
+2006-10-19 13:38 hardaker
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.c, ifTable.h
+, ifTable_data_access.c, ifTable_defs.h,
+ ifTable_interface.c:
+
+ don't let ifTable.h redefine random symbols affecting other code
+
+2006-10-19 08:50 hardaker
+
+ * agent/Makefile.in:
+
+ remove libhelpers from the link line of libagents
+
+2006-10-19 08:47 hardaker
+
+ * snmplib/snmp_api.c:
+
+ fix transport sock patch
+
+2006-10-19 07:15 hardaker
+
+ * include/net-snmp/system/: darwin8.h, darwin9.h:
+
+ CHANGES: snmpd: PATCH: 1579364: from jalbert: Updated darwin patch to fix compilation on Tiger and Leapord
+
+2006-10-18 16:52 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Win32: winExtDLL: Finish adding support for DLLs that support multiple
+ ranges.
+
+2006-10-18 14:11 dts12
+
+ * agent/mibgroup/disman/event/: mteEventConf.c,
+ mteEventConf.h, mteObjectsConf.c, mteObjectsConf.h
+, mteTriggerConf.c, mteTriggerConf.h:
+
+ Cleanly handle re-loading "monitor" (and related) directives.
+
+2006-10-18 14:09 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Handle invalid payload object OIDs.
+
+2006-10-18 12:07 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Cleanly handle re-loading "extend" directives.
+
+2006-10-18 07:45 rstory
+
+ * dist/cvsup:
+
+ - user /usr/bin/env for portability
+ - only test for tar if we're going to use it
+
+2006-10-18 03:29 tanders
+
+ * man/snmpd.conf.5.def:
+
+ document new pass_persist error messages introduced by patch 1568150
+
+2006-10-17 21:14 hardaker
+
+ * README.osX:
+
+ update from Chris Jalbert
+
+2006-10-17 20:19 hardaker
+
+ * agent/: agent_handler.c, agent_registry.c:
+
+ CHANGES: snmpd: PATCH 1565703: patch to fix rapid registrations/deregistration issues
+
+2006-10-17 20:12 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ NEWS: snmpd: PATCH 1562688: fix ping/reattach agentx code
+
+2006-10-17 20:03 hardaker
+
+ * snmplib/snmp_api.c:
+
+ CHANGES: snmplib: PATCH 1562168: check for a sock fd less than 0.
+
+2006-10-17 19:59 hardaker
+
+ * agent/mibgroup/: util_funcs.c, ucd-snmp/pass_persist.c
+:
+
+ using vfork and named pipes: NEWS: snmpd: PATCH: 1551948: from aproemel: Make pass_persist usable on uClinux
+
+2006-10-17 19:17 hardaker
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ NEWS: snmpd: PATCH: 1568150: from gavin_han: Extend pass_persist error messages that can be passed back from the script
+
+2006-10-17 19:12 hardaker
+
+ * include/net-snmp/library/snmp_logging.h,
+ snmplib/snmp_api.c, snmplib/snmp_logging.c:
+
+ CHANGES: snmplib: PATCH: 1570650: from "Benoit Amiaux": create a logging shutdown function to properly clean up log registrations if needed.
+
+2006-10-17 19:05 hardaker
+
+ * include/net-snmp/agent/table_iterator.h:
+
+ CHANGES: snmpd: PATCH: 1570650: from "Benoit Amiaux": make delete table function public
+
+2006-10-17 18:51 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ CHANGES: perl: PATCH: 1575937: from martin987: fix usenumeric output in async varbinds so they return OIDs instead of empty strings.
+
+2006-10-17 18:46 hardaker
+
+ * agent/snmpd.c:
+
+ CHANGES: snmpd: PATCH: 1575984: from rtyle: block SIGHUP during reconfig
+
+2006-10-17 18:34 hardaker
+
+ * perl/default_store/gen:
+
+ remove correct sub directory
+
+2006-10-17 18:33 hardaker
+
+ * perl/agent/default_store/: default_store.pm,
+ default_store.xs, gen, test.pl:
+
+ update to latest ds_agent.h defines
+
+2006-10-17 16:53 hardaker
+
+ * perl/default_store/: default_store.pm, default_store.xs
+, gen, test.pl:
+
+ support latest h2xs; NEWS: perl: update default_store module to latest default_store c-binding tokens
+
+2006-10-17 16:05 hardaker
+
+ * Makefile.in:
+
+ remove config generated files on a make distclean
+
+2006-10-17 15:55 hardaker
+
+ * configure, configure.in, agent/Makefile.in
+:
+
+ properly fix the sed issues without removing functionality by using files instead of sed expressions
+
+2006-10-17 14:08 tanders
+
+ * agent/kernel.c:
+
+ make klookup debugging less verbose
+
+2006-10-17 13:32 tanders
+
+ * agent/kernel.c:
+
+ add klookup debugging
+
+2006-10-17 10:39 tanders
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ still build if kernel symbols undefined
+
+2006-10-17 09:16 dts12
+
+ * agent/snmp_agent.c, agent/mibgroup/ucd-snmp/proxy.c
+, include/net-snmp/agent/snmp_agent.h:
+
+ Associate errors from delegated requests with the correct varbind,
+ and fix problems with failed proxied requests timing out.
+ Reported by Pablo Passera (See coders list - 5th Oct ff)
+
+2006-10-17 09:10 hardaker
+
+ * configure, configure.in:
+
+ NEWS: build: --enable-as-needed will try to link built libraries against needed libraries at library link time, rather than application link time.
+
+2006-10-17 07:55 hardaker
+
+ * configure.in:
+
+ remove duplicate 'compiler options' header in help output
+
+2006-10-17 07:26 tanders
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ back out host/hr_swrun part of the AIX jumbo patch since it overwrote a more complete, working implementation with a segfaulting one
+
+2006-10-16 16:36 tanders
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ CHANGES: IRIX: proper implementation for UCD-SNMP-MIB::laTable (avoiding nlist)
+
+2006-10-16 11:43 marz
+
+ * python/netsnmp/: client.py, tests/test.py:
+
+ numeric and OID sets with testing
+
+2006-10-16 08:54 tanders
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ disabling nlist shouldn't disable perfstat
+
+2006-10-16 08:21 tanders
+
+ * agent/mibgroup/mibII/at.c:
+
+ deal with missing ARPTAB_SIZE_SYMBOL
+
+2006-10-16 07:54 tanders
+
+ * include/net-snmp/system/osf5.h:
+
+ CHANGES: Tru64: - fix "auto_nlist failed on arptab_size at location 0" errors
+
+2006-10-15 17:23 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Win32: winExtDLL fixes for snmpwalk / snmpgetnext.
+
+2006-10-15 14:44 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Don't moan about normal connection-based transport activity
+ (and *do* moan sensibly about failed sends).
+
+2006-10-15 14:43 dts12
+
+ * snmplib/snmpTCPDomain.c:
+
+ Store TCP/IPv4 address information in the same format as UDP/IPv4.
+ This allows the community -> security name mapping to work correctly.
+ Fixes Bug #1571945.
+ A better (more modular) solution would be preferable (see discussions
+ on the mailing lists), but this should at least allow 5.4 to proceed.
+
+2006-10-15 10:03 tanders
+
+ * agent/kernel.h:
+
+ klookup takes three arguments, not one
+
+2006-10-14 14:28 tanders
+
+ * agent/: auto_nlist.c, kernel.h,
+ mibgroup/host/hr_swrun.c, mibgroup/mibII/at.c,
+ mibgroup/mibII/interfaces.c, mibgroup/mibII/ipAddr.c
+, mibgroup/mibII/ipv6.c, mibgroup/mibII/tcpTable.c
+, mibgroup/mibII/udpTable.c,
+ mibgroup/mibII/var_route.c:
+
+ prepare for 64-bit nlist changes
+
+2006-10-14 10:37 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Win32: winExtDLL: Fix OID sets, memory leaks.
+
+2006-10-14 06:49 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Win32: winExtDLL: Use alarm instead of thread for traps. Various trap
+ fixes.
+
+2006-10-13 16:13 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Win32: winExtDLL: Add trap support for remaining types, fix
+ ASN_IPADDRESS GET support.
+
+2006-10-13 15:16 tanders
+
+ * man/: snmpd.conf.5.def, snmpd.examples.5.def:
+
+ smuxsocket needs to be an IPv4 address
+
+2006-10-13 14:49 dts12
+
+ * README.osX:
+
+ Update with recent build reports from Chris Jalbert.
+
+2006-10-13 14:45 tanders
+
+ * testing/tests/: Sv3config, Sv3usmconfigagent,
+ Svanyconfig:
+
+ smuxsocket needs to be an IPv4 address
+
+2006-10-13 14:36 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ Handle errors from recv() - see Bug #1527930
+
+2006-10-13 14:25 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Explicitly referenced VNAME token when describing "view" token usage.
+ (Suggested by John Rouillard)
+
+2006-10-13 13:50 tanders
+
+ * perl/agent/default_store/: default_store.pm,
+ default_store.xs:
+
+ remove NETSNMP_DS_AGENT_H which isn't a default store variable
+
+2006-10-13 07:14 tanders
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ fix syntax typo
+
+2006-10-13 02:17 tanders
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ don't commit boolean logic late at night
+
+2006-10-13 01:28 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Clarify the parsing of boolean "monitor" expressions.
+
+2006-10-12 15:43 rstory
+
+ * agent/mibgroup/hardware/memory.h:
+
+ use memory_darwin for darwin7
+
+2006-10-12 15:21 dts12
+
+ * agent/mibgroup/utilities/iquery.c:
+
+ Ensure internal query configuration is available (and active)
+ *before* monitor directives attempt to use it.
+
+2006-10-12 15:19 tanders
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ build fix for systems with no RTHOST_SYMBOL or no RTNET_SYMBOL (like AIX)
+
+2006-10-12 09:12 tanders
+
+ * agent/auto_nlist.c:
+
+ fix typo
+
+2006-10-12 09:03 tanders
+
+ * include/net-snmp/system/aix.h:
+
+ CHANGES: AIX: use correct ARPTAB_SYMBOL and ARPTAB_SIZE_SYMBOL
+
+2006-10-12 08:13 tanders
+
+ * agent/auto_nlist.c, include/net-snmp/system/aix.h:
+
+ CHANGES: AIX: BUG 1205300: nlist err: neither nproc nor _nproc found (same for rt_table, rthashsize, rthost, rtnet)
+
+2006-10-12 04:54 dts12
+
+ * configure.in, configure, agent/Makefile.in
+:
+
+ Suppress the substitution of the list of module header files.
+ This is purely a temporary stop-gap fix, to handle sed commands which
+ choke on over-long substitutions. A better approach is needed.
+
+2006-10-12 04:40 dts12
+
+ * NEWS:
+
+ Document Hardware Abstraction Layer (including behaviour changes).
+
+2006-10-12 03:03 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerTable.c:
+
+ Fix handling of assignments to mteTriggerValueID
+ [Bug #1574713, Patch #1574743, from Ross Tyler]
+
+2006-10-12 02:54 dts12
+
+ * Makefile.in, acconfig.h,
+ agent/mibgroup/host/hr_storage.c,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/darwin9.h:
+
+ Tweaks for Darwin 9 support - [Patch #1575433, from Chris Jalbert]
+
+2006-10-12 02:44 dts12
+
+ * include/net-snmp/system/darwin8.h:
+
+ Updated system header file for Darwin8 - [Patch 1575430, by Chris Jalbert]
+
+2006-10-12 02:17 dts12
+
+ * agent/mibgroup/hardware/: cpu.h, memory.h:
+
+ Include the appropriate HAL modules for Darwin (Darwin9) systems.
+ Supplied by Chris Jalbert.
+
+2006-10-11 09:21 rstory
+
+ * NEWS:
+
+ - add note that --enable-mfd-rewrites is needed for experimental if-mib ports
+ - remove line on patch to previously unrelease code
+
+2006-10-11 09:14 rstory
+
+ * include/net-snmp/system/: freebsd.h, openbsd.h:
+
+ include if-mib rewrites if mfd rewrites is defined
+
+2006-10-11 08:02 rstory
+
+ * include/net-snmp/system/solaris.h:
+
+ include if-mib rewrites if mfd rewrites is defined
+
+2006-10-10 17:12 tanders
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ PrivoxyWindowOpen? Must have been missing a major feature addition:-)
+
+2006-10-10 15:32 tanders
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ fix typos
+
+2006-10-10 14:13 tanders
+
+ * agent/mibgroup/: kernel_sunos5.c, kernel_sunos5.h,
+ tcp-mib/data_access/tcpConn.h,
+ tcp-mib/data_access/tcpConn_solaris2.c,
+ udp-mib/data_access/udp_endpoint.h,
+ udp-mib/data_access/udp_endpoint_solaris2.c:
+
+ NEWS: Solaris: PATCH: 1569537,1569539: new UDP-MIB and TCP-MIB implementation (enable through --with-mib-modules=udp-mib,tcp-mib)
+
+2006-10-10 13:14 rstory
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ NEWS: snmpd: PATCH: 1570982 Solaris IF-MIB: Support for IPv6-only interfaces
+
+2006-10-10 07:32 tanders
+
+ * configure.in, configure,
+ include/net-snmp/net-snmp-config.h.in:
+
+ check for pread64 (AIX) and nlist64 (IRIX)
+
+2006-10-10 06:16 tanders
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ add missing STRUCT_NLIST64_HAS_N_VALUE variable so that the test result is actually saved
+
+2006-10-10 03:52 tanders
+
+ * net-snmp-config.in:
+
+ fix shell syntax errors reported by Richard Chonak
+
+2006-10-09 06:10 tanders
+
+ * testing/tests/T150solarishostcpu:
+
+ more robust Solaris CPU testing: the index for the first CPU may vary across systems (CPU 0 = index 768, CPU 1 = index 769 etc.)
+
+2006-10-09 04:21 tanders
+
+ * dist/nsb-functions:
+
+ don't fail on DEBUGMSG*
+
+2006-10-08 13:25 dts12
+
+ * agent/mibgroup/hardware/: cpu.h, cpu/cpu_pstat.c:
+
+ Activate pstat-based CPU handling on HP-UX systems.
+
+2006-10-08 13:24 dts12
+
+ * include/net-snmp/system/hpux.h:
+
+ Don't redefine an existing token without undefining it first.
+
+2006-10-08 13:23 dts12
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ Ensure that historical data is available before we attempt to use it.
+
+2006-10-07 14:54 dts12
+
+ * snmplib/check_varbind.c:
+
+ Fix size check for specialised integer-based assignments.
+ (Bug #1572394 - patch provided by Phil Wilson)
+
+2006-10-07 06:49 dts12
+
+ * testing/tests/: T150solarishostcpu, T153solarisswap:
+
+ Adjust to changes in certain HostRes indexing.
+
+2006-10-05 15:44 dts12
+
+ * configure.in, configure:
+
+ What's a stray underscore here or there between friends?
+
+2006-10-05 08:53 dts12
+
+ * agent/mibgroup/hardware/cpu/: cpu.c, cpu_kstat.c:
+
+ Debugging code.
+
+2006-10-05 08:52 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_kstat.c:
+
+ Be consistent in the use of CPU indexing.
+
+2006-10-04 15:07 dts12
+
+ * agent/mibgroup/hardware/: memory.h, memory/memory_null.c
+:
+
+ Allow systems without an explicit HAL memory module to compile
+ (even if the agent can't report the relevant statistics).
+
+2006-10-04 14:51 dts12
+
+ * agent/mibgroup/hardware/: cpu.h, cpu/cpu_kstat.c:
+
+ Include kstat-based CPU processing on Solaris systems, and amend this code
+ to actually compile/work. (Much of this supplied by Bruce Shaw)
+
+2006-10-03 11:30 dts12
+
+ * configure, configure.in:
+
+ Test for the actual behaviour of -Ux -Dx=x, and only use this if it works as expected.
+
+2006-10-01 08:43 alex_b
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Win32: Add NSIS installer option for installing winExtDLL version of
+ snmpd.exe
+
+2006-10-01 06:42 alex_b
+
+ * NEWS, README.win32, agent/mibgroup/winExtDLL.c
+:
+
+ Win32: Add trap support to winExtDLL and clean up debugging output.
+
+2006-09-29 19:00 alex_b
+
+ * README.win32, agent/mibgroup/winExtDLL.c:
+
+ Win32: Remove winExtDLL snmpd.conf option, add SNMP v2 support.
+
+2006-09-29 13:28 marz
+
+ * python/netsnmp/: client_intf.c, tests/test.py:
+
+ test fix
+
+2006-09-29 13:18 hardaker
+
+ * python/netsnmp/: client_intf.c, client_intf.c:
+
+ remove debugging statements
+
+2006-09-29 13:18 hardaker
+
+ * python/netsnmp/tests/test.py:
+
+ testing updates
+
+2006-09-29 13:03 hardaker
+
+ * python/: README, netsnmp/client.py,
+ netsnmp/client_intf.c, netsnmp/tests/test.py:
+
+ support for a generic walk wrapper
+
+2006-09-29 12:31 marz
+
+ * python/netsnmp/: client_intf.c, tests/test.py:
+
+ cleanup
+
+2006-09-28 18:50 marz
+
+ * python/: README, netsnmp/client_intf.c:
+
+ added 'set' method, fixes/additions to readme
+
+2006-09-27 23:02 tanders
+
+ * agent/mibgroup/hardware/memory/memory_darwin.c:
+
+ CHANGES: MacOSX: PATCH: 1566777: from jalbert: build fixes for memory_darwin.c
+
+2006-09-27 15:21 tanders
+
+ * configure, configure.in:
+
+ minor rewording
+
+2006-09-27 14:32 hardaker
+
+ * FAQ, README, configure, configure.in
+, sedscript.in, snmplib/snmp_version.c,
+ dist/net-snmp.spec:
+
+ - version tag ( 5.4.pre3 )
+
+-------------------------------------------------------------------------------
+
+Changes: V5.4.pre2 -> V5.4.pre3
+
+2006-09-27 14:28 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_agent_registry.3,
+ netsnmp_agent_trap.3, netsnmp_asn1_packet_parse.3,
+ netsnmp_baby_steps.3, netsnmp_bulk_to_next.3,
+ netsnmp_cache_handler.3, netsnmp_callback.3,
+ netsnmp_container.3, netsnmp_data_list.3,
+ netsnmp_debug.3, netsnmp_default_store.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_iterator_info_s.3, netsnmp_leaf.3,
+ netsnmp_library.3, netsnmp_mib_maintenance.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_stash_to_next.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_generic.3,
+ netsnmp_table_indexes.3, netsnmp_table_iterator.3,
+ netsnmp_table_iterator.h.3, netsnmp_table_maintenance.3
+, netsnmp_table_rows.3, netsnmp_tdata.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2006-09-27 14:28 hardaker
+
+ * doxygen.conf:
+
+ - version tag ( 5.4.pre3 )
+
+2006-09-27 14:16 hardaker
+
+ * configure, configure.in:
+
+ fix:cflags ->:ccflags
+
+2006-09-27 13:36 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_solaris2.c:
+
+ CHANGES: snmpd: PATCH: 1566523: from apersson: Memory leak in if-mib (Solaris)
+ - take advantage of if_nametoindex() when possible
+ - grab the IPv6 interface Identifier if available
+
+2006-09-27 10:54 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_sysctl.c:
+
+ - update for new reasm_max v4/v6 split
+ - add 'l' to printf spec for size_t param
+
+2006-09-27 10:48 hardaker
+
+ * configure, configure.in:
+
+ check for largefile support on solaris and disable embedded perl when on
+
+2006-09-27 09:51 tanders
+
+ * FAQ:
+
+ update platform list
+
+2006-09-27 06:56 tanders
+
+ * configure, configure.in:
+
+ fix --without-python-modules
+
+2006-09-26 16:34 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.h:
+
+ add openbsd4 to sysctl interface list
+
+2006-09-26 15:44 tanders
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ add support for openbsd4
+
+2006-09-26 15:39 tanders
+
+ * agent/mibgroup/hardware/memory.h:
+
+ add support for openbsd4
+
+2006-09-26 14:40 tanders
+
+ * configure, configure.in:
+
+ Consistently say "Perl", not "perl".
+
+2006-09-26 14:21 hardaker
+
+ * Makefile.in:
+
+ don't need to double clean python
+
+2006-09-26 14:19 tanders
+
+ * configure, configure.in:
+
+ fix --without-perl-modules
+
+2006-09-26 12:43 dts12
+
+ * agent/mibgroup/hardware/memory/memory_darwin.c:
+
+ Include some (probably not all) necessary header files.
+
+2006-09-26 12:23 hardaker
+
+ * Makefile.in, configure, configure.in:
+
+ fixed python make clean when no python support was requested
+
+2006-09-26 09:39 tanders
+
+ * dist/nsb-functions:
+
+ set up symlinks before running configure to survive the new perl tests
+
+2006-09-26 09:34 hardaker
+
+ * configure, configure.in:
+
+ change the perl tests to allow for symlinks
+
+2006-09-26 09:09 hardaker
+
+ * configure.in, configure:
+
+ fixed rpm checks... oppps
+
+2006-09-26 09:09 tanders
+
+ * README.aix:
+
+ documented AIX sed issues
+
+2006-09-26 07:49 marz
+
+ * python/: README, netsnmp/client.py,
+ netsnmp/client_intf.c, netsnmp/tests/test.py:
+
+ cleanup, weird leaf obj handling, added snmpgetbulk
+
+2006-09-25 21:58 hardaker
+
+ * FAQ, README, configure, configure.in
+, sedscript.in, dist/net-snmp.spec,
+ snmplib/snmp_version.c:
+
+ - version tag ( 5.4.pre2 )
+
+-------------------------------------------------------------------------------
+
+Changes: V5.4.pre1 -> V5.4.pre2
+
+2006-09-25 21:49 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_agent_registry.3,
+ netsnmp_agent_trap.3, netsnmp_asn1_packet_parse.3,
+ netsnmp_baby_steps.3, netsnmp_bulk_to_next.3,
+ netsnmp_cache_handler.3, netsnmp_callback.3,
+ netsnmp_container.3, netsnmp_data_list.3,
+ netsnmp_debug.3, netsnmp_default_store.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_iterator_info_s.3, netsnmp_leaf.3,
+ netsnmp_library.3, netsnmp_mib_maintenance.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_stash_to_next.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_generic.3,
+ netsnmp_table_indexes.3, netsnmp_table_iterator.3,
+ netsnmp_table_iterator.h.3, netsnmp_table_maintenance.3
+, netsnmp_table_rows.3, netsnmp_tdata.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2006-09-25 21:49 hardaker
+
+ * doxygen.conf:
+
+ - version tag ( 5.4.pre2 )
+
+2006-09-25 21:37 hardaker
+
+ * dist/makerelease:
+
+ fixed syntax error
+
+2006-09-25 17:37 hardaker
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ ran autoheader
+
+2006-09-25 17:26 hardaker
+
+ * Makefile.in, configure, configure.in:
+
+ Update for a --with-python-modules flag; will run into some of the same build-in-place issues that perl has but it's a start
+
+2006-09-25 17:04 hardaker
+
+ * python/README:
+
+ minor wording changes
+
+2006-09-25 16:57 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ CHANGES: snmpd: BUG: 1559358: from tramker: check scanf results for diskio scanning
+
+2006-09-25 16:54 hardaker
+
+ * configure, configure.in:
+
+ CHANGES: snmpd: BUGS: 1564233: Have configure test for rpm headers not just the libraries
+
+2006-09-25 14:55 hardaker
+
+ * configure, configure.in:
+
+ don't warn about excluding required modules when the current file is default_mibs
+
+2006-09-25 14:33 tanders
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ CHANGES: snmplib: PATCH: 1565293: from adp: UDPIPv6 transport reports wrong port number
+
+2006-09-25 10:52 hardaker
+
+ * configure, configure.in:
+
+ tests to see if we're in the main source tree so we can install the perl modules or not
+
+2006-09-25 09:25 tanders
+
+ * perl/SNMP/t/: async.t, bulkwalk.t, conf.t,
+ get.t, getnext.t, mib.t, mibload.t,
+ notify.t, session.t, set.t:
+
+ Make perl test suite work even if net-snmp isn't installed yet.
+
+2006-09-25 08:48 tanders
+
+ * perl/agent/test.pl:
+
+ NetSNMP::agent tests neither need config nor MIBs
+
+2006-09-25 08:21 rstory
+
+ * dist/cvsup:
+
+ exclude CVS files from nighly tarballs
+
+2006-09-25 07:30 marz
+
+ * python/netsnmp/: client.py, client_intf.c,
+ tests/test.py:
+
+ adding getbulk, removing some debug
+
+2006-09-25 05:35 tanders
+
+ * NEWS:
+
+ Don't mix tabs and spaces for indentation. Convert all (rarely used) tabs to spaces.
+
+2006-09-25 01:42 dts12
+
+ * apps/snmptrapd_handlers.c, apps/snmptrapd_handlers.h
+, man/snmptrapd.conf.5.def:
+
+ Distinguish between "OID.*" and "OID*" wildcard syntax (exclusive and
+ inclusive subtree matches respectively).
+
+2006-09-25 01:38 dts12
+
+ * apps/snmptrapd_handlers.c, man/snmptrapd.conf.5.def
+:
+
+ Implement (and document) "OID.*" syntax for subtree matching.
+
+2006-09-24 15:28 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Win32: winExtDLL - Fix bug with set requests, start to add SNMPv2 support.
+
+2006-09-23 00:13 tanders
+
+ * perl/OID/test.pl:
+
+ OID.pm tests shouldn't depend on *installed* MIBs
+
+2006-09-22 14:18 tanders
+
+ * python/README:
+
+ some nit-picking
+
+2006-09-22 13:56 tanders
+
+ * perl/SNMP/t/startagent.pl:
+
+ SNMP.pm perl tests shouldn't depend on *installed* MIBs
+
+2006-09-22 12:47 marz
+
+ * python/README:
+
+ README edits
+
+2006-09-22 12:03 marz
+
+ * python/README:
+
+ mods to README with some usage info
+
+2006-09-22 10:25 hardaker
+
+ * python/README:
+
+ proper naming
+
+2006-09-22 10:25 hardaker
+
+ * python/: LICENSE, README:
+
+ added a readme and license file
+
+2006-09-22 10:20 hardaker
+
+ * COPYING:
+
+ date update
+
+2006-09-22 07:58 marz
+
+ * python/: setup.py, netsnmp/__init__.py,
+ netsnmp/client.py, netsnmp/client_intf.c,
+ netsnmp/tests/__init__.py, netsnmp/tests/snmpd.conf,
+ netsnmp/tests/test.py:
+
+ Adding initial alpha support for net-snmp python binding
+
+2006-09-22 04:47 tanders
+
+ * dist/nsb-functions:
+
+ Don't fail on "LOG_ERR".
+
+2006-09-22 03:29 tanders
+
+ * perl/SNMP/t/: notify.t, startagent.pl:
+
+ fix SNMP.pm notify test (start snmptrapd with valid options)
+
+2006-09-21 09:15 alex_b
+
+ * win32/: libsnmp/Makefile.in, libsnmp/libsnmp.dsp,
+ libsnmp_dll/Makefile.in, libsnmp_dll/libsnmp.def,
+ libsnmp_dll/libsnmp.def.in, libsnmp_dll/libsnmp_dll.dsp
+:
+
+ Windows build fixes.
+
+2006-09-21 07:43 tanders
+
+ * perl/TrapReceiver/perl_snmptrapd.h:
+
+ Sync struct netsnmp_trapd_handler_s with the library code again (add "flags").
+
+2006-09-21 06:09 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ fix potential segfault introduced by patch 1561277
+
+2006-09-21 05:21 tanders
+
+ * agent/mibgroup/smux/smux.c:
+
+ #include <net-snmp/library/tools.h> for SNMP_STRORNULL
+
+2006-09-21 03:49 tanders
+
+ * configure, configure.in:
+
+ *really* keep preX/rcX in version strings
+
+2006-09-20 19:25 hardaker
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ change agentx socket define to NETSNMP_ prefixed
+
+2006-09-20 13:26 dts12
+
+ * apps/snmptrapd_handlers.c,
+ include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ Check incoming trap OIDs as an extension of the traphandle OID
+ (but not the other way round!)
+
+2006-09-20 09:48 hardaker
+
+ * configure, configure.in:
+
+ don't change pre tags to 0. to avoid badly generated version numbers
+
+2006-09-20 07:45 hardaker
+
+ * dist/makerelease:
+
+ automatted testing of the produced tar-ball
+
+2006-09-19 22:23 hardaker
+
+ * dist/makerelease:
+
+ fix path to extractnews
+
+2006-09-19 22:18 hardaker
+
+ * FAQ, README, configure.in, sedscript.in
+, snmplib/snmp_version.c, configure,
+ dist/net-snmp.spec:
+
+ - version tag ( 5.4.pre1 )
+
+-------------------------------------------------------------------------------
+
+Changes: V5.3 -> V5.4.pre1
+
+2006-09-19 17:29 hardaker
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3
+, netsnmp_agent_registry.3, netsnmp_agent_trap.3
+, netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3
+, netsnmp_bulk_to_next.3, netsnmp_cache_handler.3
+, netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_maintenance.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_stash_to_next.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_generic.3,
+ netsnmp_table_indexes.3, netsnmp_table_iterator.3,
+ netsnmp_table_iterator.h.3, netsnmp_table_maintenance.3
+, netsnmp_table_rows.3, netsnmp_tdata.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2006-09-19 17:29 hardaker
+
+ * doxygen.conf:
+
+ - version tag ( 5.4.pre1 )
+
+2006-09-19 17:12 hardaker
+
+ * Makefile.top:
+
+ cave to putting in some buffer space for libcurrent; 5.3 was 10 and increments of 5 make it easy, so 5 it is.
+
+2006-09-19 17:08 hardaker
+
+ * dist/: extractnews, makerelease:
+
+ yet more updates for making releases
+
+2006-09-19 16:42 hardaker
+
+ * snmplib/snmpUDPDomain.c:
+
+ more fixes for udp domains: remove requirement for inet_aton which on some systems exists in libresolv
+
+2006-09-19 16:35 hardaker
+
+ * snmplib/snmpUDPDomain.c:
+
+ udp domain fixes
+
+2006-09-19 16:04 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ build fix for IRIX with SGI's cc
+
+2006-09-19 15:58 hardaker
+
+ * apps/snmptrapd_handlers.c, apps/snmptrapd_handlers.h
+, man/snmptrapd.conf.5.def:
+
+ NEWS: snmptrapd: the traphandle directive now supports a -t switch to indicate matching any OID in the tree below the specified OID
+
+2006-09-19 15:18 hardaker
+
+ * perl/agent/Support/Support.pm:
+
+ cleaned up perl vars for support on older perl versions
+
+2006-09-19 14:57 hardaker
+
+ * configure, configure.in:
+
+ fix error logic in perl tests
+
+2006-09-19 14:44 hardaker
+
+ * configure, configure.in:
+
+ smart detection of available perl support
+
+2006-09-19 11:25 hardaker
+
+ * configure, configure.in:
+
+ fix perl cc test to allow for dash options
+
+2006-09-19 10:58 dts12
+
+ * snmplib/snmp_api.c:
+
+ Report the appropriate prefix match when one OID is a prefix of the other.
+ The previous code treated this as a non-match (returning 0).
+ I'm not at all convinced by the "+1" handling either.
+
+2006-09-19 10:25 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ another attempt to fix the items calculation without popping a mark
+
+2006-09-19 09:51 hardaker
+
+ * agent/helpers/instance.c,
+ include/net-snmp/agent/instance.h:
+
+ NEWS: snmpd: PATCH: 1550725: from 'Wayne Glantz': A new uint instance helper to match the existing int, long and ulong helpers
+
+2006-09-19 09:34 tanders
+
+ * agent/mibgroup/smux/smux.c:
+
+ NEWS: snmpd: BUG: 1527930: fix smux authentication
+
+2006-09-19 09:17 hardaker
+
+ * dist/: RELEASE-INSTRUCTIONS, extractnews:
+
+ remove from user strings in NEWS and CHANGES lines
+
+2006-09-19 08:08 hardaker
+
+ * apps/snmptrapd_handlers.c:
+
+ remove robert's self-called hack for making snmptrapd handle partial OIDs. As agreed to on coders this can't be done as is because it completely changes existing usage. A new mechanism is needed to support this behaviour so it doesn't break backwards compatibity with potential security ramifications
+
+2006-09-19 07:45 hardaker
+
+ * agent/agent_trap.c, agent/snmp_agent.c,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/subagent.c, apps/snmptrapd.c,
+ include/net-snmp/session_api.h,
+ include/net-snmp/library/snmpSTDDomain.h,
+ include/net-snmp/library/snmp_service.h,
+ include/net-snmp/library/snmp_transport.h,
+ man/snmp.conf.5.def, snmplib/Makefile.in,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpIPXDomain.c,
+ snmplib/snmpSTDDomain.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c, snmplib/snmp_api.c,
+ snmplib/snmp_service.c, snmplib/snmp_transport.c:
+
+ NEWS: snmplib: PATCH: 1282566: from magfr to rework transport creation to allow for alternative interpretations of the address and a more flexible transport registration system
+
+2006-09-19 06:17 tanders
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ NEWS: snmpd: PATCH: 1561277: use net.ipv6.neigh.lo.base_reachable_time_ms instead of deprecated base_reachable_time
+
+2006-09-19 04:06 dts12
+
+ * agent/mibgroup/disman/event/: mteEvent.c, mteObjects.c
+:
+
+ Don't re-initialise built-in Event-MIB events, etc.
+
+2006-09-19 03:24 dts12
+
+ * agent/agent_handler.c, agent/helpers/instance.c,
+ agent/helpers/table_row.c,
+ include/net-snmp/agent/agent_handler.h:
+
+ First steps in supporting single-instance registrations.
+
+2006-09-18 21:31 hardaker
+
+ * agent/mibgroup/if-mib/: data_access/interface_ioctl.c,
+ ifTable/ifTable.h, ifXTable/ifXTable.c:
+
+ CHANGES: snmpd: BUGS: 1474468: ifConnectorPresent always returns 0
+
+2006-09-18 20:40 hardaker
+
+ * agent/mibgroup/host/hr_storage.c,
+ include/net-snmp/agent/ds_agent.h, man/snmpd.conf.5.def
+:
+
+ modified the host resources skip NFS patch to fix a bug and to use the default storage config instead
+
+2006-09-18 20:26 hardaker
+
+ * agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
+, include/net-snmp/data_access/udp_endpoint.h:
+
+ CHANGES: snmpd: PATCH: 1524755: from apersson to better support the UDPTable for unknown address types
+
+2006-09-18 20:09 hardaker
+
+ * agent/mibgroup/host/hr_storage.c, man/snmpd.conf.5.def
+:
+
+ NEWS: snmpd: PATCH: 1534877: from buckh to add support for skipping NFS entries in the host resources hrStorageTable. See the skipNFSInHostResources token in the snmpd.conf file for details.
+
+2006-09-18 20:00 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ document acceptile NEWS tokens
+
+2006-09-18 17:30 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ document the new CVS NEWS tag system
+
+2006-09-18 16:05 tanders
+
+ * apps/snmptrapd_handlers.c:
+
+ NEWS: snmptrapd: - PATCH: 1536773: support partial oid matching
+
+ We can still add/require a special token/syntax for this after pre1
+ if this was the consensus.
+
+2006-09-18 15:24 tanders
+
+ * agent/mibgroup/: kernel_sunos5.c, kernel_sunos5.h,
+ if-mib/data_access/interface_solaris2.c:
+
+ fix recent build issues on Solaris 7 (patch provided by Anders Persson)
+
+2006-09-18 07:19 tanders
+
+ * agent/mibgroup/hardware/memory/memory_irix.c:
+
+ add debugging, fix some figures
+
+2006-09-18 02:08 tanders
+
+ * perl/agent/MANIFEST:
+
+ add NetSNMP::agent::Support files
+
+2006-09-18 01:17 tanders
+
+ * agent/mibgroup/kernel_sunos5.h:
+
+ Move up and rename the #ifndef to prevent duplicate include. Fixes compile errors wrt. Counter64 on Solaris 7 and earlier.
+
+2006-09-16 16:33 alex_b
+
+ * README.win32:
+
+ README update for winExtDLL.
+
+2006-09-16 15:22 alex_b
+
+ * agent/mibgroup/winExtDLL.c:
+
+ Windows winExtDLL: Use registry entries for Windows SNMP extension to get
+ the list of DLLs to load.
+
+2006-09-16 13:49 alex_b
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ NETSNMP_ define fixes.
+
+2006-09-16 12:56 tanders
+
+ * configure, include/net-snmp/net-snmp-config.h.in,
+ configure.in:
+
+ fix check for <sys/systemcfg.h> (AIX)
+
+2006-09-16 11:01 tanders
+
+ * win32/: config.h.borland, net-snmp/net-snmp-config.h
+:
+
+ fix some NETSNMP_NETSNMP_* "double rename" errors for Windows
+
+2006-09-16 10:56 tanders
+
+ * snmplib/snmpksm.c:
+
+ revert to (local) OLD_HEIMDAL define
+
+2006-09-16 10:23 tanders
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ rename last occurence of DONT_USE_NLIST
+
+2006-09-16 10:10 tanders
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ run autoheader
+
+2006-09-16 08:44 alex_b
+
+ * win32/libsnmp_dll/: libsnmp.def, libsnmp.def.in:
+
+ Windows MSVC Perl compile fixes.
+
+2006-09-16 08:19 alex_b
+
+ * perl/agent/Support/Makefile.PL:
+
+ Fix for building under Windows (MSVC).
+
+2006-09-15 09:12 tanders
+
+ * agent/mibgroup/hardware/memory.h:
+
+ activate memory HAL code for IRIX
+
+2006-09-15 09:09 tanders
+
+ * agent/mibgroup/hardware/memory/memory_irix.c:
+
+ initial IRIX version of memory HAL interface
+
+2006-09-15 07:48 tanders
+
+ * configure, configure.in:
+
+ check for <sys/sysget.h> (IRIX)
+
+2006-09-15 07:14 tanders
+
+ * include/net-snmp/library/system.h, snmplib/system.c
+:
+
+ introduce netsnmp_os_kernel_width() to be able to detect 64bit kernels at runtime
+
+2006-09-15 06:10 tanders
+
+ * configure, configure.in:
+
+ check for sys/systemcfg.h (AIX) and sys/systeminfo.h (IRIX)
+
+2006-09-15 05:46 tanders
+
+ * README.win32, acconfig.h, configure,
+ configure.in, include/net-snmp/net-snmp-config.h.in
+, perl/SNMP/Makefile.PL, snmplib/keytools.c,
+ snmplib/scapi.c, testing/eval_tools.sh,
+ testing/tests/Sv3config, testing/tests/Sv3usmconfigbase
+, testing/tests/T023snmpv3getMD5AES,
+ testing/tests/T023snmpv3getMD5DES,
+ testing/tests/T024snmpv3getSHA1,
+ testing/tests/T025snmpv3getSHADES,
+ testing/tests/T026snmpv3getSHAAES,
+ testing/tests/T030snmpv3usercreation,
+ testing/tests/T035snmpv3trapdusermgmt,
+ testing/tests/T049snmpv3informpriv,
+ testing/tests/T050snmpv3trap, win32/Configure:
+
+ more renames and fixes
+
+2006-09-15 04:15 tanders
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ fix syntax error that broke the Solaris build
+
+2006-09-15 03:44 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ fix wrong renames
+
+2006-09-15 03:30 tanders
+
+ * snmplib/snmpUDPDomain.c:
+
+ restrict IP_PKTINFO code to Linux
+
+2006-09-15 02:16 tanders
+
+ * agent/mibgroup/mibII/at.c:
+
+ fix syntax errors which broke the build on Solaris
+
+2006-09-14 21:03 alex_b
+
+ * win32/: config.h.borland, net-snmp/net-snmp-config.h
+, net-snmp/net-snmp-config.h.in:
+
+ Change Net-SNMP defines to use NETSNMP_ prefix.
+
+2006-09-14 17:48 tanders
+
+ * agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/auto_nlist.c,
+ agent/kernel.c, agent/kernel.h, agent/snmp_agent.c
+, agent/snmp_vars.c, agent/snmpd.c,
+ agent/helpers/table_dataset.c, agent/mibgroup/util_funcs.c
+, agent/mibgroup/agent/extend.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/protocol.h,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-mib/data_access/arp_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c
+, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/ipAddr.c
+, agent/mibgroup/mibII/mibII_common.h,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/smux/smux.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/memory_aix4.c,
+ agent/mibgroup/ucd-snmp/memory_darwin7.c,
+ agent/mibgroup/ucd-snmp/memory_dynix.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_hpux.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_darwin7.c,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_hpux.c,
+ agent/mibgroup/ucd-snmp/vmstat_linux.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/utilities/execute.c,
+ agent/mibgroup/utilities/iquery.c, apps/encode_keychange.c
+, apps/snmpset.c, apps/snmptable.c,
+ apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmptrapd_auth.c,
+ apps/snmptrapd_log.c, apps/snmpusm.c,
+ apps/snmpnetstat/inet6.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/route.c, include/net-snmp/mib_api.h
+, include/net-snmp/session_api.h,
+ include/net-snmp/snmpv3_api.h,
+ include/net-snmp/agent/auto_nlist.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/data_access/arp.h,
+ include/net-snmp/data_access/ipaddress.h,
+ include/net-snmp/data_access/route.h,
+ include/net-snmp/library/asn1.h,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/mib.h,
+ include/net-snmp/library/mt_support.h,
+ include/net-snmp/library/scapi.h,
+ include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpSTDDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_assert.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_impl.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/transform_oids.h,
+ perl/SNMP/SNMP.xs, snmplib/asn1.c,
+ snmplib/inet_ntop.c, snmplib/inet_pton.c,
+ snmplib/keytools.c, snmplib/lcd_time.c, snmplib/md5.c
+, snmplib/mib.c, snmplib/mt_support.c,
+ snmplib/parse.c, snmplib/pkcs.c,
+ snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp.c, snmplib/snmpAAL5PVCDomain.c,
+ snmplib/snmpCallbackDomain.c, snmplib/snmpTCPIPv6Domain.c
+, snmplib/snmpUDPDomain.c,
+ snmplib/snmpUDPIPv6Domain.c, snmplib/snmpUnixDomain.c
+, snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_debug.c,
+ snmplib/snmp_parse_args.c, snmplib/snmp_transport.c
+, snmplib/snmpksm.c, snmplib/snmpusm.c,
+ snmplib/snmpv3.c, snmplib/system.c, snmplib/tools.c
+, testing/etimetest.c, testing/misctest.c,
+ win32/mib_module_inits.h:
+
+ Always use the new net-snmp-config.h definitions from within the NETSNMP_
+ namespace.
+
+2006-09-14 16:55 hardaker
+
+ * dist/extractnews:
+
+ first pass at extracting NEWS/CHANGES files from cvs logs
+
+2006-09-14 16:32 rstory
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ detect solaris ibd/ip.tun/ath interface types properly
+
+2006-09-14 15:28 tanders
+
+ * NEWS:
+
+ mention Solaris if-mib rewrite
+
+2006-09-14 15:14 hardaker
+
+ * README:
+
+ [no log message]
+
+2006-09-14 15:12 hardaker
+
+ * snmplib/snmpUDPDomain.c:
+
+ NEWS: PATCHES: 1509943: responses will get sent from the original dest IP address when possible.
+
+2006-09-14 14:09 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ CHANGES: PATCHES: 1554827: from rtyle: fix handling of failed proxy SET requests
+
+2006-09-14 13:57 hardaker
+
+ * agent/: snmp_agent.c, mibgroup/disman/event/mteTrigger.c
+:
+
+ CHANGES: snmpd: PATCHES: 1557514 from rtyle: Do not attempt to collect data during SET processing.
+
+2006-09-14 13:42 hardaker
+
+ * configure, configure.in:
+
+ pass 2 at getting auto-build support for .so files. I'm now convienced it's close to impossible to do correctly with dependency issues and no support for recursive functions in sh
+
+2006-09-14 12:14 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_solaris2.c:
+
+ solaris support for if-mib 64bit counters
+
+2006-09-14 10:36 rstory
+
+ * agent/mibgroup/mibII/: at.c, ipAddr.c, var_route.c
+:
+
+ use new data access routine for solaris, if rewrite in effect
+
+2006-09-14 10:34 rstory
+
+ * agent/mibgroup/mibII.h:
+
+ use NETSNMP_INCLUDE_IFTABLE_REWRITES to decide about if-mib support
+
+2006-09-14 10:27 rstory
+
+ * agent/mibgroup/: kernel_sunos5.c, kernel_sunos5.h,
+ if-mib/data_access/interface.h:
+
+ solaris support for if-mib 64bit counters
+
+2006-09-14 10:23 rstory
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ run autoconf && autoheader
+
+2006-09-14 10:21 rstory
+
+ * configure.in:
+
+ type check for solaris Counter64
+
+2006-09-14 10:15 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
+,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c
+,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h
+,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c
+, include/net-snmp/data_access/interface.h:
+
+ split reasm_max int two vars (v6/v6)
+
+2006-09-14 07:51 rstory
+
+ * include/net-snmp/system/linux.h:
+
+ define NETSNMP_INCLUDE_IFTABLE_REWRITES
+
+2006-09-14 07:51 rstory
+
+ * agent/mibgroup/: if-mib/data_access/interface.h,
+ mibII/ifTable.h:
+
+ Only try to use mfd code iff NETSNMP_INCLUDE_IFTABLE_REWRITES is defined
+
+2006-09-14 07:45 rstory
+
+ * include/net-snmp/data_access/interface.h:
+
+ add defined for new ifOperStatus values
+
+2006-09-14 02:53 dts12
+
+ * agent/helpers/Makefile.in, agent/helpers/table_row.c
+, local/mib2c.row.conf:
+
+ Preliminary implementation of a single-row helper.
+
+2006-09-13 10:00 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/Makefile.in:
+
+ pass one at specifying dlls to build via modules. Do not use this yet as there are conflict issues that need to be worked out
+
+2006-09-12 18:32 alex_b
+
+ * NEWS, README.win32, agent/mibgroup/winExtDLL.c
+, agent/mibgroup/winExtDLL.h,
+ win32/mib_module_includes.h, win32/mib_module_inits.h
+, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in,
+ win32/netsnmpmibssdk/Makefile.in,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Windows: new winExtDLL extension module to allow snmpd to load Windows
+ SNMP service extension DLLs to provide support for HOST-RESOURCES-MIB
+ and other MIBs provided with Windows.
+
+2006-09-12 16:15 tanders
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ CAN_USE_SYSCTL -> NETSNMP_CAN_USE_SYSCTL
+
+2006-09-12 15:42 tanders
+
+ * configure, configure.in:
+
+ minor fixes
+
+2006-09-12 15:35 tanders
+
+ * acconfig.h, configure, configure.in,
+ sedscript.in, include/net-snmp/net-snmp-config.h.in
+, include/net-snmp/system/hpux.h,
+ include/net-snmp/system/linux.h,
+ include/net-snmp/system/mips.h,
+ include/net-snmp/system/solaris.h,
+ include/net-snmp/system/solaris2.5.h,
+ include/net-snmp/system/solaris2.6.h:
+
+ NEWS: misc: - Most net-snmp specific defines are now (also) available under a proper NETSNMP_ prefix. The older, potentially conflicting names as well as the autoconf variables can now be turned off by a special define.
+
+2006-09-12 10:33 dts12
+
+ * agent/agent_trap.c:
+
+ NEWS: agent: - [BUGS: 1427410] Set auth engineID for SNMPv3 traps.
+ (rather than sending a trap with no auth engineID)
+
+2006-09-12 10:30 dts12
+
+ * Makefile.top, configure, configure.in:
+
+ NEWS: build: - [BUGS 1416481] Support specifying an explicit linker.
+ Defaults to $CC if not explicitly set.
+
+2006-09-12 10:27 dts12
+
+ * snmplib/vacm.c:
+
+ NEWS: agent: - [BUGS 1502267] Build access list in the correct order.
+
+2006-09-12 06:06 tanders
+
+ * NEWS, configure, configure.in:
+
+ enable embedded Perl and the Perl modules by default
+
+2006-09-08 08:43 dts12
+
+ * local/mib2c.iterate_access.conf:
+
+ NEWS: mib2c: - [BUGS: 1479916] Restore consistency in row creation code.
+
+2006-09-08 05:48 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ NEWS: snmpd: - [BUGS: 1535903] Support spaces within security names
+
+2006-09-07 20:42 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ fix, I think, the bulkwalk problems; all tests pass. I believe the patch is the correct combination between the two different patches (the old one and the new one) that should fix both problems. NEWS: perl - Fixed the perl bulkwalk function
+
+2006-09-07 09:29 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ fix typo which broke persistence
+
+2006-09-07 09:17 dts12
+
+ * local/mib2c.iterate.conf:
+
+ Use the correct API call for remembering a newly-created row.
+ (Spotted by Zhang Chuan).
+
+2006-09-07 04:37 dts12
+
+ * apps/snmpdf.c:
+
+ NEWS: snmpdf: - [BUGS: 1515507] Handle failed requests better
+ (Don't go into an infinite loop!)
+
+2006-09-07 04:30 dts12
+
+ * include/net-snmp/library/parse.h, snmplib/parse.c,
+ snmplib/mib.c:
+
+ NEWS: snmplib - [BUGS: 1537459, BUGS: 1540745] Fix missing MIB parsing tokens
+
+2006-09-07 04:24 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c, NEWS,
+ man/snmpd.conf.5.def, testing/tests/Sv3usmconfigagent
+:
+
+ Revert default behaviour of convenience access control directives
+ to matching all context. An explicit context field will be taken
+ as an exact match, unless it ends in '*'.
+
+2006-09-06 10:24 rstory
+
+ * agent/mibgroup/if-mib/: data_access/interface_linux.c,
+ ifTable/ifTable.h:
+
+ fix some missing stats in ifTable/ifXTable
+
+2006-09-06 06:45 rstory
+
+ * NEWS:
+
+ add note on experiment FreeBSD/OpenBSD ifXTable support
+
+2006-09-06 06:42 rstory
+
+ * README.agent-mibs:
+
+ add FreeBDS and OpenBSD for if-mib
+
+2006-09-05 12:34 rstory
+
+ * agent/helpers/row_merge.c:
+
+ deal w/prev ptrs too
+
+2006-09-05 07:58 dts12
+
+ * NEWS, man/snmpd.conf.5.def:
+
+ Document new access control (and context) behaviour.
+
+2006-09-05 05:49 dts12
+
+ * testing/tests/Sv3usmconfigagent:
+
+ Explicitly authorise all contexts.
+ (This results from a minor alteration in behaviour following another code
+ change, but feels more secure than automatically opening up all contexts
+ by default. Though I'm happy to be persuaded otherwise...)
+
+2006-09-05 02:44 tanders
+
+ * apps/snmptrapd.c:
+
+ fix compiler warnings (again)
+
+2006-09-05 01:37 dts12
+
+ * agent/mibgroup/: agent_mibs.h, agent/nsVacmAccessTable.h
+:
+
+ Include Net-SNMP extension access table (and MIB) in the default build.
+
+2006-09-05 01:35 dts12
+
+ * apps/snmptrapd.c:
+
+ Protect against the nsVacmAccessTable not being included.
+ (and similar for usmUserTable - a cleaner check than before)
+
+2006-09-05 01:28 dts12
+
+ * apps/snmpvacm.c, man/snmpvacm.1.def:
+
+ Support manipulation of the Net-SNMP extension access table.
+
+2006-09-05 01:26 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Support both exact and context prefix matches for the convenience directives
+ (as well as 'authaccess').
+
+2006-09-05 01:23 dts12
+
+ * agent/mibgroup/agent/nsVacmAccessTable.c:
+
+ Better handling of row creation/deletion.
+ Suppress various minor type mismatches.
+
+2006-09-04 16:07 tanders
+
+ * README.agent-mibs:
+
+ add (preliminary) information on new NET-SNMP-VACM-MIB
+
+2006-09-04 16:00 tanders
+
+ * agent/mibgroup/: tcp-mib/data_access/.cvsignore,
+ tcp-mib/tcpConnectionTable/.cvsignore,
+ tcp-mib/tcpListenerTable/.cvsignore,
+ udp-mib/data_access/.cvsignore,
+ udp-mib/udpEndpointTable/.cvsignore:
+
+ tweak .cvsignore files for new udp-mib/tcp-mib
+
+2006-09-04 15:55 tanders
+
+ * apps/snmptrapd.c:
+
+ fix compiler warnings
+
+2006-09-04 07:16 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_linux.c:
+
+ Tell a fussy compiler (S/W, not human) to shut up.
+
+2006-09-04 06:33 dts12
+
+ * agent/mibgroup/: ucd_snmp.h, agent/extend.c,
+ ucd-snmp/extensible.c:
+
+ Drop the old UCD extensible module from the default build.
+ Rely on the reworked (cached, valid syntax) "extend" module instead.
+
+2006-09-04 04:06 dts12
+
+ * agent/mibgroup/agent/nsVacmAccessTable.c, apps/snmptrapd.c
+:
+
+ Support registering VACM extensions in a non-default context
+ (such as used by 'snmptrapd')
+
+2006-09-04 04:04 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c, man/snmpd.conf.5.def
+:
+
+ Support non-default contexts with the auth* convenience directives.
+
+2006-09-04 04:00 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Tweak variable names to be less confusing.
+ ("authtype" now has a specific meaning, contrary to the use here).
+
+2006-09-01 17:34 rstory
+
+ * dist/Makefile:
+
+ fix cvsroot
+
+2006-09-01 16:19 hardaker
+
+ * man/snmpcmd.1.def:
+
+ document -Y
+
+2006-09-01 16:17 hardaker
+
+ * agent/snmpd.c:
+
+ make snmpd support the -Y config flag like the other commands do
+
+2006-09-01 15:31 tanders
+
+ * dist/net-snmp.spec:
+
+ - Update to 5.4.dev
+ - introduce %{libcurrent}
+ - use new disman/event name
+ - add: README.aix README.osX README.tru64 README.irix README.agent-mibs
+ README.Panasonic_AM3X.txt
+ - add new NetSNMP::agent::Support
+
+2006-09-01 10:58 rstory
+
+ * NEWS:
+
+ - note new mib2c.emulation.conf
+ - note new linux ipv6 aware default mibs
+ - expand scopy of note on fixes to non-linux ipaddress size
+
+2006-09-01 10:55 rstory
+
+ * agent/mibgroup/mibII.h:
+
+ add tcp and udp mib tables to linux mibII module list
+
+2006-09-01 10:52 rstory
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c:
+
+ fix byteorder problems
+
+2006-09-01 10:50 rstory
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ include/net-snmp/data_access/tcpConn.h:
+
+ - only log error once if we can't open /proc/net/tcp6
+ - add ability to only load ipv4 data
+
+2006-09-01 10:42 rstory
+
+ * agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c:
+
+ fix byteorder problems
+
+2006-09-01 10:38 rstory
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ new function to 'byteswap' hex-string representation of an address
+
+2006-09-01 07:50 rstory
+
+ * agent/mibgroup/mibII/: at.c, udpTable.c,
+ var_route.c:
+
+ more ip address size fixes
+
+2006-09-01 05:41 tanders
+
+ * perl/: TrapReceiver/TrapReceiver.xs, agent/agent.xs
+:
+
+ align the netsnmp_oid struct definition (oid, size_t!) with the one from NetSNMP::OID
+
+2006-09-01 02:44 tanders
+
+ * README.aix, README.solaris, README.tru64:
+
+ add notes on IPv6
+
+2006-08-31 17:43 tanders
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ fix typo
+
+2006-08-31 17:15 tanders
+
+ * perl/OID/OID.xs:
+
+ OID len should be a size_t
+
+2006-08-31 15:47 tanders
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Use correct sockaddr_storage.[__]ss_family depending on the result of the corresponding configure test. Makes the UDPIPv6 transport code work on at least AIX and Tru64 Unix.
+
+2006-08-31 15:44 tanders
+
+ * configure, configure.in, acconfig.h,
+ include/net-snmp/net-snmp-config.h.in:
+
+ check for sockaddr_storage.[__]ss_family used in the UDPIPv6 transport code
+
+2006-08-31 12:44 rstory
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ fix IpAddress lengths on non-Linux 64bit platforms
+
+2006-08-31 01:34 tanders
+
+ * agent/mibgroup/ip-mib/data_access/scalars_linux.c:
+
+ add missing semicolon (even one-line patches can easily break the build ;-))
+
+2006-08-30 17:36 hardaker
+
+ * apps/snmptable.c:
+
+ covertiy bug 127: double check name_p pointer actually got filled before using it
+
+2006-08-30 17:33 hardaker
+
+ * snmplib/snmp_logging.c:
+
+ make sure snmp_log_options checks for NULLs of argv in illegal calls (should never happen)
+
+2006-08-30 17:29 hardaker
+
+ * snmplib/keytools.c:
+
+ coverty bug 59: double check system handles int/uint conversions properly
+
+2006-08-30 17:25 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/scalars_linux.c:
+
+ coverty bug 155: free file pointer during ipv6 forwarding
+
+2006-08-30 17:21 hardaker
+
+ * snmplib/parse.c:
+
+ coverty bug 156: free resources during mib parsing failures
+
+2006-08-30 17:14 hardaker
+
+ * snmplib/keytools.c:
+
+ coverty bug 60: double check that systems handle negative returns to unsigned variables properly
+
+2006-08-30 08:35 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ fix printing of opaque float and double compile warnings
+
+2006-08-30 08:30 dts12
+
+ * agent/mibgroup/agent/nsVacmAccessTable.c:
+
+ Simple SET support for the Net-SNMP VACM extensions.
+
+2006-08-30 08:29 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c,
+ include/net-snmp/library/vacm.h, snmplib/vacm.c:
+
+ Persistent storage for Net-SNMP VACM extension authtypes.
+
+2006-08-29 17:59 tanders
+
+ * configure, configure.in:
+
+ add generic IPv6 stack detection, e.g. for Solaris
+
+2006-08-29 09:05 dts12
+
+ * mibs/NET-SNMP-VACM-MIB.txt:
+
+ Fix inconsistent naming.
+
+2006-08-29 06:40 dts12
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Guard against missing (or incomplete) CPU history stats.
+
+2006-08-29 06:19 tanders
+
+ * mibs/NET-SNMP-VACM-MIB.txt:
+
+ fix some basic smilint complaints
+
+2006-08-29 05:56 dts12
+
+ * agent/mibgroup/agent/nsVacmAccessTable.c,
+ agent/mibgroup/agent/nsVacmAccessTable.h,
+ mibs/NET-SNMP-VACM-MIB.txt:
+
+ Provisional (read-only) implementation of a MIB for the Net-SNMP
+ access control extensions.
+
+2006-08-29 03:11 dts12
+
+ * agent/helpers/table.c:
+
+ Get-Next processing didn't handle updating the index list for multi-indexed
+ tables properly. It worked OK for the first candidate found, but subsequent
+ (better) candidates only updated the first index value.
+ This code is slightly less efficient, but works as expected.
+
+2006-08-29 03:09 dts12
+
+ * agent/mibgroup/ucd-snmp/: vmstat_linux.c, vmstat_linux.h
+:
+
+ Ship older vmstat implementation code - allow admins the option of reverting.
+
+2006-08-29 03:05 dts12
+
+ * agent/mibgroup/hardware/cpu/: cpu_nlist.c, cpu_sysctl.c
+:
+
+ Better handling of single-CPU systems.
+ Don't create new CPU entries when loading stats.
+ [Don't commit from more than one working system, Dave!]
+
+2006-08-29 02:30 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Keep braces balanced - it makes tracing code *so* much easier!
+
+2006-08-27 14:34 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ udpTable requires /dev/kmem access (root:system) on AIX
+
+2006-08-27 10:06 dts12
+
+ * agent/mibgroup/: ucd_snmp.h, host/hr_proc.c,
+ host/hr_proc.h:
+
+ Use HAL CPU interface for both UCD-specific and HostRes processor modules.
+
+2006-08-27 10:04 dts12
+
+ * agent/mibgroup/hardware/cpu.h:
+
+ Ensure that some form of HAL CPU module is included for all systems.
+
+2006-08-27 10:02 dts12
+
+ * agent/mibgroup/hardware/cpu/: cpu_null.c, cpu_null.h:
+
+ Dummy HAL CPU module, for systems that don't use any of the
+ supported interfaces.
+
+2006-08-27 09:47 dts12
+
+ * agent/mibgroup/host/hr_device.c:
+
+ Handle holes in the table properly.
+
+2006-08-27 09:45 dts12
+
+ * agent/mibgroup/hardware/cpu/: cpu.c, cpu_kerndata.c,
+ cpu_perfstat.c, cpu_pstat.c:
+
+ Better handling of single-CPU systems.
+ Don't create new CPU entries when loading stats.
+
+2006-08-27 09:43 dts12
+
+ * include/net-snmp/agent/hardware/cpu.h,
+ agent/mibgroup/hardware/cpu/cpu_kstat.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.c:
+
+ Report processor status
+
+2006-08-26 16:23 tanders
+
+ * configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ make autoheader protect PACKAGE_* variables
+
+2006-08-25 16:23 tanders
+
+ * testing/tests/: Sv3config, Sv3usmconfigagent,
+ Svanyconfig:
+
+ Fix smuxsocket config to point to /smux_socket instead of /dev/null to avoid removing /dev/null when running as root.
+
+2006-08-25 09:43 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Clarify discussion of view masks. Thanks to Dominique Bastien.
+
+2006-08-25 07:20 tanders
+
+ * configure.in, configure:
+
+ allow for whitespace in Perl cc (e.g. on IRIX 6.5)
+
+2006-08-25 06:55 tanders
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ properly cast when printing pointers
+
+2006-08-25 06:35 tanders
+
+ * apps/snmptrapd_handlers.c:
+
+ netsnmp_trapd_check_auth() only takes a single argument
+
+2006-08-25 05:13 tanders
+
+ * agent/helpers/table_iterator.c:
+
+ fix: 'return' with no value, in function returning non-void
+
+2006-08-25 04:51 tanders
+
+ * apps/snmptrapd_auth.h:
+
+ add prototype for netsnmp_trapd_check_auth()
+
+2006-08-25 04:46 tanders
+
+ * apps/snmptrapd.c:
+
+ #include "mibII/vacm_conf.h" for vacm_standard_views
+
+2006-08-25 04:38 tanders
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ print oid as unsigned long
+
+2006-08-25 02:57 tanders
+
+ * testing/tests/T115agentxperl:
+
+ make sure we can fulfill external library dependencies
+
+2006-08-25 02:41 tanders
+
+ * agent/helpers/table_iterator.c, snmplib/container.c
+, snmplib/mib.c, snmplib/snmp_debug.c,
+ snmplib/system.c:
+
+ initialize variables
+
+2006-08-25 02:33 tanders
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ proper types in format string
+
+2006-08-25 01:49 tanders
+
+ * configure, configure.in:
+
+ Add "-Ux" before "-Dx=x" for gcc to avoid annoying compiler warnings
+ on platforms that already define x (to 1).
+
+2006-08-24 17:41 tanders
+
+ * snmplib/snmp_debug.c:
+
+ use new snmp_cstrcat
+
+2006-08-24 17:36 tanders
+
+ * snmplib/mib.c, include/net-snmp/library/tools.h:
+
+ Introduce snmp_cstrcat that takes a (char *) as the last argument,
+ casts it to a (const u_char *) and calls snmp_strcat. Simplifies code
+ and fixes a *lot* of compiler warnings.
+
+2006-08-24 16:04 tanders
+
+ * agent/agent_registry.c, agent/helpers/row_merge.c,
+ agent/mibgroup/agent/nsDebug.c, perl/SNMP/SNMP.xs,
+ snmplib/md5.c, snmplib/read_config.c,
+ snmplib/snmp_logging.c, snmplib/text_utils.c:
+
+ - pointer size fixes from darix
+ - initialize variables
+ - print size_t as unsigned long
+
+2006-08-24 15:45 tanders
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ ISO C90 forbids mixed declarations and code
+
+2006-08-24 13:21 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ run autoheader
+
+2006-08-24 13:21 rstory
+
+ * acconfig.h:
+
+ add HAVE_PERL_EVAL_PV undef for whoever forgot to add it
+
+2006-08-24 13:19 rstory
+
+ * acconfig.h:
+
+ add config_error and config_warning empty macros
+
+2006-08-24 09:14 tanders
+
+ * apps/snmpusm.c:
+
+ Print size_t as unsigned long.
+
+2006-08-24 08:41 tanders
+
+ * snmplib/snmp_client.c:
+
+ Keep printing some know-to-be-small size_t values as integers, but properly
+ cast them to quiet the compiler.
+
+2006-08-24 07:31 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.h:
+
+ use new interface_sysctl for OpenBSD 2, FreeBSD 4-6
+
+2006-08-24 07:30 rstory
+
+ * agent/mibgroup/if-mib/data_access/: interface_openbsd.c,
+ interface_sysctl.c, interface_sysctl.h:
+
+ remove OS specific file in favor of method specific files
+
+2006-08-24 05:52 dts12
+
+ * agent/mibgroup/hardware/cpu/: cpu_kstat.c, cpu_nlist.c
+, cpu_pstat.c, cpu_sysctl.c:
+
+ Include descriptions for individual CPU entries.
+
+2006-08-24 05:50 dts12
+
+ * agent/mibgroup/hardware/cpu/: cpu_kerndata.h,
+ cpu_kerndata.c:
+
+ Implementation for Dynix (and similar) systems.
+
+2006-08-24 05:48 dts12
+
+ * include/net-snmp/agent/hardware/cpu.h,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/hardware/cpu/cpu_perfstat.c:
+
+ Remember the number of CPUs detected.
+ (Q: what to do if this changes?)
+
+2006-08-23 17:33 tanders
+
+ * snmplib/snmp_api.c:
+
+ Print size_t as unsigned long. Fixes 64-bit compiler warnings.
+
+2006-08-23 17:12 tanders
+
+ * configure, configure.in:
+
+ Add AC_PROG_EGREP and use $EGREP instead of egrep
+
+2006-08-23 16:43 rstory
+
+ * snmplib/oid_stash.c:
+
+ fix struct type in case
+
+2006-08-23 16:35 rstory
+
+ * configure:
+
+ update for configure.in
+
+2006-08-23 16:34 rstory
+
+ * configure.in:
+
+ add back check for sed
+
+2006-08-23 13:33 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ skip ifConnectorPresent/ifLinkUpDownTrapEnable if no data
+
+2006-08-23 12:23 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ correct scale when using ifSpeed as ifHighSpeed
+
+2006-08-23 11:58 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ use ifSpeed if ifHighSpeed==0
+
+2006-08-23 08:53 tanders
+
+ * snmplib/: container.c, container_binary_array.c,
+ data_list.c, keytools.c, mib.c, oid_stash.c
+, scapi.c, snmpCallbackDomain.c,
+ snmpTCPDomain.c, snmpUDPDomain.c, snmpUnixDomain.c
+, snmp_api.c, snmp_debug.c,
+ snmp_parse_args.c, snmpv3.c, text_utils.c,
+ tools.c:
+
+ Cast away compiler warnings/errors at a lot of places.
+
+2006-08-23 06:02 tanders
+
+ * agent/mibgroup/hardware/cpu.h:
+
+ activate cpu HAL code for AIX 4.x
+
+2006-08-23 03:23 tanders
+
+ * configure, configure.in:
+
+ Don't check twice for sed.
+
+2006-08-23 03:09 dts12
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ More portable handling of string assignments.
+ Remove C++-style comments.
+
+2006-08-23 03:07 tanders
+
+ * configure, configure.in:
+
+ fix more whitespace issues in mib module config
+
+2006-08-22 14:48 tanders
+
+ * agent/mibgroup/: ucd_snmp.h, hardware/cpu.h:
+
+ activate mem/cpu HAL code for AIX
+
+2006-08-22 09:11 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_perfstat.c:
+
+ Use correct API calls.
+
+2006-08-22 07:00 tanders
+
+ * README.tru64:
+
+ Update for 5.4 and embedded Perl.
+
+2006-08-22 06:52 dts12
+
+ * agent/mibgroup/hardware/cpu/: cpu_kstat.h, cpu_perfstat.h
+, cpu_pstat.h:
+
+ Missing HAL CPU API-specific header files
+
+2006-08-22 06:42 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c:
+
+ Handle change introduced with NetBSD 3.0.
+ sysctl( KERN_CP_TIME ) now returns 64-bit values.
+
+2006-08-22 05:15 dts12
+
+ * configure.in, configure,
+ agent/mibgroup/default_modules.h:
+
+ Be consistent in use of Event-MIB module terminology.
+
+2006-08-22 03:34 tanders
+
+ * configure.in, configure:
+
+ Improve robustness of the embedded perl checks.
+
+2006-08-22 02:26 tanders
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ Change "#if freebsd4" to "#ifdef freebsd4" to match current -Dfreebsd4=freebsd4.
+
+2006-08-22 02:22 tanders
+
+ * agent/mibgroup/: host/hr_storage.c, host/hr_swrun.c
+, mibII/route_headers.h:
+
+ Change "#if solaris2" to "#ifdef solaris2" to match current -Dsolaris2=solaris2.
+
+2006-08-21 17:47 tanders
+
+ * configure, configure.in:
+
+ "-U" doesn't work as expected with Sun's cc.
+
+2006-08-21 17:26 tanders
+
+ * agent/snmp_perl.c:
+
+ Perl_eval_pv (the upper-case variant) needs three arguments instead of two.
+
+2006-08-21 17:04 tanders
+
+ * configure, configure.in:
+
+ Yet another attempt to fix the PARTIALTARGETOS (e.g. solaris2) definitions.
+
+2006-08-21 16:33 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ replacement for newSVuv() because perl didn't have it until 5.6.0
+
+2006-08-21 15:40 tanders
+
+ * configure, configure.in:
+
+ Rewording of perl cc check errors.
+
+2006-08-21 14:07 hardaker
+
+ * configure.in:
+
+ change the OS define to redefine as the same name
+
+2006-08-21 09:44 tanders
+
+ * configure.in:
+
+ - add perl cc checks for embedded perl
+ - introduce --disable-perl-cc-checks to disable these tests
+
+2006-08-21 09:42 tanders
+
+ * configure:
+
+ configure.in
+
+2006-08-21 03:53 tanders
+
+ * configure, configure.in:
+
+ - fix config_arch_require
+ - remove obsolete AC_EXEEXT
+
+2006-08-21 02:27 dts12
+
+ * agent/mibgroup/hardware/cpu.h:
+
+ Active HAL CPU module for *BSD systems.
+
+2006-08-21 02:26 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c:
+
+ Retrieve and report memory-related statistics.
+ (Still not convinced these really belong here....)
+
+2006-08-21 02:25 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu_sysctl.c:
+
+ Retrieve CPU stats correctly.
+
+2006-08-18 15:28 tanders
+
+ * configure, configure.in:
+
+ fix perl -V:cc
+
+2006-08-18 09:00 dts12
+
+ * agent/mibgroup/ucd-snmp/: vmstat.c, vmstat.h:
+
+ Use the HAL CPU modules to implement UCD-SNMP-MIB::systemStats.
+ Initially only used by Linux systems, but this code is now
+ fundamentally architecture-independent.
+
+2006-08-18 08:58 dts12
+
+ * include/net-snmp/agent/hardware/cpu.h:
+
+ Additional fields for CPU-related (sort-of) history, etc.
+
+2006-08-18 08:56 dts12
+
+ * agent/mibgroup/hardware/cpu/: cpu.c, cpu_kerndata.c,
+ cpu_kstat.c, cpu_linux.c, cpu_nlist.c,
+ cpu_nlist.h, cpu_perfstat.c, cpu_pstat.c,
+ cpu_sysctl.c, cpu_sysctl.h:
+
+ Provisional hardware-abstraction modules for assorted CPU statistics.
+ (including multi-CPU information)
+
+2006-08-18 08:33 hardaker
+
+ * agent/snmp_perl.c:
+
+ yet more potential perl fixes
+
+2006-08-18 08:32 hardaker
+
+ * agent/snmp_perl.c:
+
+ more potential perl fixes
+
+2006-08-18 07:44 tanders
+
+ * configure.in, configure:
+
+ use "perl -V:cc" to find Perl's cc
+
+2006-08-18 07:37 hardaker
+
+ * configure, configure.in:
+
+ commenting and a bit of spacing in the module list code
+
+2006-08-17 17:19 hardaker
+
+ * configure, configure.in, acconfig.h,
+ agent/snmp_perl.c, include/net-snmp/net-snmp-config.h.in
+:
+
+ make configure bail when embedded perl function can not be found ; fix the fact that 3 functions are needed not 2 and work around autoconf upper-case only defines that causes the existing broken-perl problem; NEWS - perl: fix the 'broken perl' issue with embedded perl
+
+2006-08-17 16:14 tanders
+
+ * include/net-snmp/system/: bsdi3.h, bsdi4.h, darwin.h
+, darwin7.h, dynix.h, freebsd3.h,
+ freebsd4.h, freebsd5.h, freebsd6.h, generic.h
+, hpux.h, mingw32msvc.h, netbsd.h,
+ openbsd.h, osf5.h:
+
+ "#define x x" instead of "#define x 1" for all platform names
+
+2006-08-17 08:44 tanders
+
+ * snmplib/snmpv3.c:
+
+ BUG: Coverity #149: potential NULL pointer dereference
+
+2006-08-17 08:41 dts12
+
+ * agent/mibgroup/disman/event-mib.h:
+
+ Drop DisMan Event MIB re-write warning.
+
+2006-08-17 08:16 tanders
+
+ * snmplib/mib.c:
+
+ BUG: Coverity #159: potential resource leak after malloc failure
+
+2006-08-17 08:03 rstory
+
+ * agent/mibgroup/: if-mib/ifTable/ifTable_interface.c,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
+,
+ ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c
+, ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
+, tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c
+, tcp-mib/tcpListenerTable/tcpListenerTable_interface.c
+, udp-mib/udpEndpointTable/udpEndpointTable_interface.c
+:
+
+ BUG: Coverity #56: don't continue if malloc fails
+
+2006-08-17 07:50 rstory
+
+ *
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
+, local/mib2c-conf.d/mfd-interface.m2c:
+
+ BUG: Coverity #56: don't continue after failed malloc
+
+2006-08-17 07:31 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c:
+
+ BUG: Coverity #174: don't return ptr to freed memory
+
+2006-08-17 01:52 dts12
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c:
+
+ Fix variable types to match parameter usage. Spotted by Scott Moynes.
+
+2006-08-16 19:29 hardaker
+
+ * configure, configure.in:
+
+ fix issue with OS name being defined as 1
+
+2006-08-16 16:08 tanders
+
+ * Makefile.in:
+
+ update for reworked Solaris headers
+
+2006-08-15 22:54 tanders
+
+ * man/: snmpd.8.def, snmpd.conf.5.def,
+ snmpd.examples.5.def:
+
+ fix typo
+
+2006-08-15 14:20 marz
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ Fix email address
+
+2006-08-15 08:46 hardaker
+
+ * configure, configure.in:
+
+ clean up the tmp created file
+
+2006-08-15 07:27 hardaker
+
+ * configure, configure.in:
+
+ fixed config_arch_require
+
+2006-08-15 07:26 tanders
+
+ * include/net-snmp/system/freebsd5.h:
+
+ force "#undef IFNET_NEEDS_KERNEL" on FreeBSD 5.x only
+
+2006-08-15 07:07 tanders
+
+ * include/net-snmp/system/: solaris2.10.h, solaris2.7.h
+, solaris2.8.h, solaris2.9.h:
+
+ remove obsolete header files
+
+2006-08-15 05:16 tanders
+
+ * agent/mibgroup/default_modules.h:
+
+ avoid comment inside comment
+
+2006-08-15 01:48 tanders
+
+ * README.solaris, configure, configure.in,
+ man/snmptrapd.8.def:
+
+ minor wording changes
+
+2006-08-14 20:25 hardaker
+
+ * acinclude.m4, configure, configure.in:
+
+ - Cleaned up the debugging code for the module section
+ - Added a AC_MSG_MODULE_DBG macro to clean up the zillions of ifs
+ - Reworked the m4 quoting of the section to only changequote when
+ actually needed, rather than doing the reverse and having to change
+ to "normal" quoting when a macro call is needed.
+
+2006-08-14 16:29 tanders
+
+ * include/net-snmp/system/: freebsd4.h, freebsd5.h,
+ freebsd6.h:
+
+ simplify/aggregate FreeBSD headers
+
+2006-08-14 15:57 tanders
+
+ * include/net-snmp/system/: solaris.h, solaris2.3.h,
+ solaris2.4.h, solaris2.5.h, solaris2.6.h:
+
+ Rework of header files for Solaris. solaris.h now covers Solaris 7 and up (including any future versions) while solaris2.[3-6].h covers legacy support.
+
+2006-08-14 13:27 hardaker
+
+ * configure:
+
+ update
+
+2006-08-14 13:24 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ updated UCD references to Net-SNMP, updated contact info
+
+2006-08-14 13:23 hardaker
+
+ * acconfig.h, configure.in,
+ agent/mibgroup/default_modules.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/aix.h,
+ include/net-snmp/system/dynix.h,
+ include/net-snmp/system/freebsd.h,
+ include/net-snmp/system/hpux.h,
+ include/net-snmp/system/linux.h,
+ include/net-snmp/system/solaris.h:
+
+ New configure based default_modules.h file to decide which modules to
+ build into the agent.
+ NEWS: snmpd -- Agent builds default module list from a default_mibs.h rather than a hard coded configure list
+
+2006-08-14 13:20 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ updated references to UCD to Net-SNMP, updated contact info
+
+2006-08-11 18:15 tanders
+
+ * configure, configure.in, sedscript.in,
+ agent/mibgroup/agentx/protocol.h,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c
+, include/net-snmp/net-snmp-config.h.in,
+ man/snmpd.8.def, man/snmpd.conf.5.def,
+ man/snmptrapd.8.def:
+
+ Introduce --with-agentx-socket=FILE configure option. Helps packagers to *properly* customize that path (not encouraged, but quite common).
+
+2006-08-11 07:56 tanders
+
+ * snmplib/snmp_logging.c:
+
+ vsnprintf() needs to be followed by va_end
+
+2006-08-11 06:45 tanders
+
+ * snmplib/snmp_logging.c:
+
+ don't call va_end() if we've only memcpy()ed
+
+2006-08-11 02:59 tanders
+
+ * snmplib/snmp_logging.c:
+
+ simple attempt to fix recently introduced va_copy() build issues
+
+2006-08-10 07:11 dts12
+
+ * snmplib/snmp_api.c:
+
+ Report a failure to build the PDU. (Ref Bug #1399370)
+
+2006-08-10 01:58 dts12
+
+ * EXAMPLE.conf.def:
+
+ With fear and trepidation, remove the warnings against use of AgentX.
+ Doomed, we're aaaall dooooomed....
+
+2006-08-09 10:26 hardaker
+
+ * perl/agent/MANIFEST:
+
+ updated to correct list
+
+2006-08-09 10:13 hardaker
+
+ * perl/: Makefile.PL, Makefile.subs.pl,
+ ASN/Makefile.PL, OID/Makefile.PL, SNMP/Makefile.PL
+, TrapReceiver/Makefile.PL, agent/Makefile.PL
+, agent/default_store/Makefile.PL,
+ default_store/Makefile.PL:
+
+ another pass at perl/CPAN specific versioning checks
+
+2006-08-09 09:57 hardaker
+
+ * perl/: Makefile.PL, Makefile.subs.pl,
+ ASN/Makefile.PL, OID/Makefile.PL, SNMP/Makefile.PL
+, TrapReceiver/Makefile.PL, agent/Makefile.PL
+, agent/default_store/Makefile.PL,
+ default_store/Makefile.PL:
+
+ allow for very minor deviations in perl CPAN source versions from net-snmp versions
+
+2006-08-09 09:46 hardaker
+
+ * perl/SNMP/README:
+
+ major update for CPAN release
+
+2006-08-09 09:43 hardaker
+
+ * perl/SNMP/MANIFEST:
+
+ match 5.3 tree for ordering
+
+2006-08-09 09:41 hardaker
+
+ * perl/SNMP/MANIFEST:
+
+ update for recent needed testing files
+
+2006-08-08 17:51 tanders
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ build fix
+
+2006-08-08 15:16 tanders
+
+ * acinclude.m4:
+
+ Move our own m4 macros from aclocal.m4 into acinclude.m4 and properly quote them. Follows libtool/automake recommendations and allows to regenerate aclocal.m4 (containing libtool.m4) by calling aclocal which I've just done. Inspired by Debian patch #21.
+
+2006-08-08 15:07 bshaw666
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ minor documentation update
+
+2006-08-08 15:02 tanders
+
+ * aclocal.m4:
+
+ Move our own m4 macros from aclocal.m4 into acinclude.m4 and properly quote them. Follows libtool/automake recommendations and allows to regenerate aclocal.m4 (containing libtool.m4) by calling aclocal which I've just done. Inspired by Debian patch #21.acinclude.m4
+
+2006-08-08 06:18 tanders
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ run autoheader
+
+2006-08-08 06:18 tanders
+
+ * acconfig.h:
+
+ add HAVE_LIBNM in order to make autoheader work again
+
+2006-08-07 15:53 tanders
+
+ * aclocal.m4, config.guess, config.sub, configure
+, NEWS, ltmain.sh:
+
+ libtool update to 1.5.22 (from 1.4). Supersedes patch 1496945 and fixes bug 1518117 (probably plus a few more).
+
+2006-08-07 08:33 tanders
+
+ * testing/TESTCONF.sh:
+
+ Already randomize the initial port we try. Lowers the chance of collisions if multiple test suites run in parallel.
+
+2006-08-07 05:44 rstory
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ explicit cast to keep compiler happy
+
+2006-08-07 03:03 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Fix typo. Spotted by Leo Lei
+
+2006-08-05 17:01 tanders
+
+ * agent/mibgroup/host/: hr_filesys.c, hr_swrun.c:
+
+ Build fixes for AIX HOST-RESOURCES-MIB support
+
+2006-08-05 12:17 tanders
+
+ * Makefile.in:
+
+ add directory containing libperl.so to LD_RUN_PATH
+
+2006-08-04 15:36 bshaw666
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ E450 reporting PS temps as voltage, other problems
+
+2006-08-03 18:02 tanders
+
+ * Makefile.in:
+
+ override LD_RUN_PATH for the perl modules to avoid dependencies on the build directory (patch from darix)
+
+2006-08-01 04:43 tanders
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ one more correction
+
+2006-07-31 22:52 tanders
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ minor updates
+
+2006-07-31 16:42 hardaker
+
+ * perl/SNMP/t/mibload.t:
+
+ fix a test that may succeed when it shouldn't
+
+2006-07-31 16:05 hardaker
+
+ * NEWS:
+
+ mention gettable patch
+
+2006-07-31 16:03 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ fix getbulk at end-of-mibview boundaries
+
+2006-07-31 15:44 hardaker
+
+ * mibs/TUNNEL-MIB.txt:
+
+ update again to most recent
+
+2006-07-31 15:43 hardaker
+
+ * mibs/TUNNEL-MIB.txt:
+
+ update from the latest version.
+
+2006-07-31 15:40 hardaker
+
+ * dist/makerelease:
+
+ version tag doxygen files
+
+2006-07-31 15:39 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ minor updates
+
+2006-07-31 13:31 tanders
+
+ * apps/snmptrapd.c:
+
+ initialize snmptrapd authorization unconditionally of using AgentX (fixes bug 1527661)
+
+2006-07-31 07:25 marz
+
+ * doc/rfc/: agentx/rfc2741.txt, misc/rfc3512.txt,
+ misc/rfc3584.txt, smiV2/rfc2578.txt,
+ smiV2/rfc2579.errata, smiV2/rfc2579.errata~,
+ smiV2/rfc2579.txt, smiV2/rfc2580.txt,
+ snmpV1/rfc1155.txt, snmpV1/rfc1157.txt,
+ snmpV1/rfc1212.txt, snmpV1/rfc1213.txt,
+ snmpV2/rfc1901.txt, snmpV2/rfc1902.txt,
+ snmpV2/rfc1903.txt, snmpV2/rfc1904.txt,
+ snmpV2/rfc1905.txt, snmpV2/rfc1906.txt,
+ snmpV2/rfc1907.txt, snmpV2/rfc1908.txt,
+ snmpV2/rfc2089.txt, snmpV3/rfc3410.errata,
+ snmpV3/rfc3410.txt, snmpV3/rfc3411.txt,
+ snmpV3/rfc3412.txt, snmpV3/rfc3413.errata,
+ snmpV3/rfc3413.txt, snmpV3/rfc3414.errata,
+ snmpV3/rfc3414.txt, snmpV3/rfc3415.errata,
+ snmpV3/rfc3415.txt, snmpV3/rfc3416.txt,
+ snmpV3/rfc3417.txt, snmpV3/rfc3418.errata,
+ snmpV3/rfc3418.txt:
+
+ adding rfcs and errata to distribution
+
+2006-07-31 05:43 tanders
+
+ * dist/nsb-functions:
+
+ Don't catch "... snmpnetstat finds ..." (test 58) as an error.
+
+2006-07-30 17:28 tanders
+
+ * dist/nsb-functions:
+
+ Catch "Permission denied" errors, e.g. during "make install".
+
+2006-07-30 16:08 tanders
+
+ * dist/nsb-functions:
+
+ catch "Can't find ..." errors, e.g. from ld
+
+2006-07-30 15:41 tanders
+
+ * snmplib/Makefile.in:
+
+ pass LDFLAGS to allow for non-standard libcrypto location
+
+2006-07-29 16:58 tanders
+
+ * agent/helpers/debug_handler.c:
+
+ (correctly) make use of recently introduced SNMP_STRORNULL(x)
+
+2006-07-29 16:18 tanders
+
+ * agent/helpers/debug_handler.c:
+
+ make use of recently introduced SNMP_STRORNULL(x)
+
+2006-07-28 05:23 dts12
+
+ * configure, configure.in:
+
+ Support setting the persistent mask via configure. (based on Patch #1437385)
+
+2006-07-28 04:54 dts12
+
+ * configure, configure.in, agent/Makefile.in
+, snmplib/Makefile.in:
+
+ '-as-needed' support for linking libraries. (Patches #1398873 & 1493522)
+
+2006-07-28 02:39 dts12
+
+ * agent/auto_nlist.c, agent/mibgroup/host/hr_filesys.c
+, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/mibII/udp.c, snmplib/keytools.c
+, snmplib/scapi.c, snmplib/system.c:
+
+ Jumbo patch for improved AIX 5.x support. (Patch #1486307)
+ Note that the memory-related processing (host/hr_fstorage.c)
+ is now mostly handled by hardware/memory/memory_aix.c
+
+2006-07-27 12:48 hardaker
+
+ * local/tkmib:
+
+ patch from Julien Pinon to fix a few tkmib problems
+
+2006-07-27 08:50 dts12
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Support for HFS systems, plus NFS fixes for Darwin. (Patch #1520289)
+
+2006-07-27 06:29 dts12
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Prevent potential crash in Darwin. (Patch #1520286)
+
+2006-07-27 06:17 dts12
+
+ * agent/kernel.h:
+
+ Support '--without-kmem-usage' on non-Linux systems. (Patch #1520278)
+
+2006-07-27 05:25 dts12
+
+ * snmplib/Makefile.in:
+
+ Include 'pkcs' in the list of files to compile. (Patch #1514867)
+
+2006-07-27 05:12 dts12
+
+ * snmplib/: snmp_parse_args.c, snmpv3.c:
+
+ Accept -Z 0 values for engineBoot/engineTime. (Patch #1510032)
+
+2006-07-27 04:37 dts12
+
+ * apps/snmptrapd.c:
+
+ Support running trap receiver as non-root user/group. (Patch #1497467)
+
+2006-07-27 03:08 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Attempt to use the most up-to-date sysctl APIs. (Patch #1482169)
+
+2006-07-26 08:58 dts12
+
+ * local/: mib2c.container.conf, mib2c.iterate.conf,
+ mib2c.table_data.conf:
+
+ Generate proper code for non-integer value objects, and determine
+ the first and last accessible column objects. (Patch #1427712)
+
+ Q: Is it worth pulling some of this code out into a separate mib2c
+ utility file, since much of the processing is effectively identical
+ in all three cases?
+
+2006-07-26 04:56 dts12
+
+ * snmplib/snmp_logging.c:
+
+ Handle long (dynamic-buffered) messages correctly. (Bug #1516045)
+
+2006-07-26 04:50 dts12
+
+ * agent/mibgroup/target/target.c:
+
+ Ensure the secModel is initialised for SNMPv3 notifications. (Bug #1517454)
+
+2006-07-26 04:29 dts12
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Only sort relocatable extension entries. Those in the main extTable
+ don't have an OID to sort on, so attempting to do so may scramble
+ them into a random order. (Bug #1506707)
+
+2006-07-25 08:57 dts12
+
+ * agent/mibgroup/host/: hr_disk.h, hr_network.h,
+ hr_other.h, hr_partition.h, hr_print.h,
+ hr_proc.h, hr_storage.h:
+
+ Indicate dependencies between HostRes modules. (Bug #1505325)
+
+2006-07-25 08:26 dts12
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Ensure that IP Address values are reported as 4-octet
+ values on 64-bit architectures. (Bug #1504501)
+
+2006-07-25 06:48 dts12
+
+ * snmplib/mib.c:
+
+ Handle malformed Display Hints sensibly, rather than
+ going into an infinite loop. (Bug #1459665)
+
+2006-07-25 05:48 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Don't assume that all requests are necessarily valid. (Bug #1445116)
+
+2006-07-25 05:00 dts12
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Use the defined default port (if specified) for numeric IPv6
+ addresses, rather than hardwiring SNMP_PORT. (Bug #1445089)
+
+2006-07-25 03:08 dts12
+
+ * agent/helpers/debug_handler.c:
+
+ Don't choke on missing labels (Bug #1429469)
+
+2006-07-25 02:29 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Include missing flags parameter (Bug #1422708)
+
+2006-07-25 01:31 dts12
+
+ * snmplib/snmp_api.c:
+
+ Remove broken assertion (Bug #1399370)
+
+2006-07-25 01:11 dts12
+
+ * snmplib/: snmp_api.c, snmpv3.c:
+
+ Re-fix unsigned comparisons against 0 (Bug #1397891)
+ including fix for test #24
+
+2006-07-25 01:04 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Fix signedness of return values (Bug #1397906)
+
+2006-07-18 07:03 hardaker
+
+ * local/mib2c.container.conf:
+
+ SNMP_TYPEDEF_MALLOC -> SNMP_MALLOC_TYPEDEF
+
+2006-07-13 14:30 hardaker
+
+ * NEWS:
+
+ news update for recent features
+
+2006-07-13 08:22 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ callback support for gettable().
+ - not extensively well tested, but it does work
+
+2006-07-12 02:40 tanders
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ fix ifInOctets statistics on Solaris (patch 1520603 from John Green)
+
+2006-07-07 15:00 hardaker
+
+ * configure, configure.in:
+
+ typo fix
+
+2006-07-07 14:56 hardaker
+
+ * configure, configure.in:
+
+ Dave's patch to remove host mib support for windows by default
+
+2006-07-07 14:55 hardaker
+
+ * apps/snmpnetstat/inet6.c:
+
+ Dave's patch for compilation fixes for windows
+
+2006-07-07 14:48 hardaker
+
+ * include/net-snmp/library/lcd_time.h, snmplib/lcd_time.c
+, snmplib/snmp_api.c:
+
+ Patch from Mathew Bielejeski to free user list and engine time cache at shutdown
+
+2006-07-07 14:39 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ fix possbile null derefence, noted on coders
+
+2006-07-06 15:18 tanders
+
+ * testing/tests/T153solarisswap:
+
+ adjust OID for Solaris swap space size
+
+2006-07-06 15:01 tanders
+
+ * snmplib/read_config.c:
+
+ fix assignment in read_config_store_data_prefix() for ASN_IPADDRESS
+
+2006-07-05 15:44 rstory
+
+ * local/mib2c.emulation.conf:
+
+ - add warning comment for deprecated objects
+ - shorten scalar node comments by a line
+ - shorten column node comments
+
+2006-07-05 14:44 rstory
+
+ * snmplib/snmp_api.c:
+
+ add unsigned to asntypes
+
+2006-07-05 14:23 rstory
+
+ * local/mib2c.emulation.conf:
+
+ add * next to scalar enum defval
+
+2006-07-05 14:14 rstory
+
+ * local/mib2c.emulation.conf:
+
+ - 'override' and 'add_row' default to commented out
+ - add missing type info to override
+ - make conf file header mib2c comments so it's not included in output
+
+2006-07-05 07:42 rstory
+
+ * mibs/: DISMAN-NSLOOKUP-MIB.txt, DISMAN-PING-MIB.txt,
+ DISMAN-TRACEROUTE-MIB.txt:
+
+ update from RFC 4560
+
+2006-07-03 21:09 hardaker
+
+ * snmplib/parse.c:
+
+ Properly handle snmp enums using the word "deprecated"
+
+2006-07-03 20:47 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ appropriately mark deprecated table objects
+
+2006-06-30 22:12 hardaker
+
+ * local/Version-Munge.pl:
+
+ support for optional files (don't exist in every branch)
+
+2006-06-30 21:45 hardaker
+
+ * local/Version-Munge.pl:
+
+ doxygen.conf support
+
+2006-06-30 21:24 hardaker
+
+ * local/Version-Munge.pl:
+
+ check for file existence
+
+2006-06-30 21:07 hardaker
+
+ * local/Version-Munge.pl:
+
+ exit with the cvs commit status if run
+
+2006-06-30 15:53 hardaker
+
+ * perl/: Makefile.PL, Makefile.subs.pl,
+ ASN/Makefile.PL, OID/Makefile.PL, SNMP/Makefile.PL
+, TrapReceiver/Makefile.PL, agent/Makefile.PL
+, agent/Support/Makefile.PL,
+ agent/default_store/Makefile.PL, default_store/Makefile.PL
+:
+
+ better env name for not checking the version
+
+2006-06-30 15:17 hardaker
+
+ * Makefile.in:
+
+ remove version changing support; now in makerelease
+
+2006-06-30 15:16 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ remove tag support from versiontag; now in makerelease
+
+2006-06-30 15:15 hardaker
+
+ * local/Version-Munge.pl:
+
+ much better support for cvs commit, version numbering, etc
+
+2006-06-30 15:15 hardaker
+
+ * dist/makerelease:
+
+ various fixes and improvements
+
+2006-06-30 15:13 hardaker
+
+ * perl/: Makefile.PL, ASN/ASN.pm, ASN/Makefile.PL
+, AnyData_SNMP/Storage.pm, OID/Makefile.PL,
+ OID/OID.pm, SNMP/Makefile.PL, SNMP/SNMP.pm,
+ TrapReceiver/Makefile.PL, TrapReceiver/TrapReceiver.pm
+, agent/Makefile.PL, agent/agent.pm,
+ agent/Support/Makefile.PL, agent/Support/Support.pm,
+ agent/default_store/Makefile.PL,
+ agent/default_store/default_store.pm,
+ default_store/Makefile.PL, default_store/default_store.pm
+:
+
+ perl version numbering changes
+
+2006-06-30 15:12 hardaker
+
+ * perl/Makefile.subs.pl:
+
+ Update to check for CPAN required perl version numbers
+
+2006-06-29 16:59 rstory
+
+ * local/mib2c.emulation.conf:
+
+ first pass at autogenerating override/table/add_row entries for a MIB
+
+2006-06-27 11:40 tanders
+
+ * testing/tests/: T061agentperl, T115agentxperl:
+
+ set DYLD_LIBRARY_PATH for OSX and SHLIB_PATH for HP-UX
+
+2006-06-27 11:09 tanders
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ fix more udpTable byte-order issues (indices) on *BSD and Solaris/x86
+
+2006-06-27 09:42 rstory
+
+ * README.osX:
+
+ remove embeded perl info; add perl agentx info
+
+2006-06-26 15:28 tanders
+
+ * testing/TESTCONF.sh:
+
+ add netstat path for IRIX
+
+2006-06-26 08:33 tanders
+
+ * include/net-snmp/system/netbsd.h:
+
+ udpTable byte-order fix (values only) for NetBSD and OpenBSD
+
+2006-06-25 14:43 tanders
+
+ * testing/tests/T061agentperl:
+
+ prepend (instead of replace) a non-empty LD_LIBRARY_PATH; fixes test errors on systems that rely on it
+
+2006-06-25 14:25 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ fix test error on Solaris etc.: only use "id -u" on systems that support it
+
+2006-06-25 08:43 alex_b
+
+ * perl/: Makefile.PL, Makefile.makefiles,
+ Makefile.subs.pl, ASN/Makefile.PL, OID/Makefile.PL
+, SNMP/Makefile.PL, TrapReceiver/Makefile.PL,
+ agent/Makefile.PL, agent/Support/Makefile.PL,
+ agent/default_store/Makefile.PL, default_store/Makefile.PL
+:
+
+ -'perl Makefile.PL -NET-SNMP-IN-SOURCE=true' was not working. Fix: call
+ 'nsconfig' --version inside of InitMakeParams instead of Check_Version
+ -Support module: NetSNMPGetOpts call should pass parent folder so net-snmp-config
+ can be found
+ -Support/Makefile.PL was missing from Makefile.makefiles
+
+2006-06-24 09:00 alex_b
+
+ * perl/: Makefile.PL, Makefile.makefiles,
+ Makefile.subs.pl, make-perl-makefiles,
+ ASN/Makefile.PL, OID/Makefile.PL, SNMP/Makefile.PL
+, TrapReceiver/Makefile.PL, agent/Makefile.PL,
+ agent/default_store/Makefile.PL, default_store/Makefile.PL
+:
+
+ -Skip version check for Win32 MSVC
+ -add TrapReceiver to Makefile.makefiles
+ -make-perl-makefiles: rename files AFTER closing them, not before
+
+2006-06-23 12:50 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ check for 127.0.0.1., not just , to identify byte-order issues
+
+2006-06-23 09:06 hardaker
+
+ * agent/mibgroup/mibII/udpTable.c,
+ include/net-snmp/system/cygwin.h,
+ include/net-snmp/system/freebsd.h,
+ include/net-snmp/system/solaris.h:
+
+ Clean fixing of ordering problems with kernel storage of UDP values
+
+2006-06-23 08:52 dts12
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Document current best-practise for announcing new releases
+ (including pre-releases and release candidates).
+ Say what we do, rather than do what we say.
+
+2006-06-23 05:19 tanders
+
+ * dist/nsb-package:
+
+ fix typos
+
+2006-06-23 02:47 tanders
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ fix earlier "don't reverse address byte order for solaris (specifically x86) for local addresses" patch that broke byte order for all platforms
+
+2006-06-20 15:35 tanders
+
+ * dist/nsb-functions:
+
+ introduce NSB_PREFIX and switch to --prefix=/usr now that we support DESTDIR for everything; e.g. to avoid that the installation ends in /destdir/destdir
+
+2006-06-20 14:46 tanders
+
+ * dist/nsb-functions:
+
+ introduce NSB_EXTRA_INSTALL to be able to pass extra args to "make install"
+
+2006-06-20 12:12 tanders
+
+ * testing/tests/T061agentperl:
+
+ more portable way of exporting
+
+2006-06-20 05:41 tanders
+
+ * testing/tests/T061agentperl:
+
+ set LD_LIBRARY_PATH to make sure that NetSNMP::agent's agent.so can load (uninstalled) libnetsnmp*.so; otherwise test fails at least on FreeBSD
+
+2006-06-15 15:10 tanders
+
+ * testing/eval_tools.sh:
+
+ suppress stderr warnings for "ps -e" in order to fix [false] nightly build error messages on SF CF host alpha-linux1
+
+2006-06-15 06:52 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ add OpenBSD and NetBSD to the list of systems that require root privileges for udpTable (according to Dave's testing)
+
+2006-06-13 14:59 tanders
+
+ * testing/tests/T115agentxperl:
+
+ set NETSNMP_DS_AGENT_NO_ROOT_ACCESS (needed for e.g. Solaris 2.6)
+
+2006-06-13 05:42 tanders
+
+ * agent/mibgroup/notification-log-mib/notification_log.c,
+ include/net-snmp/library/tools.h, snmplib/callback.c
+, agent/agent_registry.c:
+
+ fix bug 1505341: agent segfaults on Solaris with -DALL
+
+2006-06-12 16:55 hardaker
+
+ * dist/makerelease:
+
+ commit the doxygen.conf file
+
+2006-06-12 16:42 tanders
+
+ * testing/TESTCONF.sh:
+
+ introduce "net-snmp-config --perlprog" and use it in the "AgentX subagent in perl" test
+
+2006-06-12 16:00 tanders
+
+ * net-snmp-config.in, testing/tests/T115agentxperl:
+
+ introduce "net-snmp-config --perlprog" and use it in the "AgentX subagent in perl" test
+
+2006-06-12 15:44 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ define mfd_*_rowreq_from_index if persistent enabled
+
+2006-06-12 15:40 rstory
+
+ * include/net-snmp/data_access/tcpConn.h:
+
+ include ipaddr instead of redefining constants
+
+2006-06-12 15:39 rstory
+
+ * include/net-snmp/library/asn1.h:
+
+ add comment w/integer value for easy grepping
+
+2006-06-12 13:23 rstory
+
+ * apps/snmpnetstat/: inet6.c, route.c:
+
+ add sys/types.h to fix OS X build
+
+2006-06-12 13:05 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c
+:
+
+ - fix bad parameter in scalar registration
+ - keep scalar value fresh using table cache + cache helper
+
+2006-06-12 13:03 rstory
+
+ * agent/mibgroup/ip-forward-mib/inetCidrRouteTable/:
+ inetCidrRouteTable_interface.c,
+ inetCidrRouteTable_interface.h:
+
+ add access to table cache
+
+2006-06-12 10:30 hardaker
+
+ * testing/tests/T141snmpv2cvacmgetfail:
+
+ fix for new failure error code
+
+2006-06-12 10:11 hardaker
+
+ * agent/snmp_agent.c:
+
+ Fix bug reported by Robert Wilcox: return no access instead of not writable on VACM denials
+
+2006-06-12 09:00 hardaker
+
+ * perl/: Makefile.subs.pl, ASN/Makefile.PL,
+ OID/Makefile.PL, SNMP/Makefile.PL,
+ TrapReceiver/Makefile.PL, agent/Makefile.PL,
+ agent/Support/Makefile.PL, agent/default_store/Makefile.PL
+:
+
+ finally a working version of the version working check
+
+2006-06-12 08:54 hardaker
+
+ * perl/: Makefile.subs.pl, ASN/Makefile.PL,
+ OID/Makefile.PL, SNMP/Makefile.PL,
+ TrapReceiver/Makefile.PL, agent/Makefile.PL,
+ agent/Support/Makefile.PL, agent/default_store/Makefile.PL
+:
+
+ fix preX version numbers before checking
+
+2006-06-12 08:46 hardaker
+
+ * perl/: Makefile.subs.pl, ASN/Makefile.PL,
+ OID/Makefile.PL, SNMP/Makefile.PL,
+ TrapReceiver/Makefile.PL, agent/Makefile.PL,
+ agent/Support/Makefile.PL, agent/Support/Support.pm,
+ agent/default_store/Makefile.PL:
+
+ check the perl module version number against the net-snmp version number
+
+2006-06-12 01:19 tanders
+
+ * dist/makerelease:
+
+ add manual step to update version number in doxygen.conf
+
+2006-06-12 01:16 tanders
+
+ * doxygen.conf:
+
+ version update
+
+2006-06-10 05:57 tanders
+
+ * apps/snmptrapd_auth.c:
+
+ fix syntax error introduced in last commit
+
+2006-06-09 13:42 tanders
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ fix typo
+
+2006-06-09 05:56 rstory
+
+ * apps/snmptrapd_auth.c:
+
+ - don't free pdu if it's not a clone
+ - ifdef more code not used if snmpv1 disabled
+
+2006-06-07 05:24 tanders
+
+ * agent/agent_registry.c:
+
+ patch from Dave to prevent crash with -Dregister_mib
+
+2006-06-07 05:13 tanders
+
+ * apps/snmpnetstat/route.c:
+
+ include netinet/in.h and arpa/inet.h to pick up ntohl on hpux10.20
+
+2006-06-05 15:37 rstory
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ fix double-free of delegated cache
+
+2006-06-05 14:27 rstory
+
+ * testing/tests/T141snmpv2cvacmgetfail:
+
+ add vacm set tests
+
+2006-06-05 14:21 rstory
+
+ * testing/tests/Svacmconfig:
+
+ add (ro|rw)community config for rw vacm test
+
+2006-06-05 11:06 rstory
+
+ * snmplib/vacm.c:
+
+ add some vacm matching debug msgs
+
+2006-06-05 10:34 rstory
+
+ * agent/mibgroup/disman/event/mteTrigger.c:
+
+ - use new ability to schedule alarm in 0 sec to run mte tirggers asap after
+ startup, instead of during config file parsing
+ - add missing \n to log msg
+
+2006-06-05 10:31 rstory
+
+ * snmplib/snmp_alarm.c:
+
+ - allow a 0 time in snmp_alarm_register, to mean run ASAP (i.e. 1 usec)
+ - allow sec/usec of 0 in sa_update_entry, except for SA_REPEAT case
+
+2006-06-05 10:26 rstory
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ - log error (and don't create entry) if sess user not found
+ - log error if agentSecName (default user) not specified
+ - add missing \n to debug msg
+
+2006-06-05 09:53 rstory
+
+ * include/net-snmp/types.h:
+
+ change len type to size_t
+
+2006-06-05 09:34 rstory
+
+ * agent/mibgroup/if-mib/: data_access/interface.c,
+ ifTable/ifTable_interface.c:
+
+ add container names
+
+2006-06-01 06:29 rstory
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ enforce MIB object lengths
+
+2006-05-29 02:40 tanders
+
+ * dist/nsb-functions:
+
+ further tweak the error regex
+
+2006-05-29 01:35 tanders
+
+ * testing/tests/T060trapdperl:
+
+ re-fix newline issues
+
+2006-05-28 13:13 tanders
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ temporary workaround to prevent snmptrapd embedded perl crash on x86_64 (bug 1494882)
+
+2006-05-27 23:58 hardaker
+
+ * testing/tests/: T059trapdtraphandle, T060trapdperl:
+
+ use CHECKORDIE instead of CHECKFILE when doing multiple checks (was succeeding when it shouldn't have). Also, open embedded perl LOG in append mode so second routine doesn't trump the first
+
+2006-05-27 22:30 hardaker
+
+ * apps/snmpnetstat/inet6.c:
+
+ include netinet/in.h and arpa/inet.h to pick up htonl, etc, on hpux10.20
+
+2006-05-27 22:16 hardaker
+
+ * Makefile.top:
+
+ way simple DESTDIR support
+
+2006-05-27 22:14 hardaker
+
+ * README:
+
+ added a few people from previous patches
+
+2006-05-27 07:41 tanders
+
+ * testing/tests/T115agentxperl:
+
+ set libtool-like LD_LIBRARY_PATH to make sure the perl agent starts properly (fixes bug 1495433)
+
+2006-05-26 15:24 hardaker
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ don't reverse address byte order for solaris (specifically x86) for local addresses
+
+2006-05-26 15:23 hardaker
+
+ * agent/mibgroup/mibII/mibII_common.h:
+
+ remove double entry comment
+
+2006-05-26 09:58 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ one intptr_t cast from a pointer
+
+2006-05-26 09:33 hardaker
+
+ * acconfig.h, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/types.h, configure:
+
+ check for uintptr_t and intptr_t
+
+2006-05-26 06:29 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ Another proper pointer cast
+
+2006-05-26 06:15 hardaker
+
+ * perl/: SNMP/SNMP.xs, TrapReceiver/TrapReceiver.xs,
+ agent/agent.xs:
+
+ Patch from darix to properly cast pointers to an IV instead of an int to fix 64bit issues
+
+2006-05-26 01:52 tanders
+
+ * testing/eval_tools.sh:
+
+ make daemons bind to localhost by default only (fixes bug 1424293)
+
+2006-05-25 15:13 tanders
+
+ * testing/TESTCONF.sh:
+
+ set SNMP_PERSISTENT_DIR for all apps/daemons
+
+2006-05-25 15:07 tanders
+
+ * testing/TESTCONF.sh:
+
+ set SNMPCONFPATH for all apps/daemons
+
+2006-05-25 09:14 tanders
+
+ * testing/tests/Sv3config:
+
+ don't open default smux port/socket
+
+2006-05-25 08:05 tanders
+
+ * testing/tests/: Sv3usmconfigagent, Svanyconfig:
+
+ don't open default smux port/socket
+
+2006-05-24 08:32 tanders
+
+ * testing/tests/T061agentperl:
+
+ more portable way of calling perl
+
+2006-05-24 08:26 tanders
+
+ * testing/tests/T115agentxperl:
+
+ double-fork the perl subagent to avoid shell output from job handling
+
+2006-05-24 06:42 tanders
+
+ * testing/TESTCONF.sh:
+
+ introduce additional variables for subagent tests: AGENTX_CONFIG_FILE, SNMP_AGENTX_PID_FILE, SNMP_AGENTX_LOG_FILE
+
+2006-05-24 06:39 tanders
+
+ * testing/tests/T115agentxperl:
+
+ new test: 'AgentX subagent in Perl (using NetSNMP::agent)'
+
+2006-05-22 15:48 tanders
+
+ * testing/tests/T151solarishostdisk:
+
+ this test requires host/hr_system in particular and uses v1, not v2c
+
+2006-05-22 15:42 tanders
+
+ * testing/tests/T150solarishostcpu:
+
+ this test requires host/hr_device in particular and uses v1, not v2c
+
+2006-05-22 15:36 tanders
+
+ * testing/tests/T153solarisswap:
+
+ this test uses v1, not v2c
+
+2006-05-22 15:18 tanders
+
+ * testing/tests/T152hostuptime:
+
+ this test requires host/hr_system in particular
+
+2006-05-22 03:08 tanders
+
+ * testing/tests/T153solarisswap:
+
+ this test requires host/hr_storage in particular
+
+2006-05-19 11:31 rstory
+
+ * agent/agent_trap.c:
+
+ - fix for bug 1313667 removed synch send, allowing us to uncomment the
+ commented out pdu free on error, plugging a memory leak identified
+ on coders by derekl at blueyonder co uk
+
+2006-05-19 10:02 rstory
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ - use nrprocs-1 as index instead of i, which will be negative if cpuinfo
+ doesn't contain a 'processor' line
+
+2006-05-17 15:11 rstory
+
+ * apps/snmptrapd_auth.c:
+
+ need sys/types.h before netinet/in.h on some platforms
+
+2006-05-13 00:21 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ update CVS host name
+
+2006-05-12 15:07 hardaker
+
+ * perl/: ASN/Makefile.PL, OID/Makefile.PL,
+ SNMP/Makefile.PL, SNMP/SNMP.pm, SNMP/SNMP.xs
+, TrapReceiver/Makefile.PL, agent/Makefile.PL,
+ agent/Support/Makefile.PL, agent/default_store/Makefile.PL
+, default_store/Makefile.PL:
+
+ change -W flag substition to be exact match of flags to remove, rather than removing any -W flag for portability reasons
+
+2006-05-12 09:10 tanders
+
+ * dist/nsb-functions:
+
+ misc. additions for more configuration control on build farms, including embedded perl building
+
+2006-05-12 08:16 tanders
+
+ * testing/tests/: T060trapdperl, T061agentperl:
+
+ fix newline issues
+
+2006-05-12 08:13 tanders
+
+ * testing/tests/: T053agentv1trap, T054agentv2ctrap,
+ T055agentv1mintrap, T056agentv2cmintrap,
+ T113agentxtrap:
+
+ ensure the tests work even if UCD-SNMP-MIB isn't in defaults MIBS list
+
+2006-05-12 08:10 tanders
+
+ * testing/tests/T050snmpv3trap:
+
+ introduce delays to not lose traps
+
+2006-05-12 07:54 tanders
+
+ * README.aix:
+
+ update README for AIX based on build test experience on AIX 4.3.3/5.1/5.2/5.3
+
+2006-05-08 03:07 tanders
+
+ * dist/nsb-functions:
+
+ introduce NSB_LIBWRAP to be able to specify --with[out]-libwrap=xxx
+
+2006-05-08 01:11 tanders
+
+ * dist/nsb-functions:
+
+ remove smux from NSB_DIST_MODULES (it's already in NSB_EXTRA_MODULES)
+
+2006-05-08 00:47 tanders
+
+ * agent/mibgroup/Rmon/row_api.h:
+
+ build fix for C89 compilers (e.g. xlc on AIX 4.3.3): no trailing comma after last entry of a "typedef enum"
+
+2006-05-05 16:03 tanders
+
+ * dist/nsb-functions:
+
+ further tweaking of the exception regex
+
+2006-05-05 15:28 tanders
+
+ * README.irix:
+
+ Initial README for IRIX
+
+2006-05-05 14:51 hardaker
+
+ * apps/snmptrapd_log.c:
+
+ put the snprintf length into a dereferenced pointer
+
+2006-05-04 14:44 hardaker
+
+ * agent/snmp_agent.c:
+
+ covertiy 135: double check netsnmp_oid_find_prefix returns a positive result (should only happen in broken-tree cases)
+
+2006-05-04 14:36 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ coverity #136: free mem leak in rare bad-agentx packet case
+
+2006-05-03 13:59 tanders
+
+ * agent/mibgroup/mibII/ipAddr.c, NEWS:
+
+ [ 1481012 ] HP-UX 11.0/11i: ipAdEntBcastAddr wrong (patch submitted by Johannes Schmidt-Fischer)
+
+2006-04-30 22:07 hardaker
+
+ * apps/snmpusm.c:
+
+ [ 1478616 ] snmpusm outputs to stderr on success
+
+2006-04-30 22:02 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ [ 1479071 ] 64 bits counter on Linux & good parsing of diskstats (again) [modified] from Fabrice Bacchella
+
+2006-04-25 10:33 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ [ 1466450 ] fix compilation with linux/ethtool. In other words: ugh nasty but needed patch
+
+2006-04-25 10:25 hardaker
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ modified version of [ 1466451 ] ipAddress size with 64bit to use sizeof() for the datatype in question
+
+2006-04-21 05:30 dts12
+
+ * apps/snmpnetstat/inet.c, snmplib/snmp_client.c:
+
+ Skip missing entries (rather than crashing out completely)
+
+2006-04-20 17:24 tanders
+
+ * snmplib/: container.c, snmpusm.c:
+
+ fix typos
+
+2006-04-20 17:13 tanders
+
+ * NEWS:
+
+ rephrased
+
+2006-04-20 16:55 tanders
+
+ * NEWS:
+
+ document changes since 5.3.0.1
+
+2006-04-20 16:19 tanders
+
+ * testing/tests/T061agentperl:
+
+ add SIGHUP test
+
+2006-04-20 16:03 tanders
+
+ * testing/tests/: T059trapdtraphandle, T060trapdperl:
+
+ add SIGHUP test
+
+2006-04-20 15:27 rstory
+
+ * apps/snmptrapd.c:
+
+ - fix bug 1473289: Re-init of 5.3.0.1 daemons fail after SIGHUP
+
+2006-04-20 15:24 tanders
+
+ * testing/tests/T035snmpv3trapdusermgmt:
+
+ add SIGHUP test
+
+2006-04-20 15:15 rstory
+
+ * agent/agent_read_config.c:
+
+ - fix bug 1473289: Re-init of 5.3.0.1 agent fails after SIGHUP
+
+2006-04-20 15:15 tanders
+
+ * testing/tests/T030snmpv3usercreation:
+
+ add SIGHUP test
+
+2006-04-20 15:09 tanders
+
+ * testing/eval_tools.sh:
+
+ introduce HUPPROG(), HUPAGENT() and HUPTRAPD() for upcoming SIGHUP tests
+
+2006-04-18 12:14 hardaker
+
+ * README.solaris:
+
+ Bug #1432165: typos in the filenames
+
+2006-04-18 11:01 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ fix bug 1458685: man page for setaccess was missing a token in the summary line
+
+2006-04-18 10:58 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ fix bug 1458818: authcommunity and friends use -V not -v to specify a view
+
+2006-04-18 10:36 hardaker
+
+ * local/mib2c.old-api.conf:
+
+ [ 1341098 ] Fix mib2c.old-api.conf oid suffixes, suffix lengths from nshulman
+
+2006-04-18 10:32 hardaker
+
+ * NEWS, README:
+
+ Support functions for easier embedded perl integration: [ 1369996 ] mib to perl support by Peter Martin
+
+2006-04-18 10:28 hardaker
+
+ * perl/agent/Support/.cvsignore,
+ perl/agent/Support/Makefile.PL,
+ perl/agent/Support/Support.pm, local/mib2c.perl.conf:
+
+ Support functions for easier embedded perl integration: [ 1369996 ] mib to perl support by Peter Martin
+
+2006-04-18 10:16 hardaker
+
+ * snmplib/read_config.c:
+
+ [ 1465485 ] netsnmp_config_remember_free_list mem leak from Robert Wilcox
+
+2006-04-18 06:58 hardaker
+
+ * mibs/: IP-FORWARD-MIB.txt, IP-MIB.txt, rfclist
+:
+
+ update from newly published RFCs
+
+2006-04-13 13:27 hardaker
+
+ * net-snmp-config.in:
+
+ [ 1364248 ] Add net-snmp-config --compile-subagent parameters: general rework of the main wrapper for auto-subagents from magfr
+
+2006-04-13 13:10 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ [ 1371778 ] diskIOTable contains invalid data for some devices on Linux
+
+2006-04-13 11:20 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ [ 1386264 ] 5.2.2 - fix Linux CPU counters on SMP machines
+
+2006-04-12 12:23 hardaker
+
+ * perl/OID/OID.xs:
+
+ fix parsing of addresses that I broke when implementing parsing of fixed-width strings
+
+2006-04-12 10:08 hardaker
+
+ * snmplib/vacm.c:
+
+ fix a bug reported in 1118814 where init length wasn't getting initialized properly
+
+2006-04-12 09:44 hardaker
+
+ * perl/OID/OID.xs:
+
+ fixes for fixed length string parsing
+
+2006-04-12 09:22 hardaker
+
+ * perl/OID/OID.xs:
+
+ remove debugging statements
+
+2006-04-12 09:19 hardaker
+
+ * perl/OID/OID.xs:
+
+ fixed length string parsing
+
+2006-04-11 04:09 tanders
+
+ * agent/mibgroup/utilities/iquery.c:
+
+ Build fix for "configure --with-out-transports=Callback" (fixes first part
+ of bug 1467724).
+ Why do tests 21-25 and 34-35 (all involving snmptrapd) fail in 5.3+ (unlike
+ 5.2.x) if the callback transport isn't available?
+
+2006-04-10 07:26 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ [ 1364648 ] Fix segfault on perl async bulkwalk from Ole Bjorn
+
+2006-04-10 07:19 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/host/hr_swrun.c:
+
+ [ 1415586 ] 5.3.0.1 host/hr_swrun.c patches for AIX 4,3/5.2 from Joe Buehler
+
+2006-04-09 21:59 hardaker
+
+ * agent/mibgroup/: if-mib/data_access/interface.h,
+ if-mib/data_access/interface_openbsd.c,
+ if-mib/ifTable/ifTable_data_access.h, mibII/ifTable.h
+:
+
+ [ 1427793 ] if(X)Table implementation for OpenBSD 3.x from NorthtroN
+
+2006-04-09 21:52 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ [ 1429455 ] endless loop, table_iterator, 5.3 from Kris (tinker105)
+
+2006-04-09 21:43 hardaker
+
+ * snmplib/fd_event_manager.c:
+
+ [ 1460082 ] [PATCH]: Fix external fd handling (anon)
+
+2006-03-27 16:52 tanders
+
+ * testing/tests/T200snmpv2cwalkall:
+
+ remove (useful) "-Cp -Ct" stderr output since it has been seen to interfere with the stdout messages to be checked
+
+2006-03-24 08:46 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Recognise failed/duplicate registrations, and don't plough on regardless
+
+2006-03-24 08:43 dts12
+
+ * apps/snmpnetstat/inet.c:
+
+ Don't choke on SNMPv2 exceptions
+ (Still need to handle SNMPv1 errors)
+ Fix a couple of minor output typos.
+
+2006-03-23 16:00 tanders
+
+ * man/mib2c.conf.5.in:
+
+ Fix section of mib2c.conf.5 (Debian patch #16 from 5.2.2-3)
+
+2006-03-23 11:17 hardaker
+
+ * agent/snmp_agent.c, agent/agent_read_config.c,
+ include/net-snmp/agent/ds_agent.h, man/snmpd.conf.5.def
+:
+
+ Patch from darix to optionally turn off connection logging for tcp_wrappers
+
+2006-03-16 01:57 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Root second output table correctly
+
+2006-03-16 01:54 dts12
+
+ * agent/mibgroup/disman/event/mteTrigger.c:
+
+ Correct logic of startup tests
+
+2006-03-15 08:28 dts12
+
+ * agent/mibgroup/hardware/memory/memory_solaris.c:
+
+ Fix SC_AINFO swapctl() call.
+
+2006-03-15 05:55 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Recognise built-in versus config-defined notifications,
+ and set owner accordingly.
+
+2006-03-10 07:42 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ don't use perfectly legal perl structures in C code
+
+2006-03-09 16:30 hardaker
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ fix typos
+
+2006-03-09 16:27 hardaker
+
+ * agent/mibgroup/disman/schedule/schedCore.c:
+
+ fix schedule typo
+
+2006-03-09 14:00 hardaker
+
+ * snmplib/snmp_api.c:
+
+ free malloc in error condition when decode function not specified
+
+2006-03-09 13:53 hardaker
+
+ * snmplib/: snmp_client.c, snmpv3.c:
+
+ ensure that if op == received message that we have a PDU too (always will be the case)
+
+2006-03-09 13:40 hardaker
+
+ * snmplib/snmp_api.c:
+
+ dont delve into future if statement when session fails to probe
+
+2006-03-09 13:36 hardaker
+
+ * snmplib/snmp_client.c:
+
+ free a pdu on the error case of no session...
+
+2006-03-09 13:33 hardaker
+
+ * snmplib/vacm.c:
+
+ reverse a patch that was trying to free an array
+
+2006-03-09 13:31 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ coverity 75: ensure free in rare case where other side of transport not found (shouldn't ever happen)
+
+2006-03-09 13:28 hardaker
+
+ * snmplib/snmpv3.c:
+
+ misc error checking (unneeded by other logic, but... why not)
+
+2006-03-09 13:13 hardaker
+
+ * snmplib/snmpusm.c:
+
+ coverity 34: check that usm wasn't actually illegally passed a null session (should have been stopped long before now)
+
+2006-03-09 13:03 hardaker
+
+ * snmplib/vacm.c:
+
+ coverity multiple: check a few pointers for null refs just in case
+
+2006-03-09 12:55 hardaker
+
+ * snmplib/: text_utils.c, vacm.c:
+
+ coverity 79: free memory in error condition spots
+
+2006-03-09 12:44 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ allow for questionably legal null community strings
+
+2006-03-09 12:37 hardaker
+
+ * agent/snmp_agent.c:
+
+ coverity 61: check return value from in tree to ensure it's not negative
+
+2006-03-09 12:24 hardaker
+
+ * agent/agent_trap.c:
+
+ coverity 80: free vblist in some failure cases
+
+2006-03-09 10:38 hardaker
+
+ * agent/mibgroup/hardware/memory/hw_mem.c:
+
+ coverity 83: free mem on should-never-get-here spot
+
+2006-03-09 10:30 hardaker
+
+ * agent/helpers/table_tdata.c:
+
+ free memory on other malloc failures
+
+2006-03-09 10:26 hardaker
+
+ * dist/patme:
+
+ more command line flags for faster patch application
+
+2006-03-09 10:24 hardaker
+
+ * agent/mibgroup/disman/schedule/schedCore.c:
+
+ check for null owner in 2 other spots
+
+2006-03-09 10:13 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ coverity 97/48: free lost memory on illegal table; check for null that shouldn't ever be
+
+2006-03-09 10:03 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ coverity 96: fix potential leak when malloc fails
+
+2006-03-09 10:00 hardaker
+
+ * agent/helpers/stash_cache.c:
+
+ free a handler if a subsequence malloc fails
+
+2006-03-09 09:57 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ coverity 98-100: free success mallocs when one fails
+
+2006-03-09 09:52 hardaker
+
+ * agent/mibgroup/agent/nsTransactionTable.c:
+
+ coverity 102/101: in case of malloc failures free what you have succeed in mallocing
+
+2006-03-09 09:44 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyFilterProfileTable.c:
+
+ double check that never-should-be-null conditions are true
+
+2006-03-09 09:39 hardaker
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ coverity 91: free various memory allocations when subsequent allocations fail
+
+2006-03-09 09:31 hardaker
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ coverity #41: not likely a real null deref for valid use cases; cases. double check for issues anyway
+
+2006-03-09 09:29 dts12
+
+ * agent/mibgroup/hardware/memory/memory_solaris.c:
+
+ Fuller implementation of memory HAL for Solaris (10 at least)
+
+2006-03-09 08:38 hardaker
+
+ * agent/mibgroup/agent/extend.c:
+
+ coverity 50: double check we could find the extension to remove
+
+2006-03-09 08:35 hardaker
+
+ * agent/mibgroup/agent/extend.c:
+
+ coverity 51: double check we could find the extension to remove
+
+2006-03-09 08:25 hardaker
+
+ * agent/mibgroup/agent/extend.c:
+
+ ensure illegal configuration of too long OIDs doesn't occur
+
+2006-03-09 08:19 hardaker
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ coverity 66: check that null isn't written beyond end
+
+2006-03-09 08:15 hardaker
+
+ * dist/net-snmp.spec, agent/mibgroup/ucd-snmp/dlmod.c:
+
+ coverity 67: ensure we don't write the null beyond the end of the buffer
+
+2006-03-09 08:07 hardaker
+
+ * dist/patme:
+
+ a script to help automatted patch management and apply patches to multiple braches of the net-snmp tree
+
+2006-03-09 08:05 hardaker
+
+ * agent/mibgroup/utilities/override.c:
+
+ coverity 92: free data structure in event somehow an unsupported data type is passed in (can't actually happen with current code)
+
+2006-03-09 08:03 hardaker
+
+ * agent/mibgroup/utilities/override.c:
+
+ coverity 93: free pointers where malloc succeeded if it suddenly stopped succeeding
+
+2006-03-09 07:33 hardaker
+
+ * apps/snmptrapd_handlers.c:
+
+ typo
+
+2006-03-09 07:31 hardaker
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ coverity #105: free storage in error loop
+
+2006-03-08 21:47 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ coverity 52: rare (never) dereference in illegal code cases.
+
+2006-03-08 21:40 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ coverity 106: rare memory leak on illegal agentx pdu's being passed to the client
+
+2006-03-08 21:32 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ coverity 112: close file handle for /proc/net/arp
+
+2006-03-08 21:24 hardaker
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ coverity bug #113: fclose an open file descriptor in error loop
+
+2006-03-08 16:13 hardaker
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ coverity bug #53: check that close_agentx_session wasn't passed a NULL session
+
+2006-03-08 16:04 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ coverity #107: fix rare pdu memory leak when function called illegaly
+
+2006-03-08 16:03 tanders
+
+ * agent/mibgroup/versiontag:
+
+ *at least* issue a WARNING if we'll create non-portable tar archives just because the release manager failed to install star.
+
+2006-03-08 15:58 hardaker
+
+ * agent/mibgroup/hardware/cpu/cpu.c:
+
+ coverity bug #108: still should free memory in the never-should-happen case
+
+2006-03-08 15:52 hardaker
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ coverity #109: close file pointer in error condtions to avoid potential rare leaks
+
+2006-03-08 15:10 rstory
+
+ * agent/helpers/instance.c:
+
+ coverity bug 85, r15: fix potential memory leak
+
+2006-03-08 14:48 rstory
+
+ * agent/helpers/table_array.c:
+
+ - coverity bug 40, run 15: fix potential null dereference
+ - misc other cleanup/error handling
+ - release memory that won't be used before returning errors
+ - check for potential null return from function
+ - assign values to correct variable
+
+2006-03-08 14:25 hardaker
+
+ * apps/snmptrapd_handlers.c:
+
+ coverity bug # 129: check session open results when forwarding and bail if failed to open
+
+2006-03-08 14:19 hardaker
+
+ * agent/mibgroup/header_complex.c:
+
+ coverity bug # check for null before dereferencing
+
+2006-03-08 14:11 hardaker
+
+ * agent/mibgroup/utilities/override.c:
+
+ coverity bug # 115: check for malloc failure before using the results
+
+2006-03-08 13:54 hardaker
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ coverity bug # 116: check (anyway) for null in variables that should never be null
+
+2006-03-08 13:44 hardaker
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ coverity bug #117: double check that pointer isn't null for safe programming (should never happen)
+
+2006-03-08 13:39 hardaker
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ coverity bug #118: double check that pointer isn't null for safe programming (should never happen)
+
+2006-03-08 13:29 hardaker
+
+ * agent/agent_registry.c:
+
+ coverity bug #120: avoid a possible deference to a freed variable
+
+2006-03-08 13:01 hardaker
+
+ * snmplib/snmpUnixDomain.c:
+
+ coverity bug #122: return NULL after failing to open transport.
+
+2006-03-08 12:45 hardaker
+
+ * agent/helpers/table.c:
+
+ coverity bug #123: avoid double free for long OID cases during getnext
+
+2006-03-08 10:51 rstory
+
+ * agent/mibgroup/versiontag:
+
+ check for star before using
+
+2006-03-08 10:48 rstory
+
+ * dist/cvsup:
+
+ use star if available
+
+2006-03-08 06:51 hardaker
+
+ * snmplib/mib.c:
+
+ fix a very rare oid parsing bug for strings in truncated OIDs
+
+2006-03-08 06:09 dts12
+
+ * agent/mibgroup/hardware/memory/memory_win.c:
+
+ Windows version of memory HAL interface
+
+2006-03-08 06:07 dts12
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Extra protection when compiling under Windows
+
+2006-03-07 22:55 hardaker
+
+ * agent/mibgroup/mibII/vacm_context.c:
+
+ coverity bug #104: rare case memory leak if you're out of memory in the first place
+
+2006-03-07 22:46 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ coverity bugs #119 initialize 2 pointers to 0
+
+2006-03-07 22:32 hardaker
+
+ * apps/snmpusm.c:
+
+ coverity bug #132: free various pointers in error loops
+
+2006-03-07 22:24 hardaker
+
+ * apps/snmpusm.c:
+
+ coverity bug #133: free key after malloc in exit loop after openssl failed
+
+2006-03-07 22:18 hardaker
+
+ * apps/snmptrapd_auth.c:
+
+ coverity bug #134: free newpdu during a vacm-not-configured bail-out
+
+2006-03-06 08:23 dts12
+
+ * agent/mibgroup/hardware/memory/hw_mem.c,
+ agent/mibgroup/hardware/memory/memory_aix.c,
+ agent/mibgroup/hardware/memory/memory_darwin.c,
+ agent/mibgroup/hardware/memory/memory_dynix.c,
+ agent/mibgroup/hardware/memory/memory_freebsd.c,
+ agent/mibgroup/hardware/memory/memory_hpux.c,
+ agent/mibgroup/hardware/memory/memory_linux.c,
+ agent/mibgroup/hardware/memory/memory_netbsd.c,
+ agent/mibgroup/hardware/memory/memory_solaris.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ include/net-snmp/agent/hardware/memory.h:
+
+ Update Memory HAL framework to support HostRes storage
+ information, and tweak hrStorageTable implementation to use it.
+ This has been tested on {Free,Net,Open}BSD, Linux and HP-UX.
+ It's probably still broken on AIX, Darwin, Dynix and Solaris
+ (and any system not explicitly mentioned?)
+
+2006-03-06 03:55 dts12
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Fix retrieval of filesystem information on NetBSD
+
+2006-03-06 03:32 dts12
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ Support UCD memory/cpu MIBs on OpenBSD 3.x
+
+2006-02-27 04:14 dts12
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ Tweak UCD memory configure processing to work with the most recent
+ OpenBSD and NetBSD releases, and to use the memory HAL
+
+2006-02-27 04:12 dts12
+
+ * agent/mibgroup/hardware/memory.h:
+
+ Tweak memory HAL configure processing to work with the most recent
+ OpenBSD and NetBSD releases
+
+2006-02-27 04:10 dts12
+
+ * agent/mibgroup/hardware/memory/: memory_freebsd.c,
+ memory_netbsd.c:
+
+ Fix problems with memory HAL code on *BSD systems
+
+2006-02-27 04:07 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory.c, memory.h:
+
+ Update UCD memory group to make proper use of memory HAL routines
+
+2006-02-27 04:04 dts12
+
+ * include/net-snmp/agent/hardware/memory.h:
+
+ Update definitions to match new memory HAL code
+
+2006-02-24 08:31 dts12
+
+ * agent/mibgroup/: ucd_snmp.h, ucd-snmp/memory.c,
+ ucd-snmp/memory.h:
+
+ Use memory HAL for the UCD memory group (all architectures).
+ This will probably break the agent on all bar Linux systems
+ and make everyone (including Thomas) unhappy.
+ So the cycle of life continues. Oh Fortuna....
+
+2006-02-24 08:27 dts12
+
+ * agent/mibgroup/hardware/: memory.h, memory/memory_aix.c
+, memory/memory_darwin.c, memory/memory_dynix.c,
+ memory/memory_freebsd.c, memory/memory_hpux.c,
+ memory/memory_linux.c, memory/memory_netbsd.c,
+ memory/memory_solaris.c:
+
+ Extend memory HAL to cover all (well, most) supported architectures.
+ Not yet tested on most of these systems, so there may easily be problems.
+ But at least this should serve to keep Thomas happy....
+
+2006-02-22 08:59 dts12
+
+ * agent/mibgroup/disman/expr/: expErrorTable.c,
+ expExpression.c, expExpression.h, expExpressionConf.c
+, expExpressionConf.h, expExpressionTable.c,
+ expObject.c, expValue.c, expValue.h,
+ expValueTable.c, exp_enum.h:
+
+ Improved expression parsing, and preliminary evaluation of expressions.
+
+2006-02-20 15:44 tanders
+
+ * README.solaris:
+
+ Remove historic references to tar problems (at even more places)
+
+2006-02-20 15:38 tanders
+
+ * README.solaris:
+
+ Remove historic paragraph on tar problems:-)
+
+2006-02-20 15:22 tanders
+
+ * agent/mibgroup/versiontag:
+
+ (further) clarify the original GNU tar problems
+
+2006-02-20 09:58 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ use star instead of tar for creating archives to get around gnu tar incompatibilities
+
+2006-02-17 07:14 rstory
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ -fix bug 1399421: 5.2+: tunnel mib fails to build w/ if-mib rewrite
+
+2006-02-16 15:19 tanders
+
+ * testing/tests/: T035snmpv3trapdusermgmt, T049snmpv3inform
+, T049snmpv3informauth, T049snmpv3informpriv,
+ T052snmpv2cinform, T057trapdauthtest,
+ T057trapdauthtest2, T057trapdauthtest3,
+ T059trapdtraphandle, T060trapdperl:
+
+ add "-t $SNMP_SLEEP" to snmpinform in order to avoid test failures on slow machines even with an increased SNMP_SLEEP (fixes bug 1403688)
+
+2006-02-15 16:27 tanders
+
+ * testing/tests/: T054agentv2ctrap, T055agentv1mintrap,
+ T056agentv2cmintrap:
+
+ don't let snmptrapd open system agentx socket during testing (see bug 1424293)
+
+2006-02-15 16:02 tanders
+
+ * testing/tests/: T049snmpv3inform, T049snmpv3informauth
+, T049snmpv3informpriv, T050snmpv3trap,
+ T051snmpv2ctrap, T052snmpv2cinform, T053agentv1trap
+, T054agentv2ctrap, T056agentv2cmintrap,
+ T057trapdauthtest, T057trapdauthtest2,
+ T057trapdauthtest3, T058agentauthtrap,
+ T059trapdtraphandle, T060trapdperl:
+
+ don't let snmptrapd open system agentx socket during testing (see bug 1424293)
+
+2006-02-15 10:30 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ gettable: fix repeat count for SNMPv1 & fix -columns to actually work
+
+2006-02-14 06:40 dts12
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.c,
+ ifTable_constants.h:
+
+ Register ifNumber as a scalar object, not an instance, so that
+ it handles invalid instances properly, and fix OID registration.
+
+2006-02-13 17:42 alex_b
+
+ * README.win32:
+
+ Update PSDK download instructions.
+
+2006-02-13 15:53 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.c,
+ ifTable_constants.h:
+
+ fix bug 1399369: ifNumber broken
+
+2006-02-13 10:49 tanders
+
+ * NEWS:
+
+ add 5.3.0.1 security fix and smux trap patch
+
+2006-02-13 10:32 tanders
+
+ * agent/mibgroup/smux/smux.c:
+
+ fix trap processing from SMUX peers (patch 1430824 from Dell, submitted by SuSE)
+
+2006-02-13 07:41 tanders
+
+ * testing/TESTCONF.sh:
+
+ increase number of retries for port probing to lower the chance for spurious test failures
+
+2006-02-11 15:34 tanders
+
+ * testing/tests/T059trapdtraphandle:
+
+ set persistentDir for snmptrapd in order to avoid being invasive (see bugs 1403688, 1424293)
+
+2006-02-10 15:47 rstory
+
+ * agent/: snmp_agent.c, helpers/bulk_to_next.c,
+ helpers/instance.c:
+
+ - a tangled web of fixes for override
+ - back out fix for 711465: override directive ignored with snmpbulkget
+ - apply new fixes for 711465 (see bug report for gory details)
+ - also fix override of table instance, reported on coders
+ - and, quoting Dave:
+
+ I'm not at all sure that this is necessarily the correct fix, but
+ it wasn't very clear as to exactly what is being handled here.
+ This change certainly addresses the above bug report, without
+ seeming to break anything else.
+
+ Let's give this patch time to settle into the main development code,
+ and then consider back-porting it to earlier lines.....
+
+2006-02-06 15:36 tanders
+
+ * configure, configure.in:
+
+ add checks for "struct nlist64", off64_t and lseek64 (for IRIX and friends)
+
+2006-02-04 14:32 tanders
+
+ * dist/nsb-functions:
+
+ don't fail "make" on SNMP_ERR_NOERROR
+
+2006-02-03 17:32 tanders
+
+ * snmplib/snmpv3.c:
+
+ backing out previous patch (which breaks test #24 "SNMPv3 traps received and sent by tools") until someone finds the time to review it again
+
+2006-02-03 16:36 tanders
+
+ * testing/tests/Sv3usmconfigtrapd:
+
+ fix typo
+
+2006-02-02 19:31 alex_b
+
+ * apps/snmptrapd.c:
+
+ Fix for bug 1420758. Missing call (typo?) for FD_ZERO(&exceptfds).
+
+2006-02-02 14:08 rstory
+
+ * snmplib/mib.c:
+
+ - use tree_head if tree_top was NULL. handles both OID and name lookups
+
+2006-02-01 18:58 bshaw666
+
+ * agent/mibgroup/ucd-snmp/: lmSensors.c, lmSensors.h:
+
+ incorporate major patches by Mike Fisher and Tom E. Lackley
+
+2006-02-01 09:39 rstory
+
+ * snmplib/mib.c:
+
+ - revert changes from version 5.88, which broke parsing fully qualified
+ named OIDs (eg .iso.org). Another fix for parsing numeric OIDs before
+ MIB files are loaded needs to be investigated.
+
+2006-01-31 10:31 tanders
+
+ * man/: mib2c.extract.pl, snmpnetstat.1.def:
+
+ fix manual page formatting errors (Debian patch #17, original author Nicolas Francois)
+
+2006-01-31 09:27 alex_b
+
+ * win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Fix Begin source / end source lines. Bug 1404402.
+
+2006-01-31 04:51 dts12
+
+ * apps/: snmpdelta.c, snmptable.c,
+ snmptrapd_handlers.c, snmptrapd_log.c, snmpusm.c
+:
+
+ Fix assorted signedness mismatches.
+
+2006-01-31 04:10 dts12
+
+ * snmplib/: read_config.c, snmpCallbackDomain.c,
+ snmpUDPDomain.c, snmp_api.c, snmp_debug.c,
+ tools.c:
+
+ Fix assorted signedness mismatches.
+
+2006-01-30 04:07 dts12
+
+ * snmplib/: scapi.c, snmpv3.c:
+
+ Fix assorted unsigned comparisons against 0. (See Bug #1397891)
+
+2006-01-30 03:23 dts12
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ Correct improper use of 'netsnmp_hex_to_binary'
+ (My mistake, not Radek's)
+
+2006-01-30 03:18 dts12
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ Handle full-length IPv6 addresses. Fix supplied by Radek Vokॆअआॆअl
+
+2006-01-30 01:52 dts12
+
+ * agent/snmpd.c:
+
+ Don't save persistent configuration until running user/group have been
+ reset. Based on patch #1371078.
+
+2006-01-30 01:45 dts12
+
+ * agent/snmp_agent.c:
+
+ Update handling of endOfMibView exceptions. Patch #1047706
+
+2006-01-30 01:35 dts12
+
+ * snmplib/read_config.c:
+
+ Support for reading/storing IP address values. Expanded from patch #107700
+
+2006-01-30 01:27 dts12
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ Don't release the response PDU prematurely, before trying to
+ extract OIDs from it. Patch #1277508.
+
+2006-01-30 01:26 tanders
+
+ * README.solaris:
+
+ fix PATH typo
+
+2006-01-27 11:42 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.h,
+ ifTable_interface.c:
+
+ do undo ref count via rowreq_ctx, not data_list
+
+2006-01-27 09:26 dts12
+
+ * include/net-snmp/library/snmp_api.h, perl/SNMP/SNMP.xs
+, snmplib/snmp_api.c, perl/SNMP/SNMP.pm:
+
+ Handle non-increasing OIDs during a (perl) bulkwalk.
+ Patch #1364650 from Ole Bjॆअआॆअšrn Hessen
+
+2006-01-27 03:07 dts12
+
+ * apps/snmpnetstat/if.c:
+
+ Handle missing values more gracefully.
+
+2006-01-26 09:02 dts12
+
+ * local/mib2c-conf.d/: generic-table-indexes-set.m2i,
+ mfd-access-container-cached-defines.m2i,
+ mfd-data-access.m2c, mfd-interface.m2c, mfd-top.m2c
+:
+
+ Apply Patch #1394068 to MfD generated templates.
+
+2006-01-25 08:25 dts12
+
+ * doxygen.conf, agent/agent_handler.c,
+ agent/agent_registry.c, agent/agent_trap.c,
+ agent/object_monitor.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/helpers/baby_steps.c,
+ agent/helpers/bulk_to_next.c, agent/helpers/cache_handler.c
+, agent/helpers/debug_handler.c,
+ agent/helpers/instance.c, agent/helpers/mode_end_call.c
+, agent/helpers/multiplexer.c,
+ agent/helpers/read_only.c, agent/helpers/row_merge.c
+, agent/helpers/scalar.c,
+ agent/helpers/scalar_group.c, agent/helpers/serialize.c
+, agent/helpers/stash_cache.c,
+ agent/helpers/stash_to_next.c, agent/helpers/table_array.c
+, agent/helpers/table_container.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, agent/helpers/table_tdata.c,
+ agent/helpers/watcher.c,
+ agent/mibgroup/examples/netSnmpHostsTable_checkfns.c,
+ agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c,
+ agent/mibgroup/examples/notification.c,
+ agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.c,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c
+,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c
+,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c
+,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
+,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
+, agent/mibgroup/ip-mib/data_access/ipaddress_common.c
+,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c
+,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
+,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
+,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
+,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
+,
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
+, agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
+, agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
+,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
+,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c
+,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
+,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c
+,
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h
+,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c
+,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h
+,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c
+,
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h
+, agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c
+,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c
+,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h
+,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c
+,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c
+,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
+, agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c
+, agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c
+,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
+, agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c
+, agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c
+, agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
+,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
+, include/net-snmp/agent/object_monitor.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/library/tools.h, snmplib/callback.c
+, snmplib/container_null.c, snmplib/data_list.c
+, snmplib/default_store.c, snmplib/int64.c,
+ snmplib/mib.c, snmplib/oid_stash.c,
+ snmplib/read_config.c, snmplib/snmp_api.c,
+ snmplib/snmp_logging.c, snmplib/text_utils.c,
+ snmplib/tools.c:
+
+ Comprehensive review of in-line documentation.
+ A most impressive effort by Nazim Baizid (Patch #1394068)
+
+2006-01-25 07:37 dts12
+
+ * agent/agent_registry.c:
+
+ Don't be in such a rush to release MIB registration structure.
+ See Patch #1386528
+
+2006-01-25 07:30 dts12
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ Additional debugging info
+
+2006-01-24 08:21 dts12
+
+ * snmplib/snmp_api.c:
+
+ Release memory before re-allocating it. See Patch #1407173
+
+2006-01-24 08:02 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ Improved/fixed perl warnings. See Patch #1334598
+
+2006-01-24 06:40 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ Check "TimeStamp" reference before use (in line with
+ the other occurances in this file). See Bug #1375282
+
+2006-01-24 06:31 dts12
+
+ * agent/mibgroup/disman/event/mteTrigger.c:
+
+ Check for missing monitored values (see Bug #1404605)
+
+2006-01-24 05:47 dts12
+
+ * testing/tests/Sv3config:
+
+ Don't override an explicit DEFPRIVTYPE setting,
+ even if the library doesn't support encryption.
+
+2006-01-24 01:51 tanders
+
+ * configure, configure.in:
+
+ replace "==" by "=" when using "test" (reported by Magnus Fromreide)
+
+2006-01-23 07:05 dts12
+
+ * apps/: snmptrapd_handlers.c, snmptrapd_handlers.h:
+
+ New handler to forward traps via the AgentX master agent.
+
+2006-01-20 15:16 tanders
+
+ * NEWS, apps/snmpusm.c, man/snmpusm.1.def:
+
+ introduce new snmpusm option -Cp to set usmUserPublic value
+
+2006-01-20 09:01 dts12
+
+ * testing/: TESTCONF.sh, tests/T035snmpv3trapdusermgmt
+, tests/T110agentxget, tests/T111agentxset,
+ tests/T112agentxsetfail, tests/T113agentxtrap,
+ tests/T120proxyget, tests/T121proxyset,
+ tests/T122proxysetfail:
+
+ Modular approach for probing to detect free ports. See Bug #1335767
+
+2006-01-18 16:06 tanders
+
+ * NEWS, apps/snmpusm.c:
+
+ Avoid expensive generate_Ku() if newpass is a localized key (instead of a passphrase). Makes a huge performance improvement then.
+
+2006-01-18 11:34 rstory
+
+ * dist/Makefile:
+
+ use base arch (eg i386, not i686); use RPM_BASE for topdir
+
+2006-01-18 08:27 dts12
+
+ * dist/net-snmp.spec:
+
+ Register RPMs as being built by the Net-SNMP project.
+
+2006-01-18 08:21 rstory
+
+ * dist/net-snmp.spec:
+
+ add beecrypt-devel, elfutils-libelf-devel to BuildRequires
+
+2006-01-18 07:35 rstory
+
+ * dist/Makefile:
+
+ restore file (looks like VersionMunge nuked it?); bump version to 5.4.dev
+
+2006-01-18 07:18 tanders
+
+ * apps/encode_keychange.c:
+
+ fix typo
+
+2006-01-17 07:55 dts12
+
+ * include/net-snmp/library/mib.h, snmplib/mib.c:
+
+ Remove references to obsolete (and missing) routine. See Bug #1011051
+
+2006-01-17 06:26 dts12
+
+ * snmplib/parse.c:
+
+ Recognise range parsing errors properly.
+
+2006-01-15 11:55 rstory
+
+ * agent/mibgroup/ip-mib/:
+ ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+ ipv6InterfaceTable/ipv6InterfaceTable_interface.c:
+
+ - better cooperation for interface tables using shared container
+ - use one dirty variable
+ - use new ref counting undo alloc/free function from ifTable
+
+2006-01-15 06:16 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ remove undo ifentry handling (done elsewhere)
+
+2006-01-15 06:11 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_interface.c:
+
+ - move undo ifentry handling here
+ - add reference counting for undo
+
+2006-01-15 06:07 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ move undo ifentry handling into interface
+
+2006-01-13 17:05 hardaker
+
+ * testing/tests/T030snmpv3usercreation:
+
+ allow write support for new user to test pasword changes
+
+2006-01-13 15:23 rstory
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ fix bitwise test to use bitwise macros
+
+2006-01-13 08:40 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ don't double allocate undo ifentry
+
+2006-01-13 08:31 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ - move all refs to undo promisc mode inside promisc set enable ifdefs
+ - if promisc mode set enabled, make sure to allocate undo ifentry
+
+2006-01-13 07:52 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ - correct proc path for base reachable time
+ - use correct flag for base reachable availability
+ - actually put base reachable time in ifentry after reading it
+
+2006-01-11 15:26 tanders
+
+ * agent/mibgroup/mibII/at.c, include/net-snmp/system/irix.h
+:
+
+ IRIX atTable fix: use sysctl() instead of nlist() to support
+ IRIX *and* IRIX64 kernels at once and not require /dev/kmem access
+ (proposed by Herve Boulouis)
+
+2006-01-11 14:09 tanders
+
+ * man/snmptrapd.8.def:
+
+ s/the agent/snmptrapd/
+
+2006-01-11 14:05 tanders
+
+ * configure:
+
+ run autoconf
+
+2006-01-11 13:37 tanders
+
+ * FAQ:
+
+ fix accidental mangling
+
+2006-01-11 12:40 tanders
+
+ * snmplib/parse.c:
+
+ - build fix: #include <limits.h> to cover recently introduced LONG_MAX
+ - wrap "#if HAVE_SYS_STAT_H" around "#include <sys/stat.h>"
+ - remove old changelog from the top of the file
+
+2006-01-11 08:38 dts12
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ SET support for manipulating the routing table isn't really implemented
+ properly (except on Cygwin), so we shouldn't pretend it is.
+
+2006-01-11 08:32 dts12
+
+ * snmplib/snmpUDPDomain.c:
+
+ Reduce reliance on (non-thread-safe) gethostbyname. See Bug #839675
+
+2006-01-11 08:00 dts12
+
+ * snmplib/parse.c:
+
+ Downgrade upper-bound parsing problems to a warning - keep TrogL happy:-)
+ Don't think the check is quite right yet though:-(
+
+2006-01-11 07:17 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Bring code template into line with final helper API.
+
+2006-01-11 07:09 dts12
+
+ * net-snmp-config.in:
+
+ Correct a misleading comment.
+
+2006-01-11 07:02 dts12
+
+ * snmplib/parse.c:
+
+ Associate MIB node types with the *last* entry parsed from the
+ definition value, not the first. Fixes problem with MIB definitions
+ that use intermediate subidentifiers (see bug #759412)
+
+2006-01-11 06:54 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Clarify the behaviour of netsnmp_table_dataset_remove_row()
+
+2006-01-10 13:45 tanders
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ fix format string bug (reported by darix on IRC)
+
+2006-01-10 08:35 dts12
+
+ * agent/snmp_agent.c:
+
+ Don't retry "out of range" responses unless there's actually a value
+ to be out of range. This proved to be the underlying cause of GetBulk
+ requests failing to handle instance-based registrations, such as
+ "override" directives (See Bug #711465)
+
+ I'm not at all sure that this is necessarily the correct fix, but
+ it wasn't very clear as to exactly what is being handled here.
+ This change certainly addresses the above bug report, without
+ seeming to break anything else.
+
+ Let's give this patch time to settle into the main development code,
+ and then consider back-porting it to earlier lines.....
+
+2006-01-10 03:07 tanders
+
+ *
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c
+:
+
+ C89 compiler build fix (bug 1398545) part 2: "A declaration cannot appear after an executable statement in a block."
+
+2006-01-09 17:41 tanders
+
+ *
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c
+:
+
+ C89 compiler build fix (bug 1398545)
+
+2006-01-09 17:11 tanders
+
+ * agent/mibgroup/mibII/mibII_common.h:
+
+ IRIX 6.5 build fix: don't include sys/socketvar.h because it's not needed and _KMEMUSER breaks the build
+
+2006-01-09 17:05 tanders
+
+ * configure.in:
+
+ fix IRIX 6.5 "present but cannot be compiled" warning for sys/vnode.h and sys/hashing.h
+
+2006-01-09 13:53 rstory
+
+ * include/ucd-snmp/.cvsignore:
+
+ don't ignore ucd-snmp-config.h, since it's no longer a generated file
+
+2006-01-09 13:38 tanders
+
+ * configure, configure.in:
+
+ revert to --disable-ucd-snmp-compatibility being the default again
+
+2006-01-09 11:04 rstory
+
+ * dist/nsb-nightly:
+
+ include all err logs in results
+
+2006-01-09 09:29 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ restore lost ifLastChange tracking
+
+2006-01-09 07:06 dts12
+
+ * man/netsnmp_Container_iterator.3, man/netsnmp_agent.3
+, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3
+, man/netsnmp_baby_steps.3,
+ man/netsnmp_bulk_to_next.3, man/netsnmp_cache_handler.3
+, man/netsnmp_callback.3, man/netsnmp_container.3
+, man/netsnmp_data_list.3, man/netsnmp_debug.3
+, man/netsnmp_default_store.3, man/netsnmp_handler.3
+, man/netsnmp_instance.3,
+ man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3,
+ man/netsnmp_library.3, snmplib/container_null.c,
+ agent/helpers/all_helpers.c, agent/helpers/baby_steps.c
+, agent/helpers/bulk_to_next.c,
+ agent/helpers/cache_handler.c,
+ agent/helpers/debug_handler.c, agent/helpers/instance.c
+, agent/helpers/mode_end_call.c,
+ agent/helpers/multiplexer.c, agent/helpers/old_api.c
+, agent/helpers/read_only.c,
+ agent/helpers/row_merge.c, agent/helpers/scalar.c,
+ agent/helpers/scalar_group.c, agent/helpers/serialize.c
+, agent/helpers/stash_cache.c,
+ agent/helpers/stash_to_next.c, agent/helpers/table.c
+, agent/helpers/table_array.c,
+ agent/helpers/table_container.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, agent/helpers/table_generic.c,
+ agent/helpers/table_iterator.c,
+ agent/helpers/table_tdata.c, agent/helpers/watcher.c
+, man/netsnmp_mib_maintenance.3,
+ man/netsnmp_mib_utilities.3, man/netsnmp_mode_end_call.3
+, man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3
+, man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3
+, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3
+, man/netsnmp_stash_to_next.3, man/netsnmp_table.3
+, man/netsnmp_table_array.3,
+ man/netsnmp_table_container.3, man/netsnmp_table_data.3
+, man/netsnmp_table_dataset.3,
+ man/netsnmp_table_generic.3, man/netsnmp_table_indexes.3
+, man/netsnmp_table_iterator.3,
+ man/netsnmp_table_maintenance.3, man/netsnmp_table_rows.3
+, man/netsnmp_tdata.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_variable_list.3
+, man/netsnmp_watcher.3:
+
+ Adjust doxygen "defgroup" comments to improve auto-generated man page format.
+ See bug #835321
+
+2006-01-09 05:01 dts12
+
+ * snmplib/parse.c:
+
+ Report failure to parse ranges correctly (Bug #411594/757121)
+
+2006-01-06 15:15 tanders
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ fix udpTable on Solaris/x86: host byte order for udpLocalPort (bug 1393197)
+
+2006-01-06 13:26 rstory
+
+ * agent/mibgroup/ip-forward-mib/inetCidrRouteTable/:
+ inetCidrRouteTable.c, inetCidrRouteTable_constants.h
+:
+
+ - add instance handler for inetCidrRouteNumber
+
+2006-01-06 09:43 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ - subtract multicast packets from total packets for unicast packets
+ (there is no broadcast packet counter to subtract)
+
+2006-01-05 16:21 tanders
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ fix multiple <netinet/tcp_var.h> inclusion (bug 1396639, IRIX build fix)
+
+2006-01-05 15:58 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ - don't save/restore promiscuous mode
+
+2006-01-05 15:56 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ - update to report proper value from promiscuous mode
+
+2006-01-05 15:48 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h:
+
+ - clear promiscuous mode from settable flags
+
+2006-01-05 15:41 rstory
+
+ * dist/net-snmp.spec:
+
+ bump library version number in provides
+
+2006-01-05 15:37 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.4.dev )
+
+2006-01-05 15:37 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.4.dev )
+
+2006-01-05 15:37 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.4.dev )
+
+2006-01-05 15:37 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.4.dev )
+
+2006-01-05 15:37 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.4.dev )
+
+2006-01-05 15:37 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.4.dev )
+
+2006-01-05 15:36 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.4.dev )
+
+2006-01-05 15:36 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.4.dev )
+
+2006-01-05 15:36 rstory
+
+ * dist/Makefile:
+
+ - (dist/Makefile): version tag ( 5.4.dev )
+
+2006-01-05 15:36 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.4.dev )
+
+2006-01-05 15:36 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.4.dev )
+
+2006-01-05 15:36 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.4.dev )
+
+2006-01-05 15:35 rstory
+
+ * README:
+
+ - (README): version tag ( 5.4.dev )
+
+2006-01-05 15:35 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.4.dev )
+
+2006-01-05 15:28 rstory
+
+ * Makefile.top:
+
+ bump LIBCURRENT version
+
+2006-01-05 15:26 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.h:
+
+ - delete unused dummy var (struct size change ok in unreleased branches)
+
+2006-01-05 15:24 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.h:
+
+ - point promiscuous mode refs to interface entry value
+ - rename old var (don't delete, so struct size doesn't change)
+
+2006-01-05 15:15 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ set promiscuous flag for interfaces
+
+2006-01-05 15:06 rstory
+
+ * local/mib2c-conf.d/mfd-persistence.m2i:
+
+ add missing \n to log msgs
+
+2006-01-05 08:30 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Display correct MIB group names in comments. (Bug #1076655)
+
+2006-01-04 15:06 tanders
+
+ * agent/mibgroup/disman/event/: mteEventConf.c,
+ mteObjectsConf.c, mteTrigger.c, mteTriggerConf.c
+:
+
+ get rid of C++ comments
+
+2006-01-02 16:04 tanders
+
+ * configure.in, configure:
+
+ fix minor typos
+
+2006-01-02 15:40 tanders
+
+ * configure.in, configure:
+
+ --disable-ucd-snmp-compatibility and --enable-ucd-snmp-compatibility=no now actually *disable* UCD-SNMP compatibility instead of enabling it
+
+2005-12-30 20:36 rstory
+
+ * agent/helpers/table_dataset.c:
+
+ - set up len for parse index hack for fixed length str/oid indexes
+
+2005-12-30 20:35 rstory
+
+ * snmplib/mib.c:
+
+ - parse index hack for multiple fixed length str/oid indexes
+
+2005-12-30 18:05 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ add step for creating patches branch for new releases
+
+2005-12-30 11:42 alex_b
+
+ * Makefile.in:
+
+ Remove docsmunge as it is no longer needed by the web site.
+
+2005-12-29 21:38 alex_b
+
+ * local/html-textfile-fix.pl:
+
+ Adds some HTML entities to the text files to prevent missing characters
+ when including in HTML.
+
+2005-12-28 11:10 rstory
+
+ * ChangeLog:
+
+ version update
+
+-------------------------------------------------------------------------------
+
+Changes: V5.2 -> V5.3
+
+2005-12-28 12:49 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.3 )
+
+2005-12-28 12:49 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.3 )
+
+2005-12-28 12:49 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.3 )
+
+2005-12-28 12:49 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.3 )
+
+2005-12-28 12:48 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.3 )
+
+2005-12-28 12:48 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.3 )
+
+2005-12-28 12:48 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.3 )
+
+2005-12-28 12:48 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.3 )
+
+2005-12-28 12:48 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.3 )
+
+2005-12-28 12:48 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.3 )
+
+2005-12-28 12:47 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.3 )
+
+2005-12-28 12:47 rstory
+
+ * README:
+
+ - (README): version tag ( 5.3 )
+
+2005-12-28 12:47 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.3 )
+
+2005-12-28 12:41 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3
+, netsnmp_agent_registry.3, netsnmp_agent_trap.3
+, netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3
+, netsnmp_bulk_to_next.3, netsnmp_cache_handler.3
+, netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_container.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_util.3,
+ netsnmp_utilities.3, netsnmp_variable_list.3,
+ netsnmp_watcher.3:
+
+ documentation update
+
+2005-12-28 12:20 rstory
+
+ * configure, configure.in:
+
+ version update
+
+2005-12-27 17:06 tanders
+
+ * README.agent-mibs:
+
+ Last-minute update for 5.3:
+ - ucd-snmp/lmSensors implements LM-SENSORS-MIB, not UCD-SNMP-MIB!
+ - disman/schedule now ships with 5.3
+
+2005-12-27 16:45 tanders
+
+ * FAQ:
+
+ Last-minute updates for 5.3:
+ - remove two mirror servers that don't exist anymore
+ - tweak list of supported platforms to list the better supported ones first
+ - fix snmptrapd examples to not use deprecated options
+ - mention the 5.3 snmptrapd authorization change
+ - mention that disman/event and host are enabled by default in 5.3
+ - mention disman/schedule MIB
+
+2005-12-21 06:08 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Minor tweaks.
+
+2005-12-21 04:31 dts12
+
+ * NEWS:
+
+ Correct the description of 'snmpnetstat' changes.
+ The status of the 5.3 line is *not* the same as the 5.2 version.
+
+2005-12-21 00:07 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.3.rc2 )
+
+2005-12-21 00:06 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.3.rc2 )
+
+2005-12-21 00:06 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.3.rc2 )
+
+2005-12-21 00:06 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.3.rc2 )
+
+2005-12-21 00:06 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.3.rc2 )
+
+2005-12-21 00:06 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.3.rc2 )
+
+2005-12-21 00:06 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.3.rc2 )
+
+2005-12-21 00:05 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.3.rc2 )
+
+2005-12-21 00:05 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.3.rc2 )
+
+2005-12-21 00:05 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.3.rc2 )
+
+2005-12-21 00:05 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.3.rc2 )
+
+2005-12-21 00:04 rstory
+
+ * README:
+
+ - (README): version tag ( 5.3.rc2 )
+
+2005-12-21 00:04 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.3.rc2 )
+
+2005-12-21 00:04 rstory
+
+ * ChangeLog:
+
+ version update
+
+2005-12-20 23:58 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3
+, netsnmp_agent_registry.3, netsnmp_agent_trap.3
+, netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3
+, netsnmp_bulk_to_next.3, netsnmp_cache_handler.3
+, netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_container.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_util.3,
+ netsnmp_utilities.3, netsnmp_variable_list.3,
+ netsnmp_watcher.3:
+
+ documentation update
+
+2005-12-20 23:40 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend,
+ apps/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2005-12-20 23:15 rstory
+
+ * configure, configure.in:
+
+ version update
+
+2005-12-20 10:33 tanders
+
+ * local/mib2c.int_watch.conf:
+
+ fix bug 1386088: use LOG_ERR instead of LOG_ERROR
+
+2005-12-19 20:46 tanders
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ traps -> notifications
+
+2005-12-19 20:37 tanders
+
+ * man/snmptrapd.8.def:
+
+ fix typo
+
+2005-12-19 20:33 tanders
+
+ * man/snmpd.conf.5.def:
+
+ snmp_perl.pl *is* installed automatically (at least for me).
+
+2005-12-19 20:16 tanders
+
+ * man/snmp.conf.5.def:
+
+ get rid of "default default"
+
+2005-12-19 18:59 tanders
+
+ * apps/snmptrapd.c:
+
+ better help output for deprecated "-P"
+
+2005-12-19 05:35 dts12
+
+ * man/: snmp.conf.5.def, snmpcmd.1.def, snmpd.8.def
+, snmpd.conf.5.def, snmptrapd.8.def,
+ snmptrapd.conf.5.def:
+
+ General revision of command and configuration file documentation.
+
+2005-12-18 16:36 tanders
+
+ * man/snmptrapd.conf.5.def:
+
+ execute also covers embedded perl
+
+2005-12-18 16:30 tanders
+
+ * man/snmptrapd.conf.5.def:
+
+ doNotRetainTrapLogs -> doNotRetainNotificationLogs
+
+2005-12-14 11:40 dts12
+
+ * man/snmptrapd.conf.5.def:
+
+ Reworking of the trapd configuration documentation.
+
+2005-12-14 05:39 dts12
+
+ * apps/snmptrapd_auth.c:
+
+ Withdraw alternative "acceptAllTraps" directive.
+ (Keep it safe for another day).
+
+2005-12-13 07:50 tanders
+
+ * README.snmpv3:
+
+ our binary releases *do* support encryption
+
+2005-12-13 07:29 tanders
+
+ * README.snmpv3:
+
+ add AES
+
+2005-12-11 15:15 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.3.rc1 )
+
+2005-12-11 15:15 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.3.rc1 )
+
+2005-12-11 15:15 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.3.rc1 )
+
+2005-12-11 15:14 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.3.rc1 )
+
+2005-12-11 15:14 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.3.rc1 )
+
+2005-12-11 15:14 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.3.rc1 )
+
+2005-12-11 15:14 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.3.rc1 )
+
+2005-12-11 15:14 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.3.rc1 )
+
+2005-12-11 15:13 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.3.rc1 )
+
+2005-12-11 15:13 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.3.rc1 )
+
+2005-12-11 15:13 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.3.rc1 )
+
+2005-12-11 15:12 rstory
+
+ * README:
+
+ - (README): version tag ( 5.3.rc1 )
+
+2005-12-11 15:12 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.3.rc1 )
+
+2005-12-11 15:12 rstory
+
+ * ChangeLog:
+
+ version update
+
+2005-12-11 15:10 rstory
+
+ * agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, agent/Makefile.depend
+, apps/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2005-12-11 15:00 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3
+, netsnmp_agent_registry.3, netsnmp_agent_trap.3
+, netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3
+, netsnmp_bulk_to_next.3, netsnmp_cache_handler.3
+, netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_container.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_util.3,
+ netsnmp_utilities.3, netsnmp_variable_list.3,
+ netsnmp_watcher.3:
+
+ documentation update
+
+2005-12-11 14:13 nba
+
+ * agent/snmp_vars.c, agent/mibgroup/disman/event/mteEvent.c
+, agent/mibgroup/disman/event/mteEvent.h,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/disman/schedule/schedCore.h,
+ agent/mibgroup/ip-mib/ip_scalars.h, apps/snmptrapd_auth.c
+, snmplib/container_binary_array.c:
+
+ Add const and #include to fix warnings
+
+2005-12-11 13:54 rstory
+
+ * configure.in, configure:
+
+ version update
+
+2005-12-11 13:41 rstory
+
+ * agent/mibgroup/versiontag:
+
+ don't use CVSUSER if already in a cvs dir
+
+2005-12-11 13:25 rstory
+
+ * agent/mibgroup/testhandler.c:
+
+ advance next pointer before continue
+
+2005-12-11 12:55 rstory
+
+ * agent/mibgroup/: ip-mib/data_access/arp_common.c,
+ ip-mib/data_access/ipaddress_common.c,
+ tcp-mib/data_access/tcpConn_common.c,
+ udp-mib/data_access/udp_endpoint_common.c:
+
+ don't free the container if asked not to
+
+2005-12-11 12:18 rstory
+
+ * agent/helpers/table.c:
+
+ - fix 1362324: testhandler module causes infinite loop
+ - don't retry for ASN_NULL; this retries when the handler does nothing,
+ which is what we tell people to do at the end of a table.
+ - add comments
+
+2005-12-11 10:37 rstory
+
+ * apps/snmpnetstat/if.c:
+
+ change nested comment to ifdef 0
+
+2005-12-10 20:07 tanders
+
+ * dist/README.build-scripts:
+
+ fix typo
+
+2005-12-10 20:02 tanders
+
+ * dist/net-snmp-solaris-build/DEVENV:
+
+ cleanup
+
+2005-12-10 19:50 tanders
+
+ * dist/net-snmp-solaris-build/net-snmp-5.0.6-build:
+
+ replaced by updated buildpackage-solaris
+
+2005-12-10 19:41 tanders
+
+ * dist/net-snmp-solaris-build/: README, buildpackage-solaris
+:
+
+ script to create native Solaris packages, replaces net-snmp-5.0.6-build
+
+2005-12-10 18:50 tanders
+
+ * configure, configure.in:
+
+ further improve mib module descriptions
+
+2005-12-10 18:29 tanders
+
+ * configure.in:
+
+ fix --with-enterprise-notification-oid description
+
+2005-12-10 18:17 tanders
+
+ * configure, configure.in:
+
+ improve text alignment in "configure --help" output
+
+2005-12-10 12:30 alex_b
+
+ * apps/snmpnetstat/if.c, win32/mib_module_includes.h,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in:
+
+ Win32: MSVC build fixes
+
+2005-12-10 12:28 tanders
+
+ * configure.in, configure:
+
+ put priv/auth related options closer to each other
+
+2005-12-10 11:37 rstory
+
+ * apps/snmpnetstat/if.c, agent/snmp_agent.c:
+
+ remove C++ comments or convert to C comments
+
+2005-12-10 11:35 rstory
+
+ * agent/mibgroup/: ip-forward-mib/data_access/route_common.c,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable.c,
+ tcp-mib/data_access/tcpConn_linux.c,
+ udp-mib/data_access/udp_endpoint_linux.c:
+
+ change cpp warnings to comments
+
+2005-12-10 11:25 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-12-10 11:23 rstory
+
+ * configure.in:
+
+ new 'os specific' section in mib module help
+
+2005-12-09 21:22 rstory
+
+ * agent/mibgroup/disman/event/: mteEventConf.h,
+ mteTriggerConf.h, mteTriggerTable.h:
+
+ config_require iquery
+
+2005-12-09 21:21 rstory
+
+ * agent/mibgroup/: ip-forward-mib/ipCidrRouteTable/.cvsignore
+, ip-mib/inetNetToMediaTable/.cvsignore,
+ ip-mib/ipAddressTable/.cvsignore,
+ ip-mib/ipSystemStatsTable/.cvsignore:
+
+ ignore misc generated files
+
+2005-12-09 20:58 rstory
+
+ *
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c
+:
+
+ update renamed variable
+
+2005-12-09 20:58 rstory
+
+ * agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
+:
+
+ fix config_require path
+
+2005-12-09 20:58 rstory
+
+ * agent/mibgroup/ip-mib/ipv4InterfaceTable/:
+ ipv4InterfaceTable_data_access.h,
+ ipv4InterfaceTable_interface.h:
+
+ remove experimental config_noinclude directives
+
+2005-12-09 20:57 rstory
+
+ *
+ agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c
+:
+
+ fix cut-n-paste
+
+2005-12-09 20:56 rstory
+
+ * agent/mibgroup/ip-mib/:
+ ipv4InterfaceTable/ipv4InterfaceTable_constants.h,
+ ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+ ipv6InterfaceTable/ipv6InterfaceTable_constants.h,
+ ipv6InterfaceTable/ipv6InterfaceTable_interface.c:
+
+ add missing registration of last change object
+
+2005-12-09 20:44 rstory
+
+ * agent/mibgroup/ip-mib/: ipv4InterfaceTable.h,
+ ipv6InterfaceTable.h:
+
+ add missing intermediate config_req headers
+
+2005-12-09 20:32 rstory
+
+ * include/net-snmp/agent/ds_agent.h:
+
+ update compat mapping too
+
+2005-12-09 19:49 hardaker
+
+ * agent/mibgroup/notification-log-mib/notification_log.c,
+ include/net-snmp/agent/ds_agent.h:
+
+ proper naming conventions standardized and widely adopted by the Internet Engineering Task Force
+
+2005-12-09 17:44 rstory
+
+ * agent/mibgroup/notification-log-mib/notification_log.c,
+ include/net-snmp/agent/ds_agent.h:
+
+ - define new agent ds id for retaining traps
+
+2005-12-09 10:43 hardaker
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ trap -> notification
+
+2005-12-09 10:13 rstory
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ - restore dontRetainLogs
+ - new, clearer doNotRetainTrapLogs use same ds id
+
+2005-12-09 08:44 dts12
+
+ * apps/snmptrapd.c:
+
+ Use the common boolean parsing routine (to recognise
+ the full list of documented values, not simply '1'!)
+
+2005-12-09 08:43 dts12
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/default_store.c:
+
+ Pull parsing of boolean config values out into a separate routine.
+
+2005-12-09 07:01 dts12
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Expand the source buffer so it can hold a maximum-length IPv6 specification.
+ Patch provided by Shuki Sasson.
+
+2005-12-08 08:10 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c, apps/snmptrapd_auth.c
+:
+
+ Issue warnings when 'snmptrapd' is run without any access configuration.
+ Both at startup, and when incoming traps are received (and dropped).
+
+ Also define an alternative name for the 'disableAuthorization' directive,
+ that is (IMO) more descriptive of what a network administrator might want to do.
+
+2005-12-08 08:07 dts12
+
+ * snmplib/vacm.c:
+
+ Properly recognise when no access settings have been configured.
+ (The new built-in views broke the previous test).
+
+2005-12-08 06:08 dts12
+
+ * configure, configure.in,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Include (and check for) another header file - needed on RedHat 9 systems.
+
+2005-12-07 17:55 tanders
+
+ * README.agent-mibs:
+
+ fix typo
+
+2005-12-07 07:29 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-12-07 07:27 rstory
+
+ * configure.in:
+
+ - fix mini-agent tests so that --disable doesn't actually enable it
+
+2005-12-06 17:50 nba
+
+ * mibs/rfclist:
+
+ Update to current RFC issues
+
+2005-12-06 12:44 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable_data_access.c,
+ ifTable_data_access.h:
+
+ reduce cache reload timeout below wrap threshold for gigabit interfaces
+
+2005-12-06 08:50 dts12
+
+ * man/snmpd.internal.5.def:
+
+ Brief (and somewhat repetative) documentation of internal directives.
+
+2005-12-06 08:11 dts12
+
+ * man/snmpd.examples.5.def:
+
+ Flesh out Event MIB, Schedule MIB and proxy examples
+ (plus various minor tweaks).
+
+2005-12-06 05:49 dts12
+
+ * agent/mibgroup/disman/event/: mteEvent.c, mteObjects.c
+, mteTriggerConf.c, mteTriggerConf.h:
+
+ Implement missing "linkUpDownNotifications" directive
+ (together with suitable standard entries)
+
+2005-12-05 11:44 hardaker
+
+ * remove-files:
+
+ don't remove dist
+
+2005-12-05 10:55 rstory
+
+ * snmplib/snmp_api.c:
+
+ fix missed var rename in conditional
+
+2005-12-05 07:47 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ config_add_mib in header
+
+2005-12-05 07:45 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ tweaks per comments from wes; see coders note
+
+2005-12-05 07:22 dts12
+
+ * man/snmpd.examples.5.def:
+
+ Flesh out AgentX examples.
+
+2005-12-05 07:21 dts12
+
+ * man/snmpd.examples.5.def:
+
+ Flesh out trap handling and embedded perl examples.
+
+2005-12-05 07:20 dts12
+
+ * man/: snmpd.conf.5.def, snmpd.examples.5.def:
+
+ Assorted wordsmithing, and pick up a couple of undocumented options.
+
+2005-12-05 07:15 dts12
+
+ * agent/mibgroup/util_funcs.c:
+
+ Implement 'get_exec_output' as a wrapper round 'run_exec_command'
+ to give proper handling of command tokenization. (See Bug #1324057)
+ Note this doesn't apply to Windows systems - that exec handling
+ probably needs to be moved to 'run_exec_command' as well.
+
+2005-12-04 18:03 rstory
+
+ * remove-files:
+
+ add -R for dist dir
+
+2005-12-04 17:54 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.3.pre5 )
+
+2005-12-04 17:54 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.3.pre5 )
+
+2005-12-04 17:53 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.3.pre5 )
+
+2005-12-04 17:53 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.3.pre5 )
+
+2005-12-04 17:53 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.3.pre5 )
+
+2005-12-04 17:53 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.3.pre5 )
+
+2005-12-04 17:53 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.3.pre5 )
+
+2005-12-04 17:53 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.3.pre5 )
+
+2005-12-04 17:52 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.3.pre5 )
+
+2005-12-04 17:52 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.3.pre5 )
+
+2005-12-04 17:52 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.3.pre5 )
+
+2005-12-04 17:52 rstory
+
+ * README:
+
+ - (README): version tag ( 5.3.pre5 )
+
+2005-12-04 17:51 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.3.pre5 )
+
+2005-12-04 17:51 rstory
+
+ * ChangeLog:
+
+ version update
+
+2005-12-04 17:43 rstory
+
+ * apps/snmpnetstat/Makefile.depend, apps/Makefile.depend
+, snmplib/Makefile.depend:
+
+ make depend
+
+2005-12-04 17:26 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3
+, netsnmp_agent_registry.3, netsnmp_agent_trap.3
+, netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3
+, netsnmp_bulk_to_next.3, netsnmp_cache_handler.3
+, netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_container.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_util.3,
+ netsnmp_utilities.3, netsnmp_variable_list.3,
+ netsnmp_watcher.3:
+
+ documentation update
+
+2005-12-04 17:23 rstory
+
+ * remove-files:
+
+ remove dist and win32/dist
+
+2005-12-04 17:14 rstory
+
+ * dist/makerelease:
+
+ do distclean before configure if Makefile exists
+
+2005-12-04 16:49 rstory
+
+ * dist/makerelease:
+
+ note that Makefile.top usually only change for first prerelease
+
+2005-12-04 16:48 rstory
+
+ * configure.in, configure:
+
+ version update
+
+2005-12-04 16:47 rstory
+
+ * dist/makerelease:
+
+ add -q to update so potential changes don't scroll off screen
+
+2005-12-04 16:29 rstory
+
+ * mibs/IANAifType-MIB.txt:
+
+ fix syntax errors
+
+2005-12-04 13:44 rstory
+
+ * dist/nsb-nightly:
+
+ log rc w/error msg
+
+2005-12-04 13:43 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ log container name, if avail, in log msg
+
+2005-12-04 13:38 rstory
+
+ * apps/snmptrapd.c:
+
+ - add log file append (-A) option
+ - remove Log/Print/Syslog distinction
+ - bring startup/reconfig log message in line w/snmpd
+
+2005-12-04 13:24 rstory
+
+ * agent/Makefile.in:
+
+ - fix bug 1297878: header_generic and header_simple_table prototypes
+ - extra header list/install target
+ - group perl install/uninstall together
+
+2005-12-04 13:19 rstory
+
+ * NEWS:
+
+ important notes for 5.3
+
+2005-12-04 09:42 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-12-04 09:40 rstory
+
+ * configure.in:
+
+ - fix bug 1365128: snmpd quietly dies on hpux 11.11
+ - add configure check for -lnm
+
+2005-12-04 09:25 rstory
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ - additional fix for bug 1103644, FreeBSD memory leak
+ - problem pointed out by rojer on irc
+ - use calloc instead of malloc/memset
+
+2005-12-02 19:13 rstory
+
+ * mibs/IANAifType-MIB.txt:
+
+ update to 200510100000Z version
+
+2005-12-02 18:48 rstory
+
+ * mibs/IP-MIB.txt:
+
+ - update from draft-ietf-ipv6-rfc2011-update-10.txt, currently in the RFC
+ editor's queue
+
+2005-12-02 17:47 rstory
+
+ * snmplib/snmp_api.c:
+
+ - bug 1337534: Read problem on stream sockets
+ - properly save partial packet which isn't at start of buffer
+
+2005-12-02 17:05 rstory
+
+ * snmplib/snmp_api.c:
+
+ - bug 1370856: ip address encoding on 64bit
+ - use inet_addr_t for inet addr
+
+2005-12-02 17:03 rstory
+
+ * snmplib/snmp_client.c:
+
+ - bug 1370856: ip address encoding on 64bit
+ - sync snmp_set_var_value w/snmp_build_var_op: ASN_IPADDRESS as a string
+
+2005-12-02 13:17 rstory
+
+ * agent/mibgroup/: udp-mib.h, tcp-mib/tcpListenerTable.h
+, udp-mib/udpEndpointTable.h:
+
+ add missing config_req files
+
+2005-12-02 13:12 rstory
+
+ * local/mib2c-conf.d/details-node.m2i:
+
+ only print ranges if they exist
+
+2005-12-02 13:12 rstory
+
+ * agent/mibgroup/tcp-mib.h:
+
+ remove extra ;
+
+2005-12-02 13:05 rstory
+
+ * agent/mibgroup/udp-mib/udpEndpointTable/: udpEndpointTable.c
+, udpEndpointTable.h, udpEndpointTable_constants.h
+, udpEndpointTable_data_access.c,
+ udpEndpointTable_data_access.h,
+ udpEndpointTable_interface.c, udpEndpointTable_interface.h
+:
+
+ regenerate mfd code
+
+2005-12-02 13:02 rstory
+
+ * agent/mibgroup/tcp-mib/tcpListenerTable/: tcpListenerTable.c
+, tcpListenerTable.h, tcpListenerTable_constants.h
+, tcpListenerTable_data_access.c,
+ tcpListenerTable_data_access.h,
+ tcpListenerTable_interface.c, tcpListenerTable_interface.h
+:
+
+ regenerate mfd code
+
+2005-12-02 11:45 hardaker
+
+ * snmplib/asn1.c:
+
+ fix counter64's when defined with 64bit long variables in the C64 structure
+
+2005-12-02 10:52 dts12
+
+ * agent/mibgroup/utilities/execute.c:
+
+ Use 'copy_nword' to tokenize external commands.
+ This means that quoted strings are handled in the natural manner.
+
+2005-12-02 10:33 dts12
+
+ * man/Makefile.in:
+
+ It helps if you actually create the man page as well, Dave!
+
+2005-12-02 09:55 tanders
+
+ * man/.cvsignore:
+
+ add the recently introduced manual pages
+
+2005-12-02 09:50 dts12
+
+ * man/: Makefile.in, snmpd.internal.5.def:
+
+ Template for documenting internal snmpd config directives.
+ (I've identified and listed the directives concerned,
+ but haven't provided any descriptions of what they do!)
+
+2005-12-02 05:36 nba
+
+ * apps/snmpnetstat/: if.c, inet.c, inet6.c,
+ main.c, main.h, netstat.h, route.c:
+
+ Align with warning fixes for 5.2.2
+
+2005-12-02 05:33 nba
+
+ * snmplib/mib.c:
+
+ Fix snmptranslate -Td display of UNITS
+
+2005-12-02 00:41 hardaker
+
+ * local/Makefile.in:
+
+ added mfd-persistence.m2i
+
+2005-12-01 16:42 rstory
+
+ * agent/mibgroup/tcp-mib/tcpConnectionTable/: tcpConnectionTable.c
+, tcpConnectionTable.h, tcpConnectionTable_constants.h
+, tcpConnectionTable_data_access.c,
+ tcpConnectionTable_data_access.h,
+ tcpConnectionTable_interface.c,
+ tcpConnectionTable_interface.h:
+
+ regenerate mfd code
+
+2005-12-01 16:31 rstory
+
+ * agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/:
+ usmDHUserKeyTable.c, usmDHUserKeyTable.h,
+ usmDHUserKeyTable_data_access.c,
+ usmDHUserKeyTable_data_access.h,
+ usmDHUserKeyTable_data_get.c, usmDHUserKeyTable_data_get.h
+, usmDHUserKeyTable_data_set.c,
+ usmDHUserKeyTable_data_set.h, usmDHUserKeyTable_enums.h
+, usmDHUserKeyTable_interface.c,
+ usmDHUserKeyTable_interface.h, usmDHUserKeyTable_oids.h
+:
+
+ regenerate mfd code
+
+2005-12-01 16:05 rstory
+
+ * agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/:
+ snmpNotifyFilterTable.c, snmpNotifyFilterTable.h,
+ snmpNotifyFilterTable_constants.h,
+ snmpNotifyFilterTable_data_access.c,
+ snmpNotifyFilterTable_data_access.h,
+ snmpNotifyFilterTable_interface.c,
+ snmpNotifyFilterTable_interface.h:
+
+ regenerate mfd code
+
+2005-12-01 15:52 rstory
+
+ * agent/mibgroup/ip-mib/: ipv4InterfaceTable/ipv4InterfaceTable.c
+, ipv4InterfaceTable/ipv4InterfaceTable.h,
+ ipv4InterfaceTable/ipv4InterfaceTable_constants.h,
+ ipv4InterfaceTable/ipv4InterfaceTable_data_access.c,
+ ipv4InterfaceTable/ipv4InterfaceTable_data_access.h,
+ ipv4InterfaceTable/ipv4InterfaceTable_interface.c,
+ ipv4InterfaceTable/ipv4InterfaceTable_interface.h,
+ ipv6InterfaceTable/ipv6InterfaceTable.c,
+ ipv6InterfaceTable/ipv6InterfaceTable.h,
+ ipv6InterfaceTable/ipv6InterfaceTable_constants.h,
+ ipv6InterfaceTable/ipv6InterfaceTable_data_access.c,
+ ipv6InterfaceTable/ipv6InterfaceTable_data_access.h,
+ ipv6InterfaceTable/ipv6InterfaceTable_interface.c,
+ ipv6InterfaceTable/ipv6InterfaceTable_interface.h:
+
+ regenerate mfd code
+
+2005-12-01 15:12 rstory
+
+ * agent/mibgroup/ip-mib/ipSystemStatsTable/: ipSystemStatsTable.c
+, ipSystemStatsTable.h, ipSystemStatsTable_constants.h
+, ipSystemStatsTable_data_access.c,
+ ipSystemStatsTable_data_access.h,
+ ipSystemStatsTable_interface.c,
+ ipSystemStatsTable_interface.h:
+
+ regenerate mfd code
+
+2005-12-01 12:00 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/: ipAddressTable.c,
+ ipAddressTable.h, ipAddressTable_constants.h,
+ ipAddressTable_data_access.c, ipAddressTable_data_access.h
+, ipAddressTable_interface.c,
+ ipAddressTable_interface.h:
+
+ regenerate mfd code
+
+2005-12-01 11:13 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Assorted minor tweaks and wordsmithing.
+
+2005-12-01 10:50 dts12
+
+ * man/: Makefile.in, snmpd.conf.5.def,
+ snmpd.examples.5.def:
+
+ Move snmpd.conf examples into a separate man page,
+ and example the range of examples provided.
+ (Not finished yet, but it's probably worth submitting
+ this while we're still in pre-release mode)
+
+2005-12-01 10:49 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressPrefixTable/:
+ ipAddressPrefixTable.c, ipAddressPrefixTable.h,
+ ipAddressPrefixTable_constants.h,
+ ipAddressPrefixTable_data_access.c,
+ ipAddressPrefixTable_data_access.h,
+ ipAddressPrefixTable_interface.c,
+ ipAddressPrefixTable_interface.h:
+
+ regenerate mfd code
+
+2005-12-01 08:09 dts12
+
+ * README.solaris:
+
+ Drop bogus "-p" port option (and apply consistent indentation).
+ Should the other changes suggested in bug #1247164 be applied, too?
+
+2005-12-01 07:45 dts12
+
+ * apps/snmpstatus.c:
+
+ Don't crash-and-burn on SNMP exceptions (see bug #1278809)
+
+2005-11-30 19:45 rstory
+
+ * agent/mibgroup/ip-mib/inetNetToMediaTable/: inetNetToMediaTable.c
+, inetNetToMediaTable.h,
+ inetNetToMediaTable_constants.h,
+ inetNetToMediaTable_data_access.c,
+ inetNetToMediaTable_data_access.h,
+ inetNetToMediaTable_interface.c,
+ inetNetToMediaTable_interface.h:
+
+ regenerate mfd code
+
+2005-11-30 18:47 tanders
+
+ * testing/tests/T050snmpv3trap:
+
+ Rewritten from scratch to verify noAuthNoPriv, authNoPriv *and* authPriv SNMPv3 traps. Let's never break this again.
+
+2005-11-30 18:44 tanders
+
+ * testing/tests/Sv3usmconfigtrapd:
+
+ create noAuthNoPriv user
+
+2005-11-30 18:43 tanders
+
+ * testing/tests/Sv3usmconfigbase:
+
+ introduce to specify the engine ID for createUser
+
+2005-11-30 17:32 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/:
+ ipCidrRouteTable.c, ipCidrRouteTable.h,
+ ipCidrRouteTable_constants.h,
+ ipCidrRouteTable_data_access.c,
+ ipCidrRouteTable_data_access.h,
+ ipCidrRouteTable_interface.c, ipCidrRouteTable_interface.h
+:
+
+ regenerate mfd code
+
+2005-11-30 17:25 rstory
+
+ * snmplib/file_utils.c:
+
+ fix compiler warning; init var
+
+2005-11-30 16:08 hardaker
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ fix automatic user creation for sessions that have probing off or delayed
+
+2005-11-30 16:07 rstory
+
+ * agent/mibgroup/ip-forward-mib/inetCidrRouteTable/:
+ inetCidrRouteTable.c, inetCidrRouteTable.h,
+ inetCidrRouteTable_constants.h,
+ inetCidrRouteTable_data_access.c,
+ inetCidrRouteTable_data_access.h,
+ inetCidrRouteTable_interface.c,
+ inetCidrRouteTable_interface.h:
+
+ regenerate mfd code
+
+2005-11-30 15:16 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/: ifXTable.c, ifXTable.h
+, ifXTable_constants.h, ifXTable_data_access.c,
+ ifXTable_data_access.h, ifXTable_interface.c,
+ ifXTable_interface.h:
+
+ regenerate mfd code
+
+2005-11-30 13:10 hardaker
+
+ * dist/net-snmp-solaris-build/README:
+
+ added a README file that has been sitting in my directory un-checked-in
+
+2005-11-29 18:36 tanders
+
+ * configure.in:
+
+ refer to agent/mibgroup/ipfwchains/README rather than "the ucd-snmp ftp site" for ipfwchains
+
+2005-11-29 17:14 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.c, ifTable.h
+, ifTable_constants.h, ifTable_data_access.c,
+ ifTable_data_access.h, ifTable_interface.c,
+ ifTable_interface.h:
+
+ regenerate mfd code
+
+2005-11-29 14:28 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
+:
+
+ typo in log msg
+
+2005-11-25 09:16 tanders
+
+ * testing/tests/: T160snmpnetstat, T200snmpv2cwalkall:
+
+ use SKIP
+
+2005-11-25 05:12 dts12
+
+ * testing/tests/: T160snmpnetstat, T200snmpv2cwalkall:
+
+ Skip tests that are known to fail when not run as root.
+ (May need to be extended to other O/S's as well).
+
+2005-11-24 18:24 tanders
+
+ * man/snmpd.conf.5.def:
+
+ fix typo and layout
+
+2005-11-24 18:14 tanders
+
+ * testing/tests/: T030snmpv3usercreation,
+ T035snmpv3trapdusermgmt, T049snmpv3informpriv:
+
+ fix tests to work with --disable-privacy
+
+2005-11-23 19:56 tanders
+
+ * configure:
+
+ run autoconf
+
+2005-11-23 19:22 tanders
+
+ * NEWS, configure.in, agent/Makefile.in:
+
+ make "configure --disable-agent" finally work (fixes bugs 1006415, 908571)
+
+2005-11-23 08:14 alex_b
+
+ * win32/netsnmpmibs/netsnmpmibs.dsp:
+
+ Win32: MSVC build fix for netsnmpmibs.dsp
+
+2005-11-23 04:11 dts12
+
+ * snmplib/snmp_parse_args.c:
+
+ Move opening brace out of alternate #ifdef clauses
+ (confuses brace-matching editors!)
+
+2005-11-22 16:29 rstory
+
+ * agent/mibgroup/Makefile.depend:
+
+ update deps for deleted file
+
+2005-11-22 05:43 dts12
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Beef up the "relocatable exec" warning message.
+
+2005-11-22 05:37 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Document Schedule MIB configuration.
+
+2005-11-21 20:40 alex_b
+
+ * README.win32, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/inet6.c, win32/agent_module_inits.h
+, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in,
+ win32/netsnmpmibs/Makefile.in,
+ win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/netsnmpmibssdk/Makefile.in,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Win32: MSVC and Cygwin compile fixes
+
+2005-11-21 19:23 rstory
+
+ * agent/mibgroup/notification/: snmpNotifyFilterTable.c,
+ snmpNotifyFilterTable.h:
+
+ remove unused files; reimplemented in snmp-notification-mib/snmpNotifyFilterTable
+
+2005-11-21 06:27 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Revise the DisMan Event-MIB documentation to match the new implementation.
+
+2005-11-21 06:17 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Properly detect all three styles of monitor expression automatically.
+ (This makes the '-t' option redundant, though it's still accepted)
+
+2005-11-20 18:51 tanders
+
+ * testing/eval_tools.sh:
+
+ CHECKANDDIE() should EXPECTRESULT 0
+
+2005-11-20 18:30 tanders
+
+ * testing/tests/T200snmpv2cwalkall:
+
+ make the test also FAIL on "Wrong Type (should be ...)"
+
+2005-11-20 18:28 tanders
+
+ * testing/eval_tools.sh:
+
+ introduce CHECKANDDIE() to FAIL if a pattern *is* found
+
+2005-11-20 18:00 tanders
+
+ * mibs/NET-SNMP-TC.txt:
+
+ update LAST-UPDATED field to reflect recent changes
+
+2005-11-20 17:48 tanders
+
+ * man/snmpd.conf.5.def:
+
+ clarify that "host" is only enabled by default on the major supported platforms
+
+2005-11-20 17:35 tanders
+
+ * man/snmpd.conf.5.def:
+
+ fix description for engineID
+
+2005-11-20 17:27 tanders
+
+ * NEWS, man/snmp.conf.5.def:
+
+ document noPersistentLoad and noPersistentSave
+
+2005-11-20 16:30 rstory
+
+ * dist/makerelease:
+
+ use -q on final cvsupdate; add spacing
+
+2005-11-20 16:17 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.3.pre4 )
+
+2005-11-20 16:17 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.3.pre4 )
+
+2005-11-20 16:17 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.3.pre4 )
+
+2005-11-20 16:16 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.3.pre4 )
+
+2005-11-20 16:16 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.3.pre4 )
+
+2005-11-20 16:16 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.3.pre4 )
+
+2005-11-20 16:16 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.3.pre4 )
+
+2005-11-20 16:16 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.3.pre4 )
+
+2005-11-20 16:15 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.3.pre4 )
+
+2005-11-20 16:15 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.3.pre4 )
+
+2005-11-20 16:15 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.3.pre4 )
+
+2005-11-20 16:15 rstory
+
+ * README:
+
+ - (README): version tag ( 5.3.pre4 )
+
+2005-11-20 16:15 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.3.pre4 )
+
+2005-11-20 16:13 rstory
+
+ * ChangeLog:
+
+ version update
+
+2005-11-20 16:07 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, apps/Makefile.depend
+, snmplib/Makefile.depend:
+
+ make depend
+
+2005-11-20 16:05 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3
+, netsnmp_agent_registry.3, netsnmp_agent_trap.3
+, netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3
+, netsnmp_bulk_to_next.3, netsnmp_cache_handler.3
+, netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_container.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_util.3,
+ netsnmp_utilities.3, netsnmp_variable_list.3,
+ netsnmp_watcher.3:
+
+ documentation update
+
+2005-11-20 15:55 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ - remove howto on libtool versioning match release numbers
+ - update suggested configure test options
+
+2005-11-20 15:38 rstory
+
+ * dist/makerelease:
+
+ use enable-ipv6 instead of specifying transports
+
+2005-11-20 15:37 rstory
+
+ * configure.in, configure:
+
+ version update
+
+2005-11-20 15:35 rstory
+
+ * dist/makerelease:
+
+ add missing ;
+
+2005-11-20 14:42 rstory
+
+ * snmplib/snmp_logging.c:
+
+ - bug 1347709: snmpd doesnt handle large log files (>= 2GB) gracefully
+ - partial fix: open/truncate log files at startup
+
+2005-11-20 14:39 rstory
+
+ * agent/snmpd.c:
+
+ use new ds boolean for append logfiles, instead of local var
+
+2005-11-20 14:38 rstory
+
+ * include/net-snmp/library/default_store.h:
+
+ new lib boolean for append logfiles
+
+2005-11-18 16:57 rstory
+
+ * snmplib/read_config.c:
+
+ support for counters in read_config_read_memory
+
+2005-11-18 14:21 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ allow session params to override global defaults
+
+2005-11-18 10:51 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Revise the introduction to snmpd config files.
+
+2005-11-18 10:36 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise the DisMan Event MIB documentation.
+
+2005-11-17 20:44 rstory
+
+ * agent/mibgroup/host/hr_device.c:
+
+ account for possible NULL value from function
+
+2005-11-17 17:45 rstory
+
+ * dist/nsb-nightly:
+
+ include CONFIGURE_OPTIONS in results email
+
+2005-11-17 17:03 rstory
+
+ * agent/agent_registry.c:
+
+ ifdef __aplha, ifdef out optimization causing alpha-linux1 to segfault
+
+2005-11-17 14:29 rstory
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ add memory/vmstats for freebsd6
+
+2005-11-17 12:56 rstory
+
+ * dist/nsb-functions:
+
+ don't explictly config ipv6 transports; enable-ipv6 instead
+
+2005-11-17 12:41 rstory
+
+ * dist/nsb-nightly:
+
+ - use sendmail on freebsd too
+ - add Errors-To header to mail
+ - echo to/subject to stdout
+
+2005-11-17 11:45 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise trap destination handling.
+
+2005-11-17 11:16 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Minor wordsmithing and formatting corrections.
+
+2005-11-17 11:10 rstory
+
+ * agent/mibgroup/mibII/interfaces.h:
+
+ exclude interface get/next prototypes if using mfd rewrites
+
+2005-11-17 11:07 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ explicit cast to match prototype
+
+2005-11-17 11:06 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h:
+
+ add missing prototype; add C++ extern wrappers
+
+2005-11-17 11:06 rstory
+
+ * agent/mibgroup/: if-mib/data_access/interface_ioctl.c,
+ ip-forward-mib/data_access/route_linux.c:
+
+ quite compiler: add headers for missing prototypes
+
+2005-11-17 10:59 rstory
+
+ * dist/nsb-nightly:
+
+ special case for openbsd mail
+
+2005-11-17 09:45 dts12
+
+ * agent/mibgroup/disman/event-mib.h:
+
+ Clarify that the "event-mib.h" warning *is* a warning rather than
+ simply a note (which would belong in the documentation)
+
+2005-11-16 16:36 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-11-16 16:33 rstory
+
+ * configure.in:
+
+ netbsd wants netinet/ip6.h before netinet6/in6_pcb.h
+
+2005-11-16 16:26 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-11-16 16:26 rstory
+
+ * configure.in:
+
+ disallow ipv6 transports if ipv6 not enabled
+
+2005-11-16 15:31 rstory
+
+ * agent/mibgroup/:
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
+,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
+:
+
+ keep compiler happy: explicit argument cast
+
+2005-11-16 15:27 rstory
+
+ * agent/mibgroup/: if-mib/ifTable/ifTable_interface.c,
+ if-mib/ifXTable/ifXTable_interface.c,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
+,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
+, tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c
+, tcp-mib/tcpListenerTable/tcpListenerTable_interface.c
+:
+
+ C++ cleanup: don't use new as variable name
+
+2005-11-16 15:20 rstory
+
+ * include/net-snmp/data_access/route.h:
+
+ add missing prototype
+
+2005-11-16 15:18 rstory
+
+ *
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
+:
+
+ keep compiler happy: explicit argument cast
+
+2005-11-16 15:16 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/: ifXTable.c, ifXTable.h
+:
+
+ move initialize_table_ifXTable prototype to header
+
+2005-11-16 15:11 rstory
+
+ * include/net-snmp/data_access/interface.h:
+
+ add prototypes for backwards compatibility interface functions
+
+2005-11-16 15:02 rstory
+
+ * agent/mibgroup/notification-log-mib/notification_log.h:
+
+ C++ extern "C" wrappers
+
+2005-11-16 15:01 rstory
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ include header w/needed prototype
+
+2005-11-16 14:51 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_interface.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+,
+ agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
+,
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+,
+ agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
+, include/net-snmp/data_access/ipaddress.h,
+ include/net-snmp/data_access/systemstats.h,
+ include/net-snmp/data_access/tcpConn.h:
+
+ C++ cleanup: don't use new as variable name
+
+2005-11-16 14:44 rstory
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ - C++ cleanup
+ - don't use __P() (nowhere else in the code uses it)
+ - don't use new as a variable name
+
+2005-11-16 12:17 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ // -> /* */
+
+2005-11-16 10:42 dts12
+
+ * apps/snmpnetstat/main.h:
+
+ Provide a definition for NI_MAXHOST if missing.
+
+2005-11-16 10:10 tanders
+
+ * agent/agent_read_config.c, agent/snmp_agent.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/ucd-snmp/proxy.c, apps/snmptrapd_log.c
+, snmplib/snmpCallbackDomain.c, snmplib/snmp_api.c
+, snmplib/snmp_parse_args.c,
+ testing/tests/T058agentauthtrap, testing/tests/T100agenthup
+, testing/tests/T152hostuptime:
+
+ build fixes for sole --disable-snmpv1 (*without* --disable-snmpv2c)
+
+2005-11-16 08:06 tanders
+
+ * agent/mibgroup/utilities/iquery.c, apps/snmptrapd_auth.c
+:
+
+ build fix for --disable-snmpv1/--disable-snmpv2c
+
+2005-11-16 06:20 tanders
+
+ * snmplib/snmpCallbackDomain.c:
+
+ build fix for --disable-snmpv1/--disable-snmpv2c
+
+2005-11-16 05:58 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Better layout of 'inject_handler' documentation.
+
+2005-11-16 05:09 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise load average and file monitoring configuration.
+ (plus assorted tidying up).
+
+2005-11-16 04:58 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise the disk monitoring configuration
+
+2005-11-16 04:57 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise the process monitoring configuration
+
+2005-11-16 04:57 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise the Host Resources configuration
+
+2005-11-16 04:56 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise the system group configuration.
+
+2005-11-16 04:55 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Consolidate the "system information", and "agent behaviour" configuration
+ directives to be documented together (as two distinct sections).
+
+2005-11-15 21:14 rstory
+
+ *
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
+:
+
+ uncomment out cleanup code
+
+2005-11-15 21:10 rstory
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ extra error checking for freebsd
+
+2005-11-15 21:08 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c
+:
+
+ remove cpp #warning lines
+
+2005-11-15 21:04 rstory
+
+ * Makefile.in, Makefile.top:
+
+ - use find found by configure
+ - tweak commentcheck regexp to miss regexp in perl header
+
+2005-11-15 20:39 rstory
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ - solaris fixes
+ - don't set sorted flag for solaris (data on sf cf 5.9 is not sorted)
+ - reverse condition on idle test so some data gets returned
+
+2005-11-15 19:25 rstory
+
+ * agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c
+:
+
+ use state from arp entry instead of hardcoded value
+
+2005-11-15 19:24 rstory
+
+ *
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
+:
+
+ default row status to active
+
+2005-11-15 19:24 tanders
+
+ * testing/tests/T065agentextend:
+
+ introduce snmpd test for extend
+
+2005-11-15 19:23 rstory
+
+ * agent/mibgroup/ip-mib/data_access/arp_linux.c:
+
+ - don't ignore incomplete entries
+ - set state to reachable if ! incomplete
+
+2005-11-15 19:02 tanders
+
+ * testing/tests/T200snmpv2cwalkall:
+
+ fix typo
+
+2005-11-15 18:46 tanders
+
+ * testing/tests/T061agentperl:
+
+ some optimization
+
+2005-11-15 18:32 rstory
+
+ * README.agentx:
+
+ document default ping interval
+
+2005-11-15 18:12 tanders
+
+ * man/snmpd.conf.5.def:
+
+ minor tweaks
+
+2005-11-15 17:46 tanders
+
+ * README.agentx:
+
+ minor tweaks
+
+2005-11-15 11:37 rstory
+
+ * net-snmp-config.in, agent/snmp_agent.c,
+ agent/snmpd.c, apps/snmptrapd.c:
+
+ ping, pong; restore netsnmp_running changes
+
+2005-11-15 10:51 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise AgentX config.
+
+2005-11-15 09:35 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise dlmod, proxy and SMUX descriptions
+ (plus assorted minor tweaks)
+
+2005-11-15 05:28 dts12
+
+ * FAQ:
+
+ Expand discussion of mib2c configs.
+
+2005-11-14 20:19 alex_b
+
+ * apps/snmpnetstat/inet6.c:
+
+ Win32: snmpnetstat IPv6 build fixes
+
+2005-11-14 19:11 tanders
+
+ * testing/tests/T061agentperl:
+
+ We finally have snmpd embedded perl testing. Feel free to review/scream/back out -- or applaud.
+
+2005-11-14 18:19 rstory
+
+ * snmplib/file_utils.c:
+
+ - remove C++ style comments
+ - add additional error handling/logging
+ - more comments
+ - doxygen docs
+
+2005-11-14 18:02 hardaker
+
+ * snmplib/: snmpSTDDomain.c, snmplocalsm.c:
+
+ remove C++ related comments
+
+2005-11-14 17:59 hardaker
+
+ * dist/makerelease:
+
+ don't manual update to SF servers
+
+2005-11-14 17:46 rstory
+
+ * snmplib/callback.c:
+
+ - undefine NETSNMP_PARANOID_LEVEL_HIGH, document what it does
+ - update lock assert/warn cases for lock per callback expectations
+
+2005-11-14 17:28 rstory
+
+ *
+ agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
+:
+
+ remove commented out code
+
+2005-11-14 17:26 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c:
+
+ remove commented out includes
+
+2005-11-14 17:25 rstory
+
+ * agent/helpers/table_tdata.c:
+
+ remove c++ style commented out code
+
+2005-11-14 17:23 rstory
+
+ * agent/helpers/row_merge.c:
+
+ remove temporary comments
+
+2005-11-14 13:16 rstory
+
+ * agent/helpers/table_container.c:
+
+ fix bug 1352554: Seg fault in netsnmp_container_table_row_insert
+
+2005-11-14 13:12 rstory
+
+ * net-snmp-config.in, agent/snmp_agent.c,
+ agent/snmpd.c, apps/snmptrapd.c:
+
+ - move running flag back into applications
+ - restore infinite loop in get-next loop handling
+
+2005-11-14 11:32 tanders
+
+ * man/snmpd.conf.5.def:
+
+ document smuxsocket and enhance AgentX*
+
+2005-11-14 10:54 tanders
+
+ * man/snmpd.conf.5.def:
+
+ minor fixes after reviewing Dave's changes
+
+2005-11-14 10:43 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise embedded perl documentation.
+
+2005-11-14 06:35 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Fix a couple of typos, and specify a more definite SET
+ protocol for 'pass_persist' - compatible with the
+ current behaviour, but opening the door for more
+ flexible handling in the future.
+
+2005-11-14 06:29 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise pass-through support.
+
+2005-11-14 06:22 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review and revise "exec"/"extend" documention
+
+2005-11-14 05:55 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Consolidate all the extension mechanisms to be documented together.
+
+2005-11-14 05:53 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Review the Access Control section, including separation into
+ distinct subsections.
+
+2005-11-14 05:52 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Simple documentation for the auth* directives.
+
+2005-11-14 04:41 tanders
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ fix typo
+
+2005-11-14 01:52 rstory
+
+ * dist/makerelease:
+
+ check for gpg key instead of userid
+
+2005-11-14 01:47 rstory
+
+ * dist/makerelease:
+
+ add option to repeat failed steps
+
+2005-11-14 01:44 rstory
+
+ * FAQ, README, perl/OID/OID.pm,
+ perl/default_store/default_store.pm:
+
+ version update
+
+2005-11-14 01:39 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.3.pre3 )
+
+2005-11-14 01:39 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.3.pre3 )
+
+2005-11-14 01:39 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.3.pre3 )
+
+2005-11-14 01:38 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.3.pre3 )
+
+2005-11-14 01:38 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.3.pre3 )
+
+2005-11-14 01:38 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.3.pre3 )
+
+2005-11-14 01:38 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.3.pre3 )
+
+2005-11-14 01:38 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.3.pre3 )
+
+2005-11-14 01:37 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.3.pre3 )
+
+2005-11-14 01:37 rstory
+
+ * ChangeLog:
+
+ version update
+
+2005-11-14 01:36 rstory
+
+ * NEWS:
+
+ note agentx subagent connect after configs fix
+
+2005-11-14 01:26 rstory
+
+ * agent/Makefile.depend, apps/snmpnetstat/Makefile.depend
+:
+
+ make depend
+
+2005-11-14 01:25 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3
+, netsnmp_agent_registry.3, netsnmp_agent_trap.3
+, netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3
+, netsnmp_bulk_to_next.3, netsnmp_cache_handler.3
+, netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_oid_stash.3, netsnmp_old_api.3,
+ netsnmp_read_config.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_snmp_agent.3, netsnmp_snmp_alarm.3,
+ netsnmp_snmp_client.3, netsnmp_snmp_logging.3,
+ netsnmp_snmp_pdu.3, netsnmp_snmp_session.3,
+ netsnmp_stash_cache.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_container.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_util.3,
+ netsnmp_utilities.3, netsnmp_variable_list.3,
+ netsnmp_watcher.3:
+
+ documentation update
+
+2005-11-14 01:19 rstory
+
+ * configure:
+
+ version update
+
+2005-11-14 01:10 rstory
+
+ * configure, configure.in:
+
+ version update
+
+2005-11-14 00:14 rstory
+
+ * agent/mibgroup/versiontag:
+
+ remove unneeded repository spec
+
+2005-11-13 22:10 alex_b
+
+ * win32/: Makefile.in, install-net-snmp.bat,
+ dist/installer/net-snmp.nsi:
+
+ -Win32: Add missing mib2c-data to installer
+ -Win32: Use wildcards in installer for installing files to help prevent
+ missing files.
+
+2005-11-13 22:00 rstory
+
+ * net-snmp-config.in, agent/snmp_agent.c,
+ agent/snmpd.c, apps/snmptrapd.c:
+
+ - new netsnmp_running global in agent lib
+ - used in place of while(1) in get next processing loop
+ - daemons w/sighandler updated to clear flag on sigterm
+
+2005-11-11 21:55 alex_b
+
+ * win32/net-snmp/: net-snmp-config.h, net-snmp-config.h.in
+:
+
+ Win32: Fix NI_MAXHOST define.
+
+2005-11-11 21:11 alex_b
+
+ * apps/snmpnetstat/inet.c:
+
+ Win32: Work around for bug 1278743: If trying to reverse lookup
+ 127.0.0.1, return 'localhost' to prevent Windows from returning the
+ local computer name because it ignores the hosts file.
+
+2005-11-10 19:48 tanders
+
+ * testing/tests/T0160snmpv2cbulkget:
+
+ fix typo
+
+2005-11-10 19:18 tanders
+
+ * README.solaris:
+
+ fix syntax typo
+
+2005-11-10 18:55 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ clarify that this test requires a working udpTable
+
+2005-11-10 18:22 tanders
+
+ * include/net-snmp/system/openbsd.h:
+
+ build fix for OpenBSD/SPARC 3.7
+
+2005-11-10 14:37 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - agentx init rework
+ - protect against multiple calls to subagent_init
+ - don't connect to master in subagent_init, instead register POST_CONFIG
+ callback to do so
+
+2005-11-10 14:27 rstory
+
+ * snmplib/callback.c:
+
+ - finer grained locking of callbacks (per subid), allowing a callback to
+ manipulate (reg/unreg) other callbacks
+ - more debugging
+ - add static flag for init
+ - memset and init variables in init_callback if not done yet
+ - call init_callback, if needed, from all functions
+
+2005-11-10 14:15 rstory
+
+ * agent/snmp_agent.c:
+
+ - agentx init rework
+ restore backwards compatibility (no subagent init in init_master_agent())
+
+2005-11-10 14:12 rstory
+
+ * agent/snmp_vars.c:
+
+ - agentx init rework:
+ restore backwards compatibility (call subagent in in init_agent)
+
+2005-11-10 05:13 dts12
+
+ * agent/mibgroup/disman/: event.h, event-mib.h,
+ old-event-mib.h:
+
+ Split original and new Event MIB implementations into distinct
+ "module group" headers, and use the original name to warn of the changes.
+
+2005-11-10 05:10 dts12
+
+ * configure, configure.in:
+
+ Add support for MIB modules to generate configure warnings or errors
+
+2005-11-10 04:46 dts12
+
+ * apps/snmpnetstat/: main.c, netstat.h, route.c:
+
+ Silence a couple of compiler warnings
+
+2005-11-10 04:45 dts12
+
+ * apps/snmpnetstat/if.c:
+
+ Don't choke on missing interfaces (and silence a couple of compiler warnings)
+
+2005-11-10 04:44 dts12
+
+ * apps/snmpnetstat/: inet.c, inet6.c:
+
+ Suppress headers for empty TCP displays (and fix a minor typo)
+
+2005-11-09 21:33 alex_b
+
+ * agent/snmpd.c, apps/snmptrapd.c,
+ snmplib/winservice.c:
+
+ -Win32: Force Event Log, SCM, registry etc to use long
+ name for service (Net-SNMP Agent instead of snmpd). Needed
+ because of new -n option in snmpd. Note: The snmpd -n option
+ does not change the Windows service name etc, only the config
+ file loaded.
+
+2005-11-09 19:34 tanders
+
+ * testing/Makefile.in:
+
+ "make test-mibs" still won't work if build dir != source dir, but it's closer now
+
+2005-11-09 18:41 rstory
+
+ * agent/mibgroup/agentx/: agentx_config.h, subagent.h:
+
+ agentx init rework: update prototypes for renamed functions
+
+2005-11-09 18:24 tanders
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ debug message should match code
+
+2005-11-09 17:38 rstory
+
+ * agent/mibgroup/: ip-mib/ipAddressPrefixTable/.cvsignore,
+ ip-mib/ipv4InterfaceTable/.cvsignore,
+ ip-mib/ipv6InterfaceTable/.cvsignore,
+ udp-mib/udpEndpointTable/.cvsignore:
+
+ ignore executables, makefiles, txt files, subagent files
+
+2005-11-09 17:31 rstory
+
+ * apps/snmpnetstat/inet6.c:
+
+ remove duplicate include
+
+2005-11-09 17:28 rstory
+
+ * dist/nsb-functions:
+
+ more specific error regexp
+
+2005-11-09 17:26 rstory
+
+ * apps/snmptrapd.c:
+
+ agentx init rework: update for function name changes
+
+2005-11-09 17:25 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - agentx init rework
+ - ifdef entire module based on using agentx subagent module
+ - rename init fucntion so we can control when it is called
+ - remove subagent_pre_init
+ - config stuff moved into agentx_config.c
+ - connection establishment moved to subagent_init, now that it's called
+ after configs have been read
+
+2005-11-09 17:21 rstory
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ - consolidate master and subagent configs in this file
+ - slight code re-org (no changes; move agentx socket parsing to top)
+ - register ping interval config and set default
+ - rename init function so configure won't add it to modules inits, so we
+ can call it when we want it to be called
+
+2005-11-09 17:18 rstory
+
+ * agent/snmp_agent.c:
+
+ - agentx init rework: init subagent in init_master_agent
+ - assert if role isn't master or sub-agent
+
+2005-11-09 17:16 rstory
+
+ * agent/snmp_vars.c:
+
+ - agentx init rework
+ - don't init subagent here (configs haven't been read yet)
+ - only init master/sub configs
+
+2005-11-09 17:12 rstory
+
+ * README.agent-mibs:
+
+ update for new tables
+
+2005-11-08 07:21 dts12
+
+ * apps/snmpnetstat/: if.c, main.c, netstat.h:
+
+ Implement Open/NetBSD-style octet interface display.
+
+2005-11-08 07:17 dts12
+
+ * apps/snmpnetstat/if.c:
+
+ Right-justify headings for counter values.
+ (looks neater when individual values become relatively wide)
+
+2005-11-08 07:04 dts12
+
+ * apps/snmpnetstat/inet6.c:
+
+ Fix problems walking the IPv6 connection tables.
+
+2005-11-08 06:59 dts12
+
+ * agent/helpers/cache_handler.c:
+
+ Only schedule automatic loading once for any given cache.
+
+2005-11-07 22:46 hardaker
+
+ * dist/makerelease:
+
+ ChangeLog note
+
+2005-11-07 21:45 alex_b
+
+ * win32/: net-snmp/net-snmp-config.h,
+ net-snmp/net-snmp-config.h.in, snmpnetstat/Makefile.in
+, snmpnetstat/snmpnetstat.dsp:
+
+ Win32: MSVC build fixes.
+
+2005-11-07 19:49 tanders
+
+ * testing/tests/T060trapdperl:
+
+ introduce embedded perl test for snmptrapd (too fancy to resist)
+
+2005-11-07 19:42 tanders
+
+ * apps/snmpnetstat/Makefile.in:
+
+ build fix: fss->ffs
+
+2005-11-07 18:54 tanders
+
+ * perl/ASN/ASN.pm:
+
+ fix typo
+
+2005-11-07 18:34 tanders
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ fix typos
+
+2005-11-07 13:41 rstory
+
+ * agent/snmpd.c:
+
+ drop default timeout down to INT_MAX, and document why
+
+2005-11-07 09:39 dts12
+
+ * apps/snmpnetstat/: Makefile.in, ffs.c, if.c,
+ main.c, netstat.h, route.c:
+
+ Tweaks to support building under Windows
+ (including renamed 'ffs()' routine, taken from OpenBSD source tree)
+
+2005-11-07 06:47 dts12
+
+ * apps/snmpnetstat/if.c:
+
+ Display interface addressing information.
+
+2005-11-07 01:57 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.3.pre2 )
+
+2005-11-07 01:57 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.3.pre2 )
+
+2005-11-07 01:56 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.3.pre2 )
+
+2005-11-07 01:56 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.3.pre2 )
+
+2005-11-07 01:56 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.3.pre2 )
+
+2005-11-07 01:56 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.3.pre2 )
+
+2005-11-07 01:56 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.3.pre2 )
+
+2005-11-07 01:56 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.3.pre2 )
+
+2005-11-07 01:55 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.3.pre2 )
+
+2005-11-07 01:55 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.3.pre2 )
+
+2005-11-07 01:55 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.3.pre2 )
+
+2005-11-07 01:54 rstory
+
+ * README:
+
+ - (README): version tag ( 5.3.pre2 )
+
+2005-11-07 01:54 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.3.pre2 )
+
+2005-11-07 01:54 rstory
+
+ * ChangeLog:
+
+ version update
+
+2005-11-07 01:44 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend,
+ apps/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2005-11-07 01:43 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3
+, netsnmp_agent_registry.3, netsnmp_agent_trap.3
+, netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3
+, netsnmp_bulk_to_next.3, netsnmp_cache_handler.3
+, netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_config.3,
+ netsnmp_read_only.3, netsnmp_row_merge.3,
+ netsnmp_scalar.3, netsnmp_scalar_group_group.3,
+ netsnmp_serialize.3, netsnmp_snmp_agent.3,
+ netsnmp_snmp_alarm.3, netsnmp_snmp_client.3,
+ netsnmp_snmp_logging.3, netsnmp_snmp_pdu.3,
+ netsnmp_snmp_session.3, netsnmp_stash_cache.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2005-11-07 01:38 rstory
+
+ * configure.in, configure:
+
+ version update
+
+2005-11-07 01:14 rstory
+
+ * snmplib/snmp_client.c:
+
+ don't try to use agent var in base lib (it was late, ok?)
+
+2005-11-07 00:16 rstory
+
+ * snmplib/snmp_client.c:
+
+ break out of waiting loops if ! running
+
+2005-11-06 22:34 alex_b
+
+ * include/net-snmp/types.h, win32/net-snmp/net-snmp-config.h
+, win32/net-snmp/net-snmp-config.h.in:
+
+ Win32: Move uint16_t definition to static win32 net-snmp-config.h
+
+2005-11-06 21:27 alex_b
+
+ * include/net-snmp/types.h,
+ win32/libnetsnmptrapd/Makefile.in,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/netsnmpmibssdk/Makefile.in,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Win32 MSVC build fixes
+
+2005-11-05 18:19 rstory
+
+ * agent/snmp_agent.c:
+
+ break out of getnext loop if ! running
+
+2005-11-05 17:46 tanders
+
+ * testing/TESTCONF.sh:
+
+ only use "ulimit -v" in bash
+
+2005-11-05 17:43 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-11-05 17:24 tanders
+
+ * dist/nsb-functions:
+
+ adjust error regex: don't fail on &entry->schedLastFailed, &fail etc.
+
+2005-11-05 17:09 rstory
+
+ * dist/nsb-functions:
+
+ - allow over-ride of NSB_(DIST|EXTRA)_MODULES
+ - remove testhandler from EXTRA modules (hangs snmpwalk)
+ - set SNMP_TMPDIR_BASE (future use)
+
+2005-11-05 17:01 rstory
+
+ * snmplib/snmpUDPDomain.c:
+
+ I'll take my port numbers unsigned, please
+
+2005-11-05 16:40 rstory
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ include netinet/tcp_var.h, if available
+
+2005-11-05 16:38 tanders
+
+ * testing/TESTCONF.sh:
+
+ deliberately ignore ulimit failures
+
+2005-11-05 16:19 rstory
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ remove sys/socketvar.h, since mibII_common.h already has it
+
+2005-11-05 14:43 rstory
+
+ * configure.in:
+
+ - switch disman module list back to event-mib (still uses new code)
+ - remove event mib conflict check (handled by config_excludes)
+
+2005-11-05 14:41 rstory
+
+ * agent/mibgroup/disman/event-mib.h:
+
+ - centralize event mib requires in original event-mib.h
+ - default to re-writes
+ - whichever implementation is selected, config_exclude the other
+
+2005-11-05 14:40 rstory
+
+ * agent/mibgroup/disman/event.h:
+
+ - centralize event mib requires in original event-mib.h
+
+2005-11-05 13:15 tanders
+
+ * apps/snmpnetstat/main.c:
+
+ fix optProc signature
+
+2005-11-04 18:46 tanders
+
+ * apps/snmpnetstat/inet6.c:
+
+ Build fix: protect #include <sys/cdefs.h>
+
+2005-11-04 13:05 rstory
+
+ * apps/snmpnetstat/route.c:
+
+ remove redundant include
+
+2005-11-04 13:05 rstory
+
+ * apps/snmpnetstat/netstat.h:
+
+ check if we have header before including it
+
+2005-11-04 11:59 dts12
+
+ * apps/snmpnetstat/: main.c, netstat.h:
+
+ Move the option flag variable declarations into a code file.
+
+2005-11-04 11:51 dts12
+
+ * apps/snmpnetstat/inet6.c:
+
+ Poertability of 'sin6_len' field is unclear
+ (and it doesn't immediately seem to be needed)
+
+2005-11-04 11:44 rstory
+
+ * apps/snmpnetstat/netstat.h:
+
+ add void to empty prototype param list
+
+2005-11-04 09:45 dts12
+
+ * configure.in, configure:
+
+ Detect (and reject) use of conflicting Event-MIB implementations.
+
+2005-11-04 07:41 dts12
+
+ * apps/snmpnetstat/: inet6.c, main.c, main.h,
+ netstat.h:
+
+ Preliminary implementation of IPv6 support
+
+2005-11-04 07:31 dts12
+
+ * apps/snmpnetstat/inet.c:
+
+ Plug minor memory leak.
+
+2005-11-03 20:02 hardaker
+
+ * perl/TrapReceiver/perl_snmptrapd.h:
+
+ update .h from the trapd.h files
+
+2005-11-03 19:59 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ make perl only require the execute bit
+
+2005-11-03 11:52 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ adjust to new snmpnetstat options
+
+2005-11-03 11:47 dts12
+
+ * apps/snmpnetstat/: inet6.c, main.c, route.c:
+
+ Ensure IPv6 code is omitted (until it can be properly ported/tested)
+
+2005-11-03 11:46 dts12
+
+ * apps/snmpnetstat/main.c:
+
+ Omit redundent declarations.
+
+2005-11-03 11:28 dts12
+
+ * apps/snmpnetstat/inet.c:
+
+ Remove code for determining RPC service names
+ (not relevant/appropriate for SNMP-based queries)
+
+2005-11-03 08:58 dts12
+
+ * apps/snmpnetstat/route.c:
+
+ Better handling of host-specific routes, and displaying gateway/host names.
+
+2005-11-03 07:21 dts12
+
+ * apps/snmpnetstat/: main.c, route.c:
+
+ Re-implement routing table display (based on OpenBSD code)
+
+2005-11-03 07:19 dts12
+
+ * apps/snmpnetstat/if.c:
+
+ Fix problems with repeated interface display.
+
+2005-11-02 16:21 rstory
+
+ * apps/snmpnetstat/route.c:
+
+ move include after net-snmp-includes.h; fix global session name
+
+2005-11-02 12:07 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.h:
+
+ remove bogus experimental config macro
+
+2005-11-02 12:06 rstory
+
+ * agent/mibgroup/examples/watched.h:
+
+ add missing semi-colon
+
+2005-11-02 09:25 dts12
+
+ * apps/snmpnetstat/: if.c, inet.c, main.c,
+ main.h, netstat.h:
+
+ Preliminary re-implementation, based on re-distributable OpenBSD code.
+ (Note that if.c draws heavily on the FreeBSD interface display behaviour,
+ which is somewhat different to the Net/OpenBSD approach)
+
+2005-11-02 01:56 hardaker
+
+ * NEWS:
+
+ minor word twiddles
+
+2005-11-02 01:50 hardaker
+
+ * configure, configure.in, agent/snmp_perl.c:
+
+ fix embedded perl and ensure compilation failures if turned on but functions missing
+
+2005-11-01 15:24 hardaker
+
+ * local/mib2c:
+
+ don't add notify objects to the scalar list
+
+2005-11-01 04:02 tanders
+
+ * testing/TESTCONF.sh:
+
+ more portable way of calling ulimit
+
+2005-10-31 07:40 tanders
+
+ * include/net-snmp/system/osf5.h:
+
+ Tru64 Unix 5.1 build fix: make sure UINT32_MAX is defined
+
+2005-10-31 06:11 tanders
+
+ * dist/: nsb-nightly, nsb-package:
+
+ more portable way of calling bash
+
+2005-10-31 05:36 tanders
+
+ * snmplib/text_utils.c:
+
+ Solaris build fix: include limits.h for [U]LONG_MAX and LONG_MIN
+
+2005-10-31 04:29 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, apps/Makefile.depend
+, snmplib/Makefile.depend:
+
+ make depend
+
+2005-10-31 04:27 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3
+, netsnmp_agent_registry.3, netsnmp_agent_trap.3
+, netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3
+, netsnmp_bulk_to_next.3, netsnmp_cache_handler.3
+, netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_config.3,
+ netsnmp_read_only.3, netsnmp_row_merge.3,
+ netsnmp_scalar.3, netsnmp_scalar_group_group.3,
+ netsnmp_serialize.3, netsnmp_snmp_agent.3,
+ netsnmp_snmp_alarm.3, netsnmp_snmp_client.3,
+ netsnmp_snmp_logging.3, netsnmp_snmp_pdu.3,
+ netsnmp_snmp_session.3, netsnmp_stash_cache.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ documentation update
+
+2005-10-31 04:24 rstory
+
+ * configure, configure.in:
+
+ version update
+
+2005-10-31 04:14 rstory
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ patches from apple
+
+2005-10-31 04:01 rstory
+
+ * include/net-snmp/system/darwin7.h,
+ agent/mibgroup/ucd_snmp.h:
+
+ patches from apple
+
+2005-10-31 04:00 rstory
+
+ * agent/mibgroup/ucd-snmp/: memory_darwin7.c,
+ memory_darwin7.h, vmstat_darwin7.c, vmstat_darwin7.h
+:
+
+ memory/vmstats code from apple
+
+2005-10-31 03:48 rstory
+
+ * agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
+,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
+,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
+,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c
+,
+ agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
+, agent/mibgroup/udp-mib/data_access/udp_endpoint.h,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,
+ agent/mibgroup/udp-mib/data_access/udp_endpoint_private.h,
+ include/net-snmp/data_access/udp_endpoint.h:
+
+ first pass at udpEndpointTable
+
+2005-10-31 03:48 tanders
+
+ * testing/TESTCONF.sh:
+
+ set cpu and memory limits to prevent major damage, especially since we now have a full snmpwalk test
+
+2005-10-30 23:32 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
+:
+
+ quiet compiler
+
+2005-10-30 23:32 rstory
+
+ * agent/mibgroup/ip-mib/: data_access/ipaddress_ioctl.c,
+ ipAddressPrefixTable/ipAddressPrefixTable_data_access.c:
+
+ remove unused var
+
+2005-10-30 23:28 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c:
+
+ calculate prefix oid as needed
+
+2005-10-30 23:27 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ remove prefix oid; add prefix len
+
+2005-10-30 23:26 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c:
+
+ remove prefix oid
+
+2005-10-30 23:26 rstory
+
+ * include/net-snmp/data_access/ipaddress.h:
+
+ - get rid of prefix oid
+ - add prefix len
+ - add prefix function prototypes
+
+2005-10-30 22:45 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c:
+
+ - don't use test correct flag bit
+ - add prefix utility routines
+
+2005-10-30 22:41 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
+:
+
+ add access to container
+
+2005-10-30 22:41 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
+:
+
+ do not use init flag with load routine
+
+2005-10-30 22:39 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ - remove inet6 code, since there we aren't using ipv6 ioctls
+ - add prefix len
+
+2005-10-30 22:37 rstory
+
+ * agent/mibgroup/ip-mib/: ipAddressTable.h,
+ ipAddressTable/ipAddressTable.h:
+
+ move detailed config_require macros down a level
+
+2005-10-30 22:37 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c:
+
+ use new util func to calculate prefix len
+
+2005-10-30 22:34 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ only check dirty flag for writable tables
+
+2005-10-30 22:33 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressPrefixTable/:
+ ipAddressPrefixTable.c, ipAddressPrefixTable.h,
+ ipAddressPrefixTable_constants.h,
+ ipAddressPrefixTable_data_access.c,
+ ipAddressPrefixTable_data_access.h,
+ ipAddressPrefixTable_interface.c,
+ ipAddressPrefixTable_interface.h:
+
+ initial pass at ipAddressPrefixTable
+
+2005-10-30 15:49 rstory
+
+ * include/net-snmp/types.h:
+
+ new netsnmp_cvalue union
+
+2005-10-30 15:49 rstory
+
+ * include/net-snmp/library/text_utils.h, snmplib/text_utils.c
+:
+
+ more new utility functions
+
+2005-10-30 14:01 rstory
+
+ * include/net-snmp/library/file_utils.h,
+ include/net-snmp/library/text_utils.h, snmplib/Makefile.in
+, snmplib/file_utils.c, snmplib/text_utils.c:
+
+ new util files
+
+2005-10-30 13:49 rstory
+
+ * snmplib/container_binary_array.c:
+
+ add support for unsorted flag
+
+2005-10-30 13:48 rstory
+
+ * snmplib/container.c:
+
+ - add compare function ptr to container type struct
+ - set compare func from container type struct
+ - register some string compare based binary array types
+
+2005-10-30 13:46 rstory
+
+ * include/net-snmp/library/container.h:
+
+ - new container register with compare prototype
+ - add unsorted container flag
+ - fix container options macros
+ - add rc param
+ - missing }
+
+2005-10-29 18:12 tanders
+
+ * testing/tests/T035snmpv3trapdusermgmt:
+
+ test change and usage of localized keys
+
+2005-10-29 17:29 tanders
+
+ * testing/tests/T059trapdtraphandle:
+
+ introduce snmptrapd traphandle test
+
+2005-10-29 15:58 tanders
+
+ * testing/tests/T200snmpv2cwalkall:
+
+ Introduce full snmpwalk test. Needs a significant amount of CPU cycles, but will catch important issues like when a simple walk crashes/hangs the agent.
+
+2005-10-29 08:17 rstory
+
+ * agent/mibgroup/examples/: data_set.h, delayed_instance.h
+, example.h, netSnmpHostsTable.h,
+ netSnmpHostsTable_access.h, netSnmpHostsTable_checkfns.h
+, netSnmpHostsTable_checkfns_local.h, notification.h
+, scalar_int.h, ucdDemoPublic.h:
+
+ add missing header protect and/or cplusplus ifdefs
+
+2005-10-29 08:16 rstory
+
+ * agent/mibgroup/examples/watched.h:
+
+ add missing header for watched.h
+
+2005-10-28 23:31 rstory
+
+ * agent/mibgroup/ip-mib/data_access/arp.h:
+
+ - remove extra ;
+ - fix typo in configure macro
+
+2005-10-28 23:30 rstory
+
+ * agent/mibgroup/if-mib/data_access/: interface_ioctl.c,
+ interface_ioctl.h:
+
+ reduce scope of ioctl version checking to v4 only (no ipv6 ioctls)
+
+2005-10-28 23:27 rstory
+
+ *
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h
+:
+
+ correct cut-n-paste error in prototype
+
+2005-10-28 23:26 rstory
+
+ *
+ agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c
+:
+
+ yank more code which is unused due to container sharing
+
+2005-10-28 23:25 rstory
+
+ * agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
+:
+
+ update for changed ifentry var names
+
+2005-10-28 23:25 rstory
+
+ * agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c
+:
+
+ skip vars that do not have ifentry flag set
+
+2005-10-28 23:24 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ - add missing flags param to arch container load
+ - support for ipv(4|6) only load flag
+ - try to load ipv6 even if ipv4 fails
+
+2005-10-28 23:22 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c:
+
+ pass correct flags to container init during load
+
+2005-10-28 23:21 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ include/net-snmp/data_access/interface.h:
+
+ tweaks and support for ipv6InterfaceTable
+
+2005-10-28 23:17 rstory
+
+ * include/net-snmp/data_access/ipaddress.h:
+
+ new load flags
+
+2005-10-28 23:17 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ add insert filtering
+
+2005-10-28 23:13 rstory
+
+ * agent/Makefile.in:
+
+ - reduce dependency list on snmp_vars.lo to agent_module_list_h
+ - add mib_module_list_h as dep for mib_modules.lo
+ - document why read_conf.lo deps are here and not in snmplib/Makefile.in
+
+2005-10-28 23:05 rstory
+
+ * agent/mibgroup/ip-mib/ipv6InterfaceTable/: ipv6InterfaceTable.c
+, ipv6InterfaceTable.h, ipv6InterfaceTable_constants.h
+, ipv6InterfaceTable_data_access.c,
+ ipv6InterfaceTable_data_access.h,
+ ipv6InterfaceTable_interface.c,
+ ipv6InterfaceTable_interface.h:
+
+ implement ipv6InterfaceTable
+
+2005-10-28 23:02 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ add shutdown prototype
+
+2005-10-28 18:38 tanders
+
+ * testing/tests/T030snmpv3usercreation:
+
+ portable way of exporting SNMPCONFPATH
+
+2005-10-28 17:28 bshaw666
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ logic change on getKstatInt
+
+2005-10-28 16:06 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ remove ; from config_require macros
+
+2005-10-28 15:47 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.c:
+
+ - move local include with other local includes
+ - ifdef proptypes that won't be defined for NOARCH case
+
+2005-10-28 15:40 bshaw666
+
+ * agent/mibgroup/if-mib/data_access/interface.c:
+
+ forgot the include for some netsnmp_arch_interface stuff
+
+2005-10-28 14:49 bshaw666
+
+ * agent/mibgroup/host/hr_network.c:
+
+ you can't not declare HRN_index for solaris then expect it to return a few lines later
+
+2005-10-28 14:20 bshaw666
+
+ * include/net-snmp/data_access/interface.h:
+
+ it's uint16_t not u_int16_t
+
+2005-10-28 12:55 tanders
+
+ * man/snmpusm.1.def:
+
+ update on -CE and -Ck
+
+2005-10-28 12:37 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h:
+
+ remove accidental checkin of unimplemented config macro
+
+2005-10-28 12:31 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-10-28 12:31 rstory
+
+ * configure.in:
+
+ add new argument to turn on debug during mib module processing
+
+2005-10-28 12:25 rstory
+
+ * agent/mibgroup/mibII/ipv6.h:
+
+ require mibII/ifTable instead of mibII/interfaces
+
+2005-10-28 12:11 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ - rename/revamp interface count function
+ - allocate local ifconf if called didn't pass on
+ - document that function allocates memory that caller must release if
+ they pass in their own ifconf pointer
+
+2005-10-28 12:08 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.h:
+
+ - remove ';' form config_* macros
+ - config_require ifTable, include ifTable header
+
+2005-10-28 12:06 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ call ifTable init to manage ifXTable init
+
+2005-10-28 12:03 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ - add calls to ipv(4|6) interface tables when updating rows
+ - correct ifTableLastChange behaviour to comply with object definition
+ - clarify some comments
+ - add assert to notify us when/if and os tracks last changed on it's own
+
+2005-10-28 12:00 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.h:
+
+ - fix config_require macros
+ - add require for data_access/interface
+ - remove last change from data context, use ifentry version instead
+
+2005-10-28 11:58 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ - make init_ifTable the common init function for interface modules
+ - protect against multiple calls
+ - proper init function calls for ipv(4|6)InterfaceTable/ifXTable
+
+2005-10-28 11:56 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ - move stats parsing to it's own function
+ - support new load flags: ipv4 only, no stats
+ - add (hardcoded reasm_max)
+ - get arp retransmit time from /proc
+
+2005-10-28 11:53 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.h:
+
+ add config_require of data_access/ipaddress
+
+2005-10-28 11:50 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c:
+
+ new function to check an interface for ipv(4|6) ip addresses
+
+2005-10-28 11:45 rstory
+
+ * include/net-snmp/data_access/interface.h:
+
+ - add warnings to update functions when adding/deleting stuct members
+ - make flags field unsigned
+ - unsigned int -> u_int
+ - add fields for ipv4InterfaceTable
+ - fix os_flags comment
+ - new ns_flags defines for ipv(4|6)InterfaceTable
+ - new load flags defines
+
+2005-10-28 11:37 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ rename to interface.c
+
+2005-10-28 11:36 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.c:
+
+ rename interface_common.c to interface.c to easy configure processing
+
+2005-10-28 11:36 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ - revert to previous behavior of ifDescr = interface name
+ - add new/missing structure members to interface copy routine
+ - rename init function for pending file rename
+
+2005-10-28 11:29 rstory
+
+ * agent/mibgroup/: if-mib/ifTable.h, if-mib/ifXTable.h,
+ if-mib/data_access/interface.h,
+ if-mib/data_access/interface_ioctl.h,
+ ip-forward-mib/inetCidrRouteTable.h,
+ ip-forward-mib/ipCidrRouteTable.h,
+ ip-forward-mib/data_access/route.h,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h,
+ ip-mib/inetNetToMediaTable.h, ip-mib/ipAddressTable.h
+, ip-mib/ipSystemStatsTable.h, ip-mib/ip_scalars.h
+, ip-mib/data_access/ipaddress.h,
+ ip-mib/data_access/ipaddress_ioctl.h,
+ ip-mib/data_access/ipaddress_linux.h,
+ ip-mib/data_access/scalars_common.h,
+ ip-mib/data_access/systemstats.h,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+, tcp-mib/tcpConnTable.h, tcp-mib/tcpConnectionTable.h
+, tcp-mib/data_access/tcpConn.h,
+ tcp-mib/tcpConnectionTable/tcpConnectionTable.h,
+ tcp-mib/tcpListenerTable/tcpListenerTable.h:
+
+ - mostly removing extraneous ';' on config_* macros
+ - a few tweak config_* macros
+
+2005-10-28 11:18 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-10-28 11:17 rstory
+
+ * configure.in:
+
+ - check for program 'find'
+ - only add header to (agent|mib)_module_includes.h if init/shutdown found
+
+2005-10-28 10:26 tanders
+
+ * dist/: README.build-scripts, nsb-nightly,
+ nsb-package:
+
+ fix typo
+
+2005-10-28 09:25 rstory
+
+ * agent/mibgroup/ip-mib/ipv4InterfaceTable/: ipv4InterfaceTable.c
+, ipv4InterfaceTable.h, ipv4InterfaceTable_constants.h
+, ipv4InterfaceTable_data_access.c,
+ ipv4InterfaceTable_data_access.h,
+ ipv4InterfaceTable_interface.c,
+ ipv4InterfaceTable_interface.h,
+ ipv4InterfaceTable_subagent.c:
+
+ implement ipv4InterfaceTable
+
+2005-10-28 08:13 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ make sure snmpnetstat can be executed; skip otherwise
+
+2005-10-27 05:42 dts12
+
+ * snmplib/: getopt.c, strtol.c, strtoul.c:
+
+ Remove UCB advertising clause (rescinded 22 July 1999)
+
+2005-10-27 05:38 dts12
+
+ * apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/inet6.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/route.c, man/snmpnetstat.1.def:
+
+ Update BSD copyright license with the current version.
+
+2005-10-26 18:54 tanders
+
+ * testing/tests/T160snmpnetstat:
+
+ add simple test for snmpnetstat to verify the upcoming rewrite
+
+2005-10-26 18:34 tanders
+
+ * testing/tests/T030snmpv3usercreation:
+
+ skip on DISABLE_SET_SUPPORT
+
+2005-10-26 17:47 tanders
+
+ * man/snmpd.8.def:
+
+ document generic --<name>=<value> command-line option
+
+2005-10-26 17:22 tanders
+
+ * man/snmptrapd.8.def:
+
+ document generic --<name>=<value> command-line option
+
+2005-10-26 13:15 tanders
+
+ * apps/snmpusm.c:
+
+ allows to use old and/or new localized key instead of pass-phrase with -Ck
+
+2005-10-26 12:26 tanders
+
+ * testing/tests/T030snmpv3usercreation:
+
+ major rewrite: adds more tests and uses new Sv3usmconfig*
+
+2005-10-26 12:23 tanders
+
+ * testing/tests/Sv3usmconfigbase:
+
+ fix some variable names
+
+2005-10-26 08:21 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ remove patch flub
+
+2005-10-26 07:07 dts12
+
+ * agent/helpers/cache_handler.c:
+
+ Extra debugging to help distinguish between different cache timers.
+
+2005-10-26 07:02 dts12
+
+ * agent/helpers/table_generic.c:
+
+ Slight rethink about how to handle the removal of a MIB registration.
+ (This is definitely one for 5.4, methinks!)
+
+2005-10-26 06:57 dts12
+
+ * agent/helpers/table_generic.c:
+
+ Minor tweaks to generic table API routine names.
+
+2005-10-26 06:56 dts12
+
+ * agent/helpers/table_tdata.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteEventConf.c,
+ agent/mibgroup/disman/event/mteEventNotificationTable.c,
+ agent/mibgroup/disman/event/mteEventSetTable.c,
+ agent/mibgroup/disman/event/mteEventTable.c,
+ agent/mibgroup/disman/event/mteObjects.c,
+ agent/mibgroup/disman/event/mteObjectsConf.c,
+ agent/mibgroup/disman/event/mteObjectsTable.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/event/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/event/mteTriggerConf.c,
+ agent/mibgroup/disman/event/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/event/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/event/mteTriggerTable.c,
+ agent/mibgroup/disman/event/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/expr/expErrorTable.c,
+ agent/mibgroup/disman/expr/expExpression.c,
+ agent/mibgroup/disman/expr/expExpressionConf.c,
+ agent/mibgroup/disman/expr/expExpressionTable.c,
+ agent/mibgroup/disman/expr/expObject.c,
+ agent/mibgroup/disman/expr/expObjectConf.c,
+ agent/mibgroup/disman/expr/expObjectTable.c,
+ agent/mibgroup/disman/expr/expValue.c,
+ agent/mibgroup/disman/schedule/schedConf.c,
+ agent/mibgroup/disman/schedule/schedCore.c,
+ agent/mibgroup/disman/schedule/schedTable.c,
+ include/net-snmp/agent/table_tdata.h:
+
+ Bring 'tdata' routine names into line with the proposed table API
+
+2005-10-26 06:20 tanders
+
+ * agent/mibgroup/host/hr_network.c:
+
+ fix compile error due to wrong hpux11 test
+
+2005-10-26 05:48 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Move registration of standard views so that they're picked up
+ by both agent and trap handler initialisation.
+ Clarify which initialisation routines are called by which apps.
+
+2005-10-25 19:08 tanders
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ temporary workaround as suggested by Dave to get snmptrapd working again
+
+2005-10-25 19:05 rstory
+
+ * agent/helpers/row_merge.c:
+
+ - narrow scope of assert test
+ - fix minor memory leak
+
+2005-10-25 16:56 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-10-25 16:55 rstory
+
+ * configure.in:
+
+ fix tests for empty var case
+
+2005-10-25 12:41 tanders
+
+ * testing/tests/T049snmpv3inform:
+
+ ... and say so.
+
+2005-10-25 12:40 tanders
+
+ * testing/tests/T049snmpv3inform:
+
+ clarify as being a noAuthNoPriv test
+
+2005-10-25 11:59 tanders
+
+ * configure, configure.in:
+
+ fix OpenBSD 3.4 "present but cannot be compiled" warning: sys/swap.h needs sys/param.h for MAXPATHLEN
+
+2005-10-25 11:52 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ remove MFD_REWRITE define tests
+
+2005-10-25 11:51 rstory
+
+ * agent/mibgroup/mibII/interfaces.h:
+
+ - comment formatting
+ - config_exclude if-mib/ifTable/ifTable
+
+2005-10-25 11:49 rstory
+
+ * include/net-snmp/library/container.h:
+
+ add ITERATOR_RELEASE macro
+
+2005-10-25 08:38 dts12
+
+ * agent/mibgroup/mibII/: vacm_conf.c, vacm_conf.h:
+
+ Alternative viewtype-based access configuration directive ("authaccess").
+ Similar to "setaccess", but closer in feel to the other auth* directives.
+ This also allows the security model, level and context information to be
+ omitted (defaulting to sensible values).
+
+2005-10-25 08:31 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Arggghhhh!!! If you've got code that works, don't change it before committing it.
+ If you *must* change it, then at least have the gumption to test it again first!
+ <heavy sigh>
+
+2005-10-25 08:01 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Tell you what, Dave. Why don't you try committing the code for the
+ "authgroup" directive - rather than just the header file?
+ <sigh>
+ You just can't get the staff these days.
+
+2005-10-25 07:58 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.h:
+
+ Directive to support viewtype-based configuration of groups ("authgroup")
+
+2005-10-25 07:51 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Allow community-based directives (authcommunity, etc) to specify
+ a particular SNMP version (v1-only or v2c-only)
+
+2005-10-25 07:47 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Support simple access directives configured with named views (-V)
+ as well as OID subtrees.
+
+2005-10-25 07:42 dts12
+
+ * agent/mibgroup/mibII/: vacm_conf.c, vacm_conf.h:
+
+ Define "standard" views (all or nothing)
+
+2005-10-25 07:39 dts12
+
+ * snmplib/mib.c:
+
+ Work with the active root of the MIB tree (rather than the backward
+ compatibility version). This allows 'read_objid' to work correctly
+ (with numeric OIDs) before the MIB files are loaded.
+
+2005-10-24 19:31 tanders
+
+ * testing/tests/T035snmpv3trapdusermgmt:
+
+ reworked to use new Sv3usmconfig* framework
+
+2005-10-24 19:30 tanders
+
+ * testing/tests/: T049snmpv3informauth, T049snmpv3informpriv
+:
+
+ SNMPv3 authNoPriv/authPriv INFORM tests based on new Sv3usmconfig*
+
+2005-10-24 19:27 tanders
+
+ * testing/tests/: Sv3usmconfigagent, Sv3usmconfigbase,
+ Sv3usmconfigtrapd:
+
+ rewritten SNMPv3 USM config: basic, agent, trapd
+
+2005-10-24 19:04 hardaker
+
+ * agent/helpers/table_data.c:
+
+ Fix for compilation issues:
+ - rearrange function order to get proper prototype ordering without
+ prototypes.
+ - Removed data type for a variable name that was getting passed in
+ as well.
+
+2005-10-24 18:40 rstory
+
+ * agent/mibgroup/mibII/at.c:
+
+ use netsnmp_access_interface_index_find instead of Interface_Index_By_Name
+
+2005-10-24 18:39 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_interface.c:
+
+ remove MFD_REWRITE check, use USING_MIBII_INTERFACES_MODULE instead
+
+2005-10-24 18:38 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.h:
+
+ config_exclude mibII/interfaces
+
+2005-10-24 18:37 rstory
+
+ * agent/mibgroup/mibII.h:
+
+ - require new mibII/ifTable instead of mibII/interfaces
+ - remove MFD_REWRITE check
+ - consolidate linux requires to one line
+
+2005-10-24 18:36 rstory
+
+ * agent/mibgroup/host/hr_network.c:
+
+ fix ifIndex mis-match (add support for netsnmp_interface_entry)
+
+2005-10-24 18:34 rstory
+
+ * agent/mibgroup/host/hr_network.h:
+
+ - require new mibII/ifTable instead of mibII/interfaces
+ - require host/hr_device too, since it declares globals we need
+
+2005-10-24 18:17 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ - implement backwards compatability functions Interface_Scan_(Init|Next) so
+ all modules can agree on ifIndex values
+
+2005-10-24 17:52 rstory
+
+ * snmplib/container_binary_array.c:
+
+ fix cut-n-paste bug in iterator; reset ptr overwritten by release
+
+2005-10-24 16:28 hardaker
+
+ * apps/snmptrapd_handlers.c:
+
+ drop packets with session errnos attached to them
+
+2005-10-24 13:47 rstory
+
+ * agent/mibgroup/mibII/var_route.h:
+
+ remove MFD rewrite gyrations
+
+2005-10-24 13:44 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-10-24 13:43 rstory
+
+ * configure.in:
+
+ add tests for invalid options (miniagent)
+
+2005-10-24 13:42 rstory
+
+ * snmplib/read_config.c:
+
+ add details to log/debug message
+
+2005-10-24 13:40 rstory
+
+ * agent/mibgroup/mibII/ip.h:
+
+ use new mibII/ifTable in place of mibII/interfaces
+
+2005-10-24 13:38 rstory
+
+ * agent/mibgroup/mibII/ifTable.h:
+
+ new module for other modules to reference, in place of mibII/interfaces
+
+2005-10-24 13:29 rstory
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ fix ifIndex lookup on linux (use netsnmp_access_interface_index_find)
+
+2005-10-24 11:48 dts12
+
+ * agent/helpers/table_iterator.c,
+ include/net-snmp/agent/table_iterator.h:
+
+ Generic table API: "Row operations" (experimental implementation)
+
+2005-10-24 11:16 tanders
+
+ * testing/eval_tools.sh:
+
+ introduce SKIP()
+
+2005-10-24 10:19 tanders
+
+ * testing/tests/: Sv3DESconfig, Sv3SHADESconfig:
+
+ remove obsolete SNMPv3 config files
+
+2005-10-24 07:02 dts12
+
+ * agent/helpers/table_data.c:
+
+ Generic table API: Row operations
+
+2005-10-24 06:58 dts12
+
+ * local/snmpdump.pl:
+
+ For Thomas
+
+2005-10-24 06:54 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Provisional implementation of the "Table maintenance" generic API.
+ Most of this is not really applicable to the iterator helper, but
+ having a standard mechanism for constructing (and freeing) the
+ main iterator structure might be useful.
+
+2005-10-24 06:22 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Count the number of rows in an iterator-based table.
+
+2005-10-24 06:18 dts12
+
+ * agent/helpers/table_iterator.c,
+ include/net-snmp/agent/table_iterator.h:
+
+ Associate table index information with the iterator structure.
+ (Experimental code - introduces a minor one-off memory leak,
+ but shouldn't otherwise affect existing code)
+
+2005-10-23 20:11 tanders
+
+ * testing/tests/T035snmpv3trapdusermgmt:
+
+ initial test for SNMPv3 snmptrapd USM user management with snmpusm
+
+2005-10-23 19:57 tanders
+
+ * testing/eval_tools.sh:
+
+ fix CHECKAGENT() and introduce CHECKTRAPDORDIE()
+
+2005-10-23 19:45 tanders
+
+ * snmplib/snmpv3.c:
+
+ fix typo
+
+2005-10-23 15:15 rstory
+
+ * snmplib/container_binary_array.c:
+
+ flags support; default to no duplicate keys
+
+2005-10-23 15:13 rstory
+
+ * include/net-snmp/library/container.h:
+
+ tweak options function to allow test and set
+
+2005-10-23 15:04 rstory
+
+ * include/net-snmp/library/container.h:
+
+ add function to set container options
+
+2005-10-22 18:26 tanders
+
+ * testing/: TESTCONF.sh, tests/Sv3config,
+ tests/Sv3vacmconfig, tests/Svacmconfig,
+ tests/Svanyconfig:
+
+ fix typo in variable name
+
+2005-10-22 18:14 tanders
+
+ * testing/eval_tools.sh:
+
+ replace obsolete snmptrapd "-u" flag by "-p"
+
+2005-10-22 18:12 tanders
+
+ * agent/mibgroup/ip-mib/.cvsignore:
+
+ ip-mib changes now require .cvsignore
+
+2005-10-22 18:04 tanders
+
+ * testing/tests/Sv3configsha:
+
+ obsoleted by Sv3config
+
+2005-10-22 00:54 hardaker
+
+ * testing/tests/: T057trapdauthtest, T057trapdauthtest2
+, T057trapdauthtest3:
+
+ proper checks for failure of unauthorized traps
+
+2005-10-22 00:51 hardaker
+
+ * testing/tests/T057trapdauthtest2:
+
+ test for wrong trap oids
+
+2005-10-22 00:47 hardaker
+
+ * testing/tests/: T049snmpv3inform, T050snmpv3trap,
+ T051snmpv2ctrap, T052snmpv2cinform, T053agentv1trap
+, T054agentv2ctrap, T055agentv1mintrap,
+ T056agentv2cmintrap, T058agentauthtrap,
+ T113agentxtrap:
+
+ new config tokens round 2
+
+2005-10-22 00:46 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_conf.h, apps/snmptrapd_auth.c
+:
+
+ Do trap auth parsing the way Dave wants.
+
+2005-10-21 20:30 rstory
+
+ * NEWS:
+
+ note new helper and scalars
+
+2005-10-21 20:27 rstory
+
+ * agent/mibgroup/ip-mib.h:
+
+ add new IP-MIB scalars
+
+2005-10-21 20:26 rstory
+
+ * include/net-snmp/data_access/ip_scalars.h:
+
+ data access for some IP-MIB scalars
+
+2005-10-21 20:25 rstory
+
+ * agent/mibgroup/ip-mib/data_access/: scalars_common.h,
+ scalars_linux.c:
+
+ data access for linux scalars
+
+2005-10-21 20:24 rstory
+
+ * agent/mibgroup/ip-mib/: ip_scalars.c, ip_scalars.h:
+
+ some new scalars in the IP-MIB
+
+2005-10-21 20:22 rstory
+
+ * agent/helpers/instance.c,
+ include/net-snmp/agent/instance.h:
+
+ - new helper for rw access to an integer based variable which is stored
+ as ascii in a file
+
+2005-10-21 18:31 tanders
+
+ * apps/snmpusm.c, man/snmpusm.1.def:
+
+ Add "-CE ENGINE-ID" option to specify the usmUserEngineID. Enables snmpusm to manage snmptrapd's usmUserTable (fixes bug #1333655).
+
+2005-10-21 18:04 rstory
+
+ * snmplib/callback.c:
+
+ - fix fun comment header for doxygen (keep wes happy)
+ - document slightly non-obvious index use (keep dave happy)
+
+2005-10-21 12:29 alex_b
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Apply patch 1299554 from Tao to fix segfault in var_ifEntry()
+
+2005-10-21 06:55 dts12
+
+ * agent/mibgroup/disman/schedule/schedConf.c:
+
+ More portable handling of 'overshoot' declaration.
+
+2005-10-21 06:53 dts12
+
+ * agent/helpers/: table_container.c, table_data.c,
+ table_iterator.c:
+
+ Preliminary implementation of the "Table maintenance" section
+ of the generic table API.
+
+2005-10-21 06:49 dts12
+
+ * agent/helpers/table_generic.c:
+
+ Minor tweaks to generic table API names,
+ and correct a couple of flawed function prototypes.
+
+2005-10-21 05:22 tanders
+
+ * dist/nsb-functions:
+
+ more generalized exception regex to let any "testing ... failure ..." go through, e.g. the new snmptrapd test recently introduced
+
+2005-10-21 01:53 hardaker
+
+ * snmplib/snmp_api.c:
+
+ init vacm
+
+2005-10-21 01:42 hardaker
+
+ * apps/snmptrapd_log.h:
+
+ include the new snmptrapd_ds.h file
+
+2005-10-21 01:41 hardaker
+
+ * include/net-snmp/agent/ds_agent.h:
+
+ Added a warning note about potential conflicts with snmptrapd, which
+ had actually been bypassed recently and no one noticed.
+
+2005-10-21 01:41 hardaker
+
+ * testing/tests/T057trapdauthtest:
+
+ test trapd authorization failures
+
+2005-10-21 01:40 hardaker
+
+ * testing/tests/: T049snmpv3inform, T050snmpv3trap,
+ T051snmpv2ctrap, T052snmpv2cinform, T053agentv1trap
+, T054agentv2ctrap, T055agentv1mintrap,
+ T056agentv2cmintrap, T058agentauthtrap,
+ T113agentxtrap:
+
+ Modified the tests to accommodate the new trapd auth scheme
+
+2005-10-21 01:38 hardaker
+
+ * apps/: Makefile.in, snmptrapd.c, snmptrapd_auth.c
+, snmptrapd_auth.h, snmptrapd_ds.h,
+ snmptrapd_handlers.c, snmptrapd_handlers.h:
+
+ Added a new authorization handler and related configuration tokens to
+ allow snmptrapd to accept or drop notifications based on the
+ authorization assigned to a community/user paired with the action to
+ be taken (log, forward, execute). There are a number of configuration
+ tokens that were added to achieve this. 3 of the VACM ones can be
+ used as normal (view, com2sec, group) and one additional one
+ (setaccess) needs to be used to set individual views for access to
+ bind everything together. There are a number of convenience wrappers
+ as well for these token sets. Finally, there is a
+ disableAuthorization token that can be set to true to simply allow
+ everything through.
+
+2005-10-21 01:29 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_conf.h,
+ agent/mibgroup/mibII/vacm_vars.c,
+ include/net-snmp/library/vacm.h, snmplib/vacm.c:
+
+ - restructured the VACM code to provide for the notion of additional
+ views besides the standard read/write/notify views
+ - much of the checking code was restructured to be more modular
+ - added a new setaccess config token that can set the view name for
+ a particular access level
+ - added 3 new access levels: log, execute, net
+ - added enum structure for these
+
+2005-10-20 13:22 tanders
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ fix remaining IP address byte order bug
+
+2005-10-20 08:26 dts12
+
+ * mibs/Makefile.in:
+
+ Install the Event MIB.
+
+ (Qn: where does 'default_mibs_install' get set?)
+
+2005-10-20 08:25 dts12
+
+ * configure, configure.in:
+
+ Add schedule MIB implementation to the default list.
+
+ This qualifies for both:
+ 'Traditionally it's been "turn it on if it compiles 100%
+ of the time....'
+ since it's all non-architecture-specific code, and:
+ '... and if it requires run time enabling as well"
+
+2005-10-20 08:03 dts12
+
+ * agent/mibgroup/disman/event.h:
+
+ Add the Event MIB to the list of MIBs to load.
+
+2005-10-20 07:33 rstory
+
+ * testing/RUNTESTS:
+
+ - rmdir -> rm -fR, since directory isn't empty
+ - add -p/SNMP_TEST_PREFIX to allow non-standard tests to be run
+
+2005-10-20 05:31 tanders
+
+ * Makefile.in:
+
+ propagate test-mibs target
+
+2005-10-20 04:31 tanders
+
+ * dist/nsb-functions:
+
+ further tweak exception regex
+
+2005-10-19 23:36 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable_constants.h,
+ ifTable_data_access.c, ifTable_interface.c,
+ ifTable_interface.h:
+
+ add ifTableLastChange scalar
+
+2005-10-19 17:59 tanders
+
+ * configure.in:
+
+ document that --enable-embedded-perl affects snmptrapd also
+
+2005-10-19 11:01 rstory
+
+ * dist/nsb-functions:
+
+ tweak error regexp exceptions
+
+2005-10-19 07:04 dts12
+
+ * agent/helpers/all_helpers.c:
+
+ Withdraw 'table_dataset2' helper
+
+2005-10-19 01:14 hardaker
+
+ * man/snmptrapd.conf.5.def:
+
+ add 'default' as the oid for execing the example traphandle
+
+2005-10-19 01:06 hardaker
+
+ * agent/agent_trap.c:
+
+ Fix bug #1313667: informs are sent asychronously to avoid crashing the agent when the receiver is down
+
+2005-10-18 22:24 alex_b
+
+ * win32/dist/: README.build.win32.txt, README.txt,
+ installer/net-snmp.nsi:
+
+ Win32: Rename Net-SNMP.ppd to NetSNMP.ppd, add a couple
+ header files to Win32 uninstaller.
+
+2005-10-18 18:22 tanders
+
+ * apps/snmptrapd.c:
+
+ add #ifdefs for MIB module dependent code
+
+2005-10-18 17:11 rstory
+
+ * agent/helpers/table_dataset.c:
+
+ fix index generation for fixed length octet strings
+
+2005-10-18 12:00 dts12
+
+ * agent/helpers/Makefile.in, agent/helpers/table_dataset2.c
+, include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/table_dataset2.h,
+ win32/libhelpers/Makefile.in,
+ win32/libhelpers/libhelpers.dsp:
+
+ Withdraw 'table_dataset2' helper.
+
+2005-10-18 11:55 dts12
+
+ * agent/mibgroup/disman/: mteEventNotificationTable.c,
+ mteEventNotificationTable.h, mteEventTable.c:
+
+ Revert to original 'table_dataset' helper.
+
+2005-10-18 11:43 rstory
+
+ * README.osX:
+
+ sync readme in all branches
+
+2005-10-18 11:33 dts12
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ Revert to using the original 'table_dataset' helper.
+
+2005-10-18 11:32 dts12
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ Provide missing table-traversal routines.
+
+2005-10-18 10:51 dts12
+
+ * agent/mibgroup/disman/schedule/schedConf.h:
+
+ Oops! One location change got overlooked!
+
+2005-10-18 10:43 rstory
+
+ * dist/nsb-functions:
+
+ make greps for error case insensitive
+
+2005-10-18 10:30 rstory
+
+ * snmplib/Makefile.in:
+
+ do not install removed/redundant header
+
+2005-10-18 10:23 dts12
+
+ * agent/helpers/Makefile.in, agent/helpers/table_data2.c
+, agent/helpers/table_tdata.c,
+ include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/table_data2.h,
+ include/net-snmp/agent/table_tdata.h,
+ win32/libhelpers/Makefile.in:
+
+ Rename 'table_data2' helper as 'table_tdata'
+
+2005-10-18 07:41 dts12
+
+ * agent/helpers/table_data2.c, agent/helpers/table_dataset2.c
+, include/net-snmp/agent/table_data2.h:
+
+ Prepare the way for renaming 'table_data2' more sensibly.
+
+2005-10-18 07:38 dts12
+
+ * agent/helpers/table_data2.c,
+ agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteObjects.c,
+ agent/mibgroup/disman/event/mteTrigger.c,
+ agent/mibgroup/disman/expr/expExpression.c,
+ agent/mibgroup/disman/expr/expObject.c,
+ include/net-snmp/agent/table_data2.h:
+
+ Remove unwanted vestigates of 'table_data' structures, and bring
+ table creation more closely into line with the generic API template.
+
+2005-10-18 07:23 dts12
+
+ * agent/mibgroup/utilities/iquery.c:
+
+ Missing return value.
+
+2005-10-18 07:21 dts12
+
+ * agent/mibgroup/disman/event/mteObjects.c:
+
+ Missing return values.
+
+2005-10-18 07:20 dts12
+
+ * agent/mibgroup/disman/event/mteEvent.c:
+
+ If no iquery session is configured for a particular event,
+ try the settings from the trigger, before falling back to
+ the default internal query session.
+
+2005-10-18 07:18 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Use 'iquerySecName' settings at configure time, rather than when
+ the trigger is actually invoked. This allows:
+ iquerySecName me
+ monitor myMonitor .....
+ monitor myOtherMonitor .....
+ iquerySecName you
+ monitor yourMonitor .....
+ to work in the most natural manner.
+ If no iquery security name is available at configure time,
+ this will be evaluated at run time instead.
+
+2005-10-18 07:07 dts12
+
+ * agent/mibgroup/disman/: schedConf.c, schedConf.h,
+ schedCore.c, schedCore.h, schedTable.c,
+ schedTable.h:
+
+ Remove previous Schedule MIB implementation.
+
+2005-10-18 07:06 dts12
+
+ * agent/mibgroup/disman/: schedule.h, schedule/.cvsignore
+, schedule/schedConf.c, schedule/schedConf.h,
+ schedule/schedCore.c, schedule/schedCore.h,
+ schedule/schedTable.c, schedule/schedTable.h:
+
+ Re-worked Schedule MIB implementation.
+ Cleaner, leaner, and more complete.
+ Now with added vitamins.
+
+2005-10-17 18:24 rstory
+
+ * snmplib/callback.c:
+
+ add move verbose debugging; init inner loop counter after each iteration
+
+2005-10-17 17:02 rstory
+
+ * testing/TESTCONF.sh:
+
+ portable export of env var
+
+2005-10-17 16:56 nba
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Fix a flipping lo interface by fixing getKstatInt to do as documented
+
+2005-10-17 14:17 rstory
+
+ * agent/helpers/table_container.c:
+
+ add prototype before use; check status of correct struct member
+
+2005-10-17 12:52 rstory
+
+ * README.osX:
+
+ - note ld flags for 10.4.x building w/perl
+
+2005-10-17 11:31 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Ensure the event name buffer is properly cleared before use.
+
+2005-10-17 07:36 dts12
+
+ * agent/helpers/table_container.c,
+ agent/helpers/table_data.c, agent/helpers/table_data2.c
+, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c,
+ include/net-snmp/agent/table_container.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_data2.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_iterator.h:
+
+ Modify existing table helpers in line with the proposed generic API.
+
+ This does *NOT* change any existing code (at least not intentionally),
+ or add any of the "missing" API routines. I've simply re-shuffled
+ the order of the existing routines to match the generic template.
+
+2005-10-17 07:29 dts12
+
+ * agent/helpers/table_generic.c:
+
+ Proper definition/documentation of a generic table API framework.
+ The exact details may not be directly appropriate in full for every
+ table helper, but this should provde a useful basic design template.
+
+2005-10-17 00:09 hardaker
+
+ * configure, configure.in:
+
+ removed forced debugging output
+
+2005-10-14 19:37 bshaw666
+
+ * configure, configure.in:
+
+ autoconf recognition
+
+2005-10-14 18:45 tanders
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in,
+ mibs/NET-SNMP-TC.txt:
+
+ support NetBSD 1.x and 2.x under the (common) "netbsd" sysObjectID.0
+
+2005-10-14 17:20 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ - update comments and debug messages
+ - don't release row on err (it's still in the container!)
+ - don't insert row on success (it's already in the container!)
+
+2005-10-14 17:07 rstory
+
+ * agent/: snmp_agent.c, mibgroup/util_funcs.c,
+ mibgroup/utilities/iquery.c:
+
+ replace hardcoded "snmpd" w/NETSNMP_DS_LIB_APPTYPE
+
+2005-10-14 11:25 tanders
+
+ * apps/snmptrapd.c:
+
+ register the snmpEngine MIB group under the "snmptrapd" context to allow for engineID probes via the master agent, e.g. by snmpusm
+
+2005-10-14 11:25 tanders
+
+ * agent/mibgroup/snmpv3/: snmpEngine.c, snmpEngine.h:
+
+ allow subagents (like snmptrapd) to register the snmpEngine MIB group under a context by introducing register_snmpEngine_scalars_context()
+
+2005-10-14 09:55 dts12
+
+ * agent/mibgroup/disman/: expression.h, expr/.cvsignore
+, expr/expErrorTable.c, expr/expErrorTable.h,
+ expr/expExpression.c, expr/expExpression.h,
+ expr/expExpressionConf.c, expr/expExpressionConf.h,
+ expr/expExpressionTable.c, expr/expExpressionTable.h,
+ expr/expObject.c, expr/expObject.h,
+ expr/expObjectConf.c, expr/expObjectConf.h,
+ expr/expObjectTable.c, expr/expObjectTable.h,
+ expr/expScalars.c, expr/expScalars.h, expr/expValue.c
+, expr/expValue.h, expr/expValueTable.c,
+ expr/expValueTable.h:
+
+ Preliminary (re-)implementation of the Expression MIB.
+ The expExpressionTable and expObjectTable are reasonably complete.
+ The expValueTable (and expression evaluation) is still just a
+ basic framework - expressions are displayed rather than evaluated.
+ And there's no user-level configuration of expressions yet.
+
+ But there's enough working code to be worth committing - even if
+ only as a safety mechanism.
+
+2005-10-13 17:07 rstory
+
+ * agent/helpers/table.c:
+
+ fix sparse handler case: no more rows, last column
+
+2005-10-13 12:49 rstory
+
+ * agent/helpers/table_dataset.c:
+
+ - fix table token table indexes for augmented table
+ - tweak debug
+ - add warning if too much data specified for add_row
+
+2005-10-13 11:28 rstory
+
+ * dotgdbinit:
+
+ add printindex for netsnmp_index structs
+
+2005-10-13 10:12 rstory
+
+ * dist/nsb-functions:
+
+ configure prefix (instead of using install prefix=)
+
+2005-10-13 05:15 dts12
+
+ * configure, configure.in:
+
+ Switch to using the new Event-MIB implementation by default.
+
+ The previous version is still available for those that prefer
+ to use that, but I'm sure someone will complain anyway:-(
+
+2005-10-12 18:59 tanders
+
+ * acconfig.h:
+
+ openbsd sysObjectID.0 for OpenBSD 3.x
+
+2005-10-12 18:16 tanders
+
+ * configure, configure.in, net-snmp-config.in
+:
+
+ enhance recently introduced "net-snmp-config --snmpconfpath" to output full config path
+
+2005-10-12 10:46 rstory
+
+ * man/Makefile.in:
+
+ def files are in srcdir
+
+2005-10-12 06:28 rstory
+
+ * snmplib/asn1.c:
+
+ change no-op macro def to empty isntead of (void)
+
+2005-10-11 19:17 rstory
+
+ * snmplib/asn1.c:
+
+ rework 64 bit overflow checking, accounting for signededness
+
+2005-10-11 16:30 rstory
+
+ * dist/nsb-functions:
+
+ fix variations in tail parameter format
+
+2005-10-11 14:53 rstory
+
+ * configure.in:
+
+ remove leftover EOF from rev 1.314
+
+2005-10-11 07:52 rstory
+
+ * dist/nsb-nightly:
+
+ ok, linux mail doesn't like [censored] solaris style; fix
+
+2005-10-11 07:49 rstory
+
+ * Makefile.in:
+
+ make sure net-snmp-config is executeable before building perl make files
+
+2005-10-11 05:27 dts12
+
+ * perl/: SNMP/examples/bulkwalk.pl,
+ SNMP/examples/trap-example.pl, SNMP/t/bulkwalk.t,
+ manager/manager.pm:
+
+ Be consistent in how various perl scripts are invoked.
+
+2005-10-10 19:42 tanders
+
+ * acconfig.h, mibs/NET-SNMP-TC.txt, ov/oid_to_sym.in
+, ov/oid_to_type.in:
+
+ add sysObjectID value for Mac OS X
+
+2005-10-10 18:33 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ update linux get_if_speed function name
+
+2005-10-10 18:01 tanders
+
+ * ov/: oid_to_sym.in, oid_to_type.in:
+
+ add sysObjectID value for AIX
+
+2005-10-10 17:54 rstory
+
+ * snmplib/read_config.c:
+
+ - break apart reading of config files and persistent config files (allows
+ proper handling of persistentDir token in config files)
+ - remove commented out code
+
+2005-10-10 17:51 rstory
+
+ * Makefile.in, mibs/Makefile.in:
+
+ repalce perl w/ $(PERL)
+
+2005-10-10 17:44 tanders
+
+ * acconfig.h, mibs/NET-SNMP-TC.txt:
+
+ add sysObjectID value for AIX
+
+2005-10-10 17:09 rstory
+
+ * dist/nsb-nightly:
+
+ fix from optarg processing
+
+2005-10-10 16:28 rstory
+
+ * dist/nsb-nightly:
+
+ add option for from address for email results
+
+2005-10-10 16:25 rstory
+
+ * dist/nsb-nightly:
+
+ - add distinct email addresses for success/error cases
+ - fixes for #%@$*& solaris mail exe
+ - don't remove directory til very end
+
+2005-10-10 16:24 rstory
+
+ * dist/nsb-functions:
+
+ exclude error lines for 'In function' (eg func name contains word error)
+
+2005-10-10 14:56 rstory
+
+ * man/Makefile.in:
+
+ - base mib2c.conf generation on $PERL, not -d CVS
+ - if no perl, touch file so install doesn't fail
+
+2005-10-10 14:47 rstory
+
+ * Makefile.rules, Makefile.top, local/Makefile.in
+, testing/Makefile.in:
+
+ - define PERL in all makefiles (via Makefile.top)
+ - replace all calls to perl with $(PERL)
+ - replace existing PERLPROG with PERL in makefiles
+
+2005-10-10 14:38 rstory
+
+ * net-snmp-config.in:
+
+ add PERLLDOPTS to agent libs
+
+2005-10-10 09:37 dts12
+
+ * agent/mibgroup/disman/event/mteEvent.c,
+ agent/mibgroup/disman/event/mteEventConf.c,
+ include/net-snmp/agent/ds_agent.h:
+
+ Allow the administrator to choose between following the DisMan
+ specifications strictly, or using an approach that actually works!
+ (The official ordering for adding varbinds to a notification
+ payload list makes it impossible to use specify Trigger and
+ Event objects in a sensible fashion).
+
+2005-10-10 09:30 dts12
+
+ * agent/mibgroup/disman/event/mteTrigger.c:
+
+ Don't report rows that haven't finished being created, and
+ don't keep scheduling samples for rows that are disabled or removed.
+
+2005-10-10 09:27 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerDeltaTable.c:
+
+ Redundent (auto-)comment.
+
+2005-10-10 09:23 dts12
+
+ * agent/helpers/table_data2.c,
+ include/net-snmp/agent/table_data2.h:
+
+ Converting between index representations is not part of the public API.
+
+2005-10-10 08:11 dts12
+
+ * agent/mibgroup/utilities/iquery.c:
+
+ Cope with a missing internal query username
+ (rather than forcing a hardwired one)
+
+2005-10-10 07:54 dts12
+
+ * snmplib/snmp_client.c:
+
+ Return the full list of results from an internal query,
+ rather than truncating it after the first varbind.
+ (Why 'clone_var' stomps on the next link is a mystery to me!)
+
+2005-10-10 07:44 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Indicate that 'if_speed' APIs are Linux-specific
+ (and not part of the generic IF-MIB data_access framework)
+
+2005-10-07 17:18 rstory
+
+ * agent/mibgroup/notification/snmpNotifyFilterTable.c:
+
+ ifdef out code if module not enabled
+
+2005-10-07 16:48 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c:
+
+ move misapplied patch to correct location
+
+2005-10-07 16:47 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ typo
+
+2005-10-07 16:46 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ only save settable cols
+
+2005-10-07 16:45 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h:
+
+ define settable cols
+
+2005-10-07 16:45 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ get rid of old persistent save funcs, in favor of new generated stuff
+
+2005-10-07 16:42 rstory
+
+ * agent/helpers/table_container.c:
+
+ typo
+
+2005-10-07 16:38 tanders
+
+ * FAQ:
+
+ Major overhaul of list of supported platforms based on 5.2.2.preX testing
+
+2005-10-07 16:25 tanders
+
+ * NEWS:
+
+ fix typos in 5.2 NEWS
+
+2005-10-07 10:14 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Hmmmm.... removing the object entries following a duplicate trigger
+ seems to be problematical. (As in the agent crashes!) It's not
+ clear whether this is appropriate behaviour anyway.
+
+ Need to think about this a bit more.
+
+2005-10-07 09:27 dts12
+
+ * agent/mibgroup/disman/event/: mteTriggerConf.c,
+ mteTriggerConf.h:
+
+ Configure monitoring of UCD-specific tables
+ (compatability with previous Event-MIB implementation).
+
+ Not yet fully tested, but seems to be OK.
+
+2005-10-07 09:25 dts12
+
+ * agent/mibgroup/disman/: event.h, event/mteScalars.c,
+ event/mteScalars.h:
+
+ Implement the Event-MIB scalar objects.
+
+2005-10-07 09:20 dts12
+
+ * agent/mibgroup/disman/event/: mteTrigger.c, mteTrigger.h
+:
+
+ API for counting the number of values being monitored.
+
+2005-10-07 08:42 tanders
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ get rid of C++ keyword "new". MfD-based code still needs to be regenerated.
+
+2005-10-07 05:55 tanders
+
+ * Makefile.in:
+
+ add missing darwin8.h and solaris2.10.h
+
+2005-10-06 20:31 tanders
+
+ * net-snmp-config.in:
+
+ improve help output
+
+2005-10-06 20:21 tanders
+
+ * configure, configure.in, net-snmp-config.in
+:
+
+ Add net-snmp-config options --default-mibs, --default-mibdirs, --persistent-directory and --snmpconfpath
+
+2005-10-06 19:01 rstory
+
+ * testing/: TESTCONF.sh, tests/Sv3config,
+ tests/Sv3vacmconfig, tests/Svacmconfig,
+ tests/Svanyconfig:
+
+ - create and use persistent dir in test directory (so make test as root
+ doesn't muck with system persistent conf)
+
+2005-10-06 18:58 rstory
+
+ * snmplib/snmp_api.c:
+
+ counter64 support to snmp_add_var (so they can be sent w/snmptrap)
+
+2005-10-06 18:56 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_common.c:
+
+ explicit braces to keep compiler happy
+
+2005-10-06 18:55 rstory
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ include utmp/utmpx header (fix for one of the BSDs)
+
+2005-10-06 18:49 rstory
+
+ * agent/mibgroup/hardware/memory/memory_linux.c:
+
+ - increase default buffer size
+ - check open rc
+ - log err if no data available
+
+2005-10-06 18:44 rstory
+
+ * agent/mibgroup/hardware/: cpu/cpu.c, memory/hw_mem.c:
+
+ this (C++ reserved word) -> this_ptr
+
+2005-10-06 18:42 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ call init_agentx_config instead of registering handler directly
+
+2005-10-06 18:42 rstory
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ - slight reorg of init_agentx_config()
+ - ifdef some stuff based on master agent support
+ - move agentx(perms|timeout) in conditional for agent role == master
+
+2005-10-06 08:45 rstory
+
+ * dist/nsb-functions:
+
+ cat correct file on errors
+
+2005-10-06 08:32 rstory
+
+ * dist/nsb-nightly:
+
+ add option to email results
+
+2005-10-06 07:39 tanders
+
+ * agent/mibgroup/mibII/tcpTable.c,
+ include/net-snmp/system/irix.h:
+
+ IRIX tcp-mib cleanup patch (from Albert Chin)
+
+2005-10-06 05:30 dts12
+
+ * agent/mibgroup/disman/event/mteTrigger.c:
+
+ Preliminary handling of errors.
+
+2005-10-06 05:28 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Block configuration of delta-thresholds on delta-samples.
+
+2005-10-06 05:17 dts12
+
+ * agent/mibgroup/disman/event/: mteTrigger.c, mteTrigger.h
+, mteTriggerConf.c, mteTriggerDeltaTable.c:
+
+ Consolidate handling of sysUpTime instance discontinuity marker.
+
+2005-10-06 05:12 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Support the configuration of *just* delta threshold tests.
+
+2005-10-06 05:09 dts12
+
+ * agent/mibgroup/disman/event/: mteTrigger.c,
+ mteTriggerConf.c:
+
+ Implement delta-threshold tests.
+
+2005-10-06 05:06 dts12
+
+ * agent/mibgroup/disman/event/mteTriggerConf.c:
+
+ Accept negative values (rather than rejecting them as invalid options)
+
+2005-10-06 05:05 dts12
+
+ * agent/mibgroup/disman/event/mteTrigger.c:
+
+ Don't bother trying to fire missing threshold events.
+
+2005-10-05 08:26 tanders
+
+ * perl/SNMP/SNMP.xs:
+
+ get rid of C++ keyword "class"
+
+2005-10-05 04:43 dts12
+
+ * agent/mibgroup/mibII/mta_sendmail.c:
+
+ Sigh - read the whole email message, Dave!
+
+2005-10-05 04:41 dts12
+
+ * agent/mibgroup/mibII/mta_sendmail.c:
+
+ Remove bogus trailing comma (reported by Albert Chin)
+
+2005-10-04 17:51 hardaker
+
+ * dist/makerelease:
+
+ check results of every system call instead of just special ones.
+
+2005-10-04 10:32 dts12
+
+ * agent/mibgroup/disman/event/: mteTrigger.c, mteTrigger.h
+, mteTriggerConf.c, mteTriggerDeltaTable.c:
+
+ Implement support for delta-valued samples.
+ Only tested with Boolean entries, and a basic sysUpTime.0
+ discontinuity marker. Threshold delta-valued samples and
+ wildcarded discontinuity OIDs ought to work, but still need testing.
+
+2005-10-04 10:26 dts12
+
+ * agent/mibgroup/disman/event/mteTrigger.c:
+
+ Canonicalise previous/current results - matching entries leads to
+ simpler test code. Adjust Existence tests to take advantage of this.
+
+2005-10-03 19:47 alex_b
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Win32 installer: Fix typo in script, fix %windir% env var check.
+
+2005-10-03 07:51 dts12
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ Run SET assignments during the ACTION pass, so errors can be reported.
+ (Should fix Bug #864281, and be consistent with pass.c behaviour)
+
+2005-10-01 16:51 rstory
+
+ * dist/nsb-nightly:
+
+ add option for email of error results
+
+2005-10-01 15:50 rstory
+
+ * agent/mibgroup/host/hr_system.c:
+
+ fix utmp include ifdef logic
+
+2005-10-01 12:25 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-10-01 12:23 rstory
+
+ * configure.in, agent/mibgroup/host/hr_storage.c:
+
+ check for mbstat.m_mbufs before using
+
+2005-09-29 18:51 hardaker
+
+ * acconfig.h:
+
+ Fix bug #1150018: Dynamic allocation of disk storage array.
+
+2005-09-29 18:48 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Fix bug #1150018: Dynamic allocation of disk storage array.
+
+2005-09-29 18:28 hardaker
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ Patch from bug#1234834: fixes targetaddrtimeout so its writable
+
+2005-09-29 18:16 hardaker
+
+ * local/mib2c.column_enums.conf:
+
+ added generation of enums for scalars
+
+2005-09-29 13:16 rstory
+
+ * snmplib/snmpUnixDomain.c:
+
+ set sock buf size for unix domain sockets
+
+2005-09-29 06:06 dts12
+
+ * agent/mibgroup/disman/event/: mteTrigger.c,
+ mteTriggerConf.c:
+
+ Implement single-valued threshold triggers.
+
+2005-09-28 18:28 alex_b
+
+ * win32/net-snmp/: net-snmp-config.h, net-snmp-config.h.in
+:
+
+ Win32 MSVC: Enable AES encryption when SSL is enabled.
+
+2005-09-28 17:22 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_common.c:
+
+ swap reversed if/else code
+
+2005-09-28 15:36 rstory
+
+ * agent/mibgroup/utilities/iquery.c:
+
+ provide default for internal secname
+
+2005-09-28 12:38 tanders
+
+ * configure, configure.in:
+
+ Fix last remaining "present, but cannot be compiled" warning on Solaris 9
+
+2005-09-28 11:36 dts12
+
+ * agent/mibgroup/disman/: event.h, event/.cvsignore,
+ event/mteEvent.c, event/mteEvent.h,
+ event/mteEventConf.c, event/mteEventConf.h,
+ event/mteEventNotificationTable.c,
+ event/mteEventNotificationTable.h, event/mteEventSetTable.c
+, event/mteEventSetTable.h, event/mteEventTable.c
+, event/mteEventTable.h, event/mteObjects.c,
+ event/mteObjects.h, event/mteObjectsConf.c,
+ event/mteObjectsConf.h, event/mteObjectsTable.c,
+ event/mteObjectsTable.h, event/mteTrigger.c,
+ event/mteTrigger.h, event/mteTriggerBooleanTable.c,
+ event/mteTriggerBooleanTable.h, event/mteTriggerConf.c
+, event/mteTriggerConf.h, event/mteTriggerDeltaTable.c
+, event/mteTriggerDeltaTable.h,
+ event/mteTriggerExistenceTable.c,
+ event/mteTriggerExistenceTable.h, event/mteTriggerTable.c
+, event/mteTriggerTable.h,
+ event/mteTriggerThresholdTable.c,
+ event/mteTriggerThresholdTable.h:
+
+ New implementation of the DisMan Event MIB.
+
+2005-09-28 10:26 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ added documentation describing the exec() path requirement
+
+2005-09-28 10:21 hardaker
+
+ * man/snmpcmd.1.def:
+
+ Updated docs on -Ib to document extra limitations
+
+2005-09-28 06:09 dts12
+
+ * agent/helpers/table_data2.c,
+ include/net-snmp/agent/table_data2.h:
+
+ Extend table interface with row comparison API routines.
+
+2005-09-28 06:07 dts12
+
+ * agent/mibgroup/utilities/: iquery.c, iquery.h:
+
+ Use the default query session from the library.
+
+2005-09-28 06:03 dts12
+
+ * include/net-snmp/library/snmp_client.h,
+ snmplib/snmp_client.c:
+
+ Support the idea of a "default session" for the query convenience routines.
+
+2005-09-28 05:00 tanders
+
+ * README:
+
+ reveal my continued presence around here
+
+2005-09-28 04:53 dts12
+
+ * snmplib/snmp_api.c:
+
+ Callback to report establishment of a connection (from Magnus Fromreide)
+
+2005-09-27 22:02 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c:
+
+ - convert mask to network byte order
+ - update pfx_len counting for network byte order
+ - add little endian /proc/net/route example line
+ - only set route policy for default gateway routes
+ - update for new static policy flag
+ - new route create/delete functions
+
+2005-09-27 19:25 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c
+:
+
+ - move active row set restriction to dependency check function
+ - update assert to test against new expected value
+
+2005-09-27 19:12 tanders
+
+ * include/net-snmp/system/solaris2.10.h:
+
+ add Solaris 10 support
+
+2005-09-27 19:08 rstory
+
+ * NEWS:
+
+ mention dynamic ipv4 route creation/deletion
+
+2005-09-27 17:45 tanders
+
+ * README.tru64, agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/udpTable.c:
+
+ Tru64 Unix 5.x build fixes (bug #1217509)
+
+2005-09-27 14:51 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ print range information
+
+2005-09-27 13:14 rstory
+
+ * agent/mibgroup/ip-forward-mib/inetCidrRouteTable/:
+ inetCidrRouteTable.c, inetCidrRouteTable.h,
+ inetCidrRouteTable_constants.h,
+ inetCidrRouteTable_data_access.c,
+ inetCidrRouteTable_data_access.h,
+ inetCidrRouteTable_interface.c,
+ inetCidrRouteTable_interface.h:
+
+ - update generated code
+ - use new route_entry functions for dynamic ipv4 route creation/deletion
+ - nuke generated column undo funcs, use new table level one instead
+ - add some depedency validation (addr type & expected addr len)
+
+2005-09-27 13:05 rstory
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i:
+
+ remove debugging comments
+
+2005-09-27 12:53 hardaker
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ patch #1304400: better hrSWRunType support
+
+2005-09-27 12:45 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ patch #1225360 to fix the smux encoding of the requestid to a signed int
+
+2005-09-27 12:14 rstory
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ key vacm "no access" warning off agent_mode instead of app type
+
+2005-09-27 12:05 rstory
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ remove unnecessary sock startup
+
+2005-09-27 12:04 rstory
+
+ * include/net-snmp/data_access/route.h:
+
+ - document that addresses are in network byte order
+ - bump max policy oid length to 2, to handle default null oid case
+ - move policy static flag definition with other flags
+ - change policy static flag so as not to conflict with item changed flags
+ - add new policy deep copy flag
+ - add macro of 'change item' flags mask
+
+2005-09-27 12:01 rstory
+
+ * local/mib2c-update:
+
+ add --forward flag to patch command
+
+2005-09-27 12:00 rstory
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i:
+
+ - use new mib2c left/right hand length units for proper sizes when copying
+ and comparing data
+
+2005-09-27 11:59 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-set.m2i:
+
+ - override default left/right hand length units; both are elements
+ - update initial set of max len to be elements
+
+2005-09-27 11:58 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ define default left/right hand lenght units (bytes/elements)
+
+2005-09-27 11:56 rstory
+
+ * local/mib2c-conf.d/generic-table-oids.m2c:
+
+ - define separate settable flags
+ - define settable column macro
+
+2005-09-27 11:54 rstory
+
+ * local/mib2c-conf.d/mfd-data-access.m2c:
+
+ fix incorrect return define suggestion in comment
+
+2005-09-27 11:53 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - always track if data context was provided by user
+ - don't call data ctx init routine for user provided data
+ - remove internal/verbose prefix from all debug error cases
+ - don't try to copy indexes if index check failed (and ctx was released!)
+ - call row_prep for newly created rows (dynamic row creation)
+ - call new table undo before column undo
+
+2005-09-27 11:47 rstory
+
+ * local/mib2c-conf.d/mfd-persistence.m2i:
+
+ - only include settable object when calculating tmp storage size
+ - don't call col_save routine if column isn't settable
+
+2005-09-27 11:43 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ add table level undo before column level undo
+
+2005-09-27 11:42 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i:
+
+ handle newly created row w/row status of destroy
+
+2005-09-27 11:39 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_common.c:
+
+ - don't free rt_policy if static flag set
+ - new function to set route changes
+ - new function to copy route_entries
+
+2005-09-27 11:37 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route.h:
+
+ require new route_ioctl for linux
+
+2005-09-27 11:36 rstory
+
+ * agent/mibgroup/agent/nsCache.c:
+
+ - update timeout for auto-update caches when mib value changed
+
+2005-09-27 11:34 rstory
+
+ * agent/snmpd.c:
+
+ - move code for help case after all command line args have been processed
+ - add new command line option (-n) for 'application name'; very useful for
+ having multiple configs, and works well with persistent store too. Open
+ for suggestions on a different char (or merge w/some existing multi-char
+ set; maybe -C).
+
+2005-09-27 11:26 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-09-27 11:26 rstory
+
+ * configure.in:
+
+ - add disman/event-mib to default module list
+ - add host to default module list for
+ linux* | mingw32* | cygwin* | freebsd* | dynix* | solaris2* | hpux*
+
+2005-09-27 10:44 rstory
+
+ * agent/mibgroup/: if-mib/ifTable/.cvsignore,
+ if-mib/ifXTable/.cvsignore,
+ ip-forward-mib/inetCidrRouteTable/.cvsignore,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/.cvsignore:
+
+ ignore some non-source files generated by MFD
+
+2005-09-27 10:41 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/: route_ioctl.c,
+ route_ioctl.h, route_linux.h:
+
+ copy route ioctls from mibII/route_write & update for route_entry
+
+2005-09-26 19:42 hardaker
+
+ * snmplib/mib.c:
+
+ Fix bug 1292896 checking for -1 before searching for TC type
+
+2005-09-26 18:54 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-09-26 18:40 rstory
+
+ * configure.in:
+
+ don't make decisions based on target_os until after it's set!
+
+2005-09-26 18:37 hardaker
+
+ * snmplib/vacm.c:
+
+ Bug Patch #1296842: don't return from void function
+
+2005-09-26 16:21 tanders
+
+ * testing/tests/Sv3config:
+
+ fix SNMPv3 config if AES isn't available
+
+2005-09-26 13:00 tanders
+
+ * testing/RUNTESTS:
+
+ Fix "-x" option
+
+2005-09-26 08:25 tanders
+
+ * configure, configure.in:
+
+ OpenBSD build fix: bring in sys/timeout.h
+
+2005-09-24 15:02 alex_b
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Win32 installer: Put back missing 'Are you sure you want to completely
+ remove' message when uninstalling.
+
+2005-09-23 21:45 alex_b
+
+ * win32/dist/: README.build.win32.txt,
+ installer/net-snmp.nsi:
+
+ Win32 installer: Add optional check for OpenSSL DLL (libeay32.dll)
+
+2005-09-23 12:24 rstory
+
+ * NEWS:
+
+ note that snmpd now implemented notification logging and filtering
+
+2005-09-23 10:41 tanders
+
+ * configure:
+
+ Rerun autoconf
+
+2005-09-23 10:20 rstory
+
+ * agent/mibgroup/host/hr_system.c:
+
+ shrink buffer size so MIB size limit not exceeded
+
+2005-09-22 19:02 rstory
+
+ * configure.in:
+
+ move socketvar.h after socket.h
+
+2005-09-22 17:21 alex_b
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Win32 installer: Default to dislabed for development files.
+
+2005-09-22 15:35 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ put var name in braces to separate from appended text
+
+2005-09-20 09:23 dts12
+
+ * snmplib/read_config.c:
+
+ Since the length parameter isn't always required when storing data,
+ allow it to be omitted (and correct the misleading comment as to
+ how this is actually used!)
+
+2005-09-16 15:30 hardaker
+
+ * configure, configure.in:
+
+ Patch from Patrick Welche to fix quoting for newer autoconfs
+
+2005-09-16 15:24 hardaker
+
+ * agent/mibgroup/disman/mteEventTable.c:
+
+ correct missing function calls now replaced by tdata.
+
+2005-09-16 14:38 hardaker
+
+ * snmplib/read_config.c:
+
+ support for string parsing of counter64s
+
+2005-09-16 14:34 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-09-16 14:33 rstory
+
+ * configure.in, dist/net-snmp.spec:
+
+ update out-of-sync version numbers
+
+2005-09-16 13:00 rstory
+
+ * agent/mibgroup/mibII/route_write.c:
+
+ don't try to use SIOC(ADD|DEL)RT if they aren't defined
+
+2005-09-16 12:45 rstory
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ HRSWRUNPERF_MEM don't work on darwin8
+
+2005-09-16 12:41 rstory
+
+ * agent/Makefile.in, apps/Makefile.in:
+
+ use new configure var PERLLDOPTS
+
+2005-09-16 12:10 tanders
+
+ * configure, configure.in:
+
+ add missing second semicolon
+
+2005-09-16 11:51 dts12
+
+ * snmplib/: check_varbind.c, snmp_api.c,
+ snmp_logging.c:
+
+ Pick up a couple of stray 'strings' that slipped through.
+ (and a bogus ASN type name)
+
+2005-09-16 10:55 rstory
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ refine conditional includes logic
+
+2005-09-16 10:46 rstory
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ include sys/socketvar.h iff available
+
+2005-09-16 10:43 rstory
+
+ * configure.in:
+
+ break perl ld opts into its own var
+
+2005-09-16 10:41 rstory
+
+ * configure:
+
+ update for configure.in
+
+2005-09-16 10:31 rstory
+
+ * configure.in:
+
+ configure.in
+
+2005-09-16 08:52 dts12
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ Tweak to use the revised 'tdata' API.
+
+2005-09-16 07:48 dts12
+
+ * local/: mib2c.container.conf, mib2c.table_data.conf:
+
+ Use the appropriate library utility routines for returning a
+ column value, and checking the validity of an assignment.
+
+2005-09-16 07:33 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Use the (revised) container-based 'table_data2' helper.
+
+2005-09-16 07:21 dts12
+
+ * local/: mib2c.container.conf, mib2c.table_data.conf:
+
+ Fix typo when defining range of valid columns.
+
+2005-09-16 07:18 dts12
+
+ * agent/helpers/table_data2.c, agent/helpers/table_dataset2.c
+, include/net-snmp/agent/table_data2.h,
+ include/net-snmp/agent/table_dataset2.h:
+
+ I've never like the renaming of the container-based table_data
+ API calls and data structures. If we're starting to think about
+ releasing this code, then any alterations must be made *before*
+ this goes live, or else it'll be too late.
+
+ I've finally come up with a form of naming for the table_data2
+ code that I'm reasonably happy with (based around 'tdata'),
+ so this patch rewrites this helper to use that style (as well
+ as tweaking the dataset2 code to match).
+ The main dataset2 API hasn't been properly updated, but this
+ should probably also be addressed before 5.3 goes out of the door.
+
+ This version also illustrates a suitable "generic table API",
+ that could usefully be considered for other table helpers as
+ well. Some aspects of it may be specific to the table_data
+ framework, but the basic ideas are more widely relevant.
+
+2005-09-16 06:44 dts12
+
+ * agent/helpers/table_dataset2.c:
+
+ A container-based 'dataset' implementation will automatically convert
+ GETNEXT/BULK requests into an equivalent GET request (including updating
+ the OID). So all that's required is to return the appropriate value.
+ The 'netsnmp_table_data2_build_result' routine is therefore redundent.
+
+2005-09-16 06:37 dts12
+
+ * include/net-snmp/library/check_varbind.h,
+ snmplib/check_varbind.c:
+
+ Define a new check utility routine for unsigned integers.
+ Integers are meant to be represented as 'long' rather than 'int' values.
+
+2005-09-16 06:30 dts12
+
+ * snmplib/: asn1.c, int64.c, parse.c,
+ read_config.c, snmp-tc.c, snmpAAL5PVCDomain.c,
+ snmpIPXDomain.c, snmpTCPDomain.c,
+ snmpTCPIPv6Domain.c, snmpUDPDomain.c,
+ snmpUDPIPv6Domain.c, snmp_api.c, snmp_logging.c
+, snmp_transport.c:
+
+ Blitz use of 'string' as a variable name.
+
+2005-09-16 05:49 dts12
+
+ * configure:
+
+ Regenerate to match updated 'configure.in'
+
+2005-09-16 01:16 hardaker
+
+ * snmplib/snmpksm.c:
+
+ Use a security model number defined in the global header instead of a
+ hard-coded number
+
+2005-09-16 01:14 hardaker
+
+ * include/net-snmp/library/snmp_secmod.h:
+
+ define security model numbers for net-snmp specific security models
+ here to keep a registry in a central place.
+
+2005-09-16 01:13 hardaker
+
+ * include/net-snmp/library/snmplocalsm.h,
+ snmplib/snmplocalsm.c:
+
+ - Defined a local security model that assumes the person that executed
+ the agent is the one who should be authorized. It requires that a
+ transport was used that was not a direct network transport (EG,
+ currently this means it was tunneled or sent through stdin/out
+ channel). Authentication and encryption level, being unknown, is
+ left at noAuthNoPriv.
+
+ This model is expected to be used for experimental and purposes only
+ at this time and should probably not be used in production.
+
+2005-09-16 00:45 hardaker
+
+ * include/net-snmp/library/snmp.h:
+
+ define a PDU tunneled flag
+
+2005-09-15 11:58 rstory
+
+ * configure.in:
+
+ check for mnt_dir in statvfs
+
+2005-09-15 09:50 hardaker
+
+ * mibs/makehtml.pl:
+
+ Added a link to the conformance summary.
+
+2005-09-15 09:48 hardaker
+
+ * snmplib/snmp_transport.c:
+
+ - Added STD init
+
+2005-09-15 09:46 hardaker
+
+ * include/net-snmp/library/snmpSTDDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ snmplib/snmpSTDDomain.c:
+
+ - Added ability for STD handler to call external things to pipe to/from
+ - Beginning support for a transport being known as "tunneled".
+
+2005-09-15 09:45 hardaker
+
+ * dist/makerelease:
+
+ minor fixes
+
+2005-09-15 09:44 hardaker
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Definitions for new features (std and a future SM model)
+
+2005-09-14 23:04 rstory
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ check for struct member before using
+
+2005-09-14 20:24 rstory
+
+ * configure.in:
+
+ - check for sys/socketvar.h earlier
+ - include sys/socketvar.h in network header tests
+ - fix without-elf test
+
+2005-09-14 20:06 rstory
+
+ * include/net-snmp/system/darwin8.h:
+
+ missing defines for darwin8 (OS X 10.4.2)
+
+2005-09-14 14:18 hardaker
+
+ * include/net-snmp/library/snmpSTDDomain.h,
+ snmplib/snmpSTDDomain.c:
+
+ Added a odd transport to do stuff through stdin/out
+
+2005-09-13 14:49 rstory
+
+ * include/net-snmp/library/snmp_locking.h:
+
+ remove unused file
+
+2005-09-12 11:36 dts12
+
+ * testing/Makefile.in:
+
+ Provide a make target for testing the MIBs implemented by an agent.
+ The behaviour of this target may need some adjustment, but it's a start...
+
+2005-09-12 11:24 dts12
+
+ * include/net-snmp/agent/table_array.h:
+
+ Document that 'delete_row' hook doesn't return a useful result.
+
+2005-09-12 11:16 dts12
+
+ * include/net-snmp/agent/all_helpers.h:
+
+ Include the table_array helper (as used by the "mib2c.array-user.conf"
+ template) in the combined helper header file.
+ (Now we'll find out why it was omitted.....)
+
+2005-09-12 10:50 dts12
+
+ * snmplib/: check_varbind.c, snmp-tc.c:
+
+ Ensure that invalid RowStatus assignments return a 'wrongValue' error.
+
+2005-09-12 10:46 dts12
+
+ * include/net-snmp/library/check_varbind.h,
+ snmplib/check_varbind.c:
+
+ Additional SET validation utility routines
+ (for OID and general INTEGER assignments)
+
+2005-09-12 10:29 dts12
+
+ * agent/mibgroup/: utilities.h, utilities/iquery.h:
+
+ Include the new "internal query" module
+
+2005-09-09 07:11 dts12
+
+ * local/Makefile.in:
+
+ Install new mib2c config files. (Bug #1284315)
+
+2005-09-09 06:09 dts12
+
+ * perl/OID/OID.xs:
+
+ Ensure that the MIB internals are initialised before using them. (Bug #705536)
+
+2005-09-08 14:56 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ remove shutdown code (handled by ifTable)
+
+2005-09-07 10:30 dts12
+
+ * perl/agent/default_store/Makefile.PL:
+
+ Fix a 'my' list declaration that slipped through the net.
+ Can finally close bugs #579705 & #601190.
+
+2005-09-07 07:28 dts12
+
+ * agent/helpers/table.c:
+
+ Report errors for invalid table OIDs appropriately for the type of request.
+ (Based on patch #1276999 by Robert Wilcox)
+
+2005-09-07 05:13 dts12
+
+ * snmplib/snmpusm.c:
+
+ Tweak to USM debugging - help detect engineID mismatches
+
+2005-09-06 21:48 alex_b
+
+ * win32/: libsnmp_dll/libsnmp.def,
+ libsnmp_dll/libsnmp.def.in, netsnmpmibs/Makefile.in,
+ netsnmpmibs/netsnmpmibs.dsp, netsnmpmibssdk/Makefile.in
+, netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Win32 build fixes
+
+2005-09-06 20:37 alex_b
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ Win32 MSVC compile fix - declare variables at the top of the function.
+
+2005-09-06 20:07 alex_b
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Change default version for binary.
+
+2005-09-06 20:06 alex_b
+
+ * README.win32, win32/Makefile.in, win32/build.pl
+, win32/dist/installer/net-snmp.nsi:
+
+ Add 'Development files' section to win32 binary
+
+2005-09-06 19:29 alex_b
+
+ * win32/dist/README.txt:
+
+ Win32: Update binary README.txt to reference README.win32
+
+2005-09-06 19:17 tanders
+
+ *
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/.cvsignore
+:
+
+ add .libs and *.lo
+
+2005-09-06 16:23 rstory
+
+ * agent/mibgroup/:
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
+, mibII/udpTable.c:
+
+ fix reversed ipAddress on little endian architectures
+
+2005-09-06 11:19 rstory
+
+ * Makefile.top:
+
+ move to libtool recommended versioning
+
+2005-09-05 19:00 rstory
+
+ * agent/mibgroup/if-mib/: ifTable/ifTable.c,
+ ifTable/ifTable.h, ifTable/ifTable_constants.h,
+ ifTable/ifTable_data_access.c,
+ ifTable/ifTable_data_access.h, ifTable/ifTable_interface.c
+, ifTable/ifTable_interface.h, ifXTable/ifXTable.c
+, ifXTable/ifXTable.h, ifXTable/ifXTable_constants.h
+, ifXTable/ifXTable_data_access.c,
+ ifXTable/ifXTable_data_access.h,
+ ifXTable/ifXTable_interface.c,
+ ifXTable/ifXTable_interface.h:
+
+ update generated code
+
+2005-09-05 16:16 rstory
+
+ * testing/tests/Sv3config:
+
+ check for OpenSSL before trying to use AES
+
+2005-09-04 12:08 rstory
+
+ * testing/RUNTESTS:
+
+ use existing SNMP_VERBOSE env value, if set
+
+2005-09-04 11:56 rstory
+
+ * man/Makefile.in:
+
+ test conditional instead of ignoring execution error
+
+2005-09-02 20:33 hardaker
+
+ * apps/: snmptrapd_auth.c, snmptrapd_auth.h:
+
+ added template functions for authorization decisions
+
+2005-09-02 19:32 hardaker
+
+ * remove-files:
+
+ remove .cvsignore files
+
+2005-09-01 17:07 rstory
+
+ * local/mib2c-conf.d/mfd-persistence.m2i:
+
+ extra paranoid length checks
+
+2005-09-01 16:45 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ account for hexified text len on persistent store save
+
+2005-08-31 22:29 alex_b
+
+ * NEWS, perl/SNMP/SNMP.xs:
+
+ Apply patch for bug 1206712: Perl getnext doesn't honor explicit reference
+ to MIB file
+
+2005-08-30 11:40 rstory
+
+ * testing/tests/: T160rfc1213, T161rfc1213, T162rfc1213
+:
+
+ remove non-conditional tests of potentially unimplemented objects
+
+2005-08-30 08:21 rstory
+
+ * agent/mibgroup/examples/notification.c:
+
+ keep running count of traps sent
+
+2005-08-30 08:19 rstory
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ add notification filtering per RFC 3413, section 6
+
+2005-08-30 08:11 rstory
+
+ * agent/mibgroup/notification.h:
+
+ use new mfd snmpNotifyFilterTable
+
+2005-08-30 08:06 rstory
+
+ *
+ agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
+:
+
+ new file
+
+2005-08-29 21:03 rstory
+
+ * agent/mibgroup/: if-mib/ifTable/.cvsignore,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/.cvsignore,
+ tcp-mib/tcpConnectionTable/.cvsignore,
+ tcp-mib/tcpListenerTable/.cvsignore:
+
+ ignore txt files
+
+2005-08-29 21:00 rstory
+
+ * agent/mibgroup/: snmp-notification-mib.h,
+ snmp-notification-mib/snmpNotifyFilterTable.h,
+ snmp-notification-mib/snmpNotifyFilterTable/.cvsignore,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c
+,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c
+,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
+,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
+,
+ snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+:
+
+ - new MFD snmpNotifyFilterTable
+
+2005-08-29 20:53 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ - remove commented out mib2c code
+ - set row dirty flag on succesfful commit
+ - clear row dirty flag on successful undo commit
+
+2005-08-29 20:52 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - change dirty flag to u_int
+ - always generated interface irreversible_commit
+ - move auto row insert/delete to irreversible_commit
+ - release deleted rows in post_request, before calling user
+ - warning if dirty flag set on unsuccessful packet
+ - memset local struct to 0x00 before use
+ - copy indexes to rowreq oid_idx on create
+ - set (incr) global dirty if user set row dirty
+ - clear (decr) global dirty if use cleared flag on undo
+
+2005-08-29 20:47 rstory
+
+ * local/mib2c-update:
+
+ autocreate current dir, if needed
+
+2005-08-29 20:47 rstory
+
+ * include/net-snmp/agent/mfd.h:
+
+ - fix comments on user flags
+ - add user flag mask
+ - add mfd row mask
+ - add MFD_ROW_DIRTY flag
+
+2005-08-29 20:46 rstory
+
+ * local/mib2c-conf.d/mfd-persistence.m2i:
+
+ add comments
+
+2005-08-29 20:45 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ - add comments
+ - move flag clear a little later
+
+2005-08-29 20:38 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ tweak comment
+
+2005-08-29 20:38 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i:
+
+ - fix required columns test (they are a min, not exact requirement)
+ - auto-transition createAndGo to active
+ - set MFD_ROW_DELETED on destroy
+ - tweak log message on creation errors
+
+2005-08-29 20:36 rstory
+
+ * include/net-snmp/library/vacm.h, snmplib/vacm.c:
+
+ - rework view list functions to take pointer to head (vs hardcoded head)
+
+2005-08-29 20:32 rstory
+
+ * snmplib/container_binary_array.c:
+
+ add iterator support
+
+2005-08-29 20:31 rstory
+
+ * include/net-snmp/library/container.h:
+
+ - fix some comments
+ - tweaks for iterator support
+ - remove unused soted_container typedef
+
+2005-08-29 20:29 rstory
+
+ * snmplib/system.c:
+
+ remove unused var
+
+2005-08-29 20:26 rstory
+
+ * agent/mibgroup/target/target.c:
+
+ - set new target paramName in session
+ - fix bug: strdup securityName, since it will be freed on session close
+
+2005-08-29 20:24 rstory
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ add target paramName
+
+2005-08-29 20:20 rstory
+
+ * agent/mibgroup/notification/: snmpNotifyFilterProfileTable.c
+, snmpNotifyFilterProfileTable.h:
+
+ rename get_FilterName -> get_FilgerProfileName
+
+2005-08-29 20:18 rstory
+
+ * agent/mibgroup/header_complex.c:
+
+ log warning on duplicate add_data
+
+2005-08-29 20:16 rstory
+
+ * agent/helpers/bulk_to_next.c:
+
+ add debug
+
+2005-08-29 20:15 rstory
+
+ * agent/mib_modules.c:
+
+ - move mib module shutdowns to a SHUTDOWN callback so they are called
+ after the last snmp_store() and can release table data
+ - add logic for testing extra init_mib_modules() calls
+
+2005-08-29 20:12 rstory
+
+ * agent/snmpd.c:
+
+ - move mib module shutdowns to a SHUTDOWN callback so they are called
+ after the last snmp_store(), and can release table data
+
+2005-08-29 20:09 rstory
+
+ * include/net-snmp/library/snmp_client.h,
+ snmplib/snmp_client.c:
+
+ move find_varbind_int_list to snmp_client.c
+
+2005-08-29 20:08 rstory
+
+ * agent/agent_trap.c:
+
+ - move find_varbind_int_list to snmp_client.c
+ - remove extraneous text in debug msg
+
+2005-08-29 20:06 rstory
+
+ * agent/agent_trap.c:
+
+ if sink contains ':', pass whole thing as peername. (allows tcp sinks)
+
+2005-08-29 18:25 tanders
+
+ * agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ include/net-snmp/library/default_store.h,
+ snmplib/data_list.c, snmplib/read_config.c,
+ snmplib/snmp_api.c:
+
+ introduce granular config/persistent file disablement (Patch #1259257 by Steven Friedl)
+
+2005-08-26 09:15 dts12
+
+ * dist/net-snmp.spec:
+
+ Advertise the main RPM as providing the equivalent of the RedHat/Fedora
+ 'net-snmp-utils' RPM. Bring the main information settings into line
+ with current rpmbuild expectations ('License' rather than 'Copyright')
+
+2005-08-25 05:16 dts12
+
+ * agent/mibgroup/mibII/: vacm_conf.c, vacm_vars.c:
+
+ The view mask is not necessarily the same length as the OID it's
+ masking against. Configure and report this properly. (Bug #1202692)
+
+2005-08-25 05:06 dts12
+
+ * snmplib/check_varbind.c:
+
+ Varbind checks should return an SNMPv2 error (wrongValue)
+ rather than the equivalent SNMPv1 error (badValue).
+
+2005-08-23 10:05 dts12
+
+ * agent/mibgroup/mibII/ip.c:
+
+ Use 'ips_fragments' field of IP statistics structure, if available
+ (See patch #1103739)
+
+2005-08-23 10:04 dts12
+
+ * configure, configure.in:
+
+ Test for 'ips_fragments' field in IP statistics structure.
+ (See patch #1103739)
+
+2005-08-23 09:51 dts12
+
+ * apps/snmptrapd.c:
+
+ Remove '-l' option from optarg processing
+ (since the corresponding case statement was deleted months ago!)
+ Reported by John Pfaff.
+
+2005-08-22 21:17 alex_b
+
+ * NEWS, apps/snmpdelta.c:
+
+ win32: Fix for 'select: No such file or directory' in snmpdelta
+
+2005-08-22 14:08 tanders
+
+ * local/snmpconf.dir/snmp-data/authopts:
+
+ add missing AES support
+
+2005-08-22 13:49 tanders
+
+ * man/: snmp.conf.5.def, snmpd.conf.5.def,
+ snmptrapd.conf.5.def:
+
+ fully document AES
+
+2005-08-19 19:06 rstory
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ grrr; *really* fix typo
+
+2005-08-19 19:05 rstory
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ fix typo
+
+2005-08-19 10:35 tanders
+
+ * man/snmpd.conf.5.def:
+
+ emphasize to use "proxy ... .1.3" (not just .1) to proxy the entire MIB tree (Bug #1249594)
+
+2005-08-19 10:06 tanders
+
+ * agent/snmpd.c:
+
+ improve help output for "-D" (Bug #1249556) and "-c"
+
+2005-08-19 09:24 tanders
+
+ * snmplib/check_varbind.c:
+
+ add missing return statement to netsnmp_check_vb_size_range() (Bug #1263523)
+
+2005-08-19 07:59 tanders
+
+ * man/snmpdelta.1.def:
+
+ fix typo
+
+2005-08-19 05:55 tanders
+
+ * agent/mibgroup/notification-log-mib/.cvsignore:
+
+ initial .cvsignore
+
+2005-08-19 05:43 tanders
+
+ * agent/mibgroup/: hardware/cpu/.cvsignore,
+ hardware/memory/.cvsignore, if-mib/ifTable/.cvsignore
+, if-mib/ifXTable/.cvsignore,
+ ip-forward-mib/inetCidrRouteTable/.cvsignore,
+ ip-forward-mib/ipCidrRouteTable/.cvsignore,
+ ip-mib/inetNetToMediaTable/.cvsignore,
+ ip-mib/ipAddressTable/.cvsignore,
+ ip-mib/ipSystemStatsTable/.cvsignore:
+
+ ignore .libs at more places
+
+2005-08-19 05:08 tanders
+
+ * README.agent-mibs:
+
+ list context support and fix typo
+
+2005-08-18 18:51 alex_b
+
+ * snmplib/snmp_client.c:
+
+ Win32 MSVC: Use __int64 instead of long long.
+
+2005-08-18 18:05 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ - move test after foreach loop
+ - set interactive flat after overwrite
+
+2005-08-18 18:00 rstory
+
+ * snmplib/asn1.c:
+
+ return error if asn buffer exceeds objid dest buffer
+
+2005-08-18 17:53 rstory
+
+ * agent/helpers/table_data2.c:
+
+ - remove unused index_oid/len
+ - restore netsnmp_table_data2_build_result
+
+2005-08-18 17:52 rstory
+
+ * include/net-snmp/agent/table_data2.h:
+
+ remove unused index_oid/len
+
+2005-08-18 17:50 rstory
+
+ * agent/snmpd.c:
+
+ quiet compiler
+
+2005-08-18 17:35 rstory
+
+ * dist/nsb-functions:
+
+ - don't overwrite existing configure extras
+ - add make extras
+
+2005-08-18 17:35 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ bring hpux function decl in line w/protype
+
+2005-08-18 17:13 rstory
+
+ * agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c
+:
+
+ fix bug 1259049: snmpd segfaults in IP-MIB during snmpwalk
+
+2005-08-18 09:44 rstory
+
+ * snmplib/: asn1.c, int64.c, snmp_client.c:
+
+ - lots of 64 bit checks added iff SIZEOF_LONG != 4
+ - check counter64 high/low overflows (int64.c)
+ - truncate received values to 32 bits (asn1.c)
+ - truncate sent values to 32 bits before encoding (asn1.c)
+ - update set_var_value (snmp_client.c)
+ - truncate varbind value sets to 32 bits
+ - handle set of integers of various lengths (1, 2, 4, 8 bytes)
+
+2005-08-18 06:05 dts12
+
+ * agent/agent_trap.c:
+
+ Don't generate authFail traps if these are not required.
+ (Bug #1226788, reported by Wang Tek Kee)
+
+2005-08-17 20:44 alex_b
+
+ * agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ win32/libsnmp/Makefile.in, win32/libsnmp/libsnmp.dsp
+, win32/libsnmp_dll/Makefile.in,
+ win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ Win32 MSVC build fixes: LONG_MIN not defined (limits.h) and added
+ fd_event_manager.c to build files.
+
+2005-08-17 20:29 alex_b
+
+ * README.win32:
+
+ Add 'Co-existence with Microsoft SNMP services' section and update the
+ 'Interactions with Other Vendor's Products' section.
+
+2005-08-17 17:50 tanders
+
+ * man/snmp.conf.5.def:
+
+ Improve documentation on clientAddr token: also used by snmpd when sending notifications
+
+2005-08-17 09:41 dts12
+
+ * include/net-snmp/types.h:
+
+ Fix problems with 32/64-bit type definitions (Bug #1254990)
+
+2005-08-17 08:36 dts12
+
+ * agent/agent_index.c, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/agent_trap.c,
+ agent/auto_nlist.c, agent/mib_modules.c,
+ agent/snmp_agent.c, agent/snmp_vars.c,
+ agent/snmpd.c, agent/helpers/baby_steps.c,
+ agent/helpers/bulk_to_next.c, agent/helpers/cache_handler.c
+, agent/helpers/debug_handler.c,
+ agent/helpers/instance.c, agent/helpers/mode_end_call.c
+, agent/helpers/multiplexer.c, agent/helpers/null.c
+, agent/helpers/old_api.c, agent/helpers/read_only.c
+, agent/helpers/row_merge.c, agent/helpers/scalar.c
+, agent/helpers/scalar_group.c,
+ agent/helpers/serialize.c, agent/helpers/stash_cache.c
+, agent/helpers/stash_to_next.c, agent/helpers/table.c
+, agent/helpers/table_array.c,
+ agent/helpers/table_container.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, agent/helpers/table_iterator.c,
+ agent/helpers/watcher.c,
+ include/net-snmp/net-snmp-includes.h, snmplib/data_list.c
+, snmplib/oid_stash.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/memory_aix4.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_hpux.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c:
+
+ Remove redundant '#include <dmalloc.h>' statements, since this is handled in
+ the header file which is included anyway. (Patch #1108053 by Jun Kuriyama)
+
+2005-08-17 07:50 dts12
+
+ * testing/tests/: T110agentxget, T111agentxset,
+ T112agentxsetfail, T113agentxtrap:
+
+ Support running AgentX tests when configured using separate
+ 'agentx/master agentx/subagent' modules (Patch #1049794 from magfr)
+
+2005-08-17 05:54 dts12
+
+ * snmplib/snmpUDPDomain.c:
+
+ Extend length of com2sec "source" buffer (Patch #1225130 from Andrew Steets)
+
+2005-08-17 04:45 dts12
+
+ * snmplib/winpipe.c:
+
+ Fix typo (patch #1255713 by Bernhard Penz)
+
+2005-08-16 20:09 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ fix bug 1259051: snmpd segfaults on amd64
+
+2005-08-16 17:16 rstory
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ allow ipv4 stats to work if v6 stats are not available
+
+2005-08-16 16:56 rstory
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ fix bug 1259054: snmpd: cannot open /proc/net/snmp6
+
+2005-08-16 12:29 dts12
+
+ * configure, configure.in:
+
+ Typo in the description of --enable-mib-config-checking (bug #1238301)
+
+2005-08-16 11:59 rstory
+
+ * local/snmpconf:
+
+ always specify perms to mkdir, as it is not option for older perl versions
+
+2005-08-15 18:42 rstory
+
+ * agent/agent_trap.c:
+
+ set timeout/retries to default for inform sessions
+
+2005-08-15 18:37 rstory
+
+ * agent/helpers/scalar_group.c:
+
+ fix typo
+
+2005-08-15 18:21 rstory
+
+ * agent/helpers/: instance.c, scalar_group.c, table.c
+:
+
+ wait for delegated requests before retries
+
+2005-08-14 17:22 alex_b
+
+ * win32/net-snmp/: net-snmp-config.h, net-snmp-config.h.in
+:
+
+ Fix spelling mistake in description of a define.
+
+2005-08-11 13:39 rstory
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ fix length of sysObjectID
+
+2005-08-01 07:39 alex_b
+
+ * agent/snmpd.c:
+
+ -don't use getdtablesize() for WIN32
+
+2005-08-01 07:39 alex_b
+
+ * win32/: libhelpers/libhelpers.dsp,
+ libnetsnmptrapd/Makefile.in,
+ libnetsnmptrapd/libnetsnmptrapd.dsp, snmptrapd/Makefile.in
+, snmptrapd/snmptrapd.dsp:
+
+ -Win32: Update project files with new location for notification_log.c and
+ missing table_data2.c for MSVC GUI
+
+2005-08-01 07:37 alex_b
+
+ * snmplib/data_list.c:
+
+ -Fix win32 build problem - declare variables before using.
+
+2005-07-28 07:47 dts12
+
+ * local/mib2c:
+
+ Simple 'while' loop, and (non-error) quit statement.
+
+2005-07-26 08:06 dts12
+
+ * apps/snmpusm.c:
+
+ Probe for engineID initially, so that it's available for constructing
+ the usmUserTable OIDs.
+
+2005-07-26 06:19 tanders
+
+ * FAQ:
+
+ Update OS support section. Still likely to be outdated for some platforms.
+
+2005-07-25 19:53 tanders
+
+ * testing/TESTCONF.sh:
+
+ fix bug 1230366: add "-n" to "netstat -a" to make it work even if port numbers have corresponding service names
+
+2005-07-25 19:28 rstory
+
+ * agent/: mibgroup/if-mib/data_access/interface_ioctl.c,
+ auto_nlist.c:
+
+ keep compiler happy; include header w/prototype
+
+2005-07-25 19:27 rstory
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ keep compiler happy; move param type decl into param decl list
+
+2005-07-25 19:26 rstory
+
+ * local/mib2c-conf.d/generic-value-map-reverse.m2i:
+
+ - move comment end out of conditional (since start is as well)
+ - include ctx set for non-enum types
+
+2005-07-25 19:25 rstory
+
+ * local/mib2c-conf.d/: generic-ctx-get.m2i,
+ generic-ctx-set.m2i:
+
+ deal with oid length vs size during get/set
+
+2005-07-25 15:57 rstory
+
+ * configure:
+
+ run autoconf
+
+2005-07-25 15:56 rstory
+
+ * configure.in:
+
+ add notification-log-mib to default mib list
+
+2005-07-25 15:55 rstory
+
+ * apps/: snmptrapd.c, snmptrapd_handlers.c:
+
+ - fix notifcation log include path
+ - only include notification log code if module included
+
+2005-07-25 14:35 marz
+
+ * agent/mibgroup/hardware/: cpu/.cvsignore, memory/.cvsignore
+:
+
+ fixing cvs ignore for shared libs
+
+2005-07-25 13:22 rstory
+
+ * apps/Makefile.depend:
+
+ remove dependencies on/for notification_log
+
+2005-07-25 11:39 dts12
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ Generate different code for caching and non-caching container frameworks
+ (rather than including caching support regardless)
+
+2005-07-25 11:37 dts12
+
+ * local/mib2c-conf.d/: default-mfd-top.m2c,
+ m2c_table_save_defaults.m2i, mfd-interactive-setup.m2c
+, mfd-makefile.m2m, mfd-top.m2c:
+
+ AgentX makefile and subagent driver code weren't getting generated
+ (even if they were requested). Fix this.
+
+2005-07-25 11:34 dts12
+
+ * include/net-snmp/library/snmp_client.h,
+ snmplib/snmp_client.c:
+
+ Convenience routine for setting an integer varbind value.
+
+2005-07-21 21:54 rstory
+
+ * include/net-snmp/agent/ds_agent.h:
+
+ add NETSNMP_DS_NOTIF_LOG_CTX string
+
+2005-07-21 21:52 rstory
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ log notification if using notification log mib module
+
+2005-07-21 21:51 rstory
+
+ * agent/helpers/table_container.c:
+
+ add todo commen
+
+2005-07-21 21:49 rstory
+
+ * apps/snmptrapd.c:
+
+ - remove commented out var decl
+ - remove unused num_received
+ - set snmptrapd context for notification log module
+
+2005-07-21 21:47 rstory
+
+ * apps/: snmptrapd_handlers.c, snmptrapd_handlers.h:
+
+ add interface to notification log agent module
+
+2005-07-21 21:47 rstory
+
+ * apps/: Makefile.in, notification_log.c,
+ notification_log.h:
+
+ remove unused notification_log files
+
+2005-07-21 21:36 rstory
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ - make num_received static
+ - add local enabled flag, set when module init called
+ - return immediately from log_notification if not enabled
+ - use correct index in compare, so we have a chance at finding the right row
+ (this fixes the varbind memory leak)
+
+2005-07-21 20:13 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ strdup tmp ds string that will be released
+
+2005-07-21 19:04 rstory
+
+ * agent/mibgroup/notification-log-mib/notification_log.c:
+
+ add missing semi-colon
+
+2005-07-21 19:01 rstory
+
+ * agent/mibgroup/notification-log-mib/: notification_log.c,
+ notification_log.h:
+
+ - remove agentx conditional compile
+ - remove snmptrapd headers
+ - re-work log size management
+ - add context parameter for table init routines
+ - new ds_app for module init to determine context
+ - remove dontRetainLogs config (use -I -notification_log)
+ - chg debug symbol (log_notification->notification_log)
+ - remove extraneous comments
+ - make sure transport ptr has value before using
+
+2005-07-21 18:47 rstory
+
+ * agent/mibgroup/: notification-log-mib/notification_log.c,
+ notification-log-mib/notification_log.h,
+ notification-log-mib.h:
+
+ original versions
+
+2005-07-20 20:34 alex_b
+
+ * local/snmpconf:
+
+ -Add wrapper for environment variables (my_getenv) to add Windows registry
+ support for persistent folder/file check
+ -Fix bug in get_persistentDir call (it was not passing the filename of
+ snmp.conf
+
+2005-07-20 18:19 rstory
+
+ * snmplib/system.c:
+
+ move header include to top of file
+
+2005-07-20 18:17 rstory
+
+ * snmplib/snmp_client.c:
+
+ add missing header
+
+2005-07-20 18:14 rstory
+
+ * snmplib/container_null.c:
+
+ fix include of own header (cut-n-paste error)
+
+2005-07-20 18:10 rstory
+
+ * include/net-snmp/library/: mib.h, snmp_api.h:
+
+ add missing prototype
+
+2005-07-20 18:09 rstory
+
+ * include/net-snmp/agent/table_data2.h:
+
+ remove prototype for non-existent func; add missing prototype
+
+2005-07-20 18:08 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ tweak parameters for nsb-config example
+
+2005-07-20 18:07 rstory
+
+ * agent/mibgroup/hardware/cpu/cpu_linux.c:
+
+ keep compiler happy; remove redundant semicolon
+
+2005-07-20 18:02 rstory
+
+ * agent/helpers/all_helpers.c:
+
+ keep compiler happy; add missing includes/prototype
+
+2005-07-20 18:00 rstory
+
+ * configure.in:
+
+ check for bad option [with|enable]-ssl
+
+2005-07-20 17:59 rstory
+
+ * Makefile.in:
+
+ make sure check run find on srcdir
+
+2005-07-20 11:30 dts12
+
+ * snmplib/data_list.c:
+
+ Guard against using nameless data lists. This still
+ won't work properly, but at least the agent won't crash.
+ (Yes, I know this should never happen - but you can't trust
+ some people not to do something stupid - naming no names)
+
+2005-07-20 11:27 dts12
+
+ * agent/helpers/table_array.c:
+
+ Include the handler name when registering a table_array.
+
+2005-07-19 13:44 rstory
+
+ * README.agent-mibs:
+
+ fix cut-n-paste; new tables are linux only
+
+2005-07-19 10:52 dts12
+
+ * local/mib2c.container.conf:
+
+ Improve handling of variable-length index and column values.
+
+2005-07-19 10:52 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Fix handling of variable-length indexes.
+
+2005-07-19 10:49 dts12
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h:
+
+ Provide another registration API to hide the helper internals
+ from user-level code.
+
+2005-07-18 17:57 rstory
+
+ * NEWS, README.agent-mibs:
+
+ update for new tcpConnectionTable and tcpListenerTable
+
+2005-07-18 17:53 rstory
+
+ * agent/mibgroup/tcp-mib/tcpListenerTable/: tcpListenerTable.c
+, tcpListenerTable.h, tcpListenerTable_data_access.c
+:
+
+ initial working version
+
+2005-07-18 17:39 rstory
+
+ * agent/mibgroup/: tcp-mib.h,
+ tcp-mib/tcpListenerTable/tcpListenerTable.c,
+ tcp-mib/tcpListenerTable/tcpListenerTable.h,
+ tcp-mib/tcpListenerTable/tcpListenerTable_constants.h,
+ tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c,
+ tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h,
+ tcp-mib/tcpListenerTable/tcpListenerTable_interface.c,
+ tcp-mib/tcpListenerTable/tcpListenerTable_interface.h:
+
+ initial code for tcpListenerTable
+
+2005-07-18 17:31 rstory
+
+ * agent/mibgroup/tcp-mib/tcpConnectionTable/: tcpConnectionTable.c
+, tcpConnectionTable.h, tcpConnectionTable_constants.h
+, tcpConnectionTable_data_access.c,
+ tcpConnectionTable_data_access.h,
+ tcpConnectionTable_interface.c,
+ tcpConnectionTable_interface.h:
+
+ - load cache from data access
+ - map address type
+ - shrink storage for indexes
+
+2005-07-18 17:28 rstory
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_common.c:
+
+ - fix index oid pointer
+ - add update of pid
+
+2005-07-18 17:28 rstory
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c:
+
+ - use new private header
+ - fix load prototypes
+ - check new listen state require/exclude load flag
+ - fix copy of remote address
+
+2005-07-18 16:26 rstory
+
+ * local/mib2c:
+
+ print bad line when bailing on error
+
+2005-07-18 16:25 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ fix cut-n-paste flub
+
+2005-07-18 16:24 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ remove duplicate comment block
+
+2005-07-18 16:23 rstory
+
+ * include/net-snmp/data_access/tcpConn.h:
+
+ - remove unused defines/comments
+ - add pid to struct
+ - add load flags to require/exlude listen state
+
+2005-07-18 16:20 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ add debug to freeBSD (esp error cases)
+
+2005-07-18 15:50 rstory
+
+ * agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c
+:
+
+ correct data struct name
+
+2005-07-18 15:41 rstory
+
+ * agent/mibgroup/tcp-mib/: tcpConnectionTable.h,
+ tcpConnectionTable/tcpConnectionTable.c,
+ tcpConnectionTable/tcpConnectionTable.h,
+ tcpConnectionTable/tcpConnectionTable_constants.h,
+ tcpConnectionTable/tcpConnectionTable_data_access.c,
+ tcpConnectionTable/tcpConnectionTable_data_access.h,
+ tcpConnectionTable/tcpConnectionTable_interface.c,
+ tcpConnectionTable/tcpConnectionTable_interface.h:
+
+ initial versions
+
+2005-07-18 14:08 rstory
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_private.h:
+
+ private implementation header
+
+2005-07-15 18:41 rstory
+
+ * local/mib2c-conf.d/: generic-table-constants.m2c,
+ generic-table-enums.m2c, generic-table-oids.m2c,
+ mfd-interface.m2c:
+
+ quote string argument in assignment
+
+2005-07-15 18:27 rstory
+
+ * snmplib/snmp_api.c:
+
+ clear session from callback client args on free
+
+2005-07-14 19:01 rstory
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ fix intr/ctx overflows
+
+2005-07-14 18:50 rstory
+
+ * agent/mibgroup/utilities.h:
+
+ config_require utilities/execute (for snmptrapd)
+
+2005-07-07 12:30 rstory
+
+ * snmplib/system.c:
+
+ do not close all non-std fds in daemonize (as we have probably opened some)
+
+2005-07-07 12:25 rstory
+
+ * agent/snmpd.c:
+
+ - close all non-standard fds inherited from shell immediately
+ - register signal handlers much sooner, so early signal doesn't core
+
+2005-07-06 12:34 rstory
+
+ * agent/Makefile.in:
+
+ tweak target to build (all) libs to use existing INSTALLLIBS
+
+2005-07-01 18:58 rstory
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ - use utility routine to clear delegated flag
+ - don't set error for timeout on get-next
+ - release delegated cache when undelegating requests
+
+2005-06-30 11:40 rstory
+
+ * snmplib/snmp_api.c:
+
+ - iff not applied, fix free of pkt to use alloc'd ptr, not offset in pkt
+ - iff applied, remove redundant prt clear after SNMP_FREE
+
+2005-06-30 05:27 tanders
+
+ * man/: snmp.conf.5.def, snmpcmd.1.def, snmpd.8.def
+, snmptrapd.conf.5.def:
+
+ Patch 1226187: document missing config file tokens and cmdline options
+
+2005-06-30 04:39 dts12
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ Calculate "cooked" values from historical data.
+ This changes the meaning of these figures from a system
+ life-time average to a (more useful) one-minute average,
+ and brings the Linux implementation into line with most
+ other architectures.
+
+2005-06-30 04:35 dts12
+
+ * agent/mibgroup/hardware/cpu/cpu.c,
+ include/net-snmp/agent/hardware/cpu.h:
+
+ Standard (system-independent) mechanism for tracking historical CPU
+ statistics, in order to calculate rolling averages.
+
+2005-06-29 17:27 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Do proper checks for zero return and wait rather than closing the connection
+
+2005-06-29 13:40 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Patch from Roman Tsiroulnikov to catch -1 return code from check_packet functions
+
+2005-06-28 08:37 dts12
+
+ * agent/mibgroup/hardware/memory/memory_linux.h:
+
+ Tweak the name of the core HAL memory module.
+
+2005-06-27 14:08 hardaker
+
+ * perl/SNMP/: SNMP.xs, examples/trap-example.pl:
+
+ Patch from David Beattie to fix trap reception
+
+2005-06-27 05:07 dts12
+
+ * agent/mibgroup/: host/hr_storage.c, host/hr_storage.h
+, ucd-snmp/memory.c, ucd-snmp/memory.h:
+
+ Use Hardware Abstraction Layer to implement Memory monitoring on Linux systems.
+
+2005-06-27 05:06 dts12
+
+ * agent/mibgroup/: host/hr_proc.c, host/hr_proc.h,
+ ucd-snmp/vmstat.c, ucd-snmp/vmstat.h:
+
+ Use Hardware Abstraction Layer to implement CPU monitoring on Linux systems.
+
+2005-06-27 04:57 dts12
+
+ * agent/mibgroup/hardware/cpu.h,
+ agent/mibgroup/hardware/memory.h,
+ agent/mibgroup/hardware/cpu/cpu.c,
+ agent/mibgroup/hardware/cpu/cpu.h,
+ agent/mibgroup/hardware/cpu/cpu_linux.c,
+ agent/mibgroup/hardware/cpu/cpu_linux.h,
+ agent/mibgroup/hardware/memory/hw_mem.c,
+ agent/mibgroup/hardware/memory/hw_mem.h,
+ agent/mibgroup/hardware/memory/memory_linux.c,
+ agent/mibgroup/hardware/memory/memory_linux.h,
+ include/net-snmp/agent/hardware/cpu.h,
+ include/net-snmp/agent/hardware/memory.h:
+
+ Preliminary implementation of a Hardware Abstraction Layer
+ (Just covering CPU and memory information for now, and
+ only implemented on Linux-based systems. But it's a start!)
+
+2005-06-27 04:53 dts12
+
+ * agent/mibgroup/disman/schedCore.c:
+
+ Handle week-day bit specifications.
+
+2005-06-27 04:50 dts12
+
+ * agent/mibgroup/disman/schedCore.c:
+
+ Handle reverse-day bit specifications.
+
+2005-06-24 06:18 dts12
+
+ * agent/mibgroup/disman/schedCore.c:
+
+ Initial implementation of calandar-based scheduling.
+ This doesn't handle reverse-day or weekday bits yet,
+ but should provide the basic functionality needed for
+ the "cron" and "at" configure directives.
+
+2005-06-23 08:55 dts12
+
+ * agent/mibgroup/disman/schedCore.c:
+
+ More meaningful debug output.
+
+2005-06-22 20:16 rstory
+
+ * man/snmpd.conf.5.def:
+
+ - document logmatch, agentxperms, com2secunix, engineIDType, engineIDNic
+ and leave_pidfile tokens
+
+2005-06-22 20:05 rstory
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ remove snmpd diskio token and the unused static variable it sets
+
+2005-06-22 19:48 rstory
+
+ * snmplib/system.c:
+
+ oops. declare variable used in new code.
+
+2005-06-22 19:35 rstory
+
+ * testing/eval_tools.sh:
+
+ apply patch from 1219548: don't use deprecated option
+
+2005-06-22 19:31 rstory
+
+ * snmplib/snmpUnixDomain.c:
+
+ apply patch from 1219548: don't unlink null filename
+
+2005-06-22 19:08 rstory
+
+ * snmplib/system.c:
+
+ close all fds after daemonizing
+
+2005-06-22 17:03 rstory
+
+ * Makefile.in:
+
+ new check target for full paths in dependency files
+
+2005-06-22 16:04 rstory
+
+ * agent/snmpd.c:
+
+ apply slightly modified version of 1225440: register singal handlers earlier
+
+2005-06-22 15:57 rstory
+
+ * apps/snmptrapd.c:
+
+ apply slightly modified version of 1225440: register singla handles earlier
+
+2005-06-22 13:22 rstory
+
+ * apps/notification_log.c:
+
+ move ifdef test after header with define is included
+
+2005-06-22 06:08 dts12
+
+ * agent/mibgroup/disman/: schedConf.c, schedTable.c:
+
+ Use the new schedTable entry creation routines.
+
+2005-06-22 06:07 dts12
+
+ * agent/mibgroup/disman/schedCore.c:
+
+ Ensure sensible default settings for an internal session.
+
+2005-06-22 05:41 dts12
+
+ * agent/mibgroup/utilities/iquery.c,
+ include/net-snmp/agent/ds_agent.h:
+
+ Support configuration of the version and security level
+ used to make internal queries.
+ Unfortunately, community-based requests don't currently
+ work over the callback transport, but I'm working on that.
+
+2005-06-22 05:39 dts12
+
+ * include/net-snmp/library/snmpv3.h, snmplib/snmpv3.c:
+
+ Separate out parsing security level tokens into a separate routine.
+
+2005-06-21 17:39 rstory
+
+ * configure:
+
+ run autoconf
+
+2005-06-21 17:36 rstory
+
+ * snmplib/snmp_api.c:
+
+ remove redundant assert
+
+2005-06-21 17:34 rstory
+
+ * include/net-snmp/library/snmp_logging.h:
+
+ prototype for netsnmp_logging_restart
+
+2005-06-21 17:33 rstory
+
+ * include/net-snmp/agent/snmp_vars.h:
+
+ prototypes for should_init and add_to_init_list
+
+2005-06-21 17:32 rstory
+
+ * acconfig.h, configure.in, apps/notification_log.c
+, apps/snmptrapd.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ - new --disable-snmptrapd-subagent configure option
+ - check new option to disable sub-agent code
+ - add 'I' option to command line processing, to disable modules
+ - use should_init to determine if notification log mib is disabled
+ - use new snmp_logging_restart on HUP
+
+2005-06-21 11:46 rstory
+
+ * include/net-snmp/library/snmp_logging.h:
+
+ prototype for snmp_stderrlog_status
+
+2005-06-21 11:40 dts12
+
+ * agent/mibgroup/disman/: schedCore.c, schedCore.h:
+
+ A cleaner approach to creating entries in the schedTable
+
+2005-06-21 11:38 dts12
+
+ * agent/mibgroup/utilities/: iquery.c, iquery.h:
+
+ Consistently work with SNMP versions, not "processing models".
+
+2005-06-21 11:33 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Correct template for cached table_data registration.
+
+2005-06-21 10:45 dts12
+
+ * EXAMPLE.conf.def:
+
+ Refer to the correct location for config files.
+ (Spotted by Leo Lei)
+
+2005-06-21 10:09 rstory
+
+ * apps/snmptrapd.c:
+
+ - only add notification handler iff we are an agentx subagent
+
+2005-06-20 18:07 rstory
+
+ * snmplib/snmp_api.c:
+
+ - fix setting of expect response pdu flag (I broke it fixing the SNMPv3
+ delayed engineID probe)
+
+2005-06-20 18:04 rstory
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ fix proxy handling of NOSUCHNAME on a get-next, noted on users by John Hardin
+
+2005-06-20 17:38 rstory
+
+ * agent/snmpd.c, snmplib/snmp_logging.c:
+
+ - remove unused log flags in agent
+ - set no default log flag for syslog cases
+ - new snmp_stderrlog_status() checks for enabled stderr log handlers
+ - fix re-enable of syslog in logging restart function
+ - use correct function name to re-enabe file logs
+ - C++ comments -> C comments
+
+2005-06-20 16:38 rstory
+
+ * agent/snmpd.c, snmplib/snmp_logging.c:
+
+ - new netsnmp_logging_restart() to close/reopen file based logs
+ - purge agent setup_log
+ - only enable default LOGFILE if no other log option defined
+
+2005-06-18 11:14 rstory
+
+ * configure:
+
+ run autoconf
+
+2005-06-18 10:44 rstory
+
+ * configure.in:
+
+ -move some arg checks earlier
+ -move libwrap/rpm checks back after setting NONAGENTLIBS, so they aren't
+ listed in app libs by net-snmp-config
+
+2005-06-16 13:58 rstory
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ oops- pass addr of var to sscanf
+
+2005-06-15 17:39 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ add prototype for func used before defined
+
+2005-06-15 08:05 dts12
+
+ * snmplib/mib.c:
+
+ Free the same pointer that was returned by 'strdup'
+
+2005-06-14 16:29 rstory
+
+ * snmplib/snmp_api.c:
+
+ - rework snmpv3 engineID probe delay to fix problems noted on coders
+ - set up/check sess/pdu version a little earlier
+ - set EXPECT_RESPONSE flag correctly initially, instead of global set
+ and unset for certain cases. also do it a little earlier
+ - move check for probe higher up call stack - now will be done the first
+ time a session sends a v3 pdu that expects a response
+
+2005-06-14 12:56 dts12
+
+ * agent/mibgroup/disman/schedConf.c:
+
+ Use "agentSecName" for retrieving schedule information.
+
+2005-06-14 12:00 rstory
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ fix bug 1197183: ssRawCpu* stays on 2^32-1 instead of rolling over
+
+2005-06-14 11:54 rstory
+
+ * snmplib/read_config.c:
+
+ oops- move var decl to func that var was moved to
+
+2005-06-14 11:09 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ fix bug 1217261: IF-MIB reports incorrect stats on AMD64
+
+2005-06-14 10:41 rstory
+
+ * snmplib/read_config.c:
+
+ - process optional config files during pre-mib config too
+ - if optional configs prefixed with '-', process before default configs
+
+2005-06-14 07:44 dts12
+
+ * agent/mibgroup/: disman/mteTriggerTable.c,
+ disman/mteTriggerTable.h, utilities/iquery.c:
+
+ Move "agentSecName" config directive to the iquery utility module.
+
+2005-06-14 07:37 dts12
+
+ * snmplib/snmp_client.c:
+
+ Distinguish snmp_send errors from SNMP errStat errors
+
+2005-06-14 07:37 dts12
+
+ * snmplib/snmpCallbackDomain.c:
+
+ Populate callback PDU with SNMPv3 defaults from the session structure.
+
+2005-06-13 19:25 rstory
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ run autoheader, autoconf
+
+2005-06-13 19:20 rstory
+
+ * configure.in,
+ agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ apply patch 1198210: using ethtool for gigabit NICs
+
+2005-06-13 19:01 rstory
+
+ * agent/helpers/stash_cache.c:
+
+ update for previous cache_hint method
+
+2005-06-13 17:25 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ alway pass hints to lower handlers
+
+2005-06-13 17:15 rstory
+
+ * snmplib/mib.c:
+
+ - make mibs, mibdirs and mibfiles handling consistent:
+ - '-XXX' adds XXX before existing
+ - '+XXX' adds XXX after existing
+ NOTE: this restores original behavior of '+' to that of 5.0.1. After
+ 5.0.2, if I read the code right, '+' behaviour on the cmd line and
+ in MIBDIRS was reversed and not consistent with handle_mibs_conf.
+
+2005-06-13 15:34 rstory
+
+ * README.tru64:
+
+ new read me for Tru64
+
+2005-06-13 12:30 dts12
+
+ * agent/mibgroup/mibII/: ifTable.c, ifTable.h,
+ ifTable_columns.h, ifXTable_columns.h:
+
+ Remove obsolete ifTable rewrite.
+
+2005-06-13 12:25 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Run trap handlers using 'system()' rather than 'execv()',
+ to support trap handler shell scripts.
+
+2005-06-13 12:16 dts12
+
+ * snmplib/: container_binary_array.c, parse.c,
+ snmpUDPIPv6Domain.c, snmp_parse_args.c, system.c
+, winservice.c:
+
+ Guard against assorted malloc failures.
+ Reported by Andreas Moroder.
+
+2005-06-13 11:38 dts12
+
+ * snmplib/mib.c:
+
+ Remove bogus handling of zero-width hints.
+ These might be pointless, but they are strictly valid.
+ (See RFC 2579, Section 3.1 (1))
+
+2005-06-13 10:52 dts12
+
+ * include/net-snmp/library/parse.h, snmplib/parse.c,
+ snmplib/mib.c:
+
+ Possible mechanism for addressing namespace clashes
+ (in response to Matthew Boehm' Asterisk problem)
+
+2005-06-10 16:04 hardaker
+
+ * mibs/UDP-MIB.txt:
+
+ update from RFC4113
+
+2005-06-10 16:02 rstory
+
+ * testing/rfc1213/run:
+
+ apply testing-rfc1213-run.diff from patch 1217475: build fixes
+
+2005-06-10 15:57 hardaker
+
+ * mibs/rfclist:
+
+ update the UDP-MIB to just published RFC4113
+
+2005-06-10 15:54 rstory
+
+ * testing/TESTCONF.sh:
+
+ apply testing-testconf.diff from patch 1217475: build fixes
+
+2005-06-10 15:51 rstory
+
+ * agent/helpers/Makefile.in:
+
+ apply agent-helpers-makefile.diff from patch 1217475: build fixes
+
+2005-06-10 13:07 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ init handler for agentxsocket for subagents too
+
+2005-06-10 10:55 dts12
+
+ * configure.in, configure:
+
+ Yet Another Attempt to find the correct quoting of configure options.
+
+2005-06-10 07:33 dts12
+
+ * agent/mibgroup/disman/schedCore.c:
+
+ Update to use the renamed internal and library query API calls.
+
+2005-06-10 07:32 dts12
+
+ * agent/mibgroup/utilities/: iquery.c, iquery.h:
+
+ Tweak the specifically agent-internal query routines to use the SNMP
+ library versions.
+
+2005-06-10 07:29 dts12
+
+ * include/net-snmp/library/snmp_client.h,
+ snmplib/snmp_client.c:
+
+ Move (and rename) session-based "internal query" API calls into the SNMP
+ library, so they're available as a convenience to all SNMP applications.
+
+2005-06-10 05:30 dts12
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Move special handling for "ip" interfaces to SUNV3-only code block.
+ No-one can remember what this was intended for, and it breaks
+ Linux IPv6 tunnel interfaces.
+
+2005-06-10 04:23 dts12
+
+ * net-snmp-config.in:
+
+ Bring authentication/encryption flags into line with the other commands.
+ In fact, treats '-A/-a' as equivalent, and uses the value to distinguish
+ between protocols and pass phrases. (And similarly for -X/-x)
+
+2005-06-09 17:45 rstory
+
+ * snmplib/snmp_api.c:
+
+ fix bug 1207023: snmpd crash on tcp disconnect
+
+2005-06-09 17:19 rstory
+
+ * snmplib/: snmp_api.c, snmp_client.c:
+
+ - move snmp_varlist_add_variable size checks to snmp_set_var_value
+ - use snmp_set_var_value in snmp_varlist_add_variable
+
+2005-06-09 11:52 rstory
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_common.c,
+ include/net-snmp/data_access/tcpConn.h,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c:
+
+ add ipv6 support
+
+2005-06-09 11:45 rstory
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ rename param, update docs, to reduce confusion
+
+2005-06-09 05:13 dts12
+
+ * agent/mibgroup/disman/schedConf.c:
+
+ Implement parsing of the "at" and "cron" config directives.
+ These still don't actually work, but you can't have everything....
+
+2005-06-09 05:12 dts12
+
+ * agent/mibgroup/disman/schedConf.c:
+
+ Fix parsing of "repeat" directive.
+
+2005-06-09 05:09 dts12
+
+ * agent/mibgroup/disman/: schedConf.c, schedCore.h:
+
+ It would be vaguely helpful if I knew the difference between
+ hours and months, and how many of each there were!
+
+2005-06-09 05:06 dts12
+
+ * agent/mibgroup/disman/schedCore.c:
+
+ Disable testing code.
+ (initialising the library too early breaks config file processing:-()
+
+2005-06-08 15:57 rstory
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ skip ipv6 code if ipv6 not enabled; noted on coders by eirik nordbroden
+
+2005-06-07 10:17 dts12
+
+ * agent/mibgroup/: disman.h, disman/schedConf.c,
+ disman/schedConf.h, disman/schedCore.c,
+ disman/schedCore.h, disman/schedTable.c,
+ disman/schedTable.h, disman/schedule.h:
+
+ Preliminary (and incomplete) implementation of the DisMan Schedule MIB.
+
+2005-06-06 05:31 dts12
+
+ * agent/mibgroup/utilities/: iquery.c, iquery.h:
+
+ Utility routines for making "internal queries", to retrieve or assign
+ values from elsewhere in the current agent.
+
+2005-06-06 05:23 dts12
+
+ * snmplib/snmpCallbackDomain.c:
+
+ Populate callback PDU with defaults from the session structure.
+ This allows community-based PDUs to be sent over a callback transport.
+
+2005-06-02 19:14 rstory
+
+ * snmplib/snmp_api.c:
+
+ delay SNMPv3 EngineID probe until needed
+
+2005-06-02 19:10 rstory
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ apply/re-apply fix for bug 1103644, FreeBSD memory leak
+
+2005-06-02 18:38 rstory
+
+ * agent/helpers/: cache_handler.c, multiplexer.c,
+ null.c, read_only.c:
+
+ apply patch 1210632: Replace netsnmp_set_all_requests_error
+
+2005-05-30 17:21 nba
+
+ * mibs/rfclist:
+
+ RFC 4044: FC-MGMT-MIB
+
+2005-05-30 17:17 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ Current IANA version
+
+2005-05-27 14:08 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ commit missing strtok_r changes *cough*
+
+2005-05-23 18:48 hardaker
+
+ * apps/snmp_perl_trapd.pl, perl/ASN/ASN.pm,
+ perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm, snmplib/snmp_debug.c
+, snmplib/snmpv3.c:
+
+ Applied minor bug fix/doc patches from Thomas Anders in #1206982
+
+2005-05-23 16:42 hardaker
+
+ * local/fixproc:
+
+ Use mkstemp appropriate to generate temp files
+
+2005-05-20 10:03 dts12
+
+ * apps/snmptrapd.c:
+
+ Bring '-H' initialisation into line with normal startup.
+
+2005-05-16 15:50 hardaker
+
+ * dist/net-snmp.spec:
+
+ Don't auto-build dependencies. Specify a list instead.
+
+2005-05-16 15:49 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ A bit of renumbering.
+
+2005-05-16 15:43 hardaker
+
+ * dist/makerelease:
+
+ automatted release producer script
+
+2005-05-11 19:51 driehuis
+
+ * configure.in:
+
+ Fix typo in comment
+
+2005-05-11 10:02 alex_b
+
+ * win32/dist/: htmlhelp/Net-SNMP.hhc, htmlhelp/Net-SNMP.hhp
+, scripts/readme2html:
+
+ Add README.agent-mibs to Windows binary
+
+2005-05-11 05:20 nba
+
+ * mibs/rfclist:
+
+ More RFCs with MIBs
+
+2005-05-10 21:13 alex_b
+
+ * local/: Makefile.in, snmpconf:
+
+ snmpconf: Allow SNMPCONFPATH to have multiple paths defined such as when the
+ persistent folder is included. snmpconf will also determine the configured
+ persistent folder and prevent it from being treated as a regular configuration
+ file.
+
+2005-05-10 20:44 alex_b
+
+ * NEWS:
+
+ Add fixes to NEWS for next release
+
+2005-05-09 21:07 driehuis
+
+ * configure:
+
+ Autoupdate
+
+2005-05-09 20:53 driehuis
+
+ * configure.in:
+
+ The kernel lives in /boot/kernel/kernel on recent FreeBSD's
+
+2005-05-09 19:35 alex_b
+
+ * win32/dist/: README.txt,
+ htmlhelp/Configuration_Overview.html,
+ installer/net-snmp.nsi:
+
+ Win32 binary: Add persist folder to SNMPCONFPATH
+
+2005-05-09 19:00 alex_b
+
+ * man/snmp_config.5.def, man/snmpd.8.def,
+ snmplib/snmp_api.c:
+
+ -Persistent files were not being read at startup when using
+ snmp.conf persistentDir
+ -Update persistent storage sections of snmp_config and snmpd
+ man pages
+
+2005-05-09 18:55 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ use more flexible css for markup and allow a passed in file
+
+2005-05-09 18:12 alex_b
+
+ * COPYING:
+
+ Add Fabasoft R&D Software (c) notice
+
+2005-05-09 16:37 nba
+
+ * apps/snmpdf.c:
+
+ detect extra arguments
+
+2005-05-09 16:33 nba
+
+ * apps/snmpdf.c:
+
+ snmpget => snmpdf
+
+2005-05-09 16:21 nba
+
+ * mibs/rfclist:
+
+ RFC 4008 is NAT-MIB
+
+2005-05-09 16:20 nba
+
+ * apps/snmpnetstat/if.c:
+
+ Find declarations for sighold/sigset/sigpause
+
+2005-05-09 16:18 nba
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ Ensure 0-termination of read file data
+
+2005-05-09 16:16 nba
+
+ * agent/mibgroup/smux/smux.c:
+
+ Detect too many defined peers. Properly parse symbolic peers
+
+2005-05-09 16:13 nba
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ Needed external
+
+2005-05-09 16:10 nba
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ Fix format warning
+
+2005-05-09 16:09 nba
+
+ * local/Makefile.in:
+
+ Fix for installing remote from source dir
+
+2005-05-09 16:06 nba
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Fix for NetBSD
+
+2005-05-09 16:01 nba
+
+ * configure, include/net-snmp/net-snmp-config.h.in:
+
+ Generated
+
+2005-05-09 15:45 nba
+
+ * configure.in, agent/mibgroup/ucd_snmp.h,
+ agent/mibgroup/host/hr_storage.c,
+ include/net-snmp/system/netbsd.h:
+
+ Fixes for NetBSD/FreeBSD for swap data
+
+2005-05-09 15:17 nba
+
+ * acconfig.h:
+
+ Fix mingw test that was only applied to net-snmp-config.h.in
+
+2005-05-09 15:13 nba
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Fix bogus preprocessor if
+
+2005-05-09 04:59 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Illustrate handling of cached tables using the table_data helper.
+ (Activate using "mib2c -Scache=true ...")
+
+2005-05-09 04:58 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Extract required table structures when processing RowStatus assignments.
+
+2005-05-09 04:13 dts12
+
+ * local/mib2c.iterate.conf:
+
+ Fix table max/min column registration.
+
+2005-05-06 15:14 driehuis
+
+ * configure:
+
+ Autoupdate
+
+2005-05-06 15:11 driehuis
+
+ * configure.in:
+
+ Placate autoconf259 by testing and including <vm/vm.h> before testing
+ <vm/swap_pager.h>
+
+2005-05-05 20:14 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Applied patch #1106443 from tolga ceylan to use a proper return code check for getKstatInt
+
+2005-05-05 20:04 hardaker
+
+ * Makefile.top, snmplib/Makefile.in:
+
+ Applied patch #1109712 to fix VPATH for rc files on cygwin
+
+2005-05-05 19:58 hardaker
+
+ * snmplib/snmpTCPIPv6Domain.c:
+
+ Patch #1110571 from Katsuhisa ABE to set ipv6 tcp sockets to ipv6 only if possible
+
+2005-05-05 19:51 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c,
+ snmplib/container.c:
+
+ Applied part of patch #1110610 from Peter Breitenlohner for compiler warnings
+
+2005-05-05 19:29 hardaker
+
+ * apps/snmptranslate.c, man/snmptranslate.1.def,
+ snmplib/mib.c:
+
+ Applied patch #1123242 from Mike McHenry to add mib2schema compliant output to snmptranslate
+
+2005-05-05 19:25 hardaker
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Applied patch #1124569 from Marcus Meissner to dynamically decide how
+ many cpus there on linux and to better parse information about them.
+ - modified to be compliant with ANSI and the coding style.
+
+2005-05-05 19:11 hardaker
+
+ * perl/agent/agent.xs:
+
+ Patch #1062114 by "snmpportal" to clean up a few memory leaks.
+
+2005-05-05 07:19 dts12
+
+ * include/net-snmp/library/snmp.h, snmplib/mib.c:
+
+ Patch #1117271 (variant) - check the buffer length when formatting
+ an uptime string (though without changing the existing API call).
+
+2005-05-05 05:07 dts12
+
+ * man/.cvsignore:
+
+ Ignore additional generated client man pages
+
+2005-05-04 20:58 driehuis
+
+ * configure:
+
+ Autoupdate
+
+2005-05-04 20:56 driehuis
+
+ * configure.in:
+
+ Use the accumulated wisdom of the previous AC_HEADERCHECKS for
+ HAVE_NETINET_IP_H, HAVE_NETINET_IF_H, HAVE_NETINET_IP_ICMP_H and
+ HAVE_NETINET_UDP_H (in addition to the ones already present).
+ This unbreaks the build on FreeBSD 5.3 and 4.10 (but the latter
+ still isn't playing with the full vm_swap deck).
+
+2005-05-04 20:48 driehuis
+
+ * include/net-snmp/system/freebsd5.h:
+
+ FreeBSD 5.3 is really unhappy about getting _KERNEL defined. By forcing
+ IFNET_NEEDS_KERNEL off we fix that (after all, defining _KERNEL really
+ is a gross hack for platforms that don't properly export system
+ internals -- famous last words:-)
+
+2005-05-04 11:48 dts12
+
+ * configure.in, configure:
+
+ Patch #1124652: options to explicitly include/exclude elf and bzip libraries
+
+2005-05-04 11:12 dts12
+
+ * snmplib/snmp_client.c:
+
+ Patch #1042447 - clone zero-length, non-NULL-pointer strings.
+
+2005-05-04 08:57 dts12
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Patch #1051001 - skip unnecessary call to 'auto_nlist' under NetBSD
+
+2005-05-04 08:50 dts12
+
+ * agent/mibgroup/examples/scalar_int.h:
+
+ Patch #1096479 - fix declaration of initialisation routine.
+
+2005-05-04 08:45 dts12
+
+ * agent/mibgroup/examples/notification.c:
+
+ Patch #1096483 - fix a minor inconstistency
+
+2005-05-04 08:22 dts12
+
+ * snmplib/parse.c:
+
+ Patch #1103751 - skip editor backups when loading MIB files.
+
+2005-05-04 08:07 dts12
+
+ * configure, configure.in:
+
+ Patch #1109719: Remove (apparently) redundant quoting of configure options.
+ This quoting was introduced early in the v5 lifetime to support "options
+ containing spaces" (see revision 5.26). Simple testing seems to indicate
+ that it's no longer needed, and it breaks AIX (possibly among others), so
+ let's try without it.
+ If no-one complains, this patch may need to be applied to the other branches
+ as well.
+
+2005-05-04 07:13 dts12
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Patch #1118132 - handle disappearing Linux processes.
+
+2005-05-04 06:42 alex_b
+
+ * agent/mibgroup/util_funcs.c:
+
+ Fixed #ifdef typo
+
+2005-05-04 06:13 dts12
+
+ * snmplib/scapi.c:
+
+ Patch #1117276 - tweak EVP_DigestFinal parameters to match expected types.
+
+2005-05-04 06:00 dts12
+
+ * agent/mibgroup/host/hr_partition.c:
+
+ Patch #1117265 - open devices with NDELAY when possible.
+ Avoids agent hanging on missing removable devices.
+
+2005-05-03 18:26 alex_b
+
+ * NEWS, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ win32/net-snmp/agent/mib_module_config.h:
+
+ Win32: Apply patch 1153271 by Ekkehard Domning for snmpd pass_persist support
+ for MSVC. Apply patch based on 1153271 for pass support for MSVC and MinGW.
+
+2005-05-03 10:38 dts12
+
+ * local/mib2c.int_watch.conf:
+
+ Use the watched scalar helper (rather than specialised instance helpers)
+ for implementing integer-based scalar objects. Picks up on unsigned
+ integer objects, as well as distinguishing between read-only/read-write
+ MIB definitions.
+
+2005-05-03 10:28 dts12
+
+ * local/mib2c.iterate.conf:
+
+ Illustrate handling of cached tables using the iterator helper.
+ (Activate using "mib2c -Scache=true ...")
+
+2005-05-03 10:23 dts12
+
+ * snmplib/oid_stash.c:
+
+ Stash lookup debugging code.
+
+2005-05-03 10:19 dts12
+
+ * agent/helpers/watcher.c, include/net-snmp/agent/watcher.h
+:
+
+ Convenience single-call APIs for integer-based watched scalars.
+ (Modelled on the existing instance-based calls).
+
+2005-05-03 09:07 dts12
+
+ * agent/helpers/table_data.c,
+ include/net-snmp/agent/table_data.h:
+
+ Provide a (trivial) get_{first,next} API.
+ Not strictly necessary in itself, but should aid the
+ transition to a container-based table_data style.
+
+2005-05-02 20:42 alex_b
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ Add limits.h header file
+
+2005-05-02 18:46 alex_b
+
+ * win32/: libsnmp/Makefile.in, libsnmp/libsnmp.dsp,
+ libsnmp_dll/Makefile.in, libsnmp_dll/libsnmp_dll.dsp
+:
+
+ Win32 MSVC support for fd_event_manager.[ch]
+
+2005-05-01 13:47 alex_b
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ Fix sysDescr support for MinGW
+
+2005-05-01 09:20 alex_b
+
+ * local/passtest.pl:
+
+ Added Perl version of /local/passtest shell script
+
+2005-04-30 20:38 alex_b
+
+ * snmplib/tools.c:
+
+ Cygwin: Add missing registry support for SNMPCONFPATH etc.
+
+2005-04-30 20:36 alex_b
+
+ * README.win32, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/ipAddr.c
+, agent/mibgroup/mibII/mibII_common.h,
+ agent/mibgroup/mibII/route_headers.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c, perl/SNMP/README:
+
+ -Remove 'define WIN32' for Cygwin and change ifdefs to check for either
+ WIN32 or cygwin.
+ -Add section to README.win32 describing the various Windows defines.
+ -Add note to README files about spaces in folder names when compiling.
+
+2005-04-30 18:36 alex_b
+
+ * win32/libhelpers/: Makefile.in, libhelpers.dsp:
+
+ Win32 MSVC build fixes
+
+2005-04-29 12:14 dts12
+
+ * apps/snmptrapd.c:
+
+ Patch #1149420 - use new external fd handler routines,
+ to pave the way for more integrated trap handlers.
+
+2005-04-29 12:12 dts12
+
+ * agent/agent_registry.c, agent/snmpd.c,
+ include/net-snmp/agent/agent_registry.h,
+ snmplib/Makefile.in, snmplib/fd_event_manager.c,
+ include/net-snmp/library/fd_event_manager.h:
+
+ Patch #1149420 - separate external fd handling off into
+ a distinct library module. Submitted by Sten J. Olsson
+
+2005-04-29 11:56 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c, man/snmpd.conf.5.def
+, agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ Patch #1154488 - option to specify priority of "pass" processing
+
+2005-04-29 11:48 dts12
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Apply patch #1155337 - fix diskIO average support for FreeBSD5
+
+2005-04-27 20:22 alex_b
+
+ * perl/: Makefile.PL, Makefile.subs.pl, ASN/Makefile.PL
+, OID/Makefile.PL, SNMP/Makefile.PL,
+ TrapReceiver/Makefile.PL, agent/Makefile.PL,
+ agent/default_store/Makefile.PL, default_store/Makefile.PL
+:
+
+ Win32 MSVC: Abort compile if a space is detected in the base folder
+ when compiling.
+
+2005-04-27 20:10 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ Massive debugging of memory leaks. It is now memory-leak free!
+
+2005-04-27 20:09 hardaker
+
+ * perl/OID/OID.xs:
+
+ free the sub-name if not attached to the parent structure.
+
+2005-04-27 18:55 alex_b
+
+ * NEWS, agent/mibgroup/host_res.h,
+ agent/mibgroup/host/hr_swrun.c:
+
+ Cygwin: Replace PID_ZOMBIE references as the flag was removed from
+ Cygwin in mid Jan 2005.
+
+2005-04-26 18:13 rstory
+
+ * local/mib2c.array-user.conf:
+
+ - sync some comments
+ - fix handling of OIDs in row_copy code, noted on IRC by davej_
+
+2005-04-25 12:32 rstory
+
+ * agent/helpers/table_iterator.c:
+
+ update table_iterator to use valid_column info
+
+2005-04-22 11:18 dts12
+
+ * local/mib2c.table_data.conf:
+
+ Improve handling of non-integer-based objects in table_data template code.
+
+2005-04-22 11:11 dts12
+
+ * agent/helpers/instance.c:
+
+ If an instance-based handler returns an error for a GetNext request,
+ we need to skip on to the next valid instance.
+
+2005-04-22 10:54 dts12
+
+ * snmplib/snmpusm.c:
+
+ Protect against failure to create initial user.
+
+2005-04-21 12:52 rstory
+
+ * snmplib/snmp_debug.c:
+
+ don't track debug stats by default; add stats prototypes
+
+2005-04-21 10:57 rstory
+
+ * agent/mibgroup/ucd-snmp/diskio.h, mibs/UCD-DISKIO-MIB.txt
+, agent/mibgroup/ucd-snmp/diskio.c:
+
+ apply patch 1085243: Add 64-bit counters to diskIOTable
+
+2005-04-21 10:55 rstory
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ init stat ptr to null
+
+2005-04-21 10:26 rstory
+
+ * include/net-snmp/library/callback.h, snmplib/callback.c
+:
+
+ - static delete_duplicates -> public netsnmp_callback_clear_client_arg
+ - tabs to spaces
+
+2005-04-21 10:12 rstory
+
+ * include/net-snmp/library/callback.h, snmplib/callback.c
+:
+
+ add/use callback priority macros
+
+2005-04-21 10:05 rstory
+
+ * snmplib/snmp_debug.c:
+
+ add debug token exclusion
+
+2005-04-21 09:32 rstory
+
+ * agent/mibgroup/agent/nsDebug.c:
+
+ skip excluded tokens (til mib is updated)
+
+2005-04-20 23:07 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ update for change to ctx init default
+
+2005-04-20 23:06 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ add code for DEFVALs in ctx init
+
+2005-04-20 23:06 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ default to generate ctx init
+
+2005-04-20 19:23 rstory
+
+ * local/mib2c-conf.d/mfd-data-access.m2c:
+
+ add note on index attributes already tested
+
+2005-04-20 18:50 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - fix comments
+ - revamp check_indexes to do basic validation before calling user func
+ - explicit not writable case for index/read-only vars in set cols
+
+2005-04-20 18:47 rstory
+
+ * local/mib2c-conf.d/mfd-data-access.m2c:
+
+ add comments in index handling function headers
+
+2005-04-20 18:47 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
+:
+
+ - remove hardcoded table name
+ - remove redundant prototype
+ - add some comments
+ - define prototype before use
+ - fix back function name
+ - fix too many params for function
+
+2005-04-20 18:45 rstory
+
+ * local/mib2c-conf.d/: node-validate.m2i,
+ node-varbind-validate.m2i:
+
+ - break value validation out of varbind-validate
+ - compare values/lengths directly, instead of calling function
+ - detect/handle ranges that are really single values
+
+2005-04-20 18:39 rstory
+
+ * local/mib2c-update:
+
+ fix directory copy
+
+2005-04-20 15:08 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ free string passed to perl after it's passed
+
+2005-04-20 14:44 rstory
+
+ * agent/mibgroup/examples.h:
+
+ add watched example
+
+2005-04-20 14:03 rstory
+
+ * agent/mibgroup/examples/watched.c,
+ mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ - add example string to mib
+ - add example of a watched string
+
+2005-04-19 16:51 rstory
+
+ * local/mib2c-conf.d/generic-value-map-reverse.m2i:
+
+ quiet compiler (%d -> %ld)
+
+2005-04-18 18:14 rstory
+
+ * local/mib2c-conf.d/generic-value-map-func.m2i:
+
+ quiet compiler (%d -> %ld)
+
+2005-04-18 18:12 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ - fixes for create_fewer_files setting
+ - define table name once, at top, for quicker updating
+
+2005-04-18 18:11 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ - revamp defaults handling
+ - generate defaults in top, instead of setup_table
+ - add top/table level shutdown functions
+ - define user context
+
+2005-04-18 18:10 rstory
+
+ * local/mib2c-conf.d/: mfd-interface.m2c,
+ mfd-access-container-cached-defines.m2i:
+
+ - use new m2c_data_cache to determine if we should generate cache code
+ - add function to get table container
+ - most cache_* functions renamed to container_*; remaining cache versions
+ call container versions
+ - add table/container shutdown functions
+
+2005-04-18 18:05 rstory
+
+ * local/mib2c-conf.d/mfd-readme.m2c:
+
+ move indexes_set readme here (from container-cached)
+
+2005-04-18 18:04 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-get.m2i:
+
+ - quiet compiler (%d -> %ld)
+ - remove hardcoded node name
+
+2005-04-18 18:01 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ - revamp defaults handling
+ - generate defaults in top, instead of setup_table
+ - always write defaults, so new options appear for user
+ - new options: data_cache, data_sparse
+ - more interactive questions:
+ skip mapping, sparse, uncached container, generate makefile/agentx
+
+2005-04-18 17:58 rstory
+
+ * local/mib2c-conf.d/mfd-data-get.m2c:
+
+ tweak exclusion of mapping functions
+
+2005-04-18 17:54 rstory
+
+ * local/mib2c-conf.d/m2c_table_save_defaults.m2i:
+
+ new m2i to save all table defaults
+
+2005-04-18 17:53 rstory
+
+ * local/mib2c-conf.d/: default-mfd-top.m2c,
+ m2c_setup_table.m2i:
+
+ - revamp defaults handling
+ - generate defaults in top, instead of setup_table
+ - always write defaults, so new options appear for user
+
+2005-04-18 17:49 rstory
+
+ * local/mib2c.array-user.conf:
+
+ - check for bad hdr len
+ - don't free NULL ptr
+
+2005-04-18 17:46 rstory
+
+ * local/mib2c-update:
+
+ - use named vars instead of positional, for clarity
+ - tweaks to copy updated defaults files
+
+2005-04-15 17:26 rstory
+
+ * agent/mibgroup/tcp-mib.h:
+
+ add config_add_mib
+
+2005-04-14 18:18 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2005-04-14 17:14 rstory
+
+ * configure.in:
+
+ move generation of empty includes outside of agent enabled conditional
+
+2005-04-13 22:52 rstory
+
+ * local/mib2c-conf.d/syntax-DateAndTime-get.m2i:
+
+ update parameter names to be inline w/everyone else
+
+2005-04-13 22:51 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - generate index check routines if table persistent is set
+ - don't refernce set_columns unless table settable
+ - don't check/insert new rows unnless row creation is set
+
+2005-04-13 22:47 rstory
+
+ * local/mib2c-conf.d/: mfd-data-access.m2c, mfd-data-set.m2c
+, parent-set.m2i:
+
+ - generate index check routines if table persistent is set
+ - move index check functions to data access file so they can be used by
+ the persistence routines
+
+2005-04-13 09:30 rstory
+
+ * agent/mibgroup/: if-mib.h, ip-forward-mib.h, ip-mib.h
+:
+
+ add appropriate mibs to default load list
+
+2005-04-08 10:38 alex_b
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Change index and rindex defines for MinGW to fix compile problem.
+
+2005-04-07 19:29 rstory
+
+ * local/mib2c-conf.d/: mfd-interface.m2c, mfd-top.m2c
+, syntax-RowStatus-dependencies.m2i:
+
+ - add api for reference counting
+ - add api to find row from table mib index struct
+
+2005-04-07 18:23 rstory
+
+ * agent/helpers/table_iterator.c:
+
+ pass in hint to get_first if sorted (suggested by Mike Thatcher on coders)
+
+2005-04-07 13:02 rstory
+
+ * snmplib/snmp_logging.c:
+
+ - don't disable all filelogs when a new one is enabled.
+ - again with the C++ comments, so this is re-thought before 5.3
+
+2005-04-06 12:39 rstory
+
+ * local/mib2c-update:
+
+ exclude cvs Id lines from diff
+
+2005-04-06 11:45 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ remove extraneous ;
+
+2005-04-06 11:44 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ add missing comment close
+
+2005-04-06 11:19 rstory
+
+ * local/mib2c-conf.d/: mfd-interface.m2c, mfd-top.m2c
+, parent-set.m2i:
+
+ - add function to get container size
+ - track table level dirty flag for settable tables
+ - check dirty & success to call snmp_store for settable persistent tables
+
+2005-04-05 12:46 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ - update interactive setup to prompt for persistent store
+
+2005-04-05 12:39 hardaker
+
+ * agent/helpers/table_data2.c:
+
+ remove old code not used for the container version
+
+2005-04-05 12:37 rstory
+
+ * local/mib2c-conf.d/: m2c_setup_table.m2i,
+ mfd-interface.m2c, mfd-persistence.m2i, mfd-top.m2c
+:
+
+ - move persistent store code to its own file
+ - update interactive setup to prompt for persistent store
+ - move should_save() out of interface code, into *Table.c
+ - log error if no columns found during restore
+
+2005-04-04 15:10 rstory
+
+ * snmplib/callback.c:
+
+ remove unused variable
+
+2005-04-04 14:49 rstory
+
+ * snmplib/callback.c:
+
+ clear duplicates so they aren't double-freed
+
+2005-04-01 13:58 rstory
+
+ * dist/snmptrapd-init.d:
+
+ new startup script
+
+2005-04-01 03:06 nba
+
+ * man/mib2c.conf.5:
+
+ This is a generated file
+
+2005-03-31 19:06 hardaker
+
+ * COPYING:
+
+ year update
+
+2005-03-31 18:22 hardaker
+
+ * man/snmpcmd.1.def:
+
+ mention AES too
+
+2005-03-31 17:42 hardaker
+
+ * apps/snmptrap.c:
+
+ call snmp_shutdown
+
+2005-03-31 17:41 hardaker
+
+ * agent/helpers/row_merge.c:
+
+ add result code to snmp_log message
+
+2005-03-31 17:35 hardaker
+
+ * agent/helpers/Makefile.in, agent/helpers/all_helpers.c
+, agent/helpers/table_data.c,
+ agent/helpers/table_data2.c, agent/helpers/table_dataset.c
+, agent/helpers/table_dataset2.c,
+ agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteEventNotificationTable.h,
+ agent/mibgroup/disman/mteEventTable.c,
+ apps/notification_log.c,
+ include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_data2.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_dataset2.h:
+
+ The new data and dataset helper implementations break older code and
+ thus break backwards compatibility.
+ - Mark the old data and dataset implementations as obsolete but restore
+ them from previous CVS versions. Reference the new ones in the docs
+ for the old ones.
+ - Create new data2 and dataset2 versions which are the new container
+ implementations.
+ - Make the current dataset implementations use the newer version.
+ - except the table and add_row implementations which broke
+ entirely under the new code.
+
+2005-03-30 23:21 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Fix row creation for vacm family tree rows that are beneath a parent row.
+
+2005-03-30 18:45 rstory
+
+ * agent/helpers/row_merge.c:
+
+ - add debug
+ - don't assert on condition for next/bulk
+ - the whole mode counting idea needs re-thinking..
+ - use SNMP_FREE instead of free, now that null ptrs are a possibility
+
+2005-03-30 15:12 hardaker
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c
+:
+
+ run htonl on the index addrs
+
+2005-03-29 22:38 alex_b
+
+ * win32/libhelpers/: Makefile.in, libhelpers.dsp:
+
+ Add stash_to_next to WIN32 MSVC Makefile and workspace.
+
+2005-03-29 20:11 rstory
+
+ * agent/snmpd.c:
+
+ - comment out default disable of stderr log, since it makes it impossible
+ to use stdout/stderr for logging (now that log->enabled is checked). use
+ C++ comments, since the whole log setup needs re-thinking before 5.3.
+
+2005-03-29 16:04 nba
+
+ * agent/mibgroup/: if-mib/ifTable/ifTable_interface.c,
+ if-mib/ifXTable/ifXTable_interface.c,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
+,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c,
+ ip-mib/ipAddressTable/ipAddressTable.c,
+ ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c:
+
+ Fix bad format parameters to snmp_log
+
+2005-03-29 15:05 nba
+
+ * include/net-snmp/library/cmu_compat.h,
+ include/net-snmp/library/snmp_api.h, snmplib/cmu_compat.c
+, snmplib/snmp_api.c, snmplib/snmp_client.c:
+
+ Detect and report invalid PDUs sent as response
+
+2005-03-28 15:24 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - use new check_all_requests_error to check the rc in ALL varbinds, not just
+ current row/handler varbinds
+
+2005-03-28 15:12 rstory
+
+ * snmplib/snmp_logging.c:
+
+ - fix bug 1170604 snmp_disable_stderrlog() is ignored
+ - chec for null before deref (fix snmptrapd crash noted on irc)
+
+2005-03-28 14:29 rstory
+
+ *
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
+:
+
+ fix address type in index oid
+
+2005-03-28 14:27 rstory
+
+ * agent/snmp_agent.c, include/net-snmp/agent/snmp_agent.h
+:
+
+ new function to really really check error status of all requests
+
+2005-03-25 20:56 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ check size of array in gettable before assuming it has something in it
+
+2005-03-25 09:49 alex_b
+
+ * man/snmp.conf.5.def:
+
+ Add hexOutputLength to man page.
+
+2005-03-24 22:08 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - pass NULL to config handler reg, to use current apptype
+ - add separators and headers when saving persistent data
+ - remove extraneous newline in persistent data
+
+2005-03-24 22:06 rstory
+
+ * snmplib/read_config.c:
+
+ new env var: SNMP_PERSISTENT_DIR
+
+2005-03-24 16:48 rstory
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c
+:
+
+ don't disable cache, just force reload for every request
+
+2005-03-23 19:42 rstory
+
+ * local/mib2c-conf.d/details-table.m2i:
+
+ add module name
+
+2005-03-23 19:41 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ - fix typo
+ - update config_require() path to something better for configure
+
+2005-03-23 19:34 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ remove * from default context reg type (typedef is for struct, not ptr)
+
+2005-03-22 17:30 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ match up todo with actual generated code
+
+2005-03-22 17:27 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-to-oid.m2i:
+
+ add missing param to snmp_log
+
+2005-03-18 18:09 rstory
+
+ * apps/snmptrapd.c:
+
+ make signal calls conditional based on definition of signal (like snmpd)
+
+2005-03-18 18:08 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ - add default (0) for sparse tables
+ - only mkdir if it doesn't already exist
+ - don't ignore mkdir errors
+
+2005-03-18 18:06 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
+:
+
+ move temp storage for indexes outside of example conditional
+
+2005-03-18 18:04 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ fix default for data transient (off by 1)
+
+2005-03-18 18:04 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ don't generate column_exists_flags code if sparse table not set
+
+2005-03-18 18:03 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ fix generated rowreq_ctx_init prototype
+
+2005-03-18 18:01 rstory
+
+ * local/mib2c-conf.d/: details-enums.m2i,
+ generic-get-char.m2i, generic-value-map-func.m2i,
+ generic-value-map-reverse.m2i, syntax-RowStatus-get.m2i
+:
+
+ change INTERNAL_* enum defines to include context (table) name
+
+2005-03-18 17:51 rstory
+
+ * local/mib2c.iterate.conf:
+
+ fix some typos noted on mailing lists
+
+2005-03-18 17:50 rstory
+
+ * local/mib2c-update:
+
+ - detect first run so we know to copy generate defaults to curr dir
+ - diff individual files instead of recursive diff w/excludes
+ - updates for new default directory style defaults
+
+2005-03-18 17:46 rstory
+
+ * local/mib2c:
+
+ - add table test for lastchange and storagetype tc
+ - tweak doc comments
+ - document ifconf and new ifdir
+
+2005-03-18 05:31 nba
+
+ * mibs/: Makefile.mib, TCP-MIB.txt, rfclist:
+
+ Update TCP-MIB to RFC 4022
+
+2005-03-18 05:30 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ Updated IANA-ifType-MIB
+
+2005-03-18 05:26 nba
+
+ * snmplib/system.c:
+
+ Fix a warning from BSD systems
+
+2005-03-18 04:52 nba
+
+ * man/.cvsignore:
+
+ mib2c.conf.5 is a generated file
+
+2005-03-17 05:32 nba
+
+ * perl/TrapReceiver/const-c.inc:
+
+ Ups, unintended patch undone
+
+2005-03-17 04:30 nba
+
+ * agent/agent_handler.c, agent/snmp_agent.c,
+ agent/mibgroup/if-mib/data_access/interface_linux.c,
+ include/net-snmp/library/snmp_logging.h,
+ perl/TrapReceiver/const-c.inc, snmplib/snmp_api.c,
+ snmplib/snmp_secmod.c:
+
+ Add format checking to calls to snmp_log, and fix the uncovered errors
+
+2005-03-15 01:13 nba
+
+ * agent/snmpd.c:
+
+ Include smux headers when needed
+
+2005-03-14 16:14 nba
+
+ * configure:
+
+ Sync to configure.in
+
+2005-03-14 15:53 nba
+
+ * mibs/: INET-ADDRESS-MIB.txt, Makefile.mib, rfclist
+:
+
+ Update to current INET-ADDRESS-MIB
+
+2005-03-14 15:48 nba
+
+ * configure.in:
+
+ Fix configure header alerts for Solaris 8 and 9, NetBSD 2 and FreeBSD 5
+
+2005-03-04 15:26 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ - don't overwrite existing makefile
+ - indention changes
+ - explicit close of file
+
+2005-03-04 15:24 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - add function to get/set user context
+ - use new row_merge first/last api to make sure pre/post called 1/per handler
+ - add rc param to post_request (yum, my own words were delicious)
+ - use asp status, not status of handlers requests, when checking for
+ successful request completion
+ - add support for skipping non-existent rows in sparse tables
+ - add more info to some debug msgs
+ - use SNMP_NOSUCHINSTANCE instead of ASN_PRIV_RETRY
+ - add more debugs msgs
+ - don't clear set flags til post commit
+ - remove redundant varbind length check
+ - update for new column flag names
+
+2005-03-04 15:19 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ - fix test for defaults in old location
+ - add option to re-run interactive setup if existin defaults
+
+2005-03-04 15:16 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ - add support for skipping non-existent rows in sparse tables
+ - add rc param to post_request (yum, my own words were delicious)
+ - check new vars to determine whether or not to generate support files
+ (doxygen, makefile, subagent)
+
+2005-03-04 15:10 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ - add comments on node lengths
+ - update for changes in value map reverse
+
+2005-03-04 15:07 rstory
+
+ * local/mib2c-conf.d/: generic-get-char.m2i,
+ generic-value-map-reverse.m2i:
+
+ - update BITS fields to use define INTERNAL_*_FLAG defines, instead of IS_SET_*
+ - add obvious note on the difference between C bit order and SNMP bit order
+ - add BITS mapping to reverse value map
+
+2005-03-04 15:02 rstory
+
+ * local/mib2c-conf.d/: generic-table-oids.m2c,
+ parent-dependencies.m2i, parent-set.m2i,
+ syntax-RowStatus-dependencies.m2i:
+
+ change column flag names to reduce confusion with other defined names
+
+2005-03-04 14:59 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ add new m2c_table_sparse to defaults
+
+2005-03-04 14:58 rstory
+
+ * local/mib2c-conf.d/m2c_setup_enum.m2i:
+
+ use new var for enum suffix
+
+2005-03-04 14:57 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ new var for enum suffix, set to _flag for bits objects
+
+2005-03-04 13:24 rstory
+
+ * local/mib2c-conf.d/details-enums.m2i:
+
+ - move INTERNAL_* enum macros inside ifdefs for TC
+ - generate INTERNAL_* enums flags for BITS
+
+2005-03-03 19:45 rstory
+
+ * include/net-snmp/agent/agent_handler.h:
+
+ update comments
+
+2005-03-03 19:13 rstory
+
+ * snmplib/check_varbind.c:
+
+ fix netsnmp_check_vb_range (check values, not sizes)
+
+2005-03-03 19:11 rstory
+
+ * agent/helpers/row_merge.c,
+ include/net-snmp/agent/row_merge.h:
+
+ - keep saved status data between mode calls (in reqinfo), so we can..
+ - build all temporary request lists before calling next handler, so we can..
+ - track number of requests and number of rows, so we can..
+ - provide api for lower handler to know if current call is for first/last row
+ - log a warning if handler for row returns error, but DONT exit loop
+ - if lower handler returns err, pass it to parent
+ - add more debugging
+
+2005-03-03 15:33 rstory
+
+ * agent/helpers/watcher.c, include/net-snmp/agent/watcher.h
+:
+
+ add option to watched timestamp to have a pointer to a direct value
+
+2005-03-02 18:56 rstory
+
+ * local/mib2c-conf.d/generic-table-oids.m2c:
+
+ - move column bit flag macros up with column number macros
+ - bail iff more than 32 columns. fix this later...
+
+2005-03-02 18:54 rstory
+
+ * local/mib2c.mfd.conf:
+
+ - don't run extra file from top; move down so can be controlled by defaults
+
+2005-03-02 18:52 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ - remove unused setup of m2c_nvv_sizeof
+
+2005-03-02 18:50 rstory
+
+ * local/mib2c-conf.d/node-varbind-validate.m2i:
+
+ - rework initial check_vb_* logic, checking max_size for octet strings
+ - fix range checks for octet strings
+ - use m2c data_item and node directory, eliminating a var from node setup
+ - remove generated comment and some commented out conf stuff
+
+2005-03-02 18:19 rstory
+
+ * snmplib/check_varbind.c:
+
+ proper implementation for check_vb_size_range
+
+2005-03-02 16:56 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ - move TODO comment away from linke likely to be deleted
+ - a log message indicating a node is not implemented
+
+2005-03-02 15:02 rstory
+
+ * snmplib/read_config.c:
+
+ - allow octest string read to fill buffer
+ - don't null terminate octet string if buffer full
+ - warn if input is larger than buffer
+
+2005-03-02 14:59 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ change default registration typedef to struct (not a ptr to struct)
+
+2005-03-02 14:56 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ change default registration typedef to struct (not a ptr to struct)
+
+2005-03-02 14:35 rstory
+
+ * local/mib2c-conf.d/: mfd-access-unsorted-external-defines.m2i
+, mfd-data-access.m2c, mfd-readme.m2c,
+ parent-set.m2i:
+
+ change default registration typedef to struct (not a ptr to struct)
+
+2005-03-02 14:24 rstory
+
+ * include/net-snmp/library/check_varbind.h,
+ snmplib/check_varbind.c:
+
+ fix mis-named function; add proto for correct name
+
+2005-03-02 14:18 rstory
+
+ * agent/mibgroup/smux/smux.c:
+
+ allow snmpd.conf smux OIDs to be text, not just numeric
+
+2005-03-02 14:05 rstory
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - fix library dependencies
+ - use new sysOR registration callback instead of direct function calls
+
+2005-03-02 13:58 rstory
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ add/register callbacks for reg/unreg sysOR entries
+
+2005-03-02 13:56 rstory
+
+ * include/net-snmp/agent/agent_callbacks.h:
+
+ add callbacks for reg/unreg sysOR entries
+
+2005-03-02 13:51 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - log INFO message on successful connect to master
+ - always log peername on unsuccessful connect attempt
+
+2005-03-02 13:48 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ always log agentx peer name on connect failure
+
+2005-03-02 13:45 rstory
+
+ * agent/mibgroup/agentx/client.c:
+
+ - log message on failed registration
+ - update for new version_sysoid location
+
+2005-03-02 13:43 rstory
+
+ * agent/mibgroup/util_funcs.c:
+
+ more debug/error log for problems with cache file
+
+2005-03-02 13:36 rstory
+
+ * agent/: snmp_agent.c, mibgroup/mibII/system_mib.c:
+
+ - fix library dependencies
+ - move version_sysoid into the agent (fix library dependencies)
+ - update system_mib for new sysoid location
+ - don't call hosts_ctl for callback connection
+ - log addr_string for UNKNOWN connections
+
+2005-03-02 12:17 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i:
+
+ add debug
+
+2005-03-02 12:14 rstory
+
+ * local/mib2c-conf.d/subagent.m2c:
+
+ - add -x param for master address
+ - add windows SOCK_* macros
+
+2005-03-02 12:03 rstory
+
+ * local/mib2c-conf.d/mfd-doxygen.m2c:
+
+ don't overwrite existing conf file
+
+2005-03-02 11:58 rstory
+
+ * dist/net-snmp.spec:
+
+ - fix spec so rpmbuild w/parameters should work ok
+ - make sure perl uses RPM prefix, instea of hardcoded /usr (config, pathsub)
+ - make sure makeinstall uses proper include dir path
+
+2005-02-28 07:52 wasmith32
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Added WIN32 ifdef blocks to accomodate compiling the HOST-RESOURCE mib on
+ Windows.
+
+2005-02-28 07:50 wasmith32
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Windows HOST-RESOURCE mib implementation. struct win_statfs has been moved
+ to hr_storage.h.
+
+2005-02-28 07:48 wasmith32
+
+ * agent/mibgroup/host/hr_storage.h:
+
+ Windows HR mib implementation.
+
+2005-02-27 22:34 alex_b
+
+ * perl/SNMP/: SNMP.pm, t/mib.t, t/startagent.pl:
+
+ Apply Max Baker's patch 1117696 which fixes a regex that splits a tag from
+ an iid. Also added additional tests to mib.t test script.
+
+2005-02-26 07:21 wasmith32
+
+ * agent/mibgroup/host/hr_network.c:
+
+ This is part of the HOST-RESOURCE Windows implementation. hr_network.c will
+ now compile with MinGW but much of the functionality still needs to be implemented.
+
+2005-02-25 17:45 rstory
+
+ * agent/snmpd.c:
+
+ set a good example and call SOCK_CLEANUP before exit
+
+2005-02-25 17:36 rstory
+
+ * local/mib2c-conf.d/: generic-data-allocate.m2i,
+ m2c_setup_table.m2i, mfd-interface.m2c:
+
+ fix typo in variable name
+
+2005-02-25 17:06 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ - fix prototypes, noted by niels
+ - don't generate doxygen conf file
+
+2005-02-25 17:03 rstory
+
+ * local/mib2c-update:
+
+ ignore cvs Id tags when performaing diff
+
+2005-02-25 16:46 rstory
+
+ * agent/: mibgroup/smux/smux.h, mib_modules.c,
+ snmp_vars.c:
+
+ - eliminate libnetsnmpagent refs to libnetsnmpmibs
+ - move module_init_list stuff into agent libs
+ - move smux code into agent libs
+
+2005-02-25 16:31 rstory
+
+ * agent/agent_registry.c:
+
+ - add context to register_mib debug
+ - warn if passed context doesn't match reginfo->contextName
+
+2005-02-25 16:18 rstory
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ register with context, if specified
+
+2005-02-25 16:10 rstory
+
+ * net-snmp-config.in:
+
+ - fix library orders in link lines
+ - add windows SOCK_* macros to generated subagent
+
+2005-02-19 07:00 wasmith32
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Part of the HOST-RESOURCE implementation for Windows.
+
+ * Defined win_statfs structure.
+ * Defined pagesize for Windows as 4096 (4k is what I have found through my
+ research. There is probably a variable or function to get the information
+ on Windows but I have not found it yet.)
+ * Added functions win_statfs() and win_realpath().
+
+2005-02-16 16:48 nba
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ Killing warnings
+
+2005-02-16 16:48 nba
+
+ * mibs/: NET-SNMP-EXAMPLES-MIB.txt, NET-SNMP-EXTEND-MIB.txt
+, NET-SNMP-TC.txt:
+
+ smilint'ing
+
+2005-02-15 11:23 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Implement proper SET support for nsExtendRunType.
+
+2005-02-12 08:45 nba
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ Move variable unused when <picl.h> unavailable for Solaris
+
+2005-02-12 08:32 nba
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c,
+ include/net-snmp/system/solaris.h,
+ snmplib/snmpTCPIPv6Domain.c:
+
+ Fix warnings
+
+2005-02-12 08:07 nba
+
+ * agent/: helpers/instance.c, helpers/watcher.c,
+ mibgroup/agent/extend.c, mibgroup/mibII/ipAddr.c:
+
+ Solaris gcc -m64 fixes
+
+2005-02-12 06:42 nba
+
+ * agent/snmp_agent.c:
+
+ More details when response fails. Good for locating 64-bit problems
+
+2005-02-12 05:58 nba
+
+ * agent/mibgroup/host/hr_system.c:
+
+ Fixing warnings
+
+2005-02-12 05:17 nba
+
+ * agent/mibgroup/ucd_snmp.h, agent/mibgroup/mibII/tcpTable.c
+, include/net-snmp/system/netbsd.h:
+
+ Integrate fixes from NetBSD port
+
+2005-02-10 14:53 nba
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ Fix misleading comment. Thanks to bug 1086870
+
+2005-02-10 13:43 nba
+
+ * agent/snmp_agent.c:
+
+ Include syslog.h also if not using libwrap
+
+2005-02-10 13:24 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ Fix sysIORawSent/Received which are reversed for Linux. Bug 1102518
+
+2005-02-10 10:45 nba
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Fix FreeBSD memory leak, thanks to John Sellens, bug 1103644
+
+2005-02-10 08:10 nba
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ Fixing warnings
+
+2005-02-10 07:35 nba
+
+ * snmplib/container.c:
+
+ Fixing warnings
+
+2005-02-10 07:22 nba
+
+ * snmplib/mib.c:
+
+ Fix an extraneous newline ending hexstrings
+
+2005-02-09 16:34 nba
+
+ * man/snmpcmd.1.def:
+
+ Fix bad index, pointed out in bug 1116652
+
+2005-02-09 16:30 nba
+
+ * apps/snmptable.c:
+
+ Fix a bad error message
+
+2005-02-09 16:25 nba
+
+ * agent/snmpd.c, apps/snmptrapd.c:
+
+ Remove warnings
+
+2005-02-09 16:15 nba
+
+ * snmplib/mib.c:
+
+ Remove warnings
+
+2005-02-09 16:01 nba
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ include/net-snmp/data_access/interface.h:
+
+ Another hunt fixing warnings
+
+2005-02-09 14:46 nba
+
+ * include/net-snmp/library/snmp_enum.h,
+ include/net-snmp/library/snmp_logging.h,
+ snmplib/snmp_enum.c, snmplib/snmp_logging.c:
+
+ Add some missing const-ness for parameters
+
+2005-02-08 16:56 nba
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c
+,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
+, agent/mibgroup/ip-mib/data_access/ipaddress_common.c
+, agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h,
+ agent/mibgroup/ip-mib/data_access/systemstats_common.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
+,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
+, agent/mibgroup/utilities/execute.c,
+ include/net-snmp/agent/table_container.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ snmplib/snmpUDPDomain.c, snmplib/snmp_auth.c:
+
+ Fix a bunch of trivial warnings
+
+2005-02-08 15:06 nba
+
+ * mibs/: IANAifType-MIB.txt, SMUX-MIB.txt, ianalist
+, rfclist, smistrip:
+
+ Update to current versions
+
+2005-02-08 14:54 nba
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ Fixes to allow it to pass smilint
+
+2005-01-27 22:52 rstory
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c
+:
+
+ disable caching since other code modifies underlying data
+
+2005-01-25 16:24 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ remove note on cvs2cl workaround, add note on how to get current version
+
+2005-01-25 08:51 dts12
+
+ * mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Fix misnamed row structure.
+
+2005-01-22 16:49 alex_b
+
+ * local/FAQ2HTML, local/html-add-header-footer.pl,
+ man/make_index.pl, man/man_sections.txt,
+ mibs/Makefile.in, mibs/makehtml.pl:
+
+ Updated scripts etc for generating web content.
+
+2005-01-22 15:38 alex_b
+
+ * README.win32, win32/dist/README.txt,
+ win32/dist/htmlhelp/Configuration_Overview.html:
+
+ Win32 registry documentation improvements
+
+2005-01-22 10:42 wasmith32
+
+ * agent/mibgroup/host/hr_system.c:
+
+ Added count_users functionality for Windows. The function currently returns
+ 0 for a failed call to NetWkstaGetInfo() and may require more error checking
+ on Windows systems to return a correct value for failure.
+
+2005-01-21 11:08 dts12
+
+ * agent/mibgroup/disman/mteEventTable.c:
+
+ Use the (new) table_dataset iterator API routines,
+ rather than the internal fields directly.
+
+ (I wonder how many more bits I broke?)
+
+2005-01-21 05:13 dts12
+
+ * agent/helpers/stash_to_next.c:
+
+ Don't be such an impatient child, Dave! If I've
+ told you once, I've told you a thousand times:
+
+ Tidy up properly after one request before starting on the next.
+
+ <shakes head sorrowfully>
+ Some people! - I blame the parents.....
+
+2005-01-20 09:25 dts12
+
+ * agent/helpers/table_data.c,
+ include/net-snmp/agent/table_data.h:
+
+ Re-implement 'table_data' using the 'table_container' helper.
+ The two are almost identical in behaviour anyway - just with
+ different expectations over the format of a per-row structure.
+
+2005-01-20 09:09 dts12
+
+ * apps/notification_log.c:
+
+ Use the (new) table_dataset iteration API,
+ rather than fiddling with the internal implementation.
+
+2005-01-20 09:07 dts12
+
+ * agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h:
+
+ Provide a clean API for walking through the rows of a table
+ (Rather than relying on a particular internal representation).
+
+2005-01-20 09:02 dts12
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ The API for counting the number of rows was confusingly
+ named, and not actually declared in the header file.
+ Introduce a more sensible version.
+
+2005-01-19 09:14 dts12
+
+ * agent/helpers/table_container.c,
+ include/net-snmp/agent/table_container.h:
+
+ We seem to have an inconsistently named API, depending on whether it
+ is being defined inline or not. This does not feel like a Good Idea.
+ Ensure that the same names work, regardless of inlining.
+ (That introduces a certain duplication of code, but such is life)
+
+2005-01-13 11:29 hardaker
+
+ * agent/mibgroup/mibII/ipCidrRouteTable.h:
+
+ Newer IP-FORWARD-MIB from an ID set to become an RFC
+
+2005-01-13 11:24 hardaker
+
+ * mibs/: IP-FORWARD-MIB.txt, IANA-RTPROTO-MIB.txt,
+ Makefile.in:
+
+ Newer IP-FORWARD-MIB from an ID set to become an RFC
+
+2005-01-12 11:50 dts12
+
+ * apps/snmptrapd.c:
+
+ Provide a means for snmptrapd to report /etc/hosts.{allow,deny}
+ style access control activity.
+ This should perhaps be logged via 'snmp_log' (c.f agent/snmp_agent.c)
+ but I seem to recall problems with duplicate symbols. But a debug
+ message should be safe enough....
+
+2005-01-12 11:26 rstory
+
+ * agent/mibgroup/utilities/execute.c:
+
+ define setPerrorstatus until proper fix implemented
+
+2005-01-12 09:43 alex_b
+
+ * snmplib/tools.c:
+
+ Apply patch from Philip W Gillis and Daniel Kerns for win32 getenv crash.
+
+2005-01-12 06:36 dts12
+
+ * agent/helpers/stash_cache.c,
+ include/net-snmp/agent/stash_cache.h:
+
+ Support configuration of stash-cache timeouts, both at
+ registration and via the NET-SNMP-AGENT-MIB::nsCacheTable.
+ (Don't much like the API names, though - improved suggestions
+ gratefully received).
+
+2005-01-12 06:23 dts12
+
+ * agent/helpers/stash_cache.c:
+
+ Use the standard cache helper, rather than handling this internally.
+
+2005-01-12 06:22 dts12
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ Make the handler chain information available to the cache load routine.
+ (And fix a broken debug message)
+
+2005-01-12 05:16 dts12
+
+ * agent/helpers/Makefile.in:
+
+ Include the new 'stash_to_next' helper in the helper library.
+
+2005-01-11 10:11 dts12
+
+ * include/net-snmp/agent/stash_cache.h,
+ agent/helpers/stash_cache.c, agent/helpers/stash_to_next.c
+:
+
+ Automatically inject the stash_to_next helper at registration,
+ rather than dynamically during request processing.
+ (We must try to keep our beloved leader happy and content and unsuspecting....)
+
+2005-01-11 10:02 dts12
+
+ * agent/agent_handler.c:
+
+ Support the injection of a handler sub-chain
+ (rather than just a single handler)
+
+2005-01-09 11:31 rstory
+
+ * man/snmpd.conf.5.def:
+
+ config.h -> net-snmp-config.h
+
+2005-01-08 10:10 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ read/create default files from/in subdir
+
+2005-01-08 10:01 rstory
+
+ * local/mib2c-conf.d/: default-mfd-top.m2c,
+ generic-value-map-func.m2i, m2c_setup_node.m2i,
+ mfd-interactive-setup.m2c, mfd-readme.m2c:
+
+ read/create default files from/in subdir
+
+2005-01-08 07:45 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - rename some of the new persistent functions/vars
+ - fix length handling for BITS
+ - use stack for line buffer
+ - add/tweak some debug msgs
+
+2005-01-07 07:22 dts12
+
+ * agent/helpers/stash_cache.c, agent/helpers/stash_to_next.c
+, agent/helpers/table_iterator.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/stash_to_next.h:
+
+ Extend the applicability of Wes' "stash_cache" helper, by
+ automatically converting a GETSTASH request into a GETNEXT
+ walk for those chains that don't support this mode directly.
+ (And provide a way for chains that do, to say so!)
+
+2005-01-07 04:37 dts12
+
+ * local/mib2c.scalar.conf:
+
+ Use netsnmp_check_vb_type for checking SET requests.
+
+2005-01-06 12:33 rstory
+
+ * NEWS:
+
+ not persistence support for mfd
+
+2005-01-06 12:31 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - add include to quite warning
+ - add persistence
+
+2005-01-06 12:26 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ remove condition on prototype gen now that function is always generated
+
+2005-01-06 10:16 rstory
+
+ * NEWS:
+
+ mention new option to disable set requests
+
+2005-01-06 10:10 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ new option to disable set requests (does not exclude set processing code - yet)
+
+2005-01-06 10:08 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2005-01-06 09:57 rstory
+
+ * configure.in, agent/snmp_agent.c:
+
+ new option to disable set requests (does not exclude set processing code - yet)
+
+2005-01-06 09:53 rstory
+
+ * local/mib2c-conf.d/generic-value-map-func.m2i:
+
+ remove conditional for var decl, since use isn't conditional
+
+2005-01-06 09:51 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
+:
+
+ add comment on how to disable caching
+
+2005-01-06 09:49 rstory
+
+ * local/mib2c-conf.d/syntax-InetAddress-get.m2i:
+
+ - add missing % spec in log msg
+ - gen code to copy value once addrType is known
+
+2005-01-05 17:28 rstory
+
+ * local/mib2c-conf.d/subagent.m2c:
+
+ init mibs before snmp so conf file registrations work
+
+2005-01-05 15:29 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ always generate row undo_setup/undo_cleanup
+
+2005-01-05 10:12 rstory
+
+ * net-snmp-config.in:
+
+ add case label to match lablel given in usage msg
+
+2005-01-03 10:51 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ comment out override checks where we don't have the interface name
+
+2005-01-02 20:34 rstory
+
+ * snmplib/mib.c:
+
+ Recognise whitespace characters as printable.
+
+2005-01-02 20:32 rstory
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Only issue "access control not configured" warning for the agent
+ (not snmptrapd)
+
+2005-01-02 19:50 rstory
+
+ * local/mib2c-conf.d/: generic-data-allocate.m2i,
+ mfd-data-get.m2c, mfd-interface.m2c:
+
+ don't generate TODO item for code in interfaces file
+
+2005-01-02 18:24 rstory
+
+ * agent/agent_trap.c:
+
+ - don't bind local trapsinks to localhost if clientAddr is set
+
+2004-12-31 09:28 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ comment clarification
+
+2004-12-28 18:49 rstory
+
+ * local/mib2c.mfd.conf:
+
+ fix logic for mfd table test
+
+2004-12-28 17:28 rstory
+
+ * agent/snmp_agent.c:
+
+ update rfc reference
+
+2004-12-28 16:02 rstory
+
+ * agent/helpers/instance.c:
+
+ - don't register ronly handlers as RWRITE
+ - add missing netsnmp_register_int_instance_context
+
+2004-12-28 15:54 rstory
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ use macro constants for return values, instead of hardcoded values
+
+2004-12-28 15:53 rstory
+
+ * snmplib/snmpUDPDomain.c:
+
+ debug msg w/errno when sendto fails
+
+2004-12-28 15:52 rstory
+
+ * snmplib/snmp_api.c:
+
+ add netsnmp_assert on bad ASN build
+
+2004-12-28 15:16 rstory
+
+ * agent/: agent_registry.c, helpers/old_api.c:
+
+ - always specify context, if available) for register callbacks
+ (so disconnected agentx subagents reconnect w/proper context)
+ - memset struct on stack to 0
+
+2004-12-28 12:02 rstory
+
+ * net-snmp-config.in:
+
+ fix bug 1049607: net-snmp-config --compile-subagent broken
+
+2004-12-27 10:55 rstory
+
+ * local/mib2c-conf.d/mfd-readme.m2c:
+
+ add pointer to tutorial and commandline to generate pseudo-todo list
+
+2004-12-25 00:34 rstory
+
+ * local/mib2c.mfd.conf:
+
+ bail on non-table OID until multiple tables per file are supported
+
+2004-12-25 00:21 rstory
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ fix bug 1062986: pass and pass_persist fail and crash snmpd
+
+2004-12-24 23:51 rstory
+
+ * snmplib/system.c:
+
+ fix bug 1072406: invalid operator precedence in opendir()
+
+2004-12-24 10:52 rstory
+
+ * snmplib/snmp_logging.c:
+
+ fix bug 1084413: Can't disable file logging
+
+2004-12-24 10:32 rstory
+
+ * apps/snmptrapd_handlers.c:
+
+ fix bug 1040711: snmptrapd: SIGHUP duplicates traphandlers (repeatedly)
+
+2004-12-24 09:50 rstory
+
+ * local/mib2c-update:
+
+ add -p to mkdir parm
+
+2004-12-24 09:42 rstory
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ remove hardcoded HAVE_IFNAMETOINDEX now that configure checks for it
+
+2004-12-24 09:05 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ - don't open stdout til we need it
+ - explicit close for opened file
+ - change default to asking questions instead of using defaults
+
+2004-12-24 09:01 rstory
+
+ * local/mib2c.mfd.conf:
+
+ - change default for interactive setup to on
+ - don't override report progress var if already set
+
+2004-12-23 17:57 alex_b
+
+ * README.win32, agent/mibgroup/mibII/system_mib.c,
+ win32/Configure, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ Win32: Fix compiling without PSDK.
+
+2004-12-23 14:19 alex_b
+
+ * agent/mibgroup/mibII/interfaces.c,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in,
+ win32/netsnmpmibssdk/Makefile.in,
+ win32/netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Win32 MSVC compile fixes
+
+2004-12-22 18:09 rstory
+
+ * agent/agent_trap.c:
+
+ fix bug 1088765: Agent fails to send traps to remote target
+
+2004-12-22 16:28 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-12-22 16:12 rstory
+
+ * configure.in, include/net-snmp/net-snmp-config.h.in
+:
+
+ - test for if_nametoindex
+
+2004-12-22 13:37 hardaker
+
+ * FAQ, README.thread:
+
+ mention that v3 isn't thread safe
+
+2004-12-16 21:08 rstory
+
+ * snmplib/read_config.c:
+
+ log warning on bad hex length (higher routines don't get error indication)
+
+2004-12-16 20:55 rstory
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ ifdef out v1/v2 code when both disabled
+
+2004-12-16 18:14 rstory
+
+ * agent/helpers/table_dataset.c:
+
+ -check for duplicate table defs in snmpd.conf
+ -more informative error messages
+ -support run-time tables which are augmentations
+ -log error if run-time row add fails
+
+2004-12-16 17:03 rstory
+
+ * agent/helpers/table_data.c:
+
+ more informative error messages
+
+2004-12-16 14:59 rstory
+
+ * snmplib/snmp_transport.c:
+
+ check for null var before deref
+
+2004-12-16 14:55 rstory
+
+ * agent/agent_registry.c:
+
+ cache next ptr b4 object could be freed
+
+2004-12-16 14:42 rstory
+
+ * ltmain.sh:
+
+ more helpful error message on missing library
+
+2004-12-16 14:40 rstory
+
+ * Makefile.rules:
+
+ add INSTALL_PREFIX to progress messages
+
+2004-12-15 11:17 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-12-14 08:16 rstory
+
+ * agent/mibgroup/utilities/execute.c:
+
+ delete extra ';'
+
+2004-12-14 06:42 rstory
+
+ * configure.in:
+
+ fix quoting on eval lines
+
+2004-12-13 12:40 hardaker
+
+ * agent/agent_registry.c:
+
+ registration lookup optimization allowing incoming requests to more quickly search through the linked list and do single int compares instead of full OID compares for much of the search tree. Should signficantly increase the search speed for new requests.
+
+2004-12-13 12:37 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm, perl/ASN/ASN.pm,
+ perl/AnyData_SNMP/Storage.pm, perl/OID/OID.pm,
+ perl/SNMP/SNMP.pm, perl/agent/agent.pm,
+ perl/agent/default_store/default_store.pm,
+ perl/default_store/default_store.pm, FAQ, README
+, sedscript.in, dist/net-snmp.spec,
+ snmplib/snmp_version.c:
+
+ - (): version tag ( 5.3.dev )
+
+2004-12-13 12:32 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Added a new oid-compare function which returns where the OIDs differed
+
+2004-12-13 12:27 hardaker
+
+ * include/net-snmp/agent/var_struct.h:
+
+ add an extra sorting variable: oid_off
+
+2004-12-13 08:25 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-12-13 08:24 rstory
+
+ * configure.in:
+
+ fix missing end quote
+
+2004-12-10 15:15 rstory
+
+ * NEWS:
+
+ update for recent checkins
+
+2004-12-10 15:00 rstory
+
+ * agent/helpers/table.c:
+
+ -comment tweaks
+ -free varbind indexes before parsing new ones
+ -add/use proper data_list free function for row stashes
+
+2004-12-10 14:44 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ fix for using ifName for ifDescr when ifDescr not available
+
+2004-12-10 14:41 rstory
+
+ * agent/helpers/table_dataset.c:
+
+ -fix bug 1034008: memory leak using SET for table_dataset
+ -remove unsupportd % spec in config_pwarn
+
+2004-12-10 13:14 rstory
+
+ * agent/mibgroup/utilities/execute.c:
+
+ apply patch 1052460: agent deadlock on exec
+
+2004-12-10 13:01 rstory
+
+ * agent/mibgroup/if-mib/: ifXTable/ifXTable.c,
+ ifXTable/ifXTable_interface.c, ifTable/ifTable_interface.c
+, ifTable/ifTable_interface.h:
+
+ apply patch 1055036: if-mib init order fix
+
+2004-12-10 12:56 rstory
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ apply patch 1057057: ipSystemStatsTable index fix, add ipv6
+
+2004-12-10 11:06 rstory
+
+ * agent/Makefile.in:
+
+ -new targets to make agentlib, miblib or both
+ -remove agent lib dependency on mib lib
+
+2004-12-10 11:04 rstory
+
+ * Makefile.in:
+
+ new targets to make snmplib, agent, all or individual apps
+
+2004-12-10 11:01 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-12-10 11:00 rstory
+
+ * configure.in:
+
+ -fix disable snmpv2c
+ -add partial target os to module cflags
+ -restore missing var init (fix configure slowdown)
+ -more debugging
+
+2004-12-10 10:15 rstory
+
+ * testing/rfc1213/snmpfun.sh:
+
+ fix table checks by adding missing null parameter
+
+2004-12-10 10:07 rstory
+
+ * snmplib/asn1.c:
+
+ comment change only- document why test may not always be false
+
+2004-12-10 09:57 rstory
+
+ * local/mib2c-conf.d/mfd-readme.m2c:
+
+ consistent table naming in example flow, noted on coders by Dave
+
+2004-12-10 09:48 rstory
+
+ * include/net-snmp/agent/mfd.h,
+ local/mib2c-conf.d/mfd-interface.m2c:
+
+ -add flag for row deleted
+ -if no errors, insert/delete new/deleted row into container
+
+2004-12-10 09:46 rstory
+
+ * local/mib2c-conf.d/generic-value-map.m2i:
+
+ fix case of missing get code
+
+2004-12-10 09:41 rstory
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ use same cache timeout on all platforms
+
+2004-12-10 09:33 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - apply patch 1056927: 5.2-p03: freebsd interface bugs
+ - fix bug 1055781: get-next fails to step into interfaces group correctly
+ - fix bug 1056760: agent ignores ifspeed, type settings in snmpd.conf
+ - also fix bug 1056760 fo HP-UX, solaris, Win32 and others
+
+2004-12-10 08:49 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ apply patch 1073897: fix if-mib data access 64bit counter wrap detection
+
+2004-12-09 22:39 rstory
+
+ * agent/helpers/table_array.c:
+
+ - delete removed row after user commit function called
+ - remove row insert/delete in undo - handled in commit
+
+2004-12-09 22:15 rstory
+
+ * agent/helpers/baby_steps.c:
+
+ check requests for errors on get modes too
+
+2004-12-09 21:01 rstory
+
+ * snmplib/snmp_client.c:
+
+ don't free null pointer
+
+2004-12-09 11:57 dts12
+
+ * man/: snmp.conf.5.def, snmp_config.5.def,
+ snmpd.conf.5.def, snmptrapd.conf.5.def:
+
+ Slightly cleaner summaries of config file handling.
+
+2004-12-09 11:53 dts12
+
+ * apps/snmptrapd.c:
+
+ Allow the trap daemon to specify a non-default AgentX socket.
+
+2004-12-09 11:52 dts12
+
+ * include/net-snmp/library/check_varbind.h,
+ snmplib/check_varbind.c:
+
+ New utility routines for checking maximum (rather than exact) size limits.
+
+2004-12-09 11:49 dts12
+
+ * agent/helpers/row_merge.c:
+
+ Use the length supplied during registration when deciding how
+ much of the OID to skip before comparing instance subidentifiers,
+ rather than trying to second-guess what the MIB implementer wanted.
+
+ The MfD framework (which is the only place this helper is currently
+ used) already takes the object subidentifier into account when
+ inserting the helper, thus doing so again will break things.
+
+-------------------------------------------------------------------------------
+
+Changes: V5.1 -> V5.2
+
+2004-11-24 17:34 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.2 )
+
+2004-11-24 17:34 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.2 )
+
+2004-11-24 17:34 hardaker
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.2 )
+
+2004-11-24 17:33 hardaker
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.2 )
+
+2004-11-24 17:33 hardaker
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.2 )
+
+2004-11-24 17:33 hardaker
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.2 )
+
+2004-11-24 17:33 hardaker
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.2 )
+
+2004-11-24 17:33 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.2 )
+
+2004-11-24 17:33 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.2 )
+
+2004-11-24 17:33 hardaker
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.2 )
+
+2004-11-24 17:32 hardaker
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.2 )
+
+2004-11-24 17:32 hardaker
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.2 )
+
+2004-11-24 17:15 hardaker
+
+ * NEWS:
+
+ wording changes suggested by Robert
+
+2004-11-24 17:12 hardaker
+
+ * perl/OID/OID.pm:
+
+ document get_indexes() by example
+
+2004-11-24 17:09 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ document gettable()
+
+2004-11-24 16:44 hardaker
+
+ * agent/helpers/Makefile.in:
+
+ Convert GNU specific make hacks to portable version
+
+2004-11-24 16:42 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ minor updates
+
+2004-11-24 16:41 hardaker
+
+ * NEWS:
+
+ Update for 5.2 adding a ton of new stuff
+
+2004-11-24 14:35 hardaker
+
+ * ChangeLog:
+
+ Update for 5.2
+
+2004-11-24 10:55 hardaker
+
+ * README:
+
+ update for 5.2. Added a few references to the other README files
+
+2004-11-24 10:33 hardaker
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3,
+ netsnmp_agent_registry.3, netsnmp_agent_trap.3,
+ netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3,
+ netsnmp_bulk_to_next.3, netsnmp_cache_handler.3,
+ netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_config.3,
+ netsnmp_read_only.3, netsnmp_row_merge.3,
+ netsnmp_scalar.3, netsnmp_scalar_group_group.3,
+ netsnmp_serialize.3, netsnmp_snmp_agent.3,
+ netsnmp_snmp_alarm.3, netsnmp_snmp_client.3,
+ netsnmp_snmp_logging.3, netsnmp_snmp_pdu.3,
+ netsnmp_snmp_session.3, netsnmp_stash_cache.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ Man page update for 5.2
+
+2004-11-24 10:18 hardaker
+
+ * configure, configure.in, doxygen.conf:
+
+ update to 5.2
+
+2004-11-24 08:40 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ strict man page fixes from Eric S. Raymond
+
+2004-11-18 05:27 rstory
+
+ * README.osX:
+
+ fix type noted on coders
+
+2004-11-17 10:17 rstory
+
+ * README.osX:
+
+ - document flags to use to install over Apple's version (which has a bad
+ copy of net-snmp-config
+ - document exluding the unsupported icmp table
+
+2004-11-17 06:49 dts12
+
+ * AGENT.txt:
+
+ Fix typo and missing config directive, reported by William Buckley.
+ Emphasise (in an understated British sort of way) that this is primarily
+ describing the v4 agent, and things may be different with the v5 toolkit.
+
+2004-11-17 05:29 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.2.rc4 )
+
+2004-11-17 05:29 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.2.rc4 )
+
+2004-11-17 05:28 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.2.rc4 )
+
+2004-11-17 05:28 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.2.rc4 )
+
+2004-11-17 05:28 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.2.rc4 )
+
+2004-11-17 05:28 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.2.rc4 )
+
+2004-11-17 05:28 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.2.rc4 )
+
+2004-11-17 05:28 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.2.rc4 )
+
+2004-11-17 05:27 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.2.rc4 )
+
+2004-11-17 05:27 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.2.rc4 )
+
+2004-11-17 05:27 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.2.rc4 )
+
+2004-11-17 05:26 rstory
+
+ * README:
+
+ - (README): version tag ( 5.2.rc4 )
+
+2004-11-17 05:26 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.2.rc4 )
+
+2004-11-16 16:56 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-11-16 16:55 rstory
+
+ * configure.in, doxygen.conf:
+
+ update version to rc4
+
+2004-11-16 15:42 rstory
+
+ * agent/mibgroup/if-mib/data_access/: interface.h,
+ interface_common.c:
+
+ - don't configure in interface ioctl code by default
+ - ifdef out arch dependent code in interface common
+
+2004-11-12 07:36 hardaker
+
+ * NEWS:
+
+ minor tweaks
+
+2004-11-11 06:36 rstory
+
+ * NEWS:
+
+ mention more changes and fixes
+
+2004-11-09 08:21 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Document the non-optional nature of snmpd.conf
+ (spotted by William Buckley)
+
+2004-11-09 08:12 dts12
+
+ * FAQ:
+
+ Raid Robert's FAQ for some useful entries.
+
+2004-11-09 05:16 dts12
+
+ * TODO:
+
+ It's about time we had a fresh TODO list.
+ There may well be bits that can be salvaged from the
+ old version, but I'll leave that to someone else.
+
+2004-11-05 21:35 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.2.rc3 )
+
+2004-11-05 21:34 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.2.rc3 )
+
+2004-11-05 21:34 hardaker
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.2.rc3 )
+
+2004-11-05 21:34 hardaker
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.2.rc3 )
+
+2004-11-05 21:34 hardaker
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.2.rc3 )
+
+2004-11-05 21:34 hardaker
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.2.rc3 )
+
+2004-11-05 21:34 hardaker
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.2.rc3 )
+
+2004-11-05 21:34 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.2.rc3 )
+
+2004-11-05 21:33 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.2.rc3 )
+
+2004-11-05 21:33 hardaker
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.2.rc3 )
+
+2004-11-05 21:33 hardaker
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.2.rc3 )
+
+2004-11-05 21:33 hardaker
+
+ * README:
+
+ - (README): version tag ( 5.2.rc3 )
+
+2004-11-05 21:33 hardaker
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.2.rc3 )
+
+2004-11-05 21:31 hardaker
+
+ * doxygen.conf, man/netsnmp_Container_iterator.3,
+ man/netsnmp_agent.3, man/netsnmp_agent_registry.3,
+ man/netsnmp_agent_trap.3, man/netsnmp_asn1_packet_parse.3
+, man/netsnmp_baby_steps.3, man/netsnmp_bulk_to_next.3
+, man/netsnmp_cache_handler.3, man/netsnmp_callback.3
+, man/netsnmp_container.3, man/netsnmp_data_list.3
+, man/netsnmp_debug.3, man/netsnmp_default_store.3
+, man/netsnmp_handler.3, man/netsnmp_instance.3
+, man/netsnmp_iterator_info_s.3, man/netsnmp_leaf.3
+, man/netsnmp_library.3, man/netsnmp_mib_utilities.3
+, man/netsnmp_mode_end_call.3,
+ man/netsnmp_multiplexer.3,
+ man/netsnmp_netsnmp_agent_request_info_s.3,
+ man/netsnmp_netsnmp_column_info_t.3,
+ man/netsnmp_netsnmp_data_list_s.3,
+ man/netsnmp_netsnmp_handler_registration_s.3,
+ man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_access_methods.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_netsnmp_mib_handler_s.3,
+ man/netsnmp_netsnmp_request_info_s.3,
+ man/netsnmp_netsnmp_table_registration_info_s.3,
+ man/netsnmp_netsnmp_table_request_info_s.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_config.3, man/netsnmp_read_only.3,
+ man/netsnmp_row_merge.3, man/netsnmp_scalar.3,
+ man/netsnmp_scalar_group_group.3, man/netsnmp_serialize.3
+, man/netsnmp_snmp_agent.3, man/netsnmp_snmp_alarm.3
+, man/netsnmp_snmp_client.3,
+ man/netsnmp_snmp_logging.3, man/netsnmp_snmp_pdu.3,
+ man/netsnmp_snmp_session.3, man/netsnmp_stash_cache.3
+, man/netsnmp_table.3, man/netsnmp_table_array.3
+, man/netsnmp_table_container.3,
+ man/netsnmp_table_data.3, man/netsnmp_table_dataset.3
+, man/netsnmp_table_iterator.3, man/netsnmp_util.3
+, man/netsnmp_utilities.3,
+ man/netsnmp_variable_list.3, man/netsnmp_watcher.3:
+
+ version update
+
+2004-11-05 21:21 hardaker
+
+ * configure, configure.in:
+
+ version update
+
+2004-11-05 20:27 hardaker
+
+ * README.solaris:
+
+ update from Bruce
+
+2004-11-05 13:08 wasmith32
+
+ * agent/mibgroup/mibII/interfaces.h:
+
+ This patch fixes a configure problem when compiling with some Windows compilers.
+ The affected platforms were MinGW and Cygwin, the patch should not effect MSVC++
+ builds.
+
+2004-11-05 02:05 dts12
+
+ * man/: Makefile.in, snmpdelta.1, snmpdelta.1.def
+, snmpdf.1, snmpdf.1.def, snmpnetstat.1,
+ snmpnetstat.1.def:
+
+ Generate "fixed information" command man pages dynamically
+ (so they pick up the version header) rather than have them static.
+
+2004-11-05 01:28 dts12
+
+ * man/: mib2c.1.def, snmpbulkget.1.def,
+ snmpbulkwalk.1.def, snmpcmd.1.def, snmpdelta.1
+, snmpdf.1, snmpget.1.def, snmpgetnext.1.def
+, snmpnetstat.1, snmpset.1.def, snmpstatus.1.def
+, snmptable.1.def, snmptranslate.1.def,
+ snmptrap.1.def, snmpusm.1.def, snmpvacm.1.def,
+ snmpwalk.1.def:
+
+ Tweak the one-line descriptions of various commands to improve
+ consistency and clarity
+
+2004-11-04 21:38 rstory
+
+ * README.agent-mibs:
+
+ updates (mostly stuff we don't support)
+
+2004-10-29 22:16 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.2.rc2 )
+
+2004-10-29 22:15 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.2.rc2 )
+
+2004-10-29 22:15 hardaker
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.2.rc2 )
+
+2004-10-29 22:15 hardaker
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.2.rc2 )
+
+2004-10-29 22:15 hardaker
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.2.rc2 )
+
+2004-10-29 22:15 hardaker
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.2.rc2 )
+
+2004-10-29 22:15 hardaker
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.2.rc2 )
+
+2004-10-29 22:15 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.2.rc2 )
+
+2004-10-29 22:14 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.2.rc2 )
+
+2004-10-29 22:14 hardaker
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.2.rc2 )
+
+2004-10-29 22:14 hardaker
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.2.rc2 )
+
+2004-10-29 22:14 hardaker
+
+ * README:
+
+ - (README): version tag ( 5.2.rc2 )
+
+2004-10-29 22:14 hardaker
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.2.rc2 )
+
+2004-10-29 22:10 hardaker
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3,
+ netsnmp_agent_registry.3, netsnmp_agent_trap.3,
+ netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3,
+ netsnmp_bulk_to_next.3, netsnmp_cache_handler.3,
+ netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_config.3,
+ netsnmp_read_only.3, netsnmp_row_merge.3,
+ netsnmp_scalar.3, netsnmp_scalar_group_group.3,
+ netsnmp_serialize.3, netsnmp_snmp_agent.3,
+ netsnmp_snmp_alarm.3, netsnmp_snmp_client.3,
+ netsnmp_snmp_logging.3, netsnmp_snmp_pdu.3,
+ netsnmp_snmp_session.3, netsnmp_stash_cache.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ -> 5.2.rc2
+
+2004-10-29 22:05 hardaker
+
+ * configure, configure.in, doxygen.conf:
+
+ -> 5.2.rc2
+
+2004-10-29 13:28 rstory
+
+ * README.agent-mibs:
+
+ first pass at agent mibs readme
+
+2004-10-26 05:40 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-10-26 05:37 rstory
+
+ * configure.in:
+
+ don't unconditionally add libraries (freebsd doesn't have libdl)
+
+2004-10-22 18:06 hardaker
+
+ * dist/net-snmp.spec:
+
+ fix conflict
+
+2004-10-22 18:02 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.2.rc1 )
+
+2004-10-22 18:01 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.2.rc1 )
+
+2004-10-22 18:01 hardaker
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.2.rc1 )
+
+2004-10-22 18:01 hardaker
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.2.rc1 )
+
+2004-10-22 18:01 hardaker
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.2.rc1 )
+
+2004-10-22 18:01 hardaker
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.2.rc1 )
+
+2004-10-22 18:00 hardaker
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.2.rc1 )
+
+2004-10-22 18:00 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.2.rc1 )
+
+2004-10-22 18:00 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.2.rc1 )
+
+2004-10-22 17:59 hardaker
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.2.rc1 )
+
+2004-10-22 17:59 hardaker
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.2.rc1 )
+
+2004-10-22 17:59 hardaker
+
+ * README:
+
+ - (README): version tag ( 5.2.rc1 )
+
+2004-10-22 17:59 hardaker
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.2.rc1 )
+
+2004-10-22 17:57 hardaker
+
+ * agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, agent/Makefile.depend
+, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2004-10-22 17:46 hardaker
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3,
+ netsnmp_agent_registry.3, netsnmp_agent_trap.3,
+ netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3,
+ netsnmp_bulk_to_next.3, netsnmp_cache_handler.3,
+ netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_config.3,
+ netsnmp_read_only.3, netsnmp_row_merge.3,
+ netsnmp_scalar.3, netsnmp_scalar_group_group.3,
+ netsnmp_serialize.3, netsnmp_snmp_agent.3,
+ netsnmp_snmp_alarm.3, netsnmp_snmp_client.3,
+ netsnmp_snmp_logging.3, netsnmp_snmp_pdu.3,
+ netsnmp_snmp_session.3, netsnmp_stash_cache.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ make docs
+
+2004-10-22 17:41 hardaker
+
+ * include/net-snmp/net-snmp-config.h.in, configure,
+ configure.in, doxygen.conf:
+
+ version update
+
+2004-10-22 11:41 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-10-22 11:40 rstory
+
+ * configure.in:
+
+ - move PIC check after module processing, & check against complete module list
+ - check diskio and lmSensors against complete module list
+
+2004-10-22 11:37 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.c,
+ ifTable_data_access.c:
+
+ fixes for building ifTable w/out ifXTable
+
+2004-10-22 02:17 dts12
+
+ * mibs/Makefile.in:
+
+ If we're going to include the NET-SNMP-EXTEND-MIB support by default,
+ (and load it automatically), it would be even more useful to actually
+ install it, so it was available to _be_ loaded!
+
+2004-10-22 02:17 dts12
+
+ * agent/mibgroup/agent/extend.h:
+
+ If we're going to include the NET-SNMP-EXTEND-MIB support by default,
+ it would be sensible to load that MIB automatically.
+
+2004-10-21 15:57 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ ifdef use of variable that isn't always defined
+
+2004-10-21 11:42 rstory
+
+ * agent/helpers/table_dataset.c:
+
+ fix for multiple rows/tables set problem, noted by Sven Jonas on coders
+
+2004-10-20 21:02 slif
+
+ * Makefile.in:
+
+ invoke perlrealclean first in the distclean sequence.
+
+2004-10-20 19:55 slif
+
+ * Makefile.in:
+
+ perform deep cleaning on Perl tree to fix bug #894425.
+
+2004-10-20 19:35 slif
+
+ * apps/snmpnetstat/if.c:
+
+ fix table overflow (inspired by Debian patch to 5.1.2).
+
+2004-10-20 18:52 slif
+
+ * man/mib_api.3.def:
+
+ remove second read_objid from methods list (Inspired by current Debian patch)
+
+2004-10-20 16:52 slif
+
+ * agent/mibgroup/ucd-snmp/memory.c,
+ include/net-snmp/library/system.h, snmplib/snmpUDPDomain.c
+, snmplib/system.c:
+
+ fix bug#1043197 (2) - test os version and release using uname to qualify action
+
+2004-10-19 16:26 rstory
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ move rpm header includes inside HAVE_LIBRPM because of header dependencies
+
+2004-10-19 16:23 rstory
+
+ * configure.in:
+
+ - move rpm checks back after module processing, since rpm only included
+ iff hr_swinst gets configured in
+
+2004-10-19 14:04 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c:
+
+ remove cpp warning
+
+2004-10-19 14:01 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-10-19 14:00 rstory
+
+ * configure.in:
+
+ - update release
+ - for every AC_ARG_ENABLE, add corresponding AC_ARG_WITH with error message
+ - for every AC_ARG_WITH, add corresponding AC_ARG_ENABLE with error message
+ - move librwap/rpm checks earlier, so they will fail before module processing
+ - check mbstat struct for m_clusters (freebsd apparently dropped it)
+
+2004-10-19 03:19 dts12
+
+ * local/mib2c.array-user.conf:
+
+ Don't generate 'Get' code for inaccessible objects.
+
+2004-10-19 03:13 dts12
+
+ * agent/helpers/table_array.c:
+
+ Protect against the agent crashing if no 'delete_row' or
+ 'duplicate_row' routines were configured.
+
+2004-10-19 03:12 dts12
+
+ * agent/helpers/table_array.c:
+
+ Prevent the agent from spinning in an infinite loop
+ at the end of the table.
+
+2004-10-19 03:05 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Report *which* agentx socket couldn't be opened.
+
+2004-10-18 20:24 rstory
+
+ * doxygen.conf:
+
+ update release
+
+2004-10-18 20:23 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ replace incorrect comment block w/note about possible future optimization
+
+2004-10-18 20:23 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ - use new ioctl ifIndex find
+ - make next alias func static
+
+2004-10-18 20:21 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c:
+
+ - use new ipaddress entry copy function for table level undo setup
+ - remove node level undo setup
+ - implement undo_commit
+
+2004-10-18 20:20 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ include/net-snmp/data_access/ipaddress.h:
+
+ new netsnmp_access_ipaddress_entry_copy to copy entries
+
+2004-10-17 20:56 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c
+:
+
+ - update generated code
+ - fix slight memory leak
+
+2004-10-17 20:53 rstory
+
+ * agent/mibgroup/:
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
+,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
+, ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
+, ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+ ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
+:
+
+ update generated code
+
+2004-10-17 20:49 rstory
+
+ * agent/mibgroup/if-mib/data_access/: interface_ioctl.h,
+ interface_linux.c:
+
+ add fd parameter to netsnmp_access_interface_ioctl_ifindex_get
+
+2004-10-17 19:56 rstory
+
+ * local/mib2c-conf.d/: mfd-access-container-cached-defines.m2i
+, mfd-interface.m2c:
+
+ only track whether user allocated data context for non-transient data
+
+2004-10-16 19:53 alex_b
+
+ * win32/dist/scripts/mandir2html:
+
+ Win32 mandir2html script was cutting off the bottom the man pages. Fixed.
+
+2004-10-16 19:00 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c:
+
+ - use new fd param for ifindex lookup, with local socket
+ - don't lookup interface if no name
+
+2004-10-16 18:59 rstory
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ don't use m_clusters if not available
+
+2004-10-16 18:53 rstory
+
+ * agent/mibgroup/mibII/interfaces.h:
+
+ simply require interface, let it decide about specific arch requires
+
+2004-10-16 18:52 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c:
+
+ - always define ifindex function; simply return 0 if SIOCGIFINDEX not avail
+ - add fd param to ifindex get, for optimization
+
+2004-10-16 18:51 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ - separate interface_common init from access_interface init
+ - call access function, not arch (so unsupported arches work)
+
+2004-10-16 18:49 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.h:
+
+ always include ioctl w/interface stuff
+
+2004-10-16 18:48 rstory
+
+ * agent/: mib_modules.c, snmp_vars.c:
+
+ move access init from agent to mib init
+
+2004-10-16 13:44 rstory
+
+ * testing/rfc1213/test_fun:
+
+ - comment out ansi colors (inconsistent use)
+ - prefix sub-tests & summary with main test number to reduce confusion
+
+2004-10-16 13:43 rstory
+
+ * testing/rfc1213/snmpfun.sh:
+
+ use snmpgetnext instead of snmptable testing tables
+
+2004-10-16 13:42 rstory
+
+ * testing/eval_tools.sh:
+
+ - check for no pid files found
+ - check for pidfile vanishing
+
+2004-10-16 13:40 rstory
+
+ * testing/RUNTESTS:
+
+ remove stray quote
+
+2004-10-16 10:32 rstory
+
+ * testing/TESTCONF.sh:
+
+ if netstat is available, test for port in use and try 2 more random ports
+
+2004-10-15 21:01 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.2.pre3 )
+
+2004-10-15 21:00 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.2.pre3 )
+
+2004-10-15 21:00 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.2.pre3 )
+
+2004-10-15 21:00 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.2.pre3 )
+
+2004-10-15 20:59 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.2.pre3 )
+
+2004-10-15 20:59 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.2.pre3 )
+
+2004-10-15 20:58 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.2.pre3 )
+
+2004-10-15 20:58 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.2.pre3 )
+
+2004-10-15 20:58 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.2.pre3 )
+
+2004-10-15 20:57 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.2.pre3 )
+
+2004-10-15 20:57 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.2.pre3 )
+
+2004-10-15 20:57 rstory
+
+ * README:
+
+ - (README): version tag ( 5.2.pre3 )
+
+2004-10-15 20:56 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.2.pre3 )
+
+2004-10-15 20:48 rstory
+
+ * agent/Makefile.depend, agent/mibgroup/Makefile.depend
+, snmplib/Makefile.depend,
+ agent/helpers/Makefile.depend, apps/Makefile.depend
+, apps/snmpnetstat/Makefile.depend:
+
+ make depend
+
+2004-10-15 20:48 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3,
+ netsnmp_agent_registry.3, netsnmp_agent_trap.3,
+ netsnmp_asn1_packet_parse.3, netsnmp_baby_steps.3,
+ netsnmp_bulk_to_next.3, netsnmp_cache_handler.3,
+ netsnmp_callback.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_default_store.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3,
+ netsnmp_multiplexer.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_netsnmp_mib_handler_methods.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_config.3,
+ netsnmp_read_only.3, netsnmp_row_merge.3,
+ netsnmp_scalar.3, netsnmp_scalar_group_group.3,
+ netsnmp_serialize.3, netsnmp_snmp_agent.3,
+ netsnmp_snmp_alarm.3, netsnmp_snmp_client.3,
+ netsnmp_snmp_logging.3, netsnmp_snmp_pdu.3,
+ netsnmp_snmp_session.3, netsnmp_stash_cache.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_container.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_variable_list.3, netsnmp_watcher.3:
+
+ update for 5.2.pre3
+
+2004-10-15 20:35 rstory
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c:
+
+ remove C++ style comments
+
+2004-10-15 20:14 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ update for data acccess change
+
+2004-10-15 20:04 rstory
+
+ * README.solaris, agent/mibgroup/ucd-snmp/lmSensors.c
+:
+
+ lmSensors changes from Bruce
+
+2004-10-15 18:00 alex_b
+
+ * win32/dist/scripts/mandir2html:
+
+ Win32 mandir2html script was cutting off the top of the man pages. Fixed.
+
+2004-10-15 17:35 rstory
+
+ * agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/:
+ usmDHUserKeyTable.h, usmDHUserKeyTable_data_access.c,
+ usmDHUserKeyTable_data_access.h,
+ usmDHUserKeyTable_data_get.c, usmDHUserKeyTable_data_get.h
+, usmDHUserKeyTable_data_set.c,
+ usmDHUserKeyTable_data_set.h, usmDHUserKeyTable_interface.c
+, usmDHUserKeyTable_interface.h,
+ usmDHUserKeyTable_oids.h:
+
+ update generated code; run indent
+
+2004-10-15 17:31 rstory
+
+ * agent/mibgroup/ip-mib/ipSystemStatsTable/: ipSystemStatsTable.c
+, ipSystemStatsTable.h, ipSystemStatsTable_constants.h
+, ipSystemStatsTable_data_access.c,
+ ipSystemStatsTable_data_access.h,
+ ipSystemStatsTable_interface.c,
+ ipSystemStatsTable_interface.h:
+
+ regenerate code; run indent
+
+2004-10-15 17:25 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/: ipAddressTable.c,
+ ipAddressTable.h, ipAddressTable_data_access.c,
+ ipAddressTable_data_access.h, ipAddressTable_interface.c
+, ipAddressTable_interface.h:
+
+ update generated code; run indent
+
+2004-10-15 17:21 rstory
+
+ * agent/mibgroup/ip-mib/inetNetToMediaTable/: inetNetToMediaTable.c
+, inetNetToMediaTable.h,
+ inetNetToMediaTable_data_access.c,
+ inetNetToMediaTable_data_access.h,
+ inetNetToMediaTable_interface.c,
+ inetNetToMediaTable_interface.h:
+
+ update generated code; run indent
+
+2004-10-15 17:15 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/:
+ ipCidrRouteTable.c, ipCidrRouteTable.h,
+ ipCidrRouteTable_data_access.c,
+ ipCidrRouteTable_data_access.h,
+ ipCidrRouteTable_interface.c, ipCidrRouteTable_interface.h
+:
+
+ update generated code; run indent
+
+2004-10-15 17:00 rstory
+
+ * agent/mibgroup/ip-forward-mib/inetCidrRouteTable/:
+ inetCidrRouteTable.c, inetCidrRouteTable.h,
+ inetCidrRouteTable_data_access.c,
+ inetCidrRouteTable_data_access.h,
+ inetCidrRouteTable_interface.c,
+ inetCidrRouteTable_interface.h:
+
+ update generated code; run indent
+
+2004-10-15 16:52 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/: ifXTable.c, ifXTable.h
+, ifXTable_data_access.c, ifXTable_interface.c
+, ifXTable_interface.h:
+
+ update generated code; run indent
+
+2004-10-15 16:34 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.c, ifTable.h
+, ifTable_data_access.c, ifTable_interface.c,
+ ifTable_interface.h:
+
+ update generated code; run indent
+
+2004-10-15 15:23 rstory
+
+ * agent/mibgroup/ip-mib/ipSystemStatsTable/:
+ ipSystemStatsTable-README-FIRST.txt,
+ ipSystemStatsTable-README-ipSystemStatsTable.txt:
+
+ remove non-source files
+
+2004-10-15 15:20 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+:
+
+ fix max index len
+
+2004-10-15 15:18 rstory
+
+ * agent/mibgroup/ip-forward-mib/:
+ ipCidrRouteTable/ipCidrRouteTable_data_access.c,
+ inetCidrRouteTable/inetCidrRouteTable_data_access.c:
+
+ fix cut-n-paste in log msg
+
+2004-10-15 15:13 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ include/net-snmp/data_access/interface.h,
+ agent/mibgroup/mibII/ipAddr.c:
+
+ use SIOCGIFINDEX ioctl for ifIndex
+
+2004-10-15 15:09 rstory
+
+ * agent/mibgroup/if-mib/data_access/: interface_common.c,
+ interface_ioctl.c, interface_ioctl.h,
+ interface_linux.c:
+
+ use SIOCGIFINDEX ioctl for ifIndex
+
+2004-10-15 11:52 rstory
+
+ * include/net-snmp/library/default_store.h,
+ man/snmp.conf.5.def, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c, snmplib/snmp_api.c
+:
+
+ tweak buffer size code and apply to tcp sockets too
+
+2004-10-14 20:29 wasmith32
+
+ * agent/mibgroup/host_res.h:
+
+ Modified includes for Windows builds to include winsock rather than Unix sockets.
+
+2004-10-14 18:15 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+:
+
+ optimize mib index size defs (reduce cache size by half!)
+
+2004-10-14 18:04 rstory
+
+ * agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/:
+ usmDHUserKeyTable.h, usmDHUserKeyTable_data_access.c,
+ usmDHUserKeyTable_data_get.c, usmDHUserKeyTable_data_set.c
+, usmDHUserKeyTable_interface.c,
+ usmDHUserKeyTable_interface.h:
+
+ update generated code; don't use struct ptr as data context
+
+2004-10-14 17:53 rstory
+
+ * include/net-snmp/data_access/route.h:
+
+ define max policy length
+
+2004-10-14 17:52 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ minor tweak to comments, reduce diffs on switch from embedded->allocated data
+
+2004-10-14 17:51 rstory
+
+ * include/net-snmp/agent/mfd.h,
+ local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
+, local/mib2c-conf.d/mfd-interface.m2c:
+
+ don't free a data context we didn't allocate
+
+2004-10-14 17:50 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ clarify that a pointer shouldn't be used as the data context type
+
+2004-10-14 17:49 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes.m2i:
+
+ account for ipaddres->OID conversion in index space allocations
+
+2004-10-14 17:48 rstory
+
+ * local/mib2c-conf.d/: generic-ctx-set.m2i,
+ m2c_setup_table.m2i, syntax-COUNTER64-get.m2i:
+
+ minor tweak to comments, reduce diffs on switch from embedded->allocated data
+
+2004-10-14 17:45 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ fix var name
+
+2004-10-14 05:57 dts12
+
+ * local/: mib2c.access_functions.conf, mib2c.container.conf
+, mib2c.iterate.conf, mib2c.scalar.conf,
+ mib2c.table_data.conf:
+
+ Return 'SNMP_ERR_NOERROR' on "normal" SET errors.
+ (Such errors should only be reported via netsnmp_set_request_error)
+
+2004-10-13 19:21 slif
+
+ * snmplib/snmp_logging.c:
+
+ use correct facility when initializing syslog log handler.
+
+2004-10-13 18:36 alex_b
+
+ * win32/dist/: README.build.win32.txt,
+ installer/net-snmp.nsi:
+
+ Remove reboot warning from register scripts and clarify step in build steps
+
+2004-10-13 15:24 alex_b
+
+ * README.win32, win32/Configure,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp.def.in:
+
+ Create libsnmp.def.in file for snmplib_dll and modify win32\Configure to
+ generate libsnmp.def if dynamic is specified and with or without the IPv6
+ lines in libsnmp.def.
+
+2004-10-12 21:10 hardaker
+
+ * agent/snmp_agent.c, apps/snmptrapd.c:
+
+ Fix bug [ 1045605 ] syntax error in snmptrapd.c (wrong arg order)
+
+2004-10-12 17:04 rstory
+
+ * snmplib/mib.c:
+
+ allow build_oid_noalloc to completely fill incoming buffer
+
+2004-10-12 16:14 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ -move initialization of internals back before we use them
+ (ah, the joys of automated patching)
+
+2004-10-12 14:56 rstory
+
+ * agent/mibgroup/: if-mib/ifTable/.mib2c-updaterc,
+ if-mib/ifTable/default-table-ifTable.m2d,
+ if-mib/ifXTable/.mib2c-updaterc,
+ if-mib/ifXTable/default-table-ifXTable.m2d,
+ ip-forward-mib/inetCidrRouteTable/.mib2c-updaterc,
+ ip-forward-mib/inetCidrRouteTable/default-table-inetCidrRouteTable.m2d
+, ip-forward-mib/ipCidrRouteTable/.mib2c-updaterc,
+ ip-forward-mib/ipCidrRouteTable/default-table-ipCidrRouteTable.m2d
+, ip-mib/inetNetToMediaTable/.mib2c-updaterc,
+ ip-mib/inetNetToMediaTable/default-table-inetNetToMediaTable.m2d
+, ip-mib/ipAddressTable/.mib2c-updaterc,
+ ip-mib/ipAddressTable/default-table-ipAddressTable.m2d,
+ ip-mib/ipSystemStatsTable/.mib2c-updaterc,
+ ip-mib/ipSystemStatsTable/default-table-ipSystemStatsTable.m2d
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/default-table-usmDHUserKeyTable.m2d
+:
+
+ remove files used for code gen (moved to netsnmp/module-templates cvs tree)
+
+2004-10-12 13:24 alex_b
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Fix IPV6 compile issues with Perl
+
+2004-10-12 13:03 alex_b
+
+ * win32/: libsnmp_dll/libsnmp.def,
+ netsnmpmibssdk/Makefile.in,
+ netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Fix Perl compile issue with dbg_tokens and debug_num_tokens. Fix snmptrapd
+ compile issue by adding iphlapi.lib to netsnmpmibssdk.
+
+2004-10-12 10:40 wasmith32
+
+ * snmplib/winservice.c:
+
+ Some versions of gcc with MinGW do not like a lable with no statements following.
+ The sollution was to add an empty statement in the sudo exception handling
+ code in winservice.c. Net-SNMP will now compile using a Linux hosted Windows
+ cross compiler.
+
+2004-10-11 21:06 slif
+
+ * agent/agent_registry.c:
+
+ fix signed/unsigned compare of range_subid
+
+2004-10-11 21:03 slif
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ remove unused var sess_community
+
+2004-10-11 21:02 slif
+
+ * agent/snmp_vars.c:
+
+ get definition of should_init
+
+2004-10-11 21:02 slif
+
+ * apps/snmpnetstat/winstub.c,
+ include/net-snmp/library/system.h:
+
+ pickup new definition of strtok_r as needed.
+
+2004-10-10 21:28 bshaw666
+
+ * README.solaris, configure, configure.in,
+ agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ LM-SENSORS-MIB for Solaris
+
+2004-10-09 07:41 rstory
+
+ * agent/snmp_agent.c:
+
+ move var decl to top of func; remove extra }
+
+2004-10-09 04:48 slif
+
+ * agent/mibgroup/ucd-snmp/memory.c,
+ include/net-snmp/library/system.h, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c, snmplib/system.c
+:
+
+ remove bugfix #1043197 - wrong patch done the wrong way at the wrong time
+
+2004-10-08 22:02 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.2.pre2 )
+
+2004-10-08 22:02 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.2.pre2 )
+
+2004-10-08 22:01 hardaker
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.2.pre2 )
+
+2004-10-08 22:01 hardaker
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.2.pre2 )
+
+2004-10-08 22:01 hardaker
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.2.pre2 )
+
+2004-10-08 22:01 hardaker
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.2.pre2 )
+
+2004-10-08 22:01 hardaker
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.2.pre2 )
+
+2004-10-08 22:01 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.2.pre2 )
+
+2004-10-08 22:00 hardaker
+
+ * dist/Makefile:
+
+ - (dist/Makefile): version tag ( 5.2.pre2 )
+
+2004-10-08 22:00 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.2.pre2 )
+
+2004-10-08 22:00 hardaker
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.2.pre2 )
+
+2004-10-08 22:00 hardaker
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.2.pre2 )
+
+2004-10-08 21:59 hardaker
+
+ * README:
+
+ - (README): version tag ( 5.2.pre2 )
+
+2004-10-08 21:59 hardaker
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.2.pre2 )
+
+2004-10-08 21:58 hardaker
+
+ * NEWS:
+
+ minor edits
+
+2004-10-08 21:58 hardaker
+
+ * agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, agent/Makefile.depend
+, apps/snmpnetstat/Makefile.depend,
+ apps/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2004-10-08 21:54 hardaker
+
+ * configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ update autoconf version req; update net-snmp version to .pro2
+
+2004-10-08 21:44 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ change the anon groups/etc created by the simple tokens to be more descriptive and unique
+
+2004-10-08 21:42 hardaker
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ test the right variable
+
+2004-10-08 21:40 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ make the background of the obsolete section pinkish
+
+2004-10-08 21:38 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ enable stderrlog
+
+2004-10-08 20:09 hardaker
+
+ * man/mib_api.3.def:
+
+ fix inconsistencies pointed out by Patrick Welche
+
+2004-10-08 20:05 hardaker
+
+ * snmplib/snmpv3.c:
+
+ make sure snmpEngineTime calculations don't wrap past an uint size
+
+2004-10-08 19:27 rstory
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
+:
+
+ remove duplicate function
+
+2004-10-08 19:25 rstory
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
+:
+
+ fix typo
+
+2004-10-08 19:12 rstory
+
+ * agent/helpers/table_container.c,
+ include/net-snmp/agent/table_container.h:
+
+ tweak some macro and fuction names/values
+
+2004-10-08 19:07 rstory
+
+ * agent/mibgroup/: if-mib/ifTable/ifTable.c,
+ if-mib/ifTable/ifTable.h,
+ if-mib/ifTable/ifTable_constants.h,
+ if-mib/ifTable/ifTable_data_access.c,
+ if-mib/ifTable/ifTable_data_access.h,
+ if-mib/ifTable/ifTable_interface.c,
+ if-mib/ifTable/ifTable_interface.h,
+ if-mib/ifXTable/ifXTable.c, if-mib/ifXTable/ifXTable.h
+, if-mib/ifXTable/ifXTable_constants.h,
+ if-mib/ifXTable/ifXTable_data_access.c,
+ if-mib/ifXTable/ifXTable_data_access.h,
+ if-mib/ifXTable/ifXTable_interface.c,
+ if-mib/ifXTable/ifXTable_interface.h,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
+,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c
+,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
+,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
+,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+, ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
+, ip-mib/inetNetToMediaTable/inetNetToMediaTable.c,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
+,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+, ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
+, ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+, ip-mib/ipAddressTable/ipAddressTable.c,
+ ip-mib/ipAddressTable/ipAddressTable.h,
+ ip-mib/ipAddressTable/ipAddressTable_constants.h,
+ ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+ ip-mib/ipAddressTable/ipAddressTable_data_access.h,
+ ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ ip-mib/ipAddressTable/ipAddressTable_interface.h,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable.c,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable.h,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h
+:
+
+ update genereated cod
+
+2004-10-08 19:02 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes.m2i:
+
+ tweak max oid guesswork
+
+2004-10-08 16:46 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ -revamp/add comments (give diff more context; facilitate auto-gen of task list)
+ -reduce some generated comments if verbose not set
+
+2004-10-08 16:44 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ -revamp/add comments (give diff more context; facilitate auto-gen of task list)
+ -use new macro for size of index oid buffer
+
+2004-10-08 16:43 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ -init irreversible commit to 0
+
+2004-10-08 16:43 hardaker
+
+ * apps/snmptrapd.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c, agent/snmp_agent.c
+:
+
+ Apply patch found in bug #1040431 to include transport information in the dump output
+
+2004-10-08 16:43 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
+:
+
+ -revamp/add comments (give diff more context; facilitate auto-gen of task list)
+ -use new define in header for cache timouet
+
+2004-10-08 16:41 rstory
+
+ * local/mib2c-conf.d/generic-value-map-func.m2i:
+
+ -revamp/add comments (give diff more context; facilitate auto-gen of task list)
+ -remove some redundant comments
+
+2004-10-08 16:41 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes.m2i:
+
+ -revamp/add comments (give diff more context; facilitate auto-gen of task list)
+ -try to shorten size of oid buffers for indexes
+
+2004-10-08 16:40 rstory
+
+ * local/mib2c-conf.d/details-enums.m2i:
+
+ -revamp/add comments (give diff more context; facilitate auto-gen of task list)
+ -don't gen internal enums if not mapping
+
+2004-10-08 16:39 rstory
+
+ * local/mib2c-conf.d/: generic-ctx-copy.m2i,
+ generic-ctx-set.m2i, generic-data-allocate.m2i,
+ generic-data-context.m2i, generic-get-char.m2i,
+ generic-table-indexes-from-oid.m2i,
+ generic-table-indexes-set.m2i,
+ generic-table-indexes-to-oid.m2i, generic-table-oids.m2c
+, generic-value-map-reverse.m2i,
+ generic-value-map.m2i,
+ mfd-access-unsorted-external-defines.m2i,
+ mfd-data-access.m2c, mfd-data-get.m2c,
+ mfd-data-set.m2c, mfd-interface.m2c, node-get.m2i
+, parent-dependencies.m2i, parent-set.m2i,
+ syntax-COUNTER64-get.m2i, syntax-DateAndTime-get.m2i,
+ syntax-InetAddress-get.m2i, syntax-InetAddressType-get.m2i
+, syntax-InetAddressType-set.m2i,
+ syntax-RowStatus-get.m2i, syntax-TestAndIncr-get.m2i:
+
+ revamp/add comments (give diff more context; facilitate auto-gen of task list)
+
+2004-10-08 16:02 slif
+
+ * net-snmp-config.in:
+
+ From Debian patch net-snmp_5.1.2-5.diff.gz -- propagate WRAPLIBS
+
+2004-10-08 15:32 hardaker
+
+ * net-snmp-config.in:
+
+ apply the intent of patch 947033 from Claus Klein to allow for cross compilation support through the use of --prefix= and --exec-prefix= flags. Didn't apply the white space, reformatting, etc portions since its against our patch acceptance standards. Also made a small fix so that --perfix=/something doesn't add a /net-snmp suffix to the include directory
+
+2004-10-08 15:16 hardaker
+
+ * acconfig.h, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ snmplib/snmpUDPDomain.c:
+
+ [ 1022787 ] Patch (from Geert De Peuter) that allows UDP buffer tuning... Take 2 after discussion on -coders
+
+2004-10-08 14:15 slif
+
+ * perl/: ASN/ASN.pm, OID/OID.pm,
+ TrapReceiver/TrapReceiver.pm, agent/agent.pm,
+ agent/netsnmp_request_infoPtr.pm,
+ agent/default_store/default_store.pm,
+ default_store/default_store.pm, manager/displaytable.pm
+:
+
+ Seen in a Debian patch. Insert required blank line following __END__ cut mark.
+
+2004-10-08 13:50 slif
+
+ * agent/mibgroup/smux/smux.c:
+
+ Don't show smux peer password in connect accept/refuse log messages.
+
+2004-10-08 11:52 slif
+
+ * testing/: rfc1213/README, rfc1213/run,
+ rfc1213/snmpfun.sh, rfc1213/test_fun,
+ rfc1213/testmib1.sh, rfc1213/testmib2.sh,
+ rfc1213/testmib3.sh, tests/T160rfc1213,
+ tests/T161rfc1213, tests/T162rfc1213:
+
+ patch #689757 - add test cases for accessing RFC-1213 MIB variables.
+ thanks to Ling Xiaofeng for the original work.
+
+2004-10-08 10:43 rstory
+
+ * agent/helpers/table_data.c:
+
+ initialize ptr to NULL
+
+2004-10-08 10:31 slif
+
+ * agent/mibgroup/ucd-snmp/memory.c,
+ include/net-snmp/library/system.h, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c, snmplib/system.c
+:
+
+ fix bug#1043197 - provide a function to test os version and release
+
+2004-10-08 10:22 rstory
+
+ * agent/: mib_modules.c, snmp_vars.c:
+
+ - fix bug [ 1025454 ] undefined symbols in snmptrapd
+ - move include "agent_module_inits.h" include inside init_agent
+
+2004-10-08 09:29 wasmith32
+
+ * include/net-snmp/system/mingw32msvc.h:
+
+ The Linux hosted version of MinGW reports itself as mingw32msvc. This system
+ header does nothing more than define mingw32 and include mingw32.h. All changes
+ should be made in mingw32.h.
+
+2004-10-08 09:04 alex_b
+
+ * snmplib/tools.c:
+
+ netsnmp_getenv(): Move variable declaration into WIN32 IFDEF
+
+2004-10-08 09:01 alex_b
+
+ * include/net-snmp/library/tools.h, local/snmpconf,
+ snmplib/mib.c, snmplib/read_config.c,
+ snmplib/tools.c, win32/dist/README.txt,
+ win32/dist/htmlhelp/Configuration_Overview.html,
+ win32/dist/installer/net-snmp.nsi:
+
+ Add netsnmp_getenv() which is a wrapper for getenv() to add
+ basic Windows registry support.
+
+2004-10-07 19:31 slif
+
+ * include/ucd-snmp/snmp_impl.h:
+
+ include net-snmp-config.h and net-snmp/types.h
+ for improved UCD_COMPATIBLE uses (from Fedora net-snmp-5.0.6-compat.patch).
+
+2004-10-07 18:44 alex_b
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Remove mib2c.iterate2.conf
+
+2004-10-07 17:15 alex_b
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Re-install path fix, prompt overwrite snmp.conf
+
+2004-10-07 16:15 alex_b
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Win32 DLL support for strtok_r
+
+2004-10-07 15:21 alex_b
+
+ * snmplib/strtok_r.c, win32/libsnmp/Makefile.in,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/Makefile.in
+, win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ Win32 MSVC support for strtok_r
+
+2004-10-07 14:57 alex_b
+
+ * win32/net-snmp/: net-snmp-config.h, net-snmp-config.h.in
+:
+
+ defined NETSNMP_* defines
+
+2004-10-07 05:12 rstory
+
+ * snmplib/: Makefile.in, strtok_r.c:
+
+ add strtok_r
+
+2004-10-06 21:08 hardaker
+
+ * snmplib/snmp_parse_args.c, agent/mibgroup/ucd-snmp/proxy.c
+, include/net-snmp/library/default_store.h:
+
+ make proxy no-community support using -Cc instead of assuming you wanted it that way
+
+2004-10-06 19:22 slif
+
+ * agent/snmp_agent.c:
+
+ include temp var "i" introduced by recent ipv6 patch.
+
+2004-10-06 19:13 hardaker
+
+ * include/net-snmp/library/snmpv3.h:
+
+ rename to NETSNMP_RND. (forgot to check this file in from earlier checkin
+
+2004-10-06 17:57 hardaker
+
+ * configure, configure.in:
+
+ fix ksm patch problem pointed out by Buck Huppmann
+
+2004-10-06 17:49 slif
+
+ * include/net-snmp/library/snmpv3.h:
+
+ add missing define ENGINEID_TYPE_NETSNMP_RND 256
+
+2004-10-06 16:54 rstory
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ fix bug [ 986238 ] snmpd loops forever
+
+2004-10-06 16:01 slif
+
+ * agent/snmp_agent.c, apps/snmpstatus.c,
+ apps/snmptest.c, apps/snmptrapd_handlers.c,
+ apps/snmptrapd_log.c:
+
+ fix bug#1040429: test every f_fmtaddr call before dereferencing or freeing.
+ Catch memory leaks in snmptest, snmptrapd, and snmpstatus.
+
+2004-10-06 15:24 hardaker
+
+ * snmplib/snmpksm.c, configure, configure.in,
+ acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Patch [ 923494 ] from Buck: improved autoconf support and heimdal support for ksm.
+
+2004-10-06 14:51 hardaker
+
+ * agent/snmp_agent.c, apps/snmptrapd.c:
+
+ Patch [ 942155 ] From Dai.H; IPv6 addr_string fix for libwrap
+
+2004-10-06 14:50 rstory
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ fix bug [ 615744 ] Spurious DISMAN-EVENT trap
+
+2004-10-06 14:45 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ Patch [ 1040718 ] from Ben Rogers: Agentx error propagation and infinite loop
+
+2004-10-06 14:11 rstory
+
+ * agent/snmpd.c:
+
+ restore ptr init before dereference; no idea how this has been working for the
+ last 6 months, and why it started crashing on me today.
+
+2004-10-06 13:15 rstory
+
+ * agent/mibgroup/mibII/interfaces.h:
+
+ - back out all of fix for bug 865415
+ - header_ifEntry depends on contiguous ifIndex values, and I'm not about
+ to try and fix that in this ifdef hell-hole. Those wanting non-changing
+ ifIndexes will just have to move to the mfd-rewrite.
+
+2004-10-06 13:10 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - back out all of fix for bug 865415
+ - header_ifEntry depends on contiguous ifIndex values, and I'm not about
+ to try and fix that in this ifdef hell-hole. Those wanting non-changing
+ ifIndexes will just have to move to the mfd-rewrite.
+
+2004-10-06 12:44 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - back out part of fix for bug 865415, it broke solaris & probably others
+ (not all platforms have Interface_Scan_Init,Interface_Scan_Next)
+
+2004-10-06 10:37 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ Patch #1041378 from Thomas Anders to fix the description of how engeIDs are created.
+
+2004-10-06 10:36 hardaker
+
+ * snmplib/snmpv3.c:
+
+ Fix the complaint outlined by Thomas Anders in Patch 104378 using the net-snmp enterprise number instead of the UCD one for randomly composed engineIDs
+
+2004-10-06 10:35 hardaker
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ defined NETSNMP_* defines
+
+2004-10-05 22:27 rstory
+
+ * README:
+
+ add Magnus Fromreide, Marcus Meissner, Andrew Rucker Jones, Dai.H.
+
+2004-10-05 21:51 rstory
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ apply part of patch [ 939595 ] from sun (update cache times)
+
+2004-10-05 21:37 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ - apply tiny piece of patch [ 836390 ]
+ - applied more ifname to iftype mappings
+
+2004-10-05 21:04 rstory
+
+ * agent/mibgroup/ucd-snmp/proxy.c, snmplib/snmp_parse_args.c
+:
+
+ - apply patch [ 811687 ] Proxy support ignores community string if -c option omitted
+
+2004-10-05 20:47 rstory
+
+ * agent/snmp_agent.c:
+
+ - apply patch [ 551183 ] LRU replacement for address cache
+
+2004-10-05 20:06 alex_b
+
+ * configure, configure.in:
+
+ Add missing reference for winservicerc in MinGW section
+
+2004-10-05 19:24 rstory
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - apply patch [ 996462 ] agentx fails on little endian 64bit
+
+2004-10-05 19:15 rstory
+
+ * agent/agent_registry.c:
+
+ - apply patch [ 1009799 ] AgentX Register-PDU with multiple items
+
+2004-10-05 19:02 rstory
+
+ * agent/: agent_read_config.c, snmp_vars.c:
+
+ - apply [ 1011471 ] More SCO Unixware 7 patches + inline macro problems
+ - define macro for unixware includes
+
+2004-10-05 19:01 rstory
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ remove extraneous endif
+
+2004-10-05 18:38 rstory
+
+ * configure:
+
+ update configure for new configure.in
+
+2004-10-05 17:46 rstory
+
+ * acconfig.h, configure.in:
+
+ - apply [ 1011471 ] More SCO Unixware 7 patches + inline macro problems
+ - check for nested static inline support
+
+2004-10-05 17:38 alex_b
+
+ * Makefile.top, configure, configure.in,
+ agent/Makefile.in, apps/Makefile.in,
+ snmplib/winservicerc.rc:
+
+ Apply patch 1040325 - win32 MinGW agent/trapd service Eventlog fixes
+
+2004-10-05 16:35 rstory
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ apply patch [ 1040254 ] Strengthen AGENTX OID checks
+
+2004-10-05 16:26 rstory
+
+ * testing/eval_tools.sh:
+
+ apply patch [ 1040261 ] Make it possible to select tests on agent modules
+
+2004-10-05 16:15 rstory
+
+ * configure:
+
+ update configure for new configure.in
+
+2004-10-05 16:14 rstory
+
+ * configure.in, include/net-snmp/net-snmp-config.h.in
+:
+
+ add check for strtok_r and run autoheader
+
+2004-10-05 16:13 rstory
+
+ * README:
+
+ add Geert De Peuter to contributors
+
+2004-10-05 16:12 rstory
+
+ * agent/agent_trap.c, agent/mib_modules.c,
+ agent/snmp_agent.c, agent/mibgroup/agentx/agentx_config.c
+, agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/if-mib/data_access/interface_common.c,
+ agent/mibgroup/mibII/vacm_conf.c,
+ agent/mibgroup/ucd-snmp/dlmod.c, apps/snmpvacm.c,
+ apps/snmpnetstat/winstub.c, snmplib/container.c,
+ snmplib/default_store.c, snmplib/mib.c,
+ snmplib/parse.c, snmplib/read_config.c,
+ snmplib/snmp_api.c, snmplib/snmp_debug.c,
+ snmplib/system.c:
+
+ apply patch [ 1040330 ] Getting rid of strtok
+
+2004-10-05 10:35 hardaker
+
+ * snmplib/snmpv3.c:
+
+ remove attribution comment
+
+2004-10-05 07:06 alex_b
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Remove -C and -c register options and add note about reboot
+
+2004-10-05 00:50 slif
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ patch from jprakashbabu: move endfsent call near setfsent to avoid compile error
+
+2004-10-04 20:18 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ elminate use of TODO_find_* undefined macros
+
+2004-10-04 20:17 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ put irreversible_commit setting in generated default-table-*
+
+2004-10-04 20:11 rstory
+
+ * local/mib2c-conf.d/: mfd-access-container-cached-defines.m2i
+, mfd-access-unsorted-external-defines.m2i:
+
+ elminate use of TODO_find_* undefined macros
+
+2004-10-04 15:09 alex_b
+
+ * agent/snmpd.c, apps/snmptrapd.c,
+ snmplib/winservice.c:
+
+ Rename g_szAppName to app_name to follow naming standards
+
+2004-10-04 11:54 rstory
+
+ * local/mib2c-conf.d/: generic-ctx-get.m2i, node-set.m2i
+:
+
+ - make comments more unique (help out diff)
+ - remove some extraneous comments
+
+2004-10-04 11:52 rstory
+
+ * local/mib2c-update:
+
+ use full paths instead of relative
+
+2004-10-04 11:51 rstory
+
+ * agent/mibgroup/utilities/execute.c:
+
+ add debug tokens
+
+2004-10-04 09:53 rstory
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ store permanent rows too
+
+2004-10-04 09:52 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ don't reset oper_status flags, ioctl code has already set them
+
+2004-10-04 09:49 rstory
+
+ * agent/helpers/baby_steps.c,
+ local/mib2c-conf.d/parent-set.m2i:
+
+ list all locations to update in flowchart comments
+
+2004-10-03 18:22 alex_b
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Unregister services on uninstall, add missing mibs, mib2c and header files.
+
+2004-10-03 14:20 slif
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ from Corey Wright: fix sensor_array size limit test
+
+2004-10-03 10:19 rstory
+
+ * agent/helpers/table_data.c:
+
+ apply missed bit from previous patch
+
+2004-10-03 08:47 rstory
+
+ * agent/helpers/table_data.c,
+ include/net-snmp/agent/table_data.h:
+
+ - apply patch from Geert De Peuter [ 1022941 ] Speed up adding a row to a table
+ - (slightly modified version)
+ - test for append before linear search
+ - save rc instead of repeating function call
+
+2004-10-03 07:52 rstory
+
+ * snmplib/mib.c:
+
+ patch from Patrick Welche; check for NULL before deref
+
+2004-10-02 20:51 alex_b
+
+ * win32/dist/README.build.win32.txt:
+
+ Add step to compare compiled and installed folders to locate missing files
+
+2004-10-01 20:52 hardaker
+
+ * configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Check for sysconf and times functions and sys/times.h header
+
+2004-10-01 20:51 hardaker
+
+ * snmplib/: lcd_time.c, snmpv3.c:
+
+ Proper fix it v3 enginetime wrapping problem. Fairly portable && uses times().
+
+2004-10-01 20:50 hardaker
+
+ * snmplib/system.c, include/net-snmp/library/system.h:
+
+ create a new calculate_sectime_diff function
+
+2004-10-01 20:44 hardaker
+
+ * snmplib/snmpv3.c:
+
+ set hent variable to NULL to squash bogus compiler warning
+
+2004-10-01 15:50 rstory
+
+ * agent/mibgroup/mibII/: interfaces.c, interfaces.h:
+
+ fix bug [ 865415 ] incorrect ifAdEntIfIndex field
+
+2004-10-01 08:58 alex_b
+
+ * win32/dist/README.build.win32.txt:
+
+ Simplify build steps
+
+2004-10-01 05:28 dts12
+
+ * local/mib2c.iterate.conf, local/mib2c.iterate2.conf,
+ local/mib2c.conf, NEWS:
+
+ Break the habit of a lifetime, have the courage of my convictions,
+ and push the new (fuller) iterate config in preference to the earlier
+ (relatively empty) framework.
+ [I just know I'm going to regret doing this.....]
+
+2004-09-30 20:10 wasmith32
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Updated the service registration batch files for the Windows installer script.
+ Applied a modified patch [ 1037695 ] with edits made by Alex Burger and myself.
+ The patch also removes configuration files from the script that were not
+ being installed.
+
+2004-09-30 11:12 hardaker
+
+ * COPYING:
+
+ change 5 -> various so we stop getting it wrong
+
+2004-09-30 08:59 alex_b
+
+ * win32/build.pl:
+
+ For bug 1037524: Set path to .DLL for Perl build / test
+
+2004-09-30 05:48 dts12
+
+ * snmplib/read_config.c:
+
+ Have 'read_config_read_octet_string' take note of the
+ initial length when using existing buffers.
+
+2004-09-30 02:55 slif
+
+ * man/Makefile.in:
+
+ ignore errors for any missing MAN5G files (e.g., mib2c.conf.5)
+
+2004-09-30 02:43 slif
+
+ * testing/tests/T113agentxtrap:
+
+ add DELAY after set to allow time for trap to fire and be logged.
+
+2004-09-30 01:38 slif
+
+ * Makefile.rules:
+
+ fix "Inconsistent operator for test" which was introduced when
+ whitespace at the beginning of the line in installsubdirheaders.
+ Indent lines of rule bodies using tab only (a requirement for some "make").
+ Remove extraneous whitespace near the end of continuation lines.
+
+2004-09-29 23:18 slif
+
+ * Makefile.in:
+
+ don't try to install ucd-snmp/agent_module_config.h (no such file)
+
+2004-09-29 18:02 alex_b
+
+ * snmplib/winservice.c:
+
+ snprintf now uses sizeof(object)
+
+2004-09-29 17:35 slif
+
+ * snmplib/snmp_logging.c:
+
+ note importance of matching MessageId value for ReportEvent.
+
+2004-09-29 15:49 hardaker
+
+ * snmplib/snmpUnixDomain.c:
+
+ Patch: 1031046 white space tab damage
+
+2004-09-29 15:45 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ man/snmp.conf.5.def, snmplib/snmpUDPDomain.c,
+ snmplib/snmp_api.c:
+
+ [no log message]
+
+2004-09-29 15:38 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ Patch: [ 1034156 ] Clarify OpenSSL req. in snmpd.conf.5
+
+2004-09-29 15:36 alex_b
+
+ * README.win32:
+
+ Update service registration section to mention the need for a reboot to
+ allow system environment variables to be used.
+
+2004-09-29 15:20 hardaker
+
+ * snmplib/vacm.c:
+
+ [ 1011331 ] vacm_destroyAccessEntry was double checking a value and missnig another.
+
+2004-09-29 15:01 hardaker
+
+ * FAQ, README:
+
+ remove japan mirror as the maintainer passed away
+
+2004-09-29 14:23 hardaker
+
+ * FAQ:
+
+ fix bug #IForgot to fix agentx usage on windows to use a real snmpd.conf token for socket address support
+
+2004-09-29 12:58 hardaker
+
+ * Makefile.rules:
+
+ remove non-portable (but nice goal) optimized header installation. Breaks on freebsd systems where cmp exits with status 2
+
+2004-09-29 10:34 alex_b
+
+ * agent/snmpd.c, apps/snmptrapd.c,
+ include/net-snmp/library/snmp_logging.h,
+ man/netsnmp_snmp_logging.3, snmplib/snmp_logging.c,
+ win32/libsnmp_dll/libsnmp.def:
+
+ Apply patch in bug 926389 by Mike Slifcak to fix Win32 event log logging
+ for snmptrapd and snmpd. Adds snmp_log_syslogname() function which
+ is now used by openlog().
+
+2004-09-29 07:47 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - remove xxx comments in generated code
+ - update for rename table_container functions
+
+2004-09-29 07:46 rstory
+
+ * local/mib2c-conf.d/: generic-table-indexes-set.m2i,
+ mfd-top.m2c:
+
+ remove xxx comments in generated code
+
+2004-09-29 07:29 rstory
+
+ * snmplib/parse.c:
+
+ convert missing dir error msg to debug msg
+
+2004-09-28 18:46 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-09-28 18:45 rstory
+
+ * configure.in, include/net-snmp/net-snmp-config.h.in
+:
+
+ - check for net/if_arp.h header
+ - run autoheader to update net-snmp-config.h.in
+
+2004-09-28 18:41 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ add vmnet to type-by-name detection
+
+2004-09-28 18:39 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c:
+
+ - include net/if_arp.h so arp type detection has a chance to work
+ - ifdef arphrd types that aren't common (pretty much all of them)
+ - debug msg on unknown type
+
+2004-09-28 15:24 slif
+
+ * snmplib/snmpTCPDomain.c:
+
+ use the correct htons function to assign to a NBO object.
+
+2004-09-28 13:54 rstory
+
+ * local/mib2c-conf.d/mfd-readme.m2c:
+
+ - first update in a while
+ - use create_fewer_files to determine correct file name
+ - chg index context to mib context
+ - chg table context to row request context
+ - remove assumptions about data access method
+ - add example function flow (w/source file) for various request scenarios
+
+2004-09-28 06:01 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ add debug
+
+2004-09-28 05:59 rstory
+
+ * agent/helpers/scalar_group.c:
+
+ fix length for memcpy
+
+2004-09-27 17:23 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - fix a few debug messages
+ - log error on uknown column
+ - don't put undo_(setup|cleanup) in interface code for generated structures
+ - call node undo_setup functions after row undo_setup
+
+2004-09-27 17:18 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ remove a blank line that snuck in
+
+2004-09-27 17:18 rstory
+
+ * local/mib2c-conf.d/generic-table-oids.m2c:
+
+ fix logic test (defval is a string, not a flag)
+
+2004-09-27 17:15 rstory
+
+ * agent/helpers/baby_steps.c:
+
+ skip undo_cleanup if undo_setup wasn't run
+
+2004-09-27 14:36 alex_b
+
+ * win32/dist/README.build.win32.txt:
+
+ Remove mention of fixing SYNOPSIS in snmpnetstat, snmpdelta and snmpdf
+
+2004-09-27 14:21 alex_b
+
+ * man/: snmpdelta.1, snmpdf.1, snmpnetstat.1:
+
+ Make commands in SYNOPSIS / DESCRIPTION section bold
+
+2004-09-27 12:06 rstory
+
+ * agent/helpers/table.c:
+
+ allow for finer grained debug control
+
+2004-09-27 10:44 alex_b
+
+ * snmplib/winservice.c:
+
+ Merged most WriteToEventLog and DisplayError calls into ProcessError so event, console & pop-up messages are consistent. Changed all stprintf's to snprintfs.
+
+2004-09-27 06:05 rstory
+
+ * agent/helpers/table_container.c:
+
+ fix typo
+
+2004-09-27 05:51 rstory
+
+ * agent/helpers/table_container.c:
+
+ don't modify table request data if no next column
+
+2004-09-26 13:40 rstory
+
+ * local/mib2c-conf.d/mfd-data-set.m2c:
+
+ - debug token consistency
+ - remove duplicate value map for indexes
+
+2004-09-26 13:38 rstory
+
+ * local/mib2c-conf.d/: generic-data-allocate.m2i,
+ generic-table-indexes-from-oid.m2i,
+ generic-table-indexes-set.m2i,
+ generic-table-indexes-to-oid.m2i,
+ generic-value-map-func.m2i,
+ mfd-access-container-cached-defines.m2i,
+ mfd-access-unsorted-external-defines.m2i,
+ mfd-data-access.m2c, mfd-interface.m2c, mfd-top.m2c
+, node-get.m2i, parent-dependencies.m2i,
+ parent-set.m2i:
+
+ - debug token consistency
+ - add missing debugs
+
+2004-09-26 13:30 rstory
+
+ * agent/mibgroup/tcp-mib/data_access/tcpConn.h:
+
+ fix paths
+
+2004-09-24 12:03 slif
+
+ * snmplib/snmpTCPDomain.c:
+
+ when creating address from ostring, convert port to network byte order
+
+2004-09-24 09:15 rstory
+
+ *
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c
+:
+
+ - fix commas in commented out items
+
+2004-09-24 07:54 slif
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Linux memory buffers patch from Kaj Niemi (Fedora *hr_storage-mbuf-v2.patch)
+
+2004-09-24 07:46 slif
+
+ * agent/mibgroup/smux/smux.c:
+
+ init input/output variable sa_enterpriseoid_len (Fedora *smux-stack-var.patch)
+
+2004-09-24 07:38 rstory
+
+ * snmplib/snmpUDPDomain.c:
+
+ when creating address from ostring, convert port to network byte order
+
+2004-09-24 06:18 slif
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/snmpksm.c:
+
+ patch 923511 adds support for non-host service principal for ksm
+
+2004-09-24 05:50 slif
+
+ * configure.in, configure:
+
+ patch 1010395 remove duplicate checks for snprintf and strtoul
+ patch 1009712 check for gethostbyname in -lsocket for Unixware
+
+2004-09-24 05:30 slif
+
+ * configure.in, configure:
+
+ patch 1032602 supports Linux cross compiler for Windows (target mingw32msvc).
+
+2004-09-23 16:15 slif
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c,
+ mibs/LM-SENSORS-MIB.txt:
+
+ undo patch #1027522 as it violates RFC 1902 section 10.2
+ when the MIB objects were changed.
+
+2004-09-23 14:57 hardaker
+
+ * include/net-snmp/library/scapi.h, snmplib/scapi.c:
+
+ new function to return the required length of a privacy key
+
+2004-09-23 13:24 rstory
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c
+:
+
+ - remove unused variable
+ - fix function call
+ - fix renamed var missed in merge
+
+2004-09-23 09:18 slif
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c,
+ mibs/LM-SENSORS-MIB.txt:
+
+ apply patch #1027522 to permit reporting negative sensor values
+
+2004-09-23 09:08 slif
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ apply modified patch #1027521 to fix problems with sensor categories (types).
+
+2004-09-23 08:58 slif
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ apply part of patch #960269 to release memory returned from sensor_get_label
+
+2004-09-22 17:51 slif
+
+ * win32/dist/htmlhelp/: snmp.conf.win32.html,
+ snmpd.conf.win32.html, snmptrapd.conf.win32.html:
+
+ patch 1033052 from Alex Burger: Win32: Updated htmlhelp files for *.conf
+
+2004-09-22 11:20 slif
+
+ * agent/snmpd.c, apps/snmptrapd.c,
+ include/net-snmp/library/winservice.h, snmplib/winservice.c
+:
+
+ apply patch #1030913 to suppress windows popups for service reg/unreg errors.
+ errors are printed to stderr if -quiet parameter is supplied.
+
+2004-09-22 11:06 slif
+
+ * win32/dist/: README.build.win32.txt,
+ htmlhelp/Introduction.html:
+
+ apply patch#103900 so that intro more closely matches current web site home page.
+ also adjust build instructions to remove example and demo MIBs from build.
+
+2004-09-22 11:01 slif
+
+ * perl/SNMP/SNMP.xs:
+
+ apply patch#1028976 check values for label, iid before dereference.
+ Fixes perl module fault, async callback. See RedHat bug #111319
+
+2004-09-22 09:36 hardaker
+
+ * man/snmpusm.1.def:
+
+ patch from Abhijit Hayatnagarkar to support key changing for localized-only keys
+
+2004-09-22 07:06 slif
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ patch 1028927 from Andy Smith fixes bug 972797; registering win32
+ snmpd/snmptrapd services includes paths to config file and to log file.
+
+2004-09-22 07:06 rstory
+
+ * agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/:
+ usmDHUserKeyTable.c, usmDHUserKeyTable.h,
+ usmDHUserKeyTable_data_access.c,
+ usmDHUserKeyTable_data_access.h,
+ usmDHUserKeyTable_data_get.c, usmDHUserKeyTable_data_get.h
+, usmDHUserKeyTable_data_set.c,
+ usmDHUserKeyTable_data_set.h, usmDHUserKeyTable_interface.c
+:
+
+ update for generated code
+
+2004-09-21 19:51 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/: ipAddressTable.c,
+ ipAddressTable.h, ipAddressTable_constants.h,
+ ipAddressTable_data_access.c, ipAddressTable_data_access.h
+, ipAddressTable_interface.c,
+ ipAddressTable_interface.h:
+
+ update for generated code
+
+2004-09-21 19:32 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ don't generate macros that are in mfd.h
+
+2004-09-21 19:31 rstory
+
+ * local/mib2c-conf.d/parent-dependencies.m2i:
+
+ fix typo
+
+2004-09-21 19:30 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i:
+
+ only generate row creation check if m2c_table_row_creation set
+
+2004-09-21 19:29 rstory
+
+ * local/mib2c-conf.d/generic-table-oids.m2c:
+
+ - set up macro w/required columns for row creation
+
+2004-09-21 16:48 rstory
+
+ * local/mib2c.column_storage.conf:
+
+ storage for table indexes and columns
+
+2004-09-21 16:32 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - move row_merge after table_container in handler chain
+
+2004-09-21 16:30 rstory
+
+ * local/mib2c-update:
+
+ - increase context for diff
+ - increase fuzz for patch
+
+2004-09-21 16:28 rstory
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ - allocate tag storage earlier, with space for null termination
+ - alloc space for null termination of name
+ - return error if allocations fail
+
+2004-09-21 16:25 rstory
+
+ * agent/helpers/table_container.c:
+
+ set endofmibview when getnext goes beyond last item in table
+
+2004-09-21 16:23 rstory
+
+ * agent/helpers/row_merge.c:
+
+ mark processed requests as DONE so they aren't merged
+
+2004-09-21 14:59 rstory
+
+ * snmplib/callback.c:
+
+ ifdef/comment some debug assert code that gets hit in rare cases
+
+2004-09-21 12:56 hardaker
+
+ * apps/snmpusm.c:
+
+ patch from Abhijit Hayatnagarkar to support key changing for localized-only keys
+
+2004-09-21 06:55 hardaker
+
+ * apps/snmpusm.c:
+
+ Patch from Abhijit Hayatna to fix DH key lengths
+
+2004-09-21 06:43 hardaker
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c
+:
+
+ check a few pointers before using them
+
+2004-09-17 01:22 nba
+
+ * configure, configure.in,
+ agent/mibgroup/host/hr_swinst.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Check for and include rpm/rpmdb.h
+
+2004-09-17 01:04 nba
+
+ * agent/mibgroup/agent/extend.c:
+
+ This was not always an unused variable
+
+2004-09-17 00:58 nba
+
+ * apps/snmpusm.c:
+
+ Fix OpenSSL chech to work on 64-bit Solaris compile with 32-bit OpenSSL
+ installed ...
+
+2004-09-16 10:34 rstory
+
+ * local/Makefile.in:
+
+ install mib2c.column_storage.conf
+
+2004-09-16 10:34 rstory
+
+ * snmplib/snmp_client.c:
+
+ - don't free NULL pointer
+ - upcase first word in sentence
+ - expand more on noCreation explanitory message
+ - add explanitory message for inconsistentName
+
+2004-09-16 10:27 rstory
+
+ * snmplib/parse.c:
+
+ log error message if a MIB directory cannot be opened
+
+2004-09-16 08:31 rstory
+
+ * agent/mibgroup/tcp-mib.h,
+ agent/mibgroup/tcp-mib/tcpConnTable.h,
+ agent/mibgroup/tcp-mib/data_access/.cvsignore,
+ agent/mibgroup/tcp-mib/data_access/Makefile,
+ agent/mibgroup/tcp-mib/data_access/tcpConn.h,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_common.c,
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,
+ include/net-snmp/data_access/tcpConn.h:
+
+ data access for tcp-mib tcp connections (ipv4 only)
+
+2004-09-16 08:18 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ - remove unused vars
+ - create default-node-${node}.m2d w/current values, iff doesn't exist
+
+2004-09-16 08:17 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-get.m2i:
+
+ don't generate mapping code if skip mapping set
+
+2004-09-15 17:22 slif
+
+ * Makefile.in:
+
+ install freebsd5/6 headers
+
+2004-09-15 15:57 hardaker
+
+ * snmplib/snmpusm.c:
+
+ Fix an opps. Delete the usm state ref before the handling of reports since it didn't need it before
+
+2004-09-15 09:57 hardaker
+
+ * include/net-snmp/library/snmp_secmod.h:
+
+ make the HandleReport callback take a transport pointer
+
+2004-09-15 09:55 hardaker
+
+ * snmplib/snmpusm.c:
+
+ Make the usm module handle its own reprots
+
+2004-09-15 09:54 hardaker
+
+ * snmplib/snmp_api.c:
+
+ don't free the state reference till after the handle_report_pdu callback is called. Also pass in the transport to the same hook.
+
+2004-09-15 09:19 rstory
+
+ * Makefile.in:
+
+ install darwin7 header
+
+2004-09-15 07:26 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i:
+
+ - check column_set_flags to see if rowstatus set
+ - only check transition if set
+ - check required rows on createAndGo
+ - don't allow destroy if other columns set
+ - don't allow creation if rowstatus not set
+
+2004-09-15 07:21 rstory
+
+ * local/mib2c-conf.d/: parent-dependencies.m2i,
+ parent-set.m2i:
+
+ - rename set_flags
+ - add comment about row created flag in rowreq_flags
+
+2004-09-15 07:20 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ comment grammar tweak
+
+2004-09-15 07:19 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ - add rowreq_flags
+ - rename set_flags to column_set_flags
+ - use context name for example user context data list
+
+2004-09-15 07:17 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - use new macro to validate SNMP error codes
+ - use new rowreq_flags to set/clear new row flag
+ - set request error on invalid oid for new row
+ - clear undo pointer after releasing it
+ - set WRONGLENGTH for bad variable size
+
+2004-09-15 07:14 rstory
+
+ * snmplib/snmp_alarm.c:
+
+ add include to quiet compiler
+
+2004-09-15 07:13 rstory
+
+ * include/net-snmp/library/snmp_enum.h:
+
+ - add prototype for se_find_slist
+ - tweak comment
+
+2004-09-15 07:12 rstory
+
+ * include/net-snmp/library/snmp.h:
+
+ new macro to validate SNMP error codes
+
+2004-09-15 07:11 rstory
+
+ * include/net-snmp/agent/mfd.h:
+
+ - define flags for rowreq_flags
+
+2004-09-15 07:11 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/: ipAddressTable.c,
+ ipAddressTable.h, ipAddressTable_constants.h,
+ ipAddressTable_data_access.c, ipAddressTable_interface.c
+:
+
+ - update generated code
+ - rename arch functions
+ - move storage type into data access interface
+ - add/use undo storage for LastChanged
+ - add support for creation/deletion of ipaddresses via RowStatus
+ - add flags for required columns
+
+2004-09-15 06:59 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - rename arch functions
+
+2004-09-15 06:58 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ - rename arch functions
+ - tweak log message, comments
+
+2004-09-15 06:58 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ include/net-snmp/data_access/ipaddress.h:
+
+ - rename arch functions
+ - remove arch flags, add data list for arch data
+ - add & call arch functions on create, copy, delete ipaddress entry
+ - add prototype to fix compiler warning
+ - new ipaddress set (create/delete ip address aliases)
+ - change macro name
+ - add flag for aliases
+
+2004-09-15 06:51 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c,
+ include/net-snmp/data_access/interface.h:
+
+ - rename arch functions
+ - add prototype to fix compiler warning
+ - new function to find interface name from ifIndex
+
+2004-09-14 15:01 hardaker
+
+ * include/net-snmp/library/snmp_secmod.h, snmplib/snmp_api.c
+:
+
+ Update to modularize a bit more the security model infrastructure: report handling outsourced to the secmod
+
+2004-09-13 19:29 rstory
+
+ * agent/mibgroup/util_funcs.h,
+ agent/mibgroup/if-mib/data_access/interface_ioctl.h,
+ agent/mibgroup/if-mib/ifTable/ifTable.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_constants.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_data_access.h,
+ agent/mibgroup/if-mib/ifTable/ifTable_interface.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.h,
+ agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
+,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
+,
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
+,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
+,
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
+,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
+,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+,
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+, agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
+,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
+,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h
+, include/net-snmp/types.h,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/baby_steps.h,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/agent/instance.h,
+ include/net-snmp/agent/row_merge.h,
+ include/net-snmp/agent/scalar.h,
+ include/net-snmp/agent/scalar_group.h,
+ include/net-snmp/agent/serialize.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/agent/table_container.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/agent/watcher.h,
+ include/net-snmp/data_access/arp.h,
+ include/net-snmp/data_access/interface.h,
+ include/net-snmp/data_access/ipaddress.h,
+ include/net-snmp/data_access/ipstats.h,
+ include/net-snmp/data_access/route.h,
+ include/net-snmp/data_access/systemstats.h,
+ include/net-snmp/library/container.h,
+ include/net-snmp/library/container_iterator.h,
+ include/net-snmp/library/container_list_ssll.h,
+ include/net-snmp/library/container_null.h,
+ include/net-snmp/library/factory.h,
+ local/mib2c.array-user.conf,
+ local/mib2c-conf.d/generic-header-bottom.m2i,
+ snmplib/mt_support.c:
+
+ - patch from Magnus Fromreide to remove ';' from extern 'C' header contructs
+ (allow g++ 3.4 and above to compile net-snmp)
+
+2004-09-13 03:34 slif
+
+ * testing/: eval_tools.sh, tests/Sv3config:
+
+ when matching CPP defines, match the ones which begin the source header line.
+
+2004-09-13 03:20 slif
+
+ * README.win32, win32/dist/README.build.win32.txt,
+ win32/dist/README.txt, win32/dist/htmlhelp/Net-SNMP.hhc
+, win32/dist/htmlhelp/Net-SNMP.hhp,
+ win32/dist/scripts/poddir2html,
+ win32/dist/scripts/readme2html:
+
+ apply patch #102669 Win32 5.2 build updates`
+
+2004-09-12 22:23 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c:
+
+ - include ipAddressTable_constants
+ - initialize defaults per the mib
+
+2004-09-12 22:20 rstory
+
+ * include/net-snmp/data_access/ipaddress.h:
+
+ - change comment
+ - add storage type
+ - define flags for set support
+
+2004-09-12 22:18 rstory
+
+ * agent/helpers/table_container.c:
+
+ fix data lookup when there are multiple varbinds
+
+2004-09-12 22:18 rstory
+
+ * agent/helpers/baby_steps.c,
+ include/net-snmp/agent/snmp_agent.h:
+
+ - fix skipping of un-registered modes
+ - remove request next_mode stuff (never used)
+ - shorten mux debug token
+
+2004-09-10 15:51 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
+:
+
+ don't mask return codes in internal functions
+
+2004-09-10 15:11 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h:
+
+ add undo storage for rowstatus and storage type
+
+2004-09-10 14:47 rstory
+
+ * agent/helpers/baby_steps.c,
+ include/net-snmp/agent/baby_steps.h:
+
+ - new function netsnmp_baby_step_mode2flag
+ - use new function, so skipping unregistered modes works
+
+2004-09-10 14:42 rstory
+
+ * local/mib2c-conf.d/parent-dependencies.m2i:
+
+ - use mfd succe macro instead of snmp macro
+ - if check returns an error, return immediately
+
+2004-09-10 14:39 rstory
+
+ * local/mib2c-conf.d/syntax-StorageType-dependencies.m2i:
+
+ use correct function name
+
+2004-09-10 13:01 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
+:
+
+ - update generated code
+ - add define to allow row-creation
+
+2004-09-10 12:58 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/: ipAddressTable.c,
+ ipAddressTable.h, ipAddressTable_data_access.c,
+ ipAddressTable_data_access.h:
+
+ update generated code
+
+2004-09-10 05:30 dts12
+
+ * local/mib2c:
+
+ Check that a variable corresponds to a valid MIB object,
+ before trying to look at characteristics of this object.
+ (Fixes a problem with the MFD scripts, which use the mib2c
+ variable expansions for non-MIB-object names as well).
+
+2004-09-09 16:17 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - fix log msg typo
+ - set request errors instead of returning error from handler
+ - debug msgs for request errors
+
+2004-09-09 16:15 rstory
+
+ * local/mib2c-conf.d/node-varbind-validate.m2i:
+
+ add missing quote
+
+2004-09-09 09:17 dts12
+
+ * NEWS:
+
+ Mention new NET-SNMP-EXTEND-MIB support
+ (plus minor grammar and formatting tweaks)
+
+2004-09-09 07:01 slif
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ apply patch #1024352 Changes Windows installer to allow snmptrapd as service.
+
+2004-09-09 06:49 slif
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ formatting patch #1024746 (one-liner) from Alex Burger.
+
+2004-09-09 03:43 slif
+
+ * agent/agent_read_config.c, agent/helpers/old_api.c,
+ agent/helpers/table.c, agent/helpers/table_data.c,
+ agent/mibgroup/agent/extend.c, snmplib/container.c,
+ snmplib/container_list_ssll.c:
+
+ fix bug#1025014 - remove unuseds, quell signed/unsigned warnings in 5.2.pre1
+
+2004-09-09 03:31 slif
+
+ * apps/snmptrapd.c:
+
+ declare external function within scope used.
+
+2004-09-09 03:22 slif
+
+ * agent/snmpd.c, apps/snmptrapd.c:
+
+ fix bug#1025004 apply minor comment and grammar fixes to snmpd,snmptrapd
+
+2004-09-08 20:52 slif
+
+ * snmplib/snmp_logging.c:
+
+ partial fix bug #909222 - move win32 changes inside _disable_syslog{entry},
+ dont write standard error on failure to close event log from disable_syslog.
+
+2004-09-08 18:43 slif
+
+ * win32/: agent_module_dot_conf.h, agent_module_includes.h
+, agent_module_inits.h, build.pl,
+ mib_module_includes.h, mib_module_inits.h,
+ mib_module_shutdown.h, libsnmp_dll/libsnmp.def,
+ net-snmp/net-snmp-config.h, net-snmp/net-snmp-config.h.in
+, net-snmp/agent/agent_module_config.h,
+ net-snmp/agent/mib_module_config.h, netsnmpmibs/Makefile.in
+, netsnmpmibs/netsnmpmibs.dsp,
+ netsnmpmibssdk/Makefile.in,
+ netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Apply mods in patch #1024810 in order to build 5.2.pre1 on win32 MSVC+MinGW.
+
+2004-09-08 08:39 rstory
+
+ * include/net-snmp/agent/baby_steps.h:
+
+ fix backwards compatability macro name
+
+2004-09-07 20:48 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c:
+
+ map data access if address type to mib type in index
+
+2004-09-07 20:46 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
+:
+
+ pass correct container to update check functionso missing addrs are removed
+
+2004-09-07 20:42 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ null rowreq_ctx is valid in undo_cleanup; simply return success
+
+2004-09-07 20:39 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ - fix ifIndex lookup for interface aliases
+ - add debug message
+ - new function to set ipaddress
+
+2004-09-07 20:35 rstory
+
+ * agent/agent_handler.c:
+
+ add se pairs for baby step modes
+
+2004-09-07 20:32 rstory
+
+ * agent/helpers/baby_steps.c:
+
+ - keep registered modes with mib handler
+ - skip lower handlers for modes that handler didnt register for
+ - skip undo commit if handler wasnt called for commit
+ - dont break on request error in final steps (equivalent of commit/undo/free)
+ - more debug msgs
+
+2004-09-07 20:25 rstory
+
+ * include/net-snmp/agent/baby_steps.h:
+
+ - sync names of BABY_STEP_* with MODE_BSTEP_*
+ - define structure for baby steps handler mode tracking
+
+2004-09-07 20:19 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ add debug msg
+
+2004-09-06 20:21 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ - add persistence for ifAlias, ifLinkUpDownTrapEnable
+ - don't allow set of promiscuous mode, since it's not implemented
+
+2004-09-06 19:28 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ - fix fixed size check
+ - add access to container pointer
+
+2004-09-06 19:25 rstory
+
+ * local/mib2c-conf.d/node-varbind-validate.m2i:
+
+ don't generate fixed size check for octet strings
+
+2004-09-06 19:00 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ set up vars for lengths to be copied correctly
+
+2004-09-05 18:57 rstory
+
+ * agent/mibgroup/agentx/subagent.h:
+
+ remove extern of non-existant var
+
+2004-09-02 07:22 slif
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ dont include byteorder.h -- avoids warning seen on RedHat
+
+2004-09-02 06:58 dts12
+
+ * NEWS:
+
+ Mention the other new mib2c config templates, and provide a little
+ more explanation. (Plus fixing a couple of typos)
+
+2004-09-02 06:52 slif
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ fix #995489 by obtaining sysDescr and sysContact through windows native methods.
+
+2004-09-02 00:59 rstory
+
+ * agent/mibgroup/mibII/interfaces.h:
+
+ - require all if-mib interface for linux
+
+2004-09-02 00:04 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.2.pre1 )
+
+2004-09-02 00:04 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.2.pre1 )
+
+2004-09-02 00:03 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.2.pre1 )
+
+2004-09-02 00:03 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.2.pre1 )
+
+2004-09-02 00:03 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.2.pre1 )
+
+2004-09-02 00:02 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.2.pre1 )
+
+2004-09-02 00:02 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.2.pre1 )
+
+2004-09-02 00:02 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.2.pre1 )
+
+2004-09-02 00:01 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.2.pre1 )
+
+2004-09-02 00:01 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.2.pre1 )
+
+2004-09-02 00:00 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.2.pre1 )
+
+2004-09-02 00:00 rstory
+
+ * README:
+
+ - (README): version tag ( 5.2.pre1 )
+
+2004-09-02 00:00 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.2.pre1 )
+
+2004-09-01 23:55 rstory
+
+ * agent/mibgroup/mibII.h:
+
+ require explicit configure flag for experimental mfd rewrite modules
+
+2004-09-01 23:51 rstory
+
+ * NEWS:
+
+ - merge 5.1.2 news
+ - add other tidbits gleaned from Changelog
+
+2004-09-01 23:51 rstory
+
+ * ChangeLog:
+
+ update for 5.2.pre1
+
+2004-09-01 22:57 rstory
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3,
+ netsnmp_baby_steps.3, netsnmp_bulk_to_next.3,
+ netsnmp_cache_handler.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_iterator_info_s.3, netsnmp_leaf.3,
+ netsnmp_library.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_methods.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_stash_cache.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_util.3, netsnmp_utilities.3,
+ netsnmp_watcher.3:
+
+ update man pages
+
+2004-09-01 22:51 rstory
+
+ * man/: netsnmp_netsnmp_mib_handler_access_methods.3,
+ netsnmp_table_container.3, netsnmp_agent_registry.3,
+ netsnmp_agent_trap.3, netsnmp_asn1_packet_parse.3,
+ netsnmp_callback.3, netsnmp_default_store.3,
+ netsnmp_netsnmp_agent_request_info_s.3,
+ netsnmp_netsnmp_column_info_t.3,
+ netsnmp_netsnmp_data_list_s.3,
+ netsnmp_netsnmp_handler_registration_s.3,
+ netsnmp_netsnmp_mib_handler_s.3,
+ netsnmp_netsnmp_request_info_s.3,
+ netsnmp_netsnmp_table_registration_info_s.3,
+ netsnmp_netsnmp_table_request_info_s.3,
+ netsnmp_read_config.3, netsnmp_snmp_agent.3,
+ netsnmp_snmp_alarm.3, netsnmp_snmp_client.3,
+ netsnmp_snmp_logging.3, netsnmp_snmp_pdu.3,
+ netsnmp_snmp_session.3, netsnmp_variable_list.3:
+
+ check in new man pages
+
+2004-09-01 22:37 rstory
+
+ * agent/Makefile.depend, agent/mibgroup/Makefile.depend
+, snmplib/Makefile.depend,
+ agent/helpers/Makefile.depend, apps/Makefile.depend
+, apps/snmpnetstat/Makefile.depend:
+
+ make depend
+
+2004-09-01 22:16 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ update after running autoheader
+
+2004-09-01 22:14 rstory
+
+ * doxygen.conf:
+
+ - update for 5.2.pre1
+
+2004-09-01 22:12 rstory
+
+ * agent/mibgroup/: if-mib/data_access/interface_common.c,
+ if-mib/data_access/interface_linux.c,
+ if-mib/ifTable/ifTable.h, if-mib/ifXTable/ifXTable.h
+, ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
+, ip-mib/data_access/arp_linux.c,
+ ip-mib/data_access/ipaddress_common.c,
+ ip-mib/data_access/ipaddress_linux.c,
+ ip-mib/data_access/systemstats_common.c,
+ ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c:
+
+ - convert C++ style comments to C style comments (or remove them)
+
+2004-09-01 22:05 rstory
+
+ * README.osX:
+
+ readme for Mac OS X
+
+2004-09-01 22:04 rstory
+
+ * configure:
+
+ update configure for new configure.in
+
+2004-09-01 22:03 rstory
+
+ * configure.in:
+
+ update version to 5.2.pre1
+
+2004-09-01 21:28 rstory
+
+ * agent/mibgroup/disman/: expression/gnuc.h, expression/in6.h
+, expression/ip_var.h, expression/ipv6.h,
+ expression/udp_var.h, ping/gnuc.h, ping/in6.h,
+ ping/ip_var.h, ping/ipv6.h, ping/udp_var.h,
+ traceroute/gnuc.h, traceroute/in6.h,
+ traceroute/ip_var.h, traceroute/ipv6.h,
+ traceroute/udp_var.h, nslookup/gnuc.h, nslookup/in6.h
+, nslookup/ip_var.h, nslookup/ipv6.h,
+ nslookup/udp_var.h:
+
+ remove GPL license code, plus some guilty-by-association files
+
+2004-09-01 20:14 rstory
+
+ * configure:
+
+ configure to match new configure.in
+
+2004-09-01 20:13 rstory
+
+ * configure.in:
+
+ openbsd needs sys/types before tcpd.h
+
+2004-09-01 19:33 rstory
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ tweak comment and log message format
+
+2004-09-01 19:32 rstory
+
+ * snmplib/snmpUDPDomain.c:
+
+ - whitespace change to add real log message (last checking had wrong log message)
+ - add port number to debug statement
+
+2004-09-01 19:28 rstory
+
+ * snmplib/snmpUDPDomain.c,
+ agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ - increase max_sensors
+ - break when number of sensors exceeds max_sensors
+ - add debug
+
+2004-09-01 19:25 rstory
+
+ * configure:
+
+ configure to match configure.in
+
+2004-09-01 19:24 rstory
+
+ * configure.in:
+
+ bail if lm_sensors header/lib checks fail
+
+2004-09-01 17:16 rstory
+
+ * agent/helpers/scalar_group.c:
+
+ - don't return handler if can't allocate sgroup
+ - use local var for rootoid machinations, instead of reginfo rootoid
+ (realloc of extra suboids doesn't survive registration, when subtree_split
+ calls netsnmp_subtree_deepcopy()) [score one for libefence]
+
+2004-09-01 17:09 rstory
+
+ * agent/mibgroup/mibII/interfaces.h:
+
+ only config_require if-mib interface_common, not all of if-mib interface
+
+2004-09-01 17:08 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route.h:
+
+ remove config_require for platforms which haven't been ported yet
+
+2004-09-01 17:06 rstory
+
+ * agent/mibgroup/if-mib/data_access/: interface.h,
+ interface_common.c:
+
+ ifdef out arch specific functions if arch not supported
+
+2004-09-01 17:03 rstory
+
+ * agent/mibgroup/mibII.h:
+
+ only require new mfd modules for linux, until other platforms are ported
+
+2004-09-01 15:27 slif
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ include asm/types.h so that agent will build on Mandrake flavored Linux.
+
+2004-09-01 14:51 rstory
+
+ * snmplib/callback.c:
+
+ - remove C++ style comment
+ - document use of simplistic _lock
+
+2004-09-01 14:30 slif
+
+ * include/net-snmp/system/freebsd6.h:
+
+ provide header for FreeBSD 6. fixes bug#1018209
+
+2004-09-01 14:12 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ - only log open err once (until success, then reset flag)
+
+2004-09-01 14:07 rstory
+
+ * agent/mibgroup/:
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c
+,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
+,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
+:
+
+ check for NULL pointer from data access routines, & return resource unavailable
+
+2004-09-01 11:31 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c:
+
+ - only log file open error once (until a successful open)
+ - return no error if couldn't open ipv6, so we can continue w/ipv4
+
+2004-09-01 10:46 rstory
+
+ * agent/agent_registry.c:
+
+ - eliminate double free on duplicate registration
+ - fix potential memory leaks on failed registration
+ (i.e. always free reginfo if registration fails)
+
+2004-09-01 10:44 rstory
+
+ * agent/helpers/old_api.c:
+
+ eliminate double free on duplicate registration
+
+2004-09-01 08:25 dts12
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/types.h:
+
+ Attempt to ensure that 'int32_t' and (if appropriate) 'int64_t'
+ types (plus unsigned equivalents) are available.
+
+2004-09-01 06:19 dts12
+
+ * local/mib2c.array-user.conf:
+
+ Remove unbalanced "@end@" statements.
+
+2004-09-01 05:57 dts12
+
+ * local/mib2c.conf:
+
+ Provide additional options for table config templates, and
+ describe the differences between them a little more fully.
+
+2004-09-01 05:54 dts12
+
+ * local/mib2c.iterate2.conf:
+
+ Fix minor typo
+
+2004-08-31 21:36 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ - update libtool version information
+ - add note on running cvs2cl on a branch
+
+2004-08-31 21:26 rstory
+
+ * man/mib2c.1.def, local/mib2c.conf:
+
+ add information about mib2c.mfd.conf
+
+2004-08-31 20:04 rstory
+
+ * Makefile.top:
+
+ - update comments on libtool versioning
+ - update for 5.2
+
+2004-08-31 16:43 slif
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ fix float calc in var_extensible_disk per Harald Straॆआƒberger <hs@syslog.at>
+
+2004-08-31 14:02 hardaker
+
+ * agent/Makefile.in:
+
+ install agent_module_config.h
+
+2004-08-31 03:28 dts12
+
+ * local/mib2c.array-user.conf:
+
+ Declare handlers as RWRITE/RONLY as appropriate.
+ Suppress SET handling code for read-only tables.
+
+2004-08-31 03:25 dts12
+
+ * local/: snmpconf, mib2c-conf.d/details-node.m2i,
+ mib2c-conf.d/details-table.m2i,
+ mib2c-conf.d/generic-value-map-func.m2i,
+ mib2c-conf.d/mfd-access-unsorted-external-defines.m2i,
+ mib2c-conf.d/mfd-readme.m2c:
+
+ Dave's being pernickity about grammar again.
+ "It's" is short for "it is".
+ "Belonging to it" is "its" - no apostrophe.
+
+2004-08-31 03:23 dts12
+
+ * local/mib2c.iterate_access.conf:
+
+ Improve error handling for invalid SET requests.
+
+2004-08-31 03:20 dts12
+
+ * local/mib2c.iterate_access.conf:
+
+ Suppress SET handling code for read-only tables.
+
+2004-08-31 03:18 dts12
+
+ * local/: mib2c.iterate.conf, mib2c.iterate_access.conf
+:
+
+ Oops! mib2c config typo
+
+2004-08-31 03:16 dts12
+
+ * local/: mib2c.iterate.conf, mib2c.iterate_access.conf
+:
+
+ Declare handlers as RWRITE/RONLY as appropriate.
+
+2004-08-31 03:11 dts12
+
+ * local/mib2c.iterate2.conf:
+
+ Alternative iterator template. Based on a single handler (unlike
+ 'iterator_access'), but somewhat more complete than the original,
+ particularly w.r.t. SET handling.
+
+2004-08-31 03:09 dts12
+
+ * local/: mib2c.container.conf, mib2c.table_data.conf:
+
+ Improve the example data structure definition (esp. w.r.t. index values)
+
+2004-08-31 00:37 rstory
+
+ * include/net-snmp/agent/agent_handler.h:
+
+ new struct typedef, netsnmp_handler_args
+
+2004-08-31 00:36 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ - add new void pointer for cache hint
+ - define new flag for handler args cache hint
+ - pass handler args cache hint when flag set
+
+2004-08-28 15:54 rstory
+
+ * agent/mibgroup/mibII/interfaces.h:
+
+ config_require mibII/var_route (USE_SYSCTL_IF needs get_address)
+
+2004-08-28 12:38 rstory
+
+ * agent/agent_handler.c:
+
+ - netsnmp_assert on self-reference in linked list
+
+2004-08-28 12:33 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
+:
+
+ - add comments
+
+2004-08-28 12:31 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.h:
+
+ - comment out config_require macros for unwritten modules
+
+2004-08-28 12:28 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ - document scanline format
+
+2004-08-28 12:25 rstory
+
+ * snmplib/container_iterator.c:
+
+ - remove extraneous ';'
+ (issue noted in bug/patch 1011471 More SCO Unixware 7 patches)
+
+2004-08-28 12:17 rstory
+
+ * agent/helpers/table_container.c,
+ include/net-snmp/agent/table_container.h,
+ include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ - inline fixes from Stephen J. Friedl, plus a few I found
+ (issues noted in bug/patch 1011471 More SCO Unixware 7 patches)
+
+2004-08-28 12:10 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ update for new acconfig.h
+
+2004-08-28 12:08 rstory
+
+ * acconfig.h:
+
+ - only define inline macros if enabled
+ (issue noted in bug 1011471 More SCO Unixware 7 patches)
+
+2004-08-27 23:27 rstory
+
+ * agent/snmp_agent.c:
+
+ - fix 1/2 of bug 702435: memory leak [...] for agentx subagents
+ - Patch supplied by Franz G. Fischer
+
+2004-08-27 23:24 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - remove unused var and prototypes
+ - add comment documenting scan line format
+
+2004-08-27 23:22 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c
+:
+
+ - omit routes that are down
+ - hardcode active row status for newly discovered routes
+
+2004-08-27 23:19 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c:
+
+ - tweak log messages syntax
+ - fix ipv4 mask calculation
+ - implement ipv6 routes
+ - common function to set route type from flags
+ - set policy oid based on arbitrary index
+
+2004-08-27 23:16 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_common.c:
+
+ dont free policy oid if static flag set
+
+2004-08-27 23:15 rstory
+
+ * include/net-snmp/data_access/route.h:
+
+ - add flag for static policy oid
+ - change internal index type to oid
+
+2004-08-27 07:29 dts12
+
+ * agent/agent_read_config.c, snmplib/read_config.c,
+ agent/mibgroup/agentx/agentx_config.c:
+
+ Try a different approach to multi-type config handling.
+ Don't automatically register config tokens against multiple types.
+ Instead, explicitly register AgentX-related config tokens as such.
+ (The config mechanism will already automatically load any config
+ file types that it knows about).
+
+2004-08-27 03:15 dts12
+
+ * agent/snmp_agent.c:
+
+ Use a consistent "hosts.{allow,deny}" token for known and unknown addresses.
+
+2004-08-27 03:14 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ If we're reading in the multicast stats, then the scan line needs to be
+ tweaked not to skip this value!
+
+2004-08-26 07:31 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Suppress 32-bit shift warnings on 32-bit systems.
+ (Though this may not be the best way to detect such systems!)
+
+2004-08-26 07:24 dts12
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ Declare missing variable on non-SCNuMAX systems.
+
+2004-08-25 12:35 rstory
+
+ * include/net-snmp/data_access/interface.h:
+
+ - rename netsnmp_interface_entry members to avoid namespace conflicts
+ - noted on users by Akihiro IIJIMA
+
+2004-08-25 09:25 rstory
+
+ * agent/mibgroup/: if-mib/data_access/interface_linux.c,
+ mibII/interfaces.c:
+
+ - apply revised patch for bug 897002: snmpd cannot handle 64 bit interface counters
+ (had been marked as fixed but wasn't)
+
+2004-08-25 08:38 dts12
+
+ * man/mib2c.conf.5:
+
+ Document the new mib2c node tags.
+
+2004-08-25 08:35 dts12
+
+ * mibs/: DISMAN-EXPRESSION-MIB.txt, DISMAN-NSLOOKUP-MIB.txt
+, DISMAN-PING-MIB.txt, DISMAN-TRACEROUTE-MIB.txt
+:
+
+ Add DisMan Remote Operations MIB files
+
+2004-08-25 08:30 dts12
+
+ * agent/mibgroup/disman/: expression/gnuc.h, expression/in6.h
+, expression/ip_var.h, expression/ipv6.h,
+ expression/udp_var.h, nslookup/gnuc.h, nslookup/in6.h
+, nslookup/ip_var.h, nslookup/ipv6.h,
+ nslookup/udp_var.h, ping/gnuc.h, ping/in6.h,
+ ping/ip_var.h, ping/ipv6.h, ping/udp_var.h,
+ traceroute/gnuc.h, traceroute/in6.h,
+ traceroute/ip_var.h, traceroute/ipv6.h,
+ traceroute/udp_var.h:
+
+ Locally-tweaked versions of standard header files.
+ This is not the most appropriate way to proceed,
+ but is needed to get the initial implementation working.
+
+2004-08-25 07:31 dts12
+
+ * local/mib2c.iterate_access.conf:
+
+ Support holes in "iterate_access" tables.
+
+2004-08-25 01:11 dts12
+
+ * agent/mibgroup/Rmon/event.c:
+
+ Fix a memory leak in the Rmon code. (Reported by Fong Tsui)
+
+2004-08-24 18:27 rstory
+
+ * agent/mibgroup/if-mib/: data_access/interface_common.c,
+ data_access/interface_ioctl.c,
+ data_access/interface_linux.c, ifTable/ifTable.c,
+ ifTable/ifTable.h, ifTable/ifTable_data_access.c:
+
+ - rename netsnmp_interface_entry members to avoid namespace conflicts
+ - noted on users by Akihiro IIJIMA
+
+2004-08-24 09:28 dts12
+
+ * testing/tests/: T055agentv1mintrap, T056agentv2cmintrap
+:
+
+ Fix the minimal config tests to use the correct set of MIB modules.
+ (Reported by Magnus Fromreide)
+
+2004-08-24 09:24 dts12
+
+ * testing/: README, RUNTESTS, eval_tools.sh:
+
+ Support additional trapd flags (patch from Magnus Fromreide)
+ (And update the README to keep Mike happy!)
+
+2004-08-24 09:19 dts12
+
+ * apps/snmptrapd.c:
+
+ Log reconfig/shutdown messages more reliably. (Patch from Magnus Fromreide)
+
+2004-08-24 09:16 dts12
+
+ * COPYING:
+
+ Add Cisco/BUPTNIC copyright notice, to cover the new DisMan RemOps code.
+
+2004-08-24 08:15 dts12
+
+ * agent/mibgroup/: disman.h, disman/expression-mib.h,
+ disman/nslookup-mib.h, disman/ping-mib.h,
+ disman/traceroute-mib.h, disman/expression/expErrorTable.c
+, disman/expression/expErrorTable.h,
+ disman/expression/expExpressionTable.c,
+ disman/expression/expExpressionTable.h,
+ disman/expression/expObjectTable.c,
+ disman/expression/expObjectTable.h,
+ disman/expression/expValueTable.c,
+ disman/expression/expValueTable.h,
+ disman/nslookup/lookupCtlTable.c,
+ disman/nslookup/lookupCtlTable.h,
+ disman/nslookup/lookupResultsTable.c,
+ disman/nslookup/lookupResultsTable.h,
+ disman/ping/pingCtlTable.c, disman/ping/pingCtlTable.h
+, disman/ping/pingProbeHistoryTable.c,
+ disman/ping/pingProbeHistoryTable.h,
+ disman/ping/pingResultsTable.c,
+ disman/ping/pingResultsTable.h,
+ disman/traceroute/traceRouteCtlTable.c,
+ disman/traceroute/traceRouteCtlTable.h,
+ disman/traceroute/traceRouteHopsTable.c,
+ disman/traceroute/traceRouteHopsTable.h,
+ disman/traceroute/traceRouteProbeHistoryTable.c,
+ disman/traceroute/traceRouteProbeHistoryTable.h,
+ disman/traceroute/traceRouteResultsTable.c,
+ disman/traceroute/traceRouteResultsTable.h:
+
+ Preliminary implementation of the DisMan Remote Operation MIB groups.
+ Note that these are not yet ready for production use.
+
+2004-08-23 08:06 rstory
+
+ * Makefile.rules:
+
+ new target to only make objects for current directory (no subdirs)
+
+2004-08-23 07:35 dts12
+
+ * apps/snmpwalk.c, man/snmpwalk.1.def:
+
+ Option to exclude the final GET request when walking a single instance.
+
+2004-08-23 02:39 dts12
+
+ * local/: mib2c.container.conf, mib2c.table_data.conf:
+
+ New template configs for row-based "internal-data" implementations.
+
+2004-08-23 02:29 dts12
+
+ * local/mib2c:
+
+ New variable tokens to identify "creatable" or RowStatus column objects.
+ Extend these two tokens, plus "settable" to apply to tables as well
+ (reporting on the constituent column objects).
+
+2004-08-23 01:59 dts12
+
+ * agent/mibgroup/target/target_counters.c:
+
+ Implement context error counters as proper scalar objects
+ (rather than simply instances)
+
+2004-08-23 01:58 dts12
+
+ * agent/mibgroup/mibII/setSerialNo.c:
+
+ Fuller implementation of snmpSetSerialNo object, including persistance across
+ agent restart, random initialisation value (both per TestAndIncr description)
+ and proper object instance behaviour.
+
+2004-08-23 01:56 dts12
+
+ * agent/agent_registry.c:
+
+ Don't invoke callback registrations if the original registration fails.
+ (See bug #990070)
+
+2004-08-20 08:51 rstory
+
+ * doxygen.conf:
+
+ update project number to 5.2.dev
+
+2004-08-20 08:48 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - remove static attribute for function
+ - fix paren grouping
+
+2004-08-20 08:47 rstory
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ - do not include data access headers, as they are not installed
+
+2004-08-20 08:18 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.h:
+
+ include interface data access header
+
+2004-08-20 01:53 dts12
+
+ * apps/snmptrapd.c:
+
+ Tidy up handling of pid_file. (Patches from Magnus Fromreide)
+
+2004-08-19 02:23 dts12
+
+ * apps/snmptrapd.c:
+
+ Improved handling of snmptrapd PID file.
+ Patch from Magnus Fromreide.
+
+2004-08-19 02:17 dts12
+
+ * Makefile.in:
+
+ Handle agent_module header files in the same way as mib_module ones.
+ (Removing them when cleaning up, and installing the config header)
+
+2004-08-19 02:12 dts12
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ Add agent_module configuration tokens to the list of
+ standard agent includes. (Reported by Magnus Fromreide)
+
+2004-08-19 02:10 dts12
+
+ * agent/mibgroup/snmpv3/usmConf.h:
+
+ Correct agent_module config setting.
+ (Spotted by Magnus Fromreide)
+
+2004-08-18 15:12 nba
+
+ * snmplib/parse.c:
+
+ Allow TOKENRING-MIB and DS1-MIB to override older RFC mibs
+
+2004-08-18 02:21 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Use the context name from the registration call,
+ rather than the context from the incoming request.
+ These ought to be the same, but are subtly different when
+ no context is specified. (Patch supplied by Magnus Fromreide)
+
+2004-08-17 08:40 dts12
+
+ * Makefile.rules:
+
+ More portable approach to avoiding unnecessary header installs.
+ (Thanks to both Ben Rogers and Stephen J. Friedl)
+
+2004-08-17 02:08 dts12
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/read_config.c:
+
+ Attempt to support multiple '{xxxx}.conf' application types.
+
+2004-08-17 02:06 dts12
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ Include the new 'NET-SNMP-EXTEND-MIB' module in a default config.
+
+2004-08-17 02:04 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Allow "traphandle" directives to match a subtree rather
+ than just a single trap. (Suggested by Bosko Milekic)
+
+2004-08-17 01:59 dts12
+
+ * snmplib/snmpv3.c:
+
+ Don't bother looking up the hostname unless it'll actually
+ be needed for generating the engineID. Suggested by Joe C.
+
+2004-08-17 01:51 dts12
+
+ * snmplib/: snmpUDPDomain.c, snmpUDPIPv6Domain.c,
+ snmpUnixDomain.c:
+
+ Ensure that a non-matching com2sec lookup will return a NULL 'secName'
+ (Based on a suggestion by Oleg Ivanov)
+
+2004-08-17 01:41 dts12
+
+ * agent/snmp_agent.c:
+
+ Don't apply 'hosts.{allow,deny}' checking to callback connections
+ (which typically won't match anything other than "ALL")
+
+2004-08-17 01:38 dts12
+
+ * agent/agent_registry.c:
+
+ Protect against missing parameters. (Suggested by John Lash)
+
+2004-08-17 01:32 dts12
+
+ * agent/helpers/table_container.c,
+ include/net-snmp/agent/table_container.h:
+
+ API for adding a (newly created) row to the varbind request list,
+ so it's available during later SET passes. There's probably
+ a better way of comparing index values, but this seems to work.
+
+2004-08-17 01:27 dts12
+
+ * agent/mibgroup/: snmpv3mibs.h, snmpv3/usmConf.c,
+ snmpv3/usmConf.h, snmpv3/usmUser.c:
+
+ Split off USM config handling into a separate module
+ (and move this into the agent library)
+
+2004-08-17 01:25 dts12
+
+ * agent/mibgroup/: agentx/agentx_config.h, agentx/client.h
+, agentx/master.h, agentx/master_admin.h,
+ agentx/protocol.h, agentx/subagent.h,
+ mibII/vacm_conf.h:
+
+ Move VACM config handling and AgentX support into the agent library.
+
+2004-08-17 01:23 dts12
+
+ * agent/: agent_read_config.c, mib_modules.c:
+
+ Pick up agent_module initialisation and dot_conf routines.
+ (Not convinced this is the best place for the agent_module
+ init routines to be called, but it'll do for now.)
+
+2004-08-17 01:21 dts12
+
+ * agent/Makefile.in:
+
+ Switch linking order of agent and mib libraries (since libnetsnmpmibs
+ may well use routines defined in libnetsnmpagent, but not vice versa)
+
+2004-08-17 01:15 dts12
+
+ * configure.in, configure:
+
+ Ensure agent vs mib modules are picked up correctly (esp. for modules
+ without a header file, which should default to 'mib_modules')
+
+2004-08-17 01:11 dts12
+
+ * agent/mibgroup/agent/extend.c,
+ agent/mibgroup/ucd-snmp/extensible.c, man/snmpd.conf.5.def
+:
+
+ Slightly preferable config token for the new extensible scripting mib,
+ document this feature, and add a warning regarding the old (invalid)
+ relocatable output format.
+
+2004-08-16 20:25 rstory
+
+ * agent/snmp_agent.c:
+
+ - don't drop re-attached head (patch from Tommy Christensen)
+ - fix typo
+
+2004-08-16 14:57 rstory
+
+ * agent/helpers/Makefile.in:
+
+ install mfd.h
+
+2004-08-16 14:45 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ new version from autoconf
+
+2004-08-16 14:23 rstory
+
+ * acconfig.h:
+
+ - add undef for STRUCT_TM_HAS_TM_GMTOFFF
+ - define config_belongs_in to nothing
+
+2004-08-16 12:13 nba
+
+ * mibs/: Makefile.mib, mibfetch, smistrip:
+
+ More automatic installation of RFC based mibs
+
+2004-08-13 06:59 dts12
+
+ * include/net-snmp/agent/.cvsignore:
+
+ Ignore config-generated 'agent_module' files
+
+2004-08-13 06:51 dts12
+
+ * agent/mibgroup/.cvsignore:
+
+ Ignore config-generated 'agent_module' files
+
+2004-08-13 06:43 dts12
+
+ * apps/snmptrapd.c, local/Makefile.in,
+ local/snmpconf.dir/snmptrapd-data/authentication,
+ local/snmpconf.dir/snmptrapd-data/logging,
+ local/snmpconf.dir/snmptrapd-data/runtime,
+ man/snmptrapd.conf.5.def, win32/dist/installer/net-snmp.nsi
+:
+
+ Add snmptrapd config support for logging, authentication and runtime options.
+ (Patch #981319 from Alex Burger)
+
+2004-08-13 06:33 dts12
+
+ * snmplib/snmpksm.c:
+
+ Strip port-number specification from "peername" when constructing KSM credentials.
+ (Based on patch #992440)
+
+2004-08-13 03:08 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Handle "general" AgentX errors, not associated with a specific varbind.
+ (Based on patch #983972 from lorenzim)
+
+2004-08-13 02:54 dts12
+
+ * Makefile.rules:
+
+ Provide missing definition of 'installsubdirheaders' rule.
+ (Patch #991664 from Ben Rogers)
+
+2004-08-13 02:53 dts12
+
+ * Makefile.rules:
+
+ "Lazy" installation of header files. Only install a header file if
+ it's newer than the existing one. (Patch #991664 from Ben Rogers)
+
+2004-08-13 02:50 dts12
+
+ * configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in, snmplib/snmp-tc.c
+:
+
+ Use an explicit check for 'tm_gmtoff', rather than per-architecture #defines
+ (Patch #1006298 from Stephen J. Friedl)
+
+2004-08-13 02:17 nba
+
+ * mibs/: IANAifType-MIB.txt, ianalist, rfclist:
+
+ Updated RFC MIB information
+
+2004-08-12 07:49 dts12
+
+ * snmplib/read_config.c:
+
+ Handle a colon-separated list of "application-type" config files.
+ (e.g. "agentx:snmpd" to search *both* 'snmpd.conf' *and* 'agentx.conf')
+ See coders-thread "AgentX configuration" - Jul '04
+
+2004-08-12 05:20 dts12
+
+ * agent/mibgroup/utilities/execute.h:
+
+ An example of configuring code into the agent rather than the mib library.
+
+2004-08-12 05:18 dts12
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ include/net-snmp/net-snmp-config.h.in, configure.in
+, configure:
+
+ Support a mechanism for including particular code modules within either
+ the mib library or the agent library (or potentially elsewhere as well).
+ (See coders-thread "Moving AgentX out of the mibmodules" - June '04)
+
+2004-08-12 05:12 dts12
+
+ * include/net-snmp/agent/all_helpers.h:
+
+ Include an oft-overlooked helper.
+
+2004-08-12 05:11 dts12
+
+ * apps/notification_log.c:
+
+ Protect against following NULL pointers
+ (plus some petty grammaticastigation)
+
+2004-08-11 13:57 rstory
+
+ * man/Makefile.in:
+
+ look for .in file in srcdir, which may != current dir
+
+2004-08-11 05:54 dts12
+
+ * agent/helpers/table_data.c:
+
+ Only store the table structure on the first pass through.
+ Subsequent passes can retrieve this stored value anyway.
+
+2004-08-11 04:55 dts12
+
+ * man/Makefile.in:
+
+ remove deleted man pages (todo & deprecated)
+
+2004-08-10 08:53 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ update libtool versioning a bit
+
+2004-08-04 05:51 dts12
+
+ * Makefile.in, man/netsnmp_deprecated.3,
+ man/netsnmp_todo.3:
+
+ Don't install 'todo' or 'deprecated' man pages
+ (since these are constructed with suspect formatting)
+
+2004-08-03 08:12 dts12
+
+ * snmplib/snmpv3.c:
+
+ Specify the correct length of string for AES 'strncmp' comparisons.
+ (See bug #996894)
+
+2004-08-02 14:17 hardaker
+
+ * agent/agent_registry.c:
+
+ fix context registration so new context trees get properly initialized.
+
+2004-08-02 14:13 hardaker
+
+ * mibs/makehtml.pl:
+
+ Don't double-produce HTML output for repeated MIBs.
+
+2004-07-30 17:32 hardaker
+
+ * NEWS:
+
+ - document AgentX context fixing
+ - document the usmUser table population under snmptrapd
+
+2004-07-30 17:31 hardaker
+
+ * snmplib/: snmpUDPDomain.c, snmpUDPIPv6Domain.c,
+ snmpUnixDomain.c:
+
+ Double check that the contextName array is properly initialize.
+
+2004-07-30 17:30 hardaker
+
+ * include/net-snmp/agent/agent_registry.h:
+
+ Add contextName to the registration paramaters structure.
+
+2004-07-30 17:29 hardaker
+
+ * apps/snmptrapd.c:
+
+ Register the usmUserTable under the "snmptrapd" context
+
+2004-07-30 17:28 hardaker
+
+ * apps/notification_log.c:
+
+ - register all the snmptrapd mib nodes under the "snmptrapd" context
+
+2004-07-30 17:26 hardaker
+
+ * agent/mibgroup/snmpv3/: usmUser.c, usmUser.h:
+
+ Create a function to register the usmUser table other a different context.
+
+2004-07-30 17:26 hardaker
+
+ * agent/mibgroup/agentx/: client.c, client.h, master.c
+, subagent.c:
+
+ - Fix agentx to work properly under non-default contexts.
+
+2004-07-30 17:24 hardaker
+
+ * agent/helpers/instance.c, include/net-snmp/agent/instance.h
+:
+
+ Add a bunch of functions to register instances under non default contexts.
+
+2004-07-30 17:23 hardaker
+
+ * agent/agent_registry.c:
+
+ - fix add_subtree so it registers top level null handlers too
+ - fixes a number of context problems
+ - pass context information down into registration info struct (used by agentx)
+
+2004-07-30 17:21 hardaker
+
+ * agent/helpers/null.c, include/net-snmp/agent/null.h:
+
+ - add a null registration function for contexts other than the default.
+
+2004-07-30 14:44 hardaker
+
+ * apps/snmpusm.c, snmplib/snmpusm.c, snmplib/snmpv3.c
+:
+
+ Patch from Abhijit Hayatnagarkar to fix USM privacy key lengths
+
+2004-07-30 13:36 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ I was sleeping earlier when I fixed code that wasn't broken.
+
+2004-07-30 13:07 hardaker
+
+ * NEWS:
+
+ mention community string -> context mappings
+
+2004-07-30 13:04 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document the new com2sec token options.
+
+2004-07-30 13:01 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c
+, snmplib/snmpUnixDomain.c:
+
+ Make the com2sec* tokens accept a -Cn CONTEXT flag to allow the
+ mapping of community strings to SNMPv3 contexts.
+
+2004-07-30 12:57 hardaker
+
+ * agent/snmp_agent.c:
+
+ Pass the actual pdu being processed into check_access instead of the copy
+
+2004-07-30 11:21 hardaker
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Fix context checking so it actually works for non default contexts
+
+2004-07-28 12:52 hardaker
+
+ * agent/mibgroup/if-mib/data_access/interface.h:
+
+ configure_require -> config_require
+
+2004-07-28 05:40 dts12
+
+ * README.win32:
+
+ OpenSSL is needed for SHA-based authentication, rather than MD5.
+ (It's used for both if available, but it's only *needed* for SHA)
+
+2004-07-28 02:17 dts12
+
+ * FAQ:
+
+ Discuss RPM-dependecy problems.
+
+2004-07-28 01:04 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Per-object switch statement is missing the "case" keyword.
+ (Reported by William Buckley)
+
+2004-07-22 17:55 slif
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ for win32 agent, interpret ifOperStatus correctly,
+ and set ifLastChange to zero. These changes fixes bug #907716.
+
+2004-07-22 13:06 slif
+
+ * win32/net-snmp/: net-snmp-config.h, net-snmp-config.h.in
+:
+
+ typedef long int32_t to succeed building with MSVC++.
+
+2004-07-22 10:45 slif
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ patch #982628 applied to fix leak on errors in netsnmp_udp6_transport
+
+2004-07-22 08:49 dts12
+
+ * FAQ:
+
+ Emphasise the need to explicitly create users.
+
+2004-07-20 23:26 slif
+
+ * agent/mibgroup/mibII/: tcpTable.c, udpTable.c:
+
+ fix bug #992735 OSX 10.3.4 make fails by including darwin in #if expressions.
+
+2004-07-20 22:29 slif
+
+ * include/net-snmp/system/darwin7.h:
+
+ create system header for -Ddarwin7. partial fix for bug 992735.
+
+2004-07-20 19:40 slif
+
+ * agent/helpers/table_iterator.c:
+
+ fix bug 994194 by checking for null before de-referencing pointer argument.
+
+2004-07-20 13:31 slif
+
+ * README.solaris:
+
+ patch 988286 from Bruce Shaw - Lots of updates on README.solaris
+
+2004-07-20 13:22 slif
+
+ * testing/eval_tools.sh:
+
+ use kill.exe only iff OSTYPE = msys (patch #987626 applied)
+
+2004-07-19 09:28 dts12
+
+ * man/snmpvacm.1.def:
+
+ Fix erroneous troff macro, as reported by Eric Raymond
+
+2004-07-16 22:53 hardaker
+
+ * agent/mibgroup/mibII/: mibII_common.h, tcpTable.c:
+
+ Attempted fixes for darwin
+
+2004-07-16 11:52 hardaker
+
+ * agent/mibgroup/ip-mib/ipSystemStatsTable.h:
+
+ Added missing ipSystemStatsTable.h file which Robert probably forgot to check in. I'm guessing at the propercontents, but it should be right
+
+2004-07-16 09:08 dts12
+
+ * FAQ:
+
+ A few additional entries (esp. relating to generating traps)
+ plus some minor restructuring and wordsmithing.
+
+2004-07-10 21:29 rstory
+
+ * agent/mibgroup/ip-mib/data_access/systemstats_linux.c:
+
+ - remove debug msg
+ - log warning if header length isn't what we expect
+
+2004-07-10 21:28 rstory
+
+ * snmplib/int64.c:
+
+ - fix inverted conditional test
+ - don't assume 64 if wrapcheck skipped
+
+2004-07-10 19:52 rstory
+
+ * include/net-snmp/data_access/interface.h:
+
+ - add comment to document structure var
+
+2004-07-10 19:51 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
+:
+
+ - bump up timeout to 30 seconds, instead of 3
+
+2004-07-10 19:50 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c:
+
+ - remove reminder comment
+ - fix typo, indententation
+
+2004-07-10 19:48 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ use uintmax_t vars for parsing data
+
+2004-07-10 13:07 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ make local function more generic and move to netsnmp_c64_check32_and_update
+
+2004-07-10 13:06 rstory
+
+ * agent/mibgroup/ip-mib/: inetNetToMediaTable.h,
+ ipAddressTable.h, inetNetToMediaTable/inetNetToMediaTable.h
+, ipAddressTable/ipAddressTable.h:
+
+ move config requires up a level
+
+2004-07-10 13:02 rstory
+
+ * include/net-snmp/data_access/net-snmp-data-access-includes.h
+:
+
+ add ipstats/systemstats headers
+
+2004-07-10 13:01 rstory
+
+ * include/net-snmp/library/int64.h, snmplib/int64.c:
+
+ new function netsnmp_c64_check32_and_update
+
+2004-07-10 12:58 rstory
+
+ * agent/mibgroup/ip-mib.h:
+
+ add ipSystemStatsTable
+
+2004-07-10 11:05 rstory
+
+ * agent/mibgroup/ip-mib/data_access/systemstats.h,
+ agent/mibgroup/ip-mib/data_access/systemstats_common.c,
+ agent/mibgroup/ip-mib/data_access/systemstats_linux.c,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/.cvsignore,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/.mib2c-updaterc,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/default-table-ipSystemStatsTable.m2d
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable-README-FIRST.txt
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable-README-ipSystemStatsTable.txt
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
+,
+ agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
+, include/net-snmp/data_access/ipstats.h,
+ include/net-snmp/data_access/systemstats.h:
+
+ implement ipSystemStatsTable
+
+2004-07-09 22:58 hardaker
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c
+:
+
+ - remove my quick // comments
+ - remove a few XXX comments that were feedback for Robert (now emailed).
+
+2004-07-09 15:29 hardaker
+
+ * apps/snmpusm.c:
+
+ - Pull the DH parameters from the agent to use its currently configured params.
+ - protect against !openssl users
+
+2004-07-09 15:28 hardaker
+
+ * apps/snmpusm.c:
+
+ Pull the DH parameters from the agent to use its currently configured params.
+
+2004-07-09 15:28 hardaker
+
+ * agent/mibgroup/: snmp-usm-dh-objects-mib.h,
+ snmp-usm-dh-objects-mib/usmDHParameters.h,
+ snmp-usm-dh-objects-mib/usmDHParameters/.cvsignore,
+ snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c,
+ snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.h,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c
+,
+ snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h
+:
+
+ Added the usmDHParameters object for management of the DH parameters
+
+2004-07-09 11:18 hardaker
+
+ * snmplib/read_config.c:
+
+ Make the persistent file warning a bit, um, more strong
+
+2004-07-09 09:58 hardaker
+
+ * NEWS, agent/mibgroup/snmp-usm-dh-objects-mib.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable.h,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/default-table-usmDHUserKeyTable.m2d
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_doxygen.conf
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h
+,
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h
+:
+
+ Implemented the SNMP-USM-DH-OBJECTS-MIB usmDHUserKeyTable table.
+
+2004-07-09 09:57 hardaker
+
+ *
+ agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/.cvsignore
+:
+
+ ignore file
+
+2004-07-09 09:32 hardaker
+
+ * apps/snmpusm.c, man/snmpusm.1.def:
+
+ Support a diffie-helman based "changekey" command.
+
+2004-07-09 09:26 hardaker
+
+ * include/net-snmp/library/snmpusm.h:
+
+ Add diffie-helman void * container pointers.
+
+2004-07-09 09:24 hardaker
+
+ * mibs/: SNMP-USM-DH-OBJECTS-MIB.txt, Makefile.in:
+
+ rfc2786: dh usm mib
+
+2004-07-09 09:22 hardaker
+
+ * configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Test for openssl/dh.h
+
+2004-07-08 17:31 rstory
+
+ * agent/mibgroup/mibII/route_write.c:
+
+ - Linux: use non 0 socket protocol when creating socket (or call fails)
+ - don't return success if socket call fails
+ - close socket before returning
+ - fix typo in comment
+
+2004-07-08 17:29 rstory
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ - move write_method assignment before check for existing node, so row creation
+ can be supported
+
+2004-07-08 17:27 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ update test for correct node decl type
+
+2004-07-08 17:26 rstory
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i:
+
+ generate high & low assignments for counter64 nodes
+
+2004-07-08 15:38 rstory
+
+ * local/mib2c:
+
+ close files before exit, to flush pending output
+
+2004-07-08 09:09 rstory
+
+ * agent/mibgroup/mibII/route_write.c:
+
+ - assign dst addr to new cache entry, so we can find it in next pass
+
+2004-07-08 08:37 rstory
+
+ * agent/agent_trap.c:
+
+ - back our previous trap binding change
+ - set new session.localname to localhost for v1/v2c traps (but not informs)
+
+2004-07-08 08:36 rstory
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ - allow per session binding to specific local address for udp transports
+
+2004-07-08 07:18 rstory
+
+ * agent/agent_trap.c:
+
+ - bind v1 trap sessions client address to localhost
+
+2004-07-08 06:52 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ - close file when done with it
+
+2004-07-07 16:56 rstory
+
+ * local/mib2c-update:
+
+ - switch to unified diff
+
+2004-07-07 16:50 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - remove some duplicated code (use interface data access versions)
+ - remove unused var
+
+2004-07-07 16:24 hardaker
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ Properly quote mib2c variable in a @if@ clause.
+
+2004-07-07 16:23 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/:
+ ipCidrRouteTable.h, ipCidrRouteTable_data_access.c:
+
+ - change row status object name to match mib (which doesn't end in RowStatus)
+
+2004-07-07 16:15 rstory
+
+ * agent/mibgroup/ip-forward-mib/inetCidrRouteTable/:
+ inetCidrRouteTable.c, inetCidrRouteTable.h,
+ inetCidrRouteTable_constants.h,
+ inetCidrRouteTable_data_access.c,
+ inetCidrRouteTable_data_access.h,
+ inetCidrRouteTable_interface.c,
+ inetCidrRouteTable_interface.h:
+
+ - update generated code
+
+2004-07-07 13:56 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/:
+ ipCidrRouteTable.h, ipCidrRouteTable_data_access.c:
+
+ - agree on variable name
+
+2004-07-07 13:41 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
+:
+
+ - register table as CAN_RONLY
+
+2004-07-07 13:41 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/:
+ ipCidrRouteTable.c, ipCidrRouteTable.h,
+ ipCidrRouteTable_data_access.c:
+
+ - implement row status (hardcoded as active)
+
+2004-07-07 13:31 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h,
+ agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ include/net-snmp/data_access/route.h:
+
+ - replace u_intN_t with more portable uintN_t
+
+2004-07-07 10:41 rstory
+
+ * agent/mibgroup/mibII/ifTable.h:
+
+ - include interface data access header for struct/enums
+
+2004-07-07 10:41 rstory
+
+ * agent/mibgroup/mibII/ifTable.c:
+
+ - initialise container via data access library
+
+2004-07-07 10:26 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ - use enums from mib instead of hardcoded values
+
+2004-07-07 10:21 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
+:
+
+ - add missing TC value
+
+2004-07-07 10:21 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_linux.c:
+
+ - update ipv6 implementation (take a stab at status, type, origin)
+
+2004-07-07 07:13 rstory
+
+ * Makefile.in:
+
+ tweak comment check pattern to exclude logs of mfd matches
+
+2004-07-07 07:02 rstory
+
+ * include/net-snmp/library/container_list_ssll.h,
+ snmplib/container_list_ssll.c:
+
+ - add unsorted singly linked list (fifo or lifo)
+
+2004-07-07 05:24 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Quote "r[ow]community" string before passing to com2sec-style parser,
+ to retain any internal whitespace.
+
+2004-07-07 05:21 dts12
+
+ * snmplib/: snmpUDPDomain.c, snmpUDPIPv6Domain.c:
+
+ Use copy_nword rather than strtok for parsing com2sec entries.
+ (To handle quoted strings properly)
+
+2004-07-07 02:14 dts12
+
+ * agent/helpers/table_data.c:
+
+ Convert to use the non-recursive 'AUTO_NEXT' approach
+ for all bar GETNEXT/GETBULK requests.
+
+2004-07-07 02:12 dts12
+
+ * agent/helpers/: table_data.c, table_iterator.c:
+
+ Sparse tables are handled within the tabler helper,
+ so don't need to be considered here.
+
+2004-07-07 02:11 dts12
+
+ * agent/agent_handler.c:
+
+ Don't throw an error if the final handler registration didn't
+ include an explicit handler routine. This is perfectly reasonable
+ if the MIB object is handled internally by the preceding helpers.
+
+2004-07-06 21:18 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/: ipAddressTable.c,
+ ipAddressTable.h, ipAddressTable_data_access.c,
+ ipAddressTable_interface.c:
+
+ - implement/enable ipAddressType, ipAddressCreated, ipAddressLastChanged
+ ipAddressRowStatus (hardcoded active), ipAddressStorageType (hardcoded volatile)
+ - return not writable/no creation until set support implemented
+ - config_require interface data access
+ - update cache policy to auto reload, for last changed/created
+
+2004-07-06 21:12 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ include/net-snmp/data_access/ipaddress.h:
+
+ - new func to compare and update ipaddress entries
+ - new flag/code for second container index, by address
+
+2004-07-06 21:07 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ - return resource unavailable on empty interface container
+ - log malloc failure
+
+2004-07-06 21:00 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c,
+ include/net-snmp/data_access/interface.h:
+
+ - rename interface data access init routine
+ - create container once during init, to discover ifIndexes
+
+2004-07-06 20:58 rstory
+
+ * agent/snmp_vars.c:
+
+ init interface data access in init_agent
+
+2004-07-06 17:33 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ increase default oid printing size.
+
+2004-07-06 17:15 hardaker
+
+ * snmplib/mib.c:
+
+ increase default buffer size passed to get_symbol_realloc (useful
+ for long OIDs when realloc is actually off).
+
+2004-07-06 15:58 rstory
+
+ * include/net-snmp/agent/all_helpers.h:
+
+ add new mfd header
+
+2004-07-06 15:57 rstory
+
+ * include/net-snmp/agent/mfd.h:
+
+ common mfd include
+
+2004-07-06 15:54 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ initialize variable before use
+
+2004-07-06 14:24 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ Only print one of the error messages if the result was an array.
+
+2004-07-06 14:23 hardaker
+
+ * perl/OID/OID.xs:
+
+ - fix a few "whoops" (remove debugging; properly {} multi if statements).
+
+2004-07-06 14:11 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ - if a table is composed of only indexes, walk at least one so results
+ are returned for gettable().
+
+2004-07-06 14:08 hardaker
+
+ * perl/OID/OID.xs:
+
+ - properly return NULLs when appropriate.
+ - make get_indexes return indexes from augmented tables.
+
+2004-07-06 14:00 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c,
+ agent/mibgroup/if-mib/ifTable/ifTable.c,
+ include/net-snmp/data_access/interface.h:
+
+ - add inucast, onucast counters to stats struct
+ - move inucast, onucast calculations into linux interface data_access
+
+2004-07-06 11:53 rstory
+
+ * Makefile.in:
+
+ - update make checks to check for cpp #warnings
+
+2004-07-05 20:01 rstory
+
+ * local/Version-Munge.pl:
+
+ - document -T option in usage
+
+2004-07-05 20:00 rstory
+
+ * include/net-snmp/data_access/interface.h:
+
+ - remove nasty kernel trick defines
+ - add backwards compatability typedef for conf_if_list
+
+2004-07-05 19:59 rstory
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ - include new data access include
+
+2004-07-05 19:52 rstory
+
+ * include/net-snmp/data_access/net-snmp-data-access-includes.h
+:
+
+ new header for all data access includes
+
+2004-07-05 15:09 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c
+:
+
+ - remove row status for now; warning to remind before 5.2
+
+2004-07-05 15:08 rstory
+
+ * agent/mibgroup/mibII/interfaces.h:
+
+ add config_require of data_access/interface
+
+2004-07-05 14:50 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ remove conf_if_list declaration (it's in data_access/intefaces.h now)
+
+2004-07-05 14:12 rstory
+
+ * agent/mibgroup/: ip-forward-mib/data_access/route_linux.c,
+ ip-mib/data_access/arp_linux.c,
+ ip-mib/data_access/ipaddress_ioctl.c:
+
+ asserts should be netsnmp_asserts
+
+2004-07-05 14:10 rstory
+
+ * agent/mibgroup/if-mib/: data_access/interface_common.c,
+ data_access/interface_linux.c, ifTable/ifTable.c,
+ ifTable/ifTable.h:
+
+ - don't use nasty kernel trick (avoid unexpected macro substitutions)
+
+2004-07-05 09:21 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-07-05 09:20 rstory
+
+ * configure.in:
+
+ update version to 5.2.dev
+
+2004-07-05 09:04 rstory
+
+ * perl/TrapReceiver/TrapReceiver.pm:
+
+ - (perl/TrapReceiver/TrapReceiver.pm): version tag ( 5.2.dev )
+
+2004-07-05 09:04 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.2.dev )
+
+2004-07-05 09:04 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.2.dev )
+
+2004-07-05 09:03 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.2.dev )
+
+2004-07-05 09:03 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.2.dev )
+
+2004-07-05 09:03 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.2.dev )
+
+2004-07-05 09:03 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.2.dev )
+
+2004-07-05 09:02 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.2.dev )
+
+2004-07-05 09:02 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.2.dev )
+
+2004-07-05 09:01 rstory
+
+ * dist/net-snmp.spec:
+
+ - (dist/net-snmp.spec): version tag ( 5.2.dev )
+
+2004-07-05 09:01 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.2.dev )
+
+2004-07-05 09:01 rstory
+
+ * README:
+
+ - (README): version tag ( 5.2.dev )
+
+2004-07-05 09:00 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.2.dev )
+
+2004-07-05 08:31 rstory
+
+ * dist/nsb-functions:
+
+ add make test results to upload
+
+2004-07-05 05:59 dts12
+
+ * agent/helpers/: cache_handler.c, read_only.c,
+ table_dataset.c, watcher.c:
+
+ Use "AUTO_NEXT"-style handling for the trivial cases
+ (noting this behaviour within the handler itself).
+
+2004-07-05 05:53 dts12
+
+ * agent/helpers/multiplexer.c:
+
+ Use switch fallthrough to handler GetBulk->GetNext->Get handler fallbacks.
+ The previous code didn't cope with a missing GET helper for GetBulk/GetNext.
+
+2004-07-04 18:27 rstory
+
+ * agent/helpers/bulk_to_next.c:
+
+ - convert to use AUTO_NEXT
+
+2004-07-04 18:25 rstory
+
+ * agent/mibgroup/mibII/udpTable.h:
+
+ - restore config_reqire of old table (enable-mfd-rewrites coexistence)
+
+2004-07-04 18:23 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_interface.c:
+
+ - ifdef out table registration iff ! enable-mfd-rewrites
+ - init cache earlier (it happens even if ! enable-mfd-rewrites, for ifXTable)
+
+2004-07-04 18:21 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.h,
+ ifTable_data_access.c:
+
+ - add flag to indicate if a cached interface is not missing
+ - set admin (and maybe oper) status down first time interface goes missing
+ - set ifLastChanged when oper status changes
+ - set ifCounterDiscontinuityTime when missing interface returns
+
+2004-07-04 18:18 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ - use ifName for description iff NULL description
+ - return empty string for physaddr iff all 0s
+
+2004-07-04 18:16 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - document that SIOCGIFHWADDR ioctl might not return full 6 bytes
+ - add memset to 0 before SIOCGIFHWADDR ioctl, if needed
+ - use standard IFHWADDRLEN macro instead of hardcoded 6
+ - trivial optimization (don't assign var twice in certain cases)
+ - comment out all ifTable from variable struct iff --enable-mfd-rewrites
+
+2004-07-04 18:12 rstory
+
+ * agent/mibgroup/: if-mib/data_access/interface_ioctl.c,
+ tunnel/tunnel.c:
+
+ - document that SIOCGIFHWADDR ioctl might not return full 6 bytes
+ - add memset to 0 before SIOCGIFHWADDR ioctl, if needed
+ - use standard IFHWADDRLEN macro instead of local one
+
+2004-07-04 18:08 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ - don't assume oper status is up
+ - remove gratuitous log message
+
+2004-07-04 18:07 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.h:
+
+ remove prototypes causing compile err (find fix later)
+
+2004-07-04 18:06 rstory
+
+ * agent/mibgroup/ip-forward-mib/:
+ inetCidrRouteTable/inetCidrRouteTable_interface.c,
+ ipCidrRouteTable/ipCidrRouteTable_interface.c:
+
+ update for generated code
+
+2004-07-04 18:04 rstory
+
+ * agent/mibgroup/: mibII.h, if-mib/ifTable.h,
+ if-mib/ifXTable.h, if-mib/ifXTable/ifXTable.h,
+ ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h,
+ ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h:
+
+ - re-enable old implementations for --enable-mfd-rewrites
+ (except for ifTable; turns out the rest are all new tables)
+ - ifdef out ifTable registration for enable-mfd-rewrites, leaving the rest
+ of the code intact for other tables/object that need it.
+
+2004-07-04 10:15 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ - set if type to tunnel if not set & if name starts with 'sit'
+
+2004-07-04 10:13 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_ioctl.c:
+
+ - set physaddr len to 0 if physaddr not known
+ - set oper status from if flags
+
+2004-07-04 10:11 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ - leave if_descr NULL until we can determine it.
+
+2004-07-04 10:07 rstory
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ Linux: only log missing /proc/meminfo errors once, at startup
+
+2004-07-04 10:03 rstory
+
+ * dist/nsb-functions:
+
+ init var before using it
+
+2004-07-04 10:02 rstory
+
+ * agent/agent_registry.c:
+
+ add netsnmp assert on duplicate registration
+
+2004-07-03 17:37 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ - update generated code
+ - fix cache lookup oid param
+
+2004-07-03 17:25 rstory
+
+ * include/net-snmp/agent/cache_handler.h:
+
+ update comments; document that magic is for user handler
+
+2004-07-03 17:08 rstory
+
+ * agent/mibgroup/if-mib/: ifTable/ifTable.c,
+ ifTable/ifTable.h, ifXTable/ifXTable.c,
+ ifXTable/ifXTable.h:
+
+ - update generated code
+
+2004-07-03 17:04 rstory
+
+ * agent/mibgroup/: if-mib/ifTable/ifTable_interface.c,
+ if-mib/ifXTable/ifXTable_data_access.h,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable.c,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
+,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+, ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
+, ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+, ip-mib/ipAddressTable/ipAddressTable.c,
+ ip-mib/ipAddressTable/ipAddressTable.h,
+ ip-mib/ipAddressTable/ipAddressTable_constants.h,
+ ip-mib/ipAddressTable/ipAddressTable_data_access.c,
+ ip-mib/ipAddressTable/ipAddressTable_data_access.h,
+ ip-mib/ipAddressTable/ipAddressTable_interface.c,
+ ip-mib/ipAddressTable/ipAddressTable_interface.h:
+
+ - update generated code
+ - some warnings for stuff to be done before 5.2
+
+2004-07-03 15:53 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ fix conditional test for skipping mapping
+
+2004-07-03 15:51 rstory
+
+ * local/mib2c-conf.d/generic-value-map-func.m2i:
+
+ only declare var if it will be used
+
+2004-07-03 13:46 rstory
+
+ * include/net-snmp/agent/agent_handler.h:
+
+ add note in struct to update _clone_handler when not items added
+
+2004-07-03 13:44 rstory
+
+ * local/mib2c-update:
+
+ - don't use ':' in file name
+ - add --show-c-function to diff params
+
+2004-07-03 13:37 rstory
+
+ * dist/nsb-nightly:
+
+ fix upload for nsb-package abort case
+
+2004-07-03 13:36 rstory
+
+ * dist/nsb-functions:
+
+ more verbose info on upload
+
+2004-07-03 10:51 rstory
+
+ * snmplib/snmpusm.c:
+
+ return error from usm_check_secLevel if userStatus is not active
+
+2004-07-03 10:48 rstory
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ -new netsnmp_hex_to_binary (allows specifying delimiters for hex string)
+ -add doxygen docs; move some comments to function docs
+
+2004-07-03 10:17 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-get.m2i:
+
+ upcase constants
+
+2004-07-03 10:16 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ don't include deleted header
+
+2004-07-03 10:15 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
+:
+
+ - consistency between non-index and index var references
+
+2004-07-03 10:14 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ - allow table to specify no mapping for nodes
+ - new option to generate table defaults & exit
+
+2004-07-03 10:13 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-set.m2i:
+
+ - move assignment later to get correct value
+
+2004-07-03 10:10 rstory
+
+ * local/mib2c-conf.d/: generic-get-char.m2i,
+ generic-get-oid.m2i, m2c_setup_node.m2i,
+ mfd-data-get.m2c, mfd-interactive-setup.m2c,
+ mfd-readme.m2c:
+
+ - allow table to specify no mapping for nodes
+
+2004-07-02 10:07 slif
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ fix bug#819154 by allowing getnext failure to continue traversing the extensible lists.
+
+2004-07-02 07:18 slif
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ make a safe copy of the command string to the name string.
+
+2004-07-02 06:50 slif
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ apply patch #910094 Solaris can only see some disks -- increase LUN range 0-7
+
+2004-07-02 06:38 slif
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ fix bug #984061 - check limits, build device type spans properly
+
+2004-07-02 06:12 slif
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ warn, then prevent adding more devices than the disks array will hold.
+
+2004-07-02 05:24 slif
+
+ * agent/mibgroup/host/hr_print.c:
+
+ apply patch # 983851 Check return value for cgetnext() and fix #ifdef
+
+2004-07-02 04:47 nba
+
+ * mibs/: Makefile.mib, README.mibs, smistrip:
+
+ Notes and tweaks that should make it easier to a full rfc mib complement
+ under Solaris
+
+2004-07-02 04:37 nba
+
+ * mibs/: rfclist, rfcmibs.diff:
+
+ New version og Printer-MIB
+
+2004-07-02 03:19 nba
+
+ * mibs/Makefile.mib:
+
+ Update tp correct RFC for Etherlike-MIB
+
+2004-06-30 20:04 slif
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ avoid sort when only one pass or pass_persist directive is instantiated.
+ prevent overflowing bin2asc's buffer, and remove a set but not used "itmp" variable.
+
+2004-06-30 19:38 slif
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ fix bug 981275 by OID sorting the "exec" and "sh" directives.
+
+2004-06-30 07:34 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ fix cut-n-pastes to use correct function/var names
+
+2004-06-30 06:35 slif
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ fix bug# 502215 "oid not increasing" bugs for IPv6 UDP/TCP on FreeBSD
+
+2004-06-30 06:09 rstory
+
+ * agent/mibgroup/if-mib/: ifTable/ifTable.c,
+ ifTable/ifTable.h, ifTable/ifTable_constants.h,
+ ifTable/ifTable_data_access.c, ifTable/ifTable_interface.c
+, ifTable/ifTable_interface.h, ifXTable/ifXTable.c
+, ifXTable/ifXTable.h, ifXTable/ifXTable_interface.c
+, ifXTable/ifXTable_interface.h:
+
+ update generated code
+
+2004-06-29 16:05 slif
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ fix name (udbtable --> tcbtable) in TCP6 version of var_tcp6.
+
+2004-06-29 05:14 slif
+
+ * agent/mibgroup/ucd-snmp/vmstat_freebsd2.c:
+
+ apply patch 979436 to make sys/dkstat.h obsolete when building recent FreeBSD5
+
+2004-06-29 04:57 slif
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ apply patch 979434 to Support FreeBSD 5.0 and 5.1 in diskio.c
+
+2004-06-29 04:00 slif
+
+ * agent/mibgroup/ucd-snmp/memory_freebsd2.c:
+
+ Use u_long for phys_mem in memory_freebsd2.c (patch #979034)
+
+2004-06-29 03:48 slif
+
+ * perl/OID/test.pl, win32/libnetsnmptrapd/Makefile.in,
+ win32/libsnmp_dll/libsnmp.def:
+
+ per Alex Burger, apply patch #980118 to fix MSVC Perl module build and
+ prevent test from stopping in Windows due to an un-initialized variable.
+
+2004-06-29 03:36 slif
+
+ * win32/: mib_module_includes.h, mib_module_inits.h,
+ net-snmp/agent/mib_module_config.h, netsnmpmibs/Makefile.in
+, netsnmpmibs/netsnmpmibs.dsp,
+ netsnmpmibssdk/Makefile.in,
+ netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ MSVC builds vacm_conf object in order to fix bug #981377. Good Call, Dave.
+
+2004-06-29 00:03 slif
+
+ * testing/tests/: T053agentv1trap, T054agentv2ctrap,
+ T055agentv1mintrap, T056agentv2cmintrap:
+
+ use AUTHTESTARGS to fix bug#973673
+
+2004-06-28 17:04 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ update for new acconfig.h
+
+2004-06-28 16:59 rstory
+
+ * acconfig.h:
+
+ - add NETSNMP_ENABLE_MFD_REWRITES
+ - add '(incomplete)' to comment for NS_REENTRANT
+
+2004-06-28 16:56 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-06-28 16:55 rstory
+
+ * configure.in, agent/mibgroup/mibII.h,
+ agent/mibgroup/mibII/ipAddr.h,
+ agent/mibgroup/mibII/route_write.h,
+ agent/mibgroup/mibII/tcpTable.h,
+ agent/mibgroup/mibII/udpTable.h,
+ agent/mibgroup/mibII/var_route.h:
+
+ - new configure flage: --enable-mfd-rewrites will turn on rewritten modules.
+ - currently has the side effect of disabling deprecated tables
+
+2004-06-28 15:18 rstory
+
+ * man/mib2c.conf.5:
+
+ - update for auto-gen from mib2c
+
+2004-06-28 15:11 rstory
+
+ *
+ agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
+:
+
+ - update oid changed in ietf draft
+
+2004-06-28 15:08 rstory
+
+ * agent/mibgroup/ip-forward-mib/:
+ inetCidrRouteTable/inetCidrRouteTable.h,
+ ipCidrRouteTable/ipCidrRouteTable.h:
+
+ config exclude mibII/ip, not mibII/var_route
+
+2004-06-28 15:07 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ remove unused (due to data sharing w/ifTable) functions
+
+2004-06-28 15:06 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.h:
+
+ use local, not sytem, style include for mibgroup header
+
+2004-06-28 15:05 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ move var decl before first statement
+
+2004-06-28 11:54 slif
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ fix setting of OSTYPE for FreeBSD build platforms (consider acconfig.h).
+
+2004-06-28 11:44 slif
+
+ * agent/agent_trap.c:
+
+ use int for atoi, cast to unsigned short;
+ this fixes bug 981438 trapsink port range checks are wrong
+
+2004-06-28 05:34 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2004-06-28 05:32 rstory
+
+ * configure.in:
+
+ - new --enable-mib-config-checking to fail on module conflicts
+
+2004-06-28 05:22 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ - add name to container structure
+ - new macro to find named container in list
+
+2004-06-28 05:21 rstory
+
+ * local/mib2c-conf.d/mfd-data-access.m2c:
+
+ remove condition for header function prototype generation
+
+2004-06-28 05:20 rstory
+
+ * snmplib/data_list.c:
+
+ - remove deprecated label from func, add note on preferred func instead
+ - add some netsnmp_asserts & debug output
+ - reduce duplicated code
+ - netsnmp_data_list_add_data now calls netsnmp_data_list_add_node
+ - log warning if duplicate key added to a data list
+ - netsnmp_add_list_data now calls preferred netsnmp_data_list_add_node
+
+2004-06-28 05:14 rstory
+
+ * local/mib2c-update:
+
+ add missing default
+
+2004-06-28 05:13 rstory
+
+ * agent/mibgroup/: if-mib/ifTable/.mib2c-updaterc,
+ if-mib/ifXTable/.mib2c-updaterc,
+ ip-forward-mib/inetCidrRouteTable/.mib2c-updaterc,
+ ip-forward-mib/ipCidrRouteTable/.mib2c-updaterc,
+ ip-mib/inetNetToMediaTable/.mib2c-updaterc,
+ ip-mib/ipAddressTable/.mib2c-updaterc:
+
+ rc file used for code generation
+
+2004-06-28 05:06 rstory
+
+ * agent/mibgroup/: if-mib/ifTable/.cvsignore,
+ if-mib/ifXTable/.cvsignore,
+ ip-forward-mib/inetCidrRouteTable/.cvsignore,
+ ip-forward-mib/ipCidrRouteTable/.cvsignore,
+ ip-mib/inetNetToMediaTable/.cvsignore,
+ ip-mib/ipAddressTable/.cvsignore:
+
+ ignore mib2c-update dirs
+
+2004-06-28 05:02 dts12
+
+ * agent/mibgroup/ucd-snmp/: proxy.c, proxy.h:
+
+ Automatically unregister proxy settings on agent shutdown or restart.
+ (Bug #748733)
+
+2004-06-28 04:59 dts12
+
+ * agent/mibgroup/ucd-snmp/: proxy.c, proxy.h:
+
+ Unregister proxy registrations when freeing the config settings.
+
+2004-06-28 04:52 dts12
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ Skip empty contexts when dumping the internal MIB registry.
+ (Probably as a result of removing registrations).
+
+2004-06-28 04:39 dts12
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Drop special-case handling of "lo/lo0" since this gives bogus results
+ (Bug #422394)
+
+2004-06-28 04:21 dts12
+
+ * agent/helpers/bulk_to_next.c:
+
+ Don't try to set the OID of a variable that isn't there.
+ (Probably triggered by running GetBulk on a "non-simple"
+ view - see Bug #706089)
+
+2004-06-27 18:34 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ - rename netsnmp_cache_extract_from_reqinfo to netsnmp_cache_reqinfo_extract
+
+2004-06-27 18:33 rstory
+
+ * agent/mibgroup/mibII/: icmp.c, ip.c, tcp.c,
+ udp.c:
+
+ - use netsnmp_cache_is_valid instead of netsnmp_is_cache_valid
+
+2004-06-27 18:25 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ - add name parameter to netsnmp_cache_is_valid
+ - new netsnmp_cache_reqinfo_insert, netsnmp_cache_reqinfo_extract
+ - use CACHE_NAME:handlerName as data_list key for cache
+ - this fixes Bug #973728 the right way. see bug report for details
+
+2004-06-27 17:11 rstory
+
+ * agent/agent_handler.c,
+ include/net-snmp/agent/agent_handler.h:
+
+ - add netsnmp_request_remove_list_data
+
+2004-06-27 17:10 rstory
+
+ * agent/snmp_agent.c, include/net-snmp/agent/snmp_agent.h
+:
+
+ - add netsnmp_agent_remove_list_data
+
+2004-06-26 15:11 rstory
+
+ * snmplib/parse.c:
+
+ - add debug msg when module path changes
+ - tweak debug msg output indent
+
+2004-06-26 15:09 rstory
+
+ * snmplib/mib.c:
+
+ - make netsnmp_set_mib_directory and handle_mibs_conf consistent:
+ - '-/dir' adds /dir before existing dirs
+ - '+/dir' adds /dir after existing dirs
+ NOTE: this restores original behavior of '+' to that of 5.0.1. After
+ 5.0.2, if I read the code right, '+' behaviour on the cmd line and
+ in MIBDIRS was reversed and not consistent with handle_mibs_conf.
+
+2004-06-26 06:51 rstory
+
+ * snmplib/mib.c:
+
+ - make multiple mibdirs in conf files work with 'least surprise' (ie completely
+ replace mibdirs, unless + specified
+ - new mibdir behaviour: if - specified, add specified dirs before existing
+ ones instead of after
+
+2004-06-26 05:11 dts12
+
+ * agent/mibgroup/mibII/vacm_conf.c:
+
+ Support "multi-token" masks - i.e. using space (rather than
+ '.' or ':') to separate the mask octets. (See bug #706089)
+
+2004-06-26 05:05 dts12
+
+ * agent/helpers/cache_handler.c:
+
+ Work with the same cache structure consistently,
+ rather than re-extracting it from the reqinfo structure.
+ (Should fix Bug #973728)
+
+2004-06-25 04:47 dts12
+
+ * agent/mibgroup/mibII/icmp.c:
+
+ Fix the check for a valid ICMP cache
+ (Spotted by Oleg Ivanov)
+
+2004-06-25 02:10 dts12
+
+ * agent/mibgroup/mibII/ip.c:
+
+ A missing 'ipOutNoRoutes' value should throw an exception (not an error)
+ and allow any other IP-related varbinds in the same request to be processed.
+
+2004-06-24 13:04 nba
+
+ * snmplib/mib.c:
+
+ Make -Ir effective for a NetworkAddress
+
+2004-06-24 09:01 rstory
+
+ * agent/agent_handler.c:
+
+ - make clone_handler static, rename to _clone_handler
+ - delete handler & return null on create if name strdup fails
+ - possible fix fo 973728 ] main branch fails to load tcpConnect and udp Table
+ - copy flags in _clone_handler
+ - update netsnmp_handler_dup to use _clone_handler, netsnmp_handler_free
+
+2004-06-24 04:56 rstory
+
+ * agent/snmp_agent.c:
+
+ fix debug statement parameter
+
+2004-06-23 11:57 nba
+
+ * snmplib/asn1.c:
+
+ Doxygen internal documentation contributed by Cyril MARGARIA
+
+2004-06-23 10:45 nba
+
+ * snmplib/mib.c:
+
+ Fix bug 978087: bad index check for NetworkAddress
+
+2004-06-22 15:57 nba
+
+ * apps/snmptrapd.c:
+
+ Fix cpu-burning by running alarms. Diagnosed by rgreab@users.sourceforge.net
+
+2004-06-22 15:32 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
+:
+
+ check for null pointer after allocation
+
+2004-06-22 15:32 rstory
+
+ * local/mib2c-conf.d/: mfd-interface.m2c, mfd-top.m2c
+:
+
+ - move data_init call into interface code
+ - call data_init before container_init
+
+2004-06-22 15:13 nba
+
+ * acconfig.h, configure, configure.in,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Autodetect -ldevstat for FreeBSD 5 (as was done for 4)
+
+2004-06-22 06:38 dts12
+
+ * agent/helpers/old_api.c, snmplib/snmp_debug.c:
+
+ Fix handling of table row registration in old-API (Bug #702458)
+
+2004-06-22 02:03 dts12
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ Perl API for setting MIB parsing options (Bug #554749)
+
+2004-06-21 11:40 rstory
+
+ * agent/Makefile.in:
+
+ install mib_modules.h
+
+2004-06-21 10:51 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - add function to set valid_columns
+
+2004-06-21 06:31 dts12
+
+ * snmplib/snmp_enum.c:
+
+ Fix duplicate allocation of memory when defining enumeration lists
+ (Bug #923766)
+
+2004-06-21 03:12 dts12
+
+ * local/mib2c.access_functions.conf:
+
+ Correct description of return values to use (Bug #947926)
+
+2004-06-21 03:01 dts12
+
+ * snmplib/snmp_api.c:
+
+ Set the size for parsing an integer correctly (Bug #947403)
+
+2004-06-19 16:56 hardaker
+
+ * include/net-snmp/library/transform_oids.h:
+
+ Fix comment typo.
+
+2004-06-19 06:34 slif
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ modify patch 956272 to make it Solaris2 specific
+
+2004-06-18 13:38 rstory
+
+ * local/Makefile.in:
+
+ - install new mib2c-update bash script
+ - install top level mfd conf file
+ - make install target depend on 'made' perl scripts
+
+2004-06-18 12:48 hardaker
+
+ * snmplib/mib.c:
+
+ change u_int32_t to int32 to make it more portable
+
+2004-06-18 11:46 hardaker
+
+ * snmplib/read_config.c:
+
+ Removed a skip_token that was causing a follow-on token to be skipped.
+
+2004-06-18 11:45 hardaker
+
+ * mibs/rfclist:
+
+ updated rfc list for usm-aes
+
+2004-06-18 11:42 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/host/hr_storage.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ - Fixed usage of f_frsize under architectures that had it for statvfs
+ but not statfs.
+
+2004-06-18 10:35 hardaker
+
+ * include/net-snmp/library/transform_oids.h, mibs/Makefile.in
+, mibs/SNMP-USM-AES-MIB.txt, snmplib/snmpusm.c:
+
+ - Updated the AES OID to match the recently published USM/AES draft
+ - Added the USM-AES MIB to the list of mibs.
+
+2004-06-18 09:41 rstory
+
+ * local/mib2c:
+
+ - add new mib2c-data dir to search path
+
+2004-06-18 09:41 rstory
+
+ * local/Makefile.in:
+
+ - add install/uninstall for mfd mib2c files
+
+2004-06-18 07:30 dts12
+
+ * snmplib/mib.c:
+
+ Support for interpreting InetAddressType/InetAddress indexes within an OID.
+ (Patch #841625 from Yixiong Zou)
+
+2004-06-18 07:03 dts12
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Recognise Infiniband interfaces
+ (Patch #970617 from Kanoj Sarcar)
+
+2004-06-18 06:54 dts12
+
+ * configure.in, configure:
+
+ Fix handling of --enable-local-smux option
+ (Patch #949808 from Erik ॆअइnggॆआ‹rd)
+
+2004-06-18 06:46 dts12
+
+ * apps/snmpusm.c:
+
+ Add support for activating and deactivating users,
+ necessary for full compliance with RFC 3414. (Patch #943762)
+
+2004-06-18 06:38 dts12
+
+ * testing/tests/: T150solarishostcpu, T151solarishostdisk
+, T152hostuptime, T153solarisswap:
+
+ Use transport variables for testing rather than hardwiring udp:localhost
+ (Patch #940302 from Mike Slifcak)
+
+2004-06-18 06:31 dts12
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Use /dev/arp rather than /dev/ip, since this works properly with multiple zones.
+ (Patch #940025 from Bob Rowlands)
+ [No idea what this means, but it sounds impressive....]
+
+2004-06-18 06:25 dts12
+
+ * snmplib/pkcs.c:
+
+ Initialise pSlotList to guard against freeing garbage.
+ (Patch #938139 from Bob Rowlands)
+
+ If garbage isn't kept strictly controlled,
+ who knows what state society might get into....
+ (Homespun philosophical musings from Dave Shield)
+
+2004-06-18 06:17 dts12
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c:
+
+ Don't set the index value until we've checked this is a valid request.
+ (Patch #930712 from Jochen/Christopher Price)
+
+2004-06-18 06:09 dts12
+
+ * snmplib/vacm.c:
+
+ Don't include the viewTree length when saving a persistent vacmView
+ (Patch #921279 from Bob Rowlands)
+
+2004-06-18 05:58 dts12
+
+ * agent/mibgroup/: util_funcs.c, util_funcs.h:
+
+ Pass *pointers* to reload/compare functions into Initialise_Table
+ (Patch #922519 from Robert Wilcox)
+
+2004-06-17 20:57 slif
+
+ * testing/tests/T150solarishostcpu:
+
+ per Bruce Shaw, include the OID for CPU device in the match string.
+
+2004-06-17 19:42 slif
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ apply patch 956272 - use correct structure member for Solaris hrPartitionSize
+
+2004-06-17 19:09 rstory
+
+ * local/mib2c:
+
+ - document node.description
+
+2004-06-17 19:09 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c:
+
+ - fix return code for malloc failure
+
+2004-06-17 19:02 rstory
+
+ * agent/helpers/table_container.c:
+
+ - convert debug code that should have never been checked in to netsnmp_assert
+
+2004-06-17 18:58 rstory
+
+ * agent/helpers/table.c:
+
+ - add lots of debug for tracking index processing
+ - make code and comments consistent with each other
+ - fix a 0-based vs 1-based problems when using valid_column verification
+ - fix comparison to wrong variable
+ - due to other fixes, init tbl_req_info->colnum earlier
+
+2004-06-17 18:50 rstory
+
+ * agent/helpers/baby_steps.c:
+
+ - update flow chart
+ - swap row create / check values; not quite sure if I should, though
+
+2004-06-17 18:46 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/: ifXTable.c, ifXTable.h
+, ifXTable_interface.c:
+
+ - update generated code
+ - ifdef out commit code (coming soon)
+
+2004-06-17 18:39 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.h:
+
+ - update generated code
+
+2004-06-17 18:39 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ - update generated code
+ - make sure to set dont invalidateon set cache flag
+
+2004-06-17 18:38 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ - update generated code
+ - implement set of admin status
+
+2004-06-17 18:36 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_interface.c:
+
+ - update generated code
+ - special case processing for ifadmin status (bypass sizeof check)
+
+2004-06-17 18:26 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_linux.c:
+
+ -use new functions netsnmp_access_interface_ioctl_flags_set,
+ netsnmp_access_interface_ioctl_mtu_get
+ -new function netsnmp_arch_set_admin_status
+
+2004-06-17 18:25 rstory
+
+ * agent/mibgroup/if-mib/data_access/: interface_ioctl.c,
+ interface_ioctl.h:
+
+ -new functions netsnmp_access_interface_ioctl_flags_set,
+ netsnmp_access_interface_ioctl_mtu_get
+ -move whole functions inside ifdef conditional, to force link errors instead
+ of a false sense of security that an ioctl is available
+
+2004-06-17 18:22 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface.h:
+
+ define private 'arch' function prototypes to quell compiler warnings
+
+2004-06-17 18:20 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c,
+ include/net-snmp/data_access/interface.h:
+
+ -rename stats struct members to not match macro names
+ -add pointer & macros for old stats to interface entry
+ -move conf override struct/routines here
+ -add init routine for configure to detect & call
+ -add netsnmp_access_interface_set_admin_status
+ -add netsnmp_access_interface_entry_update_stats to deal with 32bit counter
+ wraps, unless 64bit counters are detected
+
+2004-06-17 18:12 rstory
+
+ * include/net-snmp/library/int64.h, snmplib/int64.c:
+
+ new functions u64Incr, u64UpdateCounter, u64Copy, netsnmp_c64_check_for_32bit_wrap
+
+2004-06-17 17:36 slif
+
+ * snmplib/snmp_api.c:
+
+ test session ptr before using. fixes bug #975063 snmp_sess_close NULL deref
+
+2004-06-17 09:51 hardaker
+
+ * perl/agent/agent.pm:
+
+ Updated the documentation to make it much more extensive and complete.
+
+2004-06-17 06:39 hardaker
+
+ * net-snmp-config.in:
+
+ Patch 968839: net-snmp-config fails to print -lwrap
+
+2004-06-17 06:38 hardaker
+
+ * perl/agent/agent.pm:
+
+ Patch #973702: POD documentation patch from Toni Willberg
+
+2004-06-16 07:42 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ gettable changes:
+ - Don't retrieve indexes since we calculate them.
+ - Bug fix for self-specified column lists.
+
+2004-06-16 07:22 hardaker
+
+ * snmplib/read_config.c:
+
+ Use copy_nword for all read_config auto-parsing of tokens to help
+ strip quotes if they were used even for integers.
+
+2004-06-15 19:55 rstory
+
+ * snmplib/mt_support.c:
+
+ fix library resource locks, as noted on coders by Ying Hu
+
+2004-06-15 17:27 slif
+
+ * testing/tests/: T023snmpv3getMD5AES, T023snmpv3getMD5DES
+:
+
+ correct var PRIVTESTARGS (was PRIVTESTFLAGS)
+
+2004-06-15 15:40 slif
+
+ * win32/dist/README.build.win32.txt:
+
+ apply patch #973572 per Alex Burger to clarify naming of the package, etc.
+
+2004-06-15 07:27 dts12
+
+ * local/mib2c:
+
+ Consistency tweaks to the usage output message.
+
+2004-06-15 06:43 slif
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ apply updated patch attached to bug#758437
+ use SNMP_FREE to manage buffer pointer
+ open socket before increasing buffer size
+
+2004-06-15 05:55 dts12
+
+ * agent/mibgroup/examples/notification.c,
+ mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ Define the example notification as a notification (using an RFC2576-safe
+ OID), rather than a MIB object, and define example compulsory and optional
+ payload objects. Tweak the example code to use these new definitions.
+
+2004-06-15 04:29 slif
+
+ * agent/mibgroup/host/: hr_filesys.c, hr_storage.c:
+
+ apply patch from trontor to fix bug 942498 NetBSD 2.0D and above use statvfs
+
+2004-06-14 12:02 slif
+
+ * win32/: Makefile.in, dist/README.build.win32.txt,
+ dist/installer/net-snmp.nsi:
+
+ apply patch #972715 Win32 build: makefile, readme and .nsi script changes
+ these back out two previous changes and fixes a problem creating snmpconf.bat
+
+2004-06-14 10:34 hardaker
+
+ * perl/agent/: agent.pm, agent.xs, test.pl:
+
+ Implemented $request->setError() to set error codes for requests.
+
+2004-06-14 10:03 slif
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ patch from Mathias Scheler fixes bug #805956 by altering conditional
+ checks for NetBSD and Darwin defines.
+
+2004-06-12 08:04 slif
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ dyslexic s-M-n-p to s-n-M-p
+
+2004-06-12 08:01 slif
+
+ * README.win32, win32/dist/README.txt,
+ win32/dist/installer/net-snmp.nsi:
+
+ patch 971263 Windows installer script change component label+descr
+
+2004-06-12 07:55 slif
+
+ * win32/: build.bat, install-net-snmp.bat,
+ nmakeperl.bat, dist/installer/net-snmp.nsi,
+ local/mib2c.bat, local/snmpconf.bat,
+ local/traptoemail.bat:
+
+ convert .bat files to use DOS CR-LF line termination.
+ apply patch 971471 NSI installer script fixes addressing line-end problems.
+
+2004-06-11 17:38 slif
+
+ * win32/libnetsnmptrapd/Makefile.in:
+
+ remove "erase watcher.obj", for a file that is managed in libhelpers project.
+
+2004-06-11 15:45 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i:
+
+ default cache to not invalidate on set
+
+2004-06-11 15:39 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - default to allocated undo context, even if data context is embedded
+ - fix misassigned callback function
+ - add missing braces for multiline conditional
+
+2004-06-11 15:37 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ - default to allocated undo context, even if data context is embedded
+ - add code to handle per column behavior on commit
+ - add note on undo context when data init is set
+
+2004-06-11 15:35 rstory
+
+ * local/mib2c-conf.d/: m2c_setup_table.m2i, mfd-data-get.m2c
+, mfd-interactive-setup.m2c, mfd-top.m2c:
+
+ - default to allocated undo context, even if data context is embedded
+
+2004-06-11 15:32 rstory
+
+ * local/mib2c-conf.d/generic-data-allocate.m2i:
+
+ - tweak to work even for generated data contexts
+ - fix var typo, comment typo
+
+2004-06-11 15:30 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ - remove overly confusing method for changing defaults, because it was
+ conflicting w/command line version. maybe revisit later
+ - default (false) for new undo_embed
+
+2004-06-11 13:14 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ Return already gathered results even if getbulk fails to return the
+ expected data (typically due to end-of-mib conditions).
+
+2004-06-11 13:13 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Mention that the configure script version number needs changing.
+
+2004-06-11 10:18 slif
+
+ * win32/Makefile.in:
+
+ patch 971113 "nmake clean" visits libsnmp and libsnmp_dll every time.
+
+2004-06-10 21:05 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c,
+ include/net-snmp/data_access/interface.h:
+
+ - new netsnmp_access_interface_entry_guess_speed
+ - new netsnmp_access_interface_entry_overrides
+ - restore if_admin_status
+ - add platform specific if_flags, & define for flags to indicate availability
+ - specify all 4 hex byes for flag defines
+
+2004-06-10 21:01 rstory
+
+ * agent/mibgroup/if-mib/data_access/: interface.h,
+ interface_linux.c:
+
+ - linux requires new ioctl interface access
+ - use ioctl for hwaddr, if_flags
+ - guess if type based on name if not known
+ - move getIfSpeed code & rename netsnmp_access_interface_linux_get_if_speed
+
+2004-06-10 20:47 rstory
+
+ * agent/mibgroup/if-mib/data_access/: interface_ioctl.c,
+ interface_ioctl.h:
+
+ - new ioctl interface access
+
+2004-06-10 20:44 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.c, ifTable.h:
+
+ - move admin status back to interface entry
+ - use description from interface entry
+
+2004-06-10 10:59 slif
+
+ * win32/dist/README.build.win32.txt:
+
+ per Andy Smith, apply patch #970480 Win32 README.build.win32.txt update
+
+2004-06-09 20:28 slif
+
+ * agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ include/net-snmp/system/freebsd4.h,
+ include/net-snmp/system/freebsd5.h:
+
+ apply changes identified in patch #969338 patches for FreeBSD 5.x successful build
+
+2004-06-09 18:55 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/: ifXTable.c, ifXTable.h
+, ifXTable_constants.h, ifXTable_data_access.c,
+ ifXTable_data_access.h, ifXTable_interface.c,
+ ifXTable_interface.h:
+
+ - Update for MFD generated code changes + switch to a mixed-mode data context +
+ IF-MIB changes
+ - remove ability to build independent of ifTable
+
+2004-06-09 18:48 rstory
+
+ * agent/mibgroup/if-mib/ifTable/: ifTable.c, ifTable.h,
+ ifTable_constants.h, ifTable_data_access.c,
+ ifTable_data_access.h, ifTable_interface.c,
+ ifTable_interface.h:
+
+ - Update for MFD generated code changes + switch to a mixed-mode data context +
+ IF-MIB changes
+ - use new param to save interface entry w/generated context
+ - for data from netsnmp_interface_entry, use #defines so generated code doesn't
+ change (eg define ifName ifentry.if_name). works for most cases
+ - add generated storage/defines for ifXTable columns to data context
+ - change cache timeout to 30 seconds
+ - use new cache features to auto load and auto refresh cache
+ - use new UNKNOWN ifOperStatus for interfaces that vanish
+ - use new interface copy function when updating cache
+ - only update LastChanged on ifOperStatus changes
+
+2004-06-09 18:37 slif
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ per Andy Smith, apply patch#968800 SNMPCONFPATH fix for Win32 binary installer
+ and patch #970012 Remove snmpconf.pl from Windows installer
+
+2004-06-09 18:30 rstory
+
+ * agent/mibgroup/if-mib/: ifTable/default-table-ifTable.m2d,
+ ifXTable/default-table-ifXTable.m2d:
+
+ - switch to a mixed-mode data context
+ - chg data context to default generated
+ - don't allocate data context
+ - do request a init call for new contexts
+
+2004-06-09 18:26 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c,
+ include/net-snmp/data_access/interface.h:
+
+ - remove mib specific stuff (if_alias, if_admin_status, if_link_updown_trap)
+ (still not sure about last changed and discontinuity)
+ - new function to copy interface entry data
+ - make callback functions static
+
+2004-06-09 17:53 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - if data_init set, add user void pointer to allocate_rowreq_ctx, and pass it
+ to rowreq_ctx_init
+ - fix two typos in code only generated when data_init is set
+ - release undo data in free_rowreq_ctx
+ - don't generate undo setup code for non-settable columns
+
+2004-06-09 17:49 rstory
+
+ * local/mib2c-conf.d/: mfd-access-container-cached-defines.m2i
+, mfd-access-unsorted-external-defines.m2i,
+ mfd-top.m2c:
+
+ - if data_init set, add user void pointer to allocate_rowreq_ctx, and pass it
+ to rowreq_ctx_init
+
+2004-06-09 17:46 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ - convert contant prefixes to uppercase
+ - add '_val' suffix to all node parameter names
+
+2004-06-09 17:44 rstory
+
+ * local/mib2c-conf.d/details-node.m2i:
+
+ add description
+
+2004-06-09 02:37 slif
+
+ * agent/mibgroup/util_funcs.c:
+
+ per Mike Heisler, fix bug #936483 (restore ssize_t).
+
+2004-06-08 21:55 slif
+
+ * acconfig.h:
+
+ Update to win32 ifdef to include other environments
+
+2004-06-08 13:56 slif
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ fix build failure (no such member kp_comm, etc.) for FreeBSD 5.x
+
+2004-06-08 13:53 slif
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ fix build failure (no such member xt_tp) for FreeBSD 4.x and FreeBSD 5.x
+
+2004-06-08 13:50 slif
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ fix compile failure (no inp_next in struct inpcb) for FreeBSD 4.x and 5.x
+
+2004-06-08 13:36 slif
+
+ * agent/mibgroup/host/hr_print.c:
+
+ fix bug 895679 by ensuring upper limit tracks buffer allocation/free actions.
+
+2004-06-08 12:03 slif
+
+ * include/net-snmp/system/freebsd5.h:
+
+ remove unnecessary undef of STRUCT_STATFS_HAS_F_FAVAIL (never is defined).
+
+2004-06-08 10:50 rstory
+
+ * local/mib2c-conf.d/: mfd-data-set.m2c, parent-set.m2i
+:
+
+ - comments about flag and defines for tracking which columns have been set
+ - missed a few error define updates
+
+2004-06-08 10:49 rstory
+
+ * local/mib2c-conf.d/: generic-table-oids.m2c,
+ mfd-interface.m2c, mfd-top.m2c,
+ parent-dependencies.m2i:
+
+ add flag and defines for tracking which columns have been set
+
+2004-06-07 19:52 slif
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ fix setting of OSTYPE for FreeBSD build platforms.
+
+2004-06-07 19:47 slif
+
+ * include/net-snmp/system/freebsd5.h:
+
+ create system include file for FreeBSD 5.x build platforms.
+
+2004-06-07 19:44 slif
+
+ * agent/mibgroup/ucd-snmp/memory_freebsd2.c:
+
+ remove unused code in swapmode
+
+2004-06-07 12:31 rstory
+
+ * snmplib/read_config.c:
+
+ recheck persistent path in loop, since it might change
+
+2004-06-07 12:24 rstory
+
+ * include/net-snmp/agent/agent_handler.h:
+
+ specify full 32 bits for handler flags
+
+2004-06-07 12:15 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ - always consider cache w/timeout of -1 as expired (load cache every request)
+ - add NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD & NETSNMP_CACHE_AUTO_RELOAD flags
+ - add example usages scenarios and suggested flags
+ - add netsnmp_cache_timer_start & netsnmp_cache_timer_stop
+ - clear expired flag after cache_load
+ - add another note about potential cache issue w/delegated requests
+ (some locking/reference count mechanism is needed)
+
+2004-06-07 11:50 rstory
+
+ * net-snmp-config.in:
+
+ - accept abbreviated versions of some flags
+ - point indent-optoins at a real directory
+ - don't substitute prefix multiple times
+
+2004-06-07 11:40 rstory
+
+ * snmplib/snmp_alarm.c:
+
+ fix comment ref for integer from NULL to 0
+
+2004-06-07 11:39 rstory
+
+ * dist/cvsup:
+
+ skip scp if bac rc from cvs command
+
+2004-06-07 11:38 rstory
+
+ * local/mib2c.array-user.conf:
+
+ reame $i_IDX2 to $I_CUSTOM_SORT to reduce confusion
+
+2004-06-07 11:36 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ - use new simplified errors
+ - add missing undo_commit, undo_cleanup states
+ - move pre/post request init outside mib2c conditional
+ - move undo data context release to undo_cleanup
+ - validate rc from node check value routine
+
+2004-06-07 11:32 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ - use new simplified errors
+ - more help text for distinction between wrongValue/inconsistentValue
+
+2004-06-07 11:31 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ - use new simplified errors
+ - more help text for validate_index
+ - include baby-steps flow-chart before set functions
+ - add missing undo_commit, undo_cleanup states
+
+2004-06-07 11:26 rstory
+
+ * local/mib2c-conf.d/node-varbind-validate.m2i:
+
+ use SNMPv2 errors instead of v1 errors
+
+2004-06-07 11:25 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ - turn off indent around config_require (doesn't like '/' or '-' chars)
+ - simplify some error define names
+
+2004-06-07 11:21 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ update some question/help text
+
+2004-06-07 11:20 rstory
+
+ * local/mib2c-conf.d/generic-table-constants.m2c:
+
+ restore foreach table
+
+2004-06-07 11:17 rstory
+
+ * local/mib2c.mfd.conf:
+
+ revert changes for setting some mib2c defaults (use mib2c -S xxx instead)
+
+2004-06-07 11:13 rstory
+
+ * local/mib2c-update:
+
+ pass extra args to mib2c
+
+2004-06-07 11:10 rstory
+
+ * local/mib2c:
+
+ - change example comment block so indent will indent it
+ - skip substitution checks if they won't match
+ - apply dave's hack for 939041: ... bad macro name iff enum contains hyphen
+
+2004-06-07 08:30 dts12
+
+ * agent/mibgroup/agent/: extend.c, extend.h:
+
+ Backwards-compatability implementation of the UCD-SNMP-MIB::extTable
+ (if the ucd-snmp/extensible module isn't configured in).
+
+2004-06-07 01:21 dts12
+
+ * agent/mibgroup/: util_funcs.c, util_funcs.h,
+ ucd-snmp/extensible.c, ucd-snmp/extensible.h,
+ ucd-snmp/pass.h, ucd-snmp/pass_persist.h:
+
+ Move 'get_exten_instance' into the utility function file,
+ so that the two pass handlers aren't dependent on 'extensible'
+
+2004-06-06 23:47 nba
+
+ * snmplib/parse.c:
+
+ Fix warnings about missing modules when there are replacements for them
+
+2004-06-06 16:41 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ cvs server name change
+
+2004-06-04 13:44 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ remove redundant reference row from output
+
+2004-06-04 13:39 hardaker
+
+ * mibs/nodemap:
+
+ added a nodemap for html output generation
+
+2004-06-04 13:38 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ make html output display the reference in italics in the description fields.
+
+2004-06-04 13:37 hardaker
+
+ * local/mib2c, man/mib2c.conf.5:
+
+ make $x.reference expand to a objects reference
+
+2004-06-04 13:36 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ make SNMP::MIB objects handle a 'reference' keyword.
+
+2004-06-04 13:34 hardaker
+
+ * include/net-snmp/library/parse.h, snmplib/parse.c:
+
+ - Saved the value of parsed reference clauses.
+
+2004-06-04 05:51 nba
+
+ * apps/snmptrapd_handlers.c:
+
+ A little error-checking when forwarding, and change fprintf to snmp_log
+
+2004-06-04 03:17 nba
+
+ * apps/snmptrapd_handlers.c:
+
+ Properly free printbuffer
+
+2004-06-04 03:09 nba
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Make sure all registration are removed for exec's
+
+2004-06-04 02:45 nba
+
+ * snmplib/snmp_api.c:
+
+ Protect against garbled packets with bad packet types
+
+2004-06-04 01:57 nba
+
+ * man/snmp_api.3.def:
+
+ Simple spelling fix
+
+2004-06-04 01:15 nba
+
+ * Makefile.in:
+
+ Remove dup installation of scripts after addition of --disable-scripts
+
+2004-06-04 00:20 slif
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ undo previous change, since introduction of freebsd5.h header defines freebsd4.
+
+2004-06-03 12:59 slif
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ fix bug #943351 by considering freebsd5 when declaring "hz".
+
+2004-06-02 17:18 rstory
+
+ * local/mib2c-conf.d/: default-mfd-top.m2c, mfd-data-get.m2c
+, mfd-readme.m2c:
+
+ fix a few missed processing_type tweaks
+
+2004-06-02 05:37 slif
+
+ * README.win32, perl/SNMP/README, win32/Configure
+, win32/build.pl, win32/install-net-snmp.bat,
+ win32/nmakeperl.bat, win32/dist/README.build.win32.txt
+, win32/dist/README.txt,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ for win32 doc and scripts, match the base directory used as current default.
+
+2004-06-01 02:32 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Handle row deletion (and failed row creation) properly.
+ Move row creation and new value assignments to their natural
+ passes, with a second (separate) check for row validity.
+ (following Robert's suggestion)
+
+2004-06-01 02:29 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Fix compilation problems following the addition of 'relocatability'.
+ Ensure that the "standard" location is registered automatically
+ (so the numRows object is present, even with an otherwise empty table).
+
+2004-05-27 20:06 slif
+
+ * README.win32:
+
+ update status to reflect snmptrapd can be run as a Windows service.
+
+2004-05-27 05:37 dts12
+
+ * COPYING:
+
+ Correct the number of copyright notices
+ listed, and the text of the Sparta one.
+ (I trust this is OK, Wes!)
+
+2004-05-26 01:39 dts12
+
+ * README.agentx:
+
+ Remove warnings of AgentX "beta-status".
+ (I know I'm going to regret doing this....)
+
+2004-05-25 08:54 dts12
+
+ * snmplib/snmp_parse_args.c:
+
+ Accept the same security level tokens as used in the
+ "r[wo]user" and "access" directives.
+
+2004-05-24 03:39 dts12
+
+ * agent/mibgroup/agent/: extend.c, extend.h:
+
+ Implement relocatable form of agent extension table.
+
+2004-05-24 03:35 dts12
+
+ * agent/mibgroup/agent/extend.c:
+
+ Implement 'run-on-write' support, and use it to handle a
+ new 'execFix'-style directive.
+
+2004-05-23 10:41 slif
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ per Andy Smith: apply patch [957942] Win32 service install pause
+
+2004-05-21 10:10 rstory
+
+ * agent/snmp_agent.c:
+
+ check for/process delegated requests in agent_check_and_process
+
+2004-05-20 21:09 slif
+
+ * man/Makefile.in:
+
+ ignore failure result should cvs checkout condition not apply.
+ This permits builds outside CVS tree to succeed.
+
+2004-05-20 16:01 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ Minor wording: added table name to "index" and "other columns" line.
+
+2004-05-20 15:47 hardaker
+
+ * local/Version-Munge.pl:
+
+ remove changes accidentially applied that weren't ready
+
+2004-05-20 15:05 hardaker
+
+ * local/: Version-Munge.pl, mib2c.genhtml.conf:
+
+ - added support for notification descriptions
+
+2004-05-19 18:09 slif
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ add get_tc_description and init_usm_conf to the exported symbols list.
+
+2004-05-19 18:02 slif
+
+ * snmplib/system.c:
+
+ Permit Cygwin build to take advantage of backslash pruning and single letter volume specifier.
+
+2004-05-19 17:54 slif
+
+ * README.win32, win32/dist/README.txt,
+ win32/dist/htmlhelp/Configuration_Overview.html:
+
+ per Alex Burger: snmpconf dash little-eye
+
+2004-05-19 16:26 rstory
+
+ * snmplib/read_config.c:
+
+ fix parsing of explicit handler types
+
+2004-05-19 13:14 hardaker
+
+ * man/mib2c.conf.5:
+
+ update after a mib2c update
+
+2004-05-19 13:13 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ - support a table of contents
+ - name all nodes using html names
+ - support a tree-view
+ - misc bug fixes
+
+2004-05-19 13:12 hardaker
+
+ * local/mib2c:
+
+ - support "foreach $i stuff LIST"
+ - use unshift instead of push for calldefine to ensure proper recursion
+ - regexp munging
+
+2004-05-19 10:30 rstory
+
+ * agent/helpers/cache_handler.c:
+
+ load the cache for reserve1 (otherwise a get is required before set works)
+
+2004-05-18 13:52 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ allow for user override of mfd option defaults
+
+2004-05-18 13:51 rstory
+
+ * local/mib2c-conf.d/mfd-interactive-setup.m2c:
+
+ allow for interactive setup of mfd options
+
+2004-05-18 13:50 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ allow for interactive setup of options; use $context instead of $table
+
+2004-05-18 13:48 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ use $context instead of $table
+
+2004-05-18 13:46 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ set varbind error on column set error; always call row_prep; comment tweaks; use $context
+ instead of $table
+
+2004-05-18 13:41 rstory
+
+ * local/mib2c-conf.d/mfd-data-set.m2c:
+
+ set varbind error on column set error; comment tweaks; use $context instead of
+ $table; separate mfd_processing_types from m2c_processing_type
+
+2004-05-18 13:39 rstory
+
+ * local/mib2c-conf.d/: mfd-data-get.m2c, mfd-top.m2c:
+
+ comment tweaks; use $context instead of $table; separate mfd_processing_types
+ from m2c_processing_type
+
+2004-05-18 13:10 rstory
+
+ * local/mib2c-conf.d/mfd-data-access.m2c:
+
+ comment tweaks; use $context instead of $table; remove data setup from row_prep
+
+2004-05-18 11:43 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i
+:
+
+ comment tweaks; use $context instead of $table
+
+2004-05-18 11:38 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i:
+
+ comment tweaks; use $context instead of $table; default to setting up data
+ context in cache_load, instead of row_prep
+
+2004-05-18 11:27 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-set.m2i:
+
+ comment tweaks; assume mapping already done; set len to max size before
+ checking if it is large enough to hold a value
+
+2004-05-18 11:20 rstory
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i:
+
+ comment tweaks; log error if not enough space for var
+
+2004-05-18 11:20 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes.m2i:
+
+ use $context instead of $table; comment tweaks
+
+2004-05-18 11:12 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-get.m2i:
+
+ fix case of some constants
+
+2004-05-18 10:44 rstory
+
+ * local/mib2c-conf.d/: generic-table-constants.m2c,
+ generic-table-enums.m2c, generic-table-oids.m2c:
+
+ use $context instead of $table; make generic-table-(enums|oids) only run on current
+ table; add table loop in generic-table-constants
+
+2004-05-18 10:37 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ add debug tracing for set functions
+
+2004-05-18 10:35 rstory
+
+ * local/mib2c-conf.d/: details-table.m2i,
+ generic-ctx-copy.m2i, generic-data-allocate.m2i,
+ generic-data-context.m2i,
+ generic-table-indexes-varbind-setup.m2i, mfd-readme.m2c
+:
+
+ comment tweaks; chg $table to $context
+
+2004-05-18 02:08 dts12
+
+ * agent/mibgroup/agent/: extend.c, extend.h:
+
+ Write support, including RowStatus-based creation of new (volatile) rows.
+ The code needs a bit of tidying up, but seems to be reasonably functional.
+
+2004-05-18 02:01 dts12
+
+ * mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Minor tweaks.
+
+2004-05-17 20:06 slif
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ per Andy Smith, apply patch # 955579 to complete minor changes to install tabs.
+
+2004-05-17 19:58 slif
+
+ * win32/dist/: README.build.win32.txt,
+ htmlhelp/Introduction.html, htmlhelp/Net-SNMP.hhc,
+ htmlhelp/Net-SNMP.hhp:
+
+ Adjust usage to account for removed space from pathnames of HTML help files.
+
+2004-05-17 19:52 slif
+
+ * win32/dist/htmlhelp/: Configuration Overview.html,
+ Configuration_Overview.html, Developer FAQ.html,
+ Developer_FAQ.html, Help Caveats.html,
+ Help_Caveats.html:
+
+ remove space from pathnames of HTML help files.
+
+2004-05-17 15:45 slif
+
+ * win32/dist/README.txt:
+
+ per Alex Burger, one-line change (line 159, change period to colon).
+
+2004-05-17 07:13 slif
+
+ * README.win32, win32/Makefile.in,
+ win32/install-net-snmp.bat,
+ win32/dist/README.build.win32.txt, win32/dist/README.txt
+, win32/dist/htmlhelp/Configuration Overview.html,
+ win32/local/Makefile.in, win32/local/mib2c.bat,
+ win32/local/snmpconf.bat, win32/local/traptoemail.bat
+:
+
+ per Alex Burger: test existence of perl; provide access to more Perl programs.
+
+2004-05-17 06:44 slif
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ per Andy Smith: apply patch #955255 to enhance the NSIS installer.
+
+2004-05-17 05:35 dts12
+
+ * agent/mibgroup/agent/: extend.c, extend.h:
+
+ Implement the multi-row output MIB table.
+
+2004-05-14 04:22 dts12
+
+ * mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Oops! Close - but it's a good job I don't smoke....
+
+2004-05-13 21:23 slif
+
+ * win32/dist/README.build.win32.txt:
+
+ per AlexB: describe further details of building (creating empty files, etc).
+
+2004-05-13 21:13 slif
+
+ * win32/dist/README.txt:
+
+ per AlexB: added section "co-existing with m$ services"
+
+2004-05-13 20:29 slif
+
+ * win32/dist/installer/: Add2Path.nsi, SetEnVar.nsi,
+ net-snmp-header1.bmp, net-snmp.nsi:
+
+ Per Andy Smith: patch [952509] to fix link names for the service registration batch files.
+
+2004-05-13 20:12 slif
+
+ * win32/dist/README.build.win32.txt:
+
+ Per Alex Burger and Andy Smith: updated instructions for creating a win32 installable package.
+
+2004-05-13 20:04 slif
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/data_access/interface.h,
+ include/net-snmp/data_access/ipaddress.h,
+ include/net-snmp/data_access/route.h:
+
+ remove NETSNMP_CPP_WRAP macros
+
+2004-05-13 05:09 dts12
+
+ * agent/mibgroup/agent/: extend.c, extend.h:
+
+ Split new extension table into two (configuration and output).
+ Implement scalar to track the number of entries.
+ Parse multi-line output to implement 'nsExtendOutput1Line' object.
+
+2004-05-13 04:06 dts12
+
+ * mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Separate configuration and output into separate tables, as suggested.
+ Drop 'output length' object as probably unnecessary.
+ New scalar to track the number of entries in the table.
+ This also means that this group will not be empty,
+ even when no extensions are configured for a given agent.
+ (I'm still not happy with some of the names, though!)
+
+2004-05-11 03:59 slif
+
+ * snmplib/winservice.c:
+
+ cleanup error messages. clarify SCM interactions with worker thread in comments.
+
+2004-05-11 03:12 dts12
+
+ * mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Fix some SMI errors.
+ Wes can be a picky beggar at times....
+
+2004-05-10 17:50 slif
+
+ * win32/dist/scripts/net-snmp-perl-test.pl:
+
+ per Alex Burger - add missing test script.
+
+2004-05-10 13:49 hardaker
+
+ * win32/dist/README.build.win32.txt:
+
+ Another doc update from Alex
+
+2004-05-10 03:45 dts12
+
+ * agent/mibgroup/agent/: extend.c, extend.h:
+
+ Preliminary implemtation of new nsExtendTable
+
+2004-05-10 03:44 dts12
+
+ * mibs/NET-SNMP-EXTEND-MIB.txt:
+
+ Revised MIB for scripted extensions.
+ (To replace UCD-SNMP-MIB::extTable)
+
+2004-05-10 03:41 dts12
+
+ * snmplib/read_config.c:
+
+ Defensive programming - don't crash on NULL parameters.
+
+2004-05-10 03:40 dts12
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ External API for checking and reloading a cached value.
+ Weaken the links between this helper and 'nsCacheTable'.
+
+2004-05-07 15:41 nba
+
+ * mibs/rfclist:
+
+ Remove duplicate entry for FRNETSERV-MIB
+
+2004-05-07 15:19 nba
+
+ * mibs/: EtherLike-MIB.txt, IANAifType-MIB.txt,
+ rfcmibs.diff:
+
+ Update to current MIB versions
+
+2004-05-07 15:04 nba
+
+ * man/snmpcmd.1.def:
+
+ The word PREFIX is not endangered for substitution, so make it look normal
+
+2004-05-07 14:34 nba
+
+ * snmplib/mib.c:
+
+ Fix for truncated oid when using OBJECT IDENTIFIER as index
+
+2004-05-07 14:15 nba
+
+ * apps/snmptable.c:
+
+ Fix to allow specifying numeric oid for table
+
+2004-05-06 20:15 slif
+
+ * perl/SNMP/: README, SNMP.pm:
+
+ Per Alex Burger, add names to acknowledge the individual contributors.
+
+2004-05-06 19:41 slif
+
+ * win32/dist/: README.build.win32.txt, installer/net-snmp.nsi
+:
+
+ reflect that README-FIRST.txt and Installation.html have been merged into README.txt
+
+2004-05-06 19:02 slif
+
+ * win32/dist/installer/net-snmp.nsi:
+
+ Per Andy Smith, patch #942766 creates SNMPCONFPATH and SNMPSHAREPATH as system env vars.
+
+2004-05-06 18:54 slif
+
+ * snmplib/winservice.c:
+
+ Per Andy Smith, don't show message dialogs when reg/unreg OK (patch 948926 fixes bug 948146).
+
+2004-05-06 18:01 slif
+
+ * win32/dist/: README-FIRST.txt, README.build.win32.txt
+, README.txt, htmlhelp/Configuration Overview.html
+, htmlhelp/Help Caveats.html,
+ htmlhelp/Installation.html, htmlhelp/Net-SNMP.hhc,
+ htmlhelp/Net-SNMP.hhp, htmlhelp/snmp.conf.win32.html:
+
+ patch windows build packaging per Alex Burger's patch-win32-5.1.2-cleanup.diff
+
+2004-05-06 08:31 rstory
+
+ * agent/snmp_agent.c:
+
+ move var decl to top of block scope; add header to quiet prototype warning
+
+2004-05-05 14:41 nba
+
+ * mibs/ianalist:
+
+ Add IANA-MALLOC-MIB
+
+2004-05-05 13:49 nba
+
+ * apps/snmpdelta.c:
+
+ Protect oid table against overflow
+
+2004-05-05 07:34 rstory
+
+ * agent/snmp_agent.c:
+
+ check should_init before initializing smux
+
+2004-05-04 16:34 hardaker
+
+ * local/mib2c.check_values_local.conf:
+
+ Fix a header prototype declaration
+
+2004-05-04 07:14 dts12
+
+ * agent/mibgroup/mibII/: vacm_vars.c, vacm_conf.c,
+ vacm_conf.h, vacm_vars.h:
+
+ Split VACM handling into two - one concerned with configuration directives
+ and validating access, the other to handle the MIB table representation.
+ This allow the agent to support VACM-based access control without necessarily
+ including the VACM-related tables.
+
+2004-05-04 07:11 dts12
+
+ * agent/mibgroup/snmpv3/usmUser.c,
+ include/net-snmp/library/snmpusm.h, snmplib/snmpusm.c
+, apps/snmptrapd.c:
+
+ Move USM config handling into the library, so it can be shared between
+ agent and trap handler. This also paves the way for separating
+ config-based handling of setting up users from the USM MIB handler.
+
+2004-05-04 01:13 dts12
+
+ * local/mib2c:
+
+ Configure indent to recognise 'size_t' as a type name (Bug #946939)
+
+2004-05-03 15:08 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ Set no repeat-count to 1 when nogetbulk is specified for math purposes.
+
+2004-05-03 14:19 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ Solaris CPU_WAIT looks strange on some servers. Update to same algorith top uses
+
+2004-04-30 17:00 hardaker
+
+ * mibs/makehtml.pl:
+
+ Many misc changes and improvements.
+ - Now takes command line arguments for changing MIBDIRs and output dirs.
+ - accepts a nodemap to map MIBs to other nodes.
+
+2004-04-30 15:52 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ Added a touch of color.
+
+2004-04-30 15:52 hardaker
+
+ * local/Makefile.in:
+
+ install mib2c.genhtml.conf
+
+2004-04-30 11:19 hardaker
+
+ * mibs/: Makefile.in, makehtml.pl:
+
+ - A make routine to generate a HTML dump of our Distributed MIBs.
+ - Installed at http://www.Net-SNMP.org/mibs/
+
+2004-04-28 17:24 hardaker
+
+ * man/mib2c.conf.5:
+
+ update after extraction
+
+2004-04-28 17:23 hardaker
+
+ * local/mib2c:
+
+ many more updates and documentation for mib2c commands.
+
+2004-04-28 16:58 hardaker
+
+ * local/mib2c:
+
+ - document more and clean up $var.XXX comments
+
+2004-04-28 16:47 hardaker
+
+ * man/Makefile.in:
+
+ Only build the mib2c.conf man page if coming from a cvs checkout
+ - avoids perl dependencies on end-user machines.
+
+2004-04-28 16:45 hardaker
+
+ * man/: Makefile.in, mib2c.conf.5, mib2c.conf.5.in
+, mib2c.extract.pl:
+
+ New documentation for how to write mib2c.conf files.
+ - note, much is auto-extracted from comments in mib2c.
+
+2004-04-28 16:44 hardaker
+
+ * local/mib2c:
+
+ construct comments better for auto-extraction into a manual page.
+
+2004-04-28 15:47 hardaker
+
+ * local/mib2c.genhtml.conf:
+
+ New mib2c.genhtml.conf code to generate a HTML document from a MIB
+ document to make it easier to read.
+
+2004-04-28 15:47 hardaker
+
+ * local/mib2c:
+
+ - new @startperl@ / @endperl@ definitions to completely outsource some
+ text to a large block of perl.
+ - added mib2c_output() to output a line of text to the right place
+ from anywhere in perl (evaled) code.
+
+2004-04-28 15:45 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ support the ability to get TC descriptions from perl
+
+2004-04-28 15:38 hardaker
+
+ * perl/OID/OID.xs:
+
+ fix output to respect the output length returned by the variable
+ printing routines.
+
+2004-04-28 15:34 hardaker
+
+ * include/net-snmp/library/parse.h, snmplib/parse.c:
+
+ - Save textual convention description's
+ - Implement +const char *get_tc_description(int tc_index)
+
+2004-04-28 15:33 hardaker
+
+ * snmplib/mib.c:
+
+ change variable to const var to avoid warning.
+
+2004-04-27 11:44 hardaker
+
+ * configure, configure.in:
+
+ fix auto-enabling of --with-perl-modules when --enable-embedded-perl is selected
+
+2004-04-26 03:24 dts12
+
+ * apps/snmpusm.c, man/snmpusm.1.def:
+
+ Restore the distinction between 'cloneFrom' and 'create'(+clone)
+ subcommands. Fix handling of bare 'create' subcommand (since an
+ uncloned user can't be marked as ACTIVE with the Net-SNMP agent)
+ Document the behaviour more clearly.
+
+2004-04-23 08:15 dts12
+
+ * agent/helpers/table_container.c, agent/helpers/table_data.c
+, include/net-snmp/agent/table_container.h,
+ include/net-snmp/agent/table_data.h:
+
+ Provide an API for retrieving the table container (or 'table_data')
+ structure from within a handler routine.
+ This avoids the need for using global variables.
+
+2004-04-23 04:20 slif
+
+ * win32/dist/tosock1.sh:
+
+ script that converts back to winsock 1 library. no undo is explained.
+
+2004-04-22 19:01 rstory
+
+ * local/mib2c-conf.d/: generic-data-allocate.m2i,
+ generic-table-indexes-from-oid.m2i,
+ generic-table-indexes-set.m2i,
+ generic-table-indexes-to-oid.m2i,
+ generic-value-map-func.m2i,
+ mfd-access-container-cached-defines.m2i,
+ mfd-access-unsorted-external-defines.m2i,
+ mfd-data-access.m2c, mfd-interface.m2c, mfd-top.m2c
+, node-set.m2i, parent-set.m2i:
+
+ change all DEBUGTRACE to DEBUGMSTL(("verbose:function_name"...
+
+2004-04-22 07:13 slif
+
+ * apps/snmptrapd.c, win32/snmptrapd/Makefile.in,
+ win32/snmptrapd/snmptrapd.dsp:
+
+ patch from Andy Smith: [931673] Run snmptrapd as a Windows service;
+ slif did the makefile/project file touches.
+
+2004-04-22 07:11 slif
+
+ * agent/snmpd.c:
+
+ match application name with display name to improve event log legibility.
+
+2004-04-22 07:08 slif
+
+ * win32/: snmpd/Makefile.in, snmpdsdk/Makefile.in:
+
+ Change include search path for snmplib to "..\.." [was pointing elsewhere].
+
+2004-04-21 19:50 rstory
+
+ * local/mib2c-conf.d/subagent.m2c:
+
+ remove unused var; update help message
+
+2004-04-21 19:48 rstory
+
+ * local/mib2c-conf.d/: default-mfd-top.m2c, mfd-top.m2c
+:
+
+ use # instead of * for special char, since perl doesn't like the *
+
+2004-04-21 19:44 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ use unused var
+
+2004-04-21 19:41 rstory
+
+ * local/mib2c-conf.d/mfd-data-set.m2c:
+
+ fix quoting problem
+
+2004-04-21 19:39 rstory
+
+ * local/mib2c-conf.d/mfd-data-get.m2c:
+
+ add missing prototype for non-index map functions
+
+2004-04-21 19:37 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i
+:
+
+ get rid of loop_init_context, moving it's work into get_first; fix test
+ for code gen for transient data
+
+2004-04-21 19:25 rstory
+
+ * local/mib2c-conf.d/m2c_setup_enum.m2i:
+
+ don't use uc function, as it barfs on enums w/hyphens
+
+2004-04-21 05:53 slif
+
+ * win32/dist/installer/: Add2Path.nsi, SetEnVar.nsi,
+ net-snmp.nsi:
+
+ from Andy Smith: installer components
+
+2004-04-20 20:48 slif
+
+ * include/ucd-snmp/version.h:
+
+ fix [807349] ucd-snmp/version.h tries to use a mutable variable [#define]
+
+2004-04-20 20:23 slif
+
+ * README.win32:
+
+ update status, change build menu, and manual build ipv6 instructions.
+
+2004-04-20 18:57 slif
+
+ * snmplib/system.c:
+
+ patch-bug-919465-4 applied to fix [919465] bug in system.c
+
+2004-04-20 17:28 hardaker
+
+ * testing/tests/: T030snmpv3usercreation, T110agentxget
+, T111agentxset, T112agentxsetfail,
+ T113agentxtrap, T120proxyget, T121proxyset,
+ T122proxysetfail:
+
+ Use new global Sv3config master param setup
+
+2004-04-20 17:24 hardaker
+
+ * testing/tests/: T023snmpv3getMD5AES, T026snmpv3getSHAAES
+:
+
+ New tests for AES support
+
+2004-04-20 17:24 hardaker
+
+ * testing/tests/: T022snmpv3getMD5, T023snmpv3getMD5DES
+, T024snmpv3getSHA1, T025snmpv3getSHADES:
+
+ Use new global Sv3config master param setup
+
+2004-04-20 17:19 hardaker
+
+ * testing/tests/Sv3config:
+
+ determine the best auth/encr type available and use it.
+
+2004-04-20 17:19 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ fix for disabled snmpv1/2c and md5/des
+
+2004-04-20 15:13 rstory
+
+ * local/mib2c.conf:
+
+ fix unbalanced if/endif noted on coders by Oleg Ivanov
+
+2004-04-20 12:09 slif
+
+ * apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ include/net-snmp/system/cygwin.h,
+ include/net-snmp/system/mingw32.h, snmplib/inet_ntop.c
+, snmplib/inet_pton.c, snmplib/snmpTCPDomain.c,
+ snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c,
+ win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/net-snmp-config.h.in:
+
+ fix errors building IPv6 support for MSVC++, MinGW, and Cygwin.
+
+2004-04-20 07:18 hardaker
+
+ * local/snmpconf:
+
+ fix broken usage of qw()
+
+2004-04-20 06:20 slif
+
+ * win32/EXAMPLE.conf.win32:
+
+ add sample config file
+
+2004-04-20 04:39 nba
+
+ * agent/mibgroup/agent/: nsCache.c, nsDebug.c,
+ nsLogging.c:
+
+ Fix int/long mixup for 64-bit Solaris
+
+2004-04-20 04:33 nba
+
+ * agent/snmp_agent.c, snmplib/snmp.c:
+
+ Ensure diagnostics with ASN.1 encoding errors
+
+2004-04-20 03:51 slif
+
+ * perl/SNMP/SNMP.xs:
+
+ cleanup "reading MIB file" verbose message (compiled MIBDIRS/MIBS not useful/discernable).
+
+2004-04-20 02:51 slif
+
+ * snmplib/mib.c:
+
+ fix unsigned compare of len to line_len in sprint_realloc_hexstring
+
+2004-04-20 02:48 slif
+
+ * snmplib/parse.c:
+
+ add_mibdir variable 'token' is not used on win32. move to under the ifdef.
+
+2004-04-19 23:40 slif
+
+ * win32/: Configure, Makefile.in, local/Makefile.in
+:
+
+ patch from Alex Burger: [928872] Win32 build.bat snmpconf,mib2c,traptoemail
+
+2004-04-19 23:20 slif
+
+ * win32/dist/: README-FIRST.txt, README.build.win32.txt
+, README.txt, htmlhelp/Configuration Overview.html
+, htmlhelp/Developer FAQ.html, htmlhelp/FAQ.html
+, htmlhelp/Help Caveats.html,
+ htmlhelp/Installation.html, htmlhelp/Introduction.html
+, htmlhelp/Net-SNMP.hhc, htmlhelp/Net-SNMP.hhp,
+ htmlhelp/net-snmp-4.2-800.jpg,
+ htmlhelp/snmp.conf.win32.html,
+ htmlhelp/snmpd.conf.win32.html,
+ htmlhelp/snmptrapd.conf.win32.html, scripts/create-toc
+, scripts/mandir2html, scripts/poddir2html,
+ scripts/readme2html, scripts/txt2html:
+
+ patch from Alex Burger: [938214] Win32 dist folder - building a binary release
+
+2004-04-19 23:05 slif
+
+ * local/snmpconf:
+
+ patch from Alex Burger: [918410] SNMPCONF dynamic paths
+
+2004-04-19 21:52 slif
+
+ * snmplib/: snmpTCPIPv6Domain.c, snmpUDPIPv6Domain.c:
+
+ conditionally compile for platforms with static object lists [no configure].
+
+2004-04-19 21:49 slif
+
+ * apps/snmpnetstat/: inet6.c, netstat.h:
+
+ reduce warnings for undecl'd struct; declare inet6print only where it is needed.
+
+2004-04-19 21:41 slif
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ don't expose getaddrinfo if not supported by the platform.
+
+2004-04-19 21:39 slif
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ fix unsigned int compare
+
+2004-04-19 21:38 slif
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ trade in a single typedef uint8_t for the widely used u_char.
+
+2004-04-19 21:36 slif
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ cleanup when finished with addrinfo structure.
+
+2004-04-19 20:09 slif
+
+ * configure.in, configure:
+
+ add inet_ntop,inet_pton to snmplib objects for win32 builds.
+
+2004-04-19 20:08 slif
+
+ * win32/Configure:
+
+ more robust change for NETSNMP_USE_DLL.
+
+2004-04-19 18:37 hardaker
+
+ * apps/encode_keychange.c:
+
+ fix #ifdef bug
+
+2004-04-19 16:47 slif
+
+ * snmplib/parse.c:
+
+ add comment from Niels B. reason for win32 ifdefs in add_mibdir.
+
+2004-04-19 15:57 slif
+
+ * win32/: Configure, build.pl, mib_module_inits.h
+, net-snmp/net-snmp-config.h,
+ net-snmp/net-snmp-config.h.in, snmpnetstat/Makefile.in
+, snmpnetstat/snmpnetstat.dsp:
+
+ selective build of IPv6 transport for MSVC++ build
+
+2004-04-19 15:08 hardaker
+
+ * NEWS, configure, configure.in,
+ agent/mibgroup/snmpv3/usmUser.c, apps/encode_keychange.c
+, apps/snmpusm.c,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/transform_oids.h,
+ snmplib/keytools.c, snmplib/lcd_time.c, snmplib/md5.c
+, snmplib/scapi.c, snmplib/snmp_parse_args.c,
+ snmplib/snmpusm.c, snmplib/snmpv3.c,
+ testing/tests/Sv3config, testing/tests/Sv3vacmconfig,
+ testing/tests/T020snmpv3get,
+ testing/tests/T021snmpv3getnext,
+ testing/tests/T0220snmpv3bulkget,
+ testing/tests/T022snmpv3getMD5,
+ testing/tests/T023snmpv3getMD5DES,
+ testing/tests/T025snmpv3getSHADES,
+ testing/tests/T049snmpv3inform,
+ testing/tests/T050snmpv3trap:
+
+ New configure flags: --disable-md5 and --disable-des to completely remove support for the less trusted/secure algorithms
+
+2004-04-19 13:01 slif
+
+ * agent/snmp_agent.c:
+
+ move debug statement after variable definition.
+
+2004-04-19 12:36 slif
+
+ * win32/Configure:
+
+ use a more robust search for undef USE_OPENSSL.
+
+2004-04-19 08:28 dts12
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/snmp_api.c, snmplib/mib.c:
+
+ More flexible output of hex strings - don't hardcode 16-octets-per-line
+
+2004-04-19 07:58 slif
+
+ * apps/snmpnetstat/winstub.c:
+
+ comment out variables which are not used.
+
+2004-04-19 07:58 rstory
+
+ * agent/snmp_agent.c:
+
+ add alarm to age addr cache every 5 min; add debug for asp->reqinfo
+
+2004-04-19 07:53 rstory
+
+ * agent/snmpd.c:
+
+ remove 'sched'uled timeout processing; move addr cache aging into alarm;
+ change deafult timeout from TIMETICK to LONG_MAX
+
+2004-04-19 07:49 rstory
+
+ * snmplib/snmp_api.c:
+
+ remove unused var; add timeout debugging
+
+2004-04-19 07:36 slif
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ patch [ 918948 ] fix cygwin config problem
+
+2004-04-16 17:06 hardaker
+
+ * snmplib/snmp_parse_args.c:
+
+ fixed a v1/v2c exclusion bug
+
+2004-04-16 16:45 hardaker
+
+ * configure, configure.in:
+
+ Output message now contains versions supported
+
+2004-04-16 16:37 hardaker
+
+ * NEWS, configure, configure.in,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/snmp_agent.c,
+ agent/helpers/table_iterator.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/target/target.c, apps/snmptable.c,
+ apps/snmptrap.c, apps/snmptrapd_log.c,
+ apps/snmpnetstat/main.c,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/snmp.h, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c, snmplib/snmp_api.c,
+ snmplib/snmp_auth.c, snmplib/snmp_parse_args.c,
+ snmplib/snmpv3.c, testing/eval_tools.sh,
+ testing/tests/T001snmpv1get, testing/tests/T014snmpv2cget
+, testing/tests/T015snmpv2cgetnext,
+ testing/tests/T0160snmpv2cbulkget,
+ testing/tests/T016snmpv2cgetfail,
+ testing/tests/T017snmpv2ctov1getfail,
+ testing/tests/T018snmpv1tov2cgetfail,
+ testing/tests/T019snmpv2cnosuch,
+ testing/tests/T051snmpv2ctrap,
+ testing/tests/T052snmpv2cinform,
+ testing/tests/T058agentauthtrap, testing/tests/T100agenthup
+, testing/tests/T120proxyget,
+ testing/tests/T121proxyset, testing/tests/T122proxysetfail
+, testing/tests/T130snmpv1vacmget,
+ testing/tests/T131snmpv2cvacmget,
+ testing/tests/T140snmpv1vacmgetfail,
+ testing/tests/T141snmpv2cvacmgetfail,
+ testing/tests/T150solarishostcpu,
+ testing/tests/T151solarishostdisk,
+ testing/tests/T152hostuptime, testing/tests/T153solarisswap
+:
+
+ New flags for configure: --disable-snmpv1 --disable-snmpv2c
+
+2004-04-16 16:21 hardaker
+
+ * testing/tests/: T020snmpv3get, T021snmpv3getnext:
+
+ remove duplicate and conflicting VACM entry. It's amazing this hasn't
+ causes false problems before now.
+
+2004-04-16 12:46 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ address issues noted by dave on coders
+
+2004-04-16 12:42 rstory
+
+ * include/net-snmp/library/snmp_debug.h, snmplib/snmp_debug.c
+:
+
+ new 'no check' debug macro/functions
+
+2004-04-15 14:52 rstory
+
+ * include/net-snmp/data_access/arp.h:
+
+ header for arp data access
+
+2004-04-15 05:50 dts12
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Variables used for returning values need to be 'static'. (oops!)
+
+2004-04-15 05:47 dts12
+
+ * agent/snmp_vars.c, include/net-snmp/agent/snmp_vars.h
+, agent/mibgroup/mibII/var_route.c:
+
+ Move the definition of 'ipaddr_return' to the (only) routine where
+ it's actually used. (See Bug #934422)
+
+2004-04-15 05:29 dts12
+
+ * local/mib2c.notify.conf:
+
+ Remove extraneous ';' in notification generation routine (Bug #895800)
+
+2004-04-15 05:14 dts12
+
+ * agent/snmp_agent.c:
+
+ Remove duplicate code (Bug #934411)
+
+2004-04-14 21:59 hardaker
+
+ * snmplib/snmpv3.c:
+
+ fixed cut-n-paste typos pointed out to me by Mike S.
+
+2004-04-14 17:25 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ - support local/master SNMPv3 key settings directly
+ - have gettable() parse indexes out of the OID when NetSNMP::OID is available
+ - not extensively tested yet.
+
+2004-04-14 15:41 slif
+
+ * man/mib_api.3.def:
+
+ Specify correct default value for MIBDIRS.
+
+2004-04-14 15:32 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat.h, mibs/UCD-SNMP-MIB.txt
+:
+
+ Support for Linux 2.6 incl SoftIRQ CPU state
+
+2004-04-14 15:29 nba
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Overhaul to remove fixed table size and support Linux 2.6 kernel
+
+2004-04-14 15:21 nba
+
+ * agent/mibgroup/ucd-snmp/: vmstat_hpux.c, vmstat_solaris2.c
+:
+
+ Clean up comments mishandled ny indent
+
+2004-04-14 14:49 hardaker
+
+ * man/snmpd.conf.5.def, snmplib/snmpv3.c:
+
+ Added support to the createUser directive for specifying manual local
+ or master keys rather than relying on password derivations.
+
+2004-04-14 13:21 rstory
+
+ * agent/helpers/cache_handler.c:
+
+ null check before using pointer
+
+2004-04-14 13:11 hardaker
+
+ * include/net-snmp/library/default_store.h:
+
+ Added support for new snmp.conf tokens to directly set SNMPv3 hex keys
+
+2004-04-14 12:27 hardaker
+
+ * man/snmp.conf.5.def, man/snmpcmd.1.def,
+ snmplib/default_store.c, snmplib/snmp_api.c,
+ snmplib/snmpv3.c:
+
+ Added support for new snmp.conf tokens to directly set SNMPv3 hex keys
+
+2004-04-14 09:40 hardaker
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+, snmplib/snmpv3.c, man/snmpcmd.1.def:
+
+ Added support for directly specifying SNMPv3 hex keys using new flags (-3[mMkK])
+
+2004-04-14 08:24 rstory
+
+ * configure:
+
+ new configure for configure.in
+
+2004-04-14 08:23 rstory
+
+ * configure.in:
+
+ more debug; simplify two conflict tests into one; revert conflict messages
+ back to warning, but add obnoxious warning to summary cache
+
+2004-04-14 03:25 dts12
+
+ * perl/SNMP/t/bulkwalk.t:
+
+ A non-zero repeat count with no non-repeating varbinds confuses the
+ perl 'bulkwalk' routine. This should really be fixed properly,
+ but this at least allows the rest of the tests to run successfully.
+
+2004-04-14 03:15 dts12
+
+ * snmplib/snmp_logging.c:
+
+ Support per-loghandler shutdown processing in 'snmp_disable_log'.
+ This should allow logfiles to be rotated properly.
+
+ However, I'm not convinced that the 'enabled' flag is being used
+ consistently, particularly by other styles of logging configuration.
+ Some cleanup work is probably needed.
+
+2004-04-14 03:09 dts12
+
+ * include/net-snmp/library/default_store.h, snmplib/mib.c
+:
+
+ Support "01:02:03:04:05:06" style hex output - i.e. leading 0's
+ on single-digit hex values. (Suggested by Glenn Andrews)
+
+2004-04-14 03:06 dts12
+
+ * include/net-snmp/library/parse.h, snmplib/mib.c,
+ snmplib/parse.c:
+
+ Identify which MIB modules are present in the MIBFILES list before
+ starting to load anything. This allows IMPORT statements to work
+ correctly, regardless of the order in which such files appear.
+
+2004-04-14 02:53 dts12
+
+ * include/net-snmp/system/: aix.h, bsd.h, cygwin.h
+, dynix.h, irix.h, mingw32.h, osf5.h
+, sunos.h, svr5.h, sysv.h, ultrix4.h
+:
+
+ Include "generic.h" using the full name, rather than
+ relying on the include path being set correctly.
+ (Suggested by Nagaraj Narayanaswamy)
+
+2004-04-14 02:42 dts12
+
+ * apps/snmpdelta.c:
+
+ Catch SNMPv2 exception values.
+
+2004-04-14 02:37 dts12
+
+ * agent/mibgroup/mibII/route_write.c:
+
+ Avoid crashing the agent when backing out of an invalid SET request.
+
+2004-04-14 02:33 dts12
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ Allow 'monitor' directives to specify a single instance rather than
+ always monitoring all rows.
+
+2004-04-14 02:28 dts12
+
+ * FAQ:
+
+ Update list of supported MIBs, advice on running as non-root
+ and bring into line with 5.1.x branch version.
+
+2004-04-13 13:50 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i:
+
+ tweak assert condition to allow for valid but expired cache
+
+2004-04-13 13:48 rstory
+
+ * local/mib2c-conf.d/details-enums.m2i:
+
+ fix comment typo
+
+2004-04-13 12:35 rstory
+
+ * agent/mibgroup/: ip-mib.h, ip-mib/inetNetToMediaTable.h
+,
+ ip-mib/inetNetToMediaTable/default-table-inetNetToMediaTable.m2d
+, ip-mib/inetNetToMediaTable/inetNetToMediaTable.c,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable.h,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
+,
+ ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+, ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
+, ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+:
+
+ new inetNetToMediaTable
+
+2004-04-13 12:32 rstory
+
+ * agent/mibgroup/ip-mib/data_access/: arp.h, arp_common.c
+, arp_linux.c, ipaddress_ioctl.h:
+
+ new files
+
+2004-04-13 11:44 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
+:
+
+ remove unused var
+
+2004-04-13 11:43 rstory
+
+ *
+ agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c
+:
+
+ use access routine to allocate/free route entries
+
+2004-04-13 11:42 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable.c:
+
+ use access routine to allocate/free interface entries
+
+2004-04-13 11:41 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ default admin/oper status to up
+
+2004-04-13 11:39 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ invert order for cache refresh; set new preload flag on cache to init ifIndex
+ enum list (used by other modules); set oper_status down if interface vanishes;
+ more robust handling of comparing/swiping pointers
+
+2004-04-13 11:34 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_constants.h:
+
+ remove unused mapping defines
+
+2004-04-13 11:33 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.c:
+
+ remove unused mapping functions
+
+2004-04-13 11:31 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.h:
+
+ revert external defintion change
+
+2004-04-13 11:29 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c:
+
+ use access routine to allocate/free ipaddress_entry
+
+2004-04-13 11:26 rstory
+
+ * agent/mibgroup/ip-mib/data_access/: ipaddress_common.c,
+ ipaddress_ioctl.c, ipaddress_linux.c:
+
+ tweak internal index usage; use net-snmp ifIndex based on name instead of ioctl
+ if_index; add/tweak comments
+
+2004-04-13 11:23 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ new flag for preloading cache; move cache load/free to static subroutines for
+ code reuse; add some debug msgs
+
+2004-04-13 11:15 rstory
+
+ * include/net-snmp/data_access/interface.h:
+
+ add defines for admin/oper status enums
+
+2004-04-13 10:31 hardaker
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ entries for have_mktime nad have_stime
+
+2004-04-13 10:31 hardaker
+
+ * dist/net-snmp.spec:
+
+ version change.
+
+2004-04-10 05:59 dts12
+
+ * apps/snmpusm.c:
+
+ Cloning a user requires using the usmUserStatus column object.
+
+2004-04-10 05:57 dts12
+
+ * configure, configure.in:
+
+ Remove duplicate entry from list of default MIB modules.
+
+2004-04-09 18:50 slif
+
+ * snmplib/snmp_transport.c:
+
+ fix two SNMP_FREE candidates in tdomain_unregister, clear_tdomain_list.
+
+2004-04-09 18:47 slif
+
+ * snmplib/inet_pton.c:
+
+ fix a sign compare warning.
+
+2004-04-09 18:37 slif
+
+ * win32/: libsnmp/Makefile.in, libsnmp/libsnmp.dsp,
+ libsnmp_dll/Makefile.in, libsnmp_dll/libsnmp.def,
+ libsnmp_dll/libsnmp_dll.dsp, net-snmp/net-snmp-config.h
+, net-snmp/net-snmp-config.h.in:
+
+ add IPv6 transports to msvc++ builds.
+
+2004-04-09 18:27 slif
+
+ * perl/SNMP/t/get.t:
+
+ don't require interface layer of agent in order to pass these tests.
+
+2004-04-09 18:24 slif
+
+ * win32/libnetsnmptrapd/Makefile.in:
+
+ undo last change to restore proper construction of Perl modules.
+
+2004-04-08 21:11 slif
+
+ * testing/tests/T122proxysetfail:
+
+ match snmpset output to fix bug [919267] testnum 34 T122proxysetfail failing
+
+2004-04-08 20:25 slif
+
+ * testing/RUNTESTS:
+
+ change usage comment for "-XM" to match its function
+
+2004-04-08 20:19 slif
+
+ * win32/libnetsnmptrapd/Makefile.in:
+
+ do not build snmptrapd.obj as part of netsnmptrapd library (MSVC++ build).
+
+2004-04-08 20:17 slif
+
+ * win32/libhelpers/: Makefile.in, libhelpers.dsp:
+
+ add table_container.obj to list of objects to be built using MSVC++
+
+2004-04-08 20:12 slif
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Patch from Michael Slifcak: [ 918948 ] fix cygwin config problem
+
+2004-04-08 20:07 slif
+
+ * agent/mibgroup/host/hr_system.c:
+
+ apply nba's Feb.2004 pututline fixes to main branch.
+
+2004-04-08 15:54 hardaker
+
+ * testing/eval_tools.sh:
+
+ Use -Lf and -Lf in the main trunk to match the proper code use
+
+2004-04-08 13:08 hardaker
+
+ * agent/mibgroup/utilities/override.c, man/snmpd.conf.5.def
+:
+
+ Support for the -rw flag to the override token allowing read/write
+ access to the bogus mib objects.
+
+2004-04-08 13:01 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Fix enum lists for unsigned and bit strings to remove duplicate types
+
+2004-04-07 19:50 slif
+
+ * testing/: RUNTESTS, TESTCONF.sh:
+
+ patch [917646] test using installed MIBs first
+
+2004-04-07 15:57 rstory
+
+ * configure:
+
+ configure to match new config.in
+
+2004-04-07 15:55 rstory
+
+ * configure.in:
+
+ add lots of debug to module processing; use new var for excluded modules; make
+ conflicts errors instead of warnings; don't try to re-process a src only module
+
+2004-04-07 15:52 rstory
+
+ * local/mib2c-conf.d/details-enums.m2i:
+
+ typo in comments
+
+2004-04-07 15:51 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ only gen release undo code if settable
+
+2004-04-07 15:47 rstory
+
+ * include/net-snmp/data_access/route.h:
+
+ tweak comments
+
+2004-04-07 15:47 rstory
+
+ * agent/mibgroup/ip-mib/data_access/.cvsignore:
+
+ files to ignore
+
+2004-04-07 15:46 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c:
+
+ remove unused/undefined vars
+
+2004-04-07 15:44 rstory
+
+ * agent/mibgroup/: if-mib.h, ip-forward-mib.h:
+
+ fix config_require paths
+
+2004-04-07 15:44 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable.h:
+
+ config_exclude mibII/interfaces; tweak external oid def
+
+2004-04-07 15:43 rstory
+
+ * agent/mibgroup/if-mib/data_access/interface_common.c:
+
+ remove references to ifTable
+
+2004-04-07 15:38 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/.cvsignore:
+
+ files to ignore
+
+2004-04-07 15:37 rstory
+
+ * agent/mibgroup/ip-mib/ipAddressTable/:
+ default-table-ipAddressTable.m2d, ipAddressTable.c,
+ ipAddressTable.h, ipAddressTable_constants.h,
+ ipAddressTable_data_access.c, ipAddressTable_data_access.h
+, ipAddressTable_interface.c,
+ ipAddressTable_interface.h:
+
+ new MFD ipAddressTable
+
+2004-04-07 15:36 rstory
+
+ * agent/mibgroup/ip-mib/data_access/ipaddress.h,
+ agent/mibgroup/ip-mib/data_access/ipaddress_common.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.c,
+ agent/mibgroup/ip-mib/data_access/ipaddress_linux.h,
+ include/net-snmp/data_access/ipaddress.h:
+
+ ipaddress data access (v4 & v6)
+
+2004-04-07 15:29 rstory
+
+ * agent/mibgroup/: ip-mib.h, ip-mib/ipAddressTable.h:
+
+ new config modules
+
+2004-04-07 06:38 dts12
+
+ * snmplib/mib.c:
+
+ Remove a superfluous trailing comma (bug #930708)
+
+2004-04-07 03:23 dts12
+
+ * agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h:
+
+ Routines to indicate the number of rows in a data-helper-based table
+
+2004-04-07 02:13 slif
+
+ * testing/eval_tools.sh:
+
+ CAPTURE returns exit code from command that was run.
+
+2004-04-06 23:33 slif
+
+ * win32/net-snmp/: net-snmp-config.h, net-snmp-config.h.in
+:
+
+ patch [930880] don't build CMU compatible functions on win32
+
+2004-04-06 23:19 slif
+
+ * README.win32, perl/TrapReceiver/Makefile.PL,
+ win32/Configure, win32/Makefile.in, win32/libsdll.dsw
+, win32/win32.dsw, win32/win32sdk.dsw,
+ win32/libnetsnmptrapd/.cvsignore,
+ win32/libnetsnmptrapd/Makefile.in,
+ win32/libnetsnmptrapd/libnetsnmptrapd.dsp,
+ win32/snmptrapd/Makefile.in, win32/snmptrapd/snmptrapd.dsp
+:
+
+ patch [915615] Perl TrapReceiver does not compile on Win32 MSVC
+ also fixes bug [896012] win32 Perl build dies at TrapReceiver
+
+2004-04-06 21:59 slif
+
+ * agent/mibgroup/mibII/: tcpTable.c, udpTable.c:
+
+ fix [907716] win32 agent shows tcp,udp connect OIDs in host byte order
+
+2004-04-06 17:35 slif
+
+ * testing/eval_tools.sh:
+
+ patch [919122] test should allow time for programs to settle
+
+2004-04-06 17:34 slif
+
+ * testing/eval_tools.sh:
+
+ patch [919114] preserve test result when stopping
+
+2004-04-06 17:32 slif
+
+ * testing/eval_tools.sh:
+
+ patch [919105] better pid check
+
+2004-04-06 10:43 rstory
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ include stdint, if available
+
+2004-04-06 09:46 dts12
+
+ * agent/agent_handler.c,
+ include/net-snmp/agent/agent_handler.h:
+
+ Register new API modules using the default priority (127)
+ and provide an API for unregistering them again.
+
+2004-04-05 16:04 slif
+
+ * testing/eval_tools.sh:
+
+ reverse patch-test-deprecated-options to permit testing versions before 5.1.
+
+2004-04-04 11:17 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/:
+ ipCidrRouteTable_data_access.c,
+ ipCidrRouteTable_interface.c:
+
+ don't share cache w/inetCidrRoute, which can't work, since indexes don't match
+
+2004-04-04 11:15 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/: ifXTable.h,
+ ifXTable_data_access.c, ifXTable_interface.c:
+
+ share data structures/cache w/ifTable if enabled
+
+2004-04-04 11:05 rstory
+
+ * agent/mibgroup/if-mib/ifXTable/: default-table-ifXTable.m2d
+, ifXTable.c, ifXTable.h, ifXTable_interface.h
+:
+
+ update to use new interface data access
+
+2004-04-04 10:59 rstory
+
+ * agent/mibgroup/ip-forward-mib/data_access/route_common.c,
+ agent/mibgroup/ip-forward-mib/data_access/route_linux.c,
+ include/net-snmp/data_access/route.h:
+
+ update to support inetCidrRouteTable
+
+2004-04-04 10:58 rstory
+
+ * agent/mibgroup/ip-forward-mib.h:
+
+ add inetCidrRouteTable
+
+2004-04-04 10:57 rstory
+
+ * agent/mibgroup/ip-forward-mib/inetCidrRouteTable/:
+ inetCidrRouteTable.c, inetCidrRouteTable.h,
+ inetCidrRouteTable_constants.h,
+ inetCidrRouteTable_data_access.c,
+ inetCidrRouteTable_data_access.h,
+ inetCidrRouteTable_interface.c,
+ inetCidrRouteTable_interface.h, .cvsignore,
+ default-table-inetCidrRouteTable.m2d:
+
+ new inetCidrRouteTable. only does ipv4 so far.
+
+2004-04-04 07:14 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/:
+ ipCidrRouteTable_data_access.c,
+ ipCidrRouteTable_interface.c:
+
+ share cache w/inetCidrRouteTable, if it is enabled
+
+2004-04-04 07:09 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ use unused var
+
+2004-04-04 07:08 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ fix missed case for allocate parm; remove unused var
+
+2004-04-04 07:07 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i
+:
+
+ fix missed case for allocate parm
+
+2004-04-04 07:06 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i:
+
+ add debug
+
+2004-04-03 05:15 rstory
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ fix bug 928481 - consistency in vacm_vars.c
+
+2004-04-02 19:02 rstory
+
+ * agent/mibgroup/: if-mib/ifTable.h, if-mib/ifXTable.h,
+ ip-forward-mib/inetCidrRouteTable.h,
+ ip-forward-mib/ipCidrRouteTable.h:
+
+ configure_require files for individual modules
+
+2004-04-02 12:52 rstory
+
+ * snmplib/container.c:
+
+ default to netsnmp_index compare if no compare provided
+
+2004-04-02 12:51 rstory
+
+ * snmplib/: cmu_compat.c, snmp_version.c:
+
+ include net-snmp-config.h
+
+2004-04-02 12:40 rstory
+
+ * snmplib/callback.c:
+
+ new static lock var to detect when a callback is added/removed during callback
+ processing; don't call free on client arg of callback w/NULL callback ptr
+ (i.e. one that was removed while callbacks were being processed)
+
+2004-04-02 12:36 rstory
+
+ * local/mib2c-update:
+
+ make temp dir names configureable, w/defaults now prefixed w/'.'; tweak diff
+ exclude patterns; other misc tweaks
+
+2004-04-02 12:34 rstory
+
+ * include/net-snmp/library/tools.h:
+
+ fix macros to be safely useable as a single statement; new SNMP_SWIPE_MEM macro
+
+2004-04-02 08:20 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ new config.h.in to match acconfig.h (autoheader hadn't been run in a while):
+ pcks, croptyki, config_exclude, agentx domain socket, cppwrap macro
+
+2004-04-02 08:06 rstory
+
+ * agent/helpers/cache_handler.c:
+
+ reduce redundancy
+
+2004-04-02 08:02 rstory
+
+ * agent/agent_handler.c:
+
+ add asserts on illegal handler calls
+
+2004-04-02 06:46 hardaker
+
+ * apps/snmptrapd_handlers.c:
+
+ Fix inclusion of utilities/execute.h, since Robert's Makefile changes
+ broke the path lookups.
+
+2004-04-01 22:08 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ make gettable use getbulk when possible
+
+2004-04-01 19:41 rstory
+
+ * configure:
+
+ configure for new configure.in
+
+2004-04-01 19:32 rstory
+
+ * Makefile.in:
+
+ move VPATH to individual Makefile.in files; new makefilecheck target to check
+ for gnu make constructs; new 'checks' target runs checks for comment/makefile
+
+2004-04-01 19:29 rstory
+
+ * acconfig.h:
+
+ empty define for config_exclude; new NETSNMP_CPP_WRAP macros
+
+2004-04-01 19:27 rstory
+
+ * configure.in:
+
+ new config_exclude; config_require tweaks:
+ don't process the same module twice; allow c file w/no header; move
+ module list add, config_load_mib check inside header conditional
+
+2004-04-01 18:38 rstory
+
+ * configure:
+
+ new configure to match configure.in
+
+2004-04-01 18:37 rstory
+
+ * Makefile.top, configure.in, agent/Makefile.in
+, agent/helpers/Makefile.in,
+ agent/mibgroup/Makefile.in, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in, local/Makefile.in,
+ man/Makefile.in, mibs/Makefile.in,
+ snmplib/Makefile.in, testing/Makefile.in:
+
+ rework VPATH so people with GNU make can share a source directory for multiple
+ build (including one in the source directory); completely rework CPPFLAGS for a
+ common, consistent order (that is also correct for non sourcedir builds)
+
+2004-04-01 18:26 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable.h:
+
+ new file
+
+2004-04-01 18:15 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/:
+ default-table-ipCidrRouteTable.m2d, ipCidrRouteTable.c
+, ipCidrRouteTable.h, ipCidrRouteTable_data_access.c
+, ipCidrRouteTable_data_access.h,
+ ipCidrRouteTable_interface.c, ipCidrRouteTable_interface.h
+:
+
+ update for mfd generated code changes; update to use new data access stuff;
+
+2004-04-01 18:10 rstory
+
+ * agent/mibgroup/if-mib/ifTable/ifTable_data_access.c:
+
+ update to use new data access stuff; add todo comments
+
+2004-04-01 18:10 rstory
+
+ * agent/mibgroup/: if-mib/data_access/.cvsignore,
+ if-mib/ifTable/.cvsignore, if-mib/ifXTable/.cvsignore
+, ip-forward-mib/data_access/.cvsignore,
+ ip-forward-mib/ipCidrRouteTable/.cvsignore:
+
+ new cvsingore files
+
+2004-04-01 18:07 rstory
+
+ * agent/mibgroup/if-mib/: ifTable/ifTable.c,
+ ifTable/ifTable.h, ifXTable/ifXTable.h:
+
+ update to use new data access stuff
+
+2004-04-01 18:04 rstory
+
+ * agent/mibgroup/: if-mib/data_access/interface.h,
+ if-mib/data_access/interface_common.c,
+ if-mib/data_access/interface_linux.c,
+ ip-forward-mib/data_access/route.h,
+ ip-forward-mib/data_access/route_common.c,
+ ip-forward-mib/data_access/route_linux.c:
+
+ new data access files
+
+2004-04-01 18:00 rstory
+
+ * include/net-snmp/data_access/: interface.h, route.h:
+
+ move config_require stuff back into mibgroup, since that's the only place
+ configure will look for them
+
+2004-04-01 16:58 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Remove duplicate coloid setting (was done above as well)
+
+2004-04-01 16:54 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Another iterator fix: initialize a variable properly for every request
+
+2004-04-01 16:21 rstory
+
+ * include/net-snmp/data_access/: interface.h, route.h:
+
+ new data access headers
+
+2004-04-01 15:52 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Another iterator problem with getbulk's: make it not set RETRY if its going to be out of scope next time around still (> maxcol)
+
+2004-04-01 09:18 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ - Various patches to fix iterator problems with multiple varbinds.
+
+2004-03-31 12:13 hardaker
+
+ * agent/helpers/cache_handler.c:
+
+ Properly set the auto_next flag.
+
+2004-03-30 21:22 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ A new implementation of gettable that uses better structured GETNEXT
+ packets for faster retrieval across slow links.
+ - getbulk not yet used, but should be.
+
+2004-03-30 21:19 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ - minor changes to the cvs2cl command line flags
+
+2004-03-30 21:16 hardaker
+
+ * agent/mibgroup/host/: hr_system.c, hr_system.h:
+
+ change set_solaris_time to ns_set_time and enable it on any
+ architecture that supports mktime() and stime()
+
+2004-03-30 21:15 hardaker
+
+ * configure, configure.in:
+
+ check for stime functions
+
+2004-03-30 21:14 hardaker
+
+ * acconfig.h:
+
+ - undef ssize_t
+
+2004-03-30 17:06 slif
+
+ * snmplib/snmp_logging.c:
+
+ remove commented and unused variables. flag static variable as problem for threads.
+
+2004-03-30 16:56 slif
+
+ * win32/install-net-snmp.bat:
+
+ mildly enforce running from base source directory.
+
+2004-03-30 16:53 slif
+
+ * win32/mib_module_includes.h:
+
+ init examples modules
+
+2004-03-30 10:45 hardaker
+
+ * perl/SNMP/t/mib.t:
+
+ include previously-broken tests again
+
+2004-03-30 10:41 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Fix a really old and annoying bug: use set_boolean instead of toggle_boolean for telling the library when to replace old MIBs while parsing. Affected a bunch of stuff in odd ways.
+
+2004-03-30 05:01 dts12
+
+ * include/net-snmp/library/snmp_logging.h,
+ snmplib/snmp_logging.c:
+
+ New logging option '-Ln' to explicitly turn off logging
+
+2004-03-29 20:20 rstory
+
+ * agent/mibgroup/: if-mib.h, ip-forward-mib.h:
+
+ config-require headers
+
+2004-03-29 20:18 rstory
+
+ * agent/mibgroup/if-mib/: ifTable/default-table-ifTable.m2d,
+ ifTable/ifTable.c, ifTable/ifTable.h,
+ ifTable/ifTable_constants.h, ifTable/ifTable_data_access.c
+, ifTable/ifTable_data_access.h,
+ ifTable/ifTable_interface.c, ifTable/ifTable_interface.h
+, ifXTable/default-table-ifXTable.m2d,
+ ifXTable/ifXTable.c, ifXTable/ifXTable.h,
+ ifXTable/ifXTable_constants.h,
+ ifXTable/ifXTable_data_access.c,
+ ifXTable/ifXTable_data_access.h,
+ ifXTable/ifXTable_interface.c,
+ ifXTable/ifXTable_interface.h:
+
+ new implementations of ifTable and ifXTable, based on generated code from
+ mib2c MFD + container-cached conf files
+
+2004-03-29 16:28 slif
+
+ * perl/SNMP/SNMP.pm:
+
+ fix spell Acknowledgements, add blank before =cut so that it will be parsed correctly.
+
+2004-03-29 15:40 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ use unused vars
+
+2004-03-29 15:40 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ tweak comment
+
+2004-03-29 15:39 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ slight re-org; include (commented out) gnu make stuff
+
+2004-03-29 15:37 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ rework data_context so we don't use a typedef to a pointer
+ (e.g. typedef x* x_data); use unused vars; allow user to pass existing data
+ ptr when creating row context; set val_len to buf size iff not already set
+
+2004-03-29 15:33 rstory
+
+ * local/mib2c-conf.d/: mfd-data-access.m2c, mfd-data-get.m2c
+:
+
+ move table index functions to data-get; include data_access header
+
+2004-03-29 15:31 rstory
+
+ * local/mib2c-conf.d/: mfd-access-container-cached-defines.m2i
+, mfd-access-unsorted-external-defines.m2i:
+
+ rework data_context so we don't use a typedef to a pointer
+ (e.g. typedef x* x_data); tweak m2c_procesing type; remove unused var
+
+2004-03-29 15:28 rstory
+
+ * local/mib2c-conf.d/generic-table-constants.m2c:
+
+ tweak m2c_processing_type
+
+2004-03-29 15:26 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ rework data_context so we don't use a typedef to a pointer
+ (e.g. typedef x* x_data); include mib_modules header; tweak m2c_processing_type
+
+2004-03-29 15:25 rstory
+
+ * local/mib2c-conf.d/: generic-data-allocate.m2i,
+ generic-data-context.m2i, m2c_setup_table.m2i:
+
+ rework data_context so we don't use a typedef to a pointer
+ (e.g. typedef x* x_data)
+
+2004-03-29 14:26 hardaker
+
+ * snmplib/mib.c:
+
+ make parse_one_oid_index properly decode IP addresses in the right byte order.
+
+2004-03-29 12:58 slif
+
+ * win32/mib_module_inits.h:
+
+ init examples modules
+
+2004-03-29 09:19 slif
+
+ * testing/tests/: T110agentxget, T111agentxset,
+ T112agentxsetfail, T113agentxtrap:
+
+ patch [918838] test agentx using TCP sockets - iff transport not "unix"
+
+2004-03-29 07:54 rstory
+
+ * apps/snmptrapd.c:
+
+ sync w/5.1.1 (move var decls to top of functional block)
+
+2004-03-26 08:41 slif
+
+ * testing/eval_tools.sh:
+
+ apply patch #920234 to start programs in minimized window (mingw only).
+
+2004-03-26 08:03 slif
+
+ * win32/build.pl:
+
+ patch to fix [921423] install test sequence not right for perl build
+
+2004-03-26 07:53 slif
+
+ * configure.in:
+
+ patch #901434 tosock2.sh -- use Winsock 2.x for Windows socket library
+
+2004-03-22 15:37 rstory
+
+ * dist/cvsup:
+
+ fix path for cleanup of uploaded tarball
+
+2004-03-22 13:44 hardaker
+
+ * man/: Makefile.in, make_index.pl, man_sections.txt
+:
+
+ man/index.html generation stuff
+
+2004-03-20 21:43 hardaker
+
+ * man/Makefile.in:
+
+ newer man2html usage
+
+2004-03-20 10:02 slif
+
+ * testing/eval_onescript.sh:
+
+ patch [919132] test stop before finish is superfluous
+
+2004-03-19 16:18 hardaker
+
+ * configure.in:
+
+ Part of patch 917726 to fix a few windows config problems.
+
+2004-03-19 16:01 hardaker
+
+ * testing/tests/T100agenthup:
+
+ Patch from Michael Slifcak: [ 918828 ] conditional skip HUP test
+
+2004-03-19 15:58 hardaker
+
+ * configure.in, include/net-snmp/net-snmp-config.h.in
+:
+
+ Patch from Michael Slifcak: [ 918948 ] fix cygwin config problem
+
+2004-03-19 08:29 hardaker
+
+ * include/net-snmp/agent/watcher.h:
+
+ Added a missing prototype: netsnmp_register_watched_spinlock
+
+2004-03-19 08:23 hardaker
+
+ * snmplib/snmpv3.c:
+
+ Missed a AES128 -> AES conversion.
+
+2004-03-19 03:00 dts12
+
+ * README.win32:
+
+ Brief description of adding Win32 IPv6 transport support.
+
+2004-03-18 18:32 slif
+
+ * testing/eval_tools.sh:
+
+ patch [919116] minor diff in invoked log
+
+2004-03-18 15:44 slif
+
+ * testing/eval_tools.sh:
+
+ apply patch_915178.redux to finish the second part of that patch.
+
+2004-03-18 08:51 slif
+
+ * testing/tests/: T120proxyget, T121proxyset,
+ T122proxysetfail:
+
+ apply patch [918824] fix proxy tests
+
+2004-03-18 07:05 slif
+
+ * include/net-snmp/system/: cygwin.h, mingw32.h:
+
+ patch [917649] find uint32_t in win32-gcc build environments
+
+2004-03-16 13:05 rstory
+
+ * snmplib/Makefile.in:
+
+ merge configure substituted srs/obs def w/previous line, to avoid having a
+ continuation line followed by a blank line;
+ fixes for building outside of source dir (reorder include in CPPFLAGS so that
+ relative dirs come before srcdirs)
+
+2004-03-16 07:49 slif
+
+ * win32/: build.bat, build.pl:
+
+ synch with working version, delta install base, of course.
+
+2004-03-16 06:53 slif
+
+ * win32/net-snmp/: net-snmp-config.h, net-snmp-config.h.in
+:
+
+ add typedef for uint32_t -- absent from MSVS
+
+2004-03-16 05:15 slif
+
+ * win32/: Makefile.in, install-net-snmp.bat:
+
+ partial fix for bug 915178: adjust to accommodate 'make test' verification.
+
+2004-03-15 16:42 hardaker
+
+ * testing/tests/T151solarishostdisk:
+
+ Patch from Bruce Shaw: [ 894711 ] Solaris disk test fails on some OS's [second fix to his previous patch for even better support]
+
+2004-03-15 15:56 hardaker
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ Bug/patch from Bob Rowlands: [ 815361 ] override token in snmpd.conf does not allow snmpset on OID [really, this just returns proper error codes from system_mib variables]
+
+2004-03-15 15:52 hardaker
+
+ * agent/snmp_agent.c:
+
+ Bug/patch from Bob Rowlands: [ 815333 ] snmpvacm app not working with SNMP v1 [ really just fixing mib error codes remembered in snmp_agent.c]
+
+2004-03-15 15:43 hardaker
+
+ * agent/helpers/mode_end_call.c:
+
+ Bug/Patch from Bob Rowlands: [ 809282 ] netsnmp_mode_end_call_add_mode_callback called repeatedly
+
+2004-03-15 15:36 hardaker
+
+ * snmplib/snmpusm.c:
+
+ Patch from Bob Rowlands: [ 808881 ] Log a authentication failure message when authentication fails.
+
+2004-03-15 15:27 hardaker
+
+ * agent/snmp_vars.c, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c,
+ include/net-snmp/agent/snmp_vars.h:
+
+ Patch from Bob Rowlands: [ 807333 ] 64 bit agent returns incorrect values for IpAddress
+
+2004-03-15 14:18 rstory
+
+ * agent/mibgroup/ip-forward-mib/ipCidrRouteTable/:
+ default-table-ipCidrRouteTable.m2d, ipCidrRouteTable.c
+, ipCidrRouteTable.h, ipCidrRouteTable_constants.h
+, ipCidrRouteTable_data_access.c,
+ ipCidrRouteTable_data_access.h,
+ ipCidrRouteTable_interface.c, ipCidrRouteTable_interface.h
+:
+
+ re-implement existing ipCidrRouteTable functionality w/MFD helper
+ (i.e. read-only support; use var_route function to get data)
+
+2004-03-15 12:10 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ tweaks for row-creation case
+
+2004-03-15 12:08 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ default to inconsistentName instead of noCreation
+
+2004-03-15 06:27 dts12
+
+ * win32/build.pl:
+
+ Tweak the option prompt slightly.
+ (Dave's being picky again!)
+
+2004-03-15 06:20 dts12
+
+ * apps/snmptrapd.c:
+
+ Listen on port 162 (rather than 161) if a (bare) interface
+ address is specified.
+
+2004-03-13 22:05 rstory
+
+ * agent/helpers/table_array.c:
+
+ null free'd pointer (better safe than sorry)
+
+2004-03-13 21:59 rstory
+
+ * agent/helpers/table_array.c:
+
+ plug memory leak
+
+2004-03-13 19:21 rstory
+
+ * agent/mibgroup/mibII/mibII_common.h:
+
+ fix for compiling w/dmalloc
+
+2004-03-13 06:40 slif
+
+ * win32/build.bat:
+
+ set temp var empty to remove from env
+
+2004-03-12 15:52 slif
+
+ * win32/net-snmp/net-snmp-config.h.in:
+
+ clean up base poop.
+
+2004-03-12 13:07 slif
+
+ * README.win32, win32/build.bat:
+
+ doc change for patch 912447
+
+2004-03-12 12:13 slif
+
+ * testing/: RUNTESTS, eval_tools.sh:
+
+ apply patch[915178] to fix MinGW (MSYS) make test freezes
+
+2004-03-12 11:29 slif
+
+ * win32/: Makefile-apps.in, libsnmp_dll/Makefile.in,
+ net-snmp/net-snmp-config.h.in, snmpd/Makefile.in,
+ snmpdsdk/Makefile.in, snmpnetstat/Makefile.in,
+ snmptrapd/Makefile.in:
+
+ modify patch[912447] to use correct winsock library
+
+2004-03-12 11:16 slif
+
+ * win32/: Configure, Makefile-apps.in, Makefile.in
+, build.bat, build.pl, libagent/Makefile.in
+, libhelpers/Makefile.in, libsnmp/Makefile.in,
+ libsnmp_dll/Makefile.in, net-snmp/net-snmp-config.h.in
+, netsnmpmibs/Makefile.in, netsnmpmibssdk/Makefile.in
+, snmpd/Makefile.in, snmpdsdk/Makefile.in,
+ snmpnetstat/Makefile.in, snmptrapd/Makefile.in:
+
+ apply patch [912447] Win32 MSVC Makefile system
+
+2004-03-10 19:24 slif
+
+ * testing/RUNTESTS:
+
+ aggressive search for executables below the base directory.
+
+2004-03-10 19:15 slif
+
+ * README.win32, win32/net-snmp/net-snmp-config.h:
+
+ don't set global snmp_errno; do provide undef USE_OPENSSL;
+ replace NETSNMP_NO_DLL with NETSNMP_USE_DLL;
+ document the change.
+
+2004-03-10 19:09 slif
+
+ * testing/eval_tools.sh:
+
+ invoke snmpd, snmptrapd with non-deprecated parameters for PID and logfile.
+
+2004-03-10 15:09 slif
+
+ * snmplib/scapi.c:
+
+ fix signed mismatch when testing proper length of keyed hash.
+
+2004-03-10 15:03 slif
+
+ * README.win32, win32/net-snmp/net-snmp-config.h:
+
+ mods for building win32 with OpenSSL support.
+
+2004-03-10 08:23 slif
+
+ * README.win32:
+
+ per AlexB - change instructions to use MinGW developer's recommended OpenSSL.
+
+2004-03-10 07:21 dts12
+
+ * perl/SNMP/t/startagent.pl:
+
+ Use the same testing ports as the main agent test suite
+ (somewhat less likely to clash with other services)
+
+2004-03-10 07:08 dts12
+
+ * man/snmpd.8.def:
+
+ Document support for multiple "optional" config files via -c
+
+2004-03-10 05:01 dts12
+
+ * agent/helpers/table.c:
+
+ Retry unfulfilled GETNEXT requests that simply haven't been attempted
+ (e.g. due to a missing column object), but not ones that have been
+ explicitly marked as failed (e.g. at the end of the table).
+
+ I'm not 100% convinced this is correct, but it seems to have the
+ right effect for both 'table_data' and 'table_dataset' based modules.
+
+2004-03-10 04:52 dts12
+
+ * agent/helpers/table_data.c:
+
+ Check for problems with all of the requested varbinds
+ (not just the first one), and handle 'noSuchObject' exceptions.
+ [Though in fact, this code isn't actually used]
+
+2004-03-09 12:50 rstory
+
+ * configure:
+
+ update to match new configure.in
+
+2004-03-09 11:34 rstory
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ debugging isn't platform specific
+
+2004-03-09 07:55 rstory
+
+ * configure.in, apps/Makefile.in:
+
+ separate traplibs from agent libs for dependencies
+
+2004-03-09 07:12 slif
+
+ * win32/install-net-snmp.bat:
+
+ make SNMPCONFPATH consistent with other platforms ("$prefix/etc/snmp")
+
+2004-03-09 07:09 slif
+
+ * snmplib/: snmp_api.c, snmp_client.c:
+
+ add comment MTCRITICAL_RESOURCE to use of snmp_errno in three places.
+
+2004-03-09 05:10 dts12
+
+ * snmplib/read_config.c:
+
+ Handle multiple "optional config" files.
+
+2004-03-09 04:24 slif
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ make SNMPCONFPATH consistent with other platforms ("$prefix/etc/snmp")
+
+2004-03-08 20:26 rstory
+
+ * README.aix:
+
+ new file
+
+2004-03-08 17:53 slif
+
+ * README.win32, perl/SNMP/README:
+
+ patch [911439] Updates to the README.win32 and SNMP README for Win32
+
+2004-03-08 16:14 hardaker
+
+ * apps/notification_log.c:
+
+ ifdef out routines that only available when agentx is going to be used.
+
+2004-03-08 16:09 rstory
+
+ * apps/Makefile.in:
+
+ use app libs for snmptrapd when agent disabled; move wraplib substitution to
+ a more reasonable place. snmptrapd still doesn't link, but it's closer...
+
+2004-03-08 14:38 rstory
+
+ * configure:
+
+ new configure for new configure.in
+
+2004-03-08 14:37 rstory
+
+ * configure.in:
+
+ add comments in hairy agent module processing; don't munge default mibs until
+ we are don't building it; tweaks for --disable-agent: use same default mibset
+ as --enable-mini-agent, don't to hairy agent module processing
+
+2004-03-08 13:24 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ Fix syntax errors.
+
+2004-03-08 12:42 slif
+
+ * agent/helpers/cache_handler.c:
+
+ remove unused local var cache_timeout
+
+2004-03-08 12:41 slif
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ use quotes to search local include paths for perl_snmptrapd.h
+
+2004-03-08 11:43 slif
+
+ * README.win32:
+
+ patch [910903] Updates to the README.win32 for GCC
+
+2004-03-08 09:37 hardaker
+
+ * perl/TrapReceiver/TrapReceiver.xs:
+
+ Patch from Andrew Hood to include proper headers and {} wrap perl special declrs
+
+2004-03-08 08:51 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ use default library values instead of hard-coded defaults for auth/priv protocols
+
+2004-03-06 19:23 rstory
+
+ * include/net-snmp/agent/table.h:
+
+ remove duplicate prototype
+
+2004-03-06 19:17 rstory
+
+ * local/mib2c-update:
+
+ tweak pattern for new doxygen conf files
+
+2004-03-06 19:16 rstory
+
+ * include/net-snmp/agent/table.h:
+
+ add prototype to get sparse table mib handler, netsnmp_table_next_column;
+ rename netsnmp_register_sparse_table to netsnmp_sparse_table_register; add
+ netsnmp_sparse_table_handler_get
+
+2004-03-06 19:12 rstory
+
+ * agent/helpers/table.c:
+
+ make sparse table helper static; add method to get sparse table mib handler;
+ warn if sparse table handler has a next pointer. use new handler custom bit
+ to only log once, if possible.
+
+2004-03-06 18:47 rstory
+
+ * include/net-snmp/agent/agent_handler.h:
+
+ reserver last 4 bits of flag for handler use
+
+2004-03-06 17:12 rstory
+
+ * local/mib2c-conf.d/: mfd-doxygen.m2c, mfd-top.m2c:
+
+ generate simply doxygen.conf file
+
+2004-03-05 21:48 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ Fixed the add_row token by sorting incoming columns from the parser
+
+2004-03-05 17:03 rstory
+
+ * local/mib2c-conf.d/mfd-readme.m2c:
+
+ updates from older changes; still slightly out of date
+
+2004-03-05 17:02 rstory
+
+ * local/mib2c-update:
+
+ don't recurse on diff; cp defaults instead of moving
+
+2004-03-05 17:01 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ new var for param calls by val
+
+2004-03-05 17:00 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ fix evaluation problem in generated default file
+
+2004-03-05 16:59 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i
+:
+
+ tweaks to comments for better doxygen docs; use multiple passes to keep header
+ and source in same include; move indexes_set, init_data into data_access.m2c
+
+2004-03-05 16:58 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i:
+
+ tweaks to comments for better doxygen docs; use multiple passes to keep header
+ and source in same include; add example code; move as much cache stuff as
+ possible into interface
+
+2004-03-05 16:56 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-set.m2i:
+
+ tweaks to comments for better doxygen docs; use multiple passes to keep header
+ and source in same include; break set_indexes into 2 pieces
+
+2004-03-05 16:55 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ tweaks to comments for better doxygen docs; use multiple passes to keep header
+ and source in same include; re-add pre/post; define MFD return code here, since
+ table_mfd no longer exists;
+
+2004-03-05 16:53 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ fix syntax error
+
+2004-03-05 16:53 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ tweaks to comments for better doxygen docs; use multiple passes to keep header
+ and source in same include; re-add pre/post wrapper; call new row_prep
+
+2004-03-05 16:51 rstory
+
+ * local/mib2c-conf.d/: mfd-data-get.m2c, mfd-data-set.m2c
+:
+
+ tweaks to comments for better doxygen docs; use multiple passes to keep header
+ and source in same include
+
+2004-03-05 16:51 rstory
+
+ * local/mib2c-conf.d/mfd-data-access.m2c:
+
+ tweaks to comments for better doxygen docs; use multiple passes to keep header
+ and source in same include; mov init_data here; add row_prep
+
+2004-03-05 16:48 rstory
+
+ * local/mib2c-conf.d/: generic-table-indexes-from-oid.m2i,
+ generic-value-map-func.m2i, node-get.m2i,
+ node-set.m2i, parent-set.m2i:
+
+ tweaks to comments for better doxygen docs; use multiple passes to keep header
+ and souce in same include
+
+2004-03-05 16:44 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ add flags; add expired; only use default timeout when cache created;
+
+2004-03-05 16:42 hardaker
+
+ * snmplib/mib.c:
+
+ have mib_to_asn_type return ASN_UNSIGNED instead of ASN_UINTEGER,
+ which is the proper data type.
+
+2004-03-05 16:41 hardaker
+
+ * agent/helpers/table_data.c:
+
+ Remove the sparse table registration and register it as a normal table.
+ 1) the higher table handler always calls the sparse table handler
+ anyway, so it would be redundant even if it did work.
+ 2) The sparse table handler doesn't call any children, and doesn't
+ set the autonext flag so its alway the end of the line (this took
+ me an hour to find).
+
+2004-03-05 16:40 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ change the help information for add_row to mention that you need the
+ table name you want to add the data to.
+
+2004-03-05 14:58 hardaker
+
+ * agent/: agent_registry.c, snmp_agent.c:
+
+ Fix the oid registration cache not being invalidated properly. Bug #900967
+
+2004-03-05 11:29 slif
+
+ * apps/snmptrapd.c:
+
+ fix [706093] by not defining variables a second time.
+
+2004-03-05 10:03 slif
+
+ * perl/TrapReceiver/MANIFEST:
+
+ quell manifest check errors (makefile, pm_to_blib, .c file).
+
+2004-03-05 10:03 slif
+
+ * include/net-snmp/library/snmp_impl.h:
+
+ use of SET_SNMP_ERRNO requires -- enable DLL decoration for snmp_errno
+
+2004-03-05 10:02 slif
+
+ * include/net-snmp/agent/table.h:
+
+ add missing declaration for netsnmp_table_next_column
+
+2004-03-05 10:00 slif
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ add symbol usmAESPrivProtocol
+
+2004-03-05 08:23 rstory
+
+ * include/net-snmp/library/snmp-tc.h:
+
+ fix macro name, as noted on users
+
+2004-03-05 05:51 slif
+
+ * agent/mibgroup/ucd-snmp/file.c:
+
+ remove unused var 'space'
+
+2004-03-05 05:30 slif
+
+ * configure.in, snmplib/system.c,
+ win32/encode_keychange/encode_keychange.dsp,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp, win32/snmpd/snmpd.dsp
+, win32/snmpdelta/snmpdelta.dsp,
+ win32/snmpdf/snmpdf.dsp, win32/snmpdsdk/snmpd.dsp,
+ win32/snmpget/snmpget.dsp,
+ win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpnetstat/snmpnetstat.dsp,
+ win32/snmpset/snmpset.dsp, win32/snmpstatus/snmpstatus.dsp
+, win32/snmptable/snmptable.dsp,
+ win32/snmptest/snmptest.dsp,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrapd/snmptrapd.dsp
+, win32/snmpusm/snmpusm.dsp,
+ win32/snmpvacm/snmpvacm.dsp, win32/snmpwalk/snmpwalk.dsp
+, configure:
+
+ patch [901434] apply useWinsock2.sh [undo by using useWinsock1.sh]
+
+2004-03-04 22:27 hardaker
+
+ * agent/helpers/all_helpers.c:
+
+ initialize the table_dataset helper (again... I *know* it was initialized in the past. What happened?)
+
+2004-03-04 22:05 rstory
+
+ * agent/snmp_agent.c:
+
+ turn off caching until real fix found for bug 900967: agentx, caching
+
+2004-03-04 20:28 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ *finally* fix agentx hang when master disappears
+
+2004-03-04 15:41 rstory
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ fix execfix for relocatable execs; add fix cmd to relocatable tree
+
+2004-03-04 09:45 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ minor wording changes about version number changing
+
+2004-03-04 09:43 hardaker
+
+ * configure, configure.in, apps/Makefile.in:
+
+ - fix building trapd when the agent isn't being built
+
+2004-03-04 09:12 hardaker
+
+ * perl/TrapReceiver/Makefile.PL:
+
+ update to the way we normally do perl Makefiles, which is not normal.
+
+2004-03-04 08:53 hardaker
+
+ * perl/: OID/OID.xs, TrapReceiver/TrapReceiver.xs,
+ agent/agent.xs:
+
+ - convert fprintf(stderr to snmp_log(LOG_ERR
+
+2004-03-04 08:48 rstory
+
+ * agent/helpers/null.c:
+
+ fix syntax errors
+
+2004-03-04 05:39 slif
+
+ * configure.in, snmplib/Makefile.in, configure
+:
+
+ patch [909459] Configure patch to allow for Win32 objects.
+
+2004-03-03 22:11 slif
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ change "progra~1" to "Program Files" to avoid problem with DOS name warping.
+
+2004-03-03 21:22 slif
+
+ * perl/: Makefile.PL, Makefile.subs.pl, ASN/Makefile.PL
+, OID/Makefile.PL, SNMP/Makefile.PL,
+ SNMP/README, agent/Makefile.PL,
+ agent/default_store/Makefile.PL, default_store/Makefile.PL
+:
+
+ patch [906274] Win32 Perl compile with release/debug path changes
+
+2004-03-03 14:15 rstory
+
+ * agent/helpers/null.c:
+
+ specify mode in reginfo
+
+2004-03-03 13:05 hardaker
+
+ * agent/mibgroup/ucd-snmp/: file.c, file.h:
+
+ - make the file token accept a default size like the docs say it will.
+
+2004-03-03 12:07 rstory
+
+ * snmplib/snmp_api.c:
+
+ comment out pdu double free check til better (non-leaking) solution found
+
+2004-03-03 08:56 rstory
+
+ * man/: Makefile.in, netsnmp_mfd_pdu_context_s.3:
+
+ remove man page for removed structure
+
+2004-03-03 08:52 rstory
+
+ * local/mib2c-update:
+
+ new utility to regenerate mib2c code, preserving existing customizations
+
+2004-03-03 07:52 slif
+
+ * win32/libhelpers/libhelpers.dsp:
+
+ table_mfd removed -- dont build it.
+
+2004-03-03 07:46 slif
+
+ * win32/: install-net-snmp.bat, nmakeperl.bat:
+
+ per AlexB - add "-help" descriptions. create BASE/temp subdir.
+
+2004-03-02 13:45 slif
+
+ * agent/snmpd.c:
+
+ patch [753894] catch SIGXFSZ w/o strsignal
+
+2004-03-02 12:56 rstory
+
+ * local/mib2c.mfd.conf:
+
+ top level mfd conf file
+
+2004-03-02 04:18 slif
+
+ * agent/snmpd.c:
+
+ patch [753894] catch SIGXFSZ, log message and exit, do not coredump
+
+2004-03-02 04:06 slif
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ fix [771315] Agent coredumps during shutdown
+
+2004-03-01 21:09 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ PC police - tone down error message
+
+2004-03-01 21:05 rstory
+
+ * agent/mibgroup/agent/nsCache.c:
+
+ change globals to use functions to access cache_handler vars, or use new
+ datastore values
+
+2004-03-01 21:03 rstory
+
+ * include/net-snmp/library/container_binary_array.h:
+
+ fix typo in comment; remove noalloc prototype
+
+2004-03-01 21:01 rstory
+
+ * include/net-snmp/agent/ds_agent.h:
+
+ fix typo in comment; add NO_CACHING and CACHE_TIMEOUT
+
+2004-03-01 21:00 rstory
+
+ * agent/helpers/baby_steps.c,
+ include/net-snmp/agent/baby_steps.h:
+
+ new baby_steps access multiplexer handler; make actual helper routines static;
+ rename functions, defines for backwards compatability
+
+2004-03-01 20:53 rstory
+
+ * agent/snmp_vars.c:
+
+ protect against multiple calls to init_agent
+
+2004-03-01 20:52 rstory
+
+ * agent/snmpd.c:
+
+ set default agent cache timeout; debug msg for errno on select error
+
+2004-03-01 20:51 rstory
+
+ * agent/snmp_agent.c:
+
+ merge common case in switch
+
+2004-03-01 20:50 rstory
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ replace globals w/local static + access function; use datastore for caching
+ enabled, cache timeout; test cache_free for NULL before calling it; don't
+ use goto; use new auto-next functionality to call child handlers; new
+ cache_create, cache_handler_register, cache_find_by_oid; don't reload cache
+ more than once per request; note possibility of cache being free'd mid-
+ request for delegated requests, w/proposed solution
+
+2004-03-01 20:19 rstory
+
+ * agent/mibgroup/mibII/: ifTable.c, ifTable.h:
+
+ switch from iterator to new table_container handler.
+
+2004-03-01 19:55 rstory
+
+ * agent/mibgroup/mibII/ifTable.c:
+
+ run through indent
+
+2004-03-01 06:06 slif
+
+ * perl/SNMP/t/bulkwalk.t:
+
+ undo patch at r5.3 -- restore (16) in test to get only non-repeaters
+
+2004-02-29 21:13 rstory
+
+ * agent/helpers/table_container.c:
+
+ move netsnmp_table_index_find_next_row here from table.c
+
+2004-02-29 21:12 rstory
+
+ * include/net-snmp/agent/all_helpers.h:
+
+ add table_container; remove table_mfd
+
+2004-02-29 21:07 rstory
+
+ * agent/Makefile.depend, agent/mibgroup/Makefile.depend
+, apps/Makefile.depend:
+
+ remove mfd dependencies
+
+2004-02-29 20:54 rstory
+
+ * agent/agent_handler.c,
+ include/net-snmp/agent/agent_handler.h:
+
+ add flags field to mib handler structure; new handler AUTO_NEXT flags for
+ handlers that don't want to bother with calling sub-handlers (also reduces
+ stack depth); new netsnmp_handler_registration_create which resigers existing
+ handler; log warning for handlers registering w/no modes; handle injection to a
+ registration w/out a handler; new modes HANDLER_CAN_NOT_CREATE,
+ HANDLER_CAN_SET_ONLY; or in HANDLER_CAN_NOT_CREATE w/ DEFAULT; add void pointer
+ to handler registration
+
+2004-02-29 20:39 rstory
+
+ * agent/helpers/Makefile.depend:
+
+ remove table_mfd.h dependencies
+
+2004-02-29 20:24 rstory
+
+ * agent/helpers/table.c:
+
+ sync closest_column w/fixes in 5-1-patches; check for existing tbl_req_info in
+ requests; call sparse table handler after normal table processing; move
+ netsnmp_table_index_find_next_row to table_container.c
+
+2004-02-29 17:14 rstory
+
+ * include/net-snmp/agent/table_container.h:
+
+ prototype for handler get; make inline func static inline
+
+2004-02-29 17:13 rstory
+
+ * agent/helpers/Makefile.in:
+
+ out w/the old, in w/the new (remove mfd helper, add table_container)
+
+2004-02-29 17:11 rstory
+
+ * agent/helpers/table_mfd.c,
+ include/net-snmp/agent/table_mfd.h:
+
+ remove mfd helper; mfd conf files now user new table_container helper
+
+2004-02-29 17:06 rstory
+
+ * agent/helpers/table_container.c:
+
+ remove grouping option (user can use row_merge instead); new function go get
+ handler w/out register; break complex condition into simpler conditionals so
+ breakpoints can be set on condition; don't call lower handlers if no requests
+ need processing
+
+2004-02-29 17:01 rstory
+
+ * snmplib/: container_iterator.c, container_list_ssll.c
+, container_null.c:
+
+ add support for container clear
+
+2004-02-29 16:33 rstory
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ enable dlmod support if HAVE_LIBDL
+
+2004-02-29 16:25 rstory
+
+ * snmplib/snmp_api.c:
+
+ catch bad size for fixed size types
+
+2004-02-29 16:20 rstory
+
+ * snmplib/container_binary_array.c:
+
+ new function to support CONTAINER_CLEAR; make some functions static inline
+
+2004-02-29 16:14 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ fix insert/remove/free inlines to properly deal with multiple indexes; add new
+ CONTAINER_CLEAR macro/callback; add notes on freeing returned array from
+ get_subset
+
+2004-02-29 16:05 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ use mfd error instead of snmp error
+
+2004-02-29 16:05 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ setup size names before including generic file
+
+2004-02-29 16:04 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ remove extraneous end; add comments
+
+2004-02-29 16:01 rstory
+
+ * local/mib2c-conf.d/subagent.m2c:
+
+ add exit() call
+
+2004-02-29 16:00 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ tweaks to support new generate fewer files flag
+
+2004-02-29 15:58 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ tweaks to support new generate fewer files flag; use gloabl table oid/size var;
+ switch mfd wrapper functions to use standard new api parameters; new optional
+ cache; use two new helpers: netsnmp_baby_steps_access_multiplexer and
+ netsnmp_container_table_handler; look for data/put created row data in request
+ ala container table handler for lower handlers; tweaks for using new single
+ file access methods
+
+2004-02-29 15:52 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ tweaks to support new generate fewer files flag; make table oid/size a global
+ var; switch mfd wrapper functions to use standard new api parameters
+
+2004-02-29 15:49 rstory
+
+ * local/mib2c-conf.d/: mfd-data-get.m2c, mfd-data-set.m2c
+:
+
+ use report progress flag; tweaks to support new generate fewer files flag
+
+2004-02-29 15:30 rstory
+
+ * local/mib2c-conf.d/mfd-data-access.m2c:
+
+ tweaks to use new single file access methods (processing type flag)
+
+2004-02-29 15:28 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ test new flag for less verbose output; document transient values in comments
+ and generated table default file; make sure mfd defaults have been processed
+
+2004-02-29 15:19 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ default to no mapping, except for nodes w/enums; use param names for node
+ names; properly escape len var name
+
+2004-02-29 15:05 rstory
+
+ * local/mib2c-conf.d/generic-value-map.m2i:
+
+ tweak order of testing conditionals
+
+2004-02-29 15:03 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-set.m2i:
+
+ comment tweaks; make sure to clear tmp var before use
+
+2004-02-29 15:02 rstory
+
+ * local/mib2c-conf.d/: generic-table-enums.m2c,
+ generic-table-oids.m2c:
+
+ tweaks to support generating fewer files
+
+2004-02-29 15:01 rstory
+
+ * local/mib2c-conf.d/generic-table-constants.m2c:
+
+ new file to generate combined oid/enum header
+
+2004-02-29 14:59 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ init new flag for creating fewer files; init new flag for processing parts
+ of files (until I can figure out if I can convert to new define/calldefine)
+
+2004-02-29 14:55 rstory
+
+ * local/mib2c-conf.d/mfd-access-container-cached-defines.m2i:
+
+ new access method defines
+
+2004-02-29 14:54 rstory
+
+ * local/mib2c-conf.d/: mfd-access-unsorted-external-body.m2i
+, mfd-access-unsorted-external-header.m2i,
+ mfd-access-unsorted-external-interface.m2i,
+ mfd-access-unsorted-external-readme.m2i,
+ mfd-access-unsorted-external-setup.m2i:
+
+ remove files (merged int mfd-access-undorted-external-defines.m2i)
+
+2004-02-29 14:53 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i
+:
+
+ merge multiple access files into one file
+
+2004-02-27 22:32 hardaker
+
+ * agent/snmp_agent.c:
+
+ - fix the case where incoming getbulks with no repeating varbinds is received.
+
+2004-02-27 15:04 slif
+
+ * include/net-snmp/system/mingw32.h, perl/Makefile.PL,
+ perl/ASN/Makefile.PL, perl/OID/Makefile.PL,
+ perl/SNMP/Makefile.PL, perl/agent/Makefile.PL,
+ perl/agent/default_store/Makefile.PL,
+ perl/default_store/Makefile.PL:
+
+ patch [ 905465 ] MinGW Perl module compiling with ActiveState Perl
+
+2004-02-27 07:18 slif
+
+ * perl/SNMP/Makefile.PL:
+
+ construct install tree similar to install tree that gcc builds use.
+
+2004-02-27 06:05 slif
+
+ * win32/install-net-snmp.bat:
+
+ build MSVS release and debug versions having the same name.
+
+2004-02-27 05:42 slif
+
+ * win32/: encode_keychange/encode_keychange.dsp,
+ libagent/libagent.dsp, libhelpers/libhelpers.dsp,
+ libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp_dll.dsp,
+ netsnmpmibs/netsnmpmibs.dsp,
+ netsnmpmibssdk/netsnmpmibssdk.dsp,
+ snmpbulkget/snmpbulkget.dsp, snmpbulkwalk/snmpbulkwalk.dsp
+, snmpd/snmpd.dsp, snmpdelta/snmpdelta.dsp,
+ snmpdf/snmpdf.dsp, snmpdsdk/snmpd.dsp,
+ snmpget/snmpget.dsp, snmpgetnext/snmpgetnext.dsp,
+ snmpnetstat/snmpnetstat.dsp, snmpset/snmpset.dsp,
+ snmpstatus/snmpstatus.dsp, snmptable/snmptable.dsp,
+ snmptest/snmptest.dsp, snmptranslate/snmptranslate.dsp
+, snmptrap/snmptrap.dsp, snmptrapd/snmptrapd.dsp
+, snmpusm/snmpusm.dsp, snmpvacm/snmpvacm.dsp,
+ snmpwalk/snmpwalk.dsp:
+
+ build MSVS release and debug versions having the same name.
+
+2004-02-27 05:11 slif
+
+ * win32/: install-net-snmp.bat, net-snmp/net-snmp-config.h
+:
+
+ construct install tree similar to install tree that gcc builds use.
+
+2004-02-27 04:50 slif
+
+ * agent/snmpd.c, snmplib/Makefile.in,
+ snmplib/winservice.c:
+
+ enable gcc builds of Windows service code for the agent.
+
+2004-02-26 17:20 slif
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ remove unnecessary setting of NETSNMP_DS_LIB_APPTYPE.
+
+2004-02-26 16:44 hardaker
+
+ * local/mib2c:
+
+ common-ize loop and saving of state variables through a creative use
+ of references.
+
+2004-02-26 16:21 hardaker
+
+ * local/mib2c:
+
+ support for @define sections which can be later referred to by @calldefine
+
+2004-02-26 16:11 hardaker
+
+ * local/Version-Munge.pl:
+
+ - doxygen config file.
+ - TrapRecevier perl mod.
+
+2004-02-26 06:50 dts12
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ Don't call 'TCP_Count_Connections' if the tcpTable module isn't included.
+
+2004-02-26 06:32 dts12
+
+ * FAQ:
+
+ Minor wordsmithing tweaks to Bruce's FAQ changes.
+ Gosh, but Dave's a picky bugger at times.
+ Never mind, perhaps if you let him amuse himself with the documentation,
+ you might be able to keep him away from more critical bits of the project....
+
+2004-02-25 23:47 slif
+
+ * agent/mibgroup/agent/nsLogging.c:
+
+ remove CR accidentally inserted previously.
+
+2004-02-25 21:42 slif
+
+ * snmplib/system.c:
+
+ use RFC 3330 permitted address for this host when looking in get_myaddr
+
+2004-02-25 16:59 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Enable AES support for the SNMP module (can't believe it's been missing)
+
+2004-02-25 14:46 slif
+
+ * perl/SNMP/SNMP.xs:
+
+ remove unneeded workaround patch [ 840830 ] SNMP.xs Free to wrong pool crash on Windows
+
+2004-02-25 13:06 slif
+
+ * README.win32, perl/SNMP/README:
+
+ patch [901944] win32 doc updates from Alex Burger
+
+2004-02-24 10:39 slif
+
+ * include/net-snmp/system/mingw32.h:
+
+ use winsock gethostbyname, getservbyname on mingw32.
+
+2004-02-24 09:58 slif
+
+ * win32/install-net-snmp.bat:
+
+ per Bernhard Penz: deep copy of include tree
+
+2004-02-24 06:26 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Patch from Bob Rowlands: [ bug 902722 ] Able to delete view even when storage type = permanent
+
+2004-02-24 05:43 slif
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ patch [903424] per Andy Smith: ifdef win32 fix for tcpTable.c (cygwin)
+
+2004-02-23 16:32 hardaker
+
+ * FAQ:
+
+ Patch #901460 from Bruce Shaw: updating misc FAQ information
+
+2004-02-23 16:21 hardaker
+
+ * INSTALL:
+
+ updated perl build info
+
+2004-02-23 16:13 hardaker
+
+ * INSTALL:
+
+ patch #901375 from Bruce Shaw: some information on INSTALL is stale
+
+2004-02-23 13:29 slif
+
+ * configure.in, configure:
+
+ undo previous patch -- no semi-colons in DEFAULT_MIB{FILES,DIRS}
+
+2004-02-23 10:57 slif
+
+ * configure.in, configure:
+
+ convert other list-oriented settings to consider semi-colon delimiter for mingw32
+
+2004-02-22 09:48 slif
+
+ * win32/install-net-snmp.bat:
+
+ per AlexB: also install snmpconf files
+
+2004-02-21 13:56 slif
+
+ * README.win32, acconfig.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/library/getopt.h, snmplib/tools.c,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/net-snmp/net-snmp-config.h, win32/libsdll.dsw:
+
+ Apply patch #898464 to fix bugs #896030 and #773412
+
+2004-02-20 07:18 slif
+
+ * configure.in, include/net-snmp/net-snmp-config.h.in
+, configure:
+
+ per AlexB: fix DEFAULT_MIBS to use ';' separator on Win32.
+
+2004-02-19 20:46 hardaker
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Whoops. That would not have worked. Silly me.
+
+2004-02-19 20:42 hardaker
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ check number of support processors properly
+
+2004-02-19 20:37 hardaker
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ [ 900244 ] support up to 32 CPUs on linux from Michal Luczak
+
+2004-02-19 19:41 slif
+
+ * agent/mibgroup/notification/: snmpNotifyFilterTable.h,
+ snmpNotifyTable.h:
+
+ fix bug 898509 function pointer prototypes defined twice
+
+2004-02-19 18:50 slif
+
+ * configure.in, configure:
+
+ allow DOS volume name [A-Z]: to begin the path spec for prefixes
+
+2004-02-19 09:41 slif
+
+ * net-snmp-config.in:
+
+ fix spell NSC_EXEC_PREFIX
+
+2004-02-18 23:35 slif
+
+ * perl/SNMP/t/mibload.t:
+
+ per AlexB: -win32 support
+
+2004-02-18 23:35 slif
+
+ * perl/SNMP/t/startagent.pl:
+
+ per AlexB:
+ -add Win32 support for starting / stopping snmpd and snmptrapd
+ -allow spaces in snmptest.cmd file
+
+2004-02-18 23:34 slif
+
+ * perl/SNMP/Makefile.PL:
+
+ -make $my opts global so it's visible to GetTestInfo()
+ -re-write win32 code create snmptest.cmd file
+
+2004-02-18 23:27 slif
+
+ * perl/SNMP/t/: bulkwalk.t, notify.t:
+
+ per AlexB: test that variables are defined before using them.
+
+2004-02-18 23:17 slif
+
+ * perl/SNMP/t/: async.t, bulkwalk.t:
+
+ per AlexB: disable asynch tests when run on win32 platform.
+
+2004-02-18 23:00 slif
+
+ * perl/SNMP/t/: bulkwalk.t, mibload.t:
+
+ per AlexB: add missing snmptest_cleanup call
+
+2004-02-18 22:45 slif
+
+ * perl/SNMP/t/conf.t:
+
+ per AlexB: typo fix "compiled the"
+
+2004-02-18 22:40 slif
+
+ * perl/: Makefile.PL, Makefile.subs.pl, ASN/Makefile.PL
+, OID/Makefile.PL, SNMP/Makefile.PL,
+ agent/Makefile.PL, default_store/Makefile.PL:
+
+ from Alex Burger: case insensitive check for -NET-SNMP-IN-SOURCE command param.
+
+2004-02-18 12:35 hardaker
+
+ * Makefile.in:
+
+ Remove a v3-security auto-built header during distclean
+
+2004-02-18 11:58 rstory
+
+ * dist/nsb-package:
+
+ document -C option in usage
+
+2004-02-18 11:57 rstory
+
+ * dist/nsb-nightly:
+
+ fix path in usage; use new nsg-suffic in upload path
+
+2004-02-18 11:40 slif
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ use INSTALL_BASE -relative mktemp file pattern.
+
+2004-02-18 09:24 rstory
+
+ * dist/nsb-functions:
+
+ make # err lines reported configurable. default to 25
+
+2004-02-18 06:14 dts12
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Provide a definition for 'in6addr_any' under Windows
+ (Although there's an external declaration mentioned in
+ <ws2tcpip.h>, there no actual variable in the library)
+
+2004-02-17 10:33 hardaker
+
+ * makenosysdepend.pl:
+
+ regexp touchups
+
+2004-02-17 07:27 rstory
+
+ * snmplib/parse.c:
+
+ bump MAXTC up to 4096
+
+2004-02-17 07:25 rstory
+
+ * dist/nsb-functions:
+
+ only append suffic to build dir when building default build dir; remove
+ system specific tweaks for sf cf, they should go in ~/.snmp/nsb-rc
+
+2004-02-17 05:54 slif
+
+ * snmplib/mib.c:
+
+ fix error after change for Fix [801928]
+
+2004-02-17 04:39 slif
+
+ * snmplib/mib.c:
+
+ Fix [801928] wrong call of strlcpy in uptime_string
+
+2004-02-17 03:23 dts12
+
+ * snmplib/: snmpTCPIPv6Domain.c, snmpUDPIPv6Domain.c:
+
+ Tweak IPv6 transports so that they compile under Windows.
+
+2004-02-17 02:42 dts12
+
+ * snmplib/: inet_ntop.c, inet_pton.c:
+
+ Provide implementations of 'inet_ntop' and 'inet_pton' for
+ systems that don't support them natively.
+
+2004-02-17 02:29 slif
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ Fix [896793] loadave.c includes sys/stat.h twice
+
+2004-02-17 00:45 slif
+
+ * agent/mibgroup/notification/snmpNotifyFilterProfileTable.h:
+
+ fix bug 898509 function pointer prototypes defined twice
+
+2004-02-16 21:40 hardaker
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ removed unused function from last patch
+
+2004-02-16 21:35 hardaker
+
+ * agent/mibgroup/: host/hr_swrun.c, host/hr_system.c,
+ ucd-snmp/proc.c:
+
+ patch [ 836393 ] More proc improvements for Linux from Howard Wilkinson
+
+2004-02-16 18:28 slif
+
+ * win32/nmakeperl.bat:
+
+ note sub-directory where "nmake" output files are written.
+
+2004-02-16 15:03 hardaker
+
+ * testing/: README, RUNTESTS, TESTCONF.sh,
+ eval_tools.sh, tests/Svacmconfig, tests/Svanyconfig
+, tests/T001snmpv1get, tests/T014snmpv2cget,
+ tests/T015snmpv2cgetnext, tests/T0160snmpv2cbulkget,
+ tests/T016snmpv2cgetfail, tests/T017snmpv2ctov1getfail
+, tests/T018snmpv1tov2cgetfail,
+ tests/T019snmpv2cnosuch, tests/T020snmpv3get,
+ tests/T021snmpv3getnext, tests/T0220snmpv3bulkget,
+ tests/T022snmpv3getMD5, tests/T023snmpv3getMD5DES,
+ tests/T024snmpv3getSHA1, tests/T025snmpv3getSHADES,
+ tests/T028snmpv3getfail, tests/T030snmpv3usercreation
+, tests/T049snmpv3inform, tests/T050snmpv3trap,
+ tests/T051snmpv2ctrap, tests/T052snmpv2cinform,
+ tests/T053agentv1trap, tests/T054agentv2ctrap,
+ tests/T055agentv1mintrap, tests/T056agentv2cmintrap,
+ tests/T058agentauthtrap, tests/T100agenthup,
+ tests/T110agentxget, tests/T111agentxset,
+ tests/T112agentxsetfail, tests/T113agentxtrap,
+ tests/T120proxyget, tests/T121proxyset,
+ tests/T122proxysetfail, tests/T130snmpv1vacmget,
+ tests/T131snmpv2cvacmget, tests/T132snmpv3vacmget,
+ tests/T140snmpv1vacmgetfail, tests/T141snmpv2cvacmgetfail
+, tests/T142snmpv3vacmgetfail:
+
+ Patch #702835 (plus tweaks): patch to enable test cases run on different transport domain from Xiaofeng Ling
+
+2004-02-16 14:39 hardaker
+
+ * agent/mibgroup/ucd-snmp/errormib.c:
+
+ Fix bug [ 896777 ] errormib.c includes sys/stat/h twice
+
+2004-02-16 14:20 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ [no log message]
+
+2004-02-16 14:09 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ Bug [ 897550 ] Perl SNMP.pm missing documentation and attached patch from Alex Burger
+
+2004-02-16 12:45 hardaker
+
+ * doxygen.conf, agent/agent_handler.c,
+ agent/agent_registry.c, agent/agent_trap.c,
+ agent/snmp_agent.c, agent/snmp_vars.c,
+ agent/helpers/instance.c, agent/helpers/scalar.c,
+ agent/helpers/table.c, agent/helpers/table_iterator.c
+, include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/library/data_list.h,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/snmp_api.h, snmplib/callback.c
+, snmplib/default_store.c, snmplib/read_config.c
+, snmplib/snmp_alarm.c, snmplib/snmp_api.c,
+ snmplib/snmp_client.c, snmplib/snmp_logging.c:
+
+ Patch: [ 819241 ] Add to the API documentation from Bob Rowlands
+
+2004-02-16 11:41 hardaker
+
+ * apps/snmptable.c:
+
+ Patch [ 898160 ] Snmptable loops if table is at the end of the mib from Crispin Flowerday
+
+2004-02-16 10:30 slif
+
+ * README.win32:
+
+ make menu path to register PSDK more complete.
+
+2004-02-16 10:01 slif
+
+ * win32/: libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp_dll.dsp
+:
+
+ remove platform SDK header Snmp.h from SOURCES list.
+
+2004-02-16 06:39 hardaker
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ Fix a missing variable from the previous patch.
+
+2004-02-15 18:19 slif
+
+ * win32/install-net-snmp.bat:
+
+ copy dll to system32 cache
+
+2004-02-15 15:47 slif
+
+ * win32/: win32.dsw, win32sdk.dsw:
+
+ the project dependencies are not reliable. remove them.
+
+2004-02-15 12:00 slif
+
+ * perl/SNMP/SNMP.xs:
+
+ remove XYX comments; note that snmp_init_mib_internals does nothing.
+
+2004-02-15 10:39 rstory
+
+ * dist/nsb-functions:
+
+ fix syntax error
+
+2004-02-15 10:32 rstory
+
+ * dist/nsb-functions:
+
+ check for and source new common config file
+
+2004-02-14 09:41 slif
+
+ * win32/: win32.dsw, win32sdk.dsw:
+
+ remove dependencies for libsnmp project
+
+2004-02-14 06:20 slif
+
+ * README:
+
+ Add Noah Friedman, fixing bug 887291
+
+2004-02-14 02:51 slif
+
+ * win32/win32sdk.dsw:
+
+ Remove global dependency for libsnmp project (not necessary).
+
+2004-02-13 16:02 slif
+
+ * win32/nmakeperl.bat:
+
+ better explanatory messages, and improved test results collected.
+
+2004-02-13 13:33 hardaker
+
+ * agent/mibgroup/mibII/ipAddr.c,
+ include/net-snmp/library/cmu_compat.h:
+
+ Patch [ 812034 ] ipAdEntReasmMaxSize does not return data on snmpget from Bob Rowlands
+
+2004-02-13 12:31 hardaker
+
+ * configure, configure.in:
+
+ fix AES note output broken by last patch
+
+2004-02-13 12:18 hardaker
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in, snmplib/Makefile.in
+, snmplib/keytools.c, snmplib/pkcs.c,
+ snmplib/scapi.c:
+
+ Patch [ 807375 ] add standard PKCS#11 interface support for usm: alternative security library (openssl no longer needed on future solaris) from Bob Rowlands
+
+2004-02-13 11:59 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ Part of patch (some had been done) for [ 767316 ] fix handling of augmented tables in perl module from Randy Couey
+
+2004-02-13 11:48 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Second part of diskio load average patch
+
+2004-02-13 11:46 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/diskio.h, mibs/UCD-DISKIO-MIB.txt
+:
+
+ patch [ 795424 ] diskioLA - disk load average for FreeBSD (devstat) from Rojer
+
+2004-02-13 11:19 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ patch [ 799050 ] AIX patches - ucd-snmp/diskio from Michael Kukat
+
+2004-02-13 11:14 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Missed a portion of patch #815439 fixing auth failure traps. patch got confused by previously existing code before.
+
+2004-02-13 10:48 slif
+
+ * perl/SNMP/SNMP.xs:
+
+ one line change to properly terminate a comment injected by the previous patch.
+
+2004-02-13 10:39 hardaker
+
+ * README:
+
+ Added Nick Barkas to the README
+
+2004-02-13 10:36 slif
+
+ * perl/SNMP/SNMP.xs:
+
+ Replace get_tree_head() for references to variables Mib and tree_head.
+ Remove DLL_IMPORT lines, and BOOT section, as they are not needed.
+ Mark questionable commented code with XYX for possible removal.
+
+2004-02-13 10:36 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ Patch [ 895509 ] memory info from ucd-snmp mib on linux 2.6 from Nick Barkas
+
+2004-02-13 10:20 hardaker
+
+ * testing/tests/T151solarishostdisk:
+
+ Patch [ 894711 ] Solaris disk test fails on some OS's from Bruce Shaw
+
+2004-02-13 10:05 hardaker
+
+ * include/net-snmp/library/asn1.h,
+ include/net-snmp/library/check_varbind.h,
+ include/net-snmp/library/int64.h, snmplib/asn1.c,
+ snmplib/check_varbind.c, snmplib/int64.c:
+
+ [ 849158 ] 5.1: /const/ fixes for the API from Stephen J. Friedl
+
+2004-02-12 20:08 rstory
+
+ * agent/helpers/table_container.c:
+
+ update for renamed defines
+
+2004-02-12 17:13 hardaker
+
+ * agent/snmp_agent.c:
+
+ Patch [ 815439 ] snmagent does not send auth failure traps for v3 from Bob Rowlands
+
+2004-02-12 17:06 hardaker
+
+ * apps/snmptable.c:
+
+ remove copyright comment accidentically placed
+
+2004-02-12 17:03 hardaker
+
+ * apps/snmptable.c:
+
+ [ 812005 ] segmentation fault in snmptable
+
+2004-02-12 16:52 hardaker
+
+ * acconfig.h, configure, configure.in,
+ agent/mibgroup/agentx/master.c:
+
+ patch [ 811278 ] make agentx udp/tcp transports configurable from Bob Rowlands
+
+2004-02-12 16:37 hardaker
+
+ * agent/mibgroup/host/hr_system.c:
+
+ Patch [ 809438 ] Fix several problems with host resources MIB from Bob Rowlands (fixes multiple bugs)
+
+2004-02-12 15:02 hardaker
+
+ * NEWS:
+
+ note about snmptrapd perl
+
+2004-02-12 14:41 slif
+
+ * README.win32:
+
+ Add a section "Building with MinGW"
+
+2004-02-12 11:35 slif
+
+ * README.win32, win32/nmakeperl.bat:
+
+ Add how to (with script) for building Perl SNMP modules using MSVC.
+
+2004-02-12 08:36 slif
+
+ * apps/Makefile.in:
+
+ create snmplibsdir for snmp_perl_trapd.pl, before installing there.
+
+2004-02-12 08:31 slif
+
+ * win32/: libagent/libagent.dsp, libhelpers/libhelpers.dsp
+, libsnmp/libsnmp.dsp, netsnmpmibs/netsnmpmibs.dsp
+, netsnmpmibssdk/netsnmpmibssdk.dsp, snmpd/snmpd.dsp
+, snmpdsdk/snmpd.dsp, snmptrapd/snmptrapd.dsp:
+
+ remove unused compile constant that Slif created during his DLL experiments.
+
+2004-02-12 06:45 rstory
+
+ * agent/helpers/table_container.c,
+ include/net-snmp/agent/table_container.h:
+
+ new table container helper
+
+2004-02-12 05:32 slif
+
+ * perl/OID/OID.xs, perl/SNMP/SNMP.xs,
+ perl/agent/agent.xs, win32/net-snmp/net-snmp-config.h
+:
+
+ cleanup Perl SNMP module build through type casting and
+ removing unused variables.
+ For SNMP.xs, there was a named variable 'best_guess' that blocked
+ the calling param of "snmp_get_type", removed with this update.
+ The win32 config.h no longer tries to define bcopy,bzero,bcmp,strcasecmp.
+
+2004-02-12 01:22 slif
+
+ * perl/SNMP/t/bulkwalk.t:
+
+ use a reasonable value (1) for non-repeater in first bulkwalk.
+
+2004-02-12 00:32 slif
+
+ * perl/SNMP/SNMP.xs:
+
+ include net-snmp-config.h before using HAVE_REGEX_H.
+ replace compute_match with the non-regex savvy version from snmplib/parse.c.
+ Finally, disable Win32 DLL decoration, as DLL build is not supported.
+
+2004-02-11 20:54 slif
+
+ * win32/win32sdk.dsw:
+
+ snmptrapd builds using the same project file for PSDK or non-PSDK
+
+2004-02-11 18:26 slif
+
+ * perl/: Makefile.subs.pl, ASN/Makefile.PL,
+ OID/Makefile.PL, SNMP/Makefile.PL, agent/Makefile.PL
+, agent/default_store/Makefile.PL,
+ default_store/Makefile.PL:
+
+ fix bug [ 895367 ] Win32 Perl build -NET-SNMP-PATH and paths with spaces
+
+2004-02-11 17:42 slif
+
+ * win32/netsnmpmibssdk/netsnmpmibssdk.dsp,
+ win32/snmpdsdk/snmpd.dsp, perl/agent/Makefile.PL:
+
+ netsnmpmibssdk.lib renamed to netsnmpmibs.lib
+
+2004-02-11 17:16 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ Do not have gettable return hex encoded strings if not printable. No
+ other function does this, so why would gettable be any different.
+
+2004-02-11 17:11 slif
+
+ * README.win32:
+
+ MSVC build requires using but one workspace.
+
+2004-02-11 11:07 hardaker
+
+ * perl/TrapReceiver/: .cvsignore, Changes, MANIFEST
+, Makefile.PL, README, TrapReceiver.pm,
+ TrapReceiver.xs, const-c.inc, const-xs.inc,
+ perl_snmptrapd.h, ppport.h, typemap,
+ fallback/const-c.inc, fallback/const-xs.inc, t/1.t
+:
+
+ Initial pass at an embedded perl module for snmptrapd.
+ Whats odd for typical initial code from me is that it's fully
+ functional and documented even!
+
+2004-02-11 10:57 hardaker
+
+ * perl/Makefile.PL:
+
+ Add the TrapReceiver module to the list of defaults.
+
+2004-02-11 10:56 hardaker
+
+ * apps/snmp_perl_trapd.pl:
+
+ A perl bootstrapping startup file.
+
+2004-02-11 10:54 hardaker
+
+ * apps/Makefile.in:
+
+ Install the perl startup file.
+
+2004-02-11 10:53 hardaker
+
+ * apps/snmptrapd.c:
+
+ Initialize perl
+
+2004-02-11 10:53 hardaker
+
+ * apps/snmptrapd_handlers.h:
+
+ create a handler_data field.
+
+2004-02-11 07:28 slif
+
+ * configure, configure.in:
+
+ Show AES only to reflect previous changes -- Use AES instead of AES128,192,256
+
+2004-02-11 06:08 slif
+
+ * perl/OID/test.pl:
+
+ announce correct number of tests (was 36, now 38)
+
+2004-02-11 06:06 slif
+
+ * perl/default_store/test.pl:
+
+ update to reflect change in value of NETSNMP_DS_MAX_SUBIDS
+
+2004-02-10 17:05 rstory
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ fix always false test
+
+2004-02-10 16:17 rstory
+
+ * agent/helpers/table.c:
+
+ new netsnmp_table_next_column
+
+2004-02-10 14:36 rstory
+
+ * agent/helpers/table.c:
+
+ remove code before variable declarations
+
+2004-02-10 13:23 slif
+
+ * README.win32:
+
+ touch up instructions for MSVC builds that use OpenSSL
+
+2004-02-10 09:09 rstory
+
+ * README.solaris:
+
+ merge update from Bruce from 5-1-patches
+
+2004-02-10 08:33 slif
+
+ * local/snmpconf:
+
+ apply snmpconf3 of patch 837967; add close to read_config
+
+2004-02-10 03:50 slif
+
+ * perl/agent/Makefile.PL:
+
+ fix bug 892616
+
+2004-02-09 15:03 nba
+
+ * apps/snmpnetstat/main.c, snmplib/snmp_parse_args.c:
+
+ Enable stderrlog if no other logging is enabled - to avoid warning
+
+2004-02-09 14:16 rstory
+
+ * dist/nsb-functions:
+
+ export CPP=cpp on Darwin so Apple's gcc doesn't break config_require
+
+2004-02-09 08:55 rstory
+
+ * agent/mibgroup/mibII/ifTable.c:
+
+ fix column names
+
+2004-02-09 08:54 rstory
+
+ * agent/mibgroup/mibII/: ifTable_columns.h,
+ ifXTable_columns.h:
+
+ add missing files
+
+2004-02-09 08:24 dts12
+
+ * agent/snmp_agent.c, agent/helpers/table.c,
+ agent/helpers/table_data.c, include/net-snmp/agent/table.h
+:
+
+ Implement a new helper to cope with skipping "holes" in a table
+ (and tweak the 'table_data' helper to make use of it).
+ Note that this requires the _request_set_error() routine to be
+ a bit flexible in accepting exceptions that aren't strictly valid.
+
+2004-02-09 07:57 dts12
+
+ * agent/helpers/old_api.c:
+
+ Ensure one object's 'write_method' isn't picked up by anything else.
+
+2004-02-09 07:34 dts12
+
+ * snmplib/snmpusm.c:
+
+ Guard against passing NULL parameters to strcmp/strlen.
+ Probably shouldn't ever happen, but Dave's in a suspicious mood.
+ Qn: Should these changes be applied to the 5.1.x (?& 5.0.x) line?
+
+2004-02-09 04:05 slif
+
+ * agent/snmpd.c:
+
+ build agent on mingw, without win32 SCM glue.
+
+2004-02-09 03:26 slif
+
+ * win32/: win32.dsw, win32sdk.dsw:
+
+ add dependency for libsnmp to build snmpd.
+
+2004-02-08 19:50 slif
+
+ * snmplib/winservice.c:
+
+ cleaned up, ready for mainstream. However, not gcc-friendly, just yet.
+
+2004-02-08 18:55 slif
+
+ * configure, configure.in:
+
+ regen configure from correct configure.in
+
+2004-02-08 18:24 rstory
+
+ * include/net-snmp/system/bsd.h:
+
+ new define UTMP_HAS_NO_PID
+
+2004-02-08 18:22 rstory
+
+ * agent/mibgroup/host/hr_system.c:
+
+ use new define UTMP_HAS_NO_PID; simplify loop logic
+
+2004-02-08 17:44 rstory
+
+ * agent/mibgroup/host/hr_system.c:
+
+ don't put open brace in ifdef if close brace has no ifdef
+
+2004-02-08 16:21 rstory
+
+ * dist/nsb-functions:
+
+ extra transports should be empty; Callback should be in dist transports
+
+2004-02-08 15:50 slif
+
+ * README.win32:
+
+ Include sample display from running install-net-snmp.bat
+
+2004-02-08 10:16 slif
+
+ * include/net-snmp/library/winservice.h,
+ include/net-snmp/system/mingw32.h, snmplib/Makefile.in
+, snmplib/winpipe.c:
+
+ With input from Alex Smith, apply changes to improve mingw builds.
+
+2004-02-08 10:12 slif
+
+ * win32/: install-net-snmp.bat, net-snmp/net-snmp-config.h
+:
+
+ Move the directory from /usr to C:\Program Files\Net-SNMP.
+
+2004-02-08 10:11 slif
+
+ * README.win32, win32/install-net-snmp.bat:
+
+ MSVC build instructions are simpler, thanks to Alex Burger's project/workspace changes.
+ Also, introduced a batch command file to simplify installation after building.
+
+2004-02-08 09:34 slif
+
+ * win32/: win32.dsw, win32sdk.dsw:
+
+ Apply changes offered by Alex Burger to clean up projects and workspaces
+ and to build snmptrapd using the Platform-SDK workspace (win32sdk).
+
+2004-02-06 15:48 rstory
+
+ * dist/nsb-functions:
+
+ only config w/libwrap if we can find the header
+
+2004-02-06 11:21 hardaker
+
+ * COPYING:
+
+ Year update for Sparta
+
+2004-02-06 10:12 slif
+
+ * agent/mibgroup/utilities/execute.c:
+
+ patch 843924 run_shell_command to quote redirected parameters.
+
+2004-02-06 08:51 dts12
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ Re-instate the 'hz' variable for FreeBSD (but *only* FreeBSD)
+
+2004-02-06 05:58 dts12
+
+ * agent/agent_trap.c:
+
+ Provide missing agent_address/snmpTrapAddress information
+ (Bugs #865178 & #877587 and Patch #883028)
+
+2004-02-05 08:04 slif
+
+ * README.win32:
+
+ revised per peer review.
+
+2004-02-05 05:45 slif
+
+ * README.win32:
+
+ Current status appears immediately after the introduction
+ Removed references to building/using/installing netsnmp.DLL
+ Added registering as windows service
+ Noted new dependency of snmptrapd on netsnmpmibs
+ Noted snmptrapd builds only using win32.dsw workspace
+ Added How to change external project settings to match
+ Clarified what other project settings should be unmodified.
+
+2004-02-05 05:27 slif
+
+ * win32/: win32.dsw, win32sdk.dsw:
+
+ unregister DLL library project from workspaces.
+
+2004-02-05 05:16 slif
+
+ * agent/mibgroup/util_funcs.c,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/read_config.h, man/snmp.conf.5.def
+, snmplib/read_config.c, snmplib/snmp_api.c:
+
+ Apply patch 843919 - new tempFilePattern snmp.conf option
+
+2004-02-05 04:45 dts12
+
+ * agent/mibgroup/examples/netSnmpHostsTable.h:
+
+ Add the NET-SNMP-EXAMPLES-MIB to the load list
+ (Patch #890839 from Yixiong Zou)
+
+2004-02-05 04:39 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Correct the use of a wrong debug token (Patch #889777 by Dirk Balcerczak)
+
+2004-02-05 04:38 slif
+
+ * README.win32:
+
+ Apply patch 850785 - instructions to copy header files following build.
+
+2004-02-05 03:41 slif
+
+ * win32/: net-snmp/agent/mib_module_config.h,
+ netsnmpmibs/netsnmpmibs.dsp,
+ netsnmpmibssdk/netsnmpmibssdk.dsp:
+
+ Don't build the Rmon modules.
+
+2004-02-05 01:49 slif
+
+ * configure.in:
+
+ Apply patch 843679
+
+2004-02-04 20:11 slif
+
+ * agent/mibgroup/agent/nsLogging.c,
+ include/net-snmp/library/snmp_logging.h,
+ snmplib/snmp_logging.c, win32/libsnmp_dll/libsnmp.def
+:
+
+ expose one less static data variable (logh_head); list two others for DLL.
+
+2004-02-04 20:07 slif
+
+ * win32/: libagent/libagent.dsp, libhelpers/libhelpers.dsp
+, libsnmp/libsnmp.dsp, netsnmpmibs/netsnmpmibs.dsp
+, netsnmpmibssdk/netsnmpmibssdk.dsp, snmpd/snmpd.dsp
+, snmpdsdk/snmpd.dsp, snmptrapd/snmptrapd.dsp:
+
+ clean up BASE CPP settings.
+
+2004-02-04 14:15 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Don't operate on a null pointer for indexes that don't exist.
+
+2004-02-04 14:14 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ Mention that Robert has the ability to sign packages now.
+
+2004-02-04 14:13 hardaker
+
+ * include/net-snmp/library/scapi.h,
+ include/net-snmp/library/transform_oids.h, snmplib/scapi.c
+, snmplib/snmp_parse_args.c, snmplib/snmpusm.c
+, snmplib/snmpv3.c:
+
+ Use AES instead of AES128,192,256
+
+2004-02-04 14:13 hardaker
+
+ * net-snmp-config.in:
+
+ create the persistent directory if it hasn't been created yet.
+
+2004-02-04 13:01 slif
+
+ * snmplib/scapi.c:
+
+ cast to quiet msvc compiler.
+
+2004-02-04 05:31 slif
+
+ * agent/helpers/table_mfd.c, snmplib/container_iterator.c
+:
+
+ use Niels' choices for names substituting __FUNCTION__
+
+2004-02-04 05:29 slif
+
+ * snmplib/snmp_transport.c:
+
+ avoid void casting in free to keep gcc happy.
+
+2004-02-03 17:13 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ merge patch from 5.0-patches
+
+2004-02-03 16:53 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ strdup value from netsnmp_ds_get_string, since it is free'd later
+
+2004-02-03 14:30 slif
+
+ * agent/mibgroup/smux/smux.c:
+
+ quiet compiler warnings using appropriate type casting.
+
+2004-02-03 14:29 slif
+
+ * include/net-snmp/: types.h, system/mingw32.h:
+
+ move ifndef HAVE_SSIZE_T from MinGW specific header to types header,
+ to benefit other platforms that do not define ssize_t (e.g., msvc).
+
+2004-02-03 14:25 slif
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ export symbols for functions when SNMP_TRANSPORT_CALLBACK_DOMAIN is defined.
+
+2004-02-03 14:24 slif
+
+ * win32/mib_module_inits.h:
+
+ dont initialize ucd-snmp init_disk for msvc builds.
+
+2004-02-03 14:21 slif
+
+ * win32/net-snmp/agent/mib_module_config.h:
+
+ enable AgentX, Rmon, disman-event-mib, and ucd-snmp module groups.
+
+2004-02-03 14:19 slif
+
+ * win32/: netsnmpmibssdk/netsnmpmibssdk.dsp,
+ netsnmpmibs/netsnmpmibs.dsp:
+
+ don't build the ucd-snmp disk module (not implemented for m$ builds)
+
+2004-02-03 09:16 slif
+
+ * include/net-snmp/library/winpipe.h, snmplib/winpipe.c
+:
+
+ Finish applying patch 852682 for callback transport support under Win32
+
+2004-02-03 08:00 slif
+
+ * snmplib/snmpCallbackDomain.c, win32/libsnmp/libsnmp.dsp
+, win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/net-snmp/net-snmp-config.h:
+
+ Applied patch 852682 for callback transport on Win32; touched up MSVC project files, too.
+
+2004-02-03 07:14 slif
+
+ * agent/mibgroup/utilities/execute.c:
+
+ move #if HAVE_EXECV to head of run_exec_command for quieter MSVC builds.
+
+2004-02-03 03:25 nba
+
+ * apps/snmpnetstat/main.c:
+
+ Remove positional community from usage
+
+2004-02-03 02:09 nba
+
+ * snmplib/mib.c:
+
+ Fix bug returning only four characters for uptime string
+
+2004-02-03 02:07 nba
+
+ * mibs/rfclist:
+
+ Update for re-issued ATM and EtherLike RFCs
+
+2004-02-03 02:06 nba
+
+ * man/snmpcmd.1.def:
+
+ Fix reference to -Le to -LE
+
+2004-02-03 02:05 nba
+
+ * local/traptoemail:
+
+ Fix stupid bug fetching the trap oid
+
+2004-02-03 02:04 nba
+
+ * apps/snmpnetstat/main.c:
+
+ A bit of cleanup and properly default community from conf file
+
+2004-02-03 02:01 nba
+
+ * apps/snmptrapd_log.c, man/snmptrapd.8.def:
+
+ Allow %V to take more than one character
+
+2004-02-03 01:59 nba
+
+ * agent/mibgroup/utilities/execute.c:
+
+ Apply (modified) patch 860443 which also fixes bug 848284 by properly
+ terminating the input buffer.
+
+2004-02-03 01:56 nba
+
+ * agent/mibgroup/ucd-snmp/: disk.c, disk.h:
+
+ Try to untangle an #ifdef mess that hinders compilation on OS/X
+
+2004-02-03 01:55 nba
+
+ * agent/mibgroup/mibII/mta_sendmail.c:
+
+ Remove a bunch of superfluous newlines in messages
+
+2004-02-03 01:53 nba
+
+ * agent/mibgroup/mibII/: ipAddr.c, at.c:
+
+ Fix return of IPv4 address on 64-bit Solaris
+
+2004-02-02 23:40 nba
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ ifdef a linux specific variable
+
+2004-02-02 23:38 nba
+
+ * snmplib/snmp_api.c:
+
+ Apply patch 841705 to fix bug 817386
+
+2004-02-02 23:37 nba
+
+ * snmplib/vacm.c:
+
+ Apply patch 836568 to fix bug 829119
+
+2004-02-02 23:36 nba
+
+ * snmplib/snmpUDPDomain.c:
+
+ Apply patch 845798 to fix bug 831299
+
+2004-02-02 23:32 nba
+
+ * snmplib/mib.c:
+
+ Properly reset wildcardmatcher between calls
+
+2004-02-02 23:23 nba
+
+ * snmplib/mib.c:
+
+ Applied patch from bug 849153
+
+2004-02-02 23:21 nba
+
+ * snmplib/parse.c:
+
+ Give error message when module not available
+
+2004-02-02 23:18 nba
+
+ * snmplib/asn1.c:
+
+ Do not cast unsigned to signed
+
+2004-02-02 23:17 nba
+
+ * include/net-snmp/utilities.h:
+
+ Use system getopt.h when available
+
+2004-02-02 23:16 nba
+
+ * apps/snmpdf.c:
+
+ Protect against buffer overrun for extrame disk names
+
+2004-02-02 23:16 nba
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Apply patch 850716 to fix bug 850185
+
+2004-02-02 16:10 nba
+
+ * apps/: snmptest.c, snmptrapd_log.c:
+
+ Quell a bunch of warnings from Solaris 8 and gcc -m64
+
+2004-02-02 16:05 nba
+
+ * agent/agent_trap.c:
+
+ Quell a bunch of warnings from Solaris 8 and gcc -m64
+
+2004-02-02 15:59 nba
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Quell a bunch of warnings from Solaris 8 and gcc -m64
+
+2004-02-02 15:58 nba
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.c:
+
+ Better error message
+
+2004-02-02 15:56 nba
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Correctly loop around missing entries
+
+2004-02-02 15:55 nba
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Better file system types
+
+2004-02-02 15:52 nba
+
+ * agent/agent_trap.c:
+
+ Fix setting of community len
+
+2004-02-02 15:40 nba
+
+ * agent/mibgroup/mibII/system_mib.c, snmplib/container.c
+:
+
+ Quell a bunch of warnings from Solaris 8 and gcc -m64
+
+2004-02-02 15:36 nba
+
+ * include/net-snmp/library/snmpTCPDomain.h,
+ snmplib/snmpTCPDomain.c:
+
+ Proper OID for TCP4
+
+2004-02-02 15:35 nba
+
+ * snmplib/snmp_logging.c:
+
+ FIx newline handling in file logger
+
+2004-02-02 15:34 nba
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Fix some warnings, and make some better error messages
+
+2004-02-02 15:33 nba
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ Fix a file descriptor leak
+
+2004-02-02 15:32 nba
+
+ * agent/helpers/table_data.c, agent/helpers/table_iterator.c
+, agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/ucd-snmp/loadave.c, snmplib/asn1.c
+, snmplib/snmp_debug.c:
+
+ Quell a bunch of warnings from Solaris 8 and gcc -m64
+
+2004-02-02 11:23 rstory
+
+ * local/mib2c:
+
+ require all argument before mibNode; bail on unknown option; warn if multiple
+ mibNodes specified; new 'balanced' flag for process; define/use new m2c_die
+ that spits out current line in conf file; replace 'break' with 'next'; bail
+ on elseif; bail on unbalanced conf file (many tweaks to make that work);
+ remove unused skipif; fix currentline updates in foreach loops; exit w/error
+ if conf file not found
+
+2004-02-02 11:06 rstory
+
+ * local/: mib2c.create-dataset.conf, mib2c.iterate.conf
+:
+
+ add explicit ends for each foreach
+
+2004-02-02 10:44 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ fix up m2c_node_param_* defaults; rename node default file; set defaults for m2c_ctx_[lh|rh];
+ set up node map func defaults
+
+2004-02-02 10:23 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-body.m2i:
+
+ use new indexes_set function in example; move some code outside of example
+ condition; use value map to copy data
+
+2004-02-02 10:19 rstory
+
+ * local/mib2c-conf.d/mfd-data-access.m2c:
+
+ new indexes_set function
+
+2004-02-02 10:17 rstory
+
+ * local/mib2c-conf.d/mfd-data-set.m2c:
+
+ use mib2c next instead of break
+
+2004-02-02 10:17 rstory
+
+ * local/mib2c-conf.d/subagent.m2c:
+
+ add missing var decl
+
+2004-02-02 08:20 rstory
+
+ * local/mib2c-conf.d/generic-value-map.m2i:
+
+ use new function to map between mib/native data
+
+2004-02-02 08:00 rstory
+
+ * local/mib2c-conf.d/generic-value-map-func.m2i:
+
+ new function to map between mib/native data
+
+2004-02-02 07:59 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-set.m2i:
+
+ new function to set indexes from C types
+
+2004-02-02 07:56 rstory
+
+ * local/mib2c-conf.d/: default-mfd-top.m2c,
+ generic-ctx-copy.m2i, generic-ctx-get.m2i,
+ generic-get-char.m2i, generic-get-decl-bot.m2i,
+ generic-get-decl.m2i, mfd-data-get.m2c,
+ mfd-interface.m2c, node-get.m2i, node-set.m2i,
+ syntax-RowStatus-get.m2i:
+
+ more consistent use of m2c_ctx_[lh|rh|lhs|rhs] and m2c_node_param* vars; new
+ m2c_code_verbose flag for verbose comments in code; new value mapping func for
+ each node instead of duplicated code in mulitple funcs; use mib2c next instead
+ of break;
+
+2004-02-02 04:15 slif
+
+ * snmplib/system.c,
+ win32/encode_keychange/encode_keychange.dsp,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp, win32/snmpd/snmpd.dsp
+, win32/snmpdelta/snmpdelta.dsp,
+ win32/snmpdf/snmpdf.dsp, win32/snmpdsdk/snmpd.dsp,
+ win32/snmpget/snmpget.dsp,
+ win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpnetstat/snmpnetstat.dsp,
+ win32/snmpset/snmpset.dsp, win32/snmpstatus/snmpstatus.dsp
+, win32/snmptable/snmptable.dsp,
+ win32/snmptest/snmptest.dsp,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrapd/snmptrapd.dsp
+, win32/snmpusm/snmpusm.dsp,
+ win32/snmpvacm/snmpvacm.dsp, win32/snmpwalk/snmpwalk.dsp
+:
+
+ Restore winsock 1.1 library usage.
+
+2004-01-30 11:37 slif
+
+ * win32/snmptrapd/snmptrapd.dsp:
+
+ move netsnmp.lib to the front of the "Additional Libraries" lists.
+
+2004-01-30 11:31 slif
+
+ * win32/: snmpd/snmpd.dsp, snmpdsdk/snmpd.dsp:
+
+ move netsnmp.lib to the front of the Additional Libraries list.
+
+2004-01-30 10:29 slif
+
+ * win32/: encode_keychange/encode_keychange.dsp,
+ snmpbulkget/snmpbulkget.dsp, snmpbulkwalk/snmpbulkwalk.dsp
+, snmpd/snmpd.dsp, snmpdelta/snmpdelta.dsp,
+ snmpdf/snmpdf.dsp, snmpdsdk/snmpd.dsp,
+ snmpget/snmpget.dsp, snmpgetnext/snmpgetnext.dsp,
+ snmpnetstat/snmpnetstat.dsp, snmpset/snmpset.dsp,
+ snmpstatus/snmpstatus.dsp, snmptable/snmptable.dsp,
+ snmptest/snmptest.dsp, snmptranslate/snmptranslate.dsp
+, snmptrap/snmptrap.dsp, snmptrapd/snmptrapd.dsp
+, snmpusm/snmpusm.dsp, snmpvacm/snmpvacm.dsp,
+ snmpwalk/snmpwalk.dsp:
+
+ enable selection that will generate source browsing information.
+
+2004-01-30 10:08 slif
+
+ * agent/mibgroup/agent/nsLogging.c,
+ include/net-snmp/library/snmp_logging.h:
+
+ move extern logh_head into the logging module's header file.
+
+2004-01-30 07:25 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Remove an unwanted 'else' clause that clashes with the "common" 'else'
+ clause later in this tangle of unreadable code. (Bug #857257)
+
+2004-01-30 07:01 slif
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ restore the DATA hints that were accidentally removed.
+
+2004-01-30 06:45 dts12
+
+ * snmplib/mib.c:
+
+ Whitespace (C/R & L/F) shouldn't trigger hex string behaviour (Bug #864367)
+
+2004-01-30 06:33 dts12
+
+ * include/net-snmp/library/snmp_logging.h,
+ snmplib/snmp_logging.c:
+
+ Define a "dummy" log handler that simply discards all messages.
+ Not really a sensible thing to do, but could be used to prevent
+ turning on the "last ditch" logging to stderr (see Bug #867574)
+
+2004-01-30 06:19 dts12
+
+ * snmplib/snmp_logging.c:
+
+ Issue a warning when turning on "last ditch" logging (Bug #867574)
+
+2004-01-30 03:22 dts12
+
+ * agent/snmp_agent.c:
+
+ Handle completely empty GetBulk requests properly (Bug #877419)
+
+2004-01-30 02:50 slif
+
+ * win32/: .cvsignore, win32.opt:
+
+ fix bug #887140
+
+2004-01-30 01:39 dts12
+
+ * snmplib/tools.c:
+
+ Use 'snprint_hexstring' in the engine testing code, rather
+ than the (non-existent) 'sprint_hexstring' (Bug #886110)
+
+2004-01-29 13:03 slif
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ fix counts for certain uses of strncasecmp (i must be bored!).
+
+2004-01-29 12:32 slif
+
+ * agent/snmpd.c:
+
+ for windows service, match display name to service name.
+ for windows service description, mention mibII objects if built using SDK.
+
+2004-01-29 12:14 slif
+
+ * apps/: snmpget.c, snmpgetnext.c, snmpset.c:
+
+ use correct constant that previously applied patch refers to.
+
+2004-01-29 06:38 dts12
+
+ * apps/snmpnetstat/main.c:
+
+ Bring version handling into line with the 'snmp_parse_args' legerdemain
+
+2004-01-29 06:26 dts12
+
+ * apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, include/net-snmp/library/tools.h:
+
+ Validate the request against the maximum number of varbinds supported
+ (Patch #826714 from Jeremy Puhlman)
+
+2004-01-29 06:13 dts12
+
+ * include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ mibs/Makefile.in, mibs/NET-SNMP-TC.txt,
+ mibs/TRANSPORT-ADDRESS-MIB.txt, snmplib/snmpUDPIPv6Domain.c
+, snmplib/snmpUnixDomain.c:
+
+ Use the officially defined transport OIDs
+ (Patch #828766 from Juergen Schoenwaelder)
+
+2004-01-29 05:53 dts12
+
+ * agent/mibgroup/: host/hr_device.c, host/hr_disk.c,
+ host/hr_filesys.c, host/hr_network.c,
+ host/hr_partition.c, host/hr_storage.c,
+ host/hr_swrun.c, host/hr_system.c,
+ ucd-snmp/logmatch.c, ucd-snmp/memory.c,
+ ucd-snmp/memory_aix4.c, ucd-snmp/memory_dynix.c,
+ ucd-snmp/memory_freebsd2.c, ucd-snmp/memory_hpux.c,
+ ucd-snmp/memory_netbsd1.c, ucd-snmp/memory_solaris2.c
+:
+
+ Increase assorted fixed buffer sizes. (Patch #836395 from Howard Wilkinson)
+
+2004-01-29 05:35 dts12
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Reject attempts to delete a 'permanent' row
+ (Patch #837427 from Bob Rowlands)
+
+2004-01-29 04:23 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ Protect against freeing an empty contextEngineID
+ (Which shouldn't happen, but seems to occur under Windows)
+ (Patch #840830 from Alex Burger)
+
+2004-01-29 03:47 dts12
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/read_config.c:
+
+ Mechanism to completely disable the handling of persistent configuration files.
+ Note that enabling this would break the functionality of an SNMPv3 agent.
+ (Patch #849159 from Stephen J. Friedl)
+
+2004-01-29 03:39 dts12
+
+ * snmplib/: snmp_api.c, snmp_enum.c:
+
+ Properly release various resources when shutting down the library.
+ (Patch #849154 from Stephen J. Friedl)
+
+2004-01-29 01:44 dts12
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Provide missing config definition template for 'ssize_t' flag
+ (Patch #886655 from Andy Smith)
+
+2004-01-28 20:39 slif
+
+ * win32/: encode_keychange/encode_keychange.dsp,
+ libsnmp_dll/libsnmp_dll.dsp, snmpbulkget/snmpbulkget.dsp
+, snmpbulkwalk/snmpbulkwalk.dsp, snmpd/snmpd.dsp
+, snmpdelta/snmpdelta.dsp, snmpdf/snmpdf.dsp,
+ snmpdsdk/snmpd.dsp, snmpget/snmpget.dsp,
+ snmpgetnext/snmpgetnext.dsp, snmpnetstat/snmpnetstat.dsp
+, snmpset/snmpset.dsp, snmpstatus/snmpstatus.dsp
+, snmptable/snmptable.dsp, snmptest/snmptest.dsp
+, snmptranslate/snmptranslate.dsp,
+ snmptrap/snmptrap.dsp, snmptrapd/snmptrapd.dsp,
+ snmpusm/snmpusm.dsp, snmpvacm/snmpvacm.dsp,
+ snmpwalk/snmpwalk.dsp:
+
+ no incremental link on Debug (prevents generation of .ilk file)
+
+2004-01-28 18:44 slif
+
+ * agent/mibgroup/agentx/master.c:
+
+ ifdef around variables used only when UNIX transports are supported.
+
+2004-01-28 17:57 slif
+
+ * snmplib/system.c:
+
+ invoke winsock ver 2.2
+
+2004-01-28 17:34 slif
+
+ * win32/: mib_module_includes.h, mib_module_inits.h,
+ encode_keychange/encode_keychange.dsp,
+ libagent/libagent.dsp, libhelpers/libhelpers.dsp,
+ libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp.def,
+ libsnmp_dll/libsnmp_dll.dsp,
+ net-snmp/agent/mib_module_config.h,
+ netsnmpmibs/netsnmpmibs.dsp,
+ netsnmpmibssdk/netsnmpmibssdk.dsp,
+ snmpbulkget/snmpbulkget.dsp, snmpbulkwalk/snmpbulkwalk.dsp
+, snmpd/snmpd.dsp, snmpdelta/snmpdelta.dsp,
+ snmpdf/snmpdf.dsp, snmpdsdk/snmpd.dsp,
+ snmpget/snmpget.dsp, snmpgetnext/snmpgetnext.dsp,
+ snmpnetstat/snmpnetstat.dsp, snmpset/snmpset.dsp,
+ snmpstatus/snmpstatus.dsp, snmptable/snmptable.dsp,
+ snmptest/snmptest.dsp, snmptranslate/snmptranslate.dsp
+, snmptrap/snmptrap.dsp, snmptrapd/snmptrapd.dsp
+, snmpusm/snmpusm.dsp, snmpvacm/snmpvacm.dsp,
+ snmpwalk/snmpwalk.dsp:
+
+ consistent project settings; no C runtime conflicts; link with winsock ver 2.2
+
+2004-01-28 17:28 slif
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ remove unnecessary hack for chown.
+
+2004-01-28 14:56 slif
+
+ * snmplib/snmp_logging.c:
+
+ dereference pri_max to test return from decode_priority
+
+2004-01-28 14:54 slif
+
+ * agent/mibgroup/Rmon/: agutil.c, alarm.c, event.c
+, history.c, rows.c, statistics.c:
+
+ find platform-appropriate substitute for sys/time.h
+ fix minor type cast warnings. remove one unused variable.
+
+2004-01-28 08:40 dts12
+
+ * testing/RUNTESTS:
+
+ Import SNMP_SLEEP time from environment, if available
+ (Patch #850957 from Johannes Schmidt-Fischer,
+ merging a change from the 5.0.x branch)
+
+2004-01-28 08:04 dts12
+
+ * agent/mibgroup/util_funcs.c:
+
+ Ensure the size of the exec-cache is handled correctly on 64-bit systems
+ (Patch #860575 by Bob Rowlands)
+
+2004-01-28 07:55 dts12
+
+ * perl/: OID/OID.xs, SNMP/SNMP.xs, agent/agent.xs
+:
+
+ Be more cautious about the maximum length of OIDs (Patch 862183 by Austin Schutz)
+
+2004-01-28 07:41 dts12
+
+ * snmplib/mib.c:
+
+ Guard against a missing IP address structure (Patch #861939 by Dan Mongrain)
+
+2004-01-28 07:38 dts12
+
+ * snmplib/snmp_logging.c:
+
+ Merge Neils' 5.1.x changes into the main development tree.
+ (Seems to include patches #855170 and #858519)
+
+2004-01-28 06:55 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ don't chown/chmod if unix domain support not enabled
+
+2004-01-28 06:54 dts12
+
+ * configure, configure.in:
+
+ Check for perl 5.8 entry point. (Patch #854395)
+
+2004-01-28 06:23 rstory
+
+ * Makefile.rules:
+
+ fix install so that subdir libs are installed before bins, noted by the
+ ever-so-helpful Johannes Schmidt-Fischer.
+
+2004-01-28 04:22 dts12
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Increase the (fixed) number of disks handled (patch #884859)
+
+2004-01-28 04:18 dts12
+
+ * Makefile.in:
+
+ Install the mingw32.h system header file (patch #884100)
+
+2004-01-28 04:13 dts12
+
+ * configure.in, configure,
+ include/net-snmp/system/mingw32.h:
+
+ Check for the existence of ssize_t, and don't redefine it when
+ using the WinGW compiler. (Patch #881752)
+
+2004-01-28 03:55 dts12
+
+ * include/net-snmp/agent/table_mfd.h:
+
+ Remove two redundent forward declarations (patch #873326)
+
+2004-01-28 02:07 slif
+
+ * apps/snmpnetstat/inet.c:
+
+ inetprint allots max 22 chars for address + 8 chars for port.
+ change to 18 address + 12 port, so that more of the port is displayed.
+
+2004-01-27 22:42 slif
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ indicate Win32 has locale.h malloc.h memory.h.
+ do not set bsdlike or USExxMIB or SECURITYEXCEPTIONS
+ re-format like the Net-SNMP configured net-snmp-config.h.
+
+2004-01-27 22:34 slif
+
+ * acconfig.h, ov/oid_to_sym.in, ov/oid_to_type.in
+:
+
+ update support for OpenBSD, HP-UX/11, and Win32 sysObjectID .
+
+2004-01-27 21:49 slif
+
+ * agent/helpers/table_mfd.c, snmplib/container_iterator.c
+:
+
+ provide function hints in lieu of __FUNCTION__
+
+2004-01-27 13:46 slif
+
+ * include/net-snmp/agent/agent_trap.h:
+
+ Add declarations for functions used in apps/snmptrapd_handler.c
+
+2004-01-27 13:15 slif
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ no chown() on Win32 -- compiles to nothing.
+
+2004-01-27 10:55 slif
+
+ * win32/: win32.dsw, win32sdk.dsw:
+
+ build independent projects (libraries) before dependent projects.
+ remove incomplete dependency specification to build all faster.
+
+2004-01-27 10:12 slif
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Re-arranged the declarations of variables and/or compile constants,
+ so that the variables are declared only if needed.
+
+2004-01-27 10:11 slif
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Supplied "return 0" to extensible_unregister(), a function returning int.
+
+2004-01-27 09:59 slif
+
+ * snmplib/container.c:
+
+ cast to void the argument to free().
+
+2004-01-27 09:57 slif
+
+ * snmplib/mib.c:
+
+ use u_char type cast instead of masking with 0xFF.
+
+2004-01-27 09:52 slif
+
+ * snmplib/asn1.c:
+
+ move conditional expression within type cast scope,
+ for the benefit of some compilers.
+
+2004-01-27 09:50 slif
+
+ * include/net-snmp/library/container.h:
+
+ spellcheck: netsnmp_container_free_list
+
+2004-01-27 09:46 slif
+
+ * apps/snmptrapd.c:
+
+ declare init_subagent near its only reference.
+
+2004-01-27 09:45 slif
+
+ * snmplib/snmp_logging.c:
+
+ remove unused variable from Win32 code.
+
+2004-01-27 09:44 slif
+
+ * agent/mibgroup/utilities/execute.c:
+
+ move HAVE_EXECV compile test earlier in the function to not introduce unused variables.
+
+2004-01-27 09:41 slif
+
+ * agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/agentx/master.c
+, agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/udpTable.c
+, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/utilities/override.c,
+ apps/notification_log.c, apps/snmpvacm.c,
+ snmplib/container_binary_array.c,
+ snmplib/container_list_ssll.c, snmplib/mib.c,
+ snmplib/oid_stash.c, snmplib/snmpUDPDomain.c,
+ snmplib/snmp_api.c, snmplib/snmp_enum.c,
+ snmplib/snmp_transport.c:
+
+ quiet compiler warnings using appropriate type casting.
+
+2004-01-27 09:24 slif
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c,
+ include/net-snmp/version.h, snmplib/snmp_version.c,
+ win32/libsnmp_dll/libsnmp.def:
+
+ Refer to the netsnmp library version string via netsnmp_get_version;
+ Keep direct string reference iff UCD_COMPATIBLE is defined.
+
+2004-01-27 09:07 slif
+
+ * snmplib/: snmpTCPDomain.c, snmpUDPDomain.c:
+
+ Avoid conversion macros when forming host copy of 16-bit port value
+
+2004-01-27 09:07 slif
+
+ * snmplib/snmp-tc.c:
+
+ Dont force unsigned short onto two unsigned chars.
+ Be more explicit in the treatment of the year component.
+
+2004-01-27 09:02 slif
+
+ * agent/mibgroup/mibII/: tcpTable.c, udpTable.c:
+
+ Win32 allocates TCP and UDP connection structures that consist of
+ a 32-bit count followed by a per connection table. When freeing the table,
+ find the beginning of the structure. The TCP table incorrectly counted
+ established TCP connections, fixed with this change.
+
+2004-01-27 08:58 slif
+
+ * include/net-snmp/net-snmp-config.h.in,
+ win32/config.h.borland, win32/net-snmp/net-snmp-config.h
+:
+
+ support Win32 in OSTYPE definition.
+
+2004-01-27 08:54 slif
+
+ * agent/: snmpd.c, mibgroup/agentx/master.c:
+
+ include io.h for Win32 to introduce the close() function
+
+2004-01-27 07:48 slif
+
+ * win32/: libhelpers/.cvsignore, net-snmp/.cvsignore,
+ net-snmp/agent/.cvsignore, net-snmp/library/.cvsignore
+, netsnmpmibs/.cvsignore, netsnmpmibssdk/.cvsignore
+, snmpdsdk/.cvsignore:
+
+ provide a CVS filter to every subdir under win32.
+
+2004-01-27 07:34 slif
+
+ * win32/: libagent/libagent.def, libucdmibs/libucdmibs.def
+:
+
+ convert to DOS format to keep certain IDE happy.
+
+2004-01-27 07:27 slif
+
+ * win32/mib_module_config.h:
+
+ this file is superseded by win32/net-snmp/agent/mib_module_config.h.
+
+2004-01-27 07:23 slif
+
+ * include/net-snmp/library/winservice.h, snmplib/winservice.c
+:
+
+ changes approved by author provide more readable formatting and comments.
+
+2004-01-27 07:22 slif
+
+ * include/net-snmp/library/winservice.h, snmplib/winservice.c
+:
+
+ remove CR characters from these sources.
+
+2004-01-27 07:19 slif
+
+ * README.Panasonic_AM3X.txt:
+
+ convert CRLF to newline
+
+2004-01-27 07:04 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Forward traps to port 162 by default.
+
+2004-01-26 15:56 rstory
+
+ * snmplib/data_list.c:
+
+ quiet compiler warning
+
+2004-01-26 15:55 rstory
+
+ * snmplib/container_binary_array.c:
+
+ don't hardcode pointer size; noted on coders by rajesh arumugam
+
+2004-01-26 04:19 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Fix the ordering of hostname and IP address as passed to trap handler
+ (Bug #882071 and others)
+
+2004-01-26 04:15 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Convert v1 traps to v2 format before passing it to the trap handler
+ (plus merging the other 5.1.x patches into the main development tree)
+
+2004-01-26 02:47 dts12
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Ensure that hrFSTable indexes are consistent across the lifetime of
+ the agent.
+
+2004-01-26 02:43 dts12
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Align hrFSStorageIndex values with hrStorageTable (bug #882987)
+
+2004-01-20 05:48 rstory
+
+ * README:
+
+ Add Andy Smith to contributors
+
+2004-01-20 05:40 rstory
+
+ * configure:
+
+ update for new confiure.in
+
+2004-01-20 05:28 rstory
+
+ * include/net-snmp/system/mingw32.h:
+
+ partial application of 860980: Fix for mingw32.h
+
+2004-01-20 05:17 rstory
+
+ * configure.in:
+
+ apply patch 843679: Configure patch for MinGW
+
+2004-01-14 06:03 dts12
+
+ * agent/mibgroup/mibII/ifTable.c:
+
+ Fix handling of 64-bit counters, and use the correct /proc interface file
+ (not the temporary debugging version!)
+
+2004-01-14 05:41 dts12
+
+ * agent/mibgroup/mibII/: ifTable.c, ifTable.h:
+
+ Provisional re-implementation of IF-MIB::ifTable and IF-MIB::ifXTable
+ Linux support only (and some objects are missing),
+ but it should give the general flavour.
+
+2004-01-14 05:37 dts12
+
+ * include/net-snmp/library/snmp_enum.h, snmplib/snmp_enum.c
+:
+
+ New interfaces to find an unused value within an enumeration list.
+
+2004-01-13 20:16 rstory
+
+ * agent/mibgroup/agentx/master.c,
+ win32/net-snmp/agent/mib_module_config.h:
+
+ undo inadvertent checkin
+
+2004-01-13 20:13 rstory
+
+ * agent/helpers/: cache_handler.c, row_merge.c,
+ table_iterator.c:
+
+ undo inadvertent checkin
+
+2004-01-13 20:09 rstory
+
+ * include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/library/snmp_debug.h,
+ mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ undo inadvertent checkin
+
+2004-01-13 20:03 rstory
+
+ * Makefile.in, agent/snmp_vars.c:
+
+ undo inadvertent checkin
+
+2004-01-13 10:23 rstory
+
+ * agent/mibgroup/mibII/: interfaces.c, interfaces.h:
+
+ undo inadvertent checkin
+
+2004-01-11 16:45 rstory
+
+ * local/mib2c.conf:
+
+ fix typo, noted on coders by Oleg Ivanov
+
+2004-01-11 16:43 rstory
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt, snmplib/container.c,
+ win32/net-snmp/agent/mib_module_config.h, agent/snmp_vars.c
+, agent/helpers/cache_handler.c,
+ agent/helpers/row_merge.c, agent/helpers/table_iterator.c
+, agent/mibgroup/agentx/master.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h,
+ include/net-snmp/agent/cache_handler.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/system/netbsd.h,
+ local/mib2c.check_values.conf, Makefile.in:
+
+ fix range checking code, noted on coders by Oleg Ivanov
+
+2004-01-07 09:40 rstory
+
+ * local/mib2c-conf.d/: m2c_setup_node.m2i,
+ mfd-access-unsorted-external-body.m2i,
+ mfd-access-unsorted-external-header.m2i, mfd-data-set.m2c
+, mfd-interface.m2c, mfd-top.m2c,
+ subagent.m2c:
+
+ if needlength not set, set varbind val_len for GETs, validate val_len on set;
+ don't declares functions which can't be inlined as inline; comment tweaks
+
+2004-01-06 14:40 hardaker
+
+ * snmplib/mib.c:
+
+ - translate a MIB type of IPADDR to IPADDRESS instead of OCTET_STRING.
+ - small other bug fix
+
+2004-01-06 14:39 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ change the manual so it doesn't reference UCD-SNMP v3 (ahem)
+
+2004-01-06 14:38 hardaker
+
+ * local/mib2c:
+
+ proper sorting when NetSNMP::OID is available.
+
+2004-01-01 16:53 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ only set defaults if not already set
+
+2003-12-30 20:34 hardaker
+
+ * perl/OID/: OID.xs, test.pl:
+
+ handle implied indexes
+
+2003-12-30 19:33 hardaker
+
+ * perl/OID/: OID.pm, OID.xs, test.pl:
+
+ A new ->get_indexes() method to return the extracted indexes from a OID.
+
+2003-12-30 15:19 rstory
+
+ * local/mib2c:
+
+ allow: separated paths in MIB2C_DIR env var
+
+2003-12-30 15:15 rstory
+
+ * local/mib2c-conf.d/: m2c_setup_enum.m2i, m2c_setup_node.m2i
+:
+
+ unquote uc calls, since eval with interpret as a literal and I can't
+ reproduce the 'bareword' problem that made me quote in the first place
+
+2003-12-29 12:03 rstory
+
+ * local/mib2c-conf.d/: mfd-interface.m2c, mfd-top.m2c
+:
+
+ remove unused request_mode
+
+2003-12-26 12:54 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ rename vars for clarification: ${table}_ctx* -> ${table}_rowreq_ctx*; add
+ vars for mfd_defaults; use new mib2c push/pop to generate per table defaults
+ file default-table-$table.m2d containing current values of some m2c vars
+
+2003-12-26 12:52 rstory
+
+ * local/mib2c-conf.d/: generic-get-char.m2i,
+ mfd-access-unsorted-external-body.m2i,
+ mfd-access-unsorted-external-header.m2i,
+ mfd-access-unsorted-external-interface.m2i,
+ mfd-access-unsorted-external-readme.m2i, mfd-data-get.m2c
+, mfd-data-set.m2c, mfd-interface.m2c,
+ mfd-readme.m2c, mfd-top.m2c, node-get.m2i,
+ node-set.m2i, parent-dependencies.m2i, parent-set.m2i
+, syntax-InetAddress-get.m2i,
+ syntax-InetAddressType-get.m2i:
+
+ rename vars for clarification: itr_ctx* -> loop_ctx*, loop* -> loop_ctx*,
+ ${table}_ctx* -> ${table}_rowreq_ctx*
+
+2003-12-26 12:32 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ quote assignment of uppercased name, so values that start with a digit don't
+ get interpreted as a bare word; chg debug print to comment
+
+2003-12-26 12:31 rstory
+
+ * local/mib2c-conf.d/: details-enums.m2i,
+ generic-value-map-reverse.m2i, generic-value-map.m2i,
+ m2c_setup_enum.m2i:
+
+ quote assignment of uppercased name, so values that start with a digit don't
+ get interpreted as a bare word; consolidate $m2c_enamey/$m2c_iname processing
+ into m2c_setup_enum.m2i
+
+2003-12-23 07:19 rstory
+
+ * dist/README.build-scripts:
+
+ remove deprecated option from example
+
+2003-12-23 07:18 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ change default rpm build instructions to embed perl
+
+2003-12-23 07:17 rstory
+
+ * dist/net-snmp.spec:
+
+ re-work perl options to fix problem w/configure argument quoting
+
+2003-12-23 02:00 dts12
+
+ * README.win32:
+
+ Note that Cygwin no longer needs a separate regex library
+ Reported by John McCash
+
+2003-12-22 16:56 rstory
+
+ * local/mib2c:
+
+ add push/pop; re-work index/internalindex/externalindex/nonindex setup
+
+2003-12-19 20:38 hardaker
+
+ * local/: Makefile.in, mib2c.access_functions.conf,
+ mib2c.array-user.conf, mib2c.check_values.conf,
+ mib2c.conf:
+
+ Patch from Brian Buesker to fix misc problems (variable {}ing, ...)
+
+2003-12-18 01:58 dts12
+
+ * man/snmpnetstat.1:
+
+ Fix more markup errors, reported by Eric Raymond.
+
+2003-12-16 02:00 dts12
+
+ * include/net-snmp/agent/table_mfd.h:
+
+ Be consistent in use of forward definitions (explicit vs implicit struct)
+ Reported by Magnus Fromreide
+
+2003-12-11 18:56 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ update rpm build instructions
+
+2003-12-11 18:52 rstory
+
+ * dist/Makefile:
+
+ fix updated perl options for new rpm method
+
+2003-12-11 18:41 rstory
+
+ * dist/Makefile:
+
+ remove VER/REL, use VERSION/RELEASE; update perl options for new rpm method;
+ add target to build rpm tree; don't hardcode architecture
+
+2003-12-11 18:38 rstory
+
+ * local/Version-Munge.pl:
+
+ document -D option; add Makefile type
+
+2003-12-11 18:22 rstory
+
+ * dist/net-snmp.spec:
+
+ don't require perl; add note on vendor releases
+
+2003-12-11 08:10 rstory
+
+ * agent/helpers/cache_handler.c:
+
+ run indent
+
+2003-12-11 08:00 rstory
+
+ * agent/helpers/cache_handler.c:
+
+ move logic to skip when caching disable, no cache found or cache disabled
+
+2003-12-10 06:44 rstory
+
+ * dist/nsb-nightly:
+
+ delay sourcing of nsb-functions; mv rc file into ~/.snmp; remove build dir
+ on success
+
+2003-12-10 06:43 rstory
+
+ * dist/nsb-package:
+
+ delay sourcing of nsb-functions; mv rc file into ~/.snmp
+
+2003-12-10 06:17 rstory
+
+ * dist/nsb-functions:
+
+ new vars: NSB_VERSION NSB_BUILD_SUFFIX; don't use hostname -s, since sun
+ doesn't support it; tweak default paths
+
+2003-12-10 02:41 dts12
+
+ * man/: mib_api.3.def, snmp.conf.5.def,
+ snmp_config.5.def:
+
+ Fix assorted markup errors, reported by Eric Raymond.
+
+2003-11-30 14:25 rstory
+
+ * include/net-snmp/library/system.h:
+
+ fix scope of have_dirent ifdef
+
+2003-11-30 14:23 rstory
+
+ * agent/helpers/table_mfd.c:
+
+ add comments; remove assert on valid condition
+
+2003-11-30 14:21 rstory
+
+ * agent/helpers/table.c:
+
+ debug msg when skipping vb with bogus index
+
+2003-11-30 14:19 rstory
+
+ * agent/helpers/baby_steps.c:
+
+ readability fix - use macro instead of hardcoded value
+
+2003-11-28 05:41 dts12
+
+ * agent/helpers/table_data.c,
+ include/net-snmp/agent/table_data.h:
+
+ If a row is created via a SET request, then it needs to be made available
+ to the other columns and passes. Provide a mechanism for inserting this
+ into the request list.
+ (This looks suspiciously similar to another recent patch:-) Does
+ this functionality perhaps belong within the top-level 'table' handler?)
+
+2003-11-25 15:48 hardaker
+
+ * local/mib2c:
+
+ - support $node.description
+ - support @printf ...@
+
+2003-11-25 12:47 rstory
+
+ * dist/nsb-functions:
+
+ tweak default build dirs; default to host/version instead of platform/version
+ (since sf build hosts keep changing platforms)
+
+2003-11-25 12:44 rstory
+
+ * dist/nsb-package:
+
+ move dir munging in nsb-functions
+
+2003-11-24 09:54 hardaker
+
+ * local/Version-Munge.pl:
+
+ version stamp the .spec file
+
+2003-11-24 09:53 hardaker
+
+ * dist/net-snmp.spec:
+
+ version number change
+
+2003-11-24 09:38 hardaker
+
+ * FAQ:
+
+ add a greece mirror
+
+2003-11-24 06:37 dts12
+
+ * snmplib/snmpusm.c:
+
+ Handle invalid (64-bit) values for engine boots & time
+ Patch #827044 by Bob Rowlands, fixing bug #809250
+
+2003-11-24 06:23 dts12
+
+ * apps/snmpusm.c:
+
+ Correct usage information for -Cx options
+ Patch #818766 by Bob Rowlands, fixing bug #818634
+
+2003-11-24 04:00 dts12
+
+ * agent/mibgroup/host/hr_device.c:
+
+ Handle GETNEXT requests on the hrDeviceTable with a "too large" index.
+ Patch #811717 by Bob Rowlands, fixing bug #807315
+
+2003-11-21 09:13 dts12
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Correct handling of UCD diskio values on 64-bit Solaris.
+ Patch #809255 by Bob Rowlands, to fix bug #808975
+
+2003-11-21 09:08 dts12
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Fix Solaris implementation of ifInNUcastPkts & ifOutNUcastPkts
+ Patch #808807 by Bob Rowlands, to fix bugs #808399 & #808417
+
+2003-11-21 08:10 dts12
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Implement ifSpecific object on Solaris.
+ Patch #808746 by Bob Rowlands, fixing bug #808430
+
+2003-11-21 07:23 dts12
+
+ * snmplib/system.c:
+
+ Ensure 32-bit timeticks value returned on Solaris kit.
+ Patch #808074 by Bob Rowlands, to fix bug #807796
+
+2003-11-21 07:18 dts12
+
+ * agent/mibgroup/utilities/override.c:
+
+ Return an error on failed overrride write.
+ Patch #808054 by Bob Rowlands, fixing bug #805254
+
+2003-11-21 06:30 dts12
+
+ * man/: snmp.conf.5.def, snmpd.conf.5.def,
+ snmpusm.1.def:
+
+ Minor clarifications to a few man pages.
+ Patch #807937 from Bob Rowlands
+
+2003-11-21 06:25 dts12
+
+ * apps/snmpdf.c:
+
+ Handle storage units <1024 bytes
+ (Patch #801341 by Bob Rowlands, fixing bug #757448)
+
+2003-11-21 05:21 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ When we reach the end of the last table, make sure that the higher level
+ handlers will realise this, and move on to the next registered module.
+ Also catch missing columns when processing GETNEXT requests.
+
+2003-11-21 04:19 dts12
+
+ * agent/agent_trap.c:
+
+ Support acknowledged notifications (Inform and AgentX Notify) as
+ well as unacknowledged ones. First reported by david@grancanaria
+ Probably doesn't resend if no response is received.
+
+2003-11-20 07:09 dts12
+
+ * agent/mibgroup/examples/netSnmpHostsTable.c:
+
+ Move suffix processing within the request loop, since v5.1 iterator
+ handlers may receive multiple request varbinds. Fix provided by Barb Roesch
+
+2003-11-20 06:36 dts12
+
+ * agent/agent_registry.c:
+
+ Protect 'unregister_mibs_by_session' from being called with a NULL
+ session pointer. (Used when unregistering "internal" MIB modules)
+
+2003-11-20 01:39 dts12
+
+ * agent/mibgroup/mibII/udp.c:
+
+ Be consistent in use of return variable name for HP-UX 11
+ (Fixed bug #845460)
+
+2003-11-19 16:23 rstory
+
+ * configure:
+
+ configure to match new configure.in
+
+2003-11-19 16:21 rstory
+
+ * configure.in, snmplib/Makefile.in:
+
+ don't use non-portable .c=.o type substitutions in makefile; thus put obj/lobj
+ generation back in configure
+
+2003-11-19 07:40 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Enable retries on GetNext noSuchInstance exceptions. Fixes bug #843842
+
+2003-11-19 07:32 dts12
+
+ * include/net-snmp/agent/watcher.h, agent/helpers/watcher.c
+:
+
+ Fix watched timestamp registration. 'marker_t' is already a pointer,
+ so doesn't need further dereferencing!
+
+2003-11-17 09:17 dts12
+
+ * agent/mibgroup/agent/nsLogging.c:
+
+ Fix creation of new logging entries.
+
+2003-11-17 09:12 dts12
+
+ * agent/helpers/table_iterator.c,
+ include/net-snmp/agent/table_iterator.h:
+
+ If a row is created via a SET request, then it needs to be inserted into
+ the iteration data structures, so that it's available to other columns & passes.
+
+2003-11-17 09:06 dts12
+
+ * snmplib/snmp_logging.c:
+
+ Release the data structure once it's no longer needed.
+
+2003-11-17 02:58 dts12
+
+ * agent/mibgroup/: mibII/tcp.c, ucd-snmp/vmstat.c:
+
+ Avoid using the variable name 'hz' (which gets corrupted on AIX and HPUX
+ by system redefinitions). See bug #842475 & #842483
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0.9 -> V5.1
+
+2003-11-13 18:46 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ reverse 5.x and 4.x listing since, um, this is 5.x (again)
+
+2003-11-13 18:44 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ reverse 5.x and 4.x listing since, um, this is 5.x
+
+2003-11-13 18:42 hardaker
+
+ * man/: netsnmp_Container_iterator.3, netsnmp_agent.3,
+ netsnmp_baby_steps.3, netsnmp_bulk_to_next.3,
+ netsnmp_cache_handler.3, netsnmp_container.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_deprecated.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_iterator_info_s.3,
+ netsnmp_leaf.3, netsnmp_library.3,
+ netsnmp_mfd_pdu_context_s.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_methods.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_row_merge.3, netsnmp_scalar.3,
+ netsnmp_scalar_group_group.3, netsnmp_serialize.3,
+ netsnmp_stash_cache.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_util.3, netsnmp_utilities.3
+, netsnmp_watcher.3:
+
+ update for 5.1
+
+2003-11-13 18:21 hardaker
+
+ * NEWS:
+
+ update for 5.1
+
+2003-11-13 18:14 hardaker
+
+ * perl/: ASN/Makefile.PL, OID/Makefile.PL,
+ SNMP/Makefile.PL, agent/Makefile.PL,
+ agent/default_store/Makefile.PL, default_store/Makefile.PL
+:
+
+ patch #838112 to fix windows perl building
+
+2003-11-13 17:28 rstory
+
+ * local/mib2c:
+
+ fix regexp for duplicate index exclusion to only match whole words
+
+2003-11-13 15:03 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document stash_cache
+
+2003-11-13 14:47 hardaker
+
+ * agent/mibgroup/agent/: nsCache.c, nsDebug.c,
+ nsLogging.c:
+
+ - properly check for the ->processed flag.
+ - (fixes a bug pointed out by Bruce where a getnext returned noSuchInstance)
+
+2003-11-13 12:11 rstory
+
+ * agent/helpers/table.c:
+
+ don't call handlers for error recovery if they hadn't been called for at least
+ reserve1 (e.g. set w/invalid indexes)
+
+2003-11-13 11:34 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ fix void definition for netsnmp_assert when debugging disabled, noted on coders
+
+2003-11-13 11:32 rstory
+
+ * README.win32:
+
+ apply patch [ 841463 ] 5.1rc1 README.win32 changes
+
+2003-11-12 09:25 dts12
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Providee missing declaration for Route_Scan_Reload
+ HP-UX 11 only. Latest in the saga of bug # 840615
+
+2003-11-12 04:55 dts12
+
+ * agent/mibgroup/mibII/: icmp.c, ip.c, tcpTable.c
+:
+
+ Fix more HP-UX 11 specific bogus code.
+ Tracking Bug #840615
+
+2003-11-12 02:38 dts12
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ Use correct variable for detecting which object is being processed.
+ (HPUX-11 only - fixes bug #840615)
+
+2003-11-10 14:39 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.1.rc1 )
+
+2003-11-10 14:39 hardaker
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.1.rc1 )
+
+2003-11-10 14:39 hardaker
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.1.rc1 )
+
+2003-11-10 14:39 hardaker
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.1.rc1 )
+
+2003-11-10 14:38 hardaker
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.1.rc1 )
+
+2003-11-10 14:38 hardaker
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.1.rc1 )
+
+2003-11-10 14:38 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.1.rc1 )
+
+2003-11-10 14:38 hardaker
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.1.rc1 )
+
+2003-11-10 14:38 hardaker
+
+ * README:
+
+ - (README): version tag ( 5.1.rc1 )
+
+2003-11-10 14:38 hardaker
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.1.rc1 )
+
+2003-11-10 14:28 hardaker
+
+ * agent/Makefile.depend, agent/mibgroup/Makefile.depend
+, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2003-11-10 08:47 rstory
+
+ * snmplib/system.c:
+
+ don't double create temp directory
+
+2003-11-10 08:46 rstory
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ always use inline, now that it works (needed extern)
+
+2003-11-07 16:34 rstory
+
+ * local/mib2c-conf.d/: generic-data-allocate.m2i,
+ generic-table-indexes-from-oid.m2i,
+ generic-table-indexes-to-oid.m2i,
+ mfd-access-unsorted-external-body.m2i,
+ mfd-access-unsorted-external-interface.m2i, mfd-interface.m2c
+, mfd-top.m2c, node-set.m2i, parent-set.m2i
+:
+
+ use DEBUGTRACE instead of hardcoded __FUNCTION__
+
+2003-11-07 10:34 hardaker
+
+ * local/mib2c:
+
+ much better error message when a MIB node can't be found in the
+ command line arguments
+
+2003-11-07 10:27 hardaker
+
+ * local/Version-Munge.pl:
+
+ - fix sed script regexp for odd versions (pre2b, eg).
+ - make -h actually print help.
+
+2003-11-07 09:03 rstory
+
+ * local/mib2c.array-user.conf:
+
+ braces around var name
+
+2003-11-06 20:46 rstory
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ use inline to __inline from main net-snmp-config file; add extern to basic
+ NETSNMP_INLINE def, per MS tech note 123768
+
+2003-11-06 20:42 rstory
+
+ * include/net-snmp/library/system.h,
+ include/net-snmp/system/mingw32.h, snmplib/system.c:
+
+ apply patch [ 828362 ] First pass at MinGW32
+
+2003-11-06 20:29 rstory
+
+ * snmplib/: system.c (V5-0-patches.2), system.c:
+
+ apply patch [ 836162 ] 5.1pre3 win32 mkdirhier()
+
+2003-11-06 20:00 rstory
+
+ * win32/: encode_keychange/encode_keychange.dsp,
+ libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp.def,
+ libsnmp_dll/libsnmp_dll.dsp, snmpbulkget/snmpbulkget.dsp
+, snmpbulkwalk/snmpbulkwalk.dsp, snmpd/snmpd.dsp,
+ snmpdelta/snmpdelta.dsp, snmpdf/snmpdf.dsp,
+ snmpdsdk/snmpd.dsp, snmpget/snmpget.dsp,
+ snmpgetnext/snmpgetnext.dsp, snmpnetstat/snmpnetstat.dsp
+, snmpset/snmpset.dsp, snmpstatus/snmpstatus.dsp,
+ snmptable/snmptable.dsp, snmptest/snmptest.dsp,
+ snmptranslate/snmptranslate.dsp, snmptrap/snmptrap.dsp,
+ snmptrapd/snmptrapd.dsp, snmpusm/snmpusm.dsp,
+ snmpvacm/snmpvacm.dsp, snmpwalk/snmpwalk.dsp:
+
+ apply patch [ 837633 ] 5.1pre3 win32 lib rename
+
+2003-11-06 16:05 rstory
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ restore accidentally deleted \n in trace macro
+
+2003-11-05 19:13 rstory
+
+ * snmplib/snmp_client.c:
+
+ comment for possible future optimization
+
+2003-11-05 19:13 rstory
+
+ * agent/mibgroup/util_funcs.c:
+
+ apply spirit of patch 836721: use new tmp file pattern macro; use _open on
+ windows; add err log & debug msg; include sys/stat.h iff exists
+
+2003-11-05 19:05 rstory
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ apply spirit of patch 836721: define HAVE_SYSTEM; add new tmp file pattern macro
+
+2003-11-05 19:02 rstory
+
+ * agent/mibgroup/utilities/execute.c:
+
+ apply spirit of patch 836721 for run_shell_command: test for bad return codes
+ from functions; don't touch out_len if output not set or out_len is null
+
+2003-11-05 18:55 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ regenerate from aclocal.h, which reveals that we can't do an ifdef test
+ to prevent redefining PACKAGE_* unless it is manually re-added each time
+ this file is regenerated from acconfig.h. Blech.
+
+2003-11-05 18:50 rstory
+
+ * acconfig.h:
+
+ add macro for temp file name (configure option tbd)
+
+2003-11-05 18:14 rstory
+
+ * README.win32:
+
+ apply patch [ 833216 ] 5.1.pre3 Win32 compile patch
+
+2003-11-05 18:13 rstory
+
+ * configure:
+
+ configure to match new config.in
+
+2003-11-05 18:11 rstory
+
+ * configure.in:
+
+ include mibgroup utilities for mini-agent (run_shell_command for snmptrapd)
+
+2003-11-05 09:36 rstory
+
+ * local/mib2c-conf.d/: generic-ctx-copy.m2i,
+ generic-ctx-get.m2i, generic-ctx-set.m2i,
+ generic-data-context.m2i, generic-table-indexes-from-oid.m2i
+, generic-table-indexes-to-oid.m2i, mfd-interface.m2c
+:
+
+ always convert generated array len to array element count (not bytes)
+
+2003-11-05 02:52 dts12
+
+ * apps/: snmptable.c (V5-0-patches.1), snmptable.c:
+
+ Don't try searching for column objects if there isn't anything to search.
+ Report problems using the object name originally specified, rather than
+ a temporary internal buffer.
+
+2003-11-04 15:06 rstory
+
+ * win32/: libsnmp_dll/libsnmp_dll.dsp,
+ net-snmp/net-snmp-config.h:
+
+ INLINE changes - don't use inline for the DLL version, as it's reported to
+ cause errors
+
+2003-11-04 14:45 rstory
+
+ * win32/: win32.dsw, win32sdk.dsw,
+ libhelpers/libhelpers.dsp, libsnmp_dll/libsnmp.def,
+ netsnmpmibs/netsnmpmibs.dsp:
+
+ apply patch [ 833216 ] 5.1.pre3 Win32 compile patch
+
+2003-11-04 08:58 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ don't define configure PACKAGE_* macros if already defines.
+
+2003-11-04 08:04 dts12
+
+ * FAQ:
+
+ A new entry discussing tables with >256 columns.
+
+2003-11-04 07:33 rstory
+
+ * local/mib2c-conf.d/generic-ctx-set.m2i:
+
+ always generate code when data context is generated
+
+2003-11-04 07:32 rstory
+
+ * local/mib2c-conf.d/syntax-InetAddress-set.m2i:
+
+ clarify comments
+
+2003-11-04 07:31 rstory
+
+ * local/mib2c-conf.d/syntax-InetAddressType-set.m2i:
+
+ clarify comments; use generic-set instead of get
+
+2003-11-04 07:22 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ clarify comments
+
+2003-11-04 07:19 rstory
+
+ * README:
+
+ sync contributors w/5.0.x
+
+2003-11-04 01:28 dts12
+
+ * man/snmpd.8.def:
+
+ Document the effect of -C on persistent config files.
+
+2003-11-03 14:29 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ fix generated code for undo_setup
+
+2003-11-03 12:57 rstory
+
+ * local/mib2c-conf.d/mfd-data-set.m2c:
+
+ clarify comments; remove bogus asserts
+
+2003-11-03 10:31 rstory
+
+ * local/mib2c-conf.d/generic-get-char.m2i:
+
+ make IS_SET macros unique per node
+
+2003-11-03 10:30 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-from-oid.m2i:
+
+ fix var name typo
+
+2003-11-03 10:28 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-to-oid.m2i:
+
+ must use addr of local var to get ptr
+
+2003-11-03 10:24 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes-varbind-setup.m2i:
+
+ must use addr of local var to get ptr
+
+2003-11-03 10:22 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ set up defaults for mfd tables
+
+2003-11-03 07:50 rstory
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ recognize SNMP_MSG_SET is not a valid GET mode; comment tweaks
+
+2003-11-03 07:26 dts12
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ Recognise SNMP_MSG_SET as a valid SET mode
+ (so that the varbind caching doesn't lose the assigned values!)
+
+2003-11-02 09:51 rstory
+
+ * include/net-snmp/system/hpux.h:
+
+ restore accidentaly deleted hpux define; add comment
+
+2003-11-02 04:55 nba
+
+ * man/.cvsignore:
+
+ Fix a bunch of compiler warnings: const-ness, casts, missing protoypes,
+ unused variables, cvs ignore ignorable files
+
+2003-11-02 04:50 nba
+
+ * .cvsignore, agent/agent_trap.c, agent/snmpd.c,
+ agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/mibII/interfaces.c, apps/.cvsignore,
+ apps/snmptrapd_handlers.c, apps/snmptrapd_log.c,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/library/container.h,
+ include/net-snmp/library/container_binary_array.h,
+ include/net-snmp/library/snmp_enum.h, snmplib/mib.c,
+ snmplib/snmp_enum.c:
+
+ Fix a bunch of compiler warnings: const-ness, casts, missing protoypes,
+ unused variables, cvs ignore ignorable files
+
+2003-11-02 04:44 nba
+
+ * configure.in, configure:
+
+ Fix a bad syntax when testing for perl modules
+
+2003-11-02 04:42 nba
+
+ * apps/snmpnetstat/main.c, man/snmpnetstat.1:
+
+ Another left over -p option
+
+2003-11-01 16:04 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ always quote both sides of perl ne/eq tests; allow override of varbind variable
+ name; add subid to node summary
+
+2003-11-01 16:02 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ move example and transient defaults to table setup
+
+2003-11-01 16:02 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ change default reg ctx from void* to netsnmp_data_list *; move example
+ and transient defaults here (from top)
+
+2003-11-01 15:58 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ add 'TODO' comment; don't generate code if example not set & not generated data
+ context; default to returning no data for node;
+
+2003-11-01 15:56 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments);
+ use quotes on both sides of perl eq/ne tests; fix reg ptr dcl
+
+2003-11-01 15:55 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ add users target to only build user code
+
+2003-11-01 15:54 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ use quotes on both sides of perl eq/ne tests; check_indexs is only for row
+ creation; data not found only ok for row creation, not settable; sanity
+ check for bogus index oid size before memcpy; set ASN_PRIV_RETRY for no data,
+ so sparse tables work
+
+2003-11-01 15:51 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-interface.m2i
+:
+
+ set oid size to max before trying to parse oid
+
+2003-11-01 15:50 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-body.m2i:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments);
+ rename ref to loop_ref; more asserts; move TODO outside of conditional; move
+ itr_ctr free outside of example conditional
+
+2003-11-01 15:48 rstory
+
+ * local/mib2c-conf.d/generic-get-decl.m2i:
+
+ tweak indention
+
+2003-11-01 15:47 rstory
+
+ * local/mib2c-conf.d/generic-ctx-set.m2i:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments);
+ move TODO outside of conditional; don't include code if examples not set
+
+2003-11-01 15:45 rstory
+
+ * local/mib2c-conf.d/generic-ctx-get.m2i:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments);
+ quote both sides of perl eq/ne tests; document include in comments
+
+2003-11-01 15:44 rstory
+
+ * local/mib2c-conf.d/generic-ctx-copy.m2i:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments);
+ move TODO outside of conditional; tweak conditional
+
+2003-11-01 15:43 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments);
+ move conditional inside include
+
+2003-11-01 15:41 rstory
+
+ * local/mib2c-conf.d/: mfd-data-get.m2c, mfd-readme.m2c
+, parent-set.m2i:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments);
+ quote both sides of perl eq/ne tests
+
+2003-11-01 15:37 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-get.m2i:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments)
+
+2003-11-01 15:37 rstory
+
+ * local/mib2c-conf.d/: syntax-COUNTER64-get.m2i,
+ syntax-DateAndTime-get.m2i, syntax-InetAddress-get.m2i,
+ syntax-InetAddressType-get.m2i, syntax-TestAndIncr-get.m2i
+:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments);
+ default to returning no data for nodes
+
+2003-11-01 15:21 rstory
+
+ * local/mib2c-conf.d/: details-enums.m2i,
+ generic-data-context.m2i, generic-get-char.m2i,
+ generic-value-map-reverse.m2i, generic-value-map.m2i,
+ mfd-access-unsorted-external-header.m2i, mfd-data-set.m2c
+, parent-dependencies.m2i:
+
+ put 'TODO' comment on it's own line(removable w/out disrupting code comments)
+
+2003-11-01 15:16 rstory
+
+ * local/mib2c-conf.d/: generic-table-indexes-from-oid.m2i,
+ generic-table-indexes-to-oid.m2i,
+ generic-table-indexes-varbind-setup.m2i:
+
+ new code for indexes and oid conversions
+
+2003-11-01 10:43 rstory
+
+ * snmplib/container_iterator.c:
+
+ use endofmibview instead of no_vars
+
+2003-10-30 17:38 rstory
+
+ * agent/mibgroup/host/hr_swrun.c, local/mib2c.array-user.conf
+:
+
+ add comments
+
+2003-10-30 17:37 rstory
+
+ * agent/snmp_agent.c:
+
+ test func parameter, not variable we're about to overwrite
+
+2003-10-30 17:36 rstory
+
+ * agent/snmp_vars.c:
+
+ declare callback_master_num even if SNMP_TRANSPORT_CALLBACK_DOMAIN is not
+ defined (so I don't need to add more ifdef's in other code)
+
+2003-10-30 17:34 rstory
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ log warning and don't open callback transport if SNMP_TRANSPORT_CALLBACK_DOMAIN
+ is not defined
+
+2003-10-30 17:33 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ log warning and don't open callback transport if SNMP_TRANSPORT_CALLBACK_DOMAIN
+ is not defined; fix test for agentx_open_session
+
+2003-10-30 17:29 rstory
+
+ * snmplib/snmpCallbackDomain.c:
+
+ don't compile code if SNMP_TRANSPORT_CALLBACK_DOMAIN not defined
+
+2003-10-30 16:51 rstory
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ merge transport comments from non-win net-snmp-config.h; undef callback
+ transport instead of def of 0, so it actually turns off code; undef inline
+ macros before redefining them
+
+2003-10-30 16:49 rstory
+
+ * win32/config.h:
+
+ replace contents w/include of net-snmp/net-snmp-config.h so only one header
+ needs to be maintained. Everyone should be using the new one anyway, right?
+
+2003-10-30 01:31 dts12
+
+ * configure, configure.in:
+
+ Don't configure the Host-Resources support by default.
+ It's a good idea, but we're too close to 5.1 for this to be safe.
+
+2003-10-29 10:51 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ inline -> NETSNMP_INLINE
+
+2003-10-29 03:10 dts12
+
+ * man/: snmpcmd.1.def, snmpd.8.def, snmptrapd.8.def
+:
+
+ Document new -Lx logging option block, and assorted deprecated options.
+
+2003-10-29 02:59 dts12
+
+ * FAQ:
+
+ Various updates to the FAQ.
+ Highlights include better explanation of access control and timeout
+ problems, discussion of what traps are sent and where to (including
+ Disman Event-MIB support) and more on mib2c usage (including the
+ differences between configs, and pointers to examples).
+ Separate sections for compilation and coding new modules
+ (restructuring existing entries)
+ Refer to project as 'Net-SNMP' rather than 'UCD' throughout
+ (except where specifically v4 or UCD-SNMP-MIB are meant)
+
+2003-10-29 02:33 dts12
+
+ * agent/mibgroup/mibII/: sysORTable.h (V5-0-patches.1),
+ sysORTable.h (V4-2-patches.[1,2]), sysORTable.h:
+
+ Fix null definition of REGISTER_SYSOR_TABLE (when not using this table).
+ Reported by Mark Hopkins
+
+2003-10-28 18:16 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.1.pre3 )
+
+2003-10-28 18:16 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.1.pre3 )
+
+2003-10-28 18:16 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.1.pre3 )
+
+2003-10-28 18:16 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.1.pre3 )
+
+2003-10-28 18:16 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.1.pre3 )
+
+2003-10-28 18:16 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.1.pre3 )
+
+2003-10-28 18:16 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.1.pre3 )
+
+2003-10-28 18:16 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.1.pre3 )
+
+2003-10-28 18:15 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.1.pre3 )
+
+2003-10-28 18:15 rstory
+
+ * README:
+
+ - (README): version tag ( 5.1.pre3 )
+
+2003-10-28 18:15 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.1.pre3 )
+
+2003-10-28 18:14 rstory
+
+ * doxygen.conf, man/netsnmp_Container_iterator.3,
+ man/netsnmp_agent.3, man/netsnmp_baby_steps.3,
+ man/netsnmp_bulk_to_next.3, man/netsnmp_cache_handler.3
+, man/netsnmp_container.3, man/netsnmp_data_list.3
+, man/netsnmp_debug.3, man/netsnmp_handler.3,
+ man/netsnmp_instance.3, man/netsnmp_iterator_info_s.3,
+ man/netsnmp_leaf.3, man/netsnmp_library.3,
+ man/netsnmp_mfd_pdu_context_s.3, man/netsnmp_mib_utilities.3
+, man/netsnmp_mode_end_call.3, man/netsnmp_multiplexer.3
+, man/netsnmp_netsnmp_iterator_info_s.3,
+ man/netsnmp_netsnmp_mib_handler_methods.3,
+ man/netsnmp_oid_stash.3, man/netsnmp_old_api.3,
+ man/netsnmp_read_only.3, man/netsnmp_row_merge.3,
+ man/netsnmp_scalar.3, man/netsnmp_scalar_group_group.3
+, man/netsnmp_serialize.3, man/netsnmp_stash_cache.3
+, man/netsnmp_table.3, man/netsnmp_table_array.3
+, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_iterator.3
+, man/netsnmp_todo.3, man/netsnmp_util.3,
+ man/netsnmp_utilities.3, man/netsnmp_watcher.3:
+
+ update for 5.1.pre3
+
+2003-10-28 18:05 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend, apps/Makefile.depend
+, apps/snmpnetstat/Makefile.depend,
+ snmplib/Makefile.depend:
+
+ make depend
+
+2003-10-28 17:31 hardaker
+
+ * Makefile.top:
+
+ fix version for 5.1 release
+
+2003-10-28 12:47 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ regenerate from new acconfig.h
+
+2003-10-28 12:45 rstory
+
+ * acconfig.h:
+
+ fix bug [ 830852 ] Build doesn't work on HP-UX 11i
+ undef macro before redefining it
+
+2003-10-28 10:32 rstory
+
+ * agent/mibgroup/mibII/: route_write.c (V5-0-patches.1),
+ route_write.c:
+
+ apply patch [ 812019 ] snmpset on ipRouteDest.127.0.0.1 kill agent dumps core
+ fixes bug [ 808958 ] OSSun snmpset on ipRouteDest.127.0.0.1 kill agent dumps ...
+
+2003-10-28 10:16 rstory
+
+ * agent/helpers/: debug_handler.c (V5-0-patches.1), debug_handler.c
+:
+
+ apply patch [ 831161 ] netsnmp_get_debug_helper crashes snmpd
+ fixes bug [ 826963 ] netsnmp_get_debug_helper crashes snmpd
+
+2003-10-28 10:05 rstory
+
+ * perl/SNMP/SNMP.xs:
+
+ apply patch [ 829633 ] 5.1pre1 Perl translateObj fix
+
+2003-10-28 07:32 rstory
+
+ * dist/: net-snmp.spec (V5-0-patches.3), net-snmp.spec:
+
+ apparently nested %if's are a no-no
+
+2003-10-28 07:22 rstory
+
+ * dist/net-snmp.spec:
+
+ fix perl conditional builds after read rpm docs
+
+2003-10-26 00:34 hardaker
+
+ * snmplib/oid_stash.c:
+
+ inline -> NETSNMP_INLINE as pointed out by Alex Burger
+
+2003-10-24 16:49 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-readme.m2i:
+
+ rename loop_ctx loop_context; prefix all loop functions w/loop
+
+2003-10-24 16:46 rstory
+
+ * local/mib2c-conf.d/mfd-readme.m2c:
+
+ move defaults to an easier to spot place
+
+2003-10-24 16:45 rstory
+
+ * local/mib2c-conf.d/: generic-table-indexes.m2i,
+ mfd-access-unsorted-external-body.m2i,
+ mfd-access-unsorted-external-header.m2i,
+ mfd-access-unsorted-external-interface.m2i, mfd-top.m2c
+:
+
+ rename table_idx table_mib_index; rename loop_ctx loop_context; prefix all
+ loop functions w/loop; remove index2oid
+
+2003-10-24 06:02 dts12
+
+ * configure, configure.in:
+
+ Add Host-Resources support to the list of default MIB modules.
+ We've talked about this for years - it's about time we did so!
+
+2003-10-24 05:49 dts12
+
+ * agent/snmpd.c, apps/snmptrapd.c:
+
+ New choices for some command-line options, to improve consistency
+ between agent and trap handler usage. The previous options still
+ work but are now marked as "deprecated". These should probably
+ be removed completely in a future release (e.g. 5.2).
+
+2003-10-23 15:58 rstory
+
+ * include/net-snmp/library/container.h:
+
+ fix bug 828671: The lib isn't C++ compatible; remove 'struct' before typdef
+
+2003-10-23 15:54 rstory
+
+ * snmplib/container_null.c:
+
+ fix bug 828671: The lib isn't C++ compatible; rename structure
+ remove unused noalloc function
+
+2003-10-23 15:53 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container_binary_array.c:
+
+ fix bug 828671: The lib isn't C++ compatible; rename structure
+
+2003-10-23 15:39 rstory
+
+ * snmplib/: parse.c (V5-0-patches.3), parse.c:
+
+ fix bug 767753: snmpwalk crash (adopt_orphans)
+
+2003-10-23 10:34 rstory
+
+ * configure:
+
+ configure to match new configure.in
+
+2003-10-23 10:32 rstory
+
+ * configure.in:
+
+ apparently configure translates '_' to '-' in arguments/enables, so use -
+ consistently; move common module arg mistake checks with other module
+ checks, and add a few more; add check for enable perl-modules too
+
+2003-10-23 10:24 rstory
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ move comment fixes to acconfig.h and regenerate net-snmp-config.h.in
+
+2003-10-23 08:52 rstory
+
+ * snmplib/container.c:
+
+ remove nonstd NDEBUG ifdef tst; use DBGMSGSUBOID instead of DBGMSDOID; add
+ debug for comparison result
+
+2003-10-23 08:45 rstory
+
+ * snmplib/container_iterator.c:
+
+ add comments; fix get_next w/null key (get-first); remove redundant debugs
+
+2003-10-22 17:10 rstory
+
+ * snmplib/: snmpusm.c (V5-0-patches.2), snmpusm.c:
+
+ fix bug 822870 (usmStatsDecryptionErrors did not increment on failed get req)
+ with patch 827056 from browlands
+
+2003-10-22 09:43 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ define __STRING if not defined
+
+2003-10-22 06:14 rstory
+
+ * Makefile.top:
+
+ increment libtool revision
+
+2003-10-22 06:13 rstory
+
+ * Makefile.in:
+
+ fix commentcheck pattern to exclude ftp and http urls
+
+2003-10-22 02:08 dts12
+
+ * snmplib/snmp_api.c:
+
+ The variables 'do_hint' and 'check' are only declared
+ or needed when 'DISABLE_MIB_LOADING' is not defined.
+ There's no point in giving them dummy values otherwise.
+
+2003-10-21 12:16 rstory
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ remove c++ style comment
+
+2003-10-21 12:12 rstory
+
+ * acconfig.h, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/ucd-snmp/diskio.c:
+
+ remove c++ style comment
+
+2003-10-21 11:51 rstory
+
+ * local/Version-Munge.pl:
+
+ move usage sub to top so it actually does something; print usage for param
+ errors, instead of just dying
+
+2003-10-21 11:51 rstory
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.1.pre2 )
+
+2003-10-21 11:51 rstory
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.1.pre2 )
+
+2003-10-21 11:51 rstory
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.1.pre2 )
+
+2003-10-21 11:51 rstory
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.1.pre2 )
+
+2003-10-21 11:51 rstory
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.1.pre2 )
+
+2003-10-21 11:51 rstory
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.1.pre2 )
+
+2003-10-21 11:50 rstory
+
+ * perl/SNMP/SNMP.pm:
+
+ - (perl/SNMP/SNMP.pm): version tag ( 5.1.pre2 )
+
+2003-10-21 11:50 rstory
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.1.pre2 )
+
+2003-10-21 11:50 rstory
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.1.pre2 )
+
+2003-10-21 11:50 rstory
+
+ * README:
+
+ - (README): version tag ( 5.1.pre2 )
+
+2003-10-21 11:50 rstory
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.1.pre2 )
+
+2003-10-21 11:42 rstory
+
+ * Makefile.rules:
+
+ remove bogus install target
+
+2003-10-21 11:18 rstory
+
+ * configure:
+
+ configure for new config.in
+
+2003-10-21 11:16 rstory
+
+ * configure.in:
+
+ fix cut-n-paste error in perl uninstall support; update version in init
+
+2003-10-21 01:54 dts12
+
+ * snmplib/system.c:
+
+ Include <fcntl.h> for definition of O_RDWR. Reported by SebNob.
+
+2003-10-21 01:47 dts12
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Ensure that multi-line comments aren't broken when the active
+ net-snmp-config.h file is generated. Reported by SebNob.
+ (Possibly being a bit over-cautious here, but you can't be too careful!)
+
+2003-10-17 22:52 hardaker
+
+ * NEWS:
+
+ more updates
+
+2003-10-17 22:39 hardaker
+
+ * agent/snmp_agent.c:
+
+ turn on the lookup cache.
+
+2003-10-17 16:35 hardaker
+
+ * man/: Makefile.in, netsnmp_Container_iterator.3,
+ netsnmp_baby_steps.3, netsnmp_cache_handler.3,
+ netsnmp_container.3, netsnmp_deprecated.3,
+ netsnmp_iterator_info_s.3, netsnmp_leaf.3,
+ netsnmp_mfd_pdu_context_s.3, netsnmp_row_merge.3,
+ netsnmp_scalar_group_group.3, netsnmp_stash_cache.3,
+ netsnmp_utilities.3:
+
+ more (new) updates from doxygen
+
+2003-10-17 16:33 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_library.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_methods.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_scalar.3, netsnmp_serialize.3,
+ netsnmp_set_data.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_util.3, netsnmp_watcher.3
+:
+
+ updates from doxygen
+
+2003-10-17 16:16 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - (perl/AnyData_SNMP/Storage.pm): version tag ( 5.1.pre1 )
+
+2003-10-17 16:15 hardaker
+
+ * perl/ASN/ASN.pm:
+
+ - (perl/ASN/ASN.pm): version tag ( 5.1.pre1 )
+
+2003-10-17 16:15 hardaker
+
+ * perl/OID/OID.pm:
+
+ - (perl/OID/OID.pm): version tag ( 5.1.pre1 )
+
+2003-10-17 16:15 hardaker
+
+ * perl/default_store/default_store.pm:
+
+ - (perl/default_store/default_store.pm): version tag ( 5.1.pre1 )
+
+2003-10-17 16:15 hardaker
+
+ * perl/agent/default_store/default_store.pm:
+
+ - (perl/agent/default_store/default_store.pm): version tag ( 5.1.pre1 )
+
+2003-10-17 16:15 hardaker
+
+ * perl/agent/agent.pm:
+
+ - (perl/agent/agent.pm): version tag ( 5.1.pre1 )
+
+2003-10-17 16:15 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in): version tag ( 5.1.pre1 )
+
+2003-10-17 16:15 hardaker
+
+ * FAQ:
+
+ - (FAQ): version tag ( 5.1.pre1 )
+
+2003-10-17 16:15 hardaker
+
+ * README:
+
+ - (README): version tag ( 5.1.pre1 )
+
+2003-10-17 15:51 hardaker
+
+ * local/Version-Munge.pl:
+
+ added anydata modules
+
+2003-10-17 15:44 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ make gettable return a hash instead.
+
+2003-10-17 15:03 hardaker
+
+ * apps/snmptrapd_handlers.c:
+
+ add oid/default portion to help text for the forward token
+
+2003-10-17 15:02 hardaker
+
+ * COPYING:
+
+ Add sparta
+
+2003-10-17 14:59 hardaker
+
+ * man/snmptrapd.conf.5.def:
+
+ document the forward token
+
+2003-10-17 14:41 hardaker
+
+ * Makefile.in:
+
+ use new version modification script
+
+2003-10-17 14:40 hardaker
+
+ * local/Version-Munge.pl:
+
+ new version messing-with script
+
+2003-10-17 14:39 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ remove portions old script replaced by newer Version-Munge.pl
+
+2003-10-17 14:37 hardaker
+
+ * snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c): version tag ( 5.1.pre1 )
+
+2003-10-15 09:25 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-body.m2i:
+
+ remove hardcoded context name
+
+2003-10-14 16:42 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-header.m2i:
+
+ add note that example code is base on a data file
+
+2003-10-14 16:32 rstory
+
+ * local/mib2c-conf.d/: mfd-access-unsorted-external-body.m2i,
+ mfd-access-unsorted-external-readme.m2i:
+
+ add not that iterator get/get-next don't correspond to pdu types, and they
+ shouldn't be ordering their data
+
+2003-10-14 16:09 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-header.m2i:
+
+ sync comments w/readme
+
+2003-10-14 16:08 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ as long as we're using gnu-make specifics, only process config vars once (also
+ lets make output represent actual values, instead of script)
+
+2003-10-14 16:07 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ use big obnoxious warning; set error for no context if table not settable
+
+2003-10-14 16:06 rstory
+
+ * local/mib2c-conf.d/m2c-internal-warning.m2i:
+
+ big obnoxious warning for top of implementation files
+
+2003-10-14 16:06 rstory
+
+ * local/mib2c-conf.d/: mfd-access-unsorted-external-body.m2i,
+ mfd-access-unsorted-external-readme.m2i:
+
+ sync function header summary comments w/readme summary header comments;
+ present function in same order in both files
+
+2003-10-14 16:04 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ init m2c_data_init
+
+2003-10-14 13:34 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-body.m2i:
+
+ use new common setup; wrappers for all container functions, to convert
+ between interface context and user context; some param tweaks; remove
+ unused prototype; keep ptr to table context in example; rename some vars
+ use new MFD_* error codes; rename example function; documenation updates;
+
+2003-10-14 13:32 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-header.m2i:
+
+ use new common setup; wrappers for all container functions, to convert
+ between interface context and user context; some param tweaks; remove
+ unused prototype; keep ptr to table context in example; rename some vars
+
+2003-10-14 13:30 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-interface.m2i
+:
+
+ use new common setup; wrappers for all container functions, to convert
+ between interface context and user context; some param tweaks; don't auto
+ allocate context for get data, so user could use one they've allocated
+
+2003-10-14 13:28 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-setup.m2i:
+
+ common setup for unsorted external, which has 3 parts included at different
+ times
+
+2003-10-14 13:27 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-readme.m2i:
+
+ invert verbose logic test; add quick overview of iteration loop; reorder
+ some text/blank lines; update for renamed vars
+
+2003-10-14 13:11 rstory
+
+ * local/mib2c-conf.d/syntax-COUNTER64-get.m2i:
+
+ handle counter64 vars
+
+2003-10-14 13:10 rstory
+
+ * local/mib2c-conf.d/node-get.m2i:
+
+ use new MFD_* error codes; update for m2c param rename; handle counter64 vars
+
+2003-10-14 13:09 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ name deps files explicity, since .c=.deps isn't portable
+
+2003-10-14 13:08 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ update base param from mfd reg to mfd pdu ctx; update for renamed mfd/m2c vars;
+ rename user reg typedef; no undo in table ctx if table not settable; add user
+ reg ptr, request mode and data list to table context; mv container init proto
+ and other interface prototypes to their own header; add protos for pre/post
+ requests, table context init/cleanup; add set prototypes; include new headers
+ at bottom of main header; move as mush of init routine as possible into
+ interface code; use new MFD_* return codes; don't run makefile/subagent
+ conf files if they've already been run
+
+2003-10-14 12:59 rstory
+
+ * local/mib2c-conf.d/mfd-readme.m2c:
+
+ add mfd overview of SNMP and mfd data structures; document m2c configuration
+ variables; indent some comments to be more consistent; docs for set support
+
+2003-10-14 12:57 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ replace hardcoded header name w/$name.h; documentation updates; use MFD_*
+ return codes instead of SNMP_*; update renamed m2c params; remove local static
+ prototypes from headers; new per table interface context; rename interface init;
+ use table reg in local table context instead of malloc; remove _ prefix from
+ public table allocate & release ctx funcs; init vars in allocate_ctx; call
+ table ctx init func in allocate, if defined; wrappers for all mfd functions, to
+ convert from our table context to the users registration pointer; after object
+ lookup set users indexes back to the varbind oid and set context vars; only
+ do get routines for accessable internal indexes; prefix wrappers w/mfd_;
+ detect if user get routines munges vb value pointer; check for null ptr before
+ free; merge check_index into check_indexes; add set values, commit, undo
+ and irreversible commit wrappers; update for renamed commit mode names;
+ simplify param for internal index check funcs
+
+2003-10-14 12:34 rstory
+
+ * local/mib2c-conf.d/mfd-data-get.m2c:
+
+ put prototypes in $name_data_get.h
+
+2003-10-14 12:33 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ update m2c node params to be based on var/val/ref instead of function name
+
+2003-10-14 12:31 rstory
+
+ * local/mib2c-conf.d/generic-get-decl.m2i:
+
+ update for rename m2c var names
+
+2003-10-14 12:31 rstory
+
+ * local/mib2c-conf.d/: generic-data-context.m2i,
+ generic-table-indexes.m2i:
+
+ use m2c_node_summary in comment
+
+2003-10-14 12:30 rstory
+
+ * local/mib2c-conf.d/mfd-data-set.m2c:
+
+ documentation updates; use MFD_* return codes instead of SNMP_*; put prototypes
+ in $name_data_set.h; update renamed m2c params; add external index check func
+ if table has external index; simplify param for internal index check funcs
+
+2003-10-14 12:27 rstory
+
+ * local/mib2c-conf.d/parent-dependencies.m2i:
+
+ remove mfd reg param && assert
+
+2003-10-14 12:26 rstory
+
+ * local/mib2c-conf.d/node-set.m2i:
+
+ documentation updates; use MFD_* return codes instead of SNMP_*; add per node
+ undo_setup ; update for renamed commit mode names; update renamed mfd params
+
+2003-10-14 12:24 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ documentation updates; chg mfd_reg params to table_reg; use MFD_* return
+ codes instead of SNMP_*; no per node code in table undo_setup (will be in
+ new per node undo_setup); update for renamed commit mode names
+
+2003-10-14 12:20 rstory
+
+ * local/mib2c-conf.d/syntax-DateAndTime-readme.m2i:
+
+ indent to match other readmes
+
+2003-10-14 12:18 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ rename m2c_table_writable to m2c_table_settable (consistent w/node.settable);
+ base m2c_table_row_creation on new function table_has_create; new
+ m2c_table_external_indexes base on new function count_external_indexes
+
+2003-10-14 12:15 rstory
+
+ * local/mib2c-conf.d/details-table.m2i:
+
+ remove unused lines; add oid length in output
+
+2003-10-14 12:14 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ only set defaults if value is empty
+
+2003-10-14 11:48 rstory
+
+ * snmplib/container_iterator.c:
+
+ if sorted, skip iteration on find first; add new reuse param to save_pos
+
+2003-10-14 11:38 rstory
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ log each agentxperms part separtely, so as not to crash if any of the optional
+ items are left out; update help to show that optional parms must be in order
+
+2003-10-14 11:18 rstory
+
+ * local/mib2c:
+
+ change counter 64 type from 'counter64' to 'U64', since the former can't be
+ used as a variable declaration type; process $HOME/.snmp/mib2c.conf, if it
+ exists; new foreach internalindex and externalindex; new sub table_has_create
+ and count_external_indexes
+
+2003-10-14 09:49 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ don't require DEBUG dfine for asserts; new logic: use assert if
+ NETSNMP_USE_ASSERT defines. otherwise, failed asserts will use snmp_log
+ to log a message (unless SNMP_NO_DEBUGGING is defined).
+
+2003-10-14 09:45 rstory
+
+ * agent/helpers/table_mfd.c,
+ include/net-snmp/agent/table_mfd.h:
+
+ update for renamed modes; chg callback param to use new mfd_pdu_ctx; don't
+ split callbacks into two structures; define mfd specific error codes as a
+ subset of existing error codes; add documentation; remove table registration
+ from registration param list, since it's in the mfd reg obj; handle get request
+ split into object_lookup and get values; only call next handler if next handler
+ has access method; tweak lookup params: return error code and set found row
+ in new pdu ctx param
+
+2003-10-14 09:35 rstory
+
+ * include/net-snmp/library/container_iterator.h:
+
+ add reuse flag to ctx dup params
+
+2003-10-14 09:25 rstory
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ add mode msg defines for baby step modes; simplify mode test macros; add
+ next_mode to agent_request_info
+
+2003-10-14 09:24 rstory
+
+ * include/net-snmp/library/snmp.h:
+
+ add internal msg defines for baby step modes; renumber get stash mode; fix typo
+ in comment; reserve modes < 128 for set processing to simplify mode tests
+
+2003-10-14 09:20 rstory
+
+ * include/net-snmp/agent/baby_steps.h:
+
+ rename a few modes
+
+2003-10-14 09:20 rstory
+
+ * agent/helpers/baby_steps.c:
+
+ update for renamed modes; add mode map for get-requests as well
+
+2003-10-14 09:19 rstory
+
+ * agent/snmpd.c:
+
+ const correctness
+
+2003-10-14 09:18 rstory
+
+ * agent/snmp_agent.c:
+
+ remove ifdef'd code after restoring some of it; update new reqinfo ptr in
+ requests; fix enless loop; fix typos in asserts
+
+2003-10-14 09:15 rstory
+
+ * net-snmp-config.in:
+
+ check for relative path to src dir for build-dir checks
+
+2003-10-14 06:29 rstory
+
+ * agent/: Makefile.in (V5-0-patches.3), Makefile.in:
+
+ don't leave possibly empty configure @var@ on continuation line by itself
+
+2003-10-08 22:12 hardaker
+
+ * agent/mibgroup/mibII/: var_route.c (V5-0-patches.2), var_route.c
+:
+
+ patch from Johannes Schmidt-Fischer to fix HPUX 11
+
+2003-10-08 14:08 rstory
+
+ * agent/helpers/table.c:
+
+ add detail on improperyly registered table message, and chg to ERR (from INFO);
+ fix valid column search for ranges; go straight to first row if no indexes
+
+2003-10-07 15:10 rstory
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ more useful help text for agentxperms
+
+2003-10-07 14:43 rstory
+
+ * agent/snmpd.c:
+
+ fix logic check of DS_AGENT_QUIT_IMMEDIATELY so that parent and child don't
+ both try to become the master agent. Logic seems backwards to me - do we have
+ all these DS vars document somewhere?
+
+2003-10-07 14:39 rstory
+
+ * snmplib/system.c:
+
+ netsnmp_daemonize: init local var; chg return code to be fork result; add docs
+
+2003-10-07 07:00 hardaker
+
+ * local/: mib2c (V5-0-patches.3), mib2c:
+
+ Check for ^-S instead of -S, as reported by Jean-Marc Ranger on -users
+
+2003-10-07 03:13 dts12
+
+ * local/mib2c:
+
+ There are no statistics printed, so there's no point in having
+ a flag to turn them off.
+
+2003-10-04 11:01 rstory
+
+ * dist/net-snmp.spec:
+
+ merge changes from 5.0 patches branch; fix to build without requiring arguments;
+ separate embedded perl and perl modules options; fix fix for init.d script
+ for non-/usr/local installation
+
+2003-10-03 07:43 rstory
+
+ * agent/mibgroup/examples/ucdDemoPublic.conf:
+
+ change v1 demo community to match what is actualt configured on the
+ soon-to-be-reopened test.net-snmp.org
+
+2003-10-02 19:30 rstory
+
+ * agent/mibgroup/examples/ucdDemoPublic.conf:
+
+ add explanatory text and lines/arrows showing relationship between entries;
+ add createUser lines, w/note explaining they might be better suited for
+ the persistentdir snmpd.conf for security purposes.
+
+2003-10-02 11:04 hardaker
+
+ * man/mib2c.1.def:
+
+ document the -I switch
+
+2003-10-02 10:54 hardaker
+
+ * Makefile.rules, Makefile.top, NEWS, configure
+, configure.in, agent/Makefile.in,
+ apps/Makefile.in, local/Makefile.in, man/Makefile.in
+, mibs/Makefile.in, testing/Makefile.in:
+
+ Robert told me to keep going, so I added support for a --with-install-prefix
+ flag to configure (and thus a INSTALL_PREFIX make variable as well).
+
+2003-10-01 16:30 hardaker
+
+ * Makefile.in, Makefile.rules, Makefile.top,
+ NEWS, configure, configure.in,
+ agent/Makefile.in, apps/Makefile.in, local/Makefile.in
+, man/Makefile.in, mibs/Makefile.in:
+
+ Support for "make uninstall"
+
+2003-10-01 14:51 hardaker
+
+ * apps/snmptranslate.c:
+
+ Added -L support for output logging.
+
+2003-10-01 14:49 hardaker
+
+ * agent/mibgroup/disman/mteEventTable.h:
+
+ updated prototypes to match earlier trap -> notification string replacements.
+
+2003-09-30 17:20 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-varbind-validate.m2i:
+
+ syntax specific varbind validation
+
+2003-09-30 17:20 rstory
+
+ * local/mib2c-conf.d/: syntax-RowStatus-dependencies.m2i,
+ syntax-StorageType-dependencies.m2i:
+
+ syntax specific dependency checks
+
+2003-09-30 17:19 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-readme.m2i:
+
+ fix typos
+
+2003-09-30 17:19 rstory
+
+ * local/mib2c-conf.d/: syntax-DateAndTime-get.m2i,
+ syntax-DateAndTime-readme.m2i:
+
+ set emags tag for c; update variable name
+
+2003-09-30 17:18 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ set emags tag for c; add/correct doxygen style docs; new validate_index,
+ undo_setup, reversible_commit, final_commit
+
+2003-09-30 17:17 rstory
+
+ * local/mib2c-conf.d/parent-dependencies.m2i:
+
+ set emags tag for c; in check_dependencies, remove non-existant param and
+ include any node specific syntax dependencies
+
+2003-09-30 17:15 rstory
+
+ * local/mib2c-conf.d/node-varbind-validate.m2i:
+
+ new include to do basicy syntax validation against an incoming varbind
+
+2003-09-30 17:14 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-body.m2i:
+
+ add/correct doxygen style docs in comments; change example from linked list
+ to flat file; use var for func params so it's easy to change; check new
+ m2c_include_examples before including example code;
+
+2003-09-30 17:12 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-header.m2i:
+
+ add/correct doxygen style docs in comments; change example from linked list
+ to flat file; use var for func params so it's easy to change
+
+2003-09-30 17:11 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-interface.m2i
+:
+
+ set emacs tag to c; add/correct doxygen style docs in comments; use local
+ static variable_list for index to oid conversion; free memory used in that
+ conversion, eventually; don't ignore rc from build_oid_noalloc here (return
+ it and let someone else ignore it); prefix some internal functions names w/'_';
+ wrapper around get_data to allocate new context
+
+2003-09-30 17:08 rstory
+
+ * local/mib2c-conf.d/: node-get.m2i, node-set.m2i:
+
+ set emacs tag to c; add/correct doxygen style docs in comments
+
+2003-09-30 17:06 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ new mfd_base_params var so it's easy to change params; chg comments so that
+ indent won't not indent; don't include some prototypes here if the function
+ is in *_interfaces; new pre/post request functions; moved bulk of table
+ init into interfaces, just a little function setup here
+
+2003-09-30 16:54 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ set emacs mode to Makefile; turn off strict token checks til wes gets @ escape;
+ expand deps includes since $(x:.c=.deps) isn't portable
+
+2003-09-30 16:46 rstory
+
+ * local/mib2c:
+
+ only put MIB2C_DIR env var in search path if it isn't empty
+
+2003-09-30 16:45 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ create new $name_interface.h header; move table initialization here; prefix a
+ bunch of interface functions w/'_'; use new m2c_node_summary; use new
+ m2c_node_var_* variables; change some accessible tests to settable tests; use
+ new node-varbind-validate include; always call user $node_check_value; new
+ functions to check new index syntax; new _set_values, _undo_setup and
+ _undo_values to call user functions
+
+2003-09-30 16:36 rstory
+
+ * local/mib2c-conf.d/mfd-data-set.m2c:
+
+ set emacs mode to c; tweak processing msgs; always include parent-set; move
+ parent dependencies to bottom of file; add $node_check_index
+
+2003-09-30 16:25 rstory
+
+ * local/mib2c-conf.d/mfd-data-get.m2c:
+
+ tweak processing msgs
+
+2003-09-30 16:23 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ set emacs mode to c; add some sanity checks; set up new $m2c_enum_mask,
+ $m2c_node_var_val, $m2c_node_var_ref, $m2c_node_var_val_ptr, $m2c_node_summary
+
+2003-09-30 16:18 rstory
+
+ * local/mib2c-conf.d/generic-data-allocate.m2i:
+
+ set emacs mode to c; remove unused create_undo_context
+
+2003-09-30 16:15 rstory
+
+ * local/mib2c-conf.d/: generic-ctx-copy.m2i,
+ generic-ctx-get.m2i, generic-ctx-set.m2i,
+ m2c_setup_table.m2i:
+
+ set emacs mode to c; suck 'ctx->' or 'ctx.' into $m2c_data_item
+
+2003-09-30 16:11 rstory
+
+ * local/mib2c-conf.d/details-table.m2i:
+
+ set emacs mode to c
+
+2003-09-30 16:10 rstory
+
+ * local/mib2c-conf.d/details-enums.m2i:
+
+ set emacs mode to c; generate define for mask of all bits
+
+2003-09-30 14:27 hardaker
+
+ * local/mib2c-conf.d/mfd-readme.m2c:
+
+ xxx tagging.
+
+2003-09-30 14:26 hardaker
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ create the Makefile to either reference a Net-SNMP source dir or not
+ (and require gnu-make or not).
+
+2003-09-30 06:50 rstory
+
+ * local/mib2c:
+
+ new flag/token strict_unk_token will abort on unknow @token
+
+2003-09-30 06:38 rstory
+
+ * include/net-snmp/library/check_varbind.h:
+
+ add netsnmp_check_vb_size, netsnmp_check_vb_size_range
+ and netsnmp_check_vb_rowstatus_value
+
+2003-09-30 06:37 rstory
+
+ * snmplib/check_varbind.c:
+
+ more null ptr checks; add netsnmp_check_vb_size, netsnmp_check_vb_size_range
+ and netsnmp_check_vb_rowstatus_value
+
+2003-09-30 06:34 rstory
+
+ * local/mib2c-conf.d/: generic-data-context.m2i,
+ generic-get-char.m2i, generic-get-decl-bot.m2i,
+ generic-get-decl.m2i, generic-get-long.m2i,
+ generic-get-oid.m2i, generic-header-bottom.m2i,
+ generic-header-top.m2i, generic-source-includes.m2i,
+ generic-table-indexes.m2i, generic-value-map-reverse.m2i
+, generic-value-map.m2i, m2c_setup_enum.m2i,
+ mfd-data-access.m2c, node-storage.m2i,
+ syntax-InetAddress-get.m2i, syntax-InetAddress-set.m2i,
+ syntax-InetAddressType-get.m2i,
+ syntax-InetAddressType-set.m2i, syntax-RowStatus-get.m2i
+, syntax-TestAndIncr-get.m2i:
+
+ set emacs mode to c
+
+2003-09-30 06:19 rstory
+
+ * local/mib2c-conf.d/details-node.m2i:
+
+ set emacs mode to c; fix generated comment
+
+2003-09-30 06:18 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ new flag for including example code
+
+2003-09-29 22:45 hardaker
+
+ * local/mib2c-conf.d/: mfd-access-unsorted-external-readme.m2i
+, mfd-readme.m2c:
+
+ Misc updates for readability, etc.
+
+2003-09-29 16:43 hardaker
+
+ * local/mib2c-conf.d/mfd-readme.m2c:
+
+ Initial word smithing of the global README.
+
+2003-09-29 15:41 hardaker
+
+ * local/mib2c:
+
+ Support a -I switch to specify config file search paths.
+
+2003-09-29 15:30 hardaker
+
+ * local/mib2c.iterate_access.conf:
+
+ missing some end statements
+
+2003-09-29 14:27 hardaker
+
+ * NEWS:
+
+ reference new disman features
+
+2003-09-29 14:25 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document (poorly of course) new monitoring features.
+
+2003-09-29 14:16 hardaker
+
+ * agent/mibgroup/disman/mteEventTable.c:
+
+ - trapEvent -> notificationEvent
+
+2003-09-29 14:13 hardaker
+
+ * agent/mibgroup/disman/mteEventTable.c:
+
+ - linkUpDownTraps -> linkUpDownNotifications
+
+2003-09-29 14:09 hardaker
+
+ * agent/mibgroup/disman/: mteEventTable.c, mteEventTable.h
+, mteTriggerTable.c:
+
+ - A new snmpd.conf token (trapEvent) for generating traps of any kind
+ on a monitoring event and a -e switch to monitor token to reference it.
+ - A new snmpd.conf token linkUpDownTraps to enable linkUp/linkDown
+ traps using the above piece.
+
+2003-09-29 07:00 hardaker
+
+ * dist/snmpd-init.d:
+
+ /etc/init.d -> /etc/rc.d/init.d
+
+2003-09-28 21:58 hardaker
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ remove comment in comment problem.
+
+2003-09-28 19:58 hardaker
+
+ * man/snmp_trap_api.3.def:
+
+ Added Dave's really coll ascii diagram from -users explaining how
+ traps are sent to their destinations over any SNMP version.
+
+2003-09-28 19:39 hardaker
+
+ * agent/mibgroup/examples/notification.c:
+
+ Added Dave's really coll ascii diagram from -users explaining how
+ traps are sent to their destinations over any SNMP version.
+
+2003-09-26 22:29 hardaker
+
+ * agent/agent_trap.c:
+
+ properly malloc the enterprise pointer before using it.
+
+2003-09-26 21:27 hardaker
+
+ * perl/SNMP/: SNMP.xs (V5-0-patches.4), SNMP.xs:
+
+ correct length in string fixed string comparison
+
+2003-09-26 16:19 hardaker
+
+ * dist/net-snmp.spec:
+
+ misc install fixes (mostly perl) and one perl patch.
+
+2003-09-26 10:31 hardaker
+
+ * perl/SNMP/: SNMP.xs (V5-0-patches.3), SNMP.xs:
+
+ fix useNumeric once and for all (maybe)
+
+2003-09-20 22:38 hardaker
+
+ * agent/mibgroup/host/: hr_swrun.c (V5-0-patches.1), hr_swrun.c
+:
+
+ Patch #809243 for bug #808920 from Bob R. for fixing process name discrepency (ps vs SNMP)
+
+2003-09-20 22:29 hardaker
+
+ * agent/helpers/: instance.c (V5-0-patches.1), instance.c:
+
+ patch #807414 for bug #757923 by Bob Rowlands to fix int watching on 64 bit systems
+
+2003-09-17 20:16 rstory
+
+ * agent/helpers/table_mfd.c:
+
+ use net data_list_add_data
+
+2003-09-17 17:48 rstory
+
+ * include/net-snmp/agent/table_mfd.h:
+
+ change mfd api parameters
+
+2003-09-17 17:47 rstory
+
+ * agent/snmp_agent.c:
+
+ use new inline macros; always create agent_req_info when creating asp; move
+ getbulk reorder code into an inline function for code readability; deprecate
+ netsnmp_set_request_error and netsnmp_set_mode_request_error in favor
+ of new netsnmp_request_set_error; deprecate netsnmp_set_all_requests_error in
+ favor of new netsnmp_request_set_error_all; try and return useful error codes
+
+2003-09-17 17:29 rstory
+
+ * include/net-snmp/library/snmp-tc.h:
+
+ make sure params are unique
+
+2003-09-17 17:24 rstory
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ autoheader update for new acconfig.h
+
+2003-09-17 17:07 rstory
+
+ * local/mib2c-conf.d/m2c_setup_enum.m2i:
+
+ setup for enum vars
+
+2003-09-17 17:05 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ remove create_undo_context (assuming undo_context == data_context for now);
+ fix log level macro; allocate_data_context moved elsewhere
+
+2003-09-17 17:03 rstory
+
+ * local/mib2c-conf.d/parent-dependencies.m2i:
+
+ fix paramater type;
+
+2003-09-17 16:57 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ don't need source dir if we use new net-snmp-config --build-includes; add
+ build/src dir -I paths before base cflags
+
+2003-09-17 16:55 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ use new inline macros; add object_syntax_check processing;
+
+2003-09-17 16:54 rstory
+
+ * local/mib2c-conf.d/mfd-data-set.m2c:
+
+ only include parent-set if data context is generated & allocated
+
+2003-09-17 16:50 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ per node setup for enums
+
+2003-09-17 16:47 rstory
+
+ * local/mib2c-conf.d/: generic-get-char.m2i,
+ generic-value-map.m2i:
+
+ new file to setup enums vars
+
+2003-09-17 16:43 rstory
+
+ * local/mib2c-conf.d/generic-table-enums.m2c:
+
+ new file to generate enums header file
+
+2003-09-17 16:40 rstory
+
+ * local/mib2c-conf.d/: generic-ctx-get.m2i,
+ generic-ctx-set.m2i, generic-data-context.m2i,
+ m2c_setup_table.m2i, mfd-access-unsorted-external-body.m2i
+:
+
+ new m2c_data_item for getting to data items, so includes don't need to know
+ whether or not to use data->item or data.item.
+
+2003-09-17 16:34 rstory
+
+ * local/mib2c-conf.d/details-enums.m2i:
+
+ move some setup for enums to m2c_setup_node and new m2c_setup_enum; add some
+ comments and examples to document process flow; move some comments to the
+ top of the header instead for each node; make sure internal mapping
+ defines are unique per node
+
+2003-09-17 16:32 rstory
+
+ * snmplib/data_list.c:
+
+ use doxygen deprecated tag instead of simple comments
+
+2003-09-17 16:29 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c,
+ include/net-snmp/library/container.h:
+
+ use new inline macros; change FIRST to use find_next instead of find; add
+ func pointer for item memory free
+
+2003-09-17 16:11 rstory
+
+ * include/net-snmp/library/check_varbind.h:
+
+ prototype for new check_vb_type
+
+2003-09-17 13:09 rstory
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ add comments; add agent_request_info ptr to request_info; add
+ netsnmp_request_set_error; deprecate netsnmp_set_request_error and
+ netsnmp_set_mode_request_error; use new inline macros; remove unused pdu
+ pointer from agent_request_info
+
+2003-09-17 13:05 rstory
+
+ * agent/helpers/table_mfd.c:
+
+ for set, save row in first request; chg mfd param list; don't call later
+ modes unless row exists; call lower handlers;
+
+2003-09-17 12:34 rstory
+
+ * include/net-snmp/library/data_list.h, snmplib/data_list.c
+:
+
+ use new inline macros; add data_list_add_node, data_list_add_data
+
+2003-09-17 12:08 rstory
+
+ * agent/agent_handler.c, agent/agent_registry.c,
+ agent/helpers/table.c, agent/helpers/table_data.c,
+ agent/helpers/table_dataset.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h:
+
+ use new inline macros
+
+2003-09-17 12:02 rstory
+
+ * include/net-snmp/library/snmp-tc.h:
+
+ new netsnmp_dateandtime_set_buf_from_vars
+
+2003-09-17 11:58 rstory
+
+ * snmplib/snmp-tc.c:
+
+ new netsnmp_dateandtime_set_buf_from_vars
+
+2003-09-17 09:49 rstory
+
+ * snmplib/container.c:
+
+ use new inline macro
+
+2003-09-17 09:49 rstory
+
+ * snmplib/check_varbind.c:
+
+ use new inline macros; new check_vb_type
+
+2003-09-17 09:48 rstory
+
+ * snmplib/.cvsignore:
+
+ ignore binary array test binary
+
+2003-09-17 09:46 rstory
+
+ * win32/: config.h, net-snmp/net-snmp-config.h:
+
+ update for new inline macros (I think microsloth supports inline)
+
+2003-09-17 09:43 rstory
+
+ * include/net-snmp/system/: aix.h, hpux.h, irix.h
+, osf5.h:
+
+ turn off net-snmp use of inline for non-gcc compilers (don't undef inline)
+
+2003-09-17 09:38 rstory
+
+ * acconfig.h:
+
+ define (and comment) macros for handling inline use in net-snmp
+
+2003-09-17 09:37 rstory
+
+ * net-snmp-config.in:
+
+ mv build dir check to subroutine; add missing NSC_SRC_LIBDIRS; add new
+ --build-includes
+
+2003-09-17 09:33 rstory
+
+ * configure.in:
+
+ add -Winline to dev flags
+
+2003-09-17 09:33 rstory
+
+ * Makefile.in:
+
+ give reason when re-running config.status
+
+2003-09-16 17:25 hardaker
+
+ * README:
+
+ peter hicks
+
+2003-09-16 17:24 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ Patch from Peter Hicks for a new get_table function
+
+2003-09-16 17:09 hardaker
+
+ * snmplib/: snmpUDPIPv6Domain.c (V5-0-patches.1),
+ snmpUDPIPv6Domain.c:
+
+ Patch from Katsuhisa ABE from -users to fix a masking problem
+
+2003-09-12 12:43 hardaker
+
+ * dist/: RELEASE-INSTRUCTIONS, net-snmp.spec:
+
+ - minor changes for improved perl Makefile.PL argument support (>= 5.0.9)
+
+2003-09-12 11:03 hardaker
+
+ * Makefile.in (V5-0-patches.2), Makefile.in:
+
+ Patch for --with-perl-modules extra argument support
+
+2003-09-12 06:28 rstory
+
+ * configure:
+
+ configure to match config.in
+
+2003-09-12 06:25 rstory
+
+ * configure.in:
+
+ fix mis-matched parens
+
+2003-09-11 15:50 rstory
+
+ * agent/snmpd.c:
+
+ use new netsnmp_daemonize library call
+
+2003-09-11 15:48 rstory
+
+ * local/mib2c.access_functions.conf:
+
+ move comments about routines closer to routines to reduce confusion
+
+2003-09-11 15:47 rstory
+
+ * local/mib2c:
+
+ add @debug@ token to turn debug on/off; print locations for more warnings/errors
+
+2003-09-11 15:45 rstory
+
+ * local/mib2c-conf.d/default-mfd-top.m2c:
+
+ defaults for two new flags: readme_verbose and data_transient
+
+2003-09-11 15:44 rstory
+
+ * local/mib2c-conf.d/syntax-DateAndTime-readme.m2i:
+
+ readme for DateAndTime
+
+2003-09-11 15:44 rstory
+
+ * local/mib2c-conf.d/syntax-DateAndTime-get.m2i:
+
+ add buf len param to netsnmp_dateandtime_set
+
+2003-09-11 15:33 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ un-comment include of enums header; move all data context processing into
+ include; don't assume pointers to data/undo contexts; only define prototype
+ for allocate_data if needed; run enum header conf file; run new readme conf file
+
+2003-09-11 14:12 rstory
+
+ * net-snmp-config.in:
+
+ add build-lib-deps
+
+2003-09-11 14:04 rstory
+
+ * local/mib2c-conf.d/mfd-makefile.m2m:
+
+ open file earlier; use new var for default NETSNMPDIR; don't assume NETSNMPDIR
+ is sourcedir; use new net-snmp-config options for get lib dirs/deps
+
+2003-09-11 13:58 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ include new generic-data-allocate if data_allocate set and data_context is
+ generated; move table_(allocate|release)_ctx here
+
+2003-09-11 13:55 rstory
+
+ * local/mib2c-conf.d/generic-data-allocate.m2i:
+
+ new file for allocate/release of data context
+
+2003-09-11 13:54 rstory
+
+ * local/mib2c-conf.d/mfd-data-get.m2c:
+
+ move data allocate/release to it's own include; only include it if data_allocate
+ set and data_context isn't generated
+
+2003-09-11 13:52 rstory
+
+ * local/mib2c-conf.d/: mfd-access-unsorted-external-readme.m2i
+, mfd-readme.m2c:
+
+ new readme generation
+
+2003-09-11 13:52 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-interface.m2i
+:
+
+ wrap get_first/get_next so we can move index2oid here and make it static
+
+2003-09-11 13:51 rstory
+
+ * local/mib2c-conf.d/mfd-access-unsorted-external-body.m2i:
+
+ only generate tabe_get_data for transient data; move index2oid into interface
+ code; gen different code based on data transient setting
+
+2003-09-11 13:44 rstory
+
+ * local/mib2c-conf.d/m2c_setup_table.m2i:
+
+ default to generated, non-allocated data_context
+
+2003-09-11 13:40 rstory
+
+ * local/mib2c-conf.d/generic-value-map-reverse.m2i:
+
+ fix renamed var
+
+2003-09-11 13:40 rstory
+
+ * local/mib2c-conf.d/generic-table-oids.m2c:
+
+ don't include enum stuff in oid header
+
+2003-09-11 13:39 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes.m2i:
+
+ remove unused owner ptr
+
+2003-09-11 13:39 rstory
+
+ * local/mib2c-conf.d/generic-get-decl-bot.m2i:
+
+ fix len_ptr variable name
+
+2003-09-11 13:39 rstory
+
+ * local/mib2c-conf.d/generic-get-char.m2i:
+
+ define IS_SET_* macros here instead of in header
+
+2003-09-11 13:37 rstory
+
+ * local/mib2c-conf.d/generic-data-context.m2i:
+
+ merge data struct back into single typedef; don't generate struct if user
+ specified existing struct; add * in typedef if data_allocate set
+
+2003-09-11 13:35 rstory
+
+ * local/mib2c-conf.d/generic-ctx-copy.m2i:
+
+ remove example start/end (parent decides that)
+
+2003-09-11 13:35 rstory
+
+ * local/mib2c-conf.d/details-table.m2i:
+
+ more distinctive separator before tables
+
+2003-09-11 13:18 rstory
+
+ * local/mib2c-conf.d/details-enums.m2i:
+
+ remove IS_SET_* macros; tweak conditions for generating enums and mapping
+ macros
+
+2003-09-11 13:09 rstory
+
+ * snmplib/system.c:
+
+ new netsnmp_daemonize
+
+2003-09-11 13:05 rstory
+
+ * include/net-snmp/library/system.h:
+
+ reduce scope of sun's copyright claim; bail if net-snmp-config not included;
+ prototype for new netsnmp_daemonize
+
+2003-09-11 12:57 rstory
+
+ * agent/mibgroup/examples/netSnmpHostsTable_access.c:
+
+ fix comment typo; document possible race condition and move one line to
+ make window smaller
+
+2003-09-11 12:55 rstory
+
+ * net-snmp-config.in:
+
+ use vars to make it easier to understand what flags are what in generated
+ version; group similar options together; add options to to get source
+ directory and lib path in build dir; add --base-subagent-libs (no lib path),
+ --libdir
+
+2003-09-11 08:33 rstory
+
+ * configure:
+
+ configure to match config.in
+
+2003-09-11 08:26 rstory
+
+ * configure.in:
+
+ trap bad options --with-modules or --with-out-modules
+
+2003-09-05 23:37 hardaker
+
+ * README (V5-0-patches.7), README:
+
+ added Bob Rowlands
+
+2003-09-05 22:36 hardaker
+
+ * agent/helpers/: table.c, table_iterator.c (V5-0-patches.[2,2]),
+ table.c, table_iterator.c:
+
+ Patch #800561 from Bob Rowlands to fix 64bit problems (-> size_t)
+
+2003-09-05 22:30 hardaker
+
+ * agent/mibgroup/agentx/: protocol.c (V5-0-patches.1), protocol.c
+:
+
+ Patch #800485 from Bob Rowlands for 64 bit agentx problems
+
+2003-09-05 22:16 hardaker
+
+ * snmplib/: snmpusm.c (V5-0-patches.1), snmpusm.c:
+
+ Patch #792008 from Thomas? to allow usmUser tokens to override previous entries
+
+2003-09-05 22:04 hardaker
+
+ * man/: mib2c.1.def, snmpcmd.1.def, snmpdelta.1, snmpdf.1,
+ snmpnetstat.1, snmpstatus.1.def, snmptable.1.def, snmptest.1.def,
+ snmptranslate.1.def (V5-0-patches.[2,2,1,1,1,1,1,1,1]), mib2c.1.def
+, netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_library.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_methods.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_scalar.3, netsnmp_serialize.3,
+ netsnmp_set_data.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_util.3, netsnmp_watcher.3
+, snmpcmd.1.def, snmpdelta.1, snmpdf.1,
+ snmpnetstat.1, snmpstatus.1.def, snmptable.1.def,
+ snmptest.1.def, snmptranslate.1.def:
+
+ Patch #789485 from Bob Rowlands for a long needed overhaul of the manual pages.
+
+2003-09-05 21:21 hardaker
+
+ * Makefile.in, configure, configure.in (V5-0-patches.[9,9,9]),
+ Makefile.in, configure, configure.in:
+
+ Add optional arguments to the --with-perl-modules flag for passing down
+
+2003-09-05 16:56 hardaker
+
+ * agent/snmp_agent.c, include/net-snmp/agent/snmp_agent.h
+ (V5-0-patches.[4,2]), agent/snmp_agent.c,
+ include/net-snmp/agent/snmp_agent.h:
+
+ - fix a getbulk bug pointed out by Jurij Smakov.
+
+2003-09-05 06:25 dts12
+
+ * include/net-snmp/agent/agent_trap.h, agent/agent_trap.c
+:
+
+ Re-written internals of agent trap generation.
+ Work with separate v1 and v2 template PDUs, and separate
+ (standalone) routines to convert between them, following RFC 2576,
+ Hopefully a somewhat cleaner approach than before,
+
+2003-09-02 23:09 hardaker
+
+ * dist/net-snmp.spec:
+
+ - new spec to include building the perl modules.
+ - done in sort of a temporary hacky way till proper support is put
+ directly into the master Makefile to support optional arguments
+ being passed to the Makefile.PL script.
+
+2003-09-02 23:07 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ update to include RPM building instructions.
+
+2003-09-02 23:07 hardaker
+
+ * dist/Makefile:
+
+ Modifications to support perl and building source and binary at once.
+
+2003-09-02 14:53 rstory
+
+ * dist/nsb-nightly:
+
+ add option to not source ~/.nsb-nightly; don't remobe build dir on success here
+
+2003-09-02 14:52 rstory
+
+ * dist/nsb-functions:
+
+ allow env vars to override defaults for more options; rename DATE to
+ NSB_DATE; only scp make files from this run; add uname to output
+
+2003-09-01 16:45 hardaker
+
+ * Makefile.in:
+
+ prune dist/rpm from etags results
+
+2003-08-28 02:02 dts12
+
+ * apps/snmptrapd.c:
+
+ A configure token to control the addresses/ports that trapd listens on.
+
+2003-08-22 02:38 dts12
+
+ * perl/SNMP/SNMP.pm:
+
+ Document the default version change.
+
+2003-08-21 14:28 rstory
+
+ * dist/cvsup:
+
+ make upload tarball name based on date
+
+2003-08-21 01:55 dts12
+
+ * agent/snmp_agent.c:
+
+ If a GETBULK hits the end of the MIB tree, make sure any empty varbinds
+ are returned as 'endOfMibView' exceptions, rather than (.0.0 = NULL)
+
+ If *all* the repeating varbinds hit the end of the MIB tree, truncate
+ after the first full empty row.
+
+2003-08-21 01:50 dts12
+
+ * agent/snmp_agent.c:
+
+ If there's a mixture of "still active" repetitions, and ones that have
+ already reached the end of the OID tree, then some of the varbind structures
+ may well be NULL.
+ It's preferable to skip these, and continue processing everything else,
+ rather than crash the server:-)
+
+2003-08-21 01:29 dts12
+
+ * acconfig.h, configure, configure.in,
+ agent/mibgroup/smux/smux.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Default to global SMUX access (as currently), but supply a configure
+ option to set default SMUX access to be localhost only.
+ Happy now?
+
+2003-08-21 01:24 dts12
+
+ * acconfig.h:
+
+ Ensure that the SNMP_TRANSPORT_CALLBACK_DOMAIN token remains available
+ when configure system files are recreated.
+
+2003-08-20 02:39 dts12
+
+ * agent/snmp_agent.c:
+
+ Expand the description of the post-BULK re-organisation, so it's somewhat
+ clearer what's happening. It took me best part of an hour (plus inserting
+ assorted debugging statements) to make sense of this!
+
+2003-08-20 02:36 dts12
+
+ * agent/agent_handler.c:
+
+ Register MIBs using the lowest-level available name, rather than the
+ first handler in the chain. This no longer results in the whole MIB
+ registry being identified as "bulk_to_get"!
+
+2003-08-20 02:26 dts12
+
+ * agent/mibgroup/ucd-snmp/: extensible.c, extensible.h:
+
+ Unregister (relocatable) extensions when re-reading the configuration file.
+ This allows "exec" lines to be re-loaded without causing the agent to crash!
+
+2003-08-19 08:12 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ Better fix for Bug #630348. Treat all DBPRT calls consistently, and
+ make sure the PerlIO_printf call is passed the correct parameter list.
+
+2003-08-19 07:31 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ Whatever the cause of bug #630348 was, this isn't the answer.
+ With 'PerlIO_fprintf', it doesn't compile! More investigation needed.
+
+2003-08-19 01:56 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ Allow the (compile-time) option of restoring global access to SMUX services.
+ If the consensus is that this should be the default (as currently), then
+ I've no strong feelings either way. Feel free to adjust accordingly.
+
+2003-08-19 01:53 dts12
+
+ * agent/helpers/cache_handler.c:
+
+ Automatically release expired cache resources.
+
+2003-08-19 01:52 dts12
+
+ * agent/helpers/cache_handler.c:
+
+ Invalidate the cache on (successful) SET requests.
+ This is currently done regardless - it would be sensible to make it
+ configurable on a per-cache basis.
+
+2003-08-18 15:14 rstory
+
+ * snmplib/container_iterator.c:
+
+ comment out code that shouldn't have been checked in yet
+
+2003-08-18 15:13 rstory
+
+ * snmplib/container.c:
+
+ update for correct method to cleanup container factory list; remove
+ release_if_top and _ba_* functions
+
+2003-08-18 15:11 rstory
+
+ * include/net-snmp/library/container.h:
+
+ update prototype for correct function to cleanup container factory list; fix
+ comment typos; remove release_if_top prototype and call in CONTAINER_FREE
+
+2003-08-18 15:09 rstory
+
+ * agent/snmp_vars.c:
+
+ call correct function to cleanup container factory list
+
+2003-08-18 15:08 rstory
+
+ * agent/agent_handler.c:
+
+ document segfault location for future fixing
+
+2003-08-18 09:12 dts12
+
+ * agent/mibgroup/agent/nsCache.c:
+
+ Bring into line with new cache release API definition.
+
+2003-08-18 08:49 rstory
+
+ * agent/helpers/table_mfd.c:
+
+ source for table_mfd
+
+2003-08-18 08:30 hardaker
+
+ * include/net-snmp/agent/stash_cache.h:
+
+ opps. missed the header
+
+2003-08-18 08:04 rstory
+
+ * include/net-snmp/agent/table_mfd.h:
+
+ don't reference non-existent file
+
+2003-08-18 08:01 rstory
+
+ * include/net-snmp/agent/table_mfd.h:
+
+ header for table_mfd
+
+2003-08-18 06:35 rstory
+
+ * include/net-snmp/library/container_iterator.h:
+
+ header for container iterator
+
+2003-08-18 05:42 dts12
+
+ * agent/mibgroup/mibII/: icmp.c, ip.c, tcp.c,
+ tcpTable.c, udp.c, udpTable.c:
+
+ New v5-style handlers should only ever receive MODE_GET requests.
+ Log a warning for other unexpected (or unrecognised) request modes.
+
+2003-08-18 03:19 dts12
+
+ * agent/mibgroup/mibII/: icmp.c, ip.c, tcp.c,
+ tcpTable.c, udp.c, udpTable.c:
+
+ Use the new (internal) cache validity checking.
+ Qn: How can we access the request-information structure (or similar)
+ from within iterator data_point routines?
+
+2003-08-18 03:17 dts12
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ Provide an API for determining whether a given cache is currently valid.
+ Release old cache resources before loading the new values.
+ NB: This involves a change in the 'free' hook API.
+
+2003-08-18 03:14 dts12
+
+ * include/net-snmp/library/container.h:
+
+ The macro function definitions rely on logging routines from 'snmp_logging.c'
+ so the appropriate declarations and defined constants need to be available.
+
+2003-08-18 03:12 dts12
+
+ * include/net-snmp/agent/ds_agent.h, agent/snmp_agent.c
+, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/smux/smux.h:
+
+ Support configuration of the socket address to listen for SMUX connections on.
+
+ Note: Change of behaviour - this patch defaults to listening for connections
+ from the localhost only.
+
+2003-08-18 02:55 dts12
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/snmpUDPDomain.c, snmplib/snmp_api.c:
+
+ Provisional support for sending client requests from a specified interface
+ or socket address.
+ Qn: Should this be applied to TCP connections too?
+ What about other transports?
+
+2003-08-18 02:53 dts12
+
+ * include/net-snmp/library/mib.h, snmplib/mib.c:
+
+ Implement 'snprintf_description' routines,
+ to output MIB definitions to a string rather than a file.
+
+2003-08-17 16:49 rstory
+
+ * local/mib2c-conf.d/syntax-RowStatus-get.m2i:
+
+ fix hardcoded var names/constants (eek!)
+
+2003-08-17 16:47 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ rename some typedefs; add *_ref_* typedefs; make netsnmp_index first item
+ in ctx; make index local instead of ptr; run new mfd-access-*-header; add
+ some prototypes, debug msgs; update init to set up mfd_registration, container,
+ *_get_values; fix renames mfd registration routine; run new makefile and
+ subagent conf files
+
+2003-08-17 16:43 rstory
+
+ * local/mib2c-conf.d/mfd-interface.m2c:
+
+ include mfd header; new *_get_values; tweak *_get_column: include accessible
+ indexes, push var memory check up a level *_get_values (should go up one
+ more, into helper instead of generated code); run new mfd_access_*_interface
+
+2003-08-17 16:40 rstory
+
+ * local/mib2c-conf.d/mfd-data-set.m2c:
+
+ move process print after noaccess test
+
+2003-08-17 16:39 rstory
+
+ * local/mib2c-conf.d/mfd-data-get.m2c:
+
+ new *_(allocate|release)_(data|ctx); move process print after noaccess test
+
+2003-08-17 16:38 rstory
+
+ * local/mib2c-conf.d/mfd-data-access.m2c:
+
+ rename access-* to mfd-access-*
+
+2003-08-17 16:37 rstory
+
+ * local/mib2c-conf.d/generic-table-oids.m2c:
+
+ add header; include enums too
+
+2003-08-17 16:33 rstory
+
+ * local/mib2c-conf.d/: mfd-access-unsorted-external-body.m2i,
+ mfd-access-unsorted-external-header.m2i,
+ mfd-access-unsorted-external-interface.m2i, mfd-makefile.m2m
+, subagent.m2c:
+
+ new mfd data access conf files (wrap around new container iterator); new mfd
+ conf files to generate makefile/subagent main
+
+2003-08-17 16:31 rstory
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ use config.h define to temporarily disable win callback transport, instead
+ of win specific ifdefs in code
+
+2003-08-17 16:21 rstory
+
+ * snmplib/snmp_debug.c:
+
+ new debugmsg_suboid
+
+2003-08-17 16:21 rstory
+
+ * snmplib/read_config.c:
+
+ check for null ptr
+
+2003-08-17 16:21 rstory
+
+ * snmplib/container_list_ssll.c:
+
+ remove noalloc functions; rename typedef
+
+2003-08-17 16:18 rstory
+
+ * snmplib/container_binary_array.c:
+
+ remove noalloc functions
+
+2003-08-17 16:17 rstory
+
+ * snmplib/container.c:
+
+ remove unused var and noalloc functions
+
+2003-08-17 16:17 rstory
+
+ * dist/cvsup:
+
+ add optional upload of src tarball after update
+
+2003-08-17 15:22 rstory
+
+ * snmplib/mib.c:
+
+ new netsnmp_sprint_realloc_objid (doesn't use mibs); rework ifdefs for
+ netsnmp_sprint_realloc_objid_tree & DISABLE_MIB_LOADING
+
+2003-08-17 15:20 rstory
+
+ * snmplib/: Makefile.in, container_iterator.c:
+
+ add new container iterator
+
+2003-08-17 15:19 rstory
+
+ * local/mib2c:
+
+ don't run indent on files unless they end w/ .c or .h; print more info when
+ die of unexpected else
+
+2003-08-17 15:18 rstory
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ new DEBUGMSGSUBOID & supporting cast
+
+2003-08-17 15:17 rstory
+
+ * include/net-snmp/library/snmp.h:
+
+ fix comments which exceed 80 chars
+
+2003-08-17 15:16 rstory
+
+ * include/net-snmp/library/mib.h:
+
+ new netsnmp_sprint_realloc_objid prototype
+
+2003-08-17 15:15 rstory
+
+ * include/net-snmp/agent/table.h:
+
+ new netsnmp_table_find_next_row prototype
+
+2003-08-17 15:15 rstory
+
+ * include/net-snmp/agent/snmp_vars.h:
+
+ new netsnmp_enable_subagent prototype
+
+2003-08-17 15:14 rstory
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ new netsnmp_check_requests_error prototype
+
+2003-08-17 15:12 rstory
+
+ * agent/helpers/baby_steps.c,
+ include/net-snmp/agent/baby_steps.h:
+
+ new (temporary?) baby steps helper
+
+2003-08-17 15:10 rstory
+
+ * include/net-snmp/agent/all_helpers.h:
+
+ add baby_steps.h, row_merge.h, table_mfd.h
+
+2003-08-17 15:10 rstory
+
+ * include/net-snmp/agent/agent_handler.h:
+
+ define new can baby step mode flag
+
+2003-08-17 15:10 rstory
+
+ * include/net-snmp/types.h:
+
+ new netsnmp_ref_void, netsnmp_ref_size_t typedefs
+
+2003-08-17 15:09 rstory
+
+ * include/net-snmp/utilities.h:
+
+ bail if net-snmp-config hasn't been included; add container/assert headers
+
+2003-08-17 15:08 rstory
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ bail if net-snmp-config hasn't been included; don't inlcude utilities twice
+
+2003-08-17 15:06 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ new netsnmp_enable_subagent, only defined if USING_AGENTX_SUBAGENT_MODULE, so
+ a link error will occur if agentx support not compiled in
+
+2003-08-17 15:05 rstory
+
+ * agent/helpers/table_array.c:
+
+ remove find_next_row, use new netsnmp_table_index_find_next_row; fix typo
+
+2003-08-17 15:03 rstory
+
+ * agent/helpers/table.c:
+
+ notes for future enhancements; fix potential memory leak; new
+ netsnmp_table_index_find_next_row
+
+2003-08-17 15:02 rstory
+
+ * agent/helpers/row_merge.c:
+
+ skip grouping if only 1 varbind; note for future enhancements
+
+2003-08-17 15:02 rstory
+
+ * agent/helpers/Makefile.in:
+
+ add new baby_steps, table_mfd helpers; build objs/lobjs from srcs
+
+2003-08-17 14:59 rstory
+
+ * agent/snmp_agent.c:
+
+ new netsmp_check_requests_errors
+
+2003-08-17 14:58 rstory
+
+ * agent/agent_handler.c:
+
+ code reuse (call_handlers uses call_handler); add new mode text for
+ handler_can_mode slist
+
+2003-08-16 07:27 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ - move some pointer saving for STASH related stuff outside the more
+ frequently called loop.
+
+2003-08-15 04:24 dts12
+
+ * include/net-snmp/library/mib.h, man/snmpcmd.1.def,
+ snmplib/mib.c, snmplib/snmp_parse_args.c:
+
+ Move prefix/suffix options under -I
+
+2003-08-15 03:33 dts12
+
+ * snmplib/mib.c:
+
+ Don't add a trailing dot if we're setting a prefix, but not a suffix.
+
+2003-08-14 01:13 dts12
+
+ * agent/helpers/: all_helpers.c, bulk_to_next.c,
+ cache_handler.c, debug_handler.c, instance.c,
+ mode_end_call.c, multiplexer.c, read_only.c,
+ row_merge.c, scalar.c, scalar_group.c,
+ serialize.c, watcher.c:
+
+ Reorganise the agent helper 'doxygen' structure, to make it less "flat".
+ Group "leaf-object" helpers together, and internal "utility" helpers similarly.
+
+2003-08-14 01:09 dts12
+
+ * snmplib/snmp_api.c:
+
+ Try to catch (some) PDU dual-free's.
+
+2003-08-14 00:15 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ 1 of 2 memory leaks found (ok, I said I wasn't going to find it but...)
+
+2003-08-13 23:40 hardaker
+
+ * agent/helpers/: Makefile.in, all_helpers.c,
+ stash_cache.c, table_iterator.c:
+
+ - added a new helper to auto-cache data. Currently the only
+ sub-module supported by this is the table_iterator, but significant
+ speed improvements can be seen when caching of iterator data is
+ turned on.
+ - to test add to snmpd.conf:
+ injectHandler stash_cache MODULE table_iterator
+ (a good test module is the nsModuleTable which has a lot of rows)
+ - warning: not heavily tested. Seems ok for at least the simple cases.
+
+2003-08-13 23:36 hardaker
+
+ * include/net-snmp/: agent/snmp_agent.h, library/snmp.h
+:
+
+ - define a new internal-use mode: MODE_GET_CACHE
+
+2003-08-13 23:36 hardaker
+
+ * snmplib/snmp_enum.c:
+
+ use calloc to initialize and zero memory (fixes an error spotted by valgrind).
+
+2003-08-13 23:35 hardaker
+
+ * snmplib/oid_stash.c:
+
+ spotted one memory leak.
+
+2003-08-13 23:15 hardaker
+
+ * apps/snmpwalk.c, man/snmpwalk.1.def:
+
+ - added a -Ct option to snmpwalk to display walk clock timer results
+
+2003-08-13 22:40 hardaker
+
+ * include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c
+:
+
+ - added a parent node for upward traversal.
+ - a getnext implementation that actually works (fairly heavily tested).
+
+2003-08-13 22:36 hardaker
+
+ * agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/udpTable.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ - modified the free function pointer to take a cache argument for
+ generalizing it a bit more.
+
+2003-08-13 22:33 hardaker
+
+ * agent/agent_handler.c,
+ include/net-snmp/agent/agent_handler.h:
+
+ - Implement netsnmp_inject_handler_before() which takes an argument to
+ determine where in the handler chain it should inject something.
+ - Modify the injectHandler .conf token to taken an optional final
+ BEFORE argument.
+
+2003-08-10 11:39 hardaker
+
+ * include/net-snmp/library/system.h, snmplib/Makefile.in
+, snmplib/mib.c, snmplib/parse.c:
+
+ misc high level copyright notes added (IE, see the COPYING file, ...).
+
+2003-08-10 11:38 hardaker
+
+ * configure.in, agent/snmpd.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/logmatch.c:
+
+ misc copyright notes added.
+
+2003-08-05 01:42 dts12
+
+ * net-snmp-config.in:
+
+ Catch missing parameters in compile-subagent handling too
+
+2003-08-05 01:38 dts12
+
+ * net-snmp-config.in:
+
+ Catch missing parameters in create-snmpv3-user handling
+
+2003-08-05 01:32 dts12
+
+ * net-snmp-config.in:
+
+ Use $1 parameter directly in create-snmpv3-user processing.
+ Somewhat less confusing than with the additional $arg parameter,
+ and less chance of shifting a non-existent value.
+ (Relevant to bug #755571)
+
+2003-08-02 06:45 rstory
+
+ * local/mib2c-conf.d/mfd-top.m2c:
+
+ reog/update code generation; run mfd-data-access; set handler RWRITE if table
+ writable; chg table registration type; include new table setup
+
+2003-08-02 06:39 rstory
+
+ * local/mib2c-conf.d/parent-set.m2i:
+
+ simplify param lists; update code generation
+
+2003-08-02 06:37 rstory
+
+ * local/mib2c-conf.d/m2c_setup_node.m2i:
+
+ setup node srh independent of get temp use
+
+2003-08-02 06:36 rstory
+
+ * local/mib2c-conf.d/generic-table-oids.m2c:
+
+ be more paranoid about temporary override of $name
+
+2003-08-02 06:35 rstory
+
+ * local/mib2c-conf.d/generic-table-indexes.m2i:
+
+ chg indention on some comment blocks; use new node-storage.m2i; rmv data ptr
+
+2003-08-02 06:33 rstory
+
+ * local/mib2c-conf.d/: m2c_setup_table.m2i,
+ mfd-data-access.m2c, node-storage.m2i:
+
+ new code templates
+
+2003-08-02 06:31 rstory
+
+ * local/mib2c-conf.d/: generic-ctx-get.m2i,
+ generic-ctx-set.m2i, generic-data-context.m2i,
+ generic-get-oid.m2i, generic-value-map.m2i,
+ mfd-data-get.m2c, mfd-data-set.m2c, node-get.m2i,
+ node-set.m2i, syntax-DateAndTime-get.m2d:
+
+ data at ctx->data, not ctx; chg indention on block comments; fix some missed
+ name changes; update for renamed conf files; simplify some param lists;
+ add some asserts
+
+2003-07-31 07:23 dts12
+
+ * net-snmp-config.in:
+
+ Don't shift away command-line parameters that probably aren't there
+ (and certainly aren't relevant to the action being handled)
+ Reported by Vinod Johnson
+
+2003-07-31 03:12 dts12
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Handle proxied SETs in the ACTION pass, rather than the commit pass.
+ This allows failures here to back out assignments in other modules.
+ We can't process UNDO requests successfully, but we can at least report
+ this fact. Which is preferable to claiming failure but (silently)
+ acting on some assignments.
+
+2003-07-31 03:08 dts12
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Don't log warnings for deliberately unused SET passes.
+
+2003-07-31 03:04 dts12
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Handle SNMP errors from proxied servers correctly.
+ Passing the error back up the chain seems to Do The Right Thing.
+
+2003-07-31 03:03 dts12
+
+ * agent/snmp_agent.c:
+
+ Problems in MIB processing are indicated via the 'asp->status' field,
+ rather than the return value. So use that when downgrading v2-style
+ errors for v1 responses.
+
+2003-07-30 10:55 rstory
+
+ * local/mib2c-conf.d/: default-mfd-top.m2c, mfd-data-get.m2c
+, mfd-data-set.m2c, mfd-interface.m2c, mfd-top.m2c
+:
+
+ new MIBs For Dummies (mfd) conf files
+
+2003-07-30 10:51 rstory
+
+ * local/mib2c:
+
+ add example_(start/end); fix $x.ranges; allow literal var names in user code
+ via $@var; add table_is_writable function
+
+2003-07-30 10:45 rstory
+
+ * local/mib2c-conf.d/: generic-ctx-copy.m2i,
+ generic-ctx-get.m2i, generic-ctx-set.m2i,
+ generic-data-context.m2i, generic-get-char.m2i,
+ generic-get-decl-bot.m2i, generic-get-decl.m2i,
+ generic-get-long.m2i, generic-get-oid.m2i,
+ generic-header-bottom.m2i, generic-header-top.m2i,
+ generic-source-includes.m2i, generic-table-indexes.m2i,
+ generic-table-oids.m2c, generic-value-map-reverse.m2i,
+ generic-value-map.m2i, m2c_setup_node.m2i, node-get.m2i
+, node-set.m2i, parent-dependencies.m2i,
+ parent-set.m2i, syntax-DateAndTime-get.m2d,
+ syntax-DateAndTime-get.m2i, syntax-InetAddress-get.m2i,
+ syntax-InetAddress-set.m2i, syntax-InetAddressType-get.m2i
+, syntax-InetAddressType-set.m2i,
+ syntax-RowStatus-get.m2i, syntax-TestAndIncr-get.m2i:
+
+ lots of new mib2c helpers (includes)
+
+2003-07-30 10:38 rstory
+
+ * local/mib2c-conf.d/: details-enums.m2i, details-node.m2i
+, details-table.m2i:
+
+ mostly variable renames; some reorg
+
+2003-07-30 06:25 dts12
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Discard values received from the proxy if the OID is invalid.
+ (Typically when a GetNext walks past the end of the proxied subtree).
+ Also update the comments to describe the behaviour in a bit more detail.
+
+2003-07-30 06:11 dts12
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Respond to SNMP errors from the proxied agent.
+ (The response is much too simplistic, and is likely to prove an
+ over-reaction in many cases. But it's a start)
+ Note that the indentation has not been adjusted - wait until things
+ settle down first.
+
+2003-07-29 08:13 dts12
+
+ * apps/: snmpdf.c (V4-2-patches.6), snmpdf.c:
+
+ Fix a typo in an error message (Patch #769221)
+
+2003-07-29 05:07 dts12
+
+ * include/net-snmp/library/snmp.h:
+
+ Correct the comments identifying hex/ascii values for PDU types.
+ Reported by Oleg Ivanov.
+
+2003-07-29 02:06 dts12
+
+ * agent/mibgroup/: ucd-snmp/extensible.c, utilities/execute.c
+:
+
+ Support for multi-command directives for 'sh' extensibility.
+ (i.e. running "this; that; the other")
+ Retained the original behaviour of truncating at the first ';' for
+ 'exec' directives (following the Principle of Least Astonishment)
+
+2003-07-29 01:54 dts12
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Log failure to set up proxy command (rather than ploughing on regardless!)
+
+2003-07-29 01:53 dts12
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Fix support for multi-line (relocatable) output.
+
+2003-07-27 16:54 rstory
+
+ * local/: mib2c (V5-0-patches.2), mib2c:
+
+ fix filename in error msg, as noted in coders
+
+2003-07-24 19:29 rstory
+
+ * local/mib2c:
+
+ fix oidlength function
+
+2003-07-24 17:55 rstory
+
+ * local/mib2c:
+
+ add cvs id tag; add comment documenting nonindex; indexes loop will now
+ include index for tables using augments
+
+2003-07-24 17:52 rstory
+
+ * perl/SNMP/SNMP.xs:
+
+ add access to the AUGMENTS attribute
+
+2003-07-23 16:43 rstory
+
+ * local/mib2c:
+
+ add warning for unknown $var.tag tags to catch typos; watch for unmatched
+ @ in skipvars; don't open new file it it's already open; add flag to
+ process_file for save/restore of vars; fix process again so it will catch
+ unmatches @@; add new @foreach nonindex@
+
+2003-07-22 09:07 jbpn
+
+ * include/net-snmp/library/snmp_parse_args.h,
+ snmplib/snmp_parse_args.c:
+
+ - zero out sensitive command-line arguments (community string, user name,
+ authentication passphrase, privacy passphrase).
+
+ NOTE: this does not work for all plaforms -- certainly it doesn't
+ work for Solaris. A different, more gross method is needed
+ for these platforms (see sendmail code for details -- need
+ I say more?).
+
+2003-07-22 08:45 dts12
+
+ * man/snmpvacm.1.def:
+
+ Improved descriptions of the various subcommands.
+ Based on material supplied by Nick DiRico.
+
+2003-07-22 08:08 dts12
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ Various fixes to the recent TCP table redesign, supplied by Katsuhisa ABE.
+ (Some others still outstanding, awaiting discussion. But these are clear
+ mistakes, which need fixing).
+
+2003-07-22 08:04 dts12
+
+ * agent/mibgroup/mibII/: tcpTable.c, udpTable.c:
+
+ Use the table information 'colnum' field to identify the requested column
+ object(s) rather than pulling stuff out of the OID. Suggested by Oleg Ivanov.
+
+2003-07-22 07:59 dts12
+
+ * apps/snmpvacm.c:
+
+ Make the createView mask parameter optional
+ (as with the 'view' config directive)
+
+2003-07-22 07:57 dts12
+
+ * apps/snmpvacm.c:
+
+ Correct the layout of the usage message.
+
+2003-07-22 07:56 dts12
+
+ * apps/snmpvacm.c:
+
+ Use the more flexible API call for handling view OIDs
+
+2003-07-19 10:55 rstory
+
+ * local/mib2c-conf.d/: details-enums.m2i, details-node.m2i
+, details-table.m2i:
+
+ mib2c include files to generate node details
+
+2003-07-19 10:52 rstory
+
+ * local/mib2c:
+
+ track current line and file name; new find_conf, process_file subs; remove
+ @skip N@ ability; skip @token@ search if line doesn't begin with @;
+ add @skipif@, @break@; dont require spaces for @close@; add -ifexists param to
+ @include@; new @ifconf@ + rework code to make other @ifXXX@ tokens easy; merge
+ else/elsif in process loop
+
+2003-07-18 13:58 rstory
+
+ * local/mib2c:
+
+ add parsing of initial default file; delay processing of cmd line vars til
+ after processing default file; add new $c.needslength, $c.hasdefval, $c.defval,
+ $c.module, $c.accessible, $c.children (needs work), $c.hashint, $c.hint,
+ $c.ranges,$c.enumrange (needs work) and various code to support them; add
+ parameter to skip to allow one to break out of multiple levels (needs work);
+ allow spaces after @cmd@ to allow for better control of indention; move file
+ open/close to subroutines; new @append file@, @close file@, @include file@;
+ allow writing to multiple files at once; new @print text@ (to stdout);
+ whew! more to come...
+
+2003-07-16 03:29 dts12
+
+ * net-snmp-config.in:
+
+ Support processing of compile-subagent sub-options in any order
+
+2003-07-16 03:28 dts12
+
+ * net-snmp-config.in:
+
+ Handle compile-subagent called with no parameters
+
+2003-07-16 03:24 dts12
+
+ * net-snmp-config.in:
+
+ Fix inconsistent usage within compile-subagent
+
+2003-07-16 03:21 dts12
+
+ * net-snmp-config.in:
+
+ Handle --create-snmpv3-user called with no parameters
+
+2003-07-16 02:07 dts12
+
+ * README:
+
+ Clarify the roles of the various mailing lists, and which ones to use
+ (or not use). Also updated the project web page along the same lines.
+
+2003-07-15 21:50 rstory
+
+ * local/mib2c:
+
+ rename istable to iscolumn; add enums; add currentvar; fix enum dump to work
+ for scalars
+
+2003-07-15 08:06 dts12
+
+ * agent/helpers/table.c:
+
+ Fix a varargs type specification. Spotted by Oleg Ivanov.
+
+2003-07-15 07:35 dts12
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ Avoid referencing freed memory. (Reported by Steve Bennett)
+
+2003-07-15 07:26 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ Run pass-through scripts in the ACTION pass, not COMMIT, so any errors
+ can be reported back properly.
+ Also tweak the error-checking code to recognise the error strings properly.
+
+2003-07-14 17:00 rstory
+
+ * configure:
+
+ configure to mach configure.in
+
+2003-07-14 16:52 rstory
+
+ * configure.in:
+
+ apply patch from Steve Bennett <steveb@snapgear.com> to allow one to disable
+ the callback transport and reduce agent size. Tweaked by me a bit. disable
+ agentx if callbacks disabled
+
+ remove (transport|security)_[l]obj_list, as [l]obj lists are now generated
+ from srcs; remove AgentX beta code warning from help
+
+2003-07-14 16:50 rstory
+
+ * agent/snmp_vars.c, include/net-snmp/net-snmp-config.h.in
+, include/net-snmp/library/snmpCallbackDomain.h:
+
+ apply patch from Steve Bennett <steveb@snapgear.com> to allow one to disable
+ the callback transport and reduce agent size. Tweaked by me a bit. disable
+ agentx if callbacks disabled.
+
+2003-07-13 11:19 rstory
+
+ * include/net-snmp/library/callback.h, snmplib/callback.c
+:
+
+ add priority to callback so user can determine callback order
+
+2003-07-13 09:44 rstory
+
+ * agent/mibgroup/mibII/tcpTable.h:
+
+ restore inpcb struct for linux (until it shows up somewhere else in cvs)
+
+2003-07-11 05:08 dts12
+
+ * man/snmpvacm.1.def:
+
+ Fix errors in the examples, spotted by Nick DiRico
+
+2003-07-10 06:11 rstory
+
+ * dist/: nsb-functions, nsb-nightly, nsb-package
+:
+
+ sync w/patches
+
+2003-07-10 05:57 dts12
+
+ * agent/mibgroup/mibII/: tcp.c, tcp.h, tcpTable.c
+, tcpTable.h, udp.c, udp.h, udpTable.c
+, udpTable.h:
+
+ New-API implementation of UDP and TCP tables, using cache and iterator helpers.
+ Works on Linux and HP-UX 10, compiles (but untested) on Solaris & Windows.
+
+2003-07-10 03:55 dts12
+
+ * include/net-snmp/library/container_binary_array.h:
+
+ Colon? semicolon? What's a pixel or two between friends....
+
+2003-07-10 02:12 dts12
+
+ * win32/: win32sdk.dsw, libagent/libagent.def,
+ libhelpers/libhelpers.dsp, libsnmp/libsnmp.dsp,
+ libsnmp_dll/libsnmp.def, libsnmp_dll/libsnmp_dll.dsp,
+ netsnmpmibssdk/netsnmpmibssdk.dsp, snmpdsdk/snmpd.dsp:
+
+ Visual C++ tweaks, to get everything to compile cleanly.
+
+2003-07-09 08:40 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Missing header protection checks
+
+2003-07-09 08:14 dts12
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ Handle systems without getpwnam or getgrnam
+
+2003-07-09 08:06 dts12
+
+ * snmplib/snmp_logging.c:
+
+ Provide default definitions of syslog constants if not already present.
+
+2003-07-09 08:05 dts12
+
+ * include/net-snmp/library/container_binary_array.h,
+ snmplib/container.c:
+
+ Provide missing forward declarations
+
+2003-07-09 05:25 dts12
+
+ * agent/snmpd.c:
+
+ Support for the old '-L' option.
+ (Incredibly clunky, but necessary)
+
+2003-07-09 05:24 dts12
+
+ * include/net-snmp/library/snmp_enum.h, snmplib/snmp_api.c
+, snmplib/snmp_enum.c:
+
+ Support for "persistent enumerations".
+
+2003-07-08 06:02 dts12
+
+ * agent/mibgroup/mibII/: icmp.c, ip.c, tcp.c,
+ udp.c:
+
+ Improved debugging for new scalar_group implementations.
+
+2003-07-07 15:49 hardaker
+
+ * agent/mibgroup/mibII/mta_sendmail.c:
+
+ Patch from Chuck Yerkes to make the MTA-MIB work with newer sendmail versions, including FFR_QUARANTINE support
+
+2003-07-07 06:04 dts12
+
+ * agent/mibgroup/util_funcs.h:
+
+ Export the 'make_tempfile' routine.
+
+2003-07-06 20:41 rstory
+
+ * snmplib/: Makefile.in, container_binary_array.c:
+
+ fix typos
+
+2003-07-04 10:35 hardaker
+
+ * snmplib/snmp_enum.c:
+
+ added sys/types
+
+2003-07-03 21:21 rstory
+
+ * snmplib/container_binary_array.c:
+
+ free container on free; sort before for_each executes; add init to register
+
+2003-07-03 21:20 rstory
+
+ * snmplib/Makefile.in:
+
+ add new containers
+
+2003-07-03 21:20 rstory
+
+ * include/net-snmp/library/container.h:
+
+ update CONTAINER_FREE for new requirement that containers free themselves
+
+2003-07-03 21:20 rstory
+
+ * snmplib/container.c:
+
+ add init for list_ssll and null containers; add aliases for list and
+ binary containers; update CONTAINER_FREE for new requirement that
+ containers free themselves
+
+2003-07-03 20:53 rstory
+
+ * snmplib/container_list_ssll.c, snmplib/container_null.c
+, include/net-snmp/library/container_list_ssll.h,
+ include/net-snmp/library/container_null.h:
+
+ new files
+
+2003-07-03 20:26 rstory
+
+ * snmplib/container_list_ssll.c:
+
+ file container_list_ssll.c was initially added on branch V5-0-patches.
+
+2003-07-03 20:26 rstory
+
+ * snmplib/container_null.c:
+
+ file container_null.c was initially added on branch V5-0-patches.
+
+2003-07-02 14:57 hardaker
+
+ * testing/tests/: T023snmpv3getMD5DES, T025snmpv3getSHADES
+:
+
+ Use a SKIPIFNOT for real tokens (typo).
+
+2003-07-02 14:55 hardaker
+
+ * testing/tests/: T150solarishostcpu, T151solarishostdisk
+, T152hostuptime, T153solarisswap:
+
+ fix new tests in various ways
+
+2003-07-02 14:45 hardaker
+
+ * snmplib/oid_stash.c:
+
+ free the root pointer.
+
+2003-07-02 14:45 hardaker
+
+ * snmplib/snmpv3.c:
+
+ free the engineid at *shutdown* not *startup*:-/
+
+2003-07-02 14:41 hardaker
+
+ * agent/snmpd.c:
+
+ don't call the cleanup routines at shutdown since they're filled with
+ double frees()
+
+2003-07-02 14:32 hardaker
+
+ * agent/mibgroup/examples/netSnmpHostsTable.h:
+
+ require needs examples/ prefix
+
+2003-07-02 14:13 hardaker
+
+ * agent/agent_registry.c:
+
+ Use a for loop instead of a recursive function.
+
+2003-07-02 14:13 hardaker
+
+ * agent/mibgroup/agent/nsDebug.c:
+
+ protect against empty rows.
+
+2003-07-02 13:52 hardaker
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ fix container code from the last patch
+
+2003-07-02 13:29 hardaker
+
+ * agent/agent_handler.c, agent/agent_registry.c,
+ agent/snmp_agent.c, agent/snmpd.c,
+ snmplib/container_binary_array.c, snmplib/mib.c,
+ snmplib/read_config.c, snmplib/snmpCallbackDomain.c,
+ snmplib/snmp_api.c, snmplib/snmp_transport.c,
+ snmplib/snmpusm.c, snmplib/snmpv3.c:
+
+ Patch: 756286: A global free -> SNMP_FREE replacement
+
+2003-07-02 13:20 hardaker
+
+ * README, agent/agent_handler.c,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/snmp_agent.c, agent/snmp_vars.c, agent/snmpd.c
+, include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/snmp_vars.h,
+ include/net-snmp/library/callback.h,
+ include/net-snmp/library/container.h,
+ include/net-snmp/library/container_binary_array.h,
+ include/net-snmp/library/lcd_time.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmp_enum.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/snmpv3.h, snmplib/callback.c,
+ snmplib/container.c, snmplib/container_binary_array.c,
+ snmplib/lcd_time.c, snmplib/read_config.c,
+ snmplib/snmpCallbackDomain.c, snmplib/snmp_enum.c,
+ snmplib/snmp_secmod.c, snmplib/snmp_transport.c,
+ snmplib/snmpusm.c, snmplib/snmpv3.c:
+
+ Patch #724925 from Peter Warasin to free lots of memory for a really clean shutdown
+
+2003-07-02 13:02 hardaker
+
+ * agent/: agent_registry.c (V5-0-patches.2), agent_registry.c
+:
+
+ Patch #724925 from Peter Warasin to fix netsnmp_subtree_unload() to update the root pointer
+
+2003-07-02 12:59 hardaker
+
+ * testing/tests/: T150solarishostcpu, T151solarishostdisk
+, T152hostuptime, T153solarisswap:
+
+ Patch: 756286: New solaris specific HR tests from Bruce Shaw
+
+2003-07-02 12:47 hardaker
+
+ * agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/logmatch.c, snmplib/parse.c
+ (V5-0-patches.[1,2,1]), agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/logmatch.c, snmplib/parse.c:
+
+ Patch #760448 from Bob Rowlands/Sun to fix bug #751913 to protect a few minor security violations
+
+2003-07-02 10:58 hardaker
+
+ * COPYING, configure, configure.in,
+ agent/snmpd.c, include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/library/system.h, snmplib/Makefile.in
+, snmplib/mib.c, snmplib/strlcpy.c:
+
+ Patch #760417 from Bob Rowlands/Sun for fixing Bug #751920 for minor security problems (PID file unliked first, and use strlcpy instead of strcpy. A new strlcpy file was defined if not defined for a system.
+
+2003-07-02 10:44 hardaker
+
+ * snmplib/strlcpy.c:
+
+ file strlcpy.c was initially added on branch V5-0-patches.
+
+2003-07-02 10:26 hardaker
+
+ * include/net-snmp/library/: snmp_debug.h (V5-0-patches.1),
+ snmp_debug.h:
+
+ Patch #764047 from Stephen J. Friedl: Remove redundant declaration from snmp_debug.h and fix a few comments
+
+2003-07-02 10:21 hardaker
+
+ * configure, configure.in (V5-0-patches.[7,7]), configure,
+ configure.in:
+
+ Patch #759309 from Stephen Friedl to add prompt over-ride flag descriptions to prompt output
+
+2003-07-02 10:15 hardaker
+
+ * configure, configure.in:
+
+ patch #759298: fix spelling error
+
+2003-07-01 05:33 dts12
+
+ * agent/helpers/scalar1.c:
+
+ Remove redundent file.
+
+2003-07-01 03:13 dts12
+
+ * agent/mibgroup/mibII/: icmp.c, icmp.h, ip.c,
+ ip.h, kernel_linux.c, kernel_linux.h,
+ mibII_common.h, tcp.c, tcp.h, udp.c, udp.h
+:
+
+ Re-implement the scalar network statistics using new API features.
+ This serves as an example of the 'scalar_group' and 'cache_handler'
+ helpers, as well as (hopefully) simplifying the code somewhat.
+
+2003-07-01 02:57 dts12
+
+ * agent/helpers/: scalar.c, scalar_group.c:
+
+ Minor tweaks to handle walking from one scalar to another correctly,
+ and deal with internal missing objects within a scalar group.
+
+2003-06-30 22:34 hardaker
+
+ * local/mib2c.iterate_access.conf,
+ agent/mibgroup/examples/netSnmpHostsTable_access.c,
+ agent/mibgroup/examples/netSnmpHostsTable.c,
+ agent/mibgroup/examples/netSnmpHostsTable.h:
+
+ update for row deletion
+
+2003-06-30 17:15 hardaker
+
+ * local/: mib2c.access_functions.conf,
+ mib2c.iterate_access.conf:
+
+ update to support row creation. Deletion support still coming, as is
+ a separate handler.
+
+2003-06-30 17:10 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ remove more "not serialized" code.
+
+2003-06-30 17:08 hardaker
+
+ * agent/mibgroup/examples/: netSnmpHostsTable.c,
+ netSnmpHostsTable.h, netSnmpHostsTable_access.c,
+ netSnmpHostsTable_access.h:
+
+ Updated for row creation.
+
+2003-06-30 10:53 hardaker
+
+ * agent/mibgroup/Rmon/alarm.c:
+
+ patch from Fong Tsui for fixing NULL references
+
+2003-06-30 10:43 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - make the default agentx ping interval be 15 seconds.
+
+2003-06-30 09:26 dts12
+
+ * agent/mibgroup/: util_funcs.c, ucd-snmp/extensible.h,
+ utilities/execute.h:
+
+ Make sure the dependencies for the new approach to sub-command
+ invocation are properly acknowledged.
+
+2003-06-30 07:40 dts12
+
+ * agent/agent_handler.c:
+
+ Check for validity of parameters before using them. (Paranoid? Who, me?)
+
+2003-06-30 06:51 dts12
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Caching of interface data is actually Linux-specific.
+
+2003-06-30 05:05 dts12
+
+ * agent/helpers/Makefile.in,
+ include/net-snmp/agent/all_helpers.h:
+
+ Include recent helper modules in the helper library and meta-include file.
+
+2003-06-27 04:43 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Simplify the processing of "traphandle" directives
+ (using the new generic sub-command execution utility routines,
+ and the improved varlist logging configuration)
+
+2003-06-27 04:39 dts12
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ Use the new generic sub-command execution utility routines instead
+ of the extensible-specific ones.
+
+2003-06-27 04:37 dts12
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ Include a general 'magic' parameter in both cache data structure
+ and cache loading routine. Just In Case It Might Come In Useful.
+ Happy, Wes?
+
+2003-06-27 04:09 dts12
+
+ * agent/: Makefile.in, mibgroup/utilities/execute.c,
+ mibgroup/utilities/execute.h:
+
+ Generalised sub-command execution utility routines.
+ (The current 'exec_command' and 'shell_command' routines are very specific
+ to the details of the 'struct extensible' data structure).
+ These routines can be used more widely, wherever a sub-process is needed.
+
+ Questions:
+ a) Should these utilise the "realloc" mechanism, rather than
+ enforce a fixed size output buffer?
+ b) Do they belong in the main library (or possibly the agent library)
+ rather than a mibgroup?
+
+2003-06-27 01:42 dts12
+
+ * apps/snmptrapd_log.c:
+
+ More flexible handling of formatting varbind lists.
+ "%V" configures the varbind separator character (alt_format => added space)
+ "%v" uses this separator (alt_format => separator also printed before the list)
+ Defaults to using the earlier '\t' or ", " if no separator is specified.
+
+2003-06-26 02:27 dts12
+
+ * local/mib2c.notify.conf:
+
+ Use the new features of mib2c to tidy up the output a bit.
+
+2003-06-26 02:26 dts12
+
+ * local/mib2c:
+
+ Extend mib2c's new counter routines to cover "subloops" as well
+ (i.e. the number of columns/indexes in a particular table,
+ and the number of objects to be included with a given notification)
+
+2003-06-25 23:15 hardaker
+
+ * local/: mib2c, mib2c.conf:
+
+ - prompt support for mib2c to ask questions to the user.
+ - A new top-level wrapper around all the other mib2c files that walks
+ you through selecting the right mib2c configuration file you wish to
+ use and then sources it for you.
+ - todo: generate unique file names if both scalar and table creation
+ is done, eg.
+
+2003-06-25 23:13 hardaker
+
+ * local/mib2c.vartypes.conf:
+
+ boy is that not needed any more
+
+2003-06-25 14:41 hardaker
+
+ * local/mib2c:
+
+ Dave asks, dave gets:
+ - new functions returning 1 or 2: $var.isscalar, $var.iscolumn
+ - $var.parent returns the parent label string of the node.
+
+2003-06-25 14:28 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ fix request -> requests as pointed out by Steve Benett
+
+2003-06-25 07:38 dts12
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Stamp on a trailing '.' when specifying VACM OIDs.
+
+2003-06-25 07:30 dts12
+
+ * snmplib/snmp_enum.c:
+
+ Calls to release enumeration lists when no longer required.
+ Normally this would be handled automatically when an application
+ exists, but it might be useful to release resources earlier.
+
+2003-06-25 07:24 dts12
+
+ * agent/Makefile.in:
+
+ Install the 'dlmod.h' header file
+
+2003-06-24 06:20 dts12
+
+ * local/: mib2c, mib2c.notify.conf:
+
+ Initial support for code to send out traps and informs.
+ This still doesn't address *when* such notifications should
+ be generated, but it at least helps with doing so.
+
+2003-06-23 22:30 nba
+
+ * apps/snmptrapd_handlers.c:
+
+ Remove too much memdup'ing in inform reply
+
+2003-06-23 14:33 nba
+
+ * mibs/rfclist:
+
+ Add APS-MIB and MALLOC-MIB
+
+2003-06-23 14:31 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ Update from IANA
+
+2003-06-23 14:30 nba
+
+ * apps/snmptrapd.c:
+
+ remove now unused snmp_clone_pdu2
+
+2003-06-23 12:37 nba
+
+ * apps/snmptrapd_handlers.c:
+
+ include wait.h for waitpid, and re-instate the code that responds to an inform
+
+2003-06-23 06:47 dts12
+
+ * agent/agent_trap.c, include/net-snmp/agent/agent_trap.h
+:
+
+ Utility routine to convert v1 traps to v2-notification-style varbind list.
+
+2003-06-23 06:35 dts12
+
+ * apps/Makefile.in:
+
+ Construct a library containing the core trapd handling functionality.
+
+2003-06-23 06:23 dts12
+
+ * agent/mibgroup/mibII/sysORTable.h:
+
+ The sysORTable module is dependent on system_mib, so ensure this is available.
+
+2003-06-23 06:13 dts12
+
+ * apps/: notification_log.c, snmptrapd_handlers.c,
+ snmptrapd_handlers.h, notification_log.h:
+
+ Consolidate the notification handler in with the rest of the
+ NOTIFICATION-MIB related code.
+
+2003-06-23 06:01 dts12
+
+ * apps/: snmptrapd.c, snmptrapd_handlers.c,
+ snmptrapd_handlers.h:
+
+ Shuffle code around a bit. The three files 'snmptrapd_handlers.c',
+ 'snmptrapd_log.c' and 'notification.c' now contain all the code
+ needed to process an incoming trap.
+ It should be possible to embed this functionality within an larger
+ application, rather than having to use the 'snmptrapd.c' wrapper.
+
+2003-06-22 16:20 hardaker
+
+ * local/.cvsignore:
+
+ ignore *.c and *.h files.
+
+2003-06-22 16:18 hardaker
+
+ * agent/mibgroup/examples/: netSnmpHostsTable.c,
+ netSnmpHostsTable.h, netSnmpHostsTable_access.c,
+ netSnmpHostsTable_access.h, netSnmpHostsTable_checkfns.c
+, netSnmpHostsTable_checkfns.h,
+ netSnmpHostsTable_checkfns_local.c,
+ netSnmpHostsTable_checkfns_local.h,
+ netSnmpHostsTable_columns.h, netSnmpHostsTable_enums.h:
+
+ - A netSnmpHostsTable implementation that implements a table_iterator
+ wrapper around /etc/hosts. Note that although this is the first check
+ in, it is not entirely complete yet. Specifically:
+ - It doesn't support row creation yet (my next target) and deletion yet.
+ - It implements a bunch of stuff itself in netSnmpHostsTable.c that
+ will eventually go into a more generic helper.
+ - It doesn't support anything but ipv4 yet but doesn't ignore it in
+ the hosts file (inet_aton returns a -1 thus all ipv6 address get
+ mapped to 255.255.255.255).
+ - It is still useful just to show how SET operations can be performed
+ using a table_iterator.
+ - Plus I needed to check it in before I start messing with it again
+ just for archival purposes.
+
+2003-06-22 16:14 hardaker
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ Create an example table that is a wrapper around /etc/hosts data.
+
+2003-06-22 12:53 nba
+
+ * snmplib/snmp_logging.c:
+
+ INFO is not a facility - USER could be
+
+2003-06-22 12:50 nba
+
+ * snmplib/snmp_parse_args.c:
+
+ Add the new -L option to the usage message
+
+2003-06-22 12:49 nba
+
+ * include/net-snmp/library/snmpUnixDomain.h,
+ snmplib/snmpUnixDomain.c:
+
+ Add some missing prototypes, and use them
+
+2003-06-22 12:46 nba
+
+ * apps/snmptable.c:
+
+ Do away with some warnings
+
+2003-06-22 12:44 nba
+
+ * include/net-snmp/library/snmp_logging.h,
+ snmplib/snmp_logging.c:
+
+ constify a few arguments, make sure that we defalt output to stderr
+
+2003-06-22 12:42 nba
+
+ * agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/proc.c, apps/snmptrapd_handlers.c
+, snmplib/scapi.c, snmplib/vacm.c:
+
+ Do away with some warnings
+
+2003-06-22 12:38 nba
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Untangle a most extrordinary web og FreeBSD and Linux
+
+2003-06-22 07:22 hardaker
+
+ * apps/snmpvacm.c:
+
+ fix help usage for flag ordering.
+
+2003-06-22 07:22 hardaker
+
+ * include/net-snmp/library/default_store.h, snmplib/mib.c
+, snmplib/snmp_parse_args.c:
+
+ - add -s SUFFIX and -S PREFIX flags
+ - doxygen document snmp_parse_oid
+ - Add a proper L: token to getopt for a missing accepted flag
+
+2003-06-20 16:50 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ fix the loop free before call-sub-hook ordering problem Dave pointed out
+
+2003-06-20 11:58 dts12
+
+ * agent/helpers/table_iterator.c,
+ include/net-snmp/agent/table_iterator.h:
+
+ Support the option for sorted iterator-based tables, too.
+
+2003-06-20 11:53 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Stop searching once we've found all "exact" requested rows.
+
+2003-06-19 01:54 dts12
+
+ * man/: snmpset.1.def, snmptrap.1.def:
+
+ Clarify the ASN.1 type mappings for command-line type specifications.
+
+2003-06-17 05:54 dts12
+
+ * agent/snmpd.c:
+
+ Start using the new -Lx style logging output.
+ Unfortunately, this doesn't seem to support the old -L format
+ (see comments in snmplib/snmp_logging.c for details).
+
+ It may prove necessary to reverse this patch:-(
+ But I'm committing it anyway, in case anyone can spot a suitable workaround.
+
+2003-06-17 05:52 dts12
+
+ * snmplib/snmp_logging.c:
+
+ Minor tweak to stdout/stderr handling, to improve the appearance of
+ MIB group output.
+
+2003-06-17 05:50 dts12
+
+ * agent/mibgroup/agent_mibs.h,
+ agent/mibgroup/agent/nsLogging.c,
+ agent/mibgroup/agent/nsLogging.h, mibs/NET-SNMP-AGENT-MIB.txt
+:
+
+ MIB group to manage agent logging configuration.
+
+2003-06-16 14:59 hardaker
+
+ * testing/: RUNTESTS (V5-0-patches.4), RUNTESTS:
+
+ remove no longer needed comment about it being broken, as pointed out
+ by Bruce.
+
+2003-06-16 14:55 hardaker
+
+ * testing/: RUNTESTS (V5-0-patches.3), RUNTESTS:
+
+ support , separated arguments to -T like -h says it will.
+
+2003-06-16 14:54 hardaker
+
+ * testing/RUNTESTS:
+
+ Patch from Bruce Shaw to fix output numbering when using -T or
+ interactively picked sub-series of tests.
+
+2003-06-16 14:44 hardaker
+
+ * agent/mibgroup/: kernel_sunos5.c (V5-0-patches.2),
+ kernel_sunos5.c:
+
+ Patch #755540 from Bruce Shaw and IRC:SebNob to fix bug #701439 for 64 bit solaris systems and 64 bit integers returned by getKstat
+
+2003-06-16 13:17 hardaker
+
+ * testing/tests/: T055agentv1mintrap, T056agentv2cmintrap
+:
+
+ Patch #754105 from Bruce Shaw to fix some spelling errors
+
+2003-06-16 07:23 hardaker
+
+ * local/mib2c.iterate_access.conf:
+
+ yet more improvements working toward the end-goal.
+
+2003-06-16 07:17 hardaker
+
+ * README.Panasonic_AM3X.txt, README.Matsushita.txt:
+
+ renamed to Panasonic_AM3X by request
+
+2003-06-13 22:45 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Ok, there was 1 memory leak. But its gone now.
+
+2003-06-13 22:02 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ A complete rewrite of the iterator from scratch.
+ - 60 lines or so less code.
+ - no longer forced-serialized
+ - memory-leak free
+ - better commented (though more could always be useful).
+ - significantly simpler in design.
+ - demonstration example mib module code to be checked in early next week.
+
+2003-06-13 11:18 hardaker
+
+ * local/mib2c.check_values.conf:
+
+ fix range checks now that its no longer the last thing called.
+
+2003-06-13 11:17 hardaker
+
+ * local/mib2c.access_functions.conf:
+
+ misc minor fixes.
+
+2003-06-13 11:17 hardaker
+
+ * local/mib2c:
+
+ fix else clauses within if statements.
+
+2003-06-13 08:36 dts12
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Handle problems with reading process information on Solaris kit, consistently and cleanly.
+
+2003-06-13 06:28 dts12
+
+ * include/net-snmp/library/snmp_logging.h,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c,
+ apps/snmptrapd.c:
+
+ Implement '-Lx' command-line meta-option for configuring logging settings.
+ Not 100% convinced this is fully working, but does seem to support
+ multiple output locations.
+
+2003-06-10 15:48 nba
+
+ * snmplib/: snmp_api.c (V5-0-patches.7), snmp_api.c:
+
+ Beware of dereferencing a NULL pointer
+
+2003-06-10 10:46 hardaker
+
+ * agent/helpers/Makefile.in:
+
+ add caching handler file
+
+2003-06-10 08:48 dts12
+
+ * include/net-snmp/library/snmp_logging.h,
+ snmplib/snmp_logging.c:
+
+ Initial bash at a modular "log_handler" implementation.
+ Laying the foundations for more flexible logging configuration.
+
+2003-06-10 08:31 hardaker
+
+ * snmplib/snmp_api.c:
+
+ remove the unused function as pointed out by Bob Rowlands
+
+2003-06-09 16:10 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c, agent/snmp_agent.c,
+ include/net-snmp/library/vacm.h, snmplib/vacm.c
+ (V5-0-patches.[1,3,1,1]), agent/mibgroup/mibII/vacm_vars.c,
+ agent/snmp_agent.c, include/net-snmp/library/vacm.h,
+ snmplib/vacm.c:
+
+ Long overdue patch #695192 from Ron Tabor to fix the VACM spinning problem that I didn't quite fix before
+
+2003-06-09 15:57 hardaker
+
+ * configure.in, testing/tests/T023snmpv3getMD5DES,
+ testing/tests/T025snmpv3getSHADES, configure:
+
+ fix bug #706710 to show when privacy has been disabled
+
+2003-06-09 15:47 hardaker
+
+ * snmplib/md5.c:
+
+ fix bug #706741 from Sean Burke: check for word boundaries based on a
+ proper size (sizeof(long)).
+
+2003-06-09 15:35 hardaker
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ bug #748431 from John Shiver: fix thread-safe problems with snmp_get_fd_for_session (which was missing in the 5.x line anyway). Also separate out union structure into a separate typedef rather than use it inline in the variable list structure
+
+2003-06-09 15:22 hardaker
+
+ * snmplib/mib.c:
+
+ fix bug # 751197 pointed out by Tom Evans where isspace is used to check for hex characters when isprint() is all that is needed
+
+2003-06-09 15:11 hardaker
+
+ * agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory_aix4.c,
+ agent/mibgroup/ucd-snmp/memory_aix4.h,
+ agent/mibgroup/ucd_snmp.h,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.c,
+ agent/mibgroup/ucd-snmp/vmstat_aix4.h, acconfig.h,
+ configure.in, include/net-snmp/net-snmp-config.h.in:
+
+ patch #749552 from vaxpower (with modifications by Wes): much improved AIX support
+
+2003-06-09 14:49 hardaker
+
+ * README.Matsushita.txt (V5-0-patches.1), README.Matsushita.txt
+:
+
+ Patch #748305 from srinivasa rao gurusu describing how to build net-snmp on Matsushita embedded systems
+
+2003-06-09 14:44 hardaker
+
+ * agent/mibgroup/mibII/: ipAddr.c (V5-0-patches.3), ipAddr.c:
+
+ Patch 746339: Otto Solares fixes a file descriptor leak on linux
+
+2003-06-09 14:31 hardaker
+
+ * agent/mibgroup/: kernel_sunos5.c (V5-0-patches.1),
+ kernel_sunos5.c:
+
+ Patch #749062 to fix caching crashing and clashing under Solaris
+
+2003-06-09 14:28 hardaker
+
+ * agent/mibgroup/ucd-snmp/: proxy.c (V5-0-patches.2), proxy.c
+:
+
+ patch #749103 from Garry C Marshall to fix the proxy when a timeout occurs from the target
+
+2003-06-09 04:01 dts12
+
+ * agent/helpers/cache_handler.c, agent/mibgroup/agent_mibs.h
+, include/net-snmp/agent/cache_handler.h,
+ agent/mibgroup/agent/nsCache.c,
+ agent/mibgroup/agent/nsCache.h, mibs/NET-SNMP-AGENT-MIB.txt
+:
+
+ MIB objects to manage configuration of MIB data caching.
+
+2003-06-09 03:56 dts12
+
+ * agent/mibgroup/agent/nsDebug.c,
+ agent/mibgroup/agent/nsDebug.h, mibs/NET-SNMP-AGENT-MIB.txt
+, snmplib/snmp_debug.c:
+
+ Rework nsDebugTokenTable to be indexed by the debug token string values.
+
+2003-06-06 08:45 dts12
+
+ * apps/: snmptrapd.c, snmptrapd_handlers.c,
+ snmptrapd_handlers.h:
+
+ Implement various separate lists of "global" handlers, to support
+ pre- and post-specific global processing, as well as "authentication"
+ handlers, which are guaranteed to be called first.
+ Also support for terminating trap processing early.
+
+ Don't let me hear you say that I never listen to you, Wes!
+
+2003-06-06 06:42 nba
+
+ * snmplib/mib.c:
+
+ Fix missing length byte when setting index with checks disabled
+
+2003-06-06 01:32 dts12
+
+ * man/snmpd.conf.5.def, agent/mibgroup/mibII/vacm_vars.c
+:
+
+ Clarify which "r[ow]{user,community}" parameters are optional, and in which combinations.
+
+2003-06-04 05:56 dts12
+
+ * agent/helpers/cache_handler.c,
+ include/net-snmp/agent/cache_handler.h:
+
+ First pass at a data-caching helper - independent of individual MIB modules.
+ (i.e. it's up to each MIB module to provide "load data" and "free data"
+ routines, but the handling of when to load these caches is done here).
+
+ The intention is that this functionality will be SNMP-manageable (including
+ configuration of validity timeouts, invalidation of cached values, etc).
+ But for now, this is just the basic handler.
+
+2003-06-04 05:50 dts12
+
+ * agent/helpers/scalar_group.c,
+ include/net-snmp/agent/scalar_group.h:
+
+ Single helper to implement a group of scalar objects in one go.
+ (Closer to the model of the earlier v4 API)
+
+2003-06-03 17:14 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ mention where "later" actually is.
+
+2003-06-02 05:46 dts12
+
+ * agent/mibgroup/host/hr_proc.h:
+
+ Declarations for improved Solaris CPU support from patch #738465)
+ (Oops!)
+
+2003-06-02 05:35 dts12
+
+ * apps/snmptrapd_handlers.c:
+
+ Simple implementation of forwarding traps to another destination.
+ (I've got a number of ideas of how this could be done more flexibly,
+ but this serves as a basic proof-of-concept, for feedback & comment)
+
+2003-06-02 05:33 dts12
+
+ * apps/: snmptrapd.c, snmptrapd_handlers.c,
+ snmptrapd_handlers.h:
+
+ Modularised approach to different styles of handling incoming traps.
+ This seems to retain the same behaviour and output formats as the
+ earlier code, but should be much more flexible to extend and adapt.
+
+2003-05-30 17:12 hardaker
+
+ * agent/mibgroup/agent/nsDebug.c:
+
+ make use of new exported items from snmp_debug.
+
+2003-05-30 17:11 hardaker
+
+ * local/: mib2c.access_functions.conf,
+ mib2c.check_values.conf:
+
+ more cleanups
+
+2003-05-30 16:53 hardaker
+
+ * local/: Makefile.in, mib2c.access_functions.conf,
+ mib2c.check_values.conf, mib2c.check_values_local.conf,
+ mib2c.iterate.conf, mib2c.iterate_access.conf:
+
+ Update to mib2c code for producing what I think should be an easier to
+ use API set (that is not all wrapped into a single function).
+
+2003-05-30 16:51 hardaker
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ fix mib typo
+
+2003-05-30 16:51 hardaker
+
+ * include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c
+:
+
+ define a noop free function.
+
+2003-05-30 16:50 hardaker
+
+ * include/net-snmp/library/snmp_debug.h, snmplib/snmp_debug.c
+:
+
+ export information needed by the new debug modules.
+
+2003-05-30 14:48 hardaker
+
+ * FAQ:
+
+ added a compiling section with one new question about libelf. Other questions probably should be moved to the new section
+
+2003-05-30 05:14 dts12
+
+ * man/: Makefile.in, snmpvacm.1.def:
+
+ Preliminary man page for snmpvacm
+
+2003-05-30 03:59 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Handle block sizes <1K when converting block counts to Kb.
+ Reported by Eugene V. Chupriyanov (way back in October!).
+ Flaws with the implementation of this patch are my responsibility.
+ (I'm not totally happy about casting to float in this way,
+ but it seemed the best of a bad lot).
+
+2003-05-30 03:38 dts12
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Significantly improved support for Solaris CPU information
+ (including description, status and multi-CPU support).
+ Thanks to James Irwin for implementing it (see patch #738465)
+ No thanks to Dave Shield for sitting on it for a couple of weeks.
+ Bad Dave! Bad Dave!
+
+2003-05-28 17:25 hardaker
+
+ * agent/helpers/: old_api.c (V5-0-patches.1), old_api.c:
+
+ remove unused code as pointed out by Peter Warasin
+
+2003-05-28 16:03 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ fix getbulk operations (hopefully), as pointed out by Ron Tabor.
+
+2003-05-28 06:12 dts12
+
+ * apps/snmpdelta.c:
+
+ Clear the output buffer before displaying the second (or subsequent)
+ varbind in a multi-value table format. Bug spotted by Stefano Bodrato.
+
+2003-05-28 05:14 dts12
+
+ * include/net-snmp/agent/row_merge.h,
+ agent/helpers/Makefile.in, agent/helpers/row_merge.c:
+
+ Helper to group related requests for the same row together. Sub-handlers
+ can therefore work with multiple varbinds, all relating to the same row.
+
+ This was originally intended for use with the iterator helper, but
+ that helper is apparently being reworked at the moment. But this seems
+ a potentially useful feature anyway, so I'm committing it regardless!
+
+2003-05-28 04:19 dts12
+
+ * apps/snmptrapd.c:
+
+ Remove stray ^M line endings
+
+2003-05-28 02:21 dts12
+
+ * agent/mibgroup/misc/: dlmod.c, dlmod.h:
+
+ Remove redundent version of 'dlmod'. This was moved to 'ucd-snmp'
+ in 2000, and this 'misc' version has been effectively untouched since.
+ Leaving it around is just asking for people to get confused.
+
+2003-05-27 08:56 dts12
+
+ * AGENT.txt:
+
+ Mention that this describes the v4 API, rather than the v5 helper mechanism.
+
+2003-05-21 10:58 hardaker
+
+ * dist/Makefile:
+
+ rpm fixes
+
+2003-05-21 10:58 hardaker
+
+ * dist/net-snmp.spec:
+
+ install the spec file
+
+2003-05-21 10:56 hardaker
+
+ * agent/mibgroup/: agent/nsTransactionTable.c,
+ mibII/vacm_context.c:
+
+ Fix for proper non-serialized iterator usage.
+
+2003-05-21 06:04 dts12
+
+ * agent/mibgroup/agent_mibs.h, agent/mibgroup/agent/nsDebug.c
+, agent/mibgroup/agent/nsDebug.h,
+ mibs/NET-SNMP-AGENT-MIB.txt:
+
+ New MIB group to monitor and control debugging output from the agent.
+ Note that this is a provisional implementation, and the MIB definitions
+ are currently subject to change (at least until we make a full release
+ including this group)
+
+2003-05-21 04:36 dts12
+
+ * agent/mibgroup/ucd-snmp/: pass.c (V4-2-patches.7), pass.c:
+
+ Fix passing of "set" parameters to a pass-through script
+ (Bug #689936, fixed by Eric Bowles)
+
+2003-05-20 07:37 dts12
+
+ * snmplib/snmp_debug.c:
+
+ Manu Sharma's dynamically-configurable debug token handling.
+
+2003-05-20 05:16 dts12
+
+ * agent/helpers/watcher.c, include/net-snmp/agent/watcher.h
+:
+
+ Implement a "watched spinlock" helper.
+
+2003-05-20 04:23 dts12
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ Fix load average support for AIX5 (Bug #563978 reported by Jeff Cunningham)
+
+2003-05-20 03:29 dts12
+
+ * README.win32:
+
+ Incorporate Nikolai Devereaux's overview of the Visual C++ organisation,
+ plus some minor rearrangement of sections, and tone down a somewhat
+ overly enthusiastic comment.
+
+2003-05-15 22:42 hardaker
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ osf5 patch that never got added.
+
+2003-05-15 22:42 hardaker
+
+ * snmplib/data_list.c:
+
+ Minor fix.
+
+2003-05-14 18:19 hardaker
+
+ * snmplib/snmpUnixDomain.c:
+
+ oopsie doosie floosie woozie
+
+2003-05-14 18:13 hardaker
+
+ * snmplib/snmpUnixDomain.c:
+
+ opps
+
+2003-05-14 15:17 hardaker
+
+ * local/Makefile.in:
+
+ install some other .conf files
+
+2003-05-14 15:17 hardaker
+
+ * local/mib2c.check_values.conf:
+
+ remove unneeded var
+
+2003-05-14 15:17 hardaker
+
+ * local/mib2c:
+
+ misc minor changes
+
+2003-05-14 15:12 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ caching support from a patch #726418 from Larry Simmons.
+
+2003-05-14 15:09 hardaker
+
+ * man/snmptable.1.def:
+
+ 2nd Patch 702711 by Ron Tabor documenting new snmptable options
+
+2003-05-14 15:07 hardaker
+
+ * NEWS, agent/mibgroup/mibII/vacm_vars.c,
+ snmplib/snmpUnixDomain.c:
+
+ Patch #713072 from Xiaofeng Ling for com2sec mappings on unix sockets
+ with per-socket mappings.
+
+2003-05-14 14:56 hardaker
+
+ * agent/mibgroup/host/hr_other.c:
+
+ Patch #735480 from Bruce Shaw: assume no co-processor for Suns, as is the more common case
+
+2003-05-14 08:44 dts12
+
+ * agent/mibgroup/host/hr_print.c:
+
+ Use /etc/printcap to detect printers in preference to running lpstat
+ (or the cgetnext() API). This seems more in keeping of our general
+ principle of trying to avoid invoking sub-processes wherever possible.
+
+2003-05-12 23:11 hardaker
+
+ * README:
+
+ Add Ron Tabor
+
+2003-05-12 23:10 hardaker
+
+ * NEWS:
+
+ document new snmptable options
+
+2003-05-12 23:08 hardaker
+
+ * apps/snmptable.c:
+
+ patch #702711 from Ron Tabor: Add new command line flags to snmptable for various new features
+
+2003-05-12 22:58 hardaker
+
+ * apps/: snmptrapd.c (V5-0-patches.5), snmptrapd.c:
+
+ Patch #735511 from Alex Burger: fix snmptrapd to ensure there are the correct number of varbinds
+
+2003-05-12 22:55 hardaker
+
+ * agent/mibgroup/ucd-snmp/: proxy.c (V5-0-patches.1), proxy.c
+:
+
+ Patch #736784 from Ron Tabor: fix proxies for restarted NSMPv3 sub-agents
+
+2003-05-09 08:47 dts12
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Add various missing function names, supplied by Alex Burger
+
+2003-05-09 08:41 dts12
+
+ * win32/: win32.dsw, win32.opt, win32sdk.dsw,
+ libagent/libagent.dsp, libhelpers/libhelpers.dsp,
+ libsnmp/libsnmp.dsp, netsnmpmibs/netsnmpmibs.dsp,
+ netsnmpmibssdk/netsnmpmibssdk.dsp, snmpd/snmpd.dsp,
+ snmpdsdk/snmpd.dsp:
+
+ Apply Nikolai Devereaux's VC++ cleanup patch (#694766)
+ It appears to work OK - I just hope the line terminations
+ don't screw things up!
+
+2003-05-08 16:32 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Patch #733880 from Alex Burger to fix useNumeric
+
+2003-05-08 16:21 hardaker
+
+ * perl/SNMP/t/startagent.pl:
+
+ Patch #734774 from Andrew Findlay: fix the test environment for snmpd to give it fully qualified path names for configuration files since snmpd now chdir's to /
+
+2003-05-08 16:15 hardaker
+
+ * README (V5-0-patches.6), README:
+
+ mention Andrew Findlay
+
+2003-05-08 16:14 hardaker
+
+ * perl/agent/: agent.xs (V5-0-patches.1), agent.xs:
+
+ (excellent) patch #705566 from Andrew Findlay on perl agent support:
+
+ 1) Agent cannot return MAC addresses containing zero octet.
+
+ 2) Agent coredumps when trying to return IP addresses
+ if these are supplied as dotted-quad or as a hostname
+ that fails to resolve.
+
+ 3) Agent corrupts OID values.
+
+ 4) Agent truncates any OCTET_STRING or BIT_STRING that
+ contains a zero octet (this is the root cause of (1) above)
+
+ API changes introduced:
+
+ a) IP addresses now passed as binary strings (4 octets
+ for IPv4) rather than dotted-quad or name. This
+ sidesteps the IPv4/IPv6 problem and leaves the calling
+ script to deal with name->address resolution and
+ associated error handling.
+
+2003-05-08 09:32 hardaker
+
+ * include/net-snmp/library/mib.h, include/net-snmp/library/parse.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h, snmplib/mib.c,
+ snmplib/snmp_api.c, snmplib/snmp_client.c
+ (V5-0-patches.[1,1,1,1,3,4,1]), include/net-snmp/library/mib.h
+, include/net-snmp/library/parse.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h, snmplib/mib.c,
+ snmplib/snmp_api.c, snmplib/snmp_client.c:
+
+ patch #710275 from Stephen J. Friedl: const fixes for APIs that don't modify their arguments
+
+2003-05-08 09:28 hardaker
+
+ * include/net-snmp/library/: system.h (V5-0-patches.1), system.h
+:
+
+ missed a commit for a perl patch
+
+2003-05-08 09:22 hardaker
+
+ * agent/mibgroup/mibII/: ipAddr.c (V5-0-patches.2), ipAddr.c:
+
+ Applied patch #712101: minor irix fix
+
+2003-05-08 09:12 hardaker
+
+ * perl/: Makefile.PL, Makefile.subs.pl, ASN/Makefile.PL
+, OID/Makefile.PL, SNMP/Makefile.PL, SNMP/README
+, SNMP/SNMP.xs, agent/Makefile.PL,
+ agent/default_store/Makefile.PL, default_store/Makefile.PL
+:
+
+ patch #715603: fix perl module builds under windows
+
+2003-05-08 08:31 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ apply patch [ 724927 ] to fix log msg; add \n to log msgs
+
+2003-05-08 08:29 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ chg NET_SNMP_USE_ASSERT define to NETSNMP_USE_ASSERT to be consistent
+
+2003-05-05 15:36 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ move in agentx documentation someone only added to the patches branch (bad someone)
+
+2003-05-05 15:33 hardaker
+
+ * man/: snmpd.conf.5.def (V5-0-patches.4), snmpd.conf.5.def:
+
+ document agentxPingInterval
+
+2003-04-29 16:31 hardaker
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Really fix solaris by removing support for the cidr table function.
+
+2003-04-29 16:29 hardaker
+
+ * agent/mibgroup/mibII/: var_route.c, var_route.h:
+
+ attempt to fix solaris by removing support for the cidr table function.
+
+2003-04-29 01:53 dts12
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Linux Multi-CPU detection (hopefully!).
+ Done at initialisation, so won't detect changes during run time.
+ (probably fairly unlikely!).
+ Also changes device index value for single CPU device on other archs.
+
+2003-04-29 01:51 dts12
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ First draft of Linux CPU detection (still only supports one CPU).
+
+2003-04-29 01:49 dts12
+
+ * agent/mibgroup/host/: hr_proc.c, hr_other.c:
+
+ Consolidate all hrProcessorTable implementation into one place.
+ (Basically just moving code from hr_other.c to hr_proc.c)
+
+2003-04-28 23:40 hardaker
+
+ * snmplib/data_list.c:
+
+ - doxygen documentation for everything (gasp)
+ - Support for saving/restoring of entire data_lists.
+
+2003-04-28 23:38 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_data_list.3, netsnmp_debug.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_library.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_methods.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_scalar.3, netsnmp_serialize.3,
+ netsnmp_set_data.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_util.3, netsnmp_watcher.3
+:
+
+ make docs.
+
+2003-04-28 23:37 hardaker
+
+ * include/net-snmp/library/data_list.h:
+
+ added prototypes for save/restore of data lists.
+
+2003-04-28 23:36 hardaker
+
+ * include/net-snmp/utilities.h:
+
+ put data_list.h below callback.h
+
+2003-04-28 23:35 hardaker
+
+ * NEWS:
+
+ document snmptrapd -t and diskio on linux
+
+2003-04-25 11:23 hardaker
+
+ * README:
+
+ opps
+
+2003-04-25 08:01 dts12
+
+ * local/mib2c:
+
+ Fix typo in 'WriteOnly' (see bug #711324)
+
+2003-04-25 07:13 hardaker
+
+ * README:
+
+ added people
+
+2003-04-25 07:12 hardaker
+
+ * configure, configure.in:
+
+ document diskio support for linux
+
+2003-04-25 07:11 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Patch #712259 from James Knitter: diskio support for linux
+
+2003-04-25 07:02 hardaker
+
+ * man/read_config.3.def:
+
+ patch #710687: fix formatting bug
+
+2003-04-25 06:57 hardaker
+
+ * agent/mibgroup/: kernel_sunos5.c, kernel_sunos5.h:
+
+ patch #702351 from James Irwin: a new getKstatString() function.
+
+2003-04-25 06:00 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ mention the -e ENGINEID flag for createUser.
+ - pointed out by Dana Cook
+
+2003-04-24 08:19 dts12
+
+ * apps/: snmpusm.c, snmpvacm.c:
+
+ Fix a typo in output messages. (See Bug #726943)
+
+2003-04-24 06:00 dts12
+
+ * snmplib/snmpCallbackDomain.c:
+
+ Report back failures in netsnmp_callback_close correctly.
+ Patch #724928 by Peter Warasin
+
+2003-04-23 07:38 dts12
+
+ * apps/snmptable.c:
+
+ Patch #725141 by Peter Warasin: Fix segmentation fault on snmptable
+
+2003-04-23 06:56 dts12
+
+ * snmplib/: container_binary_array.c, snmpusm.c:
+
+ Patch #724913 by Peter Warasin - removes 2 compiler warnings
+
+2003-04-23 06:46 dts12
+
+ * Makefile.in:
+
+ Substitute sysconfdir correctly when building sedscript.
+ Patch #710689 by Peter Breitenlohner
+
+2003-04-23 06:31 dts12
+
+ * Makefile.rules, man/Makefile.in:
+
+ Install header files and man pages with appropriate permissions.
+ From patch #710685 by Peter Breitenlohner
+
+2003-04-23 06:22 dts12
+
+ * FAQ:
+
+ Fix references to incorrect API calls
+
+2003-04-23 03:06 dts12
+
+ * man/snmpd.conf.5.def:
+
+ Add an explicit example for com2sec address masking, as suggested by Andy Hood.
+
+2003-04-22 06:48 dts12
+
+ * snmplib/snmp_api.c:
+
+ Restore the original debug indentation level when dumping an SNMPv1/v2c
+ request PDU. Reported by Peter Warasin
+
+2003-04-17 07:23 dts12
+
+ * agent/snmp_agent.c:
+
+ Propagate error status values back up to the main agent processing
+ (so that e.g. failed SNMPv2 set requests using a read-only community
+ report a failure, rather than appearing to succeed!)
+
+2003-04-16 06:37 dts12
+
+ * mibs/NET-SNMP-MIB.txt:
+
+ Define a "private experimentation" area of the OID tree,
+ for those who wish to have a play with things, and don't
+ yet have an enterprise OID of their own.
+
+ See the net-snmp-users thread 'OID registration', from March/April 2003.
+
+2003-04-16 06:32 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ Twaek the default output format to be bare the suffix form
+ (as expected by SNMP::OID test harness).
+ We should probably default to MIB::variable form, to match
+ the C library, and provide a flag for the bare suffix.
+
+2003-04-16 02:46 dts12
+
+ * perl/SNMP/SNMP.xs:
+
+ Fix handling of 'UseNumeric' and 'UseLongNames' for get/getnext/getbulk methods.
+
+ Fixing 'getnext'/'getbulk' mostly involved updating the consolidated
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT' setting, rather than the individual booleans.
+ Fixing 'get' required more significant changes to the output code, so I simply
+ copied the 'getnext' routine en-masse, and tweaked it appropriately.
+ There is a large amount of overlap between these three routines, and it might
+ be worth looking at consolidating the common code in some way.
+
+2003-04-16 02:42 dts12
+
+ * include/net-snmp/library/parse.h, snmplib/parse.c,
+ perl/SNMP/README, perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs
+:
+
+ Apply Alex Burger's perl 'translateObj' handling patch (#722075)
+
+2003-04-15 10:56 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Patch from Kirill Semenkov for one more fix to linux interface speed
+ determination.
+
+2003-04-10 08:16 dts12
+
+ * agent/mibgroup/host/: hr_disk.c, hr_disk.h,
+ hr_partition.c:
+
+ Fix handling of hrPartitionTable, broken during
+ The Great SUSE 'printf' Hunt.
+ Thanks to Johannes Schmidt-Fischer for this patch.
+
+2003-04-09 01:52 dts12
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ Import SnmpAdminString, as suggested by Vadim Tarassov.
+
+2003-04-08 07:57 dts12
+
+ * local/mib2c.scalar.conf:
+
+ Fix the error code used for unavailable resources.
+ Spotted by chichien.
+
+2003-04-02 09:23 sradman
+
+ * configure.in:
+
+ improve lmSensors support
+ - check for headers
+ - check for libs
+
+2003-04-02 06:31 sradman
+
+ * agent/mibgroup/ucd-snmp/lmSensors.h:
+
+ add LM-SENSORS-MIB when module is included
+
+2003-03-28 06:48 hardaker
+
+ * README.krb5 (V5-0-patches.1), README.krb5:
+
+ Ken Hornstein noted that the rwuser -s flag was missing it's argument
+
+2003-03-28 06:47 hardaker
+
+ * snmplib/: snmpksm.c (V5-0-patches.1), snmpksm.c:
+
+ Patch from Ken for misc krb5 fixes (encryption types, New crypto support,...
+
+2003-03-20 11:18 sradman
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ fix bug #672464: ifAdminStatus must change to down
+ - ifAdminStatus up if interface is UP
+ - ifOperStatus up if interface is UP and RUNNING
+ - added support for the "link_up" kstat
+ - added Cassini Gigabit-Ethernet (ce) support
+
+2003-03-19 11:45 rstory
+
+ * Makefile.in:
+
+ remove trailing \ from last line of perl rules
+
+2003-03-13 16:03 hardaker
+
+ * agent/: snmp_agent.c (V5-0-patches.1), snmp_agent.c:
+
+ patch from Tommy Christensen to fix some AgentX (mostly) memory leaks
+
+2003-03-12 10:39 hardaker
+
+ * net-snmp-config.in (V5-0-patches.3), net-snmp-config.in:
+
+ patch #699380: From Christophe Kalt: make net-snmp-config do what it's document to do (add -L@libdir@)
+
+2003-03-12 08:48 hardaker
+
+ * snmplib/: snmp_api.c (V5-0-patches.3), snmp_api.c:
+
+ patch #700672: reset itmp to the new value length after decoding a hex string
+
+2003-03-12 08:41 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ return indexes for augmented tables
+
+2003-03-12 08:33 hardaker
+
+ * agent/snmp_vars.c, agent/mibgroup/mibII/vacm_vars.c,
+ snmplib/snmpUnixDomain.c, README:
+
+ Patch #701398: com2secunix token from Xiaofeng Ling for unix sockets
+
+2003-03-12 07:58 hardaker
+
+ * testing/: README, RUNTESTS:
+
+ update to real world and add better -h output
+
+2003-03-10 17:20 hardaker
+
+ * snmplib/scapi.c:
+
+ attempt to correct for dynamic loading of a older openssl library, which is common if you have the mod_ssl rpm installed and a newer libcrypto library at the same time
+
+2003-03-10 14:45 hardaker
+
+ * snmplib/scapi.c:
+
+ attempt to fix the openssl free bug for the last time
+
+2003-03-05 22:42 rstory
+
+ * configure (V5-0-patches.2), configure:
+
+ update for new configure.in
+
+2003-03-05 22:36 rstory
+
+ * configure.in:
+
+ fix for libwrap w/nsl
+
+2003-03-04 09:47 hardaker
+
+ * agent/mibgroup/agent/: nsModuleTable.c (V5-0-patches.1),
+ nsModuleTable.c:
+
+ wrong type returned for nsModuleModes as reported by Michael Kirkham
+
+2003-03-04 01:54 dts12
+
+ * INSTALL:
+
+ Mention the need to configure the agent.
+
+2003-03-01 07:27 rstory
+
+ * agent/mibgroup/agentx/: subagent.c (V5-0-patches.1), subagent.c
+:
+
+ agentx patch from Tommy Christensen: better error checking
+
+2003-03-01 06:59 rstory
+
+ * agent/mibgroup/agentx/: master.c (V5-0-patches.1), master.c
+:
+
+ agentx patch from Tommy Christensen: don't create delegated cache for CLEANUPSET
+
+2003-02-28 20:45 hardaker
+
+ * perl/SNMP/: Makefile.PL (V5-0-patches.3), Makefile.PL:
+
+ typo
+
+2003-02-28 20:35 hardaker
+
+ * agent/mibgroup/host/hr_system.c:
+
+ Patch #551909 from Gary Edwards: detect zombie processes and prevent
+ them from being counted as valid users.
+
+2003-02-28 20:10 hardaker
+
+ * perl/SNMP/: Makefile.PL (V5-0-patches.2), Makefile.PL:
+
+ Patch #597629 from Matt Selsky to fix man page installation
+
+2003-02-28 20:02 hardaker
+
+ * dist/net-snmp-solaris-build/: DEVENV, elfdepend.sh,
+ net-snmp-5.0.6-build:
+
+ patch #654581 from Stefan Radman: Solaris Packaging build scripts
+
+2003-02-28 19:40 hardaker
+
+ * apps/snmptrapd.c:
+
+ Patch #695312 from Alex Burger: add -t switch to disable syslog.
+
+2003-02-28 19:39 hardaker
+
+ * man/snmptrapd.8.def:
+
+ document -t
+
+2003-02-28 02:08 dts12
+
+ * snmplib/parse.c:
+
+ Simple patch to catch re-declarations of the "top-level" objects.
+ Supplied by Sean Burke
+
+2003-02-28 01:13 dts12
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ Return the correct values for ipv6Forwarding.
+ Patch supplied by Yixiong Zou (Bug #694745)
+
+2003-02-26 21:56 rstory
+
+ * local/mib2c.array-user.conf:
+
+ default octet strings to unsigned char arrays; fix example; fix logic of
+ conditional; make code referencing can_(de)activate conditional with same logic
+ used to generate the functions themselves
+
+2003-02-26 10:34 hardaker
+
+ * testing/tests/: Sv3vacmconfig, Svacmconfig,
+ T130snmpv1vacmget, T131snmpv2cvacmget,
+ T132snmpv3vacmget, T140snmpv1vacmgetfail,
+ T141snmpv2cvacmgetfail, T142snmpv3vacmgetfail:
+
+ Patch #687837 from Xiaofeng Ling for VACM test cases
+
+2003-02-26 10:19 hardaker
+
+ * Makefile.in, acconfig.h, win32/config.h,
+ agent/mibgroup/mibII/interfaces.c, win32/config.h.borland
+, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/udpTable.c,
+ include/net-snmp/net-snmp-config.h.in, README,
+ include/net-snmp/system/osf5.h:
+
+ patch #690353 from Kevin Graham: port to Tru64 v5 / osf5
+
+2003-02-26 10:10 hardaker
+
+ * configure.in, configure:
+
+ patch #692834 from David Vrabel: add --without-rpm for disabling rpm checks
+
+2003-02-26 08:28 dts12
+
+ * Makefile.top:
+
+ Oops - missed the definition of 'INSTALL_DATA' from Peter's original patch.
+ Sorry!
+
+2003-02-26 07:11 hardaker
+
+ * README:
+
+ Thanks to Srikanth Pindiproli
+
+2003-02-26 07:10 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ update to patch #655444: document includeAllDisks from Srikanth Pindiproli
+
+2003-02-26 04:45 dts12
+
+ * snmplib/read_config.c:
+
+ Stomp on trailing whitespace in config lines.
+ This allows token comparisons to work as expected.
+ (See bug #690770)
+
+2003-02-26 04:25 dts12
+
+ * apps/snmptrapd.c:
+
+ Fix getopt handling of -S (see bug #693167)
+
+2003-02-25 11:46 rstory
+
+ * Makefile.in, Makefile.top:
+
+ don't try and run autoconf/autoheader if not installed
+
+2003-02-25 06:48 dts12
+
+ * Makefile.in:
+
+ Apply Peter Breitenlohner's net-snmp-config patch (#692373)
+
+2003-02-25 06:41 dts12
+
+ * snmplib/snmpv3.c:
+
+ Recognise "defVersion v3" as well as "defVersion 3" as documented
+ in the man pages (prior to Peter Breitenlohner's correction)
+ [We might as well support both styles....]
+
+2003-02-25 06:06 dts12
+
+ * man/: mib2c.1.def, read_config.3.def, snmp.conf.5.def
+, snmp_config.5.def, snmpcmd.1.def,
+ snmpconf.1.def, snmpd.conf.5.def, snmptrapd.8.def
+, snmptrapd.conf.5.def:
+
+ Apply Peter Breitenlohner's documentation changes
+ (patches #692381, 692382 and 692388)
+
+2003-02-25 06:04 dts12
+
+ * EXAMPLE.conf.def, FAQ, sedscript.in,
+ local/Makefile.in, mibs/Makefile.in, man/Makefile.in
+, man/snmpd.1.def, man/snmpd.8.def:
+
+ Apply Peter Breitenlohner's configuration-related documentation and installation changes.
+ (patches #692372, 692377, 692379 and 692386)
+
+2003-02-25 05:17 dts12
+
+ * agent/mibgroup/host/: hr_storage.c, hr_storage.h:
+
+ List "fixed type" storage entries first, so that there isn't an
+ arbitrary limit of 100 disk-based storage entries.
+
+2003-02-25 05:07 dts12
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ Handle user/group names when setting AgentX socket ownership.
+
+2003-02-25 03:44 dts12
+
+ * agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/master.c,
+ include/net-snmp/agent/ds_agent.h:
+
+ Preliminary patch to support configuration of AgentX socket permissions.
+
+ Personally, I'm not convinced that this is ready for committing to the
+ CVS tree yet, but My Master Has Spoken, and I Must Obey.......
+
+2003-02-21 20:19 hardaker
+
+ * agent/mibgroup/mibII/: ipCidrRouteTable.c,
+ ipCidrRouteTable.h, ipCidrRouteTable_access.c,
+ ipCidrRouteTable_access.h, ipCidrRouteTable_checkfns.c,
+ ipCidrRouteTable_checkfns.h, ipCidrRouteTable_columns.h
+, ipCidrRouteTable_enums.h:
+
+ A beginning implementation of the IP-FORWARD-MIB::ipCidrRouteTable.
+ - this table is a replacement for the obsolete ipRouteTable, which
+ isn't even implemented by most vendors any more.
+ - not complete. Write support not implemented yet. Read-support
+ working though.
+ - Should work on everything but hpux11? testing needed.
+ - this is another example of a table_iterator application (different
+ than the rest using accessors).
+
+2003-02-21 20:14 hardaker
+
+ * agent/mibgroup/mibII/: route_headers.h, var_route.c:
+
+ moved headers to a separate file usable by other modules.
+ exported the collected route table.
+
+2003-02-21 20:14 hardaker
+
+ * agent/mibgroup/mibII/var_route.h:
+
+ moved headers to a separate file usable by other modules
+
+2003-02-21 20:12 hardaker
+
+ * local/mib2c.iterate_access.conf:
+
+ An alternate table_iterator .conf file (that may eventually become the
+ default). This one uses accessor functions to get/set data and should
+ take care of most other SNMP specific stuff for you. Not complete,
+ and a good percentage of the code repetition will likely move into
+ another sub-iterator handler in the future. The ipCidrRouteTable is
+ an example of this output.
+
+2003-02-21 20:10 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ - comment additions and cleanups.
+ - put the free/etc function pointers in an #ifdef clause
+
+2003-02-21 20:09 hardaker
+
+ * local/mib2c.column_enums.conf:
+
+ comment move for better formatting.
+
+2003-02-21 20:08 hardaker
+
+ * local/mib2c.check_values.conf:
+
+ - generate and use the enums header file.
+ - generate a .h file.
+ - misc fixes.
+
+2003-02-21 20:08 hardaker
+
+ * local/mib2c.access_functions.conf:
+
+ A .conf file to generate get_/set_ access functions for each column.
+ - iterator specific.
+
+2003-02-21 20:07 hardaker
+
+ * local/mib2c:
+
+ - enum fix.
+ - don't source (run) .conf files twice.
+
+2003-02-21 20:06 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_library.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_methods.3, netsnmp_oid_stash.3
+, netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_scalar.3, netsnmp_serialize.3,
+ netsnmp_set_data.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_util.3, netsnmp_watcher.3
+:
+
+ - doxygen update.
+ - includes new netsnmp_oid_stash man page.
+
+2003-02-21 20:06 hardaker
+
+ * include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c
+:
+
+ - doxygen comment everything
+ - started (not complete) a getnext function.
+ - implemented a "free the tree" function.
+
+2003-02-21 20:04 hardaker
+
+ * .cvsignore:
+
+ added autom4te.cache
+
+2003-02-21 20:04 hardaker
+
+ * configure, configure.in:
+
+ add the include directory to the module egrep cpp -I list.
+
+2003-02-21 01:50 dts12
+
+ * local/FAQ2HTML:
+
+ HTML-escape '<' and '>' characters in FAQ entries
+
+2003-02-20 08:17 dts12
+
+ * local/mib2c.scalar.conf:
+
+ Use 'netsnmp_register_scalar' instead of 'netsnmp_register_instance'
+ for handling scalar objects.
+
+2003-02-19 21:39 hardaker
+
+ * NEWS:
+
+ patch #657808: calculate a proper ifSpeed under linux when possible
+ and do more proper ifOperStatus state determination.
+
+2003-02-19 21:36 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ patch #657808: calculate a proper ifSpeed under linux when possible
+ and do more proper ifOperStatus state determination.
+
+2003-02-19 16:53 hardaker
+
+ * snmplib/snmp.c:
+
+ top level doxygen web page text
+
+2003-02-19 16:52 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_library.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_netsnmp_iterator_info_s.3,
+ netsnmp_netsnmp_mib_handler_methods.3, netsnmp_old_api.3
+, netsnmp_read_only.3, netsnmp_scalar.3,
+ netsnmp_serialize.3, netsnmp_set_data.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_table_iterator.h.3,
+ netsnmp_todo.3, netsnmp_util.3, netsnmp_watcher.3
+:
+
+ doxygen update.
+
+2003-02-19 16:52 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ run the column_enum and column_define .conf files and include those headers.
+
+2003-02-19 16:51 hardaker
+
+ * local/mib2c:
+
+ Add a @run@ tag to run other mib2c configuration files from the
+ current one.
+
+2003-02-19 16:51 hardaker
+
+ * agent/helpers/table_iterator.c,
+ include/net-snmp/agent/table_iterator.h:
+
+ more (bad) documentation for the iterator (gasp)
+
+2003-02-19 16:50 hardaker
+
+ * doxygen.conf:
+
+ add include directories for processing.
+
+2003-02-19 16:50 hardaker
+
+ * agent/mibgroup/examples/notification.c:
+
+ remove old unused comment.
+
+2003-02-19 13:11 hardaker
+
+ * snmplib/tools.c:
+
+ converted a bunch of non-doxygen docs to doxygen docs.
+
+2003-02-19 13:03 hardaker
+
+ * include/net-snmp/library/tools.h:
+
+ doxygenize a few defines.
+
+2003-02-18 07:56 hardaker
+
+ * configure:
+
+ run configure
+
+2003-02-17 11:20 rstory
+
+ * dist/nsb-functions:
+
+ add smux to list of modules for distribution; move test for make inside of
+ nsb-make; add blank line above ABORT; remove tee to logfile, as it eats
+ rc from command; add NOAUTODEPS=y to all make steps; do make touchit when
+ target = all; use nsb-make for distclean
+
+2003-02-17 11:18 rstory
+
+ * Makefile.in:
+
+ don't do any of the autoconf/autoheader deps if NOAUTODEP=* specified
+
+2003-02-17 11:15 rstory
+
+ * Makefile.rules:
+
+ add another dir level for make depends (per DS, from a while back - thought
+ this was already checked in)
+
+2003-02-17 07:30 nba
+
+ * README.solaris:
+
+ Note about bad /usr/xpg4/bin/sed
+
+2003-02-17 06:31 nba
+
+ * agent/mibgroup/ucd-snmp/logmatch.c:
+
+ The include for dmalloc better come after the std includes
+
+2003-02-17 05:36 nba
+
+ * configure.in:
+
+ Dont search /usr/local for dmalloc unless user explicitly asks for it
+
+2003-02-17 05:34 nba
+
+ * configure.in:
+
+ Bring back the developer warnings
+
+2003-02-17 05:33 nba
+
+ * configure.in:
+
+ Fix text for socklen_t
+
+2003-02-17 05:31 nba
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ Some error messages for Solaris
+
+2003-02-17 04:23 nba
+
+ * mibs/Makefile.in:
+
+ Install NET-SNMP-TC mib
+
+2003-02-14 07:41 hardaker
+
+ * NEWS:
+
+ includeAllDisks
+
+2003-02-14 07:38 hardaker
+
+ * agent/mibgroup/ucd-snmp/: disk.c, disk.h:
+
+ Patch #655444 from Srikanth Pindiproli:
+ Implement a new includeAllDisks snmpd.conf token to place all found
+ disks into the dskTable listing.
+
+2003-02-13 17:02 hardaker
+
+ * agent/mibgroup/mibII/: var_route.c (V5-0-patches.1), var_route.c
+:
+
+ Patch #654329: double check lengths when copying
+
+2003-02-13 14:59 hardaker
+
+ * configure, configure.in, agent/agent_read_config.c
+, agent/helpers/all_helpers.c,
+ agent/helpers/table_dataset.c, apps/snmptable.c,
+ apps/snmptranslate.c, apps/snmpnetstat/main.c,
+ include/net-snmp/mib_api.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/library/mib.h, snmplib/mib.c,
+ snmplib/oid_stash.c, snmplib/parse.c, snmplib/scapi.c
+, snmplib/snmp_api.c, snmplib/snmp_parse_args.c:
+
+ --disable-mib-lodaing removes the mib loading code from builds.
+ (oid printing are forced numeric)
+ This saves about about 200k in binary size on a linux box.
+ This saves about about 100k in running size on a linux box (assuming
+ the with-mib-loading is actually not loading anything just to be
+ fair, otherwise its about >500k).
+
+2003-02-13 08:01 hardaker
+
+ * Makefile.in, NEWS, aclocal.m4, configure
+, configure.in, include/net-snmp/net-snmp-config.h.in
+:
+
+ - Misc configure changes/fixes (eg, output the disabled states for perl)
+ - A bunch of new configure options:
+ --disable-applications Do not build the apps (snmpget, ...).
+ --disable-agent Do not build the agent (snmpd).
+ --disable-manuals Do not install the manuals.
+ --disable-scripts Do not install the scripts (mib2c, ...).
+ --disable-mibs Do not install the mib files.
+
+2003-02-13 06:54 hardaker
+
+ * agent/helpers/table_data.c:
+
+ check entry node as suggested by Irfan Sheriff
+
+2003-02-13 05:59 dts12
+
+ * configure:
+
+ Remove invalid 'testing' config_file target.
+ Since this is a directory, 'config.status' fails to create it.
+
+ I'm not quite sure where this appeared from. It's not part of
+ the configure script generated by autoconf 2.53, but it might
+ have been introduced between there and 2.57.
+
+2003-02-13 02:10 dts12
+
+ * testing/Makefile.in:
+
+ Mechanism for passing additional options to the test run.
+ Suggested by Andy Hood.
+
+2003-02-12 11:30 rstory
+
+ * configure, configure.in:
+
+ include agent/mibgroup headers from ${srcdir}
+
+2003-02-12 09:57 hardaker
+
+ * configure, configure.in:
+
+ - upgrade configure to autoconf 2.57
+ - This is functional now, but not all flags, features and tests have
+ been tested. Please report errors! There are more things to do,
+ like conversion of local macros (eg, STRUCT_FOR) to autoconf
+ newer standard macros.
+
+2003-02-12 06:01 hardaker
+
+ * agent/mibgroup/tunnel/: tunnel.h (V5-0-patches.1), tunnel.h
+ (V4-2-patches.[1,1]), tunnel.h:
+
+ update
+
+2003-02-11 18:05 hardaker
+
+ * agent/mibgroup/ucd-snmp/logmatch.c:
+
+ only define stuff if have_regex is defined
+
+2003-02-11 18:03 hardaker
+
+ * configure, configure.in:
+
+ run config_require checks through cpp
+
+2003-02-11 15:46 hardaker
+
+ * agent/helpers/table_data.c:
+
+ Irfan Sheriff pointed out a bug with getnext requests directly to
+ a column.
+
+2003-02-11 15:36 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ patch from Christophe Varoqui to fix dropping state change for thresholds.
+
+2003-02-11 08:26 dts12
+
+ * snmplib/: system.c (V4-2-patches.5), system.c:
+
+ Remove last remaining use of 'nlist' under HP-UX 10 & 11.
+ As per patch #656773 from Johannes Schmidt-Fischer
+
+2003-02-11 08:17 dts12
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ Checking the length of a string buffer once is sufficient.
+ Using 'strnncpy' [sic] to check this length twice is unnecessary...
+
+2003-02-11 08:05 hardaker
+
+ * agent/snmpd.c:
+
+ ifdef out unlikely-correct-code on win32
+
+2003-02-11 07:55 hardaker
+
+ * Makefile.in:
+
+ Mess with output of doxygen to add sf logos, etc, to the bottom of the
+ generated html files.
+
+2003-02-11 07:50 hardaker
+
+ * agent/snmpd.c:
+
+ Patch #655154 from Joel Rosdahl: more proper demonization:
+ - close stdin/stdout/stderr if appropriate.
+ - double fork.
+ - chdir / [I'm not convinced this is correct under windows? Anyone?]
+
+2003-02-11 07:30 hardaker
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ patch #667694 (anon) to add back newlines to pass code
+
+2003-02-11 07:25 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Patch #662169 from Jan Willem Luiten: diskio support for Darwin
+
+2003-02-11 06:14 dts12
+
+ * perl/SNMP/t/: bulkwalk.t, set.t:
+
+ Fix tests for bulkwalk (duplicate header) and set (invalid OID constant)
+
+2003-02-11 04:44 dts12
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ Accommodate a fussy IRIX environment, which is picky about <unistd.h>
+ See bug #667726
+
+2003-02-10 16:58 hardaker
+
+ * agent/mibgroup/ucd-snmp/logmatch.c:
+
+ fix indent comment damage.
+
+2003-02-10 16:38 hardaker
+
+ * agent/mibgroup/ucd-snmp/logmatch.c:
+
+ EXTENSIBLE -> UCDAVIS_MIB
+
+2003-02-10 15:38 hardaker
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Bruce Shaw pointed out a comment typo
+
+2003-02-10 15:38 hardaker
+
+ * perl/: ASN/Makefile.PL, OID/Makefile.PL,
+ agent/Makefile.PL, default_store/Makefile.PL,
+ SNMP/Makefile.PL:
+
+ fix my declarations as pointed out by Andrew Page
+
+2003-02-10 09:16 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ file name typo
+
+2003-02-10 07:57 nba
+
+ * Makefile.in, aclocal.m4, ltmain.sh,
+ config.guess, config.sub, configure.in,
+ configure:
+
+ Update libtool to 1.4.3
+
+2003-02-10 07:09 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ turn on log_match by default
+
+2003-02-10 06:39 hardaker
+
+ * README:
+
+ Added Christophe Varoqui to the thanks for his DISMAN patches
+
+2003-02-09 10:02 nba
+
+ * snmplib/mib.c:
+
+ An additional change to support 't' hints
+
+2003-02-06 21:17 hardaker
+
+ * agent/mibgroup/ucd-snmp/proc.c,
+ include/net-snmp/system/linux.h:
+
+ For linux, use /proc/X/status instead. It has the name of processes
+ when /proc/cmdline does not. A define (commented out) was put in
+ system/linux.h to revert to previous behavior if desired. I'm not
+ sure at which kernel release the status file was added.
+
+2003-02-06 20:04 hardaker
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ Add a debugging tag "proc" which prints process names as found in solaris.
+ (this should be nice when searching for unknown exact process names)
+
+2003-02-06 11:32 hardaker
+
+ * apps/snmptrapd.c, man/snmptrapd.8.def:
+
+ patch #674218: reopen log files on HUP.
+
+2003-02-06 10:42 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document monitor -t for threshold monitoring
+
+2003-02-06 10:33 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ Patch from Christophe to support monitor -t for threshold monitoring
+
+2003-02-05 22:07 hardaker
+
+ * local/mib2c.check_values.conf:
+
+ A mib2c file that generates a bunch of functions to check the value of
+ incoming SET requests.
+ (not complete yet. Needs support for BITS enums and a header file
+ with prototypes)
+
+ Happy Birthday (late) to Robert.
+
+2003-02-05 22:05 hardaker
+
+ * local/mib2c:
+
+ Support for foreach on ranges.
+
+2003-02-05 03:25 dts12
+
+ * FAQ:
+
+ Clarify the local-only access for non-standard port AgentX connections.
+
+2003-02-05 01:13 dts12
+
+ * net-snmp-config.in:
+
+ Don't prompt for an authentication pass-phrase, if one has already
+ been supplied. Reported by Darren Gamble.
+
+2003-02-04 06:25 dts12
+
+ * FAQ:
+
+ Add an entry describing configuring AgentX on a non-standard port.
+
+2003-02-03 07:25 hardaker
+
+ * snmplib/: snmp_api.c (V5-0-patches.2), snmp_api.c:
+
+ From Richard Laing: change value check of a string to use a proper length.
+
+2003-01-29 07:19 hardaker
+
+ * INSTALL, perl/SNMP/README:
+
+ perl documentation updates from Harrie
+
+2003-01-24 07:38 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ patch #672021 from Joshua Giles: large set request fixes
+
+2003-01-22 14:45 dts12
+
+ * agent/helpers/: table.c, table_iterator.c:
+
+ Having found a new row to work with, update the index values as well.
+ This seems to fix the mismatch between the OID being processed
+ and the index varbinds.
+
+2003-01-20 19:11 rstory
+
+ * snmplib/test_binary_array.c:
+
+ add string test case for binary array testing
+
+2003-01-20 19:11 rstory
+
+ * snmplib/container_binary_array.c:
+
+ fixes for array_qsort - not quite sure why/how it worked before..:-/
+
+2003-01-20 19:07 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ new netsnmp_compare_mem; fix typo in debug message
+
+2003-01-20 19:05 rstory
+
+ * agent/mibgroup/versiontag:
+
+ create md5sums after creating gzipped tarball
+
+2003-01-14 06:14 dts12
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/snmp_api.c:
+
+ Add support for 16-bit requestIDs, etc - for talking to broken agents.
+ (As per a suggestion of Niels, in discussion with Henrik Ostergaard Madsen)
+
+2003-01-14 05:56 hardaker
+
+ * agent/snmpd.c, doxygen.conf, agent/agent_handler.c
+, dist/RELEASE-INSTRUCTIONS:
+
+ doxygen changes
+
+2003-01-13 18:49 rstory
+
+ * man/: netsnmp_agent.3, netsnmp_handler.3:
+
+ update for 5.0.7
+
+2003-01-13 17:30 rstory
+
+ * snmplib/mib.c:
+
+ recognize new 't' code in display hints
+
+2003-01-13 17:07 rstory
+
+ * agent/helpers/table_iterator.c:
+
+ patch for memory leaks sent to coders by Jay Parlar
+
+2003-01-10 22:27 rstory
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.7 )
+
+2003-01-10 22:26 rstory
+
+ * ChangeLog, NEWS:
+
+ update for 5.0.7
+
+2003-01-10 22:15 rstory
+
+ * .cvsignore:
+
+ ignore configure-summary
+
+2003-01-10 22:14 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend, apps/Makefile.depend
+, apps/snmpnetstat/Makefile.depend,
+ snmplib/Makefile.depend:
+
+ make depend
+
+2003-01-10 22:08 rstory
+
+ * .cvsignore:
+
+ ignore variations of changelog.add
+
+2003-01-10 17:09 hardaker
+
+ * snmplib/: mib.c, snmp_api.c:
+
+ doxygen output tags to put the recently defined functions into groups.
+
+2003-01-10 17:09 hardaker
+
+ * man/: Makefile.in, netsnmp_agent.3,
+ netsnmp_bulk_to_next.3, netsnmp_debug.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_library.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_scalar.3, netsnmp_serialize.3, netsnmp_table.3
+, netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_watcher.3:
+
+ doxygen updates
+
+2003-01-10 14:38 hardaker
+
+ * configure, configure.in:
+
+ opps
+
+2003-01-10 14:29 hardaker
+
+ * configure, configure.in:
+
+ remove double checking output
+
+2003-01-10 11:33 hardaker
+
+ * testing/tests/T0160snmpv2cbulkget:
+
+ fix positional arguments
+
+2003-01-10 06:04 dts12
+
+ * FAQ:
+
+ Reference Bruce Shaw's discussion of the perl compilation problems
+ (see README.solaris)
+
+2003-01-10 05:31 dts12
+
+ * FAQ:
+
+ Mention AgentX under windows, and beef up the perl stuff a bit.
+ Add a missing entry in the contents list.
+ (This may prove too late for 5.0.8, but at least it'll be ready for next time!)
+
+2003-01-09 15:41 hardaker
+
+ * man/Makefile.in:
+
+ make doc update.
+
+2003-01-09 15:38 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_scalar.3, netsnmp_serialize.3, netsnmp_table.3
+, netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_watcher.3:
+
+ make doc update.
+
+2003-01-09 15:37 hardaker
+
+ * agent/helpers/Makefile.in, agent/helpers/mode_end_call.c
+, include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/mode_end_call.h:
+
+ end-of-mode helper to call more handlers after processing the main
+ line. Functionally allows parallel handler trees and callbacks after
+ a particular mode is completed (useful for things registered under a
+ serialize handler when you don't know when the mode is over).
+ (not used anywhere in production code yet.).
+
+2003-01-09 08:55 dts12
+
+ * FAQ:
+
+ Mention the perl shared/static library problem,
+ the unresponsive agent problem (and fix), and
+ disclaim all knowledge of David Town's Net::SNMP module,
+
+2003-01-09 07:27 hardaker
+
+ * testing/tests/: T0160snmpv2cbulkget, T0220snmpv3bulkget
+:
+
+ GetBulk testing supplied by Xiaofeng Ling
+
+2003-01-09 07:26 hardaker
+
+ * testing/RUNTESTS:
+
+ Add -x flag for calling subtests with "sh -x".
+ Fix number counting for interactive output.
+
+2003-01-07 15:49 hardaker
+
+ * COPYING (V4-2-patches.8), COPYING:
+
+ year update
+
+2003-01-07 10:18 hardaker
+
+ * FAQ (V4-2-patches.8), FAQ:
+
+ irc server name change
+
+2003-01-07 08:01 hardaker
+
+ * snmplib/mib.c:
+
+ bug #663628 and patch: fix ip address index parsing from OIDs
+
+2003-01-07 01:53 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Remove redundant code to free 'callback_data_keep' data.
+ This branch would never be invoked, and is in the wrong
+ place anyway. Patch supplied by Jay Parlar
+
+2003-01-06 08:16 nba
+
+ * Makefile.in:
+
+ Install Solaris 9 header
+
+2003-01-05 15:14 nba
+
+ * win32/win32.opt:
+
+ Make it compile with VC++
+
+2003-01-05 14:28 nba
+
+ * win32/: encode_keychange/encode_keychange.dsp, win32.opt
+, libsnmp_dll/libsnmp.def:
+
+ Make it compile with VC++
+
+2003-01-05 12:45 nba
+
+ * mibs/: Makefile.mib, SNMP-FRAMEWORK-MIB.txt,
+ SNMP-MPD-MIB.txt, SNMP-NOTIFICATION-MIB.txt,
+ SNMP-PROXY-MIB.txt, SNMP-TARGET-MIB.txt,
+ SNMP-USER-BASED-SM-MIB.txt, SNMP-VIEW-BASED-ACM-MIB.txt
+, SNMPv2-MIB.txt, SNMPv2-TM.txt, rfclist:
+
+ Update to current RFC versions
+
+2003-01-03 12:50 rstory
+
+ * configure, configure.in:
+
+ don't call AC_DISABLE_SHARED, as sets the default to disabled (it's very
+ presence in configure.in generates a configure with shared disabled, even
+ if it was in an if block; for developer default, set enable_shared directly
+ unless it was previously set; test that enable_shared=yes for embedded-perl
+
+2003-01-03 05:02 dts12
+
+ * FAQ (V4-2-patches.7), FAQ:
+
+ Mention the Stratus VOS port. (Thanks to Brandon Hall)
+
+2003-01-02 15:00 rstory
+
+ * include/net-snmp/library/container.h:
+
+ parens around x in macro in case x is multiple C tokens
+
+2002-12-22 09:32 rstory
+
+ * sedscript.in, snmplib/snmp_version.c, FAQ,
+ README, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.7.pre2 )
+
+2002-12-22 09:31 rstory
+
+ * ChangeLog, NEWS:
+
+ update for 5.0.7.pre2
+
+2002-12-22 09:20 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend, apps/Makefile.depend
+, apps/snmpnetstat/Makefile.depend,
+ snmplib/Makefile.depend:
+
+ make depend
+
+2002-12-20 04:58 nba
+
+ * Makefile.in:
+
+ clean away net-snmp-config on make clean
+
+2002-12-20 04:57 nba
+
+ * include/net-snmp/mib_api.h,
+ include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c
+:
+
+ stash the oid_stash ...
+
+2002-12-20 01:49 nba
+
+ * snmplib/snmp_api.c:
+
+ A patch from V4 that didn't make it ... allow list of numeric bits setting BITS
+
+2002-12-19 23:50 hardaker
+
+ * include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c
+:
+
+ add a global callback function for registering directly via a callback.
+
+2002-12-19 23:35 hardaker
+
+ * include/net-snmp/utilities.h:
+
+ add callback.h
+
+2002-12-19 23:22 hardaker
+
+ * snmplib/read_config.c:
+
+ fix persistent storage file renaming. (snprintf change mistake)
+
+2002-12-19 23:21 hardaker
+
+ * include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c
+:
+
+ some new routines for saving oid stash data to persistent storage.
+ (not used anywhere in current production code)
+
+2002-12-19 14:51 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ - watch for undefs passed in as a value to a SET clause.
+ - change BITS to a Octet String as it should be.
+ - on a side note, do you know that the Net-SNMP parser doesn't
+ distinguish between BITS and BIT STRING in it's list of types? I
+ don't think it's possible to use both types in the code today
+ (which is fine, since BIT STRING is not used in SNMPv2 and beyond).
+
+2002-12-19 14:49 hardaker
+
+ * perl/OID/OID.xs:
+
+ print a warning when you can't parse an OID (err, not ideal)
+
+2002-12-19 14:48 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - misc bug fixes.
+ - skip SETing columns with no value passed in.
+
+2002-12-19 11:43 nba
+
+ * agent/mibgroup/: examples/example.c, host/hr_network.c
+, host/hr_swinst.c:
+
+ Being a bit quick, eh, Dave ...
+
+2002-12-19 08:14 dts12
+
+ * agent/mibgroup/mibII/: at.c (V4-2-patches.2), at.c:
+
+ Ensure the ifname buffer is big enough to read in a full-length name.
+ (From the SUSE "audit" patch)
+
+2002-12-19 08:05 dts12
+
+ * agent/snmpd.c, agent/mibgroup/host/hr_print.c,
+ apps/encode_keychange.c, apps/snmptrapd_handlers.c, snmplib/mib.c
+ (V4-2-patches.[8,9,3,3,0]), agent/snmpd.c,
+ agent/mibgroup/host/hr_print.c, apps/encode_keychange.c
+, apps/snmptrapd_handlers.c, snmplib/mib.c:
+
+ Detect when memory allocations fail, and don't plough on regardless.
+ (Based on changes within the SUSE "audit" patch)
+
+2002-12-19 07:07 dts12
+
+ * agent/agent_trap.c, agent/snmp_agent.c,
+ agent/mibgroup/util_funcs.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c, apps/encode_keychange.c
+, apps/snmptrapd.c, apps/snmptrapd_handlers.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ snmplib/asn1.c, snmplib/mib.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/snmp_api.c,
+ snmplib/snmpv3.c, snmplib/vacm.c:
+
+ The Great SUSE 'sprintf' Hunt.....
+
+2002-12-19 03:02 jbpn
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ - code with BSDi4
+
+2002-12-19 02:50 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - change a comment that doesn't take into account the transport stuff
+ - fix some particularly bad formatting in snmp_open_ex
+
+2002-12-18 10:50 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ remove mem-leak comment. Out of date and was fixed
+
+2002-12-18 10:47 hardaker
+
+ * agent/mibgroup/agentx/agentx_config.c, man/snmpd.conf.5.def
+:
+
+ delete experimental warning about agentx
+
+2002-12-18 10:40 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ fix bug#655488: descriptions of ssIORawReceived and ssRawInterrupts were reversed
+
+2002-12-18 05:19 jbpn
+
+ * agent/snmpd.c:
+
+ - restart stderr logging on HUP (if -L was given on command line)
+
+2002-12-17 16:33 rstory
+
+ * local/mib2c.array-user.conf:
+
+ remove ';' from define; if table has a storage type, check that it's not
+ read only before allowing sets
+
+2002-12-17 16:26 rstory
+
+ * local/mib2c.array-persistent.conf:
+
+ never mind
+
+2002-12-17 16:02 hardaker
+
+ * perl/OID/test.pl:
+
+ Don't check for prefixes in test. They don't exist. However, do set SNMPCONFPATH in test initialization to a bogus value
+
+2002-12-17 15:58 hardaker
+
+ * perl/OID/OID.xs:
+
+ remove direct call to init_snmp(). This is already called by the .pm file
+
+2002-12-17 07:22 rstory
+
+ * local/mib2c.array-persistent.conf:
+
+ persistence for array-tables
+
+2002-12-17 07:07 rstory
+
+ * include/net-snmp/library/read_config.h,
+ snmplib/read_config.c:
+
+ add read_config_store_data_prefix; add ASN_TIMETICKS w/ASN_UNSIGNED cases
+
+2002-12-17 06:44 rstory
+
+ * snmplib/snmpUDPDomain.c:
+
+ don't use SO_REUSE_ADDR so agent port can't be hijacked
+
+2002-12-17 06:43 rstory
+
+ * net-snmp-config.in:
+
+ use local var for base agent libs; reorder base agent libs so static linking
+ works
+
+2002-12-16 15:32 nba
+
+ * snmplib/scapi.c, agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/mta_sendmail.h:
+
+ Yet another compiler warning ...
+
+2002-12-16 14:50 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ remove bogus comment reference to table_dataset helper.
+
+2002-12-16 14:42 nba
+
+ * agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/disman/mteEventTable.h,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerTable.h, apps/snmptrapd.c
+, include/net-snmp/library/tools.h, snmplib/tools.c
+:
+
+ Spread some magic dust to quell compiler warnings (why isn't --enable-slient-libtool the default ...)
+
+2002-12-16 08:44 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - fix small memory leak (peername is copied by snmp_open_ex)
+
+2002-12-16 08:31 jbpn
+
+ * snmplib/mib.c:
+
+ - fix small memory leak
+
+2002-12-16 08:19 jbpn
+
+ * snmplib/parse.c:
+
+ - fix memory leak
+
+2002-12-16 07:02 rstory
+
+ * snmplib/container.c:
+
+ remove redundant include (caused problems on Sun 5.7, reported by jbpn)
+
+2002-12-16 05:22 rstory
+
+ * dist/nsb-functions:
+
+ configure w/out developer
+
+2002-12-16 05:18 rstory
+
+ * configure, configure.in:
+
+ DEVFLAGS="" if not developer
+
+2002-12-15 23:39 nba
+
+ * snmplib/: oid_stash.c, scapi.c, snmpAAL5PVCDomain.c
+, snmpIPXDomain.c, snmpTCPIPv6Domain.c,
+ snmpUDPIPv6Domain.c:
+
+ dmalloc support
+
+2002-12-15 23:39 nba
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ Possible leak of fd on error return
+
+2002-12-14 07:22 rstory
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.7.pre1 )
+
+2002-12-14 07:21 rstory
+
+ * ChangeLog, NEWS:
+
+ update for 5.0.7.pre1
+
+2002-12-14 06:59 rstory
+
+ * dist/nsb-functions:
+
+ check for agent/mibgroup; fix modules for config_dist
+
+2002-12-14 06:58 rstory
+
+ * man/: netsnmp_bulk_to_next.3, netsnmp_debug.3,
+ netsnmp_handler.3, netsnmp_old_api.3,
+ netsnmp_read_only.3, netsnmp_serialize.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_todo.3:
+
+ update for 5.0.7.pre1
+
+2002-12-14 06:54 rstory
+
+ * Makefile.top:
+
+ bump rev to 5.0.7
+
+2002-12-14 06:49 rstory
+
+ * Makefile.in:
+
+ add -n to grep for C++ comments
+
+2002-12-14 06:47 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, apps/Makefile.depend,
+ snmplib/Makefile.depend:
+
+ make depend
+
+2002-12-14 06:45 rstory
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ remove C++ comments
+
+2002-12-14 06:30 rstory
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ add comments to some structure members
+
+2002-12-14 06:29 rstory
+
+ * agent/helpers/table_array.c:
+
+ errors during commit undo should be xxFAILED; use set_request_error instead of
+ set_mode_request_error; remove incorrect comment; more debugging; check for
+ and call lower handlers
+
+2002-12-14 06:27 rstory
+
+ * agent/helpers/table.c:
+
+ always process later passes of a set request
+
+2002-12-13 13:06 nba
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ Quell compiler warnings
+
+2002-12-13 12:47 nba
+
+ * agent/mibgroup/mibII/var_route.c, snmplib/default_store.c
+:
+
+ Quell compiler warnings
+
+2002-12-13 12:40 nba
+
+ * snmplib/scapi.c:
+
+ Fix incomplete zeroing of security data
+
+2002-12-13 12:39 nba
+
+ * snmplib/parse.c:
+
+ Fix a possible freeing of a NULL pointer
+
+2002-12-13 12:38 nba
+
+ * agent/helpers/table_dataset.c,
+ agent/mibgroup/mibII/ipAddr.c, apps/snmptrapd.c,
+ include/net-snmp/agent/table_data.h, snmplib/snmp_api.c
+:
+
+ Quell compiler warnings
+
+2002-12-13 08:38 dts12
+
+ * agent/agent_handler.c:
+
+ Clear the 'processed' flag between passes, so that handlers
+ can correctly clean up after errors have been detected.
+
+2002-12-13 08:06 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ add asser to try and cath intermittent crash i've been seeing
+
+2002-12-13 08:04 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ log unknown agentx operation
+
+2002-12-13 07:12 rstory
+
+ * agent/helpers/table_array.c:
+
+ if no row create callback on set, use NOTWRITABLE instead of NOSUCHINSTANCE
+
+2002-12-13 07:04 rstory
+
+ * agent/helpers/debug_handler.c:
+
+ fix cut-n-paste so delegated flag displayed properly
+
+2002-12-13 07:01 rstory
+
+ * snmplib/default_store.c:
+
+ log text (APP|LIB|TOK) instead of store id in debug msgs
+
+2002-12-13 06:53 rstory
+
+ * dist/nsb-functions:
+
+ add --with-libwrap
+
+2002-12-13 06:49 rstory
+
+ * FAQ:
+
+ grammar/indention tweak + mention strip for memory footprint question
+
+2002-12-13 06:32 dts12
+
+ * perl/SNMP/Makefile.PL:
+
+ Remove explicit mention of SNMP module documentation.
+ This setting doesn't seem to be necessary, and without it,
+ the man page is installed automatically.
+
+2002-12-13 04:47 jbpn
+
+ * apps/snmptrapd.c:
+
+ - make -S do the same as snmpd -S (set the syslog facility)
+ - make -l print a warning saying that it is deprecated and -S should
+ be used instead
+
+2002-12-13 04:14 jbpn
+
+ * snmplib/read_config.c:
+
+ - increase width of token field to improve legibility of
+ configuration directive help output
+
+2002-12-12 14:46 nba
+
+ * apps/snmptable.c:
+
+ Protect against unknown -O options
+
+2002-12-12 12:56 nba
+
+ * agent/mibgroup/smux/smux.c:
+
+ Fix some size_t that really should be int
+
+2002-12-12 11:18 nba
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/mib.h, man/snmp.conf.5.def,
+ man/snmpcmd.1.def, snmplib/mib.c, snmplib/snmp_api.c
+:
+
+ A long overdue patch (#415252) from Robert Hastings that implements
+ reverse DISPLAY-HINT processing, i.e. it allows you to input data
+ formatted like the DISPLAY-HINT prescribes. Enabled by default, but
+ can be disabled with the -Ih option or noDisplayHint in snmp.conf
+
+2002-12-12 10:56 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ parse oids in view statements the same way the apps do it (consistency, he said)
+
+2002-12-12 10:35 hardaker
+
+ * perl/agent/agent.xs:
+
+ Add a getRootOID function to the reginfo pointer passed into handlers.
+
+2002-12-12 10:34 rstory
+
+ * local/mib2c.array-user.conf:
+
+ change create and duplicate row to return specific context instead of generic
+ netsnmp_index; catch error from parse_oid_indexes on row creation
+
+2002-12-12 10:34 hardaker
+
+ * perl/SNMP/t/mib.t:
+
+ Print errors to STDERR instead.
+ (actually don't because these statements are commented out in the
+ first place)
+
+2002-12-12 10:33 hardaker
+
+ * agent/agent_registry.c:
+
+ Reverse the context of a context if statement so if not the context
+ then don't use the context in the given context.
+
+2002-12-12 09:56 jbpn
+
+ * apps/snmptrapd.c:
+
+ - drop long-deprecated -q and -S options
+ - minor formatting fixes
+
+2002-12-12 09:35 jbpn
+
+ * agent/snmpd.c:
+
+ - remove duplicate message in usage
+
+2002-12-12 08:37 dts12
+
+ * man/snmpd.1.def, agent/snmpd.c:
+
+ Implement a command-line option (-S) to set the facility to use when
+ logging via syslog. Based on an idea by Joel Rosdahl (Patch #627701)
+ Note that -l and -L are already taken:-(
+
+ ToDo:
+ Provide configuration directives for both this, and the syslog token ('snmpd').
+
+2002-12-12 08:18 dts12
+
+ * man/snmpd.conf.5.def, agent/mibgroup/mibII/system_mib.c
+:
+
+ Support setting of sysDescr and sysObjectID via snmpd.conf
+ configuration directives (though not via SNMP SET reqests).
+ Patches supplied by Joel Rosdahl (#627702 and #628011)
+
+2002-12-12 07:58 dts12
+
+ * agent/helpers/: all_helpers.c, table.c:
+
+ Suppress some compiler warnings.
+ Based on patch supplied by Chris Johns (#644041)
+
+2002-12-12 07:42 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory_solaris2.c (V4-2-patches.6),
+ memory_solaris2.c:
+
+ Use 'sysconf' to report on Solaris memory usage.
+ Based on patch supplied by Ben Stern (#651182)
+
+2002-12-12 07:00 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Basic support for multiple AgentX sockets (on the master side at least).
+ See Feature Request #632556
+
+2002-12-12 05:57 rstory
+
+ * dist/Makefile:
+
+ create version tag from version so cvs export works; fix REL; add tar.gz
+ of source as dependency for rpmfiles
+
+2002-12-12 05:04 nba
+
+ * snmplib/: data_list.c, snmpCallbackDomain.c,
+ snmpTCPDomain.c, snmpUDPDomain.c, snmpUnixDomain.c
+, snmp_enum.c, snmp_secmod.c, snmp_transport.c
+:
+
+ dmalloc support
+
+2002-12-12 04:18 dts12
+
+ * snmplib/mib.c:
+
+ Document the -OU option, and alphabetise the handling of options.
+
+2002-12-12 03:25 dts12
+
+ * apps/Makefile.in:
+
+ Install 'snmpinform' as a relative link, rather than an absolute one.
+ Fix provided by the indefatigable Stefan Radman (Bug #652587)
+
+2002-12-12 02:56 dts12
+
+ * configure, configure.in:
+
+ Quote configure options when contructing net-snmp-configure and net-snmp-configure.h
+ This allows options containing spaces, etc, to be handled correctly.
+ (See Feature Request #547152)
+
+2002-12-11 13:52 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ Patch for FreeBSD. Thanks to Jun Kuriyama
+
+2002-12-11 09:16 dts12
+
+ * snmplib/: snmp_logging.c (V4-2-patches.4), snmp_logging.c:
+
+ Try disabling line-buffering on Windows systems (since it
+ apparently enables full-buffering instead). See Bug #558837.
+
+2002-12-11 08:25 dts12
+
+ * perl/SNMP/t/: async.t, get.t, getnext.t,
+ notify.t, set.t:
+
+ Explicitly set SNMP version = 1 (the original default as expected by the tests)
+ This should now pass all tests apart from conf.t #3
+
+2002-12-11 03:46 dts12
+
+ * include/net-snmp/agent/auto_nlist.h:
+
+ Be more selective in using the 64-bit version of nlist. (Bug #611655)
+
+2002-12-11 03:27 dts12
+
+ * README.solaris:
+
+ Mention the non-functionality of one of the suggested approaches.
+ (Bug #617119). Reported by Quanah Gibson-Mount
+
+2002-12-11 03:20 dts12
+
+ * agent/Makefile.in:
+
+ Ensure that the destination directory exists before installing the
+ embedded perl script. (Bug #617891) Fix provided by Stefan Radman.
+
+2002-12-11 02:56 dts12
+
+ * README.snmpv3 (V4-2-patches.4), README.snmpv3:
+
+ Document the location assumptions being made in this description.
+
+2002-12-11 01:47 dts12
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/mib.h, snmplib/mib.c,
+ man/snmpcmd.1.def:
+
+ Provide a mechanism for forcing strings to be displayed in either
+ ASCII or Hex format, bypassing the "guess" mechanism as to which
+ is more appropriate. Suggested by Nick Kanakakorn.
+ Note that this does not affect objects with a Display-Hint in
+ their MIB definition.
+
+2002-12-11 01:30 dts12
+
+ * agent/ds_agent.h, agent/snmpd.c, testing/eval_tools.sh
+ (V4-2-patches.[2,6,6]), agent/agent_read_config.c,
+ agent/snmpd.c, include/net-snmp/agent/ds_agent.h,
+ testing/eval_tools.sh:
+
+ Command-line option to control whether to unlink the PID file or not.
+ Necessary for correct test operation.
+
+2002-12-11 01:21 dts12
+
+ * perl/OID/test.pl:
+
+ The latest library defaults to MODULE::name style output,
+ so adjust the expected output checks accordingly.
+ Also, there are actually 36 tests, not 35!
+
+2002-12-11 01:17 dts12
+
+ * perl/OID/OID.xs:
+
+ Initialise the SNMP libraries, to set up the OID tree.
+ Addresses bugs #638024 and #627643
+ [Qn: Do we need to supply an 'appname' (c.d the SNMP module) ?]
+
+2002-12-10 16:29 nba
+
+ * man/snmp.conf.5.def, snmplib/snmp_api.c,
+ agent/mibgroup/util_funcs.c,
+ agent/mibgroup/ucd-snmp/logmatch.c:
+
+ Allow runtime configuration of persistent directory
+
+2002-12-10 16:24 nba
+
+ * snmplib/read_config.c:
+
+ Report errors handling persistent storage files
+
+2002-12-10 16:23 nba
+
+ * snmplib/system.c:
+
+ Pass up error on directory creation
+
+2002-12-10 14:27 nba
+
+ * snmplib/mib.c:
+
+ Better respect for the max width option (snmptranslate -Td)
+
+2002-12-10 14:26 nba
+
+ * man/snmp.conf.5.def:
+
+ Document the oidOutputFormat option
+
+2002-12-10 14:25 nba
+
+ * apps/snmptable.c:
+
+ Clean up. Remove calls to obsolete functions snmp_set_quick_print,
+ snmp_get_dump_packet, snmp_get_suffix_only. Remove last traces of the
+ non_sequential backwards hack. Make sure it works for all -O options.
+
+2002-12-10 08:58 dts12
+
+ * agent/mibgroup/mibII/: interfaces.c (V4-2-patches.6),
+ interfaces.c:
+
+ Protect against empty lines in /proc/net/dev (Bug #625426)
+
+2002-12-10 08:41 dts12
+
+ * snmplib/: snmpv3.c (V4-2-patches.5), snmpv3.c:
+
+ Free destination memory before cloning SNMP Engine ID.
+ Fix provided by Martin Carlsson. (Bug #835481)
+
+2002-12-10 08:07 dts12
+
+ * perl/: ASN/Makefile.PL, OID/Makefile.PL,
+ SNMP/Makefile.PL, agent/Makefile.PL,
+ agent/default_store/Makefile.PL, default_store/Makefile.PL
+:
+
+ Add "$Config{ccflags}" to CCFLAGS. (See bug #640899)
+
+2002-12-10 07:46 dts12
+
+ * agent/mibgroup/mibII/: ipAddr.c (V4-2-patches.8), ipAddr.c:
+
+ Add support for Linux virtual interfaces in the ipAddressTable.
+ (Note this does *not* include separate per-v-interface statistics
+ in the interfaces table).
+
+ Patch supplied by Jens Sittner (#621274)
+
+2002-12-10 01:59 dts12
+
+ * agent/agent_handler.c:
+
+ Remove a couple of extraneous ^M characters.
+
+2002-12-09 23:36 nba
+
+ * snmplib/mib.c:
+
+ When using -Oqv and printing an empty string you could end up with
+ a NULL string and not an empty string leading to some very obscure
+ problems in snmptable and other applications.
+
+2002-12-09 08:12 dts12
+
+ * snmplib/snmp_api.c:
+
+ Handle missing integer values (whether 32- or 64-bit!). Oops!
+
+2002-12-09 07:12 dts12
+
+ * snmplib/: snmp_api.c (V4-2-patches.8), snmp_api.c:
+
+ Handle integer-based values correctly on a 64-bit platform.
+ Patch supplied by Thomas Weber (#561071)
+
+2002-12-09 06:45 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Take note of subagent-requested byte ordering in subsequent communications.
+ Patch supplied by Urban (#632284)
+
+2002-12-09 06:32 dts12
+
+ * agent/: snmpd.c (V4-2-patches.5), snmpd.c:
+
+ Remove the PID file on agent shutdown.
+ Patch supplied by Joel Rosdahl (#627699)
+
+2002-12-09 06:25 dts12
+
+ * snmplib/system.c:
+
+ Handle 'struct sockaddr' that contain 'sa_len' fields differently
+ to those that don't (c.f ifilter_ioctl.c in BIND 9.2.1 sources)
+ Patch supplied by Joel Rosdahl (#627696)
+
+2002-12-09 04:12 dts12
+
+ * acconfig.h, configure, configure.in:
+
+ Recognise BSDi4, and tweak the recognition of 'dlopen'.
+ Patches supplied by Joel Rosdahl.
+
+2002-12-09 03:10 dts12
+
+ * agent/mibgroup/mibII/: at.c, interfaces.c, ip.c
+:
+
+ Remove some warnings, and try to cope with 'sysctl' failures.
+ Patches supplied by Chris Johns.
+
+2002-12-09 01:20 dts12
+
+ * README.solaris:
+
+ Mention the limitations on /usr/ucb/sed,
+ and point people towards /usr/bin/sed instead.
+
+2002-12-07 05:41 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Insert newly-created rows into the per-request lists, so that lower
+ level handlers can access them.
+ [Qn: Should we do something similar with updated lists as well?]
+
+2002-12-07 05:34 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Report back the correct error for rows that couldn't be created.
+
+2002-12-07 05:32 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Protect against freeing a row that never got created in the first place.
+
+2002-12-06 15:05 hardaker
+
+ * testing/tests/T030snmpv3usercreation:
+
+ Skip on non-openssl machines. THis should be changed to just not using encryption on those machines, but I do not have the time at the moment
+
+2002-12-06 10:12 hardaker
+
+ * configure.in:
+
+ remove ucdDemoPublic from --enable-mini-agent
+
+2002-12-06 10:02 hardaker
+
+ * configure:
+
+ remove ucdDemoPublic from --enable-mini-agent
+
+2002-12-06 09:01 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Don't delete the "old" (non-existent) row, when tidying up after
+ creating a new row.
+
+2002-12-06 08:40 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Tweak handling of (invalid) RowStatus creation requests in an
+ "automatic creation" table. These should return wrongValue or
+ inconsistentValue, rather than notWritable.
+
+2002-12-05 02:47 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Support use of RowStatus object to control creation of new rows
+ (i.e. when the 'allow_creation' flag is not set).
+ This should deal with everything except determining whether a
+ row is ready to go 'active' (e.g. via 'createAndGo'). Such a
+ decision is inherently specific to each individual MIB, so must
+ really be done in the lower-level handler.
+
+2002-12-05 02:41 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Stop processing when a 'non-writable create' is detected.
+
+2002-12-04 16:35 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ - BIT_STR -> OCTET_STR, which is what it should be.
+ - run eventTable entries.
+
+2002-12-04 16:34 hardaker
+
+ * agent/mibgroup/disman/mteTriggerExistenceTable.c:
+
+ BIT_STR -> OCTET_STR, which is what it should be.
+
+2002-12-04 16:33 hardaker
+
+ * agent/mibgroup/disman/: mteObjectsTable.c,
+ mteTriggerBooleanTable.c:
+
+ use netsnmp_strdup_and_null to get real strings from mib data.
+
+2002-12-04 16:32 hardaker
+
+ * agent/mibgroup/disman/: event-mib.h,
+ mteEventNotificationTable.c, mteEventNotificationTable.h
+, mteEventTable.c, mteEventTable.h:
+
+ - implemented the mteEventTable and the mteEventNotificationTable
+ - FYI, total implementation time: about 4 hours
+ - no easy-to-use .conf wrappers yet though. snmpset support only.
+
+2002-12-04 16:29 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ - use the netsnmp_table_set_add_indexes function which actually works.
+
+2002-12-04 16:29 hardaker
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ - create a netsnmp_table_set_add_indexes function.
+ - Allow row creation using rowStatus when the data column exists, but
+ there is no assigned value (ie, is NULL).
+ - use netsnmp_strdup_and_null instead of memdup to make sure an
+ implicit NULL is in place for things that use the data and need it
+ as a real string.
+
+2002-12-04 16:27 hardaker
+
+ * net-snmp-config.in:
+
+ document --prefix
+
+2002-12-04 10:16 hardaker
+
+ * NEWS (V4-2-patches.9), NEWS:
+
+ document 4.2.6
+
+2002-12-03 01:44 dts12
+
+ * agent/mibgroup/host/hr_print.c:
+
+ Close printer file handle with 'fclose' rather than 'pclose' to avoid
+ a memory leak on Solaris 2.6. Fix provided by Jacobo Matute.
+
+2002-12-03 01:33 dts12
+
+ * agent/helpers/: table_data.c, table_dataset.c:
+
+ Translate GetNext (and GetBulk) requests into simple Get requests,
+ when passing them from the table_data handler to table_dataset.
+ This is analogous to how the iterate handler works, and allows
+ lower level handlers to override the basic behaviour (without
+ having to duplicate all of the "find next row" code every time).
+
+2002-12-02 01:48 dts12
+
+ * agent/helpers/table.c:
+
+ Return SNMPv2-style exceptions, rather than the SNMPv1 'noSuchName' error.
+ This used to break AgentX subagents, but the latest change to snmp_agent.c
+ (to catch noSuch{Instance,Object} exceptions) seems to have fixed that problem.
+
+2002-12-02 01:40 dts12
+
+ * agent/snmp_agent.c:
+
+ Explicitly parenthesise a comparison, to keep the compiler happy.
+
+2002-12-02 01:39 dts12
+
+ * agent/snmp_agent.c:
+
+ Inclusive-range GetNext requests are transmitted as Get requests, so may
+ well return noSuch{Instance,Object} exceptions. Catch these as well.
+
+2002-12-02 01:36 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Catch (and reject) attempts to create a new row via a non-writable object.
+
+2002-11-28 01:24 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Null out one final loop_context pointer after being freed.
+ (Patch provided by Roger McCalman)
+
+2002-11-26 14:59 nba
+
+ * snmplib/parse.c:
+
+ Discard the secondary (GROUP) DESCRIPTION insize a MODULE-COMPLIANCE
+ to avoid leaking memory. Thanks to Eugene_Bruk@bmc.com
+
+2002-11-26 14:53 nba
+
+ * apps/snmptranslate.c:
+
+ Reinstate the -w options that was lost in the indent fury
+
+2002-11-26 07:50 hardaker
+
+ * agent/mibgroup/examples/notification.c:
+
+ The notification variable shouldn't be static. A bug found while
+ tracking down a problem pointed out by Venice on IRC.
+
+2002-11-26 01:10 dts12
+
+ * snmplib/snmp_enum.c:
+
+ Fix incorrect usage of SE_MAX_IDS vs SE_MAX_SUBIDS.
+ Reported by 'shinepeak'
+
+2002-11-25 19:41 hardaker
+
+ * local/FAQ2HTML:
+
+ hack of a hack of a hack, or: fix multi-line FAQ questions
+
+2002-11-25 07:08 hardaker
+
+ * README.agentx:
+
+ mention agentxPingInterval
+
+2002-11-18 18:39 hardaker
+
+ * agent/mibgroup/smux/smux.h:
+
+ applied patch #527650
+
+2002-11-11 14:10 nba
+
+ * snmplib/mib.c:
+
+ Respect the mibdirs conf directive. Thanks to Stefan Radman (sradman)
+
+2002-11-11 13:57 nba
+
+ * apps/snmptrapd_log.c:
+
+ Fix a missing error return
+
+2002-11-11 11:26 hardaker
+
+ * snmplib/: snmpTCPDomain.c, snmpUDPDomain.c:
+
+ fix taddr generation/parsing for port based transports to properly use
+ network byte ordering.
+
+2002-11-11 11:25 hardaker
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ fix write support for the timeout column
+
+2002-11-09 07:06 nba
+
+ * agent/mib_modules.c, agent/snmp_vars.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c,
+ include/net-snmp/agent/mib_modules.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h:
+
+ Do away with a bunch of compiler warnings
+
+2002-11-09 06:59 nba
+
+ * agent/mibgroup/: util_funcs.c, ucd-snmp/extensible.c,
+ ucd-snmp/memory.c, ucd-snmp/memory_freebsd2.c,
+ ucd-snmp/pass.c, ucd-snmp/proc.c, host/hr_print.c
+:
+
+ Zero is an OK file descriptor. -1 is the error return
+
+2002-11-09 06:54 nba
+
+ * include/net-snmp/library/parse.h, snmplib/parse.c:
+
+ More to the point message for undefined identifiers. Brought forward from 4.2
+
+2002-11-09 06:52 nba
+
+ * apps/snmpvacm.c:
+
+ Print the error information in case of error
+
+2002-11-09 06:51 nba
+
+ * apps/snmpnetstat/route.c:
+
+ Protect against v2 exception results
+
+2002-11-09 06:49 nba
+
+ * sedscript.in, man/snmpcmd.1.def:
+
+ Protect PREFIX when it is the env var. Thanks to Stefan Radman (sradman)
+
+2002-11-09 06:47 nba
+
+ * mibs/rfclist:
+
+ Add RFC 3371 L2TP-MIB
+
+2002-11-09 06:46 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ Updated from IANA
+
+2002-11-07 02:55 jbpn
+
+ * apps/snmptable.c:
+
+ - fix -Cf and -Cw option processing (previously would core dump if
+ no option passed), as pointed out by hampa on #net-snmp
+
+2002-11-06 12:35 rstory
+
+ * net-snmp-config.in:
+
+ fix cut/paste
+
+2002-11-06 12:04 rstory
+
+ * configure:
+
+ configure to match configure.in & makefiles
+
+2002-11-06 11:08 rstory
+
+ * net-snmp-config.in:
+
+ add missing end quote
+
+2002-11-06 10:35 rstory
+
+ * net-snmp-config.in:
+
+ add @DEVFLAGS@ weherver there is a @CFLAGS@, except for the new --base-cflags
+
+2002-11-06 10:22 rstory
+
+ * Makefile.top:
+
+ add @DEVFLAGS@ to CFLAGS
+
+2002-11-06 10:21 rstory
+
+ * configure.in:
+
+ seperate developer cflags from normal cflags
+
+2002-11-06 09:55 rstory
+
+ * agent/mibgroup/util_funcs.h:
+
+ change struct.h include to use "" instead of <net-snmp/>, since it it a local
+ include, not a system include
+
+2002-11-06 09:39 rstory
+
+ * acconfig.h, agent/mibgroup/util_funcs.h,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ include/net-snmp/net-snmp-config.h.in,
+ snmplib/ucd-snmp-includes.h, win32/config.h,
+ win32/net-snmp/net-snmp-config.h:
+
+ purge IN_UCD_SNMP_SOURCE
+
+2002-11-05 09:24 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ added a xmlshort delimiter as requested by lands on IRC
+
+2002-11-05 08:59 rstory
+
+ * dist/cvsup:
+
+ tabs -> spaces only try to chmod RO src dir if owner of dirs
+
+2002-11-05 08:56 rstory
+
+ * mkinstalldirs:
+
+ making a directory is not an error, so don't send output to stderr
+
+2002-11-04 08:15 hardaker
+
+ * agent/mibgroup/target/snmpTargetParamsEntry.c:
+
+ allow unregistered security models <= 2
+
+2002-11-04 08:14 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ enable row creation to be better supported (rowstatus no longer has to
+ be first in the list, ...)
+
+2002-11-04 08:13 hardaker
+
+ * net-snmp-config.in:
+
+ add cppflags to --cflags
+
+2002-11-04 08:13 hardaker
+
+ * NEWS:
+
+ add stuff for 5.0.7 (or whatever) mentioning a few new features.
+
+2002-11-01 09:06 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Fixed bug #632094 using the suggested method: watch for NULL strerror() return
+
+2002-11-01 07:09 rstory
+
+ * Makefile.in:
+
+ undo my changes from r 5.17, attempting to reduce runs of config.status
+ by using explicit paths to srcdir, and let VPATH do it's thing
+
+2002-10-29 11:30 rstory
+
+ * snmplib/Makefile.in:
+
+ target to build binary array test app; tweak to parse test target (reduces most
+ but not all external references)
+
+2002-10-29 11:27 rstory
+
+ * snmplib/container_binary_array.c:
+
+ fix for binary search problem noted by Romy Christensen on coders; partial
+ (ifdef'd out) code for a binary array iterator
+
+2002-10-29 11:25 rstory
+
+ * snmplib/test_binary_array.c:
+
+ simple test program for binary array
+
+2002-10-29 06:28 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Fix debugging as noted in bug #630348
+
+2002-10-28 16:47 hardaker
+
+ * configure, configure.in:
+
+ changed .1.6.3 to 1.3.6 as noted in comp.protocols.snmp
+
+2002-10-28 12:01 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.conf:
+
+ changed password
+
+2002-10-28 11:57 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.conf:
+
+ misc vacm fixes
+
+2002-10-28 05:41 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - remove erroneous free() of rxbuf
+
+2002-10-25 09:35 hardaker
+
+ * snmplib/snmp_api.c:
+
+ fixed SNMP_CALLBACK_OP_DISCONNECT -> NETSNMP_OP_CALLBACK_DISCONNECT as noted by TrogL on IRC
+
+2002-10-25 04:34 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - perform a NETSNMP_CALLBACK_OP_DISCONNECT type callback if we
+ decide to shutdown a stream type connection because we received
+ an excessively large packet.
+
+2002-10-24 07:41 hardaker
+
+ * README:
+
+ Added the super-bug-patch generator Stefan Radman to the THANKS list
+
+2002-10-24 07:40 hardaker
+
+ * configure.in:
+
+ bug #617508: added the mta_sendmail module to --help
+
+2002-10-24 07:35 hardaker
+
+ * local/Makefile.in:
+
+ update install list for mib2c conf files and remove old one
+
+2002-10-23 17:34 hardaker
+
+ * configure, configure.in:
+
+ fix incorrect variable name I noticed when copying to a different configure script in another package
+
+2002-10-23 17:28 hardaker
+
+ * Makefile.in:
+
+ Fixed bug#617838: versiontag isn't distributed and shouldn't be always
+ used in the make distclean calls.
+
+2002-10-23 17:12 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ inconsequencial memory leaks fixed (init time leaks).
+
+2002-10-23 17:10 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Fixed various memory leaks in the table_iterator as pointed out by
+ Roger McCalman and Jay Parlar on the -coders list (including their patches)
+
+2002-10-23 15:44 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ snmpNotifyTable.c
+
+2002-10-23 15:40 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ free a previously malloced pointer to the watch variable before replacing it.
+
+2002-10-23 15:40 hardaker
+
+ * agent/mibgroup/examples/delayed_instance.c:
+
+ remove duplicate unused malloc.
+
+2002-10-21 09:43 jbpn
+
+ * include/net-snmp/system/solaris2.9.h:
+
+ - add system file for Solaris 9
+
+2002-10-17 19:44 hardaker
+
+ * agent/agent_registry.c, agent/snmp_agent.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ include/net-snmp/agent/agent_callbacks.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/library/vacm.h, snmplib/vacm.c:
+
+ Optimized the VACM checks in the case of getnext/getbulk so that when
+ large portions of the mib tree are excluded, the sub-mib access code
+ won't be called at all (finally implementing a very long needed optimization).
+
+2002-10-17 19:41 hardaker
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ new function to find the commonality between two oids: netsnmp_oid_find_prefix
+
+2002-10-17 19:39 hardaker
+
+ * Makefile.in, aclocal.m4, configure,
+ configure.in:
+
+ Print out a "summary" at the end of a run
+
+2002-10-17 02:40 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Properly terminate a loop construct (missing '@end@')
+ Spotted by Karl Cooper. Oops!
+
+2002-10-16 14:19 rstory
+
+ * agent/snmpd.c:
+
+ restore continue after EINTR caused by signal we handled (instead of falling
+ thorough to exit!)
+
+2002-10-16 14:00 rstory
+
+ * agent/snmpd.c:
+
+ check for our signal flags on EINTR, and only relesect if not changed;
+ debug msg when signals registered and for select/fdsets;
+
+2002-10-16 12:52 rstory
+
+ * Makefile.top:
+
+ move CPPFLAGS before user configure CFLAGS.. so if a user adds something
+ like /usr/local/include to CFLAGS, we will pick up our local includes first,
+ instead of includes from a previous release..
+
+2002-10-15 21:06 rstory
+
+ * apps/: snmptrapd.c, snmptrapd_log.c, snmptrapd_log.h
+:
+
+ make sure snmptrapd always honors DS_APP_NUMERIC_IP for logging
+
+2002-10-15 14:09 rstory
+
+ * snmplib/mib.c:
+
+ netsnmp_get_boolean -> netsnmp_ds_get_boolean
+
+2002-10-15 11:08 rstory
+
+ * agent/helpers/table.c:
+
+ fix constant used in assert, noted on coders
+
+2002-10-15 11:07 rstory
+
+ * agent/snmp_agent.c:
+
+ include syslog for libwrap log levels
+
+2002-10-15 07:39 hardaker
+
+ * man/snmpcmd.1.def:
+
+ Add yet another way to specify v6 addresses
+
+2002-10-14 08:54 hardaker
+
+ * man/snmpcmd.1.def:
+
+ fix ipv6 transport address specs
+
+2002-10-11 16:18 hardaker
+
+ * README.cmu, dist/net-snmp.spec:
+
+ Remove the README.cmu file (entirely out of date at this point).
+
+2002-10-11 13:57 hardaker
+
+ * acconfig.h, configure, configure.in,
+ agent/mibgroup/ucd-snmp/disk.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ patch #600933 from Donal Diamond: dskPercentNode for FreeBSD4
+
+2002-10-11 13:49 hardaker
+
+ * snmplib/mib.c:
+
+ Patch #598280 from Jeff Watson: make -OQ not print type warnings.
+
+2002-10-11 13:43 hardaker
+
+ * dist/Makefile:
+
+ fix include directory
+
+2002-10-11 13:42 hardaker
+
+ * dist/.cvsignore:
+
+ ignore rpm subdir
+
+2002-10-11 13:32 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ better docs about auto-extracted SF news
+
+2002-10-11 13:04 hardaker
+
+ * dist/: Makefile, net-snmp.spec:
+
+ merge in patch #598869: Mark Harig's better rpm stuff
+
+2002-10-11 12:21 hardaker
+
+ * include/net-snmp/library/default_store.h, snmplib/mib.c
+:
+
+ Alternative to a patch suggestion: add -OU to not print UNITS suffixes.
+
+2002-10-11 12:18 hardaker
+
+ * man/snmpcmd.1.def:
+
+ ../agent/snmp_agent.c
+
+2002-10-11 12:14 hardaker
+
+ * man/snmp.conf.5.def:
+
+ document dontPrintUnits
+
+2002-10-11 11:48 hardaker
+
+ * agent/snmp_agent.c:
+
+ Patch #617151 from Andrew Rucker Jones: fix libwrap headers.
+ - I'm still unhappy with how libwrap functions... needs thinking about.
+
+2002-10-11 10:53 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Patch #312694 from John Surveyor: fix diskio on solaris.
+
+2002-10-11 10:37 hardaker
+
+ * agent/mibgroup/mibII/at.c:
+
+ Applied patch #621398 from Matthew Krenzer to fix linux arp table.
+
+2002-10-11 06:47 rstory
+
+ * win32/snmpdsdk/snmpd.dsp:
+
+ chg netsnmpmibs -> netsnmpmibsskd (noted on coders by Jed Whitten)
+
+2002-10-11 06:45 jbpn
+
+ * man/snmpcmd.1.def:
+
+ - note square brackets for IPv6 addresses
+
+2002-10-11 06:40 jbpn
+
+ * agent/snmpd.c:
+
+ - restart select() more quickly if an EINTR happens
+
+2002-10-10 22:51 hardaker
+
+ * FAQ:
+
+ applied Harrie's patch describing low memory footprints
+
+2002-10-10 08:38 hardaker
+
+ * snmplib/snmpksm.c:
+
+ Patch from Ken Horstein to fix KSM module
+
+2002-10-10 03:22 jbpn
+
+ * agent/helpers/table_array.c:
+
+ - remove bad inlines which cause file not to compile with Sun CC.
+ See bug #620827.
+
+2002-10-09 23:03 hardaker
+
+ * dist/net-snmp.spec:
+
+ add .la files
+
+2002-10-09 23:00 hardaker
+
+ * dist/net-snmp.spec:
+
+ make the .spec file almost usable.
+
+2002-10-08 15:55 hardaker
+
+ * FAQ:
+
+ FAQ updates for download sites.
+
+2002-10-08 07:36 hardaker
+
+ * perl/OID/OID.pm:
+
+ Patch from Joshua Keroes for string comparisons
+
+2002-10-07 10:57 hardaker
+
+ * FAQ:
+
+ added a statement about the COPYING file (suggested by Harrie)
+
+2002-10-06 11:32 rstory
+
+ * dist/README.build-scripts:
+
+ nsb-* likes full paths, update examples; fix sourceforge upload site
+
+2002-10-05 14:42 hardaker
+
+ * README, sedscript.in, snmplib/snmp_version.c
+, FAQ, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.6 )
+
+2002-10-05 14:42 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_multiplexer.3, netsnmp_old_api.3,
+ netsnmp_read_only.3, netsnmp_scalar.3,
+ netsnmp_serialize.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_watcher.3:
+
+ make docs
+
+2002-10-05 14:41 hardaker
+
+ * ChangeLog, NEWS:
+
+ update for 5.0.6
+
+2002-10-05 14:38 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ misc updates
+
+2002-10-05 14:29 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2002-10-05 14:09 hardaker
+
+ * Makefile.top:
+
+ update for 5.0.6
+
+2002-10-05 14:08 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ remove illegal flag from nsb-config
+
+2002-10-05 13:41 rstory
+
+ * agent/snmp_agent.c:
+
+ efence is your friend: don't allocate 0 bytes
+
+2002-10-05 12:58 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ efence is your friend: don't reference ptr after is has been free'd.
+
+2002-10-04 07:17 hardaker
+
+ * agent/snmp_agent.c:
+
+ fix secondary effect of bug 613983 and really fix it this time.
+
+2002-10-02 10:56 hardaker
+
+ * agent/mibgroup/tunnel/: tunnel.c (V4-2-patches.2), tunnel.c
+:
+
+ Patch from Frank Strauss to fix some coding errors
+
+2002-10-01 07:39 rstory
+
+ * agent/snmp_vars.c:
+
+ offical patch 617049: initialize container list earlier (in init_agent)
+
+2002-10-01 07:35 rstory
+
+ * agent/snmp_vars.c:
+
+ remove ^M characters (damn windows editors)
+
+2002-09-30 15:17 rstory
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.5 )
+
+2002-09-30 15:16 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ add info on md5sums and gpg signing
+
+2002-09-30 15:15 rstory
+
+ * dist/cvsup:
+
+ fix chmod to do what I wanted, not what I told it
+
+2002-09-30 15:14 rstory
+
+ * ChangeLog, Makefile.top, NEWS:
+
+ update for 5.0.5
+
+2002-09-30 14:27 rstory
+
+ * ChangeLog:
+
+ merge pre changes into 5.0.4 comments
+
+2002-09-30 14:25 rstory
+
+ * NEWS:
+
+ update for 5.0.4
+
+2002-09-30 14:23 hardaker
+
+ * NEWS:
+
+ NEWS updates for 5.0.4
+
+2002-09-30 14:03 rstory
+
+ * README:
+
+ update my email address
+
+2002-09-30 14:03 rstory
+
+ * ChangeLog:
+
+ update for release 5.0.4
+
+2002-09-30 13:08 rstory
+
+ * agent/helpers/table.c:
+
+ make len a size_t to fix problem on 64 bit system, reported by sebnod` in IRC
+
+2002-09-30 13:05 rstory
+
+ * agent/helpers/table.c:
+
+ don't use static local vars, as they are likely to cause problems with threads
+
+2002-09-30 12:48 rstory
+
+ * dist/nsb-package:
+
+ make sure install dir is relative to build dir
+
+2002-09-30 12:20 rstory
+
+ * snmplib/vacm.c:
+
+ add missing newline in debug
+
+2002-09-30 12:19 rstory
+
+ * dist/: nsb-functions, nsb-package:
+
+ fix typos
+
+2002-09-30 12:18 rstory
+
+ * agent/snmp_agent.c:
+
+ avoid infinite loop
+
+2002-09-30 11:59 rstory
+
+ * dist/nsb-functions:
+
+ don't assume make is GNU make, and search for it. require user to set an
+ env var if no GNU make is found in PATH
+
+2002-09-30 11:58 rstory
+
+ * dist/cvsup:
+
+ if CVS dir is ro, automagically make it rw before update and ro after update
+
+2002-09-27 11:03 hardaker
+
+ * agent/snmp_agent.c:
+
+ make get_set_cache() return an error if no previous SET has been started.
+
+2002-09-27 11:02 hardaker
+
+ * agent/agent_registry.c:
+
+ double check against some null pointers before using them in the cache code.
+
+2002-09-27 10:36 hardaker
+
+ * agent/snmp_agent.c:
+
+ set treecache_num to -1 at init of memory, to be extra safe.
+
+2002-09-26 11:58 hardaker
+
+ * agent/: snmp_agent.c, snmpd.c:
+
+ move libwrap variables
+
+2002-09-26 11:57 hardaker
+
+ * perl/agent/agent.xs:
+
+ ok, remove tcpwrappers vars
+
+2002-09-26 10:44 hardaker
+
+ * perl/agent/agent.xs:
+
+ define stupid variables needed by tcpwrappers because they don't get
+ concepts of encapsulation. arg.
+
+2002-09-26 08:26 hardaker
+
+ * perl/agent/agent.xs:
+
+ change call_pv to perl_call_pv for older versions of perl.
+
+2002-09-26 08:10 hardaker
+
+ * snmplib/mib.c:
+
+ run strdup() on get_mib_dir() results to fix bug pointed out by Eugene Bruk.
+
+2002-09-23 10:14 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ mention freshmeat
+
+2002-09-23 10:13 hardaker
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/versioninfo.h, mibs/UCD-SNMP-MIB.txt
+:
+
+ - implement a (long needed) settable variable to store the current
+ persistent information.
+
+2002-09-23 09:47 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - make not in time window reports trigger a resend of informs.
+ (suggestion from Erik Anggard)
+
+2002-09-20 08:28 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.h:
+
+ - remove functions vacm_parse_security and vacm_free_security which
+ don't exist
+
+2002-09-19 14:01 hardaker
+
+ * perl/agent/agent.xs:
+
+ - support agent shutdowns (well, ok it's just an api since it doesn't work).
+ - misc bug fixes.
+
+2002-09-19 13:38 hardaker
+
+ * perl/agent/: agent.xs, netsnmp_request_infoPtr.pm:
+
+ fix agent request_infoPtr problems.
+
+2002-09-19 09:04 dts12
+
+ * win32/snmptranslate/snmptranslate.dsp:
+
+ Compile and link with 'getopt.c' explicitly.
+
+ This should not be necessary, but for some reason
+ (that completely escapes me!), using command-line options
+ (such as -IR) with the Release version of snmptranslate
+ causes a run-time DLL error. (The Debug version is fine).
+ The other applications seem to be OK - this problem only
+ seems to hit snmptranslate. So as a sticking-plaster,
+ compiliing getopt.c in as part of the project, keeps both
+ versions of the application happy.
+ Someone with better Windows knowledge than me needs to
+ look at this and fix it properly.
+
+2002-09-19 03:14 jbpn
+
+ * include/net-snmp/library/snmp_api.h:
+
+ - undo worst of indent damage
+
+2002-09-19 03:03 jbpn
+
+ * include/net-snmp/library/snmp_api.h:
+
+ - remove _dparse functions (which don't exist)
+
+2002-09-18 07:55 hardaker
+
+ * testing/eval_tools.sh:
+
+ reset SNMP_SLEEP after loop
+
+2002-09-18 07:41 jbpn
+
+ * snmplib/snmp_client.c:
+
+ - remove very obsolete (and not used anywhere) #definitions of
+ PARTY_MIB_BASE and CONTEXT_MIB_BASE
+
+2002-09-17 23:59 rstory
+
+ * ChangeLog:
+
+ tweak for 5.0.4 last minute update
+
+2002-09-17 23:48 rstory
+
+ * testing/eval_tools.sh:
+
+ chg > to -gt to achieve intended result
+
+2002-09-17 22:39 rstory
+
+ * NEWS:
+
+ update for 5.0.4
+
+2002-09-17 22:33 rstory
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.4 )
+
+2002-09-17 22:32 rstory
+
+ * ChangeLog:
+
+ update for 5.0.4
+
+2002-09-17 21:59 rstory
+
+ * Makefile.in:
+
+ add $(srcdir) to a few dependencies to try and reduce the # of times that
+ config.status is run when building outside the src dir
+
+2002-09-17 21:54 rstory
+
+ * README.win32:
+
+ visually provocative section headers; add recent status (all bad news);
+ not to use new win32sdk.dsw to get additonal functionality with platform sdk;
+ remove info on removing agentx, as it's been around now for a while; add
+ section on what files to edit to add mib2c generated code to agent; remove
+ reference to specific release number in example
+
+2002-09-17 21:25 rstory
+
+ * win32/snmpdsdk/snmpd.dsp:
+
+ take 'sdk' out of exe name
+
+2002-09-17 21:25 rstory
+
+ * win32/win32sdk.dsw:
+
+ swap snmpdsdk for snmpd
+
+2002-09-17 21:14 rstory
+
+ * win32/: encode_keychange/encode_keychange.dsp,
+ libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp_dll.dsp,
+ snmpbulkget/snmpbulkget.dsp, snmpbulkwalk/snmpbulkwalk.dsp
+, snmpd/snmpd.dsp, snmpdelta/snmpdelta.dsp,
+ snmpdf/snmpdf.dsp, snmpget/snmpget.dsp,
+ snmpgetnext/snmpgetnext.dsp, snmpnetstat/snmpnetstat.dsp
+, snmpset/snmpset.dsp, snmpstatus/snmpstatus.dsp,
+ snmptable/snmptable.dsp, snmptest/snmptest.dsp,
+ snmptranslate/snmptranslate.dsp, snmptrap/snmptrap.dsp,
+ snmptrapd/snmptrapd.dsp, snmpusm/snmpusm.dsp,
+ snmpvacm/snmpvacm.dsp, snmpwalk/snmpwalk.dsp:
+
+ get all our ducks in a row: add advapi32.lib to link lines, make sure all
+ Release and Debug libs/apps are compile with same C++ settings
+
+2002-09-17 21:12 rstory
+
+ * win32/netsnmpmibs/netsnmpmibs.dsp:
+
+ remove sdk dependent modules
+
+2002-09-17 21:10 rstory
+
+ * win32/mib_module_inits.h:
+
+ group modules that depend on win32 sdk together, with ifdef
+
+2002-09-17 21:08 rstory
+
+ * agent/snmp_vars.c:
+
+ no callback for win32 until pipe fd problem is fixed
+
+2002-09-17 21:07 rstory
+
+ * win32/: netsnmpmibssdk/netsnmpmibssdk.dsp,
+ snmpdsdk/snmpd.dsp:
+
+ new versions for sdk users
+
+2002-09-17 21:05 rstory
+
+ * win32/win32sdk.dsw:
+
+ new workspace for sdk users
+
+2002-09-16 13:27 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ mib module loading fixes by calling init_snmp first
+
+2002-09-13 12:05 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ tweak example nsb-config command; add -b back to cvs2cl, otherwise you
+ get changelog msgs from other branches and have to weed them out
+
+2002-09-13 09:33 hardaker
+
+ * perl/OID/: OID.pm, OID.xs, test.pl:
+
+ fix illegal oids to not return a pointer.
+
+2002-09-13 07:40 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ - minor optimisation; we don't need a zero-terminated community
+ string except for debugging output.
+
+2002-09-13 07:35 hardaker
+
+ * local/mib2c:
+
+ added -i option to request indent not be run
+
+2002-09-13 07:06 jbpn
+
+ * COPYING:
+
+ - add missing verb in introduction
+
+2002-09-12 12:58 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ protect calling some SvIV dereference functions if it's not an IV.
+ - eliminates the remaining perl warnings.
+
+2002-09-12 11:45 hardaker
+
+ * net-snmp-config.in:
+
+ include ldflags where appropriate (--libs, --agent-libs, ...)
+
+2002-09-11 22:48 rstory
+
+ * dist/: nsb-nightly, nsb-package:
+
+ add/use new option to remove build dir after successful build
+
+2002-09-11 22:47 rstory
+
+ * dist/nsb-functions:
+
+ print build dir
+
+2002-09-11 22:19 hardaker
+
+ * testing/tests/: Sv3config, T030snmpv3usercreation:
+
+ much more complex tests of USM user creation/modification.
+
+2002-09-11 22:07 hardaker
+
+ * testing/: eval_tools.sh, tests/T001snmpv1get,
+ tests/T002snmpv1getnext, tests/T003snmpv1getfail,
+ tests/T004snmpv1nosuch:
+
+ - support for multiple tests at once.
+ - merge v1 tests into a single (faster) test.
+
+2002-09-11 21:34 rstory
+
+ * dist/nsb-functions:
+
+ don't monkey around with returning error codes, just exit; more regexp tweaks
+
+2002-09-11 16:36 hardaker
+
+ * testing/eval_tools.sh:
+
+ - use sub-second sleeps if available
+ - sleep 1 (sub-)second at a time when waiting for particular tests
+ rather than the full SNMP_SLEEP duration.
+
+2002-09-11 16:24 hardaker
+
+ * apps/snmptrapd.c:
+
+ use snmp_log instead of printf for shutdown message.
+
+2002-09-11 15:42 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ missing variable decl pointed out by irc:df
+
+2002-09-10 13:16 rstory
+
+ * dist/nsb-functions:
+
+ tweak error regexps & error messages
+
+2002-09-10 12:28 rstory
+
+ * local/mib2c.array-user.conf:
+
+ compiler warnings are your friend!; fix embeded comments; fix non-void
+ functions w/no rtn values; code reorg to fix emacs indent complaints
+
+2002-09-10 12:26 rstory
+
+ * Makefile.in:
+
+ new start-flag end-flag targets to help nightly build script determine
+ if a make completed successfully
+
+2002-09-10 12:12 rstory
+
+ * dist/nsb-functions:
+
+ tweaks for new script for automated nightly builds; ad nsb-abort, nsb-flow;
+ direct some messages to stderr; use new start-flag end-flag make targets;
+ update error grep to include '***'; check for new value to rm -fR build dir
+
+2002-09-10 12:08 rstory
+
+ * dist/nsb-nightly:
+
+ new script for automated nightly builds
+
+2002-09-10 12:08 rstory
+
+ * dist/nsb-package:
+
+ add option to rm -fR build dir at start; check scrip path for nsb-functions;
+ prefix default build dir w/version; exit w/rc from nsb-build
+
+2002-09-10 12:05 rstory
+
+ * dist/: nsb-config, nsb-platform:
+
+ add current path to script to nsb-function search path
+
+2002-09-09 06:28 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - fix bug pointed out by Jared Smith-Mickelson (bug #605147)
+ whereby passing an unknown type character to snmp_add_var would
+ cause a segfault.
+
+2002-09-09 06:09 hardaker
+
+ * apps/snmptranslate.c:
+
+ double check a pointer value before using it.
+
+2002-09-09 06:09 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Current header update patch for netbsd from Patrick Welche.
+
+2002-09-06 15:30 driehuis
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ Mark the non-raw variants of objects that are accessable as raw counters
+ as deprecated, to (hopefully!) cut down on the number of users that get
+ bitten by it..
+
+2002-09-04 11:36 hardaker
+
+ * README.solaris:
+
+ added Bruce's email address
+
+2002-09-04 11:27 hardaker
+
+ * Makefile.in, Makefile.rules:
+
+ fix perlclean
+
+2002-09-04 11:10 hardaker
+
+ * agent/snmpd.c:
+
+ Fix process grouping by calling setsid() (reported by irc:TrogL)
+
+2002-09-04 11:09 hardaker
+
+ * configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ check for setsid().
+
+2002-09-03 10:51 hardaker
+
+ * local/mib2c:
+
+ fix cases where there either are no tables or no scalars.
+
+2002-09-03 10:23 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ don't use NULL variables.
+
+2002-09-02 19:33 rstory
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.4.pre2 )
+
+2002-09-02 19:33 rstory
+
+ * ChangeLog:
+
+ update for release 5.0.4.pre2
+
+2002-09-02 19:22 rstory
+
+ * man/netsnmp_handler.3:
+
+ updated docs
+
+2002-09-02 19:19 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2002-09-02 19:16 rstory
+
+ * dist/nsb-config:
+
+ try and guess at src dir if not specified
+
+2002-09-02 19:15 rstory
+
+ * dist/README.build-scripts:
+
+ add note about err when building in and out of source tree
+
+2002-09-02 18:55 rstory
+
+ * Makefile.in:
+
+ full path to versiontag, in case we are buildint outside of src directory
+
+2002-09-02 18:37 rstory
+
+ * dist/nsb-functions:
+
+ remove forced prompt on errors
+
+2002-09-02 18:36 rstory
+
+ * Makefile.in:
+
+ add warnings when VERSION is required; add tarclean target; add tarclean to
+ distclean target
+
+2002-09-02 18:34 rstory
+
+ * agent/mibgroup/versiontag:
+
+ add msg on error; add clean target
+
+2002-09-02 17:27 rstory
+
+ * NEWS:
+
+ update win32 & AgentX status
+
+2002-09-02 17:20 rstory
+
+ * agent/snmp_agent.c, agent/mibgroup/agentx/master_admin.c
+, include/net-snmp/agent/snmp_agent.h:
+
+ fix to avoid locking up the agent when a sugagent dies during a set request. We
+ must clean up the delegated requests when the session(s) are closed, so that
+ they will be processed and removed, allowing further requests to be processed.
+
+2002-09-01 10:43 rstory
+
+ * snmplib/container_binary_array.c:
+
+ change result type back to int, as it may receive a negative value
+
+ PLEASE check the use of a variable before changing is signedness, especially
+ areound release time!
+
+2002-08-30 12:18 rstory
+
+ * include/net-snmp/utilities.h:
+
+ include check_varbind.h
+
+2002-08-30 12:18 rstory
+
+ * agent/helpers/table_array.c:
+
+ change NOSUCHNAME to NOSUCHINSTANCE again, as it seems the agentX fix also
+ correctly deals with this error code
+
+2002-08-30 06:14 hardaker
+
+ * FAQ, README:
+
+ - delete sunsite.cnlab-switch.ch mirror, as it isn't one anymore.
+
+2002-08-29 10:32 rstory
+
+ * dist/nsb-functions:
+
+ check for modules before configuring them
+
+2002-08-29 07:52 hardaker
+
+ * snmplib/scapi.c:
+
+ Fix the last AES bug I know of. AES128 works great.
+ I still Need to fix 192/256 for longer key generation from MD5/SHA
+
+2002-08-29 07:52 hardaker
+
+ * perl/agent/agent.pm:
+
+ use the right perl module name in the use line.
+
+2002-08-29 03:47 dts12
+
+ * agent/agent_handler.c, agent/mibgroup/agentx/master.c
+, include/net-snmp/agent/agent_registry.h,
+ win32/config.h:
+
+ More Win32-related tidying up.
+ The agent now compiles with relatively few warnings.
+
+2002-08-29 01:50 dts12
+
+ * agent/agent_trap.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/utilities/override.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/library/mt_support.h,
+ snmplib/container_binary_array.c, snmplib/snmpusm.c,
+ win32/config.h, win32/libsnmp_dll/libsnmp.def:
+
+ Declare new routine 'netsnmp_oid_equals', and assorted Win32 cleanup fixes.
+
+2002-08-28 11:15 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ clarify cvs2cl script name; remove -b flag from cvs2cl per Dave; a little
+ reorganization; put commands on separate lines prefixed with $; note 5.x/4.x
+ differences per Dave's email; plug my new scripts where appropriate
+
+2002-08-27 11:48 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ add URL for cvs2cl; update cvs2cl cmds to cvs2cl.pl, since that's the file
+ that's actually distributed
+
+2002-08-26 21:59 rstory
+
+ * Makefile.top:
+
+ update for release 5.0.4.pre1
+
+2002-08-26 21:25 rstory
+
+ * snmplib/snmp_version.c, FAQ, README,
+ sedscript.in, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.4.pre1 )
+
+2002-08-26 21:24 rstory
+
+ * ChangeLog:
+
+ update for release 5.0.4.pre1
+
+2002-08-26 21:19 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2002-08-26 21:17 rstory
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_multiplexer.3, netsnmp_old_api.3,
+ netsnmp_read_only.3, netsnmp_scalar.3,
+ netsnmp_serialize.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_watcher.3:
+
+ update man pages for 5.0.4.pre1
+
+2002-08-26 21:10 rstory
+
+ * dist/nsb-config:
+
+ new file to configure using same options as nsb-package for test or dist
+
+2002-08-26 21:09 rstory
+
+ * dist/nsb-package:
+
+ don't append sys-name when building in src tree
+
+2002-08-26 21:09 rstory
+
+ * dist/nsb-functions:
+
+ fix typo
+
+2002-08-26 21:06 rstory
+
+ * dist/nsb-functions:
+
+ rename nsb-get-confg -> nsb-config-dist; use double quotes cuz of some
+ wierd shell thing I don't yet understand; check for src dir in config*
+
+2002-08-26 20:34 rstory
+
+ * Makefile.in:
+
+ tweak commentcheck target to work outside the source tree
+
+2002-08-26 20:33 rstory
+
+ * agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ include/net-snmp/library/asn1.h,
+ include/net-snmp/library/oid_stash.h, snmplib/winservice.c
+:
+
+ remove C++ style comments (and anything that even remotely resembles one)
+
+2002-08-26 14:47 rstory
+
+ * dist/nsb-functions:
+
+ pass make params to make, so we don't try to install in /usr/local/bin of
+ the compile servers...:-/
+
+2002-08-26 14:39 rstory
+
+ * dist/nsb-functions:
+
+ make dist & extra transports; no ipv6 on Darwin; make touchit before make
+
+2002-08-26 14:04 rstory
+
+ * agent/mibgroup/Rmon/event.c:
+
+ replace u_int32_t, which doesn't compile on Sun 5.8, with u_int
+
+2002-08-26 13:53 rstory
+
+ * agent/mibgroup/Rmon/rows.c:
+
+ fix undeclared variable error spotted on Sun, which linux missed completely.
+ I have no idea how this compiled before!!
+
+2002-08-26 13:43 rstory
+
+ * dist/nsb-functions:
+
+ cleaner way to add system specific modules; disable perl, as it breaks
+ builds outside of the source tree
+
+2002-08-26 12:45 rstory
+
+ * dist/nsb-functions:
+
+ only configure IPX on Linux
+
+2002-08-26 12:44 rstory
+
+ * dist/nsb-functions:
+
+ only configure IPX on Linux; bail on configure errors
+
+2002-08-26 12:04 rstory
+
+ * dist/README.build-scripts:
+
+ add suggestion to symlink nsb-* in local bin dir
+
+2002-08-26 12:03 rstory
+
+ * dist/: nsb-package, nsb-functions:
+
+ add option for pre-release test configure options
+
+2002-08-26 12:02 rstory
+
+ * README.snmpv3:
+
+ make section headers stand out more; move note about encryption not being
+ enabled to a more prominent place.
+
+2002-08-22 05:31 jbpn
+
+ * include/net-snmp/system/solaris2.7.h:
+
+ - DONT_USE_NLIST reinstated, so NO_KMEM_USAGE redundant
+
+2002-08-22 05:29 jbpn
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ - reinstate test for DONT_USE_NLIST
+
+2002-08-22 04:11 jbpn
+
+ * agent/snmpd.c:
+
+ - stop and restart logging when HUPped. This allows logfiles to be
+ rotated and so forth.
+
+2002-08-22 01:31 dts12
+
+ * README.snmpv3:
+
+ Add the missing '-x/X' options to the example authPriv command line
+ (reported by Prasada R Vankayalapati)
+
+2002-08-20 08:04 hardaker
+
+ * agent/mibgroup/agentx/subagent.c, apps/snmptrapd.c,
+ include/net-snmp/agent/ds_agent.h, FAQ:
+
+ quiet snmptrapd when it can't connect to the agentx master.
+
+2002-08-20 05:54 jbpn
+
+ * include/net-snmp/system/solaris2.7.h:
+
+ - add #define NO_KMEM_USAGE 1 since net-snmp-config.h.in no longer
+ pays attention to the DONT_USE_NLIST token. Omission of this
+ causes the agent to exit with the message "init_kmem: kvm_open
+ failed: error 0".
+
+ NOTE: this may need applying to other members of the Solaris 2
+ family, but I don't have machines to hand to test this.
+
+2002-08-20 05:48 jbpn
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - detect gigabit ethernet devices (geN)
+ - undo indent mayhem
+
+2002-08-20 02:57 jbpn
+
+ * include/net-snmp/utilities.h:
+
+ - for now, don't #include snmp_locking.h since it breaks re-entrant
+ support (because mutex_type gets multiply-defined). Furthermore, the
+ functions it declares are never used anywhere, nor defined anywhere.
+
+2002-08-20 02:56 jbpn
+
+ * include/net-snmp/library/mt_support.h:
+
+ - don't define "do nothing" macros for snmp_res_lock et al. functions
+ on Win32 platform (since real "do nothing" functions are required for
+ reasons best known to someone else).
+ - unmangling
+
+2002-08-20 02:54 jbpn
+
+ * include/net-snmp/library/snmp_locking.h:
+
+ - fix highly bogus non-C syntax
+
+2002-08-20 02:53 jbpn
+
+ * snmplib/mt_support.c:
+
+ - snmp_res_lock et al. functions no longer #defined to "do nothing"
+ targets for Win32 in mt_support.h, therefore no need to #undef them
+ here.
+ - unmangling
+
+2002-08-19 22:13 hardaker
+
+ * include/net-snmp/agent/agent_registry.h:
+
+ headers for cache enabling functions.
+
+2002-08-19 22:12 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ don't use non-existent memory pointers to the response data (eg: "timeout")
+
+2002-08-19 14:46 nba
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ Change a few conditionals to use #if in place of #ifdef
+
+2002-08-19 14:28 nba
+
+ * snmplib/: mib.c, parse.c:
+
+ Align with 4.2 branch
+
+2002-08-19 14:26 nba
+
+ * mibs/: DISMAN-SCHEDULE-MIB.txt,
+ IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt, IANAifType-MIB.txt
+, INET-ADDRESS-MIB.txt, Makefile.mib, ianalist
+, mibfetch, rfclist:
+
+ Update to current MIBs
+
+2002-08-19 14:25 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Bail out for bad snmpAdminString value
+
+2002-08-19 07:43 jbpn
+
+ * FAQ (V4-2-patches.3), FAQ:
+
+ - don't use positional community parameter in examples
+ - break a couple of over-long lines
+ - mention netsnmp_ variant of ds_set_ function
+
+2002-08-19 02:44 dts12
+
+ * FAQ (V4-2-patches.2), FAQ:
+
+ Add an entry about the snmptrapd/AgentX warning message.
+
+2002-08-18 18:24 rstory
+
+ * dist/nsb-functions:
+
+ don't configure with build install dir, it is already specified on cmd line
+ for make install
+
+2002-08-18 10:59 rstory
+
+ * agent/helpers/table.c:
+
+ more debugging - log value request is trying to set
+
+2002-08-16 15:13 hardaker
+
+ * README:
+
+ added Bruce Shaw to the thanks list
+
+2002-08-16 15:12 hardaker
+
+ * README.solaris:
+
+ A great update talking about perl and solaris from Bruce Shaw
+
+2002-08-16 01:51 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Catch explicitly 'noSuchInstance' exceptions, when walking an
+ iterator-handled module, so that holes can be skipped and the
+ next real instance retrieved. (This was already handled for
+ modules that didn't mark missing instances explicitly).
+
+2002-08-16 00:17 hardaker
+
+ * agent/snmp_agent.c:
+
+ turn off caching by default, since the agentx code appears broken.
+
+2002-08-16 00:03 hardaker
+
+ * agent/: agent_registry.c, snmp_agent.c:
+
+ speed enhancements via implementing a registration subtree lookup
+ cache. greatly speeds things up when similar requests come in
+ (snmpwalk, ...).
+
+2002-08-15 10:35 hardaker
+
+ * snmplib/parse.c:
+
+ protect against NULL labels in subtrees
+
+2002-08-15 08:14 hardaker
+
+ * agent/agent_index.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/helpers/old_api.c,
+ agent/mibgroup/header_complex.c, agent/mibgroup/testhandler.c
+, snmplib/snmp_transport.c, snmplib/snmpusm.c:
+
+ use netsnmp_oid_equals (which is sometimes faster than
+ snmp_oid_compare) in a few places to achieve barely noticeable speed gains.
+
+2002-08-15 08:12 hardaker
+
+ * snmplib/parse.c:
+
+ double check a pointer exists before passing it to strcmp()
+
+2002-08-15 08:05 hardaker
+
+ * perl/SNMP/Makefile.PL:
+
+ change MAN3PODS to something compliant with the perl manuals. I think.
+
+2002-08-14 10:42 rstory
+
+ * apps/snmpset.c:
+
+ add debug for local parsing of args
+
+2002-08-14 09:26 rstory
+
+ * agent/mibgroup/agentx/: master.c, master_admin.c,
+ subagent.c:
+
+ add more detailed in debug messages; add a few new debugs
+
+2002-08-14 09:23 rstory
+
+ * agent/snmp_agent.c:
+
+ when all delegated requests have finished, check all requests status so that
+ asp status is set, which is necessary for correct agentx set processing.
+ (now if I can just get all this hair off the floor, and glue it back to my
+ head, and then fix that dent in the wall where I've been banging my head....)
+
+2002-08-13 14:25 hardaker
+
+ * snmplib/snmp_api.c:
+
+ fix a length comparison problem with netsnmp_oid_is_subtree()
+
+2002-08-13 14:24 hardaker
+
+ * NEWS:
+
+ document a few recent changes.
+
+2002-08-13 14:05 hardaker
+
+ * agent/mibgroup/host/hr_print.c:
+
+ Fix open file runaway on solaris. See bug #592806 reported by James Irwin.
+
+2002-08-13 12:05 rstory
+
+ * include/net-snmp/types.h:
+
+ array of pointers = pointer to a pointer
+
+2002-08-09 16:32 hardaker
+
+ * local/FAQ2HTML:
+
+ misc doc fixes.
+
+2002-08-09 16:31 hardaker
+
+ * snmplib/snmp_parse_args.c,
+ include/net-snmp/library/transform_oids.h, snmplib/snmpusm.c
+, snmplib/snmpv3.c:
+
+ initial AES support.
+
+2002-08-09 16:31 hardaker
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ slight speed ups for snmp_oid_compare() to do single int compares till !=
+
+2002-08-09 16:29 hardaker
+
+ * snmplib/scapi.c:
+
+ - openssl 0.9.7 support for DES changes.
+ - initial AES support.
+
+2002-08-09 16:28 hardaker
+
+ * snmplib/keytools.c:
+
+ indent fixes.
+
+2002-08-09 16:27 hardaker
+
+ * include/net-snmp/library/: scapi.h, snmpusm.h:
+
+ define AES key specifics
+
+2002-08-09 16:26 hardaker
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ - check for openssl .0.9.7 DES structures and functions.
+ - check for AES support in openssl (> 0.9.7)
+
+2002-08-09 16:10 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ fix mode processing for RESERVE1/RESERVE2 test failures
+
+2002-08-09 15:29 rstory
+
+ * agent/snmp_agent.c:
+
+ log msg when we ignore/fix illegal error_values for the client APIs
+
+2002-08-09 15:28 rstory
+
+ * local/mib2c.array-user.conf:
+
+ corrections to example code
+
+2002-08-09 15:27 rstory
+
+ * agent/helpers/table.c:
+
+ revert errors to uninformative SNMPv1 noSuchName for AgentX get-next/inclusive
+ processing; also add more comments here and there
+
+2002-08-09 14:08 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ debug msg for agentx oid for cases other than get/getnext
+
+2002-08-09 08:45 rstory
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ don't free registration info on failure, as netsnmp_register_mib already did it
+
+2002-08-09 06:57 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c, snmpCallbackDomain.c,
+ snmpIPXDomain.c, snmpTCPDomain.c, snmpTCPIPv6Domain.c
+, snmpUDPDomain.c, snmpUDPIPv6Domain.c,
+ snmpUnixDomain.c, snmp_transport.c:
+
+ - rename snmp_<domain>_blah functions to netsnmp_<domain>_blah
+ - make transport member functions static, to emphasise that they should
+ not be used directly
+ - handle EINTR in send and recv functions (as pointed out by Antti Kuntsi
+ in bug report #576806)
+ - formatting fixes
+
+2002-08-09 06:54 jbpn
+
+ * include/net-snmp/library/: snmpAAL5PVCDomain.h,
+ snmpIPXDomain.h, snmpTCPDomain.h, snmpTCPIPv6Domain.h
+, snmpUDPDomain.h:
+
+ - minor formatting fixes
+
+2002-08-09 06:54 jbpn
+
+ * include/net-snmp/library/snmpUnixDomain.h:
+
+ - don't export netsnmp_unix_blah() functions
+
+2002-08-09 06:53 jbpn
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ - fix nasty formatting
+
+2002-08-08 09:14 rstory
+
+ * snmplib/snmpv3.c:
+
+ reword config_perror msgs to remove "Error", as it is redundant
+
+2002-08-08 09:11 rstory
+
+ * snmplib/keytools.c:
+
+ remove ifdef to log msg to user, after making msg more informative; remove
+ annoying blank lines
+
+2002-08-08 08:33 hardaker
+
+ * acconfig.h, configure, configure.in:
+
+ Patch from Harrie to completely disable kmem usage
+
+2002-08-06 00:30 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - set main_session to NULL in subagent_shutdown(). This (along with the
+ deregistration of all alarms) allows AgentX functionality to be
+ stopped and restarted in subagents.
+ - Thanks to Vishal Verma for original patch
+
+2002-08-06 00:27 jbpn
+
+ * include/net-snmp/library/snmp_alarm.h:
+
+ - add snmp_alarm_unregister_all() function
+
+2002-08-06 00:26 jbpn
+
+ * snmplib/: snmp_alarm.c, snmp_api.c:
+
+ - add snmp_alarm_unregister_all() function
+ - call it from snmp_shutdown()
+ - thanks to Vishal Verma for original patch
+
+2002-08-05 07:06 rstory
+
+ * local/mib2c.iterate.conf:
+
+ match function definition w/Netsnmp_*_DataPoint typedefs; add cvs Id
+
+2002-08-03 08:52 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ break up lines long than 80 chars; abcde, not abcdd
+
+2002-08-03 00:21 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ more updates about things Wes does at 12:30 am
+
+2002-08-02 23:44 hardaker
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.3 )
+
+2002-08-02 23:44 hardaker
+
+ * ChangeLog:
+
+ Update for 5.0.3
+
+2002-08-02 23:41 hardaker
+
+ * agent/mibgroup/agent/.cvsignore:
+
+ add .libs
+
+2002-08-02 23:40 hardaker
+
+ * agent/mibgroup/Rmon/.cvsignore:
+
+ ignore file
+
+2002-08-02 23:39 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2002-08-02 23:37 hardaker
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ forgotten to check in test for perl_ev changes
+
+2002-08-02 23:35 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ remove debugging print (opps)
+
+2002-08-02 23:35 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ fix default version usage.
+
+2002-08-02 23:34 hardaker
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Patch #572394 from Katsuhisa ABE:
+ - support link local addresses
+ - bind to ipv6 only if IPV6_V6ONLY is defined.
+
+2002-08-02 23:31 hardaker
+
+ * snmplib/snmp_parse_args.c:
+
+ fix configure specified default versioning
+
+2002-08-02 22:58 hardaker
+
+ * configure, configure.in:
+
+ Patch #572394: add ipv6 transports when --enable-ipv6 defined. Thanks to Katsuhisa ABE.
+
+2002-08-02 14:59 hardaker
+
+ * NEWS:
+
+ update for 5.0.3
+
+2002-08-02 14:55 hardaker
+
+ * man/snmp_agent_api.3.def:
+
+ update
+
+2002-08-02 14:39 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ more docs.
+
+2002-08-02 14:29 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_multiplexer.3, netsnmp_old_api.3,
+ netsnmp_read_only.3, netsnmp_scalar.3,
+ netsnmp_serialize.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_watcher.3, Makefile.in:
+
+ doxygen update.
+
+2002-08-02 14:26 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ update for yet more stuff.
+
+2002-08-02 14:26 hardaker
+
+ * remove-files:
+
+ remove a few more dist related files.
+
+2002-08-02 14:23 hardaker
+
+ * snmplib/snmp_api.c:
+
+ error message change to remove DES specific error msg.
+
+2002-08-02 14:23 hardaker
+
+ * perl/agent/typemap:
+
+ spacing fixes.
+
+2002-08-02 14:22 hardaker
+
+ * perl/agent/: Makefile.PL, agent.xs:
+
+ renamed file.
+
+2002-08-02 14:22 hardaker
+
+ * perl/agent/: netsnmp_request_info.pm,
+ netsnmp_request_infoPtr.pm:
+
+ renamed file
+
+2002-08-02 14:20 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ Add a "evalvars" directive to do simply replacements.
+
+2002-08-02 14:16 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ use CVSUSER variable when doing stuff instead of my hard-coded name.
+
+2002-08-02 14:14 hardaker
+
+ * Makefile.top:
+
+ update libtool version for 5.0.3
+
+2002-08-02 14:13 hardaker
+
+ * Makefile.in:
+
+ change checkcomment tag to exclude win32 files.
+
+2002-08-02 14:13 hardaker
+
+ * ChangeLog:
+
+ update changelog build notes at the bottom of the file.
+
+2002-08-02 14:01 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ created a how-to file for making releases
+
+2002-08-02 14:01 hardaker
+
+ * dist/changelogfix:
+
+ changelog fix-up script
+
+2002-08-02 10:21 rstory
+
+ * dist/nsb-functions:
+
+ translate '/' in system name to '_' (for cygwin)
+
+2002-08-02 09:56 rstory
+
+ * dist/README.build-scripts:
+
+ fix section cvs get command example
+
+2002-08-02 09:06 dts12
+
+ * include/net-snmp/system/hpux.h:
+
+ Suppress 'inline' when not using GCC. Suggested by Johannes Schmidt-Fischer
+
+2002-08-02 08:59 rstory
+
+ * dist/README.build-scripts:
+
+ fix section on skipping make test; add -p flag to examples
+
+2002-08-02 08:52 rstory
+
+ * dist/README.build-scripts:
+
+ describe use of nsb-package script. Testers and comments appreciated...
+
+2002-08-02 08:33 rstory
+
+ * dist/nsb-platform:
+
+ output platform info
+
+2002-08-02 08:18 rstory
+
+ * dist/nsb-build:
+
+ renamed to nsb-package
+
+2002-08-02 08:18 rstory
+
+ * dist/nsb-package:
+
+ renamed nsb-build to avoid confusion with script function
+
+2002-08-02 08:15 hardaker
+
+ * dist/nsb-functions:
+
+ Change location name to Unknown
+
+2002-08-02 08:08 hardaker
+
+ * perl/: ASN/ASN.pm, agent/agent.pm,
+ agent/netsnmp_request_info.pm:
+
+ more old perl fixes
+
+2002-08-02 08:04 hardaker
+
+ * perl/: OID/OID.pm, agent/default_store/default_store.pm
+:
+
+ more old perl fixes
+
+2002-08-02 08:00 hardaker
+
+ * perl/default_store/default_store.pm:
+
+ more old perl fixes
+
+2002-08-02 07:48 rstory
+
+ * dist/nsb-functions:
+
+ fix return code
+
+2002-08-02 07:48 rstory
+
+ * dist/nsb-build:
+
+ don't pull first arg til after getopts/shift; move set of default opts
+
+2002-08-02 07:37 rstory
+
+ * dist/nsb-functions:
+
+ add option to skip build or test steps; add -f option to prompt to override
+ no prompt flag (useful for errors); new nsb-make method; check rc of
+ make clean
+
+2002-08-02 07:36 rstory
+
+ * dist/nsb-build:
+
+ add option to skip build or test steps; tweak usage
+
+2002-08-02 07:10 rstory
+
+ * dist/nsb-build:
+
+ fix typo; remove extra trailing slash in dir
+
+2002-08-02 06:33 rstory
+
+ * dist/nsb-build:
+
+ check more places to source nsb-functions; fix for cmd line build path
+
+2002-08-02 06:28 rstory
+
+ * dist/nsb-functions:
+
+ just show errors after build, not warnings
+
+2002-08-01 17:04 hardaker
+
+ * perl/OID/OID.xs:
+
+ revert to non-ansi prototypes for older perl with older compilers on
+ older systems. Not that I'm grumpy, of course.
+
+2002-08-01 16:25 hardaker
+
+ * configure.in, agent/snmp_perl.c:
+
+ check for older and new embedded perl call functions
+
+2002-08-01 14:07 rstory
+
+ * dist/nsb-functions:
+
+ don't symlink to src from build; update nsb-get-config
+
+2002-08-01 14:06 rstory
+
+ * dist/nsb-build:
+
+ fix for cmd line build dir
+
+2002-08-01 12:58 rstory
+
+ * dist/nsb-functions:
+
+ fix config install path; remove platform specific from nsb-build
+
+2002-08-01 12:56 rstory
+
+ * dist/nsb-build:
+
+ remove hard coded info
+
+2002-08-01 12:22 rstory
+
+ * dist/nsb-functions:
+
+ add option to skip prompts; remove previous installs; tweak err pattern
+
+2002-08-01 12:14 jbpn
+
+ * man/snmp_alarm.3.def:
+
+ - use netsnmp_ds_set_boolean() instead of ds_set_boolean()
+
+2002-08-01 12:12 jbpn
+
+ * man/snmp_agent_api.3.def:
+
+ - change code sample to use netsnmp_ds_set_boolean()
+ - update references to libraries (which were still talking about
+ libucdagent et al.) -- PLEASE REVIEW BEFORE 5.0.3
+
+2002-08-01 12:07 rstory
+
+ * dist/nsb-functions:
+
+ lots of fixes to previouse untested scripts
+
+2002-08-01 12:04 rstory
+
+ * dist/nsb-build:
+
+ script to build releases... still some hardcoding while testing, but its
+ getting there...
+
+2002-08-01 11:51 rstory
+
+ * dist/: cvsshow, cvsup:
+
+ utility scripts
+
+2002-08-01 09:30 dts12
+
+ * agent/helpers/: scalar.c, scalar2.c:
+
+ Go with the "scalar as super-handler of instance" implementation.
+ Scalar1.c is probably redundent, but we can remove this later.
+ (Yup - I'm a coward....)
+
+2002-08-01 01:11 dts12
+
+ * README.win32:
+
+ Minor typos, plus emphasise the need for the IpHlpAPI library.
+
+2002-07-30 08:26 dts12
+
+ * local/snmpconf.dir/snmp-data/output:
+
+ Recognise '0' as a valid setting for suffixPrinting, and update the
+ prompts to match the v5 output formats defaults. See Bug #567451
+
+2002-07-30 07:59 dts12
+
+ * apps/snmptable.c:
+
+ First attempt at tackling Bug #574434
+ Recognise that default output format is equivalent to -OS.
+ Snmptable still crashes with -Of or -Ou, but at least the
+ default invocation works.
+
+2002-07-30 05:41 dts12
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Export newly-defined public names, and re-export some routines that
+ have changed name. This should now compile under Visual C++ again.
+
+2002-07-30 02:27 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Don't remove a Row-Status auto-deleted row until the last minute,
+ in case other (lower) handlers try to access it.
+
+2002-07-30 01:38 dts12
+
+ * FAQ (V4-2-patches.1), FAQ:
+
+ Mention the need to escape quotes when querying string-indexed tables.
+
+2002-07-29 23:56 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ update register function name
+
+2002-07-29 23:55 rstory
+
+ * local/mib2c.array-user.conf:
+
+ autogen example code for index checking in extract_index; update register
+ function name; use container in *_get_by_idx()
+
+2002-07-29 16:23 rstory
+
+ * local/mib2c.array-user.conf:
+
+ update for new struct name; add example code as comments instead of var_XXX
+ and such; in a few important places add code which will allow a newly
+ generated module to be compiled if -DTABLE_CONTAINER_TODO is specified;
+ probably a few other tweaks I forgot
+
+2002-07-29 03:06 dts12
+
+ * agent/helpers/: table_array.c, table.c, table_data.c
+, table_dataset.c, table_iterator.c:
+
+ Protect against deferencing NULL pointers.
+ (Most of these Should Never Happen but You Can't Be Too Careful!)
+
+2002-07-29 03:03 jbpn
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - detect `dmfe' ethernet cards as found on Netra X1 machines.
+ Thanks to John Olson for verifying this fix.
+
+ Also note that `indent' has ----ed the formatting of this file
+ beyond legibility in several places. I don't think we want to
+ do *that* again.
+
+2002-07-29 02:40 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Fuller validation of RowStatus values wrt row creation/existing rows.
+
+2002-07-29 01:25 dts12
+
+ * win32/: libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp_dll.dsp
+, netsnmpmibs/netsnmpmibs.dsp:
+
+ Take account of recent changes in library files.
+ 'Release' applications still don't link properly, but at least
+ the libraries compile, and the 'Debug' side seems to work.
+
+2002-07-29 01:23 dts12
+
+ * include/net-snmp/system/aix.h:
+
+ Tweak inline handling for AIX - suggested by Andy Hood.
+
+2002-07-26 10:52 rstory
+
+ * snmplib/Makefile.in:
+
+ remove autodependencies until portable solution can be found
+
+2002-07-26 08:41 dts12
+
+ * win32/: mib_module_config.h, mib_module_includes.h,
+ mib_module_inits.h:
+
+ Remove mention of the (obsolete) ucd-snmp/registry module.
+
+2002-07-26 07:32 dts12
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ Protect the Win32 version of the config file, so that the other header
+ files recognise that it has indeed been included.
+
+2002-07-26 07:24 dts12
+
+ * FAQ (V4-2-patches.0), FAQ:
+
+ A bit more detail on mib2c, plus the non-writeability of sys{Location,Contact}
+
+2002-07-26 05:22 dts12
+
+ * FAQ (V4-2-patches.9), FAQ:
+
+ Another entry about invalid use of mib2c.
+
+2002-07-26 05:16 dts12
+
+ * snmplib/Makefile.in:
+
+ Suppress the "non-standard" conditional construct,
+ since it's not recognised by some versions of 'make'.
+
+2002-07-25 05:00 dts12
+
+ * agent/helpers/Makefile.in:
+
+ Add the 'scalar' and 'watcher' helpers to the helper library.
+
+2002-07-25 03:28 dts12
+
+ * agent/helpers/watcher.c, include/net-snmp/agent/watcher.h
+:
+
+ Support for watching a sysUpTime marker.
+
+2002-07-25 03:24 dts12
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ New routine for retrieving a column value directly from a request structure.
+
+2002-07-24 13:17 rstory
+
+ * snmplib/default_store.c:
+
+ check for setting same value in ds_set_string, since it frees the old
+ value before duping the new one
+
+2002-07-24 11:58 rstory
+
+ * dist/snmpd-init.d:
+
+ first stab at init.d startup script for snmpd
+
+2002-07-24 06:48 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ When running off the end of one column, and moving on to the next
+ (in a GetNext), we need to start again with the first row.
+ This is probably the intention of the conditional block at the start
+ of this loop, but I can't see how this test could ever possibly match.
+
+ Note that there is also a reference to the row data accessible via
+ the 'request->parent_data' data list. This will also need to be
+ rewound. Suggestions as to how best to do so gratefully received.
+
+2002-07-24 06:39 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Use SNMPv2-style exceptions rather than the uninformative SNMPv1
+ 'noSuchName' error for missing table objects.
+
+2002-07-24 06:37 dts12
+
+ * agent/helpers/table_data.c:
+
+ Protect against the possibility of failing to extract a row structure.
+
+2002-07-24 06:35 dts12
+
+ * agent/helpers/table_data.c:
+
+ Use SNMPv2-style exceptions rather than the uninformative SNMPv1
+ 'noSuchName' error for missing table objects.
+
+2002-07-24 06:32 dts12
+
+ * agent/helpers/table.c:
+
+ Use SNMPv2-style exceptions rather than the uninformative SNMPv1
+ 'noSuchName' error for invalid table objects.
+
+2002-07-23 14:59 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ missing comment terminator.:-(
+
+2002-07-23 12:02 rstory
+
+ * agent/object_monitor.c, agent/snmp_agent.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ snmplib/container_binary_array.c:
+
+ use new netsnmp_assert instead of assert
+
+2002-07-23 12:00 rstory
+
+ * include/net-snmp/library/snmp_assert.h, snmplib/Makefile.in
+:
+
+ add new netsnmp_assert, which defaults to logging a message
+
+2002-07-23 07:43 dts12
+
+ * man/: mib_api.3 (V4-2-patches.3), mib_api.3.def:
+
+ Fix the descriptions of the 'sprint_realloc' calls, to include the 'allow_realloc' parameter.
+
+2002-07-22 10:58 rstory
+
+ * dist/: net-snmp.spec, nsb-functions:
+
+ new (almost empty) spec file; start creating functions for automated builds
+
+2002-07-22 01:46 dts12
+
+ * agent/helpers/watcher.c, include/net-snmp/agent/watcher.h
+:
+
+ A more generalised form of the 'ns_register_{type}_instance' routines,
+ implemented as a separate helper module, and useable with both the
+ instance and scalar helpers.
+ This also supports arbitrary ASN types (including strings and OIDs).
+
+2002-07-22 01:43 dts12
+
+ * agent/helpers/scalar1.c, agent/helpers/scalar2.c,
+ include/net-snmp/agent/scalar.h:
+
+ Agent helper module for support of scalar objects.
+ Very similar to the "instance" helper, except that this deals with
+ invalid instance subidentifiers as well (reporting noSuchInstance
+ rather that noSuchObject).
+
+ There are two parallel implementations as the moment:
+ - scalar1 is essentially an enhanced copy of the instance helper,
+ but is completely independent of it.
+ - scalar2 sits above the instance helper, and uses that to do most
+ of the real processing.
+ Scalar1 is probably slightly more efficient, while scalar2 feels more
+ in keeping with the general ethos of the handler mechanism.
+ We probably need to decide which to adopt, and junk the other.
+
+2002-07-19 14:24 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ use net agentx retires/timeout ds values
+
+2002-07-19 14:22 rstory
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ register parser for agentxTimeout and agentxRetries tokens
+
+2002-07-19 14:15 rstory
+
+ * agent/mibgroup/Makefile.depend:
+
+ remove refs to non-existent nstAgent* files
+
+2002-07-19 14:14 rstory
+
+ * agent/snmpd.c:
+
+ move ONE_SEC to definitions.h; add AGENTX_TIMEOUT and AGENTX_RETRIES defaults
+
+2002-07-19 14:10 rstory
+
+ * include/net-snmp/agent/ds_agent.h:
+
+ add AGENTX_TIMEOUT and AGENTX_RETRIES
+
+2002-07-19 14:10 rstory
+
+ * include/net-snmp/definitions.h:
+
+ move definition of ONE_SEC here from snmpd.c
+
+2002-07-19 11:23 rstory
+
+ * snmplib/container.c:
+
+ pass local obj, not random unitialized pointer.:-(
+
+2002-07-19 04:04 dts12
+
+ * include/net-snmp/library/tools.h:
+
+ Handle systems where MAXPATHLEN isn't defined.
+
+2002-07-19 03:31 dts12
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Use the "system-independent" SNMP_MAXPATH length definition instead of MAXPATHLEN
+
+2002-07-18 22:00 rstory
+
+ * agent/Makefile.depend:
+
+ remove refs to nonexistent mibgroup/nstAgentModuleObject.h
+
+2002-07-18 19:44 hardaker
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.2 )
+
+2002-07-18 19:43 hardaker
+
+ * ChangeLog:
+
+ update for 5.0.2
+
+2002-07-18 19:41 hardaker
+
+ * testing/eval_tools.sh:
+
+ minor patch for non-existent (died) log files.
+
+2002-07-18 19:41 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2002-07-18 19:40 hardaker
+
+ * NEWS:
+
+ update for 5.0.2
+
+2002-07-18 19:40 hardaker
+
+ * Makefile.rules:
+
+ make depend fixes.
+
+2002-07-18 18:57 hardaker
+
+ * agent/mibgroup/Rmon/: alarm.c, event.c:
+
+ make the rmon code compile.
+ - new subtree pointer structure.
+ - sprint_objid -> snprint_objid
+
+2002-07-18 18:32 hardaker
+
+ * Makefile.in:
+
+ silence perl subdirectory build commands.
+
+2002-07-18 18:31 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ - Use netsh -t -d xml to get xml output from netsh.
+ (Ok, I'm sitting here at an IETF conference having an argument about
+ xml vs BER and needed a XML(-like) example of a huge data set, so I
+ made netsh do it.)
+
+2002-07-18 17:54 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - initial support for doing requests from multiple hosts (retrieval, not sets)
+
+2002-07-18 17:50 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ more fixes to still ugly colorized text (well, the text is pretty but
+ the support is ugly).
+
+2002-07-18 17:42 hardaker
+
+ * include/net-snmp/library/container.h:
+
+ change text string error to match function name called.
+
+2002-07-18 15:31 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+, snmplib/container_binary_array.c:
+
+ rename free -> cfree to avoid some problem wes had... ;-)
+
+2002-07-18 14:41 rstory
+
+ * snmplib/mib.c:
+
+ two people fixing memory leak in different places = segfault
+
+2002-07-18 11:02 rstory
+
+ * local/mib2c.array-user.conf:
+
+ $name -> $i
+
+2002-07-18 10:56 rstory
+
+ * agent/object_monitor.c,
+ include/net-snmp/agent/object_monitor.h:
+
+ update to use containers
+
+2002-07-18 09:40 rstory
+
+ * net-snmp-config.in:
+
+ add --debug-tokens, --indent-options
+
+2002-07-18 09:18 dts12
+
+ * include/net-snmp/agent/auto_nlist.h, snmplib/snmp-tc.c
+, include/net-snmp/system/irix.h:
+
+ Apply patch from Bug #582347, for Irix 6.5 support.
+ Submitted by Jan Yenya Kasprzak
+
+2002-07-18 09:12 dts12
+
+ * man/: snmptrapd.8 (V4-2-patches.5), snmptrapd.8.def:
+
+ Fix markup problem on snmptrapd man page (Bug #583329)
+
+2002-07-18 09:10 dts12
+
+ * snmplib/snmp-tc.c:
+
+ The fix for the tm_gmtoff problem on AIX (Bug #565769) also applies to AIX 5
+
+2002-07-18 09:06 dts12
+
+ * apps/: encode_keychange.c (V4-2-patches.1), encode_keychange.c
+:
+
+ Fix off-by-one buffer overflow (patch #577261)
+
+2002-07-18 08:51 dts12
+
+ * local/mib2c.array-user.conf:
+
+ Generate one code-file per table (to match the header structure).
+ My apologies if this isn't correct, Robert - but the previous behaviour
+ seemed to be broken.
+
+2002-07-18 08:37 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Tackle some of the immediate deficiencies in the first draft old-api config.
+ (Now that Wes has pointed me in the direction of the documentation!)
+
+2002-07-18 08:22 dts12
+
+ * local/mib2c:
+
+ Fix the 'decl' substitution handling (so it doesn't include the internal token as well).
+
+2002-07-18 07:18 dts12
+
+ * local/mib2c.scalar.conf:
+
+ Provide the missing parameter in a read_only instance registration.
+
+2002-07-18 07:09 dts12
+
+ * agent/helpers/instance.c, include/net-snmp/agent/instance.h
+:
+
+ Bring the 'read_only_int' instance handler in line with the rest of
+ the convenience instance handlers.
+ (and even break the habit of a lifetime and declare the thing....)
+
+2002-07-18 05:48 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ fix another memory leak due to an improper ifdefed out section of code
+
+2002-07-18 04:45 hardaker
+
+ * snmplib/scapi.c:
+
+ I'm beginning to regret ever running indent on the code base...
+
+2002-07-17 15:43 hardaker
+
+ * local/: Makefile.in, mib2c.conf:
+
+ document and install mib2c.old-api.conf
+
+2002-07-17 13:07 rstory
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ fix segfault (possibly creating memory leak); author needs to examine code
+
+2002-07-17 07:41 dts12
+
+ * local/: mib2c.array-user.conf, mib2c.conf,
+ mib2c.create-dataset.conf, mib2c.int_watch.conf,
+ mib2c.iterate.conf, mib2c.scalar.conf:
+
+ Dave's being unreasonably picky about grammar & spelling again.
+ Just ignore him, and he'll go away.....
+
+2002-07-17 07:20 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Initial support for the old 4x-style agent API using the new version of mib2c.
+ It doesn't handle types properly, and I'm sure I'll have buggered up some of
+ the control structure handling, but it seems to generate something that's
+ pretty close to the old output. It's better than nothing.....
+
+2002-07-16 22:40 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ restore inline functions (sigh. I feel like I'm playing ring-around-the-rosie)
+
+2002-07-16 21:58 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h,
+ local/mib2c.array-user.conf:
+
+ rename some struct members to make code easier to read; a bit of re-ordering
+ in the set code; new flags for new and deleted rows; row deletes now
+ actualy work!
+
+2002-07-16 19:32 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ change complex macros into functions. would be nice if C had inline.
+
+2002-07-16 18:07 rstory
+
+ * include/net-snmp/types.h:
+
+ umm, try using correct define.:-/
+
+2002-07-16 18:05 rstory
+
+ * include/net-snmp/types.h:
+
+ test that net-snmp-config.h has been included, instead of actually including it..
+ (shouldn't this really be in all the header files?)
+
+2002-07-16 12:14 rstory
+
+ * local/mib2c.array-user.conf:
+
+ update for containers
+
+2002-07-16 11:20 rstory
+
+ * snmplib/snmpTCPIPv6Domain.c:
+
+ fix compiler warning
+
+2002-07-16 11:16 rstory
+
+ * apps/snmpnetstat/Makefile.depend:
+
+ remove oid_array related dependencies (grumble grumble)
+
+2002-07-16 11:14 rstory
+
+ * apps/Makefile.depend:
+
+ remove oid_array related dependencies
+
+2002-07-16 11:02 rstory
+
+ * agent/: Makefile.depend, mibgroup/Makefile.depend:
+
+ remove oid_array related dependencies
+
+2002-07-16 10:52 rstory
+
+ * snmplib/Makefile.depend, agent/helpers/Makefile.depend
+:
+
+ remove oid_array related dependencies
+
+2002-07-16 10:50 rstory
+
+ * snmplib/Makefile.in:
+
+ remove factory.c
+
+2002-07-16 10:29 rstory
+
+ * snmplib/snmp_api.c:
+
+ add netsnmp_container_init_list() in startup inits
+
+2002-07-16 10:21 rstory
+
+ * include/net-snmp/library/oid_array.h, snmplib/oid_array.c
+:
+
+ remove unused files
+
+2002-07-16 10:21 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ chg param type from void* to struct *
+
+2002-07-16 10:03 rstory
+
+ * snmplib/Makefile.in:
+
+ remove recently deleted oid_array.h; add factory, binary array .[ch]; derive
+ OBJS and LOBJS from CSRCS; add (optional) auto dependency generation
+
+2002-07-16 09:53 rstory
+
+ * include/net-snmp/mib_api.h:
+
+ remove recently deleted oid_array.h
+
+2002-07-16 09:52 rstory
+
+ * agent/mibgroup/ucd-snmp/extensible.h:
+
+ struct subtree -> netsnmp_subtree
+
+2002-07-16 09:46 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h:
+
+ remove last remaining refs to now defunct oid_array
+
+2002-07-16 09:40 rstory
+
+ * include/net-snmp/library/container_binary_array.h,
+ snmplib/container_binary_array.c:
+
+ generic binary array container extracted from oid_array
+
+2002-07-16 09:40 rstory
+
+ * include/net-snmp/types.h:
+
+ include net-snmp-config.h; new typedef struct netsnmp_index (oid ptr + len)
+
+2002-07-16 09:38 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h:
+
+ use generic container interface; use new netsnmp_index instead of
+ oid_array_header; rename array_group -> request_group
+
+2002-07-16 09:34 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ add iterators; more function typedefs; rename some func ptrs, add find_next,
+ get_subset, get_iterator, for_each, ncompare; add ability to have nested
+ containers; more utility routines; convenience marcros; start adding comments
+
+2002-07-16 09:29 rstory
+
+ * include/net-snmp/library/factory.h:
+
+ declarations for a generic factory
+
+2002-07-16 08:48 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory_dynix.c, memory_hpux.c
+, vmstat_dynix.c, vmstat_hpux.c:
+
+ Apply patch from bug report 581618 (also applicable to dynix)
+ Provided by Nicholas L. Nigay
+
+2002-07-16 06:54 hardaker
+
+ * perl/: ASN/ASN.pm, OID/OID.pm, agent/agent.pm,
+ agent/default_store/default_store.pm,
+ default_store/default_store.pm:
+
+ remove "our" problem and use older "use vars" instead for older perl.
+ (this should make it work with perl 5.005. Could some one test this
+ for me?)
+
+2002-07-15 06:45 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - names of netsnmp_subtree elements changed
+
+2002-07-15 06:42 jbpn
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ - struct subtree renamed to netsnmp_subtree
+
+2002-07-15 05:25 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ Some really nasty hacks to get colorized tables to work.
+
+2002-07-14 20:51 hardaker
+
+ * perl/SNMP/t/: bulkwalk.t, mib.t:
+
+ comment out broken tests for now (XXX marked)
+
+2002-07-14 20:50 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ fix getbulk.
+
+2002-07-14 20:20 hardaker
+
+ * agent/agent_handler.c,
+ include/net-snmp/agent/agent_handler.h:
+
+ A new function to call a sub-handler but passing it only one request to handle.
+
+2002-07-10 21:21 rstory
+
+ * win32/: config.h, net-snmp/net-snmp-config.h:
+
+ define LOG_DAEMON, since windows doesn't have it
+
+2002-07-10 21:07 rstory
+
+ * win32/: config.h, net-snmp/net-snmp-config.h:
+
+ remove define of in_addr_t, which can be found in net-snmp/types.h
+
+2002-07-10 02:36 jbpn
+
+ * agent/agent_handler.c:
+
+ - struct subtree renamed to netsnmp_subtree
+
+2002-07-10 02:35 jbpn
+
+ * agent/agent_index.c:
+
+ - don't use 0 in %p format specifiers
+
+2002-07-10 02:34 jbpn
+
+ * agent/snmp_agent.c:
+
+ - struct subtree renamed to netsnmp_subtree
+ - fix some horrible indent broken formatting
+
+2002-07-10 02:33 jbpn
+
+ * agent/snmp_vars.c:
+
+ - struct subtree renamed to netsnmp_subtree
+ - remove some obsolete variables
+
+2002-07-10 02:33 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - reflect changed function names from agent_registry
+
+2002-07-10 02:32 jbpn
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ - changes due to renaming of struct subtree to netsnmp_subtree
+ - NOTE MEMORY LEAK (which I can't see how to fix -- new agent API
+ experts please examine)
+
+2002-07-10 02:29 jbpn
+
+ * agent/agent_registry.c:
+
+ - struct subtree renamed to netsnmp_subtree
+ - name, start, end members are now dynamically allocated to reduce
+ wasted memory (by a factor of 5 or so)
+ - functions are renamed consistently
+
+2002-07-10 02:20 jbpn
+
+ * include/net-snmp/agent/: agent_registry.h,
+ net-snmp-agent-includes.h, snmp_agent.h, snmp_vars.h
+, var_struct.h:
+
+ - struct subtree renamed to netsnmp_subtree
+
+2002-07-09 06:02 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - free cache_id storage when closing session
+
+2002-07-09 05:56 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - just call netsnmp_ds_shutdown() once in snmp_shutdown()
+
+2002-07-09 04:15 jbpn
+
+ * snmplib/mib.c:
+
+ - fix memory leak in netsnmp_fixup_mib_directory()
+
+2002-07-09 03:14 jbpn
+
+ * agent/snmpd.c:
+
+ - add a cast to quell compiler warning
+
+2002-07-08 22:09 rstory
+
+ * agent/mibgroup/util_funcs.h:
+
+ extern C for C++ compiles
+
+2002-07-08 07:21 jbpn
+
+ * include/net-snmp/agent/snmp_vars.h:
+
+ - remove obsolete function prototypes
+
+2002-07-07 19:45 rstory
+
+ * local/mib2c.array-user.conf:
+
+ update to use containers
+
+2002-07-07 19:38 rstory
+
+ * include/net-snmp/library/oid_array.h:
+
+ fix typo
+
+2002-07-07 19:37 rstory
+
+ * agent/mibgroup/ucd-snmp/: disk.c, proc.c:
+
+ fix compiler warning
+
+2002-07-07 19:33 rstory
+
+ * agent/mibgroup/: agent/nsModuleTable.c,
+ agent/nsTransactionTable.c, host/hr_swinst.c:
+
+ fix compiler warning
+
+2002-07-07 19:03 rstory
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ remove unused vars
+
+2002-07-07 19:00 rstory
+
+ * snmplib/oid_stash.c:
+
+ fix compiler warnings
+
+2002-07-07 18:53 rstory
+
+ * snmplib/asn1.c:
+
+ fix compiler warnings
+
+2002-07-07 18:50 rstory
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ make param const; fix compile const warning
+
+2002-07-07 18:27 rstory
+
+ * snmplib/mib.c:
+
+ fix compiler warning; fix memory leak; prep a few comments for indent
+
+2002-07-06 14:11 hardaker
+
+ * README, sedscript.in, snmplib/snmp_version.c,
+ FAQ, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.2.pre1 )
+
+2002-07-06 14:10 hardaker
+
+ * doxygen.conf:
+
+ change project version to 5.0.2
+
+2002-07-06 14:09 hardaker
+
+ * perl/SNMP/Makefile.PL:
+
+ snmptrapd is actually built in the apps directory, not the agent directory.
+
+2002-07-05 11:55 rstory
+
+ * local/mib2c:
+
+ clarify directions for obtaining perl/SNMP module.
+
+2002-07-05 05:18 jbpn
+
+ * agent/mibgroup/agentx/client.c:
+
+ - I must not check in code without compiling it
+ - I must not check in code without compiling it
+ - I must not check in code without compiling it
+ - I must not check in code without compiling it
+ - ...
+
+2002-07-05 03:23 jbpn
+
+ * agent/mibgroup/: agentx/client.c, mibII/system_mib.c:
+
+ - sysObjectID was being returned minus its last sub-identifier because
+ the length variable had not been updated to reflect the fact that it
+ is now longer. Code changed to use sizeof() instead, so this won't
+ happen again. Reported by Stian Soiland (bug #577439).
+
+2002-07-04 10:13 rstory
+
+ * snmplib/read_config.c:
+
+ ucd-snmp -> net-snmp
+
+2002-07-04 07:06 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - modified handling of opaque pointer for stream-based transports to
+ avoid both multiple free() problem and unnecessary copying.
+
+2002-07-04 06:00 dts12
+
+ * man/snmpd.conf.5.def, agent/mibgroup/host/hr_storage.c
+ (V4-2-patches.[5,9]), man/snmpd.conf.5.def,
+ agent/mibgroup/host/hr_storage.c:
+
+ Apply Johannes Schmidt-Fischer's NetworkDisk patch #554554
+
+2002-07-04 05:56 dts12
+
+ * agent/mibgroup/host/: hr_filesys.c, hr_filesys.h
+ (V4-2-patches.[5,1]), hr_filesys.c, hr_filesys.h:
+
+ Apply Johannes Schmidt-Fischer's NFS filesystem patch #554553
+ (simplified to avoid the re-indentation - which makes it easier to see
+ what's changed. The whole HostRes group needs cleaning up anyway!)
+
+2002-07-04 05:52 dts12
+
+ * snmplib/snmp_api.c:
+
+ Ensure transport opaque data isn't multiply assigned
+ (and hence multiply freed) for stream-based transports.
+ Datagram-based transports don't suffer from this problem.
+ Based on Patch 573771
+
+2002-07-03 16:28 rstory
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ be precise about what file needs to be configured for access control
+
+2002-07-03 14:13 rstory
+
+ * local/mib2c.conf:
+
+ fix minor grammar errors; add descr for mib2c.array-user; add section header
+ for generating header definition files
+
+2002-07-03 13:11 rstory
+
+ * include/net-snmp/: types.h, library/system.h:
+
+ move include for in_addr_t to net-snmp/types.h, where in_addr_t is defined
+ for systems w/out netinet/in.h
+
+2002-07-03 12:51 rstory
+
+ * local/mib2c.scalar.conf:
+
+ more tweaks noticed on the mailing list
+
+2002-07-03 08:23 hardaker
+
+ * perl/agent/test.pl:
+
+ make test cleanups test.pl
+
+2002-07-03 03:42 dts12
+
+ * agent/mibgroup/: util_funcs.c (V4-2-patches.1), util_funcs.c
+:
+
+ Shut the agent down cleanly before restarting.
+ This closes any SNMP/AgentX ports as well.
+
+2002-07-03 03:26 dts12
+
+ * agent/mibgroup/util_funcs.c:
+
+ OID sub-identifiers are unsigned, so treating them as signed can
+ give the wrong results with large values.
+
+2002-07-03 03:20 dts12
+
+ * snmplib/system.h (V4-2-patches.5),
+ include/net-snmp/library/system.h:
+
+ Ensure in_addr_t is defined.
+
+2002-07-03 02:34 dts12
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Testing for <sys/disklabel.h> requires <machine/types.h> on NetBSD 1.5.
+ Reported by Felicia Neff.
+ (Apparently from the NetBSD bug database - why they didn't tell us about
+ it is a mystery to me....)
+
+2002-07-03 02:19 dts12
+
+ * configure.in:
+
+ Fix the default value for sysObjectID as reported in the configure --help output.
+ (The actual value used is correct - it's just the help output that's wrong).
+ Spotted by Sandhya Satyanarayan.
+
+2002-07-02 23:15 hardaker
+
+ * local/mib2c.conf:
+
+ update text for various .conf files
+
+2002-07-02 13:46 rstory
+
+ * local/mib2c.scalar.conf:
+
+ fixes noted on the mailing list by Patrice Kadionik <kadionik@enseirb.fr>
+
+2002-07-02 02:39 dts12
+
+ * perl/SNMP/Makefile.PL:
+
+ Add the 'snmpd' and 'snmptrapd' binary names to the appropriate paths
+ when setting up the testing framework.
+
+2002-07-01 07:53 dts12
+
+ * snmplib/: asn1.c (V4-2-patches.8), asn1.c:
+
+ Encode/Decode OIDs of the form 2.X (X > 40) correctly.
+
+2002-07-01 02:40 jbpn
+
+ * configure, configure.in:
+
+ - fix horrible formatting in help for transports
+
+2002-07-01 02:23 dts12
+
+ * sedscript.in:
+
+ Pick up the changed definition for the root of the UCD extensible agent tables
+ (so that the EXAMPLE.conf file gets set up with the correct numeric OIDs)
+
+2002-06-28 06:46 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - remove transport specifier and port number from strings returned
+ from snmp_tcp_fmtaddr() which break tcp_wrappers (and perhaps
+ other things).
+
+2002-06-28 04:41 dts12
+
+ * perl/agent/test.pl:
+
+ Update default store retrieval functions to use the correct name.
+
+ Note that this test script appears to include two infinite loops.
+ I'm not clear how this is expected to run successfully ?
+
+2002-06-28 04:39 dts12
+
+ * perl/agent/agent.xs:
+
+ Remove reference to non-existent degugging function.
+
+2002-06-28 04:37 dts12
+
+ * perl/manager/: Makefile.PL, displaytable.pm,
+ getValues.pm, manager.pm, snmptosql:
+
+ Bring perl 'manager' module under the NetSNMP banner
+ (both in terms of module group name, and references to 'ucd-snmp').
+ Remove some UCD-specific settings.
+
+ Note that snmptosql still refers explicitly to Wes' UCD email address,
+ and manager.pm to Wes' UCD filestore path. The relevant lines have
+ been highlighted, to encourage anyone wishing to use this to change them.
+
+2002-06-28 04:12 dts12
+
+ * perl/: AnyData_SNMP/Makefile.PL, OID/Makefile.PL,
+ SNMP/Makefile.PL, agent/Makefile.PL,
+ manager/Makefile.PL:
+
+ Remove checking for "internal" prerequisites, so that "perl Makefile.PL"
+ at the top level will work - even on a pristine system.
+
+ Qn:
+ Is it necessary/desirable to separate the NetSNMP modules to this extent?
+ Would it not be simpler to have all of the main .pm/.xs files in a single
+ NetSNMP directory, and compile/install them all from there?
+
+2002-06-28 01:45 dts12
+
+ * configure, configure.in:
+
+ Check for --with-enterprise (et al) being invoked without a value, and bomb out.
+
+2002-06-27 21:43 rstory
+
+ * README.solaris:
+
+ new README detainling the use of SFIO to circumvent the 255 fd limit on
+ solaris.
+
+2002-06-27 11:09 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h:
+
+ remove changing array; add netsnmp_table_array_remove_row()
+
+2002-06-27 04:15 dts12
+
+ * Makefile.rules:
+
+ Some versions of 'makedepend' (e.g. RedHat 7.1), can't handle "-osuffix"
+ as a single option. All versions seem happy with "-o suffix" so use that.
+
+2002-06-27 03:31 dts12
+
+ * snmplib/mib.c:
+
+ Use ENV_SEPARATOR_CHAR rather than hardwiring ':' in netsnmp_set_mib_directory
+ (as suggested by Robert)
+
+2002-06-27 03:22 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ - remove transport specifier and port number from strings returned
+ from snmp_udp_fmtaddr() which break tcp_wrappers (and perhaps
+ other things).
+
+2002-06-27 03:09 dts12
+
+ * agent/mibgroup/mibII/: snmp_mib.c (V4-2-patches.2), snmp_mib.c
+:
+
+ Validate new snmpEnableAuthenTraps value before trying to use it.
+ Spotted & fixed by Shantha Kumara
+
+2002-06-25 14:09 rstory
+
+ * apps/snmpset.c:
+
+ add APPTOPS (-Cq) for suppressing output of set results on success
+
+2002-06-25 09:28 dts12
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ Apply patch #559848 to use the /proc pseudo-filesystem under Linux
+ (rather than parsing the output of ps)
+
+2002-06-25 08:59 dts12
+
+ * snmplib/snmp-tc.c:
+
+ Check for 'aix4' (which is the token defined in the system header file)
+ rather than 'aix'. See bug #565769
+
+2002-06-25 08:31 dts12
+
+ * agent/mibgroup/util_funcs.c:
+
+ Treat '0' as an invalid index for a "simple table".
+
+2002-06-25 07:36 hardaker
+
+ * local/snmpconf.dir/snmpd-data/system:
+
+ document read-only nature of sysContact.0 and sysLocation.0
+ configuration tokens.
+
+2002-06-25 06:40 jbpn
+
+ * man/: Makefile.in, default_store.3.bot,
+ default_store.3.top:
+
+ - add netsnmp_ prefix to default_store functions
+
+ - clean up manpage a bit
+
+ - fix breakage in generation of default_store.3.h due to auto-indentation
+ of default_store.h
+
+2002-06-25 02:55 jbpn
+
+ * EXAMPLE.conf.def (V4-2-patches.3), EXAMPLE.conf.def:
+
+ - mention that setting sysLocation et al. in snmpd.conf makes them
+ read-only
+
+ - also change syntax of all example command line tools to use newer
+ -c COMMUNITY syntax not positional parameter
+
+2002-06-24 08:03 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ make buffer size increase note a debug statement rather than a generic
+ log statement.
+
+2002-06-23 18:40 driehuis
+
+ * perl/SNMP/SNMP.xs:
+
+ Handle COUNTER64 in __translate_asn_type.
+
+2002-06-23 16:03 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ documentation for the script and the language it houses.
+ (man page auto-generated from the contained pod documentation)
+
+2002-06-23 15:03 hardaker
+
+ * perl/SNMP/README:
+
+ update to reference top level Makefile.PL
+
+2002-06-23 14:51 hardaker
+
+ * perl/SNMP/: SNMP.xs (V4-2-patches.1), SNMP.xs:
+
+ fix reported by Willem Dekker for Windows. Bug #543194 fixed.
+
+2002-06-22 08:37 hardaker
+
+ * README.snmpv3:
+
+ update for recent methodologies
+
+2002-06-21 16:07 rstory
+
+ * snmplib/mib.c:
+
+ final (hopefully!) fix for parsing ip addresses from
+ "Fco. Javier Ridruejo" <acbripef@si.ehu.es>
+
+2002-06-19 14:38 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_multiplexer.3, netsnmp_old_api.3,
+ netsnmp_read_only.3, netsnmp_serialize.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_todo.3:
+
+ update from doxygen
+
+2002-06-19 11:50 hardaker
+
+ * local/: mib2c.int_watch.conf, mib2c.scalar.conf:
+
+ scalar mib2c configuration files for generating scalar code.
+
+2002-06-19 11:43 hardaker
+
+ * agent/mibgroup/examples/scalar_int.c:
+
+ clean up multi-line commend which was messed up by indent.
+
+2002-06-19 11:42 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ - add support for prompting of unknown parameters to aliases.
+ - misc other improvements (like "rehash")
+
+2002-06-19 11:38 hardaker
+
+ * net-snmp-config.in:
+
+ fix for new default store API
+
+2002-06-19 11:29 hardaker
+
+ * perl/: Makefile.PL, Makefile.makefiles,
+ Makefile.subs.pl, make-perl-makefiles, ASN/Makefile.PL
+, OID/Makefile.PL, SNMP/Makefile.PL,
+ agent/Makefile.PL, agent/default_store/Makefile.PL,
+ default_store/Makefile.PL:
+
+ ARGGGGGG
+ I love perl.
+ I hate perl's make system.
+ I hate the fact that perl segfaults if GetOptions() is called more
+ than once.
+ sigh.
+ This hopefully will fix the perl module build routines so it at least
+ works (but it's still ugly and could use more cleaning).
+
+2002-06-19 07:45 rstory
+
+ * agent/snmp_agent.c:
+
+ fix infinte loop and add debug in remove_delegated
+
+2002-06-18 07:37 hardaker
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ NULL the priv pointer on session duplication. thanks to rezitoz
+
+2002-06-17 06:23 hardaker
+
+ * README:
+
+ Changed Katsuhisa's email address, on request
+
+2002-06-14 07:44 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Patch #569021: from Lauri Myllari
+ - fix memory leak in the table iterator support.
+
+2002-06-14 07:02 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Applied patch #569020 from rezitoz on IRC to fix non-initialized variable
+
+2002-06-14 03:57 dts12
+
+ * agent/mibgroup/Rmon/alarm.c:
+
+ Add (null) context, to bring into line with the v5 registry APIs.
+ Fixes bug 568580.
+
+2002-06-14 02:27 dts12
+
+ * aclocal.m4, configure:
+
+ Use matching ' and " quotes for AIX configure test.
+ Mentioned in passing in bug 565769.
+
+2002-06-13 14:32 hardaker
+
+ * perl/SNMP/t/conf.t:
+
+ fix default_store routines
+
+2002-06-12 06:43 dts12
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ Bring Windows OID usage into line with the main config file settings.
+
+2002-06-12 06:37 dts12
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Correct the default Enterprise OID used in traps, to avoid a repeated 0
+ subidentifier. (Fixes bug #566917)
+
+2002-06-12 05:14 dts12
+
+ * snmplib/snmp_api.c:
+
+ Define 'length' as a signed variable, so it can handle an error value of -1.
+ Reported by Joakim Althini.
+
+2002-06-12 03:11 dts12
+
+ * snmplib/read_config.c:
+
+ Make sure the address of the next link is properly saved, before freeing memory.
+ Problem discovered by Hugo Cacote.
+
+2002-06-12 02:15 dts12
+
+ * include/net-snmp/: agent/agent_index.h, agent/agent_trap.h
+, agent/all_helpers.h, agent/auto_nlist.h,
+ agent/bulk_to_next.h, agent/debug_handler.h,
+ agent/mib_modules.h, agent/multiplexer.h, agent/null.h
+, agent/old_api.h, agent/read_only.h,
+ agent/serialize.h, agent/set_helper.h,
+ library/cmu_compat.h, library/snmpAAL5PVCDomain.h,
+ library/snmpCallbackDomain.h, library/snmpIPXDomain.h,
+ library/snmpTCPDomain.h, library/snmpTCPIPv6Domain.h,
+ library/snmpUDPDomain.h, library/snmpUDPIPv6Domain.h,
+ library/snmpUnixDomain.h, library/snmp_parse_args.h,
+ library/snmp_secmod.h, library/transform_oids.h,
+ library/ucd_compat.h:
+
+ Supply missing #ifndef/#define/#endif and extern "C" {} wrappers
+
+2002-06-11 17:56 rstory
+
+ * snmplib/mib.c:
+
+ remove spurious printf to stderr
+
+2002-06-11 14:21 rstory
+
+ * include/net-snmp/types.h:
+
+ add extern "C"; add void_array struct
+
+2002-06-11 14:20 rstory
+
+ * agent/helpers/table_array.c:
+
+ remove tsearch; use new container instead
+
+2002-06-11 14:19 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ use container for secondary index
+
+2002-06-11 14:17 rstory
+
+ * snmplib/Makefile.in:
+
+ add container to headers; add container.c
+
+2002-06-11 14:17 rstory
+
+ * snmplib/container.c:
+
+ init functions for basic/sorted container
+
+2002-06-11 14:15 rstory
+
+ * include/net-snmp/library/container.h:
+
+ more methods for basic container; add sorted (will probably rename) conatiner
+
+2002-06-11 12:22 rstory
+
+ * include/net-snmp/agent/instance.h:
+
+ protect against multiple includes; add extern "C" for __cplusplus
+
+2002-06-11 11:11 hardaker
+
+ * perl/AnyData_SNMP/: INSTALL, Makefile.PL, README
+, netsh, snmpsh:
+
+ renamed snmpsh to netsh, as I like the name better and it appeals to a
+ wider number of people.
+
+2002-06-10 09:53 rstory
+
+ * agent/snmp_agent.c:
+
+ when deleting an asp pointer, make sure it isn't in the delegated list
+
+2002-06-10 08:46 rstory
+
+ * snmplib/mib.c:
+
+ fix parse_one_oid_index to allow too short IP address when complete is
+ specified; add netsnmp_oid2chars & netsnmp_oid2str
+
+2002-06-10 07:42 hardaker
+
+ * perl/default_store/: default_store.pm, default_store.xs
+, test.pl:
+
+ update to latest default_store defines
+
+2002-06-10 07:39 hardaker
+
+ * Makefile.in, perl/.cvsignore, perl/Makefile.PL:
+
+ Top level perl Makefile.PL to install the whole bunch underneath.
+ This should now be used instead of the lower level makefiles for
+ simplicity.
+
+2002-06-10 07:27 dts12
+
+ * perl/SNMP/t/mib.t:
+
+ Acknowledge known failing tests.
+ This message can be removed once the problem has been isolated and fixed.
+
+2002-06-10 07:17 hardaker
+
+ * snmplib/mib.c:
+
+ support for ipaddress building/parsing of OID indexes.
+
+2002-06-10 02:07 dts12
+
+ * FAQ (V4-2-patches.8), FAQ:
+
+ Mention the other perl modules, introduced with v5 (particularly 'default_store')
+
+2002-06-10 01:28 dts12
+
+ * FAQ (V4-2-patches.7), FAQ:
+
+ New entry describing possible problems with trap handlers.
+
+2002-06-08 21:39 hardaker
+
+ * perl/agent/agent.pm:
+
+ default_store fixes
+
+2002-06-08 20:54 rstory
+
+ * Makefile.in:
+
+ break perl makefile creation into seperate step; only clean perl directory
+ if there is a makefile
+
+2002-06-08 20:15 rstory
+
+ * Makefile.in:
+
+ add perltest target to make test in all perl directories
+
+2002-06-08 09:47 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ fix to deal with updated SQL::Statement module.
+
+2002-06-08 07:08 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ update to SQL-Statement requirement of 1.004
+
+2002-06-08 06:45 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ remove mib init code from C snmp_translate_obj call
+
+2002-06-08 06:44 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ init_snmp inside translateObj
+
+2002-06-08 06:44 hardaker
+
+ * perl/OID/OID.pm:
+
+ change version to 0.1
+
+2002-06-08 06:43 hardaker
+
+ * perl/AnyData_SNMP/configs/unix:
+
+ A few cleanups to ifconfig and netstat commands
+
+2002-06-08 06:35 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ - beginning support for import/export of data (currently to/from CSV).
+ - support for "diff" which compares old (possibly imported data) to current.
+
+2002-06-08 06:34 hardaker
+
+ * perl/AnyData_SNMP/Makefile.PL:
+
+ change required SNMP module version from 4 to 5
+
+2002-06-08 06:34 hardaker
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ Add a tutorial place holder comment OID.
+
+2002-06-08 06:33 hardaker
+
+ * local/tkmib:
+
+ fix tkmib for newer perl modules.
+
+2002-06-08 06:33 hardaker
+
+ * local/snmpconf:
+
+ turn off extra bold/underline formatting by default.
+
+2002-06-07 15:04 rstory
+
+ * include/net-snmp/library/container.h:
+
+ generic container structure for storing data
+
+2002-06-07 13:01 rstory
+
+ * perl/ASN/ASN.xs:
+
+ include net-snmp-config.h
+
+2002-06-07 10:37 rstory
+
+ * configure:
+
+ update configure to keep in line with configure.in (why? shouldn't
+ configure not be in CVS and be autogenerated? One of these days I'm going
+ to have to learn autoconf....)
+
+2002-06-07 10:35 rstory
+
+ * Makefile.in, Makefile.rules:
+
+ always check return status of make when inside a loop, and exit on errors
+
+2002-06-07 08:17 dts12
+
+ * agent/mibgroup/mibII/: interfaces.c (V4-2-patches.3),
+ interfaces.c:
+
+ Only null-terminate the interface name while it's actually being copied.
+ Restore the data line afterwards, so the debugging output is meaningful.
+
+2002-06-07 01:16 dts12
+
+ * agent/snmp_agent.c:
+
+ Fix for indexing error, that causes a crash if more than 16 varbinds
+ are added to the cache in one go. Spotted by Shanth Kumara
+
+2002-06-06 01:12 dts12
+
+ * aclocal.m4, configure (V4-2-patches.[7,5]), aclocal.m4,
+ configure:
+
+ Don't differenciate between elf- and a.out-based NetBSD systems.
+ (Problem highlighted by Felicia Neff)
+
+2002-06-05 18:50 rstory
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/types.h:
+
+ put defines for socklen_t and in_addr_t in net-snmp/types.h instead of having
+ configure generate them; configure instead generates HAVE_SOCKLEN_T and
+ HAVE_IN_ADDR_T for systems which don't need the defines; this is primarily
+ for the benefit of the Win32 platform, which doesn't have configure.
+
+2002-06-05 09:20 rstory
+
+ * local/mib2c.iterate.conf:
+
+ don't advance request pointer inside for loop, since for loop does it for
+ us; otherwise for loop may end up dereferencing NULL pointer.
+
+2002-06-05 06:41 hardaker
+
+ * perl/AnyData_SNMP/configs/unix:
+
+ example configuration file to duplicate various unix utilities:
+ - currently: netstat, ps, df, ifconfig
+
+2002-06-05 06:40 hardaker
+
+ * perl/AnyData_SNMP/configs/scli:
+
+ example configuration file to duplicate functionality in Juergen's
+ scli command.
+
+2002-06-05 06:39 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ new commands:
+ source file -- sources an rc file
+ watch expression -- repeatedly runs a command and colorizes
+ differences in data
+ eval expression -- evaluates an expression directly in perl
+ - beginnings of overloads in perl so that calling sysContact()
+ will return the sysContact value. tables not returned yet.
+ fixes:
+ turns of ornamental prompt support (ick) by default
+
+2002-06-05 04:43 dts12
+
+ * man/: snmpcmd.1 (V4-2-patches.8), snmpcmd.1.def:
+
+ Brief mention of the need to quote OIDs containing string indexes,
+ to protect the double quotes from the shell.
+
+2002-06-04 10:38 rstory
+
+ * agent/snmp_agent.c:
+
+ test for a null treecache before dereferencing it; noted on the coders
+ list by joakim.althini@reddo.net
+
+2002-06-04 10:33 rstory
+
+ * agent/snmp_agent.c:
+
+ test for asp->pdu == NULL before dereferencing it; noted on the coders
+ list by joakim.althini@reddo.net.
+
+2002-06-04 05:54 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ support for printf, single query/sets of scalars, multi-line aliases.
+
+2002-05-30 15:23 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ default_store fixes
+
+2002-05-30 15:23 hardaker
+
+ * perl/OID/OID.pm:
+
+ make new() operator a bit smarter
+
+2002-05-29 19:57 hardaker
+
+ * snmplib/: snmp_alarm.c (V4-2-patches.2), snmp_alarm.c:
+
+ set the storage pointer to NULL, as pointed out by Mark Hoy.
+
+2002-05-29 09:22 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/mib.h, snmplib/mib.c,
+ snmplib/snmp_parse_args.c:
+
+ Patch from Harrie Hazewinkel to APIify MIBDIRS support
+
+2002-05-29 07:43 dts12
+
+ * FAQ (V4-2-patches.6), FAQ:
+
+ Expand on when OpenSSL is necessary, and how to compile using it.
+
+2002-05-29 06:52 dts12
+
+ * snmplib/snmpUDPDomain.c:
+
+ Set REUSEADDR so that specifying the same port twice doesn't kill the agent.
+ (Suggested by Robert Hastings)
+
+2002-05-29 02:41 dts12
+
+ * FAQ (V4-2-patches.5), FAQ:
+
+ Reference both versions of the tutorial (since this document is used
+ for building the on-line version of the FAQ)
+
+2002-05-29 02:16 dts12
+
+ * FAQ (V4-2-patches.4), FAQ:
+
+ Clarify that trap filtering is not yet operational.
+
+2002-05-28 14:53 rstory
+
+ * snmplib/oid_array.c:
+
+ remove ^M chars
+
+2002-05-28 14:52 rstory
+
+ * local/mib2c.array-user.conf:
+
+ fix logic in can_delete; consolidate use of netsnmp_set_mode_request by setting
+ rc for use at end of loop; don't use removed macros for rowstatus/storagetype,
+ using new netsnmp_check_vb* routines instead; add asserts for error cases that
+ should be caught by earlier routines
+
+2002-05-28 14:47 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ add callbacks for row (de)activation
+
+2002-05-28 06:23 dts12
+
+ * agent/helpers/table_array.c:
+
+ Protect "#include <search.h>" with the HAVE_SEARCH_H token. (Suggested by Harrie)
+
+2002-05-28 06:20 dts12
+
+ * include/net-snmp/library/snmp_logging.h:
+
+ Fix the declaration of snmp_enable_syslog_ident. (Spotted by Harrie)
+
+2002-05-27 01:53 dts12
+
+ * apps/snmptrapd.c, include/net-snmp/library/snmp_logging.h
+, snmplib/snmp_logging.c:
+
+ Don't hardwire syslog facility to LOG_DAEMON.
+ Fix provided by Joakim Fallsjo.
+
+2002-05-27 01:32 dts12
+
+ * agent/mibgroup/snmpv3/usmUser.c, apps/snmptrapd.c
+ (V4-2-patches.[2,8]), agent/mibgroup/snmpv3/usmUser.c,
+ apps/snmptrapd.c:
+
+ Tweak 'usmUser' help string to accurately reflect which bits are optional.
+ Reported by Ali Chanaui.
+
+2002-05-27 01:22 dts12
+
+ * man/: snmpd.conf.5.def (V4-2-patches.4), snmpd.conf.5.def:
+
+ Document the limit on the number of "file" directives.
+
+2002-05-27 01:17 dts12
+
+ * local/Makefile.in:
+
+ Remove an extraneous trailing backslash, that confuses some 'make's
+
+2002-05-24 09:54 hardaker
+
+ * perl/agent/netsnmp_request_info.pm:
+
+ Proper creation of returned NetSNMP::OID object.
+
+2002-05-24 09:54 hardaker
+
+ * perl/agent/agent.xs:
+
+ increase reference counts on returned mib registration objects so
+ they're not auto-cleaned by perl (the agent now has a copy of the pointer)
+
+2002-05-24 09:53 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ new default_store netsnmp_ prefixes.
+
+2002-05-24 09:53 hardaker
+
+ * local/mib2c:
+
+ support for scalars (mib2c.scalar.conf file coming shortly)
+
+2002-05-24 09:52 hardaker
+
+ * Makefile.in:
+
+ A new rule called "commentcheck" to grep all sources for // comments.
+
+2002-05-24 08:09 dts12
+
+ * agent/agent_registry.c:
+
+ Declare 'register_mib_detach_node' before it's used for the first time.
+ (Spotted by Xiang Zhang)
+
+2002-05-24 07:44 dts12
+
+ * apps/Makefile.in:
+
+ Remove extraneous trailing backslash.
+ (That *might* be confusing Sun's make, but is wrong anyway)
+
+2002-05-23 01:39 dts12
+
+ * agent/mibgroup/ucd-snmp/: vmstat.c, vmstat_bsdi4.c,
+ vmstat_dynix.c, vmstat_freebsd2.c, vmstat_hpux.c,
+ vmstat_netbsd1.c, vmstat_solaris2.c:
+
+ Bring the various 'var_extensible_vmstat' definitions into line
+ with the declaration in the header file - i.e. non-static.
+
+2002-05-21 15:25 rstory
+
+ * Makefile.in:
+
+ add -I$(srcdir)/include to CPP path for people building outside of src tree
+
+2002-05-21 08:14 rstory
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ apply patch [ 558129 ] Make the tunnel mib compile in 5.0.1, submitted
+ by Lorenzo Colitti (lcolitti), which adds missing net-snmp-config.h
+
+2002-05-21 05:32 jbpn
+
+ * agent/snmpd.c:
+
+ - fix core dump in -u option processing, noted by Andreas Maus
+
+2002-05-21 05:20 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory.c (V4-2-patches.9), memory.c
+:
+
+ Latch memory reporting at 2^31-1, rather than 2^32-1 since these
+ objects are defined as (signed) Integer32.
+ Only latch if the value is *greater* than this threshold, not less!
+
+2002-05-21 01:20 jbpn
+
+ * include/ucd-snmp/default_store.h, snmplib/ucd_compat.c
+:
+
+ - add compatibility definitions and functions for newly-renamed
+ default store manipulation functions and constants (defined iff
+ --enable-ucd-compatibility is given to at configuration time)
+
+2002-05-21 00:51 jbpn
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/default_store.c:
+
+ - move definition of netsnmp_ds_read_config type from default_store.h
+ into default_store.c (since it is not, and should not, be used
+ elsewhere).
+
+2002-05-20 03:42 rstory
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ registers tokens for ipv6 ro/rw community, and make sure to parse them
+ as ipv6, not v4.
+
+2002-05-19 11:38 driehuis
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Bugfix for FreeBSD support of the diskIO mib. The original code neglected
+ the device number, which made distinguishing between, say, ad0 and ad1
+ impossible.
+
+2002-05-17 09:05 hardaker
+
+ * agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/icmp.c
+, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ include/net-snmp/agent/var_struct.h:
+
+ Patch from Harrie Hazewinkel to slightly reduce memory costs of registartions
+
+2002-05-16 17:06 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ fix default store tag names.
+ fix init_snmp() definition to match normal perl non-ansi mode.
+
+2002-05-16 16:39 driehuis
+
+ * net-snmp-config.in:
+
+ Make sure --cflags spits out the required include path when installing
+ in a non-default location, as documented in the usage info in the script.
+
+2002-05-16 15:36 hardaker
+
+ * local/snmpconf.dir/snmpd-data/system:
+
+ add a line to the sysServices prompt saying if you don't know, say no.
+
+2002-05-16 12:55 hardaker
+
+ * perl/agent/default_store/: default_store.pm,
+ default_store.xs:
+
+ update to new define list
+
+2002-05-16 12:55 hardaker
+
+ * perl/agent/default_store/test.pl:
+
+ test script
+
+2002-05-16 12:49 hardaker
+
+ * perl/agent/default_store/gen:
+
+ autogeneration script
+
+2002-05-16 10:58 hardaker
+
+ * perl/default_store/: default_store.pm, default_store.xs
+, test.pl:
+
+ updates to new .h tokens
+
+2002-05-16 10:58 hardaker
+
+ * perl/default_store/gen:
+
+ .h -> perlmodule regeneration script
+
+2002-05-16 07:09 dts12
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/mib.h, snmplib/mib.c,
+ snmplib/snmp_api.c, snmplib/ucd_compat.c:
+
+ Consolidate the various OID output configuration mechanisms into one.
+ This does not affect the command-line options (yet!) - just the internals.
+
+2002-05-15 17:44 hardaker
+
+ * snmplib/default_store.c,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/agent/ds_agent.h:
+
+ fix default_store
+
+2002-05-15 17:20 hardaker
+
+ * configure:
+
+ run autoconf
+
+2002-05-15 17:20 hardaker
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ create a define location for HAVE_GETDEVS
+
+2002-05-15 17:16 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ depend update, which I meant to check in before the 5.0.1 release
+
+2002-05-15 05:53 jbpn
+
+ * agent/: agent_index.c, agent_read_config.c,
+ agent_registry.c, auto_nlist.c, kernel.c,
+ snmp_agent.c, snmp_perl.c, snmp_vars.c, snmpd.c
+:
+
+ - use new netsnmp_ds_blah functions and constants
+
+2002-05-15 05:39 jbpn
+
+ * apps/notification_log.c, apps/notification_log.h,
+ apps/snmpbulkwalk.c, apps/snmpdelta.c, apps/snmpget.c
+, apps/snmpgetnext.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptranslate.c, apps/snmptrap.c
+, apps/snmptrapd.c, apps/snmpusm.c,
+ apps/snmpwalk.c, apps/snmpnetstat/main.c,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/tunnel/tunnel.c:
+
+ - use new netsnmp_ds_blah functions and constants
+
+2002-05-15 05:37 jbpn
+
+ * snmplib/: default_store.c, mib.c, parse.c,
+ read_config.c, snmpUDPDomain.c, snmpUDPIPv6Domain.c
+, snmp_alarm.c, snmp_api.c, snmp_logging.c,
+ snmp_parse_args.c, snmp_secmod.c, snmpusm.c,
+ snmpv3.c, ucd_compat.c, vacm.c:
+
+ - rename functions and constants from default_store from ds_blah
+ to netsnmp_ds_blah
+
+2002-05-15 02:02 jbpn
+
+ * agent/mibgroup/smux/: smux.c (V4-2-patches.0), smux.c:
+
+ - initialise smux_listen_sd to avoid problems noted in bug #545448
+ (a bit unreasonable in my view but it can't do any harm).
+
+2002-05-14 12:40 rstory
+
+ * agent/helpers/table_array.c:
+
+ precision extraction of tumor instead of amputation, or, ifdef search.h
+ functions that aren't essential to table_array operation and will probably
+ vanish in the near future anyway.
+
+2002-05-13 20:16 rstory
+
+ * agent/object_monitor.c:
+
+ fix type in sizeof
+
+2002-05-13 13:04 hardaker
+
+ * configure, configure.in, agent/helpers/table_array.c
+, include/net-snmp/net-snmp-config.h.in:
+
+ Check for search.h before compiling the table_array helper
+
+2002-05-13 08:00 hardaker
+
+ * agent/helpers/old_api.c:
+
+ remove C++ comments
+
+2002-05-13 00:39 driehuis
+
+ * ChangeLog:
+
+ Note changes to configure.in.
+
+2002-05-12 10:30 driehuis
+
+ * configure.in:
+
+ Make sure the checks for kvm related stuff happens when -lkvm is in scope.
+ Add detection of the -ldevstat requirement when building with ucd-snmp/diskio.
+
+2002-05-10 23:33 hardaker
+
+ * FAQ, README, sedscript.in,
+ snmplib/snmp_version.c, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.1 )
+
+2002-05-10 23:05 hardaker
+
+ * Makefile.top:
+
+ libtool version inc
+
+2002-05-10 22:32 hardaker
+
+ * NEWS, ChangeLog:
+
+ update for 5.0.1
+
+2002-05-10 17:09 hardaker
+
+ * FAQ, NEWS, README, README.agentx:
+
+ mention tutorial-5 instead of tutorial
+
+2002-05-10 17:04 hardaker
+
+ * perl/agent/: Makefile.PL, agent.pm,
+ netsnmp_request_info.pm:
+
+ request info perl code moved to separate file.
+
+2002-05-10 17:01 hardaker
+
+ * perl/OID/OID.pm:
+
+ documentation for the OID building overloads.
+
+2002-05-10 16:55 hardaker
+
+ * apps/snmpvacm.c:
+
+ Add proper length segment to the build view OID.
+
+2002-05-10 14:41 hardaker
+
+ * snmplib/mib.c:
+
+ new doc patch from Axel Kittenberg
+
+2002-05-10 14:04 hardaker
+
+ * agent/mibgroup/mibII/: vacm_vars.c (V4-2-patches.0), vacm_vars.c
+:
+
+ fix vacm problem on sets with OIDs containing large numbers as noted
+ by Vinay Gaonkar on the -coders mailing list.
+
+2002-05-10 13:46 hardaker
+
+ * local/mib2c:
+
+ fix calling on multiple tables
+
+2002-05-10 03:23 dts12
+
+ * snmplib/mib.c:
+
+ Merge "STRING: Hex:" type tokens into a single token "Hex-STRING:"
+
+2002-05-10 03:12 dts12
+
+ * agent/helpers/instance.c:
+
+ Report non-existent subinstances as 'noSuchInstance' rather than 'noSuchObject'.
+ "snmpget .... .1.3.6.1.6.3.12.1.5.0.99" now responds correctly.
+ (though "snmpget .... .1.3.6.1.6.3.12.1.5.1" still returns 'noSuchObject')
+
+ Also guess that failed SET requests are 'noCreation' errors (which is
+ probably the most likely option).
+
+2002-05-09 15:54 hardaker
+
+ * Makefile.rules:
+
+ exit properly when a subdir fails to make properly
+
+2002-05-09 15:30 hardaker
+
+ * snmplib/mib.c:
+
+ create a token for the -Ov equivelant
+
+2002-05-09 09:12 hardaker
+
+ * agent/mibgroup/ucd-snmp/: memory_solaris2.c (V4-2-patches.5),
+ memory_solaris2.c:
+
+ patch from Takumi Kadode to fix memory usage on solaris
+
+2002-05-09 08:54 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ updates from malloced vmstat fixes from patches branch
+
+2002-05-08 16:34 hardaker
+
+ * net-snmp-config.in:
+
+ new --compile-subagent features:
+ --cflags
+ --norm
+ --ldflags
+ includes header files
+ misc other bug fixes.
+
+2002-05-08 13:13 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ make the subagent properly call the reserve2 state again.
+
+2002-05-08 10:02 hardaker
+
+ * agent/mibgroup/examples/notification.c:
+
+ run indent
+
+2002-05-08 09:01 hardaker
+
+ * agent/mibgroup/examples/notification.c:
+
+ um, use 30 seconds like advertised.
+
+2002-05-08 08:59 hardaker
+
+ * agent/mibgroup/examples/notification.c,
+ agent/mibgroup/examples/notification.h,
+ mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ define a better notification example (no requests. just alarm -> send)
+
+2002-05-07 22:45 hardaker
+
+ * local/mib2c:
+
+ update to current indent command
+
+2002-05-07 22:44 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ move text in comment left slight (was too long).
+
+2002-05-07 22:43 hardaker
+
+ * local/mib2c:
+
+ enum fixes.
+
+2002-05-07 22:42 hardaker
+
+ * local/: Makefile.in, mib2c.column_defines.conf,
+ mib2c.column_enums.conf, mib2c.conf:
+
+ New mib2c files for generating headers full of column number defines
+ and enum defines.
+
+2002-05-07 22:40 hardaker
+
+ * net-snmp-config.in:
+
+ - --compile-subagent agent library reordering so it actually works.
+ - --compile-subagent now supports .o files (precompiled code).
+
+2002-05-07 22:31 hardaker
+
+ * acconfig.h, configure:
+
+ hmm. missed some checkin files.
+
+2002-05-07 11:15 hardaker
+
+ * perl/SNMP/t/: conftest.conf, startagent.pl, conf.t
+:
+
+ test for configuration file/default_store support
+
+2002-05-07 11:14 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ make init_snmp() take a char * argument like the real API
+
+2002-05-07 11:00 hardaker
+
+ * agent/helpers/instance.c:
+
+ typos.
+
+2002-05-07 09:41 hardaker
+
+ * local/snmpconf:
+
+ fix the -g flag.
+
+2002-05-07 09:16 hardaker
+
+ * agent/helpers/instance.c:
+
+ call netsnmp_set_request_error like a good boy.
+
+2002-05-06 20:43 rstory
+
+ * mibs/Makefile.mib:
+
+ fix missing $ noted by John Mills on the coders list
+
+2002-05-06 16:12 hardaker
+
+ * configure, config.h.in, configure.in, snmplib/snmp_api.c
+ (V4-2-patches.[4,2,3,3]), configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ use size_t when socklen_t is not available (correctly done this time)
+
+2002-05-06 15:59 hardaker
+
+ * snmplib/: snmpTCPDomain.c, snmpTCPIPv6Domain.c,
+ snmpUDPDomain.c, snmpUDPIPv6Domain.c, snmpUnixDomain.c
+:
+
+ use size_t when socklen_t is not available
+
+2002-05-06 15:49 hardaker
+
+ * configure, acconfig.h, config.h.in, configure.in
+ (V4-2-patches.[3,7,1,2]), acconfig.h, configure,
+ configure.in, include/net-snmp/net-snmp-config.h.in:
+
+ use size_t when socklen_t is not available
+
+2002-05-06 15:11 hardaker
+
+ * agent/mibgroup/ucd-snmp/: memory_hpux.c, memory_hpux.h
+, vmstat_hpux.c, vmstat_hpux.h:
+
+ run indent
+
+2002-05-06 15:10 hardaker
+
+ * agent/mibgroup/ucd-snmp/: memory_hpux.c, memory_hpux.h
+, vmstat_hpux.c, vmstat_hpux.h:
+
+ Patches #551914+ from Gary Edwards to support hpux11 for memory and vmstat modules
+
+2002-05-06 15:07 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ add new hpux modules
+
+2002-05-06 14:34 hardaker
+
+ * README:
+
+ new contributors.
+
+2002-05-06 14:32 hardaker
+
+ * include/net-snmp/library/default_store.h, man/snmpcmd.1.def
+, snmplib/mib.c:
+
+ Patch #551489: From Jeffrey Watson to add a -Q option for quick but w/ an '='
+
+2002-05-06 14:28 hardaker
+
+ * man/snmpd.1.def:
+
+ change -D documentation to reflect current code.
+
+2002-05-06 14:27 hardaker
+
+ * agent/agent_handler.c:
+
+ misc small bugs and error message wording fixes.
+
+2002-05-06 09:37 hardaker
+
+ * agent/mibgroup/smux/: smux.c (V4-2-patches.9), smux.c:
+
+ bug #547010: fix smux auth bug as reported and fixed by Stefan Radman
+
+2002-05-01 23:01 rstory
+
+ * local/mib2c.array-user.conf:
+
+ tweaks for update to table_array
+
+2002-05-01 23:00 rstory
+
+ * agent/Makefile.in:
+
+ add object_monitor stuff
+
+2002-05-01 22:46 rstory
+
+ * snmplib/Makefile.in:
+
+ add check_varbind stuff
+
+2002-05-01 22:45 rstory
+
+ * include/net-snmp/library/check_varbind.h,
+ snmplib/check_varbind.c:
+
+ convenience functions for validation vabrind info
+
+2002-05-01 22:43 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h:
+
+ do I really have to do this? sigh. Ok, rename debug token; revamp logic to
+ modify rows in place, keeping undo info (vs always changing a copy of a row
+ and swapping rows when set completed successfully) to allow external code
+ to keep pointers that don't disappear on them; add a few callbacks, including
+ row_compare, so table_array can maintain the secondary index tree; don't call
+ can_activate/can_delete unless we are actually trying to activate/delete row;
+ add skeleton (ifdef'd out) code for cooperative notifications of row events;
+ update changing array in commit & undo cases, not just commit; change typdefs
+ for a few callback pointers; ummmm... I *think* that's it....:-)
+
+2002-05-01 17:30 hardaker
+
+ * perl/OID/: OID.pm, OID.xs, test.pl:
+
+ Add index building to the + operator.
+
+2002-05-01 09:52 hardaker
+
+ * perl/: OID/OID.pm, OID/OID.xs, agent/Makefile.PL
+, agent/agent.pm, agent/agent.xs, agent/test.pl
+, agent/typemap:
+
+ Make getOID for requests returned a NetSNMP::OID blessed reference.
+ I'm not happy about how this is done, but all attempts to do it
+ correctly only left me in confusion.
+
+2002-05-01 09:31 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpTCPIPv6Domain.c
+, snmplib/snmpUDPIPv6Domain.c, snmplib/snmpUnixDomain.c
+:
+
+ Change the domain OIDs to point to the net-snmp domains created by Dave.
+ This fixes bug #544245 as well.
+
+2002-05-01 09:30 hardaker
+
+ * Makefile.in:
+
+ Add the OID perl module to the list of modules.
+
+2002-05-01 07:45 hardaker
+
+ * mibs/: UCD-SNMP-MIB.txt (V4-2-patches.0), UCD-SNMP-MIB.txt:
+
+ remove old (and conflicting with traps) transport domain OIDs
+
+2002-05-01 06:19 dts12
+
+ * man/: snmpbulkget.1.def, snmpbulkwalk.1.def,
+ snmpcmd.1.def, snmpdelta.1, snmpget.1.def,
+ snmpset.1.def, snmpstatus.1.def, snmptest.1.def,
+ snmpwalk.1.def:
+
+ Add type tags "STRING: " and "INTEGER: " to example output.
+ Add explicit setting of protocol version to example commands.
+
+2002-05-01 03:34 jbpn
+
+ * agent/mibgroup/Rmon/: agutil.c, agutil.h,
+ agutil_api.h, alarm.c, alarm.h, event.c,
+ event.h, history.c, history.h, row_api.h,
+ rows.c, rows.h, statistics.c, statistics.h:
+
+ - remove CVS Log: entries which are causing problems since they are
+ embedded in a comment, but some of the log entries contain comment
+ delimiters.
+
+2002-04-30 22:15 rstory
+
+ * agent/snmpd.c:
+
+ remove netsnmp_processing_set, it lives in snmp_agent.c
+
+2002-04-30 22:13 rstory
+
+ * include/net-snmp/library/snmp-tc.h, snmplib/snmp-tc.c
+:
+
+ remove unused parameter; allow NONE as old value for storage type transtions
+
+2002-04-30 22:12 rstory
+
+ * include/net-snmp/agent/table.h:
+
+ remove overly complex macro stuff for rowstatus/storagetype
+
+2002-04-30 09:28 hardaker
+
+ * perl/OID/: Makefile.PL, OID.pm, OID.xs, README
+, test.pl:
+
+ - allow conversions to an array (needs to be tied still).
+ - documentation.
+
+2002-04-30 08:15 jbpn
+
+ * agent/: snmpd.c (V4-2-patches.3), snmpd.c:
+
+ - fix bug #545775, reported by Dave Denson, whereby the PID of an
+ already-running snmpd would be overwritten by starting a new snmpd
+ (which would then exit, leaving the original snmpd running and the
+ wrong PID in the file). Solution is not to write the PID until we
+ have successfully opened all our sockets.
+
+2002-04-30 07:23 hardaker
+
+ * perl/OID/: .cvsignore, Changes, MANIFEST,
+ Makefile.PL, OID.pm, OID.xs, README,
+ test.pl, typemap:
+
+ OID perl module so you can do simple OID manipulations within perl easily:
+ - Example: new NetSNMP::OID('interfaces') > new NetSNMP::OID('system')
+
+2002-04-29 16:52 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ regexp fix for white space checks in indent formatted code
+
+2002-04-29 16:47 hardaker
+
+ * Makefile.in:
+
+ reorder perl module names to reflect (new) dependencies.
+
+2002-04-29 09:42 hardaker
+
+ * perl/SNMP/t/mib.t:
+
+ fix a few warnings on failed tests (just screen cleanups)
+
+2002-04-29 09:41 hardaker
+
+ * perl/SNMP/: Makefile.PL, SNMP.pm:
+
+ Make the perl module respect snmp.conf settings (finally).
+ - Now requires a dependency on the NetSNMP::default_store module though.
+
+2002-04-27 08:19 rstory
+
+ * agent/snmp_agent.c:
+
+ don't process set request till delegated requests are complete, and queue
+ any other received packets until a set has completed processing.
+
+2002-04-27 08:10 rstory
+
+ * snmplib/snmp_api.c:
+
+ clean up comments munged by indent
+
+2002-04-27 08:08 rstory
+
+ * agent/mibgroup/agentx/subagent.h:
+
+ add missing prototype to fix compiler warning
+
+2002-04-27 08:07 rstory
+
+ * agent/: object_monitor.c, helpers/table.c,
+ helpers/table_array.c:
+
+ ifdef gymnastics to make sure asserts are only compiled in only if explicity
+ requested
+
+2002-04-26 21:26 rstory
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ fix unbalanced endif on linux. hope I didn't break anything else.
+
+2002-04-26 19:14 rstory
+
+ * agent/snmpd.c:
+
+ fix unused var warning for !windows
+
+2002-04-26 14:33 hardaker
+
+ * agent/mibgroup/Rmon/event.c,
+ include/net-snmp/library/asn1.h:
+
+ fix OID_LENGTH definitions
+
+2002-04-26 10:53 hardaker
+
+ * Makefile.in, perl/ASN/Makefile.PL,
+ perl/agent/Makefile.PL, perl/agent/default_store/Makefile.PL
+:
+
+ fix --with-perl-modules in makefiles. Make everything use
+ net-snmp-config, ...
+
+2002-04-26 10:27 hardaker
+
+ * perl/SNMP/: Makefile.PL, README, SNMP.pm:
+
+ - Cleanup.
+ - Make buildable from within the source.
+ - Change documentation references for ucd-snmp
+ - Change contact location to net-snmp-users (per Joe's agreement)
+
+2002-04-26 10:19 hardaker
+
+ * perl/default_store/: MANIFEST, Makefile.PL, README
+, default_store.pm, test.pl:
+
+ - cleanup.
+ - Use net-snmp-config to find library, etc.
+ - Make buildable from within the source.
+ - a few more tests added
+ - use correct libraries
+ - add documentation
+
+2002-04-26 04:22 dts12
+
+ * configure, configure.in:
+
+ Extracting the version from 'snmplib/snmp_version.c' needs to take account
+ of blank space. Reported by Stefan Radman (Bug #547379)
+
+2002-04-26 04:11 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory.c (V4-2-patches.8), memory.c
+:
+
+ Handle memory values > 32bit (latching at 2^32-1)
+ Patch #548663 from Rob Myers
+
+2002-04-26 03:55 dts12
+
+ * agent/snmpd.c:
+
+ Remove redundant 'Invalid option' message, since this is typically
+ reported by getopt(). (Suggested by Andrew Rucker Jones - patch #548748 )
+
+2002-04-26 03:51 dts12
+
+ * agent/snmpd.c:
+
+ Add 'v' to the list of valid options (patch #548748)
+ Thanks to Andrew Rucker Jones.
+
+2002-04-26 03:36 dts12
+
+ * README.hpux11, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/mibII/var_route.c,
+ include/net-snmp/system/hpux.h,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h:
+
+ Apply Johannes Schmidt-Fischer's improved HP-UX 11 patch
+ (#530724) to the main v5 line, as well as the v4-2 branch.
+ The code now compiles cleanly under HP-UX 11 using gcc.
+
+2002-04-25 07:19 hardaker
+
+ * README, include/net-snmp/library/vacm.h,
+ snmplib/vacm.c:
+
+ Patch from Axel Kittenberg to fix possible variable name clash
+
+2002-04-24 22:39 rstory
+
+ * agent/object_monitor.c:
+
+ handle callbacks sending new notifications (while processing notifications)
+
+2002-04-24 21:35 rstory
+
+ * include/net-snmp/agent/object_monitor.h:
+
+ header for new fucntions for monitoring objects
+
+2002-04-24 21:34 rstory
+
+ * agent/object_monitor.c:
+
+ new functions for monitoring object values
+
+2002-04-24 15:02 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ /proc/stat can be larger than 1024
+
+2002-04-24 06:19 dts12
+
+ * snmplib/Makefile.in:
+
+ Install the missing 'md5.h' header file.
+
+2002-04-23 09:43 rstory
+
+ * agent/helpers/: table.c, table_array.c:
+
+ remove last of the #warnings, add xxx-rks if necessary
+
+2002-04-23 07:53 hardaker
+
+ * agent/helpers/table_array.c:
+
+ remove warnings
+
+2002-04-22 19:11 rstory
+
+ * agent/mibgroup/ipfwchains/README:
+
+ update URL to use freenmp.com mirror (unless someone knows a better place?)
+
+2002-04-22 14:10 rstory
+
+ * snmplib/mib.c:
+
+ apply documentatin patch from Axel Kittenberger <Axel.Kittenberger@maxxio.com>
+
+2002-04-22 13:50 rstory
+
+ * local/mib2c.array-user.conf:
+
+ remove extra @end@ (sure would be nice if mib2c would check for unbalanced
+ @end@s)
+
+2002-04-22 09:48 rstory
+
+ * snmplib/oid_array.c:
+
+ update function names to match header (no mixed case)
+
+2002-04-22 08:11 hardaker
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ fix bug #547110: properly spell define
+
+2002-04-21 16:44 hardaker
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ add static to a returned variable
+
+2002-04-21 16:42 hardaker
+
+ * configure, configure.in:
+
+ fix --with-perl-modules
+
+2002-04-21 11:37 rstory
+
+ * snmplib/snmp_version.c:
+
+ 5.0.pre3 -> 5.0; (I'm sure there are other places this needs to change,
+ but I wanted to get the first post 5.0 checkin...:-)
+
+2002-04-20 00:37 hardaker
+
+ * FAQ, sedscript.in, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0 )
+
+2002-04-20 00:32 hardaker
+
+ * NEWS:
+
+ change version to 5.0
+
+2002-04-20 00:29 hardaker
+
+ * .cvsignore, AGENT.txt, COPYING, ChangeLog
+, CodingStyle, EXAMPLE.conf.def, FAQ,
+ INSTALL, Makefile.in, Makefile.rules,
+ Makefile.top, NEWS, PORTING, README,
+ README.agentx, README.cmu, README.hpux11,
+ README.krb5, README.snmpv3, README.thread,
+ README.win32, TODO, acconfig.h, aclocal.m4,
+ config.guess, config.sub, configure, configure.in
+, dotgdbinit, doxygen.conf, install-sh,
+ ltmain.sh, makedepend.in, makefileindepend.pl,
+ makenosysdepend.pl, maketarget, mkinstalldirs,
+ net-snmp-config.in, remove-files, sedscript.in,
+ stamp-h, stamp-h.in, agent/.cvsignore,
+ agent/Makefile.depend, agent/Makefile.in,
+ agent/agent_handler.c, agent/agent_index.c,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/auto_nlist.c,
+ agent/autonlist.h, agent/kernel.c, agent/kernel.h
+, agent/m2m.h, agent/mib_modules.c,
+ agent/snmp_agent.c, agent/snmp_perl.c,
+ agent/snmp_perl.pl, agent/snmp_vars.c, agent/snmpd.c
+, agent/snmpd.h, agent/dlmods/.cvsignore,
+ agent/helpers/.cvsignore, agent/helpers/Makefile.depend
+, agent/helpers/Makefile.in, agent/helpers/all_helpers.c
+, agent/helpers/bulk_to_next.c,
+ agent/helpers/debug_handler.c, agent/helpers/instance.c
+, agent/helpers/multiplexer.c, agent/helpers/null.c
+, agent/helpers/old_api.c, agent/helpers/read_only.c
+, agent/helpers/serialize.c, agent/helpers/table.c
+, agent/helpers/table_array.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, agent/helpers/table_iterator.c,
+ agent/mibgroup/.cvsignore, agent/mibgroup/Makefile.depend
+, agent/mibgroup/Makefile.in, agent/mibgroup/README
+, agent/mibgroup/README.smux, agent/mibgroup/Rmon.h
+, agent/mibgroup/agent_mibs.h, agent/mibgroup/agentx.h
+, agent/mibgroup/examples.h,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/header_complex.h, agent/mibgroup/host.h,
+ agent/mibgroup/host_res.h, agent/mibgroup/kernel_sunos5.c
+, agent/mibgroup/kernel_sunos5.h, agent/mibgroup/mibII.h
+, agent/mibgroup/mibdefs.h, agent/mibgroup/mibincl.h
+, agent/mibgroup/notification.h, agent/mibgroup/smux.h
+, agent/mibgroup/smux_gated.h,
+ agent/mibgroup/snmpv3mibs.h, agent/mibgroup/struct.h,
+ agent/mibgroup/target.h, agent/mibgroup/testhandler.c,
+ agent/mibgroup/testhandler.h, agent/mibgroup/tunnel.h,
+ agent/mibgroup/ucd_snmp.h, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/util_funcs.h, agent/mibgroup/utilities.h
+, agent/mibgroup/versiontag, agent/mibgroup/Rmon/README
+, agent/mibgroup/Rmon/agutil.c,
+ agent/mibgroup/Rmon/agutil.h,
+ agent/mibgroup/Rmon/agutil_api.h, agent/mibgroup/Rmon/alarm.c
+, agent/mibgroup/Rmon/alarm.h,
+ agent/mibgroup/Rmon/event.c, agent/mibgroup/Rmon/event.h
+, agent/mibgroup/Rmon/history.c,
+ agent/mibgroup/Rmon/history.h, agent/mibgroup/Rmon/row_api.h
+, agent/mibgroup/Rmon/rows.c, agent/mibgroup/Rmon/rows.h
+, agent/mibgroup/Rmon/statistics.c,
+ agent/mibgroup/Rmon/statistics.h,
+ agent/mibgroup/Rmon/test_alarm.sh,
+ agent/mibgroup/Rmon/test_hist.sh,
+ agent/mibgroup/agent/.cvsignore,
+ agent/mibgroup/agent/nsModuleTable.c,
+ agent/mibgroup/agent/nsModuleTable.h,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsTransactionTable.h,
+ agent/mibgroup/agentx/.cvsignore,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/agentx_config.h,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/client.h,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master.h,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_admin.h,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/protocol.h,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/agentx/subagent.h,
+ agent/mibgroup/disman/.cvsignore,
+ agent/mibgroup/disman/event-mib.h,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteObjectsTable.h,
+ agent/mibgroup/disman/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/mteTriggerBooleanTable.h,
+ agent/mibgroup/disman/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/mteTriggerDeltaTable.h,
+ agent/mibgroup/disman/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/mteTriggerExistenceTable.h,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerTable.h,
+ agent/mibgroup/disman/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/mteTriggerThresholdTable.h,
+ agent/mibgroup/dummy/.cvsignore,
+ agent/mibgroup/examples/.cvsignore,
+ agent/mibgroup/examples/Makefile.dlmod,
+ agent/mibgroup/examples/data_set.c,
+ agent/mibgroup/examples/data_set.h,
+ agent/mibgroup/examples/delayed_instance.c,
+ agent/mibgroup/examples/delayed_instance.h,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/example.h,
+ agent/mibgroup/examples/scalar_int.c,
+ agent/mibgroup/examples/scalar_int.h,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/examples/ucdDemoPublic.cmds,
+ agent/mibgroup/examples/ucdDemoPublic.conf,
+ agent/mibgroup/examples/ucdDemoPublic.h,
+ agent/mibgroup/host/.cvsignore,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_device.h,
+ agent/mibgroup/host/hr_disk.c, agent/mibgroup/host/hr_disk.h
+, agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_filesys.h,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_network.h,
+ agent/mibgroup/host/hr_other.c,
+ agent/mibgroup/host/hr_other.h,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_partition.h,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_print.h, agent/mibgroup/host/hr_proc.c
+, agent/mibgroup/host/hr_proc.h,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_storage.h,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swinst.h,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_swrun.h,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hr_system.h,
+ agent/mibgroup/ipfwchains/.cvsignore,
+ agent/mibgroup/ipfwchains/README,
+ agent/mibgroup/mibII/.cvsignore, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/at.h, agent/mibgroup/mibII/icmp.c
+, agent/mibgroup/mibII/icmp.h,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ip.h,
+ agent/mibgroup/mibII/ipAddr.c, agent/mibgroup/mibII/ipAddr.h
+, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/ipv6.h,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/kernel_linux.h,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/mta_sendmail.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/route_write.h,
+ agent/mibgroup/mibII/setSerialNo.c,
+ agent/mibgroup/mibII/setSerialNo.h,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib.h,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/system_mib.h, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/mibII/tcp.h,
+ agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/tcpTable.h, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/udp.h,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/udpTable.h,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_context.h,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/mibII/var_route.h,
+ agent/mibgroup/misc/.cvsignore, agent/mibgroup/misc/dlmod.c
+, agent/mibgroup/misc/dlmod.h,
+ agent/mibgroup/misc/ipfwacc.c, agent/mibgroup/misc/ipfwacc.h
+, agent/mibgroup/notification/.cvsignore,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.h,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterTable.h,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.h,
+ agent/mibgroup/smux/.cvsignore, agent/mibgroup/smux/smux.c
+, agent/mibgroup/smux/smux.h,
+ agent/mibgroup/smux/snmp_bgp.c,
+ agent/mibgroup/smux/snmp_bgp.h,
+ agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_ospf.h,
+ agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/smux/snmp_rip2.h,
+ agent/mibgroup/snmpv3/.cvsignore,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpEngine.h,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.h,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats.h,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/target/.cvsignore,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.h,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/target/target.h,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/target/target_counters.h,
+ agent/mibgroup/tunnel/tunnel.c,
+ agent/mibgroup/tunnel/tunnel.h,
+ agent/mibgroup/ucd-snmp/.cvsignore,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/disk.h,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/diskio.h,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/dlmod.h,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/errormib.h,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/file.h,
+ agent/mibgroup/ucd-snmp/hpux.c,
+ agent/mibgroup/ucd-snmp/hpux.h,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ agent/mibgroup/ucd-snmp/lmSensors.h,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/loadave.h,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/logmatch.h,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h,
+ agent/mibgroup/ucd-snmp/memory_dynix.c,
+ agent/mibgroup/ucd-snmp/memory_dynix.h,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.h,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.h,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass.h,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/pass_persist.h,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proc.h,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/proxy.h,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/versioninfo.h,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat.h,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.h,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.c,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.h,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.h,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.h,
+ agent/mibgroup/utilities/.cvsignore,
+ agent/mibgroup/utilities/override.c,
+ agent/mibgroup/utilities/override.h,
+ agent/mibgroup/v2party/.cvsignore,
+ agent/mibgroup/vestinternett/.cvsignore, apps/.cvsignore
+, apps/Makefile.depend, apps/Makefile.in,
+ apps/encode_keychange.c, apps/notification_log.c,
+ apps/notification_log.h, apps/snmpbulkget.c,
+ apps/snmpbulkwalk.c, apps/snmpdelta.c, apps/snmpdf.c
+, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpset.c, apps/snmpstatus.c, apps/snmptable.c
+, apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c,
+ apps/snmptrapd_handlers.c, apps/snmptrapd_handlers.h,
+ apps/snmptrapd_log.c, apps/snmptrapd_log.h,
+ apps/snmpusm.c, apps/snmpvacm.c, apps/snmpwalk.c,
+ apps/snmpnetstat/.cvsignore, apps/snmpnetstat/Makefile.depend
+, apps/snmpnetstat/Makefile.in, apps/snmpnetstat/if.c
+, apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c
+, apps/snmpnetstat/main.c, apps/snmpnetstat/main.h
+, apps/snmpnetstat/netstat.h, apps/snmpnetstat/route.c
+, apps/snmpnetstat/winstub.c, apps/snmpnetstat/winstub.h
+, include/net-snmp/.cvsignore,
+ include/net-snmp/config_api.h, include/net-snmp/definitions.h
+, include/net-snmp/mib_api.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/net-snmp-includes.h,
+ include/net-snmp/output_api.h, include/net-snmp/pdu_api.h
+, include/net-snmp/session_api.h,
+ include/net-snmp/snmpv3_api.h, include/net-snmp/types.h
+, include/net-snmp/utilities.h,
+ include/net-snmp/varbind_api.h, include/net-snmp/version.h
+, include/net-snmp/agent/.cvsignore,
+ include/net-snmp/agent/agent_callbacks.h,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/agent_index.h,
+ include/net-snmp/agent/agent_read_config.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/agent_trap.h,
+ include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/auto_nlist.h,
+ include/net-snmp/agent/bulk_to_next.h,
+ include/net-snmp/agent/debug_handler.h,
+ include/net-snmp/agent/ds_agent.h,
+ include/net-snmp/agent/instance.h,
+ include/net-snmp/agent/mib_modules.h,
+ include/net-snmp/agent/multiplexer.h,
+ include/net-snmp/agent/net-snmp-agent-includes.h,
+ include/net-snmp/agent/null.h,
+ include/net-snmp/agent/old_api.h,
+ include/net-snmp/agent/read_only.h,
+ include/net-snmp/agent/serialize.h,
+ include/net-snmp/agent/set_helper.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/snmp_vars.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/agent/var_struct.h,
+ include/net-snmp/library/.cvsignore,
+ include/net-snmp/library/README,
+ include/net-snmp/library/asn1.h,
+ include/net-snmp/library/callback.h,
+ include/net-snmp/library/cmu_compat.h,
+ include/net-snmp/library/data_list.h,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/getopt.h,
+ include/net-snmp/library/int64.h,
+ include/net-snmp/library/keytools.h,
+ include/net-snmp/library/lcd_time.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/library/md5.h,
+ include/net-snmp/library/mib.h,
+ include/net-snmp/library/mt_support.h,
+ include/net-snmp/library/oid_array.h,
+ include/net-snmp/library/oid_stash.h,
+ include/net-snmp/library/parse.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/scapi.h,
+ include/net-snmp/library/snmp-tc.h,
+ include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpIPXDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_alarm.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_enum.h,
+ include/net-snmp/library/snmp_impl.h,
+ include/net-snmp/library/snmp_locking.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/library/snmp_parse_args.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/snmpksm.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/snmpv3.h,
+ include/net-snmp/library/system.h,
+ include/net-snmp/library/tools.h,
+ include/net-snmp/library/transform_oids.h,
+ include/net-snmp/library/ucd_compat.h,
+ include/net-snmp/library/vacm.h,
+ include/net-snmp/library/winservice.h,
+ include/net-snmp/machine/generic.h,
+ include/net-snmp/system/aix.h, include/net-snmp/system/bsd.h
+, include/net-snmp/system/bsdi.h,
+ include/net-snmp/system/bsdi3.h,
+ include/net-snmp/system/bsdi4.h,
+ include/net-snmp/system/cygwin.h,
+ include/net-snmp/system/darwin.h,
+ include/net-snmp/system/dynix.h,
+ include/net-snmp/system/freebsd.h,
+ include/net-snmp/system/freebsd2.h,
+ include/net-snmp/system/freebsd3.h,
+ include/net-snmp/system/freebsd4.h,
+ include/net-snmp/system/generic.h,
+ include/net-snmp/system/hpux.h,
+ include/net-snmp/system/irix.h,
+ include/net-snmp/system/linux.h,
+ include/net-snmp/system/mips.h,
+ include/net-snmp/system/netbsd.h,
+ include/net-snmp/system/openbsd.h,
+ include/net-snmp/system/solaris.h,
+ include/net-snmp/system/solaris2.6.h,
+ include/net-snmp/system/solaris2.7.h,
+ include/net-snmp/system/solaris2.8.h,
+ include/net-snmp/system/sunos.h,
+ include/net-snmp/system/svr5.h,
+ include/net-snmp/system/sysv.h,
+ include/net-snmp/system/ultrix4.h,
+ include/ucd-snmp/.cvsignore, include/ucd-snmp/README,
+ include/ucd-snmp/agent_index.h,
+ include/ucd-snmp/agent_read_config.h,
+ include/ucd-snmp/agent_registry.h,
+ include/ucd-snmp/agent_trap.h, include/ucd-snmp/asn1.h,
+ include/ucd-snmp/auto_nlist.h, include/ucd-snmp/callback.h
+, include/ucd-snmp/default_store.h,
+ include/ucd-snmp/ds_agent.h,
+ include/ucd-snmp/header_complex.h, include/ucd-snmp/int64.h
+, include/ucd-snmp/keytools.h, include/ucd-snmp/mib.h
+, include/ucd-snmp/mib_module_config.h,
+ include/ucd-snmp/mibincl.h, include/ucd-snmp/parse.h,
+ include/ucd-snmp/read_config.h, include/ucd-snmp/scapi.h
+, include/ucd-snmp/snmp-tc.h, include/ucd-snmp/snmp.h
+, include/ucd-snmp/snmp_agent.h,
+ include/ucd-snmp/snmp_alarm.h, include/ucd-snmp/snmp_api.h
+, include/ucd-snmp/snmp_client.h,
+ include/ucd-snmp/snmp_debug.h, include/ucd-snmp/snmp_impl.h
+, include/ucd-snmp/snmp_logging.h,
+ include/ucd-snmp/snmp_parse_args.h,
+ include/ucd-snmp/snmp_vars.h, include/ucd-snmp/snmpusm.h
+, include/ucd-snmp/snmpv3.h, include/ucd-snmp/struct.h
+, include/ucd-snmp/system.h, include/ucd-snmp/tools.h
+, include/ucd-snmp/transform_oids.h,
+ include/ucd-snmp/ucd-snmp-agent-includes.h,
+ include/ucd-snmp/ucd-snmp-config.h,
+ include/ucd-snmp/ucd-snmp-includes.h,
+ include/ucd-snmp/util_funcs.h, include/ucd-snmp/var_struct.h
+, include/ucd-snmp/version.h, local/.cvsignore,
+ local/FAQ2HTML, local/Makefile.in, local/README.mib2c
+, local/convertcode, local/fixproc,
+ local/ipf-mod.pl, local/mib2c,
+ local/mib2c.array-user.conf, local/mib2c.conf,
+ local/mib2c.create-dataset.conf, local/mib2c.iterate.conf
+, local/mib2c.vartypes.conf, local/pass_persisttest
+, local/passtest, local/snmp-ucd.sh,
+ local/snmpcheck.def, local/snmpconf, local/tkmib,
+ local/traptoemail, local/snmpconf.dir/snmp-data/authopts
+, local/snmpconf.dir/snmp-data/debugging,
+ local/snmpconf.dir/snmp-data/mibs,
+ local/snmpconf.dir/snmp-data/output,
+ local/snmpconf.dir/snmp-data/snmpconf-config,
+ local/snmpconf.dir/snmpd-data/acl,
+ local/snmpconf.dir/snmpd-data/basic_setup,
+ local/snmpconf.dir/snmpd-data/extending,
+ local/snmpconf.dir/snmpd-data/monitor,
+ local/snmpconf.dir/snmpd-data/operation,
+ local/snmpconf.dir/snmpd-data/snmpconf-config,
+ local/snmpconf.dir/snmpd-data/system,
+ local/snmpconf.dir/snmpd-data/trapsinks,
+ local/snmpconf.dir/snmptrapd-data/formatting,
+ local/snmpconf.dir/snmptrapd-data/snmpconf-config,
+ local/snmpconf.dir/snmptrapd-data/traphandle, man/.cvsignore
+, man/Makefile.in, man/add_mibdir.3,
+ man/add_module_replacement.3, man/default_store.3.bot,
+ man/default_store.3.top, man/get_module_node.3,
+ man/init_mib.3, man/init_mib_internals.3,
+ man/mib2c.1.def, man/mib_api.3.def, man/netsnmp_agent.3
+, man/netsnmp_bulk_to_next.3, man/netsnmp_debug.3,
+ man/netsnmp_example_scalar_int.3, man/netsnmp_handler.3
+, man/netsnmp_instance.3,
+ man/netsnmp_mib_handler_methods.3, man/netsnmp_multiplexer.3
+, man/netsnmp_old_api.3, man/netsnmp_read_only.3,
+ man/netsnmp_serialize.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_iterator.3
+, man/netsnmp_todo.3, man/print_description.3,
+ man/print_mib.3, man/print_objid.3, man/print_value.3
+, man/print_variable.3, man/read_all_mibs.3,
+ man/read_config.3.def, man/read_mib.3,
+ man/read_module.3, man/read_module_node.3,
+ man/read_objid.3, man/shutdown_mib.3,
+ man/snmp.conf.5.def, man/snmp_agent_api.3.def,
+ man/snmp_alarm.3.def, man/snmp_api.3.def,
+ man/snmp_api_errstring.3, man/snmp_close.3,
+ man/snmp_config.5.def, man/snmp_error.3,
+ man/snmp_free_pdu.3, man/snmp_open.3, man/snmp_perror.3
+, man/snmp_read.3, man/snmp_select_info.3,
+ man/snmp_send.3, man/snmp_sess_api.3.def,
+ man/snmp_sess_async_send.3, man/snmp_sess_close.3,
+ man/snmp_sess_error.3, man/snmp_sess_init.3,
+ man/snmp_sess_open.3, man/snmp_sess_perror.3,
+ man/snmp_sess_read.3, man/snmp_sess_select_info.3,
+ man/snmp_sess_send.3, man/snmp_sess_session.3,
+ man/snmp_sess_timeout.3, man/snmp_set_mib_warnings.3,
+ man/snmp_set_save_descriptions.3, man/snmp_timeout.3,
+ man/snmp_trap_api.3.def, man/snmpbulkget.1.def,
+ man/snmpbulkwalk.1.def, man/snmpcmd.1.def,
+ man/snmpconf.1.def, man/snmpd.1.def,
+ man/snmpd.conf.5.def, man/snmpdelta.1, man/snmpdf.1
+, man/snmpget.1.def, man/snmpgetnext.1.def,
+ man/snmpinform.1, man/snmpnetstat.1, man/snmpset.1.def
+, man/snmpstatus.1.def, man/snmptable.1.def,
+ man/snmptest.1.def, man/snmptranslate.1.def,
+ man/snmptrap.1.def, man/snmptrapd.8.def,
+ man/snmptrapd.conf.5.def, man/snmpusm.1.def,
+ man/snmpwalk.1.def, man/variables.5.def,
+ mibs/.cvsignore, mibs/AGENTX-MIB.txt,
+ mibs/DISMAN-EVENT-MIB.txt, mibs/DISMAN-SCHEDULE-MIB.txt
+, mibs/DISMAN-SCRIPT-MIB.txt, mibs/EtherLike-MIB.txt
+, mibs/HCNUM-TC.txt, mibs/HOST-RESOURCES-MIB.txt,
+ mibs/HOST-RESOURCES-TYPES.txt,
+ mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt,
+ mibs/IANA-LANGUAGE-MIB.txt, mibs/IANAifType-MIB.txt,
+ mibs/IF-INVERTED-STACK-MIB.txt, mibs/IF-MIB.txt,
+ mibs/INET-ADDRESS-MIB.txt, mibs/IP-FORWARD-MIB.txt,
+ mibs/IP-MIB.txt, mibs/IPV6-ICMP-MIB.txt,
+ mibs/IPV6-MIB.txt, mibs/IPV6-TC.txt,
+ mibs/IPV6-TCP-MIB.txt, mibs/IPV6-UDP-MIB.txt,
+ mibs/LM-SENSORS-MIB.txt, mibs/MTA-MIB.txt,
+ mibs/Makefile.in, mibs/Makefile.mib,
+ mibs/NET-SNMP-AGENT-MIB.txt, mibs/NET-SNMP-EXAMPLES-MIB.txt
+, mibs/NET-SNMP-MIB.txt, mibs/NET-SNMP-MONITOR-MIB.txt
+, mibs/NET-SNMP-SYSTEM-MIB.txt, mibs/NET-SNMP-TC.txt
+, mibs/NETWORK-SERVICES-MIB.txt,
+ mibs/NOTIFICATION-LOG-MIB.txt, mibs/README.mibs,
+ mibs/RFC-1215.txt, mibs/RFC1155-SMI.txt,
+ mibs/RFC1213-MIB.txt, mibs/RMON-MIB.txt,
+ mibs/SMUX-MIB.txt, mibs/SNMP-COMMUNITY-MIB.txt,
+ mibs/SNMP-FRAMEWORK-MIB.txt, mibs/SNMP-MPD-MIB.txt,
+ mibs/SNMP-NOTIFICATION-MIB.txt, mibs/SNMP-PROXY-MIB.txt
+, mibs/SNMP-TARGET-MIB.txt,
+ mibs/SNMP-USER-BASED-SM-MIB.txt,
+ mibs/SNMP-VIEW-BASED-ACM-MIB.txt, mibs/SNMPv2-CONF.txt,
+ mibs/SNMPv2-MIB.txt, mibs/SNMPv2-SMI.txt,
+ mibs/SNMPv2-TC.txt, mibs/SNMPv2-TM.txt,
+ mibs/TCP-MIB.txt, mibs/TUNNEL-MIB.txt,
+ mibs/UCD-DEMO-MIB.inc, mibs/UCD-DEMO-MIB.txt,
+ mibs/UCD-DISKIO-MIB.inc, mibs/UCD-DISKIO-MIB.txt,
+ mibs/UCD-DLMOD-MIB.inc, mibs/UCD-DLMOD-MIB.txt,
+ mibs/UCD-IPFILTER-MIB.inc, mibs/UCD-IPFILTER-MIB.txt,
+ mibs/UCD-IPFWACC-MIB.inc, mibs/UCD-IPFWACC-MIB.txt,
+ mibs/UCD-SNMP-MIB-OLD.txt, mibs/UCD-SNMP-MIB.inc,
+ mibs/UCD-SNMP-MIB.txt, mibs/UDP-MIB.txt, mibs/ianalist
+, mibs/mibfetch, mibs/rfclist, mibs/rfcmibs.diff
+, mibs/smistrip, ov/.cvsignore, ov/Makefile.in
+, ov/README, ov/UCD-Computer, ov/UCD-fields,
+ ov/oid_to_sym.in, ov/oid_to_type.in,
+ ov/bitmaps/UCD.20.m, ov/bitmaps/UCD.20.p,
+ ov/bitmaps/UCD.26.m, ov/bitmaps/UCD.26.p,
+ ov/bitmaps/UCD.32.m, ov/bitmaps/UCD.32.p,
+ ov/bitmaps/UCD.38.m, ov/bitmaps/UCD.38.p,
+ ov/bitmaps/UCD.44.m, ov/bitmaps/UCD.44.p,
+ ov/bitmaps/UCD.50.m, ov/bitmaps/UCD.50.p,
+ ov/bitmaps/UCD.fields, perl/.cvsignore,
+ perl/ASN/.cvsignore, perl/ASN/ASN.pm, perl/ASN/ASN.xs
+, perl/ASN/Changes, perl/ASN/MANIFEST,
+ perl/ASN/Makefile.PL, perl/ASN/test.pl,
+ perl/AnyData_SNMP/.cvsignore, perl/AnyData_SNMP/Changes
+, perl/AnyData_SNMP/DBD_AnyData.patch,
+ perl/AnyData_SNMP/Format.pm, perl/AnyData_SNMP/INSTALL,
+ perl/AnyData_SNMP/MANIFEST, perl/AnyData_SNMP/Makefile.PL
+, perl/AnyData_SNMP/README, perl/AnyData_SNMP/Storage.pm
+, perl/AnyData_SNMP/snmpsh, perl/SNMP/.cvsignore,
+ perl/SNMP/BUG, perl/SNMP/MANIFEST,
+ perl/SNMP/MANIFEST.SKIP, perl/SNMP/Makefile.PL,
+ perl/SNMP/README, perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs
+, perl/SNMP/TODO, perl/SNMP/perlsnmp.h,
+ perl/SNMP/typemap, perl/SNMP/examples/async1.pl,
+ perl/SNMP/examples/async2.pl, perl/SNMP/examples/bulkwalk.pl
+, perl/SNMP/examples/ipforward.pl,
+ perl/SNMP/examples/mibtree.pl, perl/SNMP/examples/mibwalk.pl
+, perl/SNMP/examples/pingmib.pl,
+ perl/SNMP/examples/tablewalk.pl,
+ perl/SNMP/examples/testleak.pl,
+ perl/SNMP/examples/trap-example.pl, perl/SNMP/hints/irix.pl
+, perl/SNMP/hints/solaris.pl, perl/SNMP/t/.cvsignore
+, perl/SNMP/t/README, perl/SNMP/t/async.t,
+ perl/SNMP/t/bulkwalk.t, perl/SNMP/t/get.t,
+ perl/SNMP/t/getnext.t, perl/SNMP/t/mib.t,
+ perl/SNMP/t/mib.txt, perl/SNMP/t/mibload.t,
+ perl/SNMP/t/notify.t, perl/SNMP/t/session.t,
+ perl/SNMP/t/set.t, perl/SNMP/t/snmptest.conf,
+ perl/SNMP/t/startagent.pl, perl/agent/.cvsignore,
+ perl/agent/Changes, perl/agent/MANIFEST,
+ perl/agent/Makefile.PL, perl/agent/agent.pm,
+ perl/agent/agent.xs, perl/agent/test.pl,
+ perl/agent/typemap, perl/agent/default_store/.cvsignore
+, perl/agent/default_store/Makefile.PL,
+ perl/agent/default_store/default_store.pm,
+ perl/agent/default_store/default_store.xs,
+ perl/default_store/.cvsignore, perl/default_store/Changes
+, perl/default_store/MANIFEST,
+ perl/default_store/Makefile.PL,
+ perl/default_store/default_store.pm,
+ perl/default_store/default_store.xs,
+ perl/default_store/test.pl, perl/default_store/typemap,
+ perl/manager/.cvsignore, perl/manager/INSTALL,
+ perl/manager/Makefile.PL, perl/manager/displaytable.pm,
+ perl/manager/getValues.pm, perl/manager/green.gif,
+ perl/manager/manager.pm, perl/manager/red.gif,
+ perl/manager/setupauth, perl/manager/setupdb,
+ perl/manager/setupuser, perl/manager/snmptosql,
+ snmplib/.cvsignore, snmplib/MSG00001.bin,
+ snmplib/Makefile.depend, snmplib/Makefile.in,
+ snmplib/asn1.c, snmplib/callback.c,
+ snmplib/cmu_compat.c, snmplib/data_list.c,
+ snmplib/default_store.c, snmplib/getopt.c,
+ snmplib/int64.c, snmplib/keytools.c, snmplib/lcd_time.c
+, snmplib/md5.c, snmplib/mib.c,
+ snmplib/mt_support.c, snmplib/oid_array.c,
+ snmplib/oid_stash.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp-tc.c, snmplib/snmp.c,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpCallbackDomain.c
+, snmplib/snmpIPXDomain.c, snmplib/snmpTCPDomain.c
+, snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c, snmplib/snmpUnixDomain.c
+, snmplib/snmp_alarm.c, snmplib/snmp_api.c,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_debug.c, snmplib/snmp_enum.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c,
+ snmplib/snmp_secmod.c, snmplib/snmp_transport.c,
+ snmplib/snmp_version.c, snmplib/snmpksm.c,
+ snmplib/snmpusm.c, snmplib/snmpv3.c, snmplib/snprintf.c
+, snmplib/strtol.c, snmplib/strtoul.c,
+ snmplib/system.c, snmplib/tools.c,
+ snmplib/ucd-snmp-includes.h, snmplib/ucd_compat.c,
+ snmplib/vacm.c, snmplib/winservice.c,
+ snmplib/winservice.mc, snmplib/winservice.rc,
+ testing/.cvsignore, testing/Makefile.in, testing/README
+, testing/RUNTESTS, testing/T.c, testing/T2.sh
+, testing/TESTCONF.sh, testing/data.keychange-md5,
+ testing/data.keychange-sha1, testing/data.keychange-sha1-des
+, testing/data.kul-md5, testing/data.kul-sha1,
+ testing/etimetest.c, testing/eval_oneprogram.sh,
+ testing/eval_onescript.sh, testing/eval_suite.sh,
+ testing/eval_testlist, testing/eval_tools.sh,
+ testing/keymanagetest.c, testing/misctest.c,
+ testing/scapitest.c, testing/test_keychange.sh,
+ testing/test_kul.sh, testing/tests/Sv1config,
+ testing/tests/Sv2cconfig, testing/tests/Sv3DESconfig,
+ testing/tests/Sv3SHADESconfig, testing/tests/Sv3config,
+ testing/tests/Sv3configsha, testing/tests/Svanyconfig,
+ testing/tests/T001snmpv1get, testing/tests/T002snmpv1getnext
+, testing/tests/T003snmpv1getfail,
+ testing/tests/T004snmpv1nosuch, testing/tests/T014snmpv2cget
+, testing/tests/T015snmpv2cgetnext,
+ testing/tests/T016snmpv2cgetfail,
+ testing/tests/T017snmpv2ctov1getfail,
+ testing/tests/T018snmpv1tov2cgetfail,
+ testing/tests/T019snmpv2cnosuch, testing/tests/T020snmpv3get
+, testing/tests/T021snmpv3getnext,
+ testing/tests/T022snmpv3getMD5,
+ testing/tests/T023snmpv3getMD5DES,
+ testing/tests/T024snmpv3getSHA1,
+ testing/tests/T025snmpv3getSHADES,
+ testing/tests/T028snmpv3getfail,
+ testing/tests/T030snmpv3usercreation,
+ testing/tests/T049snmpv3inform, testing/tests/T050snmpv3trap
+, testing/tests/T051snmpv2ctrap,
+ testing/tests/T052snmpv2cinform,
+ testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap
+, testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap,
+ testing/tests/T058agentauthtrap, testing/tests/T100agenthup
+, testing/tests/T110agentxget,
+ testing/tests/T111agentxset, testing/tests/T112agentxsetfail
+, testing/tests/T113agentxtrap,
+ testing/tests/T120proxyget, testing/tests/T121proxyset,
+ testing/tests/T122proxysetfail, win32/.cvsignore,
+ win32/config.h, win32/config.h.borland,
+ win32/mib_module_config.h, win32/mib_module_dot_conf.h,
+ win32/mib_module_includes.h, win32/mib_module_inits.h,
+ win32/mib_module_shutdown.h, win32/snmpsm_init.h,
+ win32/win32.dsw, win32/win32.opt, win32/bin/.cvsignore
+, win32/encode_keychange/.cvsignore,
+ win32/encode_keychange/encode_keychange.dsp,
+ win32/lib/.cvsignore, win32/libagent/.cvsignore,
+ win32/libagent/libagent.def, win32/libagent/libagent.dsp
+, win32/libhelpers/libhelpers.dsp,
+ win32/libsnmp/.cvsignore, win32/libsnmp/libsnmp.dsp,
+ win32/libsnmp_dll/.cvsignore, win32/libsnmp_dll/libsnmp.def
+, win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/libucdmibs/.cvsignore, win32/libucdmibs/libucdmibs.def
+, win32/net-snmp/net-snmp-config.h,
+ win32/net-snmp/agent/mib_module_config.h,
+ win32/net-snmp/library/snmpv3-security-includes.h,
+ win32/netsnmpmibs/netsnmpmibs.dsp,
+ win32/snmpbulkget/.cvsignore,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkwalk/.cvsignore,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp, win32/snmpd/.cvsignore
+, win32/snmpd/snmpd.dsp, win32/snmpdelta/.cvsignore
+, win32/snmpdelta/snmpdelta.dsp, win32/snmpdf/.cvsignore
+, win32/snmpdf/snmpdf.dsp, win32/snmpget/.cvsignore
+, win32/snmpget/snmpget.dsp,
+ win32/snmpgetnext/.cvsignore,
+ win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpnetstat/.cvsignore,
+ win32/snmpnetstat/snmpnetstat.dsp, win32/snmpset/.cvsignore
+, win32/snmpset/snmpset.dsp, win32/snmpstatus/.cvsignore
+, win32/snmpstatus/snmpstatus.dsp,
+ win32/snmptable/.cvsignore, win32/snmptable/snmptable.dsp
+, win32/snmptest/.cvsignore, win32/snmptest/snmptest.dsp
+, win32/snmptranslate/.cvsignore,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptrap/.cvsignore, win32/snmptrap/snmptrap.dsp,
+ win32/snmptrapd/.cvsignore, win32/snmptrapd/snmptrapd.dsp
+, win32/snmpusm/.cvsignore, win32/snmpusm/snmpusm.dsp
+, win32/snmpvacm/.cvsignore, win32/snmpvacm/snmpvacm.dsp
+, win32/snmpwalk/.cvsignore, win32/snmpwalk/snmpwalk.dsp
+:
+
+ cvs file version number change
+
+2002-04-20 00:20 hardaker
+
+ * ChangeLog:
+
+ changelog
+
+2002-04-20 00:07 hardaker
+
+ * agent/agent_handler.c, agent/agent_index.c,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/auto_nlist.c,
+ agent/autonlist.h, agent/kernel.c, agent/kernel.h
+, agent/m2m.h, agent/mib_modules.c,
+ agent/snmp_agent.c, agent/snmp_perl.c,
+ agent/snmp_vars.c, agent/snmpd.c, agent/snmpd.h
+, agent/helpers/all_helpers.c,
+ agent/helpers/bulk_to_next.c, agent/helpers/debug_handler.c
+, agent/helpers/instance.c,
+ agent/helpers/multiplexer.c, agent/helpers/null.c,
+ agent/helpers/old_api.c, agent/helpers/read_only.c,
+ agent/helpers/serialize.c, agent/helpers/table.c,
+ agent/helpers/table_array.c, agent/helpers/table_data.c
+, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c, agent/mibgroup/Rmon.h,
+ agent/mibgroup/agentx.h, agent/mibgroup/header_complex.c
+, agent/mibgroup/header_complex.h,
+ agent/mibgroup/host.h, agent/mibgroup/host_res.h,
+ agent/mibgroup/kernel_sunos5.c,
+ agent/mibgroup/kernel_sunos5.h, agent/mibgroup/mibII.h
+, agent/mibgroup/mibdefs.h, agent/mibgroup/mibincl.h
+, agent/mibgroup/smux_gated.h,
+ agent/mibgroup/snmpv3mibs.h, agent/mibgroup/struct.h,
+ agent/mibgroup/testhandler.c, agent/mibgroup/testhandler.h
+, agent/mibgroup/ucd_snmp.h,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h
+, agent/mibgroup/Rmon/agutil.c,
+ agent/mibgroup/Rmon/agutil.h,
+ agent/mibgroup/Rmon/agutil_api.h, agent/mibgroup/Rmon/alarm.c
+, agent/mibgroup/Rmon/alarm.h,
+ agent/mibgroup/Rmon/event.c, agent/mibgroup/Rmon/event.h
+, agent/mibgroup/Rmon/history.c,
+ agent/mibgroup/Rmon/history.h, agent/mibgroup/Rmon/row_api.h
+, agent/mibgroup/Rmon/rows.c, agent/mibgroup/Rmon/rows.h
+, agent/mibgroup/Rmon/statistics.c,
+ agent/mibgroup/Rmon/statistics.h,
+ agent/mibgroup/agent/nsModuleTable.c,
+ agent/mibgroup/agent/nsModuleTable.h,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsTransactionTable.h,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/agentx_config.h,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/client.h,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master.h,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_admin.h,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/protocol.h,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/agentx/subagent.h,
+ agent/mibgroup/disman/event-mib.h,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteObjectsTable.h,
+ agent/mibgroup/disman/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/mteTriggerBooleanTable.h,
+ agent/mibgroup/disman/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/mteTriggerDeltaTable.h,
+ agent/mibgroup/disman/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/mteTriggerExistenceTable.h,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerTable.h,
+ agent/mibgroup/disman/mteTriggerThresholdTable.c,
+ agent/mibgroup/disman/mteTriggerThresholdTable.h,
+ agent/mibgroup/examples/data_set.c,
+ agent/mibgroup/examples/data_set.h,
+ agent/mibgroup/examples/delayed_instance.c,
+ agent/mibgroup/examples/delayed_instance.h,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/example.h,
+ agent/mibgroup/examples/scalar_int.c,
+ agent/mibgroup/examples/scalar_int.h,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/examples/ucdDemoPublic.h,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_device.h,
+ agent/mibgroup/host/hr_disk.c, agent/mibgroup/host/hr_disk.h
+, agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_filesys.h,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_network.h,
+ agent/mibgroup/host/hr_other.c,
+ agent/mibgroup/host/hr_other.h,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_partition.h,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_print.h, agent/mibgroup/host/hr_proc.c
+, agent/mibgroup/host/hr_proc.h,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_storage.h,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swinst.h,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_swrun.h,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hr_system.h, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/at.h,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/icmp.h
+, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ip.h,
+ agent/mibgroup/mibII/ipAddr.c, agent/mibgroup/mibII/ipAddr.h
+, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/ipv6.h,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/kernel_linux.h,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/mta_sendmail.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/route_write.h,
+ agent/mibgroup/mibII/setSerialNo.c,
+ agent/mibgroup/mibII/setSerialNo.h,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib.h,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/system_mib.h, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/mibII/tcp.h,
+ agent/mibgroup/mibII/tcpTable.c,
+ agent/mibgroup/mibII/tcpTable.h, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/udp.h,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/udpTable.h,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_context.h,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/mibII/var_route.h, agent/mibgroup/misc/dlmod.c
+, agent/mibgroup/misc/dlmod.h,
+ agent/mibgroup/misc/ipfwacc.c, agent/mibgroup/misc/ipfwacc.h
+, agent/mibgroup/notification/snmpNotifyFilterProfileTable.c
+, agent/mibgroup/notification/snmpNotifyFilterProfileTable.h
+, agent/mibgroup/notification/snmpNotifyFilterTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterTable.h,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.h,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/smux/smux.h
+, agent/mibgroup/smux/snmp_bgp.c,
+ agent/mibgroup/smux/snmp_bgp.h,
+ agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_ospf.h,
+ agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/smux/snmp_rip2.h,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpEngine.h,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.h,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats.h,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.h,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/target/target.h,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/target/target_counters.h,
+ agent/mibgroup/tunnel/tunnel.c,
+ agent/mibgroup/tunnel/tunnel.h,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/disk.h,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/diskio.h,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/dlmod.h,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/errormib.h,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/file.h,
+ agent/mibgroup/ucd-snmp/hpux.c,
+ agent/mibgroup/ucd-snmp/hpux.h,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ agent/mibgroup/ucd-snmp/lmSensors.h,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/loadave.h,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/logmatch.h,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h,
+ agent/mibgroup/ucd-snmp/memory_dynix.c,
+ agent/mibgroup/ucd-snmp/memory_dynix.h,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.h,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.h,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass.h,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/pass_persist.h,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proc.h,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/proxy.h,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/versioninfo.h,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat.h,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.h,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.c,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.h,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.h,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.h,
+ agent/mibgroup/utilities/override.c,
+ agent/mibgroup/utilities/override.h, apps/encode_keychange.c
+, apps/notification_log.c, apps/notification_log.h
+, apps/snmpbulkget.c, apps/snmpbulkwalk.c,
+ apps/snmpdelta.c, apps/snmpdf.c, apps/snmpget.c
+, apps/snmpgetnext.c, apps/snmpset.c,
+ apps/snmpstatus.c, apps/snmptable.c, apps/snmptest.c
+, apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmptrapd_handlers.c,
+ apps/snmptrapd_handlers.h, apps/snmptrapd_log.c,
+ apps/snmptrapd_log.h, apps/snmpusm.c, apps/snmpvacm.c
+, apps/snmpwalk.c, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/main.h,
+ apps/snmpnetstat/netstat.h, apps/snmpnetstat/route.c,
+ apps/snmpnetstat/winstub.c, apps/snmpnetstat/winstub.h
+, include/net-snmp/config_api.h,
+ include/net-snmp/definitions.h, include/net-snmp/mib_api.h
+, include/net-snmp/net-snmp-includes.h,
+ include/net-snmp/output_api.h, include/net-snmp/pdu_api.h
+, include/net-snmp/session_api.h,
+ include/net-snmp/snmpv3_api.h, include/net-snmp/types.h
+, include/net-snmp/utilities.h,
+ include/net-snmp/varbind_api.h, include/net-snmp/version.h
+, include/net-snmp/agent/agent_callbacks.h,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/agent_index.h,
+ include/net-snmp/agent/agent_read_config.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/agent_trap.h,
+ include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/auto_nlist.h,
+ include/net-snmp/agent/bulk_to_next.h,
+ include/net-snmp/agent/debug_handler.h,
+ include/net-snmp/agent/ds_agent.h,
+ include/net-snmp/agent/instance.h,
+ include/net-snmp/agent/mib_modules.h,
+ include/net-snmp/agent/multiplexer.h,
+ include/net-snmp/agent/net-snmp-agent-includes.h,
+ include/net-snmp/agent/null.h,
+ include/net-snmp/agent/old_api.h,
+ include/net-snmp/agent/read_only.h,
+ include/net-snmp/agent/serialize.h,
+ include/net-snmp/agent/set_helper.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/snmp_vars.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/agent/var_struct.h,
+ include/net-snmp/library/asn1.h,
+ include/net-snmp/library/callback.h,
+ include/net-snmp/library/cmu_compat.h,
+ include/net-snmp/library/data_list.h,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/getopt.h,
+ include/net-snmp/library/int64.h,
+ include/net-snmp/library/keytools.h,
+ include/net-snmp/library/lcd_time.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/library/md5.h,
+ include/net-snmp/library/mib.h,
+ include/net-snmp/library/mt_support.h,
+ include/net-snmp/library/oid_array.h,
+ include/net-snmp/library/oid_stash.h,
+ include/net-snmp/library/parse.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/scapi.h,
+ include/net-snmp/library/snmp-tc.h,
+ include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpIPXDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_alarm.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_enum.h,
+ include/net-snmp/library/snmp_impl.h,
+ include/net-snmp/library/snmp_locking.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/library/snmp_parse_args.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/snmpksm.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/snmpv3.h,
+ include/net-snmp/library/system.h,
+ include/net-snmp/library/tools.h,
+ include/net-snmp/library/transform_oids.h,
+ include/net-snmp/library/ucd_compat.h,
+ include/net-snmp/library/vacm.h,
+ include/net-snmp/library/winservice.h,
+ include/net-snmp/machine/generic.h,
+ include/net-snmp/system/bsd.h,
+ include/net-snmp/system/bsdi3.h,
+ include/net-snmp/system/bsdi4.h,
+ include/net-snmp/system/cygwin.h,
+ include/net-snmp/system/darwin.h,
+ include/net-snmp/system/dynix.h,
+ include/net-snmp/system/freebsd.h,
+ include/net-snmp/system/freebsd2.h,
+ include/net-snmp/system/freebsd3.h,
+ include/net-snmp/system/freebsd4.h,
+ include/net-snmp/system/generic.h,
+ include/net-snmp/system/hpux.h,
+ include/net-snmp/system/irix.h,
+ include/net-snmp/system/linux.h,
+ include/net-snmp/system/mips.h,
+ include/net-snmp/system/netbsd.h,
+ include/net-snmp/system/openbsd.h,
+ include/net-snmp/system/solaris2.6.h,
+ include/net-snmp/system/sunos.h,
+ include/net-snmp/system/svr5.h,
+ include/net-snmp/system/ultrix4.h, include/ucd-snmp/version.h
+, snmplib/asn1.c, snmplib/callback.c,
+ snmplib/cmu_compat.c, snmplib/data_list.c,
+ snmplib/default_store.c, snmplib/getopt.c,
+ snmplib/int64.c, snmplib/keytools.c,
+ snmplib/lcd_time.c, snmplib/md5.c, snmplib/mib.c
+, snmplib/mt_support.c, snmplib/oid_array.c,
+ snmplib/oid_stash.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp-tc.c, snmplib/snmp.c,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpCallbackDomain.c
+, snmplib/snmpIPXDomain.c, snmplib/snmpTCPDomain.c
+, snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_debug.c,
+ snmplib/snmp_enum.c, snmplib/snmp_logging.c,
+ snmplib/snmp_parse_args.c, snmplib/snmp_secmod.c,
+ snmplib/snmp_transport.c, snmplib/snmp_version.c,
+ snmplib/snmpksm.c, snmplib/snmpusm.c,
+ snmplib/snmpv3.c, snmplib/snprintf.c, snmplib/strtol.c
+, snmplib/strtoul.c, snmplib/system.c,
+ snmplib/tools.c, snmplib/ucd-snmp-includes.h,
+ snmplib/ucd_compat.c, snmplib/vacm.c,
+ snmplib/winservice.c, testing/T.c, testing/etimetest.c
+, testing/keymanagetest.c, testing/misctest.c,
+ testing/scapitest.c:
+
+ 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.
+
+2002-04-20 00:01 hardaker
+
+ * configure, configure.in:
+
+ turn on ucd compat by default.
+
+2002-04-20 00:00 hardaker
+
+ * NEWS:
+
+ last updates
+
+2002-04-19 23:33 hardaker
+
+ * agent/mibgroup/testdelayed.h:
+
+ remove testdelayed
+
+2002-04-19 23:18 hardaker
+
+ * agent/mibgroup/utilities/: .cvsignore, .cvsignore:
+
+ cvs ignore file
+
+2002-04-19 23:17 hardaker
+
+ * agent/snmp_perl.c:
+
+ don't die if perl doesn't init.
+
+2002-04-19 23:03 hardaker
+
+ * perl/SNMP/: README, README, SNMP.pm:
+
+ change warning.
+
+2002-04-19 22:29 hardaker
+
+ * agent/snmp_agent.c:
+
+ double check that multiple inserts into the delegated chain don't
+ happen (read: they shouldn't anyway, but.....).
+
+2002-04-19 22:29 hardaker
+
+ * CodingStyle:
+
+ typedef update
+
+2002-04-19 22:16 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ Fix the callback build hook to turn off the expect response flag when
+ not appropriate.
+
+2002-04-19 19:09 rstory
+
+ * include/net-snmp/library/oid_array.h:
+
+ spelling misteak; remove capital letters in function names
+
+2002-04-19 19:08 rstory
+
+ * agent/helpers/table_array.c:
+
+ update for function name changed in oid_array.h
+
+2002-04-19 18:20 hardaker
+
+ * agent/snmp_perl.c:
+
+ make the perlInitFile and disablePerl tokens register as premib such
+ that when passed as a --FLAG it'll actually do the right thing and
+ disable the later "perl" token handlers.
+
+2002-04-19 17:29 hardaker
+
+ * Makefile.in, man/Makefile.in, man/netsnmp_agent.3
+, man/netsnmp_bulk_to_next.3, man/netsnmp_debug.3,
+ man/netsnmp_example_scalar_int.3, man/netsnmp_handler.3
+, man/netsnmp_instance.3,
+ man/netsnmp_mib_handler_methods.3, man/netsnmp_multiplexer.3
+, man/netsnmp_old_api.3, man/netsnmp_read_only.3,
+ man/netsnmp_serialize.3, man/netsnmp_table.3,
+ man/netsnmp_table_array.3, man/netsnmp_table_data.3,
+ man/netsnmp_table_dataset.3, man/netsnmp_table_iterator.3
+, man/netsnmp_todo.3:
+
+ documentation. Can't get enough.
+ - make docs now installs man pages into the man dir, which are then installed.
+
+2002-04-19 17:14 hardaker
+
+ * testing/tests/: T111agentxset, T121proxyset:
+
+ Correct for new STRING prefix.
+
+2002-04-19 17:03 hardaker
+
+ * README:
+
+ Add Katsuhisa ABE
+
+2002-04-19 17:03 hardaker
+
+ * perl/: ASN/ASN.xs, default_store/default_store.xs:
+
+ fix header files for new paths.
+
+2002-04-19 17:00 hardaker
+
+ * agent/snmp_vars.c, agent/mibgroup/mibII/vacm_vars.c
+, include/net-snmp/library/snmpUDPIPv6Domain.h,
+ man/snmpd.conf.5.def, snmplib/snmpUDPIPv6Domain.c:
+
+ Apply patch #532555: ipv6 com2sec support, thanks to Katsuhisa ABE.
+
+2002-04-19 16:19 hardaker
+
+ * agent/agent_trap.c, agent/snmp_agent.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ fix sysUpTime (and related functions) to handle much larger upTime
+ values (ie, fix signed integer wrapping).
+
+2002-04-19 11:37 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document embedded perl support.
+
+2002-04-19 11:34 hardaker
+
+ * configure, configure.in, agent/Makefile.in
+, agent/snmp_perl.c, agent/snmp_perl.pl,
+ include/net-snmp/agent/ds_agent.h, perl/agent/Makefile.PL
+:
+
+ Add some new snmpd.conf tokens for controlling perl better.
+ Fix embedded perl support so it actually works.
+
+2002-04-19 11:32 hardaker
+
+ * perl/agent/default_store/: .cvsignore, Makefile.PL,
+ default_store.pm, default_store.xs:
+
+ Added missing agent default_store stuff. (they existed on my machine,
+ I don't know why everyone else was having problems)
+
+2002-04-19 10:30 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Protect against things that should never ever happen
+
+2002-04-19 03:10 dts12
+
+ * Makefile.in:
+
+ <Sigh> A little learning is a dangerous thing.
+ Apply the rest of the patch from Axel - sorry.
+
+2002-04-19 01:49 dts12
+
+ * Makefile.in, doxygen.conf:
+
+ Handle generating documenation when srcdir != configdir
+ (Patch supplied by Axel Kittenberger)
+
+2002-04-18 17:38 hardaker
+
+ * snmplib/snmpIPXDomain.c:
+
+ fix snmpIPXDomain (again)
+
+2002-04-18 17:31 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Patch from Vishal Verma: only open subagent connections once at startup
+
+2002-04-18 17:28 hardaker
+
+ * agent/agent_registry.c:
+
+ Patch from Vishal Verma: for down subagent cases, mark registrations as detached
+
+2002-04-18 17:17 hardaker
+
+ * snmplib/snmp_api.c:
+
+ define a maximum packet size we can accept to protect certain error
+ conditions (-1 after conversion is now too large).
+
+2002-04-18 16:28 hardaker
+
+ * acconfig.h:
+
+ change the enterprise OIDs in the proper place (net-snmp-config.h.in
+ is generated from this file).
+
+2002-04-18 13:51 hardaker
+
+ * configure, configure.in, net-snmp-config.in
+:
+
+ - Add two new options to net-snmp-config as requested on the IRC channel.
+ --configure-options
+ --snmpd-module-list
+
+2002-04-18 11:43 rstory
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ add missing comma
+
+2002-04-18 07:39 dts12
+
+ * configure, configure.in:
+
+ Calculate the length of supplied enterprise OIDs correctly
+ (and use a more meaningful output message)
+
+ Shame these settings aren't cached for later re-use....
+
+2002-04-18 07:18 dts12
+
+ * agent/snmpd.c:
+
+ Notify on agent reconfiguration.
+
+2002-04-18 07:16 dts12
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Use the Net-SNMP notifications by default, rather than the ucdavis ones.
+
+2002-04-18 07:08 dts12
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ Fix the table-of-contents sequence for the nsModuleTable, add notification
+ definitions for the agent, and define groups for everything.
+
+2002-04-18 02:52 dts12
+
+ * snmplib/mib.c:
+
+ Bring integer and string output formats into line with the other types
+ by printing a type token before the value (unless supressed by 'quick print')
+ Thanks to Erik for the patch
+
+2002-04-18 01:46 dts12
+
+ * FAQ:
+
+ Replace the dlmod 'WHERE' with something more meaningful....
+
+2002-04-17 12:12 hardaker
+
+ * snmplib/snmpIPXDomain.c:
+
+ define the ipxDomain variables
+
+2002-04-17 12:12 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ Error condition tests
+
+2002-04-17 10:10 hardaker
+
+ * agent/agent_registry.c, agent/snmp_agent.c,
+ agent/mibgroup/agentx/master_admin.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/var_struct.h:
+
+ Oh, just a small patch to make it possible to make modules request
+ that all queries to a set of registrations get passed all at once
+ (which apparently is important for, oh, agentx)
+
+2002-04-17 10:09 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ misc non-change clean ups
+
+2002-04-17 10:03 hardaker
+
+ * include/net-snmp/agent/table.h:
+
+ rename structures beginning with _ to ending with _s
+
+2002-04-17 10:02 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ add a void * pointer for the session creator to use at will (different
+ from the callback magic).
+
+2002-04-17 09:00 dts12
+
+ * configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Use the Net-SNMP sysOIDs by default, rather than the ucdavis ones.
+
+2002-04-17 08:26 dts12
+
+ * apps/snmpnetstat/Makefile.in:
+
+ Blank continuation lines confuse HP's version of make.
+
+2002-04-17 08:16 dts12
+
+ * agent/Makefile.in:
+
+ Blank continuation lines confuse HP's version of make
+
+2002-04-17 06:56 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c,
+ mibs/NET-SNMP-AGENT-MIB.txt:
+
+ move nsModuleTable into Dave's structure.
+
+2002-04-17 06:54 hardaker
+
+ * include/net-snmp/library/: snmpAAL5PVCDomain.h,
+ snmpTCPIPv6Domain.h, snmpUDPIPv6Domain.h:
+
+ fix declarations of Domain objects (const -> extern)
+
+2002-04-17 06:31 hardaker
+
+ * local/snmpconf.dir/: snmp-data/snmpconf-config,
+ snmpd-data/snmpconf-config, snmptrapd-data/snmpconf-config
+:
+
+ snmpconf configuration data
+
+2002-04-17 03:01 dts12
+
+ * configure, configure.in:
+
+ Bring the reported default settings for sysoid & notification OIDs
+ back into line with what we actually use (i.e. the ucdavis OIDs).
+
+ Qn: Do we want to switch to using the net-snmp equivalent sysOIDs?
+ Qn: What about defining net-snmp notifications?
+
+2002-04-17 02:55 dts12
+
+ * configure, configure.in:
+
+ Fix --with-enterprise-sysoid and --with-enterprise-notification-oid,
+ and try to clarify that these are OIDs, while --with-enterprise-oid
+ is actually just the enterprise *number*
+
+ Qn: should we change the name of the configure option to reflect this?
+
+2002-04-16 10:04 hardaker
+
+ * sedscript.in, snmplib/snmp_version.c, FAQ,
+ perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.pre3 )
+
+2002-04-16 10:02 hardaker
+
+ * README:
+
+ delete top disclaimers
+
+2002-04-16 10:02 hardaker
+
+ * NEWS:
+
+ misc updates
+
+2002-04-16 10:01 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ misc bug fixes
+
+2002-04-16 08:19 dts12
+
+ * FAQ:
+
+ Add an entry concerning the 'libcrypto' RPM dependency.
+
+2002-04-16 08:00 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ fix memory leak
+
+2002-04-16 07:13 hardaker
+
+ * agent/snmp_agent.c:
+
+ remove a no longer appropriate todo comment
+
+2002-04-16 07:12 hardaker
+
+ * configure:
+
+ I guess I forgot to run autoconf
+
+2002-04-15 08:58 hardaker
+
+ * local/: snmpconf, Makefile.in:
+
+ move snmpconf data directories to different names to avoid confusion
+
+2002-04-15 08:36 hardaker
+
+ * local/snmpconf.dir/: snmp-data/authopts,
+ snmp-data/debugging, snmp-data/mibs, snmp-data/output
+, snmpd-data/acl, snmpd-data/basic_setup,
+ snmpd-data/extending, snmpd-data/monitor,
+ snmpd-data/operation, snmpd-data/system,
+ snmpd-data/trapsinks, snmptrapd-data/formatting,
+ snmptrapd-data/traphandle:
+
+ data file moving
+
+2002-04-12 14:38 hardaker
+
+ * local/snmpconf:
+
+ Massive cleanup effort. It should now respect ordering in the
+ snmpconf configuration files as well.
+
+2002-04-12 13:00 rstory
+
+ * include/net-snmp/agent/agent_registry.h:
+
+ fix for overzealous perl script
+
+2002-04-12 09:47 hardaker
+
+ * Makefile.in, configure, configure.in:
+
+ copy ucd persisent directory to net-snmp (prompts, flags and other fun)
+
+2002-04-12 07:57 hardaker
+
+ * local/Makefile.in:
+
+ install traptoemail
+
+2002-04-12 07:55 hardaker
+
+ * local/trapnotif:
+
+ remove trapnotif
+
+2002-04-12 07:51 hardaker
+
+ * local/: Makefile.in, rsnmp:
+
+ remove rsnmp, which is very very old and out of date
+
+2002-04-12 07:47 hardaker
+
+ * man/: .cvsignore, Makefile.in, mib2c.1.def:
+
+ A manual page for mib2c (help, I'm turning into Dave)
+
+2002-04-12 07:28 hardaker
+
+ * dotgdbinit:
+
+ a gdb initialization file with helpful functions
+
+2002-04-12 02:42 dts12
+
+ * local/Makefile.in:
+
+ Add 'snmpconf' and 'mib2c' to the list of scripts to install.
+
+ I've left 'traptoemail' off this list, since it says it's not intended
+ as a directly user-invoked command, so probably ought not to be installed
+ into a binary directory.
+
+2002-04-12 02:41 dts12
+
+ * local/rsnmp:
+
+ Fix the path of snmpwalk to be something more plausible.
+ (I'm not convinced about the validity of that initial 'rtopmib' OID mind!)
+
+2002-04-12 02:36 dts12
+
+ * local/mib2c.conf:
+
+ Fix typo in reference to 'mib2c.iterate.conf'
+
+2002-04-12 02:33 dts12
+
+ * Makefile.rules, snmplib/Makefile.in:
+
+ Install the main library as 'libsnmp' if configured using UCD compatibility.
+ This should handle the requirements of application compatibility.
+ Agent library compatibility is likely to prove a harder problem
+ (since there are now three libraries, not just two...)
+
+2002-04-11 22:29 hardaker
+
+ * perl/SNMP/t/startagent.pl:
+
+ set SNMPCONFPATH iff [sic] not set
+
+2002-04-11 22:27 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ return from initMib before doing anything.
+
+2002-04-11 22:26 hardaker
+
+ * perl/SNMP/Makefile.PL:
+
+ turn off complier warnings
+
+2002-04-11 22:26 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ support "show columns from TABLE"
+
+2002-04-11 22:25 hardaker
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ Add a new demo scalar: the sleeper. (dah dah dah dummmmm)
+
+2002-04-11 22:25 hardaker
+
+ * agent/mibgroup/examples/scalar_int.c:
+
+ indent.
+
+2002-04-11 22:25 hardaker
+
+ * agent/mibgroup/: examples.h, examples/delayed_instance.c
+, examples/delayed_instance.h:
+
+ Add a delayed instance example, showing how to return mib request
+ results later rather than immediately.
+
+2002-04-11 22:24 hardaker
+
+ * agent/mibgroup/testdelayed.c:
+
+ remove legacy example.
+
+2002-04-11 22:23 hardaker
+
+ * agent/snmp_agent.c:
+
+ add comment about possibly fixing inclusive requests in the future.
+
+2002-04-11 17:08 hardaker
+
+ * README.win32:
+
+ change modukes-> modules
+
+2002-04-11 07:23 hardaker
+
+ * snmplib/snmp_logging.c:
+
+ turn off debugging when calling logging callbacks
+
+2002-04-10 12:51 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ fix perl module in many many places. most tests now pass.
+
+2002-04-10 12:50 hardaker
+
+ * perl/SNMP/t/startagent.pl:
+
+ force setting to a "bogus" SNMPCONFPATH.
+
+2002-04-10 12:48 hardaker
+
+ * include/net-snmp/library/mib.h, snmplib/mib.c:
+
+ Exporting functions good. Internalizing bad.
+
+2002-04-10 09:28 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ opps. sigh.
+
+2002-04-10 09:27 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ opps. remove debugging statements.
+
+2002-04-10 09:23 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ - Make the perl module call init_snmp()
+ - this is a fairly major change, is it now will read .conf files.
+ - many people have asked for this.
+ - misc clean ups.
+
+2002-04-10 09:18 dts12
+
+ * Makefile.rules:
+
+ Don't recurse into subdirectories for the consituent subtargets of "make install"
+
+2002-04-10 09:09 hardaker
+
+ * NEWS:
+
+ added a few things, separated perl stuff into it's own section.
+
+2002-04-10 08:46 dts12
+
+ * configure, configure.in:
+
+ Bring the help message for the UCD compatability option into line with
+ what's actually recognised.
+
+2002-04-10 07:52 hardaker
+
+ * Makefile.top:
+
+ change libtool versioning to their recommended method of doing things
+ (which I hate, but is still better than what we were doing, I guess)
+
+2002-04-10 07:10 dts12
+
+ * Makefile.rules:
+
+ Bring use of BUILTSUBDIR within 'installlocalheaders' into line
+ with the preceding comment, and actual usage.
+ (i.e. INSTALLBUILTSUBDIR rather than INCLUDEBUILTSUBDIR)
+
+2002-04-10 05:58 dts12
+
+ * snmplib/Makefile.in:
+
+ Typo in security-include header destination directory variable
+
+2002-04-10 05:55 dts12
+
+ * local/Makefile.in:
+
+ Ensure the destination directory exists before installing mib2c conf files.
+
+2002-04-10 01:55 dts12
+
+ * testing/tests/: T004snmpv1nosuch, T019snmpv2cnosuch:
+
+ Two new tests to check handling of GETing non-existant instances
+
+2002-04-10 01:54 dts12
+
+ * agent/snmp_agent.c:
+
+ A fix for SNMPv1 errors that doesn't end up breaking AgentX error handling.
+
+2002-04-09 10:38 hardaker
+
+ * agent/snmp_agent.c:
+
+ Patch from Dave to fix v1 error results.
+
+2002-04-08 21:08 rstory
+
+ * snmplib/oid_array.c:
+
+ fix incorrect length return value
+
+2002-04-08 18:00 hardaker
+
+ * agent/mibgroup/mibII/: vacm_vars.c, vacm_vars.h:
+
+ don't allow no-configuration access anymore.
+
+2002-04-08 17:59 hardaker
+
+ * include/net-snmp/library/transform_oids.h,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpTCPIPv6Domain.c
+, snmplib/snmpUDPIPv6Domain.c, snmplib/snmpusm.c
+:
+
+ more unconst correctness
+
+2002-04-08 17:31 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ size_t externs for exported oids
+
+2002-04-08 17:30 hardaker
+
+ * snmplib/snmp_api.c:
+
+ remove temporary debugging statements that accidentally became permanent.
+
+2002-04-08 17:26 hardaker
+
+ * snmplib/: snmpUDPDomain.c, snmp_transport.c:
+
+ define length size_t's for oid variables.
+
+2002-04-08 16:53 hardaker
+
+ * agent/mibgroup/utilities/override.c:
+
+ support "null" types.
+
+2002-04-08 16:52 hardaker
+
+ * apps/snmptrapd.c:
+
+ initialize notification log mib support before -H usage.
+
+2002-04-08 16:49 hardaker
+
+ * agent/helpers/serialize.c:
+
+ fix a few things and make subhandlers not able to tell there were more requests.
+
+2002-04-08 16:43 hardaker
+
+ * INSTALL:
+
+ A co-worker pointed out that the INSTALL script still said to edit config.h
+
+2002-04-08 15:13 hardaker
+
+ * include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_transport.h,
+ snmplib/snmpTCPDomain.c, snmplib/snmpUnixDomain.c,
+ snmplib/snmp_transport.c:
+
+ unstatic-ize a few oids that should have been external
+
+2002-04-08 14:23 hardaker
+
+ * snmplib/: snmpAAL5PVCDomain.c, snmpTCPDomain.c,
+ snmpTCPIPv6Domain.c, snmpUDPIPv6Domain.c,
+ snmpUnixDomain.c, snmp_api.c, snmp_transport.c
+, snmpusm.c:
+
+ Change const oid declarations into static ones since shared libraries
+ have a problem with initializing them on linux systems at least.
+
+2002-04-08 11:45 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ minimal documentation for debugging and the injectHandler token
+
+2002-04-05 14:32 hardaker
+
+ * man/: snmptrapd.8.def, snmptrapd.conf.5.def:
+
+ documentation for the NOTIFICATION-LOG-MIB support.
+
+2002-04-05 14:09 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document context name support in proxy code.
+
+2002-04-05 13:51 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document the disman event mib support for sending traps via monitored OIDs.
+
+2002-04-05 10:12 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ put trap config into its own section.
+ document the "override" token.
+
+2002-04-05 06:39 hardaker
+
+ * README.snmpv3:
+
+ change default context to an empty string
+
+2002-04-04 15:14 hardaker
+
+ * agent/: agent_registry.c (V4-2-patches.5), agent_registry.c
+:
+
+ deal with fd unregistrations properly.
+
+2002-04-03 09:12 hardaker
+
+ * agent/helpers/table_dataset.c, agent/mibgroup/examples.h
+, agent/mibgroup/testhandler.c,
+ agent/mibgroup/examples/data_set.c,
+ agent/mibgroup/examples/data_set.h,
+ agent/mibgroup/examples/scalar_int.c,
+ include/net-snmp/agent/table_dataset.h,
+ mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ Make an example dataset table to hold and store data in (admittedly
+ useless data from a network management point of view, but it's an example).
+
+2002-04-02 22:12 hardaker
+
+ * man/Makefile.in:
+
+ fix installation from subdir build case.
+
+2002-04-02 21:45 hardaker
+
+ * snmplib/Makefile.in:
+
+ install snmpv3-security-includes from from build dir.
+
+2002-04-02 21:45 hardaker
+
+ * agent/Makefile.in:
+
+ install mib_module_config.h and mib_module_includes.h from build dir.
+
+2002-04-02 21:43 hardaker
+
+ * Makefile.in:
+
+ install net-snmp-config.h from the build dir.
+
+2002-04-02 21:43 hardaker
+
+ * Makefile.rules:
+
+ create some install from built header rules.
+
+2002-04-02 17:27 hardaker
+
+ * local/: Makefile.in, mib2c.conf:
+
+ remove deleted array-auto from .conf install/reference lists
+
+2002-04-02 15:03 hardaker
+
+ * agent/mibgroup/: ucd_snmp.h, ucd-snmp/registry.c,
+ ucd-snmp/registry.h:
+
+ remove the registry module, as it's obsolete due to contexts. Use the nsModuleTable instead
+
+2002-04-02 14:57 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c (V4-2-patches.7),
+ agent/mibgroup/ucd-snmp/disk.c,
+ include/net-snmp/system/darwin.h:
+
+ Apply patch #524424 for darwin fixes for ucd-snmp/disk.c
+
+2002-04-02 14:47 hardaker
+
+ * agent/mibgroup/: kernel_sunos5.c (V4-2-patches.8),
+ kernel_sunos5.c:
+
+ apply patch 527573 to fix 64 bit types on solaris
+
+2002-04-02 07:04 hardaker
+
+ * snmplib/snmp_transport.c:
+
+ check char for NULL before setting to:
+
+2002-04-01 22:28 hardaker
+
+ * snmplib/: snmp_api.c (V4-2-patches.9), cmu_compat.c,
+ snmp_api.c:
+
+ Let init_snmp protect itself.
+
+2002-03-29 15:04 rstory
+
+ * local/mib2c.array-user.conf:
+
+ tweaks & updates
+
+2002-03-29 10:40 rstory
+
+ * snmplib/mib.c:
+
+ add comment
+
+2002-03-29 08:36 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ add a allow_creation definition.
+
+2002-03-29 08:22 hardaker
+
+ * Makefile.in:
+
+ make net-snmp-config executable after it's built
+
+2002-03-29 08:13 hardaker
+
+ * agent/mibgroup/mibII/: setSerialNo.c, setSerialNo.h:
+
+ opps. forgot to check the setSerial code in
+
+2002-03-28 23:48 hardaker
+
+ * agent/mibgroup/ucd-snmp/: pass.c (V4-2-patches.4), pass.c:
+
+ enable row creation for pass modules. Patch #482005
+
+2002-03-28 23:44 hardaker
+
+ * agent/mibgroup/mibII/: interfaces.c (V4-2-patches.2),
+ interfaces.c:
+
+ patch #517340: freebsd5 support
+
+2002-03-28 23:38 hardaker
+
+ * agent/mibgroup/host/: hr_filesys.c (V4-2-patches.4), hr_filesys.c
+:
+
+ apply freebsd5 patch #517333
+
+2002-03-28 23:32 hardaker
+
+ * agent/mibgroup/: host/hr_system.c, mibII/interfaces.c
+, mibII/ipAddr.c:
+
+ Apply netbsd fix patch #529733
+
+2002-03-28 23:01 hardaker
+
+ * snmplib/: snmp_api.c (V4-2-patches.8), snmp_api.c,
+ snmp_api.c:
+
+ use a static variable for init checking. Bug #536386.
+
+2002-03-28 15:25 dts12
+
+ * man/: default_store.3.top, read_config.3.def,
+ snmp_api.3.def:
+
+ Tweak to use the new include structure.
+
+2002-03-28 15:23 dts12
+
+ * FAQ (V4-2-patches.8), FAQ:
+
+ Add a few new entries (mostly relating to traps)
+
+2002-03-28 14:56 rstory
+
+ * agent/helpers/table_array.c:
+
+ rename/prefix functions; add doxygen documentation
+
+2002-03-28 13:00 rstory
+
+ * doxygen.conf:
+
+ add define for excluding stuff (DOXYGEN_SHOULD_SKIP_THIS)
+
+2002-03-28 12:50 hardaker
+
+ * agent/mibgroup/mibII.h:
+
+ add setSerialNo
+
+2002-03-28 12:47 hardaker
+
+ * snmplib/ucd_compat.c:
+
+ fix a never-seen-but-very-old-bug using the wrong default_store token.
+
+2002-03-28 12:46 hardaker
+
+ * snmplib/snmp_api.c:
+
+ only set the default output style if it's not already set to something.
+
+2002-03-28 12:45 hardaker
+
+ * agent/agent_read_config.c:
+
+ wrapping.
+
+2002-03-28 12:17 hardaker
+
+ * doxygen.conf:
+
+ change version number
+
+2002-03-28 12:08 rstory
+
+ * apps/snmptranslate.c:
+
+ back out change from version 1.65 until better solution can be found;
+ bug #535029
+
+2002-03-28 12:03 rstory
+
+ * agent/agent_registry.c:
+
+ return specific result code for registration failure if available.
+
+2002-03-28 11:57 hardaker
+
+ * agent/: agent_registry.c, mibgroup/agentx/master_admin.c
+:
+
+ perl typo
+
+2002-03-27 15:48 rstory
+
+ * local/mib2c.array-auto.conf:
+
+ delete old, unused conf file
+
+2002-03-27 08:27 hardaker
+
+ * apps/: notification_log.c, notification_log.h,
+ snmptrapd.c:
+
+ add "dontRetainLogs" token to snmptrapd.conf to not enable the
+ notification log mib.
+
+2002-03-27 01:54 dts12
+
+ * configure.in, configure (V4-2-patches.[1,1]), configure,
+ configure.in:
+
+ Use the correct name of the Windows IP Helper API library.
+ (Computers can be soooo picky!)
+
+2002-03-26 23:23 hardaker
+
+ * agent/snmp_agent.c, agent/snmpd.c,
+ agent/helpers/all_helpers.c, agent/helpers/bulk_to_next.c
+, agent/helpers/debug_handler.c,
+ agent/helpers/read_only.c, agent/mibgroup/agentx/master.c
+, include/net-snmp/agent/bulk_to_next.h,
+ include/net-snmp/agent/debug_handler.h,
+ include/net-snmp/agent/read_only.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/var_struct.h:
+
+ - Really fix the "undo failed" problem. IE, not just any old error
+ will cause an undo failed message to get sent back. Only varbinds
+ with an undo failed error code will cause an undo failed result.
+ undo failed results do still supersede all other error codes,
+ however, which is what the original problem was all about. We still
+ have to depend on the modules returning the right error code (but
+ that's their fault if they don't).
+ - misc cleanups and renames
+
+2002-03-26 23:20 hardaker
+
+ * README:
+
+ add Craig Setera
+
+2002-03-26 14:07 rstory
+
+ * TODO:
+
+ add creating src rpm spec file
+
+2002-03-26 08:29 hardaker
+
+ * agent/mibgroup/ucd-snmp/: diskio.c (V4-2-patches.2), diskio.c
+:
+
+ enable diskio on freebsd5. Implements patch 517328 in a different way.
+
+2002-03-26 07:58 hardaker
+
+ * mibs/Makefile.in:
+
+ fix for other-dir builds
+
+2002-03-26 07:57 hardaker
+
+ * agent/agent_registry.c:
+
+ duplicate registration info in split_subtree
+
+2002-03-26 07:43 dts12
+
+ * configure, configure.in (V4-2-patches.[0,0]), configure,
+ configure.in:
+
+ Add /etc/filesystems to list of mount table files (for AIX)
+ Should fix bugs 232588 and (?)517113
+
+2002-03-26 07:39 dts12
+
+ * configure, configure.in (V4-2-patches.[9,9]), configure,
+ configure.in:
+
+ Remove trailing ':' from list of MIB module names in configure output,
+ to avoid confusion (see Bug #491129)
+
+2002-03-26 06:41 dts12
+
+ * configure, configure.in:
+
+ Add '-lhlpapi' to the list of agent libraries, when running on Windows
+ (using Cygwin). Should fix Bug #534409.
+
+2002-03-25 22:33 rstory
+
+ * snmplib/: parse.c (V4-2-patches.3), parse.c:
+
+ fix bug#520478 showMibErrors token is inverted
+
+2002-03-25 15:18 rstory
+
+ * include/net-snmp/version.h:
+
+ remove ^M characters
+
+2002-03-25 14:53 hardaker
+
+ * agent/snmp_agent.c, include/net-snmp/agent/snmp_agent.h
+:
+
+ use emacs to fix perl search and replace errors, of course
+
+2002-03-25 14:47 hardaker
+
+ * agent/agent_registry.c, agent/snmp_agent.c,
+ agent/helpers/old_api.c, agent/helpers/table.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, agent/mibgroup/testhandler.c,
+ agent/mibgroup/agentx/master_admin.c,
+ apps/notification_log.c,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/library/mib.h,
+ local/mib2c.create-dataset.conf, snmplib/mib.c,
+ snmplib/snmp_api.c:
+
+ use perl to search and replace perl search and replace errors, of course
+
+2002-03-25 14:23 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ api changes
+
+2002-03-25 08:43 dts12
+
+ * win32/: win32.opt, libsnmp_dll/libsnmp.def,
+ snmpbulkget/snmpbulkget.dsp, snmpbulkwalk/snmpbulkwalk.dsp
+, snmpd/snmpd.dsp, snmpdelta/snmpdelta.dsp,
+ snmpdf/snmpdf.dsp, snmpget/snmpget.dsp,
+ snmpgetnext/snmpgetnext.dsp, snmpnetstat/snmpnetstat.dsp
+, snmpset/snmpset.dsp, snmpstatus/snmpstatus.dsp
+, snmptable/snmptable.dsp, snmptest/snmptest.dsp
+, snmptranslate/snmptranslate.dsp,
+ snmptrap/snmptrap.dsp, snmptrapd/snmptrapd.dsp,
+ snmpusm/snmpusm.dsp, snmpvacm/snmpvacm.dsp,
+ snmpwalk/snmpwalk.dsp:
+
+ Remove redundant declarations of 'getopt.c' and 'snmp_parse_args.c' in
+ each individual application project. These routines are included within
+ the libraries, so we might as well use those.
+
+2002-03-25 05:53 dts12
+
+ * win32/: mib_module_inits.h, win32.opt,
+ libsnmp_dll/libsnmp.def, libsnmp_dll/libsnmp_dll.dsp,
+ snmpd/snmpd.dsp:
+
+ Gotcha! Everything now builds (more-or-less) cleanly under Visual C++.
+ You still have to use the "Batch Build" mechanism (or else be careful which
+ of libsnmp/libsnmp_dll you build in each of the Debug & Release modes),
+ and you need to build twice in order to get encode_keychange linking.
+ But things *do* finally build.
+
+2002-03-24 05:21 nba
+
+ * snmplib/mib.c:
+
+ Oops - snprint_* cannot realloc
+
+2002-03-23 09:40 hardaker
+
+ * apps/Makefile.in:
+
+ really fix snmpinform installs this time.
+
+2002-03-22 22:32 hardaker
+
+ * apps/notification_log.c:
+
+ final cleanups of notification log support
+
+2002-03-22 22:32 hardaker
+
+ * apps/Makefile.in:
+
+ fix installation of snmpinform
+
+2002-03-22 22:32 hardaker
+
+ * agent/helpers/table_data.c, agent/mibgroup/testhandler.c
+, include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h:
+
+ Rename stuff. Fix stuff. You know, normal routine.
+
+2002-03-22 22:31 hardaker
+
+ * configure, configure.in:
+
+ fix version file location for non-sourcedir builds
+
+2002-03-22 14:13 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ forgot to commit a prototype.
+
+2002-03-22 14:12 hardaker
+
+ * agent/agent_handler.c, agent/agent_registry.c,
+ agent/mibgroup/agentx/master_admin.c,
+ include/net-snmp/agent/agent_registry.h:
+
+ register_mib_context2 -> netsnmp_register_mib (and marked as internal)
+
+2002-03-22 14:01 hardaker
+
+ * agent/mibgroup/agentx/: master.c, subagent.c:
+
+ use new error logging api when !root
+
+2002-03-22 14:00 hardaker
+
+ * snmplib/snmp_api.c:
+
+ enable logging session errors to some log level other than ERR.
+
+2002-03-22 13:55 hardaker
+
+ * agent/mibgroup/agentx/: master.c, subagent.c:
+
+ better agentx connection related error messages.
+
+2002-03-22 09:35 dts12
+
+ * win32/: win32.dsw, win32.opt,
+ libhelpers/libhelpers.dsp, libsnmp_dll/libsnmp.def,
+ netsnmpmibs/netsnmpmibs.dsp, snmpd/snmpd.dsp:
+
+ Slowly making progress on 5.0 Windows build.
+ Everything now compiles, though the Release version doesn't link.
+ (complains about assorted unknown routines that are there,
+ staring it in the face. Grrr!!!!)
+
+2002-03-22 08:24 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - do not "tweak" range_subid when dealing with compressed OIDs.
+ Thanks to Craig Setera for pointing out this deviation from RFC
+ 2741.
+
+2002-03-22 07:50 dts12
+
+ * include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmp_client.h, snmplib/oid_array.c
+, snmplib/snmpTCPDomain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmp_api.c, snmplib/snmp_client.c:
+
+ Various minor inconsistencies (mostly to do with subtle variations in types)
+
+2002-03-22 07:31 rstory
+
+ * snmplib/snmp_parse_args.c:
+
+ fix typo
+
+2002-03-22 07:29 dts12
+
+ * win32/: mib_module_includes.h, mib_module_inits.h,
+ net-snmp/net-snmp-config.h,
+ net-snmp/library/snmpv3-security-includes.h:
+
+ Bring Windows versions of "automatically-generated" header files up to date.
+
+2002-03-22 02:23 jbpn
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - don't use "reg" as a parameter name in kernel_sunos5_cache_age()
+ as /usr/include/inet/common.h says:
+ #define reg register
+ (!) which the compiler then barfs on. Reported as bug #533336 by
+ Anonymous.
+
+2002-03-21 09:24 hardaker
+
+ * include/net-snmp/library/read_config.h,
+ include/net-snmp/library/snmp_api.h, snmplib/read_config.c
+, snmplib/snmp_api.c, snmplib/snmp_parse_args.c
+:
+
+ - snmp_config* -> netsnmp_config (for new functions only)
+ - fix bug where snmp_config() strings were getting parsed twice.
+
+2002-03-21 09:23 hardaker
+
+ * apps/snmptrapd.c:
+
+ wrap agentx stuff in a still unused variable (at this point).
+
+2002-03-21 09:23 hardaker
+
+ * apps/snmptranslate.c:
+
+ remove unused variable.
+
+2002-03-21 09:23 hardaker
+
+ * agent/mibgroup/utilities/override.c:
+
+ fix oid parsing.
+
+2002-03-21 09:22 hardaker
+
+ * agent/mibgroup/: Rmon/alarm.c, Rmon/statistics.c,
+ mibII/at.c:
+
+ change // coments to /* */ comments (bad bad bad)
+
+2002-03-21 06:40 hardaker
+
+ * snmplib/snmp-tc.c:
+
+ change // coments to /* */ comments (bad bad bad)
+
+2002-03-20 20:12 hardaker
+
+ * snmplib/snmp_api.c:
+
+ add a list of registered text enums to ASN_* values.
+ (In probably the wrong place.)
+
+2002-03-20 20:11 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/utilities.h,
+ agent/mibgroup/utilities/override.c,
+ agent/mibgroup/utilities/override.h:
+
+ create a new "override" directive to force an OID to a particular value
+ - not finished. It's designed to do read-write as well, but doesn't.
+
+2002-03-20 20:08 hardaker
+
+ * agent/helpers/instance.c:
+
+ check for inclusive
+
+2002-03-20 11:37 hardaker
+
+ * include/net-snmp/agent/table_dataset.h:
+
+ include new delete/remove breakdown APIs
+
+2002-03-20 11:36 hardaker
+
+ * apps/notification_log.c:
+
+ API change.
+
+2002-03-20 11:36 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ some "this will change" early row status implementation.
+ - (this will move to a separate handler)
+
+2002-03-20 11:35 hardaker
+
+ * agent/helpers/table_data.c:
+
+ pointer checking against illegal adds (ie, shouldn't happen but check anyway)
+
+2002-03-20 08:42 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ Ok, I make mistakes. I admit it. It really should have been a NULL.
+
+2002-03-20 08:37 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ add missing comma
+
+2002-03-20 08:36 hardaker
+
+ * agent/helpers/table_data.c,
+ include/net-snmp/agent/table_data.h:
+
+ separate out delete/remove row functionality
+
+2002-03-20 07:47 hardaker
+
+ * agent/mibgroup/mibII/: system_mib.c (V4-2-patches.6),
+ system_mib.c:
+
+ remove illegal SET support for sysDescr.
+
+2002-03-20 06:27 hardaker
+
+ * CodingStyle, local/mib2c:
+
+ - add many many -T flags for defining types.
+
+2002-03-19 21:13 hardaker
+
+ * apps/snmptrapd.c:
+
+ force setting of '!root' flag so that it will run for non-privileged
+ users or when an agentx master simply has never existed.
+
+2002-03-19 16:02 hardaker
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ - allow tables to be marked whether they should support creation or not.
+ - bug fixes
+
+2002-03-19 07:32 hardaker
+
+ * agent/helpers/: table_data.c, table_dataset.c:
+
+ documentation clean up
+
+2002-03-19 07:28 hardaker
+
+ * agent/: agent_handler.c, helpers/table_data.c:
+
+ documentation clean up
+
+2002-03-19 07:17 hardaker
+
+ * agent/: agent_handler.c, helpers/bulk_to_next.c,
+ helpers/table_dataset.c, mibgroup/examples/scalar_int.c
+:
+
+ documentation clean up
+
+2002-03-19 06:43 hardaker
+
+ * agent/agent_handler.c, agent/agent_registry.c,
+ agent/snmp_agent.c, agent/helpers/instance.c,
+ agent/helpers/old_api.c, agent/helpers/table.c,
+ agent/helpers/table_array.c, agent/helpers/table_data.c
+, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c, agent/mibgroup/testdelayed.c
+, agent/mibgroup/testhandler.c,
+ agent/mibgroup/agentx/master_admin.c,
+ apps/notification_log.c, include/net-snmp/utilities.h,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/library/data_list.h,
+ local/mib2c.create-dataset.conf, perl/agent/agent.xs,
+ snmplib/data_list.c:
+
+ - renamed a few badly named functions (netsnmp_ appeared twice).
+ - implemented the beginning of creation support for datasets.
+
+2002-03-19 06:35 hardaker
+
+ * configure:
+
+ Apparently I ran autoconf earlier and missed checking in the results.
+
+2002-03-19 06:35 hardaker
+
+ * CodingStyle:
+
+ add -nfca
+
+2002-03-17 16:25 hardaker
+
+ * apps/snmptrap.c:
+
+ Set default port to 162.
+
+2002-03-17 15:51 hardaker
+
+ * snmplib/: snmpTCPDomain.c, snmpUDPDomain.c:
+
+ improved formatting strings showing both transport type and port number.
+
+2002-03-13 23:30 hardaker
+
+ * Makefile.rules:
+
+ add missing "installsubdirs" target missing (thanks to Katsuhisa ABE)
+
+2002-03-13 23:27 hardaker
+
+ * configure.in, net-snmp-config.in:
+
+ add --create-snmpv3-user to automate adding a v3 user to both the usm
+ and vacm tables (by adding lines to both the persistent and normal
+ conf files).
+
+2002-03-13 16:30 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ bug fix for pre-processed requests.
+
+2002-03-13 16:30 hardaker
+
+ * Makefile.rules, configure, configure.in,
+ agent/Makefile.in, agent/mibgroup/agent_mibs.h,
+ include/ucd-snmp/agent_index.h,
+ include/ucd-snmp/agent_read_config.h,
+ include/ucd-snmp/agent_registry.h,
+ include/ucd-snmp/agent_trap.h, include/ucd-snmp/asn1.h,
+ include/ucd-snmp/auto_nlist.h, include/ucd-snmp/callback.h
+, include/ucd-snmp/default_store.h,
+ include/ucd-snmp/ds_agent.h,
+ include/ucd-snmp/header_complex.h, include/ucd-snmp/int64.h
+, include/ucd-snmp/keytools.h, include/ucd-snmp/mib.h
+, include/ucd-snmp/mib_module_config.h,
+ include/ucd-snmp/mibincl.h, include/ucd-snmp/parse.h,
+ include/ucd-snmp/read_config.h, include/ucd-snmp/scapi.h
+, include/ucd-snmp/snmp-tc.h, include/ucd-snmp/snmp.h
+, include/ucd-snmp/snmp_agent.h,
+ include/ucd-snmp/snmp_alarm.h, include/ucd-snmp/snmp_api.h
+, include/ucd-snmp/snmp_client.h,
+ include/ucd-snmp/snmp_debug.h, include/ucd-snmp/snmp_impl.h
+, include/ucd-snmp/snmp_logging.h,
+ include/ucd-snmp/snmp_parse_args.h,
+ include/ucd-snmp/snmp_vars.h, include/ucd-snmp/snmpusm.h
+, include/ucd-snmp/snmpv3.h, include/ucd-snmp/struct.h
+, include/ucd-snmp/system.h, include/ucd-snmp/tools.h
+, include/ucd-snmp/transform_oids.h,
+ include/ucd-snmp/ucd-snmp-agent-includes.h,
+ include/ucd-snmp/ucd-snmp-includes.h,
+ include/ucd-snmp/util_funcs.h, include/ucd-snmp/var_struct.h
+, include/ucd-snmp/version.h:
+
+ - --enable-ucd-snmp-compatibility actually installs headers (as opposed
+ to always, which is what it used to do).
+ - add agent_mibs to configure default mib modules and document.
+ - change help documentation a bit for the mib modules.
+ - add a forced dependency for mib_modules.lo
+
+2002-03-13 16:13 hardaker
+
+ * agent/mibgroup/agent.h:
+
+ opps. duplicates existing agent_mibs.h
+
+2002-03-13 15:50 hardaker
+
+ * mibs/: UCD-DEMO-MIB.txt, UCD-DISKIO-MIB.txt, UCD-DLMOD-MIB.txt,
+ UCD-IPFILTER-MIB.txt, UCD-IPFWACC-MIB.txt, UCD-SNMP-MIB.txt
+ (V4-2-patches.[1,1,1,1,1,9]), UCD-DEMO-MIB.txt,
+ UCD-DISKIO-MIB.txt, UCD-DLMOD-MIB.txt,
+ UCD-IPFILTER-MIB.txt, UCD-IPFWACC-MIB.txt,
+ UCD-SNMP-MIB.txt:
+
+ address changes for ucd-snmp -> net-snmp note saying these mibs are no
+ longer supported by UCD.
+
+2002-03-13 15:39 hardaker
+
+ * agent/mibgroup/agent.h,
+ agent/mibgroup/agent/nsModuleTable.c,
+ agent/mibgroup/agent/nsModuleTable.h,
+ mibs/NET-SNMP-AGENT-MIB.txt:
+
+ Added a nsModuleTable table which replaces the older mrTable.
+ Functionally, this is a list of all registered items within the MIB
+ tree just like the mrTable was, but with support for contexts and for
+ duplicate registrations with different priorities.
+
+2002-03-13 15:21 hardaker
+
+ * snmplib/: tools.c (V4-2-patches.4), tools.c:
+
+ malloc at least one byte in hex_to_binary2
+
+2002-03-13 15:11 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ remove unneeded debug statement
+
+2002-03-13 14:10 hardaker
+
+ * snmplib/mib.c:
+
+ Use local variable name buffers by default when building oid segments.
+
+2002-03-13 14:09 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ /* stop water from flowing through dam */
+ finger->insert("hole")
+
+2002-03-13 04:03 dts12
+
+ * FAQ (V4-2-patches.7), FAQ:
+
+ Add a description of "unlinked OIDs".
+
+2002-03-12 21:30 hardaker
+
+ * local/: mib2c.create-dataset.conf, mib2c.iterate.conf
+:
+
+ fix headers.
+
+2002-03-12 21:15 hardaker
+
+ * local/mib2c:
+
+ add don't format comments option
+
+2002-03-12 21:10 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ fix for tables with holes.
+
+2002-03-12 21:09 hardaker
+
+ * mibs/Makefile.in:
+
+ move default mibs to their own variable.
+
+2002-03-12 21:06 hardaker
+
+ * perl/: SNMP/Makefile.PL, agent/Makefile.PL,
+ agent/agent.xs, agent/typemap:
+
+ - use net-snmp-config to figure things out.
+ - update headers and typeinfo for recent changes.
+
+2002-03-12 20:34 hardaker
+
+ * local/: FAQ2HTML, README.mib2c, mib2c, tkmib
+, mib2c.array-auto.conf, mib2c.array-user.conf:
+
+ ucd-snmp -> net-snmp changes.
+
+2002-03-12 20:33 hardaker
+
+ * local/mib2c.storage.conf:
+
+ remove obsolete mib2c.conf file
+
+2002-03-12 18:11 hardaker
+
+ * agent/helpers/table_data.c:
+
+ don't forget to set row->next->prev to something when removing row.
+
+2002-03-12 17:54 hardaker
+
+ * agent/snmp_agent.c:
+
+ fix agentx inclusive searches to ignore get errors.
+
+2002-03-12 17:53 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ some minimal dump debugging.
+
+2002-03-12 08:34 dts12
+
+ * FAQ (V4-2-patches.6), FAQ:
+
+ Updating of the FAQ ready for the next release.
+ (Mostly rephrasing of existing entries, but a few new questions)
+
+2002-03-11 18:00 rstory
+
+ * agent/helpers/table_dataset.c:
+
+ cast -1 to u_char so test doesn't always fail (fix compiler warning)
+
+2002-03-11 17:27 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ treat (illegal) errors from subagents specially for getnext cases.
+
+2002-03-11 13:41 hardaker
+
+ * net-snmp-config.in:
+
+ add our snmp libraries to output
+
+2002-03-11 10:34 hardaker
+
+ * include/net-snmp/agent/: table_data.h, table_dataset.h
+:
+
+ delete/remove support header changes.
+
+2002-03-11 09:13 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - allow compilation --with-out-transports=TCP
+
+2002-03-11 08:21 jbpn
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ - fixes for --disable-debugging
+
+2002-03-11 07:41 dts12
+
+ * FAQ (V4-2-patches.5), FAQ:
+
+ Bring the 4x- and main-branch FAQs into agreement.
+
+2002-03-11 06:51 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - use correct session ID when talking to subagents. Thanks to Craig
+ Setera for this fix.
+
+2002-03-11 05:20 jbpn
+
+ * snmplib/parse.c:
+
+ - fix bad type assignment in build_translation_table(), noticed by
+ Peter Stevens.
+
+2002-03-11 00:13 hardaker
+
+ * apps/snmptrapd.c:
+
+ check for NULL frees, even though it's supposed to be ok according to ansi.
+
+2002-03-11 00:12 hardaker
+
+ * apps/notification_log.c:
+
+ beginning support for maximum logged checking.
+
+2002-03-11 00:11 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ - remove/delete row support.
+ - null check
+ - doc comments.
+
+2002-03-11 00:10 hardaker
+
+ * agent/helpers/table_data.c:
+
+ remove/delete row support.
+
+2002-03-11 00:08 hardaker
+
+ * agent/helpers/instance.c:
+
+ call next handlers (opps).
+
+2002-03-10 14:11 nba
+
+ * man/mib_api.3.def:
+
+ Fix one sprint_variable => snprint_variable
+
+2002-03-10 14:06 nba
+
+ * include/net-snmp/library/mib.h, snmplib/mib.c:
+
+ Add snprint_* functions that were sprint_* in ucd-snmp 4
+
+2002-03-10 14:05 nba
+
+ * include/net-snmp/session_api.h, snmplib/snmpIPXDomain.c
+, snmplib/snmp_transport.c:
+
+ Fix compilation when IPX-transport enabled
+
+2002-03-10 14:03 nba
+
+ * apps/snmpnetstat/Makefile.in:
+
+ Fix compilation outside source directory
+
+2002-03-08 22:26 hardaker
+
+ * FAQ, sedscript.in, perl/SNMP/SNMP.pm,
+ snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.pre2 )
+
+2002-03-08 18:23 hardaker
+
+ * README:
+
+ misc changes.
+
+2002-03-08 18:23 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ new api changes
+
+2002-03-08 17:20 hardaker
+
+ * agent/mibgroup/mibII/mta_sendmail.c:
+
+ Patch from Lawrence Greenfield to deal with Sendmail 8.12 queuegroups.
+
+2002-03-08 16:59 hardaker
+
+ * apps/snmpnetstat/Makefile.in:
+
+ patch from csete to fix win32 builds
+
+2002-03-08 16:55 hardaker
+
+ * configure, configure.in:
+
+ add Callback transport to cygwin
+
+2002-03-08 16:49 hardaker
+
+ * NEWS:
+
+ mention rmon support.
+
+2002-03-08 16:39 hardaker
+
+ * snmplib/snmp_api.c:
+
+ patch from Harrie Hazewinkel to remove old an unused pointer
+
+2002-03-08 16:28 hardaker
+
+ * agent/agent_index.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c,
+ agent/helpers/instance.c, agent/helpers/old_api.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, agent/helpers/table_iterator.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/header_complex.h, agent/mibgroup/testhandler.c
+, agent/mibgroup/Rmon/event.c,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/client.h,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_admin.h,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/protocol.h,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/agentx/subagent.h,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteObjectsTable.h,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerTable.h,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/smux/smux.h
+, agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/target/target.h,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/proxy.h, apps/notification_log.c
+, apps/notification_log.h, apps/snmpbulkget.c,
+ apps/snmpbulkwalk.c, apps/snmpdelta.c, apps/snmpdf.c
+, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpset.c, apps/snmpstatus.c, apps/snmptable.c
+, apps/snmptest.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmptrapd_log.c,
+ apps/snmptrapd_log.h, apps/snmpusm.c, apps/snmpvacm.c
+, apps/snmpwalk.c, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/netstat.h,
+ apps/snmpnetstat/route.c,
+ include/net-snmp/agent/agent_index.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/agent_trap.h,
+ include/net-snmp/agent/old_api.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/snmp_vars.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/agent/var_struct.h,
+ include/net-snmp/library/cmu_compat.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/library/mib.h,
+ include/net-snmp/library/oid_array.h,
+ include/net-snmp/library/parse.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_parse_args.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmpusm.h,
+ local/mib2c.array-user.conf, local/mib2c.iterate.conf,
+ local/mib2c.storage.conf, perl/SNMP/SNMP.xs,
+ snmplib/cmu_compat.c, snmplib/mib.c,
+ snmplib/snmpCallbackDomain.c, snmplib/snmp_api.c,
+ snmplib/snmp_client.c, snmplib/snmp_debug.c,
+ snmplib/snmp_parse_args.c, snmplib/snmp_secmod.c,
+ snmplib/snmpksm.c, snmplib/snmpusm.c, snmplib/snmpv3.c
+, snmplib/ucd_compat.c:
+
+ struct snmp_session typedefed to netsnmp_session. & pdu. & ...
+
+2002-03-08 14:00 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ get_symbol -> get_tree
+
+2002-03-08 07:45 hardaker
+
+ * perl/: SNMP/SNMP.xs, agent/agent.pm, agent/agent.xs
+, agent/test.pl:
+
+ missed updates
+
+2002-03-08 07:43 hardaker
+
+ * snmplib/: data_list.c, default_store.c, mib.c
+, oid_array.c, oid_stash.c, read_config.c
+, snmpAAL5PVCDomain.c, snmpCallbackDomain.c,
+ snmpIPXDomain.c, snmpTCPDomain.c, snmpTCPIPv6Domain.c
+, snmpUDPDomain.c, snmpUDPIPv6Domain.c,
+ snmpUnixDomain.c, snmp_api.c, snmp_debug.c,
+ snmp_transport.c, snmpv3.c:
+
+ missing updated code
+
+2002-03-08 02:07 jbpn
+
+ * include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_transport.h, snmplib/snmp_api.c
+:
+
+ - some snmp -> netsnmp fixes
+
+2002-03-07 13:42 hardaker
+
+ * agent/snmp_agent.c, agent/snmp_vars.c,
+ agent/snmpd.c, agent/helpers/table.c,
+ agent/helpers/table_array.c, agent/helpers/table_data.c
+, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c, agent/mibgroup/testhandler.c
+, agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_vars.c, apps/notification_log.c
+, apps/snmptrapd.c, apps/snmptrapd_log.c,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpIPXDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ local/mib2c.array-auto.conf, local/mib2c.array-user.conf
+, local/mib2c.create-dataset.conf,
+ local/mib2c.iterate.conf:
+
+ massive netsnmp_ prefixing of stuff (pass 4)
+
+2002-03-07 13:29 hardaker
+
+ * agent/agent_handler.c, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/snmp_vars.c,
+ agent/helpers/all_helpers.c, agent/helpers/bulk_to_next.c
+, agent/helpers/debug_handler.c,
+ agent/helpers/instance.c, agent/helpers/multiplexer.c,
+ agent/helpers/null.c, agent/helpers/old_api.c,
+ agent/helpers/read_only.c, agent/helpers/serialize.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, agent/helpers/table_iterator.c,
+ agent/mibgroup/testdelayed.c, agent/mibgroup/testhandler.c
+, agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsTransactionTable.h,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/examples/scalar_int.c,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/target/target_counters.c,
+ apps/notification_log.c,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/bulk_to_next.h,
+ include/net-snmp/agent/debug_handler.h,
+ include/net-snmp/agent/instance.h,
+ include/net-snmp/agent/multiplexer.h,
+ include/net-snmp/agent/null.h,
+ include/net-snmp/agent/old_api.h,
+ include/net-snmp/agent/read_only.h,
+ include/net-snmp/agent/serialize.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ local/mib2c.array-auto.conf, local/mib2c.array-user.conf
+, local/mib2c.create-dataset.conf,
+ local/mib2c.iterate.conf:
+
+ massive netsnmp_ prefixing of stuff (pass 3)
+
+2002-03-07 13:13 hardaker
+
+ * agent/agent_handler.c, agent/agent_registry.c,
+ agent/snmp_agent.c, agent/helpers/debug_handler.c,
+ agent/helpers/instance.c, agent/helpers/old_api.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, agent/helpers/table_iterator.c,
+ agent/mibgroup/testdelayed.c, agent/mibgroup/testhandler.c
+, agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/target/target.c, apps/snmptrapd.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/library/data_list.h,
+ include/net-snmp/library/oid_array.h,
+ include/net-snmp/library/oid_stash.h,
+ local/mib2c.array-user.conf:
+
+ massive netsnmp_ prefixing of stuff (pass 2)
+
+2002-03-07 08:56 hardaker
+
+ * agent/agent_handler.c, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c,
+ agent/helpers/bulk_to_next.c, agent/helpers/debug_handler.c
+, agent/helpers/instance.c,
+ agent/helpers/multiplexer.c, agent/helpers/null.c,
+ agent/helpers/old_api.c, agent/helpers/read_only.c,
+ agent/helpers/serialize.c, agent/helpers/table.c,
+ agent/helpers/table_array.c, agent/helpers/table_data.c
+, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c, agent/mibgroup/testdelayed.c
+, agent/mibgroup/testdelayed.h,
+ agent/mibgroup/testhandler.c, agent/mibgroup/testhandler.h
+, agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsTransactionTable.h,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master.h,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_context.h,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/target/target_counters.h,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/proxy.h, apps/notification_log.c
+, apps/notification_log.h, apps/snmpstatus.c,
+ apps/snmptest.c, apps/snmptrapd.c,
+ apps/snmptrapd_log.c, apps/snmptrapd_log.h,
+ include/net-snmp/session_api.h,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/bulk_to_next.h,
+ include/net-snmp/agent/debug_handler.h,
+ include/net-snmp/agent/instance.h,
+ include/net-snmp/agent/multiplexer.h,
+ include/net-snmp/agent/null.h,
+ include/net-snmp/agent/old_api.h,
+ include/net-snmp/agent/read_only.h,
+ include/net-snmp/agent/serialize.h,
+ include/net-snmp/agent/set_helper.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/snmp_vars.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_iterator.h,
+ include/net-snmp/agent/var_struct.h,
+ include/net-snmp/library/mib.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpIPXDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_transport.h,
+ local/mib2c.array-auto.conf, local/mib2c.array-user.conf
+, local/mib2c.create-dataset.conf,
+ local/mib2c.iterate.conf:
+
+ massive netsnmp_ prefixing of stuff (pass 1)
+
+2002-03-07 06:21 jbpn
+
+ * man/snmp_sess_api.3.def:
+
+ - style update
+
+2002-03-07 05:47 jbpn
+
+ * man/snmp_trap_api.3.def:
+
+ - minor updates
+
+2002-03-07 05:39 jbpn
+
+ * man/snmp_alarm.3.def:
+
+ - style update
+
+2002-03-07 05:00 jbpn
+
+ * man/read_config.3.def:
+
+ - make prototypes match header
+
+ - make style consistent with mib_api
+
+2002-03-07 03:07 jbpn
+
+ * man/mib_api.3.def:
+
+ - fix up snprint_ declarations, fix small typo. Patch by Guy
+ Harris.
+
+2002-03-07 02:44 jbpn
+
+ * include/net-snmp/library/mib.h:
+
+ - remove duplicate declaration of sprint_realloc_by_type, as noted
+ by Guy Harris.
+
+2002-03-06 17:15 hardaker
+
+ * include/net-snmp/agent/.cvsignore,
+ include/net-snmp/library/.cvsignore, perl/SNMP/t/.cvsignore
+:
+
+ new ignore files
+
+2002-03-06 17:13 hardaker
+
+ * .cvsignore:
+
+ ignore docs
+
+2002-03-06 17:08 hardaker
+
+ * agent/mibgroup/examples.h:
+
+ examples module wrapper to include all (new) examples.
+
+2002-03-06 16:58 hardaker
+
+ * agent/mibgroup/examples/scalar_int.c:
+
+ document better.
+
+2002-03-06 16:58 hardaker
+
+ * doxygen.conf:
+
+ search examples for docs.
+
+2002-03-06 16:29 hardaker
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ example MIB template (and one node)
+
+2002-03-06 16:28 hardaker
+
+ * mibs/NET-SNMP-MIB.txt:
+
+ instantiate examples
+
+2002-03-06 16:27 hardaker
+
+ * mibs/Makefile.in:
+
+ install some NS mibs
+
+2002-03-06 16:27 hardaker
+
+ * agent/mibgroup/examples/: scalar_int.c, scalar_int.h:
+
+ Example implementation of a SNMP enabled int registered at a scalar.
+
+2002-03-06 16:25 hardaker
+
+ * agent/helpers/instance.c, include/net-snmp/agent/instance.h
+:
+
+ many changes for instances. Specificically:
+ - allow for subhandlers.
+ - provide an int wrapper.
+ - reuse more code.
+ - numerous bug fixes.
+
+2002-03-06 14:05 hardaker
+
+ * NEWS:
+
+ remove a blank line.
+
+2002-03-06 14:05 hardaker
+
+ * agent/mibgroup/agentx/: master.c, master_admin.c:
+
+ Fix master agent getbulk support. this has to be independently of the
+ normal bulk->next fixes due to delegation. Long story.
+
+2002-03-06 14:03 hardaker
+
+ * agent/helpers/bulk_to_next.c:
+
+ move bulk_to_next fixing functionality into a separate function for reuse.
+
+2002-03-06 10:26 jbpn
+
+ * include/net-snmp/library/mib.h, snmplib/mib.c:
+
+ - sprinkle magic const dust
+
+2002-03-06 10:18 jbpn
+
+ * man/mib_api.3.def:
+
+ - document changed API, incorporating patches by Guy Harris.
+
+2002-03-06 09:34 hardaker
+
+ * testing/tests/: T112agentxsetfail, T122proxysetfail:
+
+ fix tests.
+
+2002-03-06 09:24 hardaker
+
+ * snmplib/snmp_parse_args.c:
+
+ re-enable setting optind to 1 till Dave tells me where this breaks.
+
+2002-03-06 09:08 hardaker
+
+ * testing/tests/: T051snmpv2ctrap, T052snmpv2cinform,
+ T058agentauthtrap:
+
+ fixes for new command line usage.
+
+2002-03-06 09:07 hardaker
+
+ * snmplib/snmp_client.c:
+
+ more improved error messages (mostly)
+
+2002-03-06 08:54 hardaker
+
+ * configure:
+
+ autoconf
+
+2002-03-06 08:41 dts12
+
+ * snmplib/: snmpv3.c (V4-2-patches.3), snmpv3.c:
+
+ Fix a confusion between defAuthType and defPrivType.
+
+2002-03-06 08:36 hardaker
+
+ * agent/mibgroup/agentx/: master.c, protocol.c:
+
+ proper fix for not requiring responses to CLEANUP messages.
+
+2002-03-06 06:07 jbpn
+
+ * agent/snmp_agent.c:
+
+ - zero the name of elements of the bulk cache
+
+2002-03-06 06:06 jbpn
+
+ * snmplib/mib.c:
+
+ - calloc() not malloc() in a few places to initialise some buffers
+ to zeroes.
+
+2002-03-06 05:52 dts12
+
+ * snmplib/: snmp_api.c (V4-2-patches.6), snmp_api.c:
+
+ Actually use the common 'defPassphrase' value if 'def{Auth,Priv}Passphrase' isn't set.
+ Qn: Should the AuthPassphrase also be used for privacy if no other value is available?
+
+2002-03-06 05:45 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - don't send requests for OIDs preceeding the start of a region
+ (this can lead to loops if e.g. a subagent has registered two
+ adjacent rows).
+
+2002-03-06 05:07 jbpn
+
+ * testing/Makefile.in:
+
+ - ignore errors doing rm -rf /tmp/snmp-test* when making testclean
+
+2002-03-06 02:26 jbpn
+
+ * snmplib/mib.c:
+
+ - use more efficient get_tree() in sprint_realloc_value()
+
+2002-03-05 18:28 hardaker
+
+ * testing/tests/: T015snmpv2cgetnext, T001snmpv1get,
+ T002snmpv1getnext, T003snmpv1getfail, T014snmpv2cget
+, T016snmpv2cgetfail, T017snmpv2ctov1getfail,
+ T018snmpv1tov2cgetfail, T100agenthup:
+
+ fixes for new forced -c flags
+
+2002-03-05 18:21 hardaker
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ remove no longer appropriate comment.
+
+2002-03-05 18:20 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ fix duplicate free by cloning the pdu before sending it out again
+ (thought I had done this once in the past already, but I got 1/2 functions).
+
+2002-03-05 18:19 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ Temporary fix to fix for agentx SET requests. This reverses a
+ previous John change where responses to cleanups are now expected
+ again. This took me a good 2 days to track down, sigh...
+
+2002-03-05 18:07 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ - add (ascii) agentx state diagram
+
+2002-03-05 18:07 hardaker
+
+ * agent/snmp_agent.c:
+
+ - multiple free bug fixes.
+ - improved debugging statements.
+
+2002-03-05 10:44 hardaker
+
+ * agent/mibgroup/agentx/: master_request.c, master_request.h
+:
+
+ removed unused files
+
+2002-03-05 10:31 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - oops, fix bad cut and paste
+
+2002-03-05 10:25 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - reintroduce scope processing (see RFC 2741, p. 66, section 7.2.3.2
+ paragraph 2): "If the subagent can't locate an appropriate
+ variable, __v.name_is_set_to_the_starting_OID__ [the important
+ bit] and the VarBind is set to `endOfMibView'"
+
+2002-03-05 09:54 hardaker
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c:
+
+ impose max length restriction supplied by mib for configuration options.
+
+2002-03-05 08:48 jbpn
+
+ * agent/: agent_index.c, snmp_agent.c,
+ helpers/debug_handler.c, mibgroup/agentx/master.c:
+
+ - use new DEBUGMSGVAR macro in a few places
+
+2002-03-05 08:45 jbpn
+
+ * snmplib/snmp_debug.c,
+ include/net-snmp/library/snmp_debug.h:
+
+ - add DEBUGMSGVAR macro to print out a variable
+
+2002-03-05 08:34 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ print_value function updates.
+
+2002-03-05 08:05 dts12
+
+ * agent/mibgroup/examples/: ucdDemoPublic.c (V4-2-patches.2),
+ ucdDemoPublic.c:
+
+ Add missing "standard" headers, and tweak a type slightly.
+ (Based on requests from Gregory Toth).
+
+2002-03-05 08:04 jbpn
+
+ * agent/snmp_agent.c:
+
+ - grrr, botched last fix
+
+2002-03-05 08:01 hardaker
+
+ * agent/mibgroup/agentx/subagent.c,
+ snmplib/snmpCallbackDomain.c:
+
+ Set the default callback session version number to the generic -1
+ version allowing the pdu to passed without version checking.
+
+2002-03-05 07:59 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ move NULL check to *before* you actually use the pointer.
+
+2002-03-05 07:59 jbpn
+
+ * agent/snmp_agent.c:
+
+ - mark INCLUSIVE requests as such
+
+2002-03-05 07:58 hardaker
+
+ * agent/helpers/old_api.c:
+
+ - use a for loop instead of a while loop, just a precaution for future problems.
+
+2002-03-05 07:56 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_check_parse) allow internal set transactions to be passed to
+ the agent, since agentx sends them.
+
+2002-03-05 07:21 jbpn
+
+ * snmplib/mib.c:
+
+ - don't add the "module ID" to OIDs if it is numeric because we
+ couldn't look it up properly (to avoid horrible looking output
+ like this: "OID: #-1::iso.2.3.4.5.")
+
+2002-03-05 07:05 jbpn
+
+ * configure.in:
+
+ - remove reference to 2c in error message from version prompt
+
+2002-03-05 07:01 jbpn
+
+ * configure.in:
+
+ - remove duplicate tests
+
+2002-03-05 06:51 hardaker
+
+ * configure, configure.in:
+
+ - re-emphasis a suggestion to switch to a secure version of the protocol.
+ - delete notion that v3 without auth/priv provides better security (it doesn't).
+ - Don't accept v2c as an accepted value, as it's used as an int.
+ - but do change help messages, etc, to reflect that 2 = v2c.
+
+2002-03-05 06:50 dts12
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Cast a calloc appropriately (requested by Gregory Toth)
+
+2002-03-05 06:20 jbpn
+
+ * snmplib/Makefile.in:
+
+ - fix typo in OBJS definition
+
+2002-03-05 06:18 jbpn
+
+ * agent/Makefile.in:
+
+ - clean target depends on $(OBJS) and $(LOBJS), so define them
+
+2002-03-05 03:52 jbpn
+
+ * configure.in:
+
+ - fix default version tests (splitting them over several lines
+ confuses sh on Solaris, at least).
+
+ - disambiguate some instances of "version" in default version
+ prompt text.
+
+2002-03-05 02:34 dts12
+
+ * configure, configure.in:
+
+ Correctly detect when no initial default version has been set.
+ Accept '2c' as well as '2' for a default version choice.
+ Fix the title for this prompt, and reword the description to
+ make it a *slightly* less leading question, m'lud.
+
+ Qn: Should we support a "no default version" option ?
+ (hence allow the admin to force the decision down to the user)
+
+2002-03-04 18:14 hardaker
+
+ * agent/mibgroup/agentx/client.c:
+
+ ucd-snmp -> net-snmp change
+
+2002-03-04 18:10 hardaker
+
+ * agent/agent_handler.c:
+
+ (To John): do not free the myvoid pointer in a handler. You can not
+ assume that it's a freeable resource. For instance, the agentx master
+ agent was using it to store the master session pointer in it (which
+ would exist in multiple registered nodes).
+
+2002-03-04 17:26 hardaker
+
+ * configure.in, include/net-snmp/snmpv3_api.h,
+ snmplib/Makefile.in:
+
+ use a configure generated wrapper header for v3 security modules.
+
+2002-03-04 11:58 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ add dmalloc.h to the proper place.
+
+2002-03-04 11:53 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ string clean ups.
+
+2002-03-04 11:52 hardaker
+
+ * acconfig.h, aclocal.m4, configure,
+ configure.in, include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/library/default_store.h,
+ snmplib/snmp_parse_args.c, snmplib/snmpv3.c:
+
+ Implement a default version prompt for configure.
+ - (Wes ducks as this is currently set to '3' which he may have to
+ change as it hasn't exactly been agreed upon as the proper default yet).
+ - --with-default-snmp-version also created.
+ - changed handling of default store / snmp.conf usage but impact
+ should be low, hopefully.
+
+2002-03-04 11:49 hardaker
+
+ * snmplib/snmp_api.c:
+
+ a few error strings slightly improved. We really need to change the
+ way these are handled to get better improvement.
+
+2002-03-04 07:49 hardaker
+
+ * testing/Makefile.in:
+
+ separate out the cleaning of /tmp from the main cleaning to provide it
+ as a special target.
+
+2002-03-04 07:38 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ -Wall fixes.
+
+2002-03-04 05:32 jbpn
+
+ * man/: snmpbulkget.1.def, snmpbulkwalk.1.def,
+ snmpget.1.def, snmpgetnext.1.def, snmpstatus.1.def
+, snmptest.1.def, snmptrap.1.def:
+
+ - remove further instances of positional community string parameter,
+ after Patrick Welche
+
+2002-03-04 05:25 jbpn
+
+ * man/: snmpd.conf.5.def, snmpwalk.1.def:
+
+ - patches from Patrick Welche
+
+2002-03-04 01:16 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory.c (V4-2-patches.6), memory.c
+:
+
+ Correct debug output message (thanks to Jeroen Ruigrok)
+
+2002-03-01 22:45 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ making the (same) debugging statement more useful.
+
+2002-03-01 22:43 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ add missing newline to a debugging statement.
+
+2002-03-01 12:49 hardaker
+
+ * snmplib/: keytools.c, mib.c, snmp_api.c,
+ snmp_client.c, snmp_parse_args.c, snmpv3.c:
+
+ First pass at a few better error messages.
+
+2002-03-01 12:01 hardaker
+
+ * mibs/Makefile.in:
+
+ don't install headers here.
+
+2002-03-01 05:41 jbpn
+
+ * include/net-snmp/library/mib.h, snmplib/mib.c:
+
+ - add snprint_value, snprint_variable, snprint_objid
+
+2002-02-28 06:54 dts12
+
+ * agent/snmp_vars.c, snmplib/snmpCallbackDomain.c,
+ win32/libsnmp/libsnmp.dsp, win32/net-snmp/net-snmp-config.h
+:
+
+ Add back the 'snmpCallback' domain under Windows.
+
+2002-02-27 10:04 jbpn
+
+ * apps/: snmpbulkget.c, snmpbulkwalk.c, snmpget.c
+, snmpgetnext.c, snmpset.c, snmpstatus.c
+, snmptable.c, snmptest.c, snmptranslate.c
+, snmptrap.c, snmpusm.c, snmpwalk.c:
+
+ - tart up usage messages, make them more consistent and bring in line
+ with manual pages
+
+2002-02-27 10:03 jbpn
+
+ * man/: snmpset.1.def, snmptable.1.def, snmptrap.1.def
+, snmpusm.1.def:
+
+ - minor formatting changes
+
+2002-02-27 10:03 jbpn
+
+ * snmplib/: mib.c, parse.c, snmp_parse_args.c
+:
+
+ - drop community positional parameter
+
+ - tart up usage messages to be more consistent and in line with manual
+ pages
+
+2002-02-27 09:47 dts12
+
+ * snmplib/: vacm.c (V4-2-patches.4), vacm.c:
+
+ Handle views that specify a full instance OID.
+ (Since the internally stored OID prepends the length as well,
+ the apparent length is one greater than it really is)
+
+2002-02-27 06:50 jbpn
+
+ * apps/snmptrapd.c:
+
+ - [ADDRESSES] -> [LISTENING ADDRESSES] in usage message, to match
+ manual page.
+
+2002-02-27 06:09 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - drop optional positional community parameter from trapsess
+ description.
+
+2002-02-27 05:51 jbpn
+
+ * include/net-snmp/library/mib.h, snmplib/mib.c:
+
+ - drop sprint_blah functions
+
+ - no snprint_blah yet
+
+2002-02-27 05:43 jbpn
+
+ * snmplib/asn1.c:
+
+ - don't use sprint_blah functions
+
+2002-02-27 05:40 jbpn
+
+ * snmplib/snmp_debug.c:
+
+ - don't use sprint_blah functions
+
+ - drop archaic DEBUGP functions
+
+2002-02-27 05:37 dts12
+
+ * agent/mibgroup/host/: hr_storage.c, hr_swrun.c:
+
+ Use the more informative 'output_api.h' header file name
+ (I must have missed these earlier)
+
+2002-02-27 05:35 jbpn
+
+ * man/snmpcmd.1.def:
+
+ - drop community positional parameter
+
+ - yes, for once the documentation has been updated *before* the
+ code!
+
+2002-02-27 05:12 jbpn
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ - don't use obsolete DEBUGP function
+
+2002-02-27 05:11 jbpn
+
+ * include/net-snmp/library/: snmp_api.h, snmp_debug.h,
+ system.h:
+
+ - drop archaic DEBUGP functions
+
+2002-02-27 05:10 jbpn
+
+ * include/net-snmp/library/scapi.h:
+
+ - don't use obsolete DEBUGPL function
+
+2002-02-27 04:32 jbpn
+
+ * apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmptable.c, apps/snmpusm.c, apps/snmpwalk.c
+, agent/agent_index.c, agent/helpers/table.c:
+
+ - don't use sprint_blah functions
+
+2002-02-27 02:26 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - don't use sprint_variable
+
+2002-02-27 02:08 jbpn
+
+ * agent/snmp_agent.c:
+
+ - don't use sprint_variable, no, I MEAN it this time
+
+2002-02-27 02:05 jbpn
+
+ * agent/snmp_agent.c:
+
+ - don't use sprint_variable
+
+2002-02-26 12:46 rstory
+
+ * agent/snmp_agent.c:
+
+ clear new memory after realloc() since realloc doesn't do it.
+
+2002-02-26 12:30 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ add UNSIGNED32
+
+2002-02-26 08:55 jbpn
+
+ * agent/mibgroup/: kernel_sunos5.c, kernel_sunos5.h,
+ mibII/at.c, mibII/icmp.c, mibII/interfaces.c,
+ mibII/ip.c, mibII/tcp.c, mibII/udp.c,
+ mibII/var_route.c:
+
+ - change cache implementation after some interesting profiling (see
+ lengthy new comment in kernel_sunos5.c)
+
+2002-02-26 08:13 dts12
+
+ * agent/helpers/all_helpers.c, agent/helpers/table.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/ucd-snmp/proxy.c, snmplib/snmp-tc.c,
+ snmplib/ucd_compat.c:
+
+ Remove assorted extraneous ^M's
+
+2002-02-26 07:14 dts12
+
+ * README.win32:
+
+ A quick guide to installing the Core Platform SDK, needed for the Windows agent.
+
+2002-02-26 07:03 dts12
+
+ * agent/agent_trap.c, agent/snmp_vars.c,
+ agent/snmpd.c, agent/helpers/table_dataset.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/vacm_vars.c
+, apps/snmptrapd_log.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/agent_trap.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/library/mib.h,
+ include/net-snmp/library/snmp_enum.h, snmplib/mib.c,
+ snmplib/snmp_parse_args.c, snmplib/snmpv3.c,
+ snmplib/winservice.c:
+
+ Assorted minor tweaks to ensure that the project builds under Visual C++.
+ Mostly because VC++ is fussy about sort-of-compatible data types
+ (e.g. signed vs unsigned integers).
+
+2002-02-26 07:00 dts12
+
+ * win32/: mib_module_inits.h, win32.dsw, win32.opt
+, libagent/libagent.dsp, libsnmp/libsnmp.dsp,
+ libucdmibs/libucdmibs.dsp, netsnmpmibs/netsnmpmibs.dsp,
+ snmpd/snmpd.dsp, snmptrapd/snmptrapd.dsp:
+
+ Rename 'libucdmibs' to reflect the change of project name,
+ and assorted tweaks so that the full project builds under Visual C++.
+ (N.B: The agent requires "Microsoft Platform Core SDK" in order
+ to build the 'netsnmpmibs' project)
+
+2002-02-26 06:53 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ remove duplicate variable in a warning
+
+2002-02-26 06:40 jbpn
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - include net-snmp-config.h
+
+2002-02-25 21:09 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ more install changes
+
+2002-02-25 21:08 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ mention installing DBD::File.
+
+2002-02-25 20:38 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ one too many '0's in a url.
+
+2002-02-25 20:33 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ reword.
+
+2002-02-25 20:30 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ move warning outside secondary warning augmentation loop.
+
+2002-02-25 20:29 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ update SQL::Statement module.
+
+2002-02-25 16:25 rstory
+
+ * agent/helpers/table_array.c:
+
+ add find_table_array_handler(); remove debugging code/comments;
+ make sure we have the right handler before using the void pointer;
+ remove ^M characters
+
+2002-02-25 11:57 hardaker
+
+ * snmplib/data_list.c, include/net-snmp/library/data_list.h
+:
+
+ 2 new functions.
+
+2002-02-25 11:18 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ set security model
+
+2002-02-25 08:15 dts12
+
+ * agent/helpers/all_helpers.c, agent/helpers/old_api.c
+, agent/helpers/table.c, agent/helpers/table_array.c
+, agent/helpers/table_dataset.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/table.h, win32/win32.dsw:
+
+ Continuing improvements to compilation of the latest code under Visual C++.
+ The 'libhelpers' project now compiles, and this also addresses a number
+ of warnings and errors in the libagent and libucdmibs projects.
+ But these two still fail on 'OID_LENGTH' and 'iphlpapi.h'
+
+2002-02-25 07:00 dts12
+
+ * win32/net-snmp/agent/mib_module_config.h:
+
+ Provide a plausible module configuration list for the Windows agent.
+
+2002-02-25 06:04 jbpn
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ - resolve conflicting SYNTAXes for nsTransactionMode
+
+ - add range for index nsTransactionID
+
+2002-02-25 03:23 dts12
+
+ * win32/: libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp_dll.dsp
+:
+
+ Ensure the main library compiles and works under Windows.
+
+2002-02-25 03:19 dts12
+
+ * apps/: notification_log.h, snmptrapd.c:
+
+ Ensure snmptrapd compiles under Windows.
+
+2002-02-25 03:09 dts12
+
+ * snmplib/: oid_array.c, oid_stash.c, snmp-tc.c,
+ ucd_compat.c:
+
+ Minor tweaks to keep Visual C++ happy.
+
+2002-02-25 02:57 dts12
+
+ * include/net-snmp/version.h:
+
+ Wrap with "extern C"
+
+2002-02-25 02:56 dts12
+
+ * include/net-snmp/library/cmu_compat.h:
+
+ Pander to CPP's incredibly fussy nature, and provide the correct header file name.
+
+2002-02-25 01:21 dts12
+
+ * agent/: snmpd.c (V4-2-patches.1), snmpd.c:
+
+ Specify the correct debug token for displaying the list of modules
+ (spotted by Brian Shaver)
+
+2002-02-22 10:56 hardaker
+
+ * local/mib2c:
+
+ support @foreach $var1 $var2 enums@
+
+2002-02-22 10:56 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ remove trailing ;'s from sql statements.
+
+2002-02-22 10:55 hardaker
+
+ * include/net-snmp/library/tools.h, snmplib/tools.c:
+
+ define netsnmp_strdup_and_null
+
+2002-02-22 10:53 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ include utilities.
+
+2002-02-22 10:51 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ - don't loop again for secondary SET modes and cache information instead.
+ - various fixes.
+
+2002-02-22 10:49 hardaker
+
+ * agent/helpers/Makefile.in:
+
+ fix install directories for headers
+
+2002-02-22 10:49 hardaker
+
+ * net-snmp-config.in:
+
+ add --compile-subagent for automatted subagent compilation from
+ mibmodule .c files ;-)
+
+2002-02-22 09:27 dts12
+
+ * snmplib/: MSG00001.bin, winservice.mc (V4-2-patches.[1,1]),
+ MSG00001.bin, winservice.mc:
+
+ Add missing files for Windows service operation.
+
+2002-02-22 08:55 dts12
+
+ * agent/snmpd.c:
+
+ Just close the main session when shutting down under Windows,
+ not everything (so that it can still generate the shutdown trap).
+
+2002-02-22 08:40 dts12
+
+ * include/net-snmp/types.h,
+ include/net-snmp/library/snmp_impl.h, snmplib/asn1.c,
+ snmplib/mib.c, snmplib/parse.c, snmplib/snmp_api.c
+, snmplib/snmp_enum.c, snmplib/snmpv3.c:
+
+ Tweaks required to get the library compiling under Windows VC++
+
+2002-02-22 08:37 dts12
+
+ * win32/: snmpsm_init.h,
+ encode_keychange/encode_keychange.dsp,
+ net-snmp/net-snmp-config.h, libagent/libagent.dsp,
+ libhelpers/libhelpers.dsp, libsnmp/libsnmp.dsp,
+ libsnmp_dll/libsnmp_dll.dsp, libucdmibs/libucdmibs.dsp
+, snmpbulkget/snmpbulkget.dsp,
+ snmpbulkwalk/snmpbulkwalk.dsp, snmpd/snmpd.dsp,
+ snmpdelta/snmpdelta.dsp, snmpdf/snmpdf.dsp,
+ snmpget/snmpget.dsp, snmpgetnext/snmpgetnext.dsp,
+ snmpnetstat/snmpnetstat.dsp, snmpset/snmpset.dsp,
+ snmpstatus/snmpstatus.dsp, snmptable/snmptable.dsp,
+ snmptest/snmptest.dsp, snmptranslate/snmptranslate.dsp
+, snmptrap/snmptrap.dsp, snmptrapd/snmptrapd.dsp
+, snmpusm/snmpusm.dsp, snmpvacm/snmpvacm.dsp,
+ snmpwalk/snmpwalk.dsp:
+
+ Provide Windows-specific versions of automatically-generated header files,
+ and add the new include structure to the project files.
+
+2002-02-22 07:24 dts12
+
+ * include/net-snmp/library/transform_oids.h:
+
+ Define standard OID lengths here (where they're available to any
+ file wanting to access the OID structures)
+
+2002-02-22 03:24 dts12
+
+ * snmplib/: snmp_parse_args.c, snmpv3.c:
+
+ Support ".... -3u {secName} ...." syntax
+ (in the normal getopt style - i.e. no need for surrounding quotes)
+
+ It should now be possible to switch to this as the recommended form
+ for SNMPv3 options - if that's what we want to do.
+ Qn: Do we want to?
+
+2002-02-21 08:39 dts12
+
+ * snmplib/snmpv3.c:
+
+ Support "-3u {secName}" syntax (*with* the quotes, unfortunately).
+ Now comes the fun bit.....
+
+2002-02-21 07:54 dts12
+
+ * win32/snmpd/snmpd.dsp:
+
+ Fix bogus structure comments in the snmpd project file.
+
+2002-02-21 07:30 jbpn
+
+ * agent/mibgroup/: notification/snmpNotifyTable.c,
+ target/snmpTargetAddrEntry.c:
+
+ - drop inline (more trouble than it is worth)
+
+2002-02-21 05:00 dts12
+
+ * snmplib/: snmp_parse_args.c, snmpv3.c:
+
+ First pass at an SNMPv3 "combined-option" command-line flag (-3x).
+ (In *addition* to the current command-line flags, I hasten to add!)
+
+ Supports "... -3u{secName} ..." and "... -3u={secName} ..." syntax,
+ but not the separate "... -3u {secName} ..." style.
+
+ I haven't touched the documentation or usage message to mention this.
+
+2002-02-20 18:15 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ use for instead of continue for loops.
+
+2002-02-20 13:42 hardaker
+
+ * README.snmpv3, agent/agent_read_config.c,
+ agent/snmpd.c, apps/snmptrapd.c,
+ include/net-snmp/agent/ds_agent.h:
+
+ - Add a --quit option (and a configuration token) so that you can now
+ create new users by simply calling snmpd as:
+ snmpd --createUser="myuser MD5 mypassword" --quit
+ - Change README.snmpv3 documentation to make use of this feature.
+
+2002-02-20 06:16 jbpn
+
+ * apps/Makefile.in, apps/snmptrapd.c, configure
+, configure.in, agent/snmp_agent.c:
+
+ - add libwrap support to snmptrapd (untested)
+
+ - minor changes to snmpd libwrap support
+
+ - configure fixes for libwrap
+
+2002-02-20 03:07 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - use calloc instead of malloc to make sure buffer is initially
+ zero-terminated (in case of 0 varbinds). Bug #518700, noted by
+ Andreas Hartmann.
+
+2002-02-20 03:06 jbpn
+
+ * apps/snmpdelta.c:
+
+ - initialise some buffers, to avoid garbage printing problems, as
+ noted by Anonymous in bug #520220.
+
+2002-02-20 03:03 dts12
+
+ * apps/Makefile.in:
+
+ Clean up the object files as well
+
+2002-02-20 01:41 dts12
+
+ * man/.cvsignore:
+
+ Ignore the new crop of generated man pages.
+
+2002-02-20 01:37 dts12
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ Supply missing double-quote (oops)
+
+2002-02-19 04:01 dts12
+
+ * apps/snmptranslate.c:
+
+ Initialise the library internals *before* parsing the command line,
+ so that defaults can be overridden by command line options.
+ Qn: Should '_init_snmp' be invoked by 'snmp_parse_args' itself?
+
+2002-02-19 03:59 dts12
+
+ * snmplib/mib.c:
+
+ Make sure that multiple output format flags work in a consistent manner.
+ (i.e. the last one is used, rather than relying on internal ordering).
+
+2002-02-18 21:58 hardaker
+
+ * agent/mibgroup/: testdelayed.c, testhandler.c:
+
+ include stdlib.h
+
+2002-02-18 21:52 hardaker
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ fix includes
+
+2002-02-18 21:51 hardaker
+
+ * agent/helpers/table_iterator.c,
+ include/net-snmp/agent/table_iterator.h:
+
+ - make capability to create data contexts from a loop context (less
+ mallocs when mallocs aren't otherwise avoidable).
+ - don't double free the data context pointer.
+
+2002-02-18 21:50 hardaker
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ include all agent helpers.
+
+2002-02-18 21:49 hardaker
+
+ * include/net-snmp/agent/multiplexer.h:
+
+ protect include from double include
+
+2002-02-18 08:38 hardaker
+
+ * agent/mibgroup/mibincl.h:
+
+ fix include paths
+
+2002-02-18 02:35 dts12
+
+ * agent/Makefile.in, snmplib/Makefile.in:
+
+ Tweak the list of header files to be installed (thanks to Christoph Mammitzsch)
+
+2002-02-18 02:29 dts12
+
+ * agent/mibgroup/host/: hr_storage.c (V4-2-patches.7), hr_storage.c
+:
+
+ Remove a couple of unhelpful OSF definitions (thanks to Jeroen Ruigrok)
+
+2002-02-18 00:13 hardaker
+
+ * snmplib/: asn1.c (V4-2-patches.3), asn1.c:
+
+ don't build oid's with >128 length subids. (see bug #518855)
+
+2002-02-16 23:18 hardaker
+
+ * mibs/: NET-SNMP-MIB.txt, NET-SNMP-MONITOR-MIB.txt,
+ NET-SNMP-SYSTEM-MIB.txt, NET-SNMP-TC.txt:
+
+ white space clean up. (AGENT-MIB not checked in due to other
+ incomplete changes).
+
+2002-02-16 00:17 hardaker
+
+ * NEWS, agent/snmpd.c, apps/snmptrapd.c,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/read_config.h, snmplib/read_config.c
+, snmplib/snmp_parse_args.c:
+
+ - finish implementing snmp_config("my config line")
+ - was done before, but previously had to be called only after
+ configuration files had been read. Now can be called at any time.
+ - make all configuration options available as --longopts command line options.
+ - --something=value -> "something value"
+ - --something -> "something 1" (works for setting booleans to true)
+
+2002-02-16 00:02 hardaker
+
+ * agent/Makefile.in:
+
+ install mib_module_config.h
+
+2002-02-16 00:01 hardaker
+
+ * configure, configure.in:
+
+ fix rpm for 4.0.3 and above (or whenever it was that we now need librpmdb)
+
+2002-02-16 00:01 hardaker
+
+ * Makefile.in, Makefile.rules:
+
+ fix net-snmp-config install/clean/etc.
+
+2002-02-15 22:34 hardaker
+
+ * Makefile.in, Makefile.rules:
+
+ install all system and machine files, since they include each other
+
+2002-02-15 09:28 dts12
+
+ * agent/mibgroup/agent/nsTransactionTable.c,
+ mibs/NET-SNMP-AGENT-MIB.txt, mibs/NET-SNMP-MIB.txt,
+ mibs/NET-SNMP-MONITOR-MIB.txt, mibs/NET-SNMP-SYSTEM-MIB.txt
+, mibs/NET-SNMP-TC.txt:
+
+ Skeleton framework for the Net-SNMP enterprise tree.
+ (incorporating the initial 'nsTransactionTable', but nothing else as yet)
+
+2002-02-15 09:10 dts12
+
+ * apps/snmptable.c, apps/snmptranslate.c,
+ snmplib/snmp_parse_args.c:
+
+ Remove support for deprecated command-line options.
+
+2002-02-15 07:28 dts12
+
+ * include/net-snmp/library/winservice.h, snmplib/winservice.c
+, agent/snmpd.c, snmplib/Makefile.in,
+ snmplib/winservice.rc, win32/snmpd/snmpd.dsp:
+
+ Support for running as a Windows service.
+ (Supplied by Raju Krishnappa & Lathu Prabhu)
+
+2002-02-15 07:25 dts12
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ Stoke Wes' sense of paranoia by conceding without comment.
+ (What might Shield be plotting now......)
+
+2002-02-15 07:19 jbpn
+
+ * man/snmpusm.1.def:
+
+ - fix tiny formatting error
+
+2002-02-15 07:17 dts12
+
+ * mibs/Makefile.in:
+
+ Install NOTIFICATION-LOG-MIB (since it's one of the default load list!)
+
+2002-02-15 06:47 dts12
+
+ * snmplib/winservice.rc:
+
+ file winservice.rc was initially added on branch V4-2-patches.
+
+2002-02-15 06:47 dts12
+
+ * snmplib/winservice.h:
+
+ file winservice.h was initially added on branch V4-2-patches.
+
+2002-02-15 06:47 dts12
+
+ * snmplib/winservice.c:
+
+ file winservice.c was initially added on branch V4-2-patches.
+
+2002-02-15 06:08 dts12
+
+ * include/net-snmp/types.h:
+
+ Include the <sys/time.h> cascade, to pick up the definition of 'timeval'
+
+2002-02-15 04:29 jbpn
+
+ * agent/snmpd.c:
+
+ - minor change to bring usage message in line with manpage
+
+2002-02-15 03:29 dts12
+
+ * snmplib/snmp_parse_args.c:
+
+ Catch use of the transport and port options, and issue an appropriate
+ error message, describing use of the <hostname> parameter instead.
+
+2002-02-15 03:11 dts12
+
+ * snmplib/: mib.c, snmp_api.c:
+
+ Set the default output format *before* processing command line options,
+ rather than after. That's probably a bit more flexible:-)
+
+2002-02-15 02:37 dts12
+
+ * include/net-snmp/: config_api.h, definitions.h,
+ mib_api.h, output_api.h, pdu_api.h, session_api.h
+, snmpv3_api.h, types.h, utilities.h,
+ varbind_api.h:
+
+ Remove 'net-snmp-config.h' from the main API header files.
+ This will have to be #included separately (either explicitly
+ or via the all-in-one 'net-snmp-includes.h' header)
+
+2002-02-15 02:31 dts12
+
+ * snmplib/Makefile.in:
+
+ Install the README to describe the status of <net-snmp/library> and <net-snmp> header files.
+
+2002-02-15 02:13 dts12
+
+ * man/Makefile.in, mibs/Makefile.in:
+
+ Install the {system,machine}/*.h header files as well.
+
+ Doing this via the 'man' & 'mibs' Makefiles is a gross hack,
+ and really needs to be handled more cleanly. But it's the
+ best I can come up with at the moment. Sorry - Dave.
+
+2002-02-15 01:59 dts12
+
+ * snmplib/Makefile.in, agent/Makefile.in:
+
+ Install the UCD-compatability headers as well.
+
+2002-02-15 01:57 dts12
+
+ * Makefile.rules:
+
+ Only install subdirectory stuff *once*. (Don't be so enthusiastic, Dave!)
+
+2002-02-15 01:31 dts12
+
+ * README.snmpv3:
+
+ Remove redundent '-CN' and '-CO' options from the example snmpusm command.
+ (as mentioned by Wes on the users mailing list 2002-02-13)
+ Qn: Does this need to be done on the V4-2-patches branch as well?
+
+2002-02-15 01:15 dts12
+
+ * include/net-snmp/utilities.h, include/net-snmp/version.h
+, include/net-snmp/library/version.h,
+ include/ucd-snmp/version.h, snmplib/snmp_parse_args.c,
+ snmplib/snmp_version.c:
+
+ Restore 'version.h' as being a "top-level" header file.
+
+2002-02-15 01:13 dts12
+
+ * snmplib/Makefile.in:
+
+ Install the full set of library header files,
+ retaining the top-level vs library subdirectory split.
+
+2002-02-15 01:10 dts12
+
+ * configure, configure.in:
+
+ Look for transport-related header files in the correct location.
+
+2002-02-15 01:09 dts12
+
+ * Makefile.rules:
+
+ Ensure partial install targets recurse properly.
+
+2002-02-14 08:18 dts12
+
+ * testing/eval_tools.sh:
+
+ Look for mib_module_config.h in the correct location
+
+2002-02-14 08:06 hardaker
+
+ * man/Makefile.in:
+
+ fix man8 install definitions
+
+2002-02-14 07:48 dts12
+
+ * Makefile.rules, net-snmp-config.in:
+
+ Substitute values into 'net-snmp-config' properly, and don't 'make clean' it away.
+
+2002-02-14 07:22 dts12
+
+ * man/Makefile.in:
+
+ Tidy up after moving the library header files
+
+2002-02-14 07:14 dts12
+
+ * configure, configure.in:
+
+ Tidy up after moving the library header files (including Makefile dependencies)
+
+2002-02-14 07:10 dts12
+
+ * include/net-snmp/agent/agent_registry.h,
+ snmplib/Makefile.depend, snmplib/default_store.c,
+ snmplib/read_config.c, snmplib/snmp_debug.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c,
+ snmplib/system.c, snmplib/tools.c,
+ agent/Makefile.depend, apps/Makefile.depend,
+ apps/snmpbulkget.c, apps/snmpget.c, apps/snmpstatus.c
+, apps/snmptranslate.c,
+ apps/snmpnetstat/Makefile.depend, apps/snmpnetstat/main.c
+, include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/snmp_vars.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/library/data_list.h,
+ include/net-snmp/library/oid_array.h,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpIPXDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_transport.h, agent/agent_trap.c
+, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, agent/mibgroup/host_res.h
+, agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/snmpv3/usmUser.h:
+
+ Tidy up after moving the library header files (including Makefile dependencies)
+
+2002-02-14 07:08 dts12
+
+ * agent/helpers/Makefile.in:
+
+ Remove an extraneous space from CPPFLAGS
+
+2002-02-14 06:23 dts12
+
+ * include/net-snmp/: config_api.h, definitions.h,
+ mib_api.h, net-snmp-includes.h, output_api.h,
+ pdu_api.h, session_api.h, snmpv3_api.h, types.h
+, utilities.h, varbind_api.h:
+
+ Separate out top-level "public API" library header files from the "internal"
+ library header files. These are still available for use by application
+ developers, but this split makes it clearer what may change in the future
+ and what can be relied upon to be stable.
+
+2002-02-14 06:19 dts12
+
+ * include/net-snmp/asn1.h, include/net-snmp/callback.h,
+ include/net-snmp/cmu_compat.h, include/net-snmp/data_list.h
+, include/net-snmp/default_store.h,
+ include/net-snmp/getopt.h, include/net-snmp/int64.h,
+ include/net-snmp/keytools.h, include/net-snmp/lcd_time.h
+, include/net-snmp/libsnmp.h, include/net-snmp/md5.h
+, include/net-snmp/mib.h, include/net-snmp/mt_support.h
+, include/net-snmp/oid_array.h,
+ include/net-snmp/oid_stash.h, include/net-snmp/parse.h,
+ include/net-snmp/read_config.h, include/net-snmp/scapi.h
+, include/net-snmp/snmp-tc.h, include/net-snmp/snmp.h
+, include/net-snmp/snmpAAL5PVCDomain.h,
+ include/net-snmp/snmpCallbackDomain.h,
+ include/net-snmp/snmpIPXDomain.h,
+ include/net-snmp/snmpTCPDomain.h,
+ include/net-snmp/snmpTCPIPv6Domain.h,
+ include/net-snmp/snmpUDPDomain.h,
+ include/net-snmp/snmpUDPIPv6Domain.h,
+ include/net-snmp/snmpUnixDomain.h,
+ include/net-snmp/snmp_alarm.h, include/net-snmp/snmp_api.h
+, include/net-snmp/snmp_client.h,
+ include/net-snmp/snmp_debug.h, include/net-snmp/snmp_enum.h
+, include/net-snmp/snmp_impl.h,
+ include/net-snmp/snmp_locking.h,
+ include/net-snmp/snmp_logging.h,
+ include/net-snmp/snmp_parse_args.h,
+ include/net-snmp/snmp_secmod.h,
+ include/net-snmp/snmp_transport.h, include/net-snmp/snmpksm.h
+, include/net-snmp/snmpusm.h, include/net-snmp/snmpv3.h
+, include/net-snmp/system.h, include/net-snmp/tools.h
+, include/net-snmp/transform_oids.h,
+ include/net-snmp/ucd_compat.h, include/net-snmp/vacm.h,
+ include/net-snmp/version.h, include/net-snmp/library/README
+, include/net-snmp/library/asn1.h,
+ include/net-snmp/library/callback.h,
+ include/net-snmp/library/cmu_compat.h,
+ include/net-snmp/library/data_list.h,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/library/getopt.h,
+ include/net-snmp/library/int64.h,
+ include/net-snmp/library/keytools.h,
+ include/net-snmp/library/lcd_time.h,
+ include/net-snmp/library/libsnmp.h,
+ include/net-snmp/library/md5.h,
+ include/net-snmp/library/mib.h,
+ include/net-snmp/library/mt_support.h,
+ include/net-snmp/library/oid_array.h,
+ include/net-snmp/library/oid_stash.h,
+ include/net-snmp/library/parse.h,
+ include/net-snmp/library/read_config.h,
+ include/net-snmp/library/scapi.h,
+ include/net-snmp/library/snmp-tc.h,
+ include/net-snmp/library/snmp.h,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpCallbackDomain.h,
+ include/net-snmp/library/snmpIPXDomain.h,
+ include/net-snmp/library/snmpTCPDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPDomain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ include/net-snmp/library/snmp_alarm.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h,
+ include/net-snmp/library/snmp_debug.h,
+ include/net-snmp/library/snmp_enum.h,
+ include/net-snmp/library/snmp_impl.h,
+ include/net-snmp/library/snmp_locking.h,
+ include/net-snmp/library/snmp_logging.h,
+ include/net-snmp/library/snmp_parse_args.h,
+ include/net-snmp/library/snmp_secmod.h,
+ include/net-snmp/library/snmp_transport.h,
+ include/net-snmp/library/snmpksm.h,
+ include/net-snmp/library/snmpusm.h,
+ include/net-snmp/library/snmpv3.h,
+ include/net-snmp/library/system.h,
+ include/net-snmp/library/tools.h,
+ include/net-snmp/library/transform_oids.h,
+ include/net-snmp/library/ucd_compat.h,
+ include/net-snmp/library/vacm.h,
+ include/net-snmp/library/version.h, include/ucd-snmp/asn1.h
+, include/ucd-snmp/callback.h,
+ include/ucd-snmp/default_store.h, include/ucd-snmp/int64.h
+, include/ucd-snmp/keytools.h, include/ucd-snmp/mib.h
+, include/ucd-snmp/mibincl.h, include/ucd-snmp/parse.h
+, include/ucd-snmp/read_config.h,
+ include/ucd-snmp/scapi.h, include/ucd-snmp/snmp-tc.h,
+ include/ucd-snmp/snmp.h, include/ucd-snmp/snmp_alarm.h,
+ include/ucd-snmp/snmp_api.h, include/ucd-snmp/snmp_client.h
+, include/ucd-snmp/snmp_debug.h,
+ include/ucd-snmp/snmp_impl.h, include/ucd-snmp/snmp_logging.h
+, include/ucd-snmp/snmp_parse_args.h,
+ include/ucd-snmp/snmp_vars.h, include/ucd-snmp/snmpusm.h
+, include/ucd-snmp/snmpv3.h, include/ucd-snmp/system.h
+, include/ucd-snmp/tools.h,
+ include/ucd-snmp/transform_oids.h, include/ucd-snmp/version.h
+, snmplib/asn1.c, snmplib/callback.c,
+ snmplib/data_list.c, snmplib/default_store.c,
+ snmplib/int64.c, snmplib/keytools.c,
+ snmplib/lcd_time.c, snmplib/md5.c, snmplib/mib.c
+, snmplib/mt_support.c, snmplib/oid_array.c,
+ snmplib/oid_stash.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp-tc.c, snmplib/snmp.c,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpCallbackDomain.c
+, snmplib/snmpIPXDomain.c, snmplib/snmpTCPDomain.c
+, snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_debug.c,
+ snmplib/snmp_enum.c, snmplib/snmp_logging.c,
+ snmplib/snmp_parse_args.c, snmplib/snmp_secmod.c,
+ snmplib/snmp_transport.c, snmplib/snmp_version.c,
+ snmplib/snmpksm.c, snmplib/snmpusm.c, snmplib/snmpv3.c
+, snmplib/system.c, snmplib/tools.c,
+ snmplib/vacm.c:
+
+ Separate out top-level "public API" library header files from the "internal"
+ library header files. These are still available for use by application
+ developers, but this split makes it clearer what may change in the future
+ and what can be relied upon to be stable.
+
+2002-02-14 04:41 dts12
+
+ * include/net-snmp/definitions.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/output_api.h, include/net-snmp/snmp_impl.h
+, include/net-snmp/snmpv3_api.h, snmplib/asn1.c,
+ snmplib/callback.c, snmplib/default_store.c,
+ snmplib/int64.c, snmplib/keytools.c,
+ snmplib/lcd_time.c, snmplib/md5.c, snmplib/mib.c
+, snmplib/oid_stash.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp-tc.c, snmplib/snmp.c,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpCallbackDomain.c
+, snmplib/snmpIPXDomain.c, snmplib/snmpTCPDomain.c
+, snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_debug.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c,
+ snmplib/snmp_secmod.c, snmplib/snmp_transport.c,
+ snmplib/snmpksm.c, snmplib/snmpusm.c, snmplib/snmpv3.c
+, snmplib/system.c, snmplib/tools.c,
+ snmplib/vacm.c:
+
+ First moves towards using the "public" API header files in the library
+ code as well (concentrating on output/config/utility header files).
+
+2002-02-14 03:17 dts12
+
+ * configure, configure.in:
+
+ Close a dangling "if" block. (oops!)
+
+2002-02-14 01:47 dts12
+
+ * apps/snmpnetstat/: if.c (V4-2-patches.4), if.c:
+
+ Check for running off the end of I/F table (patch from RedHat)
+
+2002-02-14 01:43 dts12
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ Latest RedHat rpm-related patch
+
+2002-02-14 01:39 dts12
+
+ * configure, configure.in:
+
+ Adopt RedHat's configure testing for RPM libraries
+
+2002-02-13 08:39 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Make John trust his code
+
+2002-02-13 08:34 jbpn
+
+ * perl/SNMP/SNMP.xs:
+
+ - transport fixes (untested, still #if 0)
+
+2002-02-13 08:03 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ mark some John-to-do-sections
+
+2002-02-13 07:57 dts12
+
+ * include/net-snmp/default_store.h, man/snmpcmd.1.def,
+ snmplib/mib.c:
+
+ Switch to using -OS style output by default, and drop the requirement
+ for full OIDs to start with '.', plus command-line options to restore
+ the original UCD-style behaviour.
+
+2002-02-13 07:36 dts12
+
+ * apps/snmptable.c:
+
+ Apply John's fix for bugs #489336 and #508146 (duplicate columns and
+ columns in wrong order) to the main branch as well.
+
+2002-02-12 16:40 hardaker
+
+ * snmplib/snmp_client.c:
+
+ const changes.
+
+2002-02-12 16:39 hardaker
+
+ * perl/: .cvsignore, ASN/.cvsignore, agent/.cvsignore
+, default_store/.cvsignore:
+
+ add .cvsignore file.
+
+2002-02-12 16:38 hardaker
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ add agent/agent_handler.h
+
+2002-02-12 16:38 hardaker
+
+ * include/net-snmp/snmp_client.h:
+
+ const additions.
+
+2002-02-12 16:37 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ Add string.h
+
+2002-02-12 16:37 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ add header.
+
+2002-02-12 16:37 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ fixes to reenable disman event stuff for 5.0 code. Not done the
+ "right" way, but it works.
+
+2002-02-12 16:36 hardaker
+
+ * agent/helpers/old_api.c:
+
+ - -Wall fixes
+
+2002-02-12 16:36 hardaker
+
+ * agent/helpers/instance.c:
+
+ - add stdlib.h
+ - remove unused variable.
+
+2002-02-12 16:35 hardaker
+
+ * agent/snmp_agent.c:
+
+ remove no longer used "dump_var" routine.
+
+2002-02-12 16:35 hardaker
+
+ * agent/agent_handler.c,
+ include/net-snmp/agent/agent_handler.h:
+
+ const specific changes.
+
+2002-02-12 16:34 hardaker
+
+ * NEWS:
+
+ added new perl specific features.
+
+2002-02-12 16:34 hardaker
+
+ * Makefile.in:
+
+ .PHNOY mods
+
+2002-02-12 07:22 dts12
+
+ * agent/Makefile.depend, apps/Makefile.depend,
+ apps/snmptranslate.c, apps/snmptrapd_handlers.c,
+ apps/snmpnetstat/Makefile.depend,
+ include/net-snmp/net-snmp-includes.h,
+ include/net-snmp/logging_api.h, include/net-snmp/output_api.h
+:
+
+ Rename the logging & related output API header file, to better
+ reflect the scope of this API. (As suggested by Wes & John)
+
+2002-02-12 07:21 jbpn
+
+ * configure.in:
+
+ - amend fix to bug #516389 (ucd-snmp 4.2.3 libwrap support broken) to
+ actually add -lnsl to link parameters!
+
+2002-02-12 05:39 jbpn
+
+ * configure.in:
+
+ - fix bug #516389 (ucd-snmp 4.2.3 libwrap support broken) -- USE_LIBWRAP
+ was not being #defined in the case where -lnsl is needed in addition
+ to -lwrap.
+
+2002-02-11 15:56 hardaker
+
+ * agent/Makefile.in:
+
+ lib dependency fix for snmpd target
+
+2002-02-11 08:29 dts12
+
+ * include/net-snmp/cmu_compat.h, include/net-snmp/mib.h
+, include/net-snmp/mib_api.h,
+ include/net-snmp/net-snmp-includes.h,
+ include/net-snmp/parse.h, include/net-snmp/session_api.h
+, include/net-snmp/snmp.h, include/net-snmp/snmp_api.h
+, include/net-snmp/snmp_impl.h,
+ include/net-snmp/ucd_compat.h, snmplib/cmu_compat.c,
+ snmplib/Makefile.in, snmplib/mib.c, snmplib/parse.c
+, snmplib/snmp_api.c, snmplib/ucd_compat.c:
+
+ Extract CMU_COMPATABILITY code, and explicitly deprecated UCD code into separate files.
+
+2002-02-11 08:23 dts12
+
+ * snmplib/: snmp_parse_args.c (V4-2-patches.2), snmp_parse_args.c
+:
+
+ Use the 'ds_set_xxx' library routines, rather than the old 'snmp_set_xxx' calls
+
+2002-02-11 04:45 jbpn
+
+ * man/: snmp.conf.5.def, snmp_config.5.def,
+ snmptrapd.conf.5.def:
+
+ minor spelling tweaks
+
+2002-02-11 04:27 jbpn
+
+ * man/: Makefile.in, default_store.3.top, mib_api.3
+, mib_api.3.def, snmp_agent_api.3,
+ snmp_agent_api.3.def, snmp_alarm.3, snmp_alarm.3.def
+, snmp_api.3, snmp_api.3.def, snmp_sess_api.3
+, snmp_sess_api.3.def, snmp_trap_api.3,
+ snmp_trap_api.3.def, variables.5, variables.5.def
+:
+
+ - generate the rest of the manual pages (to get version in footer)
+
+2002-02-08 15:56 hardaker
+
+ * win32/: config.h, mib_module_config.h,
+ mib_module_inits.h, libsnmp/libsnmp.dsp,
+ libsnmp_dll/libsnmp.def, libsnmp_dll/libsnmp_dll.dsp,
+ libucdmibs/libucdmibs.dsp, snmpd/snmpd.dsp:
+
+ win32 specific portions of patch 503256
+
+2002-02-08 15:53 hardaker
+
+ * win32/libhelpers/libhelpers.dsp:
+
+ patch#503256: helpers library definition for win32
+
+2002-02-08 09:08 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - minor format tweakage
+
+2002-02-08 08:22 dts12
+
+ * man/: mib_api.3, snmp_agent_api.3, snmp_alarm.3
+, snmp_api.3, snmp_sess_api.3, snmp_trap_api.3
+:
+
+ Reference the new header-files in section 3 man page synopses.
+
+2002-02-08 07:50 jbpn
+
+ * man/: mib_api.3, read_config.3.def, snmp_agent_api.3
+, snmp_config.5.def, snmp_trap_api.3,
+ snmpcmd.1.def, snmpconf.1.def, snmpd.conf.5.def,
+ variables.5:
+
+ - more minor tweaks (ucd-snmp -> Net-SNMP etc.)
+
+2002-02-08 07:48 hardaker
+
+ * agent/Makefile.depend:
+
+ remove local modules from dependency list
+
+2002-02-08 07:45 dts12
+
+ * agent/: agent_handler.c, agent_index.c,
+ agent_read_config.c, agent_registry.c, agent_trap.c
+, auto_nlist.c, kernel.c, mib_modules.c,
+ snmp_agent.c, snmp_vars.c, snmpd.c,
+ helpers/bulk_to_next.c, helpers/debug_handler.c,
+ helpers/instance.c, helpers/multiplexer.c,
+ helpers/null.c, helpers/old_api.c, helpers/read_only.c
+, helpers/serialize.c, helpers/table.c,
+ helpers/table_array.c, helpers/table_data.c,
+ helpers/table_dataset.c, helpers/table_iterator.c,
+ mibgroup/header_complex.c, mibgroup/kernel_sunos5.c,
+ mibgroup/testdelayed.c, mibgroup/testhandler.c,
+ mibgroup/util_funcs.c, mibgroup/Rmon/agutil.c,
+ mibgroup/Rmon/alarm.c, mibgroup/Rmon/event.c,
+ mibgroup/Rmon/history.c, mibgroup/Rmon/rows.c,
+ mibgroup/Rmon/statistics.c,
+ mibgroup/agent/nsTransactionTable.c,
+ mibgroup/agentx/agentx_config.c, mibgroup/agentx/client.c
+, mibgroup/agentx/master.c,
+ mibgroup/agentx/master_admin.c,
+ mibgroup/agentx/master_request.c, mibgroup/agentx/protocol.c
+, mibgroup/agentx/subagent.c,
+ mibgroup/disman/mteObjectsTable.c,
+ mibgroup/disman/mteTriggerBooleanTable.c,
+ mibgroup/disman/mteTriggerDeltaTable.c,
+ mibgroup/disman/mteTriggerExistenceTable.c,
+ mibgroup/disman/mteTriggerTable.c,
+ mibgroup/disman/mteTriggerThresholdTable.c,
+ mibgroup/examples/example.c,
+ mibgroup/examples/ucdDemoPublic.c,
+ mibgroup/host/hr_filesys.c, mibgroup/host/hr_storage.c
+, mibgroup/host/hr_swinst.c, mibgroup/host/hr_swrun.c
+, mibgroup/host/hr_system.c, mibgroup/mibII/at.c
+, mibgroup/mibII/icmp.c, mibgroup/mibII/interfaces.c
+, mibgroup/mibII/ip.c, mibgroup/mibII/ipAddr.c,
+ mibgroup/mibII/ipv6.c, mibgroup/mibII/kernel_linux.c,
+ mibgroup/mibII/mta_sendmail.c, mibgroup/mibII/route_write.c
+, mibgroup/mibII/snmp_mib.c,
+ mibgroup/mibII/sysORTable.c, mibgroup/mibII/system_mib.c
+, mibgroup/mibII/tcp.c, mibgroup/mibII/tcpTable.c
+, mibgroup/mibII/udp.c, mibgroup/mibII/udpTable.c
+, mibgroup/mibII/vacm_context.c,
+ mibgroup/mibII/vacm_vars.c, mibgroup/mibII/var_route.c
+, mibgroup/misc/dlmod.c, mibgroup/misc/ipfwacc.c
+, mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ mibgroup/notification/snmpNotifyFilterTable.c,
+ mibgroup/notification/snmpNotifyTable.c,
+ mibgroup/smux/smux.c, mibgroup/smux/snmp_bgp.c,
+ mibgroup/smux/snmp_ospf.c, mibgroup/smux/snmp_rip2.c,
+ mibgroup/snmpv3/snmpEngine.c, mibgroup/snmpv3/snmpMPDStats.c
+, mibgroup/snmpv3/usmStats.c,
+ mibgroup/snmpv3/usmUser.c,
+ mibgroup/target/snmpTargetAddrEntry.c,
+ mibgroup/target/snmpTargetParamsEntry.c,
+ mibgroup/target/target.c, mibgroup/target/target_counters.c
+, mibgroup/tunnel/tunnel.c, mibgroup/ucd-snmp/disk.c
+, mibgroup/ucd-snmp/diskio.c, mibgroup/ucd-snmp/dlmod.c
+, mibgroup/ucd-snmp/errormib.c,
+ mibgroup/ucd-snmp/extensible.c, mibgroup/ucd-snmp/file.c
+, mibgroup/ucd-snmp/hpux.c,
+ mibgroup/ucd-snmp/lmSensors.c, mibgroup/ucd-snmp/loadave.c
+, mibgroup/ucd-snmp/logmatch.c,
+ mibgroup/ucd-snmp/memory.c, mibgroup/ucd-snmp/memory_dynix.c
+, mibgroup/ucd-snmp/memory_freebsd2.c,
+ mibgroup/ucd-snmp/memory_netbsd1.c,
+ mibgroup/ucd-snmp/memory_solaris2.c,
+ mibgroup/ucd-snmp/pass.c, mibgroup/ucd-snmp/pass_persist.c
+, mibgroup/ucd-snmp/proc.c, mibgroup/ucd-snmp/proxy.c
+, mibgroup/ucd-snmp/registry.c,
+ mibgroup/ucd-snmp/versioninfo.c, mibgroup/ucd-snmp/vmstat.c
+, mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ mibgroup/ucd-snmp/vmstat_dynix.c,
+ mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ Use the new 'net-snmp-includes' single-include header files,
+ in place of the (uninstalled) 'mibincl.h'.
+ Wheeeee......
+
+2002-02-08 07:17 jbpn
+
+ * man/: snmp.conf.5.def, snmp_agent_api.3,
+ snmp_alarm.3, snmp_api.3, snmp_config.5.def,
+ snmp_sess_api.3, snmpd.1.def, snmpd.conf.5.def,
+ snmptrapd.conf.5.def:
+
+ - some editing to make style consistent, add some missing options,
+ change ucd-snmp to Net-SNMP and things like that.
+
+2002-02-08 07:14 jbpn
+
+ * man/Makefile.in:
+
+ - generate man pages at compile time
+
+2002-02-08 07:14 jbpn
+
+ * man/: snmpbulkget.1, snmpbulkwalk.1,
+ snmpbulkget.1.def, snmpbulkwalk.1.def, snmpcmd.1
+, snmpcmd.1.def, snmpconf.1, snmpconf.1.def
+, snmpget.1, snmpget.1.def, snmpgetnext.1,
+ snmpgetnext.1.def, snmpset.1, snmpset.1.def,
+ snmpstatus.1, snmpstatus.1.def, snmptable.1,
+ snmptable.1.def, snmptest.1, snmptest.1.def,
+ snmptranslate.1, snmptranslate.1.def, snmptrap.1
+, snmptrap.1.def, snmpusm.1, snmpusm.1.def,
+ snmpwalk.1, snmpwalk.1.def, snmptrapd.8,
+ snmptrapd.8.def:
+
+ - rename man pages which are now generated at compile time in order
+ to pick up the version (which gets put in the footer).
+
+ - also some editing to make style consistent, add some missing options,
+ change ucd-snmp to Net-SNMP and things like that.
+
+2002-02-08 06:48 dts12
+
+ * agent/mibgroup/mibJJ.h:
+
+ Remove the attempted 'mibII' re-write.
+ If we want to tidy up mibII, it makes more sense to use the new agent APIs.
+
+2002-02-08 06:45 dts12
+
+ * include/net-snmp/: net-snmp-includes.h,
+ agent/net-snmp-agent-includes.h:
+
+ Bring single-include header files closer in line with the existing "mibincl.h" file
+
+2002-02-08 06:09 dts12
+
+ * agent/mibgroup/mibII/: sysORTable.h (V4-2-patches.1),
+ sysORTable.h:
+
+ Ensure the null versions of the two REGISTER macros swallow their parameters.
+
+2002-02-08 04:36 dts12
+
+ * agent/snmp_agent.c:
+
+ Implement the missing outgoing error statistics counters
+ (patch #510194 from Latha Prabhu)
+
+2002-02-08 02:42 dts12
+
+ * agent/mibgroup/: host/hr_storage.c, ucd-snmp/memory.c
+ (V4-2-patches.[6,3]), host/hr_storage.c, ucd-snmp/memory.c
+:
+
+ Added support for memory and swap entries in hrStorageTable for Solaris
+ (from patch #505498 - thanks to Johannes Schmidt-Fischer)
+
+2002-02-08 02:07 dts12
+
+ * agent/mibgroup/mibII/ip.c:
+
+ Consolidate identical MIB object entries (WIN32/non-WIN32)
+
+2002-02-08 00:50 jbpn
+
+ * man/README:
+
+ - remove chronically dated unhelpful README
+
+2002-02-07 13:33 hardaker
+
+ * Makefile.in, Makefile.rules, configure,
+ configure.in, makefileindepend.pl,
+ agent/Makefile.depend, agent/Makefile.in,
+ agent/agent_trap.c, agent/mib_modules.c,
+ agent/snmp_agent.c, agent/snmpd.c,
+ agent/helpers/Makefile.depend, agent/helpers/Makefile.in
+, agent/mibgroup/Makefile.depend,
+ agent/mibgroup/Makefile.in, agent/mibgroup/mibincl.h,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/subagent.c, apps/Makefile.depend
+, apps/Makefile.in, apps/snmpnetstat/Makefile.depend
+, apps/snmpnetstat/Makefile.in, local/Makefile.in
+, man/Makefile.in, mibs/Makefile.in,
+ snmplib/Makefile.depend, snmplib/Makefile.in:
+
+ remake make's Makefile's to make better making
+
+2002-02-07 13:31 hardaker
+
+ * perl/SNMP/Makefile.PL:
+
+ check local pathes
+
+2002-02-07 12:54 dts12
+
+ * agent/snmp_agent.c:
+
+ Ensure agent returns the correct error codes for UNDO and COMMIT failures.
+
+2002-02-07 11:18 hardaker
+
+ * perl/SNMP/: Makefile.PL, SNMP.xs, t/startagent.pl
+:
+
+ attempt at porting Joe's SNMP module to net-snmp.
+ It compiles, but only some of the tests succeed.
+
+2002-02-07 10:09 jbpn
+
+ * man/: default_store.3.top, mib_api.3,
+ read_config.3.def, snmp.conf.5.def, snmp_agent_api.3
+, snmp_alarm.3, snmp_api.3, snmp_config.5.def
+, snmp_sess_api.3, snmp_trap_api.3, snmpbulkget.1
+, snmpbulkwalk.1, snmpconf.1, snmpd.conf.5.def
+, snmpdelta.1, snmpdf.1, snmpget.1,
+ snmpgetnext.1, snmpnetstat.1, snmpset.1,
+ snmpstatus.1, snmptable.1, snmptest.1,
+ snmptranslate.1, snmptrap.1, snmptrapd.conf.5.def
+, snmpusm.1, snmpwalk.1, variables.5:
+
+ - add Net-SNMP in header of all man pages
+
+2002-02-07 09:52 jbpn
+
+ * man/snmpcmd.1:
+
+ - update style to match snmpd and snmptrapd man pages
+
+2002-02-07 08:15 jbpn
+
+ * man/snmptrapd.8:
+
+ - fix speeling mistake
+
+2002-02-07 08:00 jbpn
+
+ * man/snmptrapd.8:
+
+ - bring up to date with snmptrapd
+
+2002-02-07 07:28 dts12
+
+ * README.hpux11, acconfig.h,
+ agent/mibgroup/ucd_snmp.h, agent/mibgroup/host/hr_network.c
+, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/tcpTable.c
+, agent/mibgroup/mibII/tcpTable.h,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/udpTable.c
+, agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/mibII/var_route.h,
+ agent/mibgroup/ucd-snmp/memory.c,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/system/hpux.h, mibs/UCD-SNMP-MIB.txt:
+
+ Support for HP-UX 11, courtesy of Johannes Schmidt-Fischer.
+
+2002-02-07 06:30 jbpn
+
+ * man/snmpd.1.def:
+
+ - alphabetise options
+
+ - bring man page in line with new positional arguments listening
+ address specification and add section describing that
+
+ - put Net-SNMP in header
+
+2002-02-06 10:06 jbpn
+
+ * include/net-snmp/scapi.h:
+
+ - fix bug noted by Niels
+
+2002-02-06 09:25 jbpn
+
+ * apps/: encode_keychange.c, snmpusm.c:
+
+ - minor tweaks due to change in definition of USM OIDs.
+
+2002-02-06 09:17 jbpn
+
+ * include/net-snmp/snmpusm.h, include/net-snmp/snmpv3.h
+, include/net-snmp/transform_oids.h,
+ snmplib/snmp_parse_args.c, snmplib/snmpusm.c,
+ snmplib/snmpv3.c:
+
+ - move USM OID definitions into snmpusm.c, make them const
+
+ - consequent increase in const-ness in some function prototypes
+
+2002-02-06 09:12 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ remove internal note about v3 api, which should be public
+
+2002-02-06 09:12 hardaker
+
+ * include/net-snmp/snmpusm_init.h:
+
+ removed unneeded file
+
+2002-02-06 09:06 jbpn
+
+ * include/net-snmp/keytools.h, include/net-snmp/scapi.h
+, snmplib/keytools.c, snmplib/scapi.c:
+
+ - add const-ness for transform type args
+
+2002-02-06 09:01 jbpn
+
+ * include/net-snmp/mib.h, include/net-snmp/snmp_debug.h
+, snmplib/mib.c, snmplib/snmp_debug.c:
+
+ - add some const-ness for OID args (mainly so that debugmsg_oid takes
+ const).
+
+2002-02-06 08:44 dts12
+
+ * agent/agent_read_config.c, agent/mibgroup/ucd_snmp.h
+, agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory_dynix.c,
+ agent/mibgroup/ucd-snmp/memory_dynix.h,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.c,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.h,
+ include/net-snmp/system/dynix.h,
+ agent/mibgroup/host/hr_swrun.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/var_route.c, snmplib/snmp_api.c
+:
+
+ Support for Dynix/PTX 4.4, courtesy of Patrick Hess.
+
+2002-02-06 07:41 jbpn
+
+ * include/net-snmp/snmp_api.h, snmplib/snmp_api.c:
+
+ - make first argument of snmp_dup_objid() const.
+
+ - better handle NULL values in snmp_dup_objid().
+
+2002-02-06 07:09 dts12
+
+ * FAQ, man/snmp_trap_api.3:
+
+ Clarify the applicability of 'snmp_trap_api(3)' routines to AgentX subagents.
+
+2002-02-06 05:58 dts12
+
+ * apps/: encode_keychange.c, notification_log.c,
+ snmpbulkget.c, snmpbulkwalk.c, snmpdelta.c,
+ snmpdf.c, snmpget.c, snmpgetnext.c, snmpset.c
+, snmpstatus.c, snmptable.c, snmptest.c,
+ snmptranslate.c, snmptrap.c, snmptrapd.c,
+ snmptrapd_handlers.c, snmptrapd_log.c, snmpusm.c
+, snmpvacm.c, snmpwalk.c, snmpnetstat/if.c
+, snmpnetstat/inet.c, snmpnetstat/inet6.c,
+ snmpnetstat/main.c, snmpnetstat/route.c:
+
+ Applications amended to use the new-style library header structure.
+ (In most cases, simply including the single "full API" header file)
+
+2002-02-06 05:55 dts12
+
+ * include/net-snmp/: asn1.h, config_api.h,
+ definitions.h, logging_api.h, mib_api.h,
+ net-snmp-includes.h, pdu_api.h, session_api.h,
+ snmpv3_api.h, types.h, utilities.h, varbind_api.h
+:
+
+ Framework for new library header file organisation, with eight main groups
+ of API routines. Currently these still refer to the UCD-style style header
+ files for the actual function declarations.
+
+2002-02-06 05:31 jbpn
+
+ * man/Makefile.in:
+
+ - replace use of $< with explicit filename, since non-GNU makes seem
+ to barf on it
+
+2002-02-06 03:31 dts12
+
+ * Makefile.in:
+
+ Fix incorrect directory specification in 'make clean'
+
+2002-02-06 03:18 dts12
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Protect the project config file against multiple inclusion.
+
+2002-02-06 03:07 jbpn
+
+ * agent/auto_nlist.c:
+
+ - remove #include "../snmplib/system.h" which no longer exists and
+ is apparently unnecessary anyway.
+
+2002-02-06 02:51 jbpn
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - remove #include "../../snmplib/system.h" which no longer exists
+ and is apparently unnecessary anyway.
+
+2002-02-05 11:44 hardaker
+
+ * COPYING (V4-2-patches.7), COPYING:
+
+ copyright year update for NAI and Cambridge
+
+2002-02-05 09:54 hardaker
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ perl fixes
+
+2002-02-05 09:54 hardaker
+
+ * agent/agent_registry.c, agent/mibgroup/Rmon/alarm.c,
+ agent/mibgroup/smux/smux.c, include/net-snmp/snmp_api.h
+, snmplib/snmp_api.c:
+
+ Patch from Harrie Hazewinkel to move the oidtree_compare function to
+ the main library.
+
+2002-02-05 09:52 hardaker
+
+ * configure, configure.in, agent/Makefile.in
+:
+
+ perl build fixes.
+
+2002-02-05 07:19 hardaker
+
+ * agent/Makefile.in:
+
+ opps. Removed forced perl embedding
+
+2002-02-04 16:22 hardaker
+
+ * include/net-snmp/net-snmp-config.h:
+
+ this file shouldn't be checked in
+
+2002-02-04 16:22 hardaker
+
+ * Makefile.in, acconfig.h, configure,
+ configure.in, agent/Makefile.in, agent/snmp_perl.c
+, agent/snmp_perl.pl, agent/snmp_vars.c:
+
+ - Support for embedding perl subroutines into the agent to be called
+ as handlers.
+ - New configure options:
+ --with-perl-modules attempts to build contained modules (poorly currently).
+ --enable-embedded-perl actually specifies to do perl embedding
+ within the agent.
+
+2002-02-04 16:16 hardaker
+
+ * perl/: ASN/ASN.pm, ASN/ASN.xs, ASN/Changes,
+ ASN/MANIFEST, ASN/Makefile.PL, ASN/test.pl,
+ agent/Changes, agent/MANIFEST, agent/Makefile.PL,
+ agent/agent.pm, agent/agent.xs, agent/test.pl,
+ agent/typemap, default_store/Changes,
+ default_store/MANIFEST, default_store/Makefile.PL,
+ default_store/default_store.pm,
+ default_store/default_store.xs, default_store/test.pl,
+ default_store/typemap:
+
+ Beginnings of new perl modules needed to implement an SNMP agent (or
+ agentx subagent) inside perl.
+ - not complete yet.
+ - may change.
+ - but works.
+
+2002-02-04 04:39 jbpn
+
+ * snmplib/mib.c:
+
+ - correct processing for timeticks when DS_LIB_NUMERIC_TIMETICKS is
+ set (corrects bug #511793, reported by Anonymous).
+
+2002-02-01 01:50 dts12
+
+ * FAQ:
+
+ Clarify the procedure for compiling with 'cc' rather than 'gcc'
+
+2002-01-31 14:58 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ s/snmplib\///;
+
+2002-01-31 06:55 hardaker
+
+ * Makefile.in, agent/helpers/Makefile.in:
+
+ fix make clean as reported by Bradley Bozarth.
+
+2002-01-30 08:06 dts12
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c:
+
+ Bring MIB variable versionTag into line with the new <net-snmp/version.h> usage
+
+2002-01-29 17:53 hardaker
+
+ * version.h, agent/snmpd.c,
+ agent/mibgroup/versiontag, apps/snmptranslate.c,
+ apps/snmptrapd.c, apps/snmpnetstat/main.c,
+ include/net-snmp/version.h, include/ucd-snmp/version.h,
+ snmplib/Makefile.in, snmplib/snmp_parse_args.c,
+ snmplib/snmp_version.c:
+
+ Moved versioning information from version.h to:
+ - snmplib/snmp_version.c:
+ - define netsnmp_get_version();
+ - create a const char *NetSnmpVersionInfo
+ - include/net-snmp/version.h:
+ - extern the above char *
+ - prototype the function
+ - include/ucd-snmp/version.h:
+ - create a static variable (the old way) and set it to NetSnmpVersionInfo
+
+2002-01-29 16:09 hardaker
+
+ * testing/: eval_tools.sh, tests/T049snmpv3inform,
+ tests/T050snmpv3trap, tests/T051snmpv2ctrap,
+ tests/T052snmpv2cinform, tests/T053agentv1trap,
+ tests/T054agentv2ctrap, tests/T055agentv1mintrap,
+ tests/T056agentv2cmintrap, tests/T058agentauthtrap,
+ tests/T113agentxtrap:
+
+ trap test fixes so the majority of the tests now work.
+
+2002-01-29 16:08 hardaker
+
+ * Makefile.in:
+
+ don't generate ucd-snmp-config.h any longer.
+
+2002-01-29 15:23 hardaker
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/machine/generic.h,
+ include/net-snmp/system/aix.h, include/net-snmp/system/bsd.h
+, include/net-snmp/system/bsdi.h,
+ include/net-snmp/system/bsdi3.h,
+ include/net-snmp/system/bsdi4.h,
+ include/net-snmp/system/cygwin.h,
+ include/net-snmp/system/darwin.h,
+ include/net-snmp/system/freebsd.h,
+ include/net-snmp/system/freebsd2.h,
+ include/net-snmp/system/freebsd3.h,
+ include/net-snmp/system/freebsd4.h,
+ include/net-snmp/system/generic.h,
+ include/net-snmp/system/hpux.h,
+ include/net-snmp/system/irix.h,
+ include/net-snmp/system/linux.h,
+ include/net-snmp/system/mips.h,
+ include/net-snmp/system/netbsd.h,
+ include/net-snmp/system/openbsd.h,
+ include/net-snmp/system/solaris.h,
+ include/net-snmp/system/solaris2.6.h,
+ include/net-snmp/system/solaris2.7.h,
+ include/net-snmp/system/solaris2.8.h,
+ include/net-snmp/system/sunos.h,
+ include/net-snmp/system/svr5.h,
+ include/net-snmp/system/sysv.h,
+ include/net-snmp/system/ultrix4.h:
+
+ moved s/*.h files to include/net-snmp/system/*.h
+ moved m/generic.h files to include/net-snmp/machine/generic.h
+
+2002-01-29 09:24 hardaker
+
+ * apps/snmptrapd.c:
+
+ fix -c argument parsing.
+
+2002-01-29 09:10 hardaker
+
+ * testing/eval_tools.sh:
+
+ reference include/net-snmp/net-snmp-config.h instead of just config.h
+
+2002-01-29 09:05 hardaker
+
+ * snmplib/snmpusm.c:
+
+ attempt to fix the unknown engineid/unknown user problems once and for all.
+
+2002-01-28 21:11 hardaker
+
+ * configure, configure.in:
+
+ whoops. Missed some .h file checks in configure. Thanks Robert.
+
+2002-01-28 21:03 hardaker
+
+ * local/convertcode:
+
+ minor fix.
+
+2002-01-28 21:02 hardaker
+
+ * local/convertcode:
+
+ added code convert script for ucd-snmp -> net-snmp header conversion
+
+2002-01-28 20:59 hardaker
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/tunnel/tunnel.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ apps/encode_keychange.c, apps/notification_log.c,
+ apps/snmpbulkget.c, apps/snmpbulkwalk.c,
+ apps/snmpdelta.c, apps/snmpdf.c, apps/snmpget.c
+, apps/snmpgetnext.c, apps/snmpset.c,
+ apps/snmpstatus.c, apps/snmptable.c, apps/snmptest.c
+, apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmptrapd_handlers.c,
+ apps/snmptrapd_log.c, apps/snmpusm.c, apps/snmpvacm.c
+, apps/snmpwalk.c, apps/snmpnetstat/Makefile.in
+, apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c
+, apps/snmpnetstat/inet6.c, apps/snmpnetstat/main.c
+, apps/snmpnetstat/route.c, include/net-snmp/asn1.h
+, include/net-snmp/callback.h,
+ include/net-snmp/data_list.h,
+ include/net-snmp/default_store.h, include/net-snmp/getopt.h
+, include/net-snmp/int64.h, include/net-snmp/keytools.h
+, include/net-snmp/lcd_time.h,
+ include/net-snmp/libsnmp.h, include/net-snmp/md5.h,
+ include/net-snmp/mib.h, include/net-snmp/mt_support.h,
+ include/net-snmp/net-snmp-config.h,
+ include/net-snmp/oid_array.h, include/net-snmp/oid_stash.h
+, include/net-snmp/parse.h,
+ include/net-snmp/read_config.h, include/net-snmp/scapi.h
+, include/net-snmp/snmp-tc.h, include/net-snmp/snmp.h
+, include/net-snmp/snmpAAL5PVCDomain.h,
+ include/net-snmp/snmpCallbackDomain.h,
+ include/net-snmp/snmpIPXDomain.h,
+ include/net-snmp/snmpTCPDomain.h,
+ include/net-snmp/snmpTCPIPv6Domain.h,
+ include/net-snmp/snmpUDPDomain.h,
+ include/net-snmp/snmpUDPIPv6Domain.h,
+ include/net-snmp/snmpUnixDomain.h,
+ include/net-snmp/snmp_alarm.h, include/net-snmp/snmp_api.h
+, include/net-snmp/snmp_client.h,
+ include/net-snmp/snmp_debug.h, include/net-snmp/snmp_enum.h
+, include/net-snmp/snmp_impl.h,
+ include/net-snmp/snmp_locking.h,
+ include/net-snmp/snmp_logging.h,
+ include/net-snmp/snmp_parse_args.h,
+ include/net-snmp/snmp_secmod.h,
+ include/net-snmp/snmp_transport.h, include/net-snmp/snmpksm.h
+, include/net-snmp/snmpusm.h,
+ include/net-snmp/snmpusm_init.h, include/net-snmp/snmpv3.h
+, include/net-snmp/system.h, include/net-snmp/tools.h
+, include/net-snmp/transform_oids.h,
+ include/net-snmp/vacm.h, include/net-snmp/agent/snmp_agent.h
+, man/Makefile.in, snmplib/Makefile.in,
+ snmplib/asn1.c, snmplib/asn1.h, snmplib/callback.c
+, snmplib/callback.h, snmplib/data_list.c,
+ snmplib/data_list.h, snmplib/default_store.c,
+ snmplib/default_store.h, snmplib/getopt.h,
+ snmplib/int64.c, snmplib/int64.h, snmplib/keytools.c
+, snmplib/keytools.h, snmplib/lcd_time.c,
+ snmplib/lcd_time.h, snmplib/libsnmp.h, snmplib/md5.c
+, snmplib/md5.h, snmplib/mib.c, snmplib/mib.h
+, snmplib/mt_support.c, snmplib/mt_support.h,
+ snmplib/oid_array.c, snmplib/oid_array.h,
+ snmplib/oid_stash.c, snmplib/oid_stash.h,
+ snmplib/parse.c, snmplib/parse.h,
+ snmplib/read_config.c, snmplib/read_config.h,
+ snmplib/scapi.c, snmplib/scapi.h, snmplib/snmp-tc.c
+, snmplib/snmp-tc.h, snmplib/snmp.c,
+ snmplib/snmp.h, snmplib/snmpAAL5PVCDomain.c,
+ snmplib/snmpAAL5PVCDomain.h, snmplib/snmpCallbackDomain.c
+, snmplib/snmpCallbackDomain.h, snmplib/snmpIPXDomain.c
+, snmplib/snmpIPXDomain.h, snmplib/snmpTCPDomain.c
+, snmplib/snmpTCPDomain.h, snmplib/snmpTCPIPv6Domain.c
+, snmplib/snmpTCPIPv6Domain.h, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPDomain.h, snmplib/snmpUDPIPv6Domain.c
+, snmplib/snmpUDPIPv6Domain.h, snmplib/snmpUnixDomain.c
+, snmplib/snmpUnixDomain.h, snmplib/snmp_alarm.c
+, snmplib/snmp_alarm.h, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_client.h,
+ snmplib/snmp_debug.c, snmplib/snmp_debug.h,
+ snmplib/snmp_enum.c, snmplib/snmp_enum.h,
+ snmplib/snmp_impl.h, snmplib/snmp_logging.c,
+ snmplib/snmp_logging.h, snmplib/snmp_parse_args.c,
+ snmplib/snmp_parse_args.h, snmplib/snmp_secmod.c,
+ snmplib/snmp_secmod.h, snmplib/snmp_transport.c,
+ snmplib/snmp_transport.h, snmplib/snmpksm.c,
+ snmplib/snmpksm.h, snmplib/snmpusm.c,
+ snmplib/snmpusm.h, snmplib/snmpv3.c, snmplib/snmpv3.h
+, snmplib/system.c, snmplib/system.h,
+ snmplib/tools.c, snmplib/tools.h,
+ snmplib/transform_oids.h, snmplib/vacm.c,
+ snmplib/vacm.h, testing/RUNTESTS,
+ testing/eval_tools.sh, include/ucd-snmp/asn1.h,
+ include/ucd-snmp/callback.h, include/ucd-snmp/default_store.h
+, include/ucd-snmp/int64.h, include/ucd-snmp/keytools.h
+, include/ucd-snmp/mib.h, include/ucd-snmp/mibincl.h
+, include/ucd-snmp/parse.h,
+ include/ucd-snmp/read_config.h, include/ucd-snmp/scapi.h
+, include/ucd-snmp/snmp-tc.h, include/ucd-snmp/snmp.h
+, include/ucd-snmp/snmp_alarm.h,
+ include/ucd-snmp/snmp_api.h, include/ucd-snmp/snmp_client.h
+, include/ucd-snmp/snmp_debug.h,
+ include/ucd-snmp/snmp_impl.h, include/ucd-snmp/snmp_logging.h
+, include/ucd-snmp/snmp_parse_args.h,
+ include/ucd-snmp/snmp_vars.h, include/ucd-snmp/snmpusm.h
+, include/ucd-snmp/snmpv3.h, include/ucd-snmp/system.h
+, include/ucd-snmp/tools.h,
+ include/ucd-snmp/transform_oids.h,
+ include/ucd-snmp/util_funcs.h:
+
+ Major file moving and editing of include directives.
+ - essentially adds up to:
+ - mv snmplib/*.h include/net-snmp/
+ - local/convertcode `find . -name \*.c \*.h`
+
+2002-01-28 20:54 hardaker
+
+ * agent/: agent_handler.c, agent_index.c,
+ agent_read_config.c, agent_registry.c, agent_trap.c
+, auto_nlist.c, kernel.c, mib_modules.c,
+ snmp_agent.c, snmp_vars.c, snmpd.c,
+ helpers/bulk_to_next.c, helpers/debug_handler.c,
+ helpers/instance.c, helpers/multiplexer.c,
+ helpers/null.c, helpers/old_api.c, helpers/read_only.c
+, helpers/serialize.c, helpers/table.c,
+ helpers/table_array.c, helpers/table_dataset.c,
+ helpers/table_iterator.c, mibgroup/host_res.h,
+ mibgroup/kernel_sunos5.c, mibgroup/mibincl.h,
+ mibgroup/testdelayed.c, mibgroup/testhandler.c,
+ mibgroup/util_funcs.c, mibgroup/Rmon/alarm.c,
+ mibgroup/Rmon/event.c, mibgroup/Rmon/history.c,
+ mibgroup/Rmon/rows.c, mibgroup/agentx/agentx_config.c,
+ mibgroup/agentx/client.c, mibgroup/agentx/master.c,
+ mibgroup/agentx/master_admin.c,
+ mibgroup/agentx/master_request.c, mibgroup/agentx/protocol.c
+, mibgroup/agentx/subagent.c,
+ mibgroup/disman/mteObjectsTable.c,
+ mibgroup/disman/mteTriggerBooleanTable.c,
+ mibgroup/disman/mteTriggerDeltaTable.c,
+ mibgroup/disman/mteTriggerExistenceTable.c,
+ mibgroup/disman/mteTriggerTable.c,
+ mibgroup/disman/mteTriggerThresholdTable.c,
+ mibgroup/examples/ucdDemoPublic.c, mibgroup/host/hr_disk.c
+, mibgroup/host/hr_filesys.c,
+ mibgroup/host/hr_storage.c, mibgroup/host/hr_swinst.c
+, mibgroup/host/hr_swrun.c, mibgroup/host/hr_system.c
+, mibgroup/mibII/at.c, mibgroup/mibII/icmp.c,
+ mibgroup/mibII/interfaces.c, mibgroup/mibII/ip.c,
+ mibgroup/mibII/ipAddr.c, mibgroup/mibII/ipv6.c,
+ mibgroup/mibII/kernel_linux.c, mibgroup/mibII/route_write.c
+, mibgroup/mibII/snmp_mib.c,
+ mibgroup/mibII/sysORTable.c, mibgroup/mibII/system_mib.c
+, mibgroup/mibII/tcp.c, mibgroup/mibII/tcpTable.c
+, mibgroup/mibII/udp.c, mibgroup/mibII/udpTable.c
+, mibgroup/mibII/vacm_context.c,
+ mibgroup/mibII/vacm_vars.c, mibgroup/mibII/vacm_vars.h
+, mibgroup/mibII/var_route.c, mibgroup/misc/dlmod.c
+, mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ mibgroup/notification/snmpNotifyFilterTable.c,
+ mibgroup/notification/snmpNotifyTable.c,
+ mibgroup/smux/smux.c, mibgroup/smux/snmp_bgp.c,
+ mibgroup/smux/snmp_ospf.c, mibgroup/smux/snmp_rip2.c,
+ mibgroup/snmpv3/snmpEngine.c, mibgroup/snmpv3/usmUser.c
+, mibgroup/snmpv3/usmUser.h:
+
+ Major file moving and editing of include directives.
+ - essentially adds up to:
+ - mv snmplib/*.h include/net-snmp/
+ - local/convertcode `find . -name \*.c \*.h`
+
+2002-01-28 19:42 hardaker
+
+ * include/ucd-snmp/ucd-snmp-config.h:
+
+ remove UCD_COMPAT flag and DEFINE IT instead
+
+2002-01-28 19:41 hardaker
+
+ * include/ucd-snmp/ucd-snmp-config.h:
+
+ remove UCD_COMPAT flag and define it instead
+
+2002-01-25 11:29 hardaker
+
+ * snmplib/mib.c:
+
+ - parse_one_oid_index:
+ - use an unsigned int for length's pulled from the oid.
+ - Make sure they're always < 128
+
+2002-01-25 09:12 jbpn
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ - closer adherence to state machines described in RFC 2574
+
+2002-01-25 09:10 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - cause usmDecryptionError reports to be sent in a couple of extra
+ cases: bad salt (length != 8) and length of encrypted data not a
+ multiple of 8 octets (per RFC 2574).
+
+2002-01-25 09:04 jbpn
+
+ * agent/snmp_agent.c:
+
+ - for unknown message types, increment snmpInASNParseErrs and fail
+ at the post-parse stage.
+
+ - for notification types, increment snmpUnknownPDUHandlers and bail
+ out early.
+
+2002-01-25 09:01 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - for unhandled messages (e.g. RESPONSE messages sent to agents),
+ increment the snmpUnknownPDUHandlers counter.
+
+ - try to free securityStateRefs when post-parse fails.
+
+2002-01-25 06:26 jbpn
+
+ * agent/mibgroup/mibII/: vacm_vars.c (V4-2-patches.6), vacm_vars.c
+:
+
+ - fix minor problem with storageType (always okay to set to current
+ value).
+
+ - don't reset some variables to old value unless we actually set
+ them in the first place!
+
+2002-01-25 05:00 jbpn
+
+ * agent/helpers/table.c:
+
+ - don't print out debugging info in a further case where it has been
+ free()d.
+
+ - set the exception noSuchInstance rather than error noSuchName when
+ we have the incorrect number of indices.
+
+2002-01-25 04:54 dts12
+
+ * snmplib/README.newlib:
+
+ file README.newlib was initially added on branch NEW-LIBRARY-API.
+
+2002-01-25 04:49 jbpn
+
+ * agent/helpers/table.c:
+
+ - move debugging output to before where (potentially) the data it is
+ trying to print gets free()d.
+
+2002-01-25 04:40 jbpn
+
+ * agent/snmp_agent.c:
+
+ - keep asp->vbcount correct in create_subtree_cache() if we dump
+ varbinds in the GETNEXT case because numvarbinds > non-repeaters.
+ Failing to do this will cause problems later when you iterate over
+ 0 .. asp->vbcount - 1 in reassign_requests().
+
+2002-01-24 15:11 rstory
+
+ * include/net-snmp/agent/table.h:
+
+ update macros to put parens around parameters when used, in case a parameter is an expression, which might muck about with operator precedence rules and cause unexpected and undesirable behavior.
+
+2002-01-24 11:07 rstory
+
+ * local/mib2c.array-user.conf:
+
+ try to find & handle external indexes; use new style net-snmp includes; add
+ row_copy; use context types & casts in parameters instead of generic types
+ recast inside method
+
+2002-01-24 06:03 jbpn
+
+ * snmplib/: read_config.c (V4-2-patches.3), read_config.c:
+
+ - avoid format string nasties in read_config_store() when writing to
+ files (exposed e.g. by the persistent sysName.0 stuff -- try
+ snmpset host sysName.0 s "%08x" -- oops)
+
+2002-01-24 04:34 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - don't automatically accept a msgUserName of "" when processing
+ incoming messages.
+
+2002-01-24 04:30 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - bigger buffer for msgAuthoritativeEngineID field since it is not
+ limited to 32 bytes like SnmpEngineTC. Really this needs to be
+ allocated by the security module but for now we'll just make it
+ twice as big.
+
+2002-01-24 03:19 dts12
+
+ * agent/mibgroup/host/hr_swrun.c, snmplib/snmp-tc.c:
+
+ AIX support for the Host Resources module.
+ (Thanks to Andy Hood)
+
+2002-01-23 08:28 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - set viewType to the DEFVAL included(1) for new rows
+
+2002-01-23 07:40 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - secModel of 0 is a parse error in HeaderData
+
+2002-01-23 07:23 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - be careful to free securityStateRef in a couple of error cases in
+ snmpv3_parse -- fixes memory leaks when malformed PDUs are
+ received.
+
+2002-01-22 19:49 rstory
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ chg api for snmp_oid_ncompare, don't implement it vi snmp_oid_compare
+
+2002-01-22 19:46 rstory
+
+ * snmplib/: oid_array.c, oid_array.h:
+
+ add Get_oid_data_count(); add subset support
+
+2002-01-22 19:44 rstory
+
+ * snmplib/: mib.c, mib.h:
+
+ add netsnmp_str2oid()
+
+2002-01-22 19:41 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ add subset function
+
+2002-01-22 19:40 rstory
+
+ * agent/helpers/table_array.c:
+
+ add subset function; add preliminary locking code; add ta_check_row_status
+
+2002-01-22 06:33 jbpn
+
+ * agent/mibgroup/mibII/: vacm_vars.c (V4-2-patches.4), vacm_vars.c
+:
+
+ - fix bug just introduced where setting an existing row's status to
+ createAndGo(4) or createAndWait(5) would delete the row.
+
+2002-01-22 04:58 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - cause a parse error if we receive UsmSecurityParameters with a
+ msgUserName that is illegally long.
+
+2002-01-22 03:10 jbpn
+
+ * agent/mibgroup/target/snmpTargetParamsEntry.c:
+
+ - oops, left old code in #if 0 branch AGAIN. I am getting into bad
+ habits!
+
+2002-01-22 03:08 jbpn
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ - fix memory leaks in row creation/destruction
+
+ - more aggressive validity checking of snmpNotifyTag, snmpNotifyType
+ and snmpNotifyStorageType.
+
+ - passes 6.5.1.0 -- 6.5.8.3
+
+2002-01-22 01:47 jbpn
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c,
+ snmpTargetParamsEntry.c, snmpTargetParamsEntry.h:
+
+ - correct state machines for snmpTargetParamsTable
+
+2002-01-21 23:48 jbpn
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ - tidy things up a bit (had left some old code sitting if #if 0
+ branch).
+
+ - remember to close (target->sess) when we move a target to
+ notInService(2).
+
+2002-01-21 11:04 jbpn
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ - correct state machines for snmpTargetAddrTable
+
+2002-01-21 06:47 jbpn
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c,
+ snmpTargetAddrEntry.h:
+
+ - implement snmpTargetSpinLock object
+
+2002-01-18 09:19 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - correct state machine for vacmViewTreeFamilyTable. Passes all the
+ relevant Silvercreek VACM tetst.
+
+2002-01-18 08:49 jbpn
+
+ * snmplib/: vacm.c, vacm.h:
+
+ - add a switch to vacm_getViewEntry() to allow the mask entries
+ to be ignore (which is what you want when you are just using this
+ function to look up an entry in the table in order to write some new
+ value to one of the columnar objects).
+
+2002-01-18 06:09 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - correct state machine for vacmAccessTable. Passes all the relevant
+ Silvercreek VACM tetst.
+
+2002-01-18 04:11 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - correct state machine for vacmSecurityToGroupTable (i.e. don't
+ just do everything in the COMMIT phase). Passes all the relevant
+ Silvercreek VACM tetst.
+
+2002-01-18 04:08 jbpn
+
+ * agent/snmp_agent.c:
+
+ - don't overwrite an existing error status after COMMIT or UNDO
+ phases with commitFailed or undoFailed (but do translate error
+ returns from those phases into those errors when we don't have an
+ existing error status).
+
+2002-01-17 06:57 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - handle illegal values of msgID correctly (by dropping the packet
+ and incrementing snmpInASNParseErrs)
+
+2002-01-17 06:38 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - handle illegal values of msgMaxSize correctly (by dropping the
+ packet and incrementing snmpInASNParseErrs)
+
+2002-01-15 08:17 rstory
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ top level include which includes useful snmplib headers
+
+2002-01-15 08:15 rstory
+
+ * include/ucd-snmp/: agent_index.h, agent_read_config.h
+, agent_registry.h, agent_trap.h, asn1.h,
+ auto_nlist.h, callback.h, default_store.h,
+ ds_agent.h, header_complex.h, int64.h, keytools.h
+, mib.h, mib_module_config.h, mibincl.h,
+ parse.h, read_config.h, scapi.h, snmp-tc.h,
+ snmp.h, snmp_agent.h, snmp_alarm.h, snmp_api.h
+, snmp_client.h, snmp_debug.h, snmp_impl.h,
+ snmp_logging.h, snmp_parse_args.h, snmp_vars.h,
+ snmpusm.h, snmpv3.h, struct.h, system.h,
+ tools.h, transform_oids.h, ucd-snmp-agent-includes.h
+, ucd-snmp-config.h, ucd-snmp-includes.h,
+ util_funcs.h, var_struct.h, version.h:
+
+ create 4.x headers that are wrappers pointing to new headers
+
+2002-01-14 15:08 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ add UserRowAction and void pointer
+
+2002-01-14 13:41 hardaker
+
+ * agent/: mibgroup/ucd-snmp/lmSensors.c, Makefile.in:
+
+ -> net-snmp/agent/net-snmp-agent-includes.h
+
+2002-01-14 13:40 hardaker
+
+ * include/net-snmp/agent/ucd-snmp-agent-includes.h:
+
+ removed
+
+2002-01-14 13:29 rstory
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ copy ucd-snmp-agent-includes.h and update to net-snmp use new agent dir
+
+2002-01-14 08:04 hardaker
+
+ * agent/Makefile.in, agent/agent_callbacks.h,
+ agent/agent_handler.c, agent/agent_handler.h,
+ agent/agent_index.c, agent/agent_index.h,
+ agent/agent_read_config.c, agent/agent_read_config.h,
+ agent/agent_registry.c, agent/agent_registry.h,
+ agent/agent_trap.c, agent/agent_trap.h,
+ agent/auto_nlist.c, agent/auto_nlist.h,
+ agent/ds_agent.h, agent/kernel.c, agent/mib_modules.c
+, agent/mib_modules.h, agent/snmp_agent.c,
+ agent/snmp_agent.h, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmpd.c,
+ agent/ucd-snmp-agent-includes.h, agent/var_struct.h,
+ agent/helpers/Makefile.in, agent/helpers/bulk_to_next.c
+, agent/helpers/debug_handler.c,
+ agent/helpers/instance.c, agent/helpers/multiplexer.c,
+ agent/helpers/null.c, agent/helpers/old_api.c,
+ agent/helpers/read_only.c, agent/helpers/serialize.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ agent/helpers/table_iterator.c, agent/mibgroup/host_res.h
+, agent/mibgroup/mibincl.h,
+ agent/mibgroup/testdelayed.c, agent/mibgroup/testhandler.c
+, agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/host/hr_disk.c, agent/mibgroup/host/hr_proc.c
+, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/tcpTable.c
+, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/misc/dlmod.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/smux/snmp_bgp.c
+, agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/tunnel/tunnel.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ apps/notification_log.h, apps/snmptrapd.c,
+ include/net-snmp/agent/agent_callbacks.h,
+ include/net-snmp/agent/agent_handler.h,
+ include/net-snmp/agent/agent_index.h,
+ include/net-snmp/agent/agent_read_config.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/agent/agent_trap.h,
+ include/net-snmp/agent/auto_nlist.h,
+ include/net-snmp/agent/ds_agent.h,
+ include/net-snmp/agent/mib_modules.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/snmp_vars.h,
+ include/net-snmp/agent/ucd-snmp-agent-includes.h,
+ include/net-snmp/agent/var_struct.h:
+
+ moved the /agent installed headers to ../include/net-snmp/agent
+
+2002-01-13 09:22 hardaker
+
+ * agent/Makefile.in:
+
+ add a couple more install headers.
+
+2002-01-11 14:18 hardaker
+
+ * apps/: Makefile.in, notification_log.c:
+
+ Move all agent/helpers/*.h files to include/net-snmp/agent/ and change
+ references.
+
+2002-01-11 14:12 hardaker
+
+ * agent/Makefile.in, agent/agent_handler.c,
+ agent/agent_index.c, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/mib_modules.c,
+ agent/snmp_vars.c, agent/snmpd.c,
+ agent/helpers/all_helpers.h, agent/helpers/bulk_to_next.c
+, agent/helpers/bulk_to_next.h,
+ agent/helpers/debug_handler.c, agent/helpers/debug_handler.h
+, agent/helpers/instance.c, agent/helpers/instance.h
+, agent/helpers/multiplexer.c,
+ agent/helpers/multiplexer.h, agent/helpers/null.c,
+ agent/helpers/null.h, agent/helpers/old_api.c,
+ agent/helpers/old_api.h, agent/helpers/read_only.c,
+ agent/helpers/read_only.h, agent/helpers/serialize.c,
+ agent/helpers/serialize.h, agent/helpers/set_helper.h,
+ agent/helpers/table.c, agent/helpers/table.h,
+ agent/helpers/table_array.c, agent/helpers/table_array.h
+, agent/helpers/table_data.c, agent/helpers/table_data.h
+, agent/helpers/table_dataset.c,
+ agent/helpers/table_dataset.h, agent/helpers/table_iterator.c
+, agent/helpers/table_iterator.h,
+ agent/mibgroup/Makefile.in, agent/mibgroup/testdelayed.c
+, agent/mibgroup/testhandler.c,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/target/target_counters.c,
+ include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/bulk_to_next.h,
+ include/net-snmp/agent/debug_handler.h,
+ include/net-snmp/agent/instance.h,
+ include/net-snmp/agent/multiplexer.h,
+ include/net-snmp/agent/null.h,
+ include/net-snmp/agent/old_api.h,
+ include/net-snmp/agent/read_only.h,
+ include/net-snmp/agent/serialize.h,
+ include/net-snmp/agent/set_helper.h,
+ include/net-snmp/agent/table.h,
+ include/net-snmp/agent/table_array.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/agent/table_iterator.h:
+
+ Move all agent/helpers/*.h files to include/net-snmp/agent/ and change
+ references.
+
+2002-01-11 08:41 hardaker
+
+ * agent/Makefile.in, agent/helpers/Makefile.in,
+ agent/mibgroup/Makefile.in, apps/Makefile.in,
+ snmplib/Makefile.in:
+
+ - Add -I$(top_srcdir)/include to include path.
+ - Rename 3 agent libraries from libucd* -> libnetsnmp*
+
+2002-01-11 07:58 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - don't use while(x-- >= 0) loops for new unsigned index components
+
+2002-01-11 05:27 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - be careful about signedess of index components in tables
+
+2002-01-10 13:12 nba
+
+ * configure, configure.in:
+
+ Create the include directory when building outside source directory
+
+2002-01-10 08:20 jbpn
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ - use an unsigned long loop variable in var_sysORTable() to avoid
+ incorrect lexi-ordering when doing requests like GETNEXT
+ sysORDescr.4294967295.
+
+ - minor debugging output changes
+
+2002-01-10 07:32 jbpn
+
+ * agent/snmp_agent.c:
+
+ - fix minor memory leak in reassign_requests()
+
+2002-01-10 07:21 jbpn
+
+ * agent/snmp_agent.c:
+
+ - set type for unhandled GET requests in handle_pdu() to be
+ noSuchInstance rather than noSuchObject (noSuchObject exceptions
+ are detected and explicitly set earlier).
+
+2002-01-10 05:52 jbpn
+
+ * agent/helpers/old_api.c:
+
+ - correct typo that meant error returns from old-api write methods
+ were ignored.
+
+2002-01-10 05:04 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - change value of STAT_TARGET_STATS_END so that mibII/snmp_mib.c can
+ return values of mandatory objects snmpSilentDrops and
+ snmpProxyDrops.
+
+2002-01-09 08:50 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - make unknown/illegal varbind types in v1/v2c PDUs cause
+ snmpInASNParseErrs to be incremented.
+
+2002-01-09 07:55 jbpn
+
+ * agent/helpers/debug_handler.c:
+
+ - fix memory leak
+
+2002-01-09 07:32 jbpn
+
+ * apps/snmpbulkget.c:
+
+ - bring app-specific options in line with snmpbulkwalk (-C rather
+ than -B)
+
+2002-01-09 07:31 jbpn
+
+ * apps/snmpbulkwalk.c:
+
+ - formatting change to usage message
+
+2002-01-09 06:35 jbpn
+
+ * agent/helpers/table_iterator.c:
+
+ - fix minor memory leak
+
+2002-01-08 08:55 jbpn
+
+ * apps/snmpbulkwalk.c:
+
+ - add options from snmpwalk
+
+ - allow non-repeaters and max-repeaters to be set
+
+ - change default value of max-repeaters to a lower value to avoid
+ timeouts with slower agents
+
+2002-01-08 08:17 jbpn
+
+ * agent/snmp_agent.c:
+
+ - don't try to malloc() a zero-length buffer, in case some malloc()s
+ complain.
+
+2002-01-08 08:15 jbpn
+
+ * agent/snmp_agent.c:
+
+ - hopefully final GETBULK fix -- passes all SilverCreek's GETBULK
+ tests (incl. negative non-repeaters and max-repeaters)
+
+2002-01-08 06:59 jbpn
+
+ * agent/: snmp_agent.c, snmp_agent.h,
+ helpers/bulk_to_next.c:
+
+ - GETBULK fix to ignore varbinds for which zero repetitions are
+ called for
+
+ - drop asp->start and asp->end which are hardly used and which get
+ in the way of this type of processing
+
+ - ignore negative repetitions in bulk_to_next handler
+
+2002-01-07 08:39 hardaker
+
+ * perl/manager/.cvsignore:
+
+ ignore file
+
+2002-01-07 08:38 hardaker
+
+ * perl/manager/INSTALL:
+
+ PNGGraph -> GD::Graph
+
+2002-01-04 13:48 hardaker
+
+ * Makefile.in:
+
+ fix dependencies
+
+2002-01-04 13:24 hardaker
+
+ * acconfig.h, include/net-snmp/acconfig.h:
+
+ move acconfig.h back to the top dir where its apparently supposed to live.
+
+2002-01-04 13:18 hardaker
+
+ * configure, configure.in:
+
+ more ucd-snmp -> net-snmp translations. warning: includes the default persistent store.
+
+2002-01-04 13:04 hardaker
+
+ * include/: net-snmp/.cvsignore, ucd-snmp/.cvsignore:
+
+ ignore files
+
+2002-01-04 13:02 hardaker
+
+ * .cvsignore:
+
+ ignore built net-snmp-config
+
+2002-01-04 13:00 hardaker
+
+ * apps/: Makefile.in, encode_keychange.c,
+ notification_log.c, snmpbulkget.c, snmpbulkwalk.c
+, snmpdelta.c, snmpdf.c, snmpget.c,
+ snmpgetnext.c, snmpset.c, snmpstatus.c,
+ snmptable.c, snmptest.c, snmptranslate.c,
+ snmptrap.c, snmptrapd.c, snmptrapd_handlers.c
+, snmptrapd_log.c, snmpusm.c, snmpvacm.c
+, snmpwalk.c:
+
+ beginnings of ucd-snmp -> net-snmp structural changes.
+ - config.h -> include/net-snmp/net-snmp-config.h
+ - this, of course, changes just about every file in the repository.
+
+2002-01-04 12:56 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/smux/smux.c, agent/mibgroup/smux/snmp_bgp.c
+, agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/hpux.c,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ apps/snmpnetstat/Makefile.in, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/route.c,
+ apps/snmpnetstat/winstub.c:
+
+ beginnings of ucd-snmp -> net-snmp structural changes.
+ - config.h -> include/net-snmp/net-snmp-config.h
+ - this, of course, changes just about every file in the repository.
+
+2002-01-04 12:52 hardaker
+
+ * agent/mibgroup/misc/dlmod.c, agent/mibgroup/misc/ipfwacc.c
+, include/net-snmp/acconfig.h,
+ include/net-snmp/net-snmp-config.h.in,
+ include/ucd-snmp/README, snmplib/Makefile.in,
+ snmplib/asn1.c, snmplib/callback.c,
+ snmplib/data_list.c, snmplib/default_store.c,
+ snmplib/int64.c, snmplib/keytools.c,
+ snmplib/lcd_time.c, snmplib/md5.c, snmplib/mib.c
+, snmplib/mt_support.c, snmplib/oid_array.c,
+ snmplib/oid_stash.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp-tc.c, snmplib/snmp.c,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpCallbackDomain.c
+, snmplib/snmpIPXDomain.c, snmplib/snmpTCPDomain.c
+, snmplib/snmpTCPIPv6Domain.c, snmplib/snmpUDPDomain.c
+, snmplib/snmpUDPIPv6Domain.c, snmplib/snmpUnixDomain.c
+, snmplib/snmp_alarm.c, snmplib/snmp_api.c,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_debug.c, snmplib/snmp_enum.c,
+ snmplib/snmp_logging.c, snmplib/snmp_parse_args.c,
+ snmplib/snmp_secmod.c, snmplib/snmp_transport.c,
+ snmplib/snmpksm.c, snmplib/snmpusm.c, snmplib/snmpv3.c
+, snmplib/snprintf.c, snmplib/strtol.c,
+ snmplib/strtoul.c, snmplib/system.c, snmplib/tools.c
+, snmplib/vacm.c, testing/T.c,
+ testing/etimetest.c, testing/keymanagetest.c,
+ testing/misctest.c, testing/scapitest.c:
+
+ beginnings of ucd-snmp -> net-snmp structural changes.
+ - config.h -> include/net-snmp/net-snmp-config.h
+ - this, of course, changes just about every file in the repository.
+
+2002-01-04 12:49 hardaker
+
+ * Makefile.in, Makefile.top, configure,
+ configure.in, sedscript.in, agent/Makefile.in
+, agent/agent_handler.c, agent/agent_index.c,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/auto_nlist.c,
+ agent/kernel.c, agent/mib_modules.c,
+ agent/snmp_agent.c, agent/snmp_vars.c,
+ agent/snmpd.c, agent/helpers/Makefile.in,
+ agent/helpers/bulk_to_next.c, agent/helpers/debug_handler.c
+, agent/helpers/instance.c, agent/helpers/multiplexer.c
+, agent/helpers/null.c, agent/helpers/old_api.c,
+ agent/helpers/read_only.c, agent/helpers/serialize.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ agent/helpers/table_data.c, agent/helpers/table_dataset.c
+, agent/helpers/table_iterator.c,
+ agent/mibgroup/Makefile.in, agent/mibgroup/header_complex.c
+, agent/mibgroup/kernel_sunos5.c,
+ agent/mibgroup/testdelayed.c, agent/mibgroup/testhandler.c
+, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/Rmon/agutil.c, agent/mibgroup/Rmon/alarm.c
+, agent/mibgroup/Rmon/event.c,
+ agent/mibgroup/Rmon/history.c, agent/mibgroup/Rmon/rows.c
+, agent/mibgroup/Rmon/statistics.c,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/mteObjectsTable.c,
+ agent/mibgroup/disman/mteTriggerBooleanTable.c,
+ agent/mibgroup/disman/mteTriggerDeltaTable.c,
+ agent/mibgroup/disman/mteTriggerExistenceTable.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerThresholdTable.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_other.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_proc.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/tcpTable.c
+, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c:
+
+ beginnings of ucd-snmp -> net-snmp structural changes.
+ - config.h -> include/net-snmp/net-snmp-config.h
+ - this, of course, changes just about every file in the repository.
+
+2002-01-04 12:47 hardaker
+
+ * acconfig.h, config.h.in:
+
+ removed uneeded older files
+
+2002-01-03 14:15 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ patch #492072 to main branch
+
+2002-01-03 14:00 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ check results of setmntent before using them.
+
+2002-01-03 13:57 hardaker
+
+ * apps/snmpnetstat/if.c:
+
+ check against growing server returns as pointed out by bug #498956
+
+2002-01-03 11:40 hardaker
+
+ * perl/manager/displaytable.pm:
+
+ PNGGraph -> GDGraph
+
+2002-01-03 11:39 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ change export name to "net-snmp" from "ucd-snmp"
+
+2002-01-03 11:39 hardaker
+
+ * agent/mibgroup/testhandler.c,
+ local/mib2c.create-dataset.conf, local/mib2c.iterate.conf
+:
+
+ make use of the new multi-add functions.
+
+2002-01-03 11:38 hardaker
+
+ * agent/helpers/: table_dataset.c, table_dataset.h:
+
+ add multiple default row column definitions using one function call (varargs).
+
+2002-01-03 11:38 hardaker
+
+ * agent/helpers/: table.c, table.h:
+
+ add multiple indexes using one function call (varargs).
+
+2002-01-03 11:37 hardaker
+
+ * agent/snmp_vars.h:
+
+ remove no longer defined v4 api functions (getStatPtr no less).
+
+2002-01-03 11:37 hardaker
+
+ * agent/snmp_agent.h:
+
+ remove no longer defined v4 api functions.
+
+2002-01-03 10:31 hardaker
+
+ * snmplib/: Makefile.in, oid_stash.c, oid_stash.h
+:
+
+ data stashing based on an oid caching tree.
+
+2001-12-26 15:36 hardaker
+
+ * perl/manager/: INSTALL, Makefile.PL, manager.pm
+:
+
+ update to make it a bit easier to install (including a Makefile for
+ automated installation).
+
+2001-12-26 13:20 hardaker
+
+ * perl/manager/: INSTALL, displaytable.pm, getValues.pm
+, green.gif, manager.pm, red.gif, setupauth
+, setupdb, setupuser, snmptosql:
+
+ moving manager to perl/manager
+
+2001-12-24 16:10 hardaker
+
+ * FAQ, sedscript.in, version.h,
+ perl/SNMP/SNMP.pm:
+
+ - (version.h sedscript.in): version tag ( 5.0.pre1 )
+
+2001-12-24 16:04 hardaker
+
+ * local/: Makefile.in, mib2c, mib2c.conf:
+
+ Update to make people understand that it's not finished and you must
+ reference a particular configuration file at this point.
+
+2001-12-24 15:51 hardaker
+
+ * FAQ, sedscript.in, version.h,
+ perl/SNMP/SNMP.pm:
+
+ - (version.h sedscript.in): version tag ( 5.0.not.even.close )
+
+2001-12-24 15:50 hardaker
+
+ * README:
+
+ more comments.
+
+2001-12-24 15:41 hardaker
+
+ * FAQ, README:
+
+ more updates
+
+2001-12-24 15:20 hardaker
+
+ * agent/helpers/old_api.c:
+
+ doxygen comments
+
+2001-12-24 15:20 hardaker
+
+ * NEWS, README:
+
+ 5.0 comment updates.
+
+2001-12-24 15:19 hardaker
+
+ * agent/agent_handler.c:
+
+ doxygen comments on a few functions.
+
+2001-12-24 15:09 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ memory leaks.
+
+2001-12-24 10:06 hardaker
+
+ * agent/Makefile.in:
+
+ remove dependencies for non-existent modules
+
+2001-12-23 15:47 hardaker
+
+ * net-snmp-config:
+
+ opps. Don't check in generated files.
+
+2001-12-23 15:46 hardaker
+
+ * config.h.in, configure, configure.in,
+ agent/mibgroup/host/hr_swinst.c:
+
+ fix rpm usage (I hope).
+
+2001-12-23 14:50 hardaker
+
+ * agent/mibgroup/agent/.cvsignore:
+
+ added .cvsignore file
+
+2001-12-23 14:49 hardaker
+
+ * Makefile.in:
+
+ install net-snmp-config.
+
+2001-12-23 14:47 hardaker
+
+ * NEWS, configure, configure.in,
+ net-snmp-config, net-snmp-config.in, agent/Makefile.in
+, apps/Makefile.in:
+
+ - created a net-snmp-config script to report compiled libs.
+ - separated libs needed by agent from those needed by the rest of the
+ applications.
+
+2001-12-21 16:53 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ mention how to install DBI
+
+2001-12-21 16:44 hardaker
+
+ * perl/AnyData_SNMP/Makefile.PL:
+
+ remove version requirement for AnyData
+
+2001-12-21 16:37 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ make install as root.
+
+2001-12-21 16:32 hardaker
+
+ * perl/AnyData_SNMP/: INSTALL, INSTALL, INSTALL,
+ INSTALL:
+
+ better descr
+
+2001-12-21 16:09 hardaker
+
+ * perl/AnyData_SNMP/README:
+
+ minor wording change.
+
+2001-12-21 16:07 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ mention it's very alpha code.
+
+2001-12-21 16:06 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ new instructions
+
+2001-12-21 10:18 hardaker
+
+ * NEWS:
+
+ mention doxygen.
+
+2001-12-21 10:17 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/agent_mibs.h:
+
+ compile in agent specific support mibs.
+
+2001-12-21 09:49 hardaker
+
+ * NEWS:
+
+ (still incomplete) 2nd update for 5.0
+
+2001-12-21 09:44 hardaker
+
+ * NEWS:
+
+ (incomplete) update for 5.0
+
+2001-12-19 17:10 hardaker
+
+ * snmplib/asn1.c:
+
+ fix realloc float and double builds.
+
+2001-12-19 16:34 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ misc fixes.
+
+2001-12-19 16:33 hardaker
+
+ * local/mib2c:
+
+ define a C datatype as $var.decl (per Robert's suggestion. Robert: we
+ probably want pointers for things like strings, no? maybe one type
+ that is always a pointer and another that is sometimes depending on
+ the type?)
+
+2001-12-19 16:32 hardaker
+
+ * apps/snmpbulkwalk.c:
+
+ change default bulk number to 100 from the ridiculous 1000.
+
+2001-12-19 16:32 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, snmplib/Makefile.in:
+
+ make depend
+
+2001-12-19 08:10 hardaker
+
+ * agent/: snmp_agent.c, helpers/bulk_to_next.c:
+
+ getbulk updates to make it the modules responsibility to update the
+ varbind chain an the repeat counter.
+
+2001-12-19 07:57 hardaker
+
+ * agent/: agent_handler.c, snmp_agent.c, snmp_agent.h
+, helpers/Makefile.in, helpers/all_helpers.c,
+ helpers/all_helpers.h, helpers/bulk_to_next.c,
+ helpers/bulk_to_next.h:
+
+ GETBULK support for the new API.
+ - may need to make some slight modifications.
+ - defaults to GETNEXT for any handler that doesn't set HANDLER_CAN_GETBULK.
+ - doesn't deal properly yet with end-of-mib condition removal.
+
+2001-12-19 06:05 jbpn
+
+ * apps/snmptrapd.c:
+
+ - drop -p option. Addresses to listen on now come as optional
+ arguments at the end of the command line.
+
+ - drop (long-deprecated) -q option.
+
+ - re-ordered options in usage message to be alphabetical, and
+ changed description of some options to be more similar to snmpd
+ options (where appropriate).
+
+2001-12-19 04:38 jbpn
+
+ * agent/snmpd.c:
+
+ - drop -p and -T options. Addresses to listen on now come as
+ optional arguments at the end of the command line.
+
+ - re-ordered options in usage message to be alphabetical, plus
+ minor formatting tweaks.
+
+ - re-written options processing loop to use optarg().
+
+2001-12-18 08:44 jbpn
+
+ * mibs/: UCD-SNMP-MIB.txt (V4-2-patches.5), UCD-SNMP-MIB.txt
+:
+
+ - add OBJECT IDENTIFIER for win32 agent
+
+2001-12-18 08:16 hardaker
+
+ * agent/helpers/old_api.c:
+
+ warning -> debug.
+
+2001-12-17 10:15 jbpn
+
+ * agent/snmp_agent.c:
+
+ - handle getNext queries where the initial varbind->type is
+ ASN_PRIV_INCL_RANGE (these currently arise only in AgentX
+ subagents but the handling is not specific to AgentX).
+
+ Basically this is done by performing a GET first on all the
+ variables in a request. For variables that had an initial type of
+ ASN_PRIV_INCL_RANGE and were satisfied by this initial GET, we use
+ this value as the result. For variables that did not have an
+ initial type of ASN_PRIV_INCL_RANGE, or variable that had and
+ initial type of ASN_PRIV_INCL_RANGE but were not satisfied by this
+ GET request, we proceed to perform a GET-NEXT type request as
+ normal.
+
+2001-12-17 10:04 jbpn
+
+ * agent/helpers/old_api.c:
+
+ - add function register_mib_table_row() which emulates old
+ functionality.
+
+ - use snmp_handler_registration_free() in register_old_api().
+
+2001-12-17 09:39 jbpn
+
+ * snmplib/mib.c:
+
+ - fix bogus indent
+
+2001-12-17 09:38 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - right number of arguments for register_mib_context2() in
+ register_agentx_list().
+
+ - use snmp_handler_registration_free() in ditto.
+
+2001-12-13 19:22 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ remove handler injection order (serialize needs to be called first)
+
+2001-12-13 19:22 hardaker
+
+ * agent/snmp_agent.c:
+
+ remove unneeded check for already answered ASN_NULLs in first pass.
+
+2001-12-12 09:31 hardaker
+
+ * perl/AnyData_SNMP/: .cvsignore, INSTALL, MANIFEST
+, README, snmpsh:
+
+ - doc update.
+ - snmpsh now supports aliases so you can define command sets.
+ - snmpsh now reads a ~/.snmpshrc file for storing these defined aliases.
+
+2001-12-12 06:42 jbpn
+
+ * agent/agent_registry.c:
+
+ - new function join_subtree() which repairs "punctured" subtrees
+ (these arise in particular when AgentX row registrations are
+ withdrawn).
+
+ - copy reginfo when doing a range registration (as we used to do
+ with the variable structure), since each node must stand alone.
+
+ - add parameter to register_mib_context2 to allow REGISTER_OID
+ callbacks to be withheld (for instance, you need this to avoid
+ excess AgentX traffic for row registrations).
+
+ - remove register_mib_table_row() -- this has moved to old_api.c
+
+ - call join_subtree() in unregister_mibs_by_session().
+
+2001-12-12 06:33 jbpn
+
+ * agent/: agent_handler.c, agent_handler.h:
+
+ - add functions snmp_handler_free(), snmp_handler_dup(),
+ snmp_handler_registration_dup() and
+ snmp_handler_registration_free().
+
+2001-12-11 18:41 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Fix bug where pdu->contextName is NULL.
+
+2001-12-11 07:34 hardaker
+
+ * local/mib2c:
+
+ BITS: ipaddr -> octet_str
+
+2001-12-11 04:11 jbpn
+
+ * agent/: snmp_agent.c, snmp_agent.h,
+ mibgroup/agentx/master.c:
+
+ - send INCLUSIVE search ranges if appropriate
+
+2001-12-10 20:43 rstory
+
+ * local/mib2c:
+
+ add noaccess flag for not-accessible nodes
+
+2001-12-10 14:51 hardaker
+
+ * perl/AnyData_SNMP/: Changes, DBD_AnyData.patch,
+ Format.pm, INSTALL, MANIFEST, Makefile.PL,
+ Storage.pm, snmpsh:
+
+ First version
+
+2001-12-10 03:20 jbpn
+
+ * agent/agent_read_config.c:
+
+ - don't strdup arg to ds_set_string
+
+2001-12-10 03:19 jbpn
+
+ * snmplib/read_config.c:
+
+ - ditto in set_persistent_directory()
+
+2001-12-10 03:18 jbpn
+
+ * snmplib/read_config.c:
+
+ - don't strdup() in set_configuration_directory() because
+ ds_set_string() already does that for you.
+
+2001-12-07 09:43 hardaker
+
+ * agent/: helpers/table_iterator.c, helpers/table_iterator.h
+, mibgroup/agent/nsTransactionTable.c,
+ mibgroup/mibII/vacm_context.c:
+
+ - Implement new mantra: "always pass more information, rather than less".
+ - fix table iterater GETNEXTs for missing data points.
+ - add a new hook to free loop contexts at the end of the entire iteration.
+
+2001-12-06 06:58 jbpn
+
+ * agent/mibgroup/agentx/: client.c (JBPN-CBL-4.1), client.c:
+
+ - if request IDs don't match, then call handle_agentx_packet() --
+ copes better with unexpected packets, in particular fixes
+ intermittent duplicate trap issue (due to resent
+ agentx-Notify-PDU).
+
+2001-12-05 13:46 hardaker
+
+ * snmplib/snmp-tc.c:
+
+ Ahem. Opps. Missing includes.
+ - note to self: compile first, *then* check in changes.
+
+2001-12-05 13:41 hardaker
+
+ * snmplib/snmp-tc.c:
+
+ add in the missing functions from the NEW-AGENT-API branch.
+ (and to answer Robert's pending question of what happened, it was
+ likely one of the files that failed to commit on my side that you
+ tried to fix and somewhere between the two of us the changes were lost).
+
+2001-12-05 10:03 jbpn
+
+ * man/snmpcmd.1:
+
+ - minor tweaks
+
+2001-12-05 09:14 jbpn
+
+ * man/snmpcmd.1:
+
+ - add TCP/IPv6 domain to AGENT SPEC section
+
+ - incorporate suggestions from rstory
+
+2001-12-05 08:47 jbpn
+
+ * snmplib/snmpTCPIPv6Domain.c:
+
+ - use SOCK_STREAM not SOCK_DGRAM (duh!). You wouldn't believe how
+ confusing this was -- e.g. how on *earth* can that connect() be
+ succeeding!
+
+2001-12-05 08:36 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - make sure to close socket if you can't malloc the encoded far-end
+ address in snmp_tcp_transport()
+
+2001-12-05 08:27 hardaker
+
+ * win32/: snmptranslate/snmptranslate.dsp,
+ snmptrap/snmptrap.dsp, snmptrapd/snmptrapd.dsp,
+ snmpusm/snmpusm.dsp, snmpvacm/snmpvacm.dsp:
+
+ merge from 4.2 patches to main line
+
+2001-12-05 08:23 hardaker
+
+ * ChangeLog, FAQ, NEWS, README,
+ README.win32, acconfig.h, config.h.in,
+ configure, configure.in, sedscript.in,
+ agent/agent_callbacks.h, agent/agent_read_config.c,
+ agent/snmpd.c, agent/mibgroup/kernel_sunos5.c,
+ agent/mibgroup/versiontag, agent/mibgroup/host/hr_disk.c
+, agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/kernel_linux.c,
+ agent/mibgroup/mibII/kernel_linux.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/tcpTable.c
+, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ apps/snmpnetstat/if.c, local/mib2c, local/tkmib
+, man/snmpd.conf.5.def, mibs/UCD-SNMP-MIB.txt,
+ perl/SNMP/SNMP.pm, snmplib/asn1.c,
+ snmplib/default_store.h, snmplib/mib.c,
+ snmplib/read_config.c, snmplib/read_config.h,
+ snmplib/snmp.h, snmplib/snmp_api.c,
+ win32/snmpwalk/snmpwalk.dsp, win32/config.h,
+ win32/mib_module_config.h, win32/mib_module_includes.h,
+ win32/mib_module_inits.h, win32/win32.dsw,
+ win32/win32.opt, win32/encode_keychange/encode_keychange.dsp
+, win32/libagent/libagent.dsp, win32/libsnmp/libsnmp.dsp
+, win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/libucdmibs/libucdmibs.dsp,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp, win32/snmpd/snmpd.dsp
+, win32/snmpdelta/snmpdelta.dsp, win32/snmpdf/snmpdf.dsp
+, win32/snmpget/snmpget.dsp,
+ win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpnetstat/snmpnetstat.dsp, win32/snmpset/snmpset.dsp
+, win32/snmpstatus/snmpstatus.dsp,
+ win32/snmptable/snmptable.dsp, win32/snmptest/snmptest.dsp
+:
+
+ merge from 4.2 patches to main line
+
+2001-12-05 07:51 jbpn
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ - fix bug in address parser
+
+2001-12-05 07:48 jbpn
+
+ * snmplib/: snmpTCPIPv6Domain.c, snmpUDPIPv6Domain.c:
+
+ - minor changes to, ahem, make it compile
+
+2001-12-05 07:42 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - conditionalise #include <fcntl.h>
+
+2001-12-05 07:38 jbpn
+
+ * snmplib/snmp_transport.c:
+
+ - fix typo
+
+2001-12-05 07:29 jbpn
+
+ * acconfig.h, configure.in:
+
+ - mention the TCP/IPv6 transport in config, and add a #define for it
+ if appropriate
+
+2001-12-05 07:28 jbpn
+
+ * snmplib/snmp_transport.c:
+
+ - call snmp_tcp6_ctor() if appropriate
+
+2001-12-05 07:27 jbpn
+
+ * snmplib/: snmpTCPIPv6Domain.c, snmpTCPIPv6Domain.h:
+
+ - TCP/IPv6 transport domain. Untested.
+
+2001-12-05 07:19 jbpn
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ - make encoded addresses at transport open time
+
+2001-12-05 07:17 jbpn
+
+ * snmplib/: snmpTCPDomain.c, snmp_transport.h:
+
+ - move #definition of SNMP_STREAM_QUEUE_LEN from snmpTCPDomain.c
+ to snmp_transport.h
+
+2001-12-05 07:10 hardaker
+
+ * agent/: snmp_agent.c, snmp_vars.c:
+
+ remove some unneeded functions like, oh, I don't know, getStatPtr().
+
+2001-12-05 05:43 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - remove legacy callback operation names
+
+2001-12-05 05:06 jbpn
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ - changed textual address parsing
+
+2001-12-04 22:52 nba
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Fix bind parameters, so that the agent works
+
+2001-12-04 13:36 hardaker
+
+ * agent/helpers/table.h, agent/helpers/table_iterator.c
+, agent/helpers/table_iterator.h,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/mibII/vacm_context.c, local/mib2c.iterate.conf
+:
+
+ - move forgotten function typedefs to iterator specific header file.
+ - add a void * pointer for the callbacks to make functions more reusable.
+
+2001-12-04 13:11 hardaker
+
+ * agent/helpers/table.h, agent/helpers/table_iterator.c
+, agent/helpers/table_iterator.h,
+ agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/mibII/vacm_context.c, local/mib2c.iterate.conf
+:
+
+ move iterator specific table information into its own structure.
+
+2001-12-04 12:16 hardaker
+
+ * agent/helpers/all_helpers.h:
+
+ Fix prototype as pointed out by Jerome Peducasse
+
+2001-12-04 10:10 jbpn
+
+ * man/snmpcmd.1:
+
+ - mention that not all transport domains are always available.
+
+2001-12-04 09:55 jbpn
+
+ * man/snmpcmd.1:
+
+ - remove -p and -T options from documentation.
+
+ - add lengthy new section describing new transport address
+ specification format, with examples and everything!
+
+2001-12-04 07:14 jbpn
+
+ * snmplib/snmp_parse_args.c:
+
+ - drop -p and -T options for apps.
+
+2001-12-04 03:10 jbpn
+
+ * snmplib/: snmpUDPIPv6Domain.c, snmpUDPIPv6Domain.h:
+
+ - add create_ostring method, export ucdSnmpUDPIPv6Domain[]
+
+2001-12-04 02:19 jbpn
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - mention IPv6 transport domain OIDs in relevant comment.
+
+2001-12-03 15:07 nba
+
+ * snmplib/snmpUDPDomain.c:
+
+ Quell a const cast warning.
+
+2001-12-03 15:07 nba
+
+ * snmplib/snmp_api.c:
+
+ Fix debug output from retries.
+
+2001-12-03 15:06 nba
+
+ * apps/notification_log.c, snmplib/oid_array.c:
+
+ HAVE_SYS_TYPES_H is not conditional.
+
+2001-12-03 15:04 nba
+
+ * apps/Makefile.in:
+
+ Fix to allow compilations outside source directory.
+
+2001-12-03 15:03 nba
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmp_transport.c:
+
+ Fixes to make UDPIPv6 transport work for Solaris, Linux and FreeBSD.
+ It compiles, and the apps send v6 packets. Agent not yet tested.
+
+2001-12-03 09:48 hardaker
+
+ * local/: mib2c.iterate.conf, mib2c.create-dataset.conf
+:
+
+ copy roberts spiffy header text
+
+2001-12-03 08:36 hardaker
+
+ * apps/notification_log.c:
+
+ datentime column.
+
+2001-12-03 08:01 hardaker
+
+ * agent/snmp_agent.c:
+
+ fix problem with double delegated requests after getnext loop.
+
+2001-12-03 08:00 hardaker
+
+ * configure, configure.in,
+ mibs/NOTIFICATION-LOG-MIB.txt:
+
+ notification log mib added to default list.
+
+2001-12-03 05:33 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - remove spurious debugging output ("blah")
+
+2001-11-30 23:26 hardaker
+
+ * agent/: agent_handler.c, snmp_agent.c, snmp_agent.h
+:
+
+ Change how request processing gets done such that request objects are
+ all calloced at once and get reused instead of reallocated. Big speed
+ improvements.
+
+2001-11-30 15:22 hardaker
+
+ * Makefile.in, doxygen.conf:
+
+ "make doc" to run doxygen.
+
+2001-11-30 10:31 hardaker
+
+ * agent/helpers/: debug_handler.c, multiplexer.h:
+
+ doxygen fixes
+
+2001-11-30 09:26 jbpn
+
+ * agent/agent_handler.c:
+
+ - use DEBUGMSGOIDRANGE in register_handler() if appropriate.
+
+2001-11-30 09:24 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - fix memory leak in register_agentx_list() when subagent tries to
+ register a MIB region that fails either because it is a duplicate
+ or because of some other reason.
+
+2001-11-30 08:44 jbpn
+
+ * agent/helpers/old_api.c:
+
+ - fix memory leak of old_info (that never seems to get used for
+ anything anyway?)
+
+ - fix memory leak that arises during row registration (in AgentX
+ subagents) because successive vars cause apparent duplicate
+ registrations (this is a deficiency) -- but it would appear this
+ could arise in other situations too (genuine duplicate
+ registrations).
+
+2001-11-30 06:33 jbpn
+
+ * agent/agent_trap.c:
+
+ - fix broken parsing in snmpd_parse_config_trapsess() -- loop was
+ copying the same (first) token MAX_ARGS times.
+
+ - eliminate memory leak in ditto.
+
+ - fix typo ("Pausible cause" -> "Possible cause) in ditto.
+
+2001-11-30 06:29 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - print fd in sess_process_packet() -- useful for debugging
+
+2001-11-30 06:28 jbpn
+
+ * snmplib/: snmpCallbackDomain.c, snmpCallbackDomain.h:
+
+ - remove a couple of unnecessary #includes from snmpCallbackDomain.h
+
+ - set *opaque to NULL after we free it -- it might matter.
+
+2001-11-30 03:47 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - clone PDU in handle_agentx_subagent() before sending it on callback
+ session to avoid double free() and free()d memory reads.
+
+ - more concise (ahem) declaration of mycallback in handle_agentx_packet().
+
+2001-11-29 05:51 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - put session and subsession in subagent description (helpful for
+ debugging)
+
+2001-11-29 05:49 jbpn
+
+ * agent/helpers/Makefile.in:
+
+ - fix INSTALLHEADERS
+
+2001-11-29 05:48 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - add some debugging to init_subagent() (which showed that it wasn't
+ being called, so...).
+
+ - fix cast in handle_subagent_set_response()
+
+2001-11-29 05:46 jbpn
+
+ * agent/snmp_vars.c:
+
+ - make sure init_subagent() gets called
+
+2001-11-28 09:28 hardaker
+
+ * agent/agent_registry.c:
+
+ check for session registrations in all contexts.
+
+2001-11-28 06:39 hardaker
+
+ * apps/notification_log.c, snmplib/oid_array.c:
+
+ Add sys/types.h for bug #486277.
+
+2001-11-28 04:03 jbpn
+
+ * apps/notification_log.c:
+
+ - #include <netdb.h>
+
+2001-11-28 04:03 jbpn
+
+ * configure.in, snmplib/Makefile.in:
+
+ - install snmp_transport.h and snmp*Domain.h (for the configured
+ transport domains)
+
+2001-11-28 03:29 jbpn
+
+ * snmplib/ucd-snmp-includes.h:
+
+ - reverse mystery removal of #include <netinet/in.h> and #include
+ <sys/time.h>
+
+2001-11-27 17:28 hardaker
+
+ * agent/: snmp_agent.c, snmp_agent.h:
+
+ more intelligently allocate tree space based on number of varbinds in request.
+
+2001-11-27 14:26 hardaker
+
+ * agent/: snmp_agent.c, snmp_agent.h:
+
+ malloc one large tree_cache array rather than an array of tree_cache pointers.
+
+2001-11-27 12:19 hardaker
+
+ * agent/helpers/all_helpers.h:
+
+ include file name change.
+
+2001-11-27 11:43 hardaker
+
+ * agent/snmp_agent.c:
+
+ comment changes.
+
+2001-11-27 07:52 hardaker
+
+ * apps/Makefile.in:
+
+ fixed Makefile for snmptrapd.
+
+2001-11-27 07:48 hardaker
+
+ * agent/helpers/: Makefile.in, all_helpers.c,
+ all_helpers.h, debug_handler.c, debug_handler.h:
+
+ debug handler created for inserting debugging output into the calling chain.
+
+2001-11-27 07:47 hardaker
+
+ * agent/agent_handler.c:
+
+ enum definitions for modes and can_modes.
+
+2001-11-26 15:29 hardaker
+
+ * agent/snmp_agent.c:
+
+ set PDU variable to NULL to avoid freeing it twice.
+
+2001-11-26 11:20 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ plug another memory leak.
+
+2001-11-26 09:07 hardaker
+
+ * testing/tests/: T020snmpv3get, T021snmpv3getnext,
+ T022snmpv3getMD5, T023snmpv3getMD5DES,
+ T024snmpv3getSHA1, T025snmpv3getSHADES,
+ T028snmpv3getfail, T030snmpv3usercreation,
+ T053agentv1trap, T054agentv2ctrap, T055agentv1mintrap
+, T056agentv2cmintrap, T110agentxget,
+ T111agentxset, T112agentxsetfail, T113agentxtrap,
+ T120proxyget, T121proxyset, T122proxysetfail:
+
+ don't use contexts in tests.
+
+2001-11-26 08:57 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ fix memory leak.
+
+2001-11-26 08:49 hardaker
+
+ * agent/mibgroup/: testdelayed.c, agentx/master.c,
+ ucd-snmp/proxy.c:
+
+ use free_delegated_cache() to plug memory leaks.
+
+2001-11-26 08:48 hardaker
+
+ * agent/: agent_handler.c, agent_handler.h:
+
+ free_delegated_cache() routine
+
+2001-11-26 08:19 jbpn
+
+ * apps/snmptrapd.c:
+
+ - add the ability to listen for traps on multiple transports via the
+ -p option (consistent with snmpd).
+
+2001-11-26 05:44 jbpn
+
+ * agent/mibgroup/target/target.c:
+
+ - use snmp_tdomain_transport_oid() to do session creation from
+ <tDomain-oid, tAddress-octet-string> pair, to allow creation of
+ non-IPv4 sessions in snmpTargetAddrTable.
+
+2001-11-26 04:45 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c, snmpIPXDomain.c,
+ snmpTCPDomain.c, snmpUDPDomain.c, snmpUnixDomain.c
+, snmp_transport.c, snmp_transport.h:
+
+ - add support for creating a transport from a
+ <tDomain-oid, tAddress-octet-string> pair.
+
+2001-11-26 03:06 jbpn
+
+ * agent/mibgroup/target/target.c:
+
+ - use snmp_tdomain_support() to determine whether a transport domain
+ is supported.
+
+2001-11-23 10:24 jbpn
+
+ * apps/snmptrapd.c:
+
+ - add multiple transport domain support for trapd -- this was really
+ REALLY easy!
+
+2001-11-23 09:25 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.c,
+ snmplib/snmp_transport.c, snmplib/snmp_transport.h:
+
+ - remove legacy function snmp_transport_support() (replaced with
+ snmp_tdomain_support()).
+
+2001-11-23 08:57 jbpn
+
+ * snmplib/snmpAAL5PVCDomain.c:
+
+ - use network order for AAL5PVC transport address encoding
+
+2001-11-23 08:47 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c, snmpIPXDomain.c,
+ snmpUnixDomain.c:
+
+ - set local_length, remote_length as appropriate
+
+2001-11-23 08:39 jbpn
+
+ * snmplib/Makefile.in:
+
+ - fix typo
+
+2001-11-23 08:34 jbpn
+
+ * agent/: agent_trap.c,
+ mibgroup/notification/snmpNotifyTable.c:
+
+ - make traps work with new-style addresses, use domain-based address
+ encodings in snmpTargetAddrTable. Note you can now send traps/informs
+ over any supported transport type by using the trapsess directive and
+ a transport:address type specification.
+
+2001-11-23 08:31 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c, snmpIPXDomain.c,
+ snmpTCPDomain.c, snmpUDPDomain.c, snmpUnixDomain.c
+:
+
+ - create appropriately-encoded local or remote endpoint addresses at
+ transport open time.
+
+2001-11-23 06:50 jbpn
+
+ * snmplib/Makefile.in:
+
+ - update dependencies for transports
+
+2001-11-22 09:08 jbpn
+
+ * testing/: TESTCONF.sh, eval_tools.sh,
+ tests/T001snmpv1get, tests/T002snmpv1getnext,
+ tests/T003snmpv1getfail, tests/T014snmpv2cget,
+ tests/T015snmpv2cgetnext, tests/T016snmpv2cgetfail,
+ tests/T017snmpv2ctov1getfail, tests/T018snmpv1tov2cgetfail
+, tests/T020snmpv3get, tests/T021snmpv3getnext,
+ tests/T022snmpv3getMD5, tests/T023snmpv3getMD5DES,
+ tests/T024snmpv3getSHA1, tests/T025snmpv3getSHADES,
+ tests/T028snmpv3getfail, tests/T030snmpv3usercreation,
+ tests/T049snmpv3inform, tests/T050snmpv3trap,
+ tests/T051snmpv2ctrap, tests/T052snmpv2cinform,
+ tests/T053agentv1trap, tests/T054agentv2ctrap,
+ tests/T055agentv1mintrap, tests/T056agentv2cmintrap,
+ tests/T058agentauthtrap, tests/T100agenthup,
+ tests/T110agentxget, tests/T111agentxset,
+ tests/T112agentxsetfail, tests/T113agentxtrap,
+ tests/T120proxyget, tests/T121proxyset,
+ tests/T122proxysetfail:
+
+ - use udp:<hostname>:<port> instead of -p to make tests work again
+
+2001-11-22 00:20 hardaker
+
+ * apps/: notification_log.c, notification_log.h:
+
+ mork wore on the notification log mib. It now supports variable
+ storage, but segfaults on access due to pdu cloning problems I'm not
+ going to work out right now.
+
+2001-11-21 23:15 hardaker
+
+ * apps/Makefile.in:
+
+ fix snmptrapd linking.
+
+2001-11-21 22:58 rstory
+
+ * snmplib/asn1.h:
+
+ remove duplicate OID_LENGTH; use actual oid type in calculation
+
+2001-11-21 22:49 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ add NULL pointer for rbuild in session creation.
+
+2001-11-21 22:49 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c, apps/notification_log.c
+:
+
+ netinet/in.h needed.
+
+2001-11-21 22:49 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ variable clean ups.
+
+2001-11-21 22:33 hardaker
+
+ * agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/tcpTable.c
+, agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/ucd-snmp/file.c, local/mib2c,
+ local/mib2c.array-auto.conf, local/mib2c.array-user.conf
+, local/mib2c.create-dataset.conf,
+ local/mib2c.iterate.conf, local/mib2c.vartypes.conf,
+ man/Makefile.in, mibs/Makefile.in,
+ mibs/NET-SNMP-AGENT-MIB.txt, perl/SNMP/SNMP.xs,
+ snmplib/Makefile.in, snmplib/mib.c, snmplib/mib.h
+, snmplib/read_config.c, snmplib/read_config.h,
+ snmplib/snmp-tc.h, snmplib/snmpUnixDomain.h,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_client.c, snmplib/snmp_client.h,
+ snmplib/snmp_transport.c, snmplib/snmp_transport.h,
+ snmplib/tools.c, snmplib/tools.h, snmplib/vacm.c
+:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 22:08 rstory
+
+ * snmplib/: vacm.h, asn1.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 21:43 rstory
+
+ * snmplib/: snmpCallbackDomain.c, snmpCallbackDomain.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 21:40 rstory
+
+ * snmplib/snmp.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 21:33 rstory
+
+ * snmplib/: oid_array.c, oid_array.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 21:30 rstory
+
+ * snmplib/: data_list.c, data_list.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 18:56 hardaker
+
+ * Makefile.in, config.h.in, configure,
+ configure.in, version.h, agent/Makefile.in,
+ agent/agent_handler.c, agent/agent_handler.h,
+ agent/agent_index.c, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/agent_registry.h,
+ agent/mib_modules.c, agent/snmp_agent.c,
+ agent/snmp_agent.h, agent/snmp_vars.c, agent/snmpd.c
+, agent/ucd-snmp-agent-includes.h, agent/var_struct.h
+, agent/helpers/.cvsignore, agent/helpers/Makefile.in
+, agent/helpers/all_helpers.c,
+ agent/helpers/all_helpers.h, agent/helpers/instance.c,
+ agent/helpers/instance.h, agent/helpers/multiplexer.c,
+ agent/helpers/multiplexer.h, agent/helpers/null.c,
+ agent/helpers/null.h, agent/helpers/old_api.c,
+ agent/helpers/old_api.h, agent/helpers/read_only.c,
+ agent/helpers/read_only.h, agent/helpers/serialize.c,
+ agent/helpers/serialize.h, agent/helpers/set_helper.h,
+ agent/helpers/table.c, agent/helpers/table.h,
+ agent/helpers/table_array.c, agent/helpers/table_array.h
+, agent/helpers/table_data.c, agent/helpers/table_data.h
+, agent/helpers/table_dataset.c,
+ agent/helpers/table_dataset.h, agent/helpers/table_iterator.c
+, agent/helpers/table_iterator.h,
+ agent/mibgroup/Makefile.in, agent/mibgroup/host_res.h
+, agent/mibgroup/mibincl.h, agent/mibgroup/target.h
+, agent/mibgroup/testdelayed.c,
+ agent/mibgroup/testdelayed.h, agent/mibgroup/testhandler.c
+, agent/mibgroup/testhandler.h,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h
+, agent/mibgroup/agent/nsTransactionTable.c,
+ agent/mibgroup/agent/nsTransactionTable.h,
+ agent/mibgroup/agentx/.cvsignore,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master.h,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/.cvsignore,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/examples/.cvsignore,
+ agent/mibgroup/host/hr_disk.c, agent/mibgroup/host/hr_disk.h
+, agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_partition.h,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/mibII/.cvsignore,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/vacm_context.c,
+ agent/mibgroup/mibII/vacm_context.h,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/target/target_counters.c,
+ agent/mibgroup/target/target_counters.h,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/proxy.h,
+ agent/mibgroup/ucd-snmp/registry.c, apps/Makefile.in,
+ apps/notification_log.c, apps/notification_log.h,
+ apps/snmptrapd.c:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 06:43 jbpn
+
+ * config.h.in:
+
+ - IPv6 config defs
+
+2001-11-21 06:36 jbpn
+
+ * agent/snmp_agent.c, snmplib/snmp_api.c:
+
+ - remove now-extraneous #include "snmpBlahDomain.h" lines
+
+2001-11-21 03:39 jbpn
+
+ * apps/.cvsignore:
+
+ [no log message]
+
+2001-11-20 09:38 jbpn
+
+ * snmplib/: snmpIPXDomain.c, snmpIPXDomain.h:
+
+ - duh. Forgot a couple of things to do with domain-based transport
+ address parsing.
+
+2001-11-20 09:29 jbpn
+
+ * agent/snmp_agent.c:
+
+ - use new domain-based transport address parsing for agent NSAPs
+
+2001-11-20 09:27 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c, snmpAAL5PVCDomain.h,
+ snmpIPXDomain.c, snmpTCPDomain.c, snmpTCPDomain.h
+, snmpUDPDomain.c, snmpUDPDomain.h,
+ snmpUnixDomain.c, snmpUnixDomain.h, snmp_api.c,
+ snmp_transport.c, snmp_transport.h:
+
+ - domain-based transport address parsing
+
+2001-11-20 09:16 jbpn
+
+ * snmplib/: snmpUDPIPv6Domain.c, snmpUDPIPv6Domain.h:
+
+ - UDP/IPv6 transport domain. Note: incomplete!
+
+2001-11-20 08:29 jbpn
+
+ * agent/: agent_index.c, agent_index.h:
+
+ - unregister_{string,int,oid}_index() utility functions contributed
+ by Damian Gilmurray.
+
+2001-11-20 02:26 jbpn
+
+ * snmplib/: snmp_api.h (V4-2-patches.1), snmp_api.h:
+
+ - remove duplicate definition of SNMP_MAX_SEC_NAME_SIZE, noted by
+ Karl M. Hegbloom.
+
+2001-11-19 16:59 driehuis
+
+ * snmplib/asn1.h:
+
+ Fix typo in comment [karlheg@microsharp.com]
+
+2001-11-16 08:34 jbpn
+
+ * apps/snmptest.c:
+
+ - add support for Unsigned32/Gauge32 types
+
+2001-11-15 10:03 jbpn
+
+ * agent/mibgroup/agentx/: protocol.c (V4-2-patches.5), protocol.c
+:
+
+ - stricter test for null OIDs
+
+2001-11-15 08:44 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - document read-only nature of snmpEnableAuthenTraps.0 if value is
+ configured via the authtrapenable token
+
+2001-11-15 08:44 jbpn
+
+ * agent/: agent_read_config.c, agent_trap.c,
+ mibgroup/mibII/snmp_mib.c:
+
+ - make value of snmpEnableAuthenTraps.0 persistent. Setting via
+ a read-only configuration file also makes object notWritable (as
+ sysContact.0 et al.).
+
+2001-11-15 06:57 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - let VACM checks succeed for non-IPv4 transports
+
+2001-11-15 05:19 jbpn
+
+ * testing/tests/: T111agentxset, T121proxyset:
+
+ - use psyscontact not syscontact to set initial value of sysContact.0
+ object since the latter also makes the object read-only.
+
+2001-11-15 05:07 jbpn
+
+ * agent/: snmpd.c (V4-2-patches.6), snmpd.c:
+
+ - minor fix to formatting of usage message
+
+2001-11-15 04:05 jbpn
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ - add missing #include "snmpd.h" (for #definition of MASTER_AGENT)
+ - don't strdup() agentxsocket value -- ds_set_string does it for you
+ - change debugging to fit in better with rest of module
+
+2001-11-14 16:05 hardaker
+
+ * configure, configure.in (V4-2-patches.[7,7]), config.h.in
+, configure, configure.in:
+
+ patch from Harrie to fix init function checking in modules
+
+2001-11-14 16:00 hardaker
+
+ * agent/mibgroup/agentx/: agentx_config.c, agentx_config.h
+, master.c, master.h, subagent.h:
+
+ slightly modified patch from Harrie to move agentx configuration into
+ a separate file.
+
+2001-11-13 13:57 hardaker
+
+ * apps/notification_log.h:
+
+ file notification_log.h was initially added on branch NEW-AGENT-API.
+
+2001-11-13 13:57 hardaker
+
+ * apps/notification_log.c:
+
+ file notification_log.c was initially added on branch NEW-AGENT-API.
+
+2001-11-13 13:55 hardaker
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ file NET-SNMP-AGENT-MIB.txt was initially added on branch NEW-AGENT-API.
+
+2001-11-13 13:55 hardaker
+
+ * agent/mibgroup/agent/nsTransactionTable.c:
+
+ file nsTransactionTable.c was initially added on branch NEW-AGENT-API.
+
+2001-11-13 13:55 hardaker
+
+ * agent/mibgroup/agent/nsTransactionTable.h:
+
+ file nsTransactionTable.h was initially added on branch NEW-AGENT-API.
+
+2001-11-13 05:29 jbpn
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - patch from Jochen Kmietsch to quieten some noisy logging
+
+2001-11-13 04:13 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - use unregister_mib_table_row() when appropriate in
+ unregister_agentx_list().
+
+2001-11-13 03:23 jbpn
+
+ * agent/agent_registry.c:
+
+ - reset vr->namelen when we've finished with it
+
+2001-11-12 23:19 hardaker
+
+ * agent/helpers/all_helpers.c:
+
+ file all_helpers.c was initially added on branch NEW-AGENT-API.
+
+2001-11-12 23:19 hardaker
+
+ * agent/helpers/all_helpers.h:
+
+ file all_helpers.h was initially added on branch NEW-AGENT-API.
+
+2001-11-08 08:09 jbpn
+
+ * agent/agent_registry.c:
+
+ - better implementation of unregister_mib_table_row(), which uses
+ ranges properly in the callback (hence much more efficient for
+ AgentX).
+
+2001-11-07 09:56 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - remove now-redundant agentx_build functions
+
+2001-11-07 06:31 jbpn
+
+ * agent/mibgroup/agentx/: client.c, master_admin.c,
+ protocol.c:
+
+ - use DEBUGMSGOIDRANGE() in a couple of places for more comprehensive
+ debugging output.
+
+ - parse unregister ranges properly, and use the range properly for
+ passing to unregister_mib_context().
+
+2001-11-07 03:33 jbpn
+
+ * snmplib/: snmp_debug.c, snmp_debug.h:
+
+ - add DEBUGSMSGOIDRANGE() macro for debugging OID ranges
+
+2001-11-06 06:04 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - reset the inclusive flag in a couple of cases, to prevent spurious
+ INCLUSIVE getNext behaviour
+
+2001-11-05 08:09 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - correct bug in range_subid tweak code
+
+2001-11-05 05:00 jbpn
+
+ * agent/agent_registry.c:
+
+ - calculate upper bound for table row registrations slightly differently
+
+2001-11-01 09:35 jbpn
+
+ * agent/mibgroup/agentx/: master.c, protocol.c,
+ protocol.h, subagent.c:
+
+ - implement relocating buffer version of agentx_build() routines,
+ and use them.
+
+2001-11-01 09:33 jbpn
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - support for relocatable buffer build callbacks via open_ex calls
+
+2001-10-30 07:19 jbpn
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - fix bug whereby interface counter is not reset, noted by (amongst
+ others) Victor Kirhenshtein in patch #474064.
+
+2001-10-30 03:24 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - make the initial buffer size 2048 in snmp_resend_request (as in
+ _sess_async_send) to make success/fail behaviour for AgentX more
+ predictable (since AgentX STILL doesn't use relocating buffers,
+ boo hiss).
+
+2001-10-29 23:16 rstory
+
+ * local/mib2c.array-user.conf:
+
+ file mib2c.array-user.conf was initially added on branch NEW-AGENT-API.
+
+2001-10-29 23:16 rstory
+
+ * local/mib2c.array-auto.conf:
+
+ file mib2c.array-auto.conf was initially added on branch NEW-AGENT-API.
+
+2001-10-28 14:53 rstory
+
+ * agent/helpers/table_array.c:
+
+ file table_array.c was initially added on branch NEW-AGENT-API.
+
+2001-10-28 14:53 rstory
+
+ * agent/helpers/table_array.h:
+
+ file table_array.h was initially added on branch NEW-AGENT-API.
+
+2001-10-28 14:50 rstory
+
+ * snmplib/oid_array.h:
+
+ file oid_array.h was initially added on branch NEW-AGENT-API.
+
+2001-10-28 14:50 rstory
+
+ * snmplib/oid_array.c:
+
+ file oid_array.c was initially added on branch NEW-AGENT-API.
+
+2001-10-26 19:41 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ patch from Harrie to fix function name in error message
+
+2001-10-26 06:05 jbpn
+
+ * agent/mibgroup/mibII/: interfaces.c, interfaces.h:
+
+ - add support for rx and tx drop counts (ifInDiscards and
+ ifOutDiscards) for Linux (2.2+)
+
+2001-10-26 05:57 jbpn
+
+ * aclocal.m4:
+
+ - add if_iqdrops member to struct ifnet
+
+2001-10-26 04:03 jbpn
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - add translation for atm(37) type interfaces for Linux
+
+2001-10-26 03:43 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - document the fact that setting sysLocation.0 (et al.) via a
+ syslocation (or equivalent) token makes the object read-only,
+ returning a notWritable error response if an attempt is made to
+ SET it.
+
+2001-10-24 10:07 jbpn
+
+ * agent/mibgroup/mibII/: system_mib.c (V4-2-patches.4),
+ system_mib.c:
+
+ - fix typo noted by Tim Dietz
+
+2001-10-24 08:43 jbpn
+
+ * agent/mibgroup/mibII/: system_mib.c, system_mib.h:
+
+ - implement persistence for sysLocation.0, sysContact.0 and sysName.0
+
+ - presence of a syslocation token in snmpd.conf makes sysLocation.0
+ non-writable (returns notWritable on SET attempts)
+
+2001-10-24 05:08 jbpn
+
+ * agent/mibgroup/host/: hr_swinst.c (V4-2-patches.2), hr_swinst.c
+:
+
+ - fix small memory leak just introduced
+
+2001-10-24 03:42 jbpn
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ - use pkginfo interface to determine type of software package more
+ specifically if possible. Slight variation on patch #473669, submitted
+ by Stefan Radman.
+
+2001-10-24 03:38 jbpn
+
+ * acconfig.h, configure.in:
+
+ - autoconf support for detecting pkginfo interface in libadm. Thanks
+ to Stefan Radman (patch #473669).
+
+2001-10-21 07:26 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ file mib2c.iterate.conf was initially added on branch NEW-AGENT-API.
+
+2001-10-19 09:51 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ file mib2c.create-dataset.conf was initially added on branch NEW-AGENT-API.
+
+2001-10-17 07:52 dts12
+
+ * FAQ (V4-2-patches.2), FAQ:
+
+ Mention the MRTG tutorial web pages
+ (as suggested by Christian Robottom Reis)
+
+2001-10-15 06:49 jbpn
+
+ * snmplib/: snmpIPXDomain.c, snmpUDPDomain.c:
+
+ - zero socket address structures. Hopefully fixes problems on NetBSD
+ noted by Joakim Althini (related to sa_len member probably??).
+
+2001-10-11 16:30 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ snmplib/mib.c, snmplib/snmp_api.c:
+
+ Oppses.
+
+2001-10-11 14:15 hardaker
+
+ * man/Makefile.in, man/snmp_api_errstring.3,
+ man/snmp_config.5.def, man/snmp_error.3,
+ man/snmp_perror.3, man/snmp_sess_perror.3,
+ man/snmpcmd.1, man/snmpd.1.def, man/snmpd.conf.5.def
+, man/snmpset.1, man/snmptranslate.1,
+ man/snmptrapd.8, man/snmptrapd.conf.5.def,
+ man/snmpwalk.1, mibs/DISMAN-SCRIPT-MIB.txt,
+ mibs/IANAifType-MIB.txt, mibs/Makefile.mib,
+ mibs/README.mibs, mibs/SMUX-MIB.txt,
+ mibs/UCD-SNMP-MIB.txt, mibs/mibfetch, mibs/rfclist
+, mibs/smistrip, perl/SNMP/SNMP.xs,
+ snmplib/Makefile.in, snmplib/asn1.c,
+ snmplib/default_store.c, snmplib/int64.c,
+ snmplib/mib.c, snmplib/mib.h, snmplib/mt_support.c
+, snmplib/mt_support.h, snmplib/parse.c,
+ snmplib/scapi.c, snmplib/scapi.h, snmplib/snmp_api.c
+, snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_debug.c, snmplib/snmpusm.c,
+ snmplib/snmpv3.c, snmplib/system.c, snmplib/tools.c
+, snmplib/ucd-snmp-includes.h, testing/Makefile.in
+, win32/config.h, win32/config.h.borland:
+
+ massive merge from the patches branch to the main line.
+
+2001-10-11 14:01 hardaker
+
+ * COPYING, ChangeLog, FAQ, Makefile.in,
+ NEWS, README, acconfig.h, aclocal.m4,
+ config.guess, config.h.in, config.sub,
+ configure, configure.in, ltconfig, ltmain.sh
+, makefileindepend.pl, sedscript.in, version.h
+, agent/Makefile.in, agent/agent_index.c,
+ agent/agent_read_config.c, agent/agent_read_config.h,
+ agent/agent_registry.c, agent/agent_trap.c,
+ agent/snmp_agent.h, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmpd.c,
+ agent/mibgroup/Makefile.in, agent/mibgroup/kernel_sunos5.c
+, agent/mibgroup/mibincl.h, agent/mibgroup/ucd_snmp.h
+, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/at.h,
+ agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ipAddr.c,
+ agent/mibgroup/mibII/mta_sendmail.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/tcpTable.c
+, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/smux/smux.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/diskio.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.h,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.h,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.h,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c, apps/Makefile.in
+, apps/snmpdelta.c, apps/snmpdf.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, apps/snmptable.c,
+ apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c,
+ apps/snmptrapd_log.c, apps/snmpusm.c, apps/snmpvacm.c
+, apps/snmpwalk.c, apps/snmpnetstat/Makefile.in
+, local/mib2c.conf, local/mib2c.vartypes.conf,
+ local/pass_persisttest, local/tkmib:
+
+ massive merge from the patches branch to the main line.
+
+2001-10-09 07:14 hardaker
+
+ * CodingStyle:
+
+ Sometimes we feel like a -nut
+
+2001-10-09 06:15 jbpn
+
+ * agent/agent_registry.c:
+
+ - properly account for the length of the suffix in the variable
+ table in register_mib_table_row()
+
+2001-10-08 08:53 jbpn
+
+ * agent/mibgroup/agentx/client.c:
+
+ - declare version_sysoid_len as extern INT not extern oid, so as to
+ match its actual definition in sytem_mib.c. This caused all kinds of
+ fun & games on Linux on a Alpha.
+
+2001-10-04 08:31 jbpn
+
+ * snmplib/: callback.c, callback.h:
+
+ - add function snmp_callback_list() to return list of callbacks for a
+ given <major, minor> pair.
+
+2001-10-04 07:14 hardaker
+
+ * local/pass_persisttest:
+
+ file pass_persisttest was initially added on branch V4-2-patches.
+
+2001-10-03 05:42 jbpn
+
+ * snmplib/keytools.c:
+
+ - change expression at l. 415 from:
+
+ *kcstring++ = *kcstring ^ *newkey++;
+
+ which has undefined behaviour to:
+
+ *kcstring++ ^= *newkey++;
+
+ which is okay (since *kcstring is only evaluated once). Similarly
+ at l. 530. The previous constructs cause warnings with GCC3 and
+ some other compilers. Thanks to Niel Markwick who noted this in
+ bug #465969.
+
+2001-10-03 03:11 jbpn
+
+ * agent/agent_registry.c:
+
+ - do SNMPD_CALLBACK_UNREGISTER_OID callbacks in
+ unregister_mibs_by_session() -- called when AgentX subagents
+ disappear.
+
+2001-10-02 06:01 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - don't send ASN_PRIV_INCL_RANGE and ASN_PRIV_EXCL_RANGE on-the-wire
+
+2001-09-26 08:03 jbpn
+
+ * agent/agent_registry.c:
+
+ - allow split_subtree() to do a split in the middle of a column,
+ keeping the relevant variable in both the old tree and the new
+ tree (arises in AgentX row registrations).
+
+ - patch from Damian Gilmurray for register_mib_table_row() which
+ allows it to cope with non-zero length variables and also
+ non-contiguous OIDs for adjacent columns.
+
+ - rewritten dump_registry() that uses reallocating print functions
+ and also prints out variable lists.
+
+2001-09-26 07:45 jbpn
+
+ * agent/snmp_vars.c:
+
+ - allow for the possibility of subtree name being longer than
+ requested name when calculating the suffix for variable matching.
+
+ - be strict about subtree chunks being inclusive of the start OID
+ and exclusive of the end OID (shows up big time in AgentX).
+
+2001-09-26 07:22 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - don't do getNext requests on exclusive searchRanges that begin in
+ a tree marked as a fully-qualified instance (they are doomed to
+ fail). Skip to the next part of the tree straight away.
+
+2001-09-26 07:19 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - bring debugging tokens into line with rest of AgentX code
+
+2001-09-25 08:15 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - reinstate a missing space character
+
+2001-09-25 03:58 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - remove spurious cast
+
+2001-09-25 03:45 jbpn
+
+ * apps/snmptrapd.c:
+
+ - fix possible infelicity when printing and syslogging (not sure this is
+ actually possible but)
+
+2001-09-25 03:09 jbpn
+
+ * snmplib/mib.c:
+
+ - integrate some changes from the V4-2-patches branch: Harrie's
+ prototypes and Wes's fix for bug #463226.
+
+2001-09-25 03:01 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - fix signedness of time stuff
+
+2001-09-25 02:47 jbpn
+
+ * snmplib/: snmp_logging.c, snmp_logging.h:
+
+ - make argument of snmp_enable_syslog_ident const
+
+ - don't strdup DEFAULT_LOG_ID if a NULL arg is given
+
+2001-09-24 09:39 jbpn
+
+ * apps/snmptrapd.c:
+
+ - make use of rewritten output functions in snmptrapd_log.c which
+ avoid fixed length buffers.
+
+ - fix bug noted in support request #456646 (custom trap format was
+ being ignored for v2 traps and informs). Thanks to
+ G.Principato@motorola.com for spotting this one.
+
+ - correct usage for -P option to reflect that it causes output on
+ stderr not stdout.
+
+2001-09-24 09:36 jbpn
+
+ * apps/: snmptrapd_log.c, snmptrapd_log.h:
+
+ - rewrite of output functions to avoid use of fixed-length buffers
+
+2001-09-20 13:04 hardaker
+
+ * README, agent/mibgroup/ucd-snmp/logmatch.c,
+ agent/mibgroup/ucd-snmp/logmatch.h, mibs/UCD-SNMP-MIB.txt
+:
+
+ new logmatch mib from Stephan Wenzel.
+
+2001-09-15 08:40 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - override exclusive searchRange getNext operations when retrying
+ operations
+
+2001-09-15 08:39 jbpn
+
+ * agent/: snmp_agent.c, snmp_agent.h:
+
+ - improved support for AgentX-style inclusive searchRange getNext
+
+2001-09-14 14:43 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ patch #443115 from Yimin Ge: diskio support for freebsd4
+
+2001-09-14 14:34 hardaker
+
+ * apps/snmptrapd.c, snmplib/snmp_logging.c,
+ snmplib/snmp_logging.h:
+
+ Patch #440320 from Mark Ferlatte:
+
+ 1) Adds a new function to the snmp_logging API
+ (snmp_enable_syslog_ident(char *ident))
+
+ 2) Ports snmptrapd to use the existing snmp_logging API instead of
+ using syslog directly.
+
+ 3) Ports snmp_logging.[ch] to use the Win32 Event Log when compiled on
+ Win32. I didn't update the Visual C project files, because I only
+ have access to a newer version of VC, and I didn't know if you
+ wanted them updated. The advapi32 library needs to be added to the
+ project in order for this to work on Win32 (that's where the event
+ log API is).
+
+2001-09-14 14:22 hardaker
+
+ * config.h.in, configure:
+
+ I, uh, cough, uh forgot to run autoconf/autoheader. Dave: don't kill me.
+
+2001-09-14 14:19 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ Patch #428884: Add -PR like option to perl module (from Joe Clarke).
+
+2001-09-14 14:08 hardaker
+
+ * README, acconfig.h, configure.in,
+ agent/agent_trap.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpAAL5PVCDomain.h
+, snmplib/snmpUnixDomain.c, snmplib/snmpUnixDomain.h
+, snmplib/snmp_api.h, snmplib/snmpv3.c,
+ snmplib/asn1.h:
+
+ Applied a modified version of patch #427343 from Harrie:
+ make enterprise ID relocatable where legal to do so
+
+2001-09-14 12:09 hardaker
+
+ * agent/: Makefile.in, mibgroup/Makefile.in:
+
+ Alternative solution to patch #312694:
+ move date_n_time utilities to snmplib/snmp-tc.c.
+
+2001-09-14 12:08 hardaker
+
+ * agent/mibgroup/host/: hr_utils.c, hr_utils.h:
+
+ removed. Functionality moved to snmplib/snmp-tc.[ch]
+
+2001-09-14 12:06 hardaker
+
+ * agent/mibgroup/host.h, agent/mibgroup/host/hr_filesys.c
+, agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hr_system.h,
+ agent/mibgroup/host/hr_utils.c, snmplib/Makefile.in,
+ snmplib/snmp-tc.c, snmplib/snmp-tc.h:
+
+ Alternative solution to patch #312694:
+ move date_n_time utilities to snmplib/snmp-tc.c.
+
+2001-09-14 09:48 hardaker
+
+ * win32/config.h.borland:
+
+ file config.h.borland was initially added on branch V4-2-patches.
+
+2001-09-14 06:19 jbpn
+
+ * agent/mibgroup/agentx/: master.c, master_request.c,
+ master_request.h:
+
+ - use inclusive search range only when appropriate for getNext
+ queries
+
+2001-09-12 06:47 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ file snmpCallbackDomain.c was initially added on branch NEW-AGENT-API.
+
+2001-09-12 06:47 hardaker
+
+ * snmplib/snmpCallbackDomain.h:
+
+ file snmpCallbackDomain.h was initially added on branch NEW-AGENT-API.
+
+2001-09-06 07:40 jbpn
+
+ * agent/: snmp_agent.c, snmp_vars.c:
+
+ - if include bit is set in an AgentX SearchRange (hence type of varbind
+ is ASN_PRIV_INCL_RANGE), try an exact query first because an object
+ whose name is lexi-equal is a valid response; if exact query fails
+ then fall back to an inexact query.
+
+2001-09-06 07:38 jbpn
+
+ * agent/mibgroup/agentx/: master.c, master_request.c,
+ protocol.c, subagent.c:
+
+ - oops, used INCL/EXCL wrong way round in a couple of places
+
+ - better test for scoping requirements in subagent
+
+2001-09-04 07:14 jbpn
+
+ * agent/snmpd.c:
+
+ - add missing break; after processing -P option, noted by Botond
+ Tarnay (see patch #458327)
+
+2001-08-28 03:04 jbpn
+
+ * agent/: snmp_agent.c (V4-2-patches.7), snmp_agent.c:
+
+ - add missing #include <tcpd.h> if using libwrap, noted by Nathan
+ Neulinger (patch #453831).
+
+2001-08-28 02:38 jbpn
+
+ * agent/: snmpd.c (V4-2-patches.1), snmpd.c:
+
+ - avoid use of pre-processor directives inside printf() call, which
+ is a macro in glibc, making this an undefined behaviour
+ construct (which GCC 3.0 refuses to compile). See bug #455804 for
+ further details.
+
+2001-08-24 10:00 rstory
+
+ * snmplib/data_list.h:
+
+ file data_list.h was initially added on branch NEW-AGENT-API.
+
+2001-08-24 10:00 rstory
+
+ * snmplib/data_list.c:
+
+ file data_list.c was initially added on branch NEW-AGENT-API.
+
+2001-08-22 08:45 jbpn
+
+ * agent/: snmp_vars.c, mibgroup/agentx/master.c,
+ mibgroup/agentx/master_request.c, mibgroup/agentx/protocol.c
+, mibgroup/agentx/subagent.c:
+
+ - add checking that results to be returned to master agent are in
+ requested scope (if any) (getBulk not yet done)
+
+2001-08-15 09:31 jbpn
+
+ * snmplib/snmp_debug.c:
+
+ - use sprint_realloc_objid in debugmsg_oid to print long OIDs.
+
+2001-08-15 08:37 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - increment the value of snmpInBadCommunityUses when attempting an
+ operation not permitted by the given community, per RFC 1907.
+
+2001-08-15 08:34 jbpn
+
+ * agent/snmp_agent.c:
+
+ - when translating the v2+ error-status value authorizationError
+ into noSuchName for a v1 session, increment the value of
+ snmpInBadCommunityUses, per RFC 2576.
+
+2001-08-14 03:22 jbpn
+
+ * snmplib/snmp_client.c:
+
+ - in snmp_set_var_objid(), try to detect a previously-malloc()ed
+ buffer for the variable name, and free() it, to avoid memory
+ leaks.
+
+2001-08-13 03:47 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - use Win32 calls to change blocking state of sockets if
+ appropriate. Thanks to Joerg Mattes for help debugging this.
+
+2001-08-13 03:37 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - perform an SNMP_CALLBACK_OP_DISCONNECT and close the connection if
+ we get an error on a stream receive, as well as if it is closed in
+ an orderly fashion. This makes life easier on Win32 inparticular.
+ Thanks to Joerg Mattes for help with debugging this.
+
+2001-08-09 03:10 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ file table_dataset.c was initially added on branch NEW-AGENT-API.
+
+2001-08-09 03:10 hardaker
+
+ * agent/helpers/table_dataset.h:
+
+ file table_dataset.h was initially added on branch NEW-AGENT-API.
+
+2001-08-08 01:42 hardaker
+
+ * agent/helpers/table_data.c:
+
+ file table_data.c was initially added on branch NEW-AGENT-API.
+
+2001-08-08 01:42 hardaker
+
+ * agent/helpers/table_data.h:
+
+ file table_data.h was initially added on branch NEW-AGENT-API.
+
+2001-08-07 13:59 nba
+
+ * man/snmp_api_errstring.3:
+
+ file snmp_api_errstring.3 was initially added on branch V4-2-patches.
+
+2001-08-07 13:59 nba
+
+ * man/snmp_error.3:
+
+ file snmp_error.3 was initially added on branch V4-2-patches.
+
+2001-08-07 13:59 nba
+
+ * man/snmp_perror.3:
+
+ file snmp_perror.3 was initially added on branch V4-2-patches.
+
+2001-08-07 13:59 nba
+
+ * man/snmp_sess_perror.3:
+
+ file snmp_sess_perror.3 was initially added on branch V4-2-patches.
+
+2001-08-06 04:29 jbpn
+
+ * agent/snmpd.c:
+
+ - fix for potential buffer overflow in logfile argument handling,
+ noted by Anonymous (bug #448243). Also use a large enough buffer
+ to handle filenames of length PATH_MAX (if possible).
+
+2001-07-30 10:05 jbpn
+
+ * agent/mibgroup/mibII/var_route.c, snmplib/snmp_api.c
+, snmplib/snmp_api.h:
+
+ - move snmp_socket_length function to agent/mibgroup/mibII/var_route.c
+ from snmp_api.c -- this is the only remaining place that uses this
+ function, which certainly doesn't belong in snmp_api.c after the
+ transport abstraction malarkey.
+
+2001-07-30 09:22 hardaker
+
+ * agent/agent_handler.c:
+
+ file agent_handler.c was initially added on branch NEW-AGENT-API.
+
+2001-07-30 09:22 hardaker
+
+ * agent/agent_handler.h:
+
+ file agent_handler.h was initially added on branch NEW-AGENT-API.
+
+2001-07-30 07:06 jbpn
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ - try to return invalid(2) for the ipRouteType column if the route
+ is not up. See bug #426710, reported by pjweber.
+
+2001-07-27 07:32 jbpn
+
+ * snmplib/snmpv3.c:
+
+ - set defaultAuthType to usmHMACSHA1AuthProtocol if SHA specified
+ (was set to usmHMACMD5AuthProtocol in this case). Spotted by
+ William Kennemer (bug #444860)
+
+2001-07-27 06:59 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - change to handle_agentx_response ONLY to send NEWLY delegated
+ requests after processing a successful response. This is achieved
+ by saving the value of asp->outstanding_requests and temporarily
+ setting it to NULL. After processing all varbinds in the
+ response, therefore, asp->outstanding_requests contains only newly
+ delegated requests, if any. After sending these, the new requests
+ are merged with the saved queue.
+
+ This fixes a bug that arises if you request variables from two or
+ more separate subagents simultaneously. What used to happen is
+ that, upon receiving the first response, the master agent would
+ notice that it had an outstanding request, and retransmit it.
+ Then the second response arrives, and the master agent sends the
+ reply to the (SNMP) requester and frees the requests (including
+ callback data). Finally, another AgentX response (to the
+ erroneously transmitted request) arrives and the callback is
+ called referencing deallocated memory, which causes a segfault.
+
+2001-07-26 07:28 dts12
+
+ * snmplib/: snmp_api.c (NEW-LIBRARY-API.4), snmp_api.c:
+
+ Adding a 'double'-valued varbind isn't inherently an internal error!
+
+2001-07-25 05:47 jbpn
+
+ * agent/snmpd.c:
+
+ - disable stderr logging (if requested) before calling init_mib_modules().
+ This should fix the problem noted by Nigel Metheringham in bug #418857
+ whereby the AgentX master module prints a message to stderr which causes
+ a SIGPIPE when the agent is started as a daemon.
+
+2001-07-25 02:18 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - initialise buffers to zero in handle_wrap_fmt, to avoid garbage in
+ display of security parameters, as noted by William Frauenhofer
+ (bug #437231).
+
+ - add closing parenthesis after (via <address> in format_plain_trap
+
+2001-07-23 07:53 jbpn
+
+ * snmplib/tools.c:
+
+ - remove excessive debugging from snmp_(re)alloc functions
+
+2001-07-23 04:37 jbpn
+
+ * snmplib/snmpUnixDomain.c:
+
+ - minor fix to debugging output to print losing path correctly when
+ a remote connect fails.
+
+2001-07-17 09:56 hardaker
+
+ * CodingStyle:
+
+ update for naming conventions and for structure definitions.
+
+2001-07-17 09:07 hardaker
+
+ * CodingStyle:
+
+ initial coding style guideline document.
+
+2001-07-17 09:02 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - remember to remove_trap_session(our-session-with-master-agent)
+ if the master agent session goes away, because otherwise you
+ may subsequently try to use it, which will probably dump core,
+ and is certainly an error.
+
+ - also change when trap session is registered to being immediately
+ the session is opened so traps can be sent, e.g. from the
+ INDEX_START callback (for example linkUp traps in subagents that
+ register a row of ifTable).
+
+2001-07-17 08:48 jbpn
+
+ * agent/agent_trap.c:
+
+ - change to remove_trap_session(), so as not to close an SNMP
+ session simply because we are removing it from the trap_sink
+ list. The rationale is that the session may still be in use for
+ other purposes, or (more to the point) you may be calling this
+ function from the session's callback (from where closing the
+ session isn't a good idea).
+
+2001-07-13 06:02 dts12
+
+ * snmplib/netsnmp.h:
+
+ file netsnmp.h was initially added on branch NEW-LIBRARY-API.
+
+2001-07-12 12:09 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ file table_iterator.c was initially added on branch NEW-AGENT-API.
+
+2001-07-12 12:09 hardaker
+
+ * agent/helpers/table_iterator.h:
+
+ file table_iterator.h was initially added on branch NEW-AGENT-API.
+
+2001-07-12 02:21 jbpn
+
+ * agent/: snmp_agent.c, mibgroup/agentx/client.c,
+ mibgroup/agentx/master_request.c, mibgroup/agentx/protocol.c
+, mibgroup/agentx/subagent.c:
+
+ - fix for bug #439094, reported by Evert-Jan van Tuijl, whereby
+ the AgentX master agent expects a response to an agentx-CleanupSet-PDU
+ message (incorrectly). This only shows up when testing against other
+ subagents (e.g. jax) because the net-snmp subagent sends a response
+ to the agentx-CleanupSet-PDU (incorrectly).
+
+2001-07-10 16:10 hardaker
+
+ * agent/mibgroup/mibII/vacm_context.c:
+
+ file vacm_context.c was initially added on branch NEW-AGENT-API.
+
+2001-07-10 16:10 hardaker
+
+ * agent/mibgroup/mibII/vacm_context.h:
+
+ file vacm_context.h was initially added on branch NEW-AGENT-API.
+
+2001-07-10 16:06 hardaker
+
+ * agent/mibgroup/target/target_counters.h:
+
+ file target_counters.h was initially added on branch NEW-AGENT-API.
+
+2001-07-10 16:06 hardaker
+
+ * agent/mibgroup/target/target_counters.c:
+
+ file target_counters.c was initially added on branch NEW-AGENT-API.
+
+2001-07-05 06:11 jbpn
+
+ * agent/mibgroup/mibII/: interfaces.c, interfaces.h:
+
+ - make Interface_Scan_Get_Count non-static as it's very useful
+
+2001-07-05 03:40 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - free the cached security parameters when we have a parse error
+ on input, otherwise we leak memory (triggered by SC 3.0.13.{2,3}).
+
+2001-07-04 09:51 uid44810
+
+ * snmplib/snmp_api.c:
+
+ - catch some malformed SNMPv3 packets
+
+2001-07-04 07:42 uid44810
+
+ * snmplib/snmp_api.c:
+
+ - fix bad mistake in snmpv3_scopedPDU_header_realloc_rbuild which
+ was encoding the wrong length into the ScopedPDU SEQUENCE header
+ (wasn't including length of actual data, i.e. PDU!). Totally my
+ fault -- introduced when changing over to reallocating buffer
+ type functions. Amazing this hasn't caused all sorts of trouble
+ for people!
+
+2001-07-02 18:04 rstory
+
+ * snmplib/snmp-tc.c:
+
+ file snmp-tc.c was initially added on branch NEW-AGENT-API.
+
+2001-07-02 09:33 jbpn
+
+ * agent/snmp_agent.c:
+
+ - slight change to generation of error-index:
+
+ - explicitly test for error-status == noError, and set error-index
+ to zero in this case;
+
+ - otherwise use the cached value;
+
+ - don't zero the cached value in handle_var_list if handle_one_var
+ returns noError
+
+ - this copes properly with SET requests, where a failing SET will have
+ a FREE phase which will typically return noError. Previously this
+ would erroneously cause the error-index to be set to zero.
+
+2001-07-02 08:14 jbpn
+
+ * agent/mibgroup/util_funcs.c:
+
+ - fix bad behaviour in header_simple_table when the index is
+ equal to ULONG_MAX
+
+2001-06-28 10:01 jbpn
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ - change sense of snmp_oid_compare() result check in var_usmUser
+ to do lexi-ordering correctly
+
+2001-06-28 07:20 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - count more v1/v2c parse errors (SC 1.1.12.10)
+
+2001-06-28 05:56 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - check that version field of PDU is of integer type rather than just
+ assuming it is (SC 1.1.12.2.1)
+
+2001-06-28 04:40 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - increment snmpInBadCommunityNames when we see unknown community
+ names, per RFC1907
+
+2001-06-27 08:09 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - make use of new function register_mib_detach() to mark all our
+ nodes as detached when we get a transport disconnect indication.
+
+2001-06-27 08:07 jbpn
+
+ * agent/: agent_registry.c, agent_registry.h,
+ var_struct.h:
+
+ - add additional flag to subtree structure that subagents can use
+ to determine whether an attempt has been made to register and OID
+ with a master agent during a session's lifetime. This allows
+ manual re-registration and automatic re-registration to be mixed
+ within a subagent (perhaps because you are doing index stuff).
+
+ - add function register_mib_detach() which unsets this flag for
+ all known nodes (subagent would typically call this on disconnect
+ indication).
+
+ - add function unregister_mib_table_row()
+
+ - correct bad recursive behaviour in register_mib_reattach() which
+ used to try to re-register N nodes N! times. Once will normally
+ be enough.
+
+ - change to dump_registry() format to include hex display of
+ flags field.
+
+2001-06-26 09:26 dts12
+
+ * FAQ:
+
+ Fix error in SNMPv2 trap examples (Identified by Diwakar Shetty).
+
+2001-06-26 02:35 jbpn
+
+ * snmplib/mib.c:
+
+ - corrected sense of dump_realloc_oid_to_string() return value
+ checks, as spotted by Robert Story.
+
+2001-06-25 06:30 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - small tweak in handle_agentx_response() when retrying unfulfilled
+ requests: continue from the "start" OID of the next node of the
+ tree, not from the "name" OID, which causes looping.
+
+2001-06-21 09:51 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - handle "holes" in rows of tables that are handled by subagents
+
+ Since the fully-qualified instance is registered, we interpret
+ a return of noSuchInstance when doing an inexact query as meaning
+ we should retry the query.
+
+2001-06-21 02:50 jbpn
+
+ * snmplib/mib.h:
+
+ - forgot to commit at the same time as last mib.c commit; updated
+ prototype for sprint_realloc_hinted_integer
+
+2001-06-20 06:44 jbpn
+
+ * agent/: agent_index.c, agent_index.h:
+
+ - add function count_indexes which returns the number of indexes
+ allocated for a given OID. This can be useful for implementing
+ "row count" objects, e.g. ifNumber.
+
+2001-06-20 05:37 jbpn
+
+ * agent/: agent_callbacks.h, mibgroup/agentx/subagent.c
+:
+
+ - add SNMPD_CALLBACK_INDEX_START and SNMPD_CALLBACK_INDEX_STOP
+ callbacks which may be used to manage index allocations.
+
+ Master agent should probably call these callbacks too, although
+ it's a bit of a degenerate case.
+
+2001-06-19 09:44 jbpn
+
+ * agent/agent_index.c:
+
+ - use an explicit fieled "allocated" in snmp_index structure to
+ indicate whether or not a value is currently allocated, rather
+ than overloading a NULL session to mean that it is not.
+
+ This allows startup code in a master agent to pre-register indices
+ when there are no sessions open.
+
+2001-06-19 08:34 jbpn
+
+ * agent/mibgroup/agentx/: master_admin.c, master_request.c
+:
+
+ - keep the value of NETWORK_BYTE_ORDER from h.flags in the
+ agentx-Open-PDU and use it for subsequent master-initiated
+ AgentX protocol operations, per RFC 2741 (section 7.1.1,
+ paragraph 4).
+
+ For now, we are storing this in the flags field of a
+ subsession. This is likely to stop working if the flags
+ definitions change (i.e. it's not a great solution)
+
+ - Thanks to Peter Korsten (severityone at users.sourceforge.net)
+ for identifying this bug, and for help debugging this fix.
+
+2001-06-19 02:35 jbpn
+
+ * snmplib/mib.c:
+
+ - reinstate space between numbers and units.
+
+ - respect DISPLAY-HINTs for Unsigned32, Gauge, Gauge32 types.
+
+2001-06-13 03:29 jbpn
+
+ * agent/snmp_vars.c:
+
+ - minor change to debugging to reduce "noise level" from Purify
+
+2001-06-12 10:35 jbpn
+
+ * agent/snmp_agent.c:
+
+ - handle non-repeaters and max-repetitions field values of < 0 (by
+ setting them to 0, per RFC 1905)
+
+2001-06-12 10:05 jbpn
+
+ * agent/snmp_agent.c:
+
+ - fix bug that caused a null pointer to be followed when processing a
+ GETBULK request with non-repeaters > 0, max-repetitions == 0 and no
+ varbinds in the request.
+
+2001-06-12 07:24 dts12
+
+ * snmplib/: read_config.c (V4-2-patches.1), read_config.c:
+
+ Fix 'unregister_config_handler' to handle tags other
+ than the first in the list. (Thanks to Paul Serice).
+
+2001-06-06 07:39 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - free() return value from register_index() calls
+
+2001-06-06 07:37 jbpn
+
+ * agent/agent_index.c:
+
+ - more uniform return value from register_index(): make it always a
+ varbind which the caller is responsible for free()ing, or else NULL.
+
+2001-06-05 03:10 jbpn
+
+ * agent/agent_index.c:
+
+ - fix for index allocation, such that requests for specific indices which
+ have previously been allocated, but are not currently in use, succeed.
+
+ - more debugging output.
+
+2001-06-01 08:37 hardaker
+
+ * agent/mibgroup/testhandler.c:
+
+ file testhandler.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:37 hardaker
+
+ * agent/mibgroup/testdelayed.c:
+
+ file testdelayed.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:37 hardaker
+
+ * agent/mibgroup/testdelayed.h:
+
+ file testdelayed.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:37 hardaker
+
+ * agent/mibgroup/testhandler.h:
+
+ file testhandler.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/multiplexer.h:
+
+ file multiplexer.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/instance.c:
+
+ file instance.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/null.h:
+
+ file null.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/read_only.h:
+
+ file read_only.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/.cvsignore:
+
+ file .cvsignore was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/multiplexer.c:
+
+ file multiplexer.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/serialize.c:
+
+ file serialize.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/table.h:
+
+ file table.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/instance.h:
+
+ file instance.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/table.c:
+
+ file table.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/serialize.h:
+
+ file serialize.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/set_helper.h:
+
+ file set_helper.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/null.c:
+
+ file null.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/Makefile.in:
+
+ file Makefile.in was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/old_api.h:
+
+ file old_api.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/read_only.c:
+
+ file read_only.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/old_api.c:
+
+ file old_api.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 07:39 hardaker
+
+ * local/tkmib:
+
+ misc fixes for oid formatting problems.
+
+2001-06-01 07:37 hardaker
+
+ * README:
+
+ add Martin Oldfield.
+
+2001-06-01 02:50 jbpn
+
+ * agent/: snmp_agent.c, snmp_agent.h,
+ mibgroup/agentx/master_request.c:
+
+ - fix for absolutely mind-bending memory leak when AgentX sessions
+ timeout. agent_session_list holds a queue of sessions with outstanding
+ requests. When a session times out, this must be scavenged to make
+ sure the sessions that have timed out, and their associated requests
+ are free()d.
+
+2001-05-30 03:28 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - retry initial open of AgentX master socket if AgentX pings are
+ enabled (should really be a separate default_store option but
+ never mind)
+
+2001-05-30 03:27 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - more aggressive handling of timeout conditions (also fix memory
+ leak)
+
+2001-05-30 03:19 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - more informative debugging
+
+2001-05-30 02:37 jbpn
+
+ * snmplib/snmp_alarm.c:
+
+ - remove noisy debugging
+
+2001-05-30 02:37 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - more compact debugging in _sess_select_info
+
+2001-05-30 02:34 jbpn
+
+ * agent/agent_registry.c:
+
+ - copy flags in reattach_subtree (needed for AgentX row registration)
+
+2001-05-28 08:54 jbpn
+
+ * agent/mibgroup/agentx/: client.c, client.h,
+ master_admin.c, master_request.c, subagent.c:
+
+ - stuff from patch #416026 (submitted by anonymous) for AgentX row
+ registration
+
+2001-05-28 08:49 jbpn
+
+ * agent/snmp_vars.c:
+
+ - tweak to getStatPtr to handle getNext operations in combination with
+ FULLY_QUALIFIED_INSTANCE nodes (which arise in AgentX row registration).
+
+2001-05-28 08:46 jbpn
+
+ * agent/: agent_registry.c, agent_registry.h,
+ var_struct.h:
+
+ - stuff from patch #416026 (submitted by anonymous) for AgentX row
+ registration
+
+2001-05-28 08:42 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - small tweak to debugging output
+
+2001-05-28 08:39 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - do parsing/building of ASN_PRIV_EXCL_RANGE and
+ ASN_PRIV_INCL_RANGE types *properly*.
+
+2001-05-28 04:40 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - fix possible memory leak in _sess_async_send error cases
+
+2001-05-28 04:27 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - add parsing/building of ASN_PRIV_EXCL_RANGE and
+ ASN_PRIV_INCL_RANGE types.
+
+2001-05-23 09:20 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - respect msgMaxSize in received v3 PDUs (in the weak sense that if
+ the serialized response PDU is more than it, we don't send it)
+
+ - removed functions ascii_to_binary, hex_to_binary. Using these
+ functions is really bad, since they will happily overflow buffers.
+ The superior alternatives, defined in tools.h, are
+ snmp_{decimal, hex}_to_binary.
+
+2001-05-23 09:00 jbpn
+
+ * apps/snmpstatus.c:
+
+ - remove unused variable struct sockaddr_in respIp
+
+2001-05-23 08:58 jbpn
+
+ * agent/snmp_agent.c:
+
+ - early bail out of handle_snmp_packet() if the callback operation
+ type is not SNMP_CALLBACK_OP_RECEIVED_MESSAGE. In practice, the
+ only way this arises currently is when a stream transport based
+ connection goes away and a SNMP_CALLBACK_OP_DISCONNECT occurs.
+
+2001-05-23 08:44 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - new fields rcvMsgMaxSize and sndMsgMaxSize in snmp_session
+ structure to support v3 msgMaxSize
+
+ - removed functions ascii_to_binary, hex_to_binary from public
+ interface. Using these functions is really bad, since they
+ will happily overflow buffers. The superior alternatives,
+ defined in tools.h, are snmp_{decimal, hex}_to_binary.
+
+2001-05-23 08:37 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c, snmpIPXDomain.c,
+ snmpTCPDomain.c, snmpUDPDomain.c, snmpUnixDomain.c
+, snmp_transport.c, snmp_transport.h:
+
+ - add msgMaxSize field to snmp_transport structure to support
+ msgMaxSize negotiation for v3
+
+2001-05-23 07:14 jbpn
+
+ * snmplib/scapi.c:
+
+ - use sprint_realloc_hexstring instead of sprint_hexstring for
+ SNMP_TESTING_CODE debugging output of IV, key and plaintext
+
+2001-05-23 05:25 jbpn
+
+ * apps/snmptest.c:
+
+ - free() buffers in a couple of error cases; no big deal
+
+2001-05-23 04:39 jbpn
+
+ * snmplib/snmpv3.c:
+
+ - use new snmp_hex_to_binary function for engine ID parsing in -e
+ option, rather than archaic hex_to_binary
+
+2001-05-23 04:22 jbpn
+
+ * snmplib/snmp_parse_args.c:
+
+ - free() buffers in a couple of error cases; no big deal
+
+2001-05-23 04:14 jbpn
+
+ * snmplib/snmp_parse_args.c:
+
+ - use new snmp_hex_to_binary function for engine ID parsing in -e
+ and -E options, rather than archaic hex_to_binary
+
+2001-05-23 03:56 jbpn
+
+ * apps/snmptest.c:
+
+ - use new snmp_{decimal, hex}_to_binary functions for input string
+ to OCTET STRING conversion, rather than archaic ascii_to_binary
+ and hex_to_binary
+
+ - omit trailing newline from string (helpful for objects that don't
+ allow non-printing characters, e.g. sysLocation.0)
+
+2001-05-20 08:12 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - rewritten _sess_read() function:
+
+ - better handling of long packets
+ - zero-copy reception of packets on stream transports
+ - lower memory overheads for packet fragment handling for stream
+ transports
+
+ - allow parsing of large objects (>8192 octets)
+
+2001-05-20 05:48 jbpn
+
+ * snmplib/snmp_parse_args.c:
+
+ - don't strdup() contextName, securityName -- causes minor memory
+ leak.
+
+2001-05-20 05:04 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - test return of fcntl(F_GETFL), so as not to set flags to garbage
+
+ - correction to comment -- set socket to *blocking*!
+
+ - check opaque before writing to it in recv
+
+2001-05-20 05:02 jbpn
+
+ * snmplib/snmp_client.c:
+
+ - proper handling of SNMP_CALLBACK_OP_DISCONNECT in snmp_synch_input:
+ set an error condition, with errno SNMPERR_ABORT ("Session abort
+ failure"), which seems like a good enough match.
+
+2001-05-18 09:54 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - make newly-accept()ed sockets blocking; otherwise problems arise
+ later when send()ing large PDUs (since only a single socket buffer's
+ worth of data at most can be sent without blocking).
+
+2001-05-18 07:17 jbpn
+
+ * agent/snmp_agent.c:
+
+ - use sprint_realloc_objid and sprint_realloc_variable instead of
+ sprint_objid and sprint_variable respectively, to allow large PDUs
+ to be printed when debugging
+
+2001-05-18 07:16 jbpn
+
+ * snmplib/tools.c:
+
+ - improved debugging output from snmp_realloc()
+
+2001-05-18 07:15 jbpn
+
+ * snmplib/: mib.c, mib.h:
+
+ - remove debugging from output routines
+
+ - new function sprint_realloc_objid
+
+ - make sprint_realloc_objid and sprint_realloc_variable externally
+ visible
+
+2001-05-18 06:28 jbpn
+
+ * snmplib/asn1.c:
+
+ - improved debugging output from asn_realloc()
+
+2001-05-15 04:10 jbpn
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - add OIDs for UDP/IPv6 and TCP/IPv6
+
+2001-05-14 02:20 jbpn
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - added \n to text of snmp_log() messages (bug #422978)
+
+2001-05-11 07:30 jbpn
+
+ * snmplib/: mib.c, mib.h:
+
+ - added sprint_realloc_<type> family of functions which take extra
+ parameters and use relocating buffers to remove limitations due to
+ fixed-size buffers (e.g. see bug #409181).
+
+ - also fixes potential problem noted as bug #414803
+
+ - fprint_variable, fprint_objid and fprint_value use new functions
+ such that snmpget etc. are improved immediately
+
+ - old functions remain *FOR NOW* -- but really they should be
+ considered to be deprecated (new functions provide a superset of
+ their functionality).
+
+2001-05-11 07:14 jbpn
+
+ * snmplib/parse.h:
+
+ - added additional function pointer to struct tree to point at
+ relocating buffer compatible output function
+
+2001-05-11 06:57 jbpn
+
+ * snmplib/: tools.c, tools.h:
+
+ - added utility function snmp_strcat, which appends a string to a
+ relocatable buffer
+
+2001-05-10 11:20 rstory
+
+ * snmplib/mib.c:
+
+ fix bug #423109 incorrect index parsing
+
+2001-05-09 16:43 rstory
+
+ * snmplib/snmp_client.c:
+
+ fix snmp_client.c:569: warning: control reaches end of non-void function
+
+2001-05-09 12:36 slif
+
+ * agent/mibgroup/: Rmon.h, Rmon/README, Rmon/agutil.c
+, Rmon/agutil.h, Rmon/agutil_api.h, Rmon/alarm.c
+, Rmon/alarm.h, Rmon/event.c, Rmon/event.h,
+ Rmon/history.c, Rmon/history.h, Rmon/row_api.h,
+ Rmon/rows.c, Rmon/rows.h, Rmon/statistics.c,
+ Rmon/statistics.h, Rmon/test_alarm.sh,
+ Rmon/test_hist.sh:
+
+ Include Alex Rozin's Rmon.
+
+2001-05-07 10:41 hardaker
+
+ * snmplib/: snmp_client.c, snmp_client.h:
+
+ Added a couple of convenience functions for manipulating varbindlists:
+ int snmp_set_var_typed_value(struct variable_list *newvar, u_char type,
+ u_char *val_str, size_t val_len);
+ void snmp_replace_var_types(struct variable_list *vbl, int old_type,
+ int new_type);
+ void snmp_reset_var_types(struct variable_list *vbl, int new_type);
+
+2001-05-07 10:36 hardaker
+
+ * snmplib/tools.h:
+
+ define SNMP_MALLOC_TYPEDEF()
+
+2001-05-05 07:28 rstory
+
+ * local/mib2c.storage.conf:
+
+ fix store_ name; don't cast to asny type if parm expecting u_char*; fix _variable_oid
+ naming; cast parm 2 of memdup to u_char*
+
+2001-05-03 14:16 hardaker
+
+ * snmplib/asn1.c:
+
+ fixed rauth offset incrementing: was incrementing the pointer, not the value.
+ -- more instances of the same problem found.
+
+2001-05-03 14:15 hardaker
+
+ * snmplib/asn1.c:
+
+ fixed rauth offset incrementing: was incrementing the pointer, not the value.
+
+2001-05-03 10:08 hardaker
+
+ * aclocal.m4, config.guess, config.sub,
+ configure, ltmain.sh:
+
+ updated to libtool 1.4
+
+2001-05-01 13:31 hardaker
+
+ * snmplib/snmpksm.c:
+
+ use realloc routines.
+
+2001-05-01 13:31 hardaker
+
+ * snmplib/read_config.c:
+
+ fix variable declaration.
+
+2001-05-01 13:30 hardaker
+
+ * snmplib/mib.c:
+
+ Don't print hex for string lengths less than 4. Should have died ages ago.
+
+2001-05-01 13:29 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.h:
+
+ Fix prototype so its not static (it shouldn't be).
+
+2001-05-01 13:29 hardaker
+
+ * agent/mibgroup/mibII/ip.c:
+
+ make RONLY variables writable (which may or may not work. I'm betting not.)
+
+2001-05-01 13:28 hardaker
+
+ * agent/snmp_agent.c:
+
+ remove unused variables.
+
+2001-05-01 13:28 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ check for an rpm subdirectory.
+
+2001-04-23 20:41 hardaker
+
+ * local/tkmib:
+
+ big cleanup and other fixes I've already forgotten in the last few minutes.
+
+2001-04-23 20:34 hardaker
+
+ * local/tkmib:
+
+ Don't walk off end of mib tree (sigh).
+
+2001-04-23 20:19 hardaker
+
+ * local/tkmib:
+
+ fix the mib info display options.
+ save them appropriately.
+
+2001-04-23 18:23 hardaker
+
+ * local/tkmib:
+
+ more savable option items.
+ use Data::Dumper to save most stuff.
+
+2001-04-23 17:26 hardaker
+
+ * local/tkmib:
+
+ Don't save session options twice.
+ Make color of writable objects a variable.
+
+2001-04-23 17:08 hardaker
+
+ * local/: tkmib (V4-2-patches.2), tkmib:
+
+ fix walk problem once and for all.
+
+2001-04-23 16:36 hardaker
+
+ * local/tkmib:
+
+ reduce screen realestate all over the place
+
+2001-04-23 16:35 hardaker
+
+ * local/tkmib:
+
+ test against version 5
+
+2001-04-18 08:46 hardaker
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c,
+ agent/mibgroup/ucd-snmp/lmSensors.h, mibs/LM-SENSORS-MIB.txt
+, mibs/UCD-SNMP-MIB.txt:
+
+ Added LM-SENSORS-MIB support (diskio extension) from Martin Oldfield
+
+2001-04-18 05:40 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - hacking on snmp_add_var to handle long values
+
+ - use snmp_{hex,decimal}_to_binary instead of hex_to_binary
+ and ascii_to_binary; these should be removed
+
+ - don't use strtok in processing bitstrings
+
+2001-04-18 04:58 jbpn
+
+ * snmplib/asn1.c:
+
+ - use the generic snmp_realloc function in asn_realloc
+
+2001-04-18 02:40 jbpn
+
+ * snmplib/: tools.c, tools.h:
+
+ - new, reallocating utility functions snmp_hex_to_binary and
+ snmp_decimal_to_binary to convert hex and decimal strings to octet
+ strings respectively.
+
+ - new utility function snmp_realloc to perform buffer (re-)allocation
+
+2001-04-12 05:12 dts12
+
+ * agent/: snmp_agent.c (V4-2-patches.6), snmp_agent.c:
+
+ Better fix for bug #414855 from arajesh
+ Handles non-repeaters=0 as well, and avoids memory leaks.
+
+2001-04-11 10:06 jbpn
+
+ * snmplib/asn1.h:
+
+ - second incarnation of asn_realloc_rbuild_<type> functions, which
+ now take an additional argument that may be used to indicate that
+ reallocation should not be done.
+
+ - old _rbuild API is gone.
+
+ - extended (and corrected!) commentary on correct usage of new API.
+
+2001-04-11 10:05 jbpn
+
+ * snmplib/: snmp.c, snmp.h:
+
+ - use second incarnation of _realloc_rbuild functions.
+
+ - old _rbuild_var_op API is gone.
+
+2001-04-11 10:04 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - use second incarnation of asn_realloc_rbuild_<type> functions.
+
+2001-04-11 10:03 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - use second incarnation of _realloc_rbuild functions.
+
+ - old _rbuild API is gone.
+
+2001-04-11 10:02 jbpn
+
+ * snmplib/asn1.c:
+
+ - second incarnation of asn_realloc_rbuild_<type> functions, which
+ now take an additional argument that may be used to indicate that
+ reallocation should not be done.
+
+ - old _rbuild API is gone.
+
+ - asn_realloc() function checks whether it has been passed a NULL
+ pointer and uses malloc() in that case (thanks to Michael Slifcak
+ for pointing out the danger here).
+
+2001-04-11 06:13 dts12
+
+ * agent/snmp_agent.c:
+
+ Handle GetBulk requests with max-repetitions=0 properly (bug #414855)
+
+2001-04-10 04:47 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ - set SO_SNDBUF and SO_RCVBUF to 128Kb for newly-opened UDP sockets,
+ to enable large PDUs to be sent and received. Some
+ implementations default very low (Solaris 2.7 8Kb, Linux 2.4
+ 64Kb).
+
+2001-04-09 10:05 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - modified usm_rgenerate_out_msg() to make use of reallocating
+ reverse encode functions.
+
+2001-04-09 10:03 jbpn
+
+ * snmplib/snmpusm.h:
+
+ - additional parameter to usm_rgenerate_out_msg() to enable use of
+ reallocating reverse encode functions.
+
+2001-04-09 09:57 jbpn
+
+ * snmplib/snmp_secmod.h:
+
+ - allow additional parameter for outgoing params to enable use of
+ reallocating reverse encode functions.
+
+2001-04-09 09:55 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - prototypes for reallocating reverse encode functions
+
+2001-04-09 09:54 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - modified to use reallocating reverse ASN.1 encoder functions if
+ using reverse encoding at all.
+
+2001-04-09 09:49 jbpn
+
+ * snmplib/snmp.c:
+
+ - add new function snmp_realloc_rbuild_var_op() which uses
+ reallocating reverse ASN.1 encoder functions to encode varbinds.
+
+2001-04-09 09:47 jbpn
+
+ * snmplib/asn1.h:
+
+ - prototype for new suite of functions asn_realloc_rebuild_<type>,
+ which perform reverse encoding into a buffer and grow it if there
+ is not enough space for the encoding.
+
+ - commentary on correct usage of above.
+
+2001-04-09 09:43 jbpn
+
+ * snmplib/asn1.c:
+
+ - new suite of functions asn_realloc_rebuild_<type>, which perform
+ reverse encoding into a buffer and grow it if there is not enough
+ space for the encoding.
+
+2001-04-06 12:12 hardaker
+
+ * AGENT.txt, COPYING, ChangeLog,
+ EXAMPLE.conf.def, FAQ, NEWS, PORTING,
+ README, README.agentx, README.snmpv3, configure
+, configure.in, sedscript.in, version.h
+, agent/agent_trap.c, agent/ds_agent.h,
+ agent/snmp_agent.c, agent/snmpd.c,
+ agent/mibgroup/ucd_snmp.h, agent/mibgroup/util_funcs.c
+, agent/mibgroup/agentx/README.agentx,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master.h,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_utils.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/at.h,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c, apps/snmpdelta.c
+, apps/snmptest.c, apps/snmptrapd.c,
+ local/Makefile.in, local/mib2c, local/snmpconf
+, local/tkmib, local/wesrestart, man/snmpcmd.1
+, man/snmpd.conf.5.def, man/snmpdelta.1,
+ mibs/rfclist, mibs/rfcmibs.diff, snmplib/mib.c,
+ snmplib/parse.c, snmplib/snmp_api.c,
+ snmplib/snmp_debug.c, snmplib/snmpusm.c,
+ testing/eval_tools.sh, testing/tests/T120proxyget:
+
+ merge3 -> merge4. I don't *think* I broke anything.
+ - The main line should now contain all the 4.2.1 patches.
+ - I may double check this at a later date.
+
+2001-04-05 06:37 dts12
+
+ * snmplib/parse.c:
+
+ Change 'Line' variable name, to assist with Mac port.
+
+2001-04-05 06:14 dts12
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ Handle setting null string values via the 'pass' mechanism. (Support#406728)
+ Also handle embedded whitespace in such values.
+ Also applied to 'pass_persist'.
+
+2001-04-05 06:07 dts12
+
+ * agent/: agent_registry.c, agent_trap.c, kernel.c
+, mib_modules.c, snmp_agent.c, snmp_agent.h
+, snmp_vars.c, mibgroup/util_funcs.c,
+ mibgroup/agentx/master_admin.c, mibgroup/agentx/protocol.c
+, mibgroup/host/hr_disk.c, mibgroup/host/hr_network.c
+, mibgroup/host/hr_print.c, mibgroup/host/hr_proc.c
+, mibgroup/host/hr_system.c, mibgroup/host/hr_utils.c
+, mibgroup/mibII/vacm_vars.c,
+ mibgroup/mibII/var_route.c,
+ mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ mibgroup/notification/snmpNotifyFilterTable.c,
+ mibgroup/notification/snmpNotifyTable.c,
+ mibgroup/target/snmpTargetAddrEntry.c,
+ mibgroup/target/target.c, mibgroup/ucd-snmp/file.c,
+ mibgroup/ucd-snmp/hpux.c, mibgroup/ucd-snmp/proxy.c,
+ mibgroup/ucd-snmp/registry.c,
+ mibgroup/ucd-snmp/versioninfo.c:
+
+ Keep one of the pickier compilers (HP's aCC) happy.
+
+2001-04-05 06:06 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Ensure that checking for 'statvfs' is done consistently
+
+2001-04-05 06:05 dts12
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ ensure that 'exec_command' is used consistently with the availability of execv
+ (A cleaner approach than the previous patch)
+
+2001-04-05 06:01 dts12
+
+ * agent/: auto_nlist.c, auto_nlist.h:
+
+ fix for auto_nlist bogus definitions for machines without nlist.
+
+2001-04-05 04:51 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - save a strcpy() and allow long octet string values without crashing
+ (though there are still problems due to the liberal use of fixed
+ size buffers with no bounds checking all over the place. Sigh).
+
+2001-04-04 06:46 jbpn
+
+ * agent/snmpd.c:
+
+ - call external signal handlers before calling snmp_select_info(),
+ rather than after calling snmp_select_info() but before select().
+ This fixes a potential problem that could arise if a signal handler
+ closed a session, which would cause select() to return -1 with
+ EBADF, and thus terminate the agent.
+
+2001-04-03 09:31 dts12
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ Ensure that the 'extmp' command variable is accessible on systems without EXECV.
+
+2001-04-03 09:29 dts12
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Keep one of the pickier compilers (HP's aCC) happy.
+
+2001-04-03 09:22 dts12
+
+ * apps/: snmptrapd.c, snmptrapd_log.c:
+
+ Keep one of the pickier compilers (HP's aCC) happy.
+
+2001-04-03 09:15 dts12
+
+ * snmplib/: mib.c, read_config.c, snmpTCPDomain.h
+, snmpUDPDomain.c, snmpUnixDomain.c,
+ snmpUnixDomain.h, snmp_api.c, snmp_logging.c,
+ snmp_transport.c, snmp_transport.h, system.c:
+
+ Keep one of the pickier compilers (HP's aCC) happy.
+
+2001-04-03 06:30 dts12
+
+ * agent/mibgroup/mibII/kernel_linux.c:
+
+ Plug file-descriptor leak when using cached data. (Bug#412000)
+
+2001-04-02 10:11 jbpn
+
+ * agent/snmp_agent.c:
+
+ - check for limits.h properly
+
+2001-04-02 10:10 jbpn
+
+ * man/snmp_agent_api.3:
+
+ - minor typeface changes
+
+2001-03-31 06:27 jbpn
+
+ * man/snmp_agent_api.3:
+
+ - update documentation of agent_check_and_process to reflect
+ current behaviour
+
+ ** NOTE: currently returns control to user when an alarms runs **
+ ** **
+ ** This may change **
+
+2001-03-31 06:25 jbpn
+
+ * man/snmp_alarm.3:
+
+ - document the snmp_alarm_register_hr function
+
+ - expand the NOTES section discussing use of SIGALRM (or not)
+
+2001-03-31 06:17 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - Make use of SNMP_CALLBACK_OP_DISCONNECT transport disconnect
+ indication to shut down AgentX sessions cleanly and cancel all
+ callbacks which make refernce to the AgentX session.
+
+2001-03-31 06:15 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - Fix multiple free() of parts of the subsession by zeroing out
+ fields that we don't use.
+
+ - Make use of SNMP_CALLBACK_OP_DISCONNECT transport disconnect
+ indication to shut down AgentX sessions cleanly.
+
+2001-03-31 06:13 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - Make use of SNMP_CALLBACK_OP_DISCONNECT transport disconnect
+ indication to shut down AgentX sessions cleanly.
+
+2001-03-31 06:11 jbpn
+
+ * agent/snmp_agent.c:
+
+ - Fix memory leak in handle_one_var where long varbinds weren't
+ correctly free()d.
+
+ - Change behaviour of agent_check_and_process so that alarms run
+ correctly.
+
+ ** NOTE: currently returns control to user when an alarms runs **
+ ** **
+ ** This may change **
+
+2001-03-31 06:05 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - Changed packet handling on stream-like transports so that all
+ complete received packets are processed:
+
+ _sess_read is refactored into two functions: _sess_read remains
+ responsible for reading data from the transport layer, but then
+ calls (perhaps more than once) _sess_process_packet to dispatch
+ each packet read.
+
+ - The presence of a session with a buffered partial packet no longer
+ causes snmp_select_info to return with a timeout of zero.
+
+ - Free the subsessions of a session when doing an snmp_sess_close;
+ this fixes an AgentX memory leak when subagents come and go.
+
+ - Perform callbacks with an operation argument of
+ SNMP_CALLBACK_OP_DISCONNECT when you get a transport disconnect
+ indication.
+
+2001-03-31 05:56 jbpn
+
+ * snmplib/snmp_api.h:
+
+ Made transport domain const
+
+2001-03-31 05:55 jbpn
+
+ * snmplib/callback.c:
+
+ Fix memory leak that can occur when deregistering callbacks
+
+2001-03-30 08:05 hardaker
+
+ * README.agentx:
+
+ file README.agentx was initially added on branch V4-2-patches.
+
+2001-03-29 21:43 hardaker
+
+ * ISSUES (V4-2-patches.1), ISSUES:
+
+ rm ISSUES
+
+2001-03-29 08:21 slif
+
+ * win32/libsnmp_dll/: libsnmp.def (V4-2-patches.3), libsnmp.def
+:
+
+ Add vacm_is_configured.
+
+2001-03-28 06:19 jbpn
+
+ * agent/mibgroup/agentx/: client.c, master_request.c:
+
+ - use SNMP_CALLBACK_OP_<name> callback operation names
+
+2001-03-28 06:00 jbpn
+
+ * apps/snmptrapd.c:
+
+ - use SNMP_CALLBACK_OP_<name> callback operation names
+
+2001-03-28 05:36 jbpn
+
+ * agent/: snmp_agent.c, snmpd.c:
+
+ - use SNMP_CALLBACK_OP_<name> callback operation names
+
+2001-03-28 05:06 jbpn
+
+ * snmplib/: snmp_client.c, snmp_api.c:
+
+ - use SNMP_CALLBACK_OP_<name> callback operation names
+
+2001-03-28 05:04 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - rename callback operations to SNMP_CALLBACK_OP_<name>
+ - add new operations SNMP_CALLBACK_OP_CONNECT, SNMP_CALLBACK_OP_DISCONNECT
+ - add legacy definitions for RECEIVED_MESSAGE, TIMED_OUT, SEND_FAILED
+
+2001-03-27 15:57 hardaker
+
+ * agent/mibgroup/disman/: mteObjectsTable.c,
+ mteTriggerTable.c:
+
+ change fprintf -> snmp_log.
+ Don't allow modifications of read-only rows in mteObjectsTable.
+
+2001-03-27 10:55 hardaker
+
+ * agent/: ds_agent.h, mibgroup/disman/mteObjectsTable.c
+, mibgroup/disman/mteObjectsTable.h,
+ mibgroup/disman/mteTriggerBooleanTable.c,
+ mibgroup/disman/mteTriggerDeltaTable.c,
+ mibgroup/disman/mteTriggerExistenceTable.c,
+ mibgroup/disman/mteTriggerTable.c,
+ mibgroup/disman/mteTriggerTable.h,
+ mibgroup/disman/mteTriggerThresholdTable.c:
+
+ Support for new features in the DISMAN-EVENT-MIB code:
+ New snmpd.conf tokens:
+ - monitor [-o oid...] [-u user] oid [(=|!=|<=|...) VALUE].
+ - defaultMonitors yes
+
+2001-03-27 10:53 hardaker
+
+ * snmplib/mib.c:
+
+ Moved * from beginning of routine to the same line as the return
+ variable declaration. Was causing etags grief the other way.
+
+2001-03-27 10:52 hardaker
+
+ * local/Makefile.in:
+
+ patch from Ken Hornstein: use %s instead of @s for search/replace delimiters.
+
+2001-03-27 10:29 hardaker
+
+ * apps/snmptrapd.c:
+
+ Use snmp_log with %s to prevent % expansion in octet strings containing a %s.
+ trap_fmt_free needs ()s.
+
+2001-03-27 08:13 dts12
+
+ * agent/: snmp_agent.c, mibgroup/agentx/master_request.c
+:
+
+ Handle non-responsive AgentX sub-agents more robustly.
+ (Based on suggestions from Harrie Hazewinkel & Paul Rasmussen)
+
+2001-03-27 08:03 dts12
+
+ * agent/snmp_agent.c:
+
+ Avoid double-freeing of cached address strings.
+ (John's improvement to my suggested fix).
+
+2001-03-27 02:39 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ Reset count of authorized peers on closedown. (Thanks to Vlad Tunik)
+
+2001-03-26 18:01 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c, snmplib/vacm.c, snmplib/vacm.h
+ (V4-2-patches.[1,2,1]), agent/mibgroup/mibII/vacm_vars.c,
+ snmplib/vacm.c, snmplib/vacm.h:
+
+ Fixed vacm to drop v1/v2c packets properly when no com2sec entries are found.
+
+2001-03-26 11:04 hardaker
+
+ * local/: ipf-mod.pl (V4-2-patches.1), ipf-mod.pl:
+
+ add usage comment at top
+
+2001-03-22 07:55 dts12
+
+ * snmplib/snmp_api.c:
+
+ Use ASN_OCTET_STR rather than the historic ASN_BIT_STR for 'b' object values
+ Patch from Frank Strauss.
+
+2001-03-22 07:46 dts12
+
+ * agent/: agent_trap.c (V4-2-patches.3), agent_trap.c:
+
+ Fix for minor memory leak with trap-related varbind values.
+ Thanks to John Villalovos (and the Intel SNMP team)
+
+2001-03-21 17:30 driehuis
+
+ * snmplib/mib.c:
+
+ Avoid crash in snmp_shutdown on platforms that check pointer validity
+ in free(3), e.g. FreeBSD.
+
+2001-03-21 08:46 hardaker
+
+ * agent/agent_trap.c, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proxy.c, apps/snmptrapd_handlers.c
+, snmplib/default_store.c, snmplib/read_config.c
+, snmplib/read_config.h, snmplib/snmpusm.c,
+ snmplib/snmpv3.c:
+
+ copy_nword created that checks buffer lengths.
+ Made everything use it.
+
+2001-03-21 08:38 hardaker
+
+ * snmplib/snmpksm.c:
+
+ KSM patch from Ken Hornstein
+
+2001-03-20 09:13 jbpn
+
+ * agent/.cvsignore:
+
+ Ignore Purify and NFS stuff
+
+2001-03-16 10:14 hardaker
+
+ * config.h.in:
+
+ added MIT_NEW_CRYPTO (for ksm) definition which was missing
+
+2001-03-16 02:51 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ fix ridiculous memory leak in discontinuity processing
+
+2001-03-15 11:04 hardaker
+
+ * testing/tests/T056agentv2cmintrap:
+
+ whoops. Missed a merge conflict line
+
+2001-03-15 10:59 hardaker
+
+ * README, README.win32, agent/mib_modules.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/host/hr_filesys.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/target/target.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proxy.c, apps/snmptrapd.c,
+ apps/snmptrapd_log.c, apps/snmpnetstat/if.c,
+ man/snmp.conf.5.def, man/snmpcmd.1, man/snmptrapd.8
+, mibs/IANAifType-MIB.txt, mibs/MTA-MIB.txt,
+ mibs/Makefile.mib, mibs/README.mibs,
+ mibs/TUNNEL-MIB.txt, mibs/ianalist, mibs/mibfetch
+, mibs/rfclist, mibs/rfcmibs.diff, mibs/smistrip
+, perl/SNMP/SNMP.xs, snmplib/asn1.c,
+ snmplib/default_store.c, snmplib/mib.c,
+ snmplib/mib.h, snmplib/parse.c, snmplib/snmp_api.c
+, snmplib/snmp_logging.c, snmplib/snmp_parse_args.c
+, snmplib/snmp_parse_args.h, snmplib/snmpv3.c,
+ snmplib/system.h, testing/eval_tools.sh,
+ testing/tests/T054agentv2ctrap,
+ testing/tests/T056agentv2cmintrap,
+ testing/tests/T058agentauthtrap, testing/tests/T100agenthup
+, win32/config.h, win32/mib_module_config.h,
+ win32/mib_module_includes.h, win32/mib_module_inits.h,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libucdmibs/libucdmibs.def,
+ win32/libucdmibs/libucdmibs.dsp:
+
+ merge from patches branch: merge2->3.
+
+2001-03-15 10:22 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.h:
+
+ extra members for discontinuity processing
+
+2001-03-15 07:46 hardaker
+
+ * agent/snmpd.c:
+
+ Patch from Frank Strauss to run signal handlers earlier
+
+2001-03-14 14:37 hardaker
+
+ * agent/: agent_trap.h (V4-2-patches.2), agent_trap.h:
+
+ Patch from Harrie Hazewinkel: make send_enterprise_trap_vars a public fn.
+
+2001-03-14 12:16 slif
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ Use config.h, don't use ucd-snmp directory to build in the mibgroup tree.
+
+2001-03-14 11:05 slif
+
+ * testing/: Makefile.in, RUNTESTS, TESTCONF.sh
+, eval_onescript.sh, eval_tools.sh:
+
+ merge the test script changes made in the V4-2-patches branch.
+
+2001-03-14 10:57 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ Change to discontinuity processing to stop it returning TRUE all the
+ time
+
+2001-03-14 10:52 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ - rough stab at discontinuity processing
+ - bail out of getNext-type loops on a badType condition
+
+2001-03-14 10:34 hardaker
+
+ * README.krb5:
+
+ kerberos README file from Ken Hornstein
+
+2001-03-14 10:28 jbpn
+
+ * agent/mibgroup/disman/mteTriggerDeltaTable.c:
+
+ Get returned *var_len right for mteTriggerDeltaDiscontinuityID
+
+2001-03-14 10:19 slif
+
+ * agent/snmpd.c, agent/mibgroup/examples/ucdDemoPublic.c
+, apps/snmpvacm.c, apps/snmpnetstat/winstub.c,
+ snmplib/parse.c, snmplib/snmpUnixDomain.c:
+
+ patch submitted by Harrie Hazewinkel to quiet some warnings.
+
+2001-03-14 10:19 hardaker
+
+ * acconfig.h, configure, configure.in,
+ snmplib/snmp_api.c, snmplib/snmpksm.c,
+ snmplib/snmpksm.h:
+
+ KSM patch from Ken Hornstein.
+
+2001-03-14 05:45 dts12
+
+ * agent/mibgroup/host/: hr_swrun.c (V4-2-patches.5), hr_swrun.c
+:
+
+ Fix Linux file descriptor leak (reported by Oliver FॆआŠnger)
+
+2001-03-14 05:22 jbpn
+
+ * agent/mibgroup/disman/.cvsignore:
+
+ [no log message]
+
+2001-03-14 02:20 jbpn
+
+ * agent/mibgroup/disman/: mteTriggerTable.c,
+ mteTriggerTable.h:
+
+ - save original PDU's transport domain -- necessary for
+ community string processing
+
+ CAUTION: incompatible change in format of mteTriggerTable
+ configuration entry
+
+ - fix memory leak in mte_run_trigger by releasing PDUs
+
+ - send "bad type" notifications in some cases
+
+ - other minor memory leaks
+
+ - "delta" sampleType handled for boolean triggers
+
+ - more "XXX:" comments!
+
+2001-03-13 13:52 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ fix support for Integer32
+
+2001-03-11 08:43 jbpn
+
+ * snmplib/: snmp_transport.c, snmp_transport.h:
+
+ Add a function to test whether an OID corresponds to a supported transport
+ domain.
+
+2001-03-11 07:55 jbpn
+
+ * snmplib/snmpTCPDomain.h:
+
+ Add #includes to make struct sockaddr_in complete
+
+2001-03-11 07:54 jbpn
+
+ * snmplib/snmpAAL5PVCDomain.h:
+
+ Remove spurious #include
+
+2001-03-09 07:32 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Fix rwuser -s model to actually work.
+
+2001-03-09 05:52 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ Set a PDU's opaque data on a tcp_recv; this isn't necessary to send
+ replies (because the underlying socket is strongly connected) but if
+ you don't do this then you can't do "com2sec" type processing for PDUs
+ received on TCP sessions... interesting.
+
+2001-03-09 03:33 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ Fix bad assumption that community string is zero-terminated
+
+2001-03-08 15:36 hardaker
+
+ * agent/snmpd.c:
+
+ - correct version statements to indicate net-snmp.
+ - remove my name as author (I'm certainly not the only one)
+ - add web address.
+
+2001-03-08 15:31 hardaker
+
+ * README:
+
+ - Added Ken Hornstein's name to contributers list.
+ - Removed mine from being listed separately.
+
+2001-03-08 14:51 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/mibII/vacm_vars.c, snmplib/snmpksm.c,
+ snmplib/snmpksm.h:
+
+ Added a kerberos based security module (ksm).
+ However, Needs libraries (-lkrb5 -lcom_err) not being checked for currently.
+
+2001-03-08 14:48 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Whoops. Shouldnt have a negation sign on the most recent checkin.
+
+2001-03-08 14:38 hardaker
+
+ * snmplib/snmp_api.c:
+
+ If NO_PROBE is set, don't do any post probing activities either like
+ time updating and user creation.
+
+2001-03-08 08:14 jbpn
+
+ * agent/mibgroup/target/target.c:
+
+ Remove strdup()s on some session parameters which cause memory leaks
+ (since snmp_open deep copies the input session anyway)
+
+2001-03-08 08:11 jbpn
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ Make sure sess field of new entries is initialised to NULL.
+
+2001-03-08 07:49 jbpn
+
+ * agent/mibgroup/target/snmpTargetParamsEntry.c:
+
+ Make config token parser update timestamp on entry it creates;
+ move update_timestamp function.
+
+2001-03-07 07:45 hardaker
+
+ * perl/SNMP/: README, SNMP.pm, SNMP.xs:
+
+ Patch from Karl Schilke to remove unneeded timestamp support
+
+2001-03-06 20:58 hardaker
+
+ * snmplib/: snmp_api.c, snmp_client.c, snmp_secmod.c
+, snmp_secmod.h, snmpusm.c:
+
+ secmod struct symbol name changes to something more intelligible.
+
+2001-03-06 16:46 hardaker
+
+ * snmplib/: snmp_api.c, snmp_client.c:
+
+ - set the default pdu security model to SNMP_DEFAULT_SECMODEL (not 0).
+ - don't force the security model of the session on the pdu if already set.
+
+2001-03-06 16:11 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ hopefully fix to allow other (registered) security models to be used.
+
+2001-03-06 09:23 hardaker
+
+ * README:
+
+ Added John Naylon to the README file.
+
+2001-03-06 09:22 hardaker
+
+ * snmplib/: snmp_api.c, snmp_secmod.h:
+
+ Create a new secmod callback when a timeout on a pdu occurs.
+
+2001-03-06 09:18 hardaker
+
+ * configure, configure.in:
+
+ properly install secmod header list.
+
+2001-03-06 08:43 hardaker
+
+ * snmplib/: snmp_api.c, snmp_secmod.h:
+
+ - bug fixes for secmod related stuff (it compiles now (opps)).
+
+2001-03-06 08:38 hardaker
+
+ * snmplib/: snmp_api.c, snmp_secmod.h:
+
+ - two new secmod callbacks for freeing a pdu and a session.
+ - move transport closing in snmp_sess_close() to after pending
+ requests are freed/closed in case something needs to make use of the
+ transport before it closes.
+
+2001-03-06 07:56 hardaker
+
+ * snmplib/: snmp_api.c, snmp_secmod.h:
+
+ Pass in pdu to secmod encode/decode routines.
+
+2001-03-06 03:35 jbpn
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Modified function Interface_Index_By_Name (Solaris specific) to cope more
+ gracefully with large numbers of interfaces. Also stops Purify on Solaris
+ complaining about uninitialised memory reads.
+
+2001-03-05 16:33 hardaker
+
+ * snmplib/snmp_api.c:
+
+ reverse callback ordering of normal callback/secmod callback
+ processing in sess_copy().
+
+2001-03-05 16:26 hardaker
+
+ * snmplib/snmp_secmod.c:
+
+ remove unused free function calls for security module unregistrations.
+
+2001-03-05 16:17 hardaker
+
+ * snmplib/: snmp_api.c, snmp_secmod.h:
+
+ minor API changes to the pluggable security model handling.
+
+2001-03-05 16:11 hardaker
+
+ * snmplib/snmp_api.c:
+
+ properly respect the DONT_PROBE_FLAG.
+
+2001-03-05 15:36 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h, snmp_secmod.h
+:
+
+ add a session pointer to the v3 build routines.
+
+2001-03-05 15:23 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ Add a krb5 specific error code.
+
+2001-03-05 14:58 hardaker
+
+ * configure, configure.in:
+
+ make configure properly handle pluggable security modules
+
+2001-03-05 14:49 hardaker
+
+ * configure, configure.in:
+
+ make configure mkdir snmplib before creating a file in it
+
+2001-03-05 14:44 hardaker
+
+ * configure, configure.in:
+
+ make configure respect non-local srcdirs for transport/secmods
+
+2001-03-05 10:40 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/agent_index.c,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/mib_modules.c, agent/snmp_vars.c,
+ agent/snmpd.c, agent/mibgroup/examples/ucdDemoPublic.c
+, agent/mibgroup/snmpv3/usmUser.c, apps/snmptrapd.c
+, snmplib/.cvsignore, snmplib/Makefile.in,
+ snmplib/callback.h, snmplib/default_store.h,
+ snmplib/lcd_time.c, snmplib/scapi.c,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmpusm.c, snmplib/snmpusm.h,
+ snmplib/snmpv3.c:
+
+ support for pluggable security models. Currently only the USM is
+ available, but a new kerberos based security model will be available
+ shortly. These changes simply make it possible to use more than one
+ security service.
+
+2001-03-05 10:36 hardaker
+
+ * snmplib/: snmp_secmod.c, snmp_secmod.h:
+
+ Added John Naylon to the authors list.
+
+2001-03-05 10:33 hardaker
+
+ * snmplib/snmp_enum.h:
+
+ Comment re-arranging to actually be near the functions they're describing.
+
+2001-03-05 06:10 jbpn
+
+ * snmplib/system.c:
+
+ Modified get_myaddr() function to cope more gracefully with large numbers
+ of interfaces, and with the possibility of non-IPv4 addresses on some
+ interfaces. Also stops Purify on Solaris complaining about uninitialised
+ memory reads. Use "official" definition of INADDR_LOOPBACK.
+
+2001-03-03 14:34 nba
+
+ * mibs/README.mibs:
+
+ file README.mibs was initially added on branch V4-2-patches.
+
+2001-03-03 14:34 nba
+
+ * mibs/ianalist:
+
+ file ianalist was initially added on branch V4-2-patches.
+
+2001-03-03 14:34 nba
+
+ * mibs/rfclist:
+
+ file rfclist was initially added on branch V4-2-patches.
+
+2001-03-03 14:34 nba
+
+ * mibs/rfcmibs.diff:
+
+ file rfcmibs.diff was initially added on branch V4-2-patches.
+
+2001-03-01 19:23 hardaker
+
+ * snmplib/: asn1.c, snmp_api.c:
+
+ Fix snmp_oid_compare and reverse encodings to deal with numbers > 2^31.
+
+2001-02-28 23:02 hardaker
+
+ * snmplib/: read_config.c, read_config.h,
+ snmp_parse_args.c:
+
+ - implemented snmp_config(char *line) to parse a .conf configuration
+ line at any time in the code (handlers must be registered before hand).
+ - implemented snmp_config_remember(char *line) to memorize it for
+ later use.
+ - read_configs, et al, will automatically call them after reading
+ everything else.
+ - Added a -Y flag to snmp_parse_args to store read config directives
+ for later use, thus allowing you to specify .conf directives on the
+ command line.
+
+2001-02-27 07:28 dts12
+
+ * agent/snmp_vars.c:
+
+ Avoid infinite loop with AgentX subagents and VACM checking interaction.
+ (Fix provided by Frank Strauss)
+
+2001-02-21 15:21 hardaker
+
+ * snmplib/: ucd-snmp-includes.h (V4-2-patches.1),
+ ucd-snmp-includes.h:
+
+ Applied patch #103805 from bcollar: add sys/time.h to ucd-snmp-includes.h
+
+2001-02-21 15:15 hardaker
+
+ * snmplib/: int64.c (V4-2-patches.2), int64.c:
+
+ fix bug #133416 (u64Subtraction math) as suggested by the submittor
+
+2001-02-16 15:12 hardaker
+
+ * agent/: var_struct.h (V4-2-patches.1), var_struct.h:
+
+ - increase UCD_REGISTRY_OID_MAX_LEN to 128 at Frank's request
+
+2001-02-16 04:16 jbpn
+
+ * configure.in:
+
+ Change behaviour on cygwin to exclude Unix domain transports by default
+ on cygwin, and also fix a minor bug, thanks to suggestions by Peter Folk.
+
+2001-02-14 18:14 hardaker
+
+ * apps/: snmptrapd.c (V4-2-patches.1), snmptrapd.c:
+
+ removed unused snmp_alarm.h include
+
+2001-02-12 14:11 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ added Karl's patch for usenumeric
+
+2001-02-12 13:54 marz
+
+ * perl/SNMP/: MANIFEST, SNMP.pm, SNMP.xs,
+ examples/trap-example.pl:
+
+ added trap reception API from Philip Prindeville <philipp@cisco.com>
+
+2001-02-11 08:23 jbpn
+
+ * apps/snmptrapd.c:
+
+ Use snmp_add not snmp_sess_add (the latter doesn't add a session to
+ the Session list, and it therefore won't get included in the select()
+ fdset, hence snmptrapd will never receive very much).
+
+2001-02-11 08:20 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ Fix improperly-terminated list in com2sec handling.
+
+2001-02-11 07:45 jbpn
+
+ * agent/snmpd.c:
+
+ Clean up merge (>>>>>>, ====== etc. left behind).
+
+2001-02-10 09:26 jbpn
+
+ * configure.in:
+
+ Fix typo.
+
+2001-02-10 09:11 jbpn
+
+ * agent/mibgroup/agentx/: master.c, master_admin.c,
+ subagent.c:
+
+ Memory leak patches (sourceforge patch #103605).
+ Remove a few strdup()s, and call free_agent_snmp_session() rather than
+ free() in subagent.c:handle_agentx_packet() for AGENTX_MSG_RESPONSE
+ and default cases, to ensure free()ing of cloned PDU allocated by
+ init_agent_snmp_session.
+
+2001-02-10 07:28 hardaker
+
+ * snmplib/: snmpAAL5PVCDomain.c, snmpAAL5PVCDomain.h,
+ snmpIPXDomain.c, snmpIPXDomain.h, snmpTCPDomain.c
+, snmpTCPDomain.h, snmpUDPDomain.c,
+ snmpUDPDomain.h, snmpUnixDomain.c, snmpUnixDomain.h
+, snmp_transport.c, snmp_transport.h:
+
+ Whoops. Forgot the new files associated with the pluggable transport stuff.
+
+2001-02-09 11:22 hardaker
+
+ * agent/mibgroup/disman/: event-mib.h, mteObjectsTable.c
+, mteObjectsTable.h, mteTriggerBooleanTable.c,
+ mteTriggerExistenceTable.c, mteTriggerTable.c,
+ mteTriggerTable.h, mteTriggerThresholdTable.c:
+
+ Implemented and made use of mteObjectsTable to send additional objects out with traps generated. Also, don't return data for misc tables when that trigger isn't defined to use that test type.
+
+2001-02-09 11:16 hardaker
+
+ * agent/: snmpd.c (V4-2-patches.2), snmpd.c:
+
+ Applied patch #103613: fix memory leak in snmpd port specification -> default_store.
+
+2001-02-09 11:14 hardaker
+
+ * agent/: mib_modules.c (V4-2-patches.2), mib_modules.c:
+
+ Applied patch #103612: fix memory leak in mib_module init code
+
+2001-02-09 11:12 hardaker
+
+ * agent/: agent_registry.c (V4-2-patches.1), agent_registry.c
+:
+
+ Applied patch #103611: fix memory leak for duplicate oid registrations.
+
+2001-02-09 11:05 hardaker
+
+ * agent/mibgroup/ucd-snmp/: memory_freebsd2.c, proxy.c
+ (V4-2-patches.[1,4]), memory_freebsd2.c:
+
+ Applied patch #103702: fix swap reporting on freebsd 4.2
+
+2001-02-09 10:12 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/agent_trap.c, agent/snmp_agent.c
+, agent/snmp_agent.h, agent/snmp_vars.c,
+ agent/snmpd.c, agent/mibgroup/mibII/vacm_vars.c,
+ apps/snmpstatus.c, apps/snmptest.c, apps/snmptrap.c
+, apps/snmptrapd.c, apps/snmptrapd_log.c,
+ apps/snmptrapd_log.h, mibs/UCD-SNMP-MIB.txt,
+ snmplib/Makefile.in, snmplib/snmp_alarm.c,
+ snmplib/snmp_alarm.h, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmp_client.c,
+ snmplib/vacm.h:
+
+ Applied patch 103510: domain transport independence. Note: Traps/VACM broken.
+
+2001-02-09 08:54 hardaker
+
+ * testing/tests/: T001snmpv1get, T002snmpv1getnext,
+ T003snmpv1getfail, T014snmpv2cget, T015snmpv2cgetnext
+, T016snmpv2cgetfail, T017snmpv2ctov1getfail,
+ T018snmpv1tov2cgetfail, T020snmpv3get,
+ T021snmpv3getnext, T022snmpv3getMD5,
+ T023snmpv3getMD5DES, T024snmpv3getSHA1,
+ T025snmpv3getSHADES, T028snmpv3getfail,
+ T030snmpv3usercreation, T053agentv1trap,
+ T054agentv2ctrap, T055agentv1mintrap,
+ T056agentv2cmintrap, T058agentauthtrap, T100agenthup
+, T110agentxget, T111agentxset, T112agentxsetfail
+, T113agentxtrap, T120proxyget, T121proxyset
+, T122proxysetfail:
+
+ updated most tests to use numeric OIDs so as to not rely on mib parsing
+
+2001-02-09 07:18 hardaker
+
+ * agent/mibgroup/agentx/master.h:
+
+ remove unused prototype: get_agentx_transID
+
+2001-02-08 14:15 hardaker
+
+ * local/Makefile.in, local/traptoemail,
+ man/snmptrapd.conf.5.def:
+
+ traptoemail perl script created as an example traphandle script
+
+2001-02-08 14:01 hardaker
+
+ * Makefile.in, acconfig.h, config.h.in,
+ agent/Makefile.in, agent/agent_trap.c,
+ agent/mib_modules.c, agent/snmpd.c,
+ agent/mibgroup/kernel_sunos5.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_admin.h,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/smux/smux.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/vmstat.h,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.h,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.h,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.h, apps/snmpdelta.c
+, apps/snmpset.c, apps/snmptrap.c,
+ apps/snmpvacm.c, apps/snmpnetstat/Makefile.in,
+ local/mib2c, man/snmpcmd.1, mibs/RMON-MIB.txt,
+ mibs/UCD-SNMP-MIB.txt, perl/SNMP/SNMP.pm,
+ snmplib/int64.c, snmplib/parse.c, snmplib/snmp_api.c
+:
+
+ Merge from V4-2-patches: merge 1->2
+
+2001-01-30 17:13 hardaker
+
+ * agent/mibgroup/ucd-snmp/: disk.c (V4-2-patches.1), disk.c:
+
+ Applied patch #103414: fix disk info for block sizes other than 1024.
+
+2001-01-30 13:28 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ use snmp_enum's properly (strdup() the strings first)
+
+2001-01-30 13:28 hardaker
+
+ * snmplib/: snmp_enum.c, snmp_enum.h:
+
+ proper constness for some of the function arguments.
+
+2001-01-30 13:27 hardaker
+
+ * snmplib/read_config.c:
+
+ fix bug I just introduced (returning proper saveto pointer)
+
+2001-01-30 13:17 hardaker
+
+ * local/tkmib:
+
+ - snmpsets are supported
+ - A new "set" button has been added to perform sets on an oid.
+ - All writable objects in a table are now buttons that bring up the
+ set window with the current value instated.
+ - All writable objects in the output of snmp{get,walk,getnext}
+ buttons are displayed as blue and are clickable to change their
+ values.
+ - settings configured via the options menu can now be saved.
+ - use Getopt::Std now.
+ - supports most of the important snmpcmd(1) flags for session setup.
+
+2001-01-30 13:12 hardaker
+
+ * agent/mibgroup/disman/: event-mib.h,
+ mteTriggerBooleanTable.c, mteTriggerBooleanTable.h,
+ mteTriggerDeltaTable.c, mteTriggerDeltaTable.h,
+ mteTriggerExistenceTable.c, mteTriggerExistenceTable.h,
+ mteTriggerTable.c, mteTriggerTable.h,
+ mteTriggerThresholdTable.c, mteTriggerThresholdTable.h:
+
+ Initial (not-complete) implementation of the DISMAN-EVENT-MIB:
+ - Implements all 3 tests (boolean, threshold and existence).
+ - not rigorously tested.
+ - Currently only supports querying the local agent
+ (mteTriggerTargetTag must be '').
+ - Currently only supports sending traps and the mteObjectsTable is
+ not implemented (my next todo item)
+ - Only the default traps are sent. The mteEvent* objects haven't
+ been implemented (no self-defined traps/sets).
+ - no easy to use configuration yet (soon).
+ - configure with --with-mib-modules=disman/event-mib
+
+2001-01-30 13:03 hardaker
+
+ * snmplib/read_config.c:
+
+ Use memcpy instead of sprintf for strings that may not be null terminated.
+
+2001-01-30 12:58 hardaker
+
+ * agent/: snmp_agent.c, snmp_agent.h:
+
+ Implemented get_current_agent_session() and set_current_agent_session():
+ - These allow a mib module to retrieve the current
+ agent_snmp_session pointer for the current transaction.
+ - This should probably done differently later when we change the mib
+ module api.
+ - This will completely fail to work properly in a multi-threaded
+ agent (which we currently don't support anyway).
+
+2001-01-29 11:58 hardaker
+
+ * snmplib/callback.c:
+
+ debugging statement at initialization time.
+
+2001-01-29 11:58 hardaker
+
+ * snmplib/read_config.c:
+
+ properly malloc a 1 byte, NULL character string for "" read strings.
+
+2001-01-29 11:54 hardaker
+
+ * agent/mibgroup/: header_complex.c, header_complex.h:
+
+ data seperation and new functions:
+ header_complex_get_from_oid()
+ header_complex_add_data_by_oid()
+
+2001-01-12 08:22 hardaker
+
+ * mibs/DISMAN-EVENT-MIB.txt:
+
+ - DISMAN-EVENT-MIB added to mib repository. (Or, guess what I did during a 6 hour plane flight?)
+
+2001-01-12 08:16 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ support bit strings
+
+2001-01-12 08:00 hardaker
+
+ * snmplib/: snmp_api.c (V4-2-patches.5), snmp_api.c:
+
+ - bit_string fixes
+ - make snmp_add_var call snmp_parse_oid() instead of read_objid().
+
+2001-01-12 07:58 hardaker
+
+ * snmplib/read_config.c:
+
+ - new data types supported for read_config routines: unsigned, bit_str.
+
+2001-01-12 07:56 hardaker
+
+ * snmplib/: asn1.c (V4-2-patches.3), asn1.c:
+
+ comment out really odd (and broken) check from asn_bitstring_check???
+
+2001-01-12 07:53 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ move config string initializer above subagent check so its known even
+ if not used.
+
+2001-01-12 07:51 hardaker
+
+ * local/: mib2c.storage.conf, mib2c.vartypes.conf
+ (V4-2-patches.[1,1]), mib2c.storage.conf,
+ mib2c.vartypes.conf:
+
+ - misc bug fixes.
+ - new data types (uint32, unsigned, bits).
+
+2001-01-09 17:08 hardaker
+
+ * agent/: agent_registry.c, agent_registry.h,
+ ds_agent.h, var_struct.h, mibgroup/mibincl.h,
+ mibgroup/agentx/client.c, mibgroup/agentx/master_admin.c
+, mibgroup/agentx/master_request.c,
+ mibgroup/agentx/subagent.c, mibgroup/agentx/subagent.h
+:
+
+ SubAgent ping support:
+ - agentxPingInterval specifies SECONDS between when the subagent
+ tries to ping the master agent.
+ - if no response is received, it tries to reconnect.
+ - failing that it tries every SECONDS again till it succeeds.
+ - re-registers its oid's based on the current subtree list.
+ - may need some thought. Assumes *all* need to be re-registered.
+ - needs to re-register sysortable entries too, but doesn't.
+ - currently seg-faults on about the 2-4th time or so. Not sure why.
+ - Should make Dave smile or cringe or giggle, not sure which.
+
+2001-01-09 17:02 hardaker
+
+ * snmplib/: callback.c, callback.h:
+
+ Allow deregistering of callbacks
+
+2001-01-09 06:20 hardaker
+
+ * win32/snmpnetstat/: snmpnetstat.dsp (V4-2-patches.1),
+ snmpnetstat.dsp:
+
+ added getopt.c to list
+
+2001-01-04 16:44 hardaker
+
+ * snmplib/: snmp_enum.c, snmp_enum.h:
+
+ - generic snmp enum list support. Not used anywhere (yet).
+
+2001-01-04 16:43 hardaker
+
+ * configure, configure.in, agent/agent_callbacks.h
+, agent/agent_trap.c, agent/agent_trap.h,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.h,
+ apps/snmpnetstat/main.c, snmplib/Makefile.in,
+ snmplib/asn1.c, snmplib/callback.c,
+ snmplib/callback.h, snmplib/mib.c,
+ snmplib/snmp_api.c, snmplib/snmp_logging.c,
+ testing/tests/T053agentv1trap, testing/tests/T054agentv2ctrap
+, testing/tests/T055agentv1mintrap,
+ testing/tests/T056agentv2cmintrap,
+ testing/tests/T113agentxtrap:
+
+ - merged patches from V4-2-patches branch to main branch.
+
+2001-01-04 10:37 hardaker
+
+ * man/snmp.conf.5.def, man/snmpcmd.1, snmplib/mib.c
+:
+
+ - added new printHexText snmp.conf token.
+ - documented -OT, and the token.
+
+2001-01-04 10:27 hardaker
+
+ * snmplib/: default_store.h, mib.c:
+
+ Patch #103091 applied:
+ - Added -OT option to view hex strings with text in them.
+
+2000-12-27 16:47 hardaker
+
+ * testing/tests/T055agentv1mintrap:
+
+ file T055agentv1mintrap was initially added on branch V4-2-patches.
+
+2000-12-27 16:47 hardaker
+
+ * testing/tests/T056agentv2cmintrap:
+
+ file T056agentv2cmintrap was initially added on branch V4-2-patches.
+
+2000-12-22 07:02 hardaker
+
+ * snmplib/vacm.c:
+
+ fix view processing to watch for length prefix. The length prefix
+ really really shouldn't be stored directly in the oid. Niels?
+
+2000-12-19 07:22 hardaker
+
+ * snmplib/snmpv3.c:
+
+ make init_snmpv3() deal with a NULL argument properly.
+
+2000-12-18 14:37 hardaker
+
+ * local/.cvsignore:
+
+ - (.cvsignore): remove passtest from the .cvsignore file (bug #12694)
+
+2000-12-18 10:45 marz
+
+ * perl/SNMP/: README, SNMP.pm:
+
+ minor doc fix
+
+2000-12-14 13:46 nba
+
+ * snmplib/system.c:
+
+ - system.c: fix uptime for 64-bit Solaris
+
+2000-12-14 13:45 nba
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ - dlmod.c: fix stupid spelling error
+
+2000-12-13 21:52 nba
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ - dlmod.c: fix confusion between int, size_t, long for 64-bit compiles.
+
+2000-12-13 08:40 hardaker
+
+ * man/Makefile.in:
+
+ - (Makefile.in): add snmpconf.1
+
+2000-12-08 14:49 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c, snmplib/vacm.c:
+
+ - vacm_vars.c, vacm.c: indexing of vacmViewTreeFamilyEntry was hosed, assuming
+ that the Subtree index had an IMPLIED attribute.
+
+2000-12-08 14:46 nba
+
+ * agent/mibgroup/host/: hr_filesys.c, hr_partition.c:
+
+ - hr_filesys.c, hr_partition.c: fix some zero index values.
+
+2000-12-08 14:43 nba
+
+ * agent/snmp_vars.c:
+
+ - snmp_vars.c: fix returns of zeroDotZero (such as ifSpecific)
+
+2000-12-08 14:38 nba
+
+ * agent/agent_trap.c:
+
+ - agent_trapd.c: security model values are not the same is snmp version values
+
+2000-12-06 14:45 nba
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - interfaces.c: Linux kernel 2.0.x has no ARPHRD_HIPPI
+
+2000-12-05 07:00 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in): Fix rsnmp's /usr/local hardcoded path.
+
+2000-12-04 17:03 hardaker
+
+ * testing/tests/T112agentxsetfail:
+
+ - (T112agentxsetfail): fix
+
+2000-12-04 16:33 hardaker
+
+ * README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2 )
+
+2000-12-04 16:30 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): update.
+
+2000-12-04 15:30 hardaker
+
+ * NEWS, README:
+
+ - (NEWS, README): updates.
+
+2000-12-04 14:48 marz
+
+ * perl/SNMP/: Makefile.PL, SNMP.xs, t/mibload.t
+, t/startagent.pl:
+
+ ensure mibload.t uses correct MIBDIR for testing
+
+2000-12-04 11:05 hardaker
+
+ * AGENT.txt, FAQ, README:
+
+ - (AGENT.txt, FAQ, README): convert url's to www.netsnmp.org.
+
+2000-12-04 08:45 hardaker
+
+ * NEWS:
+
+ - (NEWS): agentx note changes.
+
+2000-12-03 07:29 nba
+
+ * man/snmptrapd.8, apps/snmptrapd_log.c:
+
+ - snmptrapd_log.c: fox missing leading zeroes for %.2d like formats.
+ Add an alternate format for up-time displays.
+
+2000-12-02 18:22 marz
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs, t/bulkwalk.t,
+ t/notify.t, t/session.t:
+
+ found the uninitialized data bug...must have been in there dormant for a while, other test fixes - good to go!
+
+2000-12-01 16:36 hardaker
+
+ * agent/snmpd.c:
+
+ - (agent/snmpd.c): reference sourceforge.
+
+2000-12-01 16:35 hardaker
+
+ * AGENT.txt:
+
+ - (AGENT.txt): reference sourceforge.
+
+2000-12-01 16:34 hardaker
+
+ * TODO:
+
+ - (TODO): reference net-snmp-coders.
+
+2000-12-01 16:34 hardaker
+
+ * README:
+
+ - (README): update.
+
+2000-12-01 16:33 hardaker
+
+ * bug-report, agent/mibgroup/versiontag:
+
+ - (bug-report, agent/mibgroup/versiontag): remove the bug report script.
+
+2000-12-01 16:31 hardaker
+
+ * PORTING:
+
+ - (PORTING): reference sourceforge.
+
+2000-12-01 16:23 hardaker
+
+ * man/snmptrapd.conf.5.def:
+
+ - (man/snmptrapd.conf.5.def): mention the fact that snmpv3 traps are
+ the same as snmpv2 traps.
+
+2000-12-01 16:23 hardaker
+
+ * NEWS:
+
+ - (NEWS): update.
+
+2000-12-01 15:31 hardaker
+
+ * README:
+
+ - (README): update.
+
+2000-12-01 15:16 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): update for proxy support.
+
+2000-12-01 14:36 hardaker
+
+ * FAQ:
+
+ - (FAQ): update a few things.
+
+2000-12-01 14:28 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: diagnose wrong quoting in indices
+
+2000-12-01 14:23 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: add RFC-1213 as an aliase for RFC1213-MIB (used in many mibs)
+
+2000-12-01 14:19 nba
+
+ * agent/mibgroup/smux/smux.c:
+
+ - smux.c: reformat some debug messages for readability
+
+2000-12-01 14:17 nba
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - interfaces.c: fix ifType values for Linux
+
+2000-12-01 14:14 nba
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - subagent.c: supply a missing return value
+
+2000-12-01 10:04 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf): quote things with spaces in them.
+
+2000-12-01 09:49 hardaker
+
+ * man/snmpconf.1:
+
+ - (snmpconf.1): quick man page for snmpconf.
+
+2000-12-01 09:14 hardaker
+
+ * snmplib/parse.c:
+
+ - (snmplib/parse.c): change no-parent log message into a warning.
+
+2000-12-01 09:11 hardaker
+
+ * agent/mibgroup/agentx/README.agentx:
+
+ - (agent/mibgroup/agentx/README.agentx): update from Dave.
+
+2000-12-01 09:10 hardaker
+
+ * FAQ:
+
+ - (FAQ): update from Dave.
+
+2000-12-01 07:59 hardaker
+
+ * agent/agent_trap.c:
+
+ - (agent/agent_trap.c): Patch from Dave Shield:
+ - support v2->v1 trap conversion.
+
+2000-12-01 07:56 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): typo.
+
+2000-12-01 07:42 marz
+
+ * perl/SNMP/Makefile.PL, perl/SNMP/SNMP.xs,
+ perl/SNMP/t/notify.t, snmplib/mib.c:
+
+ additional fixes to support targetted builds of perl/SNMP using -NET-SNMP-PATH (and white space removal as my emacs kindly does that for me?)
+
+2000-11-30 14:06 nba
+
+ * snmplib/: getopt.h, snmp_parse_args.h:
+
+ - getopt.h, snmp_parse_args.h: extern "C" bracketing
+
+2000-11-30 14:04 nba
+
+ * man/snmpd.conf.5.def:
+
+ - snmpd.conf.5.def: fix formatting of smuxpeer token
+
+2000-11-30 10:31 hardaker
+
+ * FAQ:
+
+ - (FAQ): Update from Dave.
+
+2000-11-30 10:18 hardaker
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (master_request.c): Patch from Dave Shield to fix bad sets for agentx.
+
+2000-11-30 09:19 hardaker
+
+ * ov/README:
+
+ - (ov/README): minor corrections, probably still incorrect.
+
+2000-11-30 09:18 hardaker
+
+ * local/: Makefile.in, snmpconf:
+
+ - (local/Makefile.in, snmpconf, acl, basic_setup, monitor, operation,
+ system, trapsinks):
+ - grouping support.
+ - sort-of-quiet output support.
+ - operation mode support (setting user, group, ports...)
+
+2000-11-30 09:13 hardaker
+
+ * snmplib/read_config.c:
+
+ - (snmplib/read_config.c): save a warning header at the top of the
+ persistent data file.
+
+2000-11-30 09:11 hardaker
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ - (agent/mibgroup/tunnel/tunnel.c): Cleanup patch from Frank Strauss.
+
+2000-11-30 09:10 hardaker
+
+ * agent/snmpd.c:
+
+ - (agent/snmpd.c): set DS_AGENT_NO_ROOT_ACCESS in -H help output.
+
+2000-11-30 09:08 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): mention the TUNNEL-MIB support.
+
+2000-11-29 18:21 slif
+
+ * README:
+
+ Update e-mail address for Slifcak
+
+2000-11-29 11:34 marz
+
+ * configure:
+
+ fixed order of function checking so that vsnprintf is not found in libdb (BSD db) by mistake
+
+2000-11-29 05:18 marz
+
+ * perl/SNMP/: Makefile.PL, README:
+
+ partial submit to get perl/SNMP tests to pass and update the docs somewhat - still getting cores in notify.t. had to change create_user_from_session to update an existing user incase 2 sessions are started with the same user
+
+2000-11-28 18:00 marz
+
+ * perl/SNMP/Makefile.PL, perl/SNMP/README,
+ perl/SNMP/SNMP.pm, perl/SNMP/SNMP.xs,
+ perl/SNMP/t/async.t, perl/SNMP/t/bulkwalk.t,
+ perl/SNMP/t/mib.t, perl/SNMP/t/notify.t,
+ perl/SNMP/t/session.t, perl/SNMP/t/startagent.pl,
+ snmplib/snmp_api.c, snmplib/snmpusm.c,
+ snmplib/snmpv3.c:
+
+ partial submit to get perl/SNMP tests to pass and update the docs somewhat - still getting cores in notify.t. had to change create_user_from_session to update an existing user incase 2 sessions are started with the same user
+
+2000-11-27 14:36 hardaker
+
+ * local/snmpconf:
+
+ - (local/snmpconf):
+ - add support for "groups" of items.
+ - don't use IO::Dir, as its not in the standard perl module distributions.
+
+2000-11-27 14:34 hardaker
+
+ * agent/mibgroup/ucd-snmp/dlmod.h:
+
+ - (agent/mibgroup/ucd-snmp/dlmod.h): remove unneeded variable reference.
+
+2000-11-27 14:33 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (agent/snmp_agent.c): Patch from John Naylon:
+ - fix auto-set support for the agent (and plug a memory leak).
+
+2000-11-27 13:42 nba
+
+ * man/snmp.conf.5.def:
+
+ - snmp.conf.5.def: document tokens extendedIndex and noRangeCheck
+
+2000-11-27 13:41 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: fix a C++ style comment
+
+2000-11-24 15:14 nba
+
+ * agent/mibgroup/ucd-snmp/: memory_freebsd2.c,
+ vmstat_netbsd1.c:
+
+ - memory_freebsd2.c, vmstat_netbsd1.c: minor fixes for NetBSD 1.5, OPenBSD 2.6
+
+2000-11-22 13:48 hardaker
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ - (mibgroup/ucd-snmp/dlmod.c): Patch from Sean Harding:
+ - don't export an internal variable.
+
+2000-11-21 15:17 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: fix parsing of oid like 99.13.\"guf\"8
+
+2000-11-19 13:03 nba
+
+ * perl/SNMP/SNMP.xs, local/mib2c.vartypes.conf:
+
+ - SNMP.xs, mib2c.vartypes.conf: The recent specialisation of the Integer
+ types in the parser created problems for the perl module and in turn
+ for mib2c. Sorry for not catching this before pre2:-(
+
+2000-11-19 12:58 nba
+
+ * Makefile.in, Makefile.top, configure,
+ configure.in, agent/Makefile.in, apps/Makefile.in
+, apps/snmptrap.c, apps/snmpnetstat/Makefile.in
+, apps/snmpnetstat/main.c, snmplib/parse.c:
+
+ - fixes to ./configure --with-defaults --enable-mini-agent; make install
+ and run the tools under cygwin. Haven't tried the agent yet:-)
+
+2000-11-18 07:14 hardaker
+
+ * FAQ, README, bug-report, sedscript.in
+, version.h:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.2.pre2 )
+
+2000-11-18 07:12 hardaker
+
+ * testing/tests/T049snmpv3inform:
+
+ - (T049snmpv3inform): v3 inform test added.
+
+2000-11-17 11:01 nba
+
+ * snmplib/: mib.c, snmp_api.c:
+
+ - mib.c, snmp_api.c: better error messages for bad snmpset calls and bad
+ indices. Also fix a bug with quoted indices.
+
+2000-11-17 10:32 hardaker
+
+ * testing/tests/T050snmpv3trap:
+
+ - (tests/T050snmpv3trap): test for snmpv3 traps.
+
+2000-11-17 10:30 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): fix cases where the format strings are specified.
+
+2000-11-17 10:26 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ - IANAifType-MIB.txt: update from IANA
+
+2000-11-17 08:32 hardaker
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (master_request.c): Patch from Dave Shield:
+ - fix memory leaks.
+ - fix agentx problems with bad sets.
+
+2000-11-16 17:55 hardaker
+
+ * snmplib/snmpv3.c:
+
+ - (snmplib/snmpv3.c): added a space in a debugging output statement.
+
+2000-11-16 17:54 hardaker
+
+ * snmplib/read_config.c:
+
+ - (snmplib/read_config.c): simple debugging statement added.
+
+2000-11-16 17:54 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): set DS_LIB_APPTYPE if it hasn't been set yet.
+
+2000-11-16 17:52 hardaker
+
+ * testing/eval_tools.sh:
+
+ - (testing/eval_tools.sh): add CONFIGTRAPD.
+
+2000-11-16 17:50 hardaker
+
+ * snmplib/mib.c, testing/tests/T112agentxsetfail,
+ testing/tests/T122proxysetfail:
+
+ - (snmplib/mib.c, testing/tests/T112agentxsetfail,
+ testing/tests/T122proxysetfail):
+ - support -Ir for "dont check range/type values" (letter r subject to debate).
+
+2000-11-16 17:25 hardaker
+
+ * snmplib/callback.c:
+
+ - (callback.c): better debugging output to display a callback count when done.
+
+2000-11-16 16:52 hardaker
+
+ * testing/tests/T113agentxtrap:
+
+ - (T113agentxtrap): A new test to test trap support from agentx subagents.
+
+2000-11-16 16:50 hardaker
+
+ * testing/tests/T058agentauthtrap:
+
+ - (T058agentauthtrap): sleep some and only perform one get request.
+
+2000-11-16 16:49 hardaker
+
+ * testing/tests/T054agentv2ctrap:
+
+ - (T054agentv2ctrap): sleep a bit and only send one snmp set request.
+
+2000-11-16 15:47 nba
+
+ * snmplib/getopt.c:
+
+ - getopt.c: quell compiler warnings
+
+2000-11-16 15:31 nba
+
+ * snmplib/: parse.c, mib.c, parse.h,
+ snmp_api.c:
+
+ - parse.[ch], mib.c, snmp_api.c: rename TYPE_UINTEGER32 back to TYPE_UINTEGER
+
+2000-11-16 15:16 nba
+
+ * apps/snmptrapd.c, man/snmptrapd.conf.5.def:
+
+ - snmptrapd.c, snmptrapd.conf: new config directives format1 and format2 to
+ set log formats for TRAP1 and TRAP2 pdus.
+
+2000-11-16 13:50 nba
+
+ * snmplib/snmp_api.c:
+
+ - snmp_api.c: add functionality to check value types in addition to ranges
+ for snmpset and snmptrap.
+
+2000-11-16 13:47 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: Fix DEFVAL parsing for OBJECT IDENTIFIER or BITS values
+ (i.e. DEFVAL { { 0 0 } } etc)
+
+2000-11-16 11:39 hardaker
+
+ * testing/tests/T058agentauthtrap:
+
+ - (T058agentauthtrap): add a greater timeout to the get request.
+
+2000-11-16 11:35 hardaker
+
+ * agent/mibgroup/examples/example.c:
+
+ - (example.c):
+ - send a v2c trap using its own data, not the system_mib's.
+ - more debugging statements.
+
+2000-11-16 11:34 hardaker
+
+ * testing/tests/: T053agentv1trap, T054agentv2ctrap,
+ T058agentauthtrap:
+
+ - (T053agentv1trap, T054agentv2ctrap, T058agentauthtrap):
+ - new tests for traps sent by the agent.
+
+2000-11-16 09:56 hardaker
+
+ * agent/mibgroup/target/target.c:
+
+ - (target.c): Don't delete READONLY trap sessions.
+
+2000-11-15 16:37 hardaker
+
+ * testing/tests/T052snmpv2cinform:
+
+ - (testing/tests/T052snmpv2cinform): test inform sending/receiving.
+
+2000-11-15 16:37 hardaker
+
+ * apps/snmptrap.c, man/snmptrap.1:
+
+ - (apps/snmptrap.c, man/snmptrap.1): support -Ci for sending informs.
+
+2000-11-15 15:48 hardaker
+
+ * apps/snmptrapd_log.c:
+
+ - (snmptrapd_log.c): use SNMP_MAXBUF instead of a local length definition.
+
+2000-11-15 14:18 nba
+
+ * local/Makefile.in:
+
+ - Makefile.in: fix make'ing in remote directory
+
+2000-11-15 14:11 nba
+
+ * apps/snmpnetstat/main.c:
+
+ - main.c: update to use getopt for argument parsing.
+
+2000-11-15 14:10 nba
+
+ * agent/snmp_agent.c:
+
+ - snmp_agent.c: fix a confusing indentation.
+
+2000-11-15 14:09 nba
+
+ * agent/agent_trap.c:
+
+ - agent_trap.c: make sure community is \0-terminated in targetParamsTable
+
+2000-11-15 14:03 nba
+
+ * apps/snmptrapd_log.c:
+
+ - snmptrapd_log: fix a buffer that is way too short for a trap with just a
+ single parameter. Fix a bad limit test in str_append.
+
+2000-11-15 14:00 nba
+
+ * apps/snmptranslate.c:
+
+ - snmptranslate.c: fix a stupid perror for snmp_perror
+
+2000-11-15 13:58 nba
+
+ * snmplib/: mib.c, parse.c, parse.h:
+
+ - parse.[ch], mib.c: enhance the parser to distinguish INTEGER, Integer32,
+ Unsigned32, UInteger32.
+
+2000-11-15 13:55 nba
+
+ * snmplib/snmp_api.c:
+
+ snmp_api.c: remove an unused variable
+
+2000-11-15 07:49 hardaker
+
+ * agent/: snmp_vars.c, snmp_vars.h,
+ mibgroup/agentx/subagent.c, mibgroup/agentx/subagent.h
+:
+
+ - (snmp_vars.c, subagent.c): Patch from Lawrence Greenfield:
+ - Don't make init_agent()/subagent_pre_init() exit but return an
+ error condition instead.
+
+2000-11-12 08:08 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.c:
+
+ - (ucdDemoPublic.c): add NULL to end of demo string and check for len=0.
+
+2000-11-12 04:45 nba
+
+ * snmplib/snmp_api.c:
+
+ snmp_api.c: Make sure the noRangeCheck token is a boolean
+
+2000-11-12 04:41 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: give the tree-top a name to protect error message when looking up .foo
+
+2000-11-12 04:36 nba
+
+ * apps/snmptranslate.c:
+
+ - snmptranslate.c: use config_perror for a better error message
+
+2000-11-12 04:34 nba
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ - proxy.c: remove some unused variables.
+
+2000-11-12 04:33 nba
+
+ * agent/agent_trap.c:
+
+ -agent_traps.c: Move a conditionally used variable
+
+2000-11-12 04:32 nba
+
+ * agent/agent_read_config.c:
+
+ Fix a bogus #ifdef
+
+2000-11-10 09:18 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): apply patch #102224 from jbpn for cross-compiling.
+
+2000-11-10 08:56 hardaker
+
+ * testing/: TESTCONF.sh, eval_tools.sh,
+ tests/T051snmpv2ctrap:
+
+ - (testing/TESTCONF.sh, testing/eval_tools.sh, testing/tests/T051snmpv2ctrap):
+ - first pass at a testing script to test trap functionality.
+ - which even uncovered a bug.
+
+2000-11-10 08:55 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (apps/snmptrapd.c):
+ - fork if file logging or syslogging, but not printing.
+ - don't close open file descriptors. There shouldn't be any.
+
+2000-11-10 08:53 hardaker
+
+ * apps/snmptrapd_log.c:
+
+ - (apps/snmptrapd_log.c): properly null terminate log strings.
+
+2000-11-09 16:40 hardaker
+
+ * configure.in:
+
+ - (configure.in): attempt to implement a --with-rsaref flag.
+
+2000-11-09 15:32 hardaker
+
+ * README:
+
+ - (README, perl/SNMP/README): mention Karl.
+
+2000-11-09 15:31 hardaker
+
+ * NEWS, perl/SNMP/README:
+
+ - (NEWS, perl/SNMP/README): mention Karl.
+
+2000-11-09 14:56 hardaker
+
+ * perl/SNMP/: examples/bulkwalk.pl, t/bulkwalk.t:
+
+ - (examples/bulkwalk.pl, t/bulkwalk.t): patch from Karl Schilke:
+ - support bulk requests.
+
+2000-11-09 14:53 hardaker
+
+ * perl/SNMP/: MANIFEST, README, SNMP.pm,
+ SNMP.xs:
+
+ - (MANIFEST, README, SNMP.pm, SNMP.xs): patch from Karl Schilke:
+ - support bulk requests.
+
+2000-11-08 23:33 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): fix -H output.
+
+2000-11-08 23:02 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): make agent_check_and_process() call run_alarms().
+
+2000-11-08 22:45 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ - (diskio.c): fix OID.
+
+2000-11-08 17:06 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ - (SNMP.pm, SNMP.xs): patch from Mark Cavage for default value support.
+
+2000-11-08 17:03 hardaker
+
+ * snmplib/: mib.c, parse.c, parse.h:
+
+ - (mib.c, parse.c, parse.h): minimal DEFVAL parsing support.
+
+2000-11-08 16:20 hardaker
+
+ * config.h.in, configure:
+
+ - (config.h.in, configure): check for librsaref, etc, if needed.
+
+2000-11-07 15:15 hardaker
+
+ * config.h.in, configure, configure.in,
+ agent/agent_read_config.c, agent/snmpd.c:
+
+ - (config.h.in, configure, configure.in, agent/agent_read_config.c,
+ agent/snmpd.c):
+ - uid/gid changes.
+
+2000-11-07 15:10 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ - (SNMP.xs): fix TYPE_NOTIF -> TYPE_NOTIFTYPE.
+
+2000-11-07 11:30 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ - (SNMP/SNMP.pm, SNMP/SNMP.xs): Patch from Joe Clarke:
+ - implement best-guess (-Ib) parsing.
+ - access to trap varbinds.
+ - range access.
+
+2000-11-07 11:00 hardaker
+
+ * perl/SNMP/.cvsignore:
+
+ - (.cvsignore): ignore build created files.
+
+2000-11-07 10:58 hardaker
+
+ * perl/SNMP/: README, SNMP.pm, SNMP.xs:
+
+ - (README, SNMP.pm, SNMP.xs): patch from Karl Schilke:
+ - implement a finish() call.
+
+2000-11-07 10:54 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ - (SNMP/SNMP.xs): patch from Karl Schilke:
+ - multiple callback patch for perl/SNMP/SNMP.xs.
+
+2000-11-07 10:48 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): log an error message if the optional config file DNE.
+
+2000-11-07 10:41 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ - (SNMP.pm): fix iid parsing with respect to mib nodes with a - in it.
+
+2000-11-07 10:13 hardaker
+
+ * agent/agent_read_config.c, agent/ds_agent.h,
+ agent/snmpd.c, man/snmpd.1.def, man/snmpd.conf.5.def
+:
+
+ - (agent/agent_read_config.c, agent/ds_agent.h, agent/snmpd.c,
+ man/snmpd.1.def, man/snmpd.conf.5.def): Patch from Harrie Hazewinkel:
+ - implement uid/gid changes after startup for the agent.
+
+2000-11-07 08:33 hardaker
+
+ * agent/mibgroup/target/target.c:
+
+ - (target.c): a better sanity check for session deletion.
+
+2000-11-07 07:24 hardaker
+
+ * agent/mibgroup/target/target.c:
+
+ - (target.c): Patch from Dave to sanity check param->updateTime.
+
+2000-11-06 11:00 hardaker
+
+ * snmplib/md5.c:
+
+ - (md5.c): check to see that MDsign() data lies on a 32 byte boundry.
+ - its possible some compilers will choke on this hack.
+ - fixes bug #12175.
+
+2000-11-03 17:54 hardaker
+
+ * local/mib2c:
+
+ - (mib2c): sort OIDs properly.
+
+2000-11-03 16:44 hardaker
+
+ * agent/mibgroup/examples/example.c:
+
+ - (example.c): Patch from Harrie Hazewinkel:
+ - fix mib registrations for duplicate OIDs being used for the trap examples.
+
+2000-11-03 15:31 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): second patch from dougwarz in bug #117273 to fix smux problems.
+ - Um, applied correctly this time (I hope).
+
+2000-11-03 15:29 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): second patch from dougwarz in bug #117273 to fix smux problems.
+
+2000-11-02 22:19 nba
+
+ * agent/mibgroup/mibII/: interfaces.c, ip.c, ipAddr.c
+, tcpTable.c, udpTable.c:
+
+ Clean up some unused variables etc.
+
+2000-11-02 22:16 nba
+
+ * Makefile.in:
+
+ - Makefile.in: fix some $(srcdir) references when running outside source
+
+2000-11-02 22:15 nba
+
+ * apps/snmptrapd.c:
+
+ - snmptrapd.c: fix the format string for format_trap
+
+2000-11-02 22:14 nba
+
+ * man/Makefile.in:
+
+ - Makefile.in: remove some duplicates from file lists
+
+2000-11-02 22:12 nba
+
+ * man/snmpcmd.1:
+
+ Document the -OX output option
+
+2000-11-02 22:11 nba
+
+ * man/snmpd.conf.5.def:
+
+ Document the sysservices token
+
+2000-11-02 16:17 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ - (agent/mibgroup/ucd_snmp.h): add ucd-snmp/proxy.
+
+2000-11-02 16:16 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ - (agent/mibgroup/versiontag): change cvs archive site and package name.
+
+2000-11-02 13:23 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): Patch 102239 from dougwarz to fix a previously bad smux.c patch.
+
+2000-11-01 16:36 hardaker
+
+ * README, bug-report, sedscript.in, version.h
+, FAQ:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.2.pre1 )
+
+2000-11-01 16:14 hardaker
+
+ * testing/tests/: T120proxyget, T121proxyset,
+ T122proxysetfail:
+
+ - (T120proxyget, T121proxyset, T122proxysetfail): proxy test suite.
+
+2000-11-01 16:08 hardaker
+
+ * agent/mibgroup/ucd-snmp/: proxy.c, proxy.h:
+
+ - (agent/mibgroup/ucd-snmp/proxy.c, agent/mibgroup/ucd-snmp/proxy.h):
+ - minimal SET support for the proxy code.
+
+2000-11-01 10:22 hardaker
+
+ * testing/tests/T112agentxsetfail:
+
+ - (T112agentxsetfail): test for agentx sets that should fail properly.
+
+2000-10-31 14:30 nba
+
+ * agent/mibgroup/mibII/tcpTable.c:
+
+ - tcpTable.c: remove an unnescessary #include
+
+2000-10-31 14:28 nba
+
+ * agent/mibgroup/smux/smux.c:
+
+ - smux.c: fix wrong variable length
+
+2000-10-31 14:25 nba
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - protocol.c: fix some suspicious looking code
+
+2000-10-31 14:21 nba
+
+ * man/snmpd.conf.5.def:
+
+ - man/snmpd.conf: fix a typo
+
+2000-10-31 12:41 nba
+
+ * snmplib/default_store.h, snmplib/mib.c,
+ apps/snmptable.c:
+
+ - mib.c: add -OX output format, for just another way of printing indices
+
+2000-10-31 12:27 nba
+
+ * agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, man/snmpd.conf.5.def
+:
+
+ - interface.c: add "interface" config for unguessable interface type/speed
+
+2000-10-31 12:25 nba
+
+ * apps/: snmpbulkget.c, snmpbulkwalk.c, snmpdelta.c
+, snmpdf.c, snmpget.c, snmpgetnext.c,
+ snmpset.c, snmpstatus.c, snmptable.c,
+ snmptrap.c, snmpusm.c, snmpvacm.c, snmpwalk.c
+:
+
+ - apps/*: make sure we report any errindex/errcode in the response
+
+2000-10-31 12:04 nba
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - protocol.c: clean up unused variables.
+
+2000-10-31 10:13 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): patch #1 from bug #117273 applied to fix smux socket problems.
+
+2000-10-31 09:24 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ - (SNMP.xs): print counter64's as unsigned.
+
+2000-10-31 07:54 hardaker
+
+ * agent/: agent_trap.c, agent_trap.h,
+ mibgroup/agentx/subagent.c,
+ mibgroup/notification/snmpNotifyTable.c,
+ mibgroup/notification/snmpNotifyTable.h:
+
+ - (agent_trap.c, agent_trap.h, subagent.c, snmpNotifyTable.c,
+ snmpNotifyTable.h): Patch from Dave:
+ - fix notifications from agentx subagents.
+
+2000-10-30 22:03 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): fix bug #119786: make smux reuse socket address.
+
+2000-10-30 21:42 hardaker
+
+ * testing/: eval_tools.sh, tests/T110agentxget,
+ tests/T111agentxset:
+
+ - (eval_tools.sh, tests/T110agentxget, tests/T111agentxset):
+ - fix bug #382
+ - fix agentx non-root tests to use -x /tmp/blah/agentx_socket.
+
+2000-10-30 13:45 hardaker
+
+ * man/snmpd.1.def:
+
+ - (snmpd.1.def): fix a typo pointed out by Chris Pepper.
+
+2000-10-30 11:46 hardaker
+
+ * testing/tests/T111agentxset:
+
+ - (tests/T111agentxset): test script for AgentX set support.
+
+2000-10-30 11:43 hardaker
+
+ * testing/tests/T110agentxget:
+
+ - (tests/T110agentxget): header changed to include the word GET.
+
+2000-10-30 11:13 nba
+
+ * agent/mibgroup/ucd_snmp.h, agent/mibgroup/ucd-snmp/dlmod.c
+, agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.h,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ mibs/UCD-SNMP-MIB.txt:
+
+ - ucd-snmp/vmstat_*, memory_freebsd2.c, dlmod.c: Make ssRawCpu objects Counters,
+ and add support for *BSD (including OpenBSD)
+
+2000-10-30 11:07 nba
+
+ * agent/agent_trap.c, agent/snmp_agent.c,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c, snmplib/asn1.c,
+ snmplib/scapi.c, snmplib/snmpusm.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/target.c:
+
+ - Clean up unused variables.
+
+2000-10-30 11:04 hardaker
+
+ * testing/tests/: T101agentx, T110agentxget:
+
+ - (testing/tests/T101agentx, testing/tests/T110agentxget):
+ - renamed the agentx test script.
+
+2000-10-30 11:03 hardaker
+
+ * testing/eval_tools.sh:
+
+ - (testing/eval_tools.sh): don't add -c CONFIGFILE if it doesn't exist.
+
+2000-10-30 10:39 hardaker
+
+ * agent/snmpd.c:
+
+ - (agent/snmpd.c): error when parsing -X for non-agentx builds.
+
+2000-10-27 11:29 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (apps/snmptrapd.c): add -o flag to log to a particular file.
+
+2000-10-27 10:41 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): use mkstemp if available.
+
+2000-10-27 10:40 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in): Search for mkstemp().
+
+2000-10-27 10:08 hardaker
+
+ * FAQ:
+
+ - (FAQ): update linux kernel list to include 2.2.
+
+2000-10-26 17:51 hardaker
+
+ * testing/eval_tools.sh:
+
+ - (eval_tools.sh): make SKIPIFNOT check the mib module list too.
+
+2000-10-26 17:48 hardaker
+
+ * testing/tests/T101agentx:
+
+ - (tests/T101agentx): AgentX subagent test for simple get retrieval.
+
+2000-10-25 17:44 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Add -X option to snmpd to run as a subagent.
+
+2000-10-25 17:06 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): fix for cases whene debugging is always off.
+
+2000-10-17 15:30 hardaker
+
+ * config.h.in:
+
+ - (config.h.in): autoheader run
+
+2000-10-16 03:13 daves
+
+ * agent/mibgroup/agentx/master.c:
+
+ - (agentx/master.c): Specify the length of the (pseudo-)answer to a request.
+ This allows it to be cached correctly for multi-pass SET handling.
+
+2000-10-16 03:11 daves
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - (agentx/subagent.c): Don't overwrite saved mode information
+ This should help with (some of) the SET handling problems.
+
+2000-10-16 01:56 daves
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (agentx/master_request.c): Don't free callback data structure.
+ This holds information that needs to persist across multi-pass requests.
+ I realise that this introduces a memory leak, but this isn't the
+ correct place to handle this.
+
+2000-10-12 14:52 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): add -I to the help output.
+
+2000-10-12 14:24 hardaker
+
+ * agent/dlmods/: Makefile.in, dlmod_mib.c, dlmod_mib.h
+, example.c, example.h:
+
+ - (agent/dlmods/*): remove obsolete versions
+
+2000-10-12 14:08 hardaker
+
+ * configure:
+
+ - (configure): update.
+
+2000-10-12 14:01 hardaker
+
+ * acconfig.h, config.h.in, configure.in:
+
+ - (acconfig.h, config.h.in, configure.in): Patch from Matt Braithwaite:
+ - udp configuration changes to check for misc structure definitions.
+
+2000-10-12 13:48 hardaker
+
+ * mibs/TUNNEL-MIB.txt:
+
+ - (TUNNEL-MIB.txt): TUNNEL-MIB definition.
+
+2000-10-12 13:48 hardaker
+
+ * agent/mibgroup/tunnel.h:
+
+ - (tunnel.h): config_add_mib(TUNNEL-MIB).
+
+2000-10-12 13:47 hardaker
+
+ * agent/mibgroup/: tunnel.h, tunnel/tunnel.c,
+ tunnel/tunnel.h:
+
+ - (tunnel.h, tunnel.c, tunnel.h): Patch from Frank Strauss:
+ - implement the TUNNEL-MIB.
+
+2000-10-10 14:33 mslifcak
+
+ * snmplib/parse.c:
+
+ Fix unlink_tree for "top level" tree nodes.
+
+2000-10-10 11:02 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): reverse library link ordering again...
+
+2000-10-10 09:03 mslifcak
+
+ * apps/snmptranslate.c:
+
+ Remove relative path to include system.h.
+
+2000-10-10 06:53 mslifcak
+
+ * snmplib/system.h:
+
+ Remove unneeded decl of vsnprintf without stdarg/varargs decl of va_list.
+
+2000-10-10 05:15 mslifcak
+
+ * config.sub:
+
+ Apply patch for DEC Alpha EV6, supplied by Shumon Huque<shuque@isc.upenn.edu>
+
+2000-10-09 17:06 mslifcak
+
+ * snmplib/mib.c:
+
+ patch to fix leading zero error introduced by changes for shutdown_mib.
+
+2000-10-09 15:51 hardaker
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ - (dlmod.c): minor debugging output additions.
+
+2000-10-09 15:51 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): move auto_nlist to libucdmibs.
+
+2000-10-09 11:43 hardaker
+
+ * FAQ, README:
+
+ - (FAQ, README): add new mirror.
+
+2000-10-09 10:26 mslifcak
+
+ * snmplib/: mib.c, parse.c, read_config.c,
+ snmp_api.c:
+
+ Move config- and store-related cleanup from shutdown_mib to snmp_shutdown.
+
+2000-10-09 02:36 daves
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (mibII/interfaces.c): Qualify an individual interface type test symbol
+ (Qn: should any/all of the others be qualified as well?)
+
+2000-10-06 08:56 mslifcak
+
+ * man/Makefile.in, man/default_store.3.bot,
+ man/default_store.3.top, man/mib_api.3,
+ man/shutdown_mib.3, snmplib/default_store.c,
+ snmplib/default_store.h, snmplib/mib.c,
+ snmplib/mib.h, snmplib/parse.c, snmplib/parse.h
+, snmplib/read_config.c, snmplib/read_config.h:
+
+ Support for shutdown_mib - clearing the MIB trees and configured registrations.
+
+2000-10-06 05:33 mslifcak
+
+ * snmplib/system.c:
+
+ Plug memory leak for ucd-supplied setenv on Win32 platform.
+
+2000-10-06 04:58 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Remove unused variables.
+
+2000-10-05 23:45 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: fix silly bug in new oid parser, when leaving the tree and going
+ into sub-ids we know nothing about
+
+2000-10-05 16:03 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): Patch from Harrie Hazewinkel:
+ - fix library dependency order.
+
+2000-10-04 17:59 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in): install "extending" snmpconf file.
+
+2000-10-04 14:50 nba
+
+ * FAQ:
+
+ - FAQ: fix a confusion between "omit" and "include"
+
+2000-10-04 13:25 hardaker
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ - (pass_persist.c): opaques in pass_persist.
+
+2000-10-04 10:35 hardaker
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ - (pass.c): support opaque return types.
+
+2000-10-04 07:15 mslifcak
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/mib.c:
+
+ Fix parsing problem for -Pc option; reported by Christian Mautner.
+
+2000-10-04 06:52 mslifcak
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ qualify symbols for new i/f types.
+
+2000-10-04 06:51 mslifcak
+
+ * agent/mibgroup/examples/example.c:
+
+ Terminate list to compile (add a comma).
+
+2000-10-04 00:18 nba
+
+ * apps/snmptable.c:
+
+ - snmptable.c: index columnt (-Ci) width not properly computed when using
+ GETBULK
+
+2000-10-03 18:19 hardaker
+
+ * agent/: agent_registry.c, agent_registry.h, snmpd.c
+:
+
+ - (agent_registry.c, agent_registry.h, snmpd.c): Patch from John Naylon:
+ - add a passback argument to register_readfd() callbacks.
+
+2000-10-03 18:17 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): Patch from Harrie Hazewinkel:
+ - move auto_nlist.o/lo to libucdagent since some mib-modules need it.
+
+2000-10-03 18:07 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): Patch from Jochen Friedrich:
+ - fix getnext requests to subagents.
+
+2000-10-03 17:24 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c): Patch from Frank Strauss:
+ - better iftype guessing.
+
+2000-10-03 16:52 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): Patch from Doug Warzecha:
+ - fix oid parsing in traps.
+
+2000-10-03 16:23 hardaker
+
+ * agent/mibgroup/examples/: example.c, example.h:
+
+ - (example.c, example.h): example of coding a v2 trap from someone who
+ I have very sadly forgotten. I've been looking for that message for
+ a while to properly attribute this patch. Sigh.
+
+2000-10-03 16:21 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Patch from Douglas Warzecha:
+ - snmpd returns wrong error index on SNMPv1 request (BUG#375).
+
+2000-10-03 09:12 mslifcak
+
+ * agent/agent_trap.c:
+
+ Fix null deref of ss->community, reported by Jim Pickering.
+
+2000-10-03 08:03 mslifcak
+
+ * apps/encode_keychange.c, apps/snmpvacm.c,
+ snmplib/parse.c, snmplib/read_config.c,
+ snmplib/snmp_logging.c, snmplib/snmpv3.c,
+ snmplib/snprintf.c, snmplib/vacm.c:
+
+ Casting to fix problems building with aCC
+ Thanks to Markku Laukkanen <pky@moremagic.com>
+
+2000-10-03 05:59 mslifcak
+
+ * agent/snmpd.c, apps/snmptrapd.c:
+
+ Remove chdir to undo fix for (BUG#298)
+
+2000-10-02 21:41 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: Escape " and \ in text strings.
+
+2000-10-02 21:39 nba
+
+ * snmplib/snmp_logging.c:
+
+ - snmp_logging.c: #include <netinet/in.h>
+
+2000-10-02 21:38 nba
+
+ * local/Makefile.in:
+
+ - Makefile.in: fix a missing $(srcdir) during make install of mib2c
+ configuration files
+
+2000-10-02 21:37 nba
+
+ * apps/snmpset.c:
+
+ - snmpset.c: Do a exit(2) for failure in setting the variable.
+
+2000-10-02 21:36 nba
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ - hr_swrun.c: add a safeguard for very long argument lists.
+
+2000-10-02 21:34 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ - hr_disk.c: Add a name pattern that matches x86 IDE disks for Solaris.
+
+2000-10-02 21:33 nba
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - kernel_sunos5.c: make the buffer for SIOCGIFCONF dynamic.
+
+2000-10-02 11:41 hardaker
+
+ * snmplib/Makefile.in:
+
+ - (Makefile.in): install snmpusm.h.
+
+2000-10-02 10:48 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf):
+ - new options for installing created files.
+ - more comments in the code.
+ - allow reading a .conf directly to writing for auto-commenting .conf files.
+ - misc.
+
+2000-10-02 10:47 hardaker
+
+ * agent/: Makefile.in, mibgroup/Makefile.in:
+
+ - (agent/mibgroup/Makefile.in, agent/Makefile.in): make depend-less.
+
+2000-10-02 09:35 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): protect against 0 byte statP mallocs.
+
+2000-10-02 09:14 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c): Patch from Ted Rule:
+ - fix interfaces.c for variable length number formatting in /proc/net/dev.
+
+2000-10-01 16:40 mslifcak
+
+ * agent/snmpd.c, apps/snmptrapd.c:
+
+ Per Niels recommendation, chdir to PERSISTENT_DIRECTORY (re: bug #298)
+
+2000-09-30 08:57 mslifcak
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Fix DEBUGMSGTL not found error for builds without dlmod support.
+ Thanks to simon@zid.tuwein.ac.at
+
+2000-09-29 14:35 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in, testing/Makefile.in:
+
+ - (*/Makefile.in): make depend + .o -> .lo fixes.
+
+2000-09-29 14:27 hardaker
+
+ * makefileindepend.pl:
+
+ - (makefileindepend.pl): skip empty depend lines.
+
+2000-09-29 14:09 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf): drop duplicate lines from read in snmpd.conf files.
+
+2000-09-29 13:46 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf): sort unknown directives by filetype (whoops).
+
+2000-09-29 13:42 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf): print more information/comments to the screen.
+
+2000-09-29 11:31 hardaker
+
+ * agent/var_struct.h:
+
+ - (var_struct.h): increase registration name length to 32 from 16 (Bug #172)
+
+2000-09-29 11:12 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): incorrect val length passed to parse_unsigned_int (Bug #339).
+
+2000-09-29 11:01 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): fix Bug#353 for hostnames that look like "5w".
+ - don't interprete them as an ip-port.
+
+2000-09-29 10:39 hardaker
+
+ * snmplib/snmp_alarm.c:
+
+ - (snmp_alarm.c): Patch from jbpn@cambridgebroadband.com:
+ - There is a peculiarity in the snmp_alarm_unregister function in
+ snmplib/snmp_alarm.c which can cause a segmentation fault. (Bug #367)
+
+2000-09-29 10:34 hardaker
+
+ * agent/mibgroup/target/snmpTargetParamsEntry.c:
+
+ - (snmpTargetParamsEntry.c): Patch from John Naylon:
+ - fix use of NULL timestamp pointer in new row creation (Bug #346)
+
+2000-09-28 14:38 nba
+
+ * man/mib_api.3:
+
+ - mib_api.3: add a few functions to the header
+
+2000-09-28 14:14 nba
+
+ * apps/snmptrap.c:
+
+ - snmptrap.c: remove an extraneous snmp_free_pdu
+
+2000-09-28 14:13 nba
+
+ * man/: Makefile.in, add_mibdir.3,
+ add_module_replacement.3, get_module_node.3, init_mib.3
+, init_mib_internals.3, print_description.3,
+ print_mib.3, print_objid.3, print_value.3,
+ print_variable.3, read_all_mibs.3, read_mib.3,
+ read_module.3, read_module_node.3, read_objid.3,
+ snmp_set_mib_warnings.3, snmp_set_save_descriptions.3:
+
+ - man/: add man entries for many library functions (pointing to snmp_api.3)
+
+2000-09-28 11:09 mslifcak
+
+ * agent/mibgroup/mibII/udpTable.c:
+
+ remove second copy of sys/socket.h
+
+2000-09-27 12:59 hardaker
+
+ * agent/mibgroup/ucd-snmp/dlmod.h:
+
+ - (dlmod.h): add the UCD-DLMOD-MIB to the default load list.
+
+2000-09-27 12:55 hardaker
+
+ * config.h.in, configure, configure.in,
+ agent/mibgroup/ucd_snmp.h, agent/mibgroup/ucd-snmp/dlmod.c
+:
+
+ - (config.h.in, configure, configure.in, ucd_snmp.h, dlmod.c):
+ - include ucd-snmp/dlmod by default.
+ - build code only if dlopen is found.
+
+2000-09-27 08:31 hardaker
+
+ * agent/auto_nlist.c:
+
+ - (auto_nlist.c): Patch from Harrie Hazewinkel:
+ - don't print kernel based warning messages when -r, etc, is specified.
+
+2000-09-26 13:17 mslifcak
+
+ * win32/config.h:
+
+ For Win32 API: Declare strtoul, vsnprintf; Enable reverse BER encoding.
+
+2000-09-26 13:15 mslifcak
+
+ * snmplib/snmp_logging.c:
+
+ Include system.h (vsnprintf decl)
+
+2000-09-26 13:14 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Fix unsigned comparison.
+
+2000-09-26 13:14 mslifcak
+
+ * snmplib/mib.c:
+
+ Fix unsigned comparisons.
+
+2000-09-26 13:13 mslifcak
+
+ * apps/snmptable.c:
+
+ Fix signed comparison; Remove unused var.
+
+2000-09-26 13:12 mslifcak
+
+ * apps/snmpdf.c:
+
+ Include getopt.h (optarg decl); Remove unused var.
+
+2000-09-26 13:11 mslifcak
+
+ * agent/mibgroup/util_funcs.c:
+
+ Match Initialise_Table args 3,4 declarations with definitions.
+
+2000-09-26 12:58 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c): make the adminstatus RONLY.
+
+2000-09-26 10:21 hardaker
+
+ * local/mib2c:
+
+ - (mib2c): chomp($1) is illegal.
+
+2000-09-26 03:04 mslifcak
+
+ * acconfig.h, config.h.in,
+ agent/mibgroup/util_funcs.c, win32/config.h:
+
+ Explicitly build path to CACHEFILE, as not all C compilers support "##".
+
+2000-09-25 16:56 mslifcak
+
+ * agent/snmpd.c:
+
+ chdir just before sending coldstart trap, to allow for paths to be
+ resolved.
+
+2000-09-25 09:35 mslifcak
+
+ * snmplib/snmp_parse_args.c:
+
+ case insensitive token search (use strcasecmp).
+
+2000-09-22 06:03 nba
+
+ * mibs/: HCNUM-TC.txt, IF-INVERTED-STACK-MIB.txt,
+ INET-ADDRESS-MIB.txt, IP-FORWARD-MIB.txt, smistrip
+:
+
+ -mibs/: MIB updates
+
+2000-09-22 05:55 nba
+
+ * mibs/: IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt,
+ IANAifType-MIB.txt, MTA-MIB.txt, Makefile.in,
+ Makefile.mib, NETWORK-SERVICES-MIB.txt, RFC-1215.txt
+, RFC1155-SMI.txt, RFC1213-MIB.txt:
+
+ - mibs/: MIB updates
+
+2000-09-22 05:52 nba
+
+ * man/snmpset.1, man/snmptrap.1, snmplib/snmp_api.c
+, apps/snmpset.c:
+
+ - snmp_api.c: support setting of BITS variables
+
+2000-09-22 05:50 nba
+
+ * apps/snmpstatus.c:
+
+ - snmpstatus.c: show error object
+
+2000-09-22 04:29 nba
+
+ * apps/snmpusm.c:
+
+ - snmpusm.c: issue error message with object
+
+2000-09-22 04:28 nba
+
+ * snmplib/system.h:
+
+ - system.h: provide prototypes for strtol, strtoul, snprintf, vsnprintf
+
+2000-09-22 04:27 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - vacm_vars.c: protect against overrun of strings
+
+2000-09-21 16:17 nba
+
+ * apps/: snmpbulkget.c, snmpbulkwalk.c, snmpdelta.c
+, snmpget.c, snmpgetnext.c, snmpset.c,
+ snmpstatus.c, snmptable.c, snmptest.c,
+ snmpwalk.c:
+
+ - apps/: display failed object when one is identified by pdu->errindex
+
+2000-09-21 15:59 hardaker
+
+ * man/: Makefile.in, snmpdf.1:
+
+ - (Makefile.in, snmpdf.1): document the snmpdf command.
+
+2000-09-21 15:50 nba
+
+ * man/snmptable.1, apps/snmptable.c:
+
+ - snmptable: use GETBULK to collect data when protocol allows it. Add
+ -CB options to fall back to GETNEXT.
+
+2000-09-21 15:38 nba
+
+ * snmplib/default_store.h, snmplib/mib.c,
+ man/snmpcmd.1:
+
+ - mib.c: rewrite index handling in object ids, to allow symbolic enums.
+ Add Daves suggested -Ov output. Also enhace -Td output to
+ destinguish OBJECT-TYPE from TRAP-TYPE, MODULE-IDENTITY etc.
+
+2000-09-21 15:31 hardaker
+
+ * apps/snmpdf.c:
+
+ - (snmpdf.c): use the UCD-SNMP-MIB's dskTable if the
+ HOST-RESOURCES-MIB is empty or if -Cu is specified on the command line.
+
+2000-09-21 15:28 nba
+
+ * snmplib/: parse.c, parse.h:
+
+ - parse.c: add ability to collect VARIABLES/OBJECTS for TRAP-TYPE
+ and NOTIFICATION-TYPE. Ignore files that does not have DEFINITIONS
+ as their second token. Enhance -Td output accordingly.
+
+2000-09-21 15:22 nba
+
+ * snmplib/snprintf.c, snmplib/strtol.c,
+ snmplib/strtoul.c, snmplib/Makefile.in,
+ snmplib/snmp_logging.c, acconfig.h, configure.in
+, config.h.in, configure:
+
+ - snmplib: add snprintf, strtol, strtoul for systems that don't have them
+
+2000-09-21 15:10 hardaker
+
+ * snmplib/mib.h:
+
+ - (mib.h): add fake struct definition for enums
+
+2000-09-21 14:16 nba
+
+ * snmplib/strtoul.c:
+
+ file strtoul.c was initially added on branch V4-1-1-patches.
+
+2000-09-21 14:16 nba
+
+ * snmplib/strtol.c:
+
+ file strtol.c was initially added on branch V4-1-1-patches.
+
+2000-09-21 14:16 nba
+
+ * snmplib/snprintf.c:
+
+ file snprintf.c was initially added on branch V4-1-1-patches.
+
+2000-09-21 06:16 hardaker
+
+ * snmplib/: mib.c, mib.h:
+
+ - (mib.c, mib.h): make sprint* non-static (bug #132).
+
+2000-09-21 00:25 hardaker
+
+ * snmplib/snmp_alarm.c:
+
+ - (snmp_alarm.c): Patch from John Naylon:
+ - fix bug #360 where a client might remove a alarm registration
+ during a call to the alarm function and invalidate the pointer
+ being used by the calling function.
+
+2000-09-21 00:22 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): --disable-shared by default in cvs checkouts.
+
+2000-09-20 17:31 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf): space indent tokens if # prepended.
+
+2000-09-20 17:30 hardaker
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c,
+ snmpTargetParamsEntry.c:
+
+ - (snmpTargetAddrEntry.c, snmpTargetParamsEntry.c): null internal help lines.
+
+2000-09-20 17:29 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in, monitor): disk, proc, and load checks.
+
+2000-09-20 17:27 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/usmUser.c, snmplib/snmpv3.c:
+
+ - (vacm_vars.c, usmUser.c, snmpv3.c): NULL out help messages for .conf
+ tokens that are either internal or no longer the standard way of
+ doing things.
+
+2000-09-20 17:26 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): export SNMPCONFPATH to Makefiles
+
+2000-09-20 17:25 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): minor correction of table name. More errors exist.
+
+2000-09-20 16:46 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in, debugging, mibs, output): more snmp.conf snmpconf config files.
+
+2000-09-20 15:17 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in, authopts): snmp.conf support for basic authentication options.
+
+2000-09-20 14:55 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf):
+ - don't force reading of /usr/local/share/snmpd.conf.
+ - don't print unknown directive comment headers if there aren't any.
+
+2000-09-20 14:45 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf): space things out on the screen a bit better.
+
+2000-09-20 14:35 hardaker
+
+ * local/: Makefile.in, snmpconf:
+
+ - (Makefile.in, snmpconf): install snmpconf and its various support files.
+
+2000-09-20 14:20 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c, snmp_api.h): do reverse v3 header encoding with a static buffer.
+
+2000-09-20 11:37 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf): misc updates and improvements.
+
+2000-09-20 08:54 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Fix dynamic array problem pointed out by Jochen Kmietsch.
+
+2000-09-20 02:05 daves
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - (agentx/protocol.c): Don't include context strings on PDUs that shouldn't have them
+ (Thanks to Pedro Pereira for identifying this)
+
+2000-09-19 17:06 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf): read older configuration files in and merge with new results.
+
+2000-09-19 14:40 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): print pdu type on debugging dump output.
+
+2000-09-19 14:15 hardaker
+
+ * snmplib/: asn1.c, snmp.c:
+
+ - (asn1.c, snmp.c): reverse encoding support for specialized opaque
+ datatypes (float, double, etc).
+
+2000-09-19 14:15 hardaker
+
+ * aclocal.m4:
+
+ - (aclocal.m4): document macros a bit more for submission to the
+ autoconf macro library.
+
+2000-09-19 08:30 mslifcak
+
+ * agent/mibgroup/mibII/at.c:
+
+ Fix bug #295 reported by John Whitney johnw@aiinet.com
+
+2000-09-18 14:59 hardaker
+
+ * agent/: snmp_vars.h, snmpd.h:
+
+ - (snmp_vars.h, snmpd.h): Patch from Harrie Hazewinkel:
+ - move getStatPtr definition to proper .h file.
+
+2000-09-18 14:55 mslifcak
+
+ * apps/Makefile.in:
+
+ Fix bug #347 reported by das_deniz@yahoo.com: make sbin install dir
+
+2000-09-14 09:05 hardaker
+
+ * agent/agent_read_config.c, man/snmpd.conf.5.def:
+
+ - (agent_read_config.c, snmpd.conf.5.def): Patch from Harrie Hazewinkel:
+ - add a port specification snmpd.conf token.
+
+2000-09-14 08:52 hardaker
+
+ * agent/agent_trap.c:
+
+ - (agent_trap.c): ignore output of gethostbyname for trap session adding.
+
+2000-09-13 15:06 hardaker
+
+ * local/snmpconf:
+
+ - (snmpconf): new utility to generate .conf files by prompting the
+ user with questions.
+
+2000-09-08 13:07 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ - (proxy.c): Patch from Scott Lipcon:
+ - fix proxy support for null length strings.
+
+2000-09-07 10:12 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in):
+ - fix openssl checks.
+ - run autoheader.
+
+2000-09-05 13:35 mslifcak
+
+ * agent/snmpd.c, agent/mibgroup/util_funcs.c,
+ apps/snmpbulkget.c, apps/snmpbulkwalk.c,
+ apps/snmpdelta.c, apps/snmpdf.c, apps/snmpget.c
+, apps/snmpgetnext.c, apps/snmpset.c,
+ apps/snmpstatus.c, apps/snmptable.c, apps/snmptest.c
+, apps/snmptrap.c, apps/snmpusm.c,
+ apps/snmpvacm.c, apps/snmpwalk.c:
+
+ Minor touchups to build on Win32 platform.
+
+2000-09-05 13:34 mslifcak
+
+ * win32/: win32.dsw, libsnmp_dll/libsnmp.def,
+ snmpdf/.cvsignore, snmpdf/snmpdf.dsp,
+ snmpvacm/.cvsignore, snmpvacm/snmpvacm.dsp:
+
+ Welcome the newest ucd-snmp applications to the Win32 builds.
+
+2000-09-04 15:19 nba
+
+ * snmplib/read_config.c:
+
+ - read_config.c: restart errorcount when reloading config
+
+2000-09-04 15:12 nba
+
+ * man/snmpnetstat.1:
+
+ - snmpnetstat.1: align man page with program
+
+2000-09-04 15:10 nba
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ - ipAddr.c: remove a bad ntohl for OpenBSD
+
+2000-09-04 15:09 nba
+
+ * agent/mibgroup/: mibincl.h, mibII/tcp.c,
+ mibII/tcpTable.c, mibII/udp.c, mibII/udpTable.c:
+
+ - mibincl.h, {tc,ud}p{,Table}.c: ensure just one include of socket.h
+ to make unprotected include file in Ultrix happy
+
+2000-09-04 15:05 nba
+
+ * configure.in, configure:
+
+ - configure.in: make --without-libwrap work
+
+2000-09-01 15:14 hardaker
+
+ * agent/mibgroup/ucd-snmp/: vmstat_solaris2.c,
+ vmstat_solaris2.h:
+
+ - (vmstat_solaris2.c, vmstat_solaris2.h): Patch from Jochen Kmietsch:
+ - updated code.
+
+2000-09-01 11:54 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): Scott Lipcon noted that snmptrapd doesn't support -T.
+
+2000-08-30 13:28 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: fix loop in syntax error in DEFVAL clause. Also fix reading
+ of .index file with filenames containing blanks.
+
+2000-08-28 13:43 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ minor syntax glitch in POD docs
+
+2000-08-24 01:55 daves
+
+ * apps/snmptable.c:
+
+ - (apps/snmptable.c): Fix bug with displaying header-less indexed tables
+ (Thanks to Ernie Miller)
+
+2000-08-19 11:29 mslifcak
+
+ * snmplib/asn1.c:
+
+ Apply patch from <Christoph.Mammitzsch@tu-clausthal.de>
+ to fix sign in asn_rbuild_unsigned_int .
+
+2000-08-18 04:18 mslifcak
+
+ * agent/mibgroup/mibincl.h:
+
+ restore previous version; openbsd, solaris, linux build ok.
+
+2000-08-18 03:44 mslifcak
+
+ * snmplib/read_config.c:
+
+ remove unused printf argument passed to snmp_log.
+
+2000-08-18 03:20 mslifcak
+
+ * perl/SNMP/Makefile.PL:
+
+ fix bug 253 with patch supplied by Jeffrey Honig <jch@bsdi.com>
+
+2000-08-18 02:52 mslifcak
+
+ * testing/tests/: T020snmpv3get, T021snmpv3getnext:
+
+ fix bug 318 - test 9 and 10 explicitly create the test user.
+
+2000-08-17 13:42 mslifcak
+
+ * apps/snmptest.c:
+
+ The battle to trim newlines correctly continues...reduce length by one.
+
+2000-08-16 15:04 hardaker
+
+ * snmplib/: snmp_api.c, snmpusm.c:
+
+ - (snmp_api.c, snmpusm.c): fix various encryption/decryption problems.
+
+2000-08-16 15:03 hardaker
+
+ * snmplib/scapi.c:
+
+ - (scapi.c): fix padding size in encryption.
+
+2000-08-16 14:48 hardaker
+
+ * snmplib/scapi.c:
+
+ - (scapi.c): set plaintext length at the end of sc_decrypt.
+
+2000-08-15 05:08 mslifcak
+
+ * FAQ:
+
+ Fix bug 284 with a short explanation about snmp.conf.
+
+2000-08-15 03:00 mslifcak
+
+ * INSTALL:
+
+ Fix bug 283 - umask 022, make install. Thanks to csaba.toth@szk.bke.hu
+
+2000-08-15 00:08 nba
+
+ * apps/: snmptest.c (V4-1-1-patches.2), snmptest.c:
+
+ - snmptest.c: overhaul input_variable, kill newline
+
+2000-08-14 22:05 nba
+
+ * aclocal.m4, configure.in, configure (V4-1-1-patches.[1,0,0]),
+ aclocal.m4, configure, configure.in:
+
+ - aclocal.m4, configure.in: fixes for configure --silent
+
+2000-08-14 17:27 hardaker
+
+ * Makefile.top, configure, configure.in:
+
+ - (Makefile.top, configure, configure.in):
+ - --enable-silent-libtool to make Niels smile.
+
+2000-08-14 17:17 hardaker
+
+ * snmplib/: snmpv3.c, snmpv3.h:
+
+ - (snmpv3.c, snmpv3.h): implement a new (default) engineID type based
+ on a random number, and a timestamp.
+ - I think it won't invalidate existing installations (heh).
+
+2000-08-14 16:47 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c):
+ - if -Dread_config, then print even no-help tokens and a * for PREMIB ones.
+
+2000-08-14 14:51 nba
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/agent_trap.c,
+ agent/mib_modules.c, agent/mibgroup/mibincl.h,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c, apps/snmpbulkget.c
+, snmplib/getopt.h, snmplib/scapi.c,
+ snmplib/snmp_alarm.c, snmplib/snmp_api.c,
+ snmplib/snmp_logging.c, snmplib/snmpusm.c:
+
+ - (many): portability fixes for OpenBSD 2.6, FreeBSD 4.1, Ultrix 4.5
+
+2000-08-14 11:33 hardaker
+
+ * snmplib/keytools.c:
+
+ - (keytools.c): Patch from Yigal Hochberg:
+ - remove unused context variables.
+
+2000-08-14 11:29 hardaker
+
+ * snmplib/scapi.c:
+
+ - (scapi.c): Patch from Yigal Hochberg:
+ - remove duplicate keylength check.
+
+2000-08-11 13:09 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): optimize reverse encoding of varbindlists.
+
+2000-08-11 08:55 hardaker
+
+ * local/README.mib2c:
+
+ - (README.mib2c): Patch from Jan Alfred Sandven:
+ - typos.
+
+2000-08-11 06:05 nba
+
+ * apps/: snmpbulkget.c, snmpbulkwalk.c, snmpdelta.c
+, snmpdf.c, snmpget.c, snmpgetnext.c,
+ snmpset.c, snmpstatus.c, snmptable.c,
+ snmptest.c, snmptrap.c, snmpusm.c, snmpvacm.c
+, snmpwalk.c:
+
+ - apps/*: snmpapp -V should not give the usage message too.
+
+2000-08-11 00:43 nba
+
+ * man/: snmptrapd.8 (V4-1-1-patches.2), snmptrapd.8:
+
+ - snmptrapd.8: fix typo. Thanks to G. Allen Morris III <gam3@acm.org>
+
+2000-08-10 23:23 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: predefine ObjectSyntax, ApplicationSyntax, SimpleSyntax and
+ ObjectName
+
+2000-08-10 16:20 hardaker
+
+ * local/: Makefile.in, mib2c:
+
+ - (Makefile.in, mib2c):
+ - make mib2c look in $(snmplibdir) for .conf files.
+ - install mib2c and .conf files.
+
+2000-08-10 14:33 hardaker
+
+ * snmplib/: default_store.h, snmp_api.c:
+
+ - (default_store.h, snmp_api.c): dynamically decide to reverse/forward encode.
+
+2000-08-10 14:31 hardaker
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ - (extensible.c): fix CR termination.
+
+2000-08-10 14:25 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): define reverse encoding on by default.
+
+2000-08-10 13:02 mslifcak
+
+ * configure.in, configure:
+
+ fix bug 252 for configure and sys/socket.h on BSD/OS 4.2
+
+2000-08-10 09:07 hardaker
+
+ * snmplib/: asn1.c, asn1.h, snmp.c, snmp.h
+, snmp_api.c, snmp_api.h, snmpusm.c,
+ snmpusm.h, snmpv3.c:
+
+ - (asn1.c, asn1.h, snmp.c, snmp.h, snmp_api.c, snmp_api.h, snmpusm.c,
+ snmpusm.h, snmpv3.c):
+ - implement reverse encoded messages.
+ - TODO: clean up, run-time determination of weather to use it or not.
+
+2000-08-09 15:40 mslifcak
+
+ * snmplib/read_config.c:
+
+ Fix bug 331 with patch in part provided by John Naylon <jbpn@cambridgebroadband.com>
+
+2000-08-09 15:27 mslifcak
+
+ * agent/mibgroup/smux/smux.c,
+ agent/mibgroup/ucd-snmp/proxy.c, apps/snmpvacm.c:
+
+ no // comment, in deference to non-ANSI-C compilers.
+
+2000-08-09 07:21 nba
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ - hr_swrun.c: fix the RunPath for swapped out Linux process
+
+2000-08-09 07:21 nba
+
+ * agent/mibgroup/host/: hr_print.c (V4-1-1-patches.2), hr_print.c
+:
+
+ - hr_print.c: fix a debug token
+
+2000-08-09 04:44 nba
+
+ * apps/snmpnetstat/main.c:
+
+ - main.c: fix parsing of -v
+
+2000-08-08 10:06 hardaker
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ - (extensible.c): strip newlines.
+
+2000-08-08 08:51 hardaker
+
+ * snmplib/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): Patch from Scott Lipcon: start optind at 1 not 0.
+ -
+
+2000-08-08 06:36 mslifcak
+
+ * snmplib/snmpusm.c:
+
+ Fix bug #295 (free *secStateRef before allocating another one).
+
+2000-08-08 06:05 mslifcak
+
+ * apps/snmptrapd.c, agent/snmpd.c:
+
+ fix bug #298 reported and patch supplied by Conrad Link <clink@ml.com>
+
+2000-08-08 04:59 nba
+
+ * snmplib/snmp_api.c:
+
+ - snmp_api.c: fix a busy loop when alarm queue is active without any
+ outstanding requests
+
+2000-08-08 04:47 nba
+
+ * man/snmpset.1:
+
+ - snmpset.1: cannot set counters
+
+2000-08-08 04:42 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Fixed (BUG#332) using patch submitted by John Naylon <jbpn@cambridgebroadband.com>
+ Also consolidated comments about the four send PDU functions.
+
+2000-08-07 06:59 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Fix leak in reportable errors found by John Naylon <jbpn@cambridgebroadband.com>
+
+2000-08-07 05:48 nba
+
+ * man/add_module_replacement.3:
+
+ file add_module_replacement.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 05:48 nba
+
+ * man/read_objid.3:
+
+ file read_objid.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/snmp_set_mib_warnings.3:
+
+ file snmp_set_mib_warnings.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/snmp_set_save_descriptions.3:
+
+ file snmp_set_save_descriptions.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/read_module_node.3:
+
+ file read_module_node.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/read_module.3:
+
+ file read_module.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/read_mib.3:
+
+ file read_mib.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/read_all_mibs.3:
+
+ file read_all_mibs.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/print_variable.3:
+
+ file print_variable.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/print_value.3:
+
+ file print_value.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/print_objid.3:
+
+ file print_objid.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/print_mib.3:
+
+ file print_mib.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/print_description.3:
+
+ file print_description.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/init_mib.3:
+
+ file init_mib.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/init_mib_internals.3:
+
+ file init_mib_internals.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/get_module_node.3:
+
+ file get_module_node.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ * man/add_mibdir.3:
+
+ file add_mibdir.3 was initially added on branch V4-1-1-patches.
+
+2000-08-04 17:13 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): add in the notification group by default.
+
+2000-08-04 17:08 hardaker
+
+ * agent/mibgroup/notification.h:
+
+ - (notification.h): notification mib wrapper.
+
+2000-08-04 17:06 hardaker
+
+ * snmplib/snmp_parse_args.c:
+
+ - (snmp_parse_args.c):
+ - initialize optind before calling getopt.
+ - debugging output.
+
+2000-08-04 16:56 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ - (proxy.c): properly set the first (unused) argument to snmp_parse_args().
+
+2000-08-04 16:53 hardaker
+
+ * agent/: agent_trap.c,
+ mibgroup/notification/snmpNotifyTable.h,
+ mibgroup/target/snmpTargetAddrEntry.c,
+ mibgroup/target/snmpTargetAddrEntry.h,
+ mibgroup/target/snmpTargetParamsEntry.c,
+ mibgroup/target/snmpTargetParamsEntry.h,
+ mibgroup/target/target.c:
+
+ - (agent_trap.c, snmpNotifyTable.h, snmpTargetAddrEntry.c,
+ snmpTargetAddrEntry.h, snmpTargetParamsEntry.c,
+ snmpTargetParamsEntry.h, target.c):
+ - if using the snmpNotificationTable, insert non-v1 trap sinks into it.
+
+2000-08-04 05:26 daves
+
+ * agent/mibgroup/mibJJ.h:
+
+ - (mibgroup/mibJJ.h mibgroup/mibJJ/*): Experimental re-write of mibII
+
+2000-08-04 05:21 daves
+
+ * agent/mibgroup/: util_funcs.c, util_funcs.h:
+
+ - (mibgroup/util_funcs.[ch]): New 'cached table' routines
+
+2000-08-03 08:37 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Fix bug #325 identified by John Naylon <jbpn@cambridgebroadband.com>
+
+2000-08-03 01:24 nba
+
+ * mibs/IP-FORWARD-MIB.txt:
+
+ file IP-FORWARD-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-08-03 01:24 nba
+
+ * mibs/INET-ADDRESS-MIB.txt:
+
+ file INET-ADDRESS-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-08-03 01:24 nba
+
+ * mibs/IF-INVERTED-STACK-MIB.txt:
+
+ file IF-INVERTED-STACK-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-08-03 01:24 nba
+
+ * mibs/HCNUM-TC.txt:
+
+ file HCNUM-TC.txt was initially added on branch V4-1-1-patches.
+
+2000-08-02 07:06 mslifcak
+
+ * testing/eval_tools.sh:
+
+ Silent running grep results.
+
+2000-08-02 06:10 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Fix BUG #291: allow "255.255.255.255" for text input to ASN_IPADDRESS
+
+2000-08-02 05:20 mslifcak
+
+ * agent/snmp_agent.c, agent/mibgroup/agentx/master_admin.c
+, agent/mibgroup/agentx/subagent.c, apps/snmptest.c
+:
+
+ Fix (BUG#323): free PDU when snmp_send fails.
+
+2000-08-02 05:06 mslifcak
+
+ * testing/TESTCONF.sh:
+
+ Add -p option once to snmpd args.
+ Find MIBDIRS in source tree.
+ Fix condition to set PATH.
+
+2000-08-01 23:30 nba
+
+ * agent/mibgroup/mibII/ip.c:
+
+ - ip.c: One more #if solaris
+
+2000-08-01 23:19 nba
+
+ * agent/mibgroup/mibII/ip.c:
+
+ - ip.c: A bad #if ... the proper define to test for Solaris is solaris2
+
+2000-08-01 16:40 hardaker
+
+ * snmplib/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): remove unused usage() typedef.
+
+2000-08-01 16:40 hardaker
+
+ * agent/mibgroup/ucd-snmp/: proxy.c, proxy.h:
+
+ - (proxy.c, proxy.h): -Wall warning fixes.
+
+2000-08-01 16:39 hardaker
+
+ * FAQ:
+
+ - (FAQ): mention newer versions of Solaris.
+
+2000-08-01 16:37 hardaker
+
+ * testing/TESTCONF.sh, testing/TESTCONF.sh.in,
+ configure, configure.in:
+
+ - (TESTCONF.sh, TESTCONF.sh.in): revert to non-configed TESTCONF.
+
+2000-08-01 16:31 hardaker
+
+ * Makefile.top:
+
+ - (Makefile.top): make un-quiet.
+
+2000-08-01 10:23 hardaker
+
+ * local/snmp-ucd.sh:
+
+ - (snmp-ucd.sh): fix bug #297 (don't kill grep and init script invocations).
+
+2000-08-01 04:45 mslifcak
+
+ * snmplib/snmpusm.c:
+
+ Fix bug found by Yigal Hochberg <hochberg@dmhsoftware.com>
+
+2000-08-01 03:30 daves
+
+ * agent/snmp_vars.c:
+
+ - (agent/snmp_vars.c): Fix building of complete OID
+ (work with the name originally registered,
+ not any subsequent division boundaries)
+
+2000-07-31 20:09 mslifcak
+
+ * agent/mibgroup/util_funcs.c:
+
+ Remove duplicate fopen from shell_command.
+
+2000-07-31 18:58 mslifcak
+
+ * testing/: RUNTESTS, TESTCONF.sh.in:
+
+ (TESTCONF.sh.in) - set MIBDIRS to sibling of the testing directory.
+ (RUNTESTS) - allow binaries to be in the "-D bindir" directory.
+
+2000-07-31 15:25 mslifcak
+
+ * testing/TESTCONF.sh.in:
+
+ Dont adjust PATH if SNMP_PATH is set.
+ Dont add port spec to SNMP_FLAGS if one is already specified.
+
+2000-07-31 13:49 mslifcak
+
+ * testing/eval_tools.sh:
+
+ Remove test directories for skipped tests.
+ Keep test directories for failed tests.
+ Keep test directories for passed tests when "RUNTESTS -s" is specified.
+ Search config.h at the root of the build tree.
+
+2000-07-31 11:32 mslifcak
+
+ * config.guess:
+
+ Merge from automake-1.4: Add for Rhapsody, OpenStep, Cray-T3, SX-4, SX-5
+
+2000-07-31 11:31 mslifcak
+
+ * config.sub:
+
+ Merge from automake-1.4: Add for Rhapsody, OpenStep
+
+2000-07-30 17:38 hardaker
+
+ * agent/mibgroup/: notification/snmpNotifyTable.c,
+ notification/snmpNotifyTable.h, target/target.c,
+ target/target.h:
+
+ - (snmpNotifyTable.c, snmpNotifyTable.h, target.c, target.h):
+ - implement untested filtering function callback for target searches.
+ - delete unused function.
+ - misc warning fixes.
+
+2000-07-30 17:07 hardaker
+
+ * agent/mibgroup/notification/: snmpNotifyFilterProfileTable.c
+, snmpNotifyFilterProfileTable.h,
+ snmpNotifyFilterTable.c, snmpNotifyFilterTable.h:
+
+ - (snmpNotifyFilterProfileTable.c, snmpNotifyFilterProfileTable.h,
+ snmpNotifyFilterTable.c, snmpNotifyFilterTable.h):
+ - more notification table implementations for filtering.
+ - Framework complete, functionality is not.
+
+2000-07-30 17:05 hardaker
+
+ * agent/mibgroup/: header_complex.c, header_complex.h:
+
+ - (header_complex.c, header_complex.h):
+ - handle implied objects.
+ - implement header_complex_get() for simple data retrievals.
+
+2000-07-28 06:14 mslifcak
+
+ * agent/mibgroup/mibII/: var_route.c (V4-1-1-patches.2),
+ var_route.c:
+
+ Cleanup include headers to fix bug #307. Thanks to sandven@research.att.com.
+
+2000-07-27 15:19 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): Patch from Vinay Mohta:
+ - access_hosts() requires an argument so fake one.
+
+2000-07-27 15:00 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c): Patch from Mattias Barthel:
+ - fix for interfaces without an attached IP address.
+
+2000-07-27 14:55 hardaker
+
+ * agent/mibgroup/ucd-snmp/: vmstat_solaris2.c,
+ vmstat_solaris2.h:
+
+ - (vmstat_solaris2.c, vmstat_solaris2.h): Patch from Jochen Kmietsch:
+ - support raw values.
+
+2000-07-27 08:25 hardaker
+
+ * apps/snmpusm.c:
+
+ - (snmpusm.c): print errors to stderr.
+
+2000-07-27 06:20 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: Fix a missing initization when one MIB holds MODULE-COMPLIANCE
+ for another
+
+2000-07-27 01:35 nba
+
+ * snmplib/snmp_api.c:
+
+ - snmp_api.c: Fix pdu->community being overwritten with session->community
+ Thanks to Dana P. Cook <dcook@cabletron.com>
+
+2000-07-26 22:28 mslifcak
+
+ * agent/agent_trap.c, snmplib/parse.c,
+ snmplib/read_config.c, win32/libsnmp_dll/libsnmp.def:
+
+ Update for win32 build: remove unused variables and unpublished method.
+
+2000-07-26 08:53 hardaker
+
+ * local/mib2c.storage.conf:
+
+ - (mib2c.storage.conf): misc changes and improvements.
+
+2000-07-26 08:53 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): Patch from Bert Driehuis:
+ - translateObj hack.
+
+2000-07-26 08:49 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): Patch from Bert Driehuis:
+ - remove beginning newline in description clauses.
+
+2000-07-17 11:00 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.h:
+
+ - (vmstat_solaris2.h): config_require kernel_sunos5.
+
+2000-07-12 09:29 hardaker
+
+ * snmplib/snmpv3.c:
+
+ - (snmpv3.c): copy key length as well as the key when using the same
+ privacy key as the auth key.
+
+2000-07-11 13:34 marz
+
+ * perl/SNMP/: README, SNMP.pm, SNMP.xs, t/mib.t
+:
+
+ added ranges field to SNMP::MIB hash
+
+2000-07-11 10:05 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): Patch from Robert Story:
+ - make null PREFIX variable possible so non-dot-leading oids are accepted.
+
+2000-07-11 09:22 hardaker
+
+ * agent/snmp_agent.c, apps/snmptrapd.c,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmpusm.c, snmplib/snmpusm.h:
+
+ - (snmp_agent.c, snmptrapd.c, snmp_api.c, snmp_api.h, snmpusm.c, snmpusm.h):
+ - make the session pointers indicate weather or not they are
+ "authoritative", meaning weather they should be learning engineIDs
+ or reporting on them.
+ - pass the received-packet session pointer into snmpv3_parse and
+ usm_proccess_in_msg() to use this flag.
+ - set isAuthoratative = true in the agent, and unknown in the snmptrapd.
+
+2000-07-11 08:32 hardaker
+
+ * snmplib/snmpv3.c:
+
+ - (snmpv3.c): make the createUser token accept an engineid (-e ARG) to use.
+
+2000-07-07 01:37 daves
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (mibII/interfaces.c): Recognise Token Ring interfaces under Linux
+
+2000-07-06 17:19 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): print generic strings when saving persistent data
+ where possible. (IE, check for printable characters before printing hex).
+
+2000-07-06 17:05 hardaker
+
+ * testing/: TESTCONF.sh, TESTCONF.sh.in:
+
+ - (TESTCONF.sh, TESTCONF.sh.in): moved TESTCONF.sh to TESTCONF.sh.in
+ and have the MIBS path variable built by configure since it knows
+ where the root level source directory is.
+
+2000-07-06 17:04 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/header_complex.c,
+ agent/mibgroup/notification/snmpNotifyTable.c, snmplib/asn1.h
+, snmplib/snmp_api.c:
+
+ - (configure, configure.in, header_complex.c, snmpNotifyTable.c,
+ asn1.h, snmp_api.c):
+ - implement IMPLIED index handling.
+ - make the created USM entries set the storageType and RowStatus
+ appropriately.
+
+2000-07-06 17:02 hardaker
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): better comments on a couple of function definitions.
+
+2000-07-05 07:50 mslifcak
+
+ * agent/snmp_agent.c:
+
+ fix (BUG#290) gracefully handle some PDUs that have no variables.
+
+2000-07-05 06:46 mslifcak
+
+ * README.win32:
+
+ [no log message]
+
+2000-07-04 10:21 hardaker
+
+ * agent/snmp_vars.c, apps/snmptrapd.c,
+ snmplib/snmp_api.c, snmplib/snmpusm.c,
+ snmplib/snmpusm.h:
+
+ - (snmp_vars.c, snmptrapd.c, snmp_api.c, snmp_api.h, snmpusm.c, snmpusm.h):
+ - remove last remnants of the "initial" user.
+ - make engineid reports from the usm happen based on the report flag
+ in the message flag.
+ - Note: this is a big issue with the SNMPv3 protocol specs. The
+ specifications note that you send a report if you are
+ "authoritative", but don't describe how to know if you are
+ authoritative or not. For situations like proxies and
+ notification receivers, where you are sometimes authoritative
+ and other times you're not, this is problematic. The SNMPv3
+ ASIs do not pass in enough information to determine this and the
+ WG has proclaimed that the ASIs are not meant to be used as an
+ API, but the initial work done by NAI and TISLabs attempted to
+ implement the USM such that it would be a "reference" release
+ and hence we followed the specifications to the letter and used
+ the ASIs as APIs just to see if we could. We could previously
+ only because we were always either authoritative or
+ non-authoritative. Since beginning to work on proxy and the
+ notification mib, this is no longer possible. For the record, I
+ am hereby changing the initial reference release in such a
+ manner as it no longer conforms exactly to the SNMPv3 ASIs. So
+ as not to confuse anyone, this is an entirely theoretical issue
+ with respect to the SNMPv3 specification and is perfectly legal
+ to do. Though I could easily go on, I'll step off my soap box now.
+
+2000-07-03 10:10 hardaker
+
+ * agent/: agent_callbacks.h, agent_trap.c,
+ agent_trap.h, mibgroup/notification/snmpNotifyTable.c,
+ mibgroup/target/snmpTargetAddrEntry.c,
+ mibgroup/target/snmpTargetAddrEntry.h,
+ mibgroup/target/snmpTargetParamsEntry.c,
+ mibgroup/target/snmpTargetParamsEntry.h,
+ mibgroup/target/target.c:
+
+ - (agent_callbacks.h, agent_trap.c, agent_trap.h, snmpNotifyTable.c,
+ snmpTargetAddrEntry.c, snmpTargetAddrEntry.h,
+ snmpTargetParamsEntry.c, snmpTargetParamsEntry.h, target.c):
+ - Add a new callback for sending traps.
+ - Make the notification mib use it.
+ - make the target mib generate more persistent sessions.
+ - Make the notification mib always ask the target mib for a session
+ list, which is now cached directly by the target mib.
+
+2000-07-03 08:38 mslifcak
+
+ * snmplib/: mib.c, read_config.c, snmp_api.c
+, system.c:
+
+ fix (BUG#262) - (some) statements that cannot be reached.
+
+2000-07-03 07:55 mslifcak
+
+ * snmplib/ucd-snmp-includes.h:
+
+ fix (BUG#287)
+
+2000-07-03 06:11 mslifcak
+
+ * snmplib/snmpusm.c:
+
+ fix bug # 289
+
+2000-06-30 04:45 mslifcak
+
+ * snmplib/read_config.c:
+
+ simplify memory allocation in read_config_read_{octet_string, objid}
+
+2000-06-30 00:47 nba
+
+ * snmplib/read_config.c:
+
+ - read_config.c: Fix a missing initialization for keywords without help
+
+2000-06-28 23:37 nba
+
+ * mibs/: IF-MIB.txt, Makefile.mib:
+
+ - IF-MIB.txt: upgrade to RFC 2863
+
+2000-06-28 00:58 nba
+
+ * acconfig.h, config.h.in, configure.in,
+ configure, agent/mibgroup/mibII/interfaces.c:
+
+ - interfaces.c, configure: Irix 6.5 has ifi_baudrate.ifs_value
+
+2000-06-27 01:34 nba
+
+ * apps/snmpnetstat/main.c:
+
+ - main.c: better option parsing.
+
+2000-06-27 01:34 nba
+
+ * snmplib/snmpv3.c:
+
+ - snmpv3.c: do case insensitive matching of option values.
+
+2000-06-27 00:33 nba
+
+ * man/snmptranslate.1:
+
+ - snmptranslate.1: document that -w is also for -Td
+
+2000-06-27 00:30 nba
+
+ * man/: snmpbulkget.1, snmpbulkwalk.1, snmpcmd.1
+, snmpget.1, snmpgetnext.1, snmpnetstat.1,
+ snmpset.1, snmpstatus.1, snmptest.1, snmptrap.1
+, snmptrapd.8, snmpwalk.1, variables.5:
+
+ - various man page nit-picking
+
+2000-06-27 00:28 nba
+
+ * apps/snmptable.c:
+
+ - snmptable.c: fixes and usage message for -Ch and -CH
+
+2000-06-26 23:43 nba
+
+ * mibs/: AGENTX-MIB.txt, DISMAN-SCHEDULE-MIB.txt,
+ DISMAN-SCRIPT-MIB.txt, EtherLike-MIB.txt,
+ HOST-RESOURCES-MIB.txt, HOST-RESOURCES-TYPES.txt,
+ IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt, IANA-LANGUAGE-MIB.txt
+, IANAifType-MIB.txt, IF-MIB.txt, IP-MIB.txt
+, IPV6-ICMP-MIB.txt, IPV6-MIB.txt, IPV6-TC.txt
+, IPV6-TCP-MIB.txt, Makefile.in, RMON-MIB.txt
+, SMUX-MIB.txt, SNMP-COMMUNITY-MIB.txt,
+ SNMP-FRAMEWORK-MIB.txt, SNMP-MPD-MIB.txt,
+ SNMP-NOTIFICATION-MIB.txt, SNMP-PROXY-MIB.txt,
+ SNMP-TARGET-MIB.txt, SNMP-USER-BASED-SM-MIB.txt,
+ SNMP-VIEW-BASED-ACM-MIB.txt, SNMPv2-CONF.txt,
+ SNMPv2-MIB.txt, SNMPv2-SMI.txt, SNMPv2-TC.txt,
+ SNMPv2-TM.txt, TCP-MIB.txt, UDP-MIB.txt:
+
+ - Makefile.in, *MIB.txt: update to current RFC version
+
+2000-06-26 23:42 nba
+
+ * mibs/: Makefile.mib, mibfetch, smistrip:
+
+ - Makefile.mib, mibfetch, smistrip: tools to extract MIBs from RFC
+ documents.
+
+2000-06-26 23:40 nba
+
+ * snmplib/parse.c, snmplib/mib.c, snmplib/mib.h
+, apps/snmptranslate.c:
+
+ - parse.c, mib.[ch], snmptranslate.c: add parsing of CHOICE and checks for
+ OBJECT-GROUP and AGENT-CAPABILITIES. This allows us to parse
+ complete MIB extracts from RFC documents.
+
+2000-06-26 23:38 nba
+
+ * Makefile.top:
+
+ - Makefile.top: make libtool silent, so we can see those warnings
+
+2000-06-26 23:37 nba
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ - snmpTargetAddrEntry.c: do a cast to kill a warning
+
+2000-06-26 23:32 nba
+
+ * agent/agent_trap.c:
+
+ - agent_trap.c: Fix a leak when request is blocked by VACM and no trap
+ is sent.
+
+2000-06-26 11:56 mslifcak
+
+ * snmplib/read_config.c:
+
+ fix (BUG#233)
+
+2000-06-23 06:42 mslifcak
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ replace malloc/memset 0 with calloc.
+
+2000-06-23 01:08 daves
+
+ * agent/mibgroup/mibII/: kernel_linux.c, kernel_linux.h
+, ip.c:
+
+ - (mibII/kernel_linux.[ch], mibII/ip.c): Added support for ipRoutingDiscards
+ (Thanks to Bryan Blackman)
+
+2000-06-22 17:09 mslifcak
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ remove extra include errormib.h
+
+2000-06-22 16:50 mslifcak
+
+ * agent/mibgroup/util_funcs.c:
+
+ Fix bug #276 - close most file descriptors before exec'ing command.
+
+2000-06-22 15:59 mslifcak
+
+ * agent/mibgroup/: util_funcs.c, ucd-snmp/extensible.c
+, ucd-snmp/memory.c, ucd-snmp/memory_freebsd2.c
+:
+
+ fgets: use sizeof(buf) in lieu of compiler constant STRMAX.
+
+2000-06-22 15:53 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ Use fewer large static buffers. pass_persist uses bigger buffers now.
+
+2000-06-21 12:25 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ - (snmpNotifyTable.c): Uh, only if not deleted.
+
+2000-06-21 12:23 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ - (snmpNotifyTable.c): change createAndGo/createAndWait states to active/NIS.
+
+2000-06-20 20:01 mslifcak
+
+ * Makefile.in:
+
+ Declare top_builddir to avoid annoying /libtool not found message.
+
+2000-06-20 17:30 mslifcak
+
+ * apps/encode_keychange.c:
+
+ Dont assume ANSI C-preprocessor (replace "##" concatenation with sprintf).
+
+2000-06-20 15:37 mslifcak
+
+ * win32/: libagent/libagent.def, libagent/libagent.dsp,
+ libsnmp_dll/libsnmp.def, snmpbulkget/snmpbulkget.dsp,
+ snmpbulkwalk/snmpbulkwalk.dsp, snmpd/snmpd.dsp,
+ snmpdelta/snmpdelta.dsp, snmpget/snmpget.dsp,
+ snmpgetnext/snmpgetnext.dsp, snmpset/snmpset.dsp,
+ snmpstatus/snmpstatus.dsp, snmptable/snmptable.dsp,
+ snmptest/snmptest.dsp, snmptrap/snmptrap.dsp,
+ snmptrapd/snmptrapd.dsp, snmpusm/snmpusm.dsp,
+ snmpwalk/snmpwalk.dsp:
+
+ Win32 MS-VC++ build fixups.
+
+2000-06-20 15:37 mslifcak
+
+ * snmplib/snmpv3.c:
+
+ Encapsulate local variable "x" to the scope where needed.
+
+2000-06-20 15:36 mslifcak
+
+ * snmplib/snmp_client.c:
+
+ Remove unused var "newvar".
+
+2000-06-20 15:36 mslifcak
+
+ * apps/snmptrapd_log.c:
+
+ Use int vs ulong for array indexing variables to avoid signed/unsigned mismatch.
+
+2000-06-20 15:34 mslifcak
+
+ * apps/snmptrapd.c:
+
+ Remove unused vars struct tm, time_t.
+
+2000-06-20 15:34 mslifcak
+
+ * agent/snmpd.c:
+
+ Remove unused var "initlist".
+
+2000-06-20 15:33 mslifcak
+
+ * agent/snmp_agent.c:
+
+ Declare strncasecmp in system.h ; Remove unused var "status".
+
+2000-06-20 15:31 mslifcak
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Remove unused vars.
+
+2000-06-20 15:30 mslifcak
+
+ * agent/agent_trap.c:
+
+ Declare optarg in getopt.h.
+
+2000-06-20 14:00 hardaker
+
+ * local/mib2c.storage.conf:
+
+ - (mib2c.storage.conf): misc minor changes.
+
+2000-06-20 13:59 hardaker
+
+ * agent/mibgroup/notification/: .cvsignore, snmpNotifyTable.c
+, snmpNotifyTable.h:
+
+ - (.cvsignore, snmpNotifyTable.c, snmpNotifyTable.h):
+ - SNMP-NOTIFICATION-MIB's snmpNotifyTable implemented:
+ - uses the SNMP-TARGET-MIB to get its addresses from.
+ - uses header_complex to handle the data.
+ - much todo:
+ - dynamic target/notification mib updating without kill -HUP needed.
+ - this will be a real pain.
+ - fix v3 related traps still (same usm bug I've been meaning to fix).
+ - the rest of the SNMP-NOTIFICATION-MIB tables.
+
+2000-06-20 13:53 hardaker
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c,
+ snmpTargetAddrEntry.h, snmpTargetParamsEntry.c,
+ snmpTargetParamsEntry.h:
+
+ - (snmpTargetAddrEntry.c, snmpTargetAddrEntry.h,
+ snmpTargetParamsEntry.c, snmpTargetParamsEntry.h):
+ - generic target session creation
+ - misc other minor fixes.
+
+2000-06-20 13:51 hardaker
+
+ * agent/mibgroup/: target.h, target/target.c,
+ target/target.h:
+
+ - (target.h, target.c, target.h): generic target session creation
+ based on entries in the SNMP-TARGET-MIB table.
+
+2000-06-20 13:50 hardaker
+
+ * agent/mibgroup/header_complex.c:
+
+ - (header_complex.c): remove Michael's horriblely wrong "fixes".
+
+2000-06-20 13:48 hardaker
+
+ * agent/: agent_trap.c, agent_trap.h:
+
+ - (agent_trap.c, agent_trap.h): add remove_trap_session().
+
+2000-06-20 13:46 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): deal with 0-length persistent strings better.
+
+2000-06-19 12:32 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Check more alloc failures.
+
+2000-06-19 12:15 mslifcak
+
+ * agent/mibgroup/agentx/: client.c, protocol.c:
+
+ (protocol.c) Use sizeof(oid), not 4!
+ (client.c) Add _all_ of OID value for agentx_register and agentx_unregister.
+
+2000-06-19 11:41 mslifcak
+
+ * snmplib/snmpv3.c:
+
+ Removed sizeof(u_char) and unnecessary (unsigned) casts to malloc params.
+
+2000-06-19 03:04 nba
+
+ * agent/agent_registry.c, apps/snmptrapd.c,
+ apps/snmptrapd_log.c, apps/snmptrapd_log.h,
+ snmplib/mib.c, snmplib/mib.h,
+ snmplib/snmp_parse_args.c, snmplib/snmp_parse_args.h,
+ snmplib/snmp_api.h:
+
+ Prototype fixup.
+
+2000-06-19 03:01 nba
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.h:
+
+ s/conifg/config/ .... Hrrrmmmpf
+
+2000-06-19 02:58 nba
+
+ * makenosysdepend.pl, agent/Makefile.in,
+ agent/mibgroup/Makefile.in, apps/Makefile.in,
+ snmplib/Makefile.in, testing/Makefile.in:
+
+ - makenosysdepend.pl Makefile.in: object files are now named .lo ...
+
+2000-06-16 16:01 hardaker
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.h:
+
+ - (snmpTargetAddrEntry.h): add the SNMPv2-TM mib to the default list.
+
+2000-06-16 16:01 hardaker
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c,
+ snmpTargetParamsEntry.c:
+
+ - (snmpTargetAddrEntry.c, snmpTargetParamsEntry.c): fix incorrect OIDs.
+
+2000-06-15 06:45 marz
+
+ * perl/SNMP/Makefile.PL:
+
+ fat fingers
+
+2000-06-15 06:42 marz
+
+ * perl/SNMP/: Makefile.PL, Makefile.PL:
+
+ add defaults to daemon search path...recalc t/snmptest.cmd everytime per makefile.PL is run
+
+2000-06-12 16:43 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): document trapsess.
+
+2000-06-12 16:39 hardaker
+
+ * agent/: agent_read_config.c, agent_trap.c,
+ agent_trap.h:
+
+ - (agent_read_config.c, agent_trap.c, agent_trap.h):
+ - new snmpd.conf token for trap sessions: "trapsess".
+ - uses snmp_parse_args so any type of trap can be sent with it
+ modified by any of the parameters that are documented in snmpcmd(1).
+ - v3 traps don't work due to the same USM problems found in the
+ recent proxy submissions (my next target).
+ - -Ci in the argument specifies informs should be used.
+
+2000-06-12 16:18 hardaker
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (master_request.c): re-enable freeing of master request.
+
+2000-06-12 16:17 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): save exec data to /var/ucd-snmp.
+ - could cause problems for non-root runs. Untested.
+
+2000-06-12 14:12 hardaker
+
+ * apps/snmptrapd_log.c:
+
+ - (snmptrapd_log.c): Patch from Markku Laukkanen:
+ - remove ending commas in enum list.
+
+2000-06-07 13:23 hardaker
+
+ * man/snmp_config.5.def, snmplib/read_config.c,
+ snmplib/read_config.h:
+
+ - (snmp_config.5.def, read_config.c, read_config.h):
+ - the TYPE.conf parser now accepts tokens from a different .conf
+ file TYPE if a special "[TYPE]" keyword is inserted into the
+ .conf file. See snmp_config(5) for a better description.
+
+2000-06-07 13:22 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - map strtoul to atoi if the function isn't found.
+
+2000-06-02 11:41 hardaker
+
+ * local/.cvsignore:
+
+ - (.cvsignore): add *.made.
+
+2000-06-02 11:40 hardaker
+
+ * local/: Makefile.in, fixproc, ipf-mod.pl,
+ mib2c, tkmib:
+
+ - (Makefile.in, fixproc, ipf-mod.pl, mib2c, tkmib):
+ - make (and install) perl scripts differently, without modifying the orig.
+
+2000-06-01 14:48 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): store persistent data immediately after init'ing to
+ ensure we update counters and stuff that must change (eg, engineBoots).
+
+2000-05-31 16:22 hardaker
+
+ * man/snmpd.1.def:
+
+ - (snmpd.1.def): describe -I.
+
+2000-05-31 15:52 hardaker
+
+ * configure, configure.in, agent/mib_modules.c
+, agent/mib_modules.h, agent/snmpd.c:
+
+ - (configure, configure.in, mib_modules.c, mib_modules.h, snmpd.c):
+ - new -I switch to snmpd to do dynamic determinaton of which mib
+ modules to initialize (and hence which mib tree sections to support).
+
+2000-05-31 15:50 hardaker
+
+ * snmplib/: default_store.c, default_store.h:
+
+ - (default_store.c, default_store.h): default store routines for void pointers.
+ - which I immediately decided to do something different for what I
+ originally implemented it for, so its not being used yet.
+
+2000-05-31 05:59 daves
+
+ * agent/mibgroup/mibII/: ip.c, ip.h:
+
+ - (mibII/ip.[ch]): Allow IP support without the At/ipNetToMedia module
+
+2000-05-30 17:11 hardaker
+
+ * agent/mibgroup/ucd-snmp/: proxy.c, proxy.h:
+
+ - (proxy.c, proxy.h): simple proxy support.
+ - maps one oid inside the agent to a possibly-different oid on a target.
+ - uses snmp_parse_args() so it takes standard command line config options.
+ - no set support.
+ - no kill -HUP support.
+ - no SNMPv3 support (sigh).
+
+2000-05-30 15:06 nba
+
+ * mibs/IANA-LANGUAGE-MIB.txt:
+
+ file IANA-LANGUAGE-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-05-30 15:06 nba
+
+ * mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt:
+
+ file IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-05-30 15:06 nba
+
+ * mibs/DISMAN-SCHEDULE-MIB.txt:
+
+ file DISMAN-SCHEDULE-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-05-30 15:06 nba
+
+ * mibs/AGENTX-MIB.txt:
+
+ file AGENTX-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-05-30 07:47 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ Fix problem identified by V. Grenet: new method snmp_oid_min_compare
+
+2000-05-30 01:31 nba
+
+ * mibs/mibfetch:
+
+ file mibfetch was initially added on branch V4-1-1-patches.
+
+2000-05-30 01:31 nba
+
+ * mibs/smistrip:
+
+ file smistrip was initially added on branch V4-1-1-patches.
+
+2000-05-30 01:31 nba
+
+ * mibs/Makefile.mib:
+
+ file Makefile.mib was initially added on branch V4-1-1-patches.
+
+2000-05-26 09:24 daves
+
+ * agent/mibgroup/mibII/: sysORTable.c, system_mib.c:
+
+ - (mibII/sysORTable.c mibII/system_mib.c):
+ - Use new time utility routines to simplify processing
+ - Update sysORLastChange when adding/removing entries
+
+2000-05-26 09:23 daves
+
+ * agent/mibgroup/: util_funcs.c, util_funcs.h:
+
+ - (util_funcs.[ch]): New time-diff utility routines
+
+2000-05-26 08:46 daves
+
+ * agent/: snmpd.c, snmp_agent.c,
+ mibgroup/mibII/var_route.c:
+
+ - (snmpd.c snmp_agent.c mibII/var_route.c): Use 'mibincl.h' header
+
+2000-05-26 07:48 daves
+
+ * agent/: agent_registry.c, agent_registry.h,
+ mibgroup/agentx/client.c, mibgroup/agentx/client.h,
+ mibgroup/agentx/master_request.c, mibgroup/agentx/subagent.c
+:
+
+ - (agent_registry.[ch] agentx/client.[ch]
+ agentx/master_request.c agentx/subagent.c):
+ - Support for MIB region timeouts
+
+2000-05-26 07:46 daves
+
+ * snmplib/: snmp.h, snmp_api.c, snmp_client.c
+:
+
+ - (snmp.h snmp_api.c snmp_client.c): Support for per-request timeout handling
+
+2000-05-26 07:45 daves
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - (agentx/protocol.c): Minor error in AgentX packet dump
+
+2000-05-25 10:07 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ - (memory.c): Patch from Ragnar Kjॆआà¤rstad:
+ - fixed linux problem: wrong params getting returned.
+
+2000-05-25 05:38 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ Fix use of bin2asc to not always show "string"; use snmp_oid_compare, too.
+ See bug #234 for details.
+
+2000-05-25 03:39 daves
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (mibII/interfaces.c): Consolidate header handling.
+
+2000-05-25 03:31 daves
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (mibII/interfaces.c): Correct confusing comment
+
+2000-05-25 01:53 daves
+
+ * configure.in, configure:
+
+ - (configure.in configure): Replace use of 'cut' with equivalent 'sed' calls
+
+2000-05-25 01:30 daves
+
+ * aclocal.m4, configure.in, configure:
+
+ - (configure.in aclocal.m4 configure):
+ - Direct certain checks to the appropriate file descriptor (see BUG#247)
+
+2000-05-22 16:22 hardaker
+
+ * apps/.cvsignore:
+
+ - (apps/.cvsignore): add more stuff to ignore.
+
+2000-05-22 16:21 hardaker
+
+ * apps/Makefile.in, apps/snmp_parse_args.c,
+ apps/snmp_parse_args.h, apps/snmpbulkget.c,
+ apps/snmpbulkwalk.c, apps/snmpdelta.c, apps/snmpdf.c
+, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpset.c, apps/snmpstatus.c, apps/snmptable.c
+, apps/snmptest.c, apps/snmptrap.c,
+ apps/snmpusm.c, apps/snmpvacm.c, apps/snmpwalk.c
+, snmplib/Makefile.in, snmplib/snmp_parse_args.c
+, snmplib/snmp_parse_args.h:
+
+ - (Makefile.in, snmp_parse_args.c, snmp_parse_args.h, snmpbulkget.c,
+ snmpbulkwalk.c, snmpdelta.c, snmpdf.c, snmpget.c, snmpgetnext.c,
+ snmpset.c, snmpstatus.c, snmptable.c, snmptest.c, snmptrap.c,
+ snmpusm.c, snmpvacm.c, snmpwalk.c, Makefile.in, snmp_parse_args.c,
+ snmp_parse_args.h):
+ - moved snmp_parse_args to the library, as I promised to do ages ago.
+ - no longer calls usage() directly, but returns -1 if you should.
+
+2000-05-22 05:47 daves
+
+ * snmplib/: tools.c, tools.h:
+
+ - (snmplib/tools.[ch]): Routine for comparing two markers.
+
+2000-05-22 05:42 daves
+
+ * local/mib2c:
+
+ - (local/mib2c): Generate multiple tables in one code file
+
+2000-05-17 10:28 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h, snmplib/vacm.c,
+ snmplib/vacm.h:
+
+ - (vacm_vars.c, vacm_vars.h, vacm.c, vacm.h): Patch from Arne Oesleboe:
+ - writable vacm mib support.
+ - other misc vacm fixes.
+
+2000-05-17 10:26 hardaker
+
+ * apps/snmpusm.c:
+
+ - (snmpusm.c): Patch from Arne Oesleboe:
+ - Don't segfault on an unknown command, instead print a warning..
+
+2000-05-17 10:25 hardaker
+
+ * apps/snmpvacm.c:
+
+ - (snmpvacm.c): Patch from Arne Oesleboe:
+ - added a new command: snmpvacm.
+
+2000-05-17 09:25 hardaker
+
+ * agent/agent_read_config.c:
+
+ - (agent_read_config.c): mention the port number on the trapsink help line.
+
+2000-05-17 09:20 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): use standardized buffer sizes
+
+2000-05-17 09:13 hardaker
+
+ * apps/Makefile.in, apps/snmptrapd.c,
+ apps/snmptrapd_log.c, man/snmptrapd.8:
+
+ - (Makefile.in, snmptrapd.c, snmptrapd_log.c, snmptrapd.8): Patch from
+ Jeff Cours:
+ - customized formatting of trap output.
+
+2000-05-17 09:11 hardaker
+
+ * README:
+
+ - (README): add Jeff and Arne.
+
+2000-05-17 08:15 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): *correctly* associate escapeQuotes with the right default_store bool.
+
+2000-05-17 08:11 hardaker
+
+ * man/snmp.conf.5.def:
+
+ - (snmp.conf.5.def): document escapeQuotes.
+
+2000-05-17 08:09 hardaker
+
+ * man/snmpcmd.1, snmplib/default_store.h,
+ snmplib/mib.c:
+
+ - (snmpcmd.1, default_store.h, mib.c): new option -OE:
+ - shell backslash escape quotations marks for cutting and pasting
+ onto another snmp command line.
+
+2000-05-15 09:24 daves
+
+ * agent/mibgroup/mibII/: kernel_linux.c, kernel_linux.h
+, icmp.c, ip.c, ip.h, icmp.h, tcp.c
+, tcp.h, udp.c, udp.h:
+
+ - (mibII/{ip,icmp,tcp,udp,kernel_linux}.[ch]):
+ - Pull Linux MIB-II statistics gathering into a single routine.
+ - Cache MIB-II statistics on all architectures.
+
+2000-05-15 08:53 hardaker
+
+ * agent/mibgroup/: ucd_snmp.h, ucd-snmp/vmstat_bsdi4.c
+, ucd-snmp/vmstat_bsdi4.h:
+
+ - (ucd_snmp.h, vmstat_bsdi4.c, vmstat_bsdi4.h): Patch from Bert Driehuis:
+ - vmstat support for bsdi4.
+
+2000-05-15 03:06 daves
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Re-remove redundant PDU clone
+ (It reappeared during a recent change)
+
+2000-05-15 03:00 daves
+
+ * agent/: agent_registry.c, agent_index.c,
+ agent_registry.h, mibgroup/agentx/client.c,
+ mibgroup/agentx/master_admin.c:
+
+ - (agent_registry.[ch] agentx/master_admin.c): Implement missing routine 'unregister_mib_context'
+
+ - (agent_registry.[ch] agent_index.[ch]): Move 'fd' registry handling back to agent_registry
+
+ - (agentx/client.c): Recognise new code file for index handling
+
+2000-05-12 10:15 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Um, default to port 161. Opps.
+
+2000-05-12 09:00 daves
+
+ * agent/: agent_registry.c, agent_registry.h,
+ var_struct.h, mibgroup/agentx/master_admin.c:
+
+ - (agent_registry.[ch] var_struct.h agentx/master_admin.c):
+ - Preparation for per-MIB region timeout, and context support
+
+2000-05-12 08:45 daves
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - (kernel_sunos5.c): Recognise Solaris ATM LAN Emulation interfaces
+ Thanks to Jay Young
+
+2000-05-12 08:13 daves
+
+ * agent/: agent_index.c, agent_index.h, Makefile.in
+, agent_registry.c, agent_registry.h,
+ mibgroup/agentx/master_admin.c:
+
+ - (agent_index.[ch] agent_registry.[ch] Makefile.in agentx/master_admin.c):
+ - Split index handling out from the MIB registry.
+
+2000-05-12 07:02 daves
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - (kernel_sunos5.c): Add support for recognising QuadFastEther interface
+
+2000-05-12 06:57 daves
+
+ * apps/snmptable.c:
+
+ - (apps/snmptable.c): Fix problem with missing separator (with -Ci -Cf)
+ Thanks to Xavier FOURNET
+
+2000-05-12 04:02 daves
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Remove redundant PDU clone
+ I'm sure this was put in for a reason, but I can't remember what.
+ It doesn't seem to be needed now, and just leaks memory.
+ Here's hoping.....
+
+2000-05-12 03:11 daves
+
+ * agent/snmpd.c:
+
+ - (agent/snmpd.c): Catch (and ignore) SIGPIPE signals.
+ Disappearing subagents therefor appear as normal I/O failures
+
+2000-05-12 02:24 daves
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - (agentx/protocol.c):
+ - Implement opaque-encoded float & double types
+ - Bring packet dump in line with the main library style
+ - Add packet dump capability for outgoing PDUs
+
+2000-05-10 16:52 hardaker
+
+ * man/snmpd.1.def:
+
+ - (snmpd.1.def): document -p.
+
+2000-05-10 16:43 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): always use the default transport mapping, not the last one.
+
+2000-05-10 16:25 hardaker
+
+ * agent/: ds_agent.h, snmp_agent.c, snmpd.c:
+
+ - (ds_agent.h, snmp_agent.c, snmpd.c): implement multiple transport
+ mappings via -p [transport:]port[@address].
+
+2000-05-10 11:08 mslifcak
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ fix udpstat --> tcpstat
+
+2000-05-10 07:59 daves
+
+ * agent/mibgroup/agentx/: master_admin.c, master_request.c
+:
+
+ - (agentx/master_request, agentx/master_admin.c):
+ - Handle subagent disappearing without warning
+
+2000-05-10 07:57 daves
+
+ * agent/snmp_agent.c, snmplib/snmp_api.h:
+
+ - (agent/snmp_agent.c snmplib/snmp_api.h):
+ - Provide a mechanism to handle asynchronous send failures.
+
+2000-05-10 06:13 daves
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): Logical NOT? Bitwise NOT? Who'll notice the difference anyway!
+
+2000-05-10 05:34 daves
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (agentx/master_request.c): Handle non-responsive subagents
+
+2000-05-10 05:33 daves
+
+ * agent/: agent_registry.c, mibgroup/mibII/sysORTable.c
+:
+
+ - (agent_registry.c mibII/sysORTable.c): Don't assume subsession link is valid
+
+2000-05-10 05:29 daves
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): Definitions for session closedown handling
+
+2000-05-09 14:42 mslifcak
+
+ * agent/Makefile.in, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in:
+
+ also clean Win32 binary objects, and core files.
+
+2000-05-09 14:34 mslifcak
+
+ * apps/: Makefile.in, snmpnetstat/Makefile.in:
+
+ touch up the "clean" rule.
+
+2000-05-09 11:32 mslifcak
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ until Dave's version wins, need snmp_varlist_add_variable to build Win32 agent.
+
+2000-05-09 11:31 mslifcak
+
+ * agent/agent_registry.c:
+
+ fix some Win32 builds (signals? we don't need no steenking signals!)
+
+2000-05-09 11:30 mslifcak
+
+ * ltmain.sh:
+
+ Remove trailing CR [0x0d] from one line.
+
+2000-05-09 08:50 hardaker
+
+ * apps/snmpnetstat/Makefile.in:
+
+ - (Makefile.top, Makefile.in, Makefile.in): fix link time problems
+ with aCC (or any other unknown compiler).
+
+2000-05-09 08:47 hardaker
+
+ * Makefile.top, agent/Makefile.in, apps/Makefile.in
+:
+
+ - (Makefile.top, Makefile.in, Makefile.in): fix link time problems
+ with aCC (or any other unknown compiler).
+
+2000-05-09 07:43 daves
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (agentx/master_request.c): Send out re-delegated requests
+ (and fix a problem with specifying the end-of-range value)
+
+2000-05-09 07:40 daves
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - (agentx/subagent.c): Fix handling of error response generation
+ (by analogy with recent changes to snmp_agent.c)
+
+2000-05-09 07:34 daves
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Handle AgentX "end-of-range" indication.
+ (This is not the cleanest way of doing things,
+ but works for now. We can tidy up later).
+
+2000-05-09 07:16 daves
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Use MIB registry 'start' values
+ (rather than the original name registered)
+ This handles subsequent part of 'split' ranges properly.
+
+2000-05-08 11:08 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): I can't believe the last checkin even compiled (luck).
+
+2000-05-08 11:03 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): fix library list.
+
+2000-05-05 09:56 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ - (diskio.c): Patch from Bert Driehuis:
+ - disk io support for BSD/OS.
+
+2000-05-05 09:54 hardaker
+
+ * agent/mibgroup/mibII/: at.c (V4-1-1-patches.1), at.c:
+
+ - (at.c): Patch from Bert Driehuis:
+ - fix a zero byte malloc bug (mostly noticed with -lefence).
+
+2000-05-05 09:43 hardaker
+
+ * configure (V4-1-1-patches.5), configure, configure.in
+:
+
+ - (configure, configure.in): Patch from Albert Chin-A-Young:
+ - --with-libwrap improvements.
+
+2000-05-05 09:00 daves
+
+ * agent/mibgroup/agentx/: subagent.c, master_request.c
+:
+
+ - (agentx/subagent.c agentx/master_request.c):
+ - Significant improvements to AgentX processing
+ (Thanks to Reiner Beninga)
+
+2000-05-05 08:58 daves
+
+ * snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_client.c, agent/snmp_agent.c,
+ agent/snmp_agent.h:
+
+ - (snmplib/snmp_api.[ch] snmplib/snmp_client.c agent/snmp_agent.[ch]):
+ - Minor changes to assist with AgentX development
+ (These may not be absolutely necessary, but they get things working again!)
+
+2000-05-04 16:21 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): minor unimportant --without-openssl fix.
+
+2000-05-04 16:19 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): Patch from John L. Villalovos:
+ - allow --without-openssl to work.
+
+2000-05-04 16:15 hardaker
+
+ * mibs/: Makefile.in (V4-1-1-patches.2), Makefile.in:
+
+ - (Makefile.in): add the DISMAN-SCRIPT-MIB.txt
+
+2000-05-04 16:01 hardaker
+
+ * mibs/Makefile.in:
+
+ - (Makefile.in): Patch from Albert Chin-A-Young:
+ - install UCD-DISKIO-MIB.txt.
+
+2000-05-04 08:26 daves
+
+ * snmplib/: snmp_client.c, snmp_client.h:
+
+ - (snmplib/snmp_client.[ch]): New routine 'snmp_clone_varbind()'
+ (From a suggestion by Reiner Beninga)
+
+2000-05-04 08:24 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Various minor fixes
+ (Thanks to Reiner Beninga)
+
+2000-05-04 01:29 daves
+
+ * agent/: snmp_agent.c, snmp_agent.h:
+
+ - (snmp_agent.[ch]): Handle index/status information separately from PDU.
+ Also means that delegated requests have access to variable indexes
+ (Based on a suggestion from Reiner Beninga)
+
+2000-05-04 01:00 daves
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ - (ucd-snmp/proc.c): Initialize newly malloced structure
+ (Thanks to Jeff Wilson - see BUG #231)
+
+2000-05-03 09:06 daves
+
+ * agent/: snmp_agent.c, snmp_agent.h,
+ mibgroup/agentx/master_admin.c:
+
+ - (snmp_agent.[ch] agentx/master_admin.c):
+ - Clone PDU within init_agent_snmp_session.
+ New routine 'free_agent_snmp_session'
+ (Thanks to Reiner Beninga)
+
+2000-05-03 08:17 daves
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): When returning an error response,
+ use a clean copy of the original request PDU.
+
+2000-05-03 08:14 daves
+
+ * agent/: snmp_agent.c, snmp_agent.h:
+
+ - (snmp_agent.[ch]): Routine to handle variables individually
+ (Thanks to Reiner Beninga)
+
+2000-05-03 04:37 daves
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Check accessibility of exact requests before processing
+ (and remove redundant 'generic' SET handling)
+
+2000-05-01 11:34 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: fix printing of BITS variables
+
+2000-05-01 06:55 marz
+
+ * perl/SNMP/t/mib.t:
+
+ applied patch from Steve Pheran Snodgrass to fix incompatibility with perl5.6 ref stringification
+
+2000-04-29 07:46 hardaker
+
+ * config.h.in, configure.in, agent/agent_registry.c
+:
+
+ - (config.h.in, configure.in, agent_registry.c): Patch from Frank Strauss:
+ - use sigaction when available.
+
+2000-04-28 07:36 hardaker
+
+ * agent/: agent_registry.c, snmpd.c:
+
+ - (agent_registry.c, snmpd.c): Patch from Frank Strauss:
+ - fix signal handling.
+
+2000-04-27 14:58 hardaker
+
+ * apps/: Makefile.in, snmpdf.c:
+
+ - (Makefile.in, snmpdf.c): implement a remote df command via snmp
+ - (needs the host resources mib working on the remote system).
+
+2000-04-27 10:57 hardaker
+
+ * Makefile.top, config.h.in, configure,
+ configure.in:
+
+ - (Makefile.top, config.h.in, configure, configure.in): rpm is now
+ requiring yet another library: libpopt.
+
+2000-04-26 15:20 hardaker
+
+ * Makefile.top:
+
+ - (Makefile.top): run libtool --finish without -n (go ahead and do the cmds)
+
+2000-04-26 15:19 hardaker
+
+ * Makefile.top, configure, configure.in,
+ agent/Makefile.in:
+
+ - (Makefile.top, configure, configure.in, agent/Makefile.in):
+ - more libtool fixes (.so versioning, properly install...)
+
+2000-04-26 14:18 hardaker
+
+ * apps/.cvsignore, apps/Makefile.in,
+ apps/snmpnetstat/.cvsignore, apps/snmpnetstat/Makefile.in
+, local/Makefile.in, man/Makefile.in,
+ mibs/Makefile.in, snmplib/.cvsignore,
+ snmplib/Makefile.in:
+
+ - (*/.cvsignore, */Makefile.in, Makefile.top, aclocal.m4, configure,
+ configure.in, ltconfig, ltmain.sh):
+ - use libtool for building.
+ - Certainly, I must have broke something in the process. (make depend, eg)
+
+2000-04-26 14:15 hardaker
+
+ * .cvsignore, Makefile.in, Makefile.top,
+ aclocal.m4, configure, configure.in,
+ ltconfig, ltmain.sh, agent/.cvsignore,
+ agent/Makefile.in, agent/mibgroup/.cvsignore,
+ agent/mibgroup/Makefile.in, agent/mibgroup/agentx/.cvsignore
+, agent/mibgroup/dummy/.cvsignore,
+ agent/mibgroup/examples/.cvsignore,
+ agent/mibgroup/host/.cvsignore,
+ agent/mibgroup/ipfwchains/.cvsignore,
+ agent/mibgroup/mibII/.cvsignore,
+ agent/mibgroup/misc/.cvsignore,
+ agent/mibgroup/smux/.cvsignore,
+ agent/mibgroup/snmpv3/.cvsignore,
+ agent/mibgroup/target/.cvsignore,
+ agent/mibgroup/ucd-snmp/.cvsignore,
+ agent/mibgroup/v2party/.cvsignore,
+ agent/mibgroup/vestinternett/.cvsignore:
+
+ - (*/.cvsignore, */Makefile.in, Makefile.top, aclocal.m4, configure,
+ configure.in, ltconfig, ltmain.sh):
+ - use libtool for building.
+ - Certainly, I must have broke something in the process. (make depend, eg)
+
+2000-04-26 08:11 hardaker
+
+ * FAQ:
+
+ - (FAQ): new secondary slogan.
+
+2000-04-26 07:22 hardaker
+
+ * snmplib/: snmp_api.c, snmpusm.c:
+
+ - (snmp_api.c, snmpusm.c): Attempt to parse the PDU when a report is
+ being sent so that the requestid can be used in the outgoing report.
+ This should fix a problem where SNMP Research's Emante agent is
+ doing engineID discovery probes based on the request_id (which is a
+ fairly poor choice as the message_id would be a better one to match
+ on in general and is the only possible thing to use in cases where
+ the report is encrypted).
+
+2000-04-25 13:08 hardaker
+
+ * FAQ:
+
+ - (FAQ): mention that the perl module is included with the source.
+
+2000-04-25 08:24 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): misc -Ddump fixes.
+
+2000-04-25 08:02 hardaker
+
+ * apps/: snmptable.c (V4-1-1-patches.4), snmptable.c:
+
+ - (snmptable.c): check for end of mib view exceptions (v2c, v3).
+
+2000-04-24 11:27 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): -D support for those "older" protocols that shouldn't
+ be used anymore (v1, v2c).
+
+2000-04-24 10:36 hardaker
+
+ * snmplib/: asn1.c, default_store.h, mib.c,
+ snmp.c, snmp_api.c, snmp_auth.c, snmp_debug.c
+, snmp_debug.h, snmpusm.c:
+
+ - (asn1.c, default_store.h, mib.c, snmp.c, snmp_api.c, snmp_auth.c,
+ snmp_debug.c, snmp_debug.h, snmpusm.c):
+ - timestamps can be printed as a numeric number only (-Ot).
+ - more configurable packet dumping code for both send and receive.
+ - uses new -D tokens: dumph (headers), dumpx (hex), dumpv
+ (values). dumpx_ and dumpv_ (note the _s) make it eat space
+ (and newline) before the segment in question. Try -Ddump then
+ -Ddumph,dumpv_ to see examples.
+ - todo:
+ - better horizontally formated information (probably using "%NUMs").
+ - USM is called after pdu building (makes sense but is backwards
+ visually in the dumped packet).
+ - option to strip datatype token (ie Integer:).
+
+2000-04-24 09:37 hardaker
+
+ * bug-report, version.h, FAQ, README,
+ sedscript.in:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.2.pre0 )
+
+2000-04-24 09:13 hardaker
+
+ * version.h, README, bug-report, sedscript.in
+, FAQ:
+
+ - (version.h bug-report sedscript.in): version tag ( EXT.4.2.pre0 )
+
+2000-04-21 14:13 hardaker
+
+ * apps/: snmpwalk.c (V4-1-1-patches.1), snmpwalk.c:
+
+ - (snmpwalk.c): fix GET call for an snmpwalk. (was using a GETNEXT PDU, ack).
+
+2000-04-21 10:41 hardaker
+
+ * snmplib/snmpv3.c:
+
+ - (snmpv3.c): more u_long -> size_t for engineID len.
+
+2000-04-21 08:18 hardaker
+
+ * snmplib/: mib.c (V4-1-1-patches.5), mib.c:
+
+ - (mib.c): fix fprint_description to check for null subtrees.
+
+2000-04-21 08:17 hardaker
+
+ * snmplib/: snmpv3.c, snmpv3.h:
+
+ - (snmpv3.c, snmpv3.h): use size_t for engineid lengths.
+
+2000-04-19 11:02 marz
+
+ * win32/config.h:
+
+ changed mode_t typedef to agree with what ActiveState perl uses (anyone have a problem with this?)
+
+2000-04-19 10:59 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ added Marc Lehman patch to ensure alloc/dealloc use same mechanism (perl vs. system default)
+
+2000-04-19 08:26 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): agent_check_and_process() always block if caller requested it.
+
+2000-04-19 04:34 mslifcak
+
+ * snmplib/: snmpv3.c, snmpv3.h:
+
+ move static decl to .c;minor casting about to support aCC
+
+2000-04-18 11:11 mslifcak
+
+ * apps/snmptable.c:
+
+ Synch devel branch with patches branch.
+
+2000-04-18 11:07 mslifcak
+
+ * apps/snmpdelta.c, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpset.c, apps/snmpstatus.c, win32/libsnmp_dll/libsnmp.def
+ (V4-1-1-patches.[3,3,3,2,3,2]), apps/snmpdelta.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, win32/libsnmp_dll/libsnmp.def
+:
+
+ Define optarg for apps use; Define vacm_is_configured for agent use.
+
+2000-04-18 07:57 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat.h, mibs/UCD-SNMP-MIB.txt
+:
+
+ - (vmstat.c, vmstat.h, UCD-SNMP-MIB.txt): Patch from Mizuki Honda:
+ - implement raw cpu usage numbers.
+
+2000-04-18 03:18 daves
+
+ * man/snmptable.1, apps/snmptable.c (V4-1-1-patches.[1,3]),
+ man/snmptable.1, apps/snmptable.c:
+
+ - (man/snmptable.1 apps/snmptable.c):
+ - Command-specific '-C' options for snmptable
+
+2000-04-18 02:01 daves
+
+ * apps/: snmp_parse_args.c (V4-1-1-patches.4), snmp_parse_args.c
+:
+
+ - (apps/snmp_parse_args.c): Handle previous form of -Z option as well
+
+2000-04-17 15:36 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): fix -Z if args are wrong.
+
+2000-04-17 15:32 hardaker
+
+ * apps/snmp_parse_args.c, man/snmpcmd.1:
+
+ - (snmp_parse_args.c, snmpcmd.1): fix -Z to use a ','.
+
+2000-04-17 15:06 hardaker
+
+ * agent/mibgroup/mibII/: mta_sendmail.c, mta_sendmail.h
+:
+
+ - (mta_sendmail.c, mta_sendmail.h): Patch from Christoph Mammitzsch:
+ - update on the sendmail module.
+
+2000-04-17 15:00 hardaker
+
+ * agent/mibgroup/ucd-snmp/: vmstat.c (V4-1-1-patches.1), vmstat.c
+:
+
+ - (vmstat.c): Patch from John L. Villalovos:
+ - fix ssCpuSystem, ssCpuUser, ssCpuIdle.
+
+2000-04-17 14:18 hardaker
+
+ * Makefile.top, apps/Makefile.in:
+
+ - (Makefile.top, Makefile.in): properly use LN_S for linking snmpinform.
+
+2000-04-17 13:45 hardaker
+
+ * snmplib/: snmpusm.c, snmpv3.c, snmpv3.h:
+
+ - (snmpusm.c, snmpv3.c, snmpv3.h): engineID changes for better aCC support.
+
+2000-04-17 13:44 hardaker
+
+ * apps/.cvsignore:
+
+ - (.cvsignore): ignore snmpinform.
+
+2000-04-17 09:58 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): fix row creation.
+
+2000-04-17 07:25 daves
+
+ * agent/: auto_nlist.c, snmpd.c, mibgroup/agentx/master.c
+ (V4-1-1-patches.[2,3,2]), auto_nlist.c, snmpd.c,
+ mibgroup/agentx/master.c:
+
+ - (auto_nlist.c snmpd.c agentx/master.c): Don't exit on failure with '-r'
+
+2000-04-14 15:07 hardaker
+
+ * apps/snmp_parse_args.c, apps/snmpdelta.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpstatus.c
+, man/snmpcmd.1, man/snmpget.1,
+ snmplib/default_store.h, snmplib/mib.c:
+
+ - (snmp_parse_args.c, snmpdelta.c, snmpget.c, snmpgetnext.c,
+ snmpstatus.c, snmpcmd.1, snmpget.1, default_store.h, mib.c):
+ - move -If to -Cf and invert behaviour.
+
+2000-04-14 15:06 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): remove debugging output (opps).
+
+2000-04-14 09:03 hardaker
+
+ * agent/mibgroup/ucd-snmp/: versioninfo.c (V4-1-1-patches.2),
+ versioninfo.c:
+
+ - (versioinfo.c): alright. Who made versionClearCache RONLY?
+
+2000-04-13 05:49 nba
+
+ * man/snmptranslate.1:
+
+ - snmptranslate.1: decument the -w width option
+
+2000-04-12 12:05 mslifcak
+
+ * bug-report (V4-1-1-patches.1), bug-report:
+
+ hide user's hostname; prompt before sending e-mail; prompt to save as file.
+
+2000-04-12 11:22 mslifcak
+
+ * snmplib/: mib.c (V4-1-1-patches.3), mib.c:
+
+ fix %f(%s)
+
+2000-04-12 09:29 hardaker
+
+ * man/: snmpcmd.1 (V4-1-1-patches.2), snmpcmd.1:
+
+ - (snmpcmd.1): document -If.
+
+2000-04-12 09:17 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): put ++ back in that accidentically got checked in.
+
+2000-04-12 09:16 hardaker
+
+ * apps/snmpset.c:
+
+ - (snmpset.c): put space back in usage line.
+
+2000-04-12 09:12 hardaker
+
+ * apps/snmp_parse_args.c, apps/snmpdelta.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, snmplib/default_store.h,
+ snmplib/mib.c:
+
+ - (snmp_parse_args.c, snmpdelta.c, snmpget.c, snmpgetnext.c,
+ snmpset.c, snmpstatus.c, default_store.h, mib.c):
+ - Add a new option -If to specify fixing of PDUs.
+ - Anyone know a better place to put this option?
+ - Applications don't do this by default anymore, and you can't in snmpset.
+
+2000-04-12 07:38 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c, snmplib/vacm.c,
+ snmplib/vacm.h:
+
+ - (vacm_vars.c, vacm.c, vacm.h): fix to allow no v1/v2c requests when
+ configured for just v3.
+
+2000-04-12 06:49 mslifcak
+
+ * win32/: win32.dsw, libsnmp_dll/libsnmp.def
+ (V4-1-1-patches.[1,1]), win32.dsw, libsnmp_dll/libsnmp.def
+:
+
+ fix MSVC build for encode_keychange, and add more symbols for release builds
+
+2000-04-12 05:32 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: correct parsing of sub-types textual conventions. Allow parsing
+ of MACRO invocations for standard symbols
+
+2000-04-12 05:31 nba
+
+ * apps/snmptranslate.c, snmplib/parse.c,
+ snmplib/parse.h:
+
+ - parse.[ch], snmptranslate.c: allow specification of with for -Tp
+
+2000-04-12 05:30 nba
+
+ * mibs/: HOST-RESOURCES-MIB.txt, HOST-RESOURCES-TYPES.txt
+:
+
+ - HOST-RESOURCES-MIB.txt, HOST-RESOURCES-TYPES.txt: align with published
+ RFC 2790
+
+2000-04-11 15:33 hardaker
+
+ * configure, configure.in, mibs/Makefile.in:
+
+ - (configure, configure.in): make config_add_mib() actually look for
+ the mib in $srcdir/mibs/blah and install it if found.
+
+2000-04-11 15:21 hardaker
+
+ * snmplib/: snmpv3.c, snmpv3.h:
+
+ - (snmpv3.c, snmpv3.h): make macaddr engineid setup not linux
+ specific, but #defines are checked instead.
+
+2000-04-11 15:20 hardaker
+
+ * snmplib/snmp_logging.h:
+
+ - (snmp_logging.h): remove old callback typedef no longer needed.
+
+2000-04-11 14:38 hardaker
+
+ * snmplib/: snmpv3.c, snmpv3.h:
+
+ - (snmpv3.c, snmpv3.h): Patch from John L. Villalovos:
+ - enable engineID to be set from MACAddr.
+
+2000-04-11 09:51 hardaker
+
+ * agent/mibgroup/mibII/: mta_sendmail.c, mta_sendmail.h
+:
+
+ - (mta_sendmail.c, mta_sendmail.h): New module from Christoph Mammitzsch:
+ - implements the MTA-MIB for monitoring sendmail.
+
+2000-04-11 09:50 hardaker
+
+ * mibs/: MTA-MIB.txt, NETWORK-SERVICES-MIB.txt:
+
+ - (MTA-MIB.txt, NETWORK-SERVICES-MIB.txt): new mibs for new modules.
+
+2000-04-11 03:25 daves
+
+ * agent/snmp_agent.c:
+
+ - (agent/snmp_agent.c): Save/restore original statP value for SET handling.
+
+2000-04-11 02:35 daves
+
+ * agent/: snmp_agent.c (V4-1-1-patches.2), snmp_agent.c:
+
+ - (agent/snmp_agent.c): Report failures from ACTION phase of SET correctly.
+
+2000-04-11 01:57 daves
+
+ * agent/mibgroup/agentx/: master_request.c (V4-1-1-patches.3),
+ master_request.c:
+
+ - (agentx/master_request.c): Dynamically resize subagent requests
+ (Thanks to Reiner Beninga)
+
+2000-04-10 05:08 daves
+
+ * agent/: snmp_agent.c, mibgroup/agentx/master_request.c
+ (V4-1-1-patches.[0,2]), snmp_agent.c,
+ mibgroup/agentx/master_request.c:
+
+ - (snmp_agent.c agentx/master_request.c): Fix multi-subagent requests
+ (Thanks to Reiner Beninga)
+
+2000-04-07 12:25 hardaker
+
+ * apps/snmptrap.c, snmplib/snmpusm.c (V4-1-1-patches.[2,2]),
+ apps/snmptrap.c, snmplib/snmpusm.c:
+
+ - (snmptrap.c, snmpusm.c):
+ - fix snmpv3 traps to be authoritative from the client side, not the
+ receiver side. snmpv3 informs stay as is. Unfortunately, for
+ command line apps this doesn't make a whole lot of sense but is
+ right in terms of how the protocol works and this is hence
+ somewhat of a hack.
+
+2000-04-07 07:50 daves
+
+ * agent/: snmp_agent.c (V4-1-1-patches.9), snmp_agent.c:
+
+ - (agent/snmp_agent.c): Handle v2 exception types in v1 queries
+
+2000-04-07 07:16 hardaker
+
+ * apps/snmptrapd.c, snmplib/read_config.c, snmplib/snmpv3.c
+ (V4-1-1-patches.[4,2,3]), apps/snmptrapd.c,
+ snmplib/read_config.c, snmplib/snmpv3.c:
+
+ - (snmptrapd.c, read_config.c, snmpv3.c):
+ - allow NULL help lines for config directives and use it to hide
+ internal directives used for persistent storage.
+
+2000-04-06 15:31 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c, snmp_api.h):
+ - turn backwards compatibility macros back into functions so
+ default_store.h dependencies go away again.
+ - create a flag to not probe for engineIDs durning sess_open().
+
+2000-04-06 07:20 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Fix mishandled Counter64 parsing
+
+2000-04-06 03:36 daves
+
+ * agent/snmpd.c:
+
+ - (agent/snmpd.c): Fix usage message alignment.
+
+2000-04-06 03:31 daves
+
+ * man/: snmpd.1.def (V4-1-1-patches.1), snmpd.1.def:
+
+ - (man/snmpd.1.def): Document the AgentX socket command-line option
+
+2000-04-05 08:41 hardaker
+
+ * local/FAQ2HTML:
+
+ - (FAQ2HTML): it's been sitting in my personal src tree for > 2 years.
+
+2000-04-05 08:38 hardaker
+
+ * agent/mibgroup/mibincl.h, agent/mibgroup/snmpv3/usmUser.c
+, apps/snmptrapd.c, snmplib/lcd_time.c,
+ snmplib/scapi.c, snmplib/snmp_api.c,
+ snmplib/snmpusm.c, snmplib/snmpusm.h, snmplib/snmpv3.c
+:
+
+ - (mibincl.h, usmUser.c, snmptrapd.c, lcd_time.c, scapi.c, snmp_api.c,
+ snmpusm.c, snmpusm.h, snmpv3.c):
+ - make snmptrapd handle v3 users properly, (and shutdown properly as well).
+ - a more generic user storage routine added to snmpusm.c and used in
+ usmUser.c with a side effect of needing callback.h above snmpusm.h.
+
+2000-04-05 08:27 hardaker
+
+ * local/rsnmp:
+
+ - (rsnmp): -> /usr/bin/perl
+
+2000-04-05 08:24 hardaker
+
+ * .cvsignore:
+
+ - (.cvsignore): misc minor additions to /
+
+2000-04-04 11:03 daves
+
+ * agent/: snmp_agent.c (V4-1-1-patches.8), snmp_agent.c:
+
+ - (agent/snmp_agent.c): Ensure unimplemented objects return 'noSuchObject'
+
+2000-04-03 14:57 mslifcak
+
+ * agent/snmp_agent.c:
+
+ Initialize statP.
+
+2000-04-03 09:12 daves
+
+ * agent/: snmp_agent.c (V4-1-1-patches.7), snmp_agent.c:
+
+ - (agent/snmp_agent.c): Ensure a v1 SET returns a v1 error status.
+
+2000-04-03 08:32 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): Year was "100" for 2000 (noticed by Jay Riddell):
+
+2000-04-03 07:53 daves
+
+ * agent/: snmp_agent.c (V4-1-1-patches.6), snmp_agent.c:
+
+ - (agent/snmp_agent.c): Ensure SETs fail if one varbind does.
+
+2000-03-31 07:25 daves
+
+ * agent/: snmp_vars.c (V4-1-1-patches.2), snmp_vars.c:
+
+ - (agent/snmp_vars.c): Fix to report 'noSuchObject' in certain circumstances
+
+2000-03-31 07:13 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Don't repeat the first four bytes in a PDU dump
+
+2000-03-31 07:04 daves
+
+ * snmplib/: snmp_logging.c (V4-1-1-patches.2), snmp_logging.c
+:
+
+ - (snmplib/snmp_logging.c): Handle logging empty strings (e.g. a null indent)
+
+2000-03-30 00:15 daves
+
+ * agent/: snmp_agent.c (V4-1-1-patches.5), snmp_agent.c:
+
+ - (agent/snmp_agent.c): Initialise timeout structure properly
+ (Thanks to ashipman@erggroup.com)
+
+2000-03-27 10:32 mslifcak
+
+ * agent/mibgroup/host/: hr_swrun.c (V4-1-1-patches.2), hr_swrun.c
+:
+
+ remove trailing newline from hrSWRunName values.
+
+2000-03-24 09:09 mslifcak
+
+ * man/snmpinform.1:
+
+ to sync with patches branch.
+
+2000-03-24 05:07 nba
+
+ * apps/snmptrapd.c:
+
+ - snmptrapd.c: correctly free the reponse if sending it fails
+
+2000-03-24 04:22 mslifcak
+
+ * snmplib/snmp_client.c:
+
+ xx_synch_response: avoid freeing PDU twice.
+
+2000-03-23 23:29 nba
+
+ * man/Makefile.in, man/snmpcmd.1, man/snmptrap.1
+, apps/Makefile.in, apps/snmptrap.c:
+
+ - snmpcmd.1, snmptrap.1, snmptrap.c, Makefile.in: Install and document
+ snmpinform.
+
+2000-03-23 09:58 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Enqueue only complete request_list entry; Reduce scoping of callback vars.
+
+2000-03-23 03:02 nba
+
+ * man/snmpinform.1:
+
+ file snmpinform.1 was initially added on branch V4-1-1-patches.
+
+2000-03-22 08:13 mslifcak
+
+ * agent/mibgroup/host/hr_print.c:
+
+ printf ?
+
+2000-03-21 11:12 mslifcak
+
+ * configure, configure.in:
+
+ modify F. Strauss' patch per N. Baggesen's suggestion: remove export-dynamic.
+
+2000-03-21 09:14 mslifcak
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ more smooth sailing with Win32 .DLL . DLLEXPORT, anyone ?
+
+2000-03-21 09:07 mslifcak
+
+ * agent/: agent_registry.c, mibgroup/mibII/system_mib.c
+:
+
+ win32 build check: no sigaction, SIGCLD defined.
+
+2000-03-21 08:47 daves
+
+ * agent/: ds_agent.h, snmpd.c,
+ mibgroup/agentx/master.c, mibgroup/agentx/subagent.c:
+
+ - (ds_agent.h snmpd.c mibgroup/agentx/{master,subagent}.c):
+ - Command-line option for specifying AgentX port
+ (based on patch from Frank Strauss)
+
+2000-03-21 08:38 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Support 'host:port' representation of peernames
+
+2000-03-21 04:05 daves
+
+ * agent/: snmp_agent.c (V4-1-1-patches.4), snmp_agent.c:
+
+ - (snmp_agent.c): Missing new-line on debug output
+
+2000-03-21 02:52 daves
+
+ * agent/mibgroup/mibII/: tcp.c, tcp.h, tcpTable.c
+, tcpTable.h, udp.c, icmp.c, udp.h,
+ udpTable.c, udpTable.h, icmp.h, ip.c,
+ system_mib.c:
+
+ - (mibII/{tcp,udp,ip,icmp}*) Continuing mibII code cleanup
+
+2000-03-20 11:14 mslifcak
+
+ * apps/snmptable.c:
+
+ Comment -C -- do not use this flag.
+
+2000-03-17 15:32 hardaker
+
+ * agent/mibgroup/header_complex.c:
+
+ - (header_complex.c): sizeof(x)*(len+1) not sizeof(x)*len+1
+
+2000-03-16 00:10 nba
+
+ * acconfig.h, configure.in, config.h.in,
+ configure, agent/mibgroup/host/hr_print.c:
+
+ - configure, hr_print.c: detect system printers (SysV/lpstat, *BSD/cgetnext,
+ Linux/printcap)
+
+2000-03-15 18:30 mslifcak
+
+ * agent/agent_registry.c:
+
+ Second part: all members of struct snmp_index are pointers.
+
+2000-03-15 15:07 mslifcak
+
+ * agent/agent_registry.c:
+
+ Fix memory leak with unregister_index.
+
+2000-03-15 15:07 mslifcak
+
+ * agent/mibgroup/smux/smux.c:
+
+ Fix memory leak when cleaning up trap variables.
+
+2000-03-15 08:48 daves
+
+ * snmplib/: snmp_api.c, snmp_client.c:
+
+ - (snmp_api.c snmp_client.c): Initialise varbind data hook elsewhere as well.
+
+2000-03-15 07:57 daves
+
+ * agent/mibgroup/agentx/: master_request.c (V4-1-1-patches.1),
+ master_request.c:
+
+ - (agentx/master_request.c): Fix infinite loop problem when walking subagent.
+
+2000-03-15 06:09 daves
+
+ * agent/snmp_agent.c:
+
+ - (agent/snmp_agent.c): Avoid calling read routine for each SET handling pass.
+ N.B: This hasn't been tested with AgentX subagents yet
+
+2000-03-15 06:07 daves
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmplib/snmp_api.[ch]): Provide hook for internal varbind-related data
+
+2000-03-15 05:22 daves
+
+ * agent/var_struct.h:
+
+ - (agent/var_struct.h): Use a single magic number for MIB registry name lengths.
+
+2000-03-15 01:51 daves
+
+ * snmplib/: system.h (V4-1-1-patches.1), system.h:
+
+ - (snmplib/system.h): Don't declare gettimeofday() if the system provides it.
+ (Fix provided by Ron Mevissen)
+
+2000-03-14 07:57 daves
+
+ * agent/: snmp_agent.c (V4-1-1-patches.3), snmp_agent.c:
+
+ - (agent/snmp_agent.c): Don't overwrite saved status when checking access.
+
+2000-03-14 07:52 daves
+
+ * agent/: snmp_agent.c (V4-1-1-patches.2), snmp_agent.c:
+
+ - (agent/snmp_agent.c): Return a response, even if the request failed.
+
+2000-03-13 15:32 nba
+
+ * agent/mibgroup/misc/ipfwacc.h:
+
+ - ipfwacc.h: fix the MIB name
+
+2000-03-10 12:48 hardaker
+
+ * configure:
+
+ - (configure): autoconf run
+
+2000-03-10 11:09 hardaker
+
+ * agent/mibgroup/examples/Makefile.dlmod:
+
+ - (Makefile.dlmod): Patch from Frank Strauss:
+ - dlmod build Makefile example. Needs incorperation with main configure.
+
+2000-03-10 11:02 hardaker
+
+ * agent/agent_registry.c:
+
+ - (agent_registry.c): better signal check from Michael Slifcak
+
+2000-03-10 10:59 hardaker
+
+ * mibs/UCD-DLMOD-MIB.txt:
+
+ - (UCD-DLMOD-MIB.txt): typo found by Michael Slifcak.
+
+2000-03-10 10:54 hardaker
+
+ * agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/dlmod.h, man/snmpd.conf.5.def,
+ mibs/UCD-DLMOD-MIB.txt:
+
+ - (dlmod.c, dlmod.h, snmpd.conf.5.def, UCD-DLMOD-MIB.txt): Patch from
+ Frank Strauss:
+ - Reimplementation of the dlmod mib module:
+ o mibgroup/misc/dlmod + dlmods/dlmod_mib -> mibgroup/ucd-snmp/dlmod
+ o fixed registration (ucdavis.ucdExperimental.14 instead of ucdavis.14)
+ o added configure stuff for HAVE_SNPRINTF, which was used by dlmod.c
+ o removed `_dynamic_' prefixes from init/deinit functions
+ o made dlmodIndex not-accessible (only implementation, not definition)
+ o removed the asn_parse_XXX stuff
+ o made entries with state `error' able to accept state `load'
+ o made the wombat example usable as static and dynamic module
+ o added simple config_parse functionality to the wombat example
+
+2000-03-10 10:52 hardaker
+
+ * agent/: agent_registry.c, agent_registry.h, snmpd.c
+:
+
+ - (agent_registry.c, agent_registry.h, snmpd.c): Patch from Frank Strauss:
+ - signal registry system implemented (needs to be redone allowing
+ multiple callbacks and handlers for all signals).
+ - arbitrary file descriptor/socket registration.
+ - this is not the way it should be done (use sessions instead).
+
+2000-03-10 10:44 hardaker
+
+ * Makefile.in, Makefile.top, acconfig.h,
+ config.h.in, configure.in, agent/Makefile.in
+, agent/mibgroup/Makefile.in, apps/Makefile.in
+, snmplib/Makefile.in, testing/Makefile.in:
+
+ - (Makefile.in, Makefile.top, acconfig.h, config.h.in, configure.in,
+ Makefile.in, Makefile.in, Makefile.in, Makefile.in, Makefile.in):
+ Patch from Frank Strauss:
+ - clean up shared library usage.
+
+2000-03-10 10:16 hardaker
+
+ * config.h.in:
+
+ - (config.h.in): autoheader re-arranged some stuff.
+
+2000-03-07 11:58 mslifcak
+
+ * apps/snmptrapd.c:
+
+ more touchups to allow UnixWare build to complete.
+
+2000-03-07 11:21 hardaker
+
+ * snmplib/default_store.h:
+
+ - (default_store.h): make MAX_SUBIDS larger and a multiple of 8.
+
+2000-03-07 10:13 mslifcak
+
+ * FAQ, configure, configure.in:
+
+ Introduce --enable-mini-agent to configure agent (snmpv3, no mibII interfaces).
+
+2000-03-07 09:03 mslifcak
+
+ * snmplib/snmpv3.c:
+
+ assume "snmpapp" if no arg passed to init_snmpv3.
+
+2000-03-07 08:58 mslifcak
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ remove init_mib() call - not appropriate here.
+
+2000-03-07 08:35 mslifcak
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ Let the aix4 patch work.
+
+2000-03-07 07:08 mslifcak
+
+ * configure, configure.in, agent/snmp_vars.c
+, agent/mibgroup/ucd-snmp/loadave.c:
+
+ trim fat from recent check-ins.
+
+2000-03-06 20:01 mslifcak
+
+ * config.h.in:
+
+ cleaned up SCO UnixWare build.
+
+2000-03-06 16:40 mslifcak
+
+ * Makefile.in, config.guess, config.h.in,
+ config.sub, configure, configure.in:
+
+ start support for SCO UnixWare 5 as svr5.
+
+2000-03-06 10:56 hardaker
+
+ * snmplib/: default_store.h, snmp_api.c:
+
+ - (default_store.h, snmp_api.c): Patch from Robert Story:
+ - don't check ranges if not requested.
+
+2000-03-06 10:55 hardaker
+
+ * agent/: snmp_agent.c, snmp_agent.h, snmpd.c
+:
+
+ - (snmp_agent.c, snmp_agent.h, snmpd.c): Patch from Robert Story:
+ - fix exit()ing behaviour in the libucdagent library.
+
+2000-03-06 10:36 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): Patch from Robert Story:
+ - -n prints numeric IP addrs.
+
+2000-03-06 10:25 hardaker
+
+ * snmplib/: callback.h, snmp_logging.c, snmp_logging.h
+:
+
+ - (callback.h, snmp_logging.c, snmp_logging.h): Idea from ashipman@erggroup.com:
+ - callback function (using callback.h) added for external logging.
+
+2000-03-05 05:25 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ fix to preserve trailing multi component instance id's at the end of
+ symbolic mib names(e.g., foo.6.7) when doing translateObj.
+
+2000-03-04 11:34 nba
+
+ * configure.in, configure:
+
+ - configure.in, configure: support --without-openssl, even if OpenSSL
+ is available
+
+2000-03-04 11:30 nba
+
+ * agent/: kernel.c, kernel.h, snmp_vars.c,
+ mibgroup/host/hr_swrun.c, mibgroup/mibII/var_route.c,
+ mibgroup/ucd-snmp/loadave.c, mibgroup/ucd-snmp/proc.c
+:
+
+ - agent/(various): globalize the kvm_t *kd variable
+
+2000-03-04 11:26 nba
+
+ * agent/: mib_modules.c, mibgroup/host/hr_storage.c:
+
+ - mib_modules.c, hr_storage.c: pre-processor # should be in column 1
+
+2000-03-04 11:17 nba
+
+ * apps/snmpnetstat/: inet.c, inet6.c:
+
+ - inet.c, inet6.c: survive -v 2c exception replies
+
+2000-03-04 11:17 nba
+
+ * snmplib/snmp_api.c:
+
+ - snmp_api.c: remove a superfluous & in front of an array
+
+2000-03-04 11:15 nba
+
+ * agent/mibgroup/: ucd_snmp.h, ucd-snmp/memory_netbsd1.c
+, ucd-snmp/memory_netbsd1.h, ucd-snmp/vmstat_netbsd1.c
+, ucd-snmp/vmstat_netbsd1.h:
+
+ - ucd_snmp.h, {memory,vmstat}_netbsd1.[ch]: support for NetBSD
+
+2000-03-04 11:14 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ - hr_disk.c: fixes for NetBSD
+
+2000-03-04 11:10 nba
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c:
+
+ - versioninfo.c: don't return the trailing newline
+
+2000-03-04 11:08 nba
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ - hr_swrun.c: fix process size for FreeBSD 3 and NetBSD
+
+2000-03-04 11:05 nba
+
+ * agent/agent_trap.h:
+
+ - agent_trap.h: fix a wrong prototype
+
+2000-03-04 11:04 nba
+
+ * apps/snmptable.c:
+
+ - snmptable.c: fix problems printing table name and headers when using
+ -OS format
+
+2000-03-02 11:50 nba
+
+ * snmplib/snmp_api.c:
+
+ - snmp_api.c: fix address length info for tcp connect
+
+2000-03-02 11:48 nba
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ - loadave.c: fix for AIX 4
+
+2000-03-02 08:30 daves
+
+ * agent/mibgroup/mibII/: ip.c, ipAddr.c, ipAddr.h
+, ip.h:
+
+ - (mib2/ip.[ch] mib2/ipAddr.[ch]): First stab at tidying up mib2 support.
+
+2000-03-01 08:32 mslifcak
+
+ * snmplib/mt_support.h:
+
+ fix bug 180 for cygwin build with _REENTRANT; per ashipman@erggroup.com
+
+2000-02-29 14:30 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Invoke snmp_sess_send from within snmp_read to avoid mutex deadlocks.
+
+2000-02-28 14:25 nba
+
+ * agent/: snmpd.h, mibgroup/smux/smux.c:
+
+ - snmpd.h, smux.c: don't initialize smux master in sub agent
+
+2000-02-28 14:16 nba
+
+ * agent/snmp_vars.c:
+
+ - snmp_vars.c: use SUB_AGENT symbol
+
+2000-02-28 14:12 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: sprint_by_type should handle ASN_BIT_STR
+
+2000-02-28 14:10 nba
+
+ * apps/snmp_parse_args.c:
+
+ - snmp_parse_args.c: correctly call the -I options input options
+
+2000-02-28 10:47 mslifcak
+
+ * config.h.in, configure, configure.in,
+ agent/auto_nlist.c:
+
+ fix bug #176 (AIX 4 - use knlist in lieu of nlist)
+
+2000-02-24 17:17 mslifcak
+
+ * configure, configure.in:
+
+ apply patch to fix bug no. 177.
+
+2000-02-24 13:31 hardaker
+
+ * snmplib/: default_store.h, read_config.c,
+ snmp_api.c:
+
+ - (default_store.h, read_config.c, snmp_api.c): new snmp.conf keyword
+ to force the parser to ignore unknown tokens.
+
+2000-02-24 03:59 mslifcak
+
+ * man/snmpset.1:
+
+ document UNSIGNED32 and COUNTER32 ('u' and 'c') in snmpset (gratis ashipman@erggroup.com)
+
+2000-02-24 03:56 mslifcak
+
+ * man/snmptrap.1, snmplib/snmp_api.c:
+
+ add support for COUNTER32 to snmp_add_var; document UNSIGNED32 and COUNTER32
+ ('u' and 'c') in snmptrap (gratis ashipman@erggroup.com)
+
+2000-02-23 23:06 nba
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ - pass.c, pass_persist.c: fix setting of octet strings.
+
+2000-02-23 02:09 nba
+
+ * snmplib/mt_support.h:
+
+ - mt_support.h: a bad ; in the C++ bracketing
+
+2000-02-23 02:09 nba
+
+ * snmplib/system.c:
+
+ - system.c: remove some superfluous indirections in strcasecmp
+
+2000-02-23 02:07 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - vmstat_solaris.c: make sure we agree with the prototype of getpagesize!
+
+2000-02-22 15:31 nba
+
+ * agent/mibgroup/ucd-snmp/pass_persist.h:
+
+ - pass_persist.h: declare init_pass_persist
+
+2000-02-21 16:17 mslifcak
+
+ * snmplib/system.c, win32/config.h:
+
+ Apply R. Story's patch for mkdirhier and strncasecmp on win32
+
+2000-02-21 07:39 mslifcak
+
+ * man/: read_config.3.def, snmp_alarm.3,
+ snmp_config.5.def, snmptrapd.conf.5.def, snmpusm.1
+:
+
+ fix bug 171 (thanks to Larry Parmelee).
+
+2000-02-21 05:56 mslifcak
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ remove free after snmp_close (don't free twice!)
+
+2000-02-21 04:58 mslifcak
+
+ * man/: mib_api.3, read_config.3.def, snmp_alarm.3
+, snmp_sess_api.3:
+
+ Added description in SH_NAME for several man-pages (c/o ragnark)
+
+2000-02-18 12:14 mslifcak
+
+ * man/: Makefile.in, snmp_close.3, snmp_free_pdu.3
+, snmp_open.3, snmp_read.3, snmp_select_info.3
+, snmp_send.3, snmp_sess_async_send.3,
+ snmp_sess_close.3, snmp_sess_error.3, snmp_sess_init.3
+, snmp_sess_open.3, snmp_sess_read.3,
+ snmp_sess_select_info.3, snmp_sess_send.3,
+ snmp_sess_sess_timeout.3, snmp_sess_session.3,
+ snmp_sess_timeout.3, snmp_timeout.3:
+
+ refer the .so macro to man3; adjust Makefile.in to use the renamed file.
+
+2000-02-17 05:17 mslifcak
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ include pass_persist in the required list.
+
+2000-02-17 02:00 daves
+
+ * configure, configure.in, config.h.in,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - (configure* ucd-snmp/vmstat_solaris2.c):
+ - Provide missing 'getpagesize' routine for Solaris 2.4
+ (Thanks to Ragnar Kjॆआà¤rstad)
+
+2000-02-16 20:17 mslifcak
+
+ * agent/mibgroup/: host/hr_system.c, mibII/snmp_mib.c
+, mibII/sysORTable.c, mibII/system_mib.c:
+
+ include mibincl.h in hr_system.c to fix bug #159.
+
+2000-02-16 16:35 mslifcak
+
+ * agent/mibgroup/ucd-snmp/memory_freebsd2.c:
+
+ remove auto_nlist of unused "swaplist" symbol.
+
+2000-02-16 15:17 mslifcak
+
+ * snmplib/asn1.c:
+
+ patch suggested by Rick Beaman <beaman@mediaone.net>
+
+2000-02-16 14:58 mslifcak
+
+ * apps/snmptrapd.c:
+
+ remove unused vars
+
+2000-02-16 14:57 mslifcak
+
+ * snmplib/: vacm.c, vacm.h:
+
+ test lengths before allocating memory; use new VACMSTRINGLEN constant.
+
+2000-02-16 08:18 mslifcak
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ include time.h once
+
+2000-02-16 08:02 mslifcak
+
+ * agent/mibgroup/mibII/udp.c:
+
+ restore #if HAVE...IN_PCB_H
+
+2000-02-15 23:47 nba
+
+ * configure, configure.in,
+ agent/mibgroup/mibII/ipv6.c, agent/mibgroup/mibII/ipv6.h
+:
+
+ - configure.in, ipch.[ch]: initial stabs at Linux ipv6 support. A lot is
+ lacking in the kernel statistics though.
+
+2000-02-15 23:40 nba
+
+ * config.h.in, configure.in,
+ agent/agent_read_config.c, agent/snmp_vars.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+:
+
+ - (many): configure check for netinet/ip6.h
+
+2000-02-15 23:34 nba
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ - hr_filesys.c: MNTTYPE defines for FreeBSD-3 and BSDI-4, and moving the
+ return value for Ext2FS to the newly defined OID.
+
+2000-02-15 23:23 nba
+
+ * apps/snmptable.c:
+
+ - snmptable.c: give a sensible output for an empty table.
+
+2000-02-15 23:22 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c, snmplib/vacm.c,
+ snmplib/vacm.h:
+
+ - vacm*: buffer length checking!
+
+2000-02-15 23:20 nba
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ - hr_storage.c: return memory size in pages.
+
+2000-02-15 23:17 nba
+
+ * agent/mibgroup/: ucd_snmp.h, ucd-snmp/memory_freebsd2.c
+:
+
+ - ucd_snmp.h, memory_freebsd2.h: make it work for FreeBSD-3 too
+
+2000-02-15 23:16 nba
+
+ * agent/snmp_agent.c:
+
+ - snmp_agent.c: one more place to send a AUTHFAIL trap
+
+2000-02-15 23:15 nba
+
+ * agent/agent_registry.c:
+
+ - agent_registry.c: fix a return for SNMPv1/Counter64 case
+
+2000-02-15 02:12 daves
+
+ * apps/snmp_parse_args.c:
+
+ - (apps/snmp_parse_args.c): Omit deprecated options from optarg handling.
+
+2000-02-11 15:47 hardaker
+
+ * makedepend.in:
+
+ - (makedepend.in): /usr/local/bin/perl -> /usr/bin/perl
+
+2000-02-11 15:38 hardaker
+
+ * local/rsnmp:
+
+ - (rsnmp): perl5 -> perl
+
+2000-02-11 15:17 hardaker
+
+ * man/Makefile.in:
+
+ - (man/Makefile.in): install snmp_trap_api.3
+
+2000-02-11 14:20 hardaker
+
+ * local/Makefile.in:
+
+ - (local/Makefile.in): last minute makefile touchup
+
+2000-02-11 14:03 hardaker
+
+ * NEWS:
+
+ - (NEWS): update for 4.1.1
+
+2000-02-11 13:47 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): Update for 4.1.1
+
+2000-02-11 13:29 hardaker
+
+ * bug-report, sedscript.in, version.h, FAQ
+, README:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.1.1 )
+
+2000-02-11 12:53 hardaker
+
+ * testing/tests/: T016snmpv2cgetfail, T017snmpv2ctov1getfail
+:
+
+ - (T016snmpv2cgetfail, T017snmpv2ctov1getfail): update for Timeout for v2c.
+
+2000-02-11 12:49 hardaker
+
+ * local/Makefile.in:
+
+ - (local/Makefile.in): don't cp for snmpcheck
+
+2000-02-11 12:44 hardaker
+
+ * local/Makefile.in:
+
+ - (local/Makefile.in): fix for seperate build path
+
+2000-02-11 12:30 hardaker
+
+ * agent/mibgroup/mibII/sysORTable.h:
+
+ - (sysORTable.h): Patch from Niels Baggesen:
+ - compiler warning fix.
+
+2000-02-11 12:29 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): patch from Niels:
+ - don't send autherror responses for v2c.
+ - send authFailure trap.
+
+2000-02-11 12:22 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): change perl path to /usr/bin.
+
+2000-02-11 06:58 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): Dont define PROCFIXCMD and EXECFIXCMD by default.
+
+2000-02-10 11:14 mslifcak
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ fix for older platforms to use pass_persist; not included by default.
+
+2000-02-10 10:33 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: extensible.c, pass_persist.c
+:
+
+ [no log message]
+
+2000-02-10 10:32 hardaker
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ - (hr_swinst.c): minor fixes pointed out by Michael.
+
+2000-02-10 10:28 hardaker
+
+ * snmplib/snmpv3.c:
+
+ - (snmpv3.c): fix setup engineID buffer overflow found by Mike Baer.
+
+2000-02-10 08:39 nba
+
+ * man/: default_store.3.top, mib_api.3,
+ read_config.3.def, snmp.conf.5.def, snmp_agent_api.3
+, snmp_alarm.3, snmp_api.3, snmp_config.5.def
+, snmp_sess_api.3, snmp_trap_api.3, snmpbulkget.1
+, snmpbulkwalk.1, snmpcmd.1, snmpd.1.def,
+ snmpd.conf.5.def, snmpdelta.1, snmpget.1,
+ snmpgetnext.1, snmpnetstat.1, snmpset.1,
+ snmpstatus.1, snmptable.1, snmptest.1,
+ snmptranslate.1, snmptrap.1, snmptrapd.8,
+ snmptrapd.conf.5.def, snmpusm.1, snmpwalk.1,
+ variables.5:
+
+ - man/*: set the dates on the pages to reflect the revision date
+
+2000-02-10 08:13 mslifcak
+
+ * snmplib/: md5.c, snmp_logging.c, snmp_logging.h
+:
+
+ fix varargs decl/defn of snmp_log
+
+2000-02-10 07:54 hardaker
+
+ * FAQ:
+
+ - (FAQ): mention the tutorial.
+
+2000-02-10 07:14 daves
+
+ * FAQ:
+
+ - (FAQ): Explicit examples of sending traps by hand
+
+2000-02-10 04:41 daves
+
+ * snmplib/snmp_api.c, snmplib/snmp_client.c,
+ apps/snmpnetstat/inet6.c:
+
+ - (snmplib/{snmp_api,snmp_client}.c apps/snmpnetstat/inet6.c):
+ - Comment unused code more informatively as to why it is omitted.
+
+2000-02-09 13:53 hardaker
+
+ * testing/: eval_tools.sh, tests/T023snmpv3getMD5DES,
+ tests/T024snmpv3getSHA1, tests/T025snmpv3getSHADES:
+
+ - (eval_tools.sh, T023snmpv3getMD5DES, T024snmpv3getSHA1, T025snmpv3getSHADES):
+ - skip ssl tests we can't perform.
+
+2000-02-09 13:51 mslifcak
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ include sys/param.h to get PATH_MAX on FreeBSD.
+
+2000-02-09 13:38 hardaker
+
+ * testing/tests/: Sv3SHADESconfig, T024snmpv3getSHA1,
+ T025snmpv3getSHADES:
+
+ - (Sv3SHADESconfig, T024snmpv3getSHA1, T025snmpv3getSHADES):
+ - make SHA tests actually work.
+
+2000-02-09 13:32 hardaker
+
+ * testing/tests/Sv3configsha:
+
+ - (Sv3configsha): sha config support
+
+2000-02-09 13:31 hardaker
+
+ * testing/tests/: T003snmpv1getfail, T016snmpv2cgetfail
+, T017snmpv2ctov1getfail, T018snmpv1tov2cgetfail:
+
+ - (T003snmpv1getfail, T016snmpv2cgetfail, T017snmpv2ctov1getfail,
+ T018snmpv1tov2cgetfail): fix for proper ACM error outputs.
+
+2000-02-09 13:30 mslifcak
+
+ * agent/mibgroup/host/hr_swinst.c, snmplib/system.c,
+ snmplib/tools.h:
+
+ Define SNMP_MAXPATH, and use it.
+
+2000-02-09 13:30 hardaker
+
+ * testing/tests/: T024snmpv3getSHA1, T025snmpv3getSHADES
+:
+
+ - (T024snmpv3getSHA1 T025snmpv3getSHADES): new tests
+
+2000-02-09 13:16 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): mention a new ucdExperimental registration (wavlan).
+
+2000-02-09 13:16 hardaker
+
+ * agent/: agent_callbacks.h, agent_registry.c,
+ agent_registry.h, snmp_agent.c,
+ mibgroup/mibII/vacm_vars.c:
+
+ - (agent_callbacks.h, agent_registry.c, agent_registry.h,
+ snmp_agent.c, vacm_vars.c):
+ - fix posible acm DoS problems by checking access tables early on.
+
+2000-02-09 11:38 hardaker
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ - (hr_swinst.c): patch from redhat for better RPM support.
+
+2000-02-09 10:43 hardaker
+
+ * configure.in:
+
+ - (configure.in): change mode to autoconf.
+
+2000-02-09 10:41 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in): fix rsnmp build. Really. I mean it.
+
+2000-02-09 10:41 hardaker
+
+ * agent/mibgroup/host/: hr_filesys.c, hr_storage.c:
+
+ - (hr_filesys.c, hr_storage.c): Patch from Andy HOOD:
+ - Solaris patches.
+
+2000-02-09 10:37 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in):
+ - fix rsnmp.made.
+ - use $(MAKE).
+
+2000-02-09 08:41 hardaker
+
+ * agent/mibgroup/ucd-snmp/: vmstat_solaris2.c,
+ vmstat_solaris2.h:
+
+ - (vmstat_solaris2.c, vmstat_solaris2.h): Update from Jochen Kmietsch
+
+2000-02-07 11:49 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ oops missing important fix for win32 build - fd_set must be same size as in winsock
+
+2000-02-07 11:18 mslifcak
+
+ * bug-report:
+
+ Undo last change; on Sun, additional platform info was not obtained;
+ the proper solution would be to remove the second token (hostname).
+
+2000-02-07 10:43 mslifcak
+
+ * bug-report:
+
+ Keep customer's nodename out of the published 'uname' information.
+
+2000-02-07 07:20 hardaker
+
+ * PORTING:
+
+ - (PORTING): Michael likes diff -u.
+
+2000-02-06 06:11 nba
+
+ * snmplib/read_config.c:
+
+ - read_config.c: Fix one final ':' to ENV_SEPARATOR_CHAR
+
+2000-02-05 17:39 hardaker
+
+ * snmplib/snmpv3.c:
+
+ - (snmpv3.c): correct some awful text -> engineID creation mistakes.
+
+2000-02-05 08:37 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): fix wrapped line continuation in usage message.
+
+2000-02-05 06:56 marz
+
+ * perl/SNMP/README:
+
+ fix version number
+
+2000-02-04 18:55 marz
+
+ * perl/SNMP/t/: session.t, set.t, startagent.pl:
+
+ weird delay in creation of pid files
+
+2000-02-04 18:21 marz
+
+ * perl/SNMP/t/: notify.t, startagent.pl:
+
+ brain-o
+
+2000-02-04 17:52 hardaker
+
+ * bug-report, sedscript.in, version.h, FAQ
+, README:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.1 )
+
+2000-02-04 17:49 hardaker
+
+ * PORTING, README, README.snmpv3, TODO:
+
+ - (PORTING, README, README.snmpv3, TODO): last minute doc updates.
+
+2000-02-04 17:19 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in): make local fixes for architectures that don't have
+ compliant makefile variables like $<.
+
+2000-02-04 16:47 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): update for 4.1
+
+2000-02-04 15:44 marz
+
+ * perl/SNMP/: BUG, hints/solaris.pl:
+
+ updates for perl/SNMP build
+
+2000-02-04 15:21 marz
+
+ * perl/SNMP/: hints/solaris.pl, t/get.t, t/getnext.t
+, t/session.t, t/set.t, t/snmptest.conf:
+
+ build fixes and test enhancements
+
+2000-02-04 15:09 marz
+
+ * perl/SNMP/: MANIFEST, Makefile.PL, SNMP.xs,
+ t/async.t, t/get.t, t/getnext.t, t/mibload.t
+, t/session.t, t/set.t, t/snmpd.conf,
+ t/snmptest.conf:
+
+ build fixes and test enhancements
+
+2000-02-04 14:01 hardaker
+
+ * man/snmptrapd.8:
+
+ - (snmptrapd.8): document -c and -C.
+
+2000-02-04 13:56 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c):
+ - implement -c and -C flags for Joe.
+ - redid the init structure to make it look more like the current agent.
+
+2000-02-04 13:52 marz
+
+ * INSTALL:
+
+ updates for perl/SNMP build
+
+2000-02-04 13:50 hardaker
+
+ * agent/agent_read_config.c:
+
+ - (agent_read_config.c): don't read the opt config file or call
+ post_config callbacks, since the library takes care of that now.
+
+2000-02-04 13:15 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in, testing/Makefile.in:
+
+ - (Makefile.in, Makefile.in, Makefile.in, Makefile.in, Makefile.in,
+ Makefile.in): final make depend.
+
+2000-02-04 13:12 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): don't print failed access errors (EACCES).
+
+2000-02-04 12:47 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h, snmpv3.c:
+
+ - (snmp_api.c, snmp_api.h, snmpv3.c): provide v3 defaults.
+
+2000-02-04 12:01 hardaker
+
+ * configure, configure.in, local/Makefile.in
+:
+
+ - (configure, configure.in, Makefile.in): find, locate, and use perl if found.
+
+2000-02-04 08:55 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ add defaults for v2 trap params
+
+2000-02-04 06:44 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ have mib loading api return result codes
+
+2000-02-04 04:00 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ - hr_disk.c: really do that FreBSD scsi thing
+
+2000-02-04 01:20 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - vacm_vars.c: slight rewording of warning message
+
+2000-02-04 00:17 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ - hr_disk.c: A little cleanup of the disk device definitions, also adding
+ SCSI to FreeBSD 3
+
+2000-02-04 00:16 nba
+
+ * snmplib/: mib.c, read_config.c:
+
+ - read_config.c, mib.c: fix some PATH separators from constant: to
+ ENV_SEPARATOR{_CHAR}
+
+2000-02-03 23:59 nba
+
+ * snmplib/mt_support.h:
+
+ - mt_support.h: another way of doing nothing, not giving a "null effect"
+ warning from gcc.
+
+2000-02-03 23:57 nba
+
+ * agent/: agent_registry.c, agent_trap.c,
+ mibgroup/agentx/client.c:
+
+ - agent/registry.c, agent_trap.c, client.c: change some type casts from
+ (char *) to (u_char *) top silence some warnings.
+
+2000-02-03 14:51 hardaker
+
+ * agent/mibgroup/README:
+
+ - (README): remove dummy reference.
+
+2000-02-03 14:46 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - (subagent.c): protect sysORTable callbacks with #ifdefs.
+
+2000-02-03 14:44 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - (subagent.c): include mib_module_config.h.
+
+2000-02-03 14:28 hardaker
+
+ * agent/mibgroup/dummy/: AddModuleForDummies.txt,
+ DUMMY-MIB.txt, dummy.c, dummy.h:
+
+ - (dummy/*): removed, use example instead.
+
+2000-02-03 13:28 mslifcak
+
+ * apps/snmptrapd.c:
+
+ Follow condition HAVE_GETPID for pid_file object.
+
+2000-02-03 12:58 mslifcak
+
+ * README, agent/dlmods/example.h,
+ agent/mibgroup/README:
+
+ Note the wombat is replaced by example in more places.
+
+2000-02-03 12:57 mslifcak
+
+ * win32/: mib_module_shutdown.h, libsnmp_dll/libsnmp.def
+, snmpnetstat/snmpnetstat.dsp, snmpset/snmpset.dsp
+:
+
+ Remove DOS-style line termination (CR-LF --> LF).
+ libsnmp.def - remove unneeded comment about obsolete v2party.
+
+2000-02-03 10:48 marz
+
+ * apps/snmptrapd.c:
+
+ add -u PIDFILE to snmptrapd, now we need -c -C:), btw is the value of optarg reliable after getopt has been called again...it seems to work
+
+2000-02-03 09:56 mslifcak
+
+ * acconfig.h, config.h.in,
+ agent/agent_read_config.c, agent/snmp_vars.c,
+ agent/mibgroup/mibincl.h, agent/mibgroup/util_funcs.c
+, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.h, win32/config.h
+:
+
+ Include mib_module_config.h from mibincl.h, not top level config.h.
+
+2000-02-03 09:44 marz
+
+ * README:
+
+ update my email
+
+2000-02-03 06:43 mslifcak
+
+ * win32/config.h:
+
+ include mib_module_config.h to make the USING_ constants visible.
+
+2000-02-03 04:12 mslifcak
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Undo uninformed change: load average != average time that CPU is idle.
+
+2000-02-03 01:35 daves
+
+ * FAQ:
+
+ - (FAQ): Document changes to access control stuff.
+
+2000-02-02 16:36 mslifcak
+
+ * agent/mib_modules.c:
+
+ Touchup to build more MIB modules on Win32.
+
+2000-02-02 16:23 mslifcak
+
+ * README.win32, agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ win32/mib_module_config.h, win32/mib_module_dot_conf.h,
+ win32/mib_module_includes.h, win32/mib_module_inits.h,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libucdmibs/libucdmibs.dsp:
+
+ Touchup for building more MIB modules in Win32 (MSVC).
+
+2000-02-02 14:18 mslifcak
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ Let hrProcessorLoad out of the genie's bottle.
+
+2000-02-02 14:17 marz
+
+ * perl/SNMP/README, README.win32:
+
+ add instructions for building w/ OpenSSL on VC++
+
+2000-02-02 13:42 marz
+
+ * README.win32:
+
+ add instructions for building w/ OpenSSL on VC++
+
+2000-02-02 10:52 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): Patch from Robert Miles:
+ - various fixes:
+ 1) The first registration request could be lost.
+ 2) Registration delete requests never received a response.
+ 3) Registration delete requests were not finding the registration when the
+ delete's priority was set to -1.
+ 4) Non-zero values were not being encoded properly in registration
+ responses.
+
+2000-02-02 08:52 mslifcak
+
+ * apps/snmpusm.c:
+
+ fix the fat-fingering patch I just made. feh.
+
+2000-02-02 08:42 mslifcak
+
+ * apps/snmpusm.c:
+
+ Allow -Co to affect the outcome.
+
+2000-02-02 08:02 daves
+
+ * agent/snmp_vars.c:
+
+ - (agent/snmp_vars.c): Correctly handle individually excluded instances
+
+2000-02-02 07:17 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): updated --help
+
+2000-02-02 06:45 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ - hr_disk.c: add NetBSD support
+
+2000-02-02 04:44 mslifcak
+
+ * agent/: Makefile.in, mibgroup/Makefile.in:
+
+ Remove dependencies on (moved) vestinternett/diskio
+
+2000-02-02 01:12 daves
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ - (host/hr_disk.c): Fix solaris initialisation, plus extra debugging info.
+
+2000-02-01 11:26 mslifcak
+
+ * snmplib/: snmpusm.c, snmpv3.c:
+
+ Fixup more signed/unsigned comparisons.
+
+2000-02-01 08:46 hardaker
+
+ * man/snmpusm.1:
+
+ - (snmpusm.1): changed context string in examples to "".
+
+2000-02-01 08:45 hardaker
+
+ * man/snmpcmd.1:
+
+ - (snmpcmd.1): .PP -> .IP for -Ob.
+
+2000-02-01 08:43 hardaker
+
+ * NEWS:
+
+ - (NEWS): update (again).
+
+2000-02-01 08:34 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ - (diskio.c): move to ucdExperimental.15.
+
+2000-02-01 08:34 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.h:
+
+ - (diskio.h): load the mib.
+
+2000-02-01 08:31 hardaker
+
+ * agent/mibgroup/: vestinternett/diskio.c,
+ vestinternett/diskio.h, ucd-snmp/diskio.c,
+ ucd-snmp/diskio.h:
+
+ - (diskio.*): moved to the ucd-snmp directory
+
+2000-02-01 05:27 daves
+
+ * FAQ:
+
+ - (FAQ): Expand the description of generating traps from the agent slightly.
+
+2000-02-01 04:19 daves
+
+ * configure, configure.in:
+
+ - (configure.in configure): Catch common invalid configure options.
+
+2000-02-01 03:37 daves
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (agentx/master_request.c): Fix session ID handling when delegating requests.
+
+2000-02-01 01:49 daves
+
+ * acconfig.h, config.h.in, configure.in,
+ configure, snmplib/snmp_api.h:
+
+ - (acconfig.h config.h.in configure.in configure snmplib/snmp_api.h):
+ - Fix broken setting of socket address structure choice.
+
+2000-01-31 10:41 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ set DS_LIB_DONT_BREAKDOWN_OIDS to get previoulsy released behaviour of get_symbol wrt octet based instance ids (i.e., no double-quoting)
+
+2000-01-31 07:57 daves
+
+ * agent/mibgroup/examples/: example.c, example.h:
+
+ - (mibgroup/examples/example.[ch]):
+ - Provide an example for how to trigger a trap.
+
+2000-01-31 07:56 daves
+
+ * apps/snmptest.c:
+
+ - (apps/snmptest.c): Don't assume size_t is signed (Pekka Kytolaakso)
+
+2000-01-31 07:55 daves
+
+ * snmplib/: snmpv3.c, snmpv3.h:
+
+ - (snmplib/snmpv3.[ch]): Don't assume size_t is signed (Pekka Kytolaakso)
+ - N.B: This changes the interface of snmpv3_generate_engineID() slightly.
+
+2000-01-31 07:53 daves
+
+ * snmplib/: asn1.c, snmp.c, snmp_api.c,
+ snmpusm.c:
+
+ - (snmplib/asn1.c snmplib/snmp.c snmplib/snmp_api.c snmplib/snmpusm.c):
+ - Don't assume size_t is signed (Pekka Kytolaakso)
+
+2000-01-31 07:51 daves
+
+ * snmplib/snmp_api.h:
+
+ - (snmplib/snmp_api.h): Attempt to mimic Irix-style socket address structure.
+
+2000-01-31 07:49 daves
+
+ * acconfig.h, config.h.in, configure.in,
+ configure:
+
+ - (acconfig.h config.h.in configure.in configure):
+ - Improved checking for Irix-style socket address structure.
+
+2000-01-31 03:41 daves
+
+ * AGENT.txt:
+
+ - (AGENT.txt): Revised and updated version.
+
+2000-01-31 03:14 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Initialize addrlen in _sess_read(). (Frank Strauss)
+
+2000-01-31 03:03 daves
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h config.h.in configure.in configure):
+ - Attempt to detect non-traditional socket address structure (on Irix 6.x).
+
+2000-01-31 03:00 daves
+
+ * snmplib/snmp_api.h:
+
+ - (snmplib/snmp_api.h): Alternative approach to Irix socket handling.
+
+2000-01-31 02:40 daves
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmplib/snmp_api.[ch]): Restore traditional socket field names.
+
+2000-01-31 01:45 daves
+
+ * agent/agent_trap.c:
+
+ - (agent/agent_trap.c): Include instance subidentifier in snmpTrapOID and
+ snmpTrapEnterprise OID definitions. (Thanks to Gerard Talman)
+
+2000-01-31 01:05 daves
+
+ * agent/agent_registry.h:
+
+ - (agent/agent_registry.h): Log failed MIB registrations.
+
+2000-01-30 10:56 marz
+
+ * perl/SNMP/: README, README:
+
+ clean up before release - update version, release notes etc.
+
+2000-01-30 10:46 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ clean up before release - update version, release notes etc.
+
+2000-01-30 10:44 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ clean up before release - update version, release notes
+
+ Note: KNOWN BUGS
+ the new quoted OCTETSTR instance identifiers returned by get_symbol
+ are not compatible with the perl/SNMP module (__get_label_iid)
+
+ not sure that this ever worked - will have to look at old OCTETSTR
+ behaviour and see how to recreate it
+
+2000-01-30 10:42 marz
+
+ * perl/SNMP/README:
+
+ clean up before release - update version, release notes
+
+ Note: KNOWN BUGS
+ the new quoted OCTETSTR instance identifiers returned by get_symbol
+ are not compatible with the perl/SNMP module (__get_label_iid)
+
+2000-01-30 08:19 marz
+
+ * perl/SNMP/t/snmpd.conf:
+
+ create V3 user entry, cleanup
+
+2000-01-30 03:11 nba
+
+ * apps/snmpnetstat/if.c:
+
+ - if.c: defensive test for missing objects (it might fail to show
+ down status properly)
+
+2000-01-30 03:09 nba
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ - hr_storage.c: convert from pages to 1k blocks
+
+2000-01-30 03:04 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ - hr_disk.c: convert to 1k blocks
+
+2000-01-30 03:01 nba
+
+ * agent/mibgroup/host.h:
+
+ - host.h: config_require_mib(HOST-RESOURCES-TYPES)
+
+2000-01-28 12:52 mslifcak
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ This with previous two changes completes a patch for items 2,3,4
+ for bug #149.
+
+2000-01-28 12:38 mslifcak
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ Change agentx_{build,parse}_short . Thanks to Gerard Talman@hitt.nl.
+
+2000-01-28 12:30 mslifcak
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ Fix spell LITTLE_ENDIAN. Thanks to talman@hitt.nl.
+
+2000-01-28 07:18 mslifcak
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ Some variable renaming for consistency, error checking
+ improved, missing string.h included. Patch supplied by author.
+
+2000-01-27 16:13 mslifcak
+
+ * snmplib/parse.c:
+
+ Remove hack around "SMI" token; keep the good part of the previous patch.
+
+2000-01-27 14:51 mslifcak
+
+ * snmplib/parse.c:
+
+ 1. Fix memory leak when anonymously named nodes are used.
+ 2. Hack around smicng's "SMI " statements to prevent other memory leaks.
+
+2000-01-27 11:14 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ remove no-op snmp_synch_setup
+
+2000-01-27 08:33 hardaker
+
+ * snmplib/default_store.c:
+
+ - (default_store.c): make config parser handle "" (null) parsed strings.
+
+2000-01-26 19:22 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): comma, comma, comma, comma, comma-chameleon.
+
+2000-01-26 17:32 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): allow ',' seperated --with-*-modules flag values.
+
+2000-01-26 17:18 hardaker
+
+ * bug-report, sedscript.in, version.h, FAQ
+, README:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.1.pre2 )
+
+2000-01-26 17:15 hardaker
+
+ * man/: snmpcmd.1, snmptrapd.conf.5.def, snmpusm.1
+:
+
+ - (snmpcmd.1, snmptrapd.conf.5.def, snmpusm.1):
+ - badly done updates.
+
+2000-01-26 16:54 hardaker
+
+ * testing/tests/: Sv3DESconfig, T023snmpv3getMD5DES:
+
+ - (Sv3DESconfig, T023snmpv3getMD5DES): fix DES test so it works.
+
+2000-01-26 16:53 hardaker
+
+ * snmplib/snmpv3.c:
+
+ - (snmpv3.c): fix priv key length extrapolation. Should be done differently?.
+
+2000-01-26 16:27 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, snmplib/Makefile.in:
+
+ - (Makefile.in, Makefile.in, Makefile.in, Makefile.in):
+ - make depend.
+
+2000-01-26 16:06 hardaker
+
+ * agent/agent_trap.c, agent/agent_trap.h,
+ man/snmpd.conf.5.def:
+
+ - (agent_trap.c, agent_trap.h, snmpd.conf.5.def): Patch from Frank Strauss:
+ - add ability to allow sending traps to ports other than 162.
+
+2000-01-26 15:34 hardaker
+
+ * mibs/: UCD-DEMO-MIB.txt, UCD-DISKIO-MIB.txt,
+ UCD-DLMOD-MIB.txt, UCD-IPFILTER-MIB.txt,
+ UCD-IPFWACC-MIB.txt, UCD-SNMP-MIB.txt:
+
+ - (UCD-DEMO-MIB.txt, UCD-DISKIO-MIB.txt, UCD-DLMOD-MIB.txt,
+ UCD-IPFILTER-MIB.txt, UCD-IPFWACC-MIB.txt, UCD-SNMP-MIB.txt):
+ - correct ucd-snmp-coders email address to replace "ece" with "ucd-snmp".
+
+2000-01-26 15:32 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): Patch from Juergen Schoenwaelder:
+ - clean up and reformat sub-registration comments.
+
+2000-01-26 15:31 hardaker
+
+ * mibs/UCD-IPFILTER-MIB.txt:
+
+ - (UCD-IPFILTER-MIB.txt): Patch from Juergen Schoenwaelder:
+ - prefix oids with "ucd".
+
+2000-01-26 15:30 hardaker
+
+ * mibs/UCD-DLMOD-MIB.txt:
+
+ - (UCD-DLMOD-MIB.txt): Patch from Juergen Schoenwaelder:
+ - prefix oid with "ucd".
+
+2000-01-26 15:29 hardaker
+
+ * mibs/: UCD-DISKIO-MIB.inc, UCD-DISKIO-MIB.txt,
+ VEST-INTERNETT-MIB.txt:
+
+ - (UCD-DISKIO-MIB.inc, UCD-DISKIO-MIB.txt, VEST-INTERNETT-MIB.txt):
+ Patch from Juergen Schoenwaelder:
+ - fix the diskio mib, convert to SMIv2, and move to ucdExperimental.
+
+2000-01-26 07:26 mslifcak
+
+ * README:
+
+ Acknowledge more contributors.
+
+2000-01-26 07:14 mslifcak
+
+ * agent/snmpd.c:
+
+ fix compile error when --without-root-access is used (strauss@ibr.cs.tu-bs.de)
+
+2000-01-25 21:46 mslifcak
+
+ * snmplib/: mib.c, parse.c:
+
+ mib.c:print_tree_node - show module name once in -- FROM;
+ parse.c: show "Cannot find module" once per missing module.
+
+2000-01-25 19:30 mslifcak
+
+ * snmplib/: mib.c, parse.c:
+
+ Larger buffer for print_module_name; Fix possible null deref in get_tc.
+
+2000-01-25 14:50 hardaker
+
+ * man/snmp_alarm.3, snmplib/snmp_alarm.c:
+
+ - (snmp_alarm.3, snmp_alarm.c): Patch from Frank Strauss:
+ - fix registration function to do what it says it should do.
+
+2000-01-25 14:47 hardaker
+
+ * configure, configure.in:
+
+ - (configure): help update
+
+2000-01-25 14:12 nba
+
+ * mibs/: HOST-RESOURCES-MIB.txt, HOST-RESOURCES-TYPES.txt
+, Makefile.in:
+
+ - HOST-RESOURCES-MIB.txt, HOST-RESOURCES-TYPES.txt, Makefile.in:
+ Update to the current draft HOST-RESOURCES (draft-ops-hostmib-01)
+
+2000-01-25 13:56 hardaker
+
+ * mibs/VEST-INTERNETT-MIB.txt:
+
+ - (VEST-INTERNETT-MIB.txt): Ragnar Kjrstad's diskio mib.
+
+2000-01-25 13:55 hardaker
+
+ * agent/mibgroup/vestinternett/: diskio.c, diskio.h:
+
+ - (vestinternett/diskio.[ch]): Ragnar Kjrstad's diskio mib.
+
+2000-01-25 13:52 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: fix a missing initialization of tc_index
+
+2000-01-25 12:05 marz
+
+ * README.win32:
+
+ additional win32 install notes
+
+2000-01-25 11:47 marz
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ add missing synbols for perl/SNMP module
+
+2000-01-25 06:49 marz
+
+ * snmplib/parse.c:
+
+ syntax for win32 build
+
+2000-01-24 10:36 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ [no log message]
+
+2000-01-24 10:14 mslifcak
+
+ * snmplib/mib.c:
+
+ Fix printing IMPLIED index (from associate of J. Kmietsch) modified and applied.
+
+2000-01-24 10:05 mslifcak
+
+ * configure, configure.in:
+
+ Itojun's netbsd ELF patch + remove wombat [Dave's example fix]
+
+2000-01-24 09:55 mslifcak
+
+ * apps/snmp_parse_args.c, apps/snmptrapd.c,
+ man/snmpcmd.1, snmplib/mib.c, snmplib/snmp_debug.c
+:
+
+ Fix Bug #144 items 1,3,4: case insensitive check for "all" keyword.
+
+2000-01-24 09:44 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: memory_solaris2.c,
+ vmstat_solaris2.c:
+
+ Make sure kstat_fd is initialized before being used.
+
+2000-01-24 08:59 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ [no log message]
+
+2000-01-24 07:21 daves
+
+ * agent/mibgroup/examples/: example.c, example.h,
+ wombat.c, wombat.h:
+
+ - (examples/{example,wombat}.[ch]):
+ - Consolidated example modules into one, including config and SET support.
+
+2000-01-23 16:41 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ handle adding OPAQUE vars for setting and traps etc.
+
+2000-01-23 12:43 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: errenous => erroneous
+
+2000-01-23 12:42 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: fix merging of anonymous nodes when they are named
+
+2000-01-23 08:51 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: add some more error checking to getoid
+
+2000-01-21 11:19 mslifcak
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ config_arch_require solaris2 version of vmstat.
+
+2000-01-21 10:47 marz
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ [no log message]
+
+2000-01-21 10:23 marz
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ [no log message]
+
+2000-01-21 08:13 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ inform
+
+2000-01-21 08:00 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ inform.
+
+2000-01-21 07:27 marz
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ added v3 inform
+
+2000-01-21 01:49 mslifcak
+
+ * agent/agent_registry.c, agent/agent_registry.h,
+ snmplib/snmp_api.c:
+
+ Minimize data handling and use register variabies in
+ snmp_oid_compare and compare_tree.
+
+2000-01-21 01:46 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: pass_persist.c, pass_persist.h
+:
+
+ Add const to cleanup a few signatures.
+
+2000-01-21 01:46 mslifcak
+
+ * perl/SNMP/README:
+
+ Remove party crud; spell check.
+
+2000-01-20 04:25 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Support selective binding of server addresses.
+
+2000-01-18 21:37 mslifcak
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ Consistent getpagesize (first divide by 1024).
+
+2000-01-18 21:28 mslifcak
+
+ * agent/mibgroup/mibII/snmp_mib.c,
+ win32/mib_module_includes.h, win32/mib_module_inits.h,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libucdmibs/libucdmibs.dsp:
+
+ 1.Make snmp_get_do_logging visible from DLL
+ 2.Apply Win32 patch from R.Story to activate mib stats module (snmp_mib).
+
+2000-01-18 21:25 mslifcak
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Remove commented out objects that are MAX-ACCESS not-accessible.
+
+2000-01-18 21:22 mslifcak
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ Cleanup around ip6_vars.h include (no #if 0)
+
+2000-01-18 14:23 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: vmstat_solaris2.c,
+ vmstat_solaris2.h:
+
+ Latest vmstat_solaris2 from the author Jochen Kmietsch.
+
+2000-01-18 08:14 mslifcak
+
+ * agent/agent_trap.c:
+
+ Prevent array bounds error when creating specific trap oid.
+
+2000-01-18 07:54 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ fix error messages and return vals for trap funcs, clean up pdu
+
+2000-01-18 07:00 marz
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ modified for v2-trap.
+
+2000-01-17 12:47 marz
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ added v2 trap
+
+2000-01-17 09:02 daves
+
+ * agent/snmp_vars.c:
+
+ - (agent/snmp_vars.c): Discard "too-late" responses from overlapped regions.
+
+2000-01-17 06:13 daves
+
+ * man/snmptrapd.8:
+
+ - (man/snmptrapd.8): Describe default logging behaviour.
+
+2000-01-14 16:10 hardaker
+
+ * NEWS:
+
+ - (NEWS): remove export control note about DES.
+
+2000-01-14 16:09 hardaker
+
+ * snmplib/scapi.c:
+
+ - (scapi.c): implement DES encryption.
+
+2000-01-14 11:34 hardaker
+
+ * bug-report:
+
+ - (bug-report): grep for configure flags
+
+2000-01-14 09:33 mslifcak
+
+ * agent/mibgroup/: examples/ucdDemoPublic.c, smux/snmp_bgp.c
+, smux/snmp_ospf.c, smux/snmp_rip2.c:
+
+ Small compile fix and debug message restoration.
+
+2000-01-13 06:33 daves
+
+ * snmplib/parse.c:
+
+ - (snmplib/parse.c): More complete handling of unloading MIB modules.
+
+2000-01-13 06:31 daves
+
+ * snmplib/: parse.c, parse.h:
+
+ - (snmplib/parse.[ch]): Unload MIB module
+ (N.B: Somewhat simplistic with regard to multiply-loaded nodes)
+
+2000-01-13 05:36 mslifcak
+
+ * snmplib/system.c:
+
+ No get_boottime support for cygwin (yet). Hopefully a temporary condition.
+
+2000-01-13 02:46 daves
+
+ * agent/snmp_vars.c:
+
+ - (agent/snmp_vars.c): Remove extraneous bracket.
+
+2000-01-12 21:08 mslifcak
+
+ * agent/agent_registry.c, agent/snmp_vars.c,
+ agent/snmpd.c, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/examples/wombat.c,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_proc.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/smux/snmp_bgp.c,
+ agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c, apps/snmpusm.c
+, snmplib/snmp_logging.c, snmplib/snmp_logging.h
+:
+
+ Use DEBUGMSGOID liberally, replacing sprint_objid; small speedup.
+
+2000-01-12 11:16 hardaker
+
+ * snmplib/snmpv3.c:
+
+ - (snmpv3.c): cast malloc returns.
+
+2000-01-11 15:05 mslifcak
+
+ * agent/Makefile.in:
+
+ Use CFLAGS when linking (could have profile switch, etc).
+
+2000-01-11 10:37 marz
+
+ * perl/SNMP/t/get.t:
+
+ remove bad session test - session.t has it already - note the call to gethostbyname can hang for some time if DNS is not setup correctly - anyone know a way arround this?
+
+2000-01-11 09:13 mslifcak
+
+ * agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ apps/snmpstatus.c, snmplib/snmp_api.c,
+ snmplib/snmpv3.c, snmplib/tools.c, snmplib/tools.h
+:
+
+ Restore memdup usage to its former luster.
+
+2000-01-11 08:10 mslifcak
+
+ * snmplib/system.c:
+
+ Init file count at zero, not by incrementing random value.
+
+2000-01-11 07:59 mslifcak
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Keep win32 release build from breaking.
+
+2000-01-11 07:44 mslifcak
+
+ * win32/config.h:
+
+ Add IN_UCD_SNMP_SOURCE to not break Win32 builds.
+
+2000-01-11 01:53 mslifcak
+
+ * agent/mibgroup/Makefile.in:
+
+ Glean refs to mibII.o from this makefile.
+
+2000-01-11 01:32 mslifcak
+
+ * agent/mibgroup/header_complex.c,
+ agent/mibgroup/util_funcs.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c, apps/snmpstatus.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ apps/snmpnetstat/route.c, apps/snmpnetstat/winstub.c,
+ snmplib/keytools.c, snmplib/parse.c,
+ snmplib/snmp_api.c, snmplib/snmpv3.c,
+ snmplib/tools.c, snmplib/tools.h, snmplib/vacm.c
+:
+
+ Trolling for malloc errors; more graceful degradation.
+
+2000-01-10 16:32 mslifcak
+
+ * snmplib/: read_config.c, scapi.h, snmp_api.c
+:
+
+ snmp_api.c - better comment for snmp_oid_compare.
+ read_config.c - remove sizeof(u_char) from malloc size calc.
+ scapi.h - spell check.
+
+2000-01-10 16:31 mslifcak
+
+ * apps/snmptranslate.c:
+
+ snmptranslate.c - simple default case.
+
+2000-01-10 16:31 mslifcak
+
+ * man/snmptranslate.1:
+
+ snmptranslate.1 - remove junk line.
+
+2000-01-10 16:30 mslifcak
+
+ * agent/: snmp_vars.c, snmpd.c,
+ mibgroup/examples/ucdDemoPublic.c:
+
+ ucdDemoPublic.c - remove uninitialized variables from write method.
+ snmp_vars.c - proper oid compare; no copy from save if oids exact match
+ snmpd.c - terminate statement.
+
+2000-01-10 15:38 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in):
+ - make --without-efence work.
+ - check for -lnsl more explicitly.
+
+2000-01-10 15:36 hardaker
+
+ * testing/tests/Sv3config:
+
+ - (Sv3config): remove the trailing space.
+
+2000-01-10 15:36 hardaker
+
+ * agent/mibgroup/mibincl.h:
+
+ - (mibincl.h): include stdlib.h and malloc.h.
+
+2000-01-10 14:40 marz
+
+ * perl/SNMP/MANIFEST:
+
+ add mibload
+
+2000-01-10 14:34 marz
+
+ * perl/SNMP/t/mibload.t:
+
+ [no log message]
+
+2000-01-10 14:20 marz
+
+ * perl/SNMP/: BUG, MANIFEST, MANIFEST.SKIP,
+ Makefile.PL, README, SNMP.pm, SNMP.xs, TODO
+, perlsnmp.h, typemap, examples/async1.pl,
+ examples/async2.pl, examples/ipforward.pl,
+ examples/mibtree.pl, examples/mibwalk.pl,
+ examples/pingmib.pl, examples/tablewalk.pl,
+ examples/testleak.pl, hints/irix.pl, hints/solaris.pl
+, t/README, t/async.t, t/get.t, t/getnext.t
+, t/mib.t, t/mib.txt, t/session.t, t/set.t
+, t/snmpd.conf:
+
+ Checking in SNMP-3.1.0b1
+
+2000-01-10 13:21 mslifcak
+
+ * configure, configure.in:
+
+ Qualify use of withval to define library and include search paths.
+
+2000-01-10 13:14 mslifcak
+
+ * win32/win32.dsw:
+
+ Allow MSVC++ 5.x users to build using this workspace.
+
+2000-01-10 06:12 daves
+
+ * snmplib/system.c:
+
+ - (snmplib/system.c): Re-structure get_uptime() to cache boot time.
+
+2000-01-10 03:06 daves
+
+ * agent/snmp_agent.c:
+
+ - (agent/snmp_agent.c): Count numbers of variables requested/set
+
+2000-01-10 02:31 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Differentiate max-repetition and non-repeater errors.
+
+2000-01-10 01:37 daves
+
+ * agent/mibgroup/mibII.h:
+
+ - (agent/mibgroup/mibII.h): Re-remove redundant prototype.
+
+2000-01-08 12:07 mslifcak
+
+ * agent/auto_nlist.c:
+
+ Use knlist iff aix4 and HAVE_KNLIST [not complete w/o configure mods]
+
+2000-01-08 11:44 mslifcak
+
+ * configure, configure.in:
+
+ Fix build for Linux RedHat 6.1 (cant link libwrap without libnsl).
+
+2000-01-08 00:56 nba
+
+ * configure.in, configure:
+
+ - configure.in: bugfix for a bugfix bug
+
+2000-01-07 23:43 nba
+
+ * configure, configure.in:
+
+ - configure.in: some missing "x" in tests for --with-openssl and
+ --disable-developer
+
+2000-01-07 16:21 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - (vacm_vars.c): properly group rw/rousers into usm not v1/v2c.
+
+2000-01-07 11:22 hardaker
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c): Patch from Robert Story:
+ - handle multiple translated OIDs.
+
+2000-01-07 10:38 hardaker
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c,
+ snmpTargetParamsEntry.c:
+
+ - (snmpTargetAddrEntry.c, snmpTargetParamsEntry.c): update to v4 API set code.
+
+2000-01-07 09:29 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): better handling of write failures.
+
+2000-01-06 15:09 hardaker
+
+ * local/mib2c.conf:
+
+ - (mib2c.conf): unquoted quotes quoted.
+
+2000-01-06 15:08 hardaker
+
+ * local/mib2c:
+
+ - (mib2c): removed a debugging statement.
+
+2000-01-06 15:08 hardaker
+
+ * COPYING:
+
+ - (COPYING): y2k bug.
+
+2000-01-06 13:14 marz
+
+ * testing/tests/: T020snmpv3get, T021snmpv3getnext:
+
+ update config access syntax (exact)
+
+2000-01-06 13:07 marz
+
+ * snmplib/snmp_logging.c:
+
+ we should not print to stderr if stderr logging is diabled - this thows off the alignment of test output for 'make test' in both ucd-snmp and Perl/SNMP
+
+2000-01-06 12:56 marz
+
+ * testing/tests/Svanyconfig:
+
+ update syntax (exact)
+
+2000-01-06 08:57 hardaker
+
+ * agent/mibgroup/util_funcs.h:
+
+ - (util_funcs.h): properly wrap struct.h include directive for
+ non-source-directory include.
+
+2000-01-06 01:58 daves
+
+ * agent/mibgroup/mibII.c:
+
+ - (mibgroup/mibII.c): Remove redundant file
+
+2000-01-04 23:51 nba
+
+ * apps/snmptrapd.c:
+
+ - snmptrapd.c: implement trand handlers for win32
+
+2000-01-04 23:50 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: #ifdef some variables not used under win32
+
+2000-01-04 22:12 nba
+
+ * EXAMPLE.conf.def, FAQ, man/snmpd.conf.5.def:
+
+ - EXAMPLE.conf.def, FAQ, snmpd.conf.5.def: remove all traces of security
+ model "any" in "group" configuration directives
+
+2000-01-04 16:27 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in): Patch from Sander Steffann:
+ - Add -I/usr/include/rpm because of badly written rpm header files.
+
+2000-01-04 10:35 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): deal with blocking better in snmp_agent_check_and_process().
+
+2000-01-04 10:33 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): install struct.h
+
+2000-01-04 08:58 hardaker
+
+ * FAQ, README:
+
+ - (README, FAQ): Japan mirror location change.
+
+2000-01-03 15:39 nba
+
+ * man/: snmpcmd.1, snmptranslate.1,
+ snmptrapd.conf.5.def:
+
+ - snmpcmd.1: add snmpbulkget to list of applications
+ - snmptranslate.1: explain -T outputs
+ - snmptrapd.conf.5.def: defalt traphandler is implemented
+
+2000-01-03 15:34 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: also note TEXTUAL CONVENTION in -Td output
+
+2000-01-03 15:32 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: fix File variable being left pointing into the stack.
+ Ignore .index file on WIN32 platform
+
+2000-01-03 15:30 nba
+
+ * snmplib/system.h:
+
+ - system.h: add prototype for strcasecmp
+
+2000-01-03 15:28 nba
+
+ * agent/mibgroup/examples/: wombat.c, wombat.h:
+
+ - wombat.[ch]: correct prototype for wombat_parse_config
+
+2000-01-03 15:27 nba
+
+ * agent/mibgroup/mibII.h:
+
+ - mibII.h: add prototype for init_mibII
+
+2000-01-03 15:26 nba
+
+ * agent/snmpd.c:
+
+ - snmpd.c: add a missing const specifier
+
+2000-01-03 15:26 nba
+
+ * agent/snmp_vars.c:
+
+ - snmp_vars.c: include agent_registry.h only once
+
+2000-01-03 15:23 nba
+
+ * EXAMPLE.conf.def:
+
+ - EXAMPLE.conf.def: adapt to changes in valid vacm syntax
+
+1999-12-31 13:27 mslifcak
+
+ * configure, configure.in,
+ agent/mibgroup/mibII/interfaces.c, snmplib/snmp_logging.c
+:
+
+ Apply some NetBSD 1.3.x, 1.4 patches c/o Grea A. Woods <woods@planix.com>
+
+1999-12-31 12:43 mslifcak
+
+ * snmplib/system.c, win32/config.h,
+ win32/libsnmp_dll/libsnmp.def:
+
+ Fix bug #48: no strcasecmp/strncasecmp for Sinix
+
+1999-12-31 10:36 mslifcak
+
+ * agent/mibgroup/host/hr_system.c, apps/snmptable.c:
+
+ Fix warnings of uninitialized variables.
+
+1999-12-31 10:33 mslifcak
+
+ * configure.in, configure:
+
+ Autoconf patch c/o Albert Chin-A-Young <china@thewrittenword.com>
+
+1999-12-31 10:11 mslifcak
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ Fix bug #125 - insert underscore into struct snmp_ipaddr member names.
+
+1999-12-31 09:32 mslifcak
+
+ * agent/auto_nlist.c:
+
+ Apply patch provided by Serg Trushnikov <sat@zmail.ru> for AIX 4.2.1 knlist
+
+1999-12-31 09:31 mslifcak
+
+ * agent/mibgroup/host/hr_utils.c:
+
+ Fix bug # 122
+
+1999-12-30 12:00 mslifcak
+
+ * agent/snmpd.c, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/smux/smux.c, snmplib/tools.c:
+
+ Fix compile errors.
+
+1999-12-30 07:51 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): usage line order messed up, as pointed out by Robert Story.
+
+1999-12-28 15:42 hardaker
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (master_request.c): remove the ! in front of in_a_view, which changed.
+
+1999-12-23 08:21 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - (vmstat_solaris2.c): Patch from Jochen Kmietsch:
+ - non 80-column wrapped version.
+
+1999-12-22 16:30 hardaker
+
+ * agent/mibgroup/ucd-snmp/: vmstat_solaris2.c,
+ vmstat_solaris2.h:
+
+ - (vmstat_solaris2.c, vmstat_solaris2.h): Patch from Jochen Kmietsch:
+ - first pass at vmstat support for solaris.
+
+1999-12-22 15:13 hardaker
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (master_request.c): increase max vars to 64 (was 16). I have a
+ table with more than that number in columns, which breaks snmptable.
+
+1999-12-22 15:12 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ - (master.c): use snmp_sess_open for the second try at opening the
+ master port.
+
+1999-12-22 05:58 nba
+
+ * agent/agent_registry.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/mibgroup/mibII/vacm_vars.c,
+ snmplib/vacm.h:
+
+ - vacm routines: alignment with RFC mibs, preparing for trap generation
+ and a better integration with variable tree walking
+
+1999-12-22 05:47 nba
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ - system_mib.c: use some #defines i place of numbers
+
+1999-12-22 05:46 nba
+
+ * snmplib/system.c:
+
+ - system.c: naughty, naughty Niels, just reindenting ...
+
+1999-12-22 02:43 nba
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ - hr_storage.c: kill a dummy value
+
+1999-12-22 02:41 nba
+
+ * agent/mibgroup/ucd-snmp/memory_freebsd2.c:
+
+ - memory_freebsd2.c: make it work (again) for FreeBSD-2:-)
+
+1999-12-21 02:37 nba
+
+ * agent/snmpd.c, agent/mibgroup/smux/smux.c,
+ snmplib/snmp_api.c:
+
+ - snmpd.c, smux.c, snmp_api.c: take away some unused variables.
+
+1999-12-20 17:34 hardaker
+
+ * bug-report, sedscript.in, version.h, FAQ
+, README:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.1.pre1 )
+
+1999-12-20 17:32 hardaker
+
+ * agent/mibgroup/mibincl.h:
+
+ - (mibincl.h): add agent_trap.h
+
+1999-12-20 17:32 hardaker
+
+ * NEWS:
+
+ - (NEWS): mention SMIv2 updates.
+
+1999-12-20 17:31 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): minor note.
+
+1999-12-20 17:20 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Digital Unix hack for bad recvfrom implementation.
+
+1999-12-20 17:20 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - (agentx/protocol.c): make a things size_t instead of u_int (for 64bit code).
+
+1999-12-20 17:19 hardaker
+
+ * agent/agent_trap.c:
+
+ - (agent_trap.c): make uptime a long for 64bit architectures.
+
+1999-12-20 15:38 hardaker
+
+ * mibs/Makefile.in:
+
+ - (Makefile.in): IPFWACC-MIB.txt -> UCD-IPFWACC-MIB.txt
+
+1999-12-20 13:30 hardaker
+
+ * agent/mibgroup/misc/ipfwacc.c:
+
+ - (ipfwacc.c): moved table to one level deeper under mib node.
+
+1999-12-20 13:30 hardaker
+
+ * mibs/UCD-IPFWACC-MIB.txt:
+
+ - (UCD-IPFWACC-MIB.txt): moved table to one level deeper under mib node.
+
+1999-12-20 13:26 hardaker
+
+ * mibs/: UCD-IPFWACC-MIB.inc, UCD-IPFWACC-MIB.txt:
+
+ - (UCD-IPFWACC-MIB.txt): moved and updated from IPFWACC-MIB.txt
+
+1999-12-20 13:25 hardaker
+
+ * mibs/IPFWACC-MIB.txt:
+
+ - (IPFWACC-MIB.txt): moved to UCD-IPFWACC-MIB.txt
+
+1999-12-20 13:23 hardaker
+
+ * mibs/IPSEC-MIB.txt:
+
+ - (IPSEC-MIB.txt): removed
+
+1999-12-20 06:48 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): moved kernel.o into the libucdagent library.
+
+1999-12-20 06:43 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): Force set to 1 for -D so multiple switches can
+ be given (ie, don't toggle the value).
+
+1999-12-20 04:15 daves
+
+ * agent/: agent_trap.c, snmp_vars.c,
+ mibgroup/mibII.h, mibgroup/mibII/at.c,
+ mibgroup/mibII/icmp.c, mibgroup/mibII/interfaces.c,
+ mibgroup/mibII/ip.c, mibgroup/mibII/ipv6.c,
+ mibgroup/mibII/snmp_mib.c, mibgroup/mibII/sysORTable.c
+, mibgroup/mibII/system_mib.c, mibgroup/mibII/tcp.c
+, mibgroup/mibII/udp.c, mibgroup/mibII/vacm_vars.c
+, mibgroup/mibII/sysORTable.h:
+
+ - (agent_trap.c snmp_vars.c mibII.[ch] mibII/*.c mibII/sysORTable.h):
+ - Use SNMP_OID prefix definitions in OID specifications.
+ - Register the various MIB-2 modules separately in sysORTable.
+
+1999-12-20 03:01 daves
+
+ * agent/mibgroup/agentx/README.agentx:
+
+ - (agentx/README.agentx): Updated to describe current status.
+
+1999-12-17 15:57 hardaker
+
+ * agent/mibgroup/: header_complex.c, header_complex.h:
+
+ - (header_complex.c, header_complex.h): completely restructured.
+ - drasticly reduces memory usage for large data sets (1/3).
+
+1999-12-17 15:56 hardaker
+
+ * agent/: agent_read_config.c, agent_registry.c,
+ snmp_vars.c:
+
+ - (agent_read_config.c, agent_registry.c, snmp_vars.c):
+ - include "snmp_alarm.h" for mib modules that need the callback def.
+
+1999-12-17 15:55 hardaker
+
+ * NEWS:
+
+ - (NEWS): mention -I.
+
+1999-12-17 15:46 hardaker
+
+ * snmplib/snmp_alarm.c:
+
+ - (snmp_alarm.c): missing ! operater on signal test.
+
+1999-12-17 15:41 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: memory_freebsd2.c, vmstat.c
+, vmstat_freebsd2.c:
+
+ No dummy values for FreeBSD, please.
+
+1999-12-17 15:21 mslifcak
+
+ * agent/mibgroup/: ucd_snmp.h, ucd-snmp/memory_freebsd2.c
+, ucd-snmp/vmstat_freebsd2.c:
+
+ Add Bill Fumerola's patch for FreeBSD 4.x to use swapinfo.
+ Include FreeBSD 4.x specific memory and vmstat when building that agent.
+
+1999-12-17 14:23 mslifcak
+
+ * man/: README, mib_api.3, snmp.conf.5.def,
+ snmpcmd.1, snmpd.1.def, snmpd.conf.5.def,
+ snmpnetstat.1, snmptest.1, snmpusm.1, snmpwalk.1
+:
+
+ Fixed a few spelilng errors.
+
+1999-12-17 10:18 hardaker
+
+ * man/snmp_agent_api.3:
+
+ - (snmp_agent_api.3): re-structure based on recent changes.
+
+1999-12-17 10:18 hardaker
+
+ * NEWS:
+
+ - (NEWS): second pass.
+
+1999-12-17 10:17 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): removed -R from the -h output.
+
+1999-12-17 10:17 hardaker
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ - (usmUser.c): changed help line of createUser to seperate DES token
+ from the passphrase.
+
+1999-12-17 10:16 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): put snmpd.o into the object list, and remove it from
+ direct compilation in the CC link line.
+
+1999-12-17 10:11 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): reorder init() routines for -H to prevent segfaulting.
+
+1999-12-17 10:11 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in): PERSISTENT_DIRECTORY token added.
+
+1999-12-17 10:10 hardaker
+
+ * NEWS:
+
+ - (NEWS): first pass at changes.
+
+1999-12-17 07:40 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): document createUser.
+
+1999-12-17 07:28 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): document the file directive.
+
+1999-12-17 07:26 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): document rocommunity, rwcommunity, rouser, rwuser.
+
+1999-12-17 07:13 hardaker
+
+ * man/snmp.conf.5.def:
+
+ - (snmp.conf.5.def): document a bunch of new configuration options.
+
+1999-12-17 07:05 hardaker
+
+ * man/snmpcmd.1:
+
+ - (snmpcmd.1): mention that -IR and -Ib are actually used by default.
+
+1999-12-17 07:03 hardaker
+
+ * man/snmpcmd.1:
+
+ - (snmpcmd.1): document -I and -O flags.
+
+1999-12-17 03:22 nba
+
+ * win32/: libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp.def
+:
+
+ - libsnmp.def: add some function names
+
+1999-12-17 02:18 nba
+
+ * apps/snmptrapd.c:
+
+ - snmptrapd.c: make the oids given to trapd handlers properly .0 terminated.
+ Add a SNMP-COMMUNITY-MIB::snmpTrapAddress.0
+ Add syslog of v2 traps and informs
+
+1999-12-17 02:14 nba
+
+ * apps/snmptable.c:
+
+ - snmptable.c: cleanup of the "new" mib walk to determine fields. Make it
+ default (don't even document the -C compatibility option). Ignore
+ not-accessible fields in the walk.
+
+1999-12-17 02:09 nba
+
+ * apps/snmp_parse_args.c:
+
+ - snmp_parse_args.c: remove some superfluous usage() calls.
+
+1999-12-17 02:08 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: kill that tail recursion elimination, it just adds too many
+ conditionals. Properly output an empty string index.
+
+1999-12-16 23:10 nba
+
+ * snmplib/snmpv3.c:
+
+ - snmpv3.c: a more spevific help message for defVersion
+
+1999-12-16 23:09 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: fix a tail recursion elimination problem printing oids
+
+1999-12-16 23:08 nba
+
+ * apps/snmptranslate.c:
+
+ - snmptranslate.c: be explicit in the -t warning
+
+1999-12-16 23:08 nba
+
+ * agent/mibgroup/smux/: smux.c, smux.h:
+
+ - smux.[ch]: fix some prototypes and includes.
+
+1999-12-16 23:06 nba
+
+ * agent/snmpd.c:
+
+ - snmpd.c: \n terminate some log messages
+
+1999-12-16 23:05 nba
+
+ * agent/kernel.c:
+
+ - kernel.c: output error string, not number
+
+1999-12-15 11:08 mslifcak
+
+ * agent/mibgroup/: kernel_sunos5.c,
+ ucd-snmp/memory_solaris2.c:
+
+ Replace kc from memory_solaris2.c with kstat_fd, defined in kernel_sunos5.c.
+
+1999-12-15 09:56 mslifcak
+
+ * snmplib/: tools.c, tools.h:
+
+ Add time marker create, set, and delta time check methods.
+
+1999-12-15 09:42 mslifcak
+
+ * snmplib/: snmp_logging.c, snmp_logging.h:
+
+ Remove snmp_log_syslog, snmp_log_filelog, snmp_log_stderrlog;
+ Simplify snmp_log_string.
+
+1999-12-15 09:19 hardaker
+
+ * mibs/: Makefile.in, SNMPv2-M2M-MIB.txt,
+ SNMPv2-PARTY-MIB.txt:
+
+ - (SNMPv2-PARTY-MIB.txt SNMPv2-M2M-MIB.txt ): removed.
+
+1999-12-15 09:17 hardaker
+
+ * mibs/: EtherLike-MIB.txt, IPFILTER.txt,
+ UCD-IPFILTER-MIB.inc, UCD-IPFILTER-MIB.txt:
+
+ - (EtherLike-MIB.txt, IPFILTER.txt, UCD-IPFILTER-MIB.inc,
+ UCD-IPFILTER-MIB.txt): Patch from Juergen Schoenwaelder:
+ - Even more updates.
+
+1999-12-15 05:51 mslifcak
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Share kstat fd iff ucd-snmp/memory_solaris2 is also configured.
+
+1999-12-15 04:21 mslifcak
+
+ * apps/: snmp_parse_args.c, snmptranslate.c:
+
+ Isolate and retouch deprecated command line options.
+
+1999-12-14 16:05 hardaker
+
+ * agent/mibgroup/header_complex.c:
+
+ - (header_complex.c): get next in link list before deleting root.
+
+1999-12-14 16:05 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): move -lefence check up to front (last in link).
+
+1999-12-14 15:19 hardaker
+
+ * mibs/Makefile.in:
+
+ - (Makefile.in): DLMOD -> UCD-DLMOD
+
+1999-12-14 14:54 hardaker
+
+ * snmplib/keytools.c:
+
+ - (keytools.c): reverse generate_Ku optimizations, as they don't work.
+
+1999-12-14 08:41 hardaker
+
+ * mibs/: IANAifType-MIB.txt, UCD-SNMP-MIB.txt:
+
+ - (IANAifType-MIB.txt, UCD-SNMP-MIB.txt): Patch from Juergen Schoenwaelder:
+ - updates.
+
+1999-12-14 08:07 hardaker
+
+ * apps/snmp_parse_args.c, apps/snmptranslate.c,
+ apps/snmptrapd.c, snmplib/default_store.h,
+ snmplib/mib.c, snmplib/mib.h:
+
+ - (snmp_parse_args.c, snmptranslate.c, snmptrapd.c, default_store.h,
+ mib.c, mib.h):
+ - argument shuffling...
+ -I for input args created, and -OR moved there.
+ -Ib created.
+ -TB created for snmptranslate (was -B).
+
+1999-12-13 16:03 mslifcak
+
+ * snmplib/mib.c:
+
+ Allow sprint_variable to work even if no MIB files were read.
+
+1999-12-13 15:12 mslifcak
+
+ * snmplib/mib.c:
+
+ Finish symbol conversion with numeric when subtree is leaf node.
+
+1999-12-13 14:54 mslifcak
+
+ * snmplib/mib.c:
+
+ Fix problem printing IMPLIED indices of OBJECTID type.
+
+1999-12-13 14:20 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in): --with-efence implemented.
+ - (forced checking for --enable-developer and CVS checkouts)
+
+1999-12-13 13:54 mslifcak
+
+ * snmplib/mib.c:
+
+ Sanity checks added to _get_symbol.
+
+1999-12-13 12:04 mslifcak
+
+ * man/Makefile.in:
+
+ Clean also removes generated default_store.3.h .
+
+1999-12-13 09:57 hardaker
+
+ * mibs/: DLMOD-MIB.txt, UCD-DLMOD-MIB.inc,
+ UCD-DLMOD-MIB.txt:
+
+ - (DLMOD-MIB.txt, UCD-DLMOD-MIB.inc, UCD-DLMOD-MIB.txt):
+ - Juergens patch to move DLMOD-MIB -> UCD-DLMOD-MIB and -> SMIv2.
+ - moved to the experimental tree.
+
+1999-12-13 09:49 mslifcak
+
+ * agent/mibgroup/smux/: smux.c, smux.h:
+
+ Added patch from M.Michaud to use send_enterprise_trap_vars.
+
+1999-12-13 04:43 daves
+
+ * agent/: snmpd.c, mibgroup/smux/smux.c,
+ mibgroup/smux/smux.h:
+
+ - (agent/snmpd.c agent/mibgroup/smux/smux.[ch]):
+ - Patch to get SMUX support working with the new agent architecture.
+ This is probably not The Right Way To Do Things Now, but it works.
+ Thanks to Nick Amato and Mike Michaud.
+
+1999-12-13 03:18 daves
+
+ * agent/agent_trap.c:
+
+ - (agent_trap.c): allow specification of enterprise OID when sending traps
+
+1999-12-13 03:17 daves
+
+ * agent/agent_registry.c:
+
+ - (agent_registry.c): Handle delegated MIB regions properly when split.
+
+1999-12-10 13:03 mslifcak
+
+ * agent/mibgroup/mibII/ip.c:
+
+ Fix HP-UX problem with ipDefaultTTL.
+
+1999-12-10 10:44 marz
+
+ * snmplib/snmp_api.c:
+
+ (snmlib/snmp_api.c): fix bug in _sess_copy where pointers that were not owned by newly created session could get mistakenly freed if errors were encountered during session copy - also eliminate some redundant copying of security{Auth|Priv}Key data
+
+1999-12-10 10:23 mslifcak
+
+ * agent/: snmp_agent.c, mibgroup/agentx/subagent.c:
+
+ Apply Dave's patch to fix max varbinds testing on GETBULK.
+
+1999-12-10 07:28 mslifcak
+
+ * agent/Makefile.in:
+
+ Fix to build executable agent on HP-UX.
+
+1999-12-10 03:19 nba
+
+ * snmplib/system.c, win32/config.h,
+ win32/libagent/libagent.def, win32/libagent/libagent.dsp
+, win32/libsnmp_dll/libsnmp.def,
+ win32/libucdmibs/libucdmibs.def,
+ win32/libucdmibs/libucdmibs.dsp, win32/snmpd/snmpd.dsp:
+
+ - (various): changes to compile snmpd with VC++ 5.0 (Release mode)
+
+1999-12-10 03:10 nba
+
+ * snmplib/read_config.c:
+
+ - read_config.c: add some missing const specifiers
+
+1999-12-10 03:09 nba
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ - pass_persist.c: fix some buf/buf2 confusion
+
+1999-12-10 03:07 nba
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ - pass.c: fix some buf/buf2 confusion
+
+1999-12-10 03:06 nba
+
+ * agent/mibgroup/agentx/master.c:
+
+ - master.c: add a missing #include <netinet/in.h> (at least for Solaris).
+
+1999-12-09 17:09 hardaker
+
+ * agent/: Makefile.in, mibgroup/Makefile.in:
+
+ - (agent/*Makefile.in): fix for --enable-shared on hpux
+
+1999-12-09 16:53 hardaker
+
+ * apps/snmpnetstat/Makefile.in:
+
+ - (snmpnetstat/Makefile.in): fix for --enable-shared
+
+1999-12-09 16:16 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): changed all instances of kb to kB.
+
+1999-12-09 15:26 hardaker
+
+ * snmplib/keytools.c:
+
+ - (keytools.c): Patch from Leonard Gomelsky:
+ - generate_Ku() speed improvements.
+
+1999-12-09 10:08 hardaker
+
+ * Makefile.top, config.h.in, configure,
+ configure.in, agent/Makefile.in, snmplib/Makefile.in
+:
+
+ - (Makefile.top, config.h.in, configure, configure.in,
+ agent/Makefile.in, snmplib/Makefile.in):
+ - fixed --enable-shared (at least on linux).
+
+1999-12-09 08:14 mslifcak
+
+ * mibs/: DISMAN-SCRIPT-MIB.txt, UCD-DEMO-MIB.inc,
+ UCD-DEMO-MIB.txt, UCD-SNMP-MIB.inc, UCD-SNMP-MIB.txt
+:
+
+ Patches supplied by Juergen Schoenwaelder.
+
+1999-12-09 07:49 nba
+
+ * man/snmpcmd.1:
+
+ - snmpcmd.1: support MIB::label
+
+1999-12-09 07:34 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: implement MIB::label
+
+1999-12-09 07:34 daves
+
+ * man/snmp_trap_api.3:
+
+ - (man/snmp_trap_api.3): Initial documentation for agent trap generation.
+
+1999-12-08 17:13 hardaker
+
+ * acconfig.h, config.h.in,
+ agent/mibgroup/agentx/master.c, snmplib/read_config.c
+, snmplib/system.c, snmplib/system.h:
+
+ - (acconfig.h, config.h.in, master.c, read_config.c, system.c, system.h):
+ - implement mkdirhier() and use it for persistent storage and agentx
+ socket file creation.
+
+1999-12-08 15:49 hardaker
+
+ * makefileindepend.pl, makenosysdepend.pl, remove-files
+:
+
+ - (makefileindepend.pl, makenosysdepend.pl, remove-files):
+ - move the make depend perl scripts to the top level where they only
+ need to be edited once.
+
+1999-12-08 15:46 hardaker
+
+ * agent/Makefile.in, agent/dlmods/Makefile.in,
+ agent/mibgroup/Makefile.in, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in, snmplib/Makefile.in,
+ testing/Makefile.in:
+
+ - (*..Makefile.in): A real make depend with no ssl dependancies, etc.
+
+1999-12-08 15:29 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): move sys/param out of ifdef FD_SET.
+
+1999-12-08 15:28 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in, testing/Makefile.in:
+
+ - (*..Makefile.in): make depend.
+
+1999-12-08 15:26 hardaker
+
+ * README:
+
+ - (README): add Juergen.
+
+1999-12-08 15:23 hardaker
+
+ * snmplib/: mib.c, parse.c, parse.h:
+
+ - (mib.c, parse.c, parse.h):
+ - remembered IMPLIED indexes.
+ - properly print OIDs with length prefixes on parsed OIDs so
+ cutting/pasting of them works.
+ - properly print strings and oids that are IMPLIED.
+ - print strings in either ' or " quotes depending on if their IMPLIED.
+
+1999-12-08 15:04 mslifcak
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ Add missing dskPercentNode to DskEntry (thanks to
+ Michael Kirkham <support@iwl.com>).
+
+1999-12-08 15:01 mslifcak
+
+ * apps/snmpwalk.c:
+
+ Include getopt.h to define optarg.
+
+1999-12-08 14:41 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): fix -Os and index based oid printing to work again.
+
+1999-12-08 14:08 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): make mrIndex IMPLIED since it is in the code.
+
+1999-12-08 09:19 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): register a config token for suffix printing.
+
+1999-12-07 15:23 mslifcak
+
+ * agent/mibgroup/agentx/client.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ snmplib/snmpusm.c, snmplib/system.c:
+
+ Eliminate multiplying by sizeof(char) or sizeof(unsigned char);
+ agentx/client.c - snmp_free_varbind replaces free in four places;
+ snmpv3/usmUser.c - usm_free_user replaces free in one place.
+
+1999-12-07 13:54 hardaker
+
+ * man/snmpwalk.1:
+
+ - (snmpwalk.1): document -Ci and -Cp (badly).
+
+1999-12-07 13:45 hardaker
+
+ * apps/snmpwalk.c:
+
+ - (snmpwalk.c):
+ - New ability to peform a get on the requested OID when either no
+ results are returned or when the user requests an inclusive option.
+ - New ability to print number of variables found at the end.
+
+1999-12-07 09:32 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): Patch from Juergen Schoenwaelder:
+ - convert to SMIv2 and cleanup.
+
+1999-12-07 09:17 hardaker
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ - (sysORTable.c): make sysOrIndex not-accessible, as it should be.
+
+1999-12-07 09:14 hardaker
+
+ * agent/mibgroup/host/hr_other.c:
+
+ - (hr_other.c): shorten cpu description length.
+
+1999-12-07 08:29 daves
+
+ * agent/agent_read_config.c, agent/agent_read_config.h
+, agent/snmp_vars.c, agent/snmp_vars.h,
+ agent/snmpd.c, agent/snmpd.h, snmplib/read_config.c
+, snmplib/read_config.h, snmplib/snmp_api.c:
+
+ - (agent/agent_read_config.[ch] agent/snmp_vars.[ch] agent/snmpd.[ch]
+ snmplib/read_config.[ch] snmplib/snmp_api.c):
+ - Use the saved application name for registering config handlers
+ (N.B: This change will need to be applied to MIB modules as well)
+
+1999-12-07 08:03 mslifcak
+
+ * apps/: snmp_parse_args.c, snmpusm.c:
+
+ Use argv[0] since the app wont be snmpgetnext, probably.
+
+1999-12-06 16:31 mslifcak
+
+ * agent/agent_registry.c, apps/snmptable.c,
+ apps/snmpusm.c, win32/libsnmp_dll/libsnmp.def:
+
+ More fun updating MS VC build of apps and library.
+
+1999-12-06 15:11 nba
+
+ * snmplib/system.c, win32/config.h, win32/win32.dsw
+, win32/encode_keychange/encode_keychange.dsp,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/libsnmp.def
+, win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/snmpbulkget/snmpbulkget.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp,
+ win32/snmpdelta/snmpdelta.dsp, win32/snmpget/snmpget.dsp
+, win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpstatus/snmpstatus.dsp,
+ win32/snmptable/snmptable.dsp, win32/snmptest/snmptest.dsp
+, win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrapd/snmptrapd.dsp
+, win32/snmpusm/snmpusm.dsp, win32/snmpwalk/snmpwalk.dsp
+:
+
+ - system.c, config.h, win32.dsw, *.dsp, libsnmp.def: cleaning up for VC builds
+
+1999-12-06 15:09 mslifcak
+
+ * snmplib/: snmp_api.c, snmpusm.c, snmpusm.h:
+
+ Convert USM_ERR* to SNMPERR_USM*.
+
+1999-12-06 14:58 hardaker
+
+ * apps/snmpusm.c:
+
+ - (snmpusm.c): fix usage for new args.
+
+1999-12-06 14:56 hardaker
+
+ * testing/tests/: Sv3config, T030snmpv3usercreation:
+
+ - (Sv3config, T030snmpv3usercreation): make v3 testing work again.
+
+1999-12-06 14:48 hardaker
+
+ * apps/snmpusm.c:
+
+ - (snmpusm.c):
+ - make snmpusm usable again, changing arguments slightly.
+ - make it also use defaults for passphrases, user, etc.
+
+1999-12-06 14:32 nba
+
+ * win32/: bin/.cvsignore, lib/.cvsignore:
+
+ - .cvsignore: Make CVS silent about installation files
+
+1999-12-06 13:51 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): print error strings returned by generate_Ku().
+
+1999-12-06 13:47 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): default specifications for auth/priv types.
+
+1999-12-06 09:19 mslifcak
+
+ * snmplib/mib.c:
+
+ Show all non-printable subids in dump_oid_to_string.
+ Recurse clear_tree_flags only if necessary.
+
+1999-12-05 21:49 nba
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ - pass.c, pass_persist.c: ensure proper byte ordering when pass'ing
+ ipaddress.
+
+1999-12-03 16:52 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ - (vmstat.c): remove duplicate limits.h include.
+
+1999-12-03 16:52 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): use $(MAKE) instead of make.
+
+1999-12-03 16:51 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): switch to PIC from pic.
+
+1999-12-03 15:05 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: remember to NULL a freed pointer
+
+1999-12-03 15:04 nba
+
+ * apps/snmptrapd_handlers.c:
+
+ - snmptrapd_handlers.c: a little nicer error message
+
+1999-12-03 15:03 nba
+
+ * apps/snmptrapd.c:
+
+ - snmptrapd.c: correct handling of SIGHUP tp reconfigure.
+
+1999-12-02 16:59 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): turn on REGEX_EXTENDED.
+
+1999-12-02 09:21 mslifcak
+
+ * agent/Makefile.in:
+
+ Fix bug #81 - continue install after error creating persistent directory.
+
+1999-12-02 05:06 nba
+
+ * agent/mibgroup/snmpv3/usmUser.c, snmplib/snmpv3.c,
+ snmplib/snmpv3.h:
+
+ - usmUser.c snmpv3.[ch]: move usm_parse_create_usmUser from the agent
+ to the library, so that snmptrapd can use it.
+
+1999-12-02 04:42 nba
+
+ * apps/snmptrapd.c:
+
+ - snmptrapd.c: fix snmp_clone_pdu2 by using the snmplib version
+
+1999-12-02 04:41 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: accessing and freeeing env_var misplaces around NULL test
+
+1999-12-01 16:32 mslifcak
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ Use SNMP_MAXBUF when defining large static buffer storage.
+
+1999-12-01 15:55 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c:
+
+ Fix bug #112 and finish patch supplied by Anthony Shipman.
+
+1999-12-01 10:38 mslifcak
+
+ * snmplib/: mib.c, parse.c:
+
+ Prevent overflow of object ID in get_module_node.
+ In find_best_tree_node, treat result from recursed call same for match = 0.
+
+1999-12-01 06:40 mslifcak
+
+ * snmplib/parse.c:
+
+ Error check and free resources during regex processing.
+
+1999-11-30 16:50 mslifcak
+
+ * apps/snmptranslate.c, snmplib/mib.c, snmplib/mib.h
+, snmplib/parse.c:
+
+ Add multiple match capability to find_best_tree_node, and use it in
+ snmptranslate (new -B option).
+
+1999-11-30 14:47 mslifcak
+
+ * apps/snmptranslate.c:
+
+ Use Wes' cool new get_wild_node match method.
+
+1999-11-30 14:30 hardaker
+
+ * apps/snmp_parse_args.c, snmplib/mib.c,
+ snmplib/mib.h, snmplib/parse.c:
+
+ - (snmp_parse_args.c, mib.c, mib.h, parse.c): implement regex matching
+ everywhere.
+
+1999-11-30 13:11 mslifcak
+
+ * snmplib/system.c:
+
+ Include ctype.h
+
+1999-11-30 13:10 mslifcak
+
+ * apps/snmptranslate.c:
+
+ Fix -Td usage description; use switch when current_name is NULL.
+
+1999-11-30 07:08 daves
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (agentx/master_request.c): Fix handling of multi-variable requests to subagents.
+
+1999-11-30 07:07 daves
+
+ * agent/mibgroup/agentx/master.c:
+
+ - (agentx/master.c): Remove redundent routine.
+
+1999-11-30 03:01 nba
+
+ * snmplib/snmp_api.h, agent/mibgroup/mibII/snmp_mib.c
+, agent/mibgroup/mibII/snmp_mib.h:
+
+ - snmp_api.h, snmp_mib.[ch]: A couple additional SNMP statistics points
+
+1999-11-29 14:04 hardaker
+
+ * README:
+
+ - (README): another name.
+
+1999-11-29 14:03 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in):
+ - check for regex.h, regcomp, strcasestr.
+
+1999-11-29 14:02 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): make best matching (-b) use regex when available.
+
+1999-11-29 14:02 hardaker
+
+ * snmplib/: system.c, system.h:
+
+ - (system.c, system.h): implement strcasestr (from Michael Slifcak).
+
+1999-11-29 12:43 mslifcak
+
+ * apps/snmpbulkget.c:
+
+ Use size_t for name_len member.
+
+1999-11-29 11:58 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Free STREAM packet buffer when session is closed;
+ Test for close in progress for read, write, select, and timeout functions.
+
+1999-11-29 10:36 mslifcak
+
+ * apps/: snmptrap.c, snmpwalk.c, snmpnetstat/main.c
+:
+
+ Remove last vestiges of DEBUG_MALLOC_INC fragments.
+
+1999-11-29 10:33 mslifcak
+
+ * win32/snmpbulkget/snmpbulkget.dsp:
+
+ Fix reference to snmplib.
+
+1999-11-29 10:30 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Use ntohs macro to carefully obtain the default service port.
+
+1999-11-29 05:50 mslifcak
+
+ * apps/snmpbulkget.c, snmplib/asn1.c, snmplib/mib.c
+, snmplib/snmp_api.c:
+
+ More HP-UX aCC fixes supplied by Markku Laukkanen.
+
+1999-11-27 09:18 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - (vacm_vars.c): redo rwuser/rouser to allow specification of auth type.
+
+1999-11-27 06:31 marz
+
+ * agent/kernel.c, testing/eval_tools.sh:
+
+ (agent/kernel.c, testing/eval_tools.sh): fix -r switch to supress error messages about failed kernel and add -r to default testing code so 'make test can be run by user
+
+1999-11-26 11:18 nba
+
+ * snmplib/default_store.c:
+
+ - default_store.c: although read_config is case insensitive, ds_handle_config
+ was not. At the same time it failed to report the problem that
+ it was called but didn't know what to do.
+
+1999-11-25 14:57 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: kill yet another silly warning from gcc
+
+1999-11-25 14:56 nba
+
+ * snmplib/default_store.h, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, apps/snmp_parse_args.c:
+
+ - defaults_store.h, snmp_api.c, snmp_parse_args.c: add defCommunity
+ directive
+ - snmp_api.h, snmp_api.c: add errorcode for malloc failure
+
+1999-11-25 14:52 nba
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ - usmUser.c: new user is not added unless both auth and priv is specified
+ on createUser directive
+
+1999-11-25 14:33 nba
+
+ * agent/mibgroup/mibII/snmp_mib.h:
+
+ - snmp_mib.h: fix misalignment of statistics counters
+
+1999-11-25 14:32 nba
+
+ * snmplib/snmp_api.h, agent/agent_trap.c,
+ agent/snmp_agent.c, agent/mibgroup/mibII/snmp_mib.c:
+
+ - snmp_api.c, agent_trap.c, snmp_agent.c, snmp_mib.h, snmp_mib.c:
+ fix misalignment of statistics counters
+
+1999-11-24 11:07 mslifcak
+
+ * mibs/IPFWACC-MIB.txt:
+
+ Fix BUG#57 using 2/3 of patch supplied by zany@triq.net.
+
+1999-11-24 10:43 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - (vacm_vars.c): Patch from Frank Strauss:
+ - allow seperation of mask with both . and:.
+
+1999-11-24 09:16 hardaker
+
+ * INSTALL:
+
+ - (INSTALL): change editing of config.h note.
+
+1999-11-24 09:08 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/mibgroup/snmpv3/usmUser.c,
+ snmplib/keytools.c, snmplib/keytools.h,
+ snmplib/lcd_time.c, snmplib/scapi.h, snmplib/tools.c
+, testing/keymanagetest.c, testing/scapitest.c,
+ win32/config.h:
+
+ - (acconfig.h, config.h.in, configure, configure.in, usmUser.c,
+ keytools.c, keytools.h, lcd_time.c, scapi.h, tools.c,
+ keymanagetest.c, scapitest.c, config.h):
+ - force --enable-developer for CVS checkouts.
+ - remove all references to KMT.
+
+1999-11-24 09:03 daves
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - (agentx/master_admin.c): Release allocated indexes on subagent shutdown.
+
+1999-11-23 05:40 daves
+
+ * agent/: agent_registry.c, agent_registry.h:
+
+ - (agent_registry.[ch]):
+ - Make index registration API more immediately convenient
+ - Associate such registrations with the main session
+ - new routine to unregister all indexes for a given session
+ - differentiate between ANY index and NEW index
+ - clean up assorted compiler warnings
+
+1999-11-23 05:21 daves
+
+ * agent/: snmp_agent.c, mibgroup/agentx/subagent.c:
+
+ - (snmp_agent.c agentx/subagent.c):
+ Make main session structure visible throughout the agent,
+ and use this for AgentX subagent as well.
+
+1999-11-23 02:20 nba
+
+ * agent/snmp_agent.c:
+
+ - snmp_agent.c: #include <unistd.h> for select prototype
+
+1999-11-23 02:11 daves
+
+ * agent/mibgroup/host/: hr_storage.c, hr_swrun.c:
+
+ - (host/hr_storage.c host/hr_swrun.c): Guard against calculation overflow
+
+1999-11-23 01:37 daves
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ - (host/hr_swrun.c): Fix linux process memory usage figures.
+ (Reported by Mitch Shields)
+
+1999-11-23 01:26 nba
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ - pass_persist.c: fix some arguments (int => size_t). Thanks to
+ Anthony Shipman <ashipman@erggroup.com>
+
+1999-11-23 01:24 nba
+
+ * mibs/IPSEC-MIB.txt:
+
+ - IPSEC-MIB.txt: change some underlines into dashes, and repair the
+ ::= (maybe I should have looked at this file before adding it:-))
+
+1999-11-23 01:23 nba
+
+ * agent/mibgroup/mibII/ipv6.h:
+
+ - ipv6.h: remove an __P that had sneaked in
+
+1999-11-22 17:52 hardaker
+
+ * README.snmpv3:
+
+ - (README.snmpv3): update to reflect new and easier .conf mechanisms.
+
+1999-11-22 17:02 hardaker
+
+ * snmplib/scapi.c:
+
+ - (scapi.c): fix length check of key space.
+
+1999-11-22 16:50 hardaker
+
+ * agent/mibgroup/: mibII/vacm_vars.c, snmpv3/usmUser.c
+:
+
+ - (vacm_vars.c, usmUser.c): new config tokens allowing easy user and
+ vacm/user configuration and setup.
+
+1999-11-22 16:48 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): remove creation of initial and template* users.
+
+1999-11-22 13:04 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/mibgroup/mibII/tcp.c:
+
+ - (acconfig.h, config.h.in, configure, configure.in, tcp.c): Patch
+ from Garrett Wollman:
+ - FreeBSD 4.x fixes.
+
+1999-11-22 12:53 nba
+
+ * agent/agent_read_config.c, agent/agent_read_config.h
+, agent/agent_registry.h, agent/agent_trap.c,
+ agent/agent_trap.h, agent/snmp_vars.c,
+ agent/mibgroup/mibincl.h, agent/mibgroup/mibII/system_mib.c
+, agent/mibgroup/mibII/system_mib.h,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h, agent/mibgroup/smux/smux.c
+, agent/mibgroup/smux/smux.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.h,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/disk.h,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/file.h,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/loadave.h,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.h,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass.h,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proc.h, apps/snmptable.c,
+ apps/snmptrapd_handlers.c, apps/snmptrapd_handlers.h,
+ snmplib/default_store.c, snmplib/mib.c,
+ snmplib/read_config.c, snmplib/read_config.h,
+ snmplib/snmp_debug.c, snmplib/snmpusm.c,
+ snmplib/snmpusm.h, snmplib/snmpv3.c, snmplib/snmpv3.h
+:
+
+ - *: change the first argument of the config parser functions to a
+ const string
+
+1999-11-22 12:49 hardaker
+
+ * agent/mibgroup/: mibII/vacm_vars.c, ucd-snmp/pass.c
+:
+
+ - (vacm_vars.c, pass.c): fix oid -> char conversions.
+
+1999-11-22 12:30 hardaker
+
+ * agent/mibgroup/ucd-snmp/: vmstat.c, vmstat_freebsd2.c
+:
+
+ - (vmstat.c, vmstat_freebsd2.c): use header_generic not header_simple_table
+
+1999-11-22 09:24 hardaker
+
+ * testing/tests/: T016snmpv2cgetfail, T017snmpv2ctov1getfail
+:
+
+ - (T016snmpv2cgetfail, T017snmpv2ctov1getfail): update tests for new
+ error messages.
+
+1999-11-22 09:17 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/host_res.h, agent/mibgroup/host/hr_filesys.c
+, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c:
+
+ - (configure, configure.in, host_res.h, hr_filesys.c, hr_storage.c,
+ hr_swrun.c, hr_system.c, bsdi4.h): Patch from Bert Driehuis:
+ - bsdi support for the host resources mib.
+
+1999-11-22 09:07 hardaker
+
+ * README:
+
+ - (README): added more people to the thanks list.
+
+1999-11-22 09:00 hardaker
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ - (usmUser.c): fix oid -> char conversions pointed out by Michael Slifcak.
+
+1999-11-22 08:29 hardaker
+
+ * apps/snmptable.c:
+
+ - (snmptable.c): Patch from Robert Story:
+ - Added ability to use MIB to query tables with non-sequential column OIDs.
+ - Added code to handle sparse tables.
+
+1999-11-22 08:21 mslifcak
+
+ * win32/libagent/.cvsignore:
+
+ Add CVS ignore list for win32/libagent.
+
+1999-11-22 08:20 mslifcak
+
+ * win32/libagent/libagent.dsp:
+
+ Retry add MSVC++ project file.
+
+1999-11-22 07:30 daves
+
+ * agent/: agent_registry.c, agent_registry.h,
+ mibgroup/agentx/client.c, mibgroup/agentx/client.h,
+ mibgroup/agentx/master_admin.c:
+
+ - (agent_registry.[ch] agentx/client.[ch] agentx/master_admin.c):
+ Index de-allocation, and AgentX index support.
+
+1999-11-22 07:16 nba
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ - ipv6.c: some more ANSI prototypes
+
+1999-11-22 06:59 nba
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ - ipv6.c: upgrade to the current Kame patch
+
+1999-11-22 05:32 nba
+
+ * mibs/IPV6-TCP-MIB.txt, mibs/IPV6-UDP-MIB.txt,
+ agent/mibgroup/mibII/ipv6.c, agent/mibgroup/mibII/tcp.c
+:
+
+ - IPV6-TCP-MIB, IPV6-UDP-MIB, ipv6.c, tcp.c: move the IPv6 tcp and udp
+ tables to their proper position in the tree, according to the RFC.
+
+1999-11-22 05:29 nba
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ - pass.c: remove a const casting warning
+
+1999-11-22 05:28 nba
+
+ * agent/snmpd.c:
+
+ - snmpd.c: reinstate snmpd -a functionality
+
+1999-11-22 05:28 nba
+
+ * snmplib/snmp_logging.c:
+
+ snmp_logging.c: only timestamp efter a newline
+
+1999-11-22 05:27 nba
+
+ * configure.in, config.h.in, configure:
+
+ - configure.in: configure test for netinet/ip.h
+
+1999-11-19 15:23 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, sedscript.in,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/disk.h, mibs/UCD-SNMP-MIB.txt:
+
+ - (acconfig.h, config.h.in, configure, configure.in, sedscript.in,
+ disk.c, disk.h, UCD-SNMP-MIB.txt): Patch from Andy HOOD:
+ - monitor disk inode percentages.
+
+1999-11-19 14:20 hardaker
+
+ * agent/snmp_vars.c, agent/snmpd.c,
+ snmplib/snmp_alarm.h, snmplib/snmp_api.c:
+
+ - (snmp_vars.c, snmpd.c, snmp_alarm.h, snmp_api.c):
+ - make snmp_select_info possibly handle alarm timers.
+ - make snmpd use them and call snmp_run_alarms().
+
+1999-11-19 13:47 hardaker
+
+ * local/mib2c.storage.conf:
+
+ - (mib2c.storage.conf): fix mib2c.storage.conf.
+
+1999-11-19 11:06 daves
+
+ * agent/agent_registry.h:
+
+ - (agent/agent_registry.h): Provide missing index allocation defines.
+
+1999-11-18 18:20 mslifcak
+
+ * win32/: mib_module_config.h, mib_module_dot_conf.h,
+ mib_module_includes.h, mib_module_inits.h,
+ mib_module_shutdown.h, libucdmibs/.cvsignore,
+ libucdmibs/libucdmibs.dsp, snmpd/.cvsignore,
+ snmpd/snmpd.dsp:
+
+ More MSVC++ Win32 agent files, gratis Robert Story.
+
+1999-11-18 18:14 mslifcak
+
+ * win32/: config.h, win32.dsw:
+
+ More touchup per MSVC++ Win32 agent work.
+
+1999-11-18 17:57 mslifcak
+
+ * config.h.in, configure, configure.in,
+ agent/agent_read_config.c, agent/agent_registry.c,
+ agent/agent_trap.c, agent/kernel.c,
+ agent/mib_modules.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c,
+ agent/mibgroup/mibincl.h, agent/mibgroup/util_funcs.c
+, agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/vacm_vars.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass.h,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/pass_persist.h,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c, apps/snmpbulkget.c
+:
+
+ Check-in agent changes to support Win32 agent built with MSVC++.
+ Thanks to Robert Story.
+
+1999-11-17 21:51 nba
+
+ * snmplib/default_store.c:
+
+ - default_store.c: ds_toggle_boolean missed a mask
+
+1999-11-17 13:09 hardaker
+
+ * local/mib2c.storage.conf:
+
+ - (mib2c.storage.conf): update. Deals with RowStatus objects better.
+
+1999-11-17 13:08 hardaker
+
+ * configure:
+
+ - (configure): update.
+
+1999-11-17 13:05 hardaker
+
+ * configure.in:
+
+ - (configure.in): update the so LD for linux to $(CC).
+
+1999-11-17 11:55 hardaker
+
+ * agent/ds_agent.h, agent/kernel.c, agent/snmpd.c
+, man/snmpd.1.def:
+
+ - (ds_agent.h, kernel.c, snmpd.c, snmpd.1.def):
+ - run time rootless running support for snmpd, by reqest of Joe. (-r)
+
+1999-11-17 07:36 mslifcak
+
+ * win32/win32.dsw:
+
+ Add snmpbulkget to list of apps to build.
+
+1999-11-17 07:35 mslifcak
+
+ * win32/snmpbulkget/: .cvsignore, snmpbulkget.dsp:
+
+ Project file for building snmpbulkget using MSVC++ gratis Robert Story.
+
+1999-11-17 05:59 mslifcak
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ Replace u_int16_t with more universally supported u_short.
+
+1999-11-16 14:56 mslifcak
+
+ * win32/snmptrapd/snmptrapd.dsp:
+
+ Build with getopt.
+
+1999-11-16 14:40 mslifcak
+
+ * apps/snmptranslate.c, snmplib/asn1.c,
+ snmplib/snmp_api.c, win32/win32.dsw,
+ win32/encode_keychange/encode_keychange.dsp,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/libsnmp.def
+, win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp,
+ win32/snmpdelta/snmpdelta.dsp, win32/snmpget/snmpget.dsp
+, win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpset/snmpset.dsp, win32/snmpstatus/snmpstatus.dsp
+, win32/snmptable/snmptable.dsp,
+ win32/snmptest/snmptest.dsp,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptrap/snmptrap.dsp, win32/snmpusm/snmpusm.dsp,
+ win32/snmpwalk/snmpwalk.dsp:
+
+ MSVC touchups:
+ Added snmptrapd project .DSP file; All .DS[PW] files CR-LF line terminated;
+ Fix warnings in asn1.c and snmp_api.c; Remove unused var in snmptranslate.c.
+
+1999-11-16 10:26 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): add the T: flag for -T to getopt
+
+1999-11-16 10:24 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - (protocol.c): add the header length to the packet length estimate.
+
+1999-11-16 09:13 daves
+
+ * snmplib/asn1.c:
+
+ - (snmplib/asn1.c): Fix encoding of root OIDs.
+
+1999-11-16 08:48 mslifcak
+
+ * config.guess:
+
+ Embrace all HP-9000/6xx,7xx, 8xx series platforms, without regrets.
+
+1999-11-16 06:21 nba
+
+ * apps/snmp_parse_args.c, apps/snmptranslate.c,
+ snmplib/default_store.h, snmplib/mib.c,
+ snmplib/snmp_api.h:
+
+ - snmp_parse_args.c, snmptranslate.c, mib.c: redo the snmptranslate options
+ to follow the common option set. Issue warnings when someone
+ uses the old form, advising about the new.
+
+1999-11-16 03:36 mslifcak
+
+ * snmplib/snmp.h:
+
+ Fix spelling misteak.
+
+1999-11-15 21:57 mslifcak
+
+ * snmplib/asn1.h:
+
+ Fix bug#75: build --without-opaque-types
+
+1999-11-15 17:40 hardaker
+
+ * agent/snmp_agent.c, agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/protocol.h,
+ agent/mibgroup/agentx/subagent.c, snmplib/snmp_api.c
+, snmplib/snmp_api.h:
+
+ - (snmp_agent.c, master.c, protocol.c, protocol.h, subagent.c,
+ snmp_api.c, snmp_api.h):
+ - make TCP support better for agentx. Still has a problem (I broke agentx).
+
+1999-11-15 16:43 mslifcak
+
+ * agent/snmp_agent.c:
+
+ Don't add NULL varbind when ENDOFMIBVIEW is reached.
+
+1999-11-15 15:41 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c, snmp_api.h):
+ - move more options to the ds_* routines.
+ - implement support for TCP broken SNMP packets by storing buffers
+ and dealing with pieces of incoming data till we have a full packet.
+
+1999-11-15 15:38 hardaker
+
+ * snmplib/: default_store.h, mib.c:
+
+ - (default_store.h, mib.c): move more options to the ds_* routines.
+
+1999-11-15 15:35 hardaker
+
+ * apps/: snmpdelta.c, snmptable.c, snmptest.c,
+ snmptranslate.c, snmptrapd.c, snmpnetstat/main.c
+:
+
+ - (snmpdelta.c, snmptable.c, snmptest.c, snmptranslate.c, snmptrapd.c):
+ - add default_store.h
+
+1999-11-15 15:22 hardaker
+
+ * snmplib/: asn1.c, asn1.h:
+
+ - (asn1.c, asn1.h): new function: asn_check_packet().
+
+1999-11-15 15:21 hardaker
+
+ * local/mib2c.storage.conf:
+
+ - (mib2c.storage.conf): debugging statements inserted.
+
+1999-11-15 15:21 hardaker
+
+ * man/snmp_agent_api.3:
+
+ - (snmp_agent_api.3): don't call subagent_pre_init().
+
+1999-11-15 15:21 hardaker
+
+ * local/: mib2c, tkmib:
+
+ - (mib2c, tkmib): remove -w.
+
+1999-11-15 15:20 hardaker
+
+ * agent/mibgroup/header_complex.c:
+
+ - (header_complex.c): set to '\0' instead of NULL for -Wall.
+
+1999-11-15 15:19 hardaker
+
+ * TODO:
+
+ - (TODO): memory int -> uint.
+
+1999-11-15 15:19 hardaker
+
+ * agent/: mib_modules.c, snmp_vars.c:
+
+ - (mib_modules.c, snmp_vars.c): move subagent_pre_init() to init_agent().
+
+1999-11-15 15:18 hardaker
+
+ * FAQ, README:
+
+ - (FAQ, README): new mirror in Australia.
+
+1999-11-15 14:09 nba
+
+ * .cvsignore, apps/.cvsignore:
+
+ - .cvsignore: updates to keep cvs silent about generated files.
+
+1999-11-15 14:05 nba
+
+ * snmplib/parse.c:
+
+ - parse.c: fix a spelling error in the MIB replacement table.
+
+1999-11-15 14:03 nba
+
+ * mibs/: Makefile.in, RFC1271-MIB.txt, RMON-MIB.txt
+:
+
+ - mibs/: replace RFC1271-MIN.txt with RMON-MIB.txt (RFC 1757 version)
+
+1999-11-15 14:00 nba
+
+ * apps/: snmp_parse_args.c, snmpbulkget.c:
+
+ - snmp_parse_args.c: further error checking, courtesy mslifcak
+ snmpbulkget.c: needs #include <getopt.h> (Thanks to Robert Story)
+
+1999-11-15 08:29 mslifcak
+
+ * man/mib_api.3:
+
+ Fix description of read_objid return value.
+
+1999-11-15 07:56 daves
+
+ * agent/snmp_vars.c:
+
+ - (agent/snmp_vars.c): Fix handling of failed GET/SET requests
+
+1999-11-14 06:32 nba
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, maketarget,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ipv6.c, agent/mibgroup/mibII/ipv6.h
+, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcp.h, agent/mibgroup/mibII/var_route.h
+, apps/snmpnetstat/Makefile.in,
+ apps/snmpnetstat/inet6.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/netstat.h, mibs/IPSEC-MIB.txt,
+ mibs/IPV6-ICMP-MIB.txt, mibs/IPV6-MIB.txt,
+ mibs/IPV6-TC.txt, mibs/IPV6-TCP-MIB.txt,
+ mibs/IPV6-UDP-MIB.txt, mibs/Makefile.in:
+
+ - ipc6: Add the IPv6 code from the Kame project. I have only massaged
+ it so much as to still compile on non-IPv6 systems, and detect
+ Linux, INRIA, Solaris IPv6. No code for them yet. Original
+ author: itojun@iijlab.net
+
+1999-11-14 06:15 nba
+
+ * man/snmptrapd.8:
+
+ - snmptrapd.8: add the new common -O option set
+
+1999-11-14 06:12 nba
+
+ * apps/snmptrapd.c:
+
+ - snmptrapd.c: add the new common -O option set
+
+1999-11-14 02:42 nba
+
+ * mibs/SNMPv2-CONF.txt:
+
+ - SNMPv2-CONF.txt: comment out the IMPORT clause
+
+1999-11-14 02:04 nba
+
+ * apps/snmptranslate.c, snmplib/mib.c:
+
+ - mib.c, snmptranslate.c: move the MIB:id handling inside read_objid for
+ consistency. Also fixes a buffer overrun in mib.c
+
+1999-11-14 02:01 nba
+
+ * agent/mibgroup/ucd-snmp/pass.c, man/snmpd.conf.5.def
+:
+
+ - pass.c, snmpd.conf.5.def: add an UNSIGNED return type
+
+1999-11-14 02:00 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - vacm_vars.c: kill a warning
+
+1999-11-14 01:59 nba
+
+ * agent/mibgroup/mibII/vacm_vars.h, mibs/Makefile.in,
+ mibs/SNMP-COMMUNITY-MIB.txt, mibs/SNMP-FRAMEWORK-MIB.txt
+, mibs/SNMP-MPD-MIB.txt, mibs/SNMP-NOTIFICATION-MIB.txt
+, mibs/SNMP-PROXY-MIB.txt, mibs/SNMP-TARGET-MIB.txt
+, mibs/SNMP-USER-BASED-SM-MIB.txt,
+ mibs/SNMP-VIEW-BASED-ACM-MIB.txt, mibs/SNMPv2-CONF.txt,
+ mibs/SNMPv2-SMI.txt, mibs/SNMPv2-TC.txt:
+
+ - mibs/*, vacm_vars.h: update the mib files to rfc 2571-2575. Also add
+ SNMP_COMMUNITY_MIB from the coex draft.
+
+1999-11-14 01:54 nba
+
+ * apps/: snmp_parse_args.c, snmp_parse_args.h:
+
+ - snmp_parse_args: changes to support multi-valued options
+
+1999-11-14 01:53 nba
+
+ * apps/Makefile.in, apps/snmpbulkget.c,
+ man/snmpbulkget.1, man/Makefile.in:
+
+ - snmpbulkget: new tool to issue a single GETBULK request
+
+1999-11-14 01:51 nba
+
+ * man/snmptable.1:
+
+ - snmptable: add in the application specific snmptable options between
+ the normal options.
+
+1999-11-14 01:48 nba
+
+ * apps/snmptable.c:
+
+ - snmptable, snmp_parse_args: allow the application specific options to
+
+1999-11-12 13:01 marz
+
+ * snmplib/: lcd_time.c, lcd_time.h, snmpusm.c:
+
+ (lcd_time.[ch], snmpusm.c): fix enginetime update algorithm to conform to spec rfc2574 3.2.7.b.1
+
+1999-11-12 08:46 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Provide a unique ID for all incoming PDUs
+
+1999-11-11 22:49 nba
+
+ * apps/snmp_parse_args.c, snmplib/mib.c:
+
+ - snmp_parse_args.c, mib.c: alignment of option code.
+ Some enhancements to the snmptranslate -d output.
+
+1999-11-11 22:14 nba
+
+ * man/snmpcmd.1:
+
+ - snmpcmd.1: update man page to correspond to the new getopt situation
+ Note: even though some options have been removed from this
+ page, they still work!
+
+1999-11-11 03:37 daves
+
+ * agent/mibgroup/agentx/client.c:
+
+ - (agentx/client.c): Silly typo in start time synchronisation
+
+1999-11-10 22:10 nba
+
+ * win32/: .cvsignore, encode_keychange/.cvsignore,
+ libsnmp/.cvsignore, libsnmp/libsnmp.plg,
+ libsnmp_dll/.cvsignore, libsnmp_dll/libsnmp_dll.plg,
+ snmpbulkwalk/.cvsignore, snmpbulkwalk/snmpbulkwalk.plg,
+ snmpdelta/.cvsignore, snmpdelta/snmpdelta.plg,
+ snmpget/.cvsignore, snmpget/snmpget.plg,
+ snmpgetnext/.cvsignore, snmpgetnext/snmpgetnext.plg,
+ snmpnetstat/.cvsignore, snmpset/.cvsignore,
+ snmpset/snmpset.plg, snmpstatus/.cvsignore,
+ snmpstatus/snmpstatus.plg, snmptable/.cvsignore,
+ snmptest/.cvsignore, snmptest/snmptest.plg,
+ snmptranslate/.cvsignore, snmptranslate/snmptranslate.plg
+, snmptrap/.cvsignore, snmptrap/snmptrap.plg,
+ snmptrapd/.cvsignore, snmpusm/.cvsignore,
+ snmpwalk/.cvsignore, snmpwalk/snmpwalk.plg:
+
+ - win32/*: clean up repository files, and add proper .cvsignore files
+
+1999-11-10 15:29 nba
+
+ * apps/snmp_parse_args.c, apps/snmp_parse_args.h,
+ apps/snmpbulkwalk.c, apps/snmpdelta.c, apps/snmpget.c
+, apps/snmpgetnext.c, apps/snmpset.c,
+ apps/snmpstatus.c, apps/snmptable.c, apps/snmptest.c
+, apps/snmptrap.c, apps/snmpusm.c,
+ apps/snmpwalk.c, win32/snmpget/snmpget.plg,
+ win32/snmpusm/snmpusm.dsp:
+
+ - apps/*: changes for getopt usage, and reworking of snmp_parse_args
+
+1999-11-10 12:20 nba
+
+ * win32/: win32.dsw, encode_keychange/encode_keychange.dsp
+, libsnmp_dll/libsnmp.def,
+ snmpbulkwalk/snmpbulkwalk.dsp, snmpdelta/snmpdelta.dsp,
+ snmpgetnext/snmpgetnext.dsp, snmpstatus/snmpstatus.dsp,
+ snmptest/snmptest.dsp, snmptrapd/snmptrapd.dsp,
+ snmpusm/snmpusm.dsp, snmpwalk/snmpwalk.dsp:
+
+ - win32/*.dsp: yet another round of making this crap work
+
+1999-11-10 08:59 daves
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - (agentx/subagent.c): Fix AgentX notify support
+
+1999-11-10 08:58 daves
+
+ * agent/: agent_trap.c, agent_trap.h:
+
+ - (agent/agent_trap.[ch]): minor re-structure to allow subagent trap "sinks"
+
+1999-11-10 08:57 daves
+
+ * agent/agent_read_config.c:
+
+ - (agent/agent_read_config.c): Only set up trap sinks on the master agent
+
+1999-11-10 08:31 nba
+
+ * win32/: libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp_dll.dsp
+, snmpget/snmpget.dsp, snmpset/snmpset.dsp,
+ snmpstatus/snmpstatus.dsp, snmptable/snmptable.dsp,
+ snmptranslate/snmptranslate.dsp, snmptrap/snmptrap.dsp,
+ snmptrapd/snmptrapd.dsp:
+
+ - win32/*: VC++ project updates
+
+1999-11-10 08:30 nba
+
+ * win32/: libsnmp/libsnmp.plg, libsnmp_dll/libsnmp.def
+, snmpget/snmpget.plg, snmptrap/snmptrap.dsp,
+ snmptrap/snmptrap.plg:
+
+ - win32/*: fixes to the VC++ build projects
+
+1999-11-09 23:30 nba
+
+ * snmplib/getopt.h:
+
+ - getopt.h: arguments to getopt did not match those in getopt.c
+
+1999-11-09 22:20 nba
+
+ * apps/snmp_parse_args.c:
+
+ . snmp_parse_args.c: a glitch in the conversion to getopt (thanks to
+ driehuis@playbeing.org)
+
+1999-11-09 15:15 nba
+
+ * apps/snmp_parse_args.c, apps/snmpget.c,
+ apps/snmpset.c, apps/snmptable.c,
+ apps/snmptranslate.c, apps/snmptrapd.c,
+ apps/snmpnetstat/main.c, snmplib/getopt.c,
+ snmplib/getopt.h, snmplib/mib.c, snmplib/mib.h
+, snmplib/system.c, snmplib/system.h,
+ win32/win32.dsw, win32/win32.opt,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp/libsnmp.plg,
+ win32/libsnmp_dll/libsnmp_dll.dsp, win32/snmpget/snmpget.plg
+, win32/snmpstatus/snmpstatus.dsp,
+ win32/snmptable/snmptable.dsp,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptranslate/snmptranslate.plg,
+ win32/snmptrap/snmptrap.dsp, win32/snmptrap/snmptrap.plg
+:
+
+ - various: adapt tools to use getopt (and put one in for Win32)
+
+1999-11-09 13:09 hardaker
+
+ * mibs/Makefile.in:
+
+ - (Makefile.in): install the DEMO-MIB.
+
+1999-11-09 13:09 hardaker
+
+ * agent/mibgroup/mibII/: vacm_vars.c, vacm_vars.h:
+
+ - (vacm_vars.c, vacm_vars.h): simple new .conf tokens: rocommunity, rwcommity.
+
+1999-11-09 13:02 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ - (ucd_snmp.h): require the DEMO-MIB (just for tutorial purposes).
+
+1999-11-09 13:02 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): fix -H.
+
+1999-11-09 12:59 nba
+
+ * win32/snmptrapd/snmptrapd.dsp, apps/snmptrapd.c,
+ apps/snmptrapd_handlers.c:
+
+ - snmptrapd.c,snmptrapd_handlers.c: make it compile with VC++ 5.0
+ (but no handlers (yet))
+
+1999-11-09 01:50 nba
+
+ * snmplib/: default_store.h, mib.c, parse.c,
+ parse.h:
+
+ - mib.c,parse.c: make error reporting in parser work according to spec (-Pe)
+ show defining modules in snmptranslate -d
+ use ds_toggle_boolean
+
+1999-11-05 06:22 mslifcak
+
+ * agent/mibgroup/header_complex.c, apps/encode_keychange.c
+, snmplib/callback.c, snmplib/lcd_time.c,
+ snmplib/parse.c, snmplib/snmp_api.c,
+ snmplib/snmpusm.c, snmplib/tools.c, snmplib/tools.h
+:
+
+ Say goodbye to SNMP_MALLOC, malloc_zero, xcalloc, xmalloc, and xstrdup.
+ Respectively replaced with calloc, calloc, calloc, malloc, and strdup.
+
+1999-11-04 13:43 mslifcak
+
+ * snmplib/mib.c:
+
+ Speed up sprint_variable: halve the number of calls to get_symbol.
+
+1999-11-04 10:28 hardaker
+
+ * apps/snmp_parse_args.c, man/snmpcmd.1:
+
+ - (snmp_parse_args.c, snmpcmd.1): move -q flags to -O.
+
+1999-11-04 10:19 mslifcak
+
+ * acconfig.h, config.h.in,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/mibII/interfaces.c, win32/config.h:
+
+ Redo FreeBSD 4.0: define freebsd3 in s/freebsd4.h; reduce "define" thrashing.
+
+1999-11-04 10:04 hardaker
+
+ * local/mib2c.conf:
+
+ - (mib2c.conf): include headers for compilation for both internal and
+ external to the ucd-snmp source.
+
+1999-11-04 10:03 hardaker
+
+ * Makefile.in, acconfig.h, config.h.in,
+ configure, configure.in, snmplib/mib.c:
+
+ - (Makefile.in, acconfig.h, config.h.in, configure, configure.in, mib.c):
+ - define IN_UCD_SNMP_SOURCE in config.h but not in ucd-snmp-config.h.
+ - move ucd-snmp-config.h up in the build order before subdirs.
+ - Make default MIBDIRS search path include $HOME/.snmp/mibs.
+ - Make MIBDIRS parsing handle $HOME variables in it.
+
+1999-11-04 05:12 mslifcak
+
+ * acconfig.h, config.h.in,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/ucd-snmp/disk.c
+, agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/loadave.c, snmplib/vacm.c:
+
+ First pass support for FreeBSD 4.0 [problems with proc table lookups].
+
+1999-11-04 04:33 mslifcak
+
+ * AGENT.txt:
+
+ Change example away from STDC_HEADERS.
+
+1999-11-04 04:14 mslifcak
+
+ * agent/: agent_registry.c, snmp_vars.c,
+ mibgroup/host/hr_filesys.c, mibgroup/host/hr_utils.c,
+ mibgroup/mibII/at.c, mibgroup/mibII/icmp.c,
+ mibgroup/mibII/interfaces.c, mibgroup/mibII/ip.c,
+ mibgroup/mibII/route_write.c, mibgroup/mibII/tcp.c,
+ mibgroup/mibII/udp.c, mibgroup/misc/dlmod.c,
+ mibgroup/ucd-snmp/disk.c, mibgroup/ucd-snmp/errormib.c
+, mibgroup/ucd-snmp/extensible.c,
+ mibgroup/ucd-snmp/loadave.c, mibgroup/ucd-snmp/memory.c
+, mibgroup/ucd-snmp/memory_solaris2.c,
+ mibgroup/ucd-snmp/registry.c:
+
+ More STDC_HEADERS cleanup: use HAVE_STRING_H, HAVE_STDLIB_H instead.
+
+1999-11-04 02:42 mslifcak
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ Patch to build BSD/OS 4.0.1; from Bert Driehuis -- driehuis@playbeing.org
+
+1999-11-03 13:20 mslifcak
+
+ * agent/mibgroup/host/hr_system.c:
+
+ Fix build problem on Linux RedHat 6.0: key off GNU_LIBRARY value.
+
+1999-11-03 13:18 mslifcak
+
+ * agent/mibgroup/: util_funcs.c, ucd-snmp/extensible.c
+, ucd-snmp/memory.c, ucd-snmp/memory_freebsd2.c
+, ucd-snmp/pass.c, ucd-snmp/proc.c,
+ ucd-snmp/proc.h:
+
+ Following call to fdopen (near get_exec_output), do not close(fd).
+
+1999-11-03 06:49 mslifcak
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ Near line 663: close(fd) before invoking wait_on_exec
+
+1999-11-03 06:11 mslifcak
+
+ * snmplib/parse.c, snmplib/parse.h,
+ win32/libsnmp_dll/libsnmp.def:
+
+ declare find_best_tree_node for MSVC build.
+
+1999-11-02 15:46 mslifcak
+
+ * man/Makefile.in:
+
+ Install snmp_agent_api.3
+
+1999-11-02 15:36 mslifcak
+
+ * config.h.in, configure, configure.in,
+ agent/mibgroup/mibII/route_write.c, snmplib/read_config.c
+, snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_debug.c, snmplib/snmp_debug.h,
+ snmplib/snmp_logging.c, snmplib/snmp_logging.h,
+ snmplib/system.h, win32/config.h:
+
+ Use HAVE_STDARG_H when deciding to use varargs vs ANSI-C prototypes.
+
+1999-11-02 09:57 hardaker
+
+ * snmplib/Makefile.in:
+
+ - (Makefile.in): install other header files needed by SNMP.pm.
+
+1999-11-01 13:17 hardaker
+
+ * apps/snmp_parse_args.c, snmplib/default_store.h,
+ snmplib/mib.c, snmplib/snmp_alarm.c:
+
+ - (snmp_parse_args.c, default_store.h, mib.c, snmp_alarm.c):
+ - don't break oids into pieces if quick_print is turned on.
+ - ditto if the new default_store option is turned on.
+ - made a default_store option to not use sigalrm for snmp_alarms.
+
+1999-10-29 19:54 marz
+
+ * apps/snmp_parse_args.c, snmplib/snmpv3.c:
+
+ (apps/snmp_parse_args.c, snmplib/snmpv3.c): make engineID setup conditional on app type to prevent apps from easily ending up with the same engineID as agent on same host
+
+1999-10-29 16:58 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): make it do snmpv3. Added many things to the options menu.
+
+1999-10-29 10:15 hardaker
+
+ * man/.cvsignore:
+
+ - (.cvsignore): ignore default_store.3{,.h}
+
+1999-10-29 10:15 hardaker
+
+ * man/: default_store.3, default_store.3.h:
+
+ -(default_store.3{,.h}): removed from CVS since they are built
+
+1999-10-29 10:13 hardaker
+
+ * man/snmpcmd.1:
+
+ - (snmpcmd.1): document -T and -q[oe]
+
+1999-10-29 10:05 hardaker
+
+ * agent/ds_agent.h, agent/snmp_agent.c, agent/snmpd.c
+, apps/snmp_parse_args.c:
+
+ - (ds_agent.h, snmp_agent.c, snmpd.c, snmp_parse_args.c):
+ - snmp over TCP options: -T TCP.
+ - new quick print options: -qo -qe for numeric oids and enums.
+
+1999-10-29 09:52 hardaker
+
+ * snmplib/: default_store.h, mib.c:
+
+ - (default_store.h, mib.c): two new printing options:
+ - printNumericOids
+ - printNumericEnums
+
+1999-10-29 09:28 hardaker
+
+ * agent/ucd-snmp-agent-includes.h:
+
+ - (ucd-snmp-agent-includes.h): added var_struct.h and agent_read_config.h
+
+1999-10-29 09:28 hardaker
+
+ * FAQ:
+
+ - (FAQ): added reference to an above question for perl installation.
+
+1999-10-29 08:58 hardaker
+
+ * local/: mib2c.conf, mib2c.vartypes.conf:
+
+ - (mib2c.conf, mib2c.vartypes.conf): Patch from Keith Tuson:
+ - misc fixes.
+
+1999-10-28 06:49 mslifcak
+
+ * snmplib/mib.c:
+
+ rephrase subtree not found code in _get_symbol.
+
+1999-10-28 05:25 mslifcak
+
+ * acconfig.h:
+
+ Oops! restore version r1.131.
+
+1999-10-28 05:23 mslifcak
+
+ * acconfig.h, win32/config.h:
+
+ u_int8/16/32_t types no longer needed for WIN32 builds.
+
+1999-10-28 04:55 mslifcak
+
+ * agent/snmp_agent.c:
+
+ Dave's comment about pre_parse etc. was too good to lose in e-mail.
+
+1999-10-27 17:30 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - (vacm_vars.c): watch for null communities when printing debug statements.
+
+1999-10-27 17:12 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): bail if we can't find an index in the mib tree to use for
+ breaking an oid apart.
+
+1999-10-27 17:12 hardaker
+
+ * snmplib/ucd-snmp-includes.h:
+
+ - (ucd-snmp-includes.h): added more include files.
+
+1999-10-27 14:38 hardaker
+
+ * snmplib/ucd-snmp-includes.h:
+
+ - (ucd-snmp-includes.h): add default_store.h and snmp_logging.h
+
+1999-10-27 14:37 hardaker
+
+ * snmplib/lcd_time.h:
+
+ - (lcd_time.h): define and comment LCD_TIME_SYNC_OPT better.
+
+1999-10-27 14:36 hardaker
+
+ * snmplib/default_store.h:
+
+ - (default_store.h):
+ - mark regions to be included in the default_store.3 manual page.
+
+1999-10-27 14:36 hardaker
+
+ * man/: Makefile.in, default_store.3,
+ default_store.3.bot, default_store.3.h,
+ default_store.3.top, snmp_agent_api.3:
+
+ - (Makefile.in, default_store.3, default_store.3.bot,
+ default_store.3.h, default_store.3.top, snmp_agent_api.3):
+ - new manual pages: default_store.3, snmp_agent_api.3.
+
+1999-10-27 14:35 hardaker
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - (master_admin.c): simple debugging so you can watch stuff register.
+
+1999-10-27 14:34 hardaker
+
+ * agent/: Makefile.in, ucd-snmp-agent-includes.h:
+
+ - (Makefile.in, ucd-snmp-agent-includes.h): added a header file to
+ wrap around the various agent include files.
+
+1999-10-27 14:34 hardaker
+
+ * agent/snmp_agent.h:
+
+ - (snmp_agent.h): prototype agent_check_and_process().
+
+1999-10-27 14:33 hardaker
+
+ * Makefile.in:
+
+ - (Makefile.in): fix up ucd-snmp-config.h building.
+
+1999-10-26 10:34 mslifcak
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ Allow unsigned range for counter/gauge/timeticks (fix BUG#84 per Sander Steffann).
+
+1999-10-25 16:04 hardaker
+
+ * apps/snmptranslate.c, snmplib/parse.c:
+
+ - (snmptranslate.c, parse.c): hack to do wild card searches for a mib node.
+
+1999-10-25 14:35 hardaker
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c): enable -p printing of only a section of the mib tree.
+
+1999-10-25 14:12 nba
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/auto_nlist.c,
+ agent/snmp_agent.c, agent/snmp_vars.c, agent/snmpd.c
+, agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ apps/snmpnetstat/Makefile.in, snmplib/asn1.c,
+ snmplib/callback.c, snmplib/default_store.c,
+ snmplib/keytools.c, snmplib/lcd_time.c, snmplib/mib.c
+, snmplib/parse.c, snmplib/read_config.c,
+ snmplib/scapi.c, snmplib/scapi.h, snmplib/snmp.c
+, snmplib/snmp_alarm.c, snmplib/snmp_api.c,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_debug.c, snmplib/snmp_logging.c,
+ snmplib/snmpusm.c, snmplib/snmpv3.c, snmplib/system.c
+, snmplib/tools.c, snmplib/vacm.c:
+
+ - *: configure support for dmalloc malloc debugger (www.dmalloc.com)
+
+1999-10-25 14:08 nba
+
+ * man/snmpd.conf.5.def:
+
+ - snmpd.conf.5.def: minor quirk
+
+1999-10-25 14:07 nba
+
+ * apps/snmpdelta.c:
+
+ - snmpdelta.c: COUNTER64 will dereference freed pointer
+
+1999-10-25 13:56 nba
+
+ * testing/: RUNTESTS, TESTCONF.sh, eval_onescript.sh
+, eval_tools.sh:
+
+ - RUNTESTS, TESTCONF.sh eval_onescript.sh eval_tools.sh: support non-bash
+ shells (echo -n vs echo \\c). Don't require . in PATH
+
+1999-10-25 13:40 nba
+
+ * configure, configure.in,
+ agent/mibgroup/ucd-snmp/proc.c:
+
+ - configure.in, proc.c: support for FreeBSD 2.1 where ps doesn't have c flag
+
+1999-10-25 13:39 nba
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - interfaces.c: fix a memory leak in the Linux part
+
+1999-10-25 08:06 mslifcak
+
+ * snmplib/: keytools.c, mib.c, scapi.c:
+
+ minor rework to clarify signed compares and remove unused variables.
+
+1999-10-24 08:27 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c):
+ - premib directives weren't getting read due to a missing negation (!).
+ - more parsing debugging statements added.
+
+1999-10-24 08:25 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): fix "mibs" and "mibdirs" .conf directives to properly
+ handle multiple calls (additive) and '+'s and things.
+
+1999-10-24 08:24 hardaker
+
+ * README.snmpv3:
+
+ - (README.snmpv3): typo.
+
+1999-10-24 08:23 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): SNMPCONFPATH uses sysconfdir not datadir.
+
+1999-10-22 15:29 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): print string based OIDs better.
+
+1999-10-22 15:28 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/keytools.c, snmplib/keytools.h
+, snmplib/scapi.c:
+
+ - (acconfig.h, config.h.in, configure, configure.in, keytools.c,
+ keytools.h, scapi.c):
+ - use openssl for md5/sha support (from Olafur Gudmundsson).
+
+1999-10-22 10:12 mslifcak
+
+ * snmplib/mib.c:
+
+ Display _some_ octet string indices of object identifiers as quoted printable.
+ Should be expanded to handle other INDEX types.
+
+1999-10-22 09:59 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): enable hex strings inside oids.
+
+1999-10-22 07:39 mslifcak
+
+ * snmplib/mib.c:
+
+ Removed duplicated variable in a nested block. ARg!
+
+1999-10-22 06:29 mslifcak
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ Fix BUG #83.
+
+1999-10-21 12:54 nba
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.c:
+
+ - memory_solaris2.c: reorder computations to avoid overflow.
+
+1999-10-21 12:31 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ small patch from M. Laukkanen to fix HP aCC build.
+
+1999-10-21 12:09 mslifcak
+
+ * man/: snmp_api.3, snmp_sess_api.3, snmpd.1.def
+, snmpnetstat.1, snmptest.1:
+
+ Fix BUG#78
+
+1999-10-21 10:42 mslifcak
+
+ * agent/: agent_trap.c, snmp_agent.c,
+ mibgroup/agentx/master.c, mibgroup/agentx/subagent.c:
+
+ use snmp_open_ex.
+
+1999-10-21 10:41 mslifcak
+
+ * apps/: snmpbulkwalk.c, snmpdelta.c, snmpget.c
+, snmpgetnext.c, snmpset.c, snmpstatus.c
+, snmptable.c, snmptest.c, snmptrap.c,
+ snmpusm.c, snmpwalk.c, snmpnetstat/main.c:
+
+ reminders for snmp_sess_perror usage after open.
+ snmptable.c - open/close session from main().
+ netstat/main.c - use snmp_sess_perror.
+
+1999-10-21 10:39 mslifcak
+
+ * win32/: config.h, libsnmp/libsnmp.dsp,
+ libsnmp_dll/libsnmp_dll.dsp:
+
+ Fixups for building with MSVC++. (no hpux.c, supply MAX_PERSISTENT_BACKUPS).
+
+1999-10-21 10:37 mslifcak
+
+ * snmplib/: mib.c, read_config.c, snmp_api.c
+, snmp_api.h:
+
+ mib.c - restore line stomped in my last update.
+ read_config.c - drop unused variable.
+ snmp_api.c - new method snmp_open_ex replaces set internal hook functions.
+
+1999-10-21 10:26 mslifcak
+
+ * snmplib/mib.c:
+
+ Note SNMPERR_UNKNOWN_OBJID error from within the library.
+
+1999-10-21 10:20 mslifcak
+
+ * apps/snmp_parse_args.c:
+
+ Note SNMPERR_UNKNOWN_OBJID error without specifying snmp_errno _outside_ the library.
+
+1999-10-21 10:07 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): enable oidname."hi".'there' in get_module_node() as well.
+
+1999-10-20 18:08 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): enable oid parser to handle simple embedded strings in oids
+ and to translate them into oid segments.
+ EG: .1.3.\"hello\".\'hi\' -> .1.3.5.104.101.108.108.111.104.105
+
+1999-10-20 17:26 hardaker
+
+ * agent/mibgroup/header_complex.c:
+
+ - (header_complex.c): parsed strings from oid's include null terminators.
+
+1999-10-15 07:09 mslifcak
+
+ * snmplib/: callback.c, default_store.c:
+
+ -(default_store.c, callback.c) fix
+ bug in array-boundary check in snmplib/callback.c
+ reported by Bert Holstein 15 Oct 1999.
+
+1999-10-13 07:09 nba
+
+ * agent/mibgroup/: agentx/master_admin.c, mibII/system_mib.c
+:
+
+ - master_admin.c, system_mib.h: includes for prototypes
+
+1999-10-13 03:54 mslifcak
+
+ * snmplib/read_config.h:
+
+ add missing proto for save_persistent.
+
+1999-10-12 06:07 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Define address length for FreeBSD platform.
+
+1999-10-12 05:58 mslifcak
+
+ * snmplib/: lcd_time.c, mib.c:
+
+ mib.c: quick_print is exposed for CMU_COMPATIBLE builds.
+ lcd_time.c: commented unused dump_etimelist_entry under SNMP_TESTING_CODE.
+
+1999-10-07 09:01 daves
+
+ * agent/mibgroup/agentx/: master_admin.c, subagent.c:
+
+ - (agentx/subagent.c agentx/master_admin.c): Notification support
+
+1999-10-07 08:42 daves
+
+ * agent/: agent_trap.c, agent_trap.h:
+
+ - (agent_trap.[ch]): Improve accessibility for subagents
+
+1999-10-07 07:26 daves
+
+ * agent/: agent_read_config.c, agent_trap.c,
+ agent_trap.h, snmpd.h:
+
+ - (agent_trap.c agent_trap.h agent_read_config.c snmpd.h):
+ - Re-write of agent trap handling:
+ Provision for v1 traps with varbinds
+ Consolidate v1 and v2 trap sink lists
+ Preliminary INFORM support
+
+1999-10-06 16:31 hardaker
+
+ * acconfig.h, config.h.in, snmplib/read_config.c
+, snmplib/snmp_api.c, snmplib/snmp_client.c:
+
+ - (acconfig.h, config.h.in, read_config.c, snmp_api.c, snmp_client.c):
+ - Save and parse older persistent storage files to make sure data is
+ not lost during storage crashes.
+ - Fix SNMPv3 engineID probes: PDU's are allowed to have a NULL varbindlist.
+
+1999-10-06 08:57 hardaker
+
+ * local/fixproc:
+
+ - (fixproc): new commented version.
+
+1999-10-05 22:22 nba
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - subagent.c: include system.h for prototype for calculate_time_diff
+
+1999-10-05 22:18 nba
+
+ * apps/snmp_parse_args.c:
+
+ - snmp_parse_args.c: fixes to report invalid engineId
+
+1999-10-05 21:49 nba
+
+ * snmplib/snmp_debug.h:
+
+ - snmp_debug.h: make the DEBUG* macros safe for use in compound statements
+
+1999-10-05 07:23 daves
+
+ * agent/mibgroup/agentx/: master_request.c, subagent.c
+:
+
+ - (agentx/master_request.c agentx/subagent.c): Working SET support
+
+1999-10-04 16:32 hardaker
+
+ * agent/mibgroup/: header_complex.c, header_complex.h:
+
+ - (header_complex.c, header_complex.h): added header_complex_find_entry().
+
+1999-10-04 13:52 nba
+
+ * agent/: mib_modules.c, mibgroup/agentx/subagent.c,
+ mibgroup/agentx/subagent.h:
+
+ - subagent.h, subagent.c, mib_modules.c: pre_init_subagent confuses
+ configure into believing there is a init_subagent function.
+ Rename to subagent_pre_init
+
+1999-10-04 13:51 hardaker
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ - (system_mib.c): make sysServices configurable.
+
+1999-10-04 13:38 nba
+
+ * agent/: agent_registry.h, mibgroup/agentx/master_admin.c
+, mibgroup/agentx/subagent.c,
+ mibgroup/mibII/sysORTable.c, mibgroup/mibII/sysORTable.h
+:
+
+ - various: include additions and fixes to kill warnings
+
+1999-10-04 11:52 nba
+
+ * configure, configure.in:
+
+ - configure.in: remove -pedantic from --with-developer, and the system headers
+ are not prepared for it (at least on Linux and NetBSD)
+
+1999-10-04 11:50 nba
+
+ * Makefile.in:
+
+ - Makefile.in: always use $(MAKE) for make in Makefiles
+
+1999-10-04 11:48 nba
+
+ * snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/int64.c, snmplib/int64.h, apps/snmptrap.c
+:
+
+ - (snmp_api?, int64.? snmptrap.c): add some error checking for variables
+
+1999-10-04 10:22 daves
+
+ * agent/mibgroup/agentx/: client.c, client.h,
+ master_admin.c:
+
+ - (agentx/client.[ch] agentx/master_admin.c): Trivial 'ping' implementation
+
+1999-10-04 10:17 daves
+
+ * agent/: agent_callbacks.h, mibgroup/agentx/master_admin.c
+, mibgroup/agentx/subagent.c,
+ mibgroup/mibII/sysORTable.c, mibgroup/mibII/sysORTable.h
+:
+
+ - (agent_callbacks.h mibgroup/mibII/sysORTable.[ch]
+ mibgroup/agentx/master_admin.c mibgroup/agentx/subagent.c):
+ - Complete subagent handling of Agent Capabilities / sysORTable
+
+1999-10-04 10:15 daves
+
+ * snmplib/callback.h:
+
+ - (snmplib/callback.h): Increase number of application callbacks supported
+
+1999-10-04 09:58 daves
+
+ * agent/: mib_modules.c, mibgroup/agentx/subagent.c,
+ mibgroup/agentx/subagent.h:
+
+ - (mib_modules.c mibgroup/agentx/subagent.[ch]):
+ - Ensure subagent is initialised early (prior to MIB registration, etc)
+
+1999-10-04 09:53 daves
+
+ * agent/: agent_registry.c, agent_registry.h,
+ snmp_vars.h, mibgroup/agentx/client.c,
+ mibgroup/agentx/client.h, mibgroup/agentx/master_admin.c
+, mibgroup/agentx/subagent.c,
+ mibgroup/mibII/sysORTable.c:
+
+ - (agent_registry.[ch] snmp_vars.h mibII/sysORTable.c
+ agentx/client.[ch] agentx/master_admin.c):
+ - Handle MIB range registration, and clean up wrapper interfaces
+
+1999-10-04 03:58 daves
+
+ * agent/: agent_registry.c, agent_registry.h,
+ mibgroup/agentx/client.h:
+
+ - (agent_registry.[ch] mibgroup/agentx/client.h):
+ - consolidate definitions of default MIB registration priority
+
+1999-10-02 14:28 daves
+
+ * agent/mibgroup/agentx/: master_admin.c, subagent.c:
+
+ - (mibgroup/agentx/master_admin.c mibgroup/agentx/subagent.c):
+ - Fix a problem with re-used PDU structures being freed twice.
+
+1999-10-01 09:48 daves
+
+ * agent/Makefile.in:
+
+ - (agent/Makefile.in): Fix incompatability in agent library names
+
+1999-09-30 01:09 daves
+
+ * agent/mibgroup/host/hr_system.c:
+
+ - (mibgroup/host/hr_system.c):
+ - protect against NULL utmp file (from Fabrice Dupre)
+
+1999-09-29 23:42 mslifcak
+
+ * snmplib/hpux.c:
+
+ Remove unused file.. snmplib/hpux.c
+
+1999-09-29 17:01 hardaker
+
+ * agent/mib_modules.c:
+
+ - (mib_modules.c): include netinet/in.h
+
+1999-09-29 17:01 hardaker
+
+ * agent/: agent_registry.c, agent_registry.h:
+
+ - (agent_registry.c, agent_registry.h): fix bugs.
+
+1999-09-29 16:40 hardaker
+
+ * local/mib2c.vartypes.conf:
+
+ - (mib2c.vartypes.conf): removed extra \n.
+
+1999-09-29 16:40 hardaker
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ - (pass.c): run ntohl on ip addresses stored in a long.
+
+1999-09-29 16:39 hardaker
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - (master_admin.c): -Wall fixes and found a missing }.
+
+1999-09-29 16:39 hardaker
+
+ * agent/mibgroup/agentx/client.h:
+
+ - (client.h): define DEFAULT_MIB_PRIORITY to 255.
+
+1999-09-29 16:38 hardaker
+
+ * agent/mibgroup/agentx/client.c:
+
+ - (client.c): thats "timeval" not "timevale" Dave (hehe).
+
+1999-09-29 16:38 hardaker
+
+ * agent/mibgroup/: header_complex.c, header_complex.h:
+
+ - (header_complex.c, header_complex.h):
+ - new extraction and freeing functions.
+ - bug fix, missing a malloc size by one (electric fence is very cool).
+
+1999-09-29 16:36 hardaker
+
+ * README:
+
+ - (README): added Mike Michaud to the thank you list.
+
+1999-09-29 16:35 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in):
+ - fix RANLIB testing for --enable-shared.
+
+1999-09-29 14:31 mslifcak
+
+ * snmplib/parse.c:
+
+ Robust copy of information to tree, import_list, display hints.
+
+1999-09-29 12:19 daves
+
+ * agent/mibgroup/agentx/: client.c, client.h,
+ master_admin.c, master_request.c, protocol.c,
+ protocol.h, subagent.c:
+
+ - (agent/mibgroup/agentx/*): Assorted improvements!
+
+1999-09-29 11:48 daves
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ - (agent/mibgroup/mibII/sysORTable.c): Change in MIB registration interface
+
+1999-09-29 11:46 daves
+
+ * agent/snmp_vars.c:
+
+ - (agent/snmp_vars.c):
+ - Move setting agent start time to earlier in the initialisation sequence
+ (so that it can be overridden in subagents with the master's value)
+
+1999-09-29 11:43 daves
+
+ * agent/: agent_registry.c, agent_registry.h:
+
+ - (agent_registry.[ch]): Provision to unregister MIBs by session
+
+1999-09-29 11:38 daves
+
+ * agent/agent_registry.c:
+
+ - (agent_registry.c):
+ - 'Children' nodes now have a different status, and shouldn't be freed. Oops!
+
+1999-09-29 11:36 daves
+
+ * agent/: agent_registry.c, agent_registry.h:
+
+ - (agent_registry.[ch]):
+ - Improve registry error handling
+ - Correctly handle unregistering MIB regions
+
+1999-09-29 11:23 daves
+
+ * agent/agent_registry.c:
+
+ - (agent_registry.c): Correct value of default registration priority
+
+1999-09-29 11:17 daves
+
+ * snmplib/: mt_support.h, snmp_api.c, snmp_api.h
+:
+
+ - (mt_support.h snmp_api.[ch]): Support for session and incoming transaction IDs
+
+1999-09-29 11:14 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): protect snmp_close() against a null Sessions list
+
+1999-09-28 16:52 hardaker
+
+ * agent/: Makefile.in, mib_modules.c, mib_modules.h
+, snmp_vars.c, snmpd.c:
+
+ - (Makefile.in, mib_modules.c, mib_modules.h, snmp_vars.c, snmpd.c):
+ - make libucdagent and libucdmibs as seperate libraries. In theory,
+ you shouldn't need libucdmibs to use libucdagent.
+
+1999-09-27 16:22 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): Opps: DS_LIB_DONT_READ_CONFIGS needed an !.
+
+1999-09-22 12:51 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ -(snmp_api.c) - Improved error status aggregation.
+
+1999-09-22 10:01 daves
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - (mibgroup/agentx/master_request.c): Improved AgentX response handling
+
+1999-09-22 10:00 daves
+
+ * agent/agent_registry.c:
+
+ - (agent_registry.c): Ensure registry is initialised correctly on subagents
+
+1999-09-22 09:58 daves
+
+ * agent/agent_registry.c:
+
+ - (agent_registry.c): remove redundant routines
+
+1999-09-22 09:54 daves
+
+ * agent/: agent_registry.c, snmp_vars.c,
+ var_struct.h:
+
+ - (agent_registry.c snmp_vars.c var_struct.h):
+ Change the way the MIB registry handles registered ranges.
+ This should work more reliably (as well as being rather simpler, IMHO)
+
+1999-09-22 09:35 daves
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ - (agent/mibgroup/mibII/sysORTable.c):
+ - Ensure local sysORTable takes precedence over subagent versions
+
+1999-09-22 09:33 daves
+
+ * agent/: agent_registry.c, agent_registry.h:
+
+ - (agent/agent_registry.[ch]): Provide method for prioritised registration
+
+1999-09-22 09:31 daves
+
+ * agent/agent_registry.c:
+
+ - (agent/agent_registry.c): stupid typo
+
+1999-09-22 09:27 daves
+
+ * agent/snmpd.c:
+
+ - (agent/snmpd.c): stupid typo
+
+1999-09-21 10:40 mslifcak
+
+ * snmplib/mib.c:
+
+ -(mib.c) undo erroneous change to init_mib (thanks NB!)
+
+1999-09-21 09:32 daves
+
+ * agent/: agent_registry.c, snmpd.c:
+
+ - (agent_registry.c snmpd.c): Simple run-time dump of registered MIBs
+
+1999-09-21 09:25 daves
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - (agent/mibgroup/agentx/protocol.c): Handle parsing null-length variables
+
+1999-09-21 09:21 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): handle adding 'error' type variables to a PDU
+
+1999-09-17 15:37 hardaker
+
+ * configure:
+
+ - (configure): update to 2.13.
+
+1999-09-17 11:42 mslifcak
+
+ * snmplib/parse.c:
+
+ make module_map* and tokens structures static (only used in parse.c ?)
+
+1999-09-17 11:24 mslifcak
+
+ * FAQ, snmplib/parse.c, snmplib/parse.h:
+
+ -remove old-style init for replace mib feature.
+
+1999-09-17 11:19 mslifcak
+
+ * snmplib/parse.c:
+
+ -(parse.c) - remove unneeded use of static var "last"
+
+1999-09-17 07:17 hardaker
+
+ * man/snmp_api.3:
+
+ - (snmp_api.3): Patch from Mark H. Wood:
+ - fix comments.
+
+1999-09-16 14:16 mslifcak
+
+ * config.h.in, configure, configure.in,
+ snmplib/mt_support.c, snmplib/mt_support.h:
+
+ -per agreement with Markku, no support needed for Solaris-specific threads.
+
+1999-09-15 11:30 mslifcak
+
+ * config.h.in, configure, configure.in,
+ snmplib/mib.c, snmplib/mt_support.c,
+ snmplib/mt_support.h, snmplib/snmp_api.c:
+
+ fine tuning mt support
+
+1999-09-15 09:45 hardaker
+
+ * man/: Makefile.in, snmp_close.3, snmp_free_pdu.3
+, snmp_open.3, snmp_read.3, snmp_select_info.3
+, snmp_send.3, snmp_sess_async_send.3,
+ snmp_sess_close.3, snmp_sess_error.3, snmp_sess_init.3
+, snmp_sess_open.3, snmp_sess_read.3,
+ snmp_sess_select_info.3, snmp_sess_send.3,
+ snmp_sess_sess_timeout.3, snmp_sess_session.3,
+ snmp_timeout.3:
+
+ - (Makefile.in, snmp_close.3, snmp_free_pdu.3, snmp_open.3,
+ snmp_read.3, snmp_select_info.3, snmp_send.3,
+ snmp_sess_async_send.3, snmp_sess_close.3, snmp_sess_error.3,
+ snmp_sess_init.3, snmp_sess_open.3, snmp_sess_read.3,
+ snmp_sess_select_info.3, snmp_sess_send.3, snmp_sess_sess_timeout.3,
+ snmp_sess_session.3, snmp_timeout.3): Patch from Mark H. Wood:
+ - create some fake sourcing man pages for functions.
+
+1999-09-15 06:08 mslifcak
+
+ * agent/agent_read_config.c:
+
+ include mibgroup/mib_module_includes.h for benefit of mib_module_dot_conf.h
+
+1999-09-14 13:22 mslifcak
+
+ * snmplib/parse.c:
+
+ parse.c - another fix for node: consider NULL name or NULL parent
+
+1999-09-14 13:00 marz
+
+ * apps/snmp_parse_args.c, snmplib/snmp_api.c,
+ snmplib/snmp_api.h:
+
+ (apps/snmp_parse_args.c, snmplib/snmp_api.[ch]): fix spurious error message when snmp_parse_oid fails
+
+1999-09-14 09:53 mslifcak
+
+ * FAQ, man/snmpcmd.1, snmplib/default_store.h,
+ snmplib/mib.c, snmplib/parse.c, snmplib/parse.h
+:
+
+ -(FAQ, man/snmpcmd.1, snmplib/parse.*) add replace MIB capability(experimental)
+
+1999-09-13 20:20 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ -(snmp_api.c) re-assert Niels' patch to snmp_send to free v2/v1 Trap-PDUs
+
+1999-09-13 15:01 hardaker
+
+ * agent/: agent_callbacks.h, agent_read_config.c,
+ agent_registry.c, agent_registry.h, snmp_agent.c
+, snmp_vars.c, snmpd.c,
+ mibgroup/agentx/subagent.c, mibgroup/agentx/subagent.h,
+ mibgroup/mibII/sysORTable.c, mibgroup/mibII/vacm_vars.c
+, mibgroup/mibII/vacm_vars.h:
+
+ - (agent_callbacks.h, agent_read_config.c, agent_registry.c,
+ agent_registry.h, snmp_agent.c, snmp_vars.c, snmpd.c, subagent.c,
+ subagent.h, sysORTable.c, vacm_vars.c, vacm_vars.h):
+ - further separation of agent church and state:
+ - use callbacks everywhere needed to not call mib module code directly.
+ - get rid of all instances of USING_ in libagent code.
+
+1999-09-12 22:00 nba
+
+ * snmplib/snmp_impl.h:
+
+ - snmp_impl.h: removed some unused/unneeded defines/structs
+
+1999-09-12 21:59 nba
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - protocol.c: add a missing include file.
+
+1999-09-12 21:58 nba
+
+ * testing/TESTCONF.sh:
+
+ - TESTCONF.sh: fix some exports to export the right variable.
+
+1999-09-12 21:57 nba
+
+ * agent/agent_trap.c, agent/snmp_agent.c,
+ snmplib/snmp_api.c, snmplib/snmp_client.c:
+
+ - agent/*, snmplib/*: malloc fixes, some provoked by the corrected
+ snmp_send semantics.
+
+1999-09-12 21:50 nba
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ - var_route.c: Linux cleanup. Required for Linux/SPARC
+
+1999-09-09 13:59 mslifcak
+
+ * snmplib/: mib.c, parse.c:
+
+ -(mib.c, parse.c) mib.c print_tree_node test display null type with range
+ parse.c work around core dump freeing TCs that specify ranges.
+
+1999-09-09 02:31 mslifcak
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, win32/config.h:
+
+ -(*config*) turn on resource locking with --enable-reentrant.
+
+1999-09-09 02:21 mslifcak
+
+ * apps/snmpnetstat/winstub.c:
+
+ -(winstub.c) Hack to allow snmpnetstat -a to work on AIX4 (sic).
+
+1999-09-08 22:34 mslifcak
+
+ * agent/mibgroup/mibincl.h:
+
+ -(mibincl.h) comment out duplicate #include header lines.
+
+1999-09-08 22:30 mslifcak
+
+ * agent/mibgroup/smux/smux.c:
+
+ -(smux.c) var_smux_write fixed per Mike Michaud and Nick Amato
+
+1999-09-08 17:52 mslifcak
+
+ * snmplib/: mt_support.c, mt_support.h:
+
+ -(mt_support.*) Original by Markku Laukkanen, changes by M. Slifcak
+
+1999-09-08 17:48 mslifcak
+
+ * config.h.in, configure, configure.in,
+ snmplib/Makefile.in, snmplib/parse.c,
+ snmplib/parse.h, snmplib/snmp_api.c,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/libsnmp.def
+, win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ -(config*,win32/*,snmplib/*) resource locking originally from Markku Laukkanen
+
+1999-09-08 17:02 mslifcak
+
+ * agent/mibgroup/: mibincl.h, mibII/icmp.c,
+ mibII/interfaces.c, mibII/ip.c, mibII/tcp.c,
+ mibII/udp.c:
+
+ mibincl.h, mibgroup/mibII/* - fixup for CygWin32 build
+
+1999-09-08 13:04 mslifcak
+
+ * snmplib/: snmp_client.c, snmp_client.h:
+
+ -(snmplib/snmp_client.*) add snmp_split_pdu, snmp_varbind_len methods.
+
+1999-09-08 13:00 mslifcak
+
+ * testing/RUNTESTS:
+
+ -(testing/RUNTESTS) prefix PATH with . and .. , as the script changes dir.
+
+1999-09-08 07:52 nba
+
+ * apps/snmptrapd.c:
+
+ - apps/snmptrapd.c: fix argument processing (-ld and similar)
+
+1999-09-08 07:51 nba
+
+ * man/snmpd.1.def:
+
+ - snmpd.1.def: fix a formatting problem
+
+1999-09-08 07:50 nba
+
+ * agent/mibgroup/: mibincl.h, agentx/master_admin.c,
+ agentx/master_request.c, agentx/subagent.c,
+ mibII/sysORTable.c:
+
+ - (various): fix compiler warnings
+
+1999-09-08 07:48 nba
+
+ * agent/var_struct.h:
+
+ - var_struct.h: the Agentx code uses unsigned values for the variable type.
+
+1999-09-08 07:46 nba
+
+ * snmplib/snmp_api.h:
+
+ - snmp_api.h: move inclusion protection to the real beginning/end of the file
+
+1999-09-08 07:45 nba
+
+ * configure, config.h.in, configure.in,
+ agent/mibgroup/ucd-snmp/loadave.c:
+
+ - (configure.in, loadave.c): Solaris 2.7 has getloadavg prototype
+
+1999-09-08 05:16 mslifcak
+
+ * agent/agent_trap.c:
+
+ include read_config.h
+
+1999-09-07 20:19 mslifcak
+
+ * apps/snmptrap.c:
+
+ snmptrap.c - rework fix bug #54 (missed else).
+
+1999-09-07 20:12 mslifcak
+
+ * agent/agent_trap.c, apps/snmptrap.c,
+ apps/snmpnetstat/if.c, man/snmp_api.3,
+ snmplib/snmp_api.c:
+
+ -(agent_trap.c,snmptrap.c,snmp_api.[3c]) - snmp_free_pdu fix Bug #54 per Niels B.
+ -(snmpnetstat/if.c) - fix for GETNEXT per Niels B.
+
+1999-09-07 15:57 mslifcak
+
+ * snmplib/parse.c:
+
+ -(parse.c) fix Unlinked OID print when object identifier has no parent.
+
+1999-09-07 15:32 mslifcak
+
+ * snmplib/parse.c:
+
+ -(parse.c) remove unneeded strdup to File variable from init_mib_internals.
+
+1999-09-07 15:32 mslifcak
+
+ * snmplib/snmp_api.h:
+
+ -(snmp_api.h) struct pdu and snmp_session agree: long type for version member.
+
+1999-09-07 15:23 mslifcak
+
+ * win32/: config.h, libsnmp_dll/libsnmp.def:
+
+ (win32/config.h) - set SNMPCONFPATH to succeed compile;
+ (win32*libsnmp.def) - add new snmp_get_token to list.
+
+1999-09-07 15:23 mslifcak
+
+ * snmplib/: default_store.c, default_store.h:
+
+ (default_store.*) - make 3rd param to ds_set_string type of const char *.
+
+1999-09-07 15:22 mslifcak
+
+ * snmplib/snmpv3.c:
+
+ snmpv3.c - silence type warning from MSVC++.
+
+1999-09-07 14:47 mslifcak
+
+ * snmplib/: parse.c, parse.h:
+
+ -(parse.*) fix small memory leaks; allow INDEX{INTEGER...} clauses;
+ allow larger DESCRIPTION clauses [max 8192].
+
+1999-09-03 15:01 hardaker
+
+ * FAQ:
+
+ - (FAQ): more BSDI system versions listed.
+
+1999-09-03 14:28 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): don't fall off the end of the search tree.
+
+1999-09-03 13:30 hardaker
+
+ * snmplib/Makefile.in:
+
+ - (snmplib/Makefile.in): install more library headers.
+
+1999-09-03 13:27 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in):
+ - install libagent.a.
+ - mkdirheir on needed new installation directories.
+
+1999-09-03 13:15 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): install agent header files.
+
+1999-09-03 13:15 hardaker
+
+ * agent/: history.c, history.h, snmp_vars.linux.h
+:
+
+ - (history.c, history.h, snmp_vars.linux.h): removed. No longer needed.
+
+1999-09-02 08:52 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - (subagent.c): opps. Forgot a shutdown name change instance.
+
+1999-09-02 07:07 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - (subagent.c): shutdown_subagent -> subagent_shutdown so configure
+ doesn't find it.
+
+1999-09-02 06:38 daves
+
+ * agent/mibgroup/misc/ipfwacc.c:
+
+ - (agent/mibgroup/misc/ipfwacc.c): Fix MIB location of ipfwacc module
+
+1999-08-31 09:26 mslifcak
+
+ * agent/agent_trap.c:
+
+ -(agent_trap.c) always free PDU after snmp_send.
+
+1999-08-31 08:17 mslifcak
+
+ * agent/agent_trap.c:
+
+ -(agent_trap.c) fix recent memory leak, and sizeof(objid_snmptrap) bug.
+
+1999-08-30 10:30 hardaker
+
+ * agent/mibgroup/agentx/: master.c, master_request.c:
+
+ - (master.c, master_request.c): yet more debugging.
+
+1999-08-30 09:38 hardaker
+
+ * agent/mibgroup/agentx/: client.c, master.c,
+ master_request.c, protocol.c, subagent.c:
+
+ - (client.c, master.c, master_request.c, protocol.c, subagent.c):
+ - debugging statements.
+ - use new default_store settings instead of external variables.
+
+1999-08-30 09:32 hardaker
+
+ * agent/Makefile.in, agent/agent_read_config.c,
+ agent/agent_registry.c, agent/agent_trap.c,
+ agent/agent_trap.h, agent/ds_agent.h,
+ agent/snmp_agent.c, agent/snmp_agent.h,
+ agent/snmp_vars.c, agent/snmpd.c,
+ agent/mibgroup/util_funcs.c,
+ agent/mibgroup/mibII/sysORTable.c, snmplib/callback.c,
+ snmplib/callback.h, snmplib/default_store.h,
+ snmplib/read_config.c, snmplib/snmp_api.c:
+
+ - (Makefile.in, agent_read_config.c, agent_registry.c, agent_trap.c,
+ agent_trap.h, ds_agent.h, snmp_agent.c, snmp_agent.h, snmp_vars.c,
+ snmpd.c, util_funcs.c, sysORTable.c, callback.c, callback.h,
+ default_store.h, read_config.c, snmp_api.c):
+ - restructure the agent into two pieces: a library and a application.
+ - needs much more work.
+ - many parameters are now controlled by new default_store settings
+ to help relieve compile time bindings.
+ - merge init_snmp and the custom version called inside the agent.
+ - add a new place for trap specific agent code (agent_trap.[ch]).
+ - probably other things I've forgotten that I did.
+
+1999-08-28 07:29 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/read_config.c:
+
+ - (acconfig.h, config.h.in, configure, configure.in, read_config.c):
+ - add /etc/snmp to default conf file path to make RedHat happy.
+
+1999-08-28 07:19 hardaker
+
+ * man/Makefile.in:
+
+ - (Makefile.in): install snmp_alarm.3.
+
+1999-08-27 09:17 hardaker
+
+ * agent/mibgroup/mibII/: icmp.c, interfaces.c, ip.c
+, route_write.c, tcp.c, udp.c,
+ var_route.c:
+
+ - (icmp.c, interfaces.c, ip.c, route_write.c, tcp.c, udp.c, var_route.c):
+ - Susanne Osted pointed out a lack of #if HAVE_SYS_PARAM_H.
+
+1999-08-27 08:03 mslifcak
+
+ * TODO:
+
+ Howard Spindel suggests an API for traps with pass_persist.
+
+1999-08-27 07:35 mslifcak
+
+ * configure, configure.in, sedscript.in:
+
+ -(configure*, sedscript*) change ...EXTENIS... to ...EXTENSI...
+
+1999-08-26 13:40 mslifcak
+
+ * testing/Makefile.in:
+
+ -(testing/Makefile.in) don't built targets that are no longer used
+
+1999-08-26 13:18 mslifcak
+
+ * testing/RUNTESTS:
+
+ -(testing/RUNTESTS) improved PATH set
+
+1999-08-24 17:43 mslifcak
+
+ * testing/Makefile.in:
+
+ -(testing/Makefile.in) no need to build targets in test rule.
+
+1999-08-24 17:39 mslifcak
+
+ * testing/RUNTESTS:
+
+ -(RUNTESTS) export PATH before use
+
+1999-08-24 17:14 hardaker
+
+ * bug-report, sedscript.in, version.h, FAQ
+, README:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.0.1 )
+
+1999-08-24 17:13 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): update for 4.0.1
+
+1999-08-24 16:49 mslifcak
+
+ * testing/: Makefile.in, RUNTESTS, T2.sh,
+ TESTCONF.sh, eval_onescript.sh, eval_tools.sh,
+ test_keychange.sh, test_kul.sh:
+
+ -(testing/*) run tests when package is not installed, and when
+ the build tree is not the same as the source tree.
+
+1999-08-24 16:05 mslifcak
+
+ * configure, configure.in:
+
+ -(configure.*) move statement about ucdDemoPublic into comment field.
+
+1999-08-24 16:01 hardaker
+
+ * NEWS:
+
+ - (NEWS): 4.0.1 update
+
+1999-08-24 15:59 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): remove version setting in snmp_api.c. Not needed there.
+
+1999-08-24 15:14 mslifcak
+
+ * agent/mibgroup/smux/smux.c:
+
+ -(smux.c) apply Nick Amato's patch: prevent SMUX close on parse or error.
+
+1999-08-24 14:17 mslifcak
+
+ * agent/mibgroup/: host/hr_swrun.c, mibII/icmp.c,
+ mibII/ip.c, ucd-snmp/disk.c, ucd-snmp/proc.c:
+
+ -(host/hr_swrun;mibII/icmp,ip;ucd-snmp/disk,proc) log_perror --> snmp_log_perror
+
+1999-08-24 14:15 hardaker
+
+ * snmplib/all_system.h:
+
+ - (all_system.h): remove. again.
+
+1999-08-24 14:05 mslifcak
+
+ * Makefile.in:
+
+ -(top/Makefile.in) - remove more generated files with distclean rule.
+
+1999-08-24 13:41 hardaker
+
+ * TODO:
+
+ - (TODO): remove snmpv3 support:-)
+
+1999-08-24 13:37 hardaker
+
+ * apps/snmp_parse_args.c, snmplib/default_store.h,
+ snmplib/snmp_api.c, snmplib/snmpv3.c:
+
+ - (snmp_parse_args.c, default_store.h, snmp_api.c, snmpv3.c):
+ - provide defVersion token support in snmp.conf (sort of hackish).
+
+1999-08-24 13:36 hardaker
+
+ * apps/snmpusm.c:
+
+ - (snmpusm.c): check for null response pointer.
+
+1999-08-24 12:48 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - (vacm_vars.c): correct sysORTable entry.
+
+1999-08-24 10:25 mslifcak
+
+ * testing/eval_tools.sh:
+
+ -(testing/eval_tools) - let some (AIX) agents settle before firing requests.
+
+1999-08-24 06:19 mslifcak
+
+ * testing/: RUNTESTS, T.c, etimetest.c,
+ keymanagetest.c, misctest.c, scapitest.c:
+
+ Add "." to PATH for RUNTESTS; Drop optreset to build most platforms
+
+1999-08-24 05:11 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ Remove ASN_SHORT_LEN hack - known to dump core in agent.
+
+1999-08-24 04:44 mslifcak
+
+ * snmplib/: read_config.c, snmp_api.c,
+ snmp_logging.c:
+
+ Clean CRs from read_config,snmp_logging; comment define USE_ASN_SHORT_LEN.
+
+1999-08-23 16:44 hardaker
+
+ * man/Makefile.in:
+
+ - (Makefile.in): install the snmpusm.1 manual page.
+
+1999-08-23 16:19 hardaker
+
+ * README, bug-report, sedscript.in, version.h
+, FAQ:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.0 )
+
+1999-08-23 16:17 hardaker
+
+ * INSTALL:
+
+ - (INSTALL): remove version specific information
+
+1999-08-23 16:12 hardaker
+
+ * testing/tests/T028snmpv3getfail:
+
+ - (T028snmpv3getfail): snmpv3 get failure test.
+
+1999-08-23 16:04 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): version update
+
+1999-08-23 15:32 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ HACK! fixup short length (first put correct community string in pdu-> ).
+
+1999-08-23 14:02 mslifcak
+
+ * FAQ, snmplib/snmp_api.c:
+
+ Describe USE_ASN_SHORT_LEN in FAQ, and implement in _snmp_build.
+
+1999-08-23 13:54 nba
+
+ * agent/: snmp_agent.c, snmpd.c:
+
+ - agent/snmpd.c, agent/snmp_vars.c: move some -v logging to a more rational
+ place.
+
+1999-08-23 12:28 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - (protocol.c): allow NULL strings in agentX packets.
+
+1999-08-23 09:02 mslifcak
+
+ * snmplib/snmpusm.c:
+
+ Test pointer before dereference in usm_free_user
+
+1999-08-23 09:02 mslifcak
+
+ * README.win32:
+
+ Spell check: similar
+
+1999-08-23 09:00 mslifcak
+
+ * snmplib/read_config.c, snmplib/snmp_logging.c,
+ win32/libsnmp_dll/libsnmp.def:
+
+ Win32 build fixes
+
+1999-08-23 07:02 hardaker
+
+ * NEWS:
+
+ - (NEWS): ansi mentioned.
+
+1999-08-23 06:14 mslifcak
+
+ * acconfig.h, config.h.in, win32/config.h:
+
+ Remove last vestiges of config_load_mib
+
+1999-08-22 23:17 nba
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - agentx/master_admin.c: failure when closing first agents session
+ (uninitialized variable).
+
+1999-08-22 17:57 hardaker
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): version -> u_long.
+
+1999-08-22 17:56 hardaker
+
+ * agent/mibgroup/Makefile.in, snmplib/Makefile.in:
+
+ - (Makefile.in, Makefile.in): make depend.
+
+1999-08-22 17:54 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in):
+ - --without-dummy-values is default again.
+ - cleanup of --help stuff.
+ - fix of peristent directory creation.
+
+1999-08-22 17:32 hardaker
+
+ * agent/mibgroup/ipfwchains/: IPFWCHAINS-MIB.txt, README
+, ipfwc_kernel_headers.h, ipfwchains.c,
+ ipfwchains.h, libipfwc.c, libipfwc.h:
+
+ - (ipfchains): removed from distribution. Newer one in ftp's contrib dir.
+
+1999-08-20 17:10 hardaker
+
+ * README, bug-report, sedscript.in, version.h
+, FAQ:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre7 )
+
+1999-08-20 17:08 hardaker
+
+ * NEWS:
+
+ - (NEWS): last minute changes
+
+1999-08-20 16:39 hardaker
+
+ * snmplib/: asn1.c, snmp_api.h, snmp_auth.c,
+ snmp_impl.h:
+
+ - (snmp_api.h, snmp_api.c, snmp_auth.c, snmp_impl.h, asn1.c): 64bit cleanup.
+
+1999-08-20 13:56 hardaker
+
+ * man/snmp.conf.5.def, snmplib/default_store.h,
+ snmplib/snmp_logging.c:
+
+ - (snmp.conf.5.def, default_store.h, snmp_logging.c):
+ - turn off time stamp logging by default. It must be explicitly
+ requested in the snmp.conf file to turn it on.
+ (the reason is that a lot of logging is incremental in nature and
+ is not line buffered before being sent to the logging routines.
+ The other solution is to have the logging routines detect when to
+ print timestamps by watching out for \n's. But, not this round.
+
+1999-08-20 13:43 hardaker
+
+ * snmplib/: default_store.h, snmp_api.c,
+ snmp_logging.c, snmp_logging.h:
+
+ - (default_store.h, snmp_api.c, snmp_logging.c, snmp_logging.h):
+ - make logging of timestamps optional by a snmp.conf directive.
+
+1999-08-20 03:43 nba
+
+ * agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/client.h,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/mibII/sysORTable.c, apps/snmptrap.c,
+ snmplib/snmp_client.h:
+
+ - agentx/*: various prototype fixes, to keep number of warnings down
+
+1999-08-19 16:09 hardaker
+
+ * apps/: snmpget.c, snmpgetnext.c, snmpset.c:
+
+ - (snmpget.c, snmpgetnext.c, snmpset.c): Patch from dlengel@home.com:
+ - check argument count for minimum number.
+
+1999-08-19 14:09 nba
+
+ * agent/snmpd.c, apps/snmptrap.c, apps/snmptrapd.c
+, snmplib/snmp_api.c, snmplib/snmp_api.h:
+
+ - snmp_api.?, snmpd.c, snmptrap.c, snmptrapd.c: reinstate agent_addr in
+ the pdu structure (used for v1 traps).
+
+1999-08-19 10:40 nba
+
+ * agent/snmpd.c:
+
+ - snmpd.c: remove some superfluous: from snmp_log_perror.
+ Log when snmpd reconfigures following a SIGHUP
+
+1999-08-19 10:38 nba
+
+ * agent/mibgroup/smux/smux.c:
+
+ - smux.c: remove some extraneous \n from snmp_log_perror calls.
+
+1999-08-19 10:38 nba
+
+ * snmplib/snmp_api.c:
+
+ - snmp_api.c: correcly call pre-parse hook, also when not debugging
+ (this killed the libwrap check in snmpd)
+
+1999-08-19 02:35 nba
+
+ * agent/snmp_agent.c, agent/snmpd.c,
+ snmplib/snmp_logging.c:
+
+ - snmp_logging.c, agent/various: reinstate -a and -V logging (almost).
+ timestamp file and stderr logging.
+
+1999-08-19 02:33 nba
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - interfaces.c: remove some left over debug output
+
+1999-08-18 09:30 nba
+
+ * agent/auto_nlist.c, agent/kernel.c, agent/snmpd.c
+, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/vmstat.c, apps/snmp_parse_args.c
+, apps/snmpdelta.c, apps/snmptrapd.c,
+ apps/snmpnetstat/main.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/snmp_debug.c,
+ snmplib/snmp_logging.c, snmplib/snmp_logging.h,
+ snmplib/snmpv3.c:
+
+ - (many): change the names of the logging functions to be snmp_*
+ default do_stderr_logging to 1.
+
+1999-08-18 09:26 nba
+
+ * agent/mibgroup/mibII/: interfaces.c, interfaces.h:
+
+ - interfaces.?: updates for Linux to handle large counters and virtual
+ interfaces.
+
+1999-08-18 02:51 nba
+
+ * agent/: agent_read_config.c, agent_read_config.h,
+ snmpd.c, mibgroup/ucd-snmp/versioninfo.c:
+
+ - snmpd.c, agent_read_config.?, versioninfo.c: move the reconfiguration
+ outside the signal handler.
+
+1999-08-18 02:40 nba
+
+ * agent/snmpd.c:
+
+ agent/snmpd.c: move the termination processing from the signal handler
+ to after the main loop has terminated.
+
+1999-08-16 15:09 hardaker
+
+ * testing/tests/T100agenthup:
+
+ - (T100agenthup): added new agent capability test to test kill -HUP.
+
+1999-08-16 14:59 nba
+
+ * apps/snmpnetstat/main.c:
+
+ snmpnetstat/main.c: enable_stderrlog() so that we get an error message
+ for bad host names.
+
+1999-08-16 14:58 nba
+
+ * apps/snmpnetstat/if.c:
+
+ snmpnetstat/if.c: allow -i and -o outputs even with incomplete responses
+ from snmpd (such as Linux that does not return ifInNUCastPkts
+ with the new DUMMY setup)
+
+1999-08-13 16:06 hardaker
+
+ * bug-report, version.h, FAQ, README,
+ sedscript.in:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre6 )
+
+1999-08-13 16:05 hardaker
+
+ * remove-files:
+
+ - (remove-files): remove the ISSUES file for releases.
+
+1999-08-13 16:03 hardaker
+
+ * testing/TESTCONF.sh:
+
+ - (TESTCONF.sh): store the peristent data in a temporary file. really.
+
+1999-08-13 15:48 hardaker
+
+ * testing/tests/: T003snmpv1getfail, T016snmpv2cgetfail
+, T017snmpv2ctov1getfail, T018snmpv1tov2cgetfail,
+ T030snmpv3usercreation:
+
+ - (T003snmpv1getfail, T016snmpv2cgetfail, T017snmpv2ctov1getfail,
+ T018snmpv1tov2cgetfail, T030snmpv3usercreation):
+ - fixed to check for "nosuch" errors actually returned.
+ - shortened the snmpusm test description.
+
+1999-08-13 15:35 hardaker
+
+ * Makefile.in:
+
+ - (Makefile.in): don't remove mib_module_loads.h.
+
+1999-08-13 15:22 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): remove config_load_mib parsing.
+
+1999-08-13 12:49 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): properly do what --without-dummy-values
+ should do.
+
+1999-08-13 12:18 mslifcak
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ var_route.c - #ifdef NO_DUMMY --> #if NO_DUMMY (like the other uses).
+
+1999-08-13 11:55 hardaker
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ - (var_route.c): don't do caching for NO_DUMMY_VALUES.
+
+1999-08-13 11:14 mslifcak
+
+ * agent/mibgroup/: host/hr_device.c, host/hr_print.c,
+ host/hr_proc.c, host/hr_storage.c, host/hr_swinst.c
+, host/hr_swrun.c, host/hr_system.c, mibII/at.c
+, mibII/interfaces.c, mibII/ip.c,
+ mibII/system_mib.c, mibII/tcp.c, mibII/udp.c,
+ mibII/var_route.c:
+
+ (host/hr_device.c,host/hr_print.c, host/hr_proc.c,host/hr_storage.c,
+ host/hr_swinst.c,host/hr_swrun.c, host/hr_system.c,mibII/at.c,
+ mibII/interfaces.c,mibII/ip.c, mibII/system_mib.c,mibII/tcp.c,
+ mibII/udp.c,mibII/var_route.c) - #if NO_DUMMY_VALUES (help out configure)
+
+1999-08-13 09:33 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): don't use NO_DUMMY_VALUES by default.
+
+1999-08-13 07:16 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, snmplib/Makefile.in:
+
+ - (Makefile.in, Makefile.in, Makefile.in, Makefile.in): make depend.
+
+1999-08-13 07:12 hardaker
+
+ * NEWS, README.snmpv3, configure, configure.in
+:
+
+ - (NEWS, README.snmpv3, configure, configure.in): documentation updates.
+
+1999-08-13 07:11 hardaker
+
+ * Makefile.in:
+
+ - (Makefile.in): "make test" in top level Makefile.
+
+1999-08-13 02:46 daves
+
+ * agent/mibgroup/: examples/ucdDemoPublic.c,
+ examples/ucdDemoPublic.h, ipfwchains/ipfwchains.c,
+ ipfwchains/ipfwchains.h, misc/ipfwacc.c, misc/ipfwacc.h
+, target/snmpTargetAddrEntry.c,
+ target/snmpTargetAddrEntry.h, target/snmpTargetParamsEntry.c
+, target/snmpTargetParamsEntry.h, smux/snmp_bgp.c
+, smux/snmp_bgp.h, smux/snmp_ospf.c,
+ smux/snmp_ospf.h, smux/snmp_rip2.c, smux/snmp_rip2.h
+:
+
+ - (examples/ucdDemoPublic.[ch]
+ ipfwchains/ipfwchains.[ch] misc/ipfwacc.[ch]
+ target/snmpTarget{Addr,Params}Entry.[ch]
+ smux/snmp_*.[ch]):
+ - Register modules dynamically at run-time
+
+1999-08-13 02:44 daves
+
+ * agent/agent_registry.c:
+
+ - (agent_registry.c): Drop support for 'static' module registration via configure
+
+1999-08-12 16:46 hardaker
+
+ * NEWS, README:
+
+ - (NEWS, README): minor updates.
+
+1999-08-12 16:41 hardaker
+
+ * FAQ, man/snmpcmd.1, man/snmptrap.1:
+
+ - (FAQ, snmpcmd.1, snmptrap.1): minor doc updates.
+
+1999-08-12 16:22 hardaker
+
+ * testing/tests/: Sv3config, T020snmpv3get,
+ T021snmpv3getnext, T030snmpv3usercreation:
+
+ - (Sv3config, T020snmpv3get, T021snmpv3getnext,
+ T030snmpv3usercreation): test updates, including a new snmpusm test.
+
+1999-08-12 16:18 hardaker
+
+ * man/snmpusm.1:
+
+ - (snmpusm.1): no-fill the .conf file entries.
+
+1999-08-12 16:16 hardaker
+
+ * man/snmp.conf.5.def:
+
+ - (snmp.conf.5.def): updated with the newer token list.
+
+1999-08-12 16:15 hardaker
+
+ * man/snmpusm.1:
+
+ - (snmpusm.1): added to describe the snmpusm command.
+
+1999-08-12 09:31 mslifcak
+
+ * snmplib/snmpusm.c:
+
+ -(snmpusm.c) - fix potential repeated "free" on malloc failure.
+
+1999-08-11 21:53 nba
+
+ * apps/snmpnetstat/if.c:
+
+ snmpnetstat/if.c: handle non-contiguous ifTable. Also make the
+ counters unsigned.
+
+1999-08-11 21:52 nba
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ hr_storage.c: remove to forgotten debug lines.
+
+1999-08-11 13:04 hardaker
+
+ * acconfig.h, config.h.in, snmplib/read_config.c
+:
+
+ - (acconfig.h, config.h.in, read_config.c):
+ - Make persistent cache conform to a more secure umask.
+
+1999-08-11 10:50 hardaker
+
+ * README.snmpv3, apps/snmpusm.c:
+
+ - (README.snmpv3, snmpusm.c): use ss session to get probed engineID.
+
+1999-08-10 17:24 hardaker
+
+ * snmplib/lcd_time.c:
+
+ - (lcd_time.c): debugging statements.
+
+1999-08-10 17:23 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): print -H usage to stderr.
+
+1999-08-10 17:23 hardaker
+
+ * README.snmpv3:
+
+ - (README.snmpv3): update.
+
+1999-08-10 15:54 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): force v3 engineID setting to something bogus to
+ get around local configuration data store time synchronization conflicts.
+
+1999-08-10 14:27 hardaker
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ - (usmUser.c): Um, cough, actually register us in the *init* function...
+
+1999-08-10 14:26 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): protect against evil mib modules from modifying
+ memory they shouldn't be modifying yet.
+ - (ifdef'ed for speed profiling later).
+
+1999-08-10 11:05 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): log version number after stderr is optionally closed.
+
+1999-08-10 10:04 mslifcak
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Fix for build (no pagesize var defined for linux).
+
+1999-08-10 09:19 mslifcak
+
+ * snmplib/: read_config.c, snmp_api.c:
+
+ read_config.c, snmp_api.c - convert fprintf(stderr to snmp_log(LOG_ERR,WARNING)
+
+1999-08-10 04:50 nba
+
+ * agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/var_route.c, snmplib/snmp_logging.c
+:
+
+ interfaces.c var_route.c snmp_logging.c: fix compiler warnings
+
+1999-08-10 04:48 nba
+
+ * apps/snmpnetstat/if.c:
+
+ snmpnetstat/if.c: fixes for snmpnetstat -i on virtual interfaces
+
+1999-08-10 04:47 nba
+
+ * agent/kernel.c:
+
+ agent/kernel.c: abort on kvm_open failures
+
+1999-08-10 04:46 nba
+
+ * snmplib/mib.c:
+
+ snmplib/mib.c: fix handling of numeric oids and reporting errors
+
+1999-08-10 04:45 nba
+
+ * configure.in, config.h.in, configure,
+ agent/mibgroup/host/hr_storage.c:
+
+ configure.in config.h.in configure s/netbsd agent/mibgroup/host/hr_storage.c:
+ support for NetBSD/sparc and NetBSD 1.4
+
+1999-08-09 15:07 mslifcak
+
+ * snmplib/: snmp_api.c, snmpusm.c:
+
+ snmpusm.c - always clear field_len if ref is valid ptr;
+ snmp_api.c - don't overwrite community pointer with securityAuthProto pointer
+
+1999-08-09 14:29 hardaker
+
+ * snmplib/snmpusm.c:
+
+ - (snmpusm.c): error check/null set *after* freeing the old memory.
+
+1999-08-09 14:28 hardaker
+
+ * snmplib/snmpusm.c:
+
+ - (snmpusm.c): more error checking in the MAKE_ENTRY macro.
+
+1999-08-09 13:12 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in): remove /dev/random test.
+
+1999-08-09 11:40 mslifcak
+
+ * snmplib/: md5.c, snmp_api.c:
+
+ -(md5.c) fix read past end problem
+ -(snmp_api.c) fix losing community string problem
+
+1999-08-09 10:43 nba
+
+ * agent/mibgroup/kernel_sunos5.c,
+ agent/mibgroup/kernel_sunos5.h,
+ agent/mibgroup/mibII/system_mib.c, apps/Makefile.in,
+ snmplib/snmp_client.c, snmplib/snmp_client.h,
+ snmplib/snmpv3.c:
+
+ (many): nuke various prototype warnings
+
+1999-08-09 09:45 mslifcak
+
+ * snmplib/snmp.c:
+
+ -(snmp.c) fix buffer overflow in xdump, of all places (77 s/b 78; using 80)
+
+1999-08-09 06:54 mslifcak
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ libsnmp.def - remove print_oid_report disable options
+
+1999-08-09 06:52 mslifcak
+
+ * agent/snmpd.c:
+
+ snmpd.c - list all options in usage
+
+1999-08-09 06:50 mslifcak
+
+ * apps/: snmpdelta.c, snmptranslate.c, snmptrapd.c
+:
+
+ snmpdelta, translate, trapd) - list all options in usage; remove disables for print_oid_report in translate.
+
+1999-08-09 06:48 mslifcak
+
+ * snmplib/: mib.c, mib.h, parse.c, parse.h
+:
+
+ mib.*, parse.* - move print_oid_report and minions wholly into mib.c
+
+1999-08-09 01:02 daves
+
+ * FAQ:
+
+ - (FAQ): Nine new questions, plus assorted tweaks for the new release.
+
+1999-08-09 00:24 nba
+
+ * snmplib/parse.c:
+
+ parse.c: parse agent capabilities
+
+1999-08-06 07:36 mslifcak
+
+ * snmplib/: snmp_logging.c, snmp_logging.h:
+
+ -(snmp_logging.*) -added Ragnar's patch #3 with small touches.
+
+1999-08-06 06:02 daves
+
+ * agent/mibgroup/: mibII/at.c, mibII/interfaces.c,
+ mibII/ip.c, mibII/system_mib.c, mibII/tcp.c,
+ mibII/udp.c, mibII/var_route.c, host/hr_device.c
+, host/hr_print.c, host/hr_proc.c,
+ host/hr_storage.c, host/hr_swinst.c, host/hr_swrun.c
+, host/hr_system.c:
+
+ - (mibII/*.c host/*.c): Don't provide "dummy" values (unless explicitly configured)
+
+1999-08-06 05:59 daves
+
+ * acconfig.h, config.h.in, configure.in,
+ configure:
+
+ - (acconfig.h config.h.in configure.in configure):
+ - configure-time flag to control provision of "dummy" values
+
+1999-08-05 11:11 mslifcak
+
+ * man/snmp_api.3:
+
+ snmp_api.3 - describe snmp_error(), replaces snmp_errno and snmp_get_errno()
+
+1999-08-05 10:44 mslifcak
+
+ * agent/mibgroup/agentx/client.c:
+
+ agentx/client.c - remove refs to snmp_synch{setup,reset} original version
+
+1999-08-05 03:25 mslifcak
+
+ * config.sub:
+
+ config.sub - patch from Markku Laukkanen to support HPUX 11
+
+1999-08-04 12:33 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ snmp_api.c - dummy functions snmp_synch_{setup,reset} and snmp_get_errno.
+
+1999-08-04 09:17 mslifcak
+
+ * configure, configure.in:
+
+ -(configure*) - Ken Hornstein: fix test xxgethostbyname, xxgetservbyname.
+
+1999-08-04 05:03 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ undo patch around Solaris' configure failure to register HAVE_GETHOSTBYNAME.
+
+1999-08-04 03:48 mslifcak
+
+ * agent/mibgroup/smux/smux.c:
+
+ -(smux.c) - patch supplied by Nick Amato to fix ASN_IPADDRESS parse.
+
+1999-08-04 01:46 daves
+
+ * mibs/UCD-DEMO-MIB.txt:
+
+ - (mibs/UCD-DEMO-MIB.txt): Re-resolve file & ucdDemo OID conflict
+
+1999-08-03 14:06 mslifcak
+
+ * snmplib/snmp_debug.c:
+
+ snmp_debug.c - signed comparison for len in debugmsg_hextli.
+
+1999-08-03 12:53 mslifcak
+
+ * snmplib/snmp_debug.h:
+
+ snmp_debug.h - fix "warning: ANSI C forbids conditional expr with only one void side".
+
+1999-08-03 08:37 mslifcak
+
+ * README.win32:
+
+ README.win32 - runtime lib and debug info courtesy of Robert Story.
+
+1999-08-03 07:58 mslifcak
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ vacm_vars.c - copy community string, null terminate, then debug print
+
+1999-08-03 07:03 mslifcak
+
+ * snmplib/snmp_debug.h:
+
+ snmp_debug.h - move DEBUGTRACE from debugmsg_hextli to DEBUGDUMPSETUP
+
+1999-08-03 07:00 mslifcak
+
+ * snmplib/snmp_debug.c:
+
+ snmp_debug.c - remove trace messages from debugmsg_hextli.
+
+1999-08-03 06:59 mslifcak
+
+ * snmplib/asn1.c:
+
+ asn1.c - fix out-of-bound array write and memory leak in parsing strings.
+
+1999-08-03 04:46 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ snmp_api.c - remove "BY" from HAVE_GETHOSTBYNAME (Solaris 2.5.1 wrong!)
+
+1999-08-02 22:29 mslifcak
+
+ * snmplib/snmp_debug.h:
+
+ snmp_debug - DEBUGMSG macros call snmp_get_do_debugging before invoking debugmsg* functions.
+
+1999-08-02 04:37 mslifcak
+
+ * snmplib/parse.c:
+
+ parse - shame on me for not compile testing first!
+
+1999-08-02 04:29 mslifcak
+
+ * snmplib/: asn1.c, parse.c:
+
+ asn1, parse) fixes supplied by Markku Laukkanen (MJS-use xcalloc in parse)
+
+1999-07-30 14:19 hardaker
+
+ * version.h, bug-report, sedscript.in, README
+, FAQ:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre5 )
+
+1999-07-30 14:18 hardaker
+
+ * agent/Makefile.in, apps/Makefile.in,
+ snmplib/Makefile.in, agent/mibgroup/Makefile.in:
+
+ - (*/Makefile.in): make depend
+
+1999-07-30 14:10 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): make /var/ucd-snmp exist. We should do a permission
+ set as well.
+
+1999-07-30 14:10 hardaker
+
+ * config.h.in:
+
+ - (config.h.in): autoheader run.
+
+1999-07-30 14:09 hardaker
+
+ * README.snmpv3:
+
+ - (README.snmpv3): generic v3 instructions, but has errors.
+
+1999-07-30 08:32 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ no struct sockaddr_dl in AIX 3.
+
+1999-07-30 08:01 mslifcak
+
+ * config.h.in, configure, configure.in:
+
+ add vsnprintf check and HAVE_VSNPRINTF constant
+
+1999-07-30 07:31 daves
+
+ * acconfig.h:
+
+ - (acconfig.h): Check for libdb/libdb1 & librpm separately
+
+1999-07-30 07:01 daves
+
+ * configure, configure.in:
+
+ - (configure.in configure): Check for libdb/libdb1 & librpm separately
+
+1999-07-30 06:58 mslifcak
+
+ * agent/Makefile.in:
+
+ remove references to non-existent snmp_vars_m2m.h
+
+1999-07-30 06:46 mslifcak
+
+ * agent/mibgroup/agentx/master_request.c,
+ apps/encode_keychange.c, snmplib/snmp_debug.c,
+ snmplib/system.h:
+
+ use traditional K&R commenting; not all "C" compilers accept "//" comments.
+
+1999-07-30 06:30 mslifcak
+
+ * win32/config.h:
+
+ win32/config.h - define HAVE_GETHOSTNAME
+
+1999-07-30 06:30 mslifcak
+
+ * snmplib/system.c:
+
+ system - use sizeof
+
+1999-07-30 06:30 mslifcak
+
+ * snmplib/snmpv3.c:
+
+ snmpv3 - key off HAVE_GETHOSTNAME; use sizeof buf
+
+1999-07-30 06:23 daves
+
+ * agent/: agent_read_config.c, agent_registry.c,
+ snmp_vars.c, snmp_vars_m2m.h:
+
+ - (agent_read_config.c agent_registry.c snmp_vars.c snmp_vars_m2m.h):
+ - Removed last traces of obsolete v2party Manager-to-Manager support
+
+1999-07-30 06:19 mslifcak
+
+ * snmplib/snmpv3.c:
+
+ snmpv3 - wrap possibly unused vars in #ifdef HAVE_GETHOSTNAME
+
+1999-07-30 06:00 daves
+
+ * agent/agent_registry.c, agent/snmp_vars.c,
+ agent/snmpd.c, agent/mibgroup/v2party.c,
+ agent/mibgroup/v2party.h, apps/snmp_parse_args.c,
+ apps/snmptest.c, apps/snmptrap.c, apps/snmptrapd.c
+, apps/snmpnetstat/main.c, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmp_client.c:
+
+ - (agent/agent_registry.c agent/snmp_vars.c agent/snmpd.c
+ apps/snmp_parse_args.c apps/snmptest.c apps/snmptrap.c
+ apps/snmptrapd.c apps/snmpnetstat/main.c snmplib/snmp_api.c
+ snmplib/snmp_api.h snmplib/snmp_client.c
+ agent/mibgroup/v2party.c agent/mibgroup/v2party.h):
+ - Removed last traces of v2p support
+
+1999-07-30 05:42 mslifcak
+
+ * README.win32, agent/Makefile.in,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swrun.c:
+
+ hr_storage.c - auto_nlist for HR_STORE_SIZE
+ hr_swrun.c - fix global shadow decl
+ snmp_logging.c - change filter for openlog per A. Symons patch
+
+1999-07-30 04:42 mslifcak
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ rename sd to ifsd - avoid global shadow decl
+
+1999-07-30 04:39 mslifcak
+
+ * apps/snmptrapd.c:
+
+ decl log_perror
+
+1999-07-30 04:37 mslifcak
+
+ * snmplib/parse.c:
+
+ rename local var 'last' to 'last_ipch' - avoid shadow global decl
+
+1999-07-30 04:00 mslifcak
+
+ * agent/agent_read_config.c, agent/history.c,
+ agent/snmp_vars.c, agent/snmpd.c,
+ snmplib/read_config.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmpv3.c,
+ snmplib/system.c:
+
+ -(agent/agent_read_config.c,agent/history.c,agent/snmp_vars.c,
+ agent/snmpd.c,snmplib/read_config.c,snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c,snmplib/snmp_logging.c,snmplib/snmpv3.c,
+ snmplib/system.c) - psos diffs offered by Anthony Symons
+
+1999-07-30 03:57 mslifcak
+
+ * acconfig.h, config.h.in:
+
+ Removed hint of v2party from comment.
+
+1999-07-30 03:51 mslifcak
+
+ * acconfig.h, config.h.in:
+
+ Removed duplicate HAVE_GET???BYNAME; Removed unused _CRTIMP
+
+1999-07-30 03:48 mslifcak
+
+ * README.win32:
+
+ README.win32 - cleaned up, added more acknowledgements
+
+1999-07-29 17:08 hardaker
+
+ * agent/mibgroup/agentxx.h:
+
+ - (agentxx.h): removed
+
+1999-07-29 17:06 hardaker
+
+ * agent/mibgroup/v2party/: acl_vars.c, acl_vars.h,
+ alarm.c, alarm.h, context_vars.c,
+ context_vars.h, event.c, event.h, party_vars.c
+, party_vars.h, view_vars.c, view_vars.h:
+
+ - (mibgroup/v2party): removed files.
+
+1999-07-29 17:03 hardaker
+
+ * configure, configure.in, apps/Makefile.in:
+
+ - (configure, configure.in, Makefile.in): remove trap_special stuff.
+
+1999-07-29 16:05 mslifcak
+
+ * snmplib/snmp_logging.c:
+
+ use fputs, as vsprintf has already done the hard work.
+
+1999-07-29 15:58 mslifcak
+
+ * snmplib/snmp_logging.c:
+
+ flush file and stderr after write.
+
+1999-07-29 15:50 mslifcak
+
+ * snmplib/: snmp_logging.c, snmp_logging.h:
+
+ -(snmp_logging) incorporate Ragnar's improvements with interest
+
+1999-07-29 15:04 mslifcak
+
+ * agent/: auto_nlist.c, kernel.c:
+
+ auto_nlist, kernel: place log_perror to catch errno value in report.
+
+1999-07-29 13:59 mslifcak
+
+ * agent/snmpd.c:
+
+ -(agent/snmpd.c) - log standard error until init is completed.
+
+1999-07-29 13:28 mslifcak
+
+ * apps/Makefile.in:
+
+ -(apps/Makefile.in) - comment unneeded TRAPSPECIAL line
+
+1999-07-29 12:51 mslifcak
+
+ * snmplib/snmp_logging.c:
+
+ -(snmp_logging) - fix log_perror
+
+1999-07-29 08:34 mslifcak
+
+ * agent/mibgroup/: kernel_sunos5.c,
+ ucd-snmp/memory_solaris2.c:
+
+ memory_solaris2: handle malloc errors
+ kernel_sunos5: share kstat fildes [SHARE_KSTAT_FD]
+
+1999-07-29 03:29 daves
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - (mibII/vacm_vars.c): Catch use of unconfigured EXAMPLE.conf files
+
+1999-07-28 13:33 mslifcak
+
+ * README.win32:
+
+ -README.win32 - build guide for Win32. Cygwin friendly script included.
+
+1999-07-28 09:41 mslifcak
+
+ * snmplib/snmp_logging.c:
+
+ snmp_logging.c: adjust headers for that Win32 platform.
+
+1999-07-28 09:05 mslifcak
+
+ * snmplib/snmp_logging.c:
+
+ -(snmp_logging) Support hpux9 and solaris2.5.1 with vsprintf instead.
+
+1999-07-28 06:45 hardaker
+
+ * bug-report:
+
+ - (bug-report): change mail addr to ucd-snmp-bugs
+
+1999-07-28 02:42 mslifcak
+
+ * agent/mibgroup/host/hr_swrun.c, snmplib/snmp_logging.c
+:
+
+ hr_swrun - reset pointer in module init (help HP/UX 9)
+ snmp_logging - use vsprintf for HP/UX-9
+
+1999-07-27 23:58 mslifcak
+
+ * snmplib/: keytools.c, md5.c, md5.h, scapi.c
+, snmp.c, snmp_api.c, snmp_auth.c:
+
+ -(keytools.c,md5.c,md5.h,scapi.c,snmp.c,snmp_api.c,snmp_auth.c) catch MD5 errors
+
+1999-07-27 23:34 mslifcak
+
+ * agent/snmpd.c:
+
+ -(snmpd.c) invoke log functions from child (correct process ID in syslog)
+
+1999-07-27 21:30 mslifcak
+
+ * snmplib/snmp_logging.c:
+
+ -(snmp_logging.c) fix syslog by vsnprintf to buffer.
+
+1999-07-27 19:06 mslifcak
+
+ * snmplib/mib.c:
+
+ -(mib.c) fix walking OID length pointer, numeric sub-id not found
+ in read_objid and parse_subtree.
+
+1999-07-27 19:02 mslifcak
+
+ * apps/snmp_parse_args.c:
+
+ -(snmp_parse_args) in snmp_parse_oid, try get_node if read_objid fails.
+
+1999-07-27 17:15 mslifcak
+
+ * snmplib/asn1.c:
+
+ including mib.h requires stdio.h to define FILE *.
+
+1999-07-27 16:20 hardaker
+
+ * snmplib/asn1.c:
+
+ - (asn1.c): fix header dump.
+
+1999-07-27 16:14 hardaker
+
+ * snmplib/: asn1.c, mib.c, mib.h, snmp_api.c
+, snmp_debug.c, snmp_debug.h, snmpusm.c:
+
+ - (asn1.c, mib.c, mib.h, snmp_api.c, snmp_debug.c, snmp_debug.h, snmpusm.c):
+ - cleaned up debugging dump output.
+ - added more dump parse headers for v3 dumps.
+
+1999-07-27 16:06 mslifcak
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ -(interfaces.c) - fix error setting if_ibytes for Linux 2.0
+
+1999-07-27 12:23 mslifcak
+
+ * apps/encode_keychange.c, apps/snmpdelta.c,
+ apps/snmptable.c, apps/snmpusm.c,
+ snmplib/read_config.c, snmplib/snmpv3.c,
+ win32/libsnmp_dll/libsnmp.def:
+
+ -(apps:encode_keychange.c,snmpdelta.c,snmptable.c, snmpusm.c;
+ snmplib:read_config.c,snmpv3.c; win32/libsnmp_dll/libsnmp.def) -
+ adjust headers, build Win32 snmpusm+encode_keychange
+
+1999-07-27 12:00 mslifcak
+
+ * win32/: win32.dsw, encode_keychange/encode_keychange.dsp
+, snmpusm/snmpusm.dsp:
+
+ -(encode_keychange.dsp,snmpusm.dsp) -build using common Win32 compiler
+
+1999-07-27 09:40 mslifcak
+
+ * agent/mibgroup/agentx/: master.c, subagent.c:
+
+ -(master.c, subagent.c) un-comment init_master and init_subagent.
+
+1999-07-27 09:32 mslifcak
+
+ * agent/kernel.c, agent/snmpd.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/agentx/master.c
+, agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/host/hr_swrun.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/event.c, apps/snmpbulkwalk.c,
+ apps/snmpdelta.c, apps/snmpget.c, apps/snmpgetnext.c
+, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c, apps/snmptrap.c
+, apps/snmptrapd.c, apps/snmpusm.c,
+ apps/snmpwalk.c, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/route.c,
+ snmplib/parse.c, snmplib/read_config.c,
+ snmplib/snmpv3.c:
+
+ -(agent/kernel.c,agent/snmpd.c,agent/mibgroup/util_funcs.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/host/hr_swrun.c,agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/icmp.c,agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/route_write.c,agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c,agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/v2party/alarm.c,agent/mibgroup/v2party/event.c,
+ apps/snmpbulkwalk.c,apps/snmpdelta.c,apps/snmpget.c,
+ apps/snmpgetnext.c,apps/snmpset.c,apps/snmpstatus.c,
+ apps/snmptable.c,apps/snmptest.c,apps/snmptrap.c,
+ apps/snmptrapd.c,apps/snmpusm.c,apps/snmpwalk.c,
+ apps/snmpnetstat/inet.c,apps/snmpnetstat/main.c,
+ apps/snmpnetstat/route.c,snmplib/parse.c,snmplib/read_config.c,
+ snmplib/snmpv3.c) fix snmp_sess_perror use; use log_perror for perror
+
+1999-07-27 07:50 mslifcak
+
+ * agent/kernel.c, agent/dlmods/dlmod_mib.c,
+ agent/dlmods/example.c, agent/mibgroup/kernel_sunos5.c
+, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/dummy/dummy.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/examples/wombat.c,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_proc.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/ipfwchains/ipfwchains.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/icmp.c
+, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/misc/dlmod.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/v2party/acl_vars.c,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/context_vars.c,
+ agent/mibgroup/v2party/event.c,
+ agent/mibgroup/v2party/party_vars.c,
+ agent/mibgroup/v2party/view_vars.c, apps/encode_keychange.c
+, snmplib/asn1.c, snmplib/scapi.c,
+ snmplib/snmp_client.c, snmplib/snmp_client.h:
+
+ -(agent/kernel.c,agent/dlmods/dlmod_mib.c,agent/dlmods/example.c,
+ agent/mibgroup/kernel_sunos5.c,agent/mibgroup/util_funcs.c,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/protocol.c,agent/mibgroup/dummy/dummy.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/examples/wombat.c,
+ agent/mibgroup/host/hr_device.c,agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c,agent/mibgroup/host/hr_proc.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/ipfwchains/ipfwchains.c,
+ agent/mibgroup/mibII/at.c,agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c,agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c,agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/misc/dlmod.c,agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/v2party/acl_vars.c,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/context_vars.c,
+ agent/mibgroup/v2party/event.c,
+ agent/mibgroup/v2party/party_vars.c,
+ agent/mibgroup/v2party/view_vars.c,apps/encode_keychange.c,
+ snmplib/asn1.c,snmplib/scapi.c,snmplib/snmp_client.c,
+ snmplib/snmp_client.h) ERROR_MSG, printf --> DEBUGMSGTL
+
+1999-07-27 06:38 daves
+
+ * agent/mibgroup/ucd-snmp/: disk.c, errormib.c,
+ extensible.c, file.c, hpux.c, loadave.c,
+ memory.c, memory_freebsd2.c, memory_solaris2.c,
+ registry.c:
+
+ - (agent/mibgroup/ucd-snmp/*.c): tweak registry labels
+
+1999-07-27 04:24 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ add include net/if_dl.h suggested by Tom Ivar Helbekkmo
+
+1999-07-26 17:14 hardaker
+
+ * snmplib/scapi.h:
+
+ - (scapi.h): Patch from Markku Laukkanen:
+ - size_t fix.
+
+1999-07-26 17:07 hardaker
+
+ * snmplib/: keytools.c, keytools.h, parse.c,
+ scapi.c:
+
+ - (keytools.c, keytools.h, parse.c, scapi.c): Patch from Markku Laukkanen:
+ - size_t changes.
+
+1999-07-26 17:06 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c): Patch from Markku Laukkanen:
+ - variable naming change.
+
+1999-07-26 15:59 hardaker
+
+ * agent/mibgroup/Makefile.in:
+
+ - (agent/mibgroup/Makefile.in): fix make depend.
+
+1999-07-26 15:12 mslifcak
+
+ * snmplib/: asn1.c, asn1.h, snmp.c, snmp_api.c
+, snmp_auth.c, snmpusm.c:
+
+ -(asn1.c,asn1.h,snmp.c,snmp_api.c,snmp_auth.c,snmpusm.c) more detailed parse error messages.
+
+1999-07-26 14:32 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): BIT_string: -> BITS:
+
+1999-07-26 11:51 hardaker
+
+ * bug-report, version.h, FAQ, README,
+ sedscript.in:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre4 )
+
+1999-07-26 09:14 hardaker
+
+ * NEWS:
+
+ - (NEWS): updated a bit
+
+1999-07-26 09:03 hardaker
+
+ * agent/Makefile.in, apps/Makefile.in,
+ snmplib/Makefile.in, testing/Makefile.in,
+ agent/mibgroup/Makefile.in, apps/snmpnetstat/Makefile.in
+:
+
+ - (*/Makefile.in): make depend
+
+1999-07-26 07:37 hardaker
+
+ * mibs/SNMPv2-CONF.txt:
+
+ - (SNMPv2-CONF.txt): removed bogus IMPORTS clause
+
+1999-07-24 08:11 mslifcak
+
+ * snmplib/md5.c:
+
+ -(md5.c) - wrap unused MD5print with SNMP_TESTING_CODE ifdef
+
+1999-07-24 08:05 mslifcak
+
+ * snmplib/: callback.h, default_store.h, snmp_alarm.h
+, snmp_logging.h:
+
+ -(callback.h,default_store.h,snmp_alarm.h,snmp_logging.h) extern "C" wrapped
+
+1999-07-24 07:45 mslifcak
+
+ * snmplib/snmp_client.c:
+
+ -(snmp_client.c) - use SET_SNMP_ERROR for restored snmp_errno sets.
+
+1999-07-24 07:18 mslifcak
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ -(libsnmp.def) - add decls for new error logging functions.
+
+1999-07-24 07:11 mslifcak
+
+ * snmplib/asn1.c:
+
+ -(asn1.c) - fix compare error at line 386; remove unused vars elsewhere
+
+1999-07-23 15:21 hardaker
+
+ * apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, apps/snmptable.c,
+ apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmpusm.c
+, apps/snmpwalk.c, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmp_client.c:
+
+ - (snmpbulkwalk.c, snmpdelta.c, snmpget.c, snmpgetnext.c, snmpset.c,
+ snmpstatus.c, snmptable.c, snmptest.c, snmptranslate.c, snmptrap.c,
+ snmptrapd.c, snmpusm.c, snmpwalk.c, snmp_api.c, snmp_api.h,
+ snmp_client.c):
+ - make and use snmp_sess_perror(str, sess) for error printing.
+
+1999-07-23 14:31 hardaker
+
+ * testing/: T.sh, T2.sh, demo.remote, demo2
+, demo2.functions, demo2.setupfile:
+
+ - (T.sh, T2.sh, demo.remote, demo2, demo2.functions, demo2.setupfile):
+ - removed some un-needed older demo files.
+
+1999-07-23 14:27 hardaker
+
+ * testing/: TESTCONF.sh, eval_tools.sh,
+ tests/T001snmpv1get, tests/T002snmpv1getnext,
+ tests/T003snmpv1getfail, tests/T014snmpv2cget,
+ tests/T015snmpv2cgetnext, tests/T016snmpv2cgetfail,
+ tests/T017snmpv2ctov1getfail, tests/T018snmpv1tov2cgetfail
+, tests/T020snmpv3get, tests/T021snmpv3getnext,
+ tests/T022snmpv3getMD5, tests/T023snmpv3getMD5DES:
+
+ - (TESTCONF.sh, eval_tools.sh, T001snmpv1get, T002snmpv1getnext,
+ T003snmpv1getfail, T014snmpv2cget, T015snmpv2cgetnext,
+ T016snmpv2cgetfail, T017snmpv2ctov1getfail, T018snmpv1tov2cgetfail,
+ T020snmpv3get, T021snmpv3getnext, T022snmpv3getMD5,
+ T023snmpv3getMD5DES): support a SNMP_FLAGS env variable.
+
+1999-07-23 14:26 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): init debugging.
+
+1999-07-23 14:19 hardaker
+
+ * snmplib/: asn1.c, asn1.h, snmp.c, snmp_api.c
+, snmp_auth.c, snmp_impl.h:
+
+ - (asn1.c, asn1.h, snmp.c, snmp_api.c, snmp_auth.c, snmp_impl.h):
+ - revert to non-dparse versions of asn decoding.
+
+1999-07-23 13:21 hardaker
+
+ * testing/eval_tools.sh:
+
+ - (eval_tools.sh): a little more verbose about what is running.
+
+1999-07-23 13:20 hardaker
+
+ * snmplib/: keytools.c, parse.c, read_config.c
+, snmp_api.c:
+
+ - (keytools.c, parse.c, read_config.c, snmp_api.c): snmp_log conversions.
+
+1999-07-23 13:20 hardaker
+
+ * snmplib/snmp.c:
+
+ - (snmp.c): xdump fixes.
+
+1999-07-23 13:19 hardaker
+
+ * snmplib/asn1.c:
+
+ - (asn1.c): null terminate parsed strings, just in case.
+
+1999-07-23 13:18 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ - (util_funcs.c): change malloc size().
+
+1999-07-23 13:18 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): more snmp_log conversions.
+
+1999-07-23 13:17 hardaker
+
+ * agent/agent_registry.h:
+
+ - (agent_registry.h): added for a prototype definition.
+
+1999-07-23 10:42 hardaker
+
+ * aclocal.m4, config.h.in, configure,
+ configure.in, agent/snmp_agent.c, agent/snmp_vars.c
+, agent/snmpd.c, agent/mibgroup/kernel_sunos5.c
+, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ apps/snmptrapd.c, mibs/HOST-RESOURCES-MIB.txt,
+ mibs/IANAifType-MIB.txt, mibs/IF-MIB.txt,
+ mibs/IP-MIB.txt, mibs/TCP-MIB.txt, mibs/UDP-MIB.txt
+, snmplib/parse.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_logging.c, snmplib/snmp_logging.h:
+
+ - (aclocal.m4, config.h.in, configure, configure.in, snmp_agent.c,
+ snmp_vars.c, snmpd.c, kernel_sunos5.c, util_funcs.c, interfaces.c,
+ interfaces.h, system_mib.c, var_route.c, snmpEngine.c,
+ snmpTargetParamsEntry.c, snmptrapd.c, HOST-RESOURCES-MIB.txt,
+ IANAifType-MIB.txt, IF-MIB.txt, IP-MIB.txt, TCP-MIB.txt,
+ UDP-MIB.txt, parse.c, snmp_alarm.c, snmp_logging.c, snmp_logging.h):
+ - merge from V3-line post 3.6.2 to current.
+ - misc bug fixes.
+ - make apps turn on stderr logging by default.
+
+1999-07-23 10:36 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): log to stderr.
+
+1999-07-21 16:06 hardaker
+
+ * local/: mib2c, mib2c.storage.conf, tkmib:
+
+ - (tkmib, mib2c): udpate to use indexes (requires a perl patch.
+
+1999-07-20 19:33 mslifcak
+
+ * apps/snmptest.c, snmplib/snmp_api.c:
+
+ - no printf in ascii_to_binary
+
+1999-07-20 18:11 mslifcak
+
+ * agent/mibgroup/util_funcs.c, snmplib/asn1.c,
+ snmplib/snmp_alarm.c, snmplib/snmp_debug.c,
+ snmplib/snmp_logging.c, snmplib/snmp_logging.h,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/libsnmp.def
+, win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ -minor changes to build Win32 platforms using CygWin-egcs and MSVC compilers.
+
+1999-07-20 17:07 hardaker
+
+ * snmplib/: snmp_logging.c, snmp_logging.h:
+
+ - (snmp_logging.c, snmp_logging.h): -Wall fixes (ANSI).
+
+1999-07-20 17:05 hardaker
+
+ * agent/: auto_nlist.c, snmp_agent.c, snmpd.c
+, dlmods/dlmod_mib.c, mibgroup/kernel_sunos5.c
+, mibgroup/ipfwchains/ipfwchains.c,
+ mibgroup/mibII/interfaces.c, mibgroup/misc/dlmod.c,
+ mibgroup/smux/smux.c, mibgroup/ucd-snmp/versioninfo.c
+, mibgroup/v2party/alarm.c:
+
+ - (auto_nlist.c, snmp_agent.c, snmpd.c, dlmod_mib.c, kernel_sunos5.c,
+ ipfwchains.c, interfaces.c, dlmod.c, smux.c, versioninfo.c,
+ alarm.c):
+ - convert snmp_log(LOG_DEBUG) to DEBUGMSGTL().
+
+1999-07-20 14:00 hardaker
+
+ * agent/auto_nlist.c, agent/history.c, agent/kernel.c
+, agent/snmp_agent.c, agent/snmpd.c,
+ agent/dlmods/dlmod_mib.c, agent/mibgroup/kernel_sunos5.c
+, agent/mibgroup/mibincl.h,
+ agent/mibgroup/util_funcs.c,
+ agent/mibgroup/ipfwchains/ipfwchains.c,
+ agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/interfaces.c
+, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/misc/dlmod.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/event.c, snmplib/Makefile.in,
+ snmplib/parse.c, snmplib/snmp.c, snmplib/snmp_debug.c
+, snmplib/snmp_logging.c, snmplib/snmp_logging.h:
+
+ - (auto_nlist.c, history.c, kernel.c, snmp_agent.c, snmpd.c,
+ dlmod_mib.c, kernel_sunos5.c, mibincl.h, util_funcs.c, ipfwchains.c,
+ at.c, interfaces.c, ip.c, route_write.c, system_mib.c, tcp.c, udp.c,
+ vacm_vars.c, var_route.c, dlmod.c, smux.c, disk.c, extensible.c,
+ loadave.c, memory_solaris2.c, pass.c, pass_persist.c, proc.c,
+ versioninfo.c, alarm.c, event.c, Makefile.in, parse.c, snmp.c,
+ snmp_debug.c, snmp_logging.c, snmp_logging.h): Patch from Ragnar
+ Kjॆआà¤rstad:
+ - do file, stderr, and syslog support.
+
+1999-07-15 08:45 hardaker
+
+ * snmplib/: asn1.c, snmp_api.c, snmp_auth.c,
+ snmp_debug.c, snmp_debug.h:
+
+ - (asn1.c, snmp_api.c, snmp_auth.c, snmp_debug.c, snmp_debug.h):
+ - beginning of a -Ddump version of packet dumping.
+ - needs a lot more work and clean up.
+ - I need comments... Tell me what you think...
+
+1999-07-15 08:44 hardaker
+
+ * snmplib/tools.c:
+
+ - (tools.c): include arpa/inet.h.
+
+1999-07-14 13:46 mslifcak
+
+ * snmplib/mib.c:
+
+ -(snmplib/mib.c) - conditionally allow for not setting snmp_errno
+
+1999-07-14 13:14 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ -(snmp_api.c) - snmp_add_var returns SNMPERR; MAY set snmp_errno
+
+1999-07-14 07:19 daves
+
+ * agent/mibgroup/agentx/README.agentx:
+
+ - (agent/mibgroup/agentx/README.agentx): Warning - here be dragons....
+
+1999-07-12 08:32 daves
+
+ * agent/mibgroup/host/: hr_device.c, hr_device.h,
+ hr_disk.c, hr_disk.h, hr_filesys.c,
+ hr_filesys.h, hr_network.c, hr_network.h,
+ hr_partition.c, hr_partition.h, hr_print.c,
+ hr_print.h, hr_proc.c, hr_proc.h, hr_storage.c
+, hr_storage.h, hr_swinst.c, hr_swinst.h,
+ hr_swrun.c, hr_swrun.h, hr_system.c,
+ hr_system.h:
+
+ - (mibgroup/host/*): Dynamically register all Host Resource modules
+
+1999-07-12 07:14 daves
+
+ * agent/mibgroup/Makefile.in:
+
+ - (agent/mibgroup/Makefile.in): remove dependency on snmplib/agentx.h
+
+1999-07-11 18:35 mslifcak
+
+ * agent/agent_registry.c, agent/snmp_agent.c,
+ agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/protocol.c,
+ agent/mibgroup/mibII/system_mib.c, apps/encode_keychange.c
+, snmplib/keytools.c, snmplib/mib.c,
+ snmplib/read_config.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_client.c, snmplib/snmp_client.h:
+
+ Reduce use of snmp_errno - fix memory leak, unused vars, and unset var.
+
+1999-07-09 16:21 hardaker
+
+ * snmplib/snmp_alarm.c:
+
+ - (snmp_alarm.c): fix clientreg error.
+
+1999-07-09 14:19 mslifcak
+
+ * agent/mibgroup/mibII/var_route.c, apps/snmptranslate.c
+, apps/snmpnetstat/main.c, snmplib/asn1.c,
+ snmplib/default_store.c, snmplib/scapi.c,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/system.h, win32/libsnmp/libsnmp.dsp,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ -(win32,snmplib,apps,agent) add snmp_socket_length to hide sockaddr_un; Win32 touchups
+
+1999-07-09 12:12 mslifcak
+
+ * README.thread, apps/snmpbulkwalk.c, apps/snmpdelta.c
+, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpset.c, apps/snmpstatus.c, apps/snmptable.c
+, apps/snmptest.c, apps/snmptrap.c,
+ apps/snmpusm.c, apps/snmpwalk.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/route.c,
+ man/snmp_sess_api.3, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmp_client.c,
+ snmplib/snmp_client.h, win32/libsnmp_dll/libsnmp.def:
+
+ -(snmp_client.*) remove snmp_synch_setup, snmp_synch_reset
+
+1999-07-09 08:35 daves
+
+ * snmplib/: agentx.c, agentx.h, agentx_client.c:
+
+ - (snmplib/agentx*): Moved AgentX handling out of the main SNMP library
+
+1999-07-09 08:34 daves
+
+ * agent/mibgroup/: agentx.h, agentx/client.c,
+ agentx/client.h, agentx/master.c, agentx/master.h
+, agentx/master_admin.c, agentx/master_request.c,
+ agentx/protocol.c, agentx/protocol.h, agentx/subagent.c
+, agentx/subagent.h:
+
+ - (agent/mibgroup/agentx.h agent/mibgroup/agentx/*):
+ - Move AgentX protocol handling to a (mostly) self-contained module
+
+1999-07-09 08:27 daves
+
+ * snmplib/Makefile.in, snmplib/snmp_api.c,
+ agent/Makefile.in, agent/agent_registry.c,
+ agent/snmp_agent.c, agent/snmp_agent.h,
+ agent/snmp_vars.c, agent/snmp_vars.h, agent/snmpd.c
+, agent/snmpd.h, agent/mibgroup/mibII/sysORTable.c
+, apps/Makefile.in, apps/snmpnetstat/Makefile.in
+:
+
+ - (*/Makefile.in snmplib/snmp_api.c
+ agent/agent_registry.c agent/snmp_agent.[ch] agent/snmp_vars.[ch]
+ agent/snmpd.[ch] agent/mibgroup/mibII/sysORTable.c):
+ - Move AgentX handling out of the main SNMP library
+
+1999-07-09 01:49 daves
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Clean up gid/uid change logging
+
+1999-07-08 16:02 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Patch from Ragnar Kjॆआà¤rstad:
+ - Add options for switching to a given uid and gid.
+
+1999-07-08 15:16 hardaker
+
+ * apps/snmpdelta.c, snmplib/int64.c, snmplib/int64.h
+:
+
+ - (snmpdelta.c, int64.c, int64.h): minimal c64 support for snmpdelta. Untested.
+
+1999-07-08 14:48 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in, testing/Makefile.in:
+
+ - (*/Makefile.in): make depend
+
+1999-07-08 14:35 hardaker
+
+ * configure, configure.in, agent/Makefile.in
+, agent/snmp2p.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c,
+ agent/view_parse.c, agent/mibgroup/mibII/vacm_vars.c,
+ apps/snmp_parse_args.c, apps/snmptrapd.c,
+ apps/snmptrapd_handlers.c, apps/snmpnetstat/main.c,
+ snmplib/Makefile.in, snmplib/acl.c, snmplib/acl.h
+, snmplib/acl_parse.c, snmplib/context.c,
+ snmplib/context.h, snmplib/context_parse.c,
+ snmplib/libsnmp.h, snmplib/party.c, snmplib/party.h
+, snmplib/party_parse.c, snmplib/snmp.h,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/view.c, snmplib/view.h
+:
+
+ - (configure, configure.in, Makefile.in, snmp2p.c, snmp_agent.c,
+ snmp_vars.c, snmpd.c, view_parse.c, vacm_vars.c, snmp_parse_args.c,
+ snmptrapd.c, snmptrapd_handlers.c, main.c, Makefile.in, acl.c,
+ acl.h, acl_parse.c, context.c, context.h, context_parse.c,
+ libsnmp.h, party.c, party.h, party_parse.c, snmp.h, snmp_api.c,
+ snmp_auth.c, snmp_client.c, view.c, view.h):
+ - v2party support is finally gone!
+
+1999-07-08 14:30 hardaker
+
+ * snmplib/asn1.c:
+
+ - (asn1.c): -Wall fixes.
+
+1999-07-08 14:30 hardaker
+
+ * snmplib/: agentx.c, agentx.h:
+
+ - (agentx.c, agentx.h): -Wall fixes.
+
+1999-07-08 14:29 hardaker
+
+ * win32/config.h:
+
+ - (config.h): comment change for internal md5.
+
+1999-07-08 14:29 hardaker
+
+ * snmplib/tools.c:
+
+ - (tools.c): typo in #ifdef.
+
+1999-07-08 06:25 daves
+
+ * agent/mibgroup/mibII/: snmp_mib.c, system_mib.c:
+
+ - (mibII/system_mib.c mibII/snmp_mib.c):
+ - Update 'write' routines for V4 architecture,
+ and using the full SET multi-pass algorithm
+
+1999-07-08 02:16 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Retain community string in responses
+
+1999-07-07 06:54 daves
+
+ * snmplib/: asn1.c, asn1.h, snmp.c, snmp.h
+, snmp_api.c, snmp_api.h, snmp_auth.c,
+ agentx.c, snmp_impl.h:
+
+ - (asn1.c asn1.h snmp.c snmp.h snmp_api.c snmp_api.h
+ snmp_auth.c snmp_impl.h agentx.c):
+ - First attempt at formatted display of packet data
+
+1999-07-06 02:20 daves
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Fix handling of SNMPv1 noSuchName
+
+1999-07-02 08:27 hardaker
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c): register debugging tokens with -D
+
+1999-07-02 05:18 daves
+
+ * agent/mibgroup/: agentxx.h, agentx/master.c,
+ agentx/master.h, agentx/master_admin.c,
+ agentx/master_admin.h, agentx/master_request.c,
+ agentx/master_request.h:
+
+ - (mibgroup/agentxx.h mibgroup.agentx/): Initial implementation of AgentX master
+
+1999-07-02 05:16 daves
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): support lists of sessions (and subsessions)
+
+1999-07-02 05:15 daves
+
+ * agent/: agent_registry.c, var_struct.h:
+
+ - (var_struct.h agent_registry.c):
+ - map between MIB registrations and the supporting (subagent) session
+
+1999-07-02 05:13 daves
+
+ * snmplib/asn1.h, agent/snmp_agent.c,
+ agent/snmp_vars.h:
+
+ - (snmplib/asn1.h agent/snmp_vars.h agent/snmp_agent.c):
+ - implement an interface for delegating requests to subagents
+
+1999-07-02 02:39 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Fix that last 'sendto' case *correctly* this time
+
+1999-07-02 02:04 daves
+
+ * snmplib/agentx.c:
+
+ - (agentx.c): Better handling of building null strings
+
+1999-06-30 19:37 hardaker
+
+ * snmplib/: default_store.c, default_store.h, mib.c
+, mib.h, snmp_api.c, snmpv3.c, snmpv3.h
+:
+
+ - (default_store.c, default_store.h, mib.c, mib.h, snmp_api.c,
+ snmpv3.c, snmpv3.h):
+ - convert more stuff to the default_store space.
+
+1999-06-30 19:37 hardaker
+
+ * snmplib/: keytools.c, tools.c:
+
+ - (keytools.c, tools.c): -Wall fixes when TESTING_CODE is enabled.
+
+1999-06-30 05:48 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Missed one 'sendto' call
+
+1999-06-30 05:06 daves
+
+ * config.h.in, configure.in, configure:
+
+ - (config.h.in configure.in configure): check for sys/un.h
+
+1999-06-30 05:05 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Provide the correct size of socket addresses
+
+1999-06-30 03:20 daves
+
+ * agent/agent_read_config.h:
+
+ - (agent_read_config.h): omit redundant declarations
+
+1999-06-30 02:32 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Correct the setup of stream-based accepted internal sessions
+
+1999-06-30 01:48 daves
+
+ * agent/: snmp_agent.c, snmp_agent.h:
+
+ - (snmp_agent.c snmp_agent.h): 'agent_snmp_session' initialisation routine
+
+1999-06-30 01:45 daves
+
+ * agent/: agent_registry.c, snmp_vars.h:
+
+ - (agent_registry.c snmp_vars.h): Indicate success/failure of {un}registration
+
+1999-06-30 01:37 daves
+
+ * agent/mibgroup/mibII/: sysORTable.c, sysORTable.h:
+
+ - (sysORTable.c sysORTable.h): Indicate success/failure of {un}registration
+
+1999-06-28 15:01 hardaker
+
+ * apps/: snmpdelta.c, snmptrapd.c:
+
+ - (snmptrapd.c): init_snmp_alarm();
+
+1999-06-28 15:00 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.c:
+
+ - (ucdDemoPublic.c): convert to size_t
+
+1999-06-28 14:59 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): init_snmp_alarm().
+
+1999-06-28 09:52 daves
+
+ * agent/: agent_registry.c, snmp_vars.c, snmp_vars.h
+, var_struct.h:
+
+ - (agent_registry.c snmp_vars.c snmp_vars.h var_struct.h):
+ - Non-recursive MIB registry implementation
+
+1999-06-28 08:37 daves
+
+ * agent/mibgroup/snmpv3/: snmpEngine.c, snmpEngine.h,
+ snmpMPDStats.c, snmpMPDStats.h, usmStats.c,
+ usmStats.h, usmUser.c, usmUser.h:
+
+ - (snmpEngine.c snmpEngine.h snmpMPDStats.c snmpMPDStats.h
+ usmStats.c usmStats.h usmUser.c usmUser.h):
+ - Run-time registration (rather than via 'configure')
+
+1999-06-28 07:48 hardaker
+
+ * testing/tests/: Sv3config, T021snmpv3getnext,
+ T022snmpv3getMD5, T023snmpv3getMD5DES:
+
+ - (Sv3config, T021snmpv3getnext, T022snmpv3getMD5, T023snmpv3getMD5DES):
+ - 3 new v3 tests.
+
+1999-06-28 07:47 hardaker
+
+ * testing/: RUNTESTS, eval_tools.sh:
+
+ - (RUNTESTS, eval_tools.sh): accept agent command line options.
+
+1999-06-28 04:07 daves
+
+ * agent/: Makefile.in, agent_read_config.c,
+ agent_registry.c, snmp_vars.c:
+
+ - {Makefile.in agent_read_config.c snmp_vars.c agent_registry.c):
+ - Consolidate all registry handling into one file
+
+1999-06-28 03:08 daves
+
+ * agent/: snmp_agent.c, snmp_agent.h:
+
+ - (snmp_agent.c snmp_agent.h): make SNMP packet handling routine re-entrant.
+
+1999-06-23 10:08 hardaker
+
+ * testing/: Makefile.in, RUNTESTS, TESTCONF.sh,
+ eval_tools.sh, tests/Sv3config:
+
+ - (Makefile.in, RUNTESTS, TESTCONF.sh, eval_tools.sh, Sv3config):
+ - give RUNTESTS lots of arguments.
+ - "make test" now calls "RUNTESTS -a"
+
+1999-06-22 05:25 nba
+
+ * TODO:
+
+ TODO: need for Counter64 support in snmpdelta
+
+1999-06-22 05:21 mslifcak
+
+ * agent/snmpd.c:
+
+ invoke snmp_sess_init before any MIB processing (fixes master agent).
+
+1999-06-18 12:30 mslifcak
+
+ * snmplib/: agentx.c, agentx_client.c:
+
+ -(agentx*.c) fix headers to compile on CygWin, Win32 MSVC++
+
+1999-06-18 10:02 mslifcak
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ -(sysORTable.c) fix ptr test
+
+1999-06-18 09:14 daves
+
+ * agent/: snmpd.c, snmp_agent.c, snmp_vars.c
+, snmpd.h, snmp_agent.h,
+ mibgroup/mibII/sysORTable.c:
+
+ - (snmpd.c snmpd.h snmp_vars.c snmp_agent.c snmp_agent.h
+ mibgroup/mibII/sysORTable.c):
+ - initial AgentX sub-agent implementation
+
+1999-06-18 09:00 daves
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): protocol-independent means of bypassing VACM checks
+
+1999-06-18 08:55 daves
+
+ * snmplib/: agentx.c, agentx.h, agentx_client.c,
+ snmp_api.h, Makefile.in:
+
+ - (snmp_api.h Makefile.in agentx.c agentx.h agentx_client.c):
+ - basic AgentX protocol handling
+
+1999-06-18 08:49 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c):
+ - accomodate servers that require an accessible client-end unix stream socket
+ (in particular, the CMU AgentX master agent)
+
+1999-06-18 08:47 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): protocol-independent non-response handling in 'snmp_sess_read'
+
+1999-06-18 08:44 daves
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): New socket address structure
+
+1999-06-18 08:04 daves
+
+ * snmplib/: asn1.h, snmp_api.c:
+
+ - (asn1.h snmp_api.c): New private types for OID ranges
+
+1999-06-18 08:00 daves
+
+ * snmplib/snmp_client.c:
+
+ - (snmp_client.c): Enable access to "empty" response PDUs (i.e. header only).
+ (also make 'snmp_clone_mem' accessible to other files)
+
+1999-06-18 07:56 daves
+
+ * snmplib/: snmp.h, snmp_api.c:
+
+ - (snmp.h snmp_api.c): distinguish between SNMP protocol & PDU handling flags
+
+1999-06-18 06:58 daves
+
+ * agent/mibgroup/mibII/: sysORTable.c, sysORTable.h:
+
+ - (sysORTable.c sysORTable.h): new routine for removing sysORTable entries
+
+1999-06-18 05:01 mslifcak
+
+ * apps/encode_keychange.c, apps/snmpusm.c,
+ snmplib/default_store.c, snmplib/keytools.c,
+ snmplib/keytools.h, snmplib/parse.c, snmplib/scapi.c
+, snmplib/scapi.h, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmpusm.c,
+ snmplib/system.c:
+
+ applied fixes from M. Laukkanen
+
+1999-06-17 13:18 mslifcak
+
+ * snmplib/default_store.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, win32/config.h,
+ win32/libsnmp/libsnmp.dsp, win32/libsnmp_dll/libsnmp.def
+, win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ fixups to build most apps under Win32 (MSVC++ 5.0 or later)
+
+1999-06-17 07:38 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): fix --help.
+
+1999-06-16 16:51 hardaker
+
+ * snmplib/: snmp_api.c, snmp_debug.c, snmp_debug.h
+:
+
+ - (snmp_api.c, snmp_debug.c, snmp_debug.h):
+ - 2 new snmp.conf tokens: doDebugging, debugTokens.
+
+1999-06-16 16:24 hardaker
+
+ * snmplib/: default_store.c, default_store.h, mib.c
+, parse.c:
+
+ - (default_store.c, default_store.h, mib.c, parse.c):
+ - first usage of the default_store() routines: move all the mib
+ parser variables to it, and add snmp.conf tokens for them.
+ - premib auto-registration of default_store needs cleaning up... sigh...
+
+1999-06-16 06:56 daves
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c snmp_api.h): Hooks for building/parsing non-SNMP packets
+
+1999-06-16 05:49 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): handle responses in a more protocol-independent manner
+
+1999-06-16 05:11 daves
+
+ * snmplib/: snmp.h, snmp_api.c:
+
+ - (snmp.h snmp_api.c): move PDU validation, etc from 'send' to 'build' routines
+
+1999-06-15 16:27 hardaker
+
+ * testing/tests/T020snmpv3get:
+
+ - (T020snmpv3get): new test: snmpget using v3 and user "initial".
+
+1999-06-15 16:27 hardaker
+
+ * testing/tests/: T001snmpv1get, T002snmpv1getnext,
+ T014snmpv2cget, T015snmpv2cgetnext:
+
+ - (T001snmpv1get, T002snmpv1getnext, T014snmpv2cget, T015snmpv2cgetnext):
+ - Check for Timeticks: in output, since output has changed in 4.0.
+
+1999-06-15 16:26 hardaker
+
+ * testing/eval_tools.sh:
+
+ - (eval_tools.sh): display more output stuff when in verbose mode.
+
+1999-06-15 16:26 hardaker
+
+ * testing/TESTCONF.sh:
+
+ - (TESTCONF.sh): save packet dump.
+
+1999-06-15 16:25 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): fix allowed zerolength pdu->securityName problem for
+ v3 engineID discovery probes.
+
+1999-06-15 08:27 daves
+
+ * agent/: snmp_agent.c, snmp_agent.h:
+
+ - (snmp_agent.c snmp_agent.h):
+ - Move processing from 'handle_next_pass()' to 'handle_snmp_packet()'
+
+1999-06-15 03:59 daves
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Removed duplicate code
+
+1999-06-11 17:44 hardaker
+
+ * testing/tests/: Sv1config, Sv2cconfig, Svanyconfig
+, T001snmpv1get, T002snmpv1getnext,
+ T003snmpv1getfail, T014snmpv2cget, T015snmpv2cgetnext
+, T016snmpv2cgetfail, T017snmpv2ctov1getfail,
+ T018snmpv1tov2cgetfail:
+
+ - (Sv1config, Sv2cconfig, Svanyconfig, T001snmpv1get,
+ T002snmpv1getnext, T003snmpv1getfail, T014snmpv2cget,
+ T015snmpv2cgetnext, T016snmpv2cgetfail, T017snmpv2ctov1getfail,
+ T018snmpv1tov2cgetfail):
+ - initial pass of testing suite tests... Again, still needs work.
+
+1999-06-11 17:43 hardaker
+
+ * testing/: RUNTESTS, T2.sh, TESTCONF.sh,
+ eval_onescript.sh, eval_tools.sh:
+
+ - (RUNTESTS, T2.sh, TESTCONF.sh, eval_onescript.sh, eval_tools.sh):
+ - testing suite scripts... still need heavy work.
+
+1999-06-09 18:29 hardaker
+
+ * .cvsignore, ChangeLog, EXAMPLE.conf.def, FAQ
+, INSTALL, NEWS, README, config.h.in
+, configure, configure.in, maketarget,
+ agent/agent_read_config.c, agent/kernel.c,
+ agent/snmp_vars.c, agent/snmpd.c,
+ agent/mibgroup/kernel_sunos5.c,
+ agent/mibgroup/kernel_sunos5.h, agent/mibgroup/util_funcs.c
+, agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/vmstat.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmpnetstat/Makefile.in,
+ apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c,
+ man/snmpd.conf.5.def, snmplib/asn1.c, snmplib/mib.c
+, snmplib/mib.h, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/vacm.c:
+
+ - (*): merged 3.6.2 changes into main branch.
+
+1999-06-09 06:32 daves
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): reorder PDU and session fields more clearly
+
+1999-06-08 09:32 mslifcak
+
+ * agent/mibgroup/ucd-snmp/: memory_freebsd2.c,
+ vmstat_freebsd2.c:
+
+ -(xx__freebsd2.c) - fix size_t to build on FreeBSD 2.2.x
+
+1999-06-08 08:43 daves
+
+ * agent/mibgroup/v2party/alarm.c, snmplib/snmp_api.c
+, snmplib/snmp_api.h, snmplib/snmp_auth.c,
+ snmplib/snmp_impl.h:
+
+ - (agent/mibgroup/v2party/alarm.c
+ snmplib/snmp_api.c snmplib/snmp_api.h
+ snmplib/snmp_auth.c snmplib/snmp_impl.h):
+ - removed all uses of 'struct packet_info' (subsumed into 'struct snmp_pdu')
+
+1999-06-08 07:41 mslifcak
+
+ * agent/mibgroup/host/: hr_filesys.c (V3-line.4), hr_filesys.c
+:
+
+ -(hr_filesys.c) fix memory leak when HAVE_GETFSSTAT is defined.
+
+1999-06-07 13:04 mslifcak
+
+ * apps/snmpnetstat/if.c:
+
+ -(if.c) check for valid pointer before de-referencing.
+
+1999-06-07 07:44 mslifcak
+
+ * agent/mibgroup/mibII/: interfaces.c, ip.c, tcp.c
+, udp.c:
+
+ -(interfaces.c, tcp.c, udp.c, ip.c) clone fixes from 3.6 line (FreeBSD3.1)
+
+1999-06-04 09:51 mslifcak
+
+ * agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, local/Makefile.in:
+
+ -(hr_filesys.c,interfaces.c,tcp.c,udp.c,freebsd3.h) fix FreeBSD3.1 incl Ken Key's tcp/udp patches
+
+1999-06-02 12:10 hardaker
+
+ * man/snmp_alarm.3:
+
+ - (snmp_alarm.3): document the new snmp_alarm() calls.
+
+1999-06-01 17:21 hardaker
+
+ * snmplib/: Makefile.in, snmp_alarm.c, snmp_alarm.h
+, snmp_api.c:
+
+ - (Makefile.in, snmp_alarm.c, snmp_alarm.h, snmp_api.c):
+ - implemented a generic alarm handler to register alarm functions to
+ be called back after X period of time and it handles figuring out
+ which is next and calling alarm() and signal() appropriately.
+
+1999-06-01 07:30 daves
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmplib/snmp_api.c snmplib/snmp_api.h): Support for stream-based sockets
+
+1999-06-01 02:32 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Generalise handling of addresses (w.r.t sento/recvfrom)
+
+1999-06-01 02:17 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Garbage collection for Traditional SAPI sessions
+
+1999-05-28 16:44 hardaker
+
+ * snmplib/: Makefile.in, default_store.c,
+ default_store.h:
+
+ - (Makefile.in, default_store.c, default_store.h):
+ - created generic default value storage space and parsers to reduce
+ the number of functions/etc created for values which configure the
+ library.
+
+1999-05-28 16:17 hardaker
+
+ * snmplib/: mib.c, parse.c, parse.h:
+
+ - (mib.c, parse.c, parse.h): save and use index clauses.
+
+1999-05-28 09:24 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ -(snmp_api.c) -catch one more error close from snmp_sess_copy
+
+1999-05-28 09:12 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Separate out copying a session and opening a new one
+
+1999-05-28 08:57 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): Unix domain (datagram) socket support
+
+1999-05-28 08:14 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): save local socket address in internal session structure
+
+1999-05-28 07:01 daves
+
+ * agent/: Makefile.in, mibgroup/Makefile.in:
+
+ - (agent/Makefile.in agent/mibgroup/Makefile.in): fix problem with null macro
+
+1999-05-27 14:37 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): document default oid keyword in help line.
+
+1999-05-27 14:37 hardaker
+
+ * man/snmptrapd.conf.5.def:
+
+ - (snmptrapd.conf.5.def): document default oid keyword.
+
+1999-05-27 14:30 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): need an init_mib().
+
+1999-05-27 14:30 hardaker
+
+ * apps/snmptrapd_handlers.c:
+
+ - (snmptrapd_handlers.c): implement the default trap handler.
+
+1999-05-27 05:16 mslifcak
+
+ * apps/encode_keychange.c, snmplib/read_config.c,
+ snmplib/snmpusm.c:
+
+ -(encode_keychange, read_config, snmpusm) aCC fixes by PKY (Markku Laukkanen)
+
+1999-05-26 17:38 hardaker
+
+ * mibs/: IPFWACC-MIB.txt (V3-line.2), IPFWACC-MIB.txt:
+
+ - (IPFWACC-MIB.txt): added SEQUENCE OF.
+
+1999-05-26 15:56 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): increase MAXREADCOUNT.
+
+1999-05-26 15:20 hardaker
+
+ * agent/mibgroup/misc/: ipfwacc.h (V3-b3.2), ipfwacc.h:
+
+ - (ipfwacc.h): make into counters.
+
+1999-05-26 15:18 hardaker
+
+ * mibs/: IPFWACC-MIB.txt (V3-b3.1), IPFWACC-MIB.txt:
+
+ - (IPFWACC-MIB.txt): change to counters.
+
+1999-05-26 15:14 hardaker
+
+ * agent/mibgroup/host/: hr_swinst.c (V3-b3.1), hr_swinst.c:
+
+ - (hr_swinst.c): make software application type unknown instead of app.
+
+1999-05-26 11:18 hardaker
+
+ * agent/mibgroup/misc/: ipfwacc.h (V3-b3.1), ipfwacc.h:
+
+ - (ipfwacc.h): properly locate the mib.
+
+1999-05-26 08:16 mslifcak
+
+ * snmplib/snmpv3.c:
+
+ - (snmpv3.c) - incl sys/types to fix HP-UX 9.x build
+
+1999-05-24 05:36 mslifcak
+
+ * configure:
+
+ -configure - save one which looks for netdb/socket headers
+
+1999-05-23 08:04 marz
+
+ * testing/packet1.txt:
+
+ file packet1.txt was initially added on branch V3-b3.
+
+1999-05-21 15:29 mslifcak
+
+ * snmplib/asn1.c, snmplib/callback.c,
+ snmplib/callback.h, snmplib/keytools.c,
+ snmplib/lcd_time.c, snmplib/md5.c, snmplib/mib.c
+, snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp.c, snmplib/snmp.h, snmplib/snmp_api.c
+, snmplib/snmpusm.c, snmplib/system.c,
+ snmplib/tools.c, snmplib/vacm.c, snmplib/view.c
+, win32/libsnmp/libsnmp.dsp,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ - library changes to build on Win32.
+
+1999-05-21 11:10 hardaker
+
+ * local/: mib2c.conf, mib2c.storage.conf:
+
+ - (mib2c.conf, mib2c.storage.conf):
+ - convert to size_t storages.
+ - misc eval fixes.
+ - more cleanup of the storage def.
+
+1999-05-21 11:07 hardaker
+
+ * agent/mibgroup/: header_complex.c, header_complex.h:
+
+ - (header_complex.c, header_complex.h):
+ - header_complex_parse_oid() created.
+ - convert everything to size_t.
+
+1999-05-21 05:54 daves
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c snmp_api.h):
+ - New API call to close down all open sessions
+ (also called on application shutdown)
+
+1999-05-21 05:24 mslifcak
+
+ * snmplib/read_config.c:
+
+ -(read_config.c) cast fix per Markku Laukkanen
+
+1999-05-21 01:25 daves
+
+ * snmplib/snmpusm.c:
+
+ - (snmpusm.c): Fix incorrect pointer cast
+
+1999-05-20 03:46 daves
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): Temporary fix to socket address problems
+
+1999-05-19 18:49 mslifcak
+
+ * agent/mibgroup/: host_res.h (V3-line.1), host_res.h:
+
+ - (host_res.h) fix HAVE_NET_IF_VAR_H define (was HAVE_NET_IN_VAR_H)
+
+1999-05-19 18:01 mslifcak
+
+ * agent/mibgroup/mibII/: var_route.c (V3-line.2), var_route.c
+:
+
+ -(mibII/var_route.c) - fix Linux RouteMask c/o "Nancy" nam@cs.cmu.edu
+
+1999-05-19 08:02 marz
+
+ * testing/pktgen.txt:
+
+ file pktgen.txt was initially added on branch V3-b3.
+
+1999-05-19 07:16 marz
+
+ * testing/packet.txt:
+
+ file packet.txt was initially added on branch V3-b3.
+
+1999-05-19 07:14 marz
+
+ * testing/pktgen.pl:
+
+ file pktgen.pl was initially added on branch V3-b3.
+
+1999-05-19 05:11 daves
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): More generalised handling of socket addresses
+
+1999-05-19 02:33 daves
+
+ * config.h.in:
+
+ - (config.h.in): Additional include protection entries
+
+1999-05-18 09:23 daves
+
+ * configure.in, snmplib/context_parse.c,
+ snmplib/read_config.c, snmplib/snmp_api.c,
+ snmplib/snmpv3.c, snmplib/system.c,
+ apps/snmp_parse_args.c, apps/snmpbulkwalk.c,
+ apps/snmpdelta.c, apps/snmpget.c, apps/snmpgetnext.c
+, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c, apps/snmptrap.c
+, apps/snmpusm.c, apps/snmpwalk.c,
+ apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/route.c,
+ apps/snmpnetstat/winstub.c:
+
+ - (configure.in snmplib/context_parse.c snmplib/read_config.c
+ snmplib/snmp_api.c snmplib/snmpv3.c snmplib/system.c
+ apps/snmp_parse_args.c apps/snmpbulkwalk.c apps/snmpdelta.c
+ apps/snmpget.c apps/snmpgetnext.c apps/snmpset.c
+ apps/snmpstatus.c apps/snmptable.c apps/snmptest.c
+ apps/snmptrap.c apps/snmpusm.c apps/snmpwalk.c
+ apps/snmpnetstat/if.c apps/snmpnetstat/inet.c
+ apps/snmpnetstat/main.c apps/snmpnetstat/route.c
+ apps/snmpnetstat/winstub.c):
+ - Clean up conditionals protecting include files
+ ( #if HAVE_WINSOCK_H / #else / #endif )
+
+1999-05-18 09:01 mslifcak
+
+ * agent/: Makefile.in, mibgroup/Makefile.in:
+
+ - (xx/Makefile.in) remove references to as yet missing disman files.
+
+1999-05-18 06:26 daves
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c snmp_api.h): More general handling of PDU flags
+
+1999-05-17 07:17 daves
+
+ * snmplib/snmp_api.c, snmplib/snmp_api.h,
+ agent/snmpd.c, apps/snmptrap.c, apps/snmptrapd.c
+:
+
+ - (snmplib/snmp_api.c snmplib/snmp_api.h agent/snmpd.c
+ apps/snmptrap.c apps/snmptrapd.c):
+
+ - Use a single address field within the PDU structure
+ (obsoleting 'agent_addr')
+
+1999-05-17 04:36 daves
+
+ * apps/snmpstatus.c, apps/snmptest.c, apps/snmptrap.c
+, apps/snmptrapd.c, agent/snmpd.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/event.c:
+
+ - (snmplib/snmp_api.h snmplib/snmp_api.c snmplib/snmp_client.c
+ agent/snmpd.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/v2party/alarm.c agent/mibgroup/v2party/event.c
+ apps/snmpstatus.c apps/snmptest.c apps/snmptrap.c apps/snmptrapd.c):
+
+ - Use the generic socket address 'struct sockaddr',
+ rather than the IP-specific 'struct sockaddr_in'
+
+1999-05-17 04:34 daves
+
+ * snmplib/: snmp_api.c, snmp_api.h, snmp_client.c
+:
+
+ - (snmplib/snmp_api.h snmplib/snmp_api.c snmplib/snmp_client.c
+ agent/snmpd.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/v2party/alarm.c agent/mibgroup/v2party/event.c
+ apps/snmpstatus.c apps/snmptest.c apps/snmptrap.c apps/snmptrapd.c):
+
+ - Use the generic socket addresses 'struct sockaddr',
+ rather than the IP-specific 'struct sockaddr_in'
+
+1999-05-17 03:20 daves
+
+ * apps/: snmp_parse_args.c (V3-line.1), snmp_parse_args.c:
+
+ - (snmp_parse_args.c): Initialise session using library routine
+
+1999-05-17 03:17 daves
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): Initialise session using library routine
+
+1999-05-14 13:59 mslifcak
+
+ * agent/mibgroup/mibII/interfaces.c, snmplib/snmpusm.c
+:
+
+ -(agent/mibgroup/mibII/interfaces.c snmplib/snmpusm.c) fixes to build HP & AIX
+
+1999-05-14 09:46 mslifcak
+
+ * agent/mibgroup/examples/wombat.h,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/snmpv3/usmUser.c, apps/encode_keychange.c
+, snmplib/parse.c:
+
+ - (agent/mibgroup/examples/wombat.h agent/mibgroup/host/hr_disk.c
+ agent/mibgroup/mibII/interfaces.c
+ agent/mibgroup/mibII/var_route.c
+ agent/mibgroup/snmpv3/usmUser.c apps/encode_keychange.c
+ snmplib/parse.c) more ANSI-C touchups
+
+1999-05-14 06:54 mslifcak
+
+ * agent/mibgroup/dummy/dummy.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/example.h,
+ agent/mibgroup/examples/wombat.c,
+ agent/mibgroup/misc/ipfwacc.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmUser.c, snmplib/snmp_auth.c:
+
+ - (agent/mibgroup/dummy/dummy.c agent/mibgroup/examples/example.c
+ agent/mibgroup/examples/example.h
+ agent/mibgroup/examples/wombat.c agent/mibgroup/misc/ipfwacc.c
+ agent/mibgroup/smux/smux.c
+ agent/mibgroup/snmpv3/snmpMPDStats.c
+ agent/mibgroup/snmpv3/usmStats.c
+ agent/mibgroup/snmpv3/usmUser.c snmplib/snmp_auth.c) more size_t fixes
+
+1999-05-13 09:07 hardaker
+
+ * agent/mibgroup/mibII/: vacm_vars.c (V3-line.3), vacm_vars.c
+:
+
+ - (vacm_vars.c): Set pointers to NULL after freeing them.
+
+1999-05-13 03:52 daves
+
+ * agent/mibgroup/mibII/: ip.c (V3-line.2), ip.c:
+
+ - (ip.c): Properly register IP module group on Free-BSD systems
+ (thanks to Mitchell Tasman)
+
+1999-05-12 11:22 mslifcak
+
+ * snmplib/: parse.c, party_parse.c, read_config.c
+:
+
+ -(parse.c party_parse.c read_config.c) no exit() from library; return error
+
+1999-05-12 10:53 mslifcak
+
+ * snmplib/: snmp_api.c, snmp_client.c:
+
+ - (snmp_api.c snmp_client.c) call snmp_synch_reset from snmp_sess_close
+
+1999-05-11 14:11 hardaker
+
+ * agent/mibgroup/ucd-snmp/: hpux.c, hpux.h:
+
+ - (hpux.c, hpux.h): int -> size_t conversions.
+
+1999-05-11 14:03 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory.h:
+
+ - (memory.h): remove extern.
+
+1999-05-11 14:02 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ - (util_funcs.c): read returns ssize_t not size_t.
+
+1999-05-10 14:49 nba
+
+ * snmplib/snmp_api.c:
+
+ snmplib/snmp_api.c: Mix-up of V1_IN_V2/V2_IN_V1 error code when GETBULK
+ inside V1 session.
+
+1999-05-10 14:47 nba
+
+ * agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/vmstat.c, apps/snmp_parse_args.c
+, snmplib/keytools.c, snmplib/keytools.h,
+ snmplib/snmp_api.c, snmplib/snmpusm.c,
+ snmplib/tools.c:
+
+ Fixing some more prototypes. Pointed out by Markku Laukkanen.
+
+1999-05-06 09:20 mslifcak
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ - (ucd-snmp/vmstat.c) - conditionally include limits.h per Eduard Koucky.
+
+1999-05-04 11:08 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): Added --enable-developer flag.
+
+1999-05-04 11:08 hardaker
+
+ * snmplib/scapi.c:
+
+ - (scapi.c):
+ - fixes for kmt.
+ - portability enhancements.
+
+1999-05-04 10:31 hardaker
+
+ * snmplib/keytools.c:
+
+ - (keytools.c): don't use ISDF().
+
+1999-05-04 10:31 hardaker
+
+ * snmplib/scapi.c:
+
+ - (scapi.c): don't dump keylist.
+
+1999-05-04 00:50 nba
+
+ * agent/: snmp_agent.c, snmp_vars.c, snmp_vars.h
+, snmpd.c, snmpd.h, mibgroup/kernel_sunos5.c
+, mibgroup/host/hr_device.c, mibgroup/host/hr_disk.c
+, mibgroup/host/hr_filesys.c,
+ mibgroup/host/hr_network.c, mibgroup/host/hr_partition.c
+, mibgroup/host/hr_print.c, mibgroup/host/hr_proc.c
+, mibgroup/host/hr_storage.c,
+ mibgroup/host/hr_swinst.c, mibgroup/host/hr_swrun.c,
+ mibgroup/host/hr_system.c, mibgroup/mibII/at.c,
+ mibgroup/mibII/icmp.c, mibgroup/mibII/interfaces.c,
+ mibgroup/mibII/ip.c, mibgroup/mibII/snmp_mib.c,
+ mibgroup/mibII/sysORTable.c, mibgroup/mibII/system_mib.c
+, mibgroup/mibII/tcp.c, mibgroup/mibII/udp.c,
+ mibgroup/mibII/vacm_vars.c, mibgroup/mibII/var_route.c
+, mibgroup/smux/smux.c, mibgroup/snmpv3/snmpEngine.c
+, mibgroup/snmpv3/snmpMPDStats.c,
+ mibgroup/snmpv3/usmStats.c, mibgroup/snmpv3/usmUser.c,
+ mibgroup/target/snmpTargetAddrEntry.c,
+ mibgroup/target/snmpTargetParamsEntry.c,
+ mibgroup/ucd-snmp/disk.c, mibgroup/ucd-snmp/errormib.c
+, mibgroup/ucd-snmp/extensible.c,
+ mibgroup/ucd-snmp/file.c, mibgroup/ucd-snmp/loadave.c
+, mibgroup/ucd-snmp/memory_solaris2.c,
+ mibgroup/ucd-snmp/pass.c, mibgroup/ucd-snmp/proc.c,
+ mibgroup/ucd-snmp/registry.c,
+ mibgroup/ucd-snmp/versioninfo.c, mibgroup/v2party/acl_vars.c
+, mibgroup/v2party/alarm.c,
+ mibgroup/v2party/context_vars.c, mibgroup/v2party/event.c
+, mibgroup/v2party/party_vars.c,
+ mibgroup/v2party/view_vars.c:
+
+ (many): remove const spec from FindVarMethod. That was wrong
+
+1999-05-04 00:47 nba
+
+ * snmplib/mib.c:
+
+ (mib.c): Fix problem (core dump) with MIBFILES environment variable.
+
+1999-05-03 15:38 nba
+
+ * agent/snmp2p.c, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmp_vars.h, agent/snmpd.c
+, agent/snmpd.h, agent/view_parse.c,
+ agent/mibgroup/host_res.h, agent/mibgroup/kernel_sunos5.c
+, agent/mibgroup/kernel_sunos5.h,
+ agent/mibgroup/struct.h, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/util_funcs.h, agent/mibgroup/host/hr_device.c
+, agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_network.h,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_proc.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hr_utils.c,
+ agent/mibgroup/host/hr_utils.h, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/mibII/var_route.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/smux/smux.h,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proc.h,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/v2party/acl_vars.c,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/alarm.h,
+ agent/mibgroup/v2party/context_vars.c,
+ agent/mibgroup/v2party/event.c,
+ agent/mibgroup/v2party/event.h,
+ agent/mibgroup/v2party/party_vars.c,
+ agent/mibgroup/v2party/party_vars.h,
+ agent/mibgroup/v2party/view_vars.c, apps/encode_keychange.c
+, apps/snmp_parse_args.c, apps/snmp_parse_args.h
+, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, apps/snmptable.c,
+ apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c,
+ apps/snmptrapd_handlers.c, apps/snmptrapd_handlers.h,
+ apps/snmpusm.c, apps/snmpwalk.c, apps/snmpnetstat/if.c
+, apps/snmpnetstat/inet.c, apps/snmpnetstat/main.c
+, apps/snmpnetstat/netstat.h, apps/snmpnetstat/route.c
+, snmplib/acl.h, snmplib/acl_parse.c,
+ snmplib/all_system.h, snmplib/asn1.c, snmplib/asn1.h
+, snmplib/callback.h, snmplib/context.c,
+ snmplib/context.h, snmplib/context_parse.c,
+ snmplib/int64.c, snmplib/int64.h, snmplib/keytools.c
+, snmplib/keytools.h, snmplib/lcd_time.c,
+ snmplib/lcd_time.h, snmplib/libsnmp.h, snmplib/md5.c
+, snmplib/md5.h, snmplib/mib.c, snmplib/mib.h
+, snmplib/parse.h, snmplib/party.c,
+ snmplib/party.h, snmplib/party_parse.c,
+ snmplib/read_config.c, snmplib/read_config.h,
+ snmplib/scapi.c, snmplib/scapi.h, snmplib/snmp-tc.h
+, snmplib/snmp.c, snmplib/snmp.h,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_client.h, snmplib/snmp_debug.c,
+ snmplib/snmp_debug.h, snmplib/snmp_impl.h,
+ snmplib/snmpusm.c, snmplib/snmpusm.h, snmplib/snmpv3.c
+, snmplib/snmpv3.h, snmplib/system.h,
+ snmplib/tools.c, snmplib/tools.h, snmplib/vacm.c
+, snmplib/vacm.h, snmplib/view.c, snmplib/view.h
+:
+
+ (*.[ch]): patches to types to wipe warnings from compilers
+ with more strict noise levels. (also good when compiling
+ with gcc -Wall -pedantic -Wwrite-strings -Wcast-qual)
+
+1999-05-03 12:56 hardaker
+
+ * agent/Makefile.in, agent/agent_read_config.c,
+ agent/mibgroup/Makefile.in, agent/mibgroup/header_complex.c
+, apps/Makefile.in, apps/encode_keychange.c,
+ apps/snmpnetstat/Makefile.in, snmplib/Makefile.in,
+ snmplib/all_general_local.h, snmplib/all_system.h,
+ snmplib/keytools.c, snmplib/lcd_time.c, snmplib/scapi.c
+, snmplib/snmp_auth.c, snmplib/snmpusm.c,
+ snmplib/tools.c, snmplib/tools.h, testing/Makefile.in
+, testing/T.c, testing/etimetest.c,
+ testing/keymanagetest.c, testing/misctest.c,
+ testing/scapitest.c:
+
+ - (Makefile.in, agent_read_config.c, Makefile.in, header_complex.c,
+ Makefile.in, encode_keychange.c, Makefile.in, Makefile.in,
+ all_general_local.h, all_system.h, keytools.c, lcd_time.c, scapi.c,
+ snmp_auth.c, snmpusm.c, tools.c, tools.h, Makefile.in, T.c,
+ etimetest.c, keymanagetest.c, misctest.c, scapitest.c):
+ - nuked all_general_local.h and all_system.h.
+ - makefileindepend as well.
+
+1999-05-03 07:13 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): fix -A flag, which got broken during someones changes.
+
+1999-05-03 07:05 hardaker
+
+ * agent/agent_read_config.c, agent/mibgroup/snmpv3/usmUser.c
+, agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.h,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.h,
+ apps/snmptrapd.c, snmplib/callback.c,
+ snmplib/callback.h, snmplib/scapi.c, snmplib/scapi.h
+, snmplib/snmp_api.c, snmplib/snmpv3.c,
+ snmplib/snmpv3.h:
+
+ - (agent_read_config.c, usmUser.c, usmUser.h, snmpTargetAddrEntry.c,
+ snmpTargetAddrEntry.h, snmpTargetParamsEntry.c,
+ snmpTargetParamsEntry.h, snmptrapd.c, callback.c, callback.h,
+ scapi.c, scapi.h, snmp_api.c, snmpv3.c, snmpv3.h):
+ - shutdown and store callback usage.
+
+1999-05-03 07:05 hardaker
+
+ * snmplib/keytools.c:
+
+ - (keytools.c): -Wall fix initializing a variable.
+
+1999-05-01 07:52 hardaker
+
+ * snmplib/: callback.c, callback.h:
+
+ - (callback.c, callback.h): renamed snmp_callback to snmp_gen_callback.
+
+1999-04-29 08:44 hardaker
+
+ * README.win32:
+
+ - (README.win32): Note change from Robert Story.
+
+1999-04-29 07:38 hardaker
+
+ * agent/agent_read_config.c, agent/snmpd.c,
+ apps/snmptrapd.c, snmplib/snmp_api.c,
+ snmplib/snmpusm.c, snmplib/snmpusm.h, snmplib/snmpv3.c
+, snmplib/snmpv3.h:
+
+ - (agent_read_config.c, snmpd.c, snmptrapd.c, snmp_api.c, snmpusm.c,
+ snmpusm.h, snmpv3.c, snmpv3.h):
+ - use the callback mechanism for post-config stuff.
+
+1999-04-29 07:32 hardaker
+
+ * snmplib/: Makefile.in, callback.c, callback.h:
+
+ - (Makefile.in, callback.c, callback.h): callback API.
+
+1999-04-28 07:59 hardaker
+
+ * local/mib2c.storage.conf:
+
+ - (mib2c.storage.conf): enum #defines created
+
+1999-04-27 09:51 mslifcak
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c) add if_type_from_name to convert interface name to type.
+
+1999-04-26 12:37 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c) - fix other use of request's callback data
+
+1999-04-26 12:11 nba
+
+ * version.h, agent/agent_read_config.c,
+ agent/agent_read_config.h, agent/auto_nlist.c,
+ agent/auto_nlist.h, agent/kernel.c, agent/kernel.h
+, agent/snmp2p.c, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmpd.c, agent/view_parse.c
+, agent/mibgroup/host_res.h,
+ agent/mibgroup/kernel_sunos5.c,
+ agent/mibgroup/kernel_sunos5.h, agent/mibgroup/util_funcs.c
+, agent/mibgroup/util_funcs.h,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_other.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/errormib.h,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/netstat.h, man/snmp.conf.5.def,
+ man/snmpd.1.def, man/snmpd.conf.5.def,
+ mibs/UCD-SNMP-MIB.txt, snmplib/acl_parse.c,
+ snmplib/asn1.c, snmplib/asn1.h,
+ snmplib/context_parse.c, snmplib/mib.c, snmplib/mib.h
+, snmplib/parse.c, snmplib/parse.h,
+ snmplib/party_parse.c, snmplib/read_config.c,
+ snmplib/read_config.h, snmplib/snmp.c, snmplib/snmp.h
+, snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_client.h, snmplib/snmp_debug.c,
+ snmplib/snmp_debug.h, snmplib/snmpusm.c,
+ snmplib/snmpusm.h, snmplib/snmpv3.c, snmplib/snmpv3.h
+, snmplib/system.c, snmplib/system.h,
+ snmplib/vacm.c, snmplib/vacm.h, testing/Makefile.in
+:
+
+
+ */*: replace horrible (char *)"string" with const specifiers in relevant
+ functions.
+
+1999-04-26 12:09 nba
+
+ * apps/: encode_keychange.c, snmp_parse_args.c,
+ snmpbulkwalk.c, snmpdelta.c, snmpget.c,
+ snmpgetnext.c, snmpset.c, snmpstatus.c,
+ snmptable.c, snmptrap.c, snmptrapd.c,
+ snmptrapd_handlers.c, snmpusm.c, snmpwalk.c:
+
+
+
+ apps/*.c: use snmp_perror to report errors from read_objid and friends
+ apps/snmptrapd.c: fix a bus error when using -S and receiving an
+ enterprise specific trap.
+
+1999-04-26 12:03 nba
+
+ * apps/snmpnetstat/if.c:
+
+
+ (if.c) make the width of snmpnet -i (and -o) adapt to the length of returned
+ strings
+
+1999-04-26 11:48 nba
+
+ * apps/snmptranslate.c, snmplib/parse.c,
+ snmplib/parse.h, snmplib/snmp_api.c:
+
+
+
+ - snmplib/parse.h, snmplib/parse.c: new mib printer: mib_print_tree
+ inspired by a reference to snmx in comp.protocols.snmp
+ - apps/snmptranslate: let the -p option call this new printer
+ - snmplib/snmp_api.c: some left over __P macros
+
+1999-04-26 11:21 nba
+
+ * snmplib/parse.h:
+
+
+ (parse.h) Silly speling misteak (ACCESS_CRAETE)
+
+1999-04-26 09:21 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib.c) - use request callback's data if request specifies a callback.
+
+1999-04-23 13:05 mslifcak
+
+ * README.thread:
+
+ - README.thread - long needed document describing how to use Single API
+
+1999-04-22 10:50 hardaker
+
+ * snmplib/: keytools.c, snmp_api.c, snmp_api.h
+, snmp_client.c, snmp_client.c:
+
+ - (snmp_client.c, snmp_api.c, snmp_api.h, keytools.c): Another v3 branch update.
+
+1999-04-22 07:57 hardaker
+
+ * local/mib2c.storage.conf:
+
+ - (mib2c.storage.conf): Created a new super-duper mib2c configuration
+ file that takes care of just about everything if you have a mib that
+ does its own storage (rather than having to poke something else for
+ information).
+
+1999-04-22 07:56 hardaker
+
+ * local/: mib2c, mib2c.conf:
+
+ - (mib2c, mib2c.conf): allow NoAccess to be processed, and use skipif:
+ directives where needed because of it.
+
+1999-04-22 07:54 hardaker
+
+ * snmplib/: read_config.c, read_config.h:
+
+ - (read_config.c, read_config.h): created *read_config_store_data();
+
+1999-04-22 07:54 hardaker
+
+ * agent/mibgroup/header_complex.c:
+
+ - (header_complex.c): make header_complex() accept NULLs.
+
+1999-04-20 21:39 hardaker
+
+ * local/mib2c.vartypes.conf:
+
+ - (mib2c.vartypes.conf): remove un-used vtype, parser fields.
+
+1999-04-20 21:38 hardaker
+
+ * local/mib2c.conf:
+
+ - (mib2c.conf): clean up skipif regexps a bit.
+
+1999-04-20 16:10 hardaker
+
+ * local/: mib2c, mib2c.conf:
+
+ - (mib2c, mib2c.conf): a little more clean up.
+
+1999-04-20 16:04 hardaker
+
+ * local/: mib2c, mib2c.conf:
+
+ - (mib2c, mib2c.conf): variable name conversions:
+ - variableTypes -> variables
+ - cname -> NAME
+
+1999-04-20 15:31 hardaker
+
+ * local/: mib2c, mib2c.conf, mib2c.vartypes.conf
+:
+
+ - (mib2c, mib2c.conf, mib2c.vartypes.conf):
+ - completely re-hacked:
+ - entire code base is now put into the .conf files rather than in
+ the mib2c program. This should entitle mib2c to be used more
+ generically, and could produce different types of code templates
+ based on the .conf file it is given. In theory, it should be
+ able to produce C code for a non-ucd-snmp agent, or even better,
+ any type of code (not just C) for something else based on mib
+ information.
+ - The down side, is that the current .conf files are now ambiguous
+ again and difficult to understand without being, well, me. The
+ up side is that I'm sure Dave Shield will go through and clean
+ it up for me like he did last time. Ha ha. I wonder if he'll
+ read this? (If so, see me first).
+
+1999-04-20 11:28 hardaker
+
+ * local/: mib2c, mib2c.conf, mib2c.vartypes.conf
+:
+
+ - (mib2c, mib2c.conf, mib2c.vartypes.conf): more updates.
+
+1999-04-19 21:16 hardaker
+
+ * snmplib/tools.h:
+
+ - (tools.h): new convenience macro: SNMP_MALLOC_STRUCT(structName).
+
+1999-04-19 21:15 hardaker
+
+ * snmplib/snmpusm.c:
+
+ - (snmpusm.c): don't free things that are NULL.
+
+1999-04-19 21:14 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Don't snmp_set_var_objid if name is NULL in
+ snmp_varlist_add_variable().
+
+1999-04-19 21:12 hardaker
+
+ * snmplib/: read_config.c, read_config.h:
+
+ - (read_config.c, read_config.h):
+ - created a more convenient read_config_read_data() function to
+ generically read a token into a given variable.
+ - cleaned up persistent storage parsing routines.
+ - use previously malloced space in some routines, or malloc it for
+ them if the storage area is NULL.
+
+1999-04-19 21:09 hardaker
+
+ * agent/mibgroup/header_complex.c:
+
+ - (header_complex.c): NULL checking.
+
+1999-04-19 21:09 hardaker
+
+ * agent/mibgroup/mibincl.h:
+
+ - (mibincl.h): add read_config.h.
+
+1999-04-19 21:01 hardaker
+
+ * local/: mib2c, mib2c.conf, mib2c.vartypes.conf
+:
+
+ - (mib2c, mib2c.conf, mib2c.vartypes.conf):
+ - rewrote mib2c to be more dependent on .conf files. The main .conf
+ file now contains the code itself.
+ - need to write a foreach(mibnode) type parser next.
+
+1999-04-18 06:54 mslifcak
+
+ * agent/mibgroup/misc/ipfwacc.h:
+
+ - (ipfwacc.h) subdir change per Joe Pruettt: 9 -> 10
+
+1999-04-16 21:34 hardaker
+
+ * bug-report, version.h, FAQ, README,
+ sedscript.in:
+
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre3 )
+
+1999-04-16 21:27 hardaker
+
+ * man/snmptrapd.8:
+
+ - (snmptrapd.8): man patch from Niels
+
+1999-04-16 21:27 hardaker
+
+ * NEWS:
+
+ - (NEWS): updated
+
+1999-04-16 21:16 hardaker
+
+ * snmplib/snmp_auth.c:
+
+ - (snmp_auth.c): removed fix note.
+
+1999-04-16 21:15 hardaker
+
+ * snmplib/snmp.h:
+
+ - (snmp.h): SNMPADMINLENGTH definition.
+
+1999-04-16 21:13 hardaker
+
+ * mibs/DISMAN-SCRIPT-MIB.txt:
+
+ - (DISMAN-SCRIPT-MIB.txt): added to mibs dir.
+
+1999-04-16 21:12 hardaker
+
+ * agent/mibgroup/header_complex.h:
+
+ - (header_complex.h): prototypes.
+
+1999-04-16 21:11 hardaker
+
+ * configure.in:
+
+ - (configure.in): changed default store location to /var/ucd-snmp
+
+1999-04-16 21:10 hardaker
+
+ * README:
+
+ - (README): Added v3 team members.
+
+1999-04-16 08:33 mslifcak
+
+ * snmplib/mib.c:
+
+ - (mib.c) "-m" or MIBS: can specify MIB module by file name.
+
+1999-04-16 07:54 mslifcak
+
+ * agent/mibgroup/ipfwchains/IPFWCHAINS-MIB.txt:
+
+ - (IPFWCHAINS-MIB.txt) ipfwChainTable {ipfw 1} fix
+
+1999-04-16 07:30 mslifcak
+
+ * mibs/IPFWACC-MIB.txt:
+
+ - (IPFWACC-MIB.txt) change module name from IPFWADM-MIB to IPFWACC-MIB.
+
+1999-04-14 16:56 mslifcak
+
+ * apps/: snmpdelta.c, snmpget.c, snmpgetnext.c
+, snmpset.c, snmpstatus.c:
+
+ - apps that use snmp_fix_pdu must clean up the response PDU !
+
+1999-04-14 16:31 mslifcak
+
+ * agent/snmp_agent.c, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmp_client.c,
+ snmplib/snmp_client.h:
+
+ - (snmp_agent,c, snmp_api.[ch], snmp_client.[ch]) fix variable_list with built-in storage
+
+1999-04-14 15:52 hardaker
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c): init_snmp("snmpapp").
+
+1999-04-14 15:30 mslifcak
+
+ * snmplib/parse.c:
+
+ - (parse.c) File pointer initialized to "" before first use.
+
+1999-04-14 15:29 mslifcak
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c) init_snmp takes argument; "" used.
+
+1999-04-13 16:03 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): Patch from Niels Baggesen:
+ - snmptrapd option to ignore auth traps, add -S option, log termination.
+
+1999-04-13 16:00 hardaker
+
+ * snmplib/: parse.c, parse.h:
+
+ - (parse.c, parse.h): Patch from Niels Baggesen:
+ - nicer parser messages (include file names). Correct help for -Pc.
+ - Add FRAME-RELAY-DTE-MIB as replacement for RFC-1315
+
+1999-04-13 15:58 hardaker
+
+ * man/: snmp_config.5.def, snmptrap.1,
+ snmptrapd.conf.5.def:
+
+ - (snmp_config.5.def, snmptrap.1, snmptrapd.conf.5.def): Patch from
+ Niels Baggesen:
+ - clean up small bugs.
+
+1999-04-13 15:58 hardaker
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c): Patch from Niels Baggesen:
+ - support -P.
+
+1999-04-13 15:57 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - (vacm_vars.c): Patch from Niels Baggesen:
+ - better checking of .conf file parsing line requirements.
+
+1999-04-13 15:56 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Patch from Niels Baggesen:
+ - log with timestamp at shutdown.
+
+1999-04-13 15:36 hardaker
+
+ * mibs/: SNMP-NOTIFICATION-MIB.txt, SNMP-PROXY-MIB.txt,
+ SNMP-VIEW-BASED-ACM-MIB.txt:
+
+ - (SNMP-NOTIFICATION-MIB.txt, SNMP-PROXY-MIB.txt,
+ SNMP-VIEW-BASED-ACM-MIB.txt): Patch from Niels Baggesen:
+ - fix module locations for broken mibs.
+
+1999-04-13 15:32 hardaker
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ - (pass.c): Patch from Jim Mar:
+ - add capability for binary octet strings in pass scripts.
+
+1999-04-13 15:20 hardaker
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ - (system_mib.c): make sysDescr read-only.
+
+1999-04-13 15:19 hardaker
+
+ * configure, configure.in, agent/Makefile.in
+:
+
+ - (configure, configure.in, Makefile.in): Patch from Daniel Hagerty:
+ - fix libwrap to only add the library to the agent.
+
+1999-04-13 08:43 hardaker
+
+ * README.win32:
+
+ - (README.win32): Patch from Robert Story:
+ - add a URL reference to cygwin.
+
+1999-04-12 22:23 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c): make snmp_varlist_add_variable to possible create a
+ varlist before adding something to it.
+
+1999-04-12 22:16 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): make displayed mib node info into two columns instead of one.
+
+1999-04-12 22:15 hardaker
+
+ * agent/mibgroup/host/hr_utils.h:
+
+ - (hr_utils.h): remove variable names from prototypes (was causing problems).
+
+1999-04-12 22:14 hardaker
+
+ * agent/mibgroup/mibincl.h:
+
+ - (mibincl.h): include sys/time.h.
+
+1999-04-12 22:13 hardaker
+
+ * agent/mibgroup/: header_complex.c, header_complex.h:
+
+ - (header_complex.c, header_complex.h): deal with more complex data
+ structures with multiple and variable length indexes.
+
+1999-04-12 22:12 hardaker
+
+ * README.win32:
+
+ - (README.win32): new README from Joe Marzot.
+
+1999-04-07 15:00 mslifcak
+
+ * agent/mibgroup/snmpv3/usmUser.c, snmplib/snmp_api.c,
+ snmplib/system.c:
+
+ -(usmUser.c,system.c) plug mem leak; (snmp_api.c) enforce array limit.
+
+1999-04-07 12:23 mslifcak
+
+ * apps/encode_keychange.c, snmplib/tools.c:
+
+ -(apps/encode_keychange.c snmplib/tools.c) move keystroke functions to application.
+
+1999-04-07 12:17 mslifcak
+
+ * agent/mibgroup/ipfwchains/ipfwchains.c:
+
+ -(ipfwchains.c) remove multiple definitions of MATCH_FAILED
+
+1999-04-07 11:59 mslifcak
+
+ * agent/snmp2p.c, agent/snmp_agent.c,
+ agent/snmp_vars.h, agent/view_parse.c,
+ agent/mibgroup/util_funcs.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/misc/ipfwacc.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/hpux.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/v2party/context_vars.c,
+ agent/mibgroup/v2party/party_vars.c,
+ agent/mibgroup/v2party/view_vars.c, apps/snmpdelta.c,
+ apps/snmptest.c, apps/snmptrapd.c,
+ apps/snmpnetstat/route.c, apps/snmpnetstat/winstub.c,
+ snmplib/acl_parse.c, snmplib/context.h,
+ snmplib/context_parse.c, snmplib/party.h,
+ snmplib/party_parse.c, snmplib/read_config.c,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/snmp_impl.h, snmplib/vacm.h, snmplib/view.h
+:
+
+ - (agent/snmp2p.c agent/snmp_agent.c agent/snmp_vars.h
+ agent/view_parse.c agent/mibgroup/util_funcs.c
+ agent/mibgroup/examples/ucdDemoPublic.c
+ agent/mibgroup/host/hr_filesys.c
+ agent/mibgroup/host/hr_storage.c
+ agent/mibgroup/host/hr_swrun.c agent/mibgroup/host/hr_system.c
+ agent/mibgroup/mibII/at.c agent/mibgroup/mibII/icmp.c
+ agent/mibgroup/mibII/interfaces.c agent/mibgroup/mibII/ip.c
+ agent/mibgroup/mibII/system_mib.c agent/mibgroup/mibII/tcp.c
+ agent/mibgroup/mibII/udp.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/mibII/var_route.c agent/mibgroup/misc/ipfwacc.c
+ agent/mibgroup/snmpv3/usmUser.c
+ agent/mibgroup/ucd-snmp/extensible.c
+ agent/mibgroup/ucd-snmp/hpux.c agent/mibgroup/ucd-snmp/pass.c
+ agent/mibgroup/ucd-snmp/pass_persist.c
+ agent/mibgroup/ucd-snmp/proc.c
+ agent/mibgroup/v2party/context_vars.c
+ agent/mibgroup/v2party/party_vars.c
+ agent/mibgroup/v2party/view_vars.c apps/snmpdelta.c
+ apps/snmptest.c apps/snmptrapd.c apps/snmpnetstat/route.c
+ apps/snmpnetstat/winstub.c snmplib/acl_parse.c
+ snmplib/context.h snmplib/context_parse.c snmplib/party.h
+ snmplib/party_parse.c snmplib/read_config.c snmplib/snmp_api.c
+ snmplib/snmp_auth.c snmplib/snmp_impl.h snmplib/vacm.h
+ snmplib/view.h) fgets use sizeof mostly, oid base size is MAX_OID_LEN
+
+1999-04-07 11:34 hardaker
+
+ * apps/encode_keychange.c:
+
+ - (encode_keychange.c): removal of duplicate functions.
+
+1999-04-07 11:32 hardaker
+
+ * apps/: encode_keychange.c, snmpusm.c:
+
+ - (encode_keychange.c, snmpusm.c): debugging conversions.
+
+1999-04-07 11:27 hardaker
+
+ * agent/mibgroup/: examples/ucdDemoPublic.c,
+ mibII/sysORTable.c, mibII/vacm_vars.c, smux/smux.c
+, snmpv3/snmpEngine.c, snmpv3/usmUser.c,
+ target/snmpTargetAddrEntry.c, target/snmpTargetParamsEntry.c
+:
+
+ - (ucdDemoPublic.c, sysORTable.c, vacm_vars.c, smux.c, snmpEngine.c,
+ usmUser.c, snmpTargetAddrEntry.c, snmpTargetParamsEntry.c):
+ - debugging statement conversion
+
+1999-04-07 11:12 hardaker
+
+ * snmplib/: scapi.c, snmpv3.c:
+
+ - (scapi.c, snmpv3.c): debug typos and include file additions.
+
+1999-04-07 10:48 hardaker
+
+ * agent/mibgroup/mibII/snmp_mib.c:
+
+ - (snmp_mib.c): removed unnneeded header_snmp().
+
+1999-04-07 10:43 hardaker
+
+ * snmplib/debug.h:
+
+ - (debug.h): removed.
+
+1999-04-07 10:41 hardaker
+
+ * config.h.in, agent/snmp_vars.c,
+ apps/encode_keychange.c, apps/snmptrapd.c,
+ snmplib/Makefile.in, snmplib/all_general_local.h,
+ snmplib/keytools.c, snmplib/keytools.h,
+ snmplib/lcd_time.c, snmplib/md5.c,
+ snmplib/read_config.c, snmplib/scapi.c,
+ snmplib/snmp_api.c, snmplib/snmpusm.c,
+ snmplib/snmpv3.c, snmplib/tools.c, snmplib/tools.h
+:
+
+ - (config.h.in, snmp_vars.c, encode_keychange.c, snmptrapd.c,
+ Makefile.in, all_general_local.h, keytools.c, keytools.h,
+ lcd_time.c, md5.c, read_config.c, scapi.c, snmp_api.c, snmpusm.c,
+ snmpv3.c, tools.c, tools.h):
+ - misc merging, including fixes and debugging statement changes to
+ newer model.
+ - a few -Wall fixes.
+
+1999-04-07 06:17 mslifcak
+
+ * agent/snmp_vars.c, agent/snmpd.c,
+ agent/mibgroup/v2party/alarm.c, apps/encode_keychange.c
+, apps/snmpstatus.c, apps/snmptrapd.c,
+ apps/snmpnetstat/if.c, snmplib/all_system.h,
+ snmplib/debug.h, snmplib/keytools.c, snmplib/lcd_time.c
+, snmplib/md5.c, snmplib/mib.c,
+ snmplib/read_config.c, snmplib/scapi.c, snmplib/snmp.h
+, snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/snmpusm.c, snmplib/snmpv3.c, snmplib/system.h
+, snmplib/tools.c, snmplib/tools.h,
+ win32/config.h, win32/libsnmp/libsnmp.dsp,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ - () more ANSI header fixups; touchup for M$ Win32 build
+
+1999-04-06 22:14 mslifcak
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c) more v2party rework needed
+
+1999-04-06 22:13 mslifcak
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - (vacm_vars.c) - set global ptrs = 0.
+
+1999-04-06 21:23 mslifcak
+
+ * Makefile.in, agent/snmp_agent.c, agent/snmp_vars.c
+, agent/snmpd.c, agent/mibgroup/dummy/dummy.h,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/examples/ucdDemoPublic.h,
+ agent/mibgroup/examples/wombat.h,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/misc/dlmod.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpEngine.h,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.h,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats.h,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/v2party/context_vars.c, apps/snmpusm.c,
+ apps/snmpnetstat/if.c, apps/snmpnetstat/winstub.c,
+ apps/snmpnetstat/winstub.h, snmplib/lcd_time.c,
+ snmplib/lcd_time.h, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmpusm.c,
+ snmplib/snmpusm.h, snmplib/system.c, snmplib/tools.c
+:
+
+ - changes for ANSI headers; POSIX(index vs strchr); minor fixes
+
+1999-04-06 15:38 hardaker
+
+ * agent/mibgroup/mibincl.h,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/mibII/vacm_vars.h, apps/snmptrapd.c,
+ snmplib/snmp_api.c, testing/Makefile.in:
+
+ - (mibincl.h, ucdDemoPublic.c, vacm_vars.h, snmptrapd.c, snmp_api.c,
+ Makefile.in): final merge pieces of recent v3 line changes.
+
+1999-04-06 15:12 hardaker
+
+ * ISSUES, Makefile.in, Makefile.top, acconfig.h
+, aclocal.m4, config.h.in, configure,
+ configure.in, agent/Makefile.in,
+ agent/agent_read_config.c, agent/agent_read_config.h,
+ agent/auto_nlist.h, agent/m2m.h, agent/snmp2p.c,
+ agent/snmp_agent.c, agent/snmp_agent.h,
+ agent/snmp_vars.c, agent/snmp_vars.h, agent/snmpd.c
+, agent/snmpd.h, agent/mibgroup/Makefile.in,
+ agent/mibgroup/mibincl.h, agent/mibgroup/snmpv3mibs.h,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h
+, agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/examples/ucdDemoPublic.cmds,
+ agent/mibgroup/examples/ucdDemoPublic.conf,
+ agent/mibgroup/examples/ucdDemoPublic.h,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/snmpEngine.h,
+ agent/mibgroup/snmpv3/snmpMPDStats.c,
+ agent/mibgroup/snmpv3/snmpMPDStats.h,
+ agent/mibgroup/snmpv3/usmStats.c,
+ agent/mibgroup/snmpv3/usmStats.h,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/snmpv3/usmUser.h,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c, apps/.cvsignore
+, apps/Makefile.in, apps/encode_keychange.c,
+ apps/snmp_parse_args.c, apps/snmpget.c,
+ apps/snmpset.c, apps/snmptrapd.c, apps/snmpusm.c
+, apps/snmpnetstat/Makefile.in, local/snmp-ucd.sh
+, man/snmpcmd.1, man/snmpd.conf.5.def,
+ mibs/SNMP-TARGET-MIB.txt, mibs/SNMP-USER-BASED-SM-MIB.txt
+, mibs/SNMPv2-TC.txt, mibs/UCD-DEMO-MIB.txt,
+ mibs/UCD-SNMP-MIB.txt, snmplib/Makefile.in,
+ snmplib/all_general_local.h, snmplib/all_system.h,
+ snmplib/asn1.c, snmplib/debug.h, snmplib/keytools.c
+, snmplib/keytools.h, snmplib/lcd_time.c,
+ snmplib/lcd_time.h, snmplib/md5.c, snmplib/md5.h
+, snmplib/mib.c, snmplib/parse.c,
+ snmplib/party.h, snmplib/read_config.c,
+ snmplib/read_config.h, snmplib/scapi.c,
+ snmplib/scapi.h, snmplib/snmp-tc.h, snmplib/snmp.c
+, snmplib/snmp.h, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_client.h,
+ snmplib/snmp_impl.h, snmplib/snmpusm.c,
+ snmplib/snmpusm.h, snmplib/snmpv3.c, snmplib/snmpv3.h
+, snmplib/system.c, snmplib/system.h,
+ snmplib/tools.c, snmplib/tools.h,
+ snmplib/transform_oids.h, snmplib/vacm.h,
+ snmplib/view.c, testing/.cvsignore,
+ testing/Makefile.in, testing/README, testing/T.c,
+ testing/T.sh, testing/data.keychange-md5,
+ testing/data.keychange-sha1, testing/data.keychange-sha1-des
+, testing/data.kul-md5, testing/data.kul-sha1,
+ testing/demo.remote, testing/demo2,
+ testing/demo2.functions, testing/demo2.setupfile,
+ testing/etimetest.c, testing/eval_oneprogram.sh,
+ testing/eval_suite.sh, testing/eval_testlist,
+ testing/eval_tools.sh, testing/keymanagetest.c,
+ testing/misctest.c, testing/scapitest.c,
+ testing/test_keychange.sh, testing/test_kul.sh:
+
+ - (*): Merged the 4.0 line into the 3.6.1 line.
+
+1999-04-06 11:33 mslifcak
+
+ * agent/mibgroup/: host/hr_filesys.c, host/hr_proc.c,
+ ipfwchains/libipfwc.c, mibII/icmp.c, mibII/ip.c
+, mibII/route_write.c, mibII/tcp.c, mibII/udp.c
+, smux/smux.c, target/snmpTargetAddrEntry.c,
+ target/snmpTargetAddrEntry.h, target/snmpTargetParamsEntry.c
+, target/snmpTargetParamsEntry.h,
+ ucd-snmp/memory_solaris2.c, ucd-snmp/memory_solaris2.h:
+
+ - another round of ANSI-fying the agent completed.
+
+1999-04-06 10:59 mslifcak
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ - (extensible.c) quell warning about comparing pointer with non-pointer.
+
+1999-04-06 09:23 hardaker
+
+ * config.guess, config.sub:
+
+ - (config.guess, config.sub): new versions from autoconf 2.13.
+
+1999-04-05 15:59 mslifcak
+
+ * config.h.in, configure, configure.in,
+ agent/agent_read_config.c, agent/snmp_vars.c,
+ agent/mibgroup/ucd-snmp/loadave.c:
+
+ - Build using CygWin32 (includes Niels B.'s snmp_vars.c patch).
+
+1999-04-05 14:22 mslifcak
+
+ * snmplib/system.c:
+
+ - Build with CygWin32
+
+1999-04-05 14:10 mslifcak
+
+ * apps/snmpnetstat/: Makefile.in, if.c, winstub.c
+, winstub.h:
+
+ - build snmpnetstat with CygWin32
+
+1999-04-05 11:06 mslifcak
+
+ * apps/snmp_parse_args.c, apps/snmpnetstat/main.c,
+ snmplib/snmp_api.c:
+
+ - (snmp_api.c, main.c, snmp_parse_args.c) Joe Marzot's fix to copy even an empty community name.
+
+1999-04-01 13:10 mslifcak
+
+ * snmplib/libsnmp.h:
+
+ - (libsnmp.h) Asymptotically closer to supporting CMU constants.
+
+1999-03-28 16:17 hardaker
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c,
+ snmpTargetParamsEntry.c:
+
+ - (snmpTargetAddrEntry.c, snmpTargetParamsEntry.c):
+ - when using copy_word() don't skip spaces, since it does that.
+
+1999-03-28 16:11 hardaker
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.h,
+ snmpTargetParamsEntry.h:
+
+ - (snmpTargetAddrEntry.h, snmpTargetParamsEntry.h): relocate to
+ snmpModules.12, where they should be.
+
+1999-03-23 10:23 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ - (versiontag): regexp fix.
+
+1999-03-23 10:10 hardaker
+
+ * agent/mibgroup/mibdefs.h, agent/mibgroup/struct.h,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proc.h, man/snmpd.conf.5.def,
+ mibs/UCD-SNMP-MIB.txt:
+
+ - (mibdefs.h, struct.h, extensible.c, extensible.h, proc.c, proc.h,
+ snmpd.conf.5.def, UCD-SNMP-MIB.txt):
+ - per-process/exec fix scripts created.
+
+1999-03-23 10:10 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): make copy_word() return the next token, not the
+ next space.
+
+1999-03-23 10:09 hardaker
+
+ * man/Makefile.in:
+
+ - (Makefile.in): add more targets.
+
+1999-03-19 09:23 hardaker
+
+ * apps/: snmpget.c, snmpwalk.c:
+
+ - (snmpget.c, snmpwalk.c): fixed initialization and usage of "failures".
+
+1999-03-18 08:37 mslifcak
+
+ * agent/mibgroup/mibII/ip.c:
+
+ - (mibII/ip.c) fix MIB_IPCOUNTER_SYMBOL usage
+
+1999-03-17 13:53 mslifcak
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ -(hr_swrun.c) - prevent SunOS 4.1 core (sunos4 still primitive)
+
+1999-03-16 11:33 mslifcak
+
+ * agent/: snmp_vars.h, mibgroup/mibincl.h,
+ mibgroup/util_funcs.h, mibgroup/dummy/dummy.c,
+ mibgroup/examples/wombat.c, mibgroup/host/hr_device.c,
+ mibgroup/host/hr_disk.c, mibgroup/host/hr_filesys.c,
+ mibgroup/host/hr_network.c, mibgroup/host/hr_partition.c
+, mibgroup/host/hr_print.c, mibgroup/host/hr_proc.c
+, mibgroup/host/hr_storage.c,
+ mibgroup/host/hr_swinst.c, mibgroup/host/hr_swrun.c,
+ mibgroup/host/hr_system.c, mibgroup/mibII/icmp.c,
+ mibgroup/mibII/interfaces.c, mibgroup/mibII/ip.c,
+ mibgroup/mibII/snmp_mib.c, mibgroup/mibII/sysORTable.c
+, mibgroup/mibII/system_mib.c, mibgroup/mibII/tcp.c
+, mibgroup/mibII/udp.c, mibgroup/ucd-snmp/registry.c
+:
+
+ - move MATCH_FAILED/MATCH_SUCCEEDED from util_funcs.h to mibincl.h
+
+1999-03-16 11:23 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ -(snmp_api.c) consistent error return.
+
+1999-03-16 10:34 hardaker
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ - (hr_swrun.c): fix file descriptor leak on freebsd.
+
+1999-03-16 08:15 hardaker
+
+ * agent/mibgroup/misc/dlmod.c:
+
+ - (dlmod.c): removed a bogus new-line.
+
+1999-03-15 16:24 hardaker
+
+ * agent/Makefile.in:
+
+ - (agent/Makefile.in): don't do a make install of dlmods
+
+1999-03-15 16:02 hardaker
+
+ * bug-report, sedscript.in, version.h, FAQ
+, README, FAQ, README:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6.1 )
+
+1999-03-15 16:02 hardaker
+
+ * README:
+
+ - (README): mark with version num.
+
+1999-03-15 16:00 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): update for 3.6.1.
+
+1999-03-15 15:58 hardaker
+
+ * FAQ, NEWS:
+
+ - (FAQ, NEWS): updates to talk about the AGENT.txt file.
+
+1999-03-15 15:55 hardaker
+
+ * agent/: Makefile.in, mibgroup/Makefile.in:
+
+ - (Makefile.in): makefileindepend.
+
+1999-03-15 15:46 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c): fixes for linux 2.2 interface scanning.
+
+1999-03-15 15:31 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/mibII/interfaces.c:
+
+ - (configure, configure.in, interfaces.c, linux.h): detect
+ /proc/net/dev version at run time, not compile time.
+
+1999-03-15 15:20 hardaker
+
+ * agent/mibgroup/: host/hr_proc.c, host/hr_proc.h,
+ ucd-snmp/loadave.c, ucd-snmp/loadave.h:
+
+ - (hr_proc.c, hr_proc.h, loadave.c, loadave.h): fix try_loadave for solaris.
+
+1999-03-15 14:31 hardaker
+
+ * acconfig.h:
+
+ - (acconfig.h): added CMU_COMPATIBLE
+
+1999-03-15 14:30 hardaker
+
+ * snmplib/snmp.h:
+
+ - (snmp.h): remove unneeded commented out define.
+
+1999-03-15 09:42 mslifcak
+
+ * config.h.in, apps/snmpstatus.c, apps/snmptrapd.c
+, snmplib/libsnmp.h, snmplib/snmp.h,
+ snmplib/snmp_api.c, snmplib/snmp_client.c,
+ win32/config.h:
+
+ - second pass at CMU_COMPAT: Disable by default, leave snmp_parse alone.
+
+1999-03-15 08:49 hardaker
+
+ * snmplib/: Makefile.in, snmp_api.c:
+
+ - (Makefile.in, snmp_api.c):
+ - revert to snmp_parse.
+ - don't install libsnmp.h.
+
+1999-03-15 05:54 mslifcak
+
+ * snmplib/: Makefile.in, libsnmp.h, mib.c,
+ snmp.h, snmp_api.c:
+
+ - (Makefile.in libsnmp.h mib.c snmp.h snmp_api.c) update CMU_COMPATIBLE
+
+1999-03-12 15:33 hardaker
+
+ * agent/mibgroup/ipfwchains/: IPFWCHAINS-MIB.txt,
+ ipfwchains.h:
+
+ - (IPFWCHAINS-MIB.txt, ipfwchains.h): move to a sub-oid in the
+ experimental tree.
+
+1999-03-12 15:24 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/ipfwchains/IPFWCHAINS-MIB.txt,
+ agent/mibgroup/ipfwchains/README,
+ agent/mibgroup/ipfwchains/ipfwc_kernel_headers.h,
+ agent/mibgroup/ipfwchains/ipfwchains.c,
+ agent/mibgroup/ipfwchains/ipfwchains.h,
+ agent/mibgroup/ipfwchains/libipfwc.c,
+ agent/mibgroup/ipfwchains/libipfwc.h:
+
+ - (configure, configure.in, IPFWCHAINS-MIB.txt, README,
+ ipfwc_kernel_headers.h, ipfwchains.c, ipfwchains.h, libipfwc.c,
+ libipfwc.h): Patch from Didier Dhaenens:
+ - new modules: ipfwchains.
+
+1999-03-12 15:23 hardaker
+
+ * INSTALL:
+
+ - (INSTALL): don't print module list here... tell them to look at
+ configure --help.
+
+1999-03-12 14:54 mslifcak
+
+ * agent/mibgroup/: target.h, host/hr_system.h,
+ target/snmpTargetAddrEntry.c, target/snmpTargetAddrEntry.h
+, target/snmpTargetParamsEntry.c,
+ target/snmpTargetParamsEntry.h:
+
+ - restore config_require logic; fix sprintf calls to compile under SunOS 4.1.x.
+
+1999-03-12 14:36 hardaker
+
+ * agent/mibgroup/util_funcs.h:
+
+ - (util_funcs.h): MATCH_FAILED -> -1, since some use it.
+
+1999-03-12 14:35 mslifcak
+
+ * agent/mibgroup/: target.h, target/snmpTargetAddrEntry.h
+, target/snmpTargetParamsEntry.h:
+
+ - (target.h, target/*.h) require util_funcs once.
+
+1999-03-12 14:34 mslifcak
+
+ * agent/mibgroup/host/: hr_swrun.c, hr_system.h:
+
+ - (hr_system.h) - don't require hr_util; done in mibgroup/host.h
+ - (hr_swrun.c) - solaris2: make sure kvm_open is called before kd is used.
+ - (hr_swrun.c) - add lame sunos4 equivalent in HRSWRUNPERF_CPU.
+
+1999-03-12 14:17 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): protect strcpy() against a null password specified on the
+ config line.
+
+1999-03-12 14:17 hardaker
+
+ * NEWS:
+
+ - (NEWS): update.
+
+1999-03-12 12:20 hardaker
+
+ * local/mib2c:
+
+ - (mib2c): fix asn_parse functions to pass a pointer to the size variable.
+
+1999-03-12 11:31 mslifcak
+
+ * agent/dlmods/dlmod_mib.c:
+
+ - (dlmod_mib.c): explicit test for MATCH_FAILED
+
+1999-03-12 09:14 hardaker
+
+ * agent/mibgroup/: mibincl.h, dummy/dummy.c,
+ examples/wombat.c, host/hr_device.c, host/hr_disk.c
+, host/hr_filesys.c, host/hr_network.c,
+ host/hr_partition.c, host/hr_print.c, host/hr_proc.c
+, host/hr_storage.c, host/hr_swinst.c,
+ host/hr_swrun.c, host/hr_system.c, mibII/icmp.c
+, mibII/interfaces.c, mibII/ip.c,
+ mibII/snmp_mib.c, mibII/sysORTable.c,
+ mibII/system_mib.c, mibII/tcp.c, mibII/udp.c,
+ misc/dlmod.c, ucd-snmp/registry.c:
+
+ - (mibincl.h, dummy.c, wombat.c, hr_device.c, hr_disk.c, hr_filesys.c,
+ hr_network.c, hr_partition.c, hr_print.c, hr_proc.c, hr_storage.c,
+ hr_swinst.c, hr_swrun.c, hr_system.c, icmp.c, interfaces.c, ip.c,
+ snmp_mib.c, sysORTable.c, system_mib.c, tcp.c, udp.c, dlmod.c,
+ registry.c): fixed MATCH_FAILED/SUCCEEDED defines -> util_funcs.h.
+
+1999-03-12 07:08 mslifcak
+
+ * agent/dlmods/dlmod_mib.c:
+
+ - (dlmod_mib.c): Use MATCH_FAIL/SUCCEEDED in util_funcs.h
+
+1999-03-11 16:23 hardaker
+
+ * snmplib/: snmp_api.h, snmp_debug.h:
+
+ - (snmp_api.h, snmp_debug.h): Patch from Erik Jacobsen:
+ - fixed prototypes for DEBUGP() and DEBUGPOID().
+
+1999-03-11 16:22 hardaker
+
+ * agent/mibgroup/: util_funcs.c, util_funcs.h:
+
+ - (util_funcs.c, util_funcs.h): move MATCH_SUCCEEDED defs to .h.
+
+1999-03-11 16:10 hardaker
+
+ * local/mib2c:
+
+ - (mib2c): fixed a couple of bugs and ansi'ified things.
+
+1999-03-11 16:10 hardaker
+
+ * AGENT:
+
+ - (AGENT): removed AGENT
+
+1999-03-11 15:48 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.c:
+
+ - (memory_solaris2.c): changed some comments to /* */ instead of //.
+
+1999-03-11 15:48 hardaker
+
+ * README:
+
+ - (README): Added Mike Baer.
+
+1999-03-10 15:14 hardaker
+
+ * AGENT.txt:
+
+ - (AGENT.txt): NAME -> OID.
+
+1999-03-10 15:07 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): group lines were backwards.
+
+1999-03-10 15:07 hardaker
+
+ * AGENT.txt:
+
+ - (AGENT.txt): moved from AGENT to avoid non-case-sensitive w32 conflicts.
+
+1999-03-08 14:28 mslifcak
+
+ * apps/snmpnetstat/: if.c, route.c:
+
+ - (snmpnetstat:if.c, route.c) limit interface name sizes to fit fixed length buffers.
+
+1999-03-08 09:58 mslifcak
+
+ * snmplib/parse.c:
+
+ - (snmplib/parse.c) Complete Dave Shields' patch for continue after error.
+
+1999-03-08 05:07 mslifcak
+
+ * AGENT:
+
+ - (AGENT) MAX_NAME_LEN --> MAX_OID_LEN in example
+
+1999-03-08 05:01 mslifcak
+
+ * win32/config.h:
+
+ -(win32/config.h) remove unused SYS_TIME_NAME,GLOBALSECURITY. add new constants.
+
+1999-03-08 04:14 mslifcak
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c) use request data with request callback
+
+1999-03-08 04:02 mslifcak
+
+ * snmplib/parse.c:
+
+ (parse.c) - fix subid init; remove useless '-Pl' option.
+
+1999-03-05 17:36 hardaker
+
+ * FAQ:
+
+ - (FAQ): version update.
+
+1999-03-05 17:35 hardaker
+
+ * FAQ, bug-report, sedscript.in, version.h
+:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6 )
+
+1999-03-05 17:34 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): final update.
+
+1999-03-05 17:25 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (Makefile.in): make depend.
+
+1999-03-05 17:25 hardaker
+
+ * configure:
+
+ - (configure): autoconf update.
+
+1999-03-05 17:19 hardaker
+
+ * FAQ, NEWS:
+
+ - (FAQ, NEWS): final updates.
+
+1999-03-05 17:12 hardaker
+
+ * AGENT:
+
+ - (AGENT): Dave Shield's new document.
+
+1999-03-05 17:11 hardaker
+
+ * agent/mibgroup/mibII/system.h:
+
+ - (mibII/system.h): removed
+
+1999-03-05 17:08 hardaker
+
+ * FAQ:
+
+ - (FAQ): reference AGENT document.
+
+1999-03-05 16:48 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.c:
+
+ - (memory_solaris2.c): do error reporting for solaris memory support.
+
+1999-03-05 16:10 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.h:
+
+ - (vmstat.h): declair init_vmstat().
+
+1999-03-05 16:02 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): updated --help's module list.
+
+1999-03-05 15:57 hardaker
+
+ * agent/mibgroup/: kernel_sunos5.c, examples/wombat.c
+, host/hr_network.c, mibII/snmp_mib.h,
+ mibII/system_mib.h, ucd-snmp/disk.h,
+ ucd-snmp/errormib.h, ucd-snmp/extensible.h,
+ ucd-snmp/file.h, ucd-snmp/memory_solaris2.h,
+ ucd-snmp/pass.h, ucd-snmp/proc.h, ucd-snmp/registry.h
+, ucd-snmp/versioninfo.h:
+
+ - (kernel_sunos5.c, wombat.c, hr_network.c, snmp_mib.h, system_mib.h,
+ disk.h, errormib.h, extensible.h, file.h, memory_solaris2.h, pass.h,
+ proc.h, registry.h, versioninfo.h):
+ - -Wall fixes, mostly init_() routines declaired in the appropriate .h files.
+
+1999-03-05 15:38 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): update.
+
+1999-03-05 15:31 hardaker
+
+ * snmplib/snmp_impl.h:
+
+ - (snmp_impl.h): create UNDO
+
+1999-03-05 15:12 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - remove persistent storage info, since its not used this release.
+
+1999-03-05 11:02 mslifcak
+
+ * agent/mibgroup/mibII/tcp.c:
+
+
+ (tcp.c) - break out of infinite loop when klookup fails.
+
+1999-03-05 10:42 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Patch from Dave Shield:
+ - switch COMMIT and ACTION phases.
+
+1999-03-05 10:21 hardaker
+
+ * FAQ:
+
+ - (FAQ): update from Dave: rearranging and cleaning.
+
+1999-03-05 10:11 hardaker
+
+ * local/: mib2c, mib2c.conf:
+
+ - (mib2c, mib2c.conf): Patch from Dave Shield:
+ - the use of 'header_simple_table' rather than 'checkmib'
+ - explicit comparison with MATCH_FAILED
+ - don't set defaults for 'write_method' and 'var_len'
+ (since both 'header_generic' and 'checkmib' do this anyway)
+ - Use defined constants for variable initialisation in the
+ write routine (similarly in the mib2c.conf patch)
+ [This is one of my hobby-horses with our students, so I don't
+ see why "professional" programmers should be exempt!]
+
+ - Make proper use of the three-phase nature of SETs
+
+1999-03-05 09:40 mslifcak
+
+ * snmplib/system.c:
+
+
+ Fix Win32 version of gettimeofday: tv_usec was millisecs , return now = 0
+
+1999-03-04 18:11 mslifcak
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+
+ (snmp_api.c) - expose snmp_free; snmp_pdu_add_variable returns ptr to var for
+ future improved error recovery.
+
+1999-03-04 17:50 mslifcak
+
+ * agent/history.c, agent/mibgroup/dummy/dummy.c,
+ agent/mibgroup/dummy/dummy.h,
+ agent/mibgroup/examples/example.h,
+ agent/mibgroup/examples/wombat.h,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c, win32/config.h
+:
+
+
+ Replace uses of bzero with memset, bcopy with memcpy.
+ Fix prototypes.
+
+1999-03-04 17:00 mslifcak
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+
+ (sysORTable.c) - remove static u_long long_return, for consistency.
+
+1999-03-04 16:49 hardaker
+
+ * agent/mibgroup/util_funcs.c, agent/mibgroup/dummy/dummy.c
+, agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/wombat.c, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/ucd-snmp/hpux.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/v2party/alarm.c, snmplib/snmp_api.c:
+
+ - (util_funcs.c, dummy.c, example.c, wombat.c, tcp.c, hpux.c,
+ memory.c, alarm.c, snmp_api.c):
+ - misc fixes, -Wall mostly.
+
+1999-03-04 16:32 hardaker
+
+ * local/mib2c:
+
+ - (mib2c): Update from Dave Shield.
+
+1999-03-04 16:19 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat_freebsd2.c:
+
+ - (vmstat_freebsd2.c): Patch from Nick Amato:
+ - typo fixed.
+
+1999-03-04 16:14 hardaker
+
+ * agent/mibgroup/README.smux:
+
+ - (README.smux): Patch from Nick Amato:
+ - update.
+
+1999-03-04 15:44 hardaker
+
+ * agent/mibgroup/: util_funcs.c, util_funcs.h,
+ examples/example.c, mibII/sysORTable.c, misc/ipfwacc.c
+, ucd-snmp/disk.c, ucd-snmp/extensible.c,
+ ucd-snmp/file.c, ucd-snmp/loadave.c, ucd-snmp/memory.c
+, ucd-snmp/proc.c, ucd-snmp/vmstat.c,
+ ucd-snmp/vmstat_freebsd2.c:
+
+ - (util_funcs.c, util_funcs.h, example.c, sysORTable.c, ipfwacc.c,
+ disk.c, extensible.c, file.c, loadave.c, memory.c, proc.c, vmstat.c,
+ vmstat_freebsd2.c):
+ - create and use header_simple_table to replace checkmib().
+
+1999-03-04 15:29 mslifcak
+
+ * agent/mibgroup/host/hr_disk.c:
+
+
+ (hr_disk.c) - conditionally use defined DKC disk types
+
+1999-03-04 15:25 mslifcak
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+
+ (disk.c) - explicit braces to avoid ambiguous `else'
+
+1999-03-04 15:12 mslifcak
+
+ * agent/mibgroup/: host/hr_proc.c, ucd-snmp/loadave.c
+:
+
+
+
+ (hr_proc.c, loadave.c) - fixed core on getloadavg in a different way
+
+1999-03-04 13:18 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in): removed void check.
+
+1999-03-04 09:46 hardaker
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ - (hr_swinst.c): Patch from mslifcak@iss.net:
+ - When the agent is compiled with HAVE_LIBRPM set, yet no database
+ is found, agent will core...
+
+1999-03-04 09:38 hardaker
+
+ * remove-files, local/ece-snmpd.conf,
+ local/fixproc.conf:
+
+ - (remove-files, ece-snmpd.conf, fixproc.conf):
+ - removed ece specific config files from the repository.
+ - don't remove local/*.conf in the first place anymore.
+
+1999-03-04 09:33 hardaker
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ - (loadave.c): Patch from Chris Hughes:
+ - fix load average on solaris.
+
+1999-03-04 09:24 mslifcak
+
+ * Makefile.in:
+
+
+
+ (Makefile.in) - find mibdefs.h when not building in the source tree
+
+1999-03-04 09:20 mslifcak
+
+ * agent/snmpd.c, agent/mibgroup/target/snmpTargetAddrEntry.c
+, agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ apps/snmptrapd_handlers.c, snmplib/snmp_client.c:
+
+
+
+ (agent/snmpd.c, snmplib/snmp_client.c): remove duplicate includes
+
+ (agent/mibgroup/target/snmpTargetAddrEntry.c, agent/mibgroup/target/snmpTargetParamsEntry.c, agent/mibgroup/ucd-snmp/memory_solaris2.c, apps/snmptrapd_handlers.c): change "*word" to "*token" to help some compiler
+
+1999-03-04 09:07 hardaker
+
+ * configure, configure.in:
+
+ - (configure.in, configure): fix void test for ansi compilers.
+
+1999-03-04 08:36 hardaker
+
+ * agent/mibgroup/README.smux:
+
+ - (README.smux): add Nick.
+
+1999-03-04 08:36 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ - (versiontag): repository move.
+
+1999-03-04 04:08 mslifcak
+
+ * apps/snmpnetstat/if.c:
+
+
+ (snmpnetstat/if.c) - add void to empty formal parameter list
+
+1999-03-03 18:02 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre10 )
+
+1999-03-03 18:02 hardaker
+
+ * NEWS:
+
+ - (NEWS): mention SMUX.
+
+1999-03-03 18:00 hardaker
+
+ * NEWS:
+
+ - (NEWS): mention name change.
+
+1999-03-03 17:51 hardaker
+
+ * ChangeLog, FAQ, NEWS, PORTING, README
+, TODO, bug-report, agent/snmpd.c,
+ local/README.mib2c:
+
+ - (ChangeLog, FAQ, NEWS, PORTING, README, TODO, bug-report, snmpd.c,
+ README.mib2c): ece.ucdavis.edu -> ucd-snmp.ucdavis.edu.
+
+1999-03-03 11:40 hardaker
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ - (proc.c, solaris.h): Patch from Chris Hughes:
+ - Use /proc on solaris.
+
+1999-03-03 10:22 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.c:
+
+ - (memory_solaris2.c): ansi'ify the config function.
+
+1999-03-03 08:28 hardaker
+
+ * configure:
+
+ - (configure): ran autoconf...
+
+1999-03-03 08:25 hardaker
+
+ * README:
+
+ - (README): Added Nick.
+
+1999-03-02 15:21 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): Patch from Michael Slifcak:
+ - Linux compiles die at SO_RCVTIMEO.
+ - -Wall type fixes.
+
+1999-03-02 15:18 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): typo.
+
+1999-03-02 15:18 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.c:
+
+ - (memory_solaris2.c): typecast function with (void).
+
+1999-03-02 15:18 hardaker
+
+ * agent/mibgroup/smux.h:
+
+ - (smux.h): top level smux fake module header.
+
+1999-03-02 15:17 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/snmp_debug.c,
+ snmplib/snmp_debug.h:
+
+ - (acconfig.h, config.h.in, configure, configure.in, snmp_debug.c,
+ snmp_debug.h):
+ - new flag: --disable-debugging to completely turn off its support.
+ - renaming of DODEBUG to SNMP_ALWAYS_DEBUG.
+ - clean up of the configure script options listed, including putting
+ a list of available modules for compilation into the agent.
+
+1999-03-02 13:23 hardaker
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ - (var_route.c): don't return a pointer to a pointer.
+
+1999-03-02 10:42 hardaker
+
+ * agent/mibgroup/: mibII/system_mib.c, mibII/vacm_vars.c
+, misc/ipfwacc.c:
+
+ - (system_mib.c, vacm_vars.c, ipfwacc.c): Patch from Michael Slifcak:
+ - Suggested fixes to eliminate more shadowed global references.
+ - fixups for prototype [(void) replacing ()].
+
+1999-03-02 08:47 hardaker
+
+ * snmplib/asn1.h:
+
+ - (asn1.h): Patch from Dave Shield:
+ - Don't define MAX_NAME_LEN if defined somewhere else.
+
+1999-03-01 17:43 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c):
+ - allow null length passwords.
+ - clean up debugging output.
+
+1999-03-01 16:22 hardaker
+
+ * snmplib/asn1.h:
+
+ - (asn1.h): put back in MAX_NAME_LEN temporarily.
+
+1999-03-01 16:20 hardaker
+
+ * man/: des.1, des.3:
+
+ - (des.1, des.3): removed unused manual pages.
+
+1999-03-01 16:19 hardaker
+
+ * man/: snmp.conf.5.def, snmp_config.5.def, snmpd.1.def
+, snmptrapd.conf.5.def:
+
+ - (snmp.conf.5.def, snmp_config.5.def, snmpd.1.def, snmptrapd.conf.5.def):
+ - remove reference to ECE dept.
+
+1999-03-01 16:19 hardaker
+
+ * man/.cvsignore:
+
+ - (.cvsignore): ignore targets.
+
+1999-03-01 16:17 hardaker
+
+ * man/: mib_api.3, read_config.3.def, snmp.conf.5.def
+, snmp_config.5.def, snmpd.1.def,
+ snmpd.conf.5.def, snmptest.1, snmptrapd.conf.5.def
+, variables.5:
+
+ - (mib_api.3, read_config.3.def, snmp.conf.5.def, snmp_config.5.def,
+ snmpd.1.def, snmpd.conf.5.def, snmptest.1, snmptrapd.conf.5.def,
+ variables.5): Michael Slifcak:
+ - spell check.
+
+1999-03-01 16:11 hardaker
+
+ * snmplib/Makefile.in:
+
+ - (Makefile.in): Patch from David F. Newman:
+ - removed a trailing backslash that wasn't needed.
+
+1999-03-01 16:10 hardaker
+
+ * agent/mibgroup/v2party/alarm.c:
+
+ - (alarm.c): Patch from Michael Slifcak:
+ - Cast to pointer to int may overflow the return buffer.
+
+1999-03-01 14:20 hardaker
+
+ * agent/mibgroup/smux/: smux.c, smux.h:
+
+ - (smux.c, smux.h): 3.6ified.
+
+1999-03-01 14:04 hardaker
+
+ * agent/mibgroup/smux/: smux.c, smux.h:
+
+ - (smux.c, smux.h): Patch from Nick Amato:
+ - completely re-written smux modules.
+
+1999-03-01 13:59 hardaker
+
+ * agent/: snmp_vars.c, snmp_vars.h:
+
+ - (snmp_vars.c, snmp_vars.h): make compare_tree() global.
+
+1999-03-01 13:03 hardaker
+
+ * snmplib/: context_parse.c, mib.c:
+
+ - (context_parse.c, mib.c): Patch from Michael Slifcak:
+ - typecasting for certain functions to (char *).
+
+1999-03-01 12:30 hardaker
+
+ * snmplib/asn1.h:
+
+ - (asn1.h): Patch from Mike Slifcak:
+ - added MIN_OID_LEN for instructional use mostly (its unused).
+
+1999-03-01 12:29 hardaker
+
+ * snmplib/snmp_client.c:
+
+ - (snmp_client.c): Patch from Mike Slifcak:
+ - variable renaming.
+
+1999-03-01 12:29 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): put a proper (void) into the function prototype.
+
+1999-03-01 12:28 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): sprintf arg mismatch.
+
+1999-03-01 12:28 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Mike Slifcak:
+ - remove duplicate case entries.
+
+1999-03-01 12:27 hardaker
+
+ * apps/snmpnetstat/if.c:
+
+ - (if.c): Patch from Mike Slifcak:
+ - free the interface table.
+
+1999-03-01 12:27 hardaker
+
+ * agent/mibgroup/ucd-snmp/errormib.c:
+
+ - (errormib.c): Patch from Mike Slifcak:
+ - remove errno variable.
+
+1999-03-01 12:27 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Patch from Mike Slifcak:
+ - renaming of variables away from system function names (index -> lindex).
+
+1999-03-01 12:26 hardaker
+
+ * agent/dlmods/dlmod_mib.c:
+
+ - (dlmod_mib.c): Patch from Mike Slifcak:
+ - initialize variable to 0.
+
+1999-03-01 10:48 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): typo: fileMax -> fileErrorFlag name change.
+
+1999-02-26 16:33 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre9 )
+
+1999-02-26 16:11 hardaker
+
+ * man/: Makefile.in, read_config.3.def,
+ snmp.conf.5.def, snmp_config.5.def, snmpd.conf.5.def
+, snmptrapd.8, snmptrapd.conf.5.def:
+
+ - (Makefile.in, read_config.3.def, snmp.conf.5.def, snmp_config.5.def,
+ snmpd.conf.5.def, snmptrapd.8, snmptrapd.conf.5.def):
+ - new documentation on configuration capabilities.
+
+1999-02-26 16:10 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): usage update, and -H support.
+
+1999-02-26 16:10 hardaker
+
+ * NEWS:
+
+ - (NEWS): update for 3.6 release.
+
+1999-02-26 16:06 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): update and made better examples.
+
+1999-02-26 15:42 hardaker
+
+ * snmplib/: mib.c, parse.c, parse.h:
+
+ - (mib.c, parse.c, parse.h): Patch from Michael Slifcak:
+ - Unlinked OID ... ccitt 0 fix courtesy of Dave Shield.
+ - Continue after reserved word error fix courtesy of Dave Shield.
+ - Modification to #2 courtesy of Niels Baggesen.
+ - Modification to print sub-identifier == 0
+ - variable renaming.
+ - Instead of re-ordering all singly-linked lists, use a new member
+ that flags when a report has begun.
+
+1999-02-26 15:02 hardaker
+
+ * agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/loadave.h, mibs/UCD-SNMP-MIB.txt
+:
+
+ - (loadave.c, loadave.h, UCD-SNMP-MIB.txt):
+ - implement load average reporting as a integer and as a float.
+
+1999-02-25 10:03 hardaker
+
+ * README, agent/mibgroup/ucd_snmp.h,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c,
+ agent/mibgroup/ucd-snmp/memory_solaris2.h:
+
+ - (README, ucd_snmp.h, memory_solaris2.c, memory_solaris2.h): Patch
+ from David F. Newman:
+ - memory support for solaris2.
+
+1999-02-24 17:10 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in, linux.h):
+ - Check for and handle 2.2 /proc/net/dev changes.
+
+1999-02-24 14:43 hardaker
+
+ * mibs/IANAifType-MIB.txt:
+
+ - (IANAifType-MIB.txt): update.
+
+1999-02-22 09:44 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Michael Slifcak:
+ - Don't print "can't find module XXX" messages without warnings turned on.
+
+1999-02-22 09:11 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from mslifcak@iss.net:
+ - The command line option to select "allow underscore in MIB
+ symbols" is missing.
+
+1999-02-17 16:23 dreeder
+
+ * local/snmp-ucd.sh:
+
+ file snmp-ucd.sh was initially added on branch V3-b3.
+
+1999-02-17 16:14 hardaker
+
+ * apps/snmpnetstat/: winstub.c, winstub.h:
+
+ - (winstub.c, winstub.h): patch from Michael Slifcak:
+ - generic windows API replacements.
+
+1999-02-17 16:13 hardaker
+
+ * agent/snmpd.c, agent/mibgroup/dummy/dummy.c,
+ agent/mibgroup/examples/wombat.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/vacm_vars.c, agent/mibgroup/misc/dlmod.c
+, agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c, snmplib/mib.c,
+ snmplib/read_config.c:
+
+ - (snmpd.c, dummy.c, wombat.c, system_mib.c, vacm_vars.c, dlmod.c,
+ disk.c, extensible.c, file.c, loadave.c, memory.c,
+ memory_freebsd2.c, pass.c, pass_persist.c, proc.c, mib.c,
+ read_config.c): word -> token ("word" is reserved in some compilers.
+
+1999-02-17 15:28 hardaker
+
+ * win32/: config.h, win32.dsw, libsnmp/libsnmp.dsp
+, libsnmp_dll/libsnmp.def, libsnmp_dll/libsnmp_dll.dsp
+, snmpnetstat/snmpnetstat.dsp, snmptable/snmptable.dsp
+:
+
+ - (config.h, win32.dsw, libsnmp.dsp, libsnmp.def, libsnmp_dll.dsp,
+ snmpnetstat.dsp, snmptable.dsp): Patch from Michael Slifcak:
+ - win32 updates.
+
+1999-02-17 15:23 hardaker
+
+ * snmplib/: parse.c, party_parse.c, snmp_auth.c
+:
+
+ - (parse.c, party_parse.c, snmp_auth.c): Patch from Michael Slifcak:
+ - variable name conflict fixes.
+
+1999-02-17 15:22 hardaker
+
+ * snmplib/snmp_debug.c:
+
+ - (snmp_debug.c): Patch from Michael Slifcak:
+ - debug_args was declared twice.
+ - header fixes for win32.
+
+1999-02-17 15:21 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): Patch from Michael Slifcak:
+ - fix fprint_variable to not recurse.
+
+1999-02-17 15:19 hardaker
+
+ * snmplib/context_parse.c:
+
+ - (context_parse.c): Patch from Michael Slifcak:
+ - don't use a variable called 'time'. Tsk tsk.
+
+1999-02-17 15:19 hardaker
+
+ * snmplib/asn1.c:
+
+ - (asn1.c): Patch from Michael Slifcak:
+ - comment reformatting.
+
+1999-02-17 15:18 hardaker
+
+ * mibs/IANAifType-MIB.txt:
+
+ - (IANAifType-MIB.txt): Patch from Michael Slifcak:
+ - use a '-' instead of a '.' for IEEE802-11.
+
+1999-02-17 15:17 hardaker
+
+ * man/Makefile.in:
+
+ - (Makefile.in): separate target for generated manual pages.
+
+1999-02-17 15:16 hardaker
+
+ * local/: mib2c, mib2c.conf:
+
+ - (mib2c, mib2c.conf): update again for better still output.
+
+1999-02-17 15:15 hardaker
+
+ * apps/snmpnetstat/: if.c, inet.c, main.c,
+ netstat.h, route.c:
+
+ - (if.c, inet.c, main.c, netstat.h, route.c): Patch from Michael Slifcak:
+ - make snmpnetstat win32 compatible.
+
+1999-02-17 15:13 hardaker
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c): Patch from Michael Slifcak:
+ - usage fix.
+
+1999-02-17 15:13 hardaker
+
+ * agent/snmpd.h:
+
+ - (snmpd.h): Patch from Michael Slifcak:
+ - remove reverse_bytes() prototype.
+
+1999-02-17 15:10 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c): Patch from Michael L. Hitch:
+ - fix if_name variable by making it static.
+
+1999-02-16 17:05 hardaker
+
+ * local/: mib2c, mib2c.conf:
+
+ - (mib2c, mib2c.conf): updated mib2c program... still in progress...
+
+1999-02-11 16:48 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ - (versiontag): update.
+
+1999-02-11 16:48 hardaker
+
+ * version.h, bug-report, sedscript.in:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre8 )
+
+1999-02-11 16:46 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ - (version.h bug-report sedscript.in): version tag ( Ext-3-6-pre8 )
+
+1999-02-11 16:34 hardaker
+
+ * agent/mibgroup/mibII/tcp.c:
+
+ - (tcp.c): var_tcpEntry was checking against the incoming oid with the
+ wrong length and could succeed at times when it shouldn't have.
+
+1999-02-11 16:23 hardaker
+
+ * snmplib/: acl_parse.c, context_parse.c,
+ party_parse.c, read_config.c, snmp_api.c:
+
+ - (acl_parse.c, context_parse.c, party_parse.c, read_config.c, snmp_api.c):
+ - More buf size standardizations that Michael missed.
+ - A few MAX_NAME_LEN -> MAX_OID_LEN conversions that Michael missed.
+
+1999-02-11 16:22 hardaker
+
+ * agent/mibgroup/host_res.h:
+
+ - (host_res.h): include snmp_vars.h ahead of var_struct.h.
+
+1999-02-11 16:09 hardaker
+
+ * agent/snmp_agent.c, agent/snmp_vars.c,
+ agent/dlmods/dlmod_mib.c, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/dummy/dummy.c,
+ agent/mibgroup/examples/wombat.c,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c, agent/mibgroup/host/hr_proc.c
+, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/mibII/udp.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/smux/snmp_bgp.c,
+ agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/v2party/acl_vars.c,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/context_vars.c,
+ agent/mibgroup/v2party/event.c,
+ agent/mibgroup/v2party/event.h,
+ agent/mibgroup/v2party/party_vars.c,
+ agent/mibgroup/v2party/view_vars.c, apps/snmp_parse_args.c
+, apps/snmpbulkwalk.c, apps/snmpdelta.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, apps/snmptable.c,
+ apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmpwalk.c
+, apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c
+, apps/snmpnetstat/main.c, snmplib/mib.c,
+ snmplib/snmp_api.c, snmplib/snmp_debug.c,
+ snmplib/snmp_impl.h:
+
+ - (*): Patch from Michael Slifcak:
+ - convert MAX_NAME_LEN -> MAX_OID_LEN.
+ - convert temporary character storage buffers to SPRINT_MAX_LEN.
+ - make the libraries print_ functions use the fprint_ function
+ already defined and pass it stdout.
+
+1999-02-09 14:35 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): increase buffer size for oid printing.
+
+1999-02-09 14:35 hardaker
+
+ * snmplib/snmp_debug.c:
+
+ - (snmp_debug.c): define a symbol for OID printing's storage buffer size.
+
+1999-02-09 14:10 hardaker
+
+ * local/mib2c:
+
+ - (mib2c): typo.
+
+1999-02-09 14:10 hardaker
+
+ * Makefile.in:
+
+ - (Makefile.in): make FAQ.html.
+
+1999-02-08 23:24 hardaker
+
+ * agent/dlmods/: dlmod_mib.c, dlmod_mib.h, example.c
+, example.h:
+
+ - (agent/dlmods): Patch from Michael Slifcak:
+ - misc fixes.
+
+1999-02-08 23:23 hardaker
+
+ * agent/mibgroup/: kernel_sunos5.c, mibincl.h:
+
+ - (kernel_sunos5.c, mibincl.h) Patch from Michael Slifcak:
+ - include updates.
+
+1999-02-08 23:20 hardaker
+
+ * agent/: mibgroup/util_funcs.c, mibgroup/util_funcs.h
+, snmp2p.c, snmp_agent.c, snmp_vars.c,
+ snmp_vars.h, snmpd.h, var_struct.h:
+
+ - (agent/*): Patch from Michael Slifcak:
+ - typedef all of the var_xxx and write method functions.
+
+1999-02-08 23:16 hardaker
+
+ * agent/mibgroup/: dummy/dummy.c, examples/example.c,
+ examples/example.h, examples/wombat.c, host/hr_device.c
+, host/hr_device.h, host/hr_disk.c, host/hr_disk.h
+, host/hr_filesys.c, host/hr_filesys.h,
+ host/hr_network.c, host/hr_network.h,
+ host/hr_partition.c, host/hr_partition.h,
+ host/hr_print.c, host/hr_print.h, host/hr_proc.c,
+ host/hr_proc.h, host/hr_storage.c, host/hr_storage.h
+, host/hr_swinst.c, host/hr_swinst.h,
+ host/hr_swrun.c, host/hr_swrun.h, host/hr_system.c
+, host/hr_system.h, mibII/at.c, mibII/at.h,
+ mibII/icmp.c, mibII/icmp.h, mibII/interfaces.c,
+ mibII/interfaces.h, mibII/ip.c, mibII/ip.h,
+ mibII/route_write.h, mibII/snmp_mib.c, mibII/snmp_mib.h
+, mibII/sysORTable.c, mibII/sysORTable.h,
+ mibII/system.h, mibII/system_mib.c, mibII/system_mib.h
+, mibII/tcp.c, mibII/tcp.h, mibII/udp.c,
+ mibII/udp.h, mibII/vacm_vars.c, mibII/vacm_vars.h
+, mibII/var_route.c, mibII/var_route.h,
+ misc/ipfwacc.c, misc/ipfwacc.h, smux/snmp_bgp.c,
+ smux/snmp_bgp.h, smux/snmp_ospf.c, smux/snmp_ospf.h
+, smux/snmp_rip2.c, smux/snmp_rip2.h,
+ ucd-snmp/disk.c, ucd-snmp/disk.h, ucd-snmp/errormib.c
+, ucd-snmp/errormib.h, ucd-snmp/extensible.c,
+ ucd-snmp/extensible.h, ucd-snmp/file.c, ucd-snmp/file.h
+, ucd-snmp/hpux.c, ucd-snmp/hpux.h,
+ ucd-snmp/loadave.c, ucd-snmp/loadave.h,
+ ucd-snmp/memory.c, ucd-snmp/memory.h,
+ ucd-snmp/memory_freebsd2.c, ucd-snmp/memory_freebsd2.h,
+ ucd-snmp/pass.c, ucd-snmp/pass.h,
+ ucd-snmp/pass_persist.c, ucd-snmp/pass_persist.h,
+ ucd-snmp/proc.c, ucd-snmp/proc.h, ucd-snmp/registry.c
+, ucd-snmp/registry.h, ucd-snmp/versioninfo.c,
+ ucd-snmp/versioninfo.h, ucd-snmp/vmstat.c,
+ ucd-snmp/vmstat.h, ucd-snmp/vmstat_freebsd2.c,
+ ucd-snmp/vmstat_freebsd2.h, v2party/acl_vars.c,
+ v2party/acl_vars.h, v2party/alarm.c, v2party/alarm.h
+, v2party/context_vars.c, v2party/context_vars.h,
+ v2party/event.c, v2party/event.h, v2party/party_vars.c
+, v2party/party_vars.h, v2party/view_vars.c,
+ v2party/view_vars.h:
+
+ - (agent/*): Patch from Michael Slifcak:
+ - typedef all of the var_xxx and write method functions.
+
+1999-02-08 15:21 hardaker
+
+ * snmplib/snmp_debug.c:
+
+ - (snmp_debug.c): sys/types.h
+
+1999-02-08 15:20 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c, snmp_api.h): Patch from Michael Slifcak:
+ - make snmp_oid_compare use const's.
+
+1999-02-08 15:19 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Michael Slifcak:
+ - use size_t instead of "unsigned" for xmalloc, etc.
+
+1999-02-08 15:18 hardaker
+
+ * apps/snmpnetstat/inet.c:
+
+ - (inet.c): proper bracket indentation.
+
+1999-02-08 15:17 hardaker
+
+ * apps/snmpnetstat/route.c:
+
+ - (route.c): Patch from Michael Slifcak:
+ - variable renaming index -> IfIndex.
+
+1999-02-08 15:15 hardaker
+
+ * apps/snmptrapd_handlers.c:
+
+ - (snmptrapd_handlers.c): nothing. really.
+
+1999-02-08 15:14 hardaker
+
+ * apps/snmpdelta.c:
+
+ - (snmpdelta.c): Patch from Michael Slifcak:
+ - variable renaming time -> m_time.
+
+1999-02-08 15:13 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Patch from Michael Slifcak:
+ - variable renaming index -> iindex.
+
+1999-02-08 15:11 hardaker
+
+ * agent/: agent_read_config.c, agent_read_config.h:
+
+ - (agent_read_config.c, agent_read_config.h): Patch from Michael Slifcak:
+ - make tree_compare() be a real typedef'ed function again now that
+ qsorting is no longer needed.
+
+1999-02-08 15:08 hardaker
+
+ * FAQ:
+
+ - (FAQ): Patch from Michael Slifcak:
+ - Tk.pm mention.
+
+1999-02-08 12:21 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): Patch from John Polstra:
+ - call accept() to get the socket file descriptor.
+
+1999-02-02 22:02 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt):
+ - mention that the memory section isn't supported on all
+ architectures.
+
+1999-02-02 22:02 hardaker
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ - (hr_proc.c): use [0] index of load average table.
+
+1999-02-02 22:01 hardaker
+
+ * TODO:
+
+ - (TODO): Remove unsuppored mib nodes from output instead of returning 0's.
+
+1999-02-02 22:00 hardaker
+
+ * FAQ:
+
+ - (FAQ): mention lack of solaris memory support.
+
+1999-02-02 14:48 baerm
+
+ * agent/mibgroup/: target.h, target/snmpTargetAddrEntry.c
+, target/snmpTargetAddrEntry.h,
+ target/snmpTargetParamsEntry.c,
+ target/snmpTargetParamsEntry.h:
+
+ - (target.h, snmpTargetAddrEntry.c, snmpTargetAddrEntry.h,
+ snmpTargetParamsEntry.c, snmpTargetParamsEntry.h):
+ - Code added to support the target MIB, specifically the address and
+ params table.
+
+1999-02-02 14:34 baerm
+
+ * snmplib/read_config.c:
+
+ - (read_config.c):
+ - Updated copy_word to accept quoted strings, with included white
+ spaces. '\' escapes the following character.
+
+1999-02-02 13:34 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): typo: -L -> -A in help strings docs.
+
+1999-02-02 13:33 hardaker
+
+ * FAQ:
+
+ 2036 -> 2038
+
+1999-01-26 09:45 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): change reference IP net addresses to 10.10.10.0.
+
+1999-01-25 16:25 hardaker
+
+ * README, local/README.mib2c:
+
+ - (README, README.mib2c): mib2c readme file.
+
+1999-01-25 11:15 hardaker
+
+ * agent/agent_read_config.c, agent/snmp_vars.h,
+ agent/snmpd.c, agent/mibgroup/host_res.h,
+ agent/mibgroup/mibincl.h, agent/mibgroup/ucd-snmp/file.c
+, apps/snmpnetstat/inet.c, snmplib/parse.c,
+ snmplib/snmp_debug.c:
+
+ - (agent_read_config.c, snmp_vars.h, snmpd.c, host_res.h, mibincl.h,
+ file.c, inet.c, parse.c, snmp_debug.c):
+ - -Wall fixes.
+
+1999-01-25 11:11 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - test if __FUNCTION__ is supported by the compiler.
+
+1999-01-25 10:35 hardaker
+
+ * snmplib/snmp_debug.h:
+
+ - (snmp_debug.h): special test for __FUNCTION__ before using it.
+
+1999-01-25 10:34 hardaker
+
+ * snmplib/system.c:
+
+ - (system.c): fix strings.h include.
+
+1999-01-25 10:33 hardaker
+
+ * snmplib/: context_parse.c, mib.c, parse.c,
+ read_config.c, snmp_api.c, snmp_client.c,
+ system.c:
+
+ - (context_parse.c, mib.c, parse.c, read_config.c, snmp_api.c,
+ snmp_client.c, system.c): Patch from Markku Laukkanen:
+ - ansi fixes.
+
+1999-01-25 10:28 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ - (versiontag): typo.
+
+1999-01-25 10:27 hardaker
+
+ * apps/: snmpdelta.c, snmpstatus.c, snmptest.c
+, snmptrap.c, snmptrapd_handlers.c,
+ snmpnetstat/inet.c, snmpnetstat/main.c:
+
+ - (snmpdelta.c, snmpstatus.c, snmptest.c, snmptrap.c,
+ snmptrapd_handlers.c, inet.c, main.c): Patch from Markku Laukkanen:
+ - more ansi fixes.
+
+1999-01-22 07:23 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - Check for NULL on session closes.
+
+1999-01-21 08:42 hardaker
+
+ * agent/mibgroup/Makefile.in:
+
+ - (Makefile.in): remove ucd specific module depends.
+
+1999-01-21 08:40 hardaker
+
+ * acconfig.h, config.h.in, snmplib/snmp_api.c
+, win32/config.h:
+
+ - (acconfig.h, config.h.in, snmp_api.c, config.h): Patch from Michael
+ J. Slifcak:
+ - NO_NULL_COMUNITY -> NO_ZEROLENGTH_COMMUNITY.
+
+1999-01-21 08:39 hardaker
+
+ * FAQ:
+
+ - (FAQ): Patch from Michael J. Slifcak:
+ - typo on Joe's name fixed.
+
+1999-01-20 17:11 hardaker
+
+ * FAQ, README:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre7 )
+
+1999-01-20 17:04 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre7 )
+
+1999-01-20 17:02 hardaker
+
+ * config.h.in:
+
+ - (config.h.in): ran autoheader
+
+1999-01-20 16:40 hardaker
+
+ * acconfig.h, config.h.in, apps/snmp_parse_args.c
+, apps/snmpnetstat/main.c, snmplib/snmp_api.c:
+
+ - (acconfig.h, config.h.in, snmp_parse_args.c, main.c, snmp_api.c):
+ Patch from Michael Slifcak:
+ - allow zero length (legal) community strings.
+
+1999-01-20 15:54 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): debugging changes.
+
+1999-01-20 15:54 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): export sdlist and sdlen variables.
+
+1999-01-20 15:50 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): remove ucd specific mib module make requirements.
+
+1999-01-20 15:49 hardaker
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ - (hr_swinst): #ifdef RPM protect a free routine.
+
+1999-01-20 15:48 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ - (smux.c): typo
+
+1999-01-20 15:31 hardaker
+
+ * README:
+
+ - (README): helping out changes.
+
+1999-01-20 15:30 hardaker
+
+ * COPYING:
+
+ - (COPYING): It's 1999
+
+1999-01-20 15:22 hardaker
+
+ * FAQ, README:
+
+ - (FAQ, README): added version stamp.
+
+1999-01-20 15:20 hardaker
+
+ * snmplib/Makefile.in, agent/Makefile.in,
+ agent/mibgroup/Makefile.in, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in:
+
+ - (Makefile.in): make depend.
+
+1999-01-20 15:20 hardaker
+
+ * snmplib/Makefile.in:
+
+ - (Makefile.in): install ucd-snmp-includes.h.
+
+1999-01-20 15:18 hardaker
+
+ * snmplib/ucd-snmp-includes.h:
+
+ - (ucd-snmp-includes.h): minimalish include set for library clients.
+
+1999-01-20 15:17 hardaker
+
+ * agent/mibgroup/ucd-snmp/: disk.c, errormib.c,
+ extensible.c, loadave.c, memory.c:
+
+ - (disk.c, errormib.c, extensible.c, loadave.c, memory.c):
+ - linux 2.1 kernel needs asm/page.h (all includes need to be re-written).
+
+1999-01-20 15:16 hardaker
+
+ * agent/mibgroup/mibII/: at.c, interfaces.c, ip.c
+, route_write.c, tcp.c, udp.c, var_route.c
+:
+
+ - (at.c, interfaces.c, ip.c, route_write.c, tcp.c, udp.c,
+ var_route.c):
+ - sys/stream.h needed by SCO.
+ - interfaces scan fixes for linux 2.0 vs 2.1 can be configured elsewhere now.
+ - protect get_address calls against NULL pointer returns.
+
+1999-01-20 15:14 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ - (versiontag): version tagging ability to do many things.
+
+1999-01-20 15:14 hardaker
+
+ * agent/: agent_read_config.c, snmp_vars.c:
+
+ - (agent_read_config.c, snmp_vars.c): include sys/stream.h for SCO.
+
+1999-01-20 15:14 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in):
+ - check for asm/page.h (linux).
+ - check for sys/stream.h (SCO).
+ - Fix rtentry test.
+
+1999-01-20 15:11 hardaker
+
+ * Makefile.in:
+
+ - (Makefile.in): version tag creation.
+
+1999-01-20 12:23 hardaker
+
+ * agent/agent_read_config.c, agent/auto_nlist.c,
+ agent/snmp_agent.c, agent/snmpd.c,
+ agent/mibgroup/host_res.h, agent/mibgroup/mibincl.h,
+ apps/.cvsignore, apps/snmp_parse_args.c,
+ apps/snmptrapd.c, apps/snmptrapd_handlers.c,
+ apps/snmpnetstat/if.c, snmplib/Makefile.in,
+ snmplib/mib.c, snmplib/parse.c, snmplib/read_config.c
+, snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_debug.c, snmplib/snmp_debug.h,
+ snmplib/vacm.c:
+
+ - (agent_read_config.c, auto_nlist.c, snmp_agent.c, snmpd.c,
+ host_res.h, mibincl.h, .cvsignore, snmp_parse_args.c, snmptrapd.c,
+ snmptrapd_handlers.c, if.c, Makefile.in, mib.c, parse.c,
+ read_config.c, snmp_api.c, snmp_api.h, snmp_debug.c, snmp_debug.h,
+ vacm.c): debugging support code moved to snmp_debug.[ch].
+
+1999-01-20 12:21 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c): typo in ansi changes.
+
+1999-01-20 12:21 hardaker
+
+ * acconfig.h:
+
+ - (acconfig.h): unneeded comment removed.
+
+1999-01-20 12:20 hardaker
+
+ * FAQ:
+
+ - (FAQ): perl-SNMP and y2k questions added.
+
+1999-01-20 12:19 hardaker
+
+ * agent/.pure, snmplib/.pure:
+
+ - (.pure, .pure, .pure): removed.
+
+1999-01-19 20:01 hardaker
+
+ * apps/snmptable.c, snmplib/mib.c, snmplib/parse.c
+, snmplib/snmp_auth.c, win32/libsnmp_dll/libsnmp.def
+:
+
+ - (snmptable.c, mib.c, parse.c, snmp_auth.c, libsnmp.def): Patch from
+ Michael J. Slifcak:
+ - apps/snmptable.c - some compilers warn comparing pointer with integer
+ - snmplib/mib.c - already mentioned before; here for complete-ness
+ - snmplib/parse.c - minor touchup of includes; system.h dup removed
+ - snmplib/snmp_api.h - MSVisual C++ doesn't have __FUNCTION__
+ - snmplib/snmp_auth.c - minor fix of comment
+ - win32/libsnmp_dll/libsnmp.def - snmp_parse_args needs a new function
+
+1999-01-19 19:59 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in): remove __P checking.
+
+1999-01-18 10:46 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/disk.h,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/errormib.h,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/file.h,
+ agent/mibgroup/ucd-snmp/hpux.c,
+ agent/mibgroup/ucd-snmp/hpux.h,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/loadave.h,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass.h,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/pass_persist.h,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proc.h,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/registry.h,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/versioninfo.h,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat.h,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h,
+ agent/mibgroup/v2party/acl_vars.c,
+ agent/mibgroup/v2party/acl_vars.h,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/alarm.h,
+ agent/mibgroup/v2party/context_vars.c,
+ agent/mibgroup/v2party/context_vars.h,
+ agent/mibgroup/v2party/event.c,
+ agent/mibgroup/v2party/event.h,
+ agent/mibgroup/v2party/party_vars.c,
+ agent/mibgroup/v2party/party_vars.h,
+ agent/mibgroup/v2party/view_vars.c,
+ agent/mibgroup/v2party/view_vars.h, apps/snmp_parse_args.c
+, apps/snmp_parse_args.h, apps/snmpbulkwalk.c,
+ apps/snmpdelta.c, apps/snmpget.c, apps/snmpgetnext.c
+, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c,
+ apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmptrapd_handlers.h,
+ apps/snmpwalk.c, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/netstat.h, apps/snmpnetstat/route.c,
+ win32/config.h:
+
+ - (README, apps, agent, acconfig.h): Patch from Markku Laukkanen:
+ - ansi'ify everything.
+
+1999-01-18 10:43 hardaker
+
+ * README, acconfig.h, agent/agent_read_config.c
+, agent/agent_read_config.h, agent/auto_nlist.c,
+ agent/auto_nlist.h, agent/kernel.c, agent/kernel.h
+, agent/snmp2p.c, agent/snmp_agent.c,
+ agent/snmp_agent.h, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmpd.c, agent/snmpd.h
+, agent/var_struct.h, agent/view_parse.c,
+ agent/dlmods/dlmod_mib.c, agent/dlmods/dlmod_mib.h,
+ agent/dlmods/example.c, agent/dlmods/example.h,
+ agent/mibgroup/host_res.h, agent/mibgroup/kernel_sunos5.c
+, agent/mibgroup/mibII.c, agent/mibgroup/mibII.h,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h
+, agent/mibgroup/v2party.c, agent/mibgroup/v2party.h
+, agent/mibgroup/dummy/dummy.c,
+ agent/mibgroup/dummy/dummy.h,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/example.h,
+ agent/mibgroup/examples/wombat.c,
+ agent/mibgroup/examples/wombat.h,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_device.h,
+ agent/mibgroup/host/hr_disk.c, agent/mibgroup/host/hr_disk.h
+, agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_filesys.h,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_network.h,
+ agent/mibgroup/host/hr_other.c,
+ agent/mibgroup/host/hr_other.h,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_partition.h,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_print.h, agent/mibgroup/host/hr_proc.c
+, agent/mibgroup/host/hr_proc.h,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_storage.h,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swinst.h,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_swrun.h,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hr_system.h,
+ agent/mibgroup/host/hr_utils.h, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/at.h, agent/mibgroup/mibII/icmp.c
+, agent/mibgroup/mibII/icmp.h,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ip.h,
+ agent/mibgroup/mibII/route_write.h,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib.h,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/system.h,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/system_mib.h, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/mibII/tcp.h, agent/mibgroup/mibII/udp.c
+, agent/mibgroup/mibII/udp.h,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/mibII/var_route.h, agent/mibgroup/misc/dlmod.c
+, agent/mibgroup/misc/dlmod.h,
+ agent/mibgroup/misc/ipfwacc.c, agent/mibgroup/misc/ipfwacc.h
+, agent/mibgroup/smux/smux.c, agent/mibgroup/smux/smux.h
+, agent/mibgroup/smux/snmp_bgp.c,
+ agent/mibgroup/smux/snmp_bgp.h,
+ agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_ospf.h,
+ agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/smux/snmp_rip2.h:
+
+ - (README, apps, agent, acconfig.h): Patch from Markku Laukkanen:
+ - ansi'ify everything.
+
+1999-01-16 23:13 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre6 )
+
+1999-01-16 23:12 hardaker
+
+ * snmplib/: acl.c, acl.h, acl_parse.c, asn1.c
+, asn1.h, context.c, context.h,
+ context_parse.c, int64.c, int64.h, md5.c,
+ md5.h, mib.c, mib.h, parse.c, parse.h
+, party.c, party.h, party_parse.c,
+ read_config.c, read_config.h, snmp.c, snmp.h
+, snmp_api.c, snmp_api.h, snmp_auth.c,
+ snmp_client.c, snmp_client.h, snmp_impl.h,
+ system.c, system.h, vacm.c, vacm.h,
+ view.c, view.h:
+
+ - (snmplib/*.[ch]): Patch from Markku Laukkanen:
+ - asni'ify all functions.
+
+1999-01-16 23:04 hardaker
+
+ * man/snmpcmd.1:
+
+ - (snmpcmd.1): updated -D description.
+
+1999-01-15 16:17 hardaker
+
+ * agent/mibgroup/smux/: smux.c, smux.h:
+
+ - (smux.c, smux.h): Patch from Nick Amato:
+ - smux patches.
+
+1999-01-15 15:58 hardaker
+
+ * snmplib/vacm.c:
+
+ - (vacm.c): DEBUGMSG typo.
+
+1999-01-15 15:58 hardaker
+
+ * apps/Makefile.in, snmplib/Makefile.in:
+
+ - (Makefile.in, Makefile.in): makefileindepend.
+
+1999-01-15 15:22 hardaker
+
+ * agent/: Makefile.in, agent_read_config.c,
+ snmp_vars.c, snmp_vars.h, mibgroup/Makefile.in
+, mibgroup/mibII.h, mibgroup/dummy/dummy.c,
+ mibgroup/dummy/dummy.h, mibgroup/examples/example.c,
+ mibgroup/examples/example.h, mibgroup/examples/wombat.c
+, mibgroup/examples/wombat.h, mibgroup/mibII/at.c,
+ mibgroup/mibII/at.h, mibgroup/mibII/icmp.c,
+ mibgroup/mibII/icmp.h, mibgroup/mibII/interfaces.c,
+ mibgroup/mibII/interfaces.h, mibgroup/mibII/ip.c,
+ mibgroup/mibII/ip.h, mibgroup/mibII/snmp_mib.c,
+ mibgroup/mibII/snmp_mib.h, mibgroup/mibII/sysORTable.c,
+ mibgroup/mibII/sysORTable.h, mibgroup/mibII/system.c,
+ mibgroup/mibII/system_mib.c, mibgroup/mibII/system_mib.h
+, mibgroup/mibII/tcp.c, mibgroup/mibII/tcp.h,
+ mibgroup/mibII/udp.c, mibgroup/mibII/udp.h,
+ mibgroup/mibII/vacm_vars.c, mibgroup/mibII/vacm_vars.h,
+ mibgroup/ucd-snmp/disk.c, mibgroup/ucd-snmp/disk.h,
+ mibgroup/ucd-snmp/errormib.c, mibgroup/ucd-snmp/errormib.h
+, mibgroup/ucd-snmp/extensible.c,
+ mibgroup/ucd-snmp/extensible.h, mibgroup/ucd-snmp/file.c
+, mibgroup/ucd-snmp/file.h, mibgroup/ucd-snmp/hpux.c
+, mibgroup/ucd-snmp/hpux.h, mibgroup/ucd-snmp/loadave.c
+, mibgroup/ucd-snmp/loadave.h,
+ mibgroup/ucd-snmp/memory.c, mibgroup/ucd-snmp/memory.h,
+ mibgroup/ucd-snmp/memory_freebsd2.c,
+ mibgroup/ucd-snmp/memory_freebsd2.h, mibgroup/ucd-snmp/pass.c
+, mibgroup/ucd-snmp/pass.h,
+ mibgroup/ucd-snmp/pass_persist.c,
+ mibgroup/ucd-snmp/pass_persist.h, mibgroup/ucd-snmp/proc.c
+, mibgroup/ucd-snmp/proc.h, mibgroup/ucd-snmp/registry.c
+, mibgroup/ucd-snmp/registry.h,
+ mibgroup/ucd-snmp/versioninfo.c,
+ mibgroup/ucd-snmp/versioninfo.h, mibgroup/ucd-snmp/vmstat.c
+, mibgroup/ucd-snmp/vmstat.h,
+ mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ mibgroup/ucd-snmp/vmstat_freebsd2.h:
+
+ - (agent/mibgroup/*):
+ - made all (ok, some. !host) mib modules use snmpd_register_config_handler().
+ - made all (ok, some. !host) mib modules use register_mib().
+
+1999-01-15 11:12 hardaker
+
+ * agent/: snmpd.c, snmpd.h:
+
+ - (snmpd.c, snmpd.h):
+ - remove reverse_bytes() usage.
+
+1999-01-15 11:10 hardaker
+
+ * agent/snmp2p.c:
+
+ - (snmp2p.c): Patch from Michael Slifcak:
+ - remove reverse_bytes() usage.
+
+1999-01-14 09:02 hardaker
+
+ * local/mib2c:
+
+ - (mib2c): update for SNMP.pm 1.8.
+
+1999-01-09 21:48 hardaker
+
+ * agent/: agent_read_config.c, auto_nlist.c,
+ snmp_agent.c, snmp_vars.c, snmpd.c,
+ mibgroup/kernel_sunos5.c, mibgroup/util_funcs.c,
+ mibgroup/dummy/dummy.c, mibgroup/examples/wombat.c,
+ mibgroup/host/hr_device.c, mibgroup/host/hr_disk.c,
+ mibgroup/host/hr_filesys.c, mibgroup/host/hr_network.c,
+ mibgroup/host/hr_partition.c, mibgroup/host/hr_print.c,
+ mibgroup/host/hr_proc.c, mibgroup/host/hr_storage.c,
+ mibgroup/host/hr_swinst.c, mibgroup/host/hr_swrun.c,
+ mibgroup/host/hr_system.c, mibgroup/mibII/at.c,
+ mibgroup/mibII/icmp.c, mibgroup/mibII/interfaces.c,
+ mibgroup/mibII/ip.c, mibgroup/mibII/snmp_mib.c,
+ mibgroup/mibII/sysORTable.c, mibgroup/mibII/system.c,
+ mibgroup/mibII/tcp.c, mibgroup/mibII/udp.c,
+ mibgroup/mibII/vacm_vars.c, mibgroup/mibII/var_route.c,
+ mibgroup/smux/smux.c, mibgroup/smux/snmp_bgp.c,
+ mibgroup/smux/snmp_ospf.c, mibgroup/smux/snmp_rip2.c,
+ mibgroup/ucd-snmp/disk.c, mibgroup/ucd-snmp/memory.c,
+ mibgroup/ucd-snmp/pass.c, mibgroup/ucd-snmp/pass_persist.c
+, mibgroup/ucd-snmp/proc.c, mibgroup/ucd-snmp/registry.c
+, mibgroup/ucd-snmp/versioninfo.c:
+
+ - (agent/*.c):
+ - use the new debugging functions.
+ - implement needed -D flag changes.
+
+1999-01-09 20:52 hardaker
+
+ * man/snmpcmd.1:
+
+ - (snmpcmd.1): discuss -D usage change.
+
+1999-01-09 20:52 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c, snmp_api.h): DEBUGPOID replacement: DEBUGMSGOID.
+
+1999-01-09 20:51 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): remove old token specifier in a debugging statement
+ format line.
+
+1999-01-09 20:50 hardaker
+
+ * apps/snmpnetstat/: if.c, main.c:
+
+ - (if.c, main.c): use the new debugging functions.
+
+1999-01-09 20:50 hardaker
+
+ * apps/: snmptrapd.c, snmptrapd_handlers.c:
+
+ - (snmptrapd.c, snmptrapd_handlers.c): use the new debugging functions.
+
+1999-01-09 20:49 hardaker
+
+ * FAQ, README:
+
+ - (FAQ, README): URL changes.
+
+1999-01-09 20:30 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): make -D register the debugging tokens specified.
+
+1999-01-09 20:30 hardaker
+
+ * apps/snmptable.c:
+
+ - (snmptable.c): change internal debug variable to localdebug.
+
+1999-01-09 20:28 hardaker
+
+ * snmplib/: mib.c, parse.c, read_config.c,
+ snmp_api.c, snmp_api.h, vacm.c:
+
+ - (mib.c, parse.c, read_config.c, snmp_api.c, snmp_api.h, vacm.c):
+ - Implement the new token based debugging message support.
+
+1999-01-05 10:48 hardaker
+
+ * apps/: snmpbulkwalk.c, snmpget.c, snmpgetnext.c
+, snmpset.c, snmpstatus.c, snmptable.c,
+ snmpwalk.c:
+
+ - (snmpbulkwalk.c, snmpget.c, snmpgetnext.c, snmpset.c, snmpstatus.c,
+ snmptable.c, snmpwalk.c): Patch from mslifcak@iss.net:
+ - make main() return an int instead of void.
+
+1999-01-05 10:41 hardaker
+
+ * apps/snmptable.c:
+
+ - (snmptable.c): Make field separator take arguments directly after the -f.
+
+1999-01-02 08:48 hardaker
+
+ * mibs/IANAifType-MIB.txt:
+
+ - (IANAifType-MIB.txt): Patch from Jakob Ellerstedt:
+ - new complete list of ifTypes.
+
+1998-12-31 17:49 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Patch from David Tiller:
+ - oidLen's were wrong for m2m oids.
+
+1998-12-31 17:48 hardaker
+
+ * snmplib/snmp_client.c:
+
+ - (snmp_client.c): Patch from David Tiller:
+ - need to read_objid() the context oid base, not the party oid base
+ in one location.
+
+1998-12-31 17:46 hardaker
+
+ * agent/mibgroup/v2party/event.c:
+
+ - (event.c): Patch from David Tiller:
+ - memcmp's sizes were wrong.
+
+1998-12-29 17:01 hardaker
+
+ * snmplib/: vacm.c (V3-b3.2), vacm.c:
+
+ - (vacm.c): Enable multiple side by side views in the view family
+ tree. The views already existed, but weren't checked and only the
+ first view was found.
+ - Not done in a clean fashion. Much of the structure definitions
+ should be rewritten with sub-pieces to do it properly with greater
+ speed.
+
+1998-12-29 16:55 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): Patch from Michael Slifcak:
+ - remove newlines from sprint_value() where applicable.
+
+1998-12-26 10:35 hardaker
+
+ * agent/mibgroup/misc/dlmod.c:
+
+ - (dlmod.c): Patch from Michael Slifcak:
+ - fix dlmod compilation in snmpd_register_config_handler() call.
+
+1998-12-22 14:56 hardaker
+
+ * snmplib/: mib.c, snmp_api.c:
+
+ - (mib.c, snmp_api.c): Patch from Michael Slifcak:
+ - fix my broken set_locale stuff.
+
+1998-12-22 08:50 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): don't compile dlmods
+
+1998-12-21 18:20 hardaker
+
+ * snmplib/system.c:
+
+ - (system.c): Patch from Michael Slifcak:
+ - Win32 memory leak fixes for opendir(), etc.
+
+1998-12-21 18:18 hardaker
+
+ * agent/mibgroup/ucd-snmp/file.h, mibs/UCD-SNMP-MIB.txt
+:
+
+ - (file.h, UCD-SNMP-MIB.txt): move the file mib to .15 so it doesn't
+ conflict with the demo mib.
+
+1998-12-21 18:18 hardaker
+
+ * agent/.cvsignore:
+
+ - (.cvsignore): a .gdb file of mine.
+
+1998-12-21 09:54 hardaker
+
+ * local/ipf-mod.pl, mibs/IPFILTER.txt:
+
+ - (ipf-mod.pl, IPFILTER.txt): Patch from Yaroslav Terletsky:
+ - ipfilter pass script and mib file.
+
+1998-12-18 18:16 hardaker
+
+ * agent/mibgroup/ucd-snmp/: versioninfo.c, versioninfo.h
+:
+
+ - (versioninfo.c, versioninfo.h): mib object to display configure options.
+
+1998-12-18 18:16 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - store configure flags to a define.
+
+1998-12-18 18:12 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): include read_config.h.
+
+1998-12-18 18:11 hardaker
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ - (libsnmp.def): update from Michael Slifcak.
+
+1998-12-18 18:10 hardaker
+
+ * snmplib/: parse.c, read_config.c, read_config.h
+:
+
+ - (parse.c, read_config.c, read_config.h):
+ - fixes from Michael Slifcak.
+ - misc read_config functions pulled in from the v3 work.
+
+1998-12-18 11:36 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): Patch from Michael Slifcak:
+ - typo.
+
+1998-12-17 08:05 dreeder
+
+ * local/snmpd-ucd.sh:
+
+ file snmpd-ucd.sh was initially added on branch V3-b3.
+
+1998-12-16 07:31 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - pointer checks before freeing memory.
+
+1998-12-13 08:59 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre5 )
+
+1998-12-13 08:57 hardaker
+
+ * README:
+
+ - (README): added Jeff Johnson to the contributors list.
+
+1998-12-13 08:48 hardaker
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ - (hr_swinst.c): Patch from Jeff Johnson:
+ - protect against memory leaks with the RPM package info calls.
+
+1998-12-13 08:42 hardaker
+
+ * apps/snmpnetstat/inet.c:
+
+ - (inet.c): init pointer to NULL.
+
+1998-12-13 08:41 hardaker
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ - (hr_filesys.c): watch out for NULL file pointers.
+
+1998-12-13 08:18 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - (kernel_sunos5.c): remove a few defines that were messing up solaris 7.
+
+1998-12-13 08:14 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): remove -w/-W flag in usage.
+
+1998-12-13 08:12 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): spacing in mib option usage fixes.
+
+1998-12-13 08:07 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ - (disk.c): fix disk size error flag reporting on Solaris.
+
+1998-12-13 08:06 hardaker
+
+ * NEWS:
+
+ - (NEWS): beginning notes for 3.6.
+
+1998-12-13 07:49 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): -P flag for toggling new mib parsing options.
+
+1998-12-13 07:48 hardaker
+
+ * snmplib/: parse.c, parse.h:
+
+ - (parse.c, parse.h): new functions: snmp_mib_toggle_options() and usage.
+
+1998-12-13 07:42 hardaker
+
+ * config.h.in, configure, configure.in,
+ snmplib/mib.c, snmplib/snmp_api.c:
+
+ - (config.h.in, configure, configure.in, mib.c, snmp_api.c):
+ - use setlocale() if available to correct isprint problems.
+
+1998-12-05 16:52 dreeder
+
+ * testing/demo.remote:
+
+ file demo.remote was initially added on branch V3-b1.
+
+1998-12-04 16:50 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.conf:
+
+ file ucdDemoPublic.conf was initially added on branch V3-b1.
+
+1998-12-04 16:50 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.cmds:
+
+ file ucdDemoPublic.cmds was initially added on branch V3-b1.
+
+1998-12-04 16:50 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.c:
+
+ file ucdDemoPublic.c was initially added on branch V3-b1.
+
+1998-12-04 16:50 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.h:
+
+ file ucdDemoPublic.h was initially added on branch V3-b1.
+
+1998-12-04 16:45 hardaker
+
+ * mibs/UCD-DEMO-MIB.txt:
+
+ file UCD-DEMO-MIB.txt was initially added on branch V3-b1.
+
+1998-12-04 11:03 hardaker
+
+ * apps/snmpusm.c:
+
+ file snmpusm.c was initially added on branch V3-b1.
+
+1998-12-03 18:44 dreeder
+
+ * testing/demo2.functions:
+
+ file demo2.functions was initially added on branch V3-b1.
+
+1998-12-03 18:44 dreeder
+
+ * testing/demo2:
+
+ file demo2 was initially added on branch V3-b1.
+
+1998-12-03 18:44 dreeder
+
+ * testing/demo2.setupfile:
+
+ file demo2.setupfile was initially added on branch V3-b1.
+
+1998-12-02 15:19 hardaker
+
+ * man/snmp.conf.5.def:
+
+ file snmp.conf.5.def was initially added on branch V3-b1.
+
+1998-11-27 16:55 hardaker
+
+ * apps/snmppass.c:
+
+ file snmppass.c was initially added on branch V3-b1.
+
+1998-11-24 16:43 dreeder
+
+ * snmplib/transform_oids.h:
+
+ file transform_oids.h was initially added on branch V3-b1.
+
+1998-11-24 16:43 dreeder
+
+ * apps/encode_keychange.c:
+
+ file encode_keychange.c was initially added on branch V3-b1.
+
+1998-11-23 16:35 hardaker
+
+ * snmplib/: mib.c, parse.c, parse.h:
+
+ - (snmp_parse_args.c, mib.c, parse.c, parse.h): Patch from Michael Slifcak:
+ - misc parsing bug fixes.
+ - -w & -W options to default application parse_args.
+ - runtime options to control underscore and comment parsing in mibs.
+
+1998-11-23 16:18 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c, mib.c, parse.c, parse.h): Patch from Michael Slifcak:
+ - misc parsing bug fixes.
+ - -w & -W options to default application parse_args.
+ - runtime options to control underscore and comment parsing in mibs.
+
+1998-11-23 15:42 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c, irix.h): fix location of _KERNEL define for irix.
+
+1998-11-22 07:28 hardaker
+
+ * testing/.cvsignore:
+
+ file .cvsignore was initially added on branch V3-b1.
+
+1998-11-22 07:27 hardaker
+
+ * testing/demo:
+
+ file demo was initially added on branch V3-b1.
+
+1998-11-16 22:10 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): too many improvements to count.
+
+1998-11-06 17:44 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): v2 trap send debugging.
+
+1998-11-06 17:44 hardaker
+
+ * agent/agent_read_config.c:
+
+ - (agent_read_config.h): use trap2sink for v2 handlers
+
+1998-11-06 17:23 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): fix v2 trap generation.
+
+1998-10-24 23:07 dreeder
+
+ * testing/misctest.c:
+
+ file misctest.c was initially added on branch V3-b1.
+
+1998-10-23 15:39 dreeder
+
+ * testing/etimetest.c:
+
+ file etimetest.c was initially added on branch V3-b1.
+
+1998-10-23 13:58 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/agent_read_config.c,
+ agent/agent_read_config.h, agent/snmpd.c,
+ agent/mibgroup/examples/wombat.h,
+ agent/mibgroup/mibII/system.h,
+ agent/mibgroup/mibII/vacm_vars.h, agent/mibgroup/misc/dlmod.c
+, agent/mibgroup/ucd-snmp/disk.h,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/file.h,
+ agent/mibgroup/ucd-snmp/loadave.h,
+ agent/mibgroup/ucd-snmp/memory.h,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/pass.h,
+ agent/mibgroup/ucd-snmp/pass_persist.h,
+ agent/mibgroup/ucd-snmp/proc.h, apps/snmp_parse_args.c
+, apps/snmptrapd.c, snmplib/mib.c,
+ snmplib/read_config.c, snmplib/read_config.h:
+
+ - (acconfig.h, config.h.in, configure, configure.in,
+ agent_read_config.c, agent_read_config.h, snmpd.c, wombat.h,
+ system.h, vacm_vars.h, dlmod.c, disk.h, extensible.h, file.h,
+ loadave.h, memory.h, memory_freebsd2.h, pass.h, pass_persist.h,
+ proc.h, snmp_parse_args.c, snmptrapd.c, mib.c, read_config.c,
+ read_config.h):
+ - new option -H on command line to print out .conf file directives
+ that the application understands.
+ - created a new option to the read config registration to allow
+ specifying of a help line.
+
+1998-10-23 13:56 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): editable oid field.
+
+1998-10-23 13:54 hardaker
+
+ * agent/mibgroup/mibII/: at.c, icmp.c, interfaces.c
+:
+
+ - (at.c, icmp.c, interfaces.c): bug fixes, missing #endif.
+
+1998-10-23 13:54 hardaker
+
+ * Makefile.in:
+
+ - (Makefile.in): insert @ sign.
+
+1998-10-23 09:45 dreeder
+
+ * testing/T.sh:
+
+ file T.sh was initially added on branch V3-b1.
+
+1998-10-23 09:45 dreeder
+
+ * testing/eval_testlist:
+
+ file eval_testlist was initially added on branch V3-b1.
+
+1998-10-23 09:45 dreeder
+
+ * testing/eval_tools.sh:
+
+ file eval_tools.sh was initially added on branch V3-b1.
+
+1998-10-23 09:45 dreeder
+
+ * testing/eval_suite.sh:
+
+ file eval_suite.sh was initially added on branch V3-b1.
+
+1998-10-23 09:45 dreeder
+
+ * testing/eval_oneprogram.sh:
+
+ file eval_oneprogram.sh was initially added on branch V3-b1.
+
+1998-10-23 09:45 dreeder
+
+ * testing/T.c:
+
+ file T.c was initially added on branch V3-b1.
+
+1998-10-23 09:45 dreeder
+
+ * testing/README:
+
+ file README was initially added on branch V3-b1.
+
+1998-10-23 07:57 hardaker
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ - (hr_filesys.c): Patch from Dave Shield:
+ - NULL checking on the filesystem mount point.
+
+1998-10-21 19:55 dreeder
+
+ * testing/test_kul.sh:
+
+ file test_kul.sh was initially added on branch V3-b1.
+
+1998-10-21 19:55 dreeder
+
+ * testing/test_keychange.sh:
+
+ file test_keychange.sh was initially added on branch V3-b1.
+
+1998-10-21 19:55 dreeder
+
+ * testing/test_tools.sh:
+
+ file test_tools.sh was initially added on branch V3-b1.
+
+1998-10-21 19:55 dreeder
+
+ * testing/data.kul-md5:
+
+ file data.kul-md5 was initially added on branch V3-b1.
+
+1998-10-21 19:55 dreeder
+
+ * testing/data.keychange-sha1-des:
+
+ file data.keychange-sha1-des was initially added on branch V3-b1.
+
+1998-10-21 19:55 dreeder
+
+ * testing/data.keychange-sha1:
+
+ file data.keychange-sha1 was initially added on branch V3-b1.
+
+1998-10-21 19:55 dreeder
+
+ * testing/data.keychange-md5:
+
+ file data.keychange-md5 was initially added on branch V3-b1.
+
+1998-10-21 19:55 dreeder
+
+ * testing/data.kul-sha1:
+
+ file data.kul-sha1 was initially added on branch V3-b1.
+
+1998-10-21 17:01 hardaker
+
+ * man/: .cvsignore, Makefile.in, read_config.3.def
+:
+
+ - (.cvsignore, Makefile.in, read_config.3.def):
+ - new unproofread manual on the read_config api (most of it).
+
+1998-10-21 11:08 hardaker
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ - (hr_filesys.c): Patch from Dave Shield:
+ - watch out for empty file names passed in.
+
+1998-10-21 10:54 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Dave Shield:
+ - Fix parser to deal with anonymous children properly.
+
+1998-10-20 11:38 dreeder
+
+ * testing/keymanagetest.c:
+
+ file keymanagetest.c was initially added on branch V3-b1.
+
+1998-10-18 21:14 dreeder
+
+ * testing/Makefile.in:
+
+ file Makefile.in was initially added on branch V3-b1.
+
+1998-10-18 21:14 dreeder
+
+ * testing/scapitest.c:
+
+ file scapitest.c was initially added on branch V3-b1.
+
+1998-10-16 08:38 hardaker
+
+ * agent/mibgroup/mibII/: at.c, icmp.c, interfaces.c
+:
+
+ - (at.c, icmp.c, interfaces.c, aix.h): aix header file fixes.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/tools.c:
+
+ file tools.c was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/tools.h:
+
+ file tools.h was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/lcd_time.h:
+
+ file lcd_time.h was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/scapi.c:
+
+ file scapi.c was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/scapi.h:
+
+ file scapi.h was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/lcd_time.c:
+
+ file lcd_time.c was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/keytools.h:
+
+ file keytools.h was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/keytools.c:
+
+ file keytools.c was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/all_general_local.h:
+
+ file all_general_local.h was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/all_system.h:
+
+ file all_system.h was initially added on branch V3-b1.
+
+1998-10-15 12:02 dreeder
+
+ * snmplib/debug.h:
+
+ file debug.h was initially added on branch V3-b1.
+
+1998-10-14 16:52 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ - (memory.c): fix for hpux9.
+
+1998-10-14 16:49 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): Patch from Michael Slifcak:
+ - fix for broken compiler warnings on NT.
+
+1998-10-14 16:42 hardaker
+
+ * man/snmpd.1.def:
+
+ - (snmpd.1.def): document -A.
+
+1998-10-14 16:41 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): document -A.
+
+1998-10-14 16:40 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): -A: append to log file.
+
+1998-10-14 09:42 hardaker
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ - (hr_storage.c): machine/types.h and sys/vmmeter.h for freebsd3.
+
+1998-10-14 09:41 hardaker
+
+ * agent/mibgroup/host_res.h:
+
+ - (host_res.h): net/in_var.h for freebsd3.
+
+1998-10-14 09:41 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in): check for machine/types.h.
+
+1998-10-14 09:17 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): change public community examples -> private.
+
+1998-10-09 23:20 hardaker
+
+ * FAQ:
+
+ - (FAQ): Dave Shield explains in wonderous detail all about the VACM module.
+
+1998-10-09 23:12 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Dave Shield:
+ - support for strict (case sensitive) option to the mib compiler.
+
+1998-10-09 23:08 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Dave Shield:
+ - Check for fully qualified oid statements.
+
+1998-10-09 08:09 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in): use zlib when using rpm libraries.
+
+1998-10-07 17:00 hardaker
+
+ * win32/: libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp_dll.dsp
+:
+
+ - (libsnmp.dsp, libsnmp_dll.dsp): Patch from Michael Slifcak:
+ - winNT project file updates.
+
+1998-10-07 16:54 hardaker
+
+ * apps/snmpdelta.c:
+
+ - (snmpdelta.c): Patch from Michael Slifcak:
+ - fix exiting problems on NT.
+
+1998-10-07 16:51 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): fix default port problems (again).
+
+1998-10-07 16:50 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Michael Slifcak:
+ - remove un-needed headers.
+
+1998-10-07 16:49 hardaker
+
+ * man/Makefile.in:
+
+ - (Makefile.in): Patch from Michael Slifcak:
+ - fix make html.
+
+1998-10-07 16:49 hardaker
+
+ * Makefile.in:
+
+ - (Makefile.in): Patch from Michael Slifcak:
+ - properly locate version.h in $(srcdir).
+
+1998-10-06 15:38 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre3 )
+
+1998-10-06 15:38 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ - (versiontag): typo.
+
+1998-10-06 15:35 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ - (versiontag): fix for cvs 1.10.
+
+1998-10-06 15:34 hardaker
+
+ * remove-files:
+
+ - (remove-files): update.
+
+1998-10-06 15:30 hardaker
+
+ * mibs/UCD-SNMP-MIB-OLD.txt:
+
+ - (UCD-SNMP-MIB-OLD.txt): added
+
+1998-10-06 15:18 hardaker
+
+ * config.h.in:
+
+ - (config.h.in): setup define for HAVE_USLEEP.
+
+1998-10-06 15:18 hardaker
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ - (var_route.c): hack fixes for hpux10 and rtentry.
+
+1998-10-05 17:03 hardaker
+
+ * agent/mibgroup/host/hr_proc.c:
+
+ - (hr_proc.c): possible fix for solaris's process percentage.
+
+1998-10-05 16:53 hardaker
+
+ * agent/mibgroup/dummy/: dummy.c, dummy.h:
+
+ - (dummy.c, dummy.h): update to remove common_header.h
+
+1998-09-30 14:56 hardaker
+
+ * ChangeLog, EXAMPLE.conf.def, NEWS, configure
+, configure.in, agent/mibgroup/mibII/interfaces.c
+, agent/mibgroup/ucd-snmp/memory.c, apps/snmptest.c
+, apps/snmptrap.c, snmplib/parse.c:
+
+ - (ChangeLog, EXAMPLE.conf.def, NEWS, configure, configure.in,
+ interfaces.c, memory.c, snmptest.c, snmptrap.c, parse.c):
+ - merge 3.5.3 changes into main trunk.
+
+1998-09-25 18:14 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/util_funcs.c:
+
+ - (configure, configure.in, util_funcs.c): use USLEEP if available for
+ small sleep times while waiting for processes to finish.
+
+1998-09-25 18:04 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): remove unneeded comment-out.
+
+1998-09-25 18:03 hardaker
+
+ * Makefile.in:
+
+ - (Makefile.in): install version.h, and strip includes out of config.h
+
+1998-09-25 17:56 hardaker
+
+ * snmplib/Makefile.in:
+
+ - (Makefile.in): don't install libsnmp.h. It's going to change too
+ much in the future.
+
+1998-09-25 17:55 hardaker
+
+ * snmplib/Makefile.in:
+
+ - (Makefile.in): Patch from Michael Slifcak:
+ - install more headers.
+
+1998-09-25 17:32 hardaker
+
+ * win32/: config.h, win32.dsw, libsnmp/libsnmp.dsp
+, libsnmp_dll/libsnmp.def, libsnmp_dll/libsnmp_dll.dsp
+, snmptable/snmptable.dsp:
+
+ - (config.h, win32.dsw, libsnmp.dsp, libsnmp.def, libsnmp_dll.dsp,
+ snmptable.dsp): Patch from Michael Slifcak:
+ - stupid OS update.
+
+1998-09-25 17:26 hardaker
+
+ * man/snmp_sess_api.3:
+
+ - (snmp_sess_api.3): Patch from Michael Slifcak:
+ - session documentation update.
+
+1998-09-25 17:25 hardaker
+
+ * apps/snmptable.c:
+
+ - (snmptable.c): process args directly instead of relying on get_opt().
+
+1998-09-25 17:24 hardaker
+
+ * snmplib/: mib.c, mib.h, read_config.c,
+ snmp_api.c, snmp_api.h:
+
+ - (mib.c, mib.h, read_config.c, snmp_api.c, snmp_api.h): Patch from
+ Michael Slifcak:
+ - fix compiler warnings, errors.
+
+1998-09-25 17:15 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h, snmp_client.c
+:
+
+ - (snmp_api.c, snmp_api.h, snmp_client.c): Patch from Michael Slifcak:
+ - The CMU library has an optimization in snmp_clone_pdu() that does
+ not copy zero length strings. I had merged this in with changes
+ made for multi-thread support. Unfortunately, I did not make sure
+ the cloned PDU had no pointer for this case. Oops!
+ - Another problem in snmp_clone_pdu() was the test for zero length
+ string was not being performed on the first varbind in the chain.
+
+1998-09-25 17:03 hardaker
+
+ * snmplib/: snmp_api.c (Ext-3-5-patches.5), snmp_api.c:
+
+ - (snmp_api.c): don't rely on the getservbyname pointer to stay around.
+
+1998-09-23 13:06 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/parse.c:
+
+ - (acconfig.h, config.h.in, configure, configure.in, parse.c): New flag:
+ - --enable-eol-terminated-comments.
+
+1998-09-23 12:15 hardaker
+
+ * ISSUES:
+
+ file ISSUES was initially added on branch V3-b1.
+
+1998-09-21 11:11 hardaker
+
+ * agent/: snmp_vars.c (Ext-3-5-patches.5), snmp_vars.c
+ (V3-b1.[5,2]), snmp_vars.c:
+
+ - (snmp_vars.c): finally fixed the write_method's for creation problem.
+
+1998-09-21 08:49 hardaker
+
+ * agent/mibgroup/ucd-snmp/: file.c, file.h:
+
+ - (file.c, file.h): allow -1 size to indicate simple size monitoring.
+
+1998-09-18 14:04 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): Change file return code from TruthValue to
+ integer since 1/2 does not fit the current 0/1 return code scheme.
+
+1998-09-18 14:02 hardaker
+
+ * agent/mibgroup/ucd-snmp/file.h:
+
+ - (file.h): remap to the 100/101 conventions of the ucd-snmp tables.
+
+1998-09-18 14:01 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ - (ucd_snmp.h): add the file mib module.
+
+1998-09-18 13:58 hardaker
+
+ * agent/mibgroup/ucd-snmp/: file.c, file.h:
+
+ - (file.c, file.h): Patch from Jonas Olsson:
+ - Implement a file size watching mib module (ucd-snmp/file).
+
+1998-09-18 13:20 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): added the FileTable submitted by Jonas Olsson.
+
+1998-09-18 12:42 hardaker
+
+ * snmplib/snmp-tc.h:
+
+ file snmp-tc.h was initially added on branch V3-b1.
+
+1998-09-18 09:59 hardaker
+
+ * snmplib/snmpusm.c:
+
+ file snmpusm.c was initially added on branch V3-b1.
+
+1998-09-18 09:59 hardaker
+
+ * snmplib/snmpusm.h:
+
+ file snmpusm.h was initially added on branch V3-b1.
+
+1998-09-18 09:58 hardaker
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ file usmUser.c was initially added on branch V3-b1.
+
+1998-09-18 09:58 hardaker
+
+ * agent/mibgroup/snmpv3/usmUser.h:
+
+ file usmUser.h was initially added on branch V3-b1.
+
+1998-09-16 07:04 hardaker
+
+ * agent/mibgroup/snmpv3/usmStats.h:
+
+ file usmStats.h was initially added on branch V3-b1.
+
+1998-09-16 07:04 hardaker
+
+ * agent/mibgroup/snmpv3/usmStats.c:
+
+ file usmStats.c was initially added on branch V3-b1.
+
+1998-09-15 13:07 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - fix init_snmp calls from session routines.
+
+1998-09-15 13:07 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): // comment -> /* */ comment.
+
+1998-09-15 13:02 hardaker
+
+ * apps/snmpnetstat/inet.c:
+
+ - (inet.c): Patch from Michael Slifcak:
+ - memory related fixes.
+
+1998-09-14 22:29 hardaker
+
+ * agent/mibgroup/snmpv3/snmpMPDStats.c:
+
+ file snmpMPDStats.c was initially added on branch V3-b1.
+
+1998-09-14 22:29 hardaker
+
+ * agent/mibgroup/snmpv3/snmpMPDStats.h:
+
+ file snmpMPDStats.h was initially added on branch V3-b1.
+
+1998-09-14 17:49 hardaker
+
+ * agent/mibgroup/snmpv3mibs.h:
+
+ file snmpv3mibs.h was initially added on branch V3-b1.
+
+1998-09-14 12:48 hardaker
+
+ * agent/dlmods/Makefile.in:
+
+ - (Makefile.in): Patch from Michael:
+ - do dlmods compilation better at least on solaris and linux.
+
+1998-09-14 12:40 hardaker
+
+ * agent/agent_read_config.c, agent/snmp_vars.c,
+ agent/dlmods/dlmod_mib.c, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/dummy/dummy.c,
+ agent/mibgroup/examples/wombat.c,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c, agent/mibgroup/host/hr_proc.c
+, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/system.c, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/smux/snmp_bgp.c,
+ agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/ucd-snmp/hpux.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/v2party/acl_vars.c,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/context_vars.c,
+ agent/mibgroup/v2party/event.c,
+ agent/mibgroup/v2party/party_vars.c,
+ agent/mibgroup/v2party/view_vars.c, apps/snmptrapd.c,
+ apps/snmptrapd_handlers.c, snmplib/snmp_api.c,
+ snmplib/snmp_api.h:
+
+ - (agent_read_config.c, snmp_vars.c, dlmod_mib.c, util_funcs.c,
+ dummy.c, wombat.c, hr_device.c, hr_disk.c, hr_filesys.c,
+ hr_network.c, hr_partition.c, hr_print.c, hr_proc.c, hr_storage.c,
+ hr_swinst.c, hr_swrun.c, hr_system.c, at.c, icmp.c, interfaces.c,
+ ip.c, snmp_mib.c, system.c, tcp.c, udp.c, var_route.c, snmp_bgp.c,
+ snmp_ospf.c, snmp_rip2.c, hpux.c, pass.c, pass_persist.c,
+ registry.c, acl_vars.c, alarm.c, context_vars.c, event.c,
+ party_vars.c, view_vars.c, snmptrapd.c, snmptrapd_handlers.c,
+ snmp_api.c, snmp_api.h): Patch from Michael Slifcak:
+ - rename compare -> snmp_oid_compare().
+
+1998-09-14 12:35 hardaker
+
+ * man/Makefile.in:
+
+ - (Makefile.in): Patch from Michael Slifcak:
+ - install snmp_sess_api.3.
+
+1998-09-14 09:25 hardaker
+
+ * agent/mibgroup/snmpv3/snmpEngine.c:
+
+ file snmpEngine.c was initially added on branch V3-b1.
+
+1998-09-14 09:25 hardaker
+
+ * agent/mibgroup/snmpv3/snmpEngine.h:
+
+ file snmpEngine.h was initially added on branch V3-b1.
+
+1998-09-14 09:21 hardaker
+
+ * snmplib/snmpv3.c:
+
+ file snmpv3.c was initially added on branch V3-b1.
+
+1998-09-14 09:21 hardaker
+
+ * snmplib/snmpv3.h:
+
+ file snmpv3.h was initially added on branch V3-b1.
+
+1998-09-13 21:09 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version update: 3.6.pre2
+
+1998-09-13 21:06 hardaker
+
+ * snmplib/: mib.c, read_config.c:
+
+ - (mib.c, read_config.c): refix the non-malloced configuration vars.
+
+1998-09-13 21:05 hardaker
+
+ * README:
+
+ - (README): Name addition.
+
+1998-09-13 20:30 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): prevent double init_snmp()s.
+
+1998-09-13 20:28 hardaker
+
+ * snmplib/read_config.c:
+
+ - (read_config.c): not finding a config file is printed with DEBUGP() instead.
+
+1998-09-13 20:18 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): define usage mispelling SNMP_BAD_PARSE -> SNMPERR_BAD_PARSE.
+
+1998-09-13 20:11 hardaker
+
+ * apps/snmptable.c, apps/snmptranslate.c,
+ snmplib/mib.c, snmplib/mib.h, snmplib/parse.c,
+ snmplib/parse.h:
+
+ - (snmptable.c, snmptranslate.c, mib.c, mib.h, parse.c, parse.h):
+ - merge into main line from the 3-6-pre1-trans branch.
+
+1998-09-13 18:24 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - exit -> return.
+
+1998-09-12 09:08 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): Move CAN_USE_NLIST tests below arch .h files.
+
+1998-09-12 09:02 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - bug fix to check for NULL session pointer before using it.
+
+1998-09-12 08:56 hardaker
+
+ * mibs/Makefile.in, ov/Makefile.in:
+
+ - (ov/Makefile.in, mibs/Makefile.in): Patch from Michael Slifcak:
+ - remove duplicate sections already defined in Makefile.top.
+
+1998-09-12 08:54 hardaker
+
+ * agent/mibgroup/.cvsignore:
+
+ - (.cvsignore): add mib_module_shutdown.h
+
+1998-09-12 08:54 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): Don't force cc anymore, allow gcc to go first.
+
+1998-09-12 08:53 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): move un-configured defines above @TOP@.
+
+1998-09-12 08:46 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): prototype move init_snmp() above init_snmp_session.
+
+1998-09-11 09:24 hardaker
+
+ * acconfig.h, config.h.in, apps/snmp_parse_args.c
+, apps/snmpdelta.c, man/snmp_sess_api.3,
+ snmplib/asn1.c, snmplib/int64.c, snmplib/int64.h
+, snmplib/libsnmp.h, snmplib/md5.c, snmplib/mib.c
+, snmplib/parse.c, snmplib/parse.h,
+ snmplib/party_parse.c, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_client.h,
+ snmplib/system.c, snmplib/system.h, win32/config.h
+, win32/libsnmp_dll/libsnmp.def:
+
+ - (*): Merged the MT changes into the main branch.
+
+1998-09-09 21:37 hardaker
+
+ * snmplib/libsnmp.h:
+
+ file libsnmp.h was initially added on branch Ext-3-5-1-MT.
+
+1998-09-09 21:36 hardaker
+
+ * man/snmp_sess_api.3:
+
+ file snmp_sess_api.3 was initially added on branch Ext-3-5-1-MT.
+
+1998-09-09 16:55 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): fix trap stuff broken by the code merge.
+
+1998-09-09 16:09 hardaker
+
+ * win32/: win32.dsw, win32.opt, libsnmp/libsnmp.dsp
+, libsnmp/libsnmp.plg, libsnmp_dll/libsnmp_dll.dsp
+, libsnmp_dll/libsnmp_dll.plg,
+ snmpbulkwalk/snmpbulkwalk.dsp, snmpbulkwalk/snmpbulkwalk.plg
+, snmpdelta/snmpdelta.dsp, snmpdelta/snmpdelta.plg
+, snmpget/snmpget.dsp, snmpget/snmpget.plg,
+ snmpgetnext/snmpgetnext.dsp, snmpgetnext/snmpgetnext.plg
+, snmpset/snmpset.dsp, snmpset/snmpset.plg,
+ snmpstatus/snmpstatus.dsp, snmpstatus/snmpstatus.plg,
+ snmptest/snmptest.dsp, snmptest/snmptest.plg,
+ snmptranslate/snmptranslate.dsp,
+ snmptranslate/snmptranslate.plg, snmptrap/snmptrap.dsp,
+ snmptrap/snmptrap.plg, snmpwalk/snmpwalk.dsp,
+ snmpwalk/snmpwalk.plg:
+
+ - (*): Merge into main branch from 3.5.1 branch.
+
+1998-09-09 15:37 hardaker
+
+ * snmplib/: Makefile.in, acl.h, asn1.c, asn1.h
+, md5.h, mib.c, parse.c, parse.h,
+ snmp.c, snmp.h, snmp_api.c, snmp_api.h,
+ snmp_client.c, snmp_client.h, snmp_impl.h,
+ system.c, vacm.h, view.h:
+
+ - (*): Merge into main branch from 3.5.1 branch.
+
+1998-09-09 15:34 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h, apps/Makefile.in
+, apps/snmp_parse_args.c, apps/snmpdelta.c,
+ apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/netstat.h, man/mib_api.3,
+ man/snmp_api.3, man/snmpd.1.def, man/snmpd.conf.5.def
+, man/snmptranslate.1, man/snmptrapd.8,
+ man/variables.5:
+
+ - (*): Merge into main branch from 3.5.1 branch.
+
+1998-09-09 15:30 hardaker
+
+ * .cvsignore, COPYING, ChangeLog, Makefile.in
+, NEWS, README, acconfig.h, config.h.in
+, configure, configure.in, agent/Makefile.in
+, agent/auto_nlist.c, agent/snmp2p.c,
+ agent/snmp_agent.c, agent/snmp_vars.c, agent/snmpd.c
+, agent/snmpd.h, agent/mibgroup/Makefile.in,
+ agent/mibgroup/ucd_snmp.h, agent/mibgroup/util_funcs.c
+, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/system.h,
+ agent/mibgroup/mibII/tcp.c, agent/mibgroup/smux/smux.c,
+ agent/mibgroup/smux/snmp_bgp.c,
+ agent/mibgroup/smux/snmp_bgp.h,
+ agent/mibgroup/smux/snmp_ospf.c,
+ agent/mibgroup/smux/snmp_ospf.h,
+ agent/mibgroup/smux/snmp_rip2.c,
+ agent/mibgroup/smux/snmp_rip2.h:
+
+ - (*): Merge into main branch from 3.5.1 branch.
+
+1998-09-07 19:42 marz
+
+ * win32/snmpdelta/snmpdelta.dsp:
+
+ file snmpdelta.dsp was initially added on branch Ext-3-5-patches.
+
+1998-09-07 19:42 marz
+
+ * win32/snmpdelta/snmpdelta.plg:
+
+ file snmpdelta.plg was initially added on branch Ext-3-5-patches.
+
+1998-09-07 19:42 marz
+
+ * win32/snmptest/snmptest.plg:
+
+ file snmptest.plg was initially added on branch Ext-3-5-patches.
+
+1998-09-07 19:42 marz
+
+ * win32/snmptrap/snmptrap.dsp:
+
+ file snmptrap.dsp was initially added on branch Ext-3-5-patches.
+
+1998-09-07 19:42 marz
+
+ * win32/snmptest/snmptest.dsp:
+
+ file snmptest.dsp was initially added on branch Ext-3-5-patches.
+
+1998-09-07 19:42 marz
+
+ * win32/snmptrap/snmptrap.plg:
+
+ file snmptrap.plg was initially added on branch Ext-3-5-patches.
+
+1998-09-07 12:27 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat_freebsd2.h:
+
+ file vmstat_freebsd2.h was initially added on branch Ext-3-5-patches.
+
+1998-09-07 12:27 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory_freebsd2.h:
+
+ file memory_freebsd2.h was initially added on branch Ext-3-5-patches.
+
+1998-09-03 14:29 nba
+
+ * local/fixproc:
+
+ - (fixproc): added comment to test CVS.
+
+1998-09-02 18:50 hardaker
+
+ * agent/: agent_read_config.c, agent_read_config.h,
+ snmp_vars.c, snmpd.c, snmpd.h:
+
+ - (agent_read_config.c, agent_read_config.h, snmp_vars.c, snmpd.c,
+ snmpd.h):
+ - support mib-module shutdown functions.
+ - do a minimal persistent cache implementation and read it at start up.
+ - test with beginnings (wrong place) of agentBoots variable.
+
+1998-09-02 18:48 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): use init_snmp instead of init_mib().
+
+1998-09-02 18:48 hardaker
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ - (libsnmp.def): find_module.
+
+1998-09-02 18:47 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c, snmp_api.h): init_snmp().
+
+1998-09-02 18:47 hardaker
+
+ * snmplib/: mib.c, mib.h, read_config.c,
+ read_config.h:
+
+ - (mib.c, mib.h, read_config.c, read_config.h):
+ - pre/post mib loading config files.
+ - create init_snmp() to wrap other fuctions.
+ - new snmp.conf directives: mibs, mibdirs, mibfile.
+
+1998-09-02 18:44 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): typo.
+
+1998-09-02 18:44 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - persistent config file question.
+
+1998-09-02 18:43 hardaker
+
+ * TODO:
+
+ - (TODO): added security checks.
+
+1998-08-31 13:32 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): add a blank line to the end of the trapd output for parsing.
+
+1998-08-31 13:02 hardaker
+
+ * agent/mibgroup/mibII/: interfaces.c (Ext-3-5-patches.2),
+ interfaces.c:
+
+ - (interfaces.c): missing return on ifInErrors results.
+
+1998-08-14 08:44 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat_freebsd2.c:
+
+ file vmstat_freebsd2.c was initially added on branch Ext-3-5-patches.
+
+1998-08-14 08:44 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory_freebsd2.c:
+
+ file memory_freebsd2.c was initially added on branch Ext-3-5-patches.
+
+1998-07-22 16:23 hardaker
+
+ * Makefile.in, sedscript.in:
+
+ - (Makefile.in, sedscript.in): fix sedscript includes.
+
+1998-07-22 15:35 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): don't change running environment variables with strtok.
+
+1998-07-20 17:14 hardaker
+
+ * local/snmpcheck.def:
+
+ - (snmpcheck.def): work around for new multi-depth mib tables..
+
+1998-07-17 13:22 hardaker
+
+ * mibs/RFC-1215.txt:
+
+ - (RFC-1215.txt): created an empty mib module for importing of TRAP-TYPE.
+
+1998-07-17 13:11 hardaker
+
+ * mibs/: UCD-SNMP-MIB.inc, UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.inc, UCD-SNMP-MIB.txt):
+ - created smicng input file.
+ - fixed the UCD-SNMP mib to deal with most smic errors.
+
+1998-07-15 15:46 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory.h:
+
+ - (memory.h): MEMSWAPMINIMUM wasn't being used.
+
+1998-07-15 15:46 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in): using_module changes.
+
+1998-07-10 09:42 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): wrong pdu pointer for snmpv2c traps.
+
+1998-07-08 15:51 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.6.pre1 )
+
+1998-07-08 15:32 hardaker
+
+ * agent/dlmods/dlmod_mib.c:
+
+ - (dlmod_mib.c): -Wall fixes.
+
+1998-07-08 15:31 hardaker
+
+ * agent/: agent_read_config.c, snmpd.c:
+
+ - (agent_read_config.c, snmpd.c): -Wall fixes.
+
+1998-07-08 15:31 hardaker
+
+ * apps/: snmptrapd.c, snmptrapd_handlers.c:
+
+ - (snmptrapd.c, snmptrapd_handlers.c): -Wall fixes.
+
+1998-07-08 15:31 hardaker
+
+ * snmplib/: read_config.c, read_config.h:
+
+ - (read_config.c, read_config.h): -Wall corrections.
+
+1998-07-08 14:45 hardaker
+
+ * snmplib/: read_config.c, read_config.h:
+
+ - (read_config.c, read_config.h): bug fixes.
+
+1998-07-08 14:45 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): include fixes.
+
+1998-07-08 14:45 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): include snmp_api.h
+
+1998-07-08 14:45 hardaker
+
+ * agent/mibgroup/ucd-snmp/: pass_persist.c, pass_persist.h
+:
+
+ - (pass_persist.c, pass_persist.h): cleaned up and -Wall fixes.
+
+1998-07-08 14:44 hardaker
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c:
+
+ - (versioninfo.c): include system.h
+
+1998-07-08 14:44 hardaker
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ - (pass.c): include sys/wait.h
+
+1998-07-08 14:44 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ - (ucd_snmp.h): removed ucd-snmp/pass_persist from default include list.
+
+1998-07-08 14:43 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): include fixes.
+
+1998-07-08 14:30 hardaker
+
+ * agent/mibgroup/ucd-snmp/: pass_persist.c, pass_persist.h
+, pass-persist.c, pass-persist.h:
+
+ - (pass-persist.c pass-persist.h): moved to pass_persist.[ch].
+
+1998-07-08 14:21 hardaker
+
+ * snmplib/: read_config.c, read_config.h:
+
+ - (read_config.c, read_config.h): create unregister_read..() function.
+
+1998-07-08 14:20 hardaker
+
+ * agent/mibgroup/misc/dlmod.c:
+
+ - (dlmod.c): use snmpd_ register_read_config() wrappers.
+
+1998-07-08 14:20 hardaker
+
+ * agent/: agent_read_config.c, agent_read_config.h:
+
+ - (agent_read_config.c, agent_read_config.h): wrappers for real read_config()s.
+
+1998-07-08 14:04 hardaker
+
+ * Makefile.in, Makefile.top, configure,
+ configure.in, agent/Makefile.in,
+ agent/dlmods/.cvsignore, agent/dlmods/Makefile.in,
+ agent/dlmods/dlmod_mib.c, agent/dlmods/dlmod_mib.h,
+ agent/dlmods/example.c, agent/dlmods/example.h,
+ agent/mibgroup/misc/dlmod.c, agent/mibgroup/misc/dlmod.h
+, apps/Makefile.in, apps/snmpnetstat/Makefile.in
+, mibs/DLMOD-MIB.txt, mibs/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (Makefile.in, Makefile.top, configure, configure.in, Makefile.in,
+ .cvsignore, Makefile.in, dlmod_mib.c, dlmod_mib.h, example.c,
+ example.h, dlmod.c, dlmod.h, Makefile.in, Makefile.in,
+ DLMOD-MIB.txt, Makefile.in, Makefile.in): Patch from Eugene
+ Polovnikov:
+ - new dlmod set.
+ - fix configure script.
+
+1998-07-08 13:08 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): Patch from Niels Baggesen:
+ - fix for missing object identifier labels.
+
+1998-07-08 13:03 hardaker
+
+ * snmplib/system.c:
+
+ - (system.c): don't free env pointers that are created.
+
+1998-07-08 13:02 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - (interfaces.c): make hp_interfaces structure static.
+
+1998-07-08 12:58 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Patch from Joe Marzot:
+ - fix "number of retries" bug.
+ - remove odd timeout calculation code for retries > 3.
+
+1998-07-08 12:57 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ - (ucd_snmp.h): added pass-persist module.
+
+1998-07-08 12:56 hardaker
+
+ * agent/: read_config.c, read_config.h:
+
+ - (read_config.c, read_config.h): removed from agent dir.
+
+1998-07-08 12:34 hardaker
+
+ * agent/mibgroup/: struct.h, util_funcs.c,
+ util_funcs.h, ucd-snmp/pass-persist.c,
+ ucd-snmp/pass-persist.h:
+
+ - (struct.h, util_funcs.c, util_funcs.h, pass-persist.c,
+ pass-persist.h): Patch from Michael Douglass:
+ - create a pass-persist module to handle continuously running pass throughs.
+
+1998-07-08 12:27 hardaker
+
+ * win32/: win32.opt, libsnmp/libsnmp.dsp,
+ libsnmp/libsnmp.plg, libsnmp_dll/libsnmp.def,
+ libsnmp_dll/libsnmp_dll.plg, snmpbulkwalk/snmpbulkwalk.dsp
+, snmpbulkwalk/snmpbulkwalk.plg, snmpget/snmpget.dsp
+, snmpget/snmpget.plg, snmpgetnext/snmpgetnext.dsp
+, snmpgetnext/snmpgetnext.plg, snmpset/snmpset.dsp
+, snmpset/snmpset.plg, snmpstatus/snmpstatus.dsp,
+ snmpstatus/snmpstatus.plg, snmptranslate/snmptranslate.dsp
+, snmptranslate/snmptranslate.plg, snmpwalk/snmpwalk.dsp
+, snmpwalk/snmpwalk.plg:
+
+ - (win32.opt, libsnmp.dsp, libsnmp.plg, libsnmp.def, libsnmp_dll.plg,
+ snmpbulkwalk.dsp, snmpbulkwalk.plg, snmpget.dsp, snmpget.plg,
+ snmpgetnext.dsp, snmpgetnext.plg, snmpset.dsp, snmpset.plg,
+ snmpstatus.dsp, snmpstatus.plg, snmptranslate.dsp,
+ snmptranslate.plg, snmpwalk.dsp, snmpwalk.plg): Patch from Joe
+ Marzot:
+ - win32 update.
+
+1998-07-01 15:57 hardaker
+
+ * apps/: snmptrapd.c, snmptrapd_handlers.c:
+
+ - (snmptrapd.c, snmptrapd_handlers.c):
+ - fix extensiblity checking of oids.
+ - seperate running of external command into new function.
+
+1998-07-01 15:56 hardaker
+
+ * snmplib/: read_config.c, read_config.h:
+
+ - (read_config.c, read_config.h): minor spacing changes.
+
+1998-07-01 15:56 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h, system.h:
+
+ - (snmp_api.c, snmp_api.h, system.h):
+ - added DEBUGPOID(name, namelen);
+ - moved DEBUGP definition into snmp_api.h where it belongs.
+
+1998-07-01 11:28 hardaker
+
+ * snmplib/: Makefile.in, read_config.c, read_config.h
+, snmp_api.c, snmp_api.h:
+
+ - (configure, configure.in, Makefile.in, agent_read_config.c,
+ agent_read_config.h, snmp_vars.c, snmp_vars.h, snmpd.c, Makefile.in,
+ struct.h, pass.h, Makefile.in, snmptrapd.c, snmptrapd_handlers.c,
+ snmptrapd_handlers.h, Makefile.in, read_config.c, read_config.h,
+ snmp_api.c, snmp_api.h):
+ - moved read_config support into the library and use it.
+ - beginnings of snmptrapd extensibility.
+
+1998-07-01 11:23 hardaker
+
+ * configure, configure.in, agent/Makefile.in
+, agent/agent_read_config.c, agent/agent_read_config.h
+, agent/snmp_vars.c, agent/snmp_vars.h,
+ agent/snmpd.c, agent/mibgroup/Makefile.in,
+ agent/mibgroup/struct.h, agent/mibgroup/ucd-snmp/pass.h
+, apps/Makefile.in, apps/snmptrapd.c,
+ apps/snmptrapd_handlers.c, apps/snmptrapd_handlers.h:
+
+ - (configure, configure.in, Makefile.in, agent_read_config.c,
+ agent_read_config.h, snmp_vars.c, snmp_vars.h, snmpd.c, Makefile.in,
+ struct.h, pass.h, Makefile.in, snmptrapd.c, snmptrapd_handlers.c,
+ snmptrapd_handlers.h, Makefile.in, read_config.c, read_config.h,
+ snmp_api.c, snmp_api.h):
+ - moved read_config support into the library and use it.
+ - beginnings of snmptrapd extensibility.
+
+1998-06-28 09:30 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): fix snmp_add_var().
+
+1998-06-26 10:45 hardaker
+
+ * agent/mibgroup/smux/: smux.c, snmp_bgp.c, snmp_ospf.c
+, snmp_rip2.c, snmp_rip2.h:
+
+ - (smux.c, snmp_bgp.c, snmp_ospf.c, snmp_rip2.c, snmp_rip2.h): Patch
+ from Niels Baggesen:
+ - Fix for new defines and proper header includes.
+
+1998-06-26 10:42 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ - (disk.c): Patch from Michael Douglass:
+ - fix calculation of totaldisk by doing block division first to
+ protect against 32 bit overflows.
+
+1998-06-24 11:40 hardaker
+
+ * .cvsignore:
+
+ - (.cvsignore): added .index.
+
+1998-06-24 11:40 hardaker
+
+ * agent/: snmpd.c, snmpd.h:
+
+ - (snmpd.c, snmpd.h):
+ - created (poorly) send_trap_pdu() for sending v2 traps from mib modules.
+
+1998-06-24 11:08 hardaker
+
+ * mibs/: .cvsignore, UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): Patch from Niels Baggesen:
+ - shutdown trap specifications.
+ - misc mib fixes.
+
+1998-06-24 10:58 hardaker
+
+ * agent/.cvsignore, apps/.cvsignore:
+
+ - (.cvsignore, .cvsignore): a few updates.
+
+1998-06-24 10:57 hardaker
+
+ * man/.cvsignore:
+
+ - (man/.cvsignore): ignore .html files.
+
+1998-06-24 10:56 hardaker
+
+ * apps/snmpset.c, apps/snmptest.c, apps/snmptrap.c
+, snmplib/snmp_api.c, snmplib/snmp_api.h:
+
+ - (snmpset.c, snmptest.c, snmptrap.c, snmp_api.c, snmp_api.h):
+ - moved hex_to_binary, ascii_to_binary, and snmp_add_var to snmplib.
+
+1998-06-24 10:31 hardaker
+
+ * snmplib/: Makefile.in, snmp_api.c, snmp_api.h
+:
+
+ - (Makefile.in, snmp_api.c, snmp_api.h): create snmp_pdu_add_variable().
+
+1998-06-24 10:30 hardaker
+
+ * man/Makefile.in:
+
+ - (Makefile.in): man->html make specification.
+
+1998-06-22 09:16 hardaker
+
+ * apps/snmpnetstat/main.c:
+
+ - (main.c): Patch from Jerry G. DeLapp:
+ - commented out trailing #endif comment.
+
+1998-06-19 13:14 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): update for 3.5.
+
+1998-06-19 13:13 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.5 )
+
+1998-06-19 13:12 hardaker
+
+ * NEWS:
+
+ - (NEWS): Last update for 3.5.
+
+1998-06-19 13:01 hardaker
+
+ * agent/Makefile.in, snmplib/Makefile.in:
+
+ - (Makefile.in): make depend.
+
+1998-06-19 12:53 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): memset to 0 the entire subtree struct.
+
+1998-06-19 12:50 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ - (util_funcs.c): fix checkmib() in case we get called on a get when
+ we really shouldn't (bad artifact of new tree structure).
+
+1998-06-19 12:05 hardaker
+
+ * agent/mibgroup/dummy/dummy.c:
+
+ - (dummy.c): mention auto_nlist().
+
+1998-06-19 12:04 hardaker
+
+ * agent/mibgroup/dummy/AddModuleForDummies.txt:
+
+ - (AddModuleForDummies.txt): update to fix paths and misc stuff.
+
+1998-06-19 12:03 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): fix register_mib() to init pointers to null.
+
+1998-06-19 08:59 hardaker
+
+ * mibs/Makefile.in:
+
+ - (Makefile.in): Patch from Cristian Estan:
+ - install IPFWACC mib.
+
+1998-06-19 08:59 hardaker
+
+ * agent/mibgroup/misc/ipfwacc.h, mibs/IPFWACC-MIB.txt:
+
+ - (ipfwacc.h, IPFWACC-MIB.txt): Patch from Cristian Estan:
+ - turn into a correct table.
+
+1998-06-19 08:58 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): Patch from Cristian Estan:
+ - example output corrections.
+
+1998-06-19 08:46 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): warn BSDI users against /usr/ucb/cc.
+
+1998-06-19 08:41 hardaker
+
+ * FAQ:
+
+ - (FAQ): update from Dave Shield: not found modules with configure?.
+
+1998-06-17 15:28 hardaker
+
+ * agent/mibgroup/dummy/dummy.h:
+
+ - (dummy.h): add DUMMY-MIB by default.
+
+1998-06-17 15:27 hardaker
+
+ * agent/mibgroup/README:
+
+ - (README): mention dummy group.
+
+1998-06-17 08:21 hardaker
+
+ * README, agent/mibgroup/dummy/AddModuleForDummies.txt
+, agent/mibgroup/dummy/DUMMY-MIB.txt,
+ agent/mibgroup/dummy/dummy.c, agent/mibgroup/dummy/dummy.h
+:
+
+ - (README, AddModuleForDummies.txt, DUMMY-MIB.txt, dummy.c, dummy.h):
+ Patch from Jakob Ellerstedt:
+ - mib module documentation and example for dummies.
+
+1998-06-17 08:11 hardaker
+
+ * snmplib/mib.h:
+
+ - (mib.h): Patch from Niels Baggesen:
+ - remove 2nd init_mib() prototype.
+
+1998-06-17 08:10 hardaker
+
+ * snmplib/asn1.c:
+
+ - (asn1.c): Patch from Niels Baggesen:
+ - bcopy -> memcpy.
+
+1998-06-17 08:10 hardaker
+
+ * man/: Makefile.in, snmpbulkwalk.1, snmpcmd.1,
+ snmpdelta.1, snmpget.1, snmpgetnext.1, snmpset.1
+, snmpstatus.1, snmptable.1, snmptrap.1,
+ snmpwalk.1:
+
+ - (Makefile.in, snmpbulkwalk.1, snmpcmd.1, snmpdelta.1, snmpget.1,
+ snmpgetnext.1, snmpset.1, snmpstatus.1, snmptable.1, snmptrap.1,
+ snmpwalk.1): Patch from Niels Baggesen:
+ - documentation cleanup and centralization of common options.
+
+1998-06-17 08:08 hardaker
+
+ * apps/snmpdelta.c:
+
+ - (snmpdelta.c): usage() update.
+
+1998-06-17 08:08 hardaker
+
+ * agent/: snmp2p.c, snmpd.c, snmpd.h:
+
+ - (snmp2p.c, snmpd.c, snmpd.h): Patch from Niels Baggesen:
+ - misc type fixes.
+
+1998-06-12 15:17 hardaker
+
+ * agent/mibgroup/misc/ipfwacc.h, mibs/IPFWACC-MIB.txt,
+ mibs/UCD-SNMP-MIB.txt:
+
+ - (ipfwacc.h, IPFWACC-MIB.txt, UCD-SNMP-MIB.txt):
+ - create and use a ucdExperimental section for the ipfwacc mib till
+ it stabilizes.
+
+1998-06-12 13:48 hardaker
+
+ * agent/kernel.c:
+
+ - (kernel.c): don't print klread errors unless in debugging mode.
+
+1998-06-12 13:43 hardaker
+
+ * NEWS:
+
+ - (NEWS): 64bit fix mentioned.
+
+1998-06-12 13:13 hardaker
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ - (libsnmp.def): add setenv to the list.
+
+1998-06-12 13:13 hardaker
+
+ * win32/config.h:
+
+ - (win32/config.h): don't have setenv.
+
+1998-06-12 13:13 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): function name typo.
+
+1998-06-12 13:13 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): trap types were int's not longs (failed under 64bit arch).
+
+1998-06-12 13:12 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ - (disk.c): percentage check was backwards.
+
+1998-06-12 10:12 hardaker
+
+ * NEWS:
+
+ - (NEWS): minor update.
+
+1998-06-12 10:12 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): show vacm example for public/private from anywhere.
+
+1998-06-12 08:52 hardaker
+
+ * EXAMPLE.conf.def, FAQ:
+
+ - (EXAMPLE.conf.def, FAQ): Patch from Dave Shield:
+ - update for VACM stuff.
+
+1998-06-10 15:47 hardaker
+
+ * agent/: snmp2p.c, snmpd.c, snmpd.h:
+
+ - (snmp2p.c, snmpd.c, snmpd.h): -Wall cleanups.
+
+1998-06-10 15:31 hardaker
+
+ * NEWS:
+
+ - (NEWS): update.
+
+1998-06-10 15:30 hardaker
+
+ * TODO:
+
+ - (TODO): added Dave's list.
+
+1998-06-10 14:15 hardaker
+
+ * version.h, bug-report, sedscript.in:
+
+ version tag ( 3.5.pre2 )
+
+1998-06-10 08:53 hardaker
+
+ * agent/: Makefile.in, snmp2p.c, snmpd.c:
+
+ - (Makefile.in, snmp2p.c, snmpd.c): Patch from Dave Shield:
+ - starts to separate out the historic SNMPv2 stuff.
+ - does a bit of 'code tidying'.
+ - starts to move towards port-specific handlers.
+
+1998-06-10 07:11 hardaker
+
+ * config.h.in:
+
+ - (config.h.in): have_setenv.
+
+1998-06-08 14:55 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): undid redo of comment of gettimeofday().
+
+1998-06-08 14:22 hardaker
+
+ * snmplib/: parse.c, parse.h, snmp_api.c,
+ snmp_api.h, snmp_client.c:
+
+ - (parse.c, parse.h, snmp_api.c, snmp_api.h, snmp_client.c): Patch
+ from Joe Marzot:
+ - async stuff added.
+ - get_tc added.
+ - better comments in some places.
+
+1998-06-08 14:16 hardaker
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ - (libsnmp.def): Patch from Joe Marzot: w32 update.
+
+1998-06-08 14:12 hardaker
+
+ * Makefile.in:
+
+ - (Makefile.in): Patch from Joe Marzot:
+ - remove more config created headers on make configclean.
+
+1998-06-08 13:59 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): update rfc # for vacm reference.
+
+1998-06-08 13:59 hardaker
+
+ * README:
+
+ - (README): Added Eugene's name.
+
+1998-06-08 12:34 hardaker
+
+ * agent/mibgroup/Makefile.in:
+
+ - (Makefile.in): create a .c -> .o rule to make sure and place the
+ object files in the appropriate subdirectories.
+
+1998-06-08 10:50 hardaker
+
+ * FAQ:
+
+ - (FAQ): url type splitting.
+
+1998-06-05 11:02 hardaker
+
+ * agent/mibgroup/misc/dlmod.c:
+
+ - (dlmod.c):
+ - change {de,}init functions to _dynamic_{de,}init_MODULE.
+ - use SNMPLIBPATH instead of hard coded /usr/local/lib.
+
+1998-06-05 10:54 hardaker
+
+ * snmplib/: asn1.c, mib.c, parse.h, system.c
+, system.h:
+
+ - (asn1.c, mib.c, parse.h, system.c, system.h): Patch from Niels Baggesen:
+ - MIB_ACCESS define changes.
+ - setenv implementation.
+ - ifdef wrappers for OPAQUE_SPECIAL_TYPES.
+
+1998-06-05 10:53 hardaker
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ - (hr_swrun.c): Patch from Niels Baggesen:
+ - test for null pointer.
+
+1998-06-05 10:52 hardaker
+
+ * maketarget:
+
+ - (maketarget): Patch from Niels Baggesen:
+ - support for larger tree depths.
+
+1998-06-05 10:52 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): Patch from Niels Baggesen:
+ - test for setenv.
+
+1998-06-03 14:26 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.5.pre1 )
+
+1998-06-03 14:24 hardaker
+
+ * agent/Makefile.in:
+
+ - (Makefile.in): read_config.o is mibmodule header dependant too.
+
+1998-06-03 14:23 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (Makefile.in's): make depend.
+
+1998-06-03 14:21 hardaker
+
+ * agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c, apps/snmpset.c,
+ snmplib/asn1.h, snmplib/int64.c, snmplib/int64.h,
+ snmplib/mib.c, snmplib/snmp_api.c:
+
+ - (hr_disk.c, hr_swinst.c, hr_swrun.c, hr_system.c, snmpset.c, asn1.h,
+ int64.c, int64.h, mib.c, snmp_api.c):
+ - -Wall fixes.
+
+1998-06-03 14:02 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): fix new --with-cc and --with-cflags arguments.
+
+1998-06-03 13:52 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in, freebsd2.h):
+ - move configurable defines to configure rather than in freebsd2.h.
+
+1998-06-03 13:43 hardaker
+
+ * config.h.in, configure, configure.in,
+ apps/snmptrapd.c:
+
+ - (config.h.in, configure, configure.in, snmptrapd.c):
+ - check for getdtablesize and use a generic if not available.
+
+1998-06-03 13:39 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): New flags:
+ - --with-cc=CC
+ - --with-cflags=CFLAGS
+
+1998-06-03 12:16 hardaker
+
+ * agent/snmp_agent.c, snmplib/snmp_api.c,
+ snmplib/snmp_auth.c, snmplib/snmp_impl.h:
+
+ - (snmp_agent.c, snmp_api.c, snmp_auth.c, snmp_impl.h):
+ - fix pdu->versions to be all ints.
+
+1998-06-03 11:29 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): missed a needed OPAQUE_SPECIAL_TYPES ifdef.
+
+1998-06-03 11:27 hardaker
+
+ * agent/: snmp_agent.c, snmpd.c:
+
+ - (snmp_agent.c, snmpd.c): include mibII/snmp_mib.h.
+
+1998-06-03 11:10 hardaker
+
+ * agent/mibgroup/: README, example.c, example.h,
+ wombat.c, wombat.h, examples/example.c,
+ examples/example.h, examples/wombat.c,
+ examples/wombat.h:
+
+ - (README, example.c, example.h, wombat.c, wombat.h, example.c,
+ example.h, wombat.c, wombat.h):
+ - moved wombat and example to examples/ directory.
+
+1998-06-03 11:06 hardaker
+
+ * agent/mibgroup/: example.c, example.h, misc/dlmod.c
+, misc/dlmod.h:
+
+ - (example.c, example.h, dlmod.c, dlmod.h): Patch from Eugene Polovnikov:
+ - implement a dynamic loading module for loading shared object mib modules.
+
+1998-06-03 10:58 hardaker
+
+ * README:
+
+ - (README): mention Cristian Estan in the coders list.
+
+1998-06-03 10:58 hardaker
+
+ * INSTALL:
+
+ - (INSTALL): mention ipfwacc
+
+1998-06-03 10:58 hardaker
+
+ * agent/mibgroup/misc/ipfwacc.c,
+ agent/mibgroup/misc/ipfwacc.h, mibs/IPFWACC-MIB.txt,
+ mibs/UCD-SNMP-MIB.txt:
+
+ - (ipfwacc.c, ipfwacc.h, IPFWACC-MIB.txt, UCD-SNMP-MIB.txt):
+ - moved ipfwacc to ucdavis.13 and removed ^Ms and some blank lines.
+
+1998-06-03 10:54 hardaker
+
+ * agent/mibgroup/misc/ipfwacc.h:
+
+ - (ipfwacc.h): config_add_mib(IPFWACC-MIB).
+
+1998-06-03 10:52 hardaker
+
+ * agent/mibgroup/misc/ipfwacc.c,
+ agent/mibgroup/misc/ipfwacc.h, mibs/IPFWACC-MIB.txt:
+
+ - (ipfwacc.c, ipfwacc.h, IPFWACC-MIB.txt): Patch from Cristian Estan:
+ - ip firewall accounting information mib implementation.
+
+1998-06-03 10:51 hardaker
+
+ * agent/mibgroup/: smux.c, smux.h, smux_gated.h,
+ snmp_bgp.c, snmp_bgp.h, snmp_ospf.c, snmp_ospf.h
+, snmp_rip2.c, snmp_rip2.h, smux/smux.c,
+ smux/smux.h, smux/snmp_bgp.c, smux/snmp_bgp.h,
+ smux/snmp_ospf.c, smux/snmp_ospf.h, smux/snmp_rip2.c
+, smux/snmp_rip2.h:
+
+ - (smux.c, smux.h, smux_gated.h, snmp_bgp.c, snmp_bgp.h, snmp_ospf.c,
+ snmp_ospf.h, snmp_rip2.c, snmp_rip2.h, smux.c, smux.h, snmp_bgp.c,
+ snmp_bgp.h, snmp_ospf.c, snmp_ospf.h, snmp_rip2.c, snmp_rip2.h):
+ - moved smux stuff into a smux sub-directory.
+
+1998-06-02 14:21 hardaker
+
+ * agent/auto_nlist.c, agent/auto_nlist.h,
+ agent/kernel.c, agent/snmp_agent.c, agent/snmpd.c
+, agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_other.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c, agent/mibgroup/host/hr_proc.c
+, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hr_utils.c, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/var_route.c, apps/snmp_parse_args.c
+, apps/snmpdelta.c, apps/snmptable.c,
+ apps/snmptranslate.c, apps/snmptrapd.c,
+ snmplib/asn1.c, snmplib/mib.c, snmplib/parse.c
+, snmplib/parse.h, snmplib/snmp_auth.c,
+ snmplib/snmp_impl.h:
+
+ - (auto_nlist.c, auto_nlist.h, kernel.c, snmp_agent.c, snmpd.c,
+ hr_device.c, hr_disk.c, hr_filesys.c, hr_network.c, hr_other.c,
+ hr_partition.c, hr_print.c, hr_proc.c, hr_storage.c, hr_swinst.c,
+ hr_swrun.c, hr_system.c, hr_utils.c, at.c, interfaces.c,
+ var_route.c, snmp_parse_args.c, snmpdelta.c, snmptable.c,
+ snmptranslate.c, snmptrapd.c, freebsd2.h, hpux.h, linux.h, netbsd.h,
+ solaris.h, sysv.h, asn1.c, mib.c, parse.c, parse.h, snmp_auth.c,
+ snmp_impl.h): Patch from Niels Baggensen:
+ - make host resources work under NetBSD, FreeBSD, Solaris and Linux.
+ - SunOS4 almost works.
+ - Add -s/-S to command line options for printing of shorter oids.
+ - numerous bug fixes.
+
+1998-05-31 17:56 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - make it possible not to use opaque special types with new cmd line flag.
+
+1998-05-31 17:56 hardaker
+
+ * apps/snmpset.c:
+
+ - (snmpset.c): enable setting of opaque floats, doubles, int64s, uint64s.
+
+1998-05-31 17:55 hardaker
+
+ * snmplib/: asn1.c, asn1.h, int64.c, int64.h
+, mib.c, snmp.c, snmp_api.c, snmp_api.h
+, snmp_impl.h:
+
+ - (asn1.c, asn1.h, int64.c, int64.h, mib.c, snmp.c, snmp_api.c,
+ snmp_api.h, snmp_impl.h):
+ - implement special data types via opaques: float, double, int64, uint64s.
+
+1998-05-29 16:21 hardaker
+
+ * snmplib/snmp_impl.h:
+
+ - (snmp_impl.h): change pdu version from long to int.
+
+1998-05-29 16:20 hardaker
+
+ * configure, configure.in, agent/common_header.h
+, agent/snmp_agent.c, agent/snmp_vars.c,
+ agent/snmpd.c, agent/mibgroup/Makefile.in,
+ agent/mibgroup/acl_vars.c, agent/mibgroup/acl_vars.h,
+ agent/mibgroup/alarm.c, agent/mibgroup/alarm.h,
+ agent/mibgroup/at.c, agent/mibgroup/at.h,
+ agent/mibgroup/context_vars.c, agent/mibgroup/context_vars.h
+, agent/mibgroup/disk.c, agent/mibgroup/disk.h,
+ agent/mibgroup/errormib.c, agent/mibgroup/errormib.h,
+ agent/mibgroup/event.c, agent/mibgroup/event.h,
+ agent/mibgroup/extensible.c, agent/mibgroup/extensible.h
+, agent/mibgroup/host.h, agent/mibgroup/hpux.c,
+ agent/mibgroup/hpux.h, agent/mibgroup/hr_device.c,
+ agent/mibgroup/hr_device.h, agent/mibgroup/hr_disk.c,
+ agent/mibgroup/hr_disk.h, agent/mibgroup/hr_filesys.c,
+ agent/mibgroup/hr_filesys.h, agent/mibgroup/hr_network.c
+, agent/mibgroup/hr_network.h,
+ agent/mibgroup/hr_other.c, agent/mibgroup/hr_other.h,
+ agent/mibgroup/hr_partition.c, agent/mibgroup/hr_partition.h
+, agent/mibgroup/hr_print.c, agent/mibgroup/hr_print.h
+, agent/mibgroup/hr_proc.c, agent/mibgroup/hr_proc.h
+, agent/mibgroup/hr_storage.c,
+ agent/mibgroup/hr_storage.h, agent/mibgroup/hr_swinst.c
+, agent/mibgroup/hr_swinst.h, agent/mibgroup/hr_swrun.c
+, agent/mibgroup/hr_swrun.h, agent/mibgroup/hr_system.c
+, agent/mibgroup/hr_system.h, agent/mibgroup/hr_utils.c
+, agent/mibgroup/hr_utils.h, agent/mibgroup/icmp.c
+, agent/mibgroup/icmp.h, agent/mibgroup/interfaces.c
+, agent/mibgroup/interfaces.h, agent/mibgroup/ip.c
+, agent/mibgroup/ip.h, agent/mibgroup/loadave.c
+, agent/mibgroup/loadave.h, agent/mibgroup/memory.c
+, agent/mibgroup/memory.h, agent/mibgroup/mibII.c
+, agent/mibgroup/mibII.h, agent/mibgroup/party_vars.c
+, agent/mibgroup/party_vars.h, agent/mibgroup/pass.c
+, agent/mibgroup/pass.h, agent/mibgroup/proc.c,
+ agent/mibgroup/proc.h, agent/mibgroup/registry.c,
+ agent/mibgroup/registry.h, agent/mibgroup/route_write.c
+, agent/mibgroup/route_write.h,
+ agent/mibgroup/snmp_mib.c, agent/mibgroup/snmp_mib.h,
+ agent/mibgroup/sysORTable.c, agent/mibgroup/sysORTable.h
+, agent/mibgroup/system.c, agent/mibgroup/system.h
+, agent/mibgroup/tcp.c, agent/mibgroup/tcp.h,
+ agent/mibgroup/ucd_snmp.h, agent/mibgroup/udp.c,
+ agent/mibgroup/udp.h, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/v2party.c, agent/mibgroup/v2party.h,
+ agent/mibgroup/vacm_vars.c, agent/mibgroup/vacm_vars.h
+, agent/mibgroup/var_route.c,
+ agent/mibgroup/var_route.h, agent/mibgroup/versioninfo.c
+, agent/mibgroup/versioninfo.h,
+ agent/mibgroup/view_vars.c, agent/mibgroup/view_vars.h,
+ agent/mibgroup/vmstat.c, agent/mibgroup/vmstat.h,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_device.h,
+ agent/mibgroup/host/hr_disk.c, agent/mibgroup/host/hr_disk.h
+, agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_filesys.h,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_network.h,
+ agent/mibgroup/host/hr_other.c,
+ agent/mibgroup/host/hr_other.h,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_partition.h,
+ agent/mibgroup/host/hr_print.c,
+ agent/mibgroup/host/hr_print.h, agent/mibgroup/host/hr_proc.c
+, agent/mibgroup/host/hr_proc.h,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_storage.h,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swinst.h,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_swrun.h,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/host/hr_system.h,
+ agent/mibgroup/host/hr_utils.c,
+ agent/mibgroup/host/hr_utils.h, agent/mibgroup/mibII/at.c
+, agent/mibgroup/mibII/at.h, agent/mibgroup/mibII/icmp.c
+, agent/mibgroup/mibII/icmp.h,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, agent/mibgroup/mibII/ip.c
+, agent/mibgroup/mibII/ip.h,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/route_write.h,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/snmp_mib.h,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/sysORTable.h,
+ agent/mibgroup/mibII/system.c, agent/mibgroup/mibII/system.h
+, agent/mibgroup/mibII/tcp.c, agent/mibgroup/mibII/tcp.h
+, agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/udp.h
+, agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/mibII/var_route.h,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/disk.h,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/errormib.h,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/extensible.h,
+ agent/mibgroup/ucd-snmp/hpux.c,
+ agent/mibgroup/ucd-snmp/hpux.h,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/loadave.h,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass.h,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/proc.h,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/ucd-snmp/registry.h,
+ agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/versioninfo.h,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/ucd-snmp/vmstat.h,
+ agent/mibgroup/v2party/acl_vars.c,
+ agent/mibgroup/v2party/acl_vars.h,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/alarm.h,
+ agent/mibgroup/v2party/context_vars.c,
+ agent/mibgroup/v2party/context_vars.h,
+ agent/mibgroup/v2party/event.c,
+ agent/mibgroup/v2party/event.h,
+ agent/mibgroup/v2party/party_vars.c,
+ agent/mibgroup/v2party/party_vars.h,
+ agent/mibgroup/v2party/view_vars.c,
+ agent/mibgroup/v2party/view_vars.h:
+
+ - (configure, configure.in, agent/mibgroup/*):
+ - moved most mibgroup pieces into relevent sub-directories.
+ - changed all header file and #ifdef USING_* lines to reflect this.
+
+1998-05-29 15:21 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): add ability to specify mib information on the cmd line.
+
+1998-05-29 15:20 hardaker
+
+ * TODO:
+
+ - (TODO): winSNMP mention.
+
+1998-05-29 11:34 hardaker
+
+ * configure, configure.in, agent/Makefile.in
+:
+
+ - (configure, configure.in, Makefile.in):
+ - Add a dependancy line for snmp_vars.o for all the module includes.
+
+1998-05-29 11:27 hardaker
+
+ * configure:
+
+ - (configure): make of configure.
+
+1998-05-29 11:26 hardaker
+
+ * configure.in:
+
+ - (configure.in): patch from Niels: include sys/socket in if_mtu test.
+
+1998-05-29 10:24 hardaker
+
+ * snmplib/: snmp_api.c, snmp_impl.h:
+
+ - (snmp_api.c, snmp_impl.h): Patch from Joe Marzot:
+ - fix community name length problems and increase size.
+
+1998-05-29 10:14 hardaker
+
+ * agent/mibgroup/at.c:
+
+ - (at.c): Patch from Chris Smith: fix for irix.
+
+1998-05-24 15:22 hardaker
+
+ * agent/mibgroup/ip.c:
+
+ - (ip.c): Patch from Niels Baggesen:
+ - fix for netbsd < 1.3.
+
+1998-05-24 15:22 hardaker
+
+ * NEWS:
+
+ - (NEWS): change vacm news wording.
+
+1998-05-24 15:22 hardaker
+
+ * FAQ:
+
+ - (FAQ): update to change a few things.
+
+1998-05-20 08:33 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.4 )
+
+1998-05-20 08:30 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): update.
+
+1998-05-20 08:27 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (*/Makefile.in): make depend.
+
+1998-05-20 08:25 hardaker
+
+ * agent/read_config.c:
+
+ - (read_config.c): config_perror() -> config_pwarn() for missing tokens.
+
+1998-05-20 07:37 hardaker
+
+ * snmplib/snmp_impl.h:
+
+ - (snmp_impl.h): version should be a long.
+
+1998-05-20 07:36 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ - (util_funcs.c): make checmib() use oid not int for newname.
+
+1998-05-20 07:34 hardaker
+
+ * FAQ:
+
+ - (FAQ): Update from Dave Shield.
+
+1998-05-20 07:33 hardaker
+
+ * snmplib/: mib.c, parse.c:
+
+ - (mib.c, parse.c): Patch from Niels Baggesen:
+ - extend random lookups further.
+
+1998-05-19 10:41 hardaker
+
+ * agent/mibgroup/memory.c:
+
+ - (memory.c): fix swapinfo on hpux10 systems. (/etc/swapinfo -r).
+
+1998-05-19 10:41 hardaker
+
+ * agent/mibgroup/at.c:
+
+ - (at.c): set to do nothing when CAN_USE_SYSCTL.
+
+1998-05-18 18:14 hardaker
+
+ * snmplib/int64.c:
+
+ - (int64.c):
+ - include header changes for win32.
+
+1998-05-18 15:39 hardaker
+
+ * version.h, bug-report, sedscript.in:
+
+ version tag ( 3.4.pre9 )
+
+1998-05-18 13:13 hardaker
+
+ * agent/mibgroup/hr_swinst.c:
+
+ - (hr_swinst.c): protect using the date pointer against NULL settings.
+
+1998-05-18 12:52 hardaker
+
+ * mibs/.index:
+
+ - (mibs/.index): removed.
+
+1998-05-18 11:17 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - fix rtentry structure test on re-configures.
+
+1998-05-15 11:18 hardaker
+
+ * win32/: config.h, win32.opt, libsnmp/libsnmp.dsp
+, libsnmp/libsnmp.plg, libsnmp_dll/libsnmp.def,
+ libsnmp_dll/libsnmp_dll.dsp, libsnmp_dll/libsnmp_dll.plg
+, snmpbulkwalk/snmpbulkwalk.plg, snmpget/snmpget.plg
+, snmpgetnext/snmpgetnext.plg, snmpset/snmpset.plg
+, snmpstatus/snmpstatus.plg,
+ snmptranslate/snmptranslate.plg, snmpwalk/snmpwalk.plg:
+
+ - (config.h, win32.opt, libsnmp.dsp, libsnmp.plg, libsnmp.def,
+ libsnmp_dll.dsp, libsnmp_dll.plg, snmpbulkwalk.plg, snmpget.plg,
+ snmpgetnext.plg, snmpset.plg, snmpstatus.plg, snmptranslate.plg,
+ snmpwalk.plg): Patch from Joe Marzot:
+ - win32 file updates.
+
+1998-05-15 11:17 hardaker
+
+ * FAQ, snmplib/mib.c:
+
+ - (FAQ, mib.c): Patch from Dave Shield:
+ - handle random lookups with multiple oid segments.
+
+1998-05-15 10:19 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): Patch from Dave Shield:
+ - provide ability to do random searches specifying a module name to look in.
+
+1998-05-15 10:17 hardaker
+
+ * agent/read_config.c, agent/mibgroup/hr_filesys.c,
+ agent/mibgroup/hr_storage.c, agent/mibgroup/hr_swrun.c
+, agent/mibgroup/hr_system.c,
+ agent/mibgroup/hr_system.h, agent/mibgroup/hr_utils.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/var_route.c
+, apps/snmp_parse_args.c, apps/snmptable.c,
+ apps/snmptranslate.c, man/snmptranslate.1,
+ snmplib/int64.h, snmplib/mib.c, snmplib/mib.h,
+ snmplib/parse.c, snmplib/parse.h:
+
+ - (read_config.c, hr_filesys.c, hr_storage.c, hr_swrun.c, hr_system.c,
+ hr_system.h, hr_utils.c, util_funcs.c, var_route.c,
+ snmp_parse_args.c, snmptable.c, snmptranslate.c, snmptranslate.1,
+ bsd.h, solaris.h, sunos.h, int64.h, mib.c, mib.h, parse.c, parse.h):
+ Patch from Niels Baggesen:
+ - snmptranslate supports -R and -r.
+ - miscellaneous warning fixes.
+ - oid searcher always ignores case.
+ - fixed hr_system to compile on SunOS4.
+
+1998-05-15 10:13 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): single quote missing module names.
+
+1998-05-14 08:25 hardaker
+
+ * configure, configure.in:
+
+ - (configure.in, configure): typos.
+
+1998-05-14 08:22 hardaker
+
+ * NEWS:
+
+ - (NEWS): mib2c mentioned.
+
+1998-05-14 08:21 hardaker
+
+ * FAQ:
+
+ - (FAQ): new FAQ from Dave Shields.
+
+1998-05-14 07:17 hardaker
+
+ * agent/mibgroup/memory.c:
+
+ - (memory.c): move sys/param.h up above fs.h headers.
+
+1998-05-13 21:25 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): sprint_by_type() didn't handle counter64's.
+
+1998-05-13 21:22 hardaker
+
+ * agent/mibgroup/memory.c:
+
+ - (memory.c): include sys/param.h for bsdi
+
+1998-05-13 21:22 hardaker
+
+ * agent/mibgroup/ip.c:
+
+ - (ip.c): include net/route.h and syslog.h for bsdi.
+
+1998-05-13 21:21 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): don't return a counter64 to a snmpv1 request.
+
+1998-05-13 21:21 hardaker
+
+ * snmplib/: int64.c, int64.h, mib.c:
+
+ - (int64.c, int64.h, mib.c): make int64.c use counter64's structure.
+
+1998-05-12 15:15 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.4.pre8 )
+
+1998-05-12 15:14 hardaker
+
+ * agent/mibgroup/: disk.c, example.c, interfaces.c
+, loadave.c, memory.c, pass.c, proc.c
+, util_funcs.h, vmstat.c:
+
+ - (disk.c, example.c, interfaces.c, loadave.c, memory.c, pass.c,
+ proc.c, util_funcs.h, vmstat.c):
+ - include time.h properly instead of relying on util_funcs.h to do it.
+
+1998-05-12 11:45 hardaker
+
+ * snmplib/: snmp_api.c, system.c:
+
+ - (snmp_api.c, system.c):
+ - move debugging code from system.c to snmp_api.c, where it should be.
+
+1998-05-12 11:45 hardaker
+
+ * agent/mibgroup/vmstat.c:
+
+ - (vmstat.c): correct strings inclusion.
+
+1998-05-12 11:11 hardaker
+
+ * agent/mibgroup/disk.c:
+
+ - (disk.c): NULL -> 0.
+
+1998-05-12 11:11 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - munge rpm lib check to link with -ldb as well.
+
+1998-05-12 11:10 hardaker
+
+ * NEWS:
+
+ - (NEWS): more updates.
+
+1998-05-12 10:52 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): Patch from Dave Shield:
+ - include a getdtablesize() function for hpux9.
+
+1998-05-12 10:52 hardaker
+
+ * agent/mibgroup/hr_swinst.c:
+
+ - (hr_swinst.c): Patch from Dave Shield:
+ - more swinst fixes for rpm modules.
+
+1998-05-11 10:34 hardaker
+
+ * snmplib/: mib.c, parse.c, parse.h,
+ snmp_api.h, vacm.c, vacm.h:
+
+ - (mib.c, parse.c, parse.h, snmp_api.h, vacm.c, vacm.h): Patch from
+ Niels Baggesen:
+ - free routines for vacm (to allow -HUP)
+ - fix the parser to report unlinked OIDs. This did reveal an error in a
+ Cisco MIB (CISCO-IPMCAST-MIB) that I had been using (it needs an
+ IMPORTS ciscoExperiment FROM CISCO-SMI)
+ Actually the parser worked ok, except for the missing error messages.
+ - rewrite of the parsers lexical analyser, to correct the errors that
+ Dave Perkins and others have pointed out recently (name::= , DESCRIPTION"
+ and proper handling of -- partial line comments --). Watch out! this last
+ may find errors in old MIBs (including the version of SNMPv2-TC that
+ we ship). My Fore Systems MIBs had errors with this.
+ - implement the long since announced -H option to snmptable
+
+1998-05-11 10:32 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): Patch from Niels Baggesen:
+ - Corrections of disk entry capitilazation problems.
+
+1998-05-11 10:31 hardaker
+
+ * mibs/SNMPv2-TC.txt:
+
+ - (SNMPv2-TC.txt): Patch from Niels Baggesen:
+ - this last [parser] may find errors in old MIBs (including the
+ version of SNMPv2-TC that we ship).
+
+1998-05-11 10:30 hardaker
+
+ * man/snmptranslate.1:
+
+ - (snmptranslate.1): Patch from Niels Baggesen:
+ - implement the long since announced -H option to snmptable.
+
+1998-05-11 10:30 hardaker
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c): Patch from Niels Baggesen:
+ - implement the long since announced -H option to snmptable
+
+1998-05-11 10:30 hardaker
+
+ * agent/mibgroup/: hr_disk.c, hr_filesys.c,
+ hr_partition.c, vacm_vars.c:
+
+ - (hr_disk.c, hr_filesys.c, hr_partition.c, vacm_vars.c): Patch from
+ Niels Baggesen:
+ - some prototypes for the hr_*.c files (needs Dave's recent patch)
+ Warning: the proc part still does not work with Solaris!
+
+1998-05-11 10:29 hardaker
+
+ * agent/: read_config.c, snmp_vars.h, snmpd.c,
+ snmpd.h, var_struct.h:
+
+ - (read_config.c, snmp_vars.h, snmpd.c, snmpd.h, var_struct.h): Patch
+ from Niels Baggesen:
+ - free routines for vacm (to allow -HUP)
+ - free routines for the trapsink directives in snmpd
+
+1998-05-11 08:10 hardaker
+
+ * snmplib/int64.c:
+
+ - (int64.c): add incrByU32().
+
+1998-05-11 08:10 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): opaque's can have a size specifier.
+
+1998-05-11 08:09 hardaker
+
+ * local/mib2c:
+
+ - (mib2c):
+ - counter64s.
+ - consolodation of variable declarations.
+ - more error stings in all files for unknown variable types.
+
+1998-05-11 08:08 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): optional port number.
+
+1998-05-11 08:08 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ - (util_funcs.c): blank line removal.
+
+1998-05-08 14:53 hardaker
+
+ * agent/mibgroup/disk.c:
+
+ - (disk.c): wording change.
+
+1998-05-08 11:01 hardaker
+
+ * agent/mibgroup/: hr_disk.c, hr_swinst.c:
+
+ - (hr_swinst.c, hr_disk.c): Patch from Dave Shields.
+
+1998-05-08 10:57 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config*): check for pkglocs.h.
+
+1998-05-07 09:07 hardaker
+
+ * agent/read_config.c:
+
+ - (read_config.c): debug info for config files read.
+
+1998-05-07 09:07 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): sys/stat inclusion in fs checks.
+
+1998-05-07 09:05 hardaker
+
+ * COPYING:
+
+ - (COPYING): correction for dates.
+
+1998-05-06 22:28 hardaker
+
+ * win32/config.h:
+
+ - (win32/config.h): update from Joe Marzot.
+
+1998-05-06 21:08 hardaker
+
+ * local/mib2c:
+
+ - (mib2c): created a mib2c template creator.
+
+1998-05-06 21:08 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): make bogus index's be 0.
+
+1998-05-06 21:07 hardaker
+
+ * agent/mibgroup/: util_funcs.c, util_funcs.h:
+
+ - (util_funcs.c, util_funcs.h):
+ - new function: calculate_time_diff(t1, t2).
+
+1998-05-06 21:06 hardaker
+
+ * NEWS:
+
+ - (NEWS): minor wording change.
+
+1998-05-06 14:58 hardaker
+
+ * agent/mibgroup/: disk.c, errormib.c, example.c
+, example.h, extensible.c, loadave.c,
+ memory.c, proc.c, sysORTable.c, system.c
+, util_funcs.c, util_funcs.h, versioninfo.c
+, vmstat.c:
+
+ - (disk.c, errormib.c, example.c, example.h, extensible.c, loadave.c,
+ memory.c, proc.c, sysORTable.c, system.c, util_funcs.c,
+ util_funcs.h, versioninfo.c, vmstat.c):
+ - remove the newname requirement from checkmib().
+ - create header_generic() for simple scalar tests.
+ - use header_generic() in all ucd specific scalar mibs, and example.[ch].
+
+1998-05-06 14:06 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt):
+ - added internal table section.
+ - mib number corrections to match the source.
+
+1998-05-06 11:22 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in): install tkmib.
+
+1998-04-29 11:41 hardaker
+
+ * local/tkmib:
+
+ - (tkmib):
+ - display unloaded module error.
+ - don't try to load a file on a cancel.
+
+1998-04-29 11:32 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): put vmstat back in and renamed to systemStats.
+
+1998-04-29 11:31 hardaker
+
+ * agent/mibgroup/: vmstat.c, vmstat.h:
+
+ - (vmstat.c, vmstat.h): moves, changes, removals, and fixes.
+
+1998-04-29 10:43 hardaker
+
+ * agent/mibgroup/: example.c, example.h, wombat.c
+, wombat.h:
+
+ - (example.c, example.h, wombat.c, wombat.h): more clean ups.
+
+1998-04-29 10:34 hardaker
+
+ * agent/mibgroup/: example.c, proc.c, var_route.c
+, wombat.c:
+
+ - (example.c, proc.c, var_route.c, wombat.c):
+ - nlist cleanups.
+
+1998-04-29 10:26 hardaker
+
+ * agent/mibgroup/tcp.c:
+
+ - (tcp.c): don't use TCPSTAT_SYMBOL unless defined.
+
+1998-04-29 08:56 hardaker
+
+ * apps/snmptable.c:
+
+ - (snmptable.c): Patch from Niels Baggesen:
+ - fix -H header printing.
+
+1998-04-27 16:48 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): bug fixes.
+
+1998-04-27 16:46 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): New mib menu command: load a mib module by ID name.
+
+1998-04-27 16:24 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): bug fixes and new mib menu to load new mibs.
+
+1998-04-27 13:31 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.4.pre7 )
+
+1998-04-27 11:00 hardaker
+
+ * apps/: snmpbulkwalk.c, snmpdelta.c, snmpget.c
+, snmpgetnext.c, snmpset.c, snmpstatus.c
+, snmptable.c, snmptest.c, snmpwalk.c:
+
+ - (snmpbulkwalk.c, snmpdelta.c, snmpget.c, snmpgetnext.c, snmpset.c,
+ snmpstatus.c, snmptable.c, snmptest.c, snmpwalk.c):
+ - Put the word "Timeout: " in front of the "No Response" errors.
+
+1998-04-27 11:00 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): define SHLIB_LDCONFIG_CMD as ":" for
+ static library cases.
+
+1998-04-27 10:59 hardaker
+
+ * Makefile.top:
+
+ - (Makefile.top): removed unneeded variable.
+
+1998-04-24 16:40 hardaker
+
+ * agent/mibgroup/var_route.c:
+
+ - (var_route.c): watch out for single route loops.
+
+1998-04-24 16:32 hardaker
+
+ * agent/: auto_nlist.c, auto_nlist.h:
+
+ - (auto_nlist.c, auto_nlist.h): n_value is a long:
+ - return the value from auto_nlist_value as an unsigned long.
+
+1998-04-24 16:31 hardaker
+
+ * agent/mibgroup/tcp.c:
+
+ - (tcp.c): include netinet/tcpip.h for DU4.0.
+
+1998-04-24 14:33 hardaker
+
+ * agent/mibgroup/disk.c:
+
+ - (disk.c): calculate vfs block size if possible and size > 255 bytes.
+
+1998-04-24 14:33 hardaker
+
+ * agent/mibgroup/hr_partition.c:
+
+ - (hr_partition.c): close file descriptor just opened.
+
+1998-04-24 14:33 hardaker
+
+ * agent/mibgroup/hr_filesys.c:
+
+ - (hr_filesys.c): include sys/param.h to define MAXPATHLEN.
+
+1998-04-24 14:32 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - check statvfs.h for f_bavail.
+
+1998-04-24 14:03 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): more cleaning and renaming.
+
+1998-04-24 10:22 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): the textual descriptions were updated some.
+
+1998-04-24 10:02 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt):
+ - renamed labels to be unique from the old definitions.
+ - renumbered again.
+ - commented on the desgin of the mib at the top.
+ - Changed back to SMIv1.
+ - removed lockd section.
+ - removed vmstat section till it gets implemented.
+ - removed sequences of scalers.
+
+1998-04-24 10:00 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): mib oid location updates for ucd-snmp mib.
+
+1998-04-22 08:35 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Niels Baggesen:
+ - parse BITS keywords.
+
+1998-04-22 07:49 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): changed wording, cleaned up a bit.
+
+1998-04-20 16:07 hardaker
+
+ * snmplib/snmp_client.c:
+
+ - (snmp_client.c): Patch from Niels Baggesen:
+ - needed pointer copies.
+
+1998-04-20 16:06 hardaker
+
+ * agent/mibgroup/: tcp.c, udp.c, var_route.c:
+
+ - (tcp.c, udp.c, var_route.c): Patch from Niels Baggesen:
+ - #ifdef checks on symbols and header movement.
+
+1998-04-20 16:05 hardaker
+
+ * agent/mibgroup/vacm_vars.c:
+
+ - (vacm_vars.c): Patch from Niels Baggesen:
+ - typecast a pointer.
+
+1998-04-20 16:05 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): Patch from Niels Baggesen:
+ - gethostbyaddr moves up.
+ - include sys/wait.h.
+ - syslog %d -> %ld for long specific_type.
+
+1998-04-20 16:03 hardaker
+
+ * apps/snmptable.c:
+
+ - (snmptable.c): Patch from Niels Baggesen:
+ - prototyping and other cleanups.
+
+1998-04-20 16:02 hardaker
+
+ * agent/mibgroup/ip.c:
+
+ - (ip.c): Patch from Niels Baggesen:
+ - test symbol defines and cleanup.
+
+1998-04-20 16:00 hardaker
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): Patch from Niels Baggesen:
+ - header moves.
+
+1998-04-20 16:00 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Patch from Niels Baggesen:
+ - appropriate use of strdup during startup and better flag checking.
+
+1998-04-20 15:59 hardaker
+
+ * agent/mibgroup/: hr_filesys.c, hr_swrun.c:
+
+ - (hr_filesys.c, hr_swrun.c): Patch from Niels Baggesen:
+ - fix some host resources for solaris.
+
+1998-04-20 15:56 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in): check for sys/dkio.h
+
+1998-04-20 15:54 hardaker
+
+ * agent/mibgroup/: host_res.h, hr_disk.c,
+ hr_filesys.c, hr_partition.c, hr_storage.c:
+
+ - (host_res.h, hr_disk.c, hr_filesys.c, hr_partition.c, hr_storage.c):
+ - Patch from Dave Shield:
+ - consolidate the system-specific stuff a bit (should make it easier
+ to follow)
+ - Re-structures the Disk searching, in such a way that it can set up
+ via the config file. (which I still need to do)
+ - Speed up disk searching (by caching invalid results - a *major* win!)
+ - Handle partitions sensibly (arther than one per disk)
+ - Improve Solaris support for the Device group
+
+1998-04-20 10:31 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): change oid from textual to numeric to allow now mibs to
+ be loaded.
+
+1998-04-01 16:35 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): always send enterprise and trapoid to scripts.
+
+1998-04-01 14:43 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.4.pre6 )
+
+1998-04-01 14:40 hardaker
+
+ * agent/: snmp_vars.c, snmp_vars.h:
+
+ - (snmp_vars.c, snmp_vars.h): make unregestering of mibs work.
+ - (in most cases:-?)
+
+1998-04-01 14:11 hardaker
+
+ * snmplib/Makefile.in, apps/Makefile.in,
+ agent/mibgroup/Makefile.in, agent/Makefile.in:
+
+ - (Makefile.in): make depend.
+
+1998-04-01 14:10 hardaker
+
+ * TODO:
+
+ - (TODO): removed a few things!
+
+1998-04-01 13:54 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): moved the view example section above the access section.
+
+1998-04-01 13:53 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): added vacm example configuration.
+
+1998-04-01 13:47 hardaker
+
+ * FAQ, README:
+
+ - (FAQ, README): more 3.4 updates.
+
+1998-04-01 13:31 hardaker
+
+ * NEWS, PORTING:
+
+ - (NEWS, PORTING): updates for 3.4.
+
+1998-04-01 13:27 hardaker
+
+ * agent/auto_nlist.c:
+
+ - (auto_nlist.c):
+ - remove no longer needed debugging statements of tree traversal.
+
+1998-04-01 09:52 hardaker
+
+ * snmplib/snmp_client.c:
+
+ - (snmp_client.c): enterprise_length is sizeof(oid) dependent.
+
+1998-03-27 16:43 hardaker
+
+ * agent/: snmp_vars.c, snmp_vars.h,
+ mibgroup/interfaces.c, mibgroup/ip.c,
+ mibgroup/registry.c:
+
+ - (snmp_vars.c, snmp_vars.h, interfaces.c, ip.c, registry.c):
+ - prototyping and -Wall fixes.
+
+1998-03-27 16:42 hardaker
+
+ * INSTALL:
+
+ - (INSTALL): document libwrap.
+
+1998-03-27 16:23 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/snmpd.c:
+
+ - (acconfig.h, config.h.in, configure, configure.in, snmpd.c):
+ - correctly #ifdef out the tcpwrappers patch.
+
+1998-03-27 16:23 hardaker
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): Interfaces_Scan_Next needed a 4th (NULL) argument.
+
+1998-03-27 16:10 hardaker
+
+ * README, config.h.in, configure,
+ configure.in, agent/snmpd.c:
+
+ - (README, config.h.in, configure, configure.in, snmpd.c): Patch from
+ Arthur Hyun:
+ - tcpwrappers support.
+
+1998-03-27 11:22 hardaker
+
+ * agent/mibgroup/hr_device.c:
+
+ - (hr_device.c): check device index against maximum (segfault on HPUX).
+
+1998-03-27 11:20 hardaker
+
+ * agent/mibgroup/disk.c:
+
+ - (disk.c): use config_pwarn() for missing disks.
+
+1998-03-27 11:20 hardaker
+
+ * agent/: read_config.c, read_config.h:
+
+ - (read_config.c, read_config.h):
+ - create config_pwarn() that doesn't increase the error count to
+ prevent exiting. Used for disks, since some might by process or
+ nfs mounted.
+
+1998-03-27 09:20 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c):
+ - Beta version of an extensible trap demon.
+ - -C 'command' on the command line runs the command and feeds it
+ stdin information about the trap.
+ - v1 traps are converted to v2 traps for consistancy of
+ information sent to the scripts.
+
+1998-03-26 07:22 hardaker
+
+ * config.h.in, configure, configure.in,
+ agent/auto_nlist.c, agent/auto_nlist.h,
+ agent/common_header.h, agent/kernel.c,
+ agent/read_config.c, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmpd.c,
+ agent/mibgroup/alarm.c, agent/mibgroup/at.c,
+ agent/mibgroup/context_vars.c, agent/mibgroup/disk.c,
+ agent/mibgroup/errormib.c, agent/mibgroup/event.c,
+ agent/mibgroup/extensible.c, agent/mibgroup/hr_device.c
+, agent/mibgroup/hr_network.c,
+ agent/mibgroup/hr_partition.c, agent/mibgroup/hr_storage.c
+, agent/mibgroup/hr_swinst.c, agent/mibgroup/hr_swrun.c
+, agent/mibgroup/icmp.c, agent/mibgroup/interfaces.c
+, agent/mibgroup/interfaces.h, agent/mibgroup/ip.c
+, agent/mibgroup/loadave.c, agent/mibgroup/memory.c
+, agent/mibgroup/party_vars.c, agent/mibgroup/pass.c
+, agent/mibgroup/proc.c, agent/mibgroup/smux.c,
+ agent/mibgroup/snmp_bgp.c, agent/mibgroup/snmp_ospf.c,
+ agent/mibgroup/snmp_rip2.c, agent/mibgroup/sysORTable.c
+, agent/mibgroup/tcp.c, agent/mibgroup/udp.c,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/vacm_vars.c
+, agent/mibgroup/var_route.c, agent/mibgroup/vmstat.c
+, apps/snmp_parse_args.c, apps/snmpbulkwalk.c,
+ apps/snmpdelta.c, apps/snmpget.c, apps/snmpgetnext.c
+, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c,
+ apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmpwalk.c, snmplib/asn1.c
+, snmplib/mib.c, snmplib/snmp_api.c,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/system.c, snmplib/vacm.c, snmplib/view.c
+:
+
+ - (*.c): Patch from Niels Baggesen:
+ - misc porting improvements (the bsd groups, sunos, ...).
+ - switch auto_nlists calling order of _ vs non _ lookups.
+ - reverse all string.h/strings.h include possibilities.
+
+1998-03-25 16:49 hardaker
+
+ * agent/mibgroup/hpux.c:
+
+ - (hpux.c): fix write_method declaration.
+
+1998-03-25 13:07 hardaker
+
+ * agent/mibgroup/: mibII.c, v2party.c, vacm_vars.c
+:
+
+ - (v2party.c, mibII.c, vacm_vars.c): declair registration variables staticly.
+
+1998-03-25 12:48 hardaker
+
+ * snmplib/: Makefile.in, int64.c, int64.h, mib.c
+:
+
+ - (Makefile.in, int64.c, int64.h, mib.c): Code from David T. Perkins:
+ - integrated David's code to print counter64s as integers rather than hex.
+
+1998-03-25 10:59 hardaker
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): Patch from Niels Baggesen:
+ - Add an & to arpcom.ac_enaddr in memset.
+
+1998-03-25 10:46 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in, linux.h): new define: DONT_USE_NLIST.
+
+1998-03-25 10:44 hardaker
+
+ * agent/snmpd.c, snmplib/snmp_api.c:
+
+ - (snmpd.c, snmp_api.c): Spelling errors from the CMU code fixed.
+
+1998-03-25 10:39 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): simply don't define CAN_USE_NLIST on linux.
+
+1998-03-25 10:39 hardaker
+
+ * agent/: read_config.c, read_config.h, snmp_vars.c
+, mibgroup/registry.c, mibgroup/registry.h:
+
+ - (read_config.c, read_config.h, snmp_vars.c, registry.c, registry.h):
+ - fix the registry mib to use the new module structure.
+ - create a working find_subtree() and find_subtree_next().
+
+1998-03-25 09:15 hardaker
+
+ * agent/mibgroup/tcp.c:
+
+ - (tcp.c): include tcpip.h for digital unix.
+
+1998-03-22 18:13 hardaker
+
+ * agent/mibgroup/: pass.c, proc.c, vacm_vars.c:
+
+ - (pass.c, proc.c, vacm_vars.c): Patch from Simon Burge:
+ - move sys/types.h up for ultrix.
+
+1998-03-18 14:09 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.4.pre5 )
+
+1998-03-18 13:56 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/read_config.c, agent/snmpd.c
+, apps/snmp_parse_args.c, apps/snmptrapd.c,
+ apps/snmpnetstat/main.c, man/mib_api.3,
+ win32/config.h:
+
+ - (acconfig.h, config.h.in, configure, configure.in, read_config.c,
+ snmpd.c, snmp_parse_args.c, snmptrapd.c, main.c, mib_api.3,
+ config.h):
+ - SNMPLIBPATH -> SNMPSHAREPATH
+ - a real SNMPLIBPATH
+ - make the agent read .conf files from SNMPSHAREPATH:SNMPLIBPATH.
+
+1998-03-18 13:26 hardaker
+
+ * agent/mibgroup/: extensible.c, memory.c, pass.c
+, proc.c, util_funcs.c, util_funcs.h:
+
+ - (extensible.c, memory.c, pass.c, proc.c, util_funcs.c, util_funcs.h):
+ - wait for pid after get_exec_output() with new wait_on_exec() function.
+
+1998-03-18 13:10 hardaker
+
+ * acconfig.h, config.h.in, sedscript.in,
+ mibs/UCD-SNMP-MIB.txt:
+
+ - (acconfig.h, config.h.in, sedscript.in, UCD-SNMP-MIB.txt):
+ - re-numbering of the new table modules.
+
+1998-03-18 09:17 hardaker
+
+ * ov/README:
+
+ - (README): changed OV path's to newer release paths.
+
+1998-03-11 17:05 hardaker
+
+ * agent/mibgroup/system.c:
+
+ - (system.c): don't chomp new line on read_config utils.
+
+1998-03-11 15:57 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (*/Makefile.in): depend update.
+
+1998-03-11 15:56 hardaker
+
+ * README:
+
+ - (README): name update.
+
+1998-03-11 15:42 hardaker
+
+ * agent/auto_nlist.c:
+
+ - (auto_nlist.c): better debugging printfs
+
+1998-03-11 14:40 hardaker
+
+ * agent/: read_config.c, read_config.h, snmp_agent.c
+, snmp_vars.c, snmpd.c, mibgroup/host_res.h
+, mibgroup/hr_device.c, mibgroup/hr_device.h,
+ mibgroup/hr_disk.c, mibgroup/hr_disk.h,
+ mibgroup/hr_filesys.c, mibgroup/hr_filesys.h,
+ mibgroup/hr_network.c, mibgroup/hr_network.h,
+ mibgroup/hr_other.c, mibgroup/hr_partition.c,
+ mibgroup/hr_partition.h, mibgroup/hr_print.c,
+ mibgroup/hr_print.h, mibgroup/hr_proc.c,
+ mibgroup/hr_proc.h, mibgroup/hr_storage.c,
+ mibgroup/hr_storage.h, mibgroup/hr_swinst.c,
+ mibgroup/hr_swinst.h, mibgroup/hr_swrun.c,
+ mibgroup/hr_swrun.h, mibgroup/hr_system.c,
+ mibgroup/hr_system.h, mibgroup/interfaces.c,
+ mibgroup/ip.c, mibgroup/mibII.c, mibgroup/mibII.h
+, mibgroup/sysORTable.c, mibgroup/v2party.c,
+ mibgroup/v2party.h, mibgroup/vacm_vars.c,
+ mibgroup/vacm_vars.h:
+
+ - (read_config.c, read_config.h, snmp_agent.c, snmp_vars.c, snmpd.c,
+ host_res.h, hr_device.c, hr_device.h, hr_disk.c, hr_disk.h,
+ hr_filesys.c, hr_filesys.h, hr_network.c, hr_network.h, hr_other.c,
+ hr_partition.c, hr_partition.h, hr_print.c, hr_print.h, hr_proc.c,
+ hr_proc.h, hr_storage.c, hr_storage.h, hr_swinst.c, hr_swinst.h,
+ hr_swrun.c, hr_swrun.h, hr_system.c, hr_system.h, interfaces.c,
+ ip.c, mibII.c, mibII.h, sysORTable.c, v2party.c, v2party.h,
+ vacm_vars.c, vacm_vars.h):
+ - massive prototyping and --Wall fixes.
+ - fixed things broken by the freebsd patch (only some I'm sure).
+
+1998-03-11 12:56 hardaker
+
+ * aclocal.m4, config.h.in, configure,
+ configure.in, agent/mibgroup/icmp.c,
+ agent/mibgroup/interfaces.c, agent/mibgroup/ip.c,
+ agent/mibgroup/tcp.c, agent/mibgroup/udp.c,
+ agent/mibgroup/var_route.c:
+
+ - (aclocal.m4, config.h.in, configure, configure.in, icmp.c,
+ interfaces.c, ip.c, tcp.c, udp.c, var_route.c): Patch from Garrett
+ Wollman:
+ - freebsd 3 sysctl implementations.
+
+1998-03-11 12:27 hardaker
+
+ * agent/mibgroup/: interfaces.c, tcp.c, udp.c,
+ var_route.c, var_route.h:
+
+ - (interfaces.c, tcp.c, udp.c, var_route.c, var_route.h): Patch from
+ Craig Bevins:
+ - port to OpenBSD.
+
+1998-03-11 10:30 hardaker
+
+ * agent/mibgroup/: sysORTable.c, sysORTable.h, system.c
+, system.h:
+
+ - (sysORTable.c, sysORTable.h, system.c, system.h):
+ - fix time values and move sysORLastChanged to the system group.
+
+1998-03-11 09:40 hardaker
+
+ * agent/mibgroup/: hpux.h, hr_filesys.h, memory.h
+, snmp_bgp.h, snmp_ospf.h, snmp_rip2.h,
+ sysORTable.h, vmstat.h:
+
+ - (hpux.h, hr_filesys.h, memory.h, snmp_bgp.h, snmp_ospf.h,
+ snmp_rip2.h, sysORTable.h, vmstat.h):
+ - finish converting a few of the files that Niels missed.
+
+1998-03-11 08:06 hardaker
+
+ * mibs/.index:
+
+ - (mibs/.index): update...
+
+1998-03-11 08:05 hardaker
+
+ * agent/auto_nlist.c, agent/common_header.h,
+ agent/snmp_agent.c, agent/snmpd.c,
+ agent/mibgroup/acl_vars.h, agent/mibgroup/alarm.c,
+ agent/mibgroup/alarm.h, agent/mibgroup/at.h,
+ agent/mibgroup/context_vars.h, agent/mibgroup/disk.h,
+ agent/mibgroup/errormib.h, agent/mibgroup/event.c,
+ agent/mibgroup/event.h, agent/mibgroup/example.h,
+ agent/mibgroup/extensible.c, agent/mibgroup/extensible.h
+, agent/mibgroup/hr_device.h, agent/mibgroup/hr_disk.h
+, agent/mibgroup/hr_filesys.h,
+ agent/mibgroup/hr_network.h, agent/mibgroup/hr_partition.h
+, agent/mibgroup/hr_print.h, agent/mibgroup/hr_proc.h
+, agent/mibgroup/hr_storage.h,
+ agent/mibgroup/hr_swinst.h, agent/mibgroup/hr_swrun.h,
+ agent/mibgroup/hr_system.h, agent/mibgroup/icmp.c,
+ agent/mibgroup/icmp.h, agent/mibgroup/interfaces.c,
+ agent/mibgroup/interfaces.h, agent/mibgroup/ip.c,
+ agent/mibgroup/ip.h, agent/mibgroup/loadave.h,
+ agent/mibgroup/party_vars.h, agent/mibgroup/pass.c,
+ agent/mibgroup/proc.c, agent/mibgroup/proc.h,
+ agent/mibgroup/registry.h, agent/mibgroup/snmp_mib.c,
+ agent/mibgroup/snmp_mib.h, agent/mibgroup/system.c,
+ agent/mibgroup/system.h, agent/mibgroup/tcp.c,
+ agent/mibgroup/tcp.h, agent/mibgroup/udp.c,
+ agent/mibgroup/udp.h, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/vacm_vars.c, agent/mibgroup/vacm_vars.h,
+ agent/mibgroup/versioninfo.c, agent/mibgroup/versioninfo.h
+, agent/mibgroup/view_vars.h, apps/snmpbulkwalk.c
+, apps/snmpdelta.c, apps/snmpget.c,
+ apps/snmpgetnext.c, apps/snmpset.c, apps/snmpstatus.c
+, apps/snmptable.c, apps/snmptest.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmpwalk.c
+, apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c
+, apps/snmpnetstat/route.c, snmplib/mib.c,
+ snmplib/snmp.c, snmplib/snmp.h, snmplib/snmp_api.c
+, snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_impl.h, man/Makefile.in:
+
+ - (*/*/*/*): Patch from Niels Baggesen:
+ - fix auto_nlist on preceeding _ architectures.
+ - Change *all* define usage to new SNMP_ and ASN_ prefixes.
+ - leave mib access open if no com2sec statements were found in snmpd.conf.
+
+1998-03-09 17:40 hardaker
+
+ * agent/mibgroup/: mibII.c, mibII.h, sysORTable.c
+, sysORTable.h, system.c, v2party.c,
+ vacm_vars.c, vacm_vars.h:
+
+ - (mibII.c, mibII.h, sysORTable.c, sysORTable.h, system.c, v2party.c,
+ vacm_vars.c, vacm_vars.h):
+ - implement sysORTable.
+ - register mibs under it.
+
+1998-03-06 15:48 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - remove security type prompts.
+
+1998-03-06 15:47 hardaker
+
+ * agent/mibgroup/host_res.h:
+
+ - (host_res.h): move snmp_api.h up above snmp_impl.h.
+
+1998-03-06 15:47 hardaker
+
+ * agent/mibgroup/mibII.h:
+
+ - (mibII.h): add vacm_vars.
+
+1998-03-06 15:47 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ - (util_funcs.c):
+ - remove GLOBAL-SECURITY checks.
+
+1998-03-06 14:01 hardaker
+
+ * Makefile.in, agent/kernel.c, agent/read_config.c
+, agent/read_config.h, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/snmpd.c,
+ agent/mibgroup/acl_vars.c, agent/mibgroup/alarm.c,
+ agent/mibgroup/context_vars.c, agent/mibgroup/disk.c,
+ agent/mibgroup/event.c, agent/mibgroup/extensible.c,
+ agent/mibgroup/icmp.c, agent/mibgroup/interfaces.c,
+ agent/mibgroup/ip.c, agent/mibgroup/mibincl.h,
+ agent/mibgroup/party_vars.c, agent/mibgroup/pass.c,
+ agent/mibgroup/proc.c, agent/mibgroup/registry.c,
+ agent/mibgroup/registry.h, agent/mibgroup/route_write.c
+, agent/mibgroup/snmp_mib.c, agent/mibgroup/system.c
+, agent/mibgroup/tcp.c, agent/mibgroup/udp.c,
+ agent/mibgroup/vacm_vars.c, agent/mibgroup/vacm_vars.h,
+ agent/mibgroup/var_route.c, agent/mibgroup/versioninfo.c
+, agent/mibgroup/view_vars.c, apps/snmp_parse_args.c
+, apps/snmpdelta.c, apps/snmpget.c,
+ apps/snmpgetnext.c, apps/snmpset.c, apps/snmpstatus.c
+, apps/snmptable.c, apps/snmptest.c,
+ apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/route.c,
+ man/snmpd.conf.5.def, man/snmptable.1, mibs/.index
+, mibs/Makefile.in, mibs/SNMP-FRAMEWORK-MIB.txt,
+ mibs/SNMP-MPD-MIB.txt, mibs/SNMP-NOTIFICATION-MIB.txt,
+ mibs/SNMP-PROXY-MIB.txt, mibs/SNMP-TARGET-MIB.txt,
+ mibs/SNMP-USER-BASED-SM-MIB.txt,
+ mibs/SNMP-VIEW-BASED-ACM-MIB.txt, snmplib/Makefile.in,
+ snmplib/acl.h, snmplib/acl_parse.c, snmplib/asn1.c
+, snmplib/context.h, snmplib/context_parse.c,
+ snmplib/mib.c, snmplib/party.h, snmplib/party_parse.c
+, snmplib/snmp.c, snmplib/snmp.h,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_impl.h,
+ snmplib/system.c, snmplib/vacm.c, snmplib/vacm.h
+, snmplib/view.c:
+
+ - (Makefile.in, kernel.c, read_config.c, read_config.h, snmp_agent.c,
+ snmp_vars.c, snmpd.c, acl_vars.c, alarm.c, context_vars.c, disk.c,
+ event.c, extensible.c, icmp.c, interfaces.c, ip.c, mibincl.h,
+ party_vars.c, pass.c, proc.c, registry.c, registry.h, route_write.c,
+ snmp_mib.c, system.c, tcp.c, udp.c, vacm_vars.c, vacm_vars.h,
+ var_route.c, versioninfo.c, view_vars.c, snmp_parse_args.c,
+ snmpdelta.c, snmpget.c, snmpgetnext.c, snmpset.c, snmpstatus.c,
+ snmptable.c, snmptest.c, snmptranslate.c, snmptrap.c, snmptrapd.c,
+ if.c, inet.c, route.c, snmpd.conf.5.def, snmptable.1, .index,
+ Makefile.in, SNMP-FRAMEWORK-MIB.txt, SNMP-MPD-MIB.txt,
+ SNMP-NOTIFICATION-MIB.txt, SNMP-PROXY-MIB.txt, SNMP-TARGET-MIB.txt,
+ SNMP-USER-BASED-SM-MIB.txt, SNMP-VIEW-BASED-ACM-MIB.txt,
+ Makefile.in, acl.h, acl_parse.c, asn1.c, context.h, context_parse.c,
+ mib.c, party.h, party_parse.c, snmp.c, snmp.h, snmp_api.c,
+ snmp_auth.c, snmp_client.c, snmp_impl.h, system.c, vacm.c, vacm.h,
+ view.c): Patch from Niels Baggesen:
+ - Implement the SNMPv3 View Based Access Control Model (RFC 2275).
+ - header fixes.
+ - better header-file #define names to include SNMP_, ASN_, etc. prefixes.
+
+1998-03-04 15:49 hardaker
+
+ * COPYING:
+
+ - (COPYING): documentation requirement change.
+
+1998-02-25 07:27 hardaker
+
+ * agent/: read_config.c, snmpd.c:
+
+ - (read_config.c, snmpd.c): Patch from Niels Baggesen:
+ - fix read_config parser's end of line problems.
+
+1998-02-20 11:15 hardaker
+
+ * apps/snmpnetstat/Makefile.in, snmplib/Makefile.in:
+
+ - (*/Makefile.in): fix make depend to look for and strip /usr/lib/*.
+
+1998-02-20 11:11 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in:
+
+ - (*/Makefile.in): fix make depend to look for and strip /usr/lib/*.
+
+1998-02-20 09:19 hardaker
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): Patch from Simon Leinen:
+ - fix include file dependancies on irix with _KERNEL defined.
+
+1998-02-18 16:51 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.4.pre4 )
+
+1998-02-18 16:33 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (*/Makefile.in): make depend.
+
+1998-02-18 16:33 hardaker
+
+ * config.h.in:
+
+ - (config.h.in): openbsd defines.
+
+1998-02-18 16:30 hardaker
+
+ * agent/mibgroup/: at.c, proc.c, tcp.c, udp.c
+, var_route.c:
+
+ - (at.c, proc.c, tcp.c, udp.c, var_route.c, bsd.h, bsdi.h, freebsd.h,
+ generic.h, hpux.h, netbsd.h):
+ - tried to merge some things into s/*.h defines instead. There is a
+ lot to go still.
+
+1998-02-18 16:29 hardaker
+
+ * acconfig.h, mibs/UCD-SNMP-MIB.txt:
+
+ - (acconfig.h, UCD-SNMP-MIB.txt):
+ - removed unneeded stuff.
+ - added openbsd.
+
+1998-02-18 14:32 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c, snmp_api.h): prototyping checks.
+
+1998-02-18 14:32 hardaker
+
+ * agent/: read_config.c, snmp_vars.c:
+
+ - (read_config.c, snmp_vars.c):
+ - prototyping and --Wall checks.
+
+1998-02-18 14:25 hardaker
+
+ * agent/mibgroup/: acl_vars.c, at.c, context_vars.c
+, disk.c, host_res.h, hr_disk.c,
+ hr_filesys.c, hr_storage.c, hr_swinst.c,
+ hr_swrun.c, hr_utils.c, icmp.c, interfaces.c
+, interfaces.h, ip.c, memory.c,
+ mibincl.h, party_vars.c, pass.c, proc.c,
+ registry.c, smux.c, snmp_mib.c, system.c
+, tcp.c, udp.c, var_route.c,
+ versioninfo.c, view_vars.c, vmstat.c:
+
+ - (acl_vars.c, at.c, context_vars.c, disk.c, host_res.h, hr_disk.c,
+ hr_filesys.c, hr_storage.c, hr_swinst.c, hr_swrun.c, hr_utils.c,
+ icmp.c, interfaces.c, interfaces.h, ip.c, memory.c, mibincl.h,
+ party_vars.c, pass.c, proc.c, registry.c, smux.c, snmp_mib.c,
+ system.c, tcp.c, udp.c, var_route.c, versioninfo.c, view_vars.c,
+ vmstat.c):
+ - massive -Wall and --strict-prototypes checking.
+ - bzero -> memset.
+
+1998-02-18 13:44 hardaker
+
+ * agent/mibgroup/: at.c, example.c, hpux.c,
+ hr_device.c, hr_disk.c, hr_filesys.c,
+ hr_network.c, hr_partition.c, hr_print.c,
+ hr_proc.c, hr_storage.c, hr_swinst.c,
+ hr_swrun.c, hr_system.c, icmp.c, interfaces.c
+, ip.c, pass.c, registry.c, smux.c
+, snmp_mib.c, system.c, tcp.c, udp.c
+, var_route.c, wombat.c:
+
+ - (at.c, example.c, hpux.c, hr_device.c, hr_disk.c, hr_filesys.c,
+ hr_network.c, hr_partition.c, hr_print.c, hr_proc.c, hr_storage.c,
+ hr_swinst.c, hr_swrun.c, hr_system.c, icmp.c, interfaces.c, ip.c,
+ pass.c, registry.c, smux.c, snmp_mib.c, system.c, tcp.c, udp.c,
+ var_route.c, wombat.c):
+ - all bcopys -> memcpy.
+ - include a few extra headers for DEBUGP statements.
+
+1998-02-18 13:34 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): authtrapsenable -> authtrapenable.
+
+1998-02-18 13:30 hardaker
+
+ * agent/mibgroup/disk.h, agent/mibgroup/extensible.h,
+ agent/mibgroup/loadave.h, agent/mibgroup/proc.h,
+ mibs/UCD-SNMP-MIB.txt:
+
+ - (disk.h, extensible.h, loadave.h, proc.h, UCD-SNMP-MIB.txt):
+ - turn these mibs into real tables. Required changing the mib though.
+
+1998-02-18 11:46 hardaker
+
+ * man/: snmpd.1.def, snmpd.conf.5.def:
+
+ - (snmpd.1.def, snmpd.conf.5.def): change to DATADIR from LIBDIR.
+
+1998-02-18 11:45 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in): define LIBDIR and DATADIR.
+
+1998-02-18 08:16 hardaker
+
+ * agent/mibgroup/: at.c, icmp.c, interfaces.c,
+ ip.c, tcp.c, udp.c:
+
+ - (at.c, icmp.c, interfaces.c, ip.c, tcp.c, udp.c, irix.h):
+ Patch from Simon Leinen:
+ - port to irix.
+
+1998-02-18 08:16 hardaker
+
+ * agent/auto_nlist.c:
+
+ - (auto_nlist.c): Patch from Simon Leinen:
+ - fix a debugging statement (missing a variable).
+
+1998-02-18 08:15 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in): Patch from Simon Leinen:
+ - check for sys/sysmp.h.
+
+1998-02-18 08:05 hardaker
+
+ * EXAMPLE.conf.def, mibs/UCD-SNMP-MIB.txt,
+ agent/mibgroup/ucd_snmp.h, agent/mibgroup/vmstat.c,
+ agent/mibgroup/vmstat.h:
+
+ - (EXAMPLE.conf.def, vmstat.c, vmstat.h, ucd_snmp.h,
+ UCD-SNMP-MIB.txt): Patch from Luuk de Boer:
+ - implment a vmstat mib group on linux.
+
+1998-02-17 09:54 hardaker
+
+ * agent/mibgroup/: tcp.c, udp.c:
+
+ - (tcp.c, udp.c):
+ - nlist symbol name errors.
+
+1998-02-17 09:53 hardaker
+
+ * agent/: auto_nlist.c, autonlist.h, snmp_vars.c
+:
+
+ - (auto_nlist.c, autonlist.h, snmp_vars.c):
+ - use appropriate mallocs, and NULL initialization of pointers.
+ - malloc the symbol rather than using a fixed length.
+ - insert debugging code.
+ - enable printing of the nlist tree if TESTING is defined.
+
+1998-02-17 09:50 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.c, snmp_api.h):
+ - use snmp_ipaddr instead of ipaddr to avoid hpux conflicts.
+
+1998-02-13 09:07 hardaker
+
+ * FAQ:
+
+ - (FAQ): typo: authtrapsenable -> authtrapenable.
+
+1998-02-11 16:44 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): sed doesn't like [a-z]+ type expressions.
+
+1998-02-11 09:28 hardaker
+
+ * agent/mibgroup/hr_network.c:
+
+ - (hr_network.c): Patch from Dave Shield:
+ - solaris fixes.
+
+1998-02-11 09:28 hardaker
+
+ * agent/mibgroup/host_res.h:
+
+ - (host_res.h): Patch from Dave Shield:
+ - don't include config.h
+
+1998-02-11 09:28 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in):
+ - ps aux should define aux not -aux.
+
+1998-02-11 09:19 hardaker
+
+ * agent/: mibgroup/at.c, mibgroup/hr_proc.c,
+ mibgroup/hr_storage.c, mibgroup/memory.c,
+ mibgroup/tcp.c, mibgroup/udp.c, mibgroup/var_route.c
+, auto_nlist.c:
+
+ - (generic.h, auto_nlist.c, at.c, hr_proc.c, hr_storage.c, memory.c,
+ tcp.c, udp.c, var_route.c): Patch from Dave Shield:
+ - fix all my typos ;-).
+ - create auto_nlist_value to return the looked-up value.
+
+1998-02-09 11:19 hardaker
+
+ * config.h.in, configure:
+
+ - (config.h.in, configure): check for ioctls.h.
+
+1998-02-09 11:18 hardaker
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): include ioctls.h if available.
+
+1998-02-09 11:18 hardaker
+
+ * configure.in:
+
+ - (configure.in): check for ioctls.h
+
+1998-02-09 11:17 hardaker
+
+ * sedscript.in, version.h, bug-report:
+
+ version tag ( 3.4.pre3 )
+
+1998-02-09 11:06 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Patch from Dave Shield:
+ - fix prototypes on my broken table walking routines.
+
+1998-02-09 11:03 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in):
+ - changed --with-shared-libraries to --enable-shared to match other pkgs.
+ - display arguments found for --enable-shared.
+
+1998-02-09 11:03 hardaker
+
+ * agent/auto_nlist.h:
+
+ - (auto_nlist.h): prototype wrapper.
+
+1998-02-09 11:03 hardaker
+
+ * agent/mibgroup/: at.c, disk.c, errormib.c,
+ extensible.c, hpux.c, hr_proc.c, hr_storage.c
+, hr_swrun.c, hr_system.c, icmp.c,
+ interfaces.c, ip.c, kernel_sunos5.c, loadave.c
+, memory.c, proc.c, tcp.c, udp.c,
+ var_route.c:
+
+ - (at.c, disk.c, errormib.c, extensible.c, hpux.c, hr_proc.c,
+ hr_storage.c, hr_swrun.c, hr_system.c, icmp.c, interfaces.c, ip.c,
+ kernel_sunos5.c, loadave.c, memory.c, proc.c, tcp.c, udp.c,
+ var_route.c):
+ - use auto_nlist.
+
+1998-02-06 17:10 hardaker
+
+ * Makefile.in, acconfig.h, config.h.in,
+ configure, configure.in, agent/Makefile.in,
+ agent/auto_nlist.c, agent/auto_nlist.h,
+ agent/autonlist.h, agent/kernel.c, agent/snmp_vars.c
+, agent/mibgroup/ip.c:
+
+ - (Makefile.in, acconfig.h, config.h.in, configure, configure.in,
+ auto_nlist.c, auto_nlist.h, autonlist.h, kernel.c, snmp_vars.c, ip.c):
+ - created a new auto_nlist function and use it in ip.c.
+
+1998-02-06 13:44 hardaker
+
+ * agent/mibgroup/hr_disk.c:
+
+ - (hr_disk.c): close() got caught inside an else it shouldn't have due
+ to an ifdef error.
+
+1998-02-06 13:29 hardaker
+
+ * agent/mibgroup/: at.c, icmp.c, interfaces.c,
+ ip.c, tcp.c, udp.c:
+
+ - (at.c, icmp.c, interfaces.c, ip.c, tcp.c, udp.c): protect against nlist.h
+
+1998-02-02 08:57 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): Patch from John Hawkinson:
+ - fix typo in configure for shared library extension w/o shared libraries.
+
+1998-01-30 15:25 hardaker
+
+ * apps/: snmp_parse_args.c, snmptrap.c:
+
+ - (snmp_parse_args.c, snmptrap.c): fix default port for snmptrap.
+
+1998-01-30 14:32 hardaker
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): finish linux problems and use if_speed.
+
+1998-01-30 14:31 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in): check for if_speed.
+
+1998-01-30 13:50 hardaker
+
+ * aclocal.m4, configure:
+
+ - (aclocal.m4, configure): define ifnet for linux.
+
+1998-01-30 13:49 hardaker
+
+ * README:
+
+ - (README): I can't really have forgotten Simon's name in the list
+ could I?
+
+1998-01-30 10:55 hardaker
+
+ * version.h, bug-report, sedscript.in:
+
+ version tag ( 3.4.pre2 )
+
+1998-01-30 10:49 hardaker
+
+ * agent/mibgroup/disk.c, agent/mibgroup/host_res.h,
+ agent/mibgroup/pass.c, agent/mibgroup/registry.c,
+ agent/mibgroup/snmp_mib.c, agent/mibgroup/system.c,
+ agent/mibgroup/versioninfo.c, snmplib/snmp_api.h:
+
+ - (disk.c, host_res.h, pass.c, registry.c, snmp_mib.c, system.c,
+ versioninfo.c, snmp_api.h):
+ - include netinet/in.h for address structure.
+
+1998-01-30 10:43 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): change module indexing to use oid instead of a numeric.
+
+1998-01-30 10:42 hardaker
+
+ * agent/mibgroup/: registry.c, registry.h:
+
+ - (registry.c, registry.h): begin munging for new hierarchy.
+
+1998-01-30 10:41 hardaker
+
+ * agent/: read_config.c, snmp_vars.c, snmp_vars.h
+, var_struct.h:
+
+ - (read_config.c, snmp_vars.c, snmp_vars.h, var_struct.h):
+ - merge Dave's code with mine. Still a few bugs to work through.
+
+1998-01-30 10:40 hardaker
+
+ * agent/mibgroup/pass.c:
+
+ - (pass.c): put pass_comapre here.
+
+1998-01-30 09:01 hardaker
+
+ * agent/mibgroup/memory.c, agent/mibgroup/memory.h,
+ mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt, memory.c, memory.h): Patch from Luuk de Boer:
+ - report cached, buffer, and shared statistics for linux.
+
+1998-01-30 08:57 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): test for 'ps aux' (redhat 5.0).
+
+1998-01-23 16:34 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt, agent/mibgroup/extensible.c,
+ agent/mibgroup/pass.c, agent/mibgroup/registry.c,
+ agent/mibgroup/registry.h, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/var_struct.h, configure
+, configure.in:
+
+ - (configure, configure.in, snmp_vars.c, snmp_vars.h, var_struct.h,
+ extensible.c, pass.c, registry.c, registry.h, UCD-SNMP-MIB.txt):
+ - make the mib registry record and display a mib module name as well.
+
+1998-01-23 16:15 hardaker
+
+ * agent/mibgroup/: at.c, disk.c, host_res.h,
+ hr_other.h, icmp.c, interfaces.c, ip.c,
+ snmp_mib.c, system.c, tcp.c, ucd_snmp.h,
+ udp.c, versioninfo.c:
+
+ - (at.c, disk.c, host_res.h, hr_other.h, icmp.c, interfaces.c, ip.c,
+ snmp_mib.c, system.c, tcp.c, ucd_snmp.h, udp.c, versioninfo.c):
+ - #include "snmp_api.h"
+
+1998-01-23 16:14 hardaker
+
+ * agent/mibgroup/registry.c, mibs/UCD-SNMP-MIB.txt,
+ agent/mibgroup/registry.h:
+
+ - (registry.[ch], UCD-SNMP-MIB.txt):
+ - create a new table at ucdavis.103 to display registered mibs.
+
+1998-01-23 16:11 hardaker
+
+ * agent/: mibgroup/extensible.c, read_config.c,
+ read_config.h, snmp_vars.c, snmp_vars.h,
+ mibgroup/pass.c:
+
+ - (read_config.c, read_config.h, snmp_vars.c, snmp_vars.h,
+ extensible.c, pass.c):
+ - create new functions:
+ - register_subtree()
+ - register_mib()
+ - unregister_mib().
+ - get rid of read_config special stuff for extensibility and put it
+ in their own submodules which now call register_mib().
+
+1998-01-23 08:30 hardaker
+
+ * agent/mibgroup/memory.c:
+
+ - (memory.c): Patch from Niels Baggesen:
+ - don't close file descriptor in linux's FILE_TO_BUF macro.
+
+1998-01-21 22:05 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - create m/ and s/ directories and use them for supplemental config
+ include files based on the config.guess output.
+
+1998-01-21 17:32 hardaker
+
+ * Makefile.top, configure, configure.in,
+ agent/Makefile.in, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in, snmplib/Makefile.in:
+
+ - (Makefile.top, configure, configure.in, */Makefile.in):
+ - Do a better version of shlib support. Should be useable now at least.
+
+1998-01-21 11:12 hardaker
+
+ * agent/mibgroup/: disk.c, errormib.c, extensible.c
+, interfaces.c, loadave.c, memory.c,
+ pass.c, proc.c, system.c, util_funcs.c,
+ var_route.c, versioninfo.c:
+
+ - (disk.c, errormib.c, extensible.c, interfaces.c, loadave.c,
+ memory.c, pass.c, proc.c, system.c, util_funcs.c, var_route.c,
+ versioninfo.c):
+ - include struct.h explicitly.
+
+1998-01-21 11:12 hardaker
+
+ * agent/: read_config.c, snmp_agent.c, snmp_vars.c
+, snmpd.c:
+
+ - (read_config.c, snmp_agent.c, snmp_vars.c, snmpd.c):
+ - include struct.h explicitly.
+
+1998-01-21 11:11 hardaker
+
+ * Makefile.in, Makefile.top, acconfig.h,
+ config.h.in, configure, configure.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ local/Makefile.in, man/Makefile.in,
+ snmplib/Makefile.in, agent/mibgroup/Makefile.in,
+ agent/Makefile.in:
+
+ - (*/Makefile.in, Makefile.top, acconfig.h, config.h.in, configure,
+ configure.in):
+ - begin support for creating and using shared libraries.
+ - all Makefiles now include a Makefile.top for easier future global changes.
+
+1998-01-21 11:08 hardaker
+
+ * COPYING:
+
+ - (COPYING): update.
+
+1998-01-16 09:44 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Patch from Sheshadri Yagati:
+ - signal a trap (2) when the agent is shut down.
+
+1998-01-12 09:56 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - (kernel_sunos5.c): Patch from Niels Baggesen:
+ - increase buffer size to increase max interfaces reported on Solaris.
+
+1998-01-12 09:51 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Undid anon-children change.
+
+1998-01-12 09:44 hardaker
+
+ * snmplib/: asn1.c, mib.c, snmp_api.h,
+ snmp_impl.h, system.h:
+
+ - (asn1.c, mib.c, snmp_api.h, snmp_impl.h, system.h): Patch from Niels
+ Baggesen:
+ - header changes and boolean check corrections.
+
+1998-01-12 09:41 hardaker
+
+ * agent/: read_config.c, snmp_vars.c, snmpd.c
+:
+
+ - (read_config.c, snmp_vars.c, snmpd.c): Patch from Niels Baggesen:
+ - header fixes.
+ - snmp_perror usage.
+
+1998-01-12 09:40 hardaker
+
+ * FAQ, INSTALL, Makefile.in:
+
+ - (FAQ, INSTALL, Makefile.in): Patch from Niels Baggesen:
+ - Documentation update to fix paths from recent changes.
+
+1998-01-12 09:21 hardaker
+
+ * agent/mibgroup/: alarm.c, at.c, context_vars.c
+, event.c, hr_device.c, hr_filesys.c,
+ hr_partition.c, hr_storage.c, hr_swinst.c,
+ hr_swrun.c, icmp.c, interfaces.c, ip.c,
+ proc.c, system.c, tcp.c, udp.c,
+ var_route.c:
+
+ - (alarm.c, at.c, context_vars.c, event.c, hr_device.c, hr_filesys.c,
+ hr_partition.c, hr_storage.c, hr_swinst.c, hr_swrun.c, icmp.c,
+ interfaces.c, ip.c, proc.c, system.c, tcp.c, udp.c, var_route.c):
+ Patch from Niels Baggesen:
+ - Fix headers for FreeBSD and NetBSD.
+
+1998-01-12 09:19 hardaker
+
+ * apps/: Makefile.in, snmpbulkwalk.c, snmpdelta.c
+, snmpget.c, snmpgetnext.c, snmpset.c,
+ snmpstatus.c, snmptable.c, snmptest.c,
+ snmptrap.c, snmptrapd.c, snmpwalk.c:
+
+ - (Makefile.in, snmpbulkwalk.c, snmpdelta.c, snmpget.c, snmpgetnext.c,
+ snmpset.c, snmpstatus.c, snmptable.c, snmptest.c, snmptrap.c,
+ snmptrapd.c, snmpwalk.c): Patch from Niels Baggesen:
+ - remove unused headers.
+ - snmp_perror changes.
+
+1998-01-12 09:19 hardaker
+
+ * apps/snmpnetstat/Makefile.in:
+
+ - (Makefile.in): Patch from Niels Baggesen: link directly to lib.
+
+1998-01-12 09:18 hardaker
+
+ * man/: mib_api.3, snmp_api.3:
+
+ - (mib_api.3, snmp_api.3): Patch from Niels Baggesen:
+ - doc update to reflect moved headers.
+
+1998-01-12 09:14 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Dave Shield: fix anon_children invalid memory access.
+
+1998-01-05 17:33 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): swap args to merge_anon_children().
+
+1998-01-05 16:29 hardaker
+
+ * snmplib/asn1.c:
+
+ - (asn1.c): Patch from Niels Baggesen:
+ - fix asn1_build_objid.
+
+1998-01-05 13:28 hardaker
+
+ * TODO:
+
+ - (TODO): snmpv3
+
+1998-01-05 13:28 hardaker
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c): put init_mib back in place (opps).
+
+1998-01-05 13:28 hardaker
+
+ * snmplib/: mib.c, parse.c, parse.h:
+
+ - (mib.c, parse.c, parse.h): add a find_module() routine.
+
+1998-01-05 13:27 hardaker
+
+ * man/mib_api.3:
+
+ - (mib_api.3): change "all" to "ALL".
+
+1997-12-30 17:01 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): Create a graphing widget.
+
+1997-12-30 14:00 hardaker
+
+ * local/tkmib:
+
+ - (tkmib):
+ - new command: table to display snmptables as a table.
+ - misc...
+
+1997-12-29 09:37 hardaker
+
+ * local/tkmib:
+
+ - (tkmib): First implementation.
+
+1997-12-23 16:30 hardaker
+
+ * version.h, sedscript.in, bug-report:
+
+ version tag ( 3.4.pre1 )
+
+1997-12-23 15:59 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): Create a mib variable to set/report if debugging
+ is on or off.
+
+1997-12-23 15:56 hardaker
+
+ * agent/mibgroup/: versioninfo.c, versioninfo.h:
+
+ - (versioninfo.c, versioninfo.h): Create a mib variable to set/report
+ if debugging is on or off.
+
+1997-12-23 15:27 hardaker
+
+ * agent/: mibgroup/at.c, mibgroup/at.h,
+ mibgroup/host_res.h, mibgroup/icmp.h,
+ mibgroup/interfaces.c, mibgroup/interfaces.h,
+ mibgroup/ip.h, mibgroup/tcp.c, mibgroup/tcp.h,
+ mibgroup/udp.c, mibgroup/udp.h, read_config.c,
+ snmp_vars.c:
+
+ - (at.c, at.h, host_res.h, icmp.h, interfaces.c, interfaces.h, ip.h,
+ tcp.c, tcp.h, udp.c, udp.h, read_config.c, snmp_vars.c):
+ - clean up required headers for linux.
+
+1997-12-23 14:46 hardaker
+
+ * agent/: mibgroup/at.c, mibgroup/icmp.c,
+ mibgroup/interfaces.c, mibgroup/ip.c,
+ mibgroup/snmp_mib.c, mibgroup/system.c, mibgroup/tcp.c
+, mibgroup/udp.c, read_config.c, snmp_vars.c
+:
+
+ - (at.c, icmp.c, interfaces.c, ip.c, snmp_mib.c, system.c, tcp.c, udp.c):
+ - Patch from Dave Shield to break up common_header.h.
+
+1997-12-23 14:44 hardaker
+
+ * man/: snmpd.1.def, snmptrapd.8:
+
+ - (snmpd.1.def, snmptrapd.8): debugging flag additions.
+
+1997-12-23 14:42 hardaker
+
+ * acconfig.h, config.h.in, agent/snmp_vars.c,
+ agent/snmpd.c, agent/mibgroup/at.c,
+ agent/mibgroup/disk.c, agent/mibgroup/example.c,
+ agent/mibgroup/hpux.c, agent/mibgroup/hr_device.c,
+ agent/mibgroup/hr_disk.c, agent/mibgroup/hr_filesys.c,
+ agent/mibgroup/hr_network.c, agent/mibgroup/hr_partition.c
+, agent/mibgroup/hr_print.c, agent/mibgroup/hr_proc.c
+, agent/mibgroup/hr_storage.c,
+ agent/mibgroup/hr_swinst.c, agent/mibgroup/hr_swrun.c,
+ agent/mibgroup/hr_system.c, agent/mibgroup/icmp.c,
+ agent/mibgroup/interfaces.c, agent/mibgroup/ip.c,
+ agent/mibgroup/kernel_sunos5.c, agent/mibgroup/pass.c,
+ agent/mibgroup/proc.c, agent/mibgroup/smux.c,
+ agent/mibgroup/snmp_bgp.c, agent/mibgroup/snmp_mib.c,
+ agent/mibgroup/snmp_ospf.c, agent/mibgroup/snmp_rip2.c,
+ agent/mibgroup/system.c, agent/mibgroup/tcp.c,
+ agent/mibgroup/udp.c, agent/mibgroup/wombat.c,
+ apps/snmp_parse_args.c, apps/snmpbulkwalk.c,
+ apps/snmpdelta.c, apps/snmpget.c, apps/snmpgetnext.c
+, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptest.c,
+ apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmpwalk.c,
+ apps/snmpnetstat/if.c, apps/snmpnetstat/main.c,
+ snmplib/parse.c, snmplib/snmp_impl.h,
+ snmplib/system.c, snmplib/system.h:
+
+ - (*): Turn all debugging routines into library calls that can be
+ turned on and off at run time.
+ - DEBUGP() is now a typical printf style function and is used everywhere.
+ - void snmp_set_do_debugging(int).
+ - int snmp_get_do_debugging().
+
+1997-12-23 14:40 hardaker
+
+ * README:
+
+ - (README): Add Ted Rule to coders list.
+
+1997-12-23 12:48 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c):
+ - Change -f flag to -l and make -f no-fork.
+ - fix patch which munged ability to generate both -P and -s simultaneously.
+
+1997-12-23 12:32 hardaker
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): Patch from Ted Rule:
+ - Use syslog option LOG_PID on startup.
+ - fork if syslog enabled.
+ - Enable logging to other syslog facilities.
+ - print all trap data to a single syslog line.
+
+1997-12-23 11:46 hardaker
+
+ * agent/mibgroup/hpux.c:
+
+ - (hpux.c): #ifdef'ed out unused writeHP function.
+
+1997-12-23 11:42 hardaker
+
+ * snmplib/system.c:
+
+ - (snmplib/system.c): Patch from Johannes Grosen:
+ - fix non-existent nlist.h problems under linux redhat 5.0.
+
+1997-12-23 11:42 hardaker
+
+ * apps/snmptrap.c:
+
+ - (snmptrap.c): Patch from Johannes Grosen:
+ - fix non-existent nlist.h problems under linux redhat 5.0.
+
+1997-12-23 11:42 hardaker
+
+ * agent/: mibgroup/disk.c, mibgroup/errormib.c,
+ mibgroup/extensible.c, mibgroup/hr_filesys.c,
+ mibgroup/hr_proc.c, mibgroup/hr_storage.c,
+ mibgroup/hr_swrun.c, mibgroup/hr_system.c,
+ mibgroup/loadave.c, mibgroup/memory.c,
+ common_header.h:
+
+ - (mibgroup/*.c, common_header.h): Patch from Johannes Grosen:
+ - fix non-existent nlist.h problems under linux redhat 5.0.
+
+1997-12-23 11:41 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config.h.in, configure, configure.in): Patch from Johannes Grosen:
+ - fix non-existent nlist.h problems under linux redhat 5.0.
+
+1997-12-23 11:35 hardaker
+
+ * acconfig.h, config.h.in, sedscript.in:
+
+ - (acconfig.h, config.h.in, sedscript.in): BSDI definition fixes.
+
+1997-12-23 11:33 hardaker
+
+ * agent/mibgroup/hr_filesys.c:
+
+ - (hr_filesys.c): Solaris specific fixes.
+
+1997-12-23 11:20 hardaker
+
+ * agent/mibgroup/hr_swrun.c:
+
+ - (hr_swrun.c): Correct a non-casted malloc.
+
+1997-12-15 15:07 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (UCD-fields, oid_to_sym.in, oid_to_type.in, snmp_parse_args.c, acconfig.h):
+ - Patch from TANAKA Takashi:
+ - support more OS types in the ov/ directory files.
+ - mistake: bsdi was getting defined as irix.
+ - don't core dump on -v without any arguments.
+
+1997-12-15 15:07 hardaker
+
+ * ov/: UCD-fields, oid_to_sym.in, oid_to_type.in:
+
+ - (UCD-fields, oid_to_sym.in, oid_to_type.in): Patch from TANAKA Takashi:
+ - support more OS types in the ov/ directory files.
+ - mistake: bsdi was getting defined as irix.
+ - don't core dump on -v without any arguments.
+
+1997-12-15 11:14 hardaker
+
+ * agent/: mibgroup/at.c, mibgroup/example.c,
+ mibgroup/hr_proc.c, mibgroup/hr_storage.c,
+ mibgroup/hr_swrun.c, mibgroup/hr_system.c,
+ mibgroup/icmp.c, mibgroup/interfaces.c,
+ mibgroup/interfaces.h, mibgroup/ip.c,
+ mibgroup/loadave.c, mibgroup/memory.c,
+ mibgroup/route_write.c, mibgroup/tcp.c, mibgroup/udp.c
+, mibgroup/var_route.c, mibgroup/wombat.c,
+ common_header.h:
+
+ - (at.c, example.c, hr_proc.c, hr_storage.c, hr_swrun.c, hr_system.c,
+ icmp.c, interfaces.c, interfaces.h, ip.c, loadave.c, memory.c,
+ route_write.c, tcp.c, udp.c, var_route.c, wombat.c, common_header.h):
+ - Patch from Simon Leinen to improve irix 6.2 support.
+
+1997-12-15 11:08 hardaker
+
+ * agent/mibgroup/: host.h, ucd_snmp.h, v2party.h:
+
+ - (host.h, ucd_snmp.h, v2party.h):
+ - use config_add_mib().
+
+1997-12-15 11:08 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - new macro to change default MIBS when modules are compiled:
+ config_add_mib().
+
+1997-12-05 14:30 hardaker
+
+ * configure, configure.in:
+
+ - (configure, configure.in): warn instead of error for config_require macro's.
+
+1997-12-05 11:58 hardaker
+
+ * apps/: snmp_parse_args.c, snmp_parse_args.h,
+ snmpbulkwalk.c, snmpdelta.c, snmpget.c,
+ snmpgetnext.c, snmpset.c, snmptable.c,
+ snmptest.c, snmptrap.c, snmpwalk.c:
+
+ - (apps/*.c): support random access requests on all apps via -R switch.
+
+1997-12-05 08:46 hardaker
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): Patch from Niels Baggesen:
+ - make trap variables long's not ints for 64bit machines to match
+ asn_build_int functions.
+
+1997-12-01 12:44 hardaker
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ - (*): 3.3.1 branch merged into main development branch.
+
+1997-12-01 12:39 hardaker
+
+ * apps/snmptable.c, apps/snmptrapd.c, man/snmp_api.3
+, mibs/RFC1271-MIB.txt, snmplib/Makefile.in,
+ snmplib/mib.c, snmplib/mib.h, snmplib/snmp.h,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_client.c:
+
+ - (*): 3.3.1 branch merged into main development branch.
+
+1997-12-01 12:32 hardaker
+
+ * FAQ, INSTALL, NEWS, README,
+ acconfig.h, bug-report, config.h.in, configure
+, configure.in, sedscript.in, version.h
+, agent/mibgroup/hr_disk.c, agent/mibgroup/hr_filesys.c
+, agent/mibgroup/hr_storage.c, agent/mibgroup/hr_swrun.c
+, agent/mibgroup/hr_utils.c, agent/mibgroup/proc.c
+, agent/mibgroup/smux.c:
+
+ - (*): 3.3.1 branch merged into main development branch.
+
+1997-11-17 08:10 hardaker
+
+ * agent/mibgroup/: party_vars.c (Ext-3-3-patches.1), party_vars.c
+:
+
+ - (party_vars.c): use strings.h define not string.h.
+
+1997-11-14 12:36 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.3 )
+
+1997-11-14 12:36 hardaker
+
+ * ChangeLog:
+
+ - (ChangeLog): version update.
+
+1997-11-14 12:35 hardaker
+
+ * FAQ, NEWS, README:
+
+ - (FAQ, NEWS, README): last documentation updates.
+
+1997-11-14 12:21 hardaker
+
+ * agent/mibgroup/wombat.c:
+
+ - (wombat.c): quick doc change.
+
+1997-11-14 08:32 hardaker
+
+ * README:
+
+ - (README): coder list update.
+
+1997-11-14 08:31 hardaker
+
+ * agent/mibgroup/wombat.c:
+
+ - (wombat.c): code comments from Alan Batie.
+
+1997-11-12 20:47 hardaker
+
+ * agent/: mibgroup/var_route.c, read_config.c:
+
+ - (var_route.c, read_config.c): STDC typos.
+
+1997-11-12 20:43 hardaker
+
+ * agent/: read_config.c, mibgroup/var_route.c:
+
+ - (var_route.c, read_config.c): fix qsort params for STDC.
+
+1997-11-12 20:35 hardaker
+
+ * agent/mibgroup/var_route.c, agent/read_config.c,
+ snmplib/acl_parse.c, snmplib/context_parse.c,
+ snmplib/party_parse.c, snmplib/snmp_auth.c:
+
+ - (var_route.c, read_config.c, snmpdelta.c): Patch from David Zimmerman:
+ - Fixes for AIX.
+
+1997-11-12 20:35 hardaker
+
+ * apps/snmpdelta.c:
+
+ - (): Patch from David Zimmerman:
+ - Fixes for AIX.
+
+1997-11-12 20:27 hardaker
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ - (win32/libsnmp_dll/libsnmp.def): Patch from Joe Marzot: function changes.
+
+1997-11-12 16:05 hardaker
+
+ * sedscript.in, version.h, bug-report:
+
+ version tag ( 3.3.pre11 )
+
+1997-11-12 15:41 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (*/Makefile.in): make depend.
+
+1997-11-12 15:21 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): include STDC_HEADERS for AIX.
+
+1997-11-12 15:16 hardaker
+
+ * agent/mibgroup/party_vars.c:
+
+ - (party_vars.c): include STDC_HEADERS for AIX.
+
+1997-11-12 15:10 hardaker
+
+ * snmplib/system.h:
+
+ - (system.h): Don't include config.h!
+
+1997-11-12 11:49 hardaker
+
+ * apps/.cvsignore:
+
+ - (apps/.cvsignore): added snmptable.
+
+1997-11-12 10:44 hardaker
+
+ * NEWS:
+
+ - (NEWS): doc update.
+
+1997-11-12 10:38 hardaker
+
+ * snmplib/: parse.c, parse.h, snmp_api.c,
+ snmp_client.c:
+
+ - (parse.c, parse.h): Patch from Niels Baggesen:
+ - parser improvements.
+ - parser directory caching.
+ - save_descriptions/mib_warnings set functions.
+
+1997-11-12 10:33 hardaker
+
+ * man/: snmpdelta.1, snmptable.1, snmptrapd.8:
+
+ - (man/snmpdelta.1,snmptable.1,snmptrapd.8): Patch from Niels Baggesen:
+ - documentation changes and additions.
+
+1997-11-12 10:32 hardaker
+
+ * apps/snmpnetstat/main.c:
+
+ - (snmpnetstat/main.c): Patch from Niels Baggesen:
+ - snmpv2c support and argument parsing changes.
+
+1997-11-12 10:30 hardaker
+
+ * apps/: snmp_parse_args.c, snmpdelta.c, snmpgetnext.c
+, snmptable.c, snmptest.c, snmptranslate.c
+, snmptrap.c, snmptrapd.c:
+
+ - (apps/*.c): Patch from Niels Baggesen:
+ - various (remove unneeded vars, etc).
+ - add snmptable.
+ - make snmptrapd multi-lingual.
+
+1997-11-12 10:29 hardaker
+
+ * apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ man/Makefile.in:
+
+ - (Makefile.in): Patch from Niels Baggesen:
+ - add @datadir@ to files that needed it.
+
+1997-11-12 10:28 hardaker
+
+ * agent/mibgroup/party_vars.c:
+
+ - (party_vars.c): Patch from Niels Baggesen:
+ - include netinet/in.h if available.
+
+1997-11-12 10:27 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - (kernel_sunos5.c): Patch from Niels Baggesen:
+ - solaris patches.
+
+1997-11-12 10:27 hardaker
+
+ * agent/Makefile.in:
+
+ - (*/Makefile.in): Patch from Niels Baggesen:
+ - add @datadir@ to files that needed it.
+
+1997-11-12 10:25 hardaker
+
+ * NEWS, TODO:
+
+ - (NEWS, TODO): Patch from Niels Baggesen:
+ - doc update.
+
+1997-11-12 09:18 hardaker
+
+ * agent/mibgroup/hr_swrun.c:
+
+ - (hr_swrun.c): Patch from Dave Shield for linux/hpux10 problems.
+
+1997-11-12 09:17 hardaker
+
+ * man/mib_api.3:
+
+ - (mib_api.3): Doc update from Dave Shield.
+
+1997-11-12 09:17 hardaker
+
+ * FAQ:
+
+ - (FAQ): Doc update from Dave Shield.
+
+1997-11-12 08:26 hardaker
+
+ * snmplib/snmp_client.c:
+
+ - (snmp_client.c): Patch from Joe Marzot:
+ - Free a pdu in a spot that should technically never be needed, but
+ is nice for people reading the code.
+
+1997-11-12 07:42 hardaker
+
+ * apps/snmptranslate.c:
+
+ - (snmptranslate.c): Patch from Joe Marzot: W32 specific fixes.
+
+1997-11-07 16:38 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.3.pre10 )
+
+1997-11-07 16:37 hardaker
+
+ * NEWS, README, TODO:
+
+ - (NEWS, README, TODO): Documentation updates.
+
+1997-11-07 16:14 hardaker
+
+ * configure, configure.in, configure,
+ configure.in:
+
+ - (configure.in): watch out for /usr/ucb/cc on solaris and don't use it.
+
+1997-11-07 15:28 hardaker
+
+ * acconfig.h, config.h.in, apps/snmpgetnext.c,
+ snmplib/parse.c, snmplib/parse.h,
+ snmplib/snmp_client.c, win32/config.h, win32/win32.opt
+, win32/libsnmp/libsnmp.plg,
+ win32/libsnmp_dll/libsnmp.def,
+ win32/libsnmp_dll/libsnmp_dll.dsp,
+ win32/libsnmp_dll/libsnmp_dll.plg,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp,
+ win32/snmpbulkwalk/snmpbulkwalk.plg,
+ win32/snmpget/snmpget.dsp, win32/snmpget/snmpget.plg,
+ win32/snmpgetnext/snmpgetnext.dsp,
+ win32/snmpgetnext/snmpgetnext.plg, win32/snmpset/snmpset.dsp
+, win32/snmpset/snmpset.plg,
+ win32/snmpstatus/snmpstatus.dsp,
+ win32/snmpstatus/snmpstatus.plg,
+ win32/snmptranslate/snmptranslate.dsp,
+ win32/snmptranslate/snmptranslate.plg,
+ win32/snmpwalk/snmpwalk.dsp, win32/snmpwalk/snmpwalk.plg
+:
+
+ - (*): merge to main branch: patches from Joe Marzot.
+
+1997-11-07 13:38 hardaker
+
+ * apps/snmpwalk.c:
+
+ - (snmpwalk.c): stop on no response from host.
+
+1997-11-07 13:37 hardaker
+
+ * agent/mibgroup/hr_network.c:
+
+ - (hr_network.c): don't pass char ** to interfaces_scan_next().
+
+1997-11-07 13:37 hardaker
+
+ * agent/: read_config.c, snmp_agent.c, snmpd.c:
+
+ - (read_config.c, snmp_agent.c, snmpd.c): USING.*_MIB_MODULE -> USING.*_MODULE.
+
+1997-11-07 12:28 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - (kernel_sunos5.c): patch from Niels for solaris >2.6.
+
+1997-11-07 12:25 hardaker
+
+ * agent/mibgroup/hr_swrun.c:
+
+ - (hr_swrun.c): don't print a variable that doesn't exist under linux.
+
+1997-11-07 12:24 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (configure.in): check for linux/hdreg.h
+
+1997-11-05 15:29 hardaker
+
+ * sedscript.in, version.h, bug-report:
+
+ version tag ( 3.3.pre9 )
+
+1997-11-05 14:40 hardaker
+
+ * agent/mibgroup/memory.c:
+
+ - (memory.c): protect vmmeter.h from multiple inclusions on netbsd.
+
+1997-11-05 13:59 hardaker
+
+ * Makefile.in, agent/Makefile.in,
+ agent/mibgroup/kernel_sunos5.c, snmplib/mib.c:
+
+ - (Makefile.in, kernel_sunos5.c, mib.c): Patch from Niels Baggesen:
+ - octet counters for solaris.
+ - Makefile.in patches.
+
+1997-11-05 13:56 hardaker
+
+ * agent/mibgroup/: at.c, icmp.c, interfaces.c,
+ ip.c, tcp.c, udp.c:
+
+ - (at.c, icmp.c, interfaces.c, ip.c, tcp.c, udp.c):
+ - #include "mib_module_config.h"
+
+1997-11-05 13:51 hardaker
+
+ * agent/: snmp_agent.c, snmp_vars.c, snmpd.c,
+ mibgroup/disk.c, mibgroup/proc.c,
+ mibgroup/util_funcs.c:
+
+ - (snmp_agent.c, snmp_vars.c, snmpd.c, disk.c, proc.c, util_funcs.c):
+ - #include "mib_module_config.h".
+
+1997-11-05 13:48 hardaker
+
+ * agent/: common_header.h, mibgroup/hr_disk.c,
+ mibgroup/hr_filesys.c, mibgroup/hr_swrun.c,
+ mibgroup/hr_utils.c, mibgroup/var_route.c:
+
+ - (*): merge from Dave's pre6 patches.
+
+1997-11-05 13:42 hardaker
+
+ * apps/Makefile.in:
+
+ - (apps/Makefile.in): put snmptrapd in @sbindir@
+
+1997-11-04 12:47 hardaker
+
+ * configure, configure.in:
+
+ - (configure.in):
+ - Check for $prefix being defined as NONE for other vars.
+
+1997-11-04 12:47 hardaker
+
+ * agent/read_config.c:
+
+ - (read_config.c):
+ - #include mib_module_config.h
+ - USING_EXTENSIBLE_MIB_MODULE -> USING_EXTENSIBLE_MIB_MODULE
+
+1997-10-29 14:00 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.3.pre8 )
+
+1997-10-29 12:58 hardaker
+
+ * agent/mibgroup/host_res.h:
+
+ - (host_res.h): don't include config.h twice.
+
+1997-10-29 12:57 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (config*): check and include sys/cdefs.h in config.h.
+
+1997-10-29 12:42 hardaker
+
+ * acconfig.h, configure.in, agent/common_header.h
+, agent/kernel.c, agent/kernel.h,
+ agent/read_config.c, agent/read_config.h,
+ agent/snmp_agent.c, agent/snmp_agent.h,
+ agent/snmp_vars.c, agent/snmp_vars.h, agent/snmpd.c
+, agent/snmpd.h, agent/var_struct.h,
+ agent/view_parse.c, agent/mibgroup/acl_vars.c,
+ agent/mibgroup/acl_vars.h, agent/mibgroup/alarm.c,
+ agent/mibgroup/alarm.h, agent/mibgroup/at.c,
+ agent/mibgroup/at.h, agent/mibgroup/context_vars.c,
+ agent/mibgroup/context_vars.h, agent/mibgroup/disk.c,
+ agent/mibgroup/disk.h, agent/mibgroup/errormib.c,
+ agent/mibgroup/errormib.h, agent/mibgroup/event.c,
+ agent/mibgroup/event.h, agent/mibgroup/example.c,
+ agent/mibgroup/example.h, agent/mibgroup/extensible.c,
+ agent/mibgroup/extensible.h, agent/mibgroup/hpux.h,
+ agent/mibgroup/hr_device.c, agent/mibgroup/hr_filesys.c
+, agent/mibgroup/hr_storage.c, agent/mibgroup/hr_utils.h
+, agent/mibgroup/icmp.c, agent/mibgroup/icmp.h,
+ agent/mibgroup/interfaces.c, agent/mibgroup/interfaces.h
+, agent/mibgroup/ip.c, agent/mibgroup/ip.h,
+ agent/mibgroup/loadave.c, agent/mibgroup/loadave.h,
+ agent/mibgroup/memory.c, agent/mibgroup/memory.h,
+ agent/mibgroup/party_vars.c, agent/mibgroup/party_vars.h
+, agent/mibgroup/pass.c, agent/mibgroup/pass.h,
+ agent/mibgroup/proc.c, agent/mibgroup/proc.h,
+ agent/mibgroup/route_write.h, agent/mibgroup/smux.c,
+ agent/mibgroup/smux.h, agent/mibgroup/snmp_mib.c,
+ agent/mibgroup/snmp_mib.h, agent/mibgroup/system.c,
+ agent/mibgroup/system.h, agent/mibgroup/tcp.c,
+ agent/mibgroup/tcp.h, agent/mibgroup/udp.c,
+ agent/mibgroup/udp.h, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/util_funcs.h, agent/mibgroup/var_route.c
+, agent/mibgroup/var_route.h,
+ agent/mibgroup/versioninfo.c, agent/mibgroup/versioninfo.h
+, agent/mibgroup/view_vars.c, agent/mibgroup/view_vars.h
+, agent/mibgroup/wombat.c, agent/mibgroup/wombat.h
+, apps/.cvsignore, apps/snmp_parse_args.c,
+ apps/snmp_parse_args.h, apps/snmpbulkwalk.c,
+ apps/snmpdelta.c, apps/snmpget.c, apps/snmpgetnext.c
+, apps/snmpset.c, apps/snmpstatus.c,
+ apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmpwalk.c
+, apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c
+, apps/snmpnetstat/main.c, apps/snmpnetstat/netstat.h
+, apps/snmpnetstat/route.c, snmplib/acl.c,
+ snmplib/acl.h, snmplib/acl_parse.c, snmplib/asn1.h
+, snmplib/context.c, snmplib/context.h,
+ snmplib/context_parse.c, snmplib/md5.c, snmplib/md5.h
+, snmplib/mib.c, snmplib/mib.h, snmplib/parse.c
+, snmplib/parse.h, snmplib/party.h,
+ snmplib/party_parse.c, snmplib/snmp.h,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_client.h, snmplib/snmp_impl.h,
+ snmplib/system.c, snmplib/system.h, snmplib/view.h
+, win32/config.h:
+
+ - (*.*.*): __UCD_P -> __P, and a configure check to look for it.
+
+1997-10-29 12:23 hardaker
+
+ * snmplib/parse.h:
+
+ - (parse.h): STATUS_KW_OPTIONAL -> STATUS_OPTIONAL
+
+1997-10-29 11:20 hardaker
+
+ * acconfig.h, config.h.in, agent/snmp_agent.c,
+ agent/snmp_vars.c, agent/mibgroup/disk.c,
+ agent/mibgroup/errormib.c, agent/mibgroup/extensible.c,
+ agent/mibgroup/loadave.c, apps/Makefile.in,
+ apps/snmpbulkwalk.c, apps/snmpdelta.c, apps/snmpget.c
+, apps/snmpgetnext.c, apps/snmpset.c,
+ apps/snmpstatus.c, apps/snmptest.c,
+ apps/snmptranslate.c, apps/snmptrapd.c,
+ apps/snmpwalk.c, man/Makefile.in, man/snmpdelta.1
+, snmplib/asn1.c, snmplib/mib.c, snmplib/mib.h
+, snmplib/parse.h:
+
+ - (acconfig.h, asn1.c, mib.[ch], parse.h,apps/*,errormib.c,loadave.c,
+ extensible.c, disk.c, snmpdelta*): Patch from Niels Baggesen:
+ - the now wellknown NetBSD fix,
+ - SunOS4 cc doesn't like unsigned literals or strtoul,
+ - added a char version of ";",
+ - added fprint_variable, fprint_objid etc
+ - changed the apps to print all error messages to stderr,
+ - completed the access and status values in snmplib/parse.h
+ - added a roughly patched version of snmpdelta.
+
+1997-10-29 10:54 hardaker
+
+ * agent/Makefile.in:
+
+ - (agent/Makefile.in): opps, forgot to put in @exec_path@.
+
+1997-10-29 10:47 hardaker
+
+ * Makefile.in, acconfig.h, config.h.in,
+ configure, configure.in, agent/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ local/Makefile.in, man/Makefile.in, mibs/Makefile.in
+, ov/Makefile.in:
+
+ - (config*, */Makefile.in):
+ - Move snmplibpath to @datadir@ which defaults to /usr/local/share/snmp.
+
+1997-10-29 10:25 hardaker
+
+ * Makefile.in, configure.in, agent/Makefile.in
+, apps/Makefile.in, apps/snmpnetstat/Makefile.in
+, local/Makefile.in, man/Makefile.in,
+ man/mib_api.3, man/snmpd.1.def, man/snmpd.conf.5.def
+, mibs/Makefile.in, ov/Makefile.in:
+
+ - (*/Makefile.in, man/*):
+ - Patch from Simon Burge to change installation paths.
+ - (modified to point agent to sbindir instead of etcdir).
+
+1997-10-29 10:06 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): remove space before % sign.
+
+1997-10-29 10:06 hardaker
+
+ * agent/mibgroup/disk.c:
+
+ - (disk.c): fix pointer problems from old read_config form to new.
+
+1997-10-29 09:57 hardaker
+
+ * sedscript.in, agent/mibgroup/disk.c,
+ agent/mibgroup/disk.h, agent/mibgroup/struct.h,
+ man/snmpd.conf.5.def, mibs/UCD-SNMP-MIB.txt:
+
+ - (disk.[ch], struct.h, sedscript.in, snmpd.conf.5.def, UCD-SNMP-MIB.txt):
+ - Patch from Simon Burge to allow a minimum percentage on disk space.
+ - (was originally a maximum, but I changed it to minimum instead).
+
+1997-10-29 09:42 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): add sys/select.h for aix.
+
+1997-10-29 09:41 hardaker
+
+ * apps/snmptrap.c:
+
+ - (snmptrap.c): remove unused nlist struct.
+
+1997-10-28 17:12 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.3.pre7 )
+
+1997-10-28 17:10 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ - (util_funcs.c): Patch from Nobuo_Okabe@yokogawa.co.jp:
+ - fix unwrapped fopen() by adding return NULL check.
+
+1997-10-28 17:09 hardaker
+
+ * acconfig.h, config.h.in, mibs/UCD-SNMP-MIB.txt
+:
+
+ - (acconfig.h, UCD-SNMP-MIB.txt): define bsdi agent type.
+
+1997-10-28 15:49 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/mibgroup/route_write.c,
+ agent/mibgroup/var_route.c:
+
+ - (config*, route_write.c, var_route.c):
+ - fix rtentry problems once and for probably never.
+
+1997-10-28 14:53 hardaker
+
+ * acconfig.h, agent/common_header.h, agent/kernel.c
+, agent/kernel.h, agent/read_config.c,
+ agent/read_config.h, agent/snmp_agent.c,
+ agent/snmp_agent.h, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmpd.c, agent/snmpd.h
+, agent/var_struct.h, agent/view_parse.c,
+ agent/mibgroup/acl_vars.c, agent/mibgroup/acl_vars.h,
+ agent/mibgroup/alarm.c, agent/mibgroup/alarm.h,
+ agent/mibgroup/at.c, agent/mibgroup/at.h,
+ agent/mibgroup/context_vars.c, agent/mibgroup/context_vars.h
+, agent/mibgroup/disk.c, agent/mibgroup/disk.h,
+ agent/mibgroup/errormib.c, agent/mibgroup/errormib.h,
+ agent/mibgroup/event.c, agent/mibgroup/event.h,
+ agent/mibgroup/example.c, agent/mibgroup/example.h,
+ agent/mibgroup/extensible.c, agent/mibgroup/extensible.h
+, agent/mibgroup/hpux.h, agent/mibgroup/hr_device.c
+, agent/mibgroup/hr_filesys.c,
+ agent/mibgroup/hr_storage.c, agent/mibgroup/hr_utils.h,
+ agent/mibgroup/icmp.c, agent/mibgroup/icmp.h,
+ agent/mibgroup/interfaces.c, agent/mibgroup/interfaces.h
+, agent/mibgroup/ip.c, agent/mibgroup/ip.h,
+ agent/mibgroup/loadave.c, agent/mibgroup/loadave.h,
+ agent/mibgroup/memory.c, agent/mibgroup/memory.h,
+ agent/mibgroup/party_vars.c, agent/mibgroup/party_vars.h
+, agent/mibgroup/pass.c, agent/mibgroup/pass.h,
+ agent/mibgroup/proc.c, agent/mibgroup/proc.h,
+ agent/mibgroup/route_write.h, agent/mibgroup/smux.c,
+ agent/mibgroup/smux.h, agent/mibgroup/snmp_mib.c,
+ agent/mibgroup/snmp_mib.h, agent/mibgroup/system.c,
+ agent/mibgroup/system.h, agent/mibgroup/tcp.c,
+ agent/mibgroup/tcp.h, agent/mibgroup/udp.c,
+ agent/mibgroup/udp.h, agent/mibgroup/util_funcs.c,
+ agent/mibgroup/util_funcs.h, agent/mibgroup/var_route.c
+, agent/mibgroup/var_route.h,
+ agent/mibgroup/versioninfo.c, agent/mibgroup/versioninfo.h
+, agent/mibgroup/view_vars.c, agent/mibgroup/view_vars.h
+, agent/mibgroup/wombat.c, agent/mibgroup/wombat.h
+, apps/snmp_parse_args.c, apps/snmp_parse_args.h,
+ apps/snmpbulkwalk.c, apps/snmpget.c,
+ apps/snmpgetnext.c, apps/snmpset.c, apps/snmpstatus.c
+, apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmpwalk.c
+, apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c
+, apps/snmpnetstat/main.c, apps/snmpnetstat/netstat.h
+, apps/snmpnetstat/route.c, snmplib/acl.c,
+ snmplib/acl.h, snmplib/acl_parse.c, snmplib/asn1.h
+, snmplib/context.c, snmplib/context.h,
+ snmplib/context_parse.c, snmplib/md5.c, snmplib/md5.h
+, snmplib/mib.c, snmplib/mib.h, snmplib/parse.c
+, snmplib/parse.h, snmplib/party.h,
+ snmplib/party_parse.c, snmplib/snmp.h,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_client.h, snmplib/snmp_impl.h,
+ snmplib/system.c, snmplib/system.h, snmplib/view.h
+, win32/config.h:
+
+ - (*.*.*.*): rename macro __P -> __UCD_P to reduce stupid conflicts.
+
+1997-10-28 14:42 hardaker
+
+ * configure, configure.in:
+
+ - (config*): fix rtentry structure checks for the *bsd groups.
+
+1997-10-28 14:30 hardaker
+
+ * acconfig.h, config.h.in, snmplib/mib.c:
+
+ - (acconfig.h, mib.c): use ';'s for DOS env paths.
+
+1997-10-28 09:56 hardaker
+
+ * acconfig.h, snmplib/snmp.c, snmplib/system.c
+, snmplib/system.h:
+
+ - (acconfig.h, system.[ch], snmp.c): move strdup def to system.[ch].
+
+1997-10-27 18:31 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.3.pre6 )
+
+1997-10-27 18:26 hardaker
+
+ * configure, configure.in:
+
+ - (configure.in): fix config_arch_require macro to actually work.
+
+1997-10-27 18:18 hardaker
+
+ * snmplib/: acl_parse.c, context_parse.c, party_parse.c
+, snmp_api.c, snmp_api.h, snmp_client.c:
+
+ - (snmplib/*.c): use snmp_set_detail to handle malloc/free of snmp_detail.
+
+1997-10-27 18:18 hardaker
+
+ * apps/snmpwalk.c:
+
+ - (snmpwalk.c): remove gotroot var.
+
+1997-10-27 18:05 hardaker
+
+ * win32/: libsnmp/libsnmp.dsp, libsnmp/libsnmp.plg,
+ libsnmp_dll/libsnmp.def, libsnmp_dll/libsnmp_dll.dsp,
+ libsnmp_dll/libsnmp_dll.plg, snmpbulkwalk/snmpbulkwalk.dsp
+, snmpbulkwalk/snmpbulkwalk.plg, snmpget/snmpget.dsp
+, snmpget/snmpget.plg, snmpgetnext/snmpgetnext.dsp
+, snmpgetnext/snmpgetnext.plg, snmpset/snmpset.dsp
+, snmpset/snmpset.plg, snmpstatus/snmpstatus.dsp,
+ snmpstatus/snmpstatus.plg, snmptranslate/snmptranslate.dsp
+, snmptranslate/snmptranslate.plg, snmpwalk/snmpwalk.dsp
+, snmpwalk/snmpwalk.plg:
+
+ - (win32): add files on main branch.
+
+1997-10-27 18:02 hardaker
+
+ * win32/: config.h, win32.dsw, win32.opt:
+
+ win32 files
+
+1997-10-27 17:47 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): merge bugs: else check against pdu command type.
+
+1997-10-27 17:44 hardaker
+
+ * snmplib/snmp_auth.c:
+
+ - (snmp_auth.c): merge bugs. Missing brackets.
+
+1997-10-27 17:43 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): missing a else statement (sigh).
+
+1997-10-27 17:43 hardaker
+
+ * agent/mibgroup/: hr_device.h, hr_disk.h, hr_filesys.h
+, hr_network.h, hr_print.h, hr_proc.h,
+ hr_swinst.h, hr_swrun.h, hr_system.h:
+
+ - (agent/mibgroup/hr_*.h): proper init_ prototypes.
+
+1997-10-27 17:42 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): two modules for extensible count.
+
+1997-10-27 17:05 hardaker
+
+ * apps/snmpstatus.c:
+
+ - (snmpstatus.c): remove duplicate declairation.
+
+1997-10-27 17:04 hardaker
+
+ * agent/mibgroup/: hr_device.c, hr_disk.c, hr_filesys.c
+, hr_network.c, hr_partition.c, hr_print.c,
+ hr_proc.c, hr_storage.c, hr_swinst.c, hr_swrun.c
+, hr_system.c:
+
+ - (hr_*.c): ERROR -> ERROR_MSG.
+
+1997-10-27 16:34 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ - (snmp_api.[ch]): fix perror losses from merge.
+
+1997-10-27 16:26 hardaker
+
+ * config.h.in, configure, configure.in,
+ agent/kernel.c, agent/snmp_agent.c, agent/snmp_vars.c
+, agent/mibgroup/acl_vars.c, agent/mibgroup/alarm.c
+, agent/mibgroup/at.c, agent/mibgroup/context_vars.c
+, agent/mibgroup/event.c, agent/mibgroup/example.c
+, agent/mibgroup/icmp.c, agent/mibgroup/interfaces.c
+, agent/mibgroup/ip.c, agent/mibgroup/party_vars.c
+, agent/mibgroup/snmp_mib.c, agent/mibgroup/system.c
+, agent/mibgroup/tcp.c, agent/mibgroup/udp.c,
+ agent/mibgroup/var_route.c, agent/mibgroup/view_vars.c,
+ agent/mibgroup/wombat.c, apps/snmp_parse_args.c,
+ apps/snmpbulkwalk.c, apps/snmpget.c,
+ apps/snmpgetnext.c, apps/snmpset.c, apps/snmpstatus.c
+, apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmpwalk.c,
+ apps/snmpnetstat/main.c, snmplib/acl.c,
+ snmplib/acl_parse.c, snmplib/asn1.c, snmplib/asn1.h
+, snmplib/context.c, snmplib/context_parse.c,
+ snmplib/md5.c, snmplib/mib.c, snmplib/parse.c,
+ snmplib/parse.h, snmplib/party.c,
+ snmplib/party_parse.c, snmplib/snmp.c, snmplib/snmp.h
+, snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_impl.h, snmplib/system.c,
+ snmplib/system.h, snmplib/view.c:
+
+ - (*): merge of W32 port and main version branch.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpwalk/snmpwalk.plg:
+
+ file snmpwalk.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpwalk/snmpwalk.dsp:
+
+ file snmpwalk.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmptranslate/snmptranslate.dsp:
+
+ file snmptranslate.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmptranslate/snmptranslate.plg:
+
+ file snmptranslate.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpstatus/snmpstatus.dsp:
+
+ file snmpstatus.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpstatus/snmpstatus.plg:
+
+ file snmpstatus.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpset/snmpset.plg:
+
+ file snmpset.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpset/snmpset.dsp:
+
+ file snmpset.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpgetnext/snmpgetnext.dsp:
+
+ file snmpgetnext.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpgetnext/snmpgetnext.plg:
+
+ file snmpgetnext.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpget/snmpget.dsp:
+
+ file snmpget.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpget/snmpget.plg:
+
+ file snmpget.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpbulkwalk/snmpbulkwalk.plg:
+
+ file snmpbulkwalk.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/snmpbulkwalk/snmpbulkwalk.dsp:
+
+ file snmpbulkwalk.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ file libsnmp.def was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/libsnmp_dll/libsnmp_dll.dsp:
+
+ file libsnmp_dll.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/libsnmp_dll/libsnmp_dll.plg:
+
+ file libsnmp_dll.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/libsnmp/libsnmp.dsp:
+
+ file libsnmp.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/libsnmp/libsnmp.plg:
+
+ file libsnmp.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/win32.dsw:
+
+ file win32.dsw was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/config.h:
+
+ file config.h was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 14:19 hardaker
+
+ * win32/win32.opt:
+
+ file win32.opt was initially added on branch V2C-WIN32-3-3-pre3.
+
+1997-10-27 09:56 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/mibgroup/at.h,
+ agent/mibgroup/icmp.h, agent/mibgroup/interfaces.c,
+ agent/mibgroup/interfaces.h, agent/mibgroup/ip.h,
+ agent/mibgroup/tcp.h, agent/mibgroup/ucd_snmp.h,
+ agent/mibgroup/udp.h, agent/mibgroup/var_route.c,
+ agent/mibgroup/var_route.h:
+
+ - (config*, agent/mibgroup/*.h):
+ - new config macro: config_arch_require(arch, module).
+ - moved arch dependant modules (memory, hpux, kernel_sunos5) loads
+ from the configure into the appropriate .h files.
+ - (interfaces.c, var_route.c):
+ - typecast klookup calls for freebsd2.
+
+1997-10-22 11:39 hardaker
+
+ * agent/common_header.h, agent/read_config.c,
+ agent/mibgroup/disk.c, apps/snmp_parse_args.c:
+
+ - (common_header.h, read_config.c, disk.c, snmp_parse_args.c):
+ - Typo's fixed by Niels.
+
+1997-10-21 12:36 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.3.pre5 )
+
+1997-10-21 12:36 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (*/Makefile.in): did a make depend.
+
+1997-10-21 12:32 hardaker
+
+ * apps/snmpnetstat/Makefile.in, snmplib/Makefile.in:
+
+ - (*/Makefile.in): make makefileindepend..
+
+1997-10-21 12:31 hardaker
+
+ * Makefile.in, agent/Makefile.in,
+ agent/mibgroup/Makefile.in, apps/Makefile.in:
+
+ - (*/Makefile.in): make makefileindepend setup.
+
+1997-10-21 12:24 hardaker
+
+ * agent/: Makefile.in, read_config.c, read_config.h
+, snmp_agent.c, snmp_vars.c, snmpd.c,
+ mibgroup/disk.h, mibgroup/extensible.c,
+ mibgroup/extensible.h, mibgroup/loadave.h,
+ mibgroup/pass.h, mibgroup/proc.c, mibgroup/proc.h
+, mibgroup/read_config.c, mibgroup/read_config.h,
+ mibgroup/system.c, mibgroup/util_funcs.c,
+ mibgroup/util_funcs.h:
+
+ - (agent/read_config.[ch], snmpd.c, snmp_vars.c, mibgroup/*):
+ - moved read_config.[ch] up a level to always be compiled in.
+
+1997-10-21 11:02 hardaker
+
+ * bug-report, sedscript.in, version.h:
+
+ version tag ( 3.3.pre4 )
+
+1997-10-21 11:01 hardaker
+
+ * NEWS:
+
+ - (NEWS): beginnings of NEWS updates.
+
+1997-10-21 11:00 hardaker
+
+ * agent/mibgroup/: hr_storage.c, hr_swrun.c, memory.c
+:
+
+ - (hr_storage.c, hr_swrun.c, memory.c): close open files on linux.
+
+1997-10-21 10:45 hardaker
+
+ * apps/snmp_parse_args.c:
+
+ - (snmp_parse_args.c): allow -v 2h and 2p for party code.
+
+1997-10-21 10:15 hardaker
+
+ * PORTING, README:
+
+ - (PORTING, README): minor updates.
+
+1997-10-20 19:43 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): define at least blank func nlist_init() on linux.
+
+1997-10-20 19:42 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): define linux's OS type.
+
+1997-10-20 18:01 hardaker
+
+ * INSTALL, configure, configure.in,
+ agent/mibgroup/example.c, agent/mibgroup/mibII.h,
+ agent/mibgroup/smux_gated.h, agent/mibgroup/ucd_snmp.h,
+ agent/mibgroup/v2party.h, agent/mibgroup/wombat.c,
+ agent/mibgroup/wombat.h:
+
+ - (config*, agent/mibgroup/v2party.h, ucd_snmp.h, smux_gated.h):
+ - created new wrappers for the various modules to make them easy to
+ add and remove as needed.
+
+1997-10-20 17:16 hardaker
+
+ * agent/mibgroup/: host.c, host.h, hr_device.c,
+ hr_disk.c, hr_filesys.c, hr_network.c, hr_other.c
+, hr_partition.c, hr_print.c, hr_proc.c,
+ hr_storage.c, hr_swinst.c, hr_swrun.c,
+ hr_system.c:
+
+ - (config*, agent/mibgroup/hr_*.c):
+ - A module.c file is no longer required. Only the .h file is
+ necessary, for people who want to have one module wrap a bunch of others.
+ - removed host.c
+ - renamed all hr_init functions to be auto-called.
+
+1997-10-20 17:15 hardaker
+
+ * agent/mibgroup/: README, wombat.c, wombat.h:
+
+ - (agent/mibgroup/README, wombat.[ch]):
+ - documentation update to reflect config_parse_dot_conf() usage.
+
+1997-10-20 17:01 hardaker
+
+ * configure, configure.in:
+
+ - (config*, agent/mibgroup/hr_*.c):
+ - A module.c file is no longer required. Only the .h file is
+ necessary, for people who want to have one module wrap a bunch of others.
+ - removed host.c
+ - renamed all hr_init functions to be auto-called.
+
+1997-10-20 16:44 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): patch all other env-vars to take '+' in front.
+
+1997-10-20 16:38 hardaker
+
+ * snmplib/mib.c:
+
+ - (mib.c): From Dave: patch DEFAULT_MIBS to take '+' in front.
+
+1997-10-20 16:06 hardaker
+
+ * agent/mibgroup/read_config.c:
+
+ - (read_config.c):
+ - don't report an error if you can't find a snmpd.conf file.
+ - don't report all lines as an error (opps).
+
+1997-10-20 16:05 hardaker
+
+ * agent/mibgroup/pass.c:
+
+ - (pass.c) don't null last char in command line.
+
+1997-10-20 11:51 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/snmp_agent.c, agent/snmp_agent.h
+, agent/snmpd.c, agent/snmpd.h,
+ agent/mibgroup/.cvsignore, agent/mibgroup/disk.c,
+ agent/mibgroup/disk.h, agent/mibgroup/event.c,
+ agent/mibgroup/extensible.c, agent/mibgroup/extensible.h
+, agent/mibgroup/hr_device.c, agent/mibgroup/hr_disk.c
+, agent/mibgroup/hr_network.c,
+ agent/mibgroup/hr_network.h, agent/mibgroup/hr_print.c,
+ agent/mibgroup/hr_proc.c, agent/mibgroup/hr_storage.c,
+ agent/mibgroup/hr_system.c, agent/mibgroup/loadave.c,
+ agent/mibgroup/loadave.h, agent/mibgroup/memory.c,
+ agent/mibgroup/memory.h, agent/mibgroup/pass.c,
+ agent/mibgroup/pass.h, agent/mibgroup/proc.c,
+ agent/mibgroup/proc.h, agent/mibgroup/read_config.c,
+ agent/mibgroup/read_config.h, agent/mibgroup/snmp_mib.c
+, agent/mibgroup/system.c, agent/mibgroup/system.h
+:
+
+ - (config*, agent/snmp*, agent/mibgroup/*.[ch]):
+ - Created a new mibmodule.h configuration macro called
+ config_parse_dot_conf() which can be called to request parsing of
+ the snmpd.conf file(s) on a per module basis.
+ - All related parsing has been striped from read_config.c and move
+ to their correct module instead.
+ - New function: config_perror(char *): print error with file & line #.
+ - basic -Wall cleanups in hr* as well (not nearly done yet).
+
+1997-10-20 11:45 hardaker
+
+ * FAQ:
+
+ - (FAQ): Changes from Dave.
+
+1997-10-15 18:40 hardaker
+
+ * config.h.in, configure, configure.in,
+ agent/mibgroup/host.c, agent/mibgroup/host.h,
+ agent/mibgroup/host_res.h, agent/mibgroup/hr_device.c,
+ agent/mibgroup/hr_device.h, agent/mibgroup/hr_disk.c,
+ agent/mibgroup/hr_disk.h, agent/mibgroup/hr_filesys.c,
+ agent/mibgroup/hr_filesys.h, agent/mibgroup/hr_network.c
+, agent/mibgroup/hr_network.h, agent/mibgroup/hr_other.c
+, agent/mibgroup/hr_other.h,
+ agent/mibgroup/hr_partition.c, agent/mibgroup/hr_partition.h
+, agent/mibgroup/hr_print.c, agent/mibgroup/hr_print.h
+, agent/mibgroup/hr_proc.c, agent/mibgroup/hr_proc.h
+, agent/mibgroup/hr_storage.c,
+ agent/mibgroup/hr_storage.h, agent/mibgroup/hr_swinst.c
+, agent/mibgroup/hr_swinst.h, agent/mibgroup/hr_swrun.c
+, agent/mibgroup/hr_swrun.h, agent/mibgroup/hr_system.c
+, agent/mibgroup/hr_system.h, agent/mibgroup/hr_utils.c
+, agent/mibgroup/hr_utils.h, agent/mibgroup/memory.c
+:
+
+ - (config*, agent/mibgroup/hr*): Host resources mib from Dave Shield.
+ - minor patches by me, mostly pointer errors.
+ - (memory.c): fixed a null pointer problem under linux.
+
+1997-10-15 12:12 hardaker
+
+ * mibs/.cvsignore:
+
+ - (mibs/.cvsignore): added Makefile.
+
+1997-10-15 12:11 hardaker
+
+ * agent/snmpd.c, snmplib/acl_parse.c,
+ snmplib/context_parse.c, snmplib/party_parse.c,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/route.c,
+ apps/snmp_parse_args.c, apps/snmpbulkwalk.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, apps/snmptest.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmpwalk.c
+:
+
+ - (apps/*.c, agent/snmpd.c, snmplib/*.c):
+ - create and use new function: snmp_perror(char *)
+ - free allocated space of snmp_detail upon usage by snmp_api_errstring().
+
+1997-10-15 09:58 hardaker
+
+ * agent/snmpd.c, snmplib/acl_parse.c,
+ snmplib/context_parse.c, snmplib/parse.c,
+ snmplib/party_parse.c, snmplib/snmp.c,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_auth.c, snmplib/snmp_client.c,
+ snmplib/snmp_impl.h, snmplib/view.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/route.c,
+ apps/snmp_parse_args.c, apps/snmp_parse_args.h,
+ apps/snmpbulkwalk.c, apps/snmpget.c,
+ apps/snmpgetnext.c, apps/snmpset.c, apps/snmpstatus.c
+, apps/snmptest.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmpwalk.c:
+
+ - (apps/*.c, agent/snmpd.c, snmplib/*.c): Patch from Niels:
+ - warning fixes.
+ - remove the printf's from the library and set a snmp 'errno' equivalent.
+
+1997-10-15 09:50 hardaker
+
+ * agent/: view_parse.c, snmp_vars.c:
+
+ - (view_parse.c, snmp_vars.c): From Niels: warning removals and standardization.
+
+1997-10-14 15:33 hardaker
+
+ * agent/mibgroup/: acl_vars.c, alarm.c, context_vars.c
+, event.c, event.h, interfaces.c,
+ kernel_sunos5.c, memory.c, memory.h, party_vars.c
+, read_config.c, var_route.c, versioninfo.c
+, view_vars.c:
+
+ - (agent/mibgroup/*.c): YMWRAMFSFN:
+ - (yet more warning removals and memory function standardizations from Niels).
+ - minor linux/netbsd/bsdi clean ups.
+
+1997-10-14 15:21 hardaker
+
+ * FAQ:
+
+ - (FAQ): From Dave Shields: refer reader to another answer as well.
+
+1997-10-14 15:18 hardaker
+
+ * config.h.in, configure, configure.in,
+ agent/common_header.h:
+
+ - (config*, common_header.h): dynix doesn't have net/route.h.
+
+1997-10-14 15:16 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): From Dave Shields:
+ - self contained mib .txt files with multiple modules.
+
+1997-10-14 15:15 hardaker
+
+ * man/mib_api.3:
+
+ - (mib_api.3): doc addition: add_mibdir() return value.
+
+1997-08-25 00:22 whardake
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): Patch from Dave Shields for netbsd.
+
+1997-08-25 00:21 whardake
+
+ * agent/mibgroup/versiontag:
+
+ - (versiontag): checkin version.h.
+
+1997-08-25 00:21 whardake
+
+ * agent/mibgroup/memory.c:
+
+ - (memory.c): typo in ifdef.
+
+1997-08-15 06:45 whardake
+
+ * sedscript.in, bug-report, version.h:
+
+ version tag ( 3.3.pre3 )
+
+1997-08-15 02:30 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/snmp_client.c,
+ snmplib/snmp_client.h, snmplib/system.c, agent/snmpd.c
+, snmplib/system.h:
+
+ - (config*, snmpd.c, snmp_client.[ch], system.[ch]):
+ - fix more long/int problems on 64 bit machines u_long -> in_addr_t.
+ - Check for SIOCGIFADDR in sys/ioctl.h and use it in get_myaddr() if
+ defined.
+
+1997-08-14 08:21 whardake
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): Patch from David C. Lawrence for netbsd * bsd/os 2.0.
+
+1997-08-14 08:16 whardake
+
+ * agent/mibgroup/proc.c:
+
+ - (proc.c): don't use seterrorstatus() if not using the errormib.
+
+1997-08-14 08:16 whardake
+
+ * agent/mibgroup/README:
+
+ - (agent/mibgroup/README): Point out that mib list must be in descending order.
+
+1997-08-14 08:15 whardake
+
+ * configure, configure.in:
+
+ - (configure*):
+ - Typo's when copying in a autoconf test.
+ - Add errormib to default module list (since its no longer required).
+ - backquote a . in a sed regexp to watch out for module names
+ beginning with the letter o.
+
+1997-08-14 07:37 whardake
+
+ * FAQ, README, config.h.in, configure,
+ configure.in, agent/common_header.h,
+ agent/snmp_agent.c, agent/snmpd.c,
+ agent/mibgroup/alarm.c, agent/mibgroup/disk.c,
+ agent/mibgroup/errormib.c, agent/mibgroup/event.c,
+ agent/mibgroup/extensible.c, agent/mibgroup/extensible.h
+, agent/mibgroup/loadave.c, agent/mibgroup/read_config.c
+, agent/mibgroup/var_route.c, apps/snmpbulkwalk.c
+, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpset.c, apps/snmpstatus.c, apps/snmptest.c
+, apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmpwalk.c,
+ apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/route.c:
+
+ - (config*, FAQ, README, agent/mibgroup/*.c, apps/*.c):
+ - Patch from David Paul Zimmerman:
+ - port to AIX 4.1.5.
+ - fix more type casting problems.
+
+1997-08-14 00:46 whardake
+
+ * apps/: snmp_parse_args.c, snmptrap.c, snmptrapd.c
+, snmpnetstat/main.c:
+
+ - (snmp_parse_args.c, snmptrap.c, snmptrapd.c, main.c):
+ - add -V version flage.
+
+1997-08-13 08:10 whardake
+
+ * version.h, agent/common_header.h, agent/snmp_agent.c
+, agent/snmp_vars.c, agent/snmpd.c,
+ agent/mibgroup/disk.c, agent/mibgroup/disk.h,
+ agent/mibgroup/interfaces.c, agent/mibgroup/interfaces.h
+, agent/mibgroup/proc.c, agent/mibgroup/proc.h,
+ agent/mibgroup/util_funcs.c, agent/mibgroup/util_funcs.h
+, agent/mibgroup/var_route.c, agent/mibgroup/var_route.h
+, agent/mibgroup/versioninfo.c,
+ agent/mibgroup/versioninfo.h, agent/mibgroup/versiontag
+, snmplib/context.h, snmplib/party.h:
+
+ - (version.h, agent/*, agent/mibgroup/*):
+ - move version string to a global header.
+ - insert USING_*_MODULE macro's in many places to make module
+ removal more possible. You can now compile with almost no modules
+ installed.
+
+1997-08-13 04:47 whardake
+
+ * apps/snmpstatus.c:
+
+ - (snmpstatus.c): optarg/optind need to be declaired under ultrix4.
+
+1997-08-07 02:34 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/mibgroup/memory.c:
+
+ - (config*, memory.c):
+ - fix swap on HPUX 10.20
+
+1997-08-07 01:33 whardake
+
+ * agent/: kernel.c, mibgroup/proc.c:
+
+ - (kernel.c, proc.c): Patch from Simon Burge:
+ - Implement real process table walks on Ultrix.
+
+1997-08-07 01:10 whardake
+
+ * README, acconfig.h, config.h.in, configure
+, configure.in, agent/mibgroup/disk.c,
+ agent/mibgroup/loadave.c, snmplib/parse.c,
+ snmplib/snmp.c:
+
+ - (config*, load.c, disk.c, parse.c, snmp.c): Patch from Simon Burge:
+ - Ultrix fixes for statfs, loadave.
+ - implement strdup if not found in system.
+ - test for test flags for kernel checking.
+ - watch out for ps'es that return egrep with the ps arg on the line.
+ - up maximum disks to 50.
+
+1997-08-07 00:29 whardake
+
+ * TODO:
+
+ - (TODO): better error messages by apps.
+
+1997-07-24 23:50 whardake
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Patch from Eddy J. Gurney: uncomment gettimeofday() call.
+
+1997-07-03 23:34 whardake
+
+ * agent/mibgroup/versioninfo.c, bug-report,
+ sedscript.in:
+
+ version tag ( 3.3.pre2 )
+
+1997-07-03 23:33 whardake
+
+ * apps/snmptranslate.c, snmplib/mib.c, snmplib/mib.h
+, snmplib/parse.c, snmplib/parse.h:
+
+ - (snmptranslate.c, mib.[ch], parse.[ch]):
+ - New option to snmptranslate (-a) to output a ascii dump of the mib
+ database capable of being used by the parser for quick OID translations.
+
+1997-07-01 08:37 whardake
+
+ * agent/mibgroup/versioninfo.c, sedscript.in,
+ bug-report:
+
+ version tag ( 3.3.pre1 )
+
+1997-07-01 07:20 whardake
+
+ * config.h.in, configure, configure.in:
+
+ - (config*): bsdi3 specific headers.
+
+1997-07-01 06:41 whardake
+
+ * agent/mibgroup/: disk.c, errormib.c, loadave.c,
+ memory.c:
+
+ - (disk.c, errormib.c, loadave.c, memory.c): bsdi3 specific headers.
+
+1997-07-01 06:02 whardake
+
+ * apps/: snmp_parse_args.c, snmp_parse_args.h,
+ snmpbulkwalk.c, snmpget.c, snmpgetnext.c,
+ snmpset.c, snmpstatus.c, snmptest.c,
+ snmpwalk.c:
+
+ - (apps/*.c): Better usage information and usage() standarization.
+
+1997-07-01 05:41 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/common_header.h,
+ agent/mibgroup/interfaces.c, agent/mibgroup/var_route.c
+, mibs/UCD-SNMP-MIB.txt:
+
+ - (config*, common_header.h, interfaces.c, var_route.c, UCD-SNMP-MIB.txt):
+ - fix freebsd3 specific problems (based on suggestions from Bill Fenner).
+
+1997-07-01 01:10 whardake
+
+ * agent/mibgroup/smux.c:
+
+ - (smux.c): fix prototyping failures.
+
+1997-06-30 07:19 whardake
+
+ * snmplib/: mib.c, parse.c, snmp_api.c:
+
+ - (mib.c, parse.c, snmp_api.c): Suggestions from Laukkanen Markku NRC/Hki:
+ - Malloc typecasts and other corrections in casting.
+
+1997-06-30 06:58 whardake
+
+ * man/mib_api.3, snmplib/parse.c, snmplib/parse.h
+:
+
+ - (mib_api.3, parse.[ch]): Patch from Dave Shield:
+ - Handle mib module replacements through new function and replacement table.
+
+1997-06-30 06:49 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/mibgroup/memory.c:
+
+ - (config*, memory.c): Patch from vlad@misery.rosprint.ru:
+ - implement memory section of ucd mib on linux.
+
+1997-06-30 06:38 whardake
+
+ * agent/mibgroup/wombat.h:
+
+ - (wombat.h): better document config_load_mib() example.
+
+1997-06-30 06:33 whardake
+
+ * apps/snmptest.c:
+
+ - (snmptest.c): Patch from Niels Baggesen to fix get -> fget '\n' problem.
+ - Also makes sure it handles up and lower cases.
+
+1997-06-30 05:54 whardake
+
+ * agent/mibgroup/interfaces.c:
+
+ - (agent/mibgroup/interfaces.c): Don't put & in front of osf4 ac_enaddr.
+
+1997-06-30 05:53 whardake
+
+ * agent/snmp_agent.c, agent/snmp_vars.c,
+ agent/mibgroup/alarm.c, agent/mibgroup/event.c,
+ apps/Makefile.in, apps/snmp_parse_args.c,
+ apps/snmp_parse_args.h, apps/snmpbulkwalk.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, apps/snmptest.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmpwalk.c
+, apps/snmpnetstat/main.c, snmplib/snmp.h,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c:
+
+ - (agent/snmp_{agent,vars}.c, alarm.c, event.c, apps/*,
+ snmplib/snmp{,_api,_auth}.c):
+ - Added basic (mostly conforming?) v2c support.
+ - Merged arg parsing of apps/* clients into one file.
+
+1997-06-26 23:39 whardake
+
+ * agent/mibgroup/smux.c:
+
+ - (smux.c): __P macros were called with too many arguments (needed (args)).
+
+1997-06-23 23:42 whardake
+
+ * agent/mibgroup/README:
+
+ - (agent/mibgroup/README): need 2 leading '-'s on --with-mib-modules flag.
+
+1997-06-23 23:41 whardake
+
+ * configure, configure.in:
+
+ - (configure*): bsdi3 needs to define bsdi2, not itself (duh).
+
+1997-06-23 23:40 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in): Patch from John Charlton to fix leading spaces in sedscript.
+
+1997-06-11 05:46 whardake
+
+ * ChangeLog:
+
+ - (ChangeLog): whoops.
+
+1997-06-11 04:53 whardake
+
+ * snmplib/mib.c:
+
+ - (mib.c): Patch from Niels Baggesen to make MIBFILES env var work correctly.
+
+1997-05-26 02:38 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from niels Baggesen to:
+ - close mibfiles for MIBS=ALL.
+ - Allow SYNTAX DisplayString (SIZE) inside OBJECT-TYPE.
+
+1997-05-26 01:58 whardake
+
+ * agent/mibgroup/versioninfo.c, bug-report,
+ sedscript.in:
+
+ version tag ( 3.2 )
+
+1997-05-26 01:57 whardake
+
+ * ChangeLog:
+
+ - (ChangeLog): Update for 3.2.
+
+1997-05-26 01:56 whardake
+
+ * local/snmpcheck.def:
+
+ - (snmpcheck.def): new variables to set walk/get/set command line usage.
+
+1997-05-26 01:52 whardake
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): trap long's back to ints, bad solution.
+
+1997-05-26 01:50 whardake
+
+ * INSTALL, configure, configure.in:
+
+ - (INSTALL, configure): default mibs listed correctly.
+
+1997-05-23 07:34 whardake
+
+ * man/mib_api.3:
+
+ - (mib_api.3): Modifiy to note default mibs.
+
+1997-05-23 07:23 whardake
+
+ * agent/mibgroup/versioninfo.c, bug-report,
+ sedscript.in:
+
+ version tag ( 3.1.4.pre8 )
+
+1997-05-23 04:40 whardake
+
+ * snmplib/snmp_api.h:
+
+ - (snmp_api.h): Change trap types from int to long.
+
+1997-05-23 04:40 whardake
+
+ * snmplib/mib.c:
+
+ - (mib.c): Patch from Dave Shields to fix SNMP perl again.
+
+1997-05-23 04:38 whardake
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Patch from Niels Bagessen to fix multiple frees in v2 pdu's.
+
+1997-05-23 04:37 whardake
+
+ * snmplib/snmp_client.c:
+
+ - (snmp_client.c): Patch from Niels Bagessen to fix endiennes problems.
+
+1997-05-23 04:36 whardake
+
+ * mibs/: HOST-RESOURCES-MIB.txt, SNMPv2-TC.txt:
+
+ - (HOST-RESOURCES-MIB.txt, SNMPv2-TC.txt): From Niels: change import clauses.
+
+1997-05-23 04:36 whardake
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Patch from Niels Bagessen to fix endiannes problems.
+
+1997-05-23 04:35 whardake
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): Set default MIB list.
+
+1997-05-22 04:13 whardake
+
+ * mibs/SNMPv2-M2M-MIB.txt:
+
+ - (SNMPv2-M2M-MIB.txt): restored. Got truncated.
+
+1997-05-21 06:40 whardake
+
+ * FAQ:
+
+ - (FAQ): Changes from Dave.
+
+1997-05-21 06:38 whardake
+
+ * NEWS:
+
+ - (NEWS): Changes from Dave.
+
+1997-05-21 01:13 whardake
+
+ * NEWS:
+
+ - (NEWS): Update for 3.2.
+
+1997-05-20 07:50 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): code from Dave Shield: add back in find_node() for perl usage.
+
+1997-05-20 07:50 whardake
+
+ * TODO:
+
+ - (TODO): snmpset should check against size defined in mib.
+
+1997-05-20 02:24 whardake
+
+ * agent/mibgroup/udp.c:
+
+ - (udp.c): Patch from Martin Jacobsson: Fix my cpp stupidity.
+
+1997-05-20 01:08 whardake
+
+ * agent/mibgroup/versioninfo.c, bug-report,
+ sedscript.in:
+
+ version tag ( 3.1.4.pre7 )
+
+1997-05-19 23:19 whardake
+
+ * snmplib/: mib.c, snmp_auth.c:
+
+ - (mib.c, snmp_auth.c): include sys/select.h for AIX.
+
+1997-05-19 23:19 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): protect against 0 import calls.
+
+1997-05-19 23:18 whardake
+
+ * mibs/SNMPv2-TC.txt:
+
+ - (SNMPv2-TC.txt): Comment out ObjectSyntax import.
+
+1997-05-19 23:03 whardake
+
+ * agent/mibgroup/udp.c:
+
+ - (udp.c): Only do Martin Jacobssen's fixes for freebsd2.
+
+1997-05-16 02:25 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): Protect malloc against 0 external imports.
+
+1997-05-15 07:43 whardake
+
+ * agent/mibgroup/udp.c:
+
+ - (udp.c): Patch from Martin Jacobssen:
+ - Fix udp_inpcb structures.
+
+1997-05-15 07:26 whardake
+
+ * INSTALL, configure, configure.in:
+
+ - (configure*, INSTALL):
+ - Wording and order changes in configure --help lines.
+
+1997-05-15 07:22 whardake
+
+ * INSTALL, configure, configure.in:
+
+ - (configure*, INSTALL):
+ - Display defaults in configure --help lines.
+
+1997-05-15 07:01 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/mib.c:
+
+ - (config*, mib.c):
+ - Changed env variable MIBFILE -> MIBFILES (since it is a list now).
+ (will accept MIBFILE for backwards compatibility).
+ - By default, *no* additional mibfiles are loaded (ie, mib.txt is no
+ longer loaded) and must be turned on through configure or the env var.
+ - New configure options to set default MIBS, MIBFILES, MIBDIRS.
+
+1997-05-15 06:22 whardake
+
+ * snmplib/: mib.c, parse.h:
+
+ - (parse.h): Patch from Dave Shield: Add new node structure entries.
+
+1997-05-15 05:37 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): patch from Dave Shield:
+ - deal with multiple module ID's being referenced or nodes defined.
+ - supress "name clash" warnings for anonymous nodes.
+
+1997-05-15 02:32 whardake
+
+ * snmplib/: mib.c, parse.c:
+
+ - (mib.c, parse.c): patch from Niels Baggesen:
+ - prototyping and null checking.
+ - if MIBS is set to ALL, parse everything found.
+
+1997-05-15 02:31 whardake
+
+ * mibs/SNMPv2-SMI.txt:
+
+ - (SNMPv2-SMI.txt): patch from Niels Baggesen: ccitt -> 0.
+
+1997-05-15 02:30 whardake
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): patch from Niels Baggesen: import indentifiers.
+
+1997-05-15 02:29 whardake
+
+ * man/mib_api.3:
+
+ - (mib_api.3): patch from Niels Baggesen: MIBS variable can be set to ALL.
+
+1997-05-15 02:28 whardake
+
+ * INSTALL:
+
+ - (INSTALL): patch from Niels Baggesen to reference the maketarget script.
+
+1997-05-15 02:23 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Dave Shield to fix purely numeric OIDs.
+
+1997-05-15 02:22 whardake
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): patch from Martin Jacobsson for FreeBSD
+
+1997-05-14 06:00 whardake
+
+ * agent/mibgroup/versioninfo.c, bug-report,
+ sedscript.in:
+
+ version tag ( 3.1.4.pre6 )
+
+1997-05-14 04:45 whardake
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): Typecast malloc.
+
+1997-05-14 04:17 whardake
+
+ * Makefile.in, apps/Makefile.in:
+
+ - (Makefile.in, agent/Makefile.in): Patch from Oddbjorn Steffensen:
+ - Protect against bash needing ';'s on multiple subdir makes.
+
+1997-05-14 04:13 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in): warn if mib.txt is installed from a previous release.
+
+1997-05-14 02:41 whardake
+
+ * mib.txt, Makefile.in:
+
+ - (Makefile.in, mib.txt): removed mib.txt from distribution. No longer needed.
+
+1997-05-13 07:22 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/mib.c:
+
+ - (config*,mib.c): New configure option --with-default-mibs="list:list".
+
+1997-05-13 06:38 whardake
+
+ * mibs/Makefile.in:
+
+ - (mibs/Makefile.in): ucd-snmp.txt -> UCD-SNMP-MIB.txt.
+
+1997-05-13 06:36 whardake
+
+ * mibs/ucd-snmp.txt:
+
+ - (ucd-snmp.txt): moved to UCD-SNMP-MIB.txt
+
+1997-05-13 06:36 whardake
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - (UCD-SNMP-MIB.txt): moved from ucd-snmp.txt.
+
+1997-05-13 06:05 whardake
+
+ * README:
+
+ - (README): architecture list update.
+
+1997-05-13 06:05 whardake
+
+ * INSTALL, configure, configure.in:
+
+ - (config*, INSTALL): New flags to set prompted values instead of prompting.
+
+1997-05-13 05:48 whardake
+
+ * mibs/ucd-snmp.txt:
+
+ - (ucd-snmp.txt): Changed ID to UCD-SNMP
+
+1997-05-13 03:03 whardake
+
+ * mibs/Makefile.in:
+
+ - (mibs/Makefile.in): removed snmpv2.txt, rfc1271.txt.
+
+1997-05-13 03:02 whardake
+
+ * mibs/snmpv2.txt:
+
+ - (snmpv2.txt): removed.
+
+1997-05-13 02:57 whardake
+
+ * mibs/rfc1271.txt:
+
+ - (rfc1271.txt): removed.
+
+1997-05-13 01:52 whardake
+
+ * mibs/: ucd-snmp.txt, ucd.txt:
+
+ - (ucd.txt): whoops. Removed.
+
+1997-05-13 01:51 whardake
+
+ * mibs/RFC1213-MIB.txt:
+
+ - (RFC1213-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/RFC1155-SMI.txt:
+
+ - (RFC1155-SMI.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/RFC1271-MIB.txt:
+
+ - (RFC1271-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/SNMPv2-M2M-MIB.txt:
+
+ - (SNMPv2-M2M-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/SNMPv2-PARTY-MIB.txt:
+
+ - (SNMPv2-PARTY-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/UDP-MIB.txt:
+
+ - (UDP-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/TCP-MIB.txt:
+
+ - (TCP-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/SNMPv2-TM.txt:
+
+ - (SNMPv2-TM.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/SNMPv2-TC.txt:
+
+ - (SNMPv2-TC.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/SNMPv2-SMI.txt:
+
+ - (SNMPv2-SMI.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/SNMPv2-MIB.txt:
+
+ - (SNMPv2-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/SNMPv2-CONF.txt:
+
+ - (SNMPv2-CONF.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/IP-MIB.txt:
+
+ - (IP-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/IANAifType-MIB.txt:
+
+ - (IANAifType-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/HOST-RESOURCES-MIB.txt:
+
+ - (HOST-RESOURCES-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/EtherLike-MIB.txt:
+
+ - (EtherLike-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/ucd.txt:
+
+ - (ucd.txt): New mib file from Niels Baggesen.
+
+1997-05-13 01:51 whardake
+
+ * mibs/IF-MIB.txt:
+
+ - (IF-MIB.txt): New mib file from Niels Baggesen.
+
+1997-05-11 23:52 whardake
+
+ * mibs/ucd-snmp.txt:
+
+ - (mibs/ucd-snmp.txt): Patch from Mario DeFazio to fix typos.
+ - compiles under SNMPc 4.1g.
+
+1997-05-11 23:49 whardake
+
+ * man/Makefile.in:
+
+ - (man/Makefile.in): install mib_api.3.
+
+1997-05-11 23:48 whardake
+
+ * INSTALL, README, TODO:
+
+ - (INSTALL, README, TODO): documentation update.
+
+1997-05-11 23:44 whardake
+
+ * agent/Makefile.in:
+
+ - (agent/Makefile.in): removed CCHACK ???.
+
+1997-05-11 23:43 whardake
+
+ * config.h.in, configure, configure.in,
+ agent/mibgroup/extensible.c:
+
+ - (config*, extensible.c): BSDI3 specific headers and defines.
+
+1997-05-10 08:23 whardake
+
+ * agent/: snmpd.c, mibgroup/read_config.c,
+ mibgroup/system.c:
+
+ - (snmpd.c, read_config.c, system.c): Patch from Niels Baggesen:
+ - default trap community.
+ - multiple trap sinks.
+
+1997-05-10 07:52 whardake
+
+ * man/mib_api.3:
+
+ - (mib_api.3): New file from Dave Shield.
+
+1997-05-10 07:45 whardake
+
+ * FAQ:
+
+ - (FAQ): Patch from Dave Shields: update.
+
+1997-05-10 07:41 whardake
+
+ * bug-report:
+
+ - (bug-report): Patch from Dave Shields: don't submit blank bug-reports.
+
+1997-05-09 15:50 whardake
+
+ * snmplib/: mib.c, parse.c, parse.h:
+
+ - (parse.c): Patch from Dave Shields: deal with anonymous IDs (even better).
+
+1997-05-09 15:46 whardake
+
+ * snmplib/: mib.c, parse.c:
+
+ - (parse.c): Patch from Dave Shields: deal with anonymous IDs.
+
+1997-05-09 15:28 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Dave Shields: negative numbers in mibs.
+
+1997-05-09 15:03 whardake
+
+ * snmplib/: mib.c, parse.c:
+
+ - (mib.c, parse.c): patches from Niels Baggesen: prototyping (mostly).
+
+1997-05-09 14:52 whardake
+
+ * agent/mibgroup/: smux.c, smux.h:
+
+ - (smux.[ch]): patches from Niels Baggesen: prototyping.
+
+1997-05-09 13:46 whardake
+
+ * TODO:
+
+ - (TODO): Update.
+
+1997-05-09 13:46 whardake
+
+ * agent/mibgroup/smux.c, configure.in, configure
+, config.h.in:
+
+ - (smux.c, config*):
+ - check for sgtty.h and prototype better.
+
+1997-05-09 13:38 whardake
+
+ * snmplib/: Makefile.in, mib.c, mib.h, parse.c
+, parse.h:
+
+ - (mib.[ch], parse.[ch], Makefile.in): New parser from Dave Shield:
+ - Run-time control of initial module loading
+ (uses env variables MIBDIRS, MIBS, and MIBFILE)
+ - Defined interfaces for loading modules and retreiving entries
+ - Module scoping now includes Textual Conventions
+ - Tokens implemented internally no longer require importing the
+ corresponding modules
+
+1997-04-22 11:49 whardake
+
+ * agent/mibgroup/versioninfo.c, bug-report,
+ sedscript.in:
+
+ version tag ( 3.1.4.pre5 )
+
+1997-04-22 08:43 whardake
+
+ * config.h.in, configure, configure.in,
+ agent/mibgroup/smux.c:
+
+ - (config*, smux.c): Check for headers and define FD_COPY if not defined.
+
+1997-04-22 07:41 whardake
+
+ * agent/mibgroup/: smux.c, smux.h, snmp_bgp.c,
+ snmp_ospf.c, snmp_rip2.c:
+
+ - (snmp_bgp.c, snmp_rip2.c, snmp_ospf.c, smux.[ch]):
+ - standardize headers for autoconf.
+ - smux_init() -> init_smux().
+ - SMUXDEBUG -> DODEBUG (--enable-debugging turns this on automatically).
+
+1997-04-22 06:51 whardake
+
+ * agent/mibgroup/: snmp_bgp.c, snmp_bgp.h, snmp_ospf.c
+, snmp_ospf.h, snmp_rip2.c, snmp_rip2.h:
+
+ - (snmp_bgp.[ch], snmp_rip2.[ch], snmp_ospf.[ch]):
+ - conform to new module standards of coding.
+
+1997-04-22 06:47 whardake
+
+ * agent/common_header.h:
+
+ - (common_header.h): remove duplicate (warning) TCP defines on osf4 systems.
+
+1997-04-22 06:20 whardake
+
+ * agent/mibgroup/: README.smux, smux.c, smux.h,
+ snmp_bgp.c, snmp_ospf.c, snmp_rip2.c:
+
+ - (README.smux, smux.c, smux.h, snmp_bgp.c, snmp_ospf.c, snmp_rip2.c):
+ - smux support for gated from Rohit Dube.
+
+1997-04-22 06:02 whardake
+
+ * apps/snmpbulkwalk.c, apps/snmpget.c,
+ apps/snmpgetnext.c, apps/snmpset.c, apps/snmptest.c
+, apps/snmptrap.c, apps/snmptrapd.c,
+ apps/snmpwalk.c, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/route.c, snmplib/mib.c,
+ snmplib/snmp_api.c, snmplib/snmp_api.h:
+
+ - (many): Patch from Niels Baggesen to fix various things, mostly on linux.
+
+1997-04-22 05:59 whardake
+
+ * maketarget, agent/common_header.h, agent/kernel.c
+, agent/snmp_agent.c, agent/snmp_vars.linux.h,
+ agent/snmpd.c, agent/mibgroup/at.c,
+ agent/mibgroup/disk.c, agent/mibgroup/errormib.c,
+ agent/mibgroup/icmp.c, agent/mibgroup/icmp.h,
+ agent/mibgroup/interfaces.c, agent/mibgroup/interfaces.h
+, agent/mibgroup/ip.c, agent/mibgroup/ip.h,
+ agent/mibgroup/loadave.c, agent/mibgroup/memory.c,
+ agent/mibgroup/route_write.c, agent/mibgroup/snmp_mib.c
+, agent/mibgroup/snmp_mib.h, agent/mibgroup/system.c
+, agent/mibgroup/tcp.c, agent/mibgroup/tcp.h,
+ agent/mibgroup/udp.c, agent/mibgroup/udp.h,
+ agent/mibgroup/var_route.c, agent/mibgroup/var_route.h:
+
+ - (many): Patch from Niels Baggesen to fix various things, mostly on linux.
+
+1997-04-21 23:42 whardake
+
+ * FAQ:
+
+ - (FAQ): various updates.
+
+1997-03-26 08:05 whardake
+
+ * agent/mibgroup/system.c:
+
+ - (mibgroup/system.c): report agent uptime rather than system uptime.
+
+1997-03-25 04:30 whardake
+
+ * INSTALL:
+
+ - (INSTALL): minor doc update for new flags.
+
+1997-03-25 00:39 whardake
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): added syslocation and syscontact examples.
+
+1997-03-24 04:56 whardake
+
+ * FAQ:
+
+ - (FAQ): Patch from Dave Shield.
+
+1997-03-24 00:51 whardake
+
+ * README:
+
+ - (README): runs on bsdi 2.1.
+
+1997-03-24 00:51 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in): Watch out for multiple spaces in C defs.
+
+1997-03-24 00:50 whardake
+
+ * agent/mibgroup/: example.c, example.h:
+
+ - (example.c,.h): New example mib module duplicating the passtest
+ script in C code.
+
+1997-03-24 00:49 whardake
+
+ * agent/mibgroup/memory.c:
+
+ - (memory.c): prototype write function better.
+
+1997-03-18 07:53 whardake
+
+ * FAQ:
+
+ - (FAQ): snmp.conf -> snmpd.conf
+
+1997-03-18 07:52 whardake
+
+ * FAQ:
+
+ - (FAQ): Update from Dave Shield.
+
+1997-03-14 07:16 whardake
+
+ * agent/mibgroup/README:
+
+ - (mibgroup/README): Update from Dave Shield.
+
+1997-03-14 04:55 whardake
+
+ * agent/mibgroup/versioninfo.c, sedscript.in,
+ bug-report:
+
+ version tag ( 3.1.4.pre4 )
+
+1997-03-14 04:54 whardake
+
+ * acconfig.h, config.h.in, mibs/ucd-snmp.txt:
+
+ - (acconfig.h, ucd-snmp.txt): recognize new hosts for sysObjectId.
+
+1997-03-14 04:53 whardake
+
+ * snmplib/context_parse.c, snmplib/party_parse.c,
+ snmplib/system.c, snmplib/system.h, agent/snmpd.c
+:
+
+ - (snmpd.c, context_parse.c, party_parse.c, system.[ch]):
+ - 64bit fix: get_myaddr() should return int not long.
+
+1997-03-14 04:51 whardake
+
+ * configure, configure.in, apps/Makefile.in:
+
+ - (configure.in, apps/Makefile.in): fix trap by including optional .o files.
+
+1997-03-14 02:22 whardake
+
+ * agent/snmp_groupvars.h:
+
+ - (snmp_groupvars.h): axe.
+
+1997-03-14 02:20 whardake
+
+ * agent/snmp_vars_event.h:
+
+ - (snmp_vars_event.h): axe.
+
+1997-03-14 02:18 whardake
+
+ * agent/Makefile.in, apps/snmpnetstat/Makefile.in:
+
+ - (agent/Makefile.in, apps/snmpnetstat/Makefile.in): make depend.
+
+1997-03-14 02:17 whardake
+
+ * makedepend.in:
+
+ - (makedepend.in): run on snmpnetstat dir also.
+
+1997-03-14 02:07 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in): Fix sedscript to include s# as well as s/ commands.
+
+1997-03-14 02:01 whardake
+
+ * man/snmpd.1.def:
+
+ - (snmpd.1.def): Updated to include -c/-C and SNMPCONFPATH env var.
+
+1997-03-14 01:49 whardake
+
+ * mibs/ucd-snmp.txt:
+
+ - (ucd-snmp.txt): remove the last of the sed script defs.
+
+1997-03-14 01:48 whardake
+
+ * Makefile.in, configure, configure.in,
+ mibs/Makefile.in:
+
+ - (Makefile.in, config*, mibs/Makefile.in): enable mibs/ make install.
+
+1997-03-14 00:49 whardake
+
+ * mibs/: rfc1271.txt, snmpv2.txt, ucd-snmp.txt:
+
+ - (mibs/{rfc1271,snmpv2,ucd-snmp}.txt): New mibs directory for sub-mibs.
+
+1997-03-14 00:47 whardake
+
+ * mib.txt:
+
+ - (mib.txt): streamed down.
+
+1997-03-14 00:46 whardake
+
+ * ucd-snmp.txt:
+
+ - (ucd-snmp.txt): moved to mibs/.
+
+1997-03-14 00:38 whardake
+
+ * Makefile.in, ece-mib.def, mib.txt, mibII.txt
+, ucd-snmp.txt:
+
+ - (ucd-snmp.txt, mib.txt, Makefile.in): Don't build mib files anymore.
+
+1997-03-13 08:45 whardake
+
+ * maketarget, agent/kernel.c, agent/kernel.h,
+ agent/snmp_agent.c, agent/snmp_vars.c, agent/snmpd.c
+, agent/snmpd.h, agent/mibgroup/at.c,
+ agent/mibgroup/icmp.c, agent/mibgroup/interfaces.c,
+ agent/mibgroup/interfaces.h, agent/mibgroup/ip.c,
+ agent/mibgroup/loadave.c, agent/mibgroup/tcp.c,
+ agent/mibgroup/udp.c, agent/mibgroup/var_route.c,
+ apps/snmpstatus.c, apps/snmptrap.c, apps/snmptrapd.c
+, apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c
+, apps/snmpnetstat/main.c, apps/snmpnetstat/netstat.h
+, apps/snmpnetstat/route.c, man/snmpd.1.def,
+ man/snmpnetstat.1, snmplib/mib.c, snmplib/snmp_api.c
+, snmplib/snmp_client.c:
+
+ - (many): Patch from Niels Baggensen:
+ - A large number of problems with the Linux port
+ - Some problems with NetBSD 1.2C, but it's still not perfect
+ - More (symbolic) debug output from snmpd, when using -V. -d implies -V
+ Shows you variable requested and value returned
+ - Return ipRouteMask under Solaris
+ - snmpnetstat -r shows non-standard netmasks
+ - snmpnetstat -o (new) shows interface octets, without enquiring for mtu
+ and other variables not present for a Cisco Frame-Relay virtual circuit
+ interface
+ - snmpnetstat tcp/udp print-out had ntohs/htons in wrong places for port
+ numbers (shows up on little-endian architectures)
+ - adds a maketarget script that can be used to create a parallel symlinked
+ source directory. Useful if your make does not support VPATH
+
+1997-03-13 08:17 whardake
+
+ * agent/common_header.h:
+
+ - (common_header.h): fix path to alarm.h.
+
+1997-03-13 07:17 whardake
+
+ * apps/: Makefile.in, snmpnetstat/Makefile.in:
+
+ - (apps/*/Makefile.in): depend problems fix.
+
+1997-03-13 07:10 whardake
+
+ * configure, configure.in:
+
+ - (config*): remove duplicate gethostname check.
+
+1997-03-13 07:07 whardake
+
+ * Makefile.in, agent/Makefile.in,
+ agent/mibgroup/Makefile.in, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in, snmplib/Makefile.in:
+
+ - (*/Makefile.in): make depend and rule fixes as well.
+
+1997-03-13 06:45 whardake
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in,
+ apps/Makefile.in, apps/snmpnetstat/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (*/Makefile.in): New make depend rules to seperate system/non dependent stuff.
+
+1997-03-13 06:45 whardake
+
+ * configure, configure.in:
+
+ - (config*): check for system dependent modules.
+
+1997-03-13 06:36 whardake
+
+ * agent/mibgroup/: view_vars.c, context_vars.c,
+ acl_vars.c:
+
+ - (view_vars.c, context_vars.c, acl_vars.c): don't include snmpv2_vars.h.
+
+1997-03-13 06:35 whardake
+
+ * agent/mibgroup/: hpux.c, memory.c, memory.h:
+
+ - (hpux.c, memory.c, memory.h): Patch from Dave Shields to fix minor problems.
+
+1997-03-13 05:44 whardake
+
+ * agent/: Makefile.in, acl.conf, kernel_sunos5.c
+, kernel_sunos5.h, route_write.c,
+ snmp_var_route.c, mibgroup/kernel_sunos5.c,
+ mibgroup/kernel_sunos5.h:
+
+ - (kernel_sunos5.[ch]): moved to mibgroup/.
+ - (route_write.c, snmp_var_route.c): delete from agent dir.
+
+1997-03-13 05:34 whardake
+
+ * agent/: Makefile.in, acl_vars.c, alarm.c,
+ alarm.h, common_header.h, context_vars.c, event.c
+, event.h, party_vars.c, snmp_vars.c,
+ snmpd.c, view_vars.c, mibgroup/acl_vars.c,
+ mibgroup/acl_vars.h, mibgroup/alarm.c, mibgroup/alarm.h
+, mibgroup/context_vars.c, mibgroup/context_vars.h
+, mibgroup/event.c, mibgroup/event.h,
+ mibgroup/party_vars.c, mibgroup/party_vars.h,
+ mibgroup/snmpv2_subtrees.h, mibgroup/snmpv2_vars.h,
+ mibgroup/view_vars.c, mibgroup/view_vars.h:
+
+ - (agent/*, mibgroup/*): moved alarm, context, views, event, party,
+ and acl variable groups to mibgroup/.
+
+1997-03-13 01:14 whardake
+
+ * agent/mibgroup/extensible_subtrees.h:
+
+ - (extensible_subtrees.h): Removed file.
+
+1997-03-13 00:37 whardake
+
+ * apps/snmpnetstat/main.c, snmplib/party_parse.c:
+
+ - (config*): check for in_addr_t and define as u_int (32 bits) if not present.
+ - (apps/*.c, party_parse.c): use it.
+
+1997-03-13 00:32 whardake
+
+ * Makefile.in, acconfig.h, config.h.in,
+ configure, configure.in, apps/snmpbulkwalk.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, apps/snmptest.c,
+ apps/snmptrap.c, apps/snmpwalk.c:
+
+ - (config*): check for in_addr_t and define as u_int (32 bits) if not present.
+ - (apps/*.c, party_parse.c): use it.
+
+1997-03-12 08:15 whardake
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): returns from inet_addr are in_addr_t (u_int) not u_long.
+
+1997-03-12 06:55 whardake
+
+ * agent/mibgroup/README:
+
+ - (mibgroup/README): doc update from Dave Shield.
+
+1997-03-12 06:48 whardake
+
+ * apps/snmpnetstat/Makefile.in, apps/Makefile.in,
+ agent/Makefile.in:
+
+ - (*/Makefile.in): make depend update.
+
+1997-03-12 06:45 whardake
+
+ * configure, configure.in, agent/snmp_agent.c,
+ agent/snmpd.c, agent/mibgroup/Makefile.in,
+ agent/mibgroup/ip.c, agent/mibgroup/ip.h,
+ agent/mibgroup/route_write.c, agent/mibgroup/route_write.h
+, agent/mibgroup/snmp.c, agent/mibgroup/snmp.h,
+ agent/mibgroup/snmp_mib.c, agent/mibgroup/var_route.c,
+ agent/mibgroup/var_route.h:
+
+ - (configure.in, snmpd.c, snmp_agent.c, route_write.[ch],
+ var_route.[ch], ip.[ch], snmp.[ch] -> snmp_mib.[ch]):
+ - Moved snmp mib module -> snmp_mib for naming conflicts with snmplib.
+ - Moved snmp_var_route.c -> mibgroup/var_route.c
+ - Moved write_route.c -> mibgroup/write_route.c
+
+1997-03-12 00:28 whardake
+
+ * agent/mibgroup/: snmp_mib.c, snmp_mib.h:
+
+ - (mibgroup/snmp.[hc] -> mibgroup/snmp_mib.[hc]): Moved due to name clashes.
+
+1997-03-11 08:36 whardake
+
+ * agent/mibgroup/at.h, agent/mibgroup/icmp.c,
+ agent/mibgroup/interfaces.c, agent/mibgroup/ip.c,
+ agent/mibgroup/snmp.c, agent/mibgroup/snmp.h,
+ agent/mibgroup/system.c, agent/mibgroup/tcp.c,
+ agent/mibgroup/udp.c, agent/mibgroup/wombat.c,
+ acconfig.h, config.h.in, configure,
+ configure.in, agent/route_write.c,
+ agent/snmp_var_route.c, snmplib/mib.c:
+
+ - (mibgroup/*):
+ - remove trailing ;s on bunches of functions.
+ - make everything but interfaces.c compile on irix6.3.
+ - (config*,system.c): use uname and gethostname if available.
+ - (configure.in, configure): Don't check _KERNEL if ifnet.if_mtu already works.
+
+1997-03-11 00:04 whardake
+
+ * agent/mibgroup/ip.c:
+
+ - (ip.c): freebsd2 patch.
+
+1997-03-10 08:28 whardake
+
+ * configure, configure.in:
+
+ - (configure.in): space protect modules when checking for with grep.
+
+1997-03-10 07:55 whardake
+
+ * configure, configure.in:
+
+ - (configure.in): New configure option: --with-out-mib-modules="list".
+
+1997-03-07 07:11 whardake
+
+ * agent/common_header.h:
+
+ - (common_header.h): comment out end of #endif.
+
+1997-03-07 07:09 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (config*): make new configure options respect $(srcdir).
+
+1997-03-07 06:02 whardake
+
+ * configure, configure.in:
+
+ - (configure): removed {} requirement from config_load_mib() calls.
+
+1997-03-07 06:00 whardake
+
+ * agent/mibgroup/: at.h, disk.h, errormib.h,
+ extensible.h, icmp.h, interfaces.h, ip.h,
+ loadave.h, memory.h, proc.h, snmp.h,
+ system.h, tcp.h, udp.h, versioninfo.h,
+ wombat.h:
+
+ - (mibgroup/*): removed {} requirement from config_load_mib() calls.
+
+1997-03-07 05:01 whardake
+
+ * agent/mibgroup/versioninfo.c, sedscript.in,
+ bug-report:
+
+ version tag ( 3.1.4.pre3 )
+
+1997-03-07 04:51 whardake
+
+ * snmplib/snmp.c:
+
+ - (snmplib/snmp.c): remove second ctype.h include.
+
+1997-03-07 04:50 whardake
+
+ * agent/mibgroup/hpux.c:
+
+ - (hpux.c): ifdef a few headers for correct make depend.
+
+1997-03-07 04:49 whardake
+
+ * agent/mibgroup/Makefile.in, snmplib/Makefile.in,
+ apps/Makefile.in:
+
+ - (mibgroup/Makefile.in, apps/Makefile.in, snmplib/Makefile.in): depend.
+
+1997-03-07 04:48 whardake
+
+ * agent/: snmp_agent.c, snmp_vars.c, snmpd.c:
+
+ - (snmp_agent.c, snmp_vars.c, snmpd.c): remove extproto.h include.
+
+1997-03-07 04:47 whardake
+
+ * agent/Makefile.in:
+
+ - (agent/Makefile.in): make depend and extensible/ removes.
+
+1997-03-07 04:46 whardake
+
+ * Makefile.in, config.h.in, sedscript.in:
+
+ - (Makefile.in, sedscript.in): Fix sedscript generation. sigh.
+
+1997-03-07 04:44 whardake
+
+ * .cvsignore:
+
+ - (.cvsignore): add mib_module_config.h
+
+1997-03-07 04:40 whardake
+
+ * remove-files:
+
+ - (remove-files): add makedepend.in
+
+1997-03-07 04:39 whardake
+
+ * makedepend.in:
+
+ - (makedepend.in): new make depend script
+
+1997-03-07 02:42 whardake
+
+ * acconfig.h, configure, configure.in:
+
+ - (config*): generate a mib_module_config.h with defines of whats being used.
+
+1997-03-07 01:49 whardake
+
+ * agent/mibgroup/struct.h:
+
+ - (mibgroup/struct.h): moved to here.
+
+1997-03-07 01:34 whardake
+
+ * agent/mibgroup/: hpux.c, hpux.h:
+
+ - (hpux.[ch]): Added hpux specific files from extensible dir.
+
+1997-03-07 01:07 whardake
+
+ * agent/mibgroup/versiontag:
+
+ - (mibmodule/versiontag): moved into place from extensible/
+
+1997-03-07 00:58 whardake
+
+ * agent/: snmp_vars.h, mibgroup/disk.c, mibgroup/disk.h
+, mibgroup/errormib.c, mibgroup/errormib.h,
+ mibgroup/extensible.c, mibgroup/extensible.h,
+ mibgroup/ip.c, mibgroup/ip.h, mibgroup/loadave.c,
+ mibgroup/loadave.h, mibgroup/pass.c, mibgroup/pass.h
+, mibgroup/proc.c, mibgroup/proc.h,
+ mibgroup/read_config.c, mibgroup/read_config.h,
+ mibgroup/snmp.c, mibgroup/system.c,
+ mibgroup/util_funcs.c, mibgroup/util_funcs.h:
+
+ - (snmp_vars.h, mibgroup/*): strict-prototyping and config_require()s.
+
+1997-03-07 00:07 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): removed more non-mibgroup specific calls and headers.
+
+1997-03-07 00:05 whardake
+
+ * agent/: mibgroup/Makefile.in, mibgroup/disk.c,
+ mibgroup/disk.h, mibgroup/errormib.c,
+ mibgroup/errormib.h, mibgroup/extensible.c,
+ mibgroup/extensible.h, mibgroup/loadave.c,
+ mibgroup/loadave.h, mibgroup/memory.c,
+ mibgroup/memory.h, mibgroup/mibdefs.h,
+ mibgroup/mibincl.h, mibgroup/pass.c, mibgroup/pass.h
+, mibgroup/proc.c, mibgroup/proc.h,
+ mibgroup/read_config.c, mibgroup/read_config.h,
+ mibgroup/system.c, mibgroup/system.h,
+ mibgroup/util_funcs.c, mibgroup/util_funcs.h,
+ mibgroup/versioninfo.c, mibgroup/versioninfo.h,
+ Makefile.in:
+
+ - (extensible/* -> mibgroup/*): moved extensible stuff to mib modules.
+
+1997-03-05 07:29 whardake
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Yep. It was wrong. Tested and works now.
+
+1997-03-05 07:15 whardake
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): fixed prototyping errors in snmp_parse. Possibly wrong.
+
+1997-03-05 07:13 whardake
+
+ * agent/acl_vars.c:
+
+ - (acl_vars.c): incorrectly fixed prototyping errors for write_acl().
+
+1997-03-05 06:05 whardake
+
+ * snmplib/: acl.c, acl.h, acl_parse.c, asn1.c
+, asn1.h, context.c, context.h,
+ context_parse.c, md5.c, md5.h, mib.c,
+ mib.h, parse.c, parse.h, party.c, party.h
+, party_parse.c, snmp.h, snmp_api.c,
+ snmp_api.h, snmp_auth.c, snmp_client.c,
+ snmp_client.h, snmp_impl.h, system.c, system.h
+, view.c, view.h:
+
+ - (*.c, *.h): Patch from Niels Baggesen to prototype *everything*.
+
+1997-03-05 06:01 whardake
+
+ * agent/mibgroup/at.c, agent/mibgroup/at.h,
+ agent/mibgroup/icmp.c, agent/mibgroup/icmp.h,
+ agent/mibgroup/interfaces.c, agent/mibgroup/interfaces.h
+, agent/mibgroup/ip.c, agent/mibgroup/ip.h,
+ agent/mibgroup/snmp.c, agent/mibgroup/snmp.h,
+ agent/mibgroup/snmpv2_vars.h, agent/mibgroup/system.c,
+ agent/mibgroup/system.h, agent/mibgroup/tcp.c,
+ agent/mibgroup/tcp.h, agent/mibgroup/udp.c,
+ agent/mibgroup/udp.h, apps/snmpbulkwalk.c,
+ apps/snmpget.c, apps/snmpgetnext.c, apps/snmpset.c
+, apps/snmpstatus.c, apps/snmptest.c,
+ apps/snmptranslate.c, apps/snmptrap.c,
+ apps/snmptrapd.c, apps/snmpwalk.c,
+ apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/route.c:
+
+ - (*.c, *.h): Patch from Niels Baggesen to prototype *everything*.
+
+1997-03-05 05:58 whardake
+
+ * acconfig.h, config.h.in, agent/acl_vars.c,
+ agent/alarm.c, agent/alarm.h, agent/common_header.h
+, agent/context_vars.c, agent/event.c,
+ agent/event.h, agent/kernel.h, agent/party_vars.c
+, agent/route_write.c, agent/snmp_agent.c,
+ agent/snmp_var_route.c, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmp_vars_event.h,
+ agent/snmpd.c, agent/snmpd.h, agent/var_struct.h
+, agent/view_parse.c, agent/view_vars.c:
+
+ - (*.c, *.h): Patch from Niels Baggesen to prototype *everything*.
+
+1997-03-05 02:37 whardake
+
+ * README:
+
+ - (README): Contributer name addition.
+
+1997-03-05 02:28 whardake
+
+ * agent/snmpd.h:
+
+ file snmpd.h was initially added on branch Ext-3-1-4-pre2-niels.
+
+1997-03-05 02:28 whardake
+
+ * agent/kernel.h:
+
+ file kernel.h was initially added on branch Ext-3-1-4-pre2-niels.
+
+1997-03-05 02:17 whardake
+
+ * snmplib/snmp_client.c:
+
+ - (snmp_client.c): Patch from Elwyn B Davies:
+ - Fix a PDU cloning bug.
+
+1997-03-05 01:04 whardake
+
+ * agent/mibgroup/.cvsignore:
+
+ - (mibgroup/.cvsignore): new to ignore created .h files.
+
+1997-03-05 01:03 whardake
+
+ * agent/mibgroup/system.c:
+
+ - (system.c): removed system nlist (unused).
+
+1997-03-05 00:48 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/Makefile.in,
+ agent/common_header.h, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/mibgroup/Makefile.in,
+ agent/mibgroup/at.h, agent/mibgroup/icmp.h,
+ agent/mibgroup/interfaces.h, agent/mibgroup/ip.h,
+ agent/mibgroup/snmp.c, agent/mibgroup/snmp.h,
+ agent/mibgroup/system.c, agent/mibgroup/system.h,
+ agent/mibgroup/tcp.h, agent/mibgroup/udp.h,
+ agent/mibgroup/wombat.h:
+
+ - (config*, agent/*, agent/mibgroup/*):
+ - Added .o file list to agent/Makefile.in generated by configure.
+ - new files generated by configure:
+ - mibgroup/mib_module_includes.h: A list of mib .h files for snmp_vars.h.
+ (every module *must* have a .h file)
+ - mibgroup/mib_module_inits.h: A list of init_wombat() type functions.
+ (only present if exist in wombat.c).
+ - mibgroup/mib_module_loads.h: This file is generated by a new macro in
+ the mib.h files called
+ config_load_mib(), which simplifies
+ the loading of the mib sections.
+
+1997-03-04 06:44 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/mibgroup/Makefile.in:
+
+ - (config*, mibgroup/Makefile.in):
+ - mibgroup compile list is build by configure and can be augmented
+ by the --with-mib-modules="list of modules" command line to configure.
+
+1997-02-17 07:11 whardake
+
+ * sedscript.in, bug-report:
+
+ version tag ( 3.1.4.pre2 )
+
+1997-02-17 06:32 whardake
+
+ * agent/mibgroup/interfaces.c:
+
+ - (interfaces.c): Remove MAX_NAME_LENGTH requirements.
+
+1997-02-17 06:31 whardake
+
+ * agent/mibgroup/icmp.c:
+
+ - (icmp.c): don't use ret variable, since it's not defined.
+
+1997-02-17 06:30 whardake
+
+ * agent/event.c:
+
+ - (event.c): Was passing an int to bcopy instead of &int.
+
+1997-02-17 06:30 whardake
+
+ * agent/alarm.c:
+
+ - (alarm.c): typedef for getStatPtr().
+
+1997-02-17 05:53 whardake
+
+ * agent/: Makefile.in, mibgroup/Makefile.in:
+
+ - (agent/*Makefile.in): Make depend.
+
+1997-02-17 05:47 whardake
+
+ * snmplib/: mib.c, snmp_api.c, snmp_api.h:
+
+ - (mib.c, snmp_api.c, snmp_api.h): Patch from Dave Shield to remove
+ ANSI specific requirements.
+
+1997-02-17 05:46 whardake
+
+ * agent/mibgroup/.cvsignore:
+
+ - (agent/mibgroup/.cvsignore): Added.
+
+1997-02-17 05:38 whardake
+
+ * configure, configure.in, agent/Makefile.in,
+ agent/common_header.h, agent/snmp_agent.c,
+ agent/snmp_var_route.c, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmpd.c, agent/var_struct.h
+, agent/mibgroup/Makefile.in, agent/mibgroup/README
+, agent/mibgroup/at.c, agent/mibgroup/at.h,
+ agent/mibgroup/extensible_subtrees.h, agent/mibgroup/icmp.c
+, agent/mibgroup/icmp.h, agent/mibgroup/interfaces.c
+, agent/mibgroup/interfaces.h, agent/mibgroup/ip.c
+, agent/mibgroup/ip.h, agent/mibgroup/snmp.c,
+ agent/mibgroup/snmp.h, agent/mibgroup/snmpv2_subtrees.h
+, agent/mibgroup/snmpv2_vars.h, agent/mibgroup/system.c
+, agent/mibgroup/system.h, agent/mibgroup/tcp.c,
+ agent/mibgroup/tcp.h, agent/mibgroup/udp.c,
+ agent/mibgroup/udp.h, agent/mibgroup/wombat.c,
+ agent/mibgroup/wombat.h:
+
+ - (agent/snmp_vars, agent/mibgroup): Dave Shield split up the
+ snmp_vars.c and related files into pieces for easier management.
+ The results of his work are in the new agent/mibgroup directory.
+
+1997-02-11 08:00 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in): Rest of Philip's patch to fix srcdir problems (sh vars).
+
+1997-02-11 07:44 whardake
+
+ * man/Makefile.in:
+
+ - (man/Makefile.in): Patch from Simon Leinin to fix srcdir problems.
+
+1997-02-11 07:42 whardake
+
+ * apps/Makefile.in:
+
+ - (apps/Makefile.in): Patch from Simon Leinin to descend when make cleaning.
+
+1997-02-11 05:14 whardake
+
+ * sedscript.in, bug-report:
+
+ version tag ( 3.1.4.pre1 )
+
+1997-02-11 05:13 whardake
+
+ * snmplib/snmp_auth.c:
+
+ - (snmp_auth.c): remove non-static md5digest prototype.
+
+1997-02-11 05:11 whardake
+
+ * local/Makefile.in, man/Makefile.in, ov/Makefile.in
+:
+
+ - ({local,man,ov}/Makefile.in): Remove spaces in front of tabs.
+
+1997-02-11 05:10 whardake
+
+ * agent/snmp_vars.linux.h:
+
+ - (snmp_vars.linux.h): Fix #ifdef.
+
+1997-02-11 04:17 whardake
+
+ * agent/snmpd.c, apps/snmpbulkwalk.c, apps/snmpget.c
+, apps/snmpgetnext.c, apps/snmpset.c,
+ apps/snmpstatus.c, apps/snmptest.c,
+ apps/snmptranslate.c, apps/snmptrap.c, apps/snmptrapd.c
+, apps/snmpwalk.c, apps/snmpnetstat/main.c,
+ snmplib/acl.c, snmplib/acl.h, snmplib/acl_parse.c
+, snmplib/context.c, snmplib/context.h,
+ snmplib/context_parse.c, snmplib/md5.c, snmplib/mib.c
+, snmplib/party.c, snmplib/party.h,
+ snmplib/party_parse.c, snmplib/snmp.c,
+ snmplib/snmp_api.c, snmplib/snmp_api.h,
+ snmplib/snmp_auth.c, snmplib/view.c, snmplib/view.h
+:
+
+ - (all .c with main(), snmplib/*): Patch from Philip Guenther:
+ - Make better support for shared lib possibilities.
+
+1997-02-11 04:12 whardake
+
+ * README:
+
+ - (README): Update people supplying patches list.
+
+1997-02-11 04:10 whardake
+
+ * Makefile.in, agent/Makefile.in, apps/Makefile.in
+, apps/snmpnetstat/Makefile.in, local/Makefile.in
+, man/Makefile.in, ov/Makefile.in,
+ snmplib/Makefile.in:
+
+ - (*Makefile.in): Patch from Philip Guenther:
+ - Fix all Makefile.in's to support a different src dir.
+
+1997-02-11 03:54 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Patch from Dave Shield: Fix hpux specific problems.
+
+1997-02-11 03:50 whardake
+
+ * agent/snmp_vars.linux.h:
+
+ - (snmp_vars.linux.h): Removed non-linux specific stuff.
+
+1997-02-11 03:47 whardake
+
+ * agent/: snmp_var_route.c, snmp_vars.c,
+ snmp_vars.linux.h:
+
+ - (snmp_vars.c, snmp_var_route.c, snmp_vars.linux.h): Patch from Jennifer Bray:
+ - Get agent working on linux.
+
+1997-02-10 00:54 whardake
+
+ * NEWS:
+
+ - (NEWS): Whoops.
+
+1997-02-10 00:51 whardake
+
+ * sedscript.in, bug-report:
+
+ version tag ( 3.1.3 )
+
+1997-02-10 00:50 whardake
+
+ * ChangeLog:
+
+ - (ChangeLog): Update for 3.1.3
+
+1997-02-10 00:22 whardake
+
+ * apps/snmpnetstat/main.c:
+
+ - (snmpnetstat/main.c): Remove malloc prototype, now in stdlib.h.
+
+1997-02-10 00:22 whardake
+
+ * FAQ:
+
+ - (FAQ): Dave Shields' additions: finding more info.
+
+1997-02-05 08:41 whardake
+
+ * sedscript.in, bug-report:
+
+ version tag ( 3.1.3.pre4 )
+
+1997-02-05 08:29 whardake
+
+ * Makefile.in, configure, configure.in:
+
+ - (Makefile.in, configure.in): removed tcl stuff.
+
+1997-02-05 08:24 whardake
+
+ * NEWS, local/snmpcheck.def:
+
+ - (NEWS): removed tcl stuff.
+
+1997-02-05 08:20 whardake
+
+ * bug-report:
+
+ - (bug-report): Change subject line to shorten and force better description.
+
+1997-02-05 08:13 whardake
+
+ * snmplib/system.c:
+
+ - (system.c): Patch from Dave Shield to fix nlist problems.
+
+1997-02-05 08:09 whardake
+
+ * agent/snmp_agent.c, agent/snmp_groupvars.h,
+ agent/snmp_var_route.c, agent/snmp_vars.c,
+ agent/snmpd.c, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/route.c, man/snmpd.conf.5.def:
+
+ - (many): Patch from Niels Baggesen:
+ - snmp mib group cleanups.
+ - trap generation cleanups.
+ - added man entries for trap generation.
+ - improved agent debugging output with agent's -d flag.
+
+1997-02-05 08:07 whardake
+
+ * configure, configure.in:
+
+ - (configure, configure.in): Put /dev/ksyms ahead of /kernel/unix.
+
+1997-02-05 07:33 whardake
+
+ * TODO:
+
+ - (TODO): misc requested additions.
+
+1997-02-05 07:33 whardake
+
+ * FAQ:
+
+ - (FAQ): Dave updated architecture lists.
+
+1997-02-04 00:41 whardake
+
+ * FAQ:
+
+ - (FAQ): Added TOC and autor notes ;-).
+
+1997-02-04 00:37 whardake
+
+ * snmplib/mib.c:
+
+ - (mib.c): Patch from Simon: comment #ifdef endings for ANSI compliers.
+
+1997-02-04 00:36 whardake
+
+ * configure, configure.in:
+
+ - (configure, configure.in): Fix hpux problems, *again*.
+
+1997-02-04 00:35 whardake
+
+ * TODO:
+
+ - (TODO): Added suggestions from ucd-snmp-coders.
+
+1997-02-04 00:35 whardake
+
+ * FAQ:
+
+ - (FAQ): Dave's latest revision.
+
+1997-02-03 04:55 whardake
+
+ * sedscript.in, bug-report:
+
+ version tag ( 3.1.3.pre3 )
+
+1997-02-03 04:53 whardake
+
+ * bug-report:
+
+ - (bug-report): move config.cache to end of message.
+
+1997-02-03 04:33 whardake
+
+ * NEWS, README, TODO:
+
+ - (README, NEWS, TODO): Update for 3.1.3.
+
+1997-02-03 04:15 whardake
+
+ * README:
+
+ - (README):
+ - added FAQ pointer.
+ - Dave's English pointers (ie, he proofed it and I, uh, don't...).
+ - switch ftp mirror.
+ - bug-report script mentioned.
+ - I -> We, me -> us...
+
+1997-02-03 03:51 whardake
+
+ * README:
+
+ - (README): remove project history.
+
+1997-02-03 03:47 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): add some irix appropriate includes.
+
+1997-02-03 03:44 whardake
+
+ * snmplib/system.c:
+
+ - (snmplib/system.c): typo: needs a space between 'static' and 'struct'.
+
+1997-02-03 02:50 whardake
+
+ * acconfig.h, aclocal.m4, config.h.in,
+ configure, configure.in:
+
+ - (config*):
+ - Check for irix 6.2 headers.
+ - Check if _KERNEL needs to be defined for irix and ifnet usage.
+ - Use the found UNAME program instead of assuming we have it.
+
+1997-02-03 01:48 whardake
+
+ * snmplib/system.c:
+
+ - (snmplib/system.c): Use CAN_USE_SYSCTL instead of bsdlike.
+
+1997-02-03 01:47 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Patch from Dave Shield
+ - Mark stuff for later changes.
+
+1997-02-03 01:45 whardake
+
+ * configure, configure.in:
+
+ - (configure.in):
+ - Check for whoami, logname.
+ - Don't pass null args to ksh.
+
+1997-02-03 01:03 whardake
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): comment out possible security problem lines.
+
+1997-02-03 01:02 whardake
+
+ * bug-report:
+
+ - (bug-report): Patch from Dave Shield:
+ - domain name fix and editor bomb out.
+
+1997-01-31 02:03 whardake
+
+ * bug-report, sedscript.in:
+
+ version tag update
+
+1997-01-31 01:59 whardake
+
+ * configure.in, configure:
+
+ - (configure.in, configure): changed arch to hppa and make sure /bin/ksh exists.
+
+1997-01-31 01:49 whardake
+
+ * configure, configure.in:
+
+ - (configure.in, configure): fire off ksh if hpux && sh.
+
+1997-01-31 01:01 whardake
+
+ * agent/: snmp_var_route.c, snmp_vars.c:
+
+ - (snmp_var_route.c, snmp_vars.c): Patch from Martin Jacobsson:
+ - Change some system specific ifdefs to CAN_USE_SYSCTL.
+ - Fix compliation errors on bsdi2.
+ - Fix routing tables for similar.
+
+1997-01-31 00:57 whardake
+
+ * configure.in, configure, config.h.in,
+ acconfig.h:
+
+ - (config*): Check for kstat.h and if sysctl can read the boottime.
+
+1997-01-29 04:08 whardake
+
+ * bug-report:
+
+ - (bug-report):
+ - change to address (back) to ucd-snmp-coders.
+ - Add a trap on signals to remove tmp files.
+
+1997-01-29 03:58 whardake
+
+ * agent/: kernel.c, snmp_agent.c, snmpd.c:
+
+ - (kernel.c, snmp_agent.c, snmpd.c): Patch from Niels Baggesen:
+ - Fix various warnings/errors.
+ - Implement real traps.
+
+1997-01-29 03:11 whardake
+
+ * config.h.in, configure:
+
+ - (config.h.in, configure): update
+
+1997-01-29 03:11 whardake
+
+ * FAQ:
+
+ - (FAQ): revision one!
+
+1997-01-29 03:10 whardake
+
+ * configure.in:
+
+ - (configure.in): New ps options to check for.
+
+1997-01-29 03:09 whardake
+
+ * aclocal.m4:
+
+ - (aclocal.m4): Fix check_struct_for to define things correctly.
+
+1997-01-29 03:08 whardake
+
+ * .cvsignore:
+
+ - (.cvsignore): ignore .software.db.sh
+
+1997-01-29 03:07 whardake
+
+ * acconfig.h:
+
+ - (acconfig.h):
+ - SNMPBLOCK = !SNMPBLOCK
+
+1997-01-29 03:07 whardake
+
+ * bug-report:
+
+ - (bug-report):
+ - Always use multipart: version info and config.cache are one.
+ - re-arranged a bit.
+ - Added introduction.
+ - Guess at domain name if possible.
+
+1997-01-29 01:47 whardake
+
+ * bug-report:
+
+ bug reporting script add
+
+1997-01-21 00:17 whardake
+
+ * agent/: snmp_var_route.c, snmp_vars.c:
+
+ - (snmp_var_route.c, snmp_vars.c):
+ - Patch from Karl Lehenbauer <karl@hammer1.ops.NeoSoft.com>
+ - handle multiple interface names > 10 properly.
+
+1997-01-20 23:34 whardake
+
+ * snmplib/snmp_client.h:
+
+ - (snmp_client.h): remove second (wrong) function prototype.
+
+1997-01-20 23:33 whardake
+
+ * agent/snmpd.c:
+
+ - (snmpd.c): remove second char definition.
+
+1997-01-20 07:59 whardake
+
+ * sedscript.in:
+
+ version tag ( 3.1.3.pre1 )
+
+1997-01-20 07:43 whardake
+
+ * snmplib/: snmp_api.c, snmp_client.c, snmp_client.h
+:
+
+ - (snmp_api.c, snmp_client.[ch]):
+ - Patch from Patrice VANACKER <vanacker@worldnet.fr>:
+ - fix request deletions in snmp_read().
+ - added return argument to snmp_add_null_var().
+
+1997-01-20 06:55 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Patch from Martin Jacobsson <martin@exmandato.se>:
+ - add bsdi to some #ifdefs.
+
+1997-01-20 06:38 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c, extensible.c, read_config.c): Remove ANSI cpp #elif's.
+
+1997-01-20 06:36 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (config*): Autoheader is dumb: Put macro defines belowe @BOTTOM@ symbol.
+
+1997-01-20 06:22 whardake
+
+ * snmplib/snmp_client.c:
+
+ - Patches from Niels Baggesen <Niels.Baggesen@uni-c.dk>:
+ - (snmp_client.c): Wait 120 seconds before returning.
+
+1997-01-20 06:08 whardake
+
+ * apps/snmpnetstat/if.c, apps/snmpnetstat/route.c,
+ man/snmptrapd.8, snmplib/acl.h, snmplib/asn1.c,
+ snmplib/context.h, snmplib/mib.c, snmplib/mib.h,
+ snmplib/parse.c, snmplib/party.c, snmplib/party.h
+, snmplib/snmp.c, snmplib/snmp.h,
+ snmplib/snmp_api.c, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_client.h,
+ snmplib/system.c, snmplib/view.h:
+
+ - Patches from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - implemented: interfaces.ifTable.ifEntry.ifSpecific,
+ ip.ipRoutingDiscards,
+ ip.ipAddrTable.ipAddrEntry.ipAdEntReasmMaxSize,
+ ip.ipRouteTable.ipRouteEntry.ipRouteMask ,
+ ip.ipRouteTable.ipRouteEntry.ipRouteMetric5,
+ ip.ipRouteTable.ipRouteEntry.ipRouteInfo, ip.ipNetToMediaTable,
+ udp.udpTable.
+ - udp connection table.
+ - ipNetToMedia.
+
+ - Patches from Niels Baggesen <Niels.Baggesen@uni-c.dk>:
+ - udpNoPort, tcpInErrs fixes for Solaris.
+ - linux application support.
+ - snmp variable group.
+ - simple cold start traps via exec('snmptrap').
+ - MIB parser fixes.
+ - Memory/free allocation fixes.
+
+1997-01-20 06:04 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/alarm.h, agent/event.c,
+ agent/event.h, agent/kernel.c, agent/kernel_sunos5.c
+, agent/snmp_agent.c, agent/snmp_groupvars.h,
+ agent/snmp_var_route.c, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmpd.c, agent/var_struct.h
+, apps/snmpbulkwalk.c, apps/snmpget.c,
+ apps/snmpgetnext.c, apps/snmpset.c, apps/snmpstatus.c
+, apps/snmptest.c, apps/snmptranslate.c,
+ apps/snmptrap.c, apps/snmptrapd.c, apps/snmpwalk.c
+:
+
+ - Patches from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - implemented: interfaces.ifTable.ifEntry.ifSpecific,
+ ip.ipRoutingDiscards,
+ ip.ipAddrTable.ipAddrEntry.ipAdEntReasmMaxSize,
+ ip.ipRouteTable.ipRouteEntry.ipRouteMask ,
+ ip.ipRouteTable.ipRouteEntry.ipRouteMetric5,
+ ip.ipRouteTable.ipRouteEntry.ipRouteInfo, ip.ipNetToMediaTable,
+ udp.udpTable.
+ - udp connection table.
+ - ipNetToMedia.
+
+ - Patches from Niels Baggesen <Niels.Baggesen@uni-c.dk>:
+ - udpNoPort, tcpInErrs fixes for Solaris.
+ - linux application support.
+ - snmp variable group.
+ - simple cold start traps via exec('snmptrap').
+ - MIB parser fixes.
+ - Memory/free allocation fixes.
+
+1997-01-17 02:58 whardake
+
+ * agent/snmpd.c:
+
+ - (snmpd.c):
+ - Usage() update and version printout update.
+
+1997-01-17 02:51 whardake
+
+ * agent/snmpd.c:
+
+ - (snmpd.c, extensible.c):
+ - New arg -c FILE: Read FILE as a configuration file as well.
+ - New arg -C: Don't read default configuration files.
+ - New env SNMPCONFPATH: Read snmpd{,.local}.conf files in: seperated path.
+
+1997-01-14 07:45 whardake
+
+ * PORTING, README, TODO:
+
+ - (PORTING, README, TODO): Added ucd-snmp-coders as default mail address.
+
+1997-01-09 23:46 whardake
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): Remove broken FD_SET code.
+
+1997-01-09 23:45 whardake
+
+ * configure, configure.in:
+
+ - (config*): Check for /dev/ksyms for solaris kernel.
+
+1997-01-09 23:43 whardake
+
+ * COPYING:
+
+ - (COPYING): Update for 97.
+
+1996-12-05 00:19 whardake
+
+ * sedscript.in:
+
+ version tag ( 3.1.2.1 )
+
+1996-12-05 00:19 whardake
+
+ * ChangeLog:
+
+ - (ChangeLog): Update.
+
+1996-12-05 00:14 whardake
+
+ * snmplib/md5.c:
+
+ - (md5.c): remove ansi specific C features (unsigned constants).
+
+1996-12-05 00:13 whardake
+
+ * apps/snmpnetstat/if.c:
+
+ - (if.c): #ifndef -> #ifdef for sigset.
+
+1996-12-04 01:03 whardake
+
+ * sedscript.in:
+
+ version tag ( 3.1.2 )
+
+1996-12-04 01:01 whardake
+
+ * ChangeLog, NEWS:
+
+ - (ChangeLog, NEWS): Update for release 3.1.2.
+
+1996-12-04 00:49 whardake
+
+ * PORTING, README:
+
+ - (PORTING, README): Update for release 3.1.2.
+
+1996-12-04 00:15 whardake
+
+ * snmplib/: asn1.c, parse.c, snmp_api.c,
+ snmp_client.c:
+
+ - (asn1.c, parse.c, snmp_api.c, snmp_client.c):
+ - Patch from Niels Baggesen <Niels.Baggesen@uni-c.dk>:
+ - Parser fixes for multiple nodes.
+ - memmove/copy deletes.
+
+1996-12-03 05:51 whardake
+
+ * ece-mib.def:
+
+ - (ece-mib.def): Used -> Avail in memory sequence.
+
+1996-12-03 02:14 whardake
+
+ * EXAMPLE.conf.def, local/passtest:
+
+ - (EXAMPLE.conf.def, passtest): Move passtest to ucdavis subtree.
+
+1996-12-03 02:03 whardake
+
+ * acconfig.h, configure, configure.in,
+ agent/snmp_vars.c:
+
+ - (snmp_vars.c): From Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - Fix arp table for hpux.
+ - (config*): Check for arphd.at_next and use in above.
+
+1996-12-03 01:05 whardake
+
+ * snmplib/md5.c:
+
+ - (md5.c): Put 'U'nsigned marker at end of constants to remove gcc warns.
+
+1996-12-03 01:03 whardake
+
+ * acconfig.h, aclocal.m4, config.h.in,
+ configure, configure.in, agent/snmp_vars.c:
+
+ - (config*, snmp_vars.c):
+ - Wrote AC_CHECK_STRUCT_FOR and use it.
+ - Make AC_CHECK_IFNET_FOR use above.
+ - Changequote '[]' -> '' around sed expression with []s (-Dostype).
+
+1996-12-01 23:55 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Patch from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - ifPhysAddr - in Interface_Get_Ether_By_Index, HP-UX has the same
+ EtherAddr strucure as MIPS.
+
+ - ipAdEntIfIndex - in var_ipAddrEntry, there is a false match on
+ the loopback interface, giving the wrong answer of the first
+ interface index.
+
+ - udpInErrors - in var_udp, the count of UDP errors omits discarded
+ packets. Some systems (i.e. HP-UX) have extended the udpstat
+ structure to include these. I'v tweaked this analogous to a
+ similar addition in the tcpstat structure.
+
+ - tcpConnState - HP-UX has added an extra state into the list, which
+ throws the rest of them out.
+
+1996-11-26 23:56 whardake
+
+ * configure, configure.in:
+
+ - (configure.in, configure): Truncate system names beyond [-_].*.
+
+1996-11-26 23:45 whardake
+
+ * apps/snmpnetstat/if.c:
+
+ - (if.c): Reset signal on all types of signal implementations.
+
+1996-11-26 23:34 whardake
+
+ * apps/snmpnetstat/if.c:
+
+ - (if.c): Patch from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - Watch out for interface names with ' ' in them.
+ - Reset signal on BSD signal implementations.
+
+1996-11-26 23:21 whardake
+
+ * README:
+
+ - (README): Update.
+
+1996-11-26 23:21 whardake
+
+ * INSTALL:
+
+ - (INSTALL): Typo: 3.1.3 -> 3.0.3.
+
+1996-11-26 23:05 whardake
+
+ * configure, configure.in:
+
+ - (configure, configure.in): Default sysloc UCDavis -> Unknown.
+
+1996-11-26 23:02 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Patch from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - Change comments to reflect what its actually looking at.
+ - Remove ifdef around ifnet declarations.
+
+1996-11-25 00:15 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, snmplib/snmp_impl.h:
+
+ - (config*, snmp_impl.h): Moved void -> char define to a configure test.
+
+1996-11-24 23:43 whardake
+
+ * agent/Makefile.in, apps/Makefile.in:
+
+ - ({agent,apps}/Makefile.in): Put libsnmp.a in front of -l libs.
+
+1996-11-24 07:45 whardake
+
+ * sedscript.in:
+
+ version tag ( 3.1.2.pre1 )
+
+1996-11-24 07:24 whardake
+
+ * agent/kernel.c, INSTALL, acconfig.h,
+ config.h.in, configure, configure.in:
+
+ - (kernel.c, config*, INSTALL): New configure switch: --without-root-access.
+ - The agent doesn't exit if it can't open /dev/kmem.
+
+1996-11-22 05:37 whardake
+
+ * config.guess, config.h.in, config.sub,
+ configure, install-sh, mkinstalldirs:
+
+ - (config*, install-sh, mkinstalldirs): Upgraded to autoconf 2.11.
+
+1996-11-22 00:14 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (config*): Add checks for ifnet.[io]bytes.
+
+1996-11-22 00:06 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Merge from FreeBSD2-3-1-1.
+ - Add checks for ifnet.[io]bytes.
+
+1996-11-21 23:18 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Trash interface caching.
+
+1996-11-15 07:44 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): Add back in "reading mib..." debugging statments.
+
+1996-11-15 07:43 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (config*, extensible.c): Make uname calls work correctly.
+
+1996-11-14 06:24 whardake
+
+ * apps/: snmptrap.c, snmpnetstat/inet.c,
+ snmpnetstat/route.c:
+
+ - (snmptrap.c, inet.c, route.c): typecasting warning fixes.
+
+1996-11-14 06:17 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (config*):
+ - Check for existance of tcpstat.tcps_rcvmemdrop.
+ - Check for sys/vfs.h.
+
+1996-11-14 06:16 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c):
+ - #ifdef typo.
+ - prototype for Interface_Scan_Init().
+ - Check for existance of tcpstat.tcps_rcvmemdrop before using.
+
+1996-11-08 08:06 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in): Fixed 'touchit'.
+
+1996-11-08 08:03 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in): Created a 'touchit' to touch config files properly.
+
+1996-11-07 05:19 whardake
+
+ * snmplib/mib.c:
+
+ - (mib.c): typecast for sprint_objid().
+
+1996-11-07 05:17 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): ifdef typos.
+
+1996-11-07 05:16 whardake
+
+ * agent/snmp_var_route.c:
+
+ - (snmp_var_route.c): ifdef's around strings.h.
+
+1996-11-07 05:15 whardake
+
+ * configure.in, configure:
+
+ - (configure.in, configure): Changed default SNMPV2AUTH to SNMPV1.
+
+1996-11-07 00:34 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/route_write.c,
+ agent/snmp_var_route.c, agent/snmp_vars.c:
+
+ - BSDi2 3.1.1 branch merge.
+
+1996-11-07 00:22 whardake
+
+ * agent/kernel.c, agent/snmpd.c, apps/snmpbulkwalk.c
+, apps/snmpget.c, apps/snmpgetnext.c,
+ apps/snmpset.c, apps/snmptest.c, apps/snmptranslate.c
+, apps/snmptrap.c, apps/snmptrapd.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/route.c, man/snmptranslate.1,
+ snmplib/mib.c, snmplib/mib.h, snmplib/parse.c,
+ snmplib/parse.h:
+
+ - Niels 3.1.1 branch merge.
+
+1996-11-07 00:15 whardake
+
+ * acconfig.h, aclocal.m4, config.h.in,
+ configure, configure.in, sedscript.in,
+ agent/snmp_var_route.c, agent/snmp_vars.c,
+ agent/snmp_vars.h:
+
+ - NetBSD 3.1.0.1 branch merge.
+
+1996-11-04 01:08 whardake
+
+ * config.h.in, configure, configure.in:
+
+ - (config*): Check for nlist in -lmld (irix).
+
+1996-11-04 00:30 whardake
+
+ * config.h.in, configure, configure.in,
+ agent/snmp_vars.c:
+
+ - (config*, snmp_vars.c, extensible.c): More include checks for linux.
+
+1996-10-31 23:54 whardake
+
+ * snmplib/asn1.c:
+
+ - (asn1.c): Patch from Simon Leinen <simon@switch.ch>:
+ - asn_build_unsigned_int, asn_build_unsigned_int64:
+ - Don't try to strip FFs from the high end of unsigned values.
+ - Skip the stripping code entirely if we have to add a null byte.
+
+1996-10-30 04:48 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, ece-mib.def:
+
+ - (config*, ece-mib.def):
+ - Change extensible mib location to ucdavis enterprise mib: 2021.
+ - Remove associated prompting from configure script and etc.
+
+1996-10-30 04:47 whardake
+
+ * PORTING, README:
+
+ - (PORTING,README): Add a new PORTING file to reference autoconf plee.
+
+1996-10-16 23:02 whardake
+
+ * sedscript.in:
+
+ version tag ( 3.1.1.BSDI )
+
+1996-10-09 07:46 whardake
+
+ * sedscript.in:
+
+ version tag ( 3.1.1 )
+
+1996-10-09 07:45 whardake
+
+ * ChangeLog, NEWS:
+
+ - (ChangeLog, NEWS): update for 3.1.1.
+
+1996-10-09 07:22 whardake
+
+ * README:
+
+ - (README): Added thanks name.
+
+1996-10-09 07:18 whardake
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): From: gah@bellcore.com (Gary A. Hayward)
+ - Free pdu community to quelch purify.
+
+1996-10-09 00:30 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c):
+ - print a new line in print_error() if debugging is turned on.
+ - tossObjectIdentifier(): catch multiple bracket clauses (IE { {0 0} } ).
+
+1996-10-09 00:04 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c):
+ - Parse OBJECT-IDENTY as OBJECT-GROUP (saves only description).
+ - Change print_error(), read_mib() to reflect file and correct line number.
+
+1996-10-07 04:23 whardake
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): Added syscontact and syslocation.
+
+1996-10-07 04:23 whardake
+
+ * man/snmpd.1.def:
+
+ - (snmpd.1.def): Changed to reflect SNMPLIB/mibs.
+
+1996-10-07 03:06 whardake
+
+ * .cvsignore:
+
+ - (.cvsignore): Added ucd-snmp.txt
+
+1996-10-07 03:00 whardake
+
+ * configure.in, configure:
+
+ - (configure.in):
+ - timestamp stamp-h at end.
+ - emacs local vars.
+
+1996-10-07 02:22 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in):
+ - added --recheck to config.status call to regenerate self.
+ - Changed ece-mib.txt -> ucd-snmp.txt and install (and generate) properly.
+
+1996-10-07 01:11 whardake
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c): Removed snmp version check on error return from set.
+
+1996-10-07 00:52 whardake
+
+ * config.h.in, configure, configure.in:
+
+ - (config*): check correctly for get/setmntent.
+
+1996-10-07 00:01 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in): Mib installation changed to reflect new mib directory.
+
+1996-10-06 23:49 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): Proper autoconf dirent headers.
+
+1996-10-06 23:41 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): Now loads all mibs (files) in the directory SNMPLIB/mibs.
+
+1996-10-04 02:01 whardake
+
+ * man/: snmpd.1.def, snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): lib -> lib/snmp path correction in FILES section.
+ - (snmpd.1.def):
+ - Added a FILES section.
+ - General clean up.
+
+1996-10-04 01:46 whardake
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def):
+ - Cleaned up man page formatting.
+ - Added note about SNMPset community strings.
+ - minor proof-reading (major proofing needed still).
+ - Re-organized a bit.
+
+1996-10-04 01:44 whardake
+
+ * Makefile.in:
+
+ - (Makefile.in): Remove spaces from sedscript when using broken cpp (gcc).
+
+1996-10-04 01:43 whardake
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): Added snmpget/set to pass example.
+
+1996-10-03 08:10 whardake
+
+ * snmplib/snmp_impl.h:
+
+ - (snmp_impl.h): Turn on old CMU debugging statments with --enable-debugging.
+
+1996-10-03 08:05 whardake
+
+ * agent/snmp_agent.c:
+
+ - (snmp_agent.c):
+ - Make agent properly check snmpset exit codes and use them (on COMMIT).
+
+1996-10-01 08:28 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (config*, read_config.c):
+ - Check for mntent.h and include it.
+ - Check for /etc/mnttab or /etc/mtab and use appropriately.
+ - (read_config.c):
+ - pick getmntent over getfsfile if both are available.
+ - debug cleanup (ofile -> stderr, check for DODEBUG instead of const var).
+
+1996-10-01 07:30 whardake
+
+ * snmplib/: parse.c, parse.h:
+
+ - (parse.c, parse.h): From Joe Marzot:
+ - allows the CMU lib to retain the TC information associated with a
+ particular object. In particular this allows DisplayStrings to be
+ differentiated from OctetStrings when they are looked up in the
+ Mib Tree.
+
+1996-09-25 05:14 whardake
+
+ * agent/snmp_var_route.c:
+
+ - (snmp_var_route.c): freebsd2 typecast.
+
+1996-09-24 08:16 whardake
+
+ * agent/snmp_var_route.c:
+
+ - (snmp_var_route.c): typo fixing a typo (sigh..).
+
+1996-09-24 08:02 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): Moved a variable declairation.
+
+1996-09-24 07:59 whardake
+
+ * agent/: snmp_var_route.c, snmp_vars.c:
+
+ - (snmp_var_route.c, snmp_vars.c): typos.
+
+1996-09-24 07:54 whardake
+
+ * config.h.in, configure, configure.in,
+ snmplib/snmp_api.c, snmplib/snmp_client.c:
+
+ - (config*, snmp_api.c, snmp_client.c): Added sys/select.h for AIX.
+
+1996-08-30 02:51 whardake
+
+ * ChangeLog:
+
+ - (ChangeLog): More minor bugs listed
+
+1996-08-30 02:49 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): removed malloc prototype due to conflictions.
+
+1996-08-30 01:15 whardake
+
+ * README:
+
+ - (README): Updated for 3.1.0.1
+
+1996-08-30 00:34 whardake
+
+ * sedscript.in:
+
+ version tag ( 3.1.0.1 )
+
+1996-08-30 00:34 whardake
+
+ * ChangeLog, NEWS:
+
+ - (NEWS, ChangeLog): Updated for 3.1.0.1
+
+1996-08-30 00:24 whardake
+
+ * apps/Makefile.in:
+
+ - (apps/Makefile.in): Added kernel_sunos5.o to snmptrap for getKstat.
+
+1996-08-30 00:23 whardake
+
+ * apps/snmptrap.c:
+
+ - (snmptrap.c): patch screwed up.
+
+1996-08-30 00:22 whardake
+
+ * configure.in, configure:
+
+ - (configure, configure.in):
+ - removed -Xs flag for gcc on solaris.
+ - logfile checks for existance of /var/log and /usr/adm.
+
+1996-08-29 07:29 whardake
+
+ * README, TODO:
+
+ - Changed my email address to my new one.
+
+1996-08-29 07:20 whardake
+
+ * config.h.in, configure, configure.in,
+ agent/snmp_vars.c:
+
+ - (autoconf*, snmp_vars.c): Removed some solaris ifdefs.
+
+1996-08-29 07:03 whardake
+
+ * apps/snmpwalk.c:
+
+ - (snmpwalk.c): Removed SVR4 ifdefs
+
+1996-08-29 06:58 whardake
+
+ * apps/snmpstatus.c:
+
+ - (snmpstatus.c): Patch from Trevor Bourget <tbourget@qualcomm.com>
+ - malloc sysdesc instead of assuming < 128 bytes.
+
+1996-08-29 06:08 whardake
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - gcc warnings NULL -> 0
+
+1996-08-29 06:07 whardake
+
+ * snmplib/parse.c:
+
+ - (parse.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - save mib descriptions for snmptranslate and other apps that need it.
+
+1996-08-29 06:06 whardake
+
+ * snmplib/mib.c:
+
+ - (mib.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - prototypes for gcc warnings
+
+1996-08-29 06:06 whardake
+
+ * snmplib/asn1.c:
+
+ - (asn1.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - uchar(s) can't be less than 0.
+
+1996-08-29 06:03 whardake
+
+ * man/: Makefile.in, snmptrap.1:
+
+ - (man/snmptrap.1): added by Niels Baggesen <recnba@mediator.uni-c.dk>
+
+1996-08-29 05:59 whardake
+
+ * apps/: snmpbulkwalk.c, snmpget.c, snmpgetnext.c
+, snmpset.c, snmptranslate.c, snmptrap.c,
+ snmptrapd.c, snmpwalk.c:
+
+ - (apps/*.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - set exit codes of 0 for all apps.
+ - Removed SVR4 #ifdefs.
+ - Greatly improved snmptrap.
+
+1996-08-27 01:04 whardake
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (autoconf*):
+ - FreeBSD additions.
+ - New kernel location: /kernel (ick).
+ - Log file default intelligently checks for /var/log and /usr/adm.
+ - Checks for getloadavg().
+
+1996-08-27 01:00 whardake
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): More warped FreeBSD changes
+
+1996-08-27 00:38 whardake
+
+ * agent/snmp_var_route.c:
+
+ - (snmp_var_route.c): FreeBSD specific changes.
+
+1996-08-27 00:01 whardake
+
+ * apps/snmptrap.c:
+
+ - (snmptrap.c):
+ - FreeBSD specific changes.
+ - more autoconf complete: paths to libraries and kernel location.
+
+1996-08-26 23:47 whardake
+
+ * apps/snmptrapd.c:
+
+ - (snmptrapd.c): Fix byte order problem (convert to network before sending).
+
+1996-08-26 07:57 whardake
+
+ * agent/: event.c, kernel.c, route_write.c:
+
+ - (event.c, kernel.c, route_write.c): FreeBSD modifications
+
+1996-08-26 07:55 whardake
+
+ * snmplib/snmp_api.c:
+
+ - (snmp_api.c): Fixed a gcc/FreeBSD optimization bug (stupid compiler)
+
+1996-08-26 01:37 whardake
+
+ * ece-mib.def:
+
+ - (ece-mib.def): commas out of place.
+
+1996-08-26 01:37 whardake
+
+ * TODO:
+
+ - (TODO) Extra mib parsing ideas added.
+
+1996-08-26 01:36 whardake
+
+ * NEWS:
+
+ - (NEWS) Typo, extra quotation mark.
+
+1996-08-21 06:30 hardaker
+
+ * local/passtest:
+
+ Added passtest!
+
+1996-05-24 15:46 hardaker
+
+ * sedscript.in:
+
+ version tag ( 3.1 )
+
+1996-05-24 15:44 hardaker
+
+ * COPYING:
+
+ copyright update
+
+1996-05-24 15:43 hardaker
+
+ * ChangeLog, NEWS:
+
+ - (ChangeLog, NEWS): 3.1 release info update.
+
+1996-05-24 15:29 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (snmp_vars.c): removed some ifdef requirements.
+
+1996-05-24 15:28 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (accconfig.h, config.h.in): #ifdef typos
+
+1996-05-24 14:02 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config*): check for memmove before you define it.
+
+1996-05-24 13:55 hardaker
+
+ * apps/snmpnetstat/: if.c, route.c:
+
+ - (if.c, route.c): cast returns from index to char *.
+
+1996-05-24 13:54 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): define memmove if not defined and memcpy is.
+
+1996-05-24 13:13 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - (snmpd.conf.5.def): note on creating comments added.
+
+1996-05-24 13:10 hardaker
+
+ * snmplib/parse.c:
+
+ - (parse.c): declarations cleanup
+
+1996-05-24 13:09 hardaker
+
+ * mibII.txt:
+
+ - (mibII.txt): removed ;s at the end of the BEGIN lines.
+
+1996-05-24 13:08 hardaker
+
+ * configure.in, configure, config.h.in:
+
+ - (config*): Check for sys/mnttab.h
+
+1996-05-24 13:08 hardaker
+
+ * EXAMPLE.conf.def:
+
+ - (EXAMPLE.conf.def): minor example file changes.
+
+1996-05-24 12:39 hardaker
+
+ * README:
+
+ - (README): Added a thanks section.
+
+1996-05-24 12:23 hardaker
+
+ * snmplib/parse.c:
+
+ - (snmplib/parse.c): parsing fixes from Mike Perik <mikep@crt.com>
+
+1996-05-23 17:47 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (config*): check for getmntent.
+
+1996-05-23 17:09 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (config*, extensible.c): fixed disk checks on Solaris and alpha's
+ - use statvfs over fstab if both present.
+
+1996-05-23 16:27 hardaker
+
+ * snmplib/: acl.c, party.c, view.c:
+
+ - (acl.c, party.c): include stdio.h
+
+1996-05-23 14:56 hardaker
+
+ * apps/snmpnetstat/if.c:
+
+ - (if.c): type casting bugs.
+
+1996-05-23 14:44 hardaker
+
+ * snmplib/: acl.c, party.c, view.c:
+
+ - (acl.c, party.c, view.c): removed NULL defines.
+
+1996-05-23 14:43 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.h.in): Don't define random if it already exists.
+
+1996-05-22 12:55 hardaker
+
+ * apps/snmpnetstat/if.c:
+
+ - (apps/snmpnetstat/if.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - reworked the way snmpnetstat -i works.
+
+1996-05-22 12:49 hardaker
+
+ * agent/: kernel_sunos5.c, snmp_vars.c:
+
+ - (agent/kernel_sunos5.c, snmp_vars.c,
+ agent/extensible/extensible.c,readconfig.c,snmp_vars.c):
+ - Patch from Niels Baggesen <recnba@mediator.uni-c.dk>:
+ - finally nailed that missing initialization that gave problems
+ with the AT subtree
+ - I also implemented the disk part of the extensibility in the
+ attached patch.
+
+1996-05-22 08:50 hardaker
+
+ * config.guess, configure, install-sh,
+ mkinstalldirs:
+
+ - (config.guess, configure, install-sh, mkinstalldirs): Autoconf-2.10
+
+1996-05-22 08:50 hardaker
+
+ * man/Makefile.in:
+
+ - (man/Makefile.in) Updated the way sedscript is used.
+
+1996-05-15 12:35 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in) Fixed a horrible typo. P -> PREFIX
+
+1996-05-15 12:23 hardaker
+
+ * apps/snmpnetstat/if.c:
+
+ - (apps/snmpnetstat/if.c) removed & in front of array passed as arg.
+
+1996-05-15 12:03 hardaker
+
+ * README:
+
+ - (README) Added a note (pointer to docs) on the agent's extensiblity.
+
+1996-05-15 12:00 hardaker
+
+ * INSTALL:
+
+ - (INSTALL) make install as root.
+
+1996-05-15 09:51 hardaker
+
+ * sedscript.in:
+
+ version tag ( 3.1.A1 )
+
+1996-05-15 09:50 hardaker
+
+ * agent/kernel_sunos5.c:
+
+ - (agent/kernel_sunos5.c) patch mistake.
+
+1996-05-15 09:29 hardaker
+
+ * COPYING, README, TODO:
+
+ - (COPYING, README, TODO) Release docs updated.
+
+1996-05-15 09:07 hardaker
+
+ * EXAMPLE.conf.def, man/snmpd.conf.5.def:
+
+ - (EXAMPLE.conf.def, man/snmpd.conf.5.def): documented pass thru mibs.
+
+1996-05-15 09:06 hardaker
+
+ * Makefile.in, sedscript.in:
+
+ - (Makefile.in,sedscript.in) Added PREFIX to the sedscript.
+
+1996-05-15 09:05 hardaker
+
+ * .cvsignore, agent/.cvsignore, apps/.cvsignore,
+ local/.cvsignore:
+
+ - (*/.cvsignore) ignore file update.
+
+1996-05-15 09:01 hardaker
+
+ * agent/: kernel_sunos5.c, kernel_sunos5.h:
+
+ - (agent/kernel_sunos5.c) Patch from "Dan A. Dickey" <ddickey@transition.com>
+ - Better caching algorithm for improved speed.
+
+1996-05-15 08:59 hardaker
+
+ * apps/snmpnetstat/if.c:
+
+ - (agent/extensible/pass.c) Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - Implemented missing parts of interface address and network output (-i)
+
+1996-05-13 15:59 hardaker
+
+ * snmplib/snmp_impl.h:
+
+ - (snmplib/snmp_impl.h): Change RWRITE to include Write for V2 bits.
+
+1996-05-13 15:58 hardaker
+
+ * agent/: snmp_agent.c, snmp_vars.c:
+
+ - (agent/snmp_agent.c, agent/snmp_vars.c, agent/extensible/extensible.c):
+ - Bug fix: GLOBALSECURITY bug: save rightmost two bits in acl.
+
+1996-05-10 18:16 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/Makefile.in,
+ agent/kernel_sunos5.c, agent/snmp_vars.c,
+ agent/snmpd.c, apps/Makefile.in, apps/snmpstatus.c
+, apps/snmptrapd.c, apps/snmpnetstat/Makefile.in,
+ apps/snmpnetstat/if.c, apps/snmpnetstat/main.c,
+ man/Makefile.in, man/snmpstatus.1, snmplib/parse.c
+:
+
+ - (many): Mereged baggesen-3-0-7-2 branch into main trunk.
+
+1996-05-10 17:06 hardaker
+
+ * man/snmpstatus.1:
+
+ file snmpstatus.1 was initially added on branch Baggesen-3-0-7-2.
+
+1996-05-10 17:05 hardaker
+
+ * apps/snmpstatus.c:
+
+ file snmpstatus.c was initially added on branch Baggesen-3-0-7-2.
+
+1996-05-10 10:27 hardaker
+
+ * agent/kernel_sunos5.c:
+
+ - (kernel_sunos5.c): A patch to fix a virtual interface problem.
+ - patch supplied by "Dan A. Dickey" <ddickey@transition.com>
+
+1996-05-09 16:13 hardaker
+
+ * configure, configure.in, agent/snmp_vars.c,
+ agent/snmpd.c, snmplib/mib.c, snmplib/snmp_client.c
+:
+
+ - (configure.in): Solaris specific cpp flags added for SUNspro's cpp.
+ - (agent/{snmp_vars,snmpd}.c,agent/extensible/{extensible,misc,pass}.c,
+ snmplib/{mib,snmp_client}.c):
+ - Cleaned up prototypes to match more carefully (with Solaris's spro cc).
+
+1996-05-09 13:32 hardaker
+
+ * acconfig.h, config.h.in, agent/Makefile.in,
+ agent/snmp_vars.c:
+
+ - (acconfig.h,agent/{Makefile,snmp_vars.c},agent/extensible/many):
+ - Added support for passthru mibs. Total control is handed to exec's.
+
+1996-05-09 13:27 hardaker
+
+ * configure:
+
+ - (acconfig.h, configure.in, snmplib/Makefile.in)
+ - Added a check for various random functions.
+ - Included another ifdef to ensure no #define loops occur with str/index fns.
+
+1996-05-09 13:24 hardaker
+
+ * apps/snmpset.c:
+
+ - (apps/snmpset.c) Added '.' as a delimiter for decimal encoded strings.
+
+1996-05-03 14:40 hardaker
+
+ * apps/snmptrap.c:
+
+ - (apps/snmptrap.c) Added #include<sys/sockio.h>
+
+1996-05-03 14:37 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (agent/snmp_vars.c) Solaris fix for interfaces.
+ - From Dan A. Dickey <ddickey@transition.com>
+
+1996-05-03 14:35 hardaker
+
+ * agent/: snmp_var_route.c, snmp_vars.c:
+
+ - (agent/snmp_var_route.c,snmp_vars.c)
+ - Changed the interface counter to a short for all architectures (bus err)
+ - Undefed a function that is never used.
+
+1996-05-03 14:33 hardaker
+
+ * acconfig.h, configure.in, snmplib/Makefile.in
+:
+
+ - (acconfig.h, configure.in, snmplib/Makefile.in)
+ - Added a check for various random functions.
+ - Included another ifdef to ensure no #define loops occur with str/index fns.
+
+1996-05-01 14:59 hardaker
+
+ * sedscript.in:
+
+ version tag ( 3.0.7.2 )
+
+1996-05-01 14:59 hardaker
+
+ * ChangeLog, NEWS:
+
+ - (ChangeLog,NEWS) version update 3.0.7.2
+
+1996-05-01 14:56 hardaker
+
+ * acconfig.h:
+
+ - (acconfig.h,agent/extensible/mibdefs.h): removed coments/spaces from defines.
+
+1996-05-01 14:37 hardaker
+
+ * sedscript.in:
+
+ - (sedscript.in) forgot NETBSD1ID def.
+
+1996-05-01 14:37 hardaker
+
+ * local/snmpcheck.def:
+
+ - (local/snmpcheck) Tk-b10 fixes.
+
+1996-05-01 14:35 hardaker
+
+ * agent/route_write.c:
+
+ - (agent/route_write.c,agent/extensible/extensible.c):
+ - netbsd1.1B specific fixes: clash with sys_errlist and rt_dst defines.
+
+1996-05-01 13:55 hardaker
+
+ * man/: snmpd.1.def, snmpd.conf.5.def:
+
+ - (man/snmpd.1.def,snmpd.conf.5.def) .C -> .B, to increase nroff portability.
+
+1996-05-01 13:54 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (configure*, agent/extensible/{read_config,extenisble}.c):
+ - configurified (new word) some of Niels' changes and the bcopy/memmove stuff.
+
+1996-05-01 12:37 hardaker
+
+ * agent/: kernel.c, kernel_sunos5.c, snmp_vars.c
+, snmpd.c:
+
+ - (many) Fixes for Solaris (2.5) submitted by
+ Niels Baggesen <recnba@mediator.uni-c.dk>:
+ "Some are my own, others are from Yuri Rabover who originally
+ created the patch. Some of this is there to eliminate the
+ dependency on the ucblib compatibility stuff, some is "cosmetic",
+ but it also fixes a serious problem in the agent, where walking
+ the mib tree can loop endlessly if you have multiple network
+ interfaces."
+
+1996-04-25 12:19 hardaker
+
+ * sedscript.in:
+
+ version tag ( 3.0.7.1 )
+
+1996-04-25 12:18 hardaker
+
+ * ChangeLog, acconfig.h, config.h.in:
+
+ - (ChangeLog, acconfig.h, config.h.in) Defined DEBUGP if DODEBUG is not defined.
+
+1996-04-24 14:54 hardaker
+
+ * sedscript.in:
+
+ version tag ( 3.0.7 )
+
+1996-04-24 14:53 hardaker
+
+ * ChangeLog, NEWS:
+
+ - (ChangeLog,NEWS) update for 3.0.7
+
+1996-04-24 14:37 hardaker
+
+ * local/snmpcheck.def:
+
+ - (local/snmpcheck) new pref: don't pop forward on new problems.
+
+1996-04-24 13:25 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in, agent/snmp_var_route.c:
+
+ - (config*,agent/snmp_var_route.c) config checking for rtentry.rt_next
+
+1996-04-24 11:55 hardaker
+
+ * agent/snmp_var_route.c:
+
+ - (agent/snmp_var_route.c) @#$%ing solaris
+
+1996-04-24 11:46 hardaker
+
+ * agent/snmp_var_route.c:
+
+ - (agent/snmp_var_route.c) Checked for sys/mbuf for determining rtentry.rt_next
+
+1996-04-24 09:07 hardaker
+
+ * INSTALL:
+
+ - (INSTALL) updated
+
+1996-04-24 09:00 hardaker
+
+ * README:
+
+ - (README) updated
+
+1996-04-24 08:54 hardaker
+
+ * man/.cvsignore:
+
+ - (man/.cvsignore) added snmpd.1
+
+1996-04-24 08:53 hardaker
+
+ * acconfig.h, config.h.in, ece-mib.def,
+ ov/UCD-fields, ov/oid_to_sym.in, ov/oid_to_type.in
+:
+
+ - (acconfig.h, config.h.in, ece-mib.def, ov/*) Added NetBSD to sys-OID returned.
+
+1996-04-24 08:44 hardaker
+
+ * agent/: snmp_var_route.c, snmp_vars.c:
+
+ - (agent/snmp_var_route.c,snmp_vars.c) more config files for NetBSD.
+ - (agent/snmp_vars.c) removed arp tables for netbsd.
+
+1996-04-24 08:38 hardaker
+
+ * agent/alarm.c:
+
+ - (agent/alarm.c) Fixed some define naming conflicts for NetBSD (timeradd()).
+
+1996-04-24 08:37 hardaker
+
+ * agent/Makefile.in:
+
+ - (agent/Makefile.in) Forgot a quote. (why hasn't this appeared before?)
+
+1996-04-24 08:36 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (configure.in) More header file checks (vm/vm.h (+ others) and ufs/ffs/fs.h)
+
+1996-04-16 18:08 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c) Added fflush calls after printing packet dumps
+
+1996-04-16 09:48 hardaker
+
+ * agent/: route_write.c, snmp_var_route.c:
+
+ - (agent/{route_write.c,snmp_var_route.c}) OSF3.2 specific changes. arg.
+
+1996-04-16 09:47 hardaker
+
+ * configure, configure.in:
+
+ - (configure) I forgot DMEM_LOC needs to be #undef'ed if not found
+
+1996-04-15 14:36 hardaker
+
+ * agent/snmpd.c:
+
+ - (agent/snmpd.c) Fixed 2 gettimeofday calls -- added a NULL timezone ptr.
+
+1996-04-15 14:11 hardaker
+
+ * Makefile.in, aclocal.m4, configure,
+ configure.in:
+
+ - (configure) New command line option: --with-defaults. Don't prompt the user.
+ - (configure) bug fixes: wasn't quoting kernel and dmem location.
+ - (configure) gcc cpp requires -x c to accept .in file suffix.
+
+1996-04-15 12:53 hardaker
+
+ * acconfig.h, config.h.in, configure,
+ configure.in:
+
+ - (configure) New command line option: --enable-debugging. Turns on debugging.
+ - (configure) Fixes for type checking of 4.4 rtentry structures on alphas.
+
+1996-04-12 16:48 hardaker
+
+ * acconfig.h, aclocal.m4, config.h.in,
+ configure, configure.in, ece-mib.def,
+ sedscript.in, agent/route_write.c,
+ agent/snmp_var_route.c, ov/UCD-fields,
+ ov/oid_to_sym.in, ov/oid_to_type.in,
+ ov/bitmaps/UCD.fields:
+
+ - (snmp_var_route.c)
+ - Changed nlist warnings to only print if DODEBUG is defined in config.h
+ - (many) Added support for hppa1.1-hp-hpux10.01
+ - totally! redid the routing tables for BSD 4.4 derived systems
+ (alpha, hpux10.01+, netbsd) since hpux10 doesn't have 4.3 compat structs.
+ - (ece-mib.def) Capitalization problem.
+ - (configure.in)
+ - Cleaned up kernel checking
+ - Started using a autoconf 2.8 feature to check for cache values.
+
+1996-04-12 14:51 hardaker
+
+ * agent/snmp_vars.c:
+
+ - (agent/snmp_vars.c, agent/extensible.c)
+ - Changed nlist warnings to only print if DODEBUG is defined in config.h
+
+1996-04-05 16:19 hardaker
+
+ * man/Makefile.in:
+
+ - (man/Makefile.in) Added a 'clean' definition to the Makefile.
+
+1996-04-05 16:15 hardaker
+
+ * snmplib/asn1.c:
+
+ - (snmplib/asn1.c) removed a required 'unix' define surrounding a header file.
+
+1996-04-05 16:12 hardaker
+
+ * configure:
+
+ - (configure) autoconf-2.7 -> autoconf-2.9
+
+1996-04-05 16:11 hardaker
+
+ * local/snmpcheck.def:
+
+ - (local/snmpcheck.def) Tk-b8 => Tk-b10 changes
+
+1996-03-11 15:58 hardaker
+
+ * ChangeLog:
+
+ small ChangeLog update
+
+1996-03-11 15:56 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - (snmplib/snmp_api.c): fixed a timeout bug caused by architectures
+ with an unsigned timeval.tv_sec value.
+ - Thanks goes to Giovanni S. Marzot <gmarzot@baynetworks.com> for
+ the patch!
+
+1996-03-11 15:41 hardaker
+
+ * sedscript.in:
+
+ version tag ( 3.0.6 )
+
+1996-03-11 15:41 hardaker
+
+ * ChangeLog, NEWS:
+
+ - (ChangeLog/NEWS): updated for 3.0.6
+
+1996-03-11 15:39 hardaker
+
+ * README:
+
+ - (README): more clean up and added reference to the ucd-snmp mailing list.
+
+1996-03-11 15:17 hardaker
+
+ * README:
+
+ - (README): cleaned up, re-arranged, shortened (sections moved to man/* docs).
+
+1996-03-11 15:17 hardaker
+
+ * man/Makefile.in, man/snmpd.1.def,
+ man/snmpd.conf.5.def, sedscript.in:
+
+ - (man/{Makefile.in,snmpd.1.def,snmpd.conf.5.def},versiontag,sedscript.in):
+ - cleaned up documentation more and added the version number to the trailers.
+
+1996-03-11 13:37 hardaker
+
+ * agent/: snmp_var_route.c, snmp_vars.c:
+
+ - (snmp_var_route.c, snmp_vars.c, extensible.c): commented out nlist warnings.
+
+1996-03-08 10:31 hardaker
+
+ * snmplib/snmp_api.h:
+
+ - (snmplib/snmp_api.h) fixed a fix that shouldn't have been fixed.
+
+1996-03-08 10:31 hardaker
+
+ * snmplib/snmp_client.c:
+
+ - (snmplib/snmp_client.c) Check if variable content is NULL before using.
+
+1996-03-06 16:58 hardaker
+
+ * snmplib/mib.c:
+
+ - (snmplib/mib.c) printed values for timeticks are no longer negative.
+
+1996-03-06 16:38 hardaker
+
+ * ece-mib.def:
+
+ - (ece-mib.def)
+ - Changed capitalization schemes to be mosy compliant.
+ - Made the memory mib SYNTAX point to the Memory sequence like it should.
+
+1996-03-06 09:09 hardaker
+
+ * agent/snmpd.c:
+
+ - (agent/snmpd.c) Added O_TRUNC to the logfile open() call.
+
+1996-02-21 16:24 hardaker
+
+ * snmplib/snmp_api.h:
+
+ - (snmplib/snmp_api.h)
+ - Changed trap_type & specific_type to long from int for 64 bit architectures.
+ - suggested by francus@metsny.delphi.com.
+
+1996-02-21 16:15 hardaker
+
+ * apps/: .cvsignore, Makefile.in, snmptrap.c:
+
+ - (apps/Makefile.in, apps/snmptrap.c)
+ - Added apps/snmptrap
+ - code taken from 2.0.1 and submitted to me by francus@metsny.delphi.com.
+ - I have yet to test it.
+
+1996-02-21 16:12 hardaker
+
+ * Makefile.in, sedscript.in, man/.cvsignore,
+ man/Makefile.in, man/snmpd.conf.5.def:
+
+ - (Makefile.in, sedscript.in, man/Makefile.in, man/snmpd.conf.5.def)
+ - Added the beginnings of a snmpd.conf manual page.
+
+1996-02-16 16:32 hardaker
+
+ * acconfig.h, config.h.in, agent/snmp_agent.c:
+
+ - (acconfig.h,config.h.in, agent/snmp_agent.c, agent/extensible/read_config.c)
+ - .conf file addition: "community N STRING" to change community names
+
+1996-02-12 14:28 hardaker
+
+ * acconfig.h, config.h.in:
+
+ - (acconfig.h, config.hin, agent/extensible/misc.c)
+ - The agent now sets an alarm to restart rather than doing at the
+ snmpset time to return a value to the snmpset request.
+
+1996-02-09 17:04 hardaker
+
+ * .cvsignore, Makefile.in, acconfig.h,
+ config.h.in, configure, configure.in,
+ ece-mib.def, sedscript.in, agent/snmp_vars.c,
+ ov/.cvsignore, ov/Makefile.in, ov/README,
+ ov/UCD-Computer, ov/UCD-fields, ov/oid_to_sym.in,
+ ov/oid_to_type.in, ov/bitmaps/UCD.20.m,
+ ov/bitmaps/UCD.20.p, ov/bitmaps/UCD.26.m,
+ ov/bitmaps/UCD.26.p, ov/bitmaps/UCD.32.m,
+ ov/bitmaps/UCD.32.p, ov/bitmaps/UCD.38.m,
+ ov/bitmaps/UCD.38.p, ov/bitmaps/UCD.44.m,
+ ov/bitmaps/UCD.44.p, ov/bitmaps/UCD.50.m,
+ ov/bitmaps/UCD.50.p, ov/bitmaps/UCD.fields:
+
+ - Better OpenView support
+ - Returns different sysObjectID's for each architecture
+ - Added a 'ov' directory for OpenView support files
+ - currently contains necessary files to support a UCD bitmap file
+ for hosts using the ucd-snmp agent. See the ov/README file for details.
+
+1996-01-26 08:25 hardaker
+
+ * configure, configure.in:
+
+ - The Solaris 2.5 kernel has moved to /kernel/genunix
+ - Thanks goes to pommier@volnay.stortek.com (Vincent Pommier (Toulouse))
+
+1996-01-24 16:36 hardaker
+
+ * Makefile.in, acconfig.h, config.h.in,
+ ece-mib.def, sedscript.in:
+
+ - (Makefile, config.h, ece-mib.*, sedscript.in)
+ - changed the way mib.txt is built
+ - split the command into two parts to build a ece-mib.txt as well
+ - added a new ObjectID addition to ece-mib.txt
+ - DEFMAXLOADAVE -> DREMOVEMEEFMAXLOADAVE
+
+1996-01-24 16:33 hardaker
+
+ * agent/snmpd.c:
+
+ - Patch from Dave Shield <D.T.Shield@csc.liv.ac.uk>
+ - fixes -p PORT command line option to actually use the requested port.
+ - fixes the -l LOGFILE command line option to actually use it.
+
+1996-01-24 16:31 hardaker
+
+ * agent/snmp_vars.c:
+
+ - Returning EXTENSIBLEDOTMIB.AGENTID as the new objectid
+
+1996-01-22 17:30 hardaker
+
+ * ChangeLog, NEWS:
+
+ - (ChangeLog,NEWS)
+ - Preped for 3.0.5 release
+
+1996-01-22 17:23 hardaker
+
+ * local/snmpcheck.def:
+
+ - (local/snmpcheck)
+ - added agent controls: restart, updateconfig, clearcache.
+ - removed an old debugging printf.
+ - ctrl-f => fixall.
+ - Added keyboard accelerators to the associated menu items.
+ - Made highlightThickness a global parameter via $window->option('add').
+ - Added a entry box to the executable commands with the command to run.
+
+1996-01-22 17:18 hardaker
+
+ * local/Makefile.in:
+
+ - (local/Makefile.in) Added a chmod to make the snmpcheck script executable
+
+1996-01-22 16:27 hardaker
+
+ * Makefile.in, acconfig.h, config.h.in,
+ agent/snmp_vars.c:
+
+ - (acconfig.h, agent/snmp_vars.c, agent/extensible/*.c)
+ - Added new defines to turn on/off sections of the extensible mib.
+ - This also fixes the mib.txt file definitions if something is turned off.
+ - (Makefile.in) removed ${srcdir} from the front of stamp-h.in
+
+1996-01-19 17:31 hardaker
+
+ * Makefile.in, configure, configure.in,
+ remove-files:
+
+ - (configure*)
+ - updated to autoconf v2.7
+ - Hopefully now using correct 'make' definitions
+
+1995-12-28 15:24 hardaker
+
+ * Makefile.in, local/Makefile.in:
+
+ - (Makefile.in, local/Makefile.in) Minor cleanups.
+
+1995-12-28 12:14 hardaker
+
+ * ChangeLog, EXAMPLE.conf.def:
+
+ - (ChangeLog,EXAMPLE.conf.def) spell check (sigh)
+
+1995-12-28 12:09 hardaker
+
+ * .cvsignore, ChangeLog, EXAMPLE.conf.def,
+ Makefile.in, NEWS, README, sedscript.in:
+
+ - Created a EXAMPLE.conf file for example usage.
+
+1995-12-28 10:44 hardaker
+
+ * ChangeLog, NEWS:
+
+ - (ChangeLog, NEWS): Updated these for 3.0.4 release.
+
+1995-12-28 10:30 hardaker
+
+ * local/Makefile.in:
+
+ - (local/Makefile.in): Never finished the install item.
+
+1995-12-28 10:22 hardaker
+
+ * Makefile.in, TODO, acconfig.h, config.h.in
+, configure, configure.in, ece-mib.def,
+ sedscript.in, local/.cvsignore, local/Makefile.in
+, local/snmpcheck.def, TODO:
+
+ - Added a sedscript which is built from config.h and agent/extensible/mibdefs.h
+ - used to dynamically build mib.txt and local/snmpcheck.
+
+1995-12-28 10:01 hardaker
+
+ * .cvsignore:
+
+ - Added sedscript to the .cvsignore file.
+
+1995-12-20 15:56 hardaker
+
+ * agent/snmp_var_route.c:
+
+ - Found and fixed a memory leak in the routing table mib.
+
+1995-12-20 09:53 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - snmp_open calls getservbyname only once now, at the request of Gary
+ Hayward <gah@dirac.bellcore.com>.
+
+1995-12-05 15:01 hardaker
+
+ * local/snmpcheck.def:
+
+ - (snmpcheck)
+ - New flag: -d, don't start checking anything. Just bring up interface.
+ - check for blank output of snmpget before parsing with s///g
+ constructs.
+
+1995-12-05 14:57 hardaker
+
+ * config.h.in, configure, configure.in:
+
+ - (configure*) added AC_TYPE_PID_T to the configure checks
+
+1995-12-01 16:20 hardaker
+
+ * local/snmpcheck.def:
+
+ - local/snmpcheck: *new features*
+ - handles failed snmpwalk/get/sets much more gracefully now
+ - new preference: You can pick what types of problems to check for
+ - -f on the command line only checks for fixable problems
+ - no longer ping::echos hosts before checking them
+ - instead relies on 'No Response' type replies from snmpwalk/get to
+ determine if a host is up.
+ - ping the host is still an option (through the command line and menus)
+ - converted from Tk-b4 to Tk-b8
+ - Added a logging window for debugging and tracking of actions.
+ - new command line options: -V NUM initial log verbosity level
+ -L show the log window at startup
+ - Now translates mib numbers into more reasonable names
+
+1995-11-20 16:10 hardaker
+
+ * local/trapnotif:
+
+ - (trapnotif) Logs no-responce errors.
+ - (trapnotif) Better string checking (quotes all variables now)
+
+1995-11-20 16:09 hardaker
+
+ * config.guess, config.sub, configure,
+ mkinstalldirs:
+
+ - (all autoconf built files) Updated everything to autoconf 2.5
+
+1995-11-20 16:08 hardaker
+
+ * config.h.in:
+
+ - (config.h.in) Check for -lelf for solaris 2.3 and younger
+
+1995-11-20 16:07 hardaker
+
+ * configure.in:
+
+ - (configure.in) Check for -lelf for solaris 2.3 and younger
+ - (configure.in) More solaris specifics: -DSVR4
+ - (configure.in) Caches initial prompt in the configure script so you
+ won't be bugged twice by the initial question.
+
+1995-11-20 16:05 hardaker
+
+ * TODO:
+
+ - (TODO) Find and fix memory leak sometime
+
+1995-11-20 16:04 hardaker
+
+ * README:
+
+ - (README) Added pointer to this file via ftp
+
+1995-10-17 17:27 hardaker
+
+ * ChangeLog:
+
+ ChangeLog update
+
+1995-10-17 17:10 hardaker
+
+ * remove-files:
+
+ remove-files needs to 'cd' to the correct directory first
+
+1995-10-17 16:57 hardaker
+
+ * remove-files:
+
+ added the remove-files export command
+
+1995-10-16 17:23 hardaker
+
+ * configure.in:
+
+ - (configure) One last echo -n vs \c fix
+
+1995-10-16 16:43 hardaker
+
+ * apps/: snmpbulkwalk.c, snmpget.c, snmpgetnext.c
+, snmpset.c, snmptest.c, snmptrapd.c,
+ snmpwalk.c:
+
+ - (apps) all apps were still looking in /etc/ for .conf files
+
+1995-10-16 16:41 hardaker
+
+ * aclocal.m4, configure:
+
+ - (configure) fixed \c vs -n dependency
+
+1995-10-16 16:21 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c) was still looking in /etc for two .conf files.
+
+1995-10-16 15:55 hardaker
+
+ * TODO:
+
+ - Added info request to bottom of TODO
+
+1995-10-16 15:55 hardaker
+
+ * ChangeLog:
+
+ - ChangeLog update
+
+1995-10-16 15:05 hardaker
+
+ * TODO:
+
+ - (TODO) marked install as finished and solaris port as close
+
+1995-10-16 15:01 hardaker
+
+ * INSTALL, Makefile.in, README,
+ agent/Makefile.in, apps/Makefile.in, man/Makefile.in
+, snmplib/Makefile.in:
+
+ - (Makefiles) make install echos what its doing in a more clear fashion
+ - (INSTALL) added better instructions to the INSTALL file.
+ - (README) minor wording changes
+
+1995-10-16 13:01 hardaker
+
+ * Makefile.in, NEWS, configure, configure.in
+, agent/Makefile.in, apps/Makefile.in,
+ man/.cvsignore, man/Makefile.in:
+
+ - (Makefiles) Fairly decent 'make install' now possible. Installs
+ into the directory specified by --prefix for the ./configure script.
+ - (extensible.c) config file re-location: now uses the SNMPLIBPATH
+ defined loosely as $(prefix)/lib/snmp/.
+
+1995-10-13 15:44 hardaker
+
+ * TODO, acconfig.h, config.h.in, configure
+, configure.in, stamp-h, agent/snmpd.c,
+ snmplib/mib.c:
+
+ - (snmpd.c) Added -p port to --help output
+ - (config) Setup to use --prefix to look for config files.
+
+1995-10-11 17:33 hardaker
+
+ * Makefile.in, acconfig.h, aclocal.m4,
+ config.h.in, configure, configure.in,
+ agent/Makefile.in, apps/Makefile.in:
+
+ - The configure script now prompts for important values to be put in
+ config.h. Some things need to use $(prefix) instead however.
+ - (Makefile.in, agent/Makefile.in, apps/Makefile.in)
+ + linking to ../snmplib/libsnmp.a instead of ../lib/libsnmp.a to
+ remove install requirement.
+ + put ../lib/libsnmp.a in application
+
+1995-10-06 16:41 hardaker
+
+ * NEWS, TODO:
+
+ - (NEWS/-TODO) -h/--help, -v/--version command line options
+
+1995-10-06 16:40 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c) Usage of --help and --version should work now... GNU standard.
+
+1995-10-06 16:32 hardaker
+
+ * snmplib/: Makefile.in, parse.c, snmp.c:
+
+ - (parse.c, snmp.c) added config.h to the list of includes.
+
+1995-10-06 16:32 hardaker
+
+ * agent/snmpd.c:
+
+ - (snmpd.c) Added two new flags:
+ -h for help
+ -v for version information
+
+1995-10-06 11:37 hardaker
+
+ * README:
+
+ - (README) Moved INSTALLATION instructions to INSTALL
+ Changed listing of supported architectures
+ Updated AVAILABILITY section
+
+1995-10-06 11:26 hardaker
+
+ * configure.in, configure:
+
+ - (configure, configure.in) now caches more values (ps args, etc) and
+ checks for the location of ps (no longer assuming to be /bin/ps)
+
+1995-10-06 11:24 hardaker
+
+ * INSTALL:
+
+ - (INSTALL) installation instructions moved to here
+
+1995-10-05 15:22 hardaker
+
+ * .cvsignore, TODO, config.h.in, configure,
+ configure.in, stamp-h.in, agent/Makefile.in,
+ agent/kernel_sunos5.c, agent/kernel_sunos5.h,
+ agent/route_write.c, agent/snmp_var_route.c,
+ agent/snmp_vars.c, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in:
+
+ - More Solaris porting.
+ - Most mibII entries now work.
+ - Haven't checked returned information for accuracy
+ - sysUpTime still fails.
+ - cc and gcc both compile everything now.
+
+1995-10-03 09:42 hardaker
+
+ * stamp-h, stamp-h.in:
+
+ (.cvsignore) removed files stamp-h stamp-h.in files since makefile needed them.
+
+1995-10-03 09:35 hardaker
+
+ * Makefile.in:
+
+ (Makefile.in) Removed ./configure and ./config.h.in from "all:" dependencies
+
+1995-10-03 09:31 hardaker
+
+ * .cvsignore:
+
+ (.cvsignore) removed config.h.in from cvs ignore list (bad bad)
+
+1995-10-03 09:31 hardaker
+
+ * config.h.in:
+
+ (config.h.in) Added file.
+
+1995-10-03 09:24 hardaker
+
+ * TODO:
+
+ (TODO) Update of the TODO list: included snmpv1 config ideas
+
+1995-10-03 09:24 hardaker
+
+ * acconfig.h:
+
+ (acconfig.h) Minor bug: recursive comments not correct for compilers (AIX)
+
+1995-09-29 13:46 hardaker
+
+ * NEWS:
+
+ - (NEWS) updated the news file.
+
+1995-09-29 13:41 hardaker
+
+ * .cvsignore, Makefile.in, TODO, acconfig.h
+, config.guess, config.sub, configure,
+ configure.in, install-sh, mkinstalldirs,
+ agent/.cvsignore, agent/Makefile.in, agent/acl_vars.c
+, agent/alarm.c, agent/context_vars.c,
+ agent/event.c, agent/kernel.c, agent/party_vars.c
+, agent/route_write.c, agent/snmp_agent.c,
+ agent/snmp_var_route.c, agent/snmp_vars.c,
+ agent/snmp_vars.h, agent/snmpd.c, agent/view_parse.c
+, agent/view_vars.c, apps/.cvsignore,
+ apps/Makefile.in, apps/snmpbulkwalk.c, apps/snmpget.c
+, apps/snmpgetnext.c, apps/snmpset.c,
+ apps/snmptest.c, apps/snmptranslate.c, apps/snmptrapd.c
+, apps/snmpwalk.c, apps/snmpnetstat/.cvsignore,
+ apps/snmpnetstat/Makefile.in, apps/snmpnetstat/if.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/main.c,
+ apps/snmpnetstat/route.c, snmplib/.cvsignore,
+ snmplib/Makefile.in, snmplib/acl.c, snmplib/acl_parse.c
+, snmplib/asn1.c, snmplib/context.c,
+ snmplib/context_parse.c, snmplib/md5.c, snmplib/mib.c
+, snmplib/party.c, snmplib/party_parse.c,
+ snmplib/snmp.c, snmplib/snmp_api.c, snmplib/snmp_auth.c
+, snmplib/snmp_client.c, snmplib/system.c,
+ snmplib/view.c:
+
+ - ported to GNU's autoconfig2.4
+ - to install, you must now run ./configure first to generate the
+ Makefiles and config.h
+ - almost all of the code is now dynamically checked for problems
+ rather than being dependant on architecture names.
+ - system name now dynamically determined at run time (from uname -n)
+ - created a 'make depend' call (finally).
+ - (agent/snmp_vars.h) changed SYSNAME define to SYSTEMNAME define to
+ avoid a conflict with a solaris header file.
+ - protecting better against include header files twice.
+ - Most of port to Solaris 2.4 finished. The kernel reads still need work.
+
+1995-09-21 09:29 hardaker
+
+ * ChangeLog, NEWS:
+
+ 3.0.2.1 release (compilation bug fix)
+
+1995-09-21 09:27 hardaker
+
+ * snmplib/md5.c:
+
+ (snmplib/md5.c) Forgot to include sys/types.h for u_long definition.
+
+1995-09-18 16:24 hardaker
+
+ * ChangeLog, NEWS:
+
+ News/Changelog updates
+
+1995-09-18 16:14 hardaker
+
+ * man/snmpd.1.def:
+
+ Beginnings of a manual page for snmpd
+
+1995-09-18 16:09 hardaker
+
+ * README:
+
+ Minor mods to README file.
+
+1995-09-01 14:52 hardaker
+
+ * NEWS:
+
+ Added a NEWS file to report/record major changes
+
+1995-09-01 11:57 hardaker
+
+ * agent/: kernel.c, snmp_var_route.c, snmp_vars.c
+:
+
+ - Fixed alpha's kernel lookups:
+ * CMU code was passing ints into lseek (needs long).
+
+1995-07-31 16:27 hardaker
+
+ * local/snmpcheck.def:
+
+ - snmpcheck changes:
+ - terminal (ascii) based supported fixed.
+ - Detects presence of a DISPLAY variable.
+ - Now requires the Term::Readkey package.
+ - asks users weather to fix problems
+ - raises and deiconifies when new problems are found
+ - sets the background color of new problems to pinkish
+ - new prefence: ping host?
+ - global key bindings:
+ ctrl-q = quit; ctrl-h = hide; ctrl-s = seen all
+
+1995-07-28 14:23 hardaker
+
+ * acconfig.h, agent/snmp_vars.c:
+
+ Yet more problems fixed in the alpha port.
+ -- more int -> long checking.
+
+1995-07-26 16:30 hardaker
+
+ * acconfig.h, agent/kernel.c, agent/route_write.c
+, agent/snmp_var_route.c, agent/snmp_vars.c,
+ agent/snmpd.c, snmplib/asn1.c, snmplib/md5.c,
+ snmplib/snmp_auth.c:
+
+ - Added a new #define: EXIT_ON_BAD_KLREAD to config.h
+ If defined, and an error occurs while reading the kernel contents,
+ the agent will exit. This was the default. I wanted it to
+ continue.
+
+ - Port to dec-alpha/OSF 3.1
+ - alpha's long is 8 bytes, not 4.
+ - should be (mostly) 64 bit clean now.
+ - cleaned up a LOT of bugs CMU code in the process.
+
+1995-07-14 15:20 hardaker
+
+ * ChangeLog:
+
+ Changelog update
+
+1995-07-14 15:15 hardaker
+
+ * local/snmpcheck.def:
+
+ - snmpcheck (tk-perl-b4 script) is pretty stable at this point. I
+ lost curses support, and need to re-add it still, so it is still
+ beta. It does expect a log file of problems to exist (point it to
+ /dev/null), and needs to know the locations of the mibs to check
+ (which aren't configured by 'make'), so it needs some work.
+ However, it will query an agent, check its problems based on the
+ status of the error flag (or return code) being >1 and report them
+ with neat GUI-buttons and stuff (oh wow). No documentation on it though.
+
+1995-07-14 15:12 hardaker
+
+ * agent/snmpd.c:
+
+ - Finished the restart mib. This is a setable sub-mib of the version
+ mib, default to VERSION.12(.1). If snmp-set to '1', it will restart
+ the agent.
+
+ * A side effect of this is that it restarts 3 times or so, since it
+ never returns a responce to the program generating the request.
+ If said program tries to resend the request (which most do), it
+ will AGAIN restart the agent... oh well.
+
+1995-07-10 12:30 hardaker
+
+ * acconfig.h:
+
+ Minor comment change in config.h
+
+1995-07-10 11:27 hardaker
+
+ * agent/snmpd.c:
+
+ Two new command line options:
+ -l LOGFILE Outputs stderr/out to LOGFILE (overrides config.h def)
+ -L Do NOT write to a log file (overrides config.h)
+
+1995-06-21 09:20 hardaker
+
+ * snmplib/snmp_client.c:
+
+ snmplib:
+ Bug fix: fdset -> (int *) fdset in select call.
+
+1995-06-21 09:19 hardaker
+
+ * snmplib/Makefile.in:
+
+ Changed default CC to cc again.
+
+1995-06-21 09:18 hardaker
+
+ * ece-mib.def:
+
+ ece-mib.def:
+ Bug Fix:
+ Loadave mib: Integer -> DisplayString
+ versionClearCache: -> read-write (was read-only)
+
+ Feature:
+ Added a setable mib entry to the version mib to re-read the config file(s).
+
+1995-06-21 09:11 hardaker
+
+ * agent/snmp_agent.c:
+
+ Changed another "empty" error message in the CMU code to a real warning.
+
+1995-06-16 14:20 hardaker
+
+ * agent/snmp_vars.c:
+
+ House Cleaning:
+ Missed a VERSION_ID
+
+1995-06-16 14:02 hardaker
+
+ * agent/Makefile.in:
+
+ House Cleaning:
+ Took out gcc/ansi requirement for the agent.
+ perror() is called more frequently for log archival
+
+ New Bug/Haven't solved:
+ HP-UX: if agent/*.c and agent/extensible/*.c are built with gcc,
+ DisplayStrings return garbage. No clue as to why.
+
+1995-06-16 10:15 hardaker
+
+ * agent/: snmp_var_route.c, snmp_vars.c, snmp_vars.h
+, snmpd.c:
+
+ House cleaning
+ - Compiles cleanly on hpux/gcc
+ (except one include file error I don't have control over.)
+ - Change VERSION_ID -> VERSIONID to avoid conflicts with HP's includes.
+
+1995-06-16 10:13 hardaker
+
+ * agent/Makefile.in:
+
+ Removed 'gmake' -> 'make' in agent/Makefile
+
+1995-06-14 14:09 hardaker
+
+ * README:
+
+ Added AVAILABILITY section to the README file.
+
+1995-06-14 13:56 hardaker
+
+ * ChangeLog, README:
+
+ Updated the ChangeLog
+ Added a "real" disclaimer to the README file.
+
+1995-06-14 13:43 hardaker
+
+ * README:
+
+ - Added more documentation to the README file.
+ - Created a mailing list to handle announcements
+ (ucd-snmp-announce@ece.ucdavis.edu)
+
+1995-06-14 12:56 hardaker
+
+ * acconfig.h, agent/snmp_vars.c:
+
+ - Cleaned up/Added more documentation to config.h
+ - GLOBALSECURITY now uses the left most four bits in the MIB acl.
+ This is more compatible with the CMU code than using the left most
+ 2, which was done previously.
+
+1995-06-14 11:24 hardaker
+
+ * agent/snmp_vars.c:
+
+ agent:
+ - Mib table is now qsorted at run time and the extensible variables are
+ sorted in at this time. This brings the agent up to correct
+ SNMPwalk/getnext protocols. You can now walk the entire tree
+ including the extensible sections and it won't stop.
+ * This has an added bonus of checking the mib table
+ (agent/snmp_vars.c) for correct order. I have added things to the
+ wrong location too many times and caused the agent to function
+ incorrectly. Major win.
+
+1995-06-12 10:35 hardaker
+
+ * local/trapnotif:
+
+ local/trapnotif:
+ -- uses snmpv2 now (correctly)
+
+1995-06-09 14:08 hardaker
+
+ * snmplib/Makefile.in:
+
+ Changed test -x to test -f in snmplib/Makefile. Not all OSes
+ (ie ultrix) handle this.
+
+1995-06-09 13:21 hardaker
+
+ * snmplib/md5.c:
+
+ Fixed Authentication error (again) (correct this time) between
+ reversed byte order machines.
+ -- #ifdef hpux/SYSV/sun in md5.c reverses byte order
+
+1995-06-09 12:39 hardaker
+
+ * snmplib/md5.c:
+
+ Fixed Authentication error between reversed byte order machines.
+ -- #ifdef hpux/SYSV in md5.c reverses byte order
+
+1995-06-09 10:21 hardaker
+
+ * agent/snmp_vars.c:
+
+ Correctly ordered the mib table list.
+ -- Need to write a dynamic checker/re-orderer.
+
+1995-06-09 10:20 hardaker
+
+ * acconfig.h, snmplib/Makefile.in,
+ snmplib/snmp_client.c:
+
+ Added a SNMPBLOCK option to the config.h file. Supposedily setting
+ this to zero (now the default) will allow snmp requests to time out.
+ Haven't tested it throughly.
+ -- Contributed by Sanjai Narain <narain@thumper.bellcore.com>
+
+1995-06-05 12:44 hardaker
+
+ * ChangeLog, README, agent/snmp_vars.c:
+
+ * agent/extensible/Makefile:
+ -- no longer requires GNU make
+ -- etags no longer run by default
+
+ * SunOS additions:
+ -- loadaverage checking MIB enabled
+ -- disk checking MIB enabled
+
+1995-06-02 16:21 hardaker
+
+ * README:
+
+ Final modification for inital release
+
+1995-06-02 15:41 hardaker
+
+ * agent/snmp_vars.c:
+
+ #ifdef hpux around hpux specific mibs
+
+1995-06-02 15:31 hardaker
+
+ * snmplib/snmp_impl.h:
+
+ ERROR() define now flushes stdout
+
+1995-06-02 15:30 hardaker
+
+ * local/trapnotif:
+
+ Now uses v2 request protocol.
+
+1995-06-02 15:28 hardaker
+
+ * agent/snmp_agent.c:
+
+ Prints MIB to stdout for existent mibs
+
+1995-06-02 15:27 hardaker
+
+ * agent/snmp_vars.c:
+
+ Added a check for SNMPV2/SNMPV2AUTH type authorization.
+
+1995-06-02 15:27 hardaker
+
+ * acconfig.h:
+
+ Reorganized config.h in more or less order of importance
+ Added definitions for SNMPV2ONLY type authorization.
+
+1995-06-02 15:26 hardaker
+
+ * ece-mib.def:
+
+ removed bogus two lines
+
+1995-05-31 16:30 hardaker
+
+ * agent/snmp_vars.c:
+
+ New:
+
+ Added two new ACL types: PRIVAUTHRW and PRIVAUTHRO which will only
+ work if the request is authenticated (by anything).
+
+1995-05-31 14:49 hardaker
+
+ * README:
+
+ New:
+
+ Added -f option to README
+
+1995-05-31 14:49 hardaker
+
+ * ece-mib.def:
+
+ New:
+
+ New MIB: snmpErrors to log problems with the agent
+
+1995-05-31 14:47 hardaker
+
+ * agent/: Makefile.in, snmp_vars.c, snmpd.c:
+
+ New:
+
+ New definition included for a default place to log messages: LOGFILE
+ New MIB: snmpErrors to log problems with the agent
+ Forks away from calling shell by default now unless -f specified.
+
+ Misc:
+
+ Ifdefs around all added sections of code to disable durning compilation
+
+1995-05-31 14:45 hardaker
+
+ * acconfig.h:
+
+ New:
+
+ New definition included for a default place to log messages: LOGFILE
+ New MIB: snmpErrors to log problems with the agent
+
+ Bugs:
+
+ hpux compliers don't define SYSV by default...
+
+1995-05-19 15:45 hardaker
+
+ * local/snmpcheck.def:
+
+ Added menus and moved some commands there as well as prefrences.
+ Now rescans after 5 minutes and checks the log.
+
+1995-05-19 15:44 hardaker
+
+ * local/trapnotif:
+
+ egreping for an exact match for hosts now.
+
+1995-05-19 15:43 hardaker
+
+ * agent/snmp_vars.c:
+
+ More defines moved to config.h
+
+1995-05-19 15:42 hardaker
+
+ * README, acconfig.h, ece-mib.def:
+
+ Working toward an exportable version.
+
+1995-05-17 12:45 hardaker
+
+ * local/snmpcheck.def:
+
+ Working version.
+ -- now operates on a selection
+ -- still has a lot of room for improvement.
+
+1995-05-08 16:25 hardaker
+
+ * local/snmpcheck.def:
+
+ Fairly functioning version.
+ Need to port to perl5.001 & tk4b3
+
+1995-05-05 17:01 hardaker
+
+ * agent/snmp_vars.c:
+
+ Opps. Set tp->namelen to be -1, when it is a unsigned char. Using 0 now.
+
+1995-05-05 16:18 hardaker
+
+ * acconfig.h, agent/Makefile.in, agent/snmp_vars.c
+:
+
+ Re-arranging and Re-naming stuff for external distribution
+
+1995-05-03 13:05 hardaker
+
+ * agent/snmp_vars.c:
+
+ Major bug:
+ Changing tree size caused problems.
+ extensible tree now adds a halt condition (namelen = -1) to check for
+
+1995-05-03 12:23 hardaker
+
+ * agent/snmp_vars.c:
+
+ Added prototype declairation for find_extensible()
+
+1995-05-03 09:23 hardaker
+
+ * local/trapnotif:
+
+ Changed timeout to be 30 seconds.
+
+1995-05-03 09:21 hardaker
+
+ * local/rsnmp:
+
+ New script:
+ walks an extensible (or any) mib tree. Has built in knowledge of
+ the mibs for lay-peoples useage.
+
+1995-05-03 09:19 hardaker
+
+ * local/fixproc:
+
+ Fixed bug: Using a wrong variable
+
+1995-05-03 09:12 hardaker
+
+ * agent/snmp_vars.c:
+
+ Added extensible mib entry.
+ -- find_extensible now returns the default mib tree or an
+ appropriate mib tree with the created extensible entry in it.
+
+1995-05-03 09:10 hardaker
+
+ * ece-mib.def:
+
+ Added load average mib entry
+
+1995-04-17 12:25 hardaker
+
+ * local/snmpcheck.def:
+
+ Started writting a Tk interface... Code is still very very ugly, but works.
+
+1995-04-17 12:24 hardaker
+
+ * local/trapnotif:
+
+ Now logs itself correctly.
+
+1995-04-13 14:12 hardaker
+
+ * agent/Makefile.in:
+
+ Added a dependancy for wes/mibdefs.h to snmp_vars.c
+
+1995-04-07 12:46 hardaker
+
+ * agent/snmp_vars.c, agent/snmpd.c, apps/snmptrapd.c
+, apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/main.c, snmplib/system.c:
+
+ -- Ported to dec 5000/200 Ultrix 4.2 architectures
+ TODO: memory/swap in wes.c
+
+1995-03-31 15:33 hardaker
+
+ * local/snmpcheck.def:
+
+ Bugs:
+ Was acting slow since it was checking each mib location twice.
+ Removed perl -w warnings
+
+1995-03-15 16:48 hardaker
+
+ * local/snmpcheck.def:
+
+ snmpcheck is now written using perl5's object oriented routines.
+
+1995-03-15 14:19 hardaker
+
+ * snmplib/parse.c:
+
+ CMU Bug fixes:
+ -- better job than my previous hack fixing get_token.
+ + get_token now requires a third argument dictating the max string
+ length the token can hold.
+
+1995-03-15 09:26 hardaker
+
+ * README:
+
+ Updated README.hpux file from HP-port-1-1-1...
+
+1995-03-15 09:23 hardaker
+
+ * local/snmpcheck.def:
+
+ perl -> perl5
+ No longer depends on OVs snmpset, can now use CMUs snmpset (/usr/local/etc)
+
+1995-03-10 13:34 hardaker
+
+ * snmplib/mib.c:
+
+ Added /etc as another path to search when looking for mib.txt
+
+1995-03-10 13:30 hardaker
+
+ * snmplib/parse.c:
+
+ Major hacking to parse() to work at all.
+ -- Now I don't unstand why it ever successfully parsed the mib.txt file.
+ -- get_token was constantly called to read DESCRIPTION strings into
+ a char array of either 64 (MAXTOKEN) or 4096 (MAXQUOTESTR) in
+ length. MANY of the DESCRIPTION strings are longer than this.
+ -- Hacked parseQuotedString to make sure returned are strings < MAXQUOTESTR
+
+1995-03-10 13:18 hardaker
+
+ * apps/snmptrapd.c, snmplib/system.c:
+
+ #include <socketio.h> is not needed on HPUX
+
+1995-03-10 13:18 hardaker
+
+ * apps/.cvsignore:
+
+ Added snmpgetnext and snmpset to .cvsignore
+
+1995-03-09 13:22 hardaker
+
+ * agent/Makefile.in, agent/snmpd.c, snmplib/Makefile.in
+, snmplib/party_parse.c, snmplib/snmp_client.c:
+
+ CMU 2.1.2 -> 2.1.2.1 Merge.
+
+1995-03-08 16:07 hardaker
+
+ * apps/snmpset.c, apps/snmpgetnext.c,
+ man/snmpbulkwalk.1, man/snmpget.1, man/snmpgetnext.1
+, man/snmpnetstat.1, man/snmpset.1,
+ man/snmptranslate.1, man/snmptrapd.8:
+
+ Initial revision
+
+1995-03-08 16:06 hardaker
+
+ * Makefile.in, README.cmu, agent/Makefile.in
+, agent/snmpd.c, apps/Makefile.in,
+ apps/snmpget.c, apps/snmptest.c,
+ apps/snmpbulkwalk.c, apps/snmptrapd.c,
+ apps/snmpwalk.c, apps/snmpset.c,
+ apps/snmptranslate.c, apps/snmpgetnext.c,
+ apps/snmpnetstat/Makefile.in, apps/snmpnetstat/if.c
+, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/route.c
+, man/README, man/snmptest.1,
+ man/snmpwalk.1, man/snmpbulkwalk.1,
+ man/snmpget.1, man/snmpgetnext.1,
+ man/snmpnetstat.1, man/snmpset.1,
+ man/snmptranslate.1, man/snmptrapd.8,
+ snmplib/Makefile.in, snmplib/acl.c,
+ snmplib/acl.h, snmplib/asn1.c,
+ snmplib/context.c, snmplib/context.h,
+ snmplib/context_parse.c, snmplib/mib.c,
+ snmplib/parse.c, snmplib/parse.h,
+ snmplib/party.c, snmplib/party.h,
+ snmplib/party_parse.c, snmplib/snmp_api.c,
+ snmplib/snmp_api.h, snmplib/snmp_auth.c,
+ snmplib/snmp_client.c, snmplib/snmp_impl.h,
+ snmplib/system.c, snmplib/view.c,
+ snmplib/view.h:
+
+ New release of CMU's code:
+ -- See README for specific details
+ -- snmpset,snmpgetnext added
+ -- -q flag added "quick print"
+ -- bug fixes
+ -- Man pages updated
+
+1995-03-02 14:09 hardaker
+
+ * local/snmpcheck.def:
+
+ Minor backspace changes...
+ Removed -w switch for perl
+
+1995-03-02 14:09 hardaker
+
+ * local/fixproc:
+
+ Fix from Tim: correctly finds pid now
+
+1995-02-09 12:33 hardaker
+
+ * local/snmpcheck.def:
+
+ perl -w produces no warnings now if no cmd line args are given.
+ Added two more status indicators (sleeping, checking) for fix routine.
+ Now sleeps for 2 seconds instead of 1 (not quick enough to catch X restarts)
+
+1995-02-09 12:31 hardaker
+
+ * local/fixproc:
+
+ Changed ps -el to ps -e: ps -el reported X as being alive instead of <defunct>
+
+1995-02-08 15:20 hardaker
+
+ * ece-mib.def:
+
+ Added a mib to provide capability for ignoring the exec cache.
+ -- Needed immediately following a 'fix' to check to see if the 'fix' worked.
+
+1995-02-08 15:04 hardaker
+
+ * local/snmpcheck.def:
+
+ Pokes the reset-cache mib to ensure a new 'ps' output for fixed problems.
+
+1995-02-08 14:46 hardaker
+
+ * local/snmpcheck.def:
+
+ New options:
+ -y: always try to fix the problems
+ -n: never try to fix the problems
+ Currently defaults to never (should prompt) till I can get perl's
+ getc(STDIN) to work...
+ Uses snmpset to accomplish this, which is OVs and only licenced for one host.
+
+1995-02-08 10:34 hardaker
+
+ * agent/: kernel.c, snmpd.c:
+
+ Added 'close on exec' flags to open files (/dev/*mem*) and sockets.
+ -- Prevents spawned processes from keeping snmpd from restarting.
+ (Errors were: Can't bind socket (in use) and Can't open /dev/dmem)
+ Set O_RDONLY flag on /dev/*mem* files, required by the 'man page' (else undef)
+
+1995-02-03 13:51 hardaker
+
+ * agent/Makefile.in:
+
+ Added wes/exec.o
+
+1995-02-03 13:49 hardaker
+
+ * ece-mib.def:
+
+ Added mib defs for the read/write fix for procs and exec functions
+
+1995-02-03 13:38 hardaker
+
+ * local/: ece-snmpd.conf, fixproc, fixproc.conf:
+
+ Added fixproc and its database (installed in /local/scripts and /local/etc)
+ Copied the current /etc/ece-snmpd.conf to this directory, for
+ archiving.
+
+1995-02-01 14:24 hardaker
+
+ * agent/: Makefile.in, snmp_agent.c:
+
+ Added write-mib ability to fix a given process
+ -- will eventually call Tim's script to fix the process
+ -- Defined in wes.h
+
+1995-02-01 11:57 hardaker
+
+ * agent/Makefile.in:
+
+ Fixed Makefile bug: calles $(MAKE) now instead of explicit make.
+
+1995-01-30 13:33 hardaker
+
+ * ece-mib.def:
+
+ Version information now contains a CVS tag info mib
+ VERCDATE now works properly.
+
+1995-01-30 11:19 hardaker
+
+ * ece-mib.def:
+
+ Added version mib to definitions.
+
+1995-01-30 11:08 hardaker
+
+ * agent/: Makefile.in, snmp_vars.c:
+
+ Added version mib (VERIDENT,VERDATE,VERCDATE)
+ Added mibincl.h and mibdefs.h to start splitting up mibs in wes.c into
+ seperate files. Include these two files to include necessary defs
+ ERRORMSG defs now ALL return current numerical result with the msg.
+
+1995-01-27 17:10 hardaker
+
+ * agent/snmp_vars.c:
+
+ Put in defines for the sub mib nums {snmp_vars.c, wes.h}
+
+1995-01-27 13:17 hardaker
+
+ * local/snmpcheck.def:
+
+ Added paths (/usr/local/etc) to snmp{get,walk}
+
+1995-01-27 12:45 hardaker
+
+ * agent/snmp_vars.c:
+
+ Made nlist entry changes. no longer dies from a ArpTable query.
+
+1995-01-27 12:26 hardaker
+
+ * agent/snmp_vars.c:
+
+ Moved kernel/nlist printout of not found nlist entries out of #ifdef hpux
+
+1995-01-27 11:42 hardaker
+
+ * agent/snmp_vars.c:
+
+ cpp Mistake fix: #ifdef HPUX -> #ifdef hpux
+
+1995-01-25 17:14 hardaker
+
+ * agent/snmp_vars.c:
+
+ Ported (back) to Sun4:
+ -- swap and disk mibs not supported yet
+ -- found numerous bugs I hadn't noticed under HPUX, mostly type
+ casting.
+
+1995-01-25 16:19 hardaker
+
+ * local/snmpcheck.def:
+
+ Added Swap/Memory mib check (.4), now that it conforms to .{1,2,100,101} specs.
+ Changed formating to use %-n.ns specifications instead of tab seperations.
+
+1995-01-23 16:02 hardaker
+
+ * local/trapnotif:
+
+ Bug fix: Polled wrong mib (100 instead of 101) for errmsg string.
+
+1995-01-23 12:57 hardaker
+
+ * ece-mib.def:
+
+ Typo fixes in the mib def file for OV.
+
+1995-01-23 12:00 hardaker
+
+ * local/snmpcheck.def:
+
+ Won't check down hosts:-)
+
+1995-01-23 10:57 hardaker
+
+ * ece-mib.def:
+
+ All (watched) mibs now use:
+ 1: MIBINDEX, just an index to the number of vars
+ 2: ERRORNAME, a generic one word name for the cause of ERROR{FLAG,MSG}.
+
+1995-01-23 10:37 hardaker
+
+ * local/trapnotif:
+
+ Added /1/OV/bin to the path to find the snmp utils without path extensions.
+ More variable usage: removed use of command line args directly.
+ If the error flag has changed back to normal, only log it in the
+ ece-total log file instead.
+
+1995-01-23 10:26 hardaker
+
+ * local/snmpcheck.def:
+
+ Will take hosts from the log file if none specified on the command line.
+ -- or if the first arg is a '-a' will (A)dd to the command line list.
+ Displays what host it is checking as it checks it.
+ Changed the output format (I've yet to see if it actually looks good though).
+
+1995-01-18 15:22 hardaker
+
+ * local/snmpcheck.def:
+
+ Beginning of a script to check errors with a machine and report them
+ via snmp
+ TODO: option to fix the errors if root on clover (need to rsh to the machine)
+
+1995-01-05 14:51 hardaker
+
+ * local/trapnotif:
+
+ Changed the trapnotif file to reflect recent source changes:
+ -- removed mem error section... They are handled via the normal err
+ route since they now have an error msg like the rest
+ -- Error flag is now at 100, and error message is at 101.
+
+1995-01-05 14:45 hardaker
+
+ * ece-mib.def:
+
+ Changed the mib file to reflect the current source code.
+ All mibs now have ErrorFlag and ErrorMsg as 100,101
+
+1995-01-05 14:44 hardaker
+
+ * local/: trapnotif, wesrestart:
+
+ copied the restart and trapnotif scripts to the src tree for cvs archiving.
+
+1995-01-04 16:32 hardaker
+
+ * ece-mib.def:
+
+ Initial release.
+ Needs to be updated.
+
+1995-01-04 16:30 hardaker
+
+ * apps/: .cvsignore, snmpnetstat/.cvsignore:
+
+ Just a .cvsignore file
+
+1995-01-04 16:26 hardaker
+
+ * agent/: .cvsignore, snmp_vars.c:
+
+ Feature:
+ Added the disk watching facilities to report disk space
+ -- new config option 'disk DISK MINAVAIL'
+ Added support for a second config file as CONFIGFILETWO
+ -- defaults to /etc/ece-snmpd.local.conf
+ -- intent: one is rdisted and one is machine specific
+ -- TODO: Needs to erase previous definitions rather than adding
+ two wit the same name
+
+ Change:
+ MIB definition change:
+ -- All mibs with error flags now use ERRORFLAG/ERRORMSG instead.
+ -- These default to 100 and 101, and are set by only two defines
+ Shortened error message for process errors to fit on the screen.
+ Swap mib code cleanup
+
+ TODO:
+ Added beginnings of kernal locking tests. Need to find a machine
+ with a broken rpc.lockd to test the code though.
+
+ Bugs:
+ My nlist array didn't have a NULL ending.
+
+1994-12-14 17:13 hardaker
+
+ * README:
+
+ Added the README file
+
+1994-12-14 17:02 hardaker
+
+ * snmplib/hpux.c:
+
+ Added hpux.c
+
+1994-12-14 16:55 hardaker
+
+ * snmplib/: Makefile.in, party_parse.c, snmp_client.c
+:
+
+ HP-UX port of the CMU code
+
+1994-12-14 15:43 hardaker
+
+ * Makefile.in, README.cmu, mibII.txt,
+ snmplib/asn1.c, snmplib/mib.c, snmplib/parse.c
+, snmplib/snmp.c, snmplib/snmp_api.c,
+ snmplib/snmp_auth.c, snmplib/asn1.h,
+ snmplib/mib.h, snmplib/parse.h,
+ snmplib/snmp_client.c, snmplib/Makefile.in,
+ snmplib/acl_parse.c, snmplib/snmp.h,
+ snmplib/snmp_api.h, snmplib/snmp_client.h,
+ snmplib/snmp_impl.h, snmplib/acl.c,
+ snmplib/acl.h, snmplib/party.c, snmplib/party.h
+, snmplib/party_parse.c, snmplib/view.c
+, snmplib/context.c, snmplib/context.h
+, snmplib/context_parse.c, snmplib/md5.c
+, snmplib/md5.h, snmplib/view.h,
+ apps/Makefile.in, apps/snmpget.c, snmplib/.pure
+, snmplib/system.c, snmplib/system.h,
+ apps/snmpbulkwalk.c, apps/snmptest.c,
+ apps/snmptranslate.c, apps/snmpwalk.c,
+ apps/snmptrapd.c, apps/snmpnetstat/Makefile.in,
+ apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/main.h
+, apps/snmpnetstat/route.c, man/snmp_api.3
+, man/snmptest.1, man/snmpwalk.1,
+ man/variables.5, man/README, man/des.1
+, man/des.3:
+
+ Initial CMU snmp code, version 2.1.2
+
+1994-12-14 15:43 hardaker
+
+ * Makefile.in, README.cmu, mibII.txt,
+ snmplib/asn1.c, snmplib/mib.c, snmplib/parse.c,
+ snmplib/snmp.c, snmplib/snmp_api.c, snmplib/snmp_auth.c
+, snmplib/asn1.h, snmplib/mib.h, snmplib/parse.h
+, snmplib/snmp_client.c, snmplib/Makefile.in,
+ snmplib/acl_parse.c, snmplib/snmp.h, snmplib/snmp_api.h
+, snmplib/snmp_client.h, snmplib/snmp_impl.h,
+ snmplib/acl.c, snmplib/acl.h, snmplib/party.c,
+ snmplib/party.h, snmplib/party_parse.c, snmplib/view.c
+, snmplib/context.c, snmplib/context.h,
+ snmplib/context_parse.c, snmplib/md5.c, snmplib/md5.h
+, snmplib/view.h, apps/Makefile.in, apps/snmpget.c
+, snmplib/.pure, snmplib/system.c,
+ snmplib/system.h, apps/snmpbulkwalk.c, apps/snmptest.c
+, apps/snmptranslate.c, apps/snmpwalk.c,
+ apps/snmptrapd.c, apps/snmpnetstat/Makefile.in,
+ apps/snmpnetstat/if.c, apps/snmpnetstat/inet.c,
+ apps/snmpnetstat/main.c, apps/snmpnetstat/main.h,
+ apps/snmpnetstat/route.c, man/snmp_api.3,
+ man/snmptest.1, man/snmpwalk.1, man/variables.5,
+ man/README, man/des.1, man/des.3:
+
+ Initial revision
+
+1994-11-18 15:59 hardaker
+
+ * agent/: Makefile.in, snmp_agent.c, snmp_vars.c,
+ snmpd.c:
+
+ Added some hp-mibs
+
+1994-11-04 15:47 hardaker
+
+ * agent/snmp_vars.c:
+
+ Added Virtual Memory mib (currently only total and used)
+
+1994-10-28 13:35 hardaker
+
+ * agent/: snmp_var_route.c, snmp_vars.c:
+
+ hp-ux machines now return the correct mib location for their arch type.
+ Added hp-ux to the ifdefs for Route_Scan_Reload() function for correct
+ kernal reading.
+
+1994-10-26 13:31 hardaker
+
+ * agent/: party_vars.c, snmp_vars.c:
+
+ Dec compilation achived, though its not opening any ports when run.
+
+1994-10-24 14:57 hardaker
+
+ * agent/snmp_vars.c:
+
+ Added the extensible mib section.
+
+1994-10-20 16:09 hardaker
+
+ * agent/: Makefile.in, snmp_vars.c, var_struct.h:
+
+ Added the remaining hp-ux symbols
+ put all dependancies for my stuff under wes/
+ moved the variable declairations (structs) to var_structs.h so they could be
+ referenced by other files.
+ Changed the default values to hp-ux from BSD and other misc strings
+ Added appropriate dependancies to the makefile
+ Changed errors and added stuff to the variable declairations for my stuff
+
+1994-10-14 10:46 hardaker
+
+ * agent/: Makefile.in, kernel.c, snmp_var_route.c
+, snmp_vars.c:
+
+ fixed nlist for the hps. Not sure of three particular nlist
+ references (for the arp table). The rest are working.
+ Also added wes/* do the dependances for snmp_vars.c
+
+1994-10-14 08:39 hardaker
+
+ * agent/: kernel.c, snmp_vars.c:
+
+ I fixed the source for compilation and began adding my own mib defs.
+ Any included mibs which make kernal reads still fail.
+
+1994-10-13 13:55 hardaker
+
+ * agent/: Makefile.in, history.h, kernel.c
+, snmp_agent.c, snmp_var_route.c,
+ snmp_vars.h, snmpd.c, alarm.c,
+ event.c, history.c, party_vars.c,
+ snmp_vars.c, snmp_vars_event.h, view_vars.c
+, acl.conf, acl_vars.c, alarm.h
+, context_vars.c, event.h, m2m.h
+, snmp_vars_m2m.h, view_parse.c, .pure
+, route_write.c:
+
+ Inital CMU source.
+
+
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0.8 -> V5.0.9
+
+2003-09-05 23:42 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend,
+ apps/Makefile.depend, apps/snmpnetstat/Makefile.depend
+, snmplib/Makefile.depend:
+
+ make depend
+
+2003-09-05 23:41 hardaker
+
+ * configure, configure.in:
+
+ forgot a test after the if
+
+2003-09-05 23:37 hardaker
+
+ * README:
+
+ added Bob Rowlands
+
+2003-09-05 23:30 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3
+, netsnmp_debug.3, netsnmp_handler.3,
+ netsnmp_instance.3, netsnmp_library.3,
+ netsnmp_mib_utilities.3, netsnmp_mode_end_call.3
+, netsnmp_multiplexer.3, netsnmp_old_api.3
+, netsnmp_read_only.3, netsnmp_scalar.3
+, netsnmp_serialize.3, netsnmp_table.3
+, netsnmp_table_array.3, netsnmp_table_data.3
+, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_todo.3,
+ netsnmp_watcher.3:
+
+ doxygen update
+
+2003-09-05 23:25 hardaker
+
+ * Makefile.top:
+
+ update for 5.0.9
+
+2003-09-05 22:36 hardaker
+
+ * agent/helpers/: table.c, table_iterator.c:
+
+ Patch #800561 from Bob Rowlands to fix 64bit problems (-> size_t)
+
+2003-09-05 22:30 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ Patch #800485 from Bob Rowlands for 64 bit agentx problems
+
+2003-09-05 22:16 hardaker
+
+ * snmplib/snmpusm.c:
+
+ Patch #792008 from Thomas? to allow usmUser tokens to override previous entries
+
+2003-09-05 22:04 hardaker
+
+ * man/: mib2c.1.def, snmpcmd.1.def,
+ snmpdelta.1, snmpdf.1, snmpnetstat.1,
+ snmpstatus.1.def, snmptable.1.def,
+ snmptest.1.def, snmptranslate.1.def:
+
+ Patch #789485 from Bob Rowlands for a long needed overhaul of the manual pages.
+
+2003-09-05 22:00 hardaker
+
+ * Makefile.in, snmplib/Makefile.in:
+
+ one run-away patch
+
+2003-09-05 21:58 hardaker
+
+ * Makefile.in, configure.in, agent/snmpd.c
+, agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/logmatch.c,
+ include/net-snmp/library/system.h, snmplib/mib.c
+, snmplib/parse.c:
+
+ high level comments about contained copyrights moved from the main branch
+
+2003-09-05 21:54 hardaker
+
+ * NEWS:
+
+ minor updates
+
+2003-09-05 21:21 hardaker
+
+ * Makefile.in, configure, configure.in
+:
+
+ Add optional arguments to the --with-perl-modules flag for passing down
+
+2003-09-05 16:57 hardaker
+
+ * agent/snmp_agent.c,
+ include/net-snmp/agent/snmp_agent.h:
+
+ - fix a getbulk bug pointed out by Jurij Smakov.
+
+2003-07-27 16:54 rstory
+
+ * local/mib2c:
+
+ fix filename in error msg, as noted in coders
+
+2003-07-24 18:14 rstory
+
+ * perl/SNMP/SNMP.xs:
+
+ add access to augments tag (fix bug 740082: mib2c handles AUGMENTing tables
+ incorrectly)
+
+2003-07-24 18:13 rstory
+
+ * local/mib2c:
+
+ add indexes from augmented table for tables using augments (fix
+ bug 740082: mib2c handles AUGMENTing tables incorrectly)
+
+2003-07-24 05:27 rstory
+
+ * acconfig.h:
+
+ define NETSNMP_INLINE as empty if not defined
+
+2003-07-10 09:32 rstory
+
+ * dist/nsb-functions:
+
+ fix typo; use which to find scp; add extra config to other config
+
+2003-07-09 20:56 rstory
+
+ * dist/nsb-functions:
+
+ add host/path upload; try to extract more info from make log on error
+
+2003-07-09 20:54 rstory
+
+ * dist/: nsb-package, nsb-nightly:
+
+ add host/path upload params; use new nsb-default-paths
+
+2003-07-03 20:52 rstory
+
+ * snmplib/: container_list_ssll.c, container_null.c
+:
+
+ oops - no new features for 5.0.8
+
+2003-07-03 20:26 rstory
+
+ * snmplib/container_list_ssll.c:
+
+ file container_list_ssll.c was initially added on branch V5-0-patches.
+
+2003-07-03 20:26 rstory
+
+ * snmplib/container_null.c:
+
+ file container_null.c was initially added on branch V5-0-patches.
+
+2003-07-03 20:26 rstory
+
+ * snmplib/: container_list_ssll.c, container_null.c
+:
+
+ new containers
+
+2003-07-02 13:02 hardaker
+
+ * agent/agent_registry.c:
+
+ Patch #724925 from Peter Warasin to fix netsnmp_subtree_unload() to update the root pointer
+
+2003-07-02 12:47 hardaker
+
+ * agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/logmatch.c, snmplib/parse.c
+:
+
+ Patch #760448 from Bob Rowlands/Sun to fix bug #751913 to protect a few minor security violations
+
+2003-07-02 10:44 hardaker
+
+ * snmplib/strlcpy.c:
+
+ file strlcpy.c was initially added on branch V5-0-patches.
+
+2003-07-02 10:44 hardaker
+
+ * COPYING, configure, configure.in,
+ agent/snmpd.c, include/net-snmp/net-snmp-config.h.in
+, include/net-snmp/library/system.h,
+ snmplib/Makefile.in, snmplib/mib.c,
+ snmplib/strlcpy.c:
+
+ Patch #760417 from Bob Rowlands/Sun for fixing Bug #751920 for minor security problems (PID file unliked first, and use strlcpy instead of strcpy. A new strlcpy file was defined if not defined for a system.
+
+2003-07-02 10:37 hardaker
+
+ * snmplib/mib.c:
+
+ don't use isspace and isprint simultaniously
+
+2003-07-02 10:36 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ comment change for clarification
+
+2003-07-02 10:26 hardaker
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ Patch #764047 from Stephen J. Friedl: Remove redundant declaration from snmp_debug.h and fix a few comments
+
+2003-07-02 10:21 hardaker
+
+ * configure, configure.in:
+
+ Patch #759309 from Stephen Friedl to add prompt over-ride flag descriptions to prompt output
+
+2003-07-02 10:19 hardaker
+
+ * configure, configure.in:
+
+ patch #759298: fix spelling error
+
+2003-06-25 14:29 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ fix proxying for getbulk
+
+2003-06-22 07:23 hardaker
+
+ * apps/snmpvacm.c:
+
+ fix usage for flag ordering
+
+2003-06-16 14:59 hardaker
+
+ * testing/RUNTESTS:
+
+ remove no longer needed comment about it being broken, as pointed out
+ by Bruce.
+
+2003-06-16 14:58 hardaker
+
+ * testing/RUNTESTS:
+
+ support , separated arguments to -T like -h says it will.
+
+2003-06-16 14:57 hardaker
+
+ * testing/RUNTESTS:
+
+ Bruce Shaw's patch 755553 to fix RUNTESTS test number reporting when
+ testing subsets are used.
+
+2003-06-16 14:44 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Patch #755540 from Bruce Shaw and IRC:SebNob to fix bug #701439 for 64 bit solaris systems and 64 bit integers returned by getKstat
+
+2003-06-16 14:43 hardaker
+
+ * testing/tests/: T055agentv1mintrap, T056agentv2cmintrap
+:
+
+ Patch #754105 from Bruce Shaw to fix some spelling errors
+
+2003-06-10 15:48 nba
+
+ * snmplib/snmp_api.c:
+
+ Beware of dereferencing a NULL pointer
+
+2003-06-10 10:45 hardaker
+
+ * snmplib/snmp_api.c:
+
+ remove the unused function as pointed out by Bob Rowlands
+
+2003-06-09 16:11 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c, agent/snmp_agent.c
+, include/net-snmp/library/vacm.h,
+ snmplib/vacm.c:
+
+ Long overdue patch #695192 from Ron Tabor to fix the VACM spinning problem that I didn't quite fix before
+
+2003-06-09 16:01 hardaker
+
+ * configure.in, testing/tests/T023snmpv3getMD5DES
+, testing/tests/T025snmpv3getSHADES:
+
+ fix bug #706710 to show when privacy has been disabled
+
+2003-06-09 15:33 hardaker
+
+ * snmplib/snmp_api.c:
+
+ bug #748431 from John Shiver: fix thread-safe problems with snmp_get_fd_for_session (which was missing in the 5.x line anyway)
+
+2003-06-09 14:49 hardaker
+
+ * README.Matsushita.txt, README.Matsushita.txt:
+
+ Patch #748305 from srinivasa rao gurusu describing how to build net-snmp on Matsushita embedded systems
+
+2003-06-09 14:44 hardaker
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ Patch 746339: Otto Solares fixes a file descriptor leak on linux
+
+2003-06-09 14:38 hardaker
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ patch #740918 from Eric E. Bowles: fix pass through invocation for SETs
+
+2003-06-09 14:31 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Patch #749062 to fix caching crashing and clashing under Solaris
+
+2003-06-09 14:28 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ patch #749103 from Garry C Marshall to fix the proxy when a timeout occurs from the target
+
+2003-06-06 23:17 nba
+
+ * snmplib/mib.c:
+
+ Fix missing length byte when setting index with checks disabled
+
+2003-05-28 17:25 hardaker
+
+ * agent/helpers/old_api.c:
+
+ remove unused code as pointed out by Peter Warasin
+
+2003-05-28 14:29 hardaker
+
+ * AGENT.txt:
+
+ added V4/V5 note from main branch to patches
+
+2003-05-23 11:25 rstory
+
+ * snmplib/container_binary_array.c:
+
+ free container after freeing contents
+
+2003-05-23 11:24 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container.c:
+
+ update container free macro/code to deal w/pointer being deleted
+
+2003-05-23 11:22 rstory
+
+ * agent/mibgroup/ucd-snmp/logmatch.c:
+
+ EXTENSIBLEMIB -> UCDAVIS_MIB
+
+2003-05-14 10:30 rstory
+
+ * configure:
+
+ configure to match config.in
+
+2003-05-14 10:28 rstory
+
+ * configure.in:
+
+ fix net-snmp-config chmod to work from configure and config.status
+
+2003-05-12 22:58 hardaker
+
+ * apps/snmptrapd.c:
+
+ Patch #735511 from Alex Burger: fix snmptrapd to ensure there are the correct number of varbinds
+
+2003-05-12 22:55 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Patch #736784 from Ron Tabor: fix proxies for restarted NSMPv3 sub-agents
+
+2003-05-08 16:16 hardaker
+
+ * README:
+
+ mention Andrew Findlay
+
+2003-05-08 16:15 hardaker
+
+ * perl/agent/agent.xs:
+
+ (excellent) patch #705566 from Andrew Findlay on perl agent support:
+
+ 1) Agent cannot return MAC addresses containing zero octet.
+
+ 2) Agent coredumps when trying to return IP addresses
+ if these are supplied as dotted-quad or as a hostname
+ that fails to resolve.
+
+ 3) Agent corrupts OID values.
+
+ 4) Agent truncates any OCTET_STRING or BIT_STRING that
+ contains a zero octet (this is the root cause of (1) above)
+
+ API changes introduced:
+
+ a) IP addresses now passed as binary strings (4 octets
+ for IPv4) rather than dotted-quad or name. This
+ sidesteps the IPv4/IPv6 problem and leaves the calling
+ script to deal with name->address resolution and
+ associated error handling.
+
+2003-05-08 09:42 hardaker
+
+ * README:
+
+ mention Alex Burger, who submitted the perl win32 patches
+
+2003-05-08 09:32 hardaker
+
+ * README:
+
+ mention Stephen
+
+2003-05-08 09:32 hardaker
+
+ * include/net-snmp/library/mib.h,
+ include/net-snmp/library/parse.h,
+ include/net-snmp/library/snmp_api.h,
+ include/net-snmp/library/snmp_client.h, snmplib/mib.c
+, snmplib/snmp_api.c, snmplib/snmp_client.c
+:
+
+ patch #710275 from Stephen J. Friedl: const fixes for APIs that don't modify their arguments
+
+2003-05-08 09:28 hardaker
+
+ * include/net-snmp/library/system.h:
+
+ missed a commit for a perl patch
+
+2003-05-08 09:22 hardaker
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ Applied patch #712101: minor irix fix
+
+2003-05-08 09:21 hardaker
+
+ * NEWS:
+
+ Mention patch #715603
+
+2003-05-08 09:18 hardaker
+
+ * perl/: Makefile.PL, Makefile.subs.pl,
+ ASN/Makefile.PL, OID/Makefile.PL,
+ SNMP/Makefile.PL, SNMP/README, SNMP/SNMP.xs
+, agent/Makefile.PL,
+ agent/default_store/Makefile.PL,
+ default_store/Makefile.PL:
+
+ patch #715603: fix perl module builds under windows
+
+2003-05-08 07:10 rstory
+
+ * agent/helpers/table_array.c:
+
+ try to use default container if none specified; non-existent row status not
+ legal for a new row; sanity check asserts; remove unused cooperative
+ notification code; check for null table container
+
+2003-05-08 07:06 rstory
+
+ * agent/Makefile.in:
+
+ remove object_monitor as it doesn't do anything and would be a new feature if
+ it did
+
+2003-05-08 07:05 rstory
+
+ * dist/nsb-functions:
+
+ fix sysname translation for /; allow extra config to be specified in
+ environment var
+
+2003-05-08 07:02 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ chg NET_SNMP_USE_ASSERT define to NETSNMP_USE_ASSERT to be consistent
+
+2003-05-08 06:58 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container.c:
+
+ apply patch [ 724927 ] to fix log msg; add \n to log msgs
+
+2003-05-05 15:35 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document agentxPingInterval
+
+2003-05-05 10:35 rstory
+
+ * configure:
+
+ configure to match configure.in
+
+2003-05-05 10:29 rstory
+
+ * Makefile.in, configure.in:
+
+ chmod net-snmp-config after configure, instead in make
+
+2003-04-03 15:12 rstory
+
+ * include/net-snmp/library/tools.h:
+
+ wrap SNMP_FREE macro w/do while, so it won't affect if/then flow
+
+2003-03-28 06:48 hardaker
+
+ * README.krb5:
+
+ Ken Hornstein noted that the rwuser -s flag was missing it's argument
+
+2003-03-28 06:47 hardaker
+
+ * snmplib/snmpksm.c:
+
+ Patch from Ken for misc krb5 fixes (encryption types, New crypto support,...
+
+2003-03-19 11:46 rstory
+
+ * Makefile.in:
+
+ remove trailing \ from perl rules
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0.7 -> V5.0.8
+
+2003-03-17 17:33 rstory
+
+ * NEWS, man/netsnmp_handler.3,
+ man/netsnmp_table.3, man/netsnmp_table_data.3:
+
+ update for 5.0.8
+
+2003-03-17 17:20 rstory
+
+ * sedscript.in, snmplib/snmp_version.c, FAQ
+, README, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.8 )
+
+2003-03-14 14:55 rstory
+
+ * FAQ, README, sedscript.in,
+ agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend,
+ apps/Makefile.depend, apps/snmpnetstat/Makefile.depend
+, perl/SNMP/SNMP.pm, snmplib/Makefile.depend
+, snmplib/snmp_version.c:
+
+ update for 5.0.8.pre2
+
+2003-03-14 14:40 rstory
+
+ * ChangeLog, NEWS:
+
+ update for 5.0.8.pre2
+
+2003-03-14 13:53 rstory
+
+ * man/: netsnmp_table.3, netsnmp_table_dataset.3
+:
+
+ update for 5.0.8.pre2
+
+2003-03-14 13:45 rstory
+
+ * Makefile.in:
+
+ trailing slash on srcdir for comment checks
+
+2003-03-14 13:44 rstory
+
+ * dist/nsb-functions:
+
+ more extra modules and transports
+
+2003-03-14 12:44 rstory
+
+ * include/net-snmp/agent/agent_handler.h:
+
+ use new macro for inlining; fix some indent madness
+
+2003-03-14 12:43 rstory
+
+ * include/net-snmp/library/container.h:
+
+ use new macro for testing if inlining is on
+
+2003-03-14 12:40 rstory
+
+ * include/net-snmp/system/: aix.h, hpux.h,
+ irix.h:
+
+ don't undef inline
+
+2003-03-14 12:40 rstory
+
+ * snmplib/container.c:
+
+ rename macro used to test for inlining
+
+2003-03-14 12:39 rstory
+
+ * win32/: config.h, net-snmp/net-snmp-config.h:
+
+ if inline macro not defined, define as empty
+
+2003-03-14 12:37 rstory
+
+ * agent/agent_handler.c, agent/agent_registry.c
+, agent/object_monitor.c, agent/snmp_agent.c
+, agent/helpers/table.c,
+ agent/helpers/table_array.c, agent/helpers/table_data.c
+, agent/helpers/table_dataset.c,
+ agent/helpers/table_iterator.c,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/table_data.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/library/data_list.h, snmplib/data_list.c
+, snmplib/oid_stash.c:
+
+ replace inline w/macro
+
+2003-03-13 19:03 hardaker
+
+ * agent/snmp_agent.c:
+
+ patch from Tommy Christensen to fix some AgentX (mostly) memory leaks
+
+2003-03-12 13:40 hardaker
+
+ * net-snmp-config.in:
+
+ patch #699380: From Christophe Kalt: make net-snmp-config do what it's document to do (add -L@libdir@)
+
+2003-03-12 11:48 hardaker
+
+ * snmplib/snmp_api.c:
+
+ patch #700672: reset itmp to the new value length after decoding a hex string
+
+2003-03-11 17:37 hardaker
+
+ * snmplib/scapi.c:
+
+ Applied openssl dynamic version hack/fix
+
+2003-03-11 15:14 rstory
+
+ * agent/Makefile.in:
+
+ add WRAPLIBS var instead of direct substitution
+
+2003-03-11 15:12 rstory
+
+ * net-snmp-config.in:
+
+ add WRAPLIBS to --agent-libs and --external-agent-libs
+
+2003-03-11 00:31 rstory
+
+ * configure:
+
+ revert to 2.13
+
+2003-03-06 01:44 rstory
+
+ * configure:
+
+ update for new configure.in
+
+2003-03-06 01:41 rstory
+
+ * configure.in:
+
+ fix libwrap w/nsl; make sure all quotes restored before using AC macros. This
+ seems to mess up the config output while checking for modules, but w/out it,
+ I get errors from m4 when running autoconf.
+
+2003-03-05 20:51 rstory
+
+ * .cvsignore:
+
+ ignore net-snmp-config-x
+
+2003-03-05 20:49 rstory
+
+ * agent/mibgroup/versiontag:
+
+ check for an optional 3rd param, nocvs, to not commit after updating version
+
+2003-03-05 20:48 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ put all the version number changes in the same step
+
+2003-03-05 20:21 rstory
+
+ * FAQ, README:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.8.pre1 )
+
+2003-03-05 20:00 rstory
+
+ * sedscript.in, perl/SNMP/SNMP.pm,
+ snmplib/snmp_version.c:
+
+ update version to 5.0.8.pre1
+
+2003-03-05 19:04 rstory
+
+ * man/snmpd.conf.5.def:
+
+ back out docs for new functionality accidentally added when applying patch
+
+2003-03-05 18:40 rstory
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ back out new functionality accidentally added when applying patch
+
+2003-03-05 18:20 rstory
+
+ * README.solaris:
+
+ updates from Bruce Shaw
+
+2003-03-05 18:18 rstory
+
+ * man/.cvsignore:
+
+ add snmpd.8
+
+2003-03-05 18:12 rstory
+
+ * man/: netsnmp_agent.3, netsnmp_handler.3,
+ netsnmp_library.3, netsnmp_mib_utilities.3,
+ netsnmp_table_data.3:
+
+ updates for 5.0.8
+
+2003-03-05 18:04 rstory
+
+ * doxygen.conf:
+
+ update to 5.0.8
+
+2003-03-05 17:58 rstory
+
+ * dist/README.build-scripts:
+
+ remove obsolete argument; fix typo
+
+2003-03-05 17:58 rstory
+
+ * Makefile.in:
+
+ exclude ftp from comment check; use egrep
+
+2003-03-05 17:55 rstory
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ chg C++ style comment
+
+2003-03-05 17:50 rstory
+
+ * testing/TESTCONF.sh:
+
+ argh! FreeBSD is driving me crazy! set RANDOM=2 if RANDOM not defined; use test
+
+2003-03-05 17:22 rstory
+
+ * testing/TESTCONF.sh:
+
+ simplify netstat args & tweak grep regex for multi platform compatability
+
+2003-03-05 17:11 rstory
+
+ * testing/TESTCONF.sh:
+
+ check /bin and /usr/bin for netstat (probably a good job for configure)
+
+2003-03-05 17:02 rstory
+
+ * testing/TESTCONF.sh:
+
+ missed one, re: (( )) -> expr
+
+2003-03-05 16:58 rstory
+
+ * testing/TESTCONF.sh:
+
+ use more portable expr instead of (( )) for arithmetic expressions
+
+2003-03-05 16:16 rstory
+
+ * testing/TESTCONF.sh:
+
+ for systems with /bin/netstat, check that snmpd port is not in use. If it is,
+ try up to three random others before giving up.
+
+2003-03-05 15:16 rstory
+
+ * dist/: nsb-functions, nsb-package:
+
+ don't prompt between steps by default
+
+2003-03-05 15:11 rstory
+
+ * testing/RUNTESTS:
+
+ import SNMP_SLEEP time from environment, if available
+
+2003-03-05 15:10 rstory
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ don't redefine inline
+
+2003-03-05 15:08 rstory
+
+ * Makefile.top:
+
+ version 5.0.8
+
+2003-03-05 15:07 rstory
+
+ * .cvsignore:
+
+ ignore some files autoconf may create
+
+2003-03-05 13:42 nba
+
+ * aclocal.m4, config.guess, config.sub
+, ltmain.sh, configure:
+
+ Update libtool to version 1.4.3, for the benefit of Darwin
+
+2003-03-05 13:39 nba
+
+ * configure.in:
+
+ Dont force -I/usr/local/include for --with-dmalloc
+
+2003-03-04 12:47 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ wrong type returned for nsModuleModes as reported by Michael Kirkham
+
+2003-03-03 15:03 nba
+
+ * man/snmpd.conf.5.def:
+
+ Mention the AgentXAddress, AgentsRetries and AgentXTimeout parameters
+
+2003-03-03 14:25 nba
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ Add support for OpenBSD 3. Sort some lines for easier reference.
+
+2003-03-01 10:27 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ agentx patch from Tommy Christensen: better error checking
+
+2003-03-01 09:59 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ agentx patch from Tommy Christensen: don't create delegated cache for CLEANUPSET
+
+2003-02-28 23:46 hardaker
+
+ * perl/SNMP/Makefile.PL:
+
+ typo
+
+2003-02-28 23:11 hardaker
+
+ * perl/SNMP/Makefile.PL:
+
+ Patch #597629 from Matt Selsky to fix man page installation
+
+2003-02-28 13:18 nba
+
+ * agent/snmpd.c, apps/snmptrapd.c:
+
+ Better error message if we cannot create pid file
+
+2003-02-28 13:17 nba
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Use FS types with Linux
+
+2003-02-27 00:59 rstory
+
+ * local/mib2c.array-user.conf:
+
+ sync w/main
+
+2003-02-26 18:52 rstory
+
+ * Makefile.top:
+
+ sync w/main: put in missing INSTALL_DATA
+
+2003-02-26 18:05 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ Implement sysRawInterrupts and sysRawContext for Solaris
+
+2003-02-26 14:30 nba
+
+ * snmplib/mib.c:
+
+ Fix a C precedence botch-up, thanks to Fabr५€Œcio Las Casas <Fabricio@atan.com.br>
+
+2003-02-26 14:14 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ Implement the ssRawInterrupts and ssRawContext counters in Linux
+
+2003-02-26 14:13 nba
+
+ * apps/snmptrapd.c:
+
+ Fix the -S option
+
+2003-02-25 14:38 rstory
+
+ * Makefile.in:
+
+ fix logic of test operation
+
+2003-02-25 14:33 rstory
+
+ * Makefile.in, Makefile.top:
+
+ use AUTO(CONF|HEADER) from configure, instead of hardcoded; don't try and run
+ AUTO(CONF|HEADER) if not found
+
+2003-02-25 14:11 rstory
+
+ * man/snmpd.8.def:
+
+ sync w/main branch: new file
+
+2003-02-25 14:03 rstory
+
+ * apps/snmptrapd.c:
+
+ sync w/main branch (correctly, this time)
+
+2003-02-25 13:49 rstory
+
+ * Makefile.in:
+
+ sync w/main branch: add NOAUTODEPS
+
+2003-02-25 13:38 rstory
+
+ * dist/nsb-functions:
+
+ sync w/main branch: add smux to dist modules; move make test into nsb-make;
+ remove tee so rc is preserved; use new NOAUTODEPS
+
+2003-02-25 13:29 rstory
+
+ * snmplib/snmpv3.c:
+
+ sync w/main branch:
+ Recognise "defVersion v3" as well as "defVersion 3" as documented
+ in the man pages (prior to Peter Breitenlohner's correction)
+ [We might as well support both styles....]
+
+2003-02-25 13:20 rstory
+
+ * EXAMPLE.conf.def, sedscript.in,
+ man/Makefile.in, man/mib2c.1.def,
+ man/read_config.3.def, man/snmp.conf.5.def,
+ man/snmp_config.5.def, man/snmpcmd.1.def,
+ man/snmpconf.1.def, man/snmpd.1.def,
+ man/snmptrapd.conf.5.def, mibs/Makefile.in:
+
+ sync w/main branch: (I hope I got this right)
+ -Apply Peter Breitenlohner's documentation changes
+ (patches #692381, 692382 and 692388)
+
+2003-02-25 13:16 rstory
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ sync w/main branch:
+ patch #657808: calculate a proper ifSpeed under linux when possible
+ and do more proper ifOperStatus state determination.
+
+2003-02-25 13:15 rstory
+
+ * agent/helpers/table_data.c:
+
+ sync w/main branch:
+ - Irfan Sheriff pointed out a bug with getnext requests directly to a column.
+ - check entry node as suggested by Irfan Sheriff
+
+2003-02-25 13:14 rstory
+
+ * snmplib/system.c:
+
+ sync w/main branch:
+ Remove last remaining use of 'nlist' under HP-UX 10 & 11.
+ As per patch #656773 from Johannes Schmidt-Fischer
+
+2003-02-25 13:13 rstory
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ sync w/main branch:
+ Checking the length of a string buffer once is sufficient.
+ Using 'strnncpy' [sic] to check this length twice is unnecessary...
+
+2003-02-25 13:12 rstory
+
+ * Makefile.in:
+
+ sync w/main branch:
+ - Mess with output of doxygen to add sf logos, etc, to the bottom of the
+ generated html files.
+ - Apply Peter Breitenlohner's net-snmp-config patch (#692373)
+
+2003-02-25 13:11 rstory
+
+ * agent/snmpd.c:
+
+ sync w/main branch:
+ Patch #655154 from Joel Rosdahl: more proper demonization:
+ - close stdin/stdout/stderr if appropriate.
+ - double fork.
+ - chdir / [except under windows]
+
+2003-02-25 13:10 rstory
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ sync w/main branch:
+ Patch #662169 from Jan Willem Luiten: diskio support for Darwin
+
+2003-02-25 13:10 rstory
+
+ * perl/SNMP/t/: bulkwalk.t, set.t:
+
+ sync w/main branch:
+ Fix tests for bulkwalk (duplicate header) and set (invalid OID constant)
+
+2003-02-25 13:09 rstory
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ sync w/main branch:
+ Accommodate a fussy IRIX environment, which is picky about <unistd.h>
+ See bug #667726
+
+2003-02-25 13:04 rstory
+
+ * acconfig.h:
+
+ sync w/main branch:
+ Bruce Shaw pointed out a comment typo
+
+2003-02-25 13:02 rstory
+
+ * perl/: ASN/Makefile.PL, OID/Makefile.PL,
+ SNMP/Makefile.PL, agent/Makefile.PL,
+ default_store/Makefile.PL:
+
+ sync w/main branch:
+ fix my declarations as pointed out by Andrew Page
+
+2003-02-25 13:01 rstory
+
+ * snmplib/mib.c:
+
+ sync w/main branch:
+ An additional change to support 't' hints
+
+2003-02-25 13:00 rstory
+
+ * man/snmptrapd.8.def:
+
+ sync w/main branch:
+ -document patch #674218: reopen log files on HUP.
+ -Apply Peter Breitenlohner's documentation changes
+ (patches #692381, 692382 and 692388)
+
+2003-02-25 12:59 rstory
+
+ * man/snmpd.conf.5.def:
+
+ sync w/main branch:
+ -document monitor -t for threshold monitoring
+ -Apply Peter Breitenlohner's documentation changes
+ (patches #692381, 692382 and 692388)
+
+2003-02-25 12:57 rstory
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ sync w/main branch:
+ Patch from Christophe to support monitor -t for threshold monitoring
+
+2003-02-25 12:55 rstory
+
+ * FAQ:
+
+ sync w/main branch:
+ Clarify the local-only access for non-standard port AgentX connections
+
+2003-02-25 12:54 rstory
+
+ * apps/snmptrapd.c:
+
+ sync w/main branch:
+ - close and re-open log file on receiving a HUP (patch 674218, submitted
+ by anonymous)
+
+2003-02-25 12:52 rstory
+
+ * net-snmp-config.in:
+
+ sync w/main branch: Bruce Shaw pointed out a comment typo
+
+2003-02-25 09:04 dts12
+
+ * man/snmpd.8.def:
+
+ Apply Peter Breitenlohner's configuration-related documentation and installation changes.
+ (patches #692372, 692377, 692379 and 692386)
+
+2003-02-13 20:02 hardaker
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Patch #654329: double check lengths when copying
+
+2003-02-12 09:01 hardaker
+
+ * agent/mibgroup/tunnel/tunnel.h:
+
+ update
+
+2003-02-11 11:13 hardaker
+
+ * agent/mibgroup/ucd-snmp/: pass.c, pass_persist.c
+:
+
+ patch #667694 (anon) to add back newlines to pass code
+
+2003-02-03 10:27 hardaker
+
+ * snmplib/snmp_api.c:
+
+ From Richard Laing: change value check of a string to use a proper length.
+
+2003-01-24 10:47 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ patch #672021 from Joshua Giles: large set request fixes
+
+2003-01-20 23:21 rstory
+
+ * snmplib/container_binary_array.c:
+
+ add missing brace
+
+2003-01-20 23:13 rstory
+
+ * agent/mibgroup/versiontag:
+
+ add back (accidentally deleted) creation of gzipped tarball
+
+2003-01-20 23:09 rstory
+
+ * snmplib/test_binary_array.c:
+
+ add string test case
+
+2003-01-20 23:09 rstory
+
+ * snmplib/container_binary_array.c:
+
+ fix array_qsort; fix binary search; con't recurse on insert, del, etc since
+ the INSERT/DELETE macros already handle multiple indexes
+
+2003-01-20 22:54 rstory
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/snmp_api.c:
+
+ official patch [ 669707 ] 5.0.7: 16-Bit Request IDs
+
+2003-01-20 22:52 rstory
+
+ * include/net-snmp/library/container.h,
+ snmplib/container.c:
+
+ fix typo in log message; add netsnmp_compare_mem
+
+2003-01-20 22:51 rstory
+
+ * agent/mibgroup/versiontag:
+
+ create md5sums after creating gzipped tarball
+
+2003-01-20 22:51 rstory
+
+ * Makefile.rules:
+
+ add another level of directories to make depend, per dts on coders
+ (thought this was in 5.0.7, but apparently not!)
+
+2003-01-14 08:56 hardaker
+
+ * agent/snmpd.c, doxygen.conf, agent/agent_handler.c
+, dist/RELEASE-INSTRUCTIONS:
+
+ doxygen changes
+
+2003-01-13 21:49 rstory
+
+ * man/: netsnmp_agent.3, netsnmp_handler.3:
+
+ update for 5.0.7
+
+2003-01-13 20:30 rstory
+
+ * snmplib/mib.c:
+
+ recognize new 't' code in display hints
+
+2003-01-13 20:07 rstory
+
+ * agent/helpers/table_iterator.c:
+
+ patch for memory leaks sent to coders by Jay Parlar
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0.6 -> V5.0.7
+
+2003-01-11 01:15 rstory
+
+ * .cvsignore:
+
+ ignore configure-summary
+
+2003-01-11 01:14 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend, apps/Makefile.depend
+, apps/snmpnetstat/Makefile.depend,
+ snmplib/Makefile.depend:
+
+ make depend
+
+2003-01-11 01:08 rstory
+
+ * .cvsignore:
+
+ ignore variations of changelog.add
+
+2003-01-10 20:09 hardaker
+
+ * snmplib/: mib.c, snmp_api.c:
+
+ doxygen output tags to put the recently defined functions into groups.
+
+2003-01-10 20:09 hardaker
+
+ * man/: Makefile.in, netsnmp_agent.3,
+ netsnmp_bulk_to_next.3, netsnmp_debug.3,
+ netsnmp_handler.3, netsnmp_instance.3,
+ netsnmp_library.3, netsnmp_mib_utilities.3,
+ netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_scalar.3, netsnmp_serialize.3, netsnmp_table.3
+, netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_watcher.3:
+
+ doxygen updates
+
+2003-01-10 17:38 hardaker
+
+ * configure, configure.in:
+
+ opps
+
+2003-01-10 17:29 hardaker
+
+ * configure, configure.in:
+
+ remove double checking output
+
+2003-01-10 14:33 hardaker
+
+ * testing/tests/T0160snmpv2cbulkget:
+
+ fix positional arguments
+
+2003-01-10 09:04 dts12
+
+ * FAQ:
+
+ Reference Bruce Shaw's discussion of the perl compilation problems
+ (see README.solaris)
+
+2003-01-10 08:31 dts12
+
+ * FAQ:
+
+ Mention AgentX under windows, and beef up the perl stuff a bit.
+ Add a missing entry in the contents list.
+ (This may prove too late for 5.0.8, but at least it'll be ready for next time!)
+
+2003-01-09 18:41 hardaker
+
+ * man/Makefile.in:
+
+ make doc update.
+
+2003-01-09 18:38 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_mode_end_call.3, netsnmp_multiplexer.3,
+ netsnmp_old_api.3, netsnmp_read_only.3,
+ netsnmp_scalar.3, netsnmp_serialize.3, netsnmp_table.3
+, netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_watcher.3:
+
+ make doc update.
+
+2003-01-09 18:37 hardaker
+
+ * agent/helpers/Makefile.in, agent/helpers/mode_end_call.c
+, include/net-snmp/agent/all_helpers.h,
+ include/net-snmp/agent/mode_end_call.h:
+
+ end-of-mode helper to call more handlers after processing the main
+ line. Functionally allows parallel handler trees and callbacks after
+ a particular mode is completed (useful for things registered under a
+ serialize handler when you don't know when the mode is over).
+ (not used anywhere in production code yet.).
+
+2003-01-09 11:55 dts12
+
+ * FAQ:
+
+ Mention the perl shared/static library problem,
+ the unresponsive agent problem (and fix), and
+ disclaim all knowledge of David Town's Net::SNMP module,
+
+2003-01-09 10:27 hardaker
+
+ * testing/tests/: T0160snmpv2cbulkget, T0220snmpv3bulkget
+:
+
+ GetBulk testing supplied by Xiaofeng Ling
+
+2003-01-09 10:26 hardaker
+
+ * testing/RUNTESTS:
+
+ Add -x flag for calling subtests with "sh -x".
+ Fix number counting for interactive output.
+
+2003-01-07 18:49 hardaker
+
+ * COPYING (V4-2-patches.8), COPYING:
+
+ year update
+
+2003-01-07 13:18 hardaker
+
+ * FAQ (V4-2-patches.58), FAQ:
+
+ irc server name change
+
+2003-01-07 11:01 hardaker
+
+ * snmplib/mib.c:
+
+ bug #663628 and patch: fix ip address index parsing from OIDs
+
+2003-01-07 04:53 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Remove redundant code to free 'callback_data_keep' data.
+ This branch would never be invoked, and is in the wrong
+ place anyway. Patch supplied by Jay Parlar
+
+2003-01-06 11:16 nba
+
+ * Makefile.in:
+
+ Install Solaris 9 header
+
+2003-01-05 18:14 nba
+
+ * win32/win32.opt:
+
+ Make it compile with VC++
+
+2003-01-05 17:28 nba
+
+ * win32/: encode_keychange/encode_keychange.dsp, win32.opt
+, libsnmp_dll/libsnmp.def:
+
+ Make it compile with VC++
+
+2003-01-05 15:45 nba
+
+ * mibs/: Makefile.mib, SNMP-FRAMEWORK-MIB.txt,
+ SNMP-MPD-MIB.txt, SNMP-NOTIFICATION-MIB.txt,
+ SNMP-PROXY-MIB.txt, SNMP-TARGET-MIB.txt,
+ SNMP-USER-BASED-SM-MIB.txt, SNMP-VIEW-BASED-ACM-MIB.txt
+, SNMPv2-MIB.txt, SNMPv2-TM.txt, rfclist:
+
+ Update to current RFC versions
+
+2003-01-03 15:50 rstory
+
+ * configure, configure.in:
+
+ don't call AC_DISABLE_SHARED, as sets the default to disabled (it's very
+ presence in configure.in generates a configure with shared disabled, even
+ if it was in an if block; for developer default, set enable_shared directly
+ unless it was previously set; test that enable_shared=yes for embedded-perl
+
+2003-01-03 08:02 dts12
+
+ * FAQ (V4-2-patches.57), FAQ:
+
+ Mention the Stratus VOS port. (Thanks to Brandon Hall)
+
+2003-01-02 18:00 rstory
+
+ * include/net-snmp/library/container.h:
+
+ parens around x in macro in case x is multiple C tokens
+
+2002-12-22 12:32 rstory
+
+ * sedscript.in, snmplib/snmp_version.c, FAQ,
+ README, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.7.pre2 )
+
+2002-12-22 12:31 rstory
+
+ * ChangeLog, NEWS:
+
+ update for 5.0.7.pre2
+
+2002-12-22 12:20 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend
+, agent/mibgroup/Makefile.depend, apps/Makefile.depend
+, apps/snmpnetstat/Makefile.depend,
+ snmplib/Makefile.depend:
+
+ make depend
+
+2002-12-20 07:58 nba
+
+ * Makefile.in:
+
+ clean away net-snmp-config on make clean
+
+2002-12-20 07:57 nba
+
+ * include/net-snmp/mib_api.h,
+ include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c
+:
+
+ stash the oid_stash ...
+
+2002-12-20 04:49 nba
+
+ * snmplib/snmp_api.c:
+
+ A patch from V4 that didn't make it ... allow list of numeric bits setting BITS
+
+2002-12-20 02:50 hardaker
+
+ * include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c
+:
+
+ add a global callback function for registering directly via a callback.
+
+2002-12-20 02:35 hardaker
+
+ * include/net-snmp/utilities.h:
+
+ add callback.h
+
+2002-12-20 02:22 hardaker
+
+ * snmplib/read_config.c:
+
+ fix persistent storage file renaming. (snprintf change mistake)
+
+2002-12-20 02:21 hardaker
+
+ * include/net-snmp/library/oid_stash.h, snmplib/oid_stash.c
+:
+
+ some new routines for saving oid stash data to persistent storage.
+ (not used anywhere in current production code)
+
+2002-12-19 17:51 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ - watch for undefs passed in as a value to a SET clause.
+ - change BITS to a Octet String as it should be.
+ - on a side note, do you know that the Net-SNMP parser doesn't
+ distinguish between BITS and BIT STRING in it's list of types? I
+ don't think it's possible to use both types in the code today
+ (which is fine, since BIT STRING is not used in SNMPv2 and beyond).
+
+2002-12-19 17:49 hardaker
+
+ * perl/OID/OID.xs:
+
+ print a warning when you can't parse an OID (err, not ideal)
+
+2002-12-19 17:48 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - misc bug fixes.
+ - skip SETing columns with no value passed in.
+
+2002-12-19 14:43 nba
+
+ * agent/mibgroup/: examples/example.c, host/hr_network.c
+, host/hr_swinst.c:
+
+ Being a bit quick, eh, Dave ...
+
+2002-12-19 11:14 dts12
+
+ * agent/mibgroup/mibII/: at.c (V4-2-patches.12), at.c:
+
+ Ensure the ifname buffer is big enough to read in a full-length name.
+ (From the SUSE "audit" patch)
+
+2002-12-19 11:05 dts12
+
+ * agent/snmpd.c, agent/mibgroup/host/hr_print.c,
+ apps/encode_keychange.c, apps/snmptrapd_handlers.c, snmplib/mib.c
+ (V4-2-patches.[28,9,3,3,30]), agent/snmpd.c,
+ agent/mibgroup/host/hr_print.c, apps/encode_keychange.c
+, apps/snmptrapd_handlers.c, snmplib/mib.c:
+
+ Detect when memory allocations fail, and don't plough on regardless.
+ (Based on changes within the SUSE "audit" patch)
+
+2002-12-19 10:07 dts12
+
+ * agent/agent_trap.c, agent/snmp_agent.c,
+ agent/mibgroup/util_funcs.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/host/hr_device.c,
+ agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/system_mib.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/extensible.c,
+ agent/mibgroup/ucd-snmp/pass.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proc.c, apps/encode_keychange.c
+, apps/snmptrapd.c, apps/snmptrapd_handlers.c,
+ apps/snmpnetstat/inet.c, apps/snmpnetstat/inet6.c,
+ snmplib/asn1.c, snmplib/mib.c, snmplib/parse.c,
+ snmplib/read_config.c, snmplib/snmp_api.c,
+ snmplib/snmpv3.c, snmplib/vacm.c:
+
+ The Great SUSE 'sprintf' Hunt.....
+
+2002-12-19 06:02 jbpn
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ - code with BSDi4
+
+2002-12-19 05:50 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - change a comment that doesn't take into account the transport stuff
+ - fix some particularly bad formatting in snmp_open_ex
+
+2002-12-18 13:50 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ remove mem-leak comment. Out of date and was fixed
+
+2002-12-18 13:47 hardaker
+
+ * agent/mibgroup/agentx/agentx_config.c, man/snmpd.conf.5.def
+:
+
+ delete experimental warning about agentx
+
+2002-12-18 13:40 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ fix bug#655488: descriptions of ssIORawReceived and ssRawInterrupts were reversed
+
+2002-12-18 08:19 jbpn
+
+ * agent/snmpd.c:
+
+ - restart stderr logging on HUP (if -L was given on command line)
+
+2002-12-17 19:33 rstory
+
+ * local/mib2c.array-user.conf:
+
+ remove ';' from define; if table has a storage type, check that it's not
+ read only before allowing sets
+
+2002-12-17 19:26 rstory
+
+ * local/mib2c.array-persistent.conf:
+
+ never mind
+
+2002-12-17 19:02 hardaker
+
+ * perl/OID/test.pl:
+
+ Don't check for prefixes in test. They don't exist. However, do set SNMPCONFPATH in test initialization to a bogus value
+
+2002-12-17 18:58 hardaker
+
+ * perl/OID/OID.xs:
+
+ remove direct call to init_snmp(). This is already called by the .pm file
+
+2002-12-17 10:22 rstory
+
+ * local/mib2c.array-persistent.conf:
+
+ persistence for array-tables
+
+2002-12-17 10:07 rstory
+
+ * include/net-snmp/library/read_config.h,
+ snmplib/read_config.c:
+
+ add read_config_store_data_prefix; add ASN_TIMETICKS w/ASN_UNSIGNED cases
+
+2002-12-17 09:44 rstory
+
+ * snmplib/snmpUDPDomain.c:
+
+ don't use SO_REUSE_ADDR so agent port can't be hijacked
+
+2002-12-17 09:43 rstory
+
+ * net-snmp-config.in:
+
+ use local var for base agent libs; reorder base agent libs so static linking
+ works
+
+2002-12-16 18:32 nba
+
+ * snmplib/scapi.c, agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/mta_sendmail.h:
+
+ Yet another compiler warning ...
+
+2002-12-16 17:50 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ remove bogus comment reference to table_dataset helper.
+
+2002-12-16 17:42 nba
+
+ * agent/mibgroup/disman/mteEventNotificationTable.c,
+ agent/mibgroup/disman/mteEventTable.c,
+ agent/mibgroup/disman/mteEventTable.h,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/disman/mteTriggerTable.h, apps/snmptrapd.c
+, include/net-snmp/library/tools.h, snmplib/tools.c
+:
+
+ Spread some magic dust to quell compiler warnings (why isn't --enable-slient-libtool the default ...)
+
+2002-12-16 11:44 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - fix small memory leak (peername is copied by snmp_open_ex)
+
+2002-12-16 11:31 jbpn
+
+ * snmplib/mib.c:
+
+ - fix small memory leak
+
+2002-12-16 11:19 jbpn
+
+ * snmplib/parse.c:
+
+ - fix memory leak
+
+2002-12-16 10:02 rstory
+
+ * snmplib/container.c:
+
+ remove redundant include (caused problems on Sun 5.7, reported by jbpn)
+
+2002-12-16 08:22 rstory
+
+ * dist/nsb-functions:
+
+ configure w/out developer
+
+2002-12-16 08:18 rstory
+
+ * configure, configure.in:
+
+ DEVFLAGS="" if not developer
+
+2002-12-16 02:39 nba
+
+ * snmplib/: oid_stash.c, scapi.c, snmpAAL5PVCDomain.c
+, snmpIPXDomain.c, snmpTCPIPv6Domain.c,
+ snmpUDPIPv6Domain.c:
+
+ dmalloc support
+
+2002-12-16 02:39 nba
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ Possible leak of fd on error return
+
+2002-12-14 10:22 rstory
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.7.pre1 )
+
+2002-12-14 10:21 rstory
+
+ * ChangeLog, NEWS:
+
+ update for 5.0.7.pre1
+
+
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0.6 -> V5.0.7pre1
+
+2002-12-14 09:59 rstory
+
+ * dist/nsb-functions:
+
+ check for agent/mibgroup; fix modules for config_dist
+
+2002-12-14 09:58 rstory
+
+ * man/: netsnmp_bulk_to_next.3, netsnmp_debug.3,
+ netsnmp_handler.3, netsnmp_old_api.3,
+ netsnmp_read_only.3, netsnmp_serialize.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_todo.3:
+
+ update for 5.0.7.pre1
+
+2002-12-14 09:54 rstory
+
+ * Makefile.top:
+
+ bump rev to 5.0.7
+
+2002-12-14 09:49 rstory
+
+ * Makefile.in:
+
+ add -n to grep for C++ comments
+
+2002-12-14 09:47 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, apps/Makefile.depend,
+ snmplib/Makefile.depend:
+
+ make depend
+
+2002-12-14 09:45 rstory
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ remove C++ comments
+
+2002-12-14 09:30 rstory
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ add comments to some structure members
+
+2002-12-14 09:29 rstory
+
+ * agent/helpers/table_array.c:
+
+ errors during commit undo should be xxFAILED; use set_request_error instead of
+ set_mode_request_error; remove incorrect comment; more debugging; check for
+ and call lower handlers
+
+2002-12-14 09:27 rstory
+
+ * agent/helpers/table.c:
+
+ always process later passes of a set request
+
+2002-12-13 16:06 nba
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ Quell compiler warnings
+
+2002-12-13 15:47 nba
+
+ * agent/mibgroup/mibII/var_route.c, snmplib/default_store.c
+:
+
+ Quell compiler warnings
+
+2002-12-13 15:40 nba
+
+ * snmplib/scapi.c:
+
+ Fix incomplete zeroing of security data
+
+2002-12-13 15:39 nba
+
+ * snmplib/parse.c:
+
+ Fix a possible freeing of a NULL pointer
+
+2002-12-13 15:38 nba
+
+ * agent/helpers/table_dataset.c,
+ agent/mibgroup/mibII/ipAddr.c, apps/snmptrapd.c,
+ include/net-snmp/agent/table_data.h, snmplib/snmp_api.c
+:
+
+ Quell compiler warnings
+
+2002-12-13 11:38 dts12
+
+ * agent/agent_handler.c:
+
+ Clear the 'processed' flag between passes, so that handlers
+ can correctly clean up after errors have been detected.
+
+2002-12-13 11:06 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ add asser to try and cath intermittent crash i've been seeing
+
+2002-12-13 11:04 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ log unknown agentx operation
+
+2002-12-13 10:12 rstory
+
+ * agent/helpers/table_array.c:
+
+ if no row create callback on set, use NOTWRITABLE instead of NOSUCHINSTANCE
+
+2002-12-13 10:04 rstory
+
+ * agent/helpers/debug_handler.c:
+
+ fix cut-n-paste so delegated flag displayed properly
+
+2002-12-13 10:01 rstory
+
+ * snmplib/default_store.c:
+
+ log text (APP|LIB|TOK) instead of store id in debug msgs
+
+2002-12-13 09:53 rstory
+
+ * dist/nsb-functions:
+
+ add --with-libwrap
+
+2002-12-13 09:49 rstory
+
+ * FAQ:
+
+ grammar/indention tweak + mention strip for memory footprint question
+
+2002-12-13 09:32 dts12
+
+ * perl/SNMP/Makefile.PL:
+
+ Remove explicit mention of SNMP module documentation.
+ This setting doesn't seem to be necessary, and without it,
+ the man page is installed automatically.
+
+2002-12-13 07:47 jbpn
+
+ * apps/snmptrapd.c:
+
+ - make -S do the same as snmpd -S (set the syslog facility)
+ - make -l print a warning saying that it is deprecated and -S should
+ be used instead
+
+2002-12-13 07:14 jbpn
+
+ * snmplib/read_config.c:
+
+ - increase width of token field to improve legibility of
+ configuration directive help output
+
+2002-12-12 17:46 nba
+
+ * apps/snmptable.c:
+
+ Protect against unknown -O options
+
+2002-12-12 15:56 nba
+
+ * agent/mibgroup/smux/smux.c:
+
+ Fix some size_t that really should be int
+
+2002-12-12 14:18 nba
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/mib.h, man/snmp.conf.5.def,
+ man/snmpcmd.1.def, snmplib/mib.c, snmplib/snmp_api.c
+:
+
+ A long overdue patch (#415252) from Robert Hastings that implements
+ reverse DISPLAY-HINT processing, i.e. it allows you to input data
+ formatted like the DISPLAY-HINT prescribes. Enabled by default, but
+ can be disabled with the -Ih option or noDisplayHint in snmp.conf
+
+2002-12-12 13:56 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ parse oids in view statements the same way the apps do it (consistency, he said)
+
+2002-12-12 13:35 hardaker
+
+ * perl/agent/agent.xs:
+
+ Add a getRootOID function to the reginfo pointer passed into handlers.
+
+2002-12-12 13:34 rstory
+
+ * local/mib2c.array-user.conf:
+
+ change create and duplicate row to return specific context instead of generic
+ netsnmp_index; catch error from parse_oid_indexes on row creation
+
+2002-12-12 13:34 hardaker
+
+ * perl/SNMP/t/mib.t:
+
+ Print errors to STDERR instead.
+ (actually don't because these statements are commented out in the
+ first place)
+
+2002-12-12 13:33 hardaker
+
+ * agent/agent_registry.c:
+
+ Reverse the context of a context if statement so if not the context
+ then don't use the context in the given context.
+
+2002-12-12 12:56 jbpn
+
+ * apps/snmptrapd.c:
+
+ - drop long-deprecated -q and -S options
+ - minor formatting fixes
+
+2002-12-12 12:35 jbpn
+
+ * agent/snmpd.c:
+
+ - remove duplicate message in usage
+
+2002-12-12 11:37 dts12
+
+ * man/snmpd.1.def, agent/snmpd.c:
+
+ Implement a command-line option (-S) to set the facility to use when
+ logging via syslog. Based on an idea by Joel Rosdahl (Patch #627701)
+ Note that -l and -L are already taken:-(
+
+ ToDo:
+ Provide configuration directives for both this, and the syslog token ('snmpd').
+
+2002-12-12 11:18 dts12
+
+ * man/snmpd.conf.5.def, agent/mibgroup/mibII/system_mib.c
+:
+
+ Support setting of sysDescr and sysObjectID via snmpd.conf
+ configuration directives (though not via SNMP SET reqests).
+ Patches supplied by Joel Rosdahl (#627702 and #628011)
+
+2002-12-12 10:58 dts12
+
+ * agent/helpers/: all_helpers.c, table.c:
+
+ Suppress some compiler warnings.
+ Based on patch supplied by Chris Johns (#644041)
+
+2002-12-12 10:42 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory_solaris2.c (V4-2-patches.6),
+ memory_solaris2.c:
+
+ Use 'sysconf' to report on Solaris memory usage.
+ Based on patch supplied by Ben Stern (#651182)
+
+2002-12-12 10:00 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Basic support for multiple AgentX sockets (on the master side at least).
+ See Feature Request #632556
+
+2002-12-12 08:57 rstory
+
+ * dist/Makefile:
+
+ create version tag from version so cvs export works; fix REL; add tar.gz
+ of source as dependency for rpmfiles
+
+2002-12-12 08:04 nba
+
+ * snmplib/: data_list.c, snmpCallbackDomain.c,
+ snmpTCPDomain.c, snmpUDPDomain.c, snmpUnixDomain.c
+, snmp_enum.c, snmp_secmod.c, snmp_transport.c
+:
+
+ dmalloc support
+
+2002-12-12 07:18 dts12
+
+ * snmplib/mib.c:
+
+ Document the -OU option, and alphabetise the handling of options.
+
+2002-12-12 06:25 dts12
+
+ * apps/Makefile.in:
+
+ Install 'snmpinform' as a relative link, rather than an absolute one.
+ Fix provided by the indefatigable Stefan Radman (Bug #652587)
+
+2002-12-12 05:56 dts12
+
+ * configure, configure.in:
+
+ Quote configure options when contructing net-snmp-configure and net-snmp-configure.h
+ This allows options containing spaces, etc, to be handled correctly.
+ (See Feature Request #547152)
+
+2002-12-11 16:52 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ Patch for FreeBSD. Thanks to Jun Kuriyama
+
+2002-12-11 12:16 dts12
+
+ * snmplib/: snmp_logging.c (V4-2-patches.4), snmp_logging.c:
+
+ Try disabling line-buffering on Windows systems (since it
+ apparently enables full-buffering instead). See Bug #558837.
+
+2002-12-11 11:25 dts12
+
+ * perl/SNMP/t/: async.t, get.t, getnext.t,
+ notify.t, set.t:
+
+ Explicitly set SNMP version = 1 (the original default as expected by the tests)
+ This should now pass all tests apart from conf.t #3
+
+2002-12-11 06:46 dts12
+
+ * include/net-snmp/agent/auto_nlist.h:
+
+ Be more selective in using the 64-bit version of nlist. (Bug #611655)
+
+2002-12-11 06:27 dts12
+
+ * README.solaris:
+
+ Mention the non-functionality of one of the suggested approaches.
+ (Bug #617119). Reported by Quanah Gibson-Mount
+
+2002-12-11 06:20 dts12
+
+ * agent/Makefile.in:
+
+ Ensure that the destination directory exists before installing the
+ embedded perl script. (Bug #617891) Fix provided by Stefan Radman.
+
+2002-12-11 05:56 dts12
+
+ * README.snmpv3 (V4-2-patches.4), README.snmpv3:
+
+ Document the location assumptions being made in this description.
+
+2002-12-11 04:47 dts12
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/mib.h, snmplib/mib.c,
+ man/snmpcmd.1.def:
+
+ Provide a mechanism for forcing strings to be displayed in either
+ ASCII or Hex format, bypassing the "guess" mechanism as to which
+ is more appropriate. Suggested by Nick Kanakakorn.
+ Note that this does not affect objects with a Display-Hint in
+ their MIB definition.
+
+2002-12-11 04:30 dts12
+
+ * agent/ds_agent.h, agent/snmpd.c, testing/eval_tools.sh
+ (V4-2-patches.[2,26,6]), agent/agent_read_config.c,
+ agent/snmpd.c, include/net-snmp/agent/ds_agent.h,
+ testing/eval_tools.sh:
+
+ Command-line option to control whether to unlink the PID file or not.
+ Necessary for correct test operation.
+
+2002-12-11 04:21 dts12
+
+ * perl/OID/test.pl:
+
+ The latest library defaults to MODULE::name style output,
+ so adjust the expected output checks accordingly.
+ Also, there are actually 36 tests, not 35!
+
+2002-12-11 04:17 dts12
+
+ * perl/OID/OID.xs:
+
+ Initialise the SNMP libraries, to set up the OID tree.
+ Addresses bugs #638024 and #627643
+ [Qn: Do we need to supply an 'appname' (c.d the SNMP module) ?]
+
+2002-12-10 19:29 nba
+
+ * man/snmp.conf.5.def, snmplib/snmp_api.c,
+ agent/mibgroup/util_funcs.c,
+ agent/mibgroup/ucd-snmp/logmatch.c:
+
+ Allow runtime configuration of persistent directory
+
+2002-12-10 19:24 nba
+
+ * snmplib/read_config.c:
+
+ Report errors handling persistent storage files
+
+2002-12-10 19:23 nba
+
+ * snmplib/system.c:
+
+ Pass up error on directory creation
+
+2002-12-10 17:27 nba
+
+ * snmplib/mib.c:
+
+ Better respect for the max width option (snmptranslate -Td)
+
+2002-12-10 17:26 nba
+
+ * man/snmp.conf.5.def:
+
+ Document the oidOutputFormat option
+
+2002-12-10 17:25 nba
+
+ * apps/snmptable.c:
+
+ Clean up. Remove calls to obsolete functions snmp_set_quick_print,
+ snmp_get_dump_packet, snmp_get_suffix_only. Remove last traces of the
+ non_sequential backwards hack. Make sure it works for all -O options.
+
+2002-12-10 11:58 dts12
+
+ * agent/mibgroup/mibII/: interfaces.c (V4-2-patches.26),
+ interfaces.c:
+
+ Protect against empty lines in /proc/net/dev (Bug #625426)
+
+2002-12-10 11:41 dts12
+
+ * snmplib/: snmpv3.c (V4-2-patches.5), snmpv3.c:
+
+ Free destination memory before cloning SNMP Engine ID.
+ Fix provided by Martin Carlsson. (Bug #835481)
+
+2002-12-10 11:07 dts12
+
+ * perl/: ASN/Makefile.PL, OID/Makefile.PL,
+ SNMP/Makefile.PL, agent/Makefile.PL,
+ agent/default_store/Makefile.PL, default_store/Makefile.PL
+:
+
+ Add "$Config{ccflags}" to CCFLAGS. (See bug #640899)
+
+2002-12-10 10:46 dts12
+
+ * agent/mibgroup/mibII/: ipAddr.c (V4-2-patches.8), ipAddr.c:
+
+ Add support for Linux virtual interfaces in the ipAddressTable.
+ (Note this does *not* include separate per-v-interface statistics
+ in the interfaces table).
+
+ Patch supplied by Jens Sittner (#621274)
+
+2002-12-10 04:59 dts12
+
+ * agent/agent_handler.c:
+
+ Remove a couple of extraneous ^M characters.
+
+2002-12-10 02:36 nba
+
+ * snmplib/mib.c:
+
+ When using -Oqv and printing an empty string you could end up with
+ a NULL string and not an empty string leading to some very obscure
+ problems in snmptable and other applications.
+
+2002-12-09 11:12 dts12
+
+ * snmplib/snmp_api.c:
+
+ Handle missing integer values (whether 32- or 64-bit!). Oops!
+
+2002-12-09 10:12 dts12
+
+ * snmplib/: snmp_api.c (V4-2-patches.38), snmp_api.c:
+
+ Handle integer-based values correctly on a 64-bit platform.
+ Patch supplied by Thomas Weber (#561071)
+
+2002-12-09 09:45 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Take note of subagent-requested byte ordering in subsequent communications.
+ Patch supplied by Urban (#632284)
+
+2002-12-09 09:32 dts12
+
+ * agent/: snmpd.c (V4-2-patches.25), snmpd.c:
+
+ Remove the PID file on agent shutdown.
+ Patch supplied by Joel Rosdahl (#627699)
+
+2002-12-09 09:25 dts12
+
+ * snmplib/system.c:
+
+ Handle 'struct sockaddr' that contain 'sa_len' fields differently
+ to those that don't (c.f ifilter_ioctl.c in BIND 9.2.1 sources)
+ Patch supplied by Joel Rosdahl (#627696)
+
+2002-12-09 07:12 dts12
+
+ * acconfig.h, configure, configure.in:
+
+ Recognise BSDi4, and tweak the recognition of 'dlopen'.
+ Patches supplied by Joel Rosdahl.
+
+2002-12-09 06:10 dts12
+
+ * agent/mibgroup/mibII/: at.c, interfaces.c, ip.c
+:
+
+ Remove some warnings, and try to cope with 'sysctl' failures.
+ Patches supplied by Chris Johns.
+
+2002-12-09 04:20 dts12
+
+ * README.solaris:
+
+ Mention the limitations on /usr/ucb/sed,
+ and point people towards /usr/bin/sed instead.
+
+2002-12-07 08:41 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Insert newly-created rows into the per-request lists, so that lower
+ level handlers can access them.
+ [Qn: Should we do something similar with updated lists as well?]
+
+2002-12-07 08:34 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Report back the correct error for rows that couldn't be created.
+
+2002-12-07 08:32 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Protect against freeing a row that never got created in the first place.
+
+2002-12-06 18:05 hardaker
+
+ * testing/tests/T030snmpv3usercreation:
+
+ Skip on non-openssl machines. THis should be changed to just not using encryption on those machines, but I do not have the time at the moment
+
+2002-12-06 13:12 hardaker
+
+ * configure.in:
+
+ remove ucdDemoPublic from --enable-mini-agent
+
+2002-12-06 13:02 hardaker
+
+ * configure:
+
+ remove ucdDemoPublic from --enable-mini-agent
+
+2002-12-06 12:01 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Don't delete the "old" (non-existent) row, when tidying up after
+ creating a new row.
+
+2002-12-06 11:40 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Tweak handling of (invalid) RowStatus creation requests in an
+ "automatic creation" table. These should return wrongValue or
+ inconsistentValue, rather than notWritable.
+
+2002-12-05 05:47 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Support use of RowStatus object to control creation of new rows
+ (i.e. when the 'allow_creation' flag is not set).
+ This should deal with everything except determining whether a
+ row is ready to go 'active' (e.g. via 'createAndGo'). Such a
+ decision is inherently specific to each individual MIB, so must
+ really be done in the lower-level handler.
+
+2002-12-05 05:41 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Stop processing when a 'non-writable create' is detected.
+
+2002-12-04 19:35 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ - BIT_STR -> OCTET_STR, which is what it should be.
+ - run eventTable entries.
+
+2002-12-04 19:34 hardaker
+
+ * agent/mibgroup/disman/mteTriggerExistenceTable.c:
+
+ BIT_STR -> OCTET_STR, which is what it should be.
+
+2002-12-04 19:33 hardaker
+
+ * agent/mibgroup/disman/: mteObjectsTable.c,
+ mteTriggerBooleanTable.c:
+
+ use netsnmp_strdup_and_null to get real strings from mib data.
+
+2002-12-04 19:32 hardaker
+
+ * agent/mibgroup/disman/: event-mib.h,
+ mteEventNotificationTable.c, mteEventNotificationTable.h
+, mteEventTable.c, mteEventTable.h:
+
+ - implemented the mteEventTable and the mteEventNotificationTable
+ - FYI, total implementation time: about 4 hours
+ - no easy-to-use .conf wrappers yet though. snmpset support only.
+
+2002-12-04 19:29 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ - use the netsnmp_table_set_add_indexes function which actually works.
+
+2002-12-04 19:29 hardaker
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ - create a netsnmp_table_set_add_indexes function.
+ - Allow row creation using rowStatus when the data column exists, but
+ there is no assigned value (ie, is NULL).
+ - use netsnmp_strdup_and_null instead of memdup to make sure an
+ implicit NULL is in place for things that use the data and need it
+ as a real string.
+
+2002-12-04 19:27 hardaker
+
+ * net-snmp-config.in:
+
+ document --prefix
+
+2002-12-04 13:16 hardaker
+
+ * NEWS (V4-2-patches.9), NEWS:
+
+ document 4.2.6
+
+2002-12-03 04:44 dts12
+
+ * agent/mibgroup/host/hr_print.c:
+
+ Close printer file handle with 'fclose' rather than 'pclose' to avoid
+ a memory leak on Solaris 2.6. Fix provided by Jacobo Matute.
+
+2002-12-03 04:33 dts12
+
+ * agent/helpers/: table_data.c, table_dataset.c:
+
+ Translate GetNext (and GetBulk) requests into simple Get requests,
+ when passing them from the table_data handler to table_dataset.
+ This is analogous to how the iterate handler works, and allows
+ lower level handlers to override the basic behaviour (without
+ having to duplicate all of the "find next row" code every time).
+
+2002-12-02 04:48 dts12
+
+ * agent/helpers/table.c:
+
+ Return SNMPv2-style exceptions, rather than the SNMPv1 'noSuchName' error.
+ This used to break AgentX subagents, but the latest change to snmp_agent.c
+ (to catch noSuch{Instance,Object} exceptions) seems to have fixed that problem.
+
+2002-12-02 04:40 dts12
+
+ * agent/snmp_agent.c:
+
+ Explicitly parenthesise a comparison, to keep the compiler happy.
+
+2002-12-02 04:39 dts12
+
+ * agent/snmp_agent.c:
+
+ Inclusive-range GetNext requests are transmitted as Get requests, so may
+ well return noSuch{Instance,Object} exceptions. Catch these as well.
+
+2002-12-02 04:36 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Catch (and reject) attempts to create a new row via a non-writable object.
+
+2002-11-28 04:24 dts12
+
+ * agent/helpers/table_iterator.c:
+
+ Null out one final loop_context pointer after being freed.
+ (Patch provided by Roger McCalman)
+
+2002-11-26 17:59 nba
+
+ * snmplib/parse.c:
+
+ Discard the secondary (GROUP) DESCRIPTION insize a MODULE-COMPLIANCE
+ to avoid leaking memory. Thanks to Eugene_Bruk@bmc.com
+
+2002-11-26 17:53 nba
+
+ * apps/snmptranslate.c:
+
+ Reinstate the -w options that was lost in the indent fury
+
+2002-11-26 10:50 hardaker
+
+ * agent/mibgroup/examples/notification.c:
+
+ The notification variable shouldn't be static. A bug found while
+ tracking down a problem pointed out by Venice on IRC.
+
+2002-11-26 04:10 dts12
+
+ * snmplib/snmp_enum.c:
+
+ Fix incorrect usage of SE_MAX_IDS vs SE_MAX_SUBIDS.
+ Reported by 'shinepeak'
+
+2002-11-25 22:41 hardaker
+
+ * local/FAQ2HTML:
+
+ hack of a hack of a hack, or: fix multi-line FAQ questions
+
+2002-11-25 10:08 hardaker
+
+ * README.agentx:
+
+ mention agentxPingInterval
+
+2002-11-18 21:39 hardaker
+
+ * agent/mibgroup/smux/smux.h:
+
+ applied patch #527650
+
+2002-11-11 17:10 nba
+
+ * snmplib/mib.c:
+
+ Respect the mibdirs conf directive. Thanks to Stefan Radman (sradman)
+
+2002-11-11 16:57 nba
+
+ * apps/snmptrapd_log.c:
+
+ Fix a missing error return
+
+2002-11-11 14:26 hardaker
+
+ * snmplib/: snmpTCPDomain.c, snmpUDPDomain.c:
+
+ fix taddr generation/parsing for port based transports to properly use
+ network byte ordering.
+
+2002-11-11 14:25 hardaker
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ fix write support for the timeout column
+
+2002-11-09 10:06 nba
+
+ * agent/mib_modules.c, agent/snmp_vars.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/subagent.c,
+ include/net-snmp/agent/mib_modules.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h:
+
+ Do away with a bunch of compiler warnings
+
+2002-11-09 09:59 nba
+
+ * agent/mibgroup/: util_funcs.c, ucd-snmp/extensible.c,
+ ucd-snmp/memory.c, ucd-snmp/memory_freebsd2.c,
+ ucd-snmp/pass.c, ucd-snmp/proc.c, host/hr_print.c
+:
+
+ Zero is an OK file descriptor. -1 is the error return
+
+2002-11-09 09:54 nba
+
+ * include/net-snmp/library/parse.h, snmplib/parse.c:
+
+ More to the point message for undefined identifiers. Brought forward from 4.2
+
+2002-11-09 09:52 nba
+
+ * apps/snmpvacm.c:
+
+ Print the error information in case of error
+
+2002-11-09 09:51 nba
+
+ * apps/snmpnetstat/route.c:
+
+ Protect against v2 exception results
+
+2002-11-09 09:49 nba
+
+ * sedscript.in, man/snmpcmd.1.def:
+
+ Protect PREFIX when it is the env var. Thanks to Stefan Radman (sradman)
+
+2002-11-09 09:47 nba
+
+ * mibs/rfclist:
+
+ Add RFC 3371 L2TP-MIB
+
+2002-11-09 09:46 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ Updated from IANA
+
+2002-11-07 05:55 jbpn
+
+ * apps/snmptable.c:
+
+ - fix -Cf and -Cw option processing (previously would core dump if
+ no option passed), as pointed out by hampa on #net-snmp
+
+2002-11-06 15:35 rstory
+
+ * net-snmp-config.in:
+
+ fix cut/paste
+
+2002-11-06 15:04 rstory
+
+ * configure:
+
+ configure to match configure.in & makefiles
+
+2002-11-06 14:08 rstory
+
+ * net-snmp-config.in:
+
+ add missing end quote
+
+2002-11-06 13:35 rstory
+
+ * net-snmp-config.in:
+
+ add @DEVFLAGS@ weherver there is a @CFLAGS@, except for the new --base-cflags
+
+2002-11-06 13:22 rstory
+
+ * Makefile.top:
+
+ add @DEVFLAGS@ to CFLAGS
+
+2002-11-06 13:21 rstory
+
+ * configure.in:
+
+ seperate developer cflags from normal cflags
+
+2002-11-06 12:55 rstory
+
+ * agent/mibgroup/util_funcs.h:
+
+ change struct.h include to use "" instead of <net-snmp/>, since it it a local
+ include, not a system include
+
+2002-11-06 12:39 rstory
+
+ * acconfig.h, agent/mibgroup/util_funcs.h,
+ agent/mibgroup/ucd-snmp/lmSensors.c,
+ include/net-snmp/net-snmp-config.h.in,
+ snmplib/ucd-snmp-includes.h, win32/config.h,
+ win32/net-snmp/net-snmp-config.h:
+
+ purge IN_UCD_SNMP_SOURCE
+
+2002-11-05 12:24 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ added a xmlshort delimiter as requested by lands on IRC
+
+2002-11-05 11:59 rstory
+
+ * dist/cvsup:
+
+ tabs -> spaces only try to chmod RO src dir if owner of dirs
+
+2002-11-05 11:56 rstory
+
+ * mkinstalldirs:
+
+ making a directory is not an error, so don't send output to stderr
+
+2002-11-04 11:15 hardaker
+
+ * agent/mibgroup/target/snmpTargetParamsEntry.c:
+
+ allow unregistered security models <= 2
+
+2002-11-04 11:14 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ enable row creation to be better supported (rowstatus no longer has to
+ be first in the list, ...)
+
+2002-11-04 11:13 hardaker
+
+ * net-snmp-config.in:
+
+ add cppflags to --cflags
+
+2002-11-04 11:13 hardaker
+
+ * NEWS:
+
+ add stuff for 5.0.7 (or whatever) mentioning a few new features.
+
+2002-11-01 12:06 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Fixed bug #632094 using the suggested method: watch for NULL strerror() return
+
+2002-11-01 10:09 rstory
+
+ * Makefile.in:
+
+ undo my changes from r 5.17, attempting to reduce runs of config.status
+ by using explicit paths to srcdir, and let VPATH do it's thing
+
+2002-10-29 14:30 rstory
+
+ * snmplib/Makefile.in:
+
+ target to build binary array test app; tweak to parse test target (reduces most
+ but not all external references)
+
+2002-10-29 14:27 rstory
+
+ * snmplib/container_binary_array.c:
+
+ fix for binary search problem noted by Romy Christensen on coders; partial
+ (ifdef'd out) code for a binary array iterator
+
+2002-10-29 14:25 rstory
+
+ * snmplib/test_binary_array.c:
+
+ simple test program for binary array
+
+2002-10-29 09:28 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Fix debugging as noted in bug #630348
+
+2002-10-28 19:47 hardaker
+
+ * configure, configure.in:
+
+ changed .1.6.3 to 1.3.6 as noted in comp.protocols.snmp
+
+2002-10-28 15:01 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.conf:
+
+ changed password
+
+2002-10-28 14:57 hardaker
+
+ * agent/mibgroup/examples/ucdDemoPublic.conf:
+
+ misc vacm fixes
+
+2002-10-28 08:41 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - remove erroneous free() of rxbuf
+
+2002-10-25 12:35 hardaker
+
+ * snmplib/snmp_api.c:
+
+ fixed SNMP_CALLBACK_OP_DISCONNECT -> NETSNMP_OP_CALLBACK_DISCONNECT as noted by TrogL on IRC
+
+2002-10-25 07:34 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - perform a NETSNMP_CALLBACK_OP_DISCONNECT type callback if we
+ decide to shutdown a stream type connection because we received
+ an excessively large packet.
+
+2002-10-24 10:41 hardaker
+
+ * README:
+
+ Added the super-bug-patch generator Stefan Radman to the THANKS list
+
+2002-10-24 10:40 hardaker
+
+ * configure.in:
+
+ bug #617508: added the mta_sendmail module to --help
+
+2002-10-24 10:35 hardaker
+
+ * local/Makefile.in:
+
+ update install list for mib2c conf files and remove old one
+
+2002-10-23 20:34 hardaker
+
+ * configure, configure.in:
+
+ fix incorrect variable name I noticed when copying to a different configure script in another package
+
+2002-10-23 20:28 hardaker
+
+ * Makefile.in:
+
+ Fixed bug#617838: versiontag isn't distributed and shouldn't be always
+ used in the make distclean calls.
+
+2002-10-23 20:12 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ inconsequencial memory leaks fixed (init time leaks).
+
+2002-10-23 20:10 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Fixed various memory leaks in the table_iterator as pointed out by
+ Roger McCalman and Jay Parlar on the -coders list (including their patches)
+
+2002-10-23 18:44 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ snmpNotifyTable.c
+
+2002-10-23 18:40 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ free a previously malloced pointer to the watch variable before replacing it.
+
+2002-10-23 18:40 hardaker
+
+ * agent/mibgroup/examples/delayed_instance.c:
+
+ remove duplicate unused malloc.
+
+2002-10-21 12:43 jbpn
+
+ * include/net-snmp/system/solaris2.9.h:
+
+ - add system file for Solaris 9
+
+2002-10-17 22:44 hardaker
+
+ * agent/agent_registry.c, agent/snmp_agent.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/mibII/vacm_vars.h,
+ include/net-snmp/agent/agent_callbacks.h,
+ include/net-snmp/agent/agent_registry.h,
+ include/net-snmp/library/vacm.h, snmplib/vacm.c:
+
+ Optimized the VACM checks in the case of getnext/getbulk so that when
+ large portions of the mib tree are excluded, the sub-mib access code
+ won't be called at all (finally implementing a very long needed optimization).
+
+2002-10-17 22:41 hardaker
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ new function to find the commonality between two oids: netsnmp_oid_find_prefix
+
+2002-10-17 22:39 hardaker
+
+ * Makefile.in, aclocal.m4, configure,
+ configure.in:
+
+ Print out a "summary" at the end of a run
+
+2002-10-17 05:40 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Properly terminate a loop construct (missing '@end@')
+ Spotted by Karl Cooper. Oops!
+
+2002-10-16 17:19 rstory
+
+ * agent/snmpd.c:
+
+ restore continue after EINTR caused by signal we handled (instead of falling
+ thorough to exit!)
+
+2002-10-16 17:00 rstory
+
+ * agent/snmpd.c:
+
+ check for our signal flags on EINTR, and only relesect if not changed;
+ debug msg when signals registered and for select/fdsets;
+
+2002-10-16 15:52 rstory
+
+ * Makefile.top:
+
+ move CPPFLAGS before user configure CFLAGS.. so if a user adds something
+ like /usr/local/include to CFLAGS, we will pick up our local includes first,
+ instead of includes from a previous release..
+
+2002-10-16 00:06 rstory
+
+ * apps/: snmptrapd.c, snmptrapd_log.c, snmptrapd_log.h
+:
+
+ make sure snmptrapd always honors DS_APP_NUMERIC_IP for logging
+
+2002-10-15 17:09 rstory
+
+ * snmplib/mib.c:
+
+ netsnmp_get_boolean -> netsnmp_ds_get_boolean
+
+2002-10-15 14:08 rstory
+
+ * agent/helpers/table.c:
+
+ fix constant used in assert, noted on coders
+
+2002-10-15 14:07 rstory
+
+ * agent/snmp_agent.c:
+
+ include syslog for libwrap log levels
+
+2002-10-15 10:39 hardaker
+
+ * man/snmpcmd.1.def:
+
+ Add yet another way to specify v6 addresses
+
+2002-10-14 11:54 hardaker
+
+ * man/snmpcmd.1.def:
+
+ fix ipv6 transport address specs
+
+2002-10-11 19:18 hardaker
+
+ * README.cmu, dist/net-snmp.spec:
+
+ Remove the README.cmu file (entirely out of date at this point).
+
+2002-10-11 16:57 hardaker
+
+ * acconfig.h, configure, configure.in,
+ agent/mibgroup/ucd-snmp/disk.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ patch #600933 from Donal Diamond: dskPercentNode for FreeBSD4
+
+2002-10-11 16:49 hardaker
+
+ * snmplib/mib.c:
+
+ Patch #598280 from Jeff Watson: make -OQ not print type warnings.
+
+2002-10-11 16:43 hardaker
+
+ * dist/Makefile:
+
+ fix include directory
+
+2002-10-11 16:42 hardaker
+
+ * dist/.cvsignore:
+
+ ignore rpm subdir
+
+2002-10-11 16:32 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ better docs about auto-extracted SF news
+
+2002-10-11 16:04 hardaker
+
+ * dist/: Makefile, net-snmp.spec:
+
+ merge in patch #598869: Mark Harig's better rpm stuff
+
+2002-10-11 15:21 hardaker
+
+ * include/net-snmp/library/default_store.h, snmplib/mib.c
+:
+
+ Alternative to a patch suggestion: add -OU to not print UNITS suffixes.
+
+2002-10-11 15:18 hardaker
+
+ * man/snmpcmd.1.def:
+
+ ../agent/snmp_agent.c
+
+2002-10-11 15:14 hardaker
+
+ * man/snmp.conf.5.def:
+
+ document dontPrintUnits
+
+2002-10-11 14:48 hardaker
+
+ * agent/snmp_agent.c:
+
+ Patch #617151 from Andrew Rucker Jones: fix libwrap headers.
+ - I'm still unhappy with how libwrap functions... needs thinking about.
+
+2002-10-11 13:53 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Patch #312694 from John Surveyor: fix diskio on solaris.
+
+2002-10-11 13:37 hardaker
+
+ * agent/mibgroup/mibII/at.c:
+
+ Applied patch #621398 from Matthew Krenzer to fix linux arp table.
+
+2002-10-11 09:47 rstory
+
+ * win32/snmpdsdk/snmpd.dsp:
+
+ chg netsnmpmibs -> netsnmpmibsskd (noted on coders by Jed Whitten)
+
+2002-10-11 09:45 jbpn
+
+ * man/snmpcmd.1.def:
+
+ - note square brackets for IPv6 addresses
+
+2002-10-11 09:40 jbpn
+
+ * agent/snmpd.c:
+
+ - restart select() more quickly if an EINTR happens
+
+2002-10-11 01:51 hardaker
+
+ * FAQ:
+
+ applied Harrie's patch describing low memory footprints
+
+2002-10-10 11:38 hardaker
+
+ * snmplib/snmpksm.c:
+
+ Patch from Ken Horstein to fix KSM module
+
+2002-10-10 06:22 jbpn
+
+ * agent/helpers/table_array.c:
+
+ - remove bad inlines which cause file not to compile with Sun CC.
+ See bug #620827.
+
+2002-10-10 02:03 hardaker
+
+ * dist/net-snmp.spec:
+
+ add .la files
+
+2002-10-10 02:00 hardaker
+
+ * dist/net-snmp.spec:
+
+ make the .spec file almost usable.
+
+2002-10-08 18:55 hardaker
+
+ * FAQ:
+
+ FAQ updates for download sites.
+
+2002-10-08 10:36 hardaker
+
+ * perl/OID/OID.pm:
+
+ Patch from Joshua Keroes for string comparisons
+
+2002-10-07 13:57 hardaker
+
+ * FAQ:
+
+ added a statement about the COPYING file (suggested by Harrie)
+
+2002-10-06 14:32 rstory
+
+ * dist/README.build-scripts:
+
+ nsb-* likes full paths, update examples; fix sourceforge upload site
+
+2002-10-05 17:42 hardaker
+
+ * README, sedscript.in, snmplib/snmp_version.c
+, FAQ, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.6 )
+
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0.5 -> V5.0.6
+
+2002-10-05 14:29 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2002-10-05 14:09 hardaker
+
+ * Makefile.top:
+
+ update for 5.0.6
+
+2002-10-05 14:08 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ remove illegal flag from nsb-config
+
+2002-10-05 13:41 rstory
+
+ * agent/snmp_agent.c:
+
+ efence is your friend: don't allocate 0 bytes
+
+2002-10-05 12:58 rstory
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ efence is your friend: don't reference ptr after is has been free'd.
+
+2002-10-04 07:17 hardaker
+
+ * agent/snmp_agent.c:
+
+ fix secondary effect of bug 613983 and really fix it this time.
+
+2002-10-02 10:56 hardaker
+
+ * agent/mibgroup/tunnel/: tunnel.c (V4-2-patches.2), tunnel.c
+:
+
+ Patch from Frank Strauss to fix some coding errors
+
+2002-10-01 07:39 rstory
+
+ * agent/snmp_vars.c:
+
+ offical patch 617049: initialize container list earlier (in init_agent)
+
+2002-10-01 07:35 rstory
+
+ * agent/snmp_vars.c:
+
+ remove ^M characters (damn windows editors)
+
+2002-09-30 15:17 rstory
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.5 )
+
+2002-09-30 15:16 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ add info on md5sums and gpg signing
+
+2002-09-30 15:15 rstory
+
+ * dist/cvsup:
+
+ fix chmod to do what I wanted, not what I told it
+
+2002-09-30 15:14 rstory
+
+ * ChangeLog, Makefile.top, NEWS:
+
+ update for 5.0.5
+
+2002-09-30 14:27 rstory
+
+ * ChangeLog:
+
+ merge pre changes into 5.0.4 comments
+
+2002-09-30 14:25 rstory
+
+ * NEWS:
+
+ update for 5.0.4
+
+2002-09-30 14:23 hardaker
+
+ * NEWS:
+
+ NEWS updates for 5.0.4
+
+2002-09-30 14:03 rstory
+
+ * README:
+
+ update my email address
+
+2002-09-30 14:03 rstory
+
+ * ChangeLog:
+
+ update for release 5.0.4
+
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0.3 -> V5.0.5
+
+2002-09-30 16:08 rstory
+
+ * agent/helpers/table.c:
+
+ make len a size_t to fix problem on 64 bit system, reported by sebnod` in IRC
+
+2002-09-30 16:05 rstory
+
+ * agent/helpers/table.c:
+
+ don't use static local vars, as they are likely to cause problems with threads
+
+2002-09-30 15:48 rstory
+
+ * dist/nsb-package:
+
+ make sure install dir is relative to build dir
+
+2002-09-30 15:20 rstory
+
+ * snmplib/vacm.c:
+
+ add missing newline in debug
+
+2002-09-30 15:19 rstory
+
+ * dist/: nsb-functions, nsb-package:
+
+ fix typos
+
+2002-09-30 15:18 rstory
+
+ * agent/snmp_agent.c:
+
+ avoid infinite loop
+
+2002-09-30 14:59 rstory
+
+ * dist/nsb-functions:
+
+ don't assume make is GNU make, and search for it. require user to set an
+ env var if no GNU make is found in PATH
+
+2002-09-30 14:58 rstory
+
+ * dist/cvsup:
+
+ if CVS dir is ro, automagically make it rw before update and ro after update
+
+2002-09-27 14:03 hardaker
+
+ * agent/snmp_agent.c:
+
+ make get_set_cache() return an error if no previous SET has been started.
+
+2002-09-27 14:02 hardaker
+
+ * agent/agent_registry.c:
+
+ double check against some null pointers before using them in the cache code.
+
+2002-09-27 13:36 hardaker
+
+ * agent/snmp_agent.c:
+
+ set treecache_num to -1 at init of memory, to be extra safe.
+
+2002-09-26 14:58 hardaker
+
+ * agent/: snmp_agent.c, snmpd.c:
+
+ move libwrap variables
+
+2002-09-26 14:57 hardaker
+
+ * perl/agent/agent.xs:
+
+ ok, remove tcpwrappers vars
+
+2002-09-26 13:44 hardaker
+
+ * perl/agent/agent.xs:
+
+ define stupid variables needed by tcpwrappers because they don't get
+ concepts of encapsulation. arg.
+
+2002-09-26 11:26 hardaker
+
+ * perl/agent/agent.xs:
+
+ change call_pv to perl_call_pv for older versions of perl.
+
+2002-09-26 11:10 hardaker
+
+ * snmplib/mib.c:
+
+ run strdup() on get_mib_dir() results to fix bug pointed out by Eugene Bruk.
+
+2002-09-23 13:14 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ mention freshmeat
+
+2002-09-23 13:13 hardaker
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c,
+ agent/mibgroup/ucd-snmp/versioninfo.h, mibs/UCD-SNMP-MIB.txt
+:
+
+ - implement a (long needed) settable variable to store the current
+ persistent information.
+
+2002-09-23 12:47 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - make not in time window reports trigger a resend of informs.
+ (suggestion from Erik Anggard)
+
+2002-09-20 11:28 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.h:
+
+ - remove functions vacm_parse_security and vacm_free_security which
+ don't exist
+
+2002-09-19 17:01 hardaker
+
+ * perl/agent/agent.xs:
+
+ - support agent shutdowns (well, ok it's just an api since it doesn't work).
+ - misc bug fixes.
+
+2002-09-19 16:38 hardaker
+
+ * perl/agent/: agent.xs, netsnmp_request_infoPtr.pm:
+
+ fix agent request_infoPtr problems.
+
+2002-09-19 12:04 dts12
+
+ * win32/snmptranslate/snmptranslate.dsp:
+
+ Compile and link with 'getopt.c' explicitly.
+
+ This should not be necessary, but for some reason
+ (that completely escapes me!), using command-line options
+ (such as -IR) with the Release version of snmptranslate
+ causes a run-time DLL error. (The Debug version is fine).
+ The other applications seem to be OK - this problem only
+ seems to hit snmptranslate. So as a sticking-plaster,
+ compiliing getopt.c in as part of the project, keeps both
+ versions of the application happy.
+ Someone with better Windows knowledge than me needs to
+ look at this and fix it properly.
+
+2002-09-19 06:14 jbpn
+
+ * include/net-snmp/library/snmp_api.h:
+
+ - undo worst of indent damage
+
+2002-09-19 06:03 jbpn
+
+ * include/net-snmp/library/snmp_api.h:
+
+ - remove _dparse functions (which don't exist)
+
+2002-09-18 10:55 hardaker
+
+ * testing/eval_tools.sh:
+
+ reset SNMP_SLEEP after loop
+
+2002-09-18 10:41 jbpn
+
+ * snmplib/snmp_client.c:
+
+ - remove very obsolete (and not used anywhere) #definitions of
+ PARTY_MIB_BASE and CONTEXT_MIB_BASE
+
+2002-09-18 02:59 rstory
+
+ * ChangeLog:
+
+ tweak for 5.0.4 last minute update
+
+2002-09-18 02:48 rstory
+
+ * testing/eval_tools.sh:
+
+ chg > to -gt to achieve intended result
+
+2002-09-18 01:39 rstory
+
+ * NEWS:
+
+ update for 5.0.4
+
+2002-09-18 01:33 rstory
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.4 )
+
+2002-09-18 01:32 rstory
+
+ * ChangeLog:
+
+ update for 5.0.4
+
+2002-09-18 00:59 rstory
+
+ * Makefile.in:
+
+ add $(srcdir) to a few dependencies to try and reduce the # of times that
+ config.status is run when building outside the src dir
+
+2002-09-18 00:54 rstory
+
+ * README.win32:
+
+ visually provocative section headers; add recent status (all bad news);
+ not to use new win32sdk.dsw to get additonal functionality with platform sdk;
+ remove info on removing agentx, as it's been around now for a while; add
+ section on what files to edit to add mib2c generated code to agent; remove
+ reference to specific release number in example
+
+2002-09-18 00:25 rstory
+
+ * win32/snmpdsdk/snmpd.dsp:
+
+ take 'sdk' out of exe name
+
+2002-09-18 00:25 rstory
+
+ * win32/win32sdk.dsw:
+
+ swap snmpdsdk for snmpd
+
+2002-09-18 00:14 rstory
+
+ * win32/: encode_keychange/encode_keychange.dsp,
+ libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp_dll.dsp,
+ snmpbulkget/snmpbulkget.dsp, snmpbulkwalk/snmpbulkwalk.dsp
+, snmpd/snmpd.dsp, snmpdelta/snmpdelta.dsp,
+ snmpdf/snmpdf.dsp, snmpget/snmpget.dsp,
+ snmpgetnext/snmpgetnext.dsp, snmpnetstat/snmpnetstat.dsp
+, snmpset/snmpset.dsp, snmpstatus/snmpstatus.dsp,
+ snmptable/snmptable.dsp, snmptest/snmptest.dsp,
+ snmptranslate/snmptranslate.dsp, snmptrap/snmptrap.dsp,
+ snmptrapd/snmptrapd.dsp, snmpusm/snmpusm.dsp,
+ snmpvacm/snmpvacm.dsp, snmpwalk/snmpwalk.dsp:
+
+ get all our ducks in a row: add advapi32.lib to link lines, make sure all
+ Release and Debug libs/apps are compile with same C++ settings
+
+2002-09-18 00:12 rstory
+
+ * win32/netsnmpmibs/netsnmpmibs.dsp:
+
+ remove sdk dependent modules
+
+2002-09-18 00:10 rstory
+
+ * win32/mib_module_inits.h:
+
+ group modules that depend on win32 sdk together, with ifdef
+
+2002-09-18 00:08 rstory
+
+ * agent/snmp_vars.c:
+
+ no callback for win32 until pipe fd problem is fixed
+
+2002-09-18 00:07 rstory
+
+ * win32/: netsnmpmibssdk/netsnmpmibssdk.dsp,
+ snmpdsdk/snmpd.dsp:
+
+ new versions for sdk users
+
+2002-09-18 00:05 rstory
+
+ * win32/win32sdk.dsw:
+
+ new workspace for sdk users
+
+2002-09-16 16:27 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ mib module loading fixes by calling init_snmp first
+
+2002-09-13 15:05 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ tweak example nsb-config command; add -b back to cvs2cl, otherwise you
+ get changelog msgs from other branches and have to weed them out
+
+2002-09-13 12:33 hardaker
+
+ * perl/OID/: OID.pm, OID.xs, test.pl:
+
+ fix illegal oids to not return a pointer.
+
+2002-09-13 10:40 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ - minor optimisation; we don't need a zero-terminated community
+ string except for debugging output.
+
+2002-09-13 10:35 hardaker
+
+ * local/mib2c:
+
+ added -i option to request indent not be run
+
+2002-09-13 10:06 jbpn
+
+ * COPYING:
+
+ - add missing verb in introduction
+
+2002-09-12 15:58 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ protect calling some SvIV dereference functions if it's not an IV.
+ - eliminates the remaining perl warnings.
+
+2002-09-12 14:45 hardaker
+
+ * net-snmp-config.in:
+
+ include ldflags where appropriate (--libs, --agent-libs, ...)
+
+2002-09-12 01:48 rstory
+
+ * dist/: nsb-nightly, nsb-package:
+
+ add/use new option to remove build dir after successful build
+
+2002-09-12 01:47 rstory
+
+ * dist/nsb-functions:
+
+ print build dir
+
+2002-09-12 01:19 hardaker
+
+ * testing/tests/: Sv3config, T030snmpv3usercreation:
+
+ much more complex tests of USM user creation/modification.
+
+2002-09-12 01:07 hardaker
+
+ * testing/: eval_tools.sh, tests/T001snmpv1get,
+ tests/T002snmpv1getnext, tests/T003snmpv1getfail,
+ tests/T004snmpv1nosuch:
+
+ - support for multiple tests at once.
+ - merge v1 tests into a single (faster) test.
+
+2002-09-12 00:34 rstory
+
+ * dist/nsb-functions:
+
+ don't monkey around with returning error codes, just exit; more regexp tweaks
+
+2002-09-11 19:36 hardaker
+
+ * testing/eval_tools.sh:
+
+ - use sub-second sleeps if available
+ - sleep 1 (sub-)second at a time when waiting for particular tests
+ rather than the full SNMP_SLEEP duration.
+
+2002-09-11 19:24 hardaker
+
+ * apps/snmptrapd.c:
+
+ use snmp_log instead of printf for shutdown message.
+
+2002-09-11 18:42 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ missing variable decl pointed out by irc:df
+
+2002-09-10 16:16 rstory
+
+ * dist/nsb-functions:
+
+ tweak error regexps & error messages
+
+2002-09-10 15:28 rstory
+
+ * local/mib2c.array-user.conf:
+
+ compiler warnings are your friend!; fix embeded comments; fix non-void
+ functions w/no rtn values; code reorg to fix emacs indent complaints
+
+2002-09-10 15:26 rstory
+
+ * Makefile.in:
+
+ new start-flag end-flag targets to help nightly build script determine
+ if a make completed successfully
+
+2002-09-10 15:12 rstory
+
+ * dist/nsb-functions:
+
+ tweaks for new script for automated nightly builds; ad nsb-abort, nsb-flow;
+ direct some messages to stderr; use new start-flag end-flag make targets;
+ update error grep to include '***'; check for new value to rm -fR build dir
+
+2002-09-10 15:08 rstory
+
+ * dist/nsb-nightly:
+
+ new script for automated nightly builds
+
+2002-09-10 15:08 rstory
+
+ * dist/nsb-package:
+
+ add option to rm -fR build dir at start; check scrip path for nsb-functions;
+ prefix default build dir w/version; exit w/rc from nsb-build
+
+2002-09-10 15:05 rstory
+
+ * dist/: nsb-config, nsb-platform:
+
+ add current path to script to nsb-function search path
+
+2002-09-09 09:28 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - fix bug pointed out by Jared Smith-Mickelson (bug #605147)
+ whereby passing an unknown type character to snmp_add_var would
+ cause a segfault.
+
+2002-09-09 09:09 hardaker
+
+ * apps/snmptranslate.c:
+
+ double check a pointer value before using it.
+
+2002-09-09 09:09 hardaker
+
+ * configure, configure.in,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Current header update patch for netbsd from Patrick Welche.
+
+2002-09-06 18:30 driehuis
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ Mark the non-raw variants of objects that are accessable as raw counters
+ as deprecated, to (hopefully!) cut down on the number of users that get
+ bitten by it..
+
+2002-09-04 14:36 hardaker
+
+ * README.solaris:
+
+ added Bruce's email address
+
+2002-09-04 14:27 hardaker
+
+ * Makefile.in, Makefile.rules:
+
+ fix perlclean
+
+2002-09-04 14:10 hardaker
+
+ * agent/snmpd.c:
+
+ Fix process grouping by calling setsid() (reported by irc:TrogL)
+
+2002-09-04 14:09 hardaker
+
+ * configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ check for setsid().
+
+2002-09-03 13:51 hardaker
+
+ * local/mib2c:
+
+ fix cases where there either are no tables or no scalars.
+
+2002-09-03 13:23 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ don't use NULL variables.
+
+2002-09-02 22:33 rstory
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.4.pre2 )
+
+2002-09-02 22:33 rstory
+
+ * ChangeLog:
+
+ update for release 5.0.4.pre2
+
+2002-09-02 22:22 rstory
+
+ * man/netsnmp_handler.3:
+
+ updated docs
+
+2002-09-02 22:19 rstory
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2002-09-02 22:16 rstory
+
+ * dist/nsb-config:
+
+ try and guess at src dir if not specified
+
+2002-09-02 22:15 rstory
+
+ * dist/README.build-scripts:
+
+ add note about err when building in and out of source tree
+
+2002-09-02 21:55 rstory
+
+ * Makefile.in:
+
+ full path to versiontag, in case we are buildint outside of src directory
+
+2002-09-02 21:37 rstory
+
+ * dist/nsb-functions:
+
+ remove forced prompt on errors
+
+2002-09-02 21:36 rstory
+
+ * Makefile.in:
+
+ add warnings when VERSION is required; add tarclean target; add tarclean to
+ distclean target
+
+2002-09-02 21:34 rstory
+
+ * agent/mibgroup/versiontag:
+
+ add msg on error; add clean target
+
+2002-09-02 20:27 rstory
+
+ * NEWS:
+
+ update win32 & AgentX status
+
+2002-09-02 20:20 rstory
+
+ * agent/snmp_agent.c, agent/mibgroup/agentx/master_admin.c
+, include/net-snmp/agent/snmp_agent.h:
+
+ fix to avoid locking up the agent when a sugagent dies during a set request. We
+ must clean up the delegated requests when the session(s) are closed, so that
+ they will be processed and removed, allowing further requests to be processed.
+
+2002-09-01 13:43 rstory
+
+ * snmplib/container_binary_array.c:
+
+ change result type back to int, as it may receive a negative value
+
+ PLEASE check the use of a variable before changing is signedness, especially
+ areound release time!
+
+2002-08-30 15:18 rstory
+
+ * include/net-snmp/utilities.h:
+
+ include check_varbind.h
+
+2002-08-30 15:18 rstory
+
+ * agent/helpers/table_array.c:
+
+ change NOSUCHNAME to NOSUCHINSTANCE again, as it seems the agentX fix also
+ correctly deals with this error code
+
+2002-08-30 09:14 hardaker
+
+ * FAQ, README:
+
+ - delete sunsite.cnlab-switch.ch mirror, as it isn't one anymore.
+
+2002-08-29 13:32 rstory
+
+ * dist/nsb-functions:
+
+ check for modules before configuring them
+
+2002-08-29 10:52 hardaker
+
+ * snmplib/scapi.c:
+
+ Fix the last AES bug I know of. AES128 works great.
+ I still Need to fix 192/256 for longer key generation from MD5/SHA
+
+2002-08-29 10:52 hardaker
+
+ * perl/agent/agent.pm:
+
+ use the right perl module name in the use line.
+
+2002-08-29 06:47 dts12
+
+ * agent/agent_handler.c, agent/mibgroup/agentx/master.c
+, include/net-snmp/agent/agent_registry.h,
+ win32/config.h:
+
+ More Win32-related tidying up.
+ The agent now compiles with relatively few warnings.
+
+2002-08-29 04:50 dts12
+
+ * agent/agent_trap.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/utilities/override.h,
+ include/net-snmp/agent/snmp_agent.h,
+ include/net-snmp/agent/table_dataset.h,
+ include/net-snmp/library/mt_support.h,
+ snmplib/container_binary_array.c, snmplib/snmpusm.c,
+ win32/config.h, win32/libsnmp_dll/libsnmp.def:
+
+ Declare new routine 'netsnmp_oid_equals', and assorted Win32 cleanup fixes.
+
+2002-08-28 14:15 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ clarify cvs2cl script name; remove -b flag from cvs2cl per Dave; a little
+ reorganization; put commands on separate lines prefixed with $; note 5.x/4.x
+ differences per Dave's email; plug my new scripts where appropriate
+
+2002-08-27 14:48 rstory
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ add URL for cvs2cl; update cvs2cl cmds to cvs2cl.pl, since that's the file
+ that's actually distributed
+
+2002-08-27 00:59 rstory
+
+ * Makefile.top:
+
+ update for release 5.0.4.pre1
+
+2002-08-27 00:25 rstory
+
+ * snmplib/snmp_version.c, FAQ, README,
+ sedscript.in, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.4.pre1 )
+
+2002-08-27 00:24 rstory
+
+ * ChangeLog:
+
+ update for release 5.0.4.pre1
+
+2002-08-27 00:19 rstory
+
+ * agent/Makefile.depend (5.6), agent/helpers/Makefile.depend (5.5),
+ agent/mibgroup/Makefile.depend (5.6), apps/Makefile.depend (5.5),
+ apps/snmpnetstat/Makefile.depend (5.5), snmplib/Makefile.depend
+ (5.5):
+
+ make depend
+
+2002-08-27 00:17 rstory
+
+ * man/: netsnmp_agent.3 (5.3), netsnmp_bulk_to_next.3 (5.3),
+ netsnmp_debug.3 (5.3), netsnmp_handler.3 (5.3), netsnmp_instance.3
+ (5.3), netsnmp_multiplexer.3 (5.3), netsnmp_old_api.3 (5.3),
+ netsnmp_read_only.3 (5.3), netsnmp_scalar.3 (5.2),
+ netsnmp_serialize.3 (5.3), netsnmp_table.3 (5.3),
+ netsnmp_table_array.3 (5.3), netsnmp_table_data.3 (5.3),
+ netsnmp_table_dataset.3 (5.3), netsnmp_table_iterator.3 (5.3),
+ netsnmp_todo.3 (5.3), netsnmp_watcher.3 (5.2):
+
+ update man pages for 5.0.4.pre1
+
+2002-08-27 00:10 rstory
+
+ * dist/nsb-config (1.1):
+
+ new file to configure using same options as nsb-package for test or dist
+
+2002-08-27 00:09 rstory
+
+ * dist/nsb-package (1.3):
+
+ don't append sys-name when building in src tree
+
+2002-08-27 00:09 rstory
+
+ * dist/nsb-functions (1.19):
+
+ fix typo
+
+2002-08-27 00:06 rstory
+
+ * dist/nsb-functions (1.18):
+
+ rename nsb-get-confg -> nsb-config-dist; use double quotes cuz of some
+ wierd shell thing I don't yet understand; check for src dir in config*
+
+2002-08-26 23:34 rstory
+
+ * Makefile.in (5.12):
+
+ tweak commentcheck target to work outside the source tree
+
+2002-08-26 23:33 rstory
+
+ * agent/mibgroup/mibII/interfaces.c (5.3),
+ agent/mibgroup/ucd-snmp/proxy.c (5.1),
+ include/net-snmp/library/asn1.h (5.2),
+ include/net-snmp/library/oid_stash.h (5.1), snmplib/winservice.c
+ (5.1):
+
+ remove C++ style comments (and anything that even remotely resembles one)
+
+2002-08-26 17:47 rstory
+
+ * dist/nsb-functions (1.17):
+
+ pass make params to make, so we don't try to install in /usr/local/bin of
+ the compile servers... :-/
+
+2002-08-26 17:39 rstory
+
+ * dist/nsb-functions (1.16):
+
+ make dist & extra transports; no ipv6 on Darwin; make touchit before make
+
+2002-08-26 17:04 rstory
+
+ * agent/mibgroup/Rmon/event.c (5.4):
+
+ replace u_int32_t, which doesn't compile on Sun 5.8, with u_int
+
+2002-08-26 16:53 rstory
+
+ * agent/mibgroup/Rmon/rows.c (5.2):
+
+ fix undeclared variable error spotted on Sun, which linux missed completely.
+ I have no idea how this compiled before!!
+
+2002-08-26 16:43 rstory
+
+ * dist/nsb-functions (1.15):
+
+ cleaner way to add system specific modules; disable perl, as it breaks
+ builds outside of the source tree
+
+2002-08-26 15:45 rstory
+
+ * dist/nsb-functions (1.14):
+
+ only configure IPX on Linux
+
+2002-08-26 15:44 rstory
+
+ * dist/nsb-functions (1.13):
+
+ only configure IPX on Linux; bail on configure errors
+
+2002-08-26 15:04 rstory
+
+ * dist/README.build-scripts (1.4):
+
+ add suggestion to symlink nsb-* in local bin dir
+
+2002-08-26 15:03 rstory
+
+ * dist/: nsb-package (1.2), nsb-functions (1.12):
+
+ add option for pre-release test configure options
+
+2002-08-26 15:02 rstory
+
+ * README.snmpv3 (5.3):
+
+ make section headers stand out more; move note about encryption not being
+ enabled to a more prominent place.
+
+2002-08-24 21:24 driehuis
+
+ * configure.in, agent/mibgroup/ucd-snmp/diskio.c
+ (V4-2-patches.[37,3]):
+
+ Merge from HEAD: detect the requirement for linking with -ldevstat.
+ Ugly hack to make sure diskio device names include the device number.
+
+2002-08-23 11:46 dts12
+
+ * snmplib/Makefile.in (V4-2-patches.3):
+
+ make depend
+
+2002-08-22 08:31 jbpn
+
+ * include/net-snmp/system/solaris2.7.h (5.2):
+
+ - DONT_USE_NLIST reinstated, so NO_KMEM_USAGE redundant
+
+2002-08-22 08:29 jbpn
+
+ * acconfig.h (5.9), include/net-snmp/net-snmp-config.h.in (5.10):
+
+ - reinstate test for DONT_USE_NLIST
+
+2002-08-22 07:11 jbpn
+
+ * agent/snmpd.c (5.10):
+
+ - stop and restart logging when HUPped. This allows logfiles to be
+ rotated and so forth.
+
+2002-08-22 07:06 jbpn
+
+ * agent/snmpd.c (V4-2-patches.24):
+
+ - stop and restart logging when HUPped. This allows logfiles to be
+ rotated and so forth.
+
+2002-08-22 04:31 dts12
+
+ * README.snmpv3 (5.2):
+
+ Add the missing '-x/X' options to the example authPriv command line
+ (reported by Prasada R Vankayalapati)
+
+2002-08-20 11:04 hardaker
+
+ * agent/mibgroup/agentx/subagent.c (5.6), apps/snmptrapd.c (5.4),
+ include/net-snmp/agent/ds_agent.h (5.3), FAQ (5.17):
+
+ quiet snmptrapd when it can't connect to the agentx master.
+
+2002-08-20 08:54 jbpn
+
+ * include/net-snmp/system/solaris2.7.h (5.1):
+
+ - add #define NO_KMEM_USAGE 1 since net-snmp-config.h.in no longer
+ pays attention to the DONT_USE_NLIST token. Omission of this
+ causes the agent to exit with the message "init_kmem: kvm_open
+ failed: error 0".
+
+ NOTE: this may need applying to other members of the Solaris 2
+ family, but I don't have machines to hand to test this.
+
+2002-08-20 08:48 jbpn
+
+ * agent/mibgroup/kernel_sunos5.c (5.2):
+
+ - detect gigabit ethernet devices (geN)
+ - undo indent mayhem
+
+2002-08-20 05:57 jbpn
+
+ * include/net-snmp/utilities.h (5.1):
+
+ - for now, don't #include snmp_locking.h since it breaks re-entrant
+ support (because mutex_type gets multiply-defined). Furthermore, the
+ functions it declares are never used anywhere, nor defined anywhere.
+
+2002-08-20 05:56 jbpn
+
+ * include/net-snmp/library/mt_support.h (5.1):
+
+ - don't define "do nothing" macros for snmp_res_lock et al. functions
+ on Win32 platform (since real "do nothing" functions are required for
+ reasons best known to someone else).
+ - unmangling
+
+2002-08-20 05:54 jbpn
+
+ * include/net-snmp/library/snmp_locking.h (5.1):
+
+ - fix highly bogus non-C syntax
+
+2002-08-20 05:53 jbpn
+
+ * snmplib/mt_support.c (5.1):
+
+ - snmp_res_lock et al. functions no longer #defined to "do nothing"
+ targets for Win32 in mt_support.h, therefore no need to #undef them
+ here.
+ - unmangling
+
+2002-08-20 01:13 hardaker
+
+ * include/net-snmp/agent/agent_registry.h (5.2):
+
+ headers for cache enabling functions.
+
+2002-08-20 01:12 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c (5.3):
+
+ don't use non-existent memory pointers to the response data (eg: "timeout")
+
+2002-08-19 17:46 nba
+
+ * include/net-snmp/net-snmp-includes.h (5.1):
+
+ Change a few conditionals to use #if in place of #ifdef
+
+2002-08-19 17:28 nba
+
+ * snmplib/: mib.c (5.17), parse.c (5.4):
+
+ Align with 4.2 branch
+
+2002-08-19 17:26 nba
+
+ * mibs/: DISMAN-SCHEDULE-MIB.txt (5.1),
+ IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt (5.1), IANAifType-MIB.txt
+ (5.1), INET-ADDRESS-MIB.txt (5.1), Makefile.mib (5.2), ianalist
+ (5.1), mibfetch (5.1), rfclist (5.1):
+
+ Update to current MIBs
+
+2002-08-19 17:25 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c (5.7):
+
+ Bail out for bad snmpAdminString value
+
+2002-08-19 10:43 jbpn
+
+ * FAQ (V4-2-patches.53), FAQ (5.16):
+
+ - don't use positional community parameter in examples
+ - break a couple of over-long lines
+ - mention netsnmp_ variant of ds_set_ function
+
+2002-08-19 05:44 dts12
+
+ * FAQ (V4-2-patches.52), FAQ (5.15):
+
+ Add an entry about the snmptrapd/AgentX warning message.
+
+2002-08-18 21:24 rstory
+
+ * dist/nsb-functions (1.11):
+
+ don't configure with build install dir, it is already specified on cmd line
+ for make install
+
+2002-08-18 13:59 rstory
+
+ * agent/helpers/table.c (5.7):
+
+ more debugging - log value request is trying to set
+
+2002-08-16 18:13 hardaker
+
+ * README (5.9):
+
+ added Bruce Shaw to the thanks list
+
+2002-08-16 18:12 hardaker
+
+ * README.solaris (1.2):
+
+ A great update talking about perl and solaris from Bruce Shaw
+
+2002-08-16 04:51 dts12
+
+ * agent/helpers/table_iterator.c (5.4):
+
+ Catch explicitly 'noSuchInstance' exceptions, when walking an
+ iterator-handled module, so that holes can be skipped and the
+ next real instance retrieved. (This was already handled for
+ modules that didn't mark missing instances explicitly).
+
+2002-08-16 03:17 hardaker
+
+ * agent/snmp_agent.c (5.13):
+
+ turn off caching by default, since the agentx code appears broken.
+
+2002-08-16 03:03 hardaker
+
+ * agent/: agent_registry.c (5.5), snmp_agent.c (5.12):
+
+ speed enhancements via implementing a registration subtree lookup
+ cache. greatly speeds things up when similar requests come in
+ (snmpwalk, ...).
+
+2002-08-15 13:35 hardaker
+
+ * snmplib/parse.c (5.3):
+
+ protect against NULL labels in subtrees
+
+2002-08-15 11:14 hardaker
+
+ * agent/agent_index.c (5.3), agent/agent_registry.c (5.4),
+ agent/agent_trap.c (5.1), agent/helpers/old_api.c (5.2),
+ agent/mibgroup/header_complex.c (5.1), agent/mibgroup/testhandler.c
+ (5.1), snmplib/snmp_transport.c (5.2), snmplib/snmpusm.c (5.3):
+
+ use netsnmp_oid_equals (which is sometimes faster than
+ snmp_oid_compare) in a few places to achieve barely noticeable speed gains.
+
+2002-08-15 11:12 hardaker
+
+ * snmplib/parse.c (5.2):
+
+ double check a pointer exists before passing it to strcmp()
+
+2002-08-15 11:05 hardaker
+
+ * perl/SNMP/Makefile.PL (5.7):
+
+ change MAN3PODS to something compliant with the perl manuals. I think.
+
+2002-08-14 13:42 rstory
+
+ * apps/snmpset.c (5.2):
+
+ add debug for local parsing of args
+
+2002-08-14 12:26 rstory
+
+ * agent/mibgroup/agentx/: master.c (5.5), master_admin.c (5.4),
+ subagent.c (5.5):
+
+ add more detailed in debug messages; add a few new debugs
+
+2002-08-14 12:23 rstory
+
+ * agent/snmp_agent.c (5.11):
+
+ when all delegated requests have finished, check all requests status so that
+ asp status is set, which is necessary for correct agentx set processing.
+ (now if I can just get all this hair off the floor, and glue it back to my
+ head, and then fix that dent in the wall where I've been banging my head....)
+
+2002-08-13 17:25 hardaker
+
+ * snmplib/snmp_api.c (5.14):
+
+ fix a length comparison problem with netsnmp_oid_is_subtree()
+
+2002-08-13 17:24 hardaker
+
+ * NEWS (5.6):
+
+ document a few recent changes.
+
+2002-08-13 17:05 hardaker
+
+ * agent/mibgroup/host/hr_print.c (5.1):
+
+ Fix open file runaway on solaris. See bug #592806 reported by James Irwin.
+
+2002-08-13 15:05 rstory
+
+ * include/net-snmp/types.h (5.7):
+
+ array of pointers = pointer to a pointer
+
+2002-08-09 19:32 hardaker
+
+ * local/FAQ2HTML (5.1):
+
+ misc doc fixes.
+
+2002-08-09 19:31 hardaker
+
+ * snmplib/snmp_parse_args.c (5.4),
+ include/net-snmp/library/transform_oids.h (5.2), snmplib/snmpusm.c
+ (5.2), snmplib/snmpv3.c (5.3):
+
+ initial AES support.
+
+2002-08-09 19:31 hardaker
+
+ * include/net-snmp/library/snmp_api.h (5.2), snmplib/snmp_api.c
+ (5.13):
+
+ slight speed ups for snmp_oid_compare() to do single int compares till !=
+
+2002-08-09 19:29 hardaker
+
+ * snmplib/scapi.c (5.2):
+
+ - openssl 0.9.7 support for DES changes.
+ - initial AES support.
+
+2002-08-09 19:28 hardaker
+
+ * snmplib/keytools.c (5.2):
+
+ indent fixes.
+
+2002-08-09 19:27 hardaker
+
+ * include/net-snmp/library/: scapi.h (5.1), snmpusm.h (5.1):
+
+ define AES key specifics
+
+2002-08-09 19:26 hardaker
+
+ * acconfig.h (5.8), configure (5.17), configure.in (5.15),
+ include/net-snmp/net-snmp-config.h.in (5.9):
+
+ - check for openssl .0.9.7 DES structures and functions.
+ - check for AES support in openssl (> 0.9.7)
+
+2002-08-09 19:10 hardaker
+
+ * agent/mibgroup/agentx/subagent.c (5.4):
+
+ fix mode processing for RESERVE1/RESERVE2 test failures
+
+2002-08-09 18:29 rstory
+
+ * agent/snmp_agent.c (5.10):
+
+ log msg when we ignore/fix illegal error_values for the client APIs
+
+2002-08-09 18:28 rstory
+
+ * local/mib2c.array-user.conf (5.12):
+
+ corrections to example code
+
+2002-08-09 18:27 rstory
+
+ * agent/helpers/table.c (5.6):
+
+ revert errors to uninformative SNMPv1 noSuchName for AgentX get-next/inclusive
+ processing; also add more comments here and there
+
+2002-08-09 17:08 rstory
+
+ * agent/mibgroup/agentx/master.c (5.4):
+
+ debug msg for agentx oid for cases other than get/getnext
+
+2002-08-09 11:45 rstory
+
+ * agent/mibgroup/agentx/master_admin.c (5.3):
+
+ don't free registration info on failure, as netsnmp_register_mib already did it
+
+2002-08-09 09:57 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c (5.2), snmpCallbackDomain.c (5.1),
+ snmpIPXDomain.c (5.1), snmpTCPDomain.c (5.4), snmpTCPIPv6Domain.c
+ (5.5), snmpUDPDomain.c (5.6), snmpUDPIPv6Domain.c (5.7),
+ snmpUnixDomain.c (5.4), snmp_transport.c (5.1):
+
+ - rename snmp_<domain>_blah functions to netsnmp_<domain>_blah
+ - make transport member functions static, to emphasise that they should
+ not be used directly
+ - handle EINTR in send and recv functions (as pointed out by Antti Kuntsi
+ in bug report #576806)
+ - formatting fixes
+
+2002-08-09 09:54 jbpn
+
+ * include/net-snmp/library/: snmpAAL5PVCDomain.h (5.3),
+ snmpIPXDomain.h (5.2), snmpTCPDomain.h (5.2), snmpTCPIPv6Domain.h
+ (5.3), snmpUDPDomain.h (5.2):
+
+ - minor formatting fixes
+
+2002-08-09 09:54 jbpn
+
+ * include/net-snmp/library/snmpUnixDomain.h (5.3):
+
+ - don't export netsnmp_unix_blah() functions
+
+2002-08-09 09:53 jbpn
+
+ * include/net-snmp/library/snmp_transport.h (5.1):
+
+ - fix nasty formatting
+
+2002-08-08 12:14 rstory
+
+ * snmplib/snmpv3.c (5.2):
+
+ reword config_perror msgs to remove "Error", as it is redundant
+
+2002-08-08 12:11 rstory
+
+ * snmplib/keytools.c (5.1):
+
+ remove ifdef to log msg to user, after making msg more informative; remove
+ annoying blank lines
+
+2002-08-08 11:33 hardaker
+
+ * acconfig.h (5.7), configure (5.16), configure.in (5.14):
+
+ Patch from Harrie to completely disable kmem usage
+
+2002-08-06 03:30 jbpn
+
+ * agent/mibgroup/agentx/subagent.c (5.3):
+
+ - set main_session to NULL in subagent_shutdown(). This (along with the
+ deregistration of all alarms) allows AgentX functionality to be
+ stopped and restarted in subagents.
+ - Thanks to Vishal Verma for original patch
+
+2002-08-06 03:27 jbpn
+
+ * include/net-snmp/library/snmp_alarm.h (5.1):
+
+ - add snmp_alarm_unregister_all() function
+
+2002-08-06 03:26 jbpn
+
+ * snmplib/: snmp_alarm.c (5.3), snmp_api.c (5.12):
+
+ - add snmp_alarm_unregister_all() function
+ - call it from snmp_shutdown()
+ - thanks to Vishal Verma for original patch
+
+2002-08-06 03:17 jbpn
+
+ * snmplib/snmp_alarm.c (V4-2-patches.4):
+
+ - add debugging output when all alarms unregistered
+
+2002-08-06 03:10 jbpn
+
+ * agent/mibgroup/agentx/subagent.c (V4-2-patches.4):
+
+ - set main_session to NULL in subagent_shutdown(). This (along with the
+ deregistration of all alarms) allows AgentX functionality to be
+ stopped and restarted in subagents.
+ - Thanks to Vishal Verma for this patch (#558517)
+
+2002-08-06 03:08 jbpn
+
+ * snmplib/: snmp_alarm.c, snmp_alarm.h, snmp_api.c
+ (V4-2-patches.[3,1,36]):
+
+ - add snmp_alarm_unregister_all() function
+ - call it from snmp_shutdown()
+ - thanks to Vishal Verma for providing this patch
+
+2002-08-05 10:06 rstory
+
+ * local/mib2c.iterate.conf (5.3):
+
+ match function definition w/Netsnmp_*_DataPoint typedefs; add cvs Id
+
+2002-08-03 11:52 rstory
+
+ * dist/RELEASE-INSTRUCTIONS (1.5):
+
+ break up lines long than 80 chars; abcde, not abcdd
+
+2002-08-03 03:21 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS (1.4):
+
+ more updates about things Wes does at 12:30 am
+
+2002-08-03 02:44 hardaker
+
+ * FAQ (5.14), README (5.8), sedscript.in (5.6), perl/SNMP/SNMP.pm
+ (5.12), snmplib/snmp_version.c (5.5):
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.3 )
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0.2 -> V5.0.3
+
+2002-08-02 23:41 hardaker
+
+ * agent/mibgroup/agent/.cvsignore:
+
+ add .libs
+
+2002-08-02 23:40 hardaker
+
+ * agent/mibgroup/Rmon/.cvsignore:
+
+ ignore file
+
+2002-08-02 23:39 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ make depend
+
+2002-08-02 23:37 hardaker
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ forgotten to check in test for perl_ev changes
+
+2002-08-02 23:35 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ remove debugging print (opps)
+
+2002-08-02 23:35 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ fix default version usage.
+
+2002-08-02 23:34 hardaker
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Patch #572394 from Katsuhisa ABE:
+ - support link local addresses
+ - bind to ipv6 only if IPV6_V6ONLY is defined.
+
+2002-08-02 23:31 hardaker
+
+ * snmplib/snmp_parse_args.c:
+
+ fix configure specified default versioning
+
+2002-08-02 22:58 hardaker
+
+ * configure, configure.in:
+
+ Patch #572394: add ipv6 transports when --enable-ipv6 defined. Thanks to Katsuhisa ABE.
+
+2002-08-02 14:59 hardaker
+
+ * NEWS:
+
+ update for 5.0.3
+
+2002-08-02 14:55 hardaker
+
+ * man/snmp_agent_api.3.def:
+
+ update
+
+2002-08-02 14:39 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ more docs.
+
+2002-08-02 14:29 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_multiplexer.3, netsnmp_old_api.3,
+ netsnmp_read_only.3, netsnmp_scalar.3,
+ netsnmp_serialize.3, netsnmp_table.3,
+ netsnmp_table_array.3, netsnmp_table_data.3,
+ netsnmp_table_dataset.3, netsnmp_table_iterator.3,
+ netsnmp_todo.3, netsnmp_watcher.3, Makefile.in:
+
+ doxygen update.
+
+2002-08-02 14:26 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ update for yet more stuff.
+
+2002-08-02 14:26 hardaker
+
+ * remove-files:
+
+ remove a few more dist related files.
+
+2002-08-02 14:23 hardaker
+
+ * snmplib/snmp_api.c:
+
+ error message change to remove DES specific error msg.
+
+2002-08-02 14:23 hardaker
+
+ * perl/agent/typemap:
+
+ spacing fixes.
+
+2002-08-02 14:22 hardaker
+
+ * perl/agent/: Makefile.PL, agent.xs:
+
+ renamed file.
+
+2002-08-02 14:22 hardaker
+
+ * perl/agent/: netsnmp_request_info.pm,
+ netsnmp_request_infoPtr.pm:
+
+ renamed file
+
+2002-08-02 14:20 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ Add a "evalvars" directive to do simply replacements.
+
+2002-08-02 14:16 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ use CVSUSER variable when doing stuff instead of my hard-coded name.
+
+2002-08-02 14:14 hardaker
+
+ * Makefile.top:
+
+ update libtool version for 5.0.3
+
+2002-08-02 14:13 hardaker
+
+ * Makefile.in:
+
+ change checkcomment tag to exclude win32 files.
+
+2002-08-02 14:13 hardaker
+
+ * ChangeLog:
+
+ update changelog build notes at the bottom of the file.
+
+2002-08-02 14:01 hardaker
+
+ * dist/RELEASE-INSTRUCTIONS:
+
+ created a how-to file for making releases
+
+2002-08-02 14:01 hardaker
+
+ * dist/changelogfix:
+
+ changelog fix-up script
+
+2002-08-02 10:21 rstory
+
+ * dist/nsb-functions:
+
+ translate '/' in system name to '_' (for cygwin)
+
+2002-08-02 09:56 rstory
+
+ * dist/README.build-scripts:
+
+ fix section cvs get command example
+
+2002-08-02 09:06 dts12
+
+ * include/net-snmp/system/hpux.h:
+
+ Suppress 'inline' when not using GCC. Suggested by Johannes Schmidt-Fischer
+
+2002-08-02 08:59 rstory
+
+ * dist/README.build-scripts:
+
+ fix section on skipping make test; add -p flag to examples
+
+2002-08-02 08:52 rstory
+
+ * dist/README.build-scripts:
+
+ describe use of nsb-package script. Testers and comments appreciated...
+
+2002-08-02 08:33 rstory
+
+ * dist/nsb-platform:
+
+ output platform info
+
+2002-08-02 08:18 rstory
+
+ * dist/nsb-build:
+
+ renamed to nsb-package
+
+2002-08-02 08:18 rstory
+
+ * dist/nsb-package:
+
+ renamed nsb-build to avoid confusion with script function
+
+2002-08-02 08:15 hardaker
+
+ * dist/nsb-functions:
+
+ Change location name to Unknown
+
+2002-08-02 08:08 hardaker
+
+ * perl/: ASN/ASN.pm, agent/agent.pm,
+ agent/netsnmp_request_info.pm:
+
+ more old perl fixes
+
+2002-08-02 08:04 hardaker
+
+ * perl/: OID/OID.pm, agent/default_store/default_store.pm
+:
+
+ more old perl fixes
+
+2002-08-02 08:00 hardaker
+
+ * perl/default_store/default_store.pm:
+
+ more old perl fixes
+
+2002-08-02 07:48 rstory
+
+ * dist/nsb-functions:
+
+ fix return code
+
+2002-08-02 07:48 rstory
+
+ * dist/nsb-build:
+
+ don't pull first arg til after getopts/shift; move set of default opts
+
+2002-08-02 07:37 rstory
+
+ * dist/nsb-functions:
+
+ add option to skip build or test steps; add -f option to prompt to override
+ no prompt flag (useful for errors); new nsb-make method; check rc of
+ make clean
+
+2002-08-02 07:36 rstory
+
+ * dist/nsb-build:
+
+ add option to skip build or test steps; tweak usage
+
+2002-08-02 07:10 rstory
+
+ * dist/nsb-build:
+
+ fix typo; remove extra trailing slash in dir
+
+2002-08-02 06:33 rstory
+
+ * dist/nsb-build:
+
+ check more places to source nsb-functions; fix for cmd line build path
+
+2002-08-02 06:28 rstory
+
+ * dist/nsb-functions:
+
+ just show errors after build, not warnings
+
+2002-08-01 17:04 hardaker
+
+ * perl/OID/OID.xs:
+
+ revert to non-ansi prototypes for older perl with older compilers on
+ older systems. Not that I'm grumpy, of course.
+
+2002-08-01 16:25 hardaker
+
+ * configure.in, agent/snmp_perl.c:
+
+ check for older and new embedded perl call functions
+
+2002-08-01 14:07 rstory
+
+ * dist/nsb-functions:
+
+ don't symlink to src from build; update nsb-get-config
+
+2002-08-01 14:06 rstory
+
+ * dist/nsb-build:
+
+ fix for cmd line build dir
+
+2002-08-01 12:58 rstory
+
+ * dist/nsb-functions:
+
+ fix config install path; remove platform specific from nsb-build
+
+2002-08-01 12:56 rstory
+
+ * dist/nsb-build:
+
+ remove hard coded info
+
+2002-08-01 12:22 rstory
+
+ * dist/nsb-functions:
+
+ add option to skip prompts; remove previous installs; tweak err pattern
+
+2002-08-01 12:14 jbpn
+
+ * man/snmp_alarm.3.def:
+
+ - use netsnmp_ds_set_boolean() instead of ds_set_boolean()
+
+2002-08-01 12:12 jbpn
+
+ * man/snmp_agent_api.3.def:
+
+ - change code sample to use netsnmp_ds_set_boolean()
+ - update references to libraries (which were still talking about
+ libucdagent et al.) -- PLEASE REVIEW BEFORE 5.0.3
+
+2002-08-01 12:07 rstory
+
+ * dist/nsb-functions:
+
+ lots of fixes to previouse untested scripts
+
+2002-08-01 12:04 rstory
+
+ * dist/nsb-build:
+
+ script to build releases... still some hardcoding while testing, but its
+ getting there...
+
+2002-08-01 11:51 rstory
+
+ * dist/: cvsshow, cvsup:
+
+ utility scripts
+
+2002-08-01 09:30 dts12
+
+ * agent/helpers/: scalar.c, scalar2.c:
+
+ Go with the "scalar as super-handler of instance" implementation.
+ Scalar1.c is probably redundent, but we can remove this later.
+ (Yup - I'm a coward....)
+
+2002-08-01 01:11 dts12
+
+ * README.win32:
+
+ Minor typos, plus emphasise the need for the IpHlpAPI library.
+
+2002-07-30 08:26 dts12
+
+ * local/snmpconf.dir/snmp-data/output:
+
+ Recognise '0' as a valid setting for suffixPrinting, and update the
+ prompts to match the v5 output formats defaults. See Bug #567451
+
+2002-07-30 07:59 dts12
+
+ * apps/snmptable.c:
+
+ First attempt at tackling Bug #574434
+ Recognise that default output format is equivalent to -OS.
+ Snmptable still crashes with -Of or -Ou, but at least the
+ default invocation works.
+
+2002-07-30 05:41 dts12
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Export newly-defined public names, and re-export some routines that
+ have changed name. This should now compile under Visual C++ again.
+
+2002-07-30 02:27 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Don't remove a Row-Status auto-deleted row until the last minute,
+ in case other (lower) handlers try to access it.
+
+2002-07-30 01:38 dts12
+
+ * FAQ (V4-2-patches.1), FAQ:
+
+ Mention the need to escape quotes when querying string-indexed tables.
+
+2002-07-29 23:56 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ update register function name
+
+2002-07-29 23:55 rstory
+
+ * local/mib2c.array-user.conf:
+
+ autogen example code for index checking in extract_index; update register
+ function name; use container in *_get_by_idx()
+
+2002-07-29 16:23 rstory
+
+ * local/mib2c.array-user.conf:
+
+ update for new struct name; add example code as comments instead of var_XXX
+ and such; in a few important places add code which will allow a newly
+ generated module to be compiled if -DTABLE_CONTAINER_TODO is specified;
+ probably a few other tweaks I forgot
+
+2002-07-29 03:06 dts12
+
+ * agent/helpers/: table_array.c, table.c, table_data.c
+, table_dataset.c, table_iterator.c:
+
+ Protect against deferencing NULL pointers.
+ (Most of these Should Never Happen but You Can't Be Too Careful!)
+
+2002-07-29 03:03 jbpn
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - detect `dmfe' ethernet cards as found on Netra X1 machines.
+ Thanks to John Olson for verifying this fix.
+
+ Also note that `indent' has ----ed the formatting of this file
+ beyond legibility in several places. I don't think we want to
+ do *that* again.
+
+2002-07-29 02:40 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Fuller validation of RowStatus values wrt row creation/existing rows.
+
+2002-07-29 01:25 dts12
+
+ * win32/: libsnmp/libsnmp.dsp, libsnmp_dll/libsnmp_dll.dsp
+, netsnmpmibs/netsnmpmibs.dsp:
+
+ Take account of recent changes in library files.
+ 'Release' applications still don't link properly, but at least
+ the libraries compile, and the 'Debug' side seems to work.
+
+2002-07-29 01:23 dts12
+
+ * include/net-snmp/system/aix.h:
+
+ Tweak inline handling for AIX - suggested by Andy Hood.
+
+2002-07-26 10:52 rstory
+
+ * snmplib/Makefile.in:
+
+ remove autodependencies until portable solution can be found
+
+2002-07-26 08:41 dts12
+
+ * win32/: mib_module_config.h, mib_module_includes.h,
+ mib_module_inits.h:
+
+ Remove mention of the (obsolete) ucd-snmp/registry module.
+
+2002-07-26 07:32 dts12
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ Protect the Win32 version of the config file, so that the other header
+ files recognise that it has indeed been included.
+
+2002-07-26 07:24 dts12
+
+ * FAQ (V4-2-patches.0), FAQ:
+
+ A bit more detail on mib2c, plus the non-writeability of sys{Location,Contact}
+
+2002-07-26 05:22 dts12
+
+ * FAQ (V4-2-patches.9), FAQ:
+
+ Another entry about invalid use of mib2c.
+
+2002-07-26 05:16 dts12
+
+ * snmplib/Makefile.in:
+
+ Suppress the "non-standard" conditional construct,
+ since it's not recognised by some versions of 'make'.
+
+2002-07-25 05:00 dts12
+
+ * agent/helpers/Makefile.in:
+
+ Add the 'scalar' and 'watcher' helpers to the helper library.
+
+2002-07-25 03:28 dts12
+
+ * agent/helpers/watcher.c, include/net-snmp/agent/watcher.h
+:
+
+ Support for watching a sysUpTime marker.
+
+2002-07-25 03:24 dts12
+
+ * agent/helpers/table_dataset.c,
+ include/net-snmp/agent/table_dataset.h:
+
+ New routine for retrieving a column value directly from a request structure.
+
+2002-07-24 13:17 rstory
+
+ * snmplib/default_store.c:
+
+ check for setting same value in ds_set_string, since it frees the old
+ value before duping the new one
+
+2002-07-24 11:58 rstory
+
+ * dist/snmpd-init.d:
+
+ first stab at init.d startup script for snmpd
+
+2002-07-24 06:48 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ When running off the end of one column, and moving on to the next
+ (in a GetNext), we need to start again with the first row.
+ This is probably the intention of the conditional block at the start
+ of this loop, but I can't see how this test could ever possibly match.
+
+ Note that there is also a reference to the row data accessible via
+ the 'request->parent_data' data list. This will also need to be
+ rewound. Suggestions as to how best to do so gratefully received.
+
+2002-07-24 06:39 dts12
+
+ * agent/helpers/table_dataset.c:
+
+ Use SNMPv2-style exceptions rather than the uninformative SNMPv1
+ 'noSuchName' error for missing table objects.
+
+2002-07-24 06:37 dts12
+
+ * agent/helpers/table_data.c:
+
+ Protect against the possibility of failing to extract a row structure.
+
+2002-07-24 06:35 dts12
+
+ * agent/helpers/table_data.c:
+
+ Use SNMPv2-style exceptions rather than the uninformative SNMPv1
+ 'noSuchName' error for missing table objects.
+
+2002-07-24 06:32 dts12
+
+ * agent/helpers/table.c:
+
+ Use SNMPv2-style exceptions rather than the uninformative SNMPv1
+ 'noSuchName' error for invalid table objects.
+
+2002-07-23 14:59 rstory
+
+ * include/net-snmp/library/snmp_assert.h:
+
+ missing comment terminator.:-(
+
+2002-07-23 12:02 rstory
+
+ * agent/object_monitor.c, agent/snmp_agent.c,
+ agent/helpers/table.c, agent/helpers/table_array.c,
+ snmplib/container_binary_array.c:
+
+ use new netsnmp_assert instead of assert
+
+2002-07-23 12:00 rstory
+
+ * include/net-snmp/library/snmp_assert.h, snmplib/Makefile.in
+:
+
+ add new netsnmp_assert, which defaults to logging a message
+
+2002-07-23 07:43 dts12
+
+ * man/: mib_api.3 (V4-2-patches.3), mib_api.3.def:
+
+ Fix the descriptions of the 'sprint_realloc' calls, to include the 'allow_realloc' parameter.
+
+2002-07-22 10:58 rstory
+
+ * dist/: net-snmp.spec, nsb-functions:
+
+ new (almost empty) spec file; start creating functions for automated builds
+
+2002-07-22 01:46 dts12
+
+ * agent/helpers/watcher.c, include/net-snmp/agent/watcher.h
+:
+
+ A more generalised form of the 'ns_register_{type}_instance' routines,
+ implemented as a separate helper module, and useable with both the
+ instance and scalar helpers.
+ This also supports arbitrary ASN types (including strings and OIDs).
+
+2002-07-22 01:43 dts12
+
+ * agent/helpers/scalar1.c, agent/helpers/scalar2.c,
+ include/net-snmp/agent/scalar.h:
+
+ Agent helper module for support of scalar objects.
+ Very similar to the "instance" helper, except that this deals with
+ invalid instance subidentifiers as well (reporting noSuchInstance
+ rather that noSuchObject).
+
+ There are two parallel implementations as the moment:
+ - scalar1 is essentially an enhanced copy of the instance helper,
+ but is completely independent of it.
+ - scalar2 sits above the instance helper, and uses that to do most
+ of the real processing.
+ Scalar1 is probably slightly more efficient, while scalar2 feels more
+ in keeping with the general ethos of the handler mechanism.
+ We probably need to decide which to adopt, and junk the other.
+
+2002-07-19 14:24 rstory
+
+ * agent/mibgroup/agentx/master.c:
+
+ use net agentx retires/timeout ds values
+
+2002-07-19 14:22 rstory
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ register parser for agentxTimeout and agentxRetries tokens
+
+2002-07-19 14:15 rstory
+
+ * agent/mibgroup/Makefile.depend:
+
+ remove refs to non-existent nstAgent* files
+
+2002-07-19 14:14 rstory
+
+ * agent/snmpd.c:
+
+ move ONE_SEC to definitions.h; add AGENTX_TIMEOUT and AGENTX_RETRIES defaults
+
+2002-07-19 14:10 rstory
+
+ * include/net-snmp/agent/ds_agent.h:
+
+ add AGENTX_TIMEOUT and AGENTX_RETRIES
+
+2002-07-19 14:10 rstory
+
+ * include/net-snmp/definitions.h:
+
+ move definition of ONE_SEC here from snmpd.c
+
+2002-07-19 11:23 rstory
+
+ * snmplib/container.c:
+
+ pass local obj, not random unitialized pointer.:-(
+
+2002-07-19 04:04 dts12
+
+ * include/net-snmp/library/tools.h:
+
+ Handle systems where MAXPATHLEN isn't defined.
+
+2002-07-19 03:31 dts12
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Use the "system-independent" SNMP_MAXPATH length definition instead of MAXPATHLEN
+
+2002-07-18 22:00 rstory
+
+ * agent/Makefile.depend:
+
+ remove refs to nonexistent mibgroup/nstAgentModuleObject.h
+
+2002-07-18 19:44 hardaker
+
+ * FAQ, README, sedscript.in, perl/SNMP/SNMP.pm
+, snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.2 )
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0.1 -> V5.0.2
+
+2002-07-18 19:41 hardaker
+
+ * testing/eval_tools.sh:
+
+ minor patch for non-existent (died) log files.
+
+2002-07-18 19:41 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend:
+
+ make depend
+
+2002-07-18 19:40 hardaker
+
+ * NEWS:
+
+ update for 5.0.2
+
+2002-07-18 19:40 hardaker
+
+ * Makefile.rules:
+
+ make depend fixes.
+
+2002-07-18 18:57 hardaker
+
+ * agent/mibgroup/Rmon/: alarm.c, event.c:
+
+ make the rmon code compile.
+ - new subtree pointer structure.
+ - sprint_objid -> snprint_objid
+
+2002-07-18 18:32 hardaker
+
+ * Makefile.in:
+
+ silence perl subdirectory build commands.
+
+2002-07-18 18:31 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ - Use netsh -t -d xml to get xml output from netsh.
+ (Ok, I'm sitting here at an IETF conference having an argument about
+ xml vs BER and needed a XML(-like) example of a huge data set, so I
+ made netsh do it.)
+
+2002-07-18 17:54 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ - initial support for doing requests from multiple hosts (retrieval, not sets)
+
+2002-07-18 17:50 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ more fixes to still ugly colorized text (well, the text is pretty but
+ the support is ugly).
+
+2002-07-18 17:42 hardaker
+
+ * include/net-snmp/library/container.h:
+
+ change text string error to match function name called.
+
+2002-07-18 15:31 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+, snmplib/container_binary_array.c:
+
+ rename free -> cfree to avoid some problem wes had... ;-)
+
+2002-07-18 14:41 rstory
+
+ * snmplib/mib.c:
+
+ two people fixing memory leak in different places = segfault
+
+2002-07-18 11:02 rstory
+
+ * local/mib2c.array-user.conf:
+
+ $name -> $i
+
+2002-07-18 10:56 rstory
+
+ * agent/object_monitor.c,
+ include/net-snmp/agent/object_monitor.h:
+
+ update to use containers
+
+2002-07-18 09:40 rstory
+
+ * net-snmp-config.in:
+
+ add --debug-tokens, --indent-options
+
+2002-07-18 09:18 dts12
+
+ * include/net-snmp/agent/auto_nlist.h, snmplib/snmp-tc.c
+, include/net-snmp/system/irix.h:
+
+ Apply patch from Bug #582347, for Irix 6.5 support.
+ Submitted by Jan Yenya Kasprzak
+
+2002-07-18 09:12 dts12
+
+ * man/: snmptrapd.8 (V4-2-patches.5), snmptrapd.8.def:
+
+ Fix markup problem on snmptrapd man page (Bug #583329)
+
+2002-07-18 09:10 dts12
+
+ * snmplib/snmp-tc.c:
+
+ The fix for the tm_gmtoff problem on AIX (Bug #565769) also applies to AIX 5
+
+2002-07-18 09:06 dts12
+
+ * apps/: encode_keychange.c (V4-2-patches.1), encode_keychange.c
+:
+
+ Fix off-by-one buffer overflow (patch #577261)
+
+2002-07-18 08:51 dts12
+
+ * local/mib2c.array-user.conf:
+
+ Generate one code-file per table (to match the header structure).
+ My apologies if this isn't correct, Robert - but the previous behaviour
+ seemed to be broken.
+
+2002-07-18 08:37 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Tackle some of the immediate deficiencies in the first draft old-api config.
+ (Now that Wes has pointed me in the direction of the documentation!)
+
+2002-07-18 08:22 dts12
+
+ * local/mib2c:
+
+ Fix the 'decl' substitution handling (so it doesn't include the internal token as well).
+
+2002-07-18 07:18 dts12
+
+ * local/mib2c.scalar.conf:
+
+ Provide the missing parameter in a read_only instance registration.
+
+2002-07-18 07:09 dts12
+
+ * agent/helpers/instance.c, include/net-snmp/agent/instance.h
+:
+
+ Bring the 'read_only_int' instance handler in line with the rest of
+ the convenience instance handlers.
+ (and even break the habit of a lifetime and declare the thing....)
+
+2002-07-18 05:48 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ fix another memory leak due to an improper ifdefed out section of code
+
+2002-07-18 04:45 hardaker
+
+ * snmplib/scapi.c:
+
+ I'm beginning to regret ever running indent on the code base...
+
+2002-07-17 15:43 hardaker
+
+ * local/: Makefile.in, mib2c.conf:
+
+ document and install mib2c.old-api.conf
+
+2002-07-17 13:07 rstory
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ fix segfault (possibly creating memory leak); author needs to examine code
+
+2002-07-17 07:41 dts12
+
+ * local/: mib2c.array-user.conf, mib2c.conf,
+ mib2c.create-dataset.conf, mib2c.int_watch.conf,
+ mib2c.iterate.conf, mib2c.scalar.conf:
+
+ Dave's being unreasonably picky about grammar & spelling again.
+ Just ignore him, and he'll go away.....
+
+2002-07-17 07:20 dts12
+
+ * local/mib2c.old-api.conf:
+
+ Initial support for the old 4x-style agent API using the new version of mib2c.
+ It doesn't handle types properly, and I'm sure I'll have buggered up some of
+ the control structure handling, but it seems to generate something that's
+ pretty close to the old output. It's better than nothing.....
+
+2002-07-16 22:40 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ restore inline functions (sigh. I feel like I'm playing ring-around-the-rosie)
+
+2002-07-16 21:58 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h,
+ local/mib2c.array-user.conf:
+
+ rename some struct members to make code easier to read; a bit of re-ordering
+ in the set code; new flags for new and deleted rows; row deletes now
+ actualy work!
+
+2002-07-16 19:32 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ change complex macros into functions. would be nice if C had inline.
+
+2002-07-16 18:07 rstory
+
+ * include/net-snmp/types.h:
+
+ umm, try using correct define.:-/
+
+2002-07-16 18:05 rstory
+
+ * include/net-snmp/types.h:
+
+ test that net-snmp-config.h has been included, instead of actually including it..
+ (shouldn't this really be in all the header files?)
+
+2002-07-16 12:14 rstory
+
+ * local/mib2c.array-user.conf:
+
+ update for containers
+
+2002-07-16 11:20 rstory
+
+ * snmplib/snmpTCPIPv6Domain.c:
+
+ fix compiler warning
+
+2002-07-16 11:16 rstory
+
+ * apps/snmpnetstat/Makefile.depend:
+
+ remove oid_array related dependencies (grumble grumble)
+
+2002-07-16 11:14 rstory
+
+ * apps/Makefile.depend:
+
+ remove oid_array related dependencies
+
+2002-07-16 11:02 rstory
+
+ * agent/: Makefile.depend, mibgroup/Makefile.depend:
+
+ remove oid_array related dependencies
+
+2002-07-16 10:52 rstory
+
+ * snmplib/Makefile.depend, agent/helpers/Makefile.depend
+:
+
+ remove oid_array related dependencies
+
+2002-07-16 10:50 rstory
+
+ * snmplib/Makefile.in:
+
+ remove factory.c
+
+2002-07-16 10:29 rstory
+
+ * snmplib/snmp_api.c:
+
+ add netsnmp_container_init_list() in startup inits
+
+2002-07-16 10:21 rstory
+
+ * include/net-snmp/library/oid_array.h, snmplib/oid_array.c
+:
+
+ remove unused files
+
+2002-07-16 10:21 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ chg param type from void* to struct *
+
+2002-07-16 10:03 rstory
+
+ * snmplib/Makefile.in:
+
+ remove recently deleted oid_array.h; add factory, binary array .[ch]; derive
+ OBJS and LOBJS from CSRCS; add (optional) auto dependency generation
+
+2002-07-16 09:53 rstory
+
+ * include/net-snmp/mib_api.h:
+
+ remove recently deleted oid_array.h
+
+2002-07-16 09:52 rstory
+
+ * agent/mibgroup/ucd-snmp/extensible.h:
+
+ struct subtree -> netsnmp_subtree
+
+2002-07-16 09:46 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h:
+
+ remove last remaining refs to now defunct oid_array
+
+2002-07-16 09:40 rstory
+
+ * include/net-snmp/library/container_binary_array.h,
+ snmplib/container_binary_array.c:
+
+ generic binary array container extracted from oid_array
+
+2002-07-16 09:40 rstory
+
+ * include/net-snmp/types.h:
+
+ include net-snmp-config.h; new typedef struct netsnmp_index (oid ptr + len)
+
+2002-07-16 09:38 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h:
+
+ use generic container interface; use new netsnmp_index instead of
+ oid_array_header; rename array_group -> request_group
+
+2002-07-16 09:34 rstory
+
+ * include/net-snmp/library/container.h, snmplib/container.c
+:
+
+ add iterators; more function typedefs; rename some func ptrs, add find_next,
+ get_subset, get_iterator, for_each, ncompare; add ability to have nested
+ containers; more utility routines; convenience marcros; start adding comments
+
+2002-07-16 09:29 rstory
+
+ * include/net-snmp/library/factory.h:
+
+ declarations for a generic factory
+
+2002-07-16 08:48 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory_dynix.c, memory_hpux.c
+, vmstat_dynix.c, vmstat_hpux.c:
+
+ Apply patch from bug report 581618 (also applicable to dynix)
+ Provided by Nicholas L. Nigay
+
+2002-07-16 06:54 hardaker
+
+ * perl/: ASN/ASN.pm, OID/OID.pm, agent/agent.pm,
+ agent/default_store/default_store.pm,
+ default_store/default_store.pm:
+
+ remove "our" problem and use older "use vars" instead for older perl.
+ (this should make it work with perl 5.005. Could some one test this
+ for me?)
+
+2002-07-15 06:45 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - names of netsnmp_subtree elements changed
+
+2002-07-15 06:42 jbpn
+
+ * agent/mibgroup/ucd-snmp/extensible.c:
+
+ - struct subtree renamed to netsnmp_subtree
+
+2002-07-15 05:25 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ Some really nasty hacks to get colorized tables to work.
+
+2002-07-14 20:51 hardaker
+
+ * perl/SNMP/t/: bulkwalk.t, mib.t:
+
+ comment out broken tests for now (XXX marked)
+
+2002-07-14 20:50 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ fix getbulk.
+
+2002-07-14 20:20 hardaker
+
+ * agent/agent_handler.c,
+ include/net-snmp/agent/agent_handler.h:
+
+ A new function to call a sub-handler but passing it only one request to handle.
+
+2002-07-10 21:21 rstory
+
+ * win32/: config.h, net-snmp/net-snmp-config.h:
+
+ define LOG_DAEMON, since windows doesn't have it
+
+2002-07-10 21:07 rstory
+
+ * win32/: config.h, net-snmp/net-snmp-config.h:
+
+ remove define of in_addr_t, which can be found in net-snmp/types.h
+
+2002-07-10 02:36 jbpn
+
+ * agent/agent_handler.c:
+
+ - struct subtree renamed to netsnmp_subtree
+
+2002-07-10 02:35 jbpn
+
+ * agent/agent_index.c:
+
+ - don't use 0 in %p format specifiers
+
+2002-07-10 02:34 jbpn
+
+ * agent/snmp_agent.c:
+
+ - struct subtree renamed to netsnmp_subtree
+ - fix some horrible indent broken formatting
+
+2002-07-10 02:33 jbpn
+
+ * agent/snmp_vars.c:
+
+ - struct subtree renamed to netsnmp_subtree
+ - remove some obsolete variables
+
+2002-07-10 02:33 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - reflect changed function names from agent_registry
+
+2002-07-10 02:32 jbpn
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ - changes due to renaming of struct subtree to netsnmp_subtree
+ - NOTE MEMORY LEAK (which I can't see how to fix -- new agent API
+ experts please examine)
+
+2002-07-10 02:29 jbpn
+
+ * agent/agent_registry.c:
+
+ - struct subtree renamed to netsnmp_subtree
+ - name, start, end members are now dynamically allocated to reduce
+ wasted memory (by a factor of 5 or so)
+ - functions are renamed consistently
+
+2002-07-10 02:20 jbpn
+
+ * include/net-snmp/agent/: agent_registry.h,
+ net-snmp-agent-includes.h, snmp_agent.h, snmp_vars.h
+, var_struct.h:
+
+ - struct subtree renamed to netsnmp_subtree
+
+2002-07-09 06:02 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - free cache_id storage when closing session
+
+2002-07-09 05:56 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - just call netsnmp_ds_shutdown() once in snmp_shutdown()
+
+2002-07-09 04:15 jbpn
+
+ * snmplib/mib.c:
+
+ - fix memory leak in netsnmp_fixup_mib_directory()
+
+2002-07-09 03:14 jbpn
+
+ * agent/snmpd.c:
+
+ - add a cast to quell compiler warning
+
+2002-07-08 22:09 rstory
+
+ * agent/mibgroup/util_funcs.h:
+
+ extern C for C++ compiles
+
+2002-07-08 07:21 jbpn
+
+ * include/net-snmp/agent/snmp_vars.h:
+
+ - remove obsolete function prototypes
+
+2002-07-07 19:45 rstory
+
+ * local/mib2c.array-user.conf:
+
+ update to use containers
+
+2002-07-07 19:38 rstory
+
+ * include/net-snmp/library/oid_array.h:
+
+ fix typo
+
+2002-07-07 19:37 rstory
+
+ * agent/mibgroup/ucd-snmp/: disk.c, proc.c:
+
+ fix compiler warning
+
+2002-07-07 19:33 rstory
+
+ * agent/mibgroup/: agent/nsModuleTable.c,
+ agent/nsTransactionTable.c, host/hr_swinst.c:
+
+ fix compiler warning
+
+2002-07-07 19:03 rstory
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ remove unused vars
+
+2002-07-07 19:00 rstory
+
+ * snmplib/oid_stash.c:
+
+ fix compiler warnings
+
+2002-07-07 18:53 rstory
+
+ * snmplib/asn1.c:
+
+ fix compiler warnings
+
+2002-07-07 18:50 rstory
+
+ * include/net-snmp/library/snmp_api.h, snmplib/snmp_api.c
+:
+
+ make param const; fix compile const warning
+
+2002-07-07 18:27 rstory
+
+ * snmplib/mib.c:
+
+ fix compiler warning; fix memory leak; prep a few comments for indent
+
+2002-07-06 14:11 hardaker
+
+ * README, sedscript.in, snmplib/snmp_version.c,
+ FAQ, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.2.pre1 )
+
+2002-07-06 14:10 hardaker
+
+ * doxygen.conf:
+
+ change project version to 5.0.2
+
+2002-07-06 14:09 hardaker
+
+ * perl/SNMP/Makefile.PL:
+
+ snmptrapd is actually built in the apps directory, not the agent directory.
+
+2002-07-05 11:55 rstory
+
+ * local/mib2c:
+
+ clarify directions for obtaining perl/SNMP module.
+
+2002-07-05 05:18 jbpn
+
+ * agent/mibgroup/agentx/client.c:
+
+ - I must not check in code without compiling it
+ - I must not check in code without compiling it
+ - I must not check in code without compiling it
+ - I must not check in code without compiling it
+ - ...
+
+2002-07-05 03:23 jbpn
+
+ * agent/mibgroup/: agentx/client.c, mibII/system_mib.c:
+
+ - sysObjectID was being returned minus its last sub-identifier because
+ the length variable had not been updated to reflect the fact that it
+ is now longer. Code changed to use sizeof() instead, so this won't
+ happen again. Reported by Stian Soiland (bug #577439).
+
+2002-07-04 10:13 rstory
+
+ * snmplib/read_config.c:
+
+ ucd-snmp -> net-snmp
+
+2002-07-04 07:06 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - modified handling of opaque pointer for stream-based transports to
+ avoid both multiple free() problem and unnecessary copying.
+
+2002-07-04 06:00 dts12
+
+ * man/snmpd.conf.5.def, agent/mibgroup/host/hr_storage.c
+ (V4-2-patches.[5,9]), man/snmpd.conf.5.def,
+ agent/mibgroup/host/hr_storage.c:
+
+ Apply Johannes Schmidt-Fischer's NetworkDisk patch #554554
+
+2002-07-04 05:56 dts12
+
+ * agent/mibgroup/host/: hr_filesys.c, hr_filesys.h
+ (V4-2-patches.[5,1]), hr_filesys.c, hr_filesys.h:
+
+ Apply Johannes Schmidt-Fischer's NFS filesystem patch #554553
+ (simplified to avoid the re-indentation - which makes it easier to see
+ what's changed. The whole HostRes group needs cleaning up anyway!)
+
+2002-07-04 05:52 dts12
+
+ * snmplib/snmp_api.c:
+
+ Ensure transport opaque data isn't multiply assigned
+ (and hence multiply freed) for stream-based transports.
+ Datagram-based transports don't suffer from this problem.
+ Based on Patch 573771
+
+2002-07-03 16:28 rstory
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ be precise about what file needs to be configured for access control
+
+2002-07-03 14:13 rstory
+
+ * local/mib2c.conf:
+
+ fix minor grammar errors; add descr for mib2c.array-user; add section header
+ for generating header definition files
+
+2002-07-03 13:11 rstory
+
+ * include/net-snmp/: types.h, library/system.h:
+
+ move include for in_addr_t to net-snmp/types.h, where in_addr_t is defined
+ for systems w/out netinet/in.h
+
+2002-07-03 12:51 rstory
+
+ * local/mib2c.scalar.conf:
+
+ more tweaks noticed on the mailing list
+
+2002-07-03 08:23 hardaker
+
+ * perl/agent/test.pl:
+
+ make test cleanups test.pl
+
+2002-07-03 03:42 dts12
+
+ * agent/mibgroup/: util_funcs.c (V4-2-patches.1), util_funcs.c
+:
+
+ Shut the agent down cleanly before restarting.
+ This closes any SNMP/AgentX ports as well.
+
+2002-07-03 03:26 dts12
+
+ * agent/mibgroup/util_funcs.c:
+
+ OID sub-identifiers are unsigned, so treating them as signed can
+ give the wrong results with large values.
+
+2002-07-03 03:20 dts12
+
+ * snmplib/system.h (V4-2-patches.5),
+ include/net-snmp/library/system.h:
+
+ Ensure in_addr_t is defined.
+
+2002-07-03 02:34 dts12
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Testing for <sys/disklabel.h> requires <machine/types.h> on NetBSD 1.5.
+ Reported by Felicia Neff.
+ (Apparently from the NetBSD bug database - why they didn't tell us about
+ it is a mystery to me....)
+
+2002-07-03 02:19 dts12
+
+ * configure.in:
+
+ Fix the default value for sysObjectID as reported in the configure --help output.
+ (The actual value used is correct - it's just the help output that's wrong).
+ Spotted by Sandhya Satyanarayan.
+
+2002-07-02 23:15 hardaker
+
+ * local/mib2c.conf:
+
+ update text for various .conf files
+
+2002-07-02 13:46 rstory
+
+ * local/mib2c.scalar.conf:
+
+ fixes noted on the mailing list by Patrice Kadionik <kadionik@enseirb.fr>
+
+2002-07-02 02:39 dts12
+
+ * perl/SNMP/Makefile.PL:
+
+ Add the 'snmpd' and 'snmptrapd' binary names to the appropriate paths
+ when setting up the testing framework.
+
+2002-07-01 07:53 dts12
+
+ * snmplib/: asn1.c (V4-2-patches.8), asn1.c:
+
+ Encode/Decode OIDs of the form 2.X (X > 40) correctly.
+
+2002-07-01 02:40 jbpn
+
+ * configure, configure.in:
+
+ - fix horrible formatting in help for transports
+
+2002-07-01 02:23 dts12
+
+ * sedscript.in:
+
+ Pick up the changed definition for the root of the UCD extensible agent tables
+ (so that the EXAMPLE.conf file gets set up with the correct numeric OIDs)
+
+2002-06-28 06:46 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - remove transport specifier and port number from strings returned
+ from snmp_tcp_fmtaddr() which break tcp_wrappers (and perhaps
+ other things).
+
+2002-06-28 04:41 dts12
+
+ * perl/agent/test.pl:
+
+ Update default store retrieval functions to use the correct name.
+
+ Note that this test script appears to include two infinite loops.
+ I'm not clear how this is expected to run successfully ?
+
+2002-06-28 04:39 dts12
+
+ * perl/agent/agent.xs:
+
+ Remove reference to non-existent degugging function.
+
+2002-06-28 04:37 dts12
+
+ * perl/manager/: Makefile.PL, displaytable.pm,
+ getValues.pm, manager.pm, snmptosql:
+
+ Bring perl 'manager' module under the NetSNMP banner
+ (both in terms of module group name, and references to 'ucd-snmp').
+ Remove some UCD-specific settings.
+
+ Note that snmptosql still refers explicitly to Wes' UCD email address,
+ and manager.pm to Wes' UCD filestore path. The relevant lines have
+ been highlighted, to encourage anyone wishing to use this to change them.
+
+2002-06-28 04:12 dts12
+
+ * perl/: AnyData_SNMP/Makefile.PL, OID/Makefile.PL,
+ SNMP/Makefile.PL, agent/Makefile.PL,
+ manager/Makefile.PL:
+
+ Remove checking for "internal" prerequisites, so that "perl Makefile.PL"
+ at the top level will work - even on a pristine system.
+
+ Qn:
+ Is it necessary/desirable to separate the NetSNMP modules to this extent?
+ Would it not be simpler to have all of the main .pm/.xs files in a single
+ NetSNMP directory, and compile/install them all from there?
+
+2002-06-28 01:45 dts12
+
+ * configure, configure.in:
+
+ Check for --with-enterprise (et al) being invoked without a value, and bomb out.
+
+2002-06-27 21:43 rstory
+
+ * README.solaris:
+
+ new README detainling the use of SFIO to circumvent the 255 fd limit on
+ solaris.
+
+2002-06-27 11:09 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h:
+
+ remove changing array; add netsnmp_table_array_remove_row()
+
+2002-06-27 04:15 dts12
+
+ * Makefile.rules:
+
+ Some versions of 'makedepend' (e.g. RedHat 7.1), can't handle "-osuffix"
+ as a single option. All versions seem happy with "-o suffix" so use that.
+
+2002-06-27 03:31 dts12
+
+ * snmplib/mib.c:
+
+ Use ENV_SEPARATOR_CHAR rather than hardwiring ':' in netsnmp_set_mib_directory
+ (as suggested by Robert)
+
+2002-06-27 03:22 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ - remove transport specifier and port number from strings returned
+ from snmp_udp_fmtaddr() which break tcp_wrappers (and perhaps
+ other things).
+
+2002-06-27 03:09 dts12
+
+ * agent/mibgroup/mibII/: snmp_mib.c (V4-2-patches.2), snmp_mib.c
+:
+
+ Validate new snmpEnableAuthenTraps value before trying to use it.
+ Spotted & fixed by Shantha Kumara
+
+2002-06-25 14:09 rstory
+
+ * apps/snmpset.c:
+
+ add APPTOPS (-Cq) for suppressing output of set results on success
+
+2002-06-25 09:28 dts12
+
+ * agent/mibgroup/ucd-snmp/proc.c:
+
+ Apply patch #559848 to use the /proc pseudo-filesystem under Linux
+ (rather than parsing the output of ps)
+
+2002-06-25 08:59 dts12
+
+ * snmplib/snmp-tc.c:
+
+ Check for 'aix4' (which is the token defined in the system header file)
+ rather than 'aix'. See bug #565769
+
+2002-06-25 08:31 dts12
+
+ * agent/mibgroup/util_funcs.c:
+
+ Treat '0' as an invalid index for a "simple table".
+
+2002-06-25 07:36 hardaker
+
+ * local/snmpconf.dir/snmpd-data/system:
+
+ document read-only nature of sysContact.0 and sysLocation.0
+ configuration tokens.
+
+2002-06-25 06:40 jbpn
+
+ * man/: Makefile.in, default_store.3.bot,
+ default_store.3.top:
+
+ - add netsnmp_ prefix to default_store functions
+
+ - clean up manpage a bit
+
+ - fix breakage in generation of default_store.3.h due to auto-indentation
+ of default_store.h
+
+2002-06-25 02:55 jbpn
+
+ * EXAMPLE.conf.def (V4-2-patches.3), EXAMPLE.conf.def:
+
+ - mention that setting sysLocation et al. in snmpd.conf makes them
+ read-only
+
+ - also change syntax of all example command line tools to use newer
+ -c COMMUNITY syntax not positional parameter
+
+2002-06-24 08:03 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ make buffer size increase note a debug statement rather than a generic
+ log statement.
+
+2002-06-23 18:40 driehuis
+
+ * perl/SNMP/SNMP.xs:
+
+ Handle COUNTER64 in __translate_asn_type.
+
+2002-06-23 16:03 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ documentation for the script and the language it houses.
+ (man page auto-generated from the contained pod documentation)
+
+2002-06-23 15:03 hardaker
+
+ * perl/SNMP/README:
+
+ update to reference top level Makefile.PL
+
+2002-06-23 14:51 hardaker
+
+ * perl/SNMP/: SNMP.xs (V4-2-patches.1), SNMP.xs:
+
+ fix reported by Willem Dekker for Windows. Bug #543194 fixed.
+
+2002-06-22 08:37 hardaker
+
+ * README.snmpv3:
+
+ update for recent methodologies
+
+2002-06-21 16:07 rstory
+
+ * snmplib/mib.c:
+
+ final (hopefully!) fix for parsing ip addresses from
+ "Fco. Javier Ridruejo" <acbripef@si.ehu.es>
+
+2002-06-19 14:38 hardaker
+
+ * man/: netsnmp_agent.3, netsnmp_bulk_to_next.3,
+ netsnmp_debug.3, netsnmp_handler.3, netsnmp_instance.3
+, netsnmp_multiplexer.3, netsnmp_old_api.3,
+ netsnmp_read_only.3, netsnmp_serialize.3,
+ netsnmp_table.3, netsnmp_table_array.3,
+ netsnmp_table_data.3, netsnmp_table_dataset.3,
+ netsnmp_table_iterator.3, netsnmp_todo.3:
+
+ update from doxygen
+
+2002-06-19 11:50 hardaker
+
+ * local/: mib2c.int_watch.conf, mib2c.scalar.conf:
+
+ scalar mib2c configuration files for generating scalar code.
+
+2002-06-19 11:43 hardaker
+
+ * agent/mibgroup/examples/scalar_int.c:
+
+ clean up multi-line commend which was messed up by indent.
+
+2002-06-19 11:42 hardaker
+
+ * perl/AnyData_SNMP/netsh:
+
+ - add support for prompting of unknown parameters to aliases.
+ - misc other improvements (like "rehash")
+
+2002-06-19 11:38 hardaker
+
+ * net-snmp-config.in:
+
+ fix for new default store API
+
+2002-06-19 11:29 hardaker
+
+ * perl/: Makefile.PL, Makefile.makefiles,
+ Makefile.subs.pl, make-perl-makefiles, ASN/Makefile.PL
+, OID/Makefile.PL, SNMP/Makefile.PL,
+ agent/Makefile.PL, agent/default_store/Makefile.PL,
+ default_store/Makefile.PL:
+
+ ARGGGGGG
+ I love perl.
+ I hate perl's make system.
+ I hate the fact that perl segfaults if GetOptions() is called more
+ than once.
+ sigh.
+ This hopefully will fix the perl module build routines so it at least
+ works (but it's still ugly and could use more cleaning).
+
+2002-06-19 07:45 rstory
+
+ * agent/snmp_agent.c:
+
+ fix infinte loop and add debug in remove_delegated
+
+2002-06-18 07:37 hardaker
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ NULL the priv pointer on session duplication. thanks to rezitoz
+
+2002-06-17 06:23 hardaker
+
+ * README:
+
+ Changed Katsuhisa's email address, on request
+
+2002-06-14 07:44 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Patch #569021: from Lauri Myllari
+ - fix memory leak in the table iterator support.
+
+2002-06-14 07:02 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Applied patch #569020 from rezitoz on IRC to fix non-initialized variable
+
+2002-06-14 03:57 dts12
+
+ * agent/mibgroup/Rmon/alarm.c:
+
+ Add (null) context, to bring into line with the v5 registry APIs.
+ Fixes bug 568580.
+
+2002-06-14 02:27 dts12
+
+ * aclocal.m4, configure:
+
+ Use matching ' and " quotes for AIX configure test.
+ Mentioned in passing in bug 565769.
+
+2002-06-13 14:32 hardaker
+
+ * perl/SNMP/t/conf.t:
+
+ fix default_store routines
+
+2002-06-12 06:43 dts12
+
+ * win32/net-snmp/net-snmp-config.h:
+
+ Bring Windows OID usage into line with the main config file settings.
+
+2002-06-12 06:37 dts12
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ Correct the default Enterprise OID used in traps, to avoid a repeated 0
+ subidentifier. (Fixes bug #566917)
+
+2002-06-12 05:14 dts12
+
+ * snmplib/snmp_api.c:
+
+ Define 'length' as a signed variable, so it can handle an error value of -1.
+ Reported by Joakim Althini.
+
+2002-06-12 03:11 dts12
+
+ * snmplib/read_config.c:
+
+ Make sure the address of the next link is properly saved, before freeing memory.
+ Problem discovered by Hugo Cacote.
+
+2002-06-12 02:15 dts12
+
+ * include/net-snmp/: agent/agent_index.h, agent/agent_trap.h
+, agent/all_helpers.h, agent/auto_nlist.h,
+ agent/bulk_to_next.h, agent/debug_handler.h,
+ agent/mib_modules.h, agent/multiplexer.h, agent/null.h
+, agent/old_api.h, agent/read_only.h,
+ agent/serialize.h, agent/set_helper.h,
+ library/cmu_compat.h, library/snmpAAL5PVCDomain.h,
+ library/snmpCallbackDomain.h, library/snmpIPXDomain.h,
+ library/snmpTCPDomain.h, library/snmpTCPIPv6Domain.h,
+ library/snmpUDPDomain.h, library/snmpUDPIPv6Domain.h,
+ library/snmpUnixDomain.h, library/snmp_parse_args.h,
+ library/snmp_secmod.h, library/transform_oids.h,
+ library/ucd_compat.h:
+
+ Supply missing #ifndef/#define/#endif and extern "C" {} wrappers
+
+2002-06-11 17:56 rstory
+
+ * snmplib/mib.c:
+
+ remove spurious printf to stderr
+
+2002-06-11 14:21 rstory
+
+ * include/net-snmp/types.h:
+
+ add extern "C"; add void_array struct
+
+2002-06-11 14:20 rstory
+
+ * agent/helpers/table_array.c:
+
+ remove tsearch; use new container instead
+
+2002-06-11 14:19 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ use container for secondary index
+
+2002-06-11 14:17 rstory
+
+ * snmplib/Makefile.in:
+
+ add container to headers; add container.c
+
+2002-06-11 14:17 rstory
+
+ * snmplib/container.c:
+
+ init functions for basic/sorted container
+
+2002-06-11 14:15 rstory
+
+ * include/net-snmp/library/container.h:
+
+ more methods for basic container; add sorted (will probably rename) conatiner
+
+2002-06-11 12:22 rstory
+
+ * include/net-snmp/agent/instance.h:
+
+ protect against multiple includes; add extern "C" for __cplusplus
+
+2002-06-11 11:11 hardaker
+
+ * perl/AnyData_SNMP/: INSTALL, Makefile.PL, README
+, netsh, snmpsh:
+
+ renamed snmpsh to netsh, as I like the name better and it appeals to a
+ wider number of people.
+
+2002-06-10 09:53 rstory
+
+ * agent/snmp_agent.c:
+
+ when deleting an asp pointer, make sure it isn't in the delegated list
+
+2002-06-10 08:46 rstory
+
+ * snmplib/mib.c:
+
+ fix parse_one_oid_index to allow too short IP address when complete is
+ specified; add netsnmp_oid2chars & netsnmp_oid2str
+
+2002-06-10 07:42 hardaker
+
+ * perl/default_store/: default_store.pm, default_store.xs
+, test.pl:
+
+ update to latest default_store defines
+
+2002-06-10 07:39 hardaker
+
+ * Makefile.in, perl/.cvsignore, perl/Makefile.PL:
+
+ Top level perl Makefile.PL to install the whole bunch underneath.
+ This should now be used instead of the lower level makefiles for
+ simplicity.
+
+2002-06-10 07:27 dts12
+
+ * perl/SNMP/t/mib.t:
+
+ Acknowledge known failing tests.
+ This message can be removed once the problem has been isolated and fixed.
+
+2002-06-10 07:17 hardaker
+
+ * snmplib/mib.c:
+
+ support for ipaddress building/parsing of OID indexes.
+
+2002-06-10 02:07 dts12
+
+ * FAQ (V4-2-patches.8), FAQ:
+
+ Mention the other perl modules, introduced with v5 (particularly 'default_store')
+
+2002-06-10 01:28 dts12
+
+ * FAQ (V4-2-patches.7), FAQ:
+
+ New entry describing possible problems with trap handlers.
+
+2002-06-08 21:39 hardaker
+
+ * perl/agent/agent.pm:
+
+ default_store fixes
+
+2002-06-08 20:54 rstory
+
+ * Makefile.in:
+
+ break perl makefile creation into seperate step; only clean perl directory
+ if there is a makefile
+
+2002-06-08 20:15 rstory
+
+ * Makefile.in:
+
+ add perltest target to make test in all perl directories
+
+2002-06-08 09:47 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ fix to deal with updated SQL::Statement module.
+
+2002-06-08 07:08 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ update to SQL-Statement requirement of 1.004
+
+2002-06-08 06:45 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ remove mib init code from C snmp_translate_obj call
+
+2002-06-08 06:44 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ init_snmp inside translateObj
+
+2002-06-08 06:44 hardaker
+
+ * perl/OID/OID.pm:
+
+ change version to 0.1
+
+2002-06-08 06:43 hardaker
+
+ * perl/AnyData_SNMP/configs/unix:
+
+ A few cleanups to ifconfig and netstat commands
+
+2002-06-08 06:35 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ - beginning support for import/export of data (currently to/from CSV).
+ - support for "diff" which compares old (possibly imported data) to current.
+
+2002-06-08 06:34 hardaker
+
+ * perl/AnyData_SNMP/Makefile.PL:
+
+ change required SNMP module version from 4 to 5
+
+2002-06-08 06:34 hardaker
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ Add a tutorial place holder comment OID.
+
+2002-06-08 06:33 hardaker
+
+ * local/tkmib:
+
+ fix tkmib for newer perl modules.
+
+2002-06-08 06:33 hardaker
+
+ * local/snmpconf:
+
+ turn off extra bold/underline formatting by default.
+
+2002-06-07 15:04 rstory
+
+ * include/net-snmp/library/container.h:
+
+ generic container structure for storing data
+
+2002-06-07 13:01 rstory
+
+ * perl/ASN/ASN.xs:
+
+ include net-snmp-config.h
+
+2002-06-07 10:37 rstory
+
+ * configure:
+
+ update configure to keep in line with configure.in (why? shouldn't
+ configure not be in CVS and be autogenerated? One of these days I'm going
+ to have to learn autoconf....)
+
+2002-06-07 10:35 rstory
+
+ * Makefile.in, Makefile.rules:
+
+ always check return status of make when inside a loop, and exit on errors
+
+2002-06-07 08:17 dts12
+
+ * agent/mibgroup/mibII/: interfaces.c (V4-2-patches.3),
+ interfaces.c:
+
+ Only null-terminate the interface name while it's actually being copied.
+ Restore the data line afterwards, so the debugging output is meaningful.
+
+2002-06-07 01:16 dts12
+
+ * agent/snmp_agent.c:
+
+ Fix for indexing error, that causes a crash if more than 16 varbinds
+ are added to the cache in one go. Spotted by Shanth Kumara
+
+2002-06-06 01:12 dts12
+
+ * aclocal.m4, configure (V4-2-patches.[7,5]), aclocal.m4,
+ configure:
+
+ Don't differenciate between elf- and a.out-based NetBSD systems.
+ (Problem highlighted by Felicia Neff)
+
+2002-06-05 18:50 rstory
+
+ * acconfig.h, configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ include/net-snmp/types.h:
+
+ put defines for socklen_t and in_addr_t in net-snmp/types.h instead of having
+ configure generate them; configure instead generates HAVE_SOCKLEN_T and
+ HAVE_IN_ADDR_T for systems which don't need the defines; this is primarily
+ for the benefit of the Win32 platform, which doesn't have configure.
+
+2002-06-05 09:20 rstory
+
+ * local/mib2c.iterate.conf:
+
+ don't advance request pointer inside for loop, since for loop does it for
+ us; otherwise for loop may end up dereferencing NULL pointer.
+
+2002-06-05 06:41 hardaker
+
+ * perl/AnyData_SNMP/configs/unix:
+
+ example configuration file to duplicate various unix utilities:
+ - currently: netstat, ps, df, ifconfig
+
+2002-06-05 06:40 hardaker
+
+ * perl/AnyData_SNMP/configs/scli:
+
+ example configuration file to duplicate functionality in Juergen's
+ scli command.
+
+2002-06-05 06:39 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ new commands:
+ source file -- sources an rc file
+ watch expression -- repeatedly runs a command and colorizes
+ differences in data
+ eval expression -- evaluates an expression directly in perl
+ - beginnings of overloads in perl so that calling sysContact()
+ will return the sysContact value. tables not returned yet.
+ fixes:
+ turns of ornamental prompt support (ick) by default
+
+2002-06-05 04:43 dts12
+
+ * man/: snmpcmd.1 (V4-2-patches.8), snmpcmd.1.def:
+
+ Brief mention of the need to quote OIDs containing string indexes,
+ to protect the double quotes from the shell.
+
+2002-06-04 10:38 rstory
+
+ * agent/snmp_agent.c:
+
+ test for a null treecache before dereferencing it; noted on the coders
+ list by joakim.althini@reddo.net
+
+2002-06-04 10:33 rstory
+
+ * agent/snmp_agent.c:
+
+ test for asp->pdu == NULL before dereferencing it; noted on the coders
+ list by joakim.althini@reddo.net.
+
+2002-06-04 05:54 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ support for printf, single query/sets of scalars, multi-line aliases.
+
+2002-05-30 15:23 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ default_store fixes
+
+2002-05-30 15:23 hardaker
+
+ * perl/OID/OID.pm:
+
+ make new() operator a bit smarter
+
+2002-05-29 19:57 hardaker
+
+ * snmplib/: snmp_alarm.c (V4-2-patches.2), snmp_alarm.c:
+
+ set the storage pointer to NULL, as pointed out by Mark Hoy.
+
+2002-05-29 09:22 hardaker
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/mib.h, snmplib/mib.c,
+ snmplib/snmp_parse_args.c:
+
+ Patch from Harrie Hazewinkel to APIify MIBDIRS support
+
+2002-05-29 07:43 dts12
+
+ * FAQ (V4-2-patches.6), FAQ:
+
+ Expand on when OpenSSL is necessary, and how to compile using it.
+
+2002-05-29 06:52 dts12
+
+ * snmplib/snmpUDPDomain.c:
+
+ Set REUSEADDR so that specifying the same port twice doesn't kill the agent.
+ (Suggested by Robert Hastings)
+
+2002-05-29 02:41 dts12
+
+ * FAQ (V4-2-patches.5), FAQ:
+
+ Reference both versions of the tutorial (since this document is used
+ for building the on-line version of the FAQ)
+
+2002-05-29 02:16 dts12
+
+ * FAQ (V4-2-patches.4), FAQ:
+
+ Clarify that trap filtering is not yet operational.
+
+2002-05-28 14:53 rstory
+
+ * snmplib/oid_array.c:
+
+ remove ^M chars
+
+2002-05-28 14:52 rstory
+
+ * local/mib2c.array-user.conf:
+
+ fix logic in can_delete; consolidate use of netsnmp_set_mode_request by setting
+ rc for use at end of loop; don't use removed macros for rowstatus/storagetype,
+ using new netsnmp_check_vb* routines instead; add asserts for error cases that
+ should be caught by earlier routines
+
+2002-05-28 14:47 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ add callbacks for row (de)activation
+
+2002-05-28 06:23 dts12
+
+ * agent/helpers/table_array.c:
+
+ Protect "#include <search.h>" with the HAVE_SEARCH_H token. (Suggested by Harrie)
+
+2002-05-28 06:20 dts12
+
+ * include/net-snmp/library/snmp_logging.h:
+
+ Fix the declaration of snmp_enable_syslog_ident. (Spotted by Harrie)
+
+2002-05-27 01:53 dts12
+
+ * apps/snmptrapd.c, include/net-snmp/library/snmp_logging.h
+, snmplib/snmp_logging.c:
+
+ Don't hardwire syslog facility to LOG_DAEMON.
+ Fix provided by Joakim Fallsjo.
+
+2002-05-27 01:32 dts12
+
+ * agent/mibgroup/snmpv3/usmUser.c, apps/snmptrapd.c
+ (V4-2-patches.[2,8]), agent/mibgroup/snmpv3/usmUser.c,
+ apps/snmptrapd.c:
+
+ Tweak 'usmUser' help string to accurately reflect which bits are optional.
+ Reported by Ali Chanaui.
+
+2002-05-27 01:22 dts12
+
+ * man/: snmpd.conf.5.def (V4-2-patches.4), snmpd.conf.5.def:
+
+ Document the limit on the number of "file" directives.
+
+2002-05-27 01:17 dts12
+
+ * local/Makefile.in:
+
+ Remove an extraneous trailing backslash, that confuses some 'make's
+
+2002-05-24 09:54 hardaker
+
+ * perl/agent/netsnmp_request_info.pm:
+
+ Proper creation of returned NetSNMP::OID object.
+
+2002-05-24 09:54 hardaker
+
+ * perl/agent/agent.xs:
+
+ increase reference counts on returned mib registration objects so
+ they're not auto-cleaned by perl (the agent now has a copy of the pointer)
+
+2002-05-24 09:53 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ new default_store netsnmp_ prefixes.
+
+2002-05-24 09:53 hardaker
+
+ * local/mib2c:
+
+ support for scalars (mib2c.scalar.conf file coming shortly)
+
+2002-05-24 09:52 hardaker
+
+ * Makefile.in:
+
+ A new rule called "commentcheck" to grep all sources for // comments.
+
+2002-05-24 08:09 dts12
+
+ * agent/agent_registry.c:
+
+ Declare 'register_mib_detach_node' before it's used for the first time.
+ (Spotted by Xiang Zhang)
+
+2002-05-24 07:44 dts12
+
+ * apps/Makefile.in:
+
+ Remove extraneous trailing backslash.
+ (That *might* be confusing Sun's make, but is wrong anyway)
+
+2002-05-23 01:39 dts12
+
+ * agent/mibgroup/ucd-snmp/: vmstat.c, vmstat_bsdi4.c,
+ vmstat_dynix.c, vmstat_freebsd2.c, vmstat_hpux.c,
+ vmstat_netbsd1.c, vmstat_solaris2.c:
+
+ Bring the various 'var_extensible_vmstat' definitions into line
+ with the declaration in the header file - i.e. non-static.
+
+2002-05-21 15:25 rstory
+
+ * Makefile.in:
+
+ add -I$(srcdir)/include to CPP path for people building outside of src tree
+
+2002-05-21 08:14 rstory
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ apply patch [ 558129 ] Make the tunnel mib compile in 5.0.1, submitted
+ by Lorenzo Colitti (lcolitti), which adds missing net-snmp-config.h
+
+2002-05-21 05:32 jbpn
+
+ * agent/snmpd.c:
+
+ - fix core dump in -u option processing, noted by Andreas Maus
+
+2002-05-21 05:20 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory.c (V4-2-patches.9), memory.c
+:
+
+ Latch memory reporting at 2^31-1, rather than 2^32-1 since these
+ objects are defined as (signed) Integer32.
+ Only latch if the value is *greater* than this threshold, not less!
+
+2002-05-21 01:20 jbpn
+
+ * include/ucd-snmp/default_store.h, snmplib/ucd_compat.c
+:
+
+ - add compatibility definitions and functions for newly-renamed
+ default store manipulation functions and constants (defined iff
+ --enable-ucd-compatibility is given to at configuration time)
+
+2002-05-21 00:51 jbpn
+
+ * include/net-snmp/library/default_store.h,
+ snmplib/default_store.c:
+
+ - move definition of netsnmp_ds_read_config type from default_store.h
+ into default_store.c (since it is not, and should not, be used
+ elsewhere).
+
+2002-05-20 03:42 rstory
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ registers tokens for ipv6 ro/rw community, and make sure to parse them
+ as ipv6, not v4.
+
+2002-05-19 11:38 driehuis
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ Bugfix for FreeBSD support of the diskIO mib. The original code neglected
+ the device number, which made distinguishing between, say, ad0 and ad1
+ impossible.
+
+2002-05-17 09:05 hardaker
+
+ * agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/icmp.c
+, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/ip.c, agent/mibgroup/mibII/ipv6.c,
+ agent/mibgroup/mibII/mta_sendmail.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/mibII/tcp.c
+, agent/mibgroup/mibII/udp.c,
+ agent/mibgroup/mibII/vacm_vars.c,
+ include/net-snmp/agent/var_struct.h:
+
+ Patch from Harrie Hazewinkel to slightly reduce memory costs of registartions
+
+2002-05-16 17:06 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ fix default store tag names.
+ fix init_snmp() definition to match normal perl non-ansi mode.
+
+2002-05-16 16:39 driehuis
+
+ * net-snmp-config.in:
+
+ Make sure --cflags spits out the required include path when installing
+ in a non-default location, as documented in the usage info in the script.
+
+2002-05-16 15:36 hardaker
+
+ * local/snmpconf.dir/snmpd-data/system:
+
+ add a line to the sysServices prompt saying if you don't know, say no.
+
+2002-05-16 12:55 hardaker
+
+ * perl/agent/default_store/: default_store.pm,
+ default_store.xs:
+
+ update to new define list
+
+2002-05-16 12:55 hardaker
+
+ * perl/agent/default_store/test.pl:
+
+ test script
+
+2002-05-16 12:49 hardaker
+
+ * perl/agent/default_store/gen:
+
+ autogeneration script
+
+2002-05-16 10:58 hardaker
+
+ * perl/default_store/: default_store.pm, default_store.xs
+, test.pl:
+
+ updates to new .h tokens
+
+2002-05-16 10:58 hardaker
+
+ * perl/default_store/gen:
+
+ .h -> perlmodule regeneration script
+
+2002-05-16 07:09 dts12
+
+ * include/net-snmp/library/default_store.h,
+ include/net-snmp/library/mib.h, snmplib/mib.c,
+ snmplib/snmp_api.c, snmplib/ucd_compat.c:
+
+ Consolidate the various OID output configuration mechanisms into one.
+ This does not affect the command-line options (yet!) - just the internals.
+
+2002-05-15 17:44 hardaker
+
+ * snmplib/default_store.c,
+ include/net-snmp/library/default_store.h,
+ include/net-snmp/agent/ds_agent.h:
+
+ fix default_store
+
+2002-05-15 17:20 hardaker
+
+ * configure:
+
+ run autoconf
+
+2002-05-15 17:20 hardaker
+
+ * acconfig.h, include/net-snmp/net-snmp-config.h.in:
+
+ create a define location for HAVE_GETDEVS
+
+2002-05-15 17:16 hardaker
+
+ * agent/Makefile.depend, agent/helpers/Makefile.depend,
+ agent/mibgroup/Makefile.depend, apps/Makefile.depend,
+ apps/snmpnetstat/Makefile.depend, snmplib/Makefile.depend
+:
+
+ depend update, which I meant to check in before the 5.0.1 release
+
+2002-05-15 05:53 jbpn
+
+ * agent/: agent_index.c, agent_read_config.c,
+ agent_registry.c, auto_nlist.c, kernel.c,
+ snmp_agent.c, snmp_perl.c, snmp_vars.c, snmpd.c
+:
+
+ - use new netsnmp_ds_blah functions and constants
+
+2002-05-15 05:39 jbpn
+
+ * apps/notification_log.c, apps/notification_log.h,
+ apps/snmpbulkwalk.c, apps/snmpdelta.c, apps/snmpget.c
+, apps/snmpgetnext.c, apps/snmpstatus.c,
+ apps/snmptable.c, apps/snmptranslate.c, apps/snmptrap.c
+, apps/snmptrapd.c, apps/snmpusm.c,
+ apps/snmpwalk.c, apps/snmpnetstat/main.c,
+ agent/mibgroup/agentx/agentx_config.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/disman/mteTriggerTable.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c, agent/mibgroup/smux/smux.c
+, agent/mibgroup/tunnel/tunnel.c:
+
+ - use new netsnmp_ds_blah functions and constants
+
+2002-05-15 05:37 jbpn
+
+ * snmplib/: default_store.c, mib.c, parse.c,
+ read_config.c, snmpUDPDomain.c, snmpUDPIPv6Domain.c
+, snmp_alarm.c, snmp_api.c, snmp_logging.c,
+ snmp_parse_args.c, snmp_secmod.c, snmpusm.c,
+ snmpv3.c, ucd_compat.c, vacm.c:
+
+ - rename functions and constants from default_store from ds_blah
+ to netsnmp_ds_blah
+
+2002-05-15 02:02 jbpn
+
+ * agent/mibgroup/smux/: smux.c (V4-2-patches.0), smux.c:
+
+ - initialise smux_listen_sd to avoid problems noted in bug #545448
+ (a bit unreasonable in my view but it can't do any harm).
+
+2002-05-14 12:40 rstory
+
+ * agent/helpers/table_array.c:
+
+ precision extraction of tumor instead of amputation, or, ifdef search.h
+ functions that aren't essential to table_array operation and will probably
+ vanish in the near future anyway.
+
+2002-05-13 20:16 rstory
+
+ * agent/object_monitor.c:
+
+ fix type in sizeof
+
+2002-05-13 13:04 hardaker
+
+ * configure, configure.in, agent/helpers/table_array.c
+, include/net-snmp/net-snmp-config.h.in:
+
+ Check for search.h before compiling the table_array helper
+
+2002-05-13 08:00 hardaker
+
+ * agent/helpers/old_api.c:
+
+ remove C++ comments
+
+2002-05-13 00:39 driehuis
+
+ * ChangeLog:
+
+ Note changes to configure.in.
+
+2002-05-12 10:30 driehuis
+
+ * configure.in:
+
+ Make sure the checks for kvm related stuff happens when -lkvm is in scope.
+ Add detection of the -ldevstat requirement when building with ucd-snmp/diskio.
+
+
+
+-------------------------------------------------------------------------------
+
+Changes: V5.0 -> V5.0.1
+
+20020-05-12 17:30 driehuis
+
+ * configure.in:
+
+ detect -ldevstat when needed; fix -lkvm detection
+
+2002-05-10 17:09 hardaker
+
+ * FAQ, NEWS, README, README.agentx:
+
+ mention tutorial-5 instead of tutorial
+
+2002-05-10 17:04 hardaker
+
+ * perl/agent/: Makefile.PL, agent.pm,
+ netsnmp_request_info.pm:
+
+ request info perl code moved to separate file.
+
+2002-05-10 17:01 hardaker
+
+ * perl/OID/OID.pm:
+
+ documentation for the OID building overloads.
+
+2002-05-10 16:55 hardaker
+
+ * apps/snmpvacm.c:
+
+ Add proper length segment to the build view OID.
+
+2002-05-10 14:41 hardaker
+
+ * snmplib/mib.c:
+
+ new doc patch from Axel Kittenberg
+
+2002-05-10 14:04 hardaker
+
+ * agent/mibgroup/mibII/: vacm_vars.c (V4-2-patches.0), vacm_vars.c
+:
+
+ fix vacm problem on sets with OIDs containing large numbers as noted
+ by Vinay Gaonkar on the -coders mailing list.
+
+2002-05-10 13:46 hardaker
+
+ * local/mib2c:
+
+ fix calling on multiple tables
+
+2002-05-10 03:23 dts12
+
+ * snmplib/mib.c:
+
+ Merge "STRING: Hex:" type tokens into a single token "Hex-STRING:"
+
+2002-05-10 03:12 dts12
+
+ * agent/helpers/instance.c:
+
+ Report non-existent subinstances as 'noSuchInstance' rather than 'noSuchObject'.
+ "snmpget .... .1.3.6.1.6.3.12.1.5.0.99" now responds correctly.
+ (though "snmpget .... .1.3.6.1.6.3.12.1.5.1" still returns 'noSuchObject')
+
+ Also guess that failed SET requests are 'noCreation' errors (which is
+ probably the most likely option).
+
+2002-05-09 15:54 hardaker
+
+ * Makefile.rules:
+
+ exit properly when a subdir fails to make properly
+
+2002-05-09 15:30 hardaker
+
+ * snmplib/mib.c:
+
+ create a token for the -Ov equivelant
+
+2002-05-09 09:12 hardaker
+
+ * agent/mibgroup/ucd-snmp/: memory_solaris2.c (V4-2-patches.5),
+ memory_solaris2.c:
+
+ patch from Takumi Kadode to fix memory usage on solaris
+
+2002-05-09 08:54 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ updates from malloced vmstat fixes from patches branch
+
+2002-05-08 16:34 hardaker
+
+ * net-snmp-config.in:
+
+ new --compile-subagent features:
+ --cflags
+ --norm
+ --ldflags
+ includes header files
+ misc other bug fixes.
+
+2002-05-08 13:13 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ make the subagent properly call the reserve2 state again.
+
+2002-05-08 10:02 hardaker
+
+ * agent/mibgroup/examples/notification.c:
+
+ run indent
+
+2002-05-08 09:01 hardaker
+
+ * agent/mibgroup/examples/notification.c:
+
+ um, use 30 seconds like advertised.
+
+2002-05-08 08:59 hardaker
+
+ * agent/mibgroup/examples/notification.c,
+ agent/mibgroup/examples/notification.h,
+ mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ define a better notification example (no requests. just alarm -> send)
+
+2002-05-07 22:45 hardaker
+
+ * local/mib2c:
+
+ update to current indent command
+
+2002-05-07 22:44 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ move text in comment left slight (was too long).
+
+2002-05-07 22:43 hardaker
+
+ * local/mib2c:
+
+ enum fixes.
+
+2002-05-07 22:42 hardaker
+
+ * local/: Makefile.in, mib2c.column_defines.conf,
+ mib2c.column_enums.conf, mib2c.conf:
+
+ New mib2c files for generating headers full of column number defines
+ and enum defines.
+
+2002-05-07 22:40 hardaker
+
+ * net-snmp-config.in:
+
+ - --compile-subagent agent library reordering so it actually works.
+ - --compile-subagent now supports .o files (precompiled code).
+
+2002-05-07 22:31 hardaker
+
+ * acconfig.h, configure:
+
+ hmm. missed some checkin files.
+
+2002-05-07 11:15 hardaker
+
+ * perl/SNMP/t/: conftest.conf, startagent.pl, conf.t
+:
+
+ test for configuration file/default_store support
+
+2002-05-07 11:14 hardaker
+
+ * perl/SNMP/: SNMP.pm, SNMP.xs:
+
+ make init_snmp() take a char * argument like the real API
+
+2002-05-07 11:00 hardaker
+
+ * agent/helpers/instance.c:
+
+ typos.
+
+2002-05-07 09:41 hardaker
+
+ * local/snmpconf:
+
+ fix the -g flag.
+
+2002-05-07 09:16 hardaker
+
+ * agent/helpers/instance.c:
+
+ call netsnmp_set_request_error like a good boy.
+
+2002-05-06 20:43 rstory
+
+ * mibs/Makefile.mib:
+
+ fix missing $ noted by John Mills on the coders list
+
+2002-05-06 16:12 hardaker
+
+ * configure, config.h.in, configure.in, snmplib/snmp_api.c
+ (V4-2-patches.[4,2,3,3]), configure, configure.in,
+ include/net-snmp/net-snmp-config.h.in,
+ snmplib/snmpTCPDomain.c, snmplib/snmpTCPIPv6Domain.c,
+ snmplib/snmpUDPDomain.c, snmplib/snmpUDPIPv6Domain.c,
+ snmplib/snmpUnixDomain.c:
+
+ use size_t when socklen_t is not available (correctly done this time)
+
+2002-05-06 15:59 hardaker
+
+ * snmplib/: snmpTCPDomain.c, snmpTCPIPv6Domain.c,
+ snmpUDPDomain.c, snmpUDPIPv6Domain.c, snmpUnixDomain.c
+:
+
+ use size_t when socklen_t is not available
+
+2002-05-06 15:49 hardaker
+
+ * configure, acconfig.h, config.h.in, configure.in
+ (V4-2-patches.[3,7,1,2]), acconfig.h, configure,
+ configure.in, include/net-snmp/net-snmp-config.h.in:
+
+ use size_t when socklen_t is not available
+
+2002-05-06 15:11 hardaker
+
+ * agent/mibgroup/ucd-snmp/: memory_hpux.c, memory_hpux.h
+, vmstat_hpux.c, vmstat_hpux.h:
+
+ run indent
+
+2002-05-06 15:10 hardaker
+
+ * agent/mibgroup/ucd-snmp/: memory_hpux.c, memory_hpux.h
+, vmstat_hpux.c, vmstat_hpux.h:
+
+ Patches #551914+ from Gary Edwards to support hpux11 for memory and vmstat modules
+
+2002-05-06 15:07 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ add new hpux modules
+
+2002-05-06 14:34 hardaker
+
+ * README:
+
+ new contributors.
+
+2002-05-06 14:32 hardaker
+
+ * include/net-snmp/library/default_store.h, man/snmpcmd.1.def
+, snmplib/mib.c:
+
+ Patch #551489: From Jeffrey Watson to add a -Q option for quick but w/ an '='
+
+2002-05-06 14:28 hardaker
+
+ * man/snmpd.1.def:
+
+ change -D documentation to reflect current code.
+
+2002-05-06 14:27 hardaker
+
+ * agent/agent_handler.c:
+
+ misc small bugs and error message wording fixes.
+
+2002-05-06 09:37 hardaker
+
+ * agent/mibgroup/smux/: smux.c (V4-2-patches.9), smux.c:
+
+ bug #547010: fix smux auth bug as reported and fixed by Stefan Radman
+
+2002-05-01 23:01 rstory
+
+ * local/mib2c.array-user.conf:
+
+ tweaks for update to table_array
+
+2002-05-01 23:00 rstory
+
+ * agent/Makefile.in:
+
+ add object_monitor stuff
+
+2002-05-01 22:46 rstory
+
+ * snmplib/Makefile.in:
+
+ add check_varbind stuff
+
+2002-05-01 22:45 rstory
+
+ * include/net-snmp/library/check_varbind.h,
+ snmplib/check_varbind.c:
+
+ convenience functions for validation vabrind info
+
+2002-05-01 22:43 rstory
+
+ * agent/helpers/table_array.c,
+ include/net-snmp/agent/table_array.h:
+
+ do I really have to do this? sigh. Ok, rename debug token; revamp logic to
+ modify rows in place, keeping undo info (vs always changing a copy of a row
+ and swapping rows when set completed successfully) to allow external code
+ to keep pointers that don't disappear on them; add a few callbacks, including
+ row_compare, so table_array can maintain the secondary index tree; don't call
+ can_activate/can_delete unless we are actually trying to activate/delete row;
+ add skeleton (ifdef'd out) code for cooperative notifications of row events;
+ update changing array in commit & undo cases, not just commit; change typdefs
+ for a few callback pointers; ummmm... I *think* that's it....:-)
+
+2002-05-01 17:30 hardaker
+
+ * perl/OID/: OID.pm, OID.xs, test.pl:
+
+ Add index building to the + operator.
+
+2002-05-01 09:52 hardaker
+
+ * perl/: OID/OID.pm, OID/OID.xs, agent/Makefile.PL
+, agent/agent.pm, agent/agent.xs, agent/test.pl
+, agent/typemap:
+
+ Make getOID for requests returned a NetSNMP::OID blessed reference.
+ I'm not happy about how this is done, but all attempts to do it
+ correctly only left me in confusion.
+
+2002-05-01 09:31 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c,
+ include/net-snmp/library/snmpAAL5PVCDomain.h,
+ include/net-snmp/library/snmpTCPIPv6Domain.h,
+ include/net-snmp/library/snmpUDPIPv6Domain.h,
+ include/net-snmp/library/snmpUnixDomain.h,
+ snmplib/snmpAAL5PVCDomain.c, snmplib/snmpTCPIPv6Domain.c
+, snmplib/snmpUDPIPv6Domain.c, snmplib/snmpUnixDomain.c
+:
+
+ Change the domain OIDs to point to the net-snmp domains created by Dave.
+ This fixes bug #544245 as well.
+
+2002-05-01 09:30 hardaker
+
+ * Makefile.in:
+
+ Add the OID perl module to the list of modules.
+
+2002-05-01 07:45 hardaker
+
+ * mibs/: UCD-SNMP-MIB.txt (V4-2-patches.0), UCD-SNMP-MIB.txt:
+
+ remove old (and conflicting with traps) transport domain OIDs
+
+2002-05-01 06:19 dts12
+
+ * man/: snmpbulkget.1.def, snmpbulkwalk.1.def,
+ snmpcmd.1.def, snmpdelta.1, snmpget.1.def,
+ snmpset.1.def, snmpstatus.1.def, snmptest.1.def,
+ snmpwalk.1.def:
+
+ Add type tags "STRING: " and "INTEGER: " to example output.
+ Add explicit setting of protocol version to example commands.
+
+2002-05-01 03:34 jbpn
+
+ * agent/mibgroup/Rmon/: agutil.c, agutil.h,
+ agutil_api.h, alarm.c, alarm.h, event.c,
+ event.h, history.c, history.h, row_api.h,
+ rows.c, rows.h, statistics.c, statistics.h:
+
+ - remove CVS Log: entries which are causing problems since they are
+ embedded in a comment, but some of the log entries contain comment
+ delimiters.
+
+2002-04-30 22:15 rstory
+
+ * agent/snmpd.c:
+
+ remove netsnmp_processing_set, it lives in snmp_agent.c
+
+2002-04-30 22:13 rstory
+
+ * include/net-snmp/library/snmp-tc.h, snmplib/snmp-tc.c
+:
+
+ remove unused parameter; allow NONE as old value for storage type transtions
+
+2002-04-30 22:12 rstory
+
+ * include/net-snmp/agent/table.h:
+
+ remove overly complex macro stuff for rowstatus/storagetype
+
+2002-04-30 09:28 hardaker
+
+ * perl/OID/: Makefile.PL, OID.pm, OID.xs, README
+, test.pl:
+
+ - allow conversions to an array (needs to be tied still).
+ - documentation.
+
+2002-04-30 08:15 jbpn
+
+ * agent/: snmpd.c (V4-2-patches.3), snmpd.c:
+
+ - fix bug #545775, reported by Dave Denson, whereby the PID of an
+ already-running snmpd would be overwritten by starting a new snmpd
+ (which would then exit, leaving the original snmpd running and the
+ wrong PID in the file). Solution is not to write the PID until we
+ have successfully opened all our sockets.
+
+2002-04-30 07:23 hardaker
+
+ * perl/OID/: .cvsignore, Changes, MANIFEST,
+ Makefile.PL, OID.pm, OID.xs, README,
+ test.pl, typemap:
+
+ OID perl module so you can do simple OID manipulations within perl easily:
+ - Example: new NetSNMP::OID('interfaces') > new NetSNMP::OID('system')
+
+2002-04-29 16:52 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ regexp fix for white space checks in indent formatted code
+
+2002-04-29 16:47 hardaker
+
+ * Makefile.in:
+
+ reorder perl module names to reflect (new) dependencies.
+
+2002-04-29 09:42 hardaker
+
+ * perl/SNMP/t/mib.t:
+
+ fix a few warnings on failed tests (just screen cleanups)
+
+2002-04-29 09:41 hardaker
+
+ * perl/SNMP/: Makefile.PL, SNMP.pm:
+
+ Make the perl module respect snmp.conf settings (finally).
+ - Now requires a dependency on the NetSNMP::default_store module though.
+
+2002-04-27 08:19 rstory
+
+ * agent/snmp_agent.c:
+
+ don't process set request till delegated requests are complete, and queue
+ any other received packets until a set has completed processing.
+
+2002-04-27 08:10 rstory
+
+ * snmplib/snmp_api.c:
+
+ clean up comments munged by indent
+
+2002-04-27 08:08 rstory
+
+ * agent/mibgroup/agentx/subagent.h:
+
+ add missing prototype to fix compiler warning
+
+2002-04-27 08:07 rstory
+
+ * agent/: object_monitor.c, helpers/table.c,
+ helpers/table_array.c:
+
+ ifdef gymnastics to make sure asserts are only compiled in only if explicity
+ requested
+
+2002-04-26 21:26 rstory
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ fix unbalanced endif on linux. hope I didn't break anything else.
+
+2002-04-26 19:14 rstory
+
+ * agent/snmpd.c:
+
+ fix unused var warning for !windows
+
+2002-04-26 14:33 hardaker
+
+ * agent/mibgroup/Rmon/event.c,
+ include/net-snmp/library/asn1.h:
+
+ fix OID_LENGTH definitions
+
+2002-04-26 10:53 hardaker
+
+ * Makefile.in, perl/ASN/Makefile.PL,
+ perl/agent/Makefile.PL, perl/agent/default_store/Makefile.PL:
+
+ fix --with-perl-modules in makefiles. Make everything use
+ net-snmp-config, ...
+
+2002-04-26 10:27 hardaker
+
+ * perl/SNMP/: Makefile.PL, README, SNMP.pm:
+
+ - Cleanup.
+ - Make buildable from within the source.
+ - Change documentation references for ucd-snmp
+ - Change contact location to net-snmp-users (per Joe's agreement)
+
+2002-04-26 10:19 hardaker
+
+ * perl/default_store/: MANIFEST, Makefile.PL, README,
+ default_store.pm, test.pl:
+
+ - cleanup.
+ - Use net-snmp-config to find library, etc.
+ - Make buildable from within the source.
+ - a few more tests added
+ - use correct libraries
+ - add documentation
+
+2002-04-26 04:22 dts12
+
+ * configure, configure.in:
+
+ Extracting the version from 'snmplib/snmp_version.c' needs to take account
+ of blank space. Reported by Stefan Radman (Bug #547379)
+
+2002-04-26 04:11 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory.c (V4-2-patches.8), memory.c
+:
+
+ Handle memory values > 32bit (latching at 2^32-1)
+ Patch #548663 from Rob Myers
+
+2002-04-26 03:55 dts12
+
+ * agent/snmpd.c:
+
+ Remove redundant 'Invalid option' message, since this is typically
+ reported by getopt(). (Suggested by Andrew Rucker Jones - patch #548748 )
+
+2002-04-26 03:51 dts12
+
+ * agent/snmpd.c:
+
+ Add 'v' to the list of valid options (patch #548748)
+ Thanks to Andrew Rucker Jones.
+
+2002-04-26 03:36 dts12
+
+ * README.hpux11, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/mibII/var_route.c,
+ include/net-snmp/system/hpux.h,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory.c,
+ agent/mibgroup/ucd-snmp/memory.h:
+
+ Apply Johannes Schmidt-Fischer's improved HP-UX 11 patch
+ (#530724) to the main v5 line, as well as the v4-2 branch.
+ The code now compiles cleanly under HP-UX 11 using gcc.
+
+2002-04-25 07:19 hardaker
+
+ * README, include/net-snmp/library/vacm.h,
+ snmplib/vacm.c:
+
+ Patch from Axel Kittenberg to fix possible variable name clash
+
+2002-04-24 22:39 rstory
+
+ * agent/object_monitor.c:
+
+ handle callbacks sending new notifications (while processing notifications)
+
+2002-04-24 21:35 rstory
+
+ * include/net-snmp/agent/object_monitor.h:
+
+ header for new fucntions for monitoring objects
+
+2002-04-24 21:34 rstory
+
+ * agent/object_monitor.c:
+
+ new functions for monitoring object values
+
+2002-04-24 15:02 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ /proc/stat can be larger than 1024
+
+2002-04-24 06:19 dts12
+
+ * snmplib/Makefile.in:
+
+ Install the missing 'md5.h' header file.
+
+2002-04-23 09:43 rstory
+
+ * agent/helpers/: table.c, table_array.c:
+
+ remove last of the #warnings, add xxx-rks if necessary
+
+2002-04-23 07:53 hardaker
+
+ * agent/helpers/table_array.c:
+
+ remove warnings
+
+2002-04-22 19:11 rstory
+
+ * agent/mibgroup/ipfwchains/README:
+
+ update URL to use freenmp.com mirror (unless someone knows a better place?)
+
+2002-04-22 14:10 rstory
+
+ * snmplib/mib.c:
+
+ apply documentatin patch from Axel Kittenberger <Axel.Kittenberger@maxxio.com>
+
+2002-04-22 13:50 rstory
+
+ * local/mib2c.array-user.conf:
+
+ remove extra @end@ (sure would be nice if mib2c would check for unbalanced
+ @end@s)
+
+2002-04-22 09:48 rstory
+
+ * snmplib/oid_array.c:
+
+ update function names to match header (no mixed case)
+
+2002-04-22 08:11 hardaker
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ fix bug #547110: properly spell define
+
+2002-04-21 16:44 hardaker
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ add static to a returned variable
+
+2002-04-21 16:42 hardaker
+
+ * configure, configure.in:
+
+ fix --with-perl-modules
+
+2002-04-21 11:37 rstory
+
+ * snmplib/snmp_version.c:
+
+ 5.0.pre3 -> 5.0; (I'm sure there are other places this needs to change,
+ but I wanted to get the first post 5.0 checkin...:-)
+
+2002-04-20 00:37 hardaker
+
+ * FAQ, sedscript.in, perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0 )
+
+-------------------------------------------------------------------------------
+
+Changes: V4.2 -> V5.0
+
+2002-04-20 00:27 hardaker
+
+ * everything:
+
+ set all CVS/RCS revision control numbers to 5.0
+
+2002-04-20 00:07 hardaker
+
+ * everything:
+
+ 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.
+
+2002-04-20 00:01 hardaker
+
+ * configure , configure.in:
+
+ turn on ucd compat by default.
+
+2002-04-20 00:00 hardaker
+
+ * NEWS:
+
+ last updates
+
+2002-04-19 23:33 hardaker
+
+ * agent/mibgroup/testdelayed.h:
+
+ remove testdelayed
+
+2002-04-19 23:18 hardaker
+
+ * agent/mibgroup/utilities/: .cvsignore , .cvsignore:
+
+ cvs ignore file
+
+2002-04-19 23:17 hardaker
+
+ * agent/snmp_perl.c:
+
+ don't die if perl doesn't init.
+
+2002-04-19 23:03 hardaker
+
+ * perl/SNMP/: README , README , SNMP.pm:
+
+ change warning.
+
+2002-04-19 22:29 hardaker
+
+ * agent/snmp_agent.c:
+
+ double check that multiple inserts into the delegated chain don't
+ happen (read: they shouldn't anyway, but.....).
+
+2002-04-19 22:29 hardaker
+
+ * CodingStyle:
+
+ typedef update
+
+2002-04-19 22:16 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ Fix the callback build hook to turn off the expect response flag when
+ not appropriate.
+
+2002-04-19 19:09 rstory
+
+ * include/net-snmp/library/oid_array.h:
+
+ spelling misteak; remove capital letters in function names
+
+2002-04-19 19:08 rstory
+
+ * agent/helpers/table_array.c:
+
+ update for function name changed in oid_array.h
+
+2002-04-19 18:20 hardaker
+
+ * agent/snmp_perl.c:
+
+ make the perlInitFile and disablePerl tokens register as premib such
+ that when passed as a --FLAG it'll actually do the right thing and
+ disable the later "perl" token handlers.
+
+2002-04-19 17:29 hardaker
+
+ * Makefile.in , man/Makefile.in , man/netsnmp_agent.3
+ , man/netsnmp_bulk_to_next.3 , man/netsnmp_debug.3 ,
+ man/netsnmp_example_scalar_int.3 , man/netsnmp_handler.3
+ , man/netsnmp_instance.3 ,
+ man/netsnmp_mib_handler_methods.3 , man/netsnmp_multiplexer.3
+ , man/netsnmp_old_api.3 , man/netsnmp_read_only.3 ,
+ man/netsnmp_serialize.3 , man/netsnmp_table.3 ,
+ man/netsnmp_table_array.3 , man/netsnmp_table_data.3 ,
+ man/netsnmp_table_dataset.3 , man/netsnmp_table_iterator.3
+ , man/netsnmp_todo.3:
+
+ documentation. Can't get enough.
+ - make docs now installs man pages into the man dir, which are then installed.
+
+2002-04-19 17:14 hardaker
+
+ * testing/tests/: T111agentxset , T121proxyset:
+
+ Correct for new STRING prefix.
+
+2002-04-19 17:03 hardaker
+
+ * README:
+
+ Add Katsuhisa ABE
+
+2002-04-19 17:03 hardaker
+
+ * perl/: ASN/ASN.xs , default_store/default_store.xs:
+
+ fix header files for new paths.
+
+2002-04-19 17:00 hardaker
+
+ * agent/snmp_vars.c , agent/mibgroup/mibII/vacm_vars.c
+ , include/net-snmp/library/snmpUDPIPv6Domain.h ,
+ man/snmpd.conf.5.def , snmplib/snmpUDPIPv6Domain.c:
+
+ Apply patch #532555: ipv6 com2sec support, thanks to Katsuhisa ABE.
+
+2002-04-19 16:19 hardaker
+
+ * agent/agent_trap.c , agent/snmp_agent.c ,
+ agent/mibgroup/mibII/sysORTable.c ,
+ agent/mibgroup/mibII/system_mib.c ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/library/tools.h , snmplib/tools.c:
+
+ fix sysUpTime (and related functions) to handle much larger upTime
+ values (ie, fix signed integer wrapping).
+
+2002-04-19 11:37 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document embedded perl support.
+
+2002-04-19 11:34 hardaker
+
+ * configure , configure.in , agent/Makefile.in
+ , agent/snmp_perl.c , agent/snmp_perl.pl ,
+ include/net-snmp/agent/ds_agent.h , perl/agent/Makefile.PL:
+
+ Add some new snmpd.conf tokens for controlling perl better.
+ Fix embedded perl support so it actually works.
+
+2002-04-19 11:32 hardaker
+
+ * perl/agent/default_store/: .cvsignore , Makefile.PL ,
+ default_store.pm , default_store.xs:
+
+ Added missing agent default_store stuff. (they existed on my machine,
+ I don't know why everyone else was having problems)
+
+2002-04-19 10:30 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ Protect against things that should never ever happen
+
+2002-04-19 03:10 dts12
+
+ * Makefile.in:
+
+ <Sigh> A little learning is a dangerous thing.
+ Apply the rest of the patch from Axel - sorry.
+
+2002-04-19 01:49 dts12
+
+ * Makefile.in , doxygen.conf:
+
+ Handle generating documenation when srcdir != configdir
+ (Patch supplied by Axel Kittenberger)
+
+2002-04-18 17:38 hardaker
+
+ * snmplib/snmpIPXDomain.c:
+
+ fix snmpIPXDomain (again)
+
+2002-04-18 17:31 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ Patch from Vishal Verma: only open subagent connections once at startup
+
+2002-04-18 17:28 hardaker
+
+ * agent/agent_registry.c:
+
+ Patch from Vishal Verma: for down subagent cases, mark registrations as detached
+
+2002-04-18 17:17 hardaker
+
+ * snmplib/snmp_api.c:
+
+ define a maximum packet size we can accept to protect certain error
+ conditions (-1 after conversion is now too large).
+
+2002-04-18 16:28 hardaker
+
+ * acconfig.h:
+
+ change the enterprise OIDs in the proper place (net-snmp-config.h.in
+ is generated from this file).
+
+2002-04-18 13:51 hardaker
+
+ * configure , configure.in , net-snmp-config.in:
+
+ - Add two new options to net-snmp-config as requested on the IRC channel.
+ --configure-options
+ --snmpd-module-list
+
+2002-04-18 11:43 rstory
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ add missing comma
+
+2002-04-18 07:39 dts12
+
+ * configure , configure.in:
+
+ Calculate the length of supplied enterprise OIDs correctly
+ (and use a more meaningful output message)
+
+ Shame these settings aren't cached for later re-use....
+
+2002-04-18 07:18 dts12
+
+ * agent/snmpd.c:
+
+ Notify on agent reconfiguration.
+
+2002-04-18 07:16 dts12
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ Use the Net-SNMP notifications by default, rather than the ucdavis ones.
+
+2002-04-18 07:08 dts12
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ Fix the table-of-contents sequence for the nsModuleTable, add notification
+ definitions for the agent, and define groups for everything.
+
+2002-04-18 02:52 dts12
+
+ * snmplib/mib.c:
+
+ Bring integer and string output formats into line with the other types
+ by printing a type token before the value (unless supressed by 'quick print')
+ Thanks to Erik for the patch
+
+2002-04-18 01:46 dts12
+
+ * FAQ:
+
+ Replace the dlmod 'WHERE' with something more meaningful....
+
+2002-04-17 12:12 hardaker
+
+ * snmplib/snmpIPXDomain.c:
+
+ define the ipxDomain variables
+
+2002-04-17 12:12 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ Error condition tests
+
+2002-04-17 10:10 hardaker
+
+ * agent/agent_registry.c , agent/snmp_agent.c ,
+ agent/mibgroup/agentx/master_admin.c ,
+ include/net-snmp/agent/agent_handler.h ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/var_struct.h:
+
+ Oh, just a small patch to make it possible to make modules request
+ that all queries to a set of registrations get passed all at once
+ (which apparently is important for, oh, agentx)
+
+2002-04-17 10:09 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ misc non-change clean ups
+
+2002-04-17 10:03 hardaker
+
+ * include/net-snmp/agent/table.h:
+
+ rename structures beginning with _ to ending with _s
+
+2002-04-17 10:02 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ add a void * pointer for the session creator to use at will (different
+ from the callback magic).
+
+2002-04-17 09:00 dts12
+
+ * configure , configure.in ,
+ include/net-snmp/net-snmp-config.h.in:
+
+ Use the Net-SNMP sysOIDs by default, rather than the ucdavis ones.
+
+2002-04-17 08:26 dts12
+
+ * apps/snmpnetstat/Makefile.in:
+
+ Blank continuation lines confuse HP's version of make.
+
+2002-04-17 08:16 dts12
+
+ * agent/Makefile.in:
+
+ Blank continuation lines confuse HP's version of make
+
+2002-04-17 06:56 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c ,
+ mibs/NET-SNMP-AGENT-MIB.txt:
+
+ move nsModuleTable into Dave's structure.
+
+2002-04-17 06:54 hardaker
+
+ * include/net-snmp/library/: snmpAAL5PVCDomain.h ,
+ snmpTCPIPv6Domain.h , snmpUDPIPv6Domain.h:
+
+ fix declarations of Domain objects (const -> extern)
+
+2002-04-17 06:31 hardaker
+
+ * local/snmpconf.dir/: snmp-data/snmpconf-config ,
+ snmpd-data/snmpconf-config , snmptrapd-data/snmpconf-config:
+
+ snmpconf configuration data
+
+2002-04-17 03:01 dts12
+
+ * configure , configure.in:
+
+ Bring the reported default settings for sysoid & notification OIDs
+ back into line with what we actually use (i.e. the ucdavis OIDs).
+
+ Qn: Do we want to switch to using the net-snmp equivalent sysOIDs?
+ Qn: What about defining net-snmp notifications?
+
+2002-04-17 02:55 dts12
+
+ * configure , configure.in:
+
+ Fix --with-enterprise-sysoid and --with-enterprise-notification-oid,
+ and try to clarify that these are OIDs, while --with-enterprise-oid
+ is actually just the enterprise *number*
+
+ Qn: should we change the name of the configure option to reflect this?
+
+2002-04-16 10:04 hardaker
+
+ * sedscript.in , snmplib/snmp_version.c , FAQ ,
+ perl/SNMP/SNMP.pm:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.pre3 )
+
+2002-04-16 10:02 hardaker
+
+ * README:
+
+ delete top disclaimers
+
+2002-04-16 10:02 hardaker
+
+ * NEWS:
+
+ misc updates
+
+2002-04-16 10:01 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ misc bug fixes
+
+2002-04-16 08:19 dts12
+
+ * FAQ:
+
+ Add an entry concerning the 'libcrypto' RPM dependency.
+
+2002-04-16 08:00 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ fix memory leak
+
+2002-04-16 07:13 hardaker
+
+ * agent/snmp_agent.c:
+
+ remove a no longer appropriate todo comment
+
+2002-04-16 07:12 hardaker
+
+ * configure:
+
+ I guess I forgot to run autoconf
+
+2002-04-15 08:58 hardaker
+
+ * local/: snmpconf , Makefile.in:
+
+ move snmpconf data directories to different names to avoid confusion
+
+2002-04-15 08:36 hardaker
+
+ * local/snmpconf.dir/: snmp-data/authopts ,
+ snmp-data/debugging , snmp-data/mibs , snmp-data/output
+ , snmpd-data/acl , snmpd-data/basic_setup ,
+ snmpd-data/extending , snmpd-data/monitor ,
+ snmpd-data/operation , snmpd-data/system ,
+ snmpd-data/trapsinks , snmptrapd-data/formatting ,
+ snmptrapd-data/traphandle:
+
+ data file moving
+
+2002-04-12 14:38 hardaker
+
+ * local/snmpconf:
+
+ Massive cleanup effort. It should now respect ordering in the
+ snmpconf configuration files as well.
+
+2002-04-12 13:00 rstory
+
+ * include/net-snmp/agent/agent_registry.h:
+
+ fix for overzealous perl script
+
+2002-04-12 09:47 hardaker
+
+ * Makefile.in , configure , configure.in:
+
+ copy ucd persisent directory to net-snmp (prompts, flags and other fun)
+
+2002-04-12 07:57 hardaker
+
+ * local/Makefile.in:
+
+ install traptoemail
+
+2002-04-12 07:55 hardaker
+
+ * local/trapnotif:
+
+ remove trapnotif
+
+2002-04-12 07:51 hardaker
+
+ * local/: Makefile.in , rsnmp:
+
+ remove rsnmp, which is very very old and out of date
+
+2002-04-12 07:47 hardaker
+
+ * man/: .cvsignore , Makefile.in , mib2c.1.def:
+
+ A manual page for mib2c (help, I'm turning into Dave)
+
+2002-04-12 07:28 hardaker
+
+ * dotgdbinit:
+
+ a gdb initialization file with helpful functions
+
+2002-04-12 02:42 dts12
+
+ * local/Makefile.in:
+
+ Add 'snmpconf' and 'mib2c' to the list of scripts to install.
+
+ I've left 'traptoemail' off this list, since it says it's not intended
+ as a directly user-invoked command, so probably ought not to be installed
+ into a binary directory.
+
+2002-04-12 02:41 dts12
+
+ * local/rsnmp:
+
+ Fix the path of snmpwalk to be something more plausible.
+ (I'm not convinced about the validity of that initial 'rtopmib' OID mind!)
+
+2002-04-12 02:36 dts12
+
+ * local/mib2c.conf:
+
+ Fix typo in reference to 'mib2c.iterate.conf'
+
+2002-04-12 02:33 dts12
+
+ * Makefile.rules , snmplib/Makefile.in:
+
+ Install the main library as 'libsnmp' if configured using UCD compatibility.
+ This should handle the requirements of application compatibility.
+ Agent library compatibility is likely to prove a harder problem
+ (since there are now three libraries, not just two...)
+
+2002-04-11 22:29 hardaker
+
+ * perl/SNMP/t/startagent.pl:
+
+ set SNMPCONFPATH iff [sic] not set
+
+2002-04-11 22:27 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ return from initMib before doing anything.
+
+2002-04-11 22:26 hardaker
+
+ * perl/SNMP/Makefile.PL:
+
+ turn off complier warnings
+
+2002-04-11 22:26 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ support "show columns from TABLE"
+
+2002-04-11 22:25 hardaker
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ Add a new demo scalar: the sleeper. (dah dah dah dummmmm)
+
+2002-04-11 22:25 hardaker
+
+ * agent/mibgroup/examples/scalar_int.c:
+
+ indent.
+
+2002-04-11 22:25 hardaker
+
+ * agent/mibgroup/: examples.h , examples/delayed_instance.c
+ , examples/delayed_instance.h:
+
+ Add a delayed instance example, showing how to return mib request
+ results later rather than immediately.
+
+2002-04-11 22:24 hardaker
+
+ * agent/mibgroup/testdelayed.c:
+
+ remove legacy example.
+
+2002-04-11 22:23 hardaker
+
+ * agent/snmp_agent.c:
+
+ add comment about possibly fixing inclusive requests in the future.
+
+2002-04-11 17:08 hardaker
+
+ * README.win32:
+
+ change modukes-> modules
+
+2002-04-11 07:23 hardaker
+
+ * snmplib/snmp_logging.c:
+
+ turn off debugging when calling logging callbacks
+
+2002-04-10 12:51 hardaker
+
+ * perl/SNMP/: SNMP.pm , SNMP.xs:
+
+ fix perl module in many many places. most tests now pass.
+
+2002-04-10 12:50 hardaker
+
+ * perl/SNMP/t/startagent.pl:
+
+ force setting to a "bogus" SNMPCONFPATH.
+
+2002-04-10 12:48 hardaker
+
+ * include/net-snmp/library/mib.h , snmplib/mib.c:
+
+ Exporting functions good. Internalizing bad.
+
+2002-04-10 09:28 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ opps. sigh.
+
+2002-04-10 09:27 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ opps. remove debugging statements.
+
+2002-04-10 09:23 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ - Make the perl module call init_snmp()
+ - this is a fairly major change, is it now will read .conf files.
+ - many people have asked for this.
+ - misc clean ups.
+
+2002-04-10 09:18 dts12
+
+ * Makefile.rules:
+
+ Don't recurse into subdirectories for the consituent subtargets of "make install"
+
+2002-04-10 09:09 hardaker
+
+ * NEWS:
+
+ added a few things, separated perl stuff into it's own section.
+
+2002-04-10 08:46 dts12
+
+ * configure , configure.in:
+
+ Bring the help message for the UCD compatability option into line with
+ what's actually recognised.
+
+2002-04-10 07:52 hardaker
+
+ * Makefile.top:
+
+ change libtool versioning to their recommended method of doing things
+ (which I hate, but is still better than what we were doing, I guess)
+
+2002-04-10 07:10 dts12
+
+ * Makefile.rules:
+
+ Bring use of BUILTSUBDIR within 'installlocalheaders' into line
+ with the preceding comment, and actual usage.
+ (i.e. INSTALLBUILTSUBDIR rather than INCLUDEBUILTSUBDIR)
+
+2002-04-10 05:58 dts12
+
+ * snmplib/Makefile.in:
+
+ Typo in security-include header destination directory variable
+
+2002-04-10 05:55 dts12
+
+ * local/Makefile.in:
+
+ Ensure the destination directory exists before installing mib2c conf files.
+
+2002-04-10 01:55 dts12
+
+ * testing/tests/: T004snmpv1nosuch , T019snmpv2cnosuch:
+
+ Two new tests to check handling of GETing non-existant instances
+
+2002-04-10 01:54 dts12
+
+ * agent/snmp_agent.c:
+
+ A fix for SNMPv1 errors that doesn't end up breaking AgentX error handling.
+
+2002-04-09 10:38 hardaker
+
+ * agent/snmp_agent.c:
+
+ Patch from Dave to fix v1 error results.
+
+2002-04-08 21:08 rstory
+
+ * snmplib/oid_array.c:
+
+ fix incorrect length return value
+
+2002-04-08 18:00 hardaker
+
+ * agent/mibgroup/mibII/: vacm_vars.c , vacm_vars.h:
+
+ don't allow no-configuration access anymore.
+
+2002-04-08 17:59 hardaker
+
+ * include/net-snmp/library/transform_oids.h ,
+ snmplib/snmpAAL5PVCDomain.c , snmplib/snmpTCPIPv6Domain.c
+ , snmplib/snmpUDPIPv6Domain.c , snmplib/snmpusm.c:
+
+ more unconst correctness
+
+2002-04-08 17:31 hardaker
+
+ * include/net-snmp/library/snmp_transport.h:
+
+ size_t externs for exported oids
+
+2002-04-08 17:30 hardaker
+
+ * snmplib/snmp_api.c:
+
+ remove temporary debugging statements that accidentally became permanent.
+
+2002-04-08 17:26 hardaker
+
+ * snmplib/: snmpUDPDomain.c , snmp_transport.c:
+
+ define length size_t's for oid variables.
+
+2002-04-08 16:53 hardaker
+
+ * agent/mibgroup/utilities/override.c:
+
+ support "null" types.
+
+2002-04-08 16:52 hardaker
+
+ * apps/snmptrapd.c:
+
+ initialize notification log mib support before -H usage.
+
+2002-04-08 16:49 hardaker
+
+ * agent/helpers/serialize.c:
+
+ fix a few things and make subhandlers not able to tell there were more requests.
+
+2002-04-08 16:43 hardaker
+
+ * INSTALL:
+
+ A co-worker pointed out that the INSTALL script still said to edit config.h
+
+2002-04-08 15:13 hardaker
+
+ * include/net-snmp/library/snmpTCPDomain.h ,
+ include/net-snmp/library/snmpUnixDomain.h ,
+ include/net-snmp/library/snmp_transport.h ,
+ snmplib/snmpTCPDomain.c , snmplib/snmpUnixDomain.c ,
+ snmplib/snmp_transport.c:
+
+ unstatic-ize a few oids that should have been external
+
+2002-04-08 14:23 hardaker
+
+ * snmplib/: snmpAAL5PVCDomain.c , snmpTCPDomain.c ,
+ snmpTCPIPv6Domain.c , snmpUDPIPv6Domain.c ,
+ snmpUnixDomain.c , snmp_api.c , snmp_transport.c
+ , snmpusm.c:
+
+ Change const oid declarations into static ones since shared libraries
+ have a problem with initializing them on linux systems at least.
+
+2002-04-08 11:45 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ minimal documentation for debugging and the injectHandler token
+
+2002-04-05 14:32 hardaker
+
+ * man/: snmptrapd.8.def , snmptrapd.conf.5.def:
+
+ documentation for the NOTIFICATION-LOG-MIB support.
+
+2002-04-05 14:09 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document context name support in proxy code.
+
+2002-04-05 13:51 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ document the disman event mib support for sending traps via monitored OIDs.
+
+2002-04-05 10:12 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ put trap config into its own section.
+ document the "override" token.
+
+2002-04-05 06:39 hardaker
+
+ * README.snmpv3:
+
+ change default context to an empty string
+
+2002-04-04 15:14 hardaker
+
+ * agent/: agent_registry.c (V4-2-patches.5), agent_registry.c:
+
+ deal with fd unregistrations properly.
+
+2002-04-03 09:12 hardaker
+
+ * agent/helpers/table_dataset.c , agent/mibgroup/examples.h
+ , agent/mibgroup/testhandler.c ,
+ agent/mibgroup/examples/data_set.c ,
+ agent/mibgroup/examples/data_set.h ,
+ agent/mibgroup/examples/scalar_int.c ,
+ include/net-snmp/agent/table_dataset.h ,
+ mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ Make an example dataset table to hold and store data in (admittedly
+ useless data from a network management point of view, but it's an example).
+
+2002-04-02 22:12 hardaker
+
+ * man/Makefile.in:
+
+ fix installation from subdir build case.
+
+2002-04-02 21:45 hardaker
+
+ * snmplib/Makefile.in:
+
+ install snmpv3-security-includes from from build dir.
+
+2002-04-02 21:45 hardaker
+
+ * agent/Makefile.in:
+
+ install mib_module_config.h and mib_module_includes.h from build dir.
+
+2002-04-02 21:43 hardaker
+
+ * Makefile.in:
+
+ install net-snmp-config.h from the build dir.
+
+2002-04-02 21:43 hardaker
+
+ * Makefile.rules:
+
+ create some install from built header rules.
+
+2002-04-02 17:27 hardaker
+
+ * local/: Makefile.in , mib2c.conf:
+
+ remove deleted array-auto from .conf install/reference lists
+
+2002-04-02 15:03 hardaker
+
+ * agent/mibgroup/: ucd_snmp.h , ucd-snmp/registry.c ,
+ ucd-snmp/registry.h:
+
+ remove the registry module, as it's obsolete due to contexts. Use the nsModuleTable instead
+
+2002-04-02 14:57 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c (V4-2-patches.7),
+ agent/mibgroup/ucd-snmp/disk.c ,
+ include/net-snmp/system/darwin.h:
+
+ Apply patch #524424 for darwin fixes for ucd-snmp/disk.c
+
+2002-04-02 14:47 hardaker
+
+ * agent/mibgroup/: kernel_sunos5.c (V4-2-patches.8),
+ kernel_sunos5.c:
+
+ apply patch 527573 to fix 64 bit types on solaris
+
+2002-04-02 07:04 hardaker
+
+ * snmplib/snmp_transport.c:
+
+ check char for NULL before setting to:
+
+2002-04-01 22:28 hardaker
+
+ * snmplib/: snmp_api.c (V4-2-patches.9), cmu_compat.c ,
+ snmp_api.c:
+
+ Let init_snmp protect itself.
+
+2002-03-29 15:04 rstory
+
+ * local/mib2c.array-user.conf:
+
+ tweaks & updates
+
+2002-03-29 10:40 rstory
+
+ * snmplib/mib.c:
+
+ add comment
+
+2002-03-29 08:36 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ add a allow_creation definition.
+
+2002-03-29 08:22 hardaker
+
+ * Makefile.in:
+
+ make net-snmp-config executable after it's built
+
+2002-03-29 08:13 hardaker
+
+ * agent/mibgroup/mibII/: setSerialNo.c , setSerialNo.h:
+
+ opps. forgot to check the setSerial code in
+
+2002-03-28 23:48 hardaker
+
+ * agent/mibgroup/ucd-snmp/: pass.c (V4-2-patches.4), pass.c:
+
+ enable row creation for pass modules. Patch #482005
+
+2002-03-28 23:44 hardaker
+
+ * agent/mibgroup/mibII/: interfaces.c (V4-2-patches.2),
+ interfaces.c:
+
+ patch #517340: freebsd5 support
+
+2002-03-28 23:38 hardaker
+
+ * agent/mibgroup/host/: hr_filesys.c (V4-2-patches.4), hr_filesys.c:
+
+ apply freebsd5 patch #517333
+
+2002-03-28 23:32 hardaker
+
+ * agent/mibgroup/: host/hr_system.c , mibII/interfaces.c
+ , mibII/ipAddr.c:
+
+ Apply netbsd fix patch #529733
+
+2002-03-28 23:01 hardaker
+
+ * snmplib/: snmp_api.c (V4-2-patches.8), snmp_api.c ,
+ snmp_api.c:
+
+ use a static variable for init checking. Bug #536386.
+
+2002-03-28 15:25 dts12
+
+ * man/: default_store.3.top , read_config.3.def ,
+ snmp_api.3.def:
+
+ Tweak to use the new include structure.
+
+2002-03-28 15:23 dts12
+
+ * FAQ (V4-2-patches.8), FAQ:
+
+ Add a few new entries (mostly relating to traps)
+
+2002-03-28 14:56 rstory
+
+ * agent/helpers/table_array.c:
+
+ rename/prefix functions; add doxygen documentation
+
+2002-03-28 13:00 rstory
+
+ * doxygen.conf:
+
+ add define for excluding stuff (DOXYGEN_SHOULD_SKIP_THIS)
+
+2002-03-28 12:50 hardaker
+
+ * agent/mibgroup/mibII.h:
+
+ add setSerialNo
+
+2002-03-28 12:47 hardaker
+
+ * snmplib/ucd_compat.c:
+
+ fix a never-seen-but-very-old-bug using the wrong default_store token.
+
+2002-03-28 12:46 hardaker
+
+ * snmplib/snmp_api.c:
+
+ only set the default output style if it's not already set to something.
+
+2002-03-28 12:45 hardaker
+
+ * agent/agent_read_config.c:
+
+ wrapping.
+
+2002-03-28 12:17 hardaker
+
+ * doxygen.conf:
+
+ change version number
+
+2002-03-28 12:08 rstory
+
+ * apps/snmptranslate.c:
+
+ back out change from version 1.65 until better solution can be found;
+ bug #535029
+
+2002-03-28 12:03 rstory
+
+ * agent/agent_registry.c:
+
+ return specific result code for registration failure if available.
+
+2002-03-28 11:57 hardaker
+
+ * agent/: agent_registry.c , mibgroup/agentx/master_admin.c:
+
+ perl typo
+
+2002-03-27 15:48 rstory
+
+ * local/mib2c.array-auto.conf:
+
+ delete old, unused conf file
+
+2002-03-27 08:27 hardaker
+
+ * apps/: notification_log.c , notification_log.h ,
+ snmptrapd.c:
+
+ add "dontRetainLogs" token to snmptrapd.conf to not enable the
+ notification log mib.
+
+2002-03-27 01:54 dts12
+
+ * configure.in, configure (V4-2-patches.[1,1]), configure ,
+ configure.in:
+
+ Use the correct name of the Windows IP Helper API library.
+ (Computers can be soooo picky!)
+
+2002-03-26 23:23 hardaker
+
+ * agent/snmp_agent.c , agent/snmpd.c ,
+ agent/helpers/all_helpers.c , agent/helpers/bulk_to_next.c
+ , agent/helpers/debug_handler.c ,
+ agent/helpers/read_only.c , agent/mibgroup/agentx/master.c
+ , include/net-snmp/agent/bulk_to_next.h ,
+ include/net-snmp/agent/debug_handler.h ,
+ include/net-snmp/agent/read_only.h ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/var_struct.h:
+
+ - Really fix the "undo failed" problem. IE, not just any old error
+ will cause an undo failed message to get sent back. Only varbinds
+ with an undo failed error code will cause an undo failed result.
+ undo failed results do still supersede all other error codes,
+ however, which is what the original problem was all about. We still
+ have to depend on the modules returning the right error code (but
+ that's their fault if they don't).
+ - misc cleanups and renames
+
+2002-03-26 23:20 hardaker
+
+ * README:
+
+ add Craig Setera
+
+2002-03-26 14:07 rstory
+
+ * TODO:
+
+ add creating src rpm spec file
+
+2002-03-26 08:29 hardaker
+
+ * agent/mibgroup/ucd-snmp/: diskio.c (V4-2-patches.2), diskio.c:
+
+ enable diskio on freebsd5. Implements patch 517328 in a different way.
+
+2002-03-26 07:58 hardaker
+
+ * mibs/Makefile.in:
+
+ fix for other-dir builds
+
+2002-03-26 07:57 hardaker
+
+ * agent/agent_registry.c:
+
+ duplicate registration info in split_subtree
+
+2002-03-26 07:43 dts12
+
+ * configure, configure.in (V4-2-patches.[0,0]), configure ,
+ configure.in:
+
+ Add /etc/filesystems to list of mount table files (for AIX)
+ Should fix bugs 232588 and (?)517113
+
+2002-03-26 07:39 dts12
+
+ * configure, configure.in (V4-2-patches.[9,9]), configure ,
+ configure.in:
+
+ Remove trailing ':' from list of MIB module names in configure output,
+ to avoid confusion (see Bug #491129)
+
+2002-03-26 06:41 dts12
+
+ * configure , configure.in:
+
+ Add '-lhlpapi' to the list of agent libraries, when running on Windows
+ (using Cygwin). Should fix Bug #534409.
+
+2002-03-25 22:33 rstory
+
+ * snmplib/: parse.c (V4-2-patches.3), parse.c:
+
+ fix bug#520478 showMibErrors token is inverted
+
+2002-03-25 15:18 rstory
+
+ * include/net-snmp/version.h:
+
+ remove ^M characters
+
+2002-03-25 14:53 hardaker
+
+ * agent/snmp_agent.c , include/net-snmp/agent/snmp_agent.h:
+
+ use emacs to fix perl search and replace errors, of course
+
+2002-03-25 14:47 hardaker
+
+ * agent/agent_registry.c , agent/snmp_agent.c ,
+ agent/helpers/old_api.c , agent/helpers/table.c ,
+ agent/helpers/table_data.c , agent/helpers/table_dataset.c
+ , agent/mibgroup/testhandler.c ,
+ agent/mibgroup/agentx/master_admin.c ,
+ apps/notification_log.c ,
+ include/net-snmp/agent/agent_registry.h ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/table.h ,
+ include/net-snmp/agent/table_data.h ,
+ include/net-snmp/agent/table_dataset.h ,
+ include/net-snmp/library/mib.h ,
+ local/mib2c.create-dataset.conf , snmplib/mib.c ,
+ snmplib/snmp_api.c:
+
+ use perl to search and replace perl search and replace errors, of course
+
+2002-03-25 14:23 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ api changes
+
+2002-03-25 08:43 dts12
+
+ * win32/: win32.opt , libsnmp_dll/libsnmp.def ,
+ snmpbulkget/snmpbulkget.dsp , snmpbulkwalk/snmpbulkwalk.dsp
+ , snmpd/snmpd.dsp , snmpdelta/snmpdelta.dsp ,
+ snmpdf/snmpdf.dsp , snmpget/snmpget.dsp ,
+ snmpgetnext/snmpgetnext.dsp , snmpnetstat/snmpnetstat.dsp
+ , snmpset/snmpset.dsp , snmpstatus/snmpstatus.dsp
+ , snmptable/snmptable.dsp , snmptest/snmptest.dsp
+ , snmptranslate/snmptranslate.dsp ,
+ snmptrap/snmptrap.dsp , snmptrapd/snmptrapd.dsp ,
+ snmpusm/snmpusm.dsp , snmpvacm/snmpvacm.dsp ,
+ snmpwalk/snmpwalk.dsp:
+
+ Remove redundant declarations of 'getopt.c' and 'snmp_parse_args.c' in
+ each individual application project. These routines are included within
+ the libraries, so we might as well use those.
+
+2002-03-25 05:53 dts12
+
+ * win32/: mib_module_inits.h , win32.opt ,
+ libsnmp_dll/libsnmp.def , libsnmp_dll/libsnmp_dll.dsp ,
+ snmpd/snmpd.dsp:
+
+ Gotcha! Everything now builds (more-or-less) cleanly under Visual C++.
+ You still have to use the "Batch Build" mechanism (or else be careful which
+ of libsnmp/libsnmp_dll you build in each of the Debug & Release modes),
+ and you need to build twice in order to get encode_keychange linking.
+ But things *do* finally build.
+
+2002-03-24 05:21 nba
+
+ * snmplib/mib.c:
+
+ Oops - snprint_* cannot realloc
+
+2002-03-23 09:40 hardaker
+
+ * apps/Makefile.in:
+
+ really fix snmpinform installs this time.
+
+2002-03-22 22:32 hardaker
+
+ * apps/notification_log.c:
+
+ final cleanups of notification log support
+
+2002-03-22 22:32 hardaker
+
+ * apps/Makefile.in:
+
+ fix installation of snmpinform
+
+2002-03-22 22:32 hardaker
+
+ * agent/helpers/table_data.c , agent/mibgroup/testhandler.c
+ , include/net-snmp/agent/agent_registry.h ,
+ include/net-snmp/agent/table_data.h ,
+ include/net-snmp/agent/table_dataset.h:
+
+ Rename stuff. Fix stuff. You know, normal routine.
+
+2002-03-22 22:31 hardaker
+
+ * configure , configure.in:
+
+ fix version file location for non-sourcedir builds
+
+2002-03-22 14:13 hardaker
+
+ * include/net-snmp/library/snmp_api.h:
+
+ forgot to commit a prototype.
+
+2002-03-22 14:12 hardaker
+
+ * agent/agent_handler.c , agent/agent_registry.c ,
+ agent/mibgroup/agentx/master_admin.c ,
+ include/net-snmp/agent/agent_registry.h:
+
+ register_mib_context2 -> netsnmp_register_mib (and marked as internal)
+
+2002-03-22 14:01 hardaker
+
+ * agent/mibgroup/agentx/: master.c , subagent.c:
+
+ use new error logging api when !root
+
+2002-03-22 14:00 hardaker
+
+ * snmplib/snmp_api.c:
+
+ enable logging session errors to some log level other than ERR.
+
+2002-03-22 13:55 hardaker
+
+ * agent/mibgroup/agentx/: master.c , subagent.c:
+
+ better agentx connection related error messages.
+
+2002-03-22 09:35 dts12
+
+ * win32/: win32.dsw , win32.opt ,
+ libhelpers/libhelpers.dsp , libsnmp_dll/libsnmp.def ,
+ netsnmpmibs/netsnmpmibs.dsp , snmpd/snmpd.dsp:
+
+ Slowly making progress on 5.0 Windows build.
+ Everything now compiles, though the Release version doesn't link.
+ (complains about assorted unknown routines that are there,
+ staring it in the face. Grrr!!!!)
+
+2002-03-22 08:24 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - do not "tweak" range_subid when dealing with compressed OIDs.
+ Thanks to Craig Setera for pointing out this deviation from RFC
+ 2741.
+
+2002-03-22 07:50 dts12
+
+ * include/net-snmp/library/snmpUDPDomain.h ,
+ include/net-snmp/library/snmp_client.h , snmplib/oid_array.c
+ , snmplib/snmpTCPDomain.c , snmplib/snmpUDPDomain.c
+ , snmplib/snmp_api.c , snmplib/snmp_client.c:
+
+ Various minor inconsistencies (mostly to do with subtle variations in types)
+
+2002-03-22 07:31 rstory
+
+ * snmplib/snmp_parse_args.c:
+
+ fix typo
+
+2002-03-22 07:29 dts12
+
+ * win32/: mib_module_includes.h , mib_module_inits.h ,
+ net-snmp/net-snmp-config.h ,
+ net-snmp/library/snmpv3-security-includes.h:
+
+ Bring Windows versions of "automatically-generated" header files up to date.
+
+2002-03-22 02:23 jbpn
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - don't use "reg" as a parameter name in kernel_sunos5_cache_age()
+ as /usr/include/inet/common.h says:
+ #define reg register
+ (!) which the compiler then barfs on. Reported as bug #533336 by
+ Anonymous.
+
+2002-03-21 09:24 hardaker
+
+ * include/net-snmp/library/read_config.h ,
+ include/net-snmp/library/snmp_api.h , snmplib/read_config.c
+ , snmplib/snmp_api.c , snmplib/snmp_parse_args.c:
+
+ - snmp_config* -> netsnmp_config (for new functions only)
+ - fix bug where snmp_config() strings were getting parsed twice.
+
+2002-03-21 09:23 hardaker
+
+ * apps/snmptrapd.c:
+
+ wrap agentx stuff in a still unused variable (at this point).
+
+2002-03-21 09:23 hardaker
+
+ * apps/snmptranslate.c:
+
+ remove unused variable.
+
+2002-03-21 09:23 hardaker
+
+ * agent/mibgroup/utilities/override.c:
+
+ fix oid parsing.
+
+2002-03-21 09:22 hardaker
+
+ * agent/mibgroup/: Rmon/alarm.c , Rmon/statistics.c ,
+ mibII/at.c:
+
+ change // coments to /* */ comments (bad bad bad)
+
+2002-03-21 06:40 hardaker
+
+ * snmplib/snmp-tc.c:
+
+ change // coments to /* */ comments (bad bad bad)
+
+2002-03-20 20:12 hardaker
+
+ * snmplib/snmp_api.c:
+
+ add a list of registered text enums to ASN_* values.
+ (In probably the wrong place.)
+
+2002-03-20 20:11 hardaker
+
+ * configure , configure.in ,
+ agent/mibgroup/utilities.h ,
+ agent/mibgroup/utilities/override.c ,
+ agent/mibgroup/utilities/override.h:
+
+ create a new "override" directive to force an OID to a particular value
+ - not finished. It's designed to do read-write as well, but doesn't.
+
+2002-03-20 20:08 hardaker
+
+ * agent/helpers/instance.c:
+
+ check for inclusive
+
+2002-03-20 11:37 hardaker
+
+ * include/net-snmp/agent/table_dataset.h:
+
+ include new delete/remove breakdown APIs
+
+2002-03-20 11:36 hardaker
+
+ * apps/notification_log.c:
+
+ API change.
+
+2002-03-20 11:36 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ some "this will change" early row status implementation.
+ - (this will move to a separate handler)
+
+2002-03-20 11:35 hardaker
+
+ * agent/helpers/table_data.c:
+
+ pointer checking against illegal adds (ie, shouldn't happen but check anyway)
+
+2002-03-20 08:42 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ Ok, I make mistakes. I admit it. It really should have been a NULL.
+
+2002-03-20 08:37 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ add missing comma
+
+2002-03-20 08:36 hardaker
+
+ * agent/helpers/table_data.c ,
+ include/net-snmp/agent/table_data.h:
+
+ separate out delete/remove row functionality
+
+2002-03-20 07:47 hardaker
+
+ * agent/mibgroup/mibII/: system_mib.c (V4-2-patches.6),
+ system_mib.c:
+
+ remove illegal SET support for sysDescr.
+
+2002-03-20 06:27 hardaker
+
+ * CodingStyle , local/mib2c:
+
+ - add many many -T flags for defining types.
+
+2002-03-19 21:13 hardaker
+
+ * apps/snmptrapd.c:
+
+ force setting of '!root' flag so that it will run for non-privileged
+ users or when an agentx master simply has never existed.
+
+2002-03-19 16:02 hardaker
+
+ * agent/helpers/table_dataset.c ,
+ include/net-snmp/agent/table_dataset.h:
+
+ - allow tables to be marked whether they should support creation or not.
+ - bug fixes
+
+2002-03-19 07:32 hardaker
+
+ * agent/helpers/: table_data.c , table_dataset.c:
+
+ documentation clean up
+
+2002-03-19 07:28 hardaker
+
+ * agent/: agent_handler.c , helpers/table_data.c:
+
+ documentation clean up
+
+2002-03-19 07:17 hardaker
+
+ * agent/: agent_handler.c , helpers/bulk_to_next.c ,
+ helpers/table_dataset.c , mibgroup/examples/scalar_int.c:
+
+ documentation clean up
+
+2002-03-19 06:43 hardaker
+
+ * agent/agent_handler.c , agent/agent_registry.c ,
+ agent/snmp_agent.c , agent/helpers/instance.c ,
+ agent/helpers/old_api.c , agent/helpers/table.c ,
+ agent/helpers/table_array.c , agent/helpers/table_data.c
+ , agent/helpers/table_dataset.c ,
+ agent/helpers/table_iterator.c , agent/mibgroup/testdelayed.c
+ , agent/mibgroup/testhandler.c ,
+ agent/mibgroup/agentx/master_admin.c ,
+ apps/notification_log.c , include/net-snmp/utilities.h ,
+ include/net-snmp/agent/agent_handler.h ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/table.h ,
+ include/net-snmp/agent/table_data.h ,
+ include/net-snmp/agent/table_dataset.h ,
+ include/net-snmp/library/data_list.h ,
+ local/mib2c.create-dataset.conf , perl/agent/agent.xs ,
+ snmplib/data_list.c:
+
+ - renamed a few badly named functions (netsnmp_ appeared twice).
+ - implemented the beginning of creation support for datasets.
+
+2002-03-19 06:35 hardaker
+
+ * configure:
+
+ Apparently I ran autoconf earlier and missed checking in the results.
+
+2002-03-19 06:35 hardaker
+
+ * CodingStyle:
+
+ add -nfca
+
+2002-03-17 16:25 hardaker
+
+ * apps/snmptrap.c:
+
+ Set default port to 162.
+
+2002-03-17 15:51 hardaker
+
+ * snmplib/: snmpTCPDomain.c , snmpUDPDomain.c:
+
+ improved formatting strings showing both transport type and port number.
+
+2002-03-13 23:30 hardaker
+
+ * Makefile.rules:
+
+ add missing "installsubdirs" target missing (thanks to Katsuhisa ABE)
+
+2002-03-13 23:27 hardaker
+
+ * configure.in , net-snmp-config.in:
+
+ add --create-snmpv3-user to automate adding a v3 user to both the usm
+ and vacm tables (by adding lines to both the persistent and normal
+ conf files).
+
+2002-03-13 16:30 hardaker
+
+ * agent/mibgroup/agent/nsModuleTable.c:
+
+ bug fix for pre-processed requests.
+
+2002-03-13 16:30 hardaker
+
+ * Makefile.rules , configure , configure.in ,
+ agent/Makefile.in , agent/mibgroup/agent_mibs.h ,
+ include/ucd-snmp/agent_index.h ,
+ include/ucd-snmp/agent_read_config.h ,
+ include/ucd-snmp/agent_registry.h ,
+ include/ucd-snmp/agent_trap.h , include/ucd-snmp/asn1.h ,
+ include/ucd-snmp/auto_nlist.h , include/ucd-snmp/callback.h
+ , include/ucd-snmp/default_store.h ,
+ include/ucd-snmp/ds_agent.h ,
+ include/ucd-snmp/header_complex.h , include/ucd-snmp/int64.h
+ , include/ucd-snmp/keytools.h , include/ucd-snmp/mib.h
+ , include/ucd-snmp/mib_module_config.h ,
+ include/ucd-snmp/mibincl.h , include/ucd-snmp/parse.h ,
+ include/ucd-snmp/read_config.h , include/ucd-snmp/scapi.h
+ , include/ucd-snmp/snmp-tc.h , include/ucd-snmp/snmp.h
+ , include/ucd-snmp/snmp_agent.h ,
+ include/ucd-snmp/snmp_alarm.h , include/ucd-snmp/snmp_api.h
+ , include/ucd-snmp/snmp_client.h ,
+ include/ucd-snmp/snmp_debug.h , include/ucd-snmp/snmp_impl.h
+ , include/ucd-snmp/snmp_logging.h ,
+ include/ucd-snmp/snmp_parse_args.h ,
+ include/ucd-snmp/snmp_vars.h , include/ucd-snmp/snmpusm.h
+ , include/ucd-snmp/snmpv3.h , include/ucd-snmp/struct.h
+ , include/ucd-snmp/system.h , include/ucd-snmp/tools.h
+ , include/ucd-snmp/transform_oids.h ,
+ include/ucd-snmp/ucd-snmp-agent-includes.h ,
+ include/ucd-snmp/ucd-snmp-includes.h ,
+ include/ucd-snmp/util_funcs.h , include/ucd-snmp/var_struct.h
+ , include/ucd-snmp/version.h:
+
+ - --enable-ucd-snmp-compatibility actually installs headers (as opposed
+ to always, which is what it used to do).
+ - add agent_mibs to configure default mib modules and document.
+ - change help documentation a bit for the mib modules.
+ - add a forced dependency for mib_modules.lo
+
+2002-03-13 16:13 hardaker
+
+ * agent/mibgroup/agent.h:
+
+ opps. duplicates existing agent_mibs.h
+
+2002-03-13 15:50 hardaker
+
+ * mibs/: UCD-DEMO-MIB.txt, UCD-DISKIO-MIB.txt, UCD-DLMOD-MIB.txt,
+ UCD-IPFILTER-MIB.txt, UCD-IPFWACC-MIB.txt, UCD-SNMP-MIB.txt
+ (V4-2-patches.[1,1,1,1,1,9]), UCD-DEMO-MIB.txt ,
+ UCD-DISKIO-MIB.txt , UCD-DLMOD-MIB.txt ,
+ UCD-IPFILTER-MIB.txt , UCD-IPFWACC-MIB.txt ,
+ UCD-SNMP-MIB.txt:
+
+ address changes for ucd-snmp -> net-snmp note saying these mibs are no
+ longer supported by UCD.
+
+2002-03-13 15:39 hardaker
+
+ * agent/mibgroup/agent.h ,
+ agent/mibgroup/agent/nsModuleTable.c ,
+ agent/mibgroup/agent/nsModuleTable.h ,
+ mibs/NET-SNMP-AGENT-MIB.txt:
+
+ Added a nsModuleTable table which replaces the older mrTable.
+ Functionally, this is a list of all registered items within the MIB
+ tree just like the mrTable was, but with support for contexts and for
+ duplicate registrations with different priorities.
+
+2002-03-13 15:21 hardaker
+
+ * snmplib/: tools.c (V4-2-patches.4), tools.c:
+
+ malloc at least one byte in hex_to_binary2
+
+2002-03-13 15:11 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ remove unneeded debug statement
+
+2002-03-13 14:10 hardaker
+
+ * snmplib/mib.c:
+
+ Use local variable name buffers by default when building oid segments.
+
+2002-03-13 14:09 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ /* stop water from flowing through dam */
+ finger->insert("hole")
+
+2002-03-13 04:03 dts12
+
+ * FAQ (V4-2-patches.7), FAQ:
+
+ Add a description of "unlinked OIDs".
+
+2002-03-12 21:30 hardaker
+
+ * local/: mib2c.create-dataset.conf , mib2c.iterate.conf:
+
+ fix headers.
+
+2002-03-12 21:15 hardaker
+
+ * local/mib2c:
+
+ add don't format comments option
+
+2002-03-12 21:10 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ fix for tables with holes.
+
+2002-03-12 21:09 hardaker
+
+ * mibs/Makefile.in:
+
+ move default mibs to their own variable.
+
+2002-03-12 21:06 hardaker
+
+ * perl/: SNMP/Makefile.PL , agent/Makefile.PL ,
+ agent/agent.xs , agent/typemap:
+
+ - use net-snmp-config to figure things out.
+ - update headers and typeinfo for recent changes.
+
+2002-03-12 20:34 hardaker
+
+ * local/: FAQ2HTML , README.mib2c , mib2c , tkmib
+ , mib2c.array-auto.conf , mib2c.array-user.conf:
+
+ ucd-snmp -> net-snmp changes.
+
+2002-03-12 20:33 hardaker
+
+ * local/mib2c.storage.conf:
+
+ remove obsolete mib2c.conf file
+
+2002-03-12 18:11 hardaker
+
+ * agent/helpers/table_data.c:
+
+ don't forget to set row->next->prev to something when removing row.
+
+2002-03-12 17:54 hardaker
+
+ * agent/snmp_agent.c:
+
+ fix agentx inclusive searches to ignore get errors.
+
+2002-03-12 17:53 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ some minimal dump debugging.
+
+2002-03-12 08:34 dts12
+
+ * FAQ (V4-2-patches.6), FAQ:
+
+ Updating of the FAQ ready for the next release.
+ (Mostly rephrasing of existing entries, but a few new questions)
+
+2002-03-11 18:00 rstory
+
+ * agent/helpers/table_dataset.c:
+
+ cast -1 to u_char so test doesn't always fail (fix compiler warning)
+
+2002-03-11 17:27 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ treat (illegal) errors from subagents specially for getnext cases.
+
+2002-03-11 13:41 hardaker
+
+ * net-snmp-config.in:
+
+ add our snmp libraries to output
+
+2002-03-11 10:34 hardaker
+
+ * include/net-snmp/agent/: table_data.h , table_dataset.h:
+
+ delete/remove support header changes.
+
+2002-03-11 09:13 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - allow compilation --with-out-transports=TCP
+
+2002-03-11 08:21 jbpn
+
+ * include/net-snmp/library/snmp_debug.h:
+
+ - fixes for --disable-debugging
+
+2002-03-11 07:41 dts12
+
+ * FAQ (V4-2-patches.5), FAQ:
+
+ Bring the 4x- and main-branch FAQs into agreement.
+
+2002-03-11 06:51 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - use correct session ID when talking to subagents. Thanks to Craig
+ Setera for this fix.
+
+2002-03-11 05:20 jbpn
+
+ * snmplib/parse.c:
+
+ - fix bad type assignment in build_translation_table(), noticed by
+ Peter Stevens.
+
+2002-03-11 00:13 hardaker
+
+ * apps/snmptrapd.c:
+
+ check for NULL frees, even though it's supposed to be ok according to ansi.
+
+2002-03-11 00:12 hardaker
+
+ * apps/notification_log.c:
+
+ beginning support for maximum logged checking.
+
+2002-03-11 00:11 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ - remove/delete row support.
+ - null check
+ - doc comments.
+
+2002-03-11 00:10 hardaker
+
+ * agent/helpers/table_data.c:
+
+ remove/delete row support.
+
+2002-03-11 00:08 hardaker
+
+ * agent/helpers/instance.c:
+
+ call next handlers (opps).
+
+2002-03-10 14:11 nba
+
+ * man/mib_api.3.def:
+
+ Fix one sprint_variable => snprint_variable
+
+2002-03-10 14:06 nba
+
+ * include/net-snmp/library/mib.h , snmplib/mib.c:
+
+ Add snprint_* functions that were sprint_* in ucd-snmp 4
+
+2002-03-10 14:05 nba
+
+ * include/net-snmp/session_api.h , snmplib/snmpIPXDomain.c
+ , snmplib/snmp_transport.c:
+
+ Fix compilation when IPX-transport enabled
+
+2002-03-10 14:03 nba
+
+ * apps/snmpnetstat/Makefile.in:
+
+ Fix compilation outside source directory
+
+2002-03-08 22:26 hardaker
+
+ * FAQ , sedscript.in , perl/SNMP/SNMP.pm ,
+ snmplib/snmp_version.c:
+
+ - (snmplib/snmp_version.c sedscript.in): version tag ( 5.0.pre2 )
+
+2002-03-08 18:23 hardaker
+
+ * README:
+
+ misc changes.
+
+2002-03-08 18:23 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ new api changes
+
+2002-03-08 17:20 hardaker
+
+ * agent/mibgroup/mibII/mta_sendmail.c:
+
+ Patch from Lawrence Greenfield to deal with Sendmail 8.12 queuegroups.
+
+2002-03-08 16:59 hardaker
+
+ * apps/snmpnetstat/Makefile.in:
+
+ patch from csete to fix win32 builds
+
+2002-03-08 16:55 hardaker
+
+ * configure , configure.in:
+
+ add Callback transport to cygwin
+
+2002-03-08 16:49 hardaker
+
+ * NEWS:
+
+ mention rmon support.
+
+2002-03-08 16:39 hardaker
+
+ * snmplib/snmp_api.c:
+
+ patch from Harrie Hazewinkel to remove old an unused pointer
+
+2002-03-08 16:28 hardaker
+
+ * agent/agent_index.c , agent/agent_registry.c ,
+ agent/agent_trap.c , agent/snmp_agent.c ,
+ agent/snmp_vars.c , agent/snmpd.c ,
+ agent/helpers/instance.c , agent/helpers/old_api.c ,
+ agent/helpers/table.c , agent/helpers/table_array.c ,
+ agent/helpers/table_data.c , agent/helpers/table_dataset.c
+ , agent/helpers/table_iterator.c ,
+ agent/mibgroup/header_complex.c ,
+ agent/mibgroup/header_complex.h , agent/mibgroup/testhandler.c
+ , agent/mibgroup/Rmon/event.c ,
+ agent/mibgroup/agent/nsTransactionTable.c ,
+ agent/mibgroup/agentx/client.c ,
+ agent/mibgroup/agentx/client.h ,
+ agent/mibgroup/agentx/master.c ,
+ agent/mibgroup/agentx/master_admin.c ,
+ agent/mibgroup/agentx/master_admin.h ,
+ agent/mibgroup/agentx/protocol.c ,
+ agent/mibgroup/agentx/protocol.h ,
+ agent/mibgroup/agentx/subagent.c ,
+ agent/mibgroup/agentx/subagent.h ,
+ agent/mibgroup/disman/mteObjectsTable.c ,
+ agent/mibgroup/disman/mteObjectsTable.h ,
+ agent/mibgroup/disman/mteTriggerTable.c ,
+ agent/mibgroup/disman/mteTriggerTable.h ,
+ agent/mibgroup/examples/example.c ,
+ agent/mibgroup/mibII/sysORTable.c ,
+ agent/mibgroup/mibII/sysORTable.h ,
+ agent/mibgroup/mibII/vacm_context.c ,
+ agent/mibgroup/mibII/vacm_vars.c ,
+ agent/mibgroup/mibII/vacm_vars.h ,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c ,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/smux/smux.c , agent/mibgroup/smux/smux.h
+ , agent/mibgroup/target/snmpTargetAddrEntry.c ,
+ agent/mibgroup/target/snmpTargetAddrEntry.h ,
+ agent/mibgroup/target/target.c ,
+ agent/mibgroup/target/target.h ,
+ agent/mibgroup/ucd-snmp/proxy.c ,
+ agent/mibgroup/ucd-snmp/proxy.h , apps/notification_log.c
+ , apps/notification_log.h , apps/snmpbulkget.c ,
+ apps/snmpbulkwalk.c , apps/snmpdelta.c , apps/snmpdf.c
+ , apps/snmpget.c , apps/snmpgetnext.c ,
+ apps/snmpset.c , apps/snmpstatus.c , apps/snmptable.c
+ , apps/snmptest.c , apps/snmptrap.c ,
+ apps/snmptrapd.c , apps/snmptrapd_log.c ,
+ apps/snmptrapd_log.h , apps/snmpusm.c , apps/snmpvacm.c
+ , apps/snmpwalk.c , apps/snmpnetstat/if.c ,
+ apps/snmpnetstat/inet.c , apps/snmpnetstat/inet6.c ,
+ apps/snmpnetstat/main.c , apps/snmpnetstat/netstat.h ,
+ apps/snmpnetstat/route.c ,
+ include/net-snmp/agent/agent_index.h ,
+ include/net-snmp/agent/agent_registry.h ,
+ include/net-snmp/agent/agent_trap.h ,
+ include/net-snmp/agent/old_api.h ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/snmp_vars.h ,
+ include/net-snmp/agent/table.h ,
+ include/net-snmp/agent/table_data.h ,
+ include/net-snmp/agent/table_iterator.h ,
+ include/net-snmp/agent/var_struct.h ,
+ include/net-snmp/library/cmu_compat.h ,
+ include/net-snmp/library/libsnmp.h ,
+ include/net-snmp/library/mib.h ,
+ include/net-snmp/library/oid_array.h ,
+ include/net-snmp/library/parse.h ,
+ include/net-snmp/library/snmpCallbackDomain.h ,
+ include/net-snmp/library/snmp_api.h ,
+ include/net-snmp/library/snmp_client.h ,
+ include/net-snmp/library/snmp_debug.h ,
+ include/net-snmp/library/snmp_parse_args.h ,
+ include/net-snmp/library/snmp_secmod.h ,
+ include/net-snmp/library/snmpusm.h ,
+ local/mib2c.array-user.conf , local/mib2c.iterate.conf ,
+ local/mib2c.storage.conf , perl/SNMP/SNMP.xs ,
+ snmplib/cmu_compat.c , snmplib/mib.c ,
+ snmplib/snmpCallbackDomain.c , snmplib/snmp_api.c ,
+ snmplib/snmp_client.c , snmplib/snmp_debug.c ,
+ snmplib/snmp_parse_args.c , snmplib/snmp_secmod.c ,
+ snmplib/snmpksm.c , snmplib/snmpusm.c , snmplib/snmpv3.c
+ , snmplib/ucd_compat.c:
+
+ struct snmp_session typedefed to netsnmp_session. & pdu. & ...
+
+2002-03-08 14:00 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ get_symbol -> get_tree
+
+2002-03-08 07:45 hardaker
+
+ * perl/: SNMP/SNMP.xs , agent/agent.pm , agent/agent.xs
+ , agent/test.pl:
+
+ missed updates
+
+2002-03-08 07:43 hardaker
+
+ * snmplib/: data_list.c , default_store.c , mib.c
+ , oid_array.c , oid_stash.c , read_config.c
+ , snmpAAL5PVCDomain.c , snmpCallbackDomain.c ,
+ snmpIPXDomain.c , snmpTCPDomain.c , snmpTCPIPv6Domain.c
+ , snmpUDPDomain.c , snmpUDPIPv6Domain.c ,
+ snmpUnixDomain.c , snmp_api.c , snmp_debug.c ,
+ snmp_transport.c , snmpv3.c:
+
+ missing updated code
+
+2002-03-08 02:07 jbpn
+
+ * include/net-snmp/library/snmp_api.h ,
+ include/net-snmp/library/snmp_transport.h , snmplib/snmp_api.c:
+
+ - some snmp -> netsnmp fixes
+
+2002-03-07 13:42 hardaker
+
+ * agent/snmp_agent.c , agent/snmp_vars.c ,
+ agent/snmpd.c , agent/helpers/table.c ,
+ agent/helpers/table_array.c , agent/helpers/table_data.c
+ , agent/helpers/table_dataset.c ,
+ agent/helpers/table_iterator.c , agent/mibgroup/testhandler.c
+ , agent/mibgroup/agent/nsTransactionTable.c ,
+ agent/mibgroup/agentx/subagent.c ,
+ agent/mibgroup/disman/mteTriggerTable.c ,
+ agent/mibgroup/mibII/vacm_context.c ,
+ agent/mibgroup/mibII/vacm_vars.c , apps/notification_log.c
+ , apps/snmptrapd.c , apps/snmptrapd_log.c ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/table.h ,
+ include/net-snmp/agent/table_array.h ,
+ include/net-snmp/agent/table_data.h ,
+ include/net-snmp/agent/table_dataset.h ,
+ include/net-snmp/agent/table_iterator.h ,
+ include/net-snmp/library/snmpAAL5PVCDomain.h ,
+ include/net-snmp/library/snmpCallbackDomain.h ,
+ include/net-snmp/library/snmpIPXDomain.h ,
+ include/net-snmp/library/snmpTCPDomain.h ,
+ include/net-snmp/library/snmpTCPIPv6Domain.h ,
+ include/net-snmp/library/snmpUDPDomain.h ,
+ include/net-snmp/library/snmpUDPIPv6Domain.h ,
+ include/net-snmp/library/snmpUnixDomain.h ,
+ local/mib2c.array-auto.conf , local/mib2c.array-user.conf
+ , local/mib2c.create-dataset.conf ,
+ local/mib2c.iterate.conf:
+
+ massive netsnmp_ prefixing of stuff (pass 4)
+
+2002-03-07 13:29 hardaker
+
+ * agent/agent_handler.c , agent/agent_read_config.c ,
+ agent/agent_registry.c , agent/snmp_vars.c ,
+ agent/helpers/all_helpers.c , agent/helpers/bulk_to_next.c
+ , agent/helpers/debug_handler.c ,
+ agent/helpers/instance.c , agent/helpers/multiplexer.c ,
+ agent/helpers/null.c , agent/helpers/old_api.c ,
+ agent/helpers/read_only.c , agent/helpers/serialize.c ,
+ agent/helpers/table.c , agent/helpers/table_array.c ,
+ agent/helpers/table_data.c , agent/helpers/table_dataset.c
+ , agent/helpers/table_iterator.c ,
+ agent/mibgroup/testdelayed.c , agent/mibgroup/testhandler.c
+ , agent/mibgroup/agent/nsTransactionTable.c ,
+ agent/mibgroup/agent/nsTransactionTable.h ,
+ agent/mibgroup/agentx/master_admin.c ,
+ agent/mibgroup/disman/mteTriggerTable.c ,
+ agent/mibgroup/examples/scalar_int.c ,
+ agent/mibgroup/mibII/vacm_context.c ,
+ agent/mibgroup/target/target.c ,
+ agent/mibgroup/target/target_counters.c ,
+ apps/notification_log.c ,
+ include/net-snmp/agent/agent_registry.h ,
+ include/net-snmp/agent/all_helpers.h ,
+ include/net-snmp/agent/bulk_to_next.h ,
+ include/net-snmp/agent/debug_handler.h ,
+ include/net-snmp/agent/instance.h ,
+ include/net-snmp/agent/multiplexer.h ,
+ include/net-snmp/agent/null.h ,
+ include/net-snmp/agent/old_api.h ,
+ include/net-snmp/agent/read_only.h ,
+ include/net-snmp/agent/serialize.h ,
+ include/net-snmp/agent/table.h ,
+ include/net-snmp/agent/table_array.h ,
+ include/net-snmp/agent/table_data.h ,
+ include/net-snmp/agent/table_dataset.h ,
+ include/net-snmp/agent/table_iterator.h ,
+ include/net-snmp/library/snmpTCPDomain.h ,
+ local/mib2c.array-auto.conf , local/mib2c.array-user.conf
+ , local/mib2c.create-dataset.conf ,
+ local/mib2c.iterate.conf:
+
+ massive netsnmp_ prefixing of stuff (pass 3)
+
+2002-03-07 13:13 hardaker
+
+ * agent/agent_handler.c , agent/agent_registry.c ,
+ agent/snmp_agent.c , agent/helpers/debug_handler.c ,
+ agent/helpers/instance.c , agent/helpers/old_api.c ,
+ agent/helpers/table.c , agent/helpers/table_array.c ,
+ agent/helpers/table_data.c , agent/helpers/table_dataset.c
+ , agent/helpers/table_iterator.c ,
+ agent/mibgroup/testdelayed.c , agent/mibgroup/testhandler.c
+ , agent/mibgroup/agentx/master_admin.c ,
+ agent/mibgroup/disman/mteTriggerTable.c ,
+ agent/mibgroup/target/target.c , apps/snmptrapd.c ,
+ include/net-snmp/agent/agent_handler.h ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/table_array.h ,
+ include/net-snmp/library/data_list.h ,
+ include/net-snmp/library/oid_array.h ,
+ include/net-snmp/library/oid_stash.h ,
+ local/mib2c.array-user.conf:
+
+ massive netsnmp_ prefixing of stuff (pass 2)
+
+2002-03-07 08:56 hardaker
+
+ * agent/agent_handler.c , agent/agent_read_config.c ,
+ agent/agent_registry.c , agent/snmp_agent.c ,
+ agent/snmp_vars.c , agent/snmpd.c ,
+ agent/helpers/bulk_to_next.c , agent/helpers/debug_handler.c
+ , agent/helpers/instance.c ,
+ agent/helpers/multiplexer.c , agent/helpers/null.c ,
+ agent/helpers/old_api.c , agent/helpers/read_only.c ,
+ agent/helpers/serialize.c , agent/helpers/table.c ,
+ agent/helpers/table_array.c , agent/helpers/table_data.c
+ , agent/helpers/table_dataset.c ,
+ agent/helpers/table_iterator.c , agent/mibgroup/testdelayed.c
+ , agent/mibgroup/testdelayed.h ,
+ agent/mibgroup/testhandler.c , agent/mibgroup/testhandler.h
+ , agent/mibgroup/agent/nsTransactionTable.c ,
+ agent/mibgroup/agent/nsTransactionTable.h ,
+ agent/mibgroup/agentx/master.c ,
+ agent/mibgroup/agentx/master.h ,
+ agent/mibgroup/agentx/master_admin.c ,
+ agent/mibgroup/agentx/subagent.c ,
+ agent/mibgroup/disman/mteTriggerTable.c ,
+ agent/mibgroup/mibII/sysORTable.c ,
+ agent/mibgroup/mibII/system_mib.c ,
+ agent/mibgroup/mibII/vacm_context.c ,
+ agent/mibgroup/mibII/vacm_context.h ,
+ agent/mibgroup/mibII/vacm_vars.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/target/snmpTargetAddrEntry.h ,
+ agent/mibgroup/target/target.c ,
+ agent/mibgroup/target/target_counters.c ,
+ agent/mibgroup/target/target_counters.h ,
+ agent/mibgroup/ucd-snmp/proxy.c ,
+ agent/mibgroup/ucd-snmp/proxy.h , apps/notification_log.c
+ , apps/notification_log.h , apps/snmpstatus.c ,
+ apps/snmptest.c , apps/snmptrapd.c ,
+ apps/snmptrapd_log.c , apps/snmptrapd_log.h ,
+ include/net-snmp/session_api.h ,
+ include/net-snmp/agent/agent_handler.h ,
+ include/net-snmp/agent/agent_registry.h ,
+ include/net-snmp/agent/bulk_to_next.h ,
+ include/net-snmp/agent/debug_handler.h ,
+ include/net-snmp/agent/instance.h ,
+ include/net-snmp/agent/multiplexer.h ,
+ include/net-snmp/agent/null.h ,
+ include/net-snmp/agent/old_api.h ,
+ include/net-snmp/agent/read_only.h ,
+ include/net-snmp/agent/serialize.h ,
+ include/net-snmp/agent/set_helper.h ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/snmp_vars.h ,
+ include/net-snmp/agent/table.h ,
+ include/net-snmp/agent/table_array.h ,
+ include/net-snmp/agent/table_data.h ,
+ include/net-snmp/agent/table_dataset.h ,
+ include/net-snmp/agent/table_iterator.h ,
+ include/net-snmp/agent/var_struct.h ,
+ include/net-snmp/library/mib.h ,
+ include/net-snmp/library/read_config.h ,
+ include/net-snmp/library/snmpAAL5PVCDomain.h ,
+ include/net-snmp/library/snmpCallbackDomain.h ,
+ include/net-snmp/library/snmpIPXDomain.h ,
+ include/net-snmp/library/snmpTCPDomain.h ,
+ include/net-snmp/library/snmpTCPIPv6Domain.h ,
+ include/net-snmp/library/snmpUDPDomain.h ,
+ include/net-snmp/library/snmpUDPIPv6Domain.h ,
+ include/net-snmp/library/snmpUnixDomain.h ,
+ include/net-snmp/library/snmp_api.h ,
+ include/net-snmp/library/snmp_transport.h ,
+ local/mib2c.array-auto.conf , local/mib2c.array-user.conf
+ , local/mib2c.create-dataset.conf ,
+ local/mib2c.iterate.conf:
+
+ massive netsnmp_ prefixing of stuff (pass 1)
+
+2002-03-07 06:21 jbpn
+
+ * man/snmp_sess_api.3.def:
+
+ - style update
+
+2002-03-07 05:47 jbpn
+
+ * man/snmp_trap_api.3.def:
+
+ - minor updates
+
+2002-03-07 05:39 jbpn
+
+ * man/snmp_alarm.3.def:
+
+ - style update
+
+2002-03-07 05:00 jbpn
+
+ * man/read_config.3.def:
+
+ - make prototypes match header
+
+ - make style consistent with mib_api
+
+2002-03-07 03:07 jbpn
+
+ * man/mib_api.3.def:
+
+ - fix up snprint_ declarations, fix small typo. Patch by Guy
+ Harris.
+
+2002-03-07 02:44 jbpn
+
+ * include/net-snmp/library/mib.h:
+
+ - remove duplicate declaration of sprint_realloc_by_type, as noted
+ by Guy Harris.
+
+2002-03-06 17:15 hardaker
+
+ * include/net-snmp/agent/.cvsignore ,
+ include/net-snmp/library/.cvsignore , perl/SNMP/t/.cvsignore:
+
+ new ignore files
+
+2002-03-06 17:13 hardaker
+
+ * .cvsignore:
+
+ ignore docs
+
+2002-03-06 17:08 hardaker
+
+ * agent/mibgroup/examples.h:
+
+ examples module wrapper to include all (new) examples.
+
+2002-03-06 16:58 hardaker
+
+ * agent/mibgroup/examples/scalar_int.c:
+
+ document better.
+
+2002-03-06 16:58 hardaker
+
+ * doxygen.conf:
+
+ search examples for docs.
+
+2002-03-06 16:29 hardaker
+
+ * mibs/NET-SNMP-EXAMPLES-MIB.txt:
+
+ example MIB template (and one node)
+
+2002-03-06 16:28 hardaker
+
+ * mibs/NET-SNMP-MIB.txt:
+
+ instantiate examples
+
+2002-03-06 16:27 hardaker
+
+ * mibs/Makefile.in:
+
+ install some NS mibs
+
+2002-03-06 16:27 hardaker
+
+ * agent/mibgroup/examples/: scalar_int.c , scalar_int.h:
+
+ Example implementation of a SNMP enabled int registered at a scalar.
+
+2002-03-06 16:25 hardaker
+
+ * agent/helpers/instance.c , include/net-snmp/agent/instance.h:
+
+ many changes for instances. Specificically:
+ - allow for subhandlers.
+ - provide an int wrapper.
+ - reuse more code.
+ - numerous bug fixes.
+
+2002-03-06 14:05 hardaker
+
+ * NEWS:
+
+ remove a blank line.
+
+2002-03-06 14:05 hardaker
+
+ * agent/mibgroup/agentx/: master.c , master_admin.c:
+
+ Fix master agent getbulk support. this has to be independently of the
+ normal bulk->next fixes due to delegation. Long story.
+
+2002-03-06 14:03 hardaker
+
+ * agent/helpers/bulk_to_next.c:
+
+ move bulk_to_next fixing functionality into a separate function for reuse.
+
+2002-03-06 10:26 jbpn
+
+ * include/net-snmp/library/mib.h , snmplib/mib.c:
+
+ - sprinkle magic const dust
+
+2002-03-06 10:18 jbpn
+
+ * man/mib_api.3.def:
+
+ - document changed API, incorporating patches by Guy Harris.
+
+2002-03-06 09:34 hardaker
+
+ * testing/tests/: T112agentxsetfail , T122proxysetfail:
+
+ fix tests.
+
+2002-03-06 09:24 hardaker
+
+ * snmplib/snmp_parse_args.c:
+
+ re-enable setting optind to 1 till Dave tells me where this breaks.
+
+2002-03-06 09:08 hardaker
+
+ * testing/tests/: T051snmpv2ctrap , T052snmpv2cinform ,
+ T058agentauthtrap:
+
+ fixes for new command line usage.
+
+2002-03-06 09:07 hardaker
+
+ * snmplib/snmp_client.c:
+
+ more improved error messages (mostly)
+
+2002-03-06 08:54 hardaker
+
+ * configure:
+
+ autoconf
+
+2002-03-06 08:41 dts12
+
+ * snmplib/: snmpv3.c (V4-2-patches.3), snmpv3.c:
+
+ Fix a confusion between defAuthType and defPrivType.
+
+2002-03-06 08:36 hardaker
+
+ * agent/mibgroup/agentx/: master.c , protocol.c:
+
+ proper fix for not requiring responses to CLEANUP messages.
+
+2002-03-06 06:07 jbpn
+
+ * agent/snmp_agent.c:
+
+ - zero the name of elements of the bulk cache
+
+2002-03-06 06:06 jbpn
+
+ * snmplib/mib.c:
+
+ - calloc() not malloc() in a few places to initialise some buffers
+ to zeroes.
+
+2002-03-06 05:52 dts12
+
+ * snmplib/: snmp_api.c (V4-2-patches.6), snmp_api.c:
+
+ Actually use the common 'defPassphrase' value if 'def{Auth,Priv}Passphrase' isn't set.
+ Qn: Should the AuthPassphrase also be used for privacy if no other value is available?
+
+2002-03-06 05:45 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - don't send requests for OIDs preceeding the start of a region
+ (this can lead to loops if e.g. a subagent has registered two
+ adjacent rows).
+
+2002-03-06 05:07 jbpn
+
+ * testing/Makefile.in:
+
+ - ignore errors doing rm -rf /tmp/snmp-test* when making testclean
+
+2002-03-06 02:26 jbpn
+
+ * snmplib/mib.c:
+
+ - use more efficient get_tree() in sprint_realloc_value()
+
+2002-03-05 18:28 hardaker
+
+ * testing/tests/: T015snmpv2cgetnext , T001snmpv1get ,
+ T002snmpv1getnext , T003snmpv1getfail , T014snmpv2cget
+ , T016snmpv2cgetfail , T017snmpv2ctov1getfail ,
+ T018snmpv1tov2cgetfail , T100agenthup:
+
+ fixes for new forced -c flags
+
+2002-03-05 18:21 hardaker
+
+ * include/net-snmp/agent/snmp_agent.h:
+
+ remove no longer appropriate comment.
+
+2002-03-05 18:20 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ fix duplicate free by cloning the pdu before sending it out again
+ (thought I had done this once in the past already, but I got 1/2 functions).
+
+2002-03-05 18:19 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ Temporary fix to fix for agentx SET requests. This reverses a
+ previous John change where responses to cleanups are now expected
+ again. This took me a good 2 days to track down, sigh...
+
+2002-03-05 18:07 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ - add (ascii) agentx state diagram
+
+2002-03-05 18:07 hardaker
+
+ * agent/snmp_agent.c:
+
+ - multiple free bug fixes.
+ - improved debugging statements.
+
+2002-03-05 10:44 hardaker
+
+ * agent/mibgroup/agentx/: master_request.c , master_request.h:
+
+ removed unused files
+
+2002-03-05 10:31 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - oops, fix bad cut and paste
+
+2002-03-05 10:25 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - reintroduce scope processing (see RFC 2741, p. 66, section 7.2.3.2
+ paragraph 2): "If the subagent can't locate an appropriate
+ variable, __v.name_is_set_to_the_starting_OID__ [the important
+ bit] and the VarBind is set to `endOfMibView'"
+
+2002-03-05 09:54 hardaker
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c:
+
+ impose max length restriction supplied by mib for configuration options.
+
+2002-03-05 08:48 jbpn
+
+ * agent/: agent_index.c , snmp_agent.c ,
+ helpers/debug_handler.c , mibgroup/agentx/master.c:
+
+ - use new DEBUGMSGVAR macro in a few places
+
+2002-03-05 08:45 jbpn
+
+ * snmplib/snmp_debug.c ,
+ include/net-snmp/library/snmp_debug.h:
+
+ - add DEBUGMSGVAR macro to print out a variable
+
+2002-03-05 08:34 hardaker
+
+ * perl/SNMP/: SNMP.pm , SNMP.xs:
+
+ print_value function updates.
+
+2002-03-05 08:05 dts12
+
+ * agent/mibgroup/examples/: ucdDemoPublic.c (V4-2-patches.2),
+ ucdDemoPublic.c:
+
+ Add missing "standard" headers, and tweak a type slightly.
+ (Based on requests from Gregory Toth).
+
+2002-03-05 08:04 jbpn
+
+ * agent/snmp_agent.c:
+
+ - grrr, botched last fix
+
+2002-03-05 08:01 hardaker
+
+ * agent/mibgroup/agentx/subagent.c ,
+ snmplib/snmpCallbackDomain.c:
+
+ Set the default callback session version number to the generic -1
+ version allowing the pdu to passed without version checking.
+
+2002-03-05 07:59 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ move NULL check to *before* you actually use the pointer.
+
+2002-03-05 07:59 jbpn
+
+ * agent/snmp_agent.c:
+
+ - mark INCLUSIVE requests as such
+
+2002-03-05 07:58 hardaker
+
+ * agent/helpers/old_api.c:
+
+ - use a for loop instead of a while loop, just a precaution for future problems.
+
+2002-03-05 07:56 hardaker
+
+ * agent/snmp_agent.c:
+
+ - (snmp_check_parse) allow internal set transactions to be passed to
+ the agent, since agentx sends them.
+
+2002-03-05 07:21 jbpn
+
+ * snmplib/mib.c:
+
+ - don't add the "module ID" to OIDs if it is numeric because we
+ couldn't look it up properly (to avoid horrible looking output
+ like this: "OID: #-1::iso.2.3.4.5.")
+
+2002-03-05 07:05 jbpn
+
+ * configure.in:
+
+ - remove reference to 2c in error message from version prompt
+
+2002-03-05 07:01 jbpn
+
+ * configure.in:
+
+ - remove duplicate tests
+
+2002-03-05 06:51 hardaker
+
+ * configure , configure.in:
+
+ - re-emphasis a suggestion to switch to a secure version of the protocol.
+ - delete notion that v3 without auth/priv provides better security (it doesn't).
+ - Don't accept v2c as an accepted value, as it's used as an int.
+ - but do change help messages, etc, to reflect that 2 = v2c.
+
+2002-03-05 06:50 dts12
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ Cast a calloc appropriately (requested by Gregory Toth)
+
+2002-03-05 06:20 jbpn
+
+ * snmplib/Makefile.in:
+
+ - fix typo in OBJS definition
+
+2002-03-05 06:18 jbpn
+
+ * agent/Makefile.in:
+
+ - clean target depends on $(OBJS) and $(LOBJS), so define them
+
+2002-03-05 03:52 jbpn
+
+ * configure.in:
+
+ - fix default version tests (splitting them over several lines
+ confuses sh on Solaris, at least).
+
+ - disambiguate some instances of "version" in default version
+ prompt text.
+
+2002-03-05 02:34 dts12
+
+ * configure , configure.in:
+
+ Correctly detect when no initial default version has been set.
+ Accept '2c' as well as '2' for a default version choice.
+ Fix the title for this prompt, and reword the description to
+ make it a *slightly* less leading question, m'lud.
+
+ Qn: Should we support a "no default version" option ?
+ (hence allow the admin to force the decision down to the user)
+
+2002-03-04 18:14 hardaker
+
+ * agent/mibgroup/agentx/client.c:
+
+ ucd-snmp -> net-snmp change
+
+2002-03-04 18:10 hardaker
+
+ * agent/agent_handler.c:
+
+ (To John): do not free the myvoid pointer in a handler. You can not
+ assume that it's a freeable resource. For instance, the agentx master
+ agent was using it to store the master session pointer in it (which
+ would exist in multiple registered nodes).
+
+2002-03-04 17:26 hardaker
+
+ * configure.in , include/net-snmp/snmpv3_api.h ,
+ snmplib/Makefile.in:
+
+ use a configure generated wrapper header for v3 security modules.
+
+2002-03-04 11:58 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ add dmalloc.h to the proper place.
+
+2002-03-04 11:53 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ string clean ups.
+
+2002-03-04 11:52 hardaker
+
+ * acconfig.h , aclocal.m4 , configure ,
+ configure.in , include/net-snmp/net-snmp-config.h.in ,
+ include/net-snmp/library/default_store.h ,
+ snmplib/snmp_parse_args.c , snmplib/snmpv3.c:
+
+ Implement a default version prompt for configure.
+ - (Wes ducks as this is currently set to '3' which he may have to
+ change as it hasn't exactly been agreed upon as the proper default yet).
+ - --with-default-snmp-version also created.
+ - changed handling of default store / snmp.conf usage but impact
+ should be low, hopefully.
+
+2002-03-04 11:49 hardaker
+
+ * snmplib/snmp_api.c:
+
+ a few error strings slightly improved. We really need to change the
+ way these are handled to get better improvement.
+
+2002-03-04 07:49 hardaker
+
+ * testing/Makefile.in:
+
+ separate out the cleaning of /tmp from the main cleaning to provide it
+ as a special target.
+
+2002-03-04 07:38 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ -Wall fixes.
+
+2002-03-04 05:32 jbpn
+
+ * man/: snmpbulkget.1.def , snmpbulkwalk.1.def ,
+ snmpget.1.def , snmpgetnext.1.def , snmpstatus.1.def
+ , snmptest.1.def , snmptrap.1.def:
+
+ - remove further instances of positional community string parameter,
+ after Patrick Welche
+
+2002-03-04 05:25 jbpn
+
+ * man/: snmpd.conf.5.def , snmpwalk.1.def:
+
+ - patches from Patrick Welche
+
+2002-03-04 01:16 dts12
+
+ * agent/mibgroup/ucd-snmp/: memory.c (V4-2-patches.6), memory.c:
+
+ Correct debug output message (thanks to Jeroen Ruigrok)
+
+2002-03-01 22:45 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ making the (same) debugging statement more useful.
+
+2002-03-01 22:43 hardaker
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ add missing newline to a debugging statement.
+
+2002-03-01 12:49 hardaker
+
+ * snmplib/: keytools.c , mib.c , snmp_api.c ,
+ snmp_client.c , snmp_parse_args.c , snmpv3.c:
+
+ First pass at a few better error messages.
+
+2002-03-01 12:01 hardaker
+
+ * mibs/Makefile.in:
+
+ don't install headers here.
+
+2002-03-01 05:41 jbpn
+
+ * include/net-snmp/library/mib.h , snmplib/mib.c:
+
+ - add snprint_value, snprint_variable, snprint_objid
+
+2002-02-28 06:54 dts12
+
+ * agent/snmp_vars.c , snmplib/snmpCallbackDomain.c ,
+ win32/libsnmp/libsnmp.dsp , win32/net-snmp/net-snmp-config.h:
+
+ Add back the 'snmpCallback' domain under Windows.
+
+2002-02-27 10:04 jbpn
+
+ * apps/: snmpbulkget.c , snmpbulkwalk.c , snmpget.c
+ , snmpgetnext.c , snmpset.c , snmpstatus.c
+ , snmptable.c , snmptest.c , snmptranslate.c
+ , snmptrap.c , snmpusm.c , snmpwalk.c:
+
+ - tart up usage messages, make them more consistent and bring in line
+ with manual pages
+
+2002-02-27 10:03 jbpn
+
+ * man/: snmpset.1.def , snmptable.1.def , snmptrap.1.def
+ , snmpusm.1.def:
+
+ - minor formatting changes
+
+2002-02-27 10:03 jbpn
+
+ * snmplib/: mib.c , parse.c , snmp_parse_args.c:
+
+ - drop community positional parameter
+
+ - tart up usage messages to be more consistent and in line with manual
+ pages
+
+2002-02-27 09:47 dts12
+
+ * snmplib/: vacm.c (V4-2-patches.4), vacm.c:
+
+ Handle views that specify a full instance OID.
+ (Since the internally stored OID prepends the length as well,
+ the apparent length is one greater than it really is)
+
+2002-02-27 06:50 jbpn
+
+ * apps/snmptrapd.c:
+
+ - [ADDRESSES] -> [LISTENING ADDRESSES] in usage message, to match
+ manual page.
+
+2002-02-27 06:09 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - drop optional positional community parameter from trapsess
+ description.
+
+2002-02-27 05:51 jbpn
+
+ * include/net-snmp/library/mib.h , snmplib/mib.c:
+
+ - drop sprint_blah functions
+
+ - no snprint_blah yet
+
+2002-02-27 05:43 jbpn
+
+ * snmplib/asn1.c:
+
+ - don't use sprint_blah functions
+
+2002-02-27 05:40 jbpn
+
+ * snmplib/snmp_debug.c:
+
+ - don't use sprint_blah functions
+
+ - drop archaic DEBUGP functions
+
+2002-02-27 05:37 dts12
+
+ * agent/mibgroup/host/: hr_storage.c , hr_swrun.c:
+
+ Use the more informative 'output_api.h' header file name
+ (I must have missed these earlier)
+
+2002-02-27 05:35 jbpn
+
+ * man/snmpcmd.1.def:
+
+ - drop community positional parameter
+
+ - yes, for once the documentation has been updated *before* the
+ code!
+
+2002-02-27 05:12 jbpn
+
+ * agent/mibgroup/mibII/ipv6.c:
+
+ - don't use obsolete DEBUGP function
+
+2002-02-27 05:11 jbpn
+
+ * include/net-snmp/library/: snmp_api.h , snmp_debug.h ,
+ system.h:
+
+ - drop archaic DEBUGP functions
+
+2002-02-27 05:10 jbpn
+
+ * include/net-snmp/library/scapi.h:
+
+ - don't use obsolete DEBUGPL function
+
+2002-02-27 04:32 jbpn
+
+ * apps/snmpbulkwalk.c , apps/snmpdelta.c ,
+ apps/snmptable.c , apps/snmpusm.c , apps/snmpwalk.c
+ , agent/agent_index.c , agent/helpers/table.c:
+
+ - don't use sprint_blah functions
+
+2002-02-27 02:26 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - don't use sprint_variable
+
+2002-02-27 02:08 jbpn
+
+ * agent/snmp_agent.c:
+
+ - don't use sprint_variable, no, I MEAN it this time
+
+2002-02-27 02:05 jbpn
+
+ * agent/snmp_agent.c:
+
+ - don't use sprint_variable
+
+2002-02-26 12:46 rstory
+
+ * agent/snmp_agent.c:
+
+ clear new memory after realloc() since realloc doesn't do it.
+
+2002-02-26 12:30 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ add UNSIGNED32
+
+2002-02-26 08:55 jbpn
+
+ * agent/mibgroup/: kernel_sunos5.c , kernel_sunos5.h ,
+ mibII/at.c , mibII/icmp.c , mibII/interfaces.c ,
+ mibII/ip.c , mibII/tcp.c , mibII/udp.c ,
+ mibII/var_route.c:
+
+ - change cache implementation after some interesting profiling (see
+ lengthy new comment in kernel_sunos5.c)
+
+2002-02-26 08:13 dts12
+
+ * agent/helpers/all_helpers.c , agent/helpers/table.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/target/snmpTargetAddrEntry.c ,
+ agent/mibgroup/ucd-snmp/proxy.c , snmplib/snmp-tc.c ,
+ snmplib/ucd_compat.c:
+
+ Remove assorted extraneous ^M's
+
+2002-02-26 07:14 dts12
+
+ * README.win32:
+
+ A quick guide to installing the Core Platform SDK, needed for the Windows agent.
+
+2002-02-26 07:03 dts12
+
+ * agent/agent_trap.c , agent/snmp_vars.c ,
+ agent/snmpd.c , agent/helpers/table_dataset.c ,
+ agent/mibgroup/mibII/system_mib.c ,
+ agent/mibgroup/mibII/udp.c , agent/mibgroup/mibII/vacm_vars.c
+ , apps/snmptrapd_log.c ,
+ include/net-snmp/agent/agent_handler.h ,
+ include/net-snmp/agent/agent_trap.h ,
+ include/net-snmp/agent/table_dataset.h ,
+ include/net-snmp/library/mib.h ,
+ include/net-snmp/library/snmp_enum.h , snmplib/mib.c ,
+ snmplib/snmp_parse_args.c , snmplib/snmpv3.c ,
+ snmplib/winservice.c:
+
+ Assorted minor tweaks to ensure that the project builds under Visual C++.
+ Mostly because VC++ is fussy about sort-of-compatible data types
+ (e.g. signed vs unsigned integers).
+
+2002-02-26 07:00 dts12
+
+ * win32/: mib_module_inits.h , win32.dsw , win32.opt
+ , libagent/libagent.dsp , libsnmp/libsnmp.dsp ,
+ libucdmibs/libucdmibs.dsp , netsnmpmibs/netsnmpmibs.dsp ,
+ snmpd/snmpd.dsp , snmptrapd/snmptrapd.dsp:
+
+ Rename 'libucdmibs' to reflect the change of project name,
+ and assorted tweaks so that the full project builds under Visual C++.
+ (N.B: The agent requires "Microsoft Platform Core SDK" in order
+ to build the 'netsnmpmibs' project)
+
+2002-02-26 06:53 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ remove duplicate variable in a warning
+
+2002-02-26 06:40 jbpn
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - include net-snmp-config.h
+
+2002-02-25 21:09 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ more install changes
+
+2002-02-25 21:08 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ mention installing DBD::File.
+
+2002-02-25 20:38 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ one too many '0's in a url.
+
+2002-02-25 20:33 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ reword.
+
+2002-02-25 20:30 hardaker
+
+ * perl/AnyData_SNMP/Storage.pm:
+
+ move warning outside secondary warning augmentation loop.
+
+2002-02-25 20:29 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ update SQL::Statement module.
+
+2002-02-25 16:25 rstory
+
+ * agent/helpers/table_array.c:
+
+ add find_table_array_handler(); remove debugging code/comments;
+ make sure we have the right handler before using the void pointer;
+ remove ^M characters
+
+2002-02-25 11:57 hardaker
+
+ * snmplib/data_list.c , include/net-snmp/library/data_list.h:
+
+ 2 new functions.
+
+2002-02-25 11:18 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ set security model
+
+2002-02-25 08:15 dts12
+
+ * agent/helpers/all_helpers.c , agent/helpers/old_api.c
+ , agent/helpers/table.c , agent/helpers/table_array.c
+ , agent/helpers/table_dataset.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/target/snmpTargetAddrEntry.c ,
+ agent/mibgroup/ucd-snmp/proxy.c ,
+ include/net-snmp/agent/agent_handler.h ,
+ include/net-snmp/agent/table.h , win32/win32.dsw:
+
+ Continuing improvements to compilation of the latest code under Visual C++.
+ The 'libhelpers' project now compiles, and this also addresses a number
+ of warnings and errors in the libagent and libucdmibs projects.
+ But these two still fail on 'OID_LENGTH' and 'iphlpapi.h'
+
+2002-02-25 07:00 dts12
+
+ * win32/net-snmp/agent/mib_module_config.h:
+
+ Provide a plausible module configuration list for the Windows agent.
+
+2002-02-25 06:04 jbpn
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ - resolve conflicting SYNTAXes for nsTransactionMode
+
+ - add range for index nsTransactionID
+
+2002-02-25 03:23 dts12
+
+ * win32/: libsnmp/libsnmp.dsp , libsnmp_dll/libsnmp_dll.dsp:
+
+ Ensure the main library compiles and works under Windows.
+
+2002-02-25 03:19 dts12
+
+ * apps/: notification_log.h , snmptrapd.c:
+
+ Ensure snmptrapd compiles under Windows.
+
+2002-02-25 03:09 dts12
+
+ * snmplib/: oid_array.c , oid_stash.c , snmp-tc.c ,
+ ucd_compat.c:
+
+ Minor tweaks to keep Visual C++ happy.
+
+2002-02-25 02:57 dts12
+
+ * include/net-snmp/version.h:
+
+ Wrap with "extern C"
+
+2002-02-25 02:56 dts12
+
+ * include/net-snmp/library/cmu_compat.h:
+
+ Pander to CPP's incredibly fussy nature, and provide the correct header file name.
+
+2002-02-25 01:21 dts12
+
+ * agent/: snmpd.c (V4-2-patches.1), snmpd.c:
+
+ Specify the correct debug token for displaying the list of modules
+ (spotted by Brian Shaver)
+
+2002-02-22 10:56 hardaker
+
+ * local/mib2c:
+
+ support @foreach $var1 $var2 enums@
+
+2002-02-22 10:56 hardaker
+
+ * perl/AnyData_SNMP/snmpsh:
+
+ remove trailing ;'s from sql statements.
+
+2002-02-22 10:55 hardaker
+
+ * include/net-snmp/library/tools.h , snmplib/tools.c:
+
+ define netsnmp_strdup_and_null
+
+2002-02-22 10:53 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ include utilities.
+
+2002-02-22 10:51 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ - don't loop again for secondary SET modes and cache information instead.
+ - various fixes.
+
+2002-02-22 10:49 hardaker
+
+ * agent/helpers/Makefile.in:
+
+ fix install directories for headers
+
+2002-02-22 10:49 hardaker
+
+ * net-snmp-config.in:
+
+ add --compile-subagent for automatted subagent compilation from
+ mibmodule .c files ;-)
+
+2002-02-22 09:27 dts12
+
+ * snmplib/: MSG00001.bin, winservice.mc (V4-2-patches.[1,1]),
+ MSG00001.bin , winservice.mc:
+
+ Add missing files for Windows service operation.
+
+2002-02-22 08:55 dts12
+
+ * agent/snmpd.c:
+
+ Just close the main session when shutting down under Windows,
+ not everything (so that it can still generate the shutdown trap).
+
+2002-02-22 08:40 dts12
+
+ * include/net-snmp/types.h ,
+ include/net-snmp/library/snmp_impl.h , snmplib/asn1.c ,
+ snmplib/mib.c , snmplib/parse.c , snmplib/snmp_api.c
+ , snmplib/snmp_enum.c , snmplib/snmpv3.c:
+
+ Tweaks required to get the library compiling under Windows VC++
+
+2002-02-22 08:37 dts12
+
+ * win32/: snmpsm_init.h ,
+ encode_keychange/encode_keychange.dsp ,
+ net-snmp/net-snmp-config.h , libagent/libagent.dsp ,
+ libhelpers/libhelpers.dsp , libsnmp/libsnmp.dsp ,
+ libsnmp_dll/libsnmp_dll.dsp , libucdmibs/libucdmibs.dsp
+ , snmpbulkget/snmpbulkget.dsp ,
+ snmpbulkwalk/snmpbulkwalk.dsp , snmpd/snmpd.dsp ,
+ snmpdelta/snmpdelta.dsp , snmpdf/snmpdf.dsp ,
+ snmpget/snmpget.dsp , snmpgetnext/snmpgetnext.dsp ,
+ snmpnetstat/snmpnetstat.dsp , snmpset/snmpset.dsp ,
+ snmpstatus/snmpstatus.dsp , snmptable/snmptable.dsp ,
+ snmptest/snmptest.dsp , snmptranslate/snmptranslate.dsp
+ , snmptrap/snmptrap.dsp , snmptrapd/snmptrapd.dsp
+ , snmpusm/snmpusm.dsp , snmpvacm/snmpvacm.dsp ,
+ snmpwalk/snmpwalk.dsp:
+
+ Provide Windows-specific versions of automatically-generated header files,
+ and add the new include structure to the project files.
+
+2002-02-22 07:24 dts12
+
+ * include/net-snmp/library/transform_oids.h:
+
+ Define standard OID lengths here (where they're available to any
+ file wanting to access the OID structures)
+
+2002-02-22 03:24 dts12
+
+ * snmplib/: snmp_parse_args.c , snmpv3.c:
+
+ Support ".... -3u {secName} ...." syntax
+ (in the normal getopt style - i.e. no need for surrounding quotes)
+
+ It should now be possible to switch to this as the recommended form
+ for SNMPv3 options - if that's what we want to do.
+ Qn: Do we want to?
+
+2002-02-21 08:39 dts12
+
+ * snmplib/snmpv3.c:
+
+ Support "-3u {secName}" syntax (*with* the quotes, unfortunately).
+ Now comes the fun bit.....
+
+2002-02-21 07:54 dts12
+
+ * win32/snmpd/snmpd.dsp:
+
+ Fix bogus structure comments in the snmpd project file.
+
+2002-02-21 07:30 jbpn
+
+ * agent/mibgroup/: notification/snmpNotifyTable.c ,
+ target/snmpTargetAddrEntry.c:
+
+ - drop inline (more trouble than it is worth)
+
+2002-02-21 05:00 dts12
+
+ * snmplib/: snmp_parse_args.c , snmpv3.c:
+
+ First pass at an SNMPv3 "combined-option" command-line flag (-3x).
+ (In *addition* to the current command-line flags, I hasten to add!)
+
+ Supports "... -3u{secName} ..." and "... -3u={secName} ..." syntax,
+ but not the separate "... -3u {secName} ..." style.
+
+ I haven't touched the documentation or usage message to mention this.
+
+2002-02-20 18:15 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ use for instead of continue for loops.
+
+2002-02-20 13:42 hardaker
+
+ * README.snmpv3 , agent/agent_read_config.c ,
+ agent/snmpd.c , apps/snmptrapd.c ,
+ include/net-snmp/agent/ds_agent.h:
+
+ - Add a --quit option (and a configuration token) so that you can now
+ create new users by simply calling snmpd as:
+ snmpd --createUser="myuser MD5 mypassword" --quit
+ - Change README.snmpv3 documentation to make use of this feature.
+
+2002-02-20 06:16 jbpn
+
+ * apps/Makefile.in , apps/snmptrapd.c , configure
+ , configure.in , agent/snmp_agent.c:
+
+ - add libwrap support to snmptrapd (untested)
+
+ - minor changes to snmpd libwrap support
+
+ - configure fixes for libwrap
+
+2002-02-20 03:07 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - use calloc instead of malloc to make sure buffer is initially
+ zero-terminated (in case of 0 varbinds). Bug #518700, noted by
+ Andreas Hartmann.
+
+2002-02-20 03:06 jbpn
+
+ * apps/snmpdelta.c:
+
+ - initialise some buffers, to avoid garbage printing problems, as
+ noted by Anonymous in bug #520220.
+
+2002-02-20 03:03 dts12
+
+ * apps/Makefile.in:
+
+ Clean up the object files as well
+
+2002-02-20 01:41 dts12
+
+ * man/.cvsignore:
+
+ Ignore the new crop of generated man pages.
+
+2002-02-20 01:37 dts12
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ Supply missing double-quote (oops)
+
+2002-02-19 04:01 dts12
+
+ * apps/snmptranslate.c:
+
+ Initialise the library internals *before* parsing the command line,
+ so that defaults can be overridden by command line options.
+ Qn: Should '_init_snmp' be invoked by 'snmp_parse_args' itself?
+
+2002-02-19 03:59 dts12
+
+ * snmplib/mib.c:
+
+ Make sure that multiple output format flags work in a consistent manner.
+ (i.e. the last one is used, rather than relying on internal ordering).
+
+2002-02-18 21:58 hardaker
+
+ * agent/mibgroup/: testdelayed.c , testhandler.c:
+
+ include stdlib.h
+
+2002-02-18 21:52 hardaker
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ fix includes
+
+2002-02-18 21:51 hardaker
+
+ * agent/helpers/table_iterator.c ,
+ include/net-snmp/agent/table_iterator.h:
+
+ - make capability to create data contexts from a loop context (less
+ mallocs when mallocs aren't otherwise avoidable).
+ - don't double free the data context pointer.
+
+2002-02-18 21:50 hardaker
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ include all agent helpers.
+
+2002-02-18 21:49 hardaker
+
+ * include/net-snmp/agent/multiplexer.h:
+
+ protect include from double include
+
+2002-02-18 08:38 hardaker
+
+ * agent/mibgroup/mibincl.h:
+
+ fix include paths
+
+2002-02-18 02:35 dts12
+
+ * agent/Makefile.in , snmplib/Makefile.in:
+
+ Tweak the list of header files to be installed (thanks to Christoph Mammitzsch)
+
+2002-02-18 02:29 dts12
+
+ * agent/mibgroup/host/: hr_storage.c (V4-2-patches.7), hr_storage.c:
+
+ Remove a couple of unhelpful OSF definitions (thanks to Jeroen Ruigrok)
+
+2002-02-18 00:13 hardaker
+
+ * snmplib/: asn1.c (V4-2-patches.3), asn1.c:
+
+ don't build oid's with >128 length subids. (see bug #518855)
+
+2002-02-16 23:18 hardaker
+
+ * mibs/: NET-SNMP-MIB.txt , NET-SNMP-MONITOR-MIB.txt ,
+ NET-SNMP-SYSTEM-MIB.txt , NET-SNMP-TC.txt:
+
+ white space clean up. (AGENT-MIB not checked in due to other
+ incomplete changes).
+
+2002-02-16 00:17 hardaker
+
+ * NEWS , agent/snmpd.c , apps/snmptrapd.c ,
+ include/net-snmp/library/default_store.h ,
+ include/net-snmp/library/read_config.h , snmplib/read_config.c
+ , snmplib/snmp_parse_args.c:
+
+ - finish implementing snmp_config("my config line")
+ - was done before, but previously had to be called only after
+ configuration files had been read. Now can be called at any time.
+ - make all configuration options available as --longopts command line options.
+ - --something=value -> "something value"
+ - --something -> "something 1" (works for setting booleans to true)
+
+2002-02-16 00:02 hardaker
+
+ * agent/Makefile.in:
+
+ install mib_module_config.h
+
+2002-02-16 00:01 hardaker
+
+ * configure , configure.in:
+
+ fix rpm for 4.0.3 and above (or whenever it was that we now need librpmdb)
+
+2002-02-16 00:01 hardaker
+
+ * Makefile.in , Makefile.rules:
+
+ fix net-snmp-config install/clean/etc.
+
+2002-02-15 22:34 hardaker
+
+ * Makefile.in , Makefile.rules:
+
+ install all system and machine files, since they include each other
+
+2002-02-15 09:28 dts12
+
+ * agent/mibgroup/agent/nsTransactionTable.c ,
+ mibs/NET-SNMP-AGENT-MIB.txt , mibs/NET-SNMP-MIB.txt ,
+ mibs/NET-SNMP-MONITOR-MIB.txt , mibs/NET-SNMP-SYSTEM-MIB.txt
+ , mibs/NET-SNMP-TC.txt:
+
+ Skeleton framework for the Net-SNMP enterprise tree.
+ (incorporating the initial 'nsTransactionTable', but nothing else as yet)
+
+2002-02-15 09:10 dts12
+
+ * apps/snmptable.c , apps/snmptranslate.c ,
+ snmplib/snmp_parse_args.c:
+
+ Remove support for deprecated command-line options.
+
+2002-02-15 07:28 dts12
+
+ * include/net-snmp/library/winservice.h , snmplib/winservice.c
+ , agent/snmpd.c , snmplib/Makefile.in ,
+ snmplib/winservice.rc , win32/snmpd/snmpd.dsp:
+
+ Support for running as a Windows service.
+ (Supplied by Raju Krishnappa & Lathu Prabhu)
+
+2002-02-15 07:25 dts12
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ Stoke Wes' sense of paranoia by conceding without comment.
+ (What might Shield be plotting now......)
+
+2002-02-15 07:19 jbpn
+
+ * man/snmpusm.1.def:
+
+ - fix tiny formatting error
+
+2002-02-15 07:17 dts12
+
+ * mibs/Makefile.in:
+
+ Install NOTIFICATION-LOG-MIB (since it's one of the default load list!)
+
+2002-02-15 06:47 dts12
+
+ * snmplib/winservice.h:
+
+ file winservice.h was initially added on branch V4-2-patches.
+
+2002-02-15 06:47 dts12
+
+ * snmplib/winservice.rc:
+
+ file winservice.rc was initially added on branch V4-2-patches.
+
+2002-02-15 06:47 dts12
+
+ * snmplib/winservice.c:
+
+ file winservice.c was initially added on branch V4-2-patches.
+
+2002-02-15 06:08 dts12
+
+ * include/net-snmp/types.h:
+
+ Include the <sys/time.h> cascade, to pick up the definition of 'timeval'
+
+2002-02-15 04:29 jbpn
+
+ * agent/snmpd.c:
+
+ - minor change to bring usage message in line with manpage
+
+2002-02-15 03:29 dts12
+
+ * snmplib/snmp_parse_args.c:
+
+ Catch use of the transport and port options, and issue an appropriate
+ error message, describing use of the <hostname> parameter instead.
+
+2002-02-15 03:11 dts12
+
+ * snmplib/: mib.c , snmp_api.c:
+
+ Set the default output format *before* processing command line options,
+ rather than after. That's probably a bit more flexible:-)
+
+2002-02-15 02:37 dts12
+
+ * include/net-snmp/: config_api.h , definitions.h ,
+ mib_api.h , output_api.h , pdu_api.h , session_api.h
+ , snmpv3_api.h , types.h , utilities.h ,
+ varbind_api.h:
+
+ Remove 'net-snmp-config.h' from the main API header files.
+ This will have to be #included separately (either explicitly
+ or via the all-in-one 'net-snmp-includes.h' header)
+
+2002-02-15 02:31 dts12
+
+ * snmplib/Makefile.in:
+
+ Install the README to describe the status of <net-snmp/library> and <net-snmp> header files.
+
+2002-02-15 02:13 dts12
+
+ * man/Makefile.in , mibs/Makefile.in:
+
+ Install the {system,machine}/*.h header files as well.
+
+ Doing this via the 'man' & 'mibs' Makefiles is a gross hack,
+ and really needs to be handled more cleanly. But it's the
+ best I can come up with at the moment. Sorry - Dave.
+
+2002-02-15 01:59 dts12
+
+ * snmplib/Makefile.in , agent/Makefile.in:
+
+ Install the UCD-compatability headers as well.
+
+2002-02-15 01:57 dts12
+
+ * Makefile.rules:
+
+ Only install subdirectory stuff *once*. (Don't be so enthusiastic, Dave!)
+
+2002-02-15 01:31 dts12
+
+ * README.snmpv3:
+
+ Remove redundent '-CN' and '-CO' options from the example snmpusm command.
+ (as mentioned by Wes on the users mailing list 2002-02-13)
+ Qn: Does this need to be done on the V4-2-patches branch as well?
+
+2002-02-15 01:15 dts12
+
+ * include/net-snmp/utilities.h , include/net-snmp/version.h
+ , include/net-snmp/library/version.h ,
+ include/ucd-snmp/version.h , snmplib/snmp_parse_args.c ,
+ snmplib/snmp_version.c:
+
+ Restore 'version.h' as being a "top-level" header file.
+
+2002-02-15 01:13 dts12
+
+ * snmplib/Makefile.in:
+
+ Install the full set of library header files,
+ retaining the top-level vs library subdirectory split.
+
+2002-02-15 01:10 dts12
+
+ * configure , configure.in:
+
+ Look for transport-related header files in the correct location.
+
+2002-02-15 01:09 dts12
+
+ * Makefile.rules:
+
+ Ensure partial install targets recurse properly.
+
+2002-02-14 08:18 dts12
+
+ * testing/eval_tools.sh:
+
+ Look for mib_module_config.h in the correct location
+
+2002-02-14 08:06 hardaker
+
+ * man/Makefile.in:
+
+ fix man8 install definitions
+
+2002-02-14 07:48 dts12
+
+ * Makefile.rules , net-snmp-config.in:
+
+ Substitute values into 'net-snmp-config' properly, and don't 'make clean' it away.
+
+2002-02-14 07:22 dts12
+
+ * man/Makefile.in:
+
+ Tidy up after moving the library header files
+
+2002-02-14 07:14 dts12
+
+ * configure , configure.in:
+
+ Tidy up after moving the library header files (including Makefile dependencies)
+
+2002-02-14 07:10 dts12
+
+ * include/net-snmp/agent/agent_registry.h ,
+ snmplib/Makefile.depend , snmplib/default_store.c ,
+ snmplib/read_config.c , snmplib/snmp_debug.c ,
+ snmplib/snmp_logging.c , snmplib/snmp_parse_args.c ,
+ snmplib/system.c , snmplib/tools.c ,
+ agent/Makefile.depend , apps/Makefile.depend ,
+ apps/snmpbulkget.c , apps/snmpget.c , apps/snmpstatus.c
+ , apps/snmptranslate.c ,
+ apps/snmpnetstat/Makefile.depend , apps/snmpnetstat/main.c
+ , include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/snmp_vars.h ,
+ include/net-snmp/agent/table_array.h ,
+ include/net-snmp/library/data_list.h ,
+ include/net-snmp/library/oid_array.h ,
+ include/net-snmp/library/snmpAAL5PVCDomain.h ,
+ include/net-snmp/library/snmpCallbackDomain.h ,
+ include/net-snmp/library/snmpIPXDomain.h ,
+ include/net-snmp/library/snmpTCPDomain.h ,
+ include/net-snmp/library/snmpTCPIPv6Domain.h ,
+ include/net-snmp/library/snmpUDPDomain.h ,
+ include/net-snmp/library/snmpUDPIPv6Domain.h ,
+ include/net-snmp/library/snmpUnixDomain.h ,
+ include/net-snmp/library/snmp_transport.h , agent/agent_trap.c
+ , agent/helpers/Makefile.depend ,
+ agent/mibgroup/Makefile.depend , agent/mibgroup/host_res.h
+ , agent/mibgroup/mibII/vacm_vars.h ,
+ agent/mibgroup/snmpv3/usmUser.h:
+
+ Tidy up after moving the library header files (including Makefile dependencies)
+
+2002-02-14 07:08 dts12
+
+ * agent/helpers/Makefile.in:
+
+ Remove an extraneous space from CPPFLAGS
+
+2002-02-14 06:23 dts12
+
+ * include/net-snmp/: config_api.h , definitions.h ,
+ mib_api.h , net-snmp-includes.h , output_api.h ,
+ pdu_api.h , session_api.h , snmpv3_api.h , types.h
+ , utilities.h , varbind_api.h:
+
+ Separate out top-level "public API" library header files from the "internal"
+ library header files. These are still available for use by application
+ developers, but this split makes it clearer what may change in the future
+ and what can be relied upon to be stable.
+
+2002-02-14 06:19 dts12
+
+ * include/net-snmp/asn1.h , include/net-snmp/callback.h ,
+ include/net-snmp/cmu_compat.h , include/net-snmp/data_list.h
+ , include/net-snmp/default_store.h ,
+ include/net-snmp/getopt.h , include/net-snmp/int64.h ,
+ include/net-snmp/keytools.h , include/net-snmp/lcd_time.h
+ , include/net-snmp/libsnmp.h , include/net-snmp/md5.h
+ , include/net-snmp/mib.h , include/net-snmp/mt_support.h
+ , include/net-snmp/oid_array.h ,
+ include/net-snmp/oid_stash.h , include/net-snmp/parse.h ,
+ include/net-snmp/read_config.h , include/net-snmp/scapi.h
+ , include/net-snmp/snmp-tc.h , include/net-snmp/snmp.h
+ , include/net-snmp/snmpAAL5PVCDomain.h ,
+ include/net-snmp/snmpCallbackDomain.h ,
+ include/net-snmp/snmpIPXDomain.h ,
+ include/net-snmp/snmpTCPDomain.h ,
+ include/net-snmp/snmpTCPIPv6Domain.h ,
+ include/net-snmp/snmpUDPDomain.h ,
+ include/net-snmp/snmpUDPIPv6Domain.h ,
+ include/net-snmp/snmpUnixDomain.h ,
+ include/net-snmp/snmp_alarm.h , include/net-snmp/snmp_api.h
+ , include/net-snmp/snmp_client.h ,
+ include/net-snmp/snmp_debug.h , include/net-snmp/snmp_enum.h
+ , include/net-snmp/snmp_impl.h ,
+ include/net-snmp/snmp_locking.h ,
+ include/net-snmp/snmp_logging.h ,
+ include/net-snmp/snmp_parse_args.h ,
+ include/net-snmp/snmp_secmod.h ,
+ include/net-snmp/snmp_transport.h , include/net-snmp/snmpksm.h
+ , include/net-snmp/snmpusm.h , include/net-snmp/snmpv3.h
+ , include/net-snmp/system.h , include/net-snmp/tools.h
+ , include/net-snmp/transform_oids.h ,
+ include/net-snmp/ucd_compat.h , include/net-snmp/vacm.h ,
+ include/net-snmp/version.h , include/net-snmp/library/README
+ , include/net-snmp/library/asn1.h ,
+ include/net-snmp/library/callback.h ,
+ include/net-snmp/library/cmu_compat.h ,
+ include/net-snmp/library/data_list.h ,
+ include/net-snmp/library/default_store.h ,
+ include/net-snmp/library/getopt.h ,
+ include/net-snmp/library/int64.h ,
+ include/net-snmp/library/keytools.h ,
+ include/net-snmp/library/lcd_time.h ,
+ include/net-snmp/library/libsnmp.h ,
+ include/net-snmp/library/md5.h ,
+ include/net-snmp/library/mib.h ,
+ include/net-snmp/library/mt_support.h ,
+ include/net-snmp/library/oid_array.h ,
+ include/net-snmp/library/oid_stash.h ,
+ include/net-snmp/library/parse.h ,
+ include/net-snmp/library/read_config.h ,
+ include/net-snmp/library/scapi.h ,
+ include/net-snmp/library/snmp-tc.h ,
+ include/net-snmp/library/snmp.h ,
+ include/net-snmp/library/snmpAAL5PVCDomain.h ,
+ include/net-snmp/library/snmpCallbackDomain.h ,
+ include/net-snmp/library/snmpIPXDomain.h ,
+ include/net-snmp/library/snmpTCPDomain.h ,
+ include/net-snmp/library/snmpTCPIPv6Domain.h ,
+ include/net-snmp/library/snmpUDPDomain.h ,
+ include/net-snmp/library/snmpUDPIPv6Domain.h ,
+ include/net-snmp/library/snmpUnixDomain.h ,
+ include/net-snmp/library/snmp_alarm.h ,
+ include/net-snmp/library/snmp_api.h ,
+ include/net-snmp/library/snmp_client.h ,
+ include/net-snmp/library/snmp_debug.h ,
+ include/net-snmp/library/snmp_enum.h ,
+ include/net-snmp/library/snmp_impl.h ,
+ include/net-snmp/library/snmp_locking.h ,
+ include/net-snmp/library/snmp_logging.h ,
+ include/net-snmp/library/snmp_parse_args.h ,
+ include/net-snmp/library/snmp_secmod.h ,
+ include/net-snmp/library/snmp_transport.h ,
+ include/net-snmp/library/snmpksm.h ,
+ include/net-snmp/library/snmpusm.h ,
+ include/net-snmp/library/snmpv3.h ,
+ include/net-snmp/library/system.h ,
+ include/net-snmp/library/tools.h ,
+ include/net-snmp/library/transform_oids.h ,
+ include/net-snmp/library/ucd_compat.h ,
+ include/net-snmp/library/vacm.h ,
+ include/net-snmp/library/version.h , include/ucd-snmp/asn1.h
+ , include/ucd-snmp/callback.h ,
+ include/ucd-snmp/default_store.h , include/ucd-snmp/int64.h
+ , include/ucd-snmp/keytools.h , include/ucd-snmp/mib.h
+ , include/ucd-snmp/mibincl.h , include/ucd-snmp/parse.h
+ , include/ucd-snmp/read_config.h ,
+ include/ucd-snmp/scapi.h , include/ucd-snmp/snmp-tc.h ,
+ include/ucd-snmp/snmp.h , include/ucd-snmp/snmp_alarm.h ,
+ include/ucd-snmp/snmp_api.h , include/ucd-snmp/snmp_client.h
+ , include/ucd-snmp/snmp_debug.h ,
+ include/ucd-snmp/snmp_impl.h , include/ucd-snmp/snmp_logging.h
+ , include/ucd-snmp/snmp_parse_args.h ,
+ include/ucd-snmp/snmp_vars.h , include/ucd-snmp/snmpusm.h
+ , include/ucd-snmp/snmpv3.h , include/ucd-snmp/system.h
+ , include/ucd-snmp/tools.h ,
+ include/ucd-snmp/transform_oids.h , include/ucd-snmp/version.h
+ , snmplib/asn1.c , snmplib/callback.c ,
+ snmplib/data_list.c , snmplib/default_store.c ,
+ snmplib/int64.c , snmplib/keytools.c ,
+ snmplib/lcd_time.c , snmplib/md5.c , snmplib/mib.c
+ , snmplib/mt_support.c , snmplib/oid_array.c ,
+ snmplib/oid_stash.c , snmplib/parse.c ,
+ snmplib/read_config.c , snmplib/scapi.c ,
+ snmplib/snmp-tc.c , snmplib/snmp.c ,
+ snmplib/snmpAAL5PVCDomain.c , snmplib/snmpCallbackDomain.c
+ , snmplib/snmpIPXDomain.c , snmplib/snmpTCPDomain.c
+ , snmplib/snmpTCPIPv6Domain.c , snmplib/snmpUDPDomain.c
+ , snmplib/snmpUDPIPv6Domain.c ,
+ snmplib/snmpUnixDomain.c , snmplib/snmp_alarm.c ,
+ snmplib/snmp_api.c , snmplib/snmp_auth.c ,
+ snmplib/snmp_client.c , snmplib/snmp_debug.c ,
+ snmplib/snmp_enum.c , snmplib/snmp_logging.c ,
+ snmplib/snmp_parse_args.c , snmplib/snmp_secmod.c ,
+ snmplib/snmp_transport.c , snmplib/snmp_version.c ,
+ snmplib/snmpksm.c , snmplib/snmpusm.c , snmplib/snmpv3.c
+ , snmplib/system.c , snmplib/tools.c ,
+ snmplib/vacm.c:
+
+ Separate out top-level "public API" library header files from the "internal"
+ library header files. These are still available for use by application
+ developers, but this split makes it clearer what may change in the future
+ and what can be relied upon to be stable.
+
+2002-02-14 04:41 dts12
+
+ * include/net-snmp/definitions.h ,
+ include/net-snmp/net-snmp-config.h.in ,
+ include/net-snmp/output_api.h , include/net-snmp/snmp_impl.h
+ , include/net-snmp/snmpv3_api.h , snmplib/asn1.c ,
+ snmplib/callback.c , snmplib/default_store.c ,
+ snmplib/int64.c , snmplib/keytools.c ,
+ snmplib/lcd_time.c , snmplib/md5.c , snmplib/mib.c
+ , snmplib/oid_stash.c , snmplib/parse.c ,
+ snmplib/read_config.c , snmplib/scapi.c ,
+ snmplib/snmp-tc.c , snmplib/snmp.c ,
+ snmplib/snmpAAL5PVCDomain.c , snmplib/snmpCallbackDomain.c
+ , snmplib/snmpIPXDomain.c , snmplib/snmpTCPDomain.c
+ , snmplib/snmpTCPIPv6Domain.c , snmplib/snmpUDPDomain.c
+ , snmplib/snmpUDPIPv6Domain.c ,
+ snmplib/snmpUnixDomain.c , snmplib/snmp_alarm.c ,
+ snmplib/snmp_api.c , snmplib/snmp_auth.c ,
+ snmplib/snmp_client.c , snmplib/snmp_debug.c ,
+ snmplib/snmp_logging.c , snmplib/snmp_parse_args.c ,
+ snmplib/snmp_secmod.c , snmplib/snmp_transport.c ,
+ snmplib/snmpksm.c , snmplib/snmpusm.c , snmplib/snmpv3.c
+ , snmplib/system.c , snmplib/tools.c ,
+ snmplib/vacm.c:
+
+ First moves towards using the "public" API header files in the library
+ code as well (concentrating on output/config/utility header files).
+
+2002-02-14 03:17 dts12
+
+ * configure , configure.in:
+
+ Close a dangling "if" block. (oops!)
+
+2002-02-14 01:47 dts12
+
+ * apps/snmpnetstat/: if.c (V4-2-patches.4), if.c:
+
+ Check for running off the end of I/F table (patch from RedHat)
+
+2002-02-14 01:43 dts12
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ Latest RedHat rpm-related patch
+
+2002-02-14 01:39 dts12
+
+ * configure , configure.in:
+
+ Adopt RedHat's configure testing for RPM libraries
+
+2002-02-13 08:39 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Make John trust his code
+
+2002-02-13 08:34 jbpn
+
+ * perl/SNMP/SNMP.xs:
+
+ - transport fixes (untested, still #if 0)
+
+2002-02-13 08:03 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ mark some John-to-do-sections
+
+2002-02-13 07:57 dts12
+
+ * include/net-snmp/default_store.h , man/snmpcmd.1.def ,
+ snmplib/mib.c:
+
+ Switch to using -OS style output by default, and drop the requirement
+ for full OIDs to start with '.', plus command-line options to restore
+ the original UCD-style behaviour.
+
+2002-02-13 07:36 dts12
+
+ * apps/snmptable.c:
+
+ Apply John's fix for bugs #489336 and #508146 (duplicate columns and
+ columns in wrong order) to the main branch as well.
+
+2002-02-12 16:40 hardaker
+
+ * snmplib/snmp_client.c:
+
+ const changes.
+
+2002-02-12 16:39 hardaker
+
+ * perl/: .cvsignore , ASN/.cvsignore , agent/.cvsignore
+ , default_store/.cvsignore:
+
+ add .cvsignore file.
+
+2002-02-12 16:38 hardaker
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ add agent/agent_handler.h
+
+2002-02-12 16:38 hardaker
+
+ * include/net-snmp/snmp_client.h:
+
+ const additions.
+
+2002-02-12 16:37 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ Add string.h
+
+2002-02-12 16:37 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ add header.
+
+2002-02-12 16:37 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ fixes to reenable disman event stuff for 5.0 code. Not done the
+ "right" way, but it works.
+
+2002-02-12 16:36 hardaker
+
+ * agent/helpers/old_api.c:
+
+ - -Wall fixes
+
+2002-02-12 16:36 hardaker
+
+ * agent/helpers/instance.c:
+
+ - add stdlib.h
+ - remove unused variable.
+
+2002-02-12 16:35 hardaker
+
+ * agent/snmp_agent.c:
+
+ remove no longer used "dump_var" routine.
+
+2002-02-12 16:35 hardaker
+
+ * agent/agent_handler.c ,
+ include/net-snmp/agent/agent_handler.h:
+
+ const specific changes.
+
+2002-02-12 16:34 hardaker
+
+ * NEWS:
+
+ added new perl specific features.
+
+2002-02-12 16:34 hardaker
+
+ * Makefile.in:
+
+ .PHNOY mods
+
+2002-02-12 07:22 dts12
+
+ * agent/Makefile.depend , apps/Makefile.depend ,
+ apps/snmptranslate.c , apps/snmptrapd_handlers.c ,
+ apps/snmpnetstat/Makefile.depend ,
+ include/net-snmp/net-snmp-includes.h ,
+ include/net-snmp/logging_api.h , include/net-snmp/output_api.h:
+
+ Rename the logging & related output API header file, to better
+ reflect the scope of this API. (As suggested by Wes & John)
+
+2002-02-12 07:21 jbpn
+
+ * configure.in:
+
+ - amend fix to bug #516389 (ucd-snmp 4.2.3 libwrap support broken) to
+ actually add -lnsl to link parameters!
+
+2002-02-12 05:39 jbpn
+
+ * configure.in:
+
+ - fix bug #516389 (ucd-snmp 4.2.3 libwrap support broken) -- USE_LIBWRAP
+ was not being #defined in the case where -lnsl is needed in addition
+ to -lwrap.
+
+2002-02-11 15:56 hardaker
+
+ * agent/Makefile.in:
+
+ lib dependency fix for snmpd target
+
+2002-02-11 08:29 dts12
+
+ * include/net-snmp/cmu_compat.h , include/net-snmp/mib.h
+ , include/net-snmp/mib_api.h ,
+ include/net-snmp/net-snmp-includes.h ,
+ include/net-snmp/parse.h , include/net-snmp/session_api.h
+ , include/net-snmp/snmp.h , include/net-snmp/snmp_api.h
+ , include/net-snmp/snmp_impl.h ,
+ include/net-snmp/ucd_compat.h , snmplib/cmu_compat.c ,
+ snmplib/Makefile.in , snmplib/mib.c , snmplib/parse.c
+ , snmplib/snmp_api.c , snmplib/ucd_compat.c:
+
+ Extract CMU_COMPATABILITY code, and explicitly deprecated UCD code into separate files.
+
+2002-02-11 08:23 dts12
+
+ * snmplib/: snmp_parse_args.c (V4-2-patches.2), snmp_parse_args.c:
+
+ Use the 'ds_set_xxx' library routines, rather than the old 'snmp_set_xxx' calls
+
+2002-02-11 04:45 jbpn
+
+ * man/: snmp.conf.5.def , snmp_config.5.def ,
+ snmptrapd.conf.5.def:
+
+ minor spelling tweaks
+
+2002-02-11 04:27 jbpn
+
+ * man/: Makefile.in , default_store.3.top , mib_api.3
+ , mib_api.3.def , snmp_agent_api.3 ,
+ snmp_agent_api.3.def , snmp_alarm.3 , snmp_alarm.3.def
+ , snmp_api.3 , snmp_api.3.def , snmp_sess_api.3
+ , snmp_sess_api.3.def , snmp_trap_api.3 ,
+ snmp_trap_api.3.def , variables.5 , variables.5.def:
+
+ - generate the rest of the manual pages (to get version in footer)
+
+2002-02-08 15:56 hardaker
+
+ * win32/: config.h , mib_module_config.h ,
+ mib_module_inits.h , libsnmp/libsnmp.dsp ,
+ libsnmp_dll/libsnmp.def , libsnmp_dll/libsnmp_dll.dsp ,
+ libucdmibs/libucdmibs.dsp , snmpd/snmpd.dsp:
+
+ win32 specific portions of patch 503256
+
+2002-02-08 15:53 hardaker
+
+ * win32/libhelpers/libhelpers.dsp:
+
+ patch#503256: helpers library definition for win32
+
+2002-02-08 09:08 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - minor format tweakage
+
+2002-02-08 08:22 dts12
+
+ * man/: mib_api.3 , snmp_agent_api.3 , snmp_alarm.3
+ , snmp_api.3 , snmp_sess_api.3 , snmp_trap_api.3:
+
+ Reference the new header-files in section 3 man page synopses.
+
+2002-02-08 07:50 jbpn
+
+ * man/: mib_api.3 , read_config.3.def , snmp_agent_api.3
+ , snmp_config.5.def , snmp_trap_api.3 ,
+ snmpcmd.1.def , snmpconf.1.def , snmpd.conf.5.def ,
+ variables.5:
+
+ - more minor tweaks (ucd-snmp -> Net-SNMP etc.)
+
+2002-02-08 07:48 hardaker
+
+ * agent/Makefile.depend:
+
+ remove local modules from dependency list
+
+2002-02-08 07:45 dts12
+
+ * agent/: agent_handler.c , agent_index.c ,
+ agent_read_config.c , agent_registry.c , agent_trap.c
+ , auto_nlist.c , kernel.c , mib_modules.c ,
+ snmp_agent.c , snmp_vars.c , snmpd.c ,
+ helpers/bulk_to_next.c , helpers/debug_handler.c ,
+ helpers/instance.c , helpers/multiplexer.c ,
+ helpers/null.c , helpers/old_api.c , helpers/read_only.c
+ , helpers/serialize.c , helpers/table.c ,
+ helpers/table_array.c , helpers/table_data.c ,
+ helpers/table_dataset.c , helpers/table_iterator.c ,
+ mibgroup/header_complex.c , mibgroup/kernel_sunos5.c ,
+ mibgroup/testdelayed.c , mibgroup/testhandler.c ,
+ mibgroup/util_funcs.c , mibgroup/Rmon/agutil.c ,
+ mibgroup/Rmon/alarm.c , mibgroup/Rmon/event.c ,
+ mibgroup/Rmon/history.c , mibgroup/Rmon/rows.c ,
+ mibgroup/Rmon/statistics.c ,
+ mibgroup/agent/nsTransactionTable.c ,
+ mibgroup/agentx/agentx_config.c , mibgroup/agentx/client.c
+ , mibgroup/agentx/master.c ,
+ mibgroup/agentx/master_admin.c ,
+ mibgroup/agentx/master_request.c , mibgroup/agentx/protocol.c
+ , mibgroup/agentx/subagent.c ,
+ mibgroup/disman/mteObjectsTable.c ,
+ mibgroup/disman/mteTriggerBooleanTable.c ,
+ mibgroup/disman/mteTriggerDeltaTable.c ,
+ mibgroup/disman/mteTriggerExistenceTable.c ,
+ mibgroup/disman/mteTriggerTable.c ,
+ mibgroup/disman/mteTriggerThresholdTable.c ,
+ mibgroup/examples/example.c ,
+ mibgroup/examples/ucdDemoPublic.c ,
+ mibgroup/host/hr_filesys.c , mibgroup/host/hr_storage.c
+ , mibgroup/host/hr_swinst.c , mibgroup/host/hr_swrun.c
+ , mibgroup/host/hr_system.c , mibgroup/mibII/at.c
+ , mibgroup/mibII/icmp.c , mibgroup/mibII/interfaces.c
+ , mibgroup/mibII/ip.c , mibgroup/mibII/ipAddr.c ,
+ mibgroup/mibII/ipv6.c , mibgroup/mibII/kernel_linux.c ,
+ mibgroup/mibII/mta_sendmail.c , mibgroup/mibII/route_write.c
+ , mibgroup/mibII/snmp_mib.c ,
+ mibgroup/mibII/sysORTable.c , mibgroup/mibII/system_mib.c
+ , mibgroup/mibII/tcp.c , mibgroup/mibII/tcpTable.c
+ , mibgroup/mibII/udp.c , mibgroup/mibII/udpTable.c
+ , mibgroup/mibII/vacm_context.c ,
+ mibgroup/mibII/vacm_vars.c , mibgroup/mibII/var_route.c
+ , mibgroup/misc/dlmod.c , mibgroup/misc/ipfwacc.c
+ , mibgroup/notification/snmpNotifyFilterProfileTable.c ,
+ mibgroup/notification/snmpNotifyFilterTable.c ,
+ mibgroup/notification/snmpNotifyTable.c ,
+ mibgroup/smux/smux.c , mibgroup/smux/snmp_bgp.c ,
+ mibgroup/smux/snmp_ospf.c , mibgroup/smux/snmp_rip2.c ,
+ mibgroup/snmpv3/snmpEngine.c , mibgroup/snmpv3/snmpMPDStats.c
+ , mibgroup/snmpv3/usmStats.c ,
+ mibgroup/snmpv3/usmUser.c ,
+ mibgroup/target/snmpTargetAddrEntry.c ,
+ mibgroup/target/snmpTargetParamsEntry.c ,
+ mibgroup/target/target.c , mibgroup/target/target_counters.c
+ , mibgroup/tunnel/tunnel.c , mibgroup/ucd-snmp/disk.c
+ , mibgroup/ucd-snmp/diskio.c , mibgroup/ucd-snmp/dlmod.c
+ , mibgroup/ucd-snmp/errormib.c ,
+ mibgroup/ucd-snmp/extensible.c , mibgroup/ucd-snmp/file.c
+ , mibgroup/ucd-snmp/hpux.c ,
+ mibgroup/ucd-snmp/lmSensors.c , mibgroup/ucd-snmp/loadave.c
+ , mibgroup/ucd-snmp/logmatch.c ,
+ mibgroup/ucd-snmp/memory.c , mibgroup/ucd-snmp/memory_dynix.c
+ , mibgroup/ucd-snmp/memory_freebsd2.c ,
+ mibgroup/ucd-snmp/memory_netbsd1.c ,
+ mibgroup/ucd-snmp/memory_solaris2.c ,
+ mibgroup/ucd-snmp/pass.c , mibgroup/ucd-snmp/pass_persist.c
+ , mibgroup/ucd-snmp/proc.c , mibgroup/ucd-snmp/proxy.c
+ , mibgroup/ucd-snmp/registry.c ,
+ mibgroup/ucd-snmp/versioninfo.c , mibgroup/ucd-snmp/vmstat.c
+ , mibgroup/ucd-snmp/vmstat_bsdi4.c ,
+ mibgroup/ucd-snmp/vmstat_dynix.c ,
+ mibgroup/ucd-snmp/vmstat_freebsd2.c ,
+ mibgroup/ucd-snmp/vmstat_netbsd1.c ,
+ mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ Use the new 'net-snmp-includes' single-include header files,
+ in place of the (uninstalled) 'mibincl.h'.
+ Wheeeee......
+
+2002-02-08 07:17 jbpn
+
+ * man/: snmp.conf.5.def , snmp_agent_api.3 ,
+ snmp_alarm.3 , snmp_api.3 , snmp_config.5.def ,
+ snmp_sess_api.3 , snmpd.1.def , snmpd.conf.5.def ,
+ snmptrapd.conf.5.def:
+
+ - some editing to make style consistent, add some missing options,
+ change ucd-snmp to Net-SNMP and things like that.
+
+2002-02-08 07:14 jbpn
+
+ * man/Makefile.in:
+
+ - generate man pages at compile time
+
+2002-02-08 07:14 jbpn
+
+ * man/: snmpbulkget.1 , snmpbulkwalk.1 ,
+ snmpbulkget.1.def , snmpbulkwalk.1.def , snmpcmd.1
+ , snmpcmd.1.def , snmpconf.1 , snmpconf.1.def
+ , snmpget.1 , snmpget.1.def , snmpgetnext.1 ,
+ snmpgetnext.1.def , snmpset.1 , snmpset.1.def ,
+ snmpstatus.1 , snmpstatus.1.def , snmptable.1 ,
+ snmptable.1.def , snmptest.1 , snmptest.1.def ,
+ snmptranslate.1 , snmptranslate.1.def , snmptrap.1
+ , snmptrap.1.def , snmpusm.1 , snmpusm.1.def ,
+ snmpwalk.1 , snmpwalk.1.def , snmptrapd.8 ,
+ snmptrapd.8.def:
+
+ - rename man pages which are now generated at compile time in order
+ to pick up the version (which gets put in the footer).
+
+ - also some editing to make style consistent, add some missing options,
+ change ucd-snmp to Net-SNMP and things like that.
+
+2002-02-08 06:48 dts12
+
+ * agent/mibgroup/: mibJJ.h , mibJJ/icmp.c , mibJJ/icmp.h
+ , mibJJ/if_fields.h , mibJJ/interfaces.c ,
+ mibJJ/interfaces.h , mibJJ/ip.c , mibJJ/ip.h ,
+ mibJJ/ipAddr.c , mibJJ/ipAddr.h , mibJJ/ipMedia.c ,
+ mibJJ/ipMedia.h , mibJJ/ipRoute.c , mibJJ/ipRoute.h
+ , mibJJ/ipv6.c , mibJJ/ipv6.h , mibJJ/kernel_hpux.c
+ , mibJJ/kernel_hpux.h , mibJJ/kernel_linux.c ,
+ mibJJ/kernel_linux.h , mibJJ/snmp_mib.c ,
+ mibJJ/snmp_mib.h , mibJJ/sysORTable.c ,
+ mibJJ/sysORTable.h , mibJJ/system_mib.c ,
+ mibJJ/system_mib.h , mibJJ/tcp.c , mibJJ/tcp.h ,
+ mibJJ/tcpTable.c , mibJJ/tcpTable.h , mibJJ/udp.c ,
+ mibJJ/udp.h , mibJJ/udpTable.c , mibJJ/udpTable.h ,
+ mibJJ/vacm_vars.c , mibJJ/vacm_vars.h:
+
+ Remove the attempted 'mibII' re-write.
+ If we want to tidy up mibII, it makes more sense to use the new agent APIs.
+
+2002-02-08 06:45 dts12
+
+ * include/net-snmp/: net-snmp-includes.h ,
+ agent/net-snmp-agent-includes.h:
+
+ Bring single-include header files closer in line with the existing "mibincl.h" file
+
+2002-02-08 06:09 dts12
+
+ * agent/mibgroup/mibII/: sysORTable.h (V4-2-patches.1),
+ sysORTable.h:
+
+ Ensure the null versions of the two REGISTER macros swallow their parameters.
+
+2002-02-08 04:36 dts12
+
+ * agent/snmp_agent.c:
+
+ Implement the missing outgoing error statistics counters
+ (patch #510194 from Latha Prabhu)
+
+2002-02-08 02:42 dts12
+
+ * agent/mibgroup/: host/hr_storage.c, ucd-snmp/memory.c
+ (V4-2-patches.[6,3]), host/hr_storage.c , ucd-snmp/memory.c:
+
+ Added support for memory and swap entries in hrStorageTable for Solaris
+ (from patch #505498 - thanks to Johannes Schmidt-Fischer)
+
+2002-02-08 02:07 dts12
+
+ * agent/mibgroup/mibII/ip.c:
+
+ Consolidate identical MIB object entries (WIN32/non-WIN32)
+
+2002-02-08 00:50 jbpn
+
+ * man/README:
+
+ - remove chronically dated unhelpful README
+
+2002-02-07 13:33 hardaker
+
+ * Makefile.in , Makefile.rules , configure ,
+ configure.in , makefileindepend.pl ,
+ agent/Makefile.depend , agent/Makefile.in ,
+ agent/agent_trap.c , agent/mib_modules.c ,
+ agent/snmp_agent.c , agent/snmpd.c ,
+ agent/helpers/Makefile.depend , agent/helpers/Makefile.in
+ , agent/mibgroup/Makefile.depend ,
+ agent/mibgroup/Makefile.in , agent/mibgroup/mibincl.h ,
+ agent/mibgroup/agentx/agentx_config.c ,
+ agent/mibgroup/agentx/subagent.c , apps/Makefile.depend
+ , apps/Makefile.in , apps/snmpnetstat/Makefile.depend
+ , apps/snmpnetstat/Makefile.in , local/Makefile.in
+ , man/Makefile.in , mibs/Makefile.in ,
+ snmplib/Makefile.depend , snmplib/Makefile.in:
+
+ remake make's Makefile's to make better making
+
+2002-02-07 13:31 hardaker
+
+ * perl/SNMP/Makefile.PL:
+
+ check local pathes
+
+2002-02-07 12:54 dts12
+
+ * agent/snmp_agent.c:
+
+ Ensure agent returns the correct error codes for UNDO and COMMIT failures.
+
+2002-02-07 11:18 hardaker
+
+ * perl/SNMP/: Makefile.PL , SNMP.xs , t/startagent.pl:
+
+ attempt at porting Joe's SNMP module to net-snmp.
+ It compiles, but only some of the tests succeed.
+
+2002-02-07 10:09 jbpn
+
+ * man/: default_store.3.top , mib_api.3 ,
+ read_config.3.def , snmp.conf.5.def , snmp_agent_api.3
+ , snmp_alarm.3 , snmp_api.3 , snmp_config.5.def
+ , snmp_sess_api.3 , snmp_trap_api.3 , snmpbulkget.1
+ , snmpbulkwalk.1 , snmpconf.1 , snmpd.conf.5.def
+ , snmpdelta.1 , snmpdf.1 , snmpget.1 ,
+ snmpgetnext.1 , snmpnetstat.1 , snmpset.1 ,
+ snmpstatus.1 , snmptable.1 , snmptest.1 ,
+ snmptranslate.1 , snmptrap.1 , snmptrapd.conf.5.def
+ , snmpusm.1 , snmpwalk.1 , variables.5:
+
+ - add Net-SNMP in header of all man pages
+
+2002-02-07 09:52 jbpn
+
+ * man/snmpcmd.1:
+
+ - update style to match snmpd and snmptrapd man pages
+
+2002-02-07 08:15 jbpn
+
+ * man/snmptrapd.8:
+
+ - fix speeling mistake
+
+2002-02-07 08:00 jbpn
+
+ * man/snmptrapd.8:
+
+ - bring up to date with snmptrapd
+
+2002-02-07 07:28 dts12
+
+ * README.hpux11 , acconfig.h ,
+ agent/mibgroup/ucd_snmp.h , agent/mibgroup/host/hr_network.c
+ , agent/mibgroup/host/hr_storage.c ,
+ agent/mibgroup/host/hr_swinst.c ,
+ agent/mibgroup/host/hr_swrun.c , agent/mibgroup/mibII/at.c
+ , agent/mibgroup/mibII/icmp.c ,
+ agent/mibgroup/mibII/interfaces.c ,
+ agent/mibgroup/mibII/interfaces.h , agent/mibgroup/mibII/ip.c
+ , agent/mibgroup/mibII/ipAddr.c ,
+ agent/mibgroup/mibII/tcp.c , agent/mibgroup/mibII/tcpTable.c
+ , agent/mibgroup/mibII/tcpTable.h ,
+ agent/mibgroup/mibII/udp.c , agent/mibgroup/mibII/udpTable.c
+ , agent/mibgroup/mibII/var_route.c ,
+ agent/mibgroup/mibII/var_route.h ,
+ agent/mibgroup/ucd-snmp/memory.c ,
+ include/net-snmp/net-snmp-config.h.in ,
+ include/net-snmp/system/hpux.h , mibs/UCD-SNMP-MIB.txt:
+
+ Support for HP-UX 11, courtesy of Johannes Schmidt-Fischer.
+
+2002-02-07 06:30 jbpn
+
+ * man/snmpd.1.def:
+
+ - alphabetise options
+
+ - bring man page in line with new positional arguments listening
+ address specification and add section describing that
+
+ - put Net-SNMP in header
+
+2002-02-06 10:06 jbpn
+
+ * include/net-snmp/scapi.h:
+
+ - fix bug noted by Niels
+
+2002-02-06 09:25 jbpn
+
+ * apps/: encode_keychange.c , snmpusm.c:
+
+ - minor tweaks due to change in definition of USM OIDs.
+
+2002-02-06 09:17 jbpn
+
+ * include/net-snmp/snmpusm.h , include/net-snmp/snmpv3.h
+ , include/net-snmp/transform_oids.h ,
+ snmplib/snmp_parse_args.c , snmplib/snmpusm.c ,
+ snmplib/snmpv3.c:
+
+ - move USM OID definitions into snmpusm.c, make them const
+
+ - consequent increase in const-ness in some function prototypes
+
+2002-02-06 09:12 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ remove internal note about v3 api, which should be public
+
+2002-02-06 09:12 hardaker
+
+ * include/net-snmp/snmpusm_init.h:
+
+ removed unneeded file
+
+2002-02-06 09:06 jbpn
+
+ * include/net-snmp/keytools.h , include/net-snmp/scapi.h
+ , snmplib/keytools.c , snmplib/scapi.c:
+
+ - add const-ness for transform type args
+
+2002-02-06 09:01 jbpn
+
+ * include/net-snmp/mib.h , include/net-snmp/snmp_debug.h
+ , snmplib/mib.c , snmplib/snmp_debug.c:
+
+ - add some const-ness for OID args (mainly so that debugmsg_oid takes
+ const).
+
+2002-02-06 08:44 dts12
+
+ * agent/agent_read_config.c , agent/mibgroup/ucd_snmp.h
+ , agent/mibgroup/host/hr_filesys.c ,
+ agent/mibgroup/host/hr_storage.c ,
+ agent/mibgroup/ucd-snmp/loadave.c ,
+ agent/mibgroup/ucd-snmp/memory_dynix.c ,
+ agent/mibgroup/ucd-snmp/memory_dynix.h ,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.c ,
+ agent/mibgroup/ucd-snmp/vmstat_dynix.h ,
+ include/net-snmp/system/dynix.h ,
+ agent/mibgroup/host/hr_swrun.c , agent/mibgroup/mibII/at.c
+ , agent/mibgroup/mibII/interfaces.c ,
+ agent/mibgroup/mibII/route_write.c ,
+ agent/mibgroup/mibII/var_route.c , snmplib/snmp_api.c:
+
+ Support for Dynix/PTX 4.4, courtesy of Patrick Hess.
+
+2002-02-06 07:41 jbpn
+
+ * include/net-snmp/snmp_api.h , snmplib/snmp_api.c:
+
+ - make first argument of snmp_dup_objid() const.
+
+ - better handle NULL values in snmp_dup_objid().
+
+2002-02-06 07:09 dts12
+
+ * FAQ , man/snmp_trap_api.3:
+
+ Clarify the applicability of 'snmp_trap_api(3)' routines to AgentX subagents.
+
+2002-02-06 05:58 dts12
+
+ * apps/: encode_keychange.c , notification_log.c ,
+ snmpbulkget.c , snmpbulkwalk.c , snmpdelta.c ,
+ snmpdf.c , snmpget.c , snmpgetnext.c , snmpset.c
+ , snmpstatus.c , snmptable.c , snmptest.c ,
+ snmptranslate.c , snmptrap.c , snmptrapd.c ,
+ snmptrapd_handlers.c , snmptrapd_log.c , snmpusm.c
+ , snmpvacm.c , snmpwalk.c , snmpnetstat/if.c
+ , snmpnetstat/inet.c , snmpnetstat/inet6.c ,
+ snmpnetstat/main.c , snmpnetstat/route.c:
+
+ Applications amended to use the new-style library header structure.
+ (In most cases, simply including the single "full API" header file)
+
+2002-02-06 05:55 dts12
+
+ * include/net-snmp/: asn1.h , config_api.h ,
+ definitions.h , logging_api.h , mib_api.h ,
+ net-snmp-includes.h , pdu_api.h , session_api.h ,
+ snmpv3_api.h , types.h , utilities.h , varbind_api.h:
+
+ Framework for new library header file organisation, with eight main groups
+ of API routines. Currently these still refer to the UCD-style style header
+ files for the actual function declarations.
+
+2002-02-06 05:31 jbpn
+
+ * man/Makefile.in:
+
+ - replace use of $< with explicit filename, since non-GNU makes seem
+ to barf on it
+
+2002-02-06 03:31 dts12
+
+ * Makefile.in:
+
+ Fix incorrect directory specification in 'make clean'
+
+2002-02-06 03:18 dts12
+
+ * acconfig.h , include/net-snmp/net-snmp-config.h.in:
+
+ Protect the project config file against multiple inclusion.
+
+2002-02-06 03:07 jbpn
+
+ * agent/auto_nlist.c:
+
+ - remove #include "../snmplib/system.h" which no longer exists and
+ is apparently unnecessary anyway.
+
+2002-02-06 02:51 jbpn
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - remove #include "../../snmplib/system.h" which no longer exists
+ and is apparently unnecessary anyway.
+
+2002-02-05 11:44 hardaker
+
+ * COPYING (V4-2-patches.7), COPYING:
+
+ copyright year update for NAI and Cambridge
+
+2002-02-05 09:54 hardaker
+
+ * include/net-snmp/net-snmp-config.h.in:
+
+ perl fixes
+
+2002-02-05 09:54 hardaker
+
+ * agent/agent_registry.c , agent/mibgroup/Rmon/alarm.c ,
+ agent/mibgroup/smux/smux.c , include/net-snmp/snmp_api.h
+ , snmplib/snmp_api.c:
+
+ Patch from Harrie Hazewinkel to move the oidtree_compare function to
+ the main library.
+
+2002-02-05 09:52 hardaker
+
+ * configure , configure.in , agent/Makefile.in:
+
+ perl build fixes.
+
+2002-02-05 07:19 hardaker
+
+ * agent/Makefile.in:
+
+ opps. Removed forced perl embedding
+
+2002-02-04 16:22 hardaker
+
+ * include/net-snmp/net-snmp-config.h:
+
+ this file shouldn't be checked in
+
+2002-02-04 16:22 hardaker
+
+ * Makefile.in , acconfig.h , configure ,
+ configure.in , agent/Makefile.in , agent/snmp_perl.c
+ , agent/snmp_perl.pl , agent/snmp_vars.c:
+
+ - Support for embedding perl subroutines into the agent to be called
+ as handlers.
+ - New configure options:
+ --with-perl-modules attempts to build contained modules (poorly currently).
+ --enable-embedded-perl actually specifies to do perl embedding
+ within the agent.
+
+2002-02-04 16:16 hardaker
+
+ * perl/: ASN/ASN.pm , ASN/ASN.xs , ASN/Changes ,
+ ASN/MANIFEST , ASN/Makefile.PL , ASN/test.pl ,
+ agent/Changes , agent/MANIFEST , agent/Makefile.PL ,
+ agent/agent.pm , agent/agent.xs , agent/test.pl ,
+ agent/typemap , default_store/Changes ,
+ default_store/MANIFEST , default_store/Makefile.PL ,
+ default_store/default_store.pm ,
+ default_store/default_store.xs , default_store/test.pl ,
+ default_store/typemap:
+
+ Beginnings of new perl modules needed to implement an SNMP agent (or
+ agentx subagent) inside perl.
+ - not complete yet.
+ - may change.
+ - but works.
+
+2002-02-04 04:39 jbpn
+
+ * snmplib/mib.c:
+
+ - correct processing for timeticks when DS_LIB_NUMERIC_TIMETICKS is
+ set (corrects bug #511793, reported by Anonymous).
+
+2002-02-01 01:50 dts12
+
+ * FAQ:
+
+ Clarify the procedure for compiling with 'cc' rather than 'gcc'
+
+2002-01-31 14:58 hardaker
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ s/snmplib\///;
+
+2002-01-31 06:55 hardaker
+
+ * Makefile.in , agent/helpers/Makefile.in:
+
+ fix make clean as reported by Bradley Bozarth.
+
+2002-01-30 08:06 dts12
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c:
+
+ Bring MIB variable versionTag into line with the new <net-snmp/version.h> usage
+
+2002-01-29 17:53 hardaker
+
+ * version.h , agent/snmpd.c ,
+ agent/mibgroup/versiontag , apps/snmptranslate.c ,
+ apps/snmptrapd.c , apps/snmpnetstat/main.c ,
+ include/net-snmp/version.h , include/ucd-snmp/version.h ,
+ snmplib/Makefile.in , snmplib/snmp_parse_args.c ,
+ snmplib/snmp_version.c:
+
+ Moved versioning information from version.h to:
+ - snmplib/snmp_version.c:
+ - define netsnmp_get_version();
+ - create a const char *NetSnmpVersionInfo
+ - include/net-snmp/version.h:
+ - extern the above char *
+ - prototype the function
+ - include/ucd-snmp/version.h:
+ - create a static variable (the old way) and set it to NetSnmpVersionInfo
+
+2002-01-29 16:09 hardaker
+
+ * testing/: eval_tools.sh , tests/T049snmpv3inform ,
+ tests/T050snmpv3trap , tests/T051snmpv2ctrap ,
+ tests/T052snmpv2cinform , tests/T053agentv1trap ,
+ tests/T054agentv2ctrap , tests/T055agentv1mintrap ,
+ tests/T056agentv2cmintrap , tests/T058agentauthtrap ,
+ tests/T113agentxtrap:
+
+ trap test fixes so the majority of the tests now work.
+
+2002-01-29 16:08 hardaker
+
+ * Makefile.in:
+
+ don't generate ucd-snmp-config.h any longer.
+
+2002-01-29 15:23 hardaker
+
+ * acconfig.h , configure , configure.in ,
+ include/net-snmp/net-snmp-config.h ,
+ include/net-snmp/net-snmp-config.h.in ,
+ include/net-snmp/machine/generic.h ,
+ include/net-snmp/system/aix.h , include/net-snmp/system/bsd.h
+ , include/net-snmp/system/bsdi.h ,
+ include/net-snmp/system/bsdi3.h ,
+ include/net-snmp/system/bsdi4.h ,
+ include/net-snmp/system/cygwin.h ,
+ include/net-snmp/system/darwin.h ,
+ include/net-snmp/system/freebsd.h ,
+ include/net-snmp/system/freebsd2.h ,
+ include/net-snmp/system/freebsd3.h ,
+ include/net-snmp/system/freebsd4.h ,
+ include/net-snmp/system/generic.h ,
+ include/net-snmp/system/hpux.h ,
+ include/net-snmp/system/irix.h ,
+ include/net-snmp/system/linux.h ,
+ include/net-snmp/system/mips.h ,
+ include/net-snmp/system/netbsd.h ,
+ include/net-snmp/system/openbsd.h ,
+ include/net-snmp/system/solaris.h ,
+ include/net-snmp/system/solaris2.6.h ,
+ include/net-snmp/system/solaris2.7.h ,
+ include/net-snmp/system/solaris2.8.h ,
+ include/net-snmp/system/sunos.h ,
+ include/net-snmp/system/svr5.h ,
+ include/net-snmp/system/sysv.h ,
+ include/net-snmp/system/ultrix4.h:
+
+ moved s/*.h files to include/net-snmp/system/*.h
+ moved m/generic.h files to include/net-snmp/machine/generic.h
+
+2002-01-29 09:24 hardaker
+
+ * apps/snmptrapd.c:
+
+ fix -c argument parsing.
+
+2002-01-29 09:10 hardaker
+
+ * testing/eval_tools.sh:
+
+ reference include/net-snmp/net-snmp-config.h instead of just config.h
+
+2002-01-29 09:05 hardaker
+
+ * snmplib/snmpusm.c:
+
+ attempt to fix the unknown engineid/unknown user problems once and for all.
+
+2002-01-28 21:11 hardaker
+
+ * configure , configure.in:
+
+ whoops. Missed some .h file checks in configure. Thanks Robert.
+
+2002-01-28 21:03 hardaker
+
+ * local/convertcode:
+
+ minor fix.
+
+2002-01-28 21:02 hardaker
+
+ * local/convertcode:
+
+ added code convert script for ucd-snmp -> net-snmp header conversion
+
+2002-01-28 20:59 hardaker
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c ,
+ agent/mibgroup/target/snmpTargetParamsEntry.c ,
+ agent/mibgroup/target/target.c ,
+ agent/mibgroup/target/target_counters.c ,
+ agent/mibgroup/tunnel/tunnel.c ,
+ agent/mibgroup/ucd-snmp/disk.c ,
+ agent/mibgroup/ucd-snmp/dlmod.c ,
+ agent/mibgroup/ucd-snmp/extensible.c ,
+ agent/mibgroup/ucd-snmp/loadave.c ,
+ agent/mibgroup/ucd-snmp/logmatch.c ,
+ agent/mibgroup/ucd-snmp/memory.c ,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c ,
+ agent/mibgroup/ucd-snmp/pass.c ,
+ agent/mibgroup/ucd-snmp/pass_persist.c ,
+ agent/mibgroup/ucd-snmp/proc.c ,
+ agent/mibgroup/ucd-snmp/proxy.c ,
+ agent/mibgroup/ucd-snmp/registry.c ,
+ agent/mibgroup/ucd-snmp/versioninfo.c ,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c ,
+ apps/encode_keychange.c , apps/notification_log.c ,
+ apps/snmpbulkget.c , apps/snmpbulkwalk.c ,
+ apps/snmpdelta.c , apps/snmpdf.c , apps/snmpget.c
+ , apps/snmpgetnext.c , apps/snmpset.c ,
+ apps/snmpstatus.c , apps/snmptable.c , apps/snmptest.c
+ , apps/snmptranslate.c , apps/snmptrap.c ,
+ apps/snmptrapd.c , apps/snmptrapd_handlers.c ,
+ apps/snmptrapd_log.c , apps/snmpusm.c , apps/snmpvacm.c
+ , apps/snmpwalk.c , apps/snmpnetstat/Makefile.in
+ , apps/snmpnetstat/if.c , apps/snmpnetstat/inet.c
+ , apps/snmpnetstat/inet6.c , apps/snmpnetstat/main.c
+ , apps/snmpnetstat/route.c , include/net-snmp/asn1.h
+ , include/net-snmp/callback.h ,
+ include/net-snmp/data_list.h ,
+ include/net-snmp/default_store.h , include/net-snmp/getopt.h
+ , include/net-snmp/int64.h , include/net-snmp/keytools.h
+ , include/net-snmp/lcd_time.h ,
+ include/net-snmp/libsnmp.h , include/net-snmp/md5.h ,
+ include/net-snmp/mib.h , include/net-snmp/mt_support.h ,
+ include/net-snmp/net-snmp-config.h ,
+ include/net-snmp/oid_array.h , include/net-snmp/oid_stash.h
+ , include/net-snmp/parse.h ,
+ include/net-snmp/read_config.h , include/net-snmp/scapi.h
+ , include/net-snmp/snmp-tc.h , include/net-snmp/snmp.h
+ , include/net-snmp/snmpAAL5PVCDomain.h ,
+ include/net-snmp/snmpCallbackDomain.h ,
+ include/net-snmp/snmpIPXDomain.h ,
+ include/net-snmp/snmpTCPDomain.h ,
+ include/net-snmp/snmpTCPIPv6Domain.h ,
+ include/net-snmp/snmpUDPDomain.h ,
+ include/net-snmp/snmpUDPIPv6Domain.h ,
+ include/net-snmp/snmpUnixDomain.h ,
+ include/net-snmp/snmp_alarm.h , include/net-snmp/snmp_api.h
+ , include/net-snmp/snmp_client.h ,
+ include/net-snmp/snmp_debug.h , include/net-snmp/snmp_enum.h
+ , include/net-snmp/snmp_impl.h ,
+ include/net-snmp/snmp_locking.h ,
+ include/net-snmp/snmp_logging.h ,
+ include/net-snmp/snmp_parse_args.h ,
+ include/net-snmp/snmp_secmod.h ,
+ include/net-snmp/snmp_transport.h , include/net-snmp/snmpksm.h
+ , include/net-snmp/snmpusm.h ,
+ include/net-snmp/snmpusm_init.h , include/net-snmp/snmpv3.h
+ , include/net-snmp/system.h , include/net-snmp/tools.h
+ , include/net-snmp/transform_oids.h ,
+ include/net-snmp/vacm.h , include/net-snmp/agent/snmp_agent.h
+ , man/Makefile.in , snmplib/Makefile.in ,
+ snmplib/asn1.c , snmplib/asn1.h , snmplib/callback.c
+ , snmplib/callback.h , snmplib/data_list.c ,
+ snmplib/data_list.h , snmplib/default_store.c ,
+ snmplib/default_store.h , snmplib/getopt.h ,
+ snmplib/int64.c , snmplib/int64.h , snmplib/keytools.c
+ , snmplib/keytools.h , snmplib/lcd_time.c ,
+ snmplib/lcd_time.h , snmplib/libsnmp.h , snmplib/md5.c
+ , snmplib/md5.h , snmplib/mib.c , snmplib/mib.h
+ , snmplib/mt_support.c , snmplib/mt_support.h ,
+ snmplib/oid_array.c , snmplib/oid_array.h ,
+ snmplib/oid_stash.c , snmplib/oid_stash.h ,
+ snmplib/parse.c , snmplib/parse.h ,
+ snmplib/read_config.c , snmplib/read_config.h ,
+ snmplib/scapi.c , snmplib/scapi.h , snmplib/snmp-tc.c
+ , snmplib/snmp-tc.h , snmplib/snmp.c ,
+ snmplib/snmp.h , snmplib/snmpAAL5PVCDomain.c ,
+ snmplib/snmpAAL5PVCDomain.h , snmplib/snmpCallbackDomain.c
+ , snmplib/snmpCallbackDomain.h , snmplib/snmpIPXDomain.c
+ , snmplib/snmpIPXDomain.h , snmplib/snmpTCPDomain.c
+ , snmplib/snmpTCPDomain.h , snmplib/snmpTCPIPv6Domain.c
+ , snmplib/snmpTCPIPv6Domain.h , snmplib/snmpUDPDomain.c
+ , snmplib/snmpUDPDomain.h , snmplib/snmpUDPIPv6Domain.c
+ , snmplib/snmpUDPIPv6Domain.h , snmplib/snmpUnixDomain.c
+ , snmplib/snmpUnixDomain.h , snmplib/snmp_alarm.c
+ , snmplib/snmp_alarm.h , snmplib/snmp_api.c ,
+ snmplib/snmp_api.h , snmplib/snmp_auth.c ,
+ snmplib/snmp_client.c , snmplib/snmp_client.h ,
+ snmplib/snmp_debug.c , snmplib/snmp_debug.h ,
+ snmplib/snmp_enum.c , snmplib/snmp_enum.h ,
+ snmplib/snmp_impl.h , snmplib/snmp_logging.c ,
+ snmplib/snmp_logging.h , snmplib/snmp_parse_args.c ,
+ snmplib/snmp_parse_args.h , snmplib/snmp_secmod.c ,
+ snmplib/snmp_secmod.h , snmplib/snmp_transport.c ,
+ snmplib/snmp_transport.h , snmplib/snmpksm.c ,
+ snmplib/snmpksm.h , snmplib/snmpusm.c ,
+ snmplib/snmpusm.h , snmplib/snmpv3.c , snmplib/snmpv3.h
+ , snmplib/system.c , snmplib/system.h ,
+ snmplib/tools.c , snmplib/tools.h ,
+ snmplib/transform_oids.h , snmplib/vacm.c ,
+ snmplib/vacm.h , testing/RUNTESTS ,
+ testing/eval_tools.sh , include/ucd-snmp/asn1.h ,
+ include/ucd-snmp/callback.h , include/ucd-snmp/default_store.h
+ , include/ucd-snmp/int64.h , include/ucd-snmp/keytools.h
+ , include/ucd-snmp/mib.h , include/ucd-snmp/mibincl.h
+ , include/ucd-snmp/parse.h ,
+ include/ucd-snmp/read_config.h , include/ucd-snmp/scapi.h
+ , include/ucd-snmp/snmp-tc.h , include/ucd-snmp/snmp.h
+ , include/ucd-snmp/snmp_alarm.h ,
+ include/ucd-snmp/snmp_api.h , include/ucd-snmp/snmp_client.h
+ , include/ucd-snmp/snmp_debug.h ,
+ include/ucd-snmp/snmp_impl.h , include/ucd-snmp/snmp_logging.h
+ , include/ucd-snmp/snmp_parse_args.h ,
+ include/ucd-snmp/snmp_vars.h , include/ucd-snmp/snmpusm.h
+ , include/ucd-snmp/snmpv3.h , include/ucd-snmp/system.h
+ , include/ucd-snmp/tools.h ,
+ include/ucd-snmp/transform_oids.h ,
+ include/ucd-snmp/util_funcs.h:
+
+ Major file moving and editing of include directives.
+ - essentially adds up to:
+ - mv snmplib/*.h include/net-snmp/
+ - local/convertcode `find . -name \*.c \*.h`
+
+2002-01-28 20:54 hardaker
+
+ * agent/: agent_handler.c , agent_index.c ,
+ agent_read_config.c , agent_registry.c , agent_trap.c
+ , auto_nlist.c , kernel.c , mib_modules.c ,
+ snmp_agent.c , snmp_vars.c , snmpd.c ,
+ helpers/bulk_to_next.c , helpers/debug_handler.c ,
+ helpers/instance.c , helpers/multiplexer.c ,
+ helpers/null.c , helpers/old_api.c , helpers/read_only.c
+ , helpers/serialize.c , helpers/table.c ,
+ helpers/table_array.c , helpers/table_dataset.c ,
+ helpers/table_iterator.c , mibgroup/host_res.h ,
+ mibgroup/kernel_sunos5.c , mibgroup/mibincl.h ,
+ mibgroup/testdelayed.c , mibgroup/testhandler.c ,
+ mibgroup/util_funcs.c , mibgroup/Rmon/alarm.c ,
+ mibgroup/Rmon/event.c , mibgroup/Rmon/history.c ,
+ mibgroup/Rmon/rows.c , mibgroup/agentx/agentx_config.c ,
+ mibgroup/agentx/client.c , mibgroup/agentx/master.c ,
+ mibgroup/agentx/master_admin.c ,
+ mibgroup/agentx/master_request.c , mibgroup/agentx/protocol.c
+ , mibgroup/agentx/subagent.c ,
+ mibgroup/disman/mteObjectsTable.c ,
+ mibgroup/disman/mteTriggerBooleanTable.c ,
+ mibgroup/disman/mteTriggerDeltaTable.c ,
+ mibgroup/disman/mteTriggerExistenceTable.c ,
+ mibgroup/disman/mteTriggerTable.c ,
+ mibgroup/disman/mteTriggerThresholdTable.c ,
+ mibgroup/examples/ucdDemoPublic.c , mibgroup/host/hr_disk.c
+ , mibgroup/host/hr_filesys.c ,
+ mibgroup/host/hr_storage.c , mibgroup/host/hr_swinst.c
+ , mibgroup/host/hr_swrun.c , mibgroup/host/hr_system.c
+ , mibgroup/mibII/at.c , mibgroup/mibII/icmp.c ,
+ mibgroup/mibII/interfaces.c , mibgroup/mibII/ip.c ,
+ mibgroup/mibII/ipAddr.c , mibgroup/mibII/ipv6.c ,
+ mibgroup/mibII/kernel_linux.c , mibgroup/mibII/route_write.c
+ , mibgroup/mibII/snmp_mib.c ,
+ mibgroup/mibII/sysORTable.c , mibgroup/mibII/system_mib.c
+ , mibgroup/mibII/tcp.c , mibgroup/mibII/tcpTable.c
+ , mibgroup/mibII/udp.c , mibgroup/mibII/udpTable.c
+ , mibgroup/mibII/vacm_context.c ,
+ mibgroup/mibII/vacm_vars.c , mibgroup/mibII/vacm_vars.h
+ , mibgroup/mibII/var_route.c , mibgroup/mibJJ/icmp.c
+ , mibgroup/mibJJ/interfaces.c , mibgroup/mibJJ/ip.c
+ , mibgroup/mibJJ/ipAddr.c , mibgroup/mibJJ/ipMedia.c
+ , mibgroup/mibJJ/ipv6.c , mibgroup/mibJJ/kernel_linux.c
+ , mibgroup/mibJJ/snmp_mib.c , mibgroup/mibJJ/sysORTable.c
+ , mibgroup/mibJJ/system_mib.c , mibgroup/mibJJ/tcp.c
+ , mibgroup/mibJJ/tcpTable.c , mibgroup/mibJJ/udp.c ,
+ mibgroup/mibJJ/udpTable.c , mibgroup/mibJJ/vacm_vars.c ,
+ mibgroup/misc/dlmod.c ,
+ mibgroup/notification/snmpNotifyFilterProfileTable.c ,
+ mibgroup/notification/snmpNotifyFilterTable.c ,
+ mibgroup/notification/snmpNotifyTable.c ,
+ mibgroup/smux/smux.c , mibgroup/smux/snmp_bgp.c ,
+ mibgroup/smux/snmp_ospf.c , mibgroup/smux/snmp_rip2.c ,
+ mibgroup/snmpv3/snmpEngine.c , mibgroup/snmpv3/usmUser.c
+ , mibgroup/snmpv3/usmUser.h:
+
+ Major file moving and editing of include directives.
+ - essentially adds up to:
+ - mv snmplib/*.h include/net-snmp/
+ - local/convertcode `find . -name \*.c \*.h`
+
+2002-01-28 19:42 hardaker
+
+ * include/ucd-snmp/ucd-snmp-config.h:
+
+ remove UCD_COMPAT flag and DEFINE IT instead
+
+2002-01-28 19:41 hardaker
+
+ * include/ucd-snmp/ucd-snmp-config.h:
+
+ remove UCD_COMPAT flag and define it instead
+
+2002-01-25 11:29 hardaker
+
+ * snmplib/mib.c:
+
+ - parse_one_oid_index:
+ - use an unsigned int for length's pulled from the oid.
+ - Make sure they're always < 128
+
+2002-01-25 09:12 jbpn
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ - closer adherence to state machines described in RFC 2574
+
+2002-01-25 09:10 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - cause usmDecryptionError reports to be sent in a couple of extra
+ cases: bad salt (length != 8) and length of encrypted data not a
+ multiple of 8 octets (per RFC 2574).
+
+2002-01-25 09:04 jbpn
+
+ * agent/snmp_agent.c:
+
+ - for unknown message types, increment snmpInASNParseErrs and fail
+ at the post-parse stage.
+
+ - for notification types, increment snmpUnknownPDUHandlers and bail
+ out early.
+
+2002-01-25 09:01 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - for unhandled messages (e.g. RESPONSE messages sent to agents),
+ increment the snmpUnknownPDUHandlers counter.
+
+ - try to free securityStateRefs when post-parse fails.
+
+2002-01-25 06:26 jbpn
+
+ * agent/mibgroup/mibII/: vacm_vars.c (V4-2-patches.6), vacm_vars.c:
+
+ - fix minor problem with storageType (always okay to set to current
+ value).
+
+ - don't reset some variables to old value unless we actually set
+ them in the first place!
+
+2002-01-25 05:00 jbpn
+
+ * agent/helpers/table.c:
+
+ - don't print out debugging info in a further case where it has been
+ free()d.
+
+ - set the exception noSuchInstance rather than error noSuchName when
+ we have the incorrect number of indices.
+
+2002-01-25 04:54 dts12
+
+ * snmplib/README.newlib:
+
+ file README.newlib was initially added on branch NEW-LIBRARY-API.
+
+2002-01-25 04:49 jbpn
+
+ * agent/helpers/table.c:
+
+ - move debugging output to before where (potentially) the data it is
+ trying to print gets free()d.
+
+2002-01-25 04:40 jbpn
+
+ * agent/snmp_agent.c:
+
+ - keep asp->vbcount correct in create_subtree_cache() if we dump
+ varbinds in the GETNEXT case because numvarbinds > non-repeaters.
+ Failing to do this will cause problems later when you iterate over
+ 0 .. asp->vbcount - 1 in reassign_requests().
+
+2002-01-24 15:11 rstory
+
+ * include/net-snmp/agent/table.h:
+
+ update macros to put parens around parameters when used, in case a parameter is an expression, which might muck about with operator precedence rules and cause unexpected and undesirable behavior.
+
+2002-01-24 11:07 rstory
+
+ * local/mib2c.array-user.conf:
+
+ try to find & handle external indexes; use new style net-snmp includes; add
+ row_copy; use context types & casts in parameters instead of generic types
+ recast inside method
+
+2002-01-24 06:03 jbpn
+
+ * snmplib/: read_config.c (V4-2-patches.3), read_config.c:
+
+ - avoid format string nasties in read_config_store() when writing to
+ files (exposed e.g. by the persistent sysName.0 stuff -- try
+ snmpset host sysName.0 s "%08x" -- oops)
+
+2002-01-24 04:34 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - don't automatically accept a msgUserName of "" when processing
+ incoming messages.
+
+2002-01-24 04:30 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - bigger buffer for msgAuthoritativeEngineID field since it is not
+ limited to 32 bytes like SnmpEngineTC. Really this needs to be
+ allocated by the security module but for now we'll just make it
+ twice as big.
+
+2002-01-24 03:19 dts12
+
+ * agent/mibgroup/host/hr_swrun.c , snmplib/snmp-tc.c:
+
+ AIX support for the Host Resources module.
+ (Thanks to Andy Hood)
+
+2002-01-23 08:28 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - set viewType to the DEFVAL included(1) for new rows
+
+2002-01-23 07:40 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - secModel of 0 is a parse error in HeaderData
+
+2002-01-23 07:23 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - be careful to free securityStateRef in a couple of error cases in
+ snmpv3_parse -- fixes memory leaks when malformed PDUs are
+ received.
+
+2002-01-22 19:49 rstory
+
+ * snmplib/: snmp_api.c , snmp_api.h:
+
+ chg api for snmp_oid_ncompare, don't implement it vi snmp_oid_compare
+
+2002-01-22 19:46 rstory
+
+ * snmplib/: oid_array.c , oid_array.h:
+
+ add Get_oid_data_count(); add subset support
+
+2002-01-22 19:44 rstory
+
+ * snmplib/: mib.c , mib.h:
+
+ add netsnmp_str2oid()
+
+2002-01-22 19:41 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ add subset function
+
+2002-01-22 19:40 rstory
+
+ * agent/helpers/table_array.c:
+
+ add subset function; add preliminary locking code; add ta_check_row_status
+
+2002-01-22 06:33 jbpn
+
+ * agent/mibgroup/mibII/: vacm_vars.c (V4-2-patches.4), vacm_vars.c:
+
+ - fix bug just introduced where setting an existing row's status to
+ createAndGo(4) or createAndWait(5) would delete the row.
+
+2002-01-22 04:58 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - cause a parse error if we receive UsmSecurityParameters with a
+ msgUserName that is illegally long.
+
+2002-01-22 03:10 jbpn
+
+ * agent/mibgroup/target/snmpTargetParamsEntry.c:
+
+ - oops, left old code in #if 0 branch AGAIN. I am getting into bad
+ habits!
+
+2002-01-22 03:08 jbpn
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ - fix memory leaks in row creation/destruction
+
+ - more aggressive validity checking of snmpNotifyTag, snmpNotifyType
+ and snmpNotifyStorageType.
+
+ - passes 6.5.1.0 -- 6.5.8.3
+
+2002-01-22 01:47 jbpn
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c ,
+ snmpTargetParamsEntry.c , snmpTargetParamsEntry.h:
+
+ - correct state machines for snmpTargetParamsTable
+
+2002-01-21 23:48 jbpn
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ - tidy things up a bit (had left some old code sitting if #if 0
+ branch).
+
+ - remember to close (target->sess) when we move a target to
+ notInService(2).
+
+2002-01-21 11:04 jbpn
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ - correct state machines for snmpTargetAddrTable
+
+2002-01-21 06:47 jbpn
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c ,
+ snmpTargetAddrEntry.h:
+
+ - implement snmpTargetSpinLock object
+
+2002-01-18 09:19 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - correct state machine for vacmViewTreeFamilyTable. Passes all the
+ relevant Silvercreek VACM tetst (5.4.0.1 -- 5.4.9.7 inclusive).
+
+2002-01-18 08:49 jbpn
+
+ * snmplib/: vacm.c , vacm.h:
+
+ - add a switch to vacm_getViewEntry() to allow the mask entries
+ to be ignore (which is what you want when you are just using this
+ function to look up an entry in the table in order to write some new
+ value to one of the columnar objects).
+
+2002-01-18 06:09 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - correct state machine for vacmAccessTable. Passes all the relevant
+ Silvercreek VACM tetst (5.3.0 -- 5.3.9.7 inclusive).
+
+2002-01-18 04:11 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - correct state machine for vacmSecurityToGroupTable (i.e. don't
+ just do everything in the COMMIT phase). Passes all the relevant
+ Silvercreek VACM tetst (5.2.0 -- 5.2.9.7 inclusive).
+
+2002-01-18 04:08 jbpn
+
+ * agent/snmp_agent.c:
+
+ - don't overwrite an existing error status after COMMIT or UNDO
+ phases with commitFailed or undoFailed (but do translate error
+ returns from those phases into those errors when we don't have an
+ existing error status).
+
+2002-01-17 06:57 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - handle illegal values of msgID correctly (by dropping the packet
+ and incrementing snmpInASNParseErrs)
+
+2002-01-17 06:38 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - handle illegal values of msgMaxSize correctly (by dropping the
+ packet and incrementing snmpInASNParseErrs)
+
+2002-01-15 08:17 rstory
+
+ * include/net-snmp/net-snmp-includes.h:
+
+ top level include which includes useful snmplib headers
+
+2002-01-15 08:15 rstory
+
+ * include/ucd-snmp/: agent_index.h , agent_read_config.h
+ , agent_registry.h , agent_trap.h , asn1.h ,
+ auto_nlist.h , callback.h , default_store.h ,
+ ds_agent.h , header_complex.h , int64.h , keytools.h
+ , mib.h , mib_module_config.h , mibincl.h ,
+ parse.h , read_config.h , scapi.h , snmp-tc.h ,
+ snmp.h , snmp_agent.h , snmp_alarm.h , snmp_api.h
+ , snmp_client.h , snmp_debug.h , snmp_impl.h ,
+ snmp_logging.h , snmp_parse_args.h , snmp_vars.h ,
+ snmpusm.h , snmpv3.h , struct.h , system.h ,
+ tools.h , transform_oids.h , ucd-snmp-agent-includes.h
+ , ucd-snmp-config.h , ucd-snmp-includes.h ,
+ util_funcs.h , var_struct.h , version.h:
+
+ create 4.x headers that are wrappers pointing to new headers
+
+2002-01-14 15:08 rstory
+
+ * include/net-snmp/agent/table_array.h:
+
+ add UserRowAction and void pointer
+
+2002-01-14 13:41 hardaker
+
+ * agent/: mibgroup/ucd-snmp/lmSensors.c , Makefile.in:
+
+ -> net-snmp/agent/net-snmp-agent-includes.h
+
+2002-01-14 13:40 hardaker
+
+ * include/net-snmp/agent/ucd-snmp-agent-includes.h:
+
+ removed
+
+2002-01-14 13:29 rstory
+
+ * include/net-snmp/agent/net-snmp-agent-includes.h:
+
+ copy ucd-snmp-agent-includes.h and update to net-snmp use new agent dir
+
+2002-01-14 08:04 hardaker
+
+ * agent/Makefile.in , agent/agent_callbacks.h ,
+ agent/agent_handler.c , agent/agent_handler.h ,
+ agent/agent_index.c , agent/agent_index.h ,
+ agent/agent_read_config.c , agent/agent_read_config.h ,
+ agent/agent_registry.c , agent/agent_registry.h ,
+ agent/agent_trap.c , agent/agent_trap.h ,
+ agent/auto_nlist.c , agent/auto_nlist.h ,
+ agent/ds_agent.h , agent/kernel.c , agent/mib_modules.c
+ , agent/mib_modules.h , agent/snmp_agent.c ,
+ agent/snmp_agent.h , agent/snmp_vars.c ,
+ agent/snmp_vars.h , agent/snmpd.c ,
+ agent/ucd-snmp-agent-includes.h , agent/var_struct.h ,
+ agent/helpers/Makefile.in , agent/helpers/bulk_to_next.c
+ , agent/helpers/debug_handler.c ,
+ agent/helpers/instance.c , agent/helpers/multiplexer.c ,
+ agent/helpers/null.c , agent/helpers/old_api.c ,
+ agent/helpers/read_only.c , agent/helpers/serialize.c ,
+ agent/helpers/table.c , agent/helpers/table_array.c ,
+ agent/helpers/table_iterator.c , agent/mibgroup/host_res.h
+ , agent/mibgroup/mibincl.h ,
+ agent/mibgroup/testdelayed.c , agent/mibgroup/testhandler.c
+ , agent/mibgroup/agentx/agentx_config.c ,
+ agent/mibgroup/agentx/client.c ,
+ agent/mibgroup/agentx/master.c ,
+ agent/mibgroup/agentx/master_admin.c ,
+ agent/mibgroup/agentx/master_request.c ,
+ agent/mibgroup/agentx/subagent.c ,
+ agent/mibgroup/disman/mteTriggerTable.c ,
+ agent/mibgroup/examples/example.c ,
+ agent/mibgroup/examples/ucdDemoPublic.c ,
+ agent/mibgroup/host/hr_disk.c , agent/mibgroup/host/hr_proc.c
+ , agent/mibgroup/host/hr_storage.c ,
+ agent/mibgroup/host/hr_swrun.c ,
+ agent/mibgroup/host/hr_system.c , agent/mibgroup/mibII/at.c
+ , agent/mibgroup/mibII/icmp.c ,
+ agent/mibgroup/mibII/interfaces.c , agent/mibgroup/mibII/ip.c
+ , agent/mibgroup/mibII/ipAddr.c ,
+ agent/mibgroup/mibII/ipv6.c ,
+ agent/mibgroup/mibII/route_write.c ,
+ agent/mibgroup/mibII/sysORTable.c ,
+ agent/mibgroup/mibII/system_mib.c ,
+ agent/mibgroup/mibII/tcp.c , agent/mibgroup/mibII/tcpTable.c
+ , agent/mibgroup/mibII/udp.c ,
+ agent/mibgroup/mibII/udpTable.c ,
+ agent/mibgroup/mibII/vacm_context.c ,
+ agent/mibgroup/mibII/vacm_vars.c ,
+ agent/mibgroup/mibII/var_route.c ,
+ agent/mibgroup/mibJJ/icmp.c ,
+ agent/mibgroup/mibJJ/interfaces.c , agent/mibgroup/mibJJ/ip.c
+ , agent/mibgroup/mibJJ/ipAddr.c ,
+ agent/mibgroup/mibJJ/ipMedia.c ,
+ agent/mibgroup/mibJJ/ipRoute.c , agent/mibgroup/mibJJ/ipv6.c
+ , agent/mibgroup/mibJJ/sysORTable.c ,
+ agent/mibgroup/mibJJ/system_mib.c , agent/mibgroup/mibJJ/tcp.c
+ , agent/mibgroup/mibJJ/tcpTable.c ,
+ agent/mibgroup/mibJJ/udp.c , agent/mibgroup/mibJJ/udpTable.c
+ , agent/mibgroup/mibJJ/vacm_vars.c ,
+ agent/mibgroup/misc/dlmod.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/smux/smux.c , agent/mibgroup/smux/snmp_bgp.c
+ , agent/mibgroup/smux/snmp_ospf.c ,
+ agent/mibgroup/smux/snmp_rip2.c ,
+ agent/mibgroup/snmpv3/usmUser.c ,
+ agent/mibgroup/target/target_counters.c ,
+ agent/mibgroup/tunnel/tunnel.c ,
+ agent/mibgroup/ucd-snmp/disk.c ,
+ agent/mibgroup/ucd-snmp/diskio.c ,
+ agent/mibgroup/ucd-snmp/dlmod.c ,
+ agent/mibgroup/ucd-snmp/errormib.c ,
+ agent/mibgroup/ucd-snmp/extensible.c ,
+ agent/mibgroup/ucd-snmp/file.c ,
+ agent/mibgroup/ucd-snmp/loadave.c ,
+ agent/mibgroup/ucd-snmp/logmatch.c ,
+ agent/mibgroup/ucd-snmp/memory.c ,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c ,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c ,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c ,
+ agent/mibgroup/ucd-snmp/pass.c ,
+ agent/mibgroup/ucd-snmp/proc.c ,
+ agent/mibgroup/ucd-snmp/versioninfo.c ,
+ agent/mibgroup/ucd-snmp/vmstat.c ,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c ,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c ,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c ,
+ apps/notification_log.h , apps/snmptrapd.c ,
+ include/net-snmp/agent/agent_callbacks.h ,
+ include/net-snmp/agent/agent_handler.h ,
+ include/net-snmp/agent/agent_index.h ,
+ include/net-snmp/agent/agent_read_config.h ,
+ include/net-snmp/agent/agent_registry.h ,
+ include/net-snmp/agent/agent_trap.h ,
+ include/net-snmp/agent/auto_nlist.h ,
+ include/net-snmp/agent/ds_agent.h ,
+ include/net-snmp/agent/mib_modules.h ,
+ include/net-snmp/agent/snmp_agent.h ,
+ include/net-snmp/agent/snmp_vars.h ,
+ include/net-snmp/agent/ucd-snmp-agent-includes.h ,
+ include/net-snmp/agent/var_struct.h:
+
+ moved the /agent installed headers to ../include/net-snmp/agent
+
+2002-01-13 09:22 hardaker
+
+ * agent/Makefile.in:
+
+ add a couple more install headers.
+
+2002-01-11 14:18 hardaker
+
+ * apps/: Makefile.in , notification_log.c:
+
+ Move all agent/helpers/*.h files to include/net-snmp/agent/ and change
+ references.
+
+2002-01-11 14:12 hardaker
+
+ * agent/Makefile.in , agent/agent_handler.c ,
+ agent/agent_index.c , agent/agent_read_config.c ,
+ agent/agent_registry.c , agent/mib_modules.c ,
+ agent/snmp_vars.c , agent/snmpd.c ,
+ agent/helpers/all_helpers.h , agent/helpers/bulk_to_next.c
+ , agent/helpers/bulk_to_next.h ,
+ agent/helpers/debug_handler.c , agent/helpers/debug_handler.h
+ , agent/helpers/instance.c , agent/helpers/instance.h
+ , agent/helpers/multiplexer.c ,
+ agent/helpers/multiplexer.h , agent/helpers/null.c ,
+ agent/helpers/null.h , agent/helpers/old_api.c ,
+ agent/helpers/old_api.h , agent/helpers/read_only.c ,
+ agent/helpers/read_only.h , agent/helpers/serialize.c ,
+ agent/helpers/serialize.h , agent/helpers/set_helper.h ,
+ agent/helpers/table.c , agent/helpers/table.h ,
+ agent/helpers/table_array.c , agent/helpers/table_array.h
+ , agent/helpers/table_data.c , agent/helpers/table_data.h
+ , agent/helpers/table_dataset.c ,
+ agent/helpers/table_dataset.h , agent/helpers/table_iterator.c
+ , agent/helpers/table_iterator.h ,
+ agent/mibgroup/Makefile.in , agent/mibgroup/testdelayed.c
+ , agent/mibgroup/testhandler.c ,
+ agent/mibgroup/agent/nsTransactionTable.c ,
+ agent/mibgroup/mibII/vacm_context.c ,
+ agent/mibgroup/target/target_counters.c ,
+ include/net-snmp/agent/all_helpers.h ,
+ include/net-snmp/agent/bulk_to_next.h ,
+ include/net-snmp/agent/debug_handler.h ,
+ include/net-snmp/agent/instance.h ,
+ include/net-snmp/agent/multiplexer.h ,
+ include/net-snmp/agent/null.h ,
+ include/net-snmp/agent/old_api.h ,
+ include/net-snmp/agent/read_only.h ,
+ include/net-snmp/agent/serialize.h ,
+ include/net-snmp/agent/set_helper.h ,
+ include/net-snmp/agent/table.h ,
+ include/net-snmp/agent/table_array.h ,
+ include/net-snmp/agent/table_data.h ,
+ include/net-snmp/agent/table_dataset.h ,
+ include/net-snmp/agent/table_iterator.h:
+
+ Move all agent/helpers/*.h files to include/net-snmp/agent/ and change
+ references.
+
+2002-01-11 08:41 hardaker
+
+ * agent/Makefile.in , agent/helpers/Makefile.in ,
+ agent/mibgroup/Makefile.in , apps/Makefile.in ,
+ snmplib/Makefile.in:
+
+ - Add -I$(top_srcdir)/include to include path.
+ - Rename 3 agent libraries from libucd* -> libnetsnmp*
+
+2002-01-11 07:58 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - don't use while(x-- >= 0) loops for new unsigned index components
+
+2002-01-11 05:27 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - be careful about signedess of index components in tables
+
+2002-01-10 13:12 nba
+
+ * configure , configure.in:
+
+ Create the include directory when building outside source directory
+
+2002-01-10 08:20 jbpn
+
+ * agent/mibgroup/mibII/sysORTable.c:
+
+ - use an unsigned long loop variable in var_sysORTable() to avoid
+ incorrect lexi-ordering when doing requests like GETNEXT
+ sysORDescr.4294967295.
+
+ - minor debugging output changes
+
+2002-01-10 07:32 jbpn
+
+ * agent/snmp_agent.c:
+
+ - fix minor memory leak in reassign_requests()
+
+2002-01-10 07:21 jbpn
+
+ * agent/snmp_agent.c:
+
+ - set type for unhandled GET requests in handle_pdu() to be
+ noSuchInstance rather than noSuchObject (noSuchObject exceptions
+ are detected and explicitly set earlier).
+
+2002-01-10 05:52 jbpn
+
+ * agent/helpers/old_api.c:
+
+ - correct typo that meant error returns from old-api write methods
+ were ignored.
+
+2002-01-10 05:04 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - change value of STAT_TARGET_STATS_END so that mibII/snmp_mib.c can
+ return values of mandatory objects snmpSilentDrops and
+ snmpProxyDrops.
+
+2002-01-09 08:50 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - make unknown/illegal varbind types in v1/v2c PDUs cause
+ snmpInASNParseErrs to be incremented.
+
+2002-01-09 07:55 jbpn
+
+ * agent/helpers/debug_handler.c:
+
+ - fix memory leak
+
+2002-01-09 07:32 jbpn
+
+ * apps/snmpbulkget.c:
+
+ - bring app-specific options in line with snmpbulkwalk (-C rather
+ than -B)
+
+2002-01-09 07:31 jbpn
+
+ * apps/snmpbulkwalk.c:
+
+ - formatting change to usage message
+
+2002-01-09 06:35 jbpn
+
+ * agent/helpers/table_iterator.c:
+
+ - fix minor memory leak
+
+2002-01-08 08:55 jbpn
+
+ * apps/snmpbulkwalk.c:
+
+ - add options from snmpwalk
+
+ - allow non-repeaters and max-repeaters to be set
+
+ - change default value of max-repeaters to a lower value to avoid
+ timeouts with slower agents
+
+2002-01-08 08:17 jbpn
+
+ * agent/snmp_agent.c:
+
+ - don't try to malloc() a zero-length buffer, in case some malloc()s
+ complain.
+
+2002-01-08 08:15 jbpn
+
+ * agent/snmp_agent.c:
+
+ - hopefully final GETBULK fix -- passes all SilverCreek's GETBULK
+ tests (incl. negative non-repeaters and max-repeaters)
+
+2002-01-08 06:59 jbpn
+
+ * agent/: snmp_agent.c , snmp_agent.h ,
+ helpers/bulk_to_next.c:
+
+ - GETBULK fix to ignore varbinds for which zero repetitions are
+ called for
+
+ - drop asp->start and asp->end which are hardly used and which get
+ in the way of this type of processing
+
+ - ignore negative repetitions in bulk_to_next handler
+
+2002-01-07 08:39 hardaker
+
+ * perl/manager/.cvsignore:
+
+ ignore file
+
+2002-01-07 08:38 hardaker
+
+ * perl/manager/INSTALL:
+
+ PNGGraph -> GD::Graph
+
+2002-01-04 13:48 hardaker
+
+ * Makefile.in:
+
+ fix dependencies
+
+2002-01-04 13:24 hardaker
+
+ * acconfig.h , include/net-snmp/acconfig.h:
+
+ move acconfig.h back to the top dir where its apparently supposed to live.
+
+2002-01-04 13:18 hardaker
+
+ * configure , configure.in:
+
+ more ucd-snmp -> net-snmp translations. warning: includes the default persistent store.
+
+2002-01-04 13:04 hardaker
+
+ * include/: net-snmp/.cvsignore , ucd-snmp/.cvsignore:
+
+ ignore files
+
+2002-01-04 13:02 hardaker
+
+ * .cvsignore:
+
+ ignore built net-snmp-config
+
+2002-01-04 13:00 hardaker
+
+ * apps/: Makefile.in , encode_keychange.c ,
+ notification_log.c , snmpbulkget.c , snmpbulkwalk.c
+ , snmpdelta.c , snmpdf.c , snmpget.c ,
+ snmpgetnext.c , snmpset.c , snmpstatus.c ,
+ snmptable.c , snmptest.c , snmptranslate.c ,
+ snmptrap.c , snmptrapd.c , snmptrapd_handlers.c
+ , snmptrapd_log.c , snmpusm.c , snmpvacm.c
+ , snmpwalk.c:
+
+ beginnings of ucd-snmp -> net-snmp structural changes.
+ - config.h -> include/net-snmp/net-snmp-config.h
+ - this, of course, changes just about every file in the repository.
+
+2002-01-04 12:56 hardaker
+
+ * agent/mibgroup/mibJJ/icmp.c ,
+ agent/mibgroup/mibJJ/interfaces.c , agent/mibgroup/mibJJ/ip.c
+ , agent/mibgroup/mibJJ/ipAddr.c ,
+ agent/mibgroup/mibJJ/ipMedia.c ,
+ agent/mibgroup/mibJJ/ipRoute.c , agent/mibgroup/mibJJ/ipv6.c
+ , agent/mibgroup/mibJJ/kernel_linux.c ,
+ agent/mibgroup/mibJJ/snmp_mib.c ,
+ agent/mibgroup/mibJJ/sysORTable.c ,
+ agent/mibgroup/mibJJ/system_mib.c , agent/mibgroup/mibJJ/tcp.c
+ , agent/mibgroup/mibJJ/tcpTable.c ,
+ agent/mibgroup/mibJJ/udp.c , agent/mibgroup/mibJJ/udpTable.c
+ , agent/mibgroup/mibJJ/vacm_vars.c ,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c ,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/smux/smux.c , agent/mibgroup/smux/snmp_bgp.c
+ , agent/mibgroup/smux/snmp_ospf.c ,
+ agent/mibgroup/smux/snmp_rip2.c ,
+ agent/mibgroup/snmpv3/snmpEngine.c ,
+ agent/mibgroup/snmpv3/snmpMPDStats.c ,
+ agent/mibgroup/snmpv3/usmStats.c ,
+ agent/mibgroup/snmpv3/usmUser.c ,
+ agent/mibgroup/target/snmpTargetAddrEntry.c ,
+ agent/mibgroup/target/snmpTargetParamsEntry.c ,
+ agent/mibgroup/target/target.c ,
+ agent/mibgroup/target/target_counters.c ,
+ agent/mibgroup/ucd-snmp/disk.c ,
+ agent/mibgroup/ucd-snmp/diskio.c ,
+ agent/mibgroup/ucd-snmp/dlmod.c ,
+ agent/mibgroup/ucd-snmp/errormib.c ,
+ agent/mibgroup/ucd-snmp/extensible.c ,
+ agent/mibgroup/ucd-snmp/file.c ,
+ agent/mibgroup/ucd-snmp/hpux.c ,
+ agent/mibgroup/ucd-snmp/lmSensors.c ,
+ agent/mibgroup/ucd-snmp/loadave.c ,
+ agent/mibgroup/ucd-snmp/logmatch.c ,
+ agent/mibgroup/ucd-snmp/memory.c ,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c ,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c ,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c ,
+ agent/mibgroup/ucd-snmp/pass.c ,
+ agent/mibgroup/ucd-snmp/pass_persist.c ,
+ agent/mibgroup/ucd-snmp/proc.c ,
+ agent/mibgroup/ucd-snmp/proxy.c ,
+ agent/mibgroup/ucd-snmp/registry.c ,
+ agent/mibgroup/ucd-snmp/versioninfo.c ,
+ agent/mibgroup/ucd-snmp/vmstat.c ,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c ,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c ,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c ,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c ,
+ apps/snmpnetstat/Makefile.in , apps/snmpnetstat/if.c ,
+ apps/snmpnetstat/inet.c , apps/snmpnetstat/inet6.c ,
+ apps/snmpnetstat/main.c , apps/snmpnetstat/route.c ,
+ apps/snmpnetstat/winstub.c:
+
+ beginnings of ucd-snmp -> net-snmp structural changes.
+ - config.h -> include/net-snmp/net-snmp-config.h
+ - this, of course, changes just about every file in the repository.
+
+2002-01-04 12:52 hardaker
+
+ * agent/mibgroup/misc/dlmod.c , agent/mibgroup/misc/ipfwacc.c
+ , include/net-snmp/acconfig.h ,
+ include/net-snmp/net-snmp-config.h.in ,
+ include/ucd-snmp/README , snmplib/Makefile.in ,
+ snmplib/asn1.c , snmplib/callback.c ,
+ snmplib/data_list.c , snmplib/default_store.c ,
+ snmplib/int64.c , snmplib/keytools.c ,
+ snmplib/lcd_time.c , snmplib/md5.c , snmplib/mib.c
+ , snmplib/mt_support.c , snmplib/oid_array.c ,
+ snmplib/oid_stash.c , snmplib/parse.c ,
+ snmplib/read_config.c , snmplib/scapi.c ,
+ snmplib/snmp-tc.c , snmplib/snmp.c ,
+ snmplib/snmpAAL5PVCDomain.c , snmplib/snmpCallbackDomain.c
+ , snmplib/snmpIPXDomain.c , snmplib/snmpTCPDomain.c
+ , snmplib/snmpTCPIPv6Domain.c , snmplib/snmpUDPDomain.c
+ , snmplib/snmpUDPIPv6Domain.c , snmplib/snmpUnixDomain.c
+ , snmplib/snmp_alarm.c , snmplib/snmp_api.c ,
+ snmplib/snmp_auth.c , snmplib/snmp_client.c ,
+ snmplib/snmp_debug.c , snmplib/snmp_enum.c ,
+ snmplib/snmp_logging.c , snmplib/snmp_parse_args.c ,
+ snmplib/snmp_secmod.c , snmplib/snmp_transport.c ,
+ snmplib/snmpksm.c , snmplib/snmpusm.c , snmplib/snmpv3.c
+ , snmplib/snprintf.c , snmplib/strtol.c ,
+ snmplib/strtoul.c , snmplib/system.c , snmplib/tools.c
+ , snmplib/vacm.c , testing/T.c ,
+ testing/etimetest.c , testing/keymanagetest.c ,
+ testing/misctest.c , testing/scapitest.c:
+
+ beginnings of ucd-snmp -> net-snmp structural changes.
+ - config.h -> include/net-snmp/net-snmp-config.h
+ - this, of course, changes just about every file in the repository.
+
+2002-01-04 12:49 hardaker
+
+ * Makefile.in , Makefile.top , configure ,
+ configure.in , sedscript.in , agent/Makefile.in
+ , agent/agent_handler.c , agent/agent_index.c ,
+ agent/agent_read_config.c , agent/agent_registry.c ,
+ agent/agent_trap.c , agent/auto_nlist.c ,
+ agent/kernel.c , agent/mib_modules.c ,
+ agent/snmp_agent.c , agent/snmp_vars.c ,
+ agent/snmpd.c , agent/helpers/Makefile.in ,
+ agent/helpers/bulk_to_next.c , agent/helpers/debug_handler.c
+ , agent/helpers/instance.c , agent/helpers/multiplexer.c
+ , agent/helpers/null.c , agent/helpers/old_api.c ,
+ agent/helpers/read_only.c , agent/helpers/serialize.c ,
+ agent/helpers/table.c , agent/helpers/table_array.c ,
+ agent/helpers/table_data.c , agent/helpers/table_dataset.c
+ , agent/helpers/table_iterator.c ,
+ agent/mibgroup/Makefile.in , agent/mibgroup/header_complex.c
+ , agent/mibgroup/kernel_sunos5.c ,
+ agent/mibgroup/testdelayed.c , agent/mibgroup/testhandler.c
+ , agent/mibgroup/util_funcs.c ,
+ agent/mibgroup/Rmon/agutil.c , agent/mibgroup/Rmon/alarm.c
+ , agent/mibgroup/Rmon/event.c ,
+ agent/mibgroup/Rmon/history.c , agent/mibgroup/Rmon/rows.c
+ , agent/mibgroup/Rmon/statistics.c ,
+ agent/mibgroup/agent/nsTransactionTable.c ,
+ agent/mibgroup/agentx/agentx_config.c ,
+ agent/mibgroup/agentx/client.c ,
+ agent/mibgroup/agentx/master.c ,
+ agent/mibgroup/agentx/master_admin.c ,
+ agent/mibgroup/agentx/protocol.c ,
+ agent/mibgroup/agentx/subagent.c ,
+ agent/mibgroup/disman/mteObjectsTable.c ,
+ agent/mibgroup/disman/mteTriggerBooleanTable.c ,
+ agent/mibgroup/disman/mteTriggerDeltaTable.c ,
+ agent/mibgroup/disman/mteTriggerExistenceTable.c ,
+ agent/mibgroup/disman/mteTriggerTable.c ,
+ agent/mibgroup/disman/mteTriggerThresholdTable.c ,
+ agent/mibgroup/examples/example.c ,
+ agent/mibgroup/examples/ucdDemoPublic.c ,
+ agent/mibgroup/host/hr_device.c ,
+ agent/mibgroup/host/hr_disk.c ,
+ agent/mibgroup/host/hr_filesys.c ,
+ agent/mibgroup/host/hr_network.c ,
+ agent/mibgroup/host/hr_other.c ,
+ agent/mibgroup/host/hr_partition.c ,
+ agent/mibgroup/host/hr_print.c ,
+ agent/mibgroup/host/hr_proc.c ,
+ agent/mibgroup/host/hr_storage.c ,
+ agent/mibgroup/host/hr_swinst.c ,
+ agent/mibgroup/host/hr_swrun.c ,
+ agent/mibgroup/host/hr_system.c , agent/mibgroup/mibII/at.c
+ , agent/mibgroup/mibII/icmp.c ,
+ agent/mibgroup/mibII/interfaces.c , agent/mibgroup/mibII/ip.c
+ , agent/mibgroup/mibII/ipAddr.c ,
+ agent/mibgroup/mibII/ipv6.c ,
+ agent/mibgroup/mibII/kernel_linux.c ,
+ agent/mibgroup/mibII/mta_sendmail.c ,
+ agent/mibgroup/mibII/route_write.c ,
+ agent/mibgroup/mibII/snmp_mib.c ,
+ agent/mibgroup/mibII/sysORTable.c ,
+ agent/mibgroup/mibII/system_mib.c ,
+ agent/mibgroup/mibII/tcp.c , agent/mibgroup/mibII/tcpTable.c
+ , agent/mibgroup/mibII/udp.c ,
+ agent/mibgroup/mibII/udpTable.c ,
+ agent/mibgroup/mibII/vacm_context.c ,
+ agent/mibgroup/mibII/vacm_vars.c ,
+ agent/mibgroup/mibII/var_route.c:
+
+ beginnings of ucd-snmp -> net-snmp structural changes.
+ - config.h -> include/net-snmp/net-snmp-config.h
+ - this, of course, changes just about every file in the repository.
+
+2002-01-04 12:47 hardaker
+
+ * acconfig.h , config.h.in:
+
+ removed uneeded older files
+
+2002-01-03 14:15 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ patch #492072 to main branch
+
+2002-01-03 14:00 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ check results of setmntent before using them.
+
+2002-01-03 13:57 hardaker
+
+ * apps/snmpnetstat/if.c:
+
+ check against growing server returns as pointed out by bug #498956
+
+2002-01-03 11:40 hardaker
+
+ * perl/manager/displaytable.pm:
+
+ PNGGraph -> GDGraph
+
+2002-01-03 11:39 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ change export name to "net-snmp" from "ucd-snmp"
+
+2002-01-03 11:39 hardaker
+
+ * agent/mibgroup/testhandler.c ,
+ local/mib2c.create-dataset.conf , local/mib2c.iterate.conf:
+
+ make use of the new multi-add functions.
+
+2002-01-03 11:38 hardaker
+
+ * agent/helpers/: table_dataset.c , table_dataset.h:
+
+ add multiple default row column definitions using one function call (varargs).
+
+2002-01-03 11:38 hardaker
+
+ * agent/helpers/: table.c , table.h:
+
+ add multiple indexes using one function call (varargs).
+
+2002-01-03 11:37 hardaker
+
+ * agent/snmp_vars.h:
+
+ remove no longer defined v4 api functions (getStatPtr no less).
+
+2002-01-03 11:37 hardaker
+
+ * agent/snmp_agent.h:
+
+ remove no longer defined v4 api functions.
+
+2002-01-03 10:31 hardaker
+
+ * snmplib/: Makefile.in , oid_stash.c , oid_stash.h:
+
+ data stashing based on an oid caching tree.
+
+2001-12-26 15:36 hardaker
+
+ * perl/manager/: INSTALL , Makefile.PL , manager.pm:
+
+ update to make it a bit easier to install (including a Makefile for
+ automated installation).
+
+2001-12-26 13:20 hardaker
+
+ * perl/manager/: INSTALL , displaytable.pm , getValues.pm
+ , green.gif , manager.pm , red.gif , setupauth
+ , setupdb , setupuser , snmptosql:
+
+ moving manager to perl/manager
+
+2001-12-24 16:10 hardaker
+
+ * FAQ , sedscript.in , version.h ,
+ perl/SNMP/SNMP.pm:
+
+ - (version.h sedscript.in): version tag ( 5.0.pre1 )
+
+2001-12-24 16:04 hardaker
+
+ * local/: Makefile.in , mib2c , mib2c.conf:
+
+ Update to make people understand that it's not finished and you must
+ reference a particular configuration file at this point.
+
+2001-12-24 15:51 hardaker
+
+ * FAQ , sedscript.in , version.h ,
+ perl/SNMP/SNMP.pm:
+
+ - (version.h sedscript.in): version tag ( 5.0.not.even.close )
+
+2001-12-24 15:50 hardaker
+
+ * README:
+
+ more comments.
+
+2001-12-24 15:41 hardaker
+
+ * FAQ , README:
+
+ more updates
+
+2001-12-24 15:20 hardaker
+
+ * agent/helpers/old_api.c:
+
+ doxygen comments
+
+2001-12-24 15:20 hardaker
+
+ * NEWS , README:
+
+ 5.0 comment updates.
+
+2001-12-24 15:19 hardaker
+
+ * agent/agent_handler.c:
+
+ doxygen comments on a few functions.
+
+2001-12-24 15:09 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ memory leaks.
+
+2001-12-24 10:06 hardaker
+
+ * agent/Makefile.in:
+
+ remove dependencies for non-existent modules
+
+2001-12-23 15:47 hardaker
+
+ * net-snmp-config:
+
+ opps. Don't check in generated files.
+
+2001-12-23 15:46 hardaker
+
+ * config.h.in , configure , configure.in ,
+ agent/mibgroup/host/hr_swinst.c:
+
+ fix rpm usage (I hope).
+
+2001-12-23 14:50 hardaker
+
+ * agent/mibgroup/agent/.cvsignore:
+
+ added .cvsignore file
+
+2001-12-23 14:49 hardaker
+
+ * Makefile.in:
+
+ install net-snmp-config.
+
+2001-12-23 14:47 hardaker
+
+ * NEWS , configure , configure.in ,
+ net-snmp-config , net-snmp-config.in , agent/Makefile.in
+ , apps/Makefile.in:
+
+ - created a net-snmp-config script to report compiled libs.
+ - separated libs needed by agent from those needed by the rest of the
+ applications.
+
+2001-12-21 16:53 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ mention how to install DBI
+
+2001-12-21 16:44 hardaker
+
+ * perl/AnyData_SNMP/Makefile.PL:
+
+ remove version requirement for AnyData
+
+2001-12-21 16:37 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ make install as root.
+
+2001-12-21 16:32 hardaker
+
+ * perl/AnyData_SNMP/: INSTALL , INSTALL , INSTALL ,
+ INSTALL:
+
+ better descr
+
+2001-12-21 16:09 hardaker
+
+ * perl/AnyData_SNMP/README:
+
+ minor wording change.
+
+2001-12-21 16:07 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ mention it's very alpha code.
+
+2001-12-21 16:06 hardaker
+
+ * perl/AnyData_SNMP/INSTALL:
+
+ new instructions
+
+2001-12-21 10:18 hardaker
+
+ * NEWS:
+
+ mention doxygen.
+
+2001-12-21 10:17 hardaker
+
+ * configure , configure.in ,
+ agent/mibgroup/agent_mibs.h:
+
+ compile in agent specific support mibs.
+
+2001-12-21 09:49 hardaker
+
+ * NEWS:
+
+ (still incomplete) 2nd update for 5.0
+
+2001-12-21 09:44 hardaker
+
+ * NEWS:
+
+ (incomplete) update for 5.0
+
+2001-12-19 17:10 hardaker
+
+ * snmplib/asn1.c:
+
+ fix realloc float and double builds.
+
+2001-12-19 16:34 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ misc fixes.
+
+2001-12-19 16:33 hardaker
+
+ * local/mib2c:
+
+ define a C datatype as $var.decl (per Robert's suggestion. Robert: we
+ probably want pointers for things like strings, no? maybe one type
+ that is always a pointer and another that is sometimes depending on
+ the type?)
+
+2001-12-19 16:32 hardaker
+
+ * apps/snmpbulkwalk.c:
+
+ change default bulk number to 100 from the ridiculous 1000.
+
+2001-12-19 16:32 hardaker
+
+ * agent/Makefile.in , agent/mibgroup/Makefile.in ,
+ apps/Makefile.in , snmplib/Makefile.in:
+
+ make depend
+
+2001-12-19 08:10 hardaker
+
+ * agent/: snmp_agent.c , helpers/bulk_to_next.c:
+
+ getbulk updates to make it the modules responsibility to update the
+ varbind chain an the repeat counter.
+
+2001-12-19 07:57 hardaker
+
+ * agent/: agent_handler.c , snmp_agent.c , snmp_agent.h
+ , helpers/Makefile.in , helpers/all_helpers.c ,
+ helpers/all_helpers.h , helpers/bulk_to_next.c ,
+ helpers/bulk_to_next.h:
+
+ GETBULK support for the new API.
+ - may need to make some slight modifications.
+ - defaults to GETNEXT for any handler that doesn't set HANDLER_CAN_GETBULK.
+ - doesn't deal properly yet with end-of-mib condition removal.
+
+2001-12-19 06:05 jbpn
+
+ * apps/snmptrapd.c:
+
+ - drop -p option. Addresses to listen on now come as optional
+ arguments at the end of the command line.
+
+ - drop (long-deprecated) -q option.
+
+ - re-ordered options in usage message to be alphabetical, and
+ changed description of some options to be more similar to snmpd
+ options (where appropriate).
+
+2001-12-19 04:38 jbpn
+
+ * agent/snmpd.c:
+
+ - drop -p and -T options. Addresses to listen on now come as
+ optional arguments at the end of the command line.
+
+ - re-ordered options in usage message to be alphabetical, plus
+ minor formatting tweaks.
+
+ - re-written options processing loop to use optarg().
+
+2001-12-18 08:44 jbpn
+
+ * mibs/: UCD-SNMP-MIB.txt (V4-2-patches.5), UCD-SNMP-MIB.txt:
+
+ - add OBJECT IDENTIFIER for win32 agent
+
+2001-12-18 08:16 hardaker
+
+ * agent/helpers/old_api.c:
+
+ warning -> debug.
+
+2001-12-17 10:15 jbpn
+
+ * agent/snmp_agent.c:
+
+ - handle getNext queries where the initial varbind->type is
+ ASN_PRIV_INCL_RANGE (these currently arise only in AgentX
+ subagents but the handling is not specific to AgentX).
+
+ Basically this is done by performing a GET first on all the
+ variables in a request. For variables that had an initial type of
+ ASN_PRIV_INCL_RANGE and were satisfied by this initial GET, we use
+ this value as the result. For variables that did not have an
+ initial type of ASN_PRIV_INCL_RANGE, or variable that had and
+ initial type of ASN_PRIV_INCL_RANGE but were not satisfied by this
+ GET request, we proceed to perform a GET-NEXT type request as
+ normal.
+
+2001-12-17 10:04 jbpn
+
+ * agent/helpers/old_api.c:
+
+ - add function register_mib_table_row() which emulates old
+ functionality.
+
+ - use snmp_handler_registration_free() in register_old_api().
+
+2001-12-17 09:39 jbpn
+
+ * snmplib/mib.c:
+
+ - fix bogus indent
+
+2001-12-17 09:38 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - right number of arguments for register_mib_context2() in
+ register_agentx_list().
+
+ - use snmp_handler_registration_free() in ditto.
+
+2001-12-13 19:22 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ remove handler injection order (serialize needs to be called first)
+
+2001-12-13 19:22 hardaker
+
+ * agent/snmp_agent.c:
+
+ remove unneeded check for already answered ASN_NULLs in first pass.
+
+2001-12-12 09:31 hardaker
+
+ * perl/AnyData_SNMP/: .cvsignore , INSTALL , MANIFEST
+ , README , snmpsh:
+
+ - doc update.
+ - snmpsh now supports aliases so you can define command sets.
+ - snmpsh now reads a ~/.snmpshrc file for storing these defined aliases.
+
+2001-12-12 06:42 jbpn
+
+ * agent/agent_registry.c:
+
+ - new function join_subtree() which repairs "punctured" subtrees
+ (these arise in particular when AgentX row registrations are
+ withdrawn).
+
+ - copy reginfo when doing a range registration (as we used to do
+ with the variable structure), since each node must stand alone.
+
+ - add parameter to register_mib_context2 to allow REGISTER_OID
+ callbacks to be withheld (for instance, you need this to avoid
+ excess AgentX traffic for row registrations).
+
+ - remove register_mib_table_row() -- this has moved to old_api.c
+
+ - call join_subtree() in unregister_mibs_by_session().
+
+2001-12-12 06:33 jbpn
+
+ * agent/: agent_handler.c , agent_handler.h:
+
+ - add functions snmp_handler_free(), snmp_handler_dup(),
+ snmp_handler_registration_dup() and
+ snmp_handler_registration_free().
+
+2001-12-11 18:41 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Fix bug where pdu->contextName is NULL.
+
+2001-12-11 07:34 hardaker
+
+ * local/mib2c:
+
+ BITS: ipaddr -> octet_str
+
+2001-12-11 04:11 jbpn
+
+ * agent/: snmp_agent.c , snmp_agent.h ,
+ mibgroup/agentx/master.c:
+
+ - send INCLUSIVE search ranges if appropriate
+
+2001-12-10 20:43 rstory
+
+ * local/mib2c:
+
+ add noaccess flag for not-accessible nodes
+
+2001-12-10 14:51 hardaker
+
+ * perl/AnyData_SNMP/: Changes , DBD_AnyData.patch ,
+ Format.pm , INSTALL , MANIFEST , Makefile.PL ,
+ Storage.pm , snmpsh:
+
+ First version
+
+2001-12-10 03:20 jbpn
+
+ * agent/agent_read_config.c:
+
+ - don't strdup arg to ds_set_string
+
+2001-12-10 03:19 jbpn
+
+ * snmplib/read_config.c:
+
+ - ditto in set_persistent_directory()
+
+2001-12-10 03:18 jbpn
+
+ * snmplib/read_config.c:
+
+ - don't strdup() in set_configuration_directory() because
+ ds_set_string() already does that for you.
+
+2001-12-07 09:43 hardaker
+
+ * agent/: helpers/table_iterator.c , helpers/table_iterator.h
+ , mibgroup/agent/nsTransactionTable.c ,
+ mibgroup/mibII/vacm_context.c:
+
+ - Implement new mantra: "always pass more information, rather than less".
+ - fix table iterater GETNEXTs for missing data points.
+ - add a new hook to free loop contexts at the end of the entire iteration.
+
+2001-12-06 06:58 jbpn
+
+ * agent/mibgroup/agentx/: client.c (JBPN-CBL-4.1), client.c:
+
+ - if request IDs don't match, then call handle_agentx_packet() --
+ copes better with unexpected packets, in particular fixes
+ intermittent duplicate trap issue (due to resent
+ agentx-Notify-PDU).
+
+2001-12-05 13:46 hardaker
+
+ * snmplib/snmp-tc.c:
+
+ Ahem. Opps. Missing includes.
+ - note to self: compile first, *then* check in changes.
+
+2001-12-05 13:41 hardaker
+
+ * snmplib/snmp-tc.c:
+
+ add in the missing functions from the NEW-AGENT-API branch.
+ (and to answer Robert's pending question of what happened, it was
+ likely one of the files that failed to commit on my side that you
+ tried to fix and somewhere between the two of us the changes were lost).
+
+2001-12-05 10:03 jbpn
+
+ * man/snmpcmd.1:
+
+ - minor tweaks
+
+2001-12-05 09:14 jbpn
+
+ * man/snmpcmd.1:
+
+ - add TCP/IPv6 domain to AGENT SPEC section
+
+ - incorporate suggestions from rstory
+
+2001-12-05 08:47 jbpn
+
+ * snmplib/snmpTCPIPv6Domain.c:
+
+ - use SOCK_STREAM not SOCK_DGRAM (duh!). You wouldn't believe how
+ confusing this was -- e.g. how on *earth* can that connect() be
+ succeeding!
+
+2001-12-05 08:36 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - make sure to close socket if you can't malloc the encoded far-end
+ address in snmp_tcp_transport()
+
+2001-12-05 08:27 hardaker
+
+ * win32/: snmptranslate/snmptranslate.dsp ,
+ snmptrap/snmptrap.dsp , snmptrapd/snmptrapd.dsp ,
+ snmpusm/snmpusm.dsp , snmpvacm/snmpvacm.dsp:
+
+ merge from 4.2 patches to main line
+
+2001-12-05 08:23 hardaker
+
+ * ChangeLog , FAQ , NEWS , README ,
+ README.win32 , acconfig.h , config.h.in ,
+ configure , configure.in , sedscript.in ,
+ agent/agent_callbacks.h , agent/agent_read_config.c ,
+ agent/snmpd.c , agent/mibgroup/kernel_sunos5.c ,
+ agent/mibgroup/versiontag , agent/mibgroup/host/hr_disk.c
+ , agent/mibgroup/host/hr_partition.c ,
+ agent/mibgroup/host/hr_system.c , agent/mibgroup/mibII/at.c
+ , agent/mibgroup/mibII/icmp.c ,
+ agent/mibgroup/mibII/interfaces.c , agent/mibgroup/mibII/ip.c
+ , agent/mibgroup/mibII/ipAddr.c ,
+ agent/mibgroup/mibII/kernel_linux.c ,
+ agent/mibgroup/mibII/kernel_linux.h ,
+ agent/mibgroup/mibII/route_write.c ,
+ agent/mibgroup/mibII/system_mib.c ,
+ agent/mibgroup/mibII/tcp.c , agent/mibgroup/mibII/tcpTable.c
+ , agent/mibgroup/mibII/udp.c ,
+ agent/mibgroup/mibII/udpTable.c ,
+ agent/mibgroup/mibII/var_route.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/ucd-snmp/disk.c ,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c ,
+ apps/snmpnetstat/if.c , local/mib2c , local/tkmib
+ , man/snmpd.conf.5.def , mibs/UCD-SNMP-MIB.txt ,
+ perl/SNMP/SNMP.pm , snmplib/asn1.c ,
+ snmplib/default_store.h , snmplib/mib.c ,
+ snmplib/read_config.c , snmplib/read_config.h ,
+ snmplib/snmp.h , snmplib/snmp_api.c ,
+ win32/snmpwalk/snmpwalk.dsp , win32/config.h ,
+ win32/mib_module_config.h , win32/mib_module_includes.h ,
+ win32/mib_module_inits.h , win32/win32.dsw ,
+ win32/win32.opt , win32/encode_keychange/encode_keychange.dsp
+ , win32/libagent/libagent.dsp , win32/libsnmp/libsnmp.dsp
+ , win32/libsnmp_dll/libsnmp.def ,
+ win32/libsnmp_dll/libsnmp_dll.dsp ,
+ win32/libucdmibs/libucdmibs.dsp ,
+ win32/snmpbulkget/snmpbulkget.dsp ,
+ win32/snmpbulkwalk/snmpbulkwalk.dsp , win32/snmpd/snmpd.dsp
+ , win32/snmpdelta/snmpdelta.dsp , win32/snmpdf/snmpdf.dsp
+ , win32/snmpget/snmpget.dsp ,
+ win32/snmpgetnext/snmpgetnext.dsp ,
+ win32/snmpnetstat/snmpnetstat.dsp , win32/snmpset/snmpset.dsp
+ , win32/snmpstatus/snmpstatus.dsp ,
+ win32/snmptable/snmptable.dsp , win32/snmptest/snmptest.dsp:
+
+ merge from 4.2 patches to main line
+
+2001-12-05 07:51 jbpn
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ - fix bug in address parser
+
+2001-12-05 07:48 jbpn
+
+ * snmplib/: snmpTCPIPv6Domain.c , snmpUDPIPv6Domain.c:
+
+ - minor changes to, ahem, make it compile
+
+2001-12-05 07:42 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - conditionalise #include <fcntl.h>
+
+2001-12-05 07:38 jbpn
+
+ * snmplib/snmp_transport.c:
+
+ - fix typo
+
+2001-12-05 07:29 jbpn
+
+ * acconfig.h , configure.in:
+
+ - mention the TCP/IPv6 transport in config, and add a #define for it
+ if appropriate
+
+2001-12-05 07:28 jbpn
+
+ * snmplib/snmp_transport.c:
+
+ - call snmp_tcp6_ctor() if appropriate
+
+2001-12-05 07:27 jbpn
+
+ * snmplib/: snmpTCPIPv6Domain.c , snmpTCPIPv6Domain.h:
+
+ - TCP/IPv6 transport domain. Untested.
+
+2001-12-05 07:19 jbpn
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ - make encoded addresses at transport open time
+
+2001-12-05 07:17 jbpn
+
+ * snmplib/: snmpTCPDomain.c , snmp_transport.h:
+
+ - move #definition of SNMP_STREAM_QUEUE_LEN from snmpTCPDomain.c
+ to snmp_transport.h
+
+2001-12-05 07:10 hardaker
+
+ * agent/: snmp_agent.c , snmp_vars.c:
+
+ remove some unneeded functions like, oh, I don't know, getStatPtr().
+
+2001-12-05 05:43 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - remove legacy callback operation names
+
+2001-12-05 05:06 jbpn
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ - changed textual address parsing
+
+2001-12-04 22:52 nba
+
+ * snmplib/snmpUDPIPv6Domain.c:
+
+ Fix bind parameters, so that the agent works
+
+2001-12-04 13:36 hardaker
+
+ * agent/helpers/table.h , agent/helpers/table_iterator.c
+ , agent/helpers/table_iterator.h ,
+ agent/mibgroup/agent/nsTransactionTable.c ,
+ agent/mibgroup/mibII/vacm_context.c , local/mib2c.iterate.conf:
+
+ - move forgotten function typedefs to iterator specific header file.
+ - add a void * pointer for the callbacks to make functions more reusable.
+
+2001-12-04 13:11 hardaker
+
+ * agent/helpers/table.h , agent/helpers/table_iterator.c
+ , agent/helpers/table_iterator.h ,
+ agent/mibgroup/agent/nsTransactionTable.c ,
+ agent/mibgroup/mibII/vacm_context.c , local/mib2c.iterate.conf:
+
+ move iterator specific table information into its own structure.
+
+2001-12-04 12:16 hardaker
+
+ * agent/helpers/all_helpers.h:
+
+ Fix prototype as pointed out by Jerome Peducasse
+
+2001-12-04 10:10 jbpn
+
+ * man/snmpcmd.1:
+
+ - mention that not all transport domains are always available.
+
+2001-12-04 09:55 jbpn
+
+ * man/snmpcmd.1:
+
+ - remove -p and -T options from documentation.
+
+ - add lengthy new section describing new transport address
+ specification format, with examples and everything!
+
+2001-12-04 07:14 jbpn
+
+ * snmplib/snmp_parse_args.c:
+
+ - drop -p and -T options for apps.
+
+2001-12-04 03:10 jbpn
+
+ * snmplib/: snmpUDPIPv6Domain.c , snmpUDPIPv6Domain.h:
+
+ - add create_ostring method, export ucdSnmpUDPIPv6Domain[]
+
+2001-12-04 02:19 jbpn
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - mention IPv6 transport domain OIDs in relevant comment.
+
+2001-12-03 15:07 nba
+
+ * snmplib/snmpUDPDomain.c:
+
+ Quell a const cast warning.
+
+2001-12-03 15:07 nba
+
+ * snmplib/snmp_api.c:
+
+ Fix debug output from retries.
+
+2001-12-03 15:06 nba
+
+ * apps/notification_log.c , snmplib/oid_array.c:
+
+ HAVE_SYS_TYPES_H is not conditional.
+
+2001-12-03 15:04 nba
+
+ * apps/Makefile.in:
+
+ Fix to allow compilations outside source directory.
+
+2001-12-03 15:03 nba
+
+ * acconfig.h , config.h.in , configure ,
+ configure.in , snmplib/snmpUDPIPv6Domain.c ,
+ snmplib/snmp_transport.c:
+
+ Fixes to make UDPIPv6 transport work for Solaris, Linux and FreeBSD.
+ It compiles, and the apps send v6 packets. Agent not yet tested.
+
+2001-12-03 09:48 hardaker
+
+ * local/: mib2c.iterate.conf , mib2c.create-dataset.conf:
+
+ copy roberts spiffy header text
+
+2001-12-03 08:36 hardaker
+
+ * apps/notification_log.c:
+
+ datentime column.
+
+2001-12-03 08:01 hardaker
+
+ * agent/snmp_agent.c:
+
+ fix problem with double delegated requests after getnext loop.
+
+2001-12-03 08:00 hardaker
+
+ * configure , configure.in ,
+ mibs/NOTIFICATION-LOG-MIB.txt:
+
+ notification log mib added to default list.
+
+2001-12-03 05:33 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - remove spurious debugging output ("blah")
+
+2001-11-30 23:26 hardaker
+
+ * agent/: agent_handler.c , snmp_agent.c , snmp_agent.h:
+
+ Change how request processing gets done such that request objects are
+ all calloced at once and get reused instead of reallocated. Big speed
+ improvements.
+
+2001-11-30 15:22 hardaker
+
+ * Makefile.in , doxygen.conf:
+
+ "make doc" to run doxygen.
+
+2001-11-30 10:31 hardaker
+
+ * agent/helpers/: debug_handler.c , multiplexer.h:
+
+ doxygen fixes
+
+2001-11-30 09:26 jbpn
+
+ * agent/agent_handler.c:
+
+ - use DEBUGMSGOIDRANGE in register_handler() if appropriate.
+
+2001-11-30 09:24 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - fix memory leak in register_agentx_list() when subagent tries to
+ register a MIB region that fails either because it is a duplicate
+ or because of some other reason.
+
+2001-11-30 08:44 jbpn
+
+ * agent/helpers/old_api.c:
+
+ - fix memory leak of old_info (that never seems to get used for
+ anything anyway?)
+
+ - fix memory leak that arises during row registration (in AgentX
+ subagents) because successive vars cause apparent duplicate
+ registrations (this is a deficiency) -- but it would appear this
+ could arise in other situations too (genuine duplicate
+ registrations).
+
+2001-11-30 06:33 jbpn
+
+ * agent/agent_trap.c:
+
+ - fix broken parsing in snmpd_parse_config_trapsess() -- loop was
+ copying the same (first) token MAX_ARGS times.
+
+ - eliminate memory leak in ditto.
+
+ - fix typo ("Pausible cause" -> "Possible cause) in ditto.
+
+2001-11-30 06:29 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - print fd in sess_process_packet() -- useful for debugging
+
+2001-11-30 06:28 jbpn
+
+ * snmplib/: snmpCallbackDomain.c , snmpCallbackDomain.h:
+
+ - remove a couple of unnecessary #includes from snmpCallbackDomain.h
+
+ - set *opaque to NULL after we free it -- it might matter.
+
+2001-11-30 03:47 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - clone PDU in handle_agentx_subagent() before sending it on callback
+ session to avoid double free() and free()d memory reads.
+
+ - more concise (ahem) declaration of mycallback in handle_agentx_packet().
+
+2001-11-29 05:51 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - put session and subsession in subagent description (helpful for
+ debugging)
+
+2001-11-29 05:49 jbpn
+
+ * agent/helpers/Makefile.in:
+
+ - fix INSTALLHEADERS
+
+2001-11-29 05:48 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - add some debugging to init_subagent() (which showed that it wasn't
+ being called, so...).
+
+ - fix cast in handle_subagent_set_response()
+
+2001-11-29 05:46 jbpn
+
+ * agent/snmp_vars.c:
+
+ - make sure init_subagent() gets called
+
+2001-11-28 09:28 hardaker
+
+ * agent/agent_registry.c:
+
+ check for session registrations in all contexts.
+
+2001-11-28 06:39 hardaker
+
+ * apps/notification_log.c , snmplib/oid_array.c:
+
+ Add sys/types.h for bug #486277.
+
+2001-11-28 04:03 jbpn
+
+ * apps/notification_log.c:
+
+ - #include <netdb.h>
+
+2001-11-28 04:03 jbpn
+
+ * configure.in , snmplib/Makefile.in:
+
+ - install snmp_transport.h and snmp*Domain.h (for the configured
+ transport domains)
+
+2001-11-28 03:29 jbpn
+
+ * snmplib/ucd-snmp-includes.h:
+
+ - reverse mystery removal of #include <netinet/in.h> and #include
+ <sys/time.h>
+
+2001-11-27 17:28 hardaker
+
+ * agent/: snmp_agent.c , snmp_agent.h:
+
+ more intelligently allocate tree space based on number of varbinds in request.
+
+2001-11-27 14:26 hardaker
+
+ * agent/: snmp_agent.c , snmp_agent.h:
+
+ malloc one large tree_cache array rather than an array of tree_cache pointers.
+
+2001-11-27 12:19 hardaker
+
+ * agent/helpers/all_helpers.h:
+
+ include file name change.
+
+2001-11-27 11:43 hardaker
+
+ * agent/snmp_agent.c:
+
+ comment changes.
+
+2001-11-27 07:52 hardaker
+
+ * apps/Makefile.in:
+
+ fixed Makefile for snmptrapd.
+
+2001-11-27 07:48 hardaker
+
+ * agent/helpers/: Makefile.in , all_helpers.c ,
+ all_helpers.h , debug_handler.c , debug_handler.h:
+
+ debug handler created for inserting debugging output into the calling chain.
+
+2001-11-27 07:47 hardaker
+
+ * agent/agent_handler.c:
+
+ enum definitions for modes and can_modes.
+
+2001-11-26 15:29 hardaker
+
+ * agent/snmp_agent.c:
+
+ set PDU variable to NULL to avoid freeing it twice.
+
+2001-11-26 11:20 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ plug another memory leak.
+
+2001-11-26 09:07 hardaker
+
+ * testing/tests/: T020snmpv3get , T021snmpv3getnext ,
+ T022snmpv3getMD5 , T023snmpv3getMD5DES ,
+ T024snmpv3getSHA1 , T025snmpv3getSHADES ,
+ T028snmpv3getfail , T030snmpv3usercreation ,
+ T053agentv1trap , T054agentv2ctrap , T055agentv1mintrap
+ , T056agentv2cmintrap , T110agentxget ,
+ T111agentxset , T112agentxsetfail , T113agentxtrap ,
+ T120proxyget , T121proxyset , T122proxysetfail:
+
+ don't use contexts in tests.
+
+2001-11-26 08:57 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ fix memory leak.
+
+2001-11-26 08:49 hardaker
+
+ * agent/mibgroup/: testdelayed.c , agentx/master.c ,
+ ucd-snmp/proxy.c:
+
+ use free_delegated_cache() to plug memory leaks.
+
+2001-11-26 08:48 hardaker
+
+ * agent/: agent_handler.c , agent_handler.h:
+
+ free_delegated_cache() routine
+
+2001-11-26 08:19 jbpn
+
+ * apps/snmptrapd.c:
+
+ - add the ability to listen for traps on multiple transports via the
+ -p option (consistent with snmpd).
+
+2001-11-26 05:44 jbpn
+
+ * agent/mibgroup/target/target.c:
+
+ - use snmp_tdomain_transport_oid() to do session creation from
+ <tDomain-oid, tAddress-octet-string> pair, to allow creation of
+ non-IPv4 sessions in snmpTargetAddrTable.
+
+2001-11-26 04:45 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c , snmpIPXDomain.c ,
+ snmpTCPDomain.c , snmpUDPDomain.c , snmpUnixDomain.c
+ , snmp_transport.c , snmp_transport.h:
+
+ - add support for creating a transport from a
+ <tDomain-oid, tAddress-octet-string> pair.
+
+2001-11-26 03:06 jbpn
+
+ * agent/mibgroup/target/target.c:
+
+ - use snmp_tdomain_support() to determine whether a transport domain
+ is supported.
+
+2001-11-23 10:24 jbpn
+
+ * apps/snmptrapd.c:
+
+ - add multiple transport domain support for trapd -- this was really
+ REALLY easy!
+
+2001-11-23 09:25 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.c ,
+ snmplib/snmp_transport.c , snmplib/snmp_transport.h:
+
+ - remove legacy function snmp_transport_support() (replaced with
+ snmp_tdomain_support()).
+
+2001-11-23 08:57 jbpn
+
+ * snmplib/snmpAAL5PVCDomain.c:
+
+ - use network order for AAL5PVC transport address encoding
+
+2001-11-23 08:47 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c , snmpIPXDomain.c ,
+ snmpUnixDomain.c:
+
+ - set local_length, remote_length as appropriate
+
+2001-11-23 08:39 jbpn
+
+ * snmplib/Makefile.in:
+
+ - fix typo
+
+2001-11-23 08:34 jbpn
+
+ * agent/: agent_trap.c ,
+ mibgroup/notification/snmpNotifyTable.c:
+
+ - make traps work with new-style addresses, use domain-based address
+ encodings in snmpTargetAddrTable. Note you can now send traps/informs
+ over any supported transport type by using the trapsess directive and
+ a transport:address type specification.
+
+2001-11-23 08:31 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c , snmpIPXDomain.c ,
+ snmpTCPDomain.c , snmpUDPDomain.c , snmpUnixDomain.c:
+
+ - create appropriately-encoded local or remote endpoint addresses at
+ transport open time.
+
+2001-11-23 06:50 jbpn
+
+ * snmplib/Makefile.in:
+
+ - update dependencies for transports
+
+2001-11-22 09:08 jbpn
+
+ * testing/: TESTCONF.sh , eval_tools.sh ,
+ tests/T001snmpv1get , tests/T002snmpv1getnext ,
+ tests/T003snmpv1getfail , tests/T014snmpv2cget ,
+ tests/T015snmpv2cgetnext , tests/T016snmpv2cgetfail ,
+ tests/T017snmpv2ctov1getfail , tests/T018snmpv1tov2cgetfail
+ , tests/T020snmpv3get , tests/T021snmpv3getnext ,
+ tests/T022snmpv3getMD5 , tests/T023snmpv3getMD5DES ,
+ tests/T024snmpv3getSHA1 , tests/T025snmpv3getSHADES ,
+ tests/T028snmpv3getfail , tests/T030snmpv3usercreation ,
+ tests/T049snmpv3inform , tests/T050snmpv3trap ,
+ tests/T051snmpv2ctrap , tests/T052snmpv2cinform ,
+ tests/T053agentv1trap , tests/T054agentv2ctrap ,
+ tests/T055agentv1mintrap , tests/T056agentv2cmintrap ,
+ tests/T058agentauthtrap , tests/T100agenthup ,
+ tests/T110agentxget , tests/T111agentxset ,
+ tests/T112agentxsetfail , tests/T113agentxtrap ,
+ tests/T120proxyget , tests/T121proxyset ,
+ tests/T122proxysetfail:
+
+ - use udp:<hostname>:<port> instead of -p to make tests work again
+
+2001-11-22 00:20 hardaker
+
+ * apps/: notification_log.c , notification_log.h:
+
+ mork wore on the notification log mib. It now supports variable
+ storage, but segfaults on access due to pdu cloning problems I'm not
+ going to work out right now.
+
+2001-11-21 23:15 hardaker
+
+ * apps/Makefile.in:
+
+ fix snmptrapd linking.
+
+2001-11-21 22:58 rstory
+
+ * snmplib/asn1.h:
+
+ remove duplicate OID_LENGTH; use actual oid type in calculation
+
+2001-11-21 22:49 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ add NULL pointer for rbuild in session creation.
+
+2001-11-21 22:49 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c , apps/notification_log.c:
+
+ netinet/in.h needed.
+
+2001-11-21 22:49 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ variable clean ups.
+
+2001-11-21 22:33 hardaker
+
+ * agent/mibgroup/agentx/master_request.c ,
+ agent/mibgroup/mibII/icmp.c , agent/mibgroup/mibII/tcpTable.c
+ , agent/mibgroup/mibII/udpTable.c ,
+ agent/mibgroup/ucd-snmp/file.c , local/mib2c ,
+ local/mib2c.array-auto.conf , local/mib2c.array-user.conf
+ , local/mib2c.create-dataset.conf ,
+ local/mib2c.iterate.conf , local/mib2c.vartypes.conf ,
+ man/Makefile.in , mibs/Makefile.in ,
+ mibs/NET-SNMP-AGENT-MIB.txt , perl/SNMP/SNMP.xs ,
+ snmplib/Makefile.in , snmplib/mib.c , snmplib/mib.h
+ , snmplib/read_config.c , snmplib/read_config.h ,
+ snmplib/snmp-tc.h , snmplib/snmpUnixDomain.h ,
+ snmplib/snmp_api.c , snmplib/snmp_api.h ,
+ snmplib/snmp_client.c , snmplib/snmp_client.h ,
+ snmplib/snmp_transport.c , snmplib/snmp_transport.h ,
+ snmplib/tools.c , snmplib/tools.h , snmplib/vacm.c:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 22:08 rstory
+
+ * snmplib/: vacm.h , asn1.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 21:43 rstory
+
+ * snmplib/: snmpCallbackDomain.c , snmpCallbackDomain.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 21:40 rstory
+
+ * snmplib/snmp.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 21:33 rstory
+
+ * snmplib/: oid_array.c , oid_array.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 21:30 rstory
+
+ * snmplib/: data_list.c , data_list.h:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 18:56 hardaker
+
+ * Makefile.in , config.h.in , configure ,
+ configure.in , version.h , agent/Makefile.in ,
+ agent/agent_handler.c , agent/agent_handler.h ,
+ agent/agent_index.c , agent/agent_read_config.c ,
+ agent/agent_registry.c , agent/agent_registry.h ,
+ agent/mib_modules.c , agent/snmp_agent.c ,
+ agent/snmp_agent.h , agent/snmp_vars.c , agent/snmpd.c
+ , agent/ucd-snmp-agent-includes.h , agent/var_struct.h
+ , agent/helpers/.cvsignore , agent/helpers/Makefile.in
+ , agent/helpers/all_helpers.c ,
+ agent/helpers/all_helpers.h , agent/helpers/instance.c ,
+ agent/helpers/instance.h , agent/helpers/multiplexer.c ,
+ agent/helpers/multiplexer.h , agent/helpers/null.c ,
+ agent/helpers/null.h , agent/helpers/old_api.c ,
+ agent/helpers/old_api.h , agent/helpers/read_only.c ,
+ agent/helpers/read_only.h , agent/helpers/serialize.c ,
+ agent/helpers/serialize.h , agent/helpers/set_helper.h ,
+ agent/helpers/table.c , agent/helpers/table.h ,
+ agent/helpers/table_array.c , agent/helpers/table_array.h
+ , agent/helpers/table_data.c , agent/helpers/table_data.h
+ , agent/helpers/table_dataset.c ,
+ agent/helpers/table_dataset.h , agent/helpers/table_iterator.c
+ , agent/helpers/table_iterator.h ,
+ agent/mibgroup/Makefile.in , agent/mibgroup/host_res.h
+ , agent/mibgroup/mibincl.h , agent/mibgroup/target.h
+ , agent/mibgroup/testdelayed.c ,
+ agent/mibgroup/testdelayed.h , agent/mibgroup/testhandler.c
+ , agent/mibgroup/testhandler.h ,
+ agent/mibgroup/util_funcs.c , agent/mibgroup/util_funcs.h
+ , agent/mibgroup/agent/nsTransactionTable.c ,
+ agent/mibgroup/agent/nsTransactionTable.h ,
+ agent/mibgroup/agentx/.cvsignore ,
+ agent/mibgroup/agentx/client.c ,
+ agent/mibgroup/agentx/master.c ,
+ agent/mibgroup/agentx/master.h ,
+ agent/mibgroup/agentx/master_admin.c ,
+ agent/mibgroup/agentx/subagent.c ,
+ agent/mibgroup/disman/.cvsignore ,
+ agent/mibgroup/disman/mteTriggerTable.c ,
+ agent/mibgroup/examples/.cvsignore ,
+ agent/mibgroup/host/hr_disk.c , agent/mibgroup/host/hr_disk.h
+ , agent/mibgroup/host/hr_partition.c ,
+ agent/mibgroup/host/hr_partition.h ,
+ agent/mibgroup/host/hr_swinst.c ,
+ agent/mibgroup/mibII/.cvsignore ,
+ agent/mibgroup/mibII/interfaces.c , agent/mibgroup/mibII/ip.c
+ , agent/mibgroup/mibII/system_mib.c ,
+ agent/mibgroup/mibII/tcp.c , agent/mibgroup/mibII/udp.c
+ , agent/mibgroup/mibII/vacm_context.c ,
+ agent/mibgroup/mibII/vacm_context.h ,
+ agent/mibgroup/mibII/vacm_vars.c ,
+ agent/mibgroup/mibII/vacm_vars.h ,
+ agent/mibgroup/target/target_counters.c ,
+ agent/mibgroup/target/target_counters.h ,
+ agent/mibgroup/ucd-snmp/proxy.c ,
+ agent/mibgroup/ucd-snmp/proxy.h ,
+ agent/mibgroup/ucd-snmp/registry.c , apps/Makefile.in ,
+ apps/notification_log.c , apps/notification_log.h ,
+ apps/snmptrapd.c:
+
+ Death: UCD-SNMP
+ Birth: NET-SNMP
+ (new agent API merged to the main branch)
+
+2001-11-21 06:43 jbpn
+
+ * config.h.in:
+
+ - IPv6 config defs
+
+2001-11-21 06:36 jbpn
+
+ * agent/snmp_agent.c , snmplib/snmp_api.c:
+
+ - remove now-extraneous #include "snmpBlahDomain.h" lines
+
+2001-11-21 03:39 jbpn
+
+ * apps/.cvsignore:
+
+ [no log message]
+
+2001-11-20 09:38 jbpn
+
+ * snmplib/: snmpIPXDomain.c , snmpIPXDomain.h:
+
+ - duh. Forgot a couple of things to do with domain-based transport
+ address parsing.
+
+2001-11-20 09:29 jbpn
+
+ * agent/snmp_agent.c:
+
+ - use new domain-based transport address parsing for agent NSAPs
+
+2001-11-20 09:27 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c , snmpAAL5PVCDomain.h ,
+ snmpIPXDomain.c , snmpTCPDomain.c , snmpTCPDomain.h
+ , snmpUDPDomain.c , snmpUDPDomain.h ,
+ snmpUnixDomain.c , snmpUnixDomain.h , snmp_api.c ,
+ snmp_transport.c , snmp_transport.h:
+
+ - domain-based transport address parsing
+
+2001-11-20 09:16 jbpn
+
+ * snmplib/: snmpUDPIPv6Domain.c , snmpUDPIPv6Domain.h:
+
+ - UDP/IPv6 transport domain. Note: incomplete!
+
+2001-11-20 08:29 jbpn
+
+ * agent/: agent_index.c , agent_index.h:
+
+ - unregister_{string,int,oid}_index() utility functions contributed
+ by Damian Gilmurray.
+
+2001-11-20 02:26 jbpn
+
+ * snmplib/: snmp_api.h (V4-2-patches.1), snmp_api.h:
+
+ - remove duplicate definition of SNMP_MAX_SEC_NAME_SIZE, noted by
+ Karl M. Hegbloom.
+
+2001-11-19 16:59 driehuis
+
+ * snmplib/asn1.h:
+
+ Fix typo in comment [karlheg@microsharp.com]
+
+2001-11-16 08:34 jbpn
+
+ * apps/snmptest.c:
+
+ - add support for Unsigned32/Gauge32 types
+
+2001-11-15 10:03 jbpn
+
+ * agent/mibgroup/agentx/: protocol.c (V4-2-patches.5), protocol.c:
+
+ - stricter test for null OIDs
+
+2001-11-15 08:44 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - document read-only nature of snmpEnableAuthenTraps.0 if value is
+ configured via the authtrapenable token
+
+2001-11-15 08:44 jbpn
+
+ * agent/: agent_read_config.c , agent_trap.c ,
+ mibgroup/mibII/snmp_mib.c:
+
+ - make value of snmpEnableAuthenTraps.0 persistent. Setting via
+ a read-only configuration file also makes object notWritable (as
+ sysContact.0 et al.).
+
+2001-11-15 06:57 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - let VACM checks succeed for non-IPv4 transports
+
+2001-11-15 05:19 jbpn
+
+ * testing/tests/: T111agentxset , T121proxyset:
+
+ - use psyscontact not syscontact to set initial value of sysContact.0
+ object since the latter also makes the object read-only.
+
+2001-11-15 05:07 jbpn
+
+ * agent/: snmpd.c (V4-2-patches.6), snmpd.c:
+
+ - minor fix to formatting of usage message
+
+2001-11-15 04:05 jbpn
+
+ * agent/mibgroup/agentx/agentx_config.c:
+
+ - add missing #include "snmpd.h" (for #definition of MASTER_AGENT)
+ - don't strdup() agentxsocket value -- ds_set_string does it for you
+ - change debugging to fit in better with rest of module
+
+2001-11-14 16:05 hardaker
+
+ * configure, configure.in (V4-2-patches.[7,7]), config.h.in
+ , configure , configure.in:
+
+ patch from Harrie to fix init function checking in modules
+
+2001-11-14 16:00 hardaker
+
+ * agent/mibgroup/agentx/: agentx_config.c , agentx_config.h
+ , master.c , master.h , subagent.h:
+
+ slightly modified patch from Harrie to move agentx configuration into
+ a separate file.
+
+2001-11-13 13:57 hardaker
+
+ * apps/notification_log.h:
+
+ file notification_log.h was initially added on branch NEW-AGENT-API.
+
+2001-11-13 13:57 hardaker
+
+ * apps/notification_log.c:
+
+ file notification_log.c was initially added on branch NEW-AGENT-API.
+
+2001-11-13 13:55 hardaker
+
+ * agent/mibgroup/agent/nsTransactionTable.c:
+
+ file nsTransactionTable.c was initially added on branch NEW-AGENT-API.
+
+2001-11-13 13:55 hardaker
+
+ * agent/mibgroup/agent/nsTransactionTable.h:
+
+ file nsTransactionTable.h was initially added on branch NEW-AGENT-API.
+
+2001-11-13 13:55 hardaker
+
+ * mibs/NET-SNMP-AGENT-MIB.txt:
+
+ file NET-SNMP-AGENT-MIB.txt was initially added on branch NEW-AGENT-API.
+
+2001-11-13 05:29 jbpn
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - patch from Jochen Kmietsch to quieten some noisy logging
+
+2001-11-13 04:13 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - use unregister_mib_table_row() when appropriate in
+ unregister_agentx_list().
+
+2001-11-13 03:23 jbpn
+
+ * agent/agent_registry.c:
+
+ - reset vr->namelen when we've finished with it
+
+2001-11-12 23:19 hardaker
+
+ * agent/helpers/all_helpers.c:
+
+ file all_helpers.c was initially added on branch NEW-AGENT-API.
+
+2001-11-12 23:19 hardaker
+
+ * agent/helpers/all_helpers.h:
+
+ file all_helpers.h was initially added on branch NEW-AGENT-API.
+
+2001-11-08 08:09 jbpn
+
+ * agent/agent_registry.c:
+
+ - better implementation of unregister_mib_table_row(), which uses
+ ranges properly in the callback (hence much more efficient for
+ AgentX).
+
+2001-11-07 09:56 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - remove now-redundant agentx_build functions
+
+2001-11-07 06:31 jbpn
+
+ * agent/mibgroup/agentx/: client.c , master_admin.c ,
+ protocol.c:
+
+ - use DEBUGMSGOIDRANGE() in a couple of places for more comprehensive
+ debugging output.
+
+ - parse unregister ranges properly, and use the range properly for
+ passing to unregister_mib_context().
+
+2001-11-07 03:33 jbpn
+
+ * snmplib/: snmp_debug.c , snmp_debug.h:
+
+ - add DEBUGSMSGOIDRANGE() macro for debugging OID ranges
+
+2001-11-06 06:04 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - reset the inclusive flag in a couple of cases, to prevent spurious
+ INCLUSIVE getNext behaviour
+
+2001-11-05 08:09 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - correct bug in range_subid tweak code
+
+2001-11-05 05:00 jbpn
+
+ * agent/agent_registry.c:
+
+ - calculate upper bound for table row registrations slightly differently
+
+2001-11-01 09:35 jbpn
+
+ * agent/mibgroup/agentx/: master.c , protocol.c ,
+ protocol.h , subagent.c:
+
+ - implement relocating buffer version of agentx_build() routines,
+ and use them.
+
+2001-11-01 09:33 jbpn
+
+ * snmplib/: snmp_api.c , snmp_api.h:
+
+ - support for relocatable buffer build callbacks via open_ex calls
+
+2001-10-30 07:19 jbpn
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - fix bug whereby interface counter is not reset, noted by (amongst
+ others) Victor Kirhenshtein in patch #474064.
+
+2001-10-30 03:24 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - make the initial buffer size 2048 in snmp_resend_request (as in
+ _sess_async_send) to make success/fail behaviour for AgentX more
+ predictable (since AgentX STILL doesn't use relocating buffers,
+ boo hiss).
+
+2001-10-29 23:16 rstory
+
+ * local/mib2c.array-auto.conf:
+
+ file mib2c.array-auto.conf was initially added on branch NEW-AGENT-API.
+
+2001-10-29 23:16 rstory
+
+ * local/mib2c.array-user.conf:
+
+ file mib2c.array-user.conf was initially added on branch NEW-AGENT-API.
+
+2001-10-28 14:53 rstory
+
+ * agent/helpers/table_array.c:
+
+ file table_array.c was initially added on branch NEW-AGENT-API.
+
+2001-10-28 14:53 rstory
+
+ * agent/helpers/table_array.h:
+
+ file table_array.h was initially added on branch NEW-AGENT-API.
+
+2001-10-28 14:50 rstory
+
+ * snmplib/oid_array.h:
+
+ file oid_array.h was initially added on branch NEW-AGENT-API.
+
+2001-10-28 14:50 rstory
+
+ * snmplib/oid_array.c:
+
+ file oid_array.c was initially added on branch NEW-AGENT-API.
+
+2001-10-26 19:41 hardaker
+
+ * agent/mibgroup/agentx/master.c:
+
+ patch from Harrie to fix function name in error message
+
+2001-10-26 06:05 jbpn
+
+ * agent/mibgroup/mibII/: interfaces.c , interfaces.h:
+
+ - add support for rx and tx drop counts (ifInDiscards and
+ ifOutDiscards) for Linux (2.2+)
+
+2001-10-26 05:57 jbpn
+
+ * aclocal.m4:
+
+ - add if_iqdrops member to struct ifnet
+
+2001-10-26 04:03 jbpn
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - add translation for atm(37) type interfaces for Linux
+
+2001-10-26 03:43 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - document the fact that setting sysLocation.0 (et al.) via a
+ syslocation (or equivalent) token makes the object read-only,
+ returning a notWritable error response if an attempt is made to
+ SET it.
+
+2001-10-24 10:07 jbpn
+
+ * agent/mibgroup/mibII/: system_mib.c (V4-2-patches.4),
+ system_mib.c:
+
+ - fix typo noted by Tim Dietz
+
+2001-10-24 08:43 jbpn
+
+ * agent/mibgroup/mibII/: system_mib.c , system_mib.h:
+
+ - implement persistence for sysLocation.0, sysContact.0 and sysName.0
+
+ - presence of a syslocation token in snmpd.conf makes sysLocation.0
+ non-writable (returns notWritable on SET attempts)
+
+2001-10-24 05:08 jbpn
+
+ * agent/mibgroup/host/: hr_swinst.c (V4-2-patches.2), hr_swinst.c:
+
+ - fix small memory leak just introduced
+
+2001-10-24 03:42 jbpn
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ - use pkginfo interface to determine type of software package more
+ specifically if possible. Slight variation on patch #473669, submitted
+ by Stefan Radman.
+
+2001-10-24 03:38 jbpn
+
+ * acconfig.h , configure.in:
+
+ - autoconf support for detecting pkginfo interface in libadm. Thanks
+ to Stefan Radman (patch #473669).
+
+2001-10-21 07:26 hardaker
+
+ * local/mib2c.iterate.conf:
+
+ file mib2c.iterate.conf was initially added on branch NEW-AGENT-API.
+
+2001-10-19 09:51 hardaker
+
+ * local/mib2c.create-dataset.conf:
+
+ file mib2c.create-dataset.conf was initially added on branch NEW-AGENT-API.
+
+2001-10-17 07:52 dts12
+
+ * FAQ (V4-2-patches.2), FAQ:
+
+ Mention the MRTG tutorial web pages
+ (as suggested by Christian Robottom Reis)
+
+2001-10-15 06:49 jbpn
+
+ * snmplib/: snmpIPXDomain.c , snmpUDPDomain.c:
+
+ - zero socket address structures. Hopefully fixes problems on NetBSD
+ noted by Joakim Althini (related to sa_len member probably??).
+
+2001-10-11 16:30 hardaker
+
+ * agent/Makefile.in , agent/mibgroup/Makefile.in ,
+ snmplib/mib.c , snmplib/snmp_api.c:
+
+ Oppses.
+
+2001-10-11 14:15 hardaker
+
+ * man/Makefile.in , man/snmp_api_errstring.3 ,
+ man/snmp_config.5.def , man/snmp_error.3 ,
+ man/snmp_perror.3 , man/snmp_sess_perror.3 ,
+ man/snmpcmd.1 , man/snmpd.1.def , man/snmpd.conf.5.def
+ , man/snmpset.1 , man/snmptranslate.1 ,
+ man/snmptrapd.8 , man/snmptrapd.conf.5.def ,
+ man/snmpwalk.1 , mibs/DISMAN-SCRIPT-MIB.txt ,
+ mibs/IANAifType-MIB.txt , mibs/Makefile.mib ,
+ mibs/README.mibs , mibs/SMUX-MIB.txt ,
+ mibs/UCD-SNMP-MIB.txt , mibs/mibfetch , mibs/rfclist
+ , mibs/smistrip , perl/SNMP/SNMP.xs ,
+ snmplib/Makefile.in , snmplib/asn1.c ,
+ snmplib/default_store.c , snmplib/int64.c ,
+ snmplib/mib.c , snmplib/mib.h , snmplib/mt_support.c
+ , snmplib/mt_support.h , snmplib/parse.c ,
+ snmplib/scapi.c , snmplib/scapi.h , snmplib/snmp_api.c
+ , snmplib/snmp_auth.c , snmplib/snmp_client.c ,
+ snmplib/snmp_debug.c , snmplib/snmpusm.c ,
+ snmplib/snmpv3.c , snmplib/system.c , snmplib/tools.c
+ , snmplib/ucd-snmp-includes.h , testing/Makefile.in
+ , win32/config.h , win32/config.h.borland:
+
+ massive merge from the patches branch to the main line.
+
+2001-10-11 14:01 hardaker
+
+ * COPYING , ChangeLog , FAQ , Makefile.in ,
+ NEWS , README , acconfig.h , aclocal.m4 ,
+ config.guess , config.h.in , config.sub ,
+ configure , configure.in , ltconfig , ltmain.sh
+ , makefileindepend.pl , sedscript.in , version.h
+ , agent/Makefile.in , agent/agent_index.c ,
+ agent/agent_read_config.c , agent/agent_read_config.h ,
+ agent/agent_registry.c , agent/agent_trap.c ,
+ agent/snmp_agent.h , agent/snmp_vars.c ,
+ agent/snmp_vars.h , agent/snmpd.c ,
+ agent/mibgroup/Makefile.in , agent/mibgroup/kernel_sunos5.c
+ , agent/mibgroup/mibincl.h , agent/mibgroup/ucd_snmp.h
+ , agent/mibgroup/util_funcs.c ,
+ agent/mibgroup/examples/example.c ,
+ agent/mibgroup/host/hr_disk.c ,
+ agent/mibgroup/host/hr_partition.c ,
+ agent/mibgroup/host/hr_print.c ,
+ agent/mibgroup/host/hr_storage.c ,
+ agent/mibgroup/host/hr_swrun.c ,
+ agent/mibgroup/host/hr_system.c , agent/mibgroup/mibII/at.c
+ , agent/mibgroup/mibII/at.h ,
+ agent/mibgroup/mibII/icmp.c ,
+ agent/mibgroup/mibII/interfaces.c , agent/mibgroup/mibII/ip.c
+ , agent/mibgroup/mibII/ipAddr.c ,
+ agent/mibgroup/mibII/mta_sendmail.h ,
+ agent/mibgroup/mibII/route_write.c ,
+ agent/mibgroup/mibII/sysORTable.c ,
+ agent/mibgroup/mibII/system_mib.c ,
+ agent/mibgroup/mibII/tcp.c , agent/mibgroup/mibII/tcpTable.c
+ , agent/mibgroup/mibII/udp.c ,
+ agent/mibgroup/mibII/udpTable.c ,
+ agent/mibgroup/mibII/var_route.c ,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c ,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/smux/smux.c ,
+ agent/mibgroup/target/snmpTargetAddrEntry.c ,
+ agent/mibgroup/target/snmpTargetParamsEntry.c ,
+ agent/mibgroup/ucd-snmp/diskio.c ,
+ agent/mibgroup/ucd-snmp/dlmod.c ,
+ agent/mibgroup/ucd-snmp/file.c ,
+ agent/mibgroup/ucd-snmp/memory.c ,
+ agent/mibgroup/ucd-snmp/memory.h ,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c ,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h ,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c ,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.h ,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c ,
+ agent/mibgroup/ucd-snmp/memory_solaris2.h ,
+ agent/mibgroup/ucd-snmp/proxy.c ,
+ agent/mibgroup/ucd-snmp/vmstat.c ,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c ,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.h ,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c ,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c ,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c , apps/Makefile.in
+ , apps/snmpdelta.c , apps/snmpdf.c ,
+ apps/snmpget.c , apps/snmpgetnext.c , apps/snmpset.c
+ , apps/snmpstatus.c , apps/snmptable.c ,
+ apps/snmptest.c , apps/snmptranslate.c ,
+ apps/snmptrap.c , apps/snmptrapd.c ,
+ apps/snmptrapd_log.c , apps/snmpusm.c , apps/snmpvacm.c
+ , apps/snmpwalk.c , apps/snmpnetstat/Makefile.in
+ , local/mib2c.conf , local/mib2c.vartypes.conf ,
+ local/pass_persisttest , local/tkmib:
+
+ massive merge from the patches branch to the main line.
+
+2001-10-09 07:14 hardaker
+
+ * CodingStyle:
+
+ Sometimes we feel like a -nut
+
+2001-10-09 06:15 jbpn
+
+ * agent/agent_registry.c:
+
+ - properly account for the length of the suffix in the variable
+ table in register_mib_table_row()
+
+2001-10-08 08:53 jbpn
+
+ * agent/mibgroup/agentx/client.c:
+
+ - declare version_sysoid_len as extern INT not extern oid, so as to
+ match its actual definition in sytem_mib.c. This caused all kinds of
+ fun & games on Linux on a Alpha.
+
+2001-10-04 08:31 jbpn
+
+ * snmplib/: callback.c , callback.h:
+
+ - add function snmp_callback_list() to return list of callbacks for a
+ given <major, minor> pair.
+
+2001-10-04 07:14 hardaker
+
+ * local/pass_persisttest:
+
+ file pass_persisttest was initially added on branch V4-2-patches.
+
+2001-10-03 05:42 jbpn
+
+ * snmplib/keytools.c:
+
+ - change expression at l. 415 from:
+
+ *kcstring++ = *kcstring ^ *newkey++;
+
+ which has undefined behaviour to:
+
+ *kcstring++ ^= *newkey++;
+
+ which is okay (since *kcstring is only evaluated once). Similarly
+ at l. 530. The previous constructs cause warnings with GCC3 and
+ some other compilers. Thanks to Niel Markwick who noted this in
+ bug #465969.
+
+2001-10-03 03:11 jbpn
+
+ * agent/agent_registry.c:
+
+ - do SNMPD_CALLBACK_UNREGISTER_OID callbacks in
+ unregister_mibs_by_session() -- called when AgentX subagents
+ disappear.
+
+2001-10-02 06:01 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - don't send ASN_PRIV_INCL_RANGE and ASN_PRIV_EXCL_RANGE on-the-wire
+
+2001-09-26 08:03 jbpn
+
+ * agent/agent_registry.c:
+
+ - allow split_subtree() to do a split in the middle of a column,
+ keeping the relevant variable in both the old tree and the new
+ tree (arises in AgentX row registrations).
+
+ - patch from Damian Gilmurray for register_mib_table_row() which
+ allows it to cope with non-zero length variables and also
+ non-contiguous OIDs for adjacent columns.
+
+ - rewritten dump_registry() that uses reallocating print functions
+ and also prints out variable lists.
+
+2001-09-26 07:45 jbpn
+
+ * agent/snmp_vars.c:
+
+ - allow for the possibility of subtree name being longer than
+ requested name when calculating the suffix for variable matching.
+
+ - be strict about subtree chunks being inclusive of the start OID
+ and exclusive of the end OID (shows up big time in AgentX).
+
+2001-09-26 07:22 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - don't do getNext requests on exclusive searchRanges that begin in
+ a tree marked as a fully-qualified instance (they are doomed to
+ fail). Skip to the next part of the tree straight away.
+
+2001-09-26 07:19 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - bring debugging tokens into line with rest of AgentX code
+
+2001-09-25 08:15 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - reinstate a missing space character
+
+2001-09-25 03:58 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - remove spurious cast
+
+2001-09-25 03:45 jbpn
+
+ * apps/snmptrapd.c:
+
+ - fix possible infelicity when printing and syslogging (not sure this is
+ actually possible but)
+
+2001-09-25 03:09 jbpn
+
+ * snmplib/mib.c:
+
+ - integrate some changes from the V4-2-patches branch: Harrie's
+ prototypes and Wes's fix for bug #463226.
+
+2001-09-25 03:01 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - fix signedness of time stuff
+
+2001-09-25 02:47 jbpn
+
+ * snmplib/: snmp_logging.c , snmp_logging.h:
+
+ - make argument of snmp_enable_syslog_ident const
+
+ - don't strdup DEFAULT_LOG_ID if a NULL arg is given
+
+2001-09-24 09:39 jbpn
+
+ * apps/snmptrapd.c:
+
+ - make use of rewritten output functions in snmptrapd_log.c which
+ avoid fixed length buffers.
+
+ - fix bug noted in support request #456646 (custom trap format was
+ being ignored for v2 traps and informs). Thanks to
+ G.Principato@motorola.com for spotting this one.
+
+ - correct usage for -P option to reflect that it causes output on
+ stderr not stdout.
+
+2001-09-24 09:36 jbpn
+
+ * apps/: snmptrapd_log.c , snmptrapd_log.h:
+
+ - rewrite of output functions to avoid use of fixed-length buffers
+
+2001-09-20 13:04 hardaker
+
+ * README , agent/mibgroup/ucd-snmp/logmatch.c ,
+ agent/mibgroup/ucd-snmp/logmatch.h , mibs/UCD-SNMP-MIB.txt:
+
+ new logmatch mib from Stephan Wenzel.
+
+2001-09-15 08:40 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - override exclusive searchRange getNext operations when retrying
+ operations
+
+2001-09-15 08:39 jbpn
+
+ * agent/: snmp_agent.c , snmp_agent.h:
+
+ - improved support for AgentX-style inclusive searchRange getNext
+
+2001-09-14 14:43 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ patch #443115 from Yimin Ge: diskio support for freebsd4
+
+2001-09-14 14:34 hardaker
+
+ * apps/snmptrapd.c , snmplib/snmp_logging.c ,
+ snmplib/snmp_logging.h:
+
+ Patch #440320 from Mark Ferlatte:
+
+ 1) Adds a new function to the snmp_logging API
+ (snmp_enable_syslog_ident(char *ident))
+
+ 2) Ports snmptrapd to use the existing snmp_logging API instead of
+ using syslog directly.
+
+ 3) Ports snmp_logging.[ch] to use the Win32 Event Log when compiled on
+ Win32. I didn't update the Visual C project files, because I only
+ have access to a newer version of VC, and I didn't know if you
+ wanted them updated. The advapi32 library needs to be added to the
+ project in order for this to work on Win32 (that's where the event
+ log API is).
+
+2001-09-14 14:22 hardaker
+
+ * config.h.in , configure:
+
+ I, uh, cough, uh forgot to run autoconf/autoheader. Dave: don't kill me.
+
+2001-09-14 14:19 hardaker
+
+ * perl/SNMP/: SNMP.pm , SNMP.xs:
+
+ Patch #428884: Add -PR like option to perl module (from Joe Clarke).
+
+2001-09-14 14:08 hardaker
+
+ * README , acconfig.h , configure.in ,
+ agent/agent_trap.c , agent/mibgroup/agentx/client.c ,
+ agent/mibgroup/host/hr_filesys.c ,
+ agent/mibgroup/host/hr_swinst.c ,
+ agent/mibgroup/mibII/system_mib.c ,
+ agent/mibgroup/mibJJ/system_mib.c ,
+ agent/mibgroup/ucd-snmp/disk.c ,
+ agent/mibgroup/ucd-snmp/errormib.c ,
+ agent/mibgroup/ucd-snmp/extensible.c ,
+ agent/mibgroup/ucd-snmp/file.c ,
+ agent/mibgroup/ucd-snmp/loadave.c ,
+ agent/mibgroup/ucd-snmp/memory.c ,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c ,
+ agent/mibgroup/ucd-snmp/memory_netbsd1.c ,
+ agent/mibgroup/ucd-snmp/memory_solaris2.c ,
+ agent/mibgroup/ucd-snmp/proc.c ,
+ agent/mibgroup/ucd-snmp/versioninfo.c ,
+ agent/mibgroup/ucd-snmp/vmstat.c ,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c ,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c ,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c ,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c ,
+ snmplib/snmpAAL5PVCDomain.c , snmplib/snmpAAL5PVCDomain.h
+ , snmplib/snmpUnixDomain.c , snmplib/snmpUnixDomain.h
+ , snmplib/snmp_api.h , snmplib/snmpv3.c ,
+ snmplib/asn1.h:
+
+ Applied a modified version of patch #427343 from Harrie:
+ make enterprise ID relocatable where legal to do so
+
+2001-09-14 12:09 hardaker
+
+ * agent/: Makefile.in , mibgroup/Makefile.in:
+
+ Alternative solution to patch #312694:
+ move date_n_time utilities to snmplib/snmp-tc.c.
+
+2001-09-14 12:08 hardaker
+
+ * agent/mibgroup/host/: hr_utils.c , hr_utils.h:
+
+ removed. Functionality moved to snmplib/snmp-tc.[ch]
+
+2001-09-14 12:06 hardaker
+
+ * agent/mibgroup/host.h , agent/mibgroup/host/hr_filesys.c
+ , agent/mibgroup/host/hr_swinst.c ,
+ agent/mibgroup/host/hr_system.c ,
+ agent/mibgroup/host/hr_system.h ,
+ agent/mibgroup/host/hr_utils.c , snmplib/Makefile.in ,
+ snmplib/snmp-tc.c , snmplib/snmp-tc.h:
+
+ Alternative solution to patch #312694:
+ move date_n_time utilities to snmplib/snmp-tc.c.
+
+2001-09-14 09:48 hardaker
+
+ * win32/config.h.borland:
+
+ file config.h.borland was initially added on branch V4-2-patches.
+
+2001-09-14 06:19 jbpn
+
+ * agent/mibgroup/agentx/: master.c , master_request.c ,
+ master_request.h:
+
+ - use inclusive search range only when appropriate for getNext
+ queries
+
+2001-09-12 06:47 hardaker
+
+ * snmplib/snmpCallbackDomain.c:
+
+ file snmpCallbackDomain.c was initially added on branch NEW-AGENT-API.
+
+2001-09-12 06:47 hardaker
+
+ * snmplib/snmpCallbackDomain.h:
+
+ file snmpCallbackDomain.h was initially added on branch NEW-AGENT-API.
+
+2001-09-06 07:40 jbpn
+
+ * agent/: snmp_agent.c , snmp_vars.c:
+
+ - if include bit is set in an AgentX SearchRange (hence type of varbind
+ is ASN_PRIV_INCL_RANGE), try an exact query first because an object
+ whose name is lexi-equal is a valid response; if exact query fails
+ then fall back to an inexact query.
+
+2001-09-06 07:38 jbpn
+
+ * agent/mibgroup/agentx/: master.c , master_request.c ,
+ protocol.c , subagent.c:
+
+ - oops, used INCL/EXCL wrong way round in a couple of places
+
+ - better test for scoping requirements in subagent
+
+2001-09-04 07:14 jbpn
+
+ * agent/snmpd.c:
+
+ - add missing break; after processing -P option, noted by Botond
+ Tarnay (see patch #458327)
+
+2001-08-28 03:04 jbpn
+
+ * agent/: snmp_agent.c (V4-2-patches.7), snmp_agent.c:
+
+ - add missing #include <tcpd.h> if using libwrap, noted by Nathan
+ Neulinger (patch #453831).
+
+2001-08-28 02:38 jbpn
+
+ * agent/: snmpd.c (V4-2-patches.1), snmpd.c:
+
+ - avoid use of pre-processor directives inside printf() call, which
+ is a macro in glibc, making this an undefined behaviour
+ construct (which GCC 3.0 refuses to compile). See bug #455804 for
+ further details.
+
+2001-08-24 10:00 rstory
+
+ * snmplib/data_list.h:
+
+ file data_list.h was initially added on branch NEW-AGENT-API.
+
+2001-08-24 10:00 rstory
+
+ * snmplib/data_list.c:
+
+ file data_list.c was initially added on branch NEW-AGENT-API.
+
+2001-08-22 08:45 jbpn
+
+ * agent/: snmp_vars.c , mibgroup/agentx/master.c ,
+ mibgroup/agentx/master_request.c , mibgroup/agentx/protocol.c
+ , mibgroup/agentx/subagent.c:
+
+ - add checking that results to be returned to master agent are in
+ requested scope (if any) (getBulk not yet done)
+
+2001-08-15 09:31 jbpn
+
+ * snmplib/snmp_debug.c:
+
+ - use sprint_realloc_objid in debugmsg_oid to print long OIDs.
+
+2001-08-15 08:37 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - increment the value of snmpInBadCommunityUses when attempting an
+ operation not permitted by the given community, per RFC 1907.
+
+2001-08-15 08:34 jbpn
+
+ * agent/snmp_agent.c:
+
+ - when translating the v2+ error-status value authorizationError
+ into noSuchName for a v1 session, increment the value of
+ snmpInBadCommunityUses, per RFC 2576.
+
+2001-08-14 03:22 jbpn
+
+ * snmplib/snmp_client.c:
+
+ - in snmp_set_var_objid(), try to detect a previously-malloc()ed
+ buffer for the variable name, and free() it, to avoid memory
+ leaks.
+
+2001-08-13 03:47 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - use Win32 calls to change blocking state of sockets if
+ appropriate. Thanks to Joerg Mattes for help debugging this.
+
+2001-08-13 03:37 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - perform an SNMP_CALLBACK_OP_DISCONNECT and close the connection if
+ we get an error on a stream receive, as well as if it is closed in
+ an orderly fashion. This makes life easier on Win32 inparticular.
+ Thanks to Joerg Mattes for help with debugging this.
+
+2001-08-09 03:10 hardaker
+
+ * agent/helpers/table_dataset.c:
+
+ file table_dataset.c was initially added on branch NEW-AGENT-API.
+
+2001-08-09 03:10 hardaker
+
+ * agent/helpers/table_dataset.h:
+
+ file table_dataset.h was initially added on branch NEW-AGENT-API.
+
+2001-08-08 01:42 hardaker
+
+ * agent/helpers/table_data.h:
+
+ file table_data.h was initially added on branch NEW-AGENT-API.
+
+2001-08-08 01:42 hardaker
+
+ * agent/helpers/table_data.c:
+
+ file table_data.c was initially added on branch NEW-AGENT-API.
+
+2001-08-07 13:59 nba
+
+ * man/snmp_perror.3:
+
+ file snmp_perror.3 was initially added on branch V4-2-patches.
+
+2001-08-07 13:59 nba
+
+ * man/snmp_api_errstring.3:
+
+ file snmp_api_errstring.3 was initially added on branch V4-2-patches.
+
+2001-08-07 13:59 nba
+
+ * man/snmp_sess_perror.3:
+
+ file snmp_sess_perror.3 was initially added on branch V4-2-patches.
+
+2001-08-07 13:59 nba
+
+ * man/snmp_error.3:
+
+ file snmp_error.3 was initially added on branch V4-2-patches.
+
+2001-08-06 04:29 jbpn
+
+ * agent/snmpd.c:
+
+ - fix for potential buffer overflow in logfile argument handling,
+ noted by Anonymous (bug #448243). Also use a large enough buffer
+ to handle filenames of length PATH_MAX (if possible).
+
+2001-07-30 10:05 jbpn
+
+ * agent/mibgroup/mibII/var_route.c , snmplib/snmp_api.c
+ , snmplib/snmp_api.h:
+
+ - move snmp_socket_length function to agent/mibgroup/mibII/var_route.c
+ from snmp_api.c -- this is the only remaining place that uses this
+ function, which certainly doesn't belong in snmp_api.c after the
+ transport abstraction malarkey.
+
+2001-07-30 09:22 hardaker
+
+ * agent/agent_handler.c:
+
+ file agent_handler.c was initially added on branch NEW-AGENT-API.
+
+2001-07-30 09:22 hardaker
+
+ * agent/agent_handler.h:
+
+ file agent_handler.h was initially added on branch NEW-AGENT-API.
+
+2001-07-30 07:06 jbpn
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ - try to return invalid(2) for the ipRouteType column if the route
+ is not up. See bug #426710, reported by pjweber.
+
+2001-07-27 07:32 jbpn
+
+ * snmplib/snmpv3.c:
+
+ - set defaultAuthType to usmHMACSHA1AuthProtocol if SHA specified
+ (was set to usmHMACMD5AuthProtocol in this case). Spotted by
+ William Kennemer (bug #444860)
+
+2001-07-27 06:59 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - change to handle_agentx_response ONLY to send NEWLY delegated
+ requests after processing a successful response. This is achieved
+ by saving the value of asp->outstanding_requests and temporarily
+ setting it to NULL. After processing all varbinds in the
+ response, therefore, asp->outstanding_requests contains only newly
+ delegated requests, if any. After sending these, the new requests
+ are merged with the saved queue.
+
+ This fixes a bug that arises if you request variables from two or
+ more separate subagents simultaneously. What used to happen is
+ that, upon receiving the first response, the master agent would
+ notice that it had an outstanding request, and retransmit it.
+ Then the second response arrives, and the master agent sends the
+ reply to the (SNMP) requester and frees the requests (including
+ callback data). Finally, another AgentX response (to the
+ erroneously transmitted request) arrives and the callback is
+ called referencing deallocated memory, which causes a segfault.
+
+2001-07-26 07:28 dts12
+
+ * snmplib/: snmp_api.c (NEW-LIBRARY-API.4), snmp_api.c:
+
+ Adding a 'double'-valued varbind isn't inherently an internal error!
+
+2001-07-25 05:47 jbpn
+
+ * agent/snmpd.c:
+
+ - disable stderr logging (if requested) before calling init_mib_modules().
+ This should fix the problem noted by Nigel Metheringham in bug #418857
+ whereby the AgentX master module prints a message to stderr which causes
+ a SIGPIPE when the agent is started as a daemon.
+
+2001-07-25 02:18 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - initialise buffers to zero in handle_wrap_fmt, to avoid garbage in
+ display of security parameters, as noted by William Frauenhofer
+ (bug #437231).
+
+ - add closing parenthesis after (via <address> in format_plain_trap
+
+2001-07-23 07:53 jbpn
+
+ * snmplib/tools.c:
+
+ - remove excessive debugging from snmp_(re)alloc functions
+
+2001-07-23 04:37 jbpn
+
+ * snmplib/snmpUnixDomain.c:
+
+ - minor fix to debugging output to print losing path correctly when
+ a remote connect fails.
+
+2001-07-17 09:56 hardaker
+
+ * CodingStyle:
+
+ update for naming conventions and for structure definitions.
+
+2001-07-17 09:07 hardaker
+
+ * CodingStyle:
+
+ initial coding style guideline document.
+
+2001-07-17 09:02 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - remember to remove_trap_session(our-session-with-master-agent)
+ if the master agent session goes away, because otherwise you
+ may subsequently try to use it, which will probably dump core,
+ and is certainly an error.
+
+ - also change when trap session is registered to being immediately
+ the session is opened so traps can be sent, e.g. from the
+ INDEX_START callback (for example linkUp traps in subagents that
+ register a row of ifTable).
+
+2001-07-17 08:48 jbpn
+
+ * agent/agent_trap.c:
+
+ - change to remove_trap_session(), so as not to close an SNMP
+ session simply because we are removing it from the trap_sink
+ list. The rationale is that the session may still be in use for
+ other purposes, or (more to the point) you may be calling this
+ function from the session's callback (from where closing the
+ session isn't a good idea).
+
+2001-07-13 06:02 dts12
+
+ * snmplib/netsnmp.h:
+
+ file netsnmp.h was initially added on branch NEW-LIBRARY-API.
+
+2001-07-12 12:09 hardaker
+
+ * agent/helpers/table_iterator.c:
+
+ file table_iterator.c was initially added on branch NEW-AGENT-API.
+
+2001-07-12 12:09 hardaker
+
+ * agent/helpers/table_iterator.h:
+
+ file table_iterator.h was initially added on branch NEW-AGENT-API.
+
+2001-07-12 02:21 jbpn
+
+ * agent/: snmp_agent.c , mibgroup/agentx/client.c ,
+ mibgroup/agentx/master_request.c , mibgroup/agentx/protocol.c
+ , mibgroup/agentx/subagent.c:
+
+ - fix for bug #439094, reported by Evert-Jan van Tuijl, whereby
+ the AgentX master agent expects a response to an agentx-CleanupSet-PDU
+ message (incorrectly). This only shows up when testing against other
+ subagents (e.g. jax) because the net-snmp subagent sends a response
+ to the agentx-CleanupSet-PDU (incorrectly).
+
+2001-07-10 16:10 hardaker
+
+ * agent/mibgroup/mibII/vacm_context.c:
+
+ file vacm_context.c was initially added on branch NEW-AGENT-API.
+
+2001-07-10 16:10 hardaker
+
+ * agent/mibgroup/mibII/vacm_context.h:
+
+ file vacm_context.h was initially added on branch NEW-AGENT-API.
+
+2001-07-10 16:06 hardaker
+
+ * agent/mibgroup/target/target_counters.c:
+
+ file target_counters.c was initially added on branch NEW-AGENT-API.
+
+2001-07-10 16:06 hardaker
+
+ * agent/mibgroup/target/target_counters.h:
+
+ file target_counters.h was initially added on branch NEW-AGENT-API.
+
+2001-07-05 06:11 jbpn
+
+ * agent/mibgroup/mibII/: interfaces.c , interfaces.h:
+
+ - make Interface_Scan_Get_Count non-static as it's very useful
+
+2001-07-05 03:40 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - free the cached security parameters when we have a parse error
+ on input, otherwise we leak memory (triggered by SC 3.0.13.{2,3}).
+
+2001-07-04 09:51 uid44810
+
+ * snmplib/snmp_api.c:
+
+ - catch some malformed SNMPv3 packets
+
+2001-07-04 07:42 uid44810
+
+ * snmplib/snmp_api.c:
+
+ - fix bad mistake in snmpv3_scopedPDU_header_realloc_rbuild which
+ was encoding the wrong length into the ScopedPDU SEQUENCE header
+ (wasn't including length of actual data, i.e. PDU!). Totally my
+ fault -- introduced when changing over to reallocating buffer
+ type functions. Amazing this hasn't caused all sorts of trouble
+ for people!
+
+2001-07-02 18:04 rstory
+
+ * snmplib/snmp-tc.c:
+
+ file snmp-tc.c was initially added on branch NEW-AGENT-API.
+
+2001-07-02 09:33 jbpn
+
+ * agent/snmp_agent.c:
+
+ - slight change to generation of error-index:
+
+ - explicitly test for error-status == noError, and set error-index
+ to zero in this case;
+
+ - otherwise use the cached value;
+
+ - don't zero the cached value in handle_var_list if handle_one_var
+ returns noError
+
+ - this copes properly with SET requests, where a failing SET will have
+ a FREE phase which will typically return noError. Previously this
+ would erroneously cause the error-index to be set to zero.
+
+2001-07-02 08:14 jbpn
+
+ * agent/mibgroup/util_funcs.c:
+
+ - fix bad behaviour in header_simple_table when the index is
+ equal to ULONG_MAX
+
+2001-06-28 10:01 jbpn
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ - change sense of snmp_oid_compare() result check in var_usmUser
+ to do lexi-ordering correctly
+
+2001-06-28 07:20 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - count more v1/v2c parse errors (SC 1.1.12.10)
+
+2001-06-28 05:56 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - check that version field of PDU is of integer type rather than just
+ assuming it is (SC 1.1.12.2.1)
+
+2001-06-28 04:40 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - increment snmpInBadCommunityNames when we see unknown community
+ names, per RFC1907
+
+2001-06-27 08:09 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - make use of new function register_mib_detach() to mark all our
+ nodes as detached when we get a transport disconnect indication.
+
+2001-06-27 08:07 jbpn
+
+ * agent/: agent_registry.c , agent_registry.h ,
+ var_struct.h:
+
+ - add additional flag to subtree structure that subagents can use
+ to determine whether an attempt has been made to register and OID
+ with a master agent during a session's lifetime. This allows
+ manual re-registration and automatic re-registration to be mixed
+ within a subagent (perhaps because you are doing index stuff).
+
+ - add function register_mib_detach() which unsets this flag for
+ all known nodes (subagent would typically call this on disconnect
+ indication).
+
+ - add function unregister_mib_table_row()
+
+ - correct bad recursive behaviour in register_mib_reattach() which
+ used to try to re-register N nodes N! times. Once will normally
+ be enough.
+
+ - change to dump_registry() format to include hex display of
+ flags field.
+
+2001-06-26 09:26 dts12
+
+ * FAQ:
+
+ Fix error in SNMPv2 trap examples (Identified by Diwakar Shetty).
+
+2001-06-26 02:35 jbpn
+
+ * snmplib/mib.c:
+
+ - corrected sense of dump_realloc_oid_to_string() return value
+ checks, as spotted by Robert Story.
+
+2001-06-25 06:30 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - small tweak in handle_agentx_response() when retrying unfulfilled
+ requests: continue from the "start" OID of the next node of the
+ tree, not from the "name" OID, which causes looping.
+
+2001-06-21 09:51 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - handle "holes" in rows of tables that are handled by subagents
+
+ Since the fully-qualified instance is registered, we interpret
+ a return of noSuchInstance when doing an inexact query as meaning
+ we should retry the query.
+
+2001-06-21 02:50 jbpn
+
+ * snmplib/mib.h:
+
+ - forgot to commit at the same time as last mib.c commit; updated
+ prototype for sprint_realloc_hinted_integer
+
+2001-06-20 06:44 jbpn
+
+ * agent/: agent_index.c , agent_index.h:
+
+ - add function count_indexes which returns the number of indexes
+ allocated for a given OID. This can be useful for implementing
+ "row count" objects, e.g. ifNumber.
+
+2001-06-20 05:37 jbpn
+
+ * agent/: agent_callbacks.h , mibgroup/agentx/subagent.c:
+
+ - add SNMPD_CALLBACK_INDEX_START and SNMPD_CALLBACK_INDEX_STOP
+ callbacks which may be used to manage index allocations.
+
+ Master agent should probably call these callbacks too, although
+ it's a bit of a degenerate case.
+
+2001-06-19 09:44 jbpn
+
+ * agent/agent_index.c:
+
+ - use an explicit fieled "allocated" in snmp_index structure to
+ indicate whether or not a value is currently allocated, rather
+ than overloading a NULL session to mean that it is not.
+
+ This allows startup code in a master agent to pre-register indices
+ when there are no sessions open.
+
+2001-06-19 08:34 jbpn
+
+ * agent/mibgroup/agentx/: master_admin.c , master_request.c:
+
+ - keep the value of NETWORK_BYTE_ORDER from h.flags in the
+ agentx-Open-PDU and use it for subsequent master-initiated
+ AgentX protocol operations, per RFC 2741 (section 7.1.1,
+ paragraph 4).
+
+ For now, we are storing this in the flags field of a
+ subsession. This is likely to stop working if the flags
+ definitions change (i.e. it's not a great solution)
+
+ - Thanks to Peter Korsten (severityone at users.sourceforge.net)
+ for identifying this bug, and for help debugging this fix.
+
+2001-06-19 02:35 jbpn
+
+ * snmplib/mib.c:
+
+ - reinstate space between numbers and units.
+
+ - respect DISPLAY-HINTs for Unsigned32, Gauge, Gauge32 types.
+
+2001-06-13 03:29 jbpn
+
+ * agent/snmp_vars.c:
+
+ - minor change to debugging to reduce "noise level" from Purify
+
+2001-06-12 10:35 jbpn
+
+ * agent/snmp_agent.c:
+
+ - handle non-repeaters and max-repetitions field values of < 0 (by
+ setting them to 0, per RFC 1905)
+
+2001-06-12 10:05 jbpn
+
+ * agent/snmp_agent.c:
+
+ - fix bug that caused a null pointer to be followed when processing a
+ GETBULK request with non-repeaters > 0, max-repetitions == 0 and no
+ varbinds in the request.
+
+2001-06-12 07:24 dts12
+
+ * snmplib/: read_config.c (V4-2-patches.1), read_config.c:
+
+ Fix 'unregister_config_handler' to handle tags other
+ than the first in the list. (Thanks to Paul Serice).
+
+2001-06-06 07:39 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - free() return value from register_index() calls
+
+2001-06-06 07:37 jbpn
+
+ * agent/agent_index.c:
+
+ - more uniform return value from register_index(): make it always a
+ varbind which the caller is responsible for free()ing, or else NULL.
+
+2001-06-05 03:10 jbpn
+
+ * agent/agent_index.c:
+
+ - fix for index allocation, such that requests for specific indices which
+ have previously been allocated, but are not currently in use, succeed.
+
+ - more debugging output.
+
+2001-06-01 08:37 hardaker
+
+ * agent/mibgroup/testdelayed.h:
+
+ file testdelayed.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:37 hardaker
+
+ * agent/mibgroup/testhandler.h:
+
+ file testhandler.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:37 hardaker
+
+ * agent/mibgroup/testdelayed.c:
+
+ file testdelayed.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:37 hardaker
+
+ * agent/mibgroup/testhandler.c:
+
+ file testhandler.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/table.c:
+
+ file table.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/multiplexer.h:
+
+ file multiplexer.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/old_api.c:
+
+ file old_api.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/null.h:
+
+ file null.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/instance.c:
+
+ file instance.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/set_helper.h:
+
+ file set_helper.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/table.h:
+
+ file table.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/read_only.c:
+
+ file read_only.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/serialize.c:
+
+ file serialize.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/old_api.h:
+
+ file old_api.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/instance.h:
+
+ file instance.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/read_only.h:
+
+ file read_only.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/.cvsignore:
+
+ file .cvsignore was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/multiplexer.c:
+
+ file multiplexer.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/Makefile.in:
+
+ file Makefile.in was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/serialize.h:
+
+ file serialize.h was initially added on branch NEW-AGENT-API.
+
+2001-06-01 08:36 hardaker
+
+ * agent/helpers/null.c:
+
+ file null.c was initially added on branch NEW-AGENT-API.
+
+2001-06-01 07:39 hardaker
+
+ * local/tkmib:
+
+ misc fixes for oid formatting problems.
+
+2001-06-01 07:37 hardaker
+
+ * README:
+
+ add Martin Oldfield.
+
+2001-06-01 02:50 jbpn
+
+ * agent/: snmp_agent.c , snmp_agent.h ,
+ mibgroup/agentx/master_request.c:
+
+ - fix for absolutely mind-bending memory leak when AgentX sessions
+ timeout. agent_session_list holds a queue of sessions with outstanding
+ requests. When a session times out, this must be scavenged to make
+ sure the sessions that have timed out, and their associated requests
+ are free()d.
+
+2001-05-30 03:28 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - retry initial open of AgentX master socket if AgentX pings are
+ enabled (should really be a separate default_store option but
+ never mind)
+
+2001-05-30 03:27 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - more aggressive handling of timeout conditions (also fix memory
+ leak)
+
+2001-05-30 03:19 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - more informative debugging
+
+2001-05-30 02:37 jbpn
+
+ * snmplib/snmp_alarm.c:
+
+ - remove noisy debugging
+
+2001-05-30 02:37 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - more compact debugging in _sess_select_info
+
+2001-05-30 02:34 jbpn
+
+ * agent/agent_registry.c:
+
+ - copy flags in reattach_subtree (needed for AgentX row registration)
+
+2001-05-28 08:54 jbpn
+
+ * agent/mibgroup/agentx/: client.c , client.h ,
+ master_admin.c , master_request.c , subagent.c:
+
+ - stuff from patch #416026 (submitted by anonymous) for AgentX row
+ registration
+
+2001-05-28 08:49 jbpn
+
+ * agent/snmp_vars.c:
+
+ - tweak to getStatPtr to handle getNext operations in combination with
+ FULLY_QUALIFIED_INSTANCE nodes (which arise in AgentX row registration).
+
+2001-05-28 08:46 jbpn
+
+ * agent/: agent_registry.c , agent_registry.h ,
+ var_struct.h:
+
+ - stuff from patch #416026 (submitted by anonymous) for AgentX row
+ registration
+
+2001-05-28 08:42 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - small tweak to debugging output
+
+2001-05-28 08:39 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - do parsing/building of ASN_PRIV_EXCL_RANGE and
+ ASN_PRIV_INCL_RANGE types *properly*.
+
+2001-05-28 04:40 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - fix possible memory leak in _sess_async_send error cases
+
+2001-05-28 04:27 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - add parsing/building of ASN_PRIV_EXCL_RANGE and
+ ASN_PRIV_INCL_RANGE types.
+
+2001-05-23 09:20 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - respect msgMaxSize in received v3 PDUs (in the weak sense that if
+ the serialized response PDU is more than it, we don't send it)
+
+ - removed functions ascii_to_binary, hex_to_binary. Using these
+ functions is really bad, since they will happily overflow buffers.
+ The superior alternatives, defined in tools.h, are
+ snmp_{decimal, hex}_to_binary.
+
+2001-05-23 09:00 jbpn
+
+ * apps/snmpstatus.c:
+
+ - remove unused variable struct sockaddr_in respIp
+
+2001-05-23 08:58 jbpn
+
+ * agent/snmp_agent.c:
+
+ - early bail out of handle_snmp_packet() if the callback operation
+ type is not SNMP_CALLBACK_OP_RECEIVED_MESSAGE. In practice, the
+ only way this arises currently is when a stream transport based
+ connection goes away and a SNMP_CALLBACK_OP_DISCONNECT occurs.
+
+2001-05-23 08:44 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - new fields rcvMsgMaxSize and sndMsgMaxSize in snmp_session
+ structure to support v3 msgMaxSize
+
+ - removed functions ascii_to_binary, hex_to_binary from public
+ interface. Using these functions is really bad, since they
+ will happily overflow buffers. The superior alternatives,
+ defined in tools.h, are snmp_{decimal, hex}_to_binary.
+
+2001-05-23 08:37 jbpn
+
+ * snmplib/: snmpAAL5PVCDomain.c , snmpIPXDomain.c ,
+ snmpTCPDomain.c , snmpUDPDomain.c , snmpUnixDomain.c
+ , snmp_transport.c , snmp_transport.h:
+
+ - add msgMaxSize field to snmp_transport structure to support
+ msgMaxSize negotiation for v3
+
+2001-05-23 07:14 jbpn
+
+ * snmplib/scapi.c:
+
+ - use sprint_realloc_hexstring instead of sprint_hexstring for
+ SNMP_TESTING_CODE debugging output of IV, key and plaintext
+
+2001-05-23 05:25 jbpn
+
+ * apps/snmptest.c:
+
+ - free() buffers in a couple of error cases; no big deal
+
+2001-05-23 04:39 jbpn
+
+ * snmplib/snmpv3.c:
+
+ - use new snmp_hex_to_binary function for engine ID parsing in -e
+ option, rather than archaic hex_to_binary
+
+2001-05-23 04:22 jbpn
+
+ * snmplib/snmp_parse_args.c:
+
+ - free() buffers in a couple of error cases; no big deal
+
+2001-05-23 04:14 jbpn
+
+ * snmplib/snmp_parse_args.c:
+
+ - use new snmp_hex_to_binary function for engine ID parsing in -e
+ and -E options, rather than archaic hex_to_binary
+
+2001-05-23 03:56 jbpn
+
+ * apps/snmptest.c:
+
+ - use new snmp_{decimal, hex}_to_binary functions for input string
+ to OCTET STRING conversion, rather than archaic ascii_to_binary
+ and hex_to_binary
+
+ - omit trailing newline from string (helpful for objects that don't
+ allow non-printing characters, e.g. sysLocation.0)
+
+2001-05-20 08:12 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - rewritten _sess_read() function:
+
+ - better handling of long packets
+ - zero-copy reception of packets on stream transports
+ - lower memory overheads for packet fragment handling for stream
+ transports
+
+ - allow parsing of large objects (>8192 octets)
+
+2001-05-20 05:48 jbpn
+
+ * snmplib/snmp_parse_args.c:
+
+ - don't strdup() contextName, securityName -- causes minor memory
+ leak.
+
+2001-05-20 05:04 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - test return of fcntl(F_GETFL), so as not to set flags to garbage
+
+ - correction to comment -- set socket to *blocking*!
+
+ - check opaque before writing to it in recv
+
+2001-05-20 05:02 jbpn
+
+ * snmplib/snmp_client.c:
+
+ - proper handling of SNMP_CALLBACK_OP_DISCONNECT in snmp_synch_input:
+ set an error condition, with errno SNMPERR_ABORT ("Session abort
+ failure"), which seems like a good enough match.
+
+2001-05-18 09:54 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ - make newly-accept()ed sockets blocking; otherwise problems arise
+ later when send()ing large PDUs (since only a single socket buffer's
+ worth of data at most can be sent without blocking).
+
+2001-05-18 07:17 jbpn
+
+ * agent/snmp_agent.c:
+
+ - use sprint_realloc_objid and sprint_realloc_variable instead of
+ sprint_objid and sprint_variable respectively, to allow large PDUs
+ to be printed when debugging
+
+2001-05-18 07:16 jbpn
+
+ * snmplib/tools.c:
+
+ - improved debugging output from snmp_realloc()
+
+2001-05-18 07:15 jbpn
+
+ * snmplib/: mib.c , mib.h:
+
+ - remove debugging from output routines
+
+ - new function sprint_realloc_objid
+
+ - make sprint_realloc_objid and sprint_realloc_variable externally
+ visible
+
+2001-05-18 06:28 jbpn
+
+ * snmplib/asn1.c:
+
+ - improved debugging output from asn_realloc()
+
+2001-05-15 04:10 jbpn
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - add OIDs for UDP/IPv6 and TCP/IPv6
+
+2001-05-14 02:20 jbpn
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - added \n to text of snmp_log() messages (bug #422978)
+
+2001-05-11 07:30 jbpn
+
+ * snmplib/: mib.c , mib.h:
+
+ - added sprint_realloc_<type> family of functions which take extra
+ parameters and use relocating buffers to remove limitations due to
+ fixed-size buffers (e.g. see bug #409181).
+
+ - also fixes potential problem noted as bug #414803
+
+ - fprint_variable, fprint_objid and fprint_value use new functions
+ such that snmpget etc. are improved immediately
+
+ - old functions remain *FOR NOW* -- but really they should be
+ considered to be deprecated (new functions provide a superset of
+ their functionality).
+
+2001-05-11 07:14 jbpn
+
+ * snmplib/parse.h:
+
+ - added additional function pointer to struct tree to point at
+ relocating buffer compatible output function
+
+2001-05-11 06:57 jbpn
+
+ * snmplib/: tools.c , tools.h:
+
+ - added utility function snmp_strcat, which appends a string to a
+ relocatable buffer
+
+2001-05-10 11:20 rstory
+
+ * snmplib/mib.c:
+
+ fix bug #423109 incorrect index parsing
+
+2001-05-09 16:43 rstory
+
+ * snmplib/snmp_client.c:
+
+ fix snmp_client.c:569: warning: control reaches end of non-void function
+
+2001-05-09 12:36 slif
+
+ * agent/mibgroup/: Rmon.h , Rmon/README , Rmon/agutil.c
+ , Rmon/agutil.h , Rmon/agutil_api.h , Rmon/alarm.c
+ , Rmon/alarm.h , Rmon/event.c , Rmon/event.h ,
+ Rmon/history.c , Rmon/history.h , Rmon/row_api.h ,
+ Rmon/rows.c , Rmon/rows.h , Rmon/statistics.c ,
+ Rmon/statistics.h , Rmon/test_alarm.sh ,
+ Rmon/test_hist.sh:
+
+ Include Alex Rozin's Rmon.
+
+2001-05-07 10:41 hardaker
+
+ * snmplib/: snmp_client.c , snmp_client.h:
+
+ Added a couple of convenience functions for manipulating varbindlists:
+ int snmp_set_var_typed_value(struct variable_list *newvar, u_char type,
+ u_char *val_str, size_t val_len);
+ void snmp_replace_var_types(struct variable_list *vbl, int old_type,
+ int new_type);
+ void snmp_reset_var_types(struct variable_list *vbl, int new_type);
+
+2001-05-07 10:36 hardaker
+
+ * snmplib/tools.h:
+
+ define SNMP_MALLOC_TYPEDEF()
+
+2001-05-05 07:28 rstory
+
+ * local/mib2c.storage.conf:
+
+ fix store_ name; don't cast to asny type if parm expecting u_char*; fix _variable_oid
+ naming; cast parm 2 of memdup to u_char*
+
+2001-05-03 14:16 hardaker
+
+ * snmplib/asn1.c:
+
+ fixed rauth offset incrementing: was incrementing the pointer, not the value.
+ -- more instances of the same problem found.
+
+2001-05-03 14:15 hardaker
+
+ * snmplib/asn1.c:
+
+ fixed rauth offset incrementing: was incrementing the pointer, not the value.
+
+2001-05-03 10:08 hardaker
+
+ * aclocal.m4 , config.guess , config.sub ,
+ configure , ltmain.sh:
+
+ updated to libtool 1.4
+
+2001-05-01 13:31 hardaker
+
+ * snmplib/snmpksm.c:
+
+ use realloc routines.
+
+2001-05-01 13:31 hardaker
+
+ * snmplib/read_config.c:
+
+ fix variable declaration.
+
+2001-05-01 13:30 hardaker
+
+ * snmplib/mib.c:
+
+ Don't print hex for string lengths less than 4. Should have died ages ago.
+
+2001-05-01 13:29 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat.h:
+
+ Fix prototype so its not static (it shouldn't be).
+
+2001-05-01 13:29 hardaker
+
+ * agent/mibgroup/mibII/ip.c:
+
+ make RONLY variables writable (which may or may not work. I'm betting not.)
+
+2001-05-01 13:28 hardaker
+
+ * agent/snmp_agent.c:
+
+ remove unused variables.
+
+2001-05-01 13:28 hardaker
+
+ * config.h.in , configure , configure.in:
+
+ check for an rpm subdirectory.
+
+2001-04-23 20:41 hardaker
+
+ * local/tkmib:
+
+ big cleanup and other fixes I've already forgotten in the last few minutes.
+
+2001-04-23 20:34 hardaker
+
+ * local/tkmib:
+
+ Don't walk off end of mib tree (sigh).
+
+2001-04-23 20:19 hardaker
+
+ * local/tkmib:
+
+ fix the mib info display options.
+ save them appropriately.
+
+2001-04-23 18:23 hardaker
+
+ * local/tkmib:
+
+ more savable option items.
+ use Data::Dumper to save most stuff.
+
+2001-04-23 17:26 hardaker
+
+ * local/tkmib:
+
+ Don't save session options twice.
+ Make color of writable objects a variable.
+
+2001-04-23 17:08 hardaker
+
+ * local/: tkmib (V4-2-patches.2), tkmib:
+
+ fix walk problem once and for all.
+
+2001-04-23 16:36 hardaker
+
+ * local/tkmib:
+
+ reduce screen realestate all over the place
+
+2001-04-23 16:35 hardaker
+
+ * local/tkmib:
+
+ test against version 5
+
+2001-04-18 08:46 hardaker
+
+ * agent/mibgroup/ucd-snmp/lmSensors.c ,
+ agent/mibgroup/ucd-snmp/lmSensors.h , mibs/LM-SENSORS-MIB.txt
+ , mibs/UCD-SNMP-MIB.txt:
+
+ Added LM-SENSORS-MIB support (diskio extension) from Martin Oldfield
+
+2001-04-18 05:40 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - hacking on snmp_add_var to handle long values
+
+ - use snmp_{hex,decimal}_to_binary instead of hex_to_binary
+ and ascii_to_binary; these should be removed
+
+ - don't use strtok in processing bitstrings
+
+2001-04-18 04:58 jbpn
+
+ * snmplib/asn1.c:
+
+ - use the generic snmp_realloc function in asn_realloc
+
+2001-04-18 02:40 jbpn
+
+ * snmplib/: tools.c , tools.h:
+
+ - new, reallocating utility functions snmp_hex_to_binary and
+ snmp_decimal_to_binary to convert hex and decimal strings to octet
+ strings respectively.
+
+ - new utility function snmp_realloc to perform buffer (re-)allocation
+
+2001-04-12 05:12 dts12
+
+ * agent/: snmp_agent.c (V4-2-patches.6), snmp_agent.c:
+
+ Better fix for bug #414855 from arajesh
+ Handles non-repeaters=0 as well, and avoids memory leaks.
+
+2001-04-11 10:06 jbpn
+
+ * snmplib/asn1.h:
+
+ - second incarnation of asn_realloc_rbuild_<type> functions, which
+ now take an additional argument that may be used to indicate that
+ reallocation should not be done.
+
+ - old _rbuild API is gone.
+
+ - extended (and corrected!) commentary on correct usage of new API.
+
+2001-04-11 10:05 jbpn
+
+ * snmplib/: snmp.c , snmp.h:
+
+ - use second incarnation of _realloc_rbuild functions.
+
+ - old _rbuild_var_op API is gone.
+
+2001-04-11 10:04 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - use second incarnation of asn_realloc_rbuild_<type> functions.
+
+2001-04-11 10:03 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - use second incarnation of _realloc_rbuild functions.
+
+ - old _rbuild API is gone.
+
+2001-04-11 10:02 jbpn
+
+ * snmplib/asn1.c:
+
+ - second incarnation of asn_realloc_rbuild_<type> functions, which
+ now take an additional argument that may be used to indicate that
+ reallocation should not be done.
+
+ - old _rbuild API is gone.
+
+ - asn_realloc() function checks whether it has been passed a NULL
+ pointer and uses malloc() in that case (thanks to Michael Slifcak
+ for pointing out the danger here).
+
+2001-04-11 06:13 dts12
+
+ * agent/snmp_agent.c:
+
+ Handle GetBulk requests with max-repetitions=0 properly (bug #414855)
+
+2001-04-10 04:47 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ - set SO_SNDBUF and SO_RCVBUF to 128Kb for newly-opened UDP sockets,
+ to enable large PDUs to be sent and received. Some
+ implementations default very low (Solaris 2.7 8Kb, Linux 2.4
+ 64Kb).
+
+2001-04-09 10:05 jbpn
+
+ * snmplib/snmpusm.c:
+
+ - modified usm_rgenerate_out_msg() to make use of reallocating
+ reverse encode functions.
+
+2001-04-09 10:03 jbpn
+
+ * snmplib/snmpusm.h:
+
+ - additional parameter to usm_rgenerate_out_msg() to enable use of
+ reallocating reverse encode functions.
+
+2001-04-09 09:57 jbpn
+
+ * snmplib/snmp_secmod.h:
+
+ - allow additional parameter for outgoing params to enable use of
+ reallocating reverse encode functions.
+
+2001-04-09 09:55 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - prototypes for reallocating reverse encode functions
+
+2001-04-09 09:54 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - modified to use reallocating reverse ASN.1 encoder functions if
+ using reverse encoding at all.
+
+2001-04-09 09:49 jbpn
+
+ * snmplib/snmp.c:
+
+ - add new function snmp_realloc_rbuild_var_op() which uses
+ reallocating reverse ASN.1 encoder functions to encode varbinds.
+
+2001-04-09 09:47 jbpn
+
+ * snmplib/asn1.h:
+
+ - prototype for new suite of functions asn_realloc_rebuild_<type>,
+ which perform reverse encoding into a buffer and grow it if there
+ is not enough space for the encoding.
+
+ - commentary on correct usage of above.
+
+2001-04-09 09:43 jbpn
+
+ * snmplib/asn1.c:
+
+ - new suite of functions asn_realloc_rebuild_<type>, which perform
+ reverse encoding into a buffer and grow it if there is not enough
+ space for the encoding.
+
+2001-04-06 12:12 hardaker
+
+ * AGENT.txt , COPYING , ChangeLog ,
+ EXAMPLE.conf.def , FAQ , NEWS , PORTING ,
+ README , README.agentx , README.snmpv3 , configure
+ , configure.in , sedscript.in , version.h
+ , agent/agent_trap.c , agent/ds_agent.h ,
+ agent/snmp_agent.c , agent/snmpd.c ,
+ agent/mibgroup/ucd_snmp.h , agent/mibgroup/util_funcs.c
+ , agent/mibgroup/agentx/README.agentx ,
+ agent/mibgroup/agentx/master.c ,
+ agent/mibgroup/agentx/master.h ,
+ agent/mibgroup/examples/example.c ,
+ agent/mibgroup/host/hr_filesys.c ,
+ agent/mibgroup/host/hr_storage.c ,
+ agent/mibgroup/host/hr_swrun.c ,
+ agent/mibgroup/host/hr_utils.c , agent/mibgroup/mibII/at.c
+ , agent/mibgroup/mibII/at.h ,
+ agent/mibgroup/mibII/interfaces.c , agent/mibgroup/mibII/ip.c
+ , agent/mibgroup/mibII/udp.c ,
+ agent/mibgroup/mibII/var_route.c ,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c ,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/target/target.c ,
+ agent/mibgroup/ucd-snmp/disk.c ,
+ agent/mibgroup/ucd-snmp/file.c ,
+ agent/mibgroup/ucd-snmp/loadave.c ,
+ agent/mibgroup/ucd-snmp/pass.c ,
+ agent/mibgroup/ucd-snmp/proxy.c ,
+ agent/mibgroup/ucd-snmp/registry.c ,
+ agent/mibgroup/ucd-snmp/versioninfo.c ,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c , apps/snmpdelta.c
+ , apps/snmptest.c , apps/snmptrapd.c ,
+ local/Makefile.in , local/mib2c , local/snmpconf
+ , local/tkmib , local/wesrestart , man/snmpcmd.1
+ , man/snmpd.conf.5.def , man/snmpdelta.1 ,
+ mibs/rfclist , mibs/rfcmibs.diff , snmplib/mib.c ,
+ snmplib/parse.c , snmplib/snmp_api.c ,
+ snmplib/snmp_debug.c , snmplib/snmpusm.c ,
+ testing/eval_tools.sh , testing/tests/T120proxyget:
+
+ merge3 -> merge4. I don't *think* I broke anything.
+ - The main line should now contain all the 4.2.1 patches.
+ - I may double check this at a later date.
+
+2001-04-05 06:37 dts12
+
+ * snmplib/parse.c:
+
+ Change 'Line' variable name, to assist with Mac port.
+
+2001-04-05 06:14 dts12
+
+ * agent/mibgroup/ucd-snmp/: pass.c , pass_persist.c:
+
+ Handle setting null string values via the 'pass' mechanism. (Support#406728)
+ Also handle embedded whitespace in such values.
+ Also applied to 'pass_persist'.
+
+2001-04-05 06:07 dts12
+
+ * agent/: agent_registry.c , agent_trap.c , kernel.c
+ , mib_modules.c , snmp_agent.c , snmp_agent.h
+ , snmp_vars.c , mibgroup/util_funcs.c ,
+ mibgroup/agentx/master_admin.c , mibgroup/agentx/protocol.c
+ , mibgroup/host/hr_disk.c , mibgroup/host/hr_network.c
+ , mibgroup/host/hr_print.c , mibgroup/host/hr_proc.c
+ , mibgroup/host/hr_system.c , mibgroup/host/hr_utils.c
+ , mibgroup/mibII/vacm_vars.c ,
+ mibgroup/mibII/var_route.c ,
+ mibgroup/notification/snmpNotifyFilterProfileTable.c ,
+ mibgroup/notification/snmpNotifyFilterTable.c ,
+ mibgroup/notification/snmpNotifyTable.c ,
+ mibgroup/target/snmpTargetAddrEntry.c ,
+ mibgroup/target/target.c , mibgroup/ucd-snmp/file.c ,
+ mibgroup/ucd-snmp/hpux.c , mibgroup/ucd-snmp/proxy.c ,
+ mibgroup/ucd-snmp/registry.c ,
+ mibgroup/ucd-snmp/versioninfo.c:
+
+ Keep one of the pickier compilers (HP's aCC) happy.
+
+2001-04-05 06:06 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Ensure that checking for 'statvfs' is done consistently
+
+2001-04-05 06:05 dts12
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ ensure that 'exec_command' is used consistently with the availability of execv
+ (A cleaner approach than the previous patch)
+
+2001-04-05 06:01 dts12
+
+ * agent/: auto_nlist.c , auto_nlist.h:
+
+ fix for auto_nlist bogus definitions for machines without nlist.
+
+2001-04-05 04:51 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - save a strcpy() and allow long octet string values without crashing
+ (though there are still problems due to the liberal use of fixed
+ size buffers with no bounds checking all over the place. Sigh).
+
+2001-04-04 06:46 jbpn
+
+ * agent/snmpd.c:
+
+ - call external signal handlers before calling snmp_select_info(),
+ rather than after calling snmp_select_info() but before select().
+ This fixes a potential problem that could arise if a signal handler
+ closed a session, which would cause select() to return -1 with
+ EBADF, and thus terminate the agent.
+
+2001-04-03 09:31 dts12
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ Ensure that the 'extmp' command variable is accessible on systems without EXECV.
+
+2001-04-03 09:29 dts12
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Keep one of the pickier compilers (HP's aCC) happy.
+
+2001-04-03 09:22 dts12
+
+ * apps/: snmptrapd.c , snmptrapd_log.c:
+
+ Keep one of the pickier compilers (HP's aCC) happy.
+
+2001-04-03 09:15 dts12
+
+ * snmplib/: mib.c , read_config.c , snmpTCPDomain.h
+ , snmpUDPDomain.c , snmpUnixDomain.c ,
+ snmpUnixDomain.h , snmp_api.c , snmp_logging.c ,
+ snmp_transport.c , snmp_transport.h , system.c:
+
+ Keep one of the pickier compilers (HP's aCC) happy.
+
+2001-04-03 06:30 dts12
+
+ * agent/mibgroup/mibII/kernel_linux.c:
+
+ Plug file-descriptor leak when using cached data. (Bug#412000)
+
+2001-04-02 10:11 jbpn
+
+ * agent/snmp_agent.c:
+
+ - check for limits.h properly
+
+2001-04-02 10:10 jbpn
+
+ * man/snmp_agent_api.3:
+
+ - minor typeface changes
+
+2001-03-31 06:27 jbpn
+
+ * man/snmp_agent_api.3:
+
+ - update documentation of agent_check_and_process to reflect
+ current behaviour
+
+ ** NOTE: currently returns control to user when an alarms runs **
+ ** **
+ ** This may change **
+
+2001-03-31 06:25 jbpn
+
+ * man/snmp_alarm.3:
+
+ - document the snmp_alarm_register_hr function
+
+ - expand the NOTES section discussing use of SIGALRM (or not)
+
+2001-03-31 06:17 jbpn
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ - Make use of SNMP_CALLBACK_OP_DISCONNECT transport disconnect
+ indication to shut down AgentX sessions cleanly and cancel all
+ callbacks which make refernce to the AgentX session.
+
+2001-03-31 06:15 jbpn
+
+ * agent/mibgroup/agentx/master_admin.c:
+
+ - Fix multiple free() of parts of the subsession by zeroing out
+ fields that we don't use.
+
+ - Make use of SNMP_CALLBACK_OP_DISCONNECT transport disconnect
+ indication to shut down AgentX sessions cleanly.
+
+2001-03-31 06:13 jbpn
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ - Make use of SNMP_CALLBACK_OP_DISCONNECT transport disconnect
+ indication to shut down AgentX sessions cleanly.
+
+2001-03-31 06:11 jbpn
+
+ * agent/snmp_agent.c:
+
+ - Fix memory leak in handle_one_var where long varbinds weren't
+ correctly free()d.
+
+ - Change behaviour of agent_check_and_process so that alarms run
+ correctly.
+
+ ** NOTE: currently returns control to user when an alarms runs **
+ ** **
+ ** This may change **
+
+2001-03-31 06:05 jbpn
+
+ * snmplib/snmp_api.c:
+
+ - Changed packet handling on stream-like transports so that all
+ complete received packets are processed:
+
+ _sess_read is refactored into two functions: _sess_read remains
+ responsible for reading data from the transport layer, but then
+ calls (perhaps more than once) _sess_process_packet to dispatch
+ each packet read.
+
+ - The presence of a session with a buffered partial packet no longer
+ causes snmp_select_info to return with a timeout of zero.
+
+ - Free the subsessions of a session when doing an snmp_sess_close;
+ this fixes an AgentX memory leak when subagents come and go.
+
+ - Perform callbacks with an operation argument of
+ SNMP_CALLBACK_OP_DISCONNECT when you get a transport disconnect
+ indication.
+
+2001-03-31 05:56 jbpn
+
+ * snmplib/snmp_api.h:
+
+ Made transport domain const
+
+2001-03-31 05:55 jbpn
+
+ * snmplib/callback.c:
+
+ Fix memory leak that can occur when deregistering callbacks
+
+2001-03-30 08:05 hardaker
+
+ * README.agentx:
+
+ file README.agentx was initially added on branch V4-2-patches.
+
+2001-03-29 21:43 hardaker
+
+ * ISSUES (V4-2-patches.1), ISSUES:
+
+ rm ISSUES
+
+2001-03-29 08:21 slif
+
+ * win32/libsnmp_dll/: libsnmp.def (V4-2-patches.3), libsnmp.def:
+
+ Add vacm_is_configured.
+
+2001-03-28 06:19 jbpn
+
+ * agent/mibgroup/agentx/: client.c , master_request.c:
+
+ - use SNMP_CALLBACK_OP_<name> callback operation names
+
+2001-03-28 06:00 jbpn
+
+ * apps/snmptrapd.c:
+
+ - use SNMP_CALLBACK_OP_<name> callback operation names
+
+2001-03-28 05:36 jbpn
+
+ * agent/: snmp_agent.c , snmpd.c:
+
+ - use SNMP_CALLBACK_OP_<name> callback operation names
+
+2001-03-28 05:06 jbpn
+
+ * snmplib/: snmp_client.c , snmp_api.c:
+
+ - use SNMP_CALLBACK_OP_<name> callback operation names
+
+2001-03-28 05:04 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - rename callback operations to SNMP_CALLBACK_OP_<name>
+ - add new operations SNMP_CALLBACK_OP_CONNECT, SNMP_CALLBACK_OP_DISCONNECT
+ - add legacy definitions for RECEIVED_MESSAGE, TIMED_OUT, SEND_FAILED
+
+2001-03-27 15:57 hardaker
+
+ * agent/mibgroup/disman/: mteObjectsTable.c ,
+ mteTriggerTable.c:
+
+ change fprintf -> snmp_log.
+ Don't allow modifications of read-only rows in mteObjectsTable.
+
+2001-03-27 10:55 hardaker
+
+ * agent/: ds_agent.h , mibgroup/disman/mteObjectsTable.c
+ , mibgroup/disman/mteObjectsTable.h ,
+ mibgroup/disman/mteTriggerBooleanTable.c ,
+ mibgroup/disman/mteTriggerDeltaTable.c ,
+ mibgroup/disman/mteTriggerExistenceTable.c ,
+ mibgroup/disman/mteTriggerTable.c ,
+ mibgroup/disman/mteTriggerTable.h ,
+ mibgroup/disman/mteTriggerThresholdTable.c:
+
+ Support for new features in the DISMAN-EVENT-MIB code:
+ New snmpd.conf tokens:
+ - monitor [-o oid...] [-u user] oid [(=|!=|<=|...) VALUE].
+ - defaultMonitors yes
+
+2001-03-27 10:53 hardaker
+
+ * snmplib/mib.c:
+
+ Moved * from beginning of routine to the same line as the return
+ variable declaration. Was causing etags grief the other way.
+
+2001-03-27 10:52 hardaker
+
+ * local/Makefile.in:
+
+ patch from Ken Hornstein: use %s instead of @s for search/replace delimiters.
+
+2001-03-27 10:29 hardaker
+
+ * apps/snmptrapd.c:
+
+ Use snmp_log with %s to prevent % expansion in octet strings containing a %s.
+ trap_fmt_free needs ()s.
+
+2001-03-27 08:13 dts12
+
+ * agent/: snmp_agent.c , mibgroup/agentx/master_request.c:
+
+ Handle non-responsive AgentX sub-agents more robustly.
+ (Based on suggestions from Harrie Hazewinkel & Paul Rasmussen)
+
+2001-03-27 08:03 dts12
+
+ * agent/snmp_agent.c:
+
+ Avoid double-freeing of cached address strings.
+ (John's improvement to my suggested fix).
+
+2001-03-27 02:39 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ Reset count of authorized peers on closedown. (Thanks to Vlad Tunik)
+
+2001-03-26 18:01 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c, snmplib/vacm.c, snmplib/vacm.h
+ (V4-2-patches.[1,2,1]), agent/mibgroup/mibII/vacm_vars.c ,
+ snmplib/vacm.c , snmplib/vacm.h:
+
+ Fixed vacm to drop v1/v2c packets properly when no com2sec entries are found.
+
+2001-03-26 11:04 hardaker
+
+ * local/: ipf-mod.pl (V4-2-patches.1), ipf-mod.pl:
+
+ add usage comment at top
+
+2001-03-22 07:55 dts12
+
+ * snmplib/snmp_api.c:
+
+ Use ASN_OCTET_STR rather than the historic ASN_BIT_STR for 'b' object values
+ Patch from Frank Strauss.
+
+2001-03-22 07:46 dts12
+
+ * agent/: agent_trap.c (V4-2-patches.3), agent_trap.c:
+
+ Fix for minor memory leak with trap-related varbind values.
+ Thanks to John Villalovos (and the Intel SNMP team)
+
+2001-03-21 17:30 driehuis
+
+ * snmplib/mib.c:
+
+ Avoid crash in snmp_shutdown on platforms that check pointer validity
+ in free(3), e.g. FreeBSD.
+
+2001-03-21 08:46 hardaker
+
+ * agent/agent_trap.c , agent/mibgroup/util_funcs.c ,
+ agent/mibgroup/mibII/mta_sendmail.c ,
+ agent/mibgroup/mibII/vacm_vars.c ,
+ agent/mibgroup/mibJJ/vacm_vars.c ,
+ agent/mibgroup/target/snmpTargetAddrEntry.c ,
+ agent/mibgroup/target/snmpTargetParamsEntry.c ,
+ agent/mibgroup/target/target.c ,
+ agent/mibgroup/ucd-snmp/disk.c ,
+ agent/mibgroup/ucd-snmp/extensible.c ,
+ agent/mibgroup/ucd-snmp/proc.c ,
+ agent/mibgroup/ucd-snmp/proxy.c , apps/snmptrapd_handlers.c
+ , snmplib/default_store.c , snmplib/read_config.c
+ , snmplib/read_config.h , snmplib/snmpusm.c ,
+ snmplib/snmpv3.c:
+
+ copy_nword created that checks buffer lengths.
+ Made everything use it.
+
+2001-03-21 08:38 hardaker
+
+ * snmplib/snmpksm.c:
+
+ KSM patch from Ken Hornstein
+
+2001-03-20 09:13 jbpn
+
+ * agent/.cvsignore:
+
+ Ignore Purify and NFS stuff
+
+2001-03-16 10:14 hardaker
+
+ * config.h.in:
+
+ added MIT_NEW_CRYPTO (for ksm) definition which was missing
+
+2001-03-16 02:51 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ fix ridiculous memory leak in discontinuity processing
+
+2001-03-15 11:04 hardaker
+
+ * testing/tests/T056agentv2cmintrap:
+
+ whoops. Missed a merge conflict line
+
+2001-03-15 10:59 hardaker
+
+ * README , README.win32 , agent/mib_modules.c ,
+ agent/mibgroup/header_complex.c ,
+ agent/mibgroup/agentx/client.c ,
+ agent/mibgroup/agentx/master.c ,
+ agent/mibgroup/agentx/master_admin.c ,
+ agent/mibgroup/agentx/master_request.c ,
+ agent/mibgroup/agentx/protocol.c ,
+ agent/mibgroup/agentx/subagent.c ,
+ agent/mibgroup/host/hr_filesys.c , agent/mibgroup/mibII/at.c
+ , agent/mibgroup/mibII/ip.c ,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c ,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/target/target.c ,
+ agent/mibgroup/ucd-snmp/dlmod.c ,
+ agent/mibgroup/ucd-snmp/pass_persist.c ,
+ agent/mibgroup/ucd-snmp/proxy.c , apps/snmptrapd.c ,
+ apps/snmptrapd_log.c , apps/snmpnetstat/if.c ,
+ man/snmp.conf.5.def , man/snmpcmd.1 , man/snmptrapd.8
+ , mibs/IANAifType-MIB.txt , mibs/MTA-MIB.txt ,
+ mibs/Makefile.mib , mibs/README.mibs ,
+ mibs/TUNNEL-MIB.txt , mibs/ianalist , mibs/mibfetch
+ , mibs/rfclist , mibs/rfcmibs.diff , mibs/smistrip
+ , perl/SNMP/SNMP.xs , snmplib/asn1.c ,
+ snmplib/default_store.c , snmplib/mib.c ,
+ snmplib/mib.h , snmplib/parse.c , snmplib/snmp_api.c
+ , snmplib/snmp_logging.c , snmplib/snmp_parse_args.c
+ , snmplib/snmp_parse_args.h , snmplib/snmpv3.c ,
+ snmplib/system.h , testing/eval_tools.sh ,
+ testing/tests/T054agentv2ctrap ,
+ testing/tests/T056agentv2cmintrap ,
+ testing/tests/T058agentauthtrap , testing/tests/T100agenthup
+ , win32/config.h , win32/mib_module_config.h ,
+ win32/mib_module_includes.h , win32/mib_module_inits.h ,
+ win32/libsnmp_dll/libsnmp.def ,
+ win32/libucdmibs/libucdmibs.def ,
+ win32/libucdmibs/libucdmibs.dsp:
+
+ merge from patches branch: merge2->3.
+
+2001-03-15 10:22 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.h:
+
+ extra members for discontinuity processing
+
+2001-03-15 07:46 hardaker
+
+ * agent/snmpd.c:
+
+ Patch from Frank Strauss to run signal handlers earlier
+
+2001-03-14 14:37 hardaker
+
+ * agent/: agent_trap.h (V4-2-patches.2), agent_trap.h:
+
+ Patch from Harrie Hazewinkel: make send_enterprise_trap_vars a public fn.
+
+2001-03-14 12:16 slif
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ Use config.h, don't use ucd-snmp directory to build in the mibgroup tree.
+
+2001-03-14 11:05 slif
+
+ * testing/: Makefile.in , RUNTESTS , TESTCONF.sh
+ , eval_onescript.sh , eval_tools.sh:
+
+ merge the test script changes made in the V4-2-patches branch.
+
+2001-03-14 10:57 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ Change to discontinuity processing to stop it returning TRUE all the
+ time
+
+2001-03-14 10:52 jbpn
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ - rough stab at discontinuity processing
+ - bail out of getNext-type loops on a badType condition
+
+2001-03-14 10:34 hardaker
+
+ * README.krb5:
+
+ kerberos README file from Ken Hornstein
+
+2001-03-14 10:28 jbpn
+
+ * agent/mibgroup/disman/mteTriggerDeltaTable.c:
+
+ Get returned *var_len right for mteTriggerDeltaDiscontinuityID
+
+2001-03-14 10:19 slif
+
+ * agent/snmpd.c , agent/mibgroup/examples/ucdDemoPublic.c
+ , apps/snmpvacm.c , apps/snmpnetstat/winstub.c ,
+ snmplib/parse.c , snmplib/snmpUnixDomain.c:
+
+ patch submitted by Harrie Hazewinkel to quiet some warnings.
+
+2001-03-14 10:19 hardaker
+
+ * acconfig.h , configure , configure.in ,
+ snmplib/snmp_api.c , snmplib/snmpksm.c ,
+ snmplib/snmpksm.h:
+
+ KSM patch from Ken Hornstein.
+
+2001-03-14 05:45 dts12
+
+ * agent/mibgroup/host/: hr_swrun.c (V4-2-patches.5), hr_swrun.c:
+
+ Fix Linux file descriptor leak (reported by Oliver FॆआŠnger)
+
+2001-03-14 05:22 jbpn
+
+ * agent/mibgroup/disman/.cvsignore:
+
+ [no log message]
+
+2001-03-14 02:20 jbpn
+
+ * agent/mibgroup/disman/: mteTriggerTable.c ,
+ mteTriggerTable.h:
+
+ - save original PDU's transport domain -- necessary for
+ community string processing
+
+ CAUTION: incompatible change in format of mteTriggerTable
+ configuration entry
+
+ - fix memory leak in mte_run_trigger by releasing PDUs
+
+ - send "bad type" notifications in some cases
+
+ - other minor memory leaks
+
+ - "delta" sampleType handled for boolean triggers
+
+ - more "XXX:" comments!
+
+2001-03-13 13:52 marz
+
+ * perl/SNMP/SNMP.xs:
+
+ fix support for Integer32
+
+2001-03-11 08:43 jbpn
+
+ * snmplib/: snmp_transport.c , snmp_transport.h:
+
+ Add a function to test whether an OID corresponds to a supported transport
+ domain.
+
+2001-03-11 07:55 jbpn
+
+ * snmplib/snmpTCPDomain.h:
+
+ Add #includes to make struct sockaddr_in complete
+
+2001-03-11 07:54 jbpn
+
+ * snmplib/snmpAAL5PVCDomain.h:
+
+ Remove spurious #include
+
+2001-03-09 07:32 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Fix rwuser -s model to actually work.
+
+2001-03-09 05:52 jbpn
+
+ * snmplib/snmpTCPDomain.c:
+
+ Set a PDU's opaque data on a tcp_recv; this isn't necessary to send
+ replies (because the underlying socket is strongly connected) but if
+ you don't do this then you can't do "com2sec" type processing for PDUs
+ received on TCP sessions... interesting.
+
+2001-03-09 03:33 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ Fix bad assumption that community string is zero-terminated
+
+2001-03-08 15:36 hardaker
+
+ * agent/snmpd.c:
+
+ - correct version statements to indicate net-snmp.
+ - remove my name as author (I'm certainly not the only one)
+ - add web address.
+
+2001-03-08 15:31 hardaker
+
+ * README:
+
+ - Added Ken Hornstein's name to contributers list.
+ - Removed mine from being listed separately.
+
+2001-03-08 14:51 hardaker
+
+ * configure , configure.in ,
+ agent/mibgroup/mibII/vacm_vars.c , snmplib/snmpksm.c ,
+ snmplib/snmpksm.h:
+
+ Added a kerberos based security module (ksm).
+ However, Needs libraries (-lkrb5 -lcom_err) not being checked for currently.
+
+2001-03-08 14:48 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Whoops. Shouldnt have a negation sign on the most recent checkin.
+
+2001-03-08 14:38 hardaker
+
+ * snmplib/snmp_api.c:
+
+ If NO_PROBE is set, don't do any post probing activities either like
+ time updating and user creation.
+
+2001-03-08 08:14 jbpn
+
+ * agent/mibgroup/target/target.c:
+
+ Remove strdup()s on some session parameters which cause memory leaks
+ (since snmp_open deep copies the input session anyway)
+
+2001-03-08 08:11 jbpn
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ Make sure sess field of new entries is initialised to NULL.
+
+2001-03-08 07:49 jbpn
+
+ * agent/mibgroup/target/snmpTargetParamsEntry.c:
+
+ Make config token parser update timestamp on entry it creates;
+ move update_timestamp function.
+
+2001-03-07 07:45 hardaker
+
+ * perl/SNMP/: README , SNMP.pm , SNMP.xs:
+
+ Patch from Karl Schilke to remove unneeded timestamp support
+
+2001-03-06 20:58 hardaker
+
+ * snmplib/: snmp_api.c , snmp_client.c , snmp_secmod.c
+ , snmp_secmod.h , snmpusm.c:
+
+ secmod struct symbol name changes to something more intelligible.
+
+2001-03-06 16:46 hardaker
+
+ * snmplib/: snmp_api.c , snmp_client.c:
+
+ - set the default pdu security model to SNMP_DEFAULT_SECMODEL (not 0).
+ - don't force the security model of the session on the pdu if already set.
+
+2001-03-06 16:11 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ hopefully fix to allow other (registered) security models to be used.
+
+2001-03-06 09:23 hardaker
+
+ * README:
+
+ Added John Naylon to the README file.
+
+2001-03-06 09:22 hardaker
+
+ * snmplib/: snmp_api.c , snmp_secmod.h:
+
+ Create a new secmod callback when a timeout on a pdu occurs.
+
+2001-03-06 09:18 hardaker
+
+ * configure , configure.in:
+
+ properly install secmod header list.
+
+2001-03-06 08:43 hardaker
+
+ * snmplib/: snmp_api.c , snmp_secmod.h:
+
+ - bug fixes for secmod related stuff (it compiles now (opps)).
+
+2001-03-06 08:38 hardaker
+
+ * snmplib/: snmp_api.c , snmp_secmod.h:
+
+ - two new secmod callbacks for freeing a pdu and a session.
+ - move transport closing in snmp_sess_close() to after pending
+ requests are freed/closed in case something needs to make use of the
+ transport before it closes.
+
+2001-03-06 07:56 hardaker
+
+ * snmplib/: snmp_api.c , snmp_secmod.h:
+
+ Pass in pdu to secmod encode/decode routines.
+
+2001-03-06 03:35 jbpn
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Modified function Interface_Index_By_Name (Solaris specific) to cope more
+ gracefully with large numbers of interfaces. Also stops Purify on Solaris
+ complaining about uninitialised memory reads.
+
+2001-03-05 16:33 hardaker
+
+ * snmplib/snmp_api.c:
+
+ reverse callback ordering of normal callback/secmod callback
+ processing in sess_copy().
+
+2001-03-05 16:26 hardaker
+
+ * snmplib/snmp_secmod.c:
+
+ remove unused free function calls for security module unregistrations.
+
+2001-03-05 16:17 hardaker
+
+ * snmplib/: snmp_api.c , snmp_secmod.h:
+
+ minor API changes to the pluggable security model handling.
+
+2001-03-05 16:11 hardaker
+
+ * snmplib/snmp_api.c:
+
+ properly respect the DONT_PROBE_FLAG.
+
+2001-03-05 15:36 hardaker
+
+ * snmplib/: snmp_api.c , snmp_api.h , snmp_secmod.h:
+
+ add a session pointer to the v3 build routines.
+
+2001-03-05 15:23 hardaker
+
+ * snmplib/: snmp_api.c , snmp_api.h:
+
+ Add a krb5 specific error code.
+
+2001-03-05 14:58 hardaker
+
+ * configure , configure.in:
+
+ make configure properly handle pluggable security modules
+
+2001-03-05 14:49 hardaker
+
+ * configure , configure.in:
+
+ make configure mkdir snmplib before creating a file in it
+
+2001-03-05 14:44 hardaker
+
+ * configure , configure.in:
+
+ make configure respect non-local srcdirs for transport/secmods
+
+2001-03-05 10:40 hardaker
+
+ * acconfig.h , config.h.in , configure ,
+ configure.in , agent/agent_index.c ,
+ agent/agent_read_config.c , agent/agent_registry.c ,
+ agent/mib_modules.c , agent/snmp_vars.c ,
+ agent/snmpd.c , agent/mibgroup/examples/ucdDemoPublic.c
+ , agent/mibgroup/snmpv3/usmUser.c , apps/snmptrapd.c
+ , snmplib/.cvsignore , snmplib/Makefile.in ,
+ snmplib/callback.h , snmplib/default_store.h ,
+ snmplib/lcd_time.c , snmplib/scapi.c ,
+ snmplib/snmp_api.c , snmplib/snmp_api.h ,
+ snmplib/snmpusm.c , snmplib/snmpusm.h ,
+ snmplib/snmpv3.c:
+
+ support for pluggable security models. Currently only the USM is
+ available, but a new kerberos based security model will be available
+ shortly. These changes simply make it possible to use more than one
+ security service.
+
+2001-03-05 10:36 hardaker
+
+ * snmplib/: snmp_secmod.c , snmp_secmod.h:
+
+ Added John Naylon to the authors list.
+
+2001-03-05 10:33 hardaker
+
+ * snmplib/snmp_enum.h:
+
+ Comment re-arranging to actually be near the functions they're describing.
+
+2001-03-05 06:10 jbpn
+
+ * snmplib/system.c:
+
+ Modified get_myaddr() function to cope more gracefully with large numbers
+ of interfaces, and with the possibility of non-IPv4 addresses on some
+ interfaces. Also stops Purify on Solaris complaining about uninitialised
+ memory reads. Use "official" definition of INADDR_LOOPBACK.
+
+2001-03-03 14:34 nba
+
+ * mibs/ianalist:
+
+ file ianalist was initially added on branch V4-2-patches.
+
+2001-03-03 14:34 nba
+
+ * mibs/rfclist:
+
+ file rfclist was initially added on branch V4-2-patches.
+
+2001-03-03 14:34 nba
+
+ * mibs/README.mibs:
+
+ file README.mibs was initially added on branch V4-2-patches.
+
+2001-03-03 14:34 nba
+
+ * mibs/rfcmibs.diff:
+
+ file rfcmibs.diff was initially added on branch V4-2-patches.
+
+2001-03-01 19:23 hardaker
+
+ * snmplib/: asn1.c , snmp_api.c:
+
+ Fix snmp_oid_compare and reverse encodings to deal with numbers > 2^31.
+
+2001-02-28 23:02 hardaker
+
+ * snmplib/: read_config.c , read_config.h ,
+ snmp_parse_args.c:
+
+ - implemented snmp_config(char *line) to parse a .conf configuration
+ line at any time in the code (handlers must be registered before hand).
+ - implemented snmp_config_remember(char *line) to memorize it for
+ later use.
+ - read_configs, et al, will automatically call them after reading
+ everything else.
+ - Added a -Y flag to snmp_parse_args to store read config directives
+ for later use, thus allowing you to specify .conf directives on the
+ command line.
+
+2001-02-27 07:28 dts12
+
+ * agent/snmp_vars.c:
+
+ Avoid infinite loop with AgentX subagents and VACM checking interaction.
+ (Fix provided by Frank Strauss)
+
+2001-02-21 15:21 hardaker
+
+ * snmplib/: ucd-snmp-includes.h (V4-2-patches.1),
+ ucd-snmp-includes.h:
+
+ Applied patch #103805 from bcollar: add sys/time.h to ucd-snmp-includes.h
+
+2001-02-21 15:15 hardaker
+
+ * snmplib/: int64.c (V4-2-patches.2), int64.c:
+
+ fix bug #133416 (u64Subtraction math) as suggested by the submittor
+
+2001-02-16 15:12 hardaker
+
+ * agent/: var_struct.h (V4-2-patches.1), var_struct.h:
+
+ - increase UCD_REGISTRY_OID_MAX_LEN to 128 at Frank's request
+
+2001-02-16 04:16 jbpn
+
+ * configure.in:
+
+ Change behaviour on cygwin to exclude Unix domain transports by default
+ on cygwin, and also fix a minor bug, thanks to suggestions by Peter Folk.
+
+2001-02-14 18:14 hardaker
+
+ * apps/: snmptrapd.c (V4-2-patches.1), snmptrapd.c:
+
+ removed unused snmp_alarm.h include
+
+2001-02-12 14:11 marz
+
+ * perl/SNMP/SNMP.pm:
+
+ added Karl's patch for usenumeric
+
+2001-02-12 13:54 marz
+
+ * perl/SNMP/: MANIFEST , SNMP.pm , SNMP.xs ,
+ examples/trap-example.pl:
+
+ added trap reception API from Philip Prindeville <philipp@cisco.com>
+
+2001-02-11 08:23 jbpn
+
+ * apps/snmptrapd.c:
+
+ Use snmp_add not snmp_sess_add (the latter doesn't add a session to
+ the Session list, and it therefore won't get included in the select()
+ fdset, hence snmptrapd will never receive very much).
+
+2001-02-11 08:20 jbpn
+
+ * snmplib/snmpUDPDomain.c:
+
+ Fix improperly-terminated list in com2sec handling.
+
+2001-02-11 07:45 jbpn
+
+ * agent/snmpd.c:
+
+ Clean up merge (>>>>>>, ====== etc. left behind).
+
+2001-02-10 09:26 jbpn
+
+ * configure.in:
+
+ Fix typo.
+
+2001-02-10 09:11 jbpn
+
+ * agent/mibgroup/agentx/: master.c , master_admin.c ,
+ subagent.c:
+
+ Memory leak patches (sourceforge patch #103605).
+ Remove a few strdup()s, and call free_agent_snmp_session() rather than
+ free() in subagent.c:handle_agentx_packet() for AGENTX_MSG_RESPONSE
+ and default cases, to ensure free()ing of cloned PDU allocated by
+ init_agent_snmp_session.
+
+2001-02-10 07:28 hardaker
+
+ * snmplib/: snmpAAL5PVCDomain.c , snmpAAL5PVCDomain.h ,
+ snmpIPXDomain.c , snmpIPXDomain.h , snmpTCPDomain.c
+ , snmpTCPDomain.h , snmpUDPDomain.c ,
+ snmpUDPDomain.h , snmpUnixDomain.c , snmpUnixDomain.h
+ , snmp_transport.c , snmp_transport.h:
+
+ Whoops. Forgot the new files associated with the pluggable transport stuff.
+
+2001-02-09 11:22 hardaker
+
+ * agent/mibgroup/disman/: event-mib.h , mteObjectsTable.c
+ , mteObjectsTable.h , mteTriggerBooleanTable.c ,
+ mteTriggerExistenceTable.c , mteTriggerTable.c ,
+ mteTriggerTable.h , mteTriggerThresholdTable.c:
+
+ Implemented and made use of mteObjectsTable to send additional objects out with traps generated. Also, don't return data for misc tables when that trigger isn't defined to use that test type.
+
+2001-02-09 11:16 hardaker
+
+ * agent/: snmpd.c (V4-2-patches.2), snmpd.c:
+
+ Applied patch #103613: fix memory leak in snmpd port specification -> default_store.
+
+2001-02-09 11:14 hardaker
+
+ * agent/: mib_modules.c (V4-2-patches.2), mib_modules.c:
+
+ Applied patch #103612: fix memory leak in mib_module init code
+
+2001-02-09 11:12 hardaker
+
+ * agent/: agent_registry.c (V4-2-patches.1), agent_registry.c:
+
+ Applied patch #103611: fix memory leak for duplicate oid registrations.
+
+2001-02-09 11:05 hardaker
+
+ * agent/mibgroup/ucd-snmp/: memory_freebsd2.c, proxy.c
+ (V4-2-patches.[1,4]), memory_freebsd2.c:
+
+ Applied patch #103702: fix swap reporting on freebsd 4.2
+
+2001-02-09 10:12 hardaker
+
+ * acconfig.h , config.h.in , configure ,
+ configure.in , agent/agent_trap.c , agent/snmp_agent.c
+ , agent/snmp_agent.h , agent/snmp_vars.c ,
+ agent/snmpd.c , agent/mibgroup/mibII/vacm_vars.c ,
+ apps/snmpstatus.c , apps/snmptest.c , apps/snmptrap.c
+ , apps/snmptrapd.c , apps/snmptrapd_log.c ,
+ apps/snmptrapd_log.h , mibs/UCD-SNMP-MIB.txt ,
+ snmplib/Makefile.in , snmplib/snmp_alarm.c ,
+ snmplib/snmp_alarm.h , snmplib/snmp_api.c ,
+ snmplib/snmp_api.h , snmplib/snmp_client.c ,
+ snmplib/vacm.h:
+
+ Applied patch 103510: domain transport independence. Note: Traps/VACM broken.
+
+2001-02-09 08:54 hardaker
+
+ * testing/tests/: T001snmpv1get , T002snmpv1getnext ,
+ T003snmpv1getfail , T014snmpv2cget , T015snmpv2cgetnext
+ , T016snmpv2cgetfail , T017snmpv2ctov1getfail ,
+ T018snmpv1tov2cgetfail , T020snmpv3get ,
+ T021snmpv3getnext , T022snmpv3getMD5 ,
+ T023snmpv3getMD5DES , T024snmpv3getSHA1 ,
+ T025snmpv3getSHADES , T028snmpv3getfail ,
+ T030snmpv3usercreation , T053agentv1trap ,
+ T054agentv2ctrap , T055agentv1mintrap ,
+ T056agentv2cmintrap , T058agentauthtrap , T100agenthup
+ , T110agentxget , T111agentxset , T112agentxsetfail
+ , T113agentxtrap , T120proxyget , T121proxyset
+ , T122proxysetfail:
+
+ updated most tests to use numeric OIDs so as to not rely on mib parsing
+
+2001-02-09 07:18 hardaker
+
+ * agent/mibgroup/agentx/master.h:
+
+ remove unused prototype: get_agentx_transID
+
+2001-02-08 14:15 hardaker
+
+ * local/Makefile.in , local/traptoemail ,
+ man/snmptrapd.conf.5.def:
+
+ traptoemail perl script created as an example traphandle script
+
+2001-02-08 14:01 hardaker
+
+ * Makefile.in , acconfig.h , config.h.in ,
+ agent/Makefile.in , agent/agent_trap.c ,
+ agent/mib_modules.c , agent/snmpd.c ,
+ agent/mibgroup/kernel_sunos5.c ,
+ agent/mibgroup/agentx/client.c ,
+ agent/mibgroup/agentx/master.c ,
+ agent/mibgroup/agentx/master_admin.c ,
+ agent/mibgroup/agentx/master_admin.h ,
+ agent/mibgroup/agentx/master_request.c ,
+ agent/mibgroup/agentx/protocol.c ,
+ agent/mibgroup/agentx/subagent.c ,
+ agent/mibgroup/host/hr_print.c ,
+ agent/mibgroup/host/hr_swrun.c ,
+ agent/mibgroup/mibII/interfaces.c ,
+ agent/mibgroup/mibII/var_route.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/smux/smux.c ,
+ agent/mibgroup/ucd-snmp/loadave.c ,
+ agent/mibgroup/ucd-snmp/proxy.c ,
+ agent/mibgroup/ucd-snmp/vmstat.h ,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c ,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.h ,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c ,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h ,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c ,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.h ,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c ,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.h , apps/snmpdelta.c
+ , apps/snmpset.c , apps/snmptrap.c ,
+ apps/snmpvacm.c , apps/snmpnetstat/Makefile.in ,
+ local/mib2c , man/snmpcmd.1 , mibs/RMON-MIB.txt ,
+ mibs/UCD-SNMP-MIB.txt , perl/SNMP/SNMP.pm ,
+ snmplib/int64.c , snmplib/parse.c , snmplib/snmp_api.c:
+
+ Merge from V4-2-patches: merge 1->2
+
+2001-01-30 17:13 hardaker
+
+ * agent/mibgroup/ucd-snmp/: disk.c (V4-2-patches.1), disk.c:
+
+ Applied patch #103414: fix disk info for block sizes other than 1024.
+
+2001-01-30 13:28 hardaker
+
+ * agent/mibgroup/disman/mteTriggerTable.c:
+
+ use snmp_enum's properly (strdup() the strings first)
+
+2001-01-30 13:28 hardaker
+
+ * snmplib/: snmp_enum.c , snmp_enum.h:
+
+ proper constness for some of the function arguments.
+
+2001-01-30 13:27 hardaker
+
+ * snmplib/read_config.c:
+
+ fix bug I just introduced (returning proper saveto pointer)
+
+2001-01-30 13:17 hardaker
+
+ * local/tkmib:
+
+ - snmpsets are supported
+ - A new "set" button has been added to perform sets on an oid.
+ - All writable objects in a table are now buttons that bring up the
+ set window with the current value instated.
+ - All writable objects in the output of snmp{get,walk,getnext}
+ buttons are displayed as blue and are clickable to change their
+ values.
+ - settings configured via the options menu can now be saved.
+ - use Getopt::Std now.
+ - supports most of the important snmpcmd(1) flags for session setup.
+
+2001-01-30 13:12 hardaker
+
+ * agent/mibgroup/disman/: event-mib.h ,
+ mteTriggerBooleanTable.c , mteTriggerBooleanTable.h ,
+ mteTriggerDeltaTable.c , mteTriggerDeltaTable.h ,
+ mteTriggerExistenceTable.c , mteTriggerExistenceTable.h ,
+ mteTriggerTable.c , mteTriggerTable.h ,
+ mteTriggerThresholdTable.c , mteTriggerThresholdTable.h:
+
+ Initial (not-complete) implementation of the DISMAN-EVENT-MIB:
+ - Implements all 3 tests (boolean, threshold and existence).
+ - not rigorously tested.
+ - Currently only supports querying the local agent
+ (mteTriggerTargetTag must be '').
+ - Currently only supports sending traps and the mteObjectsTable is
+ not implemented (my next todo item)
+ - Only the default traps are sent. The mteEvent* objects haven't
+ been implemented (no self-defined traps/sets).
+ - no easy to use configuration yet (soon).
+ - configure with --with-mib-modules=disman/event-mib
+
+2001-01-30 13:03 hardaker
+
+ * snmplib/read_config.c:
+
+ Use memcpy instead of sprintf for strings that may not be null terminated.
+
+2001-01-30 12:58 hardaker
+
+ * agent/: snmp_agent.c , snmp_agent.h:
+
+ Implemented get_current_agent_session() and set_current_agent_session():
+ - These allow a mib module to retrieve the current
+ agent_snmp_session pointer for the current transaction.
+ - This should probably done differently later when we change the mib
+ module api.
+ - This will completely fail to work properly in a multi-threaded
+ agent (which we currently don't support anyway).
+
+2001-01-29 11:58 hardaker
+
+ * snmplib/callback.c:
+
+ debugging statement at initialization time.
+
+2001-01-29 11:58 hardaker
+
+ * snmplib/read_config.c:
+
+ properly malloc a 1 byte, NULL character string for "" read strings.
+
+2001-01-29 11:54 hardaker
+
+ * agent/mibgroup/: header_complex.c , header_complex.h:
+
+ data seperation and new functions:
+ header_complex_get_from_oid()
+ header_complex_add_data_by_oid()
+
+2001-01-12 08:22 hardaker
+
+ * mibs/DISMAN-EVENT-MIB.txt:
+
+ - DISMAN-EVENT-MIB added to mib repository. (Or, guess what I did during a 6 hour plane flight?)
+
+2001-01-12 08:16 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ support bit strings
+
+2001-01-12 08:00 hardaker
+
+ * snmplib/: snmp_api.c (V4-2-patches.5), snmp_api.c:
+
+ - bit_string fixes
+ - make snmp_add_var call snmp_parse_oid() instead of read_objid().
+
+2001-01-12 07:58 hardaker
+
+ * snmplib/read_config.c:
+
+ - new data types supported for read_config routines: unsigned, bit_str.
+
+2001-01-12 07:56 hardaker
+
+ * snmplib/: asn1.c (V4-2-patches.3), asn1.c:
+
+ comment out really odd (and broken) check from asn_bitstring_check???
+
+2001-01-12 07:53 hardaker
+
+ * agent/mibgroup/agentx/subagent.c:
+
+ move config string initializer above subagent check so its known even
+ if not used.
+
+2001-01-12 07:51 hardaker
+
+ * local/: mib2c.storage.conf, mib2c.vartypes.conf
+ (V4-2-patches.[1,1]), mib2c.storage.conf ,
+ mib2c.vartypes.conf:
+
+ - misc bug fixes.
+ - new data types (uint32, unsigned, bits).
+
+2001-01-09 17:08 hardaker
+
+ * agent/: agent_registry.c , agent_registry.h ,
+ ds_agent.h , var_struct.h , mibgroup/mibincl.h ,
+ mibgroup/agentx/client.c , mibgroup/agentx/master_admin.c
+ , mibgroup/agentx/master_request.c ,
+ mibgroup/agentx/subagent.c , mibgroup/agentx/subagent.h:
+
+ SubAgent ping support:
+ - agentxPingInterval specifies SECONDS between when the subagent
+ tries to ping the master agent.
+ - if no response is received, it tries to reconnect.
+ - failing that it tries every SECONDS again till it succeeds.
+ - re-registers its oid's based on the current subtree list.
+ - may need some thought. Assumes *all* need to be re-registered.
+ - needs to re-register sysortable entries too, but doesn't.
+ - currently seg-faults on about the 2-4th time or so. Not sure why.
+ - Should make Dave smile or cringe or giggle, not sure which.
+
+2001-01-09 17:02 hardaker
+
+ * snmplib/: callback.c , callback.h:
+
+ Allow deregistering of callbacks
+
+2001-01-09 06:20 hardaker
+
+ * win32/snmpnetstat/: snmpnetstat.dsp (V4-2-patches.1),
+ snmpnetstat.dsp:
+
+ added getopt.c to list
+
+2001-01-04 16:44 hardaker
+
+ * snmplib/: snmp_enum.c , snmp_enum.h:
+
+ - generic snmp enum list support. Not used anywhere (yet).
+
+2001-01-04 16:43 hardaker
+
+ * configure , configure.in , agent/agent_callbacks.h
+ , agent/agent_trap.c , agent/agent_trap.h ,
+ agent/mibgroup/examples/example.c ,
+ agent/mibgroup/host/hr_swrun.c ,
+ agent/mibgroup/mibII/interfaces.c ,
+ agent/mibgroup/notification/snmpNotifyTable.c ,
+ agent/mibgroup/notification/snmpNotifyTable.h ,
+ apps/snmpnetstat/main.c , snmplib/Makefile.in ,
+ snmplib/asn1.c , snmplib/callback.c ,
+ snmplib/callback.h , snmplib/mib.c ,
+ snmplib/snmp_api.c , snmplib/snmp_logging.c ,
+ testing/tests/T053agentv1trap , testing/tests/T054agentv2ctrap
+ , testing/tests/T055agentv1mintrap ,
+ testing/tests/T056agentv2cmintrap ,
+ testing/tests/T113agentxtrap:
+
+ - merged patches from V4-2-patches branch to main branch.
+
+2001-01-04 10:37 hardaker
+
+ * man/snmp.conf.5.def , man/snmpcmd.1 , snmplib/mib.c:
+
+ - added new printHexText snmp.conf token.
+ - documented -OT, and the token.
+
+2001-01-04 10:27 hardaker
+
+ * snmplib/: default_store.h , mib.c:
+
+ Patch #103091 applied:
+ - Added -OT option to view hex strings with text in them.
+
+2000-12-27 16:47 hardaker
+
+ * testing/tests/T056agentv2cmintrap:
+
+ file T056agentv2cmintrap was initially added on branch V4-2-patches.
+
+2000-12-27 16:47 hardaker
+
+ * testing/tests/T055agentv1mintrap:
+
+ file T055agentv1mintrap was initially added on branch V4-2-patches.
+
+2000-12-22 07:02 hardaker
+
+ * snmplib/vacm.c:
+
+ fix view processing to watch for length prefix. The length prefix
+ really really shouldn't be stored directly in the oid. Niels?
+
+2000-12-19 07:22 hardaker
+
+ * snmplib/snmpv3.c:
+
+ make init_snmpv3() deal with a NULL argument properly.
+
+2000-12-18 14:37 hardaker
+
+ * local/.cvsignore:
+
+ - (.cvsignore): remove passtest from the .cvsignore file (bug #12694)
+
+2000-12-18 10:45 marz
+
+ * perl/SNMP/: README , SNMP.pm:
+
+ minor doc fix
+
+2000-12-14 13:46 nba
+
+ * snmplib/system.c:
+
+ - system.c: fix uptime for 64-bit Solaris
+
+2000-12-14 13:45 nba
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ - dlmod.c: fix stupid spelling error
+
+2000-12-13 21:52 nba
+
+ * agent/mibgroup/ucd-snmp/dlmod.c:
+
+ - dlmod.c: fix confusion between int, size_t, long for 64-bit compiles.
+
+2000-12-13 08:40 hardaker
+
+ * man/Makefile.in:
+
+ - (Makefile.in): add snmpconf.1
+
+2000-12-08 14:49 nba
+
+ * agent/mibgroup/mibII/vacm_vars.c , snmplib/vacm.c:
+
+ - vacm_vars.c, vacm.c: indexing of vacmViewTreeFamilyEntry was hosed, assuming
+ that the Subtree index had an IMPLIED attribute.
+
+2000-12-08 14:46 nba
+
+ * agent/mibgroup/host/: hr_filesys.c , hr_partition.c:
+
+ - hr_filesys.c, hr_partition.c: fix some zero index values.
+
+2000-12-08 14:43 nba
+
+ * agent/snmp_vars.c:
+
+ - snmp_vars.c: fix returns of zeroDotZero (such as ifSpecific)
+
+2000-12-08 14:38 nba
+
+ * agent/agent_trap.c:
+
+ - agent_trapd.c: security model values are not the same is snmp version values
+
+2000-12-06 14:45 nba
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - interfaces.c: Linux kernel 2.0.x has no ARPHRD_HIPPI
+
+2000-12-05 07:00 hardaker
+
+ * local/Makefile.in:
+
+ - (Makefile.in): Fix rsnmp's /usr/local hardcoded path.
+
+2000-12-04 17:03 hardaker
+
+ * testing/tests/T112agentxsetfail:
+
+ - (T112agentxsetfail): fix
+
+2000-12-04 16:33 hardaker
+
+ * README , sedscript.in , version.h:
+
+ - (version.h sedscript.in): version tag ( 5.2 )
+
+-------------------------------------------------------------------------------
+
+Changes: V4.2.3 -> V4.2.4
+
+2002-04-04 15:24 hardaker
+
+ * snmplib/: snmp_api.c, snmp_api.h:
+
+ patch from Petter Larsen to add a function for extracting the fd associated with a session
+
+2002-04-04 15:14 hardaker
+
+ * agent/agent_registry.c:
+
+ deal with fd unregistrations properly.
+
+2002-04-03 08:32 hardaker
+
+ * FAQ, README, sedscript.in, version.h, perl/SNMP/SNMP.pm:
+
+ - (version.h sedscript.in): version tag ( 4.2.4.pre3 )
+
+2002-04-02 15:02 hardaker
+
+ * agent/mibgroup/ucd-snmp/registry.c:
+
+ Apply patch #515577 to fix one case of a registry problem.
+
+2002-04-02 14:57 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c, s/darwin.h:
+
+ Apply patch #524424 for darwin fixes for ucd-snmp/disk.c
+
+2002-04-02 14:48 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ apply patch 527573 to fix 64 bit types on solaris
+
+2002-04-01 22:28 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Let init_snmp protect itself.
+
+2002-03-28 23:48 hardaker
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ enable row creation for pass modules. Patch #482005
+
+2002-03-28 23:44 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ patch #517340: freebsd5 support
+
+2002-03-28 23:38 hardaker
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ apply freebsd5 patch #517333
+
+2002-03-28 23:10 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ fix bug #525844. perl SNMP was using a trap address of 0.0.0.0.
+
+2002-03-28 23:03 hardaker
+
+ * snmplib/snmp_api.c:
+
+ use a static variable for init checking. Bug #536386.
+
+2002-03-28 15:23 dts12
+
+ * FAQ:
+
+ Add a few new entries (mostly relating to traps)
+
+2002-03-27 01:55 dts12
+
+ * configure.in, configure:
+
+ Use the correct name of the Windows IP Helper API library.
+ (Computers can be soooo picky!)
+
+2002-03-26 08:29 hardaker
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ enable diskio on freebsd5. Implements patch 517328 in a different way.
+
+2002-03-26 07:44 dts12
+
+ * configure, configure.in:
+
+ Add /etc/filesystems to list of mount table files (for AIX)
+ Should fix bugs 232588 and (?)517113
+
+2002-03-26 07:39 dts12
+
+ * configure, configure.in:
+
+ Remove trailing ':' from list of MIB module names in configure output,
+ to avoid confusion (see Bug #491129)
+
+2002-03-26 06:50 dts12
+
+ * configure, configure.in:
+
+ Add '-lhlpapi' to the agent libraries when compiling under Windows
+ (using Cygwin). DLLIBS is not as suitable as AGENT_LIBS for this
+ (see the equivalent patch on the main branch), but it should do.
+ Should fix Bug #534409.
+
+2002-03-25 22:33 rstory
+
+ * snmplib/parse.c:
+
+ fix bug#520478 showMibErrors token is inverted
+
+2002-03-25 18:47 rstory
+
+ * agent/snmp_vars.c:
+
+ fix bug#502123 agentx infinite loop.
+
+2002-03-24 05:19 nba
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Restrict hrSWRunParams returns values to 128 octets
+
+2002-03-24 05:04 nba
+
+ * snmplib/mib.c:
+
+ Oops - snprint_* cannot realloc
+
+2002-03-21 07:21 hardaker
+
+ * configure.in, configure:
+
+ fix bug #532696 fixing rpm for newer rpm versions
+
+2002-03-20 07:48 hardaker
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ remove illegal SET support for sysDescr.
+
+2002-03-19 02:01 jbpn
+
+ * agent/mibgroup/smux/smux.h:
+
+ - patch from Joshua Giles to increase the maximum string length
+ (#527650).
+
+2002-03-18 14:38 nba
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Add missing exports for VC++ build
+
+2002-03-18 13:23 nba
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Proper test for successful open of ETC_MNTTAB
+
+2002-03-18 13:09 nba
+
+ * agent/agent_read_config.c:
+
+ Fix interchanged parameters for strncpy
+
+2002-03-18 08:51 dts12
+
+ * win32/: win32.dsw, encode_keychange/encode_keychange.dsp,
+ libagent/libagent.dsp, libsnmp/libsnmp.dsp,
+ libsnmp_dll/libsnmp_dll.dsp, libucdmibs/libucdmibs.dsp,
+ snmpbulkget/snmpbulkget.dsp, snmpbulkwalk/snmpbulkwalk.dsp,
+ snmpd/snmpd.dsp, snmpdelta/snmpdelta.dsp, snmpdf/snmpdf.dsp,
+ snmpgetnext/snmpgetnext.dsp, snmpget/snmpget.dsp,
+ snmpnetstat/snmpnetstat.dsp, snmpset/snmpset.dsp,
+ snmpstatus/snmpstatus.dsp, snmptable/snmptable.dsp,
+ snmptest/snmptest.dsp, snmptranslate/snmptranslate.dsp,
+ snmptrap/snmptrap.dsp, snmptrapd/snmptrapd.dsp,
+ snmpusm/snmpusm.dsp, snmpvacm/snmpvacm.dsp, snmpwalk/snmpwalk.dsp:
+
+ Apply DOS-type line endings to the DSW/DSP files.
+
+2002-03-18 08:41 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ Use the same variable name for output buffer and size calculation.
+
+2002-03-18 05:39 jbpn
+
+ * README.hpux11, agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_system.c, agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/ucd-snmp/loadave.c,
+ agent/mibgroup/ucd-snmp/memory.c, agent/mibgroup/ucd-snmp/memory.h,
+ s/hpux.h:
+
+ - commit Johannes's update to the HPUX-11 patch
+
+2002-03-18 02:31 jbpn
+
+ * agent/mibgroup/agentx/master.c:
+
+ - extend tcp_wrappers support to AgentX. This makes it more
+ reasonable to implement a distributed subagent architecture
+ without massive security worries.
+
+2002-03-14 07:23 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Fix dont_probe bug pointed out by Stefan Aeschbacher.
+
+2002-03-13 18:58 slif
+
+ * snmplib/asn1.c:
+
+ Clarify unsigned char argument for the noisy or confused compiler.
+
+2002-03-13 18:46 slif
+
+ * agent/mibgroup/mibII/vacm_vars.c, apps/snmptrapd_log.c:
+
+ quell several warnings about signed vs unsigned comparisons.
+
+2002-03-13 18:44 slif
+
+ * win32/win32.dsw:
+
+ remove dependencies to restore building either Debug or Release targets.
+
+2002-03-13 18:43 slif
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ track change setenv --> snmp_setenv
+
+2002-03-13 15:50 hardaker
+
+ * mibs/: UCD-DEMO-MIB.txt, UCD-DISKIO-MIB.txt, UCD-DLMOD-MIB.txt,
+ UCD-IPFILTER-MIB.txt, UCD-IPFWACC-MIB.txt, UCD-SNMP-MIB.txt:
+
+ address changes for ucd-snmp -> net-snmp note saying these mibs are no
+ longer supported by UCD.
+
+2002-03-13 15:21 hardaker
+
+ * snmplib/tools.c:
+
+ malloc at least one byte in hex_to_binary2
+
+2002-03-13 04:03 dts12
+
+ * FAQ:
+
+ Add a description of "unlinked OIDs".
+
+2002-03-12 20:03 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.c:
+
+ Patch from daniel Sully to improve solaris swap info
+
+2002-03-12 08:34 dts12
+
+ * FAQ:
+
+ Updating of the FAQ ready for the next release.
+ (Mostly rephrasing of existing entries, but a few new questions)
+
+2002-03-11 10:06 hardaker
+
+ * agent/: mibgroup/smux/smux.c, mibgroup/ucd-snmp/proxy.c,
+ agent_index.c, agent_read_config.c, agent_registry.c, snmp_agent.c,
+ snmpd.c, mibgroup/agentx/master_request.c:
+
+ better printing apis
+
+2002-03-11 10:06 hardaker
+
+ * apps/snmpvacm.c:
+
+ fix api in a comment (how picky am I?)
+
+2002-03-11 07:41 dts12
+
+ * FAQ:
+
+ Bring the 4x- and main-branch FAQs into agreement.
+
+2002-03-11 05:16 jbpn
+
+ * snmplib/parse.c:
+
+ - fix bad type assignment in build_translation_table(), noticed by
+ Peter Stevens.
+
+2002-03-10 14:07 nba
+
+ * snmplib/mib.h:
+
+ Oops - forgot to remove the #ifdef for unsafe sprint_* functions declarations
+
+2002-03-10 13:54 nba
+
+ * apps/snmpwalk.c:
+
+ Fix up out-of-order error message
+
+2002-03-10 13:44 nba
+
+ * apps/snmpdelta.c:
+
+ Don't die on v2 exceptions
+
+2002-03-10 13:41 nba
+
+ * snmplib/: asn1.c, snmp_debug.c:
+
+ Remove some calls to old sprint_* functions
+
+2002-03-10 13:39 nba
+
+ * snmplib/: mib.c, mib.h:
+
+ Add snprint_* replacement functions for all sprint_* functions
+
+2002-03-10 13:38 nba
+
+ * man/mib_api.3:
+
+ Document snprint_{objid,variable,value}
+
+2002-03-10 08:34 hardaker
+
+ * snmplib/: mib.c, mib.h:
+
+ include the snprintf counterparts from the 5.0 code.
+
+2002-03-08 18:07 hardaker
+
+ * agent/mibgroup/mibII/ipAddr.c:
+
+ redefine a variable on freebsd for 2.2.5
+
+2002-03-08 17:57 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ remove a broken fix I accidentically committed
+
+2002-03-08 17:42 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ patch from Mihail Balikov to support up but no ip interfaces.
+
+2002-03-08 17:27 hardaker
+
+ * configure.in, configure, aclocal.m4:
+
+ patch from Paul Rasmussen to fix --enable-shared
+
+2002-03-08 16:58 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ old patch from Bert Driehuis to fix c64s in perl
+
+2002-03-08 14:53 nba
+
+ * snmplib/mib.c:
+
+ Remove 1000 lines of duplicate code by using the sprint_realloc_* functions
+ in the implementaion of the non-realloc counterparts.
+
+2002-03-08 14:51 nba
+
+ * apps/: snmpdelta.c, snmptable.c, snmpusm.c, snmpwalk.c:
+
+ Remove last sprint_nonrealloc calls
+
+2002-03-07 03:20 jbpn
+
+ * man/mib_api.3:
+
+ - patch from Guy Harris to describe new mib_api
+
+2002-03-07 02:58 jbpn
+
+ * snmplib/mib.h:
+
+ - declare the sprint_realloc_blah functions. Thanks to Guy Harris.
+
+2002-03-06 08:41 dts12
+
+ * snmplib/snmpv3.c:
+
+ Fix a confusion between defAuthType and defPrivType.
+
+2002-03-06 05:52 dts12
+
+ * snmplib/snmp_api.c:
+
+ Actually use the common 'defPassphrase' value if 'def{Auth,Priv}Passphrase' isn't set.
+ Qn: Should the AuthPassphrase also be used for privacy if no other value is available?
+
+2002-03-06 03:19 jbpn
+
+ * testing/Makefile.in:
+
+ - ignore errors doing rm -rf /tmp/snmp-test* when making clean (this
+ happens all the time on the compile farm because e.g. I can't
+ delete Wes's test directories and it's a nuisance because then the
+ rest of the directories don't get cleaned up properly).
+
+2002-03-06 02:24 jbpn
+
+ * snmplib/mib.c:
+
+ - fix another potential buffer overflow problem as reported in bug
+ #526262.
+
+2002-03-05 10:45 hardaker
+
+ * agent/mibgroup/ucd-snmp/versioninfo.c:
+
+ impose max length restriction supplied by mib for configuration options.
+
+2002-03-05 09:52 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ missed a modification to the patch.
+
+2002-03-05 09:51 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ A modified patch from Juergen Schoenwaelder for longer configure strings.
+
+2002-03-05 08:23 dts12
+
+ * agent/snmp_vars.h:
+
+ Reverse my earlier (bogus) fix.
+ Things were fine as they were - I must be cracking up.....
+
+2002-03-05 08:05 dts12
+
+ * agent/mibgroup/examples/ucdDemoPublic.c:
+
+ Add missing "standard" headers, and tweak a type slightly.
+ (Based on requests from Gregory Toth).
+
+2002-03-05 06:56 dts12
+
+ * agent/snmp_vars.h:
+
+ Bring declaration of 'init_agent' into line with code definition.
+
+2002-03-05 06:48 dts12
+
+ * agent/mibgroup/: notification/snmpNotifyTable.c, ucd-snmp/dlmod.c:
+
+ Cast a couple of mallocs appropriately (requested by Gregory Toth)
+
+2002-03-04 21:38 hardaker
+
+ * FAQ, README, sedscript.in, version.h, perl/SNMP/SNMP.pm:
+
+ - (version.h sedscript.in): version tag ( 4.2.4.pre2 )
+
+2002-03-04 01:51 dts12
+
+ * local/mib2c:
+
+ Catch and report invalid node specifications.
+ (This ought to be handled by that test that follows immediately, but
+ "$SNMP::MIB{$oid}" appears to return the core mib-2 object regardless)
+
+2002-03-04 01:16 dts12
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ Correct debug output message (thanks to Jeroen Ruigrok)
+
+2002-03-01 22:37 hardaker
+
+ * snmplib/asn1.c:
+
+ fix bug #524529
+
+2002-03-01 07:17 nba
+
+ * ltmain.sh, aclocal.m4, configure:
+
+ Pull in up-to-date libtool, which should help Darwin
+
+2002-03-01 07:15 nba
+
+ * config.guess, config.sub:
+
+ Pull in up-to-date config scripts
+
+2002-02-27 09:47 dts12
+
+ * snmplib/vacm.c:
+
+ Handle views that specify a full instance OID.
+ (Since the internally stored OID prepends the length as well,
+ the apparent length is one greater than it really is)
+
+2002-02-26 14:18 nba
+
+ * snmplib/: parse.c, parse.h:
+
+ Save File/line for messages about unlinked OIDs
+
+2002-02-25 15:46 nba
+
+ * mibs/: Makefile.mib, mibfetch:
+
+ Make sure that we fetch IANAifType-MIB from the maintained location.
+
+2002-02-25 15:45 nba
+
+ * mibs/DISMAN-SCHEDULE-MIB.txt:
+
+ Update for RFC 3231
+
+2002-02-25 08:59 nba
+
+ * mibs/rfclist:
+
+ New RFC's issued with mibs:
+ 3201 CIRCUIT-IF-MIB
+ 3202 FRSLD-MIB
+ 3231 DISMAN-SCHEDULE-MIB
+
+2002-02-25 08:57 nba
+
+ * agent/mibgroup/host/hr_disk.c:
+
+ FreeBSD4 has new disk names
+
+2002-02-25 08:56 nba
+
+ * agent/mibgroup/host/hr_print.c:
+
+ Properly bracket run_lpstat prototype
+
+2002-02-25 02:48 jbpn
+
+ * snmplib/parse.c:
+
+ - only copy the first DESCRIPTION clause of MODULE-COMPLIANCE
+ statements to avoid a memory leak (see bug #522363).
+
+2002-02-25 01:21 dts12
+
+ * agent/snmpd.c:
+
+ Specify the correct debug token for displaying the list of modules
+ (spotted by Brian Shaver)
+
+2002-02-22 09:27 dts12
+
+ * snmplib/: MSG00001.bin, winservice.mc ,
+ MSG00001.bin (1.1), winservice.mc (1.1):
+
+ Add missing files for Windows service operation.
+
+2002-02-22 08:42 dts12
+
+ * agent/snmpd.c:
+
+ Just close the main session when shutting down under Windows,
+ not everything (so that it can still generate the shutdown trap).
+
+2002-02-22 01:49 jbpn
+
+ * FAQ, README.win32:
+
+ - update comments on Win32 port in FAQ
+
+ - discuss what IPHLPAPI.{LIB,DLL} is and where it can be obtained
+ from in README.win32
+
+2002-02-21 07:02 dts12
+
+ * win32/snmpd/snmpd.dsp:
+
+ Fix bogus structure comments in the snmpd project file.
+
+2002-02-21 03:13 jbpn
+
+ * agent/mibgroup/smux/smux.c:
+
+ - emit error on over-length password instead of writing off end of
+ buffer (bug #520649, noted by John Sellens).
+
+2002-02-20 09:27 jbpn
+
+ * apps/snmptranslate.c, apps/snmptrapd.c,
+ snmplib/snmp_parse_args.c, snmplib/system.c, snmplib/system.h:
+
+ - changes to avoid namespace clash problems with setenv() which are
+ caused by libwrap supplying a function of that name as well as us.
+
+ - all calls in the code to setenv() are replaced with a call to
+ snmp_setenv().
+
+ - snmp_setenv() calls setenv() if such a function exists, otherwise
+ it simulates the effect by calling putenv().
+
+2002-02-20 05:43 jbpn
+
+ * NEWS:
+
+ - mention tcp_wrappers support for snmptrapd
+
+2002-02-20 05:41 jbpn
+
+ * apps/: Makefile.in, snmptrapd.c:
+
+ - add libwrap support for snmptrapd
+
+2002-02-20 05:20 jbpn
+
+ * configure, configure.in:
+
+ - exit with an error if --with-libwrap is given and we can't find it
+
+2002-02-20 03:00 jbpn
+
+ * apps/snmpdelta.c:
+
+ - initialise some buffers, to avoid garbage printing problems, as
+ noted by Anonymous in bug #520220.
+
+2002-02-19 06:47 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ Patch from Jeroen Ruigrok to merge a few ifdefs
+
+2002-02-19 01:51 jbpn
+
+ * agent/auto_nlist.h:
+
+ - add forward declaration of struct nlist to avoid compiler
+ complaints. Thanks to Andy Hood.
+
+2002-02-18 08:17 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory.c:
+
+ patch from Jeroen Ruigrok for minor ifdef clean ups
+
+2002-02-18 02:36 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - use calloc instead of malloc to make sure buffer is initially
+ zero-terminated (in case of 0 varbinds). Bug #518700, noted by
+ Andreas Hartmann.
+
+2002-02-18 02:29 dts12
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Remove a couple of unhelpful OSF definitions (thanks to Jeroen Ruigrok)
+
+2002-02-18 02:09 jbpn
+
+ * agent/mibgroup/: notification/snmpNotifyTable.c,
+ target/snmpTargetAddrEntry.c:
+
+ - remove troublesome inline qualifiers. Thanks to Andy Hood for
+ noting that these cause problems on AIX.
+
+2002-02-18 02:05 jbpn
+
+ * agent/mibgroup/mibII/at.c:
+
+ - remove //-style comments. Thanks to Andy Hood for pointing this
+ out.
+
+2002-02-18 00:13 hardaker
+
+ * snmplib/asn1.c:
+
+ don't build oid's with >128 length subids. (see bug #518855)
+
+2002-02-15 22:07 hardaker
+
+ * FAQ, README, sedscript.in, version.h, perl/SNMP/SNMP.pm:
+
+ - (version.h sedscript.in): version tag ( 4.2.4.pre1 )
+
+2002-02-15 17:02 hardaker
+
+ * agent/mibgroup/snmpv3/usmUser.c:
+
+ fix bug#508126 which actually led me to another.
+ - oid parsing and searching in getnexts could sometimes loop.
+
+2002-02-15 17:00 hardaker
+
+ * Makefile.top, configure, configure.in:
+
+ support --disable-shared-version concept from Paul Rasmussen.
+
+2002-02-15 16:41 hardaker
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ dynix broke linux. Bad dynix. No bone. Go to your room.
+
+2002-02-15 16:28 hardaker
+
+ * snmplib/ucd-snmp-includes.h:
+
+ add back in netinet/in.h and sys/time.h (in proper protected form)
+ which was deleted from 4.2.3 for some reason we never figured out.
+
+2002-02-15 16:21 hardaker
+
+ * ChangeLog, FAQ, NEWS, README:
+
+ updates for what will be 4.2.4
+
+2002-02-15 15:52 hardaker
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ check end of mibview conditions
+
+2002-02-15 08:01 dts12
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Populate an empty case statement (spotted by Jeroen Ruigrok)
+
+2002-02-15 07:11 hardaker
+
+ * README.snmpv3:
+
+ remove unneeded -CN and -CO example options
+
+2002-02-15 06:47 dts12
+
+ * agent/snmpd.c, snmplib/winservice.c, snmplib/winservice.h,
+ snmplib/winservice.rc, win32/snmpd/snmpd.dsp:
+
+ Support for running as a Windows service.
+ (Supplied by Raju Krishnappa & Latha Prabhu)
+
+2002-02-14 11:11 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ Make buffer pointer static so it doesn't leak
+
+2002-02-14 11:10 nba
+
+ * snmplib/scapi.h:
+
+ Fix bad paranthesis
+
+2002-02-14 07:40 hardaker
+
+ * agent/snmpd.c:
+
+ fix email address bug #517178
+
+2002-02-14 01:47 dts12
+
+ * apps/snmpnetstat/if.c:
+
+ Check for running off the end of I/F table (patch from RedHat)
+
+2002-02-14 01:44 dts12
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ Include RedHat patches for better RPM support
+
+2002-02-14 01:38 dts12
+
+ * config.h.in, configure, configure.in:
+
+ Adopt RedHat's configure testing for rpm library requirements
+
+2002-02-13 16:41 hardaker
+
+ * configure, configure.in:
+
+ enable shared by default except for developers
+
+2002-02-13 13:51 hardaker
+
+ * agent/mibgroup/target/snmpTargetAddrEntry.c:
+
+ remove inline function from being declared in another function.
+
+2002-02-13 13:27 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ remove inline function from being declared in another function.
+
+2002-02-13 08:18 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ fix sets of unsigned32's.
+
+2002-02-13 07:59 dts12
+
+ * snmplib/mib.c:
+
+ DS_LIB_PRINT_SUFFIX_ONLY is an integer option, not a boolean flag.
+ (Attempting to set this via the SUFFIX environmental variable will
+ turn on packet dumping instead!)
+
+2002-02-13 04:15 jbpn
+
+ * agent/mibgroup/host/hr_print.c:
+
+ - fix bug #516904 (snmpd dies if no printcap with cgetent), noted by
+ Anonymous -- check return value of cgetnext() properly in
+ Init_HR_Print().
+
+2002-02-12 07:11 jbpn
+
+ * configure.in, configure:
+
+ - amend fix to bug #516389 (ucd-snmp 4.2.3 libwrap support broken) to
+ actually add -lnsl to link parameters!
+
+2002-02-12 05:29 jbpn
+
+ * configure, configure.in:
+
+ - fix bug #516389 (ucd-snmp 4.2.3 libwrap support broken) -- USE_LIBWRAP
+ was not being #defined in the case where -lnsl is needed in addition
+ to -lwrap.
+
+2002-02-12 01:30 dts12
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ Implement the BadCommunity{Names,Uses} counters.
+
+2002-02-11 10:07 jbpn
+
+ * apps/snmptable.c:
+
+ - fix bugs #489336 and #508146 (duplicate columns and columns in
+ wrong order).
+
+2002-02-11 08:23 dts12
+
+ * snmplib/snmp_parse_args.c:
+
+ Use the 'ds_set_xxx' library routines, rather than the old 'snmp_set_xxx' calls
+
+2002-02-11 05:30 jbpn
+
+ * FAQ:
+
+ - mention HPUX-11 and Dynix/PTX 4.4 support, and some spelling fixes
+
+2002-02-08 06:12 dts12
+
+ * agent/mibgroup/mibII/sysORTable.h:
+
+ Ensure the null versions of the two REGISTER macros swallow their parameters.
+
+2002-02-08 04:42 dts12
+
+ * agent/snmp_agent.c:
+
+ Implement the missing outgoing error statistics counters
+ (patch #510194 from Latha Prabhu)
+
+2002-02-08 02:54 dts12
+
+ * agent/snmp_agent.c:
+
+ Process the full list objects in each pass of a SET, even if one entry fails
+ midway through. This is less efficient than failing immediately, but brings
+ the behaviour in line with the documentation, and ensures that all resources
+ will be released.
+
+2002-02-08 02:50 dts12
+
+ * agent/snmp_agent.c:
+
+ Return the correct error index for problems in SET handling.
+ (patch #467155, from Latha Prabhu)
+
+2002-02-08 02:42 dts12
+
+ * agent/mibgroup/: host/hr_storage.c, ucd-snmp/memory.c:
+
+ Added support for memory and swap entries in hrStorageTable for Solaris
+ (from patch #505498 - thanks to Johannes Schmidt-Fischer)
+
+2002-02-08 02:09 dts12
+
+ * agent/mibgroup/mibII/ip.c:
+
+ Register IP Routing table objects as writable.
+
+2002-02-07 07:39 dts12
+
+ * README.hpux11, acconfig.h, config.h.in,
+ agent/mibgroup/ucd_snmp.h, agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/host/hr_swinst.c,
+ agent/mibgroup/host/hr_swrun.c, agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/icmp.c, agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/mibII/interfaces.h, agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/ipAddr.c, agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/tcpTable.c, agent/mibgroup/mibII/tcpTable.h,
+ agent/mibgroup/mibII/udp.c, agent/mibgroup/mibII/udpTable.c,
+ agent/mibgroup/mibII/var_route.c, agent/mibgroup/mibII/var_route.h,
+ agent/mibgroup/ucd-snmp/memory.c, mibs/UCD-SNMP-MIB.txt, s/hpux.h:
+
+ Support for HP-UX 11, courtesy of Johannes Schmidt-Fischer.
+
+2002-02-05 11:45 hardaker
+
+ * COPYING:
+
+ copyright year update for NAI and Cambridge
+
+2002-02-04 03:17 jbpn
+
+ * snmplib/mib.c:
+
+ - correct processing for timeticks when DS_LIB_NUMERIC_TIMETICKS is
+ set (corrects bug #511793, reported by Anonymous).
+
+2002-01-28 12:50 hardaker
+
+ * FAQ:
+
+ mirror section update
+
+2002-01-28 12:49 hardaker
+
+ * agent/agent_trap.h:
+
+ warning added about send_trap_vars and enterprise oid used.
+
+2002-01-25 06:27 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - fix minor problem with storageType (always okay to set to current
+ value).
+
+ - don't reset some variables to old value unless we actually set
+ them in the first place!
+
+2002-01-24 06:06 jbpn
+
+ * snmplib/read_config.c:
+
+ - avoid format string nasties in read_config_store() when writing to
+ files (exposed e.g. by the persistent sysName.0 stuff -- try
+ snmpset host sysName.0 s "%08x" -- oops)
+
+2002-01-24 03:14 dts12
+
+ * agent/mibgroup/host/hr_swrun.c, agent/mibgroup/host/hr_utils.c,
+ s/aix.h:
+
+ AIX support for Host Resources module.
+ (Thanks to Andy Hood)
+
+2002-01-23 08:39 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - set viewType to the DEFVAL included(1) for new rows
+
+2002-01-22 06:36 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c:
+
+ - fix bug just introduced where setting an existing row's status to
+ createAndGo(4) or createAndWait(5) would delete the row.
+
+2002-01-22 04:22 jbpn
+
+ * agent/mibgroup/: notification/snmpNotifyTable.c,
+ target/snmpTargetAddrEntry.c, target/snmpTargetAddrEntry.h,
+ target/snmpTargetParamsEntry.c, target/snmpTargetParamsEntry.h:
+
+ - backport of recent improvements to snmpTargetParamsTable,
+ snmpTargetAddrTable and snmpNotifyTable.
+
+2002-01-21 04:22 jbpn
+
+ * agent/snmp_vars.c:
+
+ - set noSuchObject to FALSE if we have a valid write_method (this
+ causes the correct exception noSuchInstance to be generated if the
+ requested object doesn't exist).
+
+2002-01-21 04:20 jbpn
+
+ * agent/snmp_agent.c:
+
+ - slight change to generation of error-index:
+
+ - explicitly test for error-status == noError, and set error-index
+ to zero in this case;
+
+ - otherwise use the cached value;
+
+ - don't zero the cached value in handle_var_list if handle_one_var
+ returns noError
+
+ - this copes properly with SET requests, where a failing SET will have
+ a FREE phase which will typically return noError. Previously this
+ would erroneously cause the error-index to be set to zero.
+
+2002-01-21 04:11 jbpn
+
+ * agent/mibgroup/mibII/vacm_vars.c, snmplib/vacm.c, snmplib/vacm.h:
+
+ - backport of recent vacmSecurityToGroupTable, vacmAccessTable and
+ vacmViewTreeFamilyTable changes (corrected state machines).
+ Before: passed 20, failed 80, untested 11
+ After: passed 107, failed 1, untested 3
+
+ The still-extant failures are due to the non-implemented
+ vacmContextTable.
+
+2002-01-15 12:44 nba
+
+ * agent/snmp_vars.c:
+
+ Fix stupid missing sizeof(oid) factor in memcpy
+
+2002-01-15 12:42 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat.c:
+
+ Dont use static buffer when reading /proc/stat
+
+2002-01-15 12:41 nba
+
+ * agent/mibgroup/host/hr_system.c, s/solaris2.6.h, s/solaris2.7.h,
+ s/solaris2.8.h:
+
+ Fix hrMaxProcesses for Solaris
+
+2002-01-15 12:39 nba
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Some additional debug statements
+
+2002-01-09 08:27 nba
+
+ * agent/mibgroup/: kernel_sunos5.c, kernel_sunos5.h:
+
+ Add function to acces raw kstat data
+
+2002-01-09 08:26 nba
+
+ * agent/mibgroup/host/hr_storage.c:
+
+ Use that sysconf returns a long, to save large phys mem
+
+2002-01-09 08:24 nba
+
+ * mibs/IANAifType-MIB.txt:
+
+ Update to current IANA version
+
+2002-01-09 08:23 nba
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Care for Linux drivers that maintain octet couters as log long values
+
+2002-01-09 02:20 jbpn
+
+ * FAQ:
+
+ - add OS X to list of supported OSes, to fix bug #501179 (!)
+
+2002-01-03 14:01 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ fix bug #498809 (I think) by checking setmntent return value.
+
+2002-01-03 13:52 hardaker
+
+ * apps/snmpnetstat/if.c:
+
+ check against growing server returns as pointed out by bug #498956
+
+2001-12-18 08:49 jbpn
+
+ * acconfig.h, win32/config.h, win32/config.h.borland:
+
+ - add OSTYPE define for win32
+
+2001-12-18 08:44 jbpn
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ - add OBJECT IDENTIFIER for win32 agent
+
+2001-12-18 06:50 jbpn
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ - patch from Latha Prabhu to produce more meaningful sysDescr.0
+ strings for Microsoft platforms.
+
+2001-12-05 07:48 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ patch from Jason Gloudon to fix leaking session structures from snmp_timeout().
+
+2001-12-03 14:52 nba
+
+ * acconfig.h, config.h.in, configure, configure.in:
+
+ Complete the BSD IPSTATS configure tests, as pointed out by Mark Moraes
+ (bug# 487708)
+
+2001-11-29 16:54 hardaker
+
+ * ChangeLog:
+
+ 4.2.3 changes
+
+-------------------------------------------------------------------------------
+
+Changes: V4.2.2 -> V4.2.3
+
+2001-11-29 14:22 hardaker
+
+ * FAQ, README, sedscript.in, version.h, perl/SNMP/SNMP.pm:
+
+ - (version.h sedscript.in): version tag ( 4.2.3 )
+
+2001-11-29 13:25 nba
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Solaris 8 renamed the kstat ifspeed attribute to ifSpeed and somewhere
+ along the line changed its value from Mbps tp bps
+
+2001-11-28 14:43 hardaker
+
+ * NEWS:
+
+ mention improved irix support.
+
+2001-11-28 14:31 hardaker
+
+ * s/irix.h:
+
+ last fixes for irix I think
+
+2001-11-28 14:30 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ create islands in the stream
+
+2001-11-28 14:09 hardaker
+
+ * s/irix.h:
+
+ irix fixes for broken irix headers
+
+2001-11-27 17:05 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ version stamp (4.2.3.pre1 (opps))
+
+2001-11-27 17:05 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ fix for version stamping the perl module.
+
+2001-11-27 17:03 hardaker
+
+ * NEWS:
+
+ update for 4.2.3
+
+2001-11-27 11:09 hardaker
+
+ * win32/win32.dsw:
+
+ use at own risk patch from Harrie to fix dependancies
+
+2001-11-27 06:53 jbpn
+
+ * agent/mibgroup/host/hr_system.c:
+
+ - try harder to get hrSystemMaxProcesses.0 right, drawing on patch
+ #485765, submitted by Johannes Schmidt-Fischer, for Linux, and
+ also using sysctl() more widely.
+
+2001-11-27 06:51 jbpn
+
+ * configure.in, s/linux.h:
+
+ - Look for <linux/tasks.h>, in order to give a better value for
+ hrSystemMaxProcesses.0. From patch #485765, submitted by
+ Johannes Schmidt-Fischer.
+
+2001-11-27 03:56 jbpn
+
+ * agent/mibgroup/mibII/: kernel_linux.c, kernel_linux.h, tcp.c:
+
+ - give correct values for tcpInErrs.0 and tcpOutRsts.0 under Linux
+ if the kernel makes the data available. From patch #485765,
+ submitted by Johannes Schmidt-Fischer.
+
+2001-11-26 09:51 jbpn
+
+ * testing/tests/T110agentxget:
+
+ - longer timeout for initial GET (fix spurious test failures)
+
+2001-11-21 10:49 hardaker
+
+ * FAQ:
+
+ help update to remove the support database
+
+2001-11-21 04:53 jbpn
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ - fix compilation for Ultrix 4.5 (bug # 415197) -- make sure
+ vfs.f_bsize exists in var_extensible_disk(), and default it to
+ 1024.
+
+2001-11-20 02:27 jbpn
+
+ * snmplib/snmp_api.h:
+
+ - remove duplicate definition of SNMP_MAX_SEC_NAME_SIZE, noted by
+ Karl M. Hegbloom.
+
+2001-11-19 05:48 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - documentation of ignoredisk directive.
+
+2001-11-19 05:48 jbpn
+
+ * agent/mibgroup/host/: hr_disk.c, hr_disk.h, hr_partition.c,
+ hr_partition.h:
+
+ - patch from Johannes Schmidt-Fischer to add directive "ignoredisk" to
+ skip certain devices (and hence avoid the `snmpwalk times out' type
+ problems frequently reported). Also extends search ranges to cope with
+ larger numbers of disks etc.
+
+2001-11-16 05:31 jbpn
+
+ * apps/snmptest.c:
+
+ - add support for Unsigned32/Gauge32 types
+
+2001-11-16 03:21 jbpn
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ - more const-ness in qsort_compare => fewer warnings
+
+2001-11-16 02:54 jbpn
+
+ * apps/snmpnetstat/if.c:
+
+ - patch from Harrie Hazewinkel to add prototypes for timerSet() and
+ timerPause().
+
+2001-11-16 02:52 jbpn
+
+ * agent/snmpd.c:
+
+ - patch from Harrie Hazewinkel to #include <grp.h> if we have it
+
+2001-11-16 02:47 jbpn
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ - patch from Harrie Hazewinkel to return a value from
+ notifyTable_unregister_notifications() to avoid warnings
+
+2001-11-16 02:45 jbpn
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ - patch from Harrie Hazewinkel to make signature of qsort_compare
+ function match that expected by qsort(3) -- adds const to args.
+
+2001-11-16 02:40 jbpn
+
+ * snmplib/mib.c:
+
+ - patch from Harrie Hazewinkel to make definition of print_tree_node
+ static to match forward declaration.
+
+2001-11-15 10:03 jbpn
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ - stricter test for null OIDs
+
+2001-11-15 09:24 jbpn
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ - fix bad-looking expression which was causing problems described in
+ email titled "Defect report on UCD SNMP toolkit (crash in
+ kernel_sunos5.c)" sent to net-snmp-users on 2001-07-17.
+
+2001-11-15 08:33 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - document read-only nature of snmpEnableAuthenTraps.0 if value is
+ configured via the authtrapenable token
+
+2001-11-15 08:28 jbpn
+
+ * agent/: agent_read_config.c, agent_trap.c,
+ mibgroup/mibII/snmp_mib.c:
+
+ - make value of snmpEnableAuthenTraps.0 persistent. Setting via
+ a read-only configuration file also makes object notWritable (as
+ sysContact.0 et al.).
+
+2001-11-15 05:16 jbpn
+
+ * testing/tests/: T111agentxset, T121proxyset:
+
+ - use psyscontact not syscontact to set initial value of sysContact.0
+ object since the latter also makes the object read-only.
+
+2001-11-15 05:07 jbpn
+
+ * agent/snmpd.c:
+
+ - minor fix to formatting of usage message
+
+2001-11-14 17:54 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.3.pre1 )
+
+2001-11-14 17:42 hardaker
+
+ * snmplib/snmp.h:
+
+ numeric comments in both hex and decimal
+
+2001-11-14 17:41 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ include INTEGER32 in INTEGER case checking.
+
+2001-11-14 17:31 hardaker
+
+ * agent/mibgroup/versiontag:
+
+ version tag perl/SNMP/SNMP.pm with the ucd-snmp version number.
+
+2001-11-14 16:30 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ mention snmpconf.
+
+2001-11-14 16:06 hardaker
+
+ * configure, configure.in:
+
+ patch from Harrie to fix init function checking in modules
+
+2001-11-14 11:58 hardaker
+
+ * agent/: agent_callbacks.h, agent_read_config.c,
+ mibgroup/notification/snmpNotifyTable.c:
+
+ - make a new callback for pre-update-config conditions.
+ - make the snmpNotifyTable make use of it to remove "readOnly" entries
+ which should have been generated via configuration parsing.
+ - note that this doesn't remove the generated target entries, which
+ is not ideal, but at least duplicate traps aren't sent.
+
+2001-11-13 11:13 hardaker
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Patch from Jochen Kmietsch to look for eri interfaces.
+
+2001-11-13 05:24 jbpn
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ - patch from Jochen Kmietsch to quieten some noisy logging
+
+2001-11-12 23:14 hardaker
+
+ * snmplib/: asn1.c, mib.c:
+
+ MS C++ warning fixes from Harrie Hazewinkel
+
+2001-11-11 21:48 nba
+
+ * snmplib/system.c, win32/config.h:
+
+ Restore the old value od TIME_WITH_SYS_TIME
+
+2001-11-09 12:21 hardaker
+
+ * FAQ:
+
+ Added a germany based mirror
+
+2001-11-09 11:21 hardaker
+
+ * FAQ:
+
+ mention new mirror
+
+2001-11-09 11:20 hardaker
+
+ * configure, config.h.in, configure.in:
+
+ applied english/typo/changes noted in bug #471179
+
+2001-11-09 09:08 hardaker
+
+ * snmplib/snmp_api.c:
+
+ fix bug 479365: use strncpy in snmp_add_var().
+
+2001-11-09 07:53 hardaker
+
+ * win32/config.h:
+
+ fix bug #474488: add extern C wrappers
+
+2001-11-09 07:47 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ fix OIDs to include entry node
+
+2001-11-08 09:43 hardaker
+
+ * mibs/UCD-SNMP-MIB.txt:
+
+ UNIT specs for the fileTable to say kB explicitly
+
+2001-11-08 09:42 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ mention that the fileTable is in kB.
+
+2001-11-06 08:26 hardaker
+
+ * local/: mib2c, tkmib:
+
+ add fixes to check for the SNMP and Tk perl modules and print a better
+ error message if they're not available telling users how to get them.
+
+2001-11-06 08:16 hardaker
+
+ * snmplib/asn1.c:
+
+ fix asn_build_bitstring to check for NULL values (pointed out by Tata Kalyan).
+
+2001-11-06 07:57 hardaker
+
+ * snmplib/asn1.c:
+
+ length check fixed for wrapped addition. Bug pointed out by Tata Kalyan
+
+2001-10-30 21:42 hardaker
+
+ * snmplib/: default_store.h, read_config.c, read_config.h:
+
+ patch from Harrie to make paths more configurable from within C code.
+
+2001-10-30 07:14 jbpn
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ - fix bug whereby interface counter is not reset, noted by (amongst
+ others) Victor Kirhenshtein in patch #474064.
+
+2001-10-26 09:08 hardaker
+
+ * configure, configure.in:
+
+ patch from Harrie to fix agentx/client -> agentx/subagent help message
+
+2001-10-26 03:34 jbpn
+
+ * man/snmpd.conf.5.def:
+
+ - document the fact that setting sysLocation.0 (et al.) via a
+ syslocation (or equivalent) token makes the object read-only,
+ returning a notWritable error response if an attempt is made to
+ SET it.
+
+2001-10-24 10:08 jbpn
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ - fix typo noted by Tim Dietz
+
+2001-10-24 09:54 jbpn
+
+ * agent/mibgroup/mibII/: system_mib.c, system_mib.h:
+
+ - implement persistence for sysLocation.0, sysContact.0 and sysName.0
+
+ - presence of a syslocation token in snmpd.conf makes sysLocation.0
+ non-writable (returns notWritable on SET attempts)
+
+2001-10-24 05:08 jbpn
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ - fix small memory leak just introduced
+
+2001-10-24 03:33 jbpn
+
+ * acconfig.h, configure.in:
+
+ - autoconf support for detecting pkginfo interface in libadm. Thanks
+ to Stefan Radman (patch #473669).
+
+2001-10-24 03:30 jbpn
+
+ * agent/mibgroup/host/hr_swinst.c:
+
+ - use pkginfo interface to determine type of software package more
+ specifically if possible. Slight variation on patch #473669, submitted
+ by Stefan Radman.
+
+2001-10-17 07:52 dts12
+
+ * FAQ:
+
+ Mention the MRTG tutorial web pages
+ (as suggested by Christian Robottom Reis)
+
+2001-10-08 10:56 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.2 )
+
+-------------------------------------------------------------------------------
+
+Changes: V4.2.1 -> V4.2.2
+
+2001-10-08 10:47 hardaker
+
+ * agent/mibgroup/notification/: snmpNotifyFilterProfileTable.c,
+ snmpNotifyFilterTable.c, snmpNotifyTable.c:
+
+ Apply patches suggested in bug #469082 to fix illegal row creations
+ when rowstatus is set to destroy.
+
+2001-10-06 07:49 hardaker
+
+ * FAQ:
+
+ minor tweaks to the download list.
+
+2001-10-06 07:42 hardaker
+
+ * README:
+
+ Add David Lawrence's text about contributing patches.
+
+2001-10-05 18:09 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.2.pre6 )
+
+2001-10-05 18:01 hardaker
+
+ * acconfig.h, config.h.in, configure, configure.in,
+ snmplib/mt_support.c, snmplib/mt_support.h:
+
+ Change _REENTRANT define to NS_REENTRANT to not conflict with BSD/OS 4.3.
+
+2001-10-05 17:39 hardaker
+
+ * agent/mibgroup/mibII/at.h, agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c, s/irix.h:
+
+ irix specific fixes mentioned in bug #405454
+
+2001-10-05 17:22 hardaker
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ fix #440808 possibly overwriting a oid buffer.
+
+2001-10-05 16:59 hardaker
+
+ * local/mib2c.vartypes.conf:
+
+ fix unsigned32 return variable usage
+
+2001-10-05 16:51 hardaker
+
+ * agent/mibgroup/mibII/at.c:
+
+ move arptab_current and arptab_size definitions up out of ifdef mess.
+
+2001-10-05 16:47 hardaker
+
+ * agent/mibgroup/notification/: snmpNotifyFilterProfileTable.c,
+ snmpNotifyFilterTable.c, snmpNotifyTable.c:
+
+ don't create rowstatus entries with 'destroy' as initial value.
+
+2001-10-05 16:36 hardaker
+
+ * agent/mibgroup/notification/: snmpNotifyFilterProfileTable.c,
+ snmpNotifyFilterTable.c, snmpNotifyTable.c:
+
+ fixed UNDO clauses.
+
+2001-10-05 08:50 hardaker
+
+ * agent/mibgroup/ucd-snmp/dlmod.c, snmplib/snmp_api.c:
+
+ Patch from Harrie for picky compilers.
+
+2001-10-05 08:49 hardaker
+
+ * agent/agent_trap.c:
+
+ better error description for trapsess
+
+2001-10-05 08:49 hardaker
+
+ * FAQ:
+
+ Added mirror sites.
+
+2001-10-05 07:10 hardaker
+
+ * mibs/: SMUX-MIB.txt, UCD-SNMP-MIB.txt:
+
+ MIB problems pointed out by Marek Malowidziki
+
+2001-10-04 17:09 hardaker
+
+ * snmplib/snmp_auth.c:
+
+ Don't write a null past the end of the community string buffer.
+
+2001-10-04 07:14 hardaker
+
+ * README, local/snmpconf.dir/snmpd.conf/extending,
+ man/snmpd.conf.5.def:
+
+ Patch from T. J. Mather: Documentation of the pass_persist snmpd.conf token.
+
+2001-10-04 07:14 hardaker
+
+ * local/pass_persisttest:
+
+ Patch from T. J. Mather: An example (perl) pass_persist script.
+
+2001-10-04 02:21 jbpn
+
+ * agent/snmpd.c:
+
+ - disable stderr logging (if requested) before calling init_mib_modules().
+ This should fix the problem noted by Nigel Metheringham in bug #418857
+ whereby the AgentX master module prints a message to stderr which causes
+ a SIGPIPE when the agent is started as a daemon.
+
+ Also noted with extensive analysis by Ted Rule in bug #467551.
+
+2001-10-03 11:22 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.2.pre5 )
+
+2001-10-03 11:16 hardaker
+
+ * apps/snmptrapd.c, apps/snmptrapd_log.c, snmplib/mib.c,
+ snmplib/tools.c:
+
+ proper const casting in front of Markku's casting patch.
+
+2001-10-03 11:10 hardaker
+
+ * apps/snmptrapd.c, apps/snmptrapd_log.c, snmplib/asn1.c,
+ snmplib/mib.c, snmplib/tools.c:
+
+ Patch: proper casts for picky compilers from Markku Laukkanen.
+
+2001-10-03 09:22 hardaker
+
+ * snmplib/snmp_api.c:
+
+ don't rbuild beyond the end of a buffer (needed buffer + length "- 1").
+
+2001-10-03 05:38 jbpn
+
+ * snmplib/keytools.c:
+
+ - change expression at l. 415 from:
+
+ *kcstring++ = *kcstring ^ *newkey++;
+
+ which has undefined behaviour to:
+
+ *kcstring++ ^= *newkey++;
+
+ which is okay (since *kcstring is only evaluated once). Similarly
+ at l. 530. The previous constructs cause warnings with GCC3 and
+ some other compilers. Thanks to Niel Markwick who noted this in
+ bug #465969.
+
+2001-10-02 18:01 hardaker
+
+ * agent/agent_trap.c:
+
+ Change oid lengths to size_t from int (segfaults on an alpha/linux).
+
+2001-10-02 17:46 hardaker
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.c:
+
+ Add prototype for getTotalSwap().
+
+2001-10-02 17:15 hardaker
+
+ * agent/mibgroup/target/: snmpTargetAddrEntry.c,
+ snmpTargetParamsEntry.c:
+
+ return NOT_WRITABLE instead of READONLY as pointed out by
+ arajesh@india.adventnet.com.
+
+2001-10-02 17:03 hardaker
+
+ * win32/config.h:
+
+ Patch from Marc Moeller to define snprintf as _snprintf
+
+2001-10-02 17:02 hardaker
+
+ * agent/mibgroup/host/hr_print.c:
+
+ Patch from Marc Moeller to check for HAVE_LPSTAT before calling it.
+
+2001-10-02 17:00 hardaker
+
+ * README:
+
+ add Ron.
+
+2001-10-02 17:00 hardaker
+
+ * snmplib/system.c:
+
+ get_uptime() implementation for windows from Ron Mevissen.
+
+2001-10-01 17:38 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.2.pre4 )
+
+2001-10-01 17:38 hardaker
+
+ * agent/Makefile.in, agent/mibgroup/Makefile.in, apps/Makefile.in,
+ apps/snmpnetstat/Makefile.in, snmplib/Makefile.in,
+ testing/Makefile.in:
+
+ make makefileindepend
+
+2001-10-01 17:37 hardaker
+
+ * makefileindepend.pl:
+
+ translate .o -> .lo by hand.
+
+2001-10-01 17:07 hardaker
+
+ * agent/mibgroup/host/: hr_disk.c, hr_print.c:
+
+ Applied patch #465545 to fix delays in host resources mib when looking
+ at devices and printers.
+
+2001-10-01 16:45 hardaker
+
+ * ChangeLog, NEWS:
+
+ New stuff in 4.2.2
+
+2001-10-01 16:39 hardaker
+
+ * apps/snmpwalk.c, man/snmpwalk.1:
+
+ make snmpwalk default to detecting illegal OID increases. -Cc turns
+ it off instead of on.
+
+2001-10-01 10:36 hardaker
+
+ * COPYING:
+
+ editing tweaks by John to count things properly. Wes looses the
+ ability to count beyond the number 2.
+
+2001-10-01 10:26 hardaker
+
+ * COPYING:
+
+ ditto.
+
+2001-10-01 10:22 hardaker
+
+ * COPYING:
+
+ Various copyright updates.
+
+2001-10-01 02:52 jbpn
+
+ * snmplib/scapi.c:
+
+ - add #include "snmp_logging.h" to avoid compilation problems on
+ some platforms introduced by new error messages. See:
+ <URL:http://sourceforge.net/tracker/index.php?func=detail&aid=465807&group_id=12694&atid=112694>
+
+2001-09-29 06:06 nba
+
+ * snmplib/mib.h:
+
+ Add a missing prototype for snmp_realloc_by_type
+
+2001-09-29 06:05 nba
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.h:
+
+ Fix a bad #ifdef parantheses
+
+2001-09-26 10:21 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ smux is *not* a proper delegation subagent.
+
+2001-09-25 12:46 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.2.pre3 )
+
+2001-09-25 11:51 hardaker
+
+ * snmplib/: scapi.c, scapi.h:
+
+ Better error messages when encryption support isn't available.
+
+2001-09-25 07:59 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - reinstate another space that would make the test suite fail
+
+2001-09-25 07:53 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - reinstate a missing space
+
+2001-09-25 05:43 jbpn
+
+ * apps/: snmptrapd.c, snmptrapd_log.c, snmptrapd_log.h:
+
+ - incorporate rewritten output functions from main branch to avoid
+ fixed length buffers
+
+2001-09-25 05:41 jbpn
+
+ * snmplib/scapi.c:
+
+ - use relocating buffer version of sprint functions
+
+2001-09-25 05:40 jbpn
+
+ * snmplib/: mib.c, mib.h, parse.h:
+
+ - add relocating buffer code from main branch
+
+2001-09-25 05:39 jbpn
+
+ * snmplib/: tools.c, tools.h:
+
+ - add snmp_realloc() and snmp_strcat functions which the relocating
+ buffer code uses
+
+2001-09-21 17:16 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Patch from Glenn Mansfield to fix interface counting on interfaces
+ without ip addresses.
+
+2001-09-20 12:47 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ check skip_white() return (as mentioned in patch #462201).
+
+2001-09-20 11:30 hardaker
+
+ * snmplib/mib.c:
+
+ fixed a possible buffer overflow bug in sprint_asciistring as pointed
+ out by bug #463226.
+
+2001-09-20 09:46 hardaker
+
+ * configure, configure.in:
+
+ Don't warn about missing openssl unless explicitly asked (and then error).
+
+2001-09-20 09:12 jbpn
+
+ * agent/: snmp_vars.c, mibgroup/mibII/interfaces.c:
+
+ - move headers around to fix compilation on Solaris 2.7; sys/stream.h
+ needs to be included before sys/socketvar.h for this platform.
+
+2001-09-20 09:09 jbpn
+
+ * agent/mibgroup/ucd-snmp/memory_solaris2.c:
+
+ - remove #include "system.h" which uses the type in_addr_t thereby
+ causing problems, and seems to be unnecessary anyway.
+
+2001-09-20 06:59 hardaker
+
+ * README:
+
+ Make sure Harrie's name is in the patches README as well as the mainline.
+
+2001-09-20 06:58 hardaker
+
+ * snmplib/: default_store.c, mib.c, parse.c, snmp_api.c,
+ snmp_client.c, snmp_debug.c, snmpusm.c:
+
+ Patch from Harrie Hazewinkel:
+ - proper prototypes for some functions.
+
+2001-09-19 17:19 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.2.pre2 )
+
+2001-09-19 17:01 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.2.pre1 )
+
+2001-09-19 16:59 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.2 )
+
+2001-09-18 17:22 hardaker
+
+ * man/snmpcmd.1, snmplib/mib.c, snmplib/snmp_api.c:
+
+ Undo Niels' change to allow command line options to override .conf
+ files. Right goal, wrong branch to do it in as it broke SNMPv3 among
+ other things. The initialization process is rather sensitive to
+ ordering.
+
+2001-09-18 15:08 nba
+
+ * s/darwin.h:
+
+ Fix an oversight in the Darwin patch
+
+2001-09-18 15:08 nba
+
+ * aclocal.m4, configure, configure.in:
+
+ Fix an oversight in the Darwin patches
+
+2001-09-17 09:00 nba
+
+ * s/darwin.h:
+
+ The darwin system file, which I forgot when committing the rest of
+ the darwin patch.
+
+2001-09-17 07:07 hardaker
+
+ * config.h.in:
+
+ autoheader run
+
+2001-09-17 04:13 nba
+
+ * apps/snmptrapd.c:
+
+ Fix newlines inside usage string.
+
+2001-09-16 14:56 nba
+
+ * agent/: snmpd.c, mibgroup/smux/smux.c:
+
+ Move the smux_listen_sd variable to smux.c. This way it will be in the
+ library so the linker wont be upset when you link with the agent library.
+
+2001-09-16 14:52 nba
+
+ * agent/mibgroup/ucd-snmp/memory_netbsd1.h,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c, s/openbsd.h:
+
+ Patches for OpenBSD 2.9
+
+2001-09-16 14:49 nba
+
+ * agent/mibgroup/ucd-snmp/diskio.c:
+
+ diskio support for FreeBSD4. Thanks to Yimin Ge
+
+2001-09-16 14:16 nba
+
+ * aclocal.m4, configure, configure.in, agent/agent_read_config.c,
+ agent/snmp_vars.c, agent/mibgroup/ucd_snmp.h,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/mibII/interfaces.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.c,
+ agent/mibgroup/ucd-snmp/memory_freebsd2.h,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c:
+
+ Patches to support Darwin (Mac OS/X)
+ Thanks to Tex Clayton <tex@dartware.com>
+
+2001-09-16 14:03 nba
+
+ * agent/: agent_index.c, agent_registry.c, mibgroup/mibincl.h,
+ mibgroup/util_funcs.c, mibgroup/examples/example.c,
+ mibgroup/mibII/icmp.c, mibgroup/mibII/ip.c,
+ mibgroup/mibII/ipAddr.c, mibgroup/mibII/sysORTable.c,
+ mibgroup/mibII/tcp.c, mibgroup/mibII/tcpTable.c,
+ mibgroup/mibII/udp.c, mibgroup/ucd-snmp/proxy.c:
+
+ Header rearrangements to make BSD's happy after the WIN32 patch
+
+2001-09-15 06:08 jbpn
+
+ * snmplib/asn1.c:
+
+ - add missing argument to snprintf (errpre corresponding to %s) --
+ it was missing from the patch (#452027)
+
+2001-09-14 17:29 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ - debugging compilation fixes
+
+2001-09-14 17:26 hardaker
+
+ * local/tkmib:
+
+ many needed changes from mainline merged into patches branch
+
+2001-09-14 15:24 hardaker
+
+ * snmplib/asn1.c:
+
+ Patch #452027 from Marcus Meissner:
+ security fix to make sure that long asn lengths can't be used and
+ aren't improperly cased to a signed value.
+
+2001-09-14 14:23 hardaker
+
+ * configure, configure.in:
+
+ patch #432982 from Hollis: fix --with-libwrap without a path option
+
+2001-09-14 13:58 nba
+
+ * agent/mibgroup/: kernel_sunos5.c, mibII/udpTable.c:
+
+ Solaris support for udpTable.
+ Thanks to Johannes Schmidt-Fischer <jsf@InterFace-AG.com>
+
+2001-09-14 09:53 hardaker
+
+ * snmplib/ucd-snmp-includes.h:
+
+ from patch #423466: add ability to use this file within the source tree
+
+2001-09-14 09:48 hardaker
+
+ * win32/config.h.borland:
+
+ Added config.h file for borland compilers (which differs slightly).
+ From patch #423466
+
+2001-09-14 09:28 dts12
+
+ * agent/mibgroup/mibII/: at.c, icmp.c, interfaces.c, ip.c,
+ ipAddr.c, tcp.c, tcpTable.c, udp.c, udpTable.c, var_route.c:
+
+ Mib-2 support for Windows systems.
+ *Many* thanks to Latha S, for filling this long-awaited need.
+
+2001-09-14 09:07 dts12
+
+ * agent/mibgroup/mibII/: icmp.c, ip.c, ipAddr.c, tcp.c, tcpTable.c,
+ udp.c, udpTable.c:
+
+ Move package-provided header includes ('mibincl' and 'util_funcs')
+ to after the system includes. This shouldn't affect most systems,
+ but is necessary for the Windows port.
+
+2001-09-14 08:28 dts12
+
+ * configure:
+
+ Propogate test for <netinet/ip_icmp.h> through to the bit that does the work.
+
+ (Our illustrious leader clearly has no confidence in the competance
+ of his minions. I'd take umbrage, if he wasn't right!)
+
+2001-09-14 08:01 dts12
+
+ * config.h.in, configure.in:
+
+ Add test for <netinet/ip_icmp.h>
+
+2001-09-14 07:57 dts12
+
+ * agent/mibgroup/mibII/: at.c, icmp.c, interfaces.c, ip.c,
+ ipAddr.c, route_write.c, tcp.c, tcpTable.c, udp.c, udpTable.c,
+ var_route.c:
+
+ Wrap various #includes with appropriate #if HAVE_XXX_H declarations
+ (where this has not already been done).
+
+2001-09-11 14:47 nba
+
+ * agent/mibgroup/ucd-snmp/: memory.c, memory.h, memory_freebsd2.c,
+ memory_freebsd2.h, memory_netbsd1.c, memory_netbsd1.h,
+ memory_solaris2.c, memory_solaris2.h, vmstat.c, vmstat.h,
+ vmstat_bsdi4.c, vmstat_bsdi4.h, vmstat_freebsd2.c,
+ vmstat_netbsd1.c, vmstat_solaris2.c:
+
+ Make sure that the OID defines are only in one place. No functional change.
+
+2001-09-11 14:45 nba
+
+ * agent/mibgroup/ucd-snmp/file.c:
+
+ Header reordering to allow dmalloc to work.
+
+2001-09-11 14:31 nba
+
+ * agent/mibgroup/host/hr_partition.c:
+
+ Fix a misplaces ; in a loop.
+ Thanks to Mala Ramakrishnan <mala@routescience.com>
+ and Johannes Schmidt-Fischer <jsf@InterFace-AG.com>
+
+2001-09-10 11:20 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ change interface counting to happen more frequently to detect new cards.
+ - see bug #457290
+
+2001-09-10 11:11 hardaker
+
+ * man/snmptrapd.8, apps/snmptrapd.c:
+
+ fix -P to usage it prints to stderr (bug #459372)
+
+2001-09-10 10:55 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ fix whitespace parsing bug reported it bug #457267.
+
+2001-09-10 10:46 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat_freebsd2.c:
+
+ apply freebsd specific patch from bug#455924 to fix vmstat's swap report.
+
+2001-09-10 10:11 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Use a more portable DBPRT macro.
+
+2001-09-10 09:58 hardaker
+
+ * agent/mibgroup/notification/: snmpNotifyFilterProfileTable.c,
+ snmpNotifyFilterTable.c, snmpNotifyTable.c:
+
+ Remove redundant RowStatus value checks mentioned in bug#449502
+
+2001-09-04 07:21 jbpn
+
+ * agent/snmpd.c:
+
+ - add missing break; after processing -P option, noted by Botond
+ Tarnay (see patch #458327)
+
+2001-08-31 13:19 nba
+
+ * mibs/: DISMAN-SCRIPT-MIB.txt, Makefile.mib, README.mibs, rfclist,
+ smistrip:
+
+ Update to current version of DISMAN-SCRIPT-MIB, and a few cosetic changes
+ to smistrip et al.
+
+2001-08-31 13:18 nba
+
+ * ltconfig:
+
+ Update to libtool 1.4. This ensures that make install will work for NetBSD
+
+2001-08-31 13:17 nba
+
+ * aclocal.m4, configure, ltmain.sh:
+
+ Update to libtool 1.4. This wil ensure that make install work on NetBSD
+
+2001-08-28 15:04 nba
+
+ * agent/snmpd.c:
+
+ Fix a bad fix
+
+2001-08-28 15:03 nba
+
+ * agent/: agent_read_config.h, snmp_agent.h, snmp_vars.h:
+
+ C++ bracket the installed sgent headers
+
+2001-08-28 07:35 nba
+
+ * apps/snmptrapd.c:
+
+ Fix a malformed multi-line string
+
+2001-08-28 03:05 jbpn
+
+ * agent/snmp_agent.c:
+
+ - add missing #include <tcpd.h> if using libwrap, noted by Nathan
+ Neulinger (patch #453831).
+
+2001-08-28 02:38 jbpn
+
+ * agent/snmpd.c:
+
+ - avoid use of pre-processor directives inside printf() call, which
+ is a macro in glibc, making this an undefined behaviour
+ construct (which GCC 3.0 refuses to compile). See bug #455804 for
+ further details.
+
+2001-08-27 22:15 nba
+
+ * man/: snmp_config.5.def, snmpd.conf.5.def, snmptrapd.conf.5.def:
+
+ Fix some places where actual lines started with a period.
+
+2001-08-17 15:12 nba
+
+ * man/Makefile.in:
+
+ Fix misspelled man page name (snmperror => snmp_perror)
+
+2001-08-17 15:09 nba
+
+ * mibs/: Makefile.mib, mibfetch:
+
+ IANA has moved their mibs into an iana.mib directory.
+ Fix RFC number for RMON-MIB.
+ Make "make allmaibs" extract mibs to another directory.
+
+2001-08-17 15:03 nba
+
+ * config.guess, config.sub:
+
+ Yet another update from ftp.gnu.org
+
+2001-08-17 14:09 nba
+
+ * agent/: agent_read_config.c, snmpd.c:
+
+ Add some needed error checking to the uid/gid parsing code.
+ Allow symbolic uid/gid from the command line.
+
+2001-08-17 14:07 nba
+
+ * FAQ:
+
+ Add a missing argument to the snmptrap examples.
+
+2001-08-07 14:55 nba
+
+ * apps/snmptrapd_log.c, snmplib/mib.c:
+
+ Timeticks are unsiged! Thanks to Josh Wilmes <josh-ucd@hitchhiker.org>
+
+2001-08-07 14:42 nba
+
+ * man/snmpcmd.1, snmplib/mib.c, snmplib/snmp_api.c:
+
+ Changes to allow command line arguments to override snmp.conf settings.
+
+2001-08-07 14:02 nba
+
+ * mibs/: IANAifType-MIB.txt, rfclist:
+
+ Update to current version of IANAifType-MIB.
+ Add rfc 3144 INTERFACETOPN-MIB to rfclist.
+
+2001-08-07 14:00 nba
+
+ * config.guess, config.sub:
+
+ Update to current version from ftp.gnu.org
+
+2001-08-07 13:59 nba
+
+ * apps/snmpset.c, apps/snmptranslate.c, apps/snmptrapd.c,
+ man/Makefile.in, man/snmp_api_errstring.3, man/snmp_error.3,
+ man/snmp_perror.3, man/snmp_sess_perror.3, man/snmpcmd.1,
+ man/snmptrapd.8:
+
+ A bunch of minor fixes to usage messages and manual pages.
+
+2001-08-07 13:56 nba
+
+ * apps/snmptest.c:
+
+ Fix parsing of oid values for set
+
+2001-08-07 07:09 jbpn
+
+ * agent/snmpd.c:
+
+ - fix for potential buffer overflow in logfile argument handling,
+ noted by Anonymous (bug #448243). Also use a large enough buffer
+ to handle filenames of length PATH_MAX (if possible).
+
+2001-07-26 01:40 jbpn
+
+ * apps/snmptrapd_log.c:
+
+ - initialise buffers to zero in handle_wrap_fmt, to avoid garbage in
+ display of security parameters, as noted by William Frauenhofer
+ (bug #437231).
+
+2001-07-23 10:53 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ carefully construct tmp file names.
+
+2001-07-23 10:53 hardaker
+
+ * config.h.in, configure, configure.in, agent/snmpd.c:
+
+ use setgroups when available.
+
+2001-07-11 07:34 hardaker
+
+ * agent/mibgroup/mibII/mta_sendmail.h:
+
+ add NETWORK-SERVICES-MIB to mib require list
+
+2001-07-09 11:15 hardaker
+
+ * agent/agent_trap.c:
+
+ fix trapsess parsing so as to:
+ - set the default port to 162
+ - don't free memory passed to snmp_parse_args() since
+ snmp_parse_args is broken and needs to copy memory rather than
+ just make use of it.
+
+2001-06-27 15:48 nba
+
+ * man/snmpd.conf.5.def:
+
+ Simple fix to trapsess argument list
+
+2001-06-25 08:47 hardaker
+
+ * snmplib/mib.c:
+
+ support 'mibs ""'.
+
+2001-06-22 13:07 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Allow interface snmpd.conf tokens to completely override system
+ values. [bug#426975]
+
+2001-06-22 11:38 hardaker
+
+ * local/mib2c.conf:
+
+ define ulong_ret
+
+2001-06-22 01:44 dts12
+
+ * FAQ, man/snmpd.conf.5.def:
+
+ Include a warning of the experimental nature of AgentX in the man page,
+ and update the FAQ to reflect the fuller integration of this support.
+
+2001-06-21 15:22 nba
+
+ * apps/snmpdf.c:
+
+ Eliminate long long variables
+
+2001-06-21 15:22 nba
+
+ * apps/snmptable.c:
+
+ Warn about deprecated -b -w and -i options.
+
+2001-06-21 15:15 nba
+
+ * man/: snmpd.1.def, snmpd.conf.5.def, snmpset.1, snmpwalk.1:
+
+ Update time stamps
+
+2001-06-21 15:09 nba
+
+ * man/snmptranslate.1:
+
+ Add -m and -M options to header. Update SEE ALSO to reference snmpcmd
+ and RFC 2578-80 in place of 1155
+
+2001-06-21 15:01 nba
+
+ * snmplib/parse.c:
+
+ Fix parsing of xx ...::= { yy }
+
+2001-06-21 10:25 hardaker
+
+ * agent/mibgroup/examples/example.c:
+
+ typos (IOD -> OID)
+
+2001-06-21 10:18 hardaker
+
+ * man/snmpd.conf.5.def:
+
+ - mention "master agentx"
+ - fix config file re-reading oid.
+
+2001-06-21 10:10 hardaker
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ make syscontact and syslocation accept "" strings.
+
+2001-06-21 09:34 hardaker
+
+ * apps/snmptranslate.c, man/snmptranslate.1:
+
+ - Applied arg documentation patch from David Eisner
+
+2001-06-14 23:19 nba
+
+ * man/snmptrapd.8:
+
+ Document -n option
+
+2001-06-12 15:14 nba
+
+ * snmplib/default_store.c:
+
+ Properly detect and diagnose bad boolean and integer configuration values
+
+2001-06-12 15:12 nba
+
+ * apps/: snmpdelta.c, snmpdf.c, snmpget.c, snmpgetnext.c,
+ snmpstatus.c, snmptrap.c, snmpusm.c, snmpvacm.c, snmpwalk.c:
+
+ Properly diagnose bad -C options
+
+2001-06-12 07:24 dts12
+
+ * snmplib/read_config.c:
+
+ Fix 'unregister_config_handler' to handle tags other
+ than the first in the list. (Thanks to Paul Serice).
+
+2001-06-11 15:44 nba
+
+ * apps/snmpwalk.c, man/snmpwalk.1:
+
+ Add an options (-Cc) to snmpwalk that will validate that the returned objects
+ are indeed lexicographically increasing.
+
+2001-06-11 15:43 nba
+
+ * apps/snmpset.c, man/snmpset.1, snmplib/snmp_api.c:
+
+ Allow a simpler snmpset notation when MIB data are loaded: Using '=' for
+ type type will infer it from the MIB.
+
+2001-06-11 15:39 nba
+
+ * snmplib/: mib.c, parse.c:
+
+ Fix some long standing bugs when several MIB files define the same objects
+ with different names. Hopefully the results will be consistent now.
+
+2001-06-11 12:12 nba
+
+ * apps/snmpdelta.c, snmplib/int64.c:
+
+ Another try at Counter64 problems, thanks to Jason Gloudon <snmp@gloudon.com>
+
+2001-06-11 11:52 nba
+
+ * apps/snmptrapd_log.c:
+
+ Fix for a missing 0-byte to terminate community string.
+ Thanks to "KUBOTA,Takaya" <takaya@po.ntts.co.jp>.
+
+2001-06-06 21:38 nba
+
+ * config.h.in, configure, configure.in,
+ agent/mibgroup/host/hr_system.c:
+
+ Use <utmpx.h> if available (to fix counting users for Solaris)
+
+2001-06-06 21:33 nba
+
+ * man/snmpd.1.def:
+
+ Mention -s and -P pidfile arguments
+
+2001-06-06 21:32 nba
+
+ * agent/mibgroup/smux/smux.c:
+
+ Fix sending of traps without varbinds
+
+2001-06-06 21:31 nba
+
+ * agent/mibgroup/util_funcs.c:
+
+ More meaningful arguments to setPerrorstatus (true file names)
+
+2001-05-17 12:36 nba
+
+ * snmplib/snmpv3.c:
+
+ Fix a Truly Stupid Bug thanks to Katsuhisa ABE <abekatsu@cysols.com>
+
+2001-05-04 09:45 hardaker
+
+ * apps/snmpdf.c:
+
+ Remove duplicate l from %lld printf syntax
+
+2001-05-04 07:00 hardaker
+
+ * Makefile.in:
+
+ insall mib_module_config.h
+
+2001-05-03 10:15 hardaker
+
+ * snmplib/Makefile.in:
+
+ add snmp-tc.h to install list
+
+2001-05-02 07:08 hardaker
+
+ * apps/snmptrapd.c:
+
+ Add -T flag to usage output.
+
+2001-05-01 12:53 hardaker
+
+ * agent/mibgroup/mibII/at.c:
+
+ Fix use of a -1 assigned to a u_long as a failure checking case.
+
+2001-04-23 17:08 hardaker
+
+ * local/tkmib:
+
+ fix walk problem once and for all.
+
+2001-04-17 12:29 nba
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Get data for hrSWRunPerfTable for cygwin under NT (or better)
+
+2001-04-17 11:33 nba
+
+ * config.guess, config.sub, configure, configure.in:
+
+ Update to a recent version of config.guess/config.sub. Update configure
+ to handle the new NetBSD variant that include the object format.
+
+2001-04-12 05:12 dts12
+
+ * agent/snmp_agent.c:
+
+ Better fix for bug #414855 from arajesh
+ Handles non-repeaters=0 as well, and avoids memory leaks.
+
+2001-04-11 06:01 dts12
+
+ * agent/snmp_agent.c:
+
+ Handle GetBulk requests with max-repetitions=0 properly (bug #414855)
+
+2001-04-10 09:33 hardaker
+
+ * apps/snmpdf.c:
+
+ fixed segfault when row has holes.
+
+2001-04-06 16:20 hardaker
+
+ * man/snmpcmd.1:
+
+ - Added documentotion for -Ot
+
+2001-04-06 07:32 hardaker
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ traps/informs reversed
+
+2001-04-05 09:34 slif
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ remove unused variable from snmp_oid_min_compare.
+
+2001-04-05 09:13 slif
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ Fix snmp_oid_compare and reverse encodings to deal with numbers > 2^31.
+
+2001-04-05 08:21 slif
+
+ * agent/agent_trap.c:
+
+ use malloc to decrease stack size in snmpd_parse_config_trapsess.
+
+2001-04-05 06:14 dts12
+
+ * agent/mibgroup/ucd-snmp/pass_persist.c:
+
+ Extend recent 'pass' changes to 'pass_persist'. (Thanks, Mike!)
+
+2001-04-05 02:27 dts12
+
+ * agent/mibgroup/ucd-snmp/pass.c:
+
+ Handle setting null string values via the 'pass' mechanism. (Support#406728)
+ Also handle embedded whitespace in such values.
+
+2001-04-04 14:56 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.1 )
+
+2001-04-04 14:55 hardaker
+
+ * FAQ, README:
+
+ Change wording to say 4.2 line is the last to use the ucd-snmp name.
+
+2001-04-04 14:51 hardaker
+
+ * ChangeLog:
+
+ ChangeLog
+
+-------------------------------------------------------------------------------
+
+Changes: V4.2 -> V4.2.1
+
+2001-04-04 14:04 hardaker
+
+ * agent/mibgroup/ucd-snmp/loadave.c:
+
+ fix missing variable on solaris 2.6
+
+2001-04-04 14:02 hardaker
+
+ * testing/eval_tools.sh:
+
+ use kill -TERM instead of kill -SIGTERM for portability (breaks on solaris).
+
+2001-04-04 12:39 slif
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Cleanup debug messages, build.
+
+2001-04-04 09:18 slif
+
+ * agent/mibgroup/examples/example.c:
+
+ Fix network byte order for IpAddress displayed.
+
+2001-04-04 08:50 slif
+
+ * apps/snmptrapd.c:
+
+ quiet exit on SIGTERM/SIGINT, same as snmpd.
+
+2001-04-04 08:49 hardaker
+
+ * agent/: auto_nlist.c, auto_nlist.h:
+
+ fix for auto_nlist bogus definitions for machines without nlist.
+
+2001-04-04 08:49 hardaker
+
+ * README.snmpv3:
+
+ update to when agent removes "createUser" directives.
+
+2001-04-04 08:31 hardaker
+
+ * agent/mibgroup/ucd_snmp.h:
+
+ Applied patch #412080: add freebsd5 to module include list.
+
+2001-04-04 08:12 dts12
+
+ * EXAMPLE.conf.def:
+
+ Document how to enable the AgentX facility in the master agent.
+
+2001-04-04 07:59 hardaker
+
+ * local/tkmib:
+
+ fix bug #411917: change walk end condition as suggested by submitter.
+
+2001-04-04 07:43 dts12
+
+ * snmplib/parse.c:
+
+ Change 'Line' variable name, to assist with Mac port.
+
+2001-04-04 07:42 dts12
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Fix typo in cast (missing 'struct')
+
+2001-04-04 07:37 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Use a larger malloced buffer when decoding a large incoming encrypted message.
+
+2001-04-04 07:36 hardaker
+
+ * snmplib/snmp_debug.c:
+
+ Limit size of hex messages to 1/5th buffer size (to be safe).
+
+2001-04-04 07:24 jbpn
+
+ * agent/snmpd.c:
+
+ - call external signal handlers before calling snmp_select_info(),
+ rather than after calling snmp_select_info() but before select().
+ This fixes a potential problem that could arise if a signal handler
+ closed a session, which would cause select() to return -1 with
+ EBADF, and thus terminate the agent.
+
+2001-04-04 06:50 dts12
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Ensure that checking for 'statvfs' is done consistently
+
+2001-04-04 06:48 dts12
+
+ * agent/mibgroup/mibII/system_mib.c:
+
+ ensure that 'exec_command' is used consistently with the availability of execv
+
+2001-04-04 06:45 dts12
+
+ * snmplib/: mib.c, snmp_api.c, snmp_logging.c:
+
+ Keep one of the pickier compilers (HP's aCC) happy.
+
+2001-04-03 22:07 hardaker
+
+ * snmplib/snmpusm.c:
+
+ Fix maximum encrypted packet length support for reverse encoded packets.
+
+2001-04-03 18:07 slif
+
+ * testing/tests/T120proxyget:
+
+ fix rwcommunity
+
+2001-04-03 16:44 hardaker
+
+ * local/wesrestart:
+
+ remove old unused script
+
+2001-04-03 16:41 hardaker
+
+ * local/snmpconf.dir/snmpd.conf/operation:
+
+ Add snmpconf directive support for the new "master" token.
+
+2001-04-03 16:41 hardaker
+
+ * local/snmpconf:
+
+ Fix bug in menus for configuration files containing only "groups".
+
+2001-04-03 16:40 hardaker
+
+ * README:
+
+ Change my name -> net-snmp developers.
+
+2001-04-03 15:36 hardaker
+
+ * EXAMPLE.conf.def:
+
+ mention snmpconf
+
+2001-04-03 15:28 hardaker
+
+ * README:
+
+ url changes mostly.
+
+2001-04-03 15:28 hardaker
+
+ * NEWS:
+
+ 4.2.1 update (please check).
+
+2001-04-03 15:28 hardaker
+
+ * FAQ:
+
+ ftp site update.
+
+2001-04-03 14:04 hardaker
+
+ * configure, configure.in:
+
+ Added agentx to default modules to compile in
+
+2001-04-03 10:12 hardaker
+
+ * local/mib2c:
+
+ add a comment at the end of the mib2c output explaining that its
+ merely a template.
+
+2001-04-03 08:27 hardaker
+
+ * AGENT.txt, FAQ, PORTING, README, README.agentx:
+
+ Web page/ftp site updates. Uses www.net-snmp.org everywhere now.
+
+2001-04-03 06:24 slif
+
+ * agent/mibgroup/util_funcs.c:
+
+ Fix signed/unsigned compare.
+
+2001-04-03 06:21 dts12
+
+ * agent/mibgroup/mibII/kernel_linux.c:
+
+ Plug file-descriptor leak when using cached data. (Bug#412000)
+
+2001-04-02 23:22 nba
+
+ * apps/snmptest.c:
+
+ Fix an incompletely initialized variable
+
+2001-04-02 23:21 nba
+
+ * local/snmpconf:
+
+ The answers for the "load which files" menu are kept secret from the code
+ that loads the files .... fixed.
+
+2001-04-02 20:02 hardaker
+
+ * local/: Makefile.in, snmpconf.dir/snmptrapd.conf/formatting,
+ snmpconf.dir/snmptrapd.conf/traphandle:
+
+ Added snmptrapd configuration file directives to snmpconf.
+
+2001-04-02 10:08 jbpn
+
+ * man/snmp_agent_api.3:
+
+ - update documentation of agent_check_and_process to reflect
+ current behaviour
+
+2001-04-02 09:58 jbpn
+
+ * agent/snmp_agent.c:
+
+ - Fix memory leak in handle_one_var where long varbinds weren't
+ correctly free()d.
+
+ - Change behaviour of agent_check_and_process so that alarms run
+ correctly.
+
+2001-04-02 08:51 dts12
+
+ * agent/mibgroup/agentx/master.c:
+
+ Use the 'standard' config handler registration routine,
+ and recognise the config setting 'master all'
+
+2001-04-02 06:53 nba
+
+ * man/snmpd.conf.5.def:
+
+ Fix some missing quoting on .IP parameters
+
+2001-03-30 08:05 hardaker
+
+ * FAQ, README.agentx, agent/mibgroup/agentx/README.agentx:
+
+ moved agentx README to top
+
+2001-03-30 07:22 dts12
+
+ * FAQ:
+
+ Typo in AgentX README filename
+
+2001-03-30 07:20 dts12
+
+ * agent/: ds_agent.h, snmp_agent.c, snmpd.c,
+ mibgroup/agentx/README.agentx, mibgroup/agentx/master.c,
+ mibgroup/agentx/master.h:
+
+ Provide 'master' config directive to control whether or not to
+ activate extensible subagent support.
+ Initially restricted to AgentX support only.
+
+2001-03-30 03:46 dts12
+
+ * agent/mibgroup/agentx/README.agentx:
+
+ Update to reflect the increased maturity of the AgentX implementation.
+
+2001-03-30 03:34 dts12
+
+ * FAQ:
+
+ Tweaked various entries, and added a few new ones. General Shield meddling.
+
+2001-03-30 01:00 dts12
+
+ * README:
+
+ Add prominent warning regarding ucd-snmp => net-snmp switch.
+
+2001-03-30 00:46 dts12
+
+ * snmplib/snmp_api.c:
+
+ Fix interpretation of "pure numeric" peername strings (i.e. listen on the
+ specified port on all interfaces) - problem identified by Mala Ramakrishnan.
+
+2001-03-30 00:04 nba
+
+ * snmplib/parse.c:
+
+ Replace atoi/atol with strto(u)l which has better out-of-range returns.
+ This is not a perfect solution, but it is better ...
+
+2001-03-29 21:43 hardaker
+
+ * ISSUES:
+
+ rm ISSUES
+
+2001-03-29 14:34 hardaker
+
+ * COPYING:
+
+ minor formatting.
+
+2001-03-29 14:33 hardaker
+
+ * COPYING:
+
+ Um, got the year right this time.
+
+2001-03-29 14:32 hardaker
+
+ * COPYING:
+
+ update for 2001: added my required NAI BSD copyright.
+
+2001-03-29 08:23 slif
+
+ * testing/eval_tools.sh:
+
+ merge change from main branch (return_value=1 statement).
+
+2001-03-29 08:21 slif
+
+ * win32/libsnmp_dll/libsnmp.def:
+
+ Add vacm_is_configured.
+
+2001-03-28 22:12 nba
+
+ * mibs/: rfclist, rfcmibs.diff:
+
+ Add Printer-MIB to the rfclist with the corresponding patch.
+
+2001-03-28 13:06 nba
+
+ * snmplib/snmp_client.c:
+
+ Properly ignore non-response PDU's when doing async transaction.
+
+2001-03-28 13:04 nba
+
+ * man/snmpcmd.1, snmplib/mib.c:
+
+ Fix index handling to properly accept indexing with TimeTicks.
+ Implement -Ir to disable index checks.
+
+2001-03-28 06:20 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.1.pre2 )
+
+2001-03-27 10:27 hardaker
+
+ * apps/snmptrapd.c:
+
+ Use snmp_log with %s to prevent % expansion in octet strings containing a %s.
+
+2001-03-27 05:37 dts12
+
+ * agent/: snmp_agent.c, mibgroup/agentx/master_request.c:
+
+ Handle non-responsive AgentX sub-agents more robustly.
+ (Based on suggestions from Harrie Hazewinkel & Paul Rasmussen)
+
+2001-03-27 02:35 dts12
+
+ * agent/mibgroup/smux/smux.c:
+
+ Reset count of authorized peers on closedown. (Thanks to Vlad Tunik)
+
+2001-03-26 18:03 hardaker
+
+ * agent/mibgroup/mibII/vacm_vars.c, snmplib/vacm.c, snmplib/vacm.h:
+
+ Fixed vacm to drop v1/v2c packets properly when no com2sec entries are found.
+
+2001-03-26 11:06 hardaker
+
+ * local/ipf-mod.pl:
+
+ add usage comment at top
+
+2001-03-22 14:34 nba
+
+ * mibs/rfclist:
+
+ New MIB in RFC 3083: DOCS-BPI-MIB
+
+2001-03-22 14:27 nba
+
+ * agent/mibgroup/host/hr_filesys.c, s/cygwin.h,
+ agent/mibgroup/host/hr_storage.c, agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_utils.c:
+
+ Make most of the host resources mib compile under Cygwin. We can now do
+ --with-mib-modules=host --with-out-mib-modules=host/hr_network
+
+2001-03-22 12:27 hardaker
+
+ * agent/mibgroup/util_funcs.c:
+
+ fix header_simple_table() for too long requests
+
+2001-03-22 08:13 hardaker
+
+ * apps/snmptrapd.c:
+
+ Bad Wes: find all instances of cut-n-paste errors before committing.
+
+2001-03-22 08:12 hardaker
+
+ * apps/snmptrapd.c:
+
+ Bad Wes: don't call function without the ()s. (at least in C).
+
+2001-03-22 07:46 dts12
+
+ * agent/agent_trap.c:
+
+ Fix for minor memory leak with trap-related varbind values.
+ Thanks to John Villalovos (and the Intel SNMP team)
+
+2001-03-21 17:22 driehuis
+
+ * snmplib/mib.c:
+
+ Bugfix for crash at snmp_shutdown time with OS's that check pointer
+ validity (e.g., FreeBSD)
+
+2001-03-21 08:16 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ join broken snmp_log lines
+
+2001-03-21 08:15 hardaker
+
+ * apps/snmptrapd.c:
+
+ fix -F (I think)
+
+2001-03-21 07:43 hardaker
+
+ * snmplib/snmp_api.c:
+
+ patch from Harrie to fix variable types (int -> size_t)
+
+2001-03-20 08:25 nba
+
+ * agent/mibgroup/mibII/at.c, agent/mibgroup/mibII/at.h,
+ agent/mibgroup/mibII/interfaces.c, s/linux.h:
+
+ Fix the atTable and ipNetTopMediaTable for Linux to return the ifIndex
+
+2001-03-19 13:14 nba
+
+ * apps/snmpdelta.c, man/snmpdelta.1:
+
+ Major option parsing surgery to cather for the getopt using version of
+ snmp_parse_args. Seems to have been forgotten when the rest of the apps
+ were updated.
+
+2001-03-19 13:13 nba
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Re-order sys/conf.h and sys/param.h to make FreeBSD-5 happy
+
+2001-03-15 13:44 hardaker
+
+ * agent/mibgroup/mibII/ip.c:
+
+ fixed bug #405000: dropped support for IPOUTNOROUTES, since no
+ calculation of it seems close to correct.
+
+2001-03-15 13:36 hardaker
+
+ * agent/mibgroup/mibII/udp.c:
+
+ fix part 2 of bug 405519 adding fullsock to udpinerrors
+
+2001-03-15 13:31 hardaker
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ fix bug #408388 where memmove is called with too short a length.
+
+2001-03-15 11:21 hardaker
+
+ * FAQ, README, sedscript.in, version.h:
+
+ - (version.h sedscript.in): version tag ( 4.2.1.pre1 )
+
+2001-03-15 03:34 jbpn
+
+ * testing/eval_tools.sh:
+
+ kill -SIGKILL isn't legal syntax on Solaris or Linux; changed to kill -9
+ which is likely safer
+
+ don't set return_value to 1 after killing snmpd, which causes spurious
+ test failures
+
+2001-03-14 14:38 hardaker
+
+ * agent/agent_trap.h:
+
+ Patch from Harrie Hazewinkel: make send_enterprise_trap_vars a public fn.
+
+2001-03-14 11:08 hardaker
+
+ * agent/mibgroup/mibII/at.c:
+
+ fix ipnettomedia indexing on solaris.
+
+2001-03-14 10:27 slif
+
+ * agent/mibgroup/tunnel/tunnel.c:
+
+ Use config.h, don't use ucd-snmp directory to build in the mibgroup tree.
+
+2001-03-14 10:18 slif
+
+ * testing/RUNTESTS:
+
+ quiet "which" output. never ending saga...
+
+2001-03-14 10:08 slif
+
+ * agent/mibgroup/agentx/master_request.c:
+
+ quiet unsigned long compare.
+
+2001-03-14 10:00 slif
+
+ * agent/mibgroup/agentx/client.c:
+
+ Get a decl of in_addr_t from netinet/in.h, where necessary.
+
+2001-03-14 10:00 slif
+
+ * snmplib/parse.c:
+
+ Avoid warnings of struct timeval decl in system.h by including *time.h*.
+
+2001-03-14 09:47 slif
+
+ * agent/snmpd.c, apps/snmpvacm.c, apps/snmpnetstat/winstub.c,
+ snmplib/parse.c:
+
+ patch submitted by Harrie Hazewinkel
+
+2001-03-14 09:40 slif
+
+ * testing/RUNTESTS:
+
+ don't run tests without needed programs: snmpd, snmpget, snmpgetnext.
+
+2001-03-14 08:24 slif
+
+ * configure, configure.in:
+
+ Provide an empty DLLIBS value for non-dlmod uses.
+
+2001-03-14 07:36 slif
+
+ * agent/mibgroup/agentx/protocol.c:
+
+ cast u_long to u_char when storing 8-bit values.
+
+2001-03-14 07:33 slif
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ fix unsigned length compares.
+
+2001-03-14 05:45 dts12
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Fix Linux file descriptor leak (reported by Oliver FॆआŠnger)
+
+2001-03-13 13:20 hardaker
+
+ * snmplib/default_store.c:
+
+ Patch from Harrie Hazewinkel to check for NULLs in DEBUG msg
+
+2001-03-12 14:06 nba
+
+ * agent/mibgroup/agentx/: master_admin.c, subagent.c:
+
+ Fix some minor leaks.
+
+2001-03-12 14:05 nba
+
+ * agent/snmpd.c:
+
+ Some minor fixes to argument processing, including terminating snmpd on
+ extraneous non-option arguments.
+
+2001-03-10 08:13 hardaker
+
+ * agent/mibgroup/mibII/ip.c:
+
+ Bug #404988: don't use ipstat.ips_fragtimout as a number of seconds.
+
+2001-03-07 10:26 slif
+
+ * testing/eval_tools.sh:
+
+
+ new DELAY function; start/stop daemons using new STARTPROG/STOPPROG with DELAY;
+ log commands issued and final result to SNMP_TMPDIR/invoked;
+ suppress "kill" output to help Cygwin users happy.
+
+2001-03-07 10:23 slif
+
+ * testing/RUNTESTS:
+
+
+ add -S parameter for DELAY seconds; add trap for interrupt control;
+ pass test number and display-header-only to eval_onescript.sh;
+ add which test to verbose locating messages (Cygwin uses type, not which).
+
+2001-03-07 10:20 slif
+
+ * testing/: TESTCONF.sh, eval_onescript.sh:
+
+
+
+ Incorporate test number into test results dir name.
+ Provide default values for test number and display-header-only flag.
+
+2001-03-07 10:19 slif
+
+ * testing/Makefile.in:
+
+
+
+ "make clean" removes any test result dirs "/tmp/snmp-test-*".
+
+2001-03-07 10:15 slif
+
+ * testing/tests/: T054agentv2ctrap, T056agentv2cmintrap,
+ T058agentauthtrap:
+
+
+ Replace sleep with commented out DELAY ; each start/stop action now
+ invokes DELAY.
+
+2001-03-07 10:14 slif
+
+ * testing/tests/T100agenthup:
+
+
+ Replace sleep with DELAY.
+
+2001-03-07 10:13 slif
+
+ * win32/config.h:
+
+
+
+ Change element separator to Win32 ';' in DEFAULT_MIBS
+ Declare Win32 has getpid!.
+
+2001-03-07 10:10 slif
+
+ * snmplib/snmp_api.c:
+
+
+
+ Win32 include io.h to declare mktemp.
+ Expand the comment near mktemp usage to explain why it is needed.
+
+2001-03-07 10:09 slif
+
+ * snmplib/snmp_alarm.c:
+
+
+
+ remove unnecessary ifndef WIN32. ifdef SIGALRM is sufficient.
+
+2001-03-07 10:07 slif
+
+ * agent/snmpd.c, apps/snmptrapd.c:
+
+
+
+ Win32 include process.h to declare getpid.
+
+2001-03-07 10:06 slif
+
+ * snmplib/snmp_logging.c:
+
+
+
+ Use proper define to qualify include-ing a header.
+
+2001-03-07 10:04 slif
+
+ * agent/mib_modules.c, apps/snmpnetstat/if.c, snmplib/system.h:
+
+
+
+ Apply the time goo consistently: move header includes out of system.h.
+
+2001-03-06 10:08 hardaker
+
+ * configure, configure.in:
+
+ don't force inclusion of -ldl.
+
+2001-03-05 06:30 slif
+
+ * snmplib/snmpv3.c:
+
+
+
+ Follow method usage, don't declare getHwAddress unless used.
+
+2001-03-05 06:30 slif
+
+ * snmplib/snmp_api.c:
+
+
+
+ Remove nested variable ep - one already exists.
+
+2001-03-05 06:28 slif
+
+ * agent/mibgroup/examples/ucdDemoPublic.c:
+
+
+
+ Comment out example variables that are not used.
+
+2001-03-04 17:41 slif
+
+ * README.win32, win32/config.h, win32/mib_module_config.h,
+ win32/mib_module_includes.h, win32/mib_module_inits.h,
+ win32/libsnmp_dll/libsnmp.def, win32/libucdmibs/libucdmibs.def,
+ win32/libucdmibs/libucdmibs.dsp:
+
+
+
+ patch to build more modules, including agentX, on Win32 using MS-VC.
+
+2001-03-04 17:27 slif
+
+ * agent/mibgroup/header_complex.c, agent/mibgroup/agentx/client.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/protocol.c, agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/notification/snmpNotifyFilterProfileTable.c,
+ agent/mibgroup/notification/snmpNotifyFilterTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/target/target.c, agent/mibgroup/ucd-snmp/dlmod.c,
+ agent/mibgroup/ucd-snmp/pass_persist.c,
+ agent/mibgroup/ucd-snmp/proxy.c, apps/snmptrapd_log.c:
+
+
+
+ patch to build more of the agent using MS-VC on Win32 platform.
+
+2001-03-03 14:34 nba
+
+ * mibs/: IANAifType-MIB.txt, MTA-MIB.txt, Makefile.mib,
+ README.mibs, TUNNEL-MIB.txt, ianalist, mibfetch, rfclist,
+ rfcmibs.diff, smistrip:
+
+ Update to current IANAifType-MIB, plus addition of README and tools to get
+ a complete set of IETF MIB files.
+
+2001-03-03 07:11 nba
+
+ * agent/mibgroup/agentx/master.h:
+
+ Remove an unused prototype
+
+2001-03-03 06:36 nba
+
+ * man/snmptrapd.8, apps/snmptrapd_log.c:
+
+ Add a new %P formatting sequence to user specified log formats. It print
+ the security information from the PDU (community, user, context as available)
+ Also modify the default trap output to use it.
+
+2001-03-03 06:21 nba
+
+ * apps/snmptrapd_log.c:
+
+ Fix specifiers like %.3s
+
+2001-03-03 06:10 nba
+
+ * snmplib/parse.c:
+
+ Fix the parser to diagnose oid specs like::= { single }
+ Be silent for internal links when moving nodes to the adoption list. This
+ should help giving only a single message for missing imports of enterprises.
+
+2001-03-02 13:24 slif
+
+ * snmplib/asn1.c, snmplib/mib.c, snmplib/mib.h, snmplib/snmp_api.c,
+ snmplib/snmp_parse_args.c, snmplib/snmp_parse_args.h,
+ win32/libsnmp_dll/libsnmp.def:
+
+
+
+ cleanup for MS-VC Win32 build
+
+2001-03-02 07:36 hardaker
+
+ * README:
+
+ sourcerforge -> sourceforge
+
+2001-03-02 07:25 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Patch from Karl Schilke to fix timestamps in synchonous cases
+
+2001-03-02 06:31 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Remove unused variable from snmp_oid_compare().
+
+2001-03-01 19:49 hardaker
+
+ * snmplib/: asn1.c, snmp_api.c:
+
+ Fix snmp_oid_compare and reverse encodings to deal with numbers > 2^31.
+
+2001-02-21 15:31 nba
+
+ * man/: snmp.conf.5.def, snmpcmd.1:
+
+ Fix a couple of typos
+
+2001-02-21 15:22 hardaker
+
+ * snmplib/ucd-snmp-includes.h:
+
+ Applied patch #103805 from bcollar: add sys/time.h to ucd-snmp-includes.h
+
+2001-02-21 15:15 hardaker
+
+ * snmplib/int64.c:
+
+ fix bug #133416 (u64Subtraction math) as suggested by the submittor
+
+2001-02-21 14:38 nba
+
+ * agent/mibgroup/host/hr_filesys.c:
+
+ Try fixing inconsistent indexing on BSD
+
+2001-02-19 08:46 slif
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+
+
+ - proxy.c: remove some unused variables.
+
+2001-02-16 15:12 hardaker
+
+ * agent/var_struct.h:
+
+ - increase UCD_REGISTRY_OID_MAX_LEN to 128 at Frank's request
+
+2001-02-14 18:15 hardaker
+
+ * apps/snmptrapd.c:
+
+ removed unused snmp_alarm.h include
+
+2001-02-13 16:21 hardaker
+
+ * snmplib/snmp_api.c:
+
+ fix bug #130740 using suggested close() wrapper around mkstemp()
+
+2001-02-09 11:16 hardaker
+
+ * agent/snmpd.c:
+
+ Applied patch #103613: fix memory leak in snmpd port specification -> default_store.
+
+2001-02-09 11:14 hardaker
+
+ * agent/mib_modules.c:
+
+ Applied patch #103612: fix memory leak in mib_module init code
+
+2001-02-09 11:12 hardaker
+
+ * agent/agent_registry.c:
+
+ Applied patch #103611: fix memory leak for duplicate oid registrations.
+
+2001-02-09 11:08 hardaker
+
+ * perl/SNMP/SNMP.xs:
+
+ Applied patch #103604: Add support for V1 traps and int/int32 differences
+
+2001-02-09 11:06 hardaker
+
+ * agent/mibgroup/ucd-snmp/: memory_freebsd2.c, proxy.c:
+
+ Applied patch #103702: fix swap reporting on freebsd 4.2
+
+2001-02-06 14:26 nba
+
+ * apps/snmpnetstat/Makefile.in:
+
+ Add a dependency for libsnmp
+
+2001-02-06 14:25 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat_freebsd2.c:
+
+ Implement raw interrupt and context switch counters
+
+2001-02-06 14:24 nba
+
+ * agent/mibgroup/notification/snmpNotifyTable.c:
+
+ Make dmalloc happy by fixing a malloc read overrun
+
+2001-02-06 14:16 nba
+
+ * man/snmpcmd.1, snmplib/default_store.h, snmplib/mib.c:
+
+ Backport -OT output to 4-2-patches branch
+
+2001-02-06 06:02 hardaker
+
+ * perl/SNMP/SNMP.pm:
+
+ documentation fix
+
+2001-01-31 23:02 nba
+
+ * snmplib/snmp_api.c:
+
+ Fix value validation for snmpset/snmptrap
+
+2001-01-31 23:00 nba
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ Fix bad return of a pointer to non-static storage
+
+2001-01-31 15:44 hardaker
+
+ * agent/mibgroup/host/hr_print.c:
+
+ Patch from Frank Bartels for freebsd fixes
+
+2001-01-30 17:13 hardaker
+
+ * agent/mibgroup/ucd-snmp/disk.c:
+
+ Applied patch #103414: fix disk info for block sizes other than 1024.
+
+2001-01-29 13:24 hardaker
+
+ * agent/mibgroup/smux/smux.c:
+
+ fix bug #130410: set the write_method in var_smux before returning
+ NULL to make sure that sets happen on OIDs that don't exist first.
+
+2001-01-29 13:15 hardaker
+
+ * local/mib2c:
+
+ fix suggested in bug #129948: check for - arguments at the begginning
+ of the command line token (don't match mib-2, eg).
+
+2001-01-29 13:13 hardaker
+
+ * snmplib/parse.c:
+
+ fix suggested in bug #129876: check for hint != NULL before freeing.
+
+2001-01-26 05:49 nba
+
+ * agent/mibgroup/host/hr_print.c:
+
+ Fix bug on FreeBSD when /etc/printcap is empty
+
+2001-01-25 14:38 nba
+
+ * mibs/RMON-MIB.txt:
+
+ Updated to RFC 2819
+
+2001-01-24 21:37 nba
+
+ * agent/Makefile.in:
+
+ Install libraries before agent so that libtool can relink.
+
+2001-01-20 05:54 nba
+
+ * apps/snmpdelta.c, snmplib/int64.c:
+
+ Two Counter64 glitches detected by Jason Gloudon <snmp@gloudon.com>
+
+2001-01-20 05:44 nba
+
+ * agent/snmpd.c:
+
+ Dont set up the select parameters before calling interrupt handlers!
+ Thanks to Frank Strauss.
+
+2001-01-20 05:42 nba
+
+ * snmplib/snmp_api.c:
+
+ Fix encoding of BITS variable, thanks to Frank Strauss
+
+2001-01-20 05:37 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat_solaris2.c:
+
+ Raw IO counters from Jochen Kmietsch
+
+2001-01-20 05:36 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat.h, mibs/UCD-SNMP-MIB.txt:
+
+ Prepare for more raw counters
+
+2001-01-15 15:14 nba
+
+ * agent/mibgroup/ucd-snmp/proxy.c:
+
+ undo a change that sneaked in by mistake
+
+2001-01-15 14:07 nba
+
+ * agent/mibgroup/ucd-snmp/proxy.c,
+ agent/mibgroup/ucd-snmp/vmstat.h,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c,
+ agent/mibgroup/ucd-snmp/vmstat_bsdi4.h,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c,
+ agent/mibgroup/ucd-snmp/vmstat_freebsd2.h,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c,
+ agent/mibgroup/ucd-snmp/vmstat_netbsd1.h,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.c, mibs/UCD-SNMP-MIB.txt,
+ agent/mibgroup/ucd-snmp/vmstat_solaris2.h:
+
+ Extend the systemStats.cpuRaw section to include more raw counters for various
+ operating systems. Basic testing performed for Solaris and FreeBSD. Code
+ guesstimate for NetBSD and BSDi.
+
+2001-01-12 08:00 hardaker
+
+ * snmplib/snmp_api.c:
+
+ - bit_string fixes
+ - make snmp_add_var call snmp_parse_oid() instead of read_objid().
+
+2001-01-12 07:57 hardaker
+
+ * snmplib/asn1.c:
+
+ comment out really odd (and broken) check from asn_bitstring_check???
+
+2001-01-12 07:52 hardaker
+
+ * local/: mib2c.storage.conf, mib2c.vartypes.conf:
+
+ - misc bug fixes.
+ - new data types (uint32, unsigned, bits).
+
+2001-01-10 21:55 nba
+
+ * snmplib/snmp_api.c:
+
+ Fix calling of init_callbacks even if init_snmp called with NULL parameter
+
+2001-01-10 21:53 nba
+
+ * snmplib/snmp_api.c:
+
+ Fix badly applied previous patch
+
+2001-01-10 21:52 nba
+
+ * apps/snmpvacm.c:
+
+ Fix usage message (-e is now -Ce)
+
+2001-01-10 21:51 nba
+
+ * agent/mibgroup/mibII/var_route.c:
+
+ Fix a bad ipRouteProtocol return
+
+2001-01-10 21:50 nba
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Fix problem when running --without-root-access for FreeBSD. Thanks to
+ Bert Driehuis.
+
+2001-01-10 21:48 nba
+
+ * agent/mibgroup/kernel_sunos5.c:
+
+ Use the ifspeed attribute from driver when available
+
+2001-01-09 06:29 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Applying patch found in bug #127299:
+ - switch ifAdmin and ifOperStatus meanings to match kernel parameters better.
+
+2001-01-09 06:21 hardaker
+
+ * win32/snmpnetstat/snmpnetstat.dsp:
+
+ added getopt.c to list
+
+2001-01-08 08:19 hardaker
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ Patch from Anders Ellefsrud
+ - fix hr_swrun when programs have exited so we don't truncate
+ getnext queries.
+
+2001-01-08 08:14 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Patch from Frank Strauss:
+ - fix BITS encoding length when mib knowledge is available.
+
+2001-01-04 23:18 nba
+
+ * apps/: snmpset.c, snmptrap.c:
+
+ Try fixing problems with snmpset of negative values
+
+2001-01-04 23:15 nba
+
+ * agent/mibgroup/ucd-snmp/vmstat_bsdi4.c:
+
+ Add the raw cpu couters for BSDi. Courtesy Bert Driehuis.
+
+2001-01-04 23:12 nba
+
+ * agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/ucd-snmp/loadave.c, snmplib/callback.c:
+
+ Save some unused variables
+
+2001-01-04 23:09 nba
+
+ * acconfig.h, config.h.in, agent/agent_trap.c, agent/mib_modules.c,
+ agent/mibgroup/agentx/client.c, agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/master_admin.c,
+ agent/mibgroup/agentx/master_admin.h,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/protocol.c, agent/mibgroup/agentx/subagent.c:
+
+ Add missing dmalloc support for some files
+
+2001-01-04 23:04 nba
+
+ * Makefile.in:
+
+ Ensure sort order for config.h.in
+
+2001-01-04 10:24 hardaker
+
+ * configure, configure.in:
+
+ fix semi-colon problem. Patch #103101.
+
+2001-01-03 07:01 hardaker
+
+ * agent/mibgroup/host/hr_swrun.c:
+
+ /proc/%d/cmdline may be an empty file for some processes. Return "" if so.
+
+2001-01-02 09:47 hardaker
+
+ * snmplib/snmp_logging.c:
+
+ add a "%s" formatting string to the syslog() call (redhat bug #18153).
+
+2000-12-29 13:38 hardaker
+
+ * agent/mibgroup/mibII/interfaces.c:
+
+ Patch from Ted Rule:
+ - better checking for formatting of the /proc/net/dev file to avoid
+ linux core dumps when the kernel mis-behaves.
+
+2000-12-27 16:47 hardaker
+
+ * testing/tests/: T053agentv1trap, T054agentv2ctrap,
+ T055agentv1mintrap, T056agentv2cmintrap, T113agentxtrap:
+
+ - trap API testing suite enhanced to test more cases.
+
+2000-12-27 16:45 hardaker
+
+ * agent/agent_callbacks.h, agent/agent_trap.c, agent/agent_trap.h,
+ agent/mibgroup/notification/snmpNotifyTable.c,
+ agent/mibgroup/notification/snmpNotifyTable.h, snmplib/callback.c,
+ snmplib/callback.h:
+
+ - Make the notification mib work more via callbacks and remove ifdefs in
+ agent_trap.c
+ - Make the agent_trap.c file check for callback registrations and
+ handle it internally using the old trapsink support if no callback
+ is found.
+ - This fixes the problem when init_mib_modules() isn't called in subagents.
+
+2000-12-27 16:42 hardaker
+
+ * agent/mibgroup/examples/example.c:
+
+ make the example traps be sent using a enterprise specific trap of 99
+ rather than 3. We need to define it in the mib still.
+
+2000-12-27 15:26 hardaker
+
+ * snmplib/asn1.c:
+
+ fix broken compiler precedence as reported in support #110473.
+
+2000-12-22 08:54 hardaker
+
+ * snmplib/asn1.c:
+
+ fix counter64 reverse encodings.
+
+2000-12-22 06:58 hardaker
+
+ * snmplib/vacm.c:
+
+ fix view processing to watch for length prefix. The length prefix
+ really really shouldn't be stored directly in the oid. Niels?
+
+2000-12-21 14:43 nba
+
+ * apps/snmpnetstat/main.c:
+
+ - main.c: fix problem with positional community argument to snmpnetstat
+
+2000-12-21 14:37 nba
+
+ * snmplib/mib.c:
+
+ - mib.c: make sure init_mib_internals is called before doing anything
+ serious in init_mib
+
+2000-12-21 08:22 hardaker
+
+ * snmplib/snmp_api.c:
+
+ Patch from Frank Strauss to fix support for BITS
+
+-------------------------------------------------------------------------------
+
+Changes: V4.1.2 -> V4.2
+
+2000-12-04 15:30 hardaker
+
+ - (NEWS, README): updates.
+
+2000-12-04 14:48 marz
+
+ ensure mibload.t uses correct MIBDIR for testing
+
+2000-12-04 11:05 hardaker
+
+ - (AGENT.txt, FAQ, README): convert url's to www.netsnmp.org.
+
+2000-12-04 08:45 hardaker
+
+ - (NEWS): agentx note changes.
+
+2000-12-03 07:29 nba
+
+ - snmptrapd_log.c: fox missing leading zeroes for %.2d like formats.
+ Add an alternate format for up-time displays.
+
+2000-12-02 18:22 marz
+
+ found the uninitialized data bug...must have been in there dormant for a while, other test fixes - good to go!
+
+2000-12-01 16:36 hardaker
+
+ - (agent/snmpd.c): reference sourceforge.
+
+2000-12-01 16:35 hardaker
+
+ - (AGENT.txt): reference sourceforge.
+
+2000-12-01 16:34 hardaker
+
+ - (TODO): reference net-snmp-coders.
+
+2000-12-01 16:34 hardaker
+
+ - (README): update.
+
+2000-12-01 16:33 hardaker
+
+ - (bug-report, agent/mibgroup/versiontag): remove the bug report script.
+
+2000-12-01 16:31 hardaker
+
+ - (PORTING): reference sourceforge.
+
+2000-12-01 16:23 hardaker
+
+ - (man/snmptrapd.conf.5.def): mention the fact that snmpv3 traps are
+ the same as snmpv2 traps.
+
+2000-12-01 16:23 hardaker
+
+ - (NEWS): update.
+
+2000-12-01 15:31 hardaker
+
+ - (README): update.
+
+2000-12-01 15:16 hardaker
+
+ - (snmpd.conf.5.def): update for proxy support.
+
+2000-12-01 14:36 hardaker
+
+ - (FAQ): update a few things.
+
+2000-12-01 14:28 nba
+
+ - mib.c: diagnose wrong quoting in indices
+
+2000-12-01 14:23 nba
+
+ - parse.c: add RFC-1213 as an aliase for RFC1213-MIB (used in many mibs)
+
+2000-12-01 14:19 nba
+
+ - smux.c: reformat some debug messages for readability
+
+2000-12-01 14:17 nba
+
+ - interfaces.c: fix ifType values for Linux
+
+2000-12-01 14:14 nba
+
+ - subagent.c: supply a missing return value
+
+2000-12-01 10:04 hardaker
+
+ - (snmpconf): quote things with spaces in them.
+
+2000-12-01 09:49 hardaker
+
+ - (snmpconf.1): quick man page for snmpconf.
+
+2000-12-01 09:15 hardaker
+
+ - (local/snmpconf.dir/snmpd.conf/monitor): cleanups.
+
+2000-12-01 09:14 hardaker
+
+ - (snmplib/parse.c): change no-parent log message into a warning.
+
+2000-12-01 09:11 hardaker
+
+ - (agent/mibgroup/agentx/README.agentx): update from Dave.
+
+2000-12-01 09:10 hardaker
+
+ - (FAQ): update from Dave.
+
+2000-12-01 07:59 hardaker
+
+ - (agent/agent_trap.c): Patch from Dave Shield:
+ - support v2->v1 trap conversion.
+
+2000-12-01 07:56 hardaker
+
+ - (configure, configure.in): typo.
+
+2000-12-01 07:42 marz
+
+ additional fixes to support targetted builds of perl/SNMP using -NET-SNMP-PATH (and white space removal as my emacs kindly does that for me?)
+
+2000-11-30 14:06 nba
+
+ - getopt.h, snmp_parse_args.h: extern "C" bracketing
+
+2000-11-30 14:04 nba
+
+ - snmpd.conf.5.def: fix formatting of smuxpeer token
+
+2000-11-30 10:31 hardaker
+
+ - (FAQ): Update from Dave.
+
+2000-11-30 10:18 hardaker
+
+ - (master_request.c): Patch from Dave Shield to fix bad sets for agentx.
+
+2000-11-30 09:19 hardaker
+
+ - (ov/README): minor corrections, probably still incorrect.
+
+2000-11-30 09:18 hardaker
+
+ - (local/Makefile.in, snmpconf, acl, basic_setup, monitor, operation,
+ system, trapsinks):
+ - grouping support.
+ - sort-of-quiet output support.
+ - operation mode support (setting user, group, ports...)
+
+2000-11-30 09:13 hardaker
+
+ - (snmplib/read_config.c): save a warning header at the top of the
+ persistent data file.
+
+2000-11-30 09:11 hardaker
+
+ - (agent/mibgroup/tunnel/tunnel.c): Cleanup patch from Frank Strauss.
+
+2000-11-30 09:10 hardaker
+
+ - (agent/snmpd.c): set DS_AGENT_NO_ROOT_ACCESS in -H help output.
+
+2000-11-30 09:08 hardaker
+
+ - (configure, configure.in): mention the TUNNEL-MIB support.
+
+2000-11-29 18:21 slif
+
+ Update e-mail address for Slifcak
+
+2000-11-29 11:34 marz
+
+ fixed order of function checking so that vsnprintf is not found in libdb (BSD db) by mistake
+
+2000-11-29 05:18 marz
+
+ partial submit to get perl/SNMP tests to pass and update the docs somewhat - still getting cores in notify.t. had to change create_user_from_session to update an existing user incase 2 sessions are started with the same user
+
+2000-11-28 18:00 marz
+
+ partial submit to get perl/SNMP tests to pass and update the docs somewhat - still getting cores in notify.t. had to change create_user_from_session to update an existing user incase 2 sessions are started with the same user
+
+2000-11-27 14:37 hardaker
+
+ - (local/snmpconf.dir/snmpd.conf/basic_setup): basic setup series of questions.
+
+2000-11-27 14:36 hardaker
+
+ - (local/snmpconf.dir/snmpd.conf/acl): typos.
+
+2000-11-27 14:36 hardaker
+
+ - (local/snmpconf):
+ - add support for "groups" of items.
+ - don't use IO::Dir, as its not in the standard perl module distributions.
+
+2000-11-27 14:34 hardaker
+
+ - (agent/mibgroup/ucd-snmp/dlmod.h): remove unneeded variable reference.
+
+2000-11-27 14:33 hardaker
+
+ - (agent/snmp_agent.c): Patch from John Naylon:
+ - fix auto-set support for the agent (and plug a memory leak).
+
+2000-11-27 13:42 nba
+
+ - snmp.conf.5.def: document tokens extendedIndex and noRangeCheck
+
+2000-11-27 13:41 nba
+
+ - parse.c: fix a C++ style comment
+
+2000-11-24 15:14 nba
+
+ - memory_freebsd2.c, vmstat_netbsd1.c: minor fixes for NetBSD 1.5, OPenBSD 2.6
+
+2000-11-22 13:48 hardaker
+
+ - (mibgroup/ucd-snmp/dlmod.c): Patch from Sean Harding:
+ - don't export an internal variable.
+
+2000-11-21 15:17 nba
+
+ - mib.c: fix parsing of oid like 99.13.\"guf\"8
+
+2000-11-19 13:03 nba
+
+ - SNMP.xs, mib2c.vartypes.conf: The recent specialisation of the Integer
+ types in the parser created problems for the perl module and in turn
+ for mib2c. Sorry for not catching this before pre2 :-(
+
+2000-11-19 12:58 nba
+
+ - fixes to ./configure --with-defaults --enable-mini-agent; make install
+ and run the tools under cygwin. Haven't tried the agent yet :-)
+
+2000-11-18 07:14 hardaker
+
+ - (version.h bug-report sedscript.in): version tag ( 4.2.pre2 )
+
+2000-11-18 07:12 hardaker
+
+ - (T049snmpv3inform): v3 inform test added.
+
+2000-11-17 11:01 nba
+
+ - mib.c, snmp_api.c: better error messages for bad snmpset calls and bad
+ indices. Also fix a bug with quoted indices.
+
+2000-11-17 10:32 hardaker
+
+ - (tests/T050snmpv3trap): test for snmpv3 traps.
+
+2000-11-17 10:30 hardaker
+
+ - (snmptrapd.c): fix cases where the format strings are specified.
+
+2000-11-17 10:26 nba
+
+ - IANAifType-MIB.txt: update from IANA
+
+2000-11-17 08:32 hardaker
+
+ - (master_request.c): Patch from Dave Shield:
+ - fix memory leaks.
+ - fix agentx problems with bad sets.
+
+2000-11-16 17:55 hardaker
+
+ - (snmplib/snmpv3.c): added a space in a debugging output statement.
+
+2000-11-16 17:54 hardaker
+
+ - (snmplib/read_config.c): simple debugging statement added.
+
+2000-11-16 17:54 hardaker
+
+ - (snmplib/snmp_api.c): set DS_LIB_APPTYPE if it hasn't been set yet.
+
+2000-11-16 17:52 hardaker
+
+ - (testing/eval_tools.sh): add CONFIGTRAPD.
+
+2000-11-16 17:50 hardaker
+
+ - (snmplib/mib.c, testing/tests/T112agentxsetfail,
+ testing/tests/T122proxysetfail):
+ - support -Ir for "dont check range/type values" (letter r subject to debate).
+
+2000-11-16 17:25 hardaker
+
+ - (callback.c): better debugging output to display a callback count when done.
+
+2000-11-16 16:52 hardaker
+
+ - (T113agentxtrap): A new test to test trap support from agentx subagents.
+
+2000-11-16 16:50 hardaker
+
+ - (T058agentauthtrap): sleep some and only perform one get request.
+
+2000-11-16 16:49 hardaker
+
+ - (T054agentv2ctrap): sleep a bit and only send one snmp set request.
+
+2000-11-16 15:47 nba
+
+ - getopt.c: quell compiler warnings
+
+2000-11-16 15:31 nba
+
+ - parse.[ch], mib.c, snmp_api.c: rename TYPE_UINTEGER32 back to TYPE_UINTEGER
+
+2000-11-16 15:16 nba
+
+ - snmptrapd.c, snmptrapd.conf: new config directives format1 and format2 to
+ set log formats for TRAP1 and TRAP2 pdus.
+
+2000-11-16 13:50 nba
+
+ - snmp_api.c: add functionality to check value types in addition to ranges
+ for snmpset and snmptrap.
+
+2000-11-16 13:47 nba
+
+ - parse.c: Fix DEFVAL parsing for OBJECT IDENTIFIER or BITS values
+ (i.e. DEFVAL { { 0 0 } } etc)
+
+2000-11-16 11:39 hardaker
+
+ - (T058agentauthtrap): add a greater timeout to the get request.
+
+2000-11-16 11:35 hardaker
+
+ - (example.c):
+ - send a v2c trap using its own data, not the system_mib's.
+ - more debugging statements.
+
+2000-11-16 11:34 hardaker
+
+ - (T053agentv1trap, T054agentv2ctrap, T058agentauthtrap):
+ - new tests for traps sent by the agent.
+
+2000-11-16 09:56 hardaker
+
+ - (target.c): Don't delete READONLY trap sessions.
+
+2000-11-15 16:37 hardaker
+
+ - (testing/tests/T052snmpv2cinform): test inform sending/receiving.
+
+2000-11-15 16:37 hardaker
+
+ - (apps/snmptrap.c, man/snmptrap.1): support -Ci for sending informs.
+
+2000-11-15 15:48 hardaker
+
+ - (snmptrapd_log.c): use SNMP_MAXBUF instead of a local length definition.
+
+2000-11-15 14:18 nba
+
+ - Makefile.in: fix make'ing in remote directory
+
+2000-11-15 14:11 nba
+
+ - main.c: update to use getopt for argument parsing.
+
+2000-11-15 14:10 nba
+
+ - snmp_agent.c: fix a confusing indentation.
+
+2000-11-15 14:09 nba
+
+ - agent_trap.c: make sure community is \0-terminated in targetParamsTable
+
+2000-11-15 14:03 nba
+
+ - snmptrapd_log: fix a buffer that is way too short for a trap with just a
+ single parameter. Fix a bad limit test in str_append.
+
+2000-11-15 14:00 nba
+
+ - snmptranslate.c: fix a stupid perror for snmp_perror
+
+2000-11-15 13:58 nba
+
+ - parse.[ch], mib.c: enhance the parser to distinguish INTEGER, Integer32,
+ Unsigned32, UInteger32.
+
+2000-11-15 13:55 nba
+
+ snmp_api.c: remove an unused variable
+
+2000-11-15 07:49 hardaker
+
+ - (snmp_vars.c, subagent.c): Patch from Lawrence Greenfield:
+ - Don't make init_agent()/subagent_pre_init() exit but return an
+ error condition instead.
+
+2000-11-12 08:08 hardaker
+
+ - (ucdDemoPublic.c): add NULL to end of demo string and check for len=0.
+
+2000-11-12 04:45 nba
+
+ snmp_api.c: Make sure the noRangeCheck token is a boolean
+
+2000-11-12 04:41 nba
+
+ - mib.c: give the tree-top a name to protect error message when looking up .foo
+
+2000-11-12 04:36 nba
+
+ - snmptranslate.c: use config_perror for a better error message
+
+2000-11-12 04:34 nba
+
+ - proxy.c: remove some unused variables.
+
+2000-11-12 04:33 nba
+
+ -agent_traps.c: Move a conditionally used variable
+
+2000-11-12 04:32 nba
+
+ Fix a bogus #ifdef
+
+2000-11-10 09:18 hardaker
+
+ - (configure, configure.in): apply patch #102224 from jbpn for cross-compiling.
+
+2000-11-10 08:56 hardaker
+
+ - (testing/TESTCONF.sh, testing/eval_tools.sh, testing/tests/T051snmpv2ctrap):
+ - first pass at a testing script to test trap functionality.
+ - which even uncovered a bug.
+
+2000-11-10 08:55 hardaker
+
+ - (apps/snmptrapd.c):
+ - fork if file logging or syslogging, but not printing.
+ - don't close open file descriptors. There shouldn't be any.
+
+2000-11-10 08:53 hardaker
+
+ - (apps/snmptrapd_log.c): properly null terminate log strings.
+
+2000-11-09 16:40 hardaker
+
+ - (configure.in): attempt to implement a --with-rsaref flag.
+
+2000-11-09 15:32 hardaker
+
+ - (README, perl/SNMP/README): mention Karl.
+
+2000-11-09 15:31 hardaker
+
+ - (NEWS, perl/SNMP/README): mention Karl.
+
+2000-11-09 14:56 hardaker
+
+ - (examples/bulkwalk.pl, t/bulkwalk.t): patch from Karl Schilke:
+ - support bulk requests.
+
+2000-11-09 14:53 hardaker
+
+ - (MANIFEST, README, SNMP.pm, SNMP.xs): patch from Karl Schilke:
+ - support bulk requests.
+
+2000-11-08 23:33 hardaker
+
+ - (read_config.c): fix -H output.
+
+2000-11-08 23:02 hardaker
+
+ - (snmp_agent.c): make agent_check_and_process() call run_alarms().
+
+2000-11-08 22:45 hardaker
+
+ - (diskio.c): fix OID.
+
+2000-11-08 17:06 hardaker
+
+ - (SNMP.pm, SNMP.xs): patch from Mark Cavage for default value support.
+
+2000-11-08 17:03 hardaker
+
+ - (mib.c, parse.c, parse.h): minimal DEFVAL parsing support.
+
+2000-11-08 16:20 hardaker
+
+ - (config.h.in, configure): check for librsaref, etc, if needed.
+
+2000-11-07 15:15 hardaker
+
+ - (config.h.in, configure, configure.in, agent/agent_read_config.c,
+ agent/snmpd.c):
+ - uid/gid changes.
+
+2000-11-07 15:10 hardaker
+
+ - (SNMP.xs): fix TYPE_NOTIF -> TYPE_NOTIFTYPE.
+
+2000-11-07 11:30 hardaker
+
+ - (SNMP/SNMP.pm, SNMP/SNMP.xs): Patch from Joe Clarke:
+ - implement best-guess (-Ib) parsing.
+ - access to trap varbinds.
+ - range access.
+
+2000-11-07 11:00 hardaker
+
+ - (.cvsignore): ignore build created files.
+
+2000-11-07 10:58 hardaker
+
+ - (README, SNMP.pm, SNMP.xs): patch from Karl Schilke:
+ - implement a finish() call.
+
+2000-11-07 10:54 hardaker
+
+ - (SNMP/SNMP.xs): patch from Karl Schilke:
+ - multiple callback patch for perl/SNMP/SNMP.xs.
+
+2000-11-07 10:48 hardaker
+
+ - (read_config.c): log an error message if the optional config file DNE.
+
+2000-11-07 10:41 hardaker
+
+ - (SNMP.pm): fix iid parsing with respect to mib nodes with a - in it.
+
+2000-11-07 10:29 hardaker
+
+ - (if_fields.h, interfaces.c, ipMedia.c, ipRoute.c, tcp.c, tcpTable.c,
+ udp.c, udpTable.c): Patch from Bert Driehuis:
+ - mibJJ fixes [FreeBSD/other BSD's].
+
+2000-11-07 10:13 hardaker
+
+ - (agent/agent_read_config.c, agent/ds_agent.h, agent/snmpd.c,
+ man/snmpd.1.def, man/snmpd.conf.5.def): Patch from Harrie Hazewinkel:
+ - implement uid/gid changes after startup for the agent.
+
+2000-11-07 08:33 hardaker
+
+ - (target.c): a better sanity check for session deletion.
+
+2000-11-07 07:24 hardaker
+
+ - (target.c): Patch from Dave to sanity check param->updateTime.
+
+2000-11-06 11:00 hardaker
+
+ - (md5.c): check to see that MDsign() data lies on a 32 byte boundry.
+ - its possible some compilers will choke on this hack.
+ - fixes bug #12175.
+
+2000-11-03 17:54 hardaker
+
+ - (mib2c): sort OIDs properly.
+
+2000-11-03 16:44 hardaker
+
+ - (example.c): Patch from Harrie Hazewinkel:
+ - fix mib registrations for duplicate OIDs being used for the trap examples.
+
+2000-11-03 15:31 hardaker
+
+ - (snmpd.c): second patch from dougwarz in bug #117273 to fix smux problems.
+ - Um, applied correctly this time (I hope).
+
+2000-11-03 15:29 hardaker
+
+ - (snmpd.c): second patch from dougwarz in bug #117273 to fix smux problems.
+
+2000-11-02 22:19 nba
+
+ Clean up some unused variables etc.
+
+2000-11-02 22:16 nba
+
+ - Makefile.in: fix some $(srcdir) references when running outside source
+
+2000-11-02 22:15 nba
+
+ - snmptrapd.c: fix the format string for format_trap
+
+2000-11-02 22:14 nba
+
+ - Makefile.in: remove some duplicates from file lists
+
+2000-11-02 22:12 nba
+
+ Document the -OX output option
+
+2000-11-02 22:11 nba
+
+ Document the sysservices token
+
+2000-11-02 16:17 hardaker
+
+ - (agent/mibgroup/ucd_snmp.h): add ucd-snmp/proxy.
+
+2000-11-02 16:16 hardaker
+
+ - (agent/mibgroup/versiontag): change cvs archive site and package name.
+
+2000-11-02 13:23 hardaker
+
+ - (smux.c): Patch 102239 from dougwarz to fix a previously bad smux.c patch.
+
+2000-11-01 16:36 hardaker
+
+ - (version.h bug-report sedscript.in): version tag ( 4.2.pre1 )
+
+2000-11-01 16:14 hardaker
+
+ - (T120proxyget, T121proxyset, T122proxysetfail): proxy test suite.
+
+2000-11-01 16:08 hardaker
+
+ - (agent/mibgroup/ucd-snmp/proxy.c, agent/mibgroup/ucd-snmp/proxy.h):
+ - minimal SET support for the proxy code.
+
+2000-11-01 10:22 hardaker
+
+ - (T112agentxsetfail): test for agentx sets that should fail properly.
+
+2000-10-31 14:30 nba
+
+ - tcpTable.c: remove an unnescessary #include
+
+2000-10-31 14:28 nba
+
+ - smux.c: fix wrong variable length
+
+2000-10-31 14:25 nba
+
+ - protocol.c: fix some suspicious looking code
+
+2000-10-31 14:21 nba
+
+ - man/snmpd.conf: fix a typo
+
+2000-10-31 12:41 nba
+
+ - mib.c: add -OX output format, for just another way of printing indices
+
+2000-10-31 12:27 nba
+
+ - interface.c: add "interface" config for unguessable interface type/speed
+
+2000-10-31 12:25 nba
+
+ - apps/*: make sure we report any errindex/errcode in the response
+
+2000-10-31 12:04 nba
+
+ - protocol.c: clean up unused variables.
+
+2000-10-31 10:13 hardaker
+
+ - (smux.c): patch #1 from bug #117273 applied to fix smux socket problems.
+
+2000-10-31 09:24 hardaker
+
+ - (SNMP.xs): print counter64's as unsigned.
+
+2000-10-31 07:54 hardaker
+
+ - (agent_trap.c, agent_trap.h, subagent.c, snmpNotifyTable.c,
+ snmpNotifyTable.h): Patch from Dave:
+ - fix notifications from agentx subagents.
+
+2000-10-30 22:03 hardaker
+
+ - (smux.c): fix bug #119786: make smux reuse socket address.
+
+2000-10-30 21:42 hardaker
+
+ - (eval_tools.sh, tests/T110agentxget, tests/T111agentxset):
+ - fix bug #382
+ - fix agentx non-root tests to use -x /tmp/blah/agentx_socket.
+
+2000-10-30 13:45 hardaker
+
+ - (snmpd.1.def): fix a typo pointed out by Chris Pepper.
+
+2000-10-30 11:46 hardaker
+
+ - (tests/T111agentxset): test script for AgentX set support.
+
+2000-10-30 11:43 hardaker
+
+ - (tests/T110agentxget): header changed to include the word GET.
+
+2000-10-30 11:13 nba
+
+ - ucd-snmp/vmstat_*, memory_freebsd2.c, dlmod.c: Make ssRawCpu objects Counters,
+ and add support for *BSD (including OpenBSD)
+
+2000-10-30 11:07 nba
+
+ - Clean up unused variables.
+
+2000-10-30 11:04 hardaker
+
+ - (testing/tests/T101agentx, testing/tests/T110agentxget):
+ - renamed the agentx test script.
+
+2000-10-30 11:03 hardaker
+
+ - (testing/eval_tools.sh): don't add -c CONFIGFILE if it doesn't exist.
+
+2000-10-30 10:39 hardaker
+
+ - (agent/snmpd.c): error when parsing -X for non-agentx builds.
+
+2000-10-27 11:29 hardaker
+
+ - (apps/snmptrapd.c): add -o flag to log to a particular file.
+
+2000-10-27 10:41 hardaker
+
+ - (snmplib/snmp_api.c): use mkstemp if available.
+
+2000-10-27 10:40 hardaker
+
+ - (config.h.in, configure, configure.in): Search for mkstemp().
+
+2000-10-27 10:08 hardaker
+
+ - (FAQ): update linux kernel list to include 2.2.
+
+2000-10-26 17:51 hardaker
+
+ - (eval_tools.sh): make SKIPIFNOT check the mib module list too.
+
+2000-10-26 17:48 hardaker
+
+ - (tests/T101agentx): AgentX subagent test for simple get retrieval.
+
+2000-10-25 17:44 hardaker
+
+ - (snmpd.c): Add -X option to snmpd to run as a subagent.
+
+2000-10-25 17:06 hardaker
+
+ - (read_config.c): fix for cases whene debugging is always off.
+
+2000-10-17 15:30 hardaker
+
+ - (config.h.in): autoheader run
+
+2000-10-16 03:13 daves
+
+ - (agentx/master.c): Specify the length of the (pseudo-)answer to a request.
+ This allows it to be cached correctly for multi-pass SET handling.
+
+2000-10-16 03:11 daves
+
+ - (agentx/subagent.c): Don't overwrite saved mode information
+ This should help with (some of) the SET handling problems.
+
+2000-10-16 01:56 daves
+
+ - (agentx/master_request.c): Don't free callback data structure.
+ This holds information that needs to persist across multi-pass requests.
+ I realise that this introduces a memory leak, but this isn't the
+ correct place to handle this.
+
+2000-10-12 14:52 hardaker
+
+ - (snmpd.c): add -I to the help output.
+
+2000-10-12 14:24 hardaker
+
+ - (agent/dlmods/*): remove obsolete versions
+
+2000-10-12 14:08 hardaker
+
+ - (configure): update.
+
+2000-10-12 14:01 hardaker
+
+ - (acconfig.h, config.h.in, configure.in): Patch from Matt Braithwaite:
+ - udp configuration changes to check for misc structure definitions.
+
+2000-10-12 13:48 hardaker
+
+ - (TUNNEL-MIB.txt): TUNNEL-MIB definition.
+
+2000-10-12 13:48 hardaker
+
+ - (tunnel.h): config_add_mib(TUNNEL-MIB).
+
+2000-10-12 13:47 hardaker
+
+ - (tunnel.h, tunnel.c, tunnel.h): Patch from Frank Strauss:
+ - implement the TUNNEL-MIB.
+
+2000-10-10 14:33 mslifcak
+
+ Fix unlink_tree for "top level" tree nodes.
+
+2000-10-10 11:02 hardaker
+
+ - (Makefile.in): reverse library link ordering again...
+
+2000-10-10 09:03 mslifcak
+
+ Remove relative path to include system.h.
+
+2000-10-10 06:53 mslifcak
+
+ Remove unneeded decl of vsnprintf without stdarg/varargs decl of va_list.
+
+2000-10-10 05:15 mslifcak
+
+ Apply patch for DEC Alpha EV6, supplied by Shumon Huque<shuque@isc.upenn.edu>
+
+2000-10-09 17:06 mslifcak
+
+ patch to fix leading zero error introduced by changes for shutdown_mib.
+
+2000-10-09 15:51 hardaker
+
+ - (dlmod.c): minor debugging output additions.
+
+2000-10-09 15:51 hardaker
+
+ - (Makefile.in): move auto_nlist to libucdmibs.
+
+2000-10-09 11:43 hardaker
+
+ - (FAQ, README): add new mirror.
+
+2000-10-09 10:26 mslifcak
+
+ Move config- and store-related cleanup from shutdown_mib to snmp_shutdown.
+
+2000-10-09 02:36 daves
+
+ - (mibII/interfaces.c): Qualify an individual interface type test symbol
+ (Qn: should any/all of the others be qualified as well?)
+
+2000-10-06 08:56 mslifcak
+
+ Support for shutdown_mib - clearing the MIB trees and configured registrations.
+
+2000-10-06 05:33 mslifcak
+
+ Plug memory leak for ucd-supplied setenv on Win32 platform.
+
+2000-10-06 04:58 mslifcak
+
+ Remove unused variables.
+
+2000-10-05 23:45 nba
+
+ - mib.c: fix silly bug in new oid parser, when leaving the tree and going
+ into sub-ids we know nothing about
+
+2000-10-05 16:03 hardaker
+
+ - (Makefile.in): Patch from Harrie Hazewinkel:
+ - fix library dependency order.
+
+2000-10-04 17:59 hardaker
+
+ - (Makefile.in): install "extending" snmpconf file.
+
+2000-10-04 17:58 hardaker
+
+ - (extending): add snmpconf support for extending the agent (pass, exec, ...)
+
+2000-10-04 17:58 hardaker
+
+ - (monitor): misc updates and add "file" watching.
+
+2000-10-04 17:57 hardaker
+
+ - (acl): don't specify line specifications for default snmpconf usage.
+
+2000-10-04 14:50 nba
+
+ - FAQ: fix a confusion between "omit" and "include"
+
+2000-10-04 13:25 hardaker
+
+ - (pass_persist.c): opaques in pass_persist.
+
+2000-10-04 10:35 hardaker
+
+ - (pass.c): support opaque return types.
+
+2000-10-04 07:15 mslifcak
+
+ Fix parsing problem for -Pc option; reported by Christian Mautner.
+
+2000-10-04 07:02 mslifcak
+
+ qualify new i/f types.
+
+2000-10-04 06:52 mslifcak
+
+ qualify symbols for new i/f types.
+
+2000-10-04 06:51 mslifcak
+
+ Terminate list to compile (add a comma).
+
+2000-10-04 00:18 nba
+
+ - snmptable.c: index columnt (-Ci) width not properly computed when using
+ GETBULK
+
+2000-10-03 18:19 hardaker
+
+ - (agent_registry.c, agent_registry.h, snmpd.c): Patch from John Naylon:
+ - add a passback argument to register_readfd() callbacks.
+
+2000-10-03 18:17 hardaker
+
+ - (Makefile.in): Patch from Harrie Hazewinkel:
+ - move auto_nlist.o/lo to libucdagent since some mib-modules need it.
+
+2000-10-03 18:07 hardaker
+
+ - (smux.c): Patch from Jochen Friedrich:
+ - fix getnext requests to subagents.
+
+2000-10-03 17:26 hardaker
+
+ - (mibJJ/interfaces.c): Patch from Frank Strauss:
+ - better iftype guessing.
+
+2000-10-03 17:24 hardaker
+
+ - (interfaces.c): Patch from Frank Strauss:
+ - better iftype guessing.
+
+2000-10-03 16:52 hardaker
+
+ - (smux.c): Patch from Doug Warzecha:
+ - fix oid parsing in traps.
+
+2000-10-03 16:23 hardaker
+
+ - (example.c, example.h): example of coding a v2 trap from someone who
+ I have very sadly forgotten. I've been looking for that message for
+ a while to properly attribute this patch. Sigh.
+
+2000-10-03 16:21 hardaker
+
+ - (snmp_agent.c): Patch from Douglas Warzecha:
+ - snmpd returns wrong error index on SNMPv1 request (BUG#375).
+
+2000-10-03 09:12 mslifcak
+
+ Fix null deref of ss->community, reported by Jim Pickering.
+
+2000-10-03 08:03 mslifcak
+
+ Casting to fix problems building with aCC
+ Thanks to Markku Laukkanen <pky@moremagic.com>
+
+2000-10-03 05:59 mslifcak
+
+ Remove chdir to undo fix for (BUG#298)
+
+2000-10-02 21:41 nba
+
+ - mib.c: Escape " and \ in text strings.
+
+2000-10-02 21:39 nba
+
+ - snmp_logging.c: #include <netinet/in.h>
+
+2000-10-02 21:38 nba
+
+ - Makefile.in: fix a missing $(srcdir) during make install of mib2c
+ configuration files
+
+2000-10-02 21:37 nba
+
+ - snmpset.c: Do a exit(2) for failure in setting the variable.
+
+2000-10-02 21:36 nba
+
+ - hr_swrun.c: add a safeguard for very long argument lists.
+
+2000-10-02 21:34 nba
+
+ - hr_disk.c: Add a name pattern that matches x86 IDE disks for Solaris.
+
+2000-10-02 21:33 nba
+
+ - kernel_sunos5.c: make the buffer for SIOCGIFCONF dynamic.
+
+2000-10-02 11:41 hardaker
+
+ - (Makefile.in): install snmpusm.h.
+
+2000-10-02 10:48 hardaker
+
+ - (snmpconf):
+ - new options for installing created files.
+ - more comments in the code.
+ - allow reading a .conf directly to writing for auto-commenting .conf files.
+ - misc.
+
+2000-10-02 10:47 hardaker
+
+ - (agent/mibgroup/Makefile.in, agent/Makefile.in): make depend-less.
+
+2000-10-02 09:35 hardaker
+
+ - (snmp_agent.c): protect against 0 byte statP mallocs.
+
+2000-10-02 09:14 hardaker
+
+ - (interfaces.c): Patch from Ted Rule:
+ - fix interfaces.c for variable length number formatting in /proc/net/dev.
+
+2000-10-01 16:40 mslifcak
+
+ Per Niels recommendation, chdir to PERSISTENT_DIRECTORY (re: bug #298)
+
+2000-09-30 08:57 mslifcak
+
+ Fix DEBUGMSGTL not found error for builds without dlmod support.
+ Thanks to simon@zid.tuwein.ac.at
+
+2000-09-30 08:50 mslifcak
+
+ Fix some kernel symbols - thanks to simon@zid.tuwien.ac.at
+
+2000-09-29 14:35 hardaker
+
+ - (*/Makefile.in): make depend + .o -> .lo fixes.
+
+2000-09-29 14:27 hardaker
+
+ - (makefileindepend.pl): skip empty depend lines.
+
+2000-09-29 14:09 hardaker
+
+ - (snmpconf): drop duplicate lines from read in snmpd.conf files.
+
+2000-09-29 13:46 hardaker
+
+ - (snmpconf): sort unknown directives by filetype (whoops).
+
+2000-09-29 13:42 hardaker
+
+ - (monitor): minor wording adjustments.
+
+2000-09-29 13:42 hardaker
+
+ - (snmpconf): print more information/comments to the screen.
+
+2000-09-29 11:31 hardaker
+
+ - (var_struct.h): increase registration name length to 32 from 16 (Bug #172)
+
+2000-09-29 11:12 hardaker
+
+ - (snmp_api.c): incorrect val length passed to parse_unsigned_int (Bug #339).
+
+2000-09-29 11:01 hardaker
+
+ - (snmp_api.c): fix Bug#353 for hostnames that look like "5w".
+ - don't interprete them as an ip-port.
+
+2000-09-29 10:39 hardaker
+
+ - (snmp_alarm.c): Patch from jbpn@cambridgebroadband.com:
+ - There is a peculiarity in the snmp_alarm_unregister function in
+ snmplib/snmp_alarm.c which can cause a segmentation fault. (Bug #367)
+
+2000-09-29 10:34 hardaker
+
+ - (snmpTargetParamsEntry.c): Patch from John Naylon:
+ - fix use of NULL timestamp pointer in new row creation (Bug #346)
+
+2000-09-28 14:38 nba
+
+ - mib_api.3: add a few functions to the header
+
+2000-09-28 14:14 nba
+
+ - snmptrap.c: remove an extraneous snmp_free_pdu
+
+2000-09-28 14:13 nba
+
+ - man/: add man entries for many library functions (pointing to snmp_api.3)
+
+2000-09-28 11:09 mslifcak
+
+ remove second copy of sys/socket.h
+
+2000-09-28 11:08 mslifcak
+
+ For building on Ultrix V4.x
+
+2000-09-27 12:59 hardaker
+
+ - (dlmod.h): add the UCD-DLMOD-MIB to the default load list.
+
+2000-09-27 12:55 hardaker
+
+ - (config.h.in, configure, configure.in, ucd_snmp.h, dlmod.c):
+ - include ucd-snmp/dlmod by default.
+ - build code only if dlopen is found.
+
+2000-09-27 08:31 hardaker
+
+ - (auto_nlist.c): Patch from Harrie Hazewinkel:
+ - don't print kernel based warning messages when -r, etc, is specified.
+
+2000-09-26 16:07 hardaker
+
+ - (displaytable.pm): minor bug fixes.
+
+2000-09-26 14:21 hardaker
+
+ - (displaytable.pm, manager.pm):
+ - displatable supports -mark/-onmarked.
+ - user's oncall schedule is modifiable via the web.
+
+2000-09-26 13:17 mslifcak
+
+ For Win32 API: Declare strtoul, vsnprintf; Enable reverse BER encoding.
+
+2000-09-26 13:15 mslifcak
+
+ Include system.h (vsnprintf decl)
+
+2000-09-26 13:14 mslifcak
+
+ Fix unsigned comparison.
+
+2000-09-26 13:14 mslifcak
+
+ Fix unsigned comparisons.
+
+2000-09-26 13:13 mslifcak
+
+ Fix signed comparison; Remove unused var.
+
+2000-09-26 13:12 mslifcak
+
+ Include getopt.h (optarg decl); Remove unused var.
+
+2000-09-26 13:11 mslifcak
+
+ Match Initialise_Table args 3,4 declarations with definitions.
+
+2000-09-26 12:58 hardaker
+
+ - (interfaces.c): make the adminstatus RONLY.
+
+2000-09-26 10:21 hardaker
+
+ - (mib2c): chomp($1) is illegal.
+
+2000-09-26 03:04 mslifcak
+
+ Explicitly build path to CACHEFILE, as not all C compilers support "##".
+
+2000-09-25 17:49 hardaker
+
+ - (displaytable.pm): Wes actually documented something? you must be kidding!
+
+2000-09-25 16:56 mslifcak
+
+ chdir just before sending coldstart trap, to allow for paths to be
+ resolved.
+
+2000-09-25 15:08 hardaker
+
+ - (displaytable.pm): minor graphing changes
+
+2000-09-25 09:35 mslifcak
+
+ case insensitive token search (use strcasecmp).
+
+2000-09-22 06:03 nba
+
+ -mibs/: MIB updates
+
+2000-09-22 05:55 nba
+
+ - mibs/: MIB updates
+
+2000-09-22 05:52 nba
+
+ - snmp_api.c: support setting of BITS variables
+
+2000-09-22 05:50 nba
+
+ - snmpstatus.c: show error object
+
+2000-09-22 04:29 nba
+
+ - snmpusm.c: issue error message with object
+
+2000-09-22 04:28 nba
+
+ - system.h: provide prototypes for strtol, strtoul, snprintf, vsnprintf
+
+2000-09-22 04:27 nba
+
+ - vacm_vars.c: protect against overrun of strings
+
+2000-09-21 16:17 nba
+
+ - apps/: display failed object when one is identified by pdu->errindex
+
+2000-09-21 15:59 hardaker
+
+ - (Makefile.in, snmpdf.1): document the snmpdf command.
+
+2000-09-21 15:50 nba
+
+ - snmptable: use GETBULK to collect data when protocol allows it. Add
+ -CB options to fall back to GETNEXT.
+
+2000-09-21 15:38 nba
+
+ - mib.c: rewrite index handling in object ids, to allow symbolic enums.
+ Add Daves suggested -Ov output. Also enhace -Td output to
+ destinguish OBJECT-TYPE from TRAP-TYPE, MODULE-IDENTITY etc.
+
+2000-09-21 15:31 hardaker
+
+ - (snmpdf.c): use the UCD-SNMP-MIB's dskTable if the
+ HOST-RESOURCES-MIB is empty or if -Cu is specified on the command line.
+
+2000-09-21 15:28 nba
+
+ - parse.c: add ability to collect VARIABLES/OBJECTS for TRAP-TYPE
+ and NOTIFICATION-TYPE. Ignore files that does not have DEFINITIONS
+ as their second token. Enhance -Td output accordingly.
+
+2000-09-21 15:22 nba
+
+ - snmplib: add snprintf, strtol, strtoul for systems that don't have them
+
+2000-09-21 15:10 hardaker
+
+ - (mib.h): add fake struct definition for enums
+
+2000-09-21 14:16 nba
+
+ file strtoul.c was initially added on branch V4-1-1-patches.
+
+2000-09-21 14:16 nba
+
+ file strtol.c was initially added on branch V4-1-1-patches.
+
+2000-09-21 14:16 nba
+
+ file snprintf.c was initially added on branch V4-1-1-patches.
+
+2000-09-21 06:16 hardaker
+
+ - (mib.c, mib.h): make sprint* non-static (bug #132).
+
+2000-09-21 00:25 hardaker
+
+ - (snmp_alarm.c): Patch from John Naylon:
+ - fix bug #360 where a client might remove a alarm registration
+ during a call to the alarm function and invalidate the pointer
+ being used by the calling function.
+
+2000-09-21 00:22 hardaker
+
+ - (configure, configure.in): --disable-shared by default in cvs checkouts.
+
+2000-09-20 17:31 hardaker
+
+ - (snmpconf): space indent tokens if # prepended.
+
+2000-09-20 17:30 hardaker
+
+ - (snmpTargetAddrEntry.c, snmpTargetParamsEntry.c): null internal help lines.
+
+2000-09-20 17:29 hardaker
+
+ - (Makefile.in, monitor): disk, proc, and load checks.
+
+2000-09-20 17:28 hardaker
+
+ - (authopts): fix valid answers for auth and priv types.
+
+2000-09-20 17:27 hardaker
+
+ - (vacm_vars.c, usmUser.c, snmpv3.c): NULL out help messages for .conf
+ tokens that are either internal or no longer the standard way of
+ doing things.
+
+2000-09-20 17:26 hardaker
+
+ - (configure, configure.in): export SNMPCONFPATH to Makefiles
+
+2000-09-20 17:25 hardaker
+
+ - (EXAMPLE.conf.def): minor correction of table name. More errors exist.
+
+2000-09-20 16:46 hardaker
+
+ - (Makefile.in, debugging, mibs, output): more snmp.conf snmpconf config files.
+
+2000-09-20 15:17 hardaker
+
+ - (Makefile.in, authopts): snmp.conf support for basic authentication options.
+
+2000-09-20 14:55 hardaker
+
+ - (snmpconf):
+ - don't force reading of /usr/local/share/snmpd.conf.
+ - don't print unknown directive comment headers if there aren't any.
+
+2000-09-20 14:45 hardaker
+
+ - (snmpconf): space things out on the screen a bit better.
+
+2000-09-20 14:44 hardaker
+
+ - (trapsinks): add port number option to trapsink directives.
+
+2000-09-20 14:35 hardaker
+
+ - (Makefile.in, snmpconf): install snmpconf and its various support files.
+
+2000-09-20 14:20 hardaker
+
+ - (snmp_api.c, snmp_api.h): do reverse v3 header encoding with a static buffer.
+
+2000-09-20 11:37 hardaker
+
+ - (snmpconf): misc updates and improvements.
+
+2000-09-20 08:54 hardaker
+
+ - (snmp_api.c): Fix dynamic array problem pointed out by Jochen Kmietsch.
+
+2000-09-20 02:05 daves
+
+ - (agentx/protocol.c): Don't include context strings on PDUs that shouldn't have them
+ (Thanks to Pedro Pereira for identifying this)
+
+2000-09-19 17:07 hardaker
+
+ - (acl, system, trapsinks): initial snmpconf description files.
+
+2000-09-19 17:06 hardaker
+
+ - (snmpconf): read older configuration files in and merge with new results.
+
+2000-09-19 14:40 hardaker
+
+ - (snmp_api.c): print pdu type on debugging dump output.
+
+2000-09-19 14:15 hardaker
+
+ - (asn1.c, snmp.c): reverse encoding support for specialized opaque
+ datatypes (float, double, etc).
+
+2000-09-19 14:15 hardaker
+
+ - (aclocal.m4): document macros a bit more for submission to the
+ autoconf macro library.
+
+2000-09-19 08:30 mslifcak
+
+ Fix bug #295 reported by John Whitney johnw@aiinet.com
+
+2000-09-18 14:59 hardaker
+
+ - (snmp_vars.h, snmpd.h): Patch from Harrie Hazewinkel:
+ - move getStatPtr definition to proper .h file.
+
+2000-09-18 14:55 mslifcak
+
+ Fix bug #347 reported by das_deniz@yahoo.com: make sbin install dir
+
+2000-09-14 09:05 hardaker
+
+ - (agent_read_config.c, snmpd.conf.5.def): Patch from Harrie Hazewinkel:
+ - add a port specification snmpd.conf token.
+
+2000-09-14 08:52 hardaker
+
+ - (agent_trap.c): ignore output of gethostbyname for trap session adding.
+
+2000-09-13 15:06 hardaker
+
+ - (snmpconf): new utility to generate .conf files by prompting the
+ user with questions.
+
+2000-09-08 13:07 hardaker
+
+ - (proxy.c): Patch from Scott Lipcon:
+ - fix proxy support for null length strings.
+
+2000-09-07 10:12 hardaker
+
+ - (config.h.in, configure, configure.in):
+ - fix openssl checks.
+ - run autoheader.
+
+2000-09-05 13:35 mslifcak
+
+ Minor touchups to build on Win32 platform.
+
+2000-09-05 13:34 mslifcak
+
+ Welcome the newest ucd-snmp applications to the Win32 builds.
+
+2000-09-04 15:19 nba
+
+ - read_config.c: restart errorcount when reloading config
+
+2000-09-04 15:12 nba
+
+ - snmpnetstat.1: align man page with program
+
+2000-09-04 15:10 nba
+
+ - ipAddr.c: remove a bad ntohl for OpenBSD
+
+2000-09-04 15:09 nba
+
+ - mibincl.h, {tc,ud}p{,Table}.c: ensure just one include of socket.h
+ to make unprotected include file in Ultrix happy
+
+2000-09-04 15:05 nba
+
+ - configure.in: make --without-libwrap work
+
+2000-09-01 15:14 hardaker
+
+ - (vmstat_solaris2.c, vmstat_solaris2.h): Patch from Jochen Kmietsch:
+ - updated code.
+
+2000-09-01 11:54 hardaker
+
+ - (snmptrapd.c): Scott Lipcon noted that snmptrapd doesn't support -T.
+
+2000-08-30 13:28 nba
+
+ - parse.c: fix loop in syntax error in DEFVAL clause. Also fix reading
+ of .index file with filenames containing blanks.
+
+2000-08-28 13:43 marz
+
+ minor syntax glitch in POD docs
+
+2000-08-24 01:55 daves
+
+ - (apps/snmptable.c): Fix bug with displaying header-less indexed tables
+ (Thanks to Ernie Miller)
+
+2000-08-19 11:29 mslifcak
+
+ Apply patch from <Christoph.Mammitzsch@tu-clausthal.de>
+ to fix sign in asn_rbuild_unsigned_int .
+
+2000-08-18 04:18 mslifcak
+
+ restore previous version; openbsd, solaris, linux build ok.
+
+2000-08-18 03:44 mslifcak
+
+ remove unused printf argument passed to snmp_log.
+
+2000-08-18 03:20 mslifcak
+
+ fix bug 253 with patch supplied by Jeffrey Honig <jch@bsdi.com>
+
+2000-08-18 02:52 mslifcak
+
+ fix bug 318 - test 9 and 10 explicitly create the test user.
+
+2000-08-17 13:42 mslifcak
+
+ The battle to trim newlines correctly continues...reduce length by one.
+
+2000-08-16 15:04 hardaker
+
+ - (snmp_api.c, snmpusm.c): fix various encryption/decryption problems.
+
+2000-08-16 15:03 hardaker
+
+ - (scapi.c): fix padding size in encryption.
+
+2000-08-16 14:48 hardaker
+
+ - (scapi.c): set plaintext length at the end of sc_decrypt.
+
+2000-08-15 05:08 mslifcak
+
+ Fix bug 284 with a short explanation about snmp.conf.
+
+2000-08-15 03:00 mslifcak
+
+ Fix bug 283 - umask 022, make install. Thanks to csaba.toth@szk.bke.hu
+
+2000-08-15 00:09 nba
+
+ - snmptest.c: overhaul input_variable, kill newline
+
+2000-08-14 22:05 nba
+
+ - aclocal.m4, configure.in: fixes for configure --silent
+
+2000-08-14 17:27 hardaker
+
+ - (Makefile.top, configure, configure.in):
+ - --enable-silent-libtool to make Niels smile.
+
+2000-08-14 17:17 hardaker
+
+ - (snmpv3.c, snmpv3.h): implement a new (default) engineID type based
+ on a random number, and a timestamp.
+ - I think it won't invalidate existing installations (heh).
+
+2000-08-14 16:47 hardaker
+
+ - (read_config.c):
+ - if -Dread_config, then print even no-help tokens and a * for PREMIB ones.
+
+2000-08-14 14:51 nba
+
+ - (many): portability fixes for OpenBSD 2.6, FreeBSD 4.1, Ultrix 4.5
+
+2000-08-14 11:33 hardaker
+
+ - (keytools.c): Patch from Yigal Hochberg:
+ - remove unused context variables.
+
+2000-08-14 11:29 hardaker
+
+ - (scapi.c): Patch from Yigal Hochberg:
+ - remove duplicate keylength check.
+
+2000-08-11 13:09 hardaker
+
+ - (snmp_api.c): optimize reverse encoding of varbindlists.
+
+2000-08-11 08:55 hardaker
+
+ - (README.mib2c): Patch from Jan Alfred Sandven:
+ - typos.
+
+2000-08-11 06:05 nba
+
+ - apps/*: snmpapp -V should not give the usage message too.
+
+2000-08-11 00:44 nba
+
+ - snmptrapd.8: fix typo. Thanks to G. Allen Morris III <gam3@acm.org>
+
+2000-08-10 23:23 nba
+
+ - parse.c: predefine ObjectSyntax, ApplicationSyntax, SimpleSyntax and
+ ObjectName
+
+2000-08-10 16:20 hardaker
+
+ - (Makefile.in, mib2c):
+ - make mib2c look in $(snmplibdir) for .conf files.
+ - install mib2c and .conf files.
+
+2000-08-10 14:33 hardaker
+
+ - (default_store.h, snmp_api.c): dynamically decide to reverse/forward encode.
+
+2000-08-10 14:31 hardaker
+
+ - (extensible.c): fix CR termination.
+
+2000-08-10 14:25 hardaker
+
+ - (acconfig.h, config.h.in): define reverse encoding on by default.
+
+2000-08-10 13:02 mslifcak
+
+ fix bug 252 for configure and sys/socket.h on BSD/OS 4.2
+
+2000-08-10 09:07 hardaker
+
+ - (asn1.c, asn1.h, snmp.c, snmp.h, snmp_api.c, snmp_api.h, snmpusm.c,
+ snmpusm.h, snmpv3.c):
+ - implement reverse encoded messages.
+ - TODO: clean up, run-time determination of weather to use it or not.
+
+2000-08-09 15:40 mslifcak
+
+ Fix bug 331 with patch in part provided by John Naylon <jbpn@cambridgebroadband.com>
+
+2000-08-09 15:27 mslifcak
+
+ no // comment, in deference to non-ANSI-C compilers.
+
+2000-08-09 07:21 nba
+
+ - hr_swrun.c: fix the RunPath for swapped out Linux process
+
+2000-08-09 07:21 nba
+
+ - hr_print.c: fix a debug token
+
+2000-08-09 04:44 nba
+
+ - main.c: fix parsing of -v
+
+2000-08-09 01:13 daves
+
+ - (mibJJ/ipRoute.h): Omit route_write for now
+
+2000-08-09 00:58 daves
+
+ - (mibJJ/*): Experimental re-write of mibII
+ (Pilot error when trying to commit the changes earlier - sorry!)
+
+2000-08-08 10:06 hardaker
+
+ - (extensible.c): strip newlines.
+
+2000-08-08 08:51 hardaker
+
+ - (snmp_parse_args.c): Patch from Scott Lipcon: start optind at 1 not 0.
+ -
+
+2000-08-08 06:36 mslifcak
+
+ Fix bug #295 (free *secStateRef before allocating another one).
+
+2000-08-08 06:05 mslifcak
+
+ fix bug #298 reported and patch supplied by Conrad Link <clink@ml.com>
+
+2000-08-08 04:59 nba
+
+ - snmp_api.c: fix a busy loop when alarm queue is active without any
+ outstanding requests
+
+2000-08-08 04:47 nba
+
+ - snmpset.1: cannot set counters
+
+2000-08-08 04:42 mslifcak
+
+ Fixed (BUG#332) using patch submitted by John Naylon <jbpn@cambridgebroadband.com>
+ Also consolidated comments about the four send PDU functions.
+
+2000-08-07 06:59 mslifcak
+
+ Fix leak in reportable errors found by John Naylon <jbpn@cambridgebroadband.com>
+
+2000-08-07 05:48 nba
+
+ file add_module_replacement.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 05:48 nba
+
+ file read_objid.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file snmp_set_save_descriptions.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file snmp_set_mib_warnings.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file read_module_node.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file read_module.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file read_all_mibs.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file read_mib.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file print_variable.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file print_value.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file print_objid.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file print_description.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file print_mib.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file init_mib_internals.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file init_mib.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file get_module_node.3 was initially added on branch V4-1-1-patches.
+
+2000-08-07 02:49 nba
+
+ file add_mibdir.3 was initially added on branch V4-1-1-patches.
+
+2000-08-04 17:13 hardaker
+
+ - (configure, configure.in): add in the notification group by default.
+
+2000-08-04 17:08 hardaker
+
+ - (notification.h): notification mib wrapper.
+
+2000-08-04 17:06 hardaker
+
+ - (snmp_parse_args.c):
+ - initialize optind before calling getopt.
+ - debugging output.
+
+2000-08-04 16:56 hardaker
+
+ - (proxy.c): properly set the first (unused) argument to snmp_parse_args().
+
+2000-08-04 16:53 hardaker
+
+ - (agent_trap.c, snmpNotifyTable.h, snmpTargetAddrEntry.c,
+ snmpTargetAddrEntry.h, snmpTargetParamsEntry.c,
+ snmpTargetParamsEntry.h, target.c):
+ - if using the snmpNotificationTable, insert non-v1 trap sinks into it.
+
+2000-08-04 05:26 daves
+
+ - (mibgroup/mibJJ.h mibgroup/mibJJ/*): Experimental re-write of mibII
+
+2000-08-04 05:21 daves
+
+ - (mibgroup/util_funcs.[ch]): New 'cached table' routines
+
+2000-08-03 08:37 mslifcak
+
+ Fix bug #325 identified by John Naylon <jbpn@cambridgebroadband.com>
+
+2000-08-03 01:24 nba
+
+ file IP-FORWARD-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-08-03 01:24 nba
+
+ file INET-ADDRESS-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-08-03 01:24 nba
+
+ file IF-INVERTED-STACK-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-08-03 01:24 nba
+
+ file HCNUM-TC.txt was initially added on branch V4-1-1-patches.
+
+2000-08-02 07:06 mslifcak
+
+ Silent running grep results.
+
+2000-08-02 06:10 mslifcak
+
+ Fix BUG #291 : allow "255.255.255.255" for text input to ASN_IPADDRESS
+
+2000-08-02 05:20 mslifcak
+
+ Fix (BUG#323) : free PDU when snmp_send fails.
+
+2000-08-02 05:06 mslifcak
+
+ Add -p option once to snmpd args.
+ Find MIBDIRS in source tree.
+ Fix condition to set PATH.
+
+2000-08-01 23:30 nba
+
+ - ip.c: One more #if solaris
+
+2000-08-01 23:19 nba
+
+ - ip.c: A bad #if ... the proper define to test for Solaris is solaris2
+
+2000-08-01 16:40 hardaker
+
+ - (snmp_parse_args.c): remove unused usage() typedef.
+
+2000-08-01 16:40 hardaker
+
+ - (proxy.c, proxy.h): -Wall warning fixes.
+
+2000-08-01 16:39 hardaker
+
+ - (FAQ): mention newer versions of Solaris.
+
+2000-08-01 16:37 hardaker
+
+ - (TESTCONF.sh, TESTCONF.sh.in): revert to non-configed TESTCONF.
+
+2000-08-01 16:31 hardaker
+
+ - (Makefile.top): make un-quiet.
+
+2000-08-01 10:23 hardaker
+
+ - (snmp-ucd.sh): fix bug #297 (don't kill grep and init script invocations).
+
+2000-08-01 04:45 mslifcak
+
+ Fix bug found by Yigal Hochberg <hochberg@dmhsoftware.com>
+
+2000-08-01 03:30 daves
+
+ - (agent/snmp_vars.c): Fix building of complete OID
+ (work with the name originally registered,
+ not any subsequent division boundaries)
+
+2000-07-31 20:09 mslifcak
+
+ Remove duplicate fopen from shell_command.
+
+2000-07-31 18:58 mslifcak
+
+ (TESTCONF.sh.in) - set MIBDIRS to sibling of the testing directory.
+ (RUNTESTS) - allow binaries to be in the "-D bindir" directory.
+
+2000-07-31 15:25 mslifcak
+
+ Dont adjust PATH if SNMP_PATH is set.
+ Dont add port spec to SNMP_FLAGS if one is already specified.
+
+2000-07-31 13:49 mslifcak
+
+ Remove test directories for skipped tests.
+ Keep test directories for failed tests.
+ Keep test directories for passed tests when "RUNTESTS -s" is specified.
+ Search config.h at the root of the build tree.
+
+2000-07-31 11:32 mslifcak
+
+ Merge from automake-1.4: Add for Rhapsody, OpenStep, Cray-T3, SX-4, SX-5
+
+2000-07-31 11:31 mslifcak
+
+ Merge from automake-1.4: Add for Rhapsody, OpenStep
+
+2000-07-30 17:38 hardaker
+
+ - (snmpNotifyTable.c, snmpNotifyTable.h, target.c, target.h):
+ - implement untested filtering function callback for target searches.
+ - delete unused function.
+ - misc warning fixes.
+
+2000-07-30 17:07 hardaker
+
+ - (snmpNotifyFilterProfileTable.c, snmpNotifyFilterProfileTable.h,
+ snmpNotifyFilterTable.c, snmpNotifyFilterTable.h):
+ - more notification table implementations for filtering.
+ - Framework complete, functionality is not.
+
+2000-07-30 17:05 hardaker
+
+ - (header_complex.c, header_complex.h):
+ - handle implied objects.
+ - implement header_complex_get() for simple data retrievals.
+
+2000-07-28 06:15 mslifcak
+
+ Cleanup include headers to fix bug #307. Thanks to sandven@research.att.com.
+
+2000-07-27 15:19 hardaker
+
+ - (configure, configure.in): Patch from Vinay Mohta:
+ - access_hosts() requires an argument so fake one.
+
+2000-07-27 15:00 hardaker
+
+ - (interfaces.c): Patch from Mattias Barthel:
+ - fix for interfaces without an attached IP address.
+
+2000-07-27 14:55 hardaker
+
+ - (vmstat_solaris2.c, vmstat_solaris2.h): Patch from Jochen Kmietsch:
+ - support raw values.
+
+2000-07-27 08:25 hardaker
+
+ - (snmpusm.c): print errors to stderr.
+
+2000-07-27 06:20 nba
+
+ - parse.c: Fix a missing initization when one MIB holds MODULE-COMPLIANCE
+ for another
+
+2000-07-27 01:35 nba
+
+ - snmp_api.c: Fix pdu->community being overwritten with session->community
+ Thanks to Dana P. Cook <dcook@cabletron.com>
+
+2000-07-26 22:28 mslifcak
+
+ Update for win32 build: remove unused variables and unpublished method.
+
+2000-07-26 08:53 hardaker
+
+ - (mib2c.storage.conf): misc changes and improvements.
+
+2000-07-26 08:53 hardaker
+
+ - (tkmib): Patch from Bert Driehuis:
+ - translateObj hack.
+
+2000-07-26 08:49 hardaker
+
+ - (tkmib): Patch from Bert Driehuis:
+ - remove beginning newline in description clauses.
+
+2000-07-21 14:00 hardaker
+
+ - (setupdb, snmptosql): only delete history rows once every hour or so.
+ - too CPU intensive for large tables.
+
+2000-07-21 12:59 hardaker
+
+ - (setupdb, snmptosql): record and display sysUpTime and others.
+
+2000-07-21 12:57 hardaker
+
+ - (manager.pm): graphing works again.
+
+2000-07-21 12:57 hardaker
+
+ - (displaytable.pm): comments, legends, and max/min work again.
+
+2000-07-17 11:00 hardaker
+
+ - (vmstat_solaris2.h): config_require kernel_sunos5.
+
+2000-07-12 09:29 hardaker
+
+ - (snmpv3.c): copy key length as well as the key when using the same
+ privacy key as the auth key.
+
+2000-07-11 13:34 marz
+
+ added ranges field to SNMP::MIB hash
+
+2000-07-11 10:05 hardaker
+
+ - (mib.c): Patch from Robert Story:
+ - make null PREFIX variable possible so non-dot-leading oids are accepted.
+
+2000-07-11 09:22 hardaker
+
+ - (snmp_agent.c, snmptrapd.c, snmp_api.c, snmp_api.h, snmpusm.c, snmpusm.h):
+ - make the session pointers indicate weather or not they are
+ "authoritative", meaning weather they should be learning engineIDs
+ or reporting on them.
+ - pass the received-packet session pointer into snmpv3_parse and
+ usm_proccess_in_msg() to use this flag.
+ - set isAuthoratative = true in the agent, and unknown in the snmptrapd.
+
+2000-07-11 08:32 hardaker
+
+ - (snmpv3.c): make the createUser token accept an engineid (-e ARG) to use.
+
+2000-07-07 01:37 daves
+
+ - (mibII/interfaces.c): Recognise Token Ring interfaces under Linux
+
+2000-07-06 17:19 hardaker
+
+ - (read_config.c): print generic strings when saving persistent data
+ where possible. (IE, check for printable characters before printing hex).
+
+2000-07-06 17:05 hardaker
+
+ - (TESTCONF.sh, TESTCONF.sh.in): moved TESTCONF.sh to TESTCONF.sh.in
+ and have the MIBS path variable built by configure since it knows
+ where the root level source directory is.
+
+2000-07-06 17:04 hardaker
+
+ - (configure, configure.in, header_complex.c, snmpNotifyTable.c,
+ asn1.h, snmp_api.c):
+ - implement IMPLIED index handling.
+ - make the created USM entries set the storageType and RowStatus
+ appropriately.
+
+2000-07-06 17:02 hardaker
+
+ - (snmp_api.h): better comments on a couple of function definitions.
+
+2000-07-05 07:50 mslifcak
+
+ fix (BUG#290) gracefully handle some PDUs that have no variables.
+
+2000-07-05 06:46 mslifcak
+
+ [no log message]
+
+2000-07-04 10:21 hardaker
+
+ - (snmp_vars.c, snmptrapd.c, snmp_api.c, snmp_api.h, snmpusm.c, snmpusm.h):
+ - remove last remnants of the "initial" user.
+ - make engineid reports from the usm happen based on the report flag
+ in the message flag.
+ - Note: this is a big issue with the SNMPv3 protocol specs. The
+ specifications note that you send a report if you are
+ "authoritative", but don't describe how to know if you are
+ authoritative or not. For situations like proxies and
+ notification receivers, where you are sometimes authoritative
+ and other times you're not, this is problematic. The SNMPv3
+ ASIs do not pass in enough information to determine this and the
+ WG has proclaimed that the ASIs are not meant to be used as an
+ API, but the initial work done by NAI and TISLabs attempted to
+ implement the USM such that it would be a "reference" release
+ and hence we followed the specifications to the letter and used
+ the ASIs as APIs just to see if we could. We could previously
+ only because we were always either authoritative or
+ non-authoritative. Since beginning to work on proxy and the
+ notification mib, this is no longer possible. For the record, I
+ am hereby changing the initial reference release in such a
+ manner as it no longer conforms exactly to the SNMPv3 ASIs. So
+ as not to confuse anyone, this is an entirely theoretical issue
+ with respect to the SNMPv3 specification and is perfectly legal
+ to do. Though I could easily go on, I'll step off my soap box now.
+
+2000-07-03 10:10 hardaker
+
+ - (agent_callbacks.h, agent_trap.c, agent_trap.h, snmpNotifyTable.c,
+ snmpTargetAddrEntry.c, snmpTargetAddrEntry.h,
+ snmpTargetParamsEntry.c, snmpTargetParamsEntry.h, target.c):
+ - Add a new callback for sending traps.
+ - Make the notification mib use it.
+ - make the target mib generate more persistent sessions.
+ - Make the notification mib always ask the target mib for a session
+ list, which is now cached directly by the target mib.
+
+2000-07-03 08:38 mslifcak
+
+ fix (BUG#262) - (some) statements that cannot be reached.
+
+2000-07-03 07:55 mslifcak
+
+ fix (BUG#287)
+
+2000-07-03 06:11 mslifcak
+
+ fix bug # 289
+
+2000-06-30 04:45 mslifcak
+
+ simplify memory allocation in read_config_read_{octet_string, objid}
+
+2000-06-30 00:47 nba
+
+ - read_config.c: Fix a missing initialization for keywords without help
+
+2000-06-28 23:37 nba
+
+ - IF-MIB.txt: upgrade to RFC 2863
+
+2000-06-28 00:58 nba
+
+ - interfaces.c, configure: Irix 6.5 has ifi_baudrate.ifs_value
+
+2000-06-27 01:34 nba
+
+ - main.c: better option parsing.
+
+2000-06-27 01:34 nba
+
+ - snmpv3.c: do case insensitive matching of option values.
+
+2000-06-27 00:33 nba
+
+ - snmptranslate.1: document that -w is also for -Td
+
+2000-06-27 00:30 nba
+
+ - various man page nit-picking
+
+2000-06-27 00:28 nba
+
+ - snmptable.c: fixes and usage message for -Ch and -CH
+
+2000-06-26 23:43 nba
+
+ - Makefile.in, *MIB.txt: update to current RFC version
+
+2000-06-26 23:42 nba
+
+ - Makefile.mib, mibfetch, smistrip: tools to extract MIBs from RFC
+ documents.
+
+2000-06-26 23:40 nba
+
+ - parse.c, mib.[ch], snmptranslate.c: add parsing of CHOICE and checks for
+ OBJECT-GROUP and AGENT-CAPABILITIES. This allows us to parse
+ complete MIB extracts from RFC documents.
+
+2000-06-26 23:38 nba
+
+ - Makefile.top: make libtool silent, so we can see those warnings
+
+2000-06-26 23:37 nba
+
+ - snmpTargetAddrEntry.c: do a cast to kill a warning
+
+2000-06-26 23:32 nba
+
+ - agent_trap.c: Fix a leak when request is blocked by VACM and no trap
+ is sent.
+
+2000-06-26 11:56 mslifcak
+
+ fix (BUG#233)
+
+2000-06-23 06:42 mslifcak
+
+ replace malloc/memset 0 with calloc.
+
+2000-06-23 01:08 daves
+
+ - (mibII/kernel_linux.[ch], mibII/ip.c): Added support for ipRoutingDiscards
+ (Thanks to Bryan Blackman)
+
+2000-06-22 17:09 mslifcak
+
+ remove extra include errormib.h
+
+2000-06-22 16:50 mslifcak
+
+ Fix bug #276 - close most file descriptors before exec'ing command.
+
+2000-06-22 15:59 mslifcak
+
+ fgets: use sizeof(buf) in lieu of compiler constant STRMAX.
+
+2000-06-22 15:53 mslifcak
+
+ Use fewer large static buffers. pass_persist uses bigger buffers now.
+
+2000-06-21 14:59 hardaker
+
+ - (manager.pm, snmptosql): record and report sysUpTime.
+
+2000-06-21 14:31 hardaker
+
+ - (snmptosql): minor sql caching speed optimizations.
+
+2000-06-21 13:33 hardaker
+
+ - (snmptosql): Ack. Don't delete stuff from the history table that frequently.
+
+2000-06-21 12:51 hardaker
+
+ - (snmptosql): better error description support.
+
+2000-06-21 12:46 hardaker
+
+ - (manager.pm, snmptosql): collect sysDescr, sysObjectId, & versionTag.
+
+2000-06-21 12:46 hardaker
+
+ - (displaytable.pm): add -selectorder.
+
+2000-06-21 12:25 hardaker
+
+ - (snmpNotifyTable.c): Uh, only if not deleted.
+
+2000-06-21 12:23 hardaker
+
+ - (snmpNotifyTable.c): change createAndGo/createAndWait states to active/NIS.
+
+2000-06-20 20:01 mslifcak
+
+ Declare top_builddir to avoid annoying /libtool not found message.
+
+2000-06-20 17:30 mslifcak
+
+ Dont assume ANSI C-preprocessor (replace "##" concatenation with sprintf).
+
+2000-06-20 15:37 mslifcak
+
+ Win32 MS-VC++ build fixups.
+
+2000-06-20 15:37 mslifcak
+
+ Encapsulate local variable "x" to the scope where needed.
+
+2000-06-20 15:36 mslifcak
+
+ Remove unused var "newvar".
+
+2000-06-20 15:36 mslifcak
+
+ Use int vs ulong for array indexing variables to avoid signed/unsigned mismatch.
+
+2000-06-20 15:34 mslifcak
+
+ Remove unused vars struct tm, time_t.
+
+2000-06-20 15:34 mslifcak
+
+ Remove unused var "initlist".
+
+2000-06-20 15:33 mslifcak
+
+ Declare strncasecmp in system.h ; Remove unused var "status".
+
+2000-06-20 15:31 mslifcak
+
+ Remove unused vars.
+
+2000-06-20 15:30 mslifcak
+
+ Declare optarg in getopt.h.
+
+2000-06-20 14:00 hardaker
+
+ - (mib2c.storage.conf): misc minor changes.
+
+2000-06-20 13:59 hardaker
+
+ - (.cvsignore, snmpNotifyTable.c, snmpNotifyTable.h):
+ - SNMP-NOTIFICATION-MIB's snmpNotifyTable implemented:
+ - uses the SNMP-TARGET-MIB to get its addresses from.
+ - uses header_complex to handle the data.
+ - much todo:
+ - dynamic target/notification mib updating without kill -HUP needed.
+ - this will be a real pain.
+ - fix v3 related traps still (same usm bug I've been meaning to fix).
+ - the rest of the SNMP-NOTIFICATION-MIB tables.
+
+2000-06-20 13:53 hardaker
+
+ - (snmpTargetAddrEntry.c, snmpTargetAddrEntry.h,
+ snmpTargetParamsEntry.c, snmpTargetParamsEntry.h):
+ - generic target session creation
+ - misc other minor fixes.
+
+2000-06-20 13:51 hardaker
+
+ - (target.h, target.c, target.h): generic target session creation
+ based on entries in the SNMP-TARGET-MIB table.
+
+2000-06-20 13:50 hardaker
+
+ - (header_complex.c): remove Michael's horriblely wrong "fixes".
+
+2000-06-20 13:48 hardaker
+
+ - (agent_trap.c, agent_trap.h): add remove_trap_session().
+
+2000-06-20 13:46 hardaker
+
+ - (read_config.c): deal with 0-length persistent strings better.
+
+2000-06-19 12:32 mslifcak
+
+ Check more alloc failures.
+
+2000-06-19 12:15 mslifcak
+
+ (protocol.c) Use sizeof(oid), not 4!
+ (client.c) Add _all_ of OID value for agentx_register and agentx_unregister.
+
+2000-06-19 11:41 mslifcak
+
+ Removed sizeof(u_char) and unnecessary (unsigned) casts to malloc params.
+
+2000-06-19 03:04 nba
+
+ Prototype fixup.
+
+2000-06-19 03:01 nba
+
+ s/conifg/config/ .... Hrrrmmmpf
+
+2000-06-19 02:58 nba
+
+ - makenosysdepend.pl Makefile.in: object files are now named .lo ...
+
+2000-06-16 16:01 hardaker
+
+ - (snmpTargetAddrEntry.h): add the SNMPv2-TM mib to the default list.
+
+2000-06-16 16:01 hardaker
+
+ - (snmpTargetAddrEntry.c, snmpTargetParamsEntry.c): fix incorrect OIDs.
+
+2000-06-15 06:45 marz
+
+ fat fingers
+
+2000-06-15 06:42 marz
+
+ add defaults to daemon search path...recalc t/snmptest.cmd everytime per makefile.PL is run
+
+2000-06-14 16:15 hardaker
+
+ - (manager.pm): fix user preferences. Columns are optionally
+ displayable again.
+
+2000-06-14 16:15 hardaker
+
+ - (snmptosql): fix history deletion.
+
+2000-06-12 16:43 hardaker
+
+ - (snmpd.conf.5.def): document trapsess.
+
+2000-06-12 16:39 hardaker
+
+ - (agent_read_config.c, agent_trap.c, agent_trap.h):
+ - new snmpd.conf token for trap sessions: "trapsess".
+ - uses snmp_parse_args so any type of trap can be sent with it
+ modified by any of the parameters that are documented in snmpcmd(1).
+ - v3 traps don't work due to the same USM problems found in the
+ recent proxy submissions (my next target).
+ - -Ci in the argument specifies informs should be used.
+
+2000-06-12 16:18 hardaker
+
+ - (master_request.c): re-enable freeing of master request.
+
+2000-06-12 16:17 hardaker
+
+ - (acconfig.h, config.h.in): save exec data to /var/ucd-snmp.
+ - could cause problems for non-root runs. Untested.
+
+2000-06-12 14:12 hardaker
+
+ - (snmptrapd_log.c): Patch from Markku Laukkanen:
+ - remove ending commas in enum list.
+
+2000-06-12 10:36 hardaker
+
+ - (setupdb, setupuser, snmptosql): use "Table"s instead of "Entry"s.
+
+2000-06-12 10:33 hardaker
+
+ - (manager.pm): save mib descriptions for display purposes (again).
+
+2000-06-12 10:29 hardaker
+
+ - (manager.pm): remove debugging statements.
+
+2000-06-12 10:27 hardaker
+
+ - (manager.pm): properly sort displayed table columns again.
+
+2000-06-07 13:23 hardaker
+
+ - (snmp_config.5.def, read_config.c, read_config.h):
+ - the TYPE.conf parser now accepts tokens from a different .conf
+ file TYPE if a special "[TYPE]" keyword is inserted into the
+ .conf file. See snmp_config(5) for a better description.
+
+2000-06-07 13:22 hardaker
+
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - map strtoul to atoi if the function isn't found.
+
+2000-06-06 14:26 hardaker
+
+ - (INSTALL, green.gif, manager.pm, red.gif, setupauth, setupdb,
+ setupnewhost, setupuser, snmptosql, snmptosqltable, sqltohtml):
+ - management cleanup and installation instructions written.
+ - should be mostly complete (ie, barely functional) for the alpha testers.
+
+2000-06-06 08:03 hardaker
+
+ - (snmptosql): host name changes -> varchar(64)
+
+2000-06-06 08:02 hardaker
+
+ - (manager.pm): many minor fixes and changes.
+
+2000-06-06 08:02 hardaker
+
+ - (displaytable.pm): allow table title setting.
+
+2000-06-02 11:41 hardaker
+
+ - (.cvsignore): add *.made.
+
+2000-06-02 11:40 hardaker
+
+ - (Makefile.in, fixproc, ipf-mod.pl, mib2c, tkmib):
+ - make (and install) perl scripts differently, without modifying the orig.
+
+2000-06-01 16:47 hardaker
+
+ - (snmptosql): typos.
+
+2000-06-01 16:44 hardaker
+
+ - (snmptosql):
+ - debugging to STDERR.
+ - auto deletion of old historical data.
+
+2000-06-01 16:44 hardaker
+
+ - (manager.pm): beginnings of a nicer real interface.
+
+2000-06-01 16:43 hardaker
+
+ - (getValues.pm): some variables were global and hence persistent and
+ were messing things up.
+
+2000-06-01 14:48 hardaker
+
+ - (snmpd.c): store persistent data immediately after init'ing to
+ ensure we update counters and stuff that must change (eg, engineBoots).
+
+2000-05-31 16:22 hardaker
+
+ - (snmpd.1.def): describe -I.
+
+2000-05-31 15:52 hardaker
+
+ - (configure, configure.in, mib_modules.c, mib_modules.h, snmpd.c):
+ - new -I switch to snmpd to do dynamic determinaton of which mib
+ modules to initialize (and hence which mib tree sections to support).
+
+2000-05-31 15:50 hardaker
+
+ - (default_store.c, default_store.h): default store routines for void pointers.
+ - which I immediately decided to do something different for what I
+ originally implemented it for, so its not being used yet.
+
+2000-05-31 05:59 daves
+
+ - (mibII/ip.[ch]): Allow IP support without the At/ipNetToMedia module
+
+2000-05-30 17:11 hardaker
+
+ - (proxy.c, proxy.h): simple proxy support.
+ - maps one oid inside the agent to a possibly-different oid on a target.
+ - uses snmp_parse_args() so it takes standard command line config options.
+ - no set support.
+ - no kill -HUP support.
+ - no SNMPv3 support (sigh).
+
+2000-05-30 15:06 nba
+
+ file IANA-LANGUAGE-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-05-30 15:06 nba
+
+ file IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-05-30 15:06 nba
+
+ file DISMAN-SCHEDULE-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-05-30 15:06 nba
+
+ file AGENTX-MIB.txt was initially added on branch V4-1-1-patches.
+
+2000-05-30 07:47 mslifcak
+
+ Fix problem identified by V. Grenet : new method snmp_oid_min_compare
+
+2000-05-30 01:31 nba
+
+ file mibfetch was initially added on branch V4-1-1-patches.
+
+2000-05-30 01:31 nba
+
+ file smistrip was initially added on branch V4-1-1-patches.
+
+2000-05-30 01:31 nba
+
+ file Makefile.mib was initially added on branch V4-1-1-patches.
+
+2000-05-26 09:24 daves
+
+ - (mibII/sysORTable.c mibII/system_mib.c):
+ - Use new time utility routines to simplify processing
+ - Update sysORLastChange when adding/removing entries
+
+2000-05-26 09:23 daves
+
+ - (util_funcs.[ch]): New time-diff utility routines
+
+2000-05-26 08:46 daves
+
+ - (snmpd.c snmp_agent.c mibII/var_route.c): Use 'mibincl.h' header
+
+2000-05-26 07:48 daves
+
+ - (agent_registry.[ch] agentx/client.[ch]
+ agentx/master_request.c agentx/subagent.c):
+ - Support for MIB region timeouts
+
+2000-05-26 07:46 daves
+
+ - (snmp.h snmp_api.c snmp_client.c): Support for per-request timeout handling
+
+2000-05-26 07:45 daves
+
+ - (agentx/protocol.c): Minor error in AgentX packet dump
+
+2000-05-25 10:07 hardaker
+
+ - (memory.c): Patch from Ragnar Kjॆआà¤rstad:
+ - fixed linux problem: wrong params getting returned.
+
+2000-05-25 05:38 mslifcak
+
+ Fix use of bin2asc to not always show "string"; use snmp_oid_compare, too.
+ See bug #234 for details.
+
+2000-05-25 03:39 daves
+
+ - (mibII/interfaces.c): Consolidate header handling.
+
+2000-05-25 03:31 daves
+
+ - (mibII/interfaces.c): Correct confusing comment
+
+2000-05-25 01:53 daves
+
+ - (configure.in configure): Replace use of 'cut' with equivalent 'sed' calls
+
+2000-05-25 01:30 daves
+
+ - (configure.in aclocal.m4 configure):
+ - Direct certain checks to the appropriate file descriptor (see BUG#247)
+
+2000-05-22 16:22 hardaker
+
+ - (apps/.cvsignore): add more stuff to ignore.
+
+2000-05-22 16:21 hardaker
+
+ - (Makefile.in, snmp_parse_args.c, snmp_parse_args.h, snmpbulkget.c,
+ snmpbulkwalk.c, snmpdelta.c, snmpdf.c, snmpget.c, snmpgetnext.c,
+ snmpset.c, snmpstatus.c, snmptable.c, snmptest.c, snmptrap.c,
+ snmpusm.c, snmpvacm.c, snmpwalk.c, Makefile.in, snmp_parse_args.c,
+ snmp_parse_args.h):
+ - moved snmp_parse_args to the library, as I promised to do ages ago.
+ - no longer calls usage() directly, but returns -1 if you should.
+
+2000-05-22 05:47 daves
+
+ - (snmplib/tools.[ch]): Routine for comparing two markers.
+
+2000-05-22 05:42 daves
+
+ - (local/mib2c): Generate multiple tables in one code file
+
+2000-05-17 10:28 hardaker
+
+ - (vacm_vars.c, vacm_vars.h, vacm.c, vacm.h): Patch from Arne Oesleboe:
+ - writable vacm mib support.
+ - other misc vacm fixes.
+
+2000-05-17 10:26 hardaker
+
+ - (snmpusm.c): Patch from Arne Oesleboe:
+ - Don't segfault on an unknown command, instead print a warning..
+
+2000-05-17 10:25 hardaker
+
+ - (snmpvacm.c): Patch from Arne Oesleboe:
+ - added a new command: snmpvacm.
+
+2000-05-17 09:25 hardaker
+
+ - (agent_read_config.c): mention the port number on the trapsink help line.
+
+2000-05-17 09:20 hardaker
+
+ - (snmptrapd.c): use standardized buffer sizes
+
+2000-05-17 09:13 hardaker
+
+ - (Makefile.in, snmptrapd.c, snmptrapd_log.c, snmptrapd.8): Patch from
+ Jeff Cours:
+ - customized formatting of trap output.
+
+2000-05-17 09:11 hardaker
+
+ - (README): add Jeff and Arne.
+
+2000-05-17 08:15 hardaker
+
+ - (mib.c): *correctly* associate escapeQuotes with the right default_store bool.
+
+2000-05-17 08:11 hardaker
+
+ - (snmp.conf.5.def): document escapeQuotes.
+
+2000-05-17 08:09 hardaker
+
+ - (snmpcmd.1, default_store.h, mib.c): new option -OE:
+ - shell backslash escape quotations marks for cutting and pasting
+ onto another snmp command line.
+
+2000-05-15 09:24 daves
+
+ - (mibII/{ip,icmp,tcp,udp,kernel_linux}.[ch]):
+ - Pull Linux MIB-II statistics gathering into a single routine.
+ - Cache MIB-II statistics on all architectures.
+
+2000-05-15 08:53 hardaker
+
+ - (ucd_snmp.h, vmstat_bsdi4.c, vmstat_bsdi4.h): Patch from Bert Driehuis:
+ - vmstat support for bsdi4.
+
+2000-05-15 03:06 daves
+
+ - (snmp_agent.c): Re-remove redundant PDU clone
+ (It reappeared during a recent change)
+
+2000-05-15 03:00 daves
+
+ - (agent_registry.[ch] agentx/master_admin.c): Implement missing routine 'unregister_mib_context'
+
+ - (agent_registry.[ch] agent_index.[ch]): Move 'fd' registry handling back to agent_registry
+
+ - (agentx/client.c): Recognise new code file for index handling
+
+2000-05-12 10:15 hardaker
+
+ - (snmp_agent.c): Um, default to port 161. Opps.
+
+2000-05-12 09:00 daves
+
+ - (agent_registry.[ch] var_struct.h agentx/master_admin.c):
+ - Preparation for per-MIB region timeout, and context support
+
+2000-05-12 08:45 daves
+
+ - (kernel_sunos5.c): Recognise Solaris ATM LAN Emulation interfaces
+ Thanks to Jay Young
+
+2000-05-12 08:13 daves
+
+ - (agent_index.[ch] agent_registry.[ch] Makefile.in agentx/master_admin.c):
+ - Split index handling out from the MIB registry.
+
+2000-05-12 07:02 daves
+
+ - (kernel_sunos5.c): Add support for recognising QuadFastEther interface
+
+2000-05-12 06:57 daves
+
+ - (apps/snmptable.c): Fix problem with missing separator (with -Ci -Cf)
+ Thanks to Xavier FOURNET
+
+2000-05-12 04:02 daves
+
+ - (snmp_agent.c): Remove redundant PDU clone
+ I'm sure this was put in for a reason, but I can't remember what.
+ It doesn't seem to be needed now, and just leaks memory.
+ Here's hoping.....
+
+2000-05-12 03:11 daves
+
+ - (agent/snmpd.c): Catch (and ignore) SIGPIPE signals.
+ Disappearing subagents therefor appear as normal I/O failures
+
+2000-05-12 02:24 daves
+
+ - (agentx/protocol.c):
+ - Implement opaque-encoded float & double types
+ - Bring packet dump in line with the main library style
+ - Add packet dump capability for outgoing PDUs
+
+2000-05-10 16:52 hardaker
+
+ - (snmpd.1.def): document -p.
+
+2000-05-10 16:43 hardaker
+
+ - (snmp_agent.c): always use the default transport mapping, not the last one.
+
+2000-05-10 16:25 hardaker
+
+ - (ds_agent.h, snmp_agent.c, snmpd.c): implement multiple transport
+ mappings via -p [transport:]port[@address].
+
+2000-05-10 11:08 mslifcak
+
+ fix udpstat --> tcpstat
+
+2000-05-10 07:59 daves
+
+ - (agentx/master_request, agentx/master_admin.c):
+ - Handle subagent disappearing without warning
+
+2000-05-10 07:57 daves
+
+ - (agent/snmp_agent.c snmplib/snmp_api.h):
+ - Provide a mechanism to handle asynchronous send failures.
+
+2000-05-10 06:13 daves
+
+ - (snmp_api.h): Logical NOT? Bitwise NOT? Who'll notice the difference anyway!
+
+2000-05-10 05:34 daves
+
+ - (agentx/master_request.c): Handle non-responsive subagents
+
+2000-05-10 05:33 daves
+
+ - (agent_registry.c mibII/sysORTable.c): Don't assume subsession link is valid
+
+2000-05-10 05:29 daves
+
+ - (snmp_api.h): Definitions for session closedown handling
+
+2000-05-09 14:42 mslifcak
+
+ also clean Win32 binary objects, and core files.
+
+2000-05-09 14:34 mslifcak
+
+ touch up the "clean" rule.
+
+2000-05-09 11:32 mslifcak
+
+ until Dave's version wins, need snmp_varlist_add_variable to build Win32 agent.
+
+2000-05-09 11:31 mslifcak
+
+ fix some Win32 builds (signals? we don't need no steenking signals!)
+
+2000-05-09 11:30 mslifcak
+
+ Remove trailing CR [0x0d] from one line.
+
+2000-05-09 08:50 hardaker
+
+ - (Makefile.top, Makefile.in, Makefile.in): fix link time problems
+ with aCC (or any other unknown compiler).
+
+2000-05-09 08:47 hardaker
+
+ - (Makefile.top, Makefile.in, Makefile.in): fix link time problems
+ with aCC (or any other unknown compiler).
+
+2000-05-09 07:43 daves
+
+ - (agentx/master_request.c): Send out re-delegated requests
+ (and fix a problem with specifying the end-of-range value)
+
+2000-05-09 07:40 daves
+
+ - (agentx/subagent.c): Fix handling of error response generation
+ (by analogy with recent changes to snmp_agent.c)
+
+2000-05-09 07:34 daves
+
+ - (snmp_agent.c): Handle AgentX "end-of-range" indication.
+ (This is not the cleanest way of doing things,
+ but works for now. We can tidy up later).
+
+2000-05-09 07:16 daves
+
+ - (snmp_vars.c): Use MIB registry 'start' values
+ (rather than the original name registered)
+ This handles subsequent part of 'split' ranges properly.
+
+2000-05-08 11:08 hardaker
+
+ - (Makefile.in): I can't believe the last checkin even compiled (luck).
+
+2000-05-08 11:03 hardaker
+
+ - (Makefile.in): fix library list.
+
+2000-05-05 09:56 hardaker
+
+ - (diskio.c): Patch from Bert Driehuis:
+ - disk io support for BSD/OS.
+
+2000-05-05 09:54 hardaker
+
+ - (at.c): Patch from Bert Driehuis:
+ - fix a zero byte malloc bug (mostly noticed with -lefence).
+
+2000-05-05 09:43 hardaker
+
+ - (configure, configure.in): Patch from Albert Chin-A-Young:
+ - --with-libwrap improvements.
+
+2000-05-05 09:00 daves
+
+ - (agentx/subagent.c agentx/master_request.c):
+ - Significant improvements to AgentX processing
+ (Thanks to Reiner Beninga)
+
+2000-05-05 08:58 daves
+
+ - (snmplib/snmp_api.[ch] snmplib/snmp_client.c agent/snmp_agent.[ch]):
+ - Minor changes to assist with AgentX development
+ (These may not be absolutely necessary, but they get things working again!)
+
+2000-05-04 16:21 hardaker
+
+ - (configure, configure.in): minor unimportant --without-openssl fix.
+
+2000-05-04 16:19 hardaker
+
+ - (configure, configure.in): Patch from John L. Villalovos:
+ - allow --without-openssl to work.
+
+2000-05-04 16:15 hardaker
+
+ - (Makefile.in): add the DISMAN-SCRIPT-MIB.txt
+
+2000-05-04 16:01 hardaker
+
+ - (Makefile.in): Patch from Albert Chin-A-Young:
+ - install UCD-DISKIO-MIB.txt.
+
+2000-05-04 15:21 hardaker
+
+ - (displaytable.pm, manager.pm): make purdy graphs with history tables.
+
+2000-05-04 08:26 daves
+
+ - (snmplib/snmp_client.[ch]): New routine 'snmp_clone_varbind()'
+ (From a suggestion by Reiner Beninga)
+
+2000-05-04 08:24 daves
+
+ - (snmplib/snmp_api.c): Various minor fixes
+ (Thanks to Reiner Beninga)
+
+2000-05-04 01:29 daves
+
+ - (snmp_agent.[ch]): Handle index/status information separately from PDU.
+ Also means that delegated requests have access to variable indexes
+ (Based on a suggestion from Reiner Beninga)
+
+2000-05-04 01:00 daves
+
+ - (ucd-snmp/proc.c): Initialize newly malloced structure
+ (Thanks to Jeff Wilson - see BUG #231)
+
+2000-05-03 09:06 daves
+
+ - (snmp_agent.[ch] agentx/master_admin.c):
+ - Clone PDU within init_agent_snmp_session.
+ New routine 'free_agent_snmp_session'
+ (Thanks to Reiner Beninga)
+
+2000-05-03 08:17 daves
+
+ - (snmp_agent.c): When returning an error response,
+ use a clean copy of the original request PDU.
+
+2000-05-03 08:14 daves
+
+ - (snmp_agent.[ch]): Routine to handle variables individually
+ (Thanks to Reiner Beninga)
+
+2000-05-03 04:37 daves
+
+ - (snmp_agent.c): Check accessibility of exact requests before processing
+ (and remove redundant 'generic' SET handling)
+
+2000-05-02 09:56 hardaker
+
+ - (manager.pm): lots of small changes.
+
+2000-05-01 11:34 nba
+
+ - mib.c: fix printing of BITS variables
+
+2000-05-01 06:55 marz
+
+ applied patch from Steve Pheran Snodgrass to fix incompatibility with perl5.6 ref stringification
+
+2000-04-29 07:46 hardaker
+
+ - (config.h.in, configure.in, agent_registry.c): Patch from Frank Strauss:
+ - use sigaction when available.
+
+2000-04-28 16:22 hardaker
+
+ - (snmptosql): fix -m/-M the wrong way.
+
+2000-04-28 16:15 hardaker
+
+ - (snmptosql):
+ - do history saving better (different table).
+ - -m/-M mib loading options (which don't appear to be working right yet).
+
+2000-04-28 07:36 hardaker
+
+ - (agent_registry.c, snmpd.c): Patch from Frank Strauss:
+ - fix signal handling.
+
+2000-04-27 14:58 hardaker
+
+ - (Makefile.in, snmpdf.c): implement a remote df command via snmp
+ - (needs the host resources mib working on the remote system).
+
+2000-04-27 10:57 hardaker
+
+ - (Makefile.top, config.h.in, configure, configure.in): rpm is now
+ requiring yet another library: libpopt.
+
+2000-04-26 15:20 hardaker
+
+ - (Makefile.top): run libtool --finish without -n (go ahead and do the cmds)
+
+2000-04-26 15:19 hardaker
+
+ - (Makefile.top, configure, configure.in, agent/Makefile.in):
+ - more libtool fixes (.so versioning, properly install...)
+
+2000-04-26 14:18 hardaker
+
+ - (*/.cvsignore, */Makefile.in, Makefile.top, aclocal.m4, configure,
+ configure.in, ltconfig, ltmain.sh):
+ - use libtool for building.
+ - Certainly, I must have broke something in the process. (make depend, eg)
+
+2000-04-26 14:15 hardaker
+
+ - (*/.cvsignore, */Makefile.in, Makefile.top, aclocal.m4, configure,
+ configure.in, ltconfig, ltmain.sh):
+ - use libtool for building.
+ - Certainly, I must have broke something in the process. (make depend, eg)
+
+2000-04-26 08:11 hardaker
+
+ - (FAQ): new secondary slogan.
+
+2000-04-26 07:22 hardaker
+
+ - (snmp_api.c, snmpusm.c): Attempt to parse the PDU when a report is
+ being sent so that the requestid can be used in the outgoing report.
+ This should fix a problem where SNMP Research's Emante agent is
+ doing engineID discovery probes based on the request_id (which is a
+ fairly poor choice as the message_id would be a better one to match
+ on in general and is the only possible thing to use in cases where
+ the report is encrypted).
+
+2000-04-25 13:08 hardaker
+
+ - (FAQ): mention that the perl module is included with the source.
+
+2000-04-25 08:24 hardaker
+
+ - (snmp_api.c): misc -Ddump fixes.
+
+2000-04-25 08:02 hardaker
+
+ - (snmptable.c): check for end of mib view exceptions (v2c, v3).
+
+2000-04-24 11:27 hardaker
+
+ - (snmp_api.c): -D support for those "older" protocols that shouldn't
+ be used anymore (v1, v2c).
+
+2000-04-24 10:36 hardaker
+
+ - (asn1.c, default_store.h, mib.c, snmp.c, snmp_api.c, snmp_auth.c,
+ snmp_debug.c, snmp_debug.h, snmpusm.c):
+ - timestamps can be printed as a numeric number only (-Ot).
+ - more configurable packet dumping code for both send and receive.
+ - uses new -D tokens: dumph (headers), dumpx (hex), dumpv
+ (values). dumpx_ and dumpv_ (note the _s) make it eat space
+ (and newline) before the segment in question. Try -Ddump then
+ -Ddumph,dumpv_ to see examples.
+ - todo:
+ - better horizontally formated information (probably using "%NUMs").
+ - USM is called after pdu building (makes sense but is backwards
+ visually in the dumped packet).
+ - option to strip datatype token (ie Integer:).
+
+2000-04-24 09:37 hardaker
+
+ - (version.h bug-report sedscript.in): version tag ( 4.2.pre0 )
+
+2000-04-24 09:13 hardaker
+
+ - (version.h bug-report sedscript.in): version tag ( EXT.4.2.pre0 )
+
+2000-04-21 14:13 hardaker
+
+ - (snmpwalk.c): fix GET call for an snmpwalk. (was using a GETNEXT PDU, ack).
+
+2000-04-21 10:41 hardaker
+
+ - (snmpv3.c): more u_long -> size_t for engineID len.
+
+2000-04-21 08:18 hardaker
+
+ - (mib.c): fix fprint_description to check for null subtrees.
+
+2000-04-21 08:17 hardaker
+
+ - (snmpv3.c, snmpv3.h): use size_t for engineid lengths.
+
+2000-04-19 11:02 marz
+
+ changed mode_t typedef to agree with what ActiveState perl uses (anyone have a problem with this?)
+
+2000-04-19 10:59 marz
+
+ added Marc Lehman patch to ensure alloc/dealloc use same mechanism (perl vs. system default)
+
+2000-04-19 08:26 hardaker
+
+ - (snmp_agent.c): agent_check_and_process() always block if caller requested it.
+
+2000-04-19 04:34 mslifcak
+
+ move static decl to .c;minor casting about to support aCC
+
+2000-04-18 11:11 mslifcak
+
+ Synch devel branch with patches branch.
+
+2000-04-18 11:07 mslifcak
+
+ Define optarg for apps use; Define vacm_is_configured for agent use.
+
+2000-04-18 07:57 hardaker
+
+ - (vmstat.c, vmstat.h, UCD-SNMP-MIB.txt): Patch from Mizuki Honda:
+ - implement raw cpu usage numbers.
+
+2000-04-18 03:18 daves
+
+ - (man/snmptable.1 apps/snmptable.c):
+ - Command-specific '-C' options for snmptable
+
+2000-04-18 02:01 daves
+
+ - (apps/snmp_parse_args.c): Handle previous form of -Z option as well
+
+2000-04-17 15:36 hardaker
+
+ - (snmp_parse_args.c): fix -Z if args are wrong.
+
+2000-04-17 15:32 hardaker
+
+ - (snmp_parse_args.c, snmpcmd.1): fix -Z to use a ','.
+
+2000-04-17 15:06 hardaker
+
+ - (mta_sendmail.c, mta_sendmail.h): Patch from Christoph Mammitzsch:
+ - update on the sendmail module.
+
+2000-04-17 15:00 hardaker
+
+ - (vmstat.c): Patch from John L. Villalovos:
+ - fix ssCpuSystem, ssCpuUser, ssCpuIdle.
+
+2000-04-17 14:18 hardaker
+
+ - (Makefile.top, Makefile.in): properly use LN_S for linking snmpinform.
+
+2000-04-17 13:45 hardaker
+
+ - (snmpusm.c, snmpv3.c, snmpv3.h): engineID changes for better aCC support.
+
+2000-04-17 13:44 hardaker
+
+ - (.cvsignore): ignore snmpinform.
+
+2000-04-17 09:58 hardaker
+
+ - (snmp_agent.c): fix row creation.
+
+2000-04-17 07:25 daves
+
+ - (auto_nlist.c snmpd.c agentx/master.c): Don't exit on failure with '-r'
+
+2000-04-14 15:07 hardaker
+
+ - (snmp_parse_args.c, snmpdelta.c, snmpget.c, snmpgetnext.c,
+ snmpstatus.c, snmpcmd.1, snmpget.1, default_store.h, mib.c):
+ - move -If to -Cf and invert behaviour.
+
+2000-04-14 15:06 hardaker
+
+ - (configure, configure.in): remove debugging output (opps).
+
+2000-04-14 09:03 hardaker
+
+ - (versioinfo.c): alright. Who made versionClearCache RONLY?
+
+2000-04-13 05:49 nba
+
+ - snmptranslate.1: decument the -w width option
+
+2000-04-12 12:05 mslifcak
+
+ hide user's hostname; prompt before sending e-mail; prompt to save as file.
+
+2000-04-12 11:22 mslifcak
+
+ fix %f(%s)
+
+2000-04-12 09:29 hardaker
+
+ - (snmpcmd.1): document -If.
+
+2000-04-12 09:17 hardaker
+
+ - (snmp_parse_args.c): put ++ back in that accidentically got checked in.
+
+2000-04-12 09:16 hardaker
+
+ - (snmpset.c): put space back in usage line.
+
+2000-04-12 09:12 hardaker
+
+ - (snmp_parse_args.c, snmpdelta.c, snmpget.c, snmpgetnext.c,
+ snmpset.c, snmpstatus.c, default_store.h, mib.c):
+ - Add a new option -If to specify fixing of PDUs.
+ - Anyone know a better place to put this option?
+ - Applications don't do this by default anymore, and you can't in snmpset.
+
+2000-04-12 07:38 hardaker
+
+ - (vacm_vars.c, vacm.c, vacm.h): fix to allow no v1/v2c requests when
+ configured for just v3.
+
+2000-04-12 06:50 mslifcak
+
+ fix MSVC build for encode_keychange, and add more symbols for release builds
+
+2000-04-12 05:32 nba
+
+ - parse.c: correct parsing of sub-types textual conventions. Allow parsing
+ of MACRO invocations for standard symbols
+
+2000-04-12 05:31 nba
+
+ - parse.[ch], snmptranslate.c: allow specification of with for -Tp
+
+2000-04-12 05:30 nba
+
+ - HOST-RESOURCES-MIB.txt, HOST-RESOURCES-TYPES.txt: align with published
+ RFC 2790
+
+2000-04-11 15:33 hardaker
+
+ - (configure, configure.in): make config_add_mib() actually look for
+ the mib in $srcdir/mibs/blah and install it if found.
+
+2000-04-11 15:21 hardaker
+
+ - (snmpv3.c, snmpv3.h): make macaddr engineid setup not linux
+ specific, but #defines are checked instead.
+
+2000-04-11 15:20 hardaker
+
+ - (snmp_logging.h): remove old callback typedef no longer needed.
+
+2000-04-11 14:38 hardaker
+
+ - (snmpv3.c, snmpv3.h): Patch from John L. Villalovos:
+ - enable engineID to be set from MACAddr.
+
+2000-04-11 09:51 hardaker
+
+ - (mta_sendmail.c, mta_sendmail.h): New module from Christoph Mammitzsch:
+ - implements the MTA-MIB for monitoring sendmail.
+
+2000-04-11 09:50 hardaker
+
+ - (MTA-MIB.txt, NETWORK-SERVICES-MIB.txt): new mibs for new modules.
+
+2000-04-11 03:25 daves
+
+ - (agent/snmp_agent.c): Save/restore original statP value for SET handling.
+
+2000-04-11 02:35 daves
+
+ - (agent/snmp_agent.c): Report failures from ACTION phase of SET correctly.
+
+2000-04-11 01:57 daves
+
+ - (agentx/master_request.c): Dynamically resize subagent requests
+ (Thanks to Reiner Beninga)
+
+2000-04-10 05:08 daves
+
+ - (snmp_agent.c agentx/master_request.c): Fix multi-subagent requests
+ (Thanks to Reiner Beninga)
+
+2000-04-07 12:25 hardaker
+
+ - (snmptrap.c, snmpusm.c):
+ - fix snmpv3 traps to be authoritative from the client side, not the
+ receiver side. snmpv3 informs stay as is. Unfortunately, for
+ command line apps this doesn't make a whole lot of sense but is
+ right in terms of how the protocol works and this is hence
+ somewhat of a hack.
+
+2000-04-07 07:50 daves
+
+ - (agent/snmp_agent.c): Handle v2 exception types in v1 queries
+
+2000-04-07 07:16 hardaker
+
+ - (snmptrapd.c, read_config.c, snmpv3.c):
+ - allow NULL help lines for config directives and use it to hide
+ internal directives used for persistent storage.
+
+2000-04-06 15:31 hardaker
+
+ - (snmp_api.c, snmp_api.h):
+ - turn backwards compatibility macros back into functions so
+ default_store.h dependencies go away again.
+ - create a flag to not probe for engineIDs durning sess_open().
+
+2000-04-06 07:20 daves
+
+ - (snmplib/snmp_api.c): Fix mishandled Counter64 parsing
+
+2000-04-06 03:36 daves
+
+ - (agent/snmpd.c): Fix usage message alignment.
+
+2000-04-06 03:31 daves
+
+ - (man/snmpd.1.def): Document the AgentX socket command-line option
+
+2000-04-05 08:41 hardaker
+
+ - (FAQ2HTML): it's been sitting in my personal src tree for > 2 years.
+
+2000-04-05 08:38 hardaker
+
+ - (mibincl.h, usmUser.c, snmptrapd.c, lcd_time.c, scapi.c, snmp_api.c,
+ snmpusm.c, snmpusm.h, snmpv3.c):
+ - make snmptrapd handle v3 users properly, (and shutdown properly as well).
+ - a more generic user storage routine added to snmpusm.c and used in
+ usmUser.c with a side effect of needing callback.h above snmpusm.h.
+
+2000-04-05 08:27 hardaker
+
+ - (rsnmp): -> /usr/bin/perl
+
+2000-04-05 08:24 hardaker
+
+ - (.cvsignore): misc minor additions to /
+
+2000-04-04 11:03 daves
+
+ - (agent/snmp_agent.c): Ensure unimplemented objects return 'noSuchObject'
+
+2000-04-03 14:57 mslifcak
+
+ Initialize statP.
+
+2000-04-03 09:12 daves
+
+ - (agent/snmp_agent.c): Ensure a v1 SET returns a v1 error status.
+
+2000-04-03 08:32 hardaker
+
+ - (ChangeLog): Year was "100" for 2000 (noticed by Jay Riddell):
+
+2000-04-03 07:53 daves
+
+ - (agent/snmp_agent.c): Ensure SETs fail if one varbind does.
+
+2000-03-31 07:25 daves
+
+ - (agent/snmp_vars.c): Fix to report 'noSuchObject' in certain circumstances
+
+2000-03-31 07:13 daves
+
+ - (snmplib/snmp_api.c): Don't repeat the first four bytes in a PDU dump
+
+2000-03-31 07:04 daves
+
+ - (snmplib/snmp_logging.c): Handle logging empty strings (e.g. a null indent)
+
+2000-03-30 00:15 daves
+
+ - (agent/snmp_agent.c): Initialise timeout structure properly
+ (Thanks to ashipman@erggroup.com)
+
+2000-03-27 10:32 mslifcak
+
+ remove trailing newline from hrSWRunName values.
+
+2000-03-24 09:09 mslifcak
+
+ to sync with patches branch.
+
+2000-03-24 05:07 nba
+
+ - snmptrapd.c: correctly free the reponse if sending it fails
+
+2000-03-24 04:22 mslifcak
+
+ xx_synch_response: avoid freeing PDU twice.
+
+2000-03-23 23:29 nba
+
+ - snmpcmd.1, snmptrap.1, snmptrap.c, Makefile.in: Install and document
+ snmpinform.
+
+2000-03-23 09:58 mslifcak
+
+ Enqueue only complete request_list entry; Reduce scoping of callback vars.
+
+2000-03-23 03:02 nba
+
+ file snmpinform.1 was initially added on branch V4-1-1-patches.
+
+2000-03-22 08:13 mslifcak
+
+ printf ?
+
+2000-03-21 11:12 mslifcak
+
+ modify F. Strauss' patch per N. Baggesen's suggestion: remove export-dynamic.
+
+2000-03-21 09:14 mslifcak
+
+ more smooth sailing with Win32 .DLL . DLLEXPORT, anyone ?
+
+2000-03-21 09:07 mslifcak
+
+ win32 build check: no sigaction, SIGCLD defined.
+
+2000-03-21 08:47 daves
+
+ - (ds_agent.h snmpd.c mibgroup/agentx/{master,subagent}.c):
+ - Command-line option for specifying AgentX port
+ (based on patch from Frank Strauss)
+
+2000-03-21 08:38 daves
+
+ - (snmp_api.c): Support 'host:port' representation of peernames
+
+2000-03-21 04:05 daves
+
+ - (snmp_agent.c): Missing new-line on debug output
+
+2000-03-21 02:52 daves
+
+ - (mibII/{tcp,udp,ip,icmp}*) Continuing mibII code cleanup
+
+2000-03-20 11:14 mslifcak
+
+ Comment -C -- do not use this flag.
+
+2000-03-17 15:32 hardaker
+
+ - (header_complex.c): sizeof(x)*(len+1) not sizeof(x)*len+1
+
+2000-03-16 00:10 nba
+
+ - configure, hr_print.c: detect system printers (SysV/lpstat, *BSD/cgetnext,
+ Linux/printcap)
+
+2000-03-15 18:30 mslifcak
+
+ Second part : all members of struct snmp_index are pointers.
+
+2000-03-15 15:07 mslifcak
+
+ Fix memory leak with unregister_index.
+
+2000-03-15 15:07 mslifcak
+
+ Fix memory leak when cleaning up trap variables.
+
+2000-03-15 08:48 daves
+
+ - (snmp_api.c snmp_client.c): Initialise varbind data hook elsewhere as well.
+
+2000-03-15 07:57 daves
+
+ - (agentx/master_request.c): Fix infinite loop problem when walking subagent.
+
+2000-03-15 06:09 daves
+
+ - (agent/snmp_agent.c): Avoid calling read routine for each SET handling pass.
+ N.B: This hasn't been tested with AgentX subagents yet
+
+2000-03-15 06:07 daves
+
+ - (snmplib/snmp_api.[ch]): Provide hook for internal varbind-related data
+
+2000-03-15 05:22 daves
+
+ - (agent/var_struct.h): Use a single magic number for MIB registry name lengths.
+
+2000-03-15 01:51 daves
+
+ - (snmplib/system.h): Don't declare gettimeofday() if the system provides it.
+ (Fix provided by Ron Mevissen)
+
+2000-03-14 07:57 daves
+
+ - (agent/snmp_agent.c): Don't overwrite saved status when checking access.
+
+2000-03-14 07:52 daves
+
+ - (agent/snmp_agent.c): Return a response, even if the request failed.
+
+2000-03-13 15:32 nba
+
+ - ipfwacc.h: fix the MIB name
+
+2000-03-10 12:48 hardaker
+
+ - (configure): autoconf run
+
+2000-03-10 11:09 hardaker
+
+ - (Makefile.dlmod): Patch from Frank Strauss:
+ - dlmod build Makefile example. Needs incorperation with main configure.
+
+2000-03-10 11:02 hardaker
+
+ - (agent_registry.c): better signal check from Michael Slifcak
+
+2000-03-10 10:59 hardaker
+
+ - (UCD-DLMOD-MIB.txt): typo found by Michael Slifcak.
+
+2000-03-10 10:54 hardaker
+
+ - (dlmod.c, dlmod.h, snmpd.conf.5.def, UCD-DLMOD-MIB.txt): Patch from
+ Frank Strauss:
+ - Reimplementation of the dlmod mib module:
+ o mibgroup/misc/dlmod + dlmods/dlmod_mib -> mibgroup/ucd-snmp/dlmod
+ o fixed registration (ucdavis.ucdExperimental.14 instead of ucdavis.14)
+ o added configure stuff for HAVE_SNPRINTF, which was used by dlmod.c
+ o removed `_dynamic_' prefixes from init/deinit functions
+ o made dlmodIndex not-accessible (only implementation, not definition)
+ o removed the asn_parse_XXX stuff
+ o made entries with state `error' able to accept state `load'
+ o made the wombat example usable as static and dynamic module
+ o added simple config_parse functionality to the wombat example
+
+2000-03-10 10:52 hardaker
+
+ - (agent_registry.c, agent_registry.h, snmpd.c): Patch from Frank Strauss:
+ - signal registry system implemented (needs to be redone allowing
+ multiple callbacks and handlers for all signals).
+ - arbitrary file descriptor/socket registration.
+ - this is not the way it should be done (use sessions instead).
+
+2000-03-10 10:44 hardaker
+
+ - (Makefile.in, Makefile.top, acconfig.h, config.h.in, configure.in,
+ Makefile.in, Makefile.in, Makefile.in, Makefile.in, Makefile.in):
+ Patch from Frank Strauss:
+ - clean up shared library usage.
+
+2000-03-10 10:16 hardaker
+
+ - (config.h.in): autoheader re-arranged some stuff.
+
+2000-03-07 11:58 mslifcak
+
+ more touchups to allow UnixWare build to complete.
+
+2000-03-07 11:21 hardaker
+
+ - (default_store.h): make MAX_SUBIDS larger and a multiple of 8.
+
+2000-03-07 10:13 mslifcak
+
+ Introduce --enable-mini-agent to configure agent (snmpv3, no mibII interfaces).
+
+2000-03-07 09:03 mslifcak
+
+ assume "snmpapp" if no arg passed to init_snmpv3.
+
+2000-03-07 08:58 mslifcak
+
+ remove init_mib() call - not appropriate here.
+
+2000-03-07 08:35 mslifcak
+
+ Let the aix4 patch work.
+
+2000-03-07 07:08 mslifcak
+
+ trim fat from recent check-ins.
+
+2000-03-06 20:01 mslifcak
+
+ cleaned up SCO UnixWare build.
+
+2000-03-06 16:40 mslifcak
+
+ start support for SCO UnixWare 5 as svr5.
+
+2000-03-06 10:56 hardaker
+
+ - (default_store.h, snmp_api.c): Patch from Robert Story:
+ - don't check ranges if not requested.
+
+2000-03-06 10:55 hardaker
+
+ - (snmp_agent.c, snmp_agent.h, snmpd.c): Patch from Robert Story:
+ - fix exit()ing behaviour in the libucdagent library.
+
+2000-03-06 10:36 hardaker
+
+ - (snmptrapd.c): Patch from Robert Story:
+ - -n prints numeric IP addrs.
+
+2000-03-06 10:25 hardaker
+
+ - (callback.h, snmp_logging.c, snmp_logging.h): Idea from ashipman@erggroup.com:
+ - callback function (using callback.h) added for external logging.
+
+2000-03-05 05:25 marz
+
+ fix to preserve trailing multi component instance id's at the end of
+ symbolic mib names(e.g., foo.6.7) when doing translateObj.
+
+2000-03-04 11:34 nba
+
+ - configure.in, configure: support --without-openssl, even if OpenSSL
+ is available
+
+2000-03-04 11:30 nba
+
+ - agent/(various): globalize the kvm_t *kd variable
+
+2000-03-04 11:26 nba
+
+ - mib_modules.c, hr_storage.c: pre-processor # should be in column 1
+
+2000-03-04 11:17 nba
+
+ - inet.c, inet6.c: survive -v 2c exception replies
+
+2000-03-04 11:17 nba
+
+ - snmp_api.c: remove a superfluous & in front of an array
+
+2000-03-04 11:15 nba
+
+ - ucd_snmp.h, {memory,vmstat}_netbsd1.[ch]: support for NetBSD
+
+2000-03-04 11:14 nba
+
+ - hr_disk.c: fixes for NetBSD
+
+2000-03-04 11:10 nba
+
+ - versioninfo.c: don't return the trailing newline
+
+2000-03-04 11:08 nba
+
+ - hr_swrun.c: fix process size for FreeBSD 3 and NetBSD
+
+2000-03-04 11:05 nba
+
+ - agent_trap.h: fix a wrong prototype
+
+2000-03-04 11:04 nba
+
+ - snmptable.c: fix problems printing table name and headers when using
+ -OS format
+
+2000-03-02 11:50 nba
+
+ - snmp_api.c: fix address length info for tcp connect
+
+2000-03-02 11:48 nba
+
+ - loadave.c: fix for AIX 4
+
+2000-03-02 08:30 daves
+
+ - (mib2/ip.[ch] mib2/ipAddr.[ch]): First stab at tidying up mib2 support.
+
+2000-03-01 13:23 hardaker
+
+ - (snmptosql): fix dynamic table testing for creation needed.
+
+2000-03-01 13:22 hardaker
+
+ - (manager.pm, ucd-snmp.pm): Opps. Wrong name. ucd-snmp.pm -> manager.pm.
+
+2000-03-01 13:21 hardaker
+
+ - (ucd-snmp.pm): turned sqltohtml into an apache module. 2x speed improvement.
+
+2000-03-01 08:32 mslifcak
+
+ fix bug 180 for cygwin build with _REENTRANT; per ashipman@erggroup.com
+
+2000-02-29 14:30 mslifcak
+
+ Invoke snmp_sess_send from within snmp_read to avoid mutex deadlocks.
+
+2000-02-28 14:25 nba
+
+ - snmpd.h, smux.c: don't initialize smux master in sub agent
+
+2000-02-28 14:16 nba
+
+ - snmp_vars.c: use SUB_AGENT symbol
+
+2000-02-28 14:12 nba
+
+ - mib.c: sprint_by_type should handle ASN_BIT_STR
+
+2000-02-28 14:10 nba
+
+ - snmp_parse_args.c: correctly call the -I options input options
+
+2000-02-28 10:47 mslifcak
+
+ fix bug #176 (AIX 4 - use knlist in lieu of nlist)
+
+2000-02-24 17:17 mslifcak
+
+ apply patch to fix bug no. 177.
+
+2000-02-24 13:31 hardaker
+
+ - (default_store.h, read_config.c, snmp_api.c): new snmp.conf keyword
+ to force the parser to ignore unknown tokens.
+
+2000-02-24 03:59 mslifcak
+
+ document UNSIGNED32 and COUNTER32 ('u' and 'c') in snmpset (gratis ashipman@erggroup.com)
+
+2000-02-24 03:56 mslifcak
+
+ add support for COUNTER32 to snmp_add_var; document UNSIGNED32 and COUNTER32
+ ('u' and 'c') in snmptrap (gratis ashipman@erggroup.com)
+
+2000-02-23 23:06 nba
+
+ - pass.c, pass_persist.c: fix setting of octet strings.
+
+2000-02-23 02:09 nba
+
+ - mt_support.h: a bad ; in the C++ bracketing
+
+2000-02-23 02:09 nba
+
+ - system.c: remove some superfluous indirections in strcasecmp
+
+2000-02-23 02:07 nba
+
+ - vmstat_solaris.c: make sure we agree with the prototype of getpagesize!
+
+2000-02-22 15:31 nba
+
+ - pass_persist.h: declare init_pass_persist
+
+2000-02-22 09:57 mslifcak
+
+ prune two more symbols not used by auto_nlist for Solaris-built MIB modules.
+
+2000-02-21 16:17 mslifcak
+
+ Apply R. Story's patch for mkdirhier and strncasecmp on win32
+
+2000-02-21 07:39 mslifcak
+
+ fix bug 171 (thanks to Larry Parmelee).
+
+2000-02-21 05:56 mslifcak
+
+ remove free after snmp_close (don't free twice!)
+
+2000-02-21 04:58 mslifcak
+
+ Added description in SH_NAME for several man-pages (c/o ragnark)
+
+2000-02-18 12:14 mslifcak
+
+ refer the .so macro to man3; adjust Makefile.in to use the renamed file.
+
+2000-02-17 05:17 mslifcak
+
+ include pass_persist in the required list.
+
+2000-02-17 02:00 daves
+
+ - (configure* ucd-snmp/vmstat_solaris2.c):
+ - Provide missing 'getpagesize' routine for Solaris 2.4
+ (Thanks to Ragnar Kjॆआà¤rstad)
+
+2000-02-16 20:17 mslifcak
+
+ include mibincl.h in hr_system.c to fix bug #159.
+
+2000-02-16 16:35 mslifcak
+
+ remove auto_nlist of unused "swaplist" symbol.
+
+2000-02-16 15:17 mslifcak
+
+ patch suggested by Rick Beaman <beaman@mediaone.net>
+
+2000-02-16 14:58 mslifcak
+
+ remove unused vars
+
+2000-02-16 14:57 mslifcak
+
+ test lengths before allocating memory; use new VACMSTRINGLEN constant.
+
+2000-02-16 08:18 mslifcak
+
+ include time.h once
+
+2000-02-16 08:02 mslifcak
+
+ restore #if HAVE...IN_PCB_H
+
+2000-02-15 23:47 nba
+
+ - configure.in, ipch.[ch]: initial stabs at Linux ipv6 support. A lot is
+ lacking in the kernel statistics though.
+
+2000-02-15 23:40 nba
+
+ - (many): configure check for netinet/ip6.h
+
+2000-02-15 23:34 nba
+
+ - hr_filesys.c: MNTTYPE defines for FreeBSD-3 and BSDI-4, and moving the
+ return value for Ext2FS to the newly defined OID.
+
+2000-02-15 23:24 nba
+
+ - freebsd3.h: some kernel symbols not to be used for FreeBSD 3
+
+2000-02-15 23:23 nba
+
+ - snmptable.c: give a sensible output for an empty table.
+
+2000-02-15 23:22 nba
+
+ - vacm*: buffer length checking!
+
+2000-02-15 23:20 nba
+
+ - hr_storage.c: return memory size in pages.
+
+2000-02-15 23:17 nba
+
+ - ucd_snmp.h, memory_freebsd2.h: make it work for FreeBSD-3 too
+
+2000-02-15 23:16 nba
+
+ - snmp_agent.c: one more place to send a AUTHFAIL trap
+
+2000-02-15 23:15 nba
+
+ - agent_registry.c: fix a return for SNMPv1/Counter64 case
+
+2000-02-15 02:12 daves
+
+ - (apps/snmp_parse_args.c): Omit deprecated options from optarg handling.
+
+2000-02-11 15:48 hardaker
+
+ - (manager/*): /usr/local/bin/perl -> /usr/bin/perl
+
+2000-02-11 15:47 hardaker
+
+ - (makedepend.in): /usr/local/bin/perl -> /usr/bin/perl
+
+2000-02-11 15:38 hardaker
+
+ - (rsnmp): perl5 -> perl
+
+2000-02-11 15:17 hardaker
+
+ - (man/Makefile.in): install snmp_trap_api.3
+
+2000-02-11 14:20 hardaker
+
+ - (local/Makefile.in): last minute makefile touchup
+
+2000-02-11 14:03 hardaker
+
+ - (NEWS): update for 4.1.1
+
+2000-02-11 13:47 hardaker
+
+ - (ChangeLog): Update for 4.1.1
+
+2000-02-11 13:29 hardaker
+
+ - (version.h bug-report sedscript.in): version tag ( 4.1.1 )
+
+2000-02-11 12:53 hardaker
+
+ - (T016snmpv2cgetfail, T017snmpv2ctov1getfail): update for Timeout for v2c.
+
+2000-02-11 12:49 hardaker
+
+ - (local/Makefile.in): don't cp for snmpcheck
+
+2000-02-11 12:44 hardaker
+
+ - (local/Makefile.in): fix for seperate build path
+
+2000-02-11 12:30 hardaker
+
+ - (sysORTable.h): Patch from Niels Baggesen:
+ - compiler warning fix.
+
+2000-02-11 12:29 hardaker
+
+ - (snmp_agent.c): patch from Niels:
+ - don't send autherror responses for v2c.
+ - send authFailure trap.
+
+2000-02-11 12:22 hardaker
+
+ - (acconfig.h, config.h.in): change perl path to /usr/bin.
+
+2000-02-11 06:58 hardaker
+
+ - (acconfig.h, config.h.in): Dont define PROCFIXCMD and EXECFIXCMD by default.
+
+2000-02-10 11:14 mslifcak
+
+ fix for older platforms to use pass_persist; not included by default.
+
+2000-02-10 10:33 mslifcak
+
+ [no log message]
+
+2000-02-10 10:32 hardaker
+
+ - (hr_swinst.c): minor fixes pointed out by Michael.
+
+2000-02-10 10:28 hardaker
+
+ - (snmpv3.c): fix setup engineID buffer overflow found by Mike Baer.
+
+2000-02-10 08:39 nba
+
+ - man/*: set the dates on the pages to reflect the revision date
+
+2000-02-10 08:13 mslifcak
+
+ fix varargs decl/defn of snmp_log
+
+2000-02-10 08:00 mslifcak
+
+ typedef int ssize_t (one line added) for build on SunOS 4.
+
+2000-02-10 07:54 hardaker
+
+ - (FAQ): mention the tutorial.
+
+2000-02-10 07:14 daves
+
+ - (FAQ): Explicit examples of sending traps by hand
+
+2000-02-10 04:41 daves
+
+ - (snmplib/{snmp_api,snmp_client}.c apps/snmpnetstat/inet6.c):
+ - Comment unused code more informatively as to why it is omitted.
+
+2000-02-09 13:53 hardaker
+
+ - (eval_tools.sh, T023snmpv3getMD5DES, T024snmpv3getSHA1, T025snmpv3getSHADES):
+ - skip ssl tests we can't perform.
+
+2000-02-09 13:51 mslifcak
+
+ include sys/param.h to get PATH_MAX on FreeBSD.
+
+2000-02-09 13:38 hardaker
+
+ - (Sv3SHADESconfig, T024snmpv3getSHA1, T025snmpv3getSHADES):
+ - make SHA tests actually work.
+
+2000-02-09 13:32 hardaker
+
+ - (Sv3configsha): sha config support
+
+2000-02-09 13:31 hardaker
+
+ - (T003snmpv1getfail, T016snmpv2cgetfail, T017snmpv2ctov1getfail,
+ T018snmpv1tov2cgetfail): fix for proper ACM error outputs.
+
+2000-02-09 13:30 mslifcak
+
+ Define SNMP_MAXPATH, and use it.
+
+2000-02-09 13:30 hardaker
+
+ - (T024snmpv3getSHA1 T025snmpv3getSHADES): new tests
+
+2000-02-09 13:16 hardaker
+
+ - (UCD-SNMP-MIB.txt): mention a new ucdExperimental registration (wavlan).
+
+2000-02-09 13:16 hardaker
+
+ - (agent_callbacks.h, agent_registry.c, agent_registry.h,
+ snmp_agent.c, vacm_vars.c):
+ - fix posible acm DoS problems by checking access tables early on.
+
+2000-02-09 11:38 hardaker
+
+ - (hr_swinst.c): patch from redhat for better RPM support.
+
+2000-02-09 10:43 hardaker
+
+ - (configure.in): change mode to autoconf.
+
+2000-02-09 10:41 hardaker
+
+ - (Makefile.in): fix rsnmp build. Really. I mean it.
+
+2000-02-09 10:41 hardaker
+
+ - (hr_filesys.c, hr_storage.c): Patch from Andy HOOD:
+ - Solaris patches.
+
+2000-02-09 10:37 hardaker
+
+ - (Makefile.in):
+ - fix rsnmp.made.
+ - use $(MAKE).
+
+2000-02-09 08:41 hardaker
+
+ - (vmstat_solaris2.c, vmstat_solaris2.h): Update from Jochen Kmietsch
+
+2000-02-07 11:49 marz
+
+ oops missing important fix for win32 build - fd_set must be same size as in winsock
+
+2000-02-07 11:18 mslifcak
+
+ Undo last change; on Sun, additional platform info was not obtained;
+ the proper solution would be to remove the second token (hostname).
+
+2000-02-07 10:43 mslifcak
+
+ Keep customer's nodename out of the published 'uname' information.
+
+2000-02-07 07:20 hardaker
+
+ - (PORTING): Michael likes diff -u.
+
+2000-02-06 06:11 nba
+
+ - read_config.c: Fix one final ':' to ENV_SEPARATOR_CHAR
+
+2000-02-05 17:39 hardaker
+
+ - (snmpv3.c): correct some awful text -> engineID creation mistakes.
+
+2000-02-05 08:37 hardaker
+
+ - (snmptrapd.c): fix wrapped line continuation in usage message.
+
+2000-02-05 06:56 marz
+
+ fix version number
+
+2000-02-04 18:55 marz
+
+ weird delay in creation of pid files
+
+2000-02-04 18:21 marz
+
+ brain-o
+
+-------------------------------------------------------------------------------
+
+Changes: V4.1 -> V4.1.1
+
+marz 5 Feb 00 06:56:43
+ fix version number
+
+hardaker 5 Feb 00 08:37:27
+ - (snmptrapd.c): fix wrapped line continuation in usage message.
+
+hardaker 5 Feb 00 17:39:54
+ - (snmpv3.c): correct some awful text -> engineID creation mistakes.
+
+nba 6 Feb 00 06:11:59
+ - read_config.c: Fix one final ':' to ENV_SEPARATOR_CHAR
+
+hardaker 7 Feb 00 07:20:24
+ - (PORTING): Michael likes diff -u.
+
+mslifcak 7 Feb 00 10:43:29
+ Keep customer's nodename out of the published 'uname' information.
+
+mslifcak 7 Feb 00 11:18:26
+ Undo last change; on Sun, additional platform info was not obtained;
+ the proper solution would be to remove the second token (hostname).
+
+marz 7 Feb 00 11:49:01
+ oops missing important fix for win32 build - fd_set must be same size as in winsock
+
+hardaker 9 Feb 00 08:41:11
+ - (vmstat_solaris2.c, vmstat_solaris2.h): Update from Jochen Kmietsch
+
+hardaker 9 Feb 00 10:37:00
+ - (Makefile.in):
+ - fix rsnmp.made.
+ - use $(MAKE).
+
+hardaker 9 Feb 00 10:41:14
+ - (hr_filesys.c, hr_storage.c): Patch from Andy HOOD:
+ - Solaris patches.
+
+hardaker 9 Feb 00 10:41:44
+ - (Makefile.in): fix rsnmp build. Really. I mean it.
+
+hardaker 9 Feb 00 10:43:05
+ - (configure.in): change mode to autoconf.
+
+hardaker 9 Feb 00 11:38:42
+ - (hr_swinst.c): patch from redhat for better RPM support.
+
+hardaker 9 Feb 00 13:16:17
+ - (agent_callbacks.h, agent_registry.c, agent_registry.h,
+ snmp_agent.c, vacm_vars.c):
+ - fix posible acm DoS problems by checking access tables early on.
+
+hardaker 9 Feb 00 13:16:58
+ - (UCD-SNMP-MIB.txt): mention a new ucdExperimental registration (wavlan).
+
+mslifcak 9 Feb 00 13:31:01
+ Define SNMP_MAXPATH, and use it.
+
+hardaker 9 Feb 00 13:31:24
+ - (T003snmpv1getfail, T016snmpv2cgetfail, T017snmpv2ctov1getfail,
+ T018snmpv1tov2cgetfail): fix for proper ACM error outputs.
+
+mslifcak 9 Feb 00 13:51:12
+ include sys/param.h to get PATH_MAX on FreeBSD.
+
+hardaker 9 Feb 00 13:53:37
+ - (eval_tools.sh, T023snmpv3getMD5DES, T024snmpv3getSHA1, T025snmpv3getSHADES):
+ - skip ssl tests we can't perform.
+
+daves 10 Feb 00 04:41:10
+ - (snmplib/{snmp_api,snmp_client}.c apps/snmpnetstat/inet6.c):
+ - Comment unused code more informatively as to why it is omitted.
+
+daves 10 Feb 00 07:14:51
+ - (FAQ): Explicit examples of sending traps by hand
+
+hardaker 10 Feb 00 07:54:46
+ - (FAQ): mention the tutorial.
+
+mslifcak 10 Feb 00 08:00:26
+ typedef int ssize_t (one line added) for build on SunOS 4.
+
+mslifcak 10 Feb 00 08:13:14
+ fix varargs decl/defn of snmp_log
+
+nba 10 Feb 00 08:40:04
+ - man/*: set the dates on the pages to reflect the revision date
+
+hardaker 10 Feb 00 10:28:21
+ - (snmpv3.c): fix setup engineID buffer overflow found by Mike Baer.
+
+hardaker 10 Feb 00 10:32:08
+ - (hr_swinst.c): minor fixes pointed out by Michael.
+
+mslifcak 10 Feb 00 10:33:47
+ *** empty log message ***
+
+mslifcak 10 Feb 00 11:14:58
+ fix for older platforms to use pass_persist; not included by default.
+
+hardaker 11 Feb 00 06:58:03
+ - (acconfig.h, config.h.in): Dont define PROCFIXCMD and EXECFIXCMD by default.
+
+hardaker 11 Feb 00 12:22:10
+ - (acconfig.h, config.h.in): change perl path to /usr/bin.
+
+hardaker 11 Feb 00 12:29:37
+ - (snmp_agent.c): patch from Niels:
+ - don't send autherror responses for v2c.
+ - send authFailure trap.
+
+hardaker 11 Feb 00 12:30:02
+ - (sysORTable.h): Patch from Niels Baggesen:
+ - compiler warning fix.
+
+hardaker 11 Feb 00 12:44:23
+ - (local/Makefile.in): fix for seperate build path
+
+hardaker 11 Feb 00 12:49:03
+ - (local/Makefile.in): don't cp for snmpcheck
+
+hardaker 11 Feb 00 12:53:15
+ - (T016snmpv2cgetfail, T017snmpv2ctov1getfail): update for Timeout for v2c.
+
+hardaker 11 Feb 00 13:29:29
+ - (version.h bug-report sedscript.in): version tag ( 4.1.1 )
+
+
+-------------------------------------------------------------------------------
+
+Changes: V4.0.1 -> V4.1
+
+mslifcak 24 Aug 99 04:44:47
+ Clean CRs from read_config,snmp_logging; comment define USE_ASN_SHORT_LEN.
+
+mslifcak 24 Aug 99 05:11:13
+ Remove ASN_SHORT_LEN hack - known to dump core in agent.
+
+mslifcak 24 Aug 99 06:19:49
+ Add "." to PATH for RUNTESTS; Drop optreset to build most platforms
+
+mslifcak 24 Aug 99 10:25:53
+ -(testing/eval_tools) - let some (AIX) agents settle before firing requests.
+
+hardaker 24 Aug 99 12:48:21
+ - (vacm_vars.c): correct sysORTable entry.
+
+hardaker 24 Aug 99 13:36:35
+ - (snmpusm.c): check for null response pointer.
+
+hardaker 24 Aug 99 13:37:31
+ - (snmp_parse_args.c, default_store.h, snmp_api.c, snmpv3.c):
+ - provide defVersion token support in snmp.conf (sort of hackish).
+
+hardaker 24 Aug 99 13:41:18
+ - (TODO): remove snmpv3 support :-)
+
+mslifcak 24 Aug 99 14:05:39
+ -(top/Makefile.in) - remove more generated files with distclean rule.
+
+hardaker 24 Aug 99 14:15:40
+ - (all_system.h): remove. again.
+
+mslifcak 24 Aug 99 14:17:33
+ -(host/hr_swrun;mibII/icmp,ip;ucd-snmp/disk,proc) log_perror --> snmp_log_perror
+
+mslifcak 24 Aug 99 15:14:18
+ -(smux.c) apply Nick Amato's patch: prevent SMUX close on parse or error.
+
+hardaker 24 Aug 99 15:59:42
+ - (snmp_api.c): remove version setting in snmp_api.c. Not needed there.
+
+hardaker 24 Aug 99 16:01:55
+ - (NEWS): 4.0.1 update
+
+mslifcak 24 Aug 99 16:05:15
+ -(configure.*) move statement about ucdDemoPublic into comment field.
+
+mslifcak 24 Aug 99 16:49:22
+ -(testing/*) run tests when package is not installed, and when
+ the build tree is not the same as the source tree.
+
+hardaker 24 Aug 99 17:13:25
+ - (ChangeLog): update for 4.0.1
+
+hardaker 24 Aug 99 17:14:50
+ - (version.h bug-report sedscript.in): version tag ( 4.0.1 )
+
+mslifcak 24 Aug 99 17:39:54
+ -(RUNTESTS) export PATH before use
+
+mslifcak 24 Aug 99 17:43:04
+ -(testing/Makefile.in) no need to build targets in test rule.
+
+mslifcak 26 Aug 99 13:18:31
+ -(testing/RUNTESTS) improved PATH set
+
+mslifcak 26 Aug 99 13:40:13
+ -(testing/Makefile.in) don't built targets that are no longer used
+
+mslifcak 27 Aug 99 07:35:10
+ -(configure*, sedscript*) change ...EXTENIS... to ...EXTENSI...
+
+mslifcak 27 Aug 99 08:03:46
+ Howard Spindel suggests an API for traps with pass_persist.
+
+hardaker 27 Aug 99 09:17:08
+ - (icmp.c, interfaces.c, ip.c, route_write.c, tcp.c, udp.c, var_route.c):
+ - Susanne Osted pointed out a lack of #if HAVE_SYS_PARAM_H.
+
+hardaker 28 Aug 99 07:19:16
+ - (Makefile.in): install snmp_alarm.3.
+
+hardaker 28 Aug 99 07:29:48
+ - (acconfig.h, config.h.in, configure, configure.in, read_config.c):
+ - add /etc/snmp to default conf file path to make RedHat happy.
+
+hardaker 30 Aug 99 09:33:41
+ - (Makefile.in, agent_read_config.c, agent_registry.c, agent_trap.c,
+ agent_trap.h, ds_agent.h, snmp_agent.c, snmp_agent.h, snmp_vars.c,
+ snmpd.c, util_funcs.c, sysORTable.c, callback.c, callback.h,
+ default_store.h, read_config.c, snmp_api.c):
+ - restructure the agent into two pieces: a library and a application.
+ - needs much more work.
+ - many parameters are now controlled by new default_store settings
+ to help relieve compile time bindings.
+ - merge init_snmp and the custom version called inside the agent.
+ - add a new place for trap specific agent code (agent_trap.[ch]).
+ - probably other things I've forgotten that I did.
+
+hardaker 30 Aug 99 09:38:18
+ - (client.c, master.c, master_request.c, protocol.c, subagent.c):
+ - debugging statements.
+ - use new default_store settings instead of external variables.
+
+hardaker 30 Aug 99 10:30:56
+ - (master.c, master_request.c): yet more debugging.
+
+nba 30 Aug 99 13:02:18
+ - man/snmpd.conf.5.def: document smuxpeer directive
+
+nba 30 Aug 99 13:03:40
+ - apps/snmp_parse_args.c: properly handle MIB:oid construct
+
+nba 30 Aug 99 13:05:02
+ - apps/snmptrapd.c: fix argument parser
+
+nba 31 Aug 99 00:08:45
+ - agent/snmpd.c: don't try to parse a packet when there is an error in
+ recvfrom
+
+mslifcak 31 Aug 99 08:17:24
+ -(agent_trap.c) fix recent memory leak, and sizeof(objid_snmptrap) bug.
+
+mslifcak 31 Aug 99 09:26:14
+ -(agent_trap.c) always free PDU after snmp_send.
+
+daves 2 Sep 99 06:38:16
+ - (agent/mibgroup/misc/ipfwacc.h): Fix MIB location of ipfwacc module
+
+daves 2 Sep 99 06:38:53
+ - (agent/mibgroup/misc/ipfwacc.c): Fix MIB location of ipfwacc module
+
+hardaker 2 Sep 99 07:07:04
+ - (subagent.c): shutdown_subagent -> subagent_shutdown so configure
+ doesn't find it.
+
+hardaker 2 Sep 99 08:52:48
+ - (subagent.c): opps. Forgot a shutdown name change instance.
+
+hardaker 3 Sep 99 13:15:15
+ - (history.c, history.h, snmp_vars.linux.h): removed. No longer needed.
+
+hardaker 3 Sep 99 13:15:33
+ - (Makefile.in): install agent header files.
+
+hardaker 3 Sep 99 13:27:13
+ - (Makefile.in):
+ - install libagent.a.
+ - mkdirheir on needed new installation directories.
+
+hardaker 3 Sep 99 13:30:36
+ - (snmplib/Makefile.in): install more library headers.
+
+hardaker 3 Sep 99 14:28:46
+ - (snmp_vars.c): don't fall off the end of the search tree.
+
+hardaker 3 Sep 99 15:01:39
+ - (FAQ): more BSDI system versions listed.
+
+nba 6 Sep 99 23:53:07
+ - (man/snmp_api.3 snmplib/snmp_api.c agent/snmpd.c apps/snmptrap.c):
+ fix memory leak when agent sends traps by implementing the missing
+ free of TRAP pdu in snmp_send.
+
+nba 6 Sep 99 23:55:38
+ - if.c: correct calls of snmp_fix_pdu to use GETNEXT
+
+mslifcak 7 Sep 99 14:47:18
+ -(parse.*) fix small memory leaks; allow INDEX{INTEGER...} clauses;
+ allow larger DESCRIPTION clauses [max 8192].
+
+mslifcak 7 Sep 99 15:22:14
+ snmpv3.c - silence type warning from MSVC++.
+
+mslifcak 7 Sep 99 15:23:02
+ (default_store.*) - make 3rd param to ds_set_string type of const char *.
+
+mslifcak 7 Sep 99 15:23:51
+ (win32/config.h) - set SNMPCONFPATH to succeed compile;
+ (win32*libsnmp.def) - add new snmp_get_token to list.
+
+mslifcak 7 Sep 99 15:32:00
+ -(snmp_api.h) struct pdu and snmp_session agree: long type for version member.
+
+mslifcak 7 Sep 99 15:32:59
+ -(parse.c) remove unneeded strdup to File variable from init_mib_internals.
+
+mslifcak 7 Sep 99 15:57:13
+ -(parse.c) fix Unlinked OID print when object identifier has no parent.
+
+mslifcak 7 Sep 99 20:12:57
+ -(agent_trap.c,snmptrap.c,snmp_api.[3c]) - snmp_free_pdu fix Bug #54 per Niels B.
+ -(snmpnetstat/if.c) - fix for GETNEXT per Niels B.
+
+mslifcak 7 Sep 99 20:19:52
+ snmptrap.c - rework fix bug #54 (missed else).
+
+mslifcak 8 Sep 99 05:16:34
+ include read_config.h
+
+nba 8 Sep 99 07:45:54
+ - (configure.in, loadave.c): Solaris 2.7 has getloadavg prototype
+
+nba 8 Sep 99 07:46:51
+ - snmp_api.h: move inclusion protection to the real beginning/end of the file
+
+nba 8 Sep 99 07:48:03
+ - var_struct.h: the Agentx code uses unsigned values for the variable type.
+
+nba 8 Sep 99 07:50:37
+ - (various): fix compiler warnings
+
+nba 8 Sep 99 07:51:26
+ - snmpd.1.def: fix a formatting problem
+
+nba 8 Sep 99 07:52:23
+ - apps/snmptrapd.c: fix argument processing (-ld and similar)
+
+mslifcak 8 Sep 99 13:00:40
+ -(testing/RUNTESTS) prefix PATH with . and .. , as the script changes dir.
+
+mslifcak 8 Sep 99 13:04:55
+ -(snmplib/snmp_client.*) add snmp_split_pdu, snmp_varbind_len methods.
+
+mslifcak 8 Sep 99 17:02:37
+ mibincl.h, mibgroup/mibII/* - fixup for CygWin32 build
+
+mslifcak 8 Sep 99 17:49:13
+ -(config*,win32/*,snmplib/*) resource locking originally from Markku Laukkanen
+
+mslifcak 8 Sep 99 17:52:47
+ -(mt_support.*) Original by Markku Laukkanen, changes by M. Slifcak
+
+mslifcak 8 Sep 99 22:30:29
+ -(smux.c) var_smux_write fixed per Mike Michaud and Nick Amato
+
+mslifcak 8 Sep 99 22:34:37
+ -(mibincl.h) comment out duplicate #include header lines.
+
+daves 9 Sep 99 01:32:15
+ - (mibs/SNMPv2-CONF.txt): Omit unnecessary import clause
+
+mslifcak 9 Sep 99 02:21:50
+ -(winstub.c) Hack to allow snmpnetstat -a to work on AIX4 (sic).
+
+mslifcak 9 Sep 99 02:31:26
+ -(*config*) turn on resource locking with --enable-reentrant.
+
+mslifcak 9 Sep 99 13:59:26
+ -(mib.c, parse.c) mib.c print_tree_node test display null type with range
+ parse.c work around core dump freeing TCs that specify ranges.
+
+nba 12 Sep 99 21:50:23
+ - var_route.c: Linux cleanup. Required for Linux/SPARC
+
+nba 12 Sep 99 21:57:18
+ - agent/*, snmplib/*: malloc fixes, some provoked by the corrected
+ snmp_send semantics.
+
+nba 12 Sep 99 21:58:17
+ - TESTCONF.sh: fix some exports to export the right variable.
+
+nba 12 Sep 99 21:59:34
+ - protocol.c: add a missing include file.
+
+nba 12 Sep 99 22:00:33
+ - snmp_impl.h: removed some unused/unneeded defines/structs
+
+nba 13 Sep 99 04:35:18
+ - var_route.c: Linux cleanup. Required for Linux/SPARC
+
+nba 13 Sep 99 13:32:07
+ - snmpd.c: fix a buffer overflow
+
+hardaker 13 Sep 99 15:01:54
+ - (agent_callbacks.h, agent_read_config.c, agent_registry.c,
+ agent_registry.h, snmp_agent.c, snmp_vars.c, snmpd.c, subagent.c,
+ subagent.h, sysORTable.c, vacm_vars.c, vacm_vars.h):
+ - further separation of agent church and state:
+ - use callbacks everywhere needed to not call mib module code directly.
+ - get rid of all instances of USING_ in libagent code.
+
+mslifcak 13 Sep 99 20:20:54
+ -(snmp_api.c) re-assert Niels' patch to snmp_send to free v2/v1 Trap-PDUs
+
+mslifcak 14 Sep 99 09:54:05
+ -(FAQ, man/snmpcmd.1, snmplib/parse.*) add replace MIB capability(experimental)
+
+marz 14 Sep 99 13:00:12
+ (apps/snmp_parse_args.c, snmplib/snmp_api.[ch]): fix spurious error message when snmp_parse_oid fails
+
+mslifcak 14 Sep 99 13:22:39
+ parse.c - another fix for node: consider NULL name or NULL parent
+
+mslifcak 15 Sep 99 06:08:32
+ include mibgroup/mib_module_includes.h for benefit of mib_module_dot_conf.h
+
+hardaker 15 Sep 99 09:45:35
+ - (Makefile.in, snmp_close.3, snmp_free_pdu.3, snmp_open.3,
+ snmp_read.3, snmp_select_info.3, snmp_send.3,
+ snmp_sess_async_send.3, snmp_sess_close.3, snmp_sess_error.3,
+ snmp_sess_init.3, snmp_sess_open.3, snmp_sess_read.3,
+ snmp_sess_select_info.3, snmp_sess_send.3, snmp_sess_sess_timeout.3,
+ snmp_sess_session.3, snmp_timeout.3): Patch from Mark H. Wood:
+ - create some fake sourcing man pages for functions.
+
+mslifcak 15 Sep 99 11:30:58
+ fine tuning mt support
+
+mslifcak 16 Sep 99 14:16:38
+ -per agreement with Markku, no support needed for Solaris-specific threads.
+
+hardaker 17 Sep 99 07:17:21
+ - (snmp_api.3): Patch from Mark H. Wood:
+ - fix comments.
+
+mslifcak 17 Sep 99 11:19:42
+ -(parse.c) - remove unneeded use of static var "last"
+
+mslifcak 17 Sep 99 11:24:48
+ -remove old-style init for replace mib feature.
+
+mslifcak 17 Sep 99 11:42:17
+ make module_map* and tokens structures static (only used in parse.c ?)
+
+hardaker 17 Sep 99 15:37:41
+ - (configure): update to 2.13.
+
+daves 21 Sep 99 09:21:59
+ - (snmplib/snmp_api.c): handle adding 'error' type variables to a PDU
+
+daves 21 Sep 99 09:25:25
+ - (agent/mibgroup/agentx/protocol.c): Handle parsing null-length variables
+
+daves 21 Sep 99 09:32:27
+ - (agent_registry.c snmpd.c): Simple run-time dump of registered MIBs
+
+mslifcak 21 Sep 99 10:40:43
+ -(mib.c) undo erroneous change to init_mib (thanks NB!)
+
+daves 22 Sep 99 09:27:37
+ - (agent/snmpd.c): stupid typo
+
+daves 22 Sep 99 09:31:08
+ - (agent/agent_registry.c): stupid typo
+
+daves 22 Sep 99 09:33:51
+ - (agent/agent_registry.[ch]): Provide method for prioritised registration
+
+daves 22 Sep 99 09:35:09
+ - (agent/mibgroup/mibII/sysORTable.c):
+ - Ensure local sysORTable takes precedence over subagent versions
+
+daves 22 Sep 99 09:54:02
+ - (agent_registry.c snmp_vars.c var_struct.h):
+ Change the way the MIB registry handles registered ranges.
+ This should work more reliably (as well as being rather simpler, IMHO)
+
+daves 22 Sep 99 09:58:12
+ - (agent_registry.c): remove redundant routines
+
+daves 22 Sep 99 10:00:56
+ - (agent_registry.c): Ensure registry is initialised correctly on subagents
+
+daves 22 Sep 99 10:01:45
+ - (mibgroup/agentx/master_request.c): Improved AgentX response handling
+
+mslifcak 22 Sep 99 12:51:00
+ -(snmp_api.c) - Improved error status aggregation.
+
+hardaker 27 Sep 99 16:22:20
+ - (read_config.c): Opps: DS_LIB_DONT_READ_CONFIGS needed an !.
+
+hardaker 28 Sep 99 16:52:04
+ - (Makefile.in, mib_modules.c, mib_modules.h, snmp_vars.c, snmpd.c):
+ - make libucdagent and libucdmibs as seperate libraries. In theory,
+ you shouldn't need libucdmibs to use libucdagent.
+
+daves 29 Sep 99 11:14:42
+ - (snmplib/snmp_api.c): protect snmp_close() against a null Sessions list
+
+daves 29 Sep 99 11:17:01
+ - (mt_support.h snmp_api.[ch]): Support for session and incoming transaction IDs
+
+daves 29 Sep 99 11:23:40
+ - (agent_registry.c): Correct value of default registration priority
+
+daves 29 Sep 99 11:36:43
+ - (agent_registry.[ch]):
+ - Improve registry error handling
+ - Correctly handle unregistering MIB regions
+
+daves 29 Sep 99 11:38:22
+ - (agent_registry.c):
+ - 'Children' nodes now have a different status, and shouldn't be freed. Oops!
+
+daves 29 Sep 99 11:43:00
+ - (agent_registry.[ch]): Provision to unregister MIBs by session
+
+daves 29 Sep 99 11:46:02
+ - (agent/snmp_vars.c):
+ - Move setting agent start time to earlier in the initialisation sequence
+ (so that it can be overridden in subagents with the master's value)
+
+daves 29 Sep 99 11:48:55
+ - (agent/mibgroup/mibII/sysORTable.c): Change in MIB registration interface
+
+daves 29 Sep 99 12:19:56
+ - (agent/mibgroup/agentx/*): Assorted improvements!
+
+mslifcak 29 Sep 99 14:31:48
+ Robust copy of information to tree, import_list, display hints.
+
+hardaker 29 Sep 99 16:35:43
+ - (config.h.in, configure, configure.in):
+ - fix RANLIB testing for --enable-shared.
+
+hardaker 29 Sep 99 16:36:07
+ - (README): added Mike Michaud to the thank you list.
+
+hardaker 29 Sep 99 16:38:34
+ - (header_complex.c, header_complex.h):
+ - new extraction and freeing functions.
+ - bug fix, missing a malloc size by one (electric fence is very cool).
+
+hardaker 29 Sep 99 16:38:59
+ - (client.c): thats "timeval" not "timevale" Dave (hehe).
+
+hardaker 29 Sep 99 16:39:21
+ - (client.h): define DEFAULT_MIB_PRIORITY to 255.
+
+hardaker 29 Sep 99 16:39:42
+ - (master_admin.c): -Wall fixes and found a missing }.
+
+hardaker 29 Sep 99 16:40:08
+ - (pass.c): run ntohl on ip addresses stored in a long.
+
+hardaker 29 Sep 99 16:40:30
+ - (mib2c.vartypes.conf): removed extra \n.
+
+hardaker 29 Sep 99 17:01:28
+ - (agent_registry.c, agent_registry.h): fix bugs.
+
+hardaker 29 Sep 99 17:01:50
+ - (mib_modules.c): include netinet/in.h
+
+mslifcak 29 Sep 99 23:42:49
+ Remove unused file.. snmplib/hpux.c
+
+daves 30 Sep 99 01:09:25
+ - (mibgroup/host/hr_system.c):
+ - protect against NULL utmp file (from Fabrice Dupre)
+
+daves 1 Oct 99 09:48:20
+ - (agent/Makefile.in): Fix incompatability in agent library names
+
+daves 2 Oct 99 14:28:20
+ - (mibgroup/agentx/master_admin.c mibgroup/agentx/subagent.c):
+ - Fix a problem with re-used PDU structures being freed twice.
+
+daves 4 Oct 99 03:58:22
+ - (agent_registry.[ch] mibgroup/agentx/client.h):
+ - consolidate definitions of default MIB registration priority
+
+daves 4 Oct 99 09:53:48
+ - (agent_registry.[ch] snmp_vars.h mibII/sysORTable.c
+ agentx/client.[ch] agentx/master_admin.c):
+ - Handle MIB range registration, and clean up wrapper interfaces
+
+daves 4 Oct 99 09:58:26
+ - (mib_modules.c mibgroup/agentx/subagent.[ch]):
+ - Ensure subagent is initialised early (prior to MIB registration, etc)
+
+daves 4 Oct 99 10:15:38
+ - (snmplib/callback.h): Increase number of application callbacks supported
+
+daves 4 Oct 99 10:17:53
+ - (agent_callbacks.h mibgroup/mibII/sysORTable.[ch]
+ mibgroup/agentx/master_admin.c mibgroup/agentx/subagent.c):
+ - Complete subagent handling of Agent Capabilities / sysORTable
+
+daves 4 Oct 99 10:22:25
+ - (agentx/client.[ch] agentx/master_admin.c): Trivial 'ping' implementation
+
+nba 4 Oct 99 11:48:51
+ - (snmp_api?, int64.? snmptrap.c): add some error checking for variables
+
+nba 4 Oct 99 11:50:50
+ - Makefile.in: always use $(MAKE) for make in Makefiles
+
+nba 4 Oct 99 11:52:25
+ - configure.in: remove -pedantic from --with-developer, and the system headers
+ are not prepared for it (at least on Linux and NetBSD)
+
+nba 4 Oct 99 13:38:19
+ - various: include additions and fixes to kill warnings
+
+hardaker 4 Oct 99 13:51:51
+ - (system_mib.c): make sysServices configurable.
+
+nba 4 Oct 99 13:52:20
+ - subagent.h, subagent.c, mib_modules.c: pre_init_subagent confuses
+ configure into believing there is a init_subagent function.
+ Rename to subagent_pre_init
+
+hardaker 4 Oct 99 16:32:19
+ - (header_complex.c, header_complex.h): added header_complex_find_entry().
+
+daves 5 Oct 99 07:23:45
+ - (agentx/master_request.c agentx/subagent.c): Working SET support
+
+nba 5 Oct 99 21:49:22
+ - snmp_debug.h: make the DEBUG* macros safe for use in compound statements
+
+nba 5 Oct 99 22:18:46
+ - snmp_parse_args.c: fixes to report invalid engineId
+
+nba 5 Oct 99 22:22:54
+ - subagent.c: include system.h for prototype for calculate_time_diff
+
+hardaker 6 Oct 99 08:57:42
+ - (fixproc): new commented version.
+
+hardaker 6 Oct 99 16:31:53
+ - (acconfig.h, config.h.in, read_config.c, snmp_api.c, snmp_client.c):
+ - Save and parse older persistent storage files to make sure data is
+ not lost during storage crashes.
+ - Fix SNMPv3 engineID probes: PDU's are allowed to have a NULL varbindlist.
+
+daves 7 Oct 99 07:26:20
+ - (agent_trap.c agent_trap.h agent_read_config.c snmpd.h):
+ - Re-write of agent trap handling:
+ Provision for v1 traps with varbinds
+ Consolidate v1 and v2 trap sink lists
+ Preliminary INFORM support
+
+daves 7 Oct 99 08:42:15
+ - (agent_trap.[ch]): Improve accessibility for subagents
+
+daves 7 Oct 99 09:01:25
+ - (agentx/subagent.c agentx/master_admin.c): Notification support
+
+mslifcak 12 Oct 99 05:58:28
+ mib.c : quick_print is exposed for CMU_COMPATIBLE builds.
+ lcd_time.c : commented unused dump_etimelist_entry under SNMP_TESTING_CODE.
+
+mslifcak 12 Oct 99 06:07:44
+ Define address length for FreeBSD platform.
+
+mslifcak 13 Oct 99 03:54:02
+ add missing proto for save_persistent.
+
+nba 13 Oct 99 07:09:36
+ - master_admin.c, system_mib.h: includes for prototypes
+
+mslifcak 15 Oct 99 07:09:14
+ -(default_store.c, callback.c) fix
+ bug in array-boundary check in snmplib/callback.c
+ reported by Bert Holstein 15 Oct 1999.
+
+hardaker 20 Oct 99 17:26:59
+ - (header_complex.c): parsed strings from oid's include null terminators.
+
+hardaker 20 Oct 99 18:08:39
+ - (mib.c): enable oid parser to handle simple embedded strings in oids
+ and to translate them into oid segments.
+ EG: .1.3.\"hello\".\'hi\' -> .1.3.5.104.101.108.108.111.104.105
+
+hardaker 21 Oct 99 10:07:00
+ - (mib.c): enable oidname."hi".'there' in get_module_node() as well.
+
+mslifcak 21 Oct 99 10:20:15
+ Note SNMPERR_UNKNOWN_OBJID error without specifying snmp_errno _outside_ the library.
+
+mslifcak 21 Oct 99 10:26:29
+ Note SNMPERR_UNKNOWN_OBJID error from within the library.
+
+mslifcak 21 Oct 99 10:37:49
+ mib.c - restore line stomped in my last update.
+ read_config.c - drop unused variable.
+ snmp_api.c - new method snmp_open_ex replaces set internal hook functions.
+
+mslifcak 21 Oct 99 10:39:09
+ Fixups for building with MSVC++. (no hpux.c, supply MAX_PERSISTENT_BACKUPS).
+
+mslifcak 21 Oct 99 10:41:38
+ reminders for snmp_sess_perror usage after open.
+ snmptable.c - open/close session from main().
+ netstat/main.c - use snmp_sess_perror.
+
+mslifcak 21 Oct 99 10:42:28
+ use snmp_open_ex.
+
+mslifcak 21 Oct 99 12:09:51
+ Fix BUG#78
+
+mslifcak 21 Oct 99 12:31:28
+ small patch from M. Laukkanen to fix HP aCC build.
+
+nba 21 Oct 99 12:52:26
+ - memory_solaris.c: reorder computations to avoid overflow.
+
+nba 21 Oct 99 12:54:41
+ - memory_solaris2.c: reorder computations to avoid overflow.
+
+mslifcak 22 Oct 99 06:29:16
+ In fixing bug #83 on 4.0 branch, discovered that 3.6 branch
+ did not have "octet" token support. Added.
+
+mslifcak 22 Oct 99 06:29:52
+ Fix BUG #83.
+
+mslifcak 22 Oct 99 07:39:01
+ Removed duplicated variable in a nested block. ARg!
+
+hardaker 22 Oct 99 09:59:39
+ - (mib.c): enable hex strings inside oids.
+
+mslifcak 22 Oct 99 10:12:26
+ Display _some_ octet string indices of object identifiers as quoted printable.
+ Should be expanded to handle other INDEX types.
+
+hardaker 22 Oct 99 15:28:59
+ - (acconfig.h, config.h.in, configure, configure.in, keytools.c,
+ keytools.h, scapi.c):
+ - use openssl for md5/sha support (from Olafur Gudmundsson).
+
+hardaker 22 Oct 99 15:29:38
+ - (mib.c): print string based OIDs better.
+
+hardaker 24 Oct 99 08:24:02
+ - (configure, configure.in): SNMPCONFPATH uses sysconfdir not datadir.
+
+hardaker 24 Oct 99 08:24:21
+ - (README.snmpv3): typo.
+
+hardaker 24 Oct 99 08:25:35
+ - (mib.c): fix "mibs" and "mibdirs" .conf directives to properly
+ handle multiple calls (additive) and '+'s and things.
+
+hardaker 24 Oct 99 08:27:28
+ - (read_config.c):
+ - premib directives weren't getting read due to a missing negation (!).
+ - more parsing debugging statements added.
+
+mslifcak 25 Oct 99 08:06:32
+ minor rework to clarify signed compares and remove unused variables.
+
+nba 25 Oct 99 13:39:27
+ - interfaces.c: fix a memory leak in the Linux part
+
+nba 25 Oct 99 13:41:01
+ - configure.in, proc.c: support for FreeBSD 2.1 where ps doesn't have c flag
+
+nba 25 Oct 99 13:51:22
+ - hr_system.c: play it safe when no utmp file exists
+
+nba 25 Oct 99 13:53:26
+ - snmptrapd.c, snmptrapd_handlers.c: support for traphandle DEFAULT
+
+nba 25 Oct 99 13:56:26
+ - RUNTESTS, TESTCONF.sh eval_onescript.sh eval_tools.sh: support non-bash
+ shells (echo -n vs echo \\c). Don't require . in PATH
+
+nba 25 Oct 99 13:58:03
+ - snmptranslate.c: let ':' in OID do "the right thing"
+
+nba 25 Oct 99 13:59:05
+ - pass.c: do an htonl when passing ip address
+
+nba 25 Oct 99 14:07:11
+ - snmpdelta.c: COUNTER64 will dereference freed pointer
+
+nba 25 Oct 99 14:08:25
+ - snmpd.conf.5.def: minor quirk
+
+nba 25 Oct 99 14:13:57
+ - *: configure support for dmalloc malloc debugger (www.dmalloc.com)
+
+hardaker 25 Oct 99 14:35:51
+ - (snmptranslate.c): enable -p printing of only a section of the mib tree.
+
+hardaker 25 Oct 99 16:05:03
+ - (snmptranslate.c, parse.c): hack to do wild card searches for a mib node.
+
+mslifcak 26 Oct 99 10:34:40
+ Allow unsigned range for counter/gauge/timeticks (fix BUG#84 per Sander Steffann).
+
+hardaker 27 Oct 99 14:33:33
+ - (Makefile.in): fix up ucd-snmp-config.h building.
+
+hardaker 27 Oct 99 14:34:10
+ - (snmp_agent.h): prototype agent_check_and_process().
+
+hardaker 27 Oct 99 14:34:55
+ - (Makefile.in, ucd-snmp-agent-includes.h): added a header file to
+ wrap around the various agent include files.
+
+hardaker 27 Oct 99 14:35:27
+ - (master_admin.c): simple debugging so you can watch stuff register.
+
+hardaker 27 Oct 99 14:36:21
+ - (Makefile.in, default_store.3, default_store.3.bot,
+ default_store.3.h, default_store.3.top, snmp_agent_api.3):
+ - new manual pages: default_store.3, snmp_agent_api.3.
+
+hardaker 27 Oct 99 14:36:55
+ - (default_store.h):
+ - mark regions to be included in the default_store.3 manual page.
+
+hardaker 27 Oct 99 14:37:49
+ - (lcd_time.h): define and comment LCD_TIME_SYNC_OPT better.
+
+hardaker 27 Oct 99 14:38:06
+ - (ucd-snmp-includes.h): add default_store.h and snmp_logging.h
+
+hardaker 27 Oct 99 17:12:01
+ - (ucd-snmp-includes.h): added more include files.
+
+hardaker 27 Oct 99 17:12:59
+ - (mib.c): bail if we can't find an index in the mib tree to use for
+ breaking an oid apart.
+
+hardaker 27 Oct 99 17:30:25
+ - (vacm_vars.c): watch for null communities when printing debug statements.
+
+mslifcak 28 Oct 99 04:55:52
+ Dave's comment about pre_parse etc. was too good to lose in e-mail.
+
+mslifcak 28 Oct 99 05:23:05
+ u_int8/16/32_t types no longer needed for WIN32 builds.
+
+mslifcak 28 Oct 99 05:25:02
+ Oops! restore version r1.131.
+
+mslifcak 28 Oct 99 06:49:03
+ rephrase subtree not found code in _get_symbol.
+
+hardaker 28 Oct 99 13:47:57
+ - (snmptosql): debugging and error checking.
+
+hardaker 29 Oct 99 08:58:17
+ - (mib2c.conf, mib2c.vartypes.conf): Patch from Keith Tuson:
+ - misc fixes.
+
+hardaker 29 Oct 99 09:28:11
+ - (FAQ): added reference to an above question for perl installation.
+
+hardaker 29 Oct 99 09:28:43
+ - (ucd-snmp-agent-includes.h): added var_struct.h and agent_read_config.h
+
+hardaker 29 Oct 99 09:52:18
+ - (default_store.h, mib.c): two new printing options:
+ - printNumericOids
+ - printNumericEnums
+
+hardaker 29 Oct 99 10:06:03
+ - (ds_agent.h, snmp_agent.c, snmpd.c, snmp_parse_args.c):
+ - snmp over TCP options: -T TCP.
+ - new quick print options: -qo -qe for numeric oids and enums.
+
+hardaker 29 Oct 99 10:13:44
+ - (snmpcmd.1): document -T and -q[oe]
+
+hardaker 29 Oct 99 10:15:01
+ -(default_store.3{,.h}): removed from CVS since they are built
+
+hardaker 29 Oct 99 10:15:43
+ - (.cvsignore): ignore default_store.3{,.h}
+
+hardaker 29 Oct 99 16:58:07
+ - (tkmib): make it do snmpv3. Added many things to the options menu.
+
+marz 29 Oct 99 19:54:10
+ (apps/snmp_parse_args.c, snmplib/snmpv3.c): make engineID setup conditional on app type to prevent apps from easily ending up with the same engineID as agent on same host
+
+hardaker 1 Nov 99 13:18:00
+ - (snmp_parse_args.c, default_store.h, mib.c, snmp_alarm.c):
+ - don't break oids into pieces if quick_print is turned on.
+ - ditto if the new default_store option is turned on.
+ - made a default_store option to not use sigalrm for snmp_alarms.
+
+hardaker 2 Nov 99 09:57:31
+ - (Makefile.in): install other header files needed by SNMP.pm.
+
+mslifcak 2 Nov 99 15:37:05
+ Use HAVE_STDARG_H when deciding to use varargs vs ANSI-C prototypes.
+
+mslifcak 2 Nov 99 15:46:08
+ Install snmp_agent_api.3
+
+mslifcak 3 Nov 99 06:11:03
+ declare find_best_tree_node for MSVC build.
+
+mslifcak 3 Nov 99 06:49:30
+ Near line 663 : close(fd) before invoking wait_on_exec
+
+mslifcak 3 Nov 99 13:18:59
+ Following call to fdopen (near get_exec_output), do not close(fd).
+
+mslifcak 3 Nov 99 13:20:16
+ Fix build problem on Linux RedHat 6.0 : key off GNU_LIBRARY value.
+
+mslifcak 4 Nov 99 02:42:15
+ Patch to build BSD/OS 4.0.1; from Bert Driehuis -- driehuis@playbeing.org
+
+mslifcak 4 Nov 99 04:14:28
+ More STDC_HEADERS cleanup: use HAVE_STRING_H, HAVE_STDLIB_H instead.
+
+mslifcak 4 Nov 99 04:33:32
+ Change example away from STDC_HEADERS.
+
+mslifcak 4 Nov 99 05:08:31
+ Every #define is given a value; set to 1 if no value was specified.
+
+mslifcak 4 Nov 99 05:13:05
+ First pass support for FreeBSD 4.0 [problems with proc table lookups].
+
+mslifcak 4 Nov 99 06:11:48
+ Use sysctl(CTL_VM..) to get virtual memory stats.
+
+hardaker 4 Nov 99 10:03:47
+ - (Makefile.in, acconfig.h, config.h.in, configure, configure.in, mib.c):
+ - define IN_UCD_SNMP_SOURCE in config.h but not in ucd-snmp-config.h.
+ - move ucd-snmp-config.h up in the build order before subdirs.
+ - Make default MIBDIRS search path include $HOME/.snmp/mibs.
+ - Make MIBDIRS parsing handle $HOME variables in it.
+
+hardaker 4 Nov 99 10:04:42
+ - (mib2c.conf): include headers for compilation for both internal and
+ external to the ucd-snmp source.
+
+mslifcak 4 Nov 99 10:19:35
+ Redo FreeBSD 4.0: define freebsd3 in s/freebsd4.h; reduce "define" thrashing.
+
+hardaker 4 Nov 99 10:28:44
+ - (snmp_parse_args.c, snmpcmd.1): move -q flags to -O.
+
+mslifcak 4 Nov 99 13:43:40
+ Speed up sprint_variable: halve the number of calls to get_symbol.
+
+mslifcak 5 Nov 99 06:22:52
+ Say goodbye to SNMP_MALLOC, malloc_zero, xcalloc, xmalloc, and xstrdup.
+ Respectively replaced with calloc, calloc, calloc, malloc, and strdup.
+
+nba 9 Nov 99 01:50:09
+ - mib.c,parse.c: make error reporting in parser work according to spec (-Pe)
+ show defining modules in snmptranslate -d
+ use ds_toggle_boolean
+
+nba 9 Nov 99 12:59:52
+ - snmptrapd.c,snmptrapd_handlers.c: make it compile with VC++ 5.0
+ (but no handlers (yet))
+
+hardaker 9 Nov 99 13:02:17
+ - (snmpd.c): fix -H.
+
+hardaker 9 Nov 99 13:02:41
+ - (ucd_snmp.h): require the DEMO-MIB (just for tutorial purposes).
+
+hardaker 9 Nov 99 13:09:21
+ - (vacm_vars.c, vacm_vars.h): simple new .conf tokens: rocommunity, rwcommity.
+
+hardaker 9 Nov 99 13:09:40
+ - (Makefile.in): install the DEMO-MIB.
+
+nba 9 Nov 99 15:16:03
+ - various: adapt tools to use getopt (and put one in for Win32)
+
+nba 9 Nov 99 22:20:52
+ . snmp_parse_args.c: a glitch in the conversion to getopt (thanks to
+ driehuis@playbeing.org)
+
+nba 9 Nov 99 23:30:03
+ - getopt.h: arguments to getopt did not match those in getopt.c
+
+nba 10 Nov 99 08:30:13
+ - win32/*: fixes to the VC++ build projects
+
+nba 10 Nov 99 08:32:00
+ - win32/*: VC++ project updates
+
+daves 10 Nov 99 08:57:00
+ - (agent/agent_read_config.c): Only set up trap sinks on the master agent
+
+daves 10 Nov 99 08:58:38
+ - (agent/agent_trap.[ch]): minor re-structure to allow subagent trap "sinks"
+
+daves 10 Nov 99 08:59:45
+ - (agentx/subagent.c): Fix AgentX notify support
+
+nba 10 Nov 99 12:20:47
+ - win32/*.dsp: yet another round of making this crap work
+
+nba 10 Nov 99 15:29:18
+ - apps/*: changes for getopt usage, and reworking of snmp_parse_args
+
+nba 10 Nov 99 22:12:08
+ - win32/*: clean up repository files, and add proper .cvsignore files
+
+daves 11 Nov 99 03:37:59
+ - (agentx/client.c): Silly typo in start time synchronisation
+
+nba 11 Nov 99 22:14:27
+ - snmpcmd.1: update man page to correspond to the new getopt situation
+ Note: even though some options have been removed from this
+ page, they still work!
+
+nba 11 Nov 99 22:50:00
+ - snmp_parse_args.c, mib.c: alignment of option code.
+ Some enhancements to the snmptranslate -d output.
+
+daves 12 Nov 99 08:46:33
+ - (snmplib/snmp_api.c): Provide a unique ID for all incoming PDUs
+
+marz 12 Nov 99 13:01:08
+ (lcd_time.[ch], snmpusm.c): fix enginetime update algorithm to conform to spec rfc2574 3.2.7.b.1
+
+nba 14 Nov 99 01:48:51
+ - snmptable, snmp_parse_args: allow the application specific options to
+
+nba 14 Nov 99 01:51:57
+ - snmptable: add in the application specific snmptable options between
+ the normal options.
+
+nba 14 Nov 99 01:53:16
+ - snmpbulkget: new tool to issue a single GETBULK request
+
+nba 14 Nov 99 01:54:17
+ - snmp_parse_args: changes to support multi-valued options
+
+nba 14 Nov 99 01:59:20
+ - mibs/*, vacm_vars.h: update the mib files to rfc 2571-2575. Also add
+ SNMP_COMMUNITY_MIB from the coex draft.
+
+nba 14 Nov 99 02:00:00
+ - vacm_vars.c: kill a warning
+
+nba 14 Nov 99 02:01:37
+ - pass.c, snmpd.conf.5.def: add an UNSIGNED return type
+
+nba 14 Nov 99 02:04:46
+ - mib.c, snmptranslate.c: move the MIB:id handling inside read_objid for
+ consistency. Also fixes a buffer overrun in mib.c
+
+nba 14 Nov 99 02:42:38
+ - SNMPv2-CONF.txt: comment out the IMPORT clause
+
+nba 14 Nov 99 06:12:03
+ - snmptrapd.c: add the new common -O option set
+
+nba 14 Nov 99 06:15:01
+ - snmptrapd.8: add the new common -O option set
+
+nba 14 Nov 99 06:32:25
+ - ipc6: Add the IPv6 code from the Kame project. I have only massaged
+ it so much as to still compile on non-IPv6 systems, and detect
+ Linux, INRIA, Solaris IPv6. No code for them yet. Original
+ author: itojun@iijlab.net
+
+daves 15 Nov 99 07:56:06
+ - (agent/snmp_vars.c): Fix handling of failed GET/SET requests
+
+mslifcak 15 Nov 99 08:29:06
+ Fix description of read_objid return value.
+
+nba 15 Nov 99 14:00:20
+ - snmp_parse_args.c: further error checking, courtesy mslifcak
+ snmpbulkget.c: needs #include <getopt.h> (Thanks to Robert Story)
+
+nba 15 Nov 99 14:03:36
+ - mibs/: replace RFC1271-MIN.txt with RMON-MIB.txt (RFC 1757 version)
+
+nba 15 Nov 99 14:05:57
+ - parse.c: fix a spelling error in the MIB replacement table.
+
+nba 15 Nov 99 14:09:29
+ - .cvsignore: updates to keep cvs silent about generated files.
+
+hardaker 15 Nov 99 15:18:46
+ - (FAQ, README): new mirror in Australia.
+
+hardaker 15 Nov 99 15:19:22
+ - (mib_modules.c, snmp_vars.c): move subagent_pre_init() to init_agent().
+
+hardaker 15 Nov 99 15:19:47
+ - (TODO): memory int -> uint.
+
+hardaker 15 Nov 99 15:20:10
+ - (header_complex.c): set to '\0' instead of NULL for -Wall.
+
+hardaker 15 Nov 99 15:21:07
+ - (mib2c, tkmib): remove -w.
+
+hardaker 15 Nov 99 15:21:28
+ - (snmp_agent_api.3): don't call subagent_pre_init().
+
+hardaker 15 Nov 99 15:21:57
+ - (mib2c.storage.conf): debugging statements inserted.
+
+hardaker 15 Nov 99 15:22:24
+ - (asn1.c, asn1.h): new function: asn_check_packet().
+
+hardaker 15 Nov 99 15:36:26
+ - (snmpdelta.c, snmptable.c, snmptest.c, snmptranslate.c, snmptrapd.c):
+ - add default_store.h
+
+hardaker 15 Nov 99 15:38:25
+ - (default_store.h, mib.c): move more options to the ds_* routines.
+
+hardaker 15 Nov 99 15:41:38
+ - (snmp_api.c, snmp_api.h):
+ - move more options to the ds_* routines.
+ - implement support for TCP broken SNMP packets by storing buffers
+ and dealing with pieces of incoming data till we have a full packet.
+
+mslifcak 15 Nov 99 16:43:25
+ Don't add NULL varbind when ENDOFMIBVIEW is reached.
+
+hardaker 15 Nov 99 17:41:10
+ - (snmp_agent.c, master.c, protocol.c, protocol.h, subagent.c,
+ snmp_api.c, snmp_api.h):
+ - make TCP support better for agentx. Still has a problem (I broke agentx).
+
+mslifcak 15 Nov 99 21:57:36
+ Fix bug#75: build --without-opaque-types
+
+mslifcak 16 Nov 99 03:36:09
+ Fix spelling misteak.
+
+nba 16 Nov 99 06:21:25
+ - snmp_parse_args.c, snmptranslate.c, mib.c: redo the snmptranslate options
+ to follow the common option set. Issue warnings when someone
+ uses the old form, advising about the new.
+
+mslifcak 16 Nov 99 08:48:31
+ Embrace all HP-9000/6xx,7xx, 8xx series platforms, without regrets.
+
+daves 16 Nov 99 09:13:59
+ - (snmplib/asn1.c): Fix encoding of root OIDs.
+
+hardaker 16 Nov 99 10:24:59
+ - (protocol.c): add the header length to the packet length estimate.
+
+hardaker 16 Nov 99 10:26:02
+ - (snmp_parse_args.c): add the T: flag for -T to getopt
+
+mslifcak 16 Nov 99 14:41:50
+ MSVC touchups:
+ Added snmptrapd project .DSP file; All .DS[PW] files CR-LF line terminated;
+ Fix warnings in asn1.c and snmp_api.c; Remove unused var in snmptranslate.c.
+
+mslifcak 16 Nov 99 14:56:59
+ Build with getopt.
+
+mslifcak 17 Nov 99 05:59:15
+ Replace u_int16_t with more universally supported u_short.
+
+mslifcak 17 Nov 99 07:35:03
+ Project file for building snmpbulkget using MSVC++ gratis Robert Story.
+
+mslifcak 17 Nov 99 07:36:58
+ Add snmpbulkget to list of apps to build.
+
+hardaker 17 Nov 99 11:55:41
+ - (ds_agent.h, kernel.c, snmpd.c, snmpd.1.def):
+ - run time rootless running support for snmpd, by reqest of Joe. (-r)
+
+hardaker 17 Nov 99 12:21:26
+ - (snmptosql):
+ - move to Net::SMTP.
+ - Make new authgroup and authhost tables to contain SNMP::Session defaults.
+
+hardaker 17 Nov 99 13:05:00
+ - (configure.in): update the so LD for linux to $(CC).
+
+hardaker 17 Nov 99 13:08:17
+ - (configure): update.
+
+hardaker 17 Nov 99 13:09:14
+ - (mib2c.storage.conf): update. Deals with RowStatus objects better.
+
+nba 17 Nov 99 21:51:19
+ - default_store.c: ds_toggle_boolean missed a mask
+
+mslifcak 18 Nov 99 17:58:47
+ Check-in agent changes to support Win32 agent built with MSVC++.
+ Thanks to Robert Story.
+
+mslifcak 18 Nov 99 18:14:58
+ More touchup per MSVC++ Win32 agent work.
+
+mslifcak 18 Nov 99 18:20:45
+ More MSVC++ Win32 agent files, gratis Robert Story.
+
+daves 19 Nov 99 11:06:26
+ - (agent/agent_registry.h): Provide missing index allocation defines.
+
+hardaker 19 Nov 99 13:47:01
+ - (mib2c.storage.conf): fix mib2c.storage.conf.
+
+hardaker 19 Nov 99 14:20:25
+ - (snmp_vars.c, snmpd.c, snmp_alarm.h, snmp_api.c):
+ - make snmp_select_info possibly handle alarm timers.
+ - make snmpd use them and call snmp_run_alarms().
+
+hardaker 19 Nov 99 15:24:15
+ - (acconfig.h, config.h.in, configure, configure.in, sedscript.in,
+ disk.c, disk.h, UCD-SNMP-MIB.txt): Patch from Andy HOOD:
+ - monitor disk inode percentages.
+
+nba 22 Nov 99 05:27:15
+ - configure.in: configure test for netinet/ip.h
+
+nba 22 Nov 99 05:28:09
+ snmp_logging.c: only timestamp efter a newline
+
+nba 22 Nov 99 05:28:45
+ - snmpd.c: reinstate snmpd -a functionality
+
+nba 22 Nov 99 05:29:37
+ - pass.c: remove a const casting warning
+
+nba 22 Nov 99 05:32:05
+ - IPV6-TCP-MIB, IPV6-UDP-MIB, ipv6.c, tcp.c: move the IPv6 tcp and udp
+ tables to their proper position in the tree, according to the RFC.
+
+nba 22 Nov 99 06:59:46
+ - ipv6.c: upgrade to the current Kame patch
+
+nba 22 Nov 99 07:16:59
+ - ipv6.c: some more ANSI prototypes
+
+daves 22 Nov 99 07:30:06
+ - (agent_registry.[ch] agentx/client.[ch] agentx/master_admin.c):
+ Index de-allocation, and AgentX index support.
+
+mslifcak 22 Nov 99 08:20:29
+ Retry add MSVC++ project file.
+
+mslifcak 22 Nov 99 08:21:58
+ Add CVS ignore list for win32/libagent.
+
+hardaker 22 Nov 99 08:29:33
+ - (snmptable.c): Patch from Robert Story:
+ - Added ability to use MIB to query tables with non-sequential column OIDs.
+ - Added code to handle sparse tables.
+
+hardaker 22 Nov 99 09:00:45
+ - (usmUser.c): fix oid -> char conversions pointed out by Michael Slifcak.
+
+hardaker 22 Nov 99 09:07:34
+ - (README): added more people to the thanks list.
+
+hardaker 22 Nov 99 09:18:15
+ - (configure, configure.in, host_res.h, hr_filesys.c, hr_storage.c,
+ hr_swrun.c, hr_system.c, bsdi4.h): Patch from Bert Driehuis:
+ - bsdi support for the host resources mib.
+
+hardaker 22 Nov 99 09:24:51
+ - (T016snmpv2cgetfail, T017snmpv2ctov1getfail): update tests for new
+ error messages.
+
+hardaker 22 Nov 99 12:30:05
+ - (vmstat.c, vmstat_freebsd2.c): use header_generic not header_simple_table
+
+hardaker 22 Nov 99 12:49:21
+ - (vacm_vars.c, pass.c): fix oid -> char conversions.
+
+nba 22 Nov 99 12:54:08
+ - *: change the first argument of the config parser functions to a
+ const string
+
+hardaker 22 Nov 99 13:05:05
+ - (acconfig.h, config.h.in, configure, configure.in, tcp.c): Patch
+ from Garrett Wollman:
+ - FreeBSD 4.x fixes.
+
+hardaker 22 Nov 99 16:48:54
+ - (snmp_vars.c): remove creation of initial and template* users.
+
+hardaker 22 Nov 99 16:50:25
+ - (vacm_vars.c, usmUser.c): new config tokens allowing easy user and
+ vacm/user configuration and setup.
+
+hardaker 22 Nov 99 17:02:11
+ - (scapi.c): fix length check of key space.
+
+hardaker 22 Nov 99 17:52:36
+ - (README.snmpv3): update to reflect new and easier .conf mechanisms.
+
+nba 23 Nov 99 01:23:16
+ - ipv6.h: remove an __P that had sneaked in
+
+nba 23 Nov 99 01:24:37
+ - IPSEC-MIB.txt: change some underlines into dashes, and repair the
+ ::= (maybe I should have looked at this file before adding it :-))
+
+nba 23 Nov 99 01:26:26
+ - pass_persist.c: fix some arguments (int => size_t). Thanks to
+ Anthony Shipman <ashipman@erggroup.com>
+
+daves 23 Nov 99 01:37:29
+ - (host/hr_swrun.c): Fix linux process memory usage figures.
+ (Reported by Mitch Shields)
+
+daves 23 Nov 99 02:11:43
+ - (host/hr_storage.c host/hr_swrun.c): Guard against calculation overflow
+
+nba 23 Nov 99 02:20:13
+ - snmp_agent.c: #include <unistd.h> for select prototype
+
+daves 23 Nov 99 05:21:58
+ - (snmp_agent.c agentx/subagent.c):
+ Make main session structure visible throughout the agent,
+ and use this for AgentX subagent as well.
+
+daves 23 Nov 99 05:40:09
+ - (agent_registry.[ch]):
+ - Make index registration API more immediately convenient
+ - Associate such registrations with the main session
+ - new routine to unregister all indexes for a given session
+ - differentiate between ANY index and NEW index
+ - clean up assorted compiler warnings
+
+hardaker 23 Nov 99 17:51:44
+ - (snmptosql): fix from address line, other misc fixes.
+
+daves 24 Nov 99 09:03:00
+ - (agentx/master_admin.c): Release allocated indexes on subagent shutdown.
+
+hardaker 24 Nov 99 09:09:08
+ - (acconfig.h, config.h.in, configure, configure.in, usmUser.c,
+ keytools.c, keytools.h, lcd_time.c, scapi.h, tools.c,
+ keymanagetest.c, scapitest.c, config.h):
+ - force --enable-developer for CVS checkouts.
+ - remove all references to KMT.
+
+hardaker 24 Nov 99 09:16:02
+ - (INSTALL): change editing of config.h note.
+
+hardaker 24 Nov 99 10:43:08
+ - (vacm_vars.c): Patch from Frank Strauss:
+ - allow seperation of mask with both . and :.
+
+mslifcak 24 Nov 99 11:07:05
+ Fix BUG#57 using modified patch supplied by zany@triq.net.
+
+mslifcak 24 Nov 99 11:07:49
+ Fix BUG#57 using 2/3 of patch supplied by zany@triq.net.
+
+nba 25 Nov 99 14:32:47
+ - snmp_api.c, agent_trap.c, snmp_agent.c, snmp_mib.h, snmp_mib.c:
+ fix misalignment of statistics counters
+
+nba 25 Nov 99 14:33:15
+ - snmp_mib.h: fix misalignment of statistics counters
+
+nba 25 Nov 99 14:52:57
+ - usmUser.c: new user is not added unless both auth and priv is specified
+ on createUser directive
+
+nba 25 Nov 99 14:56:12
+ - defaults_store.h, snmp_api.c, snmp_parse_args.c: add defCommunity
+ directive
+ - snmp_api.h, snmp_api.c: add errorcode for malloc failure
+
+nba 25 Nov 99 14:57:57
+ - mib.c: kill yet another silly warning from gcc
+
+nba 26 Nov 99 11:18:23
+ - default_store.c: although read_config is case insensitive, ds_handle_config
+ was not. At the same time it failed to report the problem that
+ it was called but didn't know what to do.
+
+marz 27 Nov 99 06:31:11
+ (agent/kernel.c, testing/eval_tools.sh): fix -r switch to supress error messages about failed kernel and add -r to default testing code so 'make test can be run by user
+
+hardaker 27 Nov 99 09:18:15
+ - (vacm_vars.c): redo rwuser/rouser to allow specification of auth type.
+
+mslifcak 29 Nov 99 05:50:27
+ More HP-UX aCC fixes supplied by Markku Laukkanen.
+
+mslifcak 29 Nov 99 10:30:51
+ Use ntohs macro to carefully obtain the default service port.
+
+mslifcak 29 Nov 99 10:33:45
+ Fix reference to snmplib.
+
+mslifcak 29 Nov 99 10:36:43
+ Remove last vestiges of DEBUG_MALLOC_INC fragments.
+
+mslifcak 29 Nov 99 11:58:37
+ Free STREAM packet buffer when session is closed;
+ Test for close in progress for read, write, select, and timeout functions.
+
+mslifcak 29 Nov 99 12:43:34
+ Use size_t for name_len member.
+
+hardaker 29 Nov 99 14:02:08
+ - (system.c, system.h): implement strcasestr (from Michael Slifcak).
+
+hardaker 29 Nov 99 14:02:50
+ - (parse.c): make best matching (-b) use regex when available.
+
+hardaker 29 Nov 99 14:03:49
+ - (config.h.in, configure, configure.in):
+ - check for regex.h, regcomp, strcasestr.
+
+hardaker 29 Nov 99 14:04:09
+ - (README): another name.
+
+nba 30 Nov 99 03:01:34
+ - snmp_api.h, snmp_mib.[ch]: A couple additional SNMP statistics points
+
+daves 30 Nov 99 07:07:01
+ - (agentx/master.c): Remove redundent routine.
+
+daves 30 Nov 99 07:08:43
+ - (agentx/master_request.c): Fix handling of multi-variable requests to subagents.
+
+mslifcak 30 Nov 99 13:10:40
+ Fix -Td usage description; use switch when current_name is NULL.
+
+mslifcak 30 Nov 99 13:11:14
+ Include ctype.h
+
+hardaker 30 Nov 99 14:30:32
+ - (snmp_parse_args.c, mib.c, mib.h, parse.c): implement regex matching
+ everywhere.
+
+mslifcak 30 Nov 99 14:47:36
+ Use Wes' cool new get_wild_node match method.
+
+mslifcak 30 Nov 99 16:50:41
+ Add multiple match capability to find_best_tree_node, and use it in
+ snmptranslate (new -B option).
+
+mslifcak 1 Dec 99 06:40:07
+ Error check and free resources during regex processing.
+
+mslifcak 1 Dec 99 10:38:18
+ Prevent overflow of object ID in get_module_node.
+ In find_best_tree_node, treat result from recursed call same for match = 0.
+
+mslifcak 1 Dec 99 15:55:56
+ Fix bug #112 and finish patch supplied by Anthony Shipman.
+
+mslifcak 1 Dec 99 16:32:14
+ Use SNMP_MAXBUF when defining large static buffer storage.
+
+nba 2 Dec 99 04:41:55
+ - mib.c: accessing and freeeing env_var misplaces around NULL test
+
+nba 2 Dec 99 04:42:57
+ - snmptrapd.c: fix snmp_clone_pdu2 by using the snmplib version
+
+nba 2 Dec 99 05:06:55
+ - usmUser.c snmpv3.[ch]: move usm_parse_create_usmUser from the agent
+ to the library, so that snmptrapd can use it.
+
+mslifcak 2 Dec 99 09:21:45
+ Fix bug #81 - continue install after error creating persistent directory.
+
+hardaker 2 Dec 99 16:59:55
+ - (parse.c): turn on REGEX_EXTENDED.
+
+nba 3 Dec 99 15:03:48
+ - snmptrapd.c: correct handling of SIGHUP tp reconfigure.
+
+nba 3 Dec 99 15:04:16
+ - snmptrapd_handlers.c: a little nicer error message
+
+nba 3 Dec 99 15:05:13
+ - parse.c: remember to NULL a freed pointer
+
+hardaker 3 Dec 99 16:51:43
+ - (configure, configure.in): switch to PIC from pic.
+
+hardaker 3 Dec 99 16:52:16
+ - (Makefile.in): use $(MAKE) instead of make.
+
+hardaker 3 Dec 99 16:52:51
+ - (vmstat.c): remove duplicate limits.h include.
+
+nba 5 Dec 99 21:49:50
+ - pass.c, pass_persist.c: ensure proper byte ordering when pass'ing
+ ipaddress.
+
+mslifcak 6 Dec 99 09:19:08
+ Show all non-printable subids in dump_oid_to_string.
+ Recurse clear_tree_flags only if necessary.
+
+hardaker 6 Dec 99 13:47:41
+ - (snmp_parse_args.c): default specifications for auth/priv types.
+
+hardaker 6 Dec 99 13:51:34
+ - (snmp_parse_args.c): print error strings returned by generate_Ku().
+
+nba 6 Dec 99 14:32:22
+ - .cvsignore: Make CVS silent about installation files
+
+hardaker 6 Dec 99 14:48:08
+ - (snmpusm.c):
+ - make snmpusm usable again, changing arguments slightly.
+ - make it also use defaults for passphrases, user, etc.
+
+hardaker 6 Dec 99 14:56:21
+ - (Sv3config, T030snmpv3usercreation): make v3 testing work again.
+
+hardaker 6 Dec 99 14:58:28
+ - (snmpusm.c): fix usage for new args.
+
+mslifcak 6 Dec 99 15:09:53
+ Convert USM_ERR* to SNMPERR_USM*.
+
+nba 6 Dec 99 15:13:21
+ - system.c, config.h, win32.dsw, *.dsp, libsnmp.def: cleaning up for VC builds
+
+mslifcak 6 Dec 99 16:31:26
+ More fun updating MS VC build of apps and library.
+
+mslifcak 7 Dec 99 08:03:06
+ Use argv[0] since the app wont be snmpgetnext, probably.
+
+daves 7 Dec 99 08:29:55
+ - (agent/agent_read_config.[ch] agent/snmp_vars.[ch] agent/snmpd.[ch]
+ snmplib/read_config.[ch] snmplib/snmp_api.c):
+ - Use the saved application name for registering config handlers
+ (N.B: This change will need to be applied to MIB modules as well)
+
+hardaker 7 Dec 99 09:14:30
+ - (hr_other.c): shorten cpu description length.
+
+hardaker 7 Dec 99 09:17:41
+ - (sysORTable.c): make sysOrIndex not-accessible, as it should be.
+
+hardaker 7 Dec 99 09:32:02
+ - (UCD-SNMP-MIB.txt): Patch from Juergen Schoenwaelder:
+ - convert to SMIv2 and cleanup.
+
+hardaker 7 Dec 99 13:45:59
+ - (snmpwalk.c):
+ - New ability to peform a get on the requested OID when either no
+ results are returned or when the user requests an inclusive option.
+ - New ability to print number of variables found at the end.
+
+hardaker 7 Dec 99 13:54:11
+ - (snmpwalk.1): document -Ci and -Cp (badly).
+
+mslifcak 7 Dec 99 15:23:44
+ Eliminate multiplying by sizeof(char) or sizeof(unsigned char);
+ agentx/client.c - snmp_free_varbind replaces free in four places;
+ snmpv3/usmUser.c - usm_free_user replaces free in one place.
+
+hardaker 8 Dec 99 09:19:08
+ - (mib.c): register a config token for suffix printing.
+
+hardaker 8 Dec 99 14:08:20
+ - (UCD-SNMP-MIB.txt): make mrIndex IMPLIED since it is in the code.
+
+hardaker 8 Dec 99 14:41:53
+ - (mib.c): fix -Os and index based oid printing to work again.
+
+mslifcak 8 Dec 99 15:01:20
+ Include getopt.h to define optarg.
+
+mslifcak 8 Dec 99 15:04:54
+ Add missing dskPercentNode to DskEntry (thanks to
+ Michael Kirkham <support@iwl.com>).
+
+hardaker 8 Dec 99 15:23:07
+ - (mib.c, parse.c, parse.h):
+ - remembered IMPLIED indexes.
+ - properly print OIDs with length prefixes on parsed OIDs so
+ cutting/pasting of them works.
+ - properly print strings and oids that are IMPLIED.
+ - print strings in either ' or " quotes depending on if their IMPLIED.
+
+hardaker 8 Dec 99 15:26:51
+ - (README): add Juergen.
+
+hardaker 8 Dec 99 15:28:54
+ - (*..Makefile.in): make depend.
+
+hardaker 8 Dec 99 15:29:52
+ - (snmpd.c): move sys/param out of ifdef FD_SET.
+
+hardaker 8 Dec 99 15:47:02
+ - (*..Makefile.in): A real make depend with no ssl dependancies, etc.
+
+hardaker 8 Dec 99 15:49:32
+ - (makefileindepend.pl, makenosysdepend.pl, remove-files):
+ - move the make depend perl scripts to the top level where they only
+ need to be edited once.
+
+hardaker 8 Dec 99 17:13:17
+ - (acconfig.h, config.h.in, master.c, read_config.c, system.c, system.h):
+ - implement mkdirhier() and use it for persistent storage and agentx
+ socket file creation.
+
+daves 9 Dec 99 07:34:03
+ - (man/snmp_trap_api.3): Initial documentation for agent trap generation.
+
+nba 9 Dec 99 07:34:08
+ - mib.c: implement MIB::label
+
+nba 9 Dec 99 07:49:34
+ - snmpcmd.1: support MIB::label
+
+mslifcak 9 Dec 99 08:14:59
+ Patches supplied by Juergen Schoenwaelder.
+
+hardaker 9 Dec 99 10:08:26
+ - (Makefile.top, config.h.in, configure, configure.in,
+ agent/Makefile.in, snmplib/Makefile.in):
+ - fixed --enable-shared (at least on linux).
+
+hardaker 9 Dec 99 15:26:23
+ - (keytools.c): Patch from Leonard Gomelsky:
+ - generate_Ku() speed improvements.
+
+hardaker 9 Dec 99 16:16:40
+ - (UCD-SNMP-MIB.txt): changed all instances of kb to kB.
+
+hardaker 9 Dec 99 16:53:14
+ - (snmpnetstat/Makefile.in): fix for --enable-shared
+
+hardaker 9 Dec 99 17:09:23
+ - (agent/*Makefile.in): fix for --enable-shared on hpux
+
+nba 10 Dec 99 03:06:18
+ - master.c: add a missing #include <netinet/in.h> (at least for Solaris).
+
+nba 10 Dec 99 03:07:06
+ - pass.c: fix some buf/buf2 confusion
+
+nba 10 Dec 99 03:09:33
+ - pass_persist.c: fix some buf/buf2 confusion
+
+nba 10 Dec 99 03:10:30
+ - read_config.c: add some missing const specifiers
+
+nba 10 Dec 99 03:20:10
+ - (various): changes to compile snmpd with VC++ 5.0 (Release mode)
+
+mslifcak 10 Dec 99 07:28:33
+ Fix to build executable agent on HP-UX.
+
+mslifcak 10 Dec 99 10:23:36
+ Apply Dave's patch to fix max varbinds testing on GETBULK.
+
+marz 10 Dec 99 10:44:29
+ (snmlib/snmp_api.c): fix bug in _sess_copy where pointers that were not owned by newly created session could get mistakenly freed if errors were encountered during session copy - also eliminate some redundant copying of security{Auth|Priv}Key data
+
+mslifcak 10 Dec 99 13:03:58
+ Fix HP-UX problem with ipDefaultTTL.
+
+daves 13 Dec 99 03:17:41
+ - (agent_registry.c): Handle delegated MIB regions properly when split.
+
+daves 13 Dec 99 03:18:38
+ - (agent_trap.c): allow specification of enterprise OID when sending traps
+
+daves 13 Dec 99 04:43:14
+ - (agent/snmpd.c agent/mibgroup/smux/smux.[ch]):
+ - Patch to get SMUX support working with the new agent architecture.
+ This is probably not The Right Way To Do Things Now, but it works.
+ Thanks to Nick Amato and Mike Michaud.
+
+mslifcak 13 Dec 99 09:49:28
+ Added patch from M.Michaud to use send_enterprise_trap_vars.
+
+hardaker 13 Dec 99 09:57:37
+ - (DLMOD-MIB.txt, UCD-DLMOD-MIB.inc, UCD-DLMOD-MIB.txt):
+ - Juergens patch to move DLMOD-MIB -> UCD-DLMOD-MIB and -> SMIv2.
+ - moved to the experimental tree.
+
+mslifcak 13 Dec 99 12:04:15
+ Clean also removes generated default_store.3.h .
+
+mslifcak 13 Dec 99 13:54:27
+ Sanity checks added to _get_symbol.
+
+hardaker 13 Dec 99 14:20:10
+ - (config.h.in, configure, configure.in): --with-efence implemented.
+ - (forced checking for --enable-developer and CVS checkouts)
+
+mslifcak 13 Dec 99 14:54:31
+ Fix problem printing IMPLIED indices of OBJECTID type.
+
+mslifcak 13 Dec 99 15:12:01
+ Finish symbol conversion with numeric when subtree is leaf node.
+
+mslifcak 13 Dec 99 16:03:00
+ Allow sprint_variable to work even if no MIB files were read.
+
+hardaker 14 Dec 99 08:08:00
+ - (snmp_parse_args.c, snmptranslate.c, snmptrapd.c, default_store.h,
+ mib.c, mib.h):
+ - argument shuffling...
+ -I for input args created, and -OR moved there.
+ -Ib created.
+ -TB created for snmptranslate (was -B).
+
+hardaker 14 Dec 99 08:41:41
+ - (IANAifType-MIB.txt, UCD-SNMP-MIB.txt): Patch from Juergen Schoenwaelder:
+ - updates.
+
+hardaker 14 Dec 99 14:54:09
+ - (keytools.c): reverse generate_Ku optimizations, as they don't work.
+
+hardaker 14 Dec 99 15:19:35
+ - (Makefile.in): DLMOD -> UCD-DLMOD
+
+hardaker 14 Dec 99 16:05:08
+ - (configure, configure.in): move -lefence check up to front (last in link).
+
+hardaker 14 Dec 99 16:05:37
+ - (header_complex.c): get next in link list before deleting root.
+
+mslifcak 15 Dec 99 04:21:27
+ Isolate and retouch deprecated command line options.
+
+mslifcak 15 Dec 99 05:51:00
+ Share kstat fd iff ucd-snmp/memory_solaris2 is also configured.
+
+hardaker 15 Dec 99 09:17:03
+ - (EtherLike-MIB.txt, IPFILTER.txt, UCD-IPFILTER-MIB.inc,
+ UCD-IPFILTER-MIB.txt): Patch from Juergen Schoenwaelder:
+ - Even more updates.
+
+hardaker 15 Dec 99 09:19:14
+ - (SNMPv2-PARTY-MIB.txt SNMPv2-M2M-MIB.txt ): removed.
+
+mslifcak 15 Dec 99 09:42:44
+ Remove snmp_log_syslog, snmp_log_filelog, snmp_log_stderrlog;
+ Simplify snmp_log_string.
+
+mslifcak 15 Dec 99 09:56:24
+ Add time marker create, set, and delta time check methods.
+
+mslifcak 15 Dec 99 11:08:19
+ Replace kc from memory_solaris2.c with kstat_fd, defined in kernel_sunos5.c.
+
+nba 16 Dec 99 23:05:47
+ - kernel.c: output error string, not number
+
+nba 16 Dec 99 23:06:58
+ - snmpd.c: \n terminate some log messages
+
+nba 16 Dec 99 23:08:02
+ - smux.[ch]: fix some prototypes and includes.
+
+nba 16 Dec 99 23:08:54
+ - snmptranslate.c: be explicit in the -t warning
+
+nba 16 Dec 99 23:09:42
+ - mib.c: fix a tail recursion elimination problem printing oids
+
+nba 16 Dec 99 23:10:31
+ - snmpv3.c: a more spevific help message for defVersion
+
+nba 17 Dec 99 02:08:17
+ - mib.c: kill that tail recursion elimination, it just adds too many
+ conditionals. Properly output an empty string index.
+
+nba 17 Dec 99 02:09:18
+ - snmp_parse_args.c: remove some superfluous usage() calls.
+
+nba 17 Dec 99 02:14:18
+ - snmptable.c: cleanup of the "new" mib walk to determine fields. Make it
+ default (don't even document the -C compatibility option). Ignore
+ not-accessible fields in the walk.
+
+nba 17 Dec 99 02:18:30
+ - snmptrapd.c: make the oids given to trapd handlers properly .0 terminated.
+ Add a SNMP-COMMUNITY-MIB::snmpTrapAddress.0
+ Add syslog of v2 traps and informs
+
+nba 17 Dec 99 03:22:39
+ - libsnmp.def: add some function names
+
+hardaker 17 Dec 99 07:03:09
+ - (snmpcmd.1): document -I and -O flags.
+
+hardaker 17 Dec 99 07:05:08
+ - (snmpcmd.1): mention that -IR and -Ib are actually used by default.
+
+hardaker 17 Dec 99 07:13:03
+ - (snmp.conf.5.def): document a bunch of new configuration options.
+
+hardaker 17 Dec 99 07:26:05
+ - (snmpd.conf.5.def): document rocommunity, rwcommunity, rouser, rwuser.
+
+hardaker 17 Dec 99 07:28:34
+ - (snmpd.conf.5.def): document the file directive.
+
+hardaker 17 Dec 99 07:40:43
+ - (snmpd.conf.5.def): document createUser.
+
+hardaker 17 Dec 99 10:10:42
+ - (NEWS): first pass at changes.
+
+hardaker 17 Dec 99 10:11:02
+ - (sedscript.in): PERSISTENT_DIRECTORY token added.
+
+hardaker 17 Dec 99 10:11:34
+ - (snmpd.c): reorder init() routines for -H to prevent segfaulting.
+
+hardaker 17 Dec 99 10:16:32
+ - (Makefile.in): put snmpd.o into the object list, and remove it from
+ direct compilation in the CC link line.
+
+hardaker 17 Dec 99 10:17:05
+ - (usmUser.c): changed help line of createUser to seperate DES token
+ from the passphrase.
+
+hardaker 17 Dec 99 10:17:28
+ - (snmp_parse_args.c): removed -R from the -h output.
+
+hardaker 17 Dec 99 10:18:24
+ - (NEWS): second pass.
+
+hardaker 17 Dec 99 10:18:42
+ - (snmp_agent_api.3): re-structure based on recent changes.
+
+mslifcak 17 Dec 99 14:23:25
+ Fixed a few spelilng errors.
+
+mslifcak 17 Dec 99 15:21:39
+ Add Bill Fumerola's patch for FreeBSD 4.x to use swapinfo.
+ Include FreeBSD 4.x specific memory and vmstat when building that agent.
+
+mslifcak 17 Dec 99 15:41:14
+ No dummy values for FreeBSD, please.
+
+hardaker 17 Dec 99 15:46:08
+ - (snmp_alarm.c): missing ! operater on signal test.
+
+hardaker 17 Dec 99 15:55:48
+ - (NEWS): mention -I.
+
+hardaker 17 Dec 99 15:56:27
+ - (agent_read_config.c, agent_registry.c, snmp_vars.c):
+ - include "snmp_alarm.h" for mib modules that need the callback def.
+
+hardaker 17 Dec 99 15:57:10
+ - (header_complex.c, header_complex.h): completely restructured.
+ - drasticly reduces memory usage for large data sets (1/3).
+
+daves 20 Dec 99 03:01:49
+ - (agentx/README.agentx): Updated to describe current status.
+
+daves 20 Dec 99 04:15:55
+ - (agent_trap.c snmp_vars.c mibII.[ch] mibII/*.c mibII/sysORTable.h):
+ - Use SNMP_OID prefix definitions in OID specifications.
+ - Register the various MIB-2 modules separately in sysORTable.
+
+hardaker 20 Dec 99 06:43:40
+ - (snmp_parse_args.c): Force set to 1 for -D so multiple switches can
+ be given (ie, don't toggle the value).
+
+hardaker 20 Dec 99 06:48:24
+ - (Makefile.in): moved kernel.o into the libucdagent library.
+
+hardaker 20 Dec 99 13:23:25
+ - (IPSEC-MIB.txt): removed
+
+hardaker 20 Dec 99 13:25:15
+ - (IPFWACC-MIB.txt): moved to UCD-IPFWACC-MIB.txt
+
+hardaker 20 Dec 99 13:26:09
+ - (UCD-IPFWACC-MIB.txt): moved and updated from IPFWACC-MIB.txt
+
+hardaker 20 Dec 99 13:30:06
+ - (UCD-IPFWACC-MIB.txt): moved table to one level deeper under mib node.
+
+hardaker 20 Dec 99 13:30:36
+ - (ipfwacc.c): moved table to one level deeper under mib node.
+
+hardaker 20 Dec 99 15:38:34
+ - (Makefile.in): IPFWACC-MIB.txt -> UCD-IPFWACC-MIB.txt
+
+hardaker 20 Dec 99 17:19:18
+ - (agent_trap.c): make uptime a long for 64bit architectures.
+
+hardaker 20 Dec 99 17:20:15
+ - (agentx/protocol.c): make a things size_t instead of u_int (for 64bit code).
+
+hardaker 20 Dec 99 17:20:55
+ - (snmp_api.c): Digital Unix hack for bad recvfrom implementation.
+
+hardaker 20 Dec 99 17:31:45
+ - (EXAMPLE.conf.def): minor note.
+
+hardaker 20 Dec 99 17:32:23
+ - (NEWS): mention SMIv2 updates.
+
+hardaker 20 Dec 99 17:32:37
+ - (mibincl.h): add agent_trap.h
+
+hardaker 20 Dec 99 17:34:31
+ - (version.h bug-report sedscript.in): version tag ( 4.1.pre1 )
+
+nba 21 Dec 99 02:37:19
+ - snmpd.c, smux.c, snmp_api.c: take away some unused variables.
+
+nba 22 Dec 99 02:41:42
+ - memory_freebsd2.c: make it work (again) for FreeBSD-2 :-)
+
+nba 22 Dec 99 02:43:15
+ - hr_storage.c: kill a dummy value
+
+nba 22 Dec 99 05:46:21
+ - system.c: naughty, naughty Niels, just reindenting ...
+
+nba 22 Dec 99 05:47:11
+ - system_mib.c: use some #defines i place of numbers
+
+nba 22 Dec 99 05:58:18
+ - vacm routines: alignment with RFC mibs, preparing for trap generation
+ and a better integration with variable tree walking
+
+hardaker 22 Dec 99 15:12:26
+ - (master.c): use snmp_sess_open for the second try at opening the
+ master port.
+
+hardaker 22 Dec 99 15:13:05
+ - (master_request.c): increase max vars to 64 (was 16). I have a
+ table with more than that number in columns, which breaks snmptable.
+
+hardaker 22 Dec 99 16:30:01
+ - (vmstat_solaris2.c, vmstat_solaris2.h): Patch from Jochen Kmietsch:
+ - first pass at vmstat support for solaris.
+
+hardaker 23 Dec 99 08:21:37
+ - (vmstat_solaris2.c): Patch from Jochen Kmietsch:
+ - non 80-column wrapped version.
+
+hardaker 28 Dec 99 15:42:08
+ - (master_request.c): remove the ! in front of in_a_view, which changed.
+
+hardaker 30 Dec 99 07:51:36
+ - (snmpd.c): usage line order messed up, as pointed out by Robert Story.
+
+mslifcak 30 Dec 99 12:00:58
+ Fix compile errors.
+
+mslifcak 31 Dec 99 09:31:12
+ Fix bug # 122
+
+mslifcak 31 Dec 99 09:32:58
+ Apply patch provided by Serg Trushnikov <sat@zmail.ru> for AIX 4.2.1 knlist
+
+mslifcak 31 Dec 99 10:11:12
+ Fix bug #125 - insert underscore into struct snmp_ipaddr member names.
+
+mslifcak 31 Dec 99 10:33:16
+ Autoconf patch c/o Albert Chin-A-Young <china@thewrittenword.com>
+
+mslifcak 31 Dec 99 10:36:46
+ Fix warnings of uninitialized variables.
+
+mslifcak 31 Dec 99 12:43:50
+ Fix bug #48 : no strcasecmp/strncasecmp for Sinix
+
+mslifcak 31 Dec 99 13:27:44
+ Apply some NetBSD 1.3.x, 1.4 patches c/o Grea A. Woods <woods@planix.com>
+
+nba 3 Jan 00 15:23:21
+ - EXAMPLE.conf.def: adapt to changes in valid vacm syntax
+
+nba 3 Jan 00 15:26:07
+ - snmp_vars.c: include agent_registry.h only once
+
+nba 3 Jan 00 15:26:51
+ - snmpd.c: add a missing const specifier
+
+nba 3 Jan 00 15:27:29
+ - mibII.h: add prototype for init_mibII
+
+nba 3 Jan 00 15:28:24
+ - wombat.[ch]: correct prototype for wombat_parse_config
+
+nba 3 Jan 00 15:30:26
+ - system.h: add prototype for strcasecmp
+
+nba 3 Jan 00 15:32:59
+ - parse.c: fix File variable being left pointing into the stack.
+ Ignore .index file on WIN32 platform
+
+nba 3 Jan 00 15:34:22
+ - mib.c: also note TEXTUAL CONVENTION in -Td output
+
+nba 3 Jan 00 15:39:40
+ - snmpcmd.1: add snmpbulkget to list of applications
+ - snmptranslate.1: explain -T outputs
+ - snmptrapd.conf.5.def: defalt traphandler is implemented
+
+hardaker 4 Jan 00 08:58:24
+ - (README, FAQ): Japan mirror location change.
+
+hardaker 4 Jan 00 10:33:54
+ - (Makefile.in): install struct.h
+
+hardaker 4 Jan 00 10:35:06
+ - (snmp_agent.c): deal with blocking better in snmp_agent_check_and_process().
+
+hardaker 4 Jan 00 16:27:45
+ - (config.h.in, configure, configure.in): Patch from Sander Steffann:
+ - Add -I/usr/include/rpm because of badly written rpm header files.
+
+nba 4 Jan 00 22:12:10
+ - EXAMPLE.conf.def, FAQ, snmpd.conf.5.def: remove all traces of security
+ model "any" in "group" configuration directives
+
+nba 4 Jan 00 23:50:27
+ - parse.c: #ifdef some variables not used under win32
+
+nba 4 Jan 00 23:51:11
+ - snmptrapd.c: implement trand handlers for win32
+
+daves 6 Jan 00 01:58:56
+ - (mibgroup/mibII.c): Remove redundant file
+
+hardaker 6 Jan 00 08:57:31
+ - (util_funcs.h): properly wrap struct.h include directive for
+ non-source-directory include.
+
+marz 6 Jan 00 12:56:50
+ update syntax (exact)
+
+marz 6 Jan 00 13:07:03
+ we should not print to stderr if stderr logging is diabled - this thows off the alignment of test output for 'make test' in both ucd-snmp and Perl/SNMP
+
+marz 6 Jan 00 13:14:10
+ update config access syntax (exact)
+
+hardaker 6 Jan 00 15:08:28
+ - (COPYING): y2k bug.
+
+hardaker 6 Jan 00 15:08:48
+ - (mib2c): removed a debugging statement.
+
+hardaker 6 Jan 00 15:09:20
+ - (mib2c.conf): unquoted quotes quoted.
+
+hardaker 7 Jan 00 09:29:06
+ - (snmp_agent.c): better handling of write failures.
+
+hardaker 7 Jan 00 10:38:48
+ - (snmpTargetAddrEntry.c, snmpTargetParamsEntry.c): update to v4 API set code.
+
+hardaker 7 Jan 00 11:22:40
+ - (snmptranslate.c): Patch from Robert Story:
+ - handle multiple translated OIDs.
+
+hardaker 7 Jan 00 16:21:50
+ - (vacm_vars.c): properly group rw/rousers into usm not v1/v2c.
+
+nba 7 Jan 00 23:43:10
+ - configure.in: some missing "x" in tests for --with-openssl and
+ --disable-developer
+
+nba 8 Jan 00 00:56:30
+ - configure.in: bugfix for a bugfix bug
+
+mslifcak 8 Jan 00 11:44:58
+ Fix build for Linux RedHat 6.1 (cant link libwrap without libnsl).
+
+mslifcak 8 Jan 00 12:07:44
+ Use knlist iff aix4 and HAVE_KNLIST [not complete w/o configure mods]
+
+daves 10 Jan 00 01:37:32
+ - (agent/mibgroup/mibII.h): Re-remove redundant prototype.
+
+daves 10 Jan 00 02:31:39
+ - (snmplib/snmp_api.c): Differentiate max-repetition and non-repeater errors.
+
+daves 10 Jan 00 03:06:42
+ - (agent/snmp_agent.c): Count numbers of variables requested/set
+
+daves 10 Jan 00 06:12:40
+ - (snmplib/system.c): Re-structure get_uptime() to cache boot time.
+
+mslifcak 10 Jan 00 13:14:03
+ Allow MSVC++ 5.x users to build using this workspace.
+
+mslifcak 10 Jan 00 13:21:30
+ Qualify use of withval to define library and include search paths.
+
+marz 10 Jan 00 14:21:14
+ Checking in SNMP-3.1.0b1
+
+marz 10 Jan 00 14:34:50
+ *** empty log message ***
+
+marz 10 Jan 00 14:40:04
+ add mibload
+
+hardaker 10 Jan 00 15:36:18
+ - (mibincl.h): include stdlib.h and malloc.h.
+
+hardaker 10 Jan 00 15:36:40
+ - (Sv3config): remove the trailing space.
+
+hardaker 10 Jan 00 15:38:44
+ - (config.h.in, configure, configure.in):
+ - make --without-efence work.
+ - check for -lnsl more explicitly.
+
+mslifcak 10 Jan 00 16:30:51
+ ucdDemoPublic.c - remove uninitialized variables from write method.
+ snmp_vars.c - proper oid compare; no copy from save if oids exact match
+ snmpd.c - terminate statement.
+
+mslifcak 10 Jan 00 16:31:16
+ snmptranslate.1 - remove junk line.
+
+mslifcak 10 Jan 00 16:31:38
+ snmptranslate.c - simple default case.
+
+mslifcak 10 Jan 00 16:32:08
+ snmp_api.c - better comment for snmp_oid_compare.
+ read_config.c - remove sizeof(u_char) from malloc size calc.
+ scapi.h - spell check.
+
+mslifcak 11 Jan 00 01:33:45
+ Trolling for malloc errors; more graceful degradation.
+
+mslifcak 11 Jan 00 01:53:08
+ Glean refs to mibII.o from this makefile.
+
+mslifcak 11 Jan 00 07:44:50
+ Add IN_UCD_SNMP_SOURCE to not break Win32 builds.
+
+mslifcak 11 Jan 00 07:59:23
+ Keep win32 release build from breaking.
+
+mslifcak 11 Jan 00 08:10:10
+ Init file count at zero, not by incrementing random value.
+
+mslifcak 11 Jan 00 09:13:38
+ Restore memdup usage to its former luster.
+
+marz 11 Jan 00 10:37:21
+ remove bad session test - session.t has it already - note the call to gethostbyname can hang for some time if DNS is not setup correctly - anyone know a way arround this?
+
+mslifcak 11 Jan 00 15:05:09
+ Use CFLAGS when linking (could have profile switch, etc).
+
+hardaker 12 Jan 00 11:16:27
+ - (snmpv3.c): cast malloc returns.
+
+mslifcak 12 Jan 00 21:09:47
+ Use DEBUGMSGOID liberally, replacing sprint_objid; small speedup.
+
+daves 13 Jan 00 02:46:47
+ - (agent/snmp_vars.c): Remove extraneous bracket.
+
+mslifcak 13 Jan 00 05:36:21
+ No get_boottime support for cygwin (yet). Hopefully a temporary condition.
+
+daves 13 Jan 00 06:31:44
+ - (snmplib/parse.[ch]): Unload MIB module
+ (N.B: Somewhat simplistic with regard to multiply-loaded nodes)
+
+daves 13 Jan 00 06:33:40
+ - (snmplib/parse.c): More complete handling of unloading MIB modules.
+
+mslifcak 14 Jan 00 09:33:39
+ Small compile fix and debug message restoration.
+
+hardaker 14 Jan 00 11:34:25
+ - (bug-report): grep for configure flags
+
+hardaker 14 Jan 00 16:09:09
+ - (scapi.c): implement DES encryption.
+
+hardaker 14 Jan 00 16:10:29
+ - (NEWS): remove export control note about DES.
+
+daves 17 Jan 00 06:13:39
+ - (man/snmptrapd.8): Describe default logging behaviour.
+
+daves 17 Jan 00 09:02:32
+ - (agent/snmp_vars.c): Discard "too-late" responses from overlapped regions.
+
+marz 17 Jan 00 12:47:58
+ added v2 trap
+
+marz 18 Jan 00 07:00:26
+ modified for v2-trap.
+
+marz 18 Jan 00 07:54:12
+ fix error messages and return vals for trap funcs, clean up pdu
+
+mslifcak 18 Jan 00 08:14:42
+ Prevent array bounds error when creating specific trap oid.
+
+mslifcak 18 Jan 00 14:23:44
+ Latest vmstat_solaris2 from the author Jochen Kmietsch.
+
+mslifcak 18 Jan 00 21:22:06
+ Cleanup around ip6_vars.h include (no #if 0)
+
+mslifcak 18 Jan 00 21:25:53
+ Remove commented out objects that are MAX-ACCESS not-accessible.
+
+mslifcak 18 Jan 00 21:29:01
+ 1.Make snmp_get_do_logging visible from DLL
+ 2.Apply Win32 patch from R.Story to activate mib stats module (snmp_mib).
+
+mslifcak 18 Jan 00 21:37:02
+ Consistent getpagesize (first divide by 1024).
+
+daves 20 Jan 00 04:25:05
+ - (snmplib/snmp_api.c): Support selective binding of server addresses.
+
+mslifcak 21 Jan 00 01:46:04
+ Remove party crud; spell check.
+
+mslifcak 21 Jan 00 01:46:41
+ Add const to cleanup a few signatures.
+
+mslifcak 21 Jan 00 01:49:35
+ Minimize data handling and use register variabies in
+ snmp_oid_compare and compare_tree.
+
+marz 21 Jan 00 07:27:13
+ added v3 inform
+
+marz 21 Jan 00 08:00:27
+ inform.
+
+marz 21 Jan 00 08:13:25
+ inform
+
+marz 21 Jan 00 10:47:24
+ *** empty log message ***
+
+mslifcak 21 Jan 00 11:19:09
+ config_arch_require solaris2 version of vmstat.
+
+nba 23 Jan 00 08:51:39
+ - parse.c: add some more error checking to getoid
+
+nba 23 Jan 00 12:42:11
+ - parse.c: fix merging of anonymous nodes when they are named
+
+nba 23 Jan 00 12:43:54
+ - parse.c: errenous => erroneous
+
+marz 23 Jan 00 16:41:06
+ handle adding OPAQUE vars for setting and traps etc.
+
+daves 24 Jan 00 07:21:34
+ - (examples/{example,wombat}.[ch]):
+ - Consolidated example modules into one, including config and SET support.
+
+marz 24 Jan 00 08:59:32
+ *** empty log message ***
+
+mslifcak 24 Jan 00 09:44:45
+ Make sure kstat_fd is initialized before being used.
+
+mslifcak 24 Jan 00 09:55:32
+ Fix Bug #144 items 1,3,4 : case insensitive check for "all" keyword.
+
+mslifcak 24 Jan 00 10:05:12
+ Itojun's netbsd ELF patch + remove wombat [Dave's example fix]
+
+mslifcak 24 Jan 00 10:14:56
+ Fix printing IMPLIED index (from associate of J. Kmietsch) modified and applied.
+
+marz 24 Jan 00 10:36:43
+ *** empty log message ***
+
+marz 25 Jan 00 06:49:43
+ syntax for win32 build
+
+marz 25 Jan 00 11:47:12
+ add missing synbols for perl/SNMP module
+
+marz 25 Jan 00 12:05:59
+ additional win32 install notes
+
+nba 25 Jan 00 13:52:42
+ - parse.c: fix a missing initialization of tc_index
+
+hardaker 25 Jan 00 13:55:33
+ - (vestinternett/diskio.[ch]): Ragnar Kjrstad's diskio mib.
+
+hardaker 25 Jan 00 13:56:02
+ - (VEST-INTERNETT-MIB.txt): Ragnar Kjrstad's diskio mib.
+
+nba 25 Jan 00 14:12:58
+ - HOST-RESOURCES-MIB.txt, HOST-RESOURCES-TYPES.txt, Makefile.in:
+ Update to the current draft HOST-RESOURCES (draft-ops-hostmib-01)
+
+hardaker 25 Jan 00 14:47:59
+ - (configure): help update
+
+hardaker 25 Jan 00 14:50:56
+ - (snmp_alarm.3, snmp_alarm.c): Patch from Frank Strauss:
+ - fix registration function to do what it says it should do.
+
+mslifcak 25 Jan 00 19:30:51
+ Larger buffer for print_module_name; Fix possible null deref in get_tc.
+
+mslifcak 25 Jan 00 21:46:14
+ mib.c:print_tree_node - show module name once in -- FROM;
+ parse.c: show "Cannot find module" once per missing module.
+
+mslifcak 26 Jan 00 07:14:50
+ fix compile error when --without-root-access is used (strauss@ibr.cs.tu-bs.de)
+
+mslifcak 26 Jan 00 07:26:22
+ Acknowledge more contributors.
+
+hardaker 26 Jan 00 10:24:21
+ - (getValues.pm) getValues.pm was noted missing
+
+hardaker 26 Jan 00 15:29:54
+ - (UCD-DISKIO-MIB.inc, UCD-DISKIO-MIB.txt, VEST-INTERNETT-MIB.txt):
+ Patch from Juergen Schoenwaelder:
+ - fix the diskio mib, convert to SMIv2, and move to ucdExperimental.
+
+hardaker 26 Jan 00 15:30:42
+ - (UCD-DLMOD-MIB.txt): Patch from Juergen Schoenwaelder:
+ - prefix oid with "ucd".
+
+hardaker 26 Jan 00 15:31:00
+ - (UCD-IPFILTER-MIB.txt): Patch from Juergen Schoenwaelder:
+ - prefix oids with "ucd".
+
+hardaker 26 Jan 00 15:32:25
+ - (UCD-SNMP-MIB.txt): Patch from Juergen Schoenwaelder:
+ - clean up and reformat sub-registration comments.
+
+hardaker 26 Jan 00 15:34:20
+ - (UCD-DEMO-MIB.txt, UCD-DISKIO-MIB.txt, UCD-DLMOD-MIB.txt,
+ UCD-IPFILTER-MIB.txt, UCD-IPFWACC-MIB.txt, UCD-SNMP-MIB.txt):
+ - correct ucd-snmp-coders email address to replace "ece" with "ucd-snmp".
+
+hardaker 26 Jan 00 16:06:31
+ - (agent_trap.c, agent_trap.h, snmpd.conf.5.def): Patch from Frank Strauss:
+ - add ability to allow sending traps to ports other than 162.
+
+hardaker 26 Jan 00 16:28:22
+ - (Makefile.in, Makefile.in, Makefile.in, Makefile.in):
+ - make depend.
+
+hardaker 26 Jan 00 16:53:41
+ - (snmpv3.c): fix priv key length extrapolation. Should be done differently?.
+
+hardaker 26 Jan 00 16:54:43
+ - (Sv3DESconfig, T023snmpv3getMD5DES): fix DES test so it works.
+
+hardaker 26 Jan 00 17:15:07
+ - (snmpcmd.1, snmptrapd.conf.5.def, snmpusm.1):
+ - badly done updates.
+
+hardaker 26 Jan 00 17:18:17
+ - (version.h bug-report sedscript.in): version tag ( 4.1.pre2 )
+
+hardaker 26 Jan 00 17:32:41
+ - (configure, configure.in): allow ',' seperated --with-*-modules flag values.
+
+hardaker 26 Jan 00 19:22:53
+ - (configure, configure.in): comma, comma, comma, comma, comma-chameleon.
+
+hardaker 27 Jan 00 08:33:43
+ - (default_store.c): make config parser handle "" (null) parsed strings.
+
+marz 27 Jan 00 11:14:09
+ remove no-op snmp_synch_setup
+
+mslifcak 27 Jan 00 14:51:39
+ 1. Fix memory leak when anonymously named nodes are used.
+ 2. Hack around smicng's "SMI " statements to prevent other memory leaks.
+
+mslifcak 27 Jan 00 16:13:58
+ Remove hack around "SMI" token; keep the good part of the previous patch.
+
+mslifcak 28 Jan 00 07:18:09
+ Some variable renaming for consistency, error checking
+ improved, missing string.h included. Patch supplied by author.
+
+mslifcak 28 Jan 00 12:30:20
+ Fix spell LITTLE_ENDIAN. Thanks to talman@hitt.nl.
+
+mslifcak 28 Jan 00 12:38:22
+ Change agentx_{build,parse}_short . Thanks to Gerard Talman@hitt.nl.
+
+mslifcak 28 Jan 00 12:52:25
+ This with previous two changes completes a patch for items 2,3,4
+ for bug #149.
+
+nba 30 Jan 00 03:01:52
+ - host.h: config_require_mib(HOST-RESOURCES-TYPES)
+
+nba 30 Jan 00 03:04:22
+ - hr_disk.c: convert to 1k blocks
+
+nba 30 Jan 00 03:09:38
+ - hr_storage.c: convert from pages to 1k blocks
+
+nba 30 Jan 00 03:11:28
+ - if.c: defensive test for missing objects (it might fail to show
+ down status properly)
+
+marz 30 Jan 00 08:19:34
+ create V3 user entry, cleanup
+
+marz 30 Jan 00 10:42:36
+ clean up before release - update version, release notes
+
+ Note: KNOWN BUGS
+ the new quoted OCTETSTR instance identifiers returned by get_symbol
+ are not compatible with the perl/SNMP module (__get_label_iid)
+
+marz 30 Jan 00 10:44:37
+ clean up before release - update version, release notes
+
+ Note: KNOWN BUGS
+ the new quoted OCTETSTR instance identifiers returned by get_symbol
+ are not compatible with the perl/SNMP module (__get_label_iid)
+
+ not sure that this ever worked - will have to look at old OCTETSTR
+ behaviour and see how to recreate it
+
+marz 30 Jan 00 10:58:02
+ clean up before release - update version, release notes etc.
+
+daves 31 Jan 00 01:05:16
+ - (agent/agent_registry.h): Log failed MIB registrations.
+
+daves 31 Jan 00 01:45:15
+ - (agent/agent_trap.c): Include instance subidentifier in snmpTrapOID and
+ snmpTrapEnterprise OID definitions. (Thanks to Gerard Talman)
+
+daves 31 Jan 00 02:40:02
+ - (snmplib/snmp_api.[ch]): Restore traditional socket field names.
+
+daves 31 Jan 00 03:00:16
+ - (snmplib/snmp_api.h): Alternative approach to Irix socket handling.
+
+daves 31 Jan 00 03:03:15
+ - (acconfig.h config.h.in configure.in configure):
+ - Attempt to detect non-traditional socket address structure (on Irix 6.x).
+
+daves 31 Jan 00 03:14:50
+ - (snmplib/snmp_api.c): Initialize addrlen in _sess_read(). (Frank Strauss)
+
+daves 31 Jan 00 03:41:08
+ - (AGENT.txt): Revised and updated version.
+
+daves 31 Jan 00 07:49:50
+ - (acconfig.h config.h.in configure.in configure):
+ - Improved checking for Irix-style socket address structure.
+
+daves 31 Jan 00 07:51:54
+ - (snmplib/snmp_api.h): Attempt to mimic Irix-style socket address structure.
+
+daves 31 Jan 00 07:53:52
+ - (snmplib/asn1.c snmplib/snmp.c snmplib/snmp_api.c snmplib/snmpusm.c):
+ - Don't assume size_t is signed (Pekka Kytolaakso)
+
+daves 31 Jan 00 07:55:06
+ - (snmplib/snmpv3.[ch]): Don't assume size_t is signed (Pekka Kytolaakso)
+ - N.B: This changes the interface of snmpv3_generate_engineID() slightly.
+
+daves 31 Jan 00 07:56:38
+ - (apps/snmptest.c): Don't assume size_t is signed (Pekka Kytolaakso)
+
+daves 31 Jan 00 07:57:56
+ - (mibgroup/examples/example.[ch]):
+ - Provide an example for how to trigger a trap.
+
+marz 31 Jan 00 10:41:16
+ set DS_LIB_DONT_BREAKDOWN_OIDS to get previoulsy released behaviour of get_symbol wrt octet based instance ids (i.e., no double-quoting)
+
+daves 1 Feb 00 01:49:55
+ - (acconfig.h config.h.in configure.in configure snmplib/snmp_api.h):
+ - Fix broken setting of socket address structure choice.
+
+daves 1 Feb 00 03:37:25
+ - (agentx/master_request.c): Fix session ID handling when delegating requests.
+
+daves 1 Feb 00 04:19:16
+ - (configure.in configure): Catch common invalid configure options.
+
+daves 1 Feb 00 05:27:03
+ - (FAQ): Expand the description of generating traps from the agent slightly.
+
+hardaker 1 Feb 00 08:32:03
+ - (diskio.*): moved to the ucd-snmp directory
+
+hardaker 1 Feb 00 08:34:09
+ - (diskio.h): load the mib.
+
+hardaker 1 Feb 00 08:34:24
+ - (diskio.c): move to ucdExperimental.15.
+
+hardaker 1 Feb 00 08:43:03
+ - (NEWS): update (again).
+
+hardaker 1 Feb 00 08:45:41
+ - (snmpcmd.1): .PP -> .IP for -Ob.
+
+hardaker 1 Feb 00 08:46:07
+ - (snmpusm.1): changed context string in examples to "".
+
+mslifcak 1 Feb 00 11:26:36
+ Fixup more signed/unsigned comparisons.
+
+daves 2 Feb 00 01:12:37
+ - (host/hr_disk.c): Fix solaris initialisation, plus extra debugging info.
+
+mslifcak 2 Feb 00 04:44:23
+ Remove dependencies on (moved) vestinternett/diskio
+
+nba 2 Feb 00 06:44:31
+ - solaris2.8.h: Solaris 8 seems close to Solaris 7
+
+nba 2 Feb 00 06:45:25
+ - hr_disk.c: add NetBSD support
+
+hardaker 2 Feb 00 07:17:28
+ - (configure, configure.in): updated --help
+
+daves 2 Feb 00 08:02:46
+ - (agent/snmp_vars.c): Correctly handle individually excluded instances
+
+mslifcak 2 Feb 00 08:42:17
+ Allow -Co to affect the outcome.
+
+mslifcak 2 Feb 00 08:52:43
+ fix the fat-fingering patch I just made. feh.
+
+hardaker 2 Feb 00 10:52:33
+ - (smux.c): Patch from Robert Miles:
+ - various fixes:
+ 1) The first registration request could be lost.
+ 2) Registration delete requests never received a response.
+ 3) Registration delete requests were not finding the registration when the
+ delete's priority was set to -1.
+ 4) Non-zero values were not being encoded properly in registration
+ responses.
+
+marz 2 Feb 00 14:18:09
+ add instructions for building w/ OpenSSL on VC++
+
+mslifcak 2 Feb 00 14:18:22
+ Let hrProcessorLoad out of the genie's bottle.
+
+mslifcak 2 Feb 00 16:24:15
+ Touchup for building more MIB modules in Win32 (MSVC).
+
+mslifcak 2 Feb 00 16:36:21
+ Touchup to build more MIB modules on Win32.
+
+daves 3 Feb 00 01:35:12
+ - (FAQ): Document changes to access control stuff.
+
+mslifcak 3 Feb 00 04:12:57
+ Undo uninformed change : load average != average time that CPU is idle.
+
+mslifcak 3 Feb 00 06:43:10
+ include mib_module_config.h to make the USING_ constants visible.
+
+marz 3 Feb 00 09:44:37
+ update my email
+
+mslifcak 3 Feb 00 09:56:48
+ Include mib_module_config.h from mibincl.h, not top level config.h.
+
+marz 3 Feb 00 10:48:37
+ add -u PIDFILE to snmptrapd, now we need -c -C :), btw is the value of optarg reliable after getopt has been called again...it seems to work
+
+mslifcak 3 Feb 00 12:57:20
+ Remove DOS-style line termination (CR-LF --> LF).
+ libsnmp.def - remove unneeded comment about obsolete v2party.
+
+mslifcak 3 Feb 00 12:58:27
+ Note the wombat is replaced by example in more places.
+
+mslifcak 3 Feb 00 13:28:31
+ Follow condition HAVE_GETPID for pid_file object.
+
+hardaker 3 Feb 00 14:29:19
+ - (dummy/*): removed, use example instead.
+
+hardaker 3 Feb 00 14:44:33
+ - (subagent.c): include mib_module_config.h.
+
+hardaker 3 Feb 00 14:46:10
+ - (subagent.c): protect sysORTable callbacks with #ifdefs.
+
+hardaker 3 Feb 00 14:51:40
+ - (README): remove dummy reference.
+
+nba 3 Feb 00 23:57:49
+ - agent/registry.c, agent_trap.c, client.c: change some type casts from
+ (char *) to (u_char *) top silence some warnings.
+
+nba 3 Feb 00 23:59:57
+ - mt_support.h: another way of doing nothing, not giving a "null effect"
+ warning from gcc.
+
+nba 4 Feb 00 00:16:01
+ - read_config.c, mib.c: fix some PATH separators from constant : to
+ ENV_SEPARATOR{_CHAR}
+
+nba 4 Feb 00 00:17:48
+ - hr_disk.c: A little cleanup of the disk device definitions, also adding
+ SCSI to FreeBSD 3
+
+nba 4 Feb 00 01:20:55
+ - vacm_vars.c: slight rewording of warning message
+
+nba 4 Feb 00 04:00:27
+ - hr_disk.c: really do that FreBSD scsi thing
+
+marz 4 Feb 00 06:44:24
+ have mib loading api return result codes
+
+marz 4 Feb 00 08:55:42
+ add defaults for v2 trap params
+
+hardaker 4 Feb 00 12:01:32
+ - (configure, configure.in, Makefile.in): find, locate, and use perl if found.
+
+hardaker 4 Feb 00 12:47:26
+ - (snmp_api.c, snmp_api.h, snmpv3.c): provide v3 defaults.
+
+hardaker 4 Feb 00 13:12:18
+ - (read_config.c): don't print failed access errors (EACCES).
+
+hardaker 4 Feb 00 13:15:51
+ - (Makefile.in, Makefile.in, Makefile.in, Makefile.in, Makefile.in,
+ Makefile.in): final make depend.
+
+hardaker 4 Feb 00 13:50:15
+ - (agent_read_config.c): don't read the opt config file or call
+ post_config callbacks, since the library takes care of that now.
+
+marz 4 Feb 00 13:52:08
+ updates for perl/SNMP build
+
+hardaker 4 Feb 00 13:56:19
+ - (snmptrapd.c):
+ - implement -c and -C flags for Joe.
+ - redid the init structure to make it look more like the current agent.
+
+hardaker 4 Feb 00 14:01:30
+ - (snmptrapd.8): document -c and -C.
+
+marz 4 Feb 00 15:21:41
+ build fixes and test enhancements
+
+marz 4 Feb 00 15:44:44
+ updates for perl/SNMP build
+
+-------------------------------------------------------------------------------
+
+Changes: V4.0 -> V4.0.1
+
+hardaker 23 Aug 99 16:44:27
+ - (Makefile.in): install the snmpusm.1 manual page.
+
+mslifcak 24 Aug 99 04:44:47
+ Clean CRs from read_config,snmp_logging; comment define USE_ASN_SHORT_LEN.
+
+mslifcak 24 Aug 99 05:11:13
+ Remove ASN_SHORT_LEN hack - known to dump core in agent.
+
+mslifcak 24 Aug 99 06:19:49
+ Add "." to PATH for RUNTESTS; Drop optreset to build most platforms
+
+mslifcak 24 Aug 99 10:25:53
+ -(testing/eval_tools) - let some (AIX) agents settle before firing requests.
+
+hardaker 24 Aug 99 12:48:21
+ - (vacm_vars.c): correct sysORTable entry.
+
+hardaker 24 Aug 99 13:36:35
+ - (snmpusm.c): check for null response pointer.
+
+hardaker 24 Aug 99 13:37:31
+ - (snmp_parse_args.c, default_store.h, snmp_api.c, snmpv3.c):
+ - provide defVersion token support in snmp.conf (sort of hackish).
+
+hardaker 24 Aug 99 13:41:18
+ - (TODO): remove snmpv3 support :-)
+
+mslifcak 24 Aug 99 14:05:39
+ -(top/Makefile.in) - remove more generated files with distclean rule.
+
+hardaker 24 Aug 99 14:15:40
+ - (all_system.h): remove. again.
+
+mslifcak 24 Aug 99 14:17:33
+ -(host/hr_swrun;mibII/icmp,ip;ucd-snmp/disk,proc) log_perror --> snmp_log_perror
+
+mslifcak 24 Aug 99 15:14:18
+ -(smux.c) apply Nick Amato's patch: prevent SMUX close on parse or error.
+
+hardaker 24 Aug 99 15:59:42
+ - (snmp_api.c): remove version setting in snmp_api.c. Not needed there.
+
+hardaker 24 Aug 99 16:01:55
+ - (NEWS): 4.0.1 update
+
+mslifcak 24 Aug 99 16:05:15
+ -(configure.*) move statement about ucdDemoPublic into comment field.
+
+mslifcak 24 Aug 99 16:49:22
+ -(testing/*) run tests when package is not installed, and when
+ the build tree is not the same as the source tree.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.6.2 -> V4.0
+
+hardaker 14 Sep 98 09:11:57
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - change the PERSISTENTFILE define to PERSISTENTDIR.
+
+hardaker 14 Sep 98 09:17:45
+ - (agent_read_config.c, snmpd.c, snmpd.h, system.c):
+ - move persistent cache capability into the library from the
+ agent. (snmptrapd, and others will need this as well).
+ - implement some new functions: init_snmpv3(), snmpv3_shutdown(),
+ snmpv3_get_engine_boots(), etc.
+ - agentBoots -> engineBoots.
+
+hardaker 14 Sep 98 09:21:05
+ - (Makefile.in, read_config.c, snmp_api.c, snmp_api.h, snmpv3.c, snmpv3.h):
+ - move persistent cache capability into the library from the
+ agent. (snmptrapd, and others will need this as well).
+ - implement some new functions: init_snmpv3(), snmpv3_shutdown(),
+ snmpv3_get_engine_boots(), etc.
+ - agentBoots -> engineBoots.
+
+hardaker 14 Sep 98 09:23:09
+ - (snmp_parse_args.c, snmp_parse_args.h, snmpbulkwalk.c, snmpdelta.c,
+ snmpget.c, snmpgetnext.c, snmpset.c, snmpstatus.c, snmptable.c,
+ snmptest.c, snmptrap.c, snmpwalk.c):
+ - pass app name to snmp_parse_args, so it can pass it to
+ init_snmp(), which now needs it for persistent cache reading.
+
+hardaker 14 Sep 98 09:25:13
+ - (snmpEngine.c, snmpEngine.h):
+ - Begin implementation of the SNMP-FRAMEWORK-MIB.
+
+hardaker 14 Sep 98 17:43:12
+ - (acconfig.h, config.h.in): define ENTERPRISE_NUMBER to 2021.
+
+hardaker 14 Sep 98 17:43:50
+ - (snmpv3.c, snmpv3.h): implement snmpEngineID creation and configuration.
+
+hardaker 14 Sep 98 17:44:06
+ - (snmpEngine.c): report snmpEngineID properly.
+
+hardaker 14 Sep 98 17:49:15
+ - (snmpv3mibs.h): high-level module created to import v3 releated mibs.
+
+hardaker 14 Sep 98 21:09:41
+ - (util_funcs.[ch], snmpEngine.c, snmpv3.[ch], system.[ch]):
+ - move snmpEngineTime calculation to snmplib/snmpv3.c.
+ - move calculate_time_diff() to system.c from util_funcs.c.
+
+hardaker 14 Sep 98 22:29:55
+ - (snmpMPDStats.c, snmpMPDStats.h):
+ - implement SNMP-MPD-MIB.
+
+hardaker 14 Sep 98 22:30:10
+ - (snmpv3mibs.h): add snmpMPDStats module.
+
+hardaker 14 Sep 98 22:40:24
+ - (snmpEngine.c, snmpMPDStats.c): register the modules in sysORTable.
+
+hardaker 16 Sep 98 07:04:11
+ - (snmpMPDStats.c): double blank -> single.
+
+hardaker 16 Sep 98 07:04:58
+ - (usmStats.c, usmStats.h): implement the usmStats portion of the
+ SNMP-USER-BASED-SM-MIB.
+
+hardaker 16 Sep 98 07:05:43
+ - (snmpv3mibs.h): add usmStats to require list.
+
+hardaker 18 Sep 98 09:54:08
+ - (snmp_api.c): change sprintf_oid buf length in DEBUGPOID to 4096.
+
+hardaker 18 Sep 98 09:55:07
+ - (snmpd.c): init_snmpv3 needs to go above init_agent for engineID creation.
+
+hardaker 18 Sep 98 09:59:20
+ - (snmpv3mibs.h, usmUser.c, usmUser.h, Makefile.in, snmpusm.c,
+ snmpusm.h, snmpv3.c, snmpv3.h):
+ - basic usmUser structure created for the libray with support
+ functions:
+ - struct usmUser *usm_get_user(*engineID, engineIDLen, *name, *userList);
+ - struct usmUser *usm_add_user(*user, *userList);
+ - struct usmUser *usm_free_user(*user);
+ - struct usmUser *usm_clone_user(*from);
+ - struct usmUser *usm_create_initial_user();
+ - first pass at basic USM module support added to the agent.
+
+hardaker 18 Sep 98 12:42:46
+ - (snmp-tc.h): create a new .h file to store common textual convention defines.
+
+hardaker 18 Sep 98 12:46:38
+ - (usmUser.c, snmpusm.c, snmpusm.h):
+ - create and use storageType/userStatus in the usmUser structure.
+ - fix the auth/priv protocol pointer initializations for the "initial" user.
+
+hardaker 20 Sep 98 11:46:13
+ - (snmp_vars.c): include snmpusm.h and snmpv3.h.
+
+hardaker 20 Sep 98 11:47:17
+ - (snmp_agent.c): if a mib module returns an error > SNMP_GEN_ERR,
+ translate the error to SNMP_GEN_ERR for v1 requests.
+
+hardaker 20 Sep 98 11:49:04
+ - (mib2c):
+ - fprintf -> DEBUGP.
+ - __P -> ANSI.
+
+hardaker 20 Sep 98 11:52:08
+ - (usmUser.c, usmUser.h):
+ - getNext bug fixes.
+ - make usmPublic truely writable.
+ - implement usm_parse_oid() to parse an oid into engineID/name.
+ - implement the usmUserSpinLock.
+ - misc other bug fixes.
+
+hardaker 21 Sep 98 11:12:49
+ - (snmp_vars.c): finally fixed the write_method's for creation problem.
+
+hardaker 23 Sep 98 10:40:04
+ - (SNMPv2-TC.txt): rejustify a table.
+
+hardaker 23 Sep 98 10:45:13
+ - (usmUser.c):
+ - Make usmUserStatus actually writable and capable of creating new rows.
+ - Begin (broken) cloneFrom setting.
+ - Fixes:
+ - properly malloc space.
+ - properly use double char name and engineID pointers.
+ - do proper oid comparisons for getNexts.
+ - check to see that uptr is defined before using it to retrieve data.
+ - cloneFrom should always return the ZeroDotZero OID.
+
+hardaker 23 Sep 98 10:46:35
+ - (snmpusm.c):
+ - fix usm_add_user() from always adding the user at the end of the list.
+ - set default values for auth/priv protocols on new users.
+
+hardaker 23 Sep 98 10:47:28
+ - (snmp_api.c, snmp_api.h): create snmp_duplicate_objid() to malloc a new oid.
+
+hardaker 23 Sep 98 12:15:11
+ - (ISSUES): update
+
+hardaker 23 Sep 98 12:24:04
+ - (ISSUES): took one.
+
+hardaker 23 Sep 98 17:58:49
+ - (ISSUES): cloning/malloc issue.
+
+hardaker 23 Sep 98 17:59:40
+ - (snmpusm.c, snmpusm.h): created usm_cloneFrom_user() to clone sec info.
+
+hardaker 23 Sep 98 18:00:21
+ - (usmUser.c): make usmCloneFrom actually work (is setable).
+
+hardaker 23 Sep 98 20:15:57
+ - (ISSUES): storage type issues.
+
+hardaker 23 Sep 98 20:16:24
+ - (usmUser.c): make usmUserAuthProtocol and usmUserPrivProtocol writable.
+
+hardaker 23 Sep 98 20:50:05
+ - (ISSUES): RowStatus question added.
+
+hardaker 23 Sep 98 20:50:45
+ - (snmpusm.c, snmpusm.h): create usm_remove_user() to remove a user
+ from a list.
+
+hardaker 23 Sep 98 20:51:46
+ - (usmUser.c): make usmUserStatus destroy's actually remove a user.
+
+hardaker 27 Sep 98 22:53:53
+ - (ISSUES): more stuff.
+
+hardaker 27 Sep 98 22:55:09
+ - (read_config.c, read_config.h, snmpusm.c, snmpusm.h):
+ - bug fixes.
+ - new support functions for saving users to the persistent cache.
+
+hardaker 27 Sep 98 22:57:00
+ - (usmUser.c, usmUser.h):
+ - bug fixes.
+ - usmUserStatus is setable (to either volatile or nonVolatile).
+ - users created by set's are saved (if set to nonVolatile) on agent shutdown.
+
+hardaker 29 Sep 98 20:11:20
+ - (ISSUES): error mapping (coex work).
+
+marz 1 Oct 98 12:58:42
+ - (snmp.h, snmpusm.[ch], snmp_api.[ch]): added USM api and snmpv3_build, some tweaks to parse in prep for snmpv3_parse
+
+marz 1 Oct 98 14:05:45
+ - (snmp_api.c): fixes to snmpv3_parse
+
+marz 4 Oct 98 17:20:30
+ - (snmp_api.[ch], snmp_client.c, snmpusm.c): added snmpv3 parsing routines
+
+hardaker 5 Oct 98 20:05:03
+ - (ISSUES): more stuff.
+
+hardaker 5 Oct 98 20:06:57
+ - (snmp_api.c, snmp_api.h): breakdown of snmpv3_build() into sub-functions.
+
+hardaker 5 Oct 98 21:59:26
+ - (snmpusm.c): make generateRequestMsg do something generic.
+
+hardaker 5 Oct 98 22:00:22
+ - (snmpv3.c, snmpv3.h): return a u_char * instead of a char * for engineIDs.
+
+hardaker 5 Oct 98 22:01:04
+ - (snmp_api.c): misc bug fixes.
+
+hardaker 5 Oct 98 22:50:10
+ - (snmp_api.c): last of known bugs in snmpv3_build fixed (a pointer
+ was being used twice in overlapping needed time periods).
+
+marz 7 Oct 98 13:02:40
+ -(snmp_parse_args.c): add v3 support
+
+marz 7 Oct 98 13:06:41
+ -(snmp_api.[ch], snmpusm.[ch], snmpv3.c): added pdu field to hold sec state ref, fixed usm prototypes, added check for null hent return
+
+hardaker 7 Oct 98 15:36:05
+ - (snmpusm.c): flush out a generic processIncomingMsg().
+
+hardaker 7 Oct 98 15:36:36
+ - (snmp_impl.h): add securityName to the agent's packet_info structure.
+
+hardaker 7 Oct 98 15:38:00
+ - (snmp_api.c): many many bug fixes to v3 parse/build routines.
+
+hardaker 7 Oct 98 15:39:17
+ - (vacm_vars.c): recognize the securityName when USM model is in use.
+
+hardaker 7 Oct 98 17:17:10
+ - (snmp_agent.c): initial pass at v3. Will fail on sending error messages.
+
+hardaker 7 Oct 98 17:45:22
+ - (snmp_api.c): pass in the sec_parms length to processIncomingMsg
+
+hardaker 7 Oct 98 17:46:04
+ - (snmp_agent.c): bug fix: using an array as a pointer (used to be one).
+
+hardaker 7 Oct 98 22:40:43
+ - (snmp_api.c, snmpv3.c, snmpv3.h):
+ - default snmpv3 parameters can be specified in a snmp.conf file.
+
+hardaker 8 Oct 98 10:13:23
+ - (ISSUES): everyone loves issues!
+
+hardaker 9 Oct 98 08:03:57
+ - (config.h.in, configure, configure.in): use zlib when using rpm libraries.
+
+dreeder 9 Oct 98 13:59:12
+ - (ISSUES): Need a pass for traditional UN*X system programming holes.
+
+hardaker 9 Oct 98 18:23:27
+ - (snmpusm.c): generateRequestMsg() doesn't ASN encode the sec_params.
+
+hardaker 9 Oct 98 18:24:02
+ - (snmp_api.c): restructure the packet building to use less memcpy's.
+
+hardaker 9 Oct 98 18:24:26
+ - (snmp_agent.c): use snmp_build_packet() to construct all v3 data.
+
+dreeder 12 Oct 98 07:18:56
+ - (ISSUES): proof memory invocation/disposal; put time stamps in log files.
+
+hardaker 12 Oct 98 07:19:28
+ - (snmp_api.c, snmp_api.h):
+ - new stats counter API.
+ - bug fixes.
+
+hardaker 12 Oct 98 07:42:28
+ - (snmp_api.c, snmp_api.h): bug fixes with counters (returns u_int, EG).
+
+hardaker 12 Oct 98 07:44:55
+ - (snmp_agent.c):
+ - make v3 code return errors properly.
+ - bug fixes.
+
+hardaker 12 Oct 98 07:45:11
+ - (snmpMPDStats.c, snmpMPDStats.h, usmStats.c, usmStats.h):
+ - use the new stats counter API.
+
+marz 12 Oct 98 07:56:30
+ -(snmp_parse_args.c): merged hex to bin funcs - There can be only One
+
+marz 12 Oct 98 08:11:46
+ -(snmp_api.[ch], snmpusm.[ch]): merged hex to bin funcs, fixed MP/USM api, implemented noAuthNoPriv USM, implemented engine probe algorithm
+
+hardaker 12 Oct 98 09:23:49
+ - (ISSUES): note on David's issue.
+
+hardaker 12 Oct 98 12:26:06
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - look for /dev/random and define HAVE_DEV_RANDOM.
+ - look for libkmt and libcrypto and define HAVE_LIBXXX.
+
+marz 12 Oct 98 15:46:36
+ - (snmpusm.c): fixed header size issues (difference between asn_build_header and asn_build_sequence)
+
+hardaker 12 Oct 98 21:56:42
+ - (system.c, system.h): make calculate_time_diff take a pointer.
+
+hardaker 12 Oct 98 21:59:53
+ - (snmpv3.c): use new calculate_time_diff().
+
+hardaker 12 Oct 98 22:04:06
+ - (snmp_client.c): bug fixes:
+ - snmp_synch_input() needs to clone a report pdu too.
+ - snmp_clone_pdu() needs to copy contextEngineID, contextName, and
+ securityName
+
+hardaker 12 Oct 98 22:12:50
+ - (snmp_api.c, snmp_api.h):
+ - make snmp_increment_statistic() return the changed value.
+ - create new function: snmp_free_varbind() to free a list.
+ - \n's to the end of the new debugging messages for engineID discovery.
+ - Merge response/report handling to make report's call their
+ callback as well (engineID discovery was never returning).
+
+hardaker 12 Oct 98 22:19:54
+ - (configure, configure.in): remove incorrect comment.
+
+hardaker 12 Oct 98 22:22:36
+ - (ISSUES): wierd memory question.
+
+hardaker 12 Oct 98 22:23:16
+ - (system.c): use new calculate_time_diff().
+
+hardaker 12 Oct 98 22:25:06
+ - (snmp_agent.c): handle engineID discovery requests.
+
+hardaker 12 Oct 98 22:58:26
+ - (usmUser.c): new function to return the userList.
+
+hardaker 12 Oct 98 22:58:55
+ - (snmpusm.c, snmpusm.h): new function usm_check_secLevel(int, struct *usmUser);
+
+hardaker 12 Oct 98 22:59:36
+ - (snmp_agent.c): handle unknownSecurityName and unsupportedSecurityLevel.
+
+hardaker 13 Oct 98 13:27:14
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - new options: --disable-privacy, --enable-v2p-md5.
+
+hardaker 13 Oct 98 13:31:22
+ - (acconfig.h, config.h.in): comment formatting.
+
+hardaker 14 Oct 98 13:29:05
+ - (snmp_api.c): make snmp_add_var set the size of the oid buffer.
+
+hardaker 14 Oct 98 13:29:40
+ - (snmpusm.c, snmpusm.h): moved the default userList into the library.
+
+hardaker 14 Oct 98 13:31:29
+ - (usmUser.c): use the new library default user list.
+
+hardaker 14 Oct 98 13:32:58
+ - (snmp_agent.c):
+ - use the new library default user list.
+ - don't free a nonexistent pdu (it only exists for v3 requests).
+
+hardaker 14 Oct 98 13:47:56
+ - (snmp_agent.c): make sure pdu->securityName is null terminated.
+
+hardaker 14 Oct 98 17:52:23
+ - (aclocal.m4, configure, configure.in, Makefile.in):
+ - new arguments to configure to set CFLAGS and LIBS:
+ - --with-KMT=path
+ - --with-SSLeay=path
+ - fix to agent/mibgroup/Makefile to keep the above from getting the
+ wrong asn1.h from the SSLeay package.
+
+hardaker 14 Oct 98 20:41:07
+ - (aclocal.m4, config.h.in, configure, configure.in, */Makefile.in):
+ - check for kmt.h
+ - re-order CPPFLAGS to put -I flags last.
+
+hardaker 14 Oct 98 20:45:51
+ - (usmUser.c, usmUser.h, snmpusm.c, snmpusm.h):
+ - move usm_parse_config_usmUser to the library.
+
+hardaker 14 Oct 98 20:47:48
+ - (agent_read_config.c): include snmpusm.h
+
+dreeder 15 Oct 98 12:02:40
+ - Base for SCAPI + some formatting on the path to snmpv3 startup and shutdown.
+ - Shuffling in header files to defeat warnings of #define redundancies:
+ notably, s/freebsd*.h and snmplib/system.h
+ - Debug & tini toolbag in snmplib/{debug,tools}.*
+ - Changed configure option --enable-v2p-md5 to --enable-internal-md5.
+ - Consolidated library system and local header include sequences into
+ snmplib/all_*.h files. Possibly better solutions for this...
+
+hardaker 15 Oct 98 22:24:52
+ - (usmUser.c): removed usm_parse_config_usmUser that David put back by
+ accident when doing formating.
+
+hardaker 15 Oct 98 22:25:17
+ - (keytools.c, keytools.h): added length to engineID.
+
+hardaker 15 Oct 98 22:25:58
+ - (read_config.c, read_config.h): make copy_word return a pointer.
+
+hardaker 15 Oct 98 22:26:21
+ - (scapi.c, scapi.h): move #includes from .h to .c.
+
+hardaker 15 Oct 98 22:27:03
+ - (snmpusm.c, snmpusm.h): new config options to change keys.
+
+hardaker 15 Oct 98 22:27:58
+ - (snmpv3.c): don't call init_kmt() unless HAVE_LIBKMT is defined.
+
+hardaker 15 Oct 98 22:42:00
+ - (keytools.c, keytools.h): move #include from .h to .c.
+
+hardaker 15 Oct 98 22:47:56
+ - (usmUser.c, usmUser.h):
+ - use do_keychange() to implement the key change write methods.
+ - a bit of -Wall cleanup.
+
+dreeder 16 Oct 98 11:28:12
+ - Updated SCAPI crypting functions to identify transforms OIDs not #define's.
+ - Moved "global" definitions of OID transforms to snmpusm.h, and out of
+ usmUser.c and snmpusm.c.
+ - sc_generate_keyed_hash() stands as a good example of what other functions
+ will look like.
+
+dreeder 16 Oct 98 11:50:09
+ - (scapi.c, scapi.h) Output buffer arguments for (en|de)crypting are
+ single-pointers.
+
+lewis 16 Oct 98 13:15:16
+ - - (snmpusm.h):
+ - Added USM_ERR symbols used by usm_generate_out_msg
+
+lewis 16 Oct 98 13:20:07
+ - - (snmpusm.c)
+ - Rewrote usm_generate_out_msg, renaming old implementation to
+ usm_generate_out_msg_NULL
+ - This code compiled on FreeBSD, not tested for linking or running
+ - Added functions to calculate indicies (asn_predict_int_length,
+ asn_predict_length, usm_calc_offsets) and to make the CBC-DES
+ initialization vector (usm_set_salt).
+
+dreeder 18 Oct 98 21:14:09
+ - SCAPI code complete, but not completely tested.
+ Added testing/ directory.
+ Verified that Ed's recent changes compile cleanly.
+ Tried to patch up "critical" -Wall warnings.
+
+hardaker 19 Oct 98 07:10:27
+ - (Makefile.top): remove -Wall requirement.
+
+dreeder 19 Oct 98 15:12:57
+ - Core SCAPI routines appear sound. testing/ directory is no longer
+ commented out. SNMPv3 style key manipulations untested yet.
+ Created (?) a slew of new warnings from files early in compile sequence.
+
+dreeder 20 Oct 98 11:38:42
+ - Tests for generate_Ku and generate_kul. (testing/ktest -h for help.)
+ Cleaned up new set of "critical" warnings -- mostly adding #include's.
+ Fixed KMT/apps/randtest.c so it compiles under Linux.
+
+marz 21 Oct 98 08:18:03
+ -(snmp_api.[ch]): add fields for authKey and privKey
+
+lewis 21 Oct 98 12:07:16
+ - - (snmp.h)
+ - Added SNMP_ERR_ error symbolic constants for the auth/priv (USM) module
+ reported errors.
+ - Used values 19-27, updated MAX_SNMP_ERR to 27.
+
+lewis 21 Oct 98 12:08:24
+ - - (snmpusm.h)
+ - Added symbolic constants for errors found processing incoming messages.
+ - Equated the symbols with those added to snmp.h
+
+hardaker 21 Oct 98 12:10:03
+ - (snmp_api.h): added ASN/SNMP counters to the counter list.
+
+marz 21 Oct 98 12:50:24
+ -(snmp_api.[ch]): correctly add #define sizes for authKey and privKey
+
+marz 21 Oct 98 13:38:57
+ -(snmp_api.[ch]): added auth/priv protocol type fields to session
+
+marz 21 Oct 98 13:49:11
+ -(snmp_api.c): added cast for internal pdu (internal pdu should be elimianted someday)
+
+hardaker 21 Oct 98 13:53:38
+ - (snmp_api.h): STAT_MAX_STATS -> MAX_STATS.
+
+hardaker 21 Oct 98 17:54:08
+ - (snmpv3.c): remove snmp_perror() defined as perror(). It's a real function.
+
+hardaker 21 Oct 98 17:58:08
+ - (asn1.c): asn_build_string: allow a null string to build a 00 padded string.
+
+hardaker 21 Oct 98 18:00:07
+ - (snmp_api.c):
+ - engineID discovery debugging messages.
+ - zero length contextNames ok.
+ - set max length before usm_generate_out_msg().
+
+hardaker 21 Oct 98 19:04:35
+ - (snmp_api.c): move the engineID discovery to snmp_sess_open().
+
+hardaker 21 Oct 98 19:05:12
+ - (snmp_api.h): synch snmp_pdu and internal_snmp_pdu.
+
+dreeder 21 Oct 98 19:55:15
+ - Shook the bugs out of key manipulation routines (generate_kul, generate_Ku).
+ Completed and tested KeyChange TC code ({encode,decode}_keychange).
+ Created initial elements of an automated test harness in testing/.
+ Created data files and test scripts to demonstrate compliance.
+ Miscellaneous additions to snmplib/tools.?, some temporary/transitional.
+
+marz 21 Oct 98 19:58:11
+ -(snmp_parse_args.c): add auth/priv proto flags, add auth priv key flags
+
+marz 21 Oct 98 20:19:08
+ - (snmp_api.[ch]): updated auth/priv prot and key fileds in session, added suport in snmp_sess_open and close (yanked fields from PDU - did I do that?)
+
+hardaker 21 Oct 98 21:21:41
+ - (lcd_time.c): minor warning fixes.
+
+hardaker 21 Oct 98 21:22:07
+ - (tools.c, tools.h): new tool: memdup().
+
+hardaker 21 Oct 98 22:08:07
+ - (snmp_api.c):
+ - generate a usm user from session data if needed.
+ - check the result from the usm and fail if it does.
+
+marz 22 Oct 98 08:02:11
+ -(snmp_api.c): added DEBUGP code to trace message version and secLevel for demo
+
+lewis 22 Oct 98 13:37:34
+ - - (snmpusm.c)
+ - Not a working/tested version, but it compiles.
+ - Fixed one bug - "&" to "==" in an if()
+ - Did not alter code to deny null engine id users
+ - Added much code in process incoming message
+ - New use of errors and DEBUGP
+ - Still waiting on updates to lcd_time.h to implement
+ step #3 of RFC 2274, s3.2.
+
+dreeder 23 Oct 98 09:45:47
+ - LCD Time API prototypes are complete. 90% stable.
+ Draft of automated testing harness in testing/.
+ Use testing/eval_suite.sh to run all current tests.
+
+lewis 23 Oct 98 11:38:25
+ - - (lcd_time.h)
+ - added definitions for TRUE and FALSE (if not previously defined)
+ - fixed a compilation bug in the ensure entry macro
+
+lewis 23 Oct 98 11:47:37
+ - - (snmpusm.c)
+ - Added the step 3 code to process outgoing messages function
+ - Still un-run
+
+dreeder 23 Oct 98 15:39:02
+ - Complete code for LCD time API. Awaiting serious tests.
+ Changed snmpv3_get_engine{Time,Boots} to snmpv3_local_snmpEngine*
+
+dreeder 24 Oct 98 23:07:54
+ - Shook bugs out of LCD to manage engine IDs/time ("testing/etest -a").
+ Added a function dump_snmpEngineID ("testing/misctest -1").
+ Made sprint_hexstring not-static... (temporary change I think).
+ Added comments/questions about building snmpEngineID. (snmpv3.c)
+ Added TRUE/FALSE defines to snmpusm.c. (These should be standardized.)
+ Added SNMP_MAXBUF_SMALL. (tools.h)
+ Cleaned up (clarified?) test harness description.
+
+marz 25 Oct 98 14:48:06
+ -(snmp_parse_args.c): move key generation (generate_Ku) after init_snmp
+
+hardaker 25 Oct 98 20:59:33
+ - (snmp_agent.c): debugging parse/build statements and errno fixes.
+
+hardaker 25 Oct 98 21:00:15
+ - (system.h): created DEBUGPL to do DEBUGP with file/line statements.
+
+hardaker 25 Oct 98 21:01:00
+ - (tools.c): check memdup() for NULL passed in.
+
+hardaker 25 Oct 98 21:01:58
+ - (read_config.c): bug fixes: misc NULL checks.
+
+hardaker 25 Oct 98 21:02:40
+ - (snmp_client.c): default to setting secNameLen and contextNameLen to -1.
+
+dreeder 25 Oct 98 22:28:18
+ - Mostly shuffling pre-existing things about --
+ Used USE_INTERNAL_MD5 put kmt_hash parallel with v2p MD5 hash.
+ sc_encrypt/sc_decrypt now also return: SNMPERR_SC_NOT_CONFIGURED.
+ Tested and "fixed" build with on&off settings of:
+ USE_V2PARTY_PROTOCOL, SCAPI_AUTHPRIV, USE_INTERNAL_MD5.
+ Greatest damage done in agent/snmp_agent.c, snmplib/snmp_client.c.
+ Repaired use of key manipulation functions in snmpusm.c.
+ (Could use peer review as my expectations of use may differ.)
+ Added (and removed 1) some XXX's in party code...
+
+hardaker 26 Oct 98 13:34:03
+ - (snmpusm.c): enable NULL engineIDs in user storage.
+
+hardaker 26 Oct 98 13:37:03
+ - (snmp_api.c, snmp_api.h):
+ - creating users from a session: create_user_from_session().
+ - make probing use the above twice (once for NULL engineID and once
+ for probed engineID).
+ - bug fix: snmp version printed in debugging was off by -1.
+
+hardaker 26 Oct 98 20:41:19
+ - (snmp_agent.c): set context name on engineID report.
+
+hardaker 26 Oct 98 20:42:06
+ - (snmpd.c): create the "initial" user for engineID:null.
+
+hardaker 26 Oct 98 22:12:17
+ - (keytools.c): check for NULL pointer, not *pointer.
+
+hardaker 26 Oct 98 22:15:01
+ - (snmpusm.c): malloc kul space in usm_set_password().
+
+dreeder 28 Oct 98 09:39:57
+ - get_enginetime() now returns <0,0> tuple for NULL/""/len=0 engineIDs.
+ sc_{check,generate}_keyed_hash() process hashes <= hash output len.
+ (Stable, but expect an expanded test in scapitest.c soon.)
+ Misc: Put MD5_HASHSIZE_BYTES in party.h; SNMP_ZERO in tools.h
+
+lewis 28 Oct 98 13:16:54
+ - - (snmpusm.c)
+ - Debugged running of usm_generate... function so that it runs with no
+ authentication / no privacy options. (Don't have a way yet to test
+ with the fancy security.)
+ - Added a line for debugging which sets all bytes of the security header
+ and the PDU's resting place to FF - for debugging purposes only. This
+ lets me see what bytes remain to be punched in. This line is flush left
+ in the file, indicating that it is to be cut out if we reach release.
+ - Added "emergency_print," an uncalled routine I like to have when running
+ in gdb. It dumps a field of x bytes in hex, 25 values to a line.
+
+dreeder 28 Oct 98 14:19:52
+ - Bounded KMT code with #define's for HAVE_LIBKMT
+ - Will not compile without either HAVE_LIBKMT -or- USE_INTERNAL_MD5.
+ - Added new error code: SNMPERR_KT_NOT_AVAILABLE.
+ - Added a test for previous changes to sc_*_keyed_hash() functions.
+ (Augmented test_dokeyedhash() in keymanagement.c.)
+
+lewis 29 Oct 98 09:56:08
+ - - (snmpusm.c)
+ - Made fixes to process incoming
+ - Began to add code for the security state reference
+
+lewis 29 Oct 98 10:27:37
+ - - (snmpusm.h)
+ - Added prototype for set_reportErrorOnUnknownID
+
+lewis 29 Oct 98 10:29:16
+ - - (snmpusm.c)
+ - Fixed some of Wes' reported problems.
+ - Added code to store secStateRef
+ - Still need to use it in generate_outgoing
+
+lewis 29 Oct 98 14:30:18
+ - - (snmpusm.c)
+ - Now makes use of the stored secStateRef in generate outgoing
+ - I hope - I still haven't been able to get message back and forth,
+ it's time to figure out how to run the snmpd stuff I guess.
+
+marz 29 Oct 98 15:06:49
+ add #idef gaurds for kmt.h and kmt_algs.h dependent on existence of headers rather than libkmt
+
+lewis 30 Oct 98 06:45:24
+ - - (snmpusm.h)
+ - Added a state reference free routine
+ - Changed name of the routine to set the report-on-error flag so that it
+ begins with "usm_".
+
+lewis 30 Oct 98 06:46:52
+ - - (snmpusm.c)
+ - Modified the free state ref routine to take a void * instead of a
+ struct whatever *, this plus adding it to the .h file makes is useable
+ by the Message Processor.
+
+lewis 30 Oct 98 07:34:26
+ - - (snmpusm.c)
+ - Removed a potential memory hole (returning on error from the process
+ incoming routine without freeing the security state reference).
+
+hardaker 30 Oct 98 08:38:53
+ - (snmpv3.c): snmp_perror() -> perror() ["malloc"].
+
+hardaker 30 Oct 98 08:43:52
+ - (snmpd.c):
+ - Make -D a toggle.
+ - use usm_set_reportErrorOnUnknownID().
+
+hardaker 30 Oct 98 08:45:09
+ - (snmp_parse_args.c):
+ - Make -D a toggle.
+
+hardaker 30 Oct 98 16:44:43
+ - (snmp_agent.c): make the agent watch the error status from packet
+ parsing instead of doing checks itself.
+
+hardaker 30 Oct 98 16:52:03
+ - (snmpusm.c): usm_get_user(): allow a null length (but non null
+ pointer) engineID.
+
+marz 1 Nov 98 15:55:11
+ -(asn1.c, lcd_time.c, snmp_api.c, snmp_api.h, snmp_client.c, snmpusm.c, snmpv3.c): remove internal pdu/varlist, pdu_free update, handle initial user as discussed, remove initial user hack, remove engineID probe/Report hack, handle securityStateRef as discussed, handle zero-length context, normalize _enginetime arg order, include wes's patches for null engineid and secNameLen++
+
+hardaker 1 Nov 98 19:32:43
+ - (snmp_parse_args.c, snmp_parse_args.h, snmpbulkwalk.c, snmpdelta.c,
+ snmpget.c, snmpgetnext.c, snmpset.c, snmpstatus.c, snmptable.c,
+ snmptest.c, snmptrap.c, snmpwalk.c):
+ - use "snmpapp" as configuration file name.
+
+hardaker 1 Nov 98 19:36:59
+ - (snmp_api.c): generate user->Kul from session->Ku.
+
+hardaker 1 Nov 98 19:38:29
+ - (snmp_agent.c): generate all sorts of new SNMP reports when needed.
+
+hardaker 1 Nov 98 19:39:29
+ - (snmpd.c): use snmp_perror() if snmp_agent_parse() returns 0.
+
+hardaker 2 Nov 98 09:00:25
+ - (vacm.c): allow a security level >=, not ==.
+
+hardaker 2 Nov 98 09:01:07
+ - (snmpv3.c): remove usm_create_initial() and set_enginetime().
+
+hardaker 2 Nov 98 09:06:04
+ - (snmpusm.c, snmpusm.h):
+ - new function: init_usm_post_config(void);
+ - make usm_get_user_from_list() handle a bogus initial user flag.
+
+hardaker 2 Nov 98 09:09:35
+ - (snmp_api.c):
+ - use init_usm_post_config();
+ - use usm_get_user_from_list to ask not to return the default initial user.
+ - fix snmp_var_add_variable() to allow counters.
+
+hardaker 2 Nov 98 09:10:15
+ - (snmp_parse_args.c): typo on des key initialization, forgot the 'X'.
+
+hardaker 2 Nov 98 09:13:36
+ - (snmp_agent.c):
+ - fix report OIDs to be correct.
+ - debugging statement when sending a report.
+ - added unsupported security level report.
+ - send a counter instead of an integer.
+
+hardaker 2 Nov 98 16:01:24
+ - (snmp_parse_args.c): generate Ku for priv protocol using auth protocol hash.
+
+hardaker 3 Nov 98 09:37:03
+ - (lcd_time.c): first byte==0 engine ID's are valid.
+
+lewis 4 Nov 98 11:35:29
+ - - (snmpusm.c)
+ - Better handling of null and unknown engine IDs.
+
+dreeder 4 Nov 98 11:45:08
+ - (lcd_time.c) Special cases for NULL or 0 length engineIDs.
+
+hardaker 4 Nov 98 21:53:32
+ - (snmp_agent.c): check engineID to make sure its us.
+
+lewis 5 Nov 98 09:52:35
+ - - (snmpusm.c)
+ - Fixed call to predict integer length routine to give it the *whole*
+ number, not just one (first/last depends on endian) of the number.
+ Doh! scale rating 9.
+ - Altered that routine to be more like the asn_build_int ... i.e., no
+ longer assumes the length of the length is 1. Doh! rating a 1.
+
+lewis 5 Nov 98 11:03:24
+ - - (snmpusm.c)
+ - Fixed some DEBUGP calls to show the right function, perhaps these will
+ become DEBUGPL in the future.
+
+dreeder 5 Nov 98 15:37:29
+ - Mostly function header comments in read_config.c, util_funcs.c, snmpv3.c.
+ (Please feel free to check for accuracy...)
+ Check for NULL in register_config_handler().
+ Added length argument to snmpv3_get_engineID().
+ Check for length(P)<USM_LENGTH_P_MIN in generate_Ku().
+ Note: "etest -a" has a new failure; to be fixed when Time LCD re-stabilizes.
+
+marz 6 Nov 98 16:13:37
+ -(snmp_api.[ch], snmp_client.c): handle Reports to trigger resend, except for unknownEngineID, pass secStateRef to receive securityState from USM *WARNING* getting authorization failure in USM* please help - this was not happening before so doubtless it is my fault?
+
+marz 7 Nov 98 12:33:49
+ -(snmp_api.c, lcd_time.[ch], snmpusm.c): clean up problems caused when we began using secStateRef, other USM errors, implement LCD_TIME_SYNC_OPT optimization
+
+marz 7 Nov 98 12:37:21
+ -(snmp_agent.c, snmpd.c): clean up problems caused when we began using secStateRef, set_enginetime in LCD post config read, LCD_TIME_SYNC_OPT time lerning optimization, include file for lcd_time added, moved make_report to snmplib - report generation is still in agent
+
+hardaker 9 Nov 98 13:29:19
+ - (snmp_api.c): generate_kul should use authprotocol.
+
+marz 11 Nov 98 07:51:43
+ -(lcd_time.c, snmpusm.c): fixes to handle null engine ID - tolerated when sending, unknown when receiving
+
+marz 11 Nov 98 08:03:24
+ -(snmp_agent.c): remove workaround to detect unknownEngineID error - now doen in USM as spec'd
+
+hardaker 11 Nov 98 12:37:47
+ - (snmpd.c, snmp_api.c, snmpv3.c, snmpv3.h):
+ - move initial set_enginetime() from agent to snmpv3.c.
+ - new snmp.conf configure file tokens: defAuthType, defPrivType,
+ defPassphrase, defAuthPassphrase, defPrivPassphrase.
+ - minimum boots used is 1, not 0.
+
+hardaker 11 Nov 98 13:09:26
+ - (snmpd.c): added needed init_() routines.
+
+hardaker 11 Nov 98 13:11:02
+ - (snmpv3.c): don't print oids to %s's.
+
+hardaker 13 Nov 98 07:59:04
+ - (snmpd.c): create the correct initial user after engineID configuration.
+
+hardaker 13 Nov 98 08:03:45
+ - (usmUser.c): don't initialize user here.
+
+hardaker 13 Nov 98 08:04:42
+ - (snmpv3.c): make engineID configuration lines get parsed early.
+
+hardaker 13 Nov 98 08:14:04
+ - (snmpusm.c):
+ - more appropriate engineID checking for users (was a bug).
+ - usm_add_user(): don't duplicate users with the same name/engineID.
+
+hardaker 15 Nov 98 10:19:55
+ - (snmpd.c): move post_config init routines to beyond persistent reading.
+
+hardaker 15 Nov 98 12:55:38
+ - (Makefile.in):
+ - new make target: test
+ - make all doesn't compile the testing directory.
+
+hardaker 15 Nov 98 13:00:41
+ - (usmUser.c, snmpusm.c, snmpusm.h):
+ - usm_remove_user():
+ - properly updates the list pointer.
+ - requires a ** pointer to the list to do this.
+ - check against a NULL list pointer.
+ - usm_cloneFrom_user():
+ - the keys were not being properly duplicated.
+ - usm_clone_user(): deleted.
+ - usm_create_user(): created, and used in place of usm_clone_user(NULL).
+
+hardaker 15 Nov 98 13:01:27
+ - (etimetest.c): fix calls to set/get_enginetime().
+
+hardaker 15 Nov 98 14:14:07
+ - (ISSUES): finished a couple of things.
+
+hardaker 15 Nov 98 14:19:21
+ - (ISSUES, snmp_agent.c): fix pdu freeing problem, thanks to Joe's
+ merge of the pdu structures.
+
+hardaker 15 Nov 98 15:50:33
+ - (ISSUES): misc date changes and mark that I'm working on something.
+
+hardaker 15 Nov 98 15:53:24
+ - (snmpd.c, read_config.c, snmp_api.c):
+ - create/call snmp_shutdown().
+ - remove the "persistent." part of the persistent .conf name.
+ - rename instead of unlink old persistent .conf file.
+
+hardaker 15 Nov 98 17:37:00
+ - (ISSUES, snmpv3.c): when engineID changes from the previous run,
+ reset engineBoots to 1. (requires storing the last engineID used).
+
+hardaker 16 Nov 98 20:10:19
+ - (snmp_agent.c, snmpd.c, snmp_mib.c, snmp_mib.h, snmp_api.c,
+ snmp_api.h):
+ - use new library based statistics counter everywhere.
+
+hardaker 16 Nov 98 20:17:01
+ - (util_funcs.c, util_funcs.h, interfaces.c, system.c, registry.c):
+ - use header_generic in a few more places.
+ - standardize the MATCH_FAILED and MATCH_SUCCEEDED definitions.
+
+hardaker 22 Nov 98 07:24:56
+ - (snmpusm.c): usm_create_initial_user() accepts name & auth/priv types.
+
+hardaker 22 Nov 98 07:25:52
+ - (snmpd.c):
+ - log PID to file using -P.
+ - create template users: templateMD5 & templateSHA.
+
+hardaker 22 Nov 98 07:26:30
+ - (keymanagetest.c): new flag: -q = quiet.
+
+hardaker 22 Nov 98 07:27:12
+ - (demo): script to run list of commands required for the demo.
+
+hardaker 22 Nov 98 07:28:58
+ - (.cvsignore): ignore testing targets.
+
+hardaker 22 Nov 98 14:36:53
+ - (demo): quote the pass phrase.
+
+hardaker 22 Nov 98 22:16:44
+ - (demo):
+ - pass/fail type output.
+ - hosts other than localhost.
+ - capability to look for stuff in output of commands.
+
+hardaker 22 Nov 98 22:26:28
+ - (demo): turn encryption on for tests that need it.
+
+hardaker 23 Nov 98 07:14:05
+ - (keymanagetest.c): print MD5/SHA before the keychange string.
+
+hardaker 23 Nov 98 07:16:01
+ - (demo): fix the key change string extraction to look for the MD5 version.
+
+hardaker 23 Nov 98 07:38:44
+ - (keymanagetest.c): bequiet should be 0 by default.
+
+hardaker 23 Nov 98 08:06:34
+ - (demo): bug fixes.
+
+dreeder 24 Nov 98 16:43:50
+ Fixed bug in USM preventing exchange of crypted packets. Code added
+ to properly estimate size of crypted text given un-padded plaintext.
+ Found/fixed KMT prototype conflict that caused the given IV to be
+ ignored at crypt/decrypt time.
+ setup_engineID() has a new argument to allow ID strings to be returned
+ to caller.
+ New file snmplib/transform_oids.h to put static declarations in a single
+ place...
+ Failure of stat increments in USM no longer cause failure in the calling
+ function.
+ Added utility apps/encode_keychange. (-h for usage.)
+ DIFFTIME macro to replace oft repeated code.
+ Shortened some VACM debugging output to a single line from many.
+ More comments. More trouble spots marked XXX.
+ Converted oft used magic numbers to symbolic constants (some pre-existing).
+ Cleaned up some simply fixed build warnings.
+ Updated nonexport/crypto/README. Still needs work.
+
+marz 25 Nov 98 07:44:28
+ -(snmp_parse_args.c): added -T <boots> <time> to set an initial (authenticated) time value for the destination engineIDs boots/time)
+
+marz 25 Nov 98 07:48:49
+ -(snmp_api.[ch], snmp.h, snmp_client.c): handle incoming Reports - propagate STAT_ERROR to apps with approp. error message, handle recoverable error notInTimeWindow and engineId discovery, send reports with secLevel==noAuthNoPriv except notInTimeWindow
+
+marz 25 Nov 98 07:51:50
+ -(tools.c): oops back out little compile workaround I did not mean to commit
+
+marz 25 Nov 98 07:54:01
+ -(snmpd.c, snmp_agent.c): initialize pid_dile, only allocate engineID mem for Reports when sending Report, fix version info in debug message
+
+hardaker 25 Nov 98 07:56:30
+ - (snmpEngine.c, snmpMPDStats.c, usmUser.c, usmUser.h):
+ - Added a couple of DEUBGP statements and a couple of comment clairifications.
+
+hardaker 25 Nov 98 12:39:01
+ - (snmpusm.c): changes in comments for clarification.
+
+hardaker 25 Nov 98 12:40:35
+ - (snmpv3.c): changes in comments for clarification.
+
+hardaker 25 Nov 98 12:54:08
+ - (snmp_agent.c): version checks against v2c/v2p -> !v1.
+
+hardaker 25 Nov 98 13:04:02
+ - (snmpd.c): comment clarification.
+
+hardaker 25 Nov 98 17:12:02
+ - (demo):
+ - encode_keychange usage.
+ - move closer to 42, but leave room for a few more things.
+
+hardaker 25 Nov 98 22:58:43
+ - (config.h.in, configure, configure.in): check for tcgetattr.
+
+hardaker 25 Nov 98 22:59:56
+ - (snmpv3.c, snmpv3.h): create snmpv3_set_engineBootsAndTime().
+
+hardaker 25 Nov 98 23:00:47
+ - (tools.c): dump_engineID should *never ever* modify the passed length param.
+
+hardaker 25 Nov 98 23:02:49
+ - (demo):
+ - -s: 1 sec sleep instead of keypress.
+ - do time tests.
+ - use encode_keychange.
+
+hardaker 25 Nov 98 23:04:10
+ - (snmpEngine.c, snmpEngine.h):
+ - Shhhhh..... boots and time are writable... Don't tell anyone... Shhh...
+
+hardaker 25 Nov 98 23:15:05
+ - (encode_keychange.c):
+ - use u_char's where appropriate.
+ - some debugging statements added.
+
+hardaker 25 Nov 98 23:32:51
+ - (usmUser.c):
+ - keychange needs a temp buffer.
+ - a few debugging statements.
+
+hardaker 27 Nov 98 10:20:45
+ - (snmpusm.c): usm_set_salt() accepts a key which is too long (SHA for DES).
+
+hardaker 27 Nov 98 10:23:03
+ - (snmp_api.c): snmpv3_send_report() removes the secStateReference
+ from the pdu is there is one. It shouldn't be used for reports.
+
+hardaker 27 Nov 98 10:31:12
+ - (demo): final fixes for all current tests to work.
+
+hardaker 27 Nov 98 15:15:25
+ - (demo):
+ - -T: pause after test completions.
+ - **** 42/42 tests passed
+
+hardaker 27 Nov 98 16:55:15
+ - (snmppass.c): beginnings of a snmp password changer:
+ - stole most code from snmpset.c and encode_keychange.c.
+ - need to fix: must specify most everything on the command line (ie,
+ .conf file tokens don't work here).
+ - very unclean and a quick hack.
+ - differs from encode_keychange, in that it actually preforms the set.
+
+hardaker 27 Nov 98 16:55:23
+ - (Makefile.in): add snmppass.c
+
+hardaker 27 Nov 98 16:56:47
+ - (.cvsignore): snmppass and encode_keychange
+
+hardaker 28 Nov 98 11:41:02
+ - (usmUser.c, usmUser.h):
+ - merge write_ keyChange and ownKeyChange functions into one. Since
+ the user name is not passed in, the calling module will have to
+ check for it until we're willing to change the API or the VACM is
+ fixed and the ownKeyChnage objects can be obsoleted.
+
+hardaker 28 Nov 98 11:41:36
+ - (snmppass.c): -o: use the ownKeyChange object.
+
+marz 29 Nov 98 19:32:21
+ (demo): fix time sync test to test for timeout as expected when app clock is set ahead
+
+marz 29 Nov 98 19:34:41
+ -(snmp_api.c): move commandline based boots/time setting code after engineID discovery in case engineID was not supplied on command line as well
+
+hardaker 30 Nov 98 22:00:23
+ - (demo): better document the required .conf file pieces.
+
+hardaker 30 Nov 98 22:12:10
+ - (demo): enable -C: auto-configure the agent.
+
+wbabson 1 Dec 98 07:56:55
+ Fixed a library search order bug which had /usr/local/ssl/lib and /usr/local/lib
+ searched before ../snmplib. This caused unresolved references when trying to
+ link snmpd and the applications. To do this LOCAL_LIBS was created and ../snmplib
+ was removed from LIBS and placed there. Then LOCAL_LIBS was added before
+ LDFLAGS in the link commands. agent/Makefile.in and apps/Makefile.in were modified.
+
+hardaker 1 Dec 98 14:54:28
+ - (snmp_api.c): include kmt.h and related.
+
+hardaker 1 Dec 98 14:55:28
+ - (tools.c): include kmt.h and related.
+
+hardaker 1 Dec 98 14:55:49
+ - (usmUser.c): include kmt.h and related.
+
+hardaker 1 Dec 98 14:55:55
+ - (snmppass.c): include kmt.h and related.
+
+marz 2 Dec 98 08:32:29
+ -(demo.c): test #38 will show the 6 message exchange since it is initialized with a simulated authentic oots/time which defeats the LCD_TINE_SYNC_OPT
+
+hardaker 2 Dec 98 14:26:08
+ - (snmp_agent.c): after detection of snmp version, error codes were reversed.
+
+hardaker 2 Dec 98 15:18:53
+ - (snmpd.conf.5.def): added v3 specific token notes.
+
+hardaker 2 Dec 98 15:19:47
+ - (Makefile.in, snmp.conf.5.def): created a snmp.conf manual page.
+
+hardaker 2 Dec 98 17:03:27
+ - (.cvsignore): snmp.conf.5 ignored.
+
+hardaker 2 Dec 98 17:03:48
+ - (snmp.conf.5.def): mibdirs, mibs, and mibfiles documented.
+
+hardaker 2 Dec 98 19:38:12
+ - (lcd_time.c): comment clairification.
+
+hardaker 2 Dec 98 19:39:22
+ - (mib.c): unneeded XXX removed.
+
+hardaker 2 Dec 98 19:39:47
+ - (read_config.c): make copy_word() skip ahead of space on returned pointer.
+
+dreeder 3 Dec 98 18:44:49
+ Co-checkin with new version of KMT (located in nonexport/KMT-snmp).
+ kmt_random() signature changed in sc_random().
+ Second verson testing/demo at testing/demo2* .
+
+hardaker 3 Dec 98 22:20:06
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - new flag and define --enable-testing-code -> SNMP_TESTING_CODE.
+
+hardaker 3 Dec 98 22:22:59
+ - (keytools.c): use SNMP_TESTING_CODE def to protect some sections.
+
+hardaker 3 Dec 98 22:23:48
+ - (scapi.c): testing DEBUGP for printing out keys.
+
+hardaker 3 Dec 98 22:26:40
+ - (snmpusm.c, snmpusm.h):
+ - protect sections with SNMP_TESTING_CODE.
+ - allow *'s in fields for engineIDs for key setting .conf entries.
+
+hardaker 3 Dec 98 22:32:20
+ - (snmpEngine.c, snmpEngine.h):
+ - only make time/boots setable when SNMP_TESTING_CODE is defined.
+
+hardaker 3 Dec 98 23:17:17
+ - (demo): removed.
+
+marz 4 Dec 98 08:05:59
+ -(snmpcmd.1): update man page for new V3 parse args
+
+hardaker 4 Dec 98 11:03:14
+ - (Makefile.in, snmppass.c, snmpusm.c):
+ - delete snmppass.
+ - create first pass snmpusm.c.
+
+hardaker 4 Dec 98 11:04:09
+ - (snmpd.conf.5.def): document the * for engineID feature.
+
+hardaker 4 Dec 98 16:45:43
+ - (UCD-DEMO-MIB.txt): demo mib objects.
+
+hardaker 4 Dec 98 16:46:09
+ - (UCD-SNMP-MIB.txt): mention/reserve the demo object group in a comment.
+
+hardaker 4 Dec 98 16:49:21
+ - (.cvsignore): .gdb stuff
+
+hardaker 4 Dec 98 16:50:04
+ - (ucdDemoPublic.c, ucdDemoPublic.h):
+ - examples/ucdDemoPublic module: simple objects for doing demos,
+ including remote resetting of keys to a known passwords for a list
+ of users.
+
+hardaker 4 Dec 98 16:50:28
+ - (ucdDemoPublic.cmds): commands to run to set up for the demo.
+
+hardaker 4 Dec 98 16:50:38
+ - (ucdDemoPublic.conf): configuration file lines needed for the demo.
+
+hardaker 4 Dec 98 18:38:05
+ - (version.h, sedscript.in, bug-report): 4.0.pre1 tag
+
+dreeder 5 Dec 98 16:52:49
+ Extended demo2 into demo.remote to allow testing between <here> and
+ ucd-snmp.ucdavis.edu.
+
+marz 13 Dec 98 14:57:02
+ -(snmp_api.[ch], snmp_client.c): add support for msgID which is different from reqid and which increments with each retry. Note: late Responses will be dropped if they arrive after timeout - this is different from v1 behaviour where a late Response to the initial try will be accepted up to the time where the last retry times out
+
+hardaker 13 Dec 98 18:39:02
+ - (mib2c): minor update (needs more) for newer snmp perl mod.
+
+hardaker 13 Dec 98 18:39:44
+ - (.cvsignore): .gdb.auto.init
+
+hardaker 13 Dec 98 18:41:11
+ - (encode_keychange.c): removed unneeded linux ifdef.
+
+hardaker 17 Dec 98 15:59:10
+ - (read_config.c): wrap config line print's in SNMP_TESTING_CODE checks.
+
+hardaker 2 Dec 98 21:55:04
+ - (just about all files): merge of V3-b1 changes into V3-b2 branch.
+
+hardaker 2 Dec 98 22:27:54
+ - (agent_read_config.c, snmpd.c, usmUser.c, snmp_parse_args.c,
+ read_config.h, snmp_api.c, snmpusm.c, snmpv3.c, tools.h):
+ - final changes? to V3-b2 merge.
+
+hardaker 2 Dec 98 22:29:52
+ - (read_config.c): make that 28 errors from whitespace changes.
+
+hardaker 2 Dec 98 22:37:08
+ - (snmpd.c): call init_snmpv3 before -H usage info.
+
+hardaker 13 Dec 98 10:33:45
+ - (*): merge1 to V3-b3.
+
+hardaker 13 Dec 98 18:56:18
+ - (*): merge2 to V3-b3.
+
+dreeder 17 Dec 98 08:05:04
+ Creature comfort: /etc script to (re)start and stop snmpd and snmptrapd
+ and keep (compressed) copies of previous logfiles. Intended to be universal
+ to Linux, Solaris, FreeBSD, ... .
+
+hardaker 21 Dec 98 17:36:37
+ - (configure, configure.in): define USE_INTERNAL_MD5 if KMT isn't available.
+
+hardaker 21 Dec 98 17:49:38
+ - (all_system.h, keytools.c, lcd_time.c, md5.c, md5.h, scapi.c,
+ scapi.h, snmp_api.c, snmp_auth.c, tools.c):
+ - internal MD5 support done.
+ - tested with and without kmt to opposite and same side apps/agents.
+ - tested against older 4.0.pre1 agent on bandit as well.
+ - all but one testing/* test passes (which was failing before anyway).
+ - the older demo script passes as well.
+ - Modified many other routines. Everything should use SCAPI now and
+ KMT should never be called directly outside the scapi.c and
+ keytools.c files.
+ - new scapi routine: sc_hash().
+ - Could, as always, use a bit more clean up, but I needed to check
+ something in that worked before I break it again (ahem).
+
+hardaker 21 Dec 98 17:53:10
+ - (snmpget.c, snmpusm.c): unneeded KMT includes removed.
+
+hardaker 21 Dec 98 17:54:38
+ - (keymanagetest.c): surround a few KMT specific items with #ifdefs.
+
+hardaker 21 Dec 98 17:56:56
+ - (snmp_agent.c): remove unneeded KMT includes.
+
+hardaker 22 Dec 98 19:40:12
+ - (keytools.c): decode_keychange() wasn't setting the returned buffer length.
+
+hardaker 22 Dec 98 19:43:50
+ - (snmp_api.c): DEBUGP of probed engineID printed 00's as 0's.
+
+hardaker 22 Dec 98 21:09:38
+ - (snmp_agent.c, usmStats.c, usmStats.h, usmUser.h,
+ SNMP-USER-BASED-SM-MIB.txt):
+ - updated USM mib, including the move from snmpModules.12 to .15.
+ - make reports generated include the .0 suffix for the instance specifier.
+
+hardaker 22 Dec 98 21:10:28
+ - (tools.c): wrap dump_engineID in #ifdef SNMP_TESTING_CODE.
+
+hardaker 22 Dec 98 21:17:25
+ - (lcd_time.c): wrap dump_etimelist() in #ifdef SNMP_TESTING_CODE.
+
+hardaker 22 Dec 98 21:20:31
+ - (encode_keychange.c):
+ - don't use dump_snmpEngineID() unless testing.
+ - Note: this utility is not really needed anymore.
+
+hardaker 22 Dec 98 22:12:32
+ - (SNMP-USER-BASED-SM-MIB.txt): typo (cut and paste missed a line).
+
+hardaker 23 Dec 98 21:07:33
+ - (snmpusm.c): msgSecurityParams should contain the *salt*, not the IV,
+ as defined by the USM document, section 8.1.1.1 (and common sense).
+
+hardaker 23 Dec 98 21:47:44
+ - (snmp_api.c):
+ - Send only authNoPriv reports for notInTimeWindow reports.
+ - report length check increased by one to accomodate for the .0 suffix.
+
+hardaker 23 Dec 98 22:06:25
+ - (snmpusm.c): allow generate_out_msg() to use unknown security names
+ for secLevel = noAuthNoPriv.
+ - this is required since unknownUser reports need to go out with the
+ same user name as the bad request that came in.
+
+hardaker 29 Dec 98 17:01:24
+ - (vacm.c): Enable multiple side by side views in the view family
+ tree. The views already existed, but weren't checked and only the
+ first view was found.
+ - Not done in a clean fashion. Much of the structure definitions
+ should be rewritten with sub-pieces to do it properly with greater
+ speed.
+
+hardaker 29 Dec 98 17:28:31
+ - (config*): define u_int{8,16,32}_t for KMT headers.
+
+hardaker 31 Dec 98 17:55:39
+ - (snmpusm.c): USM oid's were wrong
+
+hardaker 31 Dec 98 17:58:19
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre2 )
+
+hardaker 6 Jan 99 07:46:02
+ - (snmpusm.c): usm_set_salt() was using a host specific byte ordering
+ for generating the salt from the enigineBoots value and from the
+ arbitrary integer. This technically shouldn't matter, but since
+ we're shooting to be a reference platform...
+
+hardaker 19 Jan 99 19:20:07
+ - (ISSUES): need random int for IV.
+
+wbabson 26 Jan 99 05:52:19
+ Changed MIN() macro to SNMP_MIN() because we explicitly
+ define that in tools.h... This was needed to allow successful
+ linkage in Solaris 2.6
+
+hardaker 27 Jan 99 20:37:56
+ - (SNMP-TARGET-MIB.txt): target mib was improperly located at .15 not .12.
+
+hardaker 27 Jan 99 20:51:12
+ - (snmp_parse_args.c): accept security level abbreviations.
+
+hardaker 27 Jan 99 21:07:59
+ - (acconfig.h, config.h.in, configure, configure.in, read_config.c):
+ - create --with-persistent-directory configure script flag.
+
+dreeder 29 Jan 99 15:20:51
+ Repaired tests to reflect changes in the codebase.
+
+marz 31 Jan 99 13:57:13
+ -(snmp_api.c): zero lenght user name for enineID discovery
+
+dreeder 2 Feb 99 14:04:48
+ Resolve OID collisions: 1) between demo MIB and UCD enterprise MIB; 2)
+ inside demo MIB.
+
+hardaker 2 Feb 99 22:04:38
+ - (snmptrapd.c): support -H.
+
+hardaker 2 Feb 99 22:13:41
+ - (read_config.c):
+ - allow env variable SNMP_PERSISTENT_FILE to override persistent
+ storage locaction.
+ - merge in Mike's changes to copy_word().
+
+hardaker 2 Feb 99 22:14:46
+ - (target.h): merge mike's target mibgroup into the 4.0 line.
+
+marz 6 Feb 99 15:04:13
+ -(snmp_api.[ch],snmp_parse_args.c,snmpv3.[ch],snmpusm.c,snmpcmd.1): allow contextEngineID and securityEngineID to be different, added -E/-e to parse_args, fixed engineID discovery which broke after name used in probe switched to zero length string
+
+hardaker 7 Feb 99 20:43:15
+ - (read_config.c): -Wall fix.
+
+hardaker 7 Feb 99 20:45:17
+ - (snmpv3.c, snmpv3.h): a few -Wall fixes:
+ - protoype init_snmpv3_post_config(void).
+ - remove unneeded variables.
+ - don't compile in set_engineBootsAndTime interface function if not needed.
+
+hardaker 7 Feb 99 20:47:59
+ - (snmp2p.c, snmp_agent.c, snmp_agent.h, snmp_vars.c, snmp_vars.h,
+ snmpd.c, snmpd.h, vacm_vars.c, vacm_vars.h, snmp_api.c, snmp_api.h,
+ snmp_auth.c, snmp_impl.h): Patch from Dave Shield:
+ - implement agent using libraries parsing and handling routines
+ instead of duplicating it.
+
+hardaker 8 Feb 99 00:11:59
+ - (snmp_agent.c, util_funcs.c, ucdDemoPublic.c, route_write.c,
+ snmp_mib.c, system.c, snmpEngine.c, usmUser.c, extensible.c, pass.c,
+ pass_persist.c, proc.c, versioninfo.c):
+ - modified to work with new write variable api.
+ - fixed a missing feature in Dave's code: creation.
+
+hardaker 8 Feb 99 12:22:13
+ - (COPYING): It's 1999.
+
+wbabson 8 Feb 99 13:34:39
+ Changed the function prototype for snmpv3_set_engineBootsand Time
+ from int f(); to void f(); to match the function definition i
+ snmpv3.c .
+
+wbabson 8 Feb 99 13:40:27
+ fixed casting error... *(long) changed to *(long *)
+
+dreeder 17 Feb 99 16:23:43
+ Random IV; fixed salt construction.
+ Fixed NULL dereference show-stopper introduced by merge of D. Sheld's changes.
+ configure.in+Makefile.in automatically create PERSISTENT_DIRECTORY.
+ Minor compile warnings, out-of-date comments fixed, clarified debug outout,
+ clarified pre-compile code in scapi.c.
+ Discovered where pdu->securityEngineID was being multiply free'd, but not
+ the *first* time... (open problem)
+
+hardaker 17 Feb 99 20:59:29
+ - (snmpd.c): -Wall fixes.
+
+hardaker 17 Feb 99 21:00:07
+ - (snmp_agent.c):
+ - fix getbulks.
+ - fix snmpset's to allow creation.
+
+hardaker 17 Feb 99 21:00:22
+ - (dlmod_mib.c): don't define MATCH_SUCCEEDED at all.
+
+hardaker 17 Feb 99 21:00:36
+ - (util_funcs.c): -Wall variable removing.
+
+hardaker 17 Feb 99 21:00:58
+ - (route_write.c, snmp_mib.c, system.c):
+ - -Wall variable removing.
+
+hardaker 17 Feb 99 21:01:36
+ - (usmUser.c, extensible.c, pass.c, proc.c, versioninfo.c):
+ - -Wall variable removing.
+
+hardaker 17 Feb 99 21:05:28
+ - (keytools.c, md5.c, read_config.c, scapi.h, snmp_api.c, snmp_auth.c,
+ snmp_client.c, snmpusm.c, transform_oids.h):
+ - -Wall fixes.
+
+hardaker 17 Feb 99 21:28:57
+ - (keytools.c): opps. Deleted a variable I shouldn't have.
+
+hardaker 17 Feb 99 21:30:11
+ - (snmp_agent.c): You can't assign a NULL to a union, only to a sub-type.
+
+hardaker 17 Feb 99 21:45:23
+ - (testing/Makefile.in): remove references to subdirs since there are
+ none and it breaks simplier versions of sh when no arguments to
+ foreach exist.
+
+marz 24 Feb 99 09:31:29
+ -(snmplib/snmp_api.[ch],snmplib/snmp.h,agent/snmpd.h,agent/snmp_agent.h): moved Reports into snmplib, conform to spec on criterria for sending Reports, lay ground work for maxMsgSize, default contextEngineID to securityEngineID when not explicitly set itself
+
+marz 25 Feb 99 14:04:05
+ -(snmp_api.c,snmp_client.c): fixed bug in snmp_clone_pdu (not cloning securityEnigineID), uncommented _snmp_free
+
+wbabson 9 Mar 99 08:54:12
+ First cut at snmptrapd modification. Receives authPriv and lower security
+ level traps.
+
+wbabson 9 Mar 99 09:02:07
+ Changed DEBUGP() statement to get securityName from PDU rather than session
+ as session was not yet initialized during engine ID discovery and the NULL
+ value caused a segmentaion fault.
+
+marz 10 Mar 99 08:04:47
+ -(snmp_api.c): fix engineId discovery when context engineID is specified (needed to discover proxy engineID if all you know is proxied agent's engineID)
+
+wbabson 17 Mar 99 13:27:59
+ Changed DEBUGP() statement about Building the SNMP message so that
+ even if securityName is uninitialized (NULL), program will continue
+ without core dumping. Later, someone should see about fixing the logic
+ so that securityName will not be a NULL pointer here, or
+ repair the debugging scheme, if that's valid.
+
+hardaker 24 Mar 99 20:30:12
+ - (mibincl.h): add agent_read_config.h
+
+hardaker 24 Mar 99 20:32:44
+ - (testing/Makefile.in): remove subdirs.
+
+hardaker 28 Mar 99 16:03:04
+ - (vacm_vars.h): relocate VACM node where it should be (13->16).
+
+hardaker 28 Mar 99 16:16:38
+ - (read_config.c): skip space after copying a word in copy_word()
+
+hardaker 30 Mar 99 09:51:21
+ - (ucdDemoPublic.c): added help strings to conf parsers.
+
+hardaker 6 Apr 99 15:27:29
+ - (Makefile.in): remove accidentially comitted conflict.
+
+hardaker 15 Apr 99 07:25:48
+ - (keytools.c): Allow short passphrases when SNMP_TESTING_CODE is set.
+
+marz 19 Apr 99 14:14:23
+ -(snmp_api.[ch],snmp_client.c): fixed bug where msgId and reqId were not treated correctly in responses if orginal request happened to have msgId or reqId equal to arbitrary default(0)
+
+marz 19 May 99 07:14:44
+
+ adding v3 packet generator perl5 script (requires Convert::BER)
+ .
+
+marz 19 May 99 07:16:41
+
+ example data file to generate a V3 packet with pktgen.pl
+
+marz 19 May 99 08:02:24
+ README for pktgen.pl
+
+marz 19 May 99 08:44:03
+ *** empty log message ***
+
+marz 19 May 99 08:45:15
+ pktgen.pl
+
+marz 19 May 99 10:31:14
+ remove last submit
+
+marz 20 May 99 12:35:03
+ *** empty log message ***
+
+marz 23 May 99 08:04:03
+ handle seq_of to allow arbitrary number of varbinds, bug fixes, send/receive, pretty print debugging packet dump
+
+hardaker 26 May 99 11:18:42
+ - (ipfwacc.h): properly locate the mib.
+
+hardaker 26 May 99 11:20:04
+ - (vmstat.c): include limits.h.
+
+hardaker 26 May 99 15:14:32
+ - (hr_swinst.c): make software application type unknown instead of app.
+
+hardaker 26 May 99 15:18:46
+ - (IPFWACC-MIB.txt): change to counters.
+
+hardaker 26 May 99 15:20:11
+ - (ipfwacc.h): make into counters.
+
+hardaker 26 May 99 15:33:05
+ - (agent_read_config.c, hr_filesys.c, interfaces.c, tcp.c, udp.c):
+ Patch from Derek J. Balling:
+ - freebsd2 fixes.
+
+hardaker 26 May 99 15:52:57
+ - (acconfig.h, config.h.in): increase MAXREADCOUNT
+
+hardaker 26 May 99 15:54:22
+ - (snmp_vars.c): include sys/queue.h.
+
+marz 1 Jun 99 07:25:55
+ (pktgen.pl, packet.txt): added authentication support (md5 and sha1)
+
+daves 1 Jun 99 08:37:47
+ - (agent/mibgroup/host/hr_swinst.c): Determine type of RPM packages
+
+marz 16 Jun 99 09:30:55
+ (pktgen.pl, packet.txt): added encryption/privact support (des-cbc)
+
+marz 16 Jun 99 12:50:29
+ (pktgen.pl, packet.txt): latest attempt to fix privacy/encryption
+
+marz 23 Jun 99 08:18:59
+ (pktgen.pl, packet.txt): latest attempt to fix privacy/encryption(working with Crypt::DES/Crypt::CBC+patch)
+
+hardaker 6 Apr 99 15:13:40
+ - (*): Merged the 4.0 line into the 3.6.1 line.
+
+hardaker 6 Apr 99 15:38:45
+ - (mibincl.h, ucdDemoPublic.c, vacm_vars.h, snmptrapd.c, snmp_api.c,
+ Makefile.in): final merge pieces of recent v3 line changes.
+
+mslifcak 6 Apr 99 21:24:22
+ - changes for ANSI headers; POSIX(index vs strchr); minor fixes
+
+mslifcak 6 Apr 99 22:13:59
+ - (vacm_vars.c) - set global ptrs = 0.
+
+mslifcak 6 Apr 99 22:14:43
+ - (snmp_vars.c) more v2party rework needed
+
+mslifcak 7 Apr 99 06:17:28
+ - () more ANSI header fixups; touchup for M$ Win32 build
+
+hardaker 7 Apr 99 10:42:10
+ - (config.h.in, snmp_vars.c, encode_keychange.c, snmptrapd.c,
+ Makefile.in, all_general_local.h, keytools.c, keytools.h,
+ lcd_time.c, md5.c, read_config.c, scapi.c, snmp_api.c, snmpusm.c,
+ snmpv3.c, tools.c, tools.h):
+ - misc merging, including fixes and debugging statement changes to
+ newer model.
+ - a few -Wall fixes.
+
+hardaker 7 Apr 99 10:48:07
+ - (snmp_mib.c): removed unnneeded header_snmp().
+
+hardaker 7 Apr 99 11:28:02
+ - (ucdDemoPublic.c, sysORTable.c, vacm_vars.c, smux.c, snmpEngine.c,
+ usmUser.c, snmpTargetAddrEntry.c, snmpTargetParamsEntry.c):
+ - debugging statement conversion
+
+mslifcak 7 Apr 99 12:00:20
+ - (agent/snmp2p.c agent/snmp_agent.c agent/snmp_vars.h
+ agent/view_parse.c agent/mibgroup/util_funcs.c
+ agent/mibgroup/examples/ucdDemoPublic.c
+ agent/mibgroup/host/hr_filesys.c
+ agent/mibgroup/host/hr_storage.c
+ agent/mibgroup/host/hr_swrun.c agent/mibgroup/host/hr_system.c
+ agent/mibgroup/mibII/at.c agent/mibgroup/mibII/icmp.c
+ agent/mibgroup/mibII/interfaces.c agent/mibgroup/mibII/ip.c
+ agent/mibgroup/mibII/system_mib.c agent/mibgroup/mibII/tcp.c
+ agent/mibgroup/mibII/udp.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/mibII/var_route.c agent/mibgroup/misc/ipfwacc.c
+ agent/mibgroup/snmpv3/usmUser.c
+ agent/mibgroup/ucd-snmp/extensible.c
+ agent/mibgroup/ucd-snmp/hpux.c agent/mibgroup/ucd-snmp/pass.c
+ agent/mibgroup/ucd-snmp/pass_persist.c
+ agent/mibgroup/ucd-snmp/proc.c
+ agent/mibgroup/v2party/context_vars.c
+ agent/mibgroup/v2party/party_vars.c
+ agent/mibgroup/v2party/view_vars.c apps/snmpdelta.c
+ apps/snmptest.c apps/snmptrapd.c apps/snmpnetstat/route.c
+ apps/snmpnetstat/winstub.c snmplib/acl_parse.c
+ snmplib/context.h snmplib/context_parse.c snmplib/party.h
+ snmplib/party_parse.c snmplib/read_config.c snmplib/snmp_api.c
+ snmplib/snmp_auth.c snmplib/snmp_impl.h snmplib/vacm.h
+ snmplib/view.h) fgets use sizeof mostly, oid base size is MAX_OID_LEN
+
+mslifcak 7 Apr 99 12:17:23
+ -(ipfwchains.c) remove multiple definitions of MATCH_FAILED
+
+mslifcak 7 Apr 99 15:00:39
+ -(usmUser.c,system.c) plug mem leak; (snmp_api.c) enforce array limit.
+
+hardaker 12 Apr 99 22:14:31
+ - (mibincl.h): include sys/time.h.
+
+hardaker 12 Apr 99 22:15:39
+ - (hr_utils.h): remove variable names from prototypes (was causing problems).
+
+hardaker 12 Apr 99 22:16:45
+ - (tkmib): make displayed mib node info into two columns instead of one.
+
+hardaker 12 Apr 99 22:25:09
+ - (snmp_api.c): make snmp_varlist_add_variable to possible create a
+ varlist before adding something to it.
+
+hardaker 13 Apr 99 15:19:20
+ - (configure, configure.in, Makefile.in): Patch from Daniel Hagerty:
+ - fix libwrap to only add the library to the agent.
+
+hardaker 13 Apr 99 15:20:00
+ - (system_mib.c): make sysDescr read-only.
+
+hardaker 13 Apr 99 15:32:23
+ - (pass.c): Patch from Jim Mar:
+ - add capability for binary octet strings in pass scripts.
+
+hardaker 13 Apr 99 15:36:31
+ - (SNMP-NOTIFICATION-MIB.txt, SNMP-PROXY-MIB.txt,
+ SNMP-VIEW-BASED-ACM-MIB.txt): Patch from Niels Baggesen:
+ - fix module locations for broken mibs.
+
+hardaker 13 Apr 99 15:54:48
+ - (freebsd.h, freebsd2.h): Patch from Niels Baggesen:
+ - freebsd utmp cleanups.
+
+hardaker 13 Apr 99 15:56:53
+ - (snmpd.c): Patch from Niels Baggesen:
+ - log with timestamp at shutdown.
+
+hardaker 13 Apr 99 15:57:24
+ - (vacm_vars.c): Patch from Niels Baggesen:
+ - better checking of .conf file parsing line requirements.
+
+hardaker 13 Apr 99 15:58:02
+ - (snmptranslate.c): Patch from Niels Baggesen:
+ - support -P.
+
+hardaker 13 Apr 99 15:58:27
+ - (snmp_config.5.def, snmptrap.1, snmptrapd.conf.5.def): Patch from
+ Niels Baggesen:
+ - clean up small bugs.
+
+hardaker 13 Apr 99 16:00:49
+ - (parse.c, parse.h): Patch from Niels Baggesen:
+ - nicer parser messages (include file names). Correct help for -Pc.
+ - Add FRAME-RELAY-DTE-MIB as replacement for RFC-1315
+
+hardaker 13 Apr 99 16:03:29
+ - (snmptrapd.c): Patch from Niels Baggesen:
+ - snmptrapd option to ignore auth traps, add -S option, log termination.
+
+mslifcak 14 Apr 99 15:29:58
+ - (snmptranslate.c) init_snmp takes argument; "" used.
+
+mslifcak 14 Apr 99 15:30:34
+ - (parse.c) File pointer initialized to "" before first use.
+
+hardaker 14 Apr 99 15:52:35
+ - (snmptranslate.c): init_snmp("snmpapp").
+
+mslifcak 14 Apr 99 16:31:55
+ - (snmp_agent,c, snmp_api.[ch], snmp_client.[ch]) fix variable_list with built-in storage
+
+mslifcak 14 Apr 99 16:56:37
+ - apps that use snmp_fix_pdu must clean up the response PDU !
+
+mslifcak 16 Apr 99 07:30:29
+ - (IPFWACC-MIB.txt) change module name from IPFWADM-MIB to IPFWACC-MIB.
+
+mslifcak 16 Apr 99 07:54:22
+ - (IPFWCHAINS-MIB.txt) ipfwChainTable {ipfw 1} fix
+
+mslifcak 16 Apr 99 08:33:16
+ - (mib.c) "-m" or MIBS : can specify MIB module by file name.
+
+hardaker 16 Apr 99 21:10:06
+ - (README): Added v3 team members.
+
+hardaker 16 Apr 99 21:11:48
+ - (configure.in): changed default store location to /var/ucd-snmp
+
+hardaker 16 Apr 99 21:15:14
+ - (snmp.h): SNMPADMINLENGTH definition.
+
+hardaker 16 Apr 99 21:16:16
+ - (snmp_auth.c): removed fix note.
+
+hardaker 16 Apr 99 21:27:06
+ - (NEWS): updated
+
+hardaker 16 Apr 99 21:27:41
+ - (snmptrapd.8): man patch from Niels
+
+hardaker 16 Apr 99 21:34:49
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre3 )
+
+mslifcak 18 Apr 99 06:54:26
+ - (ipfwacc.h) subdir change per Joe Pruettt : 9 -> 10
+
+hardaker 19 Apr 99 21:01:15
+ - (mib2c, mib2c.conf, mib2c.vartypes.conf):
+ - rewrote mib2c to be more dependent on .conf files. The main .conf
+ file now contains the code itself.
+ - need to write a foreach(mibnode) type parser next.
+
+hardaker 19 Apr 99 21:09:27
+ - (mibincl.h): add read_config.h.
+
+hardaker 19 Apr 99 21:12:17
+ - (read_config.c, read_config.h):
+ - created a more convenient read_config_read_data() function to
+ generically read a token into a given variable.
+ - cleaned up persistent storage parsing routines.
+ - use previously malloced space in some routines, or malloc it for
+ them if the storage area is NULL.
+
+hardaker 19 Apr 99 21:14:28
+ - (snmp_api.c): Don't snmp_set_var_objid if name is NULL in
+ snmp_varlist_add_variable().
+
+hardaker 20 Apr 99 11:28:14
+ - (mib2c, mib2c.conf, mib2c.vartypes.conf): more updates.
+
+hardaker 20 Apr 99 15:31:35
+ - (mib2c, mib2c.conf, mib2c.vartypes.conf):
+ - completely re-hacked:
+ - entire code base is now put into the .conf files rather than in
+ the mib2c program. This should entitle mib2c to be used more
+ generically, and could produce different types of code templates
+ based on the .conf file it is given. In theory, it should be
+ able to produce C code for a non-ucd-snmp agent, or even better,
+ any type of code (not just C) for something else based on mib
+ information.
+ - The down side, is that the current .conf files are now ambiguous
+ again and difficult to understand without being, well, me. The
+ up side is that I'm sure Dave Shield will go through and clean
+ it up for me like he did last time. Ha ha. I wonder if he'll
+ read this? (If so, see me first).
+
+hardaker 20 Apr 99 16:04:17
+ - (mib2c, mib2c.conf): variable name conversions:
+ - variableTypes -> variables
+ - cname -> NAME
+
+hardaker 20 Apr 99 16:10:44
+ - (mib2c, mib2c.conf): a little more clean up.
+
+hardaker 20 Apr 99 21:38:42
+ - (mib2c.conf): clean up skipif regexps a bit.
+
+hardaker 22 Apr 99 07:54:44
+ - (read_config.c, read_config.h): created *read_config_store_data();
+
+hardaker 22 Apr 99 07:56:03
+ - (mib2c, mib2c.conf): allow NoAccess to be processed, and use skipif:
+ directives where needed because of it.
+
+hardaker 22 Apr 99 10:51:30
+ - (snmp_client.c, snmp_api.c, snmp_api.h, keytools.c): Another v3 branch update.
+
+mslifcak 26 Apr 99 09:21:06
+ - (snmplib.c) - use request callback's data if request specifies a callback.
+
+nba 26 Apr 99 11:21:10
+
+ (parse.h) Silly speling misteak (ACCESS_CRAETE)
+
+nba 26 Apr 99 11:48:57
+
+
+ - snmplib/parse.h, snmplib/parse.c: new mib printer: mib_print_tree
+ inspired by a reference to snmx in comp.protocols.snmp
+ - apps/snmptranslate: let the -p option call this new printer
+ - snmplib/snmp_api.c: some left over __P macros
+
+nba 26 Apr 99 12:03:47
+
+ (if.c) make the width of snmpnet -i (and -o) adapt to the length of returned
+ strings
+
+nba 26 Apr 99 12:09:35
+
+
+ apps/*.c: use snmp_perror to report errors from read_objid and friends
+ apps/snmptrapd.c: fix a bus error when using -S and receiving an
+ enterprise specific trap.
+
+nba 26 Apr 99 12:13:50
+
+ */*: replace horrible (char *)"string" with const specifiers in relevant
+ functions.
+
+mslifcak 26 Apr 99 12:37:09
+ - (snmp_api.c) - fix other use of request's callback data
+
+mslifcak 27 Apr 99 09:51:35
+ - (interfaces.c) add if_type_from_name to convert interface name to type.
+
+hardaker 29 Apr 99 07:32:39
+ - (Makefile.in, callback.c, callback.h): callback API.
+
+hardaker 29 Apr 99 07:39:45
+ - (agent_read_config.c, snmpd.c, snmptrapd.c, snmp_api.c, snmpusm.c,
+ snmpusm.h, snmpv3.c, snmpv3.h):
+ - use the callback mechanism for post-config stuff.
+
+hardaker 3 May 99 07:07:15
+ - (agent_read_config.c, usmUser.c, usmUser.h, snmpTargetAddrEntry.c,
+ snmpTargetAddrEntry.h, snmpTargetParamsEntry.c,
+ snmpTargetParamsEntry.h, snmptrapd.c, callback.c, callback.h,
+ scapi.c, scapi.h, snmp_api.c, snmpv3.c, snmpv3.h):
+ - shutdown and store callback usage.
+
+hardaker 3 May 99 07:13:31
+ - (snmpd.c): fix -A flag, which got broken during someones changes.
+
+hardaker 3 May 99 12:58:19
+ - (Makefile.in, agent_read_config.c, Makefile.in, header_complex.c,
+ Makefile.in, encode_keychange.c, Makefile.in, Makefile.in,
+ all_general_local.h, all_system.h, keytools.c, lcd_time.c, scapi.c,
+ snmp_auth.c, snmpusm.c, tools.c, tools.h, Makefile.in, T.c,
+ etimetest.c, keymanagetest.c, misctest.c, scapitest.c):
+ - nuked all_general_local.h and all_system.h.
+ - makefileindepend as well.
+
+nba 3 May 99 15:40:11
+ (*.[ch]): patches to types to wipe warnings from compilers
+ with more strict noise levels. (also good when compiling
+ with gcc -Wall -pedantic -Wwrite-strings -Wcast-qual)
+
+nba 4 May 99 00:47:44
+ (mib.c): Fix problem (core dump) with MIBFILES environment variable.
+
+nba 4 May 99 00:51:16
+ (many): remove const spec from FindVarMethod. That was wrong
+
+hardaker 4 May 99 11:08:55
+ - (configure, configure.in): Added --enable-developer flag.
+
+mslifcak 6 May 99 09:20:30
+ - (ucd-snmp/vmstat.c) - conditionally include limits.h per Eduard Koucky.
+
+nba 10 May 99 14:47:22
+ Fixing some more prototypes. Pointed out by Markku Laukkanen.
+
+nba 10 May 99 14:49:49
+ snmplib/snmp_api.c: Mix-up of V1_IN_V2/V2_IN_V1 error code when GETBULK
+ inside V1 session.
+
+hardaker 11 May 99 14:02:48
+ - (util_funcs.c): read returns ssize_t not size_t.
+
+hardaker 11 May 99 14:03:25
+ - (memory.h): remove extern.
+
+hardaker 11 May 99 14:11:40
+ - (hpux.c, hpux.h): int -> size_t conversions.
+
+mslifcak 12 May 99 10:53:23
+ - (snmp_api.c snmp_client.c) call snmp_synch_reset from snmp_sess_close
+
+mslifcak 12 May 99 11:22:16
+ -(parse.c party_parse.c read_config.c) no exit() from library; return error
+
+daves 13 May 99 03:52:19
+ - (ip.c): Properly register IP module group on Free-BSD systems
+ (thanks to Mitchell Tasman)
+
+hardaker 13 May 99 09:09:18
+ - (vacm_vars.c): Set pointers to NULL after freeing them.
+
+mslifcak 14 May 99 06:54:51
+ - (agent/mibgroup/dummy/dummy.c agent/mibgroup/examples/example.c
+ agent/mibgroup/examples/example.h
+ agent/mibgroup/examples/wombat.c agent/mibgroup/misc/ipfwacc.c
+ agent/mibgroup/smux/smux.c
+ agent/mibgroup/snmpv3/snmpMPDStats.c
+ agent/mibgroup/snmpv3/usmStats.c
+ agent/mibgroup/snmpv3/usmUser.c snmplib/snmp_auth.c) more size_t fixes
+
+mslifcak 14 May 99 09:47:10
+ - (agent/mibgroup/examples/wombat.h agent/mibgroup/host/hr_disk.c
+ agent/mibgroup/mibII/interfaces.c
+ agent/mibgroup/mibII/var_route.c
+ agent/mibgroup/snmpv3/usmUser.c apps/encode_keychange.c
+ snmplib/parse.c) more ANSI-C touchups
+
+mslifcak 14 May 99 13:59:37
+ -(agent/mibgroup/mibII/interfaces.c snmplib/snmpusm.c) fixes to build HP & AIX
+
+daves 17 May 99 03:20:53
+ - (snmp_parse_args.c): Initialise session using library routine
+
+daves 17 May 99 04:34:55
+ - (snmplib/snmp_api.h snmplib/snmp_api.c snmplib/snmp_client.c
+ agent/snmpd.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/v2party/alarm.c agent/mibgroup/v2party/event.c
+ apps/snmpstatus.c apps/snmptest.c apps/snmptrap.c apps/snmptrapd.c):
+
+ - Use the generic socket addresses 'struct sockaddr',
+ rather than the IP-specific 'struct sockaddr_in'
+
+daves 17 May 99 04:38:00
+ - (snmplib/snmp_api.h snmplib/snmp_api.c snmplib/snmp_client.c
+ agent/snmpd.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/v2party/alarm.c agent/mibgroup/v2party/event.c
+ apps/snmpstatus.c apps/snmptest.c apps/snmptrap.c apps/snmptrapd.c):
+
+ - Use the generic socket address 'struct sockaddr',
+ rather than the IP-specific 'struct sockaddr_in'
+
+daves 17 May 99 07:18:02
+ - (snmplib/snmp_api.c snmplib/snmp_api.h agent/snmpd.c
+ apps/snmptrap.c apps/snmptrapd.c):
+
+ - Use a single address field within the PDU structure
+ (obsoleting 'agent_addr')
+
+daves 18 May 99 06:26:16
+ - (snmp_api.c snmp_api.h): More general handling of PDU flags
+
+mslifcak 18 May 99 09:01:46
+ - (xx/Makefile.in) remove references to as yet missing disman files.
+
+daves 18 May 99 09:23:50
+ - (configure.in snmplib/context_parse.c snmplib/read_config.c
+ snmplib/snmp_api.c snmplib/snmpv3.c snmplib/system.c
+ apps/snmp_parse_args.c apps/snmpbulkwalk.c apps/snmpdelta.c
+ apps/snmpget.c apps/snmpgetnext.c apps/snmpset.c
+ apps/snmpstatus.c apps/snmptable.c apps/snmptest.c
+ apps/snmptrap.c apps/snmpusm.c apps/snmpwalk.c
+ apps/snmpnetstat/if.c apps/snmpnetstat/inet.c
+ apps/snmpnetstat/main.c apps/snmpnetstat/route.c
+ apps/snmpnetstat/winstub.c):
+ - Clean up conditionals protecting include files
+ ( #if HAVE_WINSOCK_H / #else / #endif )
+
+daves 19 May 99 02:33:07
+ - (config.h.in): Additional include protection entries
+
+daves 19 May 99 05:11:37
+ - (snmp_api.c): More generalised handling of socket addresses
+
+mslifcak 19 May 99 18:02:55
+ -(mibII/var_route.c) - fix Linux RouteMask c/o "Nancy" nam@cs.cmu.edu
+
+mslifcak 19 May 99 18:50:12
+ - (host_res.h) fix HAVE_NET_IF_VAR_H define (was HAVE_NET_IN_VAR_H)
+
+daves 20 May 99 03:46:24
+ - (snmp_api.h): Temporary fix to socket address problems
+
+mslifcak 21 May 99 05:24:23
+ -(read_config.c) cast fix per Markku Laukkanen
+
+daves 21 May 99 05:54:22
+ - (snmp_api.c snmp_api.h):
+ - New API call to close down all open sessions
+ (also called on application shutdown)
+
+hardaker 21 May 99 11:10:44
+ - (mib2c.conf, mib2c.storage.conf):
+ - convert to size_t storages.
+ - misc eval fixes.
+ - more cleanup of the storage def.
+
+mslifcak 21 May 99 15:29:46
+ - library changes to build on Win32.
+
+mslifcak 24 May 99 05:36:13
+ -configure - save one which looks for netdb/socket headers
+
+hardaker 26 May 99 11:19:03
+ - (ipfwacc.h): properly locate the mib.
+
+hardaker 26 May 99 15:14:55
+ - (hr_swinst.c): make software application type unknown instead of app.
+
+hardaker 26 May 99 15:18:04
+ - (IPFWACC-MIB.txt): change to counters.
+
+hardaker 26 May 99 15:20:32
+ - (ipfwacc.h): make into counters.
+
+hardaker 26 May 99 15:56:03
+ - (acconfig.h, config.h.in): increase MAXREADCOUNT.
+
+hardaker 26 May 99 17:40:28
+ - (IPFWACC-MIB.txt): added SEQUENCE OF.
+
+mslifcak 27 May 99 05:16:25
+ -(encode_keychange, read_config, snmpusm) aCC fixes by PKY (Markku Laukkanen)
+
+hardaker 27 May 99 14:30:03
+ - (snmptrapd_handlers.c): implement the default trap handler.
+
+hardaker 27 May 99 14:30:15
+ - (snmptrapd.c): need an init_mib().
+
+hardaker 27 May 99 14:37:06
+ - (snmptrapd.conf.5.def): document default oid keyword.
+
+hardaker 27 May 99 14:37:32
+ - (snmptrapd.c): document default oid keyword in help line.
+
+daves 28 May 99 07:02:01
+ - (agent/Makefile.in agent/mibgroup/Makefile.in): fix problem with null macro
+
+daves 28 May 99 08:14:05
+ - (snmplib/snmp_api.c): save local socket address in internal session structure
+
+daves 28 May 99 08:57:19
+ - (snmplib/snmp_api.c): Unix domain (datagram) socket support
+
+daves 28 May 99 09:12:20
+ - (snmplib/snmp_api.c): Separate out copying a session and opening a new one
+
+mslifcak 28 May 99 09:24:56
+ -(snmp_api.c) -catch one more error close from snmp_sess_copy
+
+hardaker 28 May 99 16:17:13
+ - (mib.c, parse.c, parse.h): save and use index clauses.
+
+hardaker 28 May 99 16:44:42
+ - (Makefile.in, default_store.c, default_store.h):
+ - created generic default value storage space and parsers to reduce
+ the number of functions/etc created for values which configure the
+ library.
+
+daves 1 Jun 99 02:17:27
+ - (snmplib/snmp_api.c): Garbage collection for Traditional SAPI sessions
+
+daves 1 Jun 99 02:32:13
+ - (snmplib/snmp_api.c): Generalise handling of addresses (w.r.t sento/recvfrom)
+
+daves 1 Jun 99 07:30:42
+ - (snmplib/snmp_api.c snmplib/snmp_api.h): Support for stream-based sockets
+
+hardaker 1 Jun 99 17:21:53
+ - (Makefile.in, snmp_alarm.c, snmp_alarm.h, snmp_api.c):
+ - implemented a generic alarm handler to register alarm functions to
+ be called back after X period of time and it handles figuring out
+ which is next and calling alarm() and signal() appropriately.
+
+mslifcak 4 Jun 99 09:51:13
+ -(hr_filesys.c,interfaces.c,tcp.c,udp.c,freebsd3.h) fix FreeBSD3.1 incl Ken Key's tcp/udp patches
+
+mslifcak 7 Jun 99 07:44:06
+ -(interfaces.c, tcp.c, udp.c, ip.c) clone fixes from 3.6 line (FreeBSD3.1)
+
+mslifcak 7 Jun 99 13:04:21
+ -(if.c) check for valid pointer before de-referencing.
+
+mslifcak 8 Jun 99 07:43:10
+ -(hr_filesys.c) fix memory leak when HAVE_GETFSSTAT is defined.
+
+daves 8 Jun 99 08:43:59
+ - (agent/mibgroup/v2party/alarm.c
+ snmplib/snmp_api.c snmplib/snmp_api.h
+ snmplib/snmp_auth.c snmplib/snmp_impl.h):
+ - removed all uses of 'struct packet_info' (subsumed into 'struct snmp_pdu')
+
+mslifcak 8 Jun 99 09:32:48
+ -(xx__freebsd2.c) - fix size_t to build on FreeBSD 2.2.x
+
+daves 9 Jun 99 06:32:02
+ - (snmp_api.h): reorder PDU and session fields more clearly
+
+hardaker 9 Jun 99 18:31:42
+ - (*): merged 3.6.2 changes into main branch.
+
+daves 15 Jun 99 03:59:23
+ - (snmp_agent.c): Removed duplicate code
+
+daves 15 Jun 99 08:28:00
+ - (snmp_agent.c snmp_agent.h):
+ - Move processing from 'handle_next_pass()' to 'handle_snmp_packet()'
+
+hardaker 15 Jun 99 16:25:57
+ - (snmp_api.c): fix allowed zerolength pdu->securityName problem for
+ v3 engineID discovery probes.
+
+daves 16 Jun 99 05:11:48
+ - (snmp.h snmp_api.c): move PDU validation, etc from 'send' to 'build' routines
+
+daves 16 Jun 99 05:49:38
+ - (snmp_api.c): handle responses in a more protocol-independent manner
+
+daves 16 Jun 99 06:56:14
+ - (snmp_api.c snmp_api.h): Hooks for building/parsing non-SNMP packets
+
+hardaker 16 Jun 99 16:24:58
+ - (default_store.c, default_store.h, mib.c, parse.c):
+ - first usage of the default_store() routines: move all the mib
+ parser variables to it, and add snmp.conf tokens for them.
+ - premib auto-registration of default_store needs cleaning up... sigh...
+
+hardaker 16 Jun 99 16:51:11
+ - (snmp_api.c, snmp_debug.c, snmp_debug.h):
+ - 2 new snmp.conf tokens: doDebugging, debugTokens.
+
+hardaker 17 Jun 99 07:39:01
+ - (configure, configure.in): fix --help.
+
+mslifcak 17 Jun 99 13:18:35
+ fixups to build most apps under Win32 (MSVC++ 5.0 or later)
+
+mslifcak 18 Jun 99 05:01:54
+ applied fixes from M. Laukkanen
+
+daves 18 Jun 99 06:58:53
+ - (sysORTable.c sysORTable.h): new routine for removing sysORTable entries
+
+daves 18 Jun 99 07:56:46
+ - (snmp.h snmp_api.c): distinguish between SNMP protocol & PDU handling flags
+
+daves 18 Jun 99 08:00:34
+ - (snmp_client.c): Enable access to "empty" response PDUs (i.e. header only).
+ (also make 'snmp_clone_mem' accessible to other files)
+
+daves 18 Jun 99 08:04:22
+ - (asn1.h snmp_api.c): New private types for OID ranges
+
+daves 18 Jun 99 08:44:11
+ - (snmp_api.h): New socket address structure
+
+daves 18 Jun 99 08:47:38
+ - (snmp_api.c): protocol-independent non-response handling in 'snmp_sess_read'
+
+daves 18 Jun 99 08:49:52
+ - (snmp_api.c):
+ - accomodate servers that require an accessible client-end unix stream socket
+ (in particular, the CMU AgentX master agent)
+
+daves 18 Jun 99 08:55:32
+ - (snmp_api.h Makefile.in agentx.c agentx.h agentx_client.c):
+ - basic AgentX protocol handling
+
+daves 18 Jun 99 09:00:16
+ - (snmp_vars.c): protocol-independent means of bypassing VACM checks
+
+daves 18 Jun 99 09:14:58
+ - (snmpd.c snmpd.h snmp_vars.c snmp_agent.c snmp_agent.h
+ mibgroup/mibII/sysORTable.c):
+ - initial AgentX sub-agent implementation
+
+mslifcak 18 Jun 99 10:02:03
+ -(sysORTable.c) fix ptr test
+
+mslifcak 22 Jun 99 05:21:03
+ invoke snmp_sess_init before any MIB processing (fixes master agent).
+
+nba 22 Jun 99 05:25:13
+ TODO: need for Counter64 support in snmpdelta
+
+daves 28 Jun 99 03:08:42
+ - (snmp_agent.c snmp_agent.h): make SNMP packet handling routine re-entrant.
+
+daves 28 Jun 99 04:07:36
+ - {Makefile.in agent_read_config.c snmp_vars.c agent_registry.c):
+ - Consolidate all registry handling into one file
+
+daves 28 Jun 99 09:52:08
+ - (agent_registry.c snmp_vars.c snmp_vars.h var_struct.h):
+ - Non-recursive MIB registry implementation
+
+hardaker 28 Jun 99 14:59:41
+ - (snmpd.c): init_snmp_alarm().
+
+hardaker 28 Jun 99 15:01:14
+ - (snmptrapd.c): init_snmp_alarm();
+
+daves 30 Jun 99 01:37:11
+ - (sysORTable.c sysORTable.h): Indicate success/failure of {un}registration
+
+daves 30 Jun 99 01:45:26
+ - (agent_registry.c snmp_vars.h): Indicate success/failure of {un}registration
+
+daves 30 Jun 99 01:48:34
+ - (snmp_agent.c snmp_agent.h): 'agent_snmp_session' initialisation routine
+
+daves 30 Jun 99 02:32:03
+ - (snmp_api.c): Correct the setup of stream-based accepted internal sessions
+
+daves 30 Jun 99 03:20:46
+ - (agent_read_config.h): omit redundant declarations
+
+daves 30 Jun 99 05:05:44
+ - (snmp_api.c): Provide the correct size of socket addresses
+
+daves 30 Jun 99 05:06:52
+ - (config.h.in configure.in configure): check for sys/un.h
+
+daves 30 Jun 99 05:48:40
+ - (snmp_api.c): Missed one 'sendto' call
+
+hardaker 30 Jun 99 19:37:36
+ - (default_store.c, default_store.h, mib.c, mib.h, snmp_api.c,
+ snmpv3.c, snmpv3.h):
+ - convert more stuff to the default_store space.
+
+daves 2 Jul 99 02:39:41
+ - (snmp_api.c): Fix that last 'sendto' case *correctly* this time
+
+daves 2 Jul 99 05:13:42
+ - (snmplib/asn1.h agent/snmp_vars.h agent/snmp_agent.c):
+ - implement an interface for delegating requests to subagents
+
+daves 2 Jul 99 05:15:56
+ - (var_struct.h agent_registry.c):
+ - map between MIB registrations and the supporting (subagent) session
+
+daves 2 Jul 99 05:16:41
+ - (snmp_api.h): support lists of sessions (and subsessions)
+
+hardaker 2 Jul 99 08:27:30
+ - (snmptranslate.c): register debugging tokens with -D
+
+daves 6 Jul 99 02:20:57
+ - (snmp_agent.c): Fix handling of SNMPv1 noSuchName
+
+daves 7 Jul 99 06:54:53
+ - (asn1.c asn1.h snmp.c snmp.h snmp_api.c snmp_api.h
+ snmp_auth.c snmp_impl.h agentx.c):
+ - First attempt at formatted display of packet data
+
+daves 8 Jul 99 02:16:15
+ - (snmp_api.c): Retain community string in responses
+
+daves 8 Jul 99 06:25:07
+ - (mibII/system_mib.c mibII/snmp_mib.c):
+ - Update 'write' routines for V4 architecture,
+ and using the full SET multi-pass algorithm
+
+hardaker 8 Jul 99 14:29:35
+ - (config.h): comment change for internal md5.
+
+hardaker 8 Jul 99 14:30:47
+ - (asn1.c): -Wall fixes.
+
+hardaker 8 Jul 99 14:36:52
+ - (configure, configure.in, Makefile.in, snmp2p.c, snmp_agent.c,
+ snmp_vars.c, snmpd.c, view_parse.c, vacm_vars.c, snmp_parse_args.c,
+ snmptrapd.c, snmptrapd_handlers.c, main.c, Makefile.in, acl.c,
+ acl.h, acl_parse.c, context.c, context.h, context_parse.c,
+ libsnmp.h, party.c, party.h, party_parse.c, snmp.h, snmp_api.c,
+ snmp_auth.c, snmp_client.c, view.c, view.h):
+ - v2party support is finally gone!
+
+hardaker 8 Jul 99 14:49:08
+ - (*/Makefile.in): make depend
+
+hardaker 8 Jul 99 15:16:35
+ - (snmpdelta.c, int64.c, int64.h): minimal c64 support for snmpdelta. Untested.
+
+hardaker 8 Jul 99 16:02:58
+ - (snmpd.c): Patch from Ragnar Kjॆआà¤rstad:
+ - Add options for switching to a given uid and gid.
+
+daves 9 Jul 99 01:49:49
+ - (snmpd.c): Clean up gid/uid change logging
+
+daves 9 Jul 99 08:27:39
+ - (*/Makefile.in snmplib/snmp_api.c
+ agent/agent_registry.c agent/snmp_agent.[ch] agent/snmp_vars.[ch]
+ agent/snmpd.[ch] agent/mibgroup/mibII/sysORTable.c):
+ - Move AgentX handling out of the main SNMP library
+
+mslifcak 9 Jul 99 12:12:50
+ -(snmp_client.*) remove snmp_synch_setup, snmp_synch_reset
+
+mslifcak 9 Jul 99 14:20:23
+ -(win32,snmplib,apps,agent) add snmp_socket_length to hide sockaddr_un; Win32 touchups
+
+mslifcak 11 Jul 99 18:36:24
+ Reduce use of snmp_errno - fix memory leak, unused vars, and unset var.
+
+daves 12 Jul 99 07:14:36
+ - (agent/mibgroup/Makefile.in): remove dependency on snmplib/agentx.h
+
+daves 12 Jul 99 08:32:27
+ - (mibgroup/host/*): Dynamically register all Host Resource modules
+
+mslifcak 14 Jul 99 13:14:30
+ -(snmp_api.c) - snmp_add_var returns SNMPERR; MAY set snmp_errno
+
+mslifcak 14 Jul 99 13:46:53
+ -(snmplib/mib.c) - conditionally allow for not setting snmp_errno
+
+hardaker 15 Jul 99 08:46:00
+ - (asn1.c, snmp_api.c, snmp_auth.c, snmp_debug.c, snmp_debug.h):
+ - beginning of a -Ddump version of packet dumping.
+ - needs a lot more work and clean up.
+ - I need comments... Tell me what you think...
+
+hardaker 20 Jul 99 14:02:26
+ - (auto_nlist.c, history.c, kernel.c, snmp_agent.c, snmpd.c,
+ dlmod_mib.c, kernel_sunos5.c, mibincl.h, util_funcs.c, ipfwchains.c,
+ at.c, interfaces.c, ip.c, route_write.c, system_mib.c, tcp.c, udp.c,
+ vacm_vars.c, var_route.c, dlmod.c, smux.c, disk.c, extensible.c,
+ loadave.c, memory_solaris2.c, pass.c, pass_persist.c, proc.c,
+ versioninfo.c, alarm.c, event.c, Makefile.in, parse.c, snmp.c,
+ snmp_debug.c, snmp_logging.c, snmp_logging.h): Patch from Ragnar
+ Kjॆआà¤rstad:
+ - do file, stderr, and syslog support.
+
+hardaker 20 Jul 99 17:06:53
+ - (auto_nlist.c, snmp_agent.c, snmpd.c, dlmod_mib.c, kernel_sunos5.c,
+ ipfwchains.c, interfaces.c, dlmod.c, smux.c, versioninfo.c,
+ alarm.c):
+ - convert snmp_log(LOG_DEBUG) to DEBUGMSGTL().
+
+mslifcak 20 Jul 99 18:11:50
+ -minor changes to build Win32 platforms using CygWin-egcs and MSVC compilers.
+
+mslifcak 20 Jul 99 19:33:26
+ - no printf in ascii_to_binary
+
+hardaker 21 Jul 99 16:06:52
+ - (tkmib, mib2c): udpate to use indexes (requires a perl patch.
+
+hardaker 23 Jul 99 10:36:54
+ - (snmp_parse_args.c): log to stderr.
+
+hardaker 23 Jul 99 10:44:17
+ - (aclocal.m4, config.h.in, configure, configure.in, snmp_agent.c,
+ snmp_vars.c, snmpd.c, kernel_sunos5.c, util_funcs.c, interfaces.c,
+ interfaces.h, system_mib.c, var_route.c, snmpEngine.c,
+ snmpTargetParamsEntry.c, snmptrapd.c, HOST-RESOURCES-MIB.txt,
+ IANAifType-MIB.txt, IF-MIB.txt, IP-MIB.txt, TCP-MIB.txt,
+ UDP-MIB.txt, parse.c, snmp_alarm.c, snmp_logging.c, snmp_logging.h):
+ - merge from V3-line post 3.6.2 to current.
+ - misc bug fixes.
+ - make apps turn on stderr logging by default.
+
+hardaker 23 Jul 99 13:18:23
+ - (snmpd.c): more snmp_log conversions.
+
+hardaker 23 Jul 99 13:18:44
+ - (util_funcs.c): change malloc size().
+
+hardaker 23 Jul 99 13:19:20
+ - (asn1.c): null terminate parsed strings, just in case.
+
+hardaker 23 Jul 99 13:20:02
+ - (snmp.c): xdump fixes.
+
+hardaker 23 Jul 99 13:20:33
+ - (keytools.c, parse.c, read_config.c, snmp_api.c): snmp_log conversions.
+
+hardaker 23 Jul 99 14:19:39
+ - (asn1.c, asn1.h, snmp.c, snmp_api.c, snmp_auth.c, snmp_impl.h):
+ - revert to non-dparse versions of asn decoding.
+
+hardaker 23 Jul 99 14:26:57
+ - (snmpd.c): init debugging.
+
+hardaker 23 Jul 99 15:22:02
+ - (snmpbulkwalk.c, snmpdelta.c, snmpget.c, snmpgetnext.c, snmpset.c,
+ snmpstatus.c, snmptable.c, snmptest.c, snmptranslate.c, snmptrap.c,
+ snmptrapd.c, snmpusm.c, snmpwalk.c, snmp_api.c, snmp_api.h,
+ snmp_client.c):
+ - make and use snmp_sess_perror(str, sess) for error printing.
+
+mslifcak 24 Jul 99 07:11:30
+ -(asn1.c) - fix compare error at line 386; remove unused vars elsewhere
+
+mslifcak 24 Jul 99 07:18:13
+ -(libsnmp.def) - add decls for new error logging functions.
+
+mslifcak 24 Jul 99 07:45:59
+ -(snmp_client.c) - use SET_SNMP_ERROR for restored snmp_errno sets.
+
+mslifcak 24 Jul 99 08:11:05
+ -(md5.c) - wrap unused MD5print with SNMP_TESTING_CODE ifdef
+
+hardaker 26 Jul 99 07:37:09
+ - (SNMPv2-CONF.txt): removed bogus IMPORTS clause
+
+hardaker 26 Jul 99 09:04:09
+ - (*/Makefile.in): make depend
+
+hardaker 26 Jul 99 09:14:24
+ - (NEWS): updated a bit
+
+hardaker 26 Jul 99 11:51:22
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre4 )
+
+hardaker 26 Jul 99 14:32:17
+ - (mib.c): BIT_string: -> BITS:
+
+mslifcak 26 Jul 99 15:12:45
+ -(asn1.c,asn1.h,snmp.c,snmp_api.c,snmp_auth.c,snmpusm.c) more detailed parse error messages.
+
+hardaker 26 Jul 99 15:59:10
+ - (agent/mibgroup/Makefile.in): fix make depend.
+
+hardaker 26 Jul 99 17:06:03
+ - (interfaces.c): Patch from Markku Laukkanen:
+ - variable naming change.
+
+hardaker 26 Jul 99 17:06:47
+ - (hpux.h): Patch from Markku Laukkanen:
+ - define hpux
+
+hardaker 26 Jul 99 17:07:31
+ - (keytools.c, keytools.h, parse.c, scapi.c): Patch from Markku Laukkanen:
+ - size_t changes.
+
+mslifcak 27 Jul 99 04:24:08
+ add include net/if_dl.h suggested by Tom Ivar Helbekkmo
+
+daves 27 Jul 99 06:38:09
+ - (agent/mibgroup/ucd-snmp/*.c): tweak registry labels
+
+mslifcak 27 Jul 99 07:52:37
+ -(agent/kernel.c,agent/dlmods/dlmod_mib.c,agent/dlmods/example.c,
+ agent/mibgroup/kernel_sunos5.c,agent/mibgroup/util_funcs.c,
+ agent/mibgroup/agentx/master_request.c,
+ agent/mibgroup/agentx/protocol.c,agent/mibgroup/dummy/dummy.c,
+ agent/mibgroup/examples/example.c,
+ agent/mibgroup/examples/ucdDemoPublic.c,
+ agent/mibgroup/examples/wombat.c,
+ agent/mibgroup/host/hr_device.c,agent/mibgroup/host/hr_disk.c,
+ agent/mibgroup/host/hr_filesys.c,
+ agent/mibgroup/host/hr_network.c,
+ agent/mibgroup/host/hr_partition.c,
+ agent/mibgroup/host/hr_print.c,agent/mibgroup/host/hr_proc.c,
+ agent/mibgroup/host/hr_storage.c,
+ agent/mibgroup/host/hr_swinst.c,agent/mibgroup/host/hr_swrun.c,
+ agent/mibgroup/host/hr_system.c,
+ agent/mibgroup/ipfwchains/ipfwchains.c,
+ agent/mibgroup/mibII/at.c,agent/mibgroup/mibII/icmp.c,
+ agent/mibgroup/mibII/interfaces.c,agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/route_write.c,
+ agent/mibgroup/mibII/snmp_mib.c,
+ agent/mibgroup/mibII/sysORTable.c,
+ agent/mibgroup/mibII/system_mib.c,agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c,agent/mibgroup/mibII/var_route.c,
+ agent/mibgroup/misc/dlmod.c,agent/mibgroup/snmpv3/snmpEngine.c,
+ agent/mibgroup/snmpv3/usmUser.c,
+ agent/mibgroup/target/snmpTargetAddrEntry.c,
+ agent/mibgroup/target/snmpTargetParamsEntry.c,
+ agent/mibgroup/ucd-snmp/file.c,
+ agent/mibgroup/ucd-snmp/registry.c,
+ agent/mibgroup/v2party/acl_vars.c,
+ agent/mibgroup/v2party/alarm.c,
+ agent/mibgroup/v2party/context_vars.c,
+ agent/mibgroup/v2party/event.c,
+ agent/mibgroup/v2party/party_vars.c,
+ agent/mibgroup/v2party/view_vars.c,apps/encode_keychange.c,
+ snmplib/asn1.c,snmplib/scapi.c,snmplib/snmp_client.c,
+ snmplib/snmp_client.h) ERROR_MSG, printf --> DEBUGMSGTL
+
+mslifcak 27 Jul 99 09:33:43
+ -(agent/kernel.c,agent/snmpd.c,agent/mibgroup/util_funcs.c,
+ agent/mibgroup/agentx/master.c,
+ agent/mibgroup/agentx/subagent.c,
+ agent/mibgroup/host/hr_swrun.c,agent/mibgroup/mibII/at.c,
+ agent/mibgroup/mibII/icmp.c,agent/mibgroup/mibII/ip.c,
+ agent/mibgroup/mibII/route_write.c,agent/mibgroup/mibII/tcp.c,
+ agent/mibgroup/mibII/udp.c,agent/mibgroup/ucd-snmp/disk.c,
+ agent/mibgroup/ucd-snmp/errormib.c,
+ agent/mibgroup/ucd-snmp/proc.c,
+ agent/mibgroup/ucd-snmp/vmstat.c,
+ agent/mibgroup/v2party/alarm.c,agent/mibgroup/v2party/event.c,
+ apps/snmpbulkwalk.c,apps/snmpdelta.c,apps/snmpget.c,
+ apps/snmpgetnext.c,apps/snmpset.c,apps/snmpstatus.c,
+ apps/snmptable.c,apps/snmptest.c,apps/snmptrap.c,
+ apps/snmptrapd.c,apps/snmpusm.c,apps/snmpwalk.c,
+ apps/snmpnetstat/inet.c,apps/snmpnetstat/main.c,
+ apps/snmpnetstat/route.c,snmplib/parse.c,snmplib/read_config.c,
+ snmplib/snmpv3.c) fix snmp_sess_perror use; use log_perror for perror
+
+mslifcak 27 Jul 99 12:00:37
+ -(encode_keychange.dsp,snmpusm.dsp) -build using common Win32 compiler
+
+mslifcak 27 Jul 99 12:24:03
+ -(apps:encode_keychange.c,snmpdelta.c,snmptable.c, snmpusm.c;
+ snmplib:read_config.c,snmpv3.c; win32/libsnmp_dll/libsnmp.def) -
+ adjust headers, build Win32 snmpusm+encode_keychange
+
+mslifcak 27 Jul 99 16:06:35
+ -(interfaces.c) - fix error setting if_ibytes for Linux 2.0
+
+hardaker 27 Jul 99 16:14:28
+ - (asn1.c, mib.c, mib.h, snmp_api.c, snmp_debug.c, snmp_debug.h, snmpusm.c):
+ - cleaned up debugging dump output.
+ - added more dump parse headers for v3 dumps.
+
+hardaker 27 Jul 99 16:20:46
+ - (asn1.c): fix header dump.
+
+mslifcak 27 Jul 99 17:15:01
+ including mib.h requires stdio.h to define FILE *.
+
+mslifcak 27 Jul 99 19:02:31
+ -(snmp_parse_args) in snmp_parse_oid, try get_node if read_objid fails.
+
+mslifcak 27 Jul 99 19:06:08
+ -(mib.c) fix walking OID length pointer, numeric sub-id not found
+ in read_objid and parse_subtree.
+
+mslifcak 27 Jul 99 23:34:59
+ -(snmpd.c) invoke log functions from child (correct process ID in syslog)
+
+mslifcak 27 Jul 99 23:58:51
+ -(keytools.c,md5.c,md5.h,scapi.c,snmp.c,snmp_api.c,snmp_auth.c) catch MD5 errors
+
+mslifcak 28 Jul 99 02:42:32
+ hr_swrun - reset pointer in module init (help HP/UX 9)
+ snmp_logging - use vsprintf for HP/UX-9
+
+hardaker 28 Jul 99 06:45:19
+ - (bug-report): change mail addr to ucd-snmp-bugs
+
+daves 29 Jul 99 03:29:40
+ - (mibII/vacm_vars.c): Catch use of unconfigured EXAMPLE.conf files
+
+mslifcak 29 Jul 99 08:34:59
+ memory_solaris2 : handle malloc errors
+ kernel_sunos5 : share kstat fildes [SHARE_KSTAT_FD]
+
+mslifcak 29 Jul 99 13:28:36
+ -(apps/Makefile.in) - comment unneeded TRAPSPECIAL line
+
+mslifcak 29 Jul 99 13:59:02
+ -(agent/snmpd.c) - log standard error until init is completed.
+
+mslifcak 29 Jul 99 15:04:49
+ auto_nlist, kernel : place log_perror to catch errno value in report.
+
+hardaker 29 Jul 99 17:03:25
+ - (configure, configure.in, Makefile.in): remove trap_special stuff.
+
+hardaker 29 Jul 99 17:06:56
+ - (mibgroup/v2party): removed files.
+
+mslifcak 30 Jul 99 03:51:31
+ Removed duplicate HAVE_GET???BYNAME; Removed unused _CRTIMP
+
+mslifcak 30 Jul 99 03:57:23
+ Removed hint of v2party from comment.
+
+mslifcak 30 Jul 99 04:00:28
+ -(agent/agent_read_config.c,agent/history.c,agent/snmp_vars.c,
+ agent/snmpd.c,snmplib/read_config.c,snmplib/snmp_alarm.c,
+ snmplib/snmp_api.c,snmplib/snmp_logging.c,snmplib/snmpv3.c,
+ snmplib/system.c) - psos diffs offered by Anthony Symons
+
+mslifcak 30 Jul 99 04:37:20
+ rename local var 'last' to 'last_ipch' - avoid shadow global decl
+
+mslifcak 30 Jul 99 04:39:38
+ decl log_perror
+
+mslifcak 30 Jul 99 04:42:48
+ rename sd to ifsd - avoid global shadow decl
+
+mslifcak 30 Jul 99 05:42:34
+ hr_storage.c - auto_nlist for HR_STORE_SIZE
+ hr_swrun.c - fix global shadow decl
+ snmp_logging.c - change filter for openlog per A. Symons patch
+
+daves 30 Jul 99 06:01:08
+ - (agent/agent_registry.c agent/snmp_vars.c agent/snmpd.c
+ apps/snmp_parse_args.c apps/snmptest.c apps/snmptrap.c
+ apps/snmptrapd.c apps/snmpnetstat/main.c snmplib/snmp_api.c
+ snmplib/snmp_api.h snmplib/snmp_client.c
+ agent/mibgroup/v2party.c agent/mibgroup/v2party.h):
+ - Removed last traces of v2p support
+
+daves 30 Jul 99 06:23:06
+ - (agent_read_config.c agent_registry.c snmp_vars.c snmp_vars_m2m.h):
+ - Removed last traces of obsolete v2party Manager-to-Manager support
+
+mslifcak 30 Jul 99 06:30:30
+ system - use sizeof
+
+mslifcak 30 Jul 99 06:30:59
+ win32/config.h - define HAVE_GETHOSTNAME
+
+mslifcak 30 Jul 99 06:46:22
+ use traditional K&R commenting; not all "C" compilers accept "//" comments.
+
+mslifcak 30 Jul 99 06:58:08
+ remove references to non-existent snmp_vars_m2m.h
+
+daves 30 Jul 99 07:01:46
+ - (configure.in configure): Check for libdb/libdb1 & librpm separately
+
+daves 30 Jul 99 07:31:56
+ - (acconfig.h): Check for libdb/libdb1 & librpm separately
+
+mslifcak 30 Jul 99 08:01:18
+ add vsnprintf check and HAVE_VSNPRINTF constant
+
+mslifcak 30 Jul 99 08:32:28
+ no struct sockaddr_dl in AIX 3.
+
+hardaker 30 Jul 99 14:10:05
+ - (config.h.in): autoheader run.
+
+hardaker 30 Jul 99 14:10:30
+ - (Makefile.in): make /var/ucd-snmp exist. We should do a permission
+ set as well.
+
+hardaker 30 Jul 99 14:18:55
+ - (*/Makefile.in): make depend
+
+hardaker 30 Jul 99 14:19:21
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre5 )
+
+mslifcak 2 Aug 99 04:29:35
+ asn1, parse) fixes supplied by Markku Laukkanen (MJS-use xcalloc in parse)
+
+mslifcak 2 Aug 99 04:37:46
+ parse - shame on me for not compile testing first!
+
+mslifcak 2 Aug 99 22:29:37
+ snmp_debug - DEBUGMSG macros call snmp_get_do_debugging before invoking debugmsg* functions.
+
+mslifcak 3 Aug 99 04:46:41
+ snmp_api.c - remove "BY" from HAVE_GETHOSTBYNAME (Solaris 2.5.1 wrong!)
+
+mslifcak 3 Aug 99 06:59:50
+ asn1.c - fix out-of-bound array write and memory leak in parsing strings.
+
+mslifcak 3 Aug 99 07:00:16
+ snmp_debug.c - remove trace messages from debugmsg_hextli.
+
+mslifcak 3 Aug 99 07:03:14
+ snmp_debug.h - move DEBUGTRACE from debugmsg_hextli to DEBUGDUMPSETUP
+
+mslifcak 3 Aug 99 07:58:49
+ vacm_vars.c - copy community string, null terminate, then debug print
+
+mslifcak 3 Aug 99 12:53:32
+ snmp_debug.h - fix "warning: ANSI C forbids conditional expr with only one void side".
+
+mslifcak 3 Aug 99 14:06:33
+ snmp_debug.c - signed comparison for len in debugmsg_hextli.
+
+mslifcak 4 Aug 99 03:48:02
+ -(smux.c) - patch supplied by Nick Amato to fix ASN_IPADDRESS parse.
+
+mslifcak 4 Aug 99 05:03:11
+ undo patch around Solaris' configure failure to register HAVE_GETHOSTBYNAME.
+
+mslifcak 4 Aug 99 09:17:18
+ -(configure*) - Ken Hornstein: fix test xxgethostbyname, xxgetservbyname.
+
+mslifcak 4 Aug 99 12:33:56
+ snmp_api.c - dummy functions snmp_synch_{setup,reset} and snmp_get_errno.
+
+mslifcak 5 Aug 99 03:25:55
+ config.sub - patch from Markku Laukkanen to support HPUX 11
+
+mslifcak 5 Aug 99 11:11:53
+ snmp_api.3 - describe snmp_error(), replaces snmp_errno and snmp_get_errno()
+
+daves 6 Aug 99 05:59:46
+ - (acconfig.h config.h.in configure.in configure):
+ - configure-time flag to control provision of "dummy" values
+
+daves 6 Aug 99 06:02:15
+ - (mibII/*.c host/*.c): Don't provide "dummy" values (unless explicitly configured)
+
+nba 9 Aug 99 00:24:37
+ parse.c: parse agent capabilities
+
+daves 9 Aug 99 01:02:15
+ - (FAQ): Nine new questions, plus assorted tweaks for the new release.
+
+mslifcak 9 Aug 99 06:48:47
+ mib.*, parse.* - move print_oid_report and minions wholly into mib.c
+
+mslifcak 9 Aug 99 06:50:36
+ snmpdelta, translate, trapd) - list all options in usage; remove disables for print_oid_report in translate.
+
+mslifcak 9 Aug 99 06:52:47
+ snmpd.c - list all options in usage
+
+mslifcak 9 Aug 99 06:54:01
+ libsnmp.def - remove print_oid_report disable options
+
+mslifcak 9 Aug 99 09:45:15
+ -(snmp.c) fix buffer overflow in xdump, of all places (77 s/b 78; using 80)
+
+nba 9 Aug 99 10:43:28
+ (many): nuke various prototype warnings
+
+mslifcak 9 Aug 99 11:40:25
+ -(md5.c) fix read past end problem
+ -(snmp_api.c) fix losing community string problem
+
+hardaker 9 Aug 99 13:12:35
+ - (acconfig.h, config.h.in, configure, configure.in): remove /dev/random test.
+
+mslifcak 9 Aug 99 15:07:24
+ snmpusm.c - always clear field_len if ref is valid ptr;
+ snmp_api.c - don't overwrite community pointer with securityAuthProto pointer
+
+nba 10 Aug 99 04:45:17
+ configure.in config.h.in configure s/netbsd agent/mibgroup/host/hr_storage.c:
+ support for NetBSD/sparc and NetBSD 1.4
+
+nba 10 Aug 99 04:46:35
+ snmplib/mib.c: fix handling of numeric oids and reporting errors
+
+nba 10 Aug 99 04:47:22
+ agent/kernel.c: abort on kvm_open failures
+
+nba 10 Aug 99 04:48:41
+ snmpnetstat/if.c: fixes for snmpnetstat -i on virtual interfaces
+
+nba 10 Aug 99 04:50:52
+ interfaces.c var_route.c snmp_logging.c: fix compiler warnings
+
+mslifcak 10 Aug 99 09:19:10
+ read_config.c, snmp_api.c - convert fprintf(stderr to snmp_log(LOG_ERR,WARNING)
+
+mslifcak 10 Aug 99 10:04:40
+ Fix for build (no pagesize var defined for linux).
+
+hardaker 10 Aug 99 11:05:38
+ - (snmpd.c): log version number after stderr is optionally closed.
+
+hardaker 10 Aug 99 14:26:33
+ - (snmp_vars.c): protect against evil mib modules from modifying
+ memory they shouldn't be modifying yet.
+ - (ifdef'ed for speed profiling later).
+
+hardaker 10 Aug 99 15:54:33
+ - (snmp_parse_args.c): force v3 engineID setting to something bogus to
+ get around local configuration data store time synchronization conflicts.
+
+hardaker 10 Aug 99 17:23:59
+ - (snmpd.c): print -H usage to stderr.
+
+hardaker 11 Aug 99 13:04:50
+ - (acconfig.h, config.h.in, read_config.c):
+ - Make persistent cache conform to a more secure umask.
+
+nba 11 Aug 99 21:52:26
+ hr_storage.c: remove to forgotten debug lines.
+
+nba 11 Aug 99 21:53:31
+ snmpnetstat/if.c: handle non-contiguous ifTable. Also make the
+ counters unsigned.
+
+hardaker 12 Aug 99 16:16:01
+ - (snmp.conf.5.def): updated with the newer token list.
+
+hardaker 12 Aug 99 16:41:22
+ - (FAQ, snmpcmd.1, snmptrap.1): minor doc updates.
+
+hardaker 12 Aug 99 16:46:34
+ - (NEWS, README): minor updates.
+
+daves 13 Aug 99 02:47:00
+ - (examples/ucdDemoPublic.[ch]
+ ipfwchains/ipfwchains.[ch] misc/ipfwacc.[ch]
+ target/snmpTarget{Addr,Params}Entry.[ch]
+ smux/snmp_*.[ch]):
+ - Register modules dynamically at run-time
+
+hardaker 13 Aug 99 07:11:35
+ - (Makefile.in): "make test" in top level Makefile.
+
+hardaker 13 Aug 99 07:12:18
+ - (NEWS, README.snmpv3, configure, configure.in): documentation updates.
+
+hardaker 13 Aug 99 07:16:51
+ - (Makefile.in, Makefile.in, Makefile.in, Makefile.in): make depend.
+
+hardaker 13 Aug 99 09:33:40
+ - (configure, configure.in): don't use NO_DUMMY_VALUES by default.
+
+mslifcak 13 Aug 99 11:14:39
+ (host/hr_device.c,host/hr_print.c, host/hr_proc.c,host/hr_storage.c,
+ host/hr_swinst.c,host/hr_swrun.c, host/hr_system.c,mibII/at.c,
+ mibII/interfaces.c,mibII/ip.c, mibII/system_mib.c,mibII/tcp.c,
+ mibII/udp.c,mibII/var_route.c) - #if NO_DUMMY_VALUES (help out configure)
+
+hardaker 13 Aug 99 11:55:31
+ - (var_route.c): don't do caching for NO_DUMMY_VALUES.
+
+mslifcak 13 Aug 99 12:18:17
+ var_route.c - #ifdef NO_DUMMY --> #if NO_DUMMY (like the other uses).
+
+hardaker 13 Aug 99 12:49:35
+ - (configure, configure.in): properly do what --without-dummy-values
+ should do.
+
+hardaker 13 Aug 99 15:22:53
+ - (configure, configure.in): remove config_load_mib parsing.
+
+hardaker 13 Aug 99 15:35:54
+ - (Makefile.in): don't remove mib_module_loads.h.
+
+hardaker 13 Aug 99 16:05:42
+ - (remove-files): remove the ISSUES file for releases.
+
+hardaker 13 Aug 99 16:06:51
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre6 )
+
+nba 16 Aug 99 14:58:40
+ snmpnetstat/if.c: allow -i and -o outputs even with incomplete responses
+ from snmpd (such as Linux that does not return ifInNUCastPkts
+ with the new DUMMY setup)
+
+nba 16 Aug 99 14:59:29
+ snmpnetstat/main.c: enable_stderrlog() so that we get an error message
+ for bad host names.
+
+nba 18 Aug 99 02:40:48
+ agent/snmpd.c: move the termination processing from the signal handler
+ to after the main loop has terminated.
+
+nba 18 Aug 99 02:51:57
+ - snmpd.c, agent_read_config.?, versioninfo.c: move the reconfiguration
+ outside the signal handler.
+
+nba 18 Aug 99 09:26:35
+ - interfaces.?: updates for Linux to handle large counters and virtual
+ interfaces.
+
+nba 18 Aug 99 09:31:06
+ - (many): change the names of the logging functions to be snmp_*
+ default do_stderr_logging to 1.
+
+nba 19 Aug 99 02:33:56
+ - interfaces.c: remove some left over debug output
+
+nba 19 Aug 99 02:35:10
+ - snmp_logging.c, agent/various: reinstate -a and -V logging (almost).
+ timestamp file and stderr logging.
+
+nba 19 Aug 99 10:38:02
+ - snmp_api.c: correcly call pre-parse hook, also when not debugging
+ (this killed the libwrap check in snmpd)
+
+nba 19 Aug 99 10:38:48
+ - smux.c: remove some extraneous \n from snmp_log_perror calls.
+
+nba 19 Aug 99 10:40:22
+ - snmpd.c: remove some superfluous : from snmp_log_perror.
+ Log when snmpd reconfigures following a SIGHUP
+
+nba 19 Aug 99 14:09:25
+ - snmp_api.?, snmpd.c, snmptrap.c, snmptrapd.c: reinstate agent_addr in
+ the pdu structure (used for v1 traps).
+
+hardaker 19 Aug 99 16:09:54
+ - (snmpget.c, snmpgetnext.c, snmpset.c): Patch from dlengel@home.com:
+ - check argument count for minimum number.
+
+nba 20 Aug 99 03:43:37
+ - agentx/*: various prototype fixes, to keep number of warnings down
+
+hardaker 20 Aug 99 13:43:56
+ - (default_store.h, snmp_api.c, snmp_logging.c, snmp_logging.h):
+ - make logging of timestamps optional by a snmp.conf directive.
+
+hardaker 20 Aug 99 13:56:57
+ - (snmp.conf.5.def, default_store.h, snmp_logging.c):
+ - turn off time stamp logging by default. It must be explicitly
+ requested in the snmp.conf file to turn it on.
+ (the reason is that a lot of logging is incremental in nature and
+ is not line buffered before being sent to the logging routines.
+ The other solution is to have the logging routines detect when to
+ print timestamps by watching out for \n's. But, not this round.
+
+hardaker 20 Aug 99 16:39:21
+ - (snmp_api.h, snmp_api.c, snmp_auth.c, snmp_impl.h, asn1.c): 64bit cleanup.
+
+hardaker 20 Aug 99 17:08:17
+ - (NEWS): last minute changes
+
+hardaker 20 Aug 99 17:10:26
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre7 )
+
+hardaker 22 Aug 99 17:33:00
+ - (ipfchains): removed from distribution. Newer one in ftp's contrib dir.
+
+hardaker 22 Aug 99 17:54:57
+ - (configure, configure.in):
+ - --without-dummy-values is default again.
+ - cleanup of --help stuff.
+ - fix of peristent directory creation.
+
+hardaker 22 Aug 99 17:56:27
+ - (Makefile.in, Makefile.in): make depend.
+
+hardaker 22 Aug 99 17:57:27
+ - (snmp_api.h): version -> u_long.
+
+mslifcak 23 Aug 99 06:14:39
+ Remove last vestiges of config_load_mib
+
+hardaker 23 Aug 99 07:02:43
+ - (NEWS): ansi mentioned.
+
+mslifcak 23 Aug 99 09:00:59
+ Win32 build fixes
+
+nba 23 Aug 99 13:54:32
+ - agent/snmpd.c, agent/snmp_vars.c: move some -v logging to a more rational
+ place.
+
+mslifcak 23 Aug 99 14:02:51
+ Describe USE_ASN_SHORT_LEN in FAQ, and implement in _snmp_build.
+
+mslifcak 23 Aug 99 15:32:21
+ HACK! fixup short length (first put correct community string in pdu-> ).
+
+hardaker 23 Aug 99 16:14:00
+ - (T028snmpv3getfail): snmpv3 get failure test.
+
+hardaker 23 Aug 99 16:14:00
+ - (INSTALL): remove version specific information
+
+-------------------------------------------------------------------------------
+
+Changes: V3.6.1 -> V3.6.2
+
+hardaker 16 Mar 99 08:15:18
+ - (dlmod.c): removed a bogus new-line.
+
+hardaker 16 Mar 99 10:34:03
+ - (hr_swrun.c): fix file descriptor leak on freebsd.
+
+mslifcak 16 Mar 99 11:23:30
+ -(snmp_api.c) consistent error return.
+
+mslifcak 16 Mar 99 11:33:52
+ - move MATCH_FAILED/MATCH_SUCCEEDED from util_funcs.h to mibincl.h
+
+mslifcak 17 Mar 99 13:53:48
+ -(hr_swrun.c) - prevent SunOS 4.1 core (sunos4 still primitive)
+
+mslifcak 18 Mar 99 08:37:45
+ - (mibII/ip.c) fix MIB_IPCOUNTER_SYMBOL usage
+
+hardaker 19 Mar 99 09:23:38
+ - (snmpget.c, snmpwalk.c): fixed initialization and usage of "failures".
+
+hardaker 23 Mar 99 10:09:47
+ - (Makefile.in): add more targets.
+
+hardaker 23 Mar 99 10:10:11
+ - (read_config.c): make copy_word() return the next token, not the
+ next space.
+
+hardaker 23 Mar 99 10:11:03
+ - (mibdefs.h, struct.h, extensible.c, extensible.h, proc.c, proc.h,
+ snmpd.conf.5.def, UCD-SNMP-MIB.txt):
+ - per-process/exec fix scripts created.
+
+hardaker 23 Mar 99 10:23:21
+ - (versiontag): regexp fix.
+
+hardaker 28 Mar 99 16:11:32
+ - (snmpTargetAddrEntry.h, snmpTargetParamsEntry.h): relocate to
+ snmpModules.12, where they should be.
+
+hardaker 28 Mar 99 16:17:24
+ - (snmpTargetAddrEntry.c, snmpTargetParamsEntry.c):
+ - when using copy_word() don't skip spaces, since it does that.
+
+mslifcak 1 Apr 99 13:10:47
+ - (libsnmp.h) Asymptotically closer to supporting CMU constants.
+
+mslifcak 5 Apr 99 11:06:27
+ - (snmp_api.c, main.c, snmp_parse_args.c) Joe Marzot's fix to copy even an empty community name.
+
+mslifcak 5 Apr 99 14:10:14
+ - build snmpnetstat with CygWin32
+
+mslifcak 5 Apr 99 14:22:43
+ - Build with CygWin32
+
+mslifcak 5 Apr 99 15:59:20
+ - Build using CygWin32 (includes Niels B.'s snmp_vars.c patch).
+
+hardaker 6 Apr 99 09:23:16
+ - (config.guess, config.sub): new versions from autoconf 2.13.
+
+mslifcak 6 Apr 99 10:59:05
+ - (extensible.c) quell warning about comparing pointer with non-pointer.
+
+mslifcak 6 Apr 99 11:33:54
+ - another round of ANSI-fying the agent completed.
+
+hardaker 6 Apr 99 15:13:40
+ - (*): Merged the 4.0 line into the 3.6.1 line.
+
+hardaker 6 Apr 99 15:38:45
+ - (mibincl.h, ucdDemoPublic.c, vacm_vars.h, snmptrapd.c, snmp_api.c,
+ Makefile.in): final merge pieces of recent v3 line changes.
+
+mslifcak 6 Apr 99 21:24:22
+ - changes for ANSI headers; POSIX(index vs strchr); minor fixes
+
+mslifcak 6 Apr 99 22:13:59
+ - (vacm_vars.c) - set global ptrs = 0.
+
+mslifcak 6 Apr 99 22:14:43
+ - (snmp_vars.c) more v2party rework needed
+
+mslifcak 7 Apr 99 06:17:28
+ - () more ANSI header fixups; touchup for M$ Win32 build
+
+hardaker 7 Apr 99 10:42:10
+ - (config.h.in, snmp_vars.c, encode_keychange.c, snmptrapd.c,
+ Makefile.in, all_general_local.h, keytools.c, keytools.h,
+ lcd_time.c, md5.c, read_config.c, scapi.c, snmp_api.c, snmpusm.c,
+ snmpv3.c, tools.c, tools.h):
+ - misc merging, including fixes and debugging statement changes to
+ newer model.
+ - a few -Wall fixes.
+
+hardaker 7 Apr 99 10:48:07
+ - (snmp_mib.c): removed unnneeded header_snmp().
+
+hardaker 7 Apr 99 11:28:02
+ - (ucdDemoPublic.c, sysORTable.c, vacm_vars.c, smux.c, snmpEngine.c,
+ usmUser.c, snmpTargetAddrEntry.c, snmpTargetParamsEntry.c):
+ - debugging statement conversion
+
+mslifcak 7 Apr 99 12:00:20
+ - (agent/snmp2p.c agent/snmp_agent.c agent/snmp_vars.h
+ agent/view_parse.c agent/mibgroup/util_funcs.c
+ agent/mibgroup/examples/ucdDemoPublic.c
+ agent/mibgroup/host/hr_filesys.c
+ agent/mibgroup/host/hr_storage.c
+ agent/mibgroup/host/hr_swrun.c agent/mibgroup/host/hr_system.c
+ agent/mibgroup/mibII/at.c agent/mibgroup/mibII/icmp.c
+ agent/mibgroup/mibII/interfaces.c agent/mibgroup/mibII/ip.c
+ agent/mibgroup/mibII/system_mib.c agent/mibgroup/mibII/tcp.c
+ agent/mibgroup/mibII/udp.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/mibII/var_route.c agent/mibgroup/misc/ipfwacc.c
+ agent/mibgroup/snmpv3/usmUser.c
+ agent/mibgroup/ucd-snmp/extensible.c
+ agent/mibgroup/ucd-snmp/hpux.c agent/mibgroup/ucd-snmp/pass.c
+ agent/mibgroup/ucd-snmp/pass_persist.c
+ agent/mibgroup/ucd-snmp/proc.c
+ agent/mibgroup/v2party/context_vars.c
+ agent/mibgroup/v2party/party_vars.c
+ agent/mibgroup/v2party/view_vars.c apps/snmpdelta.c
+ apps/snmptest.c apps/snmptrapd.c apps/snmpnetstat/route.c
+ apps/snmpnetstat/winstub.c snmplib/acl_parse.c
+ snmplib/context.h snmplib/context_parse.c snmplib/party.h
+ snmplib/party_parse.c snmplib/read_config.c snmplib/snmp_api.c
+ snmplib/snmp_auth.c snmplib/snmp_impl.h snmplib/vacm.h
+ snmplib/view.h) fgets use sizeof mostly, oid base size is MAX_OID_LEN
+
+mslifcak 7 Apr 99 12:17:23
+ -(ipfwchains.c) remove multiple definitions of MATCH_FAILED
+
+mslifcak 7 Apr 99 15:00:39
+ -(usmUser.c,system.c) plug mem leak; (snmp_api.c) enforce array limit.
+
+hardaker 12 Apr 99 22:14:31
+ - (mibincl.h): include sys/time.h.
+
+hardaker 12 Apr 99 22:15:39
+ - (hr_utils.h): remove variable names from prototypes (was causing problems).
+
+hardaker 12 Apr 99 22:16:45
+ - (tkmib): make displayed mib node info into two columns instead of one.
+
+hardaker 12 Apr 99 22:25:09
+ - (snmp_api.c): make snmp_varlist_add_variable to possible create a
+ varlist before adding something to it.
+
+hardaker 13 Apr 99 15:19:20
+ - (configure, configure.in, Makefile.in): Patch from Daniel Hagerty:
+ - fix libwrap to only add the library to the agent.
+
+hardaker 13 Apr 99 15:20:00
+ - (system_mib.c): make sysDescr read-only.
+
+hardaker 13 Apr 99 15:32:23
+ - (pass.c): Patch from Jim Mar:
+ - add capability for binary octet strings in pass scripts.
+
+hardaker 13 Apr 99 15:36:31
+ - (SNMP-NOTIFICATION-MIB.txt, SNMP-PROXY-MIB.txt,
+ SNMP-VIEW-BASED-ACM-MIB.txt): Patch from Niels Baggesen:
+ - fix module locations for broken mibs.
+
+hardaker 13 Apr 99 15:54:48
+ - (freebsd.h, freebsd2.h): Patch from Niels Baggesen:
+ - freebsd utmp cleanups.
+
+hardaker 13 Apr 99 15:56:53
+ - (snmpd.c): Patch from Niels Baggesen:
+ - log with timestamp at shutdown.
+
+hardaker 13 Apr 99 15:57:24
+ - (vacm_vars.c): Patch from Niels Baggesen:
+ - better checking of .conf file parsing line requirements.
+
+hardaker 13 Apr 99 15:58:02
+ - (snmptranslate.c): Patch from Niels Baggesen:
+ - support -P.
+
+hardaker 13 Apr 99 15:58:27
+ - (snmp_config.5.def, snmptrap.1, snmptrapd.conf.5.def): Patch from
+ Niels Baggesen:
+ - clean up small bugs.
+
+hardaker 13 Apr 99 16:00:49
+ - (parse.c, parse.h): Patch from Niels Baggesen:
+ - nicer parser messages (include file names). Correct help for -Pc.
+ - Add FRAME-RELAY-DTE-MIB as replacement for RFC-1315
+
+hardaker 13 Apr 99 16:03:29
+ - (snmptrapd.c): Patch from Niels Baggesen:
+ - snmptrapd option to ignore auth traps, add -S option, log termination.
+
+mslifcak 14 Apr 99 15:29:58
+ - (snmptranslate.c) init_snmp takes argument; "" used.
+
+mslifcak 14 Apr 99 15:30:34
+ - (parse.c) File pointer initialized to "" before first use.
+
+hardaker 14 Apr 99 15:52:35
+ - (snmptranslate.c): init_snmp("snmpapp").
+
+mslifcak 14 Apr 99 16:31:55
+ - (snmp_agent,c, snmp_api.[ch], snmp_client.[ch]) fix variable_list with built-in storage
+
+mslifcak 14 Apr 99 16:56:37
+ - apps that use snmp_fix_pdu must clean up the response PDU !
+
+mslifcak 16 Apr 99 07:30:29
+ - (IPFWACC-MIB.txt) change module name from IPFWADM-MIB to IPFWACC-MIB.
+
+mslifcak 16 Apr 99 07:54:22
+ - (IPFWCHAINS-MIB.txt) ipfwChainTable {ipfw 1} fix
+
+mslifcak 16 Apr 99 08:33:16
+ - (mib.c) "-m" or MIBS : can specify MIB module by file name.
+
+hardaker 16 Apr 99 21:10:06
+ - (README): Added v3 team members.
+
+hardaker 16 Apr 99 21:11:48
+ - (configure.in): changed default store location to /var/ucd-snmp
+
+hardaker 16 Apr 99 21:15:14
+ - (snmp.h): SNMPADMINLENGTH definition.
+
+hardaker 16 Apr 99 21:16:16
+ - (snmp_auth.c): removed fix note.
+
+hardaker 16 Apr 99 21:27:06
+ - (NEWS): updated
+
+hardaker 16 Apr 99 21:27:41
+ - (snmptrapd.8): man patch from Niels
+
+hardaker 16 Apr 99 21:34:49
+ - (version.h bug-report sedscript.in): version tag ( 4.0.pre3 )
+
+mslifcak 18 Apr 99 06:54:26
+ - (ipfwacc.h) subdir change per Joe Pruettt : 9 -> 10
+
+hardaker 19 Apr 99 21:01:15
+ - (mib2c, mib2c.conf, mib2c.vartypes.conf):
+ - rewrote mib2c to be more dependent on .conf files. The main .conf
+ file now contains the code itself.
+ - need to write a foreach(mibnode) type parser next.
+
+hardaker 19 Apr 99 21:09:27
+ - (mibincl.h): add read_config.h.
+
+hardaker 19 Apr 99 21:12:17
+ - (read_config.c, read_config.h):
+ - created a more convenient read_config_read_data() function to
+ generically read a token into a given variable.
+ - cleaned up persistent storage parsing routines.
+ - use previously malloced space in some routines, or malloc it for
+ them if the storage area is NULL.
+
+hardaker 19 Apr 99 21:14:28
+ - (snmp_api.c): Don't snmp_set_var_objid if name is NULL in
+ snmp_varlist_add_variable().
+
+hardaker 20 Apr 99 11:28:14
+ - (mib2c, mib2c.conf, mib2c.vartypes.conf): more updates.
+
+hardaker 20 Apr 99 15:31:35
+ - (mib2c, mib2c.conf, mib2c.vartypes.conf):
+ - completely re-hacked:
+ - entire code base is now put into the .conf files rather than in
+ the mib2c program. This should entitle mib2c to be used more
+ generically, and could produce different types of code templates
+ based on the .conf file it is given. In theory, it should be
+ able to produce C code for a non-ucd-snmp agent, or even better,
+ any type of code (not just C) for something else based on mib
+ information.
+ - The down side, is that the current .conf files are now ambiguous
+ again and difficult to understand without being, well, me. The
+ up side is that I'm sure Dave Shield will go through and clean
+ it up for me like he did last time. Ha ha. I wonder if he'll
+ read this? (If so, see me first).
+
+hardaker 20 Apr 99 16:04:17
+ - (mib2c, mib2c.conf): variable name conversions:
+ - variableTypes -> variables
+ - cname -> NAME
+
+hardaker 20 Apr 99 16:10:44
+ - (mib2c, mib2c.conf): a little more clean up.
+
+hardaker 20 Apr 99 21:38:42
+ - (mib2c.conf): clean up skipif regexps a bit.
+
+hardaker 22 Apr 99 07:54:44
+ - (read_config.c, read_config.h): created *read_config_store_data();
+
+hardaker 22 Apr 99 07:56:03
+ - (mib2c, mib2c.conf): allow NoAccess to be processed, and use skipif:
+ directives where needed because of it.
+
+hardaker 22 Apr 99 10:51:30
+ - (snmp_client.c, snmp_api.c, snmp_api.h, keytools.c): Another v3 branch update.
+
+mslifcak 26 Apr 99 09:21:06
+ - (snmplib.c) - use request callback's data if request specifies a callback.
+
+nba 26 Apr 99 11:21:10
+
+ (parse.h) Silly speling misteak (ACCESS_CRAETE)
+
+nba 26 Apr 99 11:48:57
+
+
+ - snmplib/parse.h, snmplib/parse.c: new mib printer: mib_print_tree
+ inspired by a reference to snmx in comp.protocols.snmp
+ - apps/snmptranslate: let the -p option call this new printer
+ - snmplib/snmp_api.c: some left over __P macros
+
+nba 26 Apr 99 12:03:47
+
+ (if.c) make the width of snmpnet -i (and -o) adapt to the length of returned
+ strings
+
+nba 26 Apr 99 12:09:35
+
+
+ apps/*.c: use snmp_perror to report errors from read_objid and friends
+ apps/snmptrapd.c: fix a bus error when using -S and receiving an
+ enterprise specific trap.
+
+nba 26 Apr 99 12:13:50
+
+ */*: replace horrible (char *)"string" with const specifiers in relevant
+ functions.
+
+mslifcak 26 Apr 99 12:37:09
+ - (snmp_api.c) - fix other use of request's callback data
+
+mslifcak 27 Apr 99 09:51:35
+ - (interfaces.c) add if_type_from_name to convert interface name to type.
+
+hardaker 29 Apr 99 07:32:39
+ - (Makefile.in, callback.c, callback.h): callback API.
+
+hardaker 29 Apr 99 07:39:45
+ - (agent_read_config.c, snmpd.c, snmptrapd.c, snmp_api.c, snmpusm.c,
+ snmpusm.h, snmpv3.c, snmpv3.h):
+ - use the callback mechanism for post-config stuff.
+
+hardaker 3 May 99 07:07:15
+ - (agent_read_config.c, usmUser.c, usmUser.h, snmpTargetAddrEntry.c,
+ snmpTargetAddrEntry.h, snmpTargetParamsEntry.c,
+ snmpTargetParamsEntry.h, snmptrapd.c, callback.c, callback.h,
+ scapi.c, scapi.h, snmp_api.c, snmpv3.c, snmpv3.h):
+ - shutdown and store callback usage.
+
+hardaker 3 May 99 07:13:31
+ - (snmpd.c): fix -A flag, which got broken during someones changes.
+
+hardaker 3 May 99 12:58:19
+ - (Makefile.in, agent_read_config.c, Makefile.in, header_complex.c,
+ Makefile.in, encode_keychange.c, Makefile.in, Makefile.in,
+ all_general_local.h, all_system.h, keytools.c, lcd_time.c, scapi.c,
+ snmp_auth.c, snmpusm.c, tools.c, tools.h, Makefile.in, T.c,
+ etimetest.c, keymanagetest.c, misctest.c, scapitest.c):
+ - nuked all_general_local.h and all_system.h.
+ - makefileindepend as well.
+
+nba 3 May 99 15:40:11
+ (*.[ch]): patches to types to wipe warnings from compilers
+ with more strict noise levels. (also good when compiling
+ with gcc -Wall -pedantic -Wwrite-strings -Wcast-qual)
+
+nba 4 May 99 00:47:44
+ (mib.c): Fix problem (core dump) with MIBFILES environment variable.
+
+nba 4 May 99 00:51:16
+ (many): remove const spec from FindVarMethod. That was wrong
+
+hardaker 4 May 99 11:08:55
+ - (configure, configure.in): Added --enable-developer flag.
+
+mslifcak 6 May 99 09:20:30
+ - (ucd-snmp/vmstat.c) - conditionally include limits.h per Eduard Koucky.
+
+nba 10 May 99 14:47:22
+ Fixing some more prototypes. Pointed out by Markku Laukkanen.
+
+nba 10 May 99 14:49:49
+ snmplib/snmp_api.c: Mix-up of V1_IN_V2/V2_IN_V1 error code when GETBULK
+ inside V1 session.
+
+hardaker 11 May 99 14:02:48
+ - (util_funcs.c): read returns ssize_t not size_t.
+
+hardaker 11 May 99 14:03:25
+ - (memory.h): remove extern.
+
+hardaker 11 May 99 14:11:40
+ - (hpux.c, hpux.h): int -> size_t conversions.
+
+mslifcak 12 May 99 10:53:23
+ - (snmp_api.c snmp_client.c) call snmp_synch_reset from snmp_sess_close
+
+mslifcak 12 May 99 11:22:16
+ -(parse.c party_parse.c read_config.c) no exit() from library; return error
+
+daves 13 May 99 03:52:19
+ - (ip.c): Properly register IP module group on Free-BSD systems
+ (thanks to Mitchell Tasman)
+
+hardaker 13 May 99 09:09:18
+ - (vacm_vars.c): Set pointers to NULL after freeing them.
+
+mslifcak 14 May 99 06:54:51
+ - (agent/mibgroup/dummy/dummy.c agent/mibgroup/examples/example.c
+ agent/mibgroup/examples/example.h
+ agent/mibgroup/examples/wombat.c agent/mibgroup/misc/ipfwacc.c
+ agent/mibgroup/smux/smux.c
+ agent/mibgroup/snmpv3/snmpMPDStats.c
+ agent/mibgroup/snmpv3/usmStats.c
+ agent/mibgroup/snmpv3/usmUser.c snmplib/snmp_auth.c) more size_t fixes
+
+mslifcak 14 May 99 09:47:10
+ - (agent/mibgroup/examples/wombat.h agent/mibgroup/host/hr_disk.c
+ agent/mibgroup/mibII/interfaces.c
+ agent/mibgroup/mibII/var_route.c
+ agent/mibgroup/snmpv3/usmUser.c apps/encode_keychange.c
+ snmplib/parse.c) more ANSI-C touchups
+
+mslifcak 14 May 99 13:59:37
+ -(agent/mibgroup/mibII/interfaces.c snmplib/snmpusm.c) fixes to build HP & AIX
+
+daves 17 May 99 03:20:53
+ - (snmp_parse_args.c): Initialise session using library routine
+
+daves 17 May 99 04:34:55
+ - (snmplib/snmp_api.h snmplib/snmp_api.c snmplib/snmp_client.c
+ agent/snmpd.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/v2party/alarm.c agent/mibgroup/v2party/event.c
+ apps/snmpstatus.c apps/snmptest.c apps/snmptrap.c apps/snmptrapd.c):
+
+ - Use the generic socket addresses 'struct sockaddr',
+ rather than the IP-specific 'struct sockaddr_in'
+
+daves 17 May 99 04:38:00
+ - (snmplib/snmp_api.h snmplib/snmp_api.c snmplib/snmp_client.c
+ agent/snmpd.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/v2party/alarm.c agent/mibgroup/v2party/event.c
+ apps/snmpstatus.c apps/snmptest.c apps/snmptrap.c apps/snmptrapd.c):
+
+ - Use the generic socket address 'struct sockaddr',
+ rather than the IP-specific 'struct sockaddr_in'
+
+daves 17 May 99 07:18:02
+ - (snmplib/snmp_api.c snmplib/snmp_api.h agent/snmpd.c
+ apps/snmptrap.c apps/snmptrapd.c):
+
+ - Use a single address field within the PDU structure
+ (obsoleting 'agent_addr')
+
+daves 18 May 99 06:26:16
+ - (snmp_api.c snmp_api.h): More general handling of PDU flags
+
+mslifcak 18 May 99 09:01:46
+ - (xx/Makefile.in) remove references to as yet missing disman files.
+
+daves 18 May 99 09:23:50
+ - (configure.in snmplib/context_parse.c snmplib/read_config.c
+ snmplib/snmp_api.c snmplib/snmpv3.c snmplib/system.c
+ apps/snmp_parse_args.c apps/snmpbulkwalk.c apps/snmpdelta.c
+ apps/snmpget.c apps/snmpgetnext.c apps/snmpset.c
+ apps/snmpstatus.c apps/snmptable.c apps/snmptest.c
+ apps/snmptrap.c apps/snmpusm.c apps/snmpwalk.c
+ apps/snmpnetstat/if.c apps/snmpnetstat/inet.c
+ apps/snmpnetstat/main.c apps/snmpnetstat/route.c
+ apps/snmpnetstat/winstub.c):
+ - Clean up conditionals protecting include files
+ ( #if HAVE_WINSOCK_H / #else / #endif )
+
+daves 19 May 99 02:33:07
+ - (config.h.in): Additional include protection entries
+
+daves 19 May 99 05:11:37
+ - (snmp_api.c): More generalised handling of socket addresses
+
+mslifcak 19 May 99 18:02:55
+ -(mibII/var_route.c) - fix Linux RouteMask c/o "Nancy" nam@cs.cmu.edu
+
+mslifcak 19 May 99 18:50:12
+ - (host_res.h) fix HAVE_NET_IF_VAR_H define (was HAVE_NET_IN_VAR_H)
+
+daves 20 May 99 03:46:24
+ - (snmp_api.h): Temporary fix to socket address problems
+
+mslifcak 21 May 99 05:24:23
+ -(read_config.c) cast fix per Markku Laukkanen
+
+daves 21 May 99 05:54:22
+ - (snmp_api.c snmp_api.h):
+ - New API call to close down all open sessions
+ (also called on application shutdown)
+
+hardaker 21 May 99 11:10:44
+ - (mib2c.conf, mib2c.storage.conf):
+ - convert to size_t storages.
+ - misc eval fixes.
+ - more cleanup of the storage def.
+
+mslifcak 21 May 99 15:29:46
+ - library changes to build on Win32.
+
+mslifcak 24 May 99 05:36:13
+ -configure - save one which looks for netdb/socket headers
+
+hardaker 26 May 99 11:19:03
+ - (ipfwacc.h): properly locate the mib.
+
+hardaker 26 May 99 15:14:55
+ - (hr_swinst.c): make software application type unknown instead of app.
+
+hardaker 26 May 99 15:18:04
+ - (IPFWACC-MIB.txt): change to counters.
+
+hardaker 26 May 99 15:20:32
+ - (ipfwacc.h): make into counters.
+
+hardaker 26 May 99 15:56:03
+ - (acconfig.h, config.h.in): increase MAXREADCOUNT.
+
+hardaker 26 May 99 17:40:28
+ - (IPFWACC-MIB.txt): added SEQUENCE OF.
+
+mslifcak 27 May 99 05:16:25
+ -(encode_keychange, read_config, snmpusm) aCC fixes by PKY (Markku Laukkanen)
+
+hardaker 27 May 99 14:30:03
+ - (snmptrapd_handlers.c): implement the default trap handler.
+
+hardaker 27 May 99 14:30:15
+ - (snmptrapd.c): need an init_mib().
+
+hardaker 27 May 99 14:37:06
+ - (snmptrapd.conf.5.def): document default oid keyword.
+
+hardaker 27 May 99 14:37:32
+ - (snmptrapd.c): document default oid keyword in help line.
+
+daves 28 May 99 07:02:01
+ - (agent/Makefile.in agent/mibgroup/Makefile.in): fix problem with null macro
+
+daves 28 May 99 08:14:05
+ - (snmplib/snmp_api.c): save local socket address in internal session structure
+
+daves 28 May 99 08:57:19
+ - (snmplib/snmp_api.c): Unix domain (datagram) socket support
+
+daves 28 May 99 09:12:20
+ - (snmplib/snmp_api.c): Separate out copying a session and opening a new one
+
+mslifcak 28 May 99 09:24:56
+ -(snmp_api.c) -catch one more error close from snmp_sess_copy
+
+hardaker 28 May 99 16:17:13
+ - (mib.c, parse.c, parse.h): save and use index clauses.
+
+hardaker 28 May 99 16:44:42
+ - (Makefile.in, default_store.c, default_store.h):
+ - created generic default value storage space and parsers to reduce
+ the number of functions/etc created for values which configure the
+ library.
+
+daves 1 Jun 99 02:17:27
+ - (snmplib/snmp_api.c): Garbage collection for Traditional SAPI sessions
+
+daves 1 Jun 99 02:32:13
+ - (snmplib/snmp_api.c): Generalise handling of addresses (w.r.t sento/recvfrom)
+
+daves 1 Jun 99 07:30:42
+ - (snmplib/snmp_api.c snmplib/snmp_api.h): Support for stream-based sockets
+
+hardaker 1 Jun 99 17:21:53
+ - (Makefile.in, snmp_alarm.c, snmp_alarm.h, snmp_api.c):
+ - implemented a generic alarm handler to register alarm functions to
+ be called back after X period of time and it handles figuring out
+ which is next and calling alarm() and signal() appropriately.
+
+mslifcak 4 Jun 99 09:51:13
+ -(hr_filesys.c,interfaces.c,tcp.c,udp.c,freebsd3.h) fix FreeBSD3.1 incl Ken Key's tcp/udp patches
+
+mslifcak 7 Jun 99 07:44:06
+ -(interfaces.c, tcp.c, udp.c, ip.c) clone fixes from 3.6 line (FreeBSD3.1)
+
+mslifcak 7 Jun 99 13:04:21
+ -(if.c) check for valid pointer before de-referencing.
+
+mslifcak 11 May 99 14:39:58
+ - (agent/agent_read_config.c agent/snmp_vars.c agent/snmpd.c
+ agent/mibgroup/mibII/interfaces.c agent/mibgroup/mibII/ip.c
+ agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/mibII/vacm_vars.h apps/snmptranslate.c
+ apps/snmptrapd.c local/mib2c local/tkmib man/snmp_config.5.def
+ man/snmpd.1.def man/snmptrap.1 man/snmptrapd.8
+ man/snmptrapd.conf.5.def mibs/SNMP-NOTIFICATION-MIB.txt
+ mibs/SNMP-PROXY-MIB.txt mibs/SNMP-TARGET-MIB.txt
+ mibs/SNMP-USER-BASED-SM-MIB.txt
+ mibs/SNMP-VIEW-BASED-ACM-MIB.txt s/freebsd.h s/freebsd2.h
+ snmplib/mib.c snmplib/parse.c snmplib/parse.h
+ snmplib/snmp_api.c snmplib/vacm.c) - changes c/o Niels Baggesen
+
+mslifcak 11 May 99 18:58:37
+ -(cygwin.h) - use to build on CygWin platform.
+
+mslifcak 11 May 99 19:54:04
+ -(agent/snmp2p.c agent/snmp_vars.h agent/view_parse.c
+ agent/mibgroup/util_funcs.c agent/mibgroup/dummy/dummy.h
+ agent/mibgroup/examples/wombat.h
+ agent/mibgroup/host/hr_filesys.c
+ agent/mibgroup/host/hr_storage.c
+ agent/mibgroup/host/hr_swrun.c agent/mibgroup/host/hr_system.c
+ agent/mibgroup/ipfwchains/ipfwchains.c
+ agent/mibgroup/mibII/at.c agent/mibgroup/mibII/icmp.c
+ agent/mibgroup/mibII/interfaces.c
+ agent/mibgroup/mibII/system_mib.c agent/mibgroup/mibII/tcp.c
+ agent/mibgroup/mibII/udp.c agent/mibgroup/mibII/vacm_vars.c
+ agent/mibgroup/mibII/var_route.c agent/mibgroup/misc/ipfwacc.c
+ agent/mibgroup/misc/ipfwacc.h
+ agent/mibgroup/ucd-snmp/extensible.c
+ agent/mibgroup/ucd-snmp/hpux.c
+ agent/mibgroup/ucd-snmp/loadave.c
+ agent/mibgroup/ucd-snmp/pass.c
+ agent/mibgroup/ucd-snmp/pass_persist.c
+ agent/mibgroup/ucd-snmp/proc.c
+ agent/mibgroup/v2party/context_vars.c
+ agent/mibgroup/v2party/party_vars.c
+ agent/mibgroup/v2party/view_vars.c apps/snmpdelta.c
+ apps/snmptest.c apps/snmptrapd.c apps/snmpnetstat/if.c
+ apps/snmpnetstat/route.c apps/snmpnetstat/winstub.c
+ apps/snmpnetstat/winstub.h snmplib/acl_parse.c
+ snmplib/context.h snmplib/context_parse.c snmplib/party.h
+ snmplib/party_parse.c snmplib/read_config.c snmplib/snmp_api.c)
+ Port some of the fixes from the current development branch
+
+mslifcak 12 May 99 10:45:05
+ - (snmp_api.c snmp_client.c) call snmp_synch_reset from snmp_sess_close
+
+mslifcak 12 May 99 11:28:07
+ -(mib.c parse.c party_parse.c read_config.c) no exit() from library; return error
+
+daves 13 May 99 03:38:03
+
+ (mib.c): Fixed minor typo
+
+daves 13 May 99 03:55:06
+ - (ip.c): Properly register IP module group on Free-BSD systems
+ (thanks to Mitchell Tasman)
+
+hardaker 13 May 99 09:07:13
+ - (vmstat.c): include limits.h.
+
+hardaker 13 May 99 09:07:39
+ - (vacm_vars.c): Set pointers to NULL after freeing them.
+
+hardaker 13 May 99 15:42:48
+ - (version.h bug-report sedscript.in): version tag ( 3.6.2 )
+
+daves 17 May 99 03:20:10
+ - (snmp_parse_args.c): Initialise session using library routine
+
+mslifcak 19 May 99 18:01:48
+ -(mibII/var_route.c) - fix Linux RouteMask c/o "Nancy" nam@cs.cmu.edu
+
+mslifcak 19 May 99 18:49:25
+ - (host_res.h) fix HAVE_NET_IF_VAR_H define (was HAVE_NET_IN_VAR_H)
+
+hardaker 25 May 99 20:20:31
+ - (version.h bug-report sedscript.in): version tag ( 3.6.2.pre1 )
+
+nba 26 May 99 07:57:42
+
+ Tag: V3-line
+
+ if.c: dynamic width for -i and -o option
+
+mslifcak 26 May 99 08:00:07
+ - fix-ups to build Win32 MSVisualC++
+
+nba 26 May 99 08:24:35
+
+
+ Some fixes for Solaris 2.7 (proc access still does not work when compiled
+ with gcc (32-bit compiler)
+
+nba 26 May 99 08:29:26
+
+ Fixes for FreeBSD 2.1 from Derek J. Balling <dballing@yahoo-inc.com>
+
+hardaker 26 May 99 16:07:16
+ - (acconfig.h, config.h.in): increase MAXREADCOUNT.
+
+hardaker 26 May 99 16:07:42
+ - (hr_swinst.c): make swinstall be "unknown" since we can't truly know.
+
+hardaker 26 May 99 16:08:09
+ - (ipfwacc.h): move to correct location.
+
+hardaker 26 May 99 16:08:28
+ - (IPFWACC-MIB.txt): make counters.
+
+hardaker 26 May 99 17:31:25
+ - (proc.c): ultrix fixes.
+
+hardaker 26 May 99 17:38:56
+ - (IPFWACC-MIB.txt): added SEQUENCE OF.
+
+nba 27 May 99 02:56:25
+
+
+ host/hr_swrun.c, ucd-snmp/proc.c: Fixes for Solaris 2.7
+
+nba 27 May 99 02:59:16
+
+ snmpd.c: Properly handle the case of no community specified
+ for agent traps.
+
+nba 27 May 99 23:55:09
+
+ solaris2.?.h: define _SLASH_PROC_METHOD_ as 1
+
+nba 27 May 99 23:55:49
+
+ read_config.c: complain about existing but unreadable config files.
+
+nba 27 May 99 23:59:37
+
+ inet.c: 0 IS a valid short (and port address for remote ends of ports
+ in LISTEN state)
+
+nba 28 May 99 03:25:29
+
+ change the trapsink/trap2sink directives to support a community parameter.
+
+nba 29 May 99 02:49:47
+
+ - smux.c: fix a missing ntohs in a debug message
+
+nba 1 Jun 99 00:27:36
+
+ - proc.c: YAPBO (Yet another possible buffer overflow)
+
+nba 1 Jun 99 00:29:35
+
+ - snmp_agent.c: change noCreation return to noAccess. There are probably
+ situations where the former is correct, but this is less confusing
+
+nba 1 Jun 99 00:33:52
+
+ - kernel_sunos5.?, hr_swrun.c, at.c, interfaces.c: fix at.atTable and
+ ip.ipNetToMediaTable for Solaris. Also a tweak for getKstatInt.
+
+hardaker 2 Jun 99 07:27:46
+ - (version.h bug-report sedscript.in): version tag ( 3.6.2.pre2 )
+
+mslifcak 2 Jun 99 13:46:34
+ -(hr_filesys.c,interfaces.c,freebsd3.h) fix build on FreeBSD 3.1
+
+nba 3 Jun 99 14:31:18
+
+ - kernel.c: add some sanity checks when running without root access.
+
+nba 3 Jun 99 14:34:50
+
+ - hr_swrun.c: add a blank between process parameters
+
+nba 3 Jun 99 14:38:18
+
+ - netbsd.h, tcp.c, udp.c: fix socket tables for NetBSD 1.3/1.4
+
+nba 3 Jun 99 15:12:01
+
+ - snmptrap.c: fix a bad free when calling snmpinform.
+
+nba 3 Jun 99 15:21:09
+ - tcp.c: lost a ';' for the FreeBSD case ....
+
+daves 4 Jun 99 04:51:04
+ - (agent/mibgroup/host/hr_swinst.c): Fix RPM handling
+
+daves 4 Jun 99 05:06:44
+ - (configure.in configure): Additional library for RPM handling
+
+mslifcak 4 Jun 99 09:30:12
+ -(tcp.c, udp.c) apply Ken Key's fix for FreeBSD3.1
+
+nba 4 Jun 99 11:52:38
+ - ip.c: Fix for FreeBSD 3 from Ken Key
+
+nba 4 Jun 99 11:53:32
+ - kernel_sunos5.c, asn1.c: Fixes for 64-bit Solaris 7
+
+nba 5 Jun 99 05:47:20
+ - interfaces.c,tcp.c,udp.c: cleanup of conditionals for FreeBSD
+
+nba 5 Jun 99 06:02:52
+ - configure.in: proper configure check for sys/socketvar.h
+
+mslifcak 7 Jun 99 07:45:10
+ -(ip.c, var_route.c) fix sizeof, CPP #endif
+
+hardaker 7 Jun 99 10:52:32
+ - (Makefile.in): Patch from Chris Smith:
+ - don't put CFLAGS in the link line.
+
+hardaker 7 Jun 99 10:54:21
+ - (README.win32): added to the 3.6.2 line.
+
+hardaker 7 Jun 99 11:25:27
+ - (FAQ, README): update for 3.6.2.
+
+hardaker 7 Jun 99 11:27:15
+ - (NEWS): 3.6.2 update.
+
+hardaker 7 Jun 99 11:30:40
+ - (EXAMPLE.conf.def): update for 3.6.2.
+
+hardaker 7 Jun 99 11:32:54
+ - (INSTALL): update for 3.6.2.
+
+mslifcak 7 Jun 99 13:02:10
+ -(if.c) - check for valid pointer before de-referencing.
+
+hardaker 7 Jun 99 15:46:26
+ - (configure, configure.in): check for libdb1 before libdb for rpm usage.
+
+hardaker 7 Jun 99 15:50:01
+ - (FAQ): merge
+
+hardaker 7 Jun 99 16:03:25
+ - (configure.in, configure): check for -ldb1 then -ldb for rpm usage.
+
+hardaker 7 Jun 99 16:43:50
+ - (config.h.in, configure, configure.in): check for rpmGetPath to help
+ determine which version of RPM we're using (3 or 2).
+
+pjl 7 Jun 99 17:30:33
+ Added RPM v3 support
+
+mslifcak 8 Jun 99 03:40:36
+ -(mibII/*,snmplib/*) Markku L.'s fixes to compile on HP-UX with aCC
+
+mslifcak 8 Jun 99 03:54:50
+ spell check COMMUNITY
+
+-------------------------------------------------------------------------------
+
+Changes: V3.6 -> V3.6.1
+
+mslifcak 8 Mar 99 04:02:01
+ (parse.c) - fix subid init; remove useless '-Pl' option.
+
+mslifcak 8 Mar 99 04:14:41
+ - (snmp_api.c) use request data with request callback
+
+mslifcak 8 Mar 99 05:01:49
+ -(win32/config.h) remove unused SYS_TIME_NAME,GLOBALSECURITY. add new constants.
+
+mslifcak 8 Mar 99 05:07:13
+ - (AGENT) MAX_NAME_LEN --> MAX_OID_LEN in example
+
+mslifcak 8 Mar 99 09:58:17
+ - (snmplib/parse.c) Complete Dave Shields' patch for continue after error.
+
+mslifcak 8 Mar 99 14:28:20
+ - (snmpnetstat:if.c, route.c) limit interface name sizes to fit fixed length buffers.
+
+hardaker 10 Mar 99 15:07:31
+ - (EXAMPLE.conf.def): group lines were backwards.
+
+hardaker 11 Mar 99 15:48:22
+ - (README): Added Mike Baer.
+
+hardaker 11 Mar 99 15:48:52
+ - (memory_solaris2.c): changed some comments to /* */ instead of //.
+
+hardaker 11 Mar 99 16:10:31
+ - (AGENT): removed AGENT
+
+hardaker 11 Mar 99 16:10:47
+ - (mib2c): fixed a couple of bugs and ansi'ified things.
+
+hardaker 11 Mar 99 16:22:43
+ - (util_funcs.c, util_funcs.h): move MATCH_SUCCEEDED defs to .h.
+
+hardaker 11 Mar 99 16:23:44
+ - (snmp_api.h, snmp_debug.h): Patch from Erik Jacobsen:
+ - fixed prototypes for DEBUGP() and DEBUGPOID().
+
+mslifcak 12 Mar 99 07:08:40
+ - (dlmod_mib.c) : Use MATCH_FAIL/SUCCEEDED in util_funcs.h
+
+hardaker 12 Mar 99 09:15:14
+ - (mibincl.h, dummy.c, wombat.c, hr_device.c, hr_disk.c, hr_filesys.c,
+ hr_network.c, hr_partition.c, hr_print.c, hr_proc.c, hr_storage.c,
+ hr_swinst.c, hr_swrun.c, hr_system.c, icmp.c, interfaces.c, ip.c,
+ snmp_mib.c, sysORTable.c, system_mib.c, tcp.c, udp.c, dlmod.c,
+ registry.c): fixed MATCH_FAILED/SUCCEEDED defines -> util_funcs.h.
+
+mslifcak 12 Mar 99 11:31:16
+ - (dlmod_mib.c) : explicit test for MATCH_FAILED
+
+hardaker 12 Mar 99 12:20:12
+ - (mib2c): fix asn_parse functions to pass a pointer to the size variable.
+
+hardaker 12 Mar 99 14:17:08
+ - (NEWS): update.
+
+hardaker 12 Mar 99 14:17:44
+ - (smux.c): protect strcpy() against a null password specified on the
+ config line.
+
+mslifcak 12 Mar 99 14:34:12
+ - (hr_system.h) - don't require hr_util; done in mibgroup/host.h
+ - (hr_swrun.c) - solaris2 : make sure kvm_open is called before kd is used.
+ - (hr_swrun.c) - add lame sunos4 equivalent in HRSWRUNPERF_CPU.
+
+mslifcak 12 Mar 99 14:35:38
+ - (target.h, target/*.h) require util_funcs once.
+
+hardaker 12 Mar 99 14:36:39
+ - (util_funcs.h): MATCH_FAILED -> -1, since some use it.
+
+mslifcak 12 Mar 99 14:54:51
+ - restore config_require logic; fix sprintf calls to compile under SunOS 4.1.x.
+
+hardaker 12 Mar 99 15:23:18
+ - (INSTALL): don't print module list here... tell them to look at
+ configure --help.
+
+hardaker 12 Mar 99 15:24:37
+ - (configure, configure.in, IPFWCHAINS-MIB.txt, README,
+ ipfwc_kernel_headers.h, ipfwchains.c, ipfwchains.h, libipfwc.c,
+ libipfwc.h): Patch from Didier Dhaenens:
+ - new modules: ipfwchains.
+
+mslifcak 15 Mar 99 05:54:07
+ - (Makefile.in libsnmp.h mib.c snmp.h snmp_api.c) update CMU_COMPATIBLE
+
+hardaker 15 Mar 99 08:49:10
+ - (Makefile.in, snmp_api.c):
+ - revert to snmp_parse.
+ - don't install libsnmp.h.
+
+mslifcak 15 Mar 99 09:42:34
+ - second pass at CMU_COMPAT : Disable by default, leave snmp_parse alone.
+
+hardaker 15 Mar 99 14:30:45
+ - (snmp.h): remove unneeded commented out define.
+
+hardaker 15 Mar 99 14:31:23
+ - (acconfig.h): added CMU_COMPATIBLE
+
+hardaker 15 Mar 99 15:21:02
+ - (hr_proc.c, hr_proc.h, loadave.c, loadave.h): fix try_loadave for solaris.
+
+hardaker 15 Mar 99 15:31:51
+ - (configure, configure.in, interfaces.c, linux.h): detect
+ /proc/net/dev version at run time, not compile time.
+
+hardaker 15 Mar 99 15:46:12
+ - (interfaces.c): fixes for linux 2.2 interface scanning.
+
+hardaker 15 Mar 99 15:55:35
+ - (Makefile.in): makefileindepend.
+
+hardaker 15 Mar 99 15:58:07
+ - (FAQ, NEWS): updates to talk about the AGENT.txt file.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.5.3 -> V3.6
+
+hardaker 19 Jun 98 13:14:43
+ - (ChangeLog): update for 3.5.
+
+hardaker 22 Jun 98 09:16:32
+ - (main.c): Patch from Jerry G. DeLapp:
+ - commented out trailing #endif comment.
+
+hardaker 24 Jun 98 10:30:19
+ - (Makefile.in): man->html make specification.
+
+hardaker 24 Jun 98 10:31:22
+ - (Makefile.in, snmp_api.c, snmp_api.h): create snmp_pdu_add_variable().
+
+hardaker 24 Jun 98 10:56:46
+ - (snmpset.c, snmptest.c, snmptrap.c, snmp_api.c, snmp_api.h):
+ - moved hex_to_binary, ascii_to_binary, and snmp_add_var to snmplib.
+
+hardaker 24 Jun 98 11:08:41
+ - (UCD-SNMP-MIB.txt): Patch from Niels Baggesen:
+ - shutdown trap specifications.
+ - misc mib fixes.
+
+hardaker 24 Jun 98 11:40:40
+ - (snmpd.c, snmpd.h):
+ - created (poorly) send_trap_pdu() for sending v2 traps from mib modules.
+
+hardaker 26 Jun 98 10:42:32
+ - (disk.c): Patch from Michael Douglass:
+ - fix calculation of totaldisk by doing block division first to
+ protect against 32 bit overflows.
+
+hardaker 26 Jun 98 10:45:15
+ - (smux.c, snmp_bgp.c, snmp_ospf.c, snmp_rip2.c, snmp_rip2.h): Patch
+ from Niels Baggesen:
+ - Fix for new defines and proper header includes.
+
+hardaker 26 Jun 98 15:03:38
+ - (generic.h): put in a comment to keep compilers from complaining too much.
+
+hardaker 28 Jun 98 09:30:34
+ - (snmp_api.c): fix snmp_add_var().
+
+hardaker 1 Jul 98 11:28:17
+ - (configure, configure.in, Makefile.in, agent_read_config.c,
+ agent_read_config.h, snmp_vars.c, snmp_vars.h, snmpd.c, Makefile.in,
+ struct.h, pass.h, Makefile.in, snmptrapd.c, snmptrapd_handlers.c,
+ snmptrapd_handlers.h, Makefile.in, read_config.c, read_config.h,
+ snmp_api.c, snmp_api.h):
+ - moved read_config support into the library and use it.
+ - beginnings of snmptrapd extensibility.
+
+hardaker 1 Jul 98 15:56:12
+ - (snmp_api.c, snmp_api.h, system.h):
+ - added DEBUGPOID(name, namelen);
+ - moved DEBUGP definition into snmp_api.h where it belongs.
+
+hardaker 1 Jul 98 15:57:53
+ - (snmptrapd.c, snmptrapd_handlers.c):
+ - fix extensiblity checking of oids.
+ - seperate running of external command into new function.
+
+hardaker 8 Jul 98 12:26:25
+ - (freebsd2.h): use _UTMP_PATH if available.
+
+hardaker 8 Jul 98 12:26:34
+ - (irix.h): define _KMEMUSER
+
+hardaker 8 Jul 98 12:27:12
+ - (win32.opt, libsnmp.dsp, libsnmp.plg, libsnmp.def, libsnmp_dll.plg,
+ snmpbulkwalk.dsp, snmpbulkwalk.plg, snmpget.dsp, snmpget.plg,
+ snmpgetnext.dsp, snmpgetnext.plg, snmpset.dsp, snmpset.plg,
+ snmpstatus.dsp, snmpstatus.plg, snmptranslate.dsp,
+ snmptranslate.plg, snmpwalk.dsp, snmpwalk.plg): Patch from Joe
+ Marzot:
+ - win32 update.
+
+hardaker 8 Jul 98 12:34:26
+ - (struct.h, util_funcs.c, util_funcs.h, pass-persist.c,
+ pass-persist.h): Patch from Michael Douglass:
+ - create a pass-persist module to handle continuously running pass throughs.
+
+hardaker 8 Jul 98 12:56:46
+ - (read_config.c, read_config.h): removed from agent dir.
+
+hardaker 8 Jul 98 12:57:06
+ - (ucd_snmp.h): added pass-persist module.
+
+hardaker 8 Jul 98 12:58:03
+ - (snmp_api.c): Patch from Joe Marzot:
+ - fix "number of retries" bug.
+ - remove odd timeout calculation code for retries > 3.
+
+hardaker 8 Jul 98 13:02:06
+ - (interfaces.c): make hp_interfaces structure static.
+
+hardaker 8 Jul 98 13:03:36
+ - (system.c): don't free env pointers that are created.
+
+hardaker 8 Jul 98 13:08:18
+ - (UCD-SNMP-MIB.txt): Patch from Niels Baggesen:
+ - fix for missing object identifier labels.
+
+hardaker 8 Jul 98 14:04:22
+ - (Makefile.in, Makefile.top, configure, configure.in, Makefile.in,
+ .cvsignore, Makefile.in, dlmod_mib.c, dlmod_mib.h, example.c,
+ example.h, dlmod.c, dlmod.h, Makefile.in, Makefile.in,
+ DLMOD-MIB.txt, Makefile.in, Makefile.in): Patch from Eugene
+ Polovnikov:
+ - new dlmod set.
+ - fix configure script.
+
+hardaker 8 Jul 98 14:20:42
+ - (dlmod.c): use snmpd_ register_read_config() wrappers.
+
+hardaker 8 Jul 98 14:43:56
+ - (snmp_vars.c): include fixes.
+
+hardaker 8 Jul 98 14:44:25
+ - (ucd_snmp.h): removed ucd-snmp/pass_persist from default include list.
+
+hardaker 8 Jul 98 14:44:34
+ - (pass.c): include sys/wait.h
+
+hardaker 8 Jul 98 14:44:41
+ - (versioninfo.c): include system.h
+
+hardaker 8 Jul 98 14:45:22
+ - (parse.c): include snmp_api.h
+
+hardaker 8 Jul 98 14:45:42
+ - (snmp_api.c): include fixes.
+
+hardaker 8 Jul 98 15:31:36
+ - (snmptrapd.c, snmptrapd_handlers.c): -Wall fixes.
+
+hardaker 8 Jul 98 15:31:50
+ - (agent_read_config.c, snmpd.c): -Wall fixes.
+
+hardaker 8 Jul 98 15:51:28
+ version tag ( 3.6.pre1 )
+
+hardaker 10 Jul 98 09:42:16
+ - (snmpd.c): wrong pdu pointer for snmpv2c traps.
+
+hardaker 15 Jul 98 15:46:28
+ - (sedscript.in): using_module changes.
+
+hardaker 15 Jul 98 15:46:55
+ - (memory.h): MEMSWAPMINIMUM wasn't being used.
+
+hardaker 17 Jul 98 13:11:10
+ - (UCD-SNMP-MIB.inc, UCD-SNMP-MIB.txt):
+ - created smicng input file.
+ - fixed the UCD-SNMP mib to deal with most smic errors.
+
+hardaker 20 Jul 98 17:14:21
+ - (snmpcheck.def): work around for new multi-depth mib tables..
+
+hardaker 22 Jul 98 15:35:07
+ - (mib.c): don't change running environment variables with strtok.
+
+hardaker 22 Jul 98 16:23:45
+ - (Makefile.in, sedscript.in): fix sedscript includes.
+
+hardaker 31 Aug 98 13:02:27
+ - (interfaces.c): missing return on ifInErrors results.
+
+hardaker 31 Aug 98 13:32:43
+ - (snmptrapd.c): add a blank line to the end of the trapd output for parsing.
+
+hardaker 2 Sep 98 18:43:30
+ - (TODO): added security checks.
+
+hardaker 2 Sep 98 18:44:38
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - persistent config file question.
+
+hardaker 2 Sep 98 18:44:53
+ - (Makefile.in): typo.
+
+hardaker 2 Sep 98 18:47:15
+ - (mib.c, mib.h, read_config.c, read_config.h):
+ - pre/post mib loading config files.
+ - create init_snmp() to wrap other fuctions.
+ - new snmp.conf directives: mibs, mibdirs, mibfile.
+
+hardaker 2 Sep 98 18:47:48
+ - (snmp_api.c, snmp_api.h): init_snmp().
+
+hardaker 2 Sep 98 18:48:25
+ - (libsnmp.def): find_module.
+
+hardaker 2 Sep 98 18:48:40
+ - (snmp_parse_args.c): use init_snmp instead of init_mib().
+
+hardaker 2 Sep 98 18:50:34
+ - (agent_read_config.c, agent_read_config.h, snmp_vars.c, snmpd.c,
+ snmpd.h):
+ - support mib-module shutdown functions.
+ - do a minimal persistent cache implementation and read it at start up.
+ - test with beginnings (wrong place) of agentBoots variable.
+
+nba 3 Sep 98 14:29:03
+ - (fixproc): added comment to test CVS.
+
+hardaker 9 Sep 98 16:12:32
+ - (*): Merge into main branch from 3.5.1 branch.
+
+hardaker 9 Sep 98 16:55:04
+ - (snmpd.c): fix trap stuff broken by the code merge.
+
+hardaker 11 Sep 98 09:26:42
+ - (*): Merged the MT changes into the main branch.
+
+hardaker 12 Sep 98 08:46:01
+ - (snmp_api.c): prototype move init_snmp() above init_snmp_session.
+
+hardaker 12 Sep 98 08:53:23
+ - (acconfig.h, config.h.in): move un-configured defines above @TOP@.
+
+hardaker 12 Sep 98 08:54:24
+ - (configure, configure.in): Don't force cc anymore, allow gcc to go first.
+
+hardaker 12 Sep 98 08:56:51
+ - (ov/Makefile.in, mibs/Makefile.in): Patch from Michael Slifcak:
+ - remove duplicate sections already defined in Makefile.top.
+
+hardaker 12 Sep 98 09:02:37
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - bug fix to check for NULL session pointer before using it.
+
+hardaker 12 Sep 98 09:08:46
+ - (acconfig.h, config.h.in): Move CAN_USE_NLIST tests below arch .h files.
+
+hardaker 13 Sep 98 18:24:00
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - exit -> return.
+
+hardaker 13 Sep 98 20:12:09
+ - (snmptable.c, snmptranslate.c, mib.c, mib.h, parse.c, parse.h):
+ - merge into main line from the 3-6-pre1-trans branch.
+
+hardaker 13 Sep 98 20:18:10
+ - (snmp_api.c): define usage mispelling SNMP_BAD_PARSE -> SNMPERR_BAD_PARSE.
+
+hardaker 13 Sep 98 20:30:38
+ - (snmp_api.c): prevent double init_snmp()s.
+
+hardaker 13 Sep 98 21:05:26
+ - (README): Name addition.
+
+hardaker 13 Sep 98 21:06:52
+ - (mib.c, read_config.c): refix the non-malloced configuration vars.
+
+hardaker 13 Sep 98 21:09:36
+ version update: 3.6.pre2
+
+hardaker 14 Sep 98 12:35:10
+ - (Makefile.in): Patch from Michael Slifcak:
+ - install snmp_sess_api.3.
+
+hardaker 14 Sep 98 12:43:32
+ - (agent_read_config.c, snmp_vars.c, dlmod_mib.c, util_funcs.c,
+ dummy.c, wombat.c, hr_device.c, hr_disk.c, hr_filesys.c,
+ hr_network.c, hr_partition.c, hr_print.c, hr_proc.c, hr_storage.c,
+ hr_swinst.c, hr_swrun.c, hr_system.c, at.c, icmp.c, interfaces.c,
+ ip.c, snmp_mib.c, system.c, tcp.c, udp.c, var_route.c, snmp_bgp.c,
+ snmp_ospf.c, snmp_rip2.c, hpux.c, pass.c, pass_persist.c,
+ registry.c, acl_vars.c, alarm.c, context_vars.c, event.c,
+ party_vars.c, view_vars.c, snmptrapd.c, snmptrapd_handlers.c,
+ snmp_api.c, snmp_api.h): Patch from Michael Slifcak:
+ - rename compare -> snmp_oid_compare().
+
+hardaker 15 Sep 98 13:02:34
+ - (inet.c): Patch from Michael Slifcak:
+ - memory related fixes.
+
+hardaker 15 Sep 98 13:07:05
+ - (mib.c): // comment -> /* */ comment.
+
+hardaker 15 Sep 98 13:07:45
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - fix init_snmp calls from session routines.
+
+hardaker 18 Sep 98 13:20:11
+ - (UCD-SNMP-MIB.txt): added the FileTable submitted by Jonas Olsson.
+
+hardaker 18 Sep 98 14:01:51
+ - (ucd_snmp.h): add the file mib module.
+
+hardaker 18 Sep 98 14:04:43
+ - (UCD-SNMP-MIB.txt): Change file return code from TruthValue to
+ integer since 1/2 does not fit the current 0/1 return code scheme.
+
+hardaker 21 Sep 98 11:11:39
+ - (snmp_vars.c): finally fixed the write_method's for creation problem.
+
+hardaker 23 Sep 98 13:07:07
+ - (acconfig.h, config.h.in, configure, configure.in, parse.c): New flag:
+ - --enable-eol-terminated-comments.
+
+hardaker 25 Sep 98 17:05:40
+ - (snmp_api.c): don't rely on the getservbyname pointer to stay around.
+
+hardaker 25 Sep 98 17:15:22
+ - (snmp_api.c, snmp_api.h, snmp_client.c): Patch from Michael Slifcak:
+ - The CMU library has an optimization in snmp_clone_pdu() that does
+ not copy zero length strings. I had merged this in with changes
+ made for multi-thread support. Unfortunately, I did not make sure
+ the cloned PDU had no pointer for this case. Oops!
+ - Another problem in snmp_clone_pdu() was the test for zero length
+ string was not being performed on the first varbind in the chain.
+
+hardaker 25 Sep 98 17:24:16
+ - (mib.c, mib.h, read_config.c, snmp_api.c, snmp_api.h): Patch from
+ Michael Slifcak:
+ - fix compiler warnings, errors.
+
+hardaker 25 Sep 98 17:25:10
+ - (snmptable.c): process args directly instead of relying on get_opt().
+
+hardaker 25 Sep 98 17:33:06
+ - (config.h, win32.dsw, libsnmp.dsp, libsnmp.def, libsnmp_dll.dsp,
+ snmptable.dsp): Patch from Michael Slifcak:
+ - stupid OS update.
+
+hardaker 25 Sep 98 17:55:50
+ - (Makefile.in): Patch from Michael Slifcak:
+ - install more headers.
+
+hardaker 25 Sep 98 17:56:43
+ - (Makefile.in): don't install libsnmp.h. It's going to change too
+ much in the future.
+
+hardaker 25 Sep 98 18:03:27
+ - (Makefile.in): install version.h, and strip includes out of config.h
+
+hardaker 25 Sep 98 18:04:11
+ - (snmp_api.c): remove unneeded comment-out.
+
+hardaker 25 Sep 98 18:14:20
+ - (configure, configure.in, util_funcs.c): use USLEEP if available for
+ small sleep times while waiting for processes to finish.
+
+hardaker 30 Sep 98 14:57:11
+ - (ChangeLog, EXAMPLE.conf.def, NEWS, configure, configure.in,
+ interfaces.c, memory.c, snmptest.c, snmptrap.c, parse.c):
+ - merge 3.5.3 changes into main trunk.
+
+hardaker 5 Oct 98 16:53:23
+ - (dummy.c, dummy.h): update to remove common_header.h
+
+hardaker 5 Oct 98 17:03:34
+ - (hr_proc.c): possible fix for solaris's process percentage.
+
+hardaker 6 Oct 98 15:18:03
+ - (var_route.c): hack fixes for hpux10 and rtentry.
+
+hardaker 6 Oct 98 15:18:16
+ - (hpux.h): hack fixes for hpux10 and rtentry.
+
+hardaker 6 Oct 98 15:18:55
+ - (config.h.in): setup define for HAVE_USLEEP.
+
+hardaker 6 Oct 98 15:34:58
+ - (remove-files): update.
+
+hardaker 6 Oct 98 15:35:06
+ - (versiontag): fix for cvs 1.10.
+
+hardaker 6 Oct 98 15:38:49
+ - (versiontag): typo.
+
+hardaker 6 Oct 98 15:38:56
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre3 )
+
+hardaker 7 Oct 98 16:49:11
+ - (Makefile.in): Patch from Michael Slifcak:
+ - properly locate version.h in $(srcdir).
+
+hardaker 7 Oct 98 16:49:30
+ - (Makefile.in): Patch from Michael Slifcak:
+ - fix make html.
+
+hardaker 7 Oct 98 16:50:23
+ - (parse.c): Patch from Michael Slifcak:
+ - remove un-needed headers.
+
+hardaker 7 Oct 98 16:51:56
+ - (snmp_api.c): fix default port problems (again).
+
+hardaker 7 Oct 98 16:54:38
+ - (snmpdelta.c): Patch from Michael Slifcak:
+ - fix exiting problems on NT.
+
+hardaker 7 Oct 98 17:00:40
+ - (libsnmp.dsp, libsnmp_dll.dsp): Patch from Michael Slifcak:
+ - winNT project file updates.
+
+hardaker 9 Oct 98 08:09:12
+ - (config.h.in, configure, configure.in): use zlib when using rpm libraries.
+
+hardaker 9 Oct 98 23:08:18
+ - (parse.c): Patch from Dave Shield:
+ - Check for fully qualified oid statements.
+
+hardaker 9 Oct 98 23:12:02
+ - (parse.c): Patch from Dave Shield:
+ - support for strict (case sensitive) option to the mib compiler.
+
+hardaker 9 Oct 98 23:20:25
+ - (FAQ): Dave Shield explains in wonderous detail all about the VACM module.
+
+hardaker 14 Oct 98 09:17:02
+ - (EXAMPLE.conf.def): change public community examples -> private.
+
+hardaker 14 Oct 98 09:41:12
+ - (config.h.in, configure, configure.in): check for machine/types.h.
+
+hardaker 14 Oct 98 09:41:38
+ - (host_res.h): net/in_var.h for freebsd3.
+
+hardaker 14 Oct 98 09:42:20
+ - (hr_storage.c): machine/types.h and sys/vmmeter.h for freebsd3.
+
+hardaker 14 Oct 98 09:50:26
+ - (freebsd3.h): define freebsd2 and MOUNT_NFS.
+
+hardaker 14 Oct 98 09:51:58
+ - (freebsd3.h): opps: define MOUNT_NFS as "nfs".
+
+hardaker 14 Oct 98 16:40:05
+ - (snmpd.c): -A: append to log file.
+
+hardaker 14 Oct 98 16:41:52
+ - (snmpd.c): document -A.
+
+hardaker 14 Oct 98 16:42:10
+ - (snmpd.1.def): document -A.
+
+hardaker 14 Oct 98 16:49:03
+ - (mib.c): Patch from Michael Slifcak:
+ - fix for broken compiler warnings on NT.
+
+hardaker 14 Oct 98 16:52:51
+ - (memory.c): fix for hpux9.
+
+hardaker 16 Oct 98 08:38:39
+ - (at.c, icmp.c, interfaces.c, aix.h): aix header file fixes.
+
+hardaker 21 Oct 98 10:54:49
+ - (parse.c): Patch from Dave Shield:
+ - Fix parser to deal with anonymous children properly.
+
+hardaker 21 Oct 98 11:08:56
+ - (hr_filesys.c): Patch from Dave Shield:
+ - watch out for empty file names passed in.
+
+hardaker 21 Oct 98 17:01:12
+ - (.cvsignore, Makefile.in, read_config.3.def):
+ - new unproofread manual on the read_config api (most of it).
+
+hardaker 23 Oct 98 07:57:17
+ - (hr_filesys.c): Patch from Dave Shield:
+ - NULL checking on the filesystem mount point.
+
+hardaker 23 Oct 98 13:54:11
+ - (Makefile.in): insert @ sign.
+
+hardaker 23 Oct 98 13:54:47
+ - (at.c, icmp.c, interfaces.c): bug fixes, missing #endif.
+
+hardaker 23 Oct 98 13:56:09
+ - (tkmib): editable oid field.
+
+hardaker 23 Oct 98 13:59:44
+ - (acconfig.h, config.h.in, configure, configure.in,
+ agent_read_config.c, agent_read_config.h, snmpd.c, wombat.h,
+ system.h, vacm_vars.h, dlmod.c, disk.h, extensible.h, file.h,
+ loadave.h, memory.h, memory_freebsd2.h, pass.h, pass_persist.h,
+ proc.h, snmp_parse_args.c, snmptrapd.c, mib.c, read_config.c,
+ read_config.h):
+ - new option -H on command line to print out .conf file directives
+ that the application understands.
+ - created a new option to the read config registration to allow
+ specifying of a help line.
+
+hardaker 6 Nov 98 17:23:46
+ - (snmpd.c): fix v2 trap generation.
+
+hardaker 6 Nov 98 17:44:43
+ - (snmpd.c): v2 trap send debugging.
+
+hardaker 16 Nov 98 22:10:08
+ - (tkmib): too many improvements to count.
+
+hardaker 23 Nov 98 15:42:52
+ - (interfaces.c, irix.h): fix location of _KERNEL define for irix.
+
+hardaker 23 Nov 98 16:35:40
+ - (snmp_parse_args.c, mib.c, parse.c, parse.h): Patch from Michael Slifcak:
+ - misc parsing bug fixes.
+ - -w & -W options to default application parse_args.
+ - runtime options to control underscore and comment parsing in mibs.
+
+hardaker 13 Dec 98 07:42:44
+ - (config.h.in, configure, configure.in, mib.c, snmp_api.c):
+ - use setlocale() if available to correct isprint problems.
+
+hardaker 13 Dec 98 07:48:53
+ - (parse.c, parse.h): new functions: snmp_mib_toggle_options() and usage.
+
+hardaker 13 Dec 98 07:49:43
+ - (snmp_parse_args.c): -P flag for toggling new mib parsing options.
+
+hardaker 13 Dec 98 08:06:33
+ - (NEWS): beginning notes for 3.6.
+
+hardaker 13 Dec 98 08:07:24
+ - (disk.c): fix disk size error flag reporting on Solaris.
+
+hardaker 13 Dec 98 08:12:13
+ - (parse.c): spacing in mib option usage fixes.
+
+hardaker 13 Dec 98 08:14:44
+ - (snmp_parse_args.c): remove -w/-W flag in usage.
+
+hardaker 13 Dec 98 08:18:07
+ - (kernel_sunos5.c): remove a few defines that were messing up solaris 7.
+
+hardaker 13 Dec 98 08:41:55
+ - (hr_filesys.c): watch out for NULL file pointers.
+
+hardaker 13 Dec 98 08:42:20
+ - (inet.c): init pointer to NULL.
+
+hardaker 13 Dec 98 08:48:38
+ - (hr_swinst.c): Patch from Jeff Johnson:
+ - protect against memory leaks with the RPM package info calls.
+
+hardaker 13 Dec 98 08:57:52
+ - (README): added Jeff Johnson to the contributors list.
+
+hardaker 13 Dec 98 08:59:16
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre5 )
+
+hardaker 16 Dec 98 07:31:26
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - pointer checks before freeing memory.
+
+hardaker 18 Dec 98 11:36:39
+ - (UCD-SNMP-MIB.txt): Patch from Michael Slifcak:
+ - typo.
+
+hardaker 18 Dec 98 18:10:24
+ - (parse.c, read_config.c, read_config.h):
+ - fixes from Michael Slifcak.
+ - misc read_config functions pulled in from the v3 work.
+
+hardaker 18 Dec 98 18:11:03
+ - (libsnmp.def): update from Michael Slifcak.
+
+hardaker 18 Dec 98 18:12:54
+ - (snmp_parse_args.c): include read_config.h.
+
+hardaker 18 Dec 98 18:16:33
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - store configure flags to a define.
+
+hardaker 18 Dec 98 18:16:53
+ - (versioninfo.c, versioninfo.h): mib object to display configure options.
+
+hardaker 21 Dec 98 18:19:12
+ - (file.h, UCD-SNMP-MIB.txt): move the file mib to .15 so it doesn't
+ conflict with the demo mib.
+
+hardaker 21 Dec 98 18:20:25
+ - (system.c): Patch from Michael Slifcak:
+ - Win32 memory leak fixes for opendir(), etc.
+
+hardaker 22 Dec 98 08:50:29
+ - (Makefile.in): don't compile dlmods
+
+hardaker 22 Dec 98 14:56:44
+ - (mib.c, snmp_api.c): Patch from Michael Slifcak:
+ - fix my broken set_locale stuff.
+
+hardaker 26 Dec 98 10:35:23
+ - (dlmod.c): Patch from Michael Slifcak:
+ - fix dlmod compilation in snmpd_register_config_handler() call.
+
+hardaker 29 Dec 98 16:55:54
+ - (mib.c): Patch from Michael Slifcak:
+ - remove newlines from sprint_value() where applicable.
+
+hardaker 29 Dec 98 17:02:33
+ - (vacm.c): Enable multiple side by side views in the view family
+ tree. The views already existed, but weren't checked and only the
+ first view was found.
+ - Not done in a clean fashion. Much of the structure definitions
+ should be rewritten with sub-pieces to do it properly with greater
+ speed.
+
+hardaker 31 Dec 98 17:46:11
+ - (event.c): Patch from David Tiller:
+ - memcmp's sizes were wrong.
+
+hardaker 31 Dec 98 17:48:57
+ - (snmp_client.c): Patch from David Tiller:
+ - need to read_objid() the context oid base, not the party oid base
+ in one location.
+
+hardaker 31 Dec 98 17:49:51
+ - (snmp_vars.c): Patch from David Tiller:
+ - oidLen's were wrong for m2m oids.
+
+hardaker 2 Jan 99 08:48:29
+ - (IANAifType-MIB.txt): Patch from Jakob Ellerstedt:
+ - new complete list of ifTypes.
+
+hardaker 5 Jan 99 10:41:52
+ - (snmptable.c): Make field separator take arguments directly after the -f.
+
+hardaker 5 Jan 99 10:48:51
+ - (snmpbulkwalk.c, snmpget.c, snmpgetnext.c, snmpset.c, snmpstatus.c,
+ snmptable.c, snmpwalk.c): Patch from mslifcak@iss.net:
+ - make main() return an int instead of void.
+
+hardaker 9 Jan 99 20:28:21
+ - (mib.c, parse.c, read_config.c, snmp_api.c, snmp_api.h, vacm.c):
+ - Implement the new token based debugging message support.
+
+hardaker 9 Jan 99 20:30:12
+ - (snmptable.c): change internal debug variable to localdebug.
+
+hardaker 9 Jan 99 20:30:47
+ - (snmp_parse_args.c): make -D register the debugging tokens specified.
+
+hardaker 9 Jan 99 20:49:29
+ - (FAQ, README): URL changes.
+
+hardaker 9 Jan 99 20:50:15
+ - (snmptrapd.c, snmptrapd_handlers.c): use the new debugging functions.
+
+hardaker 9 Jan 99 20:50:28
+ - (if.c, main.c): use the new debugging functions.
+
+hardaker 9 Jan 99 20:52:10
+ - (snmp_api.c, snmp_api.h): DEBUGPOID replacement: DEBUGMSGOID.
+
+hardaker 9 Jan 99 20:52:22
+ - (snmpcmd.1): discuss -D usage change.
+
+hardaker 9 Jan 99 21:50:13
+ - (agent/*.c):
+ - use the new debugging functions.
+ - implement needed -D flag changes.
+
+hardaker 14 Jan 99 09:02:36
+ - (mib2c): update for SNMP.pm 1.8.
+
+hardaker 15 Jan 99 11:10:09
+ - (snmp2p.c): Patch from Michael Slifcak:
+ - remove reverse_bytes() usage.
+
+hardaker 15 Jan 99 11:12:22
+ - (snmpd.c, snmpd.h):
+ - remove reverse_bytes() usage.
+
+hardaker 15 Jan 99 15:24:02
+ - (agent/mibgroup/*):
+ - made all (ok, some. !host) mib modules use snmpd_register_config_handler().
+ - made all (ok, some. !host) mib modules use register_mib().
+
+hardaker 15 Jan 99 15:58:20
+ - (Makefile.in, Makefile.in): makefileindepend.
+
+hardaker 15 Jan 99 15:58:50
+ - (vacm.c): DEBUGMSG typo.
+
+hardaker 15 Jan 99 16:17:05
+ - (smux.c, smux.h): Patch from Nick Amato:
+ - smux patches.
+
+hardaker 16 Jan 99 23:04:12
+ - (snmpcmd.1): updated -D description.
+
+hardaker 16 Jan 99 23:12:03
+ - (snmplib/*.[ch]): Patch from Markku Laukkanen:
+ - asni'ify all functions.
+
+hardaker 16 Jan 99 23:13:10
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre6 )
+
+hardaker 18 Jan 99 10:47:36
+ - (README, apps, agent, acconfig.h): Patch from Markku Laukkanen:
+ - ansi'ify everything.
+
+hardaker 19 Jan 99 19:59:53
+ - (config.h.in, configure, configure.in): remove __P checking.
+
+hardaker 19 Jan 99 20:01:59
+ - (snmptable.c, mib.c, parse.c, snmp_auth.c, libsnmp.def): Patch from
+ Michael J. Slifcak:
+ - apps/snmptable.c - some compilers warn comparing pointer with integer
+ - snmplib/mib.c - already mentioned before; here for complete-ness
+ - snmplib/parse.c - minor touchup of includes; system.h dup removed
+ - snmplib/snmp_api.h - MSVisual C++ doesn't have __FUNCTION__
+ - snmplib/snmp_auth.c - minor fix of comment
+ - win32/libsnmp_dll/libsnmp.def - snmp_parse_args needs a new function
+
+hardaker 20 Jan 99 12:20:08
+ - (FAQ): perl-SNMP and y2k questions added.
+
+hardaker 20 Jan 99 12:21:35
+ - (acconfig.h): unneeded comment removed.
+
+hardaker 20 Jan 99 12:21:57
+ - (interfaces.c): typo in ansi changes.
+
+hardaker 20 Jan 99 12:24:34
+ - (agent_read_config.c, auto_nlist.c, snmp_agent.c, snmpd.c,
+ host_res.h, mibincl.h, .cvsignore, snmp_parse_args.c, snmptrapd.c,
+ snmptrapd_handlers.c, if.c, Makefile.in, mib.c, parse.c,
+ read_config.c, snmp_api.c, snmp_api.h, snmp_debug.c, snmp_debug.h,
+ vacm.c): debugging support code moved to snmp_debug.[ch].
+
+hardaker 20 Jan 99 15:11:59
+ - (Makefile.in): version tag creation.
+
+hardaker 20 Jan 99 15:14:13
+ - (config.h.in, configure, configure.in):
+ - check for asm/page.h (linux).
+ - check for sys/stream.h (SCO).
+ - Fix rtentry test.
+
+hardaker 20 Jan 99 15:14:42
+ - (agent_read_config.c, snmp_vars.c): include sys/stream.h for SCO.
+
+hardaker 20 Jan 99 15:14:58
+ - (versiontag): version tagging ability to do many things.
+
+hardaker 20 Jan 99 15:16:34
+ - (at.c, interfaces.c, ip.c, route_write.c, tcp.c, udp.c,
+ var_route.c):
+ - sys/stream.h needed by SCO.
+ - interfaces scan fixes for linux 2.0 vs 2.1 can be configured elsewhere now.
+ - protect get_address calls against NULL pointer returns.
+
+hardaker 20 Jan 99 15:17:17
+ - (disk.c, errormib.c, extensible.c, loadave.c, memory.c):
+ - linux 2.1 kernel needs asm/page.h (all includes need to be re-written).
+
+hardaker 20 Jan 99 15:17:41
+ - (linux.h): define LINUX_INTERFACE_SCAN_LINE.
+
+hardaker 20 Jan 99 15:20:04
+ - (Makefile.in): install ucd-snmp-includes.h.
+
+hardaker 20 Jan 99 15:22:08
+ - (Makefile.in): make depend.
+
+hardaker 20 Jan 99 15:22:38
+ - (FAQ, README): added version stamp.
+
+hardaker 20 Jan 99 15:30:58
+ - (COPYING): It's 1999
+
+hardaker 20 Jan 99 15:31:13
+ - (README): helping out changes.
+
+hardaker 20 Jan 99 15:48:53
+ - (smux.c): typo
+
+hardaker 20 Jan 99 15:49:30
+ - (hr_swinst): #ifdef RPM protect a free routine.
+
+hardaker 20 Jan 99 15:50:17
+ - (Makefile.in): remove ucd specific mib module make requirements.
+
+hardaker 20 Jan 99 15:54:02
+ - (snmpd.c): export sdlist and sdlen variables.
+
+hardaker 20 Jan 99 15:54:36
+ - (smux.c): debugging changes.
+
+hardaker 20 Jan 99 16:41:20
+ - (acconfig.h, config.h.in, snmp_parse_args.c, main.c, snmp_api.c):
+ Patch from Michael Slifcak:
+ - allow zero length (legal) community strings.
+
+hardaker 20 Jan 99 17:02:37
+ - (config.h.in): ran autoheader
+
+hardaker 20 Jan 99 17:11:26
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre7 )
+
+hardaker 21 Jan 99 08:39:34
+ - (FAQ): Patch from Michael J. Slifcak:
+ - typo on Joe's name fixed.
+
+hardaker 21 Jan 99 08:40:26
+ - (acconfig.h, config.h.in, snmp_api.c, config.h): Patch from Michael
+ J. Slifcak:
+ - NO_NULL_COMUNITY -> NO_ZEROLENGTH_COMMUNITY.
+
+hardaker 21 Jan 99 08:42:17
+ - (Makefile.in): remove ucd specific module depends.
+
+hardaker 22 Jan 99 07:23:13
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - Check for NULL on session closes.
+
+hardaker 25 Jan 99 10:28:08
+ - (snmpdelta.c, snmpstatus.c, snmptest.c, snmptrap.c,
+ snmptrapd_handlers.c, inet.c, main.c): Patch from Markku Laukkanen:
+ - more ansi fixes.
+
+hardaker 25 Jan 99 10:28:26
+ - (versiontag): typo.
+
+hardaker 25 Jan 99 10:28:41
+ - (linux.h): 2.2 define update.
+
+hardaker 25 Jan 99 10:33:24
+ - (context_parse.c, mib.c, parse.c, read_config.c, snmp_api.c,
+ snmp_client.c, system.c): Patch from Markku Laukkanen:
+ - ansi fixes.
+
+hardaker 25 Jan 99 10:34:11
+ - (system.c): fix strings.h include.
+
+hardaker 25 Jan 99 11:11:49
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - test if __FUNCTION__ is supported by the compiler.
+
+hardaker 25 Jan 99 11:15:53
+ - (agent_read_config.c, snmp_vars.h, snmpd.c, host_res.h, mibincl.h,
+ file.c, inet.c, parse.c, snmp_debug.c):
+ - -Wall fixes.
+
+hardaker 25 Jan 99 11:16:16
+ - (linux.h): comment typo.
+
+hardaker 25 Jan 99 16:25:37
+ - (README, README.mib2c): mib2c readme file.
+
+hardaker 26 Jan 99 09:45:42
+ - (EXAMPLE.conf.def): change reference IP net addresses to 10.10.10.0.
+
+hardaker 2 Feb 99 13:33:25
+ 2036 -> 2038
+
+hardaker 2 Feb 99 13:34:36
+ - (snmpd.c): typo: -L -> -A in help strings docs.
+
+hardaker 2 Feb 99 22:00:13
+ - (FAQ): mention lack of solaris memory support.
+
+hardaker 2 Feb 99 22:01:01
+ - (TODO): Remove unsuppored mib nodes from output instead of returning 0's.
+
+hardaker 2 Feb 99 22:02:04
+ - (hr_proc.c): use [0] index of load average table.
+
+hardaker 2 Feb 99 22:02:41
+ - (UCD-SNMP-MIB.txt):
+ - mention that the memory section isn't supported on all
+ architectures.
+
+hardaker 8 Feb 99 12:21:25
+ - (smux.c): Patch from John Polstra:
+ - call accept() to get the socket file descriptor.
+
+hardaker 8 Feb 99 15:08:57
+ - (FAQ): Patch from Michael Slifcak:
+ - Tk.pm mention.
+
+hardaker 8 Feb 99 15:13:01
+ - (snmpd.c): Patch from Michael Slifcak:
+ - variable renaming index -> iindex.
+
+hardaker 8 Feb 99 15:14:42
+ - (snmpdelta.c): Patch from Michael Slifcak:
+ - variable renaming time -> m_time.
+
+hardaker 8 Feb 99 15:17:50
+ - (route.c): Patch from Michael Slifcak:
+ - variable renaming index -> IfIndex.
+
+hardaker 8 Feb 99 15:18:08
+ - (inet.c): proper bracket indentation.
+
+hardaker 8 Feb 99 15:19:22
+ - (parse.c): Patch from Michael Slifcak:
+ - use size_t instead of "unsigned" for xmalloc, etc.
+
+hardaker 8 Feb 99 15:20:47
+ - (snmp_api.c, snmp_api.h): Patch from Michael Slifcak:
+ - make snmp_oid_compare use const's.
+
+hardaker 8 Feb 99 23:22:33
+ - (agent/*): Patch from Michael Slifcak:
+ - typedef all of the var_xxx and write method functions.
+
+hardaker 8 Feb 99 23:23:41
+ - (kernel_sunos5.c, mibincl.h) Patch from Michael Slifcak:
+ - include updates.
+
+hardaker 9 Feb 99 14:10:33
+ - (Makefile.in): make FAQ.html.
+
+hardaker 9 Feb 99 14:10:52
+ - (mib2c): typo.
+
+hardaker 9 Feb 99 14:35:46
+ - (mib.c): increase buffer size for oid printing.
+
+hardaker 11 Feb 99 16:10:39
+ - (*): Patch from Michael Slifcak:
+ - convert MAX_NAME_LEN -> MAX_OID_LEN.
+ - convert temporary character storage buffers to SPRINT_MAX_LEN.
+ - make the libraries print_ functions use the fprint_ function
+ already defined and pass it stdout.
+
+hardaker 11 Feb 99 16:22:03
+ - (host_res.h): include snmp_vars.h ahead of var_struct.h.
+
+hardaker 11 Feb 99 16:23:16
+ - (acl_parse.c, context_parse.c, party_parse.c, read_config.c, snmp_api.c):
+ - More buf size standardizations that Michael missed.
+ - A few MAX_NAME_LEN -> MAX_OID_LEN conversions that Michael missed.
+
+hardaker 11 Feb 99 16:34:00
+ - (tcp.c): var_tcpEntry was checking against the incoming oid with the
+ wrong length and could succeed at times when it shouldn't have.
+
+hardaker 11 Feb 99 16:46:48
+ - (version.h bug-report sedscript.in): version tag ( Ext-3-6-pre8 )
+
+hardaker 11 Feb 99 16:48:07
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre8 )
+
+hardaker 11 Feb 99 16:48:29
+ - (versiontag): update.
+
+hardaker 16 Feb 99 17:05:45
+ - (mib2c, mib2c.conf): updated mib2c program... still in progress...
+
+hardaker 17 Feb 99 15:10:00
+ - (interfaces.c): Patch from Michael L. Hitch:
+ - fix if_name variable by making it static.
+
+hardaker 17 Feb 99 15:13:38
+ - (snmpd.h): Patch from Michael Slifcak:
+ - remove reverse_bytes() prototype.
+
+hardaker 17 Feb 99 15:13:58
+ - (snmptranslate.c): Patch from Michael Slifcak:
+ - usage fix.
+
+hardaker 17 Feb 99 15:15:59
+ - (if.c, inet.c, main.c, netstat.h, route.c): Patch from Michael Slifcak:
+ - make snmpnetstat win32 compatible.
+
+hardaker 17 Feb 99 15:16:17
+ - (mib2c, mib2c.conf): update again for better still output.
+
+hardaker 17 Feb 99 15:17:13
+ - (Makefile.in): separate target for generated manual pages.
+
+hardaker 17 Feb 99 15:18:06
+ - (IANAifType-MIB.txt): Patch from Michael Slifcak:
+ - use a '-' instead of a '.' for IEEE802-11.
+
+hardaker 17 Feb 99 15:19:03
+ - (asn1.c): Patch from Michael Slifcak:
+ - comment reformatting.
+
+hardaker 17 Feb 99 15:19:52
+ - (context_parse.c): Patch from Michael Slifcak:
+ - don't use a variable called 'time'. Tsk tsk.
+
+hardaker 17 Feb 99 15:21:25
+ - (mib.c): Patch from Michael Slifcak:
+ - fix fprint_variable to not recurse.
+
+hardaker 17 Feb 99 15:23:44
+ - (parse.c, party_parse.c, snmp_auth.c): Patch from Michael Slifcak:
+ - variable name conflict fixes.
+
+hardaker 17 Feb 99 15:28:54
+ - (config.h, win32.dsw, libsnmp.dsp, libsnmp.def, libsnmp_dll.dsp,
+ snmpnetstat.dsp, snmptable.dsp): Patch from Michael Slifcak:
+ - win32 updates.
+
+hardaker 17 Feb 99 16:13:47
+ - (snmpd.c, dummy.c, wombat.c, system_mib.c, vacm_vars.c, dlmod.c,
+ disk.c, extensible.c, file.c, loadave.c, memory.c,
+ memory_freebsd2.c, pass.c, pass_persist.c, proc.c, mib.c,
+ read_config.c): word -> token ("word" is reserved in some compilers.
+
+hardaker 22 Feb 99 09:11:52
+ - (parse.c): Patch from mslifcak@iss.net:
+ - The command line option to select "allow underscore in MIB
+ symbols" is missing.
+
+hardaker 22 Feb 99 09:44:21
+ - (parse.c): Patch from Michael Slifcak:
+ - Don't print "can't find module XXX" messages without warnings turned on.
+
+hardaker 24 Feb 99 14:43:21
+ - (IANAifType-MIB.txt): update.
+
+hardaker 24 Feb 99 17:10:13
+ - (acconfig.h, config.h.in, configure, configure.in, linux.h):
+ - Check for and handle 2.2 /proc/net/dev changes.
+
+hardaker 25 Feb 99 10:03:41
+ - (README, ucd_snmp.h, memory_solaris2.c, memory_solaris2.h): Patch
+ from David F. Newman:
+ - memory support for solaris2.
+
+hardaker 26 Feb 99 15:02:55
+ - (loadave.c, loadave.h, UCD-SNMP-MIB.txt):
+ - implement load average reporting as a integer and as a float.
+
+hardaker 26 Feb 99 15:42:31
+ - (mib.c, parse.c, parse.h): Patch from Michael Slifcak:
+ - Unlinked OID ... ccitt 0 fix courtesy of Dave Shield.
+ - Continue after reserved word error fix courtesy of Dave Shield.
+ - Modification to #2 courtesy of Niels Baggesen.
+ - Modification to print sub-identifier == 0
+ - variable renaming.
+ - Instead of re-ordering all singly-linked lists, use a new member
+ that flags when a report has begun.
+
+hardaker 26 Feb 99 16:06:49
+ - (EXAMPLE.conf.def): update and made better examples.
+
+hardaker 26 Feb 99 16:10:21
+ - (NEWS): update for 3.6 release.
+
+hardaker 26 Feb 99 16:10:47
+ - (snmptrapd.c): usage update, and -H support.
+
+hardaker 26 Feb 99 16:11:49
+ - (Makefile.in, read_config.3.def, snmp.conf.5.def, snmp_config.5.def,
+ snmpd.conf.5.def, snmptrapd.8, snmptrapd.conf.5.def):
+ - new documentation on configuration capabilities.
+
+hardaker 26 Feb 99 16:33:09
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre9 )
+
+hardaker 1 Mar 99 10:48:03
+ - (UCD-SNMP-MIB.txt): typo: fileMax -> fileErrorFlag name change.
+
+hardaker 1 Mar 99 12:27:12
+ - (snmpd.c): Patch from Mike Slifcak:
+ - renaming of variables away from system function names (index -> lindex).
+
+hardaker 1 Mar 99 12:27:30
+ - (errormib.c): Patch from Mike Slifcak:
+ - remove errno variable.
+
+hardaker 1 Mar 99 12:27:45
+ - (if.c): Patch from Mike Slifcak:
+ - free the interface table.
+
+hardaker 1 Mar 99 12:28:17
+ - (parse.c): Patch from Mike Slifcak:
+ - remove duplicate case entries.
+
+hardaker 1 Mar 99 12:29:05
+ - (snmp_api.c): put a proper (void) into the function prototype.
+
+hardaker 1 Mar 99 12:29:45
+ - (snmp_client.c): Patch from Mike Slifcak:
+ - variable renaming.
+
+hardaker 1 Mar 99 12:30:19
+ - (asn1.h): Patch from Mike Slifcak:
+ - added MIN_OID_LEN for instructional use mostly (its unused).
+
+hardaker 1 Mar 99 13:03:15
+ - (context_parse.c, mib.c): Patch from Michael Slifcak:
+ - typecasting for certain functions to (char *).
+
+hardaker 1 Mar 99 13:59:14
+ - (snmp_vars.c, snmp_vars.h): make compare_tree() global.
+
+hardaker 1 Mar 99 14:04:05
+ - (smux.c, smux.h): Patch from Nick Amato:
+ - completely re-written smux modules.
+
+hardaker 1 Mar 99 14:20:11
+ - (smux.c, smux.h): 3.6ified.
+
+hardaker 1 Mar 99 16:10:57
+ - (alarm.c): Patch from Michael Slifcak:
+ - Cast to pointer to int may overflow the return buffer.
+
+hardaker 1 Mar 99 16:11:49
+ - (Makefile.in): Patch from David F. Newman:
+ - removed a trailing backslash that wasn't needed.
+
+hardaker 1 Mar 99 16:17:36
+ - (mib_api.3, read_config.3.def, snmp.conf.5.def, snmp_config.5.def,
+ snmpd.1.def, snmpd.conf.5.def, snmptest.1, snmptrapd.conf.5.def,
+ variables.5): Michael Slifcak:
+ - spell check.
+
+hardaker 1 Mar 99 16:19:56
+ - (snmp.conf.5.def, snmp_config.5.def, snmpd.1.def, snmptrapd.conf.5.def):
+ - remove reference to ECE dept.
+
+hardaker 1 Mar 99 16:22:40
+ - (asn1.h): put back in MAX_NAME_LEN temporarily.
+
+hardaker 1 Mar 99 17:43:49
+ - (smux.c):
+ - allow null length passwords.
+ - clean up debugging output.
+
+hardaker 2 Mar 99 08:47:29
+ - (asn1.h): Patch from Dave Shield:
+ - Don't define MAX_NAME_LEN if defined somewhere else.
+
+hardaker 2 Mar 99 10:42:34
+ - (system_mib.c, vacm_vars.c, ipfwacc.c): Patch from Michael Slifcak:
+ - Suggested fixes to eliminate more shadowed global references.
+ - fixups for prototype [(void) replacing ()].
+
+hardaker 2 Mar 99 13:23:57
+ - (var_route.c): don't return a pointer to a pointer.
+
+hardaker 2 Mar 99 15:17:53
+ - (acconfig.h, config.h.in, configure, configure.in, snmp_debug.c,
+ snmp_debug.h):
+ - new flag: --disable-debugging to completely turn off its support.
+ - renaming of DODEBUG to SNMP_ALWAYS_DEBUG.
+ - clean up of the configure script options listed, including putting
+ a list of available modules for compilation into the agent.
+
+hardaker 2 Mar 99 15:18:59
+ - (snmpd.conf.5.def): typo.
+
+hardaker 2 Mar 99 15:21:34
+ - (smux.c): Patch from Michael Slifcak:
+ - Linux compiles die at SO_RCVTIMEO.
+ - -Wall type fixes.
+
+hardaker 3 Mar 99 08:25:33
+ - (README): Added Nick.
+
+hardaker 3 Mar 99 08:28:05
+ - (configure): ran autoconf...
+
+hardaker 3 Mar 99 11:40:11
+ - (proc.c, solaris.h): Patch from Chris Hughes:
+ - Use /proc on solaris.
+
+hardaker 3 Mar 99 17:51:26
+ - (ChangeLog, FAQ, NEWS, PORTING, README, TODO, bug-report, snmpd.c,
+ README.mib2c): ece.ucdavis.edu -> ucd-snmp.ucdavis.edu.
+
+hardaker 3 Mar 99 18:00:51
+ - (NEWS): mention name change.
+
+hardaker 3 Mar 99 18:02:07
+ - (NEWS): mention SMUX.
+
+hardaker 3 Mar 99 18:02:23
+ - (version.h bug-report sedscript.in): version tag ( 3.6.pre10 )
+
+mslifcak 4 Mar 99 04:08:01
+
+ (snmpnetstat/if.c) - add void to empty formal parameter list
+
+hardaker 4 Mar 99 08:36:39
+ - (versiontag): repository move.
+
+hardaker 4 Mar 99 08:36:46
+ - (README.smux): add Nick.
+
+hardaker 4 Mar 99 09:07:07
+ - (configure.in, configure): fix void test for ansi compilers.
+
+mslifcak 4 Mar 99 09:20:08
+
+
+ (agent/snmpd.c, snmplib/snmp_client.c) : remove duplicate includes
+
+ (agent/mibgroup/target/snmpTargetAddrEntry.c, agent/mibgroup/target/snmpTargetParamsEntry.c, agent/mibgroup/ucd-snmp/memory_solaris2.c, apps/snmptrapd_handlers.c) : change "*word" to "*token" to help some compiler
+
+mslifcak 4 Mar 99 09:24:26
+
+
+ (Makefile.in) - find mibdefs.h when not building in the source tree
+
+hardaker 4 Mar 99 09:33:31
+ - (loadave.c): Patch from Chris Hughes:
+ - fix load average on solaris.
+
+hardaker 4 Mar 99 09:38:28
+ - (remove-files, ece-snmpd.conf, fixproc.conf):
+ - removed ece specific config files from the repository.
+ - don't remove local/*.conf in the first place anymore.
+
+hardaker 4 Mar 99 09:46:37
+ - (hr_swinst.c): Patch from mslifcak@iss.net:
+ - When the agent is compiled with HAVE_LIBRPM set, yet no database
+ is found, agent will core...
+
+hardaker 4 Mar 99 13:18:47
+ - (acconfig.h, config.h.in, configure, configure.in): removed void check.
+
+mslifcak 4 Mar 99 15:13:00
+
+
+ (hr_proc.c, loadave.c) - fixed core on getloadavg in a different way
+
+mslifcak 4 Mar 99 15:25:53
+
+ (disk.c) - explicit braces to avoid ambiguous `else'
+
+mslifcak 4 Mar 99 15:29:24
+
+ (hr_disk.c) - conditionally use defined DKC disk types
+
+hardaker 4 Mar 99 15:45:02
+ - (util_funcs.c, util_funcs.h, example.c, sysORTable.c, ipfwacc.c,
+ disk.c, extensible.c, file.c, loadave.c, memory.c, proc.c, vmstat.c,
+ vmstat_freebsd2.c):
+ - create and use header_simple_table to replace checkmib().
+
+hardaker 4 Mar 99 16:14:16
+ - (README.smux): Patch from Nick Amato:
+ - update.
+
+hardaker 4 Mar 99 16:26:26
+ - (freebsd2.h): Patch from Nick Amato:
+ - fixes for duplicate defines.
+
+hardaker 4 Mar 99 16:32:16
+ - (mib2c): Update from Dave Shield.
+
+hardaker 4 Mar 99 16:50:16
+ - (util_funcs.c, dummy.c, example.c, wombat.c, tcp.c, hpux.c,
+ memory.c, alarm.c, snmp_api.c):
+ - misc fixes, -Wall mostly.
+
+mslifcak 4 Mar 99 17:00:50
+
+ (sysORTable.c) - remove static u_long long_return, for consistency.
+
+mslifcak 4 Mar 99 17:07:10
+
+ (solaris.h) - undo _SLASH_PROC_METHOD_ : another time
+
+mslifcak 4 Mar 99 17:50:29
+
+ Replace uses of bzero with memset, bcopy with memcpy.
+ Fix prototypes.
+
+mslifcak 4 Mar 99 18:11:37
+
+ (snmp_api.c) - expose snmp_free; snmp_pdu_add_variable returns ptr to var for
+ future improved error recovery.
+
+mslifcak 5 Mar 99 09:40:11
+
+ Fix Win32 version of gettimeofday : tv_usec was millisecs , return now = 0
+
+hardaker 5 Mar 99 10:11:29
+ - (mib2c, mib2c.conf): Patch from Dave Shield:
+ - the use of 'header_simple_table' rather than 'checkmib'
+ - explicit comparison with MATCH_FAILED
+ - don't set defaults for 'write_method' and 'var_len'
+ (since both 'header_generic' and 'checkmib' do this anyway)
+ - Use defined constants for variable initialisation in the
+ write routine (similarly in the mib2c.conf patch)
+ [This is one of my hobby-horses with our students, so I don't
+ see why "professional" programmers should be exempt!]
+
+ - Make proper use of the three-phase nature of SETs
+
+hardaker 5 Mar 99 10:21:25
+ - (FAQ): update from Dave: rearranging and cleaning.
+
+hardaker 5 Mar 99 10:42:40
+ - (snmp_agent.c): Patch from Dave Shield:
+ - switch COMMIT and ACTION phases.
+
+mslifcak 5 Mar 99 11:02:34
+
+ (tcp.c) - break out of infinite loop when klookup fails.
+
+hardaker 5 Mar 99 15:13:02
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - remove persistent storage info, since its not used this release.
+
+hardaker 5 Mar 99 15:31:52
+ - (snmp_impl.h): create UNDO
+
+hardaker 5 Mar 99 15:38:32
+ - (tkmib): update.
+
+hardaker 5 Mar 99 15:57:36
+ - (kernel_sunos5.c, wombat.c, hr_network.c, snmp_mib.h, system_mib.h,
+ disk.h, errormib.h, extensible.h, file.h, memory_solaris2.h, pass.h,
+ proc.h, registry.h, versioninfo.h):
+ - -Wall fixes, mostly init_() routines declaired in the appropriate .h files.
+
+hardaker 5 Mar 99 16:02:06
+ - (configure, configure.in): updated --help's module list.
+
+hardaker 5 Mar 99 16:10:30
+ - (vmstat.h): declair init_vmstat().
+
+hardaker 5 Mar 99 17:08:21
+ - (FAQ): reference AGENT document.
+
+hardaker 5 Mar 99 17:11:48
+ - (mibII/system.h): removed
+
+hardaker 5 Mar 99 17:19:14
+ - (FAQ, NEWS): final updates.
+
+
+
+-------------------------------------------------------------------------------
+
+Changes: V3.5.2 -> V3.5.3
+
+hardaker 12 Sep 98 09:02:37
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - bug fix to check for NULL session pointer before using it.
+
+hardaker 20 Sep 98 11:47:17
+ - (snmp_agent.c): if a mib module returns an error > SNMP_GEN_ERR,
+ translate the error to SNMP_GEN_ERR for v1 requests.
+
+hardaker 21 Sep 98 11:13:19
+ - (snmp_vars.c): finally fixed the write_method's for creation problem.
+
+hardaker 25 Sep 98 16:53:31
+ - (EXAMPLE.conf.def): update.
+
+hardaker 25 Sep 98 17:02:39
+ - (configure, configure.in): perl eq -> test = (opps).
+
+hardaker 25 Sep 98 17:08:25
+ - (parse.c): Patch from Michael Slifcak:
+ - check for a null name.
+
+hardaker 25 Sep 98 17:42:10
+ - (parse.c): Patch from Joe Marzot:
+ - use a memset to zero out new pointers instead of doing it by hand.
+
+hardaker 28 Sep 98 13:09:06
+ - (interfaces.c): don't use a & on osf3 for arpcom.ac_enaddr.
+
+hardaker 28 Sep 98 13:09:45
+ - (snmp_api.c): typecast the default community string to (u_char *).
+
+hardaker 28 Sep 98 15:42:21
+ - (memory.c): /etc/swapinfo -> /usr/sbin/swapinfo for hpux10.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.5.1 -> V3.5.2
+
+hardaker 8 Sep 98 09:26:13
+ - (NEWS): update.
+
+hardaker 8 Sep 98 09:33:25
+ - (ChangeLog): update for 3.5.1.
+
+hardaker 8 Sep 98 09:35:55
+ version tag ( 3.5.1 )
+
+hardaker 9 Sep 98 09:45:24
+ - (Makefile.in): Put an @ sign in front of the last echo line.
+
+hardaker 9 Sep 98 09:46:35
+ - (memory.c, memory.h, memory_freebsd2.c, memory_freebsd2.h):
+ - Change all instances of USED -> AVAIL since thats really what
+ we're reporting.
+
+hardaker 9 Sep 98 09:50:22
+ - (memory.c, memory.h, memory_freebsd2.c, memory_freebsd2.h):
+ - correct work I stupidly made when tired.
+
+hardaker 9 Sep 98 11:00:44
+ - (NEWS): update for 3.5.2.
+
+marz 9 Sep 98 18:31:00
+ - (snmptrap.c, snmptest.c): add SOCK_ macros for win32 support
+
+-------------------------------------------------------------------------------
+
+Changes: V3.5 -> V3.5.1
+
+hardaker 22 Jun 98 09:16:32
+ - (main.c): Patch from Jerry G. DeLapp:
+ - commented out trailing #endif comment.
+
+hardaker 24 Jun 98 10:30:19
+ - (Makefile.in): man->html make specification.
+
+hardaker 24 Jun 98 11:08:41
+ - (UCD-SNMP-MIB.txt): Patch from Niels Baggesen:
+ - shutdown trap specifications.
+ - misc mib fixes.
+
+hardaker 26 Jun 98 10:42:32
+ - (disk.c): Patch from Michael Douglass:
+ - fix calculation of totaldisk by doing block division first to
+ protect against 32 bit overflows.
+
+hardaker 26 Jun 98 10:45:15
+ - (smux.c, snmp_bgp.c, snmp_ospf.c, snmp_rip2.c, snmp_rip2.h): Patch
+ from Niels Baggesen:
+ - Fix for new defines and proper header includes.
+
+hardaker 26 Jun 98 15:03:38
+ - (generic.h): put in a comment to keep compilers from complaining too much.
+
+hardaker 8 Jul 98 12:26:25
+ - (freebsd2.h): use _UTMP_PATH if available.
+
+hardaker 8 Jul 98 12:26:34
+ - (irix.h): define _KMEMUSER
+
+hardaker 8 Jul 98 12:27:12
+ - (win32.opt, libsnmp.dsp, libsnmp.plg, libsnmp.def, libsnmp_dll.plg,
+ snmpbulkwalk.dsp, snmpbulkwalk.plg, snmpget.dsp, snmpget.plg,
+ snmpgetnext.dsp, snmpgetnext.plg, snmpset.dsp, snmpset.plg,
+ snmpstatus.dsp, snmpstatus.plg, snmptranslate.dsp,
+ snmptranslate.plg, snmpwalk.dsp, snmpwalk.plg): Patch from Joe
+ Marzot:
+ - win32 update.
+
+hardaker 8 Jul 98 12:58:03
+ - (snmp_api.c): Patch from Joe Marzot:
+ - fix "number of retries" bug.
+ - remove odd timeout calculation code for retries > 3.
+hardaker 8 Jul 98 13:02:06
+ - (interfaces.c): make hp_interfaces structure static.
+
+hardaker 8 Jul 98 13:03:36
+ - (system.c): don't free env pointers that are created.
+
+hardaker 8 Jul 98 13:08:18
+ - (UCD-SNMP-MIB.txt): Patch from Niels Baggesen:
+ - fix for missing object identifier labels.
+
+hardaker 8 Jul 98 14:43:56
+ - (snmp_vars.c): include fixes.
+hardaker 8 Jul 98 14:44:34
+ - (pass.c): include sys/wait.h
+
+hardaker 8 Jul 98 14:44:41
+ - (versioninfo.c): include system.h
+
+hardaker 8 Jul 98 14:45:22
+ - (parse.c): include snmp_api.h
+
+hardaker 8 Jul 98 14:45:42
+ - (snmp_api.c): include fixes.
+
+hardaker 15 Jul 98 15:46:28
+ - (sedscript.in): using_module changes.
+
+hardaker 15 Jul 98 15:46:55
+ - (memory.h): MEMSWAPMINIMUM wasn't being used.
+
+hardaker 17 Jul 98 13:11:10
+ - (UCD-SNMP-MIB.inc, UCD-SNMP-MIB.txt):
+ - created smicng input file.
+ - fixed the UCD-SNMP mib to deal with most smic errors.
+
+hardaker 17 Jul 98 13:22:32
+ - (RFC-1215.txt): created an empty mib module for importing of TRAP-TYPE.
+
+hardaker 17 Jul 98 16:59:51
+ - (*): update for 3.5.1.
+
+hardaker 20 Jul 98 17:14:21
+ - (snmpcheck.def): work around for new multi-depth mib tables..
+
+hardaker 22 Jul 98 15:35:07
+ - (mib.c): don't change running environment variables with strtok.
+
+hardaker 22 Jul 98 16:23:45
+ - (Makefile.in, sedscript.in): fix sedscript includes.
+
+hardaker 24 Jul 98 09:25:33
+ - (disk.c): increment index by 1 so it doesn't start at 0.
+
+hardaker 24 Jul 98 10:02:14
+ - (snmpd.conf.5.def): various documenation updates and notes.
+
+hardaker 24 Jul 98 10:02:25
+ - (snmptranslate.1): nroff error.
+
+hardaker 24 Jul 98 10:25:44
+ - (snmptrapd.8): brought up to date.
+
+hardaker 24 Jul 98 12:10:07
+ - (snmp.c): include sys/select.h for AIX.
+
+hardaker 24 Jul 98 12:24:22
+ - (acl.h, asn1.h, md5.h, mib.h, parse.h, snmp.h, snmp_api.h,
+ snmp_client.h, snmp_impl.h, vacm.h, view.h):
+ - protect against multiple inclusions.
+
+hardaker 29 Jul 98 13:44:22
+ - (Makefile.in): make install should do a real make all first.
+
+hardaker 12 Aug 98 15:57:18
+ - (snmp_vars.c): ifdef fixes for v2part modules.
+
+hardaker 12 Aug 98 15:57:42
+ - (extensible.c, proc.c): fixit problems with array index wrong.
+
+hardaker 12 Aug 98 15:57:52
+ - (libsnmp.def): find_module added.
+
+hardaker 12 Aug 98 16:05:28
+ - (configure, configure.in):
+ - libwrap command line fixes.
+ - --with-ldflags command line option created.
+
+hardaker 12 Aug 98 16:55:32
+ - (mib_api.3, snmpd.1.def, variables.5): updates to remove mib.txt references.
+
+hardaker 12 Aug 98 16:58:11
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - don't include libraries that aren't needed if gethostbyname isn't in one.
+
+hardaker 12 Aug 98 16:59:50
+ - (snmp_impl.h): Patch from Michael Slifcak:
+ - fix the ERROR_MSG() macro to use snmp_set_detail.
+
+hardaker 14 Aug 98 08:21:44
+ - (snmp_parse_args.c, snmptranslate.c): usage fixes and -m/-M to snmptranslate.
+
+hardaker 14 Aug 98 08:42:49
+ - (auto_nlist.c): fix for stupid aix kernels.
+
+hardaker 14 Aug 98 08:44:07
+ - (ucd_snmp.h, memory_freebsd2.c, vmstat_freebsd2.c): Patch from Jonas Olsson:
+ - make the memory and vmstat module work under freebsd2.
+
+hardaker 14 Aug 98 08:44:07
+ file memory_freebsd2.c was initially added on branch Ext-3-5-patches.
+
+hardaker 14 Aug 98 08:44:07
+ file vmstat_freebsd2.c was initially added on branch Ext-3-5-patches.
+
+hardaker 14 Aug 98 08:44:29
+ - (README): Added two new names to the thankyou list.
+
+hardaker 14 Aug 98 08:44:37
+ - (sedscript.in): correct include files.
+
+hardaker 14 Aug 98 08:44:52
+ - (Makefile.in): CPP needs to check agent/mibgroup for headers.
+
+hardaker 14 Aug 98 08:52:32
+ - (mib.c, parse.c): Patch from Dave Shield:
+ - adopt unknown children into the correct place if IMPORTS are screwed up.
+
+hardaker 14 Aug 98 09:32:45
+ - (snmptranslate.c): Patch from James H. Young:
+ - usage output clean up.
+
+hardaker 14 Aug 98 10:13:13
+ - (COPYING): copyright change.
+
+hardaker 14 Aug 98 10:14:06
+ - (parse.c): Patch from Niels Baggesen:
+ - Malloc -> xmalloc.
+ - parser changes.
+
+hardaker 14 Aug 98 10:14:59
+ - (at.c): fixes for linux.
+
+hardaker 31 Aug 98 13:03:02
+ - (interfaces.c): missing return on ifInErrors results.
+
+hardaker 31 Aug 98 13:32:43
+ - (snmptrapd.c): add a blank line to the end of the trapd output for parsing.
+
+hardaker 31 Aug 98 16:10:25
+ - (snmp_vars.c): in_a_view(): create new function, and use it.
+
+hardaker 31 Aug 98 16:10:50
+ - (snmp_agent.c, snmp_impl.h): fix read/write checks.
+
+hardaker 31 Aug 98 13:03:02
+ - (interfaces.c): missing return on ifInErrors results.
+
+hardaker 31 Aug 98 13:32:43
+ - (snmptrapd.c): add a blank line to the end of the trapd output for parsing.
+
+hardaker 31 Aug 98 16:10:25
+ - (snmp_vars.c): in_a_view(): create new function, and use it.
+
+hardaker 31 Aug 98 16:10:50
+ - (snmp_agent.c, snmp_impl.h): fix read/write checks.
+
+hardaker 31 Aug 98 16:37:04
+ - (ChangeLog, NEWS): update for 3.5.1.
+
+hardaker 31 Aug 98 16:37:15
+ version tag ( 3.5.1.pre1 )
+
+hardaker 2 Sep 98 10:55:52
+ - (configure, configure.in, read_config.c, snmp2p.c, snmp_agent.c,
+ snmp_vars.c, snmpd.c, snmpd.h, util_funcs.c, interfaces.c, system.h,
+ tcp.c, smux.c, snmp_bgp.c, snmp_bgp.h, snmp_ospf.c, snmp_ospf.h,
+ snmp_rip2.c, snmp_rip2.h, extensible.c, loadave.c,
+ snmp_parse_args.c, snmpdelta.c, snmptranslate.c, snmptrap.c,
+ snmptrapd.c, inet.c, main.c, netstat.h, mib_api.3, snmp_api.3,
+ snmpd.1.def, freebsd.h, freebsd2.h, netbsd.h, asn1.h, mib.c,
+ parse.c, parse.h, snmp_api.c, snmp_api.h, snmp_client.c): Patch from
+ Niels Baggesen:
+ - prototypes, as usual (when is everybody starting to use -Wall
+ -Wstrict-prototypes ....)
+ - snmpd send an enterprise specific trap when it terminates
+ - possibility for sending v2c traps (or informs), via trap2sink directive
+ - fixes to snmplib and snmptrapd for bugs uncovered when snmpd sends
+ an INFORM instead of a TRAP
+ - -m and -M option for snmptrapd
+ - -D option for snmptranslate
+ - fixes to configure to correctly call ALL module init functions
+ - major rework of tcp.c, for netbsd. I hope this is OK now, I havent had
+ time to test it on all platforms yet - but till friday :-)
+ - snmpnetstat prints udp socket table
+ - some CMU_COMPATIBLE stuff
+ - man page fixes, with an include list that works!
+
+hardaker 2 Sep 98 10:58:10
+ - (tcp.c): Patch from Dave Shield:
+ - Combine the two (almost) identical non-solaris cases
+ - Add support for the missing Linux entries (InErrs/OutRsts)
+ - Add support for the missing Solaris entry (OutRsts)
+
+hardaker 2 Sep 98 11:03:33
+ - (tcp.c): reverse Dave's changes since they conflict with Niels'.
+
+hardaker 2 Sep 98 12:19:03
+ - (extensible.c, proc.c): use correct name index for lookups on writes.
+
+hardaker 2 Sep 98 12:19:33
+ - (snmp_agent.c): check to make sure operation is not a SET when
+ returning an error code such as noSuchName.
+
+hardaker 2 Sep 98 14:04:42
+ - (configure, configure.in): don't include modules not requested even
+ if required by another module.
+
+hardaker 2 Sep 98 14:10:53
+ version tag ( 3.5.1.pre2 )
+
+hardaker 2 Sep 98 18:43:30
+ - (TODO): added security checks.
+
+nba 3 Sep 98 14:29:03
+ - (fixproc): added comment to test CVS.
+
+hardaker 4 Sep 98 10:09:47
+ - (interfaces.c): fix for sgi's.
+
+hardaker 4 Sep 98 14:14:19
+ - (configure, configure.in, Makefile.in, Makefile.in):
+ - fix to allow non-source directory builds.
+
+hardaker 7 Sep 98 10:10:05
+ - (loadave.c): Patch from Niels Baggesen:
+ - ifdef re-ordering fixes for alpha/linux.
+
+hardaker 7 Sep 98 10:47:00
+ - (proc.c): Patch from Michael Slifcak:
+ - solaris 2.6 fixes.
+
+hardaker 7 Sep 98 10:48:09
+ - (asn1.c): Patch from Michael Slifcak:
+ - Catch subidentifier correctly.
+
+hardaker 7 Sep 98 10:49:08
+ - (asn1.h): remove __P() definition.
+
+hardaker 7 Sep 98 10:49:53
+ - (mib.c): Patch from Michael Slifcak:
+ - malloc corrections for ENV vars..
+
+hardaker 7 Sep 98 10:51:22
+ - (parse.c): Patch from Michael Slifcak:
+ - protect against multiple init_mib_internal() calls.
+
+hardaker 7 Sep 98 10:53:11
+ - (system.c): Patch from Michael Slifcak:
+ - exit -> return on win32 system routines.
+
+hardaker 7 Sep 98 10:55:51
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - NULL return by malloc protected.
+
+hardaker 7 Sep 98 12:17:36
+ - (snmpd.conf.5.def): Patch from Niels Baggesen:
+ - better description of the view mask.
+
+hardaker 7 Sep 98 12:27:42
+ - (memory_freebsd2.h, vmstat_freebsd2.h): created from memory.h and vmstat.h
+
+hardaker 7 Sep 98 12:27:42
+ file memory_freebsd2.h was initially added on branch Ext-3-5-patches.
+
+hardaker 7 Sep 98 12:27:42
+ file vmstat_freebsd2.h was initially added on branch Ext-3-5-patches.
+
+hardaker 7 Sep 98 12:47:37
+ - (parse.c): include snmp_api.h for snmp_get_do_debugging().
+
+hardaker 7 Sep 98 12:54:16
+ - (snmp_api.c): Patch from Michael Slifcak:
+ - check malloc calls more carefully.
+ - misc bug fixes.
+
+hardaker 7 Sep 98 13:15:26
+ - (Makefile.in): install config.h as $(includedir)/ucd-snmp-config.h.
+
+hardaker 7 Sep 98 13:21:18
+ - (memory.c, memory.h):
+ - MEMUSEDREAL -> MEMAVAILREAL (typedef renaming to match functionality).
+
+hardaker 7 Sep 98 14:06:21
+ - (tcp.c): back out Niels' changes since they broke other architectures.
+
+hardaker 7 Sep 98 14:19:24
+ - (Makefile.in(s)): make depends.
+
+hardaker 7 Sep 98 16:39:59
+ - (icmp.c, interfaces.c, ip.c, tcp.c): 64bit long return clean ups.
+
+marz 7 Sep 98 19:01:01
+ update headers for win32, add return to main
+
+marz 7 Sep 98 19:02:01
+ update headers for win32, add return to main,fix win32 compile error w/ non integralswitch case
+
+marz 7 Sep 98 19:03:33
+ update headers for win32, add return to main, resolve conflict w/ std lib log function
+
+marz 7 Sep 98 19:30:11
+ rename and static link debug targets, dll to bin dir, added snmptest, snmptrap, snmpdelta projects
+
+marz 7 Sep 98 19:42:35
+ file snmpdelta.dsp was initially added on branch Ext-3-5-patches.
+
+marz 7 Sep 98 19:42:35
+ file snmpdelta.plg was initially added on branch Ext-3-5-patches.
+
+marz 7 Sep 98 19:42:35
+ file snmptest.dsp was initially added on branch Ext-3-5-patches.
+
+marz 7 Sep 98 19:42:35
+ file snmptest.plg was initially added on branch Ext-3-5-patches.
+
+marz 7 Sep 98 19:42:35
+ file snmptrap.dsp was initially added on branch Ext-3-5-patches.
+
+marz 7 Sep 98 19:42:35
+ file snmptrap.plg was initially added on branch Ext-3-5-patches.
+
+marz 7 Sep 98 19:42:35
+ rename and static link debug targets, dll to bin dir, added snmptest, snmptrap, snmpdelta projects
+
+hardaker 8 Sep 98 09:26:13
+ - (NEWS): update.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.4 -> V3.5
+
+hardaker 24 May 98 15:22:21
+ - (FAQ): update to change a few things.
+
+hardaker 24 May 98 15:22:38
+ - (NEWS): change vacm news wording.
+
+hardaker 24 May 98 15:22:57
+ - (ip.c): Patch from Niels Baggesen:
+ - fix for netbsd < 1.3.
+
+hardaker 29 May 98 10:14:32
+ - (at.c): Patch from Chris Smith: fix for irix.
+
+hardaker 29 May 98 10:24:54
+ - (snmp_api.c, snmp_impl.h): Patch from Joe Marzot:
+ - fix community name length problems and increase size.
+
+hardaker 29 May 98 11:26:47
+ - (configure.in): patch from Niels: include sys/socket in if_mtu test.
+
+hardaker 29 May 98 11:27:59
+ - (configure): make of configure.
+
+hardaker 29 May 98 11:34:53
+ - (configure, configure.in, Makefile.in):
+ - Add a dependancy line for snmp_vars.o for all the module includes.
+
+hardaker 29 May 98 15:20:53
+ - (TODO): winSNMP mention.
+
+hardaker 29 May 98 15:21:13
+ - (snmp_parse_args.c): add ability to specify mib information on the cmd line.
+
+hardaker 29 May 98 16:21:08
+ - (configure, configure.in, agent/mibgroup/*):
+ - moved most mibgroup pieces into relevent sub-directories.
+ - changed all header file and #ifdef USING_* lines to reflect this.
+
+hardaker 29 May 98 16:21:51
+ - (snmp_impl.h): change pdu version from long to int.
+
+hardaker 31 May 98 17:55:45
+ - (asn1.c, asn1.h, int64.c, int64.h, mib.c, snmp.c, snmp_api.c,
+ snmp_api.h, snmp_impl.h):
+ - implement special data types via opaques: float, double, int64, uint64s.
+
+hardaker 31 May 98 17:56:07
+ - (snmpset.c): enable setting of opaque floats, doubles, int64s, uint64s.
+
+hardaker 31 May 98 17:56:55
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - make it possible not to use opaque special types with new cmd line flag.
+
+hardaker 2 Jun 98 14:23:15
+ - (auto_nlist.c, auto_nlist.h, kernel.c, snmp_agent.c, snmpd.c,
+ hr_device.c, hr_disk.c, hr_filesys.c, hr_network.c, hr_other.c,
+ hr_partition.c, hr_print.c, hr_proc.c, hr_storage.c, hr_swinst.c,
+ hr_swrun.c, hr_system.c, hr_utils.c, at.c, interfaces.c,
+ var_route.c, snmp_parse_args.c, snmpdelta.c, snmptable.c,
+ snmptranslate.c, snmptrapd.c, freebsd2.h, hpux.h, linux.h, netbsd.h,
+ solaris.h, sysv.h, asn1.c, mib.c, parse.c, parse.h, snmp_auth.c,
+ snmp_impl.h): Patch from Niels Baggensen:
+ - make host resources work under NetBSD, FreeBSD, Solaris and Linux.
+ - SunOS4 almost works.
+ - Add -s/-S to command line options for printing of shorter oids.
+ - numerous bug fixes.
+
+hardaker 3 Jun 98 10:51:10
+ - (smux.c, smux.h, smux_gated.h, snmp_bgp.c, snmp_bgp.h, snmp_ospf.c,
+ snmp_ospf.h, snmp_rip2.c, snmp_rip2.h, smux.c, smux.h, snmp_bgp.c,
+ snmp_bgp.h, snmp_ospf.c, snmp_ospf.h, snmp_rip2.c, snmp_rip2.h):
+ - moved smux stuff into a smux sub-directory.
+
+hardaker 3 Jun 98 10:58:15
+ - (ipfwacc.c, ipfwacc.h, IPFWACC-MIB.txt, UCD-SNMP-MIB.txt):
+ - moved ipfwacc to ucdavis.13 and removed ^Ms and some blank lines.
+
+hardaker 3 Jun 98 10:58:44
+ - (INSTALL): mention ipfwacc
+
+hardaker 3 Jun 98 10:58:59
+ - (README): mention Cristian Estan in the coders list.
+
+hardaker 3 Jun 98 11:06:47
+ - (example.c, example.h, dlmod.c, dlmod.h): Patch from Eugene Polovnikov:
+ - implement a dynamic loading module for loading shared object mib modules.
+
+hardaker 3 Jun 98 11:10:48
+ - (README, example.c, example.h, wombat.c, wombat.h, example.c,
+ example.h, wombat.c, wombat.h):
+ - moved wombat and example to examples/ directory.
+
+hardaker 3 Jun 98 11:27:27
+ - (snmp_agent.c, snmpd.c): include mibII/snmp_mib.h.
+
+hardaker 3 Jun 98 11:29:04
+ - (mib.c): missed a needed OPAQUE_SPECIAL_TYPES ifdef.
+
+hardaker 3 Jun 98 12:17:00
+ - (snmp_agent.c, snmp_api.c, snmp_auth.c, snmp_impl.h):
+ - fix pdu->versions to be all ints.
+
+hardaker 3 Jun 98 13:39:12
+ - (configure, configure.in): New flags:
+ - --with-cc=CC
+ - --with-cflags=CFLAGS
+
+hardaker 3 Jun 98 13:43:47
+ - (config.h.in, configure, configure.in, snmptrapd.c):
+ - check for getdtablesize and use a generic if not available.
+
+hardaker 3 Jun 98 13:52:28
+ - (config.h.in, configure, configure.in, freebsd2.h):
+ - move configurable defines to configure rather than in freebsd2.h.
+
+hardaker 3 Jun 98 13:55:40
+ - (i386.h, i586.h, i686.h): removed these (unused) headers.
+
+hardaker 3 Jun 98 14:02:34
+ - (configure, configure.in): fix new --with-cc and --with-cflags arguments.
+
+hardaker 3 Jun 98 14:21:10
+ - (hr_disk.c, hr_swinst.c, hr_swrun.c, hr_system.c, snmpset.c, asn1.h,
+ int64.c, int64.h, mib.c, snmp_api.c):
+ - -Wall fixes.
+
+hardaker 3 Jun 98 14:23:14
+ - (Makefile.in's): make depend.
+
+hardaker 3 Jun 98 14:24:58
+ - (Makefile.in): read_config.o is mibmodule header dependant too.
+
+hardaker 3 Jun 98 14:26:10
+ version tag ( 3.5.pre1 )
+
+hardaker 5 Jun 98 10:52:11
+ - (configure, configure.in): Patch from Niels Baggesen:
+ - test for setenv.
+
+hardaker 5 Jun 98 10:52:40
+ - (maketarget): Patch from Niels Baggesen:
+ - support for larger tree depths.
+
+hardaker 5 Jun 98 10:54:31
+ - (asn1.c, mib.c, parse.h, system.c, system.h): Patch from Niels Baggesen:
+ - MIB_ACCESS define changes.
+ - setenv implementation.
+ - ifdef wrappers for OPAQUE_SPECIAL_TYPES.
+
+hardaker 8 Jun 98 10:50:12
+ - (FAQ): url type splitting.
+
+hardaker 8 Jun 98 12:34:09
+ - (Makefile.in): create a .c -> .o rule to make sure and place the
+ object files in the appropriate subdirectories.
+
+hardaker 8 Jun 98 13:59:08
+ - (README): Added Eugene's name.
+
+hardaker 8 Jun 98 13:59:25
+ - (snmpd.conf.5.def): update rfc # for vacm reference.
+
+hardaker 8 Jun 98 14:12:37
+ - (Makefile.in): Patch from Joe Marzot:
+ - remove more config created headers on make configclean.
+
+hardaker 8 Jun 98 14:16:26
+ - (libsnmp.def): Patch from Joe Marzot: w32 update.
+
+hardaker 8 Jun 98 14:22:50
+ - (parse.c, parse.h, snmp_api.c, snmp_api.h, snmp_client.c): Patch
+ from Joe Marzot:
+ - async stuff added.
+ - get_tc added.
+ - better comments in some places.
+
+hardaker 8 Jun 98 14:55:53
+ - (snmp_api.c): undid redo of comment of gettimeofday().
+
+hardaker 10 Jun 98 07:11:44
+ - (config.h.in): have_setenv.
+
+hardaker 10 Jun 98 08:53:53
+ - (Makefile.in, snmp2p.c, snmpd.c): Patch from Dave Shield:
+ - starts to separate out the historic SNMPv2 stuff.
+ - does a bit of 'code tidying'.
+ - starts to move towards port-specific handlers.
+
+hardaker 10 Jun 98 14:15:47
+ version tag ( 3.5.pre2 )
+
+hardaker 10 Jun 98 15:30:59
+ - (TODO): added Dave's list.
+
+hardaker 10 Jun 98 15:31:12
+ - (NEWS): update.
+
+hardaker 10 Jun 98 15:47:59
+ - (snmp2p.c, snmpd.c, snmpd.h): -Wall cleanups.
+
+hardaker 12 Jun 98 08:52:28
+ - (EXAMPLE.conf.def, FAQ): Patch from Dave Shield:
+ - update for VACM stuff.
+
+hardaker 12 Jun 98 10:12:27
+ - (EXAMPLE.conf.def): show vacm example for public/private from anywhere.
+
+hardaker 12 Jun 98 10:12:40
+ - (NEWS): minor update.
+
+hardaker 12 Jun 98 13:13:12
+ - (snmp_api.c): trap types were int's not longs (failed under 64bit arch).
+
+hardaker 12 Jun 98 13:13:27
+ - (parse.c): function name typo.
+
+hardaker 12 Jun 98 13:13:39
+ - (win32/config.h): don't have setenv.
+
+hardaker 12 Jun 98 13:13:57
+ - (libsnmp.def): add setenv to the list.
+
+hardaker 12 Jun 98 13:43:41
+ - (NEWS): 64bit fix mentioned.
+
+hardaker 12 Jun 98 13:48:21
+ - (kernel.c): don't print klread errors unless in debugging mode.
+
+hardaker 12 Jun 98 15:17:47
+ - (ipfwacc.h, IPFWACC-MIB.txt, UCD-SNMP-MIB.txt):
+ - create and use a ucdExperimental section for the ipfwacc mib till
+ it stabilizes.
+
+hardaker 17 Jun 98 08:08:23
+ - (snmp2p.c, snmpd.c, snmpd.h): Patch from Niels Baggesen:
+ - misc type fixes.
+
+hardaker 17 Jun 98 08:08:58
+ - (snmpdelta.c): usage() update.
+
+hardaker 17 Jun 98 08:10:02
+ - (Makefile.in, snmpbulkwalk.1, snmpcmd.1, snmpdelta.1, snmpget.1,
+ snmpgetnext.1, snmpset.1, snmpstatus.1, snmptable.1, snmptrap.1,
+ snmpwalk.1): Patch from Niels Baggesen:
+ - documentation cleanup and centralization of common options.
+
+hardaker 17 Jun 98 08:10:54
+ - (asn1.c): Patch from Niels Baggesen:
+ - bcopy -> memcpy.
+
+hardaker 17 Jun 98 08:11:22
+ - (mib.h): Patch from Niels Baggesen:
+ - remove 2nd init_mib() prototype.
+
+hardaker 17 Jun 98 08:21:53
+ - (README, AddModuleForDummies.txt, DUMMY-MIB.txt, dummy.c, dummy.h):
+ Patch from Jakob Ellerstedt:
+ - mib module documentation and example for dummies.
+
+hardaker 17 Jun 98 15:27:13
+ - (README): mention dummy group.
+
+hardaker 19 Jun 98 08:41:00
+ - (FAQ): update from Dave Shield: not found modules with configure?.
+
+hardaker 19 Jun 98 08:46:31
+ - (configure, configure.in): warn BSDI users against /usr/ucb/cc.
+
+hardaker 19 Jun 98 08:58:05
+ - (EXAMPLE.conf.def): Patch from Cristian Estan:
+ - example output corrections.
+
+hardaker 19 Jun 98 08:59:53
+ - (Makefile.in): Patch from Cristian Estan:
+ - install IPFWACC mib.
+
+hardaker 19 Jun 98 12:03:48
+ - (snmp_vars.c): fix register_mib() to init pointers to null.
+
+hardaker 19 Jun 98 12:50:55
+ - (util_funcs.c): fix checkmib() in case we get called on a get when
+ we really shouldn't (bad artifact of new tree structure).
+
+hardaker 19 Jun 98 12:53:22
+ - (snmp_vars.c): memset to 0 the entire subtree struct.
+
+hardaker 19 Jun 98 13:01:47
+ - (Makefile.in): make depend.
+
+hardaker 19 Jun 98 13:12:55
+ - (NEWS): Last update for 3.5.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.3 -> V3.4
+
+hardaker 1 Dec 97 12:44:24
+ - (*): 3.3.1 branch merged into main development branch.
+
+hardaker 5 Dec 97 08:46:50
+ - (snmp_api.h): Patch from Niels Baggesen:
+ - make trap variables long's not ints for 64bit machines to match
+ asn_build_int functions.
+
+hardaker 5 Dec 97 11:58:52
+ - (apps/*.c): support random access requests on all apps via -R switch.
+
+hardaker 5 Dec 97 14:30:06
+ - (configure, configure.in): warn instead of error for config_require macro's.
+
+hardaker 15 Dec 97 11:08:01
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - new macro to change default MIBS when modules are compiled:
+ config_add_mib().
+
+hardaker 15 Dec 97 11:08:19
+ - (host.h, ucd_snmp.h, v2party.h):
+ - use config_add_mib().
+
+hardaker 15 Dec 97 11:14:18
+ - (at.c, example.c, hr_proc.c, hr_storage.c, hr_swrun.c, hr_system.c,
+ icmp.c, interfaces.c, interfaces.h, ip.c, loadave.c, memory.c,
+ route_write.c, tcp.c, udp.c, var_route.c, wombat.c, common_header.h):
+ - Patch from Simon Leinen to improve irix 6.2 support.
+
+hardaker 15 Dec 97 15:07:26
+ - (UCD-fields, oid_to_sym.in, oid_to_type.in): Patch from TANAKA Takashi:
+ - support more OS types in the ov/ directory files.
+ - mistake: bsdi was getting defined as irix.
+ - don't core dump on -v without any arguments.
+
+hardaker 15 Dec 97 15:07:59
+ - (UCD-fields, oid_to_sym.in, oid_to_type.in, snmp_parse_args.c, acconfig.h):
+ - Patch from TANAKA Takashi:
+ - support more OS types in the ov/ directory files.
+ - mistake: bsdi was getting defined as irix.
+ - don't core dump on -v without any arguments.
+
+hardaker 23 Dec 97 11:20:04
+ - (hr_swrun.c): Correct a non-casted malloc.
+
+hardaker 23 Dec 97 11:33:59
+ - (hr_filesys.c): Solaris specific fixes.
+
+hardaker 23 Dec 97 11:35:26
+ - (acconfig.h, config.h.in, sedscript.in): BSDI definition fixes.
+
+hardaker 23 Dec 97 11:41:49
+ - (config.h.in, configure, configure.in): Patch from Johannes Grosen:
+ - fix non-existent nlist.h problems under linux redhat 5.0.
+
+hardaker 23 Dec 97 11:42:28
+ - (mibgroup/*.c, common_header.h): Patch from Johannes Grosen:
+ - fix non-existent nlist.h problems under linux redhat 5.0.
+
+hardaker 23 Dec 97 11:42:39
+ - (snmptrap.c): Patch from Johannes Grosen:
+ - fix non-existent nlist.h problems under linux redhat 5.0.
+
+hardaker 23 Dec 97 11:42:54
+ - (snmplib/system.c): Patch from Johannes Grosen:
+ - fix non-existent nlist.h problems under linux redhat 5.0.
+
+hardaker 23 Dec 97 11:46:08
+ - (hpux.c): #ifdef'ed out unused writeHP function.
+
+hardaker 23 Dec 97 12:32:21
+ - (snmptrapd.c): Patch from Ted Rule:
+ - Use syslog option LOG_PID on startup.
+ - fork if syslog enabled.
+ - Enable logging to other syslog facilities.
+ - print all trap data to a single syslog line.
+
+hardaker 23 Dec 97 12:48:31
+ - (snmptrapd.c):
+ - Change -f flag to -l and make -f no-fork.
+ - fix patch which munged ability to generate both -P and -s simultaneously.
+
+hardaker 23 Dec 97 14:40:36
+ - (README): Add Ted Rule to coders list.
+
+hardaker 23 Dec 97 14:42:47
+ - (*): Turn all debugging routines into library calls that can be
+ turned on and off at run time.
+ - DEBUGP() is now a typical printf style function and is used everywhere.
+ - void snmp_set_do_debugging(int).
+ - int snmp_get_do_debugging().
+
+hardaker 23 Dec 97 14:44:38
+ - (snmpd.1.def, snmptrapd.8): debugging flag additions.
+
+hardaker 23 Dec 97 14:47:08
+ - (at.c, icmp.c, interfaces.c, ip.c, snmp_mib.c, system.c, tcp.c, udp.c):
+ - Patch from Dave Shield to break up common_header.h.
+
+hardaker 23 Dec 97 15:27:54
+ - (at.c, at.h, host_res.h, icmp.h, interfaces.c, interfaces.h, ip.h,
+ tcp.c, tcp.h, udp.c, udp.h, read_config.c, snmp_vars.c):
+ - clean up required headers for linux.
+
+hardaker 23 Dec 97 15:56:18
+ - (versioninfo.c, versioninfo.h): Create a mib variable to set/report
+ if debugging is on or off.
+
+hardaker 23 Dec 97 15:59:03
+ - (UCD-SNMP-MIB.txt): Create a mib variable to set/report if debugging
+ is on or off.
+
+hardaker 23 Dec 97 16:30:47
+ version tag ( 3.4.pre1 )
+
+hardaker 29 Dec 97 09:37:06
+ - (tkmib): First implementation.
+
+hardaker 30 Dec 97 14:00:03
+ - (tkmib):
+ - new command: table to display snmptables as a table.
+ - misc...
+
+hardaker 30 Dec 97 17:01:57
+ - (tkmib): Create a graphing widget.
+
+hardaker 5 Jan 98 13:27:38
+ - (mib_api.3): change "all" to "ALL".
+
+hardaker 5 Jan 98 13:28:00
+ - (mib.c, parse.c, parse.h): add a find_module() routine.
+
+hardaker 5 Jan 98 13:28:22
+ - (snmptranslate.c): put init_mib back in place (opps).
+
+hardaker 5 Jan 98 13:28:42
+ - (TODO): snmpv3
+
+hardaker 5 Jan 98 16:29:39
+ - (asn1.c): Patch from Niels Baggesen:
+ - fix asn1_build_objid.
+
+hardaker 5 Jan 98 17:33:07
+ - (parse.c): swap args to merge_anon_children().
+
+hardaker 12 Jan 98 09:14:54
+ - (parse.c): Patch from Dave Shield: fix anon_children invalid memory access.
+
+hardaker 12 Jan 98 09:18:50
+ - (mib_api.3, snmp_api.3): Patch from Niels Baggesen:
+ - doc update to reflect moved headers.
+
+hardaker 12 Jan 98 09:19:10
+ - (Makefile.in): Patch from Niels Baggesen: link directly to lib.
+
+hardaker 12 Jan 98 09:19:47
+ - (Makefile.in, snmpbulkwalk.c, snmpdelta.c, snmpget.c, snmpgetnext.c,
+ snmpset.c, snmpstatus.c, snmptable.c, snmptest.c, snmptrap.c,
+ snmptrapd.c, snmpwalk.c): Patch from Niels Baggesen:
+ - remove unused headers.
+ - snmp_perror changes.
+
+hardaker 12 Jan 98 09:21:56
+ - (alarm.c, at.c, context_vars.c, event.c, hr_device.c, hr_filesys.c,
+ hr_partition.c, hr_storage.c, hr_swinst.c, hr_swrun.c, icmp.c,
+ interfaces.c, ip.c, proc.c, system.c, tcp.c, udp.c, var_route.c):
+ Patch from Niels Baggesen:
+ - Fix headers for FreeBSD and NetBSD.
+
+hardaker 12 Jan 98 09:40:36
+ - (FAQ, INSTALL, Makefile.in): Patch from Niels Baggesen:
+ - Documentation update to fix paths from recent changes.
+
+hardaker 12 Jan 98 09:41:38
+ - (read_config.c, snmp_vars.c, snmpd.c): Patch from Niels Baggesen:
+ - header fixes.
+ - snmp_perror usage.
+
+hardaker 12 Jan 98 09:44:51
+ - (asn1.c, mib.c, snmp_api.h, snmp_impl.h, system.h): Patch from Niels
+ Baggesen:
+ - header changes and boolean check corrections.
+
+hardaker 12 Jan 98 09:51:27
+ - (parse.c): Undid anon-children change.
+
+hardaker 12 Jan 98 09:56:14
+ - (kernel_sunos5.c): Patch from Niels Baggesen:
+ - increase buffer size to increase max interfaces reported on Solaris.
+
+hardaker 16 Jan 98 09:44:56
+ - (snmpd.c): Patch from Sheshadri Yagati:
+ - signal a trap (2) when the agent is shut down.
+
+hardaker 21 Jan 98 11:08:39
+ - (COPYING): update.
+
+hardaker 21 Jan 98 11:12:01
+ - (*/Makefile.in, Makefile.top, acconfig.h, config.h.in, configure,
+ configure.in):
+ - begin support for creating and using shared libraries.
+ - all Makefiles now include a Makefile.top for easier future global changes.
+
+hardaker 21 Jan 98 11:12:22
+ - (read_config.c, snmp_agent.c, snmp_vars.c, snmpd.c):
+ - include struct.h explicitly.
+
+hardaker 21 Jan 98 11:12:34
+ - (disk.c, errormib.c, extensible.c, interfaces.c, loadave.c,
+ memory.c, pass.c, proc.c, system.c, util_funcs.c, var_route.c,
+ versioninfo.c):
+ - include struct.h explicitly.
+
+hardaker 21 Jan 98 17:33:24
+ - (Makefile.top, configure, configure.in, */Makefile.in):
+ - Do a better version of shlib support. Should be useable now at least.
+
+hardaker 21 Jan 98 22:05:44
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - create m/ and s/ directories and use them for supplemental config
+ include files based on the config.guess output.
+
+hardaker 23 Jan 98 08:30:35
+ - (memory.c): Patch from Niels Baggesen:
+ - don't close file descriptor in linux's FILE_TO_BUF macro.
+
+hardaker 23 Jan 98 11:19:12
+ - (generic.h, i386.h, i586.h, i686.h): m/*.h file beginnings.
+
+hardaker 23 Jan 98 11:19:33
+ - (bsd.h, generic.h, linux.h, sysv.h): s/* beginnings.
+
+hardaker 23 Jan 98 16:12:02
+ - (read_config.c, read_config.h, snmp_vars.c, snmp_vars.h,
+ extensible.c, pass.c):
+ - create new functions:
+ - register_subtree()
+ - register_mib()
+ - unregister_mib().
+ - get rid of read_config special stuff for extensibility and put it
+ in their own submodules which now call register_mib().
+
+hardaker 23 Jan 98 16:14:20
+ - (registry.[ch], UCD-SNMP-MIB.txt):
+ - create a new table at ucdavis.103 to display registered mibs.
+
+hardaker 23 Jan 98 16:15:05
+ - (at.c, disk.c, host_res.h, hr_other.h, icmp.c, interfaces.c, ip.c,
+ snmp_mib.c, system.c, tcp.c, ucd_snmp.h, udp.c, versioninfo.c):
+ - #include "snmp_api.h"
+
+hardaker 23 Jan 98 16:34:43
+ - (configure, configure.in, snmp_vars.c, snmp_vars.h, var_struct.h,
+ extensible.c, pass.c, registry.c, registry.h, UCD-SNMP-MIB.txt):
+ - make the mib registry record and display a mib module name as well.
+
+hardaker 30 Jan 98 08:57:54
+ - (configure, configure.in): test for 'ps aux' (redhat 5.0).
+
+hardaker 30 Jan 98 09:01:06
+ - (UCD-SNMP-MIB.txt, memory.c, memory.h): Patch from Luuk de Boer:
+ - report cached, buffer, and shared statistics for linux.
+
+hardaker 30 Jan 98 09:24:19
+ - (read_config.c, snmp_vars.c, var_struct.h): Patch from Dave Shield:
+ - new subtree structure system.
+
+hardaker 30 Jan 98 10:40:26
+ - (pass.c): put pass_comapre here.
+
+hardaker 30 Jan 98 10:41:53
+ - (read_config.c, snmp_vars.c, snmp_vars.h, var_struct.h):
+ - merge Dave's code with mine. Still a few bugs to work through.
+
+hardaker 30 Jan 98 10:42:17
+ - (registry.c, registry.h): begin munging for new hierarchy.
+
+hardaker 30 Jan 98 10:43:28
+ - (UCD-SNMP-MIB.txt): change module indexing to use oid instead of a numeric.
+
+hardaker 30 Jan 98 10:49:59
+ - (disk.c, host_res.h, pass.c, registry.c, snmp_mib.c, system.c,
+ versioninfo.c, snmp_api.h):
+ - include netinet/in.h for address structure.
+
+hardaker 30 Jan 98 10:55:20
+ version tag ( 3.4.pre2 )
+
+hardaker 30 Jan 98 13:49:56
+ - (README): I can't really have forgotten Simon's name in the list
+ could I?
+
+hardaker 30 Jan 98 13:50:28
+ - (aclocal.m4, configure): define ifnet for linux.
+
+hardaker 30 Jan 98 14:31:58
+ - (acconfig.h, config.h.in, configure, configure.in): check for if_speed.
+
+hardaker 30 Jan 98 14:32:13
+ - (interfaces.c): finish linux problems and use if_speed.
+
+hardaker 30 Jan 98 15:25:02
+ - (snmp_parse_args.c, snmptrap.c): fix default port for snmptrap.
+
+hardaker 2 Feb 98 08:57:41
+ - (configure, configure.in): Patch from John Hawkinson:
+ - fix typo in configure for shared library extension w/o shared libraries.
+
+hardaker 6 Feb 98 13:29:40
+ - (at.c, icmp.c, interfaces.c, ip.c, tcp.c, udp.c): protect against nlist.h
+
+hardaker 6 Feb 98 13:44:44
+ - (hr_disk.c): close() got caught inside an else it shouldn't have due
+ to an ifdef error.
+
+hardaker 6 Feb 98 17:10:53
+ - (Makefile.in, acconfig.h, config.h.in, configure, configure.in,
+ auto_nlist.c, auto_nlist.h, autonlist.h, kernel.c, snmp_vars.c, ip.c):
+ - created a new auto_nlist function and use it in ip.c.
+
+hardaker 6 Feb 98 17:11:25
+ - (generic.h, hpux.h, irix.h, linux.h, solaris.h):
+ - update for auto_nlist symbols.
+
+hardaker 9 Feb 98 11:03:02
+ - (at.c, disk.c, errormib.c, extensible.c, hpux.c, hr_proc.c,
+ hr_storage.c, hr_swrun.c, hr_system.c, icmp.c, interfaces.c, ip.c,
+ kernel_sunos5.c, loadave.c, memory.c, proc.c, tcp.c, udp.c,
+ var_route.c):
+ - use auto_nlist.
+
+hardaker 9 Feb 98 11:03:17
+ - (auto_nlist.h): prototype wrapper.
+
+hardaker 9 Feb 98 11:03:56
+ - (configure, configure.in):
+ - changed --with-shared-libraries to --enable-shared to match other pkgs.
+ - display arguments found for --enable-shared.
+
+hardaker 9 Feb 98 11:04:31
+ - (bsd.h, bsdi.h, freebsd.h, freebsd3.h, generic.h, hpux.h, netbsd.h,
+ solaris.h):
+ - define symbols for auto_nlist to use.
+
+hardaker 9 Feb 98 11:06:53
+ - (snmp_vars.c): Patch from Dave Shield:
+ - fix prototypes on my broken table walking routines.
+
+hardaker 9 Feb 98 11:17:52
+ version tag ( 3.4.pre3 )
+
+hardaker 9 Feb 98 11:18:45
+ - (configure.in): check for ioctls.h
+
+hardaker 9 Feb 98 11:18:59
+ - (interfaces.c): include ioctls.h if available.
+
+hardaker 9 Feb 98 11:20:00
+ - (config.h.in, configure): check for ioctls.h.
+
+hardaker 11 Feb 98 09:19:33
+ - (generic.h, auto_nlist.c, at.c, hr_proc.c, hr_storage.c, memory.c,
+ tcp.c, udp.c, var_route.c): Patch from Dave Shield:
+ - fix all my typos ;-).
+ - create auto_nlist_value to return the looked-up value.
+
+hardaker 11 Feb 98 09:28:09
+ - (configure, configure.in):
+ - ps aux should define aux not -aux.
+
+hardaker 11 Feb 98 09:28:33
+ - (host_res.h): Patch from Dave Shield:
+ - don't include config.h
+
+hardaker 11 Feb 98 09:28:44
+ - (hr_network.c): Patch from Dave Shield:
+ - solaris fixes.
+
+hardaker 11 Feb 98 09:29:06
+ - (solaris.h): Patch from Dave Shield:
+ - undef IP_FORWARDING_SYMBOL before defining it.
+
+hardaker 11 Feb 98 16:44:13
+ - (configure, configure.in): sed doesn't like [a-z]+ type expressions.
+
+hardaker 13 Feb 98 09:07:31
+ - (FAQ): typo: authtrapsenable -> authtrapenable.
+
+hardaker 17 Feb 98 09:50:43
+ - (snmp_api.c, snmp_api.h):
+ - use snmp_ipaddr instead of ipaddr to avoid hpux conflicts.
+
+hardaker 17 Feb 98 09:53:12
+ - (auto_nlist.c, autonlist.h, snmp_vars.c):
+ - use appropriate mallocs, and NULL initialization of pointers.
+ - malloc the symbol rather than using a fixed length.
+ - insert debugging code.
+ - enable printing of the nlist tree if TESTING is defined.
+
+hardaker 17 Feb 98 09:54:01
+ - (tcp.c, udp.c):
+ - nlist symbol name errors.
+
+hardaker 18 Feb 98 08:06:00
+ - (EXAMPLE.conf.def, vmstat.c, vmstat.h, ucd_snmp.h,
+ UCD-SNMP-MIB.txt): Patch from Luuk de Boer:
+ - implment a vmstat mib group on linux.
+
+hardaker 18 Feb 98 08:15:56
+ - (config.h.in, configure, configure.in): Patch from Simon Leinen:
+ - check for sys/sysmp.h.
+
+hardaker 18 Feb 98 08:16:21
+ - (auto_nlist.c): Patch from Simon Leinen:
+ - fix a debugging statement (missing a variable).
+
+hardaker 18 Feb 98 08:18:05
+ - (at.c, icmp.c, interfaces.c, ip.c, tcp.c, udp.c, irix.h):
+ Patch from Simon Leinen:
+ - port to irix.
+
+hardaker 18 Feb 98 11:45:20
+ - (sedscript.in): define LIBDIR and DATADIR.
+
+hardaker 18 Feb 98 11:46:48
+ - (snmpd.1.def, snmpd.conf.5.def): change to DATADIR from LIBDIR.
+
+hardaker 18 Feb 98 13:31:07
+ - (disk.h, extensible.h, loadave.h, proc.h, UCD-SNMP-MIB.txt):
+ - turn these mibs into real tables. Required changing the mib though.
+
+hardaker 18 Feb 98 13:34:55
+ - (snmpd.conf.5.def): authtrapsenable -> authtrapenable.
+
+hardaker 18 Feb 98 13:44:13
+ - (at.c, example.c, hpux.c, hr_device.c, hr_disk.c, hr_filesys.c,
+ hr_network.c, hr_partition.c, hr_print.c, hr_proc.c, hr_storage.c,
+ hr_swinst.c, hr_swrun.c, hr_system.c, icmp.c, interfaces.c, ip.c,
+ pass.c, registry.c, smux.c, snmp_mib.c, system.c, tcp.c, udp.c,
+ var_route.c, wombat.c):
+ - all bcopys -> memcpy.
+ - include a few extra headers for DEBUGP statements.
+
+hardaker 18 Feb 98 14:25:53
+ - (acl_vars.c, at.c, context_vars.c, disk.c, host_res.h, hr_disk.c,
+ hr_filesys.c, hr_storage.c, hr_swinst.c, hr_swrun.c, hr_utils.c,
+ icmp.c, interfaces.c, interfaces.h, ip.c, memory.c, mibincl.h,
+ party_vars.c, pass.c, proc.c, registry.c, smux.c, snmp_mib.c,
+ system.c, tcp.c, udp.c, var_route.c, versioninfo.c, view_vars.c,
+ vmstat.c):
+ - massive -Wall and --strict-prototypes checking.
+ - bzero -> memset.
+
+hardaker 18 Feb 98 14:32:05
+ - (read_config.c, snmp_vars.c):
+ - prototyping and --Wall checks.
+
+hardaker 18 Feb 98 14:32:38
+ - (snmp_api.c, snmp_api.h): prototyping checks.
+
+hardaker 18 Feb 98 16:28:51
+ - (openbsd.h): created.
+
+hardaker 18 Feb 98 16:29:58
+ - (acconfig.h, UCD-SNMP-MIB.txt):
+ - removed unneeded stuff.
+ - added openbsd.
+
+hardaker 18 Feb 98 16:30:47
+ - (at.c, proc.c, tcp.c, udp.c, var_route.c, bsd.h, bsdi.h, freebsd.h,
+ generic.h, hpux.h, netbsd.h):
+ - tried to merge some things into s/*.h defines instead. There is a
+ lot to go still.
+
+hardaker 18 Feb 98 16:33:14
+ - (config.h.in): openbsd defines.
+
+hardaker 18 Feb 98 16:33:43
+ - (*/Makefile.in): make depend.
+
+hardaker 18 Feb 98 16:51:18
+ version tag ( 3.4.pre4 )
+
+hardaker 20 Feb 98 09:19:00
+ - (interfaces.c): Patch from Simon Leinen:
+ - fix include file dependancies on irix with _KERNEL defined.
+
+hardaker 20 Feb 98 11:15:14
+ - (*/Makefile.in): fix make depend to look for and strip /usr/lib/*.
+
+hardaker 25 Feb 98 07:27:09
+ - (read_config.c, snmpd.c): Patch from Niels Baggesen:
+ - fix read_config parser's end of line problems.
+
+hardaker 4 Mar 98 15:49:32
+ - (COPYING): documentation requirement change.
+
+hardaker 6 Mar 98 14:01:52
+ - (Makefile.in, kernel.c, read_config.c, read_config.h, snmp_agent.c,
+ snmp_vars.c, snmpd.c, acl_vars.c, alarm.c, context_vars.c, disk.c,
+ event.c, extensible.c, icmp.c, interfaces.c, ip.c, mibincl.h,
+ party_vars.c, pass.c, proc.c, registry.c, registry.h, route_write.c,
+ snmp_mib.c, system.c, tcp.c, udp.c, vacm_vars.c, vacm_vars.h,
+ var_route.c, versioninfo.c, view_vars.c, snmp_parse_args.c,
+ snmpdelta.c, snmpget.c, snmpgetnext.c, snmpset.c, snmpstatus.c,
+ snmptable.c, snmptest.c, snmptranslate.c, snmptrap.c, snmptrapd.c,
+ if.c, inet.c, route.c, snmpd.conf.5.def, snmptable.1, .index,
+ Makefile.in, SNMP-FRAMEWORK-MIB.txt, SNMP-MPD-MIB.txt,
+ SNMP-NOTIFICATION-MIB.txt, SNMP-PROXY-MIB.txt, SNMP-TARGET-MIB.txt,
+ SNMP-USER-BASED-SM-MIB.txt, SNMP-VIEW-BASED-ACM-MIB.txt,
+ Makefile.in, acl.h, acl_parse.c, asn1.c, context.h, context_parse.c,
+ mib.c, party.h, party_parse.c, snmp.c, snmp.h, snmp_api.c,
+ snmp_auth.c, snmp_client.c, snmp_impl.h, system.c, vacm.c, vacm.h,
+ view.c): Patch from Niels Baggesen:
+ - Implement the SNMPv3 View Based Access Control Model (RFC 2275).
+ - header fixes.
+ - better header-file #define names to include SNMP_, ASN_, etc. prefixes.
+
+hardaker 6 Mar 98 15:47:01
+ - (util_funcs.c):
+ - remove GLOBAL-SECURITY checks.
+
+hardaker 6 Mar 98 15:47:19
+ - (mibII.h): add vacm_vars.
+
+hardaker 6 Mar 98 15:47:40
+ - (host_res.h): move snmp_api.h up above snmp_impl.h.
+
+hardaker 6 Mar 98 15:48:33
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - remove security type prompts.
+
+hardaker 9 Mar 98 17:40:04
+ - (mibII.c, mibII.h, sysORTable.c, sysORTable.h, system.c, v2party.c,
+ vacm_vars.c, vacm_vars.h):
+ - implement sysORTable.
+ - register mibs under it.
+
+hardaker 11 Mar 98 08:06:17
+ - (*/*/*/*): Patch from Niels Baggesen:
+ - fix auto_nlist on preceeding _ architectures.
+ - Change *all* define usage to new SNMP_ and ASN_ prefixes.
+ - leave mib access open if no com2sec statements were found in snmpd.conf.
+
+hardaker 11 Mar 98 09:40:42
+ - (hpux.h, hr_filesys.h, memory.h, snmp_bgp.h, snmp_ospf.h,
+ snmp_rip2.h, sysORTable.h, vmstat.h):
+ - finish converting a few of the files that Niels missed.
+
+hardaker 11 Mar 98 10:30:50
+ - (sysORTable.c, sysORTable.h, system.c, system.h):
+ - fix time values and move sysORLastChanged to the system group.
+
+hardaker 11 Mar 98 12:14:09
+ - (*): Patch from Craig Bevins for OpenBSD
+
+hardaker 11 Mar 98 12:27:01
+ - (interfaces.c, tcp.c, udp.c, var_route.c, var_route.h): Patch from
+ Craig Bevins:
+ - port to OpenBSD.
+
+hardaker 11 Mar 98 12:45:46
+ - (*): patch from Garrett Wollman for FreeBSD.
+
+hardaker 11 Mar 98 12:56:37
+ - (aclocal.m4, config.h.in, configure, configure.in, icmp.c,
+ interfaces.c, ip.c, tcp.c, udp.c, var_route.c): Patch from Garrett
+ Wollman:
+ - freebsd 3 sysctl implementations.
+
+hardaker 11 Mar 98 14:41:11
+ - (read_config.c, read_config.h, snmp_agent.c, snmp_vars.c, snmpd.c,
+ host_res.h, hr_device.c, hr_device.h, hr_disk.c, hr_disk.h,
+ hr_filesys.c, hr_filesys.h, hr_network.c, hr_network.h, hr_other.c,
+ hr_partition.c, hr_partition.h, hr_print.c, hr_print.h, hr_proc.c,
+ hr_proc.h, hr_storage.c, hr_storage.h, hr_swinst.c, hr_swinst.h,
+ hr_swrun.c, hr_swrun.h, hr_system.c, hr_system.h, interfaces.c,
+ ip.c, mibII.c, mibII.h, sysORTable.c, v2party.c, v2party.h,
+ vacm_vars.c, vacm_vars.h):
+ - massive prototyping and --Wall fixes.
+ - fixed things broken by the freebsd patch (only some I'm sure).
+
+hardaker 11 Mar 98 15:42:35
+ - (auto_nlist.c): better debugging printfs
+
+hardaker 11 Mar 98 15:45:22
+ - (hpux.h): switch incorrect arptab symbols.
+
+hardaker 11 Mar 98 15:56:13
+ - (README): name update.
+
+hardaker 11 Mar 98 15:57:16
+ - (*/Makefile.in): depend update.
+
+hardaker 11 Mar 98 17:05:41
+ - (system.c): don't chomp new line on read_config utils.
+
+hardaker 18 Mar 98 09:17:42
+ - (README): changed OV path's to newer release paths.
+
+hardaker 18 Mar 98 13:10:35
+ - (acconfig.h, config.h.in, sedscript.in, UCD-SNMP-MIB.txt):
+ - re-numbering of the new table modules.
+
+hardaker 18 Mar 98 13:26:22
+ - (extensible.c, memory.c, pass.c, proc.c, util_funcs.c, util_funcs.h):
+ - wait for pid after get_exec_output() with new wait_on_exec() function.
+
+hardaker 18 Mar 98 13:56:16
+ - (acconfig.h, config.h.in, configure, configure.in, read_config.c,
+ snmpd.c, snmp_parse_args.c, snmptrapd.c, main.c, mib_api.3,
+ config.h):
+ - SNMPLIBPATH -> SNMPSHAREPATH
+ - a real SNMPLIBPATH
+ - make the agent read .conf files from SNMPSHAREPATH:SNMPLIBPATH.
+
+hardaker 18 Mar 98 14:09:31
+ version tag ( 3.4.pre5 )
+
+hardaker 22 Mar 98 18:13:41
+ - (pass.c, proc.c, vacm_vars.c): Patch from Simon Burge:
+ - move sys/types.h up for ultrix.
+
+hardaker 25 Mar 98 09:15:45
+ - (tcp.c): include tcpip.h for digital unix.
+
+hardaker 25 Mar 98 10:39:13
+ - (read_config.c, read_config.h, snmp_vars.c, registry.c, registry.h):
+ - fix the registry mib to use the new module structure.
+ - create a working find_subtree() and find_subtree_next().
+
+hardaker 25 Mar 98 10:39:50
+ - (acconfig.h, config.h.in): simply don't define CAN_USE_NLIST on linux.
+
+hardaker 25 Mar 98 10:44:06
+ - (snmpd.c, snmp_api.c): Spelling errors from the CMU code fixed.
+
+hardaker 25 Mar 98 10:46:36
+ - (acconfig.h, config.h.in, linux.h): new define: DONT_USE_NLIST.
+
+hardaker 25 Mar 98 10:59:20
+ - (interfaces.c): Patch from Niels Baggesen:
+ - Add an & to arpcom.ac_enaddr in memset.
+
+hardaker 25 Mar 98 12:48:30
+ - (Makefile.in, int64.c, int64.h, mib.c): Code from David T. Perkins:
+ - integrated David's code to print counter64s as integers rather than hex.
+
+hardaker 25 Mar 98 13:07:00
+ - (v2party.c, mibII.c, vacm_vars.c): declair registration variables staticly.
+
+hardaker 25 Mar 98 16:49:56
+ - (hpux.c): fix write_method declaration.
+
+hardaker 26 Mar 98 07:22:30
+ - (*.c): Patch from Niels Baggesen:
+ - misc porting improvements (the bsd groups, sunos, ...).
+ - switch auto_nlists calling order of _ vs non _ lookups.
+ - reverse all string.h/strings.h include possibilities.
+
+hardaker 27 Mar 98 09:20:04
+ - (snmptrapd.c):
+ - Beta version of an extensible trap demon.
+ - -C 'command' on the command line runs the command and feeds it
+ stdin information about the trap.
+ - v1 traps are converted to v2 traps for consistancy of
+ information sent to the scripts.
+
+hardaker 27 Mar 98 11:20:21
+ - (read_config.c, read_config.h):
+ - create config_pwarn() that doesn't increase the error count to
+ prevent exiting. Used for disks, since some might by process or
+ nfs mounted.
+
+hardaker 27 Mar 98 11:20:54
+ - (disk.c): use config_pwarn() for missing disks.
+
+hardaker 27 Mar 98 11:22:35
+ - (hr_device.c): check device index against maximum (segfault on HPUX).
+
+hardaker 27 Mar 98 16:10:05
+ - (README, config.h.in, configure, configure.in, snmpd.c): Patch from
+ Arthur Hyun:
+ - tcpwrappers support.
+
+hardaker 27 Mar 98 16:23:03
+ - (interfaces.c): Interfaces_Scan_Next needed a 4th (NULL) argument.
+
+hardaker 27 Mar 98 16:23:33
+ - (acconfig.h, config.h.in, configure, configure.in, snmpd.c):
+ - correctly #ifdef out the tcpwrappers patch.
+
+hardaker 27 Mar 98 16:42:13
+ - (INSTALL): document libwrap.
+
+hardaker 27 Mar 98 16:43:06
+ - (snmp_vars.c, snmp_vars.h, interfaces.c, ip.c, registry.c):
+ - prototyping and -Wall fixes.
+
+hardaker 1 Apr 98 09:52:32
+ - (snmp_client.c): enterprise_length is sizeof(oid) dependent.
+
+hardaker 1 Apr 98 13:27:07
+ - (auto_nlist.c):
+ - remove no longer needed debugging statements of tree traversal.
+
+hardaker 1 Apr 98 13:31:29
+ - (NEWS, PORTING): updates for 3.4.
+
+hardaker 1 Apr 98 13:47:55
+ - (FAQ, README): more 3.4 updates.
+
+hardaker 1 Apr 98 13:53:27
+ - (EXAMPLE.conf.def): added vacm example configuration.
+
+hardaker 1 Apr 98 13:54:11
+ - (snmpd.conf.5.def): moved the view example section above the access section.
+
+hardaker 1 Apr 98 14:10:07
+ - (TODO): removed a few things!
+
+hardaker 1 Apr 98 14:11:49
+ - (Makefile.in): make depend.
+
+hardaker 1 Apr 98 14:40:44
+ - (snmp_vars.c, snmp_vars.h): make unregestering of mibs work.
+ - (in most cases :-?)
+
+hardaker 1 Apr 98 14:43:14
+ version tag ( 3.4.pre6 )
+
+hardaker 1 Apr 98 16:35:59
+ - (snmptrapd.c): always send enterprise and trapoid to scripts.
+
+hardaker 20 Apr 98 10:31:08
+ - (snmpd.c): change oid from textual to numeric to allow now mibs to
+ be loaded.
+
+hardaker 20 Apr 98 15:54:29
+ - (host_res.h, hr_disk.c, hr_filesys.c, hr_partition.c, hr_storage.c):
+ - Patch from Dave Shield:
+ - consolidate the system-specific stuff a bit (should make it easier
+ to follow)
+ - Re-structures the Disk searching, in such a way that it can set up
+ via the config file. (which I still need to do)
+ - Speed up disk searching (by caching invalid results - a *major* win!)
+ - Handle partitions sensibly (arther than one per disk)
+ - Improve Solaris support for the Device group
+
+hardaker 20 Apr 98 15:56:50
+ - (config.h.in, configure, configure.in): check for sys/dkio.h
+
+hardaker 20 Apr 98 15:59:12
+ - (hr_filesys.c, hr_swrun.c): Patch from Niels Baggesen:
+ - fix some host resources for solaris.
+
+hardaker 20 Apr 98 16:00:36
+ - (snmpd.c): Patch from Niels Baggesen:
+ - appropriate use of strdup during startup and better flag checking.
+
+hardaker 20 Apr 98 16:00:56
+ - (interfaces.c): Patch from Niels Baggesen:
+ - header moves.
+
+hardaker 20 Apr 98 16:02:12
+ - (ip.c): Patch from Niels Baggesen:
+ - test symbol defines and cleanup.
+
+hardaker 20 Apr 98 16:03:03
+ - (snmptable.c): Patch from Niels Baggesen:
+ - prototyping and other cleanups.
+
+hardaker 20 Apr 98 16:05:00
+ - (snmptrapd.c): Patch from Niels Baggesen:
+ - gethostbyaddr moves up.
+ - include sys/wait.h.
+ - syslog %d -> %ld for long specific_type.
+
+hardaker 20 Apr 98 16:05:34
+ - (vacm_vars.c): Patch from Niels Baggesen:
+ - typecast a pointer.
+
+hardaker 20 Apr 98 16:06:03
+ - (tcp.c, udp.c, var_route.c): Patch from Niels Baggesen:
+ - #ifdef checks on symbols and header movement.
+
+hardaker 20 Apr 98 16:06:21
+ - (solaris.h): Patch from Niels Baggesen:
+ - undefine a bunch of nlist symbols.
+
+hardaker 20 Apr 98 16:07:10
+ - (snmp_client.c): Patch from Niels Baggesen:
+ - needed pointer copies.
+
+hardaker 22 Apr 98 07:49:21
+ - (UCD-SNMP-MIB.txt): changed wording, cleaned up a bit.
+
+hardaker 22 Apr 98 08:35:29
+ - (parse.c): Patch from Niels Baggesen:
+ - parse BITS keywords.
+
+hardaker 24 Apr 98 10:00:06
+ - (acconfig.h, config.h.in): mib oid location updates for ucd-snmp mib.
+
+hardaker 24 Apr 98 10:02:29
+ - (UCD-SNMP-MIB.txt):
+ - renamed labels to be unique from the old definitions.
+ - renumbered again.
+ - commented on the desgin of the mib at the top.
+ - Changed back to SMIv1.
+ - removed lockd section.
+ - removed vmstat section till it gets implemented.
+ - removed sequences of scalers.
+
+hardaker 24 Apr 98 10:22:00
+ - (UCD-SNMP-MIB.txt): the textual descriptions were updated some.
+
+hardaker 24 Apr 98 14:03:26
+ - (UCD-SNMP-MIB.txt): more cleaning and renaming.
+
+hardaker 24 Apr 98 14:32:12
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - check statvfs.h for f_bavail.
+
+hardaker 24 Apr 98 14:33:08
+ - (hr_filesys.c): include sys/param.h to define MAXPATHLEN.
+
+hardaker 24 Apr 98 14:33:24
+ - (hr_partition.c): close file descriptor just opened.
+
+hardaker 24 Apr 98 14:33:58
+ - (disk.c): calculate vfs block size if possible and size > 255 bytes.
+
+hardaker 24 Apr 98 16:31:30
+ - (tcp.c): include netinet/tcpip.h for DU4.0.
+
+hardaker 24 Apr 98 16:32:05
+ - (auto_nlist.c, auto_nlist.h): n_value is a long:
+ - return the value from auto_nlist_value as an unsigned long.
+
+hardaker 24 Apr 98 16:40:45
+ - (var_route.c): watch out for single route loops.
+
+hardaker 27 Apr 98 10:59:19
+ - (Makefile.top): removed unneeded variable.
+
+hardaker 27 Apr 98 11:00:08
+ - (configure, configure.in): define SHLIB_LDCONFIG_CMD as ":" for
+ static library cases.
+
+hardaker 27 Apr 98 11:00:44
+ - (snmpbulkwalk.c, snmpdelta.c, snmpget.c, snmpgetnext.c, snmpset.c,
+ snmpstatus.c, snmptable.c, snmptest.c, snmpwalk.c):
+ - Put the word "Timeout: " in front of the "No Response" errors.
+
+hardaker 27 Apr 98 13:31:10
+ version tag ( 3.4.pre7 )
+
+hardaker 27 Apr 98 16:24:34
+ - (tkmib): bug fixes and new mib menu to load new mibs.
+
+hardaker 27 Apr 98 16:46:28
+ - (tkmib): New mib menu command: load a mib module by ID name.
+
+hardaker 27 Apr 98 16:48:02
+ - (tkmib): bug fixes.
+
+hardaker 29 Apr 98 08:56:44
+ - (snmptable.c): Patch from Niels Baggesen:
+ - fix -H header printing.
+
+hardaker 29 Apr 98 10:26:58
+ - (tcp.c): don't use TCPSTAT_SYMBOL unless defined.
+
+hardaker 29 Apr 98 10:34:12
+ - (example.c, proc.c, var_route.c, wombat.c):
+ - nlist cleanups.
+
+hardaker 29 Apr 98 10:43:04
+ - (example.c, example.h, wombat.c, wombat.h): more clean ups.
+
+hardaker 29 Apr 98 11:31:43
+ - (vmstat.c, vmstat.h): moves, changes, removals, and fixes.
+
+hardaker 29 Apr 98 11:32:01
+ - (UCD-SNMP-MIB.txt): put vmstat back in and renamed to systemStats.
+
+hardaker 29 Apr 98 11:41:58
+ - (tkmib):
+ - display unloaded module error.
+ - don't try to load a file on a cancel.
+
+hardaker 6 May 98 11:22:56
+ - (Makefile.in): install tkmib.
+
+hardaker 6 May 98 14:06:57
+ - (UCD-SNMP-MIB.txt):
+ - added internal table section.
+ - mib number corrections to match the source.
+
+hardaker 6 May 98 14:58:23
+ - (disk.c, errormib.c, example.c, example.h, extensible.c, loadave.c,
+ memory.c, proc.c, sysORTable.c, system.c, util_funcs.c,
+ util_funcs.h, versioninfo.c, vmstat.c):
+ - remove the newname requirement from checkmib().
+ - create header_generic() for simple scalar tests.
+ - use header_generic() in all ucd specific scalar mibs, and example.[ch].
+
+hardaker 6 May 98 21:06:59
+ - (NEWS): minor wording change.
+
+hardaker 6 May 98 21:07:28
+ - (util_funcs.c, util_funcs.h):
+ - new function: calculate_time_diff(t1, t2).
+
+hardaker 6 May 98 21:08:00
+ - (UCD-SNMP-MIB.txt): make bogus index's be 0.
+
+hardaker 6 May 98 21:08:37
+ - (mib2c): created a mib2c template creator.
+
+hardaker 6 May 98 22:28:47
+ - (win32/config.h): update from Joe Marzot.
+
+hardaker 7 May 98 09:05:55
+ - (COPYING): correction for dates.
+
+hardaker 7 May 98 09:07:06
+ - (configure, configure.in): sys/stat inclusion in fs checks.
+
+hardaker 7 May 98 09:07:46
+ - (read_config.c): debug info for config files read.
+
+hardaker 8 May 98 10:57:49
+ - (config*): check for pkglocs.h.
+
+hardaker 8 May 98 11:01:24
+ - (hr_swinst.c, hr_disk.c): Patch from Dave Shields.
+
+hardaker 8 May 98 14:53:36
+ - (disk.c): wording change.
+
+hardaker 11 May 98 08:08:37
+ - (util_funcs.c): blank line removal.
+
+hardaker 11 May 98 08:08:53
+ - (tkmib): optional port number.
+
+hardaker 11 May 98 08:09:58
+ - (mib2c):
+ - counter64s.
+ - consolodation of variable declarations.
+ - more error stings in all files for unknown variable types.
+
+hardaker 11 May 98 08:10:30
+ - (parse.c): opaque's can have a size specifier.
+
+hardaker 11 May 98 08:10:46
+ - (int64.c): add incrByU32().
+
+hardaker 11 May 98 10:29:16
+ - (read_config.c, snmp_vars.h, snmpd.c, snmpd.h, var_struct.h): Patch
+ from Niels Baggesen:
+ - free routines for vacm (to allow -HUP)
+ - free routines for the trapsink directives in snmpd
+
+hardaker 11 May 98 10:30:01
+ - (hr_disk.c, hr_filesys.c, hr_partition.c, vacm_vars.c): Patch from
+ Niels Baggesen:
+ - some prototypes for the hr_*.c files (needs Dave's recent patch)
+ Warning: the proc part still does not work with Solaris!
+
+hardaker 11 May 98 10:30:18
+ - (snmptranslate.c): Patch from Niels Baggesen:
+ - implement the long since announced -H option to snmptable
+
+hardaker 11 May 98 10:30:37
+ - (snmptranslate.1): Patch from Niels Baggesen:
+ - implement the long since announced -H option to snmptable.
+
+hardaker 11 May 98 10:31:33
+ - (SNMPv2-TC.txt): Patch from Niels Baggesen:
+ - this last [parser] may find errors in old MIBs (including the
+ version of SNMPv2-TC that we ship).
+
+hardaker 11 May 98 10:32:27
+ - (UCD-SNMP-MIB.txt): Patch from Niels Baggesen:
+ - Corrections of disk entry capitilazation problems.
+
+hardaker 11 May 98 10:34:38
+ - (mib.c, parse.c, parse.h, snmp_api.h, vacm.c, vacm.h): Patch from
+ Niels Baggesen:
+ - free routines for vacm (to allow -HUP)
+ - fix the parser to report unlinked OIDs. This did reveal an error in a
+ Cisco MIB (CISCO-IPMCAST-MIB) that I had been using (it needs an
+ IMPORTS ciscoExperiment FROM CISCO-SMI)
+ Actually the parser worked ok, except for the missing error messages.
+ - rewrite of the parsers lexical analyser, to correct the errors that
+ Dave Perkins and others have pointed out recently (name::= , DESCRIPTION"
+ and proper handling of -- partial line comments --). Watch out! this last
+ may find errors in old MIBs (including the version of SNMPv2-TC that
+ we ship). My Fore Systems MIBs had errors with this.
+ - implement the long since announced -H option to snmptable
+
+hardaker 12 May 98 10:52:16
+ - (hr_swinst.c): Patch from Dave Shield:
+ - more swinst fixes for rpm modules.
+
+hardaker 12 May 98 10:52:57
+ - (snmptrapd.c): Patch from Dave Shield:
+ - include a getdtablesize() function for hpux9.
+
+hardaker 12 May 98 11:10:42
+ - (NEWS): more updates.
+
+hardaker 12 May 98 11:11:10
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - munge rpm lib check to link with -ldb as well.
+
+hardaker 12 May 98 11:11:32
+ - (disk.c): NULL -> 0.
+
+hardaker 12 May 98 11:45:21
+ - (vmstat.c): correct strings inclusion.
+
+hardaker 12 May 98 11:45:51
+ - (snmp_api.c, system.c):
+ - move debugging code from system.c to snmp_api.c, where it should be.
+
+hardaker 12 May 98 15:14:48
+ - (disk.c, example.c, interfaces.c, loadave.c, memory.c, pass.c,
+ proc.c, util_funcs.h, vmstat.c):
+ - include time.h properly instead of relying on util_funcs.h to do it.
+
+hardaker 12 May 98 15:15:01
+ version tag ( 3.4.pre8 )
+
+hardaker 13 May 98 21:21:22
+ - (int64.c, int64.h, mib.c): make int64.c use counter64's structure.
+
+hardaker 13 May 98 21:21:42
+ - (snmp_vars.c): don't return a counter64 to a snmpv1 request.
+
+hardaker 13 May 98 21:22:09
+ - (ip.c): include net/route.h and syslog.h for bsdi.
+
+hardaker 13 May 98 21:22:17
+ - (memory.c): include sys/param.h for bsdi
+
+hardaker 13 May 98 21:25:39
+ - (mib.c): sprint_by_type() didn't handle counter64's.
+
+hardaker 14 May 98 07:17:34
+ - (memory.c): move sys/param.h up above fs.h headers.
+
+hardaker 14 May 98 08:21:55
+ - (FAQ): new FAQ from Dave Shields.
+
+hardaker 14 May 98 08:22:08
+ - (NEWS): mib2c mentioned.
+
+hardaker 14 May 98 08:25:57
+ - (configure.in, configure): typos.
+
+hardaker 15 May 98 10:13:16
+ - (parse.c): single quote missing module names.
+
+hardaker 15 May 98 10:17:36
+ - (read_config.c, hr_filesys.c, hr_storage.c, hr_swrun.c, hr_system.c,
+ hr_system.h, hr_utils.c, util_funcs.c, var_route.c,
+ snmp_parse_args.c, snmptable.c, snmptranslate.c, snmptranslate.1,
+ bsd.h, solaris.h, sunos.h, int64.h, mib.c, mib.h, parse.c, parse.h):
+ Patch from Niels Baggesen:
+ - snmptranslate supports -R and -r.
+ - miscellaneous warning fixes.
+ - oid searcher always ignores case.
+ - fixed hr_system to compile on SunOS4.
+
+hardaker 15 May 98 10:19:05
+ - (mib.c): Patch from Dave Shield:
+ - provide ability to do random searches specifying a module name to look in.
+
+hardaker 15 May 98 11:17:44
+ - (FAQ, mib.c): Patch from Dave Shield:
+ - handle random lookups with multiple oid segments.
+
+hardaker 15 May 98 11:19:10
+ - (config.h, win32.opt, libsnmp.dsp, libsnmp.plg, libsnmp.def,
+ libsnmp_dll.dsp, libsnmp_dll.plg, snmpbulkwalk.plg, snmpget.plg,
+ snmpgetnext.plg, snmpset.plg, snmpstatus.plg, snmptranslate.plg,
+ snmpwalk.plg): Patch from Joe Marzot:
+ - win32 file updates.
+
+hardaker 18 May 98 11:18:21
+ - (acconfig.h, config.h.in, configure, configure.in):
+ - fix rtentry structure test on re-configures.
+
+hardaker 18 May 98 13:13:18
+ - (hr_swinst.c): protect using the date pointer against NULL settings.
+
+hardaker 18 May 98 15:39:38
+ version tag ( 3.4.pre9 )
+
+hardaker 18 May 98 18:14:19
+ - (int64.c):
+ - include header changes for win32.
+
+hardaker 19 May 98 10:41:14
+ - (at.c): set to do nothing when CAN_USE_SYSCTL.
+
+hardaker 19 May 98 10:41:49
+ - (memory.c): fix swapinfo on hpux10 systems. (/etc/swapinfo -r).
+
+hardaker 20 May 98 07:33:02
+ - (mib.c, parse.c): Patch from Niels Baggesen:
+ - extend random lookups further.
+
+hardaker 20 May 98 07:34:31
+ - (FAQ): Update from Dave Shield.
+
+hardaker 20 May 98 07:36:14
+ - (util_funcs.c): make checmib() use oid not int for newname.
+
+hardaker 20 May 98 07:37:33
+ - (snmp_impl.h): version should be a long.
+
+hardaker 20 May 98 08:25:41
+ - (read_config.c): config_perror() -> config_pwarn() for missing tokens.
+
+hardaker 20 May 98 08:27:06
+ - (*/Makefile.in): make depend.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.2 -> V3.3
+
+whardake 11 Jun 97 04:53:53
+ - (mib.c): Patch from Niels Baggesen to make MIBFILES env var work correctly.
+
+whardake 11 Jun 97 05:46:18
+ - (ChangeLog): whoops.
+
+whardake 23 Jun 97 23:40:28
+ - (Makefile.in): Patch from John Charlton to fix leading spaces in sedscript.
+
+whardake 23 Jun 97 23:41:58
+ - (configure*): bsdi3 needs to define bsdi2, not itself (duh).
+
+whardake 23 Jun 97 23:42:36
+ - (agent/mibgroup/README): need 2 leading '-'s on --with-mib-modules flag.
+
+whardake 26 Jun 97 23:39:32
+ - (smux.c): __P macros were called with too many arguments (needed (args)).
+
+whardake 30 Jun 97 05:53:57
+ - (agent/snmp_{agent,vars}.c, alarm.c, event.c, apps/*,
+ snmplib/snmp{,_api,_auth}.c):
+ - Added basic (mostly conforming?) v2c support.
+ - Merged arg parsing of apps/* clients into one file.
+
+whardake 30 Jun 97 05:54:36
+ - (agent/mibgroup/interfaces.c): Don't put & in front of osf4 ac_enaddr.
+
+whardake 30 Jun 97 06:33:08
+ - (snmptest.c): Patch from Niels Baggesen to fix get -> fget '\n' problem.
+ - Also makes sure it handles up and lower cases.
+
+whardake 30 Jun 97 06:38:43
+ - (wombat.h): better document config_load_mib() example.
+
+whardake 30 Jun 97 06:49:45
+ - (config*, memory.c): Patch from vlad@misery.rosprint.ru:
+ - implement memory section of ucd mib on linux.
+
+whardake 30 Jun 97 06:58:49
+ - (mib_api.3, parse.[ch]): Patch from Dave Shield:
+ - Handle mib module replacements through new function and replacement table.
+
+whardake 30 Jun 97 07:19:51
+ - (mib.c, parse.c, snmp_api.c): Suggestions from Laukkanen Markku NRC/Hki:
+ - Malloc typecasts and other corrections in casting.
+
+whardake 1 Jul 97 01:10:00
+ - (smux.c): fix prototyping failures.
+
+whardake 1 Jul 97 05:41:58
+ - (config*, common_header.h, interfaces.c, var_route.c, UCD-SNMP-MIB.txt):
+ - fix freebsd3 specific problems (based on suggestions from Bill Fenner).
+
+whardake 1 Jul 97 06:02:57
+ - (apps/*.c): Better usage information and usage() standarization.
+
+whardake 1 Jul 97 06:41:44
+ - (disk.c, errormib.c, loadave.c, memory.c): bsdi3 specific headers.
+
+whardake 1 Jul 97 07:20:25
+ - (config*): bsdi3 specific headers.
+
+whardake 1 Jul 97 08:37:51
+ version tag ( 3.3.pre1 )
+
+whardake 3 Jul 97 23:33:23
+ - (snmptranslate.c, mib.[ch], parse.[ch]):
+ - New option to snmptranslate (-a) to output a ascii dump of the mib
+ database capable of being used by the parser for quick OID translations.
+
+whardake 3 Jul 97 23:34:14
+ version tag ( 3.3.pre2 )
+
+whardake 24 Jul 97 23:50:48
+ - (snmp_api.c): Patch from Eddy J. Gurney: uncomment gettimeofday() call.
+
+whardake 7 Aug 97 00:29:24
+ - (TODO): better error messages by apps.
+
+whardake 7 Aug 97 01:11:54
+ - (config*, load.c, disk.c, parse.c, snmp.c): Patch from Simon Burge:
+ - Ultrix fixes for statfs, loadave.
+ - implement strdup if not found in system.
+ - test for test flags for kernel checking.
+ - watch out for ps'es that return egrep with the ps arg on the line.
+ - up maximum disks to 50.
+
+whardake 7 Aug 97 01:33:38
+ - (kernel.c, proc.c): Patch from Simon Burge:
+ - Implement real process table walks on Ultrix.
+
+whardake 7 Aug 97 02:34:45
+ - (config*, memory.c):
+ - fix swap on HPUX 10.20
+
+whardake 13 Aug 97 04:47:49
+ - (snmpstatus.c): optarg/optind need to be declaired under ultrix4.
+
+whardake 13 Aug 97 08:11:42
+ - (version.h, agent/*, agent/mibgroup/*):
+ - move version string to a global header.
+ - insert USING_*_MODULE macro's in many places to make module
+ removal more possible. You can now compile with almost no modules
+ installed.
+
+whardake 14 Aug 97 00:46:38
+ - (snmp_parse_args.c, snmptrap.c, snmptrapd.c, main.c):
+ - add -V version flage.
+
+whardake 14 Aug 97 07:38:17
+ - (config*, FAQ, README, agent/mibgroup/*.c, apps/*.c):
+ - Patch from David Paul Zimmerman:
+ - port to AIX 4.1.5.
+ - fix more type casting problems.
+
+whardake 14 Aug 97 08:15:42
+ - (configure*):
+ - Typo's when copying in a autoconf test.
+ - Add errormib to default module list (since its no longer required).
+ - backquote a . in a sed regexp to watch out for module names
+ beginning with the letter o.
+
+whardake 14 Aug 97 08:16:12
+ - (agent/mibgroup/README): Point out that mib list must be in descending order.
+
+whardake 14 Aug 97 08:16:37
+ - (proc.c): don't use seterrorstatus() if not using the errormib.
+
+whardake 14 Aug 97 08:21:26
+ - (interfaces.c): Patch from David C. Lawrence for netbsd * bsd/os 2.0.
+
+whardake 15 Aug 97 02:30:59
+ - (config*, snmpd.c, snmp_client.[ch], system.[ch]):
+ - fix more long/int problems on 64 bit machines u_long -> in_addr_t.
+ - Check for SIOCGIFADDR in sys/ioctl.h and use it in get_myaddr() if
+ defined.
+
+whardake 15 Aug 97 06:46:39
+ version tag ( 3.3.pre3 )
+
+whardake 25 Aug 97 00:21:23
+ - (memory.c): typo in ifdef.
+
+whardake 25 Aug 97 00:21:41
+ - (versiontag): checkin version.h.
+
+whardake 25 Aug 97 00:22:18
+ - (interfaces.c): Patch from Dave Shields for netbsd.
+
+hardaker 14 Oct 97 15:15:23
+ - (mib_api.3): doc addition: add_mibdir() return value.
+
+hardaker 14 Oct 97 15:16:36
+ - (parse.c): From Dave Shields:
+ - self contained mib .txt files with multiple modules.
+
+hardaker 14 Oct 97 15:19:16
+ - (config*, common_header.h): dynix doesn't have net/route.h.
+
+hardaker 14 Oct 97 15:21:57
+ - (FAQ): From Dave Shields: refer reader to another answer as well.
+
+hardaker 14 Oct 97 15:33:03
+ - (agent/mibgroup/*.c): YMWRAMFSFN:
+ - (yet more warning removals and memory function standardizations from Niels).
+ - minor linux/netbsd/bsdi clean ups.
+
+hardaker 15 Oct 97 09:50:08
+ - (view_parse.c, snmp_vars.c): From Niels: warning removals and standardization.
+
+hardaker 15 Oct 97 09:58:36
+ - (apps/*.c, agent/snmpd.c, snmplib/*.c): Patch from Niels:
+ - warning fixes.
+ - remove the printf's from the library and set a snmp 'errno' equivalent.
+
+hardaker 15 Oct 97 12:12:02
+ - (apps/*.c, agent/snmpd.c, snmplib/*.c):
+ - create and use new function: snmp_perror(char *)
+ - free allocated space of snmp_detail upon usage by snmp_api_errstring().
+
+hardaker 15 Oct 97 18:40:38
+ - (config*, agent/mibgroup/hr*): Host resources mib from Dave Shield.
+ - minor patches by me, mostly pointer errors.
+ - (memory.c): fixed a null pointer problem under linux.
+
+hardaker 20 Oct 97 11:45:58
+ - (FAQ): Changes from Dave.
+
+hardaker 20 Oct 97 11:51:34
+ - (config*, agent/snmp*, agent/mibgroup/*.[ch]):
+ - Created a new mibmodule.h configuration macro called
+ config_parse_dot_conf() which can be called to request parsing of
+ the snmpd.conf file(s) on a per module basis.
+ - All related parsing has been striped from read_config.c and move
+ to their correct module instead.
+ - New function: config_perror(char *): print error with file & line #.
+ - basic -Wall cleanups in hr* as well (not nearly done yet).
+
+hardaker 20 Oct 97 16:05:14
+ - (pass.c) don't null last char in command line.
+
+hardaker 20 Oct 97 16:06:16
+ - (read_config.c):
+ - don't report an error if you can't find a snmpd.conf file.
+ - don't report all lines as an error (opps).
+
+hardaker 20 Oct 97 16:38:33
+ - (mib.c): From Dave: patch DEFAULT_MIBS to take '+' in front.
+
+hardaker 20 Oct 97 16:44:37
+ - (mib.c): patch all other env-vars to take '+' in front.
+
+hardaker 20 Oct 97 17:01:48
+ - (config*, agent/mibgroup/hr_*.c):
+ - A module.c file is no longer required. Only the .h file is
+ necessary, for people who want to have one module wrap a bunch of others.
+ - removed host.c
+ - renamed all hr_init functions to be auto-called.
+
+hardaker 20 Oct 97 17:15:51
+ - (agent/mibgroup/README, wombat.[ch]):
+ - documentation update to reflect config_parse_dot_conf() usage.
+
+hardaker 20 Oct 97 17:16:58
+ - (config*, agent/mibgroup/hr_*.c):
+ - A module.c file is no longer required. Only the .h file is
+ necessary, for people who want to have one module wrap a bunch of others.
+ - removed host.c
+ - renamed all hr_init functions to be auto-called.
+
+hardaker 20 Oct 97 18:01:46
+ - (config*, agent/mibgroup/v2party.h, ucd_snmp.h, smux_gated.h):
+ - created new wrappers for the various modules to make them easy to
+ add and remove as needed.
+
+hardaker 20 Oct 97 19:42:46
+ - (acconfig.h, config.h.in): define linux's OS type.
+
+hardaker 20 Oct 97 19:43:13
+ - (snmp_vars.c): define at least blank func nlist_init() on linux.
+
+hardaker 21 Oct 97 10:15:54
+ - (PORTING, README): minor updates.
+
+hardaker 21 Oct 97 10:45:47
+ - (snmp_parse_args.c): allow -v 2h and 2p for party code.
+
+hardaker 21 Oct 97 11:00:57
+ - (hr_storage.c, hr_swrun.c, memory.c): close open files on linux.
+
+hardaker 21 Oct 97 11:01:27
+ - (NEWS): beginnings of NEWS updates.
+
+hardaker 21 Oct 97 11:02:46
+ version tag ( 3.3.pre4 )
+
+hardaker 21 Oct 97 12:25:03
+ - (agent/read_config.[ch], snmpd.c, snmp_vars.c, mibgroup/*):
+ - moved read_config.[ch] up a level to always be compiled in.
+
+hardaker 21 Oct 97 12:31:54
+ - (*/Makefile.in): make makefileindepend setup.
+
+hardaker 21 Oct 97 12:32:08
+ - (*/Makefile.in): make makefileindepend..
+
+hardaker 21 Oct 97 12:36:33
+ - (*/Makefile.in): did a make depend.
+
+hardaker 21 Oct 97 12:36:39
+ version tag ( 3.3.pre5 )
+
+hardaker 22 Oct 97 11:40:06
+ - (common_header.h, read_config.c, disk.c, snmp_parse_args.c):
+ - Typo's fixed by Niels.
+
+hardaker 27 Oct 97 09:56:26
+ - (config*, agent/mibgroup/*.h):
+ - new config macro: config_arch_require(arch, module).
+ - moved arch dependant modules (memory, hpux, kernel_sunos5) loads
+ from the configure into the appropriate .h files.
+ - (interfaces.c, var_route.c):
+ - typecast klookup calls for freebsd2.
+
+hardaker 27 Oct 97 14:03:15
+ - (agent/snmp_agent.c snmp_vars.c): Changes from Joe Marzot and David Perkins:
+ - v2h -> v2p, v2 -> v2c.
+
+hardaker 27 Oct 97 14:04:33
+ - (apps/*.c):
+ - changes for WIN32 support.
+ - support for command line flags without spaces.
+ - v2h -> v2p.
+
+hardaker 27 Oct 97 14:16:42
+ - (snmplib/*.[ch]): Changes from Joe Marzot and David Perkins:
+ - changes for WIN32 support.
+ - v2h -> v2p.
+
+hardaker 27 Oct 97 14:19:18
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:18
+ file config.h was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:18
+ file win32.dsw was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:18
+ file win32.opt was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:25
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:25
+ file libsnmp.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:25
+ file libsnmp.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:28
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:28
+ file libsnmp.def was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:28
+ file libsnmp_dll.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:28
+ file libsnmp_dll.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:31
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:31
+ file snmpbulkwalk.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:31
+ file snmpbulkwalk.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:34
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:34
+ file snmpget.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:34
+ file snmpget.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:37
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:37
+ file snmpgetnext.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:37
+ file snmpgetnext.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:41
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:41
+ file snmpset.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:41
+ file snmpset.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:44
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:44
+ file snmpstatus.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:44
+ file snmpstatus.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:47
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:47
+ file snmptranslate.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:47
+ file snmptranslate.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:52
+ - (win32): Changes from Joe Marzot and David Perkins:
+ - project dir for WIN32 support.
+
+hardaker 27 Oct 97 14:19:52
+ file snmpwalk.dsp was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 14:19:52
+ file snmpwalk.plg was initially added on branch V2C-WIN32-3-3-pre3.
+
+hardaker 27 Oct 97 15:17:11
+ - (config*) win32 header checks.
+
+hardaker 27 Oct 97 15:17:50
+ - (agent/kernel.c, snmp_agent.c):
+ - ERROR() -> ERROR_MSG().
+ - funtion renames.
+
+hardaker 27 Oct 97 15:18:16
+ - (agent/mibgroup/*.c):
+ - ERROR() -> ERROR_MSG().
+
+hardaker 27 Oct 97 15:21:53
+ - (apps/snmp_parse_args.c):
+ - put tabs back in help string.
+ - put version string request back in.
+ - make error strings better and put back in periods.
+ - don't bomb on unknown parameters for future use.
+
+hardaker 27 Oct 97 15:22:21
+ - (snmplib/snmp.c): put strdup declairation back in.
+
+hardaker 27 Oct 97 15:23:20
+ - (snmplib/snmp_auth.c):
+ - remove #ifdef OLD requirement.
+ - change back int->long argument change for snmp_comstr_build.
+
+hardaker 27 Oct 97 15:37:46
+ - (snmplib/snmp.h):
+ - snmp version #define clairification on future implementations.
+ - more clearly state purpose of future SNMPV3.
+
+hardaker 27 Oct 97 16:26:57
+ - (*): merge of W32 port and main version branch.
+
+hardaker 27 Oct 97 16:34:45
+ - (snmp_api.[ch]): fix perror losses from merge.
+
+hardaker 27 Oct 97 17:04:51
+ - (hr_*.c): ERROR -> ERROR_MSG.
+
+hardaker 27 Oct 97 17:05:12
+ - (snmpstatus.c): remove duplicate declairation.
+
+hardaker 27 Oct 97 17:42:55
+ - (snmp_vars.c): two modules for extensible count.
+
+hardaker 27 Oct 97 17:43:22
+ - (agent/mibgroup/hr_*.h): proper init_ prototypes.
+
+hardaker 27 Oct 97 17:43:50
+ - (snmp_parse_args.c): missing a else statement (sigh).
+
+hardaker 27 Oct 97 17:44:27
+ - (snmp_auth.c): merge bugs. Missing brackets.
+
+hardaker 27 Oct 97 17:47:00
+ - (snmp_api.c): merge bugs: else check against pdu command type.
+
+hardaker 27 Oct 97 18:02:56
+ win32 files
+
+hardaker 27 Oct 97 18:05:36
+ - (win32): add files on main branch.
+
+hardaker 27 Oct 97 18:18:36
+ - (snmpwalk.c): remove gotroot var.
+
+hardaker 27 Oct 97 18:18:57
+ - (snmplib/*.c): use snmp_set_detail to handle malloc/free of snmp_detail.
+
+hardaker 27 Oct 97 18:26:41
+ - (configure.in): fix config_arch_require macro to actually work.
+
+hardaker 27 Oct 97 18:31:34
+ version tag ( 3.3.pre6 )
+
+hardaker 28 Oct 97 09:56:11
+ - (acconfig.h, system.[ch], snmp.c): move strdup def to system.[ch].
+
+hardaker 28 Oct 97 14:30:55
+ - (acconfig.h, mib.c): use ';'s for DOS env paths.
+
+hardaker 28 Oct 97 14:42:23
+ - (config*): fix rtentry structure checks for the *bsd groups.
+
+hardaker 28 Oct 97 14:54:24
+ - (*.*.*.*): rename macro __P -> __UCD_P to reduce stupid conflicts.
+
+hardaker 28 Oct 97 15:50:05
+ - (config*, route_write.c, var_route.c):
+ - fix rtentry problems once and for probably never.
+
+hardaker 28 Oct 97 17:09:57
+ - (acconfig.h, UCD-SNMP-MIB.txt): define bsdi agent type.
+
+hardaker 28 Oct 97 17:10:58
+ - (util_funcs.c): Patch from Nobuo_Okabe@yokogawa.co.jp:
+ - fix unwrapped fopen() by adding return NULL check.
+
+hardaker 28 Oct 97 17:12:00
+ version tag ( 3.3.pre7 )
+
+hardaker 29 Oct 97 09:41:54
+ - (snmptrap.c): remove unused nlist struct.
+
+hardaker 29 Oct 97 09:42:07
+ - (snmp_parse_args.c): add sys/select.h for aix.
+
+hardaker 29 Oct 97 09:57:48
+ - (disk.[ch], struct.h, sedscript.in, snmpd.conf.5.def, UCD-SNMP-MIB.txt):
+ - Patch from Simon Burge to allow a minimum percentage on disk space.
+ - (was originally a maximum, but I changed it to minimum instead).
+
+hardaker 29 Oct 97 10:06:11
+ - (disk.c): fix pointer problems from old read_config form to new.
+
+hardaker 29 Oct 97 10:06:34
+ - (snmpd.conf.5.def): remove space before % sign.
+
+hardaker 29 Oct 97 10:25:31
+ - (*/Makefile.in, man/*):
+ - Patch from Simon Burge to change installation paths.
+ - (modified to point agent to sbindir instead of etcdir).
+
+hardaker 29 Oct 97 10:48:18
+ - (config*, */Makefile.in):
+ - Move snmplibpath to @datadir@ which defaults to /usr/local/share/snmp.
+
+hardaker 29 Oct 97 10:54:07
+ - (agent/Makefile.in): opps, forgot to put in @exec_path@.
+
+hardaker 29 Oct 97 11:20:54
+ - (acconfig.h, asn1.c, mib.[ch], parse.h,apps/*,errormib.c,loadave.c,
+ extensible.c, disk.c, snmpdelta*): Patch from Niels Baggesen:
+ - the now wellknown NetBSD fix,
+ - SunOS4 cc doesn't like unsigned literals or strtoul,
+ - added a char version of ";",
+ - added fprint_variable, fprint_objid etc
+ - changed the apps to print all error messages to stderr,
+ - completed the access and status values in snmplib/parse.h
+ - added a roughly patched version of snmpdelta.
+
+hardaker 29 Oct 97 12:23:26
+ - (parse.h): STATUS_KW_OPTIONAL -> STATUS_OPTIONAL
+
+hardaker 29 Oct 97 12:43:44
+ - (*.*.*): __UCD_P -> __P, and a configure check to look for it.
+
+hardaker 29 Oct 97 12:57:48
+ - (config*): check and include sys/cdefs.h in config.h.
+
+hardaker 29 Oct 97 12:58:01
+ - (host_res.h): don't include config.h twice.
+
+hardaker 29 Oct 97 14:00:38
+ version tag ( 3.3.pre8 )
+
+hardaker 4 Nov 97 12:47:12
+ - (read_config.c):
+ - #include mib_module_config.h
+ - USING_EXTENSIBLE_MIB_MODULE -> USING_EXTENSIBLE_MIB_MODULE
+
+hardaker 4 Nov 97 12:47:59
+ - (configure.in):
+ - Check for $prefix being defined as NONE for other vars.
+
+hardaker 5 Nov 97 13:42:57
+ - (apps/Makefile.in): put snmptrapd in @sbindir@
+
+hardaker 5 Nov 97 13:44:58
+ - (common_header.h): Patch from Dave Shields for hpux10 re-defining problems.
+
+hardaker 5 Nov 97 13:45:23
+ - (hr_disk.c): new version for hpux10 support from Dave Shield.
+
+hardaker 5 Nov 97 13:46:17
+ - (hr_filesys.c, hr_swrun.c, hr_utils.c): Patches from Dave Shield:
+ - bug fixes and hpux10 support.
+
+hardaker 5 Nov 97 13:46:46
+ - (var_route.c): from Dave Shield: don't prototype malloc.
+
+hardaker 5 Nov 97 13:48:07
+ - (*): merge from Dave's pre6 patches.
+
+hardaker 5 Nov 97 13:52:00
+ - (snmp_agent.c, snmp_vars.c, snmpd.c, disk.c, proc.c, util_funcs.c):
+ - #include "mib_module_config.h".
+
+hardaker 5 Nov 97 13:56:58
+ - (at.c, icmp.c, interfaces.c, ip.c, tcp.c, udp.c):
+ - #include "mib_module_config.h"
+
+hardaker 5 Nov 97 14:00:09
+ - (Makefile.in, kernel_sunos5.c, mib.c): Patch from Niels Baggesen:
+ - octet counters for solaris.
+ - Makefile.in patches.
+
+hardaker 5 Nov 97 14:40:07
+ - (memory.c): protect vmmeter.h from multiple inclusions on netbsd.
+
+hardaker 5 Nov 97 15:29:50
+ version tag ( 3.3.pre9 )
+
+hardaker 7 Nov 97 12:24:22
+ - (configure.in): check for linux/hdreg.h
+
+hardaker 7 Nov 97 12:25:35
+ - (hr_swrun.c): don't print a variable that doesn't exist under linux.
+
+hardaker 7 Nov 97 12:28:03
+ - (kernel_sunos5.c): patch from Niels for solaris >2.6.
+
+hardaker 7 Nov 97 13:37:14
+ - (read_config.c, snmp_agent.c, snmpd.c): USING.*_MIB_MODULE -> USING.*_MODULE.
+
+hardaker 7 Nov 97 13:37:44
+ - (hr_network.c): don't pass char ** to interfaces_scan_next().
+
+hardaker 7 Nov 97 13:38:36
+ - (snmpwalk.c): stop on no response from host.
+
+hardaker 7 Nov 97 15:19:24
+ - (acconfig.h): patch from Joe Marzot:
+ - define _CRTIMP for unix due to W32 bad OS designs.
+
+hardaker 7 Nov 97 15:19:59
+ - (snmpgetnext.h): patch from Joe Marzot:
+ - use _CRTIMP in front of errno declaration.
+
+hardaker 7 Nov 97 15:20:54
+ - (parse.[ch], snmp_client.c): patch from Joe Marzot:
+ - use _CRTIMP in front of errno declaration.
+ - define find_node externally.
+
+hardaker 7 Nov 97 15:22:09
+ - (win32/*): patch from Joe Marzot:
+ - win32 specific changes.
+
+hardaker 7 Nov 97 15:28:59
+ - (*): merge to main branch: patches from Joe Marzot.
+
+hardaker 7 Nov 97 16:16:53
+ - (configure.in): watch out for /usr/ucb/cc on solaris and don't use it.
+
+hardaker 7 Nov 97 16:37:01
+ - (NEWS, README, TODO): Documentation updates.
+
+hardaker 7 Nov 97 16:38:49
+ version tag ( 3.3.pre10 )
+
+hardaker 12 Nov 97 07:42:24
+ - (snmptranslate.c): Patch from Joe Marzot: W32 specific fixes.
+
+hardaker 12 Nov 97 08:26:45
+ - (snmp_client.c): Patch from Joe Marzot:
+ - Free a pdu in a spot that should technically never be needed, but
+ is nice for people reading the code.
+
+hardaker 12 Nov 97 09:17:08
+ - (FAQ): Doc update from Dave Shield.
+
+hardaker 12 Nov 97 09:17:28
+ - (mib_api.3): Doc update from Dave Shield.
+
+hardaker 12 Nov 97 09:18:02
+ - (hr_swrun.c): Patch from Dave Shield for linux/hpux10 problems.
+
+hardaker 12 Nov 97 10:25:30
+ - (NEWS, TODO): Patch from Niels Baggesen:
+ - doc update.
+
+hardaker 12 Nov 97 10:27:08
+ - (*/Makefile.in): Patch from Niels Baggesen:
+ - add @datadir@ to files that needed it.
+
+hardaker 12 Nov 97 10:27:46
+ - (kernel_sunos5.c): Patch from Niels Baggesen:
+ - solaris patches.
+
+hardaker 12 Nov 97 10:28:11
+ - (party_vars.c): Patch from Niels Baggesen:
+ - include netinet/in.h if available.
+
+hardaker 12 Nov 97 10:29:42
+ - (Makefile.in): Patch from Niels Baggesen:
+ - add @datadir@ to files that needed it.
+
+hardaker 12 Nov 97 10:30:57
+ - (apps/*.c): Patch from Niels Baggesen:
+ - various (remove unneeded vars, etc).
+ - add snmptable.
+ - make snmptrapd multi-lingual.
+
+hardaker 12 Nov 97 10:32:22
+ - (snmpnetstat/main.c): Patch from Niels Baggesen:
+ - snmpv2c support and argument parsing changes.
+
+hardaker 12 Nov 97 10:33:20
+ - (man/snmpdelta.1,snmptable.1,snmptrapd.8): Patch from Niels Baggesen:
+ - documentation changes and additions.
+
+hardaker 12 Nov 97 10:38:36
+ - (parse.c, parse.h): Patch from Niels Baggesen:
+ - parser improvements.
+ - parser directory caching.
+ - save_descriptions/mib_warnings set functions.
+
+hardaker 12 Nov 97 10:44:47
+ - (NEWS): doc update.
+
+hardaker 12 Nov 97 15:10:27
+ - (system.h): Don't include config.h!
+
+hardaker 12 Nov 97 15:16:44
+ - (party_vars.c): include STDC_HEADERS for AIX.
+
+hardaker 12 Nov 97 15:21:41
+ - (parse.c): include STDC_HEADERS for AIX.
+
+hardaker 12 Nov 97 15:42:02
+ - (*/Makefile.in): make depend.
+
+hardaker 12 Nov 97 16:05:47
+ version tag ( 3.3.pre11 )
+
+hardaker 12 Nov 97 20:27:11
+ - (win32/libsnmp_dll/libsnmp.def): Patch from Joe Marzot: function changes.
+
+hardaker 12 Nov 97 20:35:00
+ - (): Patch from David Zimmerman:
+ - Fixes for AIX.
+
+hardaker 12 Nov 97 20:35:27
+ - (var_route.c, read_config.c, snmpdelta.c): Patch from David Zimmerman:
+ - Fixes for AIX.
+
+hardaker 12 Nov 97 20:43:33
+ - (var_route.c, read_config.c): fix qsort params for STDC.
+
+hardaker 12 Nov 97 20:47:47
+ - (var_route.c, read_config.c): STDC typos.
+
+hardaker 14 Nov 97 08:31:41
+ - (wombat.c): code comments from Alan Batie.
+
+hardaker 14 Nov 97 08:32:26
+ - (README): coder list update.
+
+hardaker 14 Nov 97 12:21:10
+ - (wombat.c): quick doc change.
+
+hardaker 14 Nov 97 12:35:19
+ - (FAQ, NEWS, README): last documentation updates.
+
+
+
+-------------------------------------------------------------------------------
+
+Changes: V3.1.3 -> V3.2
+
+whardake 11 Feb 97 12:48:06
+ - (snmp_vars.c, snmp_var_route.c, snmp_vars.linux.h): Patch from Jennifer Bray:
+ - Get agent working on linux.
+
+whardake 11 Feb 97 12:50:46
+ - (snmp_vars.linux.h): Removed non-linux specific stuff.
+
+whardake 11 Feb 97 12:54:36
+ - (snmp_vars.c): Patch from Dave Shield: Fix hpux specific problems.
+
+whardake 11 Feb 97 13:11:21
+ - (*Makefile.in): Patch from Philip Guenther:
+ - Fix all Makefile.in's to support a different src dir.
+
+whardake 11 Feb 97 13:12:19
+ - (README): Update people supplying patches list.
+
+whardake 11 Feb 97 13:19:37
+ - (all .c with main(), snmplib/*): Patch from Philip Guenther:
+ - Make better support for shared lib possibilities.
+
+whardake 11 Feb 97 14:10:11
+ - (snmp_vars.linux.h): Fix #ifdef.
+
+whardake 11 Feb 97 14:11:24
+ - ({local,man,ov}/Makefile.in): Remove spaces in front of tabs.
+
+whardake 11 Feb 97 14:13:34
+ - (snmp_auth.c): remove non-static md5digest prototype.
+
+whardake 11 Feb 97 14:14:05
+ version tag ( 3.1.4.pre1 )
+
+whardake 11 Feb 97 16:42:02
+ - (apps/Makefile.in): Patch from Simon Leinin to descend when make cleaning.
+
+whardake 11 Feb 97 16:44:08
+ - (man/Makefile.in): Patch from Simon Leinin to fix srcdir problems.
+
+whardake 11 Feb 97 17:00:26
+ - (Makefile.in): Rest of Philip's patch to fix srcdir problems (sh vars).
+
+whardake 17 Feb 97 14:41:08
+ - (agent/snmp_vars, agent/mibgroup): Dave Shield split up the
+ snmp_vars.c and related files into pieces for easier management.
+ The results of his work are in the new agent/mibgroup directory.
+
+whardake 17 Feb 97 14:47:13
+ - (mib.c, snmp_api.c, snmp_api.h): Patch from Dave Shield to remove
+ ANSI specific requirements.
+
+whardake 17 Feb 97 14:53:24
+ - (agent/*Makefile.in): Make depend.
+
+whardake 17 Feb 97 15:30:04
+ - (alarm.c): typedef for getStatPtr().
+
+whardake 17 Feb 97 15:30:36
+ - (event.c): Was passing an int to bcopy instead of &int.
+
+whardake 17 Feb 97 15:31:25
+ - (icmp.c): don't use ret variable, since it's not defined.
+
+whardake 17 Feb 97 15:32:30
+ - (interfaces.c): Remove MAX_NAME_LENGTH requirements.
+
+whardake 17 Feb 97 16:11:09
+ version tag ( 3.1.4.pre2 )
+
+whardake 4 Mar 97 15:46:30
+ - (config*, mibgroup/Makefile.in):
+ - mibgroup compile list is build by configure and can be augmented
+ by the --with-mib-modules="list of modules" command line to configure.
+
+whardake 5 Mar 97 09:49:59
+ - (config*, agent/*, agent/mibgroup/*):
+ - Added .o file list to agent/Makefile.in generated by configure.
+ - new files generated by configure:
+ - mibgroup/mib_module_includes.h: A list of mib .h files for snmp_vars.h.
+ (every module *must* have a .h file)
+ - mibgroup/mib_module_inits.h: A list of init_wombat() type functions.
+ (only present if exist in wombat.c).
+ - mibgroup/mib_module_loads.h: This file is generated by a new macro in
+ the mib.h files called
+ config_load_mib(), which simplifies
+ the loading of the mib sections.
+
+whardake 5 Mar 97 10:03:58
+ - (system.c): removed system nlist (unused).
+
+whardake 5 Mar 97 11:17:44
+ - (snmp_client.c): Patch from Elwyn B Davies:
+ - Fix a PDU cloning bug.
+
+whardake 5 Mar 97 11:28:20
+ - (*.c, *.h): Patch from Niels Baggesen to prototype *everything*.
+
+whardake 5 Mar 97 11:28:23
+ file kernel.h was initially added on branch Ext-3-1-4-pre2-niels.
+
+whardake 5 Mar 97 11:28:45
+ - (*.c, *.h): Patch from Niels Baggesen to prototype *everything*.
+
+whardake 5 Mar 97 11:28:48
+ file snmpd.h was initially added on branch Ext-3-1-4-pre2-niels.
+
+whardake 5 Mar 97 11:35:18
+ - (*.c, *.h): Patch from Niels Baggesen to prototype *everything*.
+
+whardake 5 Mar 97 11:37:35
+ - (README): Contributer name addition.
+
+whardake 5 Mar 97 15:06:41
+ - (*.c, *.h): Patch from Niels Baggesen to prototype *everything*.
+
+whardake 5 Mar 97 16:13:38
+ - (acl_vars.c): incorrectly fixed prototyping errors for write_acl().
+
+whardake 5 Mar 97 16:15:54
+ - (snmp_api.c): fixed prototyping errors in snmp_parse. Possibly wrong.
+
+whardake 5 Mar 97 16:29:05
+ - (snmp_api.c): Yep. It was wrong. Tested and works now.
+
+whardake 7 Mar 97 09:06:34
+ - (extensible/* -> mibgroup/*): moved extensible stuff to mib modules.
+
+whardake 7 Mar 97 09:07:07
+ - (snmp_vars.c): removed more non-mibgroup specific calls and headers.
+
+whardake 7 Mar 97 09:59:28
+ - (snmp_vars.h, mibgroup/*): strict-prototyping and config_require()s.
+
+whardake 7 Mar 97 10:07:53
+ - (mibmodule/versiontag): moved into place from extensible/
+
+whardake 7 Mar 97 10:34:53
+ - (hpux.[ch]): Added hpux specific files from extensible dir.
+
+whardake 7 Mar 97 10:43:08
+ - (extensible/*): cvs removing files.
+
+whardake 7 Mar 97 10:49:00
+ - (mibgroup/struct.h): moved to here.
+
+whardake 7 Mar 97 11:43:05
+ - (config*): generate a mib_module_config.h with defines of whats being used.
+
+whardake 7 Mar 97 13:39:24
+ - (makedepend.in): new make depend script
+
+whardake 7 Mar 97 13:40:40
+ - (remove-files): add makedepend.in
+
+whardake 7 Mar 97 13:46:15
+ - (Makefile.in, sedscript.in): Fix sedscript generation. sigh.
+
+whardake 7 Mar 97 13:47:45
+ - (agent/Makefile.in): make depend and extensible/ removes.
+
+whardake 7 Mar 97 13:48:59
+ - (snmp_agent.c, snmp_vars.c, snmpd.c): remove extproto.h include.
+
+whardake 7 Mar 97 13:50:15
+ - (mibgroup/Makefile.in, apps/Makefile.in, snmplib/Makefile.in): depend.
+
+whardake 7 Mar 97 13:50:52
+ - (hpux.c): ifdef a few headers for correct make depend.
+
+whardake 7 Mar 97 13:51:30
+ - (snmplib/snmp.c): remove second ctype.h include.
+
+whardake 7 Mar 97 14:01:51
+ version tag ( 3.1.4.pre3 )
+
+whardake 7 Mar 97 15:01:05
+ - (mibgroup/*): removed {} requirement from config_load_mib() calls.
+
+whardake 7 Mar 97 15:02:18
+ - (configure): removed {} requirement from config_load_mib() calls.
+
+whardake 7 Mar 97 16:09:58
+ - (config*): make new configure options respect $(srcdir).
+
+whardake 7 Mar 97 16:11:50
+ - (common_header.h): comment out end of #endif.
+
+whardake 10 Mar 97 16:55:46
+ - (configure.in): New configure option: --with-out-mib-modules="list".
+
+whardake 10 Mar 97 17:28:29
+ - (configure.in): space protect modules when checking for with grep.
+
+whardake 11 Mar 97 09:04:03
+ - (ip.c): freebsd2 patch.
+
+whardake 11 Mar 97 17:39:23
+ - (mibgroup/*):
+ - remove trailing ;s on bunches of functions.
+ - make everything but interfaces.c compile on irix6.3.
+ - (config*,system.c): use uname and gethostname if available.
+ - (configure.in, configure): Don't check _KERNEL if ifnet.if_mtu already works.
+
+whardake 12 Mar 97 09:28:04
+ - (mibgroup/snmp.[hc] -> mibgroup/snmp_mib.[hc]): Moved due to name clashes.
+
+whardake 12 Mar 97 15:47:00
+ - (configure.in, snmpd.c, snmp_agent.c, route_write.[ch],
+ var_route.[ch], ip.[ch], snmp.[ch] -> snmp_mib.[ch]):
+ - Moved snmp mib module -> snmp_mib for naming conflicts with snmplib.
+ - Moved snmp_var_route.c -> mibgroup/var_route.c
+ - Moved write_route.c -> mibgroup/write_route.c
+
+whardake 12 Mar 97 15:48:37
+ - (*/Makefile.in): make depend update.
+
+whardake 12 Mar 97 15:55:20
+ - (mibgroup/README): doc update from Dave Shield.
+
+whardake 12 Mar 97 17:15:20
+ - (snmp_api.c): returns from inet_addr are in_addr_t (u_int) not u_long.
+
+whardake 13 Mar 97 09:37:37
+ - (config*): check for in_addr_t and define as u_int (32 bits) if not present.
+ - (apps/*.c, party_parse.c): use it.
+
+whardake 13 Mar 97 10:14:59
+ - (extensible_subtrees.h): Removed file.
+
+whardake 13 Mar 97 14:35:05
+ - (agent/*, mibgroup/*): moved alarm, context, views, event, party,
+ and acl variable groups to mibgroup/.
+
+whardake 13 Mar 97 14:44:55
+ - (kernel_sunos5.[ch]): moved to mibgroup/.
+ - (route_write.c, snmp_var_route.c): delete from agent dir.
+
+whardake 13 Mar 97 15:35:26
+ - (hpux.c, memory.c, memory.h): Patch from Dave Shields to fix minor problems.
+
+whardake 13 Mar 97 15:36:14
+ - (view_vars.c, context_vars.c, acl_vars.c): don't include snmpv2_vars.h.
+
+whardake 13 Mar 97 15:45:14
+ - (config*): check for system dependent modules.
+
+whardake 13 Mar 97 15:46:16
+ - (*/Makefile.in): New make depend rules to seperate system/non dependent stuff.
+
+whardake 13 Mar 97 16:07:52
+ - (*/Makefile.in): make depend and rule fixes as well.
+
+whardake 13 Mar 97 16:10:58
+ - (config*): remove duplicate gethostname check.
+
+whardake 13 Mar 97 16:17:59
+ - (apps/*/Makefile.in): depend problems fix.
+
+whardake 13 Mar 97 17:17:32
+ - (common_header.h): fix path to alarm.h.
+
+whardake 13 Mar 97 17:47:32
+ - (many): Patch from Niels Baggensen:
+ - A large number of problems with the Linux port
+ - Some problems with NetBSD 1.2C, but it's still not perfect
+ - More (symbolic) debug output from snmpd, when using -V. -d implies -V
+ Shows you variable requested and value returned
+ - Return ipRouteMask under Solaris
+ - snmpnetstat -r shows non-standard netmasks
+ - snmpnetstat -o (new) shows interface octets, without enquiring for mtu
+ and other variables not present for a Cisco Frame-Relay virtual circuit
+ interface
+ - snmpnetstat tcp/udp print-out had ntohs/htons in wrong places for port
+ numbers (shows up on little-endian architectures)
+ - adds a maketarget script that can be used to create a parallel symlinked
+ source directory. Useful if your make does not support VPATH
+
+whardake 14 Mar 97 09:39:15
+ - (ucd-snmp.txt, mib.txt, Makefile.in): Don't build mib files anymore.
+
+whardake 14 Mar 97 09:46:31
+ - (ucd-snmp.txt): moved to mibs/.
+
+whardake 14 Mar 97 09:47:47
+ - (mib.txt): streamed down.
+
+whardake 14 Mar 97 09:50:03
+ - (mibs/{rfc1271,snmpv2,ucd-snmp}.txt): New mibs directory for sub-mibs.
+
+whardake 14 Mar 97 10:48:35
+ - (Makefile.in, config*, mibs/Makefile.in): enable mibs/ make install.
+
+whardake 14 Mar 97 10:49:03
+ - (ucd-snmp.txt): remove the last of the sed script defs.
+
+whardake 14 Mar 97 11:01:19
+ - (snmpd.1.def): Updated to include -c/-C and SNMPCONFPATH env var.
+
+whardake 14 Mar 97 11:07:16
+ - (Makefile.in): Fix sedscript to include s# as well as s/ commands.
+
+whardake 14 Mar 97 11:17:06
+ - (makedepend.in): run on snmpnetstat dir also.
+
+whardake 14 Mar 97 11:18:17
+ - (agent/Makefile.in, apps/snmpnetstat/Makefile.in): make depend.
+
+whardake 14 Mar 97 11:20:39
+ - (snmp_vars_event.h): axe.
+
+whardake 14 Mar 97 11:22:29
+ - (snmp_groupvars.h): axe.
+
+whardake 14 Mar 97 13:51:59
+ - (configure.in, apps/Makefile.in): fix trap by including optional .o files.
+
+whardake 14 Mar 97 13:53:22
+ - (snmpd.c, context_parse.c, party_parse.c, system.[ch]):
+ - 64bit fix: get_myaddr() should return int not long.
+
+whardake 14 Mar 97 13:54:22
+ - (acconfig.h, ucd-snmp.txt): recognize new hosts for sysObjectId.
+
+whardake 14 Mar 97 13:55:50
+ version tag ( 3.1.4.pre4 )
+
+whardake 14 Mar 97 16:16:52
+ - (mibgroup/README): Update from Dave Shield.
+
+whardake 18 Mar 97 16:52:34
+ - (FAQ): Update from Dave Shield.
+
+whardake 18 Mar 97 16:53:26
+ - (FAQ): snmp.conf -> snmpd.conf
+
+whardake 24 Mar 97 09:49:54
+ - (memory.c): prototype write function better.
+
+whardake 24 Mar 97 09:50:49
+ - (example.c,.h): New example mib module duplicating the passtest
+ script in C code.
+
+whardake 24 Mar 97 09:51:16
+ - (Makefile.in): Watch out for multiple spaces in C defs.
+
+whardake 24 Mar 97 09:51:33
+ - (README): runs on bsdi 2.1.
+
+whardake 24 Mar 97 13:56:50
+ - (FAQ): Patch from Dave Shield.
+
+whardake 25 Mar 97 09:39:01
+ - (EXAMPLE.conf.def): added syslocation and syscontact examples.
+
+whardake 25 Mar 97 13:30:05
+ - (INSTALL): minor doc update for new flags.
+
+whardake 26 Mar 97 17:05:11
+ - (mibgroup/system.c): report agent uptime rather than system uptime.
+
+whardake 22 Apr 97 08:42:01
+ - (FAQ): various updates.
+
+whardake 22 Apr 97 15:02:56
+ - (many): Patch from Niels Baggesen to fix various things, mostly on linux.
+
+whardake 22 Apr 97 15:20:30
+ - (README.smux, smux.c, smux.h, snmp_bgp.c, snmp_ospf.c, snmp_rip2.c):
+ - smux support for gated from Rohit Dube.
+
+whardake 22 Apr 97 15:47:06
+ - (common_header.h): remove duplicate (warning) TCP defines on osf4 systems.
+
+whardake 22 Apr 97 15:51:44
+ - (snmp_bgp.[ch], snmp_rip2.[ch], snmp_ospf.[ch]):
+ - conform to new module standards of coding.
+
+whardake 22 Apr 97 16:41:10
+ - (snmp_bgp.c, snmp_rip2.c, snmp_ospf.c, smux.[ch]):
+ - standardize headers for autoconf.
+ - smux_init() -> init_smux().
+ - SMUXDEBUG -> DODEBUG (--enable-debugging turns this on automatically).
+
+whardake 22 Apr 97 17:45:09
+ - (config*, smux.c): Check for headers and define FD_COPY if not defined.
+
+whardake 22 Apr 97 20:49:15
+ version tag ( 3.1.4.pre5 )
+
+whardake 9 May 97 22:38:15
+ - (mib.[ch], parse.[ch], Makefile.in): New parser from Dave Shield:
+ - Run-time control of initial module loading
+ (uses env variables MIBDIRS, MIBS, and MIBFILE)
+ - Defined interfaces for loading modules and retreiving entries
+ - Module scoping now includes Textual Conventions
+ - Tokens implemented internally no longer require importing the
+ corresponding modules
+
+whardake 9 May 97 22:46:30
+ - (smux.c, config*):
+ - check for sgtty.h and prototype better.
+
+whardake 9 May 97 22:46:46
+ - (TODO): Update.
+
+whardake 9 May 97 23:52:40
+ - (smux.[ch]): patches from Niels Baggesen: prototyping.
+
+whardake 10 May 97 00:03:32
+ - (mib.c, parse.c): patches from Niels Baggesen: prototyping (mostly).
+
+whardake 10 May 97 00:28:25
+ - (parse.c): Patch from Dave Shields: negative numbers in mibs.
+
+whardake 10 May 97 00:46:44
+ - (parse.c): Patch from Dave Shields: deal with anonymous IDs.
+
+whardake 10 May 97 00:50:20
+ - (parse.c): Patch from Dave Shields: deal with anonymous IDs (even better).
+
+whardake 10 May 97 16:41:23
+ - (bug-report): Patch from Dave Shields: don't submit blank bug-reports.
+
+whardake 10 May 97 16:45:14
+ - (FAQ): Patch from Dave Shields: update.
+
+whardake 10 May 97 16:52:11
+ - (mib_api.3): New file from Dave Shield.
+
+whardake 10 May 97 17:23:21
+ - (snmpd.c, read_config.c, system.c): Patch from Niels Baggesen:
+ - default trap community.
+ - multiple trap sinks.
+
+whardake 12 May 97 08:43:59
+ - (config*, extensible.c): BSDI3 specific headers and defines.
+
+whardake 12 May 97 08:44:19
+ - (agent/Makefile.in): removed CCHACK ???.
+
+whardake 12 May 97 08:48:13
+ - (INSTALL, README, TODO): documentation update.
+
+whardake 12 May 97 08:49:23
+ - (man/Makefile.in): install mib_api.3.
+
+whardake 12 May 97 08:52:48
+ - (mibs/ucd-snmp.txt): Patch from Mario DeFazio to fix typos.
+ - compiles under SNMPc 4.1g.
+
+whardake 13 May 97 10:51:28
+ - (IF-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:29
+ - (ucd.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:31
+ - (EtherLike-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:32
+ - (HOST-RESOURCES-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:33
+ - (IANAifType-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:35
+ - (IP-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:36
+ - (SNMPv2-CONF.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:37
+ - (SNMPv2-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:39
+ - (SNMPv2-SMI.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:40
+ - (SNMPv2-TC.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:42
+ - (SNMPv2-TM.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:43
+ - (TCP-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:45
+ - (UDP-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:46
+ - (SNMPv2-PARTY-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:48
+ - (SNMPv2-M2M-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:49
+ - (RFC1271-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:51
+ - (RFC1155-SMI.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:51:52
+ - (RFC1213-MIB.txt): New mib file from Niels Baggesen.
+
+whardake 13 May 97 10:52:12
+ - (ucd.txt): whoops. Removed.
+
+whardake 13 May 97 11:57:10
+ - (rfc1271.txt): removed.
+
+whardake 13 May 97 12:02:26
+ - (snmpv2.txt): removed.
+
+whardake 13 May 97 12:03:04
+ - (mibs/Makefile.in): removed snmpv2.txt, rfc1271.txt.
+
+whardake 13 May 97 14:48:59
+ - (ucd-snmp.txt): Changed ID to UCD-SNMP
+
+whardake 13 May 97 15:05:28
+ - (config*, INSTALL): New flags to set prompted values instead of prompting.
+
+whardake 13 May 97 15:05:53
+ - (README): architecture list update.
+
+whardake 13 May 97 15:36:08
+ - (UCD-SNMP-MIB.txt): moved from ucd-snmp.txt.
+
+whardake 13 May 97 15:36:51
+ - (ucd-snmp.txt): moved to UCD-SNMP-MIB.txt
+
+whardake 13 May 97 15:38:47
+ - (mibs/Makefile.in): ucd-snmp.txt -> UCD-SNMP-MIB.txt.
+
+whardake 13 May 97 16:22:13
+ - (config*,mib.c): New configure option --with-default-mibs="list:list".
+
+whardake 14 May 97 11:41:09
+ - (Makefile.in, mib.txt): removed mib.txt from distribution. No longer needed.
+
+whardake 14 May 97 13:13:19
+ - (Makefile.in): warn if mib.txt is installed from a previous release.
+
+whardake 14 May 97 13:18:02
+ - (Makefile.in, agent/Makefile.in): Patch from Oddbjorn Steffensen:
+ - Protect against bash needing ';'s on multiple subdir makes.
+
+whardake 14 May 97 13:45:24
+ - (snmpd.c): Typecast malloc.
+
+whardake 14 May 97 15:00:22
+ version tag ( 3.1.4.pre6 )
+
+whardake 15 May 97 11:22:18
+ - (interfaces.c): patch from Martin Jacobsson for FreeBSD
+
+whardake 15 May 97 11:23:29
+ - (parse.c): Patch from Dave Shield to fix purely numeric OIDs.
+
+whardake 15 May 97 11:28:15
+ - (INSTALL): patch from Niels Baggesen to reference the maketarget script.
+
+whardake 15 May 97 11:29:33
+ - (mib_api.3): patch from Niels Baggesen: MIBS variable can be set to ALL.
+
+whardake 15 May 97 11:30:01
+ - (UCD-SNMP-MIB.txt): patch from Niels Baggesen: import indentifiers.
+
+whardake 15 May 97 11:31:01
+ - (SNMPv2-SMI.txt): patch from Niels Baggesen: ccitt -> 0.
+
+whardake 15 May 97 11:32:56
+ - (mib.c, parse.c): patch from Niels Baggesen:
+ - prototyping and null checking.
+ - if MIBS is set to ALL, parse everything found.
+
+whardake 15 May 97 14:37:39
+ - (parse.c): patch from Dave Shield:
+ - deal with multiple module ID's being referenced or nodes defined.
+ - supress "name clash" warnings for anonymous nodes.
+
+whardake 15 May 97 15:22:51
+ - (parse.h): Patch from Dave Shield: Add new node structure entries.
+
+whardake 15 May 97 16:01:18
+ - (config*, mib.c):
+ - Changed env variable MIBFILE -> MIBFILES (since it is a list now).
+ (will accept MIBFILE for backwards compatibility).
+ - By default, *no* additional mibfiles are loaded (ie, mib.txt is no
+ longer loaded) and must be turned on through configure or the env var.
+ - New configure options to set default MIBS, MIBFILES, MIBDIRS.
+
+whardake 15 May 97 16:22:19
+ - (configure*, INSTALL):
+ - Display defaults in configure --help lines.
+
+whardake 15 May 97 16:26:12
+ - (configure*, INSTALL):
+ - Wording and order changes in configure --help lines.
+
+whardake 15 May 97 16:43:37
+ - (udp.c): Patch from Martin Jacobssen:
+ - Fix udp_inpcb structures.
+
+whardake 16 May 97 11:25:30
+ - (parse.c): Protect malloc against 0 external imports.
+
+whardake 20 May 97 08:03:35
+ - (udp.c): Only do Martin Jacobssen's fixes for freebsd2.
+
+whardake 20 May 97 08:18:49
+ - (SNMPv2-TC.txt): Comment out ObjectSyntax import.
+
+whardake 20 May 97 08:19:12
+ - (parse.c): protect against 0 import calls.
+
+whardake 20 May 97 08:19:28
+ - (mib.c, snmp_auth.c): include sys/select.h for AIX.
+
+whardake 20 May 97 10:08:25
+ version tag ( 3.1.4.pre7 )
+
+whardake 20 May 97 11:24:27
+ - (udp.c): Patch from Martin Jacobsson: Fix my cpp stupidity.
+
+whardake 20 May 97 16:50:18
+ - (TODO): snmpset should check against size defined in mib.
+
+whardake 20 May 97 16:50:55
+ - (parse.c): code from Dave Shield: add back in find_node() for perl usage.
+
+whardake 21 May 97 10:13:38
+ - (NEWS): Update for 3.2.
+
+whardake 21 May 97 15:38:32
+ - (NEWS): Changes from Dave.
+
+whardake 21 May 97 15:40:31
+ - (FAQ): Changes from Dave.
+
+whardake 22 May 97 13:13:59
+ - (SNMPv2-M2M-MIB.txt): restored. Got truncated.
+
+whardake 23 May 97 13:35:14
+ - (acconfig.h, config.h.in): Set default MIB list.
+
+whardake 23 May 97 13:36:17
+ - (snmpd.c): Patch from Niels Bagessen to fix endiannes problems.
+
+whardake 23 May 97 13:37:02
+ - (HOST-RESOURCES-MIB.txt, SNMPv2-TC.txt): From Niels: change import clauses.
+
+whardake 23 May 97 13:37:39
+ - (snmp_client.c): Patch from Niels Bagessen to fix endiennes problems.
+
+whardake 23 May 97 13:38:13
+ - (snmp_api.c): Patch from Niels Bagessen to fix multiple frees in v2 pdu's.
+
+whardake 23 May 97 13:40:09
+ - (mib.c): Patch from Dave Shields to fix SNMP perl again.
+
+whardake 23 May 97 13:40:32
+ - (snmp_api.h): Change trap types from int to long.
+
+whardake 23 May 97 16:23:56
+ version tag ( 3.1.4.pre8 )
+
+whardake 23 May 97 16:34:33
+ - (mib_api.3): Modifiy to note default mibs.
+
+whardake 26 May 97 10:50:20
+ - (INSTALL, configure): default mibs listed correctly.
+
+whardake 26 May 97 10:52:12
+ - (snmp_api.h): trap long's back to ints, bad solution.
+
+whardake 26 May 97 10:56:19
+ - (snmpcheck.def): new variables to set walk/get/set command line usage.
+
+whardake 26 May 97 11:38:41
+ - (parse.c): Patch from niels Baggesen to:
+ - close mibfiles for MIBS=ALL.
+ - Allow SYNTAX DisplayString (SIZE(1..255)) inside OBJECT-TYPE.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.1.2.1 -> V3.1.3
+
+whardake 10 Jan 97 08:43:42
+ - (COPYING): Update for 97.
+
+whardake 10 Jan 97 08:46:00
+ - (config*): Check for /dev/ksyms for solaris kernel.
+
+whardake 10 Jan 97 08:46:36
+ - (snmptrapd.c): Remove broken FD_SET code.
+
+whardake 14 Jan 97 16:45:33
+ - (PORTING, README, TODO): Added ucd-snmp-coders as default mail address.
+
+whardake 17 Jan 97 09:28:56
+ patch niels.0
+
+whardake 17 Jan 97 11:51:40
+ - (snmpd.c, extensible.c):
+ - New arg -c FILE: Read FILE as a configuration file as well.
+ - New arg -C: Don't read default configuration files.
+ - New env SNMPCONFPATH: Read snmpd{,.local}.conf files in : seperated path.
+
+whardake 17 Jan 97 11:58:46
+ - (snmpd.c):
+ - Usage() update and version printout update.
+
+whardake 17 Jan 97 14:55:28
+ Dave Shield patches
+
+whardake 20 Jan 97 11:17:53
+ Niel's patches integrated
+
+whardake 20 Jan 97 15:09:25
+ - Patches from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - implemented: interfaces.ifTable.ifEntry.ifSpecific,
+ ip.ipRoutingDiscards,
+ ip.ipAddrTable.ipAddrEntry.ipAdEntReasmMaxSize,
+ ip.ipRouteTable.ipRouteEntry.ipRouteMask ,
+ ip.ipRouteTable.ipRouteEntry.ipRouteMetric5,
+ ip.ipRouteTable.ipRouteEntry.ipRouteInfo, ip.ipNetToMediaTable,
+ udp.udpTable.
+ - udp connection table.
+ - ipNetToMedia.
+
+ - Patches from Niels Baggesen <Niels.Baggesen@uni-c.dk>:
+ - udpNoPort, tcpInErrs fixes for Solaris.
+ - linux application support.
+ - snmp variable group.
+ - simple cold start traps via exec('snmptrap').
+ - MIB parser fixes.
+ - Memory/free allocation fixes.
+
+whardake 20 Jan 97 15:22:53
+ - Patches from Niels Baggesen <Niels.Baggesen@uni-c.dk>:
+ - (snmp_client.c): Wait 120 seconds before returning.
+
+whardake 20 Jan 97 15:37:08
+ - (config*): Autoheader is dumb: Put macro defines belowe @BOTTOM@ symbol.
+
+whardake 20 Jan 97 15:38:59
+ - (snmp_vars.c, extensible.c, read_config.c): Remove ANSI cpp #elif's.
+
+whardake 20 Jan 97 15:50:37
+ - (snmp_vars.c): bsdi #ifdef fixes.
+
+whardake 20 Jan 97 15:55:45
+ - (snmp_vars.c): Patch from Martin Jacobsson <martin@exmandato.se>:
+ - add bsdi to some #ifdefs.
+
+whardake 20 Jan 97 15:58:51
+ - (extensible.c): Patch from Martin Jacobsson <martin@exmandato.se>:
+ - watch out for string lengths on version desc and sysname.
+
+whardake 20 Jan 97 16:38:20
+ patrice.1 patch
+
+whardake 20 Jan 97 16:43:25
+ - (snmp_api.c, snmp_client.[ch]):
+ - Patch from Patrice VANACKER <vanacker@worldnet.fr>:
+ - fix request deletions in snmp_read().
+ - added return argument to snmp_add_null_var().
+
+whardake 20 Jan 97 16:59:02
+ - (extensible.c): Patch from sxjzhang@sss.ssi1.com:
+ - fix disk reporting on sunos 4.1.3 with ODS 1.0.
+
+whardake 20 Jan 97 16:59:56
+ version tag ( 3.1.3.pre1 )
+
+whardake 21 Jan 97 08:33:04
+ - (read_config.c): Patch from Karl Lehenbauer <karl@hammer1.ops.NeoSoft.com>:
+ - #if DODEBUG -> #ifdef DODEBUG.
+
+whardake 21 Jan 97 08:33:52
+ - (snmpd.c): remove second char definition.
+
+whardake 21 Jan 97 08:34:32
+ - (snmp_client.h): remove second (wrong) function prototype.
+
+whardake 21 Jan 97 09:17:42
+ - (snmp_var_route.c, snmp_vars.c):
+ - Patch from Karl Lehenbauer <karl@hammer1.ops.NeoSoft.com>
+ - handle multiple interface names > 10 properly.
+
+whardake 29 Jan 97 10:47:40
+ bug reporting script add
+
+whardake 29 Jan 97 12:07:00
+ - (bug-report):
+ - Always use multipart: version info and config.cache are one.
+ - re-arranged a bit.
+ - Added introduction.
+ - Guess at domain name if possible.
+
+whardake 29 Jan 97 12:07:59
+ - (acconfig.h):
+ - SNMPBLOCK = !SNMPBLOCK
+
+whardake 29 Jan 97 12:09:05
+ - (aclocal.m4): Fix check_struct_for to define things correctly.
+
+whardake 29 Jan 97 12:10:28
+ - (configure.in): New ps options to check for.
+
+whardake 29 Jan 97 12:11:04
+ - (FAQ): revision one!
+
+whardake 29 Jan 97 12:11:29
+ - (config.h.in, configure): update
+
+whardake 29 Jan 97 12:58:46
+ - (kernel.c, snmp_agent.c, snmpd.c): Patch from Niels Baggesen:
+ - Fix various warnings/errors.
+ - Implement real traps.
+
+whardake 29 Jan 97 13:03:15
+ - (versiontag): Modify ../../bug-report as well.
+
+whardake 29 Jan 97 13:08:11
+ - (bug-report):
+ - change to address (back) to ucd-snmp-coders.
+ - Add a trap on signals to remove tmp files.
+
+whardake 31 Jan 97 09:58:10
+ - (config*): Check for kstat.h and if sysctl can read the boottime.
+
+whardake 31 Jan 97 10:01:59
+ - (snmp_var_route.c, snmp_vars.c): Patch from Martin Jacobsson:
+ - Change some system specific ifdefs to CAN_USE_SYSCTL.
+ - Fix compliation errors on bsdi2.
+ - Fix routing tables for similar.
+
+whardake 31 Jan 97 10:49:07
+ - (versiontag): uh, commit it again.
+
+whardake 31 Jan 97 10:50:04
+ - (configure.in, configure): fire off ksh if hpux && sh.
+
+whardake 31 Jan 97 10:59:43
+ - (configure.in, configure): changed arch to hppa and make sure /bin/ksh exists.
+
+whardake 31 Jan 97 11:03:11
+ version tag update
+
+whardake 3 Feb 97 10:02:12
+ - (bug-report): Patch from Dave Shield:
+ - domain name fix and editor bomb out.
+
+whardake 3 Feb 97 10:03:10
+ - (EXAMPLE.conf.def): comment out possible security problem lines.
+
+whardake 3 Feb 97 10:46:02
+ - (configure.in):
+ - Check for whoami, logname.
+ - Don't pass null args to ksh.
+
+whardake 3 Feb 97 10:47:04
+ - (snmp_vars.c): Patch from Dave Shield
+ - Mark stuff for later changes.
+
+whardake 3 Feb 97 10:48:06
+ - (snmplib/system.c): Use CAN_USE_SYSCTL instead of bsdlike.
+
+whardake 3 Feb 97 11:50:23
+ - (config*):
+ - Check for irix 6.2 headers.
+ - Check if _KERNEL needs to be defined for irix and ifnet usage.
+ - Use the found UNAME program instead of assuming we have it.
+
+whardake 3 Feb 97 12:44:51
+ - (snmplib/system.c): typo: needs a space between 'static' and 'struct'.
+
+whardake 3 Feb 97 12:47:58
+ - (snmp_vars.c): add some irix appropriate includes.
+
+whardake 3 Feb 97 12:51:04
+ - (README): remove project history.
+
+whardake 3 Feb 97 13:15:11
+ - (README):
+ - added FAQ pointer.
+ - Dave's English pointers (ie, he proofed it and I, uh, don't...).
+ - switch ftp mirror.
+ - bug-report script mentioned.
+ - I -> We, me -> us...
+
+whardake 3 Feb 97 13:33:11
+ - (README, NEWS, TODO): Update for 3.1.3.
+
+whardake 3 Feb 97 13:53:04
+ - (bug-report): move config.cache to end of message.
+
+whardake 3 Feb 97 13:55:05
+ version tag ( 3.1.3.pre3 )
+
+whardake 4 Feb 97 09:35:02
+ - (FAQ): Dave's latest revision.
+
+whardake 4 Feb 97 09:35:37
+ - (TODO): Added suggestions from ucd-snmp-coders.
+
+whardake 4 Feb 97 09:36:43
+ - (configure, configure.in): Fix hpux problems, *again*.
+
+whardake 4 Feb 97 09:37:26
+ - (mib.c): Patch from Simon: comment #ifdef endings for ANSI compliers.
+
+whardake 4 Feb 97 09:41:39
+ - (FAQ): Added TOC and autor notes ;-).
+
+whardake 5 Feb 97 16:33:01
+ - (FAQ): Dave updated architecture lists.
+
+whardake 5 Feb 97 16:33:32
+ - (TODO): misc requested additions.
+
+whardake 5 Feb 97 17:07:25
+ - (configure, configure.in): Put /dev/ksyms ahead of /kernel/unix.
+
+whardake 5 Feb 97 17:11:15
+ - (many): Patch from Niels Baggesen:
+ - snmp mib group cleanups.
+ - trap generation cleanups.
+ - added man entries for trap generation.
+ - improved agent debugging output with agent's -d flag.
+
+whardake 5 Feb 97 17:13:09
+ - (system.c): Patch from Dave Shield to fix nlist problems.
+
+whardake 5 Feb 97 17:20:10
+ - (bug-report): Change subject line to shorten and force better description.
+
+whardake 5 Feb 97 17:23:41
+ - (tcl, tk, snmptcl): Nuked.
+
+whardake 5 Feb 97 17:25:03
+ - (NEWS): removed tcl stuff.
+
+whardake 5 Feb 97 17:29:54
+ - (Makefile.in, configure.in): removed tcl stuff.
+
+whardake 5 Feb 97 17:41:50
+ version tag ( 3.1.3.pre4 )
+
+whardake 10 Feb 97 09:22:03
+ - (FAQ): Dave Shields' additions: finding more info.
+
+whardake 10 Feb 97 09:22:53
+ - (snmpnetstat/main.c): Remove malloc prototype, now in stdlib.h.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.1.2 -> V3.1.2.1
+
+whardake 5 Dec 96 09:13:56
+ - (if.c): #ifndef -> #ifdef for sigset.
+
+whardake 5 Dec 96 09:14:59
+ - (md5.c): remove ansi specific C features (unsigned constants).
+
+-------------------------------------------------------------------------------
+
+Changes: V3.1.1 -> V3.1.2
+
+whardake 17 Oct 96 07:02:58
+ version tag ( 3.1.1.BSDI )
+
+whardake 30 Oct 96 13:47:21
+ - (PORTING,README): Add a new PORTING file to reference autoconf plee.
+
+whardake 30 Oct 96 13:49:09
+ - (config*, ece-mib.def):
+ - Change extensible mib location to ucdavis enterprise mib: 2021.
+ - Remove associated prompting from configure script and etc.
+
+whardake 31 Oct 96 17:06:16
+ - (read_config.c): numdisks was being incremented before last usage.
+
+whardake 1 Nov 96 08:54:11
+ - (asn1.c): Patch from Simon Leinen <simon@switch.ch>:
+ - asn_build_unsigned_int, asn_build_unsigned_int64:
+ - Don't try to strip FFs from the high end of unsigned values.
+ - Skip the stripping code entirely if we have to add a null byte.
+
+whardake 4 Nov 96 09:30:46
+ - (config*, snmp_vars.c, extensible.c): More include checks for linux.
+
+whardake 4 Nov 96 10:08:49
+ - (config*): Check for nlist in -lmld (irix).
+
+whardake 7 Nov 96 09:16:45
+ - NetBSD 3.1.0.1 branch merge.
+
+whardake 7 Nov 96 09:24:23
+ - Niels 3.1.1 branch merge.
+
+whardake 7 Nov 96 09:35:52
+ - BSDi2 3.1.1 branch merge.
+
+whardake 7 Nov 96 09:57:16
+ - (versiontag): Only tag release versions (Ext*).
+
+whardake 7 Nov 96 14:16:00
+ - (configure.in, configure): Changed default SNMPV2AUTH to SNMPV1.
+
+whardake 7 Nov 96 14:16:39
+ - (snmp_var_route.c): ifdef's around strings.h.
+
+whardake 7 Nov 96 14:17:17
+ - (snmp_vars.c): ifdef typos.
+
+whardake 7 Nov 96 14:19:33
+ - (mib.c): typecast for sprint_objid().
+
+whardake 8 Nov 96 17:03:47
+ - (Makefile.in): Created a 'touchit' to touch config files properly.
+
+whardake 8 Nov 96 17:06:46
+ - (Makefile.in): Fixed 'touchit'.
+
+whardake 14 Nov 96 15:14:50
+ - (extensible.c): Use statfs if statvfs is unavailable.
+
+whardake 14 Nov 96 15:16:22
+ - (snmp_vars.c):
+ - #ifdef typo.
+ - prototype for Interface_Scan_Init().
+ - Check for existance of tcpstat.tcps_rcvmemdrop before using.
+
+whardake 14 Nov 96 15:17:36
+ - (config*):
+ - Check for existance of tcpstat.tcps_rcvmemdrop.
+ - Check for sys/vfs.h.
+
+whardake 14 Nov 96 15:24:24
+ - (snmptrap.c, inet.c, route.c): typecasting warning fixes.
+
+whardake 15 Nov 96 16:43:33
+ - (config*, extensible.c): Make uname calls work correctly.
+
+whardake 15 Nov 96 16:44:11
+ - (parse.c): Add back in "reading mib..." debugging statments.
+
+whardake 22 Nov 96 08:18:29
+ - (snmp_vars.c): Trash interface caching.
+
+whardake 22 Nov 96 09:06:10
+ - (snmp_vars.c): Merge from FreeBSD2-3-1-1.
+ - Add checks for ifnet.[io]bytes.
+
+whardake 22 Nov 96 09:14:22
+ - (config*): Add checks for ifnet.[io]bytes.
+
+whardake 22 Nov 96 11:35:29
+ - (agent/extensible/*.c, new: extproto.h): Removed all -Wall warnings!
+
+whardake 22 Nov 96 14:38:05
+ - (config*, install-sh, mkinstalldirs): Upgraded to autoconf 2.11.
+
+whardake 22 Nov 96 15:10:36
+ - (extensible.c, read_config.c): removed more -Wall warnings.
+
+whardake 24 Nov 96 16:25:07
+ - (kernel.c, config*, INSTALL): New configure switch: --without-root-access.
+ - The agent doesn't exit if it can't open /dev/kmem.
+
+whardake 24 Nov 96 16:45:27
+ version tag ( 3.1.2.pre1 )
+
+whardake 25 Nov 96 08:44:03
+ - ({agent,apps}/Makefile.in): Put libsnmp.a in front of -l libs.
+
+whardake 25 Nov 96 09:15:57
+ - (config*, snmp_impl.h): Moved void -> char define to a configure test.
+
+whardake 27 Nov 96 08:02:06
+ - (snmp_vars.c): Patch from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - Change comments to reflect what its actually looking at.
+ - Remove ifdef around ifnet declarations.
+
+whardake 27 Nov 96 08:03:47
+ - (extensible.c): Patch from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - Remove return(0) on void init_extensible().
+
+whardake 27 Nov 96 08:06:04
+ - (configure, configure.in): Default sysloc UCDavis -> Unknown.
+
+whardake 27 Nov 96 08:21:20
+ - (INSTALL): Typo: 3.1.3 -> 3.0.3.
+
+whardake 27 Nov 96 08:21:34
+ - (README): Update.
+
+whardake 27 Nov 96 08:34:12
+ - (if.c): Patch from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - Watch out for interface names with ' ' in them.
+ - Reset signal on BSD signal implementations.
+
+whardake 27 Nov 96 08:45:46
+ - (if.c): Reset signal on all types of signal implementations.
+
+whardake 27 Nov 96 08:56:44
+ - (configure.in, configure): Truncate system names beyond [-_].*.
+
+whardake 2 Dec 96 08:55:49
+ - (snmp_vars.c): Patch from Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - ifPhysAddr - in Interface_Get_Ether_By_Index, HP-UX has the same
+ EtherAddr strucure as MIPS.
+
+ - ipAdEntIfIndex - in var_ipAddrEntry, there is a false match on
+ the loopback interface, giving the wrong answer of the first
+ interface index.
+
+ - udpInErrors - in var_udp, the count of UDP errors omits discarded
+ packets. Some systems (i.e. HP-UX) have extended the udpstat
+ structure to include these. I'v tweaked this analogous to a
+ similar addition in the tcpstat structure.
+
+ - tcpConnState - HP-UX has added an extra state into the list, which
+ throws the rest of them out.
+
+whardake 3 Dec 96 10:04:02
+ - (config*, snmp_vars.c):
+ - Wrote AC_CHECK_STRUCT_FOR and use it.
+ - Make AC_CHECK_IFNET_FOR use above.
+ - Changequote '[]' -> '' around sed expression with []s (-Dostype).
+
+whardake 3 Dec 96 10:05:17
+ - (md5.c): Put 'U'nsigned marker at end of constants to remove gcc warns.
+
+whardake 3 Dec 96 11:04:33
+ - (snmp_vars.c): From Dave Shield <D.T.Shield@csc.liv.ac.uk>:
+ - Fix arp table for hpux.
+ - (config*): Check for arphd.at_next and use in above.
+
+whardake 3 Dec 96 11:14:43
+ - (EXAMPLE.conf.def, passtest): Move passtest to ucdavis subtree.
+
+whardake 3 Dec 96 14:51:24
+ - (ece-mib.def): Used -> Avail in memory sequence.
+
+whardake 4 Dec 96 09:16:09
+ - (asn1.c, parse.c, snmp_api.c, snmp_client.c):
+ - Patch from Niels Baggesen <Niels.Baggesen@uni-c.dk>:
+ - Parser fixes for multiple nodes.
+ - memmove/copy deletes.
+
+whardake 4 Dec 96 09:49:38
+ - (PORTING, README): Update for release 3.1.2.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.1.0.1 -> V3.1.1
+
+whardake 11 Sep 96 08:49:14
+ - (read_config.c): Fixed community number checks.
+
+whardake 24 Sep 96 16:54:59
+ - (config*, snmp_api.c, snmp_client.c): Added sys/select.h for AIX.
+
+whardake 24 Sep 96 16:59:26
+ - (snmp_var_route.c, snmp_vars.c): typos.
+
+whardake 24 Sep 96 17:02:47
+ - (snmp_vars.c): Moved a variable declairation.
+
+whardake 24 Sep 96 17:16:58
+ - (snmp_var_route.c): typo fixing a typo (sigh..).
+
+whardake 25 Sep 96 14:14:53
+ - (snmp_var_route.c): freebsd2 typecast.
+
+whardake 1 Oct 96 15:30:46
+ - (parse.c, parse.h): From Joe Marzot:
+ - allows the CMU lib to retain the TC information associated with a
+ particular object. In particular this allows DisplayStrings to be
+ differentiated from OctetStrings when they are looked up in the
+ Mib Tree.
+
+whardake 1 Oct 96 15:54:22
+ - (extensible.c): int -> double to support larger disk sizes.
+
+whardake 1 Oct 96 16:28:52
+ - (config*, read_config.c):
+ - Check for mntent.h and include it.
+ - Check for /etc/mnttab or /etc/mtab and use appropriately.
+ - (read_config.c):
+ - pick getmntent over getfsfile if both are available.
+ - debug cleanup (ofile -> stderr, check for DODEBUG instead of const var).
+
+whardake 3 Oct 96 16:05:47
+ - (snmp_agent.c):
+ - Make agent properly check snmpset exit codes and use them (on COMMIT).
+
+whardake 3 Oct 96 16:08:59
+ - (pass.c):
+ - Check for passthru existance before returning ERR_NOERROR, else
+ return ERR_NOSUCHNAME.
+ - Correctly check for and pass "not-writable" and "wrong-type" pass returns.
+
+whardake 3 Oct 96 16:10:38
+ - (snmp_impl.h): Turn on old CMU debugging statments with --enable-debugging.
+
+whardake 4 Oct 96 09:43:40
+ - (EXAMPLE.conf.def): Added snmpget/set to pass example.
+
+whardake 4 Oct 96 09:44:26
+ - (Makefile.in): Remove spaces from sedscript when using broken cpp (gcc).
+
+whardake 4 Oct 96 09:46:09
+ - (snmpd.conf.5.def):
+ - Cleaned up man page formatting.
+ - Added note about SNMPset community strings.
+ - minor proof-reading (major proofing needed still).
+ - Re-organized a bit.
+
+whardake 4 Oct 96 10:01:20
+ - (snmpd.conf.5.def): lib -> lib/snmp path correction in FILES section.
+ - (snmpd.1.def):
+ - Added a FILES section.
+ - General clean up.
+
+whardake 7 Oct 96 07:41:40
+ - (parse.c): Now loads all mibs (files) in the directory SNMPLIB/mibs.
+
+whardake 7 Oct 96 07:49:59
+ - (parse.c): Proper autoconf dirent headers.
+
+whardake 7 Oct 96 08:01:43
+ - (Makefile.in): Mib installation changed to reflect new mib directory.
+
+whardake 7 Oct 96 08:53:06
+ - (config*): check correctly for get/setmntent.
+
+whardake 7 Oct 96 09:11:43
+ - (snmp_agent.c): Removed snmp version check on error return from set.
+
+whardake 7 Oct 96 09:12:23
+ - (read_config.c): Use getmntent correctly. Pain.
+
+whardake 7 Oct 96 10:22:47
+ - (Makefile.in):
+ - added --recheck to config.status call to regenerate self.
+ - Changed ece-mib.txt -> ucd-snmp.txt and install (and generate) properly.
+
+whardake 7 Oct 96 10:23:32
+ - (extensible.c): Chomp newline on uname output.
+
+whardake 7 Oct 96 10:24:12
+ - (read_config.c): Added 'syscontact' and 'syslocation' parsing.
+
+whardake 7 Oct 96 11:00:10
+ - (configure.in):
+ - timestamp stamp-h at end.
+ - emacs local vars.
+
+whardake 7 Oct 96 11:01:25
+ - (read_config.c): Remove extra args from strcpy (was strncpy).
+
+whardake 7 Oct 96 11:02:46
+ - (configure.in):
+ - timestamp stamp-h at end.
+ - emacs local vars.
+
+whardake 7 Oct 96 12:23:05
+ - (snmpd.1.def): Changed to reflect SNMPLIB/mibs.
+
+whardake 7 Oct 96 12:23:27
+ - (snmpd.conf.5.def): Added syscontact and syslocation.
+
+whardake 9 Oct 96 08:04:14
+ - (parse.c):
+ - Parse OBJECT-IDENTY as OBJECT-GROUP (saves only description).
+ - Change print_error(), read_mib() to reflect file and correct line number.
+
+whardake 9 Oct 96 08:30:29
+ - (parse.c):
+ - print a new line in print_error() if debugging is turned on.
+ - tossObjectIdentifier(): catch multiple bracket clauses (IE { {0 0} } ).
+
+whardake 9 Oct 96 14:36:03
+ - (read_config.c):
+ - strncmp -> strncasecmp.
+ - NULL -> 0.
+
+whardake 9 Oct 96 14:38:05
+ - (extensible.c):
+ - sort pass thrus by miboid to prevent passing off to wrong one.
+ - typos: exsten -> exten.
+ - init_extensible() calls update_config() to reduce duplications.
+
+whardake 9 Oct 96 15:18:42
+ - (snmp_api.c): From: gah@bellcore.com (Gary A. Hayward)
+ - Free pdu community to quelch purify.
+
+whardake 9 Oct 96 15:22:23
+ - (README): Added thanks name.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.1 -> V3.1.0.1
+
+whardake 26 Aug 96 10:36:08
+ - (NEWS) Typo, extra quotation mark.
+
+whardake 26 Aug 96 10:37:05
+ - (TODO) Extra mib parsing ideas added.
+
+whardake 26 Aug 96 10:37:36
+ - (ece-mib.def): commas out of place.
+
+whardake 26 Aug 96 16:55:51
+ - (snmp_api.c): Fixed a gcc/FreeBSD optimization bug (stupid compiler)
+
+whardake 26 Aug 96 16:58:03
+ - (event.c, kernel.c, route_write.c): FreeBSD modifications
+
+whardake 27 Aug 96 08:46:43
+ - (extensible.c): FreeBSD changes and use getloadavg if available.
+
+whardake 27 Aug 96 08:47:57
+ - (snmptrapd.c): Fix byte order problem (convert to network before sending).
+
+whardake 27 Aug 96 09:01:10
+ - (snmptrap.c):
+ - FreeBSD specific changes.
+ - more autoconf complete: paths to libraries and kernel location.
+
+whardake 27 Aug 96 09:38:33
+ - (snmp_var_route.c): FreeBSD specific changes.
+
+whardake 27 Aug 96 10:00:15
+ - (snmp_vars.c): More warped FreeBSD changes
+
+whardake 27 Aug 96 10:04:56
+ - (autoconf*):
+ - FreeBSD additions.
+ - New kernel location: /kernel (ick).
+ - Log file default intelligently checks for /var/log and /usr/adm.
+ - Checks for getloadavg().
+
+whardake 29 Aug 96 14:42:20
+ - (extensible/*.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - cleaned up gcc warnings.
+ - fixed a spelling error.
+
+whardake 29 Aug 96 14:59:55
+ - (apps/*.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - set exit codes of 0 for all apps.
+ - Removed SVR4 #ifdefs.
+ - Greatly improved snmptrap.
+
+whardake 29 Aug 96 15:03:12
+ - (man/snmptrap.1): added by Niels Baggesen <recnba@mediator.uni-c.dk>
+
+whardake 29 Aug 96 15:06:21
+ - (asn1.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - uchar(s) can't be less than 0.
+
+whardake 29 Aug 96 15:06:50
+ - (mib.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - prototypes for gcc warnings
+
+whardake 29 Aug 96 15:07:56
+ - (parse.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - save mib descriptions for snmptranslate and other apps that need it.
+
+whardake 29 Aug 96 15:08:28
+ - (snmp_api.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - gcc warnings NULL -> 0
+
+whardake 29 Aug 96 15:58:10
+ - (snmpstatus.c): Patch from Trevor Bourget <tbourget@qualcomm.com>
+ - malloc sysdesc instead of assuming < 128 bytes.
+
+whardake 29 Aug 96 16:03:44
+ - (snmpwalk.c): Removed SVR4 ifdefs
+
+whardake 29 Aug 96 16:22:25
+ - (autoconf*, snmp_vars.c): Removed some solaris ifdefs.
+
+whardake 29 Aug 96 16:29:10
+ - Changed my email address to my new one.
+
+whardake 30 Aug 96 09:23:05
+ - (configure, configure.in):
+ - removed -Xs flag for gcc on solaris.
+ - logfile checks for existance of /var/log and /usr/adm.
+
+whardake 30 Aug 96 09:23:42
+ - (snmptrap.c): patch screwed up.
+
+whardake 30 Aug 96 09:24:31
+ - (apps/Makefile.in): Added kernel_sunos5.o to snmptrap for getKstat.
+
+whardake 30 Aug 96 09:34:09
+ - (NEWS, ChangeLog): Updated for 3.1.0.1
+
+whardake 30 Aug 96 09:34:48
+ version tag ( 3.1.0.1 )
+
+whardake 30 Aug 96 10:15:18
+ - (README): Updated for 3.1.0.1
+
+whardake 30 Aug 96 11:49:38
+ - (snmp_vars.c): removed malloc prototype due to conflictions.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.0.7.2 -> V3.1
+
+hardaker 3 May 96 14:34:03
+ - (acconfig.h, configure.in, snmplib/Makefile.in)
+ - Added a check for various random functions.
+ - Included another ifdef to ensure no #define loops occur with str/index fns.
+
+hardaker 3 May 96 14:35:27
+ - (agent/snmp_var_route.c,snmp_vars.c)
+ - Changed the interface counter to a short for all architectures (bus err)
+ - Undefed a function that is never used.
+
+hardaker 3 May 96 14:37:17
+ - (agent/snmp_vars.c) Solaris fix for interfaces.
+ - From Dan A. Dickey <ddickey@transition.com>
+
+hardaker 3 May 96 14:40:18
+ - (apps/snmptrap.c) Added #include<sys/sockio.h>
+
+hardaker 9 May 96 13:24:00
+ - (apps/snmpset.c) Added '.' as a delimiter for decimal encoded strings.
+
+hardaker 9 May 96 13:27:40
+ - (acconfig.h, configure.in, snmplib/Makefile.in)
+ - Added a check for various random functions.
+ - Included another ifdef to ensure no #define loops occur with str/index fns.
+
+hardaker 9 May 96 13:33:12
+ - (acconfig.h,agent/{Makefile,snmp_vars.c},agent/extensible/many):
+ - Added support for passthru mibs. Total control is handed to exec's.
+
+hardaker 9 May 96 16:14:28
+ - (configure.in): Solaris specific cpp flags added for SUNspro's cpp.
+ - (agent/{snmp_vars,snmpd}.c,agent/extensible/{extensible,misc,pass}.c,
+ snmplib/{mib,snmp_client}.c):
+ - Cleaned up prototypes to match more carefully (with Solaris's spro cc).
+
+hardaker 10 May 96 10:27:14
+ - (kernel_sunos5.c): A patch to fix a virtual interface problem.
+ - patch supplied by "Dan A. Dickey" <ddickey@transition.com>
+
+hardaker 10 May 96 18:16:57
+ - (many): Mereged baggesen-3-0-7-2 branch into main trunk.
+
+hardaker 13 May 96 15:56:45
+ - (agent/extensible/misc.c): exec Names were getting included in the command.
+
+hardaker 13 May 96 15:57:43
+ - (agent/extensible/misc.c): close file descriptors before re-starting agent.
+
+hardaker 13 May 96 15:58:44
+ - (agent/snmp_agent.c, agent/snmp_vars.c, agent/extensible/extensible.c):
+ - Bug fix: GLOBALSECURITY bug: save rightmost two bits in acl.
+
+hardaker 13 May 96 15:59:30
+ - (snmplib/snmp_impl.h): Change RWRITE to include Write for V2 bits.
+
+hardaker 15 May 96 08:59:51
+ - (agent/extensible/pass.c) Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - Implemented missing parts of interface address and network output (-i)
+
+hardaker 15 May 96 09:02:24
+ - (agent/kernel_sunos5.c) Patch from "Dan A. Dickey" <ddickey@transition.com>
+ - Better caching algorithm for improved speed.
+
+hardaker 15 May 96 09:05:49
+ - (*/.cvsignore) ignore file update.
+
+hardaker 15 May 96 09:06:49
+ - (Makefile.in,sedscript.in) Added PREFIX to the sedscript.
+
+hardaker 15 May 96 09:07:35
+ - (EXAMPLE.conf.def, man/snmpd.conf.5.def): documented pass thru mibs.
+
+hardaker 15 May 96 09:29:21
+ - (COPYING, README, TODO) Release docs updated.
+
+hardaker 15 May 96 09:50:15
+ - (agent/kernel_sunos5.c) patch mistake.
+
+hardaker 15 May 96 09:51:12
+ - (agent/extensible/read_config.c): ansi semantic fix for '<'.
+
+hardaker 15 May 96 09:51:37
+ version tag ( 3.1.A1 )
+
+hardaker 15 May 96 12:00:57
+ - (INSTALL) make install as root.
+
+hardaker 15 May 96 12:03:54
+ - (README) Added a note (pointer to docs) on the agent's extensiblity.
+
+hardaker 15 May 96 12:23:40
+ - (apps/snmpnetstat/if.c) removed & in front of array passed as arg.
+
+hardaker 15 May 96 12:35:16
+ - (sedscript.in) Fixed a horrible typo. P -> PREFIX
+
+hardaker 22 May 96 08:50:28
+ - (man/Makefile.in) Updated the way sedscript is used.
+
+hardaker 22 May 96 08:51:01
+ - (config.guess, configure, install-sh, mkinstalldirs): Autoconf-2.10
+
+hardaker 22 May 96 12:50:24
+ - (agent/kernel_sunos5.c, snmp_vars.c,
+ agent/extensible/extensible.c,readconfig.c,snmp_vars.c):
+ - Patch from Niels Baggesen <recnba@mediator.uni-c.dk>:
+ - finally nailed that missing initialization that gave problems
+ with the AT subtree
+ - I also implemented the disk part of the extensibility in the
+ attached patch.
+
+hardaker 22 May 96 12:55:33
+ - (apps/snmpnetstat/if.c): Patch from Niels Baggesen <recnba@mediator.uni-c.dk>
+ - reworked the way snmpnetstat -i works.
+
+hardaker 23 May 96 14:43:49
+ - (acconfig.h, config.h.in): Don't define random if it already exists.
+
+hardaker 23 May 96 14:44:15
+ - (extensible.c): Added a disk warning to stderr.
+
+hardaker 23 May 96 14:44:39
+ - (acl.c, party.c, view.c): removed NULL defines.
+
+hardaker 23 May 96 14:56:42
+ - (if.c): type casting bugs.
+
+hardaker 23 May 96 16:28:08
+ - (acl.c, party.c): include stdio.h
+
+hardaker 23 May 96 17:09:24
+ - (config*, extensible.c): fixed disk checks on Solaris and alpha's
+ - use statvfs over fstab if both present.
+
+hardaker 23 May 96 17:48:09
+ - (config*): check for getmntent.
+
+hardaker 24 May 96 12:23:52
+ - (snmplib/parse.c): parsing fixes from Mike Perik <mikep@crt.com>
+
+hardaker 24 May 96 12:39:51
+ - (README): Added a thanks section.
+
+hardaker 24 May 96 13:08:28
+ - (EXAMPLE.conf.def): minor example file changes.
+
+hardaker 24 May 96 13:09:02
+ - (config*): Check for sys/mnttab.h
+
+hardaker 24 May 96 13:09:52
+ - (read_config.c): ifdef cleanup
+
+hardaker 24 May 96 13:10:34
+ - (parse.c): declarations cleanup
+
+hardaker 24 May 96 13:13:21
+ - (snmpd.conf.5.def): note on creating comments added.
+
+hardaker 24 May 96 13:38:46
+ - (read_config.c): #ifdef typo
+
+hardaker 24 May 96 13:54:25
+ - (acconfig.h, config.h.in): define memmove if not defined and memcpy is.
+
+hardaker 24 May 96 13:55:14
+ - (if.c, route.c): cast returns from index to char *.
+
+hardaker 24 May 96 14:02:53
+ - (config*): check for memmove before you define it.
+
+hardaker 24 May 96 14:53:20
+ - (read_config.c): printf -> DODEBUG check
+
+hardaker 24 May 96 15:28:41
+ - (accconfig.h, config.h.in): #ifdef typos
+
+hardaker 24 May 96 15:29:13
+ - (snmp_vars.c): removed some ifdef requirements.
+
+hardaker 24 May 96 15:29:29
+ - (snmp_vars.h): reorganized
+
+-------------------------------------------------------------------------------
+
+Changes: V3.0.7.1 -> V3.0.7.2
+
+Niels Baggesen <recnba@mediator.uni-c.dk> 1 May 96 12:37:35
+ - (many) Fixes for Solaris (2.5) submitted by
+ Niels Baggesen <recnba@mediator.uni-c.dk>:
+ "Some are my own, others are from Yuri Rabover who originally
+ created the patch. Some of this is there to eliminate the
+ dependency on the ucblib compatibility stuff, some is "cosmetic",
+ but it also fixes a serious problem in the agent, where walking
+ the mib tree can loop endlessly if you have multiple network
+ interfaces."
+
+hardaker 1 May 96 13:54:18
+ - (configure*, agent/extensible/{read_config,extenisble}.c):
+ - configurified (new word) some of Niels' changes and the bcopy/memmove stuff.
+
+hardaker 1 May 96 13:55:16
+ - (man/snmpd.1.def,snmpd.conf.5.def) .C -> .B, to increase nroff portability.
+
+hardaker 1 May 96 14:35:23
+ - (agent/route_write.c,agent/extensible/extensible.c):
+ - netbsd1.1B specific fixes: clash with sys_errlist and rt_dst defines.
+
+hardaker 1 May 96 14:37:09
+ - (local/snmpcheck) Tk-b10 fixes.
+
+hardaker 1 May 96 14:37:25
+ - (sedscript.in) forgot NETBSD1ID def.
+
+hardaker 1 May 96 14:56:21
+ - (acconfig.h,agent/extensible/mibdefs.h): removed coments/spaces from defines.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.0.7 -> V3.0.7.1
+
+hardaker 25 Apr 96 12:18:43
+ - (ChangeLog, acconfig.h, config.h.in) Defined DEBUGP if DODEBUG is not defined.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.0.6 -> V3.0.7
+
+hardaker 5 Apr 96 16:11:39
+ - (local/snmpcheck.def) Tk-b8 => Tk-b10 changes
+
+hardaker 5 Apr 96 16:12:22
+ - (configure) autoconf-2.7 -> autoconf-2.9
+
+hardaker 5 Apr 96 16:15:11
+ - (snmplib/asn1.c) removed a required 'unix' define surrounding a header file.
+
+hardaker 5 Apr 96 16:19:35
+ - (man/Makefile.in) Added a 'clean' definition to the Makefile.
+
+hardaker 12 Apr 96 14:51:08
+ - Changed nlist warnings to only print if DODEBUG is defined in config.h
+
+hardaker 12 Apr 96 14:51:42
+ - (agent/snmp_vars.c, agent/extensible.c)
+ - Changed nlist warnings to only print if DODEBUG is defined in config.h
+
+hardaker 12 Apr 96 16:49:23
+ - (snmp_var_route.c)
+ - Changed nlist warnings to only print if DODEBUG is defined in config.h
+ - (many) Added support for hppa1.1-hp-hpux10.01
+ - totally! redid the routing tables for BSD 4.4 derived systems
+ (alpha, hpux10.01+, netbsd) since hpux10 doesn't have 4.3 compat structs.
+ - (ece-mib.def) Capitalization problem.
+ - (configure.in)
+ - Cleaned up kernel checking
+ - Started using a autoconf 2.8 feature to check for cache values.
+
+hardaker 15 Apr 96 12:53:40
+ - (configure) New command line option: --enable-debugging. Turns on debugging.
+ - (configure) Fixes for type checking of 4.4 rtentry structures on alphas.
+
+hardaker 15 Apr 96 14:11:39
+ - (configure) New command line option: --with-defaults. Don't prompt the user.
+ - (configure) bug fixes: wasn't quoting kernel and dmem location.
+ - (configure) gcc cpp requires -x c to accept .in file suffix.
+
+hardaker 15 Apr 96 14:36:48
+ - (agent/snmpd.c) Fixed 2 gettimeofday calls -- added a NULL timezone ptr.
+
+hardaker 16 Apr 96 09:47:18
+ - (configure) I forgot DMEM_LOC needs to be #undef'ed if not found
+
+hardaker 16 Apr 96 09:48:06
+ - (agent/{route_write.c,snmp_var_route.c}) OSF3.2 specific changes. arg.
+
+hardaker 16 Apr 96 18:08:29
+ - (snmpd.c) Added fflush calls after printing packet dumps
+
+hardaker 24 Apr 96 08:36:06
+ - (configure.in) More header file checks (vm/vm.h (+ others) and ufs/ffs/fs.h)
+
+hardaker 24 Apr 96 08:36:50
+ - (agent/extensible/extensible.c) Include ufs/ffs/fs.h if available.
+
+hardaker 24 Apr 96 08:37:13
+ - (agent/Makefile.in) Forgot a quote. (why hasn't this appeared before?)
+
+hardaker 24 Apr 96 08:38:18
+ - (agent/alarm.c) Fixed some define naming conflicts for NetBSD (timeradd()).
+
+hardaker 24 Apr 96 08:44:45
+ - (agent/snmp_var_route.c,snmp_vars.c) more config files for NetBSD.
+ - (agent/snmp_vars.c) removed arp tables for netbsd.
+
+hardaker 24 Apr 96 08:54:07
+ - (acconfig.h, config.h.in, ece-mib.def, ov/*) Added NetBSD to sys-OID returned.
+
+hardaker 24 Apr 96 08:54:39
+ - (man/.cvsignore) added snmpd.1
+
+hardaker 24 Apr 96 09:00:21
+ - (README) updated
+
+hardaker 24 Apr 96 09:07:40
+ - (INSTALL) updated
+
+hardaker 24 Apr 96 11:46:52
+ - (agent/snmp_var_route.c) Checked for sys/mbuf for determining rtentry.rt_next
+
+hardaker 24 Apr 96 11:55:10
+ - (agent/snmp_var_route.c) @#$%ing solaris
+
+hardaker 24 Apr 96 13:25:48
+ - (config*,agent/snmp_var_route.c) config checking for rtentry.rt_next
+
+hardaker 24 Apr 96 14:37:47
+ - (local/snmpcheck) new pref: don't pop forward on new problems.
+
+-------------------------------------------------------------------------------
+
+Changes: V3.0.5 -> V3.0.6
+
+hardaker 24 Jan 96 16:31:20
+ - Returning EXTENSIBLEDOTMIB.AGENTID as the new objectid
+
+Dave Shield <D.T.Shield@csc.liv.ac.uk> 24 Jan 96 16:33:08
+ - Patch from Dave Shield <D.T.Shield@csc.liv.ac.uk>
+ - fixes -p PORT command line option to actually use the requested port.
+ - fixes the -l LOGFILE command line option to actually use it.
+
+hardaker 24 Jan 96 16:36:51
+ - (Makefile, config.h, ece-mib.*, sedscript.in)
+ - changed the way mib.txt is built
+ - split the command into two parts to build a ece-mib.txt as well
+ - added a new ObjectID addition to ece-mib.txt
+ - DEFMAXLOADAVE -> DREMOVEMEEFMAXLOADAVE
+
+hardaker 26 Jan 96 08:25:08
+ - The Solaris 2.5 kernel has moved to /kernel/genunix
+ - Thanks goes to pommier@volnay.stortek.com (Vincent Pommier (Toulouse))
+
+hardaker 9 Feb 96 17:05:00
+ - Better OpenView support
+ - Returns different sysObjectID's for each architecture
+ - Added a 'ov' directory for OpenView support files
+ - currently contains necessary files to support a UCD bitmap file
+ for hosts using the ucd-snmp agent. See the ov/README file for details.
+
+hardaker 12 Feb 96 14:28:27
+ - (acconfig.h, config.hin, agent/extensible/misc.c)
+ - The agent now sets an alarm to restart rather than doing at the
+ snmpset time to return a value to the snmpset request.
+
+hardaker 16 Feb 96 16:32:41
+ - (acconfig.h,config.h.in, agent/snmp_agent.c, agent/extensible/read_config.c)
+ - .conf file addition: "community N STRING" to change community names
+
+hardaker 21 Feb 96 16:12:39
+ - (Makefile.in, sedscript.in, man/Makefile.in, man/snmpd.conf.5.def)
+ - Added the beginnings of a snmpd.conf manual page.
+
+hardaker 21 Feb 96 16:15:36
+ - (apps/Makefile.in, apps/snmptrap.c)
+ - Added apps/snmptrap
+ - code taken from 2.0.1 and submitted to me by francus@metsny.delphi.com.
+ - I have yet to test it.
+
+hardaker 6 Mar 96 09:09:15
+ - (agent/snmpd.c) Added O_TRUNC to the logfile open() call.
+
+hardaker 6 Mar 96 10:06:24
+ - (agent/extensible/read_config.c) small bugs fixed
+ - disk entries with no size specified caused seg-faults.
+ - better type checking on MIB for 'exec MIB' entries.
+ - more error messages added.
+
+hardaker 6 Mar 96 16:38:16
+ - (ece-mib.def)
+ - Changed capitalization schemes to be mosy compliant.
+ - Made the memory mib SYNTAX point to the Memory sequence like it should.
+
+hardaker 6 Mar 96 16:58:11
+ - (snmplib/mib.c) printed values for timeticks are no longer negative.
+
+hardaker 8 Mar 96 10:31:34
+ - (snmplib/snmp_client.c) Check if variable content is NULL before using.
+
+hardaker 8 Mar 96 16:56:08
+ - (agent/extensible/exec.c)
+ - relocatable exec's failed to close the cache file.
+
+hardaker 11 Mar 96 13:37:25
+ - (snmp_var_route.c, snmp_vars.c, extensible.c): commented out nlist warnings.
+
+hardaker 11 Mar 96 15:17:26
+ - (man/{Makefile.in,snmpd.1.def,snmpd.conf.5.def},versiontag,sedscript.in):
+ - cleaned up documentation more and added the version number to the trailers.
+
+hardaker 11 Mar 96 15:17:57
+ - (README): cleaned up, re-arranged, shortened (sections moved to man/* docs).
+
+hardaker 11 Mar 96 15:40:17
+
+ - (README): more clean up and added reference to the ucd-snmp mailing list.
+
+Giovanni S. Marzot <gmarzot@baynetworks.com> 11 Mar 96 15:57:20
+
+ - (snmplib/snmp_api.c): fixed a timeout bug caused by architectures
+ with an unsigned timeval.tv_sec value.
+ - Thanks goes to Giovanni S. Marzot <gmarzot@baynetworks.com> for
+ the patch!
+
+-------------------------------------------------------------------------------
+
+Changes since V3.0.4
+
+hardaker 19 Jan 96 17:31:16
+ - (configure*)
+ - updated to autoconf v2.7
+ - Hopefully now using correct 'make' definitions
+
+hardaker 19 Jan 96 17:32:57
+ - (agent/extensible/*.c)
+ - Declaired more static variables (long_ret) to fix sun4s exit codes (again).
+
+hardaker 22 Jan 96 16:27:30
+ - (acconfig.h, agent/snmp_vars.c, agent/extensible/*.c)
+ - Added new defines to turn on/off sections of the extensible mib.
+ - This also fixes the mib.txt file definitions if something is turned off.
+ - (Makefile.in) removed ${srcdir} from the front of stamp-h.in
+
+hardaker 22 Jan 96 17:18:58
+ - (local/Makefile.in) Added a chmod to make the snmpcheck script executable
+
+hardaker 22 Jan 96 17:23:17
+ - (local/snmpcheck)
+ - added agent controls: restart, updateconfig, clearcache.
+ - removed an old debugging printf.
+ - ctrl-f => fixall.
+ - Added keyboard accelerators to the associated menu items.
+ - Made highlightThickness a global parameter via $window->option('add').
+ - Added a entry box to the executable commands with the command to run.
+
+
+-------------------------------------------------------------------------------
+
+Changes since V3.0.3
+
+hardaker 23 Oct 95 16:37:43
+ - (extensible.c) stopped reporting anything for the disk mib if no
+ disks were defined in the snmpd.conf file. This was causing an
+ error in the agent's error mib when no disks were defined and
+ someone walks the disk mib.
+
+hardaker 20 Nov 95 16:04:47
+ - (README) Added pointer to this file via ftp
+
+hardaker 20 Nov 95 16:05:12
+ - (TODO) Find and fix memory leak sometime
+
+hardaker 20 Nov 95 16:07:45
+ - (configure.in) Check for -lelf for solaris 2.3 and younger
+ - (configure.in) More solaris specifics: -DSVR4
+ - (configure.in) Caches initial prompt in the configure script so you
+ won't be bugged twice by the initial question.
+
+hardaker 20 Nov 95 16:08:49
+ - (config.h.in) Check for -lelf for solaris 2.3 and younger
+
+hardaker 20 Nov 95 16:09:37
+ - (all autoconf built files) Updated everything to autoconf 2.5
+
+hardaker 20 Nov 95 16:10:49
+ - (trapnotif) Logs no-response errors.
+ - (trapnotif) Better string checking (quotes all variables now)
+
+hardaker 1 Dec 95 16:20:13
+ - local/snmpcheck: *new features*
+ - handles failed snmpwalk/get/sets much more gracefully now
+ - new preference: You can pick what types of problems to check for
+ - -f on the command line only checks for fixable problems
+ - no longer ping::echos hosts before checking them
+ - instead relies on 'No Response' type replies from snmpwalk/get to
+ determine if a host is up.
+ - ping the host is still an option (through the command line and menus)
+ - converted from Tk-b4 to Tk-b8
+ - Added a logging window for debugging and tracking of actions.
+ - new command line options: -V NUM initial log verbosity level
+ -L show the log window at startup
+ - Now translates mib numbers into more reasonable names
+
+hardaker 5 Dec 95 14:57:14
+ - (configure*) added AC_TYPE_PID_T to the configure checks
+
+hardaker 5 Dec 95 15:01:10
+ - (snmpcheck)
+ - New flag: -d, don't start checking anything. Just bring up interface.
+ - check for blank output of snmpget before parsing with s///g
+ constructs.
+
+hardaker 5 Dec 95 15:05:20
+ - (agent/extensible)
+ - Bug fix: alphas and sunoses were reporting incorrect extensible
+ exit codes. (yet another 64/32 bit bug found).
+ - Bug fix: agent-update,restart, and cache mib flush entries were
+ returning values instead of pointers to values.
+
+hardaker 13 Dec 95 15:27:19
+ - (agent/extensible/misc.c) bug fixes for exec items:
+ - a second snmpwalk of the exec item would return the old cache
+ file. Fixed by reseting the last cachetime to 0 to always rescan
+ after fork/pipe/memory/etc errors.
+ - Made lastresult a static var. Was returning wrong exit codes
+ under, strangely enough, only sunos-4 machines.
+
+hardaker 20 Dec 95 09:53:10
+ - snmp_open calls getservbyname only once now, at the request of Gary
+ Hayward <gah@dirac.bellcore.com>.
+
+hardaker 20 Dec 95 15:56:16
+ - Found and fixed a memory leak in the routing table mib.
+
+hardaker 28 Dec 95 10:01:35
+ - Added sedscript to the .cvsignore file.
+
+hardaker 28 Dec 95 10:24:37
+ - Added a sedscript which is built from config.h and agent/extensible/mibdefs.h
+ - used to dynamically build mib.txt and local/snmpcheck.
+
+hardaker 28 Dec 95 12:06:49
+ - Created a EXAMPLE.conf file for example usage.
+
+-------------------------------------------------------------------------------
+
+Changes since V3.0.2.1
+
+hardaker 29 Sep 95 13:43:49
+ - ported to GNU's autoconfig2.4
+ - to install, you must now run ./configure first to generate the
+ Makefiles and config.h
+ - almost all of the code is now dynamically checked for problems
+ rather than being dependant on architecture names.
+ - system name now dynamically determined at run time (from uname -n)
+ - created a 'make depend' call (finally).
+ - (agent/snmp_vars.h) changed SYSNAME define to SYSTEMNAME define to
+ avoid a conflict with a solaris header file.
+ - protecting better against include header files twice.
+ - Most of port to Solaris 2.4 finished. The kernel reads still need work.
+
+hardaker 29 Sep 95 13:46:43
+ - (NEWS) updated the news file.
+
+hardaker 3 Oct 95 09:24:00
+ (acconfig.h) Minor bug: recursive comments not correct for compilers (AIX)
+
+hardaker 3 Oct 95 09:43:54
+ (versioninfo.c) Added 3-0-3-A1 tag
+
+hardaker 4 Oct 95 16:53:39
+ version tag of versioninfo.c
+
+hardaker 5 Oct 95 15:23:05
+ - More Solaris porting.
+ - Most mibII entries now work.
+ - Haven't checked returned information for accuracy
+ - sysUpTime still fails.
+ - cc and gcc both compile everything now.
+
+hardaker 5 Oct 95 15:48:23
+ version tag of versioninfo.c
+
+hardaker 6 Oct 95 11:37:00
+ - (README) Moved INSTALLATION instructions to INSTALL
+ Changed listing of supported architectures
+ Updated AVAILABILITY section
+
+hardaker 6 Oct 95 16:28:48
+ version tag of versioninfo.c
+
+hardaker 6 Oct 95 16:32:04
+ - (snmpd.c) Added two new flags:
+ -h for help
+ -v for version information
+
+hardaker 6 Oct 95 16:32:43
+ - (parse.c, snmp.c) added config.h to the list of includes.
+
+hardaker 6 Oct 95 16:40:38
+ - (snmpd.c) Usage of --help and --version should work now... GNU standard.
+
+hardaker 6 Oct 95 16:41:18
+ - (NEWS/-TODO) -h/--help, -v/--version command line options
+
+hardaker 11 Oct 95 17:33:26
+ - The configure script now prompts for important values to be put in
+ config.h. Some things need to use $(prefix) instead however.
+ - (Makefile.in, agent/Makefile.in, apps/Makefile.in)
+ + linking to ../snmplib/libsnmp.a instead of ../lib/libsnmp.a to
+ remove install requirement.
+ + put ../lib/libsnmp.a in application
+
+hardaker 13 Oct 95 15:45:28
+ - (snmpd.c) Added -p port to --help output
+ - (config) Setup to use --prefix to look for config files.
+
+hardaker 16 Oct 95 13:01:39
+ - (Makefiles) Fairly decent 'make install' now possible. Installs
+ into the directory specified by --prefix for the ./configure script.
+ - (extensible.c) config file re-location: now uses the SNMPLIBPATH
+ defined loosely as $(prefix)/lib/snmp/.
+
+hardaker 16 Oct 95 15:02:01
+ - (Makefiles) make install echos what its doing in a more clear fashion
+ - (INSTALL) added better instructions to the INSTALL file.
+ - (README) minor wording changes
+
+hardaker 16 Oct 95 16:21:43
+ - (snmpd.c) was still looking in /etc for two .conf files.
+
+hardaker 16 Oct 95 16:43:12
+ - (apps) all apps were still looking in /etc/ for .conf files
+
+hardaker 17 Oct 95 16:58:32
+ version tag ( 3.0.3 ) of versioninfo.c
+
+hardaker 17 Oct 95 17:00:22
+ - ChangeLog update
+
+
+-------------------------------------------------------------------------------
+
+Changes since V3.0.2
+
+hardaker 21 Sep 95 09:27:18
+ (snmplib/md5.c) Forgot to include sys/types.h for u_long definition.
+
+-------------------------------------------------------------------------------
+
+Changes since V3.0.1
+
+hardaker 26 Jul 95 16:31:41
+ - Added a new #define: EXIT_ON_BAD_KLREAD to config.h
+ If defined, and an error occurs while reading the kernel contents,
+ the agent will exit. This was the default. I wanted it to
+ continue.
+
+ - Port to dec-alpha/OSF 3.1
+ - alpha's long is 8 bytes, not 4.
+ - should be (mostly) 64 bit clean now.
+ - cleaned up a LOT of bugs CMU code in the process.
+
+hardaker 28 Jul 95 14:23:41
+ Yet more problems fixed in the alpha port.
+ -- more int -> long checking.
+
+hardaker 31 Jul 95 16:27:47
+ - snmpcheck changes:
+ - terminal (ascii) based supported fixed.
+ - Detects presence of a DISPLAY variable.
+ - Now requires the Term::Readkey package.
+ - asks users weather to fix problems
+ - raises and deiconifies when new problems are found
+ - sets the background color of new problems to pinkish
+ - new preference: ping host?
+ - global key bindings:
+ ctrl-q = quit; ctrl-h = hide; ctrl-s = seen all
+
+hardaker 1 Sep 95 11:57:52
+ - Fixed alpha's kernel lookups:
+ * CMU code was passing ints into lseek (needs long).
+
+hardaker 18 Sep 95 16:09:25
+ Minor mods to README file.
+
+hardaker 18 Sep 95 16:13:49
+ Minor bug:
+ (sh_count_procs) check if returned file descriptor > 0 before continuing
+
+-------------------------------------------------------------------------------
+
+Changes since V3.0
+
+hardaker 16 Jun 95 10:13:53
+ Removed 'gmake' -> 'make' in agent/Makefile
+
+hardaker 16 Jun 95 10:15:42
+ House cleaning
+ - Compiles cleanly on hpux/gcc
+ (except one include file error I don't have control over.)
+ - Change VERSION_ID -> VERSIONID to avoid conflicts with HP's includes.
+
+hardaker 16 Jun 95 14:13:53
+ House Cleaning:
+ Took out gcc/ansi requirement for the agent.
+ perror() is called more frequently for log archival
+
+ New Bug/Haven't solved:
+ HP-UX: if agent/*.c and agent/extensible/*.c are built with gcc,
+ DisplayStrings return garbage. No clue as to why.
+
+hardaker 16 Jun 95 14:20:48
+ House Cleaning:
+ Missed a VERSION_ID
+
+hardaker 21 Jun 95 09:11:27
+ Changed another "empty" error message in the CMU code to a real warning.
+
+hardaker 21 Jun 95 09:15:31
+ Bug Fix:
+ Stopped returning a pointer to a non-static char array... (-> static char)
+ Passing wrong pointer to seterrorstatus() in setPerrorstatus()
+
+ Feature:
+ Added a setable mib entry to the version mib to re-read the config file(s).
+
+hardaker 21 Jun 95 09:18:37
+ ece-mib.def:
+ Bug Fix:
+ Loadave mib: Integer -> DisplayString
+ versionClearCache: -> read-write (was read-only)
+
+ Feature:
+ Added a setable mib entry to the version mib to re-read the config file(s).
+
+hardaker 21 Jun 95 09:19:17
+ Changed default CC to cc again.
+
+hardaker 21 Jun 95 09:20:23
+ snmplib:
+ Bug fix: fdset -> (int *) fdset in select call.
+
+hardaker 10 Jul 95 11:27:00
+ Two new command line options:
+ -l LOGFILE Outputs stderr/out to LOGFILE (overrides config.h def)
+ -L Do NOT write to a log file (overrides config.h)
+
+hardaker 10 Jul 95 12:29:32
+ - More perror()s converted to set the snmp error status flag on the agent.
+ - error status flag is now prioritized. perrors get the highest so
+ other errors won't override them if they happen at a later time.
+ - Added the beginnings of a restart mib to the version mib of the
+ agent. Setting this writable mib to one will cause it to exec
+ itself again (for remote restart/updates).
+
+hardaker 10 Jul 95 12:30:19
+ Minor comment change in config.h
+
+hardaker 14 Jul 95 15:12:40
+ - Finished the restart mib. This is a setable sub-mib of the version
+ mib, default to VERSION.12(.1). If snmp-set to '1', it will restart
+ the agent.
+
+ * A side effect of this is that it restarts 3 times or so, since it
+ never returns a responce to the program generating the request.
+ If said program tries to resend the request (which most do), it
+ will AGAIN restart the agent... oh well.
+
+hardaker 14 Jul 95 15:15:31
+ - snmpcheck (tk-perl-b4 script) is pretty stable at this point. I
+ lost curses support, and need to re-add it still, so it is still
+ beta. It does expect a log file of problems to exist (point it to
+ /dev/null), and needs to know the locations of the mibs to check
+ (which aren't configured by 'make'), so it needs some work.
+ However, it will query an agent, check its problems based on the
+ status of the error flag (or return code) being >1 and report them
+ with neat GUI-buttons and stuff (oh wow). No documentation on it though.
+
+-------------------------------------------------------------------------------
+
+Changes since 3-0A1:
+
+hardaker 2 Jun 95 16:23:46
+ - version update
+
+hardaker 5 Jun 95 12:44:46
+ - agent/extensible/Makefile:
+ -- no longer requires GNU make
+ -- etags no longer run by default
+
+ - SunOS additions:
+ -- loadaverage checking MIB enabled
+ -- disk checking MIB enabled
+
+hardaker 9 Jun 95 10:21:07
+ - Added a SNMPBLOCK option to the config.h file. Supposedily setting
+ this to zero (now the default) will allow snmp requests to time out.
+ Haven't tested it throughly.
+ -- Contributed by Sanjai Narain <narain@thumper.bellcore.com>
+
+hardaker 9 Jun 95 10:21:51
+ - Correctly ordered the mib table list.
+ -- Need to write a dynamic checker/re-orderer.
+
+hardaker 9 Jun 95 10:23:35
+ - Correct usage for snmpwalk is now possible. IE, snmpwalk target
+ .1.3.6.1 will now browse the entire tree.
+ -- Still fails on relocatable extensible mibs and will until I
+ write a dynamic tree builder.
+
+hardaker 9 Jun 95 14:08:15
+ - Changed test -x to test -f in snmplib/Makefile. Not all OSes
+ (ie ultrix) handle this.
+
+hardaker 12 Jun 95 10:35:38
+ - local/trapnotif:
+ -- uses snmpv2 now (correctly)
+
+hardaker 12 Jun 95 10:37:46
+ - Reports all errors through the error mib now instead of through perror().
+ - Cleaned up error handling. Shouldn't handle errors nicely if system
+ errors occur when scanning an extensible mib.
+
+hardaker 14 Jun 95 11:24:20
+ agent:
+ - Mib table is now qsorted at run time and the extensible variables are
+ sorted in at this time. This brings the agent up to correct
+ SNMPwalk/getnext protocols. You can now walk the entire tree
+ including the extensible sections and it won't stop.
+ * This has an added bonus of checking the mib table
+ (agent/snmp_vars.c) for correct order. I have added things to the
+ wrong location too many times and caused the agent to function
+ incorrectly. Major win.
+
+hardaker 14 Jun 95 12:56:49
+ - Cleaned up/Added more documentation to config.h
+ - GLOBALSECURITY now uses the left most four bits in the MIB acl.
+ This is more compatible with the CMU code than using the left most
+ 2, which was done previously.
+
+
+hardaker 14 Jun 95 13:43:38
+ - Added more documentation to the README file.
+ - Created a mailing list to handle announcements
+ (ucd-snmp-announce@ucd-snmp.ucdavis.edu)
+
+
+# generated using:
+# cvs2cl -b -r -f ChangeLog.add -F V4-2-patches --no-wrap -S
+# perl dist/changelogfix < ChangeLog.add > ChangeLog.reallyadd
diff --git a/CodingStyle b/CodingStyle
new file mode 100644
index 0000000..cb773be
--- /dev/null
+++ b/CodingStyle
@@ -0,0 +1,69 @@
+The discussion about coding style on the net-snmp-coders mailing list
+can be found at the following web address:
+
+ http://sourceforge.net/mailarchive/message.php?msg_id=1009885
+ (Thread "design proposal - coding style" started on 2001-02-08)
+
+----------------------------------------------------------------------
+Indentation:
+
+We've adopted the following indent style:
+
+ indent -orig -nbc -bap -nut -nfca -T netsnmp_mib_handler -T netsnmp_handler_registration -T netsnmp_handler_args -T netsnmp_delegated_cache -T netsnmp_baby_steps_modes -T netsnmp_baby_steps_access_methods -T netsnmp_mode_handler_list -T netsnmp_mib_handler_methods -T netsnmp_monitor_callback_header -T netsnmp_monitor_set_request_data -T netsnmp_monitor_callback_cooperative -T netsnmp_old_api_info -T netsnmp_old_api_cache -T netsnmp_row_merge_status -T netsnmp_scalar_group -T netsnmp_set_info -T netsnmp_request_info -T netsnmp_set_info -T netsnmp_tree_cache -T netsnmp_agent_request_info -T netsnmp_cachemap -T netsnmp_agent_session -T netsnmp_stash_cache_info -T netsnmp_stash_cache_data -T netsnmp_request_group_item -T netsnmp_request_group -T netsnmp_table_array_callbacks -T netsnmp_table_row -T netsnmp_table_data -T netsnmp_table_data_set_storage -T netsnmp_table_data_set -T netsnmp_column_info -T netsnmp_table_registration_info -T netsnmp_table_request_info -T netsnmp_iterator_info -T netsnmp_tdata_row -T netsnmp_tdata -T netsnmp_subtree -T netsnmp_watcher_info -T netsnmp_arp_entry -T netsnmp_interface_stats -T netsnmp_interface_entry -T netsnmp_conf_if_list -T netsnmp_ipaddress_entry -T netsnmp_ipstats -T netsnmp_route_entry -T netsnmp_systemstats_entry -T netsnmp_tcpconn_entry -T netsnmp_udp_endpoint_entry -T netsnmp_container -T netsnmp_iterator -T netsnmp_data_list -T netsnmp_data_list_saveinfo -T netsnmp_factory -T netsnmp_file -T netsnmp_oid_stash_node -T netsnmp_oid_stash_save_info -T netsnmp_pdu -T netsnmp_request_list -T netsnmp_vardata -T netsnmp_callback_pass -T netsnmp_callback_info -T netsnmp_token_descr -T netsnmp_std_data -T netsnmp_transport -T netsnmp_transport_list -T netsnmp_tdomain -T netsnmp_line_info -T netsnmp_line_process_info -T netsnmp_token_value_index
+
+[wow, what an annoying list! The above -T list can be (re)generated by
+running:
+ perl -n -e 'print "-T $1 " if (/}\s*(netsnmp_\w+)\s*;/);' */*.h
+in the include/net-snmp directory]
+
+If possible, please run all new code submitted to the project through
+the above command. However, if sending a patch, please do *not* send
+a patch that reformats the entire file. Just the new sections of code
+should be in the above style to make it easier for us to dissect what
+you did in your patch.
+
+Briefly, here's a description of the style:
+
+ Blank lines:
+ after procedures
+ not (forced) after blocks of declarations or block comments
+ multiple declarations not split onto separate lines
+
+ Comments:
+ Block comments indented 4 spaces from surrounding code
+ Start/End on separate lines
+ Solid '*' on the left of block comments
+ "One-line" comments start in column 33
+
+ Bracing/Indent/etc:
+ K&R-style bracing (including "cuddle-else")
+ 'case' statements in line with 'switch'
+ No space between procedure name and opening parenthesis
+ variable declarations lined up, and start in column 16
+ Procedure return type on a separate line to the procedure name
+ Four character basic and continuation line indent
+ No tabs used in the file, always use 8 spaces instead.
+ Continuation parameters lined up with opening parenthesis
+
+----------------------------------------------------------------------
+Function names and Variable names:
+
+should_be_like_this and notLikeThis
+
+New public functions and defines should ideally start with a netsnmp_
+or NETSNMP_ prefix, respectively.
+
+----------------------------------------------------------------------
+Structures:
+
+We have decided to typedef all structures into names using the
+following convention:
+
+typedef struct netsnmp_wombat_s {
+ int something_cool;
+} netsnmp_wombat;
+
+The important things to note here are that the struct name ends in a
+"_s", the typedef name doesn't end in "_t", and the typedef is not to a
+pointer and everything begins with "netsnmp_".
+
diff --git a/EXAMPLE.conf.def b/EXAMPLE.conf.def
new file mode 100644
index 0000000..8f4a197
--- /dev/null
+++ b/EXAMPLE.conf.def
@@ -0,0 +1,193 @@
+###############################################################################
+#
+# EXAMPLE.conf:
+# An example configuration file for configuring the Net-SNMP agent ('snmpd')
+# See the 'snmpd.conf(5)' man page for details
+#
+# Some entries are deliberately commented out, and will need to be explicitly activated
+#
+###############################################################################
+#
+# AGENT BEHAVIOUR
+#
+
+# Listen for connections from the local system only
+agentAddress udp:127.0.0.1:161
+# Listen for connections on all interfaces (both IPv4 *and* IPv6)
+#agentAddress udp:161,udp6:[::1]:161
+
+
+
+###############################################################################
+#
+# SNMPv3 AUTHENTICATION
+#
+# Note that these particular settings don't actually belong here.
+# They should be copied to the file /var/net-snmp/snmpd.conf
+# and the passwords changed, before being uncommented in that file *only*.
+# Then restart the agent
+
+# createUser authOnlyUser MD5 "remember to change this password"
+# createUser authPrivUser SHA "remember to change this one too" DES
+# createUser internalUser MD5 "this is only ever used internally, but still change the password"
+
+# If you also change the usernames (which might be sensible),
+# then remember to update the other occurances in this example config file to match.
+
+
+
+###############################################################################
+#
+# ACCESS CONTROL
+#
+
+ # system + hrSystem groups only
+view systemonly included .1.3.6.1.2.1.1
+view systemonly included .1.3.6.1.2.1.25.1
+
+ # Full access from the local host
+#rocommunity public localhost
+ # Default access to basic system info
+ rocommunity public default -V systemonly
+
+ # Full access from an example network
+ # Adjust this network address to match your local
+ # settings, change the community string,
+ # and check the 'agentAddress' setting above
+#rocommunity secret 10.0.0.0/16
+
+ # Full read-only access for SNMPv3
+ rouser authOnlyUser
+ # Full write access for encrypted requests
+ # Remember to activate the 'createUser' lines above
+#rwuser authPrivUser priv
+
+# It's no longer typically necessary to use the full 'com2sec/group/access' configuration
+# r[ou]user and r[ow]community, together with suitable views, should cover most requirements
+
+
+
+###############################################################################
+#
+# SYSTEM INFORMATION
+#
+
+# Note that setting these values here, results in the corresponding MIB objects being 'read-only'
+# See snmpd.conf(5) for more details
+sysLocation Sitting on the Dock of the Bay
+sysContact Me <me@example.org>
+ # Application + End-to-End layers
+sysServices 72
+
+
+#
+# Process Monitoring
+#
+ # At least one 'mountd' process
+proc mountd
+ # No more than 4 'ntalkd' processes - 0 is OK
+proc ntalkd 4
+ # At least one 'sendmail' process, but no more than 10
+proc sendmail 10 1
+
+# Walk the UCD-SNMP-MIB::prTable to see the resulting output
+# Note that this table will be empty if there are no "proc" entries in the snmpd.conf file
+
+
+#
+# Disk Monitoring
+#
+ # 10MBs required on root disk, 5% free on /var, 10% free on all other disks
+disk / 10000
+disk /var 5%
+includeAllDisks 10%
+
+# Walk the UCD-SNMP-MIB::dskTable to see the resulting output
+# Note that this table will be empty if there are no "disk" entries in the snmpd.conf file
+
+
+#
+# System Load
+#
+ # Unacceptable 1-, 5-, and 15-minute load averages
+load 12 10 5
+
+# Walk the UCD-SNMP-MIB::laTable to see the resulting output
+# Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file
+
+
+
+###############################################################################
+#
+# ACTIVE MONITORING
+#
+
+ # send SNMPv1 traps
+ trapsink localhost public
+ # send SNMPv2c traps
+#trap2sink localhost public
+ # send SNMPv2c INFORMs
+#informsink localhost public
+
+# Note that you typically only want *one* of these three lines
+# Uncommenting two (or all three) will result in multiple copies of each notification.
+
+
+#
+# Event MIB - automatically generate alerts
+#
+ # Remember to activate the 'createUser' lines above
+iquerySecName internalUser
+rouser internalUser
+ # generate traps on UCD error conditions
+defaultMonitors yes
+ # generate traps on linkUp/Down
+linkUpDownNotifications yes
+
+
+
+###############################################################################
+#
+# EXTENDING THE AGENT
+#
+
+#
+# Arbitrary extension commands
+#
+ extend test1 /bin/echo Hello, world!
+ extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35
+#extend-sh test3 /bin/sh /tmp/shtest
+
+# Note that this last entry requires the script '/tmp/shtest' to be created first,
+# containing the same three shell commands, before the line is uncommented
+
+# Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table
+# and nsExtendOutput2Table) to see the resulting output
+
+# Note that the "extend" directive supercedes the previous "exec" and "sh" directives
+# However, walking the UCD-SNMP-MIB::extTable should still returns the same output,
+# as well as the fuller results in the above tables.
+
+
+#
+# "Pass-through" MIB extension command
+#
+#pass .1.3.6.1.4.1.8072.2.255 /bin/sh PREFIX/local/passtest
+#pass .1.3.6.1.4.1.8072.2.255 /usr/bin/perl PREFIX/local/passtest.pl
+
+# Note that this requires one of the two 'passtest' scripts to be installed first,
+# before the appropriate line is uncommented.
+# These scripts can be found in the 'local' directory of the source distribution,
+# and are not installed automatically.
+
+# Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output
+
+
+#
+# AgentX Sub-agents
+#
+ # Run as an AgentX master agent
+ master agentx
+ # Listen for network connections (from localhost)
+ # rather than the default named socket /var/agentx/master
+#agentXSocket tcp:localhost:705
diff --git a/FAQ b/FAQ
new file mode 100644
index 0000000..d2594ce
--- /dev/null
+++ b/FAQ
@@ -0,0 +1,4060 @@
+ Frequently Asked Questions (FAQ) for the UCD/Net-SNMP package
+ =============================================================
+ FAQ Author: Dave Shield
+ Net-SNMP Version: 5.7.2
+ Net-SNMP/UCD-SNMP Project Leader: Wes Hardaker
+ Email: net-snmp-coders@lists.sourceforge.net
+
+TABLE OF CONTENTS
+=================
+
+ TABLE OF CONTENTS
+ GENERAL
+ What is it?
+ Where can I get it?
+ What documentation is available?
+ Are there binaries available?
+ What's the difference between UCD-SNMP and Net-SNMP?
+ What operating systems does it run on?
+ What happens if mine isn't listed?
+ Does it run on Windows?
+ How do I find out about new releases?
+ How can I find out what other people are doing?
+ How do I submit a patch or bug report?
+ Can I reuse the code in my commercial application?
+ What's the difference between SNMPv1, SNMPv2 and SNMPv3?
+ What's the difference between SNMPv2 and SNMPv2c?
+ Which versions of SNMP are supported in this package?
+ Can I use SNMPv1 requests with an SNMPv2 MIB (or vice versa)?
+ How can I monitor my system with SNMP?
+ Where can I find more information about network management?
+ What ports does SNMP use?
+ Is Net-SNMP thread safe?
+ APPLICATIONS
+ How do I add a MIB?
+ How do I add a MIB to the tools?
+ Why can't I see anything from the agent?
+ Why doesn't the agent respond?
+ I can see the system group, but nothing else. Why?
+ Why can't I see values in the <ENTERPRISE> tree?
+ The agent worked for a while, then stopped responding. Why?
+ Requesting an object fails with "Unknown Object Identifier" Why?
+ Why do I get "noSuchName" when asking for "sysUpTime" (or similar)?
+ Why do I sometimes get "End of MIB" when walking a tree, and sometimes not?
+ How do I use SNMPv3?
+ Why can't I set any variables in the MIB?
+ Variables seem to disappear when I try to set them. Why?
+ Why can't I change sysLocation (or sysContact)?
+ I get an error when trying to set a negative value - why?
+ I get an error when trying to query a string-indexed table value - why?
+ How should I specify string-indexed table values?
+ How do I send traps and notifications?
+ How do I receive traps and notifications?
+ How do I receive SNMPv1 traps?
+ Why don't I receive incoming traps?
+ My traphandler script doesn't work when run like this - why not?
+ How can the agent receive traps and notifications?
+ How big can an SNMP request (or reply) be?
+ How can I monitor my systems (disk, memory, etc)?
+ Applications complain about entries in your example 'snmp.conf' file. Why?
+ OK, what should I put in snmp.conf?
+ How do I specify IPv6 addresses in tools command line arguments?
+ PERL
+ What is the purpose of the Perl SNMP module?
+ Where can I get the Perl SNMP package?
+ How do I install the Perl SNMP modules?
+ But compiling this fails! Why?
+ Compiling the Perl module works OK, but 'make test' fails. Why?
+ Why can't mib2c (or tkmib) locate SNMP.pm?
+ Why can't mib2c (or tkmib) load SNMP.so?
+ Why can't tkmib locate Tk.pm?
+ Why does your RPM complain about missing Perl modules?
+ I've got a problem with the Net-SNMP module. Can you help?
+ MIBS
+ Where can I find a MIB compiler?
+ Why aren't my MIB files being read in?
+ Where should I put my MIB files?
+ What does "Cannot find module (XXX-MIB)" mean?
+ I'm getting answers, but they're all numbers. Why?
+ What does "unlinked OID" mean?
+ The parser doesn't handle comments properly. Why not?
+ How can I get more information about problems with MIB files?
+ What's this about "too many imported symbols"?
+ Do I actually need the MIB files?
+ AGENT
+ What MIBs are supported?
+ What protocols are supported?
+ How do I configure the agent?
+ How do I remove a MIB from the agent?
+ I've installed a new MIB file. Why can't I query it?
+ How do I add a MIB to the agent?
+ What's the difference between 'exec', 'sh', 'extend' and 'pass'?
+ What's the difference between AgentX, SMUX and proxied SNMP?
+ What is the purpose of 'dlmod'?
+ Which should I use?
+ Can I use AgentX when running under Windows?
+ How can I run AgentX with a different socket address?
+ How can I turn off SMUX support?
+ How can I combine two copies of the 'mib2' tree from separate subagents?
+ What traps are sent by the agent?
+ Where are these traps sent to?
+ How can I send a particular trap to selected destinations?
+ When I run the agent it runs and then quits without staying around. Why?
+ After a while the agent stops responding, and starts eating CPU time. Why?
+ How can I stop other people getting at my agent?
+ How can I listen on just one particular interface?
+ The agent is complaining about 'snmpd.conf'. Where is this?
+ Why does the agent complain about 'no access control information'?
+ How do I configure access control?
+ How do I configure SNMPv3 users?
+ The 'createUser' line disappears when I start the agent. Why?
+ What's the difference between /var/net-snmp and /usr/local/share/snmp?
+ My new agent is ignoring the old snmpd.conf file. Why?
+ Where should the snmpd.conf file go?
+ Why am I getting "Connection refused"?
+ Why can't I see values in the UCDavis 'extensible' or 'disk' trees?
+ Why can't I see values in the UCDavis 'memory' or 'vmstat' tree?
+ What do the CPU statistics mean - is this the load average?
+ How do I get percentage CPU utilization using ssCpuRawIdle?
+ What about multi-processor systems?
+ The speed/type of my network interfaces is wrong - how can I fix it?
+ The interface statistics for my subinterfaces are all zero - why?
+ Does the agent support the RMON-MIB?
+ What does "klread: bad address" mean?
+ What does "nlist err: wombat not found" (or similar) mean?
+ What does "Can't open /dev/kmem" mean?
+ The system uptime (sysUpTime) returned is wrong!
+ Can the agent run multi-threaded?
+ Can I use AgentX (or an embedded SNMP agent) in a threaded application?
+ COMPILING
+ How do I control the environment used to compile the software?
+ How do I control the environment used to compile the software under Windows?
+ Why does the compilation complain about missing libraries?
+ How can I reduce the memory footprint?
+ How can I reduce the installation footprint or speed up compilation?
+ How can I compile the project for use on an embedded system?
+ How can I compile the project to use static linking?
+ Why does 'make test' skip various tests?
+ Why does 'make test' complain about a pid file?
+ CODING
+ How do I write C code to integrate with the agent?
+ How does the agent fetch the value of a MIB variable from the system?
+ Mib2c complains about a missing "mib reference" - what does this mean?
+ Mib2c complains about not having a "valid OID" - what does this mean?
+ Why doesn't mib2c like the MIB file I'm giving it?
+ Mib2c ignores my MIB and generates a pair of 'mib-2' code files. Why?
+ What's the difference between the various mib2c configuration files?
+ Which mib2c configuration file should I use?
+ How can I have mib2c generate code for both scalars and tables?
+ Are there any examples, or documentation for developing MIB modules?
+ Where should I put the files produced by 'mib2c'?
+ Why doesn't my new MIB module report anything?
+ Why does the iterator call my get_{first,next} routines so often?
+ How can I get the agent to generate a trap (or inform)?
+ How can I get an AgentX sub-agent to generate a trap (or inform)?
+ How can I get the agent to send an SNMPv1 (or SNMPv2c) trap?
+ How can I get the agent to include varbinds with an SNMPv1 trap?
+ How can I get the agent to send an SNMPv1 enterprise-specific trap?
+ How can I get the agent to send an SNMPv3 trap (or inform)?
+ Why does calling 'send_v2trap' generate an SNMPv1 trap (or vice versa)?
+ How can I register a MIB module in a different (SNMPv3) context?
+ MISC
+ What ASN.1 parser is used?
+ What is the Official Slogan of the net-snmp-coders list?
+
+
+GENERAL
+=======
+
+What is it?
+----------
+
+ - Various tools relating to the Simple Network Management Protocol
+ including:
+
+ * An extensible agent
+ * An SNMP library
+ * tools to request or set information from SNMP agents
+ * tools to generate and handle SNMP traps
+ * a version of the unix 'netstat' command using SNMP
+ * a graphical Perl/Tk/SNMP based mib browser
+
+ This package is originally based on the Carnegie Mellon University
+ SNMP implementation (version 2.1.2.1), but has developed significantly
+ since then.
+
+
+
+Where can I get it?
+------------------
+
+ Download:
+ - http://www.net-snmp.org/download/
+ - ftp://ftp.net-snmp.org/pub/sourceforge/net-snmp/
+ Web page:
+ - http://www.net-snmp.org/
+ Sourceforge Project page:
+ - http://www.net-snmp.org/project/
+ Mirrors (note that sourceforge download servers are mirrored themselves):
+ - US: ftp://ftp.freesnmp.com/mirrors/net-snmp/
+ - Greece: ftp://ftp.ntua.gr/pub/net/snmp/net-snmp/
+
+
+What documentation is available?
+-------------------------------
+
+ This FAQ (!)
+ README and individual READMEs for various platforms
+ README.thread (discusses threading issues)
+ INSTALL
+ PORTING
+ EXAMPLE.conf
+ man pages for the individual tools, files and the API
+ A guide for extending the agent
+ Tutorials for both ucd-snmp v4 and net-snmp v5
+ at http://www.net-snmp.org/tutorial/
+ and http://www.net-snmp.org/tutorial-5/ respectively
+
+ Most of this documentation (plus archives of the mailing lists)
+ is also available on our web page:
+
+ http://www.net-snmp.org/
+
+ There is also a Wiki (including a community-maintained version
+ of this FAQ) at
+
+ http://www.net-snmp.org/wiki/
+
+
+
+Are there binaries available?
+----------------------------
+
+ There are binaries for some versions/systems available under
+ the "net-snmp binaries" package on the SourceForge "Files"
+ page, which is linked to from the main project download web
+ page at http://www.net-snmp.org/download.html.
+
+ These binaries are also available on the project FTP site,
+ with a link on the same web page.
+
+ There is also a mirror at ftp://ftp.freesnmp.org/mirrors/net-snmp/
+
+
+
+What's the difference between UCD-SNMP and Net-SNMP?
+---------------------------------------------------
+
+ Not a great deal, really.
+ Although the project originally started at UC Davis (hence the name),
+ and it has always been based there, most of the contributors have had
+ little or no connection with this institution.
+
+ The move to SourceForge was intended to provide a more flexible
+ environment for the project, and to distribute the administrative
+ workload more evenly. The change of name simply reflects this move,
+ which was the last remaining link with UC Davis.
+
+ The 4.2.x line saw the last releases made using the ucd-snmp name,
+ and all releases on this line have been been bug-fixes only. Release
+ 5.0 was the first version released under the Net-SNMP name, and all
+ further development is being done on the 5.x code base. The 4.2.x
+ code line is now effectively closed down, as are the older 5.x branches.
+
+ Much of the work done for the various 5.x releases has involved
+ some fairly significant changes to the code - in particular the
+ architecture of the agent. However attempts have been made to retain
+ backwards compatibility as much as possible, and most code written
+ for earlier releases should continue to work. The most visible
+ change from the 4.2.x UCD suite to the 5.x Net-SNMP releases was a
+ restructuring of the header file organisation - not least a change
+ from <ucd-snmp/xxx.h> to <net-snmp/yyy.h>.
+
+ But given the maturity of the Net-SNMP code, this should be less
+ of a consideration for most current SNMP development projects.
+
+
+
+What operating systems does it run on?
+-------------------------------------
+
+ Both the applications and the agent have been reported as running
+ (at least in part) on the following operating systems:
+
+ * Linux (kernels 2.6 to 1.3)
+ * Solaris/SPARC (11 to 2.3), Solaris/Intel (10, 9) -- see
+ README.solaris
+ * HP-UX (11.31 to 9.01) -- see README.hpux11
+ * Mac OS X (10.5 to 10.1) -- see README.osX
+ * NetBSD (2.0 to 1.0)
+ * FreeBSD (7.0 to 2.2)
+ * OpenBSD (4.0 to 2.6)
+ * BSDi (4.0.1 to 2.1)
+ * AIX (6.1, 5.3, 5.2, 5.1, 4.3.3, 4.1.5, 3.2.5) -- see README.aix
+ * IRIX (6.5 to 5.1)
+ * OSF (4.0, 3.2 and Tru64 Unix 5.1B) -- see README.tru64
+ * SunOS 4 (4.1.4 to 4.1.2)
+ * Ultrix (4.5 to 4.2)
+ * Dynix/PTX 4.4
+ * QNX 6.2.1A
+
+ We have also been informed about a port to the Stratus VOS.
+ See http://ftp.stratus.com/vos/network/network.html for details.
+
+ See the next question but one for the status of Windows support.
+
+ Certain systems fail to compile particular portions of the agent.
+ These can usually be persuaded to compile (at the loss of some
+ functionality) by omitting the modules affected.
+ See the next question for more details.
+
+ Also note that the presence of a particular configuration in this
+ list does not imply a perfect or complete implementation. This
+ is simply what various people have reported as seeming to work.
+ (Or more frequently, the configurations where people have reported
+ problems that we think we've subsequently fixed!)
+
+
+
+What happens if mine isn't listed?
+---------------------------------
+
+ It's probably worth trying to compile it anyway. Unless your
+ system is significantly different to the supported configurations,
+ most of the code (library, applications and the agent infrastructure)
+ should probably compile with little or no difficulty. The most
+ likely source of problems will be MIB modules within the agent,
+ as this tends to be where the most system-specific code is found.
+
+ If only a few modules fail to compile, try removing them from
+ the agent by running "configure --with-out-mib-module=xxx,yyy",
+ and re-compiling. If a large number of modules fail, then it
+ might be easier to start from a relatively bare system, using
+ "configure --enable-mini-agent --with-defaults". Then if this
+ minimal agent compiles and runs successfully, try adding each of
+ the missing mibgroups individually using the configure option
+ '--with-mib-module'.
+
+ If configure fails with "invalid configuration" messages, or
+ you get completely stuck, contact the coders list for advice.
+ Similarly, if you manage to get this working on a new system,
+ please let us know of any code changes that you needed to make,
+ together with details of the hardware you're using, and what
+ versions of the operating system you've tried it on. The entry
+ 'host' in the file 'config.status' should show this information.
+ Oh, and congratulations!
+
+
+
+Does it run on Windows?
+----------------------
+
+ The suite should compile and run on Win32 platforms, including
+ the library, command-line tools and the basic agent framework.
+ Note that the agent now includes support for the MIB-II module,
+ but this requires Microsoft's Core Platform SDK. Instructions
+ for how to install this are given in README.win32.
+
+ Pre-compiled binaries are available from the project web site.
+
+ As of v5.4, the Net-SNMP agent is able to load the Windows SNMP
+ service extension DLLs by using the Net-SNMP winExtDLL extension.
+
+ Some other Net-SNMP MIB modules, including the UCD pass-through
+ extensions, do not currently work under Windows. Volunteers to assist
+ with these missing modules are likely to welcomed with open arms :-)
+
+ Further details of Windows support (currently Visual C++, MinGW
+ and Cygnus cygwin32) is available in the file README.win32.
+
+
+
+How do I find out about new releases?
+------------------------------------
+
+ There is a mailing list for these announcements
+
+ net-snmp-announce@lists.sourceforge.net
+
+ To be added to (or removed from) this list, visit
+ http://www.net-snmp.org/lists/net-snmp-announce/
+ Or you can send a message to the address
+ net-snmp-announce-request@lists.sourceforge.net
+ with a subject line of 'subscribe' (or 'unsubscribe' as appropriate).
+
+ Advance notice of upcoming releases are also made on the
+ net-snmp-users list (for "release candidates") for a week
+ or two before the full release, and on the net-snmp-coders
+ list (for "pre-releases") during the period prior to this.
+
+ Major code revisions may be announced more widely, but these
+ lists are the most reliable way to keep in touch with the
+ status of the package.
+
+ Patches to fix known problems are also made available via the web site:
+
+ http://www.net-snmp.org/patches/
+
+
+
+How can I find out what other people are doing?
+----------------------------------------------
+
+ There is a general purpose discussion list
+
+ net-snmp-users@lists.sourceforge.net
+
+ To be added to (or removed from) this list, visit
+ http://www.net-snmp.org/lists/net-snmp-users/
+ Or you can send a message to the address
+ net-snmp-users-request@lists.sourceforge.net
+ with a subject line of 'subscribe' (or 'unsubscribe' as appropriate).
+
+ To find out what the developers are doing, and to help them
+ out, please read the PORTING file enclosed with the package.
+
+ There is also a #net-snmp IRC channel set up on the freenode.net
+ chat system. You can connect to this via chat.freenode.net.
+ See http://www.freenode.net/ for more information on getting
+ started with IRC.
+ Several core developers hang out on this channel on a fairly
+ regular basis.
+
+
+
+How do I submit a patch or bug report?
+-------------------------------------
+
+ The best way to submit a bug report is via the bug database through
+ the interface found at
+ http://www.net-snmp.org/bugs/
+ Be sure to include the version of the package that you've been working
+ with, the output of the command 'uname -a', the precise configuration
+ or command that triggers the problem and a copy of any output produced.
+
+ Questions about using the package should be directed at the
+ net-snmp-users@lists.sourceforge.net mailing list. Note that this
+ mailing list is relatively busy, and the people answering these
+ questions are doing so out of the goodness of their hearts, and in
+ addition to their main employment. Please note the following:
+
+ - use plain text mail, rather than HTML
+ - don't resend questions more than once
+ (even if no-one answered immediately)
+ - include full details of exact commands and error messages
+ ("I've tried everything, and it doesn't work" isn't much use!)
+ - do *NOT* send messages to -users and -coders mailing lists
+ (most developers read both anyway)
+ - don't mail the developers privately - keep everything on the list
+
+ We can't promise to be able to solve all problems, but we'll
+ certainly try and help. But remember that this is basically an
+ unsupported package. It's Open Source, so if you need something
+ fixing badly enough, fundamentally it's up to you to do the work.
+
+ All patches should be submitted to the patch manager at
+ http://www.net-snmp.org/patches/
+ If possible, submit a bug report describing the patch as well
+ (referencing it by its patch number) since the patch manager
+ doesn't contain a decent description field.
+
+ The best way to submit patch (diff) information is by checking out
+ the current code from the development git trunk, making your changes
+ and then running "git diff" or "git format-patch" after you're done.
+
+ (Please see http://www.net-snmp.org/wiki/index.php/Git for further
+ information on using git with the Net-SNMP project)
+
+ If you're working from a source code distribution, and comparing old
+ and new versions of a code file, use "diff -u OLDFILE NEWFILE"
+
+
+
+Can I reuse the code in my commercial application?
+-------------------------------------------------
+
+ The details of the COPYRIGHTs on the package can be found in the COPYING
+ file. You should have your lawyer read this file if you wish to use the
+ code in your commercial application. We will not summarize here what is
+ in the file, as we're not lawyers and are unqualified to do so.
+
+
+
+What's the difference between SNMPv1, SNMPv2 and SNMPv3?
+-------------------------------------------------------
+What's the difference between SNMPv2 and SNMPv2c?
+------------------------------------------------
+
+ A full description is probably beyond the scope of this FAQ.
+ Very briefly, the original protocol and admin framework was
+ described in RFCs 1155-1157, and is now known as SNMPv1.
+
+ Practical experience showed up various problems and deficiencies
+ with this, and a number of revised frameworks were developed to try
+ and address these problems. Unfortunately, it proved difficult to
+ achieve any sort of agreement - particularly over the details of
+ the administrative framework to use.
+
+ There was less disagreement over the proposed changes to the
+ protocol operations. These included:
+ * increasing the range of errors that could be reported
+ * introducing "exception values"
+ (so a single missing value didn't affect
+ the other varbinds in the same request)
+ * a new GETBULK operation
+ (a supercharged GETNEXT)
+ * new notification PDUs
+ (closer in structure to the other request PDUs)
+
+ Strictly speaking, it's this revised protocol (originally defined
+ in RFC 1905, and most recently in RFC 3416) that is "SNMPv2".
+
+ The only framework based on this protocol that saw a significant
+ level of use was "Community-based SNMPv2" or "SNMPv2c" (defined
+ in RFC 1901). This retained the same administrative framework
+ as SNMPv1 (with all of the accompanying limitations), but using
+ the new protocol operations.
+
+ More recently, a new administrative framework has been developed,
+ building on the various competing SNMPv2 proposals, and using the
+ same SNMPv2 protocol operations. This is SNMPv3, which is defined
+ in RFCs 3411-3418. It addresses some of the deficiencies of the
+ community-based versions, including significant improvements to
+ the security of SNMP requests (like it finally has some!).
+ SNMPv3 is now a full IETF standard protocol.
+
+ Strictly speaking, SNMPv3 just defines a fairly abstract framework,
+ based around the idea of "Security Models" and "Access Control Models".
+ It's this combination of SNMPv3 plus accompanying models that actually
+ provides a working SNMP system.
+ However, the only models in common use are the "User-based Security
+ Model" (RFC 3414) and the "View-based Access Control Model" (RFC 3415).
+ So "SNMPv3" is frequently used to mean the combination of the basic
+ SNMPv3 framework with these two particular models.
+ This is also sometimes described as "SNMPv3/USM".
+
+
+ So in brief:
+ - SNMPv2c updated the protocol operations
+ but left the administrative framework unchanged.
+ - SNMPv3 updated the administrative framework
+ but left the protocol operations unchanged.
+
+
+
+Which versions of SNMP are supported in this package?
+----------------------------------------------------
+
+ This package currently supports the original SNMPv1 (RFC 1157),
+ Community-based SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418).
+ The agent will respond to requests using any of these protocols,
+ and all the tools take a command-line option to determine which
+ version to use.
+
+ Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452)
+ was dropped with the 4.0 release of the UCD-snmp package.
+
+
+
+Can I use SNMPv1 requests with an SNMPv2 MIB (or vice versa)?
+------------------------------------------------------------
+
+ Yes.
+
+ The syntax used to specify a MIB file (better referred
+ to as SMIv1 or SMIv2) is purely concerned with how to define
+ the characteristics of various management objects. This is
+ (almost) completely unrelated to the versions of the protocol
+ used to operate on these values. So it is quite reasonable to
+ use SNMPv1 requests on objects defined using SMIv2, or SNMPv2
+ (or SNMPv3) requests on objects defined using SMIv1.
+
+ The one exception is objects of syntax Counter64, which are
+ only accessible using SNMPv2 or higher. SNMPv1 requests will
+ either treat such objects as an error, or skip them completely.
+
+ Note that SMIv1 is effectively obsolete, and all new MIBs
+ should be written using SMIv2.
+
+
+
+How can I monitor my system with SNMP?
+-------------------------------------
+
+ There are two main methods of using SNMP for monitoring. One is to regularly
+ query the SNMP agent for information of interest, graphing these values and/or
+ saving them for later analysis. That's not really the focus of the Net-SNMP
+ project - our tools are more low-level, single-shot commands. For this sort
+ of high-level management, you're really looking at a management console
+ application (such as Nagios or OpenNMS), or a data logging application
+ (such as RRDtool, or one of its front-ends - MRTG, Cacti, etc).
+
+ The other approach is to configure the SNMP agent to monitor the relevant
+ information itself, and issue an alert when the values pass suitable limits.
+ See the section ACTIVE MONITORING in the snmpd.conf(5) man page for details.
+
+ Note that this entry makes no reference as to _what_ you should monitor, or
+ what values might be significant. That's because it is impossible to provide
+ a universal answer to these questions. The information to monitor, and the
+ normal operating values will ultimately depend on your local environment.
+ SNMP is simply a tool to _help_ you manage your systems - it isn't a magic
+ panacea - you still have to think for yourself!
+
+
+
+Where can I find more information about network management?
+----------------------------------------------------------
+
+ There are a number of sites with network management information on
+ the World Wide Web. Some of the most useful are
+
+ http://www.simpleweb.org/
+ http://www.snmplink.org/
+ http://www.mibdepot.com/
+
+ The SNMP Usenet newsgroup is now mostly defunct, but although the
+ FAQ hasn't been updated for a while, it still contains a large
+ amount of useful information relating to SNMP, including books,
+ software, other sites, how to get an enterprise number, etc, etc.
+ This is available from
+
+ ftp://rtfm.mit.edu/pub/usenet/comp.protocols.snmp/
+
+ or via any of the Web sites above.
+
+
+
+What ports does SNMP use?
+------------------------
+
+ There are three main network ports (and one named socket), which are
+ typically used by SNMP. These are:
+
+ - UDP port 161 - SNMP requests (GET* and SET)
+ - UDP port 162 - SNMP notifications (Traps/Informs)
+ - TCP port 705 - AgentX
+ - /var/agentx/master - AgentX
+
+ However, these are simply the default "well-known" ports for these purposes,
+ and it is perfectly possible to accept requests on other ports.
+
+
+
+Is Net-SNMP thread safe?
+-----------------------
+
+ Strictly speaking, no. However, it is possible to use the library within
+ a multi-threaded management application. This is covered in detail in
+ the file README.thread (shipped with the standard distribution), but can
+ be summarised as follows:
+
+ - Call 'snmp_sess_init()' prior to activating any threads.
+ This reads in and parses MIB information (which isn't thread-safe)
+ as well as preparing a session structure for subsequent use.
+
+ - Open an SNMP session using 'snmp_sess_open()' which returns an
+ opaque session handle, which is essentially independent of any
+ other sessions (regardless of thread).
+
+ - Resource locking is not handled within the library, and is the
+ responsibility of the main application.
+
+ The Net-SNMP agent has not been designed for multi-threaded use. It
+ should be safe to use the agent library to embed a subagent within a
+ threaded application as long as *all* SNMP-related activity (including
+ generating traps, and parsing MIBs) is handled within a single thread.
+
+ The command-line tools shipped as part of the Net-SNMP distribution
+ are simple single-threaded applications, and are not designed for
+ multi-threaded use. Adapting these to a threaded model is left as
+ an exercise for the student.
+ The same holds true for the notification receiver (snmptrapd).
+
+ Unfortunately, the SNMPv3 support was added about the same time as
+ the thread support and since they occurred in parallel the SNMPv3
+ support was never checked for multi-threading correctness. It is
+ most likely that it is not thread-safe at this time.
+
+
+APPLICATIONS
+============
+
+How do I add a MIB?
+------------------
+
+ This is actually two separate questions, depending on whether you
+ are referring to the tools, or the agent (or both).
+ See the next question or the next section respectively.
+
+
+
+How do I add a MIB to the tools?
+-------------------------------
+
+ Adding a MIB to the client-side tools has two main effects:
+
+ - it allows you to refer to MIB objects by name
+ (rather than having to use the numeric OIDs)
+ - it allows the results to be displayed in a more immediately
+ meaningful fashion. Not just giving the object names, but
+ also showing named enumeration values, and interpreting table
+ indexes properly (particularly for string and OID index values).
+
+ There are two steps required to add a new MIB file to the tools.
+ Firstly, copy the MIB file into the appropriate location:
+
+ cp MY-MIB.txt /usr/local/share/snmp/mibs
+ (which makes it available to everyone on the system)
+ or
+ mkdir $HOME/.snmp
+ mkdir $HOME/.snmp/mibs
+ cp MY-MIB.txt $HOME/.snmp/mibs
+ (which makes it available to you only)
+
+ Note that the location of the shared MIB directory may be different
+ from that given here - see the FAQ entry "Where should I put my MIB
+ files?" for more information.
+
+
+ Secondly, tell the tools to load this MIB:
+
+ snmpwalk -m +MY-MIB .....
+ (load it for this command only)
+ or
+ export MIBS=+MY-MIB
+ (load it for this session only)
+ or
+ echo "mibs +MY-MIB" >> $HOME/.snmp/snmp.conf
+ (load it every time)
+
+ Note that the value for this variable is the name of the MIB
+ module, *not* the name of the MIB file. These are typically the
+ same (apart from the .txt suffix), but if in doubt, check the contents
+ of the file. The value to use is the token immediately before the
+ word DEFINITIONS at the start of the file.
+
+ Or use the special value "all" to have the tools load all available
+ MIBs (which may slow them down, particularly if you have a large
+ number of MIB files.
+
+ Note that you need *both* steps.
+
+
+ Adding a MIB in this way does *not* mean that the agent will
+ automatically return values from this MIB. The agent needs to be
+ explicitly extended to support the new MIB objects, which typically
+ involves writing new code.
+ See the AGENT section for details.
+
+ Most of the tools (apart from 'snmptable') will work quite happily
+ without any MIB files at all - although the results won't be displayed
+ in quite the same way. Similarly, the agent doesn't need MIB files
+ either (other than to handle MIB object names in the configuration file).
+
+
+
+Why can't I see anything from the agent?
+---------------------------------------
+
+ Fundamentally, there are two basic reasons why a request may go
+ unanswered. Either the management application does not like the
+ request (so never sends it), or the agent does not like the request
+ (so never responds). The simplest way to distinguish between the
+ two is to run the command with the command-line option '-d'.
+
+ If this doesn't display a hex dump of the raw outgoing packet, then
+ it's the client side which is dropping the request. Hopefully you
+ should also see an error message, to help identify what's wrong.
+
+ If this displays one or more outgoing dumps (but nothing coming back),
+ then the request is failing at the agent end. See the next entry for
+ more details.
+
+
+ There are three further possibilities to consider:
+
+ One is that the agent may return a response to the original query,
+ but the management application may not like this response, and refuse
+ to display it. This is relatively unusual, and typically indicates
+ a flaw with the remote agent. (I hope you're not contemplating the
+ suggestion that the Net-SNMP command-line tools might contain bugs!)
+
+ The typical symptoms of this would be that the '-d' option would
+ display a sequence of sending and received packet dumps, with the
+ same contents each time. Ask on the mailing list for advice.
+
+
+ Alternatively, the agent may simply not support the MIB objects being
+ requested. This is most commonly seen when using the "snmpwalk" tool
+ (particularly with SNMPv1).
+
+ The symptoms here would be that '-d' would show two pairs of raw
+ packet dumps - one a GETNEXT request (A1 in the sending packet),
+ followed by a GET request (A0). Repeating the same request with the
+ "snmpgetnext" command-line tool should show the information (if any)
+ that the agent returned, which was then discarded by snmpwalk as
+ irrelevant.
+
+ Note that this is how snmpwalk was designed to work. It is not an error.
+
+
+ Finally, it may be that the agent is simply taking too long to respond.
+ The easiest way to test for this is to add the command-line options
+ "-t 60 -r 0", which will send a single request (with no repetitions)
+ and wait for a minute before giving up. This ought to be long enough
+ for all but the most-overloaded agent, or inefficient MIB module!
+
+ If this turns out to be the cause, then ask on the mailing list for
+ advice on options for improving the performance.
+
+
+
+Why doesn't the agent respond?
+-----------------------------
+
+ Assuming that the tests outlined in the previous entry indicate that
+ the problem lies with the agent not responding, the obvious question
+ is "why not".
+
+ Again, there are two basic possibilities - either the agent never
+ sees the request, or it receives it but is unwilling (or unable) to
+ process it. If the remote system is running the Net-SNMP agent,
+ then the easiest way to distinguish between these two cases is to
+ shut down the agent, and re-start it manually using the options
+ -f -Le -d
+ Then send the same query as before. This should display raw dumps of
+ packets seen (or sent) by the agent, just as with the client side in
+ the previous entry.
+
+
+ If the agent does not display anything, then it is simply not receiving
+ the requests. This may be because they are being blocked by network
+ or local firewall settings ('iptables -L'), or the agent may not be
+ listening on the expected interfaces ('netstat -a').
+
+ This is most commonly encountered when running queries from a remote
+ host, particularly if the same request succeeds when run on the same
+ system as the agent itself.
+
+
+ If the agent displays a dump of the incoming request, but nothing going
+ out, then the most likely cause is access control settings. See the
+ relevant entries in the AGENT section for details. Note that if the agent
+ receives an SNMPv1 or SNMPv2c request with a unknown community string,
+ then it will not return an error response - the request is simply discarded.
+
+ Another possibility is that the request may be rejected by settings in
+ /etc/hosts.{allow,deny}. Again, '-d' will display an incoming packet
+ dump but no corresponding outgoing response. However in this situation,
+ the agent should also log a message that the request is being refused.
+
+
+ Running the agent with '-d' can also help identify situations where the
+ agent *is* responding to the request, but only after a long delay. This
+ would be indicated by a series of incoming packet dumps (showing various
+ retries from the client side), followed by several outgoing dumps - possibly
+ long after the client tool has given up in disgust.
+ See the entry
+ The agent worked for a while, then stopped responding. Why?
+ later in this section.
+
+
+
+I can see the system group, but nothing else. Why?
+--------------------------------------------------
+
+ This is almost definitely due to the access configuration of the agent.
+ Many pre-configured systems (such as most Linux distributions) will only
+ allow access to the system group by default, and need to be configured
+ to enable more general access.
+
+ The easiest way to test this is to try a GETNEXT request on one of
+ the other standard groups
+ e.g.
+ snmpgetnext ..... interfaces
+
+ If the agent responds with "hrSystemUptime.0" or "end of MIB", then it
+ is clearly configured in this way. See the entries on access control
+ in the AGENT section for more information.
+
+
+
+Why can't I see values in the <ENTERPRISE> tree?
+-----------------------------------------------
+
+ If you can see most of the standard information (not just the system and
+ hrSystem groups), but not in the vendor-specific 'enterprises' tree, then
+ once again there are several possible causes.
+
+ Firstly, it's possible that the agent does not implement this particular
+ enterprise tree. Remember that adding a MIB to the client tools does
+ *not* automatically add support for these object to the agent. See the
+ AGENT section for more information.
+
+
+ Alternatively, it may be that the agent does implement some or all of this
+ enterprise tree, but the access control settings are configured to block
+ access to it.
+
+ The simplest way to checks whether the agent implements a given portion
+ of the OID tree is to run
+
+ snmpwalk .... nsModuleName
+
+ and look for index values that fall in the area of interest.
+ (Always assuming that you have access to this particular section
+ of the Net-SNMP enterprise tree, of course!)
+
+ Checking the access control settings can be done by examining the tables
+ vacmAccessTable and vacmViewTreeFamilyTable. Note that these are used
+ to configure access control for *all* versions of SNMP - not just SNMPv3.
+
+
+ The third possibility is that simply isn't any information in the specified
+ tree. For example, several of the tables in the UCDavis enterprise tree
+ (such as prTable, extTable, dskTable and fileTable) require explicit
+ configuration in the snmpd.conf file. If you query this particular tables
+ without the necessary configuration entries, then they will be empty.
+
+
+ Finally, if you can't see anything from *any* enterprise-specific tree,
+ then this may be down to how you are asking for the information. By
+ default, if "snmpwalk" is run without an explicitly starting OID, then
+ it will display the contents of the 'mib-2' tree, containing most of the
+ IETF-standard management information supported by the agent.
+
+ When the agent reaches the end of this tree, it will return the first
+ enterprise-specific value, 'snmpwalk' will recognise that this marks the
+ end of the (implicit) requested tree, and stop. No enterprise-specific
+ information will be displayed.
+
+ To walk the whole tree, and see *all* the information that the
+ agent supports, specify a starting point of '.iso' or '.1'.
+ To walk a specific enterprise subtree, specify the root of this tree
+ as the starting point - e.g:
+
+ snmpwalk -v1 -c public localhost UCD-SNMP-MIB::ucdavis
+
+ There is more information about particular UCD-specific subtrees in
+ the AGENT section.
+
+
+
+The agent worked for a while, then stopped responding. Why?
+-----------------------------------------------------------
+
+ There are three basic possibilities:
+ - the agent has crashed
+ - it is hanging
+ - it is temporarily overloaded
+
+ Detecting whether the agent has crashed should be fairly straighforward.
+ If you can reliably reproduce this crash (e.g. by sending a particular
+ SNMP request), then contact the coders list for advice.
+ It's the other two cases that are probably more significant.
+
+ To tell the difference between these two, try leaving the agent
+ undisturbed for a while, and then probe it using a single 'snmpget'
+ request, specifying a longer timeout (e.g. '-t 120'). If it now
+ responds, then something was probably sending requests (including
+ duplicate retries) faster than the agent could process them, and it
+ was building up a backlog. Try adjusting the timeout period and retry
+ frequency of these client requests, or look at improving the efficiency
+ of the implementation of the relevant MIB objects.
+
+ If the agent remains unresponsive (particularly if the load on the
+ system is steadily climbing), then it's probably hanging, and all
+ you can really do is restart the agent. If you can identify what
+ causes this to happen, then contact the coders list for advice.
+
+
+
+Requesting an object fails with "Unknown Object Identifier" Why?
+----------------------------------------------------------------
+
+ If a general snmpwalk shows a particular entry, but asking for it more
+ specifically gives a "sub-identifier not found:" or "Unknown Object
+ Identifier" error, then that's a problem with the tool, rather than
+ the agent.
+
+ Firstly, make sure that you're asking for the object by the right name.
+ Object descriptors are case-sensitive, so asking for 'sysuptime' will
+ not be recognised, but 'sysUpTime' will.
+
+ Alternatively, the object may be defined in a MIB that hasn't been
+ loaded. Try loading in all the MIB files:
+
+ snmpget -m ALL -v1 -c public localhost sysUpTime.0
+
+ or specify the name of the appropriate MIB explicitly:
+
+ snmpget -v1 -c public myhost SNMPv2-MIB::sysUpTime.0
+
+ Note that this uses the name of the *module*, not the name of the file.
+ However, if 'snmpwalk' displays the object by name, this is unlikely to
+ be the cause, and you should look closely at the exact object name you
+ are using. In particular, see the next entry.
+
+
+
+Why do I get "noSuchName" when asking for "sysUpTime" (or similar)?
+------------------------------------------------------------------
+
+ Assuming that you do have access to this object, the most likely cause
+ is forgetting the instance subidentifier.
+
+ If you try walking the 'system' group (or any other part of the MIB tree),
+ you should notice that all of the results have a number after the object
+ name. This is the "instance subidentifier" of that particular MIB instance.
+
+ For values in tables (such as the sysORTable), this acts as an index into
+ the table - a very familiar concept. But *all* SNMP values will display an
+ instance number, whether or not they are part of a table. For non-table
+ objects ("scalars"), this instance subidentifier will always be '0',
+ and it *must* be included when making a GET request.
+
+ Compare the following:
+
+ $ snmpget -v1 -c public localhost sysUpTime
+ Error in packet
+ Reason: (noSuchName) There is no such variable name in this MIB.
+ This name doesn't exist: system.sysUpTime
+
+ $ snmpget -v1 -c public localhost sysUpTime.0
+ system.sysUpTime.0 = Timeticks: (69189271) 8 days, 0:11:32.71
+
+ This is a little less obscure when using SNMPv2c or v3 requests:
+
+ $ snmpget -v 2c -c public localhost sysUpTime
+ system.sysUpTime = No Such Instance currently exists
+
+
+
+Why do I sometimes get "End of MIB" when walking a tree, and sometimes not?
+--------------------------------------------------------------------------
+
+ This depends on which MIB modules are supported by the agent you are
+ querying and exactly what you're asking for.
+
+ Note that a tree is walked by repeatedly asking for "the next entry" until
+ all the values under that tree have been retrieved. However, the agent has
+ no idea that this is what's happening - all it sees is a request for "the
+ next entry after X".
+
+ If the object X happens to be the last entry in a sub-tree, the agent will
+ provide the next object supported (as requested) even though this will be
+ in a different subtree. It's up to the querying tool to recognise that
+ this last result lies outside the area of interest, and simply discard it.
+
+ If the object X happens to be the last entry supported by the agent, it
+ doesn't have another object to provide, so returns an "end of MIB"
+ indication. The Net-SNMP tools report this with the message above.
+
+ But in either case, the actual information provided will be the same.
+
+
+
+How do I use SNMPv3?
+-------------------
+
+ The simplest form of SNMPv3 request is unauthenticated and unencrypted
+ (noAuthNoPriv). It simply requires a user name, and would look something
+ like:
+
+ snmpget -v 3 -l noAuthNoPriv -u dave localhost sysUpTime.0
+
+ However this approach foregoes the security protection which is the
+ main advantage of using SNMPv3 (and the agent must also be explicitly
+ configured to allow unauthenticated requests from that user).
+
+ The most common form of SNMPv3 request is authenticated but not encrypted
+ (authNoPriv). This specifies the pass phrase to authenticate with:
+
+ snmpget -v 3 -l authNoPriv -u dave -A "Open the Door"
+ localhost sysUpTime.0
+
+ A fully secure (i.e. encrypted) request (authPriv) would also specify
+ the privacy pass phrase:
+
+ snmpget -v 3 -l authPriv -u dave -A "Open the Door"
+ -X "Bet you can't see me" localhost sysUpTime.0
+
+ In practise, most of these would probably be set via configuration
+ directives in a personal $HOME/.snmp/snmp.conf file (note, *not* the
+ agent's snmpd.conf file).
+ The equivalent settings for the third example would be:
+
+ defSecurityName dave
+ defSecurityLevel authPriv
+ defAuthPassphrase "Open the Door"
+ defPrivPassphrase "Bet you can't see me"
+
+ If the AuthPassphrase and the PrivPassphrase are the same, then you
+ can use the single setting
+ defPassphrase "Open the Door and see me"
+ instead.
+
+ See the AGENT section for how to configure the agent for SNMPv3 access.
+
+
+
+Why can't I set any variables in the MIB?
+----------------------------------------
+
+ There are three possible reasons for this:
+
+ Many MIB objects are defined as "read-only" and inherently cannot be
+ changed via SET requests. Attempts to do so will typically be rejected
+ by the 'snmpset' command without ever being sent to the agent.
+
+ Of those objects that can in principle be changed, the agent may not
+ include the code necessary to support SET requests. (GET and GETNEXT
+ are much easier to handle - particularly for objects relating to the
+ internals of the underlying operating system).
+
+ Even if SET support has been implemented, the agent may not be configured
+ to allow write access to this object.
+
+ Ready-installed distributions (such as those shipped with Linux) tend
+ to be configured with read-only access to part of the mib tree (typically
+ just the system group) and no write access at all.
+
+ To change this, you will need to set up the agent's access control
+ configuration. See the AGENT section for more details.
+
+ Note that neither the community string "public" nor "private" can be
+ used to set variables in a typical default configuration.
+
+
+
+Variables seem to disappear when I try to set them. Why?
+--------------------------------------------------------
+
+ This is actually the same as the previous question - it just isn't
+ particularly obvious, particularly when using SNMPv1. A typical
+ example of this effect would be
+
+ $ snmpget -v1 -c public localhost sysLocation.0
+ sysLocation.0 = somewhere nearby
+
+ $ snmpset -v1 -c public localhost sysLocation.0 s "right here"
+ Error in packet.
+ Reason: (noSuchName) There is no such variable name in this MIB.
+ This name doesn't exist: sysLocation.0
+
+ Trying the same request using SNMPv2 or above is somewhat more informative:
+
+ $ snmpset -v 2c -c public localhost sysLocation.0 s "right here"
+ Error in packet.
+ Reason: notWritable
+
+ The SNMPv1 error 'noSuchName' actually means:
+
+ "You can't do that to this variable"
+
+ rather than "this variable doesn't exist".
+ It may be the case that it doesn't exist at all. It may exist but you
+ don't have access to it (although different administrative credentials
+ might be accepted). Or it may exist, but you simply can't perform that
+ particular operation (e.g. changing it).
+ Similarly, the SNMPv2 error 'notWritable' means "not writable in this
+ particular case" rather than "not writable under any circumstances".
+
+ If you are sure that the object is both defined as writable, and has been
+ implemented as such, then you probably need to look at the agent access
+ control. See the AGENT section for more details.
+ But see the next entry first.
+
+
+
+Why can't I change sysLocation (or sysContact)?
+----------------------------------------------
+
+ There is one final possibility to consider for why a SET request might
+ be rejected.
+
+ The values for certain MIB objects (including 'sysLocation' and 'sysContact')
+ can be configured via the snmpd.conf file. If this is done, then these
+ particular objects become read-only, and cannot be updated via SET commands,
+ even if the access control settings would otherwise allow it.
+
+ This may seem perverse, but there is good reason for it. If there is a
+ configuration setting for one of these objects, then that value will be
+ used whenever the agent re-starts. If the object was allowed to be updated
+ using SET, this new value would be forgotten the next time the agent was
+ re-started.
+
+ Hence the Net-SNMP agent rejects such requests if there's a value configured
+ via the 'snmpd.conf' file. If there isn't such a config setting, then the
+ write request will succeed (assuming suitable access control settings), and
+ the new value will be retained the next time the agent restarts.
+
+
+
+I get an error when trying to set a negative value - why?
+--------------------------------------------------------
+
+ This is a different problem. What's happening here is that the
+ routine that parses the arguments to the 'snmpset' command is seeing
+ the '-' of the new value, and treating it as a command-line option.
+ This normally generates an error (since digits typically aren't valid
+ command line options).
+
+ The easiest way to solve this is include the "end-of-option"
+ indicator '--' in the command line, somewhere before the new value
+ (but after all of the options, obviously). For example:
+
+ snmpset -v 2c -c public localhost -- versionRestartAgent.0 i -1
+
+ (This command will still fail, since -1 isn't an acceptable value for
+ this particular object, but that's not the point here!)
+
+
+
+I get an error when trying to query a string-indexed table value - why?
+----------------------------------------------------------------------
+
+ The Net-SNMP library will normally try to interpret string-based
+ index values, and display them in a meaningful manner:
+
+ $ snmpgetnext .... vacmGroupName
+ vacmGroupName.3."dave" = theWorkers
+
+ The command-line tools will also accept string-valued indexes within
+ an OID, and convert them into the appropriate numeric form before
+ sending an SNMP request. However the Unix shell will typically
+ swallow the quotes around the string index value, before the SNMP
+ tools can get a chance to interpret them.
+
+ The answer is to escape the quotes, to protect them from the shell,
+ and allow them to be passed through to the OID parser:
+
+ snmpget .... vacmGroupName.3.\"dave\"
+ or
+ snmpget .... 'vacmGroupName.3."dave"'
+
+
+ Another alternative is to avoid trying to specify the index value as
+ a string, and provide the numeric subidentifiers directly:
+
+ snmpget .... vacmGroupName.3.4.100.97.118.101
+
+ (where '3' indicates SNMPv3, '4' is the length of the string index,
+ followed by the ASCII values of the individual characters).
+
+ The command-line option '-Ob' will display the results of querying
+ a string-indexed table in this format:
+
+ $ snmpgetnext -Ob .... vacmGroupName
+ vacmGroupName.3.4.100.97.118.101 = theWorkers
+
+
+
+How should I specify string-indexed table values?
+------------------------------------------------
+
+ There's one other aspect of string-indexed tables that can cause
+ problems - the difference between implicit- and explicit-length
+ strings, and how to represent these when making an SNMP query.
+
+ The most common style of string index uses an explicit length,
+ followed by the individual ASCII character values:
+
+ "dave" = 4.'d'.'a'.'v'.'e'
+
+ (as shown in the previous entry).
+
+ However if the string index is defined in the MIB file as IMPLIED
+ (or if it has a fixed length, such as a physical ethernet address),
+ then the length subidentifier is omitted, and the index simply
+ consists of the character values:
+
+ "dave" = 'd'.'a'.'v'.'e'
+
+ Note that IMPLIED index objects can only appear as the *last* index
+ for a table.
+
+ The Net-SNMP library uses double quotes (i.e. "dave) to indicate an
+ explicit length string index value, and single quotes (i.e. 'dave')
+ to indicate an implicit length one. If you use the wrong style of
+ quotes, then the resulting OID will be incorrect, and you'll get
+ confusing results to your query.
+
+
+
+How do I send traps and notifications?
+---------------------------------------
+
+ Traps and notifications can be sent using the command 'snmptrap'.
+ The following examples generate the generic trap 'warmStart(1)' and a
+ (dummy) enterprise specific trap '99' respectively:
+
+ snmptrap -v 1 -c public localhost "" "" 1 0 ""
+ snmptrap -v 1 -c public localhost "" "" 6 99 ""
+
+ The empty parameters "" will use suitable defaults for the relevant
+ values (enterprise OID, address of sender and current sysUptime).
+
+ An SNMPv2 or SNMPv3 notification (either trap or inform) takes
+ the OID of the trap to send:
+
+ snmptrap -v 2c -c public localhost "" UCD-SNMP-MIB::ucdStart
+ snmptrap -v 2c -c public localhost "" .1.3.6.1.4.1.2021.251.1
+
+ (These two are equivalent ways of specifying the same trap). Again,
+ the empty parameter "" will use a suitable default for the relevant
+ value (sysUptime).
+
+ Any of these commands can be followed by one or more varbinds,
+ using the same (OID/type/value) syntax as for 'snmpset':
+
+ snmptrap -v 2c -c public localhost "" ucdStart sysContact.0 s "Dave"
+
+ Generating traps from within the agent, or other applications, is
+ covered in the AGENT and CODING sections.
+
+ You should also read the snmptrap tutorial at
+ http://www.net-snmp.org/wiki/index.php/TUT:snmptrap
+ which will help you understand everything you need to know about traps.
+
+
+
+How do I receive traps and notifications?
+----------------------------------------
+
+ Handling incoming traps is the job of a "notification receiver".
+ The Net-SNMP suite include the tool 'snmptrapd' to act in this role.
+ This can log traps to a file or via the syslog mechanism, forward them
+ to another notification receiver and/or invoke a specified command
+ whenever a particular notification is received.
+
+ Logging notifications would be done by starting snmptrapd as:
+ snmptrapd -Ls 7 (log to syslog using 'LOCAL7')
+ or
+ snmptrapd -f -Lo (log to standard output)
+
+ Invoking a command to process a received notification uses one or
+ more 'traphandle' directives in the configuration file 'snmptrapd.conf'.
+ A typical configuration might look something like:
+
+ traphandle .1.3.6.1.6.3.1.5.1 /path/to/page_me up
+ traphandle .1.3.6.1.4.1.2021.251.1 /path/to/page_me up
+ traphandle .1.3.6.1.4.1.2021.251.2 /path/to/page_me down
+ traphandle default /path/to/log_it
+
+ where 'page_me' and 'log_it' are the commands to be run.
+
+ Forwarding notifications to another receiver would be done using
+ similar 'snmptrapd.conf' directives:
+
+ forward .1.3.6.1.4.1.8072.4.0.3 10.0.0.1
+ forward default 10.0.0.2
+
+ There's a tutorial with more details on the web site at
+ http://www.net-snmp.org/wiki/index.php/TUT:snmptrap
+
+
+
+How do I receive SNMPv1 traps?
+-----------------------------
+
+ Directives in the 'snmptrapd.conf' file use the (SNMPv2) snmpTrapOID
+ value to identify individual notifications. This applies to *all*
+ versions of SNMP - including SNMPv1 traps. See the co-existence spec
+ (RFC 2576) for details of mapping SNMPv1 traps to SNMPv2 OIDs.
+
+ Note that the first traphandle directive in the previous entry uses
+ the OID corresponding to the SNMPv1 'coldStart' trap.
+
+
+
+Why don't I receive incoming traps?
+----------------------------------
+
+ Starting with net-snmp 5.3, snmptrapd will no longer automatically
+ accept all incoming traps. It must be configured with authorized
+ SNMPv1/v2c community strings and/or SNMPv3 users. Non-authorized
+ traps/informs will be dropped.
+ Please refer to the snmptrapd.conf(5) manual page for details.
+
+
+
+My traphandler script doesn't work when run like this - why not?
+---------------------------------------------------------------
+
+ If a traphandler script works fine when run manually from the
+ command line, but fails or generates an error when triggered by
+ an incoming notification, then there are two likely causes.
+
+ Firstly, the interactive shell environment may not be precisely
+ the same as that for programs executed by the snmptrapd daemon.
+ In particular, it's quite possible that the PATH environmental
+ variable may not include all the additional directories that are
+ commonly set up for a personal login configuration. To avoid this
+ problem (particularly for traphandler shell scripts), it's worth
+ giving the full path to all programs used within the script.
+
+ Secondly, the snmptrapd daemon may not always recognise the
+ appropriate interpreter to use for a particular trap handler.
+ If this is the case, then you can specify this interpreter
+ explicitly as part of the trap handle directive:
+
+ traphandle default /usr/bin/perl /usr/local/bin/log_it
+
+ In this case, it's almost certain that you'll also
+ need to give the full path to the traphandle script (as shown)
+
+
+
+How can the agent receive traps and notifications?
+-------------------------------------------------
+
+ It can't.
+
+ The primary purpose of an SNMP agent is to handle requests for
+ information from management applications. In SNMP terminology,
+ it acts as a "command responder".
+
+ It may also issue traps to report significant events or conditions
+ ("notification generator"). But responding to such notifications
+ is a significantly different role, and this is handled by a separate
+ application ('snmptrapd'). Note that it is perfectly possible (even
+ normal) for both agent and trap receiver to run on the same host.
+
+
+
+How big can an SNMP request (or reply) be?
+-----------------------------------------
+
+ The protocol definition specifies a "minimum maximum" packet size
+ (484 bytes for UDP), which all systems must support, but does not
+ attempt to define an upper bound for this maximum size. This is left
+ to each individual implementation.
+
+ The UCD software used a fixed size buffer of 1472 bytes to hold the
+ encoded packet, so all requests and responses had to fit within this.
+ The Net-SNMP releases handle packet buffers rather differently, and
+ are not subject to the same fixed restrictions.
+
+
+
+How can I monitor my systems (disk, memory, etc)?
+------------------------------------------------
+
+ In general, the Net-SNMP suite consists of relatively low-level
+ tools, and there is nothing included that is designed for high-level,
+ long-term monitoring of trends in network traffic, disk or memory
+ usage, etc.
+
+ There are a number of packages available that are designed for this
+ purpose. Two of the most widely used are MRTG (http://www.mrtg.org/)
+ and RRDtool (http://oss.oetiker.ch/rrdtool/). There are also several
+ frontends built on top of RRDtool, including Cacti (http://www.cacti.net/)
+ and Cricket (http://cricket.sourceforge.net/). There are details of
+ how to set up Cricket to monitor some of the UCD extensions at
+ http://www.afn.org/~jam/software/cricket/
+
+ We have also set up a page that describes in detail how MRTG
+ can be set up to monitor disk, memory and cpu activity at
+ http://www.net-snmp.org/tutorial-5/mrtg/index.html
+
+ There is also a web-based network configuration system "Net-Policy",
+ based upon SNMP. This is not strictly connected to the Net-SNMP project,
+ but a number of the core developers are also involved with that system.
+ See http://net-policy.sourceforge.net for more details.
+
+
+
+Applications complain about entries in your example 'snmp.conf' file. Why?
+--------------------------------------------------------------------------
+
+ There *is* no example 'snmp.conf' shipped with the standard distribution.
+
+ The configuration file 'EXAMPLE.conf' is designed as a config for
+ the agent, and should be installed as 'snmpd.conf' (note the 'd').
+ The file 'snmp.conf' is intended for general configuration options,
+ applicable to all applications (via the SNMP library).
+ Rename (or merge) the 'snmp.conf' file to 'snmpd.conf', and this
+ should fix the problem.
+
+ See the AGENT section or the 'snmpd.conf(5)' man page for more information
+ about what should go in this file.
+
+
+
+OK, what should I put in snmp.conf?
+----------------------------------
+
+ This is used to set common configuration values for most of the
+ applications, to avoid having to specify them every time. Examples
+ are the SNMPv3 settings mentioned above, defaults for which MIBs to
+ load and where from (see the second entry in this section),
+ and the default SNMP version, port and (if appropriate) community
+ string to use.
+
+ Some of these (such as MIB information), might be best put in a
+ shared snmp.conf file (typically /usr/local/share/snmp/snmp.conf or
+ /etc/snmp/snmp.conf) to apply to all users of the system. Others
+ (particularly the SNMPv3 security settings), are more likely to refer
+ to a particular user, and should probably go in a personal snmp.conf
+ file (typically $HOME/.snmp/snmp.conf).
+
+ See 'snmpget -H' and/or the snmp.conf(5) man page for more details.
+
+ You can also use the "snmpconf" command to help you generate your
+ snmp.conf configuration file (just run it and answer its questions).
+
+
+
+How do I specify IPv6 addresses in tools command line arguments?
+---------------------------------------------------------------
+
+ IPv6 addresses pose a particular problem for the Net-SNMP command
+ line tools, which parse host names into pieces. In particular, normally
+ if you specify a simple host name, it assumes you want UDP in IPv4 on
+ port 161. By default, these two commands are actually the same:
+
+ snmpget 127.0.0.1 sysUpTime.0
+ snmpget udp:127.0.0.1:161 sysUpTime.0
+
+ However, for IPv6 this causes a problem because IPv6 addresses also use
+ a colon to separate addressing parts. Thus you need to enclose the address
+ in square brackets ( [ and ] ).
+ Because most shells use these brackets too, you also likely need to quote it:
+
+ snmpget 'udp6:[::1]:161' sysUpTime.0
+
+
+
+PERL
+====
+
+What is the purpose of the Perl SNMP module?
+-------------------------------------------
+
+ Short, comprehensive (but ultimately unhelpful) anwer - to provide a
+ perl interface for SNMP operations.
+
+ Longer, incomplete (but more useful) answer - there are probably two
+ main uses for the Perl SNMP module. The first is for developing client
+ management applications, using perl to send SNMP requests, and manipulating
+ or displaying the results. As such, this is a straight alternative to
+ various other SNMP toolkits currently available (for both perl and other
+ programming languages).
+
+ The second is as a means for extending the functionality of the Net-SNMP
+ agent, by implementing new MIB modules. This is an alternative to the
+ other script-based extension mechanisms, but is more tightly bound to the
+ Net-SNMP agent (and hence more efficient), while still avoiding the need
+ to write C code.
+
+ It is also possible to use the perl SNMP module in the snmpd.conf file,
+ or to process incoming notifications, but the above are probably the
+ two primary uses.
+
+
+
+Where can I get the Perl SNMP package?
+-------------------------------------
+
+ Joe Marzot's excellent Perl 'SNMP' module, is included in the Net-SNMP
+ source releases. It can be found located in the perl/SNMP subdirectory
+ of the source tree. This is accompanied by a number of Perl modules
+ grouped together under the NetSNMP namespace.
+
+ The basic SNMP module (though not the NetSNMP additions), can also
+ be found at any Comprehensive Perl Archive Network (CPAN) mirror site,
+ under modules/by-module/SNMP. To find the CPAN site nearest you,
+ please see http://www.cpan.org/SITES.html.
+
+ These Perl modules need to be used in conjunction with a compatible
+ version of the Net-SNMP library. Consult the README file in the SNMP
+ Perl distribution to find out which version of the library it needs.
+
+
+
+How do I install the Perl SNMP modules?
+--------------------------------------
+
+ Assuming you have a reasonably new (and properly configured) Perl system,
+ this should be simply:
+
+ cd perl
+ perl Makefile.PL
+ (press RETURN when prompted for host and community)
+ make
+ make test
+ make install (probably as root)
+
+
+ It might be possible to install the basic module using
+
+ perl -MCPAN -e shell ; "install SNMP"
+
+ but this has not been reliably tested, and very much relies on
+ having the correct version of the Net-SNMP library.
+
+ There may also be appropriate pre-compiled versions of the Perl modules
+ available from the Net-SNMP project website, or your O/S vendor.
+
+
+
+But compiling this fails! Why?
+-----------------------------
+
+ The Perl module tends to delve quite deeply into the internals of the
+ main Net-SNMP library, and so is quite sensitive to changes within the
+ library. It's important to use the correct version of the module, that
+ corresponds to the version of the library you have installed. If you're
+ working with a Net-SNMP source distribution, the appropriate versions of
+ the Perl modules are shipped as part of the source code, but you *must*
+ have run "make install" on the main Net-SNMP distribution *first*.
+
+ If you're working with a ready-installed version of the library, make
+ sure you obtain a compatible version of the Perl module.
+
+ Note that the Perl modules will be compiled using the compiler
+ (and compiler settings) used for compiling the original perl binary,
+ *not* those used for compiling the Net-SNMP (or UCD) library.
+ If these are different (e.g. 'gcc' used for one and 'cc' for the other)
+ then this may well cause problems. It's much safer to use a consistent
+ environment for both. This issue is discussed in greater detail in
+ the README.solaris file.
+
+ Also note that the v5 Net-SNMP suite *must* be configured to provide
+ shared libraries in order for the Perl modules to work correctly. This
+ is not necessary with the v4 UCD-SNMP libraries.
+
+
+
+Compiling the Perl module works OK, but 'make test' fails. Why?
+--------------------------------------------------------------
+
+ That's difficult to answer in general.
+ Some of the Perl tests are rather picky, so this may simply be
+ some minor inconsistency between your precise setup, and the
+ expectations of the test environment.
+
+ Check that you are working with the Perl distribution that matches
+ the SNMP libraries (use the 'perl/SNMP' in preference to CPAN), and
+ that you have installed the main libraries successfully (uninstall
+ any old versions if you're having trouble).
+
+ If all this looks OK, and if most of the tests pass, then it's
+ probably safe to run 'make install' anyway. Probably.
+
+
+
+Why can't mib2c (or tkmib) locate SNMP.pm?
+-----------------------------------------
+
+ That's probably because the SNMP Perl module hasn't been installed.
+ It's not part of the standard Perl distribution, nor is it included
+ in the default Fedora Linux installation (for example).
+ You'll need to install it yourself.
+
+ See the second entry in this section.
+
+
+
+Why can't mib2c (or tkmib) load SNMP.so?
+---------------------------------------
+
+ This is probably the same problem. Either the SNMP module
+ hasn't been installed, or it's the wrong version. See the
+ previous questions.
+
+
+
+Why can't tkmib locate Tk.pm?
+----------------------------
+
+ Tk.pm is another Perl package that needs to be installed before tkmib
+ will run. It's also available on Perl CPAN. We suggest using version
+ "Tk800.011" or later. It can be installed by issuing the command:
+
+ perl -MCPAN -e shell ; "install Tk"
+
+
+
+Why does your RPM complain about missing Perl modules?
+-----------------------------------------------------
+
+ This has been particularly noted on RedHat 9, complaining about the
+ module "perl(Term::ReadKey)" - even if this is actually present (e.g.
+ having been installed directly from CPAN). In fact, this is not
+ specific to Perl modules - the same issue can potentially arise with
+ other RPM dependencies.
+
+ The problem is that the RPM mechanism keeps a local database of what
+ software packages have been installed, and checks this for any other
+ features that this RPM requires. If software is installed "manually"
+ rather than via rpm packages, then it will not appear in this database.
+ Attempting to install another RPM that rely on this functionality will
+ then complain about the "missing" package, because the RPM system doesn't
+ know that's it's actually available.
+
+ The ideal solution is to *always* install software using a consistent
+ mechanism (which may involve building RPMs locally, or looking for a
+ suitable pre-built version).
+
+ Failing this, it's possible to tell the "rpm" command to ignore such
+ dependencies, and install the package anyway. Try:
+
+ rpm -i --nodeps {package}
+
+ In this situation, it's then up to you to make sure that any other
+ necessary packages *are* actually present on the system.
+
+
+
+I've got a problem with the Net-SNMP module. Can you help?
+----------------------------------------------------------
+
+ Sorry, despite the similar-sounding name, the Net-SNMP (or Net::SNMP)
+ module is nothing to do with this package, or the NetSNMP modules.
+ Net::SNMP is a "pure-perl" implementation of SNMP support, developed
+ by David Town. The developers of the (C-based) Net-SNMP suite do
+ not have any significant experience in using this particular module,
+ and you'll probably be better off asking for help via CPAN or some
+ other perl-related forum.
+
+
+
+MIBS
+====
+
+Where can I find a MIB compiler?
+-------------------------------
+
+ That depends what you mean by a "MIB compiler". There are at least two
+ types of tool that are commonly referred to by this name.
+
+ The first is a tool to check MIB files for validity. With the Net-SNMP
+ software, this functionality is mostly integrated within the MIB parser,
+ and hence included in all the applications. The tool 'snmptranslate' is
+ probably the most appropriate for this purpose.
+
+ Note that the parser is fairly forgiving (see 'What ASN.1 parser is used'
+ below), so this should not be regarded as a stamp of approval. For a
+ more rigourous validation, use a tool such as 'smilint', or the on-line
+ interface at http://wwwsnmp.cs.utwente.nl/ietf/mibs/validate/
+
+ The second type of "MIB compiler" is one to turn a MIB specification
+ into C code, specifically one designed to aid agent implementation. The
+ command 'mib2c' is an example of such a tool for the Net-SNMP agent.
+ See the CODING section for more information.
+
+
+
+Why aren't my MIB files being read in?
+-------------------------------------
+
+ There are two basic likely causes - either the library isn't attemping to
+ load these particular MIB files, or it's trying to load them but can't
+ locate them.
+
+ By default, the Net-SNMP library loads a specific subset of MIB files.
+ This list is set when the suite is first configured and compiled, and
+ basically corresponds to the list of modules that the agent supports.
+ (This is a simplification, but is a reasonable first approximation).
+
+ In order to load additional MIB files, it is necessary to add them to this
+ default list. See the FAQ entry "How do I add a MIB to the tools?" for
+ more information about how to do this.
+
+
+ Alternatively, the tools may be looking in the wrong place. The directory
+ where the library looks for MIB files is also set when the software is
+ first configured and compiled. If you put new MIB files in the wrong
+ location, then the library won't be able to find them (and will complain).
+
+ This problem may arise when switching from a vendor-supplied distribution
+ to one compiled from source (or vice versa).
+ See the next entry for more information.
+
+
+
+Where should I put my MIB files?
+-------------------------------
+
+ If you've compiled the package from source (or are using binaries
+ from the project website), then you should probably put new MIB
+ files in the directory /usr/local/share/snmp/mibs
+
+ If you are using vendor-supplied binaries, then the MIB files
+ may well be located somewhere else (e.g. /usr/share/snmp/mibs,
+ /opt/snmp/mibs, or /etc/sma/snmp/mibs). Have a look for where
+ existing MIB files are installed, and try adding your MIBs to
+ the same directory.
+
+ If you compiled the source yourself, but specified a different
+ --prefix value when running configure, then the location of the
+ MIB directory will be {prefix}/share/snmp/mibs.
+
+ If you're still not sure where to put your MIB files, try running
+ the command
+
+ snmpget -Dparse-mibs 2>&1 | grep directory
+
+ This will display the location(s) where the library is looking
+ for MIB files.
+
+
+
+What does "Cannot find module (XXX-MIB)" mean?
+---------------------------------------------
+
+ If this error is only generated for one or two modules, then it's
+ likely that the named modules are not being found - perhaps they're
+ not installed in the correct location, are not readable, or the
+ name being used is incorrect. See the previous entries and the entry
+ "How do I add a MIB to the tools?" for more details.
+
+ Note that the name reported is the name of the MIB *module*, which is
+ not necessarily the same as the name of the file.
+
+
+ If there are a large number of such errors, then it's more likely
+ that either the MIB files haven't been installed at all. If you are
+ compiling from source, then it is necessary to run "make install" in
+ order to set up the full run-time environment.
+
+ Otherwise, see the previous entry to check whether the MIBs are installed
+ in the correct location for the tools to find them.
+
+
+
+I'm getting answers, but they're all numbers. Why?
+-------------------------------------------------
+
+ This is related to the previous questions. Remember, the results that
+ you receive from an agent do not depend on which MIBs are loaded by the
+ client tools - purely on how the agent was compiled and configured.
+
+ Because the tools don't necessarily read in every MIB file they can find
+ (and the relevant MIB file may not be available anyway), it is quite
+ possible for results from an agent to refer to modules that have not
+ been loaded (particularly with GETNEXT requests, or when walking a tree).
+
+ The results will be reported correctly, but won't be translated to use
+ named identifiers (or display the values in the most appropriate manner).
+ To fix this, add the missing MIB files to the list of MIBs to be loaded.
+ See the previous entries and the entry "How do I add a MIB to the tools?"
+ for more information.
+
+
+
+What does "unlinked OID" mean?
+-----------------------------
+
+ This means that the library has been able to find the MIB module,
+ and parse the individual objects defined in it, but is having problems
+ linking them together into a consistent tree. In particular, it
+ can't find an object corresponding to the name within the braces
+ (i.e. the 'xxx' in '{xxx 99}').
+
+ This is probably due either to a typo in this name (remember that
+ names are case sensitive, so a reference to 'xxx' will *not* match
+ a definition of 'Xxx'), or else the name is defined in another MIB
+ file, and this dependency is missing from the IMPORT clause of this
+ MIB file.
+
+
+
+The parser doesn't handle comments properly. Why not?
+----------------------------------------------------
+
+ The way that comments are handled in a MIB file is subtly different
+ to the equivalent syntax in most typical programming languages, and
+ this difference can catch out the unwary. In particular, there are
+ two common situations which can lead to problems.
+
+ The first scenario is where the MIB designer has attempted to "comment
+ out" an unwanted line that already contains a comment:
+
+ -- broken ::= { myMIB 1 } -- This isn't working yet
+
+ The assumption here is that a comment continues to the end of the line.
+ Unfortunately, this is not correct. A comment will continue either to
+ the end of the line, *or* the next occurance of a pair of dashes.
+
+ Thus in this case, the definition of "broken" is commented out (as
+ intended) but the following text ("This isn't working yet") is treated
+ as an active part of the MIB, and will generate an error.
+
+
+ The second scenario is where a line of dashes has been used to mark
+ out separate parts of a MIB file. Depending on the exact number of
+ dashes used, this may still result in a syntactically valid MIB file,
+ but has a 1-in-4 possibility of triggering an error. This means that
+ this particular situation can be particularly difficult to spot!
+
+
+ Most of the Net-SNMP applications have a command-line option (-Pc) which
+ will work around this problem by treating the whole line as a comment.
+ But this is not strictly legal, and the offending MIB file should really
+ be corrected.
+
+
+
+How can I get more information about problems with MIB files?
+------------------------------------------------------------
+
+ The command 'snmptranslate' is used to translate between numeric
+ and symbolic forms of OIDs. It uses the same MIB parsing routines
+ as the commands that actually communicate with a network management
+ agent, but can be used standalone. As such, it is a useful tool
+ for identifying problems with reading in MIB files.
+
+ In particular, the following options may be useful in
+ identifying problems:
+ -Pw warns about conflicting symbols
+ -PW prints more verbose warnings about other problems as well
+ (in both cases, ignore the 'xmalloc' reports)
+ -T provides sub-options for various views of these entries
+
+ There are other '-P' options to control various aspects of MIB parsing.
+ See the 'snmptranslate(1)' and 'snmpcmd(1)' man pages for more details,
+ or the tutorial at
+ http://www.net-snmp.org/tutorial-5/commands/snmptranslate.html
+
+ For a more rigourous validation, use a tool such as 'smilint', or the
+ on-line interface at http://wwwsnmp.cs.utwente.nl/ietf/mibs/validate/
+
+
+
+What's this about "too many imported symbols"?
+---------------------------------------------
+
+ Any MIB file starts with an (optional) list of identifiers that
+ it "imports" from other files. The parser handles this using
+ a fixed size buffer to hold the import information.
+ There are two circumstances in which this can result in the
+ error message shown above.
+
+ Firstly, if the MIB file refers to an unusually large number
+ of external identifiers. Handling this case requires a (trivial)
+ patch to the parsing code. Contact the coders list for advice.
+ (This is extremely rare - the only example that
+ we've come across is the Cabletron Trap MIB).
+
+ Much more common is a syntax error in the IMPORTS clause of the
+ MIB file in question. In particular, check that this section ends
+ in a semicolon, before going on to the main MIB object definitions.
+
+
+
+Do I actually need the MIB files?
+--------------------------------
+
+ Probably not.
+ The MIB files play two main roles - they are used to translate
+ between numeric OIDs and the corresponding textual names, and
+ they define the structure and syntax of the relevant MIB objects.
+
+ This second role is perhaps best thought of in terms of a design
+ document. It's vital while developing an application (typically
+ the MIB module or handler within the agent), since it defines
+ what the application (MIB) must actually do. But once the code
+ has been written, the design document becomes redundent.
+ The agent then has the same information hardcoded into it
+ (literally!), and no longer needs the MIB file.
+
+ The translation task is not strictly necessary - SNMP will
+ operate fine without any MIB files at all, as long as you're
+ happy to work with numeric OIDs throughout, and know which MIB
+ objects you're interested in. But it's much easier to work with
+ the (hopefully) meaningful names, enumeration tags and the like,
+ and to view the description of a particular object.
+ This requires having the relevant MIB files installed and loaded.
+
+
+ Since the agent needs MIBs the least and some systems are memory
+ restricted, it is possible to completely disable loading these MIBs
+ as well as remove the code that does the parsing by using the
+ --disable-mib-loading flag to configure.
+
+ However, note that certain snmpd.conf tokens actually make use
+ of mib information so they won't be as easily usable.
+
+
+
+AGENT
+=====
+
+What MIBs are supported?
+-----------------------
+
+ The following MIBs are supported (at least in part and on some systems):
+
+ - MIB-2 General network statistics
+ (RFC 1213 and subsequent revisions)
+ - Host Resources (RFC 1514 and 2790)
+ - SNMPv3 framework (RFCs 2571-5, 3411-3418)
+ (including USM, VACM, Target
+ and Notification MIBs)
+ - DisMan Event and Schedule MIBs
+ - MTA-MIB (sendmail)
+ - private UCD/Net-SNMP agent extensions
+ (monitor specified processes and disks,
+ memory, CPU, load average, + extending
+ the agent using shell commands)
+
+ See README.agent-mibs for details.
+
+ Not all MIB modules are included by default on all systems. Some of
+ these may need to be explicitly requested when the software is first
+ configured and built, while others may not be available on all
+ architectures.
+
+ There are a few other MIB implementations distributed as part of the
+ source tarball, but these are basically unsupported and most of the
+ core developers have little or no experience with using them.
+
+
+
+What protocols are supported?
+----------------------------
+
+ The agent supports all three current versions of SNMP (v1, v2c and v3),
+ over both UDP and TCP transports, as well as acting as a SMUX (RFC 1227)
+ master agent, AgentX (RFC 2741) in both master and subagent roles, and
+ SNMP proxying.
+
+
+
+How do I configure the agent?
+----------------------------
+
+ That's a somewhat ambiguous question, as there are two very different
+ stages where it is possible to "configure" the agent.
+
+ Firstly, you can determine what capabilities and defaults are included
+ within the library and agent, at the time that the software is first
+ built. This uses suitable flags to the 'configure' script, before
+ compiling the source.
+ As far as the agent is concerned, the most significant option is
+ '--with-mib-modules' (or '--with-out-mib-modules') to control which
+ MIBs will be supported by the agent. See the next few entries for
+ details.
+
+ You can also control various aspects of the agent behaviour (and the
+ information it returns) at run time, via the 'snmpd.conf' configuration
+ file. Various aspects of this are touched on throughout this FAQ. Or
+ see the snmpd.conf(5) manual page for full details.
+ The "snmpconf" script can help in creating this config file.
+ Start off with 'snmpconf -g basic_setup' to get you going.
+
+
+
+How do I remove a MIB from the agent?
+------------------------------------
+
+ Deleting the text file for a MIB does not affect the agent (other than
+ to prevent it from recognising MIB object names in the config files).
+ It's necessary to tell the agent not to activate the relevant code that
+ actually implements these objects. There are three ways to do this:
+
+ 1) re-run 'configure' to exclude the given MIB module(s) from the
+ build configuration, then recompile and reinstall:
+
+ ./configure --with-out-mib-modules=path/to/unwanted ....
+ make
+ make install
+
+ This specifies the path to the module code file, relative to
+ the 'agent/mibgroup' directory. Clearly, this approach is
+ only possible if you are working with a source distribution.
+
+ 2) disable the MIB at runtime
+
+ snmpd -I -unwanted
+
+ Note that this relies on knowing which modules are used to
+ implement the relevant MIB objects. If you're not sure,
+ you could try walking the 'nsModuleName' MIB object, which
+ indicates the module responsible for each particular range
+ of OIDs.
+ You can also check which MIB modules are loaded by getting
+ the agent to report them as they are initialised:
+
+ snmpd -Dmib_init -H
+
+ From this information, it should then be fairly obvious which
+ modules to disable.
+
+ 3) use access control to exclude the mib from the view used to
+ query the agent:
+
+ view almostEverything included .1
+ view almostEverything excluded unwantedMib
+
+ rocommunity public default -V almostEverything
+
+ This approach can also be used with the full com2sec/group/access
+ configuration directives (e.g. with versions earlier than 5.3,
+ which don't support the above mechanism).
+
+
+
+I've installed a new MIB file. Why can't I query it?
+----------------------------------------------------
+
+ Installing a new MIB file will not magically enable the agent to know
+ what values to report for the objects defined in that MIB. It's
+ necessary to have some code which can provide the relevant information.
+ The next few entries, and the CODING section address this issue in more
+ detail.
+
+
+
+How do I add a MIB to the agent?
+-------------------------------
+
+ Adding a MIB essentially involves writing some code to implement the
+ objects defined in the new MIB. There are three basic approaches that
+ can be used to do this:
+
+ - The agent can invoke an external command or shell script to
+ return the necessary information. There are several possible
+ variations on this approach - see the next entry for details.
+
+ - The agent can pass the request off to another (sub-)agent,
+ which already implements the required MIB. Again, there are
+ several ways of doing this - including AgentX, SMUX and
+ proxied SNMP. See the next entry but one for details.
+
+ - You can write code to implement the new MIB objects, and
+ include this within the agent. This is most commonly C
+ (or C++) code, although the agent can also support MIB modules
+ implemented in perl.
+ See the next section (CODING) for more details.
+
+ Note that there is no visible difference between external commands,
+ subagents, and modules implemented within the main agent itself.
+ Tools querying the agent will see a single MIB structure.
+
+
+
+What's the difference between 'exec', 'sh', 'extend' and 'pass'?
+---------------------------------------------------------------
+
+ 'exec' will run the specified command and return the exit status and
+ output. Any arguments are passed directly to the command, with no
+ special interpretation.
+
+ 'sh' is similar, but invokes a shell to run the command line given.
+ This means that quoted arguments will be recognised as such, and also
+ allows redirection, and other similar shell interpretation. The results
+ are returned in exactly the same way.
+
+ 'extend' is also similar, but provides a richer and more flexible MIB
+ framework - both for configuring the exact command to be run, and for
+ displaying the results.
+
+ None of these mechanisms require the command to have any knowledge of
+ SNMP, or the fact that they are being used in this manner. But the
+ output is returned in a fixed format, and it is up to the receiving
+ application to interpret this appropriately.
+
+ Note that the "relocatable" form of the 'exec' directive ('exec OID ....')
+ produces MIB output that is not strictly valid. For this reason, support
+ for this has been deprecated in favour of 'extend OID ...', which produces
+ well-formed MIB results (as well as providing fuller functionality).
+ The most recent releases of the agent don't include support for "relocatable
+ exec" by default. This needs to be explicitly included when the agent is
+ first compiled, by including the module 'ucd-snmp/extensible' instead of
+ 'agent/extend'.
+
+
+ 'pass' is a more general mechanism for implementing arbitrary MIB
+ objects. The specified command will be invoked for any request within
+ the named MIB subtree, and passed details of the requested OID. It
+ should return the information relevant to the requested OID.
+
+ 'pass-persist' is similar, but the command will continue running
+ even after the initial request has been answered. These two mechanisms
+ can be used to implement a particular MIB, following the correct MIB
+ structure (as opposed to the fixed format of exec/sh/extend).
+
+ All of these mechanisms are described in the 'snmpd.conf(5)' man page,
+ in the section entitled "Extending Agent Functionality".
+
+
+
+What's the difference between AgentX, SMUX and proxied SNMP?
+-----------------------------------------------------------
+
+ All three are protocols that can be used to make two or more agents
+ appear as one to the querying application. In each case, one agent
+ takes the role of "master", and delegates requests to one of the others
+ as and where this is appropriate. The differences between them mainly
+ relate to how data is represented, and the mechanisms for communication
+ between master and subagents.
+
+ SMUX and proxy SNMP both essentially use the standard SNMP packet format.
+ The main difference is that a proxy SNMP subagent need not be aware that
+ it is acting in such a role. It typically listens on a non-standard port,
+ and simply receives requests as usual, forwarded from the master agent
+ (rather than directly). The main issue to be aware of is that such requests
+ will appear to come from the local host, and this may affect how the access
+ control mechanisms need to be set up.
+
+ SMUX uses a similar packet format, but the subagent "registers" with
+ the master agent, providing a suitable password. The Net-SNMP (and UCD)
+ agent includes the possibility of acting as a SMUX master agent, but the
+ suite does not include a subagent API. Note that support for SMUX is not
+ included by default, and needs to be explicitly enabled by running:
+
+ --with-mib-modules=smux
+
+ before re-compiling the agent.
+ See the file 'agent/mibgroup/README.smux' for details.
+
+ AgentX uses a more compact (and simpler) packet format, with a richer
+ range of administrative commands, and provides a more flexible and reliable
+ extension mechanism. The Net-SNMP agent can be used in both master and
+ subagent roles, and the agent library can also be used to embed an AgentX
+ subagent within another application.
+ See the file 'README.agentx' for details.
+
+ AgentX support is included by default, but needs to be explicitly
+ activated in the master agent. Do this by adding the line
+
+ master agentx
+
+ to the snmpd.conf file before starting the agent.
+
+
+
+What is the purpose of 'dlmod'?
+------------------------------
+
+ Most of the MIB information supplied by the Net-SNMP agent is provided
+ by C-coded implementation modules, and the choice of which modules to
+ include is usually made when the agent is first built. Adding new
+ MIB modules would therefore require re-compiling the agent. This is
+ not always convenient - particularly when working with a production
+ system, and/or pre-installed binaries.
+
+ Dynamically loaded modules are a means of including a MIB implementation
+ module within the main SNMP agent (or an AgentX subagent) without needing
+ to re-compile and re-link the agent binary. Instead, details of the
+ module(s) to load are specified in the configuration file, and the agent
+ locates the files listed, and merges them in at run time.
+
+ See http://www.net-snmp.org/tutorial-5/toolkit/dlmod/ for more information.
+
+
+
+Which extension mechanism should I use?
+--------------------------------------
+
+ That's not easy to answer in general.
+
+ If there's an existing agent that already implements the desired new
+ MIB, then it makes sense to re-use that, via whatever extension protocol
+ that agent might support. Note that the SMUX protocol has essentially
+ been superceded by AgentX, which provides a fuller and more reliable
+ mechanism than either SMUX or proxied SNMP. So ideally, this would
+ be the preferred extension approach.
+ But if the target subagent only supports SMUX or basic SNMP, then that
+ would dictate the extension protocol to use.
+
+ Implementing the module in C within the main agent (directly or via
+ dlmod) is probably the most efficient and reliable, closely followed
+ by embedded perl (or python) extensions. These have the advantage of
+ minimal overheads between the code implementing the MIB module, and
+ the agent framework, and no inter-process communication issues. But
+ this does assume that there's a suitable mechanism for retrieving the
+ necessary information.
+
+ If the new MIB is monitoring or managing some other subsystem, external
+ to the agent, then it may be necessary to embed a subagent within the
+ subsystem itself - particularly if there's no suitable public API to
+ retrieve the necessary information. In this case, AgentX is probably
+ the most appropriate way forward.
+ Alternatively, you could implement the missing public management API
+ for that subsystem, and develop a module within the main agent instead.
+
+
+
+Can I use AgentX when running under Windows?
+-------------------------------------------
+
+ Yes, but there are a couple of things to be aware of.
+
+ Firstly, by default the AgentX master listens on the Unix domain
+ socket '/var/agentx/master', which doesn't work under Windows.
+ You'll need to tell it to listen on a TCP port, either by using
+ the command-line option "-x localhost:705", or by adding the
+ directive "agentxSocket localhost:705" to the snmpd.conf file.
+
+ Secondly, be aware that the security of AgentX connectivity is not
+ particularly strong. The examples given here would allow any process
+ running on the local machine to register as an AgentX subagent. The
+ more obvious settings "-x 705" or "agentxSocket 705" would allow
+ a system *anywhere* on the network (or even from remote networks) to
+ register as an AgentX subagent. This could potentially be used to
+ hijack the agent, or provide false information.
+
+
+
+How can I run AgentX with a different socket address?
+----------------------------------------------------
+
+ There are two sides to an AgentX connection, and they need to
+ agree about which socket address to use. So if you want to use
+ a different socket, you need to configure both parties accordingly.
+
+ The socket that the Net-SNMP master agent uses to listen for AgentX
+ registrations (and send appropriate requests) can be specified using
+ the option '-x'.
+ The command
+ "snmpd -x tcp:localhost:705 ...."
+ would start the agent listening on the TCP port 705 for connections
+ from the local system.
+ The same effect can also be obtained by adding the line
+ agentxsocket localhost:705
+ to the file 'snmpd.conf'.
+
+ The same option can be used with the Net-SNMP agent when running in
+ This also holds when the Net-SNMP agent is running in
+ "subagent" mode, to specify the socket to register with (and receive
+ requests from).
+ So a subagent might connect to the master agent above (both running
+ on the same host), using:
+ "snmpd -X -x tcp:localhost:705 ...."
+
+ A subagent running embedded within some other application will
+ typically not understand the same command-line options, so would
+ need to set the same configuration programmatically:
+
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET, "tcp:localhost:705");
+
+ With the example subagent code from the Net-SNMP tutorial, this line
+ would be added immediately before the 'init_agent' call.
+
+ The same approach can also be used to listen on a different named
+ socket, using:
+ agentxsocket /tmp/agentx
+ agentxperms 770 770 myuser mygroup
+ or
+ snmpd -x /tmp/agentx ....
+ or
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET, "/tmp/agentx");
+ as appropriate.
+
+
+
+How can I turn off SMUX support?
+-------------------------------
+
+ Normally, you would use the command-line option '-I -{module}' to
+ disable the initialisation of a particular MIB module within the
+ agent. Unfortunately, it's not currently possible to turn off SMUX
+ support this way.
+
+ The safest approach is to run
+ configure --with-out-mib-modules=smux
+ and recompile the agent.
+
+ If this is not possible, an alternative workaround might be to have
+ the agent bind the SMUX socket to an invalid IP address, using a
+ snmpd.conf line such as:
+
+ smuxsocket 1.0.0.0
+
+ The agent may complain at startup, but it won't accept any incoming
+ SMUX requests.
+
+ If the agent complains about not recognising the "smuxsocket"
+ token, then you're out of luck. You'll either have to recompile
+ from source, or use local firewall rules to block connections
+ to port 199.
+
+
+
+How can I combine two copies of the 'mib2' tree from separate subagents?
+-----------------------------------------------------------------------
+
+ This is the purpose of the SNMPv3 'context' field. Register the MIB
+ module a second time in a non-default context (see the relevant entry
+ in the CODING section for details), and specify this context when
+ querying the agent. The MIB module can use this context information
+ to determine which set of information to report.
+ Or you could register two completely different handlers for the same
+ OID (using different contexts), and the agent will invoke the appropriate
+ code. This holds for both MIB modules implemented within the main agent,
+ or AgentX subagents - the same approach will work for both.
+
+ Contexts can also be used with proxied SNMP requests - just specify
+ the option '-Cn {context}' as part of the "proxy" entry. See the
+ 'snmpd.conf(5)' man page for details.
+
+ It's currently not possible to support parallel MIB trees when using
+ SNMPv1 or SNMPv2c. In principle, it should be possible to use the
+ community string in a similar way, but this has not (yet) been implemented.
+
+ This mechanism is only available with the v5 Net-SNMP agent. The v4
+ UCD agent does not support contexts at all. Sorry about that.
+
+ Another way to handle this would be to tweak one of the subagents to
+ use a different set of (non-standard) OID assignments - perhaps by
+ relocating the whole of the subtree to another (private) OID. This
+ is not ideal, but should work with all configurations.
+
+
+
+What traps are sent by the agent?
+--------------------------------
+
+ The Net-SNMP agent sends a 'coldStart(0)' trap when it first starts up,
+ and an enterprise-specific trap 'nsNotifyShutdown' when it stops. It
+ generates an enterprise-specific trap 'nsNotifyRestart' (rather than
+ the standard 'coldStart(0)' or 'warmStart(1)' traps) on receiving a HUP
+ signal - typically after being re-configured. It can also be configured
+ to send an 'authenticationFailure(4)' trap when it receives an SNMPv1
+ (or SNMPv2c) request using an unknown community name.
+
+ The agent does not send 'linkUp' or 'linkDown' traps by default. It can
+ be configured to do this using the directive 'linkUpDownNotifications'.
+ See the 'snmpd.conf(5)' man page (under ACTIVE MONITORING) for details.
+
+ Similarly, it does not generate traps by default when one of the
+ monitored characteristics (disk usage, running processes, etc) enters or
+ leaves an error state. This can be configured using the 'defaultMonitors'
+ directive (again documented under ACTIVE MONITORING).
+
+
+
+Where are these traps sent to?
+-----------------------------
+
+ With all these alerts, the agent needs to be told where to send them,
+ specifying the type of notification (v1 or v2 trap, or v2 inform) and
+ the community name to use. This uses the snmpd.conf directives 'trapsink',
+ 'trap2sink' and 'informsink' for the destination type, and 'trapcommunity'
+ for the community name. SNMPv3 destinations can be configured using the
+ directive 'trapsess'. See the 'snmpd.conf(5)' man page for details.
+
+ Note that the type of trap generated is totally determined by these
+ directives - irrespective of which API call was used to trigger sending
+ the trap. See the trap-related entries in the CODING section for details.
+
+ Note also that you typically only want *one* of the settings:
+
+ trapsink localhost
+ trap2sink localhost
+ informsink localhost
+
+ Including two (or all three) of these lines in the snmpd.conf file will
+ will result in multiple copies of every notifications being sent for
+ each call to 'send_easy_trap()' (or 'send_v2trap()').
+ This is probably not what was intended!
+
+
+
+How can I send a particular trap to selected destinations?
+----------------------------------------------------------
+
+ This is not currently possible. All notifications will be sent to
+ all configured destinations. The agent does not (currently) support
+ notification filtering.
+
+ There is a preliminary implementation of the snmpNotifyFilterTable
+ which is designed to allow this sort of selective trap direction.
+ However this is not currently active. (The tables are present and
+ can be manipulated and updated, but the information is not consulted)
+ Documentation on how to use this mechanism will appear once the
+ functionality is working properly.
+
+
+
+When I run the agent it runs and then quits without staying around. Why?
+-----------------------------------------------------------------------
+
+ Firstly, are you certain that this is what is happening?
+
+ The normal operation of the agent is to 'fork' itself into the background,
+ detaching itself from the controlling terminal so that it will continue
+ running even when you log out, and freeing the command line for subsequent
+ use. This looks at first sight as if the agent has died, but using 'ps'
+ to show all processes should reveal that the agent is still running.
+
+ To prevent this behaviour (such as when attempting to debug the agent),
+ you can start it with the '-f' flag. This suppresses the fork, and the
+ agent will run as a 'normal' command. It's also often useful to use the
+ '-Le' (or '-L') flag, to log messages to stderr.
+
+ On the other hand, if 'ps' shows that the agent is not running, then
+ this is an error, and probably show that something went wrong in
+ starting the agent up. Check the agent log file for any error messages,
+ or run it with '-f -Le' and see what it reports.
+
+ One possible cause might be an existing agent (or some other process)
+ that's already listening on the SNMP port. Trying to start a second
+ agent will fail with an error about "opening the specified endpoint".
+
+ If you're starting the agent as a non-root user, then this may also
+ fail with the very same error. By default, the agent (and trap handler)
+ will attempt to listen on the standard SNMP port 161 (or 162 for the
+ trap handler). These are defined as "privileged ports", and processes
+ will need to be running as root in order to open them.
+
+ One way to tackle this is to start the agent as root, but use the -u
+ option to switch to run as another user once the port has been opened.
+ Alternatively, you can specify a different port to use instead.
+ Anything greater than 1024 is available to non-root users. In this case,
+ you'll also need to specify the same port when issuing client commands.
+
+
+
+After a while the agent stops responding, and starts eating CPU time. Why?
+--------------------------------------------------------------------------
+
+ This is basically the same problem described in the APPLICATIONS
+ section, in the entry
+ The agent worked for a while, then stopped responding. Why?
+
+ See that entry for details.
+
+
+
+How can I stop other people getting at my agent?
+-----------------------------------------------
+
+ Firstly, are you concerned with read access or write access?
+
+ As far as changing things on the agent is concerned, there is relatively
+ little that can actually be altered (see the entry "Why can't I set
+ any variables in the MIB?" above).
+
+ If you are using the example config file, this is set up to allow
+ read access from your local network, and write access only from the
+ system itself (accessed as 'localhost'), both using the community name
+ specified. You will need to set appropriate values for both NETWORK
+ and COMMUNITY in this file before using it.
+ This mechanism can also be used to control access much more precisely.
+ (see the next few questions for details)
+
+ Other options include:
+ - Blocking access to port 161 from outside your organisation
+ (using filters on network routers)
+ - Using kernel-level network filtering on the system itself
+ (such as IPTables)
+ - Configuring TCP wrapper support ("--with-libwrap")
+ This uses the TCP 'libwrap' library (available separately)
+ to allow/deny access via /etc/hosts.{allow,deny}
+
+ For strict security you should use only SNMPv3, which is the secure
+ form of the protocol. However, note that the agent access control
+ mechanisms does not restrict SNMPv3 traffic by location - an SNMPv3
+ request will be accepted or rejected based purely on the user
+ authentication, irrespective of where it originated. Source-based
+ restrictions on SNMPv3 requests would need to use one of the "external"
+ mechanisms listed above.
+
+
+
+How can I listen on just one particular interface?
+-------------------------------------------------
+
+ Normally, the agent will bind to the specified port on all interfaces
+ on the system, and accept requests received from any of them. However,
+ if a particular port (or ports) is specified when the agent is first
+ started, then it will only listen for requests on these particular
+ ports.
+ For example:
+ snmpd 127.0.0.1:161
+
+ would listen (on the standard port) on the loopback interface only, and:
+
+ snmpd 10.0.0.1:6161
+
+ would listen on port 6161, on the (internal network) interface with
+ address 10.0.0.1. To listen on both of these interfaces (and no others)
+ provide a list of all the desired addresses:
+
+ snmpd 127.0.0.1:161 127.0.0.1:6161
+
+ The AgentX port option ('-x') works in much the same way.
+
+
+
+The agent is complaining about 'snmpd.conf'. Where is this?
+-----------------------------------------------------------
+
+ It doesn't exist in the distribution as shipped. You need to
+ create it to reflect your local requirement.
+ To get started, you can either just create this file manually,
+ or run snmpconf to help you create one. At the very least, you
+ will need some form of access control configuration, if the agent
+ is to be of any use whatsoever. This can be as simple as:
+
+ rocommunity public
+
+ See the snmpd.conf(5) manual page or relevant entries in this
+ FAQ for further details.
+
+
+
+Why does the agent complain about 'no access control information'?
+-----------------------------------------------------------------
+
+ Although an SNMP agent may support a wide range of management
+ information, it is not necessarily appropriate to report the whole
+ of this to every SNMP management station who asks for it. Some
+ information may be sensitive, and should restricted to authorized
+ administrators only. SNMP therefore includes mechanisms for
+ controlling who has access to what information - both in terms of
+ what can be seen, and (even more importantly) what can be changed.
+
+ By default, the Net-SNMP agent starts up with a completely empty
+ access control configuration. This means that *no* SNMP request
+ would be successful. It is necessary to explicitly configure
+ suitable access control settings, based on who should be granted
+ access in that particular environment.
+
+ If there are no access control entries configured (perhaps because
+ no snmpd.conf configuration file has been loaded, or it contains no
+ access control settings), then the agent will not respond to any
+ SNMP requests whatsoever. This is almost certainly not what was
+ intended, so the agent reports this situation.
+
+ See the next entry for how to configure access control settings.
+
+
+
+How do I configure access control?
+---------------------------------
+
+ The simplest way is to use the configure directives:
+
+ rocommunity public (for SNMPv1/2c)
+ rwcommunity private
+ or
+ rouser user1 (for SNMPv3)
+ rwuser user2
+
+ These specify the community names or security names to accept for
+ read-only and read-write access to the whole of the supported MIB tree.
+ (Obviously you should change these names to match your requirements -
+ which is a particularly good idea in the case of 'rwcommunity'!)
+
+ Note that you should *not* specify the same community name for both
+ rocommunity and rwcommunity directives. The rwcommunity setting
+ automatically provides read access, and having both lines (with the
+ same community name) may result in unexpected behaviour.
+ Only use both settings when specifying *different* community names.
+ The same holds true for rouser and rwuser.
+
+ The two community directives can be restricted to only allow requests
+ from particular sources, and all four can be restricted to a particular
+ subtrees or (from v5.3) a named view. See 'snmpd.conf(5)' for details.
+
+
+
+How do I configure SNMPv3 users?
+-------------------------------
+
+ There are three ways to configure SNMPv3 users:
+
+ 1) Stop the agent, and add the line
+
+ createUser {myUser} MD5 {myPassword} DES
+
+ to the file /var/net-snmp/snmpd.conf (where {myUser} and
+ {myPassword} are the appropriate values for username and password,
+ _without_ the braces!). Then re-start the snmpd agent.
+
+ 2) Stop the agent, run the command
+
+ net-snmp-config --create-snmpv3-user
+
+ and follow the prompts given. This will create an entry
+ in the /var/net-snmp/snmpd.conf file similar to the above.
+ Then re-start the snmpd agent.
+
+ 3) Make sure the agent is running, and will respond to an SNMPv3
+ request (using an existing user with the desired authentication
+ and privacy protocols). Then use the 'snmpusm' command to clone
+ this template user, and change the password.
+
+
+ See the access control entries above and the file 'README.snmpv3'
+ for more details about how to use SNMPv3 users,
+
+ Note that simply having a 'rouser' or 'rwuser' line does *not*
+ automatically create the corresponding SNMPv3 user. You will need
+ the above 'createUser' line (or an equivalent 'usmUser') as well.
+
+
+
+The 'createUser' line disappears when I start the agent. Why?
+-------------------------------------------------------------
+
+ This is deliberate.
+
+ The agent removes the (human-readable) 'createUser' directive, and
+ replaces it with an equivalent 'usmUser' entry. This contains the
+ same information, but in a form that's only meaningful internally.
+ Not only is the passphrase no longer visible in the config file, it
+ has actually been converted to a key that is only valid on this
+ particular system. If someone stole the configuration file, they
+ could not use the information from the usmUser entry to access any
+ of your other agents (even if the usernames and passwords were the same).
+
+
+
+What's the difference between /var/net-snmp and /usr/local/share/snmp?
+---------------------------------------------------------------------
+
+ The /var/net-snmp location is primarily used for information set
+ during the running of the agent, which needs to be persistent between
+ one run of the agent and the next. Apart from "createUser" (see
+ the previous entry), you shouldn't need to touch this file.
+
+ All other user-provided configuration should go in the traditional
+ location (typically /usr/local/share/snmp/snmpd.conf or /etc/snmp).
+
+
+
+My new agent is ignoring the old snmpd.conf file. Why?
+-----------------------------------------------------
+
+ The most likely explanation is that the new version of the agent is
+ looking in a different location than the previous one. This is commonly
+ experienced when replacing a ready-installed version (e.g. from a vendor
+ distribution), with the current release installed from the source.
+
+ Try moving the old config file to the new location, and restart the agent.
+ If you're not sure where this should go, see the next entry.
+
+
+
+Where should the snmpd.conf file go?
+-----------------------------------
+
+ The default location for this file with the basic distribution is
+ /usr/local/share/snmp/snmpd.conf (or PREFIX/share/snmp/snmpd.conf).
+ Ready-installed versions often look for the file as /etc/snmpd.conf,
+ or /etc/snmp/snmpd.conf.
+
+ If you are still not sure, try running the command
+
+ snmpd -f -Le -Dread_config 2>&1 | grep "config path"
+
+ The first line of output will display the list of locations where
+ the agent is looking for configuration information.
+
+
+
+Why am I getting "Connection refused"?
+-------------------------------------
+
+ This is actually nothing to do with the access control mechanism
+ (though that's an understandable mistake). This is the result of
+ the TCP wrapper mechanism using the files 'hosts.allow' and 'hosts.deny'
+ to control access to the service. Some distributions may come with
+ this enabled automatically - otherwise you need to explicitly activate
+ this by running
+ configure --with-libwrap
+ and recompiling the agent.
+
+ If TCP wrappers are enabled, and both hosts.allow and hosts.deny are
+ empty, then all requests will be rejected (with "Connection refused").
+ The simplest way to avoid this problem and allow incoming requests is
+ to add the line
+
+ snmpd: ALL
+
+ to the file /etc/hosts.allow. Be aware that doing this removes one
+ level of protection and allows anyone to try and query your agent.
+ The agent's own access control mechanisms can still be used to restrict
+ what - if anything - they can see.
+
+ If you do wish to use the TCP wrappers to restrict access, it's sensible
+ to have an explicit entry:
+
+ snmpd: ALL
+
+ in the file /etc/hosts.deny, which makes it crystal clear that access
+ to the SNMP agent has been denied. This mechanism can also be used to
+ restrict access to specific management hosts, using a hosts.deny entry
+ such as:
+
+ snmpd: ALL EXCEPT 127.
+
+ which will allow connections from localhost, and nothing else.
+
+ Note that personal firewalls, such as the Linux iptables mechanism,
+ may have a similar effect (though typically this won't be logged).
+ See the earlier entry
+ Requests always seem to timeout, and don't give me anything back. Why?
+
+
+
+Why can't I see values in the UCDavis 'proc' or 'disk' trees?
+------------------------------------------------------------------
+
+ Both these trees are designed to report precisely those things that
+ have been explicitly configured for monitoring. If there are no
+ relevant configuration entries in the snmpd.conf file, then these
+ tables will be empty. See the snmpd.conf manual page and the
+ EXAMPLE.conf file for details on configuring the agent.
+
+ Optionally, run snmpconf -g monitoring to help you set up this
+ section of the snmpd.conf file.
+
+
+
+Why can't I see values in the UCDavis 'memory' or 'vmstat' trees?
+----------------------------------------------------------------
+
+ These trees do not need any explicit configuration, and should
+ be present automatically.
+
+ However the C code necessary to implement these particular MIB
+ modules are not supported on all operating systems. These trees
+ will be omitted on any system for which there is no underlying
+ code. Currently, they are only supported on Linux, HP-UX (memory
+ only), Solaris, BSDi (vmstat on BSDi4 only), Dynix, FreeBSD, NetBSD
+ and OpenBSD.
+ If you want to help port it to other systems, let us know.
+
+ Note that these subtrees only report the current usage when
+ explicitly queried. They do *not* automatically generate traps
+ when the usage strays outside the configured bounds.
+ See the earlier FAQ entry
+ What traps are sent by the agent?
+ or the snmpd.conf section on active monitoring, for more information.
+
+
+
+What do the CPU statistics mean - is this the load average?
+----------------------------------------------------------
+
+ No. Unfortunately, the original definition of the various CPU
+ statistics was a little vague. It referred to a "percentage",
+ without specifying what period this should be calculated over.
+ It was therefore implemented slightly differently on different
+ architectures.
+
+ The 5.4 release has clarified the situation, and standardised on
+ calculating these percentages over a minute. The relevant MIB
+ descriptions have been updated to make the desired behaviour
+ more explicit.
+
+ The Net-SNMP agent also includes "raw counters", which can be used
+ to calculate the percentage usage over any desired period. This is
+ the "right" way to handle things in the SNMP model. The original
+ percentage objects have been deprecated, and may possibly be removed
+ in a future release of the agent.
+
+ Note that this is different from the Unix load average, which is
+ available via the loadTable, and is supported on all architectures.
+
+
+
+How do I get percentage CPU utilization using ssCpuRawIdle?
+-----------------------------------------------------------
+
+ This one of the "raw counters" mentioned in the previous entry.
+ You need to take two readings of this object and look at the
+ difference between them. That difference divided by the total
+ number of 'ticks' between the two readings (where one tick is
+ probably 0.01 seconds) will give you the percentage utilization
+ over that period.
+
+
+
+What about multi-processor systems?
+----------------------------------
+
+ The CPU objects (both percentages and raw counters) were designed to
+ monitor the overall CPU activity of a system, and typically reflect
+ whatever the underlying operating system reports for the (single)
+ CPU statistics information. How these are handled for a multi-CPU
+ system will differ from one O/S to another, and will need
+ to be investigated for each system individually.
+
+ The htProcessorTable was designed to handle monitoring multi-CPU
+ machines, but the Net-SNMP implementation has up to now treated
+ most systems (with the honourable exception of Solaris, and more
+ recently Linux) as implicitly single-CPU.
+
+ With the 5.4 release, there is now a cleaner framework for reporting
+ on multi-CPU equipment, and it is hoped that an increasing number
+ of systems will be able to report suitable processor information.
+ Also with the 5.4 release, for the first time the agent will report
+ the hrProcessorLoad value properly, which should provide some simple
+ per-CPU statistics.
+
+
+
+The speed/type of my network interfaces is wrong - how can I fix it?
+-------------------------------------------------------------------
+
+ Some operating systems will provide a mechanism for determining
+ the speed and type of network interfaces, but many do not. In such
+ cases, the agent attempts to guess the most appropriate values,
+ usually based on the name of the interface.
+
+ The snmpd.conf directive "interface" allows you to override these
+ guessed values, and provide alternative values for the name, type
+ and speed of a particular interface. This is particularly useful
+ for fast-ethernet, or dial-up interfaces, where the speed cannot be
+ guessed from the name.
+
+ See the snmpd.conf(5) man page for details.
+
+
+
+The interface statistics for my subinterfaces are all zero - why?
+----------------------------------------------------------------
+
+ Unfortunately, most kernels that support multiple logical
+ interfaces on a single physical interface, don't keep separate
+ statistics for each of these. They simply report the overall
+ statistics for the physical interface itself.
+
+ There's no easy way around this problem - the agent can only
+ report such information as is available. If the kernel doesn't
+ keep track of these figures, the agent can't report them.
+
+ Sorry!
+
+
+
+Does the agent support the RMON-MIB?
+-----------------------------------
+
+ Not really.
+
+ There is an "Rmon" code module included within the agent source
+ code tree, but this is best thought of as a template for the
+ RMON-MIB statistics groups, rather than a full implementation.
+
+ With most MIBs, the hardest part of implementing the MIB is often
+ getting hold of the data to report. This is definitely true of the
+ RMON-MIB, which relies on gathering (and analysing) a potentially
+ large quantity of network traffic. The Rmon code distributed with
+ the Net-SNMP agent code avoids this problem, by using random data.
+
+ Some of the functionality of the RMON-MIB, such as the alarm and
+ event groups, has since been superseded by the work of the DisMan
+ IETF working group. The Net-SNMP agent does implement these (more
+ general) MIB modules. But the statistics gathering aspects of
+ the RMON-MIB are not readily available.
+
+ Note too that none of the core developers have any significant
+ experience with this code, and the person who originally wrote it
+ is no longer active on the mailing lists. So there's no point in
+ asking on the lists whether these modules work or not. You've got
+ the source - how badly do you need this functionality?
+
+
+
+What does "klread: bad address" mean?
+-------------------------------------
+
+ This means that the agent was unable to extract some of the
+ necessary information from the kernel structures. This is
+ possibly due to:
+ - either looking in the wrong place for kernel information
+ (check the value of KERNEL_LOC)
+ - an error in the implementation of part of the MIB tree
+ for that architecture. Try and identify which
+ OID is generating the error, and contact the
+ list 'net-snmp-coders@lists.sourceforge.net'
+ Remember to tell us what architecture you have!
+
+
+
+What does "nlist err: wombat not found" (or similar) mean?
+----------------------------------------------------------
+
+ This means that the agent wasn't able to locate one of the
+ kernel structures it was looking for. This may or may not
+ be important - some systems provide alternative mechanisms
+ for obtaining the necessary information - Solaris, for example,
+ can produce a whole slew of such messages, but still provide
+ the correct information.
+ This error only occurs if you have used the flag
+ '--enable-debugging' as part of the initial configuration.
+ Reconfigure the agent with '--disable-debugging' and these
+ messages will disappear. (It won't fix the underlying problem,
+ but at least you won't be nagged about it).
+
+
+
+What does "Can't open /dev/kmem" mean?
+-------------------------------------
+
+ This device is normally restricted to just being accessible by root
+ (or possibly by a special group such as 'kmem' or 'sys'). The agent
+ must be able to read this device to obtain the necessary information
+ about the running system.
+ Check that the agent was started by root, and is running with UID 0
+ (or suitable GID if appropriate). The agent will normally continue
+ to run without this level of access permission, but won't be able to
+ report values for many of the variables (particularly those relating
+ to network statistics).
+
+
+
+The system uptime (sysUpTime) returned is wrong!
+-----------------------------------------------
+
+ Oh no it's not.
+ The defined meaning of 'sysUpTime' is
+ "the time ... since the *network management*
+ portion of the system was re-initialized."
+
+ In other words, when the snmp agent was started, not when the
+ system itself last booted. This latter information is available
+ in the Host Resources MIB as "hrSystemUpTime.0"
+ Note that even if the full Host Resources is not supported on
+ your system, it's worth configuring in the system portion using
+
+ '--with-mib-modules=host/hr_system'
+
+ and recompiling. This particular group is reasonably likely to work,
+ even if some of the other more architecture-specific groups don't.
+
+
+
+Can the agent run multi-threaded?
+--------------------------------
+
+ Short answer - no.
+ Longer answer - not easily.
+
+ Net-SNMP within a single thread of an threaded application is fine,
+ as long as *all* snmp code is kept within the same thread. This lets
+ you add SNMP support to an existing threaded application.
+
+ If you are concerned with the time taken for to process requests for
+ a particular agent, object or subtree, and you want the agent to
+ continue to respond to other requests in the meantime, there are
+ two options.
+
+ The first method is using AgentX sub-agents. If you have several
+ tables, each implemented by a separate subagent, then a single
+ request for entries from each of the tables will be processed
+ in parallel (and the agent will continue to respond to other
+ requests while it waits for the subagents to return the necessary
+ information). But a request for several objects from the same
+ table will be passed off to the relevant subagent, where it will
+ (normally) be processed serially.
+
+ The second method is to use delegated requests + IPC to another
+ process. If takes a long time to retrieve a value for a given object,
+ then the object handler could do whatever necessary to start or
+ communicate with another (non-SNMP) process/thread to actually
+ retrieve the value, and mark the request as delegated.
+ The main agent (or subagent) can then receive and process other
+ requests while waiting for the delegated request to finish.
+ Dealing with resource contention is all up to you.
+
+ All of this only applies to the GET family of requests. A SET
+ request will block until all pending GET requests have finished,
+ and then will not accept new requests until the SET is complete.
+
+ Adding full multi-thread support directly to the agent would be
+ nice. We just need someone with time/money to do/sponsor the work.
+
+
+
+Can I use AgentX (or an embedded SNMP agent) in a threaded application?
+-----------------------------------------------------------------------
+
+ With care.
+
+ As mentioned in the earlier "thread-safe" FAQ entry, the Net-SNMP
+ agent (including the AgentX subagent) has not been designed for
+ threaded operation. In particular, it makes use of various global
+ variables without attempting to protect them against simultaneous
+ use. This means that it is *NOT* safe to have SNMP or AgentX
+ related processing in two separate threads. This also applies to
+ handling GET (and SET) processing in one thread, and generating traps
+ in another. This is still vulnerable to the usual threading problems.
+
+ However, as long as *all* of the SNMP-related activity is limited
+ to the one thread, then there should be no reason why this cannot
+ safely communicate with other threads within the same application,
+ using private (thread-safe) mechanisms.
+
+ But in terms of the Net-SNMP-provided code, the agent (and AgentX
+ subagent) should *not* be regarded as thread-safe.
+
+
+
+COMPILING
+=========
+
+How do I control the environment used to compile the software?
+-------------------------------------------------------------
+
+ The basic mechanism for compiling the Net-SNMP project software is to
+ run "configure", followed by "make" (to compile it), "make test" (to
+ check that it's working properly) and then "make install" (to install
+ the files into the correct locations - which typicalyl needs to be done
+ as root.
+
+ The primary role of "configure" is to determines various aspects about
+ the system that the software is being compiled on. However there are
+ also a number of options to configure which can be used to control
+ various aspects of the compilation environment.
+
+ The most common options are "--with-mib-modules" and "--with-out-mib-modules"
+ which control the set of MIB module code files that are included within
+ the agent binary. Adding or removing these modules will affect what MIB
+ information the agent can return.
+ See the entry "How do I add a MIB to the agent?" for more details.
+
+
+ The configure script can also specify the compiler to use for compiling
+ the source code (e.g. "configure --with-cc=cc"), the flags passed to
+ this compiler (e.g. "configure --with-cflags=-g"), or to the linker
+ (e.g. "configure --with-ldflags=-Bstatic"), and various other aspects of
+ the build environment.
+ Run "configure --help" for a full list.
+
+
+
+How do I control the environment used to compile the software under Windows?
+---------------------------------------------------------------------------
+
+ If you are compiling the project within the MinGW or Cygwin environments,
+ then these use the same "configure" mechanism as Unix-based systems. See
+ the previous entry for more information.
+
+ If you are compiling the project from within Visual Studio, then this does
+ not use the standard configure mechanism. Instead, there is a separate
+ "Configure" script within the 'win32' directory. This can be used enable
+ or disable various aspects of the build environment, such as support for
+ encryption or IPv6.
+ Run "Configure --help" for more information
+
+ Note that this script does not include an equivalent of "--with-mib-modules"
+ for extending the MIB information supported by the agent. Instead, this
+ needs to be done by tweaking the build environment manually. See the file
+ README.win32 for more details of this, and various other aspects of building
+ the project on Windows systems.
+
+
+
+Why does the compilation complain about missing libraries?
+---------------------------------------------------------
+
+ This has been seen in a number of guises over the years - most commonly
+ on Linux systems (although the problem may also occur elsewhere). The
+ underlying problem is that typical installation may not always include
+ the full set of library links required for building the Net-SNMP software.
+
+ This problem can usually be fixed by installing the missing packages
+ (typically the development version of a package that is already there).
+
+ Examples of this that we have come across include:
+
+ -lelf elfutils-devel (later renamed to elfutils-libelf-devel)
+ -lbz2 bzip2-devel
+ -lselinux libselinux-devel
+ -lcrypto openssl/openssl-devel
+ -lbeecrypt libbeecrypt/beecrypt/beecrypt-devel.
+
+ These are the names of the RedHat/Fedora RPMs. Other distributions
+ or O/S's may use different names, but the basic idea should be the
+ same.
+
+ If the compilation is complaining about a missing .so file, then an
+ alternative quick fix is to add the missing symbolic link, using
+ something like:
+ ln -s libelf.so.1 /usr/lib/libelf.so
+
+ giving the appropriate generic library name from the error message,
+ and the correct number for whichever version of this library you
+ have installed.
+
+ If the compilation is complaining about a .la file, then you should
+ install the relevant development package, as listed above.
+
+
+
+How can I reduce the memory footprint?
+--------------------------------------
+
+ In order to reduce the memory footprint (for instance, to
+ embed the snmpd into a device), the following configure options
+ could be used.
+
+ '--disable-debugging'
+ This turns off the compilation of all debugging statements.
+
+ '--enable-mini-agent' '--with-out-mib-modules=examples/ucdDemoPublic'
+ This creates an agent with just the essential MIB modules included.
+ NOTE: If you need additional MIB modules, then simply add them
+ using the option '--with-mib-modules=...' but this will of course
+ increase the memory footprint.
+
+ '--with-transports=UDP'
+ This option specifies the transport domains to include.
+ For a simple standalone agent, just UDP should be sufficient.
+ (Although the 'disman' and 'agentx' modules may require the
+ Callback, TCP and/or Unix transport domains as well).
+
+ '--without-kmem-usage'
+ This can be used in order to omit the code that operates on the
+ /dev/kmem interface. Clearly, this option cannot be used when
+ one of the configured MIB modules depends on it.
+
+ '--with-mibdirs=' and '--with-mibs='
+ These options tell the agent not to load any MIB modules.
+ This doesn't affect the size of libraries or application
+ binaries, but will reduce the memory footprint during runtime.
+
+ '--disable-mib-loading'
+ This can be used in order to omit the code that loads and
+ parses the MIB files altogether. This will reduce both the
+ runtime memory footprint, and the binary sizes.
+
+ Once the agent (snmpd) has been linked, you might also try running
+ 'strip snmpd' to remove un-necessary debug/symbol information.
+
+
+
+How can I reduce the installation footprint or speed up compilation?
+-------------------------------------------------------------------
+
+ The following configure options may also be useful:
+
+ --disable-agent Do not build the agent (snmpd).
+ --disable-applications Do not build the apps (snmpget, ...).
+ --disable-manuals Do not install the manuals.
+ --disable-scripts Do not install the scripts (mib2c, ...).
+ --disable-mibs Do not install the mib files.
+ --disable-mib-loading Do not include code that parses and
+ manipulates the mib files.
+
+
+
+How can I compile the project for use on an embedded system?
+-----------------------------------------------------------
+
+ Although this is definitely a Frequently Asked Question on the project
+ mailing lists, it hasn't really been a Frequently _Answered_ Question.
+ The basic problem is that none of the core development team have much
+ involvement or experience with embedded systems. And although we have
+ repeatedly put out a plea for implementation reports and advice, this
+ has not so far been particularly successful. So the first thing to say
+ is that the following suggestions should be treated with a greater than
+ usual level of suspicion.
+
+ The second thing to say is that compiling the Net-SNMP project for use
+ on an embedded system typically means compiling the *agent* (rather than
+ the trap receiver, or command-line tools). So that is what this entry
+ will concentrate on.
+
+ There are three main aspects to consider:
+ - how to compile the code,
+ - *what* code to compile, and
+ - how to install the resulting agent binary.
+
+ The Net-SNMP project uses the standard "configure" mechanism, so the
+ usual cross-compilation options are available - in particular "--host"
+ and "--target". It is also possible to specify the compiler and linker
+ to use ("--with-cc" and "--with-ld"), and any special flags to pass
+ to them ("--with-cflags" and "--with-ldflags"). There shouldn't be
+ anything particularly special about compiling the Net-SNMP code, so
+ see the documentation for your target environment for more information.
+ (And please let us know if there *is* anything special that should be
+ mentioned here!)
+
+ If the aim is simply to generate an SNMP agent to run on the target
+ system, it's probably not necessary to compile the command-line tools
+ or trap receiver. The configure option "--disable-applications" will
+ omit these elements. See the previous entry for other potentially
+ relevant useful options.
+
+ Unfortunately, the SNMP agent (and in particular, the code for individual
+ MIB modules) is the most system-specific part of the Net-SNMP software.
+ It may prove necessary to disable particular MIB modules if they do not
+ compile successfully, or attempt to use the wrong system-specific APIs.
+ This can be done using the configure option "--with-out-mib-modules".
+ Alternatively, the option "--enable-mini-agent" will omit all but the
+ core MIB module code. Additional modules can then be added individually
+ using "--with-mib-modules".
+
+ Further information about how to deal with problems with individual MIB
+ modules is reliant on suitable reports being forthcoming from the wider
+ Net-SNMP community. The ball is in your court!
+
+ Finally, installing the agent binary is _not_ simply a matter of copying
+ the "snmpd" file onto the target system. The agent typically relies on
+ a number of additional libraries (and possibly the presence of assorted
+ MIB files, unless this has been explicitly omitted). It is normally
+ necessary to run "make install", before copying the installed framework
+ to the target system.
+
+ If the install destination needs to be different to the eventual location
+ on the target system, this can be handled using the configure options
+ "--prefix" (for the target location) and "--with-install-prefix" (for the
+ temporary install location). Alternatively, this can be handled as part
+ of the install command:
+ make install prefix={target location} INSTALL_PREFIX={temp location}
+
+ Alternatively, if the agent is compiled with static linking (and no MIB
+ files), then it may be possible to simply copy the agent binary across to
+ the target system. See the next entry for details.
+
+
+
+How can I compile the project to use static linking?
+---------------------------------------------------
+
+ For totally static net-snmp executables, use
+ configure --with-ldflags=-Bstatic
+
+ To compile your application with static libraries (eg for easier
+ debugging), and to link to a non-installed build directory, try the
+ following Makefile fragment:
+
+ NETSNMPDIR=/usr/local/build/snmp/full-clean-cvs-V5-1-patches
+ NETSNMPCONFIG=$(NETSNMPDIR)/net-snmp-config
+
+ NETSNMPBASECFLAGS := $(shell $(NETSNMPCONFIG) --base-cflags)
+ NETSNMPINCLUDES := $(shell $(NETSNMPCONFIG) --build-includes $(NETSNMPDIR))
+ # base flags after build/src include, in case it has /usr/local/include
+ NETSNMPCFLAGS=$(NETSNMPINCLUDES) $(NETSNMPBASECFLAGS)
+
+ 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)
+
+ STRICT_FLAGS = -Wall -Wstrict-prototypes
+ CFLAGS=-I. $(NETSNMPCFLAGS) $(STRICT_FLAGS)
+
+ This replaces the standard Makefile section, which will used installed
+ libraries:
+
+ NETSNMPCONFIG=net-snmp-config
+
+ # uncomment this if you have GNU make
+ #NETSNMPCFLAGS := $(shell $(NETSNMPCONFIG) --base-cflags)
+ #NETSNMPLIBS := $(shell $(NETSNMPCONFIG) --agent-libs)
+ NETSNMPCFLAGS=`$(NETSNMPCONFIG) --base-cflags`
+ NETSNMPLIBS=`$(NETSNMPCONFIG) --agent-libs`
+
+ LIBS=$(NETSNMPLIBS)
+
+
+
+Why does 'make test' skip various tests?
+---------------------------------------
+
+ Some of the tests are only relevant to particular operating systems,
+ or rely on specific areas of functionality. The test framework will
+ check whether the relevant elements are available before running the
+ relevant tests, and will skip them if these modules have been omitted
+ from the build environment (or do not apply to the current system).
+
+ One example of this are the tests T053agentv1trap, T054agentv2ctrap,
+ T055agentv1mintrap, T056agentv2cmintrap and T113agentxtrap, which
+ rely upon functionality from the NET-SNMP-EXAMPLES-MIB implementation.
+ This module is not included in the default agent configuration, so the
+ test framework will skip these tests.
+ To include them, run
+ "configure --with-mib-modules=examples/example"
+ and re-compile.
+
+
+
+Why does 'make test' complain about a pid file?
+-----------------------------------------------
+
+ Typically it says something like:
+
+ cat: cannot open /tmp/snmp-test-1-8694/*pid*
+
+ It's trying to tell you the port is blocked - typically because
+ another copy of the agent is still running, left over from from a
+ previous testing run.
+
+ If you type 'ps -ef' you should notice an orphaned process like:
+
+ snmpd -d -r -U -P /tmp/snmp-test-5-27295/snmpd.pid...
+
+ Kill this process.
+
+ This could be happening for several reasons including:
+
+ 1. You are trying to do concurrent runs of 'make test'.
+
+ 2. On a slow machine, the agent might be taking too long to
+ start up. Try changing the value of the variable SNMP_SLEEP
+ in testing/RUNTESTS from 1 to something higher - say 3 or 5.
+
+
+
+CODING
+======
+
+How do I write C code to integrate with the agent?
+-------------------------------------------------
+
+ There are three main methods for integrating external C code
+ within the agent. The code can be compiled directly into the
+ agent itself, it can be loaded dynamically while the agent is
+ running, or it can be compiled into a separate application
+ (a "subagent") which communicates with the main master agent.
+ All three approaches have been touched on elsewhere within this FAQ.
+
+ As far as the module code is concerned, all three mechanisms
+ use exactly the same module API. So a module developed for use
+ directly within the agent, could also be included within a subagent,
+ or loaded dynamically with no (or minimal) code changes needed.
+
+ Most of this section is concerned with more detailed aspects
+ of developing such code - including the 'mib2c' tool, which can
+ handle generating a basic code framework for implementing a
+ given set of MIB objects.
+
+
+
+How does the agent fetch the value of a MIB variable from the system?
+--------------------------------------------------------------------
+
+ That's typically the hardest bit of implementing a new MIB module,
+ and is the one thing that 'mib2c' can't help with. It very much
+ depends on the MIB variable concerned (and often the underlying
+ operating system as well).
+
+ Relatively few MIB modules are completely self-contained, with all
+ the information held internally within the agent, and all updates
+ being done via SNMP requests. Such MIB modules can be implemented
+ fairly easily.
+
+ More commonly, the agent needs to provide an SNMP-based interface to
+ information held elsewhere, perhaps in the operating system kernel or
+ some other application. Handling this is much more complex - since
+ a lot depends on what mechanisms are provided for retrieving (and
+ possibly updating) this information. The mib2c tool can generate code
+ for processing SNMP requests, based on some internal cache of management
+ information, but it cannot help with populating this cache with the
+ underlying data. That is up to the MIB implementer.
+
+ See the existing MIB modules in the Net-SNMP source tree for various
+ examples of assorted approaches to this task.
+
+
+
+Mib2c complains about a missing "mib reference" - what does this mean?
+---------------------------------------------------------------------
+
+ This basically means that it hasn't loaded the MIB file containing
+ the definition of the MIB subtree you're trying to implement. This
+ might be because it hasn't been installed, the name is wrong, or
+ (most likely), because it isn't in the default list. See the MIBS
+ section for more details, or the next entry for suitable invocations
+ of 'mib2c'.
+
+
+
+Mib2c complains about not having a "valid OID" - what does this mean?
+---------------------------------------------------------------------
+
+ This probably means that you gave it the name of a MIB file (or
+ module), rather than the name of an object defined in that file.
+ Mib2c expects the name of a 'root' object, and will generate a
+ template for the sub-tree starting from there.
+
+ If you've got a file 'MY-MIB.txt', defining the MIB module
+ 'MY-MIB' which contains a subtree based on the object 'myMib',
+ then you should invoke mib2c as
+ "mib2c .... myMib"
+ rather than
+ "mib2c .... MY-MIB.txt"
+ or "mib2c .... MY-MIB"
+
+ Note that you'll probably also have to add your MIB to the list of
+ MIBs that are loaded automatically, in order for mib2c to recognise
+ the name of this object. So the command would typically be
+ "MIBS=+MY-MIB mib2c .... myMib"
+ or "MIBS=ALL mib2c .... myMib"
+
+
+
+Why doesn't mib2c like the MIB file I'm giving it?
+-------------------------------------------------
+
+ This is most likely the same problem as the previous entry. Mib2c
+ takes the name of a MIB _object_, not the name of a file (or MIB
+ module). Try using the name of the MODULE-IDENTITY definition.
+
+ Another possibility is that the MIB may contain syntax errors.
+ Try running it through 'snmptranslate' or a dedicated SMI
+ validation tool (such as 'smilint' or the on-line interface at
+ http://wwwsnmp.cs.utwente.nl/ietf/mibs/validate/)
+
+
+
+Mib2c ignores my MIB and generates a pair of 'mib-2' code files. Why?
+---------------------------------------------------------------------
+
+ This is usually a sign of the same problem as the previous entries,
+ giving mib2c the name of the file containing the MIB (or of the MIB
+ itself), rather than an object within it.
+
+ Earlier versions of mib2c didn't detect this situation, and merrily
+ constructed a template for a default starting point of the mib-2 node.
+
+ More recent versions complain about not having a valid OID instead.
+
+
+
+What's the difference between the various mib2c configuration files?
+-------------------------------------------------------------------
+
+ Most of the mib2c config files are concerned with implementing
+ MIB tables, and generate various alternative code templates.
+ These basically fall into four distinct categories.
+
+ 'mib2c.raw-table.conf' is the lightest of the templates, and
+ just provides a fairly basic table framework. Most of the work
+ of implementing the table - detecting which row is required for a
+ given request, retrieving or updating the relevant column values,
+ and interacting with the underlying subsystem - are all left to
+ the MIB programmer.
+
+ The second group of templates - 'table_data', 'container' and
+ 'tdata' - all share the same basic model (although the internal
+ details are rather different). The MIB implementer should define a
+ data structure to represent a row of the table, and the helper then
+ takes care of holding the table internally, as a collection of such
+ per-row data structures. This includes identifying which row is
+ required for a given request. Retrieving or updating the appropriate
+ column value is left to the MIB programmer, although the generated
+ framework includes most of the necessary code.
+ Allied to this is a fourth "internal data" mib2c configuration
+ file ('create-dataset') which handles the individual columns as
+ well. This is the closest to a Plug-and-Play configuration, and
+ the MIB implementer only needs to be concerned with any special
+ processing, such as linking the table with the underlying subsystem.
+
+ The third style of mib2c config assumes that the table data is
+ held externally to the helper - either within the MIB module code
+ itself, or in the external subsystem. The generated code framework
+ includes routines to "iterate" through the rows of the table, with
+ the iterator helper simply deciding which row is required for a
+ particular request. Once again, the MIB programmer must handle
+ retrieving or updating the appropriate column value, although the
+ generated framework includes most of the necessary code.
+ There is a variant of this config ('iterate_access') which works
+ in basically the same way. However this tries to separate out the
+ standard processing, from the code that needs to be amended by the
+ programmer for retrieving and updating the individual column values.
+
+ This is also the idea behind the final table-oriented mib2c config
+ template - 'mib2c.mfd.conf' (or "MIBs for Dummies"). This is a much
+ more flexible framework, which can be used with either internally
+ held data, or iterating through an external representation. The
+ distinguishing feature of this framework is that it separates out
+ standard and table-specific processing, at a much finer level of
+ detail than the others.
+
+
+ The other mib2c config templates are concerned with implementing
+ scalar objects ('scalar', 'int_watch'), code to generating traps
+ ('notify'), and various specialised requirements. There is also a
+ template ('old-api') to generate code suitable for the previous v4
+ UCD agent - though this is not particularly complete or reliable.
+ It's probably better to use a pure v4 mib2c environment (or switch
+ wholeheartedly to the v5 style).
+
+
+
+Which mib2c configuration file should I use?
+-------------------------------------------
+
+ The answer to that heavily depends on the characteristics of the
+ MIB objects being implemented. Of the handler-based table frameworks,
+ 'tdata' is more appropriate for tables that can be stored (or a copy
+ cached) within the agent itself, while 'iterate' is more relevant to
+ reporting data from outside the agent.
+ The raw interface is only suitable in very specific circumstances,
+ so it's probably sensible to start with one of the other frameworks
+ first, and only look at this if none of the alternatives seem to work.
+
+ The decision between the handler-based configs and MfD is more a
+ matter of the style of programming to use. Most of the frameworks
+ define a single handler routine to process an incoming request, so
+ all of the code is listed together, with the MIB programmer inserting
+ table-specific processing into this single block of code.
+ The MfD provides a series of individual object-specific routines,
+ each concerned with one very specific task, and hides as much as
+ possible from the programmer.
+
+ If you like to understand the broad thrust of what's happening,
+ then one of the handler-based approaches would be the best choice.
+ If you prefer to concentrate on the nitty-gritty of a given table,
+ and are happy to trust that the rest of the processing will work
+ correctly, then the MfD framework would be more appropriate.
+
+ For implementing a group of scalar objects, then the choice is
+ simple - use 'mib2c.scalar.conf'. Similarly, for generating traps
+ or informs, use 'mib2c.notify.conf'. But note that this only assists
+ with the code to actually generate the trap. It does not address the
+ issue of _when_ to send the trap. See the FAQ entry "How can I get
+ the agent to generate a trap?" for more information.
+
+
+
+How can I have mib2c generate code for both scalars and tables?
+--------------------------------------------------------------
+
+ This uses a very powerful tool called a "text editor" :-)
+
+ The mib2c tool uses separate configuration files to generate code
+ for scalar objects, and for tables. This means that it's not possible
+ to automatically generate a single code file that supports both scalars
+ and tables.
+
+ Instead, the two code files need to be generated separately, and
+ then combined manually. This will typically mean copying the handler
+ routines for the scalar object(s) into the table file, and adding the
+ code to register these handler(s) to the table initialisation routine.
+
+
+
+Are there any examples, or documentation for developing MIB modules?
+-------------------------------------------------------------------
+
+ Many of the MIB modules shipped with the Net-SNMP agent still
+ use the v4 "traditional" MIB module API, but an increasing number
+ use one of the newer v5 helper-based handlers. All of these can
+ be found under 'agent/mibgroup'
+
+ The 'tdata' helper is used in the new DisMan Event, Expression
+ and Schedule MIB modules (see 'disman/{event,expr,schedule}/*').
+ The similar 'dataset' helper is used in the older DisMan Event
+ MIB implementation (see 'disman/mteEvent*') and the Notification
+ Log MIB (see 'notification-log-mib/*'), used by 'snmptrapd' to
+ log incoming traps.
+
+ The basic iterator handler is used in the TCP and UDP table
+ implementations (mibII/tcpTable & mibII/udpTable), VACM context
+ handling (mibII/vacm_context) and various tables relating to agent
+ internals (agent/*). These show a number of different approaches
+ to using the iterator helper, so it's worth comparing them.
+
+ The two examples/netSnmpHostsTable* modules provide a contrast
+ between the iterator and iterator_access helpers.
+
+ There are several examples based on the MfD framework (see
+ '{if,ip,tcp,udp}-mib/'). Much of this code is not intended to
+ be viewed directly, but individual files are clearly commented
+ to distinguish between internal implementation and public code.
+
+ The Net-SNMP agent does not currently include any MIB modules
+ using the array-user container-based helper. The best examples
+ of this are to be found in the net-policy project.
+ See http://net-policy.sourceforge.net/
+
+
+
+Where should I put the files produced by 'mib2c'?
+------------------------------------------------
+
+ If you're using the main source tree to compile your new module, then
+ put these two files (mymib.[ch]) in the directory 'agent/mibgroup'.
+ You should then re-run configure to add in your new module
+ configure --with-mib-modules=mymib
+ and recompile.
+
+ If you've got a number of new modules to add, it might be
+ sensible to put them all into a single subdirectory of 'mibgroup'.
+ Then create a header file, listing the individual components.
+ This might look something like:
+
+ config_require(mymib/myObjects)
+ config_require(mymib/myTable)
+ config_require(mymib/myOtherTable)
+
+ If this was saved as the file 'mymib.h', then the same configure
+ line given above, would pull in all three modules. See the current
+ contents of 'agent/mibgroup' for examples of this. Note that the
+ MfD framework will generate a similar grouping automatically.
+
+
+
+Why doesn't my new MIB module report anything?
+---------------------------------------------
+
+ There are probably four main reasons why a new MIB module isn't working.
+ Either it hasn't been included in the running agent, the code is present
+ but hasn't been initialised, the module has been initialised but the
+ handler isn't being called, or there's a problem with the module code itself.
+
+ To check whether the code files are being compiled, the easiest approach is
+ simply to look at the directory where the code is located. When the agent is
+ compiled, this should produce .o files (and probably .lo files) corresponding
+ to the C code files for this module. Alternatively, run 'nm' (or 'strings')
+ on the MIB module library (libnetsnmpmibs), and look for the names of the
+ initialisation routines or handlers (or the text of any messages displayed by
+ the module code).
+
+ One other thing to check is whether you have multiple copies of the software
+ installed on the system. This is a particular problem when compiling from
+ source (to include your new module), without first removing any vendor-supplied
+ version of the agent (which won't include this new code).
+
+
+ Assuming that you have confirmed that the module code is present in the agent,
+ the next step is to check whether the initialisation routine is being called
+ to register the MIB objects. The simplest way to do this is to include a
+ suitable debugging statement within the initialisation routine, and start
+ the agent with the corresponding '-Dtoken'. Alternatively, try walking the
+ nsModuleName column object, and look for mention of the new MIB module.
+
+
+ Assuming the module has been registered, the next step is to check whether
+ the handler is being called, when the agent receives a suitable SNMP request.
+ Again, the simplest way to do this is to include debugging statements within
+ the handler routine, and start the agent with the corresponding '-Dtoken'.
+ Then issue an "snmpget" request for an instance within the new MIB module.
+ (This command is preferable to the usual "snmpwalk" command, as it is more
+ closely focused on the MIB module in question).
+
+ If this indicates that the handler routine isn't being called, then there are
+ two main likely causes. Firstly, check the access control settings. If these
+ are configured to block access to this portion of the OID tree, then the MIB
+ handler will never be called. Secondly, several of the table helpers are
+ designed to know which rows of the table are valid, and will call the main
+ MIB handler with information about the relevant row. If the requested row is
+ not valid (or the table is empty), then the handler will not be called.
+
+
+ Finally, if the handler _is_ being called, but is still not returning any
+ information, then the cause probably lies with your MIB module code. In which
+ case, it's really up to you to find the problem and fix it! Either activate
+ any debugging code that you have included within the handler routine, or run
+ the agent under a source code debugger, and step through the handler processing.
+ In either case, it's much easier to debug these problems when processing an
+ "snmpget" request, rather than "snmpgetnext" or "snmpwalk".
+
+ Remember that 'mib2c' simply generates template code for your MIB module.
+ It's up to you to fill in the details, to report the actual information from
+ whatever underlying subsystem is being monitored. Mib2c cannot help with
+ the semantics of the MIB module - it's purely there to provide an initial
+ code framework, based on the _syntax_ of the MIB module objects.
+
+
+
+Why does the iterator call my get_{first,next} routines so often?
+-----------------------------------------------------------------------
+
+ The first thing to realise is that the 'get_first' and 'get_next'
+ hook routines are concerned with processing a single SNMP request, not
+ with walking the whole table. A full "snmpwalk" command will typically
+ involve a series of individual 'GetNext' requests, and every one of
+ these will trigger a separate 'get_first/get_next/get_next/....' cycle.
+
+ It's usually more efficient to use 'snmptable' which will walk
+ each column in parallel (as well as displaying the results in a
+ more natural manner).
+
+ Secondly, the iterator helper was originally designed to handle
+ unsorted data, so will look at every row of the internal table for
+ each request. If the data is actually held in the correct order,
+ then it's worth setting the NETSNMP_ITERATOR_FLAG_SORTED flag:
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ iinfo->flags |= NETSNMP_ITERATOR_FLAG_SORTED;
+ This will help the situation somewhat.
+
+ But the iterator helper is inherently a relatively inefficient
+ mechanism, and it may be worth looking at one of the other helpers,
+ particularly if the data will be held within the agent itself.
+
+
+
+How can I get the agent to generate a trap (or inform)?
+------------------------------------------------------
+
+ There are two aspects to having the agent generate a trap -
+ knowing *how* to do this, and knowing *when* to do so.
+
+ Actually generating a trap is reasonably simple - just call one
+ of the trap API routines ('send_easy_trap()' or 'send_v2trap()')
+ with the relevant information (generic and specific trap values,
+ or a varbind list respectively).
+
+ The 'mib2c.notify.conf' configuration file can be used to
+ construct a suitable template routine for generating a trap,
+ including building the variable list from the MIB trap
+ definition. These variables can then be given suitable values,
+ before invoking the 'send_v2trap()' call to actually send the trap.
+ See the 'snmp_trap_api(3)' man page for further details.
+
+ Note that these APIs are only available within the agent (or
+ subagents), and are not available to stand-alone applications.
+ The code for 'snmptrap' shows an approach to use in such a case.
+
+
+ Determining *when* to generate the trap (either directly or
+ via the mib2c-generated routine) is often harder. If the trap
+ is generated in response to some action within the agent, (e.g.
+ as the result of a SET), then this isn't too much of a problem.
+
+ But if the trap is intended to report on a change of status
+ (e.g. a network interface going up or down, or a disk filling up),
+ then actually detecting this is non-trivial. Unless the underlying
+ system can signal this situation to the agent, then it's typically
+ necessary to poll the value(s) on a regular basis, save the results
+ and compare them with the new values the next time round.
+
+ The simplest way to handle this is via the DisMan Event MIB,
+ which is designed for exactly this purpose. As long as you can
+ specify a MIB object to monitor, and the value or thresholds
+ that should trigger a notification, then this module can check
+ these values regularly, and automatically send a suitable trap
+ when appropriate. See the 'snmpd.conf(5)' man page (under
+ ACTIVE MONITORING) for details.
+
+ Otherwise, you'd need to use the routines documented in
+ 'snmp_alarm(3)' to regularly invoke a monitoring routine. This
+ would check the necessary conditions (which need not be MIB
+ objects), and call the 'send_xxx_trap()' routine (as generated
+ by 'mib2c.notify.conf') when appropriate.
+
+
+
+How can I get an AgentX sub-agent to generate a trap (or inform)?
+----------------------------------------------------------------
+
+ This is done in exactly the same manner as with the main SNMP agent.
+ Calling one of the routines described in 'snmp_trap_api(3)' will cause
+ the AgentX sub-agent to send a notification to the master agent, which
+ will then pass this on to the configured trap destination(s).
+
+ One of the original design aims of the Net-SNMP AgentX support was that
+ the agent (or subagent) framework should be transparent to a MIB module
+ implementer. The interface between the agent framework and a MIB module
+ should be independent of the protocol used to receive the original request.
+ So the exact same MIB module code could be used within a traditional
+ SNMP-only agent, or an AgentX subagent, with no changes needed.
+
+ This also holds for sending traps.
+
+
+
+How can I get the agent to send an SNMPv1 (or SNMPv2c) trap?
+-----------------------------------------------------------
+
+ It doesn't make any difference whether you use the v1-style
+ API call 'send_easy_trap()' or the v2-style 'send_v2trap()'.
+ What matters is the directive(s) in the snmpd.conf file.
+
+ If this file contains 'trapsink', then the agent will send
+ an SNMPv1 trap. If this file contains 'trap2sink', then the
+ agent will send an SNMPv2c trap. And if this file contains
+ both, then the agent will send *two* copies of this trap.
+
+ See the entry
+ Where are these traps sent to?
+ in the AGENT section for details.
+
+
+
+How can I get the agent to include varbinds with an SNMPv1 trap?
+---------------------------------------------------------------
+
+ There are two ways to do this. You can either use the
+ 'send_v2trap()' call and give a varbind list, starting with
+ the v2-equivalent of the SNMPv1 trap, followed by the
+ additional varbinds.
+
+ Alternatively, you can use the API call 'send_trap_vars()'
+ which takes the same generic/specific trap values as
+ 'send_easy_trap()', plus the list of additional varbinds.
+
+ In either case, you also need to have 'trapsink' in the
+ snmpd.conf file. The resulting trap will be identical,
+ whichever approach is used.
+
+
+
+How can I get the agent to send an SNMPv1 enterprise-specific trap?
+------------------------------------------------------------------
+
+ There are two ways to do this. You can either use the
+ 'send_v2trap()' call and give a varbind list, starting
+ with the v2-equivalent of the SNMPv1 trap, followed by the
+ additional varbinds.
+
+ Alternatively, you can use the (undocumented) API call
+ 'send_enterprise_trap_vars()' which takes the same parameters
+ as 'send_trap_vars()', plus the enterprise OID to use (in the
+ usual name/length form). See the code file 'agent_trap.c'
+
+ In either case, you also need to have 'trapsink' in the
+ snmpd.conf file. The resulting trap will be identical,
+ whichever approach is used.
+
+
+
+How can I get the agent to send an SNMPv3 trap (or inform)?
+----------------------------------------------------------
+
+ It doesn't matter which API call you use to specify the
+ trap - 'send_easy_trap()', 'send_v2trap()' or one of the other
+ calls mentioned above. Generating an SNMPv3 notification
+ (rather than a community-based one) is controlled by the
+ snmpd.conf file.
+
+ To send an SNMPv3 trap, this file should contain a
+ 'snmpsess' directive, specifying the version, security
+ level, user name and passphrases (if applicable), as
+ well as the destination address. This is basically
+ the same as the command line required for sending the
+ trap manually, using 'snmptrap'.
+
+ Note that (unlike 'snmptrap') this directive does *not*
+ read default settings from an 'snmp.conf' file, so these
+ must be specified explicitly in the 'snmpsess' line.
+
+
+
+Why does calling 'send_v2trap' generate an SNMPv1 trap (or vice versa)?
+----------------------------------------------------------------------
+
+ The two versions of the trap API calls are concerned with how
+ the trap is represented when it is passed *in* to the API, not
+ the version of the trap PDU that will actually be generated by
+ the agent. That is determined by the configuration token used
+ to set up the trap destination.
+
+ Remember that in general, all traps are sent to all destinations.
+ This means that a trap specified using the SNMPv1 trap syntax
+ needs to be converted to the SNMPv2 format before it can be sent
+ to an SNMPv2 (or SNMPv3) destination. Similarly, a trap specified
+ using the SNMPv2 syntax needs to be converted to the SNMPv1 format
+ before it can be sent to an SNMPv1 sink.
+
+ Essentially, the API call to use depends on what you asking for,
+ which is not necessarily what the recipients will actually get!
+ See 'snmp_trap_api(3)' for a fuller explanation.
+
+
+
+How can I register a MIB module in a different (SNMPv3) context?
+---------------------------------------------------------------
+
+ Contexts are a mechanism within SNMPv3 (and AgentX) whereby
+ an agent can support parallel versions of the same MIB objects,
+ referring to different underlying data sets. By default, a MIB
+ module registrations will use the default empty context of "".
+ But it's also possible to provide MIB information using a different
+ (non-default) context.
+
+ There are three aspects involved in doing this. Firsly, it's necessary
+ to register the MIB module in this non-default context. With the v4 API,
+ this uses the call 'register_mib_context()' rather than the REGISTER_MIB
+ macro. This is significantly more detailed, but most of the additional
+ parameters can take fixed values, if all that's needed is to change the
+ registration context.
+
+ Instead of the macro call:
+ REGISTER_MIB("my_token", my_variables, variable1, my_variables_oid);
+ use the function call:
+ register_mib_context( "my_token",
+ my_variables, sizeof(variable1),
+ sizeof(my_variables)/sizeof(variable1),
+ my_variables_oid,
+ sizeof(my_variables_oid)/sizeof(oid),
+ DEFAULT_MIB_PRIORITY, 0, 0, NULL,
+ "my_context", -1, 0);
+
+ Things are much easier with the v5 helper-based API. Having
+ created the registration structure, this just requires setting the
+ 'contextName' field before actually registering the MIB module:
+ netsnmp_handler_registration *reg;
+ reg = netsnmp_create_handler_registration(.....);
+ reg->contextName = strdup("my_context");
+ netsnmp_register_handler(reg);
+
+
+ Secondly, it is necessary to configure the access control settings to allow
+ access to information in the new context. This is handled automatically
+ when using the simple "rouser" or "rwuser" directives. But if access control
+ is configured using the fuller com2sec/group/view/access mechanism, then the
+ "access" line must specify the appropriate context(s), either explicitly:
+
+ access {group} "my_context" any noauth exact ......
+
+ or using a single entry to cover all possible contexts:
+
+ access {group} "" any noauth prefix ......
+
+
+ Finally, the SNMP request used to retrieve (or update) the information
+ must also specify the required context. With SNMPv3 requests, the context
+ is part of the protocol, so this can be done using a command-line option:
+
+ snmpwalk -v 3 -n my_context .....
+
+ With community-based requests (SNMPv1 and SNMPv2c), things aren't so simple.
+ Although the "rocommunity" and "rwcommunity" settings also configure access
+ for all possible contexts, there's no way to specify a non-default context
+ as part of the request.
+
+ The only way to handle non-default contexts with community-based SNMP requests
+ is to set up a mapping from the community string to the desired context. This
+ uses the "com2sec" directive, with an additional "-Cn" parameter. Note that
+ this also means that the access control must be configured using the full
+ com2sec/group/view/access mechanism. The short-form access control directives
+ do not handle the mapping of community strings to non-default contexts.
+
+
+
+MISC
+======
+
+What ASN.1 parser is used?
+-------------------------
+
+ The parser used by both the agent and client programs is coded by hand.
+ This parser has recently been re-vamped to allow control of which of
+ the available MIBs should be included, and to handle duplicate object
+ subidentifiers.
+ The source code can be found in the snmplib directory (in 'parse.c'),
+ and the parser is usually bundled into the library 'libnetsnmp.a'
+
+ Note that the parser attempts to be fairly forgiving of some common
+ errors and incompatibilities in MIB files. The Net-SNMP tools accepting
+ a MIB file without complaint does *not* imply that the MIB is strictly
+ correct.
+ Certain MIBs may need some amendments to allow them to be read
+ correctly by the parser. Contact the coders' list for advice.
+
+
+
+What is the Official Slogan of the net-snmp-coders list?
+-------------------------------------------------------
+
+ "The current implementation is non-obvious and may need to be improved."
+ (with thanks to Rohit Dube)
+
+ And an alternate, added 26-Apr-2000:
+
+ "In theory, it shouldn't be that hard, but it just needs to be done."
+
+
+
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..199de64
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,278 @@
+TABLE OF CONTENTS
+=================
+
+ Table Of Contents
+ Quick Instructions
+* Net-SNMP Specific Information
+ Long (but you should read these) Instructions
+ Installing the Perl/SNMP Module
+* Compilers and Options
+ Compiling For Multiple Architectures
+ Installation Names
+ Optional Features
+ Sharing Defaults
+ Operation Controls
+
+ * = required reading
+
+QUICK INSTRUCTIONS
+==================
+
+ 1) Run ./configure
+ (type "./configure --help" for a quick usage summary.)
+ (--prefix=PATH will change the default /usr/local installation path.)
+ (see "Compilers and Options" on changing the compiler to use)
+
+ 2) Optionally edit include/net-snmp/net-snmp-config.h
+ (due to prompting done by the configure script, this is very rarely
+ necessary.)
+
+ 3) make
+
+ 4) Run the next command as root:
+ 5) make install
+
+ 6) configure the agent
+ (either using 'snmpconf' or by crafting an snmpd.conf file manually.
+ The file 'EXAMPLE.conf' may be a suitable starting point)
+
+Note: By default, everything will be installed in /usr/local.
+ (see below for more instructions)
+
+Net-SNMP Specific Information
+=============================
+
+As of UCD-SNMP V3.3.1 the configuration files are now looked for in
+$(prefix)/share/snmp, where ($prefix) is defined as the value passed
+to the --prefix argument of the configure script, or /usr/local if
+undefined. In version 3.0.3 till 3.3, the files were kept in
+$(prefix)/lib/snmp
+
+Optional features to pass to configure for Net-SNMP can be obtained by
+running configure --help.
+
+LONG (but you should read these) INSTRUCTIONS
+=============================================
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, a file `config.log' containing compiler output
+(useful mainly for debugging `configure') and a file `configure-summary'
+containing the summary displayed at the end of the `configure' run.
+
+ The file `include/net-snmp/net-snmp-config.h' is also generated
+at this time. It contains IMPORTANT information such as the location
+of log and configuration files. In some special cases you may need to
+modify this file but it is prefererable to work out a way of getting
+`configure' to set things up for your particular environment.
+
+As the `configure' invocation often gets lengthy and difficult to
+type or if you have several different ways you want to configure a
+system, you may want to create a shell script containing your invocation.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for. When it
+ completes it prints a short message (also available in configure-summary)
+ indicating what functionality will be available when compiled.
+
+ 2. If necessary, edit include/net-snmp/net-snmp-config.h (see above).
+
+ 3. Type `make' to compile the package.
+
+ 4. Type `make test' which runs a variety of tests to see what functionality
+ has been incorporated and if it works.
+
+ 5. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 6. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'.
+
+ 7. You can remove the application by typing `make uninstall'.
+
+There may be additional installation issues discussed in the
+README's for various platforms such as README.solaris.
+
+
+Installing the Perl/SNMP Module
+===============================
+
+ The Perl/SNMP Module is now bundled with the net-snmp package
+(which includes other Net-SNMP specific modules as well), all of which
+are located in the net-snmp/perl directory. The Perl package provides
+a high level abstract interface to the functionality found in the
+Net-SNMP libraries and demon applications.
+
+ It is recommended you install the perl modules as you build the
+ Net-SNMP package. The configure script can be run as follows to
+ automatically find perl and use it to install the perl modules:
+
+ ./configure --with-perl-modules
+
+ If you wish to use the embedded perl support available in the
+ Net-SNMP agent (and starting in Net-SNMP 5.2, the trap receiver),
+ then use the following option instead:
+
+ ./configure --enable-embedded-perl --enable-shared
+
+ Starting with Net-SNMP 5.4, configure enables embedded Perl and the
+ Perl modules by default when possible unless explicitly disabled.
+
+ If you wish to build the perl modules by hand, *install Net-SNMP
+ first* and then change directories to the perl subdirectory and:
+
+ Run:
+ cd perl
+ perl Makefile.PL
+ make
+ make test
+ make install (as root)
+
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, there is a `maketarget' script that will generate a symlink'ed
+shadow-directory for the object files. Do a `sh maketarget', then `cd' into
+targets/`config.guess` and do the configuration and installation.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..cd8c1fa
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1 @@
+ACLOCAL_AMFLAGS = -I m4
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..4d00168
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,459 @@
+
+#
+# Makefile.in (at the root of net-snmp)
+#
+
+top_builddir = .
+VPATH = @srcdir@
+
+SUBDIRS = snmplib @MAINSUBS@
+FTSUBDIRS = @FTMAINSUBS@ snmplib
+TESTDIRS = testing
+
+CPP = @CPP@ \
+ -Iinclude -I$(srcdir)/include -I$(srcdir)/agent/mibgroup -I. -I$(srcdir) \
+ -DDONT_INC_STRUCTS -DBINDIR=$(bindir) \
+ $(EXTRACPPFLAGS)
+
+INSTALLHEADERS=version.h net-snmp-features.h
+INCLUDESUBDIR=system
+INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi.h cygwin.h \
+ darwin.h darwin7.h darwin8.h darwin9.h darwin10.h dragonfly.h dynix.h \
+ freebsd2.h freebsd3.h freebsd4.h freebsd5.h freebsd6.h \
+ freebsd7.h freebsd8.h freebsd9.h freebsd10.h freebsd.h \
+ generic.h \
+ hpux.h irix.h linux.h mingw32.h mips.h netbsd.h osf5.h \
+ openbsd.h openbsd5.h openbsd4.h \
+ solaris2.3.h solaris2.4.h solaris2.5.h solaris2.6.h \
+ solaris.h sunos.h svr5.h sysv.h ultrix4.h
+INCLUDESUBDIR2=machine
+INCLUDESUBDIRHEADERS2=generic.h
+INSTALLBUILTHEADERS=include/net-snmp/net-snmp-config.h
+INSTALLBUILTINCLUDEHEADERS=@FEATUREHEADERS@
+INSTALLBINSCRIPTS=net-snmp-config net-snmp-create-v3-user
+INSTALLUCDHEADERS=ucd-snmp-config.h version.h mib_module_config.h
+
+#
+# other install rules.
+#
+OTHERINSTALL=copypersistentfiles @PERLINSTALLTARGS@ @PYTHONINSTALLTARGS@
+OTHERUNINSTALL=@PERLUNINSTALLTARGS@ @PYTHONUNINSTALLTARGS@
+COPY_PERSISTENT_FILES=@COPY_PERSISTENT_FILES@
+PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
+UCDPERSISTENT_DIRECTORY=@UCDPERSISTENT_DIRECTORY@
+
+#
+# perl specific
+#
+# yes, order matters here. default_store must occur before anything else
+PERLMODULES=default_store SNMP ASN OID agent TrapReceiver
+PERLMODULEFTS=perl/default_store/netsnmp-feature-definitions.ft \
+ perl/SNMP/netsnmp-feature-definitions.ft \
+ perl/ASN/netsnmp-feature-definitions.ft \
+ perl/OID/netsnmp-feature-definitions.ft \
+ perl/agent/netsnmp-feature-definitions.ft \
+ perl/TrapReceiver/netsnmp-feature-definitions.ft
+PERLARGS=@PERLARGS@
+
+#
+# python specific
+#
+PYTHONARGS=@PYTHONARGS@
+PYTHONMODULEFTS=python/netsnmp/netsnmp-feature-definitions.ft
+
+#
+# libtool
+#
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+
+#
+# feature checks for optional components
+#
+FTOTHERTARGS=@PERLFEATURES@ @PYTHONFEATURES@
+
+#
+# targets
+#
+all: sedscript EXAMPLE.conf @FEATURETARGS@ standardall net-snmp-config-x net-snmp-create-v3-user @PERLTARGS@ @PYTHONTARGS@
+
+start-flag:
+ @touch build-in-progress-flag
+
+end-flag:
+ @rm -f build-in-progress-flag > /dev/null 2>&1
+
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status --recheck
+
+
+snmplib: @FEATURETARGS@
+ @(cd snmplib; $(MAKE) )
+
+agent: @FEATURETARGS@
+ @(cd snmplib; $(MAKE) )
+ @(cd agent; $(MAKE) )
+
+apps: @FEATURETARGS@
+ @(cd snmplib; $(MAKE) )
+ @(cd agent; $(MAKE) libs)
+ @(cd apps; $(MAKE) )
+
+snmpget snmpbulkget snmpwalk snmpbulkwalk snmptranslate snmpstatus snmpdelta snmptable snmptest snmpset snmpusm snmpvacm snmpgetnext encode_keychange snmpdf snmptrap snmptls: @FEATURETARGS@
+ @(cd snmplib; $(MAKE) )
+ @(cd apps; $(MAKE) $@ )
+
+agentxtrap snmptrapd: @FEATURETARGS@
+ @(cd snmplib; $(MAKE) )
+ @(cd agent; $(MAKE) libs)
+ @(cd apps; $(MAKE) $@ )
+
+#
+# local build rules
+#
+sedscript: sedscript.in include/net-snmp/net-snmp-config.h $(srcdir)/agent/mibgroup/mibdefs.h
+ $(CPP) $(srcdir)/sedscript.in | egrep '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
+ echo 's/VERSIONINFO/$(VERSION)/g' >> sedscript
+ echo 's#DATADIR#$(datadir)#g' >> sedscript
+ echo 's#LIBDIR#$(libdir)#g' >> sedscript
+ echo 's#BINDIR#$(bindir)#g' >> sedscript
+ echo 's#PERSISTENT_DIRECTORY#$(PERSISTENT_DIRECTORY)#g' >> sedscript
+ echo 's#SYSCONFDIR#@sysconfdir@#g' >> sedscript
+
+EXAMPLE.conf: sedscript EXAMPLE.conf.def
+ $(SED) -f sedscript $(srcdir)/EXAMPLE.conf.def > EXAMPLE.conf
+
+docs: docsdir
+
+docsdir: docsdox
+
+docsdox: doxygen.conf
+ srcdir=$(srcdir) VERSION=$(VERSION) doxygen $(srcdir)/doxygen.conf
+
+net-snmp-config-x: net-snmp-config
+ chmod a+x net-snmp-config
+ touch net-snmp-config-x
+
+net-snmp-create-v3-user-x: net-snmp-create-v3-user
+ chmod a+x net-snmp-create-v3-user
+ touch net-snmp-create-v3-user-x
+
+#
+# extra install rules
+#
+
+copypersistentfiles:
+ @if test "$(COPY_PERSISTENT_FILES)" = "yes" -a -d $(UCDPERSISTENT_DIRECTORY) -a ! -d $(PERSISTENT_DIRECTORY) ; then \
+ cp -pr $(UCDPERSISTENT_DIRECTORY) $(PERSISTENT_DIRECTORY) ; \
+ echo "copying $(UCDPERSISTENT_DIRECTORY) to $(PERSISTENT_DIRECTORY)" ; \
+ fi
+#
+# test targets
+#
+test test-mibs testall testfailed testsimple: all testdirs
+ ( cd testing; $(MAKE) $@ )
+
+testdirs:
+ for i in $(TESTDIRS) ; do \
+ ( cd $$i ; $(MAKE) ) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done
+
+distall: ${srcdir}/configure ${srcdir}/include/net-snmp/net-snmp-config.h
+
+OTHERCLEANTARGETS=EXAMPLE.conf sedscript
+OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pythoncleanfeatures
+
+#
+# perl specific build rules
+#
+# override LD_RUN_PATH to avoid dependencies on the build directory
+perlmodules: perlmakefiles subdirs
+ @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{archlibexp}/CORE);'`") ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi
+
+perlmakefiles: net-snmp-config-x
+ @if test ! -f perl/Makefile; then \
+ (dir=`pwd`; \
+ cd perl ; \
+ $(PERL) Makefile.PL -NET-SNMP-IN-SOURCE=true -NET-SNMP-CONFIG="sh $$dir/net-snmp-config" $(PERLARGS) ) ; \
+ fi
+
+perlinstall:
+ @(cd perl ; $(MAKE) install) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi
+
+perluninstall:
+ @(cd perl ; $(MAKE) uninstall) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi
+
+perltest:
+ @(cd perl ; $(MAKE) test) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi
+
+perlclean:
+ @if test -f perl/Makefile; then \
+ ( cd perl ; $(MAKE) clean ) ; \
+ fi
+
+perlrealclean:
+ @if test -f perl/Makefile; then \
+ ( cd perl ; $(MAKE) realclean ) ; \
+ fi
+
+.h.ft:
+ $(FEATURECHECK) --feature-global $(top_builddir)/include/net-snmp/feature-details.h `dirname $<` $< $@ $(CC) -I $(top_builddir)/include -I $(top_srcdir)/include -E $(CPPFLAGS) $(CFLAGS) -c
+
+perlfeatures: $(PERLMODULEFTS)
+
+perlcleanfeatures:
+ $(RM) $(PERLMODULEFTS)
+
+
+# python specific build rules
+#
+PYMAKE=$(PYTHON) setup.py $(PYTHONARGS)
+pythonmodules: subdirs
+ @(dir=`pwd`; cd python; $(PYMAKE) build --basedir=$$dir) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi
+
+pythoninstall:
+ @(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi
+
+pythonuninstall:
+ echo "WARNING: python doesn't support uninstall"
+
+pythontest:
+ @(dir=`pwd`; cd python; $(PYMAKE) test --basedir=$$dir) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi
+
+pythonclean:
+ @(dir=`pwd`; cd python; $(PYMAKE) clean --basedir=$$dir)
+
+pythonfeatures: $(PYTHONMODULEFTS)
+
+pythoncleanfeatures:
+ $(RM) $(PYTHONMODULEFTS)
+
+#
+# make distclean completely removes all traces of building including
+# any files generated by configure itself.
+#
+distclean: perlrealclean clean configclean tarclean
+
+makefileclean:
+ rm -f Makefile snmplib/Makefile \
+ agent/Makefile agent/mibgroup/Makefile \
+ agent/helpers/Makefile \
+ apps/Makefile apps/snmpnetstat/Makefile \
+ man/Makefile mibs/Makefile ov/Makefile \
+ local/Makefile testing/Makefile
+
+configclean: makefileclean
+ rm -f config.cache config.status config.log \
+ libtool include/net-snmp/net-snmp-config.h \
+ net-snmp-config net-snmp-config-x configure-summary \
+ net-snmp-create-v3-user net-snmp-create-v3-user-x
+ rm -f mibs/.index
+ rm -f include/net-snmp/agent/mib_module_config.h \
+ include/net-snmp/agent/agent_module_config.h \
+ include/net-snmp/library/snmpv3-security-includes.h \
+ include/net-snmp/feature-details.h \
+ snmplib/snmpsm_init.h snmplib/snmpsm_shutdown.h \
+ snmplib/transports/snmp_transport_inits.h \
+ agent/mibgroup/agent_module_includes.h \
+ agent/mibgroup/agent_module_inits.h \
+ agent/mibgroup/agent_module_shutdown.h \
+ agent/mibgroup/agent_module_dot_conf.h \
+ agent/mibgroup/mib_module_includes.h \
+ agent/mibgroup/mib_module_inits.h \
+ agent/mibgroup/mib_module_shutdown.h \
+ agent/mibgroup/mib_module_dot_conf.h
+ rm -rf mk
+ rm -f *.core
+
+#
+# Configure script related targets
+#
+touchit:
+ touch configure include/net-snmp/net-snmp-config.h.in
+ touch config.status
+ touch stamp-h stamp-h.in
+
+Makefile: Makefile.in config.status Makefile.rules Makefile.top
+ @if test "x$(NOAUTODEPS)" = "x"; then \
+ echo "running config.status because the following file(s) changed:"; \
+ echo " $?"; \
+ ./config.status; \
+ else \
+ echo "WARNING: not running config.status"; \
+ fi
+
+configure_ac = configure.ac \
+ configure.d/config_modules_agent \
+ configure.d/config_modules_lib \
+ configure.d/config_os_functions \
+ configure.d/config_os_headers \
+ configure.d/config_os_libs1 \
+ configure.d/config_os_libs2 \
+ configure.d/config_os_misc1 \
+ configure.d/config_os_misc2 \
+ configure.d/config_os_misc3 \
+ configure.d/config_os_misc4 \
+ configure.d/config_os_progs \
+ configure.d/config_os_struct_members \
+ configure.d/config_project_ipv6_types \
+ configure.d/config_project_manual \
+ configure.d/config_project_paths \
+ configure.d/config_project_perl_python \
+ configure.d/config_project_types \
+ configure.d/config_project_with_enable
+
+$(srcdir)/include/net-snmp/net-snmp-config.h.in: stamp-h.in
+$(srcdir)/stamp-h.in: $(configure_ac) acconfig.h
+ @if test "x$(NOAUTODEPS)" = "x" -a "x$(AUTOHEADER)" != "x:"; then \
+ cd ${srcdir} && LC_COLLATE=C $(AUTOHEADER); \
+ echo timestamp > ${srcdir}/stamp-h.in; \
+ else \
+ echo "WARNING: not running autoheader"; \
+ fi
+
+include/net-snmp/net-snmp-config.h: stamp-h
+stamp-h: include/net-snmp/net-snmp-config.h.in config.status
+ @if test "x$(NOAUTODEPS)" = "x"; then \
+ echo "running config.status because the following file(s) changed:"; \
+ echo " $?"; \
+ ./config.status; \
+ echo timestamp > stamp-h; \
+ else \
+ echo "WARNING: not running config.status"; \
+ fi
+
+$(srcdir)/configure: $(configure_ac) aclocal.m4
+ @if test "x$(NOAUTODEPS)" = "x" -a "x$(AUTOCONF)" != "x:"; then \
+ cd ${srcdir} && $(AUTOCONF); \
+ echo "Please run configure now."; \
+ sh -c exit 2; \
+ else \
+ echo "WARNING: not running autoconf"; \
+ fi
+
+gendir=dist/generation-scripts
+generation-scripts: generation-scripts-dirs $(gendir)/gen-transport-headers $(gendir)/gen-security-headers
+
+$(gendir)/gen-variables: $(gendir)/gen-variables.in
+ ./config.status
+
+generation-scripts-dirs:
+ @if [ ! -d dist ] ; then \
+ mkdir dist ; \
+ fi
+ @if [ ! -d dist/generation-scripts ] ; then \
+ mkdir dist/generation-scripts ; \
+ fi
+
+$(gendir)/gen-transport-headers: $(gendir)/gen-transport-headers.in $(gendir)/gen-variables
+ rm -f $@
+ autoconf -o $@ $<
+ chmod a+x $@
+
+$(gendir)/gen-security-headers: $(gendir)/gen-security-headers.in $(gendir)/gen-variables
+ rm -f $@
+ autoconf -o $@ $<
+ chmod a+x $@
+
+config.status: configure
+ @if test "x$(NOAUTODEPS)" = "x"; then \
+ echo "running config.status because $? changed"; \
+ ./config.status --recheck; \
+ else \
+ echo "WARNING: not running config.status --recheck"; \
+ fi
+
+#
+# Emacs TAGS file
+#
+TAGS:
+ $(FIND) $(srcdir) -path $(srcdir)/dist/rpm -prune -o -name '*.[ch]' -print | etags -
+
+#
+# Internal distribution packaging, etc.
+#
+#tag:
+# @if test "x$(VERSION)" = "x"; then \
+# echo "you need to supply a VERSION string."; \
+# exit 2; \
+# fi
+# ${srcdir}/agent/mibgroup/versiontag $(VERSION) tag
+
+tar:
+ @if test "x$(VERSION)" = "x"; then \
+ echo "you need to supply a VERSION string."; \
+ exit 2; \
+ fi
+ ${srcdir}/agent/mibgroup/versiontag $(VERSION) tar
+
+tarclean:
+ @if test -x ${srcdir}/agent/mibgroup/versiontag ; then \
+ ${srcdir}/agent/mibgroup/versiontag Ext clean ; \
+ fi
+
+checks:
+ $(MAKE) -k makefilecheck commentcheck warningcheck dependcheck \
+ assertcheck perlcalloccheck
+
+dependcheck:
+ @echo "Checking for full paths in dependency files..."
+ @if grep -n -E "^/" `$(FIND) $(top_srcdir) -name Makefile.depend`; then false; fi
+
+warningcheck:
+ @echo "Checking for cpp warnings..."
+ @if grep -n "#warning" `$(FIND) $(top_srcdir) -name \*.\[ch\]`; then false; fi
+
+assertcheck:
+ @echo "Checking for non-snmp asserts..."
+ @if grep -n -w "assert" `$(FIND) $(top_srcdir) -name \*.\[ch\] | grep -v snmp_assert.h | egrep -v 'perl/.*c' | grep -v openssl`; then false; fi
+
+commentcheck:
+ @echo "Checking for C++ style comments..."
+ @if grep -n -E "([^:)n]|^)//" `$(FIND) $(top_srcdir) -path './win32' -prune -o -name \*.\[ch\] | grep -v agent/mibgroup/winExtDLL.c`; then false; fi
+
+makefilecheck:
+ @echo "Checking for non-portable Makefile constructs..."
+ @if grep -n "\.c=" `$(FIND) $(top_srcdir) -name .svn -prune -o -path ./Makefile.in -prune -o -name "Makefile.*" -print`; then false; fi
+
+# Invoking calloc() directly or indirectly from a Perl XSUB and freeing that
+# memory by calling free() from the XSUB is a sure way to trigger "Free to
+# wrong pool" errors on Windows.
+perlcalloccheck:
+ @echo "Checking for calloc() in Perl's external subroutines ..."
+ @if grep -nwE 'calloc|SNMP_MALLOC_STRUCT|SNMP_MALLOC_TYPEDEF' `$(FIND) $(top_srcdir) -name '*.xs'`; then false; fi
+
+dist: tar
+
+FAQ.html:
+ local/FAQ2HTML FAQ
+
+.PHONY: docs docsdir mancp testdirs test TAGS
+# note: tags and docs are phony to force rebulding
+.PHONY: snmplib agent apps \
+ snmpget snmpbulkget snmpwalk snmpbulkwalk snmptranslate snmpstatus \
+ snmpdelta snmptable snmptest snmpset snmpusm snmpvacm snmpgetnext \
+ encode_keychange snmpdf snmptrap snmptrapd
+.PHONY: perlfeatures pythonfeatures
diff --git a/Makefile.rules b/Makefile.rules
new file mode 100644
index 0000000..9e9e900
--- /dev/null
+++ b/Makefile.rules
@@ -0,0 +1,475 @@
+
+#
+# standard target definitions. Set appropriate variables to make use of them.
+#
+# note: the strange use of the "it" variable is for shell parsing when
+# there is no targets to install for that rule.
+#
+
+# the standard items to build: libraries, bins, and sbins
+STANDARDTARGETS =$(INSTALLLIBS) $(INSTALLBINPROGS) $(INSTALLSBINPROGS)
+STANDARDCLEANTARGETS=$(INSTALLLIBS) $(INSTALLPOSTLIBS) $(INSTALLBINPROGS) $(INSTALLSBINPROGS) $(INSTALLUCDLIBS)
+
+standardall: subdirs $(STANDARDTARGETS)
+
+objs: ${OBJS} ${LOBJS}
+
+# features require that subdirs be made *first* to get dependency
+# collection processed in the right order
+.PHONY: features ftobjs ftsubdirs
+features: $(FTOTHERTARGS) ftsubdirs ftobjs $(FEATUREFILE)
+ftobjs: $(FTOBJS)
+$(FEATUREFILE): $(FTOBJS) $(top_builddir)/include/net-snmp/feature-details.h
+ cat $(FTOBJS) > $(FEATUREFILE).in
+ $(FEATUREPROCESS) $(FEATUREFILE) $(top_builddir)/include/net-snmp/feature-details.h @FEATURE_REMOVE_FLAGS@ @FEATURE_ADD_FLAGS@
+ftsubdirs:
+ @if test "$(FTSUBDIRS)" != ""; then \
+ SUBDIRS="$(FTSUBDIRS)" ; \
+ else \
+ SUBDIRS="$(SUBDIRS)" ; \
+ fi ; \
+ if test "$$SUBDIRS" != ""; then \
+ it="$$SUBDIRS" ; \
+ for i in $$it ; do \
+ echo "making features in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) features ) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+.PHONY: cleanfeatures cleanfeaturessubdirs
+cleanfeatures: cleanfeaturessubdirs
+ rm -f $(FTOBJS)
+ rm -f $(FEATUREFILE)
+ rm -f $(top_builddir)/include/net-snmp/feature-details.h
+
+cleanfeaturessubdirs:
+ @if test "$(FTSUBDIRS)" != ""; then \
+ SUBDIRS="$(FTSUBDIRS)" ; \
+ else \
+ SUBDIRS="$(SUBDIRS)" ; \
+ fi ; \
+ if test "$$SUBDIRS" != ""; then \
+ it="$$SUBDIRS" ; \
+ for i in $$it ; do \
+ echo "making cleanfeatures in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) cleanfeatures ) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+# feature-check definitions
+.SUFFIXES: .ft
+.c.ft:
+ @test -f $(top_builddir)/include/net-snmp/feature-details.h || \
+ echo "/* Generated by make. Do not modify directly */" \
+ > $(top_builddir)/include/net-snmp/feature-details.h
+ $(FEATURECHECK) --feature-global $(top_builddir)/include/net-snmp/feature-details.h $(mysubdir) $< $@ $(CC) -E $(CPPFLAGS) $(CFLAGS) -c
+
+subdirs:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making all in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) ) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+# installlibs handles local, ucd and subdir libs. need to do subdir libs
+# before bins, sinze those libs may be needed for successful linking
+install: installlocalheaders @installucdheaders@ \
+ installlibs \
+ installlocalbin installlocalsbin \
+ installsubdirs $(OTHERINSTALL)
+
+uninstall: uninstalllibs uninstallbin uninstallsbin uninstallheaders \
+ uninstallsubdirs $(OTHERUNINSTALL)
+
+installprogs: installbin installsbin
+
+#
+# headers
+#
+# set INSTALLHEADERS to a list of things to install in each makefile.
+# set INSTALLBUILTINCLUDEHEADERS a list built and placed into include/net-snmp/
+# set INSTALLBUILTHEADERS to a list of things to install from builddir
+# set INSTALLSUBDIRHEADERS and INSTALLSUBDIR to subdirectory headers
+# set INSTALLSUBDIRHEADERS2 and INSTALLSUBDIR2 to more subdirectory headers
+# set INSTALLBUILTSUBDIRHEADERS and INSTALLBUILTSUBDIR to a list from builddir
+#
+installheaders: installlocalheaders @installucdheaders@ installsubdirheaders
+
+installlocalheaders:
+ @if test "$(INSTALLBUILTINCLUDEHEADERS)" != "" ; then \
+ echo creating directory $(INSTALL_PREFIX)$(includedir) ; \
+ it="$(INSTALLBUILTINCLUDEHEADERS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/library ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/agent ; \
+ for i in $$it ; do \
+ $(INSTALL_DATA) include/net-snmp/$$i $(INSTALL_PREFIX)$(includedir)/$$i ; \
+ echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$$i" ; \
+ done \
+ fi
+ @if test "$(INSTALLHEADERS)" != "" ; then \
+ echo creating directory $(INSTALL_PREFIX)$(includedir) ; \
+ it="$(INSTALLHEADERS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir) ; \
+ for i in $$it ; do \
+ $(INSTALL_DATA) $(top_srcdir)/include/net-snmp/$$i $(INSTALL_PREFIX)$(includedir) ; \
+ echo "installing $$i in $(INSTALL_PREFIX)$(includedir)" ; \
+ done \
+ fi
+ @if test "$(INSTALLBUILTHEADERS)" != "" ; then \
+ echo creating directory $(INSTALL_PREFIX)$(includedir) ; \
+ it="$(INSTALLBUILTHEADERS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir) ; \
+ for i in $$it ; do \
+ $(INSTALL_DATA) $$i $(INSTALL_PREFIX)$(includedir) ; \
+ echo "installing $$i in $(INSTALL_PREFIX)$(includedir)" ; \
+ done \
+ fi
+ @if test "$(INCLUDESUBDIRHEADERS)" != "" ; then \
+ echo creating directory $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR) ; \
+ it="$(INCLUDESUBDIRHEADERS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR) ; \
+ for i in $$it ; do \
+ $(INSTALL_DATA) $(top_srcdir)/include/net-snmp/$(INCLUDESUBDIR)/$$i $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR) ; \
+ echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR)" ; \
+ done \
+ fi
+ @if test "$(INCLUDESUBDIRHEADERS2)" != "" ; then \
+ echo creating directory $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2) ; \
+ it="$(INCLUDESUBDIRHEADERS2)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2) ; \
+ for i in $$it ; do \
+ $(INSTALL_DATA) $(top_srcdir)/include/net-snmp/$(INCLUDESUBDIR2)/$$i $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2) ; \
+ echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2)" ; \
+ done \
+ fi
+ @if test "$(INSTALLBUILTSUBDIRHEADERS)" != "" ; then \
+ echo creating directory $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR) ; \
+ it="$(INSTALLBUILTSUBDIRHEADERS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR) ; \
+ for i in $$it ; do \
+ $(INSTALL_DATA) $$i $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR) ; \
+ echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR)" ; \
+ done \
+ fi
+
+installucdheaders:
+ @if test "$(INSTALLUCDHEADERS)" != "" ; then \
+ echo creating directory $(INSTALL_PREFIX)$(ucdincludedir) ; \
+ it="$(INSTALLUCDHEADERS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(ucdincludedir) ; \
+ for i in $$it ; do \
+ $(INSTALL_DATA) $(top_srcdir)/include/ucd-snmp/$$i $(INSTALL_PREFIX)$(ucdincludedir) ; \
+ echo "installing $$i in $(INSTALL_PREFIX)$(ucdincludedir)" ; \
+ done \
+ fi
+
+installsubdirheaders:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making installheaders in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) installheaders) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+uninstallheaders:
+ @if test "$(INSTALLHEADERS)" != "" ; then \
+ it="$(INSTALLHEADERS)" ; \
+ for i in $$it ; do \
+ rm -f $(INSTALL_PREFIX)$(includedir)/$$i ; \
+ echo "removing $$i from $(INSTALL_PREFIX)$(includedir)" ; \
+ done \
+ fi
+ @if test "$(INSTALLBUILTHEADERS)" != "" ; then \
+ it="$(INSTALLBUILTHEADERS)" ; \
+ for i in $$it ; do \
+ rm -f $(INSTALL_PREFIX)$(includedir)/`basename $$i` ; \
+ echo "removing $$i from $(INSTALL_PREFIX)$(includedir)" ; \
+ done \
+ fi
+ @if test "$(INCLUDESUBDIRHEADERS)" != "" ; then \
+ it="$(INCLUDESUBDIRHEADERS)" ; \
+ for i in $$it ; do \
+ rm -f $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR)/$$i ; \
+ echo "removing $$i from $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR)" ; \
+ done \
+ fi
+ @if test "$(INCLUDESUBDIRHEADERS2)" != "" ; then \
+ it="$(INCLUDESUBDIRHEADERS2)" ; \
+ for i in $$it ; do \
+ rm -f $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2)/$$i ; \
+ echo "removing $$i from $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2)" ; \
+ done \
+ fi
+ @if test "$(INSTALLBUILTSUBDIRHEADERS)" != "" ; then \
+ it="$(INSTALLBUILTSUBDIRHEADERS)" ; \
+ for i in $$it ; do \
+ rm -f $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR)/`basename $$i` ; \
+ echo "removing $$i from $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR)" ; \
+ done \
+ fi
+
+#
+# libraries
+#
+# set INSTALLLIBS to a list of things to install in each makefile.
+#
+installlibs: installlocallibs @installucdlibs@ installsubdirlibs installpostlibs
+
+installlocallibs: $(INSTALLLIBS)
+ @if test "$(INSTALLLIBS)" != ""; then \
+ it="$(INSTALLLIBS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir) ; \
+ $(INSTALL) $(INSTALLLIBS) $(INSTALL_PREFIX)$(libdir) ; \
+ for i in $$it ; do \
+ echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
+ $(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
+ done ; \
+ $(LIB_LDCONFIG_CMD) ; \
+ fi
+
+installpostlibs: $(INSTALLPOSTLIBS)
+ @if test "$(INSTALLPOSTLIBS)" != ""; then \
+ it="$(INSTALLPOSTLIBS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir) ; \
+ $(INSTALL) $(INSTALLPOSTLIBS) $(INSTALL_PREFIX)$(libdir) ; \
+ for i in $$it ; do \
+ echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
+ $(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
+ done ; \
+ $(LIB_LDCONFIG_CMD) ; \
+ fi
+
+installucdlibs: $(INSTALLUCDLIBS)
+ @if test "$(INSTALLUCDLIBS)" != ""; then \
+ it="$(INSTALLUCDLIBS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir) ; \
+ $(INSTALL) $(INSTALLUCDLIBS) $(INSTALL_PREFIX)$(libdir) ; \
+ for i in $$it ; do \
+ echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
+ $(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
+ done ; \
+ $(LIB_LDCONFIG_CMD) ; \
+ fi
+
+installsubdirlibs:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making installlibs in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) installlibs) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+uninstalllibs:
+ @if test "$(INSTALLLIBS)" != ""; then \
+ it="$(INSTALLLIBS)" ; \
+ for i in $$it ; do \
+ $(UNINSTALL) $(INSTALL_PREFIX)$(libdir)/$$i ; \
+ echo "removing $$i from $(INSTALL_PREFIX)$(libdir)"; \
+ done \
+ fi
+
+#
+# normal bin binaries
+#
+# set INSTALLBINPROGS to a list of things to install in each makefile.
+#
+installbin: installlocalbin installsubdirbin
+
+installlocalbin: $(INSTALLBINPROGS)
+ @if test "$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" != " "; then \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(bindir) ; \
+ it="$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" ; \
+ $(INSTALL) $(INSTALLBINPROGS) $(INSTALLBINSCRIPTS) $(INSTALL_PREFIX)$(bindir) ; \
+ for i in $$it ; do \
+ echo "installing $$i in $(INSTALL_PREFIX)$(bindir)"; \
+ done \
+ fi
+
+installsubdirbin:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making installbin in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) installbin) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+uninstallbin:
+ @if test "$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" != " "; then \
+ it="$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" ; \
+ for i in $$it ; do \
+ $(UNINSTALL) $(INSTALL_PREFIX)$(bindir)/$$i ; \
+ echo "removing $$i from $(INSTALL_PREFIX)$(bindir)"; \
+ done \
+ fi
+
+#
+# sbin binaries
+#
+# set INSTALLSBINPROGS to a list of things to install in each makefile.
+#
+installsbin: installlocalsbin installsubdirsbin
+
+installlocalsbin: $(INSTALLSBINPROGS)
+ @if test "$(INSTALLSBINPROGS)" != ""; then \
+ it="$(INSTALLSBINPROGS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(sbindir) ; \
+ $(INSTALL) $(INSTALLSBINPROGS) $(INSTALL_PREFIX)$(sbindir) ; \
+ for i in $$it ; do \
+ echo "installing $$i in $(INSTALL_PREFIX)$(sbindir)"; \
+ done \
+ fi
+
+installsubdirsbin:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making installsbin in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) installsbin) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+uninstallsbin:
+ @if test "$(INSTALLSBINPROGS)" != ""; then \
+ it="$(INSTALLSBINPROGS)" ; \
+ for i in $$it ; do \
+ $(UNINSTALL) $(INSTALL_PREFIX)$(sbindir)/$$i ; \
+ echo "removing $$i from $(INSTALL_PREFIX)$(sbindir)"; \
+ done \
+ fi
+
+#
+# general make install target for subdirs
+#
+installsubdirs:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making install in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) install) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+uninstallsubdirs:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making uninstall in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) uninstall) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+#
+# cleaning targets
+#
+clean: cleansubdirs $(OTHERCLEANTODOS)
+ $(LIBTOOLCLEAN) ${OBJS} ${LOBJS} ${FTOBJS} core $(STANDARDCLEANTARGETS) $(OTHERCLEANTARGETS)
+
+cleansubdirs:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making clean in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) clean) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+lint:
+ lint -nhx $(CSRCS)
+
+#
+# wacky dependency building.
+#
+depend: dependdirs
+ @if test -f Makefile.depend ; then \
+ makedepend `echo $(CPPFLAGS) | sed 's/-f[-a-z]*//g'` -o .lo $(srcdir)/*.c $(srcdir)/*/*.c ; \
+ fi
+
+
+nosysdepend: nosysdependdirs
+ @if test -f Makefile.depend ; then \
+ makedepend `echo $(CPPFLAGS) | sed 's/-f[-a-z]*//g'` -o .lo $(srcdir)/*.c $(srcdir)/*/*.c ; \
+ $(PERL) -n -i.bak $(top_srcdir)/makenosysdepend.pl Makefile ; \
+ fi
+
+distdepend: nosysdepend distdependdirs
+ @if test -f Makefile.depend ; then \
+ $(PERL) $(top_srcdir)/makefileindepend.pl ; \
+ fi
+
+dependdirs:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making depend in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) depend) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+nosysdependdirs:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making nosysdepend in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) nosysdepend) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+distdependdirs:
+ @if test "$(SUBDIRS)" != ""; then \
+ it="$(SUBDIRS)" ; \
+ for i in $$it ; do \
+ echo "making distdepend in `pwd`/$$i"; \
+ ( cd $$i ; $(MAKE) distdepend) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi \
+ done \
+ fi
+
+# These aren't real targets, let gnu's make know that.
+.PHONY: clean cleansubdirs lint \
+ install installprogs installheaders installlibs \
+ installbin installsbin installsubdirs \
+ all subdirs standardall objs features \
+ depend nosysdepend distdepend dependdirs nosysdependdirs distdependdirs
diff --git a/Makefile.top b/Makefile.top
new file mode 100644
index 0000000..862fb94
--- /dev/null
+++ b/Makefile.top
@@ -0,0 +1,120 @@
+#
+# Minimum environment and virtual path setup
+#
+SHELL = @SHELL@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VERSION = @VERSION@
+@SET_MAKE@
+
+#
+# Paths
+#
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+sbindir = @sbindir@
+libdir = @libdir@
+datarootdir = @datarootdir@
+datadir = @datadir@
+includedir = @includedir@/net-snmp
+ucdincludedir = @includedir@/ucd-snmp
+mandir = @mandir@
+man1dir = $(mandir)/man1
+man3dir = $(mandir)/man3
+man5dir = $(mandir)/man5
+man8dir = $(mandir)/man8
+snmplibdir = $(datadir)/snmp
+mibdir = $(snmplibdir)/mibs
+persistentdir = @PERSISTENT_DIRECTORY@
+DESTDIR = @INSTALL_PREFIX@
+INSTALL_PREFIX = $(DESTDIR)
+
+#
+# Programs
+#
+INSTALL = $(LIBTOOL) --mode=install @INSTALL@
+UNINSTALL = $(LIBTOOL) --mode=uninstall rm -f
+LIBTOOLCLEAN = $(LIBTOOL) --mode=clean rm -f
+FEATURECHECK = $(top_srcdir)/local/minimalist/feature-check
+FEATUREPROCESS = $(top_srcdir)/local/minimalist/feature-remove
+INSTALL_DATA = @INSTALL_DATA@
+SED = @SED@
+LN_S = @LN_S@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+PERL = @PERLPROG@
+PYTHON = @PYTHONPROG@
+FIND = @FIND@
+
+#
+# Compiler arguments
+#
+CFLAGS = @CFLAGS@ @DEVFLAGS@
+EXTRACPPFLAGS = @EXTRACPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBTOOL = @LIBTOOL@ @LIBTOOLFLAGS@
+EXEEXT = @EXEEXT@
+
+# Misc Compiling Stuff
+CC = @CC@
+LINKCC = @LINKCC@
+
+# use libtool versioning the way they recommend.
+# The (slightly clarified) rules:
+#
+# - If any interfaces/structures have been removed or changed since the
+# last update, increment current (+5), and set age and revision to 0. Stop.
+#
+# - If any interfaces have been added since the last public release, then
+# increment current and age, and set revision to 0. Stop.
+#
+# - If the source code has changed at all since the last update,
+# then increment revision (c:r:a becomes c:r+1:a).
+#
+# Note: maintenance releases (eg 5.2.x) should never have changes
+# that would require a current to be incremented.
+#
+# policy: we increment major releases of LIBCURRENT by 5 starting at
+# 5.3 was at 10, 5.4 is at 15, ... This leaves some room for needed
+# changes for past releases if absolutely necessary.
+#
+LIBCURRENT = 30
+LIBAGE = 0
+LIBREVISION = 2
+
+LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o
+LIB_EXTENSION = la
+LIB_VERSION =
+LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(INSTALL_PREFIX)$(libdir)
+LINK = $(LIBTOOL) --mode=link $(LINKCC)
+# RANLIB = @RANLIB@
+RANLIB = :
+
+# libtool definitions
+.SUFFIXES: .c .o .lo .rc
+.c.lo:
+ $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+.rc.lo:
+ $(LIBTOOL) --mode=compile --tag=CC windres -o $@ -i $<
+
+# include paths
+#
+SRC_TOP_INCLUDES = -I$(top_srcdir)/include
+SRC_SNMPLIB_INCLUDES = -I$(top_srcdir)/snmplib
+SRC_AGENT_INCLUDES = -I$(top_srcdir)/agent
+SRC_HELPER_INCLUDES = -I$(top_srcdir)/agent/helpers
+SRC_MIBGROUP_INCLUDES = -I$(top_srcdir)/agent/mibgroup
+
+BLD_TOP_INCLUDES = -I$(top_builddir)/include $(SRC_TOP_INCLUDES)
+BLD_SNMPLIB_INCLUDES = -I$(top_builddir)/snmplib $(SRC_SNMPLIB_INCLUDES)
+BLD_AGENT_INCLUDES = -I$(top_builddir)/agent $(SRC_AGENT_INCLUDES)
+BLD_HELPER_INCLUDES = -I$(top_builddir)/agent/helpers $(SRC_HELPER_INCLUDES)
+BLD_MIBGROUP_INCLUDES = -I$(top_builddir)/agent/mibgroup $(SRC_MIBGROUP_INCLUDES)
+
+TOP_INCLUDES = $(@TOP_INCLUDES@)
+SNMPLIB_INCLUDES = $(@SNMPLIB_INCLUDES@)
+AGENT_INCLUDES = $(@AGENT_INCLUDES@)
+HELPER_INCLUDES = $(@HELPER_INCLUDES@)
+MIBGROUP_INCLUDES = $(@MIBGROUP_INCLUDES@)
+
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..a67da8b
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,1672 @@
+This file contains a summary of the major changes in released revisions.
+Please see the CHANGES file for a more detailed list of specific bugs/patches
+that have been fixed/applied, and the ChangeLog file for a comprehensive
+listing of all changes made to the code.
+
+*5.7.2*
+ snmp:
+ - BUG: 3526549: CVE-2012-2141 Array index error leading to crash
+
+ snmpd:
+ - BUG: 3532090: Fix high ifIndex values crashing hrDeviceDescr
+
+ building:
+ - PATCH: 2091156: correctly declare dependencies in Makefile. 'make
+ -j <N>' should work now. Backport this to V5-4 as it is needed for
+ correct operation in the single threaded case of make miblib as
+ well.
+
+ Many other miscellaneous minor bug fixes
+
+*5.7.1*
+
+ libnetsnmp:
+ - Fixed the mib-parsing-bug introduced shortly before 5.7
+
+ agent:
+ - fixed rounding errors for disk percentage calculations
+
+ openbsd:
+ - better support for recent openbsd releases
+
+ features:
+ - bug fixes with minimalist support after additional user feedback
+
+ Many other miscellaneous minor bug fixes
+
+*5.7*
+
+ snmpd:
+ - Delivery of data via regularily scheduled notifications.
+ (see "Data Delivery via Notfications" in snmpd.conf)
+ - Many time-based config options can take (m)ins, (h)ours, ... arguments
+ (see the snmpd.conf manual page)
+ - The PING and TRACEROUTE MIBs now compile and work-ish on linux
+ http://www.net-snmp.org/wiki/index.php/DISMAN
+ - Mib handlers can now implement a data_clone function for
+ cloning the myvoid structure variable to avoid dangling pointers
+ - Fixed persistent storage of VACM MIB configuration
+ - Multi-homed agents send UDP responses from the proper IP address
+ - The hrStorageTable implementation now supports large filesystems better
+ - optimizations for large route tables
+ - Added a deliveryByNotify config token for regular data delivery
+ (see the snmpd.conf manual page and the NET-SNMP-PERIODIC-NOTIFY-MIB)
+ - [PATCH 3141462]: fix agentx subagent issues with multiple-object requests
+ - [PATCH 3057093]: linux uses libpci for creating useful ifDescr strings
+ - [PATCH 3131397]: huge speedups of the TCP/UDP Tables
+
+ libnetsnmp:
+ - Removed the older CMU compatibility support
+ - The SSH transport is now configurable
+
+ TLS/DTLS support:
+ - The SNMP over DTLS transport now properly supports IPv6
+ - Introduced new configuration tokens: localCert/peerCert
+ (deprecating serverCert, clientCert, defX509ServerPub, defX509ClientPub)
+ - Various fixes for the TLS/DTLS transports
+
+ apps:
+ - Added a per-variable timed output support to snmpwalk using -CT
+ - snmpinform now correctly uses the local engineID for informs
+ - A number of mib2c bug fixes
+ - New snmp.conf tokens for timeouts and retries
+
+ building:
+ - New flags to reduce the amount of compiled code to bare minimums.
+ This is provided by a new generic feature marking/selection mechanism.
+ http://www.net-snmp.org/wiki/index.php/Feature_Marking_and_Selection
+ - It's now possible to build without SNMPv3/USM
+ (e.g., if you only want TLS/DTLS with SNMPv3/TSM)
+ - It's possible to build the suite with no SET support
+ configure using --enable-read-only
+ - It's possible to build the agent as a notify-only agent
+ configure using --enable-notify-only
+ - Added a script to test memory usage with various config options
+ (see the local/minimalist/sizetests script)
+ - Net-SNMP can now be built to perform local DNSSEC validation
+ (install DNSSEC-Tools' libval and use --with-local-dnssec-validation)
+
+ testing:
+ - a number of new API unit-tests have been added to the suite
+ (to run the tests: cd testing && ./RUNFULLTESTS -g unit-tests)
+ - The unit tests can be more easily run under valgrind
+ (See http://bit.ly/jsgRnv for details)
+
+ openbsd:
+ - Support for updating the routing table via SNMP
+
+ win32:
+ - The testing suite works better under win32 environments
+ - Many building fixes for the win32 environment(s)
+
+ solaris:
+ - Net-SNMP now supports the SCTP-MIB
+
+ DragonFlyBSD, FreeBSD8:
+ - Net-SNMP should now work on DragonFlyBSD and FreeBSD8
+
+ And of course:
+ - Many other bug fixes. See the CHANGES and ChangeLog for details.
+
+*5.6*
+
+ all:
+ - Implemented the SNMP over TLS and SNMP over DTLS protocols [RFC-to-be]
+ See http://www.net-snmp.org/wiki/index.php/TUT:Using_TLS
+ - Implemented the "Transport Security Model" [RFC5591]
+ - Generic host-specific configuration .conf files are now read.
+ See the HOST-SPECIFIC FILES section of the snmp.conf manual page
+ and http://www.net-snmp.org/wiki/index.php/Configuration
+ - Include statements can now be used in .conf files.
+ See http://www.net-snmp.org/wiki/index.php/Configuration
+
+ snmpd:
+ - Fix handling of multiple matching VACM entries. (Use the "best"
+ match, rather than the first one). Reported by Adam Lewis. Note
+ that this could potentially affect the behaviour of existing access
+ control configurations.
+ - Agent will no longer call table handlers if a set request for the
+ handler has invalid indexes
+ - table_data/tdata next handler will not be called during get
+ processing if no valid rows are found for the handler
+ - [PATCH 2952708]: Added Perl implementation of BRIDGE-MIB
+ - moved all functions defined in libnetsnmphelpers to
+ libnetsnmpagent. libnetsnmphelpers is now an empty library.
+ - Implemented the TSM-MIB and the TLSTM-MIB
+ - new API for indicating that persistent store needs to be saved
+ after the current request finishes processing
+ - [PATCH 2931446]: make the load averages writable.
+
+ apps:
+ - A new tool 'net-snmp-cert' that easily creates and manages
+ X.509 certificates for use with the SNMP over (D)TLS protocols.
+ - Added an 'agentxtrap' command to send notifications via AgentX
+ (See http://www.net-snmp.org/wiki/index.php/TUT:agentxtrap for details)
+ - -T command line flag can be used to pass configuration
+ directly to transports that can accept configuration tokens
+ - A new 'snmptls' command for manipulating the agent's TLS configuration
+
+ snmplib:
+ - A more modular transport subsystem that allows third party
+ extensions and dependencies for code reuse.
+ - New transport functions: f_config, f_open, f_copy and f_setup_session
+ - Transports can now specify session defaults
+ - E.G. dtlsudp: auto-sets the SNMP version and the security model.
+ - [PATCH 2942940]: Add a new function, netsnmp_parse_args, that is
+ like snmp_parse_args but takes an additional bitmask, flags, to
+ affect the behaviour. Also remove the magic handling of some
+ application names.
+ - A new X.509 certificate API for indexing and reading certificates
+ - new experimental row creation API which uses a state machine
+ to try really hard to create a row from a given varbind list
+ - netsnmp_container enhancements:
+ - added a free_item function
+ - added a CONTAINER_FREE_ALL macro/function
+ - added an interface for duplicating a container (CONTAINER_DUP)
+ - added a remove function to container_iterators
+ - added an ability to set options on binary_array containers
+ - new snmp token logOption allows specifying log destinations
+ via configuration conf files
+ - A very significant reduction in compiler warning output
+ - new experimental simple state machine handling API
+
+ building:
+ - Support for a stream-line stripped down version of internal
+ OpenSSL support using --with-openssl=internal.
+ - Do not require that the UDP transport is included.
+ - Building Net-SNMP with dmalloc support enabled is again possible.
+
+ mib2c:
+ - mib2c can now optionally run sed on generated code
+
+ testing:
+ - A brand new test infrastructure supporting multiple test suites
+ See perldoc testing/RUNFULLTESTS for details
+
+ python:
+ - walking broken agents won't cause an infinite loop
+
+ win32:
+ - IPv6 is only supported under Cygwin 1.7 or later.
+ - [BUG 2939168]: byte order of udpLocalPort is now correct.
+ - [BUG 2939168]: fixed test infrastructure ("make test"). This has
+ been fixed by using the proper environment separator character and
+ by adding the path of the netstat executable for Cygwin in
+ testing/TESTCONF.sh.
+ - building with another OpenSSL package than the Cygwin-provided
+ packages openssl and openssl-devel is again possible.
+ - running the regression test suite is again possible ('make test').
+ - winExtDLL compiles now under MinGW.
+ - the snmpd.conf keyword 'extend' is now supported under MinGW
+ - the snmptrapd.conf keyword traphandle is now supported under MinGW
+
+ qnx6:
+ - [PATCH 2836895]: support for QNX6
+
+*5.5*
+
+ All applications:
+ - Added the ability to "alias" transports to a more simple name
+ (see the "alias" keyword in the snmp.conf manual page)
+ - The -t (timeout) switch will accept floating point numbers (eg: .1)
+
+ snmpd:
+ - [BUG 1712988]: default/configurable max # varbinds returned by GETBULK
+ - [PATCH 1585146]: Extend range of available error codes
+ - [PATCH 1654424]: Handle row deletion issues in dataset tables
+ - [PATCH 1666737]: Include IPv6 traffic in various UDP counters
+ - [PATCH 1700157]: Fix ordering of exec tokens in MIB output
+ - [PATCH 1719253]: fix skipNFSInHostResources for multiple walks
+ - [PATCH 1723611]: New implementation of the RMON alarmTable
+ - [PATCH 1737439]: automatic link up/down traps on a walk
+ - [PATCH 1806501]: Add API for sending traps with a snmpv3 context
+ - [PATCH 1882621]: Add LVM support to the partition table
+ - [PATCH 1893468]: fixed registration of OIDs with ranges
+ - [PATCH 1901764]: Support date-based logwatch files
+ - [PATCH 1909813]: fix table_iterator handling of SORTED hint
+ - [PATCH 1916840]: new config option to set SNMPv1 trap agent address
+ - [PATCH 2103492]: implement RMON-MIB::etherStatsJabbers
+ - [PATCH 2449210]: add 64-bit usage statistics to UCD-SNMP-MIB::dskTable
+ - Add support for a user provided length variable
+ and C string values to the watcher helper.
+ - Automatically reregister sysORTable entries from AgentX subagents.
+ - Fix various memory leaks
+ - Implement ipAddressSpinLock
+ - Implement ipNetToPhysicalLastUpdated
+ - Suppress annoying "registration != duplicate" warning for root oids
+
+ snmptrapd:
+ - [PATCH 1908288]: Run perl END block on termination
+ - Add trap handler for logging traps to a mysql database
+ - Withdraw deprecated options.
+
+ snmpnetstat:
+ - [PATCH 2564538]: Support GETBULK in v2c+ snmp versions
+
+ snmpusm:
+ - [PATCH 1591355]: Allow cloning to arbitrary engineIDs
+
+ snmplib:
+ - [BUG 1619827]: Improve handling of link dependencies
+ - [PATCH 700681]: limited support for UDPv4 broadcast addresses
+ - [PATCH 1882069]: Add token for specifying an exact SNMPv3 engineID
+ - Fix assorted memory leaks
+ - Implemented RFC5343 contextEngineID probing.
+ - Support for the TSM security model for use with tunneling
+
+ misc:
+ - Add config reread support to "net-snmp-config --compile-subagent" code
+ - Preliminary (alpha) support for SNMP over SSH and DTLS/UDP.
+ - Preliminary (alpha) support for the TSM security model
+ - Separate user management into new net-snmp-create-v3-user script
+
+ building:
+ - Improved cross-compilation support
+ - Improved library layering & dependency handling when linking apps
+ - Improved RPM spec files, for consistency with vendor-provided packages.
+ - Mechanism for selecting build environment based on version
+ - New test scripts to test Net-SNMP transport functionality
+ - Restructure configure template
+ - Update to autoconf 2.63 & libtool 2.2.6
+
+ perl:
+ - [BUG 1619827]: improve handling of link dependencies
+ - [PATCH 1956193]: beta threadable perl module code for SNMPv1/2c usage.
+
+ python:
+ - [PATCH 1716114]: Let python build in source tree (Debian patch #38)
+
+ Linux:
+ - [PATCH 1704105]: Add IPv6 support to the inetNetToMediaTable
+ - [PATCH 1705594]: Various fixes to ipAddressPrefixTable reporting
+ - [PATCH 1708243]: Implement ipDefaultRouteTable
+ - [PATCH 1715405]: Implement ipv6ScopeZoneIndexTable
+ - [PATCH 1724602]: MfD-based ipDefaultRouterTable implementation
+ - [PATCH 1828602]: Support ipDefaultTTL and ipForwarding SETs
+ - [PATCH 1927751]: Implement icmpMsgStatsTable
+ - [PATCH 2023633]: Implement SCTP-MIB
+ - [PATCH 2053273]: Implement EtherLike MIB
+
+ AIX:
+ - Add support for AIX 6.x
+ - Fix default shared library building instead of forcing static
+
+ FreeBSD:
+ - [BUG 1633483]: Support CPU HAL on FreeBSD4.x
+ - [PATCH 1623874]: add GNU/kFreeBSD support
+
+ IRIX:
+ - [PATCH 1709748]: Optimized IRIX cpu stats
+ - [PATCH 1675869]: CPU statistics for IRIX based on PCP
+
+ MacOSX:
+ - [PATCH 1600522]: CPU HAL implementation for mach/darwin
+
+ Solaris:
+ - [PATCH 1719730]: support for ipSystemStatsTable and ipAddressTable
+
+ Win32:
+ - [PATCH 2686248]: Fix several winExtDLL bugs.
+ - [PATCH 1706344]: Fix compilation with cygwin
+ - Fix AES support
+
+
+*5.4*
+
+ Important Changes:
+ - The default configuration now enables embedded Perl and the Perl
+ modules by default when possible unless explicitly disabled. You
+ may use the --disable-embedded-perl and --without-perl-modules
+ configure options, respectively, to revert to the former default
+ configuration.
+
+ New:
+ python:
+ - Python bindings to the Net-SNMP project are now available in
+ the python sub-directory. See the README file there for details.
+
+ build:
+ - Some preliminary support for automatic building of dynamically
+ loadable mib module code.
+ - Most net-snmp specific defines are now (also) available under
+ a proper NETSNMP_ prefix. The older, potentially conflicting
+ names as well as the autoconf variables can now be turned off
+ easily within 3rd party code.
+ - libtool update to 1.5.22
+ - enable-as-needed will try to link built libraries against needed
+ libraries at library link time, rather than application link time.
+ This is preliminary support for what will likely be better in 5.5.
+
+ snmplib:
+ - [PATCH 1282566]: to rework transport creation to allow for
+ alternative interpretations of the address and a more flexible
+ transport registration system
+ - [PATCH 1509943]: responses will get sent from the original dest IP
+ address when possible.
+
+ snmpd:
+ - new MIB table for managing Net-SNMP access control extensions
+ (see NET-SNMP-VACM-MIB). These extensions to the VACM MIB are
+ Net-SNMP specific and are used primarily by snmptrapd at this point.
+ - [PATCH 1550725]: A new uint instance helper to match the existing
+ int, long and ulong helpers
+ - [PATCH 1534877]: to add support for skipping NFS entries in the
+ host resources hrStorageTable. See the skipNFSInHostResources
+ token in the snmpd.conf file for details.
+ - A "hardware abstraction layer", to localise the O/S-specific
+ aspects of retrieving system data. This first appeared in the
+ 5.3.x line, but this release now starts to actively use it for
+ implementing particular MIB modules.
+ This has resulted in some minor changes in behaviour - some index
+ values in the hrStorageTable have changed from earlier releases,
+ and the (non-raw) memory statistics are now consistent, reporting
+ percentage usage calculated over the last minute on _all_ systems.
+ - Agent builds default module list from a default_mibs.h rather than
+ a hard coded configure list
+ - [PATCH 1568150]: Extend pass_persist error messages that can be
+ passed back from the script
+ - [PATCH 1570982]: Solaris IF-MIB: Support for IPv6-only interfaces
+
+ snmptrapd:
+ - the traphandle directive now supports a -t switch to indicate
+ matching any OID in the tree below the specified OID
+
+ mib2c:
+ - New mib2c.emulation.conf provides a quick way to do simplistic
+ emulation of an entire MIB or MIB branch.
+ - A new perl module NetSNMP::agent::Support provides easier embedded
+ perl support. (patch 1369996 from Peter Martin)
+ Run "mib2c -c mib2c.perl.conf OID" to help you start using it.
+
+ perl:
+ - gettable() now supports asynchronous callback functions
+ - update default_store module to latest default_store c-binding
+ tokens
+
+ snmpusm:
+ - performance improvement when changing localized keys
+ - new option -Cp to set usmUserPublic value
+
+ snmpvacm:
+ - new commands to manipulate Net-SNMP access control extensions
+
+ Ports:
+ Linux:
+ - add IPv6 aware UDP and TCP mibs to default module list
+
+ Solaris, FreeBSD, OpenBSD:
+ - Experimental support for 64bit interface counters (ifXTable). Enable
+ via '--with-mib-modules=if-mib --enable-mfd-rewrites'.
+ - [PATCH 1569537,1569539]: new UDP-MIB and TCP-MIB implementation
+ (enable through --with-mib-modules=udp-mib,tcp-mib)
+
+ Win32:
+ - new winExtDLL extension module to allow snmpd to load Windows SNMP
+ Service extension DLLs to provide support for HOST-RESOURCES-MIB
+ and other MIBs provided with Windows.
+
+ AIX:
+ - HOST-RESOURCES-MIB implementation added to default module list
+
+ uCLinux
+ - [PATCH 1551948]: Make pass_persist usable on uClinux
+
+ Fixes:
+ snmplib:
+ - fix OID lookups for fully qualified object names (eg .iso.org)
+ (official patch 1421725)
+ - UDPIPv6 and TCPIPv6 transports now compile on recent UN*X platforms
+
+ snmpd:
+ - fix disman/event monitoring crashes (official patch 1429059)
+ - fix re-init of daemons after SIGHUP (official patch 1473289)
+ - fix trap processing from SMUX peers (patch 1430824)
+ - [BUG 1527930]: fix smux authentication
+ - [BUG 1427410]: Set auth engineID for SNMPv3 traps.
+ - [BUG 1535903]: Support spaces within security names
+ - fix 8 byte IpAddress in at, ip and route MIBs.
+ - [PATCH 1562688]: fix ping/reattach agentx code
+
+ snmptrapd:
+ - fix bug 1420758/1458815: snmptrapd aborts/loops in select()
+ (official patch 1420758)
+ - fix re-init of daemons after SIGHUP (official patch 1473289)
+
+ perl:
+ - Fixed the perl bulkwalk function
+ - gettable() was fairly broken in prior versions
+ - OID handling was fully broken on various 64bit platforms
+ - fixes for 64-bit platforms
+
+ misc:
+ - Many misc fixes
+
+*5.3.0.1*
+
+ *** Security Fix ***
+
+ - In version 5.3 much of the authorization control was rewritten.
+ There was a bug in the new code that resulted in granting write
+ access to read-only users or communities which were configured
+ using the "rocommunity" or "rouser" snmpd.conf tokens. 5.3.0.1
+ fixes this problem. Users are encouraged to immediately update
+ their installations if they use either of these tokens.
+
+
+*5.3*
+
+ *** Important Notes ***
+
+ Several very significant changes have been made in Net-SNMP for this
+ release that warrant special attention.
+
+ - shared library version number no longer matches the release number. We
+ now follow the versioning scheme recommended by libtool. For the 5.3
+ release this means that the libraries now have a SONAME ending with
+ ".so.10", e.g. libnetsnmp.so.10.
+
+ - snmpd has not been truncating log files at startup, as documented in
+ the man pages, for a while now. This default behaviour has been restored.
+ Please use the '-A' flag if you want to continue appending to your log
+ files at startup.
+
+ - snmptrapd will no longer accept all traps by default. It must be
+ configured with authorized SNMPv1/v2c community strings and/or SNMPv3
+ users. Non-authorized traps/informs will be dropped.
+
+ - Due to a copyright statement that didn't allow modifications,
+ snmpnetstat has been completely rewritten. The new version now
+ accepts the same command-line options as the other tools, which
+ has introduced a number of incompatible changes. However, it
+ does now finally support SNMPv3.
+
+ New:
+ Building:
+ - new option to disable set support in the agent (--disable-set-support)
+
+ snmpd:
+ - implement notification logging
+ - implement notification filtering
+ - AgentX, host resources and disman/event mibs added to default module list
+ - updated and new disman mib implementations
+
+ snmptrapd:
+ - allow a non-default AgentX socket
+ - a brand new authorization scheme that is based on the VACM
+ authorization scheme from snmpd.
+ - Note: now drops unauthenticated notifications by default
+ - registers the snmpEngine MIB group under the "snmptrapd" context
+
+ snmplib:
+ - new helper for ascii file based scalar integers (think Linux /proc/)
+ - new utilities for dealing with files
+ - new utilities for parsing text files
+ - granular config/persistent file disablement (noPersistentLoad and
+ noPersistentSave snmp.conf tokens)
+
+ mib2c:
+ - mib2c.mfd.conf now generates code for persistence row storage
+ - many enhancements and bug fixes
+
+ snmpusm:
+ - allows to use old and/or new localized key instead of passphrase with
+ option -Ck
+ - new option -CE to specify usmUserEngineID (necessary to manage
+ snmptrapd's usmUserTable)
+
+ Ports:
+ Linux:
+ - new experimental tables
+ - tcpConnectionTable, tcpListenerTable
+ - ipAddressPrefixTable
+ - udpEndpointTable
+ - ipv4InterfaceTable, ipv6InterfaceTable
+ - inetCidrRouteTable supports dynamic ipv4 route creation/deletion
+ - added ipv6IpForwarding.0 and ipv6IpDefaultHopLimit.0 (read-write)
+
+ Win32:
+ - Cygwin compiler fixes
+ - MSVC: agent (snmpd) support for pass and pass_persist
+ - MinGW: agent (snmpd) support for pass
+ - Fix for 'select: No such file or directory' in snmpdelta
+
+ Fixes:
+ - Persistent files in directory defined by snmp.conf persistentDir were
+ not being loaded at startup
+ - Perl getnext didn't honor explicit reference to MIB file
+ - AgentX sub-agent connection delayed til after config files read
+ - Build fixes for --disable-agent, --disable-snmpv1 and --disable-snmpv2c
+ - Lots of bug fixes
+
+
+*5.2*
+ New:
+ For the security paranoid (like Wes):
+ - Insecure versions of SNMP may be completely disabled at compile time.
+ (configure using one or both of --disable-snmpv1 --disable-snmpv2c)
+ - Less secure versions of SNMPv3 authentication and encryption
+ algorithms may be completely disabled at compile time.
+ (configure using one or both of --disable-des --disable-md5)
+ (This requires you have OpenSSL to support SHA1 and AES instead)
+ - Diffie-Helman key negotiation (perfect-forward-secrecy - RFC2786)
+ has been implemented in both the agent and "snmpusm".
+ - Better support for direct use of localized and master keys
+ (randomly generated keys have more entropy than passwords). See
+ the -3m -3M -3k and -3K options, and the defAuthLocalizedKey,
+ defPrivLocalizedKey, defAuthMasterKey, defPrivMasterKey
+ snmp.conf tokens)
+
+ library:
+ - send and receive buffer sizes for UDP/TCP are configurable
+ - .conf file token registration can now search multiple files
+ (separate file names to search by a :. IE, "snmpd:agentx")
+
+ snmptrapd:
+ - Embedded perl support for trap handlers (much faster than traphandles).
+ (configure --with-embedded-perl ; see 'perldoc NetSNMP::TrapReceiver')
+ - the snmptrapd usmUser table can be controlled through SNMP & AgentX
+ (the snmptrapd registers MIBs under the "snmptrapd" SNMPv3 context)
+
+ agent:
+ - community strings can be mapped to individual SNMPv3 contexts
+ (see the snmpd.conf manual on "com2sec").
+ - AgentX should work properly with SNMPv3 contexts now.
+ - improved version of "exec" extension directive - "extend":
+ supports multi-line output, configurable command input, SET
+ handling, a valid relocatable MIB output structure, etc
+ - more flexibility added to netsnmp_cache helper, including periodic
+ refreshing of caches and cache pre-loading.
+ - experimental implementation of DisMan Remote Operations MIB groups
+ (remote nslookup, ping, traceroute and expressions via SNMP)
+ - The proxy supports a new -Cc flag which passes the community
+ name through to the other side rather than hard-coding it.
+ - The config_require() and other modules can now be placed
+ inside of CPP directievs (#if, /* ... */) as header files are
+ now passed through CPP processing first.
+ - new config_exclude() macro for excluding certain modules
+ - new config_belongs_in() macro to specify if a chunk of code
+ found by --with-mib-modules belongs in the agent library or
+ the mib module library.
+ - Uses a smaller function stack.
+
+ commands:
+ - snmpusm: A number of key-change improvements
+ (EG, changing localized keys supported, diffie-helman support, ...)
+ - New -Ln option to completely disable logging.
+
+ mib2c:
+ - a number of new or updated configuration templates:
+ - mib2c.iterate.conf: the iterator-based table config
+ now produces fuller template code than before.
+ - mib2c.table_data.conf and mib2c.container.conf:
+ two new "internal-row" style configs
+ - mib2c.mfd.conf: "MIBs for Dummies" (or MFD) - intended to
+ reduce the SNMP knowledge needed to develop MIB modules
+ and add flexibility at the same time. Run "mib2c -S
+ mfd_interactive_setup=1 -c mib2c.mfd.conf OID" and follow
+ its guided instructions to help you tailor its results to
+ meet your needs.
+ - mib2c.genhtml.conf: Generates an easier-to-read HTML view of
+ a MIB tree structure. (See http://www.Net-SNMP.org/mibs/
+ for example output.)
+ - more node tags available for conf file writers
+ - additional search directories may be set via MIB2C_DIRS env var.
+ - mib2c-update: new utility to help update mib2c generated code
+ when conf file changes.
+ - a mib2c.conf manual page to describe how to write mib2c .conf files.
+ - support for embedded perl code in mib2c.conf files
+
+ documentation:
+ - New README.agent-mibs: an attempt to start documenting what
+ MIBs are implemented in the agent and on what architectures.
+
+ perl:
+ - An improved SNMP::gettable() method. Uses GETBULK if possible and
+ better GETNEXT requests if not, decodes indexes from OIDs,
+ requests multiple variables at once, ... ("perldoc SNMP" for details)
+ - A NetSNMP::OID::get_indexes() function to extract index values
+ from an OID.
+
+ Ports:
+ Linux:
+ - new experimental tables/rewrites for Linux, including:
+ ifTable, ifXTable, inetCidrRouteTable, ipCidrRouteTable,
+ ipAddressTable, ipSystemStatsTable, ipNetToPhysicalTable.
+ - Enable these talbles by specifying --enable-mfd-rewrites to configure.
+ - Most of these tables have IPv6 support as well.
+ - ifIndex no longer changes when interfaces are added/removed, and all
+ tables/object will now use the same ifIndex for the same interface.
+
+ Solaris:
+ - new experimental support for ucd-snmp/lmSensors MIB module
+
+ Win32:
+ - Support for the MinGW compiler
+ - Support for snmptrapd running as a service
+ - A Win32 specific build and install script
+ - Support for a .exe installer
+ (we'll make binaries available using it)
+
+ Fixes:
+ - AgentX memory leak on sets
+ - SNMPv3 not-in-time window after 248 days
+ - Agent hang in HOST-RESOURCES MIB
+ - double free on duplicate registration
+ - OIDs with IP Addresses as indexes now print prettier
+ -'Lazy' installation of headers (only install if newer)
+ - allow whitespace in rocommunity/rwcommunity
+ - many miscellaneous bug reports
+
+
+*5.1.2*
+ New:
+ - Minor improvements to snmpdelta (error reporting)
+ - Minor improvements to snmpnetstat (IPv6 output)
+
+ Fixes:
+ - Misc 64bit processor fixes.
+ - Misc perl build and install fixes.
+
+ Ports:
+ - Linux 2.6 improvements
+ - Win32 support for TCP and UDP over IPv6 via Winsock version 2
+ - Win32 fixes in many places.
+ - Win32 service support for snmptrapd
+ - Win32 support for snmpconf
+
+*5.1.1*
+ New:
+ - test suite supports testing over other transports (tcp, udp6, unix, ...)
+ (see the -P switch to the testing/RUNTESTS script)
+ - Solaris supports the use of it's PKCS#11 library for supporting
+ cryptographic functions (OpenSSL isn't required if PKCS#11 is available)
+ (see configure's --with-pkcs flag)
+
+ Fixes:
+ - Improvements on 64 bit architectures.
+ - A few minor memory leaks fixed.
+ - An extremely large number of minor bug fixes.
+ - Many perl module specific bug fixes.
+ - snmpd will safely handle more signals.
+
+ Ports:
+ - Many many significant Windows improvements.
+ - AgentX support is working again under windows.
+ - SCM support is built into the agent to allow the agent to be
+ started as a windows service.
+ - MSDOS names are supported in path names.
+ - A win32 build script in win32/build.pl
+ - Support for the MinGW compiler
+ - (see the README.win32 file for details on new ports)
+ - Various helpful win32/*.bat files for installation, etc.
+ - Some linux 2.6 support improvements
+
+*5.1*
+ New:
+
+ Building:
+ - configure is now generated using autoconf 2.57.
+ - The make system now supports "make uninstall"
+ - configure & make supports a --with-install-prefix option
+ - new configure options to disable building of the agent, apps, ...
+ ./configure --help for a list of package sections that can be excluded.
+ - new configure option to remove specific code pieces (mib reading, ...)
+ ./configure --help for a list of code areas that can be excluded.
+
+ snmpd:
+ - linkUp and linkDown notifications can be enabled
+ (see the linkUpDownNotifications snmpd.conf token documentation)
+ - notifications (traps) can be generated for disman/monitor events.
+ (see the snmpd.conf documentation on "monitor" and "notificatonEvent")
+ - new snmpd.conf tokens: includeAllDisks
+ - the UCD-DISKIO-MIB will now work on linux.
+ - com2sec mappings for SNMP over unix sockets.
+ - some speed improvements have been made that should increase the
+ speed of the agent's processing time.
+ - for mib code using the table iterator, an auto-caching mechanism
+ which can greatly speed up access at the cost of caching.
+ (see "stash_cache" in the injectHandler token docs in snmpd.conf(5))
+ - Some of the agent modules were completely rewritten (and
+ should be faster and cleaner).
+ - A number of new APIs and helper modules are available, but
+ there is no major summary to easily list.
+ - A number of new Net-SNMP specific MIBs now exist.
+
+ snmptrapd:
+ - snmptrapd now supports forwarding of notifications.
+ (see the snmptrapd.conf manual for details)
+ - snmptrapd's new -t switch can be used to disable syslog.
+ (useful for a no-output snmptrapd with only traphandle support)
+
+ apps:
+ - snmptable sports 3 new options: fixed width, max-repeaters,
+ left-justify. (see snmptable -h for details)
+ - mib2c walks you through instructions to help you generate code
+ "just for you". Including some new forms of output code, like
+ notification code generation. Run mib2c SOMETHING for details.
+ - mib2c has about a billion other improvements, including the
+ ability to generate trap generation code templates.
+ - snmpwalk supports a new -Ct option for timing how long a walk takes.
+ - net-snmp-config supports a number of new options.
+ - All applications support a consistent -L flag for turning on
+ which forms of output logging should be used.
+
+ perl:
+ - the SNMP module supports a new get_table() call.
+
+ Fixes:
+ - More patches to properly demonize snmpd (close std*, double fork, ...).
+ - Version numbers of all packages/perl-modules/etc are better synchronized.
+ - more documentation, especially for APIs
+ - all perl module version numbers are synchronized with the
+ net-snmp package.
+ - Many many misc bug fixes, as always.
+
+ Ports:
+ - diskio MIB support for Darwin.
+ - ifSpeed under Linux should now be correct for most network cards.
+ - more windows build fixes
+
+*5.0.9*
+
+ SECURITY:
+ - An existing user/community could get access to data in MIB
+ objects that were explicitly excluded from their view.
+
+ Fixes:
+ - Perl build environment should better under Windows
+ - Misc kerberos support fixes.
+ - Improvements on various manual pages.
+ - A annoying bug with SETs being passed to pass scripts was fixed.
+ - The often talked about VACM optimization improvement was fixed again.
+ - mib2c handles augmentation tables better now.
+ - Various 64 bit issues have been addressed.
+
+*5.0.8*
+ New:
+ - No new features will be added to the 5.0.x line.
+
+ Ports:
+ - Update libtool to version 1.4.3, for the benefit of Darwin
+ - diskio support for Darwin
+ - Updates for OpenBSD 3.
+ - Updates to solaris README
+
+ Fixes:
+ - find libwrap w/nsl on RedHat
+ - fix for openssl 0.9.7
+ - Fix some AgentX memory leaks
+ - use macro for inline function prototypes
+ - Attempt to find unused port before running tests
+ - Use SNMP_SLEEP environment variable when running tests
+ - calculate a proper ifSpeed under linux when possible
+ - better daemonization of snmpd
+ - close and reopen snmptrapd log files on HUP
+ - support for 16 bit reuqest ids
+ - Recognize new 't' code in display hints
+ - misc other fixes
+
+*5.0.7*
+ New:
+ - VACM (access control) optimizations which will greatly benefit
+ people who wish to exclude large portions of the MIB tree from
+ some people. Previously this was a large resource drain.
+ - Add command line option to snmpd to set syslog facility
+ - Reverse DISPLAY-HINT processing, i.e. it allows you to input data
+ formatted like a DISPLAY-HINT prescribes
+ - Support setting of sysDescr and sysObjectID via snmpd.conf
+ configuration directives
+ - New output option to force display of strings as hex
+ - Persistent directory can be specified at runtime
+ - Add support for Linux virtual interfaces in the ipAddressTable.
+ - implemented the mteEventTable and the mteEventNotificationTable
+ form the DISMAN-EVENT-MIB.
+
+ Fixes:
+ - AgentX no longer flagged as experimental
+ - A few memory leak fixes for the table_iterator agent API.
+ - Processed flag cleared before each pass of a set request
+ - Remove snmpd pid file on exit
+ - Restore default behaviour of building shared libraries
+ - misc other fixes
+
+*5.0.6*
+
+ Fixes:
+ - prevent denial of service attack from authenticated users
+ (really this time).
+ - misc other fixes
+
+*5.0.5*
+
+ New:
+ - Support for OpenSSL 0.9.7
+ - Beginning of support for AES encryption.
+ ( Currently only usable with Net-SNMP and OpenSNMP software. )
+
+ Ports:
+ - win32 new project files win32sdk.dsw for those with the win32
+ platform sdk.
+ - win32 builds should work properly again, minus callbacks and thus
+ AgentX.
+
+ Fixes:
+ - Several AgentX (the subagent protocol) specific bugs have been fixed
+ - prevent denial of service attack from authenticated users
+ - many many misc fixes
+ - The perl agent module plugin should now work.
+ - Many other perl module related fixes.
+ - net-snmp-config --ldflags properly supplies -L flags
+ - misc make test fixes and improvements.
+
+*5.0.4*
+
+ During the testing for release 5.0.4, a release candidate was uploaded
+ to Sourceforge and marked as hidden. For various reasons, the release
+ was delayed and further changes and fixes were made. However, the
+ release candidate files still appeared on the public FTP server and our
+ mirrors. To avoid the confusion that could occur to users who may have
+ downloaded this release candidate, we are bumping the revision number
+ to 5.0.5. If you downloaded net-snmp-5.0.4.tar.gz, please upgrade
+ to net-snmp-5.0.5.tar.gz.
+
+*5.0.3*
+
+ New:
+ - the "dist" directory contains the beginnings of some init
+ scripts and packaging utilities.
+
+ Ports:
+ - win32 builds should work properly again.
+
+ Fixes:
+ - the 5.0.2 package had a few broken packaging problems. Opps.
+ - a few misc fixes.
+
+ Perl:
+ - the perl modules should work with older versions of perl again.
+
+*5.0.2*
+
+ New:
+ - mib2c support for the old-4.X style api and for scalars.
+ - many improvements to the netsh shell environment.
+
+ Fixes:
+ - tcpwrappers support should work significantly better.
+ - NFS file systems are better supported in the hrStorageTable
+ - the memory reporting no longer accidentally reports -1 integers
+ - a few memory leaks fixed in the table_iterator API
+ - fixes for Sun's "make"
+ - ds_ prefix name-space protection (-> netsnmp_ds_)
+ (run configure with --enable-ucd-compatibility for old API)
+ - v1/v2c access control fixes for ipv6 addresses
+ - many many misc fixes
+
+ Perl:
+ - The perl modules have a number of fixes, and the build process
+ was fixed (again).
+ - all make test suites should pass for people now.
+ (there are still some known minor limitations, but we removed the tests)
+
+*5.0.1*
+
+ New:
+ - A new flag: -OQ which does quick printing (-Oq), but with an '=' sign.
+ - All output should now have type tags in front of them.
+ (STRING: and INTEGER: were added)
+ - the snmplib/mib.c file has been instrumented with doxygen comments.
+ - two new mib2c configuration files for generating column and enum defines.
+ - a agent coding example: agent/mibgroup/examples/notification.c
+
+ Perl:
+ - the SNMP perl module properly uses snmp.conf values as defaults.
+ - --with-perl should work this time.
+ - more embedded perl support, but it still isn't complete yet.
+ (the NetSNMP::OID module has received many new features)
+
+ Ports:
+ - added vmstat and memory support for hpux11
+ - other misc improvements for hpux11
+
+ Fixes:
+ - the agent should properly handle requests in the right order.
+ (e.g., restrict the agent to processing only one SET at a time)
+ - net-snmp-config --compile-subagent has been greatly improved.
+ - the tools should report the right version number.
+ - large /proc/stat files on linux shouldn't crash the agent.
+ - the smux module should handle multiple registrations better.
+ - various documentation clean ups.
+ - 64 bit address clean ups.
+ - misc other bug fixes.
+
+*5.0*
+
+ New:
+
+ - Much of the agent internals were completely rewritten and sports
+ a new module API to make your life easier. See the
+ agent/mibgroup/examples directory for example code that makes
+ use of some of the new functionality.
+ (Also see http://www.net-snmp.org/tutorial-5/agent/ which has
+ some incomplete documentation)
+ - The agent sports embedded perl, see the perl details further below.
+ - The agent supports multiple SNMPv3 contexts and mib modules can
+ now register themselves under different contexts. (see the -n
+ option in the snmpcmd manual page for details on specifying
+ context strings in requests)
+ - The proxy code has been completely rewritten and now supports
+ the use of SNMPv3 contexts to help select which proxied host you
+ wish to talk to. See the snmpd.conf manual page.
+ - All the tools take --configToken=value options now. (see -H
+ output from any command for what configTokens it accepts)
+ - All the tools can speak over many different transport layers
+ now, including UDP/TCP (ipv4 and ipv6), AAL5pvc, and IPX. See
+ ./configure --help for details on enabling them.
+ Note: the -p and -T flags to all the applications have been
+ removed. Use hostname strings like "tcp:localhost:9999"
+ instead. See the snmpcmd manual page for details.
+ - snmptrapd now acts as an agentx subagent and implements portions
+ of the NOTIFICATION-LOG-MIB to allow captured traps and informs
+ to be queried.
+ - A "net-snmp-config" script will get installed which can report
+ how the various tools were built (which libraries they were
+ linked against, etc). It will also help you do other things as
+ well, like setting up snmpv3. Run net-snmp-config --help for details.
+ - kerberos authenticated and encrypted SNMPv3 is now possible.
+ See ./configure --help for details on enabling the ksm security module.
+ - The AgentX subagent protocol implementation has many new
+ features and fixes.
+ - mib2c was completely rewritten and has a much improved
+ configuration file specification.
+ - Much of the code is getting documented with "doxygen" style
+ documentation. Run "make docs" if you have doxygen installed.
+ - some RMON support is available.
+ (See agent/mibgroup/Rmon/README for details.)
+ - The source tree has been reorganized and all the exported header
+ files are now in the include subdirectory. You can now point to
+ the includes easily without having to run "make install" first.
+ - the agent now requires a configuration file to access any information.
+ - The entire code base has had indent run on it to effect a
+ consistent coding style. See the CodingStyle file for details.
+
+ Perl:
+
+ - The SNMP perl module now calls init_snmp() like real net-snmp
+ applications, which means it will read snmp.conf configuration
+ files, etc.
+ - new perl specific configure options --with-perl-modules &
+ --enable-embedded-perl. See ./configure --help for details.
+ - The beginnings of some new Perl modules (alpha level quality)
+ are in the perl directory, including:
+ - NetSNMP::agent which allows perl scripts to become net-snmp
+ master or subagents
+ - AnyData::SNMP is available that implements a perl DBI
+ interface to map SQL commands to SNMP. Included is a "netsh"
+ shell where SQL commands can be typed, aliases created, etc.
+ See the perl/AnyData_SNMP/INSTALL file for details.
+ - Beginning (alpha level quality) support for embedding perl
+ subroutines directly within the net-snmp agent.
+
+UCD-SNMP NEWS:
+
+*4.2.6*
+ Big fixes:
+ - Fixes to the Tunnel mib.
+ - Deprecated the non-raw objects in the system stats MIB portion.
+ - Testing harness fixes.
+ - Network file system improvements fro the hrStorageTable.
+ - fixed snmptable.
+ - fixed the memory table (again) locking to 2^31 in value.
+ - Misc documentation fixes and clean-ups.
+ - Many other misc fixes.
+
+*4.2.5*
+ Bug fixes:
+ - The perl module actually works. Sorry about that.
+ - don't overwrite the PID of an already-running snmpd with the PID
+ of an abortive snmpd.
+ - a 64 bit architecture socket fix
+ - smux authentication fixed for multiple connected sessions.
+ - dynamic module support testing in the configure
+ - memory values > 32bits are now reported as a maxed out 32bit number
+
+*4.2.4*
+ New:
+ - badCommunityNames and badCommunityUses Counters supported.
+ - tcp_wrappers support for snmptrapd.
+
+ Bug fixes:
+ - A security issue involving the snmpnetstat command accepting
+ illegal data from a faked snmp server.
+ - RPM library support fixes.
+ - shared libraries built by default.
+ - many bug fixes for conformance of target, notification, and vacm tables
+ - many other fixes.
+
+ Ports:
+ - HPUX 11
+ - Dynix/PTX 4.4
+ - The snmpd demon can properly run as a windows service
+
+*4.2.3*
+ New:
+ - sysLocation, sysContact, sysName and snmpEnableAuthenTraps are
+ persistent after being set remotely.
+ - New "ignoredisk" directive to ignore disks in the host resources mib.
+
+ Bug Fixes:
+ - The ifTable on Linux no longer reports duplicate interfaces.
+ - perl scripts print better error messages if needed modules
+ aren't available.
+ - trap sinks aren't duplicated after a SIGHUP.
+ - misc other fixes.
+
+ Ports:
+ - improved irix support.
+ - more mibII support for windows.
+
+*4.2.2*
+ Security Bug Fixes:
+ - A few security bugs have been found and fixed. No known exploits
+ have been released to date. However, users are encouraged to
+ upgrade to the 4.2.2 release as soon as possible.
+
+ Bug fixes:
+ - many misc bug fixes.
+ - misc documentation corrections.
+ - updated libtool to 1.4. This fixes a couple of platforms (eg, NetBSD).
+
+ Ports:
+ - mibII support for win32
+ - It should compile and work on MacOS X (Darwin)
+ - udpTable supported on solaris.
+ - win32 borland compiler supported (see win32/config.h.borland)
+
+ New:
+ - tkmib supports SETs and saving of configuration data.
+ - snmpwalk detects out of order OIDs being returned from an agent.
+ - snmpset accepts the '=' sign for a datatype if the mib is
+ available to extract the datatype from instead.
+
+*4.2.1*
+ Administrative:
+ - The http://www.net-snmp.org/ web site and domain name is now active.
+ - Copyright statement for changes beyond 4.2 is now a true BSD license.
+ (see the COPYING file for details)
+
+ Major Bug fixes:
+ - AgentX master agent no longer crashes when a subagent disconnects.
+ - counter64 encoding fixed.
+ - oids with large numbers embedded in them should work properly (again).
+ - Fixed behavior of agent_check_and_process() and alarms.
+ - mib2c handles more variable types.
+ - traps/informs are sent properly from agentx subagents.
+ - many many more bug fixes have gone into this release.
+
+ New:
+ - The snmpconf configuration file editor can create snmptrapd.conf files.
+ - AgentX support is compiled in by default, but must be configured now.
+ (Add "master on" to your snmpd.conf file to enable agentx support)
+
+*4.2*
+
+ Administrative:
+ - project services moved to http://www.net-snmp.org/project/
+
+ Features:
+ - Packets sequences are now shorter when possible, reducing packet sizes.
+ - A new configuration file creation tool: snmpconf.
+ (try snmpconf -g basic_setup)
+ - A new command to remotely list disk space: snmpdf.
+ - the agent VACM tables are now writable.
+ - a new snmpvacm tool can be used to change the running vacm configuration.
+ - dynamicly loadable mib module support for the agent.
+ (see snmpd.conf on the dlmod directive)
+ - minimal proxy support for snmpd
+ (see snmpd.conf on the proxy directive)
+ - libtool is now used to compile the package (better shared-library support)
+ - the agent now supports the SNMP-NOTIFICATION-MIB.
+ (enabled by default).
+ - the agent can set trapsink using snmpcmd command line style parameters
+ (see the trapsess section of the snmpd.conf manual page)
+ - index matching in oids has been improved
+ (see the snmpcmd manual page on -Ox, -OE, and -Ob).
+ - snmptrapd has new formatting directives.
+ (see the snmptrapd manual page on format1 and format2).
+ - the agent can listen to multiple ports.
+ - the agent can be restricted to listening on only certain interfaces.
+ - the agent can be told at run time which mib modules (not) to initialize.
+ (see the -I option in the snmpd.conf manual page)
+ - the agent can run as a particular user.
+ - snmptable takes a -Ci argument to show table indices.
+ - snmptable uses GETBULK requests when it can (unless -CB is specified).
+ - The "make test" suite contains a lot of new tests.
+ - cross-compiling support.
+ - snmpset checks types and range values for legality.
+ - Significant improvements to the AgentX support.
+ (Code is still beta, but probably safe for use on non-critical systems).
+
+ Perl:
+ - bulkwalk functionality for the SNMP perl module.
+ - entirely numeric OID support.
+ - support for best guess mode for OIDs.
+ - range and default value access added.
+ - build can now be targeted against a non-standard net-snmp install path.
+
+ Fixes:
+ - v3 traps/informs handled properly now.
+ - Many more misc bug fixes.
+ - snmpv3 engineIDs not IP address specific.
+
+*4.1.2*
+ Fixes:
+ - Host resources fixes for FreeBSD and NetBSD
+ - ucd-snmp memory/vmstat fixes for FreeBSD-3
+ - configure --enable-ipv6 fixes
+ - AIX fix (use knlist)
+ - fix init_master_agent calling exit
+ - bad free in subagent.c
+ - dont let a agentx subagent be a smux master
+ - ucd-snmp/loadave fix for AIX
+ - fix doing a set on a pass variable
+ - snmptable fixes
+ - snmpnetstat fixes for v2c exceptions
+ - man page fixes
+
+ Features:
+ - Some UnixWare 5 configuration support
+ - configure --enable-mini-agent --without-openssl
+ - snmptrapd -n
+ - snmp_log callbacks
+ - noTokenWarnings and noRangeCheck in snmp.conf
+ - using a counter type in snmpset/snmptrap
+
+*4.1.1*
+ Fixes:
+ - Better agent handling of unauthorized requests.
+ - Better "make test" support.
+ - Misc bug fixes.
+
+*4.1*
+ New:
+ - Many new command line flags have been added for input/output flexibility.
+ (see the snmpcmd(1) manual page on the -O flag and -I flag)
+ - The tools support regex matching of oids on the command line.
+ (see the snmpcmd(1) manual page on the -Ib option)
+ - A ucd-snmp usage tutorial has been placed on the main web page.
+ (see http://www.net-snmp.org/tutorial/)
+ - snmptable is much smarter and handles sparse tables better.
+ - tkmib supports snmpv3.
+ - New agent libraries to embed SNMP and AgentX agents into other programs.
+ (see the snmp_agent_api(3) manual page and the tutorial)
+ - SNMP over TCP is supported.
+ (-T TCP on the command lines)
+ - OpenSSL has replaced KMT for SHA authentication and DES encryption.
+ (Get OpenSSL from http://www.openssl.org/).
+ - Some easier-to-use access-control snmpd.conf directives for simple setups.
+ (see the snmpd.conf(5) manual page)
+ - Easier setup of SNMPv3 support for the agent.
+ (see the README.snmpv3 file).
+ - Command line argument parsing has been reworked for getopt() use.
+ (currently backwards compatible; see the snmpcmd(1) manual page)
+ - Table rows with embedded strings are dealt with for both input and output.
+ (see the snmpcmd(1) manual on the -Ob flag)
+ - Many more snmp.conf directives supported.
+ (see the snmp.conf(5) manual page)
+ - Many AgentX improvements.
+ - All of our distributed mibs have been updated to be SMIv2 compliant.
+ - Trap support in the agent has been cleaned up and an API created.
+
+ Perl:
+ - Joe Marzot's perl module is now included with the ucd-snmp source.
+ (this should help people trying to synchronize the two packages)
+
+ Fixes:
+ - SMUX support has been reintegrated into the agent in a better way.
+ - Many many others.
+
+*4.0.1*
+ New:
+ - defVersion in snmp.conf supported.
+ Fixes:
+ - An option was accidentally turned on by default that shouldn't have been.
+ - misc minor fixes.
+
+*4.0*
+ New:
+ - SNMPv3 protocol support!!!
+ (See the README.snmpv3, snmpusm(1), snmp.conf(5), snmpd.conf(5))
+ - historic v2party support removed.
+ - complete re-write of the agent.
+ - The extensible AgentX protocol is in alpha-test mode.
+ (to use, compile with the mib-module "agentx" or
+ "agentx/master" or "agentx/client").
+ - syslog support for the agent (and everything else for that matter).
+ - Per-process/per-exec-script based fix scripts implemented.
+ (see snmpd.conf(5) for details)
+ - many more config file options supported.
+ (run any command with -H and see appropriate .conf manual pages)
+ - The start of a "make test" suite.
+ - many other things we've forgotten.
+ - code is ANSI C now, and requires a ANSI C compiler.
+
+ API Changes:
+ - A small change to the write functions in mib modules.
+ (data passed in has already be BER-decoded and is a pointer to a
+ variable of the correct type).
+ - The config_load_mib mib-module .h file directive is now
+ obsolete. Use REGISTER_MIB inside your init function instead.
+
+*3.6.2*
+ Fixes:
+ - An important multi-session bug fix, especially needed for the
+ SNMP perl module.
+ - Many minor bug fixes.
+
+*3.6.1*
+ Fixes:
+ - Minor last second fixes mostly.
+
+*3.6*
+ New:
+ - All of the services for ucd-snmp have moved from the sites in
+ ece.ucdavis.edu to ucd-snmp.ucdavis.edu, including http, ftp,
+ and the mailing lists.
+ - The configure --help output has been greatly improved for better
+ readability and has been broken into sections.
+ - The agent's SMUX support has been greatly improved and should
+ function with applications other than gated now.
+ - The snmptrapd has been make extensible so you can call other
+ programs and scripts when a trap has been received.
+ (see snmptrapd.conf(5))
+ - More configuration files have been created and can be used to
+ specify defaults and configuration information to the various
+ applications. Run each command with -H to see what it understands.
+ (see snmp_config(5), snmpd.conf(5), snmp.conf(5), snmptrapd.conf(5))
+ - The configuration file parser looks in ~/.snmp by default as
+ well, allowing each user to have his/her own setup files for the
+ various applications.
+ - The mib parser supports a variety of options dictating how
+ strictly it parses mib files.
+ (see snmpcmd.1 on "-P")
+ - Debugging output with the -D flag now accepts a list of
+ debugging information types to print.
+ (see snmpcmd.1 on "-D")
+ - Minimal multi-thread support using a modified version of the
+ session API.
+ (see snmp_sess_api(3))
+ - persistent storage of information is possible from the agent's
+ mib modules now.
+ (see read_config(3))
+ - The target mib has been implemented as an optional module.
+ - More documentation has been written.
+ - The recommended mib module API has changed slightly, but is
+ backwards compatible as well. See the AGENT.txt file for new
+ documentation on how to write mib modules for the agent.
+
+ Fixes:
+ - many misc bug fixes, as always.
+
+ Ports:
+ - snmpnetstat has been ported to the win32 environment.
+
+*3.5.3*
+ - Bug fixes, including row creation sets to mib modules should work again.
+
+*3.5.2*
+ - very small last minute bug fixes for win32 and freebsd mostly.
+
+*3.5.1*
+
+ Fixes:
+ - Many bug fixes submitted by users and the ucd-snmp-coders.
+ - v2party support in the agent has been fixed.
+ - The UCD-SNMP-MIB is SMICng compliant and should work under HP OV better.
+ - Most sections of the mibII tree are 64bit clean.
+
+ Copyright:
+ - Simplification.
+
+*3.5*
+
+ New:
+ - agent/mibgroup directory reorganized hierarchically.
+ - this may break the agent compilation with some compilers.
+ - floats, doubles, counter64s, int64s, uint64s support via opaque types.
+ - new modules: misc/ipfwacc.
+ - use of dynamicly loadable modules now possible, but not fully supported.
+ - New application command line flags: -s, -S, -m MIBS, -M MIBDIRS.
+ - new configure options: --with-cc=CC and --with-cflags=CFLAGS
+
+ Fixes:
+ - Solaris core dumps.
+ - Fixes for NetBSD 1.3.
+ - The apps work again on 64bit machines.
+ - misc other bug fixes.
+
+ Ports:
+ - host resources module should work on more platforms: NetBSD,
+ FreeBSD, SunOS (almost).
+
+*3.4*
+
+ Important:
+ - the UCD-SNMP specific mib structure changed.
+ - many of the table oids have changed location and have been renamed.
+ - the View Based Access Control module was implemented in the agent.
+ Therefore, the "community" snmpd.conf parameter no longer
+ exists. See the snmpd.conf file for how to control access via
+ community names now.
+ - The header file #defines have changed. You may have to compile
+ third party applications with -DCMU_COMPATIBLE (like perl-SNMP <= V1.7).
+ - The parser is more strict about unlinked OIDs and end-of-comment
+ conditions. You may see problems in a few broken mibs that used
+ to parse ok with the older parser.
+
+ New:
+ - dynamic library support: configure with --enable-shared.
+ - the beginnings of a Perl/Tk/SNMP mib browser: tkmib
+ - all applications support -R for random oid-name lookups.
+ - default mib list changes when you add or remove agent mib-groups.
+ - debugging in the agent can be turned on and off using snmpsets.
+ - a new mib module displays a list of all loaded mib modules.
+ - the internal structure of the agent's mib modules is now hierarchical.
+ - the agent looks for .conf files in both the lib/ and share/ directories.
+ - more improvements/options to snmptable.
+ - new vmstat module to report vmstat related information under linux.
+ - a perl based mib2c translator to convert mib sections to C code templates.
+
+ Fixes:
+ - The code was run through purify for memory leaks and a few were found.
+ - snmptrap sends to the correct default port of 162 again.
+
+ Ports:
+ - irix 6.2 support improved.
+ - openbsd.
+ - the host resources mib compiles on Solaris.
+
+*3.3.1*
+
+ New:
+ - "make install" installs the library and header files.
+
+ Fixes:
+ - compilation on many architectures (sunos for example).
+ - snmptrapd doesn't exit if v2party files don't exist.
+ - host resources works a bit better (ie, it compiles) under solaris.
+
+
+*3.3*
+
+ Path changes:
+ - the default paths to the installed mibs and snmpd.conf file have
+ changed to /usr/local/share/snmp (set differently using --datadir).
+ - the default path of the snmpd and snmptrapd have changed to
+ /usr/local/sbin (set differently using --sbindir).
+
+ New:
+ - basic SNMPV2c support.
+ - Not fully tested (feedback please!), and not RFC compliant.
+ - all apps require '-v 2c' for v2c and '-v 2p' for the older party code.
+ - basic host-resources mib support for linux, and hpux.
+ - All environment variables can be set with a preceding '+' for
+ indicating additions to the default values.
+ - mib modules cleaned up more and can be added and removed more easily.
+ - mib modules have a new macro for callbacks when reading a .conf file.
+ - apps command line interfaces have merged together for standardization.
+ - the libsnmp library no longer forces printing of errors.
+ - 2 new applications: snmpdelta and snmptable.
+ - the mib parser caches mib directory scans for speed improvements.
+ - snmptrapd is snmp-version multi-lingual.
+
+ Ported:
+ - irix should be more complete.
+ - aix 4.1.5.
+ - fixes for hpux 10.20.
+ - linux 2.1.x support.
+ - library and apps supported under 32bit windows systems.
+
+ Fixes:
+ - too numerous to mention.
+
+*3.2*
+
+ New:
+ - Top level of the mib parser has been restructured
+ - no longer reads 'mib.txt'
+ - no longer reads everything (MIBS/MIBDIRS)
+ - reads import clauses to load other required modules
+ - new man page: mib_api.3
+ - The agent has been completely restructured (modularized) to
+ allow for easier extension via C code and requires no
+ modification of the ucd-snmp distributed source code to add in
+ new C coded mib modules. See the README file in the
+ agent/mibgroup subdirectory for details. Modules are added and/or
+ removed via configure options.
+ - agent can send traps to multiple trap destinations.
+ - configure can be run outside the default source directory.
+ - Optional modules: SMUX support to talk with a running gated.
+ - All configure prompted questions can be set on the command line instead.
+
+ Fixes:
+ - Memory leaks.
+ - code is now prototyped and many related bugs have been found.
+ (an ANSI compiler is still optional.)
+ - Many others.
+
+ Ported:
+ - linux-2.*
+ - mips-sgi-irix6.3 (agent needs 2 mib-modules removed still)
+
+*3.1.3*
+
+ New:
+ - FAQ file!
+ - bug-report script!
+ - Agent can read .conf files from more places:
+ - SNMPCONFPATH environment variable.
+ - command line options: -c FILE and -C.
+ - Agent can send coldstart and authentication traps.
+ - All requests/patches/questions should go to
+ ucd-snmp-coders@ece.ucdavis.edu
+ - snmp variables mib implemented.
+ - more udp, ip, ipNetToMedia tables implemented.
+
+ Fixes:
+ - Memory leaks.
+ - Many other system specific fixes.
+
+ Misc:
+ - configure script updated to autoconf 2.12.
+
+ Removed:
+ - Very ancient tk/tcl code.
+
+*3.1.2*
+
+ New:
+ - extensible mib moved to ucdavis enterprise mib: .1.3.6.1.4.1.2021.
+ - PORTING file added.
+ - new configure switch: --without-root-access.
+
+ Ports:
+ - BSDi, and possibly irix, and linux is not too far off.
+ - massive improvements for netbsd, freebsd, hpux.
+
+ Fixes:
+ - Massive parser improvements. (Niels Baggesen <recnba@mediator.uni-c.dk>)
+ - configure script upgraded to autoconf 2.11.
+
+*3.1.1*
+
+ New:
+ - init_mib() now reads all files in PREFIX/lib/snmp/mibs as mibs.
+ - sysContact and sysLocation settable in snmpd.conf.
+ - TC information retained (from Joe Marzot).
+
+ Fixes:
+ - snmpset on a pass script works now.
+ - pass scripts more throughly tested and debugged.
+ - community 5 can be set now.
+ - Many others.
+
+*3.1.0.1*
+
+ Ported:
+ - FreeBSD 2.?
+
+ Fixes:
+ - snmptrap greatly improved! (Niels Baggesen <recnba@mediator.uni-c.dk>)
+ - other small stuff.
+ - default logfile location moved to /var/log if exists, else /usr/adm.
+
+ New:
+ - snmptrap man page. (Niels Baggesen <recnba@mediator.uni-c.dk>)
+
+*3.1*
+
+ Features:
+ - Pass thru extensibility added!
+ - snmpnetstat greatly improved (Niels Baggesen <recnba@mediator.uni-c.dk>)
+ - improved solaris info caching (Dan A. Dickey <ddickey@transition.com>)
+
+ Bug fixes:
+ - many fixes for solaris (Niels Baggesen <recnba@mediator.uni-c.dk>
+ and "Dan A. Dickey" <ddickey@transition.com>)
+ - greatly reduced memory usage by mib parser (Niels Baggesen)
+ - disk checks fixed for solaris and osf.
+ - improved Mib parsing from Mike Perik <mikep@crt.com>
+ - TRAP-TYPE/NOTIFICATION-TYPE now handled.
+ - IMPORTS definition no longer required.
+ - SIZE syntax fixed.
+ - sedscript compiles correctly with Solaris's spro compiler.
+ - many more small ones.
+
+ Misc:
+ - Upgraded to autoconf-2.10
+
+*3.0.7.2*
+
+ Major solaris patches from Niels Baggesen <recnba@mediator.uni-c.dk>. Thanks!
+ Other misc patches
+
+*3.0.7.1*
+
+ Bug fixes.
+
+*3.0.7*
+
+ Features:
+ - Two new operating systems supported: hppa1.1-hp-hpux10.01, *-netbsd1.1
+ - Two new ./configure options:
+ --enable-debugging: includes nlist and other warnings in log-file output.
+ --with-defaults: Assumes you want the defaults for all user prompts.
+
+ Bug fixes:
+ - make clean in man/ works.
+ - Fixed the mib.txt capitalization problem.
+ - Fixed a gcc cpp problem (added -x c to the command line options).
+ - Added NULL to the second gettimeofday argument.
+
+ Misc:
+ - Upgraded to autoconf-2.9
+ - snmpcheck upgraded to perl5.002 and Tk-b10
+ - totally re-did the routing tables (required by hpux10.01).
+
+*3.0.6*
+
+ Features:
+ - snmpV1 community names can be set in the configuration files now!
+ - new app: apps/snmptrap, as requested by many, many people.
+ - New man page (rough still): snmpd.conf.5.
+ - Returns new values for system.sysObjectID for each supported OS.
+ - Better OpenView support for changing the icons & etc. See ov/README.
+
+ Bug fixes.
+ - -p PORT -l LOGFILE now work as advertised.
+ - printed values of timeticks are no longer negative.
+ - Correctly finds the Solaris 2.5 kernel.
+ - the restart-agent mib entry now sets an 1 second alarm to
+ restart so it can return a proper snmp response first.
+ - Truncates existing logfiles.
+ - nlist warnings removed.
+ - more... (see the ChangeLog)
+
+*3.0.5*
+
+ Bug fixes:
+ - 'make' should not call 'autoconf' and associates anymore.
+ - Fixed sun4 exit codes. Really.
+ - Changed config.h a bit to fix the mib.txt file's errors when
+ some mibs were not defined for usage.
+
+ Misc:
+ - Updated configure to autoconf 2.7
+
+*3.0.4*
+
+ Mainly a bug fix release:
+ - fixed another 32/64 bit problem: returned exit codes on alphas
+ were incorrect.
+ - many system errors (e.g., no mem) were causing the agent to
+ return error flags when it really was clueless.
+ - found a memory leak in the CMU routing table implementation.
+ - More configure cleanups, mostly for Solaris.
+ - snmp_open calls getservbyname only once now, at the request of Gary
+ Hayward <gah@dirac.bellcore.com>. Mainly for Perl users.
+
+ New example file: EXAMPLE.conf file (created at build time).
+
+ local/snmpcheck has drastically improved, and now requires Tk-b8.
+
+ You can now mung with all sorts of numbers in config.h and the
+ mib.txt file will be mostly built from it if you change my defaults.
+
+*3.0.3*
+
+ *** default location for .conf and mib.txt files moved to
+ .configure's --prefix location
+
+ Now using GNU's auto-conf for better portability
+ - prompts for important config.h information as well
+
+ Port to Sun4/Solaris 2.4
+
+ -h/--help and -v/--version flags added to snmpd
+
+*3.0.2.1*
+
+ Compilation bug fix
+
+*3.0.2*
+
+ Port to dec-alpha/OSF 3.1
+ - quite a few more CMU bugs found during port.
+
+ (docs/snmpd.1) Beginnings of documentation/man pages.
+
+ (local/snmpcheck) Many changes/improvements. Still very (usable) Beta.
+
+ (NEWS) Added this file!
+
+*3.0.1*
+
+ (agent/snmpd)
+ 2 Command line options added:
+ -l LOGFILE Outputs stderr/out to LOGFILE (overrides config.h def)
+ -L Do NOT write to a log file (overrides config.h)
+
+ (agent/snmpd)
+ New built in mib functions:
+ MIB.VERSIONMIBNUM.VERUPDATECONFIG (default: .1.3.6.1.4.10.100.11)
+ -- set to 'integer:1' to tell the agent to re-read the config file(s).
+
+ MIB.VERSIONMIBNUM.VERRESTARTAGENT (default: .1.3.6.1.4.10.100.12)
+ -- set to 'integer:1' to tell the agent to restart (exec and quits)
+
+ Bug fixes/more CMU clean up
+
+*3.0*
+
+ Initial (public) Release
diff --git a/PORTING b/PORTING
new file mode 100644
index 0000000..2d453f6
--- /dev/null
+++ b/PORTING
@@ -0,0 +1,104 @@
+--- INTRODUCTION
+
+Just a quick note on porting and sending me patches:
+
+First off, you probably should subscribe to
+net-snmp-coders@lists.sourceforge.net by sending a message to
+net-snmp-coders-request@lists.sourceforge.net with a subject line of
+subscribe. This is a mailing list to discuss all oft the coding
+aspects of the project.
+
+Additionally, you should probably be developing against the latest
+snapshot of the source code, which can be obtained through the
+net-snmp cvs server. Details can be found at
+http://www.net-snmp.org/cvs/.
+
+If you send patches to us, it would greatly help us if you sent them
+to us based on the current checked out copy from CVS. To do this,
+send us the output of "cvs diff -u" run in the top level net-snmp
+source tree after you have modified the files that will fix the
+problem or add the feature you're submitting the patch for.
+
+Quite a while back I started using the GNU autoconf testing suite to
+greatly enhance portability. Because of this porting to new
+architectures is much easier than before. However, new people porting
+the package to new architectures rarely take advantage of this setup
+and send me patches with lots of '#ifdef ARCH' type C code in it. Let
+me say up front, I *hate* this type of coding now (even though I used
+to use it a lot). What is better is to check for the necessary
+functionality using the configure script and then use the results of
+those tests.
+
+To do this, you need to install the GNU 'autoconf' package which also
+requires the GNU 'm4' (gm4) package as well. This double installation
+is extremely easy and shouldn't take you more than 15 minutes max.
+After that, modify the configure.in and acconfig.h files as needed
+instead of modifying the config.h or configure files directly. The
+Makefile will re-produce these files from the first two.
+
+Worst case: Don't put in #ifdef architecture style statements.
+Rather, create a new define in the s/ and m/ system specific header
+files and use those defines to test against in the C code. This
+should only be done for things that can't be checked using configure
+though.
+
+Some autoconf examples:
+
+--- HEADER FILES
+
+In configure.in:
+ AC_CHECK_HEADERS(headdir/header.h)
+
+Then in your source code:
+ #ifdef HAVE_HEADDIR_HEADER_H
+ #include <headdir/header.h>
+ #ENDIF
+
+--- LIBRARY ROUTIENS
+
+In configure.in:
+ AC_CHECK_LIB(libexample, example_function)
+
+Thats it. The Makefiles will automatically link against -llibexample
+if example_function is found in the library.
+
+--- FUNCTION CHECKS
+
+In configure.in:
+ AC_CHECK_FUNCS(example_function)
+
+In source code:
+ #ifdef HAVE_EXAMPLE_FUNCTION
+ /* use it */
+ #endif
+
+--- STRUCTURE MEMBER CHECKS
+
+In configure.in:
+ AC_CHECK_MEMBERS([struct STRUCTURE.MEMBER],,,[[
+#include lines
+]])
+ ^^^^^^^^^ ^^^^^^ (change)
+
+In source code:
+ #ifdef HAVE_STRUCT_STRUCTURE_MEMBER
+ /* use it */
+ #endif
+
+--- READ THE MANUAL
+
+The GNU autoconf info files are extremely well written and easy to
+follow. Please check them out.
+
+I'd be happy to help you through anything you don't understand or
+through more complex examples (eg, checking for structure parts or
+existance). I'd be far less happy to get patches ignoring the above
+request. If you simple can't abide by this, please send the patches
+anyway, but it'll just take me longer to get them applied.
+
+Submit the patch to http://www.net-snmp.org/patches/.
+Please include what version of the net-snmp package it was applied to
+and state the arcitectures you have tested it on.
+
+Thanks a lot for the consideration,
+Wes
diff --git a/README b/README
new file mode 100644
index 0000000..8263420
--- /dev/null
+++ b/README
@@ -0,0 +1,357 @@
+ README file for net-snmp Version: 5.7.2
+
+DISCLAIMER
+
+ The Authors assume no responsibility for damage or loss of system
+ performance as a direct or indirect result of the use of this
+ software. This software is provided "as is" without express or
+ implied warranty.
+
+TABLE OF CONTENTS
+
+ Disclaimer
+ Table Of Contents
+ Introduction
+* Supported Architectures
+ Availability
+ Web Page
+* Installation
+ Copying And Copyrights
+* Frequently Asked Questions
+ Helping Out
+* Code Update Announcements
+* Mailing Lists
+ Agent Extensibility
+ Example Agent Configuration and Usage
+ Configuration
+ Submitting Bug Reports
+ Closing
+ Thanks
+
+ * = Required Reading.
+
+INTRODUCTION
+
+ This package was originally based on the CMU 2.1.2.1 snmp code. It
+ has been greatly modified, restructured, enhanced and fixed. It
+ hardly looks the same as anything that CMU has ever released. It
+ was renamed from cmu-snmp to ucd-snmp in 1995 and later renamed from
+ ucd-snmp to net-snmp in November 2000.
+
+ This README file serves as a starting place to learn about the
+ package, but very little of the documentation is contained within
+ this file. The FAQ is an excellent place to start as well.
+ Additionally, there are a bunch of README files for specific
+ architectures and specific features. You might wish to look at some
+ of these other files as well.
+
+SUPPORTED ARCHITECTURES
+
+ Please see the FAQ for this information.
+
+ Please let us know if you compile it on other OS versions and it
+ works for you so we can add them to the above list.
+
+ Porting: Please! read the PORTING file.
+
+ Also note that many architecture have architecture specific README
+ files, so you should check to see if there is one appropriate to
+ your platform.
+
+AVAILABILITY
+
+ Download:
+ - http://www.net-snmp.org/download/
+ - ftp://ftp.net-snmp.org/pub/sourceforge/net-snmp/
+ Web page:
+ - http://www.net-snmp.org/
+ Project Wiki:
+ - http://www.net-snmp.org/wiki/
+ Sourceforge Project page:
+ - http://sourceforge.net/projects/net-snmp
+ Mirrors:
+ - US: ftp://ftp.freesnmp.com/mirrors/net-snmp/
+
+ The old ucd-snmp.ucdavis.edu web site and ftp server is now
+ offline and should not be accessed any longer.
+
+WEB PAGES
+
+ http://www.net-snmp.org/
+ http://sourceforge.net/projects/net-snmp
+ http://www.net-snmp.org/wiki/
+
+INSTALLATION
+
+ See the INSTALL file distributed with this package.
+
+COPYING AND COPYRIGHTS
+
+ See the COPYING file distributed with this package.
+
+FREQUENTLY ASKED QUESTIONS
+
+ See the FAQ file distributed with this package.
+ This is also available on the project Wiki at
+
+ http://www.net-snmp.org/wiki/index.php/FAQ
+
+ so that the wider Net-SNMP community can help maintain it!
+
+HELPING OUT
+
+ This is a project worked on by people around the net. We'd love
+ your help, but please read the PORTING file first. Also, subscribe
+ to the net-snmp-coders list described below and mention what you're
+ going to work on to make sure no one else is already doing so!
+ You'll also need to keep up to date with the latest code snap shot,
+ which can be obtained from CVS using the information found at
+ http://www.net-snmp.org/cvs/.
+
+ Contributions to the Net-SNMP source code in any form are greatly
+ appreciated. We expect the parties providing such contributions to
+ have the right to contribute them to the Net-SNMP project or that
+ the parties that do have the right have directed the person
+ submitting the contribution to do so. In addition, all contributors
+ need to be aware that if the contribution is accepted and
+ incorporated into the Net-SNMP project, it will be redistributed
+ under the terms of the license agreement used for the entire body of
+ work that comprises the Net-SNMP project (see the COPYING file for
+ details). If this license agreement ever changes the contribution
+ will continue to be released under any new licenses as well. Thank
+ you, in advance, for your gracious contributions.
+
+CODE UPDATE ANNOUNCEMENTS
+
+ See the NEWS file and the ChangeLog file for details on what has
+ changed between releases.
+
+ We hate broadcasting announce messages to other mailing lists and
+ newsgroups, so there is a mailing list set up to handle release
+ announcements. Any time we put new software out for ftp, we'll mail
+ this fact to net-snmp-announce@lists.sourceforge.net. See the
+ MAILING LISTS section described below to sign up for these
+ announcements.
+
+ We will post new announcements on a very infrequent basis to the
+ other channels (the other snmp mailing lists and newsgroups like
+ comp.protocols.snmp), but only for major code revisions and not for
+ bug-fix patches or small feature upgrades.
+
+MAILING LISTS
+
+ The lists:
+
+ A number of mailing lists have been created for support of the project:
+ The main ones are:
+
+ net-snmp-announce@lists.sourceforge.net -- For official announcements
+ net-snmp-users@lists.sourceforge.net -- For usage discussions
+ net-snmp-coders@lists.sourceforge.net -- For development discussions
+
+ The -coders list is intended for discussion on development of code
+ that will be shipped as part of the package. The -users list is
+ for general discussion on configuring and using the package,
+ including issues with coding user-developed applications (clients,
+ managers, MIB modules, etc).
+
+ Please do *NOT* send messages to both -users and -coders lists.
+ This is completely unnecessary, and simply serves to further
+ overload (and annoy) the core development team. If in doubt,
+ just use the -users list.
+
+
+ The other lists of possible interest are:
+
+ net-snmp-cvs@lists.sourceforge.net -- For cvs update announcements
+ net-snmp-bugs@lists.sourceforge.net -- For Bug database update announcements
+ net-snmp-patches@lists.sourceforge.net -- For Patch database update announcements
+
+ Please do NOT post messages to these lists (or to the announce list above).
+ Bug reports and Patches should be submitted via the Source Forge tracker
+ system. See the main project web pages for details.
+
+ To subscribe to any of these lists, please see:
+
+ http://www.net-snmp.org/lists/
+
+
+ Archives:
+ The archives for these mailing lists can be found by following links at
+
+ http://www.net-snmp.org/lists/
+
+AGENT EXTENSIBILITY
+
+ The agent that comes with this package is extensible through use of
+ shell scripts and other methods. See the configuration manual pages
+ (like snmpd.conf) and run the snmpconf perl script for further details.
+
+ You can also extend the agent by writing C code directly. The agent
+ is extremely modular in nature and you need only create new files,
+ re-run configure and re-compile (or link against its libraries). No
+ modification of the distributed source files are necessary. See the
+ following files for details on how to go about this:
+ http://www.net-snmp.org/tutorial-5/toolkit/,
+ agent/mibgroup/examples/*.c
+
+ Also, see the local/mib2c program and its README file for help in
+ turning a textual mib description into a C code template.
+
+ We now support AgentX for subagent extensibility. The net-snmp
+ agent can run as both a master agent and a subagent. Additionally,
+ a toolkit is provided that enables users of it to easily embed a
+ agentx client into external applications. See the tutorial at
+ http://www.net-snmp.org/tutorial-5/toolkit/ for an example of how
+ go about doing this.
+
+CONFIGURATION
+
+ See the man/snmp.conf.5 manual page.
+
+ For the agent, additionally see the man/snmpd.conf.5 manual page.
+
+ For the snmptrapd, see the man/snmptrapd.conf.5 manual page.
+
+ You can also run the snmpconf perl script to help you create some of
+ these files.
+
+SUBMITTING BUG REPORTS
+
+ Important: *Please* include what version of the net-snmp (or
+ ucd-snmp) package you are using and what architecture(s) you're
+ using, as well as detailed information about exactly what is wrong.
+
+ To submit a bug report, please use the web interface at
+ http://www.net-snmp.org/bugs/. It is a full-fledged
+ bug-tracking system that will allow you to search for already
+ existing bug reports as well as track the status of your report as
+ it is processed by the core developers.
+
+ If you intend to submit a patch as well, please read the PORTING
+ file before you do so and then submit it to
+ http://www.net-snmp.org/patches/.
+
+CLOSING
+
+ We love patches. Send some to us! But before you do, please see
+ the 'PORTING' file for information on helping us out with the
+ process of integrating your patches (regardless of whether its a new
+ feature implementation or a new port).
+
+ Also, We're interested if anyone actually uses/likes/hates/whatever
+ this package... Mail us a note and let us know what you think of it!
+
+ Have fun and may it make your life easier,
+
+ The net-snmp developers
+
+THANKS
+
+ The following people have contributed various patches and
+ improvements. To them we owe our deepest thanks (and you do too!):
+
+ Wes Hardaker <hardaker@users.sourceforge.net>
+ Steve Waldbusser <waldbusser@nextbeacon.com>
+ Dan A. Dickey <ddickey@transition.com>
+ Dave Shield <D.T.Shield@csc.liv.ac.uk>
+ Giovanni S. Marzot <gmarzot@nortelnetworks.com>
+ Niels Baggesen <nba@users.sourceforge.net>
+ Simon Leinen <simon@limmat.switch.ch>
+ David T. Perkins <dperkins@dsperkins.com>
+ Mike Perik <mikep@crt.com>
+ Sanjai Narain <narain@thumper.bellcore.com>
+ francus@metsny.delphi.com
+ Gary Palmer <gpalmer@freebsd.org>
+ Marc G. Fournier <scrappy@ki.net>
+ Gary A. Hayward <gah@bellcore.com>
+ Jennifer Bray <jbray@origin-at.co.uk>
+ Philip Guenther <guenther@gac.edu>
+ Elwyn B Davies <edavies@origin-at.co.uk>
+ Simon Burge <simonb@telstra.com.au>
+ David Paul Zimmerman <dpz@apple.com>
+ Alan Batie <batie@aahz.jf.intel.com>
+ Michael Douglass <mikedoug@texas.net>
+ Ted Rule <Ted_Rule@FLEXTECH.CO.UK>
+ Craig Bevins <craigb@bitcom.net.au>
+ Arther Hyun <arthur@psi.com>
+ Cristian Estan <Cristian.Estan@net.utcluj.ro>
+ Eugene Polovnikov <eugen@rd.zgik.zaporizhzhe.ua>
+ Jakob Ellerstedt <jakob@dynarc.se>
+ Michael J. Slifcak <slif@bellsouth.net>
+ Jonas Olsson <jolsson@erv.ericsson.se>
+ James H. Young <sysjhy@gsu.edu>
+ Jeff Johnson <jbj@redhat.com>
+ Markku Laukkanen <marlaukk@stybba.ntc.nokia.com>
+ Derek Simkowiak <dereks@kd-dev.com>
+ David F. Newman <dnewman@epnet.com>
+ Nick Amato <naamato@merit.edu>
+ Mike Baer <baerm@calweb.com>
+ Patrick Lawrence <pjlawrence@ucdavis.edu>
+ Russ Mundy <mundy@tislabs.com>
+ Olafur Gudmundsson <ogud@tislabs.com>
+ David Reeder <dreeder@tislabs.com>
+ Ed Lewis <lewis@tislabs.com>
+ Bill Babson <wbabson@tislabs.com>
+ Chris Smith <csmith@platform.com>
+ Mike Michaud <mikemichaud@earthlink.net>
+ Andy Hood <ahood@westpac.com.au>
+ Robert Story <rstory@freesnmp.com>
+ Bert Driehuis <driehuis@playbeing.org>
+ Juergen Schoenwaelder <schoenw@ibr.cs.tu-bs.de>
+ Frank Strauss <strauss@ibr.cs.tu-bs.de>
+ Ragnar Kjørstad <ucd@ragnark.vestdata.no>
+ Jochen Kmietsch <jochen.kmietsch@tu-clausthal.de>
+ Jun-ichiro itojun Hagino <itojun@iijlab.net>
+ John L Villalovos <john.l.villalovos@intel.com>
+ Christoph Mammitzsch <Christoph.Mammitzsch@tu-clausthal.de>
+ Arne Oesleboe <Arne.Oesleboe@item.ntnu.no>
+ Jeff Cours <jeff@ultradns.com>
+ Karl Schilke <karl_schilke@eli.net>
+ John Naylon <jbpn@cambridgebroadband.com>
+ Ken Hornstein <kenh@cmf.nrl.navy.mil>
+ Martin Oldfield <m@mail.tc>
+ Harrie Hazewinkel <harrie@users.sourceforge.net>
+ Mark Ferlatte <ferlatte@users.sourceforge.net>
+ Marus Meissner <marcusmeissner@users.sourceforge.net>
+ Stephan Wenzer <stephanwenzel@users.sourceforge.net>
+ Ron Mevissen <ron.mevissen@eed.ericsson.se>
+ T.J. Mather <tjmather@tjmather.com>
+ Craig Setera <seterajunk@charter.net>
+ Katsuhisa ABE <abekatsu@cysols.com>
+ Axel Kittenberger <Axel.Kittenberger@maxxio.com>
+ Johannes Schmidt-Fischer <jsf@InterFace-AG.com>
+ Jeffrey Watson <nostaw@users.sourceforge.net>
+ Bruce Shaw <Bruce.Shaw@gov.ab.ca>
+ Stefan Radman <sradman@users.sourceforge.net>
+ Stephen J. Friedl <sjfriedl@users.sourceforge.net>
+ Alex Burger <alex_b@users.sourceforge.net>
+ Christophe Varoqui <ext.devoteam.varoqui@sncf.fr>
+ Srikanth Pindiproli <sripindip@users.sourceforge.net>
+ Kevin Graham <kevgraham7@users.sourceforge.net>
+ Xiaofeng Ling <xfling@users.sourceforge.net>
+ Brandon Knitter <knitterb@bl...>
+ Andrew Findlay <andrew.findlay@skills-1st.co.uk>
+ Ron Tabor <rtabor@users.sourceforge.net>
+ Peter Warasin <drg-r3@users.sourceforge.net>
+ Bob Rowlands <robert.rowlands@sun.com>
+ Peter Hicks <Peter.Hicks@POGGS.CO.UK>
+ Andy Smith <wasmith32@earthlink.net>
+ Nick Barkas <nbarkas@users.sourceforge.net>
+ Noah Friedman <friedman@prep.ai.mit.edu>
+ Geert De Peuter <geert@depeuter.org>
+ Magnus Fromreide <magfr@lysator.liu.se>
+ Marcus Meissner <marcusmeissner@users.sourceforge.net>
+ Andrew Rucker Jones <arjones@users.sourceforge.net>
+ Dai.H. <dg-f@users.sourceforge.net>
+ Thomas Anders <tanders@users.sourceforge.net>
+ Vladislav Bogdanov <slava_reg@nsys.by>
+ Peter Martin <pnmartin@users.sourceforge.net>
+ Thomas Lackey <telackey@users.sourceforge.net>
+ Joe Buehler <jbuehler@spirentcom.com>
+ Anders Persson <apersson@users.sourceforge.net>
+ Rojer <rojer@users.sourceforge.net>
+ Bart Van Assche <bart.vanassche@gmail.com>
+
+ We've probably forgotten people on this list. Let us know if you've
+ contributed code and we've left you out.
diff --git a/README.Panasonic_AM3X.txt b/README.Panasonic_AM3X.txt
new file mode 100644
index 0000000..7b4676d
--- /dev/null
+++ b/README.Panasonic_AM3X.txt
@@ -0,0 +1,118 @@
+1. INTRODUCTION
+
+ Last revision 05/30/2003
+
+ This document describes the process to build net-snmp-5.0.8 stack for embedded linux
+ platforms based on the following Matsushita(Panasonic) processors family.
+
+ AM33,AM34
+ MN10300,MN103E0HRA
+
+ The same procedure can be followed to build the net-snmp stack for other Matsushita
+ family of processors also.
+
+2. ENVIRONMENT
+
+ Host Machine : Linux 7.1 or later ( with nfs server or samba server installed ).
+ Target Machine : Am33 Based Embedded platform.
+ Cross-compiler : GNU compiler version 3.1 for AM33/AM34/MN10300/MN103E010HRA
+ am33_2.0-linux-gnu-gcc
+ Host-Target Setup : Samba mount or NFS mount
+
+
+2. CONFIGURATION
+
+ The following configuration flags can be used to create Makefile.You can reaplce
+ some of the configuration flags according to your platform and compiler.
+
+ Perl support was NOT compiled in due to unavailability of perl support for
+ AM3X platform at this time.
+
+ The parameters passed to configure are as follows...
+ ( you can down load the script configure.am33 script )
+
+ --with-cc=am33_2.0-linux-gnu-gcc
+ --host=i686-pc-linux-gnu
+ --target=am33-linux ( Can be removed, if it stops building process )
+ --disable-dlopen
+ --disable-dlclose
+ --disable-dlerror
+ --with-endianness=little
+ --with-openssl=no
+ --with-cflags="-g -mam33 -O2 -static"
+ --oldincludedir=./usr/local
+ --prefix=./usr/local
+ --exec-prefix=./usr/local
+ --with-persistent-directory=./usr/local
+
+ These parameters passed are depending on the capabilities available for the
+ AM33/AM34 development environment at the time of build. These parameter can be
+ changed depending on the avialable capabilities and desired preferences.
+
+ You can use the below shell script directly to create Makefiles and other files.
+ This script also insttals all binaries ,libraries in usr directory in the directory
+ in which this scrip executed.
+
+# configure.am33
+#--------------------------------------------------------------------------
+./configure --with-cc=am33_2.0-linux-gnu-gcc --host=i686-pc-linux-gnu \
+--disable-dlopen --target=am33-linux --disable-dlclose --disable-dlerror \
+--with-endianness=little --with-openssl=no --with-cflags="-g -mam33 -O2 -static" \
+--oldincludedir=./usr/local --prefix=./usr/local --exec-prefix=./usr/local \
+--with-persistent-directory=./usr/local
+
+make
+make install
+#--------------------------------------------------------------------------
+
+2. INSTALLATION
+
+ Find a partition with 60 Mb available space which will be mounted on to target machine.
+ Copy or ftp the binary to this location ( copy entire usr directory tree ).
+ Copy net-snmp configuration files from host machine (.snmp directory) on to target / directory.
+ snmp configuration files can be created on host machine by running sbmpconf command. Make sure
+ that host is using snmpconf from net-snmp-5.0.8 version.
+
+ -:ON AM3X target Shell :-
+ Mount the above directory on AM3X platform either using NFS or sambs clients on target machine.
+
+ If you are running a previous version, stop the daemon
+
+ ps -ef | grep snmp
+
+ will return something like:
+
+ root 17736 1 - Jan 26 ? 0:00 /usr/local/sbin/snmpd
+
+ the PID is 17736, so you need to type
+
+ kill {PID}
+
+ in our example this would be
+
+ kill 17736.
+
+ cd /usr/local/sbin
+ ./snmpd
+
+2. TESTING
+
+ You will need to know your SNMP community. For this example, we will use "public".
+
+ snmpwalk -v 2c -m ALL -c public -t 100 localhost .1.3 > snmpwalk.txt
+ more snmpwalk.txt
+
+ This should return a considerable amount of output.
+
+3. ISSUES
+
+ You may not see correct target name in the build summary. Just ignore it.
+
+
+ Please refer net-snmp documentation for more information...
+
+
+Srinivasa Rao Gurusu
+Engineer
+Panasonic Semiconductor Development Center ( PSDC )
+gurusus@research.panasonic.com
diff --git a/README.agent-mibs b/README.agent-mibs
new file mode 100644
index 0000000..53f1caa
--- /dev/null
+++ b/README.agent-mibs
@@ -0,0 +1,462 @@
+The following is a list of SNMP MIB tables and object, and their
+implementation status for Net-SNMP.
+
+Note that simply adding a MIB file does not allow the agent to return values
+for the MIB. See the FAQ question here for details:
+
+ http://www.net-snmp.org/FAQ.html#How_do_I_add_a_MIB_to_the_agent_
+
+
+This table was generated by inspecting the source, so it may be incorrect,
+especially with regards to OS platform support. If an object/table is listed
+for your OS but doesn't work (or vice-cersa), let us know.
+
+The Rel column indicates the first release that an object/table was
+available. That does not imply that all platforms indicated in the OS
+column were supported for that release. There is no breakdown of feature
+introduction by platform. Note that the earliest CVS information I could
+find was for sometime around ucd-snmp 3.2.
+
+The OS platform is probably the least reliable of the columns, as most are
+marked as 'unix?', indicating that most unix-based platforms should
+support the table.
+
+An '=' in a file path indicates that the table/object name should be
+substituted in place of the '=' in the path. All paths are relative to
+the agent/mibgroup directory.
+
+X.*.0 indicates all scalars under node X.
+X.?.0 indicates all scalars execept as noted.
+.Y.0 indicates that Y is an exception to the previous scalar group.
+
+
+Table Style
+----------------------------
+ O old (ucd) style helper
+ D table data helper
+ I table iterator
+ A iterate_access
+ S scalar helper
+ G scalar group helper
+ W watched scalar
+ M mfd
+ C container table
+
+Platform Keys
+------------------
+A All systems
+U unix based
+ L Linux
+ S Solaris
+ H HP-UX
+ B BSD Based
+ F FreeBSD
+ O OpenBSD
+ N NetBSD
+ X MacOSX
+W Win32 based
+ $ Microsoft
+ C cygwi---
+ M MingW
+
+A number after a platform indicates notes at the bottom of the file.
+
+ table/object group OS Rel Styl File
+==============================================================================
+SNMPv2-MIB
+ system.?.0 A 5.5 W mibII/system_mib.c
+ .sysORLastChange.0 A 5.5 W mibII/sysORTable.c
+ sysORTable A 5.5 C mibII/sysORTable.c
+ snmp.*.0 A 5.5 G mibII/snmp_mib_5_5.c
+ setSerialNo.0 A 5.0 W mibII/setSerialNo.c
+
+------------------------------------------------------------------------------
+SNMP-FRAMEWORK-MIB
+ snmpEngine.*.0 A ~4.0? O snmpv3/snmpEngine.c
+
+------------------------------------------------------------------------------
+SNMP-MPD-MIB
+ snmpMPDStats.*.0 A ~4.0? G snmpv3/snmpMPDStats_5_5.c
+
+------------------------------------------------------------------------------
+SNMP-TARGET-MIB
+ snmpTargetSpinLock.0 A 3.6 O target/snmpTargetAddrEntry.c
+ snmpTargetAddrTable A 3.6 O target/snmpTargetAddrEntry.c
+ snmpTargetParamsTable A 3.6 O target/snmpTargetParamsEntry.c
+ snmpUnavailableContexts.0 A 5.5 G target/target_counters_5_5.c
+ snmpUnknownContexts.0 A 5.5 G target/target_counters_5_5.c
+
+------------------------------------------------------------------------------
+SNMP-NOTIFICATION-MIB
+ snmpNotifyTable A 4.2 O notification/=
+ snmpNotifyFilterProfileTable A 4.2 O notification/=
+ snmpNotifyFilterTable A 4.2 O notification/=
+ nlmConfig.*.0 ---
+ nlmStats.*.0 ---
+
+------------------------------------------------------------------------------
+NOTIFICATION-LOG-MIB
+ * ---
+
+------------------------------------------------------------------------------
+SNMP-PROXY-MIB
+ snmpProxyTable ---
+
+------------------------------------------------------------------------------
+SNMP-USER-BASED-SM-MIB
+ usmStats.*.0 A ~4.0 O snmpv3/usmStats.c
+ usmStats.*.0 A 5.5 G snmpv3/usmStats_5_5.c
+ usmUserTable A ~4.0? O snmpv3/usmUser.c
+
+------------------------------------------------------------------------------
+SNMP-VIEW-BASED-ACM-MIB
+ vacmContextTable A ~3.5 I mibII/vacm_context.c
+ vacmSecurityToGroupTable A ~3.5 O
+ vacmAccessContextTable A ~3.5 O mibII/vacm_vars.c
+ vacmViewSpinLock.0 A ~3.5 O
+ vacmViewTreeFamilyTable A ~3.5 O
+
+------------------------------------------------------------------------------
+SNMP-USM-DH-OBJECTS-MIB
+ usmDHPublicObjects.*.0 A 5.2 S snmp-usm-dh-objects-mib/=/*
+ usmDHUserKeyTable A 5.2 M snmp-usm-dh-objects-mib/=/*
+ usmDHKickstartTable ---
+
+------------------------------------------------------------------------------
+SNMP-COMMUNITY-MIB
+ snmpCommunityMIBObjects.*.0 ---
+ snmpCommunityTable ---
+ snmpTargetAddrExtTable ---
+
+------------------------------------------------------------------------------
+IF-MIB
+ ifNumber.0 U $2 ~3.2 O mibII/interfaces.c
+ ifTableLastChange.0 ---
+ ifTable (old) U $2 ~3.5 O mibII/interfaces.c
+ ifTable (new) L 5.2 M if-mib/ifTable/*
+ ifTable (new) FOS 5.4 M if-mib/ifTable/*
+ ifXTable L 5.2 M if-mib/ifXTable/*
+ ifXTable FOS 5.4 M if-mib/ifXTable/*
+ ifStackLastChange.0 ---
+ ifStackTable ---
+ ifTestTable ---
+ ifRcvAddressTable ---
+
+------------------------------------------------------------------------------
+RFC1213-MIB
+ atTable (D) U $2 ~3.5 O mibII/at.c
+ egp.*.0 ---
+ egpNeighTable ---
+
+------------------------------------------------------------------------------
+IP-MIB
+ ip.*.0 U $2 ~3.2 G mibII/ip.c
+ icmp.*.0 U $2 ~3.2 G mibII/icmp.c
+
+ ipSystemStatsTable L 5.2 M ip-mib/=/*
+ ipSystemStatsTable S 5.5 M ip-mib/=/*
+ ipIfStatsTableLastChange.0 ---
+ ipIfStatsTable L-- 5.5 M ip-mib/=/*
+
+ ipAddrTable (D) U $2 4.2 O mibII/ipAddr.c
+ ipAddressSpinLock.0 A 5.5 O mibII/ipAddr.c
+ ipAddressTable L 5.2 M ip-mib/=/*
+ ipAddressTable S 5.5 M ip-mib/=/*
+ ipAddressPrefixTable L 5.3 M ip-mib/=/*
+
+ ipRouteTable (D) U $2 ~3.5 O mibII/*route*.c
+ ipNetToMediaTable (D) U $2 ~3.5 O mibII/at.c
+ ipNetToPhysicalTable (implemented as inetNetToMediaTable)
+ inetNetToMediaTable L 5.2 M ip-mib/=/*
+ ipDefaultRouterTable L 5.5 M ip-mib/=/*
+
+ icmpStatsTable ---
+ icmpMsgStatsTable ---
+
+ ipv4InterfaceTableLastChange ---
+ ipv4InterfaceTable L 5.3 M ip-mib/=/*
+
+ ipv6InterfaceTableLastChange ---
+ ipv6InterfaceTable L 5.3 M ip-mib/=/*
+ ipv6RouterAdvertTable ---
+ ipv6IpForwarding.0 L 5.3 S ip-mib/ip_scalars.c
+ ipv6IpDefaultHopLimit.0 L 5.3 S ip-mib/ip_scalars.c
+ ipv6RouterAdvertSpinLock.0 ---
+ ipv6ScopeZoneIndexTable ---
+
+ ipForwarding.0 L 5.4 S ip-mib/ip_scalars.c
+ ipDefaultTTL.0 L 5.4 S ip-mib/ip_scalars.c
+
+------------------------------------------------------------------------------
+IPV6-MIB
+ ipv6MIBObjects.?.0 U 4.1 O mibII/ipv6.c
+ .ipv6IfTableLastChange.0 ---
+ .ipv6RouteNumber.0 ---
+ .ipv6DiscardedRoutes.0 ---
+ ipv6Interfaces U1 4.1 O mibII/ipv6.c
+ ipv6IfTable U1 4.1 O mibII/ipv6.c
+ ipv6IfStatsTable U1 4.1 O mibII/ipv6.c
+ ipv6AddrPrefixTable ---
+ ipv6AddrTable ---
+ ipv6RouteTable ---
+ ipv6NetToMediaTable ---
+
+------------------------------------------------------------------------------
+IPV6-TCP-MIB
+ ipv6TcpConnTable U1 4.1 O mibII/ipv6.c
+
+------------------------------------------------------------------------------
+IPV6-UDP-MIB
+ ipv6UdpTable U1 4.1 O mibII/ipv6.c
+
+------------------------------------------------------------------------------
+IPV6-ICMP-MIB
+ ipv6IfIcmpTable U1 4.1 O mibII/ipv6.c
+
+------------------------------------------------------------------------------
+IP-FORWARD-MIB
+ ipForward.*.0 ---
+ ipForwardTable (D) ---
+ ipCidrRouteTable (D)(new) L 5.2 A mibII/=
+ ipCidrRouteTable (D)(newer) L 5.2 M ip-forward-mib/=/*
+ inetCidrRouteTable L 5.2 M ip-forward-mib/=/*
+
+------------------------------------------------------------------------------
+TCP-MIB
+ tcp.*.0 U $2 ~3.2 G mibII/tcp.c
+ tcpConnTable (D) U $2 4.2 I mibII/tcpTable.c
+ tcpConnectionTable L 5.3 M tcp-mib/=/*
+ tcpConnectionTable S 5.4 M tcp-mib/=/*
+ tcpListenerTable L 5.3 M tcp-mib/=/*
+ tcpListenerTable S 5.4 M tcp-mib/=/*
+
+------------------------------------------------------------------------------
+UDP-MIB
+ udpEndpointTable L 5.3 M udp-mib/=/*
+ udpEndpointTable S 5.4 M udp-mib/=/*
+ udp.*.0 U $2 ~3.2 G mibII/udp.c
+ udpTable (D) U $2 4.2 I mibII/udpTable.c
+
+------------------------------------------------------------------------------
+IF-INVERTED-STACK-MIB
+ * ---
+
+------------------------------------------------------------------------------
+RMON-MIB
+ etherStatsTable U 5.0 O Rmon/statistics.c
+ .etherStatsJabbers L3 5.5 M rmon-mib/=/*
+ etherHistoryControlTable U 5.0 O Rmon/history.c
+ etherHistoryTable U 5.0 O Rmon/history.c
+ alarmTable U 3.2 O Rmon/alarm.c
+ eventTable U 3.2 O Rmon/event.c
+ logTable U 5.0 O Rmon/event.c
+ hostControlTable ---
+ hostTable ---
+ hostTimeTable ---
+ hostTopNControlTable ---
+ hostTopNTable ---
+ matrixControlTable ---
+ matrixSDTable ---
+ matrixDSTable ---
+ filterTable ---
+ channelTable ---
+ bufferControlTable ---
+ captureBufferTable ---
+
+------------------------------------------------------------------------------
+HOST-RESOURCES-MIB
+ hrSystem.*.0 U ~3.3 O host/hr_system.c
+ hrMemorySize U ~3.3 O host/hr_storage.c
+ hrStorageTable U ~3.3 O host/hr_storage.c
+ hrDeviceTable U ~3.3 O host/hr_device.c
+ hrProcessorTable U ~3.3 O host/hr_proc.c
+ hrNetworkTable U ~3.3 O host/hr_network.c
+ hrPrinterTable U ~3.3 O host/hr_print.c
+ hrDiskStorageTable U ~3.3 O host/hr_disk.c
+ hrPartitionTable U ~3.3 O host/hr_partition.c
+ hrFSTable U ~3.3 O host/hr_filesys.c
+ hrSWOSIndex.0 --- ~3.3 O host/hr_swrun.c
+ hrSWRunTable U ~3.3 O host/hr_swrun.c
+ hrSWRunPerfTable U ~3.3 O host/hr_swrun.c
+ hrSWInstalled.*.0 U ~3.3 O host/hr_swinst.c
+ hrSWInstalledTable U ~3.3 O host/hr_swinst.c
+
+------------------------------------------------------------------------------
+DISMAN-EVENT-MIB
+ mteTriggerTable A 5.0 O disman/=
+ mteTriggerFailures.0 ---
+ mteTriggerDeltaTable A 5.0 O disman/=
+ mteTriggerExistenceTable A 5.0 O disman/=
+ mteTriggerBooleanTable A 5.0 O disman/=
+ mteTriggerThresholdTable A 5.0 O disman/=
+ mteObjectsTable A 5.0 O disman/=
+ mteEventTable A 5.0.7 D disman/=
+ mteEventFailures.0 ---
+ mteEventNotificationTable A 5.0.7 D disman/=
+ mteResource.*.0 ---
+ mteEventSetTabel ---
+
+------------------------------------------------------------------------------
+DISMAN-SCHEDULE-MIB
+ schedLocalTime.0 A 5.3 D disman/schedule/=
+ schedTable A 5.3 D disman/schedule/=
+
+------------------------------------------------------------------------------
+DISMAN-EXPRESSION-MIB (expired ID)
+ expErrorTable U 5.2 O disman/expression/=
+ expExpressionTable U 5.2 O disman/expression/=
+ expObjectTable U 5.2 O disman/expression/=
+ expValueTable U 5.2 O disman/expression/=
+
+------------------------------------------------------------------------------
+DISMAN-PING-MIB (draft-ietf-disman-remops-mib-v2*)
+ pingCtlTable U 5.2 O disman/ping/=
+ pingProbeHistoryTable U 5.2 O disman/ping/=
+ pingResultsTable U 5.2 O disman/ping/=
+
+------------------------------------------------------------------------------
+DISMAN-TRACEROUTE-MIB (draft-ietf-disman-remops-mib-v2*)
+ traceRouteCtlTable U 5.2 O disman/traceroute/=
+ traceRouteHopsTable U 5.2 O disman/traceroute/=
+ traceRouteProbeHistory U 5.2 O disman/traceroute/=
+ traceRouteResultsTable U 5.2 O disman/traceroute/=
+
+------------------------------------------------------------------------------
+DISMAN-NSLOOKUP-MIB (draft-ietf-disman-remops-mib-v2*)
+ lookupCtlTable U 5.2 O disman/nslookup/=
+ lookupResultsTable U 5.2 O disman/nslookup/=
+
+------------------------------------------------------------------------------
+DISMAN-SCRIPT-MIB
+ * ---
+
+------------------------------------------------------------------------------
+EtherLike-MIB
+ dot3StatsTable L 5.5 M etherlike-mib/=
+
+------------------------------------------------------------------------------
+AGENTX-MIB
+ * ---
+
+------------------------------------------------------------------------------
+LM-SENSORS-MIB
+ lmTempSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
+ lmFanSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
+ lmVoltSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
+ lmMiscSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
+
+------------------------------------------------------------------------------
+UCD-SNMP-MIB
+ prTable U $ ~3.2 O ucd-snmp/proc.c
+ memory.*.0 U ~3.2 O ucd-snmp/memory*.c
+ extTable U $ ~3.2 D ucd-snmp/extensible.c
+ dskTable U 3.2 O ucd-snmp/disk.c
+ fileTable A 3.6 O ucd-snmp/file.c
+ laTable U $ ~3.2 O ucd-snmp/loadave.c
+ systemStats.*.0 U 3.4 O ucd-snmp/vmstat*.c
+ ipFwAccTable U 3.5 O misc/ipfwacc.c
+ dlModTable U 4.2 O ucd-snmp/dlmod.c
+ diskIOTable U 4.1 O ucd-snmp/diskio.c
+ ucdDemoMIBObjects A ~3.5 O examples/ucdDemoPublic.c
+ logMatch U ~3.5 O ucd-snmp/logmatch.c
+ version.*.0 A ~3.2 O ucd-snmp/versioninfo.c
+ snmperrs.*.0 A ~3.5 O ucd-snmp/errormib.c
+ mrTable (D) ---
+
+------------------------------------------------------------------------------
+NET-SNMP-EXTEND-MIB
+ nsExtendConfigTable U ~3.5 D agent/extend.c
+ nsExtendOutput1Table U ~3.5 D agent/extend.c
+ nsExtentOutput2Table U ~3.5 D agent/extend.c
+
+------------------------------------------------------------------------------
+NET-SNMP-AGENT-MIB
+ nsModuleTable A 5.0 I agent/nsModuleTable.c
+ nsCacheTable A 5.0 I agent/nsCache.c
+ nsConfigDebug.*.0 A 5.0 I agent/nsDebug.c
+ nsDebugTokenTable A 5.0 O
+ nsConfigLogging A 5.0 I agent/nsLogging.c
+ nsLoggingTable A 5.0 O
+ nsTransactionTable A 5.0 I agent/nsTransactionTable.c
+ netSnmpExampleScalars A 5.0 O
+ netSnmpIETFWGTable A 5.0 D examples/data_set.c
+ netSnmpHostsTable A 5.0 A examples/=*
+ nstAgentModules A 5.0 O
+
+------------------------------------------------------------------------------
+NET-SNMP-VACM-MIB
+ nsVacmAccessTable A 5.4 I agent/nsVacmAccessTable.c
+
+------------------------------------------------------------------------------
+MTA-MIB
+ mtaTable U 4.2 O mibII/mta_sendmail.c
+ mtaGroupTable U 4.2 O mibII/mta_sendmail.c
+
+------------------------------------------------------------------------------
+SMUX-MIB
+ smuxPeerTable ---
+ smuxTreeTable ---
+
+------------------------------------------------------------------------------
+BGP4-MIB (draft-ietf-idr-bgp4-mib)
+ bgpPeerTable A 3.5 O smux/snmp_bgp.c
+
+------------------------------------------------------------------------------
+OSPF-MIB (draft-ietf-ospf-mib-update)
+ * A 3.5 O smux/snmp_ospf.c
+
+------------------------------------------------------------------------------
+RIPv2-MIB
+ * A 3.5 O smux/snmp_rip2.c
+
+------------------------------------------------------------------------------
+TUNNEL-MIB
+ tunnelIfTable L 4.2 O tunnel/tunnel.c
+ tunnelConfigTable L 4.2 O tunnel/tunnel.c
+ tunnelInetConfigTable ---
+
+------------------------------------------------------------------------------
+SCTP-MIB
+ sctpStats L 5.5 S sctp-mib/sctpScalars*
+ sctpParameters L 5.5 S sctp-mib/sctpScalars*
+ sctpAssocTable L 5.5 C sctp-mib/=
+ sctpAssocLocalAddrTable L 5.5 C sctp-mib/=
+ sctpAssocRemAddrTable L 5.5 C sctp-mib/=
+ sctpLookupLocalPortTable L 5.5 C sctp-mib/=
+ sctpLookupRemPortTable L 5.5 C sctp-mib/=
+ sctpLookupRemHostNameTable L 5.5 C sctp-mib/=
+ sctpLookupRemPrimIPAddrTable L 5.5 C sctp-mib/=
+ sctpLookupRemIPAddrTable L 5.5 C sctp-mib/=
+
+------------------------------------------------------------------------------
+SNMP-TSM-MIB
+ snmpTsmStats A 5.6 D tsm-mib/snmpTsmStats/=
+ snmpConfiguration A 5.6 W tsm-mib/=
+
+------------------------------------------------------------------------------
+TLSTM-MIB
+ snmpTlstmSession A 5.6 W tlstm-mib/=/*
+ tlstmCertificateMapping.* A 5.6 w tlstm-mib/=
+ tlstmCertToTSNTable A 5.6 D tlstm-mib/=/*
+ tlstmParamsTable A 5.6 D tlstm-mib/=/*
+ tlstmAddrTable A 5.6 D tlstm-mib/=/*
+
+==============================================================================
+
+Misc notes
+----------
+ 1: available for systems using KAME ipv6
+ 2: with platform SDK. See README.win32
+ 3: works only with Intel and Broadcom network cards and must run as root only
+
+Other feature info
+------------------
+ smux 3.2
+ AgentX 4.0
+ proxy support 4.2
+ override token 5.0
+ proper context support 5.2
+ DISMAN-EVENT-MIB implementation rewrite 5.3
+ AgentX, host, disman/event by default 5.3
+ SSH Transport module 5.5
+ (D)TLS Transport module 5.6
diff --git a/README.agentx b/README.agentx
new file mode 100644
index 0000000..b88d553
--- /dev/null
+++ b/README.agentx
@@ -0,0 +1,47 @@
+ Net-SNMP contains a reasonably full implementation of the AgentX agent
+extensibility protocol (RFC 2741) in as much as it supports all
+the protocol operations described in this document. The core
+functionality has received a reasonable amount of exposure, and
+is believed to be more or less stable in normal use. It will
+also handle the non-graceful termination of subagents - returning
+a 'genErr' error for three successive requests before unregistering
+the unresponsive subagent.
+
+ A subagent will attempts to re-establish contact with a dead and
+resurrected master based on the agentxPingInterval setting. The default
+for this configuration variable is 15 seconds. It can be changed by
+putting the following line in your APPLICATION.conf file:
+
+ agentxPingInterval 60
+
+will make the subagent try to ping the master every 60 seconds, and if
+the connection is deemed broken it'll try and reconnect to the master
+agent after that point (once every 60 seconds).
+
+ Similarly, a subagent will not be able to re-register in place of a
+defunct colleague until the master agent has received three requests
+for the dead connection (and hence unregistered it).
+
+ Some of the less frequently used features (index allocation,
+range registration, etc), have received less thorough testing,
+and may well not be fully functional. Some of the omissions
+of the earlier release (use of GetBulk, the AgentX MIB)
+are still missing from this version.
+
+ AgentX support is now included in the agent by default, but needs
+to be explicitly enabled before use. Activate it using by putting a line
+
+ master agentx
+
+in the snmpd.conf file. This support is also enabled automatically
+when the '-x' flag is given (to specify a different master AgentX socket),
+or when the agent is invoked as an AgentX subagent (i.e. via the name
+'agentxd' or with the '-X' flag).
+
+ See the main project web page for an examples of a simple stand-alone
+subagent. (http://www.net-snmp.org/tutorial/tutorial-5/toolkit/)
+
+
+ Please report any problems experienced to the net-snmp-coders list.
+
+Dave
diff --git a/README.aix b/README.aix
new file mode 100644
index 0000000..e25e9b6
--- /dev/null
+++ b/README.aix
@@ -0,0 +1,78 @@
+Some notes for the AIX port
+===========================
+
+1. Known problems
+-----------------
+
+There are the following known problems on AIX:
+
+1) Shared libraries / embedded perl
+
+Up to (and including) net-snmp 5.4, configure forced a static build
+on AIX which caused embedded Perl to be disabled as well.
+
+Starting with net-snmp 5.4.1, we build shared libraries by default on AIX
+(like on any other platform) using run-time linking. configure forces the
+use of the required "-brtl" linker flag.
+
+With net-snmp 5.5 the shared library build is broken again but the there is
+no forced static build - use --disable-shared when building.
+
+2) "grep: capacity exceeded" or "sed: Command line is too long" during configure
+
+The version of "grep" shipped with AIX versions up to (and including) 5.1
+has a known limitation of only supporting a maximum of 2048 characters per line.
+This may cause a significant number of "grep: capacity exceeded" errors during
+configure which breaks the build. See bug 1367794 for details. The fix is to
+either install GNU grep (and have it in PATH before the AIX grep) or to upgrade
+to AIX 5.2 or later.
+
+There's a similar issue with AIX /usr/bin/sed up to at least AIX 5.3 that
+causes a significant number of "sed: Command line is too long." errors during
+configure. The fix is to install GNU sed.
+
+3) nlist errors with 64-bit kernels
+
+Accessing certain MIB objects on AIX 5.x machines running a 64-bit kernel will
+trigger nlist/klookup errors. Starting from net-snmp 5.4, you can avoid those
+by using
+
+ ./configure --without-kmem-usage ...
+
+
+4) IPv6
+
+Starting with net-snmp 5.4 you can enable the UDPIPv6 and TCPIPv6 transports
+on AIX 5.x:
+
+ ./configure --enable-ipv6
+
+There's no support for the IPv6 MIBs, though.
+
+5) Compiler for Perl
+
+In general, Perl modules need to be compiled with the same compiler and
+compiler options as Perl itself. configure detects some mismatches (gcc vs.
+vendor compiler), but treats different incarnations of the same compiler type
+as similar. If your version of Perl (e.g. the one supplied by IBM for AIX 5.x)
+has been compiled with cc_r on AIX, please make sure you also use CC=cc_r when
+building net-snmp. Building with xlc in this case is known to fail (see bug
+#1600099).
+
+
+2. Patches
+----------
+
+You may want to have a look for existing AIX patches in our patches tracker
+(http://www.net-snmp.org/patches/). If you can offer patches yourself to
+improve the AIX support, please submit them there.
+
+
+3. Feedback
+-----------
+
+Please also see README and PORTING.
+
+If you have questions, additional insights or (even better) patches regarding
+net-snmp on AIX, please refer to the net-snmp mailing lists (see
+http://www.net-snmp.org/lists).
diff --git a/README.hpux11 b/README.hpux11
new file mode 100644
index 0000000..dd575f0
--- /dev/null
+++ b/README.hpux11
@@ -0,0 +1,22 @@
+Some notes for the HP-UX 11.0/11i port
+======================================
+
+1. Starting the net-snmp daemon via rc script
+---------------------------------------------
+
+When starting the net-snmp daemon via rc script you have to trap some signals
+because otherwise the daemon will die the moment the rc script ends. I trap
+the signals 1, 2 and 3 via "trap '' 1 2 3" immediately before starting the
+daemon. I didn't check whether all these signals need to be trapped, probably
+SIGHUP will suffice. BTW this applies to the HP-UX 10.x version as well. It
+would be a good idea to ignore or handle these signals in the daemon...
+
+2. Author, credits, comments
+----------------------------
+
+The HP-UX 11.0 port was done by Johannes Schmidt-Fischer <jsf@InterFace-AG.com>
+
+If you have questions or problems please feel free to contact me via the
+above mentioned e-mail address. Please send a copy of your e-mail to the
+net-snmp-coders mailing list - probably someone else can answer your
+question earlier than me;-)
diff --git a/README.irix b/README.irix
new file mode 100644
index 0000000..c7977e9
--- /dev/null
+++ b/README.irix
@@ -0,0 +1,56 @@
+Some notes for the IRIX port
+============================
+
+1. Compiling
+------------
+
+net-snmp 5.3.1 and later have been compiled successfully on IRIX 6.5 using the
+MIPSpro C compiler 7.4.4m in C99 mode:
+
+ CC=c99 ./configure && make && make install
+
+Please note that the "host" module doesn't compile on IRIX, so you *cannot*
+configure with "--with-mib-modules=host".
+
+Compiling with gcc may be possible, but is unsupported at this point in time
+due to difficulties with the IRIX system headers. Brent Bice has reported
+a successful build of net-snmp 5.4 with gcc 3.4.6 on a IP30 machine using:
+
+ CFLAGS="-D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -DIP30 -DR10000 -DMP \
+ -DCELL_PREPARE -DBHV_PREPARE" ./configure ...
+
+See http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/0620/bks/\
+SGI_Developer/books/DevDriver_PG/sgi_html/ch10.html and
+/var/sysgen/Makefile.kernio .
+
+2. CPU stats
+------------
+
+net-snmp 5.4.1 and later reports CPU statistics on IRIX 6.x by default using
+the hardware/cpu/cpu_sysinfo module. There's also an alternative implementation:
+hardware/cpu/cpu_pcp. For full discussion and build instructions for cpu_pcp
+see Patch #1675869:
+
+ http://sf.net/support/tracker.php?aid=1675869
+
+
+3. Known Issues
+---------------
+
+Accessing certain MIB objects on IRIX64 machines (i.e. when running a 64-bit
+kernel will trigger nlist/klookup errors. The agent will not return proper
+values for the affected MIB objects (e.g. tcpConnTable, udpTable).
+Starting from net-snmp 5.4, you can avoid nlist altogether (recommended for
+IRIX64) by using
+
+ ./configure --without-kmem-usage ...
+
+
+3. Feedback
+-----------
+
+Please also see README and PORTING.
+
+If you have questions, additional insights or (even better) patches regarding
+net-snmp on IRIX, please refer to the net-snmp mailing lists (see
+http://www.net-snmp.org/lists).
diff --git a/README.krb5 b/README.krb5
new file mode 100644
index 0000000..87025f0
--- /dev/null
+++ b/README.krb5
@@ -0,0 +1,165 @@
+This version of net-snmp supports an experimental SNMPv3 security model
+using Kerberos 5 for authentication. The protocol is described in an
+up-and-coming IETF Internet-Draft.
+
+This document describes a brief overview of the Kerberos Security Model
+and how to use it.
+
+DESCRIPTION:
+
+The Kerberos Security Model does not use USM; it is completely seperate
+and is not tied to USM in any way. It works by placing the following
+ASN.1 sequence inside of the SNMPv3 msgSecurityParameters:
+
+ksmSecurityParameters ::= SEQUENCE {
+-- The Kerberos 5 checksum type used to checksum this message
+ ksmChecksumType INTEGER(0..2147483647),
+-- The actual keyed checksum data returned by Kerberos
+ ksmChecksum OCTET STRING,
+-- The Kerberos 5 message (either an AP_REQ or AP_REP)
+ ksmKerberosMsg OCTET STRING,
+-- The cached ticket identifier
+ ksmCachedTicket INTEGER(0..2147483647)
+}
+
+Note that the whole SEQUENCE is BER encoded as an OCTET STRING.
+
+ksmChecksumType is an integer which corresponded to the checksum algorithm
+used to secure this message as defined by Kerberos (see section 8.3 of
+RFC1510).
+
+ksmChecksum is the output of the checksum algoritm defined by ksmChecksumtype
+(with all NULs in the space for the checksum).
+
+ksmKerberosMsg is a Kerberos 5 AP_REQ or AP_REP message, depending on
+whether or not it is a request or a response (AP_REQ for requests, AP_REP
+for responses).
+
+ksmCachedTicket is a integer which uniquely identifies a ticked already
+cached on the agent to save the overhead of transferring a whole AP_REQ/AP_REP.
+If there is no such cached ticket, it is left at zero.
+
+An agent, upon receiving a message using the KSM, will decode the AP_REQ
+contained within the security parameters and thus validate the client's
+identity. Using the subkey contained within the AP_REQ, the agent will
+validate the checksum (after first clearing the checksum bytes to zero),
+and issue a response, encoding the appropriate AP_REP message in the
+ksmSecurityParameters.
+
+If the securityLevel of the message is set to AuthPriv, the scopedPdu
+payload will be encrypted using the encryption key and algorithm of the
+AP_REQ subkey. Note that in this case, the msgData will be a BER-encoded
+OCTET STRING corresponding to the "cipher" element of the EncryptedData
+sequence defined in RFC 1510, section 6.1.
+
+Since this security model is experimental, the number assigned to this
+security model is taken from the recommendations of RFC 2271, section 5,
+which specify enterprise-specific Security Models of the form:
+
+ SnmpSecurityModel = enterpriseID * 256 + security model number
+ in that enterprise ID;
+
+In the case of KSM this gives us:
+
+ SnmpSecurityModel = 8072 * 256 + 0 = 2066432
+
+
+USAGE:
+
+To actually USE the Kerberos Security Model, do the following:
+
+0) Install Kerberos
+
+ Let it be stated up front - Installing Kerberos completely "cold", without
+ any Kerberos experience at all, can be daunting (to say the least). If you
+ already have a Kerberos infrastructure at your site, then all of the hard
+ work has been done. If you do NOT, but you still want to tackle it,
+ you might be interested in the Kerberos FAQ, which can be found at:
+
+ http://www.nrl.navy.mil/CCS/people/kenh/kerberos-faq.html
+
+ Currently the code in net-snmp only supports using MIT Kerberos
+ libraries to link against (you should be able to use any kind of Kerberos
+ server, however).
+
+1) Compile net-snmp with Kerberos.
+
+ This assumes that you already have Kerberos libraries in place.
+
+ Configure net-snmp to include the Kerberos Security Model (ksm) and
+ use --with-cflags and --with-ldflags to specify the location and names
+ of Kerberos header files and libraries. For example, on my system I
+ run:
+
+ ./configure --with-cflags='-I/usr/krb5/include' \
+ --with-ldflags='-L/usr/krb5/lib -lkrb5 -lcrypto -lcom_err -R/usr/krb5/lib'
+
+ Note that this is on Solaris, and that -R is required to set the correct
+ shared library path. If you have a newer version of Kerberos, you might
+ instead have to use:
+
+ -lkrb5 -lk5crypto -lcom_err
+
+ as the libraries to link against. If you get errors (for example, you
+ get a message that says the compiler isn't working) you can check
+ config.log for the output of the compiler.
+
+2) Configure Kerberos and SNMP
+
+ Currently, net-snmp uses the "host" principal assigned to a host. This
+ may change in the future. You will want to create host principals of
+ the form:
+
+ host/f.q.d.n@YOUR.REALM
+
+ For example:
+
+ host/mydesktop.example.org@EXAMPLE.ORG
+
+ and place the encryption keys for these principals on every machine you
+ wish to run a SNMP agent (you place each key on it's corresponding machine).
+ Your Kerberos documentation should explain how to do this (in the case
+ of MIT Kerberos, you want to look at the "ktadd" command inside of
+ kadmin).
+
+ If you have a Kerberos infrastructure, you likely already have these
+ principals in place on your systems.
+
+ If you're installing Kerberos for the first time as well, you also
+ need to create client principals corresponding to your userid. See
+ your Kerberos documentation.
+
+ On the SNMP _agent_ side, you'll want to place in your snmpd.conf file
+ (the one that lives in /usr/local/share/snmp/snmpd.conf, or whereever
+ you have configured on your system):
+
+ rwuser -s ksm userid@YOUR.REALM
+
+ to allow the Kerberos principal 'userid@YOUR.REALM' read/write access to
+ the MIB tree.
+
+3) Run the agent and client applications
+
+ Note that before you do any of this, you will have to have valid Kerberos
+ credentials (generally acquired with the "kinit" program).
+
+ The agent should run without any additional flags.
+
+ You should run the client apps with the following flags:
+
+ -Y defSecurityModel=ksm
+ -v 3
+ -u username
+ -l authNoPriv
+
+ for example:
+
+ snmpget -v 3 -Y defSecurityModel=ksm -u myname -l authNoPriv testhost \
+ system.sysDescr.0
+
+ If you wish to encrypt the payload, change the -l argument to "authPriv".
+
+ If you run into problems, you can add the -Dksm flag to both the manager
+ applications and the agent to get more detailed Kerberos error messages.
+ Note that this setup assumes a working Kerberos infrastructure; if you
+ run into problems, check to make sure Kerberos is working for you.
diff --git a/README.osX b/README.osX
new file mode 100644
index 0000000..49b58e7
--- /dev/null
+++ b/README.osX
@@ -0,0 +1,61 @@
+README.osX
+$Id$
+
+This is what I had to do to get it to work for me. Your mileage may vary.
+If this doesn't work for you, or you have fixes for any problems listed,
+please post to <net-snmp-coders@lists.sourceforge.net>. Thanks!
+
+ - ALL
+
+ - nlist doesn't support icmpstat
+
+ - disable the icmp module during configure by specifying
+ "--with-out-mib-modules=mibII/icmp", or at startup by adding
+ "-I -icmp" to the snmpd command line.
+
+
+ - 10.4.7 (Universal) and Leopard with 5.4 sources:
+ [Supplied by Chris Jalbert]
+
+ - build using gcc 4.0 (see below) and configure using:
+ --with-persistent-directory=/var/db/net-snmp \
+ --with-defaults \
+ --without-rpm \
+ --with-mib-modules="host ucd-snmp/diskio" \
+ --with-out-mib-modules="mibII/icmp host/hr_swrun" \
+ --without-kmem-usage
+
+ The first line sets up persistent storage in the OS X standard location.
+
+ The third line is necessary because RPM is not properly disabled.
+
+ The fourth line includes those modules appear to build properly and
+ mostly work. The next line is necessary because those sub-modules
+ do not build.
+
+ The final line is necessary because /dev/kmem was removed in
+ the Intel / Universal builds of the OS, and I believe the APIs will
+ be removed in Leopard.
+ This line is the most critical for proper building on OS X.
+
+
+ - 10.3.x and earlier
+
+ - Some older versions of Apple's cpp doesn't like configure.
+
+ - run 'gcc_select' to see what version you are using, and
+ 'gcc_select -l' to list available versions. I've had success with
+ 3.3, selected by running (as root) 'gcc_select 3.3'. (Note: this was
+ on Panther, 10.3.2)
+
+ - Some older versions of net-snmp as installed by Apple contains
+ bad flags in net-snmp-config.
+
+ - build your own version, and install over Apple's version. The
+ configure flags you need for the same configuration:
+
+ configure --prefix=/usr --mandir=/usr/share/man
+ --infodir=/usr/share/info --with-libwrap --with-defaults
+ --prefix=/usr --with-persistent-directory=/var/db/ucd-snmp
+ --with-mib-modules=host
+
diff --git a/README.snmpv3 b/README.snmpv3
new file mode 100644
index 0000000..99e4238
--- /dev/null
+++ b/README.snmpv3
@@ -0,0 +1,105 @@
+README.snmpv3
+-------------
+How to setup SNMPv3, a very brief document for Dave to elaborate and
+do a better job on since I suck at writing documentation and he
+doesn't ;-) --Wes:
+
+Note: SHA authentication and DES/AES encryption support is only available
+if you have OpenSSL installed or if you've compiled using
+--with-openssl=internal. If you use --with-openssl=internal please
+read the documentation in snmplib/openssl/README for important details.
+
+Note: encryption support now *is* enabled in the binary releases downloadable
+from the net-snmp web site.
+
+Note: this description assumes you're using the software compiled from
+source, and so installed using the default prefix location (/usr/local).
+If you're working with a vendor-provided system, or have configured
+things with a different prefix, you'll need to adjust locations accordingly.
+
+CREATING THE FIRST USER:
+------------------------
+ First, you need to create a new snmpv3 user and give them rights to
+ do things:
+
+ net-snmp-config --create-snmpv3-user -a "my_password" myuser
+
+ WARNING: SNMPv3 pass phrases must be at least 8 characters long!
+
+ The above line creates the user "myuser" with a password of
+ "my_password" (and uses MD5 and DES for protection). (Note that
+ encryption support isn't enabled in the binary releases downloadable
+ from the net-snmp web site.) net-snmp-config will also add a line
+ to your snmpd.conf file to let that user have read/write access to
+ your agent. You may want to change this in your snmpd.conf file
+ (see the snmpd.conf manual page). Run net-snmp-config --help for
+ more information about it.
+
+ Start the agent and test your setup:
+ /usr/local/sbin/snmpd
+ [...wait a few seconds... It will run in the background and
+ return you to your shell immediately.]
+
+ snmpget -v 3 -u myuser -l authNoPriv -a MD5 -A my_password localhost sysUpTime.0
+ [ this should return information about how long your agent has been up]
+
+ snmpget -v 3 -u myuser -l authPriv -a MD5 -A my_password
+ -x DES -X my_password localhost sysUpTime.0
+ [ this should return similar information, but encrypts the transmission ]
+
+CREATING A SECOND USER:
+-----------------------
+ Start the agent (if you didn't do so above).
+
+ You can create as many users as you like using the above method, but
+ this details another way of doing it while the agent is running by
+ modifying the user database using the snmp protocol itself:
+
+ Now, lets create a second user using the first user (just for fun)
+ for both authentication purposes and as a template (or "cloning
+ source"):
+
+ snmpusm -v 3 -u myuser -l authNoPriv -a MD5 -A my_password localhost create wes myuser
+
+ The above should have created the user "wes" with the same password as
+ the "myuser" user. So then, you need to change his password using:
+
+ snmpusm -v 3 -u wes -l authNoPriv -a MD5 -A my_password localhost passwd my_password new_passphrase
+
+ See, wasn't that easy? You can now create users. Wheeee....
+
+ But, you'll have to add a configuration line that allows them access
+ to do things. Do this with another "rwuser" line in your
+ /usr/local/share/snmp/snmpd.conf file (you'll need to stop and start
+ the agent again, or send the agent a SIGHUP signal):
+
+ rwuser wes
+
+ Or, optional use the "rouser" token instead of the "rwuser" token to
+ only grant them read-only access.
+
+ Now, test your new user:
+
+ snmpget -v 3 -u wes -l authNoPriv -a MD5 -A new_passphrase localhost sysUpTime.0
+
+
+FURTHER STUDIES:
+---------------
+
+Tired of all those command line authentication options?
+----------------------------------------
+put something like this in your $HOME/.snmp/snmp.conf file (make it
+readable only by you!!!):
+
+ defSecurityName wes
+ defContext ""
+ defAuthType MD5
+ defSecurityLevel authNoPriv
+ defAuthPassphrase new_passphrase
+ defVersion 3
+
+And this is in place the last of the above example lines boils down to:
+
+ snmpget localhost sysUpTime.0
+
+Which is about as simple as I can make it for ya ;-)
diff --git a/README.solaris b/README.solaris
new file mode 100644
index 0000000..625aae2
--- /dev/null
+++ b/README.solaris
@@ -0,0 +1,1311 @@
+README.solaris
+$Id$
+
+This document describes issues relating to compiling,
+installing and using net-snmp on Solaris.
+
+0. Introduction
+1. Things you will need
+2. Disabling Sun's SNMP daemons
+3. Compiling net-snmp
+4. Obtaining and installing binaries
+5. Creating snmpd.conf and testing
+6. Creating your own binaries
+7. Using Sun's SNMP daemon and net-snmp together
+8. Monitoring disks, processes and execs (DISMAN-EVENT-MIB)
+9. Monitoring CPU temp, fan and power supply sensors (LM-SENSORS-MIB)
+10. MIB rewrites for IF-MIB, TCP-MIB and UDP-MIB
+
+Additional compilation issues:
+
+11. Files descriptors and fopen
+12. Perl
+13. sed
+14. OpenSSL and crle
+15. IPv6
+16. Wish list
+
+Other issues:
+
+17. Known Bugs!!
+18. Discussion and further information
+
+------------------------------------------------------------
+
+0. Introduction
+
+This document is a compilation of information relating to
+running net-snmp (www.net-snmp.org) on Sun SPARC and Ultra
+hardware under the Solaris operating system.
+
+This can be done either in conjunction with or as a
+replacement for Sun's SNMP daemons.
+
+This is discussed in detail in the sections below. Since
+this is the work of several authors, credit is given.
+Discussion, however, should take place on the net-snmp-users
+or net-snmp-coders mailing lists so everybody can
+benefit. See http://sourceforge.net/mail/?group_id=12694 .
+Use "net-snmp-users" for general usage questions and "net-snmp-coders" for
+discussion of net-snmp source code.
+
+No warranty is implied by this document.
+This document is copyright but usage allowed under the same
+licensing as net-snmp in general. See http://www.net-snmp.org/COPYING.txt.
+
+------------------------------------------------------------
+
+1. Things you will need
+
+A. Root access
+
+Root access is required to follow pretty much any of
+the steps below. At a bare minimum, you will need
+to be able to start and stop daemons, which requires root
+(at least for the default ports).
+
+B. Determine existing SNMP functionality
+
+SNMP uses ports 161 and 162 by default. Only one application
+can use them at a time. If there is an existing SNMP
+application (eg. Sun's snmpdx daemon) you need to either
+turn this off or work around it. You may also have
+a previous version of net-snmp, the older ucd-snmp, or
+something completely different. The following commands:
+
+ ps -ef | grep snm
+ ps -ef | grep mibi
+
+will give you a fairly good idea what is going on.
+
+If you see something like:
+
+ root 643 1 0 Jan 16 ? 5:49 /usr/local/sbin/snmpd
+
+that's probably a version of net-snmp. The instructions in various
+sections below should give you clues on what to do next.
+
+If you see something like:
+
+ root 16178 1 0 13:16:04 pts/2 0:00 /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
+
+and/or
+
+ root 21371 1 0 Feb 07 ? 0:52 mibiisa -r -p 41178
+
+then Sun's SNMP daemons are running.
+
+If you need this, for example if you use the Solstice Enterprise
+Agent, you may wish to run net-snmp as a sub-agent (see section 7).
+Otherwise, you will need to disable Sun's daemons (see section 2).
+
+Regardless you may wish to compile net-snmp from source
+and install it (see sections 3, 5 and 6) or install
+binaries (see sections 4 and 5).
+
+If some other SNMP daemon is running, you will need to determine
+where it came from and what it's being used for. You get clues by
+typing "snmpd -v" or "snmpd --help". In some cases it may be
+a subagent or agent from another application, such as ORACLE. If
+you disable its agent, you will need to re-create this functionality
+under net-snmp (eg. by running it as a sub-agent). ORACLE's SNMP
+functionality is turned on by default and may be unnecessary if
+you aren't using ORACLE's Enterprise Manager. Refer to ORACLE's
+documentation on how to disable it.
+
+
+If you have decided to compile your own net-snmp, you will need ...
+
+C. A compilation environment
+
+-a compiler (gcc or Sun's Forte cc) or the gcc libraries
+ (note, the cc in /usr/ucb is NOT a full-blown compiler)
+-OpenSSL (sunfreeware.com or source www.openssl.org)
+-zlib (sunfreeware.com or source www.gzip.org/zlib/)
+-an SNMP community string ("public" is deprecated)
+
+If you are installing on a development machine, it may be best
+to compile OpenSSL and zlib from source, otherwise
+obtain the appropriate zlib for your platform from sunfreeware
+and install (it goes to /usr/local automatically).
+Obtain the appropriate OpenSSL for your platform from sunfreeware
+and install (it goes to /usr/local), you may need the gcc libraries.
+These libraries should not need to be installed if you are using
+binaries, but your mileage may vary. Note the library problem
+with libcrypto noted below (section 14).
+
+There are two choices for compilers. Sun has a Forte development
+suite that includes a standalone C compiler. If you have it, it
+is likely installed in /opt/SUNWspro/bin.
+
+The more common choice is gcc (2.95.3 or better have been tested)
+available from sunfreeware.com. If you install gcc, you do not
+need the gcc libraries. 3.3.2 or later is recommended.
+
+Given that net-snmp is developed to work on a wide variety of
+platforms, but especially for linux, there's a better chance of
+it working using gcc at any given time. We also do regular test
+builds with Sun cc, though.
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca>
+ -- Thomas Anders <tanders@users.sourceforge.net>
+
+------------------------------------------------------------
+
+2. Disabling Sun's SNMP daemons
+
+Note: Sun has started to include net-snmp (version 5.0.9 plus their
+patches) with Solaris 10 and later. These instructions are written
+with Solaris 9 and previous in mind.
+
+Out of the box, Sun runs four SNMP daemons: mibiisa, idmispd,
+snmpXdmid and snmpdx.
+
+These must be disabled before running net-snmp unless you are planning
+on running them together (see Section 7 below). Here is the procedure:
+
+ cd /etc/rc3.d
+ ./S76snmpdx stop
+ ./S77dmi stop
+ mv S76snmpdx s76snmpdx
+ mv S77dmi s77dmi
+
+If you are using Solstice Disksuite, you may also be running
+mdlogd. Leave this alone.
+
+You will need to create a new script to start net-snmp.
+See dist/snmpd-init.d and dist/snmptrapd-init.d for templates.
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca>
+
+------------------------------------------------------------
+
+3. Compiling net-snmp
+
+It is strongly recommended that you compile net-snmp from source.
+That way you are guaranteed a working version for your specific
+configuration of operating system, applications and libraries.
+
+If, for some reason, you cannot compile on a specific machine,
+there are binaries available for download (see section 4).
+In addition, you may create your own binaries (see section 6).
+
+You need to set your $PATH. This is extremely important
+because otherwise there may be conflicts between the various
+components of the development environment.
+
+If you are using FORTE:
+
+PATH=/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/SUNWspro/bin:/usr/local/bin:
+
+If you are using gcc (installed in /usr/local/bin):
+
+PATH=/usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr/bin
+
+Obtain a current version of net-snmp (which, if you're reading this,
+presumably you have - don't you love recursion?) www.net-snmp.org/download/
+
+Uncompress it and untar it in a working directory eg. /usr/local/src/net-snmp
+
+In order to save a lot of typing, you should create a "configure"
+script eg. bcc.sh in the directory below eg. /usr/local/src.
+
+ ./configure --with-mib-modules="ucd-snmp/lmSensors ucd-snmp/diskio \
+ smux mibII/mta_sendmail" --with-cc=gcc
+
+(note, see the long discussion about Perl below)
+(note, substitute "cc" for "gcc" as appropriate)
+(note, for LM-SENSORS-MIB support, see discussion below)
+
+then call this script from the net-snmp directory ie ../bcc.sh
+
+and answer the appropriate questions (usually with the default).
+
+When it completes, you should see something like:
+
+---------------------------------------------------------
+ Net-SNMP configuration summary:
+---------------------------------------------------------
+
+ Net-SNMP Version: 5.4
+ Building for: solaris2
+ Network transport support: Callback Unix TCP UDP
+ SNMPv3 Security Modules: usm
+ Agent MIB code: mibII ucd_snmp snmpv3mibs notification target
+ \agent_mibs agentx agent_mibs utilities host disman/event-mib
+ \ucd-snmp/diskio smux agentx mibII/mta_sendmail
+ SNMP Perl modules: disabled
+ Embedded perl support: disabled
+ Authentication support: MD5 SHA1
+ Encryption support: DES
+
+Type:
+
+ make
+
+and watch for compile errors.
+
+You will receive numerous warnings. This is normal,
+a side effect of supporting a variety of development environments.
+
+Now type:
+
+ make test
+
+and watch for failures. Also watch for the special tests for Solaris.
+
+If you are satisfied with the tests, stop any snmpd daemons
+that may be running (see section 2) and type:
+
+ make install
+
+When complete, go on to section 5 below.
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca>
+
+------------------------------------------------------------
+
+4. Obtaining and installing binaries
+
+It is strongly recommended that you compile net-snmp from source.
+That way you are guaranteed a working version for your specific
+configuration of operating system, applications and libraries.
+
+Binaries for Solaris may be found in two locations.
+
+www.sunfreeware.com - this installs as a package.
+It does not have Perl support.
+
+Therefore, I recommend:
+
+ http://net-snmp.sourceforge.net/download/ (you will be redirected)
+
+This is the official repository for binaries.
+
+To determine which binary you need, you will need several pieces of
+information.
+
+-operating system version,
+-hardware platform
+-net-snmp version desired
+
+The first two may be obtained by typing:
+
+ uname -a
+
+It will return something like:
+
+SunOS foo 5.8 Generic_108528-14 sun4u sparc SUNW,Ultra-4
+
+5.8 means Solaris 8
+5.7 means Solaris 7 etc.
+
+"sun4u" is the Ultra hardware platform
+"sun4m" is SuperSPARC eg. Sparc 5 or Sparc 10
+"sun4d" is older SPARC boxes.
+
+You can then decode the binary version by its name eg.:
+
+net-snmp_5.0.9-SunOS_5.8_sun4u.tar.gz
+
+means "net-snmp version 5.0.9 for Solaris 8 running on Ultra
+hardware".
+
+Once you have found the appropriate version, download it to a
+distribution directory (making one if necessary) eg. /usr/local/dist
+
+Type the following: (using the sample above)
+
+ cd /
+ tar -xvf /usr/local/dist/net-snmp-5.0.9-SunOS_5.8_sun4u.tar
+
+The binaries, libraries, etc. will be installed in /usr/local.
+
+Remove the tar file to save space. Create an snmpd.conf (see below)
+or use an existing one from another machine.
+It installs in /usr/local/share/snmp.
+
+Install a startup script (see section 1).
+
+For further information, see README.solaris.binaries.x that ships
+with the binaries.
+
+--Bruce Shaw <Bruce.Shaw at shaw.ca>
+
+------------------------------------------------------------
+
+5. Creating snmpd.conf and testing
+
+When everything is installed, run:
+
+ snmpconf -g basic_setup
+
+and answer the questions appropriately. If you are using
+the defaults, place the resulting snmpd.conf file in:
+
+/usr/local/share/snmp/snmpd.conf
+
+A security note - use of the "public" community is deprecated.
+This example uses "whatever" as a community.
+
+When you have the daemon running either with the script above or running:
+
+ /usr/local/sbin/snmpd
+
+test the daemon's functionality by typing:
+
+ snmpget -v 1 -c whatever localhost sysUpTime.0
+ snmpwalk -v 2c -c whatever -m ALL localhost .1.3 | more
+
+and paging through the results.
+
+If you have problems, you can examine diagnostic messages
+by running:
+
+ /usr/local/sbin/snmpd -f -Le
+
+or use gdb (available from www.sunsolve.com) as follows:
+
+ cd /usr/local/sbin
+ gdb snmpd
+ run -f -Le
+
+and when it blows up:
+
+ bt
+
+to get the backtrace.
+
+You can use:
+
+ run -f -Le -D <modulename>
+
+to display debug messages.
+
+To display all debug messages type:
+
+ run -f -Le -D ALL
+
+but this will be extremely verbose.
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca> with suggestions by Thushara Wickram
+
+------------------------------------------------------------
+
+6. Creating your own binaries
+
+Pick an appropriate name for a tarfile
+eg. net-snmp-5.4.custom-SunOS_5.8_sun4u.tar (see above)
+(this particular one means "a customized version of
+net-snmp 5.4 that works under Solaris 8 running on Ultra hardware")
+
+Create an empty directory such as /usr/local/dist, then do the following
+from the source directory (using the example above):
+
+ make install prefix=/usr/local/dist/usr/local \
+ exec_prefix=/usr/local/dist/usr/local
+ cd /usr/local/dist
+ tar -cvf net-snmp-5.4.custom-SunOS_5.8_sun4u.tar usr
+
+Transfer this file to the machine where you want to install from binary.
+Place it in a distribution directory eg. /usr/local/dist
+Type the following (using the example above):
+
+ cd /
+ tar -xvf /usr/local/dist/net-snmp-5.4.custom-SunOS_5.8_sun4u.tar
+
+Remove the tar file to save space. Create an snmpd.conf (see above)
+or use an existing one from another machine. If you are using
+the defaults, it installs in /usr/local/share/snmp. Install
+a startup script (see section 2).
+
+Note that if you create a binary with Perl support (see below) an
+identically configured Perl needs to be installed as well.
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca>
+
+------------------------------------------------------------
+
+7. Using Sun's SNMP daemon and net-snmp together
+
+Net-SNMP may be used as a subagent in conjunction with Sun's snmpdx daemon.
+
+To do this, you will need to modify several files,
+all located in /etc/snmp/conf.
+
+First, do the following:
+
+ /etc/rc3.d/S76snmpdx stop (assuming you haven't done so already, and...)
+ /etc/rc3.d/S77dmi stop (...assuming you haven't renamed them)
+
+ cd /etc/snmp/conf
+ cp snmpd.conf snmpd.conf.orig
+ cp snmpdx.acl snmpdx.acl.orig
+ cp snmpdx.reg snmpdx.reg.orig
+ cp snmpdx.rsrc snmpdx.rsrc.orig
+ cp mibiisa.reg mibiisa.reg.orig
+ cp mibiisa.rsrc mibiisa.rsrc.orig
+
+modify snmpd.conf with the correct:
+
+ sysdescr
+ syscontact
+ sysLocation
+ system-group-read-community
+ read-community (in my example below I will use community "whatever")
+ trap
+ trap-community
+ managers (leave blank for all)
+
+modify snmpdx.acl with the correct:
+
+ trap-community
+ trap-recipients
+ communities
+ access
+
+Make sure that in snmpdx.reg the port is 161.
+
+You will now need to add two files - net-snmp.reg and net-snmp.rsrc
+
+In this example, "subtrees" is set for HOST-RESOURCES-MIB, and UCD-SNMP-MIB.
+Do not use net-snmp's MIB-2 information as this is already provided by
+Sun's mib and may cause a conflict.
+
+::::: net-snmp.reg ::::::
+
+# net-snmp.reg
+# mib-2 is already provided by the mibiisa process
+# that is a default sub agent of snmpdx
+# we are specifying only hostmib and ucd
+##########
+# agents #
+##########
+
+# The following 3 macros are predefined:
+#
+# mib-2 = 1.3.6.1.2.1
+# enterprise = 1.3.6.1.4.1
+# sun = 1.3.6.1.4.1.42
+#
+# You can define your own macros, so that you can
+# manipulate strings instead of OIDs in defining the agent.
+# See the "agent" section below.
+
+macros =
+{
+ host = mib-2.25
+ ucd = enterprise.2021
+}
+
+agents =
+{
+ {
+ name = "net-snmp"
+ subtrees = { host,ucd }
+ timeout = 2000000
+ watch-dog-time = 86400
+ }
+}
+
+::::::::::::::::::
+
+::::: net-snmp.rsrc ::::::
+
+# /etc/snmp/conf/net-snmp.rsrc
+
+resource =
+{
+ {
+ registration_file = "/etc/snmp/conf/net-snmp.reg"
+ policy = "spawn"
+ type = "legacy"
+ command = "/usr/local/sbin/snmpd $PORT"
+ }
+
+}
+
+::::::::::::::::::
+
+Stop any net-snmp processes that may be running.
+
+Start Sun's daemons by typing:
+
+ /etc/rc3.d/S76snmpdx start (assuming you haven't renamed it)
+ /etc/rc3.d/S77dmi start (assuming you haven't renamed it)
+
+Wait a moment for everything to stabilize, then try these two queries:
+
+ snmpget -v 1 -c whatever localhost sysDescr.0
+ snmpget -v 1 -c whatever localhost hrSystemUptime.0
+
+You should see something like:
+
+ SNMPv2-MIB::sysDescr.0 = STRING: SunOS foo 5.6 Generic_105181-30 sun4u
+
+which is Sun's daemon talking, and:
+
+ HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (78540910) 9 days, 2:10:09.10
+
+which is net-snmp talking. It is acting as a sub-agent through Sun's daemon.
+
+If Sun's daemons fail, you will need to shut down the snmpd daemons by typing:
+
+ pkill snmpd
+
+Then do the following:
+
+ /etc/rc3.d/S76snmpdx stop (assuming you haven't renamed it)
+ /etc/rc3.d/S77dmi stop (assuming you haven't renamed it)
+ /etc/rc3.d/S76snmpdx start (assuming you haven't renamed it)
+ /etc/rc3.d/S77dmi start (assuming you haven't renamed it)
+
+rather than trying to individually clobber all the various Sun daemons.
+
+This configuration appears to deal properly with snmpgets
+and handle mistakes gracefully.
+
+Beyond this, your mileage may vary.
+
+You may wish to modify the subtrees in net-snmp.reg as you find things
+that do and don't work. Remember to keep backup copies of working
+configurations.
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca> from notes by Stefan Radman and C Wells
+
+------------------------------------------------------------
+
+8. Monitoring disks, processes and execs (DISMAN-EVENT-MIB)
+
+Important note: this section only applies to the old DISMAN-EVENT-MIB
+implementation called "disman/event-mib", *not* the current "disman/event"
+mib module which is active by default since net-snmp 5.3 and later.
+
+For a full explanation of using DISMAN-EVENT-MIB, see:
+
+http://www.net-snmp.org/man/snmpd.conf.html
+
+To use this component, net-snmp must be compiled with the option..
+
+--with-mib-modules="disman/event-mib"
+
+This discussion concerns the use of DISMAN-EVENT-MIB with Solaris.
+
+There is a bug preventing the use of some of its functionality. This
+discussion will document what is known to work and how to use it.
+
+The problem revolves around the use of monitors. The...
+
+defaultMonitors yes
+
+token will NOT work for reasons discussed below. I suspect that the
+notificationEvent tokens will not work for the same reason but this
+has not been tested. Your mileage may vary. Same with includeAllDisks.
+
+The documentation suggests using...
+
+monitor -o prNames -o prErrMessage "process table" prErrorFlag != 0
+
+to monitor all processes. This will fail with ambiguous results.
+
+To monitor processes, put a separate monitor line for each process.
+
+For example:
+######
+proc smail
+proc mdlogd
+
+monitor -r 30 -i -o prNames.1 -o prErrMessage.1 "Process smail" prErrorFlag.1 !=0
+monitor -r 30 -i -o prNames.2 -o prErrMessage.2 "Process Solstice Disksuite SNMP trap" prErrorFlag.2 !=0
+
+To monitor disks, do the same. An example:
+
+########
+# This example sends a trap if root has less than 10% available and /usr6 less t
+han 90%
+#
+disk / 10%
+disk /usr6 90%
+
+monitor -i -r 30 -o dskPath.1 -o dskErrorMsg.1 "root file system" dskErrorFlag.1 !=0
+monitor -i -r 30 -o dskPath.2 -o dskErrorMsg.2 "ORACLE file system" dskErrorFlag.2 != 0
+#########
+
+To implement an external program then monitor its results you need to set up your script.
+
+Here is a sample script.
+
+#!//usr/bin/ksh
+xstatus=0
+
+if [ $xstatus -eq 0 ];then
+echo success: $0
+else
+echo FAILURE: $0
+fi
+
+exit $xstatus
+###end of script tester##
+
+Place this script in /usr/local/src and make it executable. Make copies called
+tester1, tester2 etc.
+and make them executable.
+
+Here is a sample snmpd.conf snippet that makes use of the exec feature:
+##############
+
+exec tester1 /usr/local/src/tester1
+exec tester2 /usr/local/src/tester2
+exec tester3 /usr/local/src/tester3
+exec tester4 /usr/local/src/tester4
+exec tester5 /usr/local/src/tester5
+
+monitor -i -r 60 -o extNames.1 -o extOutput.1 "status table 1" extResult.1 != 0
+monitor -i -r 60 -o extNames.2 -o extOutput.2 "status table 2" extResult.2 != 0
+monitor -i -r 60 -o extNames.3 -o extOutput.3 "status table 3" extResult.3 != 0
+monitor -i -r 60 -o extNames.4 -o extOutput.4 "status table 4" extResult.4 != 0
+monitor -i -r 60 -o extNames.5 -o extOutput.5 "status table 5" extResult.5 != 0
+##############
+
+While snmpd is running, go to /usr/local/src and modify one of the tester programs eg. tester1
+
+xstatus=1
+
+and save the file. Sometime in the next 60 seconds, a trap will be generated.
+Change the value back to 0, then modify another file.
+
+If you are unsure of the correct row number within a specific table, do an snmpwalk eg.
+
+snmpwalk -v 2c -c public -m ALL localhost prNames
+
+The same methodology can presumably be used for fileName and laNames. Your mileage may vary.
+
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca> with Allan McIntosh and Wes Hardaker
+
+------------------------------------------------------------
+
+9. Monitoring CPU temp, fan and power supply sensors (LM-SENSORS-MIB)
+
+Note: This module (ucd-snmp/lmSensors) works in "read only" mode to examine
+sensors. It cannot change switch or fan settings.
+
+It has been tested at least on the following platforms:
+
+Enterprise 450
+V880
+280R
+
+If you have information about other platforms this is desperately needed. For
+example, the only "state" that I'm aware of for an i2c is "OK". The more
+information we have, the richer the components.
+
+Please report any performance statistics, bugs or omissions to the users list.
+Please report any code suggestions to the coders list. See links below.
+
+
+This component delivers information that you would normally see by typing:
+
+/usr/platform/`uname -m`/sbin/prtdiag -v
+
+At present this is only supported on the Ultra (sun4u) platform.
+
+To display this information, net-snmp must be compiled with the option:
+
+--with-mib-modules="ucd-snmp/lmSensors"
+
+Early Ultra servers such as the Ultra 1 or Ultra 2 did not report
+any sensor information at all. Later servers, such as the Enterprise 450
+reported this information using kstat. Sun's latest servers make use
+of the picld daemon to control system resources and report fan information.
+This module reads in the information from picld. It cannot modify settings.
+
+You can see this information by typing:
+
+prtpicl -v | more
+
+The following is typical output from net-snmp:
+
+E450# snmpwalk -v 2c -c public -m ALL localhost lmSensors
+LM-SENSORS-MIB::lmTempSensorsIndex.1 = INTEGER: 0
+LM-SENSORS-MIB::lmTempSensorsIndex.2 = INTEGER: 1
+LM-SENSORS-MIB::lmTempSensorsIndex.3 = INTEGER: 2
+LM-SENSORS-MIB::lmTempSensorsIndex.4 = INTEGER: 3
+LM-SENSORS-MIB::lmTempSensorsDevice.1 = STRING: Ambient
+LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: CPU1
+LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: CPU2
+LM-SENSORS-MIB::lmTempSensorsDevice.4 = STRING: CPU3
+LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 22
+LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 45
+LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 46
+LM-SENSORS-MIB::lmTempSensorsValue.4 = Gauge32: 49
+LM-SENSORS-MIB::lmFanSensorsIndex.1 = INTEGER: 0
+LM-SENSORS-MIB::lmFanSensorsIndex.2 = INTEGER: 1
+LM-SENSORS-MIB::lmFanSensorsIndex.3 = INTEGER: 2
+LM-SENSORS-MIB::lmFanSensorsDevice.1 = STRING: fan type CPU number 0
+LM-SENSORS-MIB::lmFanSensorsDevice.2 = STRING: fan type PWR number 0
+LM-SENSORS-MIB::lmFanSensorsDevice.3 = STRING: fan type AFB number 0
+LM-SENSORS-MIB::lmFanSensorsValue.1 = Gauge32: 33
+LM-SENSORS-MIB::lmFanSensorsValue.2 = Gauge32: 31
+LM-SENSORS-MIB::lmFanSensorsValue.3 = Gauge32: 63
+LM-SENSORS-MIB::lmVoltSensorsIndex.1 = INTEGER: 0
+LM-SENSORS-MIB::lmVoltSensorsIndex.2 = INTEGER: 1
+LM-SENSORS-MIB::lmVoltSensorsIndex.3 = INTEGER: 2
+LM-SENSORS-MIB::lmVoltSensorsDevice.1 = STRING: power supply 0
+LM-SENSORS-MIB::lmVoltSensorsDevice.2 = STRING: power supply 1
+LM-SENSORS-MIB::lmVoltSensorsDevice.3 = STRING: power supply 2
+LM-SENSORS-MIB::lmVoltSensorsValue.1 = Gauge32: 38
+LM-SENSORS-MIB::lmVoltSensorsValue.2 = Gauge32: 39
+LM-SENSORS-MIB::lmVoltSensorsValue.3 = Gauge32: 39
+LM-SENSORS-MIB::lmMiscSensorsIndex.1 = INTEGER: 0
+LM-SENSORS-MIB::lmMiscSensorsIndex.2 = INTEGER: 1
+LM-SENSORS-MIB::lmMiscSensorsIndex.3 = INTEGER: 2
+LM-SENSORS-MIB::lmMiscSensorsDevice.1 = STRING: FSP
+LM-SENSORS-MIB::lmMiscSensorsDevice.2 = STRING: Backplane4
+LM-SENSORS-MIB::lmMiscSensorsDevice.3 = STRING: Backplane8
+LM-SENSORS-MIB::lmMiscSensorsValue.1 = Gauge32: 192
+LM-SENSORS-MIB::lmMiscSensorsValue.2 = Gauge32: 0
+LM-SENSORS-MIB::lmMiscSensorsValue.3 = Gauge32: 0
+
+V880# snmpwalk -v 2c -c public -m ALL localhost lmSensors
+LM-SENSORS-MIB::lmTempSensorsIndex.1 = INTEGER: 0
+LM-SENSORS-MIB::lmTempSensorsIndex.2 = INTEGER: 1
+LM-SENSORS-MIB::lmTempSensorsIndex.3 = INTEGER: 2
+LM-SENSORS-MIB::lmTempSensorsIndex.4 = INTEGER: 3
+LM-SENSORS-MIB::lmTempSensorsIndex.5 = INTEGER: 4
+LM-SENSORS-MIB::lmTempSensorsIndex.6 = INTEGER: 5
+LM-SENSORS-MIB::lmTempSensorsIndex.7 = INTEGER: 6
+LM-SENSORS-MIB::lmTempSensorsIndex.8 = INTEGER: 7
+LM-SENSORS-MIB::lmTempSensorsIndex.9 = INTEGER: 8
+LM-SENSORS-MIB::lmTempSensorsIndex.10 = INTEGER: 9
+LM-SENSORS-MIB::lmTempSensorsDevice.1 = STRING: CPU0_DIE_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: CPU2_DIE_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: CPU1_DIE_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsDevice.4 = STRING: CPU3_DIE_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsDevice.5 = STRING: CPU4_DIE_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsDevice.6 = STRING: CPU6_DIE_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsDevice.7 = STRING: MB_AMB_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsDevice.8 = STRING: IOB_AMB_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsDevice.9 = STRING: DBP0_AMB_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsDevice.10 = STRING: DBP1_AMB_TEMPERATURE_SENSOR
+LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 71
+LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 60
+LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 66
+LM-SENSORS-MIB::lmTempSensorsValue.4 = Gauge32: 59
+LM-SENSORS-MIB::lmTempSensorsValue.5 = Gauge32: 65
+LM-SENSORS-MIB::lmTempSensorsValue.6 = Gauge32: 69
+LM-SENSORS-MIB::lmTempSensorsValue.7 = Gauge32: 28
+LM-SENSORS-MIB::lmTempSensorsValue.8 = Gauge32: 25
+LM-SENSORS-MIB::lmTempSensorsValue.9 = Gauge32: 25
+LM-SENSORS-MIB::lmTempSensorsValue.10 = Gauge32: 24
+LM-SENSORS-MIB::lmFanSensorsIndex.1 = INTEGER: 0
+LM-SENSORS-MIB::lmFanSensorsIndex.2 = INTEGER: 1
+LM-SENSORS-MIB::lmFanSensorsIndex.3 = INTEGER: 2
+LM-SENSORS-MIB::lmFanSensorsIndex.4 = INTEGER: 3
+LM-SENSORS-MIB::lmFanSensorsIndex.5 = INTEGER: 4
+LM-SENSORS-MIB::lmFanSensorsIndex.6 = INTEGER: 5
+LM-SENSORS-MIB::lmFanSensorsIndex.7 = INTEGER: 6
+LM-SENSORS-MIB::lmFanSensorsIndex.8 = INTEGER: 7
+LM-SENSORS-MIB::lmFanSensorsIndex.9 = INTEGER: 8
+LM-SENSORS-MIB::lmFanSensorsIndex.10 = INTEGER: 9
+LM-SENSORS-MIB::lmFanSensorsDevice.1 = STRING: CPU0_PFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsDevice.2 = STRING: CPU1_PFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsDevice.3 = STRING: CPU0_SFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsDevice.4 = STRING: CPU1_SFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsDevice.5 = STRING: IO_BRIDGE_PFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsDevice.6 = STRING: IO_BRIDGE_SFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsDevice.7 = STRING: IO0_PFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsDevice.8 = STRING: IO1_PFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsDevice.9 = STRING: IO0_SFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsDevice.10 = STRING: IO1_SFAN_TACH
+LM-SENSORS-MIB::lmFanSensorsValue.1 = Gauge32: 2439
+LM-SENSORS-MIB::lmFanSensorsValue.2 = Gauge32: 2586
+LM-SENSORS-MIB::lmFanSensorsValue.3 = Gauge32: 2459
+LM-SENSORS-MIB::lmFanSensorsValue.4 = Gauge32: 2564
+LM-SENSORS-MIB::lmFanSensorsValue.5 = Gauge32: 3409
+LM-SENSORS-MIB::lmFanSensorsValue.6 = Gauge32: 0
+LM-SENSORS-MIB::lmFanSensorsValue.7 = Gauge32: 3947
+LM-SENSORS-MIB::lmFanSensorsValue.8 = Gauge32: 3896
+LM-SENSORS-MIB::lmFanSensorsValue.9 = Gauge32: 4000
+LM-SENSORS-MIB::lmFanSensorsValue.10 = Gauge32: 3896
+LM-SENSORS-MIB::lmVoltSensorsIndex.1 = INTEGER: 0
+LM-SENSORS-MIB::lmVoltSensorsIndex.2 = INTEGER: 1
+LM-SENSORS-MIB::lmVoltSensorsIndex.3 = INTEGER: 2
+LM-SENSORS-MIB::lmVoltSensorsIndex.4 = INTEGER: 3
+LM-SENSORS-MIB::lmVoltSensorsIndex.5 = INTEGER: 4
+LM-SENSORS-MIB::lmVoltSensorsIndex.6 = INTEGER: 5
+LM-SENSORS-MIB::lmVoltSensorsIndex.7 = INTEGER: 6
+LM-SENSORS-MIB::lmVoltSensorsIndex.8 = INTEGER: 7
+LM-SENSORS-MIB::lmVoltSensorsIndex.9 = INTEGER: 8
+LM-SENSORS-MIB::lmVoltSensorsIndex.10 = INTEGER: 9
+LM-SENSORS-MIB::lmVoltSensorsIndex.11 = INTEGER: 10
+LM-SENSORS-MIB::lmVoltSensorsIndex.12 = INTEGER: 11
+LM-SENSORS-MIB::lmVoltSensorsDevice.1 = STRING: PS0_3_3V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.2 = STRING: PS0_5V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.3 = STRING: PS0_12V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.4 = STRING: PS0_48V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.5 = STRING: PS1_3_3V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.6 = STRING: PS1_5V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.7 = STRING: PS1_12V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.8 = STRING: PS1_48V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.9 = STRING: PS2_3_3V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.10 = STRING: PS2_5V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.11 = STRING: PS2_12V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsDevice.12 = STRING: PS2_48V_I_SENSOR
+LM-SENSORS-MIB::lmVoltSensorsValue.1 = Gauge32: 6
+LM-SENSORS-MIB::lmVoltSensorsValue.2 = Gauge32: 4
+LM-SENSORS-MIB::lmVoltSensorsValue.3 = Gauge32: 3
+LM-SENSORS-MIB::lmVoltSensorsValue.4 = Gauge32: 4
+LM-SENSORS-MIB::lmVoltSensorsValue.5 = Gauge32: 6
+LM-SENSORS-MIB::lmVoltSensorsValue.6 = Gauge32: 4
+LM-SENSORS-MIB::lmVoltSensorsValue.7 = Gauge32: 3
+LM-SENSORS-MIB::lmVoltSensorsValue.8 = Gauge32: 4
+LM-SENSORS-MIB::lmVoltSensorsValue.9 = Gauge32: 6
+LM-SENSORS-MIB::lmVoltSensorsValue.10 = Gauge32: 4
+LM-SENSORS-MIB::lmVoltSensorsValue.11 = Gauge32: 3
+LM-SENSORS-MIB::lmVoltSensorsValue.12 = Gauge32: 4
+
+This component also reports information for switches, LEDs
+and i2c's (devices accessing the i2c bus).
+Because the MIB only allows us to display numeric
+information a certain amount of translation has been done.
+
+Switches:
+
+0 = OFF
+1 = ON
+2 = NORMAL
+3 = LOCKED
+4 = UNKNOWN
+5 = DIAG
+6 = SECURE
+99 = other
+
+LEDs:
+
+0 = OFF
+1 = ON
+2 = BLINK (this may not exist)
+99 = other
+
+i2c's:
+0 = OK
+99 = other
+
+In order to prevent inordinant consumption of machine resources,
+some sensor information is cached. Currently, information
+retrieved from picld is cached for six seconds.
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca>
+
+------------------------------------------------------------
+
+10. MIB rewrites for IF-MIB, TCP-MIB and UDP-MIB
+
+net-snmp 5.4 has started to include rewrites for the IF-MIB, TCP-MIB and
+UDP-MIB implementations. They need to be explicitely enabled, though:
+
+ ./configure --enable-mfd-rewrites ...
+
+See the Net-SNMP Wiki (http://www.net-snmp.org/wiki/index.php/IF-MIB_rewrite)
+for further details.
+
+Thanks to Sun for the excellent patches.
+
+
+ -- Thomas Anders <tanders@users.sourceforge.net>
+
+------------------------------------------------------------
+
+11. Files descriptors and fopen
+
+Solaris has a limitation on the number of file descriptors (255)
+available in stdio, so that fopen() fails if more than
+255 file descriptors (sockets) are open. This prevents mibs from
+being loaded after 250 sockets are open, since parse.c uses stdio.
+
+SEan <burke_sp@pacbell.net> investigated this problem, and had this
+report on using the SFIO package to solve this problem.
+
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+The SFIO package ( http://www.research.att.com/sw/tools/sfio/ )
+is a buffered streams IO package that is much more more sophisticated
+than stdio, but it does support stdio API's for backward compatibility,
+and that's the aspect that is important here.
+
+To compile with SFIO, we simply add -I/usr/local/sfio/include to the
+$CPPFLAGS before compiling net-snmp. This causes SFIO's stdio.h to
+preempt Solaris stdio, mapping calls like fopen() and fprintf() to
+the SFIO implementations. This produces a libnetsnmp that does not
+have the fopen() limitation. Any application that links to this
+libnetsnmp must also be linked to libsfio.
+
+Here are the two caveats:
+
+A. libsfio exports the functions 'getc' and 'putc', for reasons that
+are not clear. These are the only symbols it exports that conflict
+with stdio. While getc and putc are traditionally macros, Solaris
+makes them functions in multithreaded code (compiled with -mt,
+-pthread, or -D_REENTRANT). If your native stdio code links to the
+libsfio versions, a crash will result.
+
+There are two solutions to this problem. You may remove getc and putc
+from libsfio, since SFIO defines getc and putc as macros, by doing:
+
+ ar d libsfio.a getc.o
+ ar d libsfio.a putc.o
+
+or link to SFIO's stdio compatibility library, libstdio, ahead of
+libsfio. This library wraps all of the native stdio calls with
+versions that are safe for native or sfio streams, in case you
+need to share streams between SFIO and native stdio codes.
+
+B. libsfio provides 64-bit offsets in fseek(), ftell(). This is
+a good thing, since SFIO is intended to avoid needless limitations,
+but it means that SFIO's stdio.h defines off_t to be a 64-bit offset.
+Net-SNMP uses readdir(), which returns a struct dirent containing
+a 32-bit off_t, so the code compiled for SFIO doesn't access
+struct dirent's correctly.
+
+There are two solutions to this problem, as well. The first is to
+include <dirent.h> at the start of SFIO's stdio.h. Since SFIO
+defines a macro substitution for off_t, this leaves struct dirent's
+definition unchanged.
+
+An alternative, which I haven't verified, is to define _FILE_OFFSET_BITS
+to be 64 when compiling libnetsnmp. According to what I see in Solaris's
+/usr/include/sys/feature_tests.h, you can select a 64-bit off_t at
+compile time with this setting, which should make readdir()'s off_t
+compatible with SFIO's ftell(), fseek().
+ [[ We have received reports that this approach does not in fact work
+(see Perl discussion below)]]
+
+Finally, thanks to Phong Vo and AT&T Labs for a fast, robust and
+portable package that solves this headache very neatly.
+
+-SEan <burke_sp@pacbell.net>
+
+------------------------------------------------------------
+
+12. Perl
+
+Net-SNMP may be compiled with Perl support by configuring like:
+
+ ./configure -enable-embedded-perl ...
+
+This should only be done if you are sure you really need Perl,
+for the following reasons:
+
+Solaris 8 and later ship with a version of Perl compiled using Sun's cc.
+
+This causes a problem when attempting to compile net-snmp
+with Perl functionality ie.:
+
+ ./configure --with-mib-modules="ucd-snmp/lmSensors ucd-snmp/diskio \
+ smux mibII/mta_sendmail" --enable-embedded-perl
+
+because during the Perl section of the compile, it attempts to do so
+using the methodology used to compile the original Perl, not
+what you're currently using. This can be discovered by typing:
+
+ perl -V
+
+and it says (among other things)
+
+ Compiler:
+ cc='cc'
+
+and you don't have the full version of Sun's C compiler on your
+system, it's going to break.
+
+In addition if it was compiled with:
+
+ LFS_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
+net-snmp will not compile correctly.
+
+Given that the Perl provided with Solaris 8 (5.005_03) and Solaris 9
+(5.005_03 and 5.6.1) is somewhat stale, upgrading may be to your advantage.
+
+Perl did not ship with Solaris before version 8. If you installed a
+version from www.sunfreeware.com, it is compiled with some extra flags
+that cause the net-snmp compile to break.
+
+In either case, you will need to compile and install Perl.
+
+There are, however, some issues.
+
+A. Some applications (eg. /usr/bin/kstat) require this exact version
+of Perl because of libraries. These instructions below install Perl
+in /usr/local/bin (and optionally /usr/bin/). The original is left
+intact in /usr/perl5/bin/perl where, in fact, the kstat script looks
+for it. If you have version specific scripts, you will need to do
+the same either by invoking /usr/perl5/bin/perl or putting:
+
+#!/usr/perl/bin/perl -w
+
+as the first line of your script and making it executable
+(see the /usr/bin/kstat source as an example).
+
+B. The instructions below disable large file support.
+
+This means that Perl would be unable to deal
+successfully with files larger than 2 Gb.
+Again, using /usr/perl5/bin/perl or a version compiled
+with this functionality would solve this.
+
+Hence the ideal solution is a net-snmp specific Perl in its own directory.
+
+The following instructions will install a working Perl in /usr/local/net-snmp.
+
+Install gcc version 3.3.2 (or later) from www.sunfreeware.com.
+
+Download the current stable release of Perl
+
+ http://www.cpan.org/src/stable.tar.gz
+
+and gunzip and untar. (This document assumes Perl 5.8.3 or later)
+
+cd to the source directory and type the following:
+
+ sh Configure -Dcc=gcc -Dprefix=/usr/local/net-snmp -Uinstallusrbinperl \
+ -Duseshrplib -Dcf_email=your_email@your_domain \
+ -Dperladmin=your_email@your_domain -Uuselargefiles -de
+
+Replace your_email@your_domain by your real email address. If you intend
+to compile Net-SNMP with Sun cc later on, replace gcc with cc above.
+
+When it is finished, do:
+
+ grep cppsymbols config.sh
+
+and make sure "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" does NOT appear.
+
+Then do:
+
+ make
+ make test (optional)
+ make install
+ /usr/local/net-snmp/bin/perl -V
+
+if everything looks all right, compile net-snmp (see above) with the
+following differences:
+
+env PERLPROG=/usr/local/net-snmp/bin/perl ./configure --enable-embedded-perl \
+ --with-mib-modules=ucd-snmp/lmSensors,ucd-snmp/diskio,smux,mibII/mta_sendmail \
+ --with-cc=gcc && make && make test && make install
+
+Make sure you specify the correct path to your self-compiled Perl binary
+and use the same compiler like the one you used when building Perl above.
+Feel free to add other configure options, of course.
+
+"make test" includes some tests for the Net-SNMP Perl functionalities.
+
+Once you have compiled and installed net-snmp you can test the Perl
+capabilities of the final installation by doing the following:
+
+Copy the perl_module.pl script found at
+
+http://www.net-snmp.org/tutorial-5/toolkit/perl/index.html
+
+to /usr/local/net-snmp
+
+and modify your /usr/local/share/snmp/snmpd.conf file to contain the entry:
+
+perl do "/usr/local/net-snmp/perl_module.pl";
+
+then do:
+
+/usr/local/bin/snmpwalk -v 2c -c whatever localhost .1.3.6.1.4.1.8072.999
+
+It should return the following:
+
+NET-SNMP-MIB::netSnmp.999.1.2.1 = STRING: "hello world"
+
+WARNING!! If you are planning on creating binary versions of net-snmp with
+Perl capability, you will also need to ship the Perl which you created in
+/usr/local/net-snmp.
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca>
+ -- Thomas Anders <tanders@users.sourceforge.net>
+
+------------------------------------------------------------
+
+13. sed
+
+Various sed versions in older Solaris releases (Solaris 8 and earlier
+at least) have serious limitations that may affect ./configure
+when building net-snmp. All these issues *should* have been addressed
+in net-snmp 5.4 and later. If you still have problems, please let us know
+and consider:
+
+- installing GNU sed and putting it in front of your PATH
+- installing the available Sun patches for the various sed versions
+ (/usr/bin/sed, /usr/xpg4/bin/sed, /usr/ucb/sed)
+- try the suggestions below
+
+The version of sed in /usr/ucb on Solaris 2.5.1 and 2.6 can't
+cope with the size of the substitution strings used in config.status.
+
+Putting /usr/bin ahead of /usr/ucb in the search path fixes this.
+
+/usr/xpg4/bin/sed is seen to segfault under Solaris 8 when running configure.
+Putting /usr/bin ahead of /usr/xpg4/bin fixes this.
+
+
+ -- Thomas Anders <tanders@users.sourceforge.net>
+ -- zach dot metzinger at microtune dot com
+
+------------------------------------------------------------
+
+14. OpenSSL and crle
+
+If compiling with OpenSSL (e.g. from sunsolve), it's possible that
+the agent won't successfully load the crypto library (typically
+in /usr/local/ssl/lib) when it is in use and will return a
+cannot find library error message of some sort.
+
+To rectify this, you will need to use the /usr/bin/crle command, which
+did NOT ship with some versions of Solaris, but came as part of later
+patches. You should make sure the following patches are up to date:
+
+107733 (Solaris 2.6)
+106950 (Solaris 2.7)
+109147 (Solaris 8)
+115833 (Trusted Solaris 8)
+112693 (Solaris 9)
+
+Then type the following:
+
+/usr/bin/crle
+
+It will return something like:
+
+Default configuration file (/var/ld/ld.config) not found
+ Default Library Path (ELF): /usr/lib (system default)
+ Trusted Directories (ELF): /usr/lib/secure (system default)
+
+Find the location of the libcrypto libraries by typing:
+
+find /usr -name "libcrypto*" -print
+
+which will probably display:
+
+/usr/local/ssl/lib/libcrypto.a
+/usr/local/ssl/lib/libcrypto.so
+/usr/local/ssl/lib/libcrypto.so.0
+/usr/local/ssl/lib/libcrypto.so.0.9.7
+
+which is the default installation for OpenSSL.
+
+To include this in the loader search path, type:
+
+/usr/bin/crle -u -l /usr/local/ssl/lib
+
+/usr/bin/crle will now display:
+
+Configuration file [3]: /var/ld/ld.config
+ Default Library Path (ELF): /usr/lib:/usr/local/ssl/lib
+ Trusted Directories (ELF): /usr/lib/secure (system default)
+
+Command line:
+ crle -c /var/ld/ld.config -l /usr/lib:/usr/local/ssl/lib
+
+If this fails, usually by displaying:
+
+crle: /var/ld/ld.config: open failed: No such file or directory
+
+you will need to create this directory by hand by doing the following:
+
+mkdir /var/ld
+cd /var/ld
+ln -s . 32
+mkdir sparcv9
+chgrp bin sparcv9
+ln -s sparcv9 64
+touch ld.config
+
+then do:
+
+crle -c /var/ld/ld.config -l /usr/lib:/usr/local/ssl/lib
+
+Thanks to Dave Shield and Johannes Schmidt-Fischer
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca>
+
+------------------------------------------------------------
+
+15. IPv6
+
+Starting with net-snmp 5.4 you can enable the UDPIPv6 and TCPIPv6
+transports on Solaris:
+
+ ./configure --enable-ipv6
+
+There's no support for the mibII/ipv6 mib module, though.
+
+
+ -- Thomas Anders <tanders@users.sourceforge.net>
+
+------------------------------------------------------------
+
+16. Wish list
+
+A. Code cleanup
+
+There may be opportunities for shared code between UCD-SNMP
+and HOST-RESOURCES-MIB.
+
+There may be opportunities to optimize caching perhaps
+using the new auto-caching code.
+
+B. LM-SENSORS-MIB
+
+We need a complete list of sensors from various platforms so
+they can be displayed properly.
+
+C. ORACLE
+
+How to get ORACLE's SNMP functionality to work as a sub-agent.
+
+D. Largefile support
+
+Rework the host mib module to work even if net-snmp is built with
+largefile support. This would eliminate the most important problems
+with Perl (see section 12).
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca>
+ -- Thomas Anders <tanders@users.sourceforge.net>
+
+------------------------------------------------------------
+
+17. Known Bugs!!
+
+A. hrDeviceTable (HOST-RESOURCES-MIB)
+
+This section of code is only aware of disk controllers 0 through 7.
+Hence, anything on controller c8 and above will be invisible.
+
+B. hrPartitionTable (HOST-RESOURCES-MIB)
+
+At present, hrPartitionSize data only works for regular ufs
+partitions eg. /dev/dsk/c0t0d0s0 that are mounted. They
+are displayed in partition order rather than the order
+they are mounted. Partitions mounted as mirrors, metastate
+database replicas, swap or members of a RAID display size 0.
+
+As a workaround, put entries for disks you are
+interested in in snmpd.conf and examine
+using UCD-SNMP-MIB.
+
+
+ -- Bruce Shaw <Bruce.Shaw at shaw.ca>
+
+------------------------------------------------------------
+
+18. Discussion and further information
+
+For discussion or further information contact the coders and users
+lists at http://sourceforge.net/mail/?group_id=12694 .
+
diff --git a/README.sql b/README.sql
new file mode 100644
index 0000000..e2f7038
--- /dev/null
+++ b/README.sql
@@ -0,0 +1,29 @@
+snmptrapd MySQL Logging
+-----------------------
+
+A trap handler for logging traps to a MySQL database was added
+in release 5.5.0.
+
+The MySQL database location and password must be configured in
+/root/.my.cnf:
+
+ [snmptrapd]
+ host=localhost
+ password=sql
+
+User may also be configured, if using a MySQL user besides root.
+
+snmptrapd.conf must be configured to for the queue size and
+periodic flush interval:
+
+ # maximum number of traps to queue before forced flush
+ sqlMaxQueue 140
+
+ # seconds between periodic queue flushes
+ sqlSaveInterval 9
+
+A value of 0 for sqlSaveInterval will completely disable MySQL
+logging of traps.
+
+The schema must be loaded into MySQL before running snmptrapd.
+The schema can be found in dist/schema-snmptrapd.sql
diff --git a/README.thread b/README.thread
new file mode 100644
index 0000000..aa1304a
--- /dev/null
+++ b/README.thread
@@ -0,0 +1,343 @@
+Improved Error Reporting and Thread-Safe Use of the SNMP Library
+
+There is a need in some environments to support multiple threads
+in a single application. The SNMP Library provides the Single Session
+functions which support thread-safe operation when certain precautions
+are taken. This document describes the operation of the SNMP Library
+with a focus on its session management functions. The Traditional API
+and the Single API functions are compared and contrasted.
+A working understanding of the CMU or UCD SNMP Library
+API is recommended to fully appreciate the concepts discussed.
+The document ends with a list of restrictions for using the Single API
+in a multi-threaded application.
+
+Unfortunately, the SNMPv3 support was added about the same time as
+the thread support and since they occurred in parallel the SNMPv3
+support was never checked for multi-threading correctness. It is
+most likely that it is not thread-safe at this time.
+
+ ***** IMPORTANT ANNOUNCEMENT *****
+ To the point, no resource locks are applied within the SNMP Library.
+ The APDU encoding and some session management functions can be used
+ in thread-safe manners. The MIB file parsing is not thread-safe.
+ The Single Session API was made available in November 1998.
+ Existing applications use the Traditional API, which is not thread-safe.
+ The thread-safe considerations are discussed throughout this document.
+
+The research and development of the Single Session API that I've completed
+was wholly funded by my employer, Internet Security Systems, Inc.
+and is distributed freely to the Internet community.
+
+-Mike Slifcak, 23 April 1999
+
+09 July 1999 Removed references to snmp_synch_setup and snmp_synch_reset
+
+
+Availability
+
+The Single Session API is integrated into the currently available
+versions of the CMU SNMP library and the UC-Davis SNMP package.
+
+ ftp://ftp.net.cmu.edu/pub/snmp/cmu-snmp-V1.13.tar.gz and later
+ Read : snmp_sess_api.3, Changes.SingleSession
+
+ ftp://ucd-snmp.ucdavis.edu/ucd-snmp-3.6.tar.gz and later
+ Read : snmp_sess_api.3, README.thread (after version 3.6.1)
+
+Both libraries work equally well in Windows NT and various
+UNIX platforms. Please read this document and refer to
+the snmp_sess_api section 3 manual page.
+
+Glossary of Terms
+
+APDU Application Protocol Data Unit
+API Application Programming Interface
+CMU Carnegie-Mellon University, Pittsburgh, PA.
+Library The SNMP library; Both CMU and UCD versions are applicable.
+Session Concept embodying the management of transacting SNMP APDUS.
+SNMP Simple Network Management Protocol
+UCD University of California at Davis, CA.
+
+Introduction
+
+The Library extends the UNIX file concept (open, close, read, write) to a Session.
+Opening a Session binds a local socket to a well-known port and creates internal
+structures to help with controlling the transaction of SNMP APDUs. Closing a
+Session releases the memory and system resources used for these purposes.
+
+Since the mid-1980s, many SNMP applications have used the Traditional Session
+API to transact SNMP APDUs between the local host and SNMP-enabled devices.
+
+ The Traditional Session API does not support multi-threaded applications:
+
+ 1) There are no resource locks to prevent exposing the Library's
+ global data resources to corruption in a multi-threaded application;
+
+ 2) The Traditional API functions that receive SNMP APDUs
+ do not provide an interface for one of many sessions;
+
+ 3) Errors discovered by the Library are communicated through global
+ data structures and are not associated with the session
+ in which the error occurred.
+
+ The Single Session API provides these capabilities:
+
+ 1) Manage a single SNMP session safely, in multi-threaded or
+ non-threaded applications, by avoiding access to data structures
+ that the Traditional Session API may share between Sessions;
+
+ 2) Associate errors with the session context for threaded
+ and non-threaded applications.
+
+
+Contrasting and Comparing Traditional API and Single API
+
+The Traditional API uses the struct snmp_session pointer returned
+from snmp_open() to identify one SNMP session. The Single API uses
+the opaque pointer returned from snmp_sess_open() to identify one
+SNMP session.
+
+ Helpful Hint : The Library copies the contents of the
+ structure which is input to snmp_open() and snmp_sess_open().
+ Once copied, changing that input structure's data
+ has no effect on the opened SNMP Session.
+
+The Traditional API uses the snmp_error() function to identify any
+library and system errors that occurred during the processing for
+one SNMP session. The Single API uses snmp_sess_error() for the
+same purpose.
+
+The Traditional API manages the private Sessions list structure;
+adding to the list during snmp_open(), removing during snmp_close.
+
+With few exceptions, the Traditional API calls the Single API
+for each session that appears on the Sessions list.
+
+The Traditional API reads from all Sessions on the Sessions list;
+The Single API does not use the Sessions list.
+The Single API can read from only one Session.
+
+ Helpful Hint :
+ This is the basis for thread-safe-ness of the Library.
+ There are no resource locks applied.
+
+
+Using the Single API
+
+A multi-threaded application that deploys the SNMP Library should
+should complete all MIB file parsing before additional threads
+are activated. Drawing from the parsed contents of the MIB does
+not incur any data corruption exposure once the internal MIB structures
+are initialised.
+
+The application may create threads such that a single thread may manage
+a single SNMP session. The thread should call snmp_sess_init()
+to prepare a struct snmp_session structure. The thread can adjust
+session parameters such as the remote UDP port or the local UDP port,
+which must be set prior to invoking snmp_sess_open().
+
+The first call to snmp_sess_init() initialises the SNMP Library,
+including the MIB parse trees, before any SNMP sessions are created.
+Applications that call snmp_sess_init() do not need to read MIBs
+nor setup environment variables to utilize the Library.
+
+After the struct snmp_session is setup, the thread must call
+snmp_sess_open() to create an SNMP session. If at any time
+the thread must change the Session configuration,
+snmp_sess_session() returns the pointer to the internal configuration
+structure (a struct snmp_session, copied from snmp_sess_open).
+The thread can adjust parameters such as the session timeout
+or the community string with this returned struct snmp_session pointer.
+Changes to the remote or local port values have no effect on an opened Session.
+
+The thread can build PDUs and bind variables to PDUs, as it performs its duties.
+The thread then calls snmp_sess_send() or snmp_sess_async_send() to build and send
+an SNMP APDU to the remote device. If a Get-Response-PDU is expected, the thread
+should call snmp_sess_synch_response() instead.
+
+When the thread is finished using the session, it must free the resources
+that the Library used to manage the session.
+Finally, the thread must call snmp_sess_close() to end the Session.
+
+Snmp_sess_init(), snmp_open(), and snmp_sess_open()
+must use the same calling parameter for a given Session.
+Other methods should use only the returned parameter from
+snmp_open() and snmp_sess_open() to access the opened SNMP Session.
+
+
+Error Processing
+
+Two calls were added : snmp_error() and snmp_sess_error() return the
+"errno" and "snmp_errno" values from the per session data, and a string
+that describes the errors that they represent. The string must be freed
+by the caller.
+
+Use snmp_error() to process failures after Traditional API calls,
+or snmp_sess_error() to process failure after Single API calls.
+In the case where an SNMP session could not be opened,
+call snmp_error() using the struct snmp_session supplied to either snmp_open()
+or snmp_sess_open().
+
+
+The following variables and functions are obsolete and may create problems
+in a multi-threaded application :
+
+ int snmp_errno
+ char * snmp_detail
+ snmp_set_detail()
+ snmp_api_errstring()
+
+
+Function Summary
+
+The functions in the following table are functionally equivalent,
+with the exception of these behaviors:
+- The Traditional API manages many sessions
+- The Traditional API passes a struct snmp_session pointer,
+ and touches the Sessions list
+- The Single API manages only one session
+- The Single API passes an opaque pointer, and does not use Sessions list
+
+ Traditional Single Comment
+ =========== ============== =======
+ snmp_sess_init snmp_sess_init Call before either open
+ snmp_open snmp_sess_open Single not on Sessions list
+ snmp_sess_session Exposes snmp_session pointer
+ snmp_send snmp_sess_send Send one APDU
+ snmp_async_send snmp_sess_async_send Send one APDU with callback
+ snmp_select_info snmp_sess_select_info Which session(s) have input
+ snmp_read snmp_sess_read Read APDUs
+ snmp_timeout snmp_sess_timeout Check for timeout
+ snmp_close snmp_sess_close Single not on Sessions list
+ snmp_synch_response snmp_sess_synch_response Send/receive one APDU
+ snmp_error snmp_sess_error Get library,system errno
+
+
+Example 1 : Traditional API use.
+
+ #include "snmp_api.h"
+ ...
+ int liberr, syserr;
+ char *errstr;
+ struct snmp_session Session, *sptr;
+ ...
+ snmp_sess_init(&Session);
+ Session.peername = "foo.bar.net";
+ sptr = snmp_open(&Session);
+ if (sptr == NULL) {
+ /* Error codes found in open calling argument */
+ snmp_error(&Session, &liberr, &syserr, &errstr);
+ printf("SNMP create error %s.\n", errstr);
+ free(errstr);
+ return 0;
+ }
+ /* Pass sptr to snmp_error from here forward */
+ ...
+ /* Change the community name */
+ free(sptr->community);
+ sptr->community = strdup("public");
+ sptr->community_len = strlen("public");
+ ...
+ if (0 == snmp_send(sptr, pdu)) {
+ snmp_error(sptr, &liberr, &syserr, &errstr);
+ printf("SNMP write error %s.\n", errstr);
+ free(errstr);
+ return 0;
+ }
+ snmp_close(sptr);
+
+
+Example 2 : Single API use.
+
+ #include "snmp_api.h"
+ ...
+ int liberr, syserr;
+ char *errstr;
+ void *sessp; /* <-- an opaque pointer, not a struct pointer */
+ struct snmp_session Session, *sptr;
+ ...
+ snmp_sess_init(&Session);
+ Session.peername = "foo.bar.net";
+ sessp = snmp_sess_open(&Session);
+ if (sessp == NULL) {
+ /* Error codes found in open calling argument */
+ snmp_error(&Session, &liberr, &syserr, &errstr);
+ printf("SNMP create error %s.\n", errstr);
+ free(errstr);
+ return 0;
+ }
+ sptr = snmp_sess_session(sessp); /* <-- get the snmp_session pointer */
+
+ /* Pass sptr to snmp_sess_error from here forward */
+ ...
+ /* Change the community name */
+ free(sptr->community);
+ sptr->community = strdup("public");
+ sptr->community_len = strlen("public");
+ ...
+ if (0 == snmp_sess_send(sessp, pdu)) {
+ snmp_sess_error(sessp, &liberr, &syserr, &errstr);
+ printf("SNMP write error %s.\n", errstr);
+ free(errstr);
+ return 0;
+ }
+ snmp_sess_close(sessp);
+
+Example 3. Differences Between Traditional API and Single API Usage
+5a6
+> void *sessp; /* <-- an opaque pointer, not a struct pointer */
+11,13c12,14
+< sptr = snmp_open(&Session);
+< if (sptr == NULL) {
+---
+> sessp = snmp_sess_open(&Session);
+> if (sessp == NULL) {
+19c20,22
+< /* Pass sptr to snmp_error from here forward */
+---
+> sptr = snmp_sess_session(sessp); /* <-- get the snmp_session pointer */
+>
+> /* Pass sptr to snmp_sess_error from here forward */
+26,27c29,30
+< if (0 == snmp_send(sptr, pdu)) {
+< snmp_error(sptr, &liberr, &syserr, &errstr);
+---
+> if (0 == snmp_sess_send(sessp, pdu)) {
+> snmp_sess_error(sessp, &liberr, &syserr, &errstr);
+33c36
+< snmp_close(sptr);
+---
+> snmp_sess_close(sessp);
+
+
+Restrictions on Multi-threaded Use of the SNMP Library
+
+ 1. Invoke SOCK_STARTUP or SOCK_CLEANUP from the main thread only.
+
+ 2. The MIB parsing functions use global shared data and are not
+ multi-thread safe when the MIB tree is under construction.
+ Once the tree is built, the data can be safely referenced from
+ any thread. There is no provision for freeing the MIB tree.
+ Suggestion: Read the MIB files before an SNMP session is created.
+ This can be accomplished by invoking snmp_sess_init from the main
+ thread and discarding the buffer which is initialised.
+
+ 3. Invoke the SNMPv2p initialisation before an SNMP session is created,
+ for reasons similar to reading the MIB file.
+ The SNMPv2p structures should be available to all SNMP sessions.
+ CAUTION: These structures have not been tested in a multi-threaded
+ application.
+
+ 4. Sessions created using the Single API do not interact with other
+ SNMP sessions. If you choose to use Traditional API calls, call
+ them from a single thread. The Library cannot reference an SNMP
+ session using both Traditional and Single API calls.
+
+ 5. Using the callback mechanism for asynchronous response PDUs
+ requires additional caution in a multi-threaded application.
+ This means a callback function probably should probably not use
+ Single API calls to further process the session.
+
+ 6. Each call to snmp_sess_open() creates an IDS. Only a call to
+ snmp_sess_close() releases the resources used by the IDS.
+
diff --git a/README.tru64 b/README.tru64
new file mode 100644
index 0000000..edc456b
--- /dev/null
+++ b/README.tru64
@@ -0,0 +1,57 @@
+Some notes for the Tru64 Unix 5.x port
+======================================
+
+1. Compiling
+------------
+
+The following procedure has been proven to successfully compile net-snmp
+version 5.2.2 and later on Tru64 Unix 5.1B (Alpha EV5.6) using the Compaq C 6.5
+compiler:
+
+ ./configure --disable-embedded-perl
+ make
+ su -
+ make install
+
+A recent GNU C compiler (gcc) will probably work, too.
+
+Please note that the "host" module doesn't compile on Tru64, so you *cannot*
+run configure with "--with-mib-modules=host".
+
+2. Embedded Perl
+----------------
+
+The Perl package (5.00503) shipped with Tru64 Unix 5.1 isn't complete enough
+to allow to build net-snmp with embedded Perl support. If you need embedded
+Perl support, do your own Perl installation first.
+
+3. IPv6
+-------
+
+Starting with net-snmp 5.4 you can enable the UDPIPv6 and TCPIPv6 transports
+on Tru64 Unix 5.1:
+
+ ./configure --enable-ipv6
+
+There's no support for the IPv6 MIBs, though.
+
+
+4. Known problems
+-----------------
+
+"make test" is known to report the following failure:
+
+ 59: testing full snmpwalk (SNMPv2c) against agent (may take time)... FAIL
+
+so it's obvious that there are still problems with some MIB modules on Tru64.
+If you have ideas how to fix them, please let us know!
+
+
+5. Feedback
+-----------
+
+Please also see README and PORTING.
+
+If you have questions, additional insights or (even better) patches regarding
+net-snmp on Tru64 Unix, please refer to the net-snmp mailing lists (see
+http://www.net-snmp.org/lists).
diff --git a/README.win32 b/README.win32
new file mode 100644
index 0000000..0f4cb9e
--- /dev/null
+++ b/README.win32
@@ -0,0 +1,1513 @@
+***************************************************************************
+*
+* README.win32
+*
+***************************************************************************
+
+This guide describes how to build Net-SNMP with Microsoft Visual C++, the
+MinGW gcc compiler or the Cygwin gcc compiler. As developers build with other
+Win32 environments, their notes will be included here.
+
+The sections in this guide are:
+
+Current Status for Win32 platforms
+Interactions with Other Vendor's Products
+Running Net-SNMP as a replacement for the Microsoft SNMP service
+Co-existence with Microsoft SNMP services
+Installing Platform SDK
+Microsoft Visual C++ - Overview
+Microsoft Visual C++ - Configure / nmake - Building
+Microsoft Visual C++ - Workspace - Building
+Microsoft Visual C++ - Workspace - Building the DLL
+Microsoft Visual C++ - Workspace - Building the Perl SNMP modules
+Microsoft Visual C++ - Workspace - Installing
+Microsoft Visual C++ - Building with OpenSSL
+Microsoft Visual C++ - Building with IPv6
+Microsoft Visual C++ - Building your own applications with snmplib
+Microsoft Visual C++ - Extending the Agent
+GCC on Windows
+Cygwin - Building
+MinGW - Building
+MinGW - Building with OpenSSL
+Configuring Net-SNMP
+How to Register the Net-SNMP Agent and Trap Daemon as Windows services
+Notes on SET support for WIN32 ports
+Notes on preprocessor defines for MSVC, MinGW and Cygwin
+Acknowledgements
+
+
+***************************************************************************
+*
+* Net-SNMP status for Win32 platforms
+*
+***************************************************************************
+
+All applications build with Microsoft Visual C++ 6.0, Microsoft Development
+Environment 2003 (MSVC 7.0/7.1), Microsoft Visual Studio 2005, Microsoft
+Visual Studio 2008, Microsoft Visual Studio 2010, gcc under Cygwin and gcc
+under MinGW.
+
+ - All of the applications work (snmpwalk, snmpget, snmpset, snmptrap, ...).
+ - The system, snmp, ip, tcp, udp and icmp MIB-groups work (requires the
+ Platform SDK).
+ - The Net-SNMP agent runs as an AgentX master agent or as subagent.
+ - smux is working.
+ - The target, notification, disman/mte groups compile but are not tested.
+ - The TCP/IPv6 and UDP/IPv6 transports compile but are not tested.
+ - Extending the agent to support enterprise-specific MIBs works.
+ - Running the agent on a non-standard UDP or TCP port works.
+ - Snmpd can be registered as a Windows service.
+ - Snmptrapd can be registered as a Windows service.
+ - Some build environments allow long pathnames that contain
+ embedded spaces. As this is not true for Cygwin "configure",
+ the documented example scripts will refer to "c:/usr"
+ as the base directory for installed Net-SNMP software.
+ - When using the winExtDLL extension agent, the Net-SNMP agent will
+ load the Windows SNMP Service extension DLLs.
+
+The next subsection relates to items that are built using Visual Studio
+
+ - All Visual Studio project (.dsp) files are cleaned, and
+ a) Generate code to use Multi-Threaded DLL (/MD) "C" run-time library;
+ b) Provide the same preprocessor defines (WIN32,_CONSOLE,_MBCS);
+ c) Remove unnecessary references to GDI, ODBC, and "C" libraries;
+ d) Debug versions build source browsing and debugging information;
+ e) Provide consistent include search paths.
+
+ - All Debug and Release targets linked with libsnmp project targets
+ build without errors, and are fully functional.
+
+ - Both building via the interactive development environment and via the
+ command line (nmake) is supported.
+
+ - With Visual Studio 2005 and later, the Net-SNMP source code can be
+ compiled into either 32-bit or 64-bit executables (the amd64/x64
+ architecture). Previous Visual Studio versions support 32-bit executables
+ only.
+
+
+***************************************************************************
+*
+* Interactions with Other Vendor's Products
+*
+***************************************************************************
+
+ - Install scripts etc are written assuming Windows NT / 2000 or higher
+
+ - Running the Net-SNMP Agent or trap receiver on Windows 95 or Win3.1
+ is not supported.
+
+ - Running the Net-SNMP Agent or trap receiver as a service on Windows 95
+ or Windows 98 is not supported.
+
+ - The Net-SNMP agent and trap receiver will fail to start if either
+ cannot bind to their connect port (161 for agent, 162 for trap receiver).
+ Check the Services panel to be sure no other SNMP program conflicts. See
+ the section titled 'Co-existence with Microsoft SNMP services' below.
+
+ - The Net-SNMP agent can be used instead of the MS supplied one while
+ retaining all functionality and with slightly better SNMP conformance.
+ See the section titled 'Co-existence with Microsoft SNMP services' below.
+
+ - The Net-SNMP agent does not use the MS SNMP.dll, therefore it cannot
+ run as an extensible part of the MS agent. It is possible to use a third
+ party proxy agent for the MS agent to 'proxy' requests to the Net-SNMP
+ agent listening on a different UDP port on the same machine.
+
+ - Snmptrapd does not "share" nor multiplex traps with SNMPTRAP.EXE,
+ a program that is available from Microsoft or ACE#COMM.
+
+
+***************************************************************************
+*
+* Running Net-SNMP as a replacement for the Microsoft SNMP service
+*
+***************************************************************************
+
+As of Net-SNMP 5.4, the Net-SNMP agent is able to load the Windows SNMP
+service extension DLLs by using the Net-SNMP winExtDLL extension.
+
+The Windows SNMP service must be installed, but the service must be 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.
+
+An alternative to winExtDLL is to proxy requests from Net-SNMP to the Windows
+SNMP service. See the section 'Co-existence with Microsoft SNMP services'.
+
+
+Limitations
+-----------
+
+- When using HP Insight Agents, some parts of the enterprises.232 tree are not
+ accessible. The cause of this is not known.
+
+- When using winExtDLL, there is an offset of up to one second between the
+ value of the sysUpTime varbind included in the traps generated by SNMP
+ extension DLLs (e.g. linkUp and linkDown) and the value of the sysUpTime
+ varbind included in traps generated by Net-SNMP itself (e.g. coldStart).
+
+- When using winExtDLL, hrSystemUptime.0 reports the system uptime in thousands
+ of a second instead of hundreds of a second. This is well known behavior of
+ the Microsoft DLL that implements this MIB object. For more information,
+ see also https://connect.microsoft.com/onecare/feedback/ViewFeedback.aspx?FeedbackID=504908.
+
+
+Enabling the Windows SNMP extension agents
+------------------------------------------
+
+When installing Net-SNMP using the binary available from the web site, select
+'With Windows Extension DLL support' for the 'Net-SNMP Agent Service'.
+
+The recommended way to start snmpd is with the following command line:
+
+ snmpd.exe -I-udp,udpTable,tcp,tcpTable,icmp,ip,interfaces,system_mib,sysORTable
+
+The above command will exclude all the Net-SNMP extensions that overlap with
+the default Windows (2003) extensions included with Windows. Other Net-SNMP
+modules take precedence over the modules loaded by winExtDLL.
+
+The binary install of Net-SNMP includes shortcuts in the Start menu for
+registering and unregistering snmpd and snmptrapd as a service with the
+correct command line options.
+
+A simple test to see if winExtDLL is working is to get the sysDescr string.
+
+ snmpget -v 1 -c public localhost sysDescr.0
+
+If you see something similar to:
+
+ Hardware: x86 Family 15 Model 12 Stepping 0 AT/AT COMPATIBLE - Software:
+ Windows 2000 Version 5.0 (Build 2195 Uniprocessor Free)
+
+instead of the usual Net-SNMP:
+
+ Windows host1 5.0.2195 Service Pack 4 2000 Server x86 Family 15 Model 12
+ Stepping 0
+
+then it's using the Windows DLLs. You may also notice that your floppy
+drive is accessed when starting the service. This is from one of the
+Windows extensions.
+
+To see what Windows modules are being loaded, you can shut down the
+service and then run snmpd.exe from the command line with winExtDLL
+debugging enabled using (all on one line):
+
+ snmpd.exe -Lo -I-udp,udpTable,tcp,tcpTable,icmp,ip,interfaces,system_mib,
+ sysORTable -DwinExtDLL
+
+The Windows DLL snmpmib.dll (SNMPMIB) contains SNMP traffic statistics
+(.1.3.6.1.2.1.11). As we are using Net-SNMP and not the Windows SNMP Service,
+no values will be returned from the Windows extension. To allow SNMP
+statistics to be received, the Net-SNMP module snmp_mib is permitted to load
+by not excluding it in the above command line. As stated above, this module
+will take precedence over the Windows module.
+
+
+Registry Information
+--------------------
+
+Warning: Improper use of the registry editor can damage to your operating
+ system and should only be used by experienced users.
+
+The following registry keys are used by the Windows SNMP Service to determine
+what extension DLLs to load:
+
+HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents
+
+Each REG_SZ value contains the registry path to an extension agent which
+contains the path to the DLL. For example:
+
+Name Type Value
+1 REG_SZ SOFTWARE\Microsoft\LANManagerMIB2Agent\CurrentVersion
+
+To prevent winExtDLL from loading the above extension, change the registry
+path to an invalid path such as:
+
+Name Type Value
+1 REG_SZ SOFTWARE\Microsoft\LANManagerMIB2Agent\CurrentVersion!!!
+
+
+Service dependencies
+--------------------
+
+Services that depend on the SNMP Service will have to be modified to depend on
+Net-SNMP instead of SNMP by modifying the registry. See Microsoft article
+193888 for more information.
+
+
+Compiling Net-SNMP with the winExtDLL extension (MSVC)
+------------------------------------------------------
+
+When building with MSVC 6, the Microsoft Platform SDK is required. Note: the
+most recent Platform SDK version that is still compatible with MSVC 6 is the
+February 2003 edition. This edition is no longer available online but can be
+ordered via http://mssdk.orderport.net/22221848/showall.asp.
+
+Configure / nmake:
+
+-add --with-winextdll to the Configure command line.
+
+Workspace:
+
+-in file win32\net-snmp\net-snmp-config.h modify
+ /* #undef USING_WINEXTDLL_MODULE */ into the following:
+ #define USING_WINEXTDLL_MODULE 1
+
+
+***************************************************************************
+*
+* Co-existence with Microsoft SNMP services
+*
+***************************************************************************
+
+If the Microsoft SNMP agent service (SNMP Service) is running, the Net-SNMP
+agent (snmpd) will fail to start as it will not be able to bind to the default
+TCP/IP port of 161.
+
+If the Microsoft SNMP Trap Receiver service is running, the Net-SNMP trap
+receiver (snmptrapd) will fail to start as it will not be able to bind to the
+default TCP/IP port of 162.
+
+It is not a requirement to install the Net-SNMP agent (snmpd) or trap receiver
+(snmptrapd). All the command line utilities such as snmpget.exe, snmpset.exe
+and the Perl modules will work without the Net-SNMP services. All the
+utilities will work against any SNMP agent.
+
+The main benefit of running the Microsoft SNMP agent instead of the Net-SNMP
+agent is that many Windows applications such as Microsoft SQL Server,
+Microsoft Exchange etc, extend the Microsoft agent. Net-SNMP is NOT a drop
+in replacement for the Microsoft agent unless the winExtDLL Net-SNMP extension
+is used (see the section 'Running Net-SNMP as a replacement for the Microsoft
+SNMP service'). Running Net-SNMP in place of the Microsoft agent (without
+winExtDLL) will prevent the other applications from working with SNMP. Also,
+the Net-SNMP agent does not contain as many MIBs as the Microsoft agent. For
+example, as of August 2005, the HOST-RESOURCES (host) MIB is not yet
+implemented in Net-SNMP.
+
+There are many benefits of running the Net-SNMP agent instead of the Microsoft
+such as you can extend the agent using various features found in snmpd.conf
+such as pass and pass_persist (support for others are being added), you can
+use SNMP v3, and there is more granular access control.
+
+To allow both the Microsoft and Net-SNMP agent / trap receiver to run at the
+same time, the default TCP/IP port must be changed on either the Microsoft or
+Net-SNMP version of the application.
+
+The Net-SNMP ports for snmpd and snmptrapd can be modified via snmpd.conf and
+snmptrapd.conf or by using a command line option with each program. See the
+Net-SNMP Help file for instructions on changing the port number.
+
+The Microsoft services use the 'snmp' and 'snmptrap' entries in the SERVICES
+file (%SystemRoot%\system32\drivers\etc\services) to determine the port to bind
+the service to when the service starts. Simply modify the entries and restart
+the affected services.
+
+Note: Changing the default port the service listens on will prevent it from
+ accepting requests or receiving traps from standard SNMP devices and
+ management stations unless they have also been reconfigured to use the
+ new port numbers.
+
+It is possible to configure Net-SNMP agent to listen on the default UDP port
+(161), have the Microsoft agent listen on another port such as 1161, and have
+Net-SNMP proxy (forward) requests to the Microsoft agent. This will allow you
+to use the advanced features of Net-SNMP while still being able to query
+the Microsoft agent and subagents. To this, follow these steps:
+
+ 1. Change the port that the Microsoft agent listens on.
+
+ 2. Configure the Microsoft agent to only accept requests from localhost.
+ This can be set in the Security tab for the SNMP service in Windows 2000+.
+ This is recommended to prevent users from querying the Microsoft agent
+ directly.
+
+ 3. Add a r/c community string to the Microsoft agent. This can be set in
+ the Security tab for the SNMP service in Windows 2000+. This will give
+ Net-SNMP full SNMP access. User access can be restricted by Net-SNMP
+ as explained below.
+
+ 4. Restart the Microsoft SNMP service.
+
+ 5. Configure Net-SNMP to proxy requests to the Microsoft agent. To have it
+ forward ALL requests to the Microsoft agent, add the following line to
+ snmpd.conf:
+
+ proxy -v 1 -c public localhost:1161 .1.3
+
+ To only forward a section of the MIB tree such as the host section, use:
+
+ proxy -v 1 -c public localhost:1161 host
+
+ 6. Start the Net-SNMP agent.
+
+ Notes: If Net-SNMP has built in support for an OID and the proxy statement
+ is not for a specific OID, then it will respond instead of proxying
+ the request. For example, if you proxy the 'system' tree and issue
+ an snmpget for sysDescr.0, Net-SNMP will respond with it's own
+ version of sysDescr.0 instead of forwarding it. To prevent Net-SNMP
+ from doing this, you must prevent the system MIB from being
+ initialized when snmpd.exe is started by specifying what MIBS to
+ initialize using the -I switch.
+
+ If you are forwarding everything to the Microsoft agent (.1.3),
+ start snmpd.exe using:
+
+ snmpd.exe -Ivacm_conf,proxy,pass,pass_persist
+
+ The above will enable proxy, pass and pass_persist support. See the
+ snmpd man page for more information on the -I switch.
+
+ If you are forwarding a section of the tree that is not implemented
+ in Net-SNMP such as 'host', you do not need to use the -I switch as
+ Net-SNMP will forward the request. This may cause issues in the
+ future if newer versions of Net-SNMP implement the section of the
+ tree you are forwarding, such as the HOST-RESOURCES MIB.
+
+ The pass and pass_persist commands will work even if the entire
+ tree is proxied to the Microsoft Agent.
+
+ 7. Test the agent. If you have forwarded the entire tree, issue an snmpget
+ for sysDescr.0. For example:
+
+ snmpget -v 1 -c public localhost sysDescr.0
+
+ The Microsoft agent will respond in a format similar to:
+
+ Hardware: x86 Family 15 Model 12 Stepping 0 AT/AT COMPATIBLE - Software:
+ Windows 2000 Version 5.0 (Build 2195 Uniprocessor Free)
+
+ The Net-SNMP agent would normally respond in a format similar to:
+
+ Windows host1 5.0.2195 Service Pack 4 2000 Server x86 Family 15 Model 12
+ Stepping 0
+
+If you had previously configured the Microsoft agent with multiple community
+strings to restrict who can read and write to the OID tree, the security
+settings should be transferred to snmpd.conf. For example, if the Microsoft
+agent was configured with:
+
+ Community Rights
+ ---------------------------------
+ public read
+ S3cur39876 read/write
+ Sn0wb0ard345 read/create
+
+Add the following to snmpd.conf:
+
+ rocommunity public
+ rwcommunity S3cur39876
+ rwcommunity Sn0wb0ard345
+
+It is possible to add more granular security using Net-SNMP. For example, to
+restrict the public community string to only read the system tree, use:
+
+ rocommunity public 0.0.0.0 system
+
+See the snmpd.conf man page for more information on configuring security.
+
+
+***************************************************************************
+*
+* Installing Platform SDK
+*
+***************************************************************************
+
+If you are using Microsoft Visual Studio 6.0, you will have to install the
+Platform SDK (PSDK) first.
+
+Once the PSDK has been installed, select the following action from the Start
+Menu: Programs / Microsoft Windows SDK / Visual Studio Registration / Windows
+SDK Configuration Tool.
+
+If you are using any of the following environments, the PSDK download is not
+necessary as the required parts of the PSDK are included:
+ - Microsoft Visual Studio 2002 or later.
+ - Cygwin.
+ - MinGW.
+
+In order for the process part of the host resources MIB to work under Windows
+NT you will need to obtain PSAPI.DLL. This is available under the download
+section of www.microsoft.com. The DLL is included with Windows 2000 and XP,
+and is also part of the VC++ distribution.
+
+If you are building Net-SNMP using Cygwin, go now to "Cygwin - Building".
+If you are building Net-SNMP using MinGW, go now to "MinGW - Building".
+Otherwise, see the Building section below.
+
+
+***************************************************************************
+*
+* Microsoft Visual C++ - Overview
+*
+***************************************************************************
+
+There are two ways to build Net-SNMP using Microsoft Visual C++. The first
+and easiest method is using Configure and nmake on the command line, and the
+second is using the Workspace files inside the interactive development
+environment.
+
+To use nmake on the command line, the Configure script is run first to create
+the various makefiles. Once these have been created, nmake is used to build
+the applications. Perl is required to use this method, as the Configure
+script is written in Perl. ActiveState ActivePerl is available at:
+
+ http://www.activestate.com/Products/ActivePerl/
+
+The make file system is based on and uses the directory structure of the
+projects contained in the Workspace files which are described below. It is
+recommended that you read and understand how the workspaces are configured
+even if you will only be using the command line Configure / nmake system.
+
+For building via the interactive development environment, there are the Win32
+workspaces win32.dsw and libdll.dsw. The last workspace allows to build a DLL
+version of snmplib (netsnmp.dll).
+
+There is one core development library ('libsnmp'), together with a number
+of utility projects for the individual executable commands ('snmpget',
+'snmpwalk', etc...). All of these projects require the .lib created by
+the libsnmp project.
+
+The agent requires the core library plus the other two library projects
+('libagent' and 'netsnmpmibs') together with the main agent project ('snmpd').
+
+The final application project is the trap handler 'snmptrapd'. This also
+requires the agent libraries ('libagent' and 'netsnmpmibs') as well as the
+core development library.
+
+There is a Debug version and Release version for each subproject. This is so
+the Debug and Release versions of an application can be built and tested
+separately.
+
+VC++ 6.0, 7.1, 8.0 (2005), 9.0 (2008) and 10.0 (2010) have been tested.
+Building with earlier Microsoft compiler versions is no longer supported.
+
+Note: if you want to distribute the generated executable, you will also need
+to distribute the Microsoft Visual Studio Redistributable Package. Check the
+EULA included with that package before redistributing it.
+
+OpenSSL is required to support the encryption capabilities in SNMPv3,
+or SHA authentication.
+
+Since the MSVC build environment does not natively use "configure" nor "make"
+to generate the various pathnames that the programs require, the header files
+need to be manually modified when using the IDE, and an install script is
+provided. When using the Perl Configure / nmake system, the header files are
+automatically modified and require no manual editing.
+
+The projects are arranged so that ALL of the usable products, the .exe files,
+are written to the win32\bin directory. The win32\lib directory is used only
+to build the the files in the win32\bin directory. Once building is
+completed, there is no further use for the files in the win32\lib directory.
+
+Debug Information
+-----------------
+
+Note that VC++ 6.0 has options for debugging information - the 'Program
+Database'. This option is set in the Project settings, C/C++ tab, 'General'
+category, and is turned on by default during the conversion of the project
+files. This option is not for use with a library, as it embeds debug
+information into the library that references an external file that will
+not be available to the linking application. If you get an error message
+along the lines of 'debugging information not available in file vc60.pdb,
+make sure the library debug option is set to 'Program Database' or "/Zi".
+
+
+***************************************************************************
+*
+* Microsoft Visual C++ - Configure / nmake - Building
+*
+***************************************************************************
+
+There are two ways to build Net-SNMP using the Configure / nmake system.
+The first and easiest method is by running the win32\build.bat script. The
+second is manually running Configure and nmake.
+
+Note: Perl is required to use this method as the Configure script is
+ written in Perl. ActiveState ActivePerl is available at:
+
+ http://www.activestate.com/Products/ActivePerl/
+
+
+Win32\build.bat script
+======================
+
+The build.bat script is an easy menu driven system that allows you to select
+how Net-SNMP should be built, and where it should be installed. Follow these
+steps to build using build.bat:
+
+1. Open a command prompt
+
+2. When building with OpenSSL, set the environment variables INCLUDE and LIB
+ such that these point at the proper OpenSSL directories. An example:
+
+ set INCLUDE=C:\OpenSSL-Win32\include
+ set LIB=C:\OpenSSL-Win32\lib\VC\static
+
+3. Initialize the Visual Studio build environment by running vcvarsall.bat
+ which can be found in the bin folder of your Visual Studio install folder.
+ If you want to generate 64-bit binaries instead of 32-bit binaries, run
+ vcvarsall.bat with the amd64 argument. See also "How to: Enable a 64-Bit
+ Visual C++ Toolset at the Command Line" for more information
+ (http://msdn.microsoft.com/en-us/library/x4d2c09s%28v=vs.80%29.aspx).
+
+4. Run win32\build.bat
+
+5. The following screen will appear:
+
+ Net-SNMP build and install options
+ ==================================
+
+ 1. OpenSSL support: disabled
+ 2. Platform SDK support: disabled
+
+ 3. Install path: c:/usr
+ 4. Install after build: enabled
+
+ 5. Perl modules: disabled
+ 6. Install perl modules: disabled
+
+ 7. Quiet build (logged): enabled
+ 8. Debug mode: disabled
+
+ 9. IPv6 transports (requires SDK): disabled
+ 10. winExtDLL agent (requires SDK): disabled
+
+ 11. Link type: static
+
+ 12. Install development files disabled
+
+ F. Finished - start build
+ Q. Quit - abort build
+
+ Select option to set / toggle:
+
+6. Toggle the options on and off as desired by typing the line number
+ followed by <enter>.
+
+ To compile with OpenSSL, the OpenSSL library and header files must
+ already be installed. See the section 'Microsoft Visual C++ - Building
+ with OpenSSL' for details.
+
+ To compile with the Platform SDK, the Platform SDK must already be
+ installed. See the section 'Installing Platform SDK' for details.
+
+ To use the IPv6 transports, Windows 98 or later is required.
+
+ See the section 'Running Net-SNMP as a replacement for the Microsoft
+ SNMP service' for important information on using the winExtDLL agent.
+
+ If Quiet mode is enabled, all build activity is stored in various *.out
+ files inside of the win32 folder.
+
+ When you are ready to build, type f <enter>
+
+7. Building will begin. Following is a sample screen shot of a quiet build:
+
+ Building...
+
+ Deleting old log files...
+ Running Configure...
+ Cleaning...
+ Building main package...
+ Installing main package...
+ Running Configure for DLL...
+ Cleaning libraries...
+ Building DLL libraries...
+ Installing DLL libraries...
+ Cleaning Perl....
+ Building Perl modules...
+ Testing Perl modules...
+ Installing Perl modules...
+
+ See perlmake.out for Perl test results
+
+ Done!
+
+8. If the folder that Net-SNMP was installed to is ever changed, modify the
+ system environment variables or registry keys as explained in the
+ 'Configuration_Overview.html' file located in win32/dist/htmlhelp.
+
+
+Manual build using Configure / nmake
+====================================
+
+To build using nmake on the command line, the make files need to be generated
+first by the Configure script. Following are sample steps to:
+
+ -enable Platform SDK support
+ -enable OpenSSL support
+ -enable debug mode
+ -build Net-SNMP
+ -install to 'c:\usr'
+ -compile the Perl modules
+ -test the Perl modules
+ -install the Perl modules
+
+1. Open a command prompt
+
+2. Initialize the Visual Studio build environment by running VCVARS32.bat
+ which can be found in the bin folder of your Visual Studio install folder.
+
+3. Type (all on one line):
+
+ perl Configure --with-sdk --with-ssl --config=debug
+ --prefix="c:/usr"
+
+4. The make files will be generated, and a configuration summary will appear:
+
+ ---------------------------------------------------------
+ Net-SNMP configuration summary:
+ ---------------------------------------------------------
+
+ Config type: debug
+ SDK: enabled
+ Link type: static
+ Prefix / Destdir: c:/usr
+ OpenSSL: enabled
+
+5. Type:
+
+ nmake clean
+ nmake
+ nmake install
+
+ perl Configure --with-sdk --with-ssl --config=debug --linktype=dynamic
+ --prefix="c:/usr"
+
+ nmake libs_clean
+ nmake libs
+ nmake install
+
+ nmake perl_clean
+ nmake perl
+ nmake perl_test
+ nmake perl_install
+
+For a complete list of Configure options, run:
+
+ perl Configure --help
+
+For a complete list of possible build targets, after generating the make files
+using Configure, run:
+
+ nmake help
+
+Note: The Configure option --linktype=static (or not specifying a linktype)
+ will result in libsnmp being compiled and all other components being
+ statically linked to it.
+
+ The Configure option --linktype=dynamic will result in libsnmp_dll
+ (netsnmp.dll) being compiled and all other components being dynamically
+ linked to it.
+
+
+***************************************************************************
+*
+* Microsoft Visual C++ - Workspace - Building
+*
+***************************************************************************
+
+The win32.dsw and win32dll.dsw workspaces allow to build the agent and the
+applications. Proceed as follows:
+
+1. Update the version stamp in win32\net-snmp\net-snmp-config.h. The current
+ version can be found in the Unix configure script (top level folder) by
+ looking for the PACKAGE_VERSION variable.
+
+2. If SNMPv3 encryption capabilities or SHA authentication is required,
+ install the OpenSSL DLL and library file as described in the section
+ 'Microsoft Visual C++ - Building with OpenSSL" and then continue with
+ step 2.
+
+3. The default installation path is c:\usr. This folder will contain all
+ the binaries, MIB files, configuration files etc. To change the location,
+ the win32\net-snmp\net-snmp-config.h file needs to be modified by changing
+ the INSTALL_BASE variable.
+
+ Note:
+
+ All paths in net-snmp-config.h use the "/" UNIX pathname delimiter.
+ If a drive letter is not specified, the current drive letter is assumed.
+
+ For example: #define INSTALL_BASE "c:/usr".
+
+4. When building DLLs instead of static libraries, *change* the following
+ line which is located near the top of the file:
+
+ /* #undef NETSNMP_USE_DLL */
+
+ *to*
+
+ #define NETSNMP_USE_DLL 1
+
+5. Build the agent and the applications
+
+ a. Open win32.dsw (static build) or win32dll.dsw (dynamic build).
+ b. If you want to generate 64-bit binaries instead of 32-bit binaries,
+ select "Build/Configuration Manager" and add the "x64" platform.
+ c. Select "Build/Batch Build..."
+ d. Select the projects and configurations you want to build.
+ e. Click "ReBuild All".
+ f. When building is done, View the Output window, clip and
+ save to a text file if there is some information to share.
+
+6. If the Perl modules are required, continue with the next section:
+ 'Microsoft Visual C++ - Building the Perl SNMP modules'.
+
+ Otherwise, continue with the section:
+ 'Microsoft Visual C++ - Installing'
+
+
+***************************************************************************
+*
+* Microsoft Visual C++ - Workspace - Building the Perl SNMP modules
+*
+***************************************************************************
+
+The Perl modules should be compiled against the DLL version of snmplib.
+Compiling against a static version is possible, but each module will
+load it's own copy of the MIB, and sharing data between modules will
+not be possible. For example, the conf module tests will fail.
+
+1. Complete the section 'Microsoft Visual C++ - Building' and choose for
+ the dynamic build. This will build the libraries, agent and applications.
+
+ Note: SNMPD.EXE and SNMPTRAPD.EXE are required for running the tests
+ against the SNMP Perl module.
+
+2. Install Net-SNMP as described in the 'Microsoft Visual C++ - Installing'
+ section to install the applications, the DLL and the .lib files.
+
+3. Continue with the Win32 section of the Perl README file located in
+ perl\SNMP\README.
+
+
+***************************************************************************
+*
+* Microsoft Visual C++ - Workspace - Installing
+*
+***************************************************************************
+
+The install script "win32\install-net-snmp.bat" should be run after a
+build is successful. It copies the programs, MIB files, and development
+components to an install directory named in the INSTALL_BASE variable.
+
+1. Complete the section 'Microsoft Visual C++ - Building'.
+
+2. Open win32\install-net-snmp.bat using a text editor.
+
+ The INSTALL_BASE variable must match the INSTALL_BASE compile constant
+ defined in "win32\net-snmp\net-snmp-config.h", using these rules:
+
+ a. All paths in install-net-snmp.bat use the "\" DOS pathname delimiter.
+
+ Example: set INSTALL_BASE="c:\usr".
+
+ b. All paths in net-snmp-config.h use the "/" UNIX pathname delimiter.
+ If a drive letter is not specified, the current drive letter is
+ assumed.
+
+ Example: #define INSTALL_BASE "c:/usr".
+
+ Note: You may also modify "install-net-snmp.bat" in order to not install
+ the linking libraries, or the header files.
+
+3. Open a command prompt window.
+
+4. Cd to the base directory where this file README.win32 is located.
+
+5. Run win32\install-net-snmp.bat to install the programs.
+
+ ## sample output from install-net-snmp.bat
+
+ NOTE: Directory already exist messages are normal. If you are
+ not building with OpenSSL, then DLL not found messages
+ are normal.
+
+ C:\net-snmp-5.1.1> win32\install-net-snmp
+ Remember to run this script from the base of the source directory.
+ Creating "c:\usr" sub-directories
+ A subdirectory or file c:\usr already exists.
+ A subdirectory or file c:\usr\bin already exists.
+ A subdirectory or file c:\usr\etc\snmp already exists.
+ A subdirectory or file c:\usr\share\snmp\snmpconf-data
+ already exists
+ A subdirectory or file c:\usr\share\snmp\snmpconf-data\
+ snmp-data already exists.
+ A subdirectory or file c:\usr\share\snmp\snmpconf-data\
+ snmpd-data already exists.
+ A subdirectory or file c:\usr\share\snmp\snmpconf-data\
+ snmptrapd-data already exists.
+ A subdirectory or file c:\usr\lib already exists.
+ A subdirectory or file c:\usr\mibs already exists.
+ A subdirectory or file c:\usr\include already exists.
+ A subdirectory or file c:\usr\include\net-snmp already
+ exists
+ .
+ A subdirectory or file c:\usr\include\ucd-snmp already
+ exists
+ .
+ Copying MIB files to "c:\usr"\mibs
+ Copying compiled programs to "c:\usr"\bin
+ Copying snmpconf files to "c:\usr"\share\snmp\snmpconf-
+ data\snmp-data
+ Copying link libraries to "c:\usr"\lib
+ Copying header files to "c:\usr"\include
+ Deleting debugging files from "c:\usr"
+ Copying DLL files to "c:\usr"
+ The system cannot find the file specified.
+ Done copying files to "c:\usr"
+ C:\net-snmp-5.1.1>
+
+ ## END sample output from install-net-snmp.bat
+
+6. Add the bin folder (c:\usr\bin in the above example) to
+ your system path.
+
+7. Test the installation. For a simple test to see if Net-SNMP is working,
+ open a _new_ command prompt window, and type:
+
+ snmptranslate -IR -Td linkDown
+
+8. If the folder that Net-SNMP was installed to is ever changed, modify the
+ system environment variables or registry keys as explained in the
+ 'Configuration_Overview.html' file located in win32/dist/htmlhelp.
+
+
+***************************************************************************
+*
+* Microsoft Visual C++ - Building with OpenSSL
+*
+***************************************************************************
+
+OpenSSL is required to support the encryption capabilities in SNMPv3
+(or SHA authentication). The win32 version of OpenSSL can be built
+from the sources or you can download a pre-compiled version.
+
+Building from source:
+=====================
+
+ 1. Install an assembler. If you do not have the M$ assembler installed (MASM)
+ you can get a free one(NASM) from:
+
+ http://www.kernel.org/pub/software/devel/nasm
+
+
+ 2. Obtain the OpenSSL source from the link below. Follow instructions in
+ INSTALL.W32
+
+ ftp://ftp.openssl.org/source/
+
+
+ 3. Once the OpenSSL libraries are built, copy the folder inc32\openssl to
+ C:\OpenSSL\Include\openssl and the folder out32dll to C:\OpenSSL\Lib\VC.
+
+
+Using a pre-compiled version
+============================
+
+ 1. Obtain the latest OpenSSL binary from the link below.
+
+ http://www.slproweb.com/products/Win32OpenSSL.html
+
+ 2. Install the package to c:\OpenSSL.
+
+
+Project changes
+===============
+
+ 1. Edit the win32\net-snmp\net-snmp-config.h header file. Add:
+
+ #define NETSNMP_USE_OPENSSL 1
+
+ 2. Open Visual Studio, open the Tools menu and select Options. Go to
+ Projects and Solutions and select VC++ Directories. Add
+ C:\OpenSSL\Include to the list of include directories and
+ C:\OpenSSL\Lib\VC to the list of library directories.
+
+ 3. Continue with the section 'Microsoft Visual C++ - Building"
+
+
+***************************************************************************
+*
+* Microsoft Visual C++ - Building with IPv6
+*
+***************************************************************************
+
+The default build configuration supports SNMP over IPv4-based transports.
+However Windows 2000 and later include an IPv6-capable stack which
+can be used to provide SNMP over IPv6. To enable IPv6, the Microsoft PSDK
+is required and NETSNMP_ENABLE_IPV6 has to be enabled in
+win32\net-snmp\net-snmp-config.h. Change the following single line from:
+
+ /* #undef NETSNMP_ENABLE_IPV6 */
+
+ to:
+
+ #define NETSNMP_ENABLE_IPV6 1
+
+Next, continue with the section 'Microsoft Visual C++ - Building"
+
+
+***************************************************************************
+*
+* Microsoft Visual C++ - Building your own applications with snmplib
+*
+***************************************************************************
+
+Linking in an snmplib built to use the Multithreaded DLL runtime library to
+an application configured for the Debug Multithreaded DLL runtime library
+results in a link error along the lines of 'defaultlib "MSVCRT" conflicts
+with use of other libs'. If you receive a similar message, check that the
+projects settings between library and application match up.
+
+To successfully build your existing project with Net-SNMP libraries,
+change the project settings FOR YOUR APPLICATION ONLY as follows:
+
+ 1. In the Link section, Select "Additional Libraries".
+ Add netsnmp.lib for Release version.
+ Add netsnmp_d.lib for Debug version.
+
+ 2. Remove all references to these libraries:
+ libsnmp*.lib msvcrt*.lib libc*.lib oldnames.lib
+
+ 3. In the C++ section, Select "Code Generation".
+ For Release, select /MD or "MultiThreaded DLL".
+ For Debug, select /MDd or "Debug MultiThreaded DLL".
+
+ 4. Make sure "Ignore all default libraries" is NOT SET.
+
+ 5. Make sure "_MBCS" is included in your pre-processor defines.
+
+Note: Some users may have better results compiling other packages that use
+ the installed header files by removing the "mode_t" definition from
+ net-snmp-config.h file in the installed directories.
+
+
+***************************************************************************
+*
+* Microsoft Visual C++ - Extending the Agent
+*
+***************************************************************************
+
+Assuming that the MIB compiler generated the my.h and my.c files for the
+custom MIB "my", the following changes are required to extend the agent
+using VC++:
+
+ - Add the my.h and my.c files to your 'netsnmpmibs' project in VC++.
+ - Next edit the '<sourcedir>\win32\mib_module_includes.h' file to
+ add an include to your .h file.
+
+ #include "mibgroup/my.h"
+
+ - Next edit the '<sourcedir>\win32\mib_module_inits.h' file to add
+ code to call your initialize function.
+
+ if (should_init("my")) init_my();
+
+That's all that is needed. Now go ahead and compile the 'netsnmpmibs'
+and 'snmpd' project. And things should work just fine.
+
+
+***************************************************************************
+*
+* GCC on Windows
+*
+***************************************************************************
+
+There are two versions of GCC (the GNU Compiler Collection) in common use on
+Microsoft Windows operating systems. This section will attempt to point the
+user to the information required to choose the one to best suit their needs.
+
+Cygwin
+
+The Cygwin compiler and toolkit provides a Unix style shell and environment
+for Windows based systems. The cygwin1.dll provides a POSIX emulation layer
+that simplifies porting Unix / Linux applications to Windows. The Cygwin dlls
+are required if an application is to be distributed. The dependency on the
+Cygwin dlls can be eliminated with the --mno-cygwin compiler flag, which uses
+MinGW to compile a native Windows binary, but the benefit of the POSIX emulation
+is lost. The Cygwin tool chain and documentation can be found at:
+
+http://sources.redhat.com/cygwin/
+
+
+MinGW
+
+The MinGW compiler is a Windows native version of gcc. The tool chain links
+against existing Windows dlls found on most systems. Binaries compiled with MinGW
+do not require additional libraries to be distributed. The MSyS environment
+provides a shell (Bash) and tools to emulate a Unix style build environment on
+Windows. The MinGW and MSyS tools and documentation can be found at:
+
+http://www.mingw.org
+
+
+***************************************************************************
+*
+* Cygwin - Building
+*
+***************************************************************************
+
+An alternate way to build and run Net-SNMP on Win32 is to use the Cygwin
+environment. Detailed information about the Cygwin environment is available
+on the web at: http://sources.redhat.com/cygwin/.
+
+Cygwin allows you to compile almost the complete agent and applications.
+As an example, the following configure options create a working set of
+programs:
+
+./configure \
+ --with-mib-modules="host agentx disman/event-mib examples/example" \
+ --with-out-mib-modules=host/hr_network \
+
+If you want to disable SNMPv3 auth and privacy features, add:
+ --without-openssl \
+
+If you want to use IPv6 transports, add:
+ --enable-ipv6
+
+Note: the source code should *not* be in a folder that contains a space.
+For example, compiling in your 'My Documents' folder or your Desktop folder
+(usually c:\Documents and Settings\xxxx\Desktop) is not supported.
+
+A note for Windows NT users: in order for the process part of the host
+resources MIB (hr_swrun) to work under Windows NT you will need to get hold
+of PSAPI.DLL. This DLL is available under the download section of
+www.microsoft.com, and is also included in the VC++ distribution.
+
+If the folder that Net-SNMP was installed to is ever changed, modify the
+system environment variables or registry keys as explained in the
+'Configuration_Overview.html' file located in win32/dist/htmlhelp.
+
+
+***************************************************************************
+*
+* MinGW - Building
+*
+***************************************************************************
+
+Currently the tools and agent will compile on win32 platforms using the
+MinGW tools with the MSyS environment. MinGW, MSyS and the associated
+documentation can be downloaded from: http://www.mingw.org.
+
+Compiling net-snmp with MinGW requires GNU regex and libintl. Binaries and
+developer header files for these libraries are available at:
+
+ http://gnuwin32.sourceforge.net/packages/regex.htm
+ http://gnuwin32.sourceforge.net/packages/libintl.htm
+
+Proceed as follows to build Net-SNMP:
+
+1. Install GNU regex and GNU libintl binaries and developer files in the
+ MinGW tree.
+
+2. If SNMPv3 encryption capabilities or SHA authentication is required,
+ install the OpenSSL DLL and library file as described in the section
+ 'MinGW - Building with OpenSSL" and then continue with step 3.
+
+3. Determine where you want the programs to be installed. Currently
+ you must use path segments no longer than 8 characters, and no
+ embedded spaces are allowed. Due to limitations with Makefiles,
+ you must also specify the MIBDIRS default that corresponds to
+ a particular subtree from the base directory.
+
+ Note: All paths use the "/" UNIX pathname delimiter.
+ Also note that embedded spaces will NOT currently work
+ with MinGW configure. Use the DOS 8.3 form of the path,
+
+ For example: Say that you want to install the programs in
+ the directory "C:\usr".
+
+ Use BASEDIR=c:/usr
+
+4. Configure net-snmp using the configure flags as shown:
+
+ BASEDIR=c:/usr
+
+ ./configure --prefix="$BASEDIR" \
+ --with-mibdirs="$BASEDIR/share/snmp/mibs" \
+ --with-mib-modules="agentx disman/event-mib winExtDLL examples/example"\
+ --disable-embedded-perl --without-perl-modules \
+
+ Note: while the Net-SNMP implementation of the host resources MIB is not
+ supported when using MinGW, winExtDLL is supported. Via winExtDLL you can
+ use Microsoft's implementation of the host resources MIB.
+
+4.1. If you want to use IPv6 transports, add:
+ --enable-ipv6 --with-transports="TCPIPv6 UDPIPv6" \
+
+
+5. Type "make" to compile the package.
+
+6. Type "make install" to install the package.
+
+7. If the folder that Net-SNMP was installed to is ever changed, modify the
+ system environment variables or registry keys as explained in the
+ 'Configuration_Overview.html' file located in win32/dist/htmlhelp.
+
+
+***************************************************************************
+*
+* MinGW - Building with OpenSSL
+*
+***************************************************************************
+
+OpenSSL is required to support the encryption capabilities in SNMPv3
+(or SHA authentication). A pre-compiled MinGW compatible version of
+OpenSSL is available on the Internet.
+
+Follow these steps to install OpenSSL:
+
+ 1. Obtain the latest OpenSSL binary from the link below.
+
+ http://www.slproweb.com/products/Win32OpenSSL.html
+
+ 2. Install the package to c:\OpenSSL
+
+ 3. Copy the header and library files to the the MinGW directory:
+
+ a. Copy the c:\OpenSSL\include\openssl folder to the include folder in
+ MinGW.
+
+ Example: "C:\MinGW\include\openssl\*.h"
+
+ b. Copy c:\OpenSSL\lib\MinGW\libeay32.* to the lib folder in Mingw.
+
+ Example: "C:\MinGW\lib\libeay32.a"
+ Example: "C:\MinGW\lib\libeay32.def"
+
+ 4. Continue with the section 'MinGW - Building"
+
+
+***************************************************************************
+*
+* Configuring Net-SNMP
+*
+***************************************************************************
+
+Online documentation is available from the Net-SNMP home page at:
+
+http://www.net-snmp.org/docs/
+
+All configuration files should be placed in the INSTALL_BASE\etc\snmp folder.
+The INSTALL_BASE folder is defined in the win32\net-snmp\net-snmp-config.h
+file. For example, c:\usr\etc\snmp.
+
+Included is a Perl script called snmpconf which can be used to create
+configuration files. Full documentation on using snmpconf is available from the
+Net-SNMP web site at the above link.
+
+To run snmpconf, first modify snmpconf.bat located in the bin folder where
+Net-SNMP is installed. Modify the set MYPERLPROGRAM= line to contain the full
+path to the snmpconf Perl script. For example:
+
+ set MYPERLPROGRAM=c:\usr\bin\snmpconf
+
+You can now run snmpconf using the standard command line such as:
+
+ snmpconf -i
+
+For detailed information on using environment variables and the registry to
+configure Net-SNMP, see the 'Configuration_Overview.html' file in
+win32/dist/htmlhelp.
+
+
+***************************************************************************
+*
+* How to Register the Net-SNMP Agent and Trap Daemon as Windows services
+*
+***************************************************************************
+
+The Agent (snmpd.exe) and trap daemon (snmptrapd.exe) can be run as a service
+under Windows operating systems that have the Service Control Manager (SCM)
+(Services Control Panel). This includes Windows NT, 2000, XP and 2003.
+Windows 9x/Me do not have the SCM.
+
+To allow snmpd.exe or snmptrapd.exe to run as a service, the programs need
+to be registered with the SCM. This is done by running the program once with
+the -register command line switch from a command prompt.
+
+If Net-SNMP was installed using the binary available from the Net-SNMP web site,
+there will be shortcuts in the Start menu for registering and unregistering the
+agent and snmptrapd.
+
+The synopsis for registering snmpd as a Windows service is:
+
+ snmpd -register [OPTIONS] [LISTENING ADDRESSES]
+
+The synopsis for registering snmptrapd as a Windows service is:
+
+ snmptrapd -register [OPTIONS] [LISTENING ADDRESSES]
+
+After registration, the services 'Net-SNMP Agent' and 'Net-SNMP Trap Handler'
+will be available in the SCM. The services can be started and stopped using
+the SCM (Services Control Panel) or from the command prompt using:
+
+ net start "Net-SNMP Agent"
+ net start "Net-SNMP Trap Handler"
+
+and
+
+ net stop "Net-SNMP Agent"
+ net stop "Net-SNMP Trap Handler"
+
+If any command line options are specified after the -register option, they
+will be included when the service starts. For example, to register the
+snmptrapd daemon and enable logging of traps to c:\usr\log\snmptrapd.log,
+enter the following command line:
+
+ snmptrapd -register -Lf c:/usr/log/snmptrapd.log
+
+Note: Use Unix style slashes (/) for all paths.
+
+For a complete list of command line options, consult the man pages, or use
+the -h switch:
+
+ snmpd -h
+ snmptrapd -h
+
+Notes: -H will display all available snmpd.conf, snmptrapd.conf and snmp.conf
+ configuration file options, not the command line options.
+
+ Like all Net-SNMP applications, snmpd and snmptrapd will use the
+ SNMPCONFPATH and SNMPSHAREPATH environment variables when run as a
+ service. The registry is the recommended method for defining these
+ variables due to a limitation in the Windows Service Control Manager
+ (SCM). When running as a service, if any system environment variables
+ are changed, the system will need to be rebooted to allow the services
+ to access the changed environment variables (see Microsoft knowledge
+ base article 821761). Therefore, when running snmpd or snmptrapd as
+ a service, if SNMPCONFPATH or SNMPSHAREPATH is changed, a reboot will
+ be required after setting the environment variables, otherwise the
+ services may fail to start. Using the registry to store the environment
+ variables eliminates this problem. See the 'Configuration_Overview.html'
+ file in win32/dist/htmlhelp for more information on using the registry.
+
+
+Unregistering the services
+--------------------------
+
+To un-register the services, use the command line switch -unregister. For
+example:
+
+ snmpd -unregister
+
+ snmptrapd -unregister
+
+Note: Be sure to have all Service Control Panel windows closed when
+ unregistering, otherwise a reboot may be required to complete
+ the removal.
+
+
+Modifying the services
+----------------------
+
+To change the parameters that the SCM passes to snmpd or snmptrapd, the
+service must be unregistered, and then re-registered with the new options.
+
+For example, to change the parameters that SCM passes to snmpd, open a
+command prompt window, CD to the directory where the snmpd program is located
+(unless it is already in your PATH), identify the full set of parameters you
+desire, then type these two commands:
+
+ snmpd -unregister
+ snmpd -register [OPTIONS] [LISTENING ADDRESSES]
+
+Note: Be sure to have all Service Control Panel windows closed when
+ unregistering, otherwise a reboot may be required to complete
+ the removal.
+
+
+Registry Information
+--------------------
+
+Warning: Improper use of the registry editor can damage to your operating
+ system and should only be used by experienced users.
+
+The following registry keys are used by snmpd and snmptrapd:
+
+HKLM\SYSTEM\CurrentControlSet\Services\Net-SNMP Agent
+HKLM\SYSTEM\CurrentControlSet\Services\Net-SNMP Trap Handler
+
+Each command line option specified when regsitering the service will be added
+to the Parameters registry subkey for the service as a ParamX REG_SZ value
+where X starts at 1 and increments for each additional command line option.
+For example, '-Lf c:/usr/log/snmptrapd.log' would be:
+
+ HKLM\SYSTEM\CurrentControlSet\Services\
+ Net-SNMP Trap Handler\Parameters\Param1 -Lf
+
+ HKLM\SYSTEM\CurrentControlSet\Services\
+ Net-SNMP Trap Handler\Parameters\Param2 c:/usr/log/snmptrapd.log
+
+To add additional command line switches or modify the existing ones, it is
+recommended to unregister and re-register the services with the new command
+line options. It is also possible to directly add or modify the ParamX values
+in the registry.
+
+Note: The Parameters key is only created when there is at least one command
+ line option specified when registering the service so it may need to be
+ manually added if modifying using the registry editor.
+
+
+***************************************************************************
+*
+* Notes on SET support for WIN32 ports
+*
+***************************************************************************
+
+Requirements:
+
+ Windows NT/2000/XP or later: Requires Windows NT 4.0 SP4 or later.
+ Windows 95/98/Me: Requires Windows 98 or later.
+
+Windows support for SET on following groups:
+
+interfaces:
+----------
+ifAdminStatus is read-write. Status can be set with either 'up' or
+'down'. (IE, 'testing' status is not supported.)
+
+
+ip group:
+--------
+Scalar objects:
+ipForwarding:Currently windows supports only ON->OFF (IE,
+enable->disable). For any other value, it returns with failure.
+
+ipDefaultTTL: Supports value greater than or equal to 0.
+
+Table objects:
+-------------
+1. ipRouteTable:
+ ------------
+route_write.c implements this.
+
+ipRouteDest: Setting this value, updates row with new ipRouteDest and all other
+ entries will be same as old row.
+ EX:
+ Consider there is an entry with ipRouteDest = 10.0.0.20
+ Request, snmpset localhost private ip.ipRouteTable.ipRouteEntry.ipRouteDest.10.0.0.20 -a 10.0.0.16
+ Updates that row with ipRouteDest = 10.0.0.16
+
+ipRouteIfIndex:Write supported.
+
+ipRouteMetric1: Supports value greater than or equal to -1
+
+ipRouteMetric2, ipRouteMetric3, ipRouteMetric4, ipRouteMetric5: Even though
+ call returns with success, Windows doesn't change these (as
+ these are not used in Windows)
+
+ipRouteNextHop: Write supported.
+
+ipRouteType: Write Supported. If value is 2, IE 'invalid', it deletes the entry.
+
+ipRouteAge: Whenever any row is updated this will be automatically reset.
+
+ipRouteMask: Write Supported.
+
+Creation of ipRouteTable row:
+-----------------------------
+snmpset request for non existent OID with ipRouteIfIndex, ipRouteMetric1,
+ipRouteNextHop and ipRouteMask varbinds, creates a row.
+
+snmpset with create option is not supported, as row creation requires
+ipRouteIfIndex, ipRouteMetric1, ipRouteNextHop and ipRouteMask in a single
+request.
+
+Example to create a row:
+-----------------------
+Consider there is no entry for 10.0.0.18
+
+snmpset localhost private ip.ipRouteTable.ipRouteEntry.ipRouteIfIndex.10.0.0.18 i 2 4.21.1.ipRouteMask.10.0.0.18 a 255.255.255.255 4.21.1.ipRouteNextHop.10.0.0.0 a 10.0.0.0 4.21.1.ipRouteMetric1.10.0.0.18 i 1
+
+If ipRouteIfIndex is valid then creates row with:
+ipRouteIfIndex = 2
+ipRouteMask = 255.255.255.255
+ipRouteNextHop = 10.0.0.0
+ipRouteMetric1 = 1
+
+2. ipNetToMediaTable:
+--------------------
+ipNetToMediaIfIndex: write supported
+ipNetToMediaPhysAddress: write supported
+ipNetToMediaNetAddress: write supported
+ipNetToMediaType: write supported, setting with value 2, deletes the row.
+
+Creation of row:
+--------------------
+snmpset request for non existent OID with ipNetToMediaPhysAddress varbind
+creates a row.
+
+snmpset with create option is not supported, as row creation requires
+ipNetToMediaPhysAddress in a request
+request.
+
+Example to create a row:
+-----------------------
+Consider there is no entry for 10.0.0.32
+
+snmpset localhost private ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress.2.10.0.0.32 x efcd12130103
+
+If ipNetToMediaIfIndex is valid then creates row with:
+ipNetToMediaIfIndex = 2
+ipNetToMediaPhysAddress = ef:cd:12:12:01:03
+ipNetToMediaNetAddress = 10.0.0.32
+ipNetToMediaType = 4
+
+TCP:
+---
+tcpConnState of tcpConnTable is writable and the only value which may
+be set by a management station is deleteTCB(12)
+
+
+***************************************************************************
+*
+* Notes on preprocessor defines for MSVC, MinGW and Cygwin
+*
+***************************************************************************
+
+When adding Windows specific code, one or more of the following defines should
+be used:
+
+Define: Description:
+------- ------------
+WIN32 Defined by MSVC & MinGW
+
+_MSC_VER Defined by MSVC only (standard MSVC macro)
+
+mingw32 Defined by MinGW only
+
+cygwin Defined by Cygwin only
+
+HAVE_WIN32_PLATFORM_SDK Should be defined if the Microsoft Platform SDK is
+ installed and registered with MSVC or enabled for
+ MinGW or Cygwin
+
+MinGW and Cygwin do not require the Microsoft Platform SDK as they both should
+contain most if not all of the functionality provided by the SDK. When adding
+code that requires the PSDK under MSVC, the following can usually be used:
+
+ #if defined (HAVE_WIN32_PLATFORM_SDK) || defined (mingw32) || defined (cygwin)
+
+As listed above, Cygwin does NOT define WIN32. When adding generic Windows
+code that will work with MSVC, MinGW and Cygwin, the following should be used:
+
+ #if defined (WIN32) || defined (cygwin)
+
+
+***************************************************************************
+*
+* Acknowledgements
+*
+***************************************************************************
+
+These people are known to have contributed to one or more of
+the Win32 platform ports. If you have, and your name is not here,
+please accept our apologies, and tell us so we can add your name.
+
+David Perkins, Joe Marzot, Wes Hardaker, Niels Baggesen, Dave Shield,
+Robert Story, Suvrit Sra, Mike Slifcak, Latha Prabhu, Nikolai Devereaux,
+Alex Burger, Bernhard Penz, Andy Smith and Bart Van Assche.
+
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..49d913e
--- /dev/null
+++ b/TODO
@@ -0,0 +1,60 @@
+TODO list of possible projects/developments/etc
+===============================================
+
+APIs:
+ Perl (basically OK - may need a review/update)
+ PHP (PHP-shipped API is out of date, needs reworking)
+ Java (see netsnmpj)
+ Tk/Tcl
+ WinSNMP
+ Python (yapsnmp? / snmpy?)
+ #Net
+
+Agent MIBs:
+ Notification Filtering
+ Community MIB
+ Proxy MIB (extended to support proxying of subtrees)
+ RMON/RMON2
+ MIB-2 updates (in hand)
+ IPv6
+ Firewall (inc. connection tracking)
+ DisMan:
+ monitor (done?)
+ RemOps (preliminary implementation)
+ Tunnel
+ WWW-MIB
+ Hardware Abstraction Layer:
+ HostRes (convert to use HAL and clean up - in progress)
+ UCDavis (convert to use HAL and update structures - in progress)
+
+Extensibility:
+ AgentX (reasonably stable now)
+ SMUX (?obsolete?)
+ embedded Perl (done? in hand?)
+ " Python
+ DisMan script MIB
+ Extend scripts (new, so will need to bed down)
+ Pass scripts (support SNMPv2 exceptions/errors)
+ DLMod (OK, but MIB i/f not robust)
+
+Library:
+ Threading
+ Debugging (heirarchical)
+ Config (split syntax & processing, persist/read-only/etc)
+ SecModels:
+ Kerberos (?done)
+ SBSM (?in hand)
+ Pre-compiled MIBs
+
+Traps:
+ Separate thread in agen
+ Pluggable modules (?done)
+ Dynamic loading
+ Persistent connection
+ Threaded handler
+
+Documentation:
+ Tutorials
+ Extending the agent
+ Agent internals
+
diff --git a/acconfig.h b/acconfig.h
new file mode 100644
index 0000000..d7a829b
--- /dev/null
+++ b/acconfig.h
@@ -0,0 +1,831 @@
+/*
+ * net-snmp configuration header file
+ *
+ * NOTE: DO NOT EDIT include/net-snmp/net-snmp-config.h.in as your changes
+ * will be overwritten. This content is in acconfig.h and merged
+ * into include/net-snmp/net-snmp-config.h.in by autoheader.
+ */
+/* 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.
+ */
+
+#ifndef NET_SNMP_CONFIG_H
+#define NET_SNMP_CONFIG_H
+
+
+/* ********* NETSNMP_MARK_BEGIN_AUTOCONF_DEFINITIONS ********* */
+/*
+ * put all autoconf-specific definitions below here
+ *
+ */
+#ifndef NETSNMP_NO_AUTOCONF_DEFINITIONS
+
+
+#if defined (WIN32) || defined (mingw32) || defined (cygwin)
+#define ENV_SEPARATOR ";"
+#define ENV_SEPARATOR_CHAR ';'
+#else
+#define ENV_SEPARATOR ":"
+#define ENV_SEPARATOR_CHAR ':'
+#endif
+
+/* definitions added by configure on-the-fly */
+@TOP@
+@BOTTOM@
+
+/* end of definitions added by configure on-the-fly */
+
+/* If you have openssl 0.9.7 or above, you likely have AES support. */
+#undef NETSNMP_USE_OPENSSL
+#if (defined(NETSNMP_USE_OPENSSL) && defined(HAVE_OPENSSL_AES_H) && defined(HAVE_AES_CFB128_ENCRYPT)) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+#define HAVE_AES 1
+#endif
+
+/* define random functions */
+
+#ifndef HAVE_RANDOM
+#ifdef HAVE_LRAND48
+#define random lrand48
+#define srandom(s) srand48(s)
+#else
+#ifdef HAVE_RAND
+#define random rand
+#define srandom(s) srand(s)
+#endif
+#endif
+#endif
+
+/* define signal if DNE */
+
+#ifndef HAVE_SIGNAL
+#ifdef HAVE_SIGSET
+#define signal(a,b) sigset(a,b)
+#endif
+#endif
+
+#ifdef HAVE_DMALLOC_H
+#define DMALLOC_FUNC_CHECK
+#endif
+
+#endif /* NETSNMP_NO_AUTOCONF_DEFINITIONS */
+
+
+
+
+/* ********* NETSNMP_MARK_BEGIN_CLEAN_NAMESPACE ********* */
+/*
+ * put all new net-snmp-specific definitions here
+ *
+ * all definitions MUST have a NETSNMP_ prefix
+ *
+ */
+
+/* Default (SNMP) version number for the tools to use */
+#define NETSNMP_DEFAULT_SNMP_VERSION 3
+
+/* don't change these values! */
+#define NETSNMP_SNMPV1 0xAAAA /* readable by anyone */
+#define NETSNMP_SNMPV2ANY 0xA000 /* V2 Any type (includes NoAuth) */
+#define NETSNMP_SNMPV2AUTH 0x8000 /* V2 Authenticated requests only */
+
+/* default list of mibs to load */
+#define NETSNMP_DEFAULT_MIBS "IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB"
+
+/* debugging stuff */
+/* if defined, we optimize the code to exclude all debugging calls. */
+#undef NETSNMP_NO_DEBUGGING
+/* ignore the -D flag and always print debugging information */
+#define NETSNMP_ALWAYS_DEBUG 0
+
+/* reverse encoding BER packets is both faster and more efficient in space. */
+#define NETSNMP_USE_REVERSE_ASNENCODING 1
+#define NETSNMP_DEFAULT_ASNENCODING_DIRECTION 1 /* 1 = reverse, 0 = forwards */
+
+/* PERSISTENT_DIRECTORY: If defined, the library is capabile of saving
+ persisant information to this directory in the form of configuration
+ lines: PERSISTENT_DIRECTORY/NAME.persistent.conf */
+#define NETSNMP_PERSISTENT_DIRECTORY "/var/snmp"
+
+/* AGENT_DIRECTORY_MODE: the mode the agents should use to create
+ directories with. Since the data stored here is probably sensitive, it
+ probably should be read-only by root/administrator. */
+#define NETSNMP_AGENT_DIRECTORY_MODE 0700
+
+/* MAX_PERSISTENT_BACKUPS:
+ * The maximum number of persistent backups the library will try to
+ * read from the persistent cache directory. If an application fails to
+ * close down successfully more than this number of times, data will be lost.
+ */
+#define NETSNMP_MAX_PERSISTENT_BACKUPS 10
+
+/* define the system type include file here */
+#define NETSNMP_SYSTEM_INCLUDE_FILE <net-snmp/system/generic.h>
+
+/* define the machine (cpu) type include file here */
+#define NETSNMP_MACHINE_INCLUDE_FILE <net-snmp/machine/generic.h>
+
+/* define the UDP buffer defaults undefined means use the OS buffers
+ * by default */
+#undef NETSNMP_DEFAULT_SERVER_SEND_BUF
+#undef NETSNMP_DEFAULT_SERVER_RECV_BUF
+#undef NETSNMP_DEFAULT_CLIENT_SEND_BUF
+#undef NETSNMP_DEFAULT_CLIENT_RECV_BUF
+
+/* net-snmp's major path names */
+#undef SNMPLIBPATH
+#undef SNMPSHAREPATH
+#undef SNMPCONFPATH
+#undef SNMPDLMODPATH
+
+/* NETSNMP_LOGFILE: If defined it closes stdout/err/in and opens this in
+ out/err's place. (stdin is closed so that sh scripts won't wait for it) */
+#undef NETSNMP_LOGFILE
+
+/* default system contact */
+#undef NETSNMP_SYS_CONTACT
+
+/* system location */
+#undef NETSNMP_SYS_LOC
+
+/* Use libwrap to handle allow/deny hosts? */
+#undef NETSNMP_USE_LIBWRAP
+
+/* Mib-2 tree Info */
+/* These are the system information variables. */
+
+#define NETSNMP_VERS_DESC "unknown" /* overridden at run time */
+#define NETSNMP_SYS_NAME "unknown" /* overridden at run time */
+
+/* comment out the second define to turn off functionality for any of
+ these: (See README for details) */
+
+/* proc PROCESSNAME [MAX] [MIN] */
+#define NETSNMP_PROCMIBNUM 2
+
+/* exec/shell NAME COMMAND */
+#define NETSNMP_SHELLMIBNUM 8
+
+/* swap MIN */
+#define NETSNMP_MEMMIBNUM 4
+
+/* disk DISK MINSIZE */
+#define NETSNMP_DISKMIBNUM 9
+
+/* load 1 5 15 */
+#define NETSNMP_LOADAVEMIBNUM 10
+
+/* which version are you using? This mibloc will tell you */
+#define NETSNMP_VERSIONMIBNUM 100
+
+/* Reports errors the agent runs into */
+/* (typically its "can't fork, no mem" problems) */
+#define NETSNMP_ERRORMIBNUM 101
+
+/* The sub id of EXTENSIBLEMIB returned to queries of
+ .iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0 */
+#define NETSNMP_AGENTID 250
+
+/* This ID is returned after the AGENTID above. IE, the resulting
+ value returned by a query to sysObjectID is
+ EXTENSIBLEMIB.AGENTID.???, where ??? is defined below by OSTYPE */
+
+#define NETSNMP_HPUX9ID 1
+#define NETSNMP_SUNOS4ID 2
+#define NETSNMP_SOLARISID 3
+#define NETSNMP_OSFID 4
+#define NETSNMP_ULTRIXID 5
+#define NETSNMP_HPUX10ID 6
+#define NETSNMP_NETBSD1ID 7
+#define NETSNMP_FREEBSDID 8
+#define NETSNMP_IRIXID 9
+#define NETSNMP_LINUXID 10
+#define NETSNMP_BSDIID 11
+#define NETSNMP_OPENBSDID 12
+#define NETSNMP_WIN32ID 13
+#define NETSNMP_HPUX11ID 14
+#define NETSNMP_AIXID 15
+#define NETSNMP_MACOSXID 16
+#define NETSNMP_DRAGONFLYID 17
+#define NETSNMP_UNKNOWNID 255
+
+#ifdef hpux9
+#define NETSNMP_OSTYPE NETSNMP_HPUX9ID
+#endif
+#ifdef hpux10
+#define NETSNMP_OSTYPE NETSNMP_HPUX10ID
+#endif
+#ifdef hpux11
+#define NETSNMP_OSTYPE NETSNMP_HPUX11ID
+#endif
+#ifdef sunos4
+#define NETSNMP_OSTYPE NETSNMP_SUNOS4ID
+#endif
+#ifdef solaris2
+#define NETSNMP_OSTYPE NETSNMP_SOLARISID
+#endif
+#if defined(osf3) || defined(osf4) || defined(osf5)
+#define NETSNMP_OSTYPE NETSNMP_OSFID
+#endif
+#ifdef ultrix4
+#define NETSNMP_OSTYPE NETSNMP_ULTRIXID
+#endif
+#if defined(netbsd1) || defined(netbsd2)
+#define NETSNMP_OSTYPE NETSNMP_NETBSD1ID
+#endif
+#if defined(__FreeBSD__)
+#define NETSNMP_OSTYPE NETSNMP_FREEBSDID
+#endif
+#if defined(__DragonFly__)
+#define NETSNMP_OSTYPE NETSNMP_DRAGONFLYID
+#endif
+#if defined(irix6) || defined(irix5)
+#define NETSNMP_OSTYPE NETSNMP_IRIXID
+#endif
+#ifdef linux
+#define NETSNMP_OSTYPE NETSNMP_LINUXID
+#endif
+#if defined(bsdi2) || defined(bsdi3) || defined(bsdi4)
+#define NETSNMP_OSTYPE NETSNMP_BSDIID
+#endif
+#if defined(openbsd)
+#define NETSNMP_OSTYPE NETSNMP_OPENBSDID
+#endif
+#ifdef WIN32
+#define NETSNMP_OSTYPE NETSNMP_WIN32ID
+#endif
+#if defined(aix3) || defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+#define NETSNMP_OSTYPE NETSNMP_AIXID
+#endif
+#if defined(darwin) && (darwin >= 8)
+#define NETSNMP_OSTYPE NETSNMP_MACOSXID
+#endif
+/* unknown */
+#ifndef NETSNMP_OSTYPE
+#define NETSNMP_OSTYPE NETSNMP_UNKNOWNID
+#endif
+
+/* The enterprise number has been assigned by the IANA group. */
+/* Optionally, this may point to the location in the tree your */
+/* company/organization has been allocated. */
+/* The assigned enterprise number for the NET_SNMP MIB modules. */
+#define NETSNMP_ENTERPRISE_OID 8072
+#define NETSNMP_ENTERPRISE_MIB 1,3,6,1,4,1,8072
+#define NETSNMP_ENTERPRISE_DOT_MIB 1.3.6.1.4.1.8072
+#define NETSNMP_ENTERPRISE_DOT_MIB_LENGTH 7
+
+/* The assigned enterprise number for sysObjectID. */
+#define NETSNMP_SYSTEM_MIB 1,3,6,1,4,1,8072,3,2,NETSNMP_OSTYPE
+#define NETSNMP_SYSTEM_DOT_MIB 1.3.6.1.4.1.8072.3.2.NETSNMP_OSTYPE
+#define NETSNMP_SYSTEM_DOT_MIB_LENGTH 10
+
+/* The assigned enterprise number for notifications. */
+#define NETSNMP_NOTIFICATION_MIB 1,3,6,1,4,1,8072,4
+#define NETSNMP_NOTIFICATION_DOT_MIB 1.3.6.1.4.1.8072.4
+#define NETSNMP_NOTIFICATION_DOT_MIB_LENGTH 8
+
+/* this is the location of the ucdavis mib tree. It shouldn't be
+ changed, as the places it is used are expected to be constant
+ values or are directly tied to the UCD-SNMP-MIB. */
+#define NETSNMP_UCDAVIS_OID 2021
+#define NETSNMP_UCDAVIS_MIB 1,3,6,1,4,1,2021
+#define NETSNMP_UCDAVIS_DOT_MIB 1.3.6.1.4.1.2021
+#define NETSNMP_UCDAVIS_DOT_MIB_LENGTH 7
+
+/* how long to wait (seconds) for error querys before reseting the error trap.*/
+#define NETSNMP_ERRORTIMELENGTH 600
+
+/* Exec command to fix PROC problems */
+/* %s will be replaced by the process name in error */
+
+/* #define NETSNMP_PROCFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
+
+/* Exec command to fix EXEC problems */
+/* %s will be replaced by the exec/script name in error */
+
+/* #define NETSNMP_EXECFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
+
+/* Should exec output Cashing be used (speeds up things greatly), and
+ if so, After how many seconds should the cache re-newed? Note:
+ Don't define CASHETIME to disable cashing completely */
+
+#define NETSNMP_EXCACHETIME 30
+#define NETSNMP_CACHEFILE ".snmp-exec-cache"
+#define NETSNMP_MAXCACHESIZE (1500*80) /* roughly 1500 lines max */
+
+/* misc defaults */
+
+/* default of 100 meg minimum if the minimum size is not specified in
+ the config file */
+#define NETSNMP_DEFDISKMINIMUMSPACE 100000
+
+/* default maximum load average before error */
+#define NETSNMP_DEFMAXLOADAVE 12.0
+
+/* max times to loop reading output from execs. */
+/* Because of sleep(1)s, this will also be time to wait (in seconds) for exec
+ to finish */
+#define NETSNMP_MAXREADCOUNT 100
+
+/* Set if snmpgets should block and never timeout */
+/* The original CMU code had this hardcoded as = 1 */
+#define NETSNMP_SNMPBLOCK 1
+
+/* How long to wait before restarting the agent after a snmpset to
+ EXTENSIBLEMIB.VERSIONMIBNUM.VERRESTARTAGENT. This is
+ necessary to finish the snmpset reply before restarting. */
+#define NETSNMP_RESTARTSLEEP 5
+
+/* UNdefine to allow specifying zero-length community string */
+/* #define NETSNMP_NO_ZEROLENGTH_COMMUNITY 1 */
+
+/* Number of community strings to store */
+#define NETSNMP_NUM_COMMUNITIES 5
+
+/* internal define */
+#define NETSNMP_LASTFIELD -1
+
+/* Pluggable transports. */
+
+/* This is defined if support for the UDP/IP transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_UDP_DOMAIN
+
+/* This is defined if support for the "callback" transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+
+/* This is defined if support for the TCP/IP transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_TCP_DOMAIN
+
+/* This is defined if support for the Unix transport domain
+ (a.k.a. "local IPC") is available. */
+#undef NETSNMP_TRANSPORT_UNIX_DOMAIN
+
+/* This is defined if support for the AAL5 PVC transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
+
+/* This is defined if support for the IPX transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_IPX_DOMAIN
+
+/* This is defined if support for the UDP/IPv6 transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+
+/* This is defined if support for the TCP/IPv6 transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+
+/* This is defined if support for the TLS transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_TLSBASE_DOMAIN
+
+/* This is defined if support for the Alias transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_ALIAS_DOMAIN
+
+/* This is defined if support for the SSH transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_SSH_DOMAIN
+
+/* This is defined if support for the DTLS/UDP transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+/* This is defined if support for the TLS/TCP transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+/* This is defined if support for stdin/out transport domain is available. */
+#undef NETSNMP_TRANSPORT_STD_DOMAIN
+
+/* This is defined if support for the IPv4Base transport domain is available. */
+#undef NETSNMP_TRANSPORT_IPV4BASE_DOMAIN
+
+/* define this if the USM security module is available */
+#undef NETSNMP_SECMOD_USM
+
+/* define this if the KSM (kerberos based snmp) security module is available */
+#undef NETSNMP_SECMOD_KSM
+
+/* define this if the local security module is available */
+#undef NETSNMP_SECMOD_LOCALSM
+
+/* define if configured as a "mini-agent" */
+#undef NETSNMP_MINI_AGENT
+
+/* this is the location of the net-snmp mib tree. It shouldn't be
+ changed, as the places it is used are expected to be constant
+ values or are directly tied to the UCD-SNMP-MIB. */
+#define NETSNMP_OID 8072
+#define NETSNMP_MIB 1,3,6,1,4,1,8072
+#define NETSNMP_DOT_MIB 1.3.6.1.4.1.8072
+#define NETSNMP_DOT_MIB_LENGTH 7
+
+/* pattern for temporary file names */
+#define NETSNMP_TEMP_FILE_PATTERN "/tmp/snmpdXXXXXX"
+
+/*
+ * this must be before the system/machine includes, to allow them to
+ * override and turn off inlining. To do so, they should do the
+ * following:
+ *
+ * #undef NETSNMP_ENABLE_INLINE
+ * #define NETSNMP_ENABLE_INLINE 0
+ *
+ * A user having problems with their compiler can also turn off
+ * the use of inline by defining NETSNMP_NO_INLINE via their cflags:
+ *
+ * -DNETSNMP_NO_INLINE
+ *
+ * Header and source files should only test against NETSNMP_USE_INLINE:
+ *
+ * #ifdef NETSNMP_USE_INLINE
+ * NETSNMP_INLINE function(int parm) { return parm -1; }
+ * #endif
+ *
+ * Functions which should be static, regardless of whether or not inline
+ * is available or enabled should use the NETSNMP_STATIC_INLINE macro,
+ * like so:
+ *
+ * NETSNMP_STATIC_INLINE function(int parm) { return parm -1; }
+ *
+ * NOT like this:
+ *
+ * static NETSNMP_INLINE function(int parm) { return parm -1; }
+ *
+ */
+#ifdef NETSNMP_BROKEN_INLINE
+# define NETSNMP_ENABLE_INLINE 0
+#else
+# define NETSNMP_ENABLE_INLINE 1
+#endif
+
+#include NETSNMP_SYSTEM_INCLUDE_FILE
+#include NETSNMP_MACHINE_INCLUDE_FILE
+
+#if NETSNMP_ENABLE_INLINE && !defined(NETSNMP_NO_INLINE)
+# define NETSNMP_USE_INLINE 1
+# ifndef NETSNMP_INLINE
+# define NETSNMP_INLINE inline
+# endif
+# ifndef NETSNMP_STATIC_INLINE
+# define NETSNMP_STATIC_INLINE static inline
+# endif
+#else
+# define NETSNMP_INLINE
+# define NETSNMP_STATIC_INLINE static
+#endif
+
+#ifndef NETSNMP_IMPORT
+# define NETSNMP_IMPORT extern
+#endif
+
+/* comment the next line if you are compiling with libsnmp.h
+ and are not using the UC-Davis SNMP library. */
+#define UCD_SNMP_LIBRARY 1
+
+/* final conclusion on nlist usage */
+#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(NETSNMP_DONT_USE_NLIST) && defined(HAVE_KMEM) && !defined(NETSNMP_NO_KMEM_USAGE)
+#define NETSNMP_CAN_USE_NLIST
+#endif
+
+
+/* ********* NETSNMP_MARK_BEGIN_LEGACY_DEFINITIONS *********/
+/*
+ * existing definitions prior to Net-SNMP 5.4
+ *
+ * do not add anything new here
+ *
+ */
+
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+
+#ifdef NETSNMP_DEFAULT_SNMP_VERSION
+# define DEFAULT_SNMP_VERSION NETSNMP_DEFAULT_SNMP_VERSION
+#endif
+
+#ifdef NETSNMP_SNMPV1
+# define SNMPV1 NETSNMP_SNMPV1
+#endif
+
+#ifdef NETSNMP_SNMPV2ANY
+# define SNMPV2ANY NETSNMP_SNMPV2ANY
+#endif
+
+#ifdef NETSNMP_SNMPV2AUTH
+# define SNMPV2AUTH NETSNMP_SNMPV2AUTH
+#endif
+
+#ifdef NETSNMP_DEFAULT_MIBS
+# define DEFAULT_MIBS NETSNMP_DEFAULT_MIBS
+#endif
+
+#ifdef NETSNMP_DEFAULT_MIBDIRS
+# define DEFAULT_MIBDIRS NETSNMP_DEFAULT_MIBDIRS
+#endif
+
+#ifdef NETSNMP_DEFAULT_MIBFILES
+# define DEFAULT_MIBFILES NETSNMP_DEFAULT_MIBFILES
+#endif
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+# define OPAQUE_SPECIAL_TYPES NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+#endif
+
+#ifdef NETSNMP_ENABLE_SCAPI_AUTHPRIV
+# define SCAPI_AUTHPRIV NETSNMP_ENABLE_SCAPI_AUTHPRIV
+#endif
+
+#ifdef NETSNMP_USE_INTERNAL_MD5
+# define USE_INTERNAL_MD5 NETSNMP_USE_INTERNAL_MD5
+#endif
+
+#ifdef NETSNMP_USE_PKCS11
+# define USE_PKCS NETSNMP_USE_PKCS11
+#endif
+
+#ifdef NETSNMP_USE_OPENSSL
+# define USE_OPENSSL NETSNMP_USE_OPENSSL
+#endif
+
+#ifdef NETSNMP_NO_DEBUGGING
+# define SNMP_NO_DEBUGGING NETSNMP_NO_DEBUGGING
+#endif
+
+#ifdef NETSNMP_ALWAYS_DEBUG
+# define SNMP_ALWAYS_DEBUG NETSNMP_ALWAYS_DEBUG
+#endif
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+# define USE_REVERSE_ASNENCODING NETSNMP_USE_REVERSE_ASNENCODING
+#endif
+#ifdef NETSNMP_DEFAULT_ASNENCODING_DIRECTION
+# define DEFAULT_ASNENCODING_DIRECTION NETSNMP_DEFAULT_ASNENCODING_DIRECTION
+#endif
+
+#define PERSISTENT_DIRECTORY NETSNMP_PERSISTENT_DIRECTORY
+#define PERSISTENT_MASK NETSNMP_PERSISTENT_MASK
+#define AGENT_DIRECTORY_MODE NETSNMP_AGENT_DIRECTORY_MODE
+#define MAX_PERSISTENT_BACKUPS NETSNMP_MAX_PERSISTENT_BACKUPS
+#define SYSTEM_INCLUDE_FILE NETSNMP_SYSTEM_INCLUDE_FILE
+#define MACHINE_INCLUDE_FILE NETSNMP_MACHINE_INCLUDE_FILE
+
+#ifdef NETSNMP_DEFAULT_SERVER_SEND_BUF
+# define DEFAULT_SERVER_SEND_BUF NETSNMP_DEFAULT_SERVER_SEND_BUF
+#endif
+#ifdef NETSNMP_DEFAULT_SERVER_RECV_BUF
+# define DEFAULT_SERVER_RECV_BUF NETSNMP_DEFAULT_SERVER_RECV_BUF
+#endif
+#ifdef NETSNMP_DEFAULT_CLIENT_SEND_BUF
+# define DEFAULT_CLIENT_SEND_BUF NETSNMP_DEFAULT_CLIENT_SEND_BUF
+#endif
+#ifdef NETSNMP_DEFAULT_CLIENT_RECV_BUF
+# define DEFAULT_CLIENT_RECV_BUF NETSNMP_DEFAULT_CLIENT_RECV_BUF
+#endif
+
+#ifdef NETSNMP_LOGFILE
+# define LOGFILE NETSNMP_LOGFILE
+#endif
+
+#ifdef NETSNMP_SYS_CONTACT
+# define SYS_CONTACT NETSNMP_SYS_CONTACT
+#endif
+
+#ifdef NETSNMP_SYS_LOC
+# define SYS_LOC NETSNMP_SYS_LOC
+#endif
+
+#ifdef NETSNMP_USE_LIBWRAP
+# define USE_LIBWRAP NETSNMP_USE_LIBWRAP
+#endif
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+# define SNMP_TESTING_CODE NETSNMP_ENABLE_TESTING_CODE
+#endif
+
+#ifdef NETSNMP_NO_ROOT_ACCESS
+# define NO_ROOT_ACCESS NETSNMP_NO_ROOT_ACCESS
+#endif
+
+#ifdef NETSNMP_NO_KMEM_USAGE
+# define NO_KMEM_USAGE NETSNMP_NO_KMEM_USAGE
+#endif
+
+#ifdef NETSNMP_NO_DUMMY_VALUES
+# define NO_DUMMY_VALUES NETSNMP_NO_DUMMY_VALUES
+#endif
+
+#define VERS_DESC NETSNMP_VERS_DESC
+#define SYS_NAME NETSNMP_SYS_NAME
+
+#define PROCMIBNUM NETSNMP_PROCMIBNUM
+#define SHELLMIBNUM NETSNMP_SHELLMIBNUM
+#define MEMMIBNUM NETSNMP_MEMMIBNUM
+#define DISKMIBNUM NETSNMP_DISKMIBNUM
+
+#define LOADAVEMIBNUM NETSNMP_LOADAVEMIBNUM
+#define VERSIONMIBNUM NETSNMP_VERSIONMIBNUM
+#define ERRORMIBNUM NETSNMP_ERRORMIBNUM
+#define AGENTID NETSNMP_AGENTID
+
+#define HPUX9ID NETSNMP_HPUX9ID
+#define SUNOS4ID NETSNMP_SUNOS4ID
+#define SOLARISID NETSNMP_SOLARISID
+#define OSFID NETSNMP_OSFID
+#define ULTRIXID NETSNMP_ULTRIXID
+#define HPUX10ID NETSNMP_HPUX10ID
+#define NETBSD1ID NETSNMP_NETBSD1ID
+#define FREEBSDID NETSNMP_FREEBSDID
+#define IRIXID NETSNMP_IRIXID
+#define LINUXID NETSNMP_LINUXID
+#define BSDIID NETSNMP_BSDIID
+#define OPENBSDID NETSNMP_OPENBSDID
+#define WIN32ID NETSNMP_WIN32ID
+#define HPUX11ID NETSNMP_HPUX11ID
+#define AIXID NETSNMP_AIXID
+#define MACOSXID NETSNMP_MACOSXID
+#define UNKNOWNID NETSNMP_UNKNOWNID
+
+#define ENTERPRISE_OID NETSNMP_ENTERPRISE_OID
+#define ENTERPRISE_MIB NETSNMP_ENTERPRISE_MIB
+#define ENTERPRISE_DOT_MIB NETSNMP_ENTERPRISE_DOT_MIB
+#define ENTERPRISE_DOT_MIB_LENGTH NETSNMP_ENTERPRISE_DOT_MIB_LENGTH
+
+#define SYSTEM_MIB NETSNMP_SYSTEM_MIB
+#define SYSTEM_DOT_MIB NETSNMP_SYSTEM_DOT_MIB
+#define SYSTEM_DOT_MIB_LENGTH NETSNMP_SYSTEM_DOT_MIB_LENGTH
+
+#define NOTIFICATION_MIB NETSNMP_NOTIFICATION_MIB
+#define NOTIFICATION_DOT_MIB NETSNMP_NOTIFICATION_DOT_MIB
+#define NOTIFICATION_DOT_MIB_LENGTH NETSNMP_NOTIFICATION_DOT_MIB_LENGTH
+
+#define UCDAVIS_OID NETSNMP_UCDAVIS_OID
+#define UCDAVIS_MIB NETSNMP_UCDAVIS_MIB
+#define UCDAVIS_DOT_MIB NETSNMP_UCDAVIS_DOT_MIB
+#define UCDAVIS_DOT_MIB_LENGTH NETSNMP_UCDAVIS_DOT_MIB_LENGTH
+
+#define ERRORTIMELENGTH NETSNMP_ERRORTIMELENGTH
+
+#ifdef NETSNMP_PROCFIXCMD
+# define PROCFIXCMD NETSNMP_PROCFIXCMD
+#endif
+
+#ifdef NETSNMP_EXECFIXCMD
+# define EXECFIXCMD NETSNMP_EXECFIXCMD
+#endif
+
+#define EXCACHETIME NETSNMP_EXCACHETIME
+#define CACHEFILE NETSNMP_CACHEFILE
+#define MAXCACHESIZE NETSNMP_MAXCACHESIZE
+
+#define DEFDISKMINIMUMSPACE NETSNMP_DEFDISKMINIMUMSPACE
+#define DEFMAXLOADAVE NETSNMP_DEFMAXLOADAVE
+#define MAXREADCOUNT NETSNMP_MAXREADCOUNT
+
+#define SNMPBLOCK NETSNMP_SNMPBLOCK
+#define RESTARTSLEEP NETSNMP_RESTARTSLEEP
+
+#define NUM_COMMUNITIES NETSNMP_NUM_COMMUNITIES
+
+#ifdef NETSNMP_NO_ZEROLENGTH_COMMUNITY
+# define NO_ZEROLENGTH_COMMUNITY NETSNMP_NO_ZEROLENGTH_COMMUNITY
+#endif
+
+#define LASTFIELD NETSNMP_LASTFIELD
+
+#define CONFIGURE_OPTIONS NETSNMP_CONFIGURE_OPTIONS
+
+#ifdef NETSNMP_TRANSPORT_UDP_DOMAIN
+# define SNMP_TRANSPORT_UDP_DOMAIN NETSNMP_TRANSPORT_UDP_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+# define SNMP_TRANSPORT_CALLBACK_DOMAIN NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_TCP_DOMAIN
+# define SNMP_TRANSPORT_TCP_DOMAIN NETSNMP_TRANSPORT_TCP_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+# define SNMP_TRANSPORT_UNIX_DOMAIN NETSNMP_TRANSPORT_UNIX_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
+# define SNMP_TRANSPORT_AAL5PVC_DOMAIN NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_IPX_DOMAIN
+# define SNMP_TRANSPORT_IPX_DOMAIN NETSNMP_TRANSPORT_IPX_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+# define SNMP_TRANSPORT_UDPIPV6_DOMAIN NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+# define SNMP_TRANSPORT_TCPIPV6_DOMAIN NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_TLS_DOMAIN
+# define SNMP_TRANSPORT_TLS_DOMAIN NETSNMP_TRANSPORT_TLS_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_STD_DOMAIN
+# define SNMP_TRANSPORT_STD_DOMAIN NETSNMP_TRANSPORT_STD_DOMAIN
+#endif
+
+#ifdef NETSNMP_SECMOD_USM
+# define SNMP_SECMOD_USM NETSNMP_SECMOD_USM
+#endif
+
+#ifdef NETSNMP_SECMOD_KSM
+# define SNMP_SECMOD_KSM NETSNMP_SECMOD_KSM
+#endif
+
+#ifdef NETSNMP_SECMOD_LOCALSM
+# define SNMP_SECMOD_LOCALSM NETSNMP_SECMOD_LOCALSM
+#endif
+
+#ifdef NETSNMP_REENTRANT
+# define NS_REENTRANT NETSNMP_REENTRANT
+#endif
+
+#ifdef NETSNMP_ENABLE_IPV6
+# define INET6 NETSNMP_ENABLE_IPV6
+#endif
+
+#ifdef NETSNMP_ENABLE_LOCAL_SMUX
+# define LOCAL_SMUX NETSNMP_ENABLE_LOCAL_SMUX
+#endif
+
+#ifdef NETSNMP_AGENTX_DOM_SOCK_ONLY
+# define AGENTX_DOM_SOCK_ONLY NETSNMP_AGENTX_DOM_SOCK_ONLY
+#endif
+
+#ifdef NETSNMP_SNMPTRAPD_DISABLE_AGENTX
+# define SNMPTRAPD_DISABLE_AGENTX
+#endif
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+# define MIT_NEW_CRYPTO NETSNMP_USE_KERBEROS_MIT
+#endif
+
+#ifdef NETSNMP_USE_KERBEROS_HEIMDAL
+# define HEIMDAL NETSNMP_USE_KERBEROS_HEIMDAL
+#endif
+
+#ifdef NETSNMP_AGENTX_SOCKET
+# define AGENTX_SOCKET NETSNMP_AGENTX_SOCKET
+#endif
+
+#ifdef NETSNMP_DISABLE_MIB_LOADING
+# define DISABLE_MIB_LOADING NETSNMP_DISABLE_MIB_LOADING
+#endif
+
+#ifdef NETSNMP_DISABLE_SNMPV1
+# define DISABLE_SNMPV1 NETSNMP_DISABLE_SNMPV1
+#endif
+
+#ifdef NETSNMP_DISABLE_SNMPV2C
+# define DISABLE_SNMPV2C NETSNMP_DISABLE_SNMPV2C
+#endif
+
+#ifdef NETSNMP_DISABLE_SET_SUPPORT
+# define DISABLE_SET_SUPPORT NETSNMP_DISABLE_SET_SUPPORT
+#endif
+
+#ifdef NETSNMP_DISABLE_DES
+# define DISABLE_DES NETSNMP_DISABLE_DES
+#endif
+
+#ifdef NETSNMP_DISABLE_MD5
+# define DISABLE_MD5 NETSNMP_DISABLE_MD5
+#endif
+
+#ifdef NETSNMP_DONT_USE_NLIST
+# define DONT_USE_NLIST NETSNMP_DONT_USE_NLIST
+#endif
+
+#ifdef NETSNMP_CAN_USE_NLIST
+# define CAN_USE_NLIST NETSNMP_CAN_USE_NLIST
+#endif
+
+#ifdef NETSNMP_CAN_USE_SYSCTL
+# define CAN_USE_SYSCTL NETSNMP_CAN_USE_SYSCTL
+#endif
+
+#endif /* NETSNMP_NO_LEGACY_DEFINITIONS */
+
+
+#endif /* NET_SNMP_CONFIG_H */
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..cd80c74
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,24 @@
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_include([m4/ac_add_search_path.m4])
+m4_include([m4/ac_msg_cache.m4])
+m4_include([m4/ac_msg_module_dbg.m4])
+m4_include([m4/ac_prompt_user.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([m4/netsnmp_arg.m4])
+m4_include([m4/netsnmp_search_libs.m4])
diff --git a/agent/Makefile.depend b/agent/Makefile.depend
new file mode 100644
index 0000000..cf72cbf
--- /dev/null
+++ b/agent/Makefile.depend
@@ -0,0 +1,5418 @@
+# 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/net-snmp-features.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/oid.h
+./agent_handler.lo: ../include/net-snmp/library/types.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_api.h
+./agent_handler.lo: ../include/net-snmp/varbind_api.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_client.h
+./agent_handler.lo: ../include/net-snmp/pdu_api.h
+./agent_handler.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent_handler.lo: ../include/net-snmp/session_api.h
+./agent_handler.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent_handler.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent_handler.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent_handler.lo: ../include/net-snmp/mib_api.h
+./agent_handler.lo: ../include/net-snmp/library/parse.h
+./agent_handler.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent_handler.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/net-snmp-config.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/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/snmptsm.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_handler.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./agent_index.lo: ../include/net-snmp/net-snmp-config.h
+./agent_index.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./agent_index.lo: ../include/net-snmp/library/types.h
+./agent_index.lo: ../include/net-snmp/library/snmp_api.h
+./agent_index.lo: ../include/net-snmp/varbind_api.h
+./agent_index.lo: ../include/net-snmp/library/snmp_client.h
+./agent_index.lo: ../include/net-snmp/pdu_api.h
+./agent_index.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent_index.lo: ../include/net-snmp/session_api.h
+./agent_index.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent_index.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent_index.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent_index.lo: ../include/net-snmp/mib_api.h
+./agent_index.lo: ../include/net-snmp/library/parse.h
+./agent_index.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent_index.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/hrh_storage.h mibgroup/host/hrh_filesys.h
+./agent_index.lo: mibgroup/host/hrSWInstalledTable.h
+./agent_index.lo: mibgroup/host/hrSWRunTable.h mibgroup/host/hr_system.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/examples/scalar_int.h
+./agent_index.lo: mibgroup/examples/watched.h mibgroup/examples/data_set.h
+./agent_index.lo: mibgroup/examples/delayed_instance.h
+./agent_index.lo: mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.h
+./agent_index.lo: mibgroup/Rmon/rows.h mibgroup/Rmon/agutil.h
+./agent_index.lo: mibgroup/Rmon/statistics.h mibgroup/Rmon/alarmTable.h
+./agent_index.lo: mibgroup/Rmon/history.h mibgroup/Rmon/event.h
+./agent_index.lo: mibgroup/host/data_access/swinst.h
+./agent_index.lo: mibgroup/host/data_access/swrun.h
+./agent_index.lo: mibgroup/host/hrSWRunPerfTable.h
+./agent_index.lo: mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h
+./agent_index.lo: mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h
+./agent_index.lo: mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h
+./agent_index.lo: mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h
+./agent_index.lo: mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h
+./agent_index.lo: 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/snmpMPDStats_5_5.h
+./agent_index.lo: mibgroup/snmpv3/usmStats_5_5.h mibgroup/snmpv3/snmpEngine.h
+./agent_index.lo: mibgroup/snmpv3/usmUser.h mibgroup/mibII/snmp_mib_5_5.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/tcp.h
+./agent_index.lo: mibgroup/mibII/icmp.h mibgroup/mibII/udp.h
+./agent_index.lo: mibgroup/mibII/vacm_vars.h mibgroup/mibII/setSerialNo.h
+./agent_index.lo: mibgroup/mibII/ipv6.h mibgroup/ucd-snmp/disk_hw.h
+./agent_index.lo: ../agent/mibgroup/mibdefs.h mibgroup/ucd-snmp/proc.h
+./agent_index.lo: mibgroup/ucd-snmp/versioninfo.h mibgroup/ucd-snmp/pass.h
+./agent_index.lo: mibgroup/ucd-snmp/pass_persist.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 mibgroup/ucd-snmp/memory.h
+./agent_index.lo: 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/target_counters_5_5.h
+./agent_index.lo: mibgroup/target/snmpTargetAddrEntry.h
+./agent_index.lo: mibgroup/target/snmpTargetParamsEntry.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/fsys/hw_fsys.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/ipAddressPrefixTable/ipAddressPrefixTable.h
+./agent_index.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
+./agent_index.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
+./agent_index.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
+./agent_index.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
+./agent_index.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./agent_index.lo: ../include/net-snmp/data_access/defaultrouter.h
+./agent_index.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h
+./agent_index.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h
+./agent_index.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h
+./agent_index.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./agent_index.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h
+./agent_index.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.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-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./agent_index.lo: ../include/net-snmp/data_access/scopezone.h
+./agent_index.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h
+./agent_index.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h
+./agent_index.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h
+./agent_index.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./agent_index.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h
+./agent_index.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./agent_index.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h
+./agent_index.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h
+./agent_index.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h
+./agent_index.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./agent_index.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h
+./agent_index.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.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/net-snmp-features.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/oid.h
+./agent_read_config.lo: ../include/net-snmp/library/types.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_api.h
+./agent_read_config.lo: ../include/net-snmp/varbind_api.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_client.h
+./agent_read_config.lo: ../include/net-snmp/pdu_api.h
+./agent_read_config.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent_read_config.lo: ../include/net-snmp/session_api.h
+./agent_read_config.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent_read_config.lo: ../include/net-snmp/mib_api.h
+./agent_read_config.lo: ../include/net-snmp/library/parse.h
+./agent_read_config.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent_read_config.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./agent_read_config.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./agent_read_config.lo: mibgroup/struct.h snmpd.h
+./agent_read_config.lo: ../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/utilities/iquery.h
+./agent_read_config.lo: mibgroup/snmpv3/usmConf.h 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/hrh_storage.h
+./agent_read_config.lo: mibgroup/host/hrh_filesys.h
+./agent_read_config.lo: mibgroup/host/hrSWInstalledTable.h
+./agent_read_config.lo: mibgroup/host/hrSWRunTable.h
+./agent_read_config.lo: mibgroup/host/hr_system.h mibgroup/host/hr_device.h
+./agent_read_config.lo: mibgroup/host/hr_other.h mibgroup/host/hr_proc.h
+./agent_read_config.lo: mibgroup/host/hr_network.h mibgroup/host/hr_print.h
+./agent_read_config.lo: mibgroup/host/hr_disk.h mibgroup/host/hr_partition.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/tsm-mib/snmpTsmConfigurationUsePrefix.h
+./agent_read_config.lo: mibgroup/Rmon/rows.h mibgroup/Rmon/agutil.h
+./agent_read_config.lo: mibgroup/Rmon/statistics.h mibgroup/Rmon/alarmTable.h
+./agent_read_config.lo: mibgroup/Rmon/history.h mibgroup/Rmon/event.h
+./agent_read_config.lo: mibgroup/host/data_access/swinst.h
+./agent_read_config.lo: mibgroup/host/data_access/swrun.h
+./agent_read_config.lo: mibgroup/host/hrSWRunPerfTable.h
+./agent_read_config.lo: mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h
+./agent_read_config.lo: mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h
+./agent_read_config.lo: mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h
+./agent_read_config.lo: mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h
+./agent_read_config.lo: mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.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/snmpMPDStats_5_5.h
+./agent_read_config.lo: mibgroup/snmpv3/usmStats_5_5.h
+./agent_read_config.lo: mibgroup/snmpv3/snmpEngine.h
+./agent_read_config.lo: mibgroup/snmpv3/usmUser.h
+./agent_read_config.lo: mibgroup/mibII/snmp_mib_5_5.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/tcp.h mibgroup/mibII/icmp.h
+./agent_read_config.lo: mibgroup/mibII/udp.h mibgroup/mibII/vacm_vars.h
+./agent_read_config.lo: mibgroup/mibII/setSerialNo.h mibgroup/mibII/ipv6.h
+./agent_read_config.lo: mibgroup/ucd-snmp/disk_hw.h
+./agent_read_config.lo: ../agent/mibgroup/mibdefs.h mibgroup/ucd-snmp/proc.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/loadave.h mibgroup/agent/extend.h
+./agent_read_config.lo: mibgroup/ucd-snmp/errormib.h mibgroup/ucd-snmp/file.h
+./agent_read_config.lo: mibgroup/ucd-snmp/dlmod.h 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/target_counters_5_5.h
+./agent_read_config.lo: mibgroup/target/snmpTargetAddrEntry.h
+./agent_read_config.lo: mibgroup/target/snmpTargetParamsEntry.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/fsys/hw_fsys.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/ipAddressPrefixTable/ipAddressPrefixTable.h
+./agent_read_config.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
+./agent_read_config.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
+./agent_read_config.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
+./agent_read_config.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
+./agent_read_config.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./agent_read_config.lo: ../include/net-snmp/data_access/defaultrouter.h
+./agent_read_config.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h
+./agent_read_config.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h
+./agent_read_config.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h
+./agent_read_config.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./agent_read_config.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h
+./agent_read_config.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.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-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./agent_read_config.lo: ../include/net-snmp/data_access/scopezone.h
+./agent_read_config.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h
+./agent_read_config.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h
+./agent_read_config.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h
+./agent_read_config.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./agent_read_config.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h
+./agent_read_config.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./agent_read_config.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h
+./agent_read_config.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h
+./agent_read_config.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h
+./agent_read_config.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./agent_read_config.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h
+./agent_read_config.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.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/net-snmp-features.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/oid.h
+./agent_registry.lo: ../include/net-snmp/library/types.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_api.h
+./agent_registry.lo: ../include/net-snmp/varbind_api.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_client.h
+./agent_registry.lo: ../include/net-snmp/pdu_api.h
+./agent_registry.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent_registry.lo: ../include/net-snmp/session_api.h
+./agent_registry.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent_registry.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent_registry.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent_registry.lo: ../include/net-snmp/mib_api.h
+./agent_registry.lo: ../include/net-snmp/library/parse.h
+./agent_registry.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent_registry.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/hrh_storage.h mibgroup/host/hrh_filesys.h
+./agent_registry.lo: mibgroup/host/hrSWInstalledTable.h
+./agent_registry.lo: mibgroup/host/hrSWRunTable.h mibgroup/host/hr_system.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
+./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/tsm-mib/snmpTsmConfigurationUsePrefix.h
+./agent_registry.lo: mibgroup/Rmon/rows.h mibgroup/Rmon/agutil.h
+./agent_registry.lo: mibgroup/Rmon/statistics.h mibgroup/Rmon/alarmTable.h
+./agent_registry.lo: mibgroup/Rmon/history.h mibgroup/Rmon/event.h
+./agent_registry.lo: mibgroup/host/data_access/swinst.h
+./agent_registry.lo: mibgroup/host/data_access/swrun.h
+./agent_registry.lo: mibgroup/host/hrSWRunPerfTable.h
+./agent_registry.lo: mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h
+./agent_registry.lo: mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h
+./agent_registry.lo: mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h
+./agent_registry.lo: mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h
+./agent_registry.lo: mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.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/snmpMPDStats_5_5.h
+./agent_registry.lo: mibgroup/snmpv3/usmStats_5_5.h
+./agent_registry.lo: mibgroup/snmpv3/snmpEngine.h mibgroup/snmpv3/usmUser.h
+./agent_registry.lo: mibgroup/mibII/snmp_mib_5_5.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/tcp.h
+./agent_registry.lo: mibgroup/mibII/icmp.h mibgroup/mibII/udp.h
+./agent_registry.lo: mibgroup/mibII/vacm_vars.h mibgroup/mibII/setSerialNo.h
+./agent_registry.lo: mibgroup/mibII/ipv6.h mibgroup/ucd-snmp/disk_hw.h
+./agent_registry.lo: ../agent/mibgroup/mibdefs.h mibgroup/ucd-snmp/proc.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/loadave.h mibgroup/agent/extend.h
+./agent_registry.lo: mibgroup/ucd-snmp/errormib.h mibgroup/ucd-snmp/file.h
+./agent_registry.lo: mibgroup/ucd-snmp/dlmod.h mibgroup/ucd-snmp/proxy.h
+./agent_registry.lo: mibgroup/ucd-snmp/logmatch.h 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/target_counters_5_5.h
+./agent_registry.lo: mibgroup/target/snmpTargetAddrEntry.h
+./agent_registry.lo: mibgroup/target/snmpTargetParamsEntry.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/fsys/hw_fsys.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/ipAddressPrefixTable/ipAddressPrefixTable.h
+./agent_registry.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
+./agent_registry.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
+./agent_registry.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
+./agent_registry.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
+./agent_registry.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./agent_registry.lo: ../include/net-snmp/data_access/defaultrouter.h
+./agent_registry.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h
+./agent_registry.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h
+./agent_registry.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h
+./agent_registry.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./agent_registry.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h
+./agent_registry.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.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-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./agent_registry.lo: ../include/net-snmp/data_access/scopezone.h
+./agent_registry.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h
+./agent_registry.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h
+./agent_registry.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h
+./agent_registry.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./agent_registry.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h
+./agent_registry.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./agent_registry.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h
+./agent_registry.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h
+./agent_registry.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h
+./agent_registry.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./agent_registry.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h
+./agent_registry.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.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_sysORTable.lo: ../include/net-snmp/net-snmp-config.h
+./agent_sysORTable.lo: ../include/net-snmp/net-snmp-includes.h
+./agent_sysORTable.lo: ../include/net-snmp/definitions.h
+./agent_sysORTable.lo: ../include/net-snmp/types.h
+./agent_sysORTable.lo: ../include/net-snmp/library/oid.h
+./agent_sysORTable.lo: ../include/net-snmp/library/types.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_api.h
+./agent_sysORTable.lo: ../include/net-snmp/varbind_api.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_client.h
+./agent_sysORTable.lo: ../include/net-snmp/pdu_api.h
+./agent_sysORTable.lo: ../include/net-snmp/library/asn1.h
+./agent_sysORTable.lo: ../include/net-snmp/output_api.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_debug.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_logging.h
+./agent_sysORTable.lo: ../include/net-snmp/session_api.h
+./agent_sysORTable.lo: ../include/net-snmp/library/callback.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_transport.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_service.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./agent_sysORTable.lo: ../include/net-snmp/library/ucd_compat.h
+./agent_sysORTable.lo: ../include/net-snmp/library/mib.h
+./agent_sysORTable.lo: ../include/net-snmp/mib_api.h
+./agent_sysORTable.lo: ../include/net-snmp/library/parse.h
+./agent_sysORTable.lo: ../include/net-snmp/library/oid_stash.h
+./agent_sysORTable.lo: ../include/net-snmp/net-snmp-features.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_impl.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp-tc.h
+./agent_sysORTable.lo: ../include/net-snmp/library/getopt.h
+./agent_sysORTable.lo: ../include/net-snmp/utilities.h
+./agent_sysORTable.lo: ../include/net-snmp/library/system.h
+./agent_sysORTable.lo: ../include/net-snmp/library/tools.h
+./agent_sysORTable.lo: ../include/net-snmp/library/int64.h
+./agent_sysORTable.lo: ../include/net-snmp/library/mt_support.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_alarm.h
+./agent_sysORTable.lo: ../include/net-snmp/library/data_list.h
+./agent_sysORTable.lo: ../include/net-snmp/library/check_varbind.h
+./agent_sysORTable.lo: ../include/net-snmp/library/container.h
+./agent_sysORTable.lo: ../include/net-snmp/library/factory.h
+./agent_sysORTable.lo: ../include/net-snmp/library/container_binary_array.h
+./agent_sysORTable.lo: ../include/net-snmp/library/container_list_ssll.h
+./agent_sysORTable.lo: ../include/net-snmp/library/container_iterator.h
+./agent_sysORTable.lo: ../include/net-snmp/library/container.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_assert.h
+./agent_sysORTable.lo: ../include/net-snmp/version.h
+./agent_sysORTable.lo: ../include/net-snmp/config_api.h
+./agent_sysORTable.lo: ../include/net-snmp/library/read_config.h
+./agent_sysORTable.lo: ../include/net-snmp/library/default_store.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_parse_args.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_enum.h
+./agent_sysORTable.lo: ../include/net-snmp/library/vacm.h
+./agent_sysORTable.lo: ../include/net-snmp/snmpv3_api.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpv3.h
+./agent_sysORTable.lo: ../include/net-snmp/library/transform_oids.h
+./agent_sysORTable.lo: ../include/net-snmp/library/keytools.h
+./agent_sysORTable.lo: ../include/net-snmp/library/scapi.h
+./agent_sysORTable.lo: ../include/net-snmp/library/lcd_time.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmp_secmod.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmptsm.h
+./agent_sysORTable.lo: ../include/net-snmp/library/snmpusm.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/mib_module_config.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/agent_module_config.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/snmp_agent.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/snmp_vars.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/agent_handler.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/var_struct.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/agent_registry.h
+./agent_sysORTable.lo: ../include/net-snmp/library/fd_event_manager.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/ds_agent.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/agent_read_config.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/agent_trap.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/all_helpers.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/instance.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/baby_steps.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/scalar.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/scalar_group.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/watcher.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/multiplexer.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/null.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/debug_handler.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/cache_handler.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/old_api.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/read_only.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/row_merge.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/serialize.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/bulk_to_next.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/mode_end_call.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/table.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/table_data.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/table_dataset.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/table_tdata.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/table_iterator.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/table_container.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/table_array.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/mfd.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/agent_callbacks.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/agent_sysORTable.h
+./agent_sysORTable.lo: ../include/net-snmp/agent/sysORTable.h
+./agent_trap.lo: ../include/net-snmp/net-snmp-config.h
+./agent_trap.lo: ../include/net-snmp/net-snmp-features.h
+./agent_trap.lo: ../include/net-snmp/utilities.h ../include/net-snmp/types.h
+./agent_trap.lo: ../include/net-snmp/library/oid.h
+./agent_trap.lo: ../include/net-snmp/library/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/varbind_api.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_client.h
+./agent_trap.lo: ../include/net-snmp/pdu_api.h
+./agent_trap.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent_trap.lo: ../include/net-snmp/session_api.h
+./agent_trap.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent_trap.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent_trap.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent_trap.lo: ../include/net-snmp/mib_api.h
+./agent_trap.lo: ../include/net-snmp/library/parse.h
+./agent_trap.lo: ../include/net-snmp/library/oid_stash.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/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/data_list.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/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/library/getopt.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/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/snmptsm.h
+./agent_trap.lo: ../include/net-snmp/library/snmpusm.h
+./agent_trap.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent_trap.lo: ../include/net-snmp/agent/mib_module_config.h
+./agent_trap.lo: ../include/net-snmp/agent/agent_module_config.h
+./agent_trap.lo: ../include/net-snmp/agent/snmp_agent.h
+./agent_trap.lo: ../include/net-snmp/agent/snmp_vars.h
+./agent_trap.lo: ../include/net-snmp/agent/agent_handler.h
+./agent_trap.lo: ../include/net-snmp/agent/var_struct.h
+./agent_trap.lo: ../include/net-snmp/agent/agent_registry.h
+./agent_trap.lo: ../include/net-snmp/library/fd_event_manager.h
+./agent_trap.lo: ../include/net-snmp/agent/ds_agent.h
+./agent_trap.lo: ../include/net-snmp/agent/agent_read_config.h
+./agent_trap.lo: ../include/net-snmp/agent/agent_trap.h
+./agent_trap.lo: ../include/net-snmp/agent/all_helpers.h
+./agent_trap.lo: ../include/net-snmp/agent/instance.h
+./agent_trap.lo: ../include/net-snmp/agent/baby_steps.h
+./agent_trap.lo: ../include/net-snmp/agent/scalar.h
+./agent_trap.lo: ../include/net-snmp/agent/scalar_group.h
+./agent_trap.lo: ../include/net-snmp/agent/watcher.h
+./agent_trap.lo: ../include/net-snmp/agent/multiplexer.h
+./agent_trap.lo: ../include/net-snmp/agent/null.h
+./agent_trap.lo: ../include/net-snmp/agent/debug_handler.h
+./agent_trap.lo: ../include/net-snmp/agent/cache_handler.h
+./agent_trap.lo: ../include/net-snmp/agent/old_api.h
+./agent_trap.lo: ../include/net-snmp/agent/read_only.h
+./agent_trap.lo: ../include/net-snmp/agent/row_merge.h
+./agent_trap.lo: ../include/net-snmp/agent/serialize.h
+./agent_trap.lo: ../include/net-snmp/agent/bulk_to_next.h
+./agent_trap.lo: ../include/net-snmp/agent/mode_end_call.h
+./agent_trap.lo: ../include/net-snmp/agent/table.h
+./agent_trap.lo: ../include/net-snmp/agent/table_data.h
+./agent_trap.lo: ../include/net-snmp/agent/table_dataset.h
+./agent_trap.lo: ../include/net-snmp/agent/table_tdata.h
+./agent_trap.lo: ../include/net-snmp/agent/table_iterator.h
+./agent_trap.lo: ../include/net-snmp/agent/table_container.h
+./agent_trap.lo: ../include/net-snmp/agent/table_array.h
+./agent_trap.lo: ../include/net-snmp/agent/mfd.h
+./agent_trap.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./agent_trap.lo: ../include/net-snmp/agent/agent_callbacks.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/agent/auto_nlist.h
+./kernel.lo: ../include/net-snmp/net-snmp-config.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/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/oid.h
+./mib_modules.lo: ../include/net-snmp/library/types.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_api.h
+./mib_modules.lo: ../include/net-snmp/varbind_api.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_client.h
+./mib_modules.lo: ../include/net-snmp/pdu_api.h
+./mib_modules.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mib_modules.lo: ../include/net-snmp/session_api.h
+./mib_modules.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mib_modules.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mib_modules.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mib_modules.lo: ../include/net-snmp/mib_api.h
+./mib_modules.lo: ../include/net-snmp/library/parse.h
+./mib_modules.lo: ../include/net-snmp/library/oid_stash.h
+./mib_modules.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mib_modules.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./mib_modules.lo: ../include/net-snmp/agent/snmp_get_statistic.h m2m.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/hrh_storage.h mibgroup/host/hrh_filesys.h
+./mib_modules.lo: mibgroup/host/hrSWInstalledTable.h
+./mib_modules.lo: mibgroup/host/hrSWRunTable.h mibgroup/host/hr_system.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/examples/scalar_int.h
+./mib_modules.lo: mibgroup/examples/watched.h mibgroup/examples/data_set.h
+./mib_modules.lo: mibgroup/examples/delayed_instance.h
+./mib_modules.lo: mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.h
+./mib_modules.lo: mibgroup/Rmon/rows.h mibgroup/Rmon/agutil.h
+./mib_modules.lo: mibgroup/Rmon/statistics.h mibgroup/Rmon/alarmTable.h
+./mib_modules.lo: mibgroup/Rmon/history.h mibgroup/Rmon/event.h
+./mib_modules.lo: mibgroup/host/data_access/swinst.h
+./mib_modules.lo: mibgroup/host/data_access/swrun.h
+./mib_modules.lo: mibgroup/host/hrSWRunPerfTable.h
+./mib_modules.lo: mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h
+./mib_modules.lo: mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h
+./mib_modules.lo: mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h
+./mib_modules.lo: mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h
+./mib_modules.lo: mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h
+./mib_modules.lo: 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/snmpMPDStats_5_5.h
+./mib_modules.lo: mibgroup/snmpv3/usmStats_5_5.h mibgroup/snmpv3/snmpEngine.h
+./mib_modules.lo: mibgroup/snmpv3/usmUser.h mibgroup/mibII/snmp_mib_5_5.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/tcp.h
+./mib_modules.lo: mibgroup/mibII/icmp.h mibgroup/mibII/udp.h
+./mib_modules.lo: mibgroup/mibII/vacm_vars.h mibgroup/mibII/setSerialNo.h
+./mib_modules.lo: mibgroup/mibII/ipv6.h mibgroup/ucd-snmp/disk_hw.h
+./mib_modules.lo: ../agent/mibgroup/mibdefs.h mibgroup/ucd-snmp/proc.h
+./mib_modules.lo: mibgroup/ucd-snmp/versioninfo.h mibgroup/ucd-snmp/pass.h
+./mib_modules.lo: mibgroup/ucd-snmp/pass_persist.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 mibgroup/ucd-snmp/memory.h
+./mib_modules.lo: 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/target_counters_5_5.h
+./mib_modules.lo: mibgroup/target/snmpTargetAddrEntry.h
+./mib_modules.lo: mibgroup/target/snmpTargetParamsEntry.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/fsys/hw_fsys.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: ../include/net-snmp/data_access/interface.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/ipAddressPrefixTable/ipAddressPrefixTable.h
+./mib_modules.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
+./mib_modules.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
+./mib_modules.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
+./mib_modules.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
+./mib_modules.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./mib_modules.lo: ../include/net-snmp/data_access/defaultrouter.h
+./mib_modules.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h
+./mib_modules.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h
+./mib_modules.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h
+./mib_modules.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./mib_modules.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h
+./mib_modules.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.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-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./mib_modules.lo: ../include/net-snmp/data_access/scopezone.h
+./mib_modules.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h
+./mib_modules.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h
+./mib_modules.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h
+./mib_modules.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./mib_modules.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h
+./mib_modules.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./mib_modules.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h
+./mib_modules.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h
+./mib_modules.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h
+./mib_modules.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./mib_modules.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h
+./mib_modules.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.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: ../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/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/oid.h
+./object_monitor.lo: ../include/net-snmp/library/types.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_api.h
+./object_monitor.lo: ../include/net-snmp/varbind_api.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_client.h
+./object_monitor.lo: ../include/net-snmp/pdu_api.h
+./object_monitor.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./object_monitor.lo: ../include/net-snmp/session_api.h
+./object_monitor.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./object_monitor.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./object_monitor.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./object_monitor.lo: ../include/net-snmp/mib_api.h
+./object_monitor.lo: ../include/net-snmp/library/parse.h
+./object_monitor.lo: ../include/net-snmp/library/oid_stash.h
+./object_monitor.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./object_monitor.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/net-snmp-features.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/oid.h
+./snmp_agent.lo: ../include/net-snmp/library/types.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_agent.lo: ../include/net-snmp/varbind_api.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_agent.lo: ../include/net-snmp/pdu_api.h
+./snmp_agent.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./snmp_agent.lo: ../include/net-snmp/session_api.h
+./snmp_agent.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./snmp_agent.lo: ../include/net-snmp/mib_api.h
+./snmp_agent.lo: ../include/net-snmp/library/parse.h
+./snmp_agent.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./snmp_agent.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./snmp_agent.lo: ../include/net-snmp/agent/snmp_get_statistic.h snmpd.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
+./snmpd.lo: ../include/net-snmp/net-snmp-config.h
+./snmpd.lo: ../include/net-snmp/net-snmp-features.h
+./snmpd.lo: ../include/net-snmp/types.h
+./snmpd.lo: ../include/net-snmp/library/oid.h
+./snmpd.lo: ../include/net-snmp/library/types.h
+./snmpd.lo: ../include/net-snmp/definitions.h
+./snmpd.lo: ../include/net-snmp/library/snmp_api.h
+./snmpd.lo: ../include/net-snmp/varbind_api.h
+./snmpd.lo: ../include/net-snmp/library/snmp_client.h
+./snmpd.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./snmpd.lo: ../include/net-snmp/output_api.h
+./snmpd.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpd.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpd.lo: ../include/net-snmp/session_api.h
+./snmpd.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./snmpd.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpd.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpd.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpd.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpd.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpd.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpd.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpd.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmpd.lo: ../include/net-snmp/library/parse.h
+./snmpd.lo: ../include/net-snmp/library/oid_stash.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/net-snmp-includes.h
+./snmpd.lo: ../include/net-snmp/library/getopt.h
+./snmpd.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./snmpd.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./snmpd.lo: ../include/net-snmp/library/large_fd_set.h m2m.h snmpd.h
+./snmpd.lo: ../include/net-snmp/agent/mib_modules.h mibgroup/smux/smux.h
+./snmp_perl.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_perl.lo: ../include/net-snmp/net-snmp-includes.h
+./snmp_perl.lo: ../include/net-snmp/definitions.h
+./snmp_perl.lo: ../include/net-snmp/types.h
+./snmp_perl.lo: ../include/net-snmp/library/oid.h
+./snmp_perl.lo: ../include/net-snmp/library/types.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_perl.lo: ../include/net-snmp/varbind_api.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_perl.lo: ../include/net-snmp/pdu_api.h
+./snmp_perl.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./snmp_perl.lo: ../include/net-snmp/session_api.h
+./snmp_perl.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./snmp_perl.lo: ../include/net-snmp/mib_api.h
+./snmp_perl.lo: ../include/net-snmp/library/parse.h
+./snmp_perl.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_perl.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./snmp_perl.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_perl.lo: ../include/net-snmp/agent/snmp_get_statistic.h snmp_perl.h
+./snmp_vars.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_vars.lo: ../include/net-snmp/net-snmp-includes.h
+./snmp_vars.lo: ../include/net-snmp/definitions.h ../include/net-snmp/types.h
+./snmp_vars.lo: ../include/net-snmp/library/oid.h
+./snmp_vars.lo: ../include/net-snmp/library/types.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_vars.lo: ../include/net-snmp/varbind_api.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_vars.lo: ../include/net-snmp/pdu_api.h
+./snmp_vars.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./snmp_vars.lo: ../include/net-snmp/session_api.h
+./snmp_vars.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./snmp_vars.lo: ../include/net-snmp/mib_api.h
+./snmp_vars.lo: ../include/net-snmp/library/parse.h
+./snmp_vars.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_vars.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./snmp_vars.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./snmp_vars.lo: ../include/net-snmp/agent/mib_modules.h
+./snmp_vars.lo: ../include/net-snmp/agent/agent_sysORTable.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/utilities/iquery.h
+./snmp_vars.lo: mibgroup/snmpv3/usmConf.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/hrh_storage.h mibgroup/host/hrh_filesys.h
+./snmp_vars.lo: mibgroup/host/hrSWInstalledTable.h
+./snmp_vars.lo: mibgroup/host/hrSWRunTable.h mibgroup/host/hr_system.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/examples/scalar_int.h
+./snmp_vars.lo: mibgroup/examples/watched.h mibgroup/examples/data_set.h
+./snmp_vars.lo: mibgroup/examples/delayed_instance.h
+./snmp_vars.lo: mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.h
+./snmp_vars.lo: mibgroup/Rmon/rows.h mibgroup/Rmon/agutil.h
+./snmp_vars.lo: mibgroup/Rmon/statistics.h mibgroup/Rmon/alarmTable.h
+./snmp_vars.lo: mibgroup/Rmon/history.h mibgroup/Rmon/event.h
+./snmp_vars.lo: mibgroup/host/data_access/swinst.h
+./snmp_vars.lo: mibgroup/host/data_access/swrun.h
+./snmp_vars.lo: mibgroup/host/hrSWRunPerfTable.h
+./snmp_vars.lo: mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h
+./snmp_vars.lo: mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h
+./snmp_vars.lo: mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h
+./snmp_vars.lo: mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h
+./snmp_vars.lo: mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h
+./snmp_vars.lo: 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/snmpMPDStats_5_5.h
+./snmp_vars.lo: mibgroup/snmpv3/usmStats_5_5.h mibgroup/snmpv3/snmpEngine.h
+./snmp_vars.lo: mibgroup/snmpv3/usmUser.h mibgroup/mibII/snmp_mib_5_5.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/tcp.h
+./snmp_vars.lo: mibgroup/mibII/icmp.h mibgroup/mibII/udp.h
+./snmp_vars.lo: mibgroup/mibII/vacm_vars.h mibgroup/mibII/setSerialNo.h
+./snmp_vars.lo: mibgroup/mibII/ipv6.h mibgroup/ucd-snmp/disk_hw.h
+./snmp_vars.lo: ../agent/mibgroup/mibdefs.h mibgroup/ucd-snmp/proc.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/loadave.h
+./snmp_vars.lo: mibgroup/agent/extend.h mibgroup/ucd-snmp/errormib.h
+./snmp_vars.lo: mibgroup/ucd-snmp/file.h mibgroup/ucd-snmp/dlmod.h
+./snmp_vars.lo: mibgroup/ucd-snmp/proxy.h 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/target_counters_5_5.h
+./snmp_vars.lo: mibgroup/target/snmpTargetAddrEntry.h
+./snmp_vars.lo: mibgroup/target/snmpTargetParamsEntry.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
+./snmp_vars.lo: mibgroup/hardware/fsys/hw_fsys.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/ipAddressPrefixTable/ipAddressPrefixTable.h
+./snmp_vars.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
+./snmp_vars.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
+./snmp_vars.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
+./snmp_vars.lo: mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
+./snmp_vars.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./snmp_vars.lo: ../include/net-snmp/data_access/defaultrouter.h
+./snmp_vars.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h
+./snmp_vars.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h
+./snmp_vars.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h
+./snmp_vars.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+./snmp_vars.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h
+./snmp_vars.lo: mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.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-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./snmp_vars.lo: ../include/net-snmp/data_access/scopezone.h
+./snmp_vars.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h
+./snmp_vars.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h
+./snmp_vars.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h
+./snmp_vars.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+./snmp_vars.lo: mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h
+./snmp_vars.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./snmp_vars.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h
+./snmp_vars.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h
+./snmp_vars.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h
+./snmp_vars.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+./snmp_vars.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h
+./snmp_vars.lo: mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.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_perl.h
+./snmp_vars.lo: ../agent/mibgroup/agent_module_inits.h
+./helpers/all_helpers.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/all_helpers.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/types.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/varbind_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/all_helpers.lo: ../include/net-snmp/pdu_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/all_helpers.lo: ../include/net-snmp/session_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/all_helpers.lo: ../include/net-snmp/mib_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/parse.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/all_helpers.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/all_helpers.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/stash_cache.h
+./helpers/baby_steps.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/baby_steps.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/types.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/varbind_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/baby_steps.lo: ../include/net-snmp/pdu_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/baby_steps.lo: ../include/net-snmp/session_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/baby_steps.lo: ../include/net-snmp/mib_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/parse.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/baby_steps.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/baby_steps.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/net-snmp-config.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/oid.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/types.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/varbind_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/pdu_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/session_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/mib_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/parse.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/bulk_to_next.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/cache_handler.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/cache_handler.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/types.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/varbind_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/cache_handler.lo: ../include/net-snmp/pdu_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/cache_handler.lo: ../include/net-snmp/session_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/cache_handler.lo: ../include/net-snmp/mib_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/parse.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/cache_handler.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/cache_handler.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/debug_handler.lo: ../include/net-snmp/net-snmp-config.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/oid.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/types.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/varbind_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/debug_handler.lo: ../include/net-snmp/pdu_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/debug_handler.lo: ../include/net-snmp/session_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/debug_handler.lo: ../include/net-snmp/mib_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/parse.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/debug_handler.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./helpers/debug_handler.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/debug_handler.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/instance.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/instance.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/instance.lo: ../include/net-snmp/library/types.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/instance.lo: ../include/net-snmp/varbind_api.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/instance.lo: ../include/net-snmp/pdu_api.h
+./helpers/instance.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/instance.lo: ../include/net-snmp/session_api.h
+./helpers/instance.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/instance.lo: ../include/net-snmp/mib_api.h
+./helpers/instance.lo: ../include/net-snmp/library/parse.h
+./helpers/instance.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/instance.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/instance.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/mode_end_call.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/mode_end_call.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/types.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/varbind_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/mode_end_call.lo: ../include/net-snmp/pdu_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/mode_end_call.lo: ../include/net-snmp/session_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/mode_end_call.lo: ../include/net-snmp/mib_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/parse.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/mode_end_call.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/mode_end_call.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/multiplexer.lo: ../include/net-snmp/net-snmp-config.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/oid.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/types.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/varbind_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/multiplexer.lo: ../include/net-snmp/pdu_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/multiplexer.lo: ../include/net-snmp/session_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/multiplexer.lo: ../include/net-snmp/mib_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/parse.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/multiplexer.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./helpers/multiplexer.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/multiplexer.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/null.lo: ../include/net-snmp/net-snmp-config.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/oid.h
+./helpers/null.lo: ../include/net-snmp/library/types.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/null.lo: ../include/net-snmp/varbind_api.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/null.lo: ../include/net-snmp/pdu_api.h
+./helpers/null.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/null.lo: ../include/net-snmp/session_api.h
+./helpers/null.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/null.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/null.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/null.lo: ../include/net-snmp/mib_api.h
+./helpers/null.lo: ../include/net-snmp/library/parse.h
+./helpers/null.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/null.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./helpers/null.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/null.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/old_api.lo: ../include/net-snmp/net-snmp-config.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/oid.h
+./helpers/old_api.lo: ../include/net-snmp/library/types.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/old_api.lo: ../include/net-snmp/varbind_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/old_api.lo: ../include/net-snmp/pdu_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/old_api.lo: ../include/net-snmp/session_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/old_api.lo: ../include/net-snmp/mib_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/parse.h
+./helpers/old_api.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/old_api.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./helpers/old_api.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/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/oid.h
+./helpers/read_only.lo: ../include/net-snmp/library/types.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/read_only.lo: ../include/net-snmp/varbind_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/read_only.lo: ../include/net-snmp/pdu_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/read_only.lo: ../include/net-snmp/session_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/read_only.lo: ../include/net-snmp/mib_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/parse.h
+./helpers/read_only.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/read_only.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./helpers/read_only.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/read_only.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/row_merge.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/row_merge.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/row_merge.lo: ../include/net-snmp/library/types.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/row_merge.lo: ../include/net-snmp/varbind_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/row_merge.lo: ../include/net-snmp/pdu_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/row_merge.lo: ../include/net-snmp/session_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/row_merge.lo: ../include/net-snmp/mib_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/parse.h
+./helpers/row_merge.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/row_merge.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/row_merge.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/scalar.lo: ../include/net-snmp/net-snmp-config.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/oid.h
+./helpers/scalar.lo: ../include/net-snmp/library/types.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/scalar.lo: ../include/net-snmp/varbind_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/scalar.lo: ../include/net-snmp/pdu_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/scalar.lo: ../include/net-snmp/session_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/scalar.lo: ../include/net-snmp/mib_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/parse.h
+./helpers/scalar.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/scalar.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./helpers/scalar.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/scalar_group.lo: ../include/net-snmp/net-snmp-config.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/oid.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/types.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/varbind_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/scalar_group.lo: ../include/net-snmp/pdu_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/scalar_group.lo: ../include/net-snmp/session_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/scalar_group.lo: ../include/net-snmp/mib_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/parse.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/scalar_group.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./helpers/scalar_group.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/scalar_group.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/serialize.lo: ../include/net-snmp/net-snmp-config.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/oid.h
+./helpers/serialize.lo: ../include/net-snmp/library/types.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/serialize.lo: ../include/net-snmp/varbind_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/serialize.lo: ../include/net-snmp/pdu_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/serialize.lo: ../include/net-snmp/session_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/serialize.lo: ../include/net-snmp/mib_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/parse.h
+./helpers/serialize.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/serialize.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./helpers/serialize.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/serialize.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/net-snmp-features.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/definitions.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/types.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/oid.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/types.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/varbind_api.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/pdu_api.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/asn1.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/output_api.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/session_api.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/callback.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/mib.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/mib_api.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/parse.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/getopt.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/utilities.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/system.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/tools.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/int64.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/mt_support.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/data_list.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/container.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/factory.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/container.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/version.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/config_api.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/read_config.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/default_store.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/vacm.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/keytools.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/scapi.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmptsm.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/instance.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/scalar.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/watcher.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/null.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/old_api.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/read_only.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/serialize.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/table.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/table_data.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/table_container.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/table_array.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/mfd.h
+./helpers/snmp_get_statistic.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/stash_cache.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/stash_cache.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/types.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/varbind_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/stash_cache.lo: ../include/net-snmp/pdu_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/stash_cache.lo: ../include/net-snmp/session_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/stash_cache.lo: ../include/net-snmp/mib_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/parse.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/stash_cache.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/stash_to_next.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/stash_cache.h
+./helpers/stash_to_next.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/stash_to_next.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/types.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/varbind_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/stash_to_next.lo: ../include/net-snmp/pdu_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/stash_to_next.lo: ../include/net-snmp/session_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/stash_to_next.lo: ../include/net-snmp/mib_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/parse.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/stash_to_next.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/stash_to_next.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/stash_cache.h
+./helpers/table_array.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_array.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/table_array.lo: ../include/net-snmp/library/types.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_array.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_array.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/table_array.lo: ../include/net-snmp/session_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/table_array.lo: ../include/net-snmp/mib_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/parse.h
+./helpers/table_array.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/table_array.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_array.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/table.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/table.lo: ../include/net-snmp/library/types.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table.lo: ../include/net-snmp/varbind_api.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table.lo: ../include/net-snmp/pdu_api.h
+./helpers/table.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/table.lo: ../include/net-snmp/session_api.h
+./helpers/table.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/table.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/table.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/table.lo: ../include/net-snmp/mib_api.h
+./helpers/table.lo: ../include/net-snmp/library/parse.h
+./helpers/table.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/table.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/table_container.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_container.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/table_container.lo: ../include/net-snmp/library/types.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_container.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_container.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/table_container.lo: ../include/net-snmp/session_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/table_container.lo: ../include/net-snmp/mib_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/parse.h
+./helpers/table_container.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/table_container.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_container.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/table_data.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_data.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/table_data.lo: ../include/net-snmp/library/types.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_data.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_data.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/table_data.lo: ../include/net-snmp/session_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/table_data.lo: ../include/net-snmp/mib_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/parse.h
+./helpers/table_data.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/table_data.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_data.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/table_dataset.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_dataset.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/types.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_dataset.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/table_dataset.lo: ../include/net-snmp/session_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/table_dataset.lo: ../include/net-snmp/mib_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/parse.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/table_dataset.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_dataset.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/table_iterator.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_iterator.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/types.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_iterator.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/table_iterator.lo: ../include/net-snmp/session_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/table_iterator.lo: ../include/net-snmp/mib_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/parse.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/table_iterator.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/net-snmp-features.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/oid.h
+./helpers/table_row.lo: ../include/net-snmp/library/types.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_row.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_row.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/table_row.lo: ../include/net-snmp/session_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/table_row.lo: ../include/net-snmp/mib_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/parse.h
+./helpers/table_row.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/table_row.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_row.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/table_tdata.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_tdata.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/types.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_tdata.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/table_tdata.lo: ../include/net-snmp/session_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/table_tdata.lo: ../include/net-snmp/mib_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/parse.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/table_tdata.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/table_tdata.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./helpers/watcher.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/watcher.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./helpers/watcher.lo: ../include/net-snmp/library/types.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/watcher.lo: ../include/net-snmp/varbind_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/watcher.lo: ../include/net-snmp/pdu_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./helpers/watcher.lo: ../include/net-snmp/session_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./helpers/watcher.lo: ../include/net-snmp/mib_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/parse.h
+./helpers/watcher.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./helpers/watcher.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./helpers/watcher.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./mibgroup/header_complex.lo: ../include/net-snmp/net-snmp-config.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/oid.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/types.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/varbind_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_client.h
+./mibgroup/header_complex.lo: ../include/net-snmp/pdu_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibgroup/header_complex.lo: ../include/net-snmp/session_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibgroup/header_complex.lo: ../include/net-snmp/mib_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/parse.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/oid_stash.h
+./mibgroup/header_complex.lo: ../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibgroup/header_complex.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../include/net-snmp/agent/snmp_get_statistic.h
+./mibgroup/header_complex.lo: ./mibgroup/header_complex.h
+./mibgroup/kernel_sunos5.lo: ../include/net-snmp/net-snmp-config.h
+./mibgroup/testhandler.lo: ../include/net-snmp/net-snmp-config.h
+./mibgroup/testhandler.lo: ../include/net-snmp/net-snmp-features.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/oid.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/types.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/varbind_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_client.h
+./mibgroup/testhandler.lo: ../include/net-snmp/pdu_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibgroup/testhandler.lo: ../include/net-snmp/session_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibgroup/testhandler.lo: ../include/net-snmp/mib_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/parse.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibgroup/testhandler.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../include/net-snmp/agent/snmp_get_statistic.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/net-snmp-features.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/oid.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/types.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/varbind_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_client.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/pdu_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/session_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/mib_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/parse.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/util_funcs.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./mibgroup/util_funcs.lo: ./mibgroup/struct.h ./mibgroup/util_funcs.h
+./mibgroup/util_funcs.lo: ./mibgroup/util_funcs/header_generic.h
+./mibgroup/util_funcs.lo: ./mibgroup/util_funcs/header_simple_table.h
+./mibgroup/util_funcs.lo: ./mibgroup/util_funcs/MIB_STATS_CACHE_TIMEOUT.h
+./mibgroup/util_funcs.lo: ./mibgroup/utilities/execute.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/net-snmp-config.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/net-snmp-features.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/mib_module_config.h
diff --git a/agent/Makefile.in b/agent/Makefile.in
new file mode 100644
index 0000000..748b01c
--- /dev/null
+++ b/agent/Makefile.in
@@ -0,0 +1,345 @@
+#
+# Makefile for snmpd
+#
+
+top_builddir = ..
+mysubdir=agent
+
+# 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
+FTSUBDIRS=mibgroup helpers
+
+INSTALLSBINPROGS= @SNMPD@
+INSTALLLIBS = libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
+INSTALLPOSTLIBS = libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
+
+INCLUDESUBDIR=agent
+HEADERS=\
+ agent_read_config.h \
+ agent_registry.h \
+ agent_index.h \
+ agent_sysORTable.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 \
+ sysORTable.h \
+ 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 \
+ snmp_get_statistic.h \
+ stash_cache.h \
+ stash_to_next.h \
+ table_array.h \
+ table_container.h \
+ table.h \
+ table_data.h \
+ table_dataset.h \
+ table_tdata.h \
+ table_iterator.h \
+ watcher.h
+
+HEADERSONLY=mfd.h set_helper.h
+
+INCLUDESUBDIRHEADERS=$(HEADERS) $(HEADERSONLY)
+
+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=struct.h util_funcs.h util_funcs/header_generic.h \
+ util_funcs/header_simple_table.h util_funcs/MIB_STATS_CACHE_TIMEOUT.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_sysORTable.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)
+AGENTLIB = libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
+MIBLIB = libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
+
+LAGENTLIBS = @LAGENTLIBS@
+LMIBLIBS = @LMIBLIBS@
+VAL_LIBS = @VAL_LIBS@
+PERLLDOPTS_FOR_APPS = @PERLLDOPTS_FOR_APPS@
+PERLLDOPTS_FOR_LIBS = @PERLLDOPTS_FOR_LIBS@
+LIBS = $(USELIBS) @AGENTLIBS@ $(PERLLDOPTS_FOR_APPS) $(VAL_LIBS)
+OUR_AGENT_LIBS = $(AGENTLIB) $(MIBLIB) $(LIBS) @DLLIBS@
+CPPFLAGS = $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(MIBGROUP_INCLUDES) \
+ $(SNMPLIB_INCLUDES) @CPPFLAGS@
+
+
+#
+# Objects
+#
+
+# libnetsnmpmibs objects.
+@mibgroup_list_lo@
+@mibgroup_list_ft@
+@mibgroup_list_o@
+@agentgroup_list_lo@
+@agentgroup_list_ft@
+@agentgroup_list_o@
+FTMIBOBJS = $(mibgroup_list_ft) mib_modules.ft auto_nlist.ft
+LMIBOBJS = $(mibgroup_list_lo) mib_modules.lo auto_nlist.lo
+MIBOBJS = $(mibgroup_list_o) mib_modules.o auto_nlist.o
+
+# libnetsnmpagent objects
+LIBAGENTOBJS= \
+ helpers/all_helpers.o \
+ helpers/baby_steps.o \
+ helpers/bulk_to_next.o \
+ helpers/cache_handler.o \
+ helpers/debug_handler.o \
+ helpers/instance.o \
+ helpers/mode_end_call.o \
+ helpers/multiplexer.o \
+ helpers/null.o \
+ helpers/old_api.o \
+ helpers/read_only.o \
+ helpers/row_merge.o \
+ helpers/scalar.o \
+ helpers/scalar_group.o \
+ helpers/serialize.o \
+ helpers/snmp_get_statistic.o \
+ helpers/stash_cache.o \
+ helpers/stash_to_next.o \
+ helpers/table.o \
+ helpers/table_array.o \
+ helpers/table_container.o \
+ helpers/table_data.o \
+ helpers/table_dataset.o \
+ helpers/table_iterator.o \
+ helpers/table_row.o \
+ helpers/table_tdata.o \
+ helpers/watcher.o \
+ agent_handler.o \
+ agent_index.o \
+ agent_read_config.o \
+ agent_registry.o \
+ agent_sysORTable.o \
+ agent_trap.o \
+ kernel.o \
+ snmp_agent.o \
+ snmp_vars.o \
+ $(agentgroup_list_o) \
+ @OTHERAGENTLIBOBJS@
+
+LLIBAGENTOBJS= \
+ helpers/all_helpers.lo \
+ helpers/baby_steps.lo \
+ helpers/bulk_to_next.lo \
+ helpers/cache_handler.lo \
+ helpers/debug_handler.lo \
+ helpers/instance.lo \
+ helpers/mode_end_call.lo \
+ helpers/multiplexer.lo \
+ helpers/null.lo \
+ helpers/old_api.lo \
+ helpers/read_only.lo \
+ helpers/row_merge.lo \
+ helpers/scalar.lo \
+ helpers/scalar_group.lo \
+ helpers/serialize.lo \
+ helpers/snmp_get_statistic.lo \
+ helpers/stash_cache.lo \
+ helpers/stash_to_next.lo \
+ helpers/table.lo \
+ helpers/table_array.lo \
+ helpers/table_container.lo \
+ helpers/table_data.lo \
+ helpers/table_dataset.lo \
+ helpers/table_iterator.lo \
+ helpers/table_row.lo \
+ helpers/table_tdata.lo \
+ helpers/watcher.lo \
+ agent_handler.lo \
+ agent_index.lo \
+ agent_read_config.lo \
+ agent_registry.lo \
+ agent_sysORTable.lo \
+ agent_trap.lo \
+ kernel.lo \
+ snmp_agent.lo \
+ snmp_vars.lo \
+ $(agentgroup_list_lo) \
+ @OTHERAGENTLIBLOBJS@
+
+LLIBAGENTFTS= \
+ helpers/all_helpers.ft \
+ helpers/baby_steps.ft \
+ helpers/bulk_to_next.ft \
+ helpers/cache_handler.ft \
+ helpers/debug_handler.ft \
+ helpers/instance.ft \
+ helpers/mode_end_call.ft \
+ helpers/multiplexer.ft \
+ helpers/null.ft \
+ helpers/old_api.ft \
+ helpers/read_only.ft \
+ helpers/row_merge.ft \
+ helpers/scalar.ft \
+ helpers/scalar_group.ft \
+ helpers/serialize.ft \
+ helpers/snmp_get_statistic.ft \
+ helpers/stash_cache.ft \
+ helpers/stash_to_next.ft \
+ helpers/table.ft \
+ helpers/table_array.ft \
+ helpers/table_container.ft \
+ helpers/table_data.ft \
+ helpers/table_dataset.ft \
+ helpers/table_iterator.ft \
+ helpers/table_row.ft \
+ helpers/table_tdata.ft \
+ helpers/watcher.ft \
+ agent_handler.ft \
+ agent_index.ft \
+ agent_read_config.ft \
+ agent_registry.ft \
+ agent_sysORTable.ft \
+ agent_trap.ft \
+ kernel.ft \
+ snmp_agent.ft \
+ snmp_vars.ft \
+ $(agentgroup_list_ft) \
+ @OTHERAGENTLIBLFTS@
+
+# The agent objects.
+AGENTOBJS=snmpd.o @other_agentobjs@
+LAGENTOBJS=snmpd.lo @other_lagentobjs@
+FTAGENTOBJS=snmpd.ft @other_ftagentobjs@
+
+#
+# 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
+FTOBJS = $(LLIBAGENTFTS) $(FTAGENTOBJS) mib_modules.ft auto_nlist.ft
+
+FEATUREFILE = $(top_builddir)/include/net-snmp/agent/features.h
+
+all: agentlib subdirs miblib $(INSTALLBINPROGS) $(INSTALLSBINPROGS)
+
+#
+# build stuff targets
+#
+getkstat: getkstat.o
+ $(CC) $(CFLAGS) -o $@ $? $(LIBS)
+
+getkstat.o: mibgroup/kernel_sunos5.c
+ $(CC) $(CFLAGS) -o $@ -D_GETKSTAT_TEST -DDODEBUG -c $?
+
+getmibstat: getmibstat.o
+ $(CC) $(CFLAGS) -o $@ $? $(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} ${LDFLAGS} ${OUR_AGENT_LIBS}
+
+libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS)
+ $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@
+ $(RANLIB) $(AGENTLIB)
+
+libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION): ${LMIBOBJS} $(AGENTLIB) $(USELIBS)
+ $(LIB_LD_CMD) $(MIBLIB) ${LMIBOBJS} $(AGENTLIB) $(USELIBS) @LD_NO_UNDEFINED@ $(LDFLAGS) ${LMIBLIBS} $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@
+ $(RANLIB) $(MIBLIB)
+
+agentlib: $(AGENTLIB)
+
+miblib: $(MIBLIB)
+
+libs: $(AGENTLIB) $(MIBLIB)
+
+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:
+ @for it in $(INCLUDEMIBGROUPDIRHEADERS) ; do \
+ itd=`dirname "$(INSTALL_PREFIX)$(includedir)/agent/$$it"` ; \
+ if [ ! -d "$$itd" ] ; then \
+ echo "creating directory $$itd" ; \
+ $(SHELL) "$(top_srcdir)/mkinstalldirs" "$$itd" ; \
+ fi ; \
+ $(INSTALL_DATA) "$(top_srcdir)/$(INCLUDEMIBGROUPDIR)/$$it" \
+ "$$itd" ; \
+ echo "installing $$it in $$itd" ; \
+ done
+
+@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.
+
+subdirs: agentlib
+# wait for agentlib before building 'subdirs' target
+
diff --git a/agent/agent_handler.c b/agent/agent_handler.c
new file mode 100644
index 0000000..59e9613
--- /dev/null
+++ b/agent/agent_handler.c
@@ -0,0 +1,1332 @@
+/* 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-features.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>
+
+netsnmp_feature_child_of(agent_handler, libnetsnmpagent)
+
+netsnmp_feature_child_of(handler_mark_requests_as_delegated, agent_handler)
+
+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 MIB handler structure.
+ * The new structure is allocated and filled using the given name
+ * and 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 MIB handler structure.
+ * The new structure is allocated and filled using the given name,
+ * access function, registration location OID and list of modes that
+ * 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,
+ const 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);
+ the_reg->rootoid = snmp_duplicate_objid(reg_oid, reg_oid_len);
+ the_reg->rootoid_len = reg_oid_len;
+ return the_reg;
+}
+
+/** Creates a handler registration structure with a new MIB handler.
+ * This function first @link netsnmp_create_handler() creates @endlink
+ * a MIB handler, then @link netsnmp_handler_registration_create()
+ * makes registation structure @endlink for it.
+ *
+ * @param name is the handler name for netsnmp_create_handler()
+ *
+ * @param handler_access_method is a function pointer used as the access
+ * method for netsnmp_create_handler()
+ *
+ * @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, as in
+ * netsnmp_handler_registration_create()
+ *
+ * @return Returns a pointer to a netsnmp_handler_registration struct.
+ * If the structures creation failed, NULL is returned.
+ *
+ * @see netsnmp_create_handler()
+ * @see netsnmp_handler_registration_create()
+ */
+netsnmp_handler_registration *
+netsnmp_create_handler_registration(const char *name,
+ Netsnmp_Node_Handler *
+ handler_access_method, const oid * reg_oid,
+ size_t reg_oid_len, int modes)
+{
+ netsnmp_handler_registration *rv = NULL;
+ netsnmp_mib_handler *handler =
+ netsnmp_create_handler(name, handler_access_method);
+ if (handler) {
+ rv = netsnmp_handler_registration_create(
+ name, handler, reg_oid, reg_oid_len, modes);
+ if (!rv)
+ netsnmp_handler_free(handler);
+ }
+ return rv;
+}
+
+/** Registers a MIB handler inside the registration structure.
+ * Checks given registation handler for sanity, then
+ * @link netsnmp_register_mib() performs registration @endlink
+ * in the MIB tree, as defined by the netsnmp_handler_registration
+ * pointer. On success, SNMP_CALLBACK_APPLICATION is called.
+ * The registration struct may be created by call of
+ * netsnmp_create_handler_registration().
+ *
+ * @param reginfo Pointer to a netsnmp_handler_registration struct.
+ *
+ * @return Returns SNMPERR_SUCCESS or SNMP_ERR_* error code.
+ *
+ * @see netsnmp_create_handler_registration()
+ * @see netsnmp_register_mib()
+ */
+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);
+}
+
+/** Unregisters a MIB handler described inside the registration structure.
+ * Removes a registration, performed earlier by
+ * netsnmp_register_handler(), from the MIB tree.
+ * Uses unregister_mib_context() to do the task.
+ *
+ * @param reginfo Pointer to a netsnmp_handler_registration struct.
+ *
+ * @return Returns SNMPERR_SUCCESS or SNMP_ERR_* error code.
+ *
+ * @see netsnmp_register_handler()
+ * @see unregister_mib_context()
+ */
+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);
+}
+
+/** Registers a MIB handler inside the registration structure.
+ * Checks given registation handler for sanity, then
+ * @link netsnmp_register_mib() performs registration @endlink
+ * in the MIB tree, as defined by the netsnmp_handler_registration
+ * pointer. Never calls SNMP_CALLBACK_APPLICATION.
+ * The registration struct may be created by call of
+ * netsnmp_create_handler_registration().
+ *
+ * @param reginfo Pointer to a netsnmp_handler_registration struct.
+ *
+ * @return Returns SNMPERR_SUCCESS or SNMP_ERR_* error code.
+ *
+ * @see netsnmp_create_handler_registration()
+ * @see netsnmp_register_mib()
+ */
+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);
+}
+
+/** Injects handler into the calling chain of handlers.
+ * The given MIB handler is inserted after the handler named before_what.
+ * If before_what is NULL, the handler is put at the top of the list,
+ * and hence will be the handler to be called first.
+ *
+ * @return Returns SNMPERR_SUCCESS or SNMP_ERR_* error code.
+ *
+ * @see netsnmp_create_handler_registration()
+ * @see netsnmp_inject_handler()
+ */
+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;
+}
+
+/** Injects handler into the calling chain of handlers.
+ * The given MIB handler is put at the top of the list,
+ * and hence will be the handler to be called first.
+ *
+ * @return Returns SNMPERR_SUCCESS or SNMP_ERR_* error code.
+ *
+ * @see netsnmp_create_handler_registration()
+ * @see netsnmp_inject_handler_before()
+ */
+int
+netsnmp_inject_handler(netsnmp_handler_registration *reginfo,
+ netsnmp_mib_handler *handler)
+{
+ return netsnmp_inject_handler_before(reginfo, handler, NULL);
+}
+
+/** Calls a MIB handlers chain, starting with specific handler.
+ * The given arguments and MIB handler are checked
+ * for sanity, then the handlers are called, one by one,
+ * until next handler is NULL.
+ *
+ * @return Returns SNMPERR_SUCCESS or SNMP_ERR_* error code.
+ */
+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;
+}
+
+/** @private
+ * Calls all the MIB Handlers in registration struct for a given mode.
+ *
+ * @return Returns SNMPERR_SUCCESS or SNMP_ERR_* error code.
+ */
+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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+}
+
+/** @private
+ * Calls the next MIB handler in the chain, after the current one.
+ * The given arguments and MIB handler are checked
+ * for sanity, then the next handler is called.
+ *
+ * @return Returns SNMPERR_SUCCESS or SNMP_ERR_* error code.
+ */
+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);
+}
+
+/** @private
+ * Calls the next MIB handler in the chain, after the current one.
+ * The given arguments and MIB handler are not validated before
+ * the call, only request is checked.
+ *
+ * @return Returns SNMPERR_SUCCESS or SNMP_ERR_* error code.
+ */
+netsnmp_feature_child_of(netsnmp_call_next_handler_one_request,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_CALL_NEXT_HANDLER_ONE_REQUEST
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_CALL_NEXT_HANDLER_ONE_REQUEST */
+
+/** Deallocates resources associated with a given handler.
+ * The handler is removed from chain and then freed.
+ * After calling this function, the handler pointer is invalid
+ * and should be set to NULL.
+ *
+ * @param handler is the MIB Handler to be freed
+ */
+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;
+ }
+ if ((handler->myvoid != NULL) && (handler->data_free != NULL))
+ {
+ handler->data_free(handler->myvoid);
+ }
+ SNMP_FREE(handler->handler_name);
+ SNMP_FREE(handler);
+ }
+}
+
+/** Duplicates a MIB handler and all subsequent handlers.
+ * Creates a copy of all data in given handlers chain.
+ *
+ * @param handler is the MIB Handler to be duplicated
+ *
+ * @return Returns a pointer to the complete copy,
+ * or NULL if any problem occured.
+ *
+ * @see _clone_handler()
+ */
+netsnmp_mib_handler *
+netsnmp_handler_dup(netsnmp_mib_handler *handler)
+{
+ netsnmp_mib_handler *h = NULL;
+
+ if (!handler)
+ goto err;
+
+ h = _clone_handler(handler);
+ if (!h)
+ goto err;
+
+ /*
+ * Providing a clone function without a free function is asking for
+ * memory leaks, and providing a free function without clone function
+ * is asking for memory corruption. Hence the log statement below.
+ */
+ if (!!handler->data_clone != !!handler->data_free)
+ snmp_log(LOG_ERR, "data_clone / data_free inconsistent (%s)\n",
+ handler->handler_name);
+ if (handler->myvoid && handler->data_clone) {
+ h->myvoid = handler->data_clone(handler->myvoid);
+ if (!h->myvoid)
+ goto err;
+ } else
+ h->myvoid = handler->myvoid;
+ h->data_clone = handler->data_clone;
+ h->data_free = handler->data_free;
+
+ if (handler->next != NULL) {
+ h->next = netsnmp_handler_dup(handler->next);
+ if (!h->next)
+ goto err;
+ h->next->prev = h;
+ }
+ h->prev = NULL;
+ return h;
+
+err:
+ netsnmp_handler_free(h);
+ return NULL;
+}
+
+/** Free resources associated with a handler registration object.
+ * The registration object and all MIB Handlers in the chain are
+ * freed. When the function ends, given pointer is no longer valid
+ * and should be set to NULL.
+ *
+ * @param reginfo is the handler registration object to be freed
+ */
+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 handler registration object and all subsequent handlers.
+ * Creates a copy of the handler registration object and all its data.
+ *
+ * @param reginfo is the handler registration object to be duplicated
+ *
+ * @return Returns a pointer to the complete copy,
+ * or NULL if any problem occured.
+ *
+ * @see netsnmp_handler_dup()
+ */
+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) {
+ r->rootoid =
+ snmp_duplicate_objid(reginfo->rootoid, reginfo->rootoid_len);
+ 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.
+ * The cache is filled with pointers from parameters. Note that
+ * the input structures are not duplicated, but put directly into
+ * the new cache struct.
+ * Use netsnmp_handler_check_cache() later to make sure it's still
+ * valid before referencing it in the future.
+ *
+ * @see netsnmp_handler_check_cache()
+ * @see netsnmp_free_delegated_cache()
+ */
+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 if a given delegated cache is still valid.
+ * The cache is valid if it's a part of transaction
+ * (ie, the agent still considers it to be an outstanding request).
+ *
+ * @param dcache is the delegated cache to be checked.
+ *
+ * @return Returns the cache pointer if it is still valid, NULL otherwise.
+ *
+ * @see netsnmp_create_delegated_cache()
+ * @see netsnmp_free_delegated_cache()
+ */
+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;
+}
+
+/** Free a cache once it's no longer used.
+ * Deletes the data allocated by netsnmp_create_delegated_cache().
+ * Structures which were not allocated by netsnmp_create_delegated_cache()
+ * are not freed (pointers are dropped).
+ *
+ * @param dcache is the delegated cache to be freed.
+ *
+ * @see netsnmp_create_delegated_cache()
+ * @see netsnmp_handler_check_cache()
+ */
+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;
+}
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_HANDLER_MARK_REQUESTS_AS_DELEGATED
+/** Sets a list of requests as delegated or not delegated.
+ * Sweeps through given chain of requests and sets 'delegated'
+ * flag accordingly to the isdelegaded parameter.
+ *
+ * @param requests Request list.
+ * @param isdelegated New value of the 'delegated' flag.
+ */
+void
+netsnmp_handler_mark_requests_as_delegated(netsnmp_request_info *requests,
+ int isdelegated)
+{
+ while (requests) {
+ requests->delegated = isdelegated;
+ requests = requests->next;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_HANDLER_MARK_REQUESTS_AS_DELEGATED */
+
+/** Adds data from node list to the request information structure.
+ * Data in the request can be later extracted and used by submodules.
+ *
+ * @param request Destination request information structure.
+ *
+ * @param node The data to be added to the linked list
+ * request->parent_data.
+ *
+ * @see netsnmp_request_remove_list_data()
+ * @see netsnmp_request_get_list_data()
+ */
+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;
+ }
+}
+
+/** Removes all 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.
+ *
+ * @see netsnmp_request_add_list_data()
+ * @see netsnmp_request_get_list_data()
+ */
+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);
+}
+
+/** Extracts data from a request.
+ * Retrieves data that was previously added to the request,
+ * usually by a parent module.
+ *
+ * @param request Source request information structure.
+ *
+ * @param name Used to compare against the request->parent_data->name value;
+ * if a match is found, request->parent_data->data is returned.
+ *
+ * @return Gives a void pointer(request->parent_data->data); NULL is
+ * returned if source data is NULL or the object is not found.
+ *
+ * @see netsnmp_request_add_list_data()
+ * @see netsnmp_request_remove_list_data()
+ */
+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.
+ * Deletes the data in given request only. Other chain items
+ * are unaffected.
+ *
+ * @param request Request information structure to be modified.
+ *
+ * @see netsnmp_request_add_list_data()
+ * @see netsnmp_free_list_data()
+ */
+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.
+ * Deletes all data in the chain inside request.
+ *
+ * @param request Request information structure to be modified.
+ *
+ * @see netsnmp_request_add_list_data()
+ * @see netsnmp_free_request_data_set()
+ */
+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 MIB handler from a chain based on the name.
+ *
+ * @param reginfo Handler registration struct which contains the chain.
+ *
+ * @param name Target MIB Handler name string. The name is case
+ * sensitive.
+ *
+ * @return The MIB Handler is returned, or NULL if not found.
+ *
+ * @see netsnmp_request_add_list_data()
+ */
+netsnmp_mib_handler *
+netsnmp_find_handler_by_name(netsnmp_handler_registration *reginfo,
+ const char *name)
+{
+ netsnmp_mib_handler *it;
+ if (reginfo == NULL || name == NULL )
+ return NULL;
+ 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.
+ *
+ * @warning The void pointer data may change as a handler evolves.
+ * Handlers should really advertise some function for you
+ * to use instead.
+ *
+ * @param reginfo Handler registration struct which contains the chain.
+ *
+ * @param name Target MIB Handler name string. The name is case
+ * sensitive.
+ *
+ * @return The MIB Handler's void * pointer is returned,
+ * or NULL if the handler is not found.
+ *
+ * @see netsnmp_find_handler_by_name()
+ */
+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;
+}
+
+/** @private
+ * Clones a MIB Handler with its basic properties.
+ * Creates a copy of the given MIB Handler. Copies name, flags and
+ * access methods only; not myvoid.
+ *
+ * @see 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 *handler)
+{
+ netsnmp_handler_free((netsnmp_mib_handler *)handler);
+}
+
+/** Registers a given handler by name, so that it can be found easily later.
+ * Pointer to the handler is put into a list where it can be easily located
+ * at any time.
+ *
+ * @param name Name string to be associated with the handler.
+ *
+ * @param handler Pointer the MIB Handler.
+ *
+ * @see netsnmp_clear_handler_list()
+ */
+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 MIB Handlers registration list.
+ * MIB Handlers registration list is used to access any MIB Handler by
+ * its name. The function frees the list memory and sets pointer to NULL.
+ * Instead of calling this function directly, use shutdown_agent().
+ *
+ * @see shutdown_agent()
+ * @see netsnmp_register_handler_by_name()
+ */
+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;
+}
+
+/** @private
+ * 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(("injectHandler",
+ "not injecting handler into %s\n",
+ mh->handler_name));
+ }
+ }
+ }
+ }
+}
+
+static int doneit = 0;
+/** @private
+ * 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_mib_handler*)netsnmp_get_list_data(handler_reg, handler_to_insert);
+ if (!handler) {
+ netsnmp_config_error("no \"%s\" handler registered.",
+ handler_to_insert);
+ 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);
+ }
+}
+
+/** @private
+ * 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_inject_handler_done(int majorID, int minorID,
+ void *serverarg, void *clientarg)
+{
+ doneit = 1;
+ return 0;
+}
+
+/** @private
+ * Registers the injectHandle parser token.
+ * Used in init_agent_read_config().
+ *
+ * @see init_agent_read_config()
+ */
+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_inject_handler_done, 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);
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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);
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * 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/agent/agent_index.c b/agent/agent_index.c
new file mode 100644
index 0000000..ce8f8ca
--- /dev/null
+++ b/agent/agent_index.c
@@ -0,0 +1,872 @@
+/*
+ * 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 <net-snmp/net-snmp-features.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 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_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
+
+netsnmp_feature_child_of(agent_index_all, libnetsnmpagent)
+
+netsnmp_feature_child_of(remove_index, agent_index_all)
+
+ /*
+ * 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 = (char *)malloc(res->val_len + 1);
+ if (rv) {
+ memcpy(rv, res->val.string, res->val_len);
+ rv[res->val_len] = 0;
+ }
+ 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 %8p\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 (NULL == 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
+ */
+netsnmp_feature_child_of(release_index,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_RELEASE_INDEX
+int
+release_index(netsnmp_variable_list * varbind)
+{
+ return (unregister_index(varbind, TRUE, NULL));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_RELEASE_INDEX */
+
+#ifndef NETSNMP_FEATURE_REMOVE_REMOVE_INDEX
+ /*
+ * 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));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REMOVE_INDEX */
+
+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;
+}
+
+netsnmp_feature_child_of(unregister_indexes,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_UNREGISTER_INDEXES
+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));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UNREGISTER_INDEXES */
+
+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);
+ }
+}
+
+netsnmp_feature_child_of(count_indexes, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_UNUSED
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UNUSED */
+
+#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/agent/agent_read_config.c b/agent/agent_read_config.c
new file mode 100644
index 0000000..f9ef1af
--- /dev/null
+++ b/agent/agent_read_config.c
@@ -0,0 +1,338 @@
+/*
+ * agent_read_config.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#else
+#include <sys/types.h>
+#endif
+#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
+# 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_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
+#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"
+
+netsnmp_feature_child_of(agent_read_config_all, libnetsnmpagent)
+
+netsnmp_feature_child_of(snmpd_unregister_config_handler, agent_read_config_all)
+
+#ifdef HAVE_UNISTD_H
+void
+snmpd_set_agent_user(const char *token, char *cptr)
+{
+ 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 {
+ struct passwd *info;
+
+ info = getpwnam(cptr);
+ if (info)
+ 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 (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 {
+ struct group *info;
+
+ info = getgrnam(cptr);
+ if (info)
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_GROUPID, info->gr_gid);
+ else
+ config_perror("Group not found in group database");
+ endgrent();
+#endif
+ }
+}
+#endif
+
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+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
+ */
+ snprintf(buf, sizeof(buf), "%s,%s", ptr, cptr);
+ buf[sizeof(buf) - 1] = '\0';
+ } else {
+ strlcpy(buf, cptr, sizeof(buf));
+ }
+
+ DEBUGMSGTL(("snmpd_ports", "port spec: %s\n", buf));
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS, buf);
+}
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+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 */
+ netsnmp_ds_register_config(ASN_OCTET_STR, app, "v1trapaddress",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_TRAP_ADDR);
+#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
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ register_app_config_handler("agentaddress",
+ snmpd_set_agent_address, NULL,
+ "SNMP bind address");
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ 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();
+ 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_register_const_config_handler(const char *token,
+ void (*parser) (const char *, const 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, (void(*)(const char *, char *))parser,
+ releaser, help);
+}
+
+#ifdef NETSNMP_FEATURE_REQUIRE_SNMPD_UNREGISTER_CONFIG_HANDLER
+netsnmp_feature_require(unregister_app_config_handler)
+#endif /* NETSNMP_FEATURE_REQUIRE_SNMPD_UNREGISTER_CONFIG_HANDLER */
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMPD_UNREGISTER_CONFIG_HANDLER
+void
+snmpd_unregister_config_handler(const char *token)
+{
+ unregister_app_config_handler(token);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMPD_UNREGISTER_CONFIG_HANDLER */
+
+/*
+ * 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/agent/agent_registry.c b/agent/agent_registry.c
new file mode 100644
index 0000000..1e2482a
--- /dev/null
+++ b/agent/agent_registry.c
@@ -0,0 +1,2421 @@
+/*
+ * 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 Registry of MIB subtrees, modules, sessions, etc
+ * Maintain a registry of MIB subtrees, together with related information
+ * regarding MIB modules, sessions, etc
+ * @ingroup agent
+ *
+ * @{
+ */
+
+#define IN_SNMP_VARS_C
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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 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_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/library/snmp_assert.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
+
+netsnmp_feature_child_of(agent_registry_all, libnetsnmpagent)
+
+netsnmp_feature_child_of(unregister_mib_table_row, agent_registry_all)
+
+/** @defgroup agent_lookup_cache Lookup cache, storing the registered OIDs.
+ * Maintain the cache used for locating sub-trees and OIDs.
+ * @ingroup agent_registry
+ *
+ * @{
+ */
+
+/** Lookup cache - default size.*/
+#define SUBTREE_DEFAULT_CACHE_SIZE 8
+/** Lookup cache - max acceptable size.*/
+#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.
+ * Note that it is only used by master agent - sub-agent doesn't need the cache.
+ * The rough guide is that the cache size should be equal to the maximum
+ * number of simultaneous 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.
+ *
+ * @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
+ */
+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
+ * Should be called from master agent only - sub-agent doesn't need the cache.
+ *
+ * @return the current lookup cache size
+ */
+int
+netsnmp_get_lookup_cache_size(void) {
+ return lookup_cache_size;
+}
+
+/** Returns lookup cache entry for the context of given name.
+ *
+ * @param context Name of the context. Name is case sensitive.
+ *
+ * @return the lookup cache context
+ */
+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;
+}
+
+/** Adds an entry to the Lookup Cache under specified context name.
+ *
+ * @param context Name of the context. Name is case sensitive.
+ *
+ * @param next Next subtree item.
+ *
+ * @param previous Previous subtree item.
+ */
+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;
+}
+
+/** @private
+ * Replaces next and previous pointer in given Lookup Cache.
+ *
+ * @param ptr Lookup Cache pointer.
+ *
+ * @param next Next subtree item.
+ *
+ * @param previous Previous subtree item.
+ */
+NETSNMP_STATIC_INLINE void
+lookup_cache_replace(lookup_cache *ptr,
+ netsnmp_subtree *next, netsnmp_subtree *previous) {
+
+ ptr->next = next;
+ ptr->previous = previous;
+}
+
+/** Finds an entry in the Lookup Cache.
+ *
+ * @param context Case sensitive name of the context.
+ *
+ * @param name The OID we're searching for.
+ *
+ * @param name_len Number of sub-ids (single integers) in the OID.
+ *
+ * @param retcmp Value set to snmp_oid_compare() call result.
+ * The value, if set, is always nonnegative.
+ *
+ * @return gives Lookup Cache entry, or NULL if not found.
+ *
+ * @see snmp_oid_compare()
+ */
+NETSNMP_STATIC_INLINE lookup_cache *
+lookup_cache_find(const char *context, const 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;
+}
+
+/** @private
+ * Clears cache count and position in Lookup Cache.
+ */
+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;
+ }
+}
+
+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; /* !!! */
+}
+
+/** @} */
+/* End of Lookup cache code */
+
+/** @defgroup agent_context_cache Context cache, storing the OIDs under their contexts.
+ * Maintain the cache used for locating sub-trees registered under different contexts.
+ * @ingroup agent_registry
+ *
+ * @{
+ */
+subtree_context_cache *context_subtrees = NULL;
+
+/** Returns the top element of context subtrees cache.
+ * Use it if you wish to sweep through the cache elements.
+ * Note that the return may be NULL (cache may be empty).
+ *
+ * @return pointer to topmost context subtree cache element.
+ */
+subtree_context_cache *
+get_top_context_cache(void)
+{
+ return context_subtrees;
+}
+
+/** Finds the first subtree registered under given context.
+ *
+ * @param context_name Text name of the context we're searching for.
+ *
+ * @return pointer to the first subtree element, or NULL if not found.
+ */
+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;
+}
+
+/** Adds the subtree to Context Cache under given context name.
+ *
+ * @param context_name Text name of the context we're adding.
+ *
+ * @param new_tree The subtree to be added.
+ *
+ * @return copy of the new_tree pointer, or NULL if cannot add.
+ */
+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;
+}
+
+void
+netsnmp_remove_subtree(netsnmp_subtree *tree)
+{
+ subtree_context_cache *ptr;
+
+ if (!tree->prev) {
+ for (ptr = context_subtrees; ptr; ptr = ptr->next)
+ if (ptr->first_subtree == tree)
+ break;
+ netsnmp_assert(ptr);
+ if (ptr)
+ ptr->first_subtree = tree->next;
+ } else
+ tree->prev->next = tree->next;
+
+ if (tree->next)
+ tree->next->prev = tree->prev;
+}
+
+/** Replaces first subtree registered under given context name.
+ * Overwrites a subtree pointer in Context Cache for the context name.
+ * The previous subtree pointer is lost. If there's no subtree
+ * under the supplied name, then a new cache item is created.
+ *
+ * @param new_tree The new subtree to be set.
+ *
+ * @param context_name Text name of the context we're replacing.
+ * It is case sensitive.
+ *
+ * @return copy of the new_tree pointer, or NULL on error.
+ */
+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);
+}
+
+
+void clear_subtree (netsnmp_subtree *sub);
+
+/** Completely clears both the Context cache and the Lookup cache.
+ */
+void
+clear_context(void) {
+
+ subtree_context_cache *ptr = NULL, *next = NULL;
+ netsnmp_subtree *t, *u;
+
+ DEBUGMSGTL(("agent_registry", "clear context\n"));
+
+ ptr = get_top_context_cache();
+ while (ptr) {
+ next = ptr->next;
+
+ for (t = ptr->first_subtree; t; t = u) {
+ u = t->next;
+ clear_subtree(t);
+ }
+
+ free(NETSNMP_REMOVE_CONST(char*, ptr->context_name));
+ SNMP_FREE(ptr);
+
+ ptr = next;
+ }
+ context_subtrees = NULL; /* !!! */
+ clear_lookup_cache();
+}
+
+/** @} */
+/* End of Context cache code */
+
+/** @defgroup agent_mib_subtree Maintaining MIB subtrees.
+ * Maintaining MIB nodes and subtrees.
+ * @ingroup agent_registry
+ *
+ * @{
+ */
+
+static void register_mib_detach_node(netsnmp_subtree *s);
+
+/** Frees single subtree item.
+ * Deallocated memory for given netsnmp_subtree item, including
+ * Handle Registration structure stored inside this item.
+ * After calling this function, the pointer is invalid
+ * and should be set to NULL.
+ *
+ * @param a The subtree item to dispose.
+ */
+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);
+ }
+}
+
+/** Creates deep copy of a subtree item.
+ * Duplicates all properties stored in the structure, including
+ * Handle Registration structure stored inside the item.
+ *
+ * @param a The subtree item to copy.
+ *
+ * @return deep copy of the subtree item, or NULL on error.
+ */
+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;
+}
+
+/** @private
+ * Replaces next subtree pointer in given subtree.
+ */
+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);
+}
+
+/** @private
+ * Replaces previous subtree pointer in given subtree.
+ */
+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);
+}
+
+netsnmp_feature_child_of(netsnmp_subtree_compare,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_SUBTREE_COMPARE
+/** Compares OIDs of given subtrees.
+ *
+ * @param ap,bp Pointers to the subtrees to be compared.
+ *
+ * @return OIDs lexicographical comparison result.
+ *
+ * @see snmp_oid_compare()
+ */
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_SUBTREE_COMPARE */
+
+/** Joins the given subtree with the current tree.
+ * Trees are joined and the one supplied as parameter is freed.
+ *
+ * @param root The subtree to be merged with current subtree.
+ * Do not use the pointer after joining - it may be invalid.
+ */
+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.
+ * Subtrees of the given OID and separated and formed into the
+ * returned subtree.
+ *
+ * @param current The element at which splitting is started.
+ *
+ * @param name The OID we'd like to split.
+ *
+ * @param name_len Length of the OID.
+ *
+ * @return head of 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;
+ }
+
+ 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;
+}
+
+/** Loads the subtree under given context name.
+ *
+ * @param new_sub The subtree to be loaded into current subtree.
+ *
+ * @param context_name Text name of the context we're searching for.
+ *
+ * @return gives MIB_REGISTERED_OK on success, error code otherwise.
+ */
+int
+netsnmp_subtree_load(netsnmp_subtree *new_sub, const char *context_name)
+{
+ netsnmp_subtree *tree1, *tree2;
+ netsnmp_subtree *prev, *next;
+
+ 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) {
+ netsnmp_subtree *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. */
+
+ switch (snmp_oid_compare(new_sub->end_a, new_sub->end_len,
+ tree1->end_a, tree1->end_len)) {
+
+ 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 */
+ size_t out_len = 0;
+ size_t buf_len = 0;
+ char *buf = NULL;
+ int buf_overflow = 0;
+
+ netsnmp_sprint_realloc_objid((u_char **) &buf, &buf_len, &out_len,
+ 1, &buf_overflow,
+ new_sub->start_a,
+ new_sub->start_len);
+ snmp_log(LOG_ERR,
+ "duplicate registration: MIB modules %s and %s (oid %s%s).\n",
+ next->label_a, new_sub->label_a,
+ buf ? buf : "",
+ buf_overflow ? " [TRUNCATED]" : "");
+ free(buf);
+ }
+ 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. */
+ {
+ netsnmp_subtree *new2 =
+ netsnmp_subtree_split(new_sub, tree1->end_a,tree1->end_len);
+ int res = netsnmp_subtree_load(new_sub, context_name);
+ if (res != MIB_REGISTERED_OK) {
+ netsnmp_remove_subtree(new2);
+ netsnmp_subtree_free(new2);
+ return res;
+ }
+ return netsnmp_subtree_load(new2, context_name);
+ }
+ }
+ }
+ return 0;
+}
+
+/** Free the given subtree and all its children.
+ *
+ * @param sub Subtree branch to be cleared and freed.
+ * After the call, this pointer is invalid
+ * and should be set to NULL.
+ */
+void
+clear_subtree (netsnmp_subtree *sub) {
+
+ netsnmp_subtree *c;
+
+ if (sub == NULL)
+ return;
+
+ for(c = sub; c;) {
+ sub = c;
+ c = c->children;
+ netsnmp_subtree_free(sub);
+ }
+
+}
+
+netsnmp_subtree *
+netsnmp_subtree_find_prev(const 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 = %lu, in off = %lu test = %d\n",
+ (unsigned long)myptr->oid_off, (unsigned long)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(const 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(const 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;
+}
+
+/** @} */
+/* End of Subtrees maintaining code */
+
+/** @defgroup agent_mib_registering Registering and unregistering MIB subtrees.
+ * Adding and removing MIB nodes to the database under their contexts.
+ * @ingroup agent_registry
+ *
+ * @{
+ */
+
+
+/** Registers a MIB handler.
+ *
+ * @param moduleName
+ * @param var
+ * @param varsize
+ * @param numvars
+ * @param mibloc
+ * @param mibloclen
+ * @param priority
+ * @param range_subid
+ * @param range_ubound
+ * @param ss
+ * @param context
+ * @param timeout
+ * @param flags
+ * @param reginfo Registration handler structure.
+ * In a case of failure, it will be freed.
+ * @param perform_callback
+ *
+ * @return gives MIB_REGISTERED_OK or MIB_* error code.
+ *
+ * @see netsnmp_register_handler()
+ * @see register_agentx_list()
+ * @see netsnmp_handler_registration_free()
+ */
+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;
+ 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) {
+ int i;
+ 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_remove_subtree(sub2);
+ 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;
+ reg_parms.session = ss;
+ reg_parms.reginfo = reginfo;
+ 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;
+}
+
+/** @private
+ * 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;
+ reg_parms.session = s->session;
+ reg_parms.reginfo = s->reginfo;
+ /* XXX: missing in subtree: reg_parms.contextName = s->context; */
+ 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);
+ }
+ }
+ }
+}
+
+/** @private
+ * Mark a node as detached.
+ *
+ * @param s The note to be marked
+ */
+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 the subagent is being shut down.
+ */
+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);
+ }
+ }
+ }
+}
+
+/** Register a new module into the MIB database, with all possible custom options
+ *
+ * @param moduleName Text name of the module.
+ * The given name will be used to identify the module
+ * inside the agent.
+ *
+ * @param var Array of variables to be registered in the module.
+ *
+ * @param varsize Size of a single variable in var array.
+ * The size is normally equal to sizeof(struct variable),
+ * but if we wish to use shorter (or longer) OIDs, then we
+ * could use different variant of the variable structure.
+ *
+ * @param numvars Number of variables in the var array.
+ * This is how many variables the function will try to register.
+ *
+ * @param mibloc Base OID of the module.
+ * All OIDs in var array should be sub-oids of the base OID.
+ *
+ * @param mibloclen Length of the base OID.
+ * Number of integers making up the base OID.
+ *
+ * @param priority Registration priority.
+ * Used to achieve a desired configuration when different
+ * sessions register identical or overlapping regions.
+ * Primarily used with AgentX subagent registrations.
+ *
+ * @param range_subid If non-zero, the module is registered against a range
+ * of OIDs, with this parameter identifying the relevant
+ * subidentifier - see RFC 2741 for details.
+ * Typically used to register a single row of a table.
+ * If zero, then register the module against the full OID subtree.
+ *
+ * @param range_ubound The end of the range being registered (see RFC 2741)
+ * If range_subid is zero, then this parameter is ignored.
+ *
+ * @param ss
+ * @param context
+ * @param timeout
+ * @param flags
+ *
+ * @return gives SNMPERR_SUCCESS or SNMPERR_* error code.
+ *
+ * @see register_mib()
+ * @see register_mib_priority()
+ * @see register_mib_range()
+ * @see unregister_mib()
+ */
+int
+register_mib_context(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ const 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);
+}
+
+/** Register a new module into the MIB database, as being responsible
+ * for a range of OIDs (typically a single row of a table).
+ *
+ * @param moduleName Text name of the module.
+ * The given name will be used to identify the module
+ * inside the agent.
+ *
+ * @param var Array of variables to be registered in the module.
+ *
+ * @param varsize Size of a single variable in var array.
+ * The size is normally equal to sizeof(struct variable),
+ * but if we wish to use shorter (or longer) OIDs, then we
+ * could use different variant of the variable structure.
+ *
+ * @param numvars Number of variables in the var array.
+ * This is how many variables the function will try to register.
+ *
+ * @param mibloc Base OID of the module.
+ * All OIDs in var array should be sub-oids of the base OID.
+ *
+ * @param mibloclen Length of the base OID.
+ * Number of integers making up the base OID.
+ *
+ * @param priority Registration priority.
+ * Used to achieve a desired configuration when different
+ * sessions register identical or overlapping regions.
+ * Primarily used with AgentX subagent registrations.
+ *
+ * @param range_subid If non-zero, the module is registered against a range
+ * of OIDs, with this parameter identifying the relevant
+ * subidentifier - see RFC 2741 for details.
+ * Typically used to register a single row of a table.
+ * If zero, then register the module against the full OID subtree.
+ *
+ * @param range_ubound The end of the range being registered (see RFC 2741)
+ * If range_subid is zero, then this parameter is ignored.
+ *
+ * @param ss
+ *
+ * @return gives SNMPERR_SUCCESS or SNMPERR_* error code.
+ *
+ * @see register_mib()
+ * @see register_mib_priority()
+ * @see register_mib_context()
+ * @see unregister_mib()
+ */
+int
+register_mib_range(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ const 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);
+}
+
+/** Register a new module into the MIB database, with a non-default priority
+ *
+ * @param moduleName Text name of the module.
+ * The given name will be used to identify the module
+ * inside the agent.
+ *
+ * @param var Array of variables to be registered in the module.
+ *
+ * @param varsize Size of a single variable in var array.
+ * The size is normally equal to sizeof(struct variable),
+ * but if we wish to use shorter (or longer) OIDs, then we
+ * could use different variant of the variable structure.
+ *
+ * @param numvars Number of variables in the var array.
+ * This is how many variables the function will try to register.
+ *
+ * @param mibloc Base OID of the module.
+ * All OIDs in var array should be sub-oids of the base OID.
+ *
+ * @param mibloclen Length of the base OID.
+ * Number of integers making up the base OID.
+ *
+ * @param priority Registration priority.
+ * Used to achieve a desired configuration when different
+ * sessions register identical or overlapping regions.
+ * Primarily used with AgentX subagent registrations.
+ *
+ * @return gives SNMPERR_SUCCESS or SNMPERR_* error code.
+ *
+ * @see register_mib()
+ * @see register_mib_range()
+ * @see register_mib_context()
+ * @see unregister_mib()
+ */
+int
+register_mib_priority(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ const oid * mibloc, size_t mibloclen, int priority)
+{
+ return register_mib_range(moduleName, var, varsize, numvars,
+ mibloc, mibloclen, priority, 0, 0, NULL);
+}
+
+/** Register a new module into the MIB database, using default priority and context
+ *
+ * @param moduleName Text name of the module.
+ * The given name will be used to identify the module
+ * inside the agent.
+ *
+ * @param var Array of variables to be registered in the module.
+ *
+ * @param varsize Size of a single variable in var array.
+ * The size is normally equal to sizeof(struct variable),
+ * but if we wish to use shorter (or longer) OIDs, then we
+ * could use different variant of the variable structure.
+ *
+ * @param numvars Number of variables in the var array.
+ * This is how many variables the function will try to register.
+ *
+ * @param mibloc Base OID of the module.
+ * All OIDs in var array should be sub-oids of the base OID.
+ *
+ * @param mibloclen Length of the base OID.
+ * Number of integers making up the base OID.
+ *
+ * @return gives SNMPERR_SUCCESS or SNMPERR_* error code.
+ *
+ * @see register_mib_priority()
+ * @see register_mib_range()
+ * @see register_mib_context()
+ * @see unregister_mib()
+ */
+int
+register_mib(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars, const oid * mibloc, size_t mibloclen)
+{
+ return register_mib_priority(moduleName, var, varsize, numvars,
+ mibloc, mibloclen, DEFAULT_MIB_PRIORITY);
+}
+
+/** @private
+ * Unloads a subtree from MIB tree.
+ *
+ * @param sub The sub-tree which is being removed.
+ *
+ * @param prev Previous entry, before the unloaded one.
+ *
+ * @param context Name of the context which is being removed.
+ *
+ * @see unregister_mib_context()
+ */
+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]"));
+ return;
+ }
+ 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 a module registered against a given OID (or range) in a specified context.
+ * Typically used when a module has multiple contexts defined.
+ * The parameters priority, range_subid, range_ubound and context
+ * should match those used to register the module originally.
+ *
+ * @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 gives MIB_UNREGISTERED_OK or MIB_* error code.
+ *
+ * @see unregister_mib()
+ * @see unregister_mib_priority()
+ * @see unregister_mib_range()
+ */
+int
+unregister_mib_context(oid * name, size_t len, int priority,
+ int range_subid, oid range_ubound,
+ const char *context)
+{
+ netsnmp_subtree *list, *myptr = NULL;
+ 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) && ((size_t)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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_UNREGISTER_MIB_TABLE_ROW
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UNREGISTER_MIB_TABLE_ROW */
+
+/**
+ * Unregisters a module registered against a given OID (or range) in the default context.
+ * Typically used when a module has multiple contexts defined.
+ * The parameters priority, range_subid, and range_ubound should
+ * match those used to register the module originally.
+ *
+ * @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.
+ *
+ * @return gives MIB_UNREGISTERED_OK or MIB_* error code.
+ *
+ * @see unregister_mib()
+ * @see unregister_mib_priority()
+ * @see unregister_mib_context()
+ */
+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, "");
+}
+
+/**
+ * Unregisters a module registered against a given OID at the specified priority.
+ * The priority parameter should match that used to register the module originally.
+ *
+ * @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.
+ *
+ * @return gives MIB_UNREGISTERED_OK or MIB_* error code.
+ *
+ * @see unregister_mib()
+ * @see unregister_mib_range()
+ * @see unregister_mib_context()
+ */
+int
+unregister_mib_priority(oid * name, size_t len, int priority)
+{
+ return unregister_mib_range(name, len, priority, 0, 0);
+}
+
+/**
+ * Unregisters a module registered against a given OID at the default priority.
+ *
+ * @param name the specific OID to unregister if it conatins the associated
+ * context.
+ *
+ * @param len the length of the OID, use OID_LENGTH macro.
+ *
+ * @return gives MIB_UNREGISTERED_OK or MIB_* error code.
+ *
+ * @see unregister_mib_priority()
+ * @see unregister_mib_context()
+ * @see unregister_mib_range()
+ * @see unregister_agentx_list()
+ */
+int
+unregister_mib(oid * name, size_t len)
+{
+ return unregister_mib_priority(name, len, DEFAULT_MIB_PRIORITY);
+}
+
+/** Unregisters subtree of OIDs bounded to given session.
+ *
+ * @param ss Session which OIDs will be removed from tree.
+ *
+ * @see unregister_mib()
+ * @see unregister_agentx_list()
+ */
+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);
+ }
+}
+
+/** Determines if given PDU is allowed to see (or update) a given OID.
+ *
+ * @param name The OID to check access for.
+ * On return, this parameter holds the OID actually matched
+ *
+ * @param namelen Number of sub-identifiers in the OID.
+ * On return, this parameter holds the length of the matched OID
+ *
+ * @param pdu PDU requesting access to the OID.
+ *
+ * @param type ANS.1 type of the value at given OID.
+ * (Used for catching SNMPv1 requests for SMIv2-only objects)
+ *
+ * @return gives VACM_SUCCESS if the OID is in the PDU, otherwise error code.
+ */
+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;
+}
+
+/** Determines if the given PDU request could potentially succeed.
+ * (Preliminary, OID-independent validation)
+ *
+ * @param pdu PDU requesting access
+ *
+ * @return gives VACM_SUCCESS if the entire MIB tree is accessible
+ * VACM_NOTINVIEW if the entire MIB tree is inaccessible
+ * VACM_SUBTREE_UNKNOWN if some portions are accessible
+ * other codes may returned on error
+ */
+int
+check_access(netsnmp_pdu *pdu)
+{ /* IN - pdu being checked */
+ struct view_parameters view_parms;
+ view_parms.pdu = pdu;
+ view_parms.name = NULL;
+ 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;
+}
+
+/** Determines if the given PDU request could potentially access
+ * the specified MIB subtree
+ *
+ * @param pdu PDU requesting access
+ *
+ * @param name The OID to check access for.
+ *
+ * @param namelen Number of sub-identifiers in the OID.
+ *
+ * @return gives VACM_SUCCESS if the entire MIB tree is accessible
+ * VACM_NOTINVIEW if the entire MIB tree is inaccessible
+ * VACM_SUBTREE_UNKNOWN if some portions are accessible
+ * other codes may returned on error
+ */
+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;
+}
+
+netsnmp_feature_child_of(get_session_for_oid,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_GET_SESSION_FOR_OID
+netsnmp_session *
+get_session_for_oid(const 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;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_GET_SESSION_FOR_OID */
+
+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);
+
+}
+
+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 =
+ (struct variable*)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);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ SNMP_FREE(s);
+ SNMP_FREE(e);
+ SNMP_FREE(v);
+
+ dump_idx_registry();
+}
+
+/** @} */
+/* End of MIB registration code */
+
+
+/** @defgroup agent_signals POSIX signals support for agents.
+ * Registering and unregistering signal handlers.
+ * @ingroup agent_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
+}
+
+/** Registers a POSIX Signal handler.
+ * Implements the signal registering process for POSIX and non-POSIX
+ * systems. Also, unifies the way signals work.
+ * Note that the signal handler should register itself again with
+ * signal() call before end of execution to prevent possible problems.
+ *
+ * @param sig POSIX Signal ID number, as defined in signal.h.
+ *
+ * @param func New signal handler function.
+ *
+ * @return value is SIG_REGISTERED_OK for success and
+ * SIG_REGISTRATION_FAILED if the registration can't
+ * be handled.
+ */
+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;
+}
+
+/** Unregisters a POSIX Signal handler.
+ *
+ * @param sig POSIX Signal ID number, as defined in signal.h.
+ *
+ * @return value is SIG_UNREGISTERED_OK for success, or error code.
+ */
+int
+unregister_signal(int sig)
+{
+ signal(sig, SIG_DFL);
+ DEBUGMSGTL(("unregister_signal", "unregistered signal %d\n", sig));
+ return SIG_UNREGISTERED_OK;
+}
+
+#endif /* !WIN32 */
+
+/** @} */
+/* End of signals support code */
+
+/** @} */
+
diff --git a/agent/agent_sysORTable.c b/agent/agent_sysORTable.c
new file mode 100644
index 0000000..f628060
--- /dev/null
+++ b/agent/agent_sysORTable.c
@@ -0,0 +1,236 @@
+#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
+#include <stddef.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 <net-snmp/agent/agent_sysORTable.h>
+#include <net-snmp/agent/sysORTable.h>
+
+typedef struct data_node_s {
+ struct sysORTable data;
+ struct data_node_s* next;
+ struct data_node_s* prev;
+}* data_node;
+
+static data_node table = NULL;
+
+static void
+erase(data_node entry)
+{
+ entry->data.OR_uptime = netsnmp_get_agent_uptime();
+ DEBUGMSGTL(("agent/sysORTable", "UNREG_SYSOR %p\n", &entry->data));
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION, SNMPD_CALLBACK_UNREG_SYSOR,
+ &entry->data);
+ free(entry->data.OR_oid);
+ free(entry->data.OR_descr);
+ if (entry->next == entry)
+ table = NULL;
+ else {
+ entry->next->prev = entry->prev;
+ entry->prev->next = entry->next;
+ if (entry == table)
+ table = entry->next;
+ }
+ free(entry);
+}
+
+void
+netsnmp_sysORTable_foreach(void (*f)(const struct sysORTable*, void*), void* c)
+{
+ DEBUGMSGTL(("agent/sysORTable", "foreach(%p, %p)\n", f, c));
+ if(table) {
+ data_node run = table;
+ do {
+ data_node tmp = run;
+ run = run->next;
+ f(&tmp->data, c);
+ } while(table && run != table);
+ }
+}
+
+int
+register_sysORTable_sess(oid * oidin,
+ size_t oidlen,
+ const char *descr, netsnmp_session * ss)
+{
+ data_node entry;
+
+ DEBUGMSGTL(("agent/sysORTable", "registering: "));
+ DEBUGMSGOID(("agent/sysORTable", oidin, oidlen));
+ DEBUGMSG(("agent/sysORTable", ", session %p\n", ss));
+
+ entry = (data_node)calloc(1, sizeof(struct data_node_s));
+ if (entry == NULL) {
+ DEBUGMSGTL(("agent/sysORTable", "Failed to allocate new entry\n"));
+ return SYS_ORTABLE_REGISTRATION_FAILED;
+ }
+
+ entry->data.OR_descr = strdup(descr);
+ if (entry->data.OR_descr == NULL) {
+ DEBUGMSGTL(("agent/sysORTable", "Failed to allocate new sysORDescr\n"));
+ free(entry);
+ return SYS_ORTABLE_REGISTRATION_FAILED;
+ }
+
+ entry->data.OR_oid = (oid *) malloc(sizeof(oid) * oidlen);
+ if (entry->data.OR_oid == NULL) {
+ DEBUGMSGTL(("agent/sysORTable", "Failed to allocate new sysORID\n"));
+ free(entry->data.OR_descr);
+ free(entry);
+ return SYS_ORTABLE_REGISTRATION_FAILED;
+ }
+
+ memcpy(entry->data.OR_oid, oidin, sizeof(oid) * oidlen);
+ entry->data.OR_oidlen = oidlen;
+ entry->data.OR_sess = ss;
+
+ if(table) {
+ entry->next = table;
+ entry->prev = table->prev;
+ table->prev->next = entry;
+ table->prev = entry;
+ } else
+ table = entry->next = entry->prev = entry;
+
+ entry->data.OR_uptime = netsnmp_get_agent_uptime();
+
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REG_SYSOR, &entry->data);
+
+ 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)
+{
+ int any_unregistered = 0;
+
+ DEBUGMSGTL(("agent/sysORTable", "sysORTable unregistering: "));
+ DEBUGMSGOID(("agent/sysORTable", oidin, oidlen));
+ DEBUGMSG(("agent/sysORTable", ", session %p\n", ss));
+
+ if(table) {
+ data_node run = table;
+ do {
+ data_node tmp = run;
+ run = run->next;
+ if (tmp->data.OR_sess == ss &&
+ snmp_oid_compare(oidin, oidlen,
+ tmp->data.OR_oid, tmp->data.OR_oidlen) == 0) {
+ erase(tmp);
+ any_unregistered = 1;
+ }
+ } while(table && run != table);
+ }
+
+ if (any_unregistered) {
+ DEBUGMSGTL(("agent/sysORTable", "unregistering successfull\n"));
+ return SYS_ORTABLE_UNREGISTERED_OK;
+ } else {
+ DEBUGMSGTL(("agent/sysORTable", "unregistering failed\n"));
+ return SYS_ORTABLE_NO_SUCH_REGISTRATION;
+ }
+}
+
+
+int
+unregister_sysORTable(oid * oidin, size_t oidlen)
+{
+ return unregister_sysORTable_sess(oidin, oidlen, NULL);
+}
+
+
+void
+unregister_sysORTable_by_session(netsnmp_session * ss)
+{
+ DEBUGMSGTL(("agent/sysORTable",
+ "sysORTable unregistering session %p\n", ss));
+
+ if(table) {
+ data_node run = table;
+ do {
+ data_node tmp = run;
+ run = run->next;
+ if (((ss->flags & SNMP_FLAGS_SUBSESSION) &&
+ tmp->data.OR_sess == ss) ||
+ (!(ss->flags & SNMP_FLAGS_SUBSESSION) && tmp->data.OR_sess &&
+ tmp->data.OR_sess->subsession == ss))
+ erase(tmp);
+ } while(table && run != table);
+ }
+
+ DEBUGMSGTL(("agent/sysORTable",
+ "sysORTable unregistering session %p done\n", ss));
+}
+
+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);
+}
+
+void
+init_agent_sysORTable(void)
+{
+ DEBUGMSGTL(("agent/sysORTable", "init_agent_sysORTable\n"));
+
+ 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);
+}
+
+void
+shutdown_agent_sysORTable(void)
+{
+ DEBUGMSGTL(("agent/sysORTable", "shutdown_sysORTable\n"));
+ while(table)
+ erase(table);
+}
diff --git a/agent/agent_trap.c b/agent/agent_trap.c
new file mode 100644
index 0000000..dfa9dcf
--- /dev/null
+++ b/agent/agent_trap.c
@@ -0,0 +1,1309 @@
+/*
+ * 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>
+#include <net-snmp/net-snmp-features.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
+# 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_SYS_SOCKET_H
+#include <sys/socket.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/net-snmp-agent-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
+
+netsnmp_feature_child_of(agent_trap_all, libnetsnmpagent)
+
+netsnmp_feature_child_of(trap_vars_with_context, agent_trap_all)
+netsnmp_feature_child_of(remove_trap_session, agent_trap_all)
+
+netsnmp_feature_child_of(send_v3trap,netsnmp_unused)
+netsnmp_feature_child_of(send_trap_pdu,netsnmp_unused)
+
+struct trap_sink {
+ netsnmp_session *sesp;
+ struct trap_sink *next;
+ int pdutype;
+ int version;
+};
+
+struct trap_sink *sinks = NULL;
+
+const oid objid_enterprisetrap[] = { NETSNMP_NOTIFICATION_MIB };
+const oid trap_version_id[] = { NETSNMP_SYSTEM_MIB };
+const int enterprisetrap_len = OID_LENGTH(objid_enterprisetrap);
+const int trap_version_id_len = OID_LENGTH(trap_version_id);
+
+#define SNMPV2_TRAPS_PREFIX SNMP_OID_SNMPMODULES,1,1,5
+const oid trap_prefix[] = { SNMPV2_TRAPS_PREFIX };
+const oid cold_start_oid[] = { SNMPV2_TRAPS_PREFIX, 1 }; /* SNMPv2-MIB */
+
+#define SNMPV2_TRAP_OBJS_PREFIX SNMP_OID_SNMPMODULES,1,1,4
+const oid snmptrap_oid[] = { SNMPV2_TRAP_OBJS_PREFIX, 1, 0 };
+const oid snmptrapenterprise_oid[] = { SNMPV2_TRAP_OBJS_PREFIX, 3, 0 };
+const oid sysuptime_oid[] = { SNMP_OID_MIB2, 1, 3, 0 };
+const size_t snmptrap_oid_len = OID_LENGTH(snmptrap_oid);
+const size_t snmptrapenterprise_oid_len = OID_LENGTH(snmptrapenterprise_oid);
+const size_t sysuptime_oid_len = OID_LENGTH(sysuptime_oid);
+
+#define SNMPV2_COMM_OBJS_PREFIX SNMP_OID_SNMPMODULES,18,1
+const oid agentaddr_oid[] = { SNMPV2_COMM_OBJS_PREFIX, 3, 0 };
+const size_t agentaddr_oid_len = OID_LENGTH(agentaddr_oid);
+const oid community_oid[] = { SNMPV2_COMM_OBJS_PREFIX, 4, 0 };
+const size_t community_oid_len = OID_LENGTH(community_oid);
+#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
+
+long 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)
+{
+}
+
+static void
+free_trap_session(struct trap_sink *sp)
+{
+ DEBUGMSGTL(("trap", "freeing callback trap session (%p, %p)\n", sp, sp->sesp));
+ 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 (%p)\n", ss));
+ 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_REMOVE_TRAP_SESSION
+int
+remove_trap_session(netsnmp_session * ss)
+{
+ struct trap_sink *sp = sinks, *prev = NULL;
+
+ DEBUGMSGTL(("trap", "removing trap sessions\n"));
+ 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);
+ */
+ DEBUGMSGTL(("trap", "removing trap session (%p, %p)\n", sp, sp->sesp));
+ free(sp);
+ return 1;
+ }
+ prev = sp;
+ sp = sp->next;
+ }
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REMOVE_TRAP_SESSION */
+
+#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 = strdup("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;
+ DEBUGMSGTL(("trap", "freeing trap sessions\n"));
+ 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;
+
+ /*
+ * 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) {
+ template_v1pdu->enterprise_length = var->val_len/sizeof(oid);
+ template_v1pdu->enterprise =
+ snmp_duplicate_objid(var->val.objid,
+ template_v1pdu->enterprise_length);
+ } 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
+ */
+ size_t len = vblist->val_len / sizeof(oid);
+ if ( len <= 2 ) {
+ snmp_log(LOG_WARNING,
+ "send_trap: v2 trapOID too short (%d)\n", (int)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);
+ template_v1pdu->enterprise =
+ snmp_duplicate_objid(vblist->val.objid, len);
+ 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 *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;
+
+ /*
+ * 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 specific
+ * 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,
+ const oid * enterprise, int enterprise_length,
+ netsnmp_variable_list * vars,
+ const 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;
+ const char *v1trapaddress;
+ int res = 0;
+
+ 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,
+ 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;
+ v1trapaddress = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_TRAP_ADDR);
+ if (v1trapaddress != NULL) {
+ /* "v1trapaddress" was specified in config, try to resolve it */
+ res = netsnmp_gethostbyname_v4(v1trapaddress, pdu_in_addr_t);
+ }
+ if (v1trapaddress == NULL || res < 0) {
+ /* "v1trapaddress" was not specified in config or the resolution failed,
+ * try any local address */
+ *pdu_in_addr_t = get_myaddr();
+ }
+
+ }
+
+ if (template_v2pdu) {
+ /* A context name was provided, so copy it and its length to the v2 pdu
+ * template. */
+ if (context != NULL)
+ {
+ template_v2pdu->contextName = strdup(context);
+ template_v2pdu->contextNameLen = strlen(context);
+ }
+ }
+
+ /*
+ * 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,
+ const 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;
+
+ if (!sess || !template_pdu)
+ return;
+
+ DEBUGMSGTL(("trap", "sending trap type=%d, version=%ld\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) &&
+ (sess->securityEngineIDLen == 0)) {
+ u_char tmp[SPRINT_MAX_LEN];
+
+ int 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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TRAP_VARS_WITH_CONTEXT
+/* Send a trap under a context */
+void send_trap_vars_with_context(int trap, int specific,
+ netsnmp_variable_list *vars, const char *context)
+{
+ if (trap == SNMP_TRAP_ENTERPRISESPECIFIC)
+ netsnmp_send_traps(trap, specific, objid_enterprisetrap,
+ OID_LENGTH(objid_enterprisetrap), vars,
+ context, 0);
+ else
+ netsnmp_send_traps(trap, specific, trap_version_id,
+ OID_LENGTH(trap_version_id), vars,
+ context, 0);
+
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TRAP_VARS_WITH_CONTEXT */
+
+/**
+ * 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);
+}
+
+/**
+ * Similar to send_v2trap(), with the added ability to specify a context. If
+ * the last parameter is NULL, then this call is equivalent to send_v2trap().
+ *
+ * @param vars is used to supply the list of variable bindings for the trap.
+ *
+ * @param context is used to specify the context of the trap.
+ *
+ * @return void
+ *
+ * @see send_v2trap
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_SEND_V3TRAP
+void send_v3trap(netsnmp_variable_list *vars, const char *context)
+{
+ netsnmp_send_traps(-1, -1,
+ trap_version_id, OID_LENGTH(trap_version_id),
+ vars, context, 0);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SEND_V3TRAP */
+
+#ifndef NETSNMP_FEATURE_REMOVE_SEND_TRAP_PDU
+void
+send_trap_pdu(netsnmp_pdu *pdu)
+{
+ send_trap_vars(-1, -1, pdu->variables);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SEND_TRAP_PDU */
+
+
+
+ /*******************
+ *
+ * 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 *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) {
+ netsnmp_config_error("cannot create trapsink: %s", cptr);
+ }
+}
+#endif
+
+#ifndef NETSNMP_DISABLE_SNMPV2C
+void
+snmpd_parse_config_trap2sink(const char *word, char *cptr)
+{
+ char *st, *sp, *cp, *pp = NULL;
+
+ 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) {
+ netsnmp_config_error("cannot create trap2sink: %s", cptr);
+ }
+}
+
+void
+snmpd_parse_config_informsink(const char *word, char *cptr)
+{
+ char *st, *sp, *cp, *pp = NULL;
+
+ 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) {
+ netsnmp_config_error("cannot create informsink: %s", cptr);
+ }
+}
+#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;
+ int argn, rc;
+ netsnmp_session session, *ss;
+ netsnmp_transport *transport;
+ 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++) {
+ char tmp[SPRINT_MAX_LEN];
+
+ cp = copy_nword(cp, tmp, SPRINT_MAX_LEN);
+ argv[argn] = strdup(tmp);
+ }
+
+ netsnmp_parse_args(argn, argv, &session, "C:", trapOptProc,
+ NETSNMP_PARSE_ARGS_NOLOGGING |
+ NETSNMP_PARSE_ARGS_NOZERO);
+
+ transport = netsnmp_transport_open_client("snmptrap", session.peername);
+ if (transport == NULL) {
+ config_perror("snmpd: failed to parse this line.");
+ return;
+ }
+ if ((rc = netsnmp_sess_config_and_open_transport(&session, transport))
+ != SNMPERR_SUCCESS) {
+ session.s_snmp_errno = rc;
+ session.s_errno = 0;
+ return;
+ }
+ ss = snmp_add(&session, transport, 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) {
+ u_char tmp[SPRINT_MAX_LEN];
+
+ 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)
+ traptype = SNMP_MSG_TRAP;
+#endif
+ add_trap_session(ss, traptype, (traptype == SNMP_MSG_INFORM), ss->version);
+}
+
+#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/agent/auto_nlist.c b/agent/auto_nlist.c
new file mode 100644
index 0000000..25d080f
--- /dev/null
+++ b/agent/auto_nlist.c
@@ -0,0 +1,270 @@
+#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) {
+#if !(defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7))
+ static char *n_name = NULL;
+#endif
+ *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) || defined(aix7)
+ strcpy(it->nl[0].n_name, string);
+ it->nl[0].n_name[strlen(string)+1] = '\0';
+#elif defined(freebsd9)
+ sprintf(__DECONST(char*, it->nl[0].n_name), "_%s", string);
+#else
+
+ if (n_name != NULL)
+ free(n_name);
+
+ n_name = malloc(strlen(string) + 2);
+ if (n_name == NULL) {
+ snmp_log(LOG_ERR, "nlist err: failed to allocate memory");
+ return (-1);
+ }
+ snprintf(n_name, strlen(string) + 2, "_%s", string);
+ it->nl[0].n_name = (const char*)n_name;
+#endif
+ it->nl[1].n_name = 0;
+ init_nlist(it->nl);
+#if !(defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7) || \
+ defined(netbsd1) || defined(dragonfly))
+ if (it->nl[0].n_type == 0) {
+#if defined(freebsd9)
+ strcpy(__DECONST(char*, it->nl[0].n_name), string);
+ __DECONST(char*, it->nl[0].n_name)[strlen(string)+1] = '\0';
+#else
+ static char *n_name2 = NULL;
+
+ if (n_name2 != NULL)
+ free(n_name2);
+
+ n_name2 = malloc(strlen(string) + 1);
+ if (n_name2 == NULL) {
+ snmp_log(LOG_ERR, "nlist err: failed to allocate memory");
+ return (-1);
+ }
+ strcpy(n_name2, string);
+ it->nl[0].n_name = (const char*)n_name2;
+#endif
+ 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 %lx.\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, size_t 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[])
+{
+ 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(aix7)) && 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) || defined(aix7)
+ 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));
+ }
+ }
+}
+
+int
+KNLookup(struct nlist nl[], int nl_which, char *buf, size_t 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/agent/autonlist.h b/agent/autonlist.h
new file mode 100644
index 0000000..82a52ab
--- /dev/null
+++ b/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/agent/helpers/Makefile.depend b/agent/helpers/Makefile.depend
new file mode 100644
index 0000000..1023c66
--- /dev/null
+++ b/agent/helpers/Makefile.depend
@@ -0,0 +1,2902 @@
+# 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/net-snmp-features.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/oid.h
+./all_helpers.lo: ../../include/net-snmp/library/types.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_api.h
+./all_helpers.lo: ../../include/net-snmp/varbind_api.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_client.h
+./all_helpers.lo: ../../include/net-snmp/pdu_api.h
+./all_helpers.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./all_helpers.lo: ../../include/net-snmp/session_api.h
+./all_helpers.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./all_helpers.lo: ../../include/net-snmp/mib_api.h
+./all_helpers.lo: ../../include/net-snmp/library/parse.h
+./all_helpers.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./all_helpers.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/net-snmp-config.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/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/snmptsm.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
+./all_helpers.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./all_helpers.lo: ../../include/net-snmp/agent/stash_cache.h
+./baby_steps.lo: ../../include/net-snmp/net-snmp-config.h
+./baby_steps.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./baby_steps.lo: ../../include/net-snmp/library/types.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_api.h
+./baby_steps.lo: ../../include/net-snmp/varbind_api.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_client.h
+./baby_steps.lo: ../../include/net-snmp/pdu_api.h
+./baby_steps.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./baby_steps.lo: ../../include/net-snmp/session_api.h
+./baby_steps.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./baby_steps.lo: ../../include/net-snmp/mib_api.h
+./baby_steps.lo: ../../include/net-snmp/library/parse.h
+./baby_steps.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./baby_steps.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./baby_steps.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./bulk_to_next.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./bulk_to_next.lo: ../../include/net-snmp/library/types.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_api.h
+./bulk_to_next.lo: ../../include/net-snmp/varbind_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_client.h
+./bulk_to_next.lo: ../../include/net-snmp/pdu_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./bulk_to_next.lo: ../../include/net-snmp/session_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./bulk_to_next.lo: ../../include/net-snmp/mib_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/parse.h
+./bulk_to_next.lo: ../../include/net-snmp/library/oid_stash.h
+./bulk_to_next.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./bulk_to_next.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./bulk_to_next.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./cache_handler.lo: ../../include/net-snmp/net-snmp-config.h
+./cache_handler.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./cache_handler.lo: ../../include/net-snmp/library/types.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_api.h
+./cache_handler.lo: ../../include/net-snmp/varbind_api.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_client.h
+./cache_handler.lo: ../../include/net-snmp/pdu_api.h
+./cache_handler.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./cache_handler.lo: ../../include/net-snmp/session_api.h
+./cache_handler.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./cache_handler.lo: ../../include/net-snmp/mib_api.h
+./cache_handler.lo: ../../include/net-snmp/library/parse.h
+./cache_handler.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./cache_handler.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./cache_handler.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./debug_handler.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./debug_handler.lo: ../../include/net-snmp/library/types.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_api.h
+./debug_handler.lo: ../../include/net-snmp/varbind_api.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_client.h
+./debug_handler.lo: ../../include/net-snmp/pdu_api.h
+./debug_handler.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./debug_handler.lo: ../../include/net-snmp/session_api.h
+./debug_handler.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./debug_handler.lo: ../../include/net-snmp/mib_api.h
+./debug_handler.lo: ../../include/net-snmp/library/parse.h
+./debug_handler.lo: ../../include/net-snmp/library/oid_stash.h
+./debug_handler.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./debug_handler.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./debug_handler.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./instance.lo: ../../include/net-snmp/net-snmp-config.h
+./instance.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./instance.lo: ../../include/net-snmp/library/types.h
+./instance.lo: ../../include/net-snmp/library/snmp_api.h
+./instance.lo: ../../include/net-snmp/varbind_api.h
+./instance.lo: ../../include/net-snmp/library/snmp_client.h
+./instance.lo: ../../include/net-snmp/pdu_api.h
+./instance.lo: ../../include/net-snmp/library/asn1.h
+./instance.lo: ../../include/net-snmp/output_api.h
+./instance.lo: ../../include/net-snmp/library/snmp_debug.h
+./instance.lo: ../../include/net-snmp/library/snmp_logging.h
+./instance.lo: ../../include/net-snmp/session_api.h
+./instance.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./instance.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./instance.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./instance.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./instance.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./instance.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./instance.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./instance.lo: ../../include/net-snmp/library/ucd_compat.h
+./instance.lo: ../../include/net-snmp/library/mib.h
+./instance.lo: ../../include/net-snmp/mib_api.h
+./instance.lo: ../../include/net-snmp/library/parse.h
+./instance.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./instance.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./instance.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mode_end_call.lo: ../../include/net-snmp/net-snmp-config.h
+./mode_end_call.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mode_end_call.lo: ../../include/net-snmp/library/types.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_api.h
+./mode_end_call.lo: ../../include/net-snmp/varbind_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_client.h
+./mode_end_call.lo: ../../include/net-snmp/pdu_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mode_end_call.lo: ../../include/net-snmp/session_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mode_end_call.lo: ../../include/net-snmp/mib_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/parse.h
+./mode_end_call.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mode_end_call.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./mode_end_call.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./multiplexer.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./multiplexer.lo: ../../include/net-snmp/library/types.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_api.h
+./multiplexer.lo: ../../include/net-snmp/varbind_api.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_client.h
+./multiplexer.lo: ../../include/net-snmp/pdu_api.h
+./multiplexer.lo: ../../include/net-snmp/library/asn1.h
+./multiplexer.lo: ../../include/net-snmp/output_api.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_debug.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_logging.h
+./multiplexer.lo: ../../include/net-snmp/session_api.h
+./multiplexer.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/ucd_compat.h
+./multiplexer.lo: ../../include/net-snmp/library/mib.h
+./multiplexer.lo: ../../include/net-snmp/mib_api.h
+./multiplexer.lo: ../../include/net-snmp/library/parse.h
+./multiplexer.lo: ../../include/net-snmp/library/oid_stash.h
+./multiplexer.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./multiplexer.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./multiplexer.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./null.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./null.lo: ../../include/net-snmp/library/types.h
+./null.lo: ../../include/net-snmp/library/snmp_api.h
+./null.lo: ../../include/net-snmp/varbind_api.h
+./null.lo: ../../include/net-snmp/library/snmp_client.h
+./null.lo: ../../include/net-snmp/pdu_api.h
+./null.lo: ../../include/net-snmp/library/asn1.h
+./null.lo: ../../include/net-snmp/output_api.h
+./null.lo: ../../include/net-snmp/library/snmp_debug.h
+./null.lo: ../../include/net-snmp/library/snmp_logging.h
+./null.lo: ../../include/net-snmp/session_api.h
+./null.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./null.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./null.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./null.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./null.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./null.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./null.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./null.lo: ../../include/net-snmp/library/ucd_compat.h
+./null.lo: ../../include/net-snmp/library/mib.h
+./null.lo: ../../include/net-snmp/mib_api.h
+./null.lo: ../../include/net-snmp/library/parse.h
+./null.lo: ../../include/net-snmp/library/oid_stash.h
+./null.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./null.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./null.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./old_api.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./old_api.lo: ../../include/net-snmp/library/types.h
+./old_api.lo: ../../include/net-snmp/library/snmp_api.h
+./old_api.lo: ../../include/net-snmp/varbind_api.h
+./old_api.lo: ../../include/net-snmp/library/snmp_client.h
+./old_api.lo: ../../include/net-snmp/pdu_api.h
+./old_api.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./old_api.lo: ../../include/net-snmp/session_api.h
+./old_api.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./old_api.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./old_api.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./old_api.lo: ../../include/net-snmp/mib_api.h
+./old_api.lo: ../../include/net-snmp/library/parse.h
+./old_api.lo: ../../include/net-snmp/library/oid_stash.h
+./old_api.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./old_api.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/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/oid.h
+./read_only.lo: ../../include/net-snmp/library/types.h
+./read_only.lo: ../../include/net-snmp/library/snmp_api.h
+./read_only.lo: ../../include/net-snmp/varbind_api.h
+./read_only.lo: ../../include/net-snmp/library/snmp_client.h
+./read_only.lo: ../../include/net-snmp/pdu_api.h
+./read_only.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./read_only.lo: ../../include/net-snmp/session_api.h
+./read_only.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./read_only.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./read_only.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./read_only.lo: ../../include/net-snmp/mib_api.h
+./read_only.lo: ../../include/net-snmp/library/parse.h
+./read_only.lo: ../../include/net-snmp/library/oid_stash.h
+./read_only.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./read_only.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./read_only.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./row_merge.lo: ../../include/net-snmp/net-snmp-config.h
+./row_merge.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./row_merge.lo: ../../include/net-snmp/library/types.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_api.h
+./row_merge.lo: ../../include/net-snmp/varbind_api.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_client.h
+./row_merge.lo: ../../include/net-snmp/pdu_api.h
+./row_merge.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./row_merge.lo: ../../include/net-snmp/session_api.h
+./row_merge.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./row_merge.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./row_merge.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./row_merge.lo: ../../include/net-snmp/mib_api.h
+./row_merge.lo: ../../include/net-snmp/library/parse.h
+./row_merge.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./row_merge.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./row_merge.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./scalar.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./scalar.lo: ../../include/net-snmp/library/types.h
+./scalar.lo: ../../include/net-snmp/library/snmp_api.h
+./scalar.lo: ../../include/net-snmp/varbind_api.h
+./scalar.lo: ../../include/net-snmp/library/snmp_client.h
+./scalar.lo: ../../include/net-snmp/pdu_api.h
+./scalar.lo: ../../include/net-snmp/library/asn1.h
+./scalar.lo: ../../include/net-snmp/output_api.h
+./scalar.lo: ../../include/net-snmp/library/snmp_debug.h
+./scalar.lo: ../../include/net-snmp/library/snmp_logging.h
+./scalar.lo: ../../include/net-snmp/session_api.h
+./scalar.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./scalar.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./scalar.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./scalar.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./scalar.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./scalar.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./scalar.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./scalar.lo: ../../include/net-snmp/library/ucd_compat.h
+./scalar.lo: ../../include/net-snmp/library/mib.h
+./scalar.lo: ../../include/net-snmp/mib_api.h
+./scalar.lo: ../../include/net-snmp/library/parse.h
+./scalar.lo: ../../include/net-snmp/library/oid_stash.h
+./scalar.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./scalar.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./scalar_group.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./scalar_group.lo: ../../include/net-snmp/library/types.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_api.h
+./scalar_group.lo: ../../include/net-snmp/varbind_api.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_client.h
+./scalar_group.lo: ../../include/net-snmp/pdu_api.h
+./scalar_group.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./scalar_group.lo: ../../include/net-snmp/session_api.h
+./scalar_group.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./scalar_group.lo: ../../include/net-snmp/mib_api.h
+./scalar_group.lo: ../../include/net-snmp/library/parse.h
+./scalar_group.lo: ../../include/net-snmp/library/oid_stash.h
+./scalar_group.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./scalar_group.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./scalar_group.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./serialize.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./serialize.lo: ../../include/net-snmp/library/types.h
+./serialize.lo: ../../include/net-snmp/library/snmp_api.h
+./serialize.lo: ../../include/net-snmp/varbind_api.h
+./serialize.lo: ../../include/net-snmp/library/snmp_client.h
+./serialize.lo: ../../include/net-snmp/pdu_api.h
+./serialize.lo: ../../include/net-snmp/library/asn1.h
+./serialize.lo: ../../include/net-snmp/output_api.h
+./serialize.lo: ../../include/net-snmp/library/snmp_debug.h
+./serialize.lo: ../../include/net-snmp/library/snmp_logging.h
+./serialize.lo: ../../include/net-snmp/session_api.h
+./serialize.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./serialize.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./serialize.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./serialize.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./serialize.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./serialize.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./serialize.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./serialize.lo: ../../include/net-snmp/library/ucd_compat.h
+./serialize.lo: ../../include/net-snmp/library/mib.h
+./serialize.lo: ../../include/net-snmp/mib_api.h
+./serialize.lo: ../../include/net-snmp/library/parse.h
+./serialize.lo: ../../include/net-snmp/library/oid_stash.h
+./serialize.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./serialize.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./serialize.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./snmp_get_statistic.lo: ../../include/net-snmp/net-snmp-config.h
+./snmp_get_statistic.lo: ../../include/net-snmp/net-snmp-features.h
+./snmp_get_statistic.lo: ../../include/net-snmp/net-snmp-includes.h
+./snmp_get_statistic.lo: ../../include/net-snmp/definitions.h
+./snmp_get_statistic.lo: ../../include/net-snmp/types.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/oid.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/types.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_api.h
+./snmp_get_statistic.lo: ../../include/net-snmp/varbind_api.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_client.h
+./snmp_get_statistic.lo: ../../include/net-snmp/pdu_api.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/asn1.h
+./snmp_get_statistic.lo: ../../include/net-snmp/output_api.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_debug.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_logging.h
+./snmp_get_statistic.lo: ../../include/net-snmp/session_api.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/callback.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_transport.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_service.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/ucd_compat.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/mib.h
+./snmp_get_statistic.lo: ../../include/net-snmp/mib_api.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/parse.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/oid_stash.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_impl.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp-tc.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/getopt.h
+./snmp_get_statistic.lo: ../../include/net-snmp/utilities.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/system.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/tools.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/int64.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/mt_support.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_alarm.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/data_list.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/check_varbind.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/container.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/factory.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/container_binary_array.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/container_list_ssll.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/container_iterator.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/container.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_assert.h
+./snmp_get_statistic.lo: ../../include/net-snmp/version.h
+./snmp_get_statistic.lo: ../../include/net-snmp/config_api.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/read_config.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/default_store.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_enum.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/vacm.h
+./snmp_get_statistic.lo: ../../include/net-snmp/snmpv3_api.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpv3.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/transform_oids.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/keytools.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/scapi.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/lcd_time.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmp_secmod.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmptsm.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/snmpusm.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/mib_module_config.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/agent_module_config.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/snmp_agent.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/snmp_vars.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/agent_handler.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/var_struct.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/agent_registry.h
+./snmp_get_statistic.lo: ../../include/net-snmp/library/fd_event_manager.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/ds_agent.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/agent_read_config.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/agent_trap.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/all_helpers.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/instance.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/baby_steps.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/scalar.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/scalar_group.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/watcher.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/multiplexer.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/null.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/debug_handler.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/cache_handler.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/old_api.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/read_only.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/row_merge.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/serialize.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/mode_end_call.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/table.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/table_data.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/table_dataset.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/table_tdata.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/table_iterator.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/table_container.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/table_array.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/mfd.h
+./snmp_get_statistic.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./stash_cache.lo: ../../include/net-snmp/net-snmp-config.h
+./stash_cache.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./stash_cache.lo: ../../include/net-snmp/library/types.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_api.h
+./stash_cache.lo: ../../include/net-snmp/varbind_api.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_client.h
+./stash_cache.lo: ../../include/net-snmp/pdu_api.h
+./stash_cache.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./stash_cache.lo: ../../include/net-snmp/session_api.h
+./stash_cache.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./stash_cache.lo: ../../include/net-snmp/mib_api.h
+./stash_cache.lo: ../../include/net-snmp/library/parse.h
+./stash_cache.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./stash_cache.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./stash_cache.lo: ../../include/net-snmp/agent/stash_to_next.h
+./stash_cache.lo: ../../include/net-snmp/agent/stash_cache.h
+./stash_to_next.lo: ../../include/net-snmp/net-snmp-config.h
+./stash_to_next.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./stash_to_next.lo: ../../include/net-snmp/library/types.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_api.h
+./stash_to_next.lo: ../../include/net-snmp/varbind_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_client.h
+./stash_to_next.lo: ../../include/net-snmp/pdu_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./stash_to_next.lo: ../../include/net-snmp/session_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./stash_to_next.lo: ../../include/net-snmp/mib_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/parse.h
+./stash_to_next.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./stash_to_next.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./stash_to_next.lo: ../../include/net-snmp/agent/stash_to_next.h
+./stash_to_next.lo: ../../include/net-snmp/agent/stash_cache.h
+./table_array.lo: ../../include/net-snmp/net-snmp-config.h
+./table_array.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./table_array.lo: ../../include/net-snmp/library/types.h
+./table_array.lo: ../../include/net-snmp/library/snmp_api.h
+./table_array.lo: ../../include/net-snmp/varbind_api.h
+./table_array.lo: ../../include/net-snmp/library/snmp_client.h
+./table_array.lo: ../../include/net-snmp/pdu_api.h
+./table_array.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./table_array.lo: ../../include/net-snmp/session_api.h
+./table_array.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./table_array.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./table_array.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./table_array.lo: ../../include/net-snmp/mib_api.h
+./table_array.lo: ../../include/net-snmp/library/parse.h
+./table_array.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./table_array.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_array.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./table.lo: ../../include/net-snmp/net-snmp-config.h
+./table.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./table.lo: ../../include/net-snmp/library/types.h
+./table.lo: ../../include/net-snmp/library/snmp_api.h
+./table.lo: ../../include/net-snmp/varbind_api.h
+./table.lo: ../../include/net-snmp/library/snmp_client.h
+./table.lo: ../../include/net-snmp/pdu_api.h
+./table.lo: ../../include/net-snmp/library/asn1.h
+./table.lo: ../../include/net-snmp/output_api.h
+./table.lo: ../../include/net-snmp/library/snmp_debug.h
+./table.lo: ../../include/net-snmp/library/snmp_logging.h
+./table.lo: ../../include/net-snmp/session_api.h
+./table.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./table.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./table.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./table.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./table.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./table.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./table.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./table.lo: ../../include/net-snmp/library/ucd_compat.h
+./table.lo: ../../include/net-snmp/library/mib.h
+./table.lo: ../../include/net-snmp/mib_api.h
+./table.lo: ../../include/net-snmp/library/parse.h
+./table.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./table.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./table_container.lo: ../../include/net-snmp/net-snmp-config.h
+./table_container.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./table_container.lo: ../../include/net-snmp/library/types.h
+./table_container.lo: ../../include/net-snmp/library/snmp_api.h
+./table_container.lo: ../../include/net-snmp/varbind_api.h
+./table_container.lo: ../../include/net-snmp/library/snmp_client.h
+./table_container.lo: ../../include/net-snmp/pdu_api.h
+./table_container.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./table_container.lo: ../../include/net-snmp/session_api.h
+./table_container.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./table_container.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./table_container.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./table_container.lo: ../../include/net-snmp/mib_api.h
+./table_container.lo: ../../include/net-snmp/library/parse.h
+./table_container.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./table_container.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_container.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./table_data.lo: ../../include/net-snmp/net-snmp-config.h
+./table_data.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./table_data.lo: ../../include/net-snmp/library/types.h
+./table_data.lo: ../../include/net-snmp/library/snmp_api.h
+./table_data.lo: ../../include/net-snmp/varbind_api.h
+./table_data.lo: ../../include/net-snmp/library/snmp_client.h
+./table_data.lo: ../../include/net-snmp/pdu_api.h
+./table_data.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./table_data.lo: ../../include/net-snmp/session_api.h
+./table_data.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./table_data.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./table_data.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./table_data.lo: ../../include/net-snmp/mib_api.h
+./table_data.lo: ../../include/net-snmp/library/parse.h
+./table_data.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./table_data.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_data.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./table_dataset.lo: ../../include/net-snmp/net-snmp-config.h
+./table_dataset.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./table_dataset.lo: ../../include/net-snmp/library/types.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_api.h
+./table_dataset.lo: ../../include/net-snmp/varbind_api.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_client.h
+./table_dataset.lo: ../../include/net-snmp/pdu_api.h
+./table_dataset.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./table_dataset.lo: ../../include/net-snmp/session_api.h
+./table_dataset.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./table_dataset.lo: ../../include/net-snmp/mib_api.h
+./table_dataset.lo: ../../include/net-snmp/library/parse.h
+./table_dataset.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./table_dataset.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_dataset.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./table_iterator.lo: ../../include/net-snmp/net-snmp-config.h
+./table_iterator.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./table_iterator.lo: ../../include/net-snmp/library/types.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_api.h
+./table_iterator.lo: ../../include/net-snmp/varbind_api.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_client.h
+./table_iterator.lo: ../../include/net-snmp/pdu_api.h
+./table_iterator.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./table_iterator.lo: ../../include/net-snmp/session_api.h
+./table_iterator.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./table_iterator.lo: ../../include/net-snmp/mib_api.h
+./table_iterator.lo: ../../include/net-snmp/library/parse.h
+./table_iterator.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./table_iterator.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/net-snmp-features.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/oid.h
+./table_row.lo: ../../include/net-snmp/library/types.h
+./table_row.lo: ../../include/net-snmp/library/snmp_api.h
+./table_row.lo: ../../include/net-snmp/varbind_api.h
+./table_row.lo: ../../include/net-snmp/library/snmp_client.h
+./table_row.lo: ../../include/net-snmp/pdu_api.h
+./table_row.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./table_row.lo: ../../include/net-snmp/session_api.h
+./table_row.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./table_row.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./table_row.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./table_row.lo: ../../include/net-snmp/mib_api.h
+./table_row.lo: ../../include/net-snmp/library/parse.h
+./table_row.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./table_row.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_row.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./table_tdata.lo: ../../include/net-snmp/net-snmp-config.h
+./table_tdata.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./table_tdata.lo: ../../include/net-snmp/library/types.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_api.h
+./table_tdata.lo: ../../include/net-snmp/varbind_api.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_client.h
+./table_tdata.lo: ../../include/net-snmp/pdu_api.h
+./table_tdata.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./table_tdata.lo: ../../include/net-snmp/session_api.h
+./table_tdata.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./table_tdata.lo: ../../include/net-snmp/mib_api.h
+./table_tdata.lo: ../../include/net-snmp/library/parse.h
+./table_tdata.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./table_tdata.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./table_tdata.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./watcher.lo: ../../include/net-snmp/net-snmp-config.h
+./watcher.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./watcher.lo: ../../include/net-snmp/library/types.h
+./watcher.lo: ../../include/net-snmp/library/snmp_api.h
+./watcher.lo: ../../include/net-snmp/varbind_api.h
+./watcher.lo: ../../include/net-snmp/library/snmp_client.h
+./watcher.lo: ../../include/net-snmp/pdu_api.h
+./watcher.lo: ../../include/net-snmp/library/asn1.h
+./watcher.lo: ../../include/net-snmp/output_api.h
+./watcher.lo: ../../include/net-snmp/library/snmp_debug.h
+./watcher.lo: ../../include/net-snmp/library/snmp_logging.h
+./watcher.lo: ../../include/net-snmp/session_api.h
+./watcher.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./watcher.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./watcher.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./watcher.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./watcher.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./watcher.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./watcher.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./watcher.lo: ../../include/net-snmp/library/ucd_compat.h
+./watcher.lo: ../../include/net-snmp/library/mib.h
+./watcher.lo: ../../include/net-snmp/mib_api.h
+./watcher.lo: ../../include/net-snmp/library/parse.h
+./watcher.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./watcher.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./watcher.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
diff --git a/agent/helpers/Makefile.in b/agent/helpers/Makefile.in
new file mode 100644
index 0000000..5178b79
--- /dev/null
+++ b/agent/helpers/Makefile.in
@@ -0,0 +1,38 @@
+#
+# Makefile for libnetsnmphelpers
+#
+
+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
+
+#
+# Build info
+#
+HELPERLIB = libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION)
+# -I. -I.. -I../..
+CPPFLAGS= $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(MIBGROUP_INCLUDES) \
+ $(SNMPLIB_INCLUDES) @CPPFLAGS@
+
+OBJS = dummy.o
+
+LOBJS = dummy.lo
+
+all: standardall
+
+libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION): $(LOBJS)
+ $(LIB_LD_CMD) $@ $(LOBJS) @LD_NO_UNDEFINED@ $(LDFLAGS) $(LIB_LD_LIBS)
+ $(RANLIB) $@
diff --git a/agent/helpers/all_helpers.c b/agent/helpers/all_helpers.c
new file mode 100644
index 0000000..e1e1b78
--- /dev/null
+++ b/agent/helpers/all_helpers.c
@@ -0,0 +1,58 @@
+/** @name handler
+ * @{ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#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>
+
+netsnmp_feature_child_of(mib_helpers, libnetsnmpagent)
+
+
+/** 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();
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATASET
+ netsnmp_init_table_dataset();
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATASET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_ROW_MERGE
+ netsnmp_init_row_merge();
+#endif /* NETSNMP_FEATURE_REMOVE_ROW_MERGE */
+#ifndef NETSNMP_FEATURE_REMOVE_STASH_CACHE
+ netsnmp_init_stash_cache_helper();
+#endif /* NETSNMP_FEATURE_REMOVE_STASH_CACHE */
+}
+
+/** @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/agent/helpers/baby_steps.c b/agent/helpers/baby_steps.c
new file mode 100644
index 0000000..d79acbc
--- /dev/null
+++ b/agent/helpers/baby_steps.c
@@ -0,0 +1,565 @@
+/*
+ * baby_steps.c
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+netsnmp_feature_provide(baby_steps)
+netsnmp_feature_child_of(baby_steps, mib_helpers)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_BABY_STEPS
+netsnmp_feature_require(check_requests_error)
+#endif
+
+#ifndef NETSNMP_FEATURE_REMOVE_BABY_STEPS
+
+#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 };
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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}
+};
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+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
+ * @{
+ */
+
+static netsnmp_baby_steps_modes *
+netsnmp_baby_steps_modes_ref(netsnmp_baby_steps_modes *md)
+{
+ md->refcnt++;
+ return md;
+}
+
+static void
+netsnmp_baby_steps_modes_deref(netsnmp_baby_steps_modes *md)
+{
+ if (--md->refcnt == 0)
+ free(md);
+}
+
+/** 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 {
+ md->refcnt = 1;
+ mh->myvoid = md;
+ mh->data_clone = (void *(*)(void *))netsnmp_baby_steps_modes_ref;
+ mh->data_free = (void (*)(void *))netsnmp_baby_steps_modes_deref;
+ 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 = (netsnmp_baby_steps_modes*)handler->myvoid;
+ netsnmp_assert(NULL != bs_modes);
+
+ switch (reqinfo->mode) {
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * 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;
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ || (save_mode < SNMP_MSG_INTERNAL_SET_COMMIT)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ ) {
+ 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.
+ */
+netsnmp_feature_child_of(netsnmp_baby_steps_handler_init,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_BABY_STEPS_HANDLER_INIT
+void
+netsnmp_baby_steps_handler_init(void)
+{
+ netsnmp_register_handler_by_name("baby_steps",
+ netsnmp_baby_steps_handler_get(BABY_STEP_ALL));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_BABY_STEPS_HANDLER_INIT */
+
+/** @} */
+
+/** @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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ netsnmp_assert("unknown flag");
+ break;
+ }
+ return 0;
+}
+/** @} */
+
+#else /* NETSNMP_FEATURE_REMOVE_BABY_STEPS */
+netsnmp_feature_unused(baby_steps);
+#endif /* NETSNMP_FEATURE_REMOVE_BABY_STEPS */
+
diff --git a/agent/helpers/bulk_to_next.c b/agent/helpers/bulk_to_next.c
new file mode 100644
index 0000000..e607eda
--- /dev/null
+++ b/agent/helpers/bulk_to_next.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/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/agent/helpers/cache_handler.c b/agent/helpers/cache_handler.c
new file mode 100644
index 0000000..520a4cf
--- /dev/null
+++ b/agent/helpers/cache_handler.c
@@ -0,0 +1,771 @@
+/* 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 (C) 2007 Apple, 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-features.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>
+
+netsnmp_feature_child_of(cache_handler, mib_helpers)
+
+netsnmp_feature_child_of(cache_find_by_oid, cache_handler)
+netsnmp_feature_child_of(cache_get_head, cache_handler)
+
+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 routine 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.
+ *
+ * If NETSNMP_CACHE_RESET_TIMER_ON_USE is set, the expiry timer will be
+ * reset on each cache access. In practice the 'timeout' becomes a timer
+ * which triggers when the cache is no longer needed. This is useful
+ * if the cache is automatically kept synchronized: e.g. by receiving
+ * change notifications from Netlink, inotify or similar. This should
+ * not be used if cache is not synchronized automatically as it would
+ * result in stale cache information when if polling happens too fast.
+ *
+ *
+ * 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
+ *
+ * Dynamically updated, unloaded after timeout:
+ * If the cache is kept up to date dynamically by listening for
+ * change notifications somehow, but it should not be in memory
+ * if it's not needed. Set the following flag:
+ *
+ * NETSNMP_CACHE_RESET_TIMER_ON_USE
+ *
+ * @{
+ */
+
+static void
+_cache_free( netsnmp_cache *cache );
+
+#ifndef NETSNMP_FEATURE_REMOVE_CACHE_GET_HEAD
+/** 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CACHE_GET_HEAD */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CACHE_FIND_BY_OID
+/** find existing cache
+ */
+netsnmp_cache *
+netsnmp_cache_find_by_oid(const 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CACHE_FIND_BY_OID */
+
+/** returns a cache
+ */
+netsnmp_cache *
+netsnmp_cache_create(int timeout, NetsnmpCacheLoad * load_hook,
+ NetsnmpCacheFree * free_hook,
+ const 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;
+}
+
+static netsnmp_cache *
+netsnmp_cache_ref(netsnmp_cache *cache)
+{
+ cache->refcnt++;
+ return cache;
+}
+
+static void
+netsnmp_cache_deref(netsnmp_cache *cache)
+{
+ if (--cache->refcnt == 0) {
+ netsnmp_cache_remove(cache);
+ netsnmp_cache_free(cache);
+ }
+}
+
+/** frees a cache
+ */
+int
+netsnmp_cache_free(netsnmp_cache *cache)
+{
+ netsnmp_cache *pos;
+
+ if (NULL == cache)
+ return SNMPERR_SUCCESS;
+
+ for (pos = cache_head; pos; pos = pos->next) {
+ if (pos == cache) {
+ size_t out_len = 0;
+ size_t buf_len = 0;
+ char *buf = NULL;
+
+ sprint_realloc_objid((u_char **) &buf, &buf_len, &out_len,
+ 1, pos->rootoid, pos->rootoid_len);
+ snmp_log(LOG_WARNING,
+ "not freeing cache with root OID %s (still in list)\n",
+ buf);
+ free(buf);
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+ if(0 != cache->timer_id)
+ netsnmp_cache_timer_stop(cache);
+
+ if (cache->valid)
+ _cache_free(cache);
+
+ if (cache->timestampM)
+ free(cache->timestampM);
+
+ if (cache->rootoid)
+ free(cache->rootoid);
+
+ free(cache);
+
+ return SNMPERR_SUCCESS;
+}
+
+/** removes a cache
+ */
+int
+netsnmp_cache_remove(netsnmp_cache *cache)
+{
+ netsnmp_cache *cur,*prev;
+
+ if (!cache || !cache_head)
+ return -1;
+
+ if (cache == cache_head) {
+ cache_head = cache_head->next;
+ if (cache_head)
+ cache_head->prev = NULL;
+ return 0;
+ }
+
+ prev = cache_head;
+ cur = cache_head->next;
+ for (; cur; prev = cur, cur = cur->next) {
+ if (cache == cur) {
+ prev->next = cur->next;
+ if (cur->next)
+ cur->next->prev = cur->prev;
+ return 0;
+ }
+ }
+ return -1;
+}
+
+/** 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 %lu 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 %lu 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;
+}
+
+/** Makes sure that memory allocated for the cache is freed when the handler
+ * is unregistered.
+ */
+void netsnmp_cache_handler_owns_cache(netsnmp_mib_handler *handler)
+{
+ netsnmp_assert(handler->myvoid);
+ ((netsnmp_cache *)handler->myvoid)->refcnt++;
+ handler->data_clone = (void *(*)(void *))netsnmp_cache_ref;
+ handler->data_free = (void(*)(void*))netsnmp_cache_deref;
+}
+
+/** 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,
+ const 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;
+ netsnmp_cache_handler_owns_cache(ret);
+ }
+ return ret;
+}
+
+/** functionally the same as calling netsnmp_register_handler() but also
+ * injects a cache handler at the same time for you. */
+netsnmp_feature_child_of(netsnmp_cache_handler_register,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_CACHE_HANDLER_REGISTER
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_CACHE_HANDLER_REGISTER */
+
+/** functionally the same as calling netsnmp_register_handler() but also
+ * injects a cache handler at the same time for you. */
+netsnmp_feature_child_of(netsnmp_register_cache_handler,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_REGISTER_CACHE_HANDLER
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_REGISTER_CACHE_HANDLER */
+
+static char *
+_build_cache_name(const char *name)
+{
+ char *dup = (char*)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_cache*)netsnmp_agent_get_list_data(reqinfo, cache_name);
+ SNMP_FREE(cache_name);
+ return result;
+}
+
+/** Extract the cache information for a given request (PDU) */
+netsnmp_feature_child_of(netsnmp_extract_cache_info,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_EXTRACT_CACHE_INFO
+netsnmp_cache *
+netsnmp_extract_cache_info(netsnmp_agent_request_info * reqinfo)
+{
+ return netsnmp_cache_reqinfo_extract(reqinfo, CACHE_NAME);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_EXTRACT_CACHE_INFO */
+
+
+/** 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->expired)
+ return 1;
+ if(!cache->valid || (NULL == cache->timestampM) || (-1 == cache->timeout))
+ cache->expired = 1;
+ else
+ cache->expired = netsnmp_ready_monotonic(cache->timestampM,
+ 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.
+ */
+netsnmp_feature_child_of(netsnmp_is_cache_valid,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_IS_CACHE_VALID
+int
+netsnmp_is_cache_valid(netsnmp_agent_request_info * reqinfo)
+{
+ return netsnmp_cache_is_valid(reqinfo, CACHE_NAME);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_IS_CACHE_VALID */
+
+/** 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)
+{
+ char addrstr[32];
+
+ 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;
+ }
+ snprintf(addrstr,sizeof(addrstr), "%ld", (long int)cache);
+ DEBUGMSGTL(("helper:cache_handler", "using cache %s: ", addrstr));
+ DEBUGMSGOID(("helper:cache_handler", cache->rootoid, cache->rootoid_len));
+ DEBUGMSG(("helper:cache_handler", "\n"));
+
+ /*
+ * 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE1:
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * 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, addrstr))
+ break;
+
+ /*
+ * 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, addrstr);
+ /** next handler called automatically - 'AUTO_NEXT' */
+ break;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_ACTION:
+ case MODE_SET_UNDO:
+ netsnmp_assert(netsnmp_cache_is_valid(reqinfo, addrstr));
+ /** next handler called automatically - 'AUTO_NEXT' */
+ break;
+
+ /*
+ * 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' */
+ break;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+ }
+ if (cache->flags & NETSNMP_CACHE_RESET_TIMER_ON_USE)
+ netsnmp_set_monotonic_marker(&cache->timestampM);
+ return SNMP_ERR_NOERROR;
+}
+
+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;
+ }
+ netsnmp_set_monotonic_marker(&cache->timestampM);
+ 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/agent/helpers/debug_handler.c b/agent/helpers/debug_handler.c
new file mode 100644
index 0000000..e4a8438
--- /dev/null
+++ b/agent/helpers/debug_handler.c
@@ -0,0 +1,166 @@
+/* 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/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);
+}
+
+#ifdef NETSNMP_NO_DEBUGGING
+
+#define debug_print_requests(x)
+
+#else /* NETSNMP_NO_DEBUGGING */
+
+/** @internal debug print variables in a chain */
+static 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"));
+ }
+ }
+}
+
+#endif /* NETSNMP_NO_DEBUGGING */
+
+/** @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)
+{
+ int ret;
+
+ DEBUGIF("helper:debug") {
+ netsnmp_mib_handler *hptr;
+ char *cp;
+ int i, count;
+
+ 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 = %p]", 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);
+
+ DEBUGIF("helper:debug") {
+ 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/agent/helpers/dummy.c b/agent/helpers/dummy.c
new file mode 100644
index 0000000..6979ae4
--- /dev/null
+++ b/agent/helpers/dummy.c
@@ -0,0 +1 @@
+char const netsnmp_helpers_dummy_text[] = "dummy symbol to make sure that linking netsnmphelpers does not fail on systems that do not support empty libraries.";
diff --git a/agent/helpers/instance.c b/agent/helpers/instance.c
new file mode 100644
index 0000000..a187d58
--- /dev/null
+++ b/agent/helpers/instance.c
@@ -0,0 +1,807 @@
+/* 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-features.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/instance.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/serialize.h>
+#include <net-snmp/agent/read_only.h>
+
+netsnmp_feature_provide(instance)
+netsnmp_feature_child_of(instance, mib_helpers)
+
+typedef struct netsnmp_num_file_instance_s {
+ int refcnt;
+ char *file_name;
+ FILE *filep;
+ u_char type;
+ int flags;
+} netsnmp_num_file_instance;
+
+/** @defgroup instance instance
+ * Process individual MIB instances easily.
+ * @ingroup leaf
+ * @{
+ */
+
+static netsnmp_num_file_instance *
+netsnmp_num_file_instance_ref(netsnmp_num_file_instance *nfi)
+{
+ nfi->refcnt++;
+ return nfi;
+}
+
+static void
+netsnmp_num_file_instance_deref(netsnmp_num_file_instance *nfi)
+{
+ if (--nfi->refcnt == 0) {
+ free(nfi->file_name);
+ free(nfi);
+ }
+}
+
+/**
+ * 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,
+ const oid * reg_oid, size_t reg_oid_len,
+ netsnmp_num_file_instance *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 = it;
+ myhandler->data_clone = (void*(*)(void*))netsnmp_num_file_instance_ref;
+ myhandler->data_free = (void(*)(void*))netsnmp_num_file_instance_deref;
+ netsnmp_inject_handler(myreg, myhandler);
+ } else {
+ myreg =
+ netsnmp_create_handler_registration(name,
+ scalarh,
+ reg_oid, reg_oid_len,
+ modes);
+ myreg->handler->myvoid = it;
+ myreg->handler->data_clone
+ = (void *(*)(void *))netsnmp_num_file_instance_ref;
+ myreg->handler->data_free
+ = (void (*)(void *))netsnmp_num_file_instance_deref;
+ }
+ if (contextName)
+ myreg->contextName = strdup(contextName);
+ return myreg;
+}
+
+/* Watched 'long' instances are writable on both 32-bit and 64-bit systems */
+netsnmp_feature_child_of(read_only_ulong_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_READ_ONLY_ULONG_INSTANCE
+int
+netsnmp_register_read_only_ulong_instance(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len, u_long * it,
+ Netsnmp_Node_Handler *
+ subhandler)
+{
+ return netsnmp_register_watched_instance2(
+ 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));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_READ_ONLY_ULONG_INSTANCE */
+
+netsnmp_feature_child_of(ulong_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_ULONG_INSTANCE
+int
+netsnmp_register_ulong_instance(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_instance2(
+ 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));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_ULONG_INSTANCE */
+
+netsnmp_feature_child_of(read_only_counter32_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_READ_ONLY_COUNTER32_INSTANCE
+int
+netsnmp_register_read_only_counter32_instance(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler *
+ subhandler)
+{
+ return netsnmp_register_watched_instance2(
+ 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));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_READ_ONLY_COUNTER32_INSTANCE */
+
+netsnmp_feature_child_of(read_only_long_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_READ_ONLY_LONG_INSTANCE
+int
+netsnmp_register_read_only_long_instance(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_instance2(
+ 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));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_READ_ONLY_LONG_INSTANCE */
+
+netsnmp_feature_child_of(long_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_LONG_INSTANCE
+int
+netsnmp_register_long_instance(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ long *it, Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_instance2(
+ 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));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LONG_INSTANCE */
+
+/* Watched 'int' instances are only writable on 32-bit systems */
+netsnmp_feature_child_of(read_only_uint_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_READ_ONLY_UINT_INSTANCE
+int
+netsnmp_register_read_only_uint_instance(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ unsigned int *it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_instance2(
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, HANDLER_CAN_RONLY),
+ netsnmp_create_watcher_info(
+ (void *)it, sizeof(unsigned int),
+ ASN_UNSIGNED, WATCHER_FIXED_SIZE));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_READ_ONLY_UINT_INSTANCE */
+
+netsnmp_feature_child_of(uint_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_UINT_INSTANCE
+int
+netsnmp_register_uint_instance(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ unsigned int *it, Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_instance2(
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, HANDLER_CAN_RWRITE),
+ netsnmp_create_watcher_info(
+ (void *)it, sizeof(unsigned int),
+ ASN_UNSIGNED, WATCHER_FIXED_SIZE));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UINT_INSTANCE */
+
+netsnmp_feature_child_of(read_only_int_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_READ_ONLY_INT_INSTANCE
+int
+netsnmp_register_read_only_int_instance(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ int *it, Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_instance2(
+ 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));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_READ_ONLY_INT_INSTANCE */
+
+ /*
+ * Compatibility with earlier (inconsistently named) routine
+ */
+netsnmp_feature_child_of(register_read_only_int_instance,netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_INT_INSTANCE
+int
+register_read_only_int_instance(const char *name,
+ const 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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_INT_INSTANCE */
+
+/*
+ * Context registrations
+ */
+
+netsnmp_feature_child_of(register_read_only_ulong_instance_context,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_ULONG_INSTANCE_CONTEXT
+int
+netsnmp_register_read_only_ulong_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler *
+ subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg =
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, HANDLER_CAN_RONLY);
+ if (myreg && contextName)
+ myreg->contextName = strdup(contextName);
+ return netsnmp_register_watched_instance2(
+ myreg, netsnmp_create_watcher_info(
+ (void *)it, sizeof(u_long), ASN_UNSIGNED, WATCHER_FIXED_SIZE));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_ULONG_INSTANCE_CONTEXT */
+
+netsnmp_feature_child_of(register_ulong_instance_context,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_ULONG_INSTANCE_CONTEXT
+int
+netsnmp_register_ulong_instance_context(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg =
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, HANDLER_CAN_RWRITE);
+ if (myreg && contextName)
+ myreg->contextName = strdup(contextName);
+ return netsnmp_register_watched_instance2(
+ myreg, netsnmp_create_watcher_info(
+ (void *)it, sizeof(u_long), ASN_UNSIGNED, WATCHER_FIXED_SIZE));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_ULONG_INSTANCE_CONTEXT */
+
+netsnmp_feature_child_of(register_read_only_counter32_instance_context,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_COUNTER32_INSTANCE_CONTEXT
+int
+netsnmp_register_read_only_counter32_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler *
+ subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg =
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, HANDLER_CAN_RONLY);
+ if (myreg && contextName)
+ myreg->contextName = strdup(contextName);
+ return netsnmp_register_watched_instance2(
+ myreg, netsnmp_create_watcher_info(
+ (void *)it, sizeof(u_long), ASN_COUNTER, WATCHER_FIXED_SIZE));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_COUNTER32_INSTANCE_CONTEXT */
+
+netsnmp_feature_child_of(register_read_only_long_instance_context,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_LONG_INSTANCE_CONTEXT
+int
+netsnmp_register_read_only_long_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler
+ *subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg =
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, HANDLER_CAN_RONLY);
+ if (myreg && contextName)
+ myreg->contextName = strdup(contextName);
+ return netsnmp_register_watched_instance2(
+ myreg, netsnmp_create_watcher_info(
+ (void *)it, sizeof(long), ASN_INTEGER, WATCHER_FIXED_SIZE));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_LONG_INSTANCE_CONTEXT */
+
+netsnmp_feature_child_of(register_long_instance_context,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_LONG_INSTANCE_CONTEXT
+int
+netsnmp_register_long_instance_context(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg =
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, HANDLER_CAN_RWRITE);
+ if (myreg && contextName)
+ myreg->contextName = strdup(contextName);
+ return netsnmp_register_watched_instance2(
+ myreg, netsnmp_create_watcher_info(
+ (void *)it, sizeof(long), ASN_INTEGER, WATCHER_FIXED_SIZE));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_LONG_INSTANCE_CONTEXT */
+
+netsnmp_feature_child_of(register_int_instance_context,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_INT_INSTANCE_CONTEXT
+int
+netsnmp_register_int_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ int *it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg =
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, HANDLER_CAN_RWRITE);
+ if (myreg && contextName)
+ myreg->contextName = strdup(contextName);
+ return netsnmp_register_watched_instance2(
+ myreg, netsnmp_create_watcher_info(
+ (void *)it, sizeof(int), ASN_INTEGER, WATCHER_FIXED_SIZE));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_INT_INSTANCE_CONTEXT */
+
+netsnmp_feature_child_of(register_read_only_int_instance_context,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_INT_INSTANCE_CONTEXT
+int
+netsnmp_register_read_only_int_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ int *it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg =
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, HANDLER_CAN_RONLY);
+ if (myreg && contextName)
+ myreg->contextName = strdup(contextName);
+ return netsnmp_register_watched_instance2(
+ myreg, netsnmp_create_watcher_info(
+ (void *)it, sizeof(int), ASN_INTEGER, WATCHER_FIXED_SIZE));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_INT_INSTANCE_CONTEXT */
+
+/*
+ * Compatibility with earlier (inconsistently named) routine
+ */
+netsnmp_feature_child_of(read_only_int_instance_context,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_READ_ONLY_INT_INSTANCE_CONTEXT
+int
+register_read_only_int_instance_context(const char *name,
+ const 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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_READ_ONLY_INT_INSTANCE_CONTEXT */
+
+netsnmp_feature_child_of(register_num_file_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_NUM_FILE_INSTANCE
+int
+netsnmp_register_num_file_instance(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ const 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;
+ }
+
+ nfi->refcnt = 1;
+ myreg = get_reg(name, "file_num_handler", reg_oid, reg_oid_len, nfi,
+ mode, netsnmp_instance_num_file_handler,
+ subhandler, contextName);
+ if (NULL == myreg) {
+ netsnmp_num_file_instance_deref(nfi);
+ 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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_NUM_FILE_INSTANCE */
+
+netsnmp_feature_child_of(register_int_instance,instance)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_INT_INSTANCE
+/**
+ * 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,
+ const oid * reg_oid, size_t reg_oid_len,
+ int *it, Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_instance2(
+ 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));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_INT_INSTANCE */
+
+#ifdef HAVE_DMALLOC_H
+static void free_wrapper(void * p)
+{
+ free(p);
+}
+#else
+#define free_wrapper free
+#endif
+
+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;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ u_long *it_save;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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_wrapper));
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ snmp_log(LOG_ERR,
+ "netsnmp_instance_num_file_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_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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+ default:
+ snmp_log(LOG_ERR,
+ "netsnmp_instance_helper_handler: illegal mode\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * got here only if illegal mode found
+ */
+ return SNMP_ERR_GENERR;
+}
+
+/** @}
+ */
diff --git a/agent/helpers/mode_end_call.c b/agent/helpers/mode_end_call.c
new file mode 100644
index 0000000..0bfcc69
--- /dev/null
+++ b/agent/helpers/mode_end_call.c
@@ -0,0 +1,127 @@
+/* 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-features.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>
+
+netsnmp_feature_provide(mode_end_call)
+netsnmp_feature_child_of(mode_end_call, mib_helpers)
+
+#ifndef NETSNMP_FEATURE_REMOVE_MODE_END_CALL
+/** @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 = (netsnmp_mode_handler_list*)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;
+}
+#else
+netsnmp_feature_unused(mode_end_call);
+#endif /* NETSNMP_FEATURE_REMOVE_MODE_END_CALL */
+
+
+/** @} */
+
diff --git a/agent/helpers/multiplexer.c b/agent/helpers/multiplexer.c
new file mode 100644
index 0000000..2a7a664
--- /dev/null
+++ b/agent/helpers/multiplexer.c
@@ -0,0 +1,119 @@
+#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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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
+ */
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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/agent/helpers/null.c b/agent/helpers/null.c
new file mode 100644
index 0000000..97dfc92
--- /dev/null
+++ b/agent/helpers/null.c
@@ -0,0 +1,65 @@
+#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/null.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+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);
+ if (reginfo != NULL) {
+ 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 | HANDLER_CAN_GETBULK;
+ }
+ 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/agent/helpers/old_api.c b/agent/helpers/old_api.c
new file mode 100644
index 0000000..4888cbc
--- /dev/null
+++ b/agent/helpers/old_api.c
@@ -0,0 +1,461 @@
+#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/old_api.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/agent/agent_callbacks.h>
+
+#include <stddef.h>
+
+#define MIB_CLIENTS_ARE_EVIL 1
+
+#ifdef HAVE_DMALLOC_H
+static void free_wrapper(void * p)
+{
+ free(p);
+}
+#else
+#define free_wrapper free
+#endif
+
+/*
+ * 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);
+}
+
+struct variable *
+netsnmp_duplicate_variable(struct variable *var)
+{
+ struct variable *var2 = NULL;
+
+ if (var) {
+ const int varsize = offsetof(struct variable, name) + var->namelen * sizeof(var->name[0]);
+ var2 = malloc(varsize);
+ if (var2)
+ memcpy(var2, var, varsize);
+ }
+ return var2;
+}
+
+/** 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,
+ const 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);
+ if (reginfo == NULL)
+ return SNMP_ERR_GENERR;
+
+ vp = netsnmp_duplicate_variable((struct variable *)
+ ((char *) var + varsize * i));
+
+ 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));
+ if (reginfo->rootoid == NULL) {
+ SNMP_FREE(vp);
+ SNMP_FREE(reginfo->handlerName);
+ SNMP_FREE(reginfo);
+ return SNMP_ERR_GENERR;
+ }
+
+ memcpy(reginfo->rootoid, mibloc, mibloclen * sizeof(oid));
+ memcpy(reginfo->rootoid + mibloclen, vp->name, vp->namelen
+ * sizeof(oid));
+ reginfo->handler->myvoid = (void *) vp;
+ reginfo->handler->data_clone
+ = (void *(*)(void *))netsnmp_duplicate_variable;
+ reginfo->handler->data_free = free;
+
+ 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); already freed */
+ }
+ }
+ 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 = netsnmp_duplicate_variable(vr);
+ r->handler->data_clone = (void *(*)(void *))netsnmp_duplicate_variable;
+ r->handler->data_free = free;
+
+ if (r->handler->myvoid == NULL) {
+ netsnmp_handler_registration_free(r);
+ rc = MIB_REGISTRATION_FAILED;
+ break;
+ }
+
+ 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;
+ netsnmp_old_api_cache *cacheptr;
+ netsnmp_agent_session *oldasp = NULL;
+ u_char *access = NULL;
+ WriteMethod *write_method = NULL;
+ size_t len;
+ size_t tmp_len;
+ oid tmp_name[MAX_OID_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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE1:
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ /*
+ * 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
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (reqinfo->mode != MODE_SET_RESERVE1)
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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)
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (reqinfo->mode != MODE_SET_RESERVE1)
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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_wrapper));
+ /*
+ * 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(void)
+{
+ return current_agent_session;
+}
+
+/*
+ * don't use this!
+ */
+void
+set_current_agent_session(netsnmp_agent_session *asp)
+{
+ current_agent_session = asp;
+}
diff --git a/agent/helpers/read_only.c b/agent/helpers/read_only.c
new file mode 100644
index 0000000..0b06d4f
--- /dev/null
+++ b/agent/helpers/read_only.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/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) {
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ case MODE_GET:
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+ }
+
+ netsnmp_request_set_error_all(requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR;
+}
+
+/** 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/agent/helpers/row_merge.c b/agent/helpers/row_merge.c
new file mode 100644
index 0000000..4a8e476
--- /dev/null
+++ b/agent/helpers/row_merge.c
@@ -0,0 +1,381 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/row_merge.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+netsnmp_feature_provide(row_merge)
+netsnmp_feature_child_of(row_merge, row_merge_all)
+netsnmp_feature_child_of(row_merge_all, mib_helpers)
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_ROW_MERGE
+/** @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. */
+netsnmp_feature_child_of(register_row_merge, row_merge_all)
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_ROW_MERGE
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_ROW_MERGE */
+
+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) || ((size_t)rc >= sizeof(buf))) {
+ snmp_log(LOG_ERR,"error creating key\n");
+ return NULL;
+ }
+
+ rm_status = (netsnmp_row_merge_status*)netsnmp_agent_get_list_data(reqinfo, buf);
+ if ((NULL == rm_status) && create_missing) {
+ netsnmp_data_list *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));
+}
+#else /* NETSNMP_FEATURE_REMOVE_ROW_MERGE */
+netsnmp_feature_unused(row_merge);
+#endif /* NETSNMP_FEATURE_REMOVE_ROW_MERGE */
+
+
+/** @} */
+
diff --git a/agent/helpers/scalar.c b/agent/helpers/scalar.c
new file mode 100644
index 0000000..7a4c9e0
--- /dev/null
+++ b/agent/helpers/scalar.c
@@ -0,0 +1,199 @@
+/* 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/scalar.h>
+
+#include <stdlib.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#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 = (oid*)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 = (oid*)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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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/agent/helpers/scalar_group.c b/agent/helpers/scalar_group.c
new file mode 100644
index 0000000..6b7f098
--- /dev/null
+++ b/agent/helpers/scalar_group.c
@@ -0,0 +1,209 @@
+#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_group.h>
+
+#include <stdlib.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/agent/instance.h>
+#include <net-snmp/agent/serialize.h>
+
+static netsnmp_scalar_group*
+clone_scalar_group(netsnmp_scalar_group* src)
+{
+ netsnmp_scalar_group *t = SNMP_MALLOC_TYPEDEF(netsnmp_scalar_group);
+ if(t != NULL) {
+ t->lbound = src->lbound;
+ t->ubound = src->ubound;
+ }
+ return t;
+}
+
+/** @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;
+ ret->data_free = free;
+ ret->data_clone = (void *(*)(void *))clone_scalar_group;
+ }
+ }
+ 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_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 */
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_UNDO:
+ case MODE_SET_FREE:
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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_len += 2;
+ reginfo->rootoid = root_tmp;
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ reginfo->rootoid = root_save;
+ reginfo->rootoid_len -= 2;
+ 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_len += 2;
+ 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 - 1);
+ requests->requestvb->name[reginfo->rootoid_len - 2] = ++subid;
+ requests->requestvb->type = ASN_PRIV_RETRY;
+ }
+ reginfo->rootoid = root_save;
+ reginfo->rootoid_len -= 2;
+ return ret;
+ }
+ /*
+ * got here only if illegal mode found
+ */
+ return SNMP_ERR_GENERR;
+}
+
+/** @}
+ */
diff --git a/agent/helpers/serialize.c b/agent/helpers/serialize.c
new file mode 100644
index 0000000..eec66b4
--- /dev/null
+++ b/agent/helpers/serialize.c
@@ -0,0 +1,93 @@
+#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/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/agent/helpers/snmp_get_statistic.c b/agent/helpers/snmp_get_statistic.c
new file mode 100644
index 0000000..efac2ac
--- /dev/null
+++ b/agent/helpers/snmp_get_statistic.c
@@ -0,0 +1,61 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/snmp_get_statistic.h>
+
+netsnmp_feature_provide(helper_statistics)
+netsnmp_feature_child_of(helper_statistics, mib_helpers)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_HELPER_STATISTICS
+/* if we're not needed, then neither is this */
+netsnmp_feature_require(statistics)
+#endif
+
+#ifndef NETSNMP_FEATURE_REMOVE_HELPER_STATISTICS
+static int
+netsnmp_get_statistic_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ if (reqinfo->mode == MODE_GET) {
+ const oid idx = requests->requestvb->name[reginfo->rootoid_len - 2] +
+ (oid)(uintptr_t)handler->myvoid;
+ uint32_t value;
+
+ if (idx > NETSNMP_STAT_MAX_STATS)
+ return SNMP_ERR_GENERR;
+ value = snmp_get_statistic(idx);
+ snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER,
+ (const u_char*)&value, sizeof(value));
+ return SNMP_ERR_NOERROR;
+ }
+ return SNMP_ERR_GENERR;
+}
+
+static netsnmp_mib_handler *
+netsnmp_get_statistic_handler(int offset)
+{
+ netsnmp_mib_handler *ret =
+ netsnmp_create_handler("get_statistic",
+ netsnmp_get_statistic_helper_handler);
+ if (ret) {
+ ret->flags |= MIB_HANDLER_AUTO_NEXT;
+ ret->myvoid = (void*)(uintptr_t)offset;
+ }
+ return ret;
+}
+
+int
+netsnmp_register_statistic_handler(netsnmp_handler_registration *reginfo,
+ oid start, int begin, int end)
+{
+ netsnmp_inject_handler(reginfo,
+ netsnmp_get_statistic_handler(begin - start));
+ return netsnmp_register_scalar_group(reginfo, start, start + (end - begin));
+}
+#else /* !NETSNMP_FEATURE_REMOVE_HELPER_GET_STATISTICS */
+netsnmp_feature_unused(helper_statistics);
+#endif /* !NETSNMP_FEATURE_REMOVE_HELPER_GET_STATISTICS */
diff --git a/agent/helpers/stash_cache.c b/agent/helpers/stash_cache.c
new file mode 100644
index 0000000..5da1796
--- /dev/null
+++ b/agent/helpers/stash_cache.c
@@ -0,0 +1,252 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+netsnmp_feature_provide(stash_cache)
+netsnmp_feature_child_of(stash_cache, mib_helpers)
+#ifdef NETSNMP_FEATURE_REQUIRE_STASH_CACHE
+netsnmp_feature_require(oid_stash)
+netsnmp_feature_require(oid_stash_iterate)
+netsnmp_feature_require(oid_stash_get_data)
+#endif
+
+#ifndef NETSNMP_FEATURE_REMOVE_STASH_CACHE
+#include <net-snmp/agent/stash_to_next.h>
+
+#include <net-snmp/agent/stash_cache.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 alleviate
+ * 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);
+ if (cinfo != NULL)
+ 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;
+ netsnmp_cache_handler_owns_cache(handler);
+
+ 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_oid_stash_node**)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_variable_list*)
+ 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);
+ }
+ }
+ 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 = (netsnmp_variable_list*)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);
+ }
+ }
+ }
+ break;
+
+ default:
+ cinfo->cache_valid = 0;
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+/** 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());
+}
+/** @} */
+
+#else /* NETSNMP_FEATURE_REMOVE_STASH_CACHE */
+netsnmp_feature_unused(stash_cache);
+#endif /* NETSNMP_FEATURE_REMOVE_STASH_CACHE */
diff --git a/agent/helpers/stash_to_next.c b/agent/helpers/stash_to_next.c
new file mode 100644
index 0000000..d7baffd
--- /dev/null
+++ b/agent/helpers/stash_to_next.c
@@ -0,0 +1,129 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+netsnmp_feature_provide(stash_to_next)
+netsnmp_feature_child_of(stash_to_next, mib_helpers)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_STASH_TO_NEXT
+netsnmp_feature_require(oid_stash)
+netsnmp_feature_require(oid_stash_add_data)
+#endif
+
+#ifndef NETSNMP_FEATURE_REMOVE_STASH_TO_NEXT
+#include <net-snmp/agent/stash_to_next.h>
+
+#include <net-snmp/agent/stash_cache.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;
+}
+/** @} */
+
+#else /* ! NETSNMP_FEATURE_REMOVE_STASH_TO_NEXT */
+netsnmp_feature_unused(stash_to_next);
+#endif /* ! NETSNMP_FEATURE_REMOVE_STASH_TO_NEXT */
diff --git a/agent/helpers/table.c b/agent/helpers/table.c
new file mode 100644
index 0000000..882e84c
--- /dev/null
+++ b/agent/helpers/table.c
@@ -0,0 +1,1290 @@
+/*
+ * 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.
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright (C) 2007 Apple, 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table.h>
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(oid_stash)
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/library/snmp_assert.h>
+
+netsnmp_feature_child_of(table_all, mib_helpers)
+
+netsnmp_feature_child_of(table_build_result, table_all)
+netsnmp_feature_child_of(table_get_or_create_row_stash, table_all)
+netsnmp_feature_child_of(registration_owns_table_info, table_all)
+netsnmp_feature_child_of(table_sparse, table_all)
+
+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;
+}
+
+/** Configures a handler such that table registration information is freed by
+ * netsnmp_handler_free(). Should only be called if handler->myvoid points to
+ * an object of type netsnmp_table_registration_info.
+ */
+void netsnmp_handler_owns_table_info(netsnmp_mib_handler *handler)
+{
+ netsnmp_assert(handler);
+ netsnmp_assert(handler->myvoid);
+ handler->data_clone
+ = (void *(*)(void *)) netsnmp_table_registration_info_clone;
+ handler->data_free
+ = (void (*)(void *)) netsnmp_table_registration_info_free;
+}
+
+/** Configures a handler such that table registration information is freed by
+ * netsnmp_handler_free(). Should only be called if reg->handler->myvoid
+ * points to an object of type netsnmp_table_registration_info.
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTRATION_OWNS_TABLE_INFO
+void netsnmp_registration_owns_table_info(netsnmp_handler_registration *reg)
+{
+ if (reg)
+ netsnmp_handler_owns_table_info(reg->handler);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTRATION_OWNS_TABLE_INFO */
+
+/** 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)
+{
+ int rc = netsnmp_inject_handler(reginfo, netsnmp_get_table_handler(tabreq));
+ if (SNMPERR_SUCCESS != rc)
+ return rc;
+
+ return netsnmp_register_handler(reginfo);
+}
+
+int
+netsnmp_unregister_table(netsnmp_handler_registration *reginfo)
+{
+ /* Locate "this" reginfo */
+ /* SNMP_FREE(reginfo->myvoid); */
+ return netsnmp_unregister_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;
+ ssize_t tmp_len;
+ int incomplete, out_of_range;
+ 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 %s (%d) mode request for handler %s: base oid:",
+ se_find_label_in_slist("agent_mode", reqinfo->mode),
+ reqinfo->mode, 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)) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (MODE_IS_SET(reqinfo->mode)) {
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ } else {
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+/** XXX-rks: memory leak. add cleanup handler? */
+ netsnmp_free_agent_data_sets(reqinfo);
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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(("helper:table","no table info for set - skipping\n"));
+ }
+ else
+ need_processing = 1;
+ }
+ else {
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ /*
+ * for GETS, only continue if we have at least one valid request.
+ * for RESERVE1, only continue if we have indexes for all requests.
+ */
+
+ /*
+ * 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;
+ }
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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, NULL, NULL, NULL)) {
+ 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);
+ }
+ }
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * 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)
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (reqinfo->mode == MODE_SET_RESERVE1)
+ table_helper_cleanup(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ else
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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);
+ if (tbl_req_info == NULL) {
+ table_helper_cleanup(reqinfo, request,
+ SNMP_ERR_GENERR);
+ continue;
+ }
+ 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 (%" NETSNMP_PRIo "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)
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (reqinfo->mode == MODE_SET_RESERVE1)
+ table_helper_cleanup(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ else if (reqinfo->mode == MODE_GET)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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 "
+ "%" NETSNMP_PRIo "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 %lu bytes of index\n",
+ (unsigned long)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);
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ } else if (reqinfo->mode == MODE_SET_RESERVE1 ) {
+ table_helper_cleanup(reqinfo, request, SNMP_ERR_NOTWRITABLE);
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ }
+ 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) {
+ size_t parsed_oid_len;
+
+ 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)
+ */
+ tmp_len = 0;
+ tmp_name = NULL;
+ break;
+ }
+ /*
+ * try and parse current index
+ */
+ netsnmp_assert(tmp_len >= 0);
+ parsed_oid_len = tmp_len;
+ if (parse_one_oid_index(&tmp_name, &parsed_oid_len,
+ vb, 1) != SNMPERR_SUCCESS) {
+ incomplete = 1;
+ tmp_len = -1; /* is this necessary? Better safe than
+ * sorry */
+ } else {
+ tmp_len = parsed_oid_len;
+ DEBUGMSGTL(("helper:table", " got 1 (incomplete=%d)\n",
+ incomplete));
+ /*
+ * do not count incomplete indexes
+ */
+ 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") {
+ unsigned int count;
+ u_char *buf = NULL;
+ size_t buf_len = 0, out_len = 0;
+ DEBUGMSGTL(("helper:table:results", " found %d indexes\n",
+ tbl_req_info->number_indexes));
+ 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, NULL, NULL, NULL)) {
+ 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 sufficient 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"));
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if ( MODE_IS_SET(reqinfo->mode) ) {
+ /*
+ * no point in continuing without indexes for set.
+ */
+ netsnmp_assert(reqinfo->mode == MODE_SET_RESERVE1);
+ /** clear first request so we wont try to run FREE mode */
+ netsnmp_free_request_data_sets(requests);
+ /** set actual error */
+ table_helper_cleanup(reqinfo, request, SNMP_ERR_NOCREATION);
+ need_processing = 0; /* don't call next handler */
+ break;
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ table_helper_cleanup(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ netsnmp_assert(request->status == SNMP_ERR_NOERROR);
+
+ ++need_processing;
+
+ } /* for each request */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * 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
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_SPARSE
+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_mib_handler *handler1, *handler2;
+ int rc;
+
+ handler1 = netsnmp_create_handler(SPARSE_TABLE_HANDLER_NAME,
+ sparse_table_helper_handler);
+ if (NULL == handler1)
+ return SNMP_ERR_GENERR;
+
+ handler2 = netsnmp_get_table_handler(tabreq);
+ if (NULL == handler2 ) {
+ netsnmp_handler_free(handler1);
+ return SNMP_ERR_GENERR;
+ }
+
+ rc = netsnmp_inject_handler(reginfo, handler1);
+ if (SNMPERR_SUCCESS != rc) {
+ netsnmp_handler_free(handler1);
+ netsnmp_handler_free(handler2);
+ return rc;
+ }
+
+ rc = netsnmp_inject_handler(reginfo, handler2);
+ if (SNMPERR_SUCCESS != rc) {
+ /** handler1 is in reginfo... remove and free?? */
+ netsnmp_handler_free(handler2);
+ return rc;
+ }
+
+ /** both handlers now in reginfo, so nothing to do on error */
+ return netsnmp_register_handler(reginfo);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_SPARSE */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_BUILD_RESULT
+/** 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_BUILD_RESULT */
+
+/** 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;
+ snmp_set_var_objid( var, tmpoid, 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;
+}
+
+netsnmp_table_registration_info *
+netsnmp_table_registration_info_clone(netsnmp_table_registration_info *tri)
+{
+ netsnmp_table_registration_info *copy;
+ copy = malloc(sizeof(*copy));
+ if (copy) {
+ *copy = *tri;
+ copy->indexes = snmp_clone_varbind(tri->indexes);
+ if (!copy->indexes) {
+ free(copy);
+ copy = NULL;
+ }
+ }
+ return copy;
+}
+
+void
+netsnmp_table_registration_info_free(netsnmp_table_registration_info *tri)
+{
+ if (NULL == tri)
+ return;
+
+ if (NULL != tri->indexes)
+ snmp_free_varbind(tri->indexes);
+
+#if 0
+ /*
+ * sigh... example use of valid_columns points to static memory,
+ * so freeing it would be bad... we'll just have to live with any
+ * leaks, for now...
+ */
+#endif
+
+ free(tri);
+}
+
+/** @} */
+
+/*
+ * 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
+netsnmp_table_helper_add_indexes(netsnmp_table_registration_info *tinfo,
+ ...)
+{
+ va_list debugargs;
+ int type;
+
+ va_start(debugargs, tinfo);
+ while ((type = va_arg(debugargs, int)) != 0) {
+ netsnmp_table_helper_add_index(tinfo, type);
+ }
+ va_end(debugargs);
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_GET_OR_CREATE_ROW_STASH
+/** 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, (const char *) 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((const char *) storage_name,
+ stashp,
+ _row_stash_data_list_free));
+ }
+ return stashp;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_GET_OR_CREATE_ROW_STASH */
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * 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/agent/helpers/table_array.c b/agent/helpers/table_array.c
new file mode 100644
index 0000000..7c98aae
--- /dev/null
+++ b/agent/helpers/table_array.c
@@ -0,0 +1,919 @@
+/*
+ * table_array.c
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table_array.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/snmp_assert.h>
+
+netsnmp_feature_child_of(table_array_all, mib_helpers)
+
+netsnmp_feature_child_of(table_array_register,table_array_all)
+netsnmp_feature_child_of(table_array_find_table_array_handler,table_array_all)
+netsnmp_feature_child_of(table_array_extract_array_context,table_array_all)
+netsnmp_feature_child_of(table_array_check_row_status,table_array_all)
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER
+
+/*
+ * 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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_ARRAY_REGISTER
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_ARRAY_REGISTER */
+
+/** find the handler for the table_array helper. */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_ARRAY_FIND_TABLE_ARRAY_HANDLER
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_ARRAY_FIND_TABLE_ARRAY_HANDLER */
+
+/** find the context data used by the table_array helper */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_ARRAY_EXTRACT_ARRAY_CONTEXT
+netsnmp_container *
+netsnmp_extract_array_context(netsnmp_request_info *request)
+{
+ return (netsnmp_container*)netsnmp_request_get_list_data(request, TABLE_ARRAY_NAME);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_ARRAY_EXTRACT_ARRAY_CONTEXT */
+
+/** this function is called to validate RowStatus transitions. */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_ARRAY_CHECK_ROW_STATUS
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_ARRAY_CHECK_ROW_STATUS */
+
+/** @} */
+
+/** @cond */
+/**********************************************************************
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * *
+ * *
+ * EVERYTHING BELOW THIS IS PRIVATE IMPLEMENTATION DETAILS. *
+ * *
+ * *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * Structures, Utility/convenience functions *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+/*
+ * context info for SET requests
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+typedef struct set_context_s {
+ netsnmp_agent_request_info *agtreq_info;
+ table_container_data *tad;
+ int status;
+} set_context;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+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];
+
+ if (!tblreq_info || !reginfo || !row || !current)
+ return;
+
+ 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 = (netsnmp_index*)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_index *row, *tmp, index;
+ netsnmp_request_info *current;
+ netsnmp_request_group *g;
+ netsnmp_request_group_item *i;
+
+ for (current = requests; current; current = current->next) {
+ /*
+ * 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 = (netsnmp_index*)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);
+ if (i == NULL)
+ return;
+ 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);
+ if (i == NULL || g == NULL) {
+ SNMP_FREE(i);
+ SNMP_FREE(g);
+ return;
+ }
+ 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 = (netsnmp_index*)CONTAINER_FIND(tad->table, &index);
+ if (!g->existing_row) {
+ if (!tad->cb->create_row) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if(MODE_IS_SET(agtreq_info->mode))
+ netsnmp_set_request_error(agtreq_info, current,
+ SNMP_ERR_NOTWRITABLE);
+ else
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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 ... ) */
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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);
+}
+
+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;
+}
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * 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]));
+ }
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER */
+/** @endcond */
diff --git a/agent/helpers/table_container.c b/agent/helpers/table_container.c
new file mode 100644
index 0000000..08e9741
--- /dev/null
+++ b/agent/helpers/table_container.c
@@ -0,0 +1,876 @@
+/*
+ * table_container.c
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table_container.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/snmp_assert.h>
+
+netsnmp_feature_provide(table_container)
+netsnmp_feature_child_of(table_container, table_container_all)
+netsnmp_feature_child_of(table_container_replace_row, table_container_all)
+netsnmp_feature_child_of(table_container_extract, table_container_all)
+netsnmp_feature_child_of(table_container_management, table_container_all)
+netsnmp_feature_child_of(table_container_row_remove, table_container_all)
+netsnmp_feature_child_of(table_container_row_insert, table_container_all)
+netsnmp_feature_child_of(table_container_all, mib_helpers)
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER
+
+/*
+ * 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 {
+
+ /** Number of handlers whose myvoid pointer points to this structure. */
+ int refcnt;
+
+ /** 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
+ *
+ * ================================== */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_MANAGEMENT
+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 = (char)(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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_MANAGEMENT */
+
+ /*
+ * 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_REPLACE_ROW
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_REPLACE_ROW */
+
+ /* netsnmp_tcontainer_remove_delete_row() will be table-specific too */
+
+
+/* ==================================
+ *
+ * Container Table API: MIB maintenance
+ *
+ * ================================== */
+
+static container_table_data *
+netsnmp_container_table_data_clone(container_table_data *tad)
+{
+ ++tad->refcnt;
+ return tad;
+}
+
+static void
+netsnmp_container_table_data_free(container_table_data *tad)
+{
+ if (--tad->refcnt == 0)
+ free(tad);
+}
+
+/** 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->refcnt = 1;
+ 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->data_clone = (void *(*)(void *))netsnmp_container_table_data_clone;
+ handler->data_free = (void (*)(void *))netsnmp_container_table_data_free;
+ 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);
+}
+
+int
+netsnmp_container_table_unregister(netsnmp_handler_registration *reginfo)
+{
+ container_table_data *tad;
+
+ if (!reginfo)
+ return MIB_UNREGISTRATION_FAILED;
+ tad = (container_table_data *)
+ netsnmp_find_handler_data_by_name(reginfo, "table_container");
+ if (tad) {
+ CONTAINER_FREE( tad->table );
+ tad->table = NULL;
+ /*
+ * Note: don't free the memory tad points at here - that is done
+ * by netsnmp_container_table_data_free().
+ */
+ }
+ return netsnmp_unregister_table( reginfo );
+}
+
+/** retrieve the container used by the table_container helper */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_EXTRACT
+netsnmp_container*
+netsnmp_container_table_container_extract(netsnmp_request_info *request)
+{
+ return (netsnmp_container *)
+ netsnmp_request_get_list_data(request, TABLE_CONTAINER_CONTAINER);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_EXTRACT */
+
+#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 */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_ROW_INSERT
+/** 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));
+ }
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_ROW_INSERT */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_ROW_REMOVE
+/** removes a table_container entry from a request list */
+void
+netsnmp_container_table_row_remove(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_remove_list_data(req, TABLE_CONTAINER_ROW);
+ }
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER_ROW_REMOVE */
+
+/** @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 = (netsnmp_index*)_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 = (netsnmp_index*)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"));
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if((agtreq_info->mode != MODE_SET_RESERVE1) || /* get */
+ (reginfo->modes & HANDLER_CAN_NOT_CREATE)) { /* no create */
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ netsnmp_set_request_error(agtreq_info, request,
+ SNMP_NOSUCHINSTANCE);
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ }
+ } /** 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)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ || (MODE_SET_RESERVE1 == oldmode)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ ) {
+ 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 (netsnmp_index*)_find_next_row(c, tblreq, NULL );
+}
+
+/* ==================================
+ *
+ * Container Table API: Index operations
+ *
+ * ================================== */
+
+#else /* NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER */
+netsnmp_feature_unused(table_container);
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_CONTAINER */
+/** @} */
+
+
diff --git a/agent/helpers/table_data.c b/agent/helpers/table_data.c
new file mode 100644
index 0000000..75ddc1d
--- /dev/null
+++ b/agent/helpers/table_data.c
@@ -0,0 +1,1069 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table_data.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/read_only.h>
+
+netsnmp_feature_child_of(table_data_all, mib_helpers)
+
+netsnmp_feature_child_of(table_data, table_data_all)
+netsnmp_feature_child_of(register_read_only_table_data, table_data_all)
+netsnmp_feature_child_of(extract_table_row_data, table_data_all)
+netsnmp_feature_child_of(insert_table_row, table_data_all)
+netsnmp_feature_child_of(table_data_delete_table, table_data_all)
+
+netsnmp_feature_child_of(table_data_extras, table_data_all)
+
+netsnmp_feature_child_of(table_data_create_table, table_data_extras)
+netsnmp_feature_child_of(table_data_create_row, table_data_extras)
+netsnmp_feature_child_of(table_data_copy_row, table_data_extras)
+netsnmp_feature_child_of(table_data_remove_delete_row, table_data_extras)
+netsnmp_feature_child_of(table_data_unregister, table_data_extras)
+netsnmp_feature_child_of(table_data_row_count, table_data_extras)
+netsnmp_feature_child_of(table_data_row_operations, table_data_extras)
+netsnmp_feature_child_of(table_data_row_first, table_data_extras)
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA
+
+/** @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) {
+ free(newrow);
+ return NULL;
+ }
+ }
+
+ if (row->index_oid) {
+ newrow->index_oid =
+ snmp_duplicate_objid(row->index_oid, row->index_oid_len);
+ if (!newrow->index_oid) {
+ free(newrow->indexes);
+ free(newrow);
+ 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! */
+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
+ * ===================================== */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_CREATE_TABLE
+netsnmp_table_data *
+netsnmp_table_data_create_table(const char *name, long flags)
+{
+ return netsnmp_create_table_data( name );
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_CREATE_TABLE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_DELETE_TABLE
+void
+netsnmp_table_data_delete_table( netsnmp_table_data *table )
+{
+ netsnmp_table_row *row, *nextrow;
+
+ if (!table)
+ return;
+
+ snmp_free_varbind(table->indexes_template);
+ table->indexes_template = NULL;
+
+ 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;
+
+ SNMP_FREE(table->name);
+ SNMP_FREE(table);
+ return;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_DELETE_TABLE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_CREATE_ROW
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_CREATE_ROW */
+
+ /* netsnmp_table_data_clone_row() defined above */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_COPY_ROW
+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)
+ new_row->index_oid =
+ snmp_duplicate_objid(old_row->index_oid, old_row->index_oid_len);
+ /* XXX - Doesn't copy table-specific row structure */
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_COPY_ROW */
+
+ /*
+ * netsnmp_table_data_delete_row()
+ * netsnmp_table_data_add_row()
+ * netsnmp_table_data_replace_row()
+ * netsnmp_table_data_remove_row()
+ * all defined above
+ */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_REMOVE_DELETE_ROW
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_REMOVE_DELETE_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);
+}
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_TABLE_DATA
+/** 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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_READ_ONLY_TABLE_DATA */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_UNREGISTER
+int
+netsnmp_unregister_table_data(netsnmp_handler_registration *reginfo)
+{
+ /* free table; */
+ return netsnmp_unregister_table(reginfo);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_UNREGISTER */
+
+/*
+ * 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE1:
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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
+ */
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ }
+ }
+
+ 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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_EXTRACT_TABLE_ROW_DATA
+/** 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_EXTRACT_TABLE_ROW_DATA */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INSERT_TABLE_ROW
+/** inserts a newly created table_data row into a request */
+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));
+ }
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INSERT_TABLE_ROW */
+
+/* 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
+ * ===================================== */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_ROW_FIRST
+netsnmp_table_row *
+netsnmp_table_data_row_first(netsnmp_table_data *table)
+{
+ return netsnmp_table_data_get_first_row(table);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_ROW_FIRST */
+
+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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_ROW_COUNT
+int
+netsnmp_table_data_row_count(netsnmp_table_data *table)
+{
+ return netsnmp_table_data_num_rows(table);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_ROW_COUNT */
+
+
+/* ==================================
+ *
+ * Table Data API: Row operations
+ * (table-specific rows)
+ *
+ * ================================== */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_ROW_OPERATIONS
+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 );
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_ROW_OPERATIONS */
+
+ /* =====================================
+ * Generic API - mostly renamed wrappers
+ * ===================================== */
+
+/* ==================================
+ *
+ * Table Data API: Index operations
+ *
+ * ================================== */
+
+#else /* NETSNMP_FEATURE_REMOVE_TABLE_DATA */
+netsnmp_feature_unused(table_data);
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA */
+
+/** @}
+ */
diff --git a/agent/helpers/table_dataset.c b/agent/helpers/table_dataset.c
new file mode 100644
index 0000000..0949a8a
--- /dev/null
+++ b/agent/helpers/table_dataset.c
@@ -0,0 +1,1475 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table_dataset.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+netsnmp_feature_child_of(table_dataset_all, mib_helpers)
+netsnmp_feature_child_of(table_dataset, table_dataset_all)
+netsnmp_feature_child_of(table_dataset_remove_row, table_dataset_all)
+netsnmp_feature_child_of(table_data_set_column, table_dataset_all)
+netsnmp_feature_child_of(table_dataset_get_newrow, table_dataset_all)
+netsnmp_feature_child_of(table_set_add_indexes, table_dataset_all)
+netsnmp_feature_child_of(delete_table_data_set, table_dataset_all)
+netsnmp_feature_child_of(table_set_multi_add_default_row, table_dataset_all)
+netsnmp_feature_child_of(table_dataset_unregister_auto_data_table, table_dataset_all)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_TABLE_DATASET
+netsnmp_feature_require(table_get_or_create_row_stash)
+netsnmp_feature_require(table_data_delete_table)
+netsnmp_feature_require(table_data)
+netsnmp_feature_require(oid_stash_get_data)
+netsnmp_feature_require(oid_stash_add_data)
+#endif /* NETSNMP_FEATURE_REQUIRE_TABLE_DATASET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATASET
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(oid_stash)
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+netsnmp_feature_require(mib_to_asn_type)
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+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 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
+ *
+ * ================================== */
+
+/** 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_set_storage*)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 */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATASET_REMOVE_ROW
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATASET_REMOVE_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);
+}
+
+/** 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_DELETE_TABLE_DATA_SET
+void netsnmp_delete_table_data_set(netsnmp_table_data_set *table_set)
+{
+ netsnmp_table_data_set_storage *ptr, *next;
+ netsnmp_table_row *prow, *pnextrow;
+
+ for (ptr = table_set->default_row; ptr; ptr = next) {
+ next = ptr->next;
+ free(ptr);
+ }
+ table_set->default_row = NULL;
+ for (prow = table_set->table->first_row; prow; prow = pnextrow) {
+ pnextrow = prow->next;
+ netsnmp_table_dataset_remove_and_delete_row(table_set, prow);
+ }
+ table_set->table->first_row = NULL;
+ netsnmp_table_data_delete_table(table_set->table);
+ free(table_set);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DELETE_TABLE_DATA_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;
+}
+
+/* ==================================
+ *
+ * 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);
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (defrow->writable)
+ netsnmp_mark_row_column_writable(row, defrow->column, 1);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ 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);
+ if (new_col == NULL)
+ return SNMPERR_GENERR;
+ 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.
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_SET_MULTI_ADD_DEFAULT_ROW
+void
+netsnmp_table_set_multi_add_default_row(netsnmp_table_data_set *tset, ...)
+{
+ va_list debugargs;
+ unsigned int column;
+ int type, writable;
+ void *data;
+ size_t data_len;
+
+ va_start(debugargs, tset);
+
+ 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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_SET_MULTI_ADD_DEFAULT_ROW */
+
+/* ==================================
+ *
+ * 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)
+{
+ int ret;
+
+ if (NULL == table_info) {
+ /*
+ * allocate the table if one wasn't allocated
+ */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (table_info == NULL)
+ return SNMP_ERR_GENERR;
+ }
+
+ 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));
+ ret = netsnmp_register_table_data(reginfo, data_set->table,
+ table_info);
+ if (ret == SNMPERR_SUCCESS && reginfo->handler)
+ netsnmp_handler_owns_table_info(reginfo->handler->next);
+ return ret;
+}
+
+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);
+
+ if (newrowstash != NULL) {
+ 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;
+ 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;
+ const oid * const suffix =
+ requests->requestvb->name + reginfo->rootoid_len + 2;
+ const size_t suffix_len =
+ requests->requestvb->name_length - (reginfo->rootoid_len + 2);
+
+ if (request->processed)
+ continue;
+
+ /*
+ * extract our stored data and table info
+ */
+ row = netsnmp_extract_table_row(request);
+ table_info = netsnmp_extract_table_info(request);
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (MODE_IS_SET(reqinfo->mode)) {
+
+ /*
+ * 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.
+ */
+ stashp = netsnmp_table_dataset_get_or_create_stash(reqinfo,
+ datatable,
+ table_info);
+ if (NULL == stashp) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_GENERR);
+ continue;
+ }
+
+ newrowstash
+ = (newrow_stash*)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);
+ if (newrowstash == NULL) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_GENERR);
+ continue;
+ }
+ 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;
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ if (row)
+ data = (netsnmp_table_data_set_storage *) row->data;
+
+ if (!row || !table_info || !data) {
+ if (!table_info
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ || !MODE_IS_SET(reqinfo->mode)
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ ) {
+ 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->type == SNMP_NOSUCHINSTANCE) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ } else {
+ /*
+ * Note: data->data.voidp can be NULL, e.g. when a zero-length
+ * octet string has been stored in the table cache.
+ */
+ netsnmp_table_data_build_result(reginfo, reqinfo, request,
+ row,
+ table_info->colnum,
+ data->type,
+ (u_char*)data->data.voidp,
+ data->data_len);
+ }
+ break;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 = (u_char *)
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ default:
+ snmp_log(LOG_ERR,
+ "table_dataset: unknown mode passed into the handler\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+ /* 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
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATA_SET_COLUMN
+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_table_data_set_storage*)netsnmp_extract_table_row_data( request );
+ if (data) {
+ data = netsnmp_table_data_set_find_column(data, column);
+ }
+ return data;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATA_SET_COLUMN */
+
+/* ==================================
+ *
+ * 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, free)); /* XXX */
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATASET_UNREGISTER_AUTO_DATA_TABLE
+/** Undo the effect of netsnmp_register_auto_data_table().
+ */
+void
+netsnmp_unregister_auto_data_table(netsnmp_table_data_set *table_set,
+ char *registration_name)
+{
+ netsnmp_remove_list_node(&auto_tables, registration_name
+ ? registration_name : table_set->table->name);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATASET_UNREGISTER_AUTO_DATA_TABLE */
+
+#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 table name");
+ snmp_log(LOG_WARNING, " can't parse %s\n", tp->augments);
+ SNMP_FREE (table_set);
+ 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);
+ SNMP_FREE (table_set);
+ 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");
+ SNMP_FREE (table_set);
+ return; /* xxx mem leak */
+ }
+
+ DEBUGMSGTL(("table_set_add_table",
+ "adding column %s(%ld) 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;
+ /* fallthrough */
+ case MIB_ACCESS_READWRITE:
+ case MIB_ACCESS_WRITEONLY:
+ canwrite = 1;
+ /* fallthrough */
+ case MIB_ACCESS_READONLY:
+ DEBUGMSGTL(("table_set_add_table",
+ "adding column %ld 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, sizeof(tname));
+
+ 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");
+ SNMP_FREE (row);
+ return;
+ }
+
+ DEBUGMSGTL(("table_set_add_row", "adding index of type %d\n",
+ vb->type));
+ buf_size = sizeof(buf);
+ 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);
+ SNMP_FREE (row);
+ return;
+ }
+
+ buf_size = sizeof(buf);
+ 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);
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (dr->writable)
+ netsnmp_mark_row_column_writable(row, dr->column, 1); /* make writable */
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ 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);
+ }
+}
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_oid_stash_node **
+netsnmp_table_dataset_get_or_create_stash(netsnmp_agent_request_info *reqinfo,
+ netsnmp_table_data_set *datatable,
+ netsnmp_table_request_info *table_info)
+{
+ netsnmp_oid_stash_node **stashp = NULL;
+ char buf[256]; /* is this reasonable size?? */
+ size_t len;
+ int rc;
+
+ rc = snprintf(buf, sizeof(buf), "dataset_row_stash:%s:",
+ datatable->table->name);
+ if ((-1 == rc) || ((size_t)rc >= sizeof(buf))) {
+ snmp_log(LOG_ERR,"%s handler name too long\n", datatable->table->name);
+ return NULL;
+ }
+
+ 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);
+ return NULL;
+ }
+
+ stashp = (netsnmp_oid_stash_node **)
+ netsnmp_table_get_or_create_row_stash(reqinfo, (u_char *) buf);
+ return stashp;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATASET_GET_NEWROW
+netsnmp_table_row *
+netsnmp_table_dataset_get_newrow(netsnmp_request_info *request,
+ netsnmp_agent_request_info *reqinfo,
+ int rootoid_len,
+ netsnmp_table_data_set *datatable,
+ netsnmp_table_request_info *table_info)
+{
+ oid * const suffix = request->requestvb->name + rootoid_len + 2;
+ size_t suffix_len = request->requestvb->name_length - (rootoid_len + 2);
+ netsnmp_oid_stash_node **stashp;
+ newrow_stash *newrowstash;
+
+ stashp = netsnmp_table_dataset_get_or_create_stash(reqinfo, datatable,
+ table_info);
+ if (NULL == stashp)
+ return NULL;
+
+ newrowstash = (newrow_stash*)netsnmp_oid_stash_get_data(*stashp, suffix, suffix_len);
+ if (NULL == newrowstash)
+ return NULL;
+
+ return newrowstash->newrow;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATASET_GET_NEWROW */
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/* ==================================
+ *
+ * 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;
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+/**
+ * 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 = (struct netsnmp_table_data_set_storage_s*)row->data;
+ row->data = data;
+ } else {
+ data->writable = writable;
+ }
+ return SNMPERR_SUCCESS;
+}
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/**
+ * Sets a given column in a row with data given a type, value,
+ * and length. Data is memdup'ed by the function, at least if
+ * type != SNMP_NOSUCHINSTANCE and if value_len > 0.
+ *
+ * @param[in] row Pointer to the row to be modified.
+ * @param[in] column Index of the column to be modified.
+ * @param[in] type Either the ASN type of the value to be set or
+ * SNMP_NOSUCHINSTANCE.
+ * @param[in] value If type != SNMP_NOSUCHINSTANCE, pointer to the
+ * new value. May be NULL if value_len == 0, e.g. when storing a
+ * zero-length octet string. Ignored when type == SNMP_NOSUCHINSTANCE.
+ * @param[in] value_len If type != SNMP_NOSUCHINSTANCE, number of bytes
+ * occupied by *value. Ignored when type == SNMP_NOSUCHINSTANCE.
+ *
+ * @return SNMPERR_SUCCESS upon success; SNMPERR_MALLOC when out of memory;
+ * or SNMPERR_GENERR when row == 0 or when type does not match the datatype
+ * of the data stored in *row.
+ *
+ */
+int
+netsnmp_set_row_column(netsnmp_table_row *row, unsigned int column,
+ int type, const void *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 = (struct netsnmp_table_data_set_storage_s*)row->data;
+ row->data = data;
+ }
+
+ /* Transitions from / to SNMP_NOSUCHINSTANCE are allowed, but no other transitions. */
+ if (data->type != type && data->type != SNMP_NOSUCHINSTANCE
+ && type != SNMP_NOSUCHINSTANCE)
+ return SNMPERR_GENERR;
+
+ /* Return now if neither the type nor the data itself has been modified. */
+ if (data->type == type && data->data_len == value_len
+ && (value == NULL || memcmp(&data->data.string, value, value_len) == 0))
+ return SNMPERR_SUCCESS;
+
+ /* Reallocate memory and store the new value. */
+ data->data.voidp = realloc(data->data.voidp, value ? value_len : 0);
+ if (value && value_len && !data->data.voidp) {
+ data->data_len = 0;
+ data->type = SNMP_NOSUCHINSTANCE;
+ snmp_log(LOG_CRIT, "no memory in netsnmp_set_row_column");
+ return SNMPERR_MALLOC;
+ }
+ if (value && value_len)
+ memcpy(data->data.string, value, value_len);
+ data->type = type;
+ 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. */
+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. */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_SET_ADD_INDEXES
+void
+netsnmp_table_set_add_indexes(netsnmp_table_data_set *tset,
+ ...)
+{
+ va_list debugargs;
+ int type;
+
+ va_start(debugargs, tset);
+
+ if (tset)
+ while ((type = va_arg(debugargs, int)) != 0)
+ netsnmp_table_data_add_index(tset->table, (u_char)type);
+
+ va_end(debugargs);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_SET_ADD_INDEXES */
+
+#else /* NETSNMP_FEATURE_REMOVE_TABLE_DATASET */
+netsnmp_feature_unused(table_dataset);
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATASET */
+/** @}
+ */
diff --git a/agent/helpers/table_generic.c b/agent/helpers/table_generic.c
new file mode 100644
index 0000000..75424f3
--- /dev/null
+++ b/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/agent/helpers/table_iterator.c b/agent/helpers/table_iterator.c
new file mode 100644
index 0000000..8ed5cd0
--- /dev/null
+++ b/agent/helpers/table_iterator.c
@@ -0,0 +1,1236 @@
+/*
+ * 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>
+
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table_iterator.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/serialize.h>
+#include <net-snmp/agent/stash_cache.h>
+
+netsnmp_feature_child_of(table_iterator_all, mib_helpers)
+
+netsnmp_feature_child_of(table_iterator_insert_context, table_iterator_all)
+netsnmp_feature_child_of(table_iterator_create_table, table_iterator_all)
+netsnmp_feature_child_of(table_iterator_row_first, table_iterator_all)
+netsnmp_feature_child_of(table_iterator_row_count, table_iterator_all)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_STASH_CACHE
+netsnmp_feature_require(data_list_get_list_node)
+netsnmp_feature_require(oid_stash_add_data)
+#endif /* NETSNMP_FEATURE_REQUIRE_STASH_CACHE */
+
+/* ==================================
+ *
+ * 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.
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_ITERATOR_CREATE_TABLE
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_ITERATOR_CREATE_TABLE */
+
+/** Free the memory that was allocated for a table iterator. */
+void
+netsnmp_iterator_delete_table( netsnmp_iterator_info *iinfo )
+{
+ if (!iinfo)
+ return;
+
+ if (iinfo->indexes) {
+ snmp_free_varbind( iinfo->indexes );
+ iinfo->indexes = NULL;
+ }
+ netsnmp_table_registration_info_free(iinfo->table_reginfo);
+ 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
+ *
+ * ================================== */
+
+static netsnmp_iterator_info *
+netsnmp_iterator_ref(netsnmp_iterator_info *iinfo)
+{
+ iinfo->refcnt++;
+ return iinfo;
+}
+
+static void
+netsnmp_iterator_deref(netsnmp_iterator_info *iinfo)
+{
+ if (--iinfo->refcnt == 0)
+ netsnmp_iterator_delete_table(iinfo);
+}
+
+void netsnmp_handler_owns_iterator_info(netsnmp_mib_handler *h)
+{
+ netsnmp_assert(h);
+ netsnmp_assert(h->myvoid);
+ ((netsnmp_iterator_info *)(h->myvoid))->refcnt++;
+ h->data_clone = (void *(*)(void *))netsnmp_iterator_ref;
+ h->data_free = (void(*)(void *))netsnmp_iterator_deref;
+}
+
+/**
+ * Returns a netsnmp_mib_handler object for the table_iterator helper.
+ *
+ * The caller remains the owner of the iterator information object if
+ * the flag NETSNMP_HANDLER_OWNS_IINFO has not been set, and the created
+ * handler becomes the owner of the iterator information if the flag
+ * NETSNMP_HANDLER_OWNS_IINFO has been set.
+ */
+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;
+ if (iinfo->flags & NETSNMP_HANDLER_OWNS_IINFO)
+ netsnmp_handler_owns_iterator_info(me);
+ 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 A pointer to a netsnmp_iterator_info struct. If the flag
+ * NETSNMP_HANDLER_OWNS_IINFO is not set in iinfo->flags, the caller remains
+ * the owner of this structure. And if the flag NETSNMP_HANDLER_OWNS_IINFO is
+ * set in iinfo->flags, ownership of this data structure is passed to the
+ * handler.
+ *
+ * @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)
+{
+#ifndef NETSNMP_FEATURE_REMOVE_STASH_CACHE
+ reginfo->modes |= HANDLER_CAN_STASH;
+#endif /* NETSNMP_FEATURE_REMOVE_STASH_CACHE */
+ 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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_ITERATOR_INSERT_CONTEXT
+/** 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));
+ }
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_ITERATOR_INSERT_CONTEXT */
+
+#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 = (ti_cache_info*)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 = (ti_cache_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);
+ if (ti_info == NULL)
+ return NULL;
+ 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 = SNMP_ERR_NOERROR;
+ 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;
+#ifndef NETSNMP_FEATURE_REMOVE_STASH_CACHE
+ 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;
+#endif /* NETSNMP_FEATURE_REMOVE_STASH_CACHE */
+
+ iinfo = (netsnmp_iterator_info *) handler->myvoid;
+ if (!iinfo || !reginfo || !reqinfo)
+ return SNMP_ERR_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) {
+#ifndef NETSNMP_FEATURE_REMOVE_STASH_CACHE
+ 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);
+ if (reqtmp == NULL)
+ return SNMP_ERR_GENERR;
+ 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;
+#endif /* NETSNMP_FEATURE_REMOVE_STASH_CACHE */
+
+ case MODE_GETNEXT:
+ for(request = requests ; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_info = netsnmp_extract_table_info(request);
+ if (table_info == NULL) {
+ /*
+ * Cleanup
+ */
+ if (free_this_index_search)
+ snmp_free_varbind(free_this_index_search);
+ return SNMP_ERR_GENERR;
+ }
+ 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 = (ti_cache_info*)
+ netsnmp_request_get_list_data(request, TI_REQUEST_CACHE);
+ if (!ti_info) {
+ ti_info = SNMP_MALLOC_TYPEDEF(ti_cache_info);
+ if (ti_info == NULL) {
+ /*
+ * Cleanup
+ */
+ if (free_this_index_search)
+ snmp_free_varbind(free_this_index_search);
+ return SNMP_ERR_GENERR;
+ }
+ 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
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ || reqinfo->mode == MODE_SET_RESERVE1
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ ) {
+ /*
+ * 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 retrieval */
+ table_info = netsnmp_extract_table_info(request);
+ if (table_info == NULL) {
+ /*
+ * Cleanup
+ */
+ if (free_this_index_search)
+ snmp_free_varbind(free_this_index_search);
+ netsnmp_free_request_data_sets(reqtmp);
+ SNMP_FREE(reqtmp);
+ return SNMP_ERR_GENERR;
+ }
+ coloid[reginfo->rootoid_len + 1] = table_info->colnum;
+
+ ti_info = (ti_cache_info*)
+ netsnmp_request_get_list_data(request, TI_REQUEST_CACHE);
+
+ switch(reqinfo->mode) {
+ case MODE_GET:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE1:
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ /* 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
+ */
+ if (netsnmp_iterator_remember(request,
+ myname,
+ myname_len,
+ callback_data_context,
+ callback_loop_context,
+ iinfo) == NULL) {
+ /*
+ * Cleanup
+ */
+ if (free_this_index_search)
+ snmp_free_varbind
+ (free_this_index_search);
+ netsnmp_free_request_data_sets(reqtmp);
+ SNMP_FREE(reqtmp);
+ return SNMP_ERR_GENERR;
+ }
+ 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;
+
+#ifndef NETSNMP_FEATURE_REMOVE_STASH_CACHE
+ 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);
+ if (vb == NULL) {
+ /*
+ * Cleanup
+ */
+ if (free_this_index_search)
+ snmp_free_varbind
+ (free_this_index_search);
+ return SNMP_ERR_GENERR;
+ }
+ 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;
+#endif /* NETSNMP_FEATURE_REMOVE_STASH_CACHE */
+
+ case MODE_GETNEXT:
+ /* looking for "next" matches */
+ if (netsnmp_check_getnext_reply
+ (request, coloid, coloid_len, index_search,
+ &ti_info->results)) {
+ if (netsnmp_iterator_remember(request,
+ ti_info->
+ results->name,
+ ti_info->
+ results->
+ name_length,
+ callback_data_context,
+ callback_loop_context,
+ iinfo) == NULL) {
+ /*
+ * Cleanup
+ */
+ if (free_this_index_search)
+ snmp_free_varbind
+ (free_this_index_search);
+ return SNMP_ERR_GENERR;
+ }
+ /*
+ * 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ case MODE_SET_COMMIT:
+ /* needed processing already done in RESERVE1 */
+ break;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 = (ti_cache_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
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ || reqinfo->mode == MODE_SET_RESERVE1
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ ) {
+ /* per request last minute processing */
+ for(request = requests ; request; request = request->next) {
+ if (request->processed)
+ continue;
+ ti_info = (ti_cache_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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE1:
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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;
+ }
+#ifndef NETSNMP_FEATURE_REMOVE_STASH_CACHE
+ } else if (reqinfo->mode == MODE_GET_STASH) {
+ netsnmp_free_request_data_sets(reqtmp);
+ SNMP_FREE(reqtmp);
+ table_info->indexes = old_indexes;
+#endif /* NETSNMP_FEATURE_REMOVE_STASH_CACHE */
+ }
+
+
+ /* 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 ret;
+}
+
+/* ==================================
+ *
+ * Iterator API: Row operations
+ *
+ * ================================== */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_ITERATOR_ROW_FIRST
+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 ?? */
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_ITERATOR_ROW_FIRST */
+
+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: %p %p %p\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: %p %p %p\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: %p %p %p\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: %p %p %p\n",
+ ctx1, ctx2, vp2));
+ /* XXX - free context ? */
+ }
+
+ /* XXX - final free context ? */
+ snmp_free_varbind( vp1 );
+
+ return ( vp2 ? ctx2 : NULL );
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_ITERATOR_ROW_COUNT
+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: %p %p %p\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: %p %p %p (%d)\n",
+ ctx1, ctx2, vp2, i));
+ /* XXX - free context ? */
+ }
+
+ /* XXX - final free context ? */
+ snmp_free_varbind( vp1 );
+ return i;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_ITERATOR_ROW_COUNT */
+
+
+/* ==================================
+ *
+ * Iterator API: Index operations
+ *
+ * ================================== */
+
+
+/** @} */
diff --git a/agent/helpers/table_row.c b/agent/helpers/table_row.c
new file mode 100644
index 0000000..2a33f23
--- /dev/null
+++ b/agent/helpers/table_row.c
@@ -0,0 +1,264 @@
+/*
+ * table_row.c
+ *
+ * Helper for registering single row slices of a shared table
+ *
+ * $Id$
+ */
+#define TABLE_ROW_DATA "table_row"
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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>
+
+netsnmp_feature_child_of(table_row_all, mib_helpers)
+
+netsnmp_feature_child_of(table_row_extract, table_row_all)
+
+
+/*
+ * 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);
+ reginfo->rootoid = snmp_duplicate_objid(row_oid, row_oid_len);
+ 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 */
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_ROW_EXTRACT
+void *
+netsnmp_table_row_extract(netsnmp_request_info *request)
+{
+ return netsnmp_request_get_list_data(request, TABLE_ROW_DATA);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_ROW_EXTRACT */
+/** @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/agent/helpers/table_tdata.c b/agent/helpers/table_tdata.c
new file mode 100644
index 0000000..5bdb26a
--- /dev/null
+++ b/agent/helpers/table_tdata.c
@@ -0,0 +1,652 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table_tdata.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/agent/read_only.h>
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+netsnmp_feature_child_of(table_tdata_all, mib_helpers)
+netsnmp_feature_child_of(table_tdata, table_tdata_all)
+netsnmp_feature_child_of(table_tdata_delete_table, table_tdata_all)
+netsnmp_feature_child_of(table_tdata_extract_table, table_tdata_all)
+netsnmp_feature_child_of(table_tdata_remove_row, table_tdata_all)
+netsnmp_feature_child_of(table_tdata_insert_row, table_tdata_all)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_TABLE_TDATA
+netsnmp_feature_require(table_container_row_insert)
+#ifdef NETSNMP_FEATURE_REQUIRE_TABLE_TDATA_REMOVE_ROW
+netsnmp_feature_require(table_container_row_remove)
+#endif /* NETSNMP_FEATURE_REQUIRE_TABLE_TDATA_REMOVE_ROW */
+#endif /* NETSNMP_FEATURE_REQUIRE_TABLE_TDATA */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_TDATA
+
+/** @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;
+
+ table->flags = flags;
+ if (name)
+ table->name = strdup(name);
+
+ if (!(table->flags & TDATA_FLAG_NO_CONTAINER)) {
+ table->container = netsnmp_container_find( name );
+ if (!table->container)
+ table->container = netsnmp_container_find( "table_container" );
+ if (table->container)
+ table->container->container_name = strdup(name);
+ }
+ return table;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_TDATA_DELETE_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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_TDATA_DELETE_TABLE */
+
+/** 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_feature_child_of(tdata_clone_row, table_tdata_all)
+#ifndef NETSNMP_FEATURE_REMOVE_TDATA_CLONE_ROW
+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) {
+ newrow->oid_index.oids =
+ snmp_duplicate_objid(row->oid_index.oids, row->oid_index.len);
+ if (!newrow->oid_index.oids) {
+ if (newrow->indexes)
+ snmp_free_varbind(newrow->indexes);
+ SNMP_FREE(newrow);
+ return NULL;
+ }
+ }
+
+ return newrow;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDATA_CLONE_ROW */
+
+/** copy the contents of a 'tdata' row.
+ DOES NOT COPY THE TABLE-SPECIFIC ENTRY DATA. */
+netsnmp_feature_child_of(tdata_copy_row, table_tdata_all)
+#ifndef NETSNMP_FEATURE_REMOVE_TDATA_COPY_ROW
+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) {
+ dst_row->oid_index.oids = snmp_duplicate_objid(src_row->oid_index.oids,
+ src_row->oid_index.len);
+ if (!dst_row->oid_index.oids)
+ return -1;
+ }
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDATA_COPY_ROW */
+
+/** 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
+ */
+ if (CONTAINER_INSERT( table->container, row ) != 0)
+ return SNMPERR_GENERR;
+
+ DEBUGMSGTL(("tdata_add_row", "added row (%p)\n", row));
+
+ return SNMPERR_SUCCESS;
+}
+
+/** swaps out origrow with newrow. This does *not* delete/free anything! */
+netsnmp_feature_child_of(tdata_replace_row, table_tdata_all)
+#ifndef NETSNMP_FEATURE_REMOVE_TDATA_REPLACE_ROW
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDATA_REPLACE_ROW */
+
+/**
+ * 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;
+ int need_processing = 1;
+
+ switch ( reqinfo->mode ) {
+ case MODE_GET:
+ need_processing = 0; /* only need processing if some vars found */
+ /** Fall through */
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE1:
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ table_info = netsnmp_extract_table_info(request);
+ if (!table_info) {
+ netsnmp_assert(table_info); /* yes, this will always hit */
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_GENERR);
+ continue; /* eek */
+ }
+ row = (netsnmp_tdata_row*)netsnmp_container_table_row_extract( request );
+ if (!row && (reqinfo->mode == MODE_GET)) {
+ netsnmp_assert(row); /* yes, this will always hit */
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_GENERR);
+ continue; /* eek */
+ }
+ ++need_processing;
+ 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));
+ }
+ /** skip next handler if processing not needed */
+ if (!need_processing)
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ }
+
+ /* 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);
+}
+
+netsnmp_feature_child_of(tdata_unregister, table_tdata_all)
+#ifndef NETSNMP_FEATURE_REMOVE_TDATA_UNREGISTER
+int
+netsnmp_tdata_unregister(netsnmp_handler_registration *reginfo)
+{
+ /* free table; */
+ return netsnmp_container_table_unregister(reginfo);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDATA_UNREGISTER */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_TDATA_EXTRACT_TABLE
+/** 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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_TDATA_EXTRACT_TABLE */
+
+/** extracts the tdata container from the request structure */
+netsnmp_feature_child_of(tdata_extract_container, table_tdata_all)
+#ifndef NETSNMP_FEATURE_REMOVE_TDATA_EXTRACT_CONTAINER
+netsnmp_container *
+netsnmp_tdata_extract_container(netsnmp_request_info *request)
+{
+ netsnmp_tdata *tdata = (netsnmp_tdata*)
+ netsnmp_request_get_list_data(request, TABLE_TDATA_TABLE);
+ return ( tdata ? tdata->container : NULL );
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDATA_EXTRACT_CONTAINER */
+
+/** 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_TDATA_INSERT_ROW
+/** 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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_TDATA_INSERT_ROW */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TABLE_TDATA_REMOVE_ROW
+/** inserts a newly created tdata row into a request */
+NETSNMP_INLINE void
+netsnmp_remove_tdata_row(netsnmp_request_info *request,
+ netsnmp_tdata_row *row)
+{
+ netsnmp_container_table_row_remove(request, (netsnmp_index *)row);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_TDATA_REMOVE_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 (netsnmp_tdata_row*)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 (netsnmp_tdata_row*)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 (netsnmp_tdata_row*)CONTAINER_NEXT( table->container, &index );
+}
+
+netsnmp_feature_child_of(tdata_row_count, table_tdata_all)
+#ifndef NETSNMP_FEATURE_REMOVE_TDATA_ROW_COUNT
+int
+netsnmp_tdata_row_count(netsnmp_tdata *table)
+{
+ if (!table)
+ return 0;
+ return CONTAINER_SIZE( table->container );
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDATA_ROW_COUNT */
+
+/* ==================================
+ *
+ * Generic API: Index operations on a 'tdata' table
+ *
+ * ================================== */
+
+
+/** compare a row with the given index values */
+netsnmp_feature_child_of(tdata_compare_idx, table_tdata_all)
+#ifndef NETSNMP_FEATURE_REMOVE_TDATA_COMPARE_IDX
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDATA_COMPARE_IDX */
+
+/** 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);
+}
+#else /* NETSNMP_FEATURE_REMOVE_TABLE_TDATA */
+netsnmp_feature_unused(table_tdata);
+#endif /* NETSNMP_FEATURE_REMOVE_TABLE_TDATA */
+
+
+/** @}
+ */
diff --git a/agent/helpers/watcher.c b/agent/helpers/watcher.c
new file mode 100644
index 0000000..9b3933b
--- /dev/null
+++ b/agent/helpers/watcher.c
@@ -0,0 +1,661 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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/instance.h>
+#include <net-snmp/agent/scalar.h>
+
+#include <string.h>
+
+#ifdef HAVE_DMALLOC_H
+static void free_wrapper(void * p)
+{
+ free(p);
+}
+#else
+#define free_wrapper free
+#endif
+
+netsnmp_feature_provide(watcher_all)
+netsnmp_feature_child_of(watcher_all, mib_helpers)
+netsnmp_feature_child_of(watcher_create_info6, watcher_all)
+netsnmp_feature_child_of(watcher_register_timestamp, watcher_all)
+netsnmp_feature_child_of(watcher_ulong_scalar, watcher_all)
+netsnmp_feature_child_of(watcher_read_only_ulong_scalar, watcher_all)
+netsnmp_feature_child_of(watcher_read_only_int_scalar, watcher_all)
+netsnmp_feature_child_of(watcher_long_scalar, watcher_all)
+netsnmp_feature_child_of(watcher_read_only_long_scalar, watcher_all)
+netsnmp_feature_child_of(watcher_int_scalar, watcher_all)
+netsnmp_feature_child_of(read_only_counter32_scalar, watcher_all)
+netsnmp_feature_child_of(watcher_spinlock, watcher_all)
+
+/** @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_init_watcher_info6(netsnmp_watcher_info *winfo,
+ void *data, size_t size, u_char type,
+ int flags, size_t max_size, size_t* size_p)
+{
+ winfo->data = data;
+ winfo->data_size = size;
+ winfo->max_size = max_size;
+ winfo->type = type;
+ winfo->flags = flags;
+ winfo->data_size_p = size_p;
+ return winfo;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_WATCHER_CREATE_INFO6
+netsnmp_watcher_info *
+netsnmp_create_watcher_info6(void *data, size_t size, u_char type,
+ int flags, size_t max_size, size_t* size_p)
+{
+ netsnmp_watcher_info *winfo = SNMP_MALLOC_TYPEDEF(netsnmp_watcher_info);
+ if (winfo)
+ netsnmp_init_watcher_info6(winfo, data, size, type, flags, max_size,
+ size_p);
+ return winfo;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_WATCHER_CREATE_INFO6 */
+
+netsnmp_watcher_info *
+netsnmp_init_watcher_info(netsnmp_watcher_info *winfo,
+ void *data, size_t size, u_char type, int flags)
+{
+ return netsnmp_init_watcher_info6(winfo, data, size,
+ type, (flags ? flags : WATCHER_FIXED_SIZE),
+ size, /* Probably wrong for non-fixed
+ * size data */
+ NULL);
+}
+
+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);
+ if (winfo)
+ netsnmp_init_watcher_info(winfo, data, size, type, flags);
+ return winfo;
+}
+
+/**
+ * Register a watched scalar. The caller remains the owner of watchinfo.
+ *
+ * @see netsnmp_register_watched_instance2()
+ */
+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);
+}
+
+/**
+ * Register a watched scalar. Ownership of watchinfo is transferred to the handler.
+ *
+ * @see netsnmp_register_watched_instance()
+ */
+int
+netsnmp_register_watched_instance2(netsnmp_handler_registration *reginfo,
+ netsnmp_watcher_info *watchinfo)
+{
+ netsnmp_mib_handler *whandler;
+
+ whandler = netsnmp_get_watcher_handler();
+ whandler->myvoid = (void *)watchinfo;
+ netsnmp_owns_watcher_info(whandler);
+
+ netsnmp_inject_handler(reginfo, whandler);
+ return netsnmp_register_instance(reginfo);
+}
+
+/**
+ * Register a watched scalar. The caller remains the owner of watchinfo.
+ *
+ * @see netsnmp_register_watched_scalar2()
+ */
+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);
+}
+
+/**
+ * Register a watched scalar. Ownership of watchinfo is transferred to the handler.
+ *
+ * @see netsnmp_register_watched_scalar()
+ */
+int
+netsnmp_register_watched_scalar2(netsnmp_handler_registration *reginfo,
+ netsnmp_watcher_info *watchinfo)
+{
+ netsnmp_mib_handler *whandler;
+
+ whandler = netsnmp_get_watcher_handler();
+ whandler->myvoid = (void *)watchinfo;
+ netsnmp_owns_watcher_info(whandler);
+
+ netsnmp_inject_handler(reginfo, whandler);
+ return netsnmp_register_scalar(reginfo);
+}
+
+void
+netsnmp_owns_watcher_info(netsnmp_mib_handler *handler)
+{
+ netsnmp_assert(handler);
+ netsnmp_assert(handler->myvoid);
+ handler->data_clone = (void *(*)(void *))netsnmp_clone_watcher_info;
+ handler->data_free = free;
+}
+
+/** @cond */
+
+NETSNMP_STATIC_INLINE size_t
+get_data_size(const netsnmp_watcher_info* winfo)
+{
+ if (winfo->flags & WATCHER_SIZE_STRLEN)
+ return strlen((const char*)winfo->data);
+ else {
+ size_t res;
+ if (winfo->flags & WATCHER_SIZE_IS_PTR)
+ res = *winfo->data_size_p;
+ else
+ res = winfo->data_size;
+ if (winfo->flags & WATCHER_SIZE_UNIT_OIDS)
+ res *= sizeof(oid);
+ return res;
+ }
+}
+
+NETSNMP_STATIC_INLINE void
+set_data(netsnmp_watcher_info* winfo, void* data, size_t size)
+{
+ memcpy(winfo->data, data, size);
+ if (winfo->flags & WATCHER_SIZE_STRLEN)
+ ((char*)winfo->data)[size] = '\0';
+ else {
+ if (winfo->flags & WATCHER_SIZE_UNIT_OIDS)
+ size /= sizeof(oid);
+ if (winfo->flags & WATCHER_SIZE_IS_PTR)
+ *winfo->data_size_p = size;
+ else
+ winfo->data_size = size;
+ }
+}
+
+typedef struct {
+ size_t size;
+ char data[1];
+} netsnmp_watcher_cache;
+
+NETSNMP_STATIC_INLINE netsnmp_watcher_cache*
+netsnmp_watcher_cache_create(const void* data, size_t size)
+{
+ netsnmp_watcher_cache *res = (netsnmp_watcher_cache*)
+ malloc(sizeof(netsnmp_watcher_cache) + size - 1);
+ if (res) {
+ res->size = size;
+ memcpy(res->data, data, size);
+ }
+ return res;
+}
+
+/** @endcond */
+
+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;
+ netsnmp_watcher_cache *old_data;
+
+ DEBUGMSGTL(("helper:watcher", "Got request: %d\n", reqinfo->mode));
+ 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,
+ get_data_size(winfo));
+ break;
+
+ /*
+ * SET requests. Should only get here if registered RWRITE
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+ } else if (((winfo->flags & WATCHER_MAX_SIZE) &&
+ requests->requestvb->val_len > winfo->max_size) ||
+ ((winfo->flags & WATCHER_FIXED_SIZE) &&
+ requests->requestvb->val_len != get_data_size(winfo))) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGLENGTH);
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ } else if ((winfo->flags & WATCHER_SIZE_STRLEN) &&
+ (memchr(requests->requestvb->val.string, '\0',
+ requests->requestvb->val_len) != NULL)) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGVALUE);
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old info for undo later
+ */
+ old_data =
+ netsnmp_watcher_cache_create(winfo->data, get_data_size(winfo));
+ if (old_data == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ } else
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("watcher", old_data, &free_wrapper));
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * nothing to do
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * update current
+ */
+ set_data(winfo, (void *)requests->requestvb->val.string,
+ requests->requestvb->val_len);
+ break;
+
+ case MODE_SET_UNDO:
+ old_data = (netsnmp_watcher_cache*)netsnmp_request_get_list_data(requests, "watcher");
+ set_data(winfo, old_data->data, old_data->size);
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ default:
+ snmp_log(LOG_ERR, "watcher handler called with an unknown mode: %d\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+
+ }
+
+ /* 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? */
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_WATCHER_REGISTER_TIMESTAMP
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_WATCHER_REGISTER_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;
+
+ DEBUGMSGTL(("helper:watcher:timestamp",
+ "Got request: %d\n", reqinfo->mode));
+ 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.
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+}
+
+ /***************************
+ *
+ * Another specialised form of the above,
+ * implementing a 'TestAndIncr' spinlock
+ *
+ ***************************/
+
+#ifndef NETSNMP_FEATURE_REMOVE_WATCHER_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_scalar2(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;
+
+ DEBUGMSGTL(("helper:watcher:spinlock",
+ "Got request: %d\n", reqinfo->mode));
+ 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
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_WATCHER_SPINLOCK */
+
+ /***************************
+ *
+ * Convenience registration routines - modelled on
+ * the equivalent netsnmp_register_*_instance() calls
+ *
+ ***************************/
+
+netsnmp_watcher_info *
+netsnmp_clone_watcher_info(netsnmp_watcher_info *winfo)
+{
+ netsnmp_watcher_info *copy = malloc(sizeof(*copy));
+ if (copy)
+ *copy = *winfo;
+ return copy;
+}
+
+static int
+register_scalar_watcher(const char* name,
+ const oid* reg_oid, size_t reg_oid_len,
+ void *data, size_t size, u_char type,
+ Netsnmp_Node_Handler * subhandler, int mode)
+{
+ netsnmp_handler_registration *reginfo = NULL;
+ netsnmp_mib_handler *whandler = NULL;
+ netsnmp_watcher_info* watchinfo =
+ netsnmp_create_watcher_info(data, size, type, WATCHER_FIXED_SIZE);
+ if (watchinfo)
+ whandler = netsnmp_get_watcher_handler();
+ if (watchinfo && whandler) {
+ whandler->myvoid = watchinfo;
+ netsnmp_owns_watcher_info(whandler);
+ reginfo =
+ netsnmp_create_handler_registration(
+ name, subhandler, reg_oid, reg_oid_len, mode);
+ }
+ if (watchinfo && whandler && reginfo) {
+ netsnmp_inject_handler(reginfo, whandler);
+ return netsnmp_register_scalar(reginfo);
+ }
+ if (whandler)
+ netsnmp_handler_free(whandler);
+ else if (watchinfo)
+ free(watchinfo);
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_WATCHER_ULONG_SCALAR
+int
+netsnmp_register_ulong_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return register_scalar_watcher(
+ name, reg_oid, reg_oid_len,
+ (void *)it, sizeof( u_long ),
+ ASN_UNSIGNED, subhandler, HANDLER_CAN_RWRITE);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_WATCHER_ULONG_SCALAR */
+
+#ifndef NETSNMP_FEATURE_REMOVE_WATCHER_READ_ONLY_ULONG_SCALAR
+int
+netsnmp_register_read_only_ulong_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return register_scalar_watcher(
+ name, reg_oid, reg_oid_len,
+ (void *)it, sizeof( u_long ),
+ ASN_UNSIGNED, subhandler, HANDLER_CAN_RONLY);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_WATCHER_READ_ONLY_ULONG_SCALAR */
+
+#ifndef NETSNMP_FEATURE_REMOVE_WATCHER_LONG_SCALAR
+int
+netsnmp_register_long_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return register_scalar_watcher(
+ name, reg_oid, reg_oid_len,
+ (void *)it, sizeof( long ),
+ ASN_INTEGER, subhandler, HANDLER_CAN_RWRITE);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_WATCHER_LONG_SCALAR */
+
+#ifndef NETSNMP_FEATURE_REMOVE_WATCHER_READ_ONLY_LONG_SCALAR
+int
+netsnmp_register_read_only_long_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return register_scalar_watcher(
+ name, reg_oid, reg_oid_len,
+ (void *)it, sizeof( long ),
+ ASN_INTEGER, subhandler, HANDLER_CAN_RONLY);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_WATCHER_READ_ONLY_LONG_SCALAR */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_WATCHER_INT_SCALAR
+int
+netsnmp_register_int_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ int * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return register_scalar_watcher(
+ name, reg_oid, reg_oid_len,
+ (void *)it, sizeof( int ),
+ ASN_INTEGER, subhandler, HANDLER_CAN_RWRITE);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_WATCHER_INT_SCALAR */
+
+#ifndef NETSNMP_FEATURE_REMOVE_WATCHER_READ_ONLY_INT_SCALAR
+int
+netsnmp_register_read_only_int_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ int * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return register_scalar_watcher(
+ name, reg_oid, reg_oid_len,
+ (void *)it, sizeof( int ),
+ ASN_INTEGER, subhandler, HANDLER_CAN_RONLY);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_WATCHER_READ_ONLY_INT_SCALAR */
+
+#ifndef NETSNMP_FEATURE_REMOVE_READ_ONLY_COUNTER32_SCALAR
+int
+netsnmp_register_read_only_counter32_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return register_scalar_watcher(
+ name, reg_oid, reg_oid_len,
+ (void *)it, sizeof( u_long ),
+ ASN_COUNTER, subhandler, HANDLER_CAN_RONLY);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_READ_ONLY_COUNTER32_SCALAR */
+/** @} */
+
diff --git a/agent/kernel.c b/agent/kernel.c
new file mode 100644
index 0000000..200ad0b
--- /dev/null
+++ b/agent/kernel.c
@@ -0,0 +1,254 @@
+/***********************************************************************
+ Net-SNMP - Simple Network Management Protocol agent library.
+ ***********************************************************************/
+/** @file kernel.c
+ * Net-SNMP Kernel Data Access Library.
+ * Provides access to kernel virtual memory for systems that
+ * support it.
+ * @author See README file for a list of contributors
+ */
+/* Copyrights:
+ * Copyright holders are listed in README file.
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted. License terms are specified
+ * in COPYING file distributed with the Net-SNMP package.
+ */
+/***********************************************************************/
+
+#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 = NULL;
+
+/**
+ * Initialize the support for accessing kernel virtual memory.
+ *
+ * @return TRUE upon success; FALSE upon failure.
+ */
+int
+init_kmem(const char *file)
+{
+ int res = TRUE;
+
+#if HAVE_KVM_OPENFILES
+ char err[4096];
+
+ kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, err);
+ if (!kd && !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);
+ res = FALSE;
+ }
+#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));
+ res = FALSE;
+ }
+#endif /* HAVE_KVM_OPENFILES */
+ return res;
+}
+
+/** Reads kernel memory.
+ * Seeks to the specified location in kmem, then
+ * does a read of given amount ob bytes into target buffer.
+ *
+ * @param off The location to seek.
+ *
+ * @param target The target buffer to read into.
+ *
+ * @param siz Number of bytes to read.
+ *
+ * @return gives 1 on success and 0 on failure.
+ */
+int
+klookup(unsigned long off, void *target, size_t 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, %zx) = %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;
+}
+
+/** Closes the kernel memory support.
+ */
+void
+free_kmem(void)
+{
+ if (kd != NULL)
+ {
+ kvm_close(kd);
+ kd = NULL;
+ }
+}
+
+#else /* HAVE_KVM_H */
+
+static off_t klseek(off_t);
+static int klread(char *, int);
+int swap = -1, mem = -1, kmem = -1;
+
+/**
+ * Initialize the support for accessing kernel virtual memory.
+ *
+ * @return TRUE upon success; FALSE upon failure.
+ */
+int
+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);
+ }
+ if (kmem >= 0)
+ fcntl(kmem, F_SETFD, 1/*FD_CLOEXEC*/);
+ 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");
+ }
+ if (mem >= 0)
+ fcntl(mem, F_SETFD, 1/*FD_CLOEXEC*/);
+#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);
+ }
+ if (swap >= 0)
+ fcntl(swap, F_SETFD, 1/*FD_CLOEXEC*/);
+#endif
+ return kmem >= 0 && mem >= 0 && swap >= 0;
+}
+
+/** @private
+ * Seek into the kernel for a value.
+ */
+static off_t
+klseek(off_t base)
+{
+ return (lseek(kmem, (off_t) base, SEEK_SET));
+}
+
+/** @private
+ * Read from the kernel.
+ */
+static int
+klread(char *buf, int buflen)
+{
+ return (read(kmem, buf, buflen));
+}
+
+/** Reads kernel memory.
+ * Seeks to the specified location in kmem, then
+ * does a read of given amount ob bytes into target buffer.
+ *
+ * @param off The location to seek.
+ *
+ * @param target The target buffer to read into.
+ *
+ * @param siz Number of bytes to read.
+ *
+ * @return gives 1 on success and 0 on failure.
+ */
+int
+klookup(unsigned long off, void *target, size_t 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");
+ 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");
+ }
+ return (0);
+ }
+ DEBUGMSGTL(("verbose:kernel:klookup", "klookup(%lx, %p, %d) succeeded", off, target, siz));
+ return (1);
+}
+
+/** Closes the kernel memory support.
+ */
+void
+free_kmem(void)
+{
+ if (swap >= 0) {
+ close(swap);
+ swap = -1;
+ }
+ if (mem >= 0) {
+ close(mem);
+ mem = -1;
+ }
+ if (kmem >= 0) {
+ close(kmem);
+ kmem = -1;
+ }
+}
+
+#endif /* HAVE_KVM_H */
+
+#else
+int unused; /* Suppress "empty translation unit" warning */
+#endif /* NETSNMP_CAN_USE_NLIST */
diff --git a/agent/kernel.h b/agent/kernel.h
new file mode 100644
index 0000000..131687a
--- /dev/null
+++ b/agent/kernel.h
@@ -0,0 +1,31 @@
+/***********************************************************************
+ Net-SNMP - Simple Network Management Protocol agent library.
+ ***********************************************************************/
+/** @file kernel.h
+ * Net-SNMP Kernel Data Access Library - header.
+ * Provides access to kernel virtual memory for systems that
+ * support it.
+ * @author See README file for a list of contributors
+ */
+/* Copyrights:
+ * Copyright holders are listed in README file.
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted. License terms are specified
+ * in COPYING file distributed with the Net-SNMP package.
+ */
+/***********************************************************************/
+
+#ifdef NETSNMP_CAN_USE_NLIST
+extern int init_kmem(const char *);
+extern int klookup(unsigned long, void *, size_t);
+extern void free_kmem(void);
+#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/agent/m2m.h b/agent/m2m.h
new file mode 100644
index 0000000..c4d1510
--- /dev/null
+++ b/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/agent/mib_modules.c b/agent/mib_modules.c
new file mode 100644
index 0000000..cde317e
--- /dev/null
+++ b/agent/mib_modules.c
@@ -0,0 +1,87 @@
+/*
+ * 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
+# 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_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 "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"
+
+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/agent/mibgroup/Makefile.depend b/agent/mibgroup/Makefile.depend
new file mode 100644
index 0000000..cee726e
--- /dev/null
+++ b/agent/mibgroup/Makefile.depend
@@ -0,0 +1,18122 @@
+# 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/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/oid.h
+./header_complex.lo: ../../include/net-snmp/library/types.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_api.h
+./header_complex.lo: ../../include/net-snmp/varbind_api.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_client.h
+./header_complex.lo: ../../include/net-snmp/pdu_api.h
+./header_complex.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./header_complex.lo: ../../include/net-snmp/session_api.h
+./header_complex.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./header_complex.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./header_complex.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./header_complex.lo: ../../include/net-snmp/mib_api.h
+./header_complex.lo: ../../include/net-snmp/library/parse.h
+./header_complex.lo: ../../include/net-snmp/library/oid_stash.h
+./header_complex.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./header_complex.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/net-snmp-config.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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./header_complex.lo: header_complex.h
+./kernel_sunos5.lo: ../../include/net-snmp/net-snmp-config.h
+./testhandler.lo: ../../include/net-snmp/net-snmp-config.h
+./testhandler.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./testhandler.lo: ../../include/net-snmp/library/types.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_api.h
+./testhandler.lo: ../../include/net-snmp/varbind_api.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_client.h
+./testhandler.lo: ../../include/net-snmp/pdu_api.h
+./testhandler.lo: ../../include/net-snmp/library/asn1.h
+./testhandler.lo: ../../include/net-snmp/output_api.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_debug.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_logging.h
+./testhandler.lo: ../../include/net-snmp/session_api.h
+./testhandler.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./testhandler.lo: ../../include/net-snmp/library/ucd_compat.h
+./testhandler.lo: ../../include/net-snmp/library/mib.h
+./testhandler.lo: ../../include/net-snmp/mib_api.h
+./testhandler.lo: ../../include/net-snmp/library/parse.h
+./testhandler.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./testhandler.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./testhandler.lo: testhandler.h
+./util_funcs.lo: ../../include/net-snmp/net-snmp-config.h
+./util_funcs.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./util_funcs.lo: ../../include/net-snmp/library/types.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_api.h
+./util_funcs.lo: ../../include/net-snmp/varbind_api.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_client.h
+./util_funcs.lo: ../../include/net-snmp/pdu_api.h
+./util_funcs.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./util_funcs.lo: ../../include/net-snmp/session_api.h
+./util_funcs.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./util_funcs.lo: ../../include/net-snmp/mib_api.h
+./util_funcs.lo: ../../include/net-snmp/library/parse.h
+./util_funcs.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./util_funcs.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./util_funcs.lo: ../../include/net-snmp/agent/snmp_get_statistic.h struct.h
+./util_funcs.lo: util_funcs.h util_funcs/header_generic.h
+./util_funcs.lo: util_funcs/header_simple_table.h
+./util_funcs.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h utilities/execute.h
+./winExtDLL.lo: ../../include/net-snmp/net-snmp-config.h
+./winExtDLL.lo: ../../include/net-snmp/net-snmp-features.h
+./winExtDLL.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agent/extend.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/extend.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./agent/extend.lo: ../../include/net-snmp/library/types.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/extend.lo: ../../include/net-snmp/varbind_api.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/extend.lo: ../../include/net-snmp/pdu_api.h
+./agent/extend.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent/extend.lo: ../../include/net-snmp/session_api.h
+./agent/extend.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent/extend.lo: ../../include/net-snmp/mib_api.h
+./agent/extend.lo: ../../include/net-snmp/library/parse.h
+./agent/extend.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent/extend.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./agent/extend.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./agent/extend.lo: agent/extend.h utilities/execute.h struct.h
+./agent/extend.lo: util_funcs/header_simple_table.h mibdefs.h
+./agent/nsCache.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsCache.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./agent/nsCache.lo: ../../include/net-snmp/library/types.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsCache.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsCache.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent/nsCache.lo: ../../include/net-snmp/session_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent/nsCache.lo: ../../include/net-snmp/mib_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/parse.h
+./agent/nsCache.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent/nsCache.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./agent/nsCache.lo: agent/nsCache.h
+./agent/nsDebug.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/types.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsDebug.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent/nsDebug.lo: ../../include/net-snmp/session_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent/nsDebug.lo: ../../include/net-snmp/mib_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/parse.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/oid_stash.h
+./agent/nsDebug.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./agent/nsDebug.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./agent/nsDebug.lo: agent/nsDebug.h
+./agent/nsLogging.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsLogging.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/types.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsLogging.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent/nsLogging.lo: ../../include/net-snmp/session_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent/nsLogging.lo: ../../include/net-snmp/mib_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/parse.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent/nsLogging.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./agent/nsLogging.lo: agent/nsLogging.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/types.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/session_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/mib_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/parse.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./agent/nsModuleTable.lo: ./agent/nsModuleTable.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/types.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/session_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/mib_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/parse.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./agent/nsTransactionTable.lo: ./agent/nsTransactionTable.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/types.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/session_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/mib_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/parse.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/net-snmp-features.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/oid.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/types.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/varbind_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/agentx_config.lo: ../../include/net-snmp/pdu_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agentx/agentx_config.lo: ../../include/net-snmp/session_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agentx/agentx_config.lo: ../../include/net-snmp/mib_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/parse.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agentx/agentx_config.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/net-snmp-features.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/oid.h
+./agentx/client.lo: ../../include/net-snmp/library/types.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/client.lo: ../../include/net-snmp/varbind_api.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/client.lo: ../../include/net-snmp/pdu_api.h
+./agentx/client.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agentx/client.lo: ../../include/net-snmp/session_api.h
+./agentx/client.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agentx/client.lo: ../../include/net-snmp/mib_api.h
+./agentx/client.lo: ../../include/net-snmp/library/parse.h
+./agentx/client.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agentx/client.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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_admin.lo: ../../include/net-snmp/net-snmp-config.h
+./agentx/master_admin.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/types.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/varbind_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/master_admin.lo: ../../include/net-snmp/pdu_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agentx/master_admin.lo: ../../include/net-snmp/session_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agentx/master_admin.lo: ../../include/net-snmp/mib_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/parse.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agentx/master_admin.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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: ../../include/net-snmp/agent/agent_sysORTable.h
+./agentx/master_admin.lo: ./agentx/master.h
+./agentx/master.lo: ../../include/net-snmp/net-snmp-config.h
+./agentx/master.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./agentx/master.lo: ../../include/net-snmp/library/types.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/master.lo: ../../include/net-snmp/varbind_api.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/master.lo: ../../include/net-snmp/pdu_api.h
+./agentx/master.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agentx/master.lo: ../../include/net-snmp/session_api.h
+./agentx/master.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agentx/master.lo: ../../include/net-snmp/mib_api.h
+./agentx/master.lo: ../../include/net-snmp/library/parse.h
+./agentx/master.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agentx/master.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./agentx/master.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./agentx/master.lo: ../../agent/snmpd.h agentx/protocol.h
+./agentx/master.lo: agentx/master_admin.h
+./agentx/protocol.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./agentx/protocol.lo: ../../include/net-snmp/library/types.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/protocol.lo: ../../include/net-snmp/varbind_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/protocol.lo: ../../include/net-snmp/pdu_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agentx/protocol.lo: ../../include/net-snmp/session_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agentx/protocol.lo: ../../include/net-snmp/mib_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/parse.h
+./agentx/protocol.lo: ../../include/net-snmp/library/oid_stash.h
+./agentx/protocol.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./agentx/protocol.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/net-snmp-features.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/oid.h
+./agentx/subagent.lo: ../../include/net-snmp/library/types.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/subagent.lo: ../../include/net-snmp/varbind_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/subagent.lo: ../../include/net-snmp/pdu_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./agentx/subagent.lo: ../../include/net-snmp/session_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./agentx/subagent.lo: ../../include/net-snmp/mib_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/parse.h
+./agentx/subagent.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./agentx/subagent.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./agentx/subagent.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./agentx/subagent.lo: ../../agent/snmpd.h 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: ../../include/net-snmp/agent/sysORTable.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/agent_sysORTable.h
+./agentx/subagent.lo: ./agentx/subagent.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/net-snmp-config.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/net-snmp-features.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/net-snmp-includes.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/definitions.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/types.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/oid.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/types.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_api.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/varbind_api.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_client.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/pdu_api.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/asn1.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/output_api.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_debug.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_logging.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/session_api.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/callback.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_transport.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_service.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/ucd_compat.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/mib.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/mib_api.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/parse.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/oid_stash.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_impl.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp-tc.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/getopt.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/utilities.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/system.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/tools.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/int64.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/mt_support.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_alarm.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/data_list.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/check_varbind.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/container.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/factory.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/container_binary_array.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/container_list_ssll.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/container_iterator.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/container.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_assert.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/version.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/config_api.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/read_config.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/default_store.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_enum.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/vacm.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/snmpv3_api.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpv3.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/transform_oids.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/keytools.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/scapi.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/lcd_time.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmp_secmod.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmptsm.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/snmpusm.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/mib_module_config.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/agent_module_config.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/snmp_agent.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/snmp_vars.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/agent_handler.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/var_struct.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/agent_registry.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/library/fd_event_manager.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/ds_agent.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/agent_read_config.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/agent_trap.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/all_helpers.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/instance.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/baby_steps.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/scalar.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/scalar_group.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/watcher.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/multiplexer.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/null.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/debug_handler.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/cache_handler.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/old_api.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/read_only.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/row_merge.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/serialize.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/mode_end_call.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/table.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/table_data.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/table_dataset.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/table_tdata.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/table_iterator.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/table_container.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/table_array.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/mfd.h
+./deliver/deliverByNotify.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./deliver/deliverByNotify.lo: ./deliver/deliverByNotify.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/types.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./disman/mteEventNotificationTable.lo: ./disman/mteEventNotificationTable.h
+./disman/mteEventTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteEventTable.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/types.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteEventTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./disman/mteEventTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./disman/mteEventTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./disman/mteEventTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/net-snmp-features.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/oid.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/types.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/types.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/types.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/types.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/net-snmp-features.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/oid.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/types.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/types.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./examples/data_set.lo: ../../include/net-snmp/library/types.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/data_set.lo: ../../include/net-snmp/varbind_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/data_set.lo: ../../include/net-snmp/pdu_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/data_set.lo: ../../include/net-snmp/session_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/data_set.lo: ../../include/net-snmp/mib_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/parse.h
+./examples/data_set.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/data_set.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./examples/data_set.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/data_set.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./examples/delayed_instance.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/types.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/varbind_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/delayed_instance.lo: ../../include/net-snmp/pdu_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/delayed_instance.lo: ../../include/net-snmp/session_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/delayed_instance.lo: ../../include/net-snmp/mib_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/parse.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/delayed_instance.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./examples/delayed_instance.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./examples/example.lo: ../../include/net-snmp/library/types.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/example.lo: ../../include/net-snmp/varbind_api.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/example.lo: ../../include/net-snmp/pdu_api.h
+./examples/example.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/example.lo: ../../include/net-snmp/session_api.h
+./examples/example.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/example.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/example.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/example.lo: ../../include/net-snmp/mib_api.h
+./examples/example.lo: ../../include/net-snmp/library/parse.h
+./examples/example.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/example.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./examples/example.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./examples/example.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./examples/example.lo: util_funcs/header_generic.h ./examples/example.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/types.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/varbind_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/pdu_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/session_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/mib_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/parse.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./examples/netSnmpHostsTable_access.lo: ./examples/netSnmpHostsTable_access.h
+./examples/netSnmpHostsTable_access.lo: ./examples/netSnmpHostsTable_enums.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/types.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/varbind_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/pdu_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/session_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/mib_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/parse.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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_checkfns.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/types.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/varbind_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/pdu_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/session_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/mib_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/parse.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/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/oid.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/types.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/varbind_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/pdu_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/session_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/mib_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/parse.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/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/oid.h
+./examples/notification.lo: ../../include/net-snmp/library/types.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/notification.lo: ../../include/net-snmp/varbind_api.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/notification.lo: ../../include/net-snmp/pdu_api.h
+./examples/notification.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/notification.lo: ../../include/net-snmp/session_api.h
+./examples/notification.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/notification.lo: ../../include/net-snmp/mib_api.h
+./examples/notification.lo: ../../include/net-snmp/library/parse.h
+./examples/notification.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/notification.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./examples/notification.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./examples/notification.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./examples/notification.lo: notification.h
+./examples/scalar_int.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/scalar_int.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/types.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/varbind_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/scalar_int.lo: ../../include/net-snmp/pdu_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/scalar_int.lo: ../../include/net-snmp/session_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/scalar_int.lo: ../../include/net-snmp/mib_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/parse.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./examples/scalar_int.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/scalar_int.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/types.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/varbind_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/pdu_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/session_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/mib_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/parse.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./examples/ucdDemoPublic.lo: util_funcs/header_generic.h
+./examples/ucdDemoPublic.lo: ./examples/ucdDemoPublic.h
+./examples/watched.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./examples/watched.lo: ../../include/net-snmp/library/types.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/watched.lo: ../../include/net-snmp/varbind_api.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/watched.lo: ../../include/net-snmp/pdu_api.h
+./examples/watched.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./examples/watched.lo: ../../include/net-snmp/session_api.h
+./examples/watched.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./examples/watched.lo: ../../include/net-snmp/mib_api.h
+./examples/watched.lo: ../../include/net-snmp/library/parse.h
+./examples/watched.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/watched.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./examples/watched.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./examples/watched.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./host/hr_device.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./host/hr_device.lo: ../../include/net-snmp/library/types.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_device.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_device.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_device.lo: ../../include/net-snmp/session_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_device.lo: ../../include/net-snmp/mib_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/parse.h
+./host/hr_device.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_device.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./host/hr_device.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_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/oid.h
+./host/hr_disk.lo: ../../include/net-snmp/library/types.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_disk.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_disk.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_disk.lo: ../../include/net-snmp/session_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_disk.lo: ../../include/net-snmp/mib_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/parse.h
+./host/hr_disk.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_disk.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./host/hr_disk.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/net-snmp-features.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/oid.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/types.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_filesys.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_filesys.lo: ../../include/net-snmp/session_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_filesys.lo: ../../include/net-snmp/mib_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/parse.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./host/hr_filesys.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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_storage.h
+./host/hr_filesys.lo: ./host/hr_disk.h
+./host/hrh_filesys.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hrh_filesys.lo: ../../include/net-snmp/net-snmp-features.h
+./host/hrh_filesys.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hrh_filesys.lo: ../../include/net-snmp/definitions.h
+./host/hrh_filesys.lo: ../../include/net-snmp/types.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/oid.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/types.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hrh_filesys.lo: ../../include/net-snmp/varbind_api.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hrh_filesys.lo: ../../include/net-snmp/pdu_api.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/asn1.h
+./host/hrh_filesys.lo: ../../include/net-snmp/output_api.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hrh_filesys.lo: ../../include/net-snmp/session_api.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/callback.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/mib.h
+./host/hrh_filesys.lo: ../../include/net-snmp/mib_api.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/parse.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/getopt.h
+./host/hrh_filesys.lo: ../../include/net-snmp/utilities.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/system.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/tools.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/int64.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/mt_support.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/data_list.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/container.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/factory.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/container.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hrh_filesys.lo: ../../include/net-snmp/version.h
+./host/hrh_filesys.lo: ../../include/net-snmp/config_api.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/read_config.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/default_store.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/vacm.h
+./host/hrh_filesys.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/keytools.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/scapi.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmptsm.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hrh_filesys.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/instance.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/scalar.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/watcher.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/null.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/old_api.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/read_only.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/serialize.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/table.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/table_data.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/table_container.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/table_array.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/mfd.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/hardware/memory.h
+./host/hrh_filesys.lo: ../../include/net-snmp/agent/hardware/fsys.h
+./host/hrh_filesys.lo: host_res.h ./host/hrh_filesys.h ./host/hrh_storage.h
+./host/hrh_filesys.lo: ./host/hr_disk.h
+./host/hrh_storage.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hrh_storage.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hrh_storage.lo: ../../include/net-snmp/definitions.h
+./host/hrh_storage.lo: ../../include/net-snmp/types.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/oid.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/types.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hrh_storage.lo: ../../include/net-snmp/varbind_api.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hrh_storage.lo: ../../include/net-snmp/pdu_api.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/asn1.h
+./host/hrh_storage.lo: ../../include/net-snmp/output_api.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hrh_storage.lo: ../../include/net-snmp/session_api.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/callback.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/mib.h
+./host/hrh_storage.lo: ../../include/net-snmp/mib_api.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/parse.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hrh_storage.lo: ../../include/net-snmp/net-snmp-features.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/getopt.h
+./host/hrh_storage.lo: ../../include/net-snmp/utilities.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/system.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/tools.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/int64.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/mt_support.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/data_list.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/container.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/factory.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/container.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hrh_storage.lo: ../../include/net-snmp/version.h
+./host/hrh_storage.lo: ../../include/net-snmp/config_api.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/read_config.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/default_store.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/vacm.h
+./host/hrh_storage.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/keytools.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/scapi.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmptsm.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hrh_storage.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/instance.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/scalar.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/watcher.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/null.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/old_api.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/read_only.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/serialize.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/table.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/table_data.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/table_container.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/table_array.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/mfd.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/hardware/memory.h
+./host/hrh_storage.lo: ../../include/net-snmp/agent/hardware/fsys.h
+./host/hrh_storage.lo: host_res.h ./host/hrh_filesys.h ./host/hrh_storage.h
+./host/hrh_storage.lo: ./host/hr_disk.h
+./host/hr_network.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_network.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./host/hr_network.lo: ../../include/net-snmp/library/types.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_network.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_network.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_network.lo: ../../include/net-snmp/session_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_network.lo: ../../include/net-snmp/mib_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/parse.h
+./host/hr_network.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./host/hr_network.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/agent/snmp_get_statistic.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_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/oid.h
+./host/hr_other.lo: ../../include/net-snmp/library/types.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_other.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_other.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_other.lo: ../../include/net-snmp/session_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_other.lo: ../../include/net-snmp/mib_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/parse.h
+./host/hr_other.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_other.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./host/hr_other.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: 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/oid.h
+./host/hr_partition.lo: ../../include/net-snmp/library/types.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_partition.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_partition.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_partition.lo: ../../include/net-snmp/session_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_partition.lo: ../../include/net-snmp/mib_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/parse.h
+./host/hr_partition.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_partition.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./host/hr_partition.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_filesys.h
+./host/hr_partition.lo: ./host/hr_disk.h
+./host/hr_print.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./host/hr_print.lo: ../../include/net-snmp/library/types.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_print.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_print.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_print.lo: ../../include/net-snmp/session_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_print.lo: ../../include/net-snmp/mib_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/parse.h
+./host/hr_print.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_print.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./host/hr_print.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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 util_funcs.h
+./host/hr_print.lo: util_funcs/header_generic.h
+./host/hr_print.lo: util_funcs/header_simple_table.h
+./host/hr_print.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h
+./host/hr_proc.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./host/hr_proc.lo: ../../include/net-snmp/library/types.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_proc.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_proc.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_proc.lo: ../../include/net-snmp/session_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_proc.lo: ../../include/net-snmp/mib_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/parse.h
+./host/hr_proc.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_proc.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./host/hr_proc.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./host/hr_proc.lo: host_res.h
+./host/hr_proc.lo: ./host/hr_proc.h ../../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: 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/oid.h
+./host/hr_storage.lo: ../../include/net-snmp/library/types.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_storage.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_storage.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_storage.lo: ../../include/net-snmp/session_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_storage.lo: ../../include/net-snmp/mib_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/parse.h
+./host/hr_storage.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_storage.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./host/hr_storage.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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_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/snmp_get_statistic.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/hardware/memory.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/definitions.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/types.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/oid.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/types.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/varbind_api.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/pdu_api.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/asn1.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/output_api.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/session_api.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/callback.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/mib.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/mib_api.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/parse.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/net-snmp-features.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/getopt.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/utilities.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/system.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/tools.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/int64.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/mt_support.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/data_list.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/container.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/factory.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/container.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/version.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/config_api.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/read_config.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/default_store.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/vacm.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/keytools.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/scapi.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmptsm.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/instance.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/scalar.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/watcher.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/null.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/old_api.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/read_only.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/serialize.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/table.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/table_data.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/table_container.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/table_array.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/mfd.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./host/hrSWInstalledTable.lo: ../../include/net-snmp/data_access/swinst.h
+./host/hrSWInstalledTable.lo: ./host/hrSWInstalledTable.h
+./host/hr_swinst.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_swinst.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/types.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_swinst.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_swinst.lo: ../../include/net-snmp/session_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_swinst.lo: ../../include/net-snmp/mib_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/parse.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./host/hr_swinst.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/output_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/types.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/oid.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/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/varbind_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_swrun.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_swrun.lo: ../../include/net-snmp/session_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_swrun.lo: ../../include/net-snmp/mib_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/parse.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_swrun.lo: ../../include/net-snmp/net-snmp-features.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_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/library/getopt.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/data_list.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/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/snmptsm.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/hrSWRunPerfTable.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/definitions.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/types.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/oid.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/types.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/varbind_api.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/pdu_api.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/asn1.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/output_api.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/session_api.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/callback.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/mib.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/mib_api.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/parse.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/net-snmp-features.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/getopt.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/utilities.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/system.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/tools.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/int64.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/mt_support.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/data_list.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/container.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/factory.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/container.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/version.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/config_api.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/read_config.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/default_store.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/vacm.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/keytools.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/scapi.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmptsm.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/instance.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/scalar.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/watcher.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/null.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/old_api.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/read_only.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/serialize.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/table.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/table_data.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/table_container.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/table_array.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/mfd.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./host/hrSWRunPerfTable.lo: ../../include/net-snmp/data_access/swrun.h
+./host/hrSWRunPerfTable.lo: ./host/hrSWRunPerfTable.h
+./host/hrSWRunPerfTable.lo: ./host/data_access/swrun.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/definitions.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/types.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/oid.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/types.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/varbind_api.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/pdu_api.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/asn1.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/output_api.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/session_api.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/callback.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/mib.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/mib_api.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/parse.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/net-snmp-features.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/getopt.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/utilities.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/system.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/tools.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/int64.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/mt_support.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/data_list.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/container.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/factory.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/container.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/version.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/config_api.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/read_config.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/default_store.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/vacm.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/keytools.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/scapi.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmptsm.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/instance.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/scalar.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/watcher.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/null.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/old_api.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/read_only.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/serialize.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/table.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/table_data.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/table_container.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/table_array.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/mfd.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./host/hrSWRunTable.lo: ../../include/net-snmp/data_access/swrun.h
+./host/hrSWRunTable.lo: ./host/data_access/swrun.h ./host/hrSWRunTable.h
+./host/hr_system.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_system.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./host/hr_system.lo: ../../include/net-snmp/library/types.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_system.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_system.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./host/hr_system.lo: ../../include/net-snmp/session_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./host/hr_system.lo: ../../include/net-snmp/mib_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/parse.h
+./host/hr_system.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./host/hr_system.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/hr_system.lo: ../../include/net-snmp/agent/snmp_get_statistic.h host.h
+./host/hr_system.lo: host_res.h ./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/net-snmp-features.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/oid.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/types.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/varbind_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_client.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/pdu_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/session_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/mib_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/parse.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/agent/snmp_get_statistic.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: ./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/oid.h
+./mibII/at.lo: ../../include/net-snmp/library/types.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/at.lo: ../../include/net-snmp/varbind_api.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/at.lo: ../../include/net-snmp/pdu_api.h
+./mibII/at.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/at.lo: ../../include/net-snmp/session_api.h
+./mibII/at.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/at.lo: ../../include/net-snmp/mib_api.h
+./mibII/at.lo: ../../include/net-snmp/library/parse.h
+./mibII/at.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/at.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/at.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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: ./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/oid.h
+./mibII/icmp.lo: ../../include/net-snmp/library/types.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/icmp.lo: ../../include/net-snmp/varbind_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/icmp.lo: ../../include/net-snmp/pdu_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/icmp.lo: ../../include/net-snmp/session_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/icmp.lo: ../../include/net-snmp/mib_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/parse.h
+./mibII/icmp.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/icmp.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/icmp.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/icmp.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h ./mibII/icmp.h
+./mibII/interfaces.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/interfaces.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/types.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/varbind_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/interfaces.lo: ../../include/net-snmp/pdu_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/interfaces.lo: ../../include/net-snmp/session_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/interfaces.lo: ../../include/net-snmp/mib_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/parse.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/interfaces.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/interfaces.lo: ../../include/net-snmp/data_access/interface.h
+./mibII/interfaces.lo: ./mibII/interfaces.h struct.h
+./mibII/interfaces.lo: util_funcs/header_generic.h
+./mibII/ipAddr.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/ipAddr.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/types.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipAddr.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/ipAddr.lo: ../../include/net-snmp/session_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/ipAddr.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/ipAddr.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/ip.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./mibII/ip.lo: ../../include/net-snmp/library/types.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ip.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ip.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/ip.lo: ../../include/net-snmp/session_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/ip.lo: ../../include/net-snmp/mib_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/parse.h
+./mibII/ip.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/ip.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/ip.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/ip.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/ip.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/ip.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/ip.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h ./mibII/ip.h
+./mibII/ip.lo: ./mibII/var_route.h ./mibII/route_write.h ./mibII/at.h
+./mibII/ip.lo: ./mibII/ipAddr.h ./mibII/interfaces.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/types.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/session_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mibII/ipCidrRouteTable_access.lo: ./mibII/ipCidrRouteTable_access.h
+./mibII/ipCidrRouteTable_access.lo: ./mibII/ipCidrRouteTable_enums.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/types.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/session_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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_checkfns.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/types.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/session_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/net-snmp-features.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/oid.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/types.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipv6.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/ipv6.lo: ../../include/net-snmp/session_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/ipv6.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/ipv6.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/ipv6.lo: ../../agent/kernel.h ./mibII/ipv6.h ./mibII/var_route.h
+./mibII/ipv6.lo: ./mibII/route_write.h ./mibII/at.h ./mibII/interfaces.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/types.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/varbind_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/pdu_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/session_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/mib_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/parse.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mibII/kernel_linux.lo: ./mibII/kernel_linux.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/definitions.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/types.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/oid.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/types.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/varbind_api.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/pdu_api.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/asn1.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/output_api.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/session_api.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/callback.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/mib.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/mib_api.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/parse.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/net-snmp-features.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/getopt.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/utilities.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/system.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/tools.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/int64.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/data_list.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/container.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/factory.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/container.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/version.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/config_api.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/read_config.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/default_store.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/vacm.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/keytools.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/scapi.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmptsm.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/instance.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/null.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/table.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/kernel_netbsd.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mibII/kernel_netbsd.lo: ./mibII/kernel_netbsd.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/types.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/varbind_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/pdu_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/session_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/mib_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/parse.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./mibII/route_write.lo: ../../include/net-snmp/library/types.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/route_write.lo: ../../include/net-snmp/varbind_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/route_write.lo: ../../include/net-snmp/pdu_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/route_write.lo: ../../include/net-snmp/session_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/route_write.lo: ../../include/net-snmp/mib_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/parse.h
+./mibII/route_write.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/route_write.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/route_write.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/route_write.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mibII/route_write.lo: ./mibII/ip.h ./mibII/var_route.h
+./mibII/route_write.lo: ./mibII/route_write.h ./mibII/at.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/types.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/varbind_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/pdu_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/session_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/mib_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/parse.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mibII/setSerialNo.lo: ./mibII/setSerialNo.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/net-snmp-features.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/definitions.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/types.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/oid.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/types.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/varbind_api.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/pdu_api.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/asn1.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/output_api.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/session_api.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/callback.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/mib.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/mib_api.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/parse.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/getopt.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/utilities.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/system.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/tools.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/int64.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/data_list.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/container.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/factory.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/container.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/version.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/config_api.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/read_config.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/default_store.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/vacm.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/keytools.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/scapi.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmptsm.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/instance.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/null.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/table.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/snmp_mib_5_5.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/snmp_mib_5_5.lo: ./mibII/snmp_mib_5_5.h ./mibII/updates.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/types.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/varbind_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/pdu_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/session_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/mib_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/parse.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/snmp_mib.lo: ./mibII/snmp_mib.h ./mibII/updates.h
+./mibII/sysORTable.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/types.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/varbind_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/sysORTable.lo: ../../include/net-snmp/pdu_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/sysORTable.lo: ../../include/net-snmp/session_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/sysORTable.lo: ../../include/net-snmp/mib_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/parse.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/sysORTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/sysORTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/agent_sysORTable.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/sysORTable.lo: ./mibII/sysORTable.h
+./mibII/system_mib.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/system_mib.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/types.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/varbind_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/system_mib.lo: ../../include/net-snmp/pdu_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/system_mib.lo: ../../include/net-snmp/session_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/system_mib.lo: ../../include/net-snmp/mib_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/parse.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/system_mib.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./mibII/system_mib.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/system_mib.lo: util_funcs.h util_funcs/header_generic.h
+./mibII/system_mib.lo: util_funcs/header_simple_table.h struct.h
+./mibII/system_mib.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h
+./mibII/system_mib.lo: ./mibII/system_mib.h ./mibII/updates.h
+./mibII/tcp.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/tcp.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/tcp.lo: ../../include/net-snmp/library/types.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/tcp.lo: ../../include/net-snmp/varbind_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/tcp.lo: ../../include/net-snmp/pdu_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/tcp.lo: ../../include/net-snmp/session_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/tcp.lo: ../../include/net-snmp/mib_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/parse.h
+./mibII/tcp.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/tcp.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/tcp.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h ./mibII/tcp.h
+./mibII/tcp.lo: ./mibII/tcpTable.h
+./mibII/tcpTable.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/tcpTable.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/types.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/varbind_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/tcpTable.lo: ../../include/net-snmp/pdu_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/tcpTable.lo: ../../include/net-snmp/session_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/tcpTable.lo: ../../include/net-snmp/mib_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/parse.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/tcpTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/auto_nlist.h ./mibII/tcp.h
+./mibII/tcpTable.lo: ./mibII/tcpTable.h
+./mibII/udp.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./mibII/udp.lo: ../../include/net-snmp/library/types.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/udp.lo: ../../include/net-snmp/varbind_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/udp.lo: ../../include/net-snmp/pdu_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/udp.lo: ../../include/net-snmp/session_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/udp.lo: ../../include/net-snmp/mib_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/parse.h
+./mibII/udp.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/udp.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/udp.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/udp.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/udp.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/udp.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/udp.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h ./mibII/udp.h
+./mibII/udp.lo: ./mibII/udpTable.h
+./mibII/udpTable.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/types.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/varbind_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/udpTable.lo: ../../include/net-snmp/pdu_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/udpTable.lo: ../../include/net-snmp/session_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/udpTable.lo: ../../include/net-snmp/mib_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/parse.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/udpTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/udpTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/auto_nlist.h ./mibII/udp.h
+./mibII/udpTable.lo: ./mibII/udpTable.h
+./mibII/updates.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/updates.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/updates.lo: ../../include/net-snmp/definitions.h
+./mibII/updates.lo: ../../include/net-snmp/types.h
+./mibII/updates.lo: ../../include/net-snmp/library/oid.h
+./mibII/updates.lo: ../../include/net-snmp/library/types.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/updates.lo: ../../include/net-snmp/varbind_api.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/updates.lo: ../../include/net-snmp/pdu_api.h
+./mibII/updates.lo: ../../include/net-snmp/library/asn1.h
+./mibII/updates.lo: ../../include/net-snmp/output_api.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/updates.lo: ../../include/net-snmp/session_api.h
+./mibII/updates.lo: ../../include/net-snmp/library/callback.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/updates.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/updates.lo: ../../include/net-snmp/library/mib.h
+./mibII/updates.lo: ../../include/net-snmp/mib_api.h
+./mibII/updates.lo: ../../include/net-snmp/library/parse.h
+./mibII/updates.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/updates.lo: ../../include/net-snmp/net-snmp-features.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/updates.lo: ../../include/net-snmp/library/getopt.h
+./mibII/updates.lo: ../../include/net-snmp/utilities.h
+./mibII/updates.lo: ../../include/net-snmp/library/system.h
+./mibII/updates.lo: ../../include/net-snmp/library/tools.h
+./mibII/updates.lo: ../../include/net-snmp/library/int64.h
+./mibII/updates.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/updates.lo: ../../include/net-snmp/library/data_list.h
+./mibII/updates.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/updates.lo: ../../include/net-snmp/library/container.h
+./mibII/updates.lo: ../../include/net-snmp/library/factory.h
+./mibII/updates.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/updates.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/updates.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/updates.lo: ../../include/net-snmp/library/container.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/updates.lo: ../../include/net-snmp/version.h
+./mibII/updates.lo: ../../include/net-snmp/config_api.h
+./mibII/updates.lo: ../../include/net-snmp/library/read_config.h
+./mibII/updates.lo: ../../include/net-snmp/library/default_store.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/updates.lo: ../../include/net-snmp/library/vacm.h
+./mibII/updates.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/updates.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/updates.lo: ../../include/net-snmp/library/keytools.h
+./mibII/updates.lo: ../../include/net-snmp/library/scapi.h
+./mibII/updates.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmptsm.h
+./mibII/updates.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/updates.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/updates.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/updates.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/updates.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/updates.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/updates.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/updates.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/updates.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/updates.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/updates.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/updates.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/updates.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/updates.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/updates.lo: ../../include/net-snmp/agent/instance.h
+./mibII/updates.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/updates.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/updates.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/updates.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/updates.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/updates.lo: ../../include/net-snmp/agent/null.h
+./mibII/updates.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/updates.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/updates.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/updates.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/updates.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/updates.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/updates.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/updates.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/updates.lo: ../../include/net-snmp/agent/table.h
+./mibII/updates.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/updates.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/updates.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/updates.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/updates.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/updates.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/updates.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/updates.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/types.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/varbind_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/pdu_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/session_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/mib_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/parse.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/vacm_conf.lo: ./mibII/vacm_conf.h ../../agent/snmpd.h
+./mibII/vacm_context.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/types.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/varbind_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/vacm_context.lo: ../../include/net-snmp/pdu_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/vacm_context.lo: ../../include/net-snmp/session_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/vacm_context.lo: ../../include/net-snmp/mib_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/parse.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/vacm_context.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/vacm_context.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/types.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/varbind_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/pdu_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/session_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/mib_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/parse.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/sysORTable.h
+./mibII/vacm_vars.lo: ./mibII/vacm_vars.h util_funcs/header_generic.h
+./mibII/var_route.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/var_route.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./mibII/var_route.lo: ../../include/net-snmp/library/types.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/var_route.lo: ../../include/net-snmp/varbind_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/var_route.lo: ../../include/net-snmp/pdu_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./mibII/var_route.lo: ../../include/net-snmp/session_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./mibII/var_route.lo: ../../include/net-snmp/mib_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/parse.h
+./mibII/var_route.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./mibII/var_route.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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
+./misc/ipfwacc.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/types.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/varbind_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_client.h
+./misc/ipfwacc.lo: ../../include/net-snmp/pdu_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./misc/ipfwacc.lo: ../../include/net-snmp/session_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./misc/ipfwacc.lo: ../../include/net-snmp/mib_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/parse.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/oid_stash.h
+./misc/ipfwacc.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./misc/ipfwacc.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./misc/ipfwacc.lo: util_funcs/header_simple_table.h ./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/net-snmp-features.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/oid.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/types.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/varbind_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_client.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/pdu_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/session_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/mib_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/parse.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/sysORTable.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/agent_callbacks.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/net-snmp-features.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/oid.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/types.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/varbind_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_client.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/pdu_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/session_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/mib_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/parse.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/net-snmp-features.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/oid.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/types.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/varbind_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_client.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/pdu_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/session_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/mib_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/parse.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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: ../../include/net-snmp/agent/sysORTable.h
+./notification/snmpNotifyTable.lo: notification-log-mib/notification_log.h
+./Rmon/agutil.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/types.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/agutil.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./Rmon/agutil.lo: ../../include/net-snmp/session_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./Rmon/agutil.lo: ../../include/net-snmp/mib_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/parse.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/agutil.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./Rmon/agutil.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./Rmon/agutil.lo: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/types.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/alarm.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./Rmon/alarm.lo: ../../include/net-snmp/session_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./Rmon/alarm.lo: ../../include/net-snmp/mib_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/parse.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/alarm.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./Rmon/alarm.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./Rmon/alarm.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./Rmon/alarm.lo: ./Rmon/alarm.h ./Rmon/agutil_api.h ./Rmon/row_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/net-snmp-config.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/net-snmp-features.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/definitions.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/types.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/oid.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/types.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/asn1.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/output_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/session_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/callback.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_service.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/mib.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/mib_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/parse.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/getopt.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/utilities.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/system.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/tools.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/int64.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/mt_support.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/data_list.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/check_varbind.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/container.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/factory.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/container_iterator.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/container.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/version.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/config_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/read_config.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/default_store.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/vacm.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/snmpv3_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpv3.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/transform_oids.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/keytools.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/scapi.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/lcd_time.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmptsm.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/snmpusm.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/var_struct.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/instance.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/scalar.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/watcher.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/null.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/old_api.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/read_only.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/row_merge.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/serialize.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/table.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/table_data.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/table_container.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/table_array.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/mfd.h
+./Rmon/alarmTable.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./Rmon/alarmTable.lo: utilities/iquery.h ./Rmon/alarmTable.h
+./Rmon/event.lo: ../../include/net-snmp/net-snmp-config.h
+./Rmon/event.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./Rmon/event.lo: ../../include/net-snmp/library/types.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/event.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/event.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./Rmon/event.lo: ../../include/net-snmp/session_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./Rmon/event.lo: ../../include/net-snmp/mib_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/parse.h
+./Rmon/event.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./Rmon/event.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./Rmon/event.lo: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./Rmon/history.lo: ../../include/net-snmp/library/types.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/history.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/history.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./Rmon/history.lo: ../../include/net-snmp/session_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./Rmon/history.lo: ../../include/net-snmp/mib_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/parse.h
+./Rmon/history.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/history.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./Rmon/history.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./Rmon/history.lo: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./Rmon/rows.lo: ../../include/net-snmp/library/types.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/rows.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/rows.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./Rmon/rows.lo: ../../include/net-snmp/session_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./Rmon/rows.lo: ../../include/net-snmp/mib_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/parse.h
+./Rmon/rows.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/rows.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./Rmon/rows.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./Rmon/rows.lo: ../../include/net-snmp/agent/snmp_get_statistic.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/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/oid.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/types.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/statistics.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./Rmon/statistics.lo: ../../include/net-snmp/session_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./Rmon/statistics.lo: ../../include/net-snmp/mib_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/parse.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/statistics.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./Rmon/statistics.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./Rmon/statistics.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./Rmon/statistics.lo: ./Rmon/statistics.h ./Rmon/agutil_api.h
+./Rmon/statistics.lo: ./Rmon/row_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/net-snmp-config.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/oid.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ./sctp-mib/sctpAssocLocalAddrTable.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ./sctp-mib/sctpTables_common.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/oid.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./sctp-mib/sctpScalars_common.lo: ./sctp-mib/sctpScalars_common.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/oid.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/net-snmp-features.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/getopt.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmptsm.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpScalars_freebsd.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./sctp-mib/sctpScalars_freebsd.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/oid.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./sctp-mib/sctpScalars_linux.lo: ./sctp-mib/sctpScalars_common.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/oid.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/net-snmp-features.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/getopt.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmptsm.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpScalars_solaris2.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./sctp-mib/sctpScalars_solaris2.lo: ./sctp-mib/sctpScalars_common.h
+./sctp-mib/sctpScalars_solaris2.lo: kernel_sunos5.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpTables_common.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_freebsd.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/oid.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/net-snmp-features.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/getopt.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmptsm.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpTables_freebsd.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./sctp-mib/sctpTables_freebsd.lo: ./sctp-mib/sctpAssocTable.h
+./sctp-mib/sctpTables_freebsd.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpTables_freebsd.lo: ./sctp-mib/sctpAssocLocalAddrTable.h
+./sctp-mib/sctpTables_freebsd.lo: ./sctp-mib/sctpAssocRemAddrTable.h
+./sctp-mib/sctpTables_freebsd.lo: util_funcs.h util_funcs/header_generic.h
+./sctp-mib/sctpTables_freebsd.lo: util_funcs/header_simple_table.h struct.h
+./sctp-mib/sctpTables_freebsd.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.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/oid.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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: ./sctp-mib/sctpAssocLocalAddrTable.h
+./sctp-mib/sctpTables_linux.lo: ./sctp-mib/sctpAssocRemAddrTable.h
+./sctp-mib/sctpTables_linux.lo: ../../agent/mibgroup/util_funcs/get_pid_from_inode.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/oid.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/types.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/net-snmp-features.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/getopt.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmptsm.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpTables_solaris2.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./sctp-mib/sctpTables_solaris2.lo: ./sctp-mib/sctpAssocTable.h
+./sctp-mib/sctpTables_solaris2.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpTables_solaris2.lo: ./sctp-mib/sctpAssocLocalAddrTable.h
+./sctp-mib/sctpTables_solaris2.lo: ./sctp-mib/sctpAssocRemAddrTable.h
+./sctp-mib/sctpTables_solaris2.lo: util_funcs.h util_funcs/header_generic.h
+./sctp-mib/sctpTables_solaris2.lo: util_funcs/header_simple_table.h struct.h
+./sctp-mib/sctpTables_solaris2.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h
+./sctp-mib/sctpTables_solaris2.lo: kernel_sunos5.h
+./smux/smux.lo: ../../include/net-snmp/net-snmp-config.h
+./smux/smux.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./smux/smux.lo: ../../include/net-snmp/library/types.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_api.h
+./smux/smux.lo: ../../include/net-snmp/varbind_api.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_client.h
+./smux/smux.lo: ../../include/net-snmp/pdu_api.h
+./smux/smux.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./smux/smux.lo: ../../include/net-snmp/session_api.h
+./smux/smux.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./smux/smux.lo: ../../include/net-snmp/mib_api.h
+./smux/smux.lo: ../../include/net-snmp/library/parse.h
+./smux/smux.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./smux/smux.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/smux.lo: ../../include/net-snmp/agent/snmp_get_statistic.h smux.h
+./smux/smux.lo: 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/oid.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/types.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/varbind_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_client.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/pdu_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/session_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/mib_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/parse.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/oid_stash.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_bgp.lo: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/types.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/varbind_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_client.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/pdu_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/session_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/mib_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/parse.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/oid_stash.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_ospf.lo: ../../include/net-snmp/agent/snmp_get_statistic.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/oid.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/types.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/varbind_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_client.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/pdu_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/session_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/mib_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/parse.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/oid_stash.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_rip2.lo: ../../include/net-snmp/agent/snmp_get_statistic.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-features.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/oid.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/types.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/session_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/sysORTable.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./snmpv3/snmpEngine.lo: util_funcs/header_generic.h ./snmpv3/snmpEngine.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/net-snmp-config.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/net-snmp-features.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/net-snmp-includes.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/definitions.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/types.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/oid.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/types.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/asn1.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/output_api.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_debug.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_logging.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/session_api.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/callback.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_transport.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_service.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/ucd_compat.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/mib.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_impl.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp-tc.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/getopt.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/utilities.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/system.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/tools.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/int64.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/mt_support.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_alarm.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/data_list.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/check_varbind.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/container.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/factory.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/container_binary_array.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/container_list_ssll.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/container_iterator.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/container.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_assert.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/version.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/config_api.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/read_config.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/default_store.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_enum.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/vacm.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/snmpv3_api.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpv3.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/transform_oids.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/keytools.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/scapi.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/lcd_time.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmp_secmod.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmptsm.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/snmpusm.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/mib_module_config.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/agent_module_config.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/snmp_agent.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/snmp_vars.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/agent_handler.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/var_struct.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/agent_registry.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/library/fd_event_manager.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/ds_agent.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/agent_read_config.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/agent_trap.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/all_helpers.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/instance.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/baby_steps.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/scalar.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/scalar_group.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/watcher.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/multiplexer.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/null.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/debug_handler.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/cache_handler.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/old_api.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/read_only.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/row_merge.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/serialize.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/mode_end_call.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/table.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/table_data.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/table_dataset.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/table_tdata.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/table_iterator.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/table_container.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/table_array.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/mfd.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/sysORTable.h
+./snmpv3/snmpMPDStats_5_5.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./snmpv3/snmpMPDStats_5_5.lo: ./snmpv3/snmpMPDStats_5_5.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/oid.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/types.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/session_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/sysORTable.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./snmpv3/snmpMPDStats.lo: ./snmpv3/snmpMPDStats.h util_funcs/header_generic.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/oid.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/types.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/session_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/usmConf.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/net-snmp-config.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/net-snmp-features.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/net-snmp-includes.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/definitions.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/types.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/oid.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/types.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/asn1.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/output_api.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_debug.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_logging.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/session_api.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/callback.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_transport.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_service.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/ucd_compat.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/mib.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_impl.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp-tc.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/getopt.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/utilities.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/system.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/tools.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/int64.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/mt_support.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_alarm.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/data_list.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/check_varbind.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/container.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/factory.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/container_binary_array.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/container_list_ssll.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/container_iterator.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/container.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_assert.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/version.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/config_api.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/read_config.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/default_store.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_enum.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/vacm.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/snmpv3_api.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpv3.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/transform_oids.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/keytools.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/scapi.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/lcd_time.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmp_secmod.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmptsm.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/snmpusm.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/mib_module_config.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/agent_module_config.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/snmp_agent.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/snmp_vars.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/agent_handler.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/var_struct.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/agent_registry.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/library/fd_event_manager.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/ds_agent.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/agent_read_config.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/agent_trap.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/all_helpers.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/instance.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/baby_steps.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/scalar.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/scalar_group.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/watcher.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/multiplexer.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/null.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/debug_handler.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/cache_handler.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/old_api.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/read_only.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/row_merge.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/serialize.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/mode_end_call.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/table.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/table_data.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/table_dataset.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/table_tdata.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/table_iterator.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/table_container.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/table_array.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/mfd.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/sysORTable.h
+./snmpv3/usmStats_5_5.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./snmpv3/usmStats_5_5.lo: ./snmpv3/usmStats_5_5.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/oid.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/types.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/session_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/sysORTable.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./snmpv3/usmStats.lo: util_funcs/header_generic.h ./snmpv3/usmStats.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/net-snmp-config.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/types.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/session_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./snmpv3/usmUser.lo: util_funcs/header_generic.h ./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/oid.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/types.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/varbind_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_client.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/pdu_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/session_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/mib_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/parse.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/oid_stash.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./target/snmpTargetAddrEntry.lo: ./target/snmpTargetAddrEntry.h
+./target/snmpTargetAddrEntry.lo: util_funcs/header_generic.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/oid.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/types.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/varbind_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_client.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/pdu_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/session_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/mib_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/parse.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/oid_stash.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.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-features.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/oid.h
+./target/target.lo: ../../include/net-snmp/library/types.h
+./target/target.lo: ../../include/net-snmp/library/snmp_api.h
+./target/target.lo: ../../include/net-snmp/varbind_api.h
+./target/target.lo: ../../include/net-snmp/library/snmp_client.h
+./target/target.lo: ../../include/net-snmp/pdu_api.h
+./target/target.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./target/target.lo: ../../include/net-snmp/session_api.h
+./target/target.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./target/target.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./target/target.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./target/target.lo: ../../include/net-snmp/mib_api.h
+./target/target.lo: ../../include/net-snmp/library/parse.h
+./target/target.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./target/target.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./target/target.lo: ./target/snmpTargetAddrEntry.h
+./target/target.lo: ./target/snmpTargetParamsEntry.h target.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/net-snmp-config.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/net-snmp-features.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/net-snmp-includes.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/definitions.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/types.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/oid.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/types.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_api.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/varbind_api.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_client.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/pdu_api.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/asn1.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/output_api.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_debug.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_logging.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/session_api.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/callback.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_transport.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_service.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/ucd_compat.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/mib.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/mib_api.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/parse.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/oid_stash.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_impl.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp-tc.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/getopt.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/utilities.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/system.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/tools.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/int64.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/mt_support.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_alarm.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/data_list.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/check_varbind.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/container.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/factory.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/container_binary_array.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/container_list_ssll.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/container_iterator.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/container.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_assert.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/version.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/config_api.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/read_config.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/default_store.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_enum.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/vacm.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/snmpv3_api.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpv3.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/transform_oids.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/keytools.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/scapi.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/lcd_time.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmp_secmod.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmptsm.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/snmpusm.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/mib_module_config.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/agent_module_config.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/snmp_agent.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/snmp_vars.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/agent_handler.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/var_struct.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/agent_registry.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/library/fd_event_manager.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/ds_agent.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/agent_read_config.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/agent_trap.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/all_helpers.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/instance.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/baby_steps.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/scalar.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/scalar_group.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/watcher.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/multiplexer.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/null.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/debug_handler.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/cache_handler.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/old_api.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/read_only.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/row_merge.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/serialize.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/mode_end_call.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/table.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/table_data.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/table_dataset.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/table_tdata.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/table_iterator.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/table_container.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/table_array.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/mfd.h
+./target/target_counters_5_5.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./target/target_counters_5_5.lo: ./target/target_counters_5_5.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/oid.h
+./target/target_counters.lo: ../../include/net-snmp/library/types.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_api.h
+./target/target_counters.lo: ../../include/net-snmp/varbind_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_client.h
+./target/target_counters.lo: ../../include/net-snmp/pdu_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./target/target_counters.lo: ../../include/net-snmp/session_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./target/target_counters.lo: ../../include/net-snmp/mib_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/parse.h
+./target/target_counters.lo: ../../include/net-snmp/library/oid_stash.h
+./target/target_counters.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./target/target_counters.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./target/target_counters.lo: ./target/target_counters.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/net-snmp-config.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/net-snmp-includes.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/definitions.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/types.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/oid.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/types.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_api.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/varbind_api.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_client.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/pdu_api.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/asn1.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/output_api.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_debug.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_logging.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/session_api.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/callback.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_transport.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_service.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/ucd_compat.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/mib.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/mib_api.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/parse.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/oid_stash.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/net-snmp-features.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_impl.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp-tc.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/getopt.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/utilities.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/system.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/tools.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/int64.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/mt_support.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_alarm.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/data_list.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/check_varbind.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/container.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/factory.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/container_binary_array.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/container_list_ssll.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/container_iterator.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/container.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_assert.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/version.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/config_api.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/read_config.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/default_store.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_enum.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/vacm.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/snmpv3_api.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpv3.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/transform_oids.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/keytools.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/scapi.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/lcd_time.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmp_secmod.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmptsm.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/snmpusm.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/mib_module_config.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/agent_module_config.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/snmp_agent.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/snmp_vars.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/agent_handler.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/var_struct.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/agent_registry.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/library/fd_event_manager.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/ds_agent.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/agent_read_config.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/agent_trap.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/all_helpers.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/instance.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/baby_steps.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/scalar.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/scalar_group.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/watcher.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/multiplexer.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/null.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/debug_handler.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/cache_handler.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/old_api.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/read_only.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/row_merge.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/serialize.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/mode_end_call.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/table.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/table_data.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/table_dataset.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/table_tdata.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/table_iterator.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/table_container.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/table_array.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/mfd.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./tsm-mib/snmpTsmConfigurationUsePrefix.lo: ./tsm-mib/snmpTsmConfigurationUsePrefix.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/oid.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/types.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/varbind_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_client.h
+./tunnel/tunnel.lo: ../../include/net-snmp/pdu_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./tunnel/tunnel.lo: ../../include/net-snmp/session_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./tunnel/tunnel.lo: ../../include/net-snmp/mib_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/parse.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/oid_stash.h
+./tunnel/tunnel.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./tunnel/tunnel.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/sysORTable.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/agent_callbacks.h tunnel.h
+./tunnel/tunnel.lo: 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/oid.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/auto_nlist.h struct.h
+./ucd-snmp/disk.lo: ./ucd-snmp/disk.h mibdefs.h
+./ucd-snmp/disk.lo: util_funcs/header_simple_table.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/types.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/oid.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/net-snmp-features.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/getopt.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/version.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmptsm.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/disk_hw.lo: ../../include/net-snmp/agent/hardware/fsys.h struct.h
+./ucd-snmp/disk_hw.lo: ./ucd-snmp/disk.h mibdefs.h
+./ucd-snmp/disk_hw.lo: util_funcs/header_simple_table.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/oid.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/diskio.lo: util_funcs/header_simple_table.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-features.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/oid.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/dlmod.lo: ./ucd-snmp/dlmod.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/oid.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/auto_nlist.h struct.h
+./ucd-snmp/errormib.lo: ./ucd-snmp/errormib.h mibdefs.h
+./ucd-snmp/errormib.lo: util_funcs/header_generic.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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: ../../agent/mibgroup/util_funcs.h
+./ucd-snmp/extensible.lo: util_funcs/header_generic.h
+./ucd-snmp/extensible.lo: util_funcs/header_simple_table.h
+./ucd-snmp/extensible.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h
+./ucd-snmp/extensible.lo: utilities/execute.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/oid.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/file.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/file.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/file.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/file.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/file.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/file.lo: struct.h ./ucd-snmp/file.h mibdefs.h
+./ucd-snmp/file.lo: util_funcs/header_simple_table.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/oid.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/hpux.lo: ./ucd-snmp/hpux.h mibdefs.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/lmSensors.lo: util_funcs/header_simple_table.h
+./ucd-snmp/lmSensors.lo: ./ucd-snmp/lmSensors.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/types.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/oid.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/net-snmp-features.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/getopt.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/version.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmptsm.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/lmsensorsMib.lo: ../../include/net-snmp/agent/hardware/sensors.h
+./ucd-snmp/lmsensorsMib.lo: hardware/sensors/hw_sensors.h
+./ucd-snmp/lmsensorsMib.lo: ucd-snmp/lmsensorsMib.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/oid.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/auto_nlist.h struct.h
+./ucd-snmp/loadave.lo: ./ucd-snmp/loadave.h mibdefs.h
+./ucd-snmp/loadave.lo: util_funcs/header_simple_table.h ../../agent/kernel.h
+./ucd-snmp/logmatch.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/logmatch.lo: ./ucd-snmp/logmatch.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/oid.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_aix4.lo: util_funcs/header_generic.h ./ucd-snmp/memory.h
+./ucd-snmp/memory_aix4.lo: ./ucd-snmp/memory_aix4.h mibdefs.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/oid.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/hardware/memory.h
+./ucd-snmp/memory.lo: ./ucd-snmp/memory.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/oid.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_darwin7.lo: util_funcs/header_generic.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/oid.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_dynix.lo: util_funcs/header_generic.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/oid.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_freebsd2.lo: util_funcs.h util_funcs/header_generic.h
+./ucd-snmp/memory_freebsd2.lo: util_funcs/header_simple_table.h struct.h
+./ucd-snmp/memory_freebsd2.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h
+./ucd-snmp/memory_freebsd2.lo: ./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/oid.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/oid.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_netbsd1.lo: util_funcs/header_generic.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/oid.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_solaris2.lo: util_funcs/header_generic.h
+./ucd-snmp/memory_solaris2.lo: ./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-features.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/oid.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/pass.lo: struct.h ./ucd-snmp/pass.h mibdefs.h
+./ucd-snmp/pass.lo: ./ucd-snmp/pass_common.h ./ucd-snmp/extensible.h
+./ucd-snmp/pass.lo: util_funcs.h util_funcs/header_generic.h
+./ucd-snmp/pass.lo: util_funcs/header_simple_table.h
+./ucd-snmp/pass.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/types.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/oid.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/net-snmp-features.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/getopt.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/version.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmptsm.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/pass_common.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/pass_common.lo: ../../agent/mibgroup/util_funcs.h
+./ucd-snmp/pass_common.lo: util_funcs/header_generic.h
+./ucd-snmp/pass_common.lo: util_funcs/header_simple_table.h struct.h
+./ucd-snmp/pass_common.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h
+./ucd-snmp/pass_common.lo: ./ucd-snmp/pass_common.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/pass_persist.lo: struct.h ./ucd-snmp/pass_persist.h mibdefs.h
+./ucd-snmp/pass_persist.lo: ./ucd-snmp/pass_common.h ./ucd-snmp/extensible.h
+./ucd-snmp/pass_persist.lo: util_funcs.h util_funcs/header_generic.h
+./ucd-snmp/pass_persist.lo: util_funcs/header_simple_table.h
+./ucd-snmp/pass_persist.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/proc.lo: struct.h ./ucd-snmp/proc.h mibdefs.h util_funcs.h
+./ucd-snmp/proc.lo: util_funcs/header_generic.h
+./ucd-snmp/proc.lo: util_funcs/header_simple_table.h
+./ucd-snmp/proc.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.h ../../agent/kernel.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/proxy.lo: ./ucd-snmp/proxy.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/versioninfo.lo: struct.h ./ucd-snmp/versioninfo.h mibdefs.h
+./ucd-snmp/versioninfo.lo: util_funcs/header_generic.h util_funcs/restart.h
+./ucd-snmp/versioninfo.lo: util_funcs.h util_funcs/header_simple_table.h
+./ucd-snmp/versioninfo.lo: util_funcs/MIB_STATS_CACHE_TIMEOUT.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/oid.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/vmstat_aix4.lo: mibdefs.h util_funcs/header_generic.h
+./ucd-snmp/vmstat_aix4.lo: ./ucd-snmp/vmstat.h ./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/oid.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat_bsdi4.lo: util_funcs/header_generic.h ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_bsdi4.lo: mibdefs.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/oid.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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_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/oid.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat_darwin7.lo: util_funcs/header_generic.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/oid.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/vmstat_dynix.lo: mibdefs.h util_funcs/header_generic.h
+./ucd-snmp/vmstat_dynix.lo: ./ucd-snmp/vmstat.h ./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/oid.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat_freebsd2.lo: util_funcs/header_generic.h
+./ucd-snmp/vmstat_freebsd2.lo: ./ucd-snmp/vmstat.h mibdefs.h
+./ucd-snmp/vmstat_freebsd2.lo: ./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/oid.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/vmstat_hpux.lo: mibdefs.h util_funcs/header_generic.h
+./ucd-snmp/vmstat_hpux.lo: ./ucd-snmp/vmstat.h ./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-features.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/oid.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.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/header_generic.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/oid.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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/snmp_get_statistic.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat_netbsd1.lo: util_funcs/header_generic.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/oid.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/types.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./ucd-snmp/vmstat_solaris2.lo: mibdefs.h util_funcs/header_generic.h
+./ucd-snmp/vmstat_solaris2.lo: ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_solaris2.lo: ./ucd-snmp/vmstat_solaris2.h
+./util_funcs/Exit.lo: ../../include/net-snmp/net-snmp-config.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmp_logging.h
+./util_funcs/Exit.lo: ../../include/net-snmp/types.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/oid.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/types.h
+./util_funcs/Exit.lo: ../../include/net-snmp/definitions.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmp_api.h
+./util_funcs/Exit.lo: ../../include/net-snmp/varbind_api.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmp_client.h
+./util_funcs/Exit.lo: ../../include/net-snmp/pdu_api.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/asn1.h
+./util_funcs/Exit.lo: ../../include/net-snmp/output_api.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmp_debug.h
+./util_funcs/Exit.lo: ../../include/net-snmp/session_api.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/callback.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmp_transport.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmp_service.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/ucd_compat.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/mib.h
+./util_funcs/Exit.lo: ../../include/net-snmp/mib_api.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/parse.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/oid_stash.h
+./util_funcs/Exit.lo: ../../include/net-snmp/net-snmp-features.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmp_impl.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmp.h
+./util_funcs/Exit.lo: ../../include/net-snmp/library/snmp-tc.h
+./util_funcs/Exit.lo: ./util_funcs/Exit.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/net-snmp-config.h
+./util_funcs/get_pid_from_inode.lo: ./util_funcs/get_pid_from_inode.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/output_api.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/types.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/oid.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/types.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/definitions.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmp_api.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/varbind_api.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmp_client.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/pdu_api.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/asn1.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/session_api.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/callback.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmp_transport.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmp_service.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/ucd_compat.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/mib.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/mib_api.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/parse.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/oid_stash.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/net-snmp-features.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmp_impl.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmp.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmp-tc.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmp_debug.h
+./util_funcs/get_pid_from_inode.lo: ../../include/net-snmp/library/snmp_logging.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/net-snmp-config.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/net-snmp-includes.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/definitions.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/types.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/oid.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/types.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_api.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/varbind_api.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_client.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/pdu_api.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/asn1.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/output_api.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_debug.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_logging.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/session_api.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/callback.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_transport.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_service.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/ucd_compat.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/mib.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/mib_api.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/parse.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/oid_stash.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/net-snmp-features.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_impl.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp-tc.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/getopt.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/utilities.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/system.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/tools.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/int64.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/mt_support.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_alarm.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/data_list.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/check_varbind.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/container.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/factory.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/container_binary_array.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/container_list_ssll.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/container_iterator.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/container.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_assert.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/version.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/config_api.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/read_config.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/default_store.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_enum.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/vacm.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/snmpv3_api.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpv3.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/transform_oids.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/keytools.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/scapi.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/lcd_time.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmp_secmod.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmptsm.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/snmpusm.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/mib_module_config.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/agent_module_config.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/snmp_agent.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/snmp_vars.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/agent_handler.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/var_struct.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/agent_registry.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/library/fd_event_manager.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/ds_agent.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/agent_read_config.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/agent_trap.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/all_helpers.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/instance.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/baby_steps.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/scalar.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/scalar_group.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/watcher.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/multiplexer.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/null.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/debug_handler.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/cache_handler.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/old_api.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/read_only.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/row_merge.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/serialize.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/mode_end_call.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/table.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/table_data.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/table_dataset.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/table_tdata.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/table_iterator.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/table_container.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/table_array.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/mfd.h
+./util_funcs/header_generic.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./util_funcs/header_generic.lo: ./util_funcs/header_generic.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/net-snmp-config.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/net-snmp-includes.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/definitions.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/types.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/oid.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/types.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_api.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/varbind_api.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_client.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/pdu_api.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/asn1.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/output_api.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_debug.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_logging.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/session_api.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/callback.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_transport.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_service.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/ucd_compat.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/mib.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/mib_api.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/parse.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/oid_stash.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/net-snmp-features.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_impl.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp-tc.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/getopt.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/utilities.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/system.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/tools.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/int64.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/mt_support.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_alarm.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/data_list.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/check_varbind.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/container.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/factory.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/container_binary_array.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/container_list_ssll.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/container_iterator.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/container.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_assert.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/version.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/config_api.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/read_config.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/default_store.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_enum.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/vacm.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/snmpv3_api.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpv3.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/transform_oids.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/keytools.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/scapi.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/lcd_time.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmp_secmod.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmptsm.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/snmpusm.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/mib_module_config.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/agent_module_config.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/snmp_agent.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/snmp_vars.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/agent_handler.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/var_struct.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/agent_registry.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/library/fd_event_manager.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/ds_agent.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/agent_read_config.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/agent_trap.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/all_helpers.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/instance.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/baby_steps.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/scalar.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/scalar_group.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/watcher.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/multiplexer.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/null.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/debug_handler.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/cache_handler.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/old_api.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/read_only.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/row_merge.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/serialize.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/mode_end_call.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/table.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/table_data.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/table_dataset.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/table_tdata.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/table_iterator.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/table_container.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/table_array.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/mfd.h
+./util_funcs/header_simple_table.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./util_funcs/header_simple_table.lo: ./util_funcs/header_simple_table.h
+./util_funcs/restart.lo: ../../include/net-snmp/net-snmp-config.h
+./util_funcs/restart.lo: ../../include/net-snmp/net-snmp-includes.h
+./util_funcs/restart.lo: ../../include/net-snmp/definitions.h
+./util_funcs/restart.lo: ../../include/net-snmp/types.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/oid.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/types.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_api.h
+./util_funcs/restart.lo: ../../include/net-snmp/varbind_api.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_client.h
+./util_funcs/restart.lo: ../../include/net-snmp/pdu_api.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/asn1.h
+./util_funcs/restart.lo: ../../include/net-snmp/output_api.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_debug.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_logging.h
+./util_funcs/restart.lo: ../../include/net-snmp/session_api.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/callback.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_transport.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_service.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/ucd_compat.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/mib.h
+./util_funcs/restart.lo: ../../include/net-snmp/mib_api.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/parse.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/oid_stash.h
+./util_funcs/restart.lo: ../../include/net-snmp/net-snmp-features.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_impl.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp-tc.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/getopt.h
+./util_funcs/restart.lo: ../../include/net-snmp/utilities.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/system.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/tools.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/int64.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/mt_support.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_alarm.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/data_list.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/check_varbind.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/container.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/factory.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/container_binary_array.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/container_list_ssll.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/container_iterator.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/container.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_assert.h
+./util_funcs/restart.lo: ../../include/net-snmp/version.h
+./util_funcs/restart.lo: ../../include/net-snmp/config_api.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/read_config.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/default_store.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_enum.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/vacm.h
+./util_funcs/restart.lo: ../../include/net-snmp/snmpv3_api.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpv3.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/transform_oids.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/keytools.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/scapi.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/lcd_time.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmp_secmod.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmptsm.h
+./util_funcs/restart.lo: ../../include/net-snmp/library/snmpusm.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/oid.h
+./utilities/execute.lo: ../../include/net-snmp/library/types.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_api.h
+./utilities/execute.lo: ../../include/net-snmp/varbind_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_client.h
+./utilities/execute.lo: ../../include/net-snmp/pdu_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./utilities/execute.lo: ../../include/net-snmp/session_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./utilities/execute.lo: ../../include/net-snmp/mib_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/parse.h
+./utilities/execute.lo: ../../include/net-snmp/library/oid_stash.h
+./utilities/execute.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./utilities/execute.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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: ../../include/net-snmp/agent/snmp_get_statistic.h
+./utilities/execute.lo: ./ucd-snmp/errormib.h mibdefs.h ./utilities/execute.h
+./utilities/execute.lo: struct.h
+./utilities/iquery.lo: ../../include/net-snmp/net-snmp-config.h
+./utilities/iquery.lo: ../../include/net-snmp/net-snmp-features.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/oid.h
+./utilities/iquery.lo: ../../include/net-snmp/library/types.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_api.h
+./utilities/iquery.lo: ../../include/net-snmp/varbind_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_client.h
+./utilities/iquery.lo: ../../include/net-snmp/pdu_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./utilities/iquery.lo: ../../include/net-snmp/session_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./utilities/iquery.lo: ../../include/net-snmp/mib_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/parse.h
+./utilities/iquery.lo: ../../include/net-snmp/library/oid_stash.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/library/getopt.h
+./utilities/iquery.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
+./utilities/iquery.lo: 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/oid.h
+./utilities/override.lo: ../../include/net-snmp/library/types.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_api.h
+./utilities/override.lo: ../../include/net-snmp/varbind_api.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_client.h
+./utilities/override.lo: ../../include/net-snmp/pdu_api.h
+./utilities/override.lo: ../../include/net-snmp/library/asn1.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/library/snmp_logging.h
+./utilities/override.lo: ../../include/net-snmp/session_api.h
+./utilities/override.lo: ../../include/net-snmp/library/callback.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/snmpUDPIPv4BaseDomain.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.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/snmpIPv6BaseDomain.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/library/mib.h
+./utilities/override.lo: ../../include/net-snmp/mib_api.h
+./utilities/override.lo: ../../include/net-snmp/library/parse.h
+./utilities/override.lo: ../../include/net-snmp/library/oid_stash.h
+./utilities/override.lo: ../../include/net-snmp/net-snmp-features.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/library/getopt.h
+./utilities/override.lo: ../../include/net-snmp/utilities.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/data_list.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/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/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/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/snmptsm.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
+./utilities/override.lo: ../../include/net-snmp/agent/snmp_get_statistic.h
diff --git a/agent/mibgroup/Makefile.in b/agent/mibgroup/Makefile.in
new file mode 100644
index 0000000..2341ab4
--- /dev/null
+++ b/agent/mibgroup/Makefile.in
@@ -0,0 +1,41 @@
+top_builddir=../..
+mysubdir=agent/mibgroup
+
+# 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@
+
+FEATUREFILE=../../include/net-snmp/agent/features-mibgroups.h
+
+# 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@
+@mib_module_list_ft@
+
+OBJS = $(mib_module_list_o)
+LOBJS = $(mib_module_list_lo)
+SRCS = $(mib_module_list_c)
+FTOBJS = $(mib_module_list_ft)
+
+all: standardall $(LOBJS)
+
+@module_rules@
diff --git a/agent/mibgroup/README b/agent/mibgroup/README
new file mode 100644
index 0000000..7d83806
--- /dev/null
+++ b/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/agent/mibgroup/README.smux b/agent/mibgroup/README.smux
new file mode 100644
index 0000000..b977f2b
--- /dev/null
+++ b/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/agent/mibgroup/Rmon.h b/agent/mibgroup/Rmon.h
new file mode 100644
index 0000000..3a7d3a4
--- /dev/null
+++ b/agent/mibgroup/Rmon.h
@@ -0,0 +1,56 @@
+/**************************************************************
+ * 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)
+/* older implementation: */
+/* config_require(Rmon/alarm) */
+config_require(Rmon/alarmTable)
+config_require(Rmon/history)
+config_require(Rmon/event)
+config_add_mib(RMON-MIB)
+
diff --git a/agent/mibgroup/Rmon/README b/agent/mibgroup/Rmon/README
new file mode 100644
index 0000000..c5269ec
--- /dev/null
+++ b/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/agent/mibgroup/Rmon/agutil.c b/agent/mibgroup/Rmon/agutil.c
new file mode 100644
index 0000000..12c6342
--- /dev/null
+++ b/agent/mibgroup/Rmon/agutil.c
@@ -0,0 +1,299 @@
+/**************************************************************
+ * 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 "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)
+{
+ return netsnmp_get_agent_runtime();
+}
+
+/*
+ * 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/agent/mibgroup/Rmon/agutil.h b/agent/mibgroup/Rmon/agutil.h
new file mode 100644
index 0000000..4eb3bf7
--- /dev/null
+++ b/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/agent/mibgroup/Rmon/agutil_api.h b/agent/mibgroup/Rmon/agutil_api.h
new file mode 100644
index 0000000..3959fab
--- /dev/null
+++ b/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/agent/mibgroup/Rmon/alarm.c b/agent/mibgroup/Rmon/alarm.c
new file mode 100644
index 0000000..95cb017
--- /dev/null
+++ b/agent/mibgroup/Rmon/alarm.c
@@ -0,0 +1,722 @@
+/**************************************************************
+ * 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
+# 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 "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, NETSNMP_OLDAPI_RONLY,
+ var_alarmEntry, 3, {1, 1, 1}},
+ {IDalarmInterval, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_alarmEntry, 3, {1, 1, 2}},
+ {IDalarmVariable, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_alarmEntry, 3, {1, 1, 3}},
+ {IDalarmSampleType, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_alarmEntry, 3, {1, 1, 4}},
+ {IDalarmValue, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_alarmEntry, 3, {1, 1, 5}},
+ {IDalarmStartupAlarm, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_alarmEntry, 3, {1, 1, 6}},
+ {IDalarmRisingThreshold, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_alarmEntry, 3, {1, 1, 7}},
+ {IDalarmFallingThreshold, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_alarmEntry, 3, {1, 1, 8}},
+ {IDalarmRisingEventIndex, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_alarmEntry, 3, {1, 1, 9}},
+ {IDalarmFallingEventIndex, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_alarmEntry, 3, {1, 1, 10}},
+ {IDalarmOwner, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_alarmEntry, 3, {1, 1, 11}},
+ {IDalarmStatus, ASN_INTEGER, NETSNMP_OLDAPI_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/agent/mibgroup/Rmon/alarm.h b/agent/mibgroup/Rmon/alarm.h
new file mode 100644
index 0000000..05f2152
--- /dev/null
+++ b/agent/mibgroup/Rmon/alarm.h
@@ -0,0 +1,29 @@
+/**************************************************************
+ * 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
+
+ /*
+ * function prototypes
+ */
+ void init_alarm(void);
+
+#endif /* _MIBGROUP_ALARM_H */
diff --git a/agent/mibgroup/Rmon/alarmTable.c b/agent/mibgroup/Rmon/alarmTable.c
new file mode 100644
index 0000000..6181628
--- /dev/null
+++ b/agent/mibgroup/Rmon/alarmTable.c
@@ -0,0 +1,842 @@
+/*--------------------------------------------------------------------------+
+| Edition History: |
+| # Date Comments By |
+| --- -------- -------------------------------------------------------- --- |
+| 1 07/05/18 Created. emi |
++--------------------------------------------------------------------------*/
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.11.2.1 2006/01/11 15:17:47 dts12 Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "utilities/iquery.h"
+#include "alarmTable.h"
+
+netsnmp_feature_require(iquery)
+netsnmp_feature_require(query_set_default_session)
+netsnmp_feature_require(table_tdata)
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(table_tdata_extract_table)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(table_tdata_insert_row)
+netsnmp_feature_require(iquery_pdu_session)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/** Initializes the alarmTable module */
+void
+init_alarmTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_alarmTable();
+}
+
+/** Initialize the alarmTable table by defining its contents and how it's structured */
+void
+initialize_table_alarmTable(void)
+{
+ static oid alarmTable_oid[] = { 1, 3, 6, 1, 2, 1, 16, 3, 1 };
+ size_t alarmTable_oid_len = OID_LENGTH(alarmTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_tdata *table_data;
+ netsnmp_table_registration_info *table_info;
+
+ DEBUGMSGTL(( "rmon:alarmTable", "initialize_table_alarmTable called.\n"));
+ reg =
+ netsnmp_create_handler_registration("alarmTable",
+ alarmTable_handler,
+ alarmTable_oid,
+ alarmTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_data = netsnmp_tdata_create_table("alarmTable", 0);
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: alarmIndex */
+ 0);
+
+ table_info->min_column = COLUMN_ALARMINDEX;
+ table_info->max_column = COLUMN_ALARMSTATUS;
+
+ netsnmp_tdata_register(reg, table_data, table_info);
+
+ /*
+ * Initialise the contents of the table here
+ */
+}
+
+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, const char *alarm_descr);
+
+#define ALARM_STR1_LEN 32
+typedef enum {
+ RMON1_ENTRY_VALID = 1,
+ RMON1_ENTRY_CREATE_REQUEST,
+ RMON1_ENTRY_UNDER_CREATION,
+ RMON1_ENTRY_INVALID
+} RMON1_ENTRY_STATUS_T;
+
+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;
+ /*
+ * Typical data structure for a row entry
+ */
+struct alarmTable_entry {
+ /*
+ * Index values
+ */
+ long alarmIndex;
+
+ /*
+ * Column values
+ */
+ long alarmInterval;
+ long old_alarmInterval;
+ oid alarmVariable[ALARM_STR1_LEN];
+ size_t alarmVariable_len;
+ oid old_alarmVariable[ALARM_STR1_LEN];
+ size_t old_alarmVariable_len;
+ long alarmSampleType;
+ long old_alarmSampleType;
+ long alarmValue;
+ long alarmStartupAlarm;
+ long old_alarmStartupAlarm;
+ long alarmRisingThreshold;
+ long old_alarmRisingThreshold;
+ long alarmFallingThreshold;
+ long old_alarmFallingThreshold;
+ long alarmRisingEventIndex;
+ long old_alarmRisingEventIndex;
+ long alarmFallingEventIndex;
+ long old_alarmFallingEventIndex;
+ char alarmOwner[ALARM_STR1_LEN];
+ size_t alarmOwner_len;
+ char old_alarmOwner[ALARM_STR1_LEN];
+ size_t old_alarmOwner_len;
+ long alarmStatus;
+ long old_alarmStatus;
+
+ int valid;
+ unsigned int alarm_reg;
+ netsnmp_session *session;
+ u_long last_abs_value;
+ ALARM_TYPE_T prev_alarm; /* NOTHING | RISING | FALLING */
+};
+
+
+void
+alarmTable_run( unsigned int reg, void *clientarg)
+{
+ struct alarmTable_entry *entry = (struct alarmTable_entry *)clientarg;
+ netsnmp_variable_list *var;
+ u_long new_value;
+ int rc;
+
+ if (!entry) {
+ snmp_alarm_unregister( reg );
+ return;
+ }
+ /*
+ * Retrieve the requested MIB value(s)...
+ */
+ DEBUGMSGTL(( "rmon:alarmTable", "alarmTable_run called\n"));
+ var = (netsnmp_variable_list *)SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ if (!var) {
+ snmp_log(LOG_ERR,"failed to create alarmTable query varbind");
+ return;
+ }
+ snmp_set_var_objid( var, entry->alarmVariable,
+ entry->alarmVariable_len );
+
+ rc = netsnmp_query_get( var, entry->session );
+ if ( rc != SNMP_ERR_NOERROR ) {
+ DEBUGMSGTL(( "rmon:alarmTable", "alarmVariable query failed (%d)\n", rc));
+ snmp_free_varbind(var);
+ return;
+ }
+
+ switch (var->type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_GAUGE:
+ case ASN_COUNTER64:
+ new_value = *var->val.integer;
+ break;
+ default:
+ DEBUGMSGTL(("rmon:alarmTable", "invalid type (%d)\n", var->type));
+ snmp_free_varbind(var);
+ return ;
+ }
+
+ DEBUGMSGTL(("rmon:alarmTable", "alarmIndex.%ld last value (%ld)\n", entry->alarmIndex, entry->last_abs_value));
+ DEBUGMSGTL(("rmon:alarmTable", "alarmIndex.%ld new_value (%ld)\n", entry->alarmIndex, new_value));
+
+ entry->alarmValue = (SAMPLE_TYPE_ABSOLUTE == entry->alarmSampleType) ?
+ new_value : new_value - entry->last_abs_value;
+ entry->last_abs_value = new_value;
+
+ if (ALARM_RISING != entry->prev_alarm &&
+ entry->alarmValue >= entry->alarmRisingThreshold) {
+ if (SNMP_ERR_NOERROR == event_api_send_alarm(1, entry->alarmIndex,
+ entry->alarmRisingEventIndex,
+ entry->alarmVariable,
+ entry->alarmVariable_len,
+ entry->alarmSampleType,
+ entry->alarmValue,
+ entry->alarmRisingThreshold,
+ "Rising"))
+ entry->prev_alarm = ALARM_RISING;
+ else
+ snmp_log(LOG_ERR,"failed to send rising alarm\n");
+ }
+ else if (ALARM_FALLING != entry->prev_alarm &&
+ entry->alarmValue <= entry->alarmFallingThreshold) {
+ if (SNMP_ERR_NOERROR == event_api_send_alarm(0, entry->alarmIndex,
+ entry->alarmFallingEventIndex,
+ entry->alarmVariable,
+ entry->alarmVariable_len,
+ entry->alarmSampleType,
+ entry->alarmValue,
+ entry->alarmFallingThreshold,
+ "Falling"))
+ entry->prev_alarm = ALARM_FALLING;
+ else
+ snmp_log(LOG_ERR,"failed to send falling alarm\n");
+ }
+ else
+ DEBUGMSGTL(("rmon:alarmTable", "no alarm sent\n"));
+
+ snmp_free_varbind(var);
+}
+
+void
+alarmTable_enable( struct alarmTable_entry *entry )
+{
+ if (!entry)
+ return;
+
+ DEBUGMSGTL(( "rmon:alarmTable", "alarmTable_enable called.\n"));
+ if (entry->alarm_reg) {
+ snmp_alarm_unregister( entry->alarm_reg );
+ entry->alarm_reg = 0;
+ }
+
+ if (entry->alarmInterval) {
+ /*
+ * register once to run ASAP, and another to run
+ * at the trigger frequency
+ */
+ snmp_alarm_register(0, 0, alarmTable_run, entry );
+ entry->alarm_reg = snmp_alarm_register(
+ entry->alarmInterval, SA_REPEAT,
+ alarmTable_run, entry );
+ }
+}
+
+void
+alarmTable_disable( struct alarmTable_entry *entry )
+{
+ if (!entry)
+ return;
+
+ DEBUGMSGTL(( "rmon:alarmTable", "alarmTable_disable called.\n"));
+ if (entry->alarm_reg) {
+ snmp_alarm_unregister( entry->alarm_reg );
+ entry->alarm_reg = 0;
+ /* XXX - perhaps release any previous results */
+ }
+}
+
+/*
+ * create a new row in the table
+ */
+netsnmp_tdata_row *
+alarmTable_createEntry(netsnmp_tdata * table_data, long alarmIndex)
+{
+ struct alarmTable_entry *entry;
+ netsnmp_tdata_row *row;
+
+ DEBUGMSGTL(( "rmon:alarmTable", "alarmTable_createEntry called.\n"));
+ entry = SNMP_MALLOC_TYPEDEF(struct alarmTable_entry);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+ entry->alarmIndex = alarmIndex;
+ entry->alarmInterval = 1;
+ entry->alarmSampleType = SAMPLE_TYPE_ABSOLUTE;
+ entry->alarmStartupAlarm = ALARM_BOTH;
+ entry->alarmRisingThreshold = 10;
+ entry->alarmFallingThreshold = 5;
+ entry->alarmRisingEventIndex = alarmIndex;
+ entry->alarmFallingEventIndex = alarmIndex;
+ entry->prev_alarm = ALARM_NOTHING;
+ netsnmp_tdata_row_add_index(row, ASN_INTEGER,
+ &(entry->alarmIndex),
+ sizeof(entry->alarmIndex));
+ netsnmp_tdata_add_row(table_data, row);
+ return row;
+}
+
+/*
+ * remove a row from the table
+ */
+void
+alarmTable_removeEntry(netsnmp_tdata * table_data, netsnmp_tdata_row * row)
+{
+ struct alarmTable_entry *entry;
+
+ DEBUGMSGTL(( "rmon:alarmTable", "alarmTable_removeEntry called.\n"));
+ if (!row)
+ return; /* Nothing to remove */
+ entry = (struct alarmTable_entry *)
+ netsnmp_tdata_remove_and_delete_row(table_data, row);
+ if (entry) {
+ alarmTable_disable(entry);
+ SNMP_FREE(entry); /* XXX - release any other internal resources */
+ }
+}
+
+
+/** handles requests for the alarmTable table */
+int
+alarmTable_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_tdata *table_data;
+ netsnmp_tdata_row *table_row;
+ struct alarmTable_entry *table_entry;
+ int ret;
+ netsnmp_session *sess = NULL;
+ char *secName;
+
+ DEBUGMSGTL(( "rmon:alarmTable", "alarmTable_handler called.\n"));
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ table_entry = (struct alarmTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_ALARMINDEX:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->alarmIndex);
+ break;
+ case COLUMN_ALARMINTERVAL:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->alarmInterval);
+ break;
+ case COLUMN_ALARMVARIABLE:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) table_entry->
+ alarmVariable,
+ table_entry->alarmVariable_len *
+ sizeof(oid));
+ break;
+ case COLUMN_ALARMSAMPLETYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->alarmSampleType);
+ break;
+ case COLUMN_ALARMVALUE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->alarmValue);
+ break;
+ case COLUMN_ALARMSTARTUPALARM:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->alarmStartupAlarm);
+ break;
+ case COLUMN_ALARMRISINGTHRESHOLD:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->
+ alarmRisingThreshold);
+ break;
+ case COLUMN_ALARMFALLINGTHRESHOLD:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->
+ alarmFallingThreshold);
+ break;
+ case COLUMN_ALARMRISINGEVENTINDEX:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->
+ alarmRisingEventIndex);
+ break;
+ case COLUMN_ALARMFALLINGEVENTINDEX:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->
+ alarmFallingEventIndex);
+ break;
+ case COLUMN_ALARMOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) table_entry->
+ alarmOwner,
+ table_entry->alarmOwner_len);
+ break;
+ case COLUMN_ALARMSTATUS:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->alarmStatus);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ table_entry = (struct alarmTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_ALARMINTERVAL:
+ /*
+ * or possibly 'netsnmp_check_vb_int_range'
+ */
+ 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_ALARMVARIABLE:
+ /*
+ * or possibly 'netsnmp_check_vb_type_and_max_size'
+ */
+ break;
+ case COLUMN_ALARMSAMPLETYPE:
+ /*
+ * or possibly 'netsnmp_check_vb_int_range'
+ */
+ 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_ALARMSTARTUPALARM:
+ /*
+ * or possibly 'netsnmp_check_vb_int_range'
+ */
+ 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_ALARMRISINGTHRESHOLD:
+ /*
+ * or possibly 'netsnmp_check_vb_int_range'
+ */
+ 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_ALARMFALLINGTHRESHOLD:
+ /*
+ * or possibly 'netsnmp_check_vb_int_range'
+ */
+ 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_ALARMRISINGEVENTINDEX:
+ /*
+ * or possibly 'netsnmp_check_vb_int_range'
+ */
+ 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_ALARMFALLINGEVENTINDEX:
+ /*
+ * or possibly 'netsnmp_check_vb_int_range'
+ */
+ 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_ALARMOWNER:
+ /*
+ * or possibly 'netsnmp_check_vb_type_and_max_size'
+ */
+ break;
+ case COLUMN_ALARMSTATUS:
+ /*
+ * or possibly 'netsnmp_check_vb_int_range'
+ */
+ ret = netsnmp_check_vb_int(request->requestvb);
+ 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) {
+ table_row = netsnmp_tdata_extract_row(request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_ALARMINTERVAL:
+ case COLUMN_ALARMVARIABLE:
+ case COLUMN_ALARMSAMPLETYPE:
+ case COLUMN_ALARMSTARTUPALARM:
+ case COLUMN_ALARMRISINGTHRESHOLD:
+ case COLUMN_ALARMFALLINGTHRESHOLD:
+ case COLUMN_ALARMRISINGEVENTINDEX:
+ case COLUMN_ALARMFALLINGEVENTINDEX:
+ case COLUMN_ALARMOWNER:
+ case COLUMN_ALARMSTATUS:
+ if (!table_row) {
+ table_row =
+ alarmTable_createEntry(table_data,
+ *table_info->indexes->val.
+ integer);
+ if (table_row) {
+ netsnmp_insert_tdata_row(request, table_row);
+ } else {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ for (request = requests; request; request = request->next) {
+ table_entry = (struct alarmTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_row = netsnmp_tdata_extract_row(request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_ALARMINTERVAL:
+ case COLUMN_ALARMVARIABLE:
+ case COLUMN_ALARMSAMPLETYPE:
+ case COLUMN_ALARMSTARTUPALARM:
+ case COLUMN_ALARMRISINGTHRESHOLD:
+ case COLUMN_ALARMFALLINGTHRESHOLD:
+ case COLUMN_ALARMRISINGEVENTINDEX:
+ case COLUMN_ALARMFALLINGEVENTINDEX:
+ case COLUMN_ALARMOWNER:
+ case COLUMN_ALARMSTATUS:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ }
+ break;
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ table_entry = (struct alarmTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_ALARMINTERVAL:
+ table_entry->old_alarmInterval =
+ table_entry->alarmInterval;
+ table_entry->alarmInterval =
+ *request->requestvb->val.integer;
+ break;
+ case COLUMN_ALARMVARIABLE:
+ table_entry->alarmVariable_len =
+ request->requestvb->val_len / sizeof(oid);
+ memset(table_entry->alarmVariable, 0,
+ sizeof(table_entry->alarmVariable));
+ memcpy(table_entry->alarmVariable,
+ request->requestvb->val.objid,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_ALARMSAMPLETYPE:
+ table_entry->old_alarmSampleType =
+ table_entry->alarmSampleType;
+ table_entry->alarmSampleType =
+ *request->requestvb->val.integer;
+ break;
+ case COLUMN_ALARMSTARTUPALARM:
+ table_entry->old_alarmStartupAlarm =
+ table_entry->alarmStartupAlarm;
+ table_entry->alarmStartupAlarm =
+ *request->requestvb->val.integer;
+ break;
+ case COLUMN_ALARMRISINGTHRESHOLD:
+ table_entry->old_alarmRisingThreshold =
+ table_entry->alarmRisingThreshold;
+ table_entry->alarmRisingThreshold =
+ *request->requestvb->val.integer;
+ break;
+ case COLUMN_ALARMFALLINGTHRESHOLD:
+ table_entry->old_alarmFallingThreshold =
+ table_entry->alarmFallingThreshold;
+ table_entry->alarmFallingThreshold =
+ *request->requestvb->val.integer;
+ break;
+ case COLUMN_ALARMRISINGEVENTINDEX:
+ table_entry->old_alarmRisingEventIndex =
+ table_entry->alarmRisingEventIndex;
+ table_entry->alarmRisingEventIndex =
+ *request->requestvb->val.integer;
+ break;
+ case COLUMN_ALARMFALLINGEVENTINDEX:
+ table_entry->old_alarmFallingEventIndex =
+ table_entry->alarmFallingEventIndex;
+ table_entry->alarmFallingEventIndex =
+ *request->requestvb->val.integer;
+ break;
+ case COLUMN_ALARMOWNER:
+ memcpy(table_entry->old_alarmOwner,
+ table_entry->alarmOwner,
+ sizeof(table_entry->alarmOwner));
+ table_entry->old_alarmOwner_len =
+ table_entry->alarmOwner_len;
+ memset(table_entry->alarmOwner, 0,
+ sizeof(table_entry->alarmOwner));
+ memcpy(table_entry->alarmOwner,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ table_entry->alarmOwner_len = request->requestvb->val_len;
+ break;
+ case COLUMN_ALARMSTATUS:
+ table_entry->old_alarmStatus = table_entry->alarmStatus;
+ table_entry->alarmStatus =
+ *request->requestvb->val.integer;
+ break;
+ }
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ for (request = requests; request; request = request->next) {
+ table_entry = (struct alarmTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_row = netsnmp_tdata_extract_row(request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_ALARMINTERVAL:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ table_entry->alarmInterval =
+ table_entry->old_alarmInterval;
+ table_entry->old_alarmInterval = 0;
+ }
+ break;
+ case COLUMN_ALARMVARIABLE:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ memcpy(table_entry->alarmVariable,
+ table_entry->old_alarmVariable,
+ sizeof(table_entry->alarmVariable));
+ memset(table_entry->old_alarmVariable, 0,
+ sizeof(table_entry->alarmVariable));
+ table_entry->alarmVariable_len =
+ table_entry->old_alarmVariable_len;
+ }
+ break;
+ case COLUMN_ALARMSAMPLETYPE:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ table_entry->alarmSampleType =
+ table_entry->old_alarmSampleType;
+ table_entry->old_alarmSampleType = 0;
+ }
+ break;
+ case COLUMN_ALARMSTARTUPALARM:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ table_entry->alarmStartupAlarm =
+ table_entry->old_alarmStartupAlarm;
+ table_entry->old_alarmStartupAlarm = 0;
+ }
+ break;
+ case COLUMN_ALARMRISINGTHRESHOLD:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ table_entry->alarmRisingThreshold =
+ table_entry->old_alarmRisingThreshold;
+ table_entry->old_alarmRisingThreshold = 0;
+ }
+ break;
+ case COLUMN_ALARMFALLINGTHRESHOLD:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ table_entry->alarmFallingThreshold =
+ table_entry->old_alarmFallingThreshold;
+ table_entry->old_alarmFallingThreshold = 0;
+ }
+ break;
+ case COLUMN_ALARMRISINGEVENTINDEX:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ table_entry->alarmRisingEventIndex =
+ table_entry->old_alarmRisingEventIndex;
+ table_entry->old_alarmRisingEventIndex = 0;
+ }
+ break;
+ case COLUMN_ALARMFALLINGEVENTINDEX:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ table_entry->alarmFallingEventIndex =
+ table_entry->old_alarmFallingEventIndex;
+ table_entry->old_alarmFallingEventIndex = 0;
+ }
+ break;
+ case COLUMN_ALARMOWNER:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ memcpy(table_entry->alarmOwner,
+ table_entry->old_alarmOwner,
+ sizeof(table_entry->alarmOwner));
+ memset(table_entry->old_alarmOwner, 0,
+ sizeof(table_entry->alarmOwner));
+ table_entry->alarmOwner_len =
+ table_entry->old_alarmOwner_len;
+ }
+ break;
+ case COLUMN_ALARMSTATUS:
+ if (table_entry && !table_entry->valid) {
+ alarmTable_removeEntry(table_data, table_row);
+ } else {
+ table_entry->alarmStatus =
+ table_entry->old_alarmStatus;
+ table_entry->old_alarmStatus = 0;
+ }
+ break;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ for (request = requests; request; request = request->next) {
+ table_entry = (struct alarmTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_ALARMINTERVAL:
+ case COLUMN_ALARMVARIABLE:
+ case COLUMN_ALARMSAMPLETYPE:
+ case COLUMN_ALARMSTARTUPALARM:
+ case COLUMN_ALARMRISINGTHRESHOLD:
+ case COLUMN_ALARMFALLINGTHRESHOLD:
+ case COLUMN_ALARMRISINGEVENTINDEX:
+ case COLUMN_ALARMFALLINGEVENTINDEX:
+ case COLUMN_ALARMOWNER:
+ if (table_entry && !table_entry->valid) {
+ table_entry->valid = 1;
+ }
+ break;
+ case COLUMN_ALARMSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RMON1_ENTRY_VALID:
+ alarmTable_enable( table_entry );
+ break;
+ case RMON1_ENTRY_UNDER_CREATION:
+ alarmTable_disable( table_entry );
+#if 0
+ table_entry->session = (netsnmp_session *)
+ netsnmp_iquery_pdu_session(reqinfo->asp->pdu);
+#else
+ secName = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME);
+ if (secName) {
+ sess = netsnmp_iquery_user_session(secName);
+ netsnmp_query_set_default_session(sess);
+ DEBUGMSGTL(("rmon:alarmTable", "user name %s\n", secName));
+ } else {
+ snmp_log(LOG_ERR, "user name %s not found\n", secName);
+ config_perror("Unknown user name\n");
+ }
+
+ 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");
+ return SNMP_ERR_NOERROR;
+ }
+ }
+#endif
+ break;
+ case RMON1_ENTRY_INVALID:
+ table_row = netsnmp_tdata_extract_row(request);
+ table_data = netsnmp_tdata_extract_table(request);
+ alarmTable_removeEntry(table_data, table_row);
+ }
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/Rmon/alarmTable.h b/agent/mibgroup/Rmon/alarmTable.h
new file mode 100644
index 0000000..1a070b2
--- /dev/null
+++ b/agent/mibgroup/Rmon/alarmTable.h
@@ -0,0 +1,41 @@
+/*--------------------------------------------------------------------------+
+| Edition History: |
+| # Date Comments By |
+| --- -------- -------------------------------------------------------- --- |
+| 1 07/05/18 Created. emi |
++--------------------------------------------------------------------------*/
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.11.2.1 2006/01/11 15:17:47 dts12 Exp $
+ */
+#ifndef ALARMTABLE_H
+#define ALARMTABLE_H
+
+config_require(utilities/iquery)
+config_require(Rmon/agutil)
+config_require(Rmon/rows)
+config_require(Rmon/event)
+
+/*
+ * function declarations
+ */
+void init_alarmTable(void);
+void initialize_table_alarmTable(void);
+Netsnmp_Node_Handler alarmTable_handler;
+
+/*
+ * column number definitions for table alarmTable
+ */
+#define COLUMN_ALARMINDEX 1
+#define COLUMN_ALARMINTERVAL 2
+#define COLUMN_ALARMVARIABLE 3
+#define COLUMN_ALARMSAMPLETYPE 4
+#define COLUMN_ALARMVALUE 5
+#define COLUMN_ALARMSTARTUPALARM 6
+#define COLUMN_ALARMRISINGTHRESHOLD 7
+#define COLUMN_ALARMFALLINGTHRESHOLD 8
+#define COLUMN_ALARMRISINGEVENTINDEX 9
+#define COLUMN_ALARMFALLINGEVENTINDEX 10
+#define COLUMN_ALARMOWNER 11
+#define COLUMN_ALARMSTATUS 12
+#endif /* ALARMTABLE_H */
diff --git a/agent/mibgroup/Rmon/event.c b/agent/mibgroup/Rmon/event.c
new file mode 100644
index 0000000..bb87bfe
--- /dev/null
+++ b/agent/mibgroup/Rmon/event.c
@@ -0,0 +1,819 @@
+/**************************************************************
+ * 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-features.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.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_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 "event.h"
+
+/*
+ * Implementation headers
+ */
+#include "agutil_api.h"
+#include "row_api.h"
+
+netsnmp_feature_require(snprint_objid)
+
+/*
+ * 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_index 1
+#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;
+static unsigned char zero_octet_string[1];
+
+/*
+ * 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;
+
+ 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;
+ switch (leaf_id) {
+ case Leaf_event_index:
+ return SNMP_ERR_NOTWRITABLE;
+ 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_last_time_sent:
+ return SNMP_ERR_NOTWRITABLE;
+ 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 zero_octet_string;
+ }
+ 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 zero_octet_string;
+ }
+ 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 zero_octet_string;
+ }
+ 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;
+
+ *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;
+
+ *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 zero_octet_string;
+ }
+ 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;
+}
+
+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 objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+ 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, 0 };
+ static oid alarmed_var_oid[] =
+ { 1, 3, 6, 1, 2, 1, 16, 3, 1, 1, 3, 0 };
+ static oid sample_type_oid[] =
+ { 1, 3, 6, 1, 2, 1, 16, 3, 1, 1, 4, 0 };
+ static oid value_oid[] = { 1, 3, 6, 1, 2, 1, 16, 3, 1, 1, 5, 0 };
+ static oid threshold_oid[] = { 1, 3, 6, 1, 2, 1, 16, 3, 1, 1, 7, 0 }; /* rising case */
+ netsnmp_variable_list *var_list = NULL;
+
+ /*
+ * set the last 'oid' : risingAlarm or fallingAlarm
+ */
+ if (is_rising) {
+ rmon1_trap_oid[8] = 1;
+ threshold_oid[10] = 7;
+ } else {
+ rmon1_trap_oid[8] = 2;
+ threshold_oid[10] = 8;
+ }
+ alarm_index_oid[11] = alarm_index;
+ alarmed_var_oid[11] = alarm_index;
+ sample_type_oid[11] = alarm_index;
+ value_oid[11] = alarm_index;
+ threshold_oid[11] = alarm_index;
+
+ /*
+ * build the var list
+ */
+ snmp_varlist_add_variable(&var_list, objid_snmptrap,
+ OID_LENGTH(objid_snmptrap),
+ ASN_OBJECT_ID, (u_char *) rmon1_trap_oid,
+ sizeof(rmon1_trap_oid));
+ snmp_varlist_add_variable(&var_list, alarm_index_oid,
+ OID_LENGTH(alarm_index_oid),
+ ASN_INTEGER, (u_char *) &alarm_index,
+ sizeof(u_int));
+ snmp_varlist_add_variable(&var_list, alarmed_var_oid,
+ OID_LENGTH(alarmed_var_oid),
+ ASN_OBJECT_ID, (u_char *) alarmed_var,
+ alarmed_var_length * sizeof(oid));
+ snmp_varlist_add_variable(&var_list, sample_type_oid,
+ OID_LENGTH(sample_type_oid),
+ ASN_INTEGER, (u_char *) &sample_type,
+ sizeof(u_int));
+ snmp_varlist_add_variable(&var_list, value_oid,
+ OID_LENGTH(value_oid),
+ ASN_INTEGER, (u_char *) &value,
+ sizeof(u_int));
+ snmp_varlist_add_variable(&var_list, threshold_oid,
+ OID_LENGTH(threshold_oid),
+ ASN_INTEGER, (u_char *) &the_threshold,
+ sizeof(u_int));
+
+ send_v2trap(var_list);
+ ag_trace("rmon trap has been sent");
+ snmp_free_varbind(var_list);
+}
+
+
+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_NOERROR;
+
+#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, NETSNMP_OLDAPI_RONLY,
+ var_eventTable, 2, {1, 1}},
+ {EVENTDESCRIPTION, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_eventTable, 2, {1, 2}},
+ {EVENTTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_eventTable, 2, {1, 3}},
+ {EVENTCOMMUNITY, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_eventTable, 2, {1, 4}},
+ {EVENTLASTTIMESENT, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_eventTable, 2, {1, 5}},
+ {EVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_eventTable, 2, {1, 6}},
+ {EVENTSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_eventTable, 2, {1, 7}}
+};
+
+struct variable2 logTable_variables[] = {
+ /*
+ * magic number , variable type, ro/rw , callback fn , L, oidsuffix
+ */
+ {LOGEVENTINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_logTable, 2, {1, 1}},
+ {LOGINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_logTable, 2, {1, 2}},
+ {LOGTIME, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_logTable, 2, {1, 3}},
+ {LOGDESCRIPTION, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/Rmon/event.h b/agent/mibgroup/Rmon/event.h
new file mode 100644
index 0000000..b03e162
--- /dev/null
+++ b/agent/mibgroup/Rmon/event.h
@@ -0,0 +1,33 @@
+/**************************************************************
+ * 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
+
+ /*
+ * function prototypes
+ */
+ void init_event(void);
+
+config_require(util_funcs)
+
+config_require(Rmon/agutil)
+config_require(Rmon/rows)
+#endif /* _MIBGROUP_EVENT_H */
diff --git a/agent/mibgroup/Rmon/history.c b/agent/mibgroup/Rmon/history.c
new file mode 100644
index 0000000..c8e9c25
--- /dev/null
+++ b/agent/mibgroup/Rmon/history.c
@@ -0,0 +1,727 @@
+/**************************************************************
+ * 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
+# 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_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.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,
+ (long *) &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,
+ (long *) &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 unsigned char zero_octet_string[1];
+ 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 zero_octet_string;
+ }
+
+ 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;
+
+ *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 */
+
+ 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, NETSNMP_OLDAPI_RONLY,
+ var_historyControlTable, 2, {1, 1}},
+ {CTRL_DATASOURCE, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_historyControlTable, 2, {1, 2}},
+ {CTRL_BUCKETSREQUESTED, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_historyControlTable, 2, {1, 3}},
+ {CTRL_BUCKETSGRANTED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_historyControlTable, 2, {1, 4}},
+ {CTRL_INTERVAL, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_historyControlTable, 2, {1, 5}},
+ {CTRL_OWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_historyControlTable, 2, {1, 6}},
+ {CTRL_STATUS, ASN_INTEGER, NETSNMP_OLDAPI_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, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 1}},
+ {DATA_SAMPLEINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 2}},
+ {DATA_INTERVALSTART, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 3}},
+ {DATA_DROPEVENTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 4}},
+ {DATA_OCTETS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 5}},
+ {DATA_PKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 6}},
+ {DATA_BROADCASTPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 7}},
+ {DATA_MULTICASTPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 8}},
+ {DATA_CRCALIGNERRORS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 9}},
+ {DATA_UNDERSIZEPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 10}},
+ {DATA_OVERSIZEPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 11}},
+ {DATA_FRAGMENTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 12}},
+ {DATA_JABBERS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 13}},
+ {DATA_COLLISIONS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherHistoryTable, 2, {1, 14}},
+ {DATA_UTILIZATION, ASN_INTEGER, NETSNMP_OLDAPI_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/agent/mibgroup/Rmon/history.h b/agent/mibgroup/Rmon/history.h
new file mode 100644
index 0000000..d2c401d
--- /dev/null
+++ b/agent/mibgroup/Rmon/history.h
@@ -0,0 +1,29 @@
+/**************************************************************
+ * 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
+
+ /*
+ * function prototypes
+ */
+ void init_history(void);
+
+#endif /* _MIBGROUP_HISTORY_H */
diff --git a/agent/mibgroup/Rmon/row_api.h b/agent/mibgroup/Rmon/row_api.h
new file mode 100644
index 0000000..9f576be
--- /dev/null
+++ b/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 {
+ const 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,
+ const 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/agent/mibgroup/Rmon/rows.c b/agent/mibgroup/Rmon/rows.c
new file mode 100644
index 0000000..ac26e30
--- /dev/null
+++ b/agent/mibgroup/Rmon/rows.c
@@ -0,0 +1,878 @@
+/**************************************************************
+ * 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 "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,
+ const 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 = NETSNMP_REMOVE_CONST(char*,"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 = NULL;
+ } 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/agent/mibgroup/Rmon/rows.h b/agent/mibgroup/Rmon/rows.h
new file mode 100644
index 0000000..a099e6b
--- /dev/null
+++ b/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/agent/mibgroup/Rmon/statistics.c b/agent/mibgroup/Rmon/statistics.c
new file mode 100644
index 0000000..3ed4acb
--- /dev/null
+++ b/agent/mibgroup/Rmon/statistics.c
@@ -0,0 +1,544 @@
+/**************************************************************
+ * 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
+# 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_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.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 unsigned char zero_octet_string[1];
+ 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 zero_octet_string;
+ }
+ 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, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 1}},
+ {IDetherStatsDataSource, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_etherStatsEntry, 3, {1, 1, 2}},
+ {IDetherStatsDropEvents, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 3}},
+ {IDetherStatsOctets, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 4}},
+ {IDetherStatsPkts, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 5}},
+ {IDetherStatsBroadcastPkts, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 6}},
+ {IDetherStatsMulticastPkts, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 7}},
+ {IDetherStatsCRCAlignErrors, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 8}},
+ {IDetherStatsUndersizePkts, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 9}},
+ {IDetherStatsOversizePkts, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 10}},
+ {IDetherStatsFragments, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 11}},
+ {IDetherStatsJabbers, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 12}},
+ {IDetherStatsCollisions, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 13}},
+ {IDetherStatsPkts64Octets, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 14}},
+ {IDetherStatsPkts65to127Octets, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 15}},
+ {IDetherStatsPkts128to255Octets, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 16}},
+ {IDetherStatsPkts256to511Octets, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 17}},
+ {IDetherStatsPkts512to1023Octets, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 18}},
+ {IDetherStatsPkts1024to1518Octets, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStatsEntry, 3, {1, 1, 19}},
+ {IDetherStatsOwner, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_etherStatsEntry, 3, {1, 1, 20}},
+ {IDetherStatsStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_etherStatsEntry, 3, {1, 1, 21}},
+ {IDetherStatsDroppedFrames, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_etherStats2Entry, 3, {4, 1, 1}},
+ {IDetherStatsCreateTime, ASN_TIMETICKS, NETSNMP_OLDAPI_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/agent/mibgroup/Rmon/statistics.h b/agent/mibgroup/Rmon/statistics.h
new file mode 100644
index 0000000..9b622a7
--- /dev/null
+++ b/agent/mibgroup/Rmon/statistics.h
@@ -0,0 +1,30 @@
+/**************************************************************
+ * 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__
+
+ void init_statistics(void);
+
+#endif /* _statistics_h_included__ */
+
+/*
+ * end of file statistics.h
+ */
diff --git a/agent/mibgroup/Rmon/test_alarm.sh b/agent/mibgroup/Rmon/test_alarm.sh
new file mode 100755
index 0000000..b6046c7
--- /dev/null
+++ b/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/agent/mibgroup/Rmon/test_hist.sh b/agent/mibgroup/Rmon/test_hist.sh
new file mode 100755
index 0000000..52bdd88
--- /dev/null
+++ b/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/agent/mibgroup/agent/extend.c b/agent/mibgroup/agent/extend.c
new file mode 100644
index 0000000..68a11e2
--- /dev/null
+++ b/agent/mibgroup/agent/extend.c
@@ -0,0 +1,1556 @@
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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/header_simple_table.h"
+#include "mibdefs.h"
+#define SHELLCOMMAND 3
+#endif
+
+netsnmp_feature_require(extract_table_row_data)
+netsnmp_feature_require(table_data_delete_table)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(insert_table_row)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+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 {
+ unsigned int idx;
+ netsnmp_extend *exec_entry;
+ netsnmp_extend *efix_entry;
+} netsnmp_old_extend;
+
+unsigned int num_compatability_entries = 0;
+unsigned 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 };
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct variable2 old_extensible_variables[] = {
+ {MIBINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {ERRORNAME}},
+ {SHELLCOMMAND, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {SHELLCOMMAND}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {ERRORMSG}},
+ {ERRORFIX, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_old, 1, {ERRORFIX}},
+ {ERRORFIXCMD, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {ERRORFIXCMD}}
+};
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+struct variable2 old_extensible_variables[] = {
+ {MIBINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {ERRORNAME}},
+ {SHELLCOMMAND, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {SHELLCOMMAND}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {ERRORMSG}},
+ {ERRORFIX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {ERRORFIX}},
+ {ERRORFIXCMD, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_old, 1, {ERRORFIXCMD}}
+};
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+#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 = NULL;
+ int rc;
+
+ 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 );
+ if (!eptr)
+ return NULL;
+ 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;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration(
+ "nsExtendConfigTable", handle_nsExtendConfigTable,
+ oid_buf, len+1, HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration(
+ "nsExtendConfigTable", handle_nsExtendConfigTable,
+ oid_buf, len+1, HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ rc = netsnmp_register_table_data( reg, dinfo, tinfo );
+ if (rc != SNMPERR_SUCCESS) {
+ goto bail;
+ }
+ netsnmp_handler_owns_table_info(reg->handler->next);
+ 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);
+ rc = netsnmp_register_table_data( reg, dinfo, tinfo );
+ if (rc != SNMPERR_SUCCESS)
+ goto bail;
+ netsnmp_handler_owns_table_info(reg->handler->next);
+ 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);
+ rc = netsnmp_register_table( reg, tinfo );
+ if (rc != SNMPERR_SUCCESS)
+ goto bail;
+ netsnmp_handler_owns_table_info(reg->handler->next);
+ 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);
+ rc = netsnmp_register_watched_scalar2( reg, winfo );
+ if (rc != SNMPERR_SUCCESS)
+ goto bail;
+
+ return eptr;
+
+bail:
+ if (eptr->reg[2])
+ netsnmp_unregister_handler(eptr->reg[2]);
+ if (eptr->reg[1])
+ netsnmp_unregister_handler(eptr->reg[1]);
+ if (eptr->reg[0])
+ netsnmp_unregister_handler(eptr->reg[0]);
+ return NULL;
+}
+
+static void
+_unregister_extend(extend_registration_block *eptr)
+{
+ extend_registration_block *prev;
+
+ netsnmp_assert(eptr);
+ for (prev = ereg_head; prev && prev->next != eptr; prev = prev->next)
+ ;
+ if (prev) {
+ netsnmp_assert(eptr == prev->next);
+ prev->next = eptr->next;
+ } else {
+ netsnmp_assert(eptr == ereg_head);
+ ereg_head = eptr->next;
+ }
+
+ netsnmp_table_data_delete_table(eptr->dinfo);
+ free(eptr->root_oid);
+ free(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 = (netsnmp_old_extend *)
+ 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);
+}
+
+void
+shutdown_extend(void)
+{
+#ifndef USING_UCD_SNMP_EXTENSIBLE_MODULE
+ free(compatability_entries);
+ compatability_entries = NULL;
+#endif
+ while (ereg_head)
+ _unregister_extend(ereg_head);
+}
+
+ /*************************
+ *
+ * Cached-data hooks
+ * see 'cache_handler' helper
+ *
+ *************************/
+
+int
+extend_load_cache(netsnmp_cache *cache, void *magic)
+{
+#ifndef USING_UTILITIES_EXECUTE_MODULE
+ NETSNMP_LOGONCE((LOG_WARNING,"support for run_exec_command not available\n"));
+ return -1;
+#else
+ 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 = (char**)calloc( sizeof(char *), extension->numlines );
+ memcpy( extension->lines, line_buf,
+ sizeof(char *) * extension->numlines );
+ } else {
+ extension->lines = &extension->output;
+ }
+ }
+ extension->result = ret;
+ return ret;
+#endif /* !defined(USING_UTILITIES_EXECUTE_MODULE) */
+}
+
+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_name2[STRMAX]; /* For use with UCD execFix directive */
+ 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" )) {
+ strcpy( exec_name2, exec_name );
+ 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_name2,
+ 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 */
+ netsnmp_old_extend *new_compatability_entries;
+ new_compatability_entries = realloc(compatability_entries,
+ max_compatability_entries*2*sizeof(netsnmp_old_extend));
+ if (!new_compatability_entries)
+ config_perror("No further UCD-compatible entries" );
+ else {
+ memset(new_compatability_entries+num_compatability_entries, 0,
+ sizeof(netsnmp_old_extend)*max_compatability_entries);
+ max_compatability_entries *= 2;
+ compatability_entries = new_compatability_entries;
+ }
+ }
+ if (num_compatability_entries != max_compatability_entries)
+ 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.
+ *
+ **********/
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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( (char *) 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * 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;
+ }
+ }
+ }
+ }
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+ unsigned int line_idx;
+ oid oid_buf[MAX_OID_LEN];
+ int oid_len;
+ int i;
+ char *token;
+ size_t 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 / %ld\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, (char *) 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 (line_idx < 1 || line_idx > eptr->numlines)
+ return NULL;
+ }
+ }
+
+ /***
+ * 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 = (char *) 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,
+ (const u_char*)&line_idx, sizeof(line_idx));
+ }
+ }
+ return eptr; /* Finally, signal success */
+}
+
+/*
+ * 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;
+ unsigned 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;
+ if (line_idx < 1 || line_idx > extension->numlines) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ 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;
+ unsigned int idx;
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, num_compatability_entries))
+ return (NULL);
+
+ idx = name[*length-1] -1;
+ if (idx > max_compatability_entries)
+ return NULL;
+ 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;
+ unsigned int idx;
+
+ idx = name[name_len-1] -1;
+ exten = &compatability_entries[ idx ];
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 );
+ }
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ return SNMP_ERR_NOERROR;
+}
+#endif /* USING_UCD_SNMP_EXTENSIBLE_MODULE */
diff --git a/agent/mibgroup/agent/extend.h b/agent/mibgroup/agent/extend.h
new file mode 100644
index 0000000..8b76cd4
--- /dev/null
+++ b/agent/mibgroup/agent/extend.h
@@ -0,0 +1,70 @@
+#ifndef NETSNMP_EXTEND_H
+#define NETSNMP_EXTEND_H
+
+config_require( util_funcs/header_simple_table )
+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);
+void shutdown_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/agent/mibgroup/agent/nsCache.c b/agent/mibgroup/agent/nsCache.c
new file mode 100644
index 0000000..a56b0bd
--- /dev/null
+++ b/agent/mibgroup/agent/nsCache.c
@@ -0,0 +1,428 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(cache_get_head)
+
+
+/*
+ * 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);
+
+
+#define nsCache 1, 3, 6, 1, 4, 1, 8072, 1, 5
+
+/*
+ * 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.
+ */
+
+/*
+ * ... 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
+
+NETSNMP_IMPORT struct snmp_alarm *
+sa_find_specific(unsigned int clientreg);
+
+
+void
+init_nsCache(void)
+{
+ const oid nsCacheTimeout_oid[] = { nsCache, 1 };
+ const oid nsCacheEnabled_oid[] = { nsCache, 2 };
+ const oid nsCacheTable_oid[] = { nsCache, 3 };
+
+ 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_iterator2(
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ 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->timestampM ?
+ (!netsnmp_ready_monotonic(cache_entry->timestampM,
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 ? */
+ }
+ }
+ 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->timestampM);
+ cache_entry->timestampM = NULL;
+ break;
+ }
+ break;
+ }
+ }
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/agent/nsCache.h b/agent/mibgroup/agent/nsCache.h
new file mode 100644
index 0000000..ab63bc9
--- /dev/null
+++ b/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/agent/mibgroup/agent/nsDebug.c b/agent/mibgroup/agent/nsDebug.c
new file mode 100644
index 0000000..89a90b0
--- /dev/null
+++ b/agent/mibgroup/agent/nsDebug.c
@@ -0,0 +1,466 @@
+#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"
+
+#define nsConfigDebug 1, 3, 6, 1, 4, 1, 8072, 1, 7, 1
+
+void
+init_nsDebug(void)
+{
+ /*
+ * 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.
+ */
+ const oid nsDebugEnabled_oid[] = { nsConfigDebug, 1};
+ const oid nsDebugOutputAll_oid[] = { nsConfigDebug, 2};
+ const oid nsDebugDumpPdu_oid[] = { nsConfigDebug, 3};
+
+ /*
+ * ... and for the token table.
+ */
+
+#define DBGTOKEN_PREFIX 2
+#define DBGTOKEN_ENABLED 3
+#define DBGTOKEN_STATUS 4
+ const oid nsDebugTokenTable_oid[] = { nsConfigDebug, 4};
+
+ 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_iterator2(
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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);
+ if (debug_entry)
+ 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((char *) 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/agent/mibgroup/agent/nsDebug.h b/agent/mibgroup/agent/nsDebug.h
new file mode 100644
index 0000000..55614ce
--- /dev/null
+++ b/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/agent/mibgroup/agent/nsLogging.c b/agent/mibgroup/agent/nsLogging.c
new file mode 100644
index 0000000..7f20bdb
--- /dev/null
+++ b/agent/mibgroup/agent/nsLogging.c
@@ -0,0 +1,472 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(logging_external)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(table_iterator_insert_context)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * OID and columns for the logging table.
+ */
+
+#define NSLOGGING_TYPE 3
+#define NSLOGGING_MAXLEVEL 4
+#define NSLOGGING_STATUS 5
+
+void
+init_nsLogging(void)
+{
+ netsnmp_table_registration_info *table_info;
+ netsnmp_iterator_info *iinfo;
+
+ const oid nsLoggingTable_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 7, 2, 1};
+
+ /*
+ * 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_iterator2(
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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((char *) 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;
+ }
+ }
+ 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 || !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:
+ netsnmp_enable_this_loghandler(logh);
+ break;
+ case RS_NOTINSERVICE:
+ case RS_CREATEANDWAIT:
+ netsnmp_disable_this_loghandler(logh);
+ break;
+ case RS_DESTROY:
+ netsnmp_remove_loghandler( logh );
+ break;
+ }
+ break;
+ }
+ }
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/agent/nsLogging.h b/agent/mibgroup/agent/nsLogging.h
new file mode 100644
index 0000000..093fecc
--- /dev/null
+++ b/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/agent/mibgroup/agent/nsModuleTable.c b/agent/mibgroup/agent/nsModuleTable.c
new file mode 100644
index 0000000..84bd8fa
--- /dev/null
+++ b/agent/mibgroup/agent/nsModuleTable.c
@@ -0,0 +1,322 @@
+/*
+ * 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "nsModuleTable.h"
+
+netsnmp_feature_require(table_dataset)
+
+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)
+{
+ const 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_iterator2(my_handler, iinfo);
+}
+
+/** Initializes 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, ctree->context_ptr->context_name,
+ strlen(ctree->context_ptr->context_name));
+
+ vptr = vptr->next_variable;
+ snmp_set_var_value(vptr,
+ 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, & 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, ctree->context_ptr->context_name,
+ strlen(ctree->context_ptr->context_name));
+
+ vptr = vptr->next_variable;
+ snmp_set_var_value(vptr, ctree->tree->name_a,
+ ctree->tree->namelen * sizeof(oid));
+
+ ultmp = ctree->tree->priority;
+ vptr = vptr->next_variable;
+ snmp_set_var_value(vptr, & 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/agent/mibgroup/agent/nsModuleTable.h b/agent/mibgroup/agent/nsModuleTable.h
new file mode 100644
index 0000000..2a0e63c
--- /dev/null
+++ b/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/agent/mibgroup/agent/nsTransactionTable.c b/agent/mibgroup/agent/nsTransactionTable.c
new file mode 100644
index 0000000..75fe7be
--- /dev/null
+++ b/agent/mibgroup/agent/nsTransactionTable.c
@@ -0,0 +1,247 @@
+/*
+ * Note: this file originally auto-generated by mib2c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(table_dataset)
+
+/** Initialize the nsTransactionTable table by defining it's contents
+ and how it's structured */
+void
+initialize_table_nsTransactionTable(void)
+{
+ const oid nsTransactionTable_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 8, 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(
+ "nsTransactionTable", nsTransactionTable_handler,
+ nsTransactionTable_oid, OID_LENGTH(nsTransactionTable_oid),
+ 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_iterator2(my_handler, iinfo);
+}
+
+/** Initializes 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/agent/mibgroup/agent/nsTransactionTable.h b/agent/mibgroup/agent/nsTransactionTable.h
new file mode 100644
index 0000000..db997df
--- /dev/null
+++ b/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/agent/mibgroup/agent/nsVacmAccessTable.c b/agent/mibgroup/agent/nsVacmAccessTable.c
new file mode 100644
index 0000000..79fa97d
--- /dev/null
+++ b/agent/mibgroup/agent/nsVacmAccessTable.c
@@ -0,0 +1,355 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(check_vb_storagetype)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(table_iterator_insert_context)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/** 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
+ */
+ const oid nsVacmAccessTable_oid[] = { 1,3,6,1,4,1,8072,1,9,1 };
+ netsnmp_handler_registration *reg;
+ netsnmp_iterator_info *iinfo;
+ netsnmp_table_registration_info *table_info;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration(
+ "nsVacmAccessTable", nsVacmAccessTable_handler,
+ nsVacmAccessTable_oid, OID_LENGTH(nsVacmAccessTable_oid),
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration(
+ "nsVacmAccessTable", nsVacmAccessTable_handler,
+ nsVacmAccessTable_oid, OID_LENGTH(nsVacmAccessTable_oid),
+ HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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_iterator2(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));
+ memcpy(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 || viewIdx < 0)
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * 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));
+ memcpy(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));
+ memcpy(atype, (char *)idx->val.string, idx->val_len);
+ viewIdx = se_find_value_in_slist(VACM_VIEW_ENUM_NAME, atype);
+ if (viewIdx < 0)
+ continue;
+
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/agent/nsVacmAccessTable.h b/agent/mibgroup/agent/nsVacmAccessTable.h
new file mode 100644
index 0000000..e7a7e20
--- /dev/null
+++ b/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/agent/mibgroup/agent_mibs.h b/agent/mibgroup/agent_mibs.h
new file mode 100644
index 0000000..50dd159
--- /dev/null
+++ b/agent/mibgroup/agent_mibs.h
@@ -0,0 +1,9 @@
+config_require(agent/nsTransactionTable)
+config_require(agent/nsModuleTable)
+#ifndef NETSNMP_NO_DEBUGGING
+config_require(agent/nsDebug)
+#endif
+config_require(agent/nsCache)
+config_require(agent/nsLogging)
+config_require(agent/nsVacmAccessTable)
+config_add_mib(NET-SNMP-AGENT-MIB)
diff --git a/agent/mibgroup/agentx.h b/agent/mibgroup/agentx.h
new file mode 100644
index 0000000..de47fa8
--- /dev/null
+++ b/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/agent/mibgroup/agentx/agentx_config.c b/agent/mibgroup/agentx/agentx_config.c
new file mode 100644
index 0000000..ea453c2
--- /dev/null
+++ b/agent/mibgroup/agentx/agentx_config.c
@@ -0,0 +1,228 @@
+/*
+ * AgentX Configuration
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+
+#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"
+
+netsnmp_feature_require(user_information)
+netsnmp_feature_require(string_time_to_secs)
+
+/* ---------------------------------------------------------------------
+ *
+ * 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;
+
+ 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) {
+ netsnmp_config_error("master '%s' unrecognised", cptr);
+ } 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;
+
+ 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 = netsnmp_str_to_uid(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 = netsnmp_str_to_gid(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 = netsnmp_string_time_to_secs(cptr);
+ DEBUGMSGTL(("agentx/config/timeout", "%s\n", cptr));
+ if (x == -1) {
+ config_perror("Invalid timeout value");
+ return;
+ }
+ 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);
+}
+
+netsnmp_feature_child_of(agentx_unregister_config_handler, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_AGENTX_UNREGISTER_CONFIG_HANDLER
+void
+agentx_unregister_config_handler(const char *token)
+{
+ unregister_config_handler(":agentx", token);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_AGENTX_UNREGISTER_CONFIG_HANDLER */
+
+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);
+ netsnmp_register_default_target("agentx", "tcp",
+ "localhost:" __STRING(AGENTX_PORT));
+ 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/agent/mibgroup/agentx/agentx_config.h b/agent/mibgroup/agentx/agentx_config.h
new file mode 100644
index 0000000..9496a47
--- /dev/null
+++ b/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/agent/mibgroup/agentx/client.c b/agent/mibgroup/agentx/client.c
new file mode 100644
index 0000000..d36fe2d
--- /dev/null
+++ b/agent/mibgroup/agentx/client.c
@@ -0,0 +1,492 @@
+/*
+ * AgentX utility routines
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+# 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_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_index.h>
+
+#include "agentx/protocol.h"
+#include "agentx/client.h"
+#include "agentx/subagent.h"
+
+netsnmp_feature_require(set_agent_uptime)
+
+ /*
+ * 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;
+
+ if (!state || 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
+ */
+ netsnmp_set_agent_uptime(pdu->time);
+ }
+ } 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;
+ u_long timeout;
+
+ 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;
+ timeout = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT);
+ if (timeout < 0)
+ pdu->time = 0;
+ else
+ /* for master TIMEOUT is usec, but Agentx Open specifies sec */
+ pdu->time = timeout/ONE_SEC;
+
+ 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)
+ 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 = (u_char *) 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: %ld!\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 = (u_char *) 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,
+ const 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,
+ const 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/agent/mibgroup/agentx/client.h b/agent/mibgroup/agentx/client.h
new file mode 100644
index 0000000..1701aaa
--- /dev/null
+++ b/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 *, const oid *, size_t,
+ const char *);
+ int agentx_remove_agentcaps(netsnmp_session *, const 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/agent/mibgroup/agentx/master.c b/agent/mibgroup/agentx/master.c
new file mode 100644
index 0000000..c42a42a
--- /dev/null
+++ b/agent/mibgroup/agentx/master.c
@@ -0,0 +1,612 @@
+/*
+ * 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>
+#include <net-snmp/net-snmp-features.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_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"
+
+netsnmp_feature_require(handler_mark_requests_as_delegated)
+netsnmp_feature_require(unix_socket_paths)
+netsnmp_feature_require(free_agent_snmp_session_by_session)
+
+void
+real_init_master(void)
+{
+ netsnmp_session sess, *session = NULL;
+ char *agentx_sockets;
+ char *cp1;
+
+ 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);
+
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+ {
+ int 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;
+ netsnmp_unix_create_path_with_mode(agentx_dir_perm);
+ }
+#endif
+
+ 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';
+ }
+
+ /*
+ * Let 'snmp_open' interpret the descriptor.
+ */
+ 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) {
+ /*
+ * 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) {
+ /*
+ * Apply any settings to the ownership/permissions of the
+ * AgentX socket
+ */
+ int agentx_sock_perm =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCK_PERM);
+ int agentx_sock_user =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCK_USER);
+ int agentx_sock_group =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCK_GROUP);
+
+ char name[sizeof(struct sockaddr_un) + 1];
+ memcpy(name, t->local, t->local_length);
+ name[t->local_length] = '\0';
+
+ 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);
+ }
+ }
+
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+ netsnmp_unix_dont_create_path();
+#endif
+
+ 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 %8p\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 %8p req=0x%x\n",
+ session, (unsigned)reqid));
+
+ 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 %8p\n",
+ session));
+ } else {
+ DEBUGMSGTL(("agentx/master", "send failed on session %8p\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=%ld, (req=0x%x,trans="
+ "0x%x,sess=0x%x)\n",
+ pdu->errstat, (unsigned)pdu->reqid, (unsigned)pdu->transid,
+ (unsigned)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(("agentx/master", " >> "));
+ DEBUGMSGVAR(("agentx/master", var));
+ DEBUGMSG(("agentx/master", "\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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 = (u_char *) 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/master", "sending pdu (req=0x%x,trans=0x%x,sess=0x%x)\n",
+ (unsigned)pdu->reqid, (unsigned)pdu->transid, (unsigned)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/agent/mibgroup/agentx/master.h b/agent/mibgroup/agentx/master.h
new file mode 100644
index 0000000..a5dbfad
--- /dev/null
+++ b/agent/mibgroup/agentx/master.h
@@ -0,0 +1,15 @@
+#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)
+
+ void init_master(void);
+ void real_init_master(void);
+ Netsnmp_Node_Handler agentx_master_handler;
+
+#endif /* _AGENTX_MASTER_H */
diff --git a/agent/mibgroup/agentx/master_admin.c b/agent/mibgroup/agentx/master_admin.c
new file mode 100644
index 0000000..64aa491
--- /dev/null
+++ b/agent/mibgroup/agentx/master_admin.c
@@ -0,0 +1,595 @@
+/*
+ * AgentX Administrative request handling
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+# 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_NETINET_IN_H
+#include <netinet/in.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 <net-snmp/agent/agent_sysORTable.h>
+#include "master.h"
+
+netsnmp_feature_require(unregister_mib_table_row)
+netsnmp_feature_require(trap_vars_with_context)
+netsnmp_feature_require(calculate_sectime_diff)
+netsnmp_feature_require(allocate_globalcacheid)
+netsnmp_feature_require(remove_index)
+
+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;
+
+ DEBUGMSGTL(("agentx/master", "open %8p\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);
+ sp->engineTime = (uint32_t)((netsnmp_get_agent_runtime() + 50) / 100) & 0x7fffffffL;
+
+ 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 %8p = %ld with flags = %02lx\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 %8p, %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);
+ unregister_sysORTable_by_session(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);
+ unregister_sysORTable_by_session(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 %8p, %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((char *)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;
+ char* description;
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL)
+ return AGENTX_ERR_NOT_OPEN;
+
+ description = netsnmp_strdup_and_null(pdu->variables->val.string,
+ pdu->variables->val_len);
+ register_sysORTable_sess(pdu->variables->name, pdu->variables->name_length,
+ description, sp);
+ free(description);
+ return AGENTX_ERR_NOERROR;
+}
+
+int
+remove_agent_caps_list(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+ int rc;
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL)
+ return AGENTX_ERR_NOT_OPEN;
+
+ rc = unregister_sysORTable_sess(pdu->variables->name,
+ pdu->variables->name_length, sp);
+
+ 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;
+ extern const oid sysuptime_oid[], snmptrap_oid[];
+ extern const 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) {
+ 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.
+ */
+
+ /* If a context name was specified, send the trap using that context.
+ * Otherwise, send the trap without the context using the old method */
+ if (pdu->contextName != NULL)
+ {
+ send_trap_vars_with_context(-1, -1, pdu->variables,
+ pdu->contextName);
+ }
+ else
+ {
+ 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;
+
+ if (operation == NETSNMP_CALLBACK_OP_DISCONNECT) {
+ DEBUGMSGTL(("agentx/master",
+ "transport disconnect on session %8p\n", session));
+ /*
+ * Shut this session down gracefully.
+ */
+ close_agentx_session(session, -1);
+ return 1;
+ } else if (operation == NETSNMP_CALLBACK_OP_CONNECT) {
+ DEBUGMSGTL(("agentx/master",
+ "transport connect on session %8p\n", session));
+ 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%lx,trans=0x%lx,sess=0x%lx)\n",
+ (unsigned long)pdu->reqid, (unsigned long)pdu->transid,
+ (unsigned long)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;
+ }
+
+ asp->pdu->time = netsnmp_get_agent_uptime();
+ asp->pdu->command = AGENTX_MSG_RESPONSE;
+ asp->pdu->errstat = asp->status;
+ DEBUGMSGTL(("agentx/master", "send response, stat %d (req=0x%lx,trans="
+ "0x%lx,sess=0x%lx)\n",
+ asp->status, (unsigned long)pdu->reqid,
+ (unsigned long)pdu->transid, (unsigned long)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/agent/mibgroup/agentx/master_admin.h b/agent/mibgroup/agentx/master_admin.h
new file mode 100644
index 0000000..8f1a6cc
--- /dev/null
+++ b/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/agent/mibgroup/agentx/protocol.c b/agent/mibgroup/agentx/protocol.c
new file mode 100644
index 0000000..0845cf1
--- /dev/null
+++ b/agent/mibgroup/agentx/protocol.c
@@ -0,0 +1,2058 @@
+/* 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
+# 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_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.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%u (0x%.2X)\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%u (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", (int)name_len,
+ (unsigned int)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();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ DEBUGDUMPHEADER("send", "value");
+ switch (vp->type) {
+
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ 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%f\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;
+ }
+ DEBUGINDENTLESS();
+ } 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;
+ }
+ DEBUGINDENTLESS();
+ }
+ 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;
+ 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);
+ }
+
+ /* We've received a PDU that has specified a context. NetSNMP however, uses
+ * the pdu->community field to specify context when using the AgentX
+ * protocol. Therefore we need to copy the context name and length into the
+ * pdu->community and pdu->community_len fields, respectively. */
+ if (pdu->contextName != NULL && pdu->community == NULL)
+ {
+ pdu->community = (u_char *) strdup(pdu->contextName);
+ pdu->community_len = pdu->contextNameLen;
+ 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;
+ 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%lu\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%ld\n", pdu->errstat));
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", " errindex:\t%ld\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%u (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%hu (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;
+ u_int tmp_oid_len;
+ 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\n"));
+ 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", (int)sizeof(oid)));
+ if (n_subid == 0 && prefix == 0) {
+ /*
+ * Null OID
+ */
+ memset(int_ptr, 0, 2 * sizeof(oid));
+ *oid_len = 2;
+ DEBUGPRINTINDENT("dumpv_recv");
+ DEBUGMSG(("dumpv_recv", "OID: NULL (0.0)\n"));
+ DEBUGINDENTLESS();
+ return buf_ptr;
+ }
+
+ /*
+ * Check that the expanded OID will fit in the buffer provided
+ */
+ tmp_oid_len = (prefix ? n_subid + 5 : n_subid);
+ if (*oid_len < tmp_oid_len) {
+ DEBUGMSGTL(("agentx", "Oversized Object ID (buf=%" NETSNMP_PRIz "d"
+ " pdu=%d)\n", *oid_len, tmp_oid_len));
+ DEBUGINDENTLESS();
+ return NULL;
+ }
+
+#ifdef WORDS_BIGENDIAN
+# define endianoff 1
+#else
+# define endianoff 0
+#endif
+ if (*length < 4 * n_subid) {
+ DEBUGMSGTL(("agentx", "Incomplete Object ID\n"));
+ DEBUGINDENTLESS();
+ 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 = tmp_oid_len;
+
+ 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)\n",
+ (int)*length));
+ return NULL;
+ }
+
+ len = agentx_parse_int(data, network_byte_order);
+ if (*length < len + 4) {
+ DEBUGMSGTL(("agentx", "Incomplete string (still too short: %d)\n",
+ (int)*length));
+ return NULL;
+ }
+ if (len > *str_len) {
+ DEBUGMSGTL(("agentx", "String too long (too long)\n"));
+ 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)
+{
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ union {
+ float floatVal;
+ double doubleVal;
+ int intVal[2];
+ char c[sizeof(double)];
+ } fu;
+ int tmp;
+ u_char *buf;
+#endif
+ u_char *const cp =
+ agentx_parse_string(data, length,
+ opaque_buf, opaque_len, network_byte_order);
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ if (cp == NULL)
+ return NULL;
+
+ buf = opaque_buf;
+
+ if ((*opaque_len <= 3) || (buf[0] != ASN_OPAQUE_TAG1))
+ 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: %f\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;
+ 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:
+ case ASN_UINTEGER:
+ 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:
+ DEBUGMSG(("recv", "Can not parse type %x", *type));
+ 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;
+
+ DEBUGINDENTLESS();
+ *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];
+ 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)
+ 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);
+
+ /* The NetSNMP API stuffs the context into the PDU's community string
+ * field, when using the AgentX Protocol. The rest of the code however,
+ * expects to find the context in the PDU's context field. Therefore we
+ * need to copy the context into the PDU's context fields. */
+ if (pdu->community_len > 0 && pdu->contextName == NULL)
+ {
+ pdu->contextName = strdup((char *) pdu->community);
+ pdu->contextNameLen = pdu->community_len;
+ }
+
+ buf_len = sizeof(buffer);
+ }
+
+ DEBUGDUMPHEADER("recv", "PDU");
+ 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();
+
+ 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);
+ }
+ oid_buf_len = MAX_OID_LEN;
+ end_oid_buf_len = MAX_OID_LEN;
+ }
+
+ DEBUGINDENTLESS();
+ 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();
+ DEBUGMSGTL(("agentx", "Unrecognised PDU type: %d\n",
+ pdu->command));
+ return SNMPERR_UNKNOWN_PDU;
+ }
+ 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\n"));
+ 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/agent/mibgroup/agentx/protocol.h b/agent/mibgroup/agentx/protocol.h
new file mode 100644
index 0000000..e1eebc1
--- /dev/null
+++ b/agent/mibgroup/agentx/protocol.h
@@ -0,0 +1,112 @@
+#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_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/agent/mibgroup/agentx/subagent.c b/agent/mibgroup/agentx/subagent.c
new file mode 100644
index 0000000..b3da321
--- /dev/null
+++ b/agent/mibgroup/agentx/subagent.c
@@ -0,0 +1,1094 @@
+/*
+ * AgentX sub-agent
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <sys/types.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.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_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>
+#include <net-snmp/agent/sysORTable.h>
+#include <net-snmp/agent/agent_sysORTable.h>
+
+#include "subagent.h"
+
+netsnmp_feature_child_of(agentx_subagent, agentx_all)
+netsnmp_feature_child_of(agentx_enable_subagent, agentx_subagent)
+
+netsnmp_feature_require(remove_trap_session)
+
+#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);
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+int handle_subagent_set_response(int op,
+ netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu,
+ void *magic);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+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;
+}
+
+static void
+subagent_init_callback_session(void)
+{
+ 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 %p\n",
+ agentx_callback_sess));
+ }
+}
+
+static int subagent_init_init = 0;
+/**
+ * init subagent callback (local) session and connect to master agent
+ *
+ * @returns 0 for success, !0 otherwise
+ */
+int
+subagent_init(void)
+{
+ int rc = 0;
+
+ DEBUGMSGTL(("agentx/subagent", "initializing....\n"));
+
+ if (++subagent_init_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
+ */
+ subagent_init_callback_session();
+ 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_AGENTX_ENABLE_SUBAGENT
+void
+netsnmp_enable_subagent(void) {
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE,
+ SUB_AGENT);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_AGENTX_ENABLE_SUBAGENT */
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct agent_netsnmp_set_info *
+save_set_vars(netsnmp_session * ss, netsnmp_pdu *pdu)
+{
+ struct agent_netsnmp_set_info *ptr;
+
+ 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;
+ ptr->uptime = netsnmp_get_agent_uptime();
+
+ 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;
+ }
+}
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+static void
+send_agentx_error(netsnmp_session *session, netsnmp_pdu *pdu, int errstat, int errindex)
+{
+ pdu = snmp_clone_pdu(pdu);
+ pdu->command = AGENTX_MSG_RESPONSE;
+ pdu->version = session->version;
+ pdu->errstat = errstat;
+ pdu->errindex = errindex;
+ snmp_free_varbind(pdu->variables);
+ pdu->variables = NULL;
+
+ DEBUGMSGTL(("agentx/subagent", "Sending AgentX response error stat %d idx %d\n",
+ errstat, errindex));
+ if (!snmp_send(session, pdu)) {
+ snmp_free_pdu(pdu);
+ }
+}
+
+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);
+ snmp_log(LOG_INFO, "AgentX master disconnected us, reconnecting in %d\n", period);
+ } else {
+ snmp_log(LOG_INFO, "AgentX master disconnected us, not reconnecting\n");
+ }
+ 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", (unsigned)pdu->reqid,
+ (unsigned)pdu->transid, (unsigned)pdu->sessid));
+ pdu->version = AGENTX_VERSION_1;
+ pdu->flags |= UCD_MSG_FLAG_ALWAYS_IN_VIEW;
+
+ /* Master agent is alive, no need to ping */
+ if (session->securityModel != SNMP_DEFAULT_SECMODEL) {
+ snmp_alarm_reset(session->securityModel);
+ }
+
+ 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"));
+ /* would like to send_agentx_error(), but it needs memory too */
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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");
+ send_agentx_error(session, pdu, AGENTX_ERR_PARSE_FAILED, 0);
+ 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");
+ send_agentx_error(session, pdu, AGENTX_ERR_PROCESSING_ERROR, 0);
+ 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);
+ send_agentx_error(session, pdu, AGENTX_ERR_PROCESSING_ERROR, 0);
+ 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");
+ send_agentx_error(session, pdu, AGENTX_ERR_PROCESSING_ERROR, 0);
+ 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");
+ send_agentx_error(session, pdu, AGENTX_ERR_PROCESSING_ERROR, 0);
+ return 1;
+ }
+ asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_UNDO;
+ mycallback = handle_subagent_set_response;
+ retmagic = asi;
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 = (char *) 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;
+}
+
+static int
+_invalid_op_and_magic(int op, ns_subagent_magic *smagic)
+{
+ int invalid = 0;
+
+ if (smagic && (snmp_sess_pointer(smagic->session) == NULL ||
+ op == NETSNMP_CALLBACK_OP_TIMED_OUT)) {
+ if (smagic->ovars != NULL) {
+ snmp_free_varbind(smagic->ovars);
+ }
+ free(smagic);
+ invalid = 1;
+ }
+
+ if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE || smagic == NULL)
+ invalid = 1;
+
+ return invalid;
+}
+
+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 (_invalid_op_and_magic(op, magic)) {
+ return 1;
+ }
+
+ pdu = snmp_clone_pdu(pdu);
+ DEBUGMSGTL(("agentx/subagent",
+ "handling AgentX response (cmd 0x%02x orig_cmd 0x%02x)"
+ " (req=0x%x,trans=0x%x,sess=0x%x)\n",
+ pdu->command, smagic->original_command,
+ (unsigned)pdu->reqid, (unsigned)pdu->transid,
+ (unsigned)pdu->sessid));
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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);
+ }
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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/sizeof(oid)) != 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, NULL, 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;
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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",
+ (unsigned)pdu->command, (unsigned)pdu->reqid,
+ (unsigned)pdu->transid, (unsigned)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;
+}
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+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);
+}
+
+
+static int
+agentx_sysOR_callback(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ const struct register_sysOR_parameters *reg_parms =
+ (const 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);
+}
+
+
+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);
+ if (main_session != NULL) {
+ remove_trap_session(main_session);
+ main_session = NULL;
+ }
+ DEBUGMSGTL(("agentx/subagent", "shut down finished.\n"));
+
+ subagent_init_init = 0;
+ return 1;
+}
+
+
+
+/*
+ * Register all the "standard" AgentX callbacks for the given session.
+ */
+
+void
+agentx_register_callbacks(netsnmp_session * s)
+{
+ netsnmp_session *sess_p;
+
+ DEBUGMSGTL(("agentx/subagent",
+ "registering callbacks for session %p\n", s));
+ memdup((u_char **)&sess_p, &s, sizeof(s));
+ netsnmp_assert(sess_p);
+ s->myvoid = sess_p;
+ if (!sess_p)
+ return;
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_SHUTDOWN,
+ subagent_shutdown, sess_p);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_OID,
+ agentx_registration_callback, sess_p);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREGISTER_OID,
+ agentx_registration_callback, sess_p);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REG_SYSOR,
+ agentx_sysOR_callback, sess_p);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREG_SYSOR,
+ agentx_sysOR_callback, sess_p);
+}
+
+/*
+ * 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->myvoid, 1);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_OID,
+ agentx_registration_callback, ss->myvoid, 1);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREGISTER_OID,
+ agentx_registration_callback, ss->myvoid, 1);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REG_SYSOR,
+ agentx_sysOR_callback, ss->myvoid, 1);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREG_SYSOR,
+ agentx_sysOR_callback, ss->myvoid, 1);
+ SNMP_FREE(ss->myvoid);
+}
+
+/*
+ * Open a session to the master agent.
+ */
+int
+subagent_open_master_session(void)
+{
+ netsnmp_transport *t;
+ netsnmp_session sess;
+ const char *agentx_socket;
+
+ 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;
+
+ agentx_socket = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET);
+ t = netsnmp_transport_open_client("agentx", agentx_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];
+ snprintf(buf, sizeof(buf), "Warning: "
+ "Failed to connect to the agentx master agent (%s)",
+ agentx_socket ? agentx_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)",
+ agentx_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;
+}
+
+static void
+agentx_reopen_sysORTable(const struct sysORTable* data, void* v)
+{
+ netsnmp_session *agentx_ss = (netsnmp_session *) v;
+
+ agentx_add_agentcaps(agentx_ss, data->OR_oid, data->OR_oidlen,
+ data->OR_descr);
+}
+
+/*
+ * 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();
+
+ /*
+ * Reregister all our sysOREntries
+ */
+ netsnmp_sysORTable_foreach(&agentx_reopen_sysORTable, main_session);
+
+ /*
+ * Register a ping alarm (if need be).
+ */
+ subagent_register_ping_alarm(0, 0, NULL, main_session);
+ } else {
+ if (clientreg == 0) {
+ /*
+ * Register a reattach alarm for later
+ */
+ subagent_register_ping_alarm(0, 0, NULL, 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);
+ /*
+ * We need to remove the callbacks attached to the callback
+ * session because they have a magic callback data structure
+ * which includes a pointer to the main session
+ * (which is no longer valid).
+ *
+ * Given that the main session is not responsive anyway.
+ * it shoudn't matter if we lose some outstanding requests.
+ */
+ if (agentx_callback_sess != NULL ) {
+ snmp_close(agentx_callback_sess);
+ agentx_callback_sess = NULL;
+
+ subagent_init_callback_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/agent/mibgroup/agentx/subagent.h b/agent/mibgroup/agentx/subagent.h
new file mode 100644
index 0000000..b55bec1
--- /dev/null
+++ b/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/agent/mibgroup/default_modules.h b/agent/mibgroup/default_modules.h
new file mode 100644
index 0000000..fc5f26a
--- /dev/null
+++ b/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)
+
+/* very few default mibs */
+config_add_mib(SNMPv2-MIB)
+config_add_mib(IF-MIB)
+config_add_mib(IP-MIB)
+config_add_mib(TCP-MIB)
+config_add_mib(UDP-MIB)
+
+#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)
+
+#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)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+config_require(disman/schedule)
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+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(HOST-RESOURCES-MIB)
+config_add_mib(NOTIFICATION-LOG-MIB)
+config_add_mib(DISMAN-EVENT-MIB)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+config_add_mib(DISMAN-SCHEDULE-MIB)
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/* 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/agent/mibgroup/deliver/deliverByNotify.c b/agent/mibgroup/deliver/deliverByNotify.c
new file mode 100644
index 0000000..c89879a
--- /dev/null
+++ b/agent/mibgroup/deliver/deliverByNotify.c
@@ -0,0 +1,475 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <limits.h>
+
+netsnmp_feature_require(container_fifo)
+
+#include "deliverByNotify.h"
+
+/* we should never split beyond this */
+#define MAX_MESSAGE_COUNT 128
+#define BASE_PACKET_SIZE 100 /* should be enough to store SNMPv3 msg headers */
+
+/* if v is !NULL, then estimate it's likely size */
+#define ESTIMATE_VAR_SIZE(v) (v?(v->name_length + v->val_len + 8):0)
+
+void parse_deliver_config(const char *, char *);
+void parse_deliver_maxsize_config(const char *, char *);
+void parse_data_notification_oid_config(const char *, char *);
+void parse_periodic_time_oid_config(const char *, char *);
+void parse_message_number_oid_config(const char *, char *);
+void parse_max_message_number_oid_config(const char *, char *);
+void free_deliver_config(void);
+
+static void _schedule_next_execute_time(void);
+
+oid data_notification_oid[MAX_OID_LEN]
+ = { 1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 4, 0, 1 };
+size_t data_notification_oid_len = 13;
+
+oid netsnmp_periodic_time_oid[MAX_OID_LEN]
+ = { 1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3, 1, 0 };
+size_t netsnmp_periodic_time_oid_len = 13;
+
+oid netsnmp_message_number_oid[MAX_OID_LEN]
+ = { 1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3, 2, 0 };
+size_t netsnmp_message_number_oid_len = 13;
+
+oid netsnmp_max_message_number_oid[MAX_OID_LEN]
+ = { 1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3, 3, 0 };
+size_t netsnmp_max_message_number_oid_len = 13;
+
+oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+
+#define DEFAULT_MAX_DELIVER_SIZE -1;
+static int default_max_size;
+unsigned int alarm_reg;
+static netsnmp_container *deliver_container;
+
+static int
+_deliver_compare(deliver_by_notify *lhs, deliver_by_notify *rhs) {
+ /* sort by the next_run time */
+ if (lhs->next_run < rhs->next_run)
+ return -1;
+ else
+ return 1;
+}
+
+/** Initializes the mteTrigger module */
+void
+init_deliverByNotify(void)
+{
+ /* register the config tokens */
+ snmpd_register_config_handler("deliverByNotify",
+ &parse_deliver_config, &free_deliver_config,
+ "[-p] [-m] [-s maxsize] FREQUENCY OID");
+
+ snmpd_register_config_handler("deliverByNotifyMaxPacketSize",
+ &parse_deliver_maxsize_config, NULL,
+ "sizeInBytes");
+
+ snmpd_register_config_handler("deliverByNotifyOid",
+ &parse_data_notification_oid_config,
+ NULL, /* XXX: reset to default */
+ "OID");
+
+ snmpd_register_config_handler("deliverByNotifyFrequencyOid",
+ &parse_periodic_time_oid_config,
+ NULL, /* XXX: reset to default */
+ "OID");
+
+ snmpd_register_config_handler("deliverByNotifyMessageNumberOid",
+ &parse_message_number_oid_config,
+ NULL, /* XXX: reset to default */
+ "OID");
+
+ snmpd_register_config_handler("deliverByNotifyMaxMessageNumberOid",
+ &parse_max_message_number_oid_config,
+ NULL, /* XXX: reset to default */
+ "OID");
+
+ /* create the container to store the config objects*/
+ deliver_container = netsnmp_container_find("deliverByNotify:fifo");
+ if (NULL == deliver_container) {
+ snmp_log(LOG_ERR,
+ "deliverByNotify: failed to initialize our data container\n");
+ return;
+ }
+ deliver_container->container_name = strdup("deliverByNotify");
+ deliver_container->compare = (netsnmp_container_compare *) _deliver_compare;
+
+ /* set the defaults */
+ default_max_size = DEFAULT_MAX_DELIVER_SIZE;
+
+ alarm_reg = 0;
+}
+
+void
+_parse_config_oid(const char *token, char *line,
+ oid *oid_store, size_t *oid_store_len) {
+ size_t tmp_len = MAX_OID_LEN;
+ /* parse the OID given */
+
+ if (!snmp_parse_oid(line, oid_store, &tmp_len)) {
+ char buf[SPRINT_MAX_LEN];
+ snprintf(buf, SPRINT_MAX_LEN-1, "unknown %s OID: %s", token, line);
+ config_perror(buf);
+ return;
+ }
+
+ *oid_store_len = tmp_len;
+}
+
+void
+parse_data_notification_oid_config(const char *token, char *line) {
+ _parse_config_oid(token, line,
+ data_notification_oid, &data_notification_oid_len);
+}
+
+void
+parse_periodic_time_oid_config(const char *token, char *line) {
+ _parse_config_oid(token, line,
+ netsnmp_periodic_time_oid, &netsnmp_periodic_time_oid_len);
+}
+
+void
+parse_message_number_oid_config(const char *token, char *line) {
+ _parse_config_oid(token, line,
+ netsnmp_message_number_oid,
+ &netsnmp_message_number_oid_len);
+}
+
+void
+parse_max_message_number_oid_config(const char *token, char *line) {
+ _parse_config_oid(token, line,
+ netsnmp_max_message_number_oid,
+ &netsnmp_max_message_number_oid_len);
+}
+
+void
+parse_deliver_config(const char *token, char *line) {
+ const char *cp = line;
+ char buf[SPRINT_MAX_LEN];
+ size_t buf_len = SPRINT_MAX_LEN;
+ int max_size = DEFAULT_MAX_DELIVER_SIZE;
+ int frequency;
+ oid target_oid[MAX_OID_LEN];
+ size_t target_oid_len = MAX_OID_LEN;
+ deliver_by_notify *new_notify = NULL;
+ int flags = 0;
+
+ while(cp && *cp == '-') {
+ switch (*(cp+1)) {
+ case 's':
+ cp = skip_token_const(cp);
+ if (!cp) {
+ config_perror("no argument given to -s");
+ return;
+ }
+ max_size = atoi(cp);
+ break;
+
+ case 'p':
+ flags = flags | NETSNMP_DELIVER_NO_PERIOD_OID;
+ break;
+
+ case 'm':
+ flags = flags | NETSNMP_DELIVER_NO_MSG_COUNTS;
+ break;
+
+ default:
+ config_perror("unknown flag");
+ return;
+ }
+ cp = skip_token_const(cp);
+ }
+
+ if (!cp) {
+ config_perror("no frequency given");
+ return;
+ }
+ copy_nword(cp, buf, buf_len);
+ frequency = netsnmp_string_time_to_secs(buf);
+ cp = skip_token_const(cp);
+
+ if (frequency <= 0) {
+ config_perror("illegal frequency given");
+ return;
+ }
+
+ if (!cp) {
+ config_perror("no OID given");
+ return;
+ }
+
+ /* parse the OID given */
+ if (!snmp_parse_oid(cp, target_oid, &target_oid_len)) {
+ config_perror("unknown deliverByNotify OID");
+ DEBUGMSGTL(("deliverByNotify", "The OID with the problem: %s\n", cp));
+ return;
+ }
+
+ /* set up the object to store all the data */
+ new_notify = SNMP_MALLOC_TYPEDEF(deliver_by_notify);
+ new_notify->frequency = frequency;
+ new_notify->max_packet_size = max_size;
+ new_notify->last_run = time(NULL);
+ new_notify->next_run = new_notify->last_run + frequency;
+ new_notify->flags = flags;
+
+ new_notify->target = malloc(target_oid_len * sizeof(oid));
+ new_notify->target_len = target_oid_len;
+ memcpy(new_notify->target, target_oid, target_oid_len*sizeof(oid));
+
+ /* XXX: need to do the whole container */
+ snmp_alarm_register(calculate_time_until_next_run(new_notify, NULL), 0,
+ &deliver_execute, NULL);
+
+ /* add it to the container */
+ CONTAINER_INSERT(deliver_container, new_notify);
+ _schedule_next_execute_time();
+}
+
+void
+parse_deliver_maxsize_config(const char *token, char *line) {
+ default_max_size = atoi(line);
+}
+
+static void
+_free_deliver_obj(deliver_by_notify *obj, void *context) {
+ netsnmp_assert_or_return(obj != NULL, );
+ SNMP_FREE(obj->target);
+ SNMP_FREE(obj);
+}
+
+void
+free_deliver_config(void) {
+ default_max_size = DEFAULT_MAX_DELIVER_SIZE;
+ CONTAINER_CLEAR(deliver_container,
+ (netsnmp_container_obj_func *) _free_deliver_obj, NULL);
+ if (alarm_reg) {
+ snmp_alarm_unregister(alarm_reg);
+ alarm_reg = 0;
+ }
+}
+
+void
+deliver_execute(unsigned int clientreg, void *clientarg) {
+ netsnmp_variable_list *vars, *walker, *deliver_notification, *vartmp;
+ netsnmp_variable_list *ready_for_delivery[MAX_MESSAGE_COUNT];
+ netsnmp_session *sess;
+ int rc, i;
+ deliver_by_notify *obj;
+ netsnmp_iterator *iterator;
+ time_t now = time(NULL);
+ u_long message_count, max_message_count, tmp_long;
+ u_long *max_message_count_ptrs[MAX_MESSAGE_COUNT];
+ size_t estimated_pkt_size;
+
+ DEBUGMSGTL(("deliverByNotify", "Starting the execute routine\n"));
+
+ /* XXX: need to do the whole container */
+ iterator = CONTAINER_ITERATOR(deliver_container);
+ netsnmp_assert_or_return(iterator != NULL,);
+
+ sess = netsnmp_query_get_default_session();
+
+ for(obj = ITERATOR_FIRST(iterator); obj;
+ obj = ITERATOR_NEXT(iterator)) {
+
+ /* check if we need to run this one yet */
+ if (obj->next_run > now)
+ continue;
+
+ max_message_count = 1;
+ message_count = 0;
+
+ /* fill the varbind list with the target object */
+ vars = SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ snmp_set_var_objid( vars, obj->target, obj->target_len );
+ vars->type = ASN_NULL;
+
+ /* walk the OID tree for the data */
+ rc = netsnmp_query_walk(vars, sess);
+ if (rc != SNMP_ERR_NOERROR) {
+ /* XXX: disable? and reset the next query time point! */
+ snmp_log(LOG_ERR, "deliverByNotify: failed to issue the query");
+ ITERATOR_RELEASE(iterator);
+ return;
+ }
+
+ walker = vars;
+
+ while (walker) {
+
+ /* Set up the notification itself */
+ deliver_notification = NULL;
+ estimated_pkt_size = BASE_PACKET_SIZE;
+
+ /* add in the notification type */
+ snmp_varlist_add_variable(&deliver_notification,
+ objid_snmptrap, OID_LENGTH(objid_snmptrap),
+ ASN_OBJECT_ID,
+ data_notification_oid,
+ data_notification_oid_len * sizeof(oid));
+ estimated_pkt_size += ESTIMATE_VAR_SIZE(deliver_notification);
+
+ /* add in the current message number in this sequence */
+ if (!(obj->flags & NETSNMP_DELIVER_NO_PERIOD_OID)) {
+ tmp_long = obj->frequency;
+ snmp_varlist_add_variable(&deliver_notification,
+ netsnmp_periodic_time_oid,
+ netsnmp_periodic_time_oid_len,
+ ASN_UNSIGNED,
+ (const void *) &tmp_long,
+ sizeof(tmp_long));
+ estimated_pkt_size += ESTIMATE_VAR_SIZE(deliver_notification);
+ }
+
+ /* add in the current message number in this sequence */
+ message_count++;
+ if (message_count > MAX_MESSAGE_COUNT) {
+ snmp_log(LOG_ERR, "delivery construct grew too large... giving up\n");
+ /* XXX: disable it */
+ /* XXX: send a notification about it? */
+ ITERATOR_RELEASE(iterator);
+ return;
+ }
+
+ /* store this for later updating and sending */
+ ready_for_delivery[message_count-1] = deliver_notification;
+
+ if (!(obj->flags & NETSNMP_DELIVER_NO_MSG_COUNTS)) {
+ snmp_varlist_add_variable(&deliver_notification,
+ netsnmp_message_number_oid,
+ netsnmp_message_number_oid_len,
+ ASN_UNSIGNED,
+ (const void *) &message_count,
+ sizeof(message_count));
+ estimated_pkt_size += ESTIMATE_VAR_SIZE(deliver_notification);
+
+ /* add in the max message number count for this sequence */
+ vartmp = snmp_varlist_add_variable(&deliver_notification,
+ netsnmp_max_message_number_oid,
+ netsnmp_max_message_number_oid_len,
+ ASN_UNSIGNED,
+ (const void *) &max_message_count,
+ sizeof(max_message_count));
+ estimated_pkt_size += ESTIMATE_VAR_SIZE(deliver_notification);
+
+ /* we'll need to update this counter later */
+ max_message_count_ptrs[message_count-1] =
+ (u_long *) vartmp->val.integer;
+ } else {
+ /* just to be sure */
+ max_message_count_ptrs[message_count-1] = NULL;
+ }
+
+ /* copy in the collected data */
+ while(walker) {
+ snmp_varlist_add_variable(&deliver_notification,
+ walker->name, walker->name_length,
+ walker->type,
+ walker->val.string, walker->val_len);
+
+ /* 8 byte padding for ASN encodings an a few extra OID bytes */
+ estimated_pkt_size += ESTIMATE_VAR_SIZE(walker);
+
+ walker = walker->next_variable;
+
+ /* if the current size PLUS the next one (which is now
+ in 'walker') is greater than the limet then we stop here */
+ if (obj->max_packet_size > 0 &&
+ estimated_pkt_size +
+ ESTIMATE_VAR_SIZE(walker) >=
+ obj->max_packet_size) {
+ break;
+ }
+ }
+
+ /* send out the notification */
+ send_v2trap(deliver_notification);
+ }
+
+ for(i = 0; i < message_count; i++) {
+ /* update the max count pointer */
+ if (max_message_count_ptrs[i])
+ *(max_message_count_ptrs[i]) = message_count;
+
+ send_v2trap(ready_for_delivery[i]);
+ snmp_free_varbind(ready_for_delivery[i]);
+ }
+
+ snmp_free_varbind(vars);
+
+ /* record this as the time processed */
+ /* XXX: this may creep by a few seconds when processing and maybe we want
+ to do the time stamp at the beginning? */
+ obj->last_run = time(NULL);
+ }
+ ITERATOR_RELEASE(iterator);
+
+ /* calculate the next time to sleep for */
+ _schedule_next_execute_time();
+}
+
+int
+calculate_time_until_next_run(deliver_by_notify *it, time_t *now) {
+ time_t local_now;
+
+ /* if we weren't passed a valid time, fake it */
+ if (NULL == now) {
+ now = &local_now;
+ time(&local_now);
+ }
+
+ netsnmp_assert_or_return(it->last_run != 0, -1);
+
+ /* set the timestamp for the next run */
+ it->next_run = it->last_run + it->frequency;
+
+ /* how long until the next run? */
+ return it->next_run - *now;
+}
+
+static void
+_schedule_next_execute_time(void) {
+ time_t local_now = time(NULL);
+ int sleep_for = INT_MAX;
+ int next_time;
+ netsnmp_iterator *iterator;
+ deliver_by_notify *obj;
+
+ DEBUGMSGTL(("deliverByNotify", "Calculating scheduling needed\n"));
+
+ if (alarm_reg) {
+ snmp_alarm_unregister(alarm_reg);
+ alarm_reg = 0;
+ }
+
+ iterator = CONTAINER_ITERATOR(deliver_container);
+ if (NULL == iterator)
+ return;
+
+ for(obj = ITERATOR_FIRST(iterator); obj;
+ obj = ITERATOR_NEXT(iterator)) {
+ next_time = calculate_time_until_next_run(obj, &local_now);
+ DEBUGMSGTL(("deliverByNotify", " obj: %d (last=%d, next_run=%d)\n", next_time, obj->last_run, obj->next_run));
+ if (next_time < sleep_for)
+ sleep_for = next_time;
+ }
+
+ if (sleep_for != INT_MAX) {
+ if (sleep_for < 1)
+ sleep_for = 1; /* give at least a small pause */
+ DEBUGMSGTL(("deliverByNotify", "Next execution in %d (max = %d) seconds\n",
+ sleep_for, INT_MAX));
+ alarm_reg = snmp_alarm_register(sleep_for, 0, &deliver_execute, NULL);
+ }
+
+ ITERATOR_RELEASE(iterator);
+}
+
diff --git a/agent/mibgroup/deliver/deliverByNotify.h b/agent/mibgroup/deliver/deliverByNotify.h
new file mode 100644
index 0000000..292c366
--- /dev/null
+++ b/agent/mibgroup/deliver/deliverByNotify.h
@@ -0,0 +1,40 @@
+#ifndef DELIVERBYNOTIFY_H
+#define DELIVERBYNOTIFY_H 1
+
+#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
+
+config_add_mib(NET-SNMP-PERIODIC-NOTIFY-MIB)
+
+void init_deliverByNotify(void);
+
+void parse_deliver_config(const char *, char *);
+void free_deliver_config(void);
+
+SNMPAlarmCallback deliver_execute;
+
+#define NETSNMP_DELIVER_NO_PERIOD_OID 0x01
+#define NETSNMP_DELIVER_NO_MSG_COUNTS 0x02
+
+/* implementation details */
+typedef struct deliver_by_notify_s {
+ int frequency;
+ int last_run;
+ int next_run;
+ oid *target;
+ size_t target_len;
+ int max_packet_size;
+ int flags;
+} deliver_by_notify;
+
+int calculate_time_until_next_run(deliver_by_notify *it, time_t *now);
+
+#endif /* deliverByNotify_h */
diff --git a/agent/mibgroup/disman.h b/agent/mibgroup/disman.h
new file mode 100644
index 0000000..6b7cdd5
--- /dev/null
+++ b/agent/mibgroup/disman.h
@@ -0,0 +1,12 @@
+/*
+ * Wrapper for the full DisMan implementation
+ */
+config_require(disman/event-mib)
+config_require(disman/expression-mib)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+/* the schedule mib is all about writing (SETs) */
+config_require(disman/schedule)
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+/* config_require(disman/nslookup-mib) */
+/* config_require(disman/ping-mib) */
+/* config_require(disman/traceroute-mib) */
diff --git a/agent/mibgroup/disman/event-mib.h b/agent/mibgroup/disman/event-mib.h
new file mode 100644
index 0000000..58c8391
--- /dev/null
+++ b/agent/mibgroup/disman/event-mib.h
@@ -0,0 +1,2 @@
+config_require(disman/event)
+
diff --git a/agent/mibgroup/disman/event.h b/agent/mibgroup/disman/event.h
new file mode 100644
index 0000000..e646975
--- /dev/null
+++ b/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/agent/mibgroup/disman/event/mteEvent.c b/agent/mibgroup/disman/event/mteEvent.c
new file mode 100644
index 0000000..bc4ff0b
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteEvent.c
@@ -0,0 +1,492 @@
+/*
+ * DisMan Event MIB:
+ * Core implementation of the event handling behaviour
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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_feature_child_of(disman_debugging, libnetsnmpmibs)
+netsnmp_feature_child_of(mteevent, libnetsnmpmibs)
+netsnmp_feature_child_of(mteevent_removeentry, mteevent)
+
+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 (%p)\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.
+ *
+ * =================================================== */
+
+#ifndef NETSNMP_FEATURE_REMOVE_DISMAN_DEBUGGING
+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", ": %p, %p\n", row, entry));
+ i++;
+ }
+ DEBUGMSGTL(("disman:event:dump", "EventTable %d entries\n", i));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DISMAN_DEBUGGING */
+
+/*
+ * 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;
+}
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_MTEEVENT_REMOVEENTRY
+/*
+ * 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);
+ SNMP_FREE(entry);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MTEEVENT_REMOVEENTRY */
+
+ /* ===================================================
+ *
+ * APIs for processing the firing of an event
+ *
+ * =================================================== */
+
+int
+_mteEvent_fire_notify( struct mteEvent *event,
+ struct mteTrigger *trigger,
+ oid *suffix, size_t sfx_len );
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+int
+_mteEvent_fire_set( struct mteEvent *event,
+ struct mteTrigger *trigger,
+ oid *suffix, size_t sfx_len );
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+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;
+ }
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (entry->mteEventActions & MTE_EVENT_SET) {
+ DEBUGMSGTL(("disman:event:fire", "Firing set event\n"));
+ _mteEvent_fire_set( entry, trigger, suffix, s_len );
+ fired = 1;
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 /* __NOT_NEEDED */
+
+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;
+ extern const oid snmptrap_oid[];
+ extern const size_t snmptrap_oid_len;
+ 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;
+}
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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 */
+}
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
diff --git a/agent/mibgroup/disman/event/mteEvent.h b/agent/mibgroup/disman/event/mteEvent.h
new file mode 100644
index 0000000..3be5c6e
--- /dev/null
+++ b/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];
+ u_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/agent/mibgroup/disman/event/mteEventConf.c b/agent/mibgroup/disman/event/mteEventConf.c
new file mode 100644
index 0000000..24192a6
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteEventConf.c
@@ -0,0 +1,588 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the event table configure handling
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(iquery)
+
+/** 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 */
+ }
+ if (!cp) {
+ config_perror("syntax error: missing set value");
+ return;
+ }
+
+ 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, *cp;
+ 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);
+
+ cp = entry->mteOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteEName; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteEventComment; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &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);
+
+ cp = entry->mteOwner; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteEName; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &tint );
+ vp = entry->mteNotification;
+ cptr = read_config_store_data(ASN_OBJECT_ID, cptr, &vp,
+ &entry->mteNotification_len);
+ cp = entry->mteNotifyOwner; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteNotifyObjects; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &tint );
+ snmpd_store_config(line);
+ }
+
+ if ( entry->mteEventActions & MTE_EVENT_SET ) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteESetTable ");
+ cptr = line + strlen(line);
+
+ cp = entry->mteOwner; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteEName; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &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);
+ cp = entry->mteSetTarget; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteSetContext; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &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/agent/mibgroup/disman/event/mteEventConf.h b/agent/mibgroup/disman/event/mteEventConf.h
new file mode 100644
index 0000000..47001f0
--- /dev/null
+++ b/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/agent/mibgroup/disman/event/mteEventNotificationTable.c b/agent/mibgroup/disman/event/mteEventNotificationTable.c
new file mode 100644
index 0000000..7d2c94a
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteEventNotificationTable.c
@@ -0,0 +1,266 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(check_vb_oid)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static netsnmp_table_registration_info *table_info;
+
+/* 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;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_event_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteEventNotificationTable slice
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration("mteEventNotificationTable",
+ mteEventNotificationTable_handler,
+ mteEventNotificationTable_oid,
+ mteEventNotificationTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration("mteEventNotificationTable",
+ mteEventNotificationTable_handler,
+ mteEventNotificationTable_oid,
+ mteEventNotificationTable_oid_len,
+ HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 (%p)\n",
+ event_table_data));
+}
+
+void
+shutdown_mteEventNotificationTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+
+/** 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/event/mteEventNotificationTable.h b/agent/mibgroup/disman/event/mteEventNotificationTable.h
new file mode 100644
index 0000000..abd6110
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteEventNotificationTable.h
@@ -0,0 +1,21 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/disman/event/mteEventSetTable.c b/agent/mibgroup/disman/event/mteEventSetTable.c
new file mode 100644
index 0000000..ee696f1
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteEventSetTable.c
@@ -0,0 +1,310 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(check_vb_oid)
+netsnmp_feature_require(check_vb_truthvalue)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static netsnmp_table_registration_info *table_info;
+
+/* 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;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_event_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteEventSetTable slice
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration("mteEventSetTable",
+ mteEventSetTable_handler,
+ mteEventSetTable_oid,
+ mteEventSetTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration("mteEventSetTable",
+ mteEventSetTable_handler,
+ mteEventSetTable_oid,
+ mteEventSetTable_oid_len,
+ HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 (%p)\n",
+ event_table_data));
+}
+
+void
+shutdown_mteEventSetTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+
+/** 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/event/mteEventSetTable.h b/agent/mibgroup/disman/event/mteEventSetTable.h
new file mode 100644
index 0000000..71ec09a
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteEventSetTable.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 MTEEVENTSETTABLE_H
+#define MTEEVENTSETTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteEventSetTable(void);
+void shutdown_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/agent/mibgroup/disman/event/mteEventTable.c b/agent/mibgroup/disman/event/mteEventTable.c
new file mode 100644
index 0000000..c5b534e
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteEventTable.c
@@ -0,0 +1,375 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(iquery)
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(iquery_pdu_session)
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(mteevent_removeentry)
+netsnmp_feature_require(check_vb_truthvalue)
+netsnmp_feature_require(table_tdata_insert_row)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static netsnmp_table_registration_info *table_info;
+
+/* 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;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_event_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteEventTable slice
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration("mteEventTable",
+ mteEventTable_handler,
+ mteEventTable_oid,
+ mteEventTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration("mteEventTable",
+ mteEventTable_handler,
+ mteEventTable_oid,
+ mteEventTable_oid_len,
+ HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 (%p)\n",
+ event_table_data));
+}
+
+void
+shutdown_mteEventTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+/** 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ }
+ DEBUGMSGTL(("disman:event:mib", "Table handler, done\n"));
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/event/mteEventTable.h b/agent/mibgroup/disman/event/mteEventTable.h
new file mode 100644
index 0000000..adc1c30
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteEventTable.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 MTEEVENTTABLE_H
+#define MTEEVENTTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteEventTable(void);
+void shutdown_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/agent/mibgroup/disman/event/mteObjects.c b/agent/mibgroup/disman/event/mteObjects.c
new file mode 100644
index 0000000..cf950c1
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteObjects.c
@@ -0,0 +1,433 @@
+/*
+ * 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(const char *owner, const 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(const char *owner, const char *oname, int index,
+ const 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);
+ SNMP_FREE(entry);
+}
+
+
+/*
+ * Remove all matching rows from the event table
+ */
+void
+mteObjects_removeEntries( const 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/agent/mibgroup/disman/event/mteObjects.h b/agent/mibgroup/disman/event/mteObjects.h
new file mode 100644
index 0000000..cdbf626
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteObjects.h
@@ -0,0 +1,60 @@
+#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(const char *owner, char *oname);
+netsnmp_tdata_row *mteObjects_createEntry( const char *owner,
+ const char *oname,
+ int oindex, int flags);
+struct mteObject * mteObjects_addOID(const char *owner, const char *oname, int index,
+ const 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/agent/mibgroup/disman/event/mteObjectsConf.c b/agent/mibgroup/disman/event/mteObjectsConf.c
new file mode 100644
index 0000000..7679865
--- /dev/null
+++ b/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, %lu) ", 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, *cp;
+ 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 %ld)\n",
+ entry->mteOwner, entry->mteOName, entry->mteOIndex));
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteOTable ");
+ cptr = line + strlen(line);
+
+ cp = entry->mteOwner; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteOName; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &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/agent/mibgroup/disman/event/mteObjectsConf.h b/agent/mibgroup/disman/event/mteObjectsConf.h
new file mode 100644
index 0000000..d6649ff
--- /dev/null
+++ b/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/agent/mibgroup/disman/event/mteObjectsTable.c b/agent/mibgroup/disman/event/mteObjectsTable.c
new file mode 100644
index 0000000..f7f6e02
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteObjectsTable.c
@@ -0,0 +1,347 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_oid)
+netsnmp_feature_require(check_vb_truthvalue)
+netsnmp_feature_require(table_tdata_insert_row)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static netsnmp_table_registration_info *table_info;
+
+/** 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;
+
+ /*
+ * Ensure the object table container is available...
+ */
+ init_objects_table_data();
+
+ /*
+ * ... then set up the MIB interface to this table
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration("mteObjectsTable",
+ mteObjectsTable_handler,
+ mteObjectsTable_oid,
+ mteObjectsTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration("mteObjectsTable",
+ mteObjectsTable_handler,
+ mteObjectsTable_oid,
+ mteObjectsTable_oid_len,
+ HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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);
+}
+
+void
+shutdown_mteObjectsTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+
+/** 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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);
+ }
+ }
+ }
+
+ /** set up to save persistent store */
+ snmp_store_needed(NULL);
+
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/event/mteObjectsTable.h b/agent/mibgroup/disman/event/mteObjectsTable.h
new file mode 100644
index 0000000..f5cd7bc
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteObjectsTable.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 MTEOBJECTSTABLE_H
+#define MTEOBJECTSTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteObjectsTable(void);
+void shutdown_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/agent/mibgroup/disman/event/mteScalars.c b/agent/mibgroup/disman/event/mteScalars.c
new file mode 100644
index 0000000..769adc1
--- /dev/null
+++ b/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/agent/mibgroup/disman/event/mteScalars.h b/agent/mibgroup/disman/event/mteScalars.h
new file mode 100644
index 0000000..a6ade2e
--- /dev/null
+++ b/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/agent/mibgroup/disman/event/mteTrigger.c b/agent/mibgroup/disman/event/mteTrigger.c
new file mode 100644
index 0000000..7fca1b0
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTrigger.c
@@ -0,0 +1,1200 @@
+/*
+ * DisMan Event MIB:
+ * Core implementation of the trigger handling behaviour
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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_feature_child_of(disman_debugging, libnetsnmpmibs)
+netsnmp_feature_child_of(mtetrigger, libnetsnmpmibs)
+netsnmp_feature_child_of(mtetrigger_removeentry, mtetrigger)
+
+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 (%p)\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.
+ *
+ * =================================================== */
+
+#ifndef NETSNMP_FEATURE_REMOVE_DISMAN_DEBUGGING
+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", ": %p, %p\n", row, entry));
+ i++;
+ }
+ DEBUGMSGTL(("disman:event:dump", "TriggerTable %d entries\n", i));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DISMAN_DEBUGGING */
+
+/*
+ * Create a new row in the trigger table
+ */
+netsnmp_tdata_row *
+mteTrigger_createEntry(const 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_MTETRIGGER_REMOVEENTRY
+/*
+ * 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);
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MTETRIGGER_REMOVEENTRY */
+
+ /* ===================================================
+ *
+ * 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" );
+ snmp_free_varbind(var);
+ 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");
+ snmp_free_varbind(var);
+ 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");
+ snmp_free_varbind(var);
+ 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");
+ snmp_free_varbind(var);
+ 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");
+ snmp_free_varbind(dvar);
+ 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", " (%ld - %ld) = %ld\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: (%ld %s %ld) %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/agent/mibgroup/disman/event/mteTrigger.h b/agent/mibgroup/disman/event/mteTrigger.h
new file mode 100644
index 0000000..19626b1
--- /dev/null
+++ b/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)
+ */
+ u_char mteTExTest;
+ u_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(const 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/agent/mibgroup/disman/event/mteTriggerBooleanTable.c b/agent/mibgroup/disman/event/mteTriggerBooleanTable.c
new file mode 100644
index 0000000..ed1ec30
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTriggerBooleanTable.c
@@ -0,0 +1,315 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(check_vb_truthvalue)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static netsnmp_table_registration_info *table_info;
+
+/** 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;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerBooleanTable slice
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration("mteTriggerBooleanTable",
+ mteTriggerBooleanTable_handler,
+ mteTBoolTable_oid,
+ mteTBoolTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration("mteTriggerBooleanTable",
+ mteTriggerBooleanTable_handler,
+ mteTBoolTable_oid,
+ mteTBoolTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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"));
+}
+
+void
+shutdown_mteTriggerBooleanTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+/** 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) {
+ if (request->processed)
+ continue;
+
+ 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 )) {
+ netsnmp_request_set_error(request, SNMP_NOSUCHINSTANCE);
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/event/mteTriggerBooleanTable.h b/agent/mibgroup/disman/event/mteTriggerBooleanTable.h
new file mode 100644
index 0000000..f2ddd77
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTriggerBooleanTable.h
@@ -0,0 +1,25 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/disman/event/mteTriggerConf.c b/agent/mibgroup/disman/event/mteTriggerConf.c
new file mode 100644
index 0000000..e7bb69b
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTriggerConf.c
@@ -0,0 +1,1489 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the trigger table configure handling
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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>
+
+netsnmp_feature_require(iquery)
+
+/** Initializes the mteTriggerConf module */
+void
+init_mteTriggerConf(void)
+{
+ init_trigger_table_data();
+
+ /*
+ * Register config handler for user-level (fixed) triggers ...
+ */
+ snmpd_register_const_config_handler("monitor",
+ parse_mteMonitor,
+ NULL,
+ "triggername [-I] [-i OID | -o OID]* [-e event] expression ");
+ snmpd_register_const_config_handler("defaultMonitors",
+ parse_default_mteMonitors,
+ NULL, "yes|no");
+ snmpd_register_const_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( const 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( const 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, const char *line)
+{
+ char buf[ SPRINT_MAX_LEN];
+ char tname[MTE_STR1_LEN+1];
+ const 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;
+ u_char 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_const(line, buf, SPRINT_MAX_LEN);
+ ;
+ cp = copy_nword_const(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_const( 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_const( 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_const(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((unsigned char)(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_const(line, buf, SPRINT_MAX_LEN);
+ ;
+ cp = copy_nword_const(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_const(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_const(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_const(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_const(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_const(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_const(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_const(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_const(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_const(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, %ld)\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_const(cp, buf, SPRINT_MAX_LEN);
+ 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, %ld, %s)\n",
+ tname, oid_name_buf, value, 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:
+ 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 */
+
+ /*
+ * 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_const(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, const 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, const 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, *cp;
+ 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);
+
+ cp = entry->mteOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTName; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTriggerComment; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &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 );
+ cp = entry->mteTriggerTarget; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTriggerContext; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ tint = entry->mteTriggerFrequency;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+ cp = entry->mteTriggerOOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTriggerObjects; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &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);
+
+ cp = entry->mteOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTName; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &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);
+
+ cp = entry->mteOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTName; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+
+ tint = (entry->mteTExTest & 0xff) << 8;
+ tint|= (entry->mteTExStartup & 0xff);
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+
+ cp = entry->mteTExObjOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTExObjects; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+
+ cp = entry->mteTExEvOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTExEvent; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+
+ snmpd_store_config(line);
+ }
+ if ( entry->mteTriggerTest & MTE_TRIGGER_BOOLEAN ) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteTBlTable ");
+ cptr = line + strlen(line);
+
+ cp = entry->mteOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTName; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &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 );
+
+ cp = entry->mteTBoolObjOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTBoolObjects; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+
+ cp = entry->mteTBoolEvOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTBoolEvent; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+
+ snmpd_store_config(line);
+ }
+ if ( entry->mteTriggerTest & MTE_TRIGGER_THRESHOLD ) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteTThTable ");
+ cptr = line + strlen(line);
+
+ cp = entry->mteOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTName; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &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 );
+
+ cp = entry->mteTThObjOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTThObjects; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+
+ cp = entry->mteTThRiseOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTThRiseEvent; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTThFallOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTThFallEvent; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+
+ cp = entry->mteTThDRiseOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTThDRiseEvent; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTThDFallOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->mteTThDFallEvent; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &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 ))) {
+ struct mteTrigger *entry = (struct mteTrigger *)
+ netsnmp_tdata_remove_and_delete_row(trigger_table_data, row);
+ if (entry) {
+ /* Remove from the callbacks list and disable triggers */
+ snmp_unregister_callback( SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ _mteTrigger_callback_enable, entry, 0 );
+ mteTrigger_disable( entry );
+ SNMP_FREE(entry);
+ }
+ }
+ return SNMPERR_SUCCESS;
+}
diff --git a/agent/mibgroup/disman/event/mteTriggerConf.h b/agent/mibgroup/disman/event/mteTriggerConf.h
new file mode 100644
index 0000000..bfbcfcb
--- /dev/null
+++ b/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 *, const char *);
+void parse_default_mteMonitors( const char *, const char *);
+void parse_linkUpDown_traps(const char *, const 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/agent/mibgroup/disman/event/mteTriggerDeltaTable.c b/agent/mibgroup/disman/event/mteTriggerDeltaTable.c
new file mode 100644
index 0000000..c2c2e8e
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTriggerDeltaTable.c
@@ -0,0 +1,273 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_oid)
+netsnmp_feature_require(check_vb_truthvalue)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/** 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;
+ int rc;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerDeltaTable slice
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration("mteTriggerDeltaTable",
+ mteTriggerDeltaTable_handler,
+ mteTDeltaTable_oid,
+ mteTDeltaTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration("mteTriggerDeltaTable",
+ mteTriggerDeltaTable_handler,
+ mteTDeltaTable_oid,
+ mteTDeltaTable_oid_len,
+ HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 */
+ rc = netsnmp_tdata_register(reg, trigger_table_data, table_info);
+ if (rc != SNMPERR_SUCCESS)
+ return;
+ netsnmp_handler_owns_table_info(reg->handler->next);
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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 )) {
+ netsnmp_request_set_error(request, SNMP_NOSUCHINSTANCE);
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/event/mteTriggerDeltaTable.h b/agent/mibgroup/disman/event/mteTriggerDeltaTable.h
new file mode 100644
index 0000000..51f0bdb
--- /dev/null
+++ b/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/agent/mibgroup/disman/event/mteTriggerExistenceTable.c b/agent/mibgroup/disman/event/mteTriggerExistenceTable.c
new file mode 100644
index 0000000..22b683e
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTriggerExistenceTable.c
@@ -0,0 +1,290 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static netsnmp_table_registration_info *table_info;
+
+/* 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;
+ int rc;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerExistenceTable slice
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration("mteTriggerExistenceTable",
+ mteTriggerExistenceTable_handler,
+ mteTExistTable_oid,
+ mteTExistTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration("mteTriggerExistenceTable",
+ mteTriggerExistenceTable_handler,
+ mteTExistTable_oid,
+ mteTExistTable_oid_len,
+ HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 */
+ rc = netsnmp_tdata_register(reg, trigger_table_data, table_info);
+ if (rc != SNMPERR_SUCCESS)
+ return;
+
+ netsnmp_handler_owns_table_info(reg->handler->next);
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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 )) {
+ netsnmp_request_set_error(request, SNMP_NOSUCHINSTANCE);
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/event/mteTriggerExistenceTable.h b/agent/mibgroup/disman/event/mteTriggerExistenceTable.h
new file mode 100644
index 0000000..c845660
--- /dev/null
+++ b/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/agent/mibgroup/disman/event/mteTriggerTable.c b/agent/mibgroup/disman/event/mteTriggerTable.c
new file mode 100644
index 0000000..88c2f8b
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTriggerTable.c
@@ -0,0 +1,508 @@
+/*
+ * 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-features.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(iquery)
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(iquery_pdu_session)
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(check_vb_oid)
+netsnmp_feature_require(check_vb_uint)
+netsnmp_feature_require(mtetrigger_removeentry)
+netsnmp_feature_require(check_vb_truthvalue)
+netsnmp_feature_require(table_tdata_insert_row)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static netsnmp_table_registration_info *table_info;
+
+/** 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;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerTable slice
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration("mteTriggerTable",
+ mteTriggerTable_handler,
+ mteTriggerTable_oid,
+ mteTriggerTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration("mteTriggerTable",
+ mteTriggerTable_handler,
+ mteTriggerTable_oid,
+ mteTriggerTable_oid_len,
+ HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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"));
+}
+
+void
+shutdown_mteTriggerTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+
+/** 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+ }
+ }
+
+ /** set up to save persistent store */
+ snmp_store_needed(NULL);
+
+ break;
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/event/mteTriggerTable.h b/agent/mibgroup/disman/event/mteTriggerTable.h
new file mode 100644
index 0000000..c5c393a
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTriggerTable.h
@@ -0,0 +1,35 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/disman/event/mteTriggerThresholdTable.c b/agent/mibgroup/disman/event/mteTriggerThresholdTable.c
new file mode 100644
index 0000000..5aed0c8
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTriggerThresholdTable.c
@@ -0,0 +1,389 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static netsnmp_table_registration_info *table_info;
+
+/** 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;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerThresholdTable slice
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ reg = netsnmp_create_handler_registration("mteTriggerThresholdTable",
+ mteTriggerThresholdTable_handler,
+ mteTThreshTable_oid,
+ mteTThreshTable_oid_len,
+ HANDLER_CAN_RWRITE);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg = netsnmp_create_handler_registration("mteTriggerThresholdTable",
+ mteTriggerThresholdTable_handler,
+ mteTThreshTable_oid,
+ mteTThreshTable_oid_len,
+ HANDLER_CAN_RONLY);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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"));
+}
+
+void
+shutdown_mteTriggerThresholdTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+
+/** 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) {
+ if (request->processed)
+ continue;
+
+ 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 )) {
+ netsnmp_request_set_error(request, SNMP_NOSUCHINSTANCE);
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/event/mteTriggerThresholdTable.h b/agent/mibgroup/disman/event/mteTriggerThresholdTable.h
new file mode 100644
index 0000000..80f5f2a
--- /dev/null
+++ b/agent/mibgroup/disman/event/mteTriggerThresholdTable.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 MTETRIGGERTHRESHOLDTABLE_H
+#define MTETRIGGERTHRESHOLDTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteTriggerThresholdTable(void);
+void shutdown_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/agent/mibgroup/disman/expr/expErrorTable.c b/agent/mibgroup/disman/expr/expErrorTable.c
new file mode 100644
index 0000000..a759e2d
--- /dev/null
+++ b/agent/mibgroup/disman/expr/expErrorTable.c
@@ -0,0 +1,120 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_tdata)
+
+/* 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 (%p)\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) {
+ if (request->processed)
+ continue;
+
+ 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/agent/mibgroup/disman/expr/expErrorTable.h b/agent/mibgroup/disman/expr/expErrorTable.h
new file mode 100644
index 0000000..1d8339e
--- /dev/null
+++ b/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/agent/mibgroup/disman/expr/expExpression.c b/agent/mibgroup/disman/expr/expExpression.c
new file mode 100644
index 0000000..c924141
--- /dev/null
+++ b/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 (%p)\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", ": %p, %p\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(const char *expOwner, const 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(const char *expOwner, const 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(const char *owner, const 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,
+ (const u_char*)owner, strlen(owner));
+ snmp_set_var_typed_value( &name_var, ASN_OCTET_STR,
+ (const 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(const char *owner, const 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,
+ (const u_char*)owner, strlen(owner));
+ snmp_set_var_typed_value( &name_var, ASN_OCTET_STR,
+ (const 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/agent/mibgroup/disman/expr/expExpression.h b/agent/mibgroup/disman/expr/expExpression.h
new file mode 100644
index 0000000..282e2bf
--- /dev/null
+++ b/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(const char *, const char *, int);
+netsnmp_tdata_row *expExpression_createRow(const char *, const char *, int);
+void expExpression_removeEntry( netsnmp_tdata_row *);
+
+struct expExpression *expExpression_getEntry(const char *, const char *);
+struct expExpression *expExpression_getFirstEntry( void );
+struct expExpression *expExpression_getNextEntry(const char *, const 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/agent/mibgroup/disman/expr/expExpressionConf.c b/agent/mibgroup/disman/expr/expExpressionConf.c
new file mode 100644
index 0000000..5c08c72
--- /dev/null
+++ b/agent/mibgroup/disman/expr/expExpressionConf.c
@@ -0,0 +1,292 @@
+/*
+ * DisMan Expression MIB:
+ * Implementation of the expression table configuration handling.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <ctype.h>
+
+#include "utilities/iquery.h"
+#include "disman/expr/expExpression.h"
+#include "disman/expr/expObject.h"
+#include "disman/expr/expExpressionConf.h"
+
+netsnmp_feature_require(iquery)
+
+/* 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, *cp;
+ 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);
+
+ cp = entry->expOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->expName; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+
+ cp = entry->expExpression; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ tint = entry->expValueType;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+ cp = entry->expComment; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &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/agent/mibgroup/disman/expr/expExpressionConf.h b/agent/mibgroup/disman/expr/expExpressionConf.h
new file mode 100644
index 0000000..2729109
--- /dev/null
+++ b/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/agent/mibgroup/disman/expr/expExpressionTable.c b/agent/mibgroup/disman/expr/expExpressionTable.c
new file mode 100644
index 0000000..79aa715
--- /dev/null
+++ b/agent/mibgroup/disman/expr/expExpressionTable.c
@@ -0,0 +1,364 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(iquery)
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(table_tdata_insert_row)
+netsnmp_feature_require(iquery_pdu_session)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/* 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 (%p)\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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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/agent/mibgroup/disman/expr/expExpressionTable.h b/agent/mibgroup/disman/expr/expExpressionTable.h
new file mode 100644
index 0000000..a32d8f5
--- /dev/null
+++ b/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/agent/mibgroup/disman/expr/expObject.c b/agent/mibgroup/disman/expr/expObject.c
new file mode 100644
index 0000000..c27437b
--- /dev/null
+++ b/agent/mibgroup/disman/expr/expObject.c
@@ -0,0 +1,345 @@
+/*
+ * 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 (%p)\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(const char *expOwner, const 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( const char *expOwner, const 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( const char *expOwner, const 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,
+ (const u_char*)expOwner, strlen(expOwner));
+ snmp_set_var_typed_value( &name_var, ASN_OCTET_STR,
+ (const 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;
+
+ /*
+ * 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 );
+ }
+ 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 );
+ 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?)
+ */
+ netsnmp_query_get( var, expr->session );
+ if ( obj->cvars )
+ snmp_free_varbind( obj->cvars );
+ obj->cvars = var;
+ }
+}
diff --git a/agent/mibgroup/disman/expr/expObject.h b/agent/mibgroup/disman/expr/expObject.h
new file mode 100644
index 0000000..c62158a
--- /dev/null
+++ b/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( const char *, const char *, long, int );
+netsnmp_tdata_row * expObject_createRow( const char *, const char *, long, int );
+void expObject_removeEntry( netsnmp_tdata_row * );
+
+netsnmp_tdata_row * expObject_getFirst( const char *, const char * );
+netsnmp_tdata_row * expObject_getNext( netsnmp_tdata_row * );
+void expObject_getData( struct expExpression *,
+ struct expObject * );
+#endif /* EXPOBJECT_H */
diff --git a/agent/mibgroup/disman/expr/expObjectConf.c b/agent/mibgroup/disman/expr/expObjectConf.c
new file mode 100644
index 0000000..64069d9
--- /dev/null
+++ b/agent/mibgroup/disman/expr/expObjectConf.c
@@ -0,0 +1,185 @@
+/*
+ * DisMan Expression MIB:
+ * Implementation of the object table configuration handling.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(iquery)
+
+/* 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, %ld) ", 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, *cp;
+ 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 %lu)\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);
+
+ cp = entry->expOwner; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->expName; tint = strlen( cp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &cp, &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/agent/mibgroup/disman/expr/expObjectConf.h b/agent/mibgroup/disman/expr/expObjectConf.h
new file mode 100644
index 0000000..8a67cca
--- /dev/null
+++ b/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/agent/mibgroup/disman/expr/expObjectTable.c b/agent/mibgroup/disman/expr/expObjectTable.c
new file mode 100644
index 0000000..adda438
--- /dev/null
+++ b/agent/mibgroup/disman/expr/expObjectTable.c
@@ -0,0 +1,461 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_tdata)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_oid)
+netsnmp_feature_require(check_vb_truthvalue)
+netsnmp_feature_require(table_tdata_insert_row)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/* 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 (%p)\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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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/agent/mibgroup/disman/expr/expObjectTable.h b/agent/mibgroup/disman/expr/expObjectTable.h
new file mode 100644
index 0000000..568f67a
--- /dev/null
+++ b/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/agent/mibgroup/disman/expr/expScalars.c b/agent/mibgroup/disman/expr/expScalars.c
new file mode 100644
index 0000000..4a3ebc7
--- /dev/null
+++ b/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/agent/mibgroup/disman/expr/expScalars.h b/agent/mibgroup/disman/expr/expScalars.h
new file mode 100644
index 0000000..022e01b
--- /dev/null
+++ b/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/agent/mibgroup/disman/expr/expValue.c b/agent/mibgroup/disman/expr/expValue.c
new file mode 100644
index 0000000..46638f2
--- /dev/null
+++ b/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 & 0xFF ];
+ 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 & 0xFF ];
+ 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 %ld\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/agent/mibgroup/disman/expr/expValue.h b/agent/mibgroup/disman/expr/expValue.h
new file mode 100644
index 0000000..5b9bffb
--- /dev/null
+++ b/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/agent/mibgroup/disman/expr/expValueTable.c b/agent/mibgroup/disman/expr/expValueTable.c
new file mode 100644
index 0000000..d74dbd1
--- /dev/null
+++ b/agent/mibgroup/disman/expr/expValueTable.c
@@ -0,0 +1,329 @@
+/*
+ * 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 NULL;
+ }
+
+ 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 (%p)\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 (%p)\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 != %ld)\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 (%p)\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 (%" NETSNMP_PRIo "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 (%p)\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 (%p)\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 (%" NETSNMP_PRIo "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 (%p)\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);
+ } else {
+ len = 1;
+ }
+ res = expValue_evaluateExpression( exp, vp->val.objid+1, len-1);
+ DEBUGMSGTL(( "disman:expr:val", "w/card next returned (%p)\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/agent/mibgroup/disman/expr/expValueTable.h b/agent/mibgroup/disman/expr/expValueTable.h
new file mode 100644
index 0000000..15f3202
--- /dev/null
+++ b/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/agent/mibgroup/disman/expr/exp_enum.h b/agent/mibgroup/disman/expr/exp_enum.h
new file mode 100644
index 0000000..47085b2
--- /dev/null
+++ b/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/agent/mibgroup/disman/expression-mib.h b/agent/mibgroup/disman/expression-mib.h
new file mode 100644
index 0000000..18db2af
--- /dev/null
+++ b/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/agent/mibgroup/disman/expression.h b/agent/mibgroup/disman/expression.h
new file mode 100644
index 0000000..82f7cc0
--- /dev/null
+++ b/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/agent/mibgroup/disman/expression/expErrorTable.c b/agent/mibgroup/disman/expression/expErrorTable.c
new file mode 100644
index 0000000..1feb3ee
--- /dev/null
+++ b/agent/mibgroup/disman/expression/expErrorTable.c
@@ -0,0 +1,144 @@
+/*
+ *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, NETSNMP_OLDAPI_RONLY,
+ var_expErrorTable, 2, {1, 1}},
+#define EXPERRORINDEX 2
+ {EXPERRORINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_expErrorTable, 2, {1, 2}},
+#define EXPERRORCODE 3
+ {EXPERRORCODE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_expErrorTable, 2, {1, 3}},
+#define EXPERRORINSTANCE 4
+ {EXPERRORINSTANCE, ASN_OBJECT_ID, NETSNMP_OLDAPI_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;
+ }
+
+ return NULL;
+}
diff --git a/agent/mibgroup/disman/expression/expErrorTable.h b/agent/mibgroup/disman/expression/expErrorTable.h
new file mode 100644
index 0000000..5399159
--- /dev/null
+++ b/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/agent/mibgroup/disman/expression/expExpressionTable.c b/agent/mibgroup/disman/expression/expExpressionTable.c
new file mode 100644
index 0000000..ce3b0db
--- /dev/null
+++ b/agent/mibgroup/disman/expression/expExpressionTable.c
@@ -0,0 +1,1177 @@
+/*
+ *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>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(tdomain_support)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(header_complex_find_entry)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * 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, NETSNMP_OLDAPI_RWRITE,
+ var_expExpressionTable, 2, {1, 3}},
+#define EXPEXPRESSIONVALUETYPE 4
+ {EXPEXPRESSIONVALUETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_expExpressionTable, 2, {1, 4}},
+#define EXPEXPRESSIONCOMMENT 5
+ {EXPEXPRESSIONCOMMENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_expExpressionTable, 2, {1, 5}},
+#define EXPEXPRESSIONDELTALNTERVAL 6
+ {EXPEXPRESSIONDELTALNTERVAL, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_expExpressionTable, 2, {1, 6}},
+#define EXPEXPRESSIONPREFIX 7
+ {EXPEXPRESSIONPREFIX, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_expExpressionTable, 2, {1, 7}},
+#define EXPEXPRESSIONERRORS 8
+ {EXPEXPRESSIONERRORS, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_expExpressionTable, 2, {1, 8}},
+#define EXPEXPRESSIONENTRYSTATUS 9
+ {EXPEXPRESSIONENTRYSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_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 header_complex_index *hcindex;
+
+ 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);
+ snmp_store_needed(NULL);
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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);
+ snmp_store_needed(NULL);
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ }
+ }
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/expression/expExpressionTable.h b/agent/mibgroup/disman/expression/expExpressionTable.h
new file mode 100644
index 0000000..6c139f8
--- /dev/null
+++ b/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/agent/mibgroup/disman/expression/expObjectTable.c b/agent/mibgroup/disman/expression/expObjectTable.c
new file mode 100644
index 0000000..e56f25a
--- /dev/null
+++ b/agent/mibgroup/disman/expression/expObjectTable.c
@@ -0,0 +1,1465 @@
+/*
+ *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>
+#include <net-snmp/net-snmp-features.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
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(header_complex_find_entry)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * 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, NETSNMP_OLDAPI_RWRITE,
+ var_expObjectTable, 2, {1, 2}},
+#define EXPOBJECTIDWILDCARD 3
+ {EXPOBJECTIDWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_expObjectTable, 2, {1, 3}},
+#define EXPOBJECTSAMPLETYPE 4
+ {EXPOBJECTSAMPLETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_expObjectTable, 2, {1, 4}},
+#define EXPOBJECTDELTADISCONTINUITYID 5
+ {EXPOBJECTDELTADISCONTINUITYID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_expObjectTable, 2, {1, 5}},
+#define EXPOBJECTDISCONTINUITYIDWILDCARD 6
+ {EXPOBJECTDISCONTINUITYIDWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_expObjectTable, 2, {1, 6}},
+#define EXPOBJECTDISCONTINUITYIDTYPE 7
+ {EXPOBJECTDISCONTINUITYIDTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_expObjectTable, 2, {1, 7}},
+#define EXPOBJECTCONDITIONAL 8
+ {EXPOBJECTCONDITIONAL, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_expObjectTable, 2, {1, 8}},
+#define EXPOBJECTCONDITIONALWILDCARD 9
+ {EXPOBJECTCONDITIONALWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_expObjectTable, 2, {1, 9}},
+#define EXPOBJECTENTRYSTATUS 10
+ {EXPOBJECTENTRYSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_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;
+ 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"));
+ return 0;
+}
+
+
+/*
+ * 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);
+ snmp_store_needed(NULL);
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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);
+ snmp_store_needed(NULL);
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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);
+ snmp_store_needed(NULL);
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ }
+ }
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/expression/expObjectTable.h b/agent/mibgroup/disman/expression/expObjectTable.h
new file mode 100644
index 0000000..86fea31
--- /dev/null
+++ b/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/agent/mibgroup/disman/expression/expValueTable.c b/agent/mibgroup/disman/expression/expValueTable.c
new file mode 100644
index 0000000..6b315c6
--- /dev/null
+++ b/agent/mibgroup/disman/expression/expValueTable.c
@@ -0,0 +1,873 @@
+/*
+ *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 nodelink;
+nodelink *operater = NULL;
+nodelink *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, NETSNMP_OLDAPI_RONLY,
+ var_expValueTable, 2, {1, 2}},
+#define EXPVALUEUNSIGNED32VAL 3
+ {EXPVALUEUNSIGNED32VAL, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_expValueTable, 2, {1, 3}},
+#define EXPVALUETIMETICKSVAL 4
+ {EXPVALUETIMETICKSVAL, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_expValueTable, 2, {1, 4}},
+#define EXPVALUEINTEGER32VAL 5
+ {EXPVALUEINTEGER32VAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_expValueTable, 2, {1, 5}},
+#define EXPVALUEIPADDRESSVAL 6
+ {EXPVALUEIPADDRESSVAL, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_expValueTable, 2, {1, 6}},
+#define EXPVALUEOCTETSTRINGVAL 7
+ {EXPVALUEOCTETSTRINGVAL, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_expValueTable, 2, {1, 7}},
+#define EXPVALUEOIDVAL 8
+ {EXPVALUEOIDVAL, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_expValueTable, 2, {1, 8}},
+#define EXPVALUECOUNTER64VAL 9
+ {EXPVALUECOUNTER64VAL, ASN_INTEGER, NETSNMP_OLDAPI_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 = strdup("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 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;
+ }
+ }
+ sprintf(temp, "%.*s", j - 1, expression + 1);
+ 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;
+
+ /*
+ * 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, "%lu", 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(void)
+{
+ struct expExpressionTable_data *expstorage;
+ struct expObjectTable_data *objstorage, *objfound = NULL;
+ struct header_complex_index *hcindex, *object_hcindex;
+ char *expression;
+ oid *index;
+ int i = 0, j, l;
+
+ 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;
+ 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;
+ }
+ }
+ {
+ char temp[100];
+
+ sprintf(temp, "%.*s", j - 1, expression + 1);
+ 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) {
+ 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;
+ int status;
+ 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)
+{
+
+ struct expValueTable_data *StorageTmp = NULL;
+
+
+
+
+ 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("");
+ return NULL;
+ }
+}
+
+
+
+
+
+void
+push(nodelink ** stack, unsigned long value)
+{
+ nodelink *newnode;
+ newnode = (nodelink *) malloc(sizeof(nodelink));
+ if (!newnode) {
+ printf("\nMemory allocation failure!");
+ return;
+ }
+ newnode->data = value;
+ newnode->next = *stack;
+ *stack = newnode;
+}
+
+unsigned long
+pop(nodelink ** stack)
+{
+ unsigned long value;
+ nodelink *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);
+ }
+ return 0;
+}
+
+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/agent/mibgroup/disman/expression/expValueTable.h b/agent/mibgroup/disman/expression/expValueTable.h
new file mode 100644
index 0000000..8569f9d
--- /dev/null
+++ b/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/agent/mibgroup/disman/mteEventNotificationTable.c b/agent/mibgroup/disman/mteEventNotificationTable.c
new file mode 100644
index 0000000..48add68
--- /dev/null
+++ b/agent/mibgroup/disman/mteEventNotificationTable.c
@@ -0,0 +1,110 @@
+/*
+ * 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "mteEventNotificationTable.h"
+
+netsnmp_feature_require(table_dataset)
+netsnmp_feature_require(table_set_multi_add_default_row)
+
+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"
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration
+ ("mteEventNotificationTable",
+ mteEventNotificationTable_handler,
+ mteEventNotificationTable_oid,
+ mteEventNotificationTable_oid_len,
+ HANDLER_CAN_RWRITE), mteEventNotif_table_set, NULL);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration
+ ("mteEventNotificationTable",
+ mteEventNotificationTable_handler,
+ mteEventNotificationTable_oid,
+ mteEventNotificationTable_oid_len,
+ HANDLER_CAN_RONLY), mteEventNotif_table_set, NULL);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+}
+
+/** 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/agent/mibgroup/disman/mteEventNotificationTable.h b/agent/mibgroup/disman/mteEventNotificationTable.h
new file mode 100644
index 0000000..dd9bdfa
--- /dev/null
+++ b/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/agent/mibgroup/disman/mteEventTable.c b/agent/mibgroup/disman/mteEventTable.c
new file mode 100644
index 0000000..22bad73
--- /dev/null
+++ b/agent/mibgroup/disman/mteEventTable.c
@@ -0,0 +1,345 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(table_dataset)
+netsnmp_feature_require(table_set_multi_add_default_row)
+
+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 = MAX_OID_LEN;
+ 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;
+ }
+ oid_buf_len = MAX_OID_LEN;
+ 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/agent/mibgroup/disman/mteEventTable.h b/agent/mibgroup/disman/mteEventTable.h
new file mode 100644
index 0000000..c67b880
--- /dev/null
+++ b/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/agent/mibgroup/disman/mteObjectsTable.c b/agent/mibgroup/disman/mteObjectsTable.c
new file mode 100644
index 0000000..c3f331d
--- /dev/null
+++ b/agent/mibgroup/disman/mteObjectsTable.c
@@ -0,0 +1,995 @@
+/*
+ * 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 <net-snmp/net-snmp-features.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(header_complex_find_entry)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * 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
+ */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct variable2 mteObjectsTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTEOBJECTSID 5
+ {MTEOBJECTSID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_mteObjectsTable, 2, {1, 3}},
+#define MTEOBJECTSIDWILDCARD 6
+ {MTEOBJECTSIDWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteObjectsTable, 2, {1, 4}},
+#define MTEOBJECTSENTRYSTATUS 7
+ {MTEOBJECTSENTRYSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteObjectsTable, 2, {1, 5}},
+
+};
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+struct variable2 mteObjectsTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTEOBJECTSID 5
+ {MTEOBJECTSID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_mteObjectsTable, 2, {1, 3}},
+#define MTEOBJECTSIDWILDCARD 6
+ {MTEOBJECTSIDWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteObjectsTable, 2, {1, 4}},
+#define MTEOBJECTSENTRYSTATUS 7
+ {MTEOBJECTSENTRYSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteObjectsTable, 2, {1, 5}},
+
+};
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * (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"));
+
+ /* set default value */
+ *write_method = NULL;
+
+ /*
+ * 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteObjectsID;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = (StorageTmp->mteObjectsIDLen) * sizeof(oid);
+ return (u_char *) StorageTmp->mteObjectsID;
+
+ case MTEOBJECTSIDWILDCARD:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteObjectsIDWildcard;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteObjectsIDWildcard);
+ return (u_char *) & StorageTmp->mteObjectsIDWildcard;
+
+ case MTEOBJECTSENTRYSTATUS:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteObjectsEntryStatus;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteObjectsEntryStatus);
+ return (u_char *) & StorageTmp->mteObjectsEntryStatus;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+
+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);
+
+ snmp_store_needed(NULL);
+
+ 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!
+ */
+
+ snmp_store_needed(NULL);
+
+ 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);
+ if (StorageNew == NULL)
+ return SNMP_ERR_GENERR;
+ 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;
+ }
+ }
+ snmp_store_needed(NULL);
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+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);
+ if (StorageNew == NULL)
+ return SNMP_ERR_GENERR;
+ 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/agent/mibgroup/disman/mteObjectsTable.h b/agent/mibgroup/disman/mteObjectsTable.h
new file mode 100644
index 0000000..4d44c87
--- /dev/null
+++ b/agent/mibgroup/disman/mteObjectsTable.h
@@ -0,0 +1,71 @@
+/*
+ * 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);
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ WriteMethod write_mteObjectsID;
+ WriteMethod write_mteObjectsIDWildcard;
+ WriteMethod write_mteObjectsEntryStatus;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+
+#endif /* _MIBGROUP_MTEOBJECTSTABLE_H */
diff --git a/agent/mibgroup/disman/mteTriggerBooleanTable.c b/agent/mibgroup/disman/mteTriggerBooleanTable.c
new file mode 100644
index 0000000..5b17927
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerBooleanTable.c
@@ -0,0 +1,852 @@
+/*
+ * 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
+ */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct variable2 mteTriggerBooleanTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERBOOLEANCOMPARISON 3
+ {MTETRIGGERBOOLEANCOMPARISON, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 1}},
+#define MTETRIGGERBOOLEANVALUE 4
+ {MTETRIGGERBOOLEANVALUE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 2}},
+#define MTETRIGGERBOOLEANSTARTUP 5
+ {MTETRIGGERBOOLEANSTARTUP, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 3}},
+#define MTETRIGGERBOOLEANOBJECTSOWNER 6
+ {MTETRIGGERBOOLEANOBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 4}},
+#define MTETRIGGERBOOLEANOBJECTS 7
+ {MTETRIGGERBOOLEANOBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 5}},
+#define MTETRIGGERBOOLEANEVENTOWNER 8
+ {MTETRIGGERBOOLEANEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 6}},
+#define MTETRIGGERBOOLEANEVENT 9
+ {MTETRIGGERBOOLEANEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 7}},
+};
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+struct variable2 mteTriggerBooleanTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERBOOLEANCOMPARISON 3
+ {MTETRIGGERBOOLEANCOMPARISON, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerBooleanTable, 2, {1, 1}},
+#define MTETRIGGERBOOLEANVALUE 4
+ {MTETRIGGERBOOLEANVALUE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerBooleanTable, 2, {1, 2}},
+#define MTETRIGGERBOOLEANSTARTUP 5
+ {MTETRIGGERBOOLEANSTARTUP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerBooleanTable, 2, {1, 3}},
+#define MTETRIGGERBOOLEANOBJECTSOWNER 6
+ {MTETRIGGERBOOLEANOBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerBooleanTable, 2, {1, 4}},
+#define MTETRIGGERBOOLEANOBJECTS 7
+ {MTETRIGGERBOOLEANOBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerBooleanTable, 2, {1, 5}},
+#define MTETRIGGERBOOLEANEVENTOWNER 8
+ {MTETRIGGERBOOLEANEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerBooleanTable, 2, {1, 6}},
+#define MTETRIGGERBOOLEANEVENT 9
+ {MTETRIGGERBOOLEANEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerBooleanTable, 2, {1, 7}},
+};
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * (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"));
+
+ /* set default value */
+ *write_method = NULL;
+
+ /*
+ * 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerBooleanComparison;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerBooleanComparison);
+ return (u_char *) & StorageTmp->mteTriggerBooleanComparison;
+
+ case MTETRIGGERBOOLEANVALUE:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerBooleanValue;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerBooleanValue);
+ return (u_char *) & StorageTmp->mteTriggerBooleanValue;
+
+ case MTETRIGGERBOOLEANSTARTUP:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerBooleanStartup;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerBooleanStartup);
+ return (u_char *) & StorageTmp->mteTriggerBooleanStartup;
+
+ case MTETRIGGERBOOLEANOBJECTSOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerBooleanObjectsOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerBooleanObjectsOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerBooleanObjectsOwner;
+
+ case MTETRIGGERBOOLEANOBJECTS:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerBooleanObjects;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerBooleanObjectsLen;
+ return (u_char *) StorageTmp->mteTriggerBooleanObjects;
+
+ case MTETRIGGERBOOLEANEVENTOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerBooleanEventOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerBooleanEventOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerBooleanEventOwner;
+
+ case MTETRIGGERBOOLEANEVENT:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerBooleanEvent;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerBooleanEventLen;
+ return (u_char *) StorageTmp->mteTriggerBooleanEvent;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+
+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;
+}
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
diff --git a/agent/mibgroup/disman/mteTriggerBooleanTable.h b/agent/mibgroup/disman/mteTriggerBooleanTable.h
new file mode 100644
index 0000000..6413da5
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerBooleanTable.h
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ WriteMethod write_mteTriggerBooleanComparison;
+ WriteMethod write_mteTriggerBooleanValue;
+ WriteMethod write_mteTriggerBooleanStartup;
+ WriteMethod write_mteTriggerBooleanObjectsOwner;
+ WriteMethod write_mteTriggerBooleanObjects;
+ WriteMethod write_mteTriggerBooleanEventOwner;
+ WriteMethod write_mteTriggerBooleanEvent;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+
+
+#endif /* _MIBGROUP_MTETRIGGERBOOLEANTABLE_H */
diff --git a/agent/mibgroup/disman/mteTriggerDeltaTable.c b/agent/mibgroup/disman/mteTriggerDeltaTable.c
new file mode 100644
index 0000000..b5d2244
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerDeltaTable.c
@@ -0,0 +1,443 @@
+/*
+ * 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
+ */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct variable2 mteTriggerDeltaTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERDELTADISCONTINUITYID 3
+ {MTETRIGGERDELTADISCONTINUITYID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerDeltaTable, 2, {1, 1}},
+#define MTETRIGGERDELTADISCONTINUITYIDWILDCARD 4
+ {MTETRIGGERDELTADISCONTINUITYIDWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerDeltaTable, 2, {1, 2}},
+#define MTETRIGGERDELTADISCONTINUITYIDTYPE 5
+ {MTETRIGGERDELTADISCONTINUITYIDTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerDeltaTable, 2, {1, 3}},
+};
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+struct variable2 mteTriggerDeltaTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERDELTADISCONTINUITYID 3
+ {MTETRIGGERDELTADISCONTINUITYID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerDeltaTable, 2, {1, 1}},
+#define MTETRIGGERDELTADISCONTINUITYIDWILDCARD 4
+ {MTETRIGGERDELTADISCONTINUITYIDWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerDeltaTable, 2, {1, 2}},
+#define MTETRIGGERDELTADISCONTINUITYIDTYPE 5
+ {MTETRIGGERDELTADISCONTINUITYIDTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerDeltaTable, 2, {1, 3}},
+};
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * (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"));
+
+ /* set default value */
+ *write_method = NULL;
+
+ /*
+ * 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerDeltaDiscontinuityID;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len =
+ StorageTmp->mteTriggerDeltaDiscontinuityIDLen * sizeof(oid);
+ return (u_char *) StorageTmp->mteTriggerDeltaDiscontinuityID;
+
+ case MTETRIGGERDELTADISCONTINUITYIDWILDCARD:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerDeltaDiscontinuityIDWildcard;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len =
+ sizeof(StorageTmp->mteTriggerDeltaDiscontinuityIDWildcard);
+ return (u_char *) & StorageTmp->
+ mteTriggerDeltaDiscontinuityIDWildcard;
+
+ case MTETRIGGERDELTADISCONTINUITYIDTYPE:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerDeltaDiscontinuityIDType;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerDeltaDiscontinuityIDType);
+ return (u_char *) & StorageTmp->mteTriggerDeltaDiscontinuityIDType;
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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;
+}
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
diff --git a/agent/mibgroup/disman/mteTriggerDeltaTable.h b/agent/mibgroup/disman/mteTriggerDeltaTable.h
new file mode 100644
index 0000000..fa4872a
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerDeltaTable.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_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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ WriteMethod write_mteTriggerDeltaDiscontinuityID;
+ WriteMethod write_mteTriggerDeltaDiscontinuityIDWildcard;
+ WriteMethod write_mteTriggerDeltaDiscontinuityIDType;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+#endif /* _MIBGROUP_MTETRIGGERDELTATABLE_H */
diff --git a/agent/mibgroup/disman/mteTriggerExistenceTable.c b/agent/mibgroup/disman/mteTriggerExistenceTable.c
new file mode 100644
index 0000000..fdfdaf2
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerExistenceTable.c
@@ -0,0 +1,782 @@
+/*
+ * 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
+ */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct variable2 mteTriggerExistenceTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGEREXISTENCETEST 3
+ {MTETRIGGEREXISTENCETEST, ASN_BIT_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 1}},
+#define MTETRIGGEREXISTENCESTARTUP 4
+ {MTETRIGGEREXISTENCESTARTUP, ASN_BIT_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 2}},
+#define MTETRIGGEREXISTENCEOBJECTSOWNER 5
+ {MTETRIGGEREXISTENCEOBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 3}},
+#define MTETRIGGEREXISTENCEOBJECTS 6
+ {MTETRIGGEREXISTENCEOBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 4}},
+#define MTETRIGGEREXISTENCEEVENTOWNER 7
+ {MTETRIGGEREXISTENCEEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 5}},
+#define MTETRIGGEREXISTENCEEVENT 8
+ {MTETRIGGEREXISTENCEEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 6}},
+};
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+struct variable2 mteTriggerExistenceTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGEREXISTENCETEST 3
+ {MTETRIGGEREXISTENCETEST, ASN_BIT_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerExistenceTable, 2, {1, 1}},
+#define MTETRIGGEREXISTENCESTARTUP 4
+ {MTETRIGGEREXISTENCESTARTUP, ASN_BIT_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerExistenceTable, 2, {1, 2}},
+#define MTETRIGGEREXISTENCEOBJECTSOWNER 5
+ {MTETRIGGEREXISTENCEOBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerExistenceTable, 2, {1, 3}},
+#define MTETRIGGEREXISTENCEOBJECTS 6
+ {MTETRIGGEREXISTENCEOBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerExistenceTable, 2, {1, 4}},
+#define MTETRIGGEREXISTENCEEVENTOWNER 7
+ {MTETRIGGEREXISTENCEEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerExistenceTable, 2, {1, 5}},
+#define MTETRIGGEREXISTENCEEVENT 8
+ {MTETRIGGEREXISTENCEEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerExistenceTable, 2, {1, 6}},
+};
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * (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"));
+
+ /* set default value */
+ *write_method = NULL;
+
+ /*
+ * 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerExistenceTest;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerExistenceTestLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceTest;
+
+ case MTETRIGGEREXISTENCESTARTUP:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerExistenceStartup;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerExistenceStartupLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceStartup;
+
+ case MTETRIGGEREXISTENCEOBJECTSOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerExistenceObjectsOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerExistenceObjectsOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceObjectsOwner;
+
+ case MTETRIGGEREXISTENCEOBJECTS:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerExistenceObjects;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerExistenceObjectsLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceObjects;
+
+ case MTETRIGGEREXISTENCEEVENTOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerExistenceEventOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerExistenceEventOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceEventOwner;
+
+ case MTETRIGGEREXISTENCEEVENT:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerExistenceEvent;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerExistenceEventLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceEvent;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+
+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;
+}
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
diff --git a/agent/mibgroup/disman/mteTriggerExistenceTable.h b/agent/mibgroup/disman/mteTriggerExistenceTable.h
new file mode 100644
index 0000000..75c6427
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerExistenceTable.h
@@ -0,0 +1,41 @@
+/*
+ * 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ WriteMethod write_mteTriggerExistenceTest;
+ WriteMethod write_mteTriggerExistenceStartup;
+ WriteMethod write_mteTriggerExistenceObjectsOwner;
+ WriteMethod write_mteTriggerExistenceObjects;
+ WriteMethod write_mteTriggerExistenceEventOwner;
+ WriteMethod write_mteTriggerExistenceEvent;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+#endif /* _MIBGROUP_MTETRIGGEREXISTENCETABLE_H */
diff --git a/agent/mibgroup/disman/mteTriggerTable.c b/agent/mibgroup/disman/mteTriggerTable.c
new file mode 100644
index 0000000..a2306f7
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerTable.c
@@ -0,0 +1,3814 @@
+/*
+ * 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 <net-snmp/net-snmp-features.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
+
+netsnmp_feature_require(mib_snprint_variable)
+netsnmp_feature_require(tdomain_support)
+netsnmp_feature_require(check_vb_uint)
+netsnmp_feature_require(string_time_to_secs)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(header_complex_find_entry)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * 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
+ */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct variable2 mteTriggerTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERCOMMENT 5
+ {MTETRIGGERCOMMENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 3}},
+#define MTETRIGGERTEST 6
+ {MTETRIGGERTEST, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 4}},
+#define MTETRIGGERSAMPLETYPE 7
+ {MTETRIGGERSAMPLETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 5}},
+#define MTETRIGGERVALUEID 8
+ {MTETRIGGERVALUEID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 6}},
+#define MTETRIGGERVALUEIDWILDCARD 9
+ {MTETRIGGERVALUEIDWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 7}},
+#define MTETRIGGERTARGETTAG 10
+ {MTETRIGGERTARGETTAG, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 8}},
+#define MTETRIGGERCONTEXTNAME 11
+ {MTETRIGGERCONTEXTNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 9}},
+#define MTETRIGGERCONTEXTNAMEWILDCARD 12
+ {MTETRIGGERCONTEXTNAMEWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 10}},
+#define MTETRIGGERFREQUENCY 13
+ {MTETRIGGERFREQUENCY, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 11}},
+#define MTETRIGGEROBJECTSOWNER 14
+ {MTETRIGGEROBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 12}},
+#define MTETRIGGEROBJECTS 15
+ {MTETRIGGEROBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 13}},
+#define MTETRIGGERENABLED 16
+ {MTETRIGGERENABLED, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 14}},
+#define MTETRIGGERENTRYSTATUS 17
+ {MTETRIGGERENTRYSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerTable, 2, {1, 15}},
+};
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+struct variable2 mteTriggerTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERCOMMENT 5
+ {MTETRIGGERCOMMENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 3}},
+#define MTETRIGGERTEST 6
+ {MTETRIGGERTEST, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 4}},
+#define MTETRIGGERSAMPLETYPE 7
+ {MTETRIGGERSAMPLETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 5}},
+#define MTETRIGGERVALUEID 8
+ {MTETRIGGERVALUEID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 6}},
+#define MTETRIGGERVALUEIDWILDCARD 9
+ {MTETRIGGERVALUEIDWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 7}},
+#define MTETRIGGERTARGETTAG 10
+ {MTETRIGGERTARGETTAG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 8}},
+#define MTETRIGGERCONTEXTNAME 11
+ {MTETRIGGERCONTEXTNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 9}},
+#define MTETRIGGERCONTEXTNAMEWILDCARD 12
+ {MTETRIGGERCONTEXTNAMEWILDCARD, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 10}},
+#define MTETRIGGERFREQUENCY 13
+ {MTETRIGGERFREQUENCY, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 11}},
+#define MTETRIGGEROBJECTSOWNER 14
+ {MTETRIGGEROBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 12}},
+#define MTETRIGGEROBJECTS 15
+ {MTETRIGGEROBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 13}},
+#define MTETRIGGERENABLED 16
+ {MTETRIGGERENABLED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 14}},
+#define MTETRIGGERENTRYSTATUS 17
+ {MTETRIGGERENTRYSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerTable, 2, {1, 15}},
+};
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * (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);
+
+ 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, 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) {
+ int freq;
+ cp = copy_nword(cp, buf, sizeof(buf));
+ freq = netsnmp_string_time_to_secs(buf);
+ if (freq == -1) {
+ config_perror("Invalid -r value\n");
+ /*
+ * XXX: free StorageNew
+ */
+ return;
+ }
+ StorageNew->mteTriggerFrequency = (unsigend long) freq;
+ } 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)) {
+ netsnmp_config_error("unable to parse oid: %s", buf);
+ /*
+ * 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)) {
+ netsnmp_config_error("unable to parse oid: %s", buf);
+ /*
+ * 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_simple_monitor */
+
+
+/*
+ * 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"));
+} /* parse_mteTriggerTable */
+
+
+/*
+ * 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"));
+
+ /* set default value */
+ *write_method = NULL;
+
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (vp->magic == MTETRIGGERENTRYSTATUS)
+ *write_method = write_mteTriggerEntryStatus;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ return NULL;
+ }
+
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case MTETRIGGERCOMMENT:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerComment;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerCommentLen;
+ return (u_char *) StorageTmp->mteTriggerComment;
+
+ case MTETRIGGERTEST:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerTest;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerTestLen;
+ return (u_char *) StorageTmp->mteTriggerTest;
+
+ case MTETRIGGERSAMPLETYPE:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerSampleType;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerSampleType);
+ return (u_char *) & StorageTmp->mteTriggerSampleType;
+
+ case MTETRIGGERVALUEID:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerValueID;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerValueIDLen * sizeof(oid);
+ return (u_char *) StorageTmp->mteTriggerValueID;
+
+ case MTETRIGGERVALUEIDWILDCARD:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerValueIDWildcard;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerValueIDWildcard);
+ return (u_char *) & StorageTmp->mteTriggerValueIDWildcard;
+
+ case MTETRIGGERTARGETTAG:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerTargetTag;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerTargetTagLen;
+ return (u_char *) StorageTmp->mteTriggerTargetTag;
+
+ case MTETRIGGERCONTEXTNAME:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerContextName;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerContextNameLen;
+ return (u_char *) StorageTmp->mteTriggerContextName;
+
+ case MTETRIGGERCONTEXTNAMEWILDCARD:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerContextNameWildcard;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerContextNameWildcard);
+ return (u_char *) & StorageTmp->mteTriggerContextNameWildcard;
+
+ case MTETRIGGERFREQUENCY:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerFrequency;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerFrequency);
+ return (u_char *) & StorageTmp->mteTriggerFrequency;
+
+ case MTETRIGGEROBJECTSOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerObjectsOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerObjectsOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerObjectsOwner;
+
+ case MTETRIGGEROBJECTS:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerObjects;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerObjectsLen;
+ return (u_char *) StorageTmp->mteTriggerObjects;
+
+ case MTETRIGGERENABLED:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerEnabled;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerEnabled);
+ return (u_char *) & StorageTmp->mteTriggerEnabled;
+
+ case MTETRIGGERENTRYSTATUS:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerEntryStatus;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerEntryStatus);
+ return (u_char *) & StorageTmp->mteTriggerEntryStatus;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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);
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerComment */
+
+
+
+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);
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerTest */
+
+
+
+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!
+ */
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerSampleType */
+
+
+
+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);
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerValueID */
+
+
+
+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!
+ */
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerValueIDWildcard */
+
+
+
+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);
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerTargetTag */
+
+
+
+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);
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerContextName */
+
+
+
+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!
+ */
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerContextNameWildcard */
+
+
+
+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);
+
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerFrequency */
+
+
+
+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);
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerObjectsOwner */
+
+
+
+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);
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerObjects */
+
+
+
+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);
+
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerEnabled */
+
+
+
+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);
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_mteTriggerEntryStatus */
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+
+/*
+ * 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);
+} /* send_mte_trap */
+
+
+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
+ */
+
+ if (mte_callback_sess == NULL)
+ mte_callback_sess = netsnmp_query_get_default_session();
+ if (!mte_callback_sess)
+ return NULL;
+
+ 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;
+} /* mte_get_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;
+} /* mte_discontinuity_occurred */
+
+
+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;
+} /* mte_run_trigger */
+
+
+
+/*
+ * 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/agent/mibgroup/disman/mteTriggerTable.h b/agent/mibgroup/disman/mteTriggerTable.h
new file mode 100644
index 0000000..c427602
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerTable.h
@@ -0,0 +1,253 @@
+/*
+ * 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 *);
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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/agent/mibgroup/disman/mteTriggerThresholdTable.c b/agent/mibgroup/disman/mteTriggerThresholdTable.c
new file mode 100644
index 0000000..93c02b2
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerThresholdTable.c
@@ -0,0 +1,1700 @@
+/*
+ * 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
+ */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct variable2 mteTriggerThresholdTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERTHRESHOLDSTARTUP 3
+ {MTETRIGGERTHRESHOLDSTARTUP, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 1}},
+#define MTETRIGGERTHRESHOLDRISING 4
+ {MTETRIGGERTHRESHOLDRISING, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 2}},
+#define MTETRIGGERTHRESHOLDFALLING 5
+ {MTETRIGGERTHRESHOLDFALLING, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 3}},
+#define MTETRIGGERTHRESHOLDDELTARISING 6
+ {MTETRIGGERTHRESHOLDDELTARISING, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 4}},
+#define MTETRIGGERTHRESHOLDDELTAFALLING 7
+ {MTETRIGGERTHRESHOLDDELTAFALLING, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 5}},
+#define MTETRIGGERTHRESHOLDOBJECTSOWNER 8
+ {MTETRIGGERTHRESHOLDOBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 6}},
+#define MTETRIGGERTHRESHOLDOBJECTS 9
+ {MTETRIGGERTHRESHOLDOBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 7}},
+#define MTETRIGGERTHRESHOLDRISINGEVENTOWNER 10
+ {MTETRIGGERTHRESHOLDRISINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 8}},
+#define MTETRIGGERTHRESHOLDRISINGEVENT 11
+ {MTETRIGGERTHRESHOLDRISINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 9}},
+#define MTETRIGGERTHRESHOLDFALLINGEVENTOWNER 12
+ {MTETRIGGERTHRESHOLDFALLINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 10}},
+#define MTETRIGGERTHRESHOLDFALLINGEVENT 13
+ {MTETRIGGERTHRESHOLDFALLINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 11}},
+#define MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER 14
+ {MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 12}},
+#define MTETRIGGERTHRESHOLDDELTARISINGEVENT 15
+ {MTETRIGGERTHRESHOLDDELTARISINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 13}},
+#define MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER 16
+ {MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 14}},
+#define MTETRIGGERTHRESHOLDDELTAFALLINGEVENT 17
+ {MTETRIGGERTHRESHOLDDELTAFALLINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 15}},
+};
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+struct variable2 mteTriggerThresholdTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERTHRESHOLDSTARTUP 3
+ {MTETRIGGERTHRESHOLDSTARTUP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 1}},
+#define MTETRIGGERTHRESHOLDRISING 4
+ {MTETRIGGERTHRESHOLDRISING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 2}},
+#define MTETRIGGERTHRESHOLDFALLING 5
+ {MTETRIGGERTHRESHOLDFALLING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 3}},
+#define MTETRIGGERTHRESHOLDDELTARISING 6
+ {MTETRIGGERTHRESHOLDDELTARISING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 4}},
+#define MTETRIGGERTHRESHOLDDELTAFALLING 7
+ {MTETRIGGERTHRESHOLDDELTAFALLING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 5}},
+#define MTETRIGGERTHRESHOLDOBJECTSOWNER 8
+ {MTETRIGGERTHRESHOLDOBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 6}},
+#define MTETRIGGERTHRESHOLDOBJECTS 9
+ {MTETRIGGERTHRESHOLDOBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 7}},
+#define MTETRIGGERTHRESHOLDRISINGEVENTOWNER 10
+ {MTETRIGGERTHRESHOLDRISINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 8}},
+#define MTETRIGGERTHRESHOLDRISINGEVENT 11
+ {MTETRIGGERTHRESHOLDRISINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 9}},
+#define MTETRIGGERTHRESHOLDFALLINGEVENTOWNER 12
+ {MTETRIGGERTHRESHOLDFALLINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 10}},
+#define MTETRIGGERTHRESHOLDFALLINGEVENT 13
+ {MTETRIGGERTHRESHOLDFALLINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 11}},
+#define MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER 14
+ {MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 12}},
+#define MTETRIGGERTHRESHOLDDELTARISINGEVENT 15
+ {MTETRIGGERTHRESHOLDDELTARISINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 13}},
+#define MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER 16
+ {MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 14}},
+#define MTETRIGGERTHRESHOLDDELTAFALLINGEVENT 17
+ {MTETRIGGERTHRESHOLDDELTAFALLINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mteTriggerThresholdTable, 2, {1, 15}},
+};
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+/*
+ * (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"));
+
+ /* set default value */
+ *write_method = NULL;
+
+ /*
+ * 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdStartup;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdStartup);
+ return (u_char *) & StorageTmp->mteTriggerThresholdStartup;
+
+ case MTETRIGGERTHRESHOLDRISING:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdRising;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdRising);
+ return (u_char *) & StorageTmp->mteTriggerThresholdRising;
+
+ case MTETRIGGERTHRESHOLDFALLING:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdFalling;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdFalling);
+ return (u_char *) & StorageTmp->mteTriggerThresholdFalling;
+
+ case MTETRIGGERTHRESHOLDDELTARISING:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdDeltaRising;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdDeltaRising);
+ return (u_char *) & StorageTmp->mteTriggerThresholdDeltaRising;
+
+ case MTETRIGGERTHRESHOLDDELTAFALLING:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdDeltaFalling;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdDeltaFalling);
+ return (u_char *) & StorageTmp->mteTriggerThresholdDeltaFalling;
+
+ case MTETRIGGERTHRESHOLDOBJECTSOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdObjectsOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerThresholdObjectsOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdObjectsOwner;
+
+ case MTETRIGGERTHRESHOLDOBJECTS:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdObjects;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerThresholdObjectsLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdObjects;
+
+ case MTETRIGGERTHRESHOLDRISINGEVENTOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdRisingEventOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerThresholdRisingEventOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdRisingEventOwner;
+
+ case MTETRIGGERTHRESHOLDRISINGEVENT:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdRisingEvent;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerThresholdRisingEventLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdRisingEvent;
+
+ case MTETRIGGERTHRESHOLDFALLINGEVENTOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdFallingEventOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerThresholdFallingEventOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdFallingEventOwner;
+
+ case MTETRIGGERTHRESHOLDFALLINGEVENT:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdFallingEvent;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerThresholdFallingEventLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdFallingEvent;
+
+ case MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdDeltaRisingEventOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen;
+ return (u_char *) StorageTmp->
+ mteTriggerThresholdDeltaRisingEventOwner;
+
+ case MTETRIGGERTHRESHOLDDELTARISINGEVENT:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdDeltaRisingEvent;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerThresholdDeltaRisingEventLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdDeltaRisingEvent;
+
+ case MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdDeltaFallingEventOwner;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len =
+ StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen;
+ return (u_char *) StorageTmp->
+ mteTriggerThresholdDeltaFallingEventOwner;
+
+ case MTETRIGGERTHRESHOLDDELTAFALLINGEVENT:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_mteTriggerThresholdDeltaFallingEvent;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = StorageTmp->mteTriggerThresholdDeltaFallingEventLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdDeltaFallingEvent;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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;
+}
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
diff --git a/agent/mibgroup/disman/mteTriggerThresholdTable.h b/agent/mibgroup/disman/mteTriggerThresholdTable.h
new file mode 100644
index 0000000..8f33011
--- /dev/null
+++ b/agent/mibgroup/disman/mteTriggerThresholdTable.h
@@ -0,0 +1,48 @@
+/*
+ * 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 /* !NETSNMP_NO_WRITE_SUPPORT */
+
+#endif /* _MIBGROUP_MTETRIGGERTHRESHOLDTABLE_H */
diff --git a/agent/mibgroup/disman/nslookup-mib.h b/agent/mibgroup/disman/nslookup-mib.h
new file mode 100644
index 0000000..1c3fb1c
--- /dev/null
+++ b/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/agent/mibgroup/disman/nslookup/lookupCtlTable.c b/agent/mibgroup/disman/nslookup/lookupCtlTable.c
new file mode 100644
index 0000000..3048999
--- /dev/null
+++ b/agent/mibgroup/disman/nslookup/lookupCtlTable.c
@@ -0,0 +1,1415 @@
+/*
+ *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
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(header_complex_find_entry)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+#include <arpa/inet.h>
+#include <netdb.h>
+
+#include "lookupCtlTable.h"
+#include "lookupResultsTable.h"
+#include "header_complex.h"
+
+#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 */
+
+/*
+ *For discontinuity checking.
+ */
+
+oid lookupCtlTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 82, 1, 3 };
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct variable2 lookupCtlTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+ {COLUMN_LOOKUPCTLTARGETADDRESSTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_lookupCtlTable, 2, {1, 3}},
+ {COLUMN_LOOKUPCTLTARGETADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_lookupCtlTable, 2, {1, 4}},
+ {COLUMN_LOOKUPCTLOPERSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_lookupCtlTable, 2, {1, 5}},
+ {COLUMN_LOOKUPCTLTIME, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_lookupCtlTable, 2, {1, 6}},
+ {COLUMN_LOOKUPCTLRC, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_lookupCtlTable, 2, {1, 7}},
+ {COLUMN_LOOKUPCTLROWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_lookupCtlTable, 2, {1, 8}}
+};
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+struct variable2 lookupCtlTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+ {COLUMN_LOOKUPCTLTARGETADDRESSTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_lookupCtlTable, 2, {1, 3}},
+ {COLUMN_LOOKUPCTLTARGETADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_lookupCtlTable, 2, {1, 4}},
+ {COLUMN_LOOKUPCTLOPERSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_lookupCtlTable, 2, {1, 5}},
+ {COLUMN_LOOKUPCTLTIME, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_lookupCtlTable, 2, {1, 6}},
+ {COLUMN_LOOKUPCTLRC, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_lookupCtlTable, 2, {1, 7}},
+ {COLUMN_LOOKUPCTLROWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_lookupCtlTable, 2, {1, 8}}
+};
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+struct header_complex_index *lookupCtlTableStorage = NULL;
+struct header_complex_index *lookupResultsTableStorage = NULL;
+
+int modify_lookupCtlTime(struct lookupTable_data *thedata, unsigned long val);
+int modify_lookupCtlOperStatus(struct lookupTable_data *thedata, long val);
+int modify_lookupCtlRc(struct lookupTable_data *thedata, long val);
+
+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) {
+ snmp_log(LOG_ERR, "Out in memory in nslookup-mib/create_lookupTable_date\n");
+ 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);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ (char *) thedata->lookupCtlOperationName,
+ thedata->lookupCtlOperationNameLen);
+
+
+ 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);
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR,
+ (char *) p->lookupCtlOperationName,
+ p->lookupCtlOperationNameLen);
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED,
+ (char *) &p->lookupResultsIndex,
+ sizeof(p->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"));
+ return SNMPERR_SUCCESS;
+}
+
+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;
+ *write_method = 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_lookupCtlTargetAddressType;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->lookupCtlTargetAddressType);
+ return (u_char *) & StorageTmp->lookupCtlTargetAddressType;
+
+ case COLUMN_LOOKUPCTLTARGETADDRESS:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_lookupCtlTargetAddress;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_lookupCtlRowStatus;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ *var_len = sizeof(StorageTmp->lookupCtlRowStatus);
+ return (u_char *) & StorageTmp->lookupCtlRowStatus;
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+static struct lookupResultsTable_data *
+add_result(struct lookupTable_data *item, int index,
+ int iatype, const void *data, size_t data_len)
+{
+ struct lookupResultsTable_data *temp;
+ temp = SNMP_MALLOC_STRUCT(lookupResultsTable_data);
+ if (temp == NULL) {
+ snmp_log(LOG_ERR, "Out of memory in nslookup-mib/run_lookup\n");
+ return NULL;
+ }
+ temp->lookupResultsIndex = index;
+ temp->next = NULL;
+
+ temp->lookupCtlOwnerIndex = malloc(item->lookupCtlOwnerIndexLen + 1);
+ if (temp->lookupCtlOwnerIndex == NULL) {
+ snmp_log(LOG_ERR, "Out of memory in nslookup-mib/run_lookup\n");
+ free(temp);
+ return NULL;
+ }
+ memcpy(temp->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndexLen + 1);
+ temp->lookupCtlOwnerIndex[item->lookupCtlOwnerIndexLen] = '\0';
+ temp->lookupCtlOwnerIndexLen = item->lookupCtlOwnerIndexLen;
+
+ temp->lookupCtlOperationName = malloc(item->lookupCtlOperationNameLen + 1);
+ if (temp->lookupCtlOperationName == NULL) {
+ snmp_log(LOG_ERR, "Out of memory in nslookup-mib/run_lookup\n");
+ free(temp->lookupCtlOwnerIndex);
+ free(temp);
+ return NULL;
+ }
+ memcpy(temp->lookupCtlOperationName,
+ item->lookupCtlOperationName,
+ item->lookupCtlOperationNameLen + 1);
+ temp->lookupCtlOperationName[item->lookupCtlOperationNameLen] = '\0';
+ temp->lookupCtlOperationNameLen = item->lookupCtlOperationNameLen;
+
+ temp->lookupResultsAddressType = iatype;
+ temp->lookupResultsAddress = malloc(data_len + 1);
+ memcpy(temp->lookupResultsAddress, data, data_len);
+ temp->lookupResultsAddress[data_len] = '\0';
+ temp->lookupResultsAddressLen = data_len;
+ if (!item->ResultsTable)
+ item->ResultsTable = temp;
+
+ return temp;
+}
+
+void
+run_lookup(struct lookupTable_data *item)
+{
+ long addressType;
+ char *address = NULL;
+ size_t addresslen;
+ struct lookupResultsTable_data *current = NULL;
+ struct lookupResultsTable_data *temp = NULL;
+ int i = 0, n = 1;
+
+ struct timeval tpstart, tpend;
+ unsigned long timeuse, timeuse4 = 0, timeuse6 = 0;
+
+ 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 == INETADDRESSTYPE_IPV4) {
+ struct in_addr addr_in;
+ struct hostent *lookup;
+
+ if (!inet_aton(address, &addr_in)) {
+ DEBUGMSGTL(("lookupResultsTable", "Invalid argument: %s\n",
+ address));
+ modify_lookupCtlRc(item, 99);
+ return;
+ }
+
+ netsnmp_get_monotonic_clock(&tpstart);
+ lookup = netsnmp_gethostbyaddr(&addr_in, sizeof(addr_in), AF_INET);
+ netsnmp_get_monotonic_clock(&tpend);
+ 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, h_errno);
+ return;
+ } else {
+ modify_lookupCtlRc(item, 0L);
+ if (lookup->h_name != NULL) {
+ current = temp = add_result(item, n, INETADDRESSTYPE_DNS,
+ lookup->h_name, strlen(lookup->h_name));
+ n = n + 1;
+ }
+
+ i = 0;
+ while (lookup->h_aliases[i]) {
+ temp = add_result(item, n, INETADDRESSTYPE_DNS,
+ lookup->h_aliases[i], strlen(lookup->h_aliases[i]));
+ current->next = temp;
+ current = temp;
+ i = i + 1;
+ n = n + 1;
+ }
+ }
+
+ if (item->ResultsTable != NULL)
+ if (lookupResultsTable_add(item) != SNMPERR_SUCCESS)
+ DEBUGMSGTL(("lookupResultsTable",
+ "registered an entry error\n"));
+ SNMP_FREE(address);
+ return;
+ }
+
+ else if (addressType == INETADDRESSTYPE_DNS) {
+ struct hostent *lookup;
+#if HAVE_GETADDRINFO
+ int res;
+ struct addrinfo *ais;
+ struct addrinfo hints = { 0, AF_INET6, SOCK_DGRAM };
+#endif
+
+ netsnmp_get_monotonic_clock(&tpstart);
+ lookup = netsnmp_gethostbyname(address);
+ netsnmp_get_monotonic_clock(&tpend);
+ timeuse4 = 1000000 * (tpend.tv_sec - tpstart.tv_sec) +
+ tpend.tv_usec - tpstart.tv_usec;
+ if (lookup == NULL) {
+ DEBUGMSGTL(("lookupCtlTable",
+ "Can't get a network host entry for %s\n",
+ address));
+ modify_lookupCtlRc(item, h_errno);
+ } else {
+ while (lookup->h_addr_list[i]) {
+ char buf[64];
+ int buflen;
+
+ inet_ntop(lookup->h_addrtype, lookup->h_addr_list[i], buf, sizeof(buf));
+ buflen = strlen(buf);
+ switch (lookup->h_addrtype) {
+ case AF_INET:
+ temp = add_result(item, n, INETADDRESSTYPE_IPV4, buf, buflen);
+ break;
+ case AF_INET6:
+ temp = add_result(item, n, INETADDRESSTYPE_IPV6, buf, buflen);
+ break;
+ default:
+ snmp_log(LOG_ERR, "nslookup-mib/run_lookup: Unknown address type %d\n", lookup->h_addrtype);
+ temp = add_result(item, n, INETADDRESSTYPE_UNKNOWN, "", 0);
+ break;
+ }
+ DEBUGMSGTL(("lookupCtlTable", "Adding %d %s\n", n, buf));
+
+ if (n == 1)
+ item->ResultsTable = temp;
+ else
+ current->next = temp;
+ current = temp;
+ n = n + 1;
+ i = i + 1;
+ }
+ }
+
+#if HAVE_GETADDRINFO
+ netsnmp_get_monotonic_clock(&tpstart);
+ res = netsnmp_getaddrinfo(address, NULL, &hints, &ais);
+ netsnmp_get_monotonic_clock(&tpend);
+ timeuse6 = 1000000 * (tpend.tv_sec - tpstart.tv_sec) +
+ tpend.tv_usec - tpstart.tv_usec;
+
+ if (res != 0) {
+ DEBUGMSGTL(("lookupCtlTable",
+ "Can't get a ipv6 network host entry for %s\n",
+ address));
+ modify_lookupCtlRc(item, res);
+ } else {
+ struct addrinfo *aip = ais;
+ while (aip) {
+ char buf[64];
+ int buflen;
+
+ switch (aip->ai_family) {
+ case AF_INET:
+ inet_ntop(aip->ai_family,
+ &((struct sockaddr_in *)aip->ai_addr)->sin_addr,
+ buf, sizeof(buf));
+ buflen = strlen(buf);
+ temp = add_result(item, n, INETADDRESSTYPE_IPV4, buf, buflen);
+ break;
+ case AF_INET6:
+ inet_ntop(aip->ai_family,
+ &((struct sockaddr_in6 *)aip->ai_addr)->sin6_addr,
+ buf, sizeof(buf));
+ buflen = strlen(buf);
+ temp = add_result(item, n, INETADDRESSTYPE_IPV6, buf, buflen);
+ break;
+ default:
+ snmp_log(LOG_ERR, "nslookup-mib/run_lookup: Unknown address type %d\n", aip->ai_family);
+ temp = add_result(item, n, INETADDRESSTYPE_UNKNOWN, "", 0);
+ break;
+ }
+ DEBUGMSGTL(("lookupCtlTable", "Adding %d %s\n", n, buf));
+
+ if (n == 1)
+ item->ResultsTable = temp;
+ else
+ current->next = temp;
+ current = temp;
+ n = n + 1;
+ aip = aip->ai_next;
+ }
+ freeaddrinfo(ais);
+ }
+#elif HAVE_GETHOSTBYNAME2
+ netsnmp_get_monotonic_clock(&tpstart);
+ lookup = gethostbyname2(address, AF_INET6);
+ netsnmp_get_monotonic_clock(&tpend);
+ timeuse6 = 1000000 * (tpend.tv_sec - tpstart.tv_sec) +
+ tpend.tv_usec - tpstart.tv_usec;
+
+ if (lookup == NULL) {
+ DEBUGMSGTL(("lookupCtlTable",
+ "Can't get a ipv6 network host entry for %s\n",
+ address));
+ modify_lookupCtlRc(item, h_errno);
+ } else {
+ i = 0;
+ while (lookup->h_addr_list[i]) {
+ char buf[64];
+ int buflen;
+
+ inet_ntop(lookup->h_addrtype, lookup->h_addr_list[i],
+ buf, sizeof(buf));
+ buflen = strlen(buf);
+ switch (lookup->h_addrtype) {
+ case AF_INET:
+ temp = add_result(item, n, INETADDRESSTYPE_IPV4, buf, buflen);
+ break;
+ case AF_INET6:
+ temp = add_result(item, n, INETADDRESSTYPE_IPV6, buf, buflen);
+ break;
+ default:
+ snmp_log(LOG_ERR, "nslookup-mib/run_lookup: Unknown address type %d\n", lookup->h_addrtype);
+ temp = add_result(item, n, INETADDRESSTYPE_UNKNOWN, "", 0);
+ break;
+ }
+ DEBUGMSGTL(("lookupCtlTable", "Adding %d %s\n", n, buf));
+
+ if (n == 1)
+ item->ResultsTable = temp;
+ else
+ current->next = temp;
+ current = temp;
+ n = n + 1;
+ i = i + 1;
+ }
+ }
+#endif
+
+ timeuse = timeuse4 + timeuse6;
+ timeuse /= 1000;
+ 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"));
+ }
+ SNMP_FREE(address);
+ return;
+ }
+
+ else if (addressType == INETADDRESSTYPE_IPV6) {
+ struct in6_addr addr_in6;
+ struct hostent *lookup;
+
+ if (inet_pton(AF_INET6, address, &addr_in6) == 1)
+ DEBUGMSGTL(("lookupCtlTable", "success! \n"));
+ else
+ DEBUGMSGTL(("lookupCtlTable", "error! \n"));
+
+ netsnmp_get_monotonic_clock(&tpstart);
+ lookup = netsnmp_gethostbyaddr(&addr_in6, sizeof(addr_in6), AF_INET6);
+ netsnmp_get_monotonic_clock(&tpend);
+ 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, h_errno);
+ return;
+ } else {
+ modify_lookupCtlRc(item, 0L);
+ if (lookup->h_name != NULL) {
+ current = temp = add_result(item, n, INETADDRESSTYPE_DNS,
+ lookup->h_name, strlen(lookup->h_name));
+ n = n + 1;
+ }
+
+ i = 0;
+ while (lookup->h_aliases[i]) {
+ current = temp = add_result(item, n, INETADDRESSTYPE_DNS,
+ lookup->h_aliases[i], 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);
+ return;
+ } else {
+ SNMP_FREE(address);
+ 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);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ (char *) thedata->lookupCtlOperationName,
+ thedata->lookupCtlOperationNameLen);
+
+
+ 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);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ (char *) thedata->lookupCtlOperationName,
+ thedata->lookupCtlOperationNameLen);
+
+
+ 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);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ (char *) thedata->lookupCtlOperationName,
+ thedata->lookupCtlOperationNameLen);
+
+
+ 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);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ (char *) thedata->lookupCtlOperationName,
+ thedata->lookupCtlOperationNameLen);
+ memset(newoid, '\0', 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;
+}
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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;
+ 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!
+ */
+
+ /** set up to save persistent store */
+ snmp_store_needed(NULL);
+
+ 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) {
+ snmp_log(LOG_ERR, "Out of memory in nslookup-mib/write_lookupCtlTargetAddress\n");
+ 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;
+
+ /** set up to save persistent store */
+ snmp_store_needed(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 = NULL, *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 = INETADDRESSTYPE_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)
+ DEBUGMSGTL(("lookupCtlTable",
+ "write_lookupCtlRowStatus entering new=%d... \n",
+ action));
+ 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);
+ SNMP_FREE(StorageDel->lookupCtlOperationName);
+ SNMP_FREE(StorageDel->lookupCtlTargetAddress);
+ SNMP_FREE(StorageDel);
+ /*
+ * 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) {
+ DEBUGMSGTL(("lookupCtlTable",
+ "write_lookupCtlRowStatus entering runbefore=%ld... \n",
+ StorageTmp->lookupCtlTargetAddressType));
+
+ modify_lookupCtlOperStatus(StorageTmp, 2L);
+ run_lookup((struct lookupTable_data *) StorageTmp);
+
+ }
+
+ /** set up to save persistent store */
+ snmp_store_needed(NULL);
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
diff --git a/agent/mibgroup/disman/nslookup/lookupCtlTable.h b/agent/mibgroup/disman/nslookup/lookupCtlTable.h
new file mode 100644
index 0000000..085b25b
--- /dev/null
+++ b/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;
+};
+
+
+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;
+};
+
+/*
+ * function declarations
+ */
+void init_lookupCtlTable(void);
+FindVarMethod var_lookupCtlTable;
+void parse_lookupCtlTable(const char *, char *);
+SNMPCallback store_lookupCtlTable;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+WriteMethod write_lookupCtlTargetAddressType;
+WriteMethod write_lookupCtlTargetAddress;
+WriteMethod write_lookupCtlRowStatus;
+
+WriteMethod write_lookupCtlRowStatus;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * 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/agent/mibgroup/disman/nslookup/lookupResultsTable.c b/agent/mibgroup/disman/nslookup/lookupResultsTable.c
new file mode 100644
index 0000000..d6a937c
--- /dev/null
+++ b/agent/mibgroup/disman/nslookup/lookupResultsTable.c
@@ -0,0 +1,306 @@
+/*
+ *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
+ */
+
+#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, NETSNMP_OLDAPI_RONLY,
+ var_lookupResultsTable, 2, {1, 2}},
+ {COLUMN_LOOKUPRESULTSADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_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;
+
+int
+lookupResultsTable_inadd(struct lookupResultsTable_data *thedata);
+
+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);
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR,
+ (char *) thedata->lookupCtlOperationName,
+ thedata->lookupCtlOperationNameLen);
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED,
+ (char *) &thedata->lookupResultsIndex,
+ sizeof(thedata->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/agent/mibgroup/disman/nslookup/lookupResultsTable.h b/agent/mibgroup/disman/nslookup/lookupResultsTable.h
new file mode 100644
index 0000000..4abfb11
--- /dev/null
+++ b/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/agent/mibgroup/disman/old-event-mib.h b/agent/mibgroup/disman/old-event-mib.h
new file mode 100644
index 0000000..71ef1f5
--- /dev/null
+++ b/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/agent/mibgroup/disman/ping-mib.h b/agent/mibgroup/disman/ping-mib.h
new file mode 100644
index 0000000..640b37f
--- /dev/null
+++ b/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/agent/mibgroup/disman/ping/pingCtlTable.c b/agent/mibgroup/disman/ping/pingCtlTable.c
new file mode 100644
index 0000000..b9add8f
--- /dev/null
+++ b/agent/mibgroup/disman/ping/pingCtlTable.c
@@ -0,0 +1,5829 @@
+/*
+ *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
+ */
+
+#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
+#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 "pingCtlTable.h"
+#include "pingResultsTable.h"
+#include "pingProbeHistoryTable.h"
+#include "header_complex.h"
+
+static inline void tvsub(struct timeval *, struct timeval *);
+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 inline void update_interval(int, int, int *, int *);
+static long llsqrt(long long);
+static __inline__ int ipv6_addr_any(struct in6_addr *);
+static char *pr_addr(struct in6_addr *, int);
+static char *pr_addr_n(struct in6_addr *);
+void pingCtlTable_cleaner(struct header_complex_index *thestuff);
+
+/*
+ *pingCtlTable_variables_oid:
+ *
+ */
+
+
+oid pingCtlTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 2 };
+static const int pingCtlTable_variables_oid_len = sizeof(pingCtlTable_variables_oid)/sizeof(pingCtlTable_variables_oid[0]);
+
+/* 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, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 3}},
+ {COLUMN_PINGCTLTARGETADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 4}},
+ {COLUMN_PINGCTLDATASIZE, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_pingCtlTable, 2, {1, 5}},
+ {COLUMN_PINGCTLTIMEOUT, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_pingCtlTable, 2, {1, 6}},
+ {COLUMN_PINGCTLPROBECOUNT, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_pingCtlTable, 2, {1, 7}},
+ {COLUMN_PINGCTLADMINSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 8}},
+ {COLUMN_PINGCTLDATAFILL, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 9}},
+ {COLUMN_PINGCTLFREQUENCY, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 10}},
+ {COLUMN_PINGCTLMAXROWS, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 11}},
+ {COLUMN_PINGCTLSTORAGETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 12}},
+ {COLUMN_PINGCTLTRAPGENERATION, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 13}},
+ {COLUMN_PINGCTLTRAPPROBEFAILUREFILTER, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 14}},
+ {COLUMN_PINGCTLTRAPTESTFAILUREFILTER, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 15}},
+ {COLUMN_PINGCTLTYPE, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 16}},
+ {COLUMN_PINGCTLDESCR, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 17}},
+ {COLUMN_PINGCTLSOURCEADDRESSTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 18}},
+ {COLUMN_PINGCTLSOURCEADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 19}},
+ {COLUMN_PINGCTLIFINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 20}},
+ {COLUMN_PINGCTLBYPASSROUTETABLE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 21}},
+ {COLUMN_PINGCTLDSFIELD, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_pingCtlTable, 2, {1, 22}},
+ {COLUMN_PINGCTLROWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_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"));
+}
+
+void shutdown_pingCtlTable(void)
+{
+ snmp_unregister_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_pingCtlTable, NULL, 1);
+ snmpd_unregister_config_handler("pingCtlTable");
+ unregister_mib(pingCtlTable_variables_oid, pingCtlTable_variables_oid_len);
+ pingCtlTable_cleaner(pingCtlTableStorage);
+ pingCtlTableStorage = NULL;
+}
+
+struct pingCtlTable_data *
+create_pingCtlTable_data(void)
+{
+ struct pingCtlTable_data *StorageNew = NULL;
+
+ StorageNew = SNMP_MALLOC_STRUCT(pingCtlTable_data);
+ if (StorageNew == NULL)
+ return NULL;
+ StorageNew->pingCtlTargetAddressType = 1;
+ StorageNew->pingCtlTargetAddress = strdup("");
+ StorageNew->pingCtlTargetAddressLen = 0;
+ StorageNew->pingCtlDataSize = 0;
+ StorageNew->pingCtlTimeOut = 3;
+ StorageNew->pingCtlProbeCount = 1;
+ StorageNew->pingCtlAdminStatus = 2;
+ StorageNew->pingCtlDataFill = strdup("00");
+ if (StorageNew->pingCtlDataFill == NULL) {
+ free(StorageNew);
+ return NULL;
+ }
+ StorageNew->pingCtlDataFillLen = strlen(StorageNew->pingCtlDataFill);
+ StorageNew->pingCtlFrequency = 0;
+ StorageNew->pingCtlMaxRows = 50;
+ StorageNew->pingCtlStorageType = 1;
+ StorageNew->pingCtlTrapGeneration = strdup("");
+ 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;
+}
+
+static void free_pingCtlTable_data(struct pingCtlTable_data *StorageDel)
+{
+ netsnmp_assert(StorageDel);
+ free(StorageDel->pingCtlOwnerIndex);
+ free(StorageDel->pingCtlTestName);
+ free(StorageDel->pingCtlTargetAddress);
+ free(StorageDel->pingCtlDataFill);
+ free(StorageDel->pingCtlTrapGeneration);
+ free(StorageDel->pingCtlType);
+ free(StorageDel->pingCtlDescr);
+ free(StorageDel->pingCtlSourceAddress);
+ free(StorageDel);
+}
+
+/*
+ * 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,
+ thedata->pingCtlOwnerIndex,
+ thedata->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ thedata->pingCtlTestName,
+ thedata->pingCtlTestNameLen);
+ header_complex_add_data(&pingCtlTableStorage, vars, thedata);
+
+ DEBUGMSGTL(("pingCtlTable", "registered an entry\n"));
+
+ return SNMPERR_SUCCESS;
+}
+
+int
+pingResultsTable_add(struct pingCtlTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+ struct pingResultsTable_data *p;
+
+ p = thedata->pingResults;
+ if (thedata->pingResults != NULL) {
+
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR,
+ p->pingCtlOwnerIndex,
+ p->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR,
+ p->pingCtlTestName, p->pingCtlTestNameLen);
+
+ /*
+ * 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"));
+
+ }
+
+ 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,
+ thedata->pingCtlOwnerIndex,
+ thedata->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR,
+ thedata->pingCtlTestName,
+ thedata->pingCtlTestNameLen);
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED,
+ &thedata->pingProbeHistoryIndex,
+ sizeof(thedata->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"));
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+int
+pingProbeHistoryTable_addall(struct pingCtlTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list;
+ struct pingProbeHistoryTable_data *p;
+
+ for (p = thedata->pingProbeHis; p; p = p->next) {
+ vars_list = NULL;
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR,
+ p->pingCtlOwnerIndex,
+ p->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR,
+ p->pingCtlTestName,
+ p->pingCtlTestNameLen);
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED,
+ &p->pingProbeHistoryIndex,
+ sizeof(p->pingProbeHistoryIndex));
+ header_complex_add_data(&pingProbeHistoryTableStorage, vars_list, p);
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+void
+pingCtlTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr, *next;
+ struct pingCtlTable_data *StorageDel;
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr; hciptr = next) {
+ next = hciptr->next;
+ StorageDel = header_complex_extract_entry(&pingCtlTableStorage, hciptr);
+ free_pingCtlTable_data(StorageDel);
+ 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,
+ thedata->pingCtlOwnerIndex,
+ thedata->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ thedata->pingCtlTestName,
+ thedata->pingCtlTestNameLen);
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+ snmp_free_varbind(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;
+}
+
+
+void
+pingProbeHistoryTable_delLast(struct pingCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ struct header_complex_index *hcilast = NULL;
+ struct pingProbeHistoryTable_data *StorageTmp, *StorageDel;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+ time_t last_time = 2147483647;
+ time_t tp;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ thedata->pingCtlOwnerIndex,
+ thedata->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ thedata->pingCtlTestName,
+ thedata->pingCtlTestNameLen);
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+ snmp_free_varbind(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);
+ tp = StorageTmp->pingProbeHistoryTime_time;
+
+ if (last_time > tp) {
+ last_time = tp;
+ hcilast = hciptr2;
+ }
+
+ }
+ }
+ StorageDel =
+ header_complex_extract_entry(&pingProbeHistoryTableStorage, hcilast);
+ for (hciptr2 = pingCtlTableStorage; hciptr2; hciptr2 = hciptr2->next) {
+ struct pingCtlTable_data *tmp;
+
+ tmp = hciptr2->data;
+ if (tmp->pingProbeHis == StorageDel) {
+ tmp->pingProbeHis = tmp->pingProbeHis->next;
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "deleting the last one succeeded!\n"));
+ break;
+ }
+ }
+ if (StorageDel) {
+ free(StorageDel->pingProbeHistoryTime);
+ free(StorageDel->pingCtlTestName);
+ free(StorageDel->pingCtlOwnerIndex);
+ free(StorageDel);
+ }
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "delete the last one success!\n"));
+}
+
+
+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:{
+ const struct sockaddr_in *sin = (const 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:{
+ const struct sockaddr_in6 *sin6 = (const 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:{
+ const struct sockaddr_un *unp = (const 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) {
+ /* inet_ntop() sets errno */
+ snmp_log_perror("pingCtlTable: sock_ntop_host()");
+ }
+ 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;
+
+ memset(&hints, '\0', 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 = netsnmp_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;
+
+ memset(&hints, '\0', 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 = netsnmp_getaddrinfo(host, serv, &hints, &res)) != 0) {
+#if HAVE_GAI_STRERROR
+ snmp_log(LOG_ERR, "host_serv error for %s, %s: %s",
+ (host == NULL) ? "(no hostname)" : host,
+ (serv == NULL) ? "(no service name)" : serv,
+ gai_strerror(n));
+#else
+ snmp_log(LOG_ERR, "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
+ */
+void
+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,
+ item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ item->pingCtlTestName,
+ item->pingCtlTestNameLen);
+ StorageTmp = header_complex_get(pingResultsTableStorage, vars);
+ snmp_free_varbind(vars);
+ if (!StorageTmp)
+ return;
+
+ /*
+ * 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
+ */
+ memset(newoid, '\0', 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
+ */
+ memset(newoid, '\0', 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
+ */
+ memset(newoid, '\0', 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
+ */
+ memset(newoid, '\0', 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
+ */
+ memset(newoid, '\0', 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
+ */
+ memset(newoid, '\0', 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)
+{
+ 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 select_result;
+ int current_probe_temp;
+ int success_probe = 0;
+ int fail_probe = 0;
+ int flag;
+ unsigned long sumrtt;
+ struct timeval tv;
+
+ memset(sendbuf, 0, sizeof(sendbuf));
+
+ sockfd = socket(pr->sasend->sa_family, SOCK_RAW, pr->icmpproto);
+ if (sockfd < 0) {
+ snmp_log_perror("pingCtlTable: failed to create socket");
+ return;
+ }
+ setuid(getuid()); /* don't need special permissions any more */
+
+ 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++) {
+ time_t timep;
+ (*pr->fsend) (datalen, pid, nsent, sockfd, sendbuf);
+ nsent++;
+ len = pr->salen;
+ select_result = readable_timeo(sockfd, item->pingCtlTimeOut);
+ do {
+ if (select_result == 0) {
+ DEBUGMSGTL(("pingCtlTable", "socket timeout\n"));
+ n = -1;
+ 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;
+ }
+
+ netsnmp_get_monotonic_clock(&tval);
+
+ 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);
+ select_result = readable_timeo(sockfd, 0);
+ } while (select_result > 0);
+ }
+ close(sockfd);
+}
+
+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;
+
+ DEBUGMSGTL(("pingCtlTable", "proc_v4(flag = %d)\n", flag));
+
+ 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)
+ DEBUGMSGTL(("pingCtlTable", "icmplen (%d) < 8", icmplen));
+
+ DEBUGMSGTL(("pingCtlTable", "ICMP type = %d (%sa reply)\n",
+ icmp->icmp_type,
+ icmp->icmp_type == ICMP_ECHOREPLY ? "" : "not a "));
+
+ if (icmp->icmp_type == ICMP_ECHOREPLY) {
+ if (icmp->icmp_id != pid) {
+ DEBUGMSGTL(("pingCtlTable", "not a response to our ECHO_REQUEST\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ if (icmplen < 16)
+ DEBUGMSGTL(("pingCtlTable", "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,
+ item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ item->pingCtlTestName,
+ item->pingCtlTestNameLen);
+
+ StorageNew = header_complex_get(pingResultsTableStorage, vars);
+ snmp_free_varbind(vars);
+ if (!StorageNew) {
+ DEBUGMSGTL(("pingCtlTable", "StorageNew == NULL\n"));
+ return SNMP_ERR_NOSUCHNAME;
+ }
+
+ if (current_probe == 1) {
+ *averagertt = rtt;
+ *minrtt = rtt;
+ *maxrtt = rtt;
+ *sumrtt = rtt;
+ } else {
+ 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_time = timep;
+ free(StorageNew->pingResultsLastGoodProbe);
+ memdup(&StorageNew->pingResultsLastGoodProbe,
+ date_n_time(&timep,
+ &StorageNew->pingResultsLastGoodProbeLen), 11);
+
+ 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_time = timep;
+ memdup(&temp->pingProbeHistoryTime,
+ date_n_time(&timep, &temp->pingProbeHistoryTimeLen), 11);
+
+ 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)
+ pingProbeHistoryTable_delLast(item);
+ if (pingProbeHistoryTable_add(current_temp) != SNMPERR_SUCCESS)
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "failed to add a row\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,
+ item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ item->pingCtlTestName,
+ item->pingCtlTestNameLen);
+
+ StorageNew = header_complex_get(pingResultsTableStorage, vars);
+ snmp_free_varbind(vars);
+ if (!StorageNew)
+ 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_time = timep;
+ memdup(&temp->pingProbeHistoryTime,
+ date_n_time(&timep, &temp->pingProbeHistoryTimeLen), 11);
+
+ 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 SNMP_ERR_NOERROR;
+}
+
+
+
+void
+send_v4(int datalen, pid_t pid, int nsent, int sockfd, char *sendbuf)
+{
+ int len;
+ struct icmp *icmp = NULL;
+
+ icmp = (struct icmp *) sendbuf;
+ icmp->icmp_type = ICMP_ECHO;
+ icmp->icmp_code = 0;
+ icmp->icmp_id = pid;
+ icmp->icmp_seq = nsent;
+ netsnmp_get_monotonic_clock((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,
+ item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ item->pingCtlTestName, item->pingCtlTestNameLen);
+
+ StorageNew = header_complex_get(pingResultsTableStorage, vars);
+ snmp_free_varbind(vars);
+ if (!StorageNew)
+ 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 */
+ 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);
+
+ if (ai) {
+ DEBUGMSGTL(("pingCtlTable", "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)))
+ snmp_log(LOG_ERR, "cannot ping IPv4-mapped IPv6 address");
+#endif
+ } else {
+ snmp_log(LOG_ERR, "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);
+ free(pr->sarecv);
+ } else {
+ snmp_log(LOG_ERR, "PING: name resolution for %s failed.\n", host);
+ }
+
+ SNMP_FREE(minrtt);
+ SNMP_FREE(maxrtt);
+ SNMP_FREE(averagertt);
+ freeaddrinfo(ai);
+ }
+
+ else if (item->pingCtlTargetAddressType == 2) {
+
+ int 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;
+ 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;
+
+ 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)) {
+ socklen_t alen;
+ int probe_fd = socket(AF_INET6, SOCK_DGRAM, 0);
+
+ if (probe_fd < 0) {
+ snmp_log_perror("pingCtlTable: IPv6 datagram socket creation");
+ return;
+ }
+ if (device) {
+ struct ifreq ifr;
+ memset(&ifr, 0, sizeof(ifr));
+ strlcpy(ifr.ifr_name, device, IFNAMSIZ);
+ 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);
+ close(probe_fd);
+ 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");
+ close(probe_fd);
+ return;
+ }
+ alen = sizeof(source);
+ if (getsockname(probe_fd, (struct sockaddr *) &source, &alen)
+ == -1) {
+ perror("getsockname");
+ close(probe_fd);
+ 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(ICMP6_DST_UNREACH, &filter);
+ ICMPV6_FILTER_SETPASS(ICMP6_PACKET_TOO_BIG, &filter);
+ ICMPV6_FILTER_SETPASS(ICMP6_TIME_EXCEEDED, &filter);
+ ICMPV6_FILTER_SETPASS(ICMP6_PARAM_PROB, &filter);
+ }
+
+ ICMPV6_FILTER_SETPASS(ICMP6_ECHO_REPLY, &filter);
+
+ err = setsockopt(icmp_sock, SOL_ICMPV6, ICMP6_FILTER, &filter,
+ sizeof(struct icmp6_filter));
+
+ if (err < 0) {
+ perror("setsockopt(ICMP6_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;
+ }
+ }
+
+ DEBUGMSGTL(("pingCtlTable", "PING %s(%s) ", hostname,
+ pr_addr(&whereto.sin6_addr, options)));
+ if (flowlabel)
+ DEBUGMSGTL(("pingCtlTable", ", flow 0x%05x, ",
+ (unsigned) ntohl(flowlabel)));
+ if (device || (options & F_NUMERIC)) {
+ DEBUGMSGTL(("pingCtlTable", "from %s %s: ",
+ pr_addr_n(&source.sin6_addr), device ? : ""));
+ }
+ DEBUGMSGTL(("pingCtlTable", "%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);
+
+ close(icmp_sock);
+ }
+ 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,
+ item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ item->pingCtlTestName, item->pingCtlTestNameLen);
+
+ StorageNew = header_complex_get(pingResultsTableStorage, vars);
+ snmp_free_varbind(vars);
+ if (StorageNew) {
+ StorageNew->pingResultsSendProbes = 0;
+ StorageNew->pingResultsProbeResponses = 0;
+ return;
+ }
+
+ 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) {
+ const char* str;
+
+ StorageTmp->pingResultsIpTargetAddressType = ai ? 1 : 0;
+ str = ai ? sock_ntop_host(ai->ai_addr, ai->ai_addrlen) : NULL;
+ if (!str)
+ str = "";
+ StorageTmp->pingResultsIpTargetAddress = strdup(str);
+ StorageTmp->pingResultsIpTargetAddressLen = strlen(str);
+ }
+ 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 = strdup(host);
+ 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 = strdup(hostname);
+ 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->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"));
+ }
+ }
+ }
+ freeaddrinfo(ai);
+}
+
+
+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,
+ thedata->pingCtlOwnerIndex,
+ thedata->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ thedata->pingCtlTestName,
+ thedata->pingCtlTestNameLen);
+
+ StorageTmp = header_complex_get(pingResultsTableStorage, vars);
+ snmp_free_varbind(vars);
+ if (!StorageTmp)
+ 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, *next;
+ 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,
+ thedata->pingCtlOwnerIndex,
+ thedata->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ thedata->pingCtlTestName,
+ thedata->pingCtlTestNameLen);
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+ snmp_free_varbind(vars);
+
+ for (hciptr2 = pingResultsTableStorage; hciptr2; hciptr2 = next) {
+ next = 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, *next;
+ 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,
+ thedata->pingCtlOwnerIndex,
+ thedata->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ thedata->pingCtlTestName,
+ thedata->pingCtlTestNameLen);
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+ snmp_free_varbind(vars);
+
+ for (hciptr2 = pingProbeHistoryTableStorage; hciptr2; hciptr2 = next) {
+ next = 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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, 0, 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);
+ }
+
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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;
+ 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) {
+ netsnmp_variable_list *vars, *vp;
+
+ 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) {
+ snmp_free_varbind(vars);
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ vp = vars;
+
+ StorageNew = create_pingCtlTable_data();
+ if (!StorageNew)
+ return SNMP_ERR_GENERR;
+ 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;
+
+
+ snmp_free_varbind(vars);
+ }
+
+
+ break;
+
+
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+
+ if (set_value == RS_DESTROY && StorageNew)
+ free_pingCtlTable_data(StorageNew);
+ StorageNew = NULL;
+
+ if (StorageDel) {
+ free_pingCtlTable_data(StorageDel);
+ StorageDel = 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) {
+ 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);
+ free_pingCtlTable_data(StorageDel);
+ StorageDel = NULL;
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ pingCtlTable_add(StorageDel);
+ pingResultsTable_add(StorageDel);
+ pingProbeHistoryTable_addall(StorageDel);
+ StorageDel = NULL;
+ } 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) {
+ free_pingCtlTable_data(StorageDel);
+ StorageDel = NULL;
+ } 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, 0, run_ping, StorageTmp);
+
+ }
+
+ }
+ snmp_store_needed(NULL);
+
+ 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;
+#if 0
+ struct itimerval it;
+#endif
+
+ if (*nreceived) {
+ waittime = 2 * (*tmax);
+ if (waittime < 1000000)
+ waittime = 1000000;
+ } else
+ waittime = MAXWAIT * 1000000;
+
+ if (next < 0 || next < waittime / 1000)
+ next = waittime / 1000;
+
+#if 0
+ 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);
+#endif
+ 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) {
+ netsnmp_get_monotonic_clock(cur_time);
+ tokens = interval * (preload - 1);
+ } else {
+ long ntokens;
+ struct timeval tv;
+
+ netsnmp_get_monotonic_clock(&tv);
+ 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;
+ socklen_t 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;
+
+ netsnmp_get_monotonic_clock(start_time);
+
+#if 0
+ 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;
+ }
+#endif
+
+ 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) {
+ DEBUGMSGTL(("pingCtlTable", "npackets,nreceived=%ld\n", nreceived));
+ break;
+ }
+ if (deadline && nerrors) {
+ DEBUGMSGTL(("pingCtlTable", "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 {
+ DEBUGMSGTL(("pingCtlTable", "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);
+ DEBUGMSGTL(("pingCtlTable", "1:next=%d\n", next));
+ next =
+ schedule_exit(next, deadline, &npackets, &nreceived,
+ &ntransmitted, &tmax);
+ DEBUGMSGTL(("pingCtlTable", "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,
+ item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ item->pingCtlTestName,
+ item->pingCtlTestNameLen);
+
+ StorageNew = header_complex_get(pingResultsTableStorage,
+ vars);
+ snmp_free_varbind(vars);
+ if (!StorageNew)
+ 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_time = timep;
+ memdup(&temp->pingProbeHistoryTime,
+ date_n_time(&timep, &temp->pingProbeHistoryTimeLen), 11);
+
+ 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 {
+ DEBUGMSGTL(("pingCtlTable", "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))
+ netsnmp_get_monotonic_clock(&recv_time);
+ 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));
+
+ tvsub(tv, &tmp_tv);
+ triptime = tv->tv_sec * 1000000 + tv->tv_usec;
+ if (triptime < 0) {
+ snmp_log(LOG_INFO,
+ "Warning: invalid timestamp in ICMP response.\n");
+ triptime = 0;
+ if (!(options & F_LATENCY))
+ options |= F_LATENCY;
+ }
+ 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;
+
+ DEBUGMSGTL(("pingCtlTable", "%d bytes from %s: icmp_seq=%u", cc, from,
+ seq));
+
+ if (hops >= 0)
+ DEBUGMSGTL(("pingCtlTable", " ttl=%d", hops));
+
+ if (cc < datalen + 8) {
+ DEBUGMSGTL(("pingCtlTable", " (truncated)\n"));
+ return 1;
+ }
+ if (timing) {
+ if (triptime >= 100000)
+ DEBUGMSGTL(("pingCtlTable", " time=%ld ms", triptime / 1000));
+ else if (triptime >= 10000)
+ DEBUGMSGTL(("pingCtlTable", " time=%ld.%01ld ms",
+ triptime / 1000, (triptime % 1000) / 100));
+ else if (triptime >= 1000)
+ DEBUGMSGTL(("pingCtlTable", " time=%ld.%02ld ms",
+ triptime / 1000, (triptime % 1000) / 10));
+ else
+ DEBUGMSGTL(("pingCtlTable", " time=%ld.%03ld ms",
+ triptime / 1000, triptime % 1000));
+ }
+ if (dupflag)
+ DEBUGMSGTL(("pingCtlTable", " (DUP!)"));
+ if (csfailed)
+ DEBUGMSGTL(("pingCtlTable", " (BAD CHECKSUM!)"));
+
+ /*
+ * check the data
+ */
+ cp = ((u_char *) ptr) + sizeof(struct timeval);
+ dp = (u_char *)&outpack[8 + sizeof(struct timeval)];
+ for (i = sizeof(struct timeval); i < datalen; ++i, ++cp, ++dp) {
+ if (*cp != *dp) {
+ DEBUGMSGTL(("pingCtlTable",
+ "\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))
+ DEBUGMSGTL(("pingCtlTable", "\n#%d\t", i));
+ DEBUGMSGTL(("pingCtlTable", "%x ", *cp));
+ }
+ break;
+ }
+ }
+ }
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR,
+ item->pingCtlTestName,
+ item->pingCtlTestNameLen);
+
+ StorageNew = header_complex_get(pingResultsTableStorage, vars);
+ snmp_free_varbind(vars);
+ if (!StorageNew)
+ 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_time = timep;
+ free(StorageNew->pingResultsLastGoodProbe);
+ memdup(&StorageNew->pingResultsLastGoodProbe,
+ date_n_time(&timep, &StorageNew->pingResultsLastGoodProbeLen), 11);
+
+ /* 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_time = timep;
+ memdup(&temp->pingProbeHistoryTime,
+ date_n_time(&timep, &temp->pingProbeHistoryTimeLen), 11);
+
+ 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);
+ DEBUGMSGTL(("pingCtlTable", "--- %s ping statistics ---\n", hostname));
+
+ if (*nrepeats)
+ DEBUGMSGTL(("pingCtlTable", ", +%ld duplicates", *nrepeats));
+ if (*nchecksum)
+ DEBUGMSGTL(("pingCtlTable", ", +%ld corrupted", *nchecksum));
+ if (*nerrors)
+ DEBUGMSGTL(("pingCtlTable", ", +%ld errors", *nerrors));
+ if (*ntransmitted) {
+ DEBUGMSGTL(("pingCtlTable", ", %d%% loss",
+ (int) ((((long long) ((*ntransmitted) -
+ (*nreceived))) * 100) /
+ (*ntransmitted))));
+ DEBUGMSGTL(("pingCtlTable", ", 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));
+
+ DEBUGMSGTL(("pingCtlTable", "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)
+ DEBUGMSGTL(("pingCtlTable", ", 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);
+ DEBUGMSGTL(("pingCtlTable", ", 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);
+
+ DEBUGMSGTL(("pingCtlTable", "\n%ld/%ld packets, %d%% loss", *ntransmitted,
+ *nreceived, loss));
+
+ if ((*nreceived) && timing) {
+ tavg = (*tsum) / ((*nreceived) + (*nrepeats));
+
+ DEBUGMSGTL(("pingCtlTable", ", 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));
+ }
+ DEBUGMSGTL(("pingCtlTable", "\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 icmp6_hdr 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)
+ snmp_log(LOG_ERR, "ping: local error: %s\n", strerror(e->ee_errno));
+ else
+ snmp_log(LOG_ERR, "ping: local error: Message too long, mtu=%u\n",
+ e->ee_info);
+ (*nerrors)++;
+ } else if (e->ee_origin == SO_EE_ORIGIN_ICMP6) {
+ if (res < sizeof(icmph) ||
+ memcmp(&target.sin6_addr, &(whereto->sin6_addr), 16) ||
+ icmph.icmp6_type != ICMP6_ECHO_REQUEST ||
+ icmph.icmp6_id != *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 icmp6_hdr *icmph;
+ int cc;
+ int i;
+ int mx_dup_ck = MAX_DUP_CHK;
+
+ icmph = (struct icmp6_hdr *) outpack;
+ icmph->icmp6_type = ICMP6_ECHO_REQUEST;
+ icmph->icmp6_code = 0;
+ icmph->icmp6_cksum = 0;
+ icmph->icmp6_seq = (*ntransmitted) + 1;
+ icmph->icmp6_id = *ident;
+
+ CLR(icmph->icmp6_seq % 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 icmp6_hdr *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 icmp6_hdr *) buf;
+ if (cc < 8) {
+ if (options & F_VERBOSE)
+ snmp_log(LOG_ERR, "ping: packet too short (%d bytes)\n", cc);
+ return 1;
+ }
+ if (icmph->icmp6_type == ICMP6_ECHO_REPLY) {
+ if (icmph->icmp6_id != *ident)
+ return 1;
+ if (gather_statistics(series, item, (__u8 *) (icmph + 1), cc,
+ icmph->icmp6_seq,
+ 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 ip6_hdr *iph1 = (struct ip6_hdr *) (icmph + 1);
+ struct icmp6_hdr *icmph1 = (struct icmp6_hdr *) (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 ip6_hdr) + 8)
+ return 1;
+
+ if (memcmp(&iph1->ip6_dst, &(whereto->sin6_addr), 16))
+ return 1;
+
+ nexthdr = iph1->ip6_nxt;
+
+ if (nexthdr == 44) {
+ nexthdr = *(__u8 *) icmph1;
+ icmph1++;
+ }
+ if (nexthdr == IPPROTO_ICMPV6) {
+ if (icmph1->icmp6_type != ICMP6_ECHO_REQUEST ||
+ icmph1->icmp6_id != *ident)
+ return 1;
+ acknowledge(icmph1->icmp6_seq, acked, ntransmitted,
+ pipesize);
+ if (working_recverr)
+ return 0;
+ (*nerrors)++;
+ if (options & F_FLOOD) {
+ write(STDOUT_FILENO, "\bE", 2);
+ return 0;
+ }
+ DEBUGMSGTL(("pingCtlTable", "From %s: icmp_seq=%u ",
+ pr_addr(&from->sin6_addr, options),
+ icmph1->icmp6_seq));
+ } else {
+ /*
+ * We've got something other than an ECHOREPLY
+ */
+ if (!(options & F_VERBOSE) || uid)
+ return 1;
+ DEBUGMSGTL(("pingCtlTable", "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, ICMP6_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
+ };
+ int id;
+
+ if (once)
+ return;
+ once = 1;
+
+ /*
+ * Patch bpflet for current identifier.
+ */
+ id = htons( *ident );
+ insns[1] =
+ (struct sock_filter) BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K,
+ id, 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 = netsnmp_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/agent/mibgroup/disman/ping/pingCtlTable.h b/agent/mibgroup/disman/ping/pingCtlTable.h
new file mode 100644
index 0000000..ca69d13
--- /dev/null
+++ b/agent/mibgroup/disman/ping/pingCtlTable.h
@@ -0,0 +1,437 @@
+/*
+ *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 <sched.h>
+
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
+
+
+/*
+ * 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;
+ u_char *pingResultsLastGoodProbe;
+ size_t pingResultsLastGoodProbeLen;
+ time_t pingResultsLastGoodProbe_time;
+
+ 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;
+ u_char *pingProbeHistoryTime;
+ size_t pingProbeHistoryTimeLen;
+ time_t pingProbeHistoryTime_time;
+
+ int storageType;
+
+};
+
+
+/*
+ * function declarations
+ */
+void init_pingCtlTable(void);
+void shutdown_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
+
+
+
+#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
+
+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 *);
+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 *);
+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 *);
+void install_filter(int, int *);
+
+#endif
+/*
+ * PINGCTLTABLE_H
+ */
diff --git a/agent/mibgroup/disman/ping/pingProbeHistoryTable.c b/agent/mibgroup/disman/ping/pingProbeHistoryTable.c
new file mode 100644
index 0000000..78c75be
--- /dev/null
+++ b/agent/mibgroup/disman/ping/pingProbeHistoryTable.c
@@ -0,0 +1,342 @@
+/*
+ *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, NETSNMP_OLDAPI_RONLY,
+ var_pingProbeHistoryTable, 2, {1, 2}},
+ {COLUMN_PINGPROBEHISTORYSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_pingProbeHistoryTable, 2, {1, 3}},
+ {COLUMN_PINGPROBEHISTORYLASTRC, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_pingProbeHistoryTable, 2, {1, 4}},
+ {COLUMN_PINGPROBEHISTORYTIME, ASN_OCTET_STR, NETSNMP_OLDAPI_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;
+int
+pingProbeHistoryTable_inadd(struct pingProbeHistoryTable_data *thedata);
+
+void
+pingProbeHistoryTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ 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/agent/mibgroup/disman/ping/pingProbeHistoryTable.h b/agent/mibgroup/disman/ping/pingProbeHistoryTable.h
new file mode 100644
index 0000000..1c3eadb
--- /dev/null
+++ b/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/agent/mibgroup/disman/ping/pingResultsTable.c b/agent/mibgroup/disman/ping/pingResultsTable.c
new file mode 100644
index 0000000..1445d86
--- /dev/null
+++ b/agent/mibgroup/disman/ping/pingResultsTable.c
@@ -0,0 +1,425 @@
+/*
+ *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, NETSNMP_OLDAPI_RONLY,
+ var_pingResultsTable, 2, {1, 1}},
+ {COLUMN_PINGRESULTSIPTARGETADDRESSTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_pingResultsTable, 2, {1, 2}},
+ {COLUMN_PINGRESULTSIPTARGETADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_pingResultsTable, 2, {1, 3}},
+ {COLUMN_PINGRESULTSMINRTT, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_pingResultsTable, 2, {1, 4}},
+ {COLUMN_PINGRESULTSMAXRTT, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_pingResultsTable, 2, {1, 5}},
+ {COLUMN_PINGRESULTSAVERAGERTT, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_pingResultsTable, 2, {1, 6}},
+ {COLUMN_PINGRESULTSPROBERESPONSES, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_pingResultsTable, 2, {1, 7}},
+ {COLUMN_PINGRESULTSSENTPROBES, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_pingResultsTable, 2, {1, 8}},
+ {COLUMN_PINGRESULTSRTTSUMOFSQUARES, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_pingResultsTable, 2, {1, 9}},
+ {COLUMN_PINGRESULTSLASTGOODPROBE, ASN_OCTET_STR, NETSNMP_OLDAPI_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;
+int
+pingResultsTable_inadd(struct pingResultsTable_data *thedata);
+
+void
+pingResultsTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr;
+
+ DEBUGMSGTL(("pingResultsTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ 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/agent/mibgroup/disman/ping/pingResultsTable.h b/agent/mibgroup/disman/ping/pingResultsTable.h
new file mode 100644
index 0000000..5cfa339
--- /dev/null
+++ b/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/agent/mibgroup/disman/schedule.h b/agent/mibgroup/disman/schedule.h
new file mode 100644
index 0000000..a3351b6
--- /dev/null
+++ b/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/agent/mibgroup/disman/schedule/schedConf.c b/agent/mibgroup/disman/schedule/schedConf.c
new file mode 100644
index 0000000..0cbdbc6
--- /dev/null
+++ b/agent/mibgroup/disman/schedule/schedConf.c
@@ -0,0 +1,437 @@
+/*
+ * DisMan Schedule MIB:
+ * Implementation of the schedule MIB config handling
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(iquery)
+netsnmp_feature_require(string_time_to_secs)
+
+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], tmpbuf[SPRINT_MAX_LEN];
+ 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 = copy_nword(line, tmpbuf, sizeof(tmpbuf));
+ frequency = netsnmp_string_time_to_secs(tmpbuf);
+ if (frequency == -1) {
+ config_perror("Illegal frequency specified");
+ 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((unsigned char)(*line)))
+ line++;
+ if (line && *line == '=' ) {
+ line++;
+ while (line && isspace((unsigned char)(*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;
+ u_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((unsigned char)(*line)))
+ line++;
+ if ( *line == '=' ) {
+ line++;
+ while (line && isspace((unsigned char)(*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, *cp;
+ 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);
+
+ cp = entry->schedOwner; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->schedName; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &tint );
+ cp = entry->schedDescr; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &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 );
+
+ cp = entry->schedContextName; tint = strlen( cp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &cp, &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/agent/mibgroup/disman/schedule/schedConf.h b/agent/mibgroup/disman/schedule/schedConf.h
new file mode 100644
index 0000000..91f4965
--- /dev/null
+++ b/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/agent/mibgroup/disman/schedule/schedCore.c b/agent/mibgroup/disman/schedule/schedCore.c
new file mode 100644
index 0000000..c3db34f
--- /dev/null
+++ b/agent/mibgroup/disman/schedule/schedCore.c
@@ -0,0 +1,515 @@
+/*
+ * DisMan Schedule MIB:
+ * Core implementation of the schedule handling behaviour
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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_feature_require(iquery)
+
+netsnmp_feature_child_of(sched_nextrowtime, netsnmp_unused)
+
+netsnmp_tdata *schedule_table;
+
+
+#if !defined(HAVE_LOCALTIME_R) && !defined(localtime_r)
+/*
+ * localtime_r() replacement for older MinGW versions.
+ * Note: this implementation is not thread-safe, while it should.
+ */
+struct tm *
+localtime_r(const time_t * timer, struct tm *result)
+{
+ struct tm *result_p;
+
+ result_p = localtime(timer);
+ if (result && result_p)
+ *result = *result_p;
+ return result_p;
+}
+#endif
+
+
+ /*
+ * 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(%p)\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(NULL);
+ entry->schedTriggers++;
+
+ DEBUGMSGTL(( "disman:schedule:callback", "assignment "));
+ DEBUGMSGOID(("disman:schedule:callback", entry->schedVariable,
+ entry->schedVariable_len));
+ DEBUGMSG(( "disman:schedule:callback", " = %ld\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 u_char _masks[] = { /* 0xff, */ 0x7f, 0x3f, 0x1f,
+ 0x0f, 0x07, 0x03, 0x01, 0x00 };
+static u_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<(int)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 u_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 */
+}
+
+
+/*
+ * 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: (%ld) %s",
+ (long) entry->schedNextRun, ctime(&entry->schedNextRun)));
+ break;
+
+ case SCHED_TYPE_ONESHOT:
+ if ( entry->schedLastRun ) {
+ DEBUGMSGTL(("disman:schedule:time", "one-shot: expired (%ld) %s",
+ (long) 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)
+ */
+
+ (void) localtime_r( &now, &now_tm );
+ (void) 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: (%ld) %s",
+ (long) entry->schedNextRun, ctime(&entry->schedNextRun)));
+ return;
+
+ default:
+ DEBUGMSGTL(("disman:schedule:time", "unknown type (%ld)\n",
+ entry->schedType));
+ return;
+ }
+ entry->schedCallbackID = snmp_alarm_register(
+ entry->schedNextRun - now,
+ 0, _sched_callback, entry );
+ return;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SCHED_NEXTROWTIME
+void
+sched_nextRowTime( netsnmp_tdata_row *row )
+{
+ sched_nextTime((struct schedTable_entry *) row->data );
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SCHED_NEXTROWTIME */
+
+/*
+ * 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));
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR,
+ entry->schedOwner, strlen(schedOwner));
+ }
+ else
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR, "", 0 );
+
+ memcpy( entry->schedName, schedName, strlen(schedName));
+ 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/agent/mibgroup/disman/schedule/schedCore.h b/agent/mibgroup/disman/schedule/schedCore.h
new file mode 100644
index 0000000..35866d7
--- /dev/null
+++ b/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+1];
+ 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/agent/mibgroup/disman/schedule/schedTable.c b/agent/mibgroup/disman/schedule/schedTable.c
new file mode 100644
index 0000000..bba48fd
--- /dev/null
+++ b/agent/mibgroup/disman/schedule/schedTable.c
@@ -0,0 +1,540 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(iquery)
+netsnmp_feature_require(iquery_pdu_session)
+netsnmp_feature_require(table_tdata)
+netsnmp_feature_require(date_n_time)
+netsnmp_feature_require(check_vb_uint)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(check_vb_oid)
+netsnmp_feature_require(check_vb_truthvalue)
+netsnmp_feature_require(table_tdata_insert_row)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static netsnmp_table_registration_info *table_info;
+
+/** 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;
+
+ 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);
+}
+
+void
+shutdown_schedTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+/** 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) {
+ if (request->processed)
+ continue;
+
+ 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 = (char *) 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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) {
+ if (request->processed)
+ continue;
+
+ 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
+ */
+ entry = NULL;
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ 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, sizeof(entry->schedContextName));
+ 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) {
+ netsnmp_assert(entry);
+ sched_nextTime(entry);
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/disman/schedule/schedTable.h b/agent/mibgroup/disman/schedule/schedTable.h
new file mode 100644
index 0000000..52033ba
--- /dev/null
+++ b/agent/mibgroup/disman/schedule/schedTable.h
@@ -0,0 +1,39 @@
+#ifndef SCHEDTABLE_H
+#define SCHEDTABLE_H
+
+config_require(disman/schedule/schedCore)
+config_add_mib(DISMAN-SCHEDULE-MIB)
+
+/*
+ * function declarations
+ */
+void init_schedTable(void);
+void shutdown_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/agent/mibgroup/disman/traceroute-mib.h b/agent/mibgroup/disman/traceroute-mib.h
new file mode 100644
index 0000000..b33d69e
--- /dev/null
+++ b/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/agent/mibgroup/disman/traceroute/traceRouteCtlTable.c b/agent/mibgroup/disman/traceroute/traceRouteCtlTable.c
new file mode 100644
index 0000000..04143eb
--- /dev/null
+++ b/agent/mibgroup/disman/traceroute/traceRouteCtlTable.c
@@ -0,0 +1,6198 @@
+/*
+ *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/net-snmp-features.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <pthread.h>
+#include <math.h>
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(header_complex_find_entry)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+#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, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 3}},
+ {COLUMN_TRACEROUTECTLTARGETADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 4}},
+ {COLUMN_TRACEROUTECTLBYPASSROUTETABLE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 5}},
+ {COLUMN_TRACEROUTECTLDATASIZE, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 6}},
+ {COLUMN_TRACEROUTECTLTIMEOUT, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 7}},
+ {COLUMN_TRACEROUTECTLPROBESPERHOP, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 8}},
+ {COLUMN_TRACEROUTECTLPORT, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 9}},
+ {COLUMN_TRACEROUTECTLMAXTTL, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 10}},
+ {COLUMN_TRACEROUTECTLDSFIELD, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 11}},
+ {COLUMN_TRACEROUTECTLSOURCEADDRESSTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 12}},
+ {COLUMN_TRACEROUTECTLSOURCEADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 13}},
+ {COLUMN_TRACEROUTECTLIFINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 14}},
+ {COLUMN_TRACEROUTECTLMISCOPTIONS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 15}},
+ {COLUMN_TRACEROUTECTLMAXFAILURES, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 16}},
+ {COLUMN_TRACEROUTECTLDONTFRAGMENT, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 17}},
+ {COLUMN_TRACEROUTECTLINITIALTTL, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 18}},
+ {COLUMN_TRACEROUTECTLFREQUENCY, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 19}},
+ {COLUMN_TRACEROUTECTLSTORAGETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 20}},
+ {COLUMN_TRACEROUTECTLADMINSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 21}},
+ {COLUMN_TRACEROUTECTLDESCR, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 22}},
+ {COLUMN_TRACEROUTECTLMAXROWS, ASN_UNSIGNED, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 23}},
+ {COLUMN_TRACEROUTECTLTRAPGENERATION, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 24}},
+ {COLUMN_TRACEROUTECTLCREATEHOPSENTRIES, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 25}},
+ {COLUMN_TRACEROUTECTLTYPE, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_traceRouteCtlTable, 2, {1, 26}},
+ {COLUMN_TRACEROUTECTLROWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_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;
+
+int
+traceRouteResultsTable_add(struct traceRouteCtlTable_data *thedata);
+int
+traceRouteResultsTable_del(struct traceRouteCtlTable_data *thedata);
+
+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);
+ }
+
+ memset(host, '\0',
+ 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];
+ memset(pa, '\0', 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);
+ }
+ memset(StorageTmp->traceRouteResultsIpTgtAddr, '\0',
+ 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);
+ }
+ memset(StorageTmp->traceRouteResultsIpTgtAddr, '\0',
+ 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->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 *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="));
+ DEBUGMSGOID(("traceRouteProbeHistoryTable",
+ temp->name, temp->namelen));
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "\n "));
+ 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;
+ }
+ }
+ return SNMPERR_GENERR;
+}
+
+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="));
+ DEBUGMSGOID(("traceRouteProbeHistoryTable",
+ temp->name, temp->namelen));
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "\n "));
+ 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;
+}
+
+
+
+void
+traceRouteProbeHistoryTable_delLast(struct traceRouteCtlTable_data
+ *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ struct header_complex_index *hcilast = NULL;
+ struct traceRouteProbeHistoryTable_data *StorageTmp = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len = 0;
+ time_t last_time = 2147483647;
+ time_t tp;
+
+ 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 */
+
+ memset(newoid, '\0', 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);
+ tp = StorageTmp->traceRouteProbeHistoryTime_time;
+
+ if (last_time > tp) {
+ last_time = tp;
+ hcilast = hciptr2;
+ }
+
+ }
+ }
+ header_complex_extract_entry(&traceRouteProbeHistoryTableStorage, hcilast);
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "delete the last one success!\n"));
+ vars = 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;
+ 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 */
+
+ memset(newoid, '\0', 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) {
+ 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;
+ 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); /* traceRouteCtlOperationName */
+
+ memset(newoid, '\0', 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) {
+ 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;
+ 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 */
+
+ memset(newoid, '\0', 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) {
+ header_complex_extract_entry(&traceRouteHopsTableStorage, hciptr2);
+ DEBUGMSGTL(("traceRouteHopsTable", "delete success!\n"));
+
+ }
+ }
+ vars = NULL;
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * send trap
+ */
+
+void
+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 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
+ */
+ memset(newoid, '\0', 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) {
+ memset(indexoid, '\0', 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);
+ memset(tempoid, '\0', 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 */
+ memset(newoid, '\0', 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_traceRoute_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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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;
+ 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, 0, 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);
+ }
+ }
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(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;
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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 = 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);
+ snmp_store_needed(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;
+ 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, 0, run_traceRoute, StorageTmp);
+
+ }
+
+ }
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+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 */
+ int nprobes = item->traceRouteCtlProbesPerHop;
+
+ if (item->traceRouteCtlInitialTtl > item->traceRouteCtlMaxTtl) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "first ttl (%lu) may not be greater than max ttl (%lu)\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 code, n;
+ const 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);
+
+
+ netsnmp_set_line_buffering(stdout);
+
+ 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",
+ ", %lu 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 *temp = NULL;
+ struct traceRouteHopsTable_data *current_temp = NULL;
+ struct traceRouteHopsTable_data *current = NULL;
+
+ unsigned long index = 0;
+
+ struct traceRouteProbeHistoryTable_data *temp_his = NULL;
+ struct traceRouteProbeHistoryTable_data *current_temp_his = 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->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_time = timep;
+ memdup(&temp_his->traceRouteProbeHistoryTime,
+ date_n_time(&timep,
+ &temp_his->traceRouteProbeHistoryTimeLen), 11);
+ 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_time = timep;
+ memdup(&current->traceRouteHopsLastGoodProbe,
+ date_n_time(&timep,
+ &current->traceRouteHopsLastGoodProbeLen), 11);
+ }
+
+ (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_time = timep;
+ memdup(&StorageResults->traceRouteResultsLastGoodPath,
+ date_n_time(&timep,
+ &StorageResults->traceRouteResultsLastGoodPathLen), 11);
+ 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_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) {
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "test Failed!\n"));
+ send_traceRoute_trap(item, traceRouteTestFailed,
+ sizeof(traceRouteTestFailed) /
+ sizeof(oid));
+ }
+ }
+
+ }
+
+ close(sndsock);
+
+ 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) {
+ int icmp_sock = 0; /* receive (icmp) socket file descriptor */
+ int sndsock = 0; /* send (udp) socket file descriptor */
+
+ 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 waittime = 5; /* time to wait for response (in seconds) */
+
+ 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 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);
+
+ memset(&whereto, '\0', sizeof(struct sockaddr_in6));
+
+ to->sin6_family = AF_INET6;
+ to->sin6_port = htons(port);
+
+ if (inet_pton(AF_INET6, hostname, &to->sin6_addr) <= 0) {
+ 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) {
+ socklen_t 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 {
+ memset(&saddr, '\0', 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, ", %lu 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 *temp = NULL;
+ struct traceRouteHopsTable_data *current_temp = NULL;
+ struct traceRouteHopsTable_data *current = NULL;
+
+ unsigned long index = 0;
+
+ struct traceRouteProbeHistoryTable_data *temp_his = NULL;
+ struct traceRouteProbeHistoryTable_data *current_temp_his = 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->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 ICMP6_DST_UNREACH_NOPORT:
+ ++got_there;
+ break;
+
+ case ICMP6_DST_UNREACH_NOROUTE:
+ ++unreachable;
+ Printf(" !N");
+ break;
+ case ICMP6_DST_UNREACH_ADDR:
+ ++unreachable;
+ Printf(" !H");
+ break;
+
+ case ICMP6_DST_UNREACH_ADMIN:
+ ++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_time = timep;
+ memdup(&temp_his->traceRouteProbeHistoryTime,
+ date_n_time(&timep,
+ &temp_his->traceRouteProbeHistoryTimeLen), 11);
+
+ 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_time = timep;
+ memdup(&current->traceRouteHopsLastGoodProbe,
+ date_n_time(&timep,
+ &current->traceRouteHopsLastGoodProbeLen), 11);
+
+ 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_time = timep;
+ memdup(&StorageResults->traceRouteResultsLastGoodPath,
+ date_n_time(&timep,
+ &StorageResults->traceRouteResultsLastGoodPathLen), 11);
+ 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_traceRoute_trap(item, traceRouteTestFailed,
+ sizeof(traceRouteTestFailed) /
+ sizeof(oid));
+ }
+ }
+
+ }
+
+ close(sndsock);
+
+ 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;
+ socklen_t 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;
+ socklen_t 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);
+}
+
+/*
+ * send_probe() uses the BSD-ish udpiphdr.
+ * Define something that looks enough like it to work.
+ */
+struct udpiphdr {
+ struct iphdr ui_i;
+ struct udphdr ui_u;
+};
+#define ui_src ui_i.saddr
+#define ui_dst ui_i.daddr
+#define ui_pr ui_i.protocol
+#define ui_len ui_i.tot_len
+
+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",
+ "traceroute", 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", "traceroute", strerror(errno));
+ Printf("%s: wrote %s %d chars, ret=%d\n",
+ "traceroute", 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;
+
+ 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 icmp6_hdr *icp = NULL;
+ u_char type, code;
+
+ icp = (struct icmp6_hdr *) buf;
+
+ type = icp->icmp6_type;
+ code = icp->icmp6_code;
+
+ if ((type == ICMP6_TIME_EXCEEDED && code == ICMP6_TIME_EXCEED_TRANSIT) ||
+ type == ICMP6_DST_UNREACH) {
+ struct ip6_hdr *hip = NULL;
+ struct udphdr *up = NULL;
+ int nexthdr = 0;
+
+ hip = (struct ip6_hdr *) (icp + 1);
+ up = (struct udphdr *) (hip + 1);
+ nexthdr = hip->ip6_nxt;
+
+ 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 == ICMP6_TIME_EXCEEDED ? -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",
+ "traceroute", hostname);
+ exit(1);
+ }
+ hi = calloc(1, sizeof(*hi));
+ if (hi == NULL) {
+ Fprintf(stderr, "%s: calloc %s\n", "traceroute", 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", "traceroute", strerror(errno));
+ exit(1);
+ }
+ hi->addrs[0] = addr;
+ return (hi);
+ }
+
+ hp = netsnmp_gethostbyname(hostname);
+ if (hp == NULL) {
+ Fprintf(stderr, "%s: unknown host %s\n", "traceroute", hostname);
+ printf("hp=NULL\n");
+ exit(1);
+ }
+ if (hp->h_addrtype != AF_INET || hp->h_length != 4) {
+ Fprintf(stderr, "%s: bad host %s\n", "traceroute", 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", "traceroute", 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;
+ 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)",
+ (int)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;
+ 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.)
+ */
+ strlcpy(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;
+
+ sprintf(device, "%.*s", (int) sizeof(ifr.ifr_name), ifr.ifr_name);
+#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)", nipaddr);
+ (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/agent/mibgroup/disman/traceroute/traceRouteCtlTable.h b/agent/mibgroup/disman/traceroute/traceRouteCtlTable.h
new file mode 100644
index 0000000..0711978
--- /dev/null
+++ b/agent/mibgroup/disman/traceroute/traceRouteCtlTable.h
@@ -0,0 +1,613 @@
+/*
+ *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;
+ u_char *traceRouteResultsLastGoodPath;
+ size_t traceRouteResultsLastGoodPathLen;
+ time_t traceRouteResultsLastGoodPath_time;
+
+ 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;
+ u_char *traceRouteProbeHistoryTime;
+ size_t traceRouteProbeHistoryTimeLen;
+ time_t traceRouteProbeHistoryTime_time;
+
+ 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;
+ u_char *traceRouteHopsLastGoodProbe;
+ size_t traceRouteHopsLastGoodProbeLen;
+ time_t traceRouteHopsLastGoodProbe_time;
+
+ 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$ (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 <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/udp.h>
+
+#include <netinet/ip6.h>
+#include <netinet/icmp6.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>
+
+#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) memset((p), '\0', 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;
+};
+
+
+struct pkt_format {
+ u_int32_t ident;
+ u_int32_t seq;
+ struct timeval tv;
+};
+
+
+/*
+ * Forwards
+ */
+unsigned long deltaT(struct timeval *, struct timeval *);
+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/agent/mibgroup/disman/traceroute/traceRouteHopsTable.c b/agent/mibgroup/disman/traceroute/traceRouteHopsTable.c
new file mode 100644
index 0000000..763757d
--- /dev/null
+++ b/agent/mibgroup/disman/traceroute/traceRouteHopsTable.c
@@ -0,0 +1,420 @@
+/*
+ *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, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteHopsTable, 2, {1, 2}},
+ {COLUMN_TRACEROUTEHOPSIPTGTADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteHopsTable, 2, {1, 3}},
+ {COLUMN_TRACEROUTEHOPSMINRTT, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteHopsTable, 2, {1, 4}},
+ {COLUMN_TRACEROUTEHOPSMAXRTT, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteHopsTable, 2, {1, 5}},
+ {COLUMN_TRACEROUTEHOPSAVERAGERTT, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteHopsTable, 2, {1, 6}},
+ {COLUMN_TRACEROUTEHOPSRTTSUMOFSQUARES, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteHopsTable, 2, {1, 7}},
+ {COLUMN_TRACEROUTEHOPSSENTPROBES, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteHopsTable, 2, {1, 8}},
+ {COLUMN_TRACEROUTEHOPSPROBERESPONSES, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteHopsTable, 2, {1, 9}},
+ {COLUMN_TRACEROUTEHOPSLASTGOODPROBE, ASN_OCTET_STR, NETSNMP_OLDAPI_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_inadd(struct traceRouteHopsTable_data *thedata);
+
+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;
+}
+
+
+void
+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/agent/mibgroup/disman/traceroute/traceRouteHopsTable.h b/agent/mibgroup/disman/traceroute/traceRouteHopsTable.h
new file mode 100644
index 0000000..f7e7746
--- /dev/null
+++ b/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/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c b/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c
new file mode 100644
index 0000000..0b410c5
--- /dev/null
+++ b/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c
@@ -0,0 +1,417 @@
+/*
+ *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, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteProbeHistoryTable, 2, {1, 4}},
+ {COLUMN_TRACEROUTEPROBEHISTORYHADDR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteProbeHistoryTable, 2, {1, 5}},
+ {COLUMN_TRACEROUTEPROBEHISTORYRESPONSE, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteProbeHistoryTable, 2, {1, 6}},
+ {COLUMN_TRACEROUTEPROBEHISTORYSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteProbeHistoryTable, 2, {1, 7}},
+ {COLUMN_TRACEROUTEPROBEHISTORYLASTRC, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteProbeHistoryTable, 2, {1, 8}},
+ {COLUMN_TRACEROUTEPROBEHISTORYTIME, ASN_OCTET_STR, NETSNMP_OLDAPI_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_inadd(struct traceRouteProbeHistoryTable_data
+ *thedata);
+
+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;
+}
+
+
+void
+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/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.h b/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.h
new file mode 100644
index 0000000..e99d948
--- /dev/null
+++ b/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/agent/mibgroup/disman/traceroute/traceRouteResultsTable.c b/agent/mibgroup/disman/traceroute/traceRouteResultsTable.c
new file mode 100644
index 0000000..aba6cf1
--- /dev/null
+++ b/agent/mibgroup/disman/traceroute/traceRouteResultsTable.c
@@ -0,0 +1,421 @@
+/*
+ *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>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(table_dataset)
+
+/*
+ *traceRouteResultsTable_variables_oid:
+ *
+ */
+oid traceRouteResultsTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 81, 1, 3 };
+
+struct variable2 traceRouteResultsTable_variables[] = {
+ {COLUMN_TRACEROUTERESULTSOPERSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteResultsTable, 2, {1, 1}},
+ {COLUMN_TRACEROUTERESULTSCURHOPCOUNT, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteResultsTable, 2, {1, 2}},
+ {COLUMN_TRACEROUTERESULTSCURPROBECOUNT, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteResultsTable, 2, {1, 3}},
+ {COLUMN_TRACEROUTERESULTSIPTGTADDRTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteResultsTable, 2, {1, 4}},
+ {COLUMN_TRACEROUTERESULTSIPTGTADDR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteResultsTable, 2, {1, 5}},
+ {COLUMN_TRACEROUTERESULTSTESTATTEMPTS, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteResultsTable, 2, {1, 6}},
+ {COLUMN_TRACEROUTERESULTSTESTSUCCESSES, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_traceRouteResultsTable, 2, {1, 7}},
+ {COLUMN_TRACEROUTERESULTSLASTGOODPATH, ASN_OCTET_STR, NETSNMP_OLDAPI_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_inadd(struct traceRouteResultsTable_data *thedata);
+
+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;
+}
+
+void
+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/agent/mibgroup/disman/traceroute/traceRouteResultsTable.h b/agent/mibgroup/disman/traceroute/traceRouteResultsTable.h
new file mode 100644
index 0000000..f31ffbf
--- /dev/null
+++ b/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/agent/mibgroup/etherlike-mib.h b/agent/mibgroup/etherlike-mib.h
new file mode 100644
index 0000000..224e254
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib.h
@@ -0,0 +1,7 @@
+/*
+ * module to include the modules
+ */
+
+config_require(etherlike-mib/dot3StatsTable)
+config_add_mib(EtherLike-MIB)
+
diff --git a/agent/mibgroup/etherlike-mib/data_access/dot3stats.h b/agent/mibgroup/etherlike-mib/data_access/dot3stats.h
new file mode 100644
index 0000000..7d2b44f
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/data_access/dot3stats.h
@@ -0,0 +1,7 @@
+/*
+ * module to include the modules
+ */
+
+#if defined(linux)
+config_require(etherlike-mib/data_access/dot3stats_linux)
+#endif
diff --git a/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c b/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c
new file mode 100644
index 0000000..00f4bc3
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c
@@ -0,0 +1,928 @@
+/*
+ * standard Net-SNMP includes
+ */
+
+#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 "etherlike-mib/dot3StatsTable/dot3StatsTable.h"
+#include "etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h"
+#include "etherlike-mib/dot3StatsTable/ioctl_imp_common.h"
+
+/*
+ * @retval 0 success
+ * @retval -1 getifaddrs failed
+ * @retval -2 memory allocation failed
+ */
+
+struct ifname *
+dot3stats_interface_name_list_get (struct ifname *list_head, int *retval)
+{
+ struct ifaddrs *addrs = NULL, *p = NULL;
+ struct ifname *nameptr1=NULL, *nameptr2 = NULL;
+
+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_get",
+ "called\n"));
+
+ if ((getifaddrs(&addrs)) < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_get",
+ "getifaddrs failed\n"));
+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_name_list_get, getifaddrs failed\n");
+ *retval = -1;
+ return NULL;
+ }
+
+ for (p = addrs; p; p = p->ifa_next) {
+
+ if (!list_head) {
+ if ( (list_head = (struct ifname *) malloc (sizeof(struct ifname))) < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_get",
+ "memory allocation failed\n"));
+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_name_list_get, memory allocation failed\n");
+ freeifaddrs(addrs);
+ *retval = -2;
+ return NULL;
+ }
+ memset(list_head, 0, sizeof (struct ifname));
+ strlcpy(list_head->name, p->ifa_name, IF_NAMESIZE);
+ continue;
+ }
+
+ for (nameptr1 = list_head; nameptr1; nameptr2 = nameptr1, nameptr1 = nameptr1->ifn_next)
+ if (!strncmp(p->ifa_name, nameptr1->name, IF_NAMESIZE))
+ break;
+
+ if (nameptr1)
+ continue;
+
+ if ( (nameptr2->ifn_next = (struct ifname *) malloc (sizeof(struct ifname))) < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_get",
+ "memory allocation failed\n"));
+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_name_list_get, memory allocation failed\n");
+ dot3stats_interface_name_list_free (list_head);
+ freeifaddrs(addrs);
+ *retval = -2;
+ return NULL;
+ }
+ nameptr2 = nameptr2->ifn_next;
+ memset(nameptr2, 0, sizeof (struct ifname));
+ strlcpy(nameptr2->name, p->ifa_name, IF_NAMESIZE);
+ continue;
+
+ }
+
+ freeifaddrs(addrs);
+ return list_head;
+}
+
+/*
+ * @retval 0 success
+ * @retval -1 invalid pointer
+ */
+
+int
+dot3stats_interface_name_list_free (struct ifname *list_head)
+{
+ struct ifname *nameptr1 = NULL, *nameptr2 = NULL;
+
+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_free",
+ "called\n"));
+
+ if (!list_head) {
+ snmp_log (LOG_ERR, "access:dot3StatsTable:interface_name_list_free: invalid pointer list_head");
+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_free",
+ "invalid pointer list_head\n"));
+ return -1;
+ }
+
+ for (nameptr1 = list_head; nameptr1; nameptr1 = nameptr2) {
+ nameptr2 = nameptr1->ifn_next;
+ free (nameptr1);
+ }
+
+ return 0;
+}
+
+/*
+ * @retval 0 : not found
+ * @retval !0 : ifIndex
+ */
+
+int
+dot3stats_interface_ioctl_ifindex_get (int fd, const char *name) {
+#ifndef SIOCGIFINDEX
+ return 0;
+#else
+ struct ifreq ifrq;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_ifindex_get", "called\n"));
+
+ rc = _dot3Stats_ioctl_get(fd, SIOCGIFINDEX, &ifrq, name);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_ifindex_get",
+ "error on interface '%s'\n", name));
+ snmp_log (LOG_ERR, "access:dot3StatsTable:interface_ioctl_ifindex_get, error on interface '%s'\n", name);
+ return 0;
+
+ }
+
+ return ifrq.ifr_ifindex;
+#endif /* SIOCGIFINDEX */
+}
+
+# if HAVE_LINUX_RTNETLINK_H /* { NETLINK */
+/*
+ * The following code is based upon code I got from Stephen Hemminger
+ */
+#include <linux/rtnetlink.h>
+#include <errno.h>
+
+struct rtnl_handle {
+ int fd;
+ struct sockaddr_nl local;
+ struct sockaddr_nl peer;
+ __u32 seq;
+ __u32 dump;
+};
+
+struct ifstat_ent {
+ struct ifstat_ent *next;
+ const char *name;
+ int ifindex;
+ struct rtnl_link_stats stats;
+};
+
+typedef int (*rtnl_filter_t)(const struct sockaddr_nl *, struct nlmsghdr *n, void *);
+
+struct rtnl_dump_filter_arg
+{
+ rtnl_filter_t filter;
+ void *arg1;
+ rtnl_filter_t junk;
+ void *arg2;
+};
+
+static struct ifstat_ent *kern_db;
+static const int rcvbuf_size = 1024 * 1024;
+
+static int
+rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions, int protocol)
+{
+ socklen_t addr_len;
+ int sndbuf = 32768;
+
+ memset(rth, 0, sizeof(*rth));
+
+ rth->fd = socket(AF_NETLINK, SOCK_RAW, protocol);
+ if (rth->fd < 0) {
+ snmp_log(LOG_ERR, "Cannot open netlink socket");
+ return -1;
+ }
+
+ if (setsockopt(rth->fd,SOL_SOCKET,SO_SNDBUF,&sndbuf,sizeof(sndbuf)) < 0) {
+ snmp_log(LOG_ERR, "SO_SNDBUF");
+ return -1;
+ }
+
+ if (setsockopt(rth->fd,SOL_SOCKET,SO_RCVBUF,&rcvbuf_size,sizeof(rcvbuf_size)) < 0) {
+ snmp_log(LOG_ERR, "SO_RCVBUF");
+ return -1;
+ }
+
+ memset(&rth->local, 0, sizeof(rth->local));
+ rth->local.nl_family = AF_NETLINK;
+ rth->local.nl_groups = subscriptions;
+
+ if (bind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)) < 0) {
+ snmp_log(LOG_ERR, "Cannot bind netlink socket");
+ return -1;
+ }
+ addr_len = sizeof(rth->local);
+ if (getsockname(rth->fd, (struct sockaddr*)&rth->local, &addr_len) < 0) {
+ snmp_log(LOG_ERR, "Cannot getsockname");
+ return -1;
+ }
+ if (addr_len != sizeof(rth->local)) {
+ snmp_log(LOG_ERR, "Wrong address length %d\n", addr_len);
+ return -1;
+ }
+ if (rth->local.nl_family != AF_NETLINK) {
+ snmp_log(LOG_ERR, "Wrong address family %d\n", rth->local.nl_family);
+ return -1;
+ }
+ rth->seq = time(NULL);
+ return 0;
+}
+
+static int
+rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
+{
+ return rtnl_open_byproto(rth, subscriptions, NETLINK_ROUTE);
+}
+
+static void
+rtnl_close(struct rtnl_handle *rth)
+{
+ if (rth->fd != -1)
+ close(rth->fd);
+ rth->fd = -1;
+
+ return;
+}
+
+static int
+rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct rtgenmsg g;
+ } req;
+
+ memset(&req, 0, sizeof(req));
+ req.nlh.nlmsg_len = sizeof(req);
+ req.nlh.nlmsg_type = type;
+ req.nlh.nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST;
+ req.nlh.nlmsg_pid = 0;
+ req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
+ req.g.rtgen_family = family;
+
+ return send(rth->fd, (void*)&req, sizeof(req), 0);
+}
+
+static int
+parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len)
+{
+ memset(tb, 0, sizeof(struct rtattr *) * (max + 1));
+ while (RTA_OK(rta, len))
+ {
+ if (rta->rta_type <= max)
+ tb[rta->rta_type] = rta;
+ rta = RTA_NEXT(rta,len);
+ }
+
+ if (len)
+ snmp_log(LOG_ERR, "parse_rtattr: !!!Deficit %d, rta_len=%d\n", len, rta->rta_len);
+
+ return 0;
+}
+
+static int
+get_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *m, void *arg)
+{
+ struct ifinfomsg *ifi = NLMSG_DATA(m);
+ struct rtattr * tb[IFLA_MAX+1];
+ int len = m->nlmsg_len;
+ struct ifstat_ent *n;
+
+ if (m->nlmsg_type != RTM_NEWLINK)
+ return 0;
+
+ len -= NLMSG_LENGTH(sizeof(*ifi));
+ if (len < 0)
+ return -1;
+
+ parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len);
+ if (tb[IFLA_IFNAME] == NULL || tb[IFLA_STATS] == NULL)
+ return 0;
+
+ n = malloc(sizeof(*n));
+ memset(n, 0, sizeof(*n));
+
+ n->ifindex = ifi->ifi_index;
+ n->name = strdup(RTA_DATA(tb[IFLA_IFNAME]));
+ memcpy(&n->stats, RTA_DATA(tb[IFLA_STATS]), sizeof(n->stats));
+ n->next = kern_db;
+ kern_db = n;
+ return 0;
+}
+
+static int
+rtnl_dump_filter_l(struct rtnl_handle *rth,
+ const struct rtnl_dump_filter_arg *arg)
+{
+ struct sockaddr_nl nladdr;
+ struct iovec iov;
+ struct msghdr msg = {
+ .msg_name = &nladdr,
+ .msg_namelen = sizeof(nladdr),
+ .msg_iov = &iov,
+ .msg_iovlen = 1,
+ };
+ char buf[16384];
+
+ iov.iov_base = buf;
+ while (1) {
+ int status;
+ const struct rtnl_dump_filter_arg *a;
+
+ iov.iov_len = sizeof(buf);
+ status = recvmsg(rth->fd, &msg, 0);
+
+ if (status < 0) {
+ if (errno == EINTR || errno == EAGAIN)
+ continue;
+ fprintf(stderr, "netlink receive error %s (%d)\n",
+ strerror(errno), errno);
+ return -1;
+ }
+
+ if (status == 0) {
+ fprintf(stderr, "EOF on netlink\n");
+ return -1;
+ }
+
+ for (a = arg; a->filter; a++) {
+ struct nlmsghdr *h = (struct nlmsghdr*)buf;
+
+ while (NLMSG_OK(h, status)) {
+ int err;
+
+ if (nladdr.nl_pid != 0 ||
+ h->nlmsg_pid != rth->local.nl_pid ||
+ h->nlmsg_seq != rth->dump) {
+ if (a->junk) {
+ err = a->junk(&nladdr, h, a->arg2);
+ if (err < 0)
+ return err;
+ }
+ goto skip_it;
+ }
+
+ if (h->nlmsg_type == NLMSG_DONE)
+ return 0;
+ if (h->nlmsg_type == NLMSG_ERROR) {
+ struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
+ if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr))) {
+ fprintf(stderr, "ERROR truncated\n");
+ } else {
+ errno = -err->error;
+ perror("RTNETLINK answers");
+ }
+ return -1;
+ }
+ err = a->filter(&nladdr, h, a->arg1);
+ if (err < 0)
+ return err;
+
+skip_it:
+ h = NLMSG_NEXT(h, status);
+ }
+ } while (0);
+ if (msg.msg_flags & MSG_TRUNC) {
+ fprintf(stderr, "Message truncated\n");
+ continue;
+ }
+ if (status) {
+ fprintf(stderr, "!!!Remnant of size %d\n", status);
+ exit(1);
+ }
+ }
+}
+
+static int
+rtnl_dump_filter(struct rtnl_handle *rth,
+ rtnl_filter_t filter,
+ void *arg1,
+ rtnl_filter_t junk,
+ void *arg2)
+{
+ const struct rtnl_dump_filter_arg a[2] = {
+ { .filter = filter, .arg1 = arg1, .junk = junk, .arg2 = arg2 },
+ { .filter = NULL, .arg1 = NULL, .junk = NULL, .arg2 = NULL }
+ };
+
+ return rtnl_dump_filter_l(rth, a);
+}
+
+int
+_dot3Stats_netlink_get_errorcntrs(dot3StatsTable_rowreq_ctx *rowreq_ctx, const char *name)
+{
+ struct rtnl_handle rth;
+ struct ifstat_ent *ke;
+ int done;
+
+ if (rtnl_open(&rth, 0) < 0)
+ {
+ snmp_log(LOG_ERR, "_dot3Stats_netlink_get_errorcntrs: rtnl_open() failed\n");
+ return 1;
+ }
+
+ if (rtnl_wilddump_request(&rth, AF_INET, RTM_GETLINK) < 0)
+ {
+ snmp_log(LOG_ERR, "_dot3Stats_netlink_get_errorcntrs: Cannot send dump request");
+ rtnl_close(&rth);
+ return 1;
+ }
+
+ if (rtnl_dump_filter(&rth, get_nlmsg, NULL, NULL, NULL) < 0)
+ {
+ snmp_log(LOG_ERR, "_dot3Stats_netlink_get_errorcntrs: Dump terminated\n");
+ rtnl_close(&rth);
+ return 1;
+ }
+
+ rtnl_close(&rth);
+
+ /*
+ * Now scan kern_db for this if's data
+ * While doing so, we'll throw away the kern db.
+ */
+ done = 0;
+
+ while ((ke = kern_db) != NULL)
+ {
+ if (strcmp(ke->name, name) == 0)
+ {
+ dot3StatsTable_data *data = &rowreq_ctx->data;
+
+ snmp_log(LOG_ERR, "IFLA_STATS for %s\n", name);
+
+ data->dot3StatsFCSErrors = ke->stats.rx_crc_errors;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSFCSERRORS_FLAG;
+
+ data->dot3StatsDeferredTransmissions = ke->stats.tx_dropped;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSDEFERREDTRANSMISSIONS_FLAG;
+
+ data->dot3StatsInternalMacTransmitErrors = ke->stats.tx_fifo_errors;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS_FLAG;
+
+ data->dot3StatsCarrierSenseErrors = ke->stats.tx_carrier_errors;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSCARRIERSENSEERRORS_FLAG;
+
+ data->dot3StatsFrameTooLongs = ke->stats.rx_frame_errors;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSFRAMETOOLONGS_FLAG;
+
+ data->dot3StatsInternalMacReceiveErrors = ke->stats.rx_fifo_errors;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS_FLAG;
+
+ done = 1;
+ }
+ kern_db = ke->next;
+ free(ke);
+ }
+
+ return !done;
+}
+# else /* }{ */
+int
+_dot3Stats_netlink_get_errorcntrs(dot3StatsTable_rowreq_ctx *rowreq_ctx, const char *name)
+{
+ return 1;
+}
+# endif /* } */
+
+
+/*
+ * NAME: getulongfromsysclassnetstatistics
+ * PURPOSE: To get a single statistics value from /sys/class/net/<ifname>/statistics/<ctrname>
+ * ARGUMENTS: ifname: interface name
+ * ctrname: counter name
+ * valuep: where to store value
+ * RETURNS: 0 if value not available
+ * non-0 if value available
+ */
+static int
+getulongfromsysclassnetstatistics(const char *ifname, const char *ctrname, u_long *valuep)
+{
+ char path[256];
+ FILE *fp;
+ int rv;
+
+ if (ifname == NULL || ctrname == NULL || valuep == NULL)
+ return 0;
+
+ snprintf(path, sizeof(path), "/sys/class/net/%s/statistics/%s", ifname, ctrname);
+ fp = fopen(path, "rt");
+ if (fp == NULL)
+ return 0;
+
+ rv = 1;
+ if (fscanf(fp, "%lu", valuep) != 1)
+ rv = 0;
+
+ fclose(fp);
+
+ return rv;
+}
+
+/*
+ * NAME: interface_dot3stats_get_errorcounters
+ * PURPOSE: To get ethernet error statistics
+ * ARGUMENTS: rowreq_ctx: where to store the value(s)
+ * name: interface name
+ * RETURNS: nothing. fields not set if data not available
+ */
+void
+interface_dot3stats_get_errorcounters (dot3StatsTable_rowreq_ctx *rowreq_ctx, const char *name)
+{
+ u_long value;
+ dot3StatsTable_data *data = &rowreq_ctx->data;
+ FILE *dev;
+ const char NETDEV_FILE[] = "/proc/net/dev";
+
+ if (_dot3Stats_netlink_get_errorcntrs(rowreq_ctx, name) == 0)
+ {
+ snmp_log(LOG_NOTICE, "interface_dot3stats_get_errorcounters: got data from IFLA_STATS\n");
+ return;
+ }
+
+ if ((dev = fopen(NETDEV_FILE, "r")) != NULL)
+ {
+ char line[256], *lp, *next;
+ size_t namelen = strlen(name);
+ unsigned int value;
+ unsigned int column;
+
+ while (fgets(line, sizeof(line), dev) != NULL)
+ {
+ /* br0:68395635 1038214 0 0 0 0 0 939411 25626606 90708 0 0 0 0 0 0 */
+ lp = line;
+ while (*lp == ' ' || *lp == '\t')
+ lp++;
+ if (strncmp(lp, name, namelen) != 0 || lp[namelen] != ':')
+ continue;
+ lp += namelen + 1; /* Skip name and colon */
+
+ column = 1;
+ while (1)
+ {
+ value = strtoul(lp, &next, 10);
+ if (next == lp)
+ break; /* no more data */
+ switch (column)
+ {
+ case 3:
+ data->dot3StatsFCSErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSFCSERRORS_FLAG;
+ break;
+ case 12:
+ data->dot3StatsDeferredTransmissions = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSDEFERREDTRANSMISSIONS_FLAG;
+ break;
+ case 13:
+ data->dot3StatsInternalMacTransmitErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS_FLAG;
+ break;
+ case 15:
+ data->dot3StatsCarrierSenseErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSCARRIERSENSEERRORS_FLAG;
+ break;
+ case 6:
+ data->dot3StatsFrameTooLongs = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSFRAMETOOLONGS_FLAG;
+ break;
+ case 5:
+ data->dot3StatsInternalMacReceiveErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS_FLAG;
+ break;
+ case 14:
+ data->dot3StatsSingleCollisionFrames = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSSINGLECOLLISIONFRAMES_FLAG;
+ break;
+ }
+ column++;
+ lp = next;
+ }
+ break;
+ }
+
+ fclose(dev);
+ }
+
+ if (!(rowreq_ctx->column_exists_flags & COLUMN_DOT3STATSFCSERRORS_FLAG) &&
+ getulongfromsysclassnetstatistics(name, "rx_errors", &value)) {
+ data->dot3StatsFCSErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSFCSERRORS_FLAG;
+ }
+ if (!(rowreq_ctx->column_exists_flags & COLUMN_DOT3STATSDEFERREDTRANSMISSIONS_FLAG) &&
+ getulongfromsysclassnetstatistics(name, "tx_dropped", &value)) {
+ data->dot3StatsDeferredTransmissions = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSDEFERREDTRANSMISSIONS_FLAG;
+ }
+ if (!(rowreq_ctx->column_exists_flags & COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS_FLAG) &&
+ getulongfromsysclassnetstatistics(name, "tx_fifo_errors", &value)) {
+ data->dot3StatsInternalMacTransmitErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS_FLAG;
+ }
+ if (!(rowreq_ctx->column_exists_flags & COLUMN_DOT3STATSCARRIERSENSEERRORS_FLAG) &&
+ getulongfromsysclassnetstatistics(name, "tx_carrier_errors", &value)) {
+ data->dot3StatsCarrierSenseErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSCARRIERSENSEERRORS_FLAG;
+ }
+ if (!(rowreq_ctx->column_exists_flags & COLUMN_DOT3STATSFRAMETOOLONGS_FLAG) &&
+ getulongfromsysclassnetstatistics(name, "rx_frame_errors", &value)) {
+ data->dot3StatsFrameTooLongs = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSFRAMETOOLONGS_FLAG;
+ }
+ if (!(rowreq_ctx->column_exists_flags & COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS_FLAG) &&
+ getulongfromsysclassnetstatistics(name, "rx_fifo_errors", &value)) {
+ data->dot3StatsInternalMacReceiveErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS_FLAG;
+ }
+
+ return;
+}
+
+/*
+ * @retval 0 success
+ * @retval -1 cannot get ETHTOOL_DRVINFO failed
+ * @retval -2 nstats zero - no statistcs available
+ * @retval -3 memory allocation for holding the statistics failed
+ * @retval -4 cannot get ETHTOOL_GSTRINGS information
+ * @retval -5 cannot get ETHTOOL_GSTATS information
+ * @retval -6 function not supported if HAVE_LINUX_ETHTOOL_H not defined
+ */
+
+
+int
+interface_ioctl_dot3stats_get (dot3StatsTable_rowreq_ctx *rowreq_ctx, int fd, const char *name) {
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+ dot3StatsTable_data *data = &rowreq_ctx->data;
+ struct ethtool_drvinfo driver_info;
+ struct ethtool_gstrings *eth_strings;
+ struct ethtool_stats *eth_stats;
+ struct ifreq ifr;
+ unsigned int nstats, size_str, i;
+ int err;
+
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get",
+ "called\n"));
+
+ memset(&ifr, 0, sizeof(ifr));
+ strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+
+ memset(&driver_info, 0, sizeof (driver_info));
+ driver_info.cmd = ETHTOOL_GDRVINFO;
+ ifr.ifr_data = (char *)&driver_info;
+
+ err = _dot3Stats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get",
+ "ETHTOOL_GETDRVINFO failed for interface |%s| \n", name));
+ return -1;
+ }
+
+ nstats = driver_info.n_stats;
+ if (nstats < 1) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get",
+ "no stats available for interface |%s| \n", name));
+ return -2;
+ }
+
+ size_str = nstats * ETH_GSTRING_LEN;
+
+ eth_strings = malloc(size_str + sizeof (struct ethtool_gstrings));
+ if (!eth_strings) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get",
+ "no memory available\n"));
+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_get, no memory available\n");
+
+ return -3;
+ }
+ memset (eth_strings, 0, (size_str + sizeof (struct ethtool_gstrings)));
+
+ eth_stats = malloc (size_str + sizeof (struct ethtool_stats));
+ if (!eth_stats) {
+ free (eth_strings);
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get",
+ "no memory available\n"));
+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_get, no memory available\n");
+
+ return -3;
+ }
+ memset (eth_stats, 0, (size_str + sizeof (struct ethtool_stats)));
+
+ eth_strings->cmd = ETHTOOL_GSTRINGS;
+ eth_strings->string_set = ETH_SS_STATS;
+ eth_strings->len = nstats;
+ ifr.ifr_data = (char *) eth_strings;
+ err = _dot3Stats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get",
+ "cannot get stats strings information for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_get, cannot get stats strings information for interface |%s| \n", name);
+
+ free(eth_strings);
+ free(eth_stats);
+ return -4;
+ }
+
+ eth_stats->cmd = ETHTOOL_GSTATS;
+ eth_stats->n_stats = nstats;
+ ifr.ifr_data = (char *) eth_stats;
+ err = _dot3Stats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get",
+ "cannot get stats strings information for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_get, cannot get stats information for interface |%s| \n", name);
+
+ free(eth_strings);
+ free(eth_stats);
+ return -5;
+ }
+
+ for (i = 0; i < nstats; i++) {
+ char s[ETH_GSTRING_LEN];
+
+ strlcpy(s, (const char *) &eth_strings->data[i * ETH_GSTRING_LEN],
+ sizeof(s));
+
+ if (DOT3STATSALIGNMENTERRORS(s)) {
+ data->dot3StatsAlignmentErrors = (u_long)eth_stats->data[i];
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSALIGNMENTERRORS_FLAG;
+ }
+
+ if (DOT3STATSMULTIPLECOLLISIONFRAMES(s)) {
+ data->dot3StatsMultipleCollisionFrames = (u_long)eth_stats->data[i];
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES_FLAG;
+ }
+
+ if (DOT3STATSLATECOLLISIONS(s)) {
+ data->dot3StatsLateCollisions = (u_long)eth_stats->data[i];
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSLATECOLLISIONS_FLAG;
+ }
+
+ if (DOT3STATSSINGLECOLLISIONFRAMES(s)) {
+ data->dot3StatsSingleCollisionFrames = (u_long)eth_stats->data[i];
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSSINGLECOLLISIONFRAMES_FLAG;
+ }
+
+ if (DOT3STATSEXCESSIVECOLLISIONS(s)) {
+ data->dot3StatsExcessiveCollisions = (u_long)eth_stats->data[i];
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSEXCESSIVECOLLISIONS_FLAG;
+ }
+ }
+
+ free(eth_strings);
+ free(eth_stats);
+
+ return 0;
+#else
+ return -6;
+#endif
+}
+
+
+/*
+ * @retval 0 success
+ * @retval -1 ETHTOOL_GSET failed
+ * @retval -2 function not supported if HAVE_LINUX_ETHTOOL_H not defined
+ */
+
+int
+interface_ioctl_dot3stats_duplex_get(dot3StatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name) {
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+ dot3StatsTable_data *data = &rowreq_ctx->data;
+ struct ethtool_cmd edata;
+ struct ifreq ifr;
+ int err;
+
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_duplex_get",
+ "called\n"));
+
+ memset(&edata, 0, sizeof (edata));
+ memset(&ifr, 0, sizeof (ifr));
+ edata.cmd = ETHTOOL_GSET;
+ ifr.ifr_data = (char *)&edata;
+
+ err = _dot3Stats_ioctl_get (fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_duplex_get",
+ "ETHTOOL_GSET failed\n"));
+
+ return -1;
+ }
+
+ if (err == 0) {
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSDUPLEXSTATUS_FLAG;
+ switch (edata.duplex) {
+ case DUPLEX_HALF:
+ data->dot3StatsDuplexStatus = (u_long) DOT3STATSDUPLEXSTATUS_HALFDUPLEX;
+ break;
+ case DUPLEX_FULL:
+ data->dot3StatsDuplexStatus = (u_long) DOT3STATSDUPLEXSTATUS_FULLDUPLEX;
+ break;
+ default:
+ data->dot3StatsDuplexStatus = (u_long) DOT3STATSDUPLEXSTATUS_UNKNOWN;
+ break;
+ };
+ }
+
+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_duplex_get",
+ "ETHTOOL_GSET processed\n"));
+ return err;
+#else
+ return -2;
+#endif
+}
+
+
+/*
+ * NAME: interface_sysclassnet_dot3stats_get
+ * PURPOSE: To get ethernet statistics from /sys/class/net/...
+ * ARGUMENTS: rowreq_ctx: where to store the value(s)
+ * name: interface name
+ * RETURNS: nothing. fields not set if data not available
+ */
+void
+interface_sysclassnet_dot3stats_get (dot3StatsTable_rowreq_ctx *rowreq_ctx, const char *name)
+{
+ u_long value;
+ dot3StatsTable_data *data = &rowreq_ctx->data;
+
+ if (getulongfromsysclassnetstatistics(name, "rx_errors", &value)) {
+ data->dot3StatsFCSErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSFCSERRORS_FLAG;
+ }
+ if (getulongfromsysclassnetstatistics(name, "tx_dropped", &value)) {
+ data->dot3StatsDeferredTransmissions = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSDEFERREDTRANSMISSIONS_FLAG;
+ }
+ if (getulongfromsysclassnetstatistics(name, "tx_fifo_errors", &value)) {
+ data->dot3StatsInternalMacTransmitErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS_FLAG;
+ }
+ if (getulongfromsysclassnetstatistics(name, "tx_carrier_errors", &value)) {
+ data->dot3StatsCarrierSenseErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSCARRIERSENSEERRORS_FLAG;
+ }
+ if (getulongfromsysclassnetstatistics(name, "rx_frame_errors", &value)) {
+ data->dot3StatsFrameTooLongs = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSFRAMETOOLONGS_FLAG;
+ }
+ if (getulongfromsysclassnetstatistics(name, "rx_fifo_errors", &value)) {
+ data->dot3StatsInternalMacReceiveErrors = value;
+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS_FLAG;
+ }
+
+ return;
+}
+
+
+
+/* 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
+ */
+int
+_dot3Stats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name)
+{
+ int ourfd = -1, rc = 0;
+
+ DEBUGMSGTL(("access:dot3StatsTable:ioctl", "_dot3Stats_ioctl_get\n"));
+
+ /*
+ * sanity checks
+ */
+ if(NULL == name) {
+ DEBUGMSGTL(("access:dot3StatsTable:ioctl",
+ "_dot3Stats_ioctl_get invalid ifname '%s'\n", name));
+ snmp_log (LOG_ERR, "access:dot3StatsTable:ioctl, _dot3Stats_ioctl_get error on interface '%s'\n", name);
+ return -1;
+ }
+
+ /*
+ * create socket for ioctls
+ */
+ if(fd < 0) {
+ fd = ourfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(ourfd < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:ioctl",
+ "dot3Stats_ioctl_get couldn't create a socket\n"));
+ snmp_log (LOG_ERR, "access:dot3StatsTable:ioctl, _dot3Stats_ioctl_get error on interface '%s'\n", name);
+
+ return -2;
+ }
+ }
+
+ strlcpy(ifrq->ifr_name, name, sizeof(ifrq->ifr_name));
+ rc = ioctl(fd, which, ifrq);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable:ioctl",
+ "dot3Stats_ioctl_get ioctl %d returned %d\n", which, rc));
+ rc = -3;
+ }
+
+ if(ourfd >= 0)
+ close(ourfd);
+
+ return rc;
+}
+
+
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable.h b/agent/mibgroup/etherlike-mib/dot3StatsTable.h
new file mode 100644
index 0000000..b04f7bf
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable.h
@@ -0,0 +1,11 @@
+/*
+ * module to include the modules
+ */
+
+config_require(etherlike-mib/data_access/dot3stats)
+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable)
+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable_data_get)
+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable_data_set)
+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable_data_access)
+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable_interface)
+
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c
new file mode 100644
index 0000000..b86380a
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c
@@ -0,0 +1,215 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for dot3StatsTable
+ *
+ * \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 "dot3StatsTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "dot3StatsTable_interface.h"
+
+oid dot3StatsTable_oid[] = { DOT3STATSTABLE_OID };
+int dot3StatsTable_oid_size = OID_LENGTH(dot3StatsTable_oid);
+
+dot3StatsTable_registration dot3StatsTable_user_context;
+static dot3StatsTable_registration *dot3StatsTable_user_context_p;
+
+void initialize_table_dot3StatsTable(void);
+void shutdown_table_dot3StatsTable(void);
+
+
+/**
+ * Initializes the dot3StatsTable module
+ */
+void
+init_dot3StatsTable(void)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:init_dot3StatsTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform dot3StatsTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("dot3StatsTable"))
+ initialize_table_dot3StatsTable();
+
+} /* init_dot3StatsTable */
+
+/**
+ * Shut-down the dot3StatsTable module (agent is exiting)
+ */
+void
+shutdown_dot3StatsTable(void)
+{
+ if (should_init("dot3StatsTable"))
+ shutdown_table_dot3StatsTable();
+
+}
+
+/**
+ * Initialize the table dot3StatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_dot3StatsTable(void)
+{
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:initialize_table_dot3StatsTable",
+ "called\n"));
+
+ /*
+ * TODO:301:o: Perform dot3StatsTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize dot3StatsTable 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.
+ */
+ dot3StatsTable_user_context_p
+ = netsnmp_create_data_list("dot3StatsTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _dot3StatsTable_initialize_interface(dot3StatsTable_user_context_p, flags);
+} /* initialize_table_dot3StatsTable */
+
+/**
+ * Shutdown the table dot3StatsTable
+ */
+void
+shutdown_table_dot3StatsTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _dot3StatsTable_shutdown_interface(dot3StatsTable_user_context_p);
+ netsnmp_free_all_list_data(dot3StatsTable_user_context_p);
+ dot3StatsTable_user_context_p = NULL;
+}
+
+/**
+ * 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
+dot3StatsTable_rowreq_ctx_init(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_rowreq_ctx_init",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra dot3StatsTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* dot3StatsTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+dot3StatsTable_rowreq_ctx_cleanup(dot3StatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_rowreq_ctx_cleanup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra dot3StatsTable rowreq cleanup.
+ */
+} /* dot3StatsTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+dot3StatsTable_pre_request(dot3StatsTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform dot3StatsTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* dot3StatsTable_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
+dot3StatsTable_post_request(dot3StatsTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform dot3StatsTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* dot3StatsTable_post_request */
+
+
+/** @{ */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h
new file mode 100644
index 0000000..c4713fc
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h
@@ -0,0 +1,271 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef DOT3STATSTABLE_H
+#define DOT3STATSTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * OID and column number definitions for dot3StatsTable
+ */
+#include "dot3StatsTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "dot3StatsTable_enums.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_dot3StatsTable(void);
+ void shutdown_dot3StatsTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table dot3StatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.10.7.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 dot3StatsTable registration context.
+ */
+ typedef netsnmp_data_list dot3StatsTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review dot3StatsTable data context structure.
+ * This structure is used to represent the data for dot3StatsTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * dot3StatsTable.
+ */
+ typedef struct dot3StatsTable_data_s {
+
+ /*
+ * dot3StatsAlignmentErrors(2)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsAlignmentErrors;
+
+ /*
+ * dot3StatsFCSErrors(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsFCSErrors;
+
+ /*
+ * dot3StatsSingleCollisionFrames(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsSingleCollisionFrames;
+
+ /*
+ * dot3StatsMultipleCollisionFrames(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsMultipleCollisionFrames;
+
+ /*
+ * dot3StatsSQETestErrors(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsSQETestErrors;
+
+ /*
+ * dot3StatsDeferredTransmissions(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsDeferredTransmissions;
+
+ /*
+ * dot3StatsLateCollisions(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsLateCollisions;
+
+ /*
+ * dot3StatsExcessiveCollisions(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsExcessiveCollisions;
+
+ /*
+ * dot3StatsInternalMacTransmitErrors(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsInternalMacTransmitErrors;
+
+ /*
+ * dot3StatsCarrierSenseErrors(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsCarrierSenseErrors;
+
+ /*
+ * dot3StatsFrameTooLongs(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsFrameTooLongs;
+
+ /*
+ * dot3StatsInternalMacReceiveErrors(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsInternalMacReceiveErrors;
+
+ /*
+ * dot3StatsEtherChipSet(17)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ oid dot3StatsEtherChipSet[128];
+ size_t dot3StatsEtherChipSet_len; /* # of oid elements, not bytes */
+
+ /*
+ * dot3StatsSymbolErrors(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long dot3StatsSymbolErrors;
+
+ /*
+ * dot3StatsDuplexStatus(19)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long dot3StatsDuplexStatus;
+
+ /*
+ * dot3StatsRateControlAbility(20)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long dot3StatsRateControlAbility;
+
+ /*
+ * dot3StatsRateControlStatus(21)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long dot3StatsRateControlStatus;
+
+ } dot3StatsTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review dot3StatsTable mib index.
+ * This structure is used to represent the index for dot3StatsTable.
+ */
+ typedef struct dot3StatsTable_mib_index_s {
+
+ /*
+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ long dot3StatsIndex;
+
+
+ } dot3StatsTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review dot3StatsTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_dot3StatsTable_IDX_LEN 255
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review dot3StatsTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * dot3StatsTable_rowreq_ctx pointer.
+ */
+ typedef struct dot3StatsTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_dot3StatsTable_IDX_LEN];
+
+ dot3StatsTable_mib_index tbl_idx;
+
+ dot3StatsTable_data data;
+ unsigned int column_exists_flags; /* flags for existence */
+
+ /*
+ * 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 dot3StatsTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *dot3StatsTable_data_list;
+
+ } dot3StatsTable_rowreq_ctx;
+
+ typedef struct dot3StatsTable_ref_rowreq_ctx_s {
+ dot3StatsTable_rowreq_ctx *rowreq_ctx;
+ } dot3StatsTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int dot3StatsTable_pre_request(dot3StatsTable_registration
+ * user_context);
+ int dot3StatsTable_post_request(dot3StatsTable_registration
+ * user_context, int rc);
+
+ int
+ dot3StatsTable_rowreq_ctx_init(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ dot3StatsTable_rowreq_ctx_cleanup(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ dot3StatsTable_rowreq_ctx
+ *dot3StatsTable_row_find_by_mib_index(dot3StatsTable_mib_index *
+ mib_idx);
+
+ extern oid dot3StatsTable_oid[];
+ extern int dot3StatsTable_oid_size;
+
+
+#include "dot3StatsTable_interface.h"
+#include "dot3StatsTable_data_access.h"
+#include "dot3StatsTable_data_get.h"
+#include "dot3StatsTable_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 /* DOT3STATSTABLE_H */
+/** @} */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c
new file mode 100644
index 0000000..5414001
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c
@@ -0,0 +1,417 @@
+/*
+ * 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 "dot3StatsTable.h"
+#include "dot3StatsTable_data_access.h"
+
+#if defined(linux)
+#include "ioctl_imp_common.h"
+#endif
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table dot3StatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.10.7.2, length: 9
+ */
+
+/**
+ * initialization for dot3StatsTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param dot3StatsTable_reg
+ * Pointer to dot3StatsTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+dot3StatsTable_init_data(dot3StatsTable_registration * dot3StatsTable_reg)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize dot3StatsTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* dot3StatsTable_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
+dot3StatsTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to dot3StatsTable_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 dot3StatsTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up dot3StatsTable 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 = DOT3STATSTABLE_CACHE_TIMEOUT; /* seconds */
+} /* dot3StatsTable_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 dot3StatsTable_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
+dot3StatsTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_container_shutdown",
+ "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to dot3StatsTable_container_shutdown\n");
+ return;
+ }
+
+} /* dot3StatsTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement dot3StatsTable 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
+ * dot3StatsTable_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.
+ *
+ */
+
+/*
+ *
+ * @retval MFD_SUCCESS success
+ * @retval MFD_ERROR could not get the interface names
+ * @retval MFD_RESOURCE_UNAVAILABLE failed to allocate memory
+ * @retval -2 could not open a socket
+ */
+
+
+int
+dot3StatsTable_container_load(netsnmp_container * container)
+{
+ dot3StatsTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int fd;
+#if defined(linux)
+ long dot3StatsIndex;
+ int rc = 0, retval = 0;
+ struct ifname *list_head = NULL, *p = NULL;
+#endif
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_container_load",
+ "called\n"));
+
+ /*
+ * TODO:352:M: | |-> set indexes in new dot3StatsTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+
+ /*
+ * temporary storage for index values
+ */
+
+ /*
+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+
+
+
+ /*
+ * 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;
+ }
+
+ /*
+ * get the interface names of the devices present in the system, in case of failure retval suggests the reson for failure
+ * and list_head contains null
+ */
+
+#if defined(linux)
+ list_head = dot3stats_interface_name_list_get (list_head, &retval);
+
+ if (!list_head) {
+ snmp_log (LOG_ERR, "access:dot3StatsTable, error getting the interface names present in the system\n");
+ DEBUGMSGTL(("access:dot3StatsTable", "error getting the interface names present in the system"));
+ close(fd);
+ return MFD_ERROR;
+ }
+
+ /*
+ * Walk over the list of interface names present in the system and retreive the statistics
+ */
+
+ for (p = list_head; p; p = p->ifn_next) {
+ DEBUGMSGTL(("access:dot3StatsTable", "processing '%s'\n", p->name));
+
+ /*
+ * get index via ioctl.
+ */
+
+ dot3StatsIndex = (long) dot3stats_interface_ioctl_ifindex_get(-1, p->name);
+
+ /*
+ * get the dot3stats contents populated, if the device is not an ethernet device
+ * the operation will not be supported and an error message will be logged
+ */
+
+ rowreq_ctx = dot3StatsTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation for dot3StatsTable failed\n");
+ close(fd);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ if (MFD_SUCCESS !=
+ dot3StatsTable_indexes_set(rowreq_ctx, dot3StatsIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "dot3StatsTable data.\n");
+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate dot3StatsTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * non-TRANSIENT data: no need to copy. set pointer to data
+ */
+
+ memset (&rowreq_ctx->data, 0, sizeof (rowreq_ctx->data));
+ rc = interface_ioctl_dot3stats_get (rowreq_ctx, fd, p->name);
+
+ if (rc < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable", "error getting the statistics for interface |%s| "
+ "dot3StatsTable data, operation might not be supported\n", p->name));
+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ rc = interface_ioctl_dot3stats_duplex_get(rowreq_ctx, fd, p->name);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable", "error getting the duplex status for |%s| "
+ "dot3StatsTable data, operation might not be supported\n", p->name));
+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ interface_sysclassnet_dot3stats_get(rowreq_ctx, p->name);
+
+ interface_dot3stats_get_errorcounters(rowreq_ctx, p->name);
+
+ /*
+ * insert into table container
+ */
+ rc = CONTAINER_INSERT(container, rowreq_ctx);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:dot3StatsTable", "error inserting |%s|", p->name));
+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ ++count;
+ }
+
+ close(fd);
+
+ /*
+ * free the interface names list
+ */
+
+ if ( (dot3stats_interface_name_list_free(list_head)) < 0) {
+ snmp_log(LOG_ERR, "access:dot3StatsTable, error freeing the interface name list \n");
+ DEBUGMSGTL(("access:dot3StatsTable", "error freeing the interface name list\n"));
+ return MFD_ERROR;
+ }
+#endif
+
+ DEBUGMSGT(("verbose:dot3StatsTable:dot3StatsTable_container_load",
+ "inserted %" NETSNMP_PRIz "d records\n", count));
+
+ return MFD_SUCCESS;
+} /* dot3StatsTable_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
+dot3StatsTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free dot3StatsTable container data.
+ */
+} /* dot3StatsTable_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
+dot3StatsTable_row_prep(dot3StatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_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;
+} /* dot3StatsTable_row_prep */
+
+/** @} */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h
new file mode 100644
index 0000000..f4b39a9
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h
@@ -0,0 +1,79 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef DOT3STATSTABLE_DATA_ACCESS_H
+#define DOT3STATSTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table dot3StatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.10.7.2, length: 9
+ */
+
+
+ int dot3StatsTable_init_data(dot3StatsTable_registration *
+ dot3StatsTable_reg);
+
+
+ /*
+ * TODO:180:o: Review dot3StatsTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define DOT3STATSTABLE_CACHE_TIMEOUT 60
+
+ void dot3StatsTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void dot3StatsTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int dot3StatsTable_container_load(netsnmp_container *
+ container);
+ void dot3StatsTable_container_free(netsnmp_container *
+ container);
+
+ int dot3StatsTable_cache_load(netsnmp_container *
+ container);
+ void dot3StatsTable_cache_free(netsnmp_container *
+ container);
+
+#define MAX_LINE_SIZE 256
+
+ int dot3StatsTable_row_prep(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ void interface_sysclassnet_dot3stats_get
+ (dot3StatsTable_rowreq_ctx * rowreq_ctx, const char *name);
+ void interface_dot3stats_get_errorcounters
+ (dot3StatsTable_rowreq_ctx * rowreq_ctx, const char *name);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DOT3STATSTABLE_DATA_ACCESS_H */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.c b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.c
new file mode 100644
index 0000000..42646e0
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.c
@@ -0,0 +1,1450 @@
+/*
+ * 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 "dot3StatsTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement dot3StatsTable get routines.
+ * TODO:240:M: Implement dot3StatsTable 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 dot3StatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.10.7.2, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement dot3StatsTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param dot3StatsIndex_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
+dot3StatsTable_indexes_set_tbl_idx(dot3StatsTable_mib_index * tbl_idx,
+ long dot3StatsIndex_val)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ tbl_idx->dot3StatsIndex = dot3StatsIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* dot3StatsTable_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
+dot3StatsTable_indexes_set(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ long dot3StatsIndex_val)
+{
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ dot3StatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ dot3StatsIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != dot3StatsTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* dot3StatsTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsAlignmentErrors
+ * dot3StatsAlignmentErrors is subid 2 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.2
+ * Description:
+A count of frames received on a particular
+ interface that are not an integral number of
+ octets in length and do not pass the FCS check.
+
+ The count represented by an instance of this
+ object is incremented when the alignmentError
+ status is returned by the MAC service to the
+ LLC (or other MAC user). Received frames for
+ which multiple error conditions pertain are,
+ according to the conventions of IEEE 802.3
+ Layer Management, counted exclusively according
+
+ to the error status presented to the LLC.
+
+ This counter does not increment for group
+ encoding schemes greater than 4 bits per group.
+
+ For interfaces operating at 10 Gb/s, this
+ counter can roll over in less than 5 minutes if
+ it is incrementing at its maximum rate. Since
+ that amount of time could be less than a
+ management station's poll cycle time, in order
+ to avoid a loss of information, a management
+ station is advised to poll the
+ dot3HCStatsAlignmentErrors object for 10 Gb/s
+ or faster interfaces.
+
+ 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 dot3StatsAlignmentErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsAlignmentErrors_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
+dot3StatsAlignmentErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * dot3StatsAlignmentErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsAlignmentErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsAlignmentErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsAlignmentErrors data.
+ * copy (* dot3StatsAlignmentErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsAlignmentErrors_val_ptr) =
+ rowreq_ctx->data.dot3StatsAlignmentErrors;
+
+ return MFD_SUCCESS;
+} /* dot3StatsAlignmentErrors_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsFCSErrors
+ * dot3StatsFCSErrors is subid 3 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.3
+ * Description:
+A count of frames received on a particular
+ interface that are an integral number of octets
+ in length but do not pass the FCS check. This
+ count does not include frames received with
+ frame-too-long or frame-too-short error.
+
+ The count represented by an instance of this
+ object is incremented when the frameCheckError
+ status is returned by the MAC service to the
+ LLC (or other MAC user). Received frames for
+ which multiple error conditions pertain are,
+ according to the conventions of IEEE 802.3
+ Layer Management, counted exclusively according
+ to the error status presented to the LLC.
+
+ Note: Coding errors detected by the physical
+ layer for speeds above 10 Mb/s will cause the
+ frame to fail the FCS check.
+
+ For interfaces operating at 10 Gb/s, this
+ counter can roll over in less than 5 minutes if
+
+ it is incrementing at its maximum rate. Since
+ that amount of time could be less than a
+ management station's poll cycle time, in order
+ to avoid a loss of information, a management
+ station is advised to poll the
+ dot3HCStatsFCSErrors object for 10 Gb/s or
+ faster interfaces.
+
+ 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 dot3StatsFCSErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsFCSErrors_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
+dot3StatsFCSErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * dot3StatsFCSErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsFCSErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsFCSErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsFCSErrors data.
+ * copy (* dot3StatsFCSErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsFCSErrors_val_ptr) = rowreq_ctx->data.dot3StatsFCSErrors;
+
+ return MFD_SUCCESS;
+} /* dot3StatsFCSErrors_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsSingleCollisionFrames
+ * dot3StatsSingleCollisionFrames is subid 4 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.4
+ * Description:
+A count of frames that are involved in a single
+ collision, and are subsequently transmitted
+ successfully.
+
+ A frame that is counted by an instance of this
+ object is also counted by the corresponding
+ instance of either the ifOutUcastPkts,
+ ifOutMulticastPkts, or ifOutBroadcastPkts,
+ and is not counted by the corresponding
+ instance of the dot3StatsMultipleCollisionFrames
+ object.
+
+ This counter does not increment when the
+ interface is operating in full-duplex mode.
+
+ 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 dot3StatsSingleCollisionFrames data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsSingleCollisionFrames_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
+dot3StatsSingleCollisionFrames_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ dot3StatsSingleCollisionFrames_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsSingleCollisionFrames_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsSingleCollisionFrames_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsSingleCollisionFrames data.
+ * copy (* dot3StatsSingleCollisionFrames_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsSingleCollisionFrames_val_ptr) =
+ rowreq_ctx->data.dot3StatsSingleCollisionFrames;
+
+ return MFD_SUCCESS;
+} /* dot3StatsSingleCollisionFrames_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsMultipleCollisionFrames
+ * dot3StatsMultipleCollisionFrames is subid 5 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.5
+ * Description:
+A count of frames that are involved in more
+
+ than one collision and are subsequently
+ transmitted successfully.
+
+ A frame that is counted by an instance of this
+ object is also counted by the corresponding
+ instance of either the ifOutUcastPkts,
+ ifOutMulticastPkts, or ifOutBroadcastPkts,
+ and is not counted by the corresponding
+ instance of the dot3StatsSingleCollisionFrames
+ object.
+
+ This counter does not increment when the
+ interface is operating in full-duplex mode.
+
+ 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 dot3StatsMultipleCollisionFrames data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsMultipleCollisionFrames_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
+dot3StatsMultipleCollisionFrames_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsMultipleCollisionFrames_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsMultipleCollisionFrames_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsMultipleCollisionFrames_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsMultipleCollisionFrames data.
+ * copy (* dot3StatsMultipleCollisionFrames_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsMultipleCollisionFrames_val_ptr) =
+ rowreq_ctx->data.dot3StatsMultipleCollisionFrames;
+
+ return MFD_SUCCESS;
+} /* dot3StatsMultipleCollisionFrames_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsSQETestErrors
+ * dot3StatsSQETestErrors is subid 6 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.6
+ * Description:
+A count of times that the SQE TEST ERROR
+ is received on a particular interface. The
+ SQE TEST ERROR is set in accordance with the
+ rules for verification of the SQE detection
+ mechanism in the PLS Carrier Sense Function as
+ described in IEEE Std. 802.3, 2000 Edition,
+ section 7.2.4.6.
+
+ This counter does not increment on interfaces
+ operating at speeds greater than 10 Mb/s, or on
+ interfaces operating in full-duplex mode.
+
+ 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 dot3StatsSQETestErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsSQETestErrors_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
+dot3StatsSQETestErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * dot3StatsSQETestErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsSQETestErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsSQETestErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsSQETestErrors data.
+ * copy (* dot3StatsSQETestErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsSQETestErrors_val_ptr) =
+ rowreq_ctx->data.dot3StatsSQETestErrors;
+
+ return MFD_SUCCESS;
+} /* dot3StatsSQETestErrors_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsDeferredTransmissions
+ * dot3StatsDeferredTransmissions is subid 7 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.7
+ * Description:
+A count of frames for which the first
+ transmission attempt on a particular interface
+ is delayed because the medium is busy.
+
+ The count represented by an instance of this
+ object does not include frames involved in
+ collisions.
+
+ This counter does not increment when the
+ interface is operating in full-duplex mode.
+
+ 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 dot3StatsDeferredTransmissions data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsDeferredTransmissions_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
+dot3StatsDeferredTransmissions_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ dot3StatsDeferredTransmissions_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsDeferredTransmissions_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsDeferredTransmissions_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsDeferredTransmissions data.
+ * copy (* dot3StatsDeferredTransmissions_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsDeferredTransmissions_val_ptr) =
+ rowreq_ctx->data.dot3StatsDeferredTransmissions;
+
+ return MFD_SUCCESS;
+} /* dot3StatsDeferredTransmissions_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsLateCollisions
+ * dot3StatsLateCollisions is subid 8 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.8
+ * Description:
+The number of times that a collision is
+ detected on a particular interface later than
+ one slotTime into the transmission of a packet.
+
+ A (late) collision included in a count
+ represented by an instance of this object is
+ also considered as a (generic) collision for
+ purposes of other collision-related
+ statistics.
+
+ This counter does not increment when the
+ interface is operating in full-duplex mode.
+
+ 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 dot3StatsLateCollisions data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsLateCollisions_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
+dot3StatsLateCollisions_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * dot3StatsLateCollisions_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsLateCollisions_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsLateCollisions_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsLateCollisions data.
+ * copy (* dot3StatsLateCollisions_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsLateCollisions_val_ptr) =
+ rowreq_ctx->data.dot3StatsLateCollisions;
+
+ return MFD_SUCCESS;
+} /* dot3StatsLateCollisions_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsExcessiveCollisions
+ * dot3StatsExcessiveCollisions is subid 9 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.9
+ * Description:
+A count of frames for which transmission on a
+ particular interface fails due to excessive
+ collisions.
+
+ This counter does not increment when the
+ interface is operating in full-duplex mode.
+
+ 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 dot3StatsExcessiveCollisions data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsExcessiveCollisions_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
+dot3StatsExcessiveCollisions_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ dot3StatsExcessiveCollisions_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsExcessiveCollisions_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsExcessiveCollisions_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsExcessiveCollisions data.
+ * copy (* dot3StatsExcessiveCollisions_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsExcessiveCollisions_val_ptr) =
+ rowreq_ctx->data.dot3StatsExcessiveCollisions;
+
+ return MFD_SUCCESS;
+} /* dot3StatsExcessiveCollisions_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsInternalMacTransmitErrors
+ * dot3StatsInternalMacTransmitErrors is subid 10 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.10
+ * Description:
+A count of frames for which transmission on a
+ particular interface fails due to an internal
+ MAC sublayer transmit error. A frame is only
+ counted by an instance of this object if it is
+ not counted by the corresponding instance of
+ either the dot3StatsLateCollisions object, the
+ dot3StatsExcessiveCollisions object, or the
+ dot3StatsCarrierSenseErrors object.
+
+ The precise meaning of the count represented by
+ an instance of this object is implementation-
+ specific. In particular, an instance of this
+ object may represent a count of transmission
+ errors on a particular interface that are not
+ otherwise counted.
+
+ For interfaces operating at 10 Gb/s, this
+ counter can roll over in less than 5 minutes if
+ it is incrementing at its maximum rate. Since
+ that amount of time could be less than a
+ management station's poll cycle time, in order
+ to avoid a loss of information, a management
+ station is advised to poll the
+ dot3HCStatsInternalMacTransmitErrors object for
+ 10 Gb/s or faster interfaces.
+
+ 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 dot3StatsInternalMacTransmitErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsInternalMacTransmitErrors_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
+dot3StatsInternalMacTransmitErrors_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsInternalMacTransmitErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsInternalMacTransmitErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsInternalMacTransmitErrors_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsInternalMacTransmitErrors data.
+ * copy (* dot3StatsInternalMacTransmitErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsInternalMacTransmitErrors_val_ptr) =
+ rowreq_ctx->data.dot3StatsInternalMacTransmitErrors;
+
+ return MFD_SUCCESS;
+} /* dot3StatsInternalMacTransmitErrors_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsCarrierSenseErrors
+ * dot3StatsCarrierSenseErrors is subid 11 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.11
+ * Description:
+The number of times that the carrier sense
+ condition was lost or never asserted when
+ attempting to transmit a frame on a particular
+ interface.
+
+ The count represented by an instance of this
+ object is incremented at most once per
+ transmission attempt, even if the carrier sense
+ condition fluctuates during a transmission
+ attempt.
+
+ This counter does not increment when the
+ interface is operating in full-duplex mode.
+
+ 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 dot3StatsCarrierSenseErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsCarrierSenseErrors_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
+dot3StatsCarrierSenseErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ dot3StatsCarrierSenseErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsCarrierSenseErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsCarrierSenseErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsCarrierSenseErrors data.
+ * copy (* dot3StatsCarrierSenseErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsCarrierSenseErrors_val_ptr) =
+ rowreq_ctx->data.dot3StatsCarrierSenseErrors;
+
+ return MFD_SUCCESS;
+} /* dot3StatsCarrierSenseErrors_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsFrameTooLongs
+ * dot3StatsFrameTooLongs is subid 13 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.13
+ * Description:
+A count of frames received on a particular
+ interface that exceed the maximum permitted
+ frame size.
+
+ The count represented by an instance of this
+ object is incremented when the frameTooLong
+ status is returned by the MAC service to the
+ LLC (or other MAC user). Received frames for
+ which multiple error conditions pertain are,
+ according to the conventions of IEEE 802.3
+ Layer Management, counted exclusively according
+ to the error status presented to the LLC.
+
+ For interfaces operating at 10 Gb/s, this
+ counter can roll over in less than 80 minutes if
+ it is incrementing at its maximum rate. Since
+ that amount of time could be less than a
+ management station's poll cycle time, in order
+ to avoid a loss of information, a management
+ station is advised to poll the
+ dot3HCStatsFrameTooLongs object for 10 Gb/s
+ or faster interfaces.
+
+ 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 dot3StatsFrameTooLongs data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsFrameTooLongs_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
+dot3StatsFrameTooLongs_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * dot3StatsFrameTooLongs_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsFrameTooLongs_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsFrameTooLongs_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsFrameTooLongs data.
+ * copy (* dot3StatsFrameTooLongs_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsFrameTooLongs_val_ptr) =
+ rowreq_ctx->data.dot3StatsFrameTooLongs;
+
+ return MFD_SUCCESS;
+} /* dot3StatsFrameTooLongs_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsInternalMacReceiveErrors
+ * dot3StatsInternalMacReceiveErrors is subid 16 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.16
+ * Description:
+A count of frames for which reception on a
+ particular interface fails due to an internal
+ MAC sublayer receive error. A frame is only
+ counted by an instance of this object if it is
+ not counted by the corresponding instance of
+ either the dot3StatsFrameTooLongs object, the
+ dot3StatsAlignmentErrors object, or the
+ dot3StatsFCSErrors object.
+
+ The precise meaning of the count represented by
+ an instance of this object is implementation-
+ specific. In particular, an instance of this
+ object may represent a count of receive errors
+ on a particular interface that are not
+ otherwise counted.
+
+ For interfaces operating at 10 Gb/s, this
+ counter can roll over in less than 5 minutes if
+
+ it is incrementing at its maximum rate. Since
+ that amount of time could be less than a
+ management station's poll cycle time, in order
+ to avoid a loss of information, a management
+ station is advised to poll the
+ dot3HCStatsInternalMacReceiveErrors object for
+ 10 Gb/s or faster interfaces.
+
+ 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 dot3StatsInternalMacReceiveErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsInternalMacReceiveErrors_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
+dot3StatsInternalMacReceiveErrors_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsInternalMacReceiveErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsInternalMacReceiveErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsInternalMacReceiveErrors_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsInternalMacReceiveErrors data.
+ * copy (* dot3StatsInternalMacReceiveErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsInternalMacReceiveErrors_val_ptr) =
+ rowreq_ctx->data.dot3StatsInternalMacReceiveErrors;
+
+ return MFD_SUCCESS;
+} /* dot3StatsInternalMacReceiveErrors_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsEtherChipSet
+ * dot3StatsEtherChipSet is subid 17 of dot3StatsEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.17
+ * Description:
+******** THIS OBJECT IS DEPRECATED ********
+
+ This object contains an OBJECT IDENTIFIER
+ which identifies the chipset used to
+ realize the interface. Ethernet-like
+ interfaces are typically built out of
+ several different chips. The MIB implementor
+ is presented with a decision of which chip
+ to identify via this object. The implementor
+ should identify the chip which is usually
+ called the Medium Access Control chip.
+ If no such chip is easily identifiable,
+ the implementor should identify the chip
+ which actually gathers the transmit
+ and receive statistics and error
+ indications. This would allow a
+ manager station to correlate the
+ statistics and the chip generating
+ them, giving it the ability to take
+ into account any known anomalies
+ in the chip.
+
+ This object has been deprecated. Implementation
+ feedback indicates that it is of limited use for
+ debugging network problems in the field, and
+ the administrative overhead involved in
+ maintaining a registry of chipset OIDs is not
+ justified.
+ *
+ * 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.
+ */
+/**
+ * Extract the current value of the dot3StatsEtherChipSet data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsEtherChipSet_val_ptr_ptr
+ * Pointer to storage for a oid variable
+ * @param dot3StatsEtherChipSet_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by dot3StatsEtherChipSet.
+ * 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 (*dot3StatsEtherChipSet_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update dot3StatsEtherChipSet_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
+dot3StatsEtherChipSet_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ oid ** dot3StatsEtherChipSet_val_ptr_ptr,
+ size_t *dot3StatsEtherChipSet_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != dot3StatsEtherChipSet_val_ptr_ptr)
+ && (NULL != *dot3StatsEtherChipSet_val_ptr_ptr));
+ netsnmp_assert(NULL != dot3StatsEtherChipSet_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsEtherChipSet_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsEtherChipSet data.
+ * copy (* dot3StatsEtherChipSet_val_ptr_ptr ) data and (* dot3StatsEtherChipSet_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for dot3StatsEtherChipSet data
+ */
+ if ((NULL == (*dot3StatsEtherChipSet_val_ptr_ptr)) ||
+ ((*dot3StatsEtherChipSet_val_ptr_len_ptr) <
+ (rowreq_ctx->data.dot3StatsEtherChipSet_len *
+ sizeof(rowreq_ctx->data.dot3StatsEtherChipSet[0])))) {
+ /*
+ * allocate space for dot3StatsEtherChipSet data
+ */
+ (*dot3StatsEtherChipSet_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.dot3StatsEtherChipSet_len *
+ sizeof(rowreq_ctx->data.dot3StatsEtherChipSet[0]));
+ if (NULL == (*dot3StatsEtherChipSet_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*dot3StatsEtherChipSet_val_ptr_len_ptr) =
+ rowreq_ctx->data.dot3StatsEtherChipSet_len *
+ sizeof(rowreq_ctx->data.dot3StatsEtherChipSet[0]);
+ memcpy((*dot3StatsEtherChipSet_val_ptr_ptr),
+ rowreq_ctx->data.dot3StatsEtherChipSet,
+ rowreq_ctx->data.dot3StatsEtherChipSet_len *
+ sizeof(rowreq_ctx->data.dot3StatsEtherChipSet[0]));
+
+ return MFD_SUCCESS;
+} /* dot3StatsEtherChipSet_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsSymbolErrors
+ * dot3StatsSymbolErrors is subid 18 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.18
+ * Description:
+For an interface operating at 100 Mb/s, the
+ number of times there was an invalid data symbol
+ when a valid carrier was present.
+
+ For an interface operating in half-duplex mode
+ at 1000 Mb/s, the number of times the receiving
+ media is non-idle (a carrier event) for a period
+ of time equal to or greater than slotTime, and
+ during which there was at least one occurrence
+ of an event that causes the PHY to indicate
+ 'Data reception error' or 'carrier extend error'
+ on the GMII.
+
+ For an interface operating in full-duplex mode
+ at 1000 Mb/s, the number of times the receiving
+ media is non-idle (a carrier event) for a period
+ of time equal to or greater than minFrameSize,
+ and during which there was at least one
+ occurrence of an event that causes the PHY to
+ indicate 'Data reception error' on the GMII.
+
+ For an interface operating at 10 Gb/s, the
+ number of times the receiving media is non-idle
+ (a carrier event) for a period of time equal to
+ or greater than minFrameSize, and during which
+ there was at least one occurrence of an event
+ that causes the PHY to indicate 'Receive Error'
+ on the XGMII.
+
+ The count represented by an instance of this
+ object is incremented at most once per carrier
+ event, even if multiple symbol errors occur
+ during the carrier event. This count does
+ not increment if a collision is present.
+
+ This counter does not increment when the
+ interface is operating at 10 Mb/s.
+
+ For interfaces operating at 10 Gb/s, this
+ counter can roll over in less than 5 minutes if
+ it is incrementing at its maximum rate. Since
+ that amount of time could be less than a
+
+ management station's poll cycle time, in order
+ to avoid a loss of information, a management
+ station is advised to poll the
+ dot3HCStatsSymbolErrors object for 10 Gb/s
+ or faster interfaces.
+
+ 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 dot3StatsSymbolErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsSymbolErrors_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
+dot3StatsSymbolErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * dot3StatsSymbolErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsSymbolErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsSymbolErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsSymbolErrors data.
+ * copy (* dot3StatsSymbolErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsSymbolErrors_val_ptr) =
+ rowreq_ctx->data.dot3StatsSymbolErrors;
+
+ return MFD_SUCCESS;
+} /* dot3StatsSymbolErrors_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsDuplexStatus
+ * dot3StatsDuplexStatus is subid 19 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.19
+ * Description:
+The current mode of operation of the MAC
+ entity. 'unknown' indicates that the current
+ duplex mode could not be determined.
+
+ Management control of the duplex mode is
+ accomplished through the MAU MIB. When
+ an interface does not support autonegotiation,
+ or when autonegotiation is not enabled, the
+ duplex mode is controlled using
+ ifMauDefaultType. When autonegotiation is
+ supported and enabled, duplex mode is controlled
+ using ifMauAutoNegAdvertisedBits. In either
+ case, the currently operating duplex mode is
+ reflected both in this object and in ifMauType.
+
+ Note that this object provides redundant
+ information with ifMauType. Normally, redundant
+ objects are discouraged. However, in this
+ instance, it allows a management application to
+ determine the duplex status of an interface
+ without having to know every possible value of
+ ifMauType. This was felt to be sufficiently
+ valuable to justify the redundancy.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: unknown(1), halfDuplex(2), fullDuplex(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 dot3StatsDuplexStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsDuplexStatus_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
+dot3StatsDuplexStatus_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * dot3StatsDuplexStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsDuplexStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsDuplexStatus_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsDuplexStatus data.
+ * copy (* dot3StatsDuplexStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsDuplexStatus_val_ptr) =
+ rowreq_ctx->data.dot3StatsDuplexStatus;
+
+ return MFD_SUCCESS;
+} /* dot3StatsDuplexStatus_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsRateControlAbility
+ * dot3StatsRateControlAbility is subid 20 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.20
+ * Description:
+'true' for interfaces operating at speeds above
+ 1000 Mb/s that support Rate Control through
+ lowering the average data rate of the MAC
+ sublayer, with frame granularity, and 'false'
+ 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 dot3StatsRateControlAbility data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsRateControlAbility_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
+dot3StatsRateControlAbility_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ dot3StatsRateControlAbility_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsRateControlAbility_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsRateControlAbility_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsRateControlAbility data.
+ * copy (* dot3StatsRateControlAbility_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsRateControlAbility_val_ptr) =
+ rowreq_ctx->data.dot3StatsRateControlAbility;
+
+ return MFD_SUCCESS;
+} /* dot3StatsRateControlAbility_get */
+
+/*---------------------------------------------------------------------
+ * EtherLike-MIB::dot3StatsEntry.dot3StatsRateControlStatus
+ * dot3StatsRateControlStatus is subid 21 of dot3StatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.10.7.2.1.21
+ * Description:
+The current Rate Control mode of operation of
+ the MAC sublayer of this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: rateControlOff(1), rateControlOn(2), unknown(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 dot3StatsRateControlStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param dot3StatsRateControlStatus_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
+dot3StatsRateControlStatus_get(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * dot3StatsRateControlStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != dot3StatsRateControlStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsRateControlStatus_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the dot3StatsRateControlStatus data.
+ * copy (* dot3StatsRateControlStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*dot3StatsRateControlStatus_val_ptr) =
+ rowreq_ctx->data.dot3StatsRateControlStatus;
+
+ return MFD_SUCCESS;
+} /* dot3StatsRateControlStatus_get */
+
+
+
+/** @} */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.h b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.h
new file mode 100644
index 0000000..e543cd3
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.h
@@ -0,0 +1,143 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file dot3StatsTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef DOT3STATSTABLE_DATA_GET_H
+#define DOT3STATSTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table dot3StatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.10.7.2, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int dot3StatsAlignmentErrors_get(dot3StatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ dot3StatsAlignmentErrors_val_ptr);
+ int dot3StatsFCSErrors_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsFCSErrors_val_ptr);
+ int
+ dot3StatsSingleCollisionFrames_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsSingleCollisionFrames_val_ptr);
+ int
+ dot3StatsMultipleCollisionFrames_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsMultipleCollisionFrames_val_ptr);
+ int dot3StatsSQETestErrors_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsSQETestErrors_val_ptr);
+ int
+ dot3StatsDeferredTransmissions_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsDeferredTransmissions_val_ptr);
+ int dot3StatsLateCollisions_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsLateCollisions_val_ptr);
+ int
+ dot3StatsExcessiveCollisions_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsExcessiveCollisions_val_ptr);
+ int
+ dot3StatsInternalMacTransmitErrors_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsInternalMacTransmitErrors_val_ptr);
+ int
+ dot3StatsCarrierSenseErrors_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsCarrierSenseErrors_val_ptr);
+ int dot3StatsFrameTooLongs_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsFrameTooLongs_val_ptr);
+ int
+ dot3StatsInternalMacReceiveErrors_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsInternalMacReceiveErrors_val_ptr);
+ int dot3StatsEtherChipSet_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ oid **
+ dot3StatsEtherChipSet_val_ptr_ptr,
+ size_t
+ *dot3StatsEtherChipSet_val_ptr_len_ptr);
+ int dot3StatsSymbolErrors_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsSymbolErrors_val_ptr);
+ int dot3StatsDuplexStatus_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsDuplexStatus_val_ptr);
+ int
+ dot3StatsRateControlAbility_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsRateControlAbility_val_ptr);
+ int
+ dot3StatsRateControlStatus_get(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ dot3StatsRateControlStatus_val_ptr);
+
+
+ int
+ dot3StatsTable_indexes_set_tbl_idx(dot3StatsTable_mib_index *
+ tbl_idx,
+ long dot3StatsIndex_val);
+ int dot3StatsTable_indexes_set(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx,
+ long dot3StatsIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DOT3STATSTABLE_DATA_GET_H */
+/** @} */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.c b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.c
new file mode 100644
index 0000000..44c2da2
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_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 "dot3StatsTable.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/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.h b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.h
new file mode 100644
index 0000000..6a03356
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.h
@@ -0,0 +1,28 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef DOT3STATSTABLE_DATA_SET_H
+#define DOT3STATSTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DOT3STATSTABLE_DATA_SET_H */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h
new file mode 100644
index 0000000..88a72e4
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h
@@ -0,0 +1,89 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef DOT3STATSTABLE_ENUMS_H
+#define DOT3STATSTABLE_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 dot3StatsTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * dot3StatsDuplexStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef DOT3STATSDUPLEXSTATUS_ENUMS
+#define DOT3STATSDUPLEXSTATUS_ENUMS
+
+#define DOT3STATSDUPLEXSTATUS_UNKNOWN 1
+#define DOT3STATSDUPLEXSTATUS_HALFDUPLEX 2
+#define DOT3STATSDUPLEXSTATUS_FULLDUPLEX 3
+
+#endif /* DOT3STATSDUPLEXSTATUS_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * dot3StatsRateControlAbility (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
+ * dot3StatsRateControlStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef DOT3STATSRATECONTROLSTATUS_ENUMS
+#define DOT3STATSRATECONTROLSTATUS_ENUMS
+
+#define DOT3STATSRATECONTROLSTATUS_RATECONTROLOFF 1
+#define DOT3STATSRATECONTROLSTATUS_RATECONTROLON 2
+#define DOT3STATSRATECONTROLSTATUS_UNKNOWN 3
+
+#endif /* DOT3STATSRATECONTROLSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DOT3STATSTABLE_ENUMS_H */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c
new file mode 100644
index 0000000..e0741f3
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c
@@ -0,0 +1,1187 @@
+/*
+ * 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/net-snmp-features.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "dot3StatsTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "dot3StatsTable_interface.h"
+
+#include <ctype.h>
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table dot3StatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.10.7.2, length: 9
+ */
+typedef struct dot3StatsTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ dot3StatsTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} dot3StatsTable_interface_ctx;
+
+static dot3StatsTable_interface_ctx dot3StatsTable_if_ctx;
+
+static void _dot3StatsTable_container_init(dot3StatsTable_interface_ctx
+ * if_ctx);
+static void
+_dot3StatsTable_container_shutdown(dot3StatsTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+dot3StatsTable_container_get(void)
+{
+ return dot3StatsTable_if_ctx.container;
+}
+
+dot3StatsTable_registration *
+dot3StatsTable_registration_get(void)
+{
+ return dot3StatsTable_if_ctx.user_ctx;
+}
+
+dot3StatsTable_registration *
+dot3StatsTable_registration_set(dot3StatsTable_registration * newreg)
+{
+ dot3StatsTable_registration *old = dot3StatsTable_if_ctx.user_ctx;
+ dot3StatsTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+dot3StatsTable_container_size(void)
+{
+ return CONTAINER_SIZE(dot3StatsTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_dot3StatsTable_pre_request;
+static Netsnmp_Node_Handler _mfd_dot3StatsTable_post_request;
+static Netsnmp_Node_Handler _mfd_dot3StatsTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_dot3StatsTable_get_values;
+/**
+ * @internal
+ * Initialize the table dot3StatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+_dot3StatsTable_initialize_interface(dot3StatsTable_registration * reg_ptr,
+ u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &dot3StatsTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &dot3StatsTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:dot3StatsTable:_dot3StatsTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for dot3StatsTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: dot3StatsIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrieval.
+ */
+ tbl_info->min_column = DOT3STATSTABLE_MIN_COL;
+ tbl_info->max_column = DOT3STATSTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ dot3StatsTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ dot3StatsTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _dot3StatsTable_container_init(&dot3StatsTable_if_ctx);
+ if (NULL == dot3StatsTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for dot3StatsTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_dot3StatsTable_object_lookup;
+ access_multiplexer->get_values = _mfd_dot3StatsTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_dot3StatsTable_pre_request;
+ access_multiplexer->post_request = _mfd_dot3StatsTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("dot3StatsTable:init_dot3StatsTable",
+ "Registering dot3StatsTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("dot3StatsTable", handler,
+ dot3StatsTable_oid,
+ dot3StatsTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table dot3StatsTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &dot3StatsTable_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,
+ dot3StatsTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != dot3StatsTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(dot3StatsTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _dot3StatsTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table dot3StatsTable
+ */
+void
+_dot3StatsTable_shutdown_interface(dot3StatsTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _dot3StatsTable_container_shutdown(&dot3StatsTable_if_ctx);
+}
+
+void
+dot3StatsTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ dot3StatsTable_if_ctx.tbl_info.valid_columns = vc;
+} /* dot3StatsTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+dot3StatsTable_index_to_oid(netsnmp_index * oid_idx,
+ dot3StatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ netsnmp_variable_list var_dot3StatsIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_dot3StatsIndex, 0x00, sizeof(var_dot3StatsIndex));
+ var_dot3StatsIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_dot3StatsIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_dot3StatsIndex,
+ (u_char *) & mib_idx->dot3StatsIndex,
+ sizeof(mib_idx->dot3StatsIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_dot3StatsIndex);
+ 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_dot3StatsIndex);
+
+ return err;
+} /* dot3StatsTable_index_to_oid */
+
+/**
+ * extract dot3StatsTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+dot3StatsTable_index_from_oid(netsnmp_index * oid_idx,
+ dot3StatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ netsnmp_variable_list var_dot3StatsIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_dot3StatsIndex, 0x00, sizeof(var_dot3StatsIndex));
+ var_dot3StatsIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_dot3StatsIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_dot3StatsIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->dot3StatsIndex =
+ *((long *) var_dot3StatsIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_dot3StatsIndex);
+
+ return err;
+} /* dot3StatsTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a dot3StatsTable_rowreq_ctx
+ */
+dot3StatsTable_rowreq_ctx *
+dot3StatsTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ dot3StatsTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(dot3StatsTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:dot3StatsTable:dot3StatsTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "dot3StatsTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->dot3StatsTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ dot3StatsTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* dot3StatsTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a dot3StatsTable_rowreq_ctx
+ */
+void
+dot3StatsTable_release_rowreq_ctx(dot3StatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:dot3StatsTable:dot3StatsTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ dot3StatsTable_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);
+} /* dot3StatsTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_dot3StatsTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:dot3StatsTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = dot3StatsTable_pre_request(dot3StatsTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("dot3StatsTable", "error %d from "
+ "dot3StatsTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_dot3StatsTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_dot3StatsTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ dot3StatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:dot3StatsTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = dot3StatsTable_post_request(dot3StatsTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("dot3StatsTable", "error %d from "
+ "dot3StatsTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_dot3StatsTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_dot3StatsTable_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;
+ dot3StatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * dot3StatsTable_interface_ctx *if_ctx =
+ * (dot3StatsTable_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
+ dot3StatsTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_dot3StatsTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_dot3StatsTable_get_column(dot3StatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ case COLUMN_DOT3STATSINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.dot3StatsIndex;
+ break;
+
+ /*
+ * dot3StatsAlignmentErrors(2)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSALIGNMENTERRORS:
+ if (!
+ (COLUMN_DOT3STATSALIGNMENTERRORS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsAlignmentErrors) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsAlignmentErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsFCSErrors(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSFCSERRORS:
+ if (!
+ (COLUMN_DOT3STATSFCSERRORS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsFCSErrors) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsFCSErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsSingleCollisionFrames(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSSINGLECOLLISIONFRAMES:
+ if (!
+ (COLUMN_DOT3STATSSINGLECOLLISIONFRAMES_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsSingleCollisionFrames) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsSingleCollisionFrames_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * dot3StatsMultipleCollisionFrames(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES:
+ if (!
+ (COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsMultipleCollisionFrames) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsMultipleCollisionFrames_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * dot3StatsSQETestErrors(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSSQETESTERRORS:
+ if (!
+ (COLUMN_DOT3STATSSQETESTERRORS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsSQETestErrors) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsSQETestErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsDeferredTransmissions(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSDEFERREDTRANSMISSIONS:
+ if (!
+ (COLUMN_DOT3STATSDEFERREDTRANSMISSIONS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsDeferredTransmissions) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsDeferredTransmissions_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * dot3StatsLateCollisions(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSLATECOLLISIONS:
+ if (!
+ (COLUMN_DOT3STATSLATECOLLISIONS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsLateCollisions) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsLateCollisions_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsExcessiveCollisions(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSEXCESSIVECOLLISIONS:
+ if (!
+ (COLUMN_DOT3STATSEXCESSIVECOLLISIONS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsExcessiveCollisions) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsExcessiveCollisions_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsInternalMacTransmitErrors(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS:
+ if (!
+ (COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsInternalMacTransmitErrors) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsInternalMacTransmitErrors_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * dot3StatsCarrierSenseErrors(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSCARRIERSENSEERRORS:
+ if (!
+ (COLUMN_DOT3STATSCARRIERSENSEERRORS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsCarrierSenseErrors) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsCarrierSenseErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsFrameTooLongs(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSFRAMETOOLONGS:
+ if (!
+ (COLUMN_DOT3STATSFRAMETOOLONGS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsFrameTooLongs) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsFrameTooLongs_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsInternalMacReceiveErrors(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS:
+ if (!
+ (COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsInternalMacReceiveErrors) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsInternalMacReceiveErrors_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * dot3StatsEtherChipSet(17)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSETHERCHIPSET:
+ if (!
+ (COLUMN_DOT3STATSETHERCHIPSET_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsEtherChipSet) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OBJECT_ID;
+ rc = dot3StatsEtherChipSet_get(rowreq_ctx,
+ (oid **) & var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * dot3StatsSymbolErrors(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DOT3STATSSYMBOLERRORS:
+ if (!
+ (COLUMN_DOT3STATSSYMBOLERRORS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsSymbolErrors) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = dot3StatsSymbolErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsDuplexStatus(19)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_DOT3STATSDUPLEXSTATUS:
+ if (!
+ (COLUMN_DOT3STATSDUPLEXSTATUS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsDuplexStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = dot3StatsDuplexStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsRateControlAbility(20)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_DOT3STATSRATECONTROLABILITY:
+ if (!
+ (COLUMN_DOT3STATSRATECONTROLABILITY_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsRateControlAbility) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = dot3StatsRateControlAbility_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * dot3StatsRateControlStatus(21)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_DOT3STATSRATECONTROLSTATUS:
+ if (!
+ (COLUMN_DOT3STATSRATECONTROLSTATUS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsRateControlStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = dot3StatsRateControlStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (DOT3STATSTABLE_MIN_COL <= column
+ && column <= DOT3STATSTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _dot3StatsTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _dot3StatsTable_get_column */
+
+int
+_mfd_dot3StatsTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ dot3StatsTable_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:dot3StatsTable:_mfd_dot3StatsTable_get_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:dot3StatsTable:_mfd_dot3StatsTable_get_values",
+ "exists %u\n", 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 = _dot3StatsTable_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_dot3StatsTable_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:dot3StatsTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for dot3StatsTable_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 dot3StatsTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:dot3StatsTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in dot3StatsTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(dot3StatsTable_rowreq_ctx * rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:dot3StatsTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:dot3StatsTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in dot3StatsTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ dot3StatsTable_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
+_dot3StatsTable_container_init(dot3StatsTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:dot3StatsTable:_dot3StatsTable_container_init",
+ "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ dot3StatsTable_oid,
+ dot3StatsTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for dot3StatsTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ dot3StatsTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("dot3StatsTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "dot3StatsTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _dot3StatsTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_dot3StatsTable_container_shutdown(dot3StatsTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:dot3StatsTable:_dot3StatsTable_container_shutdown", "called\n"));
+
+ dot3StatsTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _dot3StatsTable_container_shutdown */
+
+
+dot3StatsTable_rowreq_ctx *
+dot3StatsTable_row_find_by_mib_index(dot3StatsTable_mib_index * mib_idx)
+{
+ dot3StatsTable_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 = dot3StatsTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(dot3StatsTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.h b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.h
new file mode 100644
index 0000000..ac2b5a6
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_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 DOT3STATSTABLE_INTERFACE_H
+#define DOT3STATSTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "dot3StatsTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _dot3StatsTable_initialize_interface(dot3StatsTable_registration *
+ user_ctx, u_long flags);
+ void
+ _dot3StatsTable_shutdown_interface(dot3StatsTable_registration *
+ user_ctx);
+
+ dot3StatsTable_registration *dot3StatsTable_registration_get(void);
+
+ dot3StatsTable_registration
+ *dot3StatsTable_registration_set(dot3StatsTable_registration *
+ newreg);
+
+ netsnmp_container *dot3StatsTable_container_get(void);
+ int dot3StatsTable_container_size(void);
+
+ dot3StatsTable_rowreq_ctx *dot3StatsTable_allocate_rowreq_ctx(void *);
+ void
+ dot3StatsTable_release_rowreq_ctx(dot3StatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int dot3StatsTable_index_to_oid(netsnmp_index * oid_idx,
+ dot3StatsTable_mib_index *
+ mib_idx);
+ int dot3StatsTable_index_from_oid(netsnmp_index * oid_idx,
+ dot3StatsTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void dot3StatsTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DOT3STATSTABLE_INTERFACE_H */
+/** @} */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h
new file mode 100644
index 0000000..79b16ce
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h
@@ -0,0 +1,82 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef DOT3STATSTABLE_OIDS_H
+#define DOT3STATSTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table dot3StatsTable
+ */
+#define DOT3STATSTABLE_OID 1,3,6,1,2,1,10,7,2
+
+#define COLUMN_DOT3STATSINDEX 1
+#define COLUMN_DOT3STATSINDEX_FLAG (0x1 << 0)
+
+#define COLUMN_DOT3STATSALIGNMENTERRORS 2
+#define COLUMN_DOT3STATSALIGNMENTERRORS_FLAG (0x1 << 1)
+
+#define COLUMN_DOT3STATSFCSERRORS 3
+#define COLUMN_DOT3STATSFCSERRORS_FLAG (0x1 << 2)
+
+#define COLUMN_DOT3STATSSINGLECOLLISIONFRAMES 4
+#define COLUMN_DOT3STATSSINGLECOLLISIONFRAMES_FLAG (0x1 << 3)
+
+#define COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES 5
+#define COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES_FLAG (0x1 << 4)
+
+#define COLUMN_DOT3STATSSQETESTERRORS 6
+#define COLUMN_DOT3STATSSQETESTERRORS_FLAG (0x1 << 5)
+
+#define COLUMN_DOT3STATSDEFERREDTRANSMISSIONS 7
+#define COLUMN_DOT3STATSDEFERREDTRANSMISSIONS_FLAG (0x1 << 6)
+
+#define COLUMN_DOT3STATSLATECOLLISIONS 8
+#define COLUMN_DOT3STATSLATECOLLISIONS_FLAG (0x1 << 7)
+
+#define COLUMN_DOT3STATSEXCESSIVECOLLISIONS 9
+#define COLUMN_DOT3STATSEXCESSIVECOLLISIONS_FLAG (0x1 << 8)
+
+#define COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS 10
+#define COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS_FLAG (0x1 << 9)
+
+#define COLUMN_DOT3STATSCARRIERSENSEERRORS 11
+#define COLUMN_DOT3STATSCARRIERSENSEERRORS_FLAG (0x1 << 10)
+
+#define COLUMN_DOT3STATSFRAMETOOLONGS 13
+#define COLUMN_DOT3STATSFRAMETOOLONGS_FLAG (0x1 << 12)
+
+#define COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS 16
+#define COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS_FLAG (0x1 << 15)
+
+#define COLUMN_DOT3STATSETHERCHIPSET 17
+#define COLUMN_DOT3STATSETHERCHIPSET_FLAG (0x1 << 16)
+
+#define COLUMN_DOT3STATSSYMBOLERRORS 18
+#define COLUMN_DOT3STATSSYMBOLERRORS_FLAG (0x1 << 17)
+
+#define COLUMN_DOT3STATSDUPLEXSTATUS 19
+#define COLUMN_DOT3STATSDUPLEXSTATUS_FLAG (0x1 << 18)
+
+#define COLUMN_DOT3STATSRATECONTROLABILITY 20
+#define COLUMN_DOT3STATSRATECONTROLABILITY_FLAG (0x1 << 19)
+
+#define COLUMN_DOT3STATSRATECONTROLSTATUS 21
+#define COLUMN_DOT3STATSRATECONTROLSTATUS_FLAG (0x1 << 20)
+
+
+#define DOT3STATSTABLE_MIN_COL COLUMN_DOT3STATSINDEX
+#define DOT3STATSTABLE_MAX_COL COLUMN_DOT3STATSRATECONTROLSTATUS
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DOT3STATSTABLE_OIDS_H */
diff --git a/agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h b/agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h
new file mode 100644
index 0000000..ef9232a
--- /dev/null
+++ b/agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h
@@ -0,0 +1,65 @@
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <linux/sockios.h>
+#include <ifaddrs.h>
+
+/* use kernel's ethtool.h */
+
+#include <linux/types.h>
+typedef __u64 u64;
+typedef __u32 u32;
+typedef __u16 u16;
+typedef __u8 u8;
+#include <linux/ethtool.h>
+
+/* structure for storing the interface names in the system */
+
+struct ifname {
+ struct ifname *ifn_next;
+ char name [IF_NAMESIZE];
+};
+
+struct ifname *dot3stats_interface_name_list_get (struct ifname *, int *);
+int dot3stats_interface_name_list_free (struct ifname *list_head);
+int dot3stats_interface_ioctl_ifindex_get (int fd, const char *name);
+int _dot3Stats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name);
+int interface_ioctl_dot3stats_get(dot3StatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name);
+int interface_ioctl_dot3stats_duplex_get(dot3StatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name);
+
+
+/* for maintainability */
+
+#define INTEL_RECEIVE_ALIGN_ERRORS "rx_align_errors"
+#define BROADCOM_RECEIVE_ALIGN_ERRORS INTEL_RECEIVE_ALIGN_ERRORS
+
+#define INTEL_TRANSMIT_MULTIPLE_COLLISIONS "tx_multi_coll_ok"
+#define BROADCOM_TRANSMIT_MULTIPLE_COLLISIONS_BNX2 "tx_multi_collisions"
+#define BROADCOM_TRANSMIT_MULTIPLE_COLLISIONS_TG3 "tx_mult_collisions"
+
+#define INTEL_TRANSMIT_LATE_COLLISIONS "tx_abort_late_coll"
+#define BROADCOM_TRANSMIT_LATE_COLLISIONS "tx_late_collisions"
+
+#define INTEL_TRANSMIT_SINGLE_COLLISIONS "tx_single_coll_ok"
+#define BROADCOM_TRANSMIT_SINGLE_COLLISIONS "tx_single_collisions"
+
+#define BROADCOM_TRANSMIT_EXCESS_COLLISIONS_BNX2 "tx_excess_collisions"
+#define BROADCOM_TRANSMIT_EXCESS_COLLISIONS_TG3 "tx_excessive_collisions"
+
+
+#define DOT3STATSALIGNMENTERRORS(x) strstr(x, INTEL_RECEIVE_ALIGN_ERRORS)
+
+#define DOT3STATSMULTIPLECOLLISIONFRAMES(x) (strstr(x, INTEL_TRANSMIT_MULTIPLE_COLLISIONS)) || \
+ (strstr(x, BROADCOM_TRANSMIT_MULTIPLE_COLLISIONS_BNX2)) || \
+ (strstr(x, BROADCOM_TRANSMIT_MULTIPLE_COLLISIONS_TG3))
+
+#define DOT3STATSLATECOLLISIONS(x) (strstr(x, INTEL_TRANSMIT_LATE_COLLISIONS)) || \
+ (strstr(x, BROADCOM_TRANSMIT_LATE_COLLISIONS))
+
+#define DOT3STATSSINGLECOLLISIONFRAMES(x) (strstr(x, INTEL_TRANSMIT_SINGLE_COLLISIONS)) || \
+ (strstr(x, BROADCOM_TRANSMIT_SINGLE_COLLISIONS))
+
+#define DOT3STATSEXCESSIVECOLLISIONS(x) (strstr(x, BROADCOM_TRANSMIT_EXCESS_COLLISIONS_BNX2)) || \
+ (strstr(x, BROADCOM_TRANSMIT_EXCESS_COLLISIONS_TG3))
+
diff --git a/agent/mibgroup/examples.h b/agent/mibgroup/examples.h
new file mode 100644
index 0000000..83d3ccb
--- /dev/null
+++ b/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/agent/mibgroup/examples/Makefile.dlmod b/agent/mibgroup/examples/Makefile.dlmod
new file mode 100644
index 0000000..13bf3e4
--- /dev/null
+++ b/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/agent/mibgroup/examples/data_set.c b/agent/mibgroup/examples/data_set.c
new file mode 100644
index 0000000..cc6a04a
--- /dev/null
+++ b/agent/mibgroup/examples/data_set.c
@@ -0,0 +1,223 @@
+/** @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/net-snmp-features.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+netsnmp_feature_require(table_set_multi_add_default_row)
+netsnmp_feature_require(unregister_auto_data_table)
+netsnmp_feature_require(delete_table_data_set)
+netsnmp_feature_require(table_dataset)
+netsnmp_feature_require(table_set_multi_add_default_row)
+netsnmp_feature_require(table_dataset_unregister_auto_data_table)
+
+static netsnmp_table_data_set *table_set;
+
+/*
+ * 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_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"));
+}
+
+void
+shutdown_data_set(void)
+{
+ netsnmp_unregister_auto_data_table(table_set, NULL);
+ netsnmp_delete_table_data_set(table_set);
+ table_set = NULL;
+}
diff --git a/agent/mibgroup/examples/data_set.h b/agent/mibgroup/examples/data_set.h
new file mode 100644
index 0000000..c9cf8b2
--- /dev/null
+++ b/agent/mibgroup/examples/data_set.h
@@ -0,0 +1,16 @@
+#ifndef DATA_SET_H
+#define DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void init_data_set(void);
+void shutdown_data_set(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DATA_SET_H */
diff --git a/agent/mibgroup/examples/delayed_instance.c b/agent/mibgroup/examples/delayed_instance.c
new file mode 100644
index 0000000..ea59502
--- /dev/null
+++ b/agent/mibgroup/examples/delayed_instance.c
@@ -0,0 +1,258 @@
+/** @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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 -> %ld\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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ /*
+ * free the information cache
+ */
+ netsnmp_free_delegated_cache(cache);
+}
diff --git a/agent/mibgroup/examples/delayed_instance.h b/agent/mibgroup/examples/delayed_instance.h
new file mode 100644
index 0000000..9d0e522
--- /dev/null
+++ b/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/agent/mibgroup/examples/example.c b/agent/mibgroup/examples/example.c
new file mode 100644
index 0000000..50b7e7d
--- /dev/null
+++ b/agent/mibgroup/examples/example.c
@@ -0,0 +1,728 @@
+/*
+ * 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
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * header_generic() comes from here
+ */
+#include "util_funcs/header_generic.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: NETSNMP_OLDAPI_RONLY (or NETSNMP_OLDAPI_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, NETSNMP_OLDAPI_RONLY,
+ var_example, 1, {1}},
+ {EXAMPLEINTEGER, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_example, 2, {2, 1}},
+ {EXAMPLEOBJECTID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_example, 2, {2, 2}},
+ {EXAMPLETIMETICKS, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_example, 1, {3}},
+ {EXAMPLEIPADDRESS, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_example, 1, {4}},
+ {EXAMPLECOUNTER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_example, 1, {5}},
+ {EXAMPLEGAUGE, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_example, 1, {6}},
+ {EXAMPLETRIGGERTRAP, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_example, 1, {7}},
+ {EXAMPLETRIGGERTRAP2, ASN_INTEGER, NETSNMP_OLDAPI_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.
+ */
+ strlcpy(example_str, EXAMPLE_STR_DEFAULT, sizeof(example_str));
+
+ 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) < sizeof(example_str))
+ strcpy(example_str, cptr);
+ else {
+ /*
+ * Truncate the string if necessary.
+ * An alternative approach would be to log an error,
+ * and discard this value altogether.
+ */
+ sprintf(example_str, "%.*s...", (int) (sizeof(example_str) - 4), cptr);
+ netsnmp_assert(strlen(example_str) < sizeof(example_str));
+ }
+}
+
+ /*
+ * 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:
+ strcpy(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 %" NETSNMP_PRIz "u",
+ var_val_len));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ intval = *((long *) var_val);
+ if (intval > MAX_EXAMPLE_INT) {
+ DEBUGMSGTL(("example", "wrong value %lx", 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 %" NETSNMP_PRIz "u",
+ var_val_len));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ intval = *((long *) var_val);
+ if (intval != 1) {
+ DEBUGMSGTL(("example", "wrong value %lx", 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 %" NETSNMP_PRIz "u",
+ var_val_len));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ intval = *((long *) var_val);
+ if (intval != 1) {
+ DEBUGMSGTL(("example", "wrong value %lx", 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 = (unsigned char *) 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/agent/mibgroup/examples/example.h b/agent/mibgroup/examples/example.h
new file mode 100644
index 0000000..04b73e0
--- /dev/null
+++ b/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/header_generic module,
+ * so make sure this module is included in the agent.
+ */
+config_require(util_funcs/header_generic)
+
+
+ /*
+ * 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/agent/mibgroup/examples/netSnmpHostsTable.c b/agent/mibgroup/examples/netSnmpHostsTable.c
new file mode 100644
index 0000000..f2aa0c7
--- /dev/null
+++ b/agent/mibgroup/examples/netSnmpHostsTable.c
@@ -0,0 +1,567 @@
+/*
+ * 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-features.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"
+
+netsnmp_feature_require(oid_stash)
+netsnmp_feature_require(oid_stash_get_data)
+netsnmp_feature_require(oid_stash_add_data)
+
+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 retrieval. */
+ 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_iterator2(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;
+ struct commitInfo *ci = NULL;
+
+ void *data_context = NULL;
+
+ for (request = requests; request; request = request->next) {
+ /* column and row index encoded portion */
+ netsnmp_variable_list *var = request->requestvb;
+ const oid * const suffix = var->name + reginfo->rootoid_len + 1;
+ const size_t 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/agent/mibgroup/examples/netSnmpHostsTable.h b/agent/mibgroup/examples/netSnmpHostsTable.h
new file mode 100644
index 0000000..b6164a9
--- /dev/null
+++ b/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/agent/mibgroup/examples/netSnmpHostsTable_access.c b/agent/mibgroup/examples/netSnmpHostsTable_access.c
new file mode 100644
index 0000000..3d2e5fb
--- /dev/null
+++ b/agent/mibgroup/examples/netSnmpHostsTable_access.c
@@ -0,0 +1,365 @@
+
+/*
+ * 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 retrieval 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;
+ strlcpy(datactx->hostname, (const char *) index_data->val.string,
+ sizeof(datactx->hostname));
+ 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/agent/mibgroup/examples/netSnmpHostsTable_access.h b/agent/mibgroup/examples/netSnmpHostsTable_access.h
new file mode 100644
index 0000000..3be2a5c
--- /dev/null
+++ b/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/agent/mibgroup/examples/netSnmpHostsTable_checkfns.c b/agent/mibgroup/examples/netSnmpHostsTable_checkfns.c
new file mode 100644
index 0000000..25a7330
--- /dev/null
+++ b/agent/mibgroup/examples/netSnmpHostsTable_checkfns.c
@@ -0,0 +1,187 @@
+/*
+ * 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "netSnmpHostsTable_checkfns.h"
+#include "netSnmpHostsTable_checkfns_local.h"
+#include "netSnmpHostsTable_enums.h"
+
+netsnmp_feature_require(check_storage_transition)
+
+/** 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)
+{
+ /** 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;
+ }
+
+ /** 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)
+{
+ /** 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 = check_storage_transition((old_val) ? *old_val : SNMP_STORAGE_NONE,
+ *val);
+ if (ret)
+ 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 = check_rowstatus_transition((old_val) ? *old_val : RS_NONEXISTENT,
+ *val);
+ if (ret)
+ 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/agent/mibgroup/examples/netSnmpHostsTable_checkfns.h b/agent/mibgroup/examples/netSnmpHostsTable_checkfns.h
new file mode 100644
index 0000000..cb996bb
--- /dev/null
+++ b/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/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c b/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c
new file mode 100644
index 0000000..a29360d
--- /dev/null
+++ b/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/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.h b/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.h
new file mode 100644
index 0000000..6cd44c9
--- /dev/null
+++ b/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.h
@@ -0,0 +1,49 @@
+/*
+ * 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_LOCAL_H
+#define NETSNMPHOSTSTABLE_CHECKFNS_LOCAL_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
+#if 0
+}
+#endif
+
+int check_netSnmpHostAddressType_local(int type, long *val,
+ size_t val_len,
+ long *old_val,
+ size_t old_val_len);
+int check_netSnmpHostAddress_local(int type, char *val,
+ size_t val_len,
+ char *old_val,
+ size_t old_val_len);
+int check_netSnmpHostStorage_local(int type, long *val,
+ size_t val_len,
+ long *old_val,
+ size_t old_val_len);
+int check_netSnmpHostRowStatus_local(int type, long *val,
+ size_t val_len,
+ long *old_val,
+ size_t old_val_len);
+
+#if 0
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMPHOSTSTABLE_CHECKFNS_LOCAL_H */
diff --git a/agent/mibgroup/examples/netSnmpHostsTable_columns.h b/agent/mibgroup/examples/netSnmpHostsTable_columns.h
new file mode 100644
index 0000000..2b3af76
--- /dev/null
+++ b/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/agent/mibgroup/examples/netSnmpHostsTable_enums.h b/agent/mibgroup/examples/netSnmpHostsTable_enums.h
new file mode 100644
index 0000000..fcff392
--- /dev/null
+++ b/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/agent/mibgroup/examples/notification.c b/agent/mibgroup/examples/notification.c
new file mode 100644
index 0000000..ab60201
--- /dev/null
+++ b/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/agent/mibgroup/examples/notification.h b/agent/mibgroup/examples/notification.h
new file mode 100644
index 0000000..2adfdb2
--- /dev/null
+++ b/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/agent/mibgroup/examples/scalar_int.c b/agent/mibgroup/examples/scalar_int.c
new file mode 100644
index 0000000..db4d295
--- /dev/null
+++ b/agent/mibgroup/examples/scalar_int.c
@@ -0,0 +1,84 @@
+/** @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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * if --enable-minimalist has been turned on, we need to register
+ * the support we need so the needed functions aren't removed at compile time
+ */
+netsnmp_feature_require(long_instance)
+
+/*
+ * Then, we declare the variables we want to be accessed
+ */
+static long 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 = %ld\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_long_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_long_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/agent/mibgroup/examples/scalar_int.h b/agent/mibgroup/examples/scalar_int.h
new file mode 100644
index 0000000..223b568
--- /dev/null
+++ b/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/agent/mibgroup/examples/ucdDemoPublic.c b/agent/mibgroup/examples/ucdDemoPublic.c
new file mode 100644
index 0000000..8e9e66a
--- /dev/null
+++ b/agent/mibgroup/examples/ucdDemoPublic.c
@@ -0,0 +1,222 @@
+/*
+ * 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
+# 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 <net-snmp/library/tools.h>
+
+#include "util_funcs/header_generic.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, NETSNMP_OLDAPI_RWRITE,
+ var_ucdDemoPublic, 1, {1}},
+ {UCDDEMOPUBLICSTRING, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_ucdDemoPublic, 1, {2}},
+ {UCDDEMOUSERLIST, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_ucdDemoPublic, 1, {3}},
+ {UCDDEMOPASSPHRASE, ASN_OCTET_STR, NETSNMP_OLDAPI_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((const char*)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) {
+ sprintf((char*) publicString, "%.*s",
+ (int) SNMP_MIN(sizeof(publicString) - 1, var_val_len),
+ (const char*) var_val);
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/examples/ucdDemoPublic.cmds b/agent/mibgroup/examples/ucdDemoPublic.cmds
new file mode 100755
index 0000000..41ce10e
--- /dev/null
+++ b/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/agent/mibgroup/examples/ucdDemoPublic.conf b/agent/mibgroup/examples/ucdDemoPublic.conf
new file mode 100644
index 0000000..ff4a207
--- /dev/null
+++ b/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/agent/mibgroup/examples/ucdDemoPublic.h b/agent/mibgroup/examples/ucdDemoPublic.h
new file mode 100644
index 0000000..253f4ff
--- /dev/null
+++ b/agent/mibgroup/examples/ucdDemoPublic.h
@@ -0,0 +1,38 @@
+/*
+ * ucdDemoPublic.h
+ */
+
+#ifndef _MIBGROUP_UCDDEMOPUBLIC_H
+#define _MIBGROUP_UCDDEMOPUBLIC_H
+
+/*
+ * we use header_generic from the util_funcs module
+ */
+
+config_require(util_funcs/header_generic)
+
+#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/agent/mibgroup/examples/watched.c b/agent/mibgroup/examples/watched.c
new file mode 100644
index 0000000..b486bac
--- /dev/null
+++ b/agent/mibgroup/examples/watched.c
@@ -0,0 +1,98 @@
+/*
+ * watched.c
+ * $Id$
+ *
+ */
+/** @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;
+ static 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));
+
+ /*
+ * 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 three options for a string watcher are:
+ * fixed size string (length never changes)
+ * variable size (length can be 0 - MAX, for some MAX)
+ * c string (length can be 0 - MAX-1 for some max, \0 is not a valid
+ * character in the string, the length is provided by strlen)
+ *
+ * we'll use a variable length string.
+ */
+ watcher_flags = WATCHER_MAX_SIZE;
+
+ /*
+ * create the watcher info for our string.
+ */
+ netsnmp_init_watcher_info6(&watcher_info, my_string, strlen(my_string),
+ ASN_OCTET_STR, watcher_flags,
+ sizeof(my_string), NULL);
+
+ /*
+ * the line below registers our "my_string" variable above as
+ * accessible and makes it writable.
+ */
+ netsnmp_register_watched_instance(reginfo, &watcher_info);
+
+ DEBUGMSGTL(("example_string_instance",
+ "Done initalizing example string instance\n"));
+}
diff --git a/agent/mibgroup/examples/watched.h b/agent/mibgroup/examples/watched.h
new file mode 100644
index 0000000..84e5f33
--- /dev/null
+++ b/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/agent/mibgroup/hardware/cpu.h b/agent/mibgroup/hardware/cpu.h
new file mode 100644
index 0000000..3956679
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu.h
@@ -0,0 +1,35 @@
+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(dragonfly)
+config_require(hardware/cpu/cpu_kinfo)
+
+#elif (defined(netbsd) || defined(netbsd1) || defined(netbsdelf) || defined(netbsdelf2)|| defined(netbsdelf3) || defined(openbsd) || 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) || defined(aix7))
+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/agent/mibgroup/hardware/cpu/cpu.c b/agent/mibgroup/hardware/cpu/cpu.c
new file mode 100644
index 0000000..2772001
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu.c
@@ -0,0 +1,274 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+netsnmp_feature_child_of(hardware_cpu, libnetsnmpmibs)
+
+netsnmp_feature_child_of(hardware_cpu_copy_stats, hardware_cpu)
+netsnmp_feature_child_of(hardware_cpu_load, hardware_cpu)
+netsnmp_feature_child_of(hardware_cpu_get_cache, hardware_cpu)
+netsnmp_feature_child_of(hardware_cpu_get_byName, hardware_cpu)
+
+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 ) {
+ oid nsCPU[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 33 };
+ /*
+ * 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,
+ nsCPU, OID_LENGTH(nsCPU));
+}
+
+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) {
+ DEBUGMSG(("cpu", "(failed)\n"));
+ return NULL;
+ }
+ 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;
+ }
+ }
+ SNMP_FREE(cpu); /* just in case */
+ return NULL; /* Shouldn't happen! */
+}
+
+ /*
+ * Work with a list of CPU entries, indexed by name
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_HARDWARE_CPU_GET_BYNAME
+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;
+ if (strlen(name) >= sizeof(cpu->name)) {
+ free(cpu);
+ snmp_log(LOG_ERR, "Name of CPU is too large: %s\n", name);
+ 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_HARDWARE_CPU_GET_BYNAME */
+
+#ifndef NETSNMP_FEATURE_REMOVE_HARDWARE_CPU_GET_CACHE
+netsnmp_cache *netsnmp_cpu_get_cache( void ) {
+ return _cpu_cache;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_HARDWARE_CPU_GET_CACHE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_HARDWARE_CPU_LOAD
+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 ));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_HARDWARE_CPU_LOAD */
+
+ /*
+ * 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 = (struct netsnmp_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 +
+ cpu->steal_ticks +
+ cpu->guest_ticks +
+ cpu->guestnice_ticks;
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_HARDWARE_CPU_COPY_STATS
+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->steal_ticks = cpu->steal_ticks;
+ cpu2->guest_ticks = cpu->guest_ticks;
+ cpu2->guestnice_ticks = cpu->guestnice_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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_HARDWARE_CPU_COPY_STATS */
diff --git a/agent/mibgroup/hardware/cpu/cpu.h b/agent/mibgroup/hardware/cpu/cpu.h
new file mode 100644
index 0000000..bb7a1e4
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu.h
@@ -0,0 +1,2 @@
+void init_cpu(void);
+void shutdown_cpu(void);
diff --git a/agent/mibgroup/hardware/cpu/cpu_kerndata.c b/agent/mibgroup/hardware/cpu/cpu_kerndata.c
new file mode 100644
index 0000000..8a7f2b2
--- /dev/null
+++ b/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 long)vminfo[i].v_time[V_CPU_USER];
+ cpu2->idle_ticks = (unsigned long long)vminfo[i].v_time[V_CPU_IDLE];
+ cpu2->kern_ticks = (unsigned long long)vminfo[i].v_time[V_CPU_KERNEL];
+ cpu2->wait_ticks = (unsigned long long)vminfo[i].v_time[V_CPU_STREAM];
+ cpu2->sys2_ticks = (unsigned long 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 long)vminfo[i].v_time[V_CPU_USER];
+ cpu->idle_ticks += (unsigned long long)vminfo[i].v_time[V_CPU_IDLE];
+ cpu->kern_ticks += (unsigned long long)vminfo[i].v_time[V_CPU_KERNEL];
+ cpu->wait_ticks += (unsigned long long)vminfo[i].v_time[V_CPU_STREAM];
+ cpu->sys2_ticks += (unsigned long 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 long)vminfo[i].v_swpin;
+ cpu->swapOut += (unsigned long long)vminfo[i].v_swpout;
+ cpu->pageIn += (unsigned long long)vminfo[i].v_phread;
+ cpu->pageOut += (unsigned long long)vminfo[i].v_phwrite;
+ cpu->nInterrupts += (unsigned long long)vminfo[i].v_intr;
+ cpu->nCtxSwitches += (unsigned long long)vminfo[i].v_swtch;
+ }
+ return 0;
+}
diff --git a/agent/mibgroup/hardware/cpu/cpu_kerndata.h b/agent/mibgroup/hardware/cpu/cpu_kerndata.h
new file mode 100644
index 0000000..7a0d9c7
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_kerndata.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_kerndata(void);
diff --git a/agent/mibgroup/hardware/cpu/cpu_kinfo.c b/agent/mibgroup/hardware/cpu/cpu_kinfo.c
new file mode 100644
index 0000000..37cf847
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_kinfo.c
@@ -0,0 +1,75 @@
+/*
+ * DragonFly kinfo interface
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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 <sys/param.h>
+#include <sys/vmmeter.h>
+#include <kinfo.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/sysctl.h>
+
+netsnmp_feature_require(hardware_cpu_copy_stats)
+void _cpu_copy_stats( netsnmp_cpu_info *cpu );
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_kinfo( void ) {
+ netsnmp_cpu_info *cpu;
+ int i;
+ size_t len;
+ char descr[ SNMP_MAXBUF ];
+
+ cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ kinfo_get_cpus(&cpu_num);
+ len = sizeof(descr);
+ sysctlbyname("hw.model", descr, &len, NULL, 0);
+ for ( i = 0; i < cpu_num; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ cpu->status = 2; /* running */
+ sprintf(cpu->name, "cpu%d", i);
+ sprintf(cpu->descr, "%s", descr);
+ }
+}
+
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ struct vmmeter vmm;
+ size_t len;
+ struct kinfo_cputime cp_time;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+
+ kinfo_get_sched_cputime(&cp_time);
+ len = sizeof(vmm);
+ sysctlbyname("vm.vmmeter", &vmm, &len, NULL, 0);
+
+ cpu->user_ticks = cp_time.cp_user;
+ cpu->nice_ticks = cp_time.cp_nice;
+ cpu->sys2_ticks = cp_time.cp_sys + cp_time.cp_intr;
+ cpu->idle_ticks = cp_time.cp_idle;
+ cpu->kern_ticks = cp_time.cp_sys;
+ cpu->intrpt_ticks = cp_time.cp_intr;
+
+ cpu->swapIn = vmm.v_swappgsin + vmm.v_vnodepgsin;
+ cpu->swapOut = vmm.v_swappgsout + vmm.v_vnodepgsout;
+ cpu->nInterrupts = vmm.v_intr;
+ cpu->nCtxSwitches = vmm.v_swtch;
+
+ /* Copy "overall" figures to cpu0 entry */
+ _cpu_copy_stats( cpu );
+
+ return 0;
+}
+
diff --git a/agent/mibgroup/hardware/cpu/cpu_kinfo.h b/agent/mibgroup/hardware/cpu/cpu_kinfo.h
new file mode 100644
index 0000000..774f5f2
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_kinfo.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_kinfo( void );
diff --git a/agent/mibgroup/hardware/cpu/cpu_kstat.c b/agent/mibgroup/hardware/cpu/cpu_kstat.c
new file mode 100644
index 0000000..049864c
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_kstat.c
@@ -0,0 +1,161 @@
+/*
+ * 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 = 0, 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 ) {
+ strlcpy(state, ks_data->value.c, sizeof(state));
+ } else if ( strcmp( ks_data->name, "state_begin" ) == 0 ) {
+ state_begin = ks_data->value.i32;
+ } else if ( strcmp( ks_data->name, "cpu_type" ) == 0 ) {
+ strlcpy(ctype, ks_data->value.c, sizeof(ctype));
+ } else if ( strcmp( ks_data->name, "fpu_type" ) == 0 ) {
+ strlcpy(ftype, ks_data->value.c, sizeof(ftype));
+ } 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 ( !cpu2 )
+ break; /* or continue ? */ /* Skip new CPUs */
+ 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 long)cs.cpu_sysinfo.cpu[CPU_USER];
+ cpu2->idle_ticks = (unsigned long long)cs.cpu_sysinfo.cpu[CPU_IDLE];
+ cpu2->kern_ticks = (unsigned long long)cs.cpu_sysinfo.cpu[CPU_KERNEL];
+ cpu2->wait_ticks = (unsigned long 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 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 long)cs.cpu_sysinfo.cpu[CPU_USER];
+ cpu->idle_ticks += (unsigned long long)cs.cpu_sysinfo.cpu[CPU_IDLE];
+ cpu->kern_ticks += (unsigned long long)cs.cpu_sysinfo.cpu[CPU_KERNEL];
+ cpu->wait_ticks += (unsigned long 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 long)cpu2->kern_ticks+cpu2->wait_ticks;
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+ cpu->swapIn += (unsigned long long)cs.cpu_vminfo.swapin;
+ cpu->swapOut += (unsigned long long)cs.cpu_vminfo.swapout;
+ cpu->nInterrupts += (unsigned long long)cs.cpu_sysinfo.intr;
+ cpu->nCtxSwitches += (unsigned long 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/agent/mibgroup/hardware/cpu/cpu_kstat.h b/agent/mibgroup/hardware/cpu/cpu_kstat.h
new file mode 100644
index 0000000..ce38628
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_kstat.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_kstat(void);
diff --git a/agent/mibgroup/hardware/cpu/cpu_linux.c b/agent/mibgroup/hardware/cpu/cpu_linux.c
new file mode 100644
index 0000000..8a081cd
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_linux.c
@@ -0,0 +1,333 @@
+#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 have 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 num_cpuline_elem = 0;
+ int bytes_read, statfd, i;
+ char *b1, *b2;
+ unsigned long long cusell = 0, cicell = 0, csysll = 0, cidell = 0,
+ ciowll = 0, cirqll = 0, csoftll = 0, cstealll = 0,
+ cguestll = 0, cguest_nicell = 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 = getpagesize()-1;
+ buff = (char*)malloc(bsize+1);
+ }
+ while ((bytes_read = read(statfd, buff, bsize)) == bsize) {
+ bsize += BUFSIZ;
+ buff = (char*)realloc(buff, bsize+1);
+ DEBUGMSGTL(("cpu", "/proc/stat buffer increased to %d\n", bsize));
+ close(statfd);
+ statfd = open(STAT_FILE, O_RDONLY, 0);
+ if (statfd == -1) {
+ snmp_log_perror(STAT_FILE);
+ return -1;
+ }
+ }
+ close(statfd);
+
+ if ( bytes_read < 0 ) {
+ snmp_log_perror(STAT_FILE "read error");
+ return -1;
+ }
+ buff[bytes_read] = '\0';
+
+ /*
+ * 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 " */
+ }
+
+ num_cpuline_elem = sscanf(b1, "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu",
+ &cusell, &cicell, &csysll, &cidell, &ciowll, &cirqll, &csoftll, &cstealll, &cguestll, &cguest_nicell);
+ DEBUGMSGTL(("cpu", "/proc/stat cpu line number of elements: %i\n", num_cpuline_elem));
+
+ /* kernel 2.6.33 and above */
+ if (num_cpuline_elem == 10) {
+ cpu->guestnice_ticks = (unsigned long long)cguest_nicell;
+ }
+ /* kernel 2.6.24 and above */
+ if (num_cpuline_elem >= 9) {
+ cpu->guest_ticks = (unsigned long long)cguestll;
+ }
+ /* kernel 2.6.11 and above */
+ if (num_cpuline_elem >= 8) {
+ cpu->steal_ticks = (unsigned long long)cstealll;
+ }
+ /* kernel 2.6 */
+ if (num_cpuline_elem >= 5) {
+ cpu->wait_ticks = (unsigned long long)ciowll;
+ cpu->intrpt_ticks = (unsigned long long)cirqll;
+ cpu->sirq_ticks = (unsigned long long)csoftll;
+ }
+ /* rest */
+ cpu->user_ticks = (unsigned long long)cusell;
+ cpu->nice_ticks = (unsigned long long)cicell;
+ cpu->sys_ticks = (unsigned long long)csysll;
+ cpu->idle_ticks = (unsigned long 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 bytes_read, 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);
+ if (vmstatfd == -1 ) {
+ snmp_log(LOG_ERR, "cannot open %s\n", VMSTAT_FILE);
+ has_vmstat = 0;
+ } else {
+ if (vmbsize == 0) {
+ vmbsize = getpagesize()-1;
+ vmbuff = (char*)malloc(vmbsize+1);
+ }
+ while ((bytes_read = read(vmstatfd, vmbuff, vmbsize)) == vmbsize) {
+ vmbsize += BUFSIZ;
+ vmbuff = (char*)realloc(vmbuff, vmbsize+1);
+ close(vmstatfd);
+ vmstatfd = open(VMSTAT_FILE, O_RDONLY, 0);
+ if (vmstatfd == -1) {
+ snmp_log_perror("cannot open " VMSTAT_FILE);
+ return;
+ }
+ }
+ close(vmstatfd);
+ if ( bytes_read < 0 ) {
+ snmp_log_perror(VMSTAT_FILE "read error");
+ return;
+ }
+ vmbuff[bytes_read] = '\0';
+ }
+ }
+
+ if (has_vmstat) {
+ b = strstr(vmbuff, "pgpgin ");
+ if (b) {
+ sscanf(b, "pgpgin %llu", &pin);
+ cpu->pageIn = (unsigned long 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 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 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 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 long)pin;
+ cpu->pageOut = (unsigned long 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 long)swpin;
+ cpu->swapOut = (unsigned long 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 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 long)ctx;
+ } else {
+ if (first)
+ snmp_log(LOG_ERR, "No ctxt line in %s\n", STAT_FILE);
+ }
+ first = 0;
+}
+
diff --git a/agent/mibgroup/hardware/cpu/cpu_linux.h b/agent/mibgroup/hardware/cpu/cpu_linux.h
new file mode 100644
index 0000000..9bcdb19
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_linux.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_linux(void);
diff --git a/agent/mibgroup/hardware/cpu/cpu_mach.c b/agent/mibgroup/hardware/cpu/cpu_mach.c
new file mode 100644
index 0000000..d527b3d
--- /dev/null
+++ b/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/agent/mibgroup/hardware/cpu/cpu_mach.h b/agent/mibgroup/hardware/cpu/cpu_mach.h
new file mode 100644
index 0000000..f3f408f
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_mach.h
@@ -0,0 +1,4 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_mach( void );
+
+
diff --git a/agent/mibgroup/hardware/cpu/cpu_nlist.c b/agent/mibgroup/hardware/cpu/cpu_nlist.c
new file mode 100644
index 0000000..974028a
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_nlist.c
@@ -0,0 +1,112 @@
+/*
+ * nlist() interface
+ * e.g. FreeBSD
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(hardware_cpu_copy_stats)
+void _cpu_copy_stats( netsnmp_cpu_info *cpu );
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_nlist( void ) {
+ int n;
+ size_t i;
+ 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 long)cpu_stats[CP_USER];
+ cpu->nice_ticks = (unsigned long long)cpu_stats[CP_NICE];
+ cpu->sys2_ticks = (unsigned long long)cpu_stats[CP_SYS]+cpu_stats[CP_INTR];
+ cpu->idle_ticks = (unsigned long long)cpu_stats[CP_IDLE];
+ cpu->kern_ticks = (unsigned long long)cpu_stats[CP_SYS];
+ cpu->intrpt_ticks = (unsigned long 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 long)mem_stats.v_swpin;
+ cpu->swapOut = (unsigned long long)mem_stats.v_swpout;
+#else
+ cpu->swapIn = (unsigned long long)mem_stats.v_swappgsin+mem_stats.v_vnodepgsin;
+ cpu->swapOut = (unsigned long long)mem_stats.v_swappgsout+mem_stats.v_vnodepgsout;
+#endif
+ cpu->nInterrupts = (unsigned long long)mem_stats.v_intr;
+ cpu->nCtxSwitches = (unsigned long 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/agent/mibgroup/hardware/cpu/cpu_nlist.h b/agent/mibgroup/hardware/cpu/cpu_nlist.h
new file mode 100644
index 0000000..d28ba6f
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_nlist.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_nlist( void );
diff --git a/agent/mibgroup/hardware/cpu/cpu_null.c b/agent/mibgroup/hardware/cpu/cpu_null.c
new file mode 100644
index 0000000..3ec1938
--- /dev/null
+++ b/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/agent/mibgroup/hardware/cpu/cpu_null.h b/agent/mibgroup/hardware/cpu/cpu_null.h
new file mode 100644
index 0000000..3150358
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_null.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_null(void);
diff --git a/agent/mibgroup/hardware/cpu/cpu_pcp.c b/agent/mibgroup/hardware/cpu/cpu_pcp.c
new file mode 100644
index 0000000..94c7b5c
--- /dev/null
+++ b/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 long)resp->vset[CPUWAIT]->vlist[0].value.lval / 10;
+ cpu->intrpt_ticks = (unsigned long long)resp->vset[CPUINTR]->vlist[0].value.lval / 10;
+ /*cpu->sirq_ticks = (unsigned long)csoftll / 10;*/
+ cpu->user_ticks = (unsigned long long)resp->vset[CPUUSER]->vlist[0].value.lval / 10;
+ /*cpu->nice_ticks = (unsigned long)cicell / 10;*/
+ cpu->sys_ticks = (unsigned long long)resp->vset[CPUSYS]->vlist[0].value.lval / 10;
+ cpu->idle_ticks = (unsigned long 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 long)resp->vset[PAGESIN]->vlist[0].value.lval;
+ cpu->pageOut = (unsigned long long)resp->vset[PAGESOUT]->vlist[0].value.lval;
+ cpu->swapIn = (unsigned long long)resp->vset[SWAPIN]->vlist[0].value.lval;
+ cpu->swapOut = (unsigned long long)resp->vset[SWAPOUT]->vlist[0].value.lval;
+ cpu->nInterrupts = (unsigned long long)resp->vset[INTR]->vlist[0].value.lval;
+ cpu->nCtxSwitches = (unsigned long 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/agent/mibgroup/hardware/cpu/cpu_pcp.h b/agent/mibgroup/hardware/cpu/cpu_pcp.h
new file mode 100644
index 0000000..ddb7547
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_pcp.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_pcp(void);
diff --git a/agent/mibgroup/hardware/cpu/cpu_perfstat.c b/agent/mibgroup/hardware/cpu/cpu_perfstat.c
new file mode 100644
index 0000000..5f58190
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_perfstat.c
@@ -0,0 +1,110 @@
+/*
+ * perfstat() interface
+ * e.g. AIX
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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/protosw.h>
+#include <libperfstat.h>
+
+netsnmp_feature_require(hardware_cpu_copy_stats)
+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 = (perfstat_cpu_t*)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 long)cs.user / cs.ncpus;
+ cpu->sys_ticks = ((unsigned long long)cs.sys + (unsigned long long)cs.wait) / cs.ncpus;
+ cpu->kern_ticks = (unsigned long long)cs.sys / cs.ncpus;
+ cpu->wait_ticks = (unsigned long long)cs.wait / cs.ncpus;
+ cpu->idle_ticks = (unsigned long 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 long)cs.sysread;
+ cpu->pageOut = (unsigned long long)cs.syswrite;
+ cpu->nInterrupts = (unsigned long long)cs.devintrs + cs.softintrs;
+ cpu->nCtxSwitches = (unsigned long long)cs.pswitch;
+ }
+
+ if (perfstat_memory_total((perfstat_id_t *)NULL, &ms,
+ sizeof(perfstat_memory_total_t), 1) > 0) {
+ cpu->swapIn = (unsigned long long)ms.pgspins;
+ cpu->swapOut = (unsigned long long)ms.pgspouts;
+ }
+
+
+ /*
+ * Per-CPU statistics
+ */
+ n = cs.ncpus; /* XXX - Compare against cpu_num */
+ cs2 = (perfstat_cpu_t*)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 long)cs2[i].user;
+ cpu->sys_ticks = (unsigned long long)cs2[i].sys + (unsigned long long)cs2[i].wait;
+ cpu->kern_ticks = (unsigned long long)cs2[i].sys;
+ cpu->wait_ticks = (unsigned long long)cs2[i].wait;
+ cpu->idle_ticks = (unsigned long long)cs2[i].idle;
+ cpu->pageIn = (unsigned long long)cs2[i].sysread;
+ cpu->pageOut = (unsigned long long)cs2[i].syswrite;
+ cpu->nCtxSwitches = (unsigned long long)cs2[i].pswitch;
+ /* Interrupt stats only apply overall, not per-CPU */
+ }
+ } else {
+ _cpu_copy_stats( cpu );
+ }
+ free(cs2);
+
+ return 0;
+}
diff --git a/agent/mibgroup/hardware/cpu/cpu_perfstat.h b/agent/mibgroup/hardware/cpu/cpu_perfstat.h
new file mode 100644
index 0000000..8b8b62c
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_perfstat.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_perfstat(void);
diff --git a/agent/mibgroup/hardware/cpu/cpu_pstat.c b/agent/mibgroup/hardware/cpu/cpu_pstat.c
new file mode 100644
index 0000000..35c1d63
--- /dev/null
+++ b/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 long)psd.psd_cpu_time[CP_USER];
+ cpu->nice_ticks = (unsigned long long)psd.psd_cpu_time[CP_NICE];
+ cpu->sys2_ticks = (unsigned long long)psd.psd_cpu_time[CP_SYS]+
+ psd.psd_cpu_time[CP_WAIT];
+ cpu->idle_ticks = (unsigned long long)psd.psd_cpu_time[CP_IDLE];
+ cpu->wait_ticks = (unsigned long long)psd.psd_cpu_time[CP_WAIT];
+ cpu->kern_ticks = (unsigned long 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 long)psv.psv_sswpin;
+ cpu->swapOut = (unsigned long long)psv.psv_sswpout;
+ cpu->nInterrupts = (unsigned long long)psv.psv_sintr;
+ cpu->nCtxSwitches = (unsigned long 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 long)psd.psd_mp_cpu_time[i][CP_USER];
+ cpu->nice_ticks = (unsigned long long)psd.psd_mp_cpu_time[i][CP_NICE];
+ cpu->sys2_ticks = (unsigned long long)psd.psd_mp_cpu_time[i][CP_SYS]+
+ psd.psd_mp_cpu_time[i][CP_WAIT];
+ cpu->idle_ticks = (unsigned long long)psd.psd_mp_cpu_time[i][CP_IDLE];
+ cpu->wait_ticks = (unsigned long long)psd.psd_mp_cpu_time[i][CP_WAIT];
+ cpu->kern_ticks = (unsigned long long)psd.psd_mp_cpu_time[i][CP_SYS];
+ /* XXX - record (sum of) "all other ticks" */
+ }
+
+ return 0;
+}
diff --git a/agent/mibgroup/hardware/cpu/cpu_pstat.h b/agent/mibgroup/hardware/cpu/cpu_pstat.h
new file mode 100644
index 0000000..2353f68
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_pstat.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_pstat(void);
diff --git a/agent/mibgroup/hardware/cpu/cpu_sysctl.c b/agent/mibgroup/hardware/cpu/cpu_sysctl.c
new file mode 100644
index 0000000..5599a58
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_sysctl.c
@@ -0,0 +1,220 @@
+/*
+ * sysctl() interface
+ * e.g. BSD/OS, NetBSD, OpenBSD, later Darwin releases
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+
+netsnmp_feature_require(hardware_cpu_copy_stats)
+
+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;
+ size_t siz;
+ int ncpu_mib[] = { CTL_HW, HW_NCPU };
+#if !(defined(__NetBSD__) && ( defined(__i386__) || defined(__x86_64__) ) )
+ int model_mib[] = { CTL_HW, HW_MODEL };
+#endif
+ char descr[ SNMP_MAXBUF ];
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ siz = sizeof(n);
+ sysctl(ncpu_mib, 2, &n, &siz, NULL, 0);
+ if ( n <= 0 )
+ n = 1; /* Single CPU system */
+ siz = sizeof(descr);
+#if defined(__NetBSD__) && ( defined(__i386__) || defined(__x86_64__) )
+ sysctlbyname("machdep.cpu_brand", descr, &siz, NULL, 0);
+#else
+ sysctl(model_mib, 2, descr, &siz, NULL, 0);
+#endif
+ 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;
+}
+
+
+#if defined(__NetBSD__)
+#define NETSNMP_CPU_STATS uint64_t
+#else
+#define NETSNMP_CPU_STATS long
+#endif
+
+#if defined(__NetBSD__)
+#define NETSNMP_KERN_CPU KERN_CP_TIME
+#elif defined(KERN_CPUSTATS) /* BSDi */
+#define NETSNMP_KERN_CPU KERN_CPUSTATS
+#elif defined(KERN_CPTIME) /* OpenBSD */
+#define NETSNMP_KERN_CPU KERN_CPTIME
+
+#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 ) {
+#ifdef NETSNMP_KERN_MCPU
+ int i;
+#endif
+
+ /*
+ * 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];
+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+ int cpu_mib[] = { CTL_KERN, NETSNMP_KERN_CPU };
+#endif
+ 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;
+#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__) || defined(__NetBSD__))
+ 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 long)cpu_stats[CP_USER];
+ cpu->nice_ticks = (unsigned long long)cpu_stats[CP_NICE];
+ cpu->sys2_ticks = (unsigned long long)cpu_stats[CP_SYS]+cpu_stats[CP_INTR];
+ cpu->kern_ticks = (unsigned long long)cpu_stats[CP_SYS];
+ cpu->idle_ticks = (unsigned long long)cpu_stats[CP_IDLE];
+ cpu->intrpt_ticks = (unsigned long 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 long)mem_stats.NS_VM_INTR;
+ cpu->nCtxSwitches = (unsigned long long)mem_stats.NS_VM_SWTCH;
+ cpu->swapIn = (unsigned long long)mem_stats.NS_VM_SWAPIN;
+ cpu->swapOut = (unsigned long long)mem_stats.NS_VM_SWAPOUT;
+#ifdef NS_VM_PAGEIN
+ cpu->pageIn = (unsigned long long)mem_stats.NS_VM_PAGEIN;
+#endif
+#ifdef NS_VM_PAGEOUT
+ cpu->pageOut = (unsigned long long)mem_stats.NS_VM_PAGEOUT;
+#endif
+
+#ifdef NETSNMP_KERN_MCPU
+ mcpu_size = cpu_num*sizeof(NETSNMP_KERN_MCPU_TYPE);
+ mcpu_stats = malloc(mcpu_size);
+ sysctl(mcpu_mib, 2, mcpu_stats, &mcpu_size, NULL, 0);
+ for ( i = 0; i < cpu_num; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 0 );
+ /* XXX - per-CPU statistics - mcpu_mib[i].??? */
+ }
+ free(mcpu_stats);
+#else
+ /* Copy "overall" figures to cpu0 entry */
+ _cpu_copy_stats( cpu );
+#endif
+
+ return 0;
+}
diff --git a/agent/mibgroup/hardware/cpu/cpu_sysctl.h b/agent/mibgroup/hardware/cpu/cpu_sysctl.h
new file mode 100644
index 0000000..f37b907
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_sysctl.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_sysctl(void);
diff --git a/agent/mibgroup/hardware/cpu/cpu_sysinfo.c b/agent/mibgroup/hardware/cpu/cpu_sysinfo.c
new file mode 100644
index 0000000..ed1f357
--- /dev/null
+++ b/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 long) sinfo_gen->cpu[CPU_KERNEL] + (unsigned long long) sinfo_gen->cpu[CPU_SXBRK] + (unsigned long long) sinfo_gen->cpu[CPU_INTR];
+ cpu->kern_ticks = (unsigned long long) sinfo_gen->cpu[CPU_KERNEL];
+ cpu->intrpt_ticks = (unsigned long long) sinfo_gen->cpu[CPU_INTR];
+ cpu->user_ticks = (unsigned long long) sinfo_gen->cpu[CPU_USER];
+ cpu->wait_ticks = (unsigned long long) sinfo_gen->cpu[CPU_WAIT];
+ cpu->idle_ticks = (unsigned long long) sinfo_gen->cpu[CPU_IDLE];
+
+ /* XXX - Do these really belong here ? */
+ cpu->pageIn = (unsigned long long)0;
+ cpu->pageOut = (unsigned long long)0;
+ cpu->swapIn = (unsigned long long)sinfo_gen->swapin;
+ cpu->swapOut = (unsigned long long)sinfo_gen->swapout;
+ cpu->nInterrupts = (unsigned long long)sinfo_gen->intr_svcd;
+ cpu->nCtxSwitches = (unsigned long 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 long)sinfo_cpus[i].cpu[CPU_KERNEL] + (unsigned long long) sinfo_cpus[i].cpu[CPU_SXBRK] + (unsigned long long)sinfo_cpus[i].cpu[CPU_INTR];
+ cpu->intrpt_ticks = (unsigned long long)sinfo_cpus[i].cpu[CPU_INTR];
+ cpu->user_ticks = (unsigned long long)sinfo_cpus[i].cpu[CPU_USER];
+ cpu->wait_ticks = (unsigned long long)sinfo_cpus[i].cpu[CPU_WAIT];
+ cpu->idle_ticks = (unsigned long long)sinfo_cpus[i].cpu[CPU_IDLE];
+ }
+
+ return 0;
+}
+
diff --git a/agent/mibgroup/hardware/cpu/cpu_sysinfo.h b/agent/mibgroup/hardware/cpu/cpu_sysinfo.h
new file mode 100644
index 0000000..36c6e13
--- /dev/null
+++ b/agent/mibgroup/hardware/cpu/cpu_sysinfo.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_sysinfo(void);
diff --git a/agent/mibgroup/hardware/fsys.h b/agent/mibgroup/hardware/fsys.h
new file mode 100644
index 0000000..8cbf439
--- /dev/null
+++ b/agent/mibgroup/hardware/fsys.h
@@ -0,0 +1,10 @@
+config_require(hardware/fsys/hw_fsys)
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+config_require(hardware/fsys/fsys_mntctl)
+#elif defined(HAVE_GETVFSSTAT) || defined(HAVE_GETFSSTAT)
+config_require(hardware/fsys/fsys_getfsstats)
+#elif defined(HAVE_GETMNTENT) && !defined(irix6)
+config_require(hardware/fsys/fsys_mntent)
+#else
+config_require(hardware/fsys/fsys_void)
+#endif
diff --git a/agent/mibgroup/hardware/fsys/fsys_getfsstats.c b/agent/mibgroup/hardware/fsys/fsys_getfsstats.c
new file mode 100644
index 0000000..8e9468b
--- /dev/null
+++ b/agent/mibgroup/hardware/fsys/fsys_getfsstats.c
@@ -0,0 +1,187 @@
+#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/fsys.h>
+#include "hardware/fsys/hw_fsys.h"
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+
+ /*
+ * Handle minor naming differences between statfs/statvfs
+ */
+#if defined(_VFS_NAMELEN)
+#define NSFS_NAMELEN _VFS_NAMELEN
+#else
+#define NSFS_NAMELEN MNAMELEN
+#endif
+
+#if defined(HAVE_GETVFSSTAT) && defined(__NetBSD__)
+#define NSFS_GETFSSTAT getvfsstat
+#define NSFS_STATFS statvfs
+#define NSFS_FLAGS f_flag
+#else
+#define NSFS_GETFSSTAT getfsstat
+#define NSFS_STATFS statfs
+#define NSFS_FLAGS f_flags
+#endif
+
+/*
+#if defined(HAVE_STATVFS)
+#define NSFS_STATFS statvfs
+#define NSFS_FLAGS f_flag
+#else
+#define NSFS_STATFS statfs
+#define NSFS_FLAGS f_flags
+#endif
+*/
+
+/*
+#if defined(HAVE_STATVFS) && defined(__NetBSD__)
+#define NSFS_NAMELEN _VFS_NAMELEN
+#define NSFS_GETFSSTAT getvfsstat
+#define NSFS_STATFS statvfs
+#else
+#define NSFS_FLAGS f_flags
+#define NSFS_NAMELEN _VFS_NAMELEN
+#define NSFS_GETFSSTAT getvfsstat
+#define NSFS_STATFS statvfs
+#endif
+*/
+
+int
+_fs_type( char *typename )
+{
+ DEBUGMSGTL(("fsys:type", "Classifying %s\n", typename));
+
+ if ( !typename || *typename=='\0' )
+ return NETSNMP_FS_TYPE_UNKNOWN;
+
+#include "mounts.h"
+
+ /*
+ * List of mount types from <sys/mount.h>
+ */
+ else if ( !strcmp(typename, MOUNT_FFS) ||
+ !strcmp(typename, MOUNT_UFS) )
+ return NETSNMP_FS_TYPE_BERKELEY;
+ else if ( !strcmp(typename, MOUNT_NFS) )
+ return NETSNMP_FS_TYPE_NFS;
+ else if ( !strcmp(typename, MOUNT_MFS) )
+ return NETSNMP_FS_TYPE_MFS;
+ else if ( !strcmp(typename, MOUNT_MSDOS) ||
+ !strcmp(typename, MOUNT_MSDOSFS) )
+ return NETSNMP_FS_TYPE_FAT;
+ else if ( !strcmp(typename, MOUNT_AFS) )
+ return NETSNMP_FS_TYPE_AFS;
+ else if ( !strcmp(typename, MOUNT_CD9660) )
+ return NETSNMP_FS_TYPE_ISO9660;
+ else if ( !strcmp(typename, MOUNT_EXT2FS) )
+ return NETSNMP_FS_TYPE_EXT2;
+ else if ( !strcmp(typename, MOUNT_NTFS) )
+ return NETSNMP_FS_TYPE_NTFS;
+
+ /*
+ * NetBSD also recognises the following filesystem types:
+ * MOUNT_NULL
+ * MOUNT_OVERLAY
+ * MOUNT_UMAP
+ * MOUNT_UNION
+ * MOUNT_CFS/CODA
+ * MOUNT_FILECORE
+ * MOUNT_SMBFS
+ * MOUNT_PTYFS
+ * OpenBSD also recognises the following filesystem types:
+ * MOUNT_LOFS
+ * MOUNT_NCPFS
+ * MOUNT_XFS
+ * MOUNT_UDF
+ * Both of them recognise the following filesystem types:
+ * MOUNT_LFS
+ * MOUNT_FDESC
+ * MOUNT_PORTAL
+ * MOUNT_KERNFS
+ * MOUNT_PROCFS
+ * MOUNT_ADOSFS
+ *
+ * All of these filesystems are mapped to NETSNMP_FS_TYPE_OTHER
+ * so will be picked up by the following default branch.
+ */
+ else
+ return NETSNMP_FS_TYPE_OTHER;
+}
+
+void
+netsnmp_fsys_arch_init( void )
+{
+ return;
+}
+
+void
+netsnmp_fsys_arch_load( void )
+{
+ int n, i;
+ struct NSFS_STATFS *stats;
+ netsnmp_fsys_info *entry;
+
+ /*
+ * Retrieve information about the currently mounted filesystems...
+ */
+ n = NSFS_GETFSSTAT( NULL, 0, 0 );
+ if ( n==0 )
+ return;
+ stats = (struct NSFS_STATFS *)malloc( n * sizeof( struct NSFS_STATFS ));
+ n = NSFS_GETFSSTAT( stats, n * sizeof( struct NSFS_STATFS ), MNT_NOWAIT );
+
+ /*
+ * ... and insert this into the filesystem container.
+ */
+ for ( i=0; i<n; i++ ) {
+ entry = netsnmp_fsys_by_path( stats[i].f_mntonname,
+ NETSNMP_FS_FIND_CREATE );
+ if (!entry)
+ continue;
+
+ strlcpy( entry->path, stats[i].f_mntonname, sizeof(entry->path));
+ entry->path[sizeof(entry->path)-1] = '\0';
+ strlcpy( entry->device, stats[i].f_mntfromname, sizeof(entry->device));
+ entry->device[sizeof(entry->device)-1] = '\0';
+ entry->units = stats[i].f_bsize; /* or f_frsize */
+ entry->size = stats[i].f_blocks;
+ entry->used = (stats[i].f_blocks - stats[i].f_bfree);
+ /* entry->avail is currently unsigned, so protect against negative
+ * values!
+ * This should be changed to a signed field.
+ */
+ if (stats[i].f_bavail < 0)
+ entry->avail = 0;
+ else
+ entry->avail = stats[i].f_bavail;
+ entry->inums_total = stats[i].f_files;
+ entry->inums_avail = stats[i].f_ffree;
+
+ entry->type = _fs_type( stats[i].f_fstypename );
+ entry->flags |= NETSNMP_FS_FLAG_ACTIVE;
+
+ if (! (stats[i].NSFS_FLAGS & MNT_LOCAL )) {
+ entry->flags |= NETSNMP_FS_FLAG_REMOTE;
+ }
+ if ( stats[i].NSFS_FLAGS & MNT_RDONLY ) {
+ entry->flags |= NETSNMP_FS_FLAG_RONLY;
+ }
+ if ( stats[i].NSFS_FLAGS & MNT_ROOTFS ) {
+ entry->flags |= NETSNMP_FS_FLAG_BOOTABLE;
+ }
+ netsnmp_fsys_calculate32(entry);
+ }
+
+ free(stats);
+}
diff --git a/agent/mibgroup/hardware/fsys/fsys_mntctl.c b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
new file mode 100644
index 0000000..a03019a
--- /dev/null
+++ b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
@@ -0,0 +1,179 @@
+#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/fsys.h>
+
+#include <stdio.h>
+#if HAVE_SYS_MNTCTL_H
+#include <sys/mntctl.h>
+#endif
+#if HAVE_SYS_VMOUNT_H
+#include <sys/vmount.h>
+#endif
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+
+int
+_fsys_remote( char *device, int type, char *host )
+{
+ if (( type == NETSNMP_FS_TYPE_NFS) ||
+ ( type == NETSNMP_FS_TYPE_AFS))
+ return 1;
+ else
+ return 0;
+}
+
+int
+_fsys_type( int type)
+{
+ DEBUGMSGTL(("fsys:type", "Classifying %d\n", type));
+
+ switch ( type ) {
+ case MNT_AIX:
+ case MNT_JFS:
+ return NETSNMP_FS_TYPE_BERKELEY;
+
+ case MNT_CDROM:
+ return NETSNMP_FS_TYPE_ISO9660;
+
+ case MNT_NFS:
+ case MNT_NFS3:
+ case MNT_AUTOFS:
+ return NETSNMP_FS_TYPE_NFS;
+
+ /*
+ * The following code covers selected filesystems
+ * which are not covered by the HR-TYPES enumerations,
+ * but should still be monitored.
+ * These are all mapped into type "other"
+ *
+ */
+#ifdef MNT_NAMEFS
+ case MNT_NAMEFS:
+#endif
+#ifdef MNT_PROCFS
+ case MNT_PROCFS:
+#endif
+ case MNT_SFS:
+ case MNT_CACHEFS:
+ return NETSNMP_FS_TYPE_OTHER;
+
+ /*
+ * All other types are silently skipped
+ */
+ default:
+ return NETSNMP_FS_TYPE_IGNORE;
+ }
+ return NETSNMP_FS_TYPE_IGNORE; /* Not reached */
+}
+
+void
+netsnmp_fsys_arch_init( void )
+{
+ return;
+}
+
+void
+netsnmp_fsys_arch_load( void )
+{
+ int ret = 0, i = 0;
+ uint size = 0;
+
+ struct vmount *aixmnt, *aixcurr;
+ char *path;
+ struct statfs stat_buf;
+ netsnmp_fsys_info *entry;
+ char tmpbuf[1024];
+
+ /*
+ * Retrieve information about the currently mounted filesystems...
+ */
+ ret = mntctl(MCTL_QUERY, sizeof(uint), &size);
+ if ( ret != 0 || size<=0 ) {
+ snmp_log_perror( "initial mntctl failed" );
+ return;
+ }
+
+ aixmnt = (struct vmount *)malloc( size );
+ if ( aixmnt == NULL ) {
+ snmp_log_perror( "cannot allocate memory for mntctl data" );
+ return;
+ }
+
+ ret = mntctl(MCTL_QUERY, size, aixmnt );
+ if ( ret <= 0 ) {
+ free(aixmnt);
+ snmp_log_perror( "main mntctl failed" );
+ return;
+ }
+ aixcurr = aixmnt;
+
+
+ /*
+ * ... and insert this into the filesystem container.
+ */
+
+ for (i = 0;
+ i < ret;
+ i++, aixcurr = (struct vmount *) ((char*)aixcurr + aixcurr->vmt_length) ) {
+
+ path = vmt2dataptr( aixcurr, VMT_STUB );
+ entry = netsnmp_fsys_by_path( path, NETSNMP_FS_FIND_CREATE );
+ if (!entry) {
+ continue;
+ }
+
+ strlcpy(entry->path, path, sizeof(entry->path));
+ strlcpy(entry->device, vmt2dataptr(aixcurr, VMT_OBJECT),
+ sizeof(entry->device));
+ entry->type = _fsys_type( aixcurr->vmt_gfstype );
+
+ if (!(entry->type & _NETSNMP_FS_TYPE_SKIP_BIT))
+ entry->flags |= NETSNMP_FS_FLAG_ACTIVE;
+
+ if ( _fsys_remote( entry->device, entry->type, vmt2dataptr( aixcurr, VMT_HOST) ))
+ entry->flags |= NETSNMP_FS_FLAG_REMOTE;
+ if ( aixcurr->vmt_flags & MNT_READONLY )
+ entry->flags |= NETSNMP_FS_FLAG_RONLY;
+ /*
+ * The root device is presumably bootable.
+ * Other partitions probably aren't!
+ */
+ if ((entry->path[0] == '/') && (entry->path[1] == '\0'))
+ entry->flags |= NETSNMP_FS_FLAG_BOOTABLE;
+
+ /*
+ * XXX - identify removeable disks
+ */
+
+ /*
+ * Optionally skip retrieving statistics for remote mounts
+ */
+ if ( (entry->flags & NETSNMP_FS_FLAG_REMOTE) &&
+ netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES))
+ continue;
+
+ if ( statfs( entry->path, &stat_buf ) < 0 ) {
+ snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s\n", entry->path );
+ snmp_log_perror( tmpbuf );
+ continue;
+ }
+ entry->units = stat_buf.f_bsize;
+ entry->size = stat_buf.f_blocks;
+ entry->used = (stat_buf.f_blocks - stat_buf.f_bfree);
+ entry->avail = stat_buf.f_bavail;
+ entry->inums_total = stat_buf.f_files;
+ entry->inums_avail = stat_buf.f_ffree;
+ netsnmp_fsys_calculate32(entry);
+ }
+ free(aixmnt);
+ aixmnt = NULL;
+ aixcurr = NULL;
+}
+
diff --git a/agent/mibgroup/hardware/fsys/fsys_mntent.c b/agent/mibgroup/hardware/fsys/fsys_mntent.c
new file mode 100644
index 0000000..c5e711c
--- /dev/null
+++ b/agent/mibgroup/hardware/fsys/fsys_mntent.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/hardware/fsys.h>
+
+#include <stdio.h>
+#if HAVE_MNTENT_H
+#include <mntent.h>
+#endif
+#if HAVE_SYS_MNTTAB_H
+#include <sys/mnttab.h>
+#endif
+#if HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+#ifdef solaris2
+#define _NETSNMP_GETMNTENT_TWO_ARGS 1
+#else
+#undef _NETSNMP_GETMNTENT_TWO_ARGS
+#endif
+
+ /*
+ * Handle naming differences between getmntent() APIs
+ */
+#ifdef _NETSNMP_GETMNTENT_TWO_ARGS
+ /* Two-argument form (Solaris) */
+#define NSFS_MNTENT struct mnttab
+#define NSFS_PATH mnt_mountp
+#define NSFS_DEV mnt_special
+#define NSFS_TYPE mnt_fstype
+
+#define NSFS_STATFS statvfs
+#define NSFS_SIZE f_frsize
+
+#else
+ /* One-argument form (everything else?) */
+#define NSFS_MNTENT struct mntent
+#define NSFS_PATH mnt_dir
+#define NSFS_DEV mnt_fsname
+#define NSFS_TYPE mnt_type
+
+#define NSFS_STATFS statfs
+#define NSFS_SIZE f_bsize
+
+#endif
+
+int
+_fsys_remote( char *device, int type )
+{
+ if (( type == NETSNMP_FS_TYPE_NFS) ||
+ ( type == NETSNMP_FS_TYPE_AFS))
+ return 1;
+ else
+ return 0;
+}
+
+int
+_fsys_type( char *typename )
+{
+ DEBUGMSGTL(("fsys:type", "Classifying %s\n", typename));
+
+ if ( !typename || *typename=='\0' )
+ return NETSNMP_FS_TYPE_UNKNOWN;
+
+#include "mnttypes.h"
+
+ else if ( !strcmp(typename, MNTTYPE_FFS) )
+ return NETSNMP_FS_TYPE_BERKELEY;
+ else if ( !strcmp(typename, MNTTYPE_UFS) )
+ return _NETSNMP_FS_TYPE_UFS; /* either N_FS_TYPE_BERKELEY or N_FS_TYPE_SYSV */
+ else if ( !strcmp(typename, MNTTYPE_SYSV) )
+ return NETSNMP_FS_TYPE_SYSV;
+ else if ( !strcmp(typename, MNTTYPE_PC) ||
+ !strcmp(typename, MNTTYPE_MSDOS) )
+ return NETSNMP_FS_TYPE_FAT;
+ else if ( !strcmp(typename, MNTTYPE_HFS) )
+ return NETSNMP_FS_TYPE_HFS;
+ else if ( !strcmp(typename, MNTTYPE_MFS) )
+ return NETSNMP_FS_TYPE_MFS;
+ else if ( !strcmp(typename, MNTTYPE_NTFS) )
+ return NETSNMP_FS_TYPE_NTFS;
+ else if ( !strcmp(typename, MNTTYPE_ISO9660) ||
+ !strcmp(typename, MNTTYPE_CD9660) )
+ return NETSNMP_FS_TYPE_ISO9660;
+ else if ( !strcmp(typename, MNTTYPE_CDFS) )
+ return _NETSNMP_FS_TYPE_CDFS; /* either N_FS_TYPE_ISO9660 or N_FS_TYPE_ROCKRIDGE */
+ else if ( !strcmp(typename, MNTTYPE_HSFS) )
+ return NETSNMP_FS_TYPE_ROCKRIDGE;
+ else if ( !strcmp(typename, MNTTYPE_NFS) ||
+ !strcmp(typename, MNTTYPE_NFS3) ||
+ !strcmp(typename, MNTTYPE_NFS4) ||
+ !strcmp(typename, MNTTYPE_CIFS) || /* i.e. SMB - ?? */
+ !strcmp(typename, MNTTYPE_SMBFS) /* ?? */ )
+ return NETSNMP_FS_TYPE_NFS;
+ else if ( !strcmp(typename, MNTTYPE_NCPFS) )
+ return NETSNMP_FS_TYPE_NETWARE;
+ else if ( !strcmp(typename, MNTTYPE_AFS) )
+ return NETSNMP_FS_TYPE_AFS;
+ else if ( !strcmp(typename, MNTTYPE_EXT2) ||
+ !strcmp(typename, MNTTYPE_EXT3) ||
+ !strcmp(typename, MNTTYPE_EXT4) ||
+ !strcmp(typename, MNTTYPE_EXT2FS) ||
+ !strcmp(typename, MNTTYPE_EXT3FS) ||
+ !strcmp(typename, MNTTYPE_EXT4FS) )
+ return NETSNMP_FS_TYPE_EXT2;
+ else if ( !strcmp(typename, MNTTYPE_FAT32) ||
+ !strcmp(typename, MNTTYPE_VFAT) )
+ return NETSNMP_FS_TYPE_FAT32;
+
+ /*
+ * The following code covers selected filesystems
+ * which are not covered by the HR-TYPES enumerations,
+ * but should still be monitored.
+ * These are all mapped into type "other"
+ *
+ * (The systems listed are not fixed in stone,
+ * but are simply here to illustrate the principle!)
+ */
+ else if ( !strcmp(typename, MNTTYPE_MVFS) ||
+ !strcmp(typename, MNTTYPE_TMPFS) ||
+ !strcmp(typename, MNTTYPE_GFS) ||
+ !strcmp(typename, MNTTYPE_GFS2) ||
+ !strcmp(typename, MNTTYPE_XFS) ||
+ !strcmp(typename, MNTTYPE_JFS) ||
+ !strcmp(typename, MNTTYPE_VXFS) ||
+ !strcmp(typename, MNTTYPE_REISERFS) ||
+ !strcmp(typename, MNTTYPE_OCFS2) ||
+ !strcmp(typename, MNTTYPE_CVFS) ||
+ !strcmp(typename, MNTTYPE_LOFS))
+ return NETSNMP_FS_TYPE_OTHER;
+
+ /*
+ * All other types are silently skipped
+ */
+ else
+ return NETSNMP_FS_TYPE_IGNORE;
+}
+
+void
+netsnmp_fsys_arch_init( void )
+{
+ return;
+}
+
+void
+netsnmp_fsys_arch_load( void )
+{
+ FILE *fp=NULL;
+#ifdef _NETSNMP_GETMNTENT_TWO_ARGS
+ struct mnttab mtmp;
+ struct mnttab *m = &mtmp;
+#else
+ struct mntent *m;
+#endif
+ struct NSFS_STATFS stat_buf;
+ netsnmp_fsys_info *entry;
+ char tmpbuf[1024];
+
+ /*
+ * Retrieve information about the currently mounted filesystems...
+ */
+ fp = fopen( ETC_MNTTAB, "r" ); /* OR setmntent()?? */
+ if ( !fp ) {
+ snprintf( tmpbuf, sizeof(tmpbuf), "Cannot open %s\n", ETC_MNTTAB );
+ snmp_log_perror( tmpbuf );
+ return;
+ }
+
+ /*
+ * ... and insert this into the filesystem container.
+ */
+ while
+#ifdef _NETSNMP_GETMNTENT_TWO_ARGS
+ ((getmntent(fp, m)) == 0 )
+#else
+ ((m = getmntent(fp)) != NULL )
+#endif
+ {
+ entry = netsnmp_fsys_by_path( m->NSFS_PATH, NETSNMP_FS_FIND_CREATE );
+ if (!entry) {
+ continue;
+ }
+
+ strlcpy(entry->path, m->NSFS_PATH, sizeof(entry->path));
+ strlcpy(entry->device, m->NSFS_DEV, sizeof(entry->device));
+ entry->type = _fsys_type(m->NSFS_TYPE);
+ if (!(entry->type & _NETSNMP_FS_TYPE_SKIP_BIT))
+ entry->flags |= NETSNMP_FS_FLAG_ACTIVE;
+
+ if ( _fsys_remote( entry->device, entry->type ))
+ entry->flags |= NETSNMP_FS_FLAG_REMOTE;
+#if HAVE_HASMNTOPT
+ if (hasmntopt( m, "ro" ))
+ entry->flags |= NETSNMP_FS_FLAG_RONLY;
+#endif
+ /*
+ * The root device is presumably bootable.
+ * Other partitions probably aren't!
+ *
+ * XXX - what about /boot ??
+ */
+ if ((entry->path[0] == '/') &&
+ (entry->path[1] == '\0'))
+ entry->flags |= NETSNMP_FS_FLAG_BOOTABLE;
+
+ /*
+ * XXX - identify removeable disks
+ */
+
+ /*
+ * Optionally skip retrieving statistics for remote mounts
+ */
+ if ( (entry->flags & NETSNMP_FS_FLAG_REMOTE) &&
+ netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES))
+ continue;
+
+#ifdef irix6
+ if ( NSFS_STATFS( entry->path, &stat_buf, sizeof(struct statfs), 0) < 0 )
+#else
+ if ( NSFS_STATFS( entry->path, &stat_buf ) < 0 )
+#endif
+ {
+ snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s\n", entry->path );
+ snmp_log_perror( tmpbuf );
+ continue;
+ }
+ entry->units = stat_buf.NSFS_SIZE;
+ entry->size = stat_buf.f_blocks;
+ entry->used = (stat_buf.f_blocks - stat_buf.f_bfree);
+ /* entry->avail is currently unsigned, so protect against negative
+ * values!
+ * This should be changed to a signed field.
+ */
+ if (stat_buf.f_bavail < 0)
+ entry->avail = 0;
+ else
+ entry->avail = stat_buf.f_bavail;
+ entry->inums_total = stat_buf.f_files;
+ entry->inums_avail = stat_buf.f_ffree;
+ netsnmp_fsys_calculate32(entry);
+ }
+ fclose( fp );
+}
+
diff --git a/agent/mibgroup/hardware/fsys/fsys_void.c b/agent/mibgroup/hardware/fsys/fsys_void.c
new file mode 100644
index 0000000..7edc344
--- /dev/null
+++ b/agent/mibgroup/hardware/fsys/fsys_void.c
@@ -0,0 +1,24 @@
+#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/fsys.h>
+
+int
+_fsys_remote( char *device, int type )
+{
+ return 0;
+}
+
+int
+_fsys_type( char *typename )
+{
+ return NETSNMP_FS_TYPE_UNKNOWN;
+}
+
+void
+netsnmp_fsys_arch_init( void )
+{ }
+
+void
+netsnmp_fsys_arch_load( void )
+{ }
diff --git a/agent/mibgroup/hardware/fsys/hw_fsys.c b/agent/mibgroup/hardware/fsys/hw_fsys.c
new file mode 100644
index 0000000..a6cd94d
--- /dev/null
+++ b/agent/mibgroup/hardware/fsys/hw_fsys.c
@@ -0,0 +1,349 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/fsys.h>
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+netsnmp_feature_child_of(hw_fsys_get_container, netsnmp_unused)
+
+extern void netsnmp_fsys_arch_load( void );
+extern void netsnmp_fsys_arch_init( void );
+static int _fsys_load( void );
+static void _fsys_free( void );
+
+static int _fsysAutoUpdate = 0; /* 0 means on-demand caching */
+static void _fsys_update_stats( unsigned int, void* );
+
+netsnmp_cache *_fsys_cache = NULL;
+netsnmp_container *_fsys_container = NULL;
+static int _fsys_idx = 0;
+static netsnmp_fsys_info * _fsys_create_entry( void );
+
+void init_hw_fsys( void ) {
+
+ if ( _fsys_container )
+ return; /* Already initialised */
+
+ DEBUGMSGTL(("fsys", "Initialise Hardware FileSystem module\n"));
+
+ /*
+ * Define a container to hold the list of filesystems
+ */
+ _fsys_container = netsnmp_container_find("fsysTable:table_container");
+ if ( NULL == _fsys_container ) {
+ snmp_log( LOG_ERR, "failed to create container for fsysTable");
+ return;
+ }
+ netsnmp_fsys_arch_init( );
+
+ /*
+ * If we're sampling the file system information automatically,
+ * then arrange for this to be triggered regularly.
+ *
+ * If we're not sampling these values regularly,
+ * create a suitable cache handler instead.
+ */
+ if ( _fsysAutoUpdate ) {
+ DEBUGMSGTL(("fsys", "Reloading Hardware FileSystems automatically (%d)\n",
+ _fsysAutoUpdate));
+ snmp_alarm_register( _fsysAutoUpdate, SA_REPEAT,
+ _fsys_update_stats, NULL );
+ }
+ else {
+ _fsys_cache = netsnmp_cache_create( 5, netsnmp_fsys_load,
+ netsnmp_fsys_free, NULL, 0 );
+ DEBUGMSGTL(("fsys", "Reloading Hardware FileSystems on-demand (%p)\n",
+ _fsys_cache));
+ }
+}
+
+void shutdown_hw_fsys( void ) {
+ _fsys_free();
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_HW_FSYS_GET_CONTAINER
+/*
+ * Return the main fsys container
+ */
+netsnmp_container *netsnmp_fsys_get_container( void ) { return _fsys_container; }
+#endif /* NETSNMP_FEATURE_REMOVE_HW_FSYS_GET_CONTAINER */
+
+/*
+ * Return the main fsys cache control structure (if defined)
+ */
+netsnmp_cache *netsnmp_fsys_get_cache( void ) { return _fsys_cache; }
+
+
+/*
+ * Wrapper routine for automatically updating fsys information
+ */
+void
+_fsys_update_stats( unsigned int clientreg, void *data )
+{
+ _fsys_free();
+ _fsys_load();
+}
+
+/*
+ * Wrapper routine for re-loading filesystem statistics on demand
+ */
+int
+netsnmp_fsys_load( netsnmp_cache *cache, void *data )
+{
+ /* XXX - check cache timeliness */
+ return _fsys_load();
+}
+
+/*
+ * Wrapper routine for releasing expired filesystem statistics
+ */
+void
+netsnmp_fsys_free( netsnmp_cache *cache, void *data )
+{
+ _fsys_free();
+}
+
+
+/*
+ * Architecture-independent processing of loading filesystem statistics
+ */
+static int
+_fsys_load( void )
+{
+ netsnmp_fsys_arch_load();
+ /* XXX - update cache timestamp */
+ return 0;
+}
+
+/*
+ * Architecture-independent release of filesystem statistics
+ */
+static void
+_fsys_free( void )
+{
+ netsnmp_fsys_info *sp;
+
+ for (sp = CONTAINER_FIRST( _fsys_container );
+ sp;
+ sp = CONTAINER_NEXT( _fsys_container, sp )) {
+
+ sp->flags &= ~NETSNMP_FS_FLAG_ACTIVE;
+ }
+}
+
+
+netsnmp_fsys_info *netsnmp_fsys_get_first( void ) {
+ return CONTAINER_FIRST( _fsys_container );
+}
+netsnmp_fsys_info *netsnmp_fsys_get_next( netsnmp_fsys_info *this_ptr ) {
+ return CONTAINER_NEXT( _fsys_container, this_ptr );
+}
+
+/*
+ * Retrieve a filesystem entry based on the path where it is mounted,
+ * or (optionally) insert a new one into the container
+ */
+netsnmp_fsys_info *
+netsnmp_fsys_by_path( char *path, int create_type )
+{
+ netsnmp_fsys_info *sp;
+
+ DEBUGMSGTL(("fsys:path", "Get filesystem entry (%s)\n", path));
+
+ /*
+ * Look through the list for a matching entry
+ */
+ /* .. or use a secondary index container ?? */
+ for (sp = CONTAINER_FIRST( _fsys_container );
+ sp;
+ sp = CONTAINER_NEXT( _fsys_container, sp )) {
+
+ if ( !strcmp( path, sp->path ))
+ return sp;
+ }
+
+ /*
+ * Not found...
+ */
+ if ( create_type == NETSNMP_FS_FIND_EXIST ) {
+ DEBUGMSGTL(("fsys:path", "No such filesystem entry\n"));
+ return NULL;
+ }
+
+ /*
+ * ... so let's create a new one
+ */
+ sp = _fsys_create_entry();
+ if (sp)
+ strlcpy(sp->path, path, sizeof(sp->path));
+ return sp;
+}
+
+
+/*
+ * Retrieve a filesystem entry based on the hardware device,
+ * (or exported path for remote mounts).
+ * (Optionally) insert a new one into the container.
+ */
+netsnmp_fsys_info *
+netsnmp_fsys_by_device( char *device, int create_type )
+{
+ netsnmp_fsys_info *sp;
+
+ DEBUGMSGTL(("fsys:device", "Get filesystem entry (%s)\n", device));
+
+ /*
+ * Look through the list for a matching entry
+ */
+ /* .. or use a secondary index container ?? */
+ for (sp = CONTAINER_FIRST( _fsys_container );
+ sp;
+ sp = CONTAINER_NEXT( _fsys_container, sp )) {
+
+ if ( !strcmp( device, sp->device ))
+ return sp;
+ }
+
+ /*
+ * Not found...
+ */
+ if ( create_type == NETSNMP_FS_FIND_EXIST ) {
+ DEBUGMSGTL(("fsys:device", "No such filesystem entry\n"));
+ return NULL;
+ }
+
+ /*
+ * ... so let's create a new one
+ */
+ sp = _fsys_create_entry();
+ if (sp)
+ strlcpy(sp->device, device, sizeof(sp->device));
+ return sp;
+}
+
+
+netsnmp_fsys_info *
+_fsys_create_entry( void )
+{
+ netsnmp_fsys_info *sp;
+
+ sp = SNMP_MALLOC_TYPEDEF( netsnmp_fsys_info );
+ if ( sp ) {
+ /*
+ * Set up the index value.
+ *
+ * All this trouble, just for a simple integer.
+ * Surely there must be a better way?
+ */
+ sp->idx.len = 1;
+ sp->idx.oids = SNMP_MALLOC_TYPEDEF( oid );
+ sp->idx.oids[0] = ++_fsys_idx;
+ }
+
+ DEBUGMSGTL(("fsys:new", "Create filesystem entry (index = %d)\n", _fsys_idx));
+ CONTAINER_INSERT( _fsys_container, sp );
+ return sp;
+}
+
+
+/*
+ * Convert fsys size information to 1K units
+ * (attempting to avoid 32-bit overflow!)
+ */
+unsigned long long
+_fsys_to_K( unsigned long long size, unsigned long long units )
+{
+ int factor = 1;
+
+ if ( units == 0 ) {
+ return 0; /* XXX */
+ } else if ( units == 1024 ) {
+ return size;
+ } else if ( units == 512 ) { /* To avoid unnecessary division */
+ return size/2;
+ } else if ( units < 1024 ) {
+ factor = 1024 / units; /* Assuming power of two */
+ return (size / factor);
+ } else {
+ factor = units / 1024; /* Assuming multiple of 1K */
+ return (size * factor);
+ }
+}
+
+unsigned long long
+netsnmp_fsys_size_ull( netsnmp_fsys_info *f) {
+ if ( !f ) {
+ return 0;
+ }
+ return _fsys_to_K( f->size, f->units );
+}
+
+unsigned long long
+netsnmp_fsys_used_ull( netsnmp_fsys_info *f) {
+ if ( !f ) {
+ return 0;
+ }
+ return _fsys_to_K( f->used, f->units );
+}
+
+unsigned long long
+netsnmp_fsys_avail_ull( netsnmp_fsys_info *f) {
+ if ( !f ) {
+ return 0;
+ }
+ return _fsys_to_K( f->avail, f->units );
+}
+
+
+int
+netsnmp_fsys_size( netsnmp_fsys_info *f) {
+ unsigned long long v = netsnmp_fsys_size_ull(f);
+ return (int)v;
+}
+
+int
+netsnmp_fsys_used( netsnmp_fsys_info *f) {
+ unsigned long long v = netsnmp_fsys_used_ull(f);
+ return (int)v;
+}
+
+int
+netsnmp_fsys_avail( netsnmp_fsys_info *f) {
+ unsigned long long v = netsnmp_fsys_avail_ull(f);
+ return (int)v;
+}
+
+#ifndef INT32_MAX
+#define INT32_MAX 0x7fffffff
+#endif
+
+#ifndef PRIu64
+#define PRIu64 "llu"
+#endif
+
+/* recalculate f->size_32, used_32, avail_32 and units_32 from f->size & comp.*/
+void
+netsnmp_fsys_calculate32(netsnmp_fsys_info *f)
+{
+ unsigned long long s = f->size;
+ unsigned shift = 0;
+
+ while (s > INT32_MAX) {
+ s = s >> 1;
+ shift++;
+ }
+
+ f->size_32 = s;
+ f->units_32 = f->units << shift;
+ f->avail_32 = f->avail >> shift;
+ f->used_32 = f->used >> shift;
+
+ DEBUGMSGTL(("fsys", "Results of 32-bit conversion: size %" PRIu64 " -> %lu;"
+ " units %" PRIu64 " -> %lu; avail %" PRIu64 " -> %lu;"
+ " used %" PRIu64 " -> %lu\n",
+ (uint64_t)f->size, f->size_32, (uint64_t)f->units, f->units_32,
+ (uint64_t)f->avail, f->avail_32, (uint64_t)f->used, f->used_32));
+}
diff --git a/agent/mibgroup/hardware/fsys/hw_fsys.h b/agent/mibgroup/hardware/fsys/hw_fsys.h
new file mode 100644
index 0000000..31f90ef
--- /dev/null
+++ b/agent/mibgroup/hardware/fsys/hw_fsys.h
@@ -0,0 +1,2 @@
+void init_hw_fsys(void);
+void shutdown_hw_fsys( void );
diff --git a/agent/mibgroup/hardware/fsys/mnttypes.h b/agent/mibgroup/hardware/fsys/mnttypes.h
new file mode 100644
index 0000000..ed4f590
--- /dev/null
+++ b/agent/mibgroup/hardware/fsys/mnttypes.h
@@ -0,0 +1,175 @@
+#ifndef _NETSNMP_FSYS_MNTTYPES_H
+#define _NETSNMP_FSYS_MNTTYPES_H
+/*
+ * Some mounts can map to one of two hrFS types
+ * (depending on other characteristics of the system)
+ * Note which should be used *before* defining any
+ * type tokens which may be missing.
+ */
+
+#if (defined(BerkelyFS) && !defined(MNTTYPE_HFS)) || defined(solaris2)
+#define _NETSNMP_FS_TYPE_UFS NETSNMP_FS_TYPE_BERKELEY
+#else
+#define _NETSNMP_FS_TYPE_UFS NETSNMP_FS_TYPE_SYSV
+#endif
+
+#ifdef RockRidge
+#define _NETSNMP_FS_TYPE_CDFS NETSNMP_FS_TYPE_ROCKRIDGE
+#else
+#define _NETSNMP_FS_TYPE_CDFS NETSNMP_FS_TYPE_ISO9660
+#endif
+
+
+/*
+ * Ensure all recognised filesystem mount type tokens are
+ * available (even on systems where they're not used)
+ */
+#ifndef MNTTYPE_AFS
+#define MNTTYPE_AFS "afs"
+#endif
+#ifndef MNTTYPE_CDFS
+#define MNTTYPE_CDFS "cdfs"
+#endif
+#ifndef MNTTYPE_CD9660
+#define MNTTYPE_CD9660 "cd9660"
+#endif
+#ifndef MNTTYPE_EXT2
+#define MNTTYPE_EXT2 "ext2"
+#endif
+#ifndef MNTTYPE_EXT3
+#define MNTTYPE_EXT3 "ext3"
+#endif
+#ifndef MNTTYPE_EXT4
+#define MNTTYPE_EXT4 "ext4"
+#endif
+#ifndef MNTTYPE_EXT2FS
+#define MNTTYPE_EXT2FS "ext2fs"
+#endif
+#ifndef MNTTYPE_EXT3FS
+#define MNTTYPE_EXT3FS "ext3fs"
+#endif
+#ifndef MNTTYPE_EXT4FS
+#define MNTTYPE_EXT4FS "ext4fs"
+#endif
+#ifndef MNTTYPE_FAT32
+#define MNTTYPE_FAT32 "fat32"
+#endif
+#ifndef MNTTYPE_FFS
+#define MNTTYPE_FFS "ffs"
+#endif
+#ifndef MNTTYPE_HFS
+#define MNTTYPE_HFS "hfs"
+#endif
+#ifndef MNTTYPE_HSFS
+#define MNTTYPE_HSFS "hsfs"
+#endif
+#ifndef MNTTYPE_ISO9660
+#define MNTTYPE_ISO9660 "iso9660"
+#endif
+#ifndef MNTTYPE_MFS
+#define MNTTYPE_MFS "mfs"
+#endif
+#ifndef MNTTYPE_MSDOS
+#define MNTTYPE_MSDOS "msdos"
+#endif
+#ifndef MNTTYPE_NCPFS
+#define MNTTYPE_NCPFS "ncpfs"
+#endif
+#ifndef MNTTYPE_NFS
+#define MNTTYPE_NFS "nfs"
+#endif
+#ifndef MNTTYPE_NFS3
+#define MNTTYPE_NFS3 "nfs3"
+#endif
+#ifndef MNTTYPE_NFS4
+#define MNTTYPE_NFS4 "nfs4"
+#endif
+#ifndef MNTTYPE_NTFS
+#define MNTTYPE_NTFS "ntfs"
+#endif
+#ifndef MNTTYPE_PC
+#define MNTTYPE_PC "pc"
+#endif
+#ifndef MNTTYPE_SMBFS
+#define MNTTYPE_SMBFS "smbfs"
+#endif
+#ifndef MNTTYPE_CIFS
+#define MNTTYPE_CIFS "cifs"
+#endif
+#ifndef MNTTYPE_SYSV
+#define MNTTYPE_SYSV "sysv"
+#endif
+#ifndef MNTTYPE_UFS
+#define MNTTYPE_UFS "ufs"
+#endif
+#ifndef MNTTYPE_VFAT
+#define MNTTYPE_VFAT "vfat"
+#endif
+
+/*
+ * File systems to monitor, but not covered by HR-TYPES enumerations
+ */
+#ifndef MNTTYPE_MVFS
+#define MNTTYPE_MVFS "mvfs"
+#endif
+#ifndef MNTTYPE_TMPFS
+#define MNTTYPE_TMPFS "tmpfs"
+#endif
+#ifndef MNTTYPE_GFS
+#define MNTTYPE_GFS "gfs"
+#endif
+#ifndef MNTTYPE_GFS2
+#define MNTTYPE_GFS2 "gfs2"
+#endif
+#ifndef MNTTYPE_XFS
+#define MNTTYPE_XFS "xfs"
+#endif
+#ifndef MNTTYPE_JFS
+#define MNTTYPE_JFS "jfs"
+#endif
+#ifndef MNTTYPE_VXFS
+#define MNTTYPE_VXFS "vxfs"
+#endif
+#ifndef MNTTYPE_REISERFS
+#define MNTTYPE_REISERFS "reiserfs"
+#endif
+#ifndef MNTTYPE_LOFS
+#define MNTTYPE_LOFS "lofs"
+#endif
+#ifndef MNTTYPE_OCFS2
+#define MNTTYPE_OCFS2 "ocfs2"
+#endif
+#ifndef MNTTYPE_CVFS
+#define MNTTYPE_CVFS "cvfs"
+#endif
+
+/*
+ * File systems to skip
+ * (Probably not strictly needed)
+ */
+#ifndef MNTTYPE_APP
+#define MNTTYPE_APP "app"
+#endif
+#ifndef MNTTYPE_DEVPTS
+#define MNTTYPE_DEVPTS "devpts"
+#endif
+#ifndef MNTTYPE_IGNORE
+#define MNTTYPE_IGNORE "ignore"
+#endif
+#ifndef MNTTYPE_PROC
+#define MNTTYPE_PROC "proc"
+#endif
+#ifndef MNTTYPE_SYSFS
+#define MNTTYPE_SYSFS "sysfs"
+#endif
+#ifndef MNTTYPE_USBFS
+#define MNTTYPE_USBFS "usbfs"
+#endif
+#ifndef MNTTYPE_BINFMT
+#define MNTTYPE_BINFMT "binfmt_misc"
+#endif
+#ifndef MNTTYPE_RPCPIPE
+#define MNTTYPE_RPCPIPE "rpc_pipefs"
+#endif
+
+#endif /* _NETSNMP_FSYS_MNTTYPES_H */
diff --git a/agent/mibgroup/hardware/fsys/mounts.h b/agent/mibgroup/hardware/fsys/mounts.h
new file mode 100644
index 0000000..2148888
--- /dev/null
+++ b/agent/mibgroup/hardware/fsys/mounts.h
@@ -0,0 +1,159 @@
+#ifndef _NETSNMP_FSYS_MOUNTS_H
+#define _NETSNMP_FSYS_MOUNTS_H
+/*
+ * Some mounts can map to one of two hrFS types
+ * (depending on other characteristics of the system)
+ * Note which should be used *before* defining any
+ * type tokens which may be missing.
+ */
+
+/*
+#if (defined(BerkelyFS) && !defined(MNTTYPE_HFS)) || defined(solaris2)
+#define _NETSNMP_FS_TYPE_UFS NETSNMP_FS_TYPE_BERKELEY
+#else
+#define _NETSNMP_FS_TYPE_UFS NETSNMP_FS_TYPE_SYSV
+#endif
+
+#ifdef RockRidge
+#define _NETSNMP_FS_TYPE_CDFS NETSNMP_FS_TYPE_ROCKRIDGE
+#else
+#define _NETSNMP_FS_TYPE_CDFS NETSNMP_FS_TYPE_ISO9660
+#endif
+ */
+
+
+/*
+ * Ensure all recognised filesystem mount type tokens are
+ * available (even on systems where they're not used)
+ */
+#ifndef MOUNT_FFS
+#define MOUNT_FFS "ffs"
+#endif
+#ifndef MOUNT_NFS
+#define MOUNT_NFS "nfs"
+#endif
+#ifndef MOUNT_MFS
+#define MOUNT_MFS "mfs"
+#endif
+#ifndef MOUNT_MSDOS
+#define MOUNT_MSDOS "msdos"
+#endif
+#ifndef MOUNT_MSDOSFS
+#define MOUNT_MSDOSFS "msdosfs"
+#endif
+#ifndef MOUNT_AFS
+#define MOUNT_AFS "afs"
+#endif
+#ifndef MOUNT_CD9660
+#define MOUNT_CD9660 "cd9660"
+#endif
+#ifndef MOUNT_EXT2FS
+#define MOUNT_EXT2FS "ext2fs"
+#endif
+#ifndef MOUNT_NTFS
+#define MOUNT_NTFS "ntfs"
+#endif
+#ifndef MOUNT_UFS
+#define MOUNT_UFS "ufs"
+#endif
+
+/*
+#ifndef MNTTYPE_AFS
+#define MNTTYPE_AFS "afs"
+#endif
+#ifndef MNTTYPE_CDFS
+#define MNTTYPE_CDFS "cdfs"
+#endif
+#ifndef MNTTYPE_CD9660
+#define MNTTYPE_CD9660 "cd9660"
+#endif
+#ifndef MNTTYPE_EXT2
+#define MNTTYPE_EXT2 "ext2"
+#endif
+#ifndef MNTTYPE_EXT3
+#define MNTTYPE_EXT3 "ext3"
+#endif
+#ifndef MNTTYPE_EXT2FS
+#define MNTTYPE_EXT2FS "ext2fs"
+#endif
+#ifndef MNTTYPE_EXT3FS
+#define MNTTYPE_EXT3FS "ext3fs"
+#endif
+#ifndef MNTTYPE_FAT32
+#define MNTTYPE_FAT32 "fat32"
+#endif
+#ifndef MNTTYPE_FFS
+#define MNTTYPE_FFS "ffs"
+#endif
+#ifndef MNTTYPE_HFS
+#define MNTTYPE_HFS "hfs"
+#endif
+#ifndef MNTTYPE_HSFS
+#define MNTTYPE_HSFS "hsfs"
+#endif
+#ifndef MNTTYPE_ISO9660
+#define MNTTYPE_ISO9660 "iso9660"
+#endif
+#ifndef MNTTYPE_MFS
+#define MNTTYPE_MFS "mfs"
+#endif
+#ifndef MNTTYPE_MSDOS
+#define MNTTYPE_MSDOS "msdos"
+#endif
+#ifndef MNTTYPE_NCPFS
+#define MNTTYPE_NCPFS "ncpfs"
+#endif
+#ifndef MNTTYPE_NFS
+#define MNTTYPE_NFS "nfs"
+#endif
+#ifndef MNTTYPE_NFS3
+#define MNTTYPE_NFS3 "nfs3"
+#endif
+#ifndef MNTTYPE_NTFS
+#define MNTTYPE_NTFS "ntfs"
+#endif
+#ifndef MNTTYPE_PC
+#define MNTTYPE_PC "pc"
+#endif
+#ifndef MNTTYPE_REISERFS
+#define MNTTYPE_REISERFS "reiserfs"
+#endif
+#ifndef MNTTYPE_SMBFS
+#define MNTTYPE_SMBFS "smbfs"
+#endif
+#ifndef MNTTYPE_SYSV
+#define MNTTYPE_SYSV "sysv"
+#endif
+#ifndef MNTTYPE_UFS
+#define MNTTYPE_UFS "ufs"
+#endif
+#ifndef MNTTYPE_VFAT
+#define MNTTYPE_VFAT "vfat"
+#endif
+*/
+
+/*
+ * File systems to skip
+ */
+/*
+#ifndef MNTTYPE_DEVPTS
+#define MNTTYPE_DEVPTS "devpts"
+#endif
+#ifndef MNTTYPE_IGNORE
+#define MNTTYPE_IGNORE "ignore"
+#endif
+#ifndef MNTTYPE_PROC
+#define MNTTYPE_PROC "proc"
+#endif
+#ifndef MNTTYPE_SYSFS
+#define MNTTYPE_SYSFS "sysfs"
+#endif
+#ifndef MNTTYPE_TMPFS
+#define MNTTYPE_TMPFS "tmpfs"
+#endif
+#ifndef MNTTYPE_USBFS
+#define MNTTYPE_USBFS "usbfs"
+#endif
+*/
+
+#endif /* _NETSNMP_FSYS_MOUNTS_H */
diff --git a/agent/mibgroup/hardware/memory.h b/agent/mibgroup/hardware/memory.h
new file mode 100644
index 0000000..c33450a
--- /dev/null
+++ b/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(openbsd))
+config_require(hardware/memory/memory_netbsd)
+
+#elif (defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7))
+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/agent/mibgroup/hardware/memory/hw_mem.c b/agent/mibgroup/hardware/memory/hw_mem.c
new file mode 100644
index 0000000..badc775
--- /dev/null
+++ b/agent/mibgroup/hardware/memory/hw_mem.c
@@ -0,0 +1,104 @@
+#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 <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_child_of(hardware_memory, netsnmp_unused)
+
+netsnmp_feature_child_of(memory_get_cache, hardware_memory)
+
+extern NetsnmpCacheLoad netsnmp_mem_arch_load;
+
+netsnmp_memory_info *_mem_head = NULL;
+netsnmp_cache *_mem_cache = NULL;
+
+void init_hw_mem( void ) {
+ oid nsMemory[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 31 };
+ _mem_cache = netsnmp_cache_create( 5, netsnmp_mem_arch_load, NULL,
+ nsMemory, OID_LENGTH(nsMemory));
+}
+
+
+
+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;
+}
+
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_MEMORY_GET_CACHE
+netsnmp_cache *netsnmp_memory_get_cache( void ) {
+ return _mem_cache;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MEMORY_GET_CACHE */
+
+int netsnmp_memory_load( void ) {
+ return netsnmp_cache_check_and_reload( _mem_cache );
+}
diff --git a/agent/mibgroup/hardware/memory/hw_mem.h b/agent/mibgroup/hardware/memory/hw_mem.h
new file mode 100644
index 0000000..12fd90b
--- /dev/null
+++ b/agent/mibgroup/hardware/memory/hw_mem.h
@@ -0,0 +1 @@
+void init_hw_mem(void);
diff --git a/agent/mibgroup/hardware/memory/memory_aix.c b/agent/mibgroup/hardware/memory/memory_aix.c
new file mode 100644
index 0000000..ad24526
--- /dev/null
+++ b/agent/mibgroup/hardware/memory/memory_aix.c
@@ -0,0 +1,81 @@
+#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/protosw.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/agent/mibgroup/hardware/memory/memory_darwin.c b/agent/mibgroup/hardware/memory/memory_darwin.c
new file mode 100644
index 0000000..4914f0c
--- /dev/null
+++ b/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/agent/mibgroup/hardware/memory/memory_dynix.c b/agent/mibgroup/hardware/memory/memory_dynix.c
new file mode 100644
index 0000000..9b0bc50
--- /dev/null
+++ b/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/agent/mibgroup/hardware/memory/memory_freebsd.c b/agent/mibgroup/hardware/memory/memory_freebsd.c
new file mode 100644
index 0000000..c5007d5
--- /dev/null
+++ b/agent/mibgroup/hardware/memory/memory_freebsd.c
@@ -0,0 +1,264 @@
+#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 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 cache_count;
+ unsigned int cache_max;
+ unsigned int bufspace;
+ unsigned int maxbufspace;
+ unsigned int inact_count;
+ size_t mem_size = sizeof(phys_mem);
+ size_t cache_size = sizeof(cache_count);
+ size_t buf_size = sizeof(bufspace);
+ size_t inact_size = sizeof(inact_count);
+ 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("vm.stats.vm.v_cache_count", &cache_count, &cache_size, NULL, 0);
+ sysctlbyname("vm.stats.vm.v_cache_max", &cache_max, &cache_size, NULL, 0);
+ sysctlbyname("vm.stats.vm.v_inactive_count", &inact_count, &inact_size, NULL, 0);
+ sysctlbyname("vfs.bufspace", &bufspace, &buf_size, NULL, 0);
+ sysctlbyname("vfs.maxbufspace", &maxbufspace, &buf_size, NULL, 0);
+#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 = phys_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 = pagesize;
+ mem->size = cache_max + inact_count;
+ mem->free = cache_max - 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/agent/mibgroup/hardware/memory/memory_hpux.c b/agent/mibgroup/hardware/memory/memory_hpux.c
new file mode 100644
index 0000000..b1181bb
--- /dev/null
+++ b/agent/mibgroup/hardware/memory/memory_hpux.c
@@ -0,0 +1,133 @@
+#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/param.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 = 1024;
+ mem->size = (pss.pss_nblksavail * (DEV_BSIZE/512)) / 2; /* Or pss_nblks ? */
+ mem->free = 4*pss.pss_nfpgs; /* Or pss_nblksavail ? */
+ mem->other = -1;
+ *total +=mem->size;
+ *free +=mem->free;
+ *size = mem->units; /* Hopefully consistent! */
+ i++;
+ } else
+ return;
+ }
+} /* end get_swapinfo */
+
diff --git a/agent/mibgroup/hardware/memory/memory_irix.c b/agent/mibgroup/hardware/memory/memory_irix.c
new file mode 100644
index 0000000..377f007
--- /dev/null
+++ b/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/agent/mibgroup/hardware/memory/memory_linux.c b/agent/mibgroup/hardware/memory/memory_linux.c
new file mode 100644
index 0000000..8c189c5
--- /dev/null
+++ b/agent/mibgroup/hardware/memory/memory_linux.c
@@ -0,0 +1,217 @@
+#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
+ *
+ * On newer systems, the size is up to around 930 (2.6.27 kernel)
+ * or 1160 (2.6.28 kernel)
+ */
+#define MEMINFO_INIT_SIZE 1279
+#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 = (char*)malloc(bsize+1);
+ if (NULL == buff) {
+ snmp_log(LOG_ERR, "malloc failed\n");
+ close(statfd);
+ return -1;
+ }
+ }
+ while ((bytes_read = read(statfd, buff, bsize)) == bsize) {
+ b = (char*)realloc(buff, bsize + MEMINFO_STEP_SIZE + 1);
+ if (NULL == b) {
+ snmp_log(LOG_ERR, "malloc failed\n");
+ close(statfd);
+ 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);
+ } else {
+ buff[bytes_read] = '\0';
+ }
+
+ /*
+ * ... 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");
+ }
+ if (0 == netsnmp_os_prematch("Linux","2.4")) {
+ b = strstr(buff, "MemShared: ");
+ if (b)
+ sscanf(b, "MemShared: %lu", &memshared);
+ else if (first)
+ snmp_log(LOG_ERR, "No MemShared line in /proc/meminfo\n");
+ }
+ else {
+ b = strstr(buff, "Shmem: ");
+ if (b)
+ sscanf(b, "Shmem: %lu", &memshared);
+ else if (first)
+ snmp_log(LOG_ERR, "No Shmem 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;
+ }
+
+ 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 = 0; /* All in use */
+ 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/agent/mibgroup/hardware/memory/memory_linux.h b/agent/mibgroup/hardware/memory/memory_linux.h
new file mode 100644
index 0000000..1b59cfb
--- /dev/null
+++ b/agent/mibgroup/hardware/memory/memory_linux.h
@@ -0,0 +1 @@
+config_require(hardware/memory/hw_mem)
diff --git a/agent/mibgroup/hardware/memory/memory_netbsd.c b/agent/mibgroup/hardware/memory/memory_netbsd.c
new file mode 100644
index 0000000..5749ae2
--- /dev/null
+++ b/agent/mibgroup/hardware/memory/memory_netbsd.c
@@ -0,0 +1,223 @@
+#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 <errno.h>
+#include <sys/sysctl.h>
+#if HAVE_SYS_VMMETER_H
+#include <sys/vmmeter.h>
+#endif
+#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;
+ size_t uvmexp_size = sizeof(uvmexp);
+
+ struct vmtotal total;
+ size_t total_size = sizeof(total);
+
+ quad_t phys_mem;
+ quad_t user_mem;
+ size_t mem_size = sizeof(phys_mem);
+#if defined(openbsd)
+ int phys_mem_mib[] = { CTL_HW, HW_PHYSMEM64 };
+ int user_mem_mib[] = { CTL_HW, HW_USERMEM64 };
+ int uvmexp_mib[] = { CTL_VM, VM_UVMEXP };
+ int total_mib[] = { CTL_VM, VM_METER };
+#else
+ unsigned int bufspace;
+ unsigned int maxbufspace;
+ size_t buf_size = sizeof(bufspace);
+#endif
+
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+#if defined(openbsd)
+ 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);
+#else
+ if (sysctlbyname("vm.uvmexp", &uvmexp, &uvmexp_size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl vm.uvmexp failed (errno %d)\n", errno);
+ return -1;
+ }
+ if (sysctlbyname("vm.vmmeter", &total, &total_size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl vm.vmmeter failed (errno %d)\n", errno);
+ return -1;
+ }
+ if (sysctlbyname("hw.physmem64", &phys_mem, &mem_size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl hw.physmem64 failed (errno %d)\n", errno);
+ return -1;
+ }
+ if (sysctlbyname("hw.usermem64", &user_mem, &mem_size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl hw.usermem64 failed (errno %d)\n", errno);
+ return -1;
+ }
+ if (sysctlbyname("vm.bufmem", &bufspace, &buf_size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl vm.bufmem failed (errno %d)\n", errno);
+ return -1;
+ }
+ if (sysctlbyname("vm.bufmem_hiwater", &maxbufspace, &buf_size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl vm.bufmem_hiwater failed (errno %d)\n", errno);
+ return -1;
+ }
+
+#endif
+ pagesize = sysconf(_SC_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 = 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;
+ }
+
+#if 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 = 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;
+ }
+#endif
+
+#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;
+ }
+
+#if defined(__NetBSD__)
+ 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->size = (maxbufspace - bufspace)/1024;
+ }
+#endif
+
+ 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/agent/mibgroup/hardware/memory/memory_null.c b/agent/mibgroup/hardware/memory/memory_null.c
new file mode 100644
index 0000000..54ca6df
--- /dev/null
+++ b/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/agent/mibgroup/hardware/memory/memory_solaris.c b/agent/mibgroup/hardware/memory/memory_solaris.c
new file mode 100644
index 0000000..42f203e
--- /dev/null
+++ b/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 = (swaptbl_t*)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/agent/mibgroup/hardware/memory/memory_win.c b/agent/mibgroup/hardware/memory/memory_win.c
new file mode 100644
index 0000000..849aae7
--- /dev/null
+++ b/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/agent/mibgroup/hardware/sensors.h b/agent/mibgroup/hardware/sensors.h
new file mode 100644
index 0000000..b88d915
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors.h
@@ -0,0 +1,17 @@
+config_require(hardware/sensors/hw_sensors)
+
+#if defined(solaris2)
+# if defined(HAVE_PICL_H)
+config_require(hardware/sensors/picld_sensors)
+# else
+config_require(hardware/sensors/kstat_sensors)
+# endif
+#else
+# if defined(NETSNMP_USE_SENSORS_V3)
+config_require(hardware/sensors/lmsensors_v3)
+# else
+config_require(hardware/sensors/lmsensors_v2)
+# endif
+#endif
+
+/* config_require(hardware/sensors/dummy_sensors) */
diff --git a/agent/mibgroup/hardware/sensors/dummy_sensors.c b/agent/mibgroup/hardware/sensors/dummy_sensors.c
new file mode 100644
index 0000000..8d2555d
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/dummy_sensors.c
@@ -0,0 +1,60 @@
+#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/sensors.h>
+
+
+void netsnmp_sensor_arch_init( void ) {
+ /* Nothing to do */
+ DEBUGMSGTL(("sensors:arch", "Initialise Dummy Sensors module\n"));
+}
+
+int
+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
+ time_t now;
+ struct tm *tm;
+ netsnmp_sensor_info *sp;
+
+ time(&now);
+ tm = localtime(&now);
+
+ DEBUGMSGTL(("sensors:arch", "Reload Dummy Sensors module\n"));
+
+ /* First pseudo-sensor - slowly-rising temperature */
+ sp = sensor_by_name( "minute", NETSNMP_SENSOR_TYPE_TEMPERATURE );
+ sp->value = tm->tm_min;
+ snprintf( sp->descr, 256, "Minute-based pseudo-sensor - slowly-rising temperature" );
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+
+ /* Second pseudo-sensor - quickly-rising temperature */
+ sp = sensor_by_name( "second", NETSNMP_SENSOR_TYPE_TEMPERATURE );
+ sp->value = tm->tm_sec;
+ snprintf( sp->descr, 256, "Second-based pseudo-sensor - quickly-rising temperature" );
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+
+ /* Third pseudo-sensor - annual fan speed */
+ sp = sensor_by_name( "year", NETSNMP_SENSOR_TYPE_RPM );
+ sp->value = tm->tm_year + 1900;
+ snprintf( sp->descr, 256, "RPM pseudo-sensor - annual fan speed" );
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+
+ /* Fourth pseudo-sensor - daily voltage */
+ sp = sensor_by_name( "day", NETSNMP_SENSOR_TYPE_VOLTAGE_DC );
+ sp->value = tm->tm_mday-20;
+ snprintf( sp->descr, 256, "Day-based pseudo-sensor - positive or negative voltage" );
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+
+ /* Fifth pseudo-sensor - monthly voltage */
+ sp = sensor_by_name( "month", NETSNMP_SENSOR_TYPE_VOLTAGE_DC );
+ sp->value = tm->tm_mon;
+ snprintf( sp->descr, 256, "Month-based pseudo-sensor - positive voltage" );
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+
+ /* Sixth pseudo-sensor - annual daily something */
+ sp = sensor_by_name( "yday", NETSNMP_SENSOR_TYPE_OTHER );
+ sp->value = tm->tm_yday;
+ snprintf( sp->descr, 256, "Day-based pseudo-sensor - annual something" );
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+
+ return 0;
+}
diff --git a/agent/mibgroup/hardware/sensors/dummy_sensors.h b/agent/mibgroup/hardware/sensors/dummy_sensors.h
new file mode 100644
index 0000000..b5ffb4d
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/dummy_sensors.h
@@ -0,0 +1 @@
+config_require(hardware/sensors/hw_sensors)
diff --git a/agent/mibgroup/hardware/sensors/hw_sensors.c b/agent/mibgroup/hardware/sensors/hw_sensors.c
new file mode 100644
index 0000000..1a01645
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/hw_sensors.c
@@ -0,0 +1,189 @@
+#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/sensors.h>
+
+
+extern NetsnmpCacheLoad netsnmp_sensor_arch_load;
+extern void netsnmp_sensor_arch_init( void );
+static int _sensor_load( void );
+static void _sensor_free( void );
+
+static int _sensorAutoUpdate = 0; /* 0 means on-demand caching */
+static void _sensor_update_stats( unsigned int, void* );
+
+netsnmp_cache *_sensor_cache = NULL;
+netsnmp_container *_sensor_container = NULL;
+static int _sensor_idx = 0;
+
+void init_hw_sensors( void ) {
+
+ if ( _sensor_container )
+ return; /* Already initialised */
+
+ DEBUGMSGTL(("sensors", "Initialise Hardware Sensors module\n"));
+
+ /*
+ * Define a container to hold the basic list of sensors
+ * The four LM-SENSOR-MIB containers will be created in
+ * the relevant initialisation routine(s)
+ */
+ _sensor_container = netsnmp_container_find("sensorTable:table_container");
+ if ( NULL == _sensor_container ) {
+ snmp_log( LOG_ERR, "failed to create container for sensorTable");
+ return;
+ }
+ netsnmp_sensor_arch_init( );
+
+ /*
+ * If we're sampling the sensor information automatically,
+ * then arrange for this to be triggered regularly.
+ *
+ * If we're not sampling these values regularly,
+ * create a suitable cache handler instead.
+ */
+ if ( _sensorAutoUpdate ) {
+ DEBUGMSGTL(("sensors", "Reloading Hardware Sensors automatically (%d)\n",
+ _sensorAutoUpdate));
+ snmp_alarm_register( _sensorAutoUpdate, SA_REPEAT,
+ _sensor_update_stats, NULL );
+ }
+ else {
+ _sensor_cache = netsnmp_cache_create( 5, netsnmp_sensor_load,
+ netsnmp_sensor_free, NULL, 0 );
+ DEBUGMSGTL(("sensors", "Reloading Hardware Sensors on-demand (%p)\n",
+ _sensor_cache));
+ }
+}
+
+void shutdown_hw_sensors( void ) {
+ _sensor_free();
+}
+
+/*
+ * Return the main sensor container
+ */
+netsnmp_container *get_sensor_container( void ) { return _sensor_container; }
+
+/*
+ * Return the main sensor cache control structure (if defined)
+ */
+netsnmp_cache *get_sensor_cache( void ) { return _sensor_cache; }
+
+
+/*
+ * Wrapper routine for automatically updating sensor statistics
+ */
+void
+_sensor_update_stats( unsigned int clientreg, void *data )
+{
+ _sensor_free();
+ _sensor_load();
+}
+
+/*
+ * Wrapper routine for re-loading sensor statistics on demand
+ */
+int
+netsnmp_sensor_load( netsnmp_cache *cache, void *data )
+{
+ return _sensor_load();
+}
+
+/*
+ * Wrapper routine for releasing expired sensor statistics
+ */
+void
+netsnmp_sensor_free( netsnmp_cache *cache, void *data )
+{
+ _sensor_free();
+}
+
+
+/*
+ * Architecture-independent processing of loading sensor statistics
+ */
+static int
+_sensor_load( void )
+{
+ netsnmp_sensor_arch_load( NULL, NULL );
+ return 0;
+}
+
+/*
+ * Architecture-independent release of sensor statistics
+ */
+static void
+_sensor_free( void )
+{
+ netsnmp_sensor_info *sp;
+
+ for (sp = CONTAINER_FIRST( _sensor_container );
+ sp;
+ sp = CONTAINER_NEXT( _sensor_container, sp )) {
+
+ sp->flags &= ~ NETSNMP_SENSOR_FLAG_ACTIVE;
+ }
+}
+
+
+/*
+ * Retrieve a sensor entry by name,
+ * or (optionally) insert a new one into the container
+ */
+netsnmp_sensor_info *
+sensor_by_name( const char *name, int create_type )
+{
+ netsnmp_sensor_info *sp;
+
+ DEBUGMSGTL(("sensors:name", "Get sensor entry (%s)\n", name));
+
+ /*
+ * Look through the list for a matching entry
+ */
+ /* .. or use a secondary index container ?? */
+ for (sp = CONTAINER_FIRST( _sensor_container );
+ sp;
+ sp = CONTAINER_NEXT( _sensor_container, sp )) {
+
+ if ( !strcmp( name, sp->name ))
+ return sp;
+ }
+
+ /*
+ * Not found...
+ */
+ if ( create_type == NETSNMP_SENSOR_FIND_EXIST ) {
+ DEBUGMSGTL(("sensors:name", "No such sensor entry\n"));
+ return NULL;
+ }
+
+ /*
+ * ... so let's create a new one, using the type supplied
+ */
+ sp = SNMP_MALLOC_TYPEDEF( netsnmp_sensor_info );
+ if ( sp ) {
+ if (strlen(name) >= sizeof(sp->name)) {
+ snmp_log(LOG_ERR, "Sensor name is too large: %s\n", name);
+ free(sp);
+ return NULL;
+ }
+ strcpy( sp->name, name );
+ sp->type = create_type;
+ /*
+ * Set up the index value.
+ *
+ * All this trouble, just for a simple integer.
+ * Surely there must be a better way?
+ */
+ sp->idx.len = 1;
+ sp->idx.oids = SNMP_MALLOC_TYPEDEF( oid );
+ sp->idx.oids[0] = ++_sensor_idx;
+ }
+
+ DEBUGMSGTL(("sensors:name", "Create sensor entry (type = %d, index = %d\n",
+ create_type, _sensor_idx));
+ CONTAINER_INSERT( _sensor_container, sp );
+ return sp;
+}
+
diff --git a/agent/mibgroup/hardware/sensors/hw_sensors.h b/agent/mibgroup/hardware/sensors/hw_sensors.h
new file mode 100644
index 0000000..17eccf5
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/hw_sensors.h
@@ -0,0 +1,2 @@
+void init_hw_sensors( void );
+void shutdown_hw_sensors( void );
diff --git a/agent/mibgroup/hardware/sensors/kstat_sensors.c b/agent/mibgroup/hardware/sensors/kstat_sensors.c
new file mode 100644
index 0000000..62bbb10
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/kstat_sensors.c
@@ -0,0 +1,161 @@
+#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/sensors.h>
+
+#include <time.h>
+
+#include <kstat.h>
+#include </usr/platform/sun4u/include/sys/envctrl.h>
+
+void netsnmp_sensor_arch_init( void ) {
+ DEBUGMSGTL(("sensors:arch", "Initialise KStat Sensors module\n"));
+}
+
+
+int
+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
+ netsnmp_sensor_info *sp;
+
+ int i;
+ const char *fantypes[]={"CPU","PWR","AFB"};
+ char name[ 256 ];
+
+ kstat_ctl_t *kc;
+ kstat_t *kp;
+ envctrl_fan_t *fan_info;
+ envctrl_ps_t *power_info;
+ envctrl_encl_t *enc_info;
+
+
+ DEBUGMSGTL(("sensors:arch", "Reload KStat Sensors module\n"));
+
+ kc = kstat_open();
+ if ( kc == 0) {
+ DEBUGMSGTL(("sensors:arch", "Couldn't open kstat\n"));
+ return 1;
+ }
+
+
+ /*
+ * Retrieve fan information
+ */
+ kp = kstat_lookup( kc, ENVCTRL_MODULE_NAME, 0, ENVCTRL_KSTAT_FANSTAT);
+ if (( kp == 0 ) || (kstat_read( kc, kp, 0 ) == -1 )) {
+ DEBUGMSGTL(("sensors:arch", "No fan information\n"));
+ } else {
+ fan_info = (envctrl_fan_t *)kp->ks_data;
+ for (i=0; i<kp->ks_ndata; i++) {
+ memset( name, 0, 256 );
+ snprintf( name, 255, "%s%d", fantypes[fan_info->type], fan_info->instance );
+
+ sp = sensor_by_name( name, NETSNMP_SENSOR_TYPE_RPM );
+ if ( sp ) {
+ sp->value = fan_info->fanspeed;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ snprintf( sp->descr, 255, "fan type %s number %d",
+ fantypes[fan_info->type], fan_info->instance );
+ }
+
+ fan_info++;
+ }
+ }
+
+
+ /*
+ * Retrieve Power Supply information
+ */
+ kp = kstat_lookup( kc, ENVCTRL_MODULE_NAME, 0, ENVCTRL_KSTAT_PSNAME);
+ if (( kp == 0 ) || (kstat_read( kc, kp, 0 ) == -1 )) {
+ DEBUGMSGTL(("sensors:arch", "No PSU information\n"));
+ } else {
+ power_info = (envctrl_ps_t *)kp->ks_data;
+ for (i=0; i<kp->ks_ndata; i++) {
+ memset( name, 0, 256 );
+ snprintf( name, 255, "PSU%d", power_info->instance );
+
+ sp = sensor_by_name( name, NETSNMP_SENSOR_TYPE_TEMPERATURE);
+ if ( sp ) {
+ sp->value = power_info->ps_tempr;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ snprintf( sp->descr, 255, "power supply %d", power_info->instance );
+ }
+
+ power_info++;
+ }
+ }
+
+
+ /*
+ * Retrieve Enclosure information
+ */
+ kp = kstat_lookup( kc, ENVCTRL_MODULE_NAME, 0, ENVCTRL_KSTAT_ENCL);
+ if (( kp == 0 ) || (kstat_read( kc, kp, 0 ) == -1 )) {
+ DEBUGMSGTL(("sensors:arch", "No enclosure information\n"));
+ } else {
+ enc_info = (envctrl_encl_t *)kp->ks_data;
+ for (i=0; i<kp->ks_ndata; i++) {
+ /*
+ * The enclosure information covers several different types of sensor
+ */
+ switch ( enc_info->type ) {
+ case ENVCTRL_ENCL_FSP:
+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure Front Panel\n"));
+ sp = sensor_by_name( "FSP", NETSNMP_SENSOR_TYPE_OTHER);
+ if ( sp ) {
+ sp->value = enc_info->value;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ }
+ break;
+
+ case ENVCTRL_ENCL_AMBTEMPR:
+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure Ambient Temperature\n"));
+ sp = sensor_by_name( "Ambient", NETSNMP_SENSOR_TYPE_TEMPERATURE);
+ if ( sp ) {
+ sp->value = enc_info->value;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ }
+ break;
+
+ case ENVCTRL_ENCL_CPUTEMPR:
+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure CPU Temperature\n"));
+ memset( name, 0, 256 );
+ snprintf( name, 255, "CPU%d", enc_info->instance );
+ sp = sensor_by_name( name, NETSNMP_SENSOR_TYPE_TEMPERATURE);
+ if ( sp ) {
+ sp->value = enc_info->value;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ snprintf( sp->descr, 255, "CPU%d temperature", enc_info->instance );
+ }
+ break;
+
+ case ENVCTRL_ENCL_BACKPLANE4:
+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure Backplane4\n"));
+ sp = sensor_by_name( "Backplane4", NETSNMP_SENSOR_TYPE_OTHER);
+ if ( sp ) {
+ sp->value = enc_info->value;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ }
+ break;
+
+ case ENVCTRL_ENCL_BACKPLANE8:
+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure Backplane4\n"));
+ sp = sensor_by_name( "Backplane4", NETSNMP_SENSOR_TYPE_OTHER);
+ if ( sp ) {
+ sp->value = enc_info->value;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ }
+ break;
+
+ default:
+ DEBUGMSGTL(("sensors:arch:detail", "Unrecognised Enclosure entry (%d)n",
+ enc_info->type));
+ }
+
+ enc_info++;
+ }
+ }
+
+ kstat_close(kc);
+ return 0;
+}
diff --git a/agent/mibgroup/hardware/sensors/kstat_sensors.h b/agent/mibgroup/hardware/sensors/kstat_sensors.h
new file mode 100644
index 0000000..b5ffb4d
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/kstat_sensors.h
@@ -0,0 +1 @@
+config_require(hardware/sensors/hw_sensors)
diff --git a/agent/mibgroup/hardware/sensors/lmsensors_v2.c b/agent/mibgroup/hardware/sensors/lmsensors_v2.c
new file mode 100644
index 0000000..a63f140
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/lmsensors_v2.c
@@ -0,0 +1,74 @@
+#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/sensors.h>
+
+#include <time.h>
+#include <sensors/sensors.h>
+
+void netsnmp_sensor_arch_init( void ) {
+ FILE *fp = fopen("/etc/sensors.conf", "r");
+ DEBUGMSGTL(("sensors:arch", "Initialise LM Sensors module\n"));
+ sensors_init( fp );
+}
+
+int
+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
+ netsnmp_sensor_info *sp;
+ const sensors_chip_name *chip;
+ const sensors_feature_data *data;
+ int chip_nr = 0;
+
+ DEBUGMSGTL(("sensors:arch", "Reload LM Sensors module\n"));
+ while ((chip = sensors_get_detected_chips(&chip_nr))) {
+ int a = 0;
+ int b = 0;
+
+ while ((data = sensors_get_all_features(*chip, &a, &b))) {
+ DEBUGMSGTL(("sensors:arch:detail", "get_all_features (%d, %d)\n", a, b));
+ char *label = NULL;
+ double val;
+ int type = NETSNMP_SENSOR_TYPE_OTHER;
+
+ 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)) {
+
+ DEBUGMSGTL(("sensors:arch:detail", "%s = %f\n", label, val));
+ /*
+ * Determine the type of sensor from the description.
+ *
+ * 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'
+ * rather than 'CPU temp') it will be categorised as OTHER.
+ */
+ if (strstr(label, "V")) {
+ type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC;
+ }
+ if (strstr(label, "fan") || strstr(label, "Fan")) {
+ type = NETSNMP_SENSOR_TYPE_RPM;
+ }
+ if (strstr(label, "temp") || strstr(label, "Temp")) {
+ type = NETSNMP_SENSOR_TYPE_TEMPERATURE;
+ }
+
+ /*
+ * Use this type to create a new sensor entry
+ * (inserting it in the appropriate sub-containers)
+ */
+ sp = sensor_by_name( label, type );
+ if ( sp ) {
+ sp->value = val;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ }
+ }
+ if (label) {
+ free(label);
+ label = NULL;
+ }
+ } /* end while data */
+ } /* end while chip */
+
+ return 0;
+}
diff --git a/agent/mibgroup/hardware/sensors/lmsensors_v2.h b/agent/mibgroup/hardware/sensors/lmsensors_v2.h
new file mode 100644
index 0000000..b5ffb4d
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/lmsensors_v2.h
@@ -0,0 +1 @@
+config_require(hardware/sensors/hw_sensors)
diff --git a/agent/mibgroup/hardware/sensors/lmsensors_v3.c b/agent/mibgroup/hardware/sensors/lmsensors_v3.c
new file mode 100644
index 0000000..e34da19
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/lmsensors_v3.c
@@ -0,0 +1,102 @@
+#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/sensors.h>
+
+#include <time.h>
+#include <sensors/sensors.h>
+
+
+void netsnmp_sensor_arch_init( void ) {
+ FILE *fp = fopen("/etc/sensors.conf", "r");
+ DEBUGMSGTL(("sensors:arch", "Initialise v3 LM Sensors module\n"));
+ sensors_init( fp );
+}
+
+int
+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
+ netsnmp_sensor_info *sp;
+ const sensors_chip_name *chip;
+ const sensors_feature *data;
+ const sensors_subfeature *data2;
+ int chip_nr = 0;
+
+ DEBUGMSGTL(("sensors:arch", "Reload v3 LM Sensors module\n"));
+ while ((chip = sensors_get_detected_chips( NULL, &chip_nr))) {
+ int a = 0;
+
+ while ((data = sensors_get_features( chip, &a))) {
+ int b = 0;
+
+ DEBUGMSGTL(("sensors:arch:detail", "get_features (%s, %d)\n", data->name, data->number));
+
+ while ((data2 = sensors_get_all_subfeatures( chip, data, &b))) {
+ char *label = NULL;
+ double val = 0;
+ int type = NETSNMP_SENSOR_TYPE_OTHER;
+
+ DEBUGMSGTL(("sensors:arch:detail", " get_subfeatures (%s, %d)\n", data2->name, data2->number));
+ /*
+ * Check the type of this subfeature,
+ * concentrating on the main "input" measurements.
+ */
+ switch ( data2->type ) {
+ case SENSORS_SUBFEATURE_IN_INPUT:
+ type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC;
+ break;
+ case SENSORS_SUBFEATURE_FAN_INPUT:
+ type = NETSNMP_SENSOR_TYPE_RPM;
+ break;
+ case SENSORS_SUBFEATURE_TEMP_INPUT:
+ type = NETSNMP_SENSOR_TYPE_TEMPERATURE;
+ break;
+ case SENSORS_SUBFEATURE_VID:
+ type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC;
+ break;
+ default:
+ /* Skip everything other than these basic sensor features - ??? */
+ DEBUGMSGTL(("sensors:arch:detail", " Skip type %x\n", data2->type));
+ continue;
+ }
+
+ /*
+ * Get the name and value of this subfeature
+ */
+/*
+ if (!(label = sensors_get_label(chip, data))) {
+ DEBUGMSGTL(("sensors:arch:detail", " Can't get name (%s)\n", label));
+ continue;
+ }
+ if (sensors_get_value(chip, data2->number, &val) < 0) {
+ DEBUGMSGTL(("sensors:arch:detail", " Can't get value (%f)\n", val));
+ continue;
+ }
+*/
+ if (!(label = sensors_get_label(chip, data)) ||
+ (sensors_get_value(chip, data2->number, &val) < 0)) {
+ DEBUGMSGTL(("sensors:arch:detail", " Can't get name/value (%s, %f)\n", label, val));
+ free(label);
+ label = NULL;
+ continue;
+ }
+ DEBUGMSGTL(("sensors:arch:detail", "%s = %f\n", label, val));
+
+ /*
+ * Use this type to create a new sensor entry
+ * (inserting it in the appropriate sub-containers)
+ */
+ sp = sensor_by_name( label, type );
+ if ( sp ) {
+ sp->value = val;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ }
+ if (label) {
+ free(label);
+ label = NULL;
+ }
+ } /* end while data2 */
+ } /* end while data */
+ } /* end while chip */
+
+ return 0;
+}
diff --git a/agent/mibgroup/hardware/sensors/lmsensors_v3.h b/agent/mibgroup/hardware/sensors/lmsensors_v3.h
new file mode 100644
index 0000000..b5ffb4d
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/lmsensors_v3.h
@@ -0,0 +1 @@
+config_require(hardware/sensors/hw_sensors)
diff --git a/agent/mibgroup/hardware/sensors/picld_sensors.c b/agent/mibgroup/hardware/sensors/picld_sensors.c
new file mode 100644
index 0000000..a4617b2
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/picld_sensors.c
@@ -0,0 +1,334 @@
+#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/sensors.h>
+
+#include <time.h>
+
+#include <picl.h>
+
+void netsnmp_sensor_arch_init( void ) {
+ DEBUGMSGTL(("sensors:arch", "Initialise PICLd Sensors module\n"));
+ picl_initialize();
+}
+
+
+/*
+ * Handle a numeric-valued sensor
+ */
+static int
+read_num_sensor( picl_nodehdl_t childh, const char *propval, float *value )
+{
+ picl_nodehdl_t sensorh;
+ picl_propinfo_t sensor_info;
+ picl_errno_t error_code;
+
+ union valu {
+ char buf[PICL_PROPSIZE_MAX];
+ uint32_t us4;
+ uint16_t us2;
+ int32_t is4;
+ int16_t is2;
+ float f;
+ } val;
+
+ /*
+ * Retrieve the specified sensor information and value
+ */
+ error_code = picl_get_propinfo_by_name(childh, propval, &sensor_info, &sensorh);
+ if ( error_code != PICL_SUCCESS ) {
+ DEBUGMSGTL(("sensors:arch:detail", "sensor info lookup failed (%d)\n",
+ error_code));
+ return( error_code );
+ }
+
+ error_code = picl_get_propval(sensorh, &val.buf, sensor_info.size);
+ if ( error_code != PICL_SUCCESS ) {
+ DEBUGMSGTL(("sensors:arch:detail", "sensor value lookup failed (%d)\n",
+ error_code));
+ return( error_code );
+ }
+
+ /*
+ * Check the validity (type and size) of this value
+ */
+ if ( sensor_info.type == PICL_PTYPE_FLOAT ) {
+ *value = val.f;
+ } else if ( sensor_info.type == PICL_PTYPE_UNSIGNED_INT ) {
+ /* 16-bit or 32-bit unsigned integers */
+ if ( sensor_info.size == 2 ) {
+ *value = val.us2;
+ } else if ( sensor_info.size == 4 ) {
+ *value = val.us4;
+ } else {
+ DEBUGMSGTL(("sensors:arch:detail", "unsigned integer (%d bit)\n",
+ sensor_info.size * 8));
+ return PICL_FAILURE;
+ }
+ } else if ( sensor_info.type == PICL_PTYPE_INT ) {
+ /* 16-bit or 32-bit signed integers */
+ if ( sensor_info.size == 2 ) {
+ *value = val.is2;
+ } else if ( sensor_info.size == 4 ) {
+ *value = val.is4;
+ } else {
+ DEBUGMSGTL(("sensors:arch:detail", "signed integer (%d bit)\n",
+ sensor_info.size * 8));
+ return PICL_FAILURE;
+ }
+ } else {
+ DEBUGMSGTL(("sensors:arch:detail", "unrecognised type (%d)\n",
+ sensor_info.type));
+ return PICL_FAILURE;
+ }
+
+ return error_code;
+}
+
+static int
+process_num_sensor( picl_nodehdl_t childh, const char *propname, const char *propval, int typ )
+{
+ netsnmp_sensor_info *sp;
+ float value;
+ picl_errno_t error_code;
+
+ sp = sensor_by_name( propname, typ );
+ if ( !sp ) {
+ return -1;
+ }
+
+ error_code = read_num_sensor( childh, propval, &value );
+ if ( error_code == PICL_SUCCESS ) {
+ sp->value = value;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ } else {
+ DEBUGMSGTL(("sensors:arch:detail", "Failed to read %s sensor value (%d)\n",
+ propname, error_code));
+ return -1;
+ }
+ return 0;
+}
+
+
+
+/*
+ * Handle an enumeration-valued sensor
+ */
+const char *switch_settings[] = { "OFF","ON","NORMAL","LOCKED",
+ "UNKNOWN","DIAG","SECURE",
+ NULL };
+const char *led_settings[] = { "OFF","ON","BLINK",
+ NULL };
+const char *i2c_settings[] = { "OK",
+ NULL };
+
+static int
+read_enum_sensor( picl_nodehdl_t childh, float *value, const char **options )
+{
+ picl_nodehdl_t sensorh;
+ picl_propinfo_t sensor_info;
+ picl_errno_t error_code;
+ char state[PICL_PROPSIZE_MAX];
+ int i;
+
+ /*
+ * Retrieve the specified sensor information and value
+ */
+ error_code = picl_get_propinfo_by_name(childh, "State", &sensor_info, &sensorh);
+ if ( error_code != PICL_SUCCESS ) {
+ DEBUGMSGTL(("sensors:arch:detail", "sensor info lookup failed (%d)\n",
+ error_code));
+ return( error_code );
+ }
+
+ error_code = picl_get_propval(sensorh, state, sensor_info.size);
+ if ( error_code != PICL_SUCCESS ) {
+ DEBUGMSGTL(("sensors:arch:detail", "sensor value lookup failed (%d)\n",
+ error_code));
+ return( error_code );
+ }
+
+ /*
+ * Try to find a matching entry in the list of options.
+ * Note that some platforms may use upper or lower case
+ * versions of these enumeration values
+ * (so the checks are case insensitive)
+ */
+ *value = 99; /* Dummy value */
+ for ( i=0; options[i] != NULL; i++ ) {
+ if (strncasecmp(state, options[i], strlen(options[i])) == 0) {
+ *value = i;
+ return 0;
+ }
+ }
+
+ DEBUGMSGTL(("sensors:arch:detail", "Enumeration state %s not matched\n",
+ state));
+ return 0; /* Or an error ? */
+}
+
+static int
+process_enum_sensor( picl_nodehdl_t childh, const char *propname, int typ, const char **options )
+{
+ netsnmp_sensor_info *sp;
+ float value;
+ picl_errno_t error_code;
+
+ sp = sensor_by_name( propname, typ );
+ if ( !sp ) {
+ return -1;
+ }
+
+ error_code = read_enum_sensor( childh, &value, options );
+ if ( error_code == PICL_SUCCESS ) {
+ sp->value = value;
+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
+ } else {
+ DEBUGMSGTL(("sensors:arch:detail", "Failed to read %s sensor value (%d)\n",
+ propname, error_code));
+ return -1;
+ }
+ return 0;
+}
+
+
+
+/*
+ * Recursively walk through the tree of sensors
+ */
+static int
+process_sensors( int level, picl_nodehdl_t nodeh ) {
+ picl_nodehdl_t childh, nexth;
+ char propname[ PICL_PROPNAMELEN_MAX ];
+ char propclass[ PICL_CLASSNAMELEN_MAX ];
+ picl_errno_t error_code;
+
+ level++;
+ DEBUGMSGTL(("sensors:arch:detail", "process_sensors - level %d\n", level));
+
+ /* Look up the first child node at this level */
+ error_code = picl_get_propval_by_name( nodeh, PICL_PROP_CHILD,
+ &childh, sizeof(childh));
+ if ( error_code != PICL_SUCCESS ) {
+ DEBUGMSGTL(("sensors:arch:detail", "Failed to get first child node (%d)\n",
+ error_code));
+ return( error_code );
+ }
+
+ /* Step through the child nodes, retrieving the name and class of each one */
+ while ( error_code == PICL_SUCCESS ) {
+ error_code = picl_get_propval_by_name( childh, PICL_PROP_NAME,
+ propname, sizeof(propname)-1);
+ if ( error_code != PICL_SUCCESS ) {
+ /* The Node With No Name */
+ DEBUGMSGTL(("sensors:arch:detail", "get property name failed (%d)\n",
+ error_code));
+ return( error_code );
+ }
+
+ error_code = picl_get_propval_by_name( childh, PICL_PROP_CLASSNAME,
+ propclass, sizeof(propclass)-1);
+ if ( error_code != PICL_SUCCESS ) {
+ /* The Classless Society */
+ DEBUGMSGTL(("sensors:arch:detail", "get property class failed (%d)\n",
+ error_code));
+ return( error_code );
+ }
+
+ DEBUGMSGTL(("sensors:arch:detail", "Name: %s, Class %s\n",
+ propname, propclass ));
+
+
+ /*
+ * Three classes represent further groups of sensors, etc.
+ * Call 'process_sensors' recursively to handle this next level
+ */
+ if (( strstr( propclass, "picl" )) ||
+ ( strstr( propclass, "frutree" )) ||
+ ( strstr( propclass, "obp" ))) {
+ process_sensors( level, childh );
+ }
+ /*
+ * Otherwise retrieve the value appropriately based on the
+ * class of the sensor.
+ *
+ * We need to specify the name of the PICL property to retrieve
+ * for this class of sensor, and the Net-SNMP sensor type.
+ */
+ else if ( strstr( propclass, "fan-tachometer" )) {
+ process_num_sensor( childh, propname, "AtoDSensorValue",
+ NETSNMP_SENSOR_TYPE_RPM );
+ } else if ( strstr( propclass, "fan" )) {
+ process_num_sensor( childh, propname, "Speed",
+ NETSNMP_SENSOR_TYPE_RPM );
+ } else if ( strstr( propclass, "temperature-sensor" )) {
+ process_num_sensor( childh, propname, "Temperature",
+ NETSNMP_SENSOR_TYPE_TEMPERATURE );
+ } else if ( strstr( propclass, "voltage-sensor" )) {
+ process_num_sensor( childh, propname, "Voltage",
+ /* ?? */ NETSNMP_SENSOR_TYPE_VOLTAGE_DC );
+ } else if ( strstr( propclass, "digital-sensor" )) {
+ process_num_sensor( childh, propname, "AtoDSensorValue",
+ /* ?? */ NETSNMP_SENSOR_TYPE_VOLTAGE_DC );
+ /*
+ * Enumeration-valued sensors use a fixed PICL property ("State"),
+ * but take a list of the values appropriate for that sensor,
+ * as well as the Net-SNMP sensor type.
+ */
+ } else if ( strstr( propclass, "switch" )) {
+ process_enum_sensor( childh, propname, NETSNMP_SENSOR_TYPE_OTHER,
+ switch_settings );
+ } else if ( strstr( propclass, "led" )) {
+ process_enum_sensor( childh, propname, NETSNMP_SENSOR_TYPE_OTHER,
+ led_settings );
+ } else if ( strstr( propclass, "i2c" )) {
+ process_enum_sensor( childh, propname, NETSNMP_SENSOR_TYPE_BOOLEAN, /* ?? */
+ i2c_settings );
+ } else {
+ /* Skip other classes of sensor */
+ DEBUGMSGTL(("sensors:arch:detail", "Skipping class %s\n", propclass ));
+ }
+
+ /*
+ * Move on to the next child node at the current level (if any)
+ */
+ error_code = picl_get_propval_by_name( childh, PICL_PROP_PEER,
+ &nexth, sizeof(nexth));
+ if ( error_code != PICL_SUCCESS ) {
+ /* That's All Folks! */
+ return (( error_code == PICL_PROPNOTFOUND )
+ ? PICL_SUCCESS : error_code );
+ }
+ childh = nexth;
+ }
+
+ return error_code;
+}
+
+
+int
+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
+ int error_code;
+ picl_nodehdl_t rooth;
+
+ DEBUGMSGTL(("sensors:arch", "Reload PICLd Sensors module\n"));
+
+ error_code = picl_get_root(&rooth);
+ if ( error_code != PICL_SUCCESS) {
+ DEBUGMSGTL(("sensors:arch", "Couldn't get root node (error %d)\n", error_code));
+ return 1;
+ }
+
+ error_code = process_sensors(0, rooth);
+ if ( error_code != 255 )
+ if ( error_code != 7 ) /* ignore PICL_PROPNOTFOUND error */
+ DEBUGMSGTL(("sensors:arch", "Internal PICLd problem (error %d)\n", error_code));
+
+ return 0;
+}
+
+void netsnmp_sensor_arch_shutdown( void ) {
+ DEBUGMSGTL(("sensors:arch", "Shutdown PicLD Sensors module\n"));
+ picl_shutdown();
+}
+
diff --git a/agent/mibgroup/hardware/sensors/picld_sensors.h b/agent/mibgroup/hardware/sensors/picld_sensors.h
new file mode 100644
index 0000000..b5ffb4d
--- /dev/null
+++ b/agent/mibgroup/hardware/sensors/picld_sensors.h
@@ -0,0 +1 @@
+config_require(hardware/sensors/hw_sensors)
diff --git a/agent/mibgroup/header_complex.c b/agent/mibgroup/header_complex.c
new file mode 100644
index 0000000..d34d906
--- /dev/null
+++ b/agent/mibgroup/header_complex.c
@@ -0,0 +1,638 @@
+/*
+ * header complex: More complex storage and data sorting for mib modules
+ */
+
+#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 <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "header_complex.h"
+
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_child_of(header_complex_all, libnetsnmpmibs)
+
+netsnmp_feature_child_of(header_complex_free_all, header_complex_all)
+netsnmp_feature_child_of(header_complex_find_entry, header_complex_all)
+
+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",
+ (int)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): %ld\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_maybe_add_data(struct header_complex_index **thedata,
+ netsnmp_variable_list * var, void *data,
+ int dont_allow_duplicates)
+{
+ 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_maybe_add_data_by_oid(thedata, newoid, newoid_len, data,
+ dont_allow_duplicates);
+ /*
+ * 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(struct header_complex_index **thedata,
+ netsnmp_variable_list * var, void *data)
+{
+ return
+ header_complex_maybe_add_data(thedata, var, data, 0);
+}
+
+
+struct header_complex_index *
+_header_complex_add_between(struct header_complex_index **thedata,
+ struct header_complex_index *hciptrp,
+ struct header_complex_index *hciptrn,
+ oid * newoid, size_t newoid_len, void *data)
+{
+ struct header_complex_index *ourself;
+
+ /*
+ * 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);
+ if (ourself == NULL)
+ return NULL;
+
+ /*
+ * 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;
+}
+
+
+struct header_complex_index *
+header_complex_maybe_add_data_by_oid(struct header_complex_index **thedata,
+ oid * newoid, size_t newoid_len, void *data,
+ int dont_allow_duplicates)
+{
+ struct header_complex_index *hciptrn, *hciptrp;
+ 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");
+ if (dont_allow_duplicates)
+ return NULL;
+ }
+ }
+
+ return _header_complex_add_between(thedata, hciptrp, hciptrn,
+ newoid, newoid_len, data);
+}
+
+struct header_complex_index *
+header_complex_add_data_by_oid(struct header_complex_index **thedata,
+ oid * newoid, size_t newoid_len, void *data)
+{
+ return header_complex_maybe_add_data_by_oid(thedata, newoid, newoid_len,
+ data, 0);
+}
+
+/*
+ * 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
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_HEADER_COMPLEX_FREE_ALL
+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);
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_HEADER_COMPLEX_FREE_ALL */
+
+#ifndef NETSNMP_FEATURE_REMOVE_HEADER_COMPLEX_FIND_ENTRY
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_HEADER_COMPLEX_FIND_ENTRY */
+
+#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/agent/mibgroup/header_complex.h b/agent/mibgroup/header_complex.h
new file mode 100644
index 0000000..2a1728a
--- /dev/null
+++ b/agent/mibgroup/header_complex.h
@@ -0,0 +1,81 @@
+/*
+ * 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);
+struct header_complex_index *header_complex_maybe_add_data(struct header_complex_index **thedata,
+ netsnmp_variable_list * var,
+ void *data,
+ int dont_allow_duplicates);
+
+/*
+ * 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);
+struct header_complex_index *header_complex_maybe_add_data_by_oid(struct header_complex_index **thedata,
+ oid * newoid,
+ size_t newoid_len,
+ void *data,
+ int dont_allow_duplicates);
+
+#endif /* _MIBGROUP_HEADER_COMPLEX_H */
diff --git a/agent/mibgroup/host.h b/agent/mibgroup/host.h
new file mode 100644
index 0000000..e8e6558
--- /dev/null
+++ b/agent/mibgroup/host.h
@@ -0,0 +1,97 @@
+/*
+ * Host Resources 'wrapper' interface
+ * calls the per-group interfaces from 'hr_*.h'
+ */
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+ config_require(host/hr_system)
+ 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_version_require((host/hr_storage, 5.7, host/hrh_storage))
+ config_version_require((host/hr_filesys, 5.7, host/hrh_filesys))
+
+ config_version_require((host/hr_swinst, 5.6, host/hrSWInstalledTable))
+ config_version_require((host/hr_swrun, 5.6, host/hrSWRunTable))
+
+/* 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/agent/mibgroup/host/data_access/swinst.c b/agent/mibgroup/host/data_access/swinst.c
new file mode 100644
index 0000000..3ef05e9
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swinst.c
@@ -0,0 +1,224 @@
+/*
+ * swinst.c : hrSWInstalledTable data access
+ */
+/*
+ * Copyright (C) 2007 Apple, 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/swinst.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+netsnmp_feature_child_of(software_installed, libnetsnmpmibs)
+
+netsnmp_feature_child_of(swinst_entry_remove, netsnmp_unused)
+
+/* ---------------------------------------------------------------------
+ */
+
+static void netsnmp_swinst_entry_free_cb(netsnmp_swinst_entry *, void *);
+
+extern void netsnmp_swinst_arch_init(void);
+extern void netsnmp_swinst_arch_shutdown(void);
+extern int netsnmp_swinst_arch_load(netsnmp_container *, u_int);
+
+void init_swinst( void )
+{
+ static int initialized = 0;
+
+ DEBUGMSGTL(("swinst", "init called\n"));
+
+ if (initialized)
+ return; /* already initialized */
+
+
+ /*
+ * call arch init code
+ */
+ netsnmp_swinst_arch_init();
+}
+
+void shutdown_swinst( void )
+{
+ DEBUGMSGTL(("swinst", "shutdown called\n"));
+
+ netsnmp_swinst_arch_shutdown();
+}
+
+/* ---------------------------------------------------------------------
+ */
+
+/*
+ * load a container with installed software. If user_container is NULL,
+ * a new container will be allocated and returned, and the caller
+ * is responsible for releasing the allocated memory when done.
+ *
+ * if flags contains NETSNMP_SWINST_ALL_OR_NONE and any error occurs,
+ * the container will be completely cleared.
+ */
+netsnmp_container *
+netsnmp_swinst_container_load( netsnmp_container *user_container, int flags )
+{
+ netsnmp_container *container = user_container;
+ int arch_rc;
+
+ DEBUGMSGTL(("swinst:container", "load\n"));
+
+ /*
+ * create the container, if needed
+ */
+ if (NULL == container) {
+ container = netsnmp_container_find("swinst:table_container");
+ if (NULL == container)
+ return NULL;
+ }
+ if (NULL == container->container_name)
+ container->container_name = strdup("swinst container");
+
+ /*
+ * call the arch specific code to load the container
+ */
+ arch_rc = netsnmp_swinst_arch_load( container, flags );
+ if (arch_rc && (flags & NETSNMP_SWINST_ALL_OR_NONE)) {
+ /*
+ * caller does not want a partial load, so empty the container.
+ * if we created the container, destroy it.
+ */
+ netsnmp_swinst_container_free_items(container);
+ if (container != user_container) {
+ netsnmp_swinst_container_free(container, flags);
+ }
+ }
+
+ return container;
+}
+
+void
+netsnmp_swinst_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("swinst:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container for netsnmp_swinst_container_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_SWINST_DONT_FREE_ITEMS))
+ netsnmp_swinst_container_free_items(container);
+
+ CONTAINER_FREE(container);
+}
+
+/*
+ * free a swinst container
+ */
+void netsnmp_swinst_container_free_items(netsnmp_container *container)
+{
+ DEBUGMSGTL(("swinst:container", "free_items\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container for netsnmp_swinst_container_free_items\n");
+ return;
+ }
+
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)netsnmp_swinst_entry_free_cb,
+ NULL);
+}
+
+
+/* ---------------------------------------------------------------------
+ */
+
+/*
+ * create a new row in the table
+ */
+netsnmp_swinst_entry *
+netsnmp_swinst_entry_create(int32_t swIndex)
+{
+ netsnmp_swinst_entry *entry;
+
+ entry = SNMP_MALLOC_TYPEDEF(netsnmp_swinst_entry);
+ if (!entry)
+ return NULL;
+
+ entry->swIndex = swIndex;
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = &entry->swIndex;
+
+ entry->swType = HRSWINSTALLEDTYPE_APPLICATION;
+
+ return entry;
+}
+
+/*
+ * free a row
+ */
+void
+netsnmp_swinst_entry_free(netsnmp_swinst_entry *entry)
+{
+ DEBUGMSGTL(("swinst:entry:free", "index %" NETSNMP_PRIo "u\n",
+ entry->swIndex));
+
+ free(entry);
+}
+
+/*
+ * free a row
+ */
+static void
+netsnmp_swinst_entry_free_cb(netsnmp_swinst_entry *entry, void *context)
+{
+ free(entry);
+}
+
+/*
+ * remove a row from the table
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_SWINST_ENTRY_REMOVE
+void
+netsnmp_swinst_entry_remove(netsnmp_container * container,
+ netsnmp_swinst_entry *entry)
+{
+ DEBUGMSGTL(("swinst:container", "remove\n"));
+ if (!entry)
+ return; /* Nothing to remove */
+ CONTAINER_REMOVE(container, entry);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SWINST_ENTRY_REMOVE */
+
+/* ---------------------------------------------------------------------
+ */
+
+#ifdef TEST
+int main(int argc, char *argv[])
+{
+ const char *tokens = getenv("SNMP_DEBUG");
+
+ netsnmp_container_init_list();
+
+ /** swinst,verbose:swinst */
+ if (tokens)
+ debug_register_tokens(tokens);
+ else
+ debug_register_tokens("swinst");
+ snmp_set_do_debugging(1);
+
+ init_swinst();
+ netsnmp_swinst_container_load(NULL, 0);
+ shutdown_swinst();
+
+ return 0;
+}
+#endif
diff --git a/agent/mibgroup/host/data_access/swinst.h b/agent/mibgroup/host/data_access/swinst.h
new file mode 100644
index 0000000..bda3e47
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swinst.h
@@ -0,0 +1,38 @@
+/*
+ * swinst data access header
+ *
+ * $Id: swinst.h 15346 2006-09-26 23:34:50Z rstory $
+ */
+/*
+ * Copyright (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#ifndef NETSNMP_ACCESS_SWINST_CONFIG_H
+#define NETSNMP_ACCESS_SWINST_CONFIG_H
+
+/*
+ * all platforms use this generic code
+ */
+config_exclude(host/hr_swinst)
+
+/*
+ * select the appropriate architecture-specific interface code
+ */
+#if defined( darwin )
+ config_require(host/data_access/swinst_darwin)
+#elif defined( HAVE_DPKG_QUERY )
+ config_require(host/data_access/swinst_apt)
+#elif defined( HAVE_LIBRPM ) && defined( linux )
+ config_require(host/data_access/swinst_rpm)
+#elif defined( HAVE_PKGLOCS_H ) || defined( hpux9 ) || defined( hpux10 ) || defined( hpux11 ) || defined( freebsd2 ) || defined( linux ) || defined( openbsd )
+ config_require(host/data_access/swinst_pkginfo)
+#else
+ config_warning(This platform does not yet support hrSWInstalledTable rewrites)
+ config_require(host/data_access/swinst_null)
+#endif
+
+void init_swinst( void );
+void shutdown_swinst( void );
+
+#endif /* NETSNMP_ACCESS_SWINST_CONFIG_H */
diff --git a/agent/mibgroup/host/data_access/swinst_apt.c b/agent/mibgroup/host/data_access/swinst_apt.c
new file mode 100644
index 0000000..26cdba5
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swinst_apt.c
@@ -0,0 +1,102 @@
+/*
+ * swinst_rpm.c:
+ * hrSWInstalledTable data access:
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swinst.h>
+
+char pkg_directory[SNMP_MAXBUF];
+static char apt_fmt[SNMP_MAXBUF];
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_swinst_arch_init(void)
+{
+ strlcpy(pkg_directory, "/var/lib/dpkg/info", sizeof(pkg_directory));
+ snprintf(apt_fmt, SNMP_MAXBUF, "%%%d[^#]#%%%d[^#]#%%%d[^#]#%%%d[^#]#%%%d[^#]#%%%ds",
+ SNMP_MAXBUF, SNMP_MAXBUF, SNMP_MAXBUF,
+ SNMP_MAXBUF, SNMP_MAXBUF, SNMP_MAXBUF);
+}
+
+void
+netsnmp_swinst_arch_shutdown(void)
+{
+ /* Nothing to do */
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags)
+{
+ FILE *p = popen("dpkg-query --show --showformat '${Package}#${Version}#${Section}#${Priority}#${Essential}#${Status}\n'", "r");
+ char package[SNMP_MAXBUF];
+ char version[SNMP_MAXBUF];
+ char section[SNMP_MAXBUF];
+ char priority[SNMP_MAXBUF];
+ char essential[SNMP_MAXBUF];
+ char status[SNMP_MAXBUF];
+ char buf[BUFSIZ];
+ netsnmp_swinst_entry *entry;
+ int i = 0;
+ int rc;
+
+ if (p == NULL) {
+ snmp_perror("dpkg-list");
+ return 1;
+ }
+
+ while (fgets(buf, BUFSIZ, p)) {
+ DEBUGMSG(("swinst_apt", "entry: %s\n", buf));
+ entry = netsnmp_swinst_entry_create( i++ );
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ rc = CONTAINER_INSERT(container, entry);
+
+ sscanf(buf, apt_fmt, package, version, section, priority, essential, status);
+ if (strstr(status, "not-installed"))
+ continue;
+
+ entry->swName_len = snprintf( entry->swName, sizeof(entry->swName),
+ "%s-%s", package, version);
+ if (entry->swName_len >= sizeof(entry->swName))
+ entry->swName_len = sizeof(entry->swName)-1;
+ entry->swType = (strcmp(essential, "yes") == 0)
+ ? 2 /* operatingSystem */
+ : 4; /* application */
+
+ entry->swDate_len = 8;
+ memcpy(entry->swDate, "\0\0\1\1\0\0\0\0", 8);
+ }
+ pclose(p);
+ DEBUGMSGTL(("swinst:load:arch"," loaded %d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swinst_darwin.c b/agent/mibgroup/host/data_access/swinst_darwin.c
new file mode 100644
index 0000000..e7a0294
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swinst_darwin.c
@@ -0,0 +1,396 @@
+/*
+ * swinst.c : hrSWInstalledTable data access
+ */
+/*
+ * Copyright (C) 2007 Apple, 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-features.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/dir_utils.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/data_access/swinst.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/stat.h>
+
+#define __APPLE_API_EVOLVING 1
+#include <sys/acl.h> /* or else CoreFoundation.h barfs */
+#undef __APPLE_API_EVOLVING
+
+#include <CoreFoundation/CoreFoundation.h>
+#include <ApplicationServices/ApplicationServices.h>
+
+netsnmp_feature_require(container_directory)
+netsnmp_feature_require(date_n_time)
+
+/* ---------------------------------------------------------------------
+ */
+static int _add_applications_in_dir(netsnmp_container *, const char* path);
+static int32_t _index;
+static int _check_bundled_app(CFURLRef currentURL, CFStringRef *name,
+ CFStringRef *info, const char* path);
+static int _check_classic_app(CFURLRef currentURL, CFStringRef *name,
+ CFStringRef *info, const char* path);
+static netsnmp_container *dirs = NULL;
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_swinst_arch_init( void )
+{
+ struct stat stat_buf;
+ const char *default_dirs[] = {
+ "/Applications",
+ "/Applications (Mac OS 9)",
+ "/System/Library/CoreServices",
+ "/System/Library/Extensions",
+ "/System/Library/Services"
+#ifdef TEST
+ , "/Developer/Applications"
+ , "/Volumes/audX/Applications (Mac OS 9)"
+#endif
+ };
+ int i, count = sizeof(default_dirs)/sizeof(default_dirs[0]);
+
+ /*
+ * create the container, if needed
+ */
+ if (NULL == dirs) {
+ dirs = netsnmp_container_find("directory_container:cstring");
+ if (NULL == dirs) {
+ snmp_log(LOG_ERR, "couldn't allocate container for dir list\n");
+ return;
+ }
+ dirs->container_name = strdup("directory search list");
+ netsnmp_binary_array_options_set(dirs, 1, CONTAINER_KEY_UNSORTED);
+ }
+
+ /*
+ * add dirs
+ */
+ for(i = 0; i < count; ++i) {
+ char * tmp;
+ /** xxx: get/save the last mod date? */
+ if(-1 == stat(default_dirs[i], &stat_buf)) {
+ DEBUGMSGTL(("swinst:arch:darwin", "skipping dir %s\n",
+ default_dirs[i]));
+ continue;
+ }
+ DEBUGMSGTL(("swinst:arch:darwin", "adding dir %s\n",
+ default_dirs[i]));
+ tmp = strdup(default_dirs[i]);
+ if (NULL == tmp) {
+ snmp_log(LOG_ERR,"strdup failed\n");
+ break;
+ }
+ CONTAINER_INSERT(dirs, tmp);
+ }
+}
+
+void
+netsnmp_swinst_arch_shutdown( void )
+{
+ netsnmp_directory_container_free(dirs);
+}
+
+/* ---------------------------------------------------------------------
+ */
+
+int
+netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags )
+{
+ netsnmp_iterator *it;
+ const char *dir;
+ int rc;
+
+ DEBUGMSGTL(("swinst:arch:darwin", "load\n"));
+
+ if (NULL == dirs) {
+ DEBUGMSGTL(("swinst:arch:darwin", "no dirs to scan!\n"));
+ return -1;
+ }
+
+ _index = 0;
+
+ it = CONTAINER_ITERATOR(dirs);
+ for (dir = ITERATOR_FIRST(it); dir; dir = ITERATOR_NEXT(it)) {
+ rc = _add_applications_in_dir(container, dir);
+ }
+ ITERATOR_RELEASE(it);
+ DEBUGMSGTL(("swinst:arch:darwin", "loaded %d apps\n",_index));
+
+ return 0;
+}
+
+void _dump_flags(u_long flags)
+{
+ static struct {
+ const char*name;
+ u_long bits;
+ } names[] = {
+ { "kLSItemInfoIsPlainFile", 0x00000001 },
+ { "kLSItemInfoIsPackage", 0x00000002 },
+ { "kLSItemInfoIsApplication", 0x00000004 },
+ { "kLSItemInfoIsContainer", 0x00000008 },
+ { "kLSItemInfoIsAliasFile", 0x00000010 },
+ { "kLSItemInfoIsSymlink", 0x00000020 },
+ { "kLSItemInfoIsInvisible", 0x00000040 },
+ { "kLSItemInfoIsNativeApp", 0x00000080 },
+ { "kLSItemInfoIsClassicApp", 0x00000100 },
+ { "kLSItemInfoAppPrefersNative", 0x00000200 },
+ { "kLSItemInfoAppPrefersClassic", 0x00000400 },
+ { "kLSItemInfoAppIsScriptable", 0x00000800 },
+ { "kLSItemInfoIsVolume", 0x00001000 },
+ { "kLSItemInfoExtensionIsHidden", 0x00100000 }
+ };
+ int i, count = sizeof(names)/sizeof(names[0]);
+
+ for(i = 0; i < count; ++i) {
+ if (flags & names[i].bits) {
+ DEBUGMSGTL(("swinst:arch:darwin:flags", "\t%s\n",
+ names[i].name));
+ }
+ }
+}
+
+static int
+_add_applications_in_dir(netsnmp_container *container, const char* path)
+{
+ netsnmp_container *files;
+ netsnmp_iterator *it;
+ const char *file;
+ netsnmp_swinst_entry *entry = NULL;
+ struct stat stat_buf;
+ size_t date_len;
+ u_char *date_buf;
+ int rc = 0;
+
+ CFStringRef currentPath = NULL;
+ CFURLRef currentURL = NULL;
+ LSItemInfoRecord itemInfoRecord;
+ CFStringRef prodName = NULL;
+ CFStringRef version = NULL;
+
+ DEBUGMSGTL(("swinst:arch:darwin", " adding files from %s\n", path));
+ files = netsnmp_directory_container_read(NULL, path, 0);
+ if (NULL == files) {
+ snmp_log(LOG_ERR, "swinst: could not read directory %s\n", path);
+ return -1;
+ }
+
+ it = CONTAINER_ITERATOR(files);
+ if (NULL == it) {
+ snmp_log(LOG_ERR, "could not get iterator\n");
+ netsnmp_directory_container_free(files);
+ return -1;
+ }
+ for (file = ITERATOR_FIRST(it);
+ file;
+ file = ITERATOR_NEXT(it),
+ CFRelease(currentPath),
+ CFRelease(currentURL)) {
+
+ int rc2 = 0;
+
+ currentPath =
+ CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, file,
+ kCFStringEncodingUTF8,
+ kCFAllocatorNull);
+ currentURL =
+ CFURLCreateWithFileSystemPath(kCFAllocatorDefault, currentPath,
+ kCFURLPOSIXPathStyle, true);
+ LSCopyItemInfoForURL(currentURL,
+ kLSRequestBasicFlagsOnly|kLSRequestAppTypeFlags,
+ &itemInfoRecord);
+ if((0 == itemInfoRecord.flags) ||
+ (kLSItemInfoIsPlainFile == itemInfoRecord.flags) ||
+ (itemInfoRecord.flags & kLSItemInfoIsInvisible) ||
+ (itemInfoRecord.flags & kLSItemInfoIsAliasFile)) {
+ continue;
+ }
+ /** recurse on non-application containers (i.e. directory) */
+ if ((itemInfoRecord.flags & kLSItemInfoIsContainer) &&
+ (!(itemInfoRecord.flags & kLSItemInfoIsApplication))) {
+ netsnmp_directory_container_read(files, file, 0);
+ continue;
+ }
+
+ /** skip any other non-application files */
+ if (!(itemInfoRecord.flags & kLSItemInfoIsApplication)) {
+ continue;
+ }
+
+ if ((itemInfoRecord.flags & kLSItemInfoIsPackage) ||
+ (itemInfoRecord.flags & kLSItemInfoIsContainer)) {
+ rc2 = _check_bundled_app(currentURL, &prodName, &version, file);
+ }
+ else if ((itemInfoRecord.flags & kLSItemInfoIsClassicApp) ||
+ (itemInfoRecord.flags & kLSItemInfoIsPlainFile)) {
+ rc2 = _check_classic_app(currentURL, &prodName, &version, file);
+ } else {
+ snmp_log(LOG_ERR,"swinst shouldn't get here: %s\n", file);
+ _dump_flags(itemInfoRecord.flags);
+ continue;
+ }
+ if (rc2) { /* not an app. if directory, recurse; else continue */
+ _dump_flags(itemInfoRecord.flags);
+ if (1 == rc2)
+ netsnmp_directory_container_read(files, file, 0);
+ continue;
+ }
+
+ /*
+ * allocate entry
+ */
+ entry = netsnmp_swinst_entry_create(++_index);
+ if (NULL == entry) {
+ snmp_log(LOG_ERR, "error creating swinst entry\n");
+ rc = -1;
+ SNMP_CFRelease(prodName);
+ SNMP_CFRelease(version);
+ break;
+ }
+
+ entry->swName_len =
+ snprintf(entry->swName, sizeof(entry->swName),
+ "%s %s", CFStringGetCStringPtr(prodName,0),
+ CFStringGetCStringPtr(version,0));
+ if (entry->swName_len >= sizeof(entry->swName))
+ entry->swName_len = sizeof(entry->swName)-1;
+
+ DEBUGMSGTL(("swinst:arch:darwin", "\t%s %s\n", file, entry->swName));
+
+ /** get the last mod date */
+ if(stat(file, &stat_buf) != -1) {
+ date_buf = date_n_time(&stat_buf.st_mtime, &date_len);
+ entry->swDate_len = date_len;
+ memcpy(entry->swDate, date_buf, entry->swDate_len);
+ }
+
+ CONTAINER_INSERT(container, entry);
+ entry = NULL;
+ SNMP_CFRelease(prodName);
+ SNMP_CFRelease(version);
+ }
+ ITERATOR_RELEASE(it);
+ netsnmp_directory_container_free(files);
+
+ return rc;
+}
+
+int
+_check_bundled_app(CFURLRef currentURL, CFStringRef *prodName,
+ CFStringRef *version, const char* file)
+{
+ CFBundleRef theBundle = NULL;
+ CFDictionaryRef infoDict = NULL;
+
+ if ((NULL == prodName) || (NULL == version))
+ return -1;
+
+ theBundle = CFBundleCreate (kCFAllocatorDefault, currentURL);
+ if(theBundle == NULL)
+ return -1; /* not a bundle */
+
+ infoDict = CFBundleGetInfoDictionary(theBundle);
+ if(0 == CFDictionaryGetCount(infoDict)) {
+ SNMP_CFRelease(theBundle);
+ return 1; /* directory */
+ }
+
+ *prodName = (CFStringRef)
+ CFDictionaryGetValue (infoDict, CFSTR("CFBundleName"));
+ if (NULL == *prodName) {
+ *prodName = (CFStringRef)
+ CFDictionaryGetValue (infoDict, CFSTR("CFBundleDisplayName"));
+ if (NULL == *prodName) {
+ *prodName = (CFStringRef) CFDictionaryGetValue (infoDict,
+ CFSTR("CFBundleExecutable"));
+ }
+ }
+ if(NULL == *prodName) {
+ DEBUGMSGTL(("swinst:arch:darwin", "\tmissing name: %s\n",file));
+ /*CFShow(infoDict);*/
+ SNMP_CFRelease(theBundle);
+ return -1;
+ }
+
+ *version = (CFStringRef)
+ CFDictionaryGetValue (infoDict, CFSTR("CFBundleShortVersionString"));
+ if(NULL == *version) {
+ *version = (CFStringRef)
+ CFDictionaryGetValue (infoDict, CFSTR("CFBundleVersion"));
+ if (*version == NULL)
+ *version = (CFStringRef) CFDictionaryGetValue (infoDict,
+ CFSTR("CFBundleGetInfoString"));
+ }
+ if(NULL == *version) {
+ DEBUGMSGTL(("swinst:arch:darwin", "\tmissing version: %s\n",file));
+ /*CFShow(infoDict);*/
+ SNMP_CFRelease(theBundle);
+ return -1;
+ }
+
+ if(theBundle != NULL) {
+ CFRetain(*prodName);
+ CFRetain(*version);
+ SNMP_CFRelease(theBundle);
+ }
+ return 0;
+}
+
+static int
+_check_classic_app(CFURLRef currentURL, CFStringRef *prodName,
+ CFStringRef *version, const char* file)
+{
+ /*
+ * get info for classic or single-file apps
+ */
+ FSRef theFSRef;
+ int theResFile;
+
+ if ((NULL == prodName) || (NULL == version))
+ return -1;
+
+ *prodName = CFURLCopyLastPathComponent(currentURL);
+ if (! CFURLGetFSRef(currentURL, &theFSRef)) {
+ DEBUGMSGTL(("swinst:arch:darwin", "GetFSRef failed: %s\n", file));
+ SNMP_CFRelease(*prodName);
+ return -1;
+ }
+ theResFile = FSOpenResFile(&theFSRef, fsRdPerm);
+ if (ResError() != noErr) {
+ DEBUGMSGTL(("swinst:arch:darwin", "FSOpenResFile failed: %s\n", file));
+ SNMP_CFRelease(*prodName);
+ return -1;
+ }
+ VersRecHndl versHandle = (VersRecHndl)Get1IndResource('vers', 1);
+ if (versHandle != NULL) {
+ *version = CFStringCreateWithPascalString(kCFAllocatorDefault,
+ (**versHandle).shortVersion, kCFStringEncodingMacRoman);
+ if (*version == NULL) {
+ StringPtr longVersionPtr = (**versHandle).shortVersion;
+ longVersionPtr = (StringPtr)(((Ptr) longVersionPtr) +
+ 1 + ((unsigned char) *longVersionPtr));
+ *version = CFStringCreateWithPascalString(kCFAllocatorDefault,
+ longVersionPtr, kCFStringEncodingMacRoman);
+ }
+ ReleaseResource((Handle)versHandle);
+ }
+ CloseResFile(theResFile);
+ if(*version == NULL) {
+ DEBUGMSGTL(("swinst:arch:darwin",
+ "\tmissing classic/file version: %s\n", file));
+ SNMP_CFRelease(*prodName);
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swinst_null.c b/agent/mibgroup/host/data_access/swinst_null.c
new file mode 100644
index 0000000..e4f9158
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swinst_null.c
@@ -0,0 +1,51 @@
+/*
+ * swinst_null.c:
+ * hrSWInstalledTable data access:
+ * dummy interface for non-supported systems
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swinst.h>
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_swinst_arch_init(void)
+{
+ /* Nothing to do */
+ return;
+}
+
+void
+netsnmp_swinst_arch_shutdown(void)
+{
+ /* Nothing to do */
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags)
+{
+ /* Nothing to do */
+ DEBUGMSGTL(("swinst:load:arch"," loaded %" NETSNMP_PRIz "d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swinst_pkginfo.c b/agent/mibgroup/host/data_access/swinst_pkginfo.c
new file mode 100644
index 0000000..965a7ef
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swinst_pkginfo.c
@@ -0,0 +1,151 @@
+/*
+ * swinst_pkginfo.c:
+ * hrSWInstalledTable data access:
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <stdio.h>
+#include <sys/stat.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+
+#ifdef HAVE_PKGLOCS_H
+#include <pkglocs.h>
+#endif
+#ifdef HAVE_PKGINFO_H
+#include <pkginfo.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swinst.h>
+
+netsnmp_feature_require(date_n_time)
+
+ /*
+ * Location of package directory.
+ * Used for:
+ * - reporting hrSWInstalledLast* objects
+ * - detecting when the cached contents are out of date.
+ */
+char pkg_directory[SNMP_MAXPATH];
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_swinst_arch_init(void)
+{
+#if defined(PKGLOC)
+ snprintf( pkg_directory, SNMP_MAXPATH, "%s", PKGLOC );
+#elif defined(hpux9)
+ snprintf( pkg_directory, SNMP_MAXPATH, "/system" );
+#elif defined(hpux10) || defined(hpux11)
+ snprintf( pkg_directory, SNMP_MAXPATH, "/var/adm/sw/products" );
+#elif defined(freebsd2) || defined(openbsd)
+ snprintf( pkg_directory, SNMP_MAXPATH, "/var/db/pkg" );
+#elif defined(linux)
+ snprintf( pkg_directory, SNMP_MAXPATH, "/var/cache/hrmib" );
+#else
+ pkg_directory[0] = '\0';
+ snmp_log( LOG_ERR, "SWInst: No package directory\n" );
+#endif
+
+ DEBUGMSGTL(("swinst:init:arch"," package directory = %s\n",
+ pkg_directory));
+ return;
+}
+
+void
+netsnmp_swinst_arch_shutdown(void)
+{
+ pkg_directory[0] = '\0';
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags)
+{
+ DIR *d;
+ struct dirent *dp;
+ struct stat stat_buf;
+#ifdef HAVE_PKGINFO
+ char *v, *c;
+#endif
+ char buf[ BUFSIZ ];
+ unsigned char *cp;
+ time_t install_time;
+ size_t date_len;
+ int i = 1;
+ netsnmp_swinst_entry *entry;
+
+ if ( !pkg_directory[0] ) {
+ return 1; /* Can't report installed packages
+ if there isn't a list of them! */
+ }
+ d = opendir( pkg_directory );
+ if (!d)
+ return 1;
+ while ((dp = readdir(d)) != NULL) {
+ if ( '.' == dp->d_name[0] )
+ continue;
+ entry = netsnmp_swinst_entry_create( i++ );
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ CONTAINER_INSERT(container, entry);
+
+#ifdef HAVE_PKGINFO
+ v = pkgparam( dp->d_name, "VERSION" );
+ c = pkgparam( dp->d_name, "CATEGORY" );
+
+ entry->swName_len = snprintf( entry->swName, sizeof(entry->swName),
+ "%s-%s", dp->d_name, v );
+ if (entry->swName_len >= sizeof(entry->swName))
+ entry->swName_len = sizeof(entry->swName)-1;
+ entry->swType = (NULL != strstr( c, "system"))
+ ? 2 /* operatingSystem */
+ : 4; /* application */
+
+ /* Do we need to free 'v' & 'c' ??? */
+#else
+ entry->swName_len = snprintf( entry->swName, sizeof(entry->swName),
+ "%s", dp->d_name );
+ if (entry->swName_len >= sizeof(entry->swName))
+ entry->swName_len = sizeof(entry->swName)-1;
+
+ /* no information about O/S vs application packages ??? */
+#endif
+
+ snprintf( buf, BUFSIZ, "%s/%s", pkg_directory, dp->d_name );
+ stat( buf, &stat_buf );
+ install_time = stat_buf.st_mtime;
+ cp = date_n_time( &install_time, &date_len );
+ memcpy( entry->swDate, cp, date_len );
+ entry->swDate_len = date_len;
+ }
+ closedir( d );
+
+ DEBUGMSGTL(("swinst:load:arch"," loaded %d entries\n",
+ (int)CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c
new file mode 100644
index 0000000..71595be
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swinst_rpm.c
@@ -0,0 +1,156 @@
+/*
+ * swinst_rpm.c:
+ * hrSWInstalledTable data access:
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_RPM_RPMLIB_H
+#include <rpm/rpmlib.h>
+#endif
+#ifdef HAVE_RPM_RPMLIB_H
+#include <rpm/header.h>
+#endif
+#ifdef HAVE_RPMGETPATH /* HAVE_RPM_RPMMACRO_H */
+#include <rpm/rpmmacro.h>
+#endif
+#ifdef HAVE_RPM_RPMTS_H
+#include <rpm/rpmts.h>
+#include <rpm/rpmdb.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swinst.h>
+
+netsnmp_feature_require(date_n_time)
+
+ /*
+ * Location of RPM package directory.
+ * Used for:
+ * - reporting hrSWInstalledLast* objects
+ * - detecting when the cached contents are out of date.
+ */
+char pkg_directory[SNMP_MAXPATH];
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_swinst_arch_init(void)
+{
+ char *rpmdbpath = NULL;
+ const char *dbpath;
+ struct stat stat_buf;
+
+#ifdef HAVE_RPMGETPATH
+ rpmReadConfigFiles( NULL, NULL );
+ rpmdbpath = rpmGetPath( "%{_dbpath}", NULL );
+ dbpath = rpmdbpath;
+#else
+ dbpath = "/var/lib/rpm"; /* Most likely */
+#endif
+
+ snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath );
+ SNMP_FREE(rpmdbpath);
+ dbpath = NULL;
+ if (-1 == stat( pkg_directory, &stat_buf )) {
+ snmp_log(LOG_ERR, "Can't find directory of RPM packages");
+ pkg_directory[0] = '\0';
+ }
+}
+
+void
+netsnmp_swinst_arch_shutdown(void)
+{
+ /* Nothing to do */
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags)
+{
+ rpmts ts;
+
+ rpmdbMatchIterator mi;
+ Header h;
+ char *n, *v, *r, *g;
+ int32_t *t;
+ time_t install_time;
+ size_t date_len;
+ int i = 1;
+ netsnmp_swinst_entry *entry;
+
+ ts = rpmtsCreate();
+ rpmtsSetVSFlags( ts, (_RPMVSF_NOSIGNATURES|_RPMVSF_NODIGESTS));
+
+ mi = rpmtsInitIterator( ts, RPMDBI_PACKAGES, NULL, 0);
+ if (mi == NULL)
+ NETSNMP_LOGONCE((LOG_ERR, "rpmdbOpen() failed\n"));
+
+ while (NULL != (h = rpmdbNextIterator( mi )))
+ {
+ const u_char *dt;
+ entry = netsnmp_swinst_entry_create( i++ );
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ CONTAINER_INSERT(container, entry);
+
+ h = headerLink( h );
+ headerGetEntry( h, RPMTAG_NAME, NULL, (void**)&n, NULL);
+ headerGetEntry( h, RPMTAG_VERSION, NULL, (void**)&v, NULL);
+ headerGetEntry( h, RPMTAG_RELEASE, NULL, (void**)&r, NULL);
+ headerGetEntry( h, RPMTAG_GROUP, NULL, (void**)&g, NULL);
+ headerGetEntry( h, RPMTAG_INSTALLTIME, NULL, (void**)&t, NULL);
+
+ entry->swName_len = snprintf( entry->swName, sizeof(entry->swName),
+ "%s-%s-%s", n, v, r);
+ if (entry->swName_len > sizeof(entry->swName))
+ entry->swName_len = sizeof(entry->swName);
+ entry->swType = (NULL != strstr( g, "System Environment"))
+ ? 2 /* operatingSystem */
+ : 4; /* application */
+
+ install_time = *t;
+ dt = date_n_time( &install_time, &date_len );
+ if (date_len != 8 && date_len != 11) {
+ snmp_log(LOG_ERR, "Bogus length from date_n_time for %s", entry->swName);
+ entry->swDate_len = 0;
+ }
+ else {
+ entry->swDate_len = date_len;
+ memcpy(entry->swDate, dt, entry->swDate_len);
+ }
+
+ headerFree( h );
+ }
+ rpmdbFreeIterator( mi );
+ rpmtsFree( ts );
+
+ DEBUGMSGTL(("swinst:load:arch", "loaded %d entries\n",
+ (int)CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun.c b/agent/mibgroup/host/data_access/swrun.c
new file mode 100644
index 0000000..d18ea5f
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun.c
@@ -0,0 +1,353 @@
+/*
+ * Swrun MIB architecture support
+ *
+ * $Id: swrun.c 15768 2007-01-22 16:18:29Z rstory $
+ */
+/*
+ * Copyright (C) 2007 Apple, 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/swrun.h>
+
+netsnmp_feature_child_of(software_running, libnetsnmpmibs)
+
+netsnmp_feature_child_of(swrun_max_processes, software_running)
+netsnmp_feature_child_of(swrun_count_processes_by_name, software_running)
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static vars
+ */
+static int _swrun_init = 0;
+ int _swrun_max = 0;
+static netsnmp_cache *swrun_cache = NULL;
+static netsnmp_container *swrun_container = NULL;
+
+netsnmp_container * netsnmp_swrun_container(void);
+netsnmp_cache * netsnmp_swrun_cache (void);
+
+/*
+ * local static prototypes
+ */
+static void _swrun_entry_release(netsnmp_swrun_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 void netsnmp_arch_swrun_init(void);
+extern int netsnmp_arch_swrun_container_load(netsnmp_container* container,
+ u_int load_flags);
+
+/**
+ * initialization
+ */
+void
+init_swrun(void)
+{
+ DEBUGMSGTL(("swrun:access", "init\n"));
+
+ if (1 == _swrun_init)
+ return;
+
+ _swrun_init = 1;
+
+ (void)netsnmp_swrun_container();
+ netsnmp_arch_swrun_init();
+ (void) netsnmp_swrun_cache();
+}
+
+void
+shutdown_swrun(void)
+{
+ DEBUGMSGTL(("swrun:access", "shutdown\n"));
+
+}
+
+int
+swrun_count_processes( void )
+{
+ netsnmp_cache_check_and_reload(swrun_cache);
+ return ( swrun_container ? CONTAINER_SIZE(swrun_container) : 0 );
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SWRUN_MAX_PROCESSES
+int
+swrun_max_processes( void )
+{
+ return _swrun_max;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SWRUN_MAX_PROCESSES */
+
+#ifndef NETSNMP_FEATURE_REMOVE_SWRUN_COUNT_PROCESSES_BY_NAME
+int
+swrun_count_processes_by_name( char *name )
+{
+ netsnmp_swrun_entry *entry;
+ netsnmp_iterator *it;
+ int i = 0;
+
+ netsnmp_cache_check_and_reload(swrun_cache);
+ if ( !swrun_container || !name )
+ return 0; /* or -1 */
+
+ it = CONTAINER_ITERATOR( swrun_container );
+ while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) {
+ if (0 == strcmp( entry->hrSWRunName, name ))
+ i++;
+ }
+ ITERATOR_RELEASE( it );
+
+ return i;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SWRUN_COUNT_PROCESSES_BY_NAME */
+
+/**---------------------------------------------------------------------*/
+/*
+ * cache functions
+ */
+
+static int
+_cache_load( netsnmp_cache *cache, void *magic )
+{
+ netsnmp_swrun_container_load( swrun_container, 0 );
+ return 0;
+}
+
+static void
+_cache_free( netsnmp_cache *cache, void *magic )
+{
+ netsnmp_swrun_container_free_items( swrun_container );
+ return;
+}
+
+/**
+ * create swrun cache
+ */
+netsnmp_cache *
+netsnmp_swrun_cache(void)
+{
+ oid hrSWRunTable_oid[] = { 1, 3, 6, 1, 2, 1, 25, 4, 2 };
+ size_t hrSWRunTable_oid_len = OID_LENGTH(hrSWRunTable_oid);
+
+ if ( !swrun_cache ) {
+ swrun_cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ hrSWRunTable_oid, hrSWRunTable_oid_len);
+ if (swrun_cache)
+ swrun_cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+ }
+ return swrun_cache;
+}
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ * create swrun container
+ */
+netsnmp_container *
+netsnmp_swrun_container(void)
+{
+ DEBUGMSGTL(("swrun:container", "init\n"));
+
+ /*
+ * create the container.
+ */
+ if (!swrun_container) {
+ swrun_container = netsnmp_container_find("swrun:table_container");
+ if (NULL == swrun_container)
+ return NULL;
+
+ swrun_container->container_name = strdup("swrun container");
+ }
+
+ return swrun_container;
+}
+
+/**
+ * load swrun information in specified container
+ *
+ * @param container empty container to be filled.
+ * pass NULL to have the function create one.
+ * @param load_flags flags to modify behaviour. Examples:
+ * NETSNMP_SWRUN_ALL_OR_NONE
+ *
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_swrun_container_load(netsnmp_container* user_container, u_int load_flags)
+{
+ netsnmp_container* container = user_container;
+ int rc;
+
+ DEBUGMSGTL(("swrun:container:load", "load\n"));
+ netsnmp_assert(1 == _swrun_init);
+
+ if (NULL == container)
+ container = netsnmp_swrun_container();
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for swrun\n");
+ return NULL;
+ }
+
+ rc = netsnmp_arch_swrun_container_load(container, load_flags);
+ if (0 != rc) {
+ if (NULL == user_container) {
+ netsnmp_swrun_container_free(container, NETSNMP_SWRUN_NOFLAGS);
+ container = NULL;
+ }
+ else if (load_flags & NETSNMP_SWRUN_ALL_OR_NONE) {
+ DEBUGMSGTL(("swrun:container:load",
+ " discarding partial results\n"));
+ netsnmp_swrun_container_free_items(container);
+ }
+ }
+
+ return container;
+}
+
+void
+netsnmp_swrun_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("swrun:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_swrun_container_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_SWRUN_DONT_FREE_ITEMS))
+ netsnmp_swrun_container_free_items(container);
+
+ CONTAINER_FREE(container);
+}
+
+void
+netsnmp_swrun_container_free_items(netsnmp_container *container)
+{
+ DEBUGMSGTL(("swrun:container", "free_items\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_swrun_container_free_items\n");
+ return;
+ }
+
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_swrun_entry_release,
+ NULL);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * swrun_entry functions
+ */
+/**
+ */
+netsnmp_swrun_entry *
+netsnmp_swrun_entry_get_by_index(netsnmp_container *container, oid index)
+{
+ netsnmp_index tmp;
+
+ DEBUGMSGTL(("swrun:entry", "by_index\n"));
+ netsnmp_assert(1 == _swrun_init);
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container for netsnmp_swrun_entry_get_by_index\n");
+ return NULL;
+ }
+
+ tmp.len = 1;
+ tmp.oids = &index;
+
+ return (netsnmp_swrun_entry *) CONTAINER_FIND(container, &tmp);
+}
+
+/**
+ */
+netsnmp_swrun_entry *
+netsnmp_swrun_entry_create(int32_t index)
+{
+ netsnmp_swrun_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_swrun_entry);
+
+ if(NULL == entry)
+ return NULL;
+
+ entry->hrSWRunIndex = index;
+ entry->hrSWRunType = 1; /* unknown */
+ entry->hrSWRunStatus = 2; /* runnable */
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = (oid *) & entry->hrSWRunIndex;
+
+ return entry;
+}
+
+/**
+ */
+NETSNMP_INLINE void
+netsnmp_swrun_entry_free(netsnmp_swrun_entry * entry)
+{
+ 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
+ */
+
+/**
+ */
+static void
+_swrun_entry_release(netsnmp_swrun_entry * entry, void *context)
+{
+ netsnmp_swrun_entry_free(entry);
+}
+
+
+#ifdef TEST
+int main(int argc, char *argv[])
+{
+ const char *tokens = getenv("SNMP_DEBUG");
+
+ netsnmp_container_init_list();
+
+ /** swrun,verbose:swrun,9:swrun,8:swrun,5:swrun */
+ if (tokens)
+ debug_register_tokens(tokens);
+ else
+ debug_register_tokens("swrun");
+ snmp_set_do_debugging(1);
+
+ init_swrun();
+ netsnmp_swrun_container_load(NULL, 0);
+ shutdown_swrun();
+
+ return 0;
+}
+#endif
diff --git a/agent/mibgroup/host/data_access/swrun.h b/agent/mibgroup/host/data_access/swrun.h
new file mode 100644
index 0000000..2ae53f5
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun.h
@@ -0,0 +1,54 @@
+/*
+ * swrun data access header
+ *
+ * $Id: swrun.h 15346 2006-09-26 23:34:50Z rstory $
+ */
+/*
+ * Copyright (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#ifndef NETSNMP_ACCESS_SWRUN_CONFIG_H
+#define NETSNMP_ACCESS_SWRUN_CONFIG_H
+
+/*
+ * all platforms use this generic code
+ */
+config_require(host/data_access/swrun)
+config_exclude(host/hr_swrun)
+
+/*
+ * select the appropriate architecture-specific interface code
+ */
+#if defined( darwin )
+ config_require(host/data_access/swrun_darwin)
+#elif defined( HAVE_SYS_PSTAT_H )
+ config_require(host/data_access/swrun_pstat)
+#elif defined( dynix )
+ config_require(host/data_access/swrun_prpsinfo)
+#elif defined( solaris2 )
+# if _SLASH_PROC_METHOD_
+ config_require(host/data_access/swrun_procfs_psinfo)
+# else
+ config_require(host/data_access/swrun_kvm_proc)
+# endif
+#elif defined( aix4 ) || defined( aix5 ) || defined( aix6 ) || defined( aix7 )
+ config_require(host/data_access/swrun_procinfo)
+#elif HAVE_KVM_GETPROCS
+ config_require(host/data_access/swrun_kinfo)
+#elif defined( linux )
+ config_require(host/data_access/swrun_procfs_status)
+#elif defined( cygwin )
+ config_require(host/data_access/swrun_cygwin)
+#else
+ config_warning(This platform does not yet support hrSWRunTable rewrites)
+ config_require(host/data_access/swrun_null)
+#endif
+
+void init_swrun(void);
+void shutdown_swrun(void);
+
+netsnmp_cache *netsnmp_swrun_cache(void);
+netsnmp_container *netsnmp_swrun_container(void);
+
+#endif /* NETSNMP_ACCESS_SWRUN_CONFIG_H */
diff --git a/agent/mibgroup/host/data_access/swrun_cygwin.c b/agent/mibgroup/host/data_access/swrun_cygwin.c
new file mode 100644
index 0000000..ca5194d
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_cygwin.c
@@ -0,0 +1,279 @@
+/*
+ * swrun_cygwin.c:
+ * hrSWRunTable data access:
+ * Cygwin interface
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#include <windows.h>
+#include <sys/cygwin.h>
+#include <tlhelp32.h>
+#include <psapi.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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+#include <net-snmp/data_access/swrun.h>
+
+/*
+ * 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;
+}
+
+OSVERSIONINFO ver;
+HMODULE h;
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+ 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");
+ }
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ struct external_pinfo *curproc;
+ pid_t curpid = 0;
+ DWORD n;
+ HANDLE h;
+ FILETIME ct, et, kt, ut;
+ PROCESS_MEMORY_COUNTERS pmc;
+ char *cp1, *cp2;
+ netsnmp_swrun_entry *entry;
+
+ cygwin_internal(CW_LOCK_PINFO, 1000);
+ while (curproc = (struct external_pinfo *)
+ cygwin_internal(query, curpid | CW_NEXTPID)) {
+
+ curpid = curproc->pid;
+ if (( PID_EXITED & curproc.process_state ) ||
+ ( ~0xffff & curproc.exitcode ))
+ continue;
+ entry = netsnmp_swrun_entry_create(curpid);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ rc = CONTAINER_INSERT(container, entry);
+
+
+ n = lowproc.dwProcessId & 0xffff;
+ h = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, n);
+
+ if (curproc.ppid) {
+ entry->hrSWRunPath_len = snprintf(entry->hrSWRunPath,
+ sizeof(entry->hrSWRunPath)-1, "%s",
+ cygwin_conv_to_posix_path(curproc.progname));
+ } else if (query == CW_GETPINFO_FULL) {
+
+ if (h) {
+ HMODULE hm[1000];
+ if (!myEnumProcessModules(h, hm, sizeof hm, &n))
+ n = 0;
+ if (n && myGetModuleFileNameEx(h, hm[0], string,
+ sizeof string)) {
+ entry->hrSWRunPath_len = snprintf(entry->hrSWRunPath,
+ sizeof(entry->hrSWRunPath)-1,
+ "%s", string );
+ }
+ }
+ }
+ /*
+ * Set hrSWRunName to be the last component of hrSWRunPath,
+ * but without any file extension
+ */
+ if ( entry->hrSWRunPath_len ) {
+ cp1 = strrchr( entry->hrSWRunPath, '.' );
+ if ( cp1 )
+ *cp1 = '\0'; /* Mask the file extension */
+
+ cp2 = strrchr( entry->hrSWRunPath, '/' );
+ if (cp2)
+ cp2++; /* Find the final component ... */
+ else
+ cp2 = entry->hrSWRunPath; /* ... if any */
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName)-1, "%s", cp2);
+
+ if ( cp1 )
+ *cp1 = '.'; /* Restore the file extension */
+ }
+
+ /*
+ * XXX - No information regarding process arguments
+ * XXX - No information regarding system processes vs applications
+ */
+
+ if (PID_STOPPED & curproc.process_state ) {
+ entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ }
+ /* else if (PID_ZOMBIE & curproc.process_state ) */
+ else if ( ~0xffff & curproc.exitcode )
+ {
+ entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ } else {
+ /* entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE; ?? */
+ entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ }
+
+ if (h) {
+ if (GetProcessTimes(h, &ct, &et, &kt, &ut))
+ entry->hrSWRunPerfCPU = (to_msec(&kt) + to_msec(&ut)) / 10;
+ if (myGetProcessMemoryInfo
+ && myGetProcessMemoryInfo(h, &pmc, sizeof pmc))
+ entry->hrSWRunPerfMem = pmc.WorkingSetSize / 1024;
+
+ CloseHandle(h);
+ }
+ }
+ cygwin_internal(CW_UNLOCK_PINFO);
+
+ DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun_darwin.c b/agent/mibgroup/host/data_access/swrun_darwin.c
new file mode 100644
index 0000000..6c6b82a
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_darwin.c
@@ -0,0 +1,494 @@
+/*
+ * swrun_darwin.c:
+ * hrSWRunTable data access:
+ * Darwin
+ */
+/*
+ * Copyright (C) 2007 Apple, 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/library/container.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/data_access/swrun.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <libproc.h>
+#include <sys/proc_info.h>
+#include <sys/sysctl.h> /* for sysctl() and struct kinfo_proc */
+
+#define __APPLE_API_EVOLVING 1
+#include <sys/acl.h> /* or else CoreFoundation.h barfs */
+#undef __APPLE_API_EVOLVING
+
+#include <CoreFoundation/CFBase.h>
+#include <CoreFoundation/CFNumber.h>
+#include <CoreFoundation/CFBundle.h>
+#include <CoreServices/CoreServices.h>
+#include <IOKit/IOCFBundle.h>
+#include <mach/mach.h>
+#include <mach/mach_time.h>
+
+/** sigh... can't find Processes.h */
+#ifndef kProcessDictionaryIncludeAllInformationMask
+#define kProcessDictionaryIncludeAllInformationMask (long)0xFFFFFFFF
+#endif
+#ifndef procNotFound
+#define procNotFound -600
+#endif
+
+/* ---------------------------------------------------------------------
+ */
+static int _kern_argmax;
+static int _set_command_name(netsnmp_swrun_entry *entry);
+
+/** avoid kernel bug in 10.2. 8192 oughta be enough anyways, right? */
+#define MAX_KERN_ARGMAX 8192
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+ int mib[2] = { CTL_KERN, KERN_ARGMAX };
+ size_t size, mib_size = sizeof(mib)/sizeof(mib[0]);
+
+ DEBUGMSGTL(("swrun:load:arch","init\n"));
+
+ size = sizeof(_kern_argmax);
+ if (sysctl(mib, mib_size, &_kern_argmax, &size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "Error in ARGMAX sysctl(): %s", strerror(errno));
+ _kern_argmax = MAX_KERN_ARGMAX;
+ }
+ else if (_kern_argmax > MAX_KERN_ARGMAX) {
+ DEBUGMSGTL(("swrun:load:arch",
+ "artificially limiting ARGMAX to %d (from %d)\n",
+ MAX_KERN_ARGMAX, _kern_argmax));
+ _kern_argmax = MAX_KERN_ARGMAX;
+ }
+
+
+}
+
+/* ---------------------------------------------------------------------
+ */
+#define SWRUNINDENT " "
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL};
+ size_t buf_size, mib_size = sizeof(mib)/sizeof(mib[0]);
+ struct kinfo_proc *processes = NULL;
+ struct proc_taskallinfo taskinfo;
+ netsnmp_swrun_entry *entry;
+ int rc, num_entries, i;
+
+ DEBUGMSGTL(("swrun:load:arch"," load\n"));
+
+ /*
+ * get size to allocate. This introduces a bit of a race condition,
+ * as the size could change between this call and the next...
+ */
+ rc = sysctl(mib, mib_size, NULL, &buf_size, NULL, 0);
+ if (rc < 0) {
+ snmp_log(LOG_ERR, "KERN_PROC_ALL size sysctl failed: %d\n", rc);
+ return -1;
+ }
+
+ processes = (struct kinfo_proc*) malloc(buf_size);
+ if (NULL == processes) {
+ snmp_log(LOG_ERR, "malloc failed\n");
+ return -1;
+ }
+
+ rc = sysctl(mib, mib_size, processes, &buf_size, NULL, 0);
+ if (rc < 0) {
+ snmp_log(LOG_ERR, "KERN_PROC_ALL sysctl failed: %d\n", rc);
+ free(processes);
+ return -1;
+ }
+
+ num_entries = buf_size / sizeof(struct kinfo_proc);
+
+ for (i = 0; i < num_entries; i++) {
+ /*
+ * skip empty names.
+ * p_stat = (SIDL|SRUN|SSLEEP|SSTOP|SZOMB)
+ */
+ if ((NULL == processes[i].kp_proc.p_comm) ||
+ (0 == processes[i].kp_proc.p_pid)) {
+ DEBUGMSGTL(("swrun:load:arch",
+ " skipping p_comm '%s', pid %5d, p_pstat %d\n",
+ processes[i].kp_proc.p_comm ?
+ processes[i].kp_proc.p_comm : "NULL",
+ processes[i].kp_proc.p_pid,
+ processes[i].kp_proc.p_stat));
+ continue;
+ }
+
+ DEBUGMSGTL(("swrun:load:arch"," %s pid %5d\n",
+ processes[i].kp_proc.p_comm,
+ processes[i].kp_proc.p_pid));
+
+ entry = netsnmp_swrun_entry_create(processes[i].kp_proc.p_pid);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ rc = CONTAINER_INSERT(container, entry);
+
+ /*
+ * p_comm is a partial name, but it is all we have at this point.
+ */
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName)-1,
+ "%s", processes[i].kp_proc.p_comm);
+
+ /** sysctl for name, path, params */
+ rc = _set_command_name(entry);
+
+ /*
+ * map p_stat to RunStatus. Odd that there is no 'running' status.
+ */
+ switch(processes[i].kp_proc.p_stat) {
+ case SRUN:
+ entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case SSLEEP:
+ case SSTOP:
+ entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+ case SIDL:
+ case SZOMB:
+ default:
+ entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ break;
+ }
+
+ /*
+ * check for system processes
+ */
+ if (P_SYSTEM & processes[i].kp_proc.p_flag) {
+ entry->hrSWRunType = 2; /* operatingSystem */
+ DEBUGMSGTL(("swrun:load:arch", SWRUNINDENT "SYSTEM\n"));
+ }
+
+ /*
+ * get mem size, run time
+ */
+ rc = proc_pidinfo( processes[i].kp_proc.p_pid, PROC_PIDTASKALLINFO, 0,
+ &taskinfo, sizeof(taskinfo));
+ if (sizeof(taskinfo) != rc) {
+ DEBUGMSGTL(("swrun:load:arch", " proc_pidinfo returned %d\n", rc));
+ }
+ else {
+ uint64_t task_mem = taskinfo.ptinfo.pti_resident_size / 1024;
+ union {
+ u_quad_t uq; /* u_int64_t */
+ UnsignedWide uw; /* struct u_int32_t hi/lo */
+ } at, ns;
+ at.uq = taskinfo.ptinfo.pti_total_user +
+ taskinfo.ptinfo.pti_total_system;
+ ns.uw = AbsoluteToNanoseconds( at.uw );
+ ns.uq = ns.uq / 10000000LL; /* nano to deci */
+ if (task_mem > INT32_MAX) {
+ DEBUGMSGTL(("swrun:load:arch", SWRUNINDENT "mem overflow\n"));
+ task_mem = INT32_MAX;
+ }
+ if (ns.uq > INT32_MAX) {
+ DEBUGMSGTL(("swrun:load:arch", SWRUNINDENT "time overflow\n"));
+ ns.uq = INT32_MAX;
+ }
+ entry->hrSWRunPerfMem = task_mem;
+ entry->hrSWRunPerfCPU = ns.uq;
+ }
+ }
+ free(processes);
+
+ DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
+
+/* ---------------------------------------------------------------------
+ * The following code was snagged from Darwin code, and the original
+ * file had the following licences:
+ */
+
+/*
+ * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * The contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License"). You may not use this file except in compliance with the
+ * License. Please obtain a copy of the License at
+ * http://www.apple.com/publicsource and read it before using this file.
+ *
+ * This Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifdef JAGUAR /* xxx configure test? */
+static int
+_set_command_name_jaguar(netsnmp_swrun_entry *entry)
+{
+ int mib[3] = {CTL_KERN, KERN_PROCARGS, 0};
+ size_t procargssize, mib_size = sizeof(mib)/sizeof(mib[0]);
+ char *arg_end, *exec_path;
+ int *ip;
+ int len;
+ char *command_beg, *command, *command_end;
+ char arg_buf[MAX_KERN_ARGMAX]; /* max to avoid kernel bug */
+
+ DEBUGMSGTL(("swrun:load:arch:_cn"," pid %d\n", entry->hrSWRunIndex));
+
+ mib[2] = entry->hrSWRunIndex;
+
+ memset(arg_buf, 0x0, sizeof(arg_buf));
+ procargssize = _kern_argmax;
+ if (sysctl(mib, mib_size, arg_buf, &procargssize, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "Error in PROCARGS sysctl() for %s: %s\n",
+ entry->hrSWRunName, strerror(errno));
+ entry->hrSWRunPath_len = 0;
+ return -1;
+ }
+
+ /* Set ip just above the end of arg_buf. */
+ arg_end = &arg_buf[procargssize];
+ ip = (int *)arg_end;
+
+ /*
+ * Skip the last 2 words, since the last is a 0 word, and
+ * the second to last may be as well, if there are no
+ * arguments.
+ */
+ ip -= 3;
+
+ /* Iterate down the arguments until a 0 word is found. */
+ for (; *ip != 0; ip--) {
+ if (ip == (int *)arg_buf) {
+ DEBUGMSGTL(("swrun:load:arch:_cn"," unexpected toparg\n"));
+ return -1;
+ }
+ }
+
+ /* The saved exec_path is just above the 0 word. */
+ ip++;
+ exec_path = (char *)ip;
+ DEBUGMSGTL(("swrun:load:arch:_cn"," exec_path %s\n", exec_path));
+ len = strlen(exec_path);
+ strlcpy(entry->hrSWRunPath, exec_path, sizeof(entry->hrSWRunPath));
+ if (len > sizeof(entry->hrSWRunPath)-1) {
+ DEBUGMSGTL(("swrun:load:arch:_cn"," truncating long run path\n"));
+ entry->hrSWRunPath[sizeof(entry->hrSWRunPath)-2] = '$';
+ entry->hrSWRunPath_len = sizeof(entry->hrSWRunPath)-1;
+ DEBUGMSGTL(("swrun:load:arch:_cn"," exec_path %s\n",
+ entry->hrSWRunPath));
+ }
+ else
+ entry->hrSWRunPath_len = len;
+
+ /*
+ * Get the beginning of the first argument. It is word-aligned,
+ * so skip padding '\0' bytes.
+ */
+ command_beg = exec_path + strlen(exec_path);
+ DEBUGMSGTL(("swrun:load:arch:_cn"," command_beg '%s'\n", command_beg));
+ for (; *command_beg == '\0'; command_beg++) {
+ if (command_beg >= arg_end)
+ return -1;
+ }
+ DEBUGMSGTL(("swrun:load:arch:_cn"," command_beg '%s'\n", command_beg));
+
+ /* Get the basename of command. */
+ command = command_end = command_beg + strlen(command_beg) + 1;
+ for (command--; command >= command_beg; command--) {
+ if (*command == '/')
+ break;
+ }
+ command++;
+ DEBUGMSGTL(("swrun:load:arch:_cn"," command '%s'\n", command));
+
+ /* Allocate space for the command and copy. */
+ DEBUGMSGTL(("swrun:load:arch:_cn",
+ SWRUNINDENT "kernel name %s\n", command));
+ if (strncmp(command, entry->hrSWRunName, sizeof(entry->hrSWRunName)-1)) {
+ strlcpy(entry->hrSWRunName, command, sizeof(entry->hrSWRunName));
+ entry->hrSWRunName_len = strlen(entry->hrSWRunName);
+ DEBUGMSGTL(("swrun:load:arch:_cn", "**"
+ SWRUNINDENT "updated name to %s\n", entry->hrSWRunName));
+ return 0;
+ }
+
+ /** no error, no change */
+ return 1;
+}
+#else
+static int
+_set_command_name(netsnmp_swrun_entry *entry)
+{
+ int mib[3] = {CTL_KERN, 0, 0};
+ size_t procargssize, mib_size = sizeof(mib)/sizeof(mib[0]);
+ char *cp;
+ int len, nargs;
+ char *command_beg, *command, *command_end, *exec_path, *argN;
+ char arg_buf[MAX_KERN_ARGMAX]; /* max to avoid kernel bug */
+
+ /*
+ * arguments
+ */
+ mib[1] = KERN_PROCARGS2;
+ mib[2] = entry->hrSWRunIndex;
+
+ memset(arg_buf, 0x0, sizeof(arg_buf));
+ procargssize = _kern_argmax;
+ if (sysctl(mib, mib_size, arg_buf, &procargssize, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "Error in PROCARGS2 sysctl() for %s: %s\n",
+ entry->hrSWRunName, strerror(errno));
+ entry->hrSWRunPath_len = 0;
+ entry->hrSWRunParameters_len = 0;
+ return -1;
+ }
+ else {
+ memcpy(&nargs,arg_buf, sizeof(nargs));
+ }
+
+ exec_path = arg_buf + sizeof(nargs);
+ len = strlen(exec_path);
+ strlcpy(entry->hrSWRunPath, exec_path, sizeof(entry->hrSWRunPath));
+ if (len > sizeof(entry->hrSWRunPath)-1) {
+ DEBUGMSGTL(("swrun:load:arch:_cn"," truncating long run path\n"));
+ entry->hrSWRunPath[sizeof(entry->hrSWRunPath)-2] = '$';
+ entry->hrSWRunPath_len = sizeof(entry->hrSWRunPath)-1;
+ }
+ else
+ entry->hrSWRunPath_len = len;
+
+ /** Skip the saved exec_path. */
+#if 0
+ cp = exec_path + len;
+#else
+ for (cp = exec_path; cp < &arg_buf[procargssize]; cp++) {
+ if (*cp == '\0')
+ break; /* End of exec_path reached. */
+ }
+ if (cp != exec_path + len) {
+ DEBUGMSGTL(("swrun:load:arch:_cn"," OFF BY %d\n",
+ (exec_path + len) - cp));
+ netsnmp_assert( cp == exec_path + len );
+ }
+#endif
+ if (cp == &arg_buf[procargssize]) {
+ DEBUGMSGTL(("swrun:load:arch:_cn"," unexpected end of buffer\n"));
+ return -1;
+ }
+
+ /** Skip trailing '\0' characters. */
+ for (; cp < &arg_buf[procargssize]; cp++) {
+ if (*cp != '\0')
+ break; /* Beginning of first argument reached. */
+ }
+ if (cp == &arg_buf[procargssize]) {
+ DEBUGMSGTL(("swrun:load:arch:_cn"," unexpected end of buffer\n"));
+ return -1;
+ }
+ command_beg = cp;
+
+ /*
+ * Make sure that the command is '\0'-terminated. This protects
+ * against malicious programs; under normal operation this never
+ * ends up being a problem..
+ */
+ for (; cp < &arg_buf[procargssize]; cp++) {
+ if (*cp == '\0')
+ break; /* End of first argument reached. */
+ }
+ if (cp == &arg_buf[procargssize]) {
+ DEBUGMSGTL(("swrun:load:arch:_cn"," unexpected end of buffer\n"));
+ return -1;
+ }
+ command_end = command = cp;
+ --nargs;
+
+ /*
+ * save arguments
+ */
+ while( nargs && cp < &arg_buf[procargssize] ) {
+ /** Skip trailing '\0' characters from prev arg. */
+ for (; (cp < &arg_buf[procargssize]) && (*cp == 0); cp++)
+ ; /* noop */
+ if (cp == &arg_buf[procargssize])
+ continue; /* effectively a break */
+
+ /** save argN start */
+ argN = cp;
+ --nargs;
+ if (0 == nargs)
+ continue; /* effectively a break */
+
+ /** Skip to end of arg */
+ for (; (cp < &arg_buf[procargssize]) && (*cp != 0); cp++)
+ ; /* noop */
+ if (cp == &arg_buf[procargssize])
+ continue; /* effectively a break */
+
+ /*
+ * check for overrun into env
+ */
+ if ((*argN != '-') && strchr(argN,'=')) {
+ DEBUGMSGTL(("swrun:load:arch:_cn", " *** OVERRUN INTO ENV %d\n",nargs));
+ continue;
+ }
+
+ /*
+ * save arg
+ */
+ if(entry->hrSWRunParameters_len < sizeof(entry->hrSWRunParameters)-1) {
+ strlcat(&entry->hrSWRunParameters[entry->hrSWRunParameters_len],
+ argN, sizeof(entry->hrSWRunParameters));
+ entry->hrSWRunParameters_len = strlen(entry->hrSWRunParameters);
+ if ((entry->hrSWRunParameters_len+2 < sizeof(entry->hrSWRunParameters)-1) && (0 != nargs)) {
+ /* add space between params */
+ entry->hrSWRunParameters[entry->hrSWRunParameters_len++] = ' ';
+ entry->hrSWRunParameters[entry->hrSWRunParameters_len] = 0;
+ } else {
+ DEBUGMSGTL(("swrun:load:arch:_cn"," truncating long arg list\n"));
+ entry->hrSWRunParameters[entry->hrSWRunParameters_len++] = '$';
+ entry->hrSWRunParameters[entry->hrSWRunParameters_len] = '0';
+ }
+ }
+ }
+ if (' ' == entry->hrSWRunParameters[entry->hrSWRunParameters_len])
+ entry->hrSWRunParameters[entry->hrSWRunParameters_len--] = 0;
+
+
+ /* Get the basename of command. */
+ for (command--; command >= command_beg; command--) {
+ if (*command == '/')
+ break;
+ }
+ command++;
+
+ /* Allocate space for the command and copy. */
+ if (strncmp(command, entry->hrSWRunName, sizeof(entry->hrSWRunName)-1)) {
+ strlcpy(entry->hrSWRunName, command, sizeof(entry->hrSWRunName));
+ entry->hrSWRunName_len = strlen(entry->hrSWRunName);
+ DEBUGMSGTL(("swrun:load:arch:_cn",
+ " **updated name to %s\n", entry->hrSWRunName));
+ }
+
+ return 0;
+}
+#endif
diff --git a/agent/mibgroup/host/data_access/swrun_kinfo.c b/agent/mibgroup/host/data_access/swrun_kinfo.c
new file mode 100644
index 0000000..b13ea3a
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_kinfo.c
@@ -0,0 +1,331 @@
+/*
+ * swrun_kinfo.c:
+ * hrSWRunTable data access:
+ * kvm_getprocs() interface - FreeBSD, NetBSD, OpenBSD
+ *
+ * NB: later FreeBSD uses a different kinfo_proc structure
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#ifdef HAVE_KVM_H
+#include <kvm.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#ifdef HAVE_SYS_USER_H
+#include <sys/user.h>
+#endif
+#ifdef HAVE_UVM_UVM_EXTERNAL_H
+#include <uvm/uvm_external.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+
+extern kvm_t *kd;
+
+
+#if defined(freebsd5) && __FreeBSD_version >= 500014
+ /*
+ * later FreeBSD kinfo_proc field names
+ */
+#define SWRUN_TABLE kinfo_proc
+#define SWRUN_K_STAT ki_stat
+#define SWRUN_K_PID ki_pid
+#define SWRUN_K_COMM ki_comm
+#define SWRUN_K_FLAG ki_flag
+#define SWRUN_K_CLASS ki_pri.pri_class
+
+#elif HAVE_KVM_GETPROC2
+ /*
+ * newer NetBSD, OpenBSD kinfo_proc2 field names
+ */
+#define SWRUN_TABLE kinfo_proc2
+#define SWRUN_K_STAT p_stat
+#define SWRUN_K_PID p_pid
+#define SWRUN_K_COMM p_comm
+#define SWRUN_K_FLAG p_flag
+/* SWRUN_K_CLASS not defined */
+
+#elif defined(dragonfly)
+ /*
+ * DragonFly is different ...
+ */
+#define SWRUN_TABLE kinfo_proc
+#define SWRUN_K_STAT kp_stat
+#define SWRUN_K_PID kp_pid
+#define SWRUN_K_COMM kp_comm
+#define SWRUN_K_FLAG kp_flags
+/* SWRUN_K_CLASS not defined */
+
+#else
+ /*
+ * early FreeBSD, NetBSD, OpenBSD kinfo_proc field names
+ */
+#define SWRUN_TABLE kinfo_proc
+#define SWRUN_K_STAT kp_proc.p_stat
+#define SWRUN_K_PID kp_proc.p_pid
+#define SWRUN_K_COMM kp_proc.p_comm
+#define SWRUN_K_FLAG kp_proc.p_flag
+/* SWRUN_K_CLASS not defined */
+#endif
+
+/*
+ * Define dummy values if not already provided by the system
+ */
+
+#ifndef SRUN
+#define SRUN 200 /* Defined by FreeBSD/OpenBSD, missing in NetBSD */
+#endif
+#ifndef SACTIVE
+#define SACTIVE 201 /* Defined by NetBSD, missing in FreeBSD/OpenBSD */
+#endif
+#ifndef SSLEEP
+#define SSLEEP 202 /* Defined by FreeBSD/OpenBSD, missing in NetBSD */
+#endif
+#ifndef SWAIT
+#define SWAIT 203 /* Defined by FreeBSD, missing in NetBSD/OpenBSD */
+#endif
+#ifndef SSTOP
+#define SSTOP 204 /* Defined by FreeBSD/NetBSD/OpenBSD */
+#endif
+#ifndef SLOCK
+#define SLOCK 205 /* Defined by FreeBSD, missing in NetBSD/OpenBSD */
+#endif
+#ifndef SIDL
+#define SIDL 206 /* Defined by FreeBSD/NetBSD/OpenBSD */
+#endif
+#ifndef SZOMB
+#define SZOMB 207 /* Defined by FreeBSD/NetBSD/OpenBSD */
+#endif
+#ifndef SDEAD
+#define SDEAD 208 /* Defined by OpenBSD, missing in FreeBSD/NetBSD */
+#endif
+#ifndef SONPROC
+#define SONPROC 209 /* Defined by OpenBSD, missing in FreeBSD/NetBSD */
+#endif
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+#if NETSNMP_CAN_USE_SYSCTL && defined(CTL_KERN) && defined(KERN_MAXPROC)
+ extern int _swrun_max;
+ size_t max_size = sizeof(_swrun_max);
+ int maxproc_mib[] = { CTL_KERN, KERN_MAXPROC };
+ sysctl(maxproc_mib, 2, &_swrun_max, &max_size, NULL, 0);
+#endif
+
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ struct SWRUN_TABLE *proc_table;
+ int nprocs, i, rc;
+ char buf[BUFSIZ], **argv;
+ netsnmp_swrun_entry *entry;
+
+ if ( 0 == kd ) {
+ DEBUGMSGTL(("swrun:load:arch"," Can't query kvm info\n"));
+ return 1; /* No handle for retrieving process table */
+ }
+#if HAVE_KVM_GETPROC2
+ proc_table = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc2), &nprocs );
+#elif defined(KERN_PROC_PROC)
+ proc_table = kvm_getprocs(kd, KERN_PROC_PROC, 0, &nprocs );
+#else
+ proc_table = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nprocs );
+#endif
+ for ( i=0 ; i<nprocs; i++ ) {
+ if ( 0 == proc_table[i].SWRUN_K_STAT )
+ continue;
+ entry = netsnmp_swrun_entry_create(proc_table[i].SWRUN_K_PID);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ rc = CONTAINER_INSERT(container, entry);
+
+ /*
+ * There are two possible sources for the command being run:
+ * - SWRUN_K_COMM (from the proc_table entry directly)
+ * - running kvm_getargv on the process entry.
+ *
+ * We'll use argv[0] (if set) for hrSWRunPath,
+ * since that might potentially contain the
+ * absolute path to the running binary.
+ * We'll use SWRUN_K_COMM for hrSWRunName,
+ * and as an alternative for hrSWRunPath
+ */
+#if HAVE_KVM_GETPROC2
+ argv = kvm_getargv2( kd, &(proc_table[i]), 0);
+#else
+ argv = kvm_getargv( kd, &(proc_table[i]), 0);
+#endif
+
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName)-1,
+ "%s", proc_table[i].SWRUN_K_COMM);
+
+ if ( argv && *argv)
+ entry->hrSWRunPath_len = snprintf(entry->hrSWRunPath,
+ sizeof(entry->hrSWRunPath)-1,
+ "%s", argv[0]);
+ else {
+ memcpy( entry->hrSWRunPath, entry->hrSWRunName,
+ entry->hrSWRunName_len );
+ entry->hrSWRunPath_len = entry->hrSWRunName_len;
+ }
+
+ /*
+ * Stitch together the rest of argv[] to build hrSWRunParameters
+ *
+ * Note:
+ * We add a separating space before each argv[] parameter,
+ * *including* the first one. So we need to skip this
+ * leading space (buf[0]) when setting hrSWRunParameters.
+ * This is also why we cleared the first *two* characters
+ * in the buffer initially. If there were no command-line
+ * arguments, then buf[1] would still be a null string.
+ */
+ buf[0] = '\0';
+ buf[1] = '\0';
+ if (argv)
+ argv++; /* Skip argv[0] */
+ while ( argv && *argv ) {
+ strcat(buf, " ");
+ strcat(buf, *argv);
+ argv++;
+ }
+ entry->hrSWRunParameters_len = snprintf(entry->hrSWRunParameters,
+ sizeof(entry->hrSWRunParameters)-1,
+ "%s", buf+1);
+
+ entry->hrSWRunType = (P_SYSTEM & proc_table[i].SWRUN_K_FLAG)
+#ifdef SWRUN_K_CLASS
+ ? ((PRI_ITHD == proc_table[i].SWRUN_K_CLASS)
+ ? 3 /* device driver */
+ : 2 /* operating system */
+ )
+ : 4 /* application */
+#else
+ ? 2 /* operating system */
+ : 4 /* application */
+#endif
+ ;
+
+#ifdef netbsd5
+ switch (proc_table[i].SWRUN_K_STAT) {
+ case LSONPROC:
+ case LSRUN: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ break;
+ case LSSLEEP: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case LSIDL:
+ case LSSUSPENDED:
+ case LSSTOP: entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+ case LSDEAD:
+ case LSZOMB: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ break;
+ default:
+ entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ snmp_log(LOG_ERR, "Bad process status %c (0x%x)\n", proc_table[i].SWRUN_K_STAT, proc_table[i].SWRUN_K_STAT);
+ break;
+ }
+#else
+ switch (proc_table[i].SWRUN_K_STAT & 0xFF) {
+ case SONPROC:
+ case SRUN: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ break;
+ case SSLEEP:
+ case SWAIT: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case SIDL:
+ case SSTOP:
+ case SLOCK: entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+
+ case SDEAD:
+ case SZOMB: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID; /* i.e. "not loaded" */
+ break;
+
+ default: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID; /* Actually invalid */
+ snmp_log(LOG_ERR, "Bad process status %c (0x%x)\n", proc_table[i].SWRUN_K_STAT, proc_table[i].SWRUN_K_STAT);
+ break;
+ }
+#endif
+
+#if defined(freebsd5) && __FreeBSD_version >= 500014
+ entry->hrSWRunPerfCPU = (proc_table[i].ki_rusage.ru_utime.tv_sec*1000000 + proc_table[i].ki_rusage.ru_utime.tv_usec) / 10000;
+ entry->hrSWRunPerfCPU += (proc_table[i].ki_rusage.ru_stime.tv_sec*1000000 + proc_table[i].ki_rusage.ru_stime.tv_usec) / 10000;
+ entry->hrSWRunPerfCPU += (proc_table[i].ki_rusage_ch.ru_utime.tv_sec*1000000 + proc_table[i].ki_rusage_ch.ru_utime.tv_usec) / 10000;
+ entry->hrSWRunPerfCPU += (proc_table[i].ki_rusage_ch.ru_stime.tv_sec*1000000 + proc_table[i].ki_rusage_ch.ru_stime.tv_usec) / 10000;
+ entry->hrSWRunPerfMem = proc_table[i].ki_rssize * (getpagesize()/1024); /* in kB */
+#elif defined(HAVE_KVM_GETPROC2)
+ /*
+ * newer NetBSD, OpenBSD
+ */
+ entry->hrSWRunPerfCPU = proc_table[i].p_uticks;
+ entry->hrSWRunPerfCPU += proc_table[i].p_sticks;
+ entry->hrSWRunPerfCPU += proc_table[i].p_iticks;
+ entry->hrSWRunPerfMem = proc_table[i].p_vm_rssize;
+ entry->hrSWRunPerfMem *= (getpagesize() / 1024);
+#elif defined(dragonfly) && __DragonFly_version >= 190000
+ entry->hrSWRunPerfCPU = proc_table[i].kp_lwp.kl_uticks;
+ entry->hrSWRunPerfCPU += proc_table[i].kp_lwp.kl_sticks;
+ entry->hrSWRunPerfCPU += proc_table[i].kp_lwp.kl_iticks;
+ entry->hrSWRunPerfMem = proc_table[i].kp_vm_map_size / 1024;
+#elif defined(dragonfly)
+ entry->hrSWRunPerfCPU = proc_table[i].kp_eproc.e_uticks;
+ entry->hrSWRunPerfCPU += proc_table[i].kp_eproc.e_sticks;
+ entry->hrSWRunPerfCPU += proc_table[i].kp_eproc.e_iticks;
+ entry->hrSWRunPerfMem = proc_table[i].kp_vm_map_size / 1024;
+
+#else
+ /*
+ * early FreeBSD, NetBSD, OpenBSD
+ */
+ entry->hrSWRunPerfCPU = proc_table[i].kp_proc.p_uticks;
+ entry->hrSWRunPerfCPU += proc_table[i].kp_proc.p_sticks;
+ entry->hrSWRunPerfCPU += proc_table[i].kp_proc.p_iticks;
+ entry->hrSWRunPerfMem = proc_table[i].kp_eproc.e_vm.vm_rssize;
+ entry->hrSWRunPerfMem *= (getpagesize() / 1024);
+#endif
+ }
+ /*
+ * 'proc_table' is owned by the kvm library,
+ * so shouldn't be freed here.
+ */
+
+ DEBUGMSGTL(("swrun:load:arch","loaded %d entries\n",
+ (int)CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun_kvm_proc.c b/agent/mibgroup/host/data_access/swrun_kvm_proc.c
new file mode 100644
index 0000000..ae6876e
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_kvm_proc.c
@@ -0,0 +1,164 @@
+/*
+ * swrun_kvm_proc.c:
+ * hrSWRunTable data access:
+ * kvm_getproc() interface - Solaris
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_USER_H
+#define _KMEMUSER
+#include <sys/user.h>
+#endif
+#ifdef HAVE_SYS_PROC_H
+#include <sys/proc.h>
+#endif
+ /* XXX - should really be protected */
+#include <sys/var.h>
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef HAVE_KVM_H
+#include <kvm.h>
+#endif
+#ifdef HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+#include "kernel.h"
+#include "kernel_sunos5.h"
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+ extern int _swrun_max;
+ kstat_ctl_t *ksc;
+ kstat_t *ks;
+ struct var v;
+
+ if (NULL != (ksc = kstat_open())) {
+ if ((NULL != (ks = kstat_lookup(ksc, "unix", 0, "var"))) &&
+ ( -1 != kstat_read(ksc, ks, &v ))) {
+ _swrun_max = v.v_proc;
+ }
+ kstat_close(ksc);
+ }
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ DIR *procdir = NULL;
+ struct dirent *procentry_p;
+ struct proc *proc_buf;
+ int pid, rc, i;
+ char *cp;
+ netsnmp_swrun_entry *entry;
+
+ /*
+ * Even if we're using kvm_proc() to retrieve information
+ * about a particular process, we seem to use /proc to get
+ * the initial list of processes to report on.
+ */
+ procdir = opendir("/proc");
+ if ( NULL == procdir ) {
+ snmp_log( LOG_ERR, "Failed to open /proc" );
+ return -1;
+ }
+
+ /*
+ * Walk through the list of processes in the /proc tree
+ */
+ while ( NULL != (procentry_p = readdir( procdir ))) {
+ pid = atoi( procentry_p->d_name );
+ if ( 0 == pid )
+ continue; /* Presumably '.' or '..' */
+
+ entry = netsnmp_swrun_entry_create(pid);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ if (NULL == (proc_buf = kvm_getproc( kd, pid))) {
+ /* release entry */
+ continue;
+ }
+ rc = CONTAINER_INSERT(container, entry);
+
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName)-1,
+ "%s", proc_buf->p_user.u_comm);
+ /*
+ * Split u_psargs into two:
+ * argv[0] is hrSWRunPath
+ * argv[1..] is hrSWRunParameters
+ */
+ for ( cp = proc_buf->p_user.u_psargs; ' ' == *cp; cp++ )
+ ;
+ *cp = '\0'; /* End of argv[0] */
+ entry->hrSWRunPath_len = snprintf(entry->hrSWRunPath,
+ sizeof(entry->hrSWRunPath)-1,
+ "%s", proc_buf->p_user.u_psargs);
+ entry->hrSWRunParameters_len = snprintf(entry->hrSWRunParameters,
+ sizeof(entry->hrSWRunParameters)-1,
+ "%s", cp+1);
+ *cp = ' '; /* Restore u_psargs value */
+
+ /*
+ * check for system processes
+ */
+ entry->hrSWRunType = (SSYS & proc_buf->p_flag)
+ ? 2 /* kernel process */
+ : 4 /* application */
+ ;
+
+ switch (proc_buf->p_stat) {
+ case SRUN:
+ case SONPROC: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ break;
+ case SSLEEP: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case SSTOP: entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+ case SIDL:
+ case SZOMB:
+ default: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ break;
+ }
+
+ entry->hrSWRunPerfCPU = (proc_buf->p_utime * 100);
+ entry->hrSWRunPerfCPU += (proc_buf->p_stime * 100);
+ entry->hrSWRunPerfMem = proc_buf->p_swrss;
+ /* XXX - is this reported in kB? */
+ }
+ closedir( procdir );
+
+ DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun_nlist.c b/agent/mibgroup/host/data_access/swrun_nlist.c
new file mode 100644
index 0000000..5db6c9c
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_nlist.c
@@ -0,0 +1,114 @@
+/*
+ * swrun_nlist.c:
+ * hrSWRunTable data access:
+ * nlist() interface
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#include <net-snmp/agent/auto_nlist.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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+ extern int _swrun_max;
+
+ auto_nlist( PROC_SYMBOL, 0, 0);
+ auto_nlist( NPROC_SYMBOL, (char *)&_swrun_max, sizeof(int));
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ struct proc *proc_table;
+ int proc_type_base;
+ int nproc, i, rc;
+ netsnmp_swrun_entry *entry;
+
+ auto_nlist( NPROC_SYMBOL, (char *)&nproc, sizeof(int));
+ proc_table = (struct proc *) malloc(nproc*(sizeof(struct proc)));
+
+ auto_nlist( PROC_SYMBOL, (char *)&proc_table_base, sizeof(int));
+ NETSNMP_KLOOKUP(proc_table_base, (char *)proc_table,
+ nproc*(sizeof(struct proc)));
+
+ for ( i=0 ; i<nproc; i++ ) {
+ if (0 == proc_table[i].p_stat)
+ continue; /* Skip unused entries */
+ entry = netsnmp_swrun_entry_create(proc_table[i].p_pid);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ rc = CONTAINER_INSERT(container, entry);
+
+ /*
+ * XXX - What information does 'struct proc' contain?
+ */
+
+/*
+ Apparently no process name/argument information
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName)-1,
+ "%s", proc_table[i].???);
+ entry->hrSWRunPath_len = snprintf(entry->hrSWRunPath,
+ sizeof(entry->hrSWRunPath)-1,
+ "%s", proc_table[i].???);
+ entry->hrSWRunParameters_len = snprintf(entry->hrSWRunParameters,
+ sizeof(entry->hrSWRunParameters)-1,
+ "%s", ???);
+ */
+
+ switch (proc_table[i].p_stat) {
+/* XXX - which names to use ?? */
+ case SACTIVE:
+ case SRUN:
+ case SONPROC: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ break;
+ case SSWAP:
+ case SSLEEP:
+ case SWAIT: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case SSTOP: entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+ case SIDL:
+ case SZOMB:
+ default: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ break;
+ }
+
+
+ entry->hrSWRunPerfCPU = (proc_table[i].p_utime.tv_sec * 100);
+ entry->hrSWRunPerfCPU += (proc_table[i].p_utime.tv_usec / 10000);
+ entry->hrSWRunPerfCPU += (proc_table[i].p_stime.tv_sec * 100);
+ entry->hrSWRunPerfCPU += (proc_table[i].p_stime.tv_usec / 10000);
+ /*
+ or entry->hrSWRunPerfCPU = proc_table[i].p_time;
+ */
+ }
+ free(proc_table);
+
+ DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun_null.c b/agent/mibgroup/host/data_access/swrun_null.c
new file mode 100644
index 0000000..343d40e
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_null.c
@@ -0,0 +1,44 @@
+/*
+ * swrun_null.c:
+ * hrSWRunTable data access:
+ * dummy interface for non-supported systems
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+ /* Nothing to do */
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ /* Nothing to do */
+ DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun_procfs_psinfo.c b/agent/mibgroup/host/data_access/swrun_procfs_psinfo.c
new file mode 100644
index 0000000..ed961ee
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_procfs_psinfo.c
@@ -0,0 +1,147 @@
+/*
+ * swrun_procfs_psinfo.c:
+ * hrSWRunTable data access:
+ * /proc/{pid}/psinfo interface - Solaris
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#define HAVE_SYS_PROCFS_H /* XXX - Needs a configure check! */
+#ifdef HAVE_SYS_PROCFS_H
+#define _KERNEL /* For psinfo_t */
+#include <sys/procfs.h>
+#undef _KERNEL
+#endif
+#ifdef HAVE_SYS_PROC_H
+#include <sys/proc.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+ /* Nothing to do */
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ DIR *procdir = NULL;
+ struct dirent *procentry_p;
+ psinfo_t psinfo;
+ int pid, rc, fd;
+ char *cp, buf[512];
+ netsnmp_swrun_entry *entry;
+
+ procdir = opendir("/proc");
+ if ( NULL == procdir ) {
+ snmp_log( LOG_ERR, "Failed to open /proc" );
+ return -1;
+ }
+
+ /*
+ * Walk through the list of processes in the /proc tree
+ */
+ while ( NULL != (procentry_p = readdir( procdir ))) {
+ pid = atoi( procentry_p->d_name );
+ if ( 0 == pid )
+ continue; /* Presumably '.' or '..' */
+
+ entry = netsnmp_swrun_entry_create(pid);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ rc = CONTAINER_INSERT(container, entry);
+
+ /*
+ * Now extract the interesting information
+ * from the various /proc{PID}/ interface files
+ */
+
+ snprintf( buf, sizeof(buf), "/proc/%d/psinfo", pid );
+ fd = open( buf, O_RDONLY );
+ read( fd, &psinfo, sizeof(psinfo));
+ close(fd);
+
+ entry->hrSWRunName_len
+ = sprintf(entry->hrSWRunName, "%.*s",
+ (int)sizeof(entry->hrSWRunName) - 1,
+ psinfo.pr_fname);
+ /*
+ * Split pr_psargs into two:
+ * argv[0] is hrSWRunPath
+ * argv[1..] is hrSWRunParameters
+ */
+ for ( cp = psinfo.pr_psargs; ' ' == *cp; cp++ )
+ ;
+ *cp = '\0'; /* End of argv[0] */
+ entry->hrSWRunPath_len
+ = sprintf(entry->hrSWRunPath, "%.*s",
+ (int)sizeof(entry->hrSWRunPath) - 1,
+ psinfo.pr_psargs);
+
+ entry->hrSWRunParameters_len
+ = sprintf(entry->hrSWRunParameters, "%.*s",
+ (int)sizeof(entry->hrSWRunParameters) - 1, cp+1);
+ *cp = ' '; /* Restore pr_psargs value */
+
+ /*
+ * check for system processes
+ */
+ entry->hrSWRunType = (PR_ISSYS & psinfo.pr_flag)
+ ? 2 /* kernel process */
+ : 4 /* application */
+ ;
+
+ switch (psinfo.pr_lwp.pr_state) {
+ case SRUN:
+ case SONPROC: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ break;
+ case SSLEEP: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case SSTOP: entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+ case SIDL:
+ case SZOMB:
+ default: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ break;
+ }
+
+ entry->hrSWRunPerfCPU = (psinfo.pr_time.tv_sec * 100);
+ entry->hrSWRunPerfCPU += (psinfo.pr_time.tv_nsec / 10000000);
+ entry->hrSWRunPerfMem = psinfo.pr_rssize;
+ /* XXX - is this reported in kB? */
+ }
+ closedir( procdir );
+
+ DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+ (int)CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun_procfs_status.c b/agent/mibgroup/host/data_access/swrun_procfs_status.c
new file mode 100644
index 0000000..80182d0
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_procfs_status.c
@@ -0,0 +1,218 @@
+/*
+ * swrun_procfs_linux.c:
+ * hrSWRunTable data access:
+ * /proc/{pid}/status interface - Linux
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#include <ctype.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef HAVE_LINUX_TASKS_H
+#include <linux/tasks.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+
+static long pagesize;
+static long sc_clk_tck;
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+#ifdef HAVE_LINUX_TASKS_H
+ extern int _swrun_max = NR_TASKS; /* from <linux/tasks.h> */
+#endif
+
+ pagesize = getpagesize();
+ sc_clk_tck = sysconf(_SC_CLK_TCK);
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ DIR *procdir = NULL;
+ struct dirent *procentry_p;
+ FILE *fp;
+ int pid, i;
+ unsigned long long cpu;
+ char buf[BUFSIZ], buf2[BUFSIZ], *cp;
+ netsnmp_swrun_entry *entry;
+
+ procdir = opendir("/proc");
+ if ( NULL == procdir ) {
+ snmp_log( LOG_ERR, "Failed to open /proc" );
+ return -1;
+ }
+
+ /*
+ * Walk through the list of processes in the /proc tree
+ */
+ while ( NULL != (procentry_p = readdir( procdir ))) {
+ pid = atoi( procentry_p->d_name );
+ if ( 0 == pid )
+ continue; /* Presumably '.' or '..' */
+
+ entry = netsnmp_swrun_entry_create(pid);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+
+ /*
+ * Now extract the interesting information
+ * from the various /proc{PID}/ interface files
+ */
+
+ /*
+ * Name: process name
+ */
+ snprintf( buf2, BUFSIZ, "/proc/%d/status", pid );
+ fp = fopen( buf2, "r" );
+ if (!fp) {
+ netsnmp_swrun_entry_free(entry);
+ continue; /* file (process) probably went away */
+ }
+ memset(buf, 0, sizeof(buf));
+ if (fgets( buf, BUFSIZ-1, fp ) == NULL) {
+ fclose(fp);
+ netsnmp_swrun_entry_free(entry);
+ continue;
+ }
+ fclose(fp);
+
+ for ( cp = buf; *cp != ':'; cp++ )
+ ;
+ while (isspace(*(++cp))) /* Skip ':' and following spaces */
+ ;
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName)-1, "%s", cp);
+ if ( '\n' == entry->hrSWRunName[ entry->hrSWRunName_len-1 ]) {
+ entry->hrSWRunName[ entry->hrSWRunName_len-1 ] = '\0';
+ entry->hrSWRunName_len--; /* Stamp on trailing newline */
+ }
+
+ /*
+ * Command Line:
+ * argv[0] '\0' argv[1] '\0' ....
+ */
+ snprintf( buf2, BUFSIZ, "/proc/%d/cmdline", pid );
+ fp = fopen( buf2, "r" );
+ if (!fp) {
+ netsnmp_swrun_entry_free(entry);
+ continue; /* file (process) probably went away */
+ }
+ memset(buf, 0, sizeof(buf));
+ if ((cp = fgets( buf, BUFSIZ-1, fp )) == NULL) {
+ fclose(fp);
+ netsnmp_swrun_entry_free(entry);
+ continue;
+ }
+ fclose(fp);
+
+ /*
+ * argv[0] is hrSWRunPath
+ */
+ entry->hrSWRunPath_len = snprintf(entry->hrSWRunPath,
+ sizeof(entry->hrSWRunPath)-1, "%s", buf);
+ /*
+ * Stitch together argv[1..] to construct hrSWRunParameters
+ */
+ cp = buf + entry->hrSWRunPath_len+1;
+ while ( 1 ) {
+ while (*cp)
+ cp++;
+ if ( '\0' == *(cp+1))
+ break; /* '\0''\0' => End of command line */
+ *cp = ' ';
+ }
+ entry->hrSWRunParameters_len
+ = sprintf(entry->hrSWRunParameters, "%.*s",
+ (int)sizeof(entry->hrSWRunParameters) - 1,
+ buf + entry->hrSWRunPath_len + 1);
+
+ /*
+ * XXX - No information regarding system processes vs applications
+ */
+ entry->hrSWRunType = HRSWRUNTYPE_APPLICATION;
+
+ /*
+ * {xxx} {xxx} STATUS {xxx}*10 UTIME STIME {xxx}*8 RSS
+ */
+ snprintf( buf, BUFSIZ, "/proc/%d/stat", pid );
+ fp = fopen( buf, "r" );
+ if (!fp) {
+ netsnmp_swrun_entry_free(entry);
+ continue; /* file (process) probably went away */
+ }
+ if (fgets( buf, BUFSIZ-1, fp ) == NULL) {
+ fclose(fp);
+ netsnmp_swrun_entry_free(entry);
+ continue;
+ }
+ fclose(fp);
+
+ cp = buf;
+ while ( ' ' != *(cp++)) /* Skip first field */
+ ;
+ while ( ' ' != *(cp++)) /* Skip second field */
+ ;
+
+ switch (*cp) {
+ case 'R': entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ break;
+ case 'S': entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case 'D':
+ case 'T': entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+ case 'Z':
+ default: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ break;
+ }
+ for (i=11; i; i--) { /* Skip STATUS + 10 fields */
+ while (' ' != *(++cp))
+ ;
+ cp++;
+ }
+ cpu = atol( cp ); /* utime */
+ while ( ' ' != *(++cp))
+ ;
+ cpu += atol( cp ); /* +stime */
+ entry->hrSWRunPerfCPU = cpu * 100 / sc_clk_tck;
+
+ for (i=9; i; i--) { /* Skip stime + 8 fields */
+ while (' ' != *(++cp))
+ ;
+ cp++;
+ }
+ entry->hrSWRunPerfMem = atol( cp ); /* rss */
+ entry->hrSWRunPerfMem *= (pagesize/1024); /* in kB */
+ CONTAINER_INSERT(container, entry);
+ }
+ closedir( procdir );
+
+ DEBUGMSGTL(("swrun:load:arch"," loaded %" NETSNMP_PRIz "d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun_procinfo.c b/agent/mibgroup/host/data_access/swrun_procinfo.c
new file mode 100644
index 0000000..20caee6
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_procinfo.c
@@ -0,0 +1,130 @@
+/*
+ * swrun_procinfo.c:
+ * hrSWRunTable data access:
+ * getprocs() interface - AIX
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#include <procinfo.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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+
+int avail = 1024; /* Size of table to allocate */
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+ /* Nothing to do */
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ struct procsinfo *proc_table;
+ pid_t proc_index = 0;
+ int nprocs, rc, i;
+ char pentry[128], *ppentry, fullpath[128];
+ netsnmp_swrun_entry *entry;
+
+ /*
+ * Create a buffer for the process table, based on the size of
+ * the table the last time we loaded this information.
+ * If this isn't big enough, keep increasing the size of the
+ * table until we can retrieve the whole thing.
+ */
+ proc_table = (struct procsinfo *) malloc(avail*(sizeof(struct procsinfo)));
+ while ( avail == (nprocs = getprocs(proc_table, sizeof(struct procsinfo),
+ 0, sizeof(struct fdsinfo),
+ &proc_index, avail))) {
+ avail += 1024;
+ free( proc_table );
+ proc_table = (struct procsinfo *) malloc(avail*(sizeof(struct procsinfo)));
+ }
+
+ for ( i=0 ; i<nprocs; i++ ) {
+ if (0 == proc_table[i].pi_state)
+ continue; /* Skip unused entries */
+ entry = netsnmp_swrun_entry_create(proc_table[i].pi_pid);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ rc = CONTAINER_INSERT(container, entry);
+
+ memset(pentry, 0, sizeof(pentry)); /* Empty each time */
+ if(!(SKPROC & proc_table[i].pi_flags)) { /* Remove kernel processes */
+ getargs(&proc_table[i], sizeof(struct procsinfo), pentry, sizeof(pentry)); /* Call getargs() */
+ for(ppentry = pentry; !((*ppentry == '\0') && (*(ppentry+1) == '\0')); ppentry++) { /* Process until 0x00 0x00 */
+ if((*ppentry == '\0') && (!(*(ppentry+1) == '\0'))) /* if 0x00 !0x00 */
+ *ppentry = ' '; /* change to 0x20 !0x00 */
+ }
+ snprintf(fullpath, sizeof(fullpath)-1, "%.*s", (int)(strchr(pentry, ' ')-pentry), pentry);
+
+ entry->hrSWRunPath_len = snprintf(entry->hrSWRunPath,
+ sizeof(entry->hrSWRunPath), "%s", fullpath);
+ ppentry = strrchr(fullpath, '/');
+ if(ppentry == NULL) {
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName), "%s", fullpath);
+ }
+ else {
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName), "%s", ppentry + 1);
+ }
+
+ ppentry = strchr(pentry, ' ');
+ entry->hrSWRunParameters_len = snprintf(entry->hrSWRunParameters,
+ sizeof(entry->hrSWRunParameters), "%.*s", (int)(pentry - ppentry), ppentry + 1);
+ }
+
+ entry->hrSWRunType = (SKPROC & proc_table[i].pi_flags)
+ ? 2 /* kernel process */
+ : 4 /* application */
+ ;
+
+ switch (proc_table[i].pi_state) {
+ case SACTIVE:
+ case SRUN: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ break;
+ case SSLEEP: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case SSTOP: entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+ case SIDL:
+ case SZOMB:
+ default: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ break;
+ }
+
+ entry->hrSWRunPerfCPU = (proc_table[i].pi_ru.ru_utime.tv_sec * 100);
+ entry->hrSWRunPerfCPU += (proc_table[i].pi_ru.ru_utime.tv_usec / 10000000);
+ entry->hrSWRunPerfCPU += (proc_table[i].pi_ru.ru_stime.tv_sec * 100);
+ entry->hrSWRunPerfCPU += (proc_table[i].pi_ru.ru_stime.tv_usec / 10000000);
+ entry->hrSWRunPerfMem = proc_table[i].pi_size;
+ entry->hrSWRunPerfMem *= (getpagesize()/1024); /* in kB */
+ }
+ free(proc_table);
+
+ DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun_prpsinfo.c b/agent/mibgroup/host/data_access/swrun_prpsinfo.c
new file mode 100644
index 0000000..6cbbb23
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_prpsinfo.c
@@ -0,0 +1,107 @@
+/*
+ * swrun_prpsinfo.c:
+ * hrSWRunTable data access:
+ * getprpsinfo() interface - Dynix
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_?????_H
+#include <?????.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+ /* Nothing to do */
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ pid_t nextproc = 0;
+ getprpsinfo_t *select = 0;
+ prpsinfo_t mypsinfo;
+ int rc;
+ char *cp;
+ netsnmp_swrun_entry *entry;
+
+ while ( 0 <= ( nextproc = getprpsinfo( nextproc, select, &mypsinfo ))) {
+ entry = netsnmp_swrun_entry_create(mypsinfo.pr_pid);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ rc = CONTAINER_INSERT(container, entry);
+
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName)-1,
+ "%s", mypsinfo.pr_fname);
+ /*
+ * Split pr_psargs into two:
+ * argv[0] is hrSWRunPath
+ * argv[1..] is hrSWRunParameters
+ */
+ for ( cp = mypsinfo.pr_psargs; ' ' == *cp; cp++ )
+ ;
+ *cp = '\0'; /* End of argv[0] */
+ entry->hrSWRunPath_len = snprintf(entry->hrSWRunPath,
+ sizeof(entry->hrSWRunPath)-1,
+ "%s", mypsinfo.pr_psargs);
+ entry->hrSWRunParameters_len = snprintf(entry->hrSWRunParameters,
+ sizeof(entry->hrSWRunParameters)-1,
+ "%s", cp+1);
+ *cp = ' '; /* Restore pr_psargs value */
+
+ /*
+ * XXX - No information regarding system processes vs applications
+ */
+
+ switch (mypsinfo.pr_state) {
+/* XXX - which names to use ?? */
+ case SACTIVE:
+ case SRUN:
+ case SONPROC: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ break;
+ case SSWAP:
+ case SSLEEP:
+ case SWAIT: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case SSTOP: entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+ case SIDL:
+ case SZOMB:
+ default: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ break;
+ }
+
+ entry->hrSWRunPerfCPU = (mypsinfo.pr_time.tv_sec * 100);
+ entry->hrSWRunPerfCPU += (mypsinfo.pr_time.tv_nsec / 10000000);
+ entry->hrSWRunPerfMem = (mypsinfo.pr_rssize);
+ entry->hrSWRunPerfMem *= (MU_PAGESIZE/1024); /* in kB */
+ }
+
+ DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/data_access/swrun_pstat.c b/agent/mibgroup/host/data_access/swrun_pstat.c
new file mode 100644
index 0000000..b85ce77
--- /dev/null
+++ b/agent/mibgroup/host/data_access/swrun_pstat.c
@@ -0,0 +1,117 @@
+/*
+ * swrun_pstat.c:
+ * hrSWRunTable data access:
+ * pstat_getdynamic() interface - HPUX
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_PSTAT_H
+#define _PSTAT64
+#include <sys/pstat.h>
+#endif
+
+#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_debug.h>
+#include <net-snmp/data_access/swrun.h>
+
+/* ---------------------------------------------------------------------
+ */
+void
+netsnmp_arch_swrun_init(void)
+{
+ extern int _swrun_max;
+ struct pst_static pst_buf;
+
+ pstat_getstatic( &pst_buf, sizeof(struct pst_static), 1, 0);
+ _swrun_max = pst_buf.max_proc;
+ return;
+}
+
+/* ---------------------------------------------------------------------
+ */
+int
+netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags)
+{
+ struct pst_status *proc_table;
+ struct pst_dynamic pst_dyn;
+ int nproc, i, rc;
+ char *cp1, *cp2;
+ netsnmp_swrun_entry *entry;
+
+ pstat_getdynamic( &pst_dyn, sizeof(struct pst_dynamic), 1, 0);
+ nproc = pst_dyn.psd_activeprocs;
+ proc_table = (struct pst_status *) malloc(nproc*(sizeof(struct pst_status)));
+ pstat_getproc(proc_table, sizeof(struct pst_status), nproc, 0);
+
+ for ( i=0 ; i<nproc; i++ ) {
+ entry = netsnmp_swrun_entry_create(proc_table[i].pst_pid);
+ if (NULL == entry)
+ continue; /* error already logged by function */
+ rc = CONTAINER_INSERT(container, entry);
+
+ entry->hrSWRunName_len = snprintf(entry->hrSWRunName,
+ sizeof(entry->hrSWRunName)-1,
+ "%s", proc_table[i].pst_ucomm);
+ /*
+ * Split pst_cmd into two:
+ * argv[0] is hrSWRunPath
+ * argv[1..] is hrSWRunParameters
+ */
+ for ( cp1 = proc_table[i].pst_cmd; ' ' == *cp1; cp1++ )
+ ;
+ *cp1 = '\0'; /* End of argv[0] */
+ entry->hrSWRunPath_len = snprintf(entry->hrSWRunPath,
+ sizeof(entry->hrSWRunPath)-1,
+ "%s", proc_table[i].pst_cmd);
+ entry->hrSWRunParameters_len = snprintf(entry->hrSWRunParameters,
+ sizeof(entry->hrSWRunParameters)-1,
+ "%s", cp1+1);
+ *cp1 = ' '; /* Restore pst_cmd value */
+
+ entry->hrSWRunType = (PS_SYS & proc_table[i].pst_flag)
+ ? 2 /* kernel process */
+ : 4 /* application */
+ ;
+
+ switch (proc_table[i].pst_stat) {
+ case PS_RUN: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNING;
+ break;
+ case PS_SLEEP: entry->hrSWRunStatus = HRSWRUNSTATUS_RUNNABLE;
+ break;
+ case PS_STOP: entry->hrSWRunStatus = HRSWRUNSTATUS_NOTRUNNABLE;
+ break;
+ case PS_IDLE:
+ case PS_ZOMBIE:
+ case PS_OTHER:
+ default: entry->hrSWRunStatus = HRSWRUNSTATUS_INVALID;
+ break;
+ }
+
+ entry->hrSWRunPerfCPU = proc_table[i].pst_cptickstotal;
+ entry->hrSWRunPerfMem = proc_table[i].pst_rssize;
+ entry->hrSWRunPerfMem *= getpagesize() / 1024; /* in kB */
+ /* XXX - Check this last calculation */
+ }
+ free(proc_table);
+
+ DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+ CONTAINER_SIZE(container)));
+
+ return 0;
+}
diff --git a/agent/mibgroup/host/hrSWInstalledTable.c b/agent/mibgroup/host/hrSWInstalledTable.c
new file mode 100644
index 0000000..ad8aee3
--- /dev/null
+++ b/agent/mibgroup/host/hrSWInstalledTable.c
@@ -0,0 +1,282 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.container.conf,v 1.8 2006/07/26 15:58:26 dts12 Exp $
+ */
+/* 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 (C) 2007 Apple, 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/table_container.h>
+#include <net-snmp/data_access/swinst.h>
+#include <net-snmp/agent/cache_handler.h>
+#include "hrSWInstalledTable.h"
+
+#define MYTABLE "hrSWInstalledTable"
+
+static netsnmp_table_registration_info *table_info;
+
+static void _cache_free(netsnmp_cache * cache, void *magic);
+static int _cache_load(netsnmp_cache * cache, void *magic);
+
+/** Initializes the hrSWInstalledTable module */
+void
+init_hrSWInstalledTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_hrSWInstalledTable();
+}
+
+void
+shutdown_hrSWInstalledTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+/** Initialize the hrSWInstalledTable table by defining its contents and how it's structured */
+void
+initialize_table_hrSWInstalledTable(void)
+{
+ static oid hrSWInstalledTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 25, 6, 3 };
+ size_t hrSWInstalledTable_oid_len =
+ OID_LENGTH(hrSWInstalledTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_cache *cache = NULL;
+
+ DEBUGMSGTL(("hrSWInstalled", "initialize\n"));
+
+ reg =
+ netsnmp_create_handler_registration("hrSWInstalledTable",
+ hrSWInstalledTable_handler,
+ hrSWInstalledTable_oid,
+ hrSWInstalledTable_oid_len,
+ HANDLER_CAN_RONLY);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,"error creating handler registration for "
+ MYTABLE "\n");
+ goto bail;
+ }
+
+ container = netsnmp_container_find("hrSWInstalledTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR,"error creating container for "
+ MYTABLE "\n");
+ goto bail;
+ }
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,"error allocating table registration for "
+ MYTABLE "\n");
+ goto bail;
+ }
+
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: hrSWInstalledIndex */
+ 0);
+ table_info->min_column = COLUMN_HRSWINSTALLEDINDEX;
+ table_info->max_column = COLUMN_HRSWINSTALLEDDATE;
+
+ /*************************************************
+ *
+ * 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 "
+ MYTABLE "\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,"error injecting container_table handler for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ hrSWInstalledTable_oid,
+ hrSWInstalledTable_oid_len);
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR, "error creating cache for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ cache->magic = container;
+
+ handler = netsnmp_cache_handler_get(cache);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR, "error creating cache handler for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,"error injecting cache handler for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it*/
+
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,"error registering table handler for "
+ MYTABLE "\n");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ goto bail;
+ }
+
+ return; /* ok */
+
+
+ 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 hrSWInstalledTable table */
+int
+hrSWInstalledTable_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_swinst_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 = (netsnmp_swinst_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 "
+ MYTABLE "\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_HRSWINSTALLEDINDEX:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->swIndex);
+ break;
+ case COLUMN_HRSWINSTALLEDNAME: {
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) table_entry->swName,
+ table_entry->swName_len);
+ } break;
+ case COLUMN_HRSWINSTALLEDID:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) &nullOid, nullOidLen);
+ break;
+ case COLUMN_HRSWINSTALLEDTYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->swType);
+ break;
+ case COLUMN_HRSWINSTALLEDDATE:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) table_entry->swDate,
+ table_entry->swDate_len);
+ break;
+ default:
+ /*
+ * An unsupported/unreadable column (if applicable)
+ */
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_NOSUCHOBJECT, NULL, 0);
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ * The data access mechanism here is rather simple: let newsnmp_swinst_*
+ * take care of it.
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("hrSWInstalledTable:cache", "load\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for hrSWInstalledTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ cache->magic =
+ netsnmp_swinst_container_load((netsnmp_container *) cache->magic, 0);
+
+ return 0;
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in hrSWInstalledTable_cache_free\n");
+ return;
+ }
+ DEBUGMSGTL(("hrSWInstalledTable:cache", "free\n"));
+
+ netsnmp_swinst_container_free_items((netsnmp_container *) cache->magic);
+} /* _cache_free */
diff --git a/agent/mibgroup/host/hrSWInstalledTable.h b/agent/mibgroup/host/hrSWInstalledTable.h
new file mode 100644
index 0000000..48f17e8
--- /dev/null
+++ b/agent/mibgroup/host/hrSWInstalledTable.h
@@ -0,0 +1,26 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.container.conf,v 1.8 2006/07/26 15:58:26 dts12 Exp $
+ */
+#ifndef HRSWINSTALLEDTABLE_H
+#define HRSWINSTALLEDTABLE_H
+
+config_require(host/data_access/swinst)
+
+/*
+ * function declarations
+ */
+void init_hrSWInstalledTable(void);
+void shutdown_hrSWInstalledTable(void);
+void initialize_table_hrSWInstalledTable(void);
+Netsnmp_Node_Handler hrSWInstalledTable_handler;
+
+/*
+ * column number definitions for table hrSWInstalledTable
+ */
+#define COLUMN_HRSWINSTALLEDINDEX 1
+#define COLUMN_HRSWINSTALLEDNAME 2
+#define COLUMN_HRSWINSTALLEDID 3
+#define COLUMN_HRSWINSTALLEDTYPE 4
+#define COLUMN_HRSWINSTALLEDDATE 5
+#endif /* HRSWINSTALLEDTABLE_H */
diff --git a/agent/mibgroup/host/hrSWRunPerfTable.c b/agent/mibgroup/host/hrSWRunPerfTable.c
new file mode 100644
index 0000000..43b44d1
--- /dev/null
+++ b/agent/mibgroup/host/hrSWRunPerfTable.c
@@ -0,0 +1,198 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.container.conf,v 1.8 2006/07/26 15:58:26 dts12 Exp $
+ */
+/* 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 (C) 2007 Apple, 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/data_access/swrun.h>
+#include "hrSWRunPerfTable.h"
+#include "data_access/swrun.h"
+
+#define MYTABLE "hrSWRunPerfTable"
+
+/** Initializes the hrSWRunPerfTable module */
+void
+init_hrSWRunPerfTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_hrSWRunPerfTable();
+}
+
+void
+shutdown_hrSWRunPerfTable(void)
+{
+ shutdown_table_hrSWRunPerfTable();
+}
+
+extern oid hrSWRunTable_oid[];
+extern size_t hrSWRunTable_oid_len;
+static netsnmp_table_registration_info *table_info;
+
+/** Initialize the hrSWRunPerfTable table by defining its contents and how it's structured */
+void
+initialize_table_hrSWRunPerfTable(void)
+{
+ static oid hrSWRunPerfTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 25, 5, 1 };
+ size_t hrSWRunPerfTable_oid_len =
+ OID_LENGTH(hrSWRunPerfTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_mib_handler *handler = NULL;
+
+ reg =
+ netsnmp_create_handler_registration("hrSWRunPerfTable",
+ hrSWRunPerfTable_handler,
+ hrSWRunPerfTable_oid,
+ hrSWRunPerfTable_oid_len,
+ HANDLER_CAN_RONLY);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,"error creating handler registration for "
+ MYTABLE "\n");
+ goto bail;
+ }
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,"error allocating table registration for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: hrSWRunIndex */
+ 0);
+ table_info->min_column = COLUMN_HRSWRUNPERFCPU;
+ table_info->max_column = COLUMN_HRSWRUNPERFMEM;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, netsnmp_swrun_container(),
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,"error allocating table registration for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,"error injecting container_table handler for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+
+ handler = netsnmp_cache_handler_get(netsnmp_swrun_cache());
+ if (NULL == handler) {
+ snmp_log(LOG_ERR, "error creating cache handler for " MYTABLE "\n");
+ goto bail;
+ }
+
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,"error injecting cache handler for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it*/
+
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,"error registering table handler for "
+ MYTABLE "\n");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ goto bail;
+ }
+
+ return; /* ok */
+
+
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+void
+shutdown_table_hrSWRunPerfTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+/** handles requests for the hrSWRunPerfTable table */
+int
+hrSWRunPerfTable_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_swrun_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 = (netsnmp_swrun_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 "
+ MYTABLE "\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_HRSWRUNPERFCPU:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->hrSWRunPerfCPU);
+ break;
+ case COLUMN_HRSWRUNPERFMEM:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->hrSWRunPerfMem);
+ break;
+ default:
+ /*
+ * An unsupported/unreadable column (if applicable)
+ */
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_NOSUCHOBJECT, NULL, 0);
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/host/hrSWRunPerfTable.h b/agent/mibgroup/host/hrSWRunPerfTable.h
new file mode 100644
index 0000000..453fda3
--- /dev/null
+++ b/agent/mibgroup/host/hrSWRunPerfTable.h
@@ -0,0 +1,34 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.container.conf,v 1.8 2006/07/26 15:58:26 dts12 Exp $
+ */
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#ifndef HRSWRUNPERFTABLE_H
+#define HRSWRUNPERFTABLE_H
+
+config_require(host/hrSWRunTable)
+
+/*
+ * function declarations
+ */
+void init_hrSWRunPerfTable(void);
+void shutdown_hrSWRunPerfTable(void);
+void initialize_table_hrSWRunPerfTable(void);
+void shutdown_table_hrSWRunPerfTable(void);
+Netsnmp_Node_Handler hrSWRunPerfTable_handler;
+
+/*
+ * column number definitions for table hrSWRunPerfTable
+ */
+#define COLUMN_HRSWRUNPERFCPU 1
+#define COLUMN_HRSWRUNPERFMEM 2
+#endif /* HRSWRUNPERFTABLE_H */
diff --git a/agent/mibgroup/host/hrSWRunTable.c b/agent/mibgroup/host/hrSWRunTable.c
new file mode 100644
index 0000000..03ad256
--- /dev/null
+++ b/agent/mibgroup/host/hrSWRunTable.c
@@ -0,0 +1,350 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.container.conf,v 1.8 2006/07/26 15:58:26 dts12 Exp $
+ */
+/* 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 (C) 2007 Apple, 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/table_container.h>
+#include <net-snmp/data_access/swrun.h>
+#include <net-snmp/agent/cache_handler.h>
+#include "data_access/swrun.h"
+#include "hrSWRunTable.h"
+
+#include <signal.h>
+
+#define MYTABLE "hrSWRunTable"
+
+static netsnmp_table_registration_info *table_info;
+
+/** Initializes the hrSWRunTable module */
+void
+init_hrSWRunTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_hrSWRunTable();
+}
+
+void
+shutdown_hrSWRunTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+}
+
+oid hrSWRunTable_oid[] = { 1, 3, 6, 1, 2, 1, 25, 4, 2 };
+size_t hrSWRunTable_oid_len = OID_LENGTH(hrSWRunTable_oid);
+
+/** Initialize the hrSWRunTable table by defining its contents and how it's structured */
+void
+initialize_table_hrSWRunTable(void)
+{
+ netsnmp_handler_registration *reg;
+ netsnmp_mib_handler *handler = NULL;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#ifdef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
+# define SWRUN_ACCESS_LEVEL HANDLER_CAN_RWRITE
+#else
+# define SWRUN_ACCESS_LEVEL HANDLER_CAN_RONLY
+#endif
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+# define SWRUN_ACCESS_LEVEL HANDLER_CAN_RONLY
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ reg =
+ netsnmp_create_handler_registration(MYTABLE,
+ hrSWRunTable_handler,
+ hrSWRunTable_oid,
+ hrSWRunTable_oid_len,
+ SWRUN_ACCESS_LEVEL);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,"error creating handler registration for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ reg->modes |= HANDLER_CAN_NOT_CREATE;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,"error allocating table registration for "
+ MYTABLE "\n");
+ goto bail;
+ }
+
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: hrSWRunIndex */
+ 0);
+ table_info->min_column = COLUMN_HRSWRUNINDEX;
+ table_info->max_column = COLUMN_HRSWRUNSTATUS;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, netsnmp_swrun_container(),
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,"error allocating table registration for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,"error injecting container_table handler for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ handler = netsnmp_cache_handler_get(netsnmp_swrun_cache());
+ if (NULL == handler) {
+ snmp_log(LOG_ERR, "error creating cache handler for " MYTABLE "\n");
+ goto bail;
+ }
+
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,"error injecting cache handler for "
+ MYTABLE "\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it*/
+
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,"error registering table handler for "
+ MYTABLE "\n");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ goto bail;
+ }
+
+ return; /* ok */
+
+
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+
+}
+
+/** handles requests for the hrSWRunTable table */
+int
+hrSWRunTable_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_swrun_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 = (netsnmp_swrun_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 "
+ MYTABLE "\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_HRSWRUNINDEX:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->hrSWRunIndex);
+ break;
+ case COLUMN_HRSWRUNNAME:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) table_entry->
+ hrSWRunName,
+ table_entry->hrSWRunName_len);
+ break;
+ case COLUMN_HRSWRUNID:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+#ifdef NETSNMP_SWRUN_HAVE_ID
+ (u_char *) table_entry->hrSWRunID,
+ table_entry->hrSWRunID_len
+#else
+ (u_char *) &nullOid, nullOidLen
+#endif
+ );
+ break;
+ case COLUMN_HRSWRUNPATH:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) table_entry->
+ hrSWRunPath,
+ table_entry->hrSWRunPath_len);
+ break;
+ case COLUMN_HRSWRUNPARAMETERS:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) table_entry->
+ hrSWRunParameters,
+ table_entry->
+ hrSWRunParameters_len);
+ break;
+ case COLUMN_HRSWRUNTYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->hrSWRunType);
+ break;
+ case COLUMN_HRSWRUNSTATUS:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->hrSWRunStatus);
+ break;
+ default:
+ /*
+ * An unsupported/unreadable column (if applicable)
+ */
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_NOSUCHOBJECT, NULL, 0);
+ }
+ }
+ break;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#ifdef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ int pid;
+ if (request->processed)
+ continue;
+ table_entry = (netsnmp_swrun_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 "
+ MYTABLE "\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_HRSWRUNSTATUS:
+ if (*request->requestvb->val.integer != HRSWRUNSTATUS_INVALID) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ pid = request->requestvb->name[request->requestvb->name_length-1];
+ if (1 == pid) {
+ snmp_log(LOG_WARNING,"refusing to kill pid 1\n");
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOACCESS);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (netsnmp_swrun_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 "
+ MYTABLE "\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_HRSWRUNSTATUS:
+ table_entry->old_hrSWRunStatus =
+ table_entry->hrSWRunStatus;
+ table_entry->hrSWRunStatus =
+ *request->requestvb->val.integer;
+ break;
+ }
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ container = netsnmp_container_table_extract_context(request);
+ table_entry = (netsnmp_swrun_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 "
+ MYTABLE "\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_HRSWRUNSTATUS:
+ table_entry->hrSWRunStatus =
+ table_entry->old_hrSWRunStatus;
+ table_entry->old_hrSWRunStatus = 0;
+ break;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ for (request = requests; request; request = request->next) {
+ int pid;
+ if (request->processed)
+ continue;
+ pid = request->requestvb->name[request->requestvb->name_length-1];
+ DEBUGMSGTL(("hrSWRunTable:commit", "kill(%d,TERM)\n", pid));
+ kill(pid, SIGTERM);
+ }
+ break;
+#endif /* NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT */
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/agent/mibgroup/host/hrSWRunTable.h b/agent/mibgroup/host/hrSWRunTable.h
new file mode 100644
index 0000000..de80fc0
--- /dev/null
+++ b/agent/mibgroup/host/hrSWRunTable.h
@@ -0,0 +1,39 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.container.conf,v 1.8 2006/07/26 15:58:26 dts12 Exp $
+ */
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#ifndef HRSWRUNTABLE_H
+#define HRSWRUNTABLE_H
+
+config_require(host/data_access/swrun)
+config_require(host/hrSWRunPerfTable)
+
+/*
+ * function declarations
+ */
+void init_hrSWRunTable(void);
+void shutdown_hrSWRunTable(void);
+void initialize_table_hrSWRunTable(void);
+Netsnmp_Node_Handler hrSWRunTable_handler;
+
+/*
+ * column number definitions for table hrSWRunTable
+ */
+#define COLUMN_HRSWRUNINDEX 1
+#define COLUMN_HRSWRUNNAME 2
+#define COLUMN_HRSWRUNID 3
+#define COLUMN_HRSWRUNPATH 4
+#define COLUMN_HRSWRUNPARAMETERS 5
+#define COLUMN_HRSWRUNTYPE 6
+#define COLUMN_HRSWRUNSTATUS 7
+#endif /* HRSWRUNTABLE_H */
diff --git a/agent/mibgroup/host/hr_device.c b/agent/mibgroup/host/hr_device.c
new file mode 100644
index 0000000..24031bf
--- /dev/null
+++ b/agent/mibgroup/host/hr_device.c
@@ -0,0 +1,355 @@
+/*
+ * 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, NETSNMP_OLDAPI_RONLY,
+ var_hrdevice, 2, {1, 1}},
+ {HRDEV_TYPE, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_hrdevice, 2, {1, 2}},
+ {HRDEV_DESCR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrdevice, 2, {1, 3}},
+ {HRDEV_ID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_hrdevice, 2, {1, 4}},
+ {HRDEV_STATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrdevice, 2, {1, 5}},
+ {HRDEV_ERRORS, ASN_COUNTER, NETSNMP_OLDAPI_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 = (WriteMethod*)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))))) {
+ strlcpy(string, tmp_str, sizeof(string));
+ } 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/agent/mibgroup/host/hr_device.h b/agent/mibgroup/host/hr_device.h
new file mode 100644
index 0000000..0e29489
--- /dev/null
+++ b/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/agent/mibgroup/host/hr_disk.c b/agent/mibgroup/host/hr_disk.c
new file mode 100644
index 0000000..679264b
--- /dev/null
+++ b/agent/mibgroup/host/hr_disk.c
@@ -0,0 +1,1426 @@
+/*
+ * Host Resources MIB - disk device group implementation - hr_disk.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 (C) 2007 Apple, 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 "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 defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
+#include <regex.h>
+#endif
+
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifdef darwin
+#include <CoreFoundation/CoreFoundation.h>
+#include <IOKit/IOKitLib.h>
+#include <IOKit/storage/IOBlockStorageDriver.h>
+#include <IOKit/storage/IOMedia.h>
+#include <IOKit/IOBSD.h>
+#include <DiskArbitration/DADisk.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
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * hrDiskStorageAccess (INTEGER / ASN_INTEGER)
+ */
+#define HRDISKSTORAGEACCESS_READWRITE 1
+#define HRDISKSTORAGEACCESS_READONLY 2
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * hrDiskStorageMedia (INTEGER / ASN_INTEGER)
+ */
+#define HRDISKSTORAGEMEDIA_OTHER 1
+#define HRDISKSTORAGEMEDIA_UNKNOWN 2
+#define HRDISKSTORAGEMEDIA_HARDDISK 3
+#define HRDISKSTORAGEMEDIA_FLOPPYDISK 4
+#define HRDISKSTORAGEMEDIA_OPTICALDISKROM 5
+#define HRDISKSTORAGEMEDIA_OPTICALDISKWORM 6
+#define HRDISKSTORAGEMEDIA_OPTICALDISKRW 7
+#define HRDISKSTORAGEMEDIA_RAMDISK 8
+
+ /*********************
+ *
+ * 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
+
+#ifdef darwin
+static int64_t HRD_cap;
+static int HRD_access;
+static int HRD_type;
+static int HRD_removeble;
+static char HRD_model[40];
+static int HRD_saved_access;
+static int HRD_saved_type;
+static int HRD_saved_removeble;
+static int _get_type_from_protocol( const char *prot );
+static int _get_type_value( const char *str_type );
+#endif
+
+static void parse_disk_config(const char *, char *);
+static void free_disk_config(void);
+
+#ifdef linux
+static void Add_LVM_Disks(void);
+static void Remove_LVM_Disks(void);
+#endif
+
+ /*********************
+ *
+ * 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, NETSNMP_OLDAPI_RONLY,
+ var_hrdisk, 2, {1, 1}},
+ {HRDISK_MEDIA, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrdisk, 2, {1, 2}},
+ {HRDISK_REMOVEABLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrdisk, 2, {1, 3}},
+ {HRDISK_CAPACITY, ASN_INTEGER, NETSNMP_OLDAPI_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);
+
+ Add_LVM_Disks();
+
+#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(darwin)
+ Add_HR_Disk_entry("/dev/disk%ds%d", -1, -1, 0, 32, "/dev/disk%d", 1, 32);
+#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");
+}
+
+void
+shutdown_hr_disk(void)
+{
+#ifdef linux
+ Remove_LVM_Disks();
+#endif
+}
+
+#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 = NULL;
+ conf_disk_item *di_curr = NULL;
+ details_set *d_set = NULL;
+ char *name = NULL, *p = NULL, *d_str = NULL, c;
+ unsigned int i, neg, c1, c2;
+ char *st = NULL;
+
+ 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 *) calloc(sizeof(details_set), 1);
+ 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;
+ }
+ 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();
+ DEBUGMSGTL(("host/hr_disk", "... index %d\n", disk_idx));
+ 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 = (WriteMethod*)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[PATH_MAX+1];
+ int fd, result;
+ int iindex;
+ int max_disks;
+ time_t now;
+
+ HRD_index++;
+ 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 if (disk_devices[HRD_type_index].disk_device_first == disk_devices[HRD_type_index].disk_device_last) {
+ /* exact device name */
+ snprintf(string, sizeof(string)-1, "%s", disk_devices[HRD_type_index].disk_devfull_string);
+ } 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);
+ }
+ DEBUGMSGTL(("host/hr_disk",
+ "Get_Next_HR_Disk: can't query %s\n", string));
+ }
+ else {
+ DEBUGMSGTL(("host/hr_disk",
+ "Get_Next_HR_Disk: can't open %s\n", string));
+ }
+ 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;
+}
+
+#ifdef darwin
+int
+Get_HR_Disk_Label(char *string, size_t str_len, const char *devfull)
+{
+ DASessionRef sess_ref;
+ DADiskRef disk;
+ CFDictionaryRef desc;
+ CFStringRef str_ref;
+ CFStringEncoding sys_encoding = CFStringGetSystemEncoding();
+
+ DEBUGMSGTL(("host/hr_disk", "Disk Label type %s\n", devfull));
+
+ sess_ref = DASessionCreate( NULL );
+ if (NULL == sess_ref) {
+ strlcpy(string, devfull, str_len);
+ return -1;
+ }
+
+ disk = DADiskCreateFromBSDName( NULL, sess_ref, devfull );
+ if (NULL == disk) {
+ CFRelease(sess_ref);
+ strlcpy(string, devfull, str_len);
+ return -1;
+ }
+
+ desc = DADiskCopyDescription( disk );
+ if (NULL == desc) {
+ snmp_log(LOG_ERR,
+ "diskmgr: couldn't get disk description for %s, skipping\n",
+ devfull);
+ CFRelease(disk);
+ CFRelease(sess_ref);
+ strlcpy(string, devfull, str_len);
+ return -1;
+ }
+
+ /** model */
+ str_ref = (CFStringRef)
+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaNameKey);
+ if (str_ref) {
+ strlcpy(string, CFStringGetCStringPtr(str_ref, sys_encoding),
+ str_len);
+ DEBUGMSGTL(("verbose:diskmgr:darwin", " name %s\n", string));
+ }
+ else {
+ strlcpy(string, devfull, str_len);
+ }
+
+ CFRelease(disk);
+ CFRelease(desc);
+ CFRelease(sess_ref);
+
+ return 0;
+}
+#endif
+
+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
+#ifdef darwin
+ HRD_savedCapacity = HRD_cap / 1024;
+ HRD_saved_access = HRD_access;
+ HRD_saved_type = HRD_type;
+ HRD_saved_removeble = HRD_removeble;
+#endif
+
+}
+
+static void
+Save_HR_Disk_General(void)
+{
+#ifdef DIOC_DESCRIBE
+ strlcpy(HRD_savedModel, HRD_info.model_num, sizeof(HRD_savedModel));
+#endif
+#ifdef DKIOCINFO
+ strlcpy(HRD_savedModel, HRD_info.dki_dname, sizeof(HRD_savedModel));
+#endif
+#ifdef HAVE_LINUX_HDREG_H
+ strlcpy(HRD_savedModel, (const char *) HRD_info.model,
+ sizeof(HRD_savedModel));
+#endif
+#ifdef DIOCGDINFO
+ strlcpy(HRD_savedModel, dktypenames[HRD_info.d_type],
+ sizeof(HRD_savedModel));
+#endif
+#ifdef darwin
+ strlcpy(HRD_savedModel, HRD_model, sizeof(HRD_savedModel));
+#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 != 3) { /* SCSI hard disk, md and LVM 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( (char *) HRD_info.model, sizeof(HRD_info.model)-1,
+ "SCSI disk (%s)", devfull);
+ else if (HRD_type_index >= 4)
+ snprintf( (char *) HRD_info.model, sizeof(HRD_info.model)-1,
+ "LVM volume (%s)", devfull + strlen("/dev/mapper/"));
+ else
+ snprintf( (char *) 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
+
+#ifdef darwin
+ DASessionRef sess_ref;
+ DADiskRef disk;
+ CFDictionaryRef desc;
+ CFStringRef str_ref;
+ CFNumberRef number_ref;
+ CFBooleanRef bool_ref;
+ CFStringEncoding sys_encoding = CFStringGetSystemEncoding();
+
+ sess_ref = DASessionCreate( NULL );
+ if (NULL == sess_ref)
+ return -1;
+
+ disk = DADiskCreateFromBSDName( NULL, sess_ref, devfull );
+ if (NULL == disk) {
+ CFRelease(sess_ref);
+ return -1;
+ }
+
+ desc = DADiskCopyDescription( disk );
+ if (NULL == desc) {
+ CFRelease(disk);
+ CFRelease(sess_ref);
+ return -1;
+ }
+
+ number_ref = (CFNumberRef)
+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaSizeKey);
+ if (number_ref)
+ CFNumberGetValue(number_ref, kCFNumberSInt64Type, &HRD_cap);
+ else
+ HRD_cap = 0;
+ DEBUGMSGTL(("verbose:diskmgr:darwin", " size %lld\n", HRD_cap));
+
+ /** writable? */
+ bool_ref = (CFBooleanRef)
+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaWritableKey);
+ if (bool_ref) {
+ HRD_access = CFBooleanGetValue(bool_ref);
+ }
+ else
+ HRD_access = 0;
+ DEBUGMSGTL(("verbose:diskmgr:darwin", " writable %d\n",
+ HRD_access));
+
+ /** removable? */
+ bool_ref = (CFBooleanRef)
+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaRemovableKey);
+ if (bool_ref) {
+ HRD_removeble = CFBooleanGetValue(bool_ref);
+ }
+ else
+ HRD_removeble = 0;
+ DEBUGMSGTL(("verbose:diskmgr:darwin", " removable %d\n",
+ HRD_removeble));
+
+ /** get type */
+ str_ref = (CFStringRef)
+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaTypeKey);
+ if (str_ref) {
+ HRD_type = _get_type_value(CFStringGetCStringPtr(str_ref,
+ sys_encoding));
+ DEBUGMSGTL(("verbose:diskmgr:darwin", " type %s / %d\n",
+ CFStringGetCStringPtr(str_ref, sys_encoding),
+ HRD_type));
+ }
+ else {
+ str_ref = (CFStringRef)
+ CFDictionaryGetValue(desc, kDADiskDescriptionDeviceProtocolKey);
+ if (str_ref) {
+ HRD_type =
+ _get_type_from_protocol(CFStringGetCStringPtr(str_ref,
+ sys_encoding));
+ DEBUGMSGTL(("verbose:diskmgr:darwin", " type %s / %d\n",
+ CFStringGetCStringPtr(str_ref, sys_encoding),
+ HRD_type));
+ }
+ else
+ HRD_type = HRDISKSTORAGEMEDIA_UNKNOWN;
+ }
+
+ /** model */
+ str_ref = (CFStringRef)
+ CFDictionaryGetValue(desc, kDADiskDescriptionDeviceModelKey);
+ if (str_ref) {
+ strlcpy(HRD_model, CFStringGetCStringPtr(str_ref, sys_encoding),
+ sizeof(HRD_model));
+ DEBUGMSGTL(("verbose:diskmgr:darwin", " model %s\n", HRD_model));
+ }
+ else
+ HRD_model[0] = 0;
+ CFRelease(disk);
+ CFRelease(desc);
+ CFRelease(sess_ref);
+ result = 0;
+#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
+
+#ifdef darwin
+ if (!HRD_access)
+ return (2);
+#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
+
+#ifdef darwin
+ return HRD_type;
+#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
+
+#ifdef darwin
+ if (HRD_removeble)
+ return (1);
+#endif
+
+ return (2); /* false */
+}
+
+#ifdef darwin
+typedef struct type_value_map_s {
+ const char *type;
+ uint32_t value;
+} type_value_map;
+
+static type_value_map media_type_map[] = {
+ { "CD-ROM", HRDISKSTORAGEMEDIA_OPTICALDISKROM},
+ { "DVD-R", HRDISKSTORAGEMEDIA_OPTICALDISKWORM},
+ { "DVD+R", HRDISKSTORAGEMEDIA_OPTICALDISKWORM},
+};
+static int media_types = sizeof(media_type_map)/sizeof(media_type_map[0]);
+
+static int
+_get_type_value( const char *str_type )
+{
+ int i, len;
+
+ if (NULL == str_type)
+ return HRDISKSTORAGEMEDIA_UNKNOWN;
+
+ len = strlen(str_type);
+ for(i=0; i < media_types; ++i) {
+ if (0 == strcmp(media_type_map[i].type, str_type))
+ return media_type_map[i].value;
+ }
+
+ return HRDISKSTORAGEMEDIA_UNKNOWN;
+}
+
+static type_value_map proto_map[] = {
+ { "ATA", HRDISKSTORAGEMEDIA_HARDDISK},
+ { "ATAPI", HRDISKSTORAGEMEDIA_OPTICALDISKROM}
+};
+static int proto_maps = sizeof(proto_map)/sizeof(proto_map[0]);
+
+static int _get_type_from_protocol( const char *prot )
+{
+ int i, len;
+
+ if (NULL == prot)
+ return TV_FALSE;
+
+ len = strlen(prot);
+ for(i=0; i < proto_maps; ++i) {
+ if (0 == strcmp(proto_map[i].type, prot))
+ return proto_map[i].value;
+ }
+
+ return HRDISKSTORAGEMEDIA_UNKNOWN;
+}
+#endif
+
+
+#ifdef linux
+#if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
+static char *lvm_device_names[MAX_NUMBER_DISK_TYPES];
+static int lvm_device_count;
+#endif
+
+static void
+Add_LVM_Disks(void)
+{
+#if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
+ /*
+ * LVM devices are harder because their name can be almost anything (see
+ * regexp below). Each logical volume is interpreted as its own device with
+ * one partition, even if two logical volumes share common volume group.
+ */
+ regex_t lvol;
+ int res;
+ DIR *dir;
+ struct dirent *d;
+
+ res =
+ regcomp(&lvol, "[0-9a-zA-Z+_\\.-]+-[0-9a-zA-Z+_\\.-]+",
+ REG_EXTENDED | REG_NOSUB);
+ if (res != 0) {
+ char error[200];
+ regerror(res, &lvol, error, sizeof(error)-1);
+ DEBUGMSGTL(("host/hr_disk",
+ "Add_LVM_Disks: cannot compile regexp: %s", error));
+ return;
+ }
+
+ dir = opendir("/dev/mapper/");
+ if (dir == NULL) {
+ DEBUGMSGTL(("host/hr_disk",
+ "Add_LVM_Disks: cannot open /dev/mapper"));
+ regfree(&lvol);
+ return;
+ }
+
+ while ((d = readdir(dir)) != NULL) {
+ res = regexec(&lvol, d->d_name, 0, NULL, 0);
+ if (res == 0) {
+ char *path = (char*)malloc(PATH_MAX + 1);
+ if (path == NULL) {
+ DEBUGMSGTL(("host/hr_disk",
+ "Add_LVM_Disks: cannot allocate memory for device %s",
+ d->d_name));
+ break;
+ }
+ snprintf(path, PATH_MAX-1, "/dev/mapper/%s", d->d_name);
+ Add_HR_Disk_entry(path, -1, -1, 0, 0, path, 0, 0);
+
+ /*
+ * store the device name so we can free it in Remove_LVM_Disks
+ */
+ lvm_device_names[lvm_device_count] = path;
+ ++lvm_device_count;
+ if (lvm_device_count >= MAX_NUMBER_DISK_TYPES) {
+ DEBUGMSGTL(("host/hr_disk",
+ "Add_LVM_Disks: maximum count of LVM devices reached"));
+ break;
+ }
+ }
+ }
+ closedir(dir);
+ regfree(&lvol);
+#endif
+}
+
+static void
+Remove_LVM_Disks(void)
+{
+#if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
+ /*
+ * just free the device names allocated in add_lvm_disks
+ */
+ int i;
+ for (i = 0; i < lvm_device_count; i++) {
+ free(lvm_device_names[i]);
+ lvm_device_names[i] = NULL;
+ }
+ lvm_device_count = 0;
+#endif
+}
+#endif
diff --git a/agent/mibgroup/host/hr_disk.h b/agent/mibgroup/host/hr_disk.h
new file mode 100644
index 0000000..b3c439c
--- /dev/null
+++ b/agent/mibgroup/host/hr_disk.h
@@ -0,0 +1,19 @@
+/*
+ * 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 shutdown_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/agent/mibgroup/host/hr_filesys.c b/agent/mibgroup/host/hr_filesys.c
new file mode 100644
index 0000000..b23d322
--- /dev/null
+++ b/agent/mibgroup/host/hr_filesys.c
@@ -0,0 +1,1009 @@
+/*
+ * Host Resources MIB - File System device group implementation - hr_filesys.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 (C) 2007 Apple, 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-features.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 "hr_disk.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 HAVE_NBUTIL_H
+#include <nbutil.h>
+#endif
+
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+#include <sys/mntctl.h>
+#include <sys/vmount.h>
+#include <sys/statfs.h>
+#endif
+
+netsnmp_feature_require(se_find_free_value_in_slist)
+netsnmp_feature_require(date_n_time)
+netsnmp_feature_require(ctime_to_timet)
+
+#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__)
+
+#if !defined(MFSNAMELEN) && defined(_VFS_NAMELEN)
+#define MFSNAMELEN _VFS_NAMELEN
+#endif
+
+#define getfsstat getvfsstat
+
+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) && !defined(HAVE_STATFS) && defined(HAVE_STATVFS)
+
+static struct statfs *fsstats = NULL;
+struct statfs *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) || defined(aix7)
+
+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, NETSNMP_OLDAPI_RONLY,
+ var_hrfilesys, 2, {1, 1}},
+ {HRFSYS_MOUNT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrfilesys, 2, {1, 2}},
+ {HRFSYS_RMOUNT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrfilesys, 2, {1, 3}},
+ {HRFSYS_TYPE, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_hrfilesys, 2, {1, 4}},
+ {HRFSYS_ACCESS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrfilesys, 2, {1, 5}},
+ {HRFSYS_BOOT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrfilesys, 2, {1, 6}},
+ {HRFSYS_STOREIDX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrfilesys, 2, {1, 7}},
+ {HRFSYS_FULLDUMP, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrfilesys, 2, {1, 8}},
+ {HRFSYS_PARTDUMP, ASN_OCTET_STR, NETSNMP_OLDAPI_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) || defined(aix7)
+ /* 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 = (WriteMethod*)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:
+ strlcpy(string, HRFS_entry->HRFS_mount, sizeof(string));
+ *var_len = strlen(string);
+ return (u_char *) string;
+ case HRFSYS_RMOUNT:
+ if (Check_HR_FileSys_NFS())
+ strlcpy(string, HRFS_entry->HRFS_name, sizeof(string));
+ 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) || defined(aix7)
+ 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)
+#if HAVE_STRUCT_STATFS_F_FLAGS
+ long_return = HRFS_entry->f_flags & MNT_RDONLY ? 2 : 1;
+#else
+ long_return = HRFS_entry->f_flag & MNT_RDONLY ? 2 : 1;
+#endif
+#elif defined(cygwin)
+ long_return = 1;
+#elif defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ 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) || defined(aix7)
+ 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) {
+ netsnmp_config_error("Can't open mnttab %s\n", ETC_MNTTAB);
+ }
+#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
+ NULL
+};
+
+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) || defined(aix7)
+ 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 */
+
+ for (cpp = HRFS_ignores; *cpp != NULL; ++cpp)
+ if (!strcmp(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) || defined(aix7)
+ 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) || defined(aix7)
+ 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 & 0xFF))
+ ++cp2; /* Now find the dump level */
+
+ if (level == FULL_DUMP) {
+ if (*(cp2++) != '0')
+ continue; /* Not interested in partial dumps */
+ while (isspace(*cp2 & 0xFF))
+ ++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 & 0xFF))
+ ++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))) {
+ strlcpy(cooked_dev, COOKED_DEVICE_PREFIX, sizeof(cooked_dev));
+ strlcat(cooked_dev, dev + strlen(RAW_DEVICE_PREFIX),
+ sizeof(cooked_dev));
+ } else {
+ strlcpy(cooked_dev, dev, sizeof(cooked_dev));
+ }
+
+ 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(HAVE_STRUCT_STATVFS_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/agent/mibgroup/host/hr_filesys.h b/agent/mibgroup/host/hr_filesys.h
new file mode 100644
index 0000000..2f00355
--- /dev/null
+++ b/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/agent/mibgroup/host/hr_network.c b/agent/mibgroup/host/hr_network.c
new file mode 100644
index 0000000..6cce58c
--- /dev/null
+++ b/agent/mibgroup/host/hr_network.c
@@ -0,0 +1,310 @@
+/*
+ * Host Resources MIB - network device group implementation - hr_network.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+#if !defined( solaris2 )
+netsnmp_feature_require(interface_legacy)
+#endif /* !solaris2 */
+
+ /*********************
+ *
+ * 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, NETSNMP_OLDAPI_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 = (WriteMethod*)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_NextInt(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_NextInt(a, b, c)
+#elif defined darwin
+static char HRN_name[IFNAMSIZ];
+static struct if_msghdr HRN_ifnet;
+#define M_Interface_Scan_Next(a, b, c, d) Interface_Scan_NextInt(a, b, c, d)
+#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_NextInt(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)
+{
+int HRN_index;
+#if !(defined(solaris2) || defined(darwin) || 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;
+
+ /*
+ * If the index is greater than the shift registry space,
+ * this will overrun into the next device type block,
+ * potentially resulting in duplicate index values
+ * which may cause the agent to crash.
+ * To avoid this, we silently drop interfaces greater
+ * than the shift registry size can handle.
+ */
+ if (HRN_index > (1 << HRDEV_TYPE_SHIFT ))
+ return -1;
+
+ 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;
+#elif defined(__APPLE__) /* or darwin? */
+ HRN_savedFlags = HRN_ifnet.ifm_flags;
+ HRN_savedErrors = HRN_ifnet.ifm_data.ifi_ierrors +
+ HRN_ifnet.ifm_data.ifi_oerrors;
+#elif !defined(WIN32)
+ HRN_savedFlags = HRN_ifnet.if_flags;
+ HRN_savedErrors = HRN_ifnet.if_ierrors + HRN_ifnet.if_oerrors;
+#endif
+}
+
+
+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/agent/mibgroup/host/hr_network.h b/agent/mibgroup/host/hr_network.h
new file mode 100644
index 0000000..d7bcb48
--- /dev/null
+++ b/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/agent/mibgroup/host/hr_other.c b/agent/mibgroup/host/hr_other.c
new file mode 100644
index 0000000..9e4b16a
--- /dev/null
+++ b/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/agent/mibgroup/host/hr_other.h b/agent/mibgroup/host/hr_other.h
new file mode 100644
index 0000000..c1865d1
--- /dev/null
+++ b/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/agent/mibgroup/host/hr_partition.c b/agent/mibgroup/host/hr_partition.c
new file mode 100644
index 0000000..abe7692
--- /dev/null
+++ b/agent/mibgroup/host/hr_partition.c
@@ -0,0 +1,342 @@
+/*
+ * Host Resources MIB - partition device group implementation - hr_partition.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 (C) 2007 Apple, 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 <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];
+#ifdef NETSNMP_CAN_GET_DISK_LABEL
+static char HRP_savedLabel[1024];
+#endif
+
+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, NETSNMP_OLDAPI_RONLY,
+ var_hrpartition, 2, {1, 1}},
+ {HRPART_LABEL, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrpartition, 2, {1, 2}},
+ {HRPART_ID, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrpartition, 2, {1, 3}},
+ {HRPART_SIZE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrpartition, 2, {1, 4}},
+ {HRPART_FSIDX, ASN_INTEGER, NETSNMP_OLDAPI_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));
+
+ DEBUGMSGTL(("host/hr_partition", "... low index %d\n", LowDiskIndex));
+ 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();
+ DEBUGMSGTL(("host/hr_partition", "... part index %d\n", part_idx));
+ 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 = (WriteMethod*)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:
+#ifdef NETSNMP_CAN_GET_DISK_LABEL
+ *var_len = strlen(HRP_savedLabel);
+ return (u_char *) HRP_savedLabel;
+#else
+ *var_len = strlen(HRP_savedName);
+ return (u_char *) HRP_savedName;
+#endif
+ 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)
+{
+ DEBUGMSGTL(("host/hr_partition", "Init_HR_Partition\n"));
+ HRP_DiskIndex = Get_Next_HR_Disk();
+ if (HRP_DiskIndex != -1)
+ HRP_DiskIndex &= ((1 << HRDEV_TYPE_SHIFT) - 1);
+ DEBUGMSGTL(("host/hr_partition", "... %d\n",HRP_DiskIndex));
+
+ HRP_index = -1;
+}
+
+static int
+Get_Next_HR_Partition(void)
+{
+ char string[1024];
+ int fd;
+
+ DEBUGMSGTL(("host/hr_partition", "Get_Next_HR_Partition %d\n",HRP_DiskIndex));
+ 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);
+#ifdef NETSNMP_CAN_GET_DISK_LABEL
+ (void) Get_HR_Disk_Label(HRP_savedLabel, sizeof(HRP_savedLabel), HRP_savedName);
+#endif
+}
diff --git a/agent/mibgroup/host/hr_partition.h b/agent/mibgroup/host/hr_partition.h
new file mode 100644
index 0000000..c4992dd
--- /dev/null
+++ b/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/agent/mibgroup/host/hr_print.c b/agent/mibgroup/host/hr_print.c
new file mode 100644
index 0000000..e7660ff
--- /dev/null
+++ b/agent/mibgroup/host/hr_print.c
@@ -0,0 +1,368 @@
+/*
+ * 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, NETSNMP_OLDAPI_RONLY,
+ var_hrprint, 2, {1, 1}},
+ {HRPRINT_ERROR, ASN_OCTET_STR, NETSNMP_OLDAPI_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 = (WriteMethod*)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;
+#else
+ long_return = 0; /* Null string */
+ return (u_char *) & long_return;
+#endif
+ 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/agent/mibgroup/host/hr_print.h b/agent/mibgroup/host/hr_print.h
new file mode 100644
index 0000000..7acee8d
--- /dev/null
+++ b/agent/mibgroup/host/hr_print.h
@@ -0,0 +1,15 @@
+/*
+ * Host Resources MIB - printer device group interface - hr_print.h
+ *
+ */
+#ifndef _MIBGROUP_HRPRINT_H
+#define _MIBGROUP_HRPRINT_H
+
+config_require(host/hr_device)
+config_require(util_funcs)
+
+extern void init_hr_print(void);
+extern FindVarMethod var_hrprint;
+
+
+#endif /* _MIBGROUP_HRPRINT_H */
diff --git a/agent/mibgroup/host/hr_proc.c b/agent/mibgroup/host/hr_proc.c
new file mode 100644
index 0000000..6f93079
--- /dev/null
+++ b/agent/mibgroup/host/hr_proc.c
@@ -0,0 +1,233 @@
+/*
+ * 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, NETSNMP_OLDAPI_RONLY,
+ var_hrproc, 2, {1, 1}},
+ {HRPROC_LOAD, ASN_INTEGER, NETSNMP_OLDAPI_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 = (WriteMethod*)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;
+ unsigned long long value;
+ 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 ||
+ ( cpu->history[0].total_hist == cpu->total_ticks ))
+ return NULL;
+
+ value = (cpu->idle_ticks - cpu->history[0].idle_hist)*100;
+ value /= (cpu->total_ticks - cpu->history[0].total_hist);
+ long_return = 100 - value;
+ 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/agent/mibgroup/host/hr_proc.h b/agent/mibgroup/host/hr_proc.h
new file mode 100644
index 0000000..1e4a926
--- /dev/null
+++ b/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/agent/mibgroup/host/hr_storage.c b/agent/mibgroup/host/hr_storage.c
new file mode 100644
index 0000000..264fecc
--- /dev/null
+++ b/agent/mibgroup/host/hr_storage.c
@@ -0,0 +1,793 @@
+/*
+ * 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 HAVE_STRUCT_STATVFS_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
+# include <sys/time.h>
+# 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) || defined(aix7)) && HAVE_LIBPERFSTAT_H
+#ifdef HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#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
+#if HAVE_NBUTIL_H
+#include <nbutil.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 HAVE_STRUCT_STATVFS_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 HAVE_STRUCT_STATVFS_F_FRSIZE
+
+#elif defined(HAVE_STATVFS) && defined(HAVE_STRUCT_STATVFS_MNT_DIR)
+
+extern struct mntent *HRFS_entry;
+extern int fscount;
+#define HRFS_statfs statvfs
+#define HRFS_mount mnt_dir
+#define HRFS_HAS_FRSIZE HAVE_STRUCT_STATVFS_F_FRSIZE
+
+#elif defined(HAVE_GETFSSTAT) && !defined(HAVE_STATFS) && defined(HAVE_STATVFS)
+
+extern struct statfs *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_GETFSSTAT)
+
+extern struct statfs *HRFS_entry;
+extern int fscount;
+#define HRFS_statfs statfs
+#define HRFS_mount f_mntonname
+#define HRFS_HAS_FRSIZE HAVE_STRUCT_STATFS_F_FRSIZE
+
+#else
+
+extern struct mntent *HRFS_entry;
+#define HRFS_mount mnt_dir
+#define HRFS_statfs statfs
+#define HRFS_HAS_FRSIZE HAVE_STRUCT_STATFS_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 **);
+Netsnmp_Node_Handler handle_memsize;
+
+#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 variable2 hrstore_variables[] = {
+ {HRSTORE_INDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {1}},
+ {HRSTORE_TYPE, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {2}},
+ {HRSTORE_DESCR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {3}},
+ {HRSTORE_UNITS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {4}},
+ {HRSTORE_SIZE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {5}},
+ {HRSTORE_USED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {6}},
+ {HRSTORE_FAILS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {7}}
+};
+oid hrstore_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 2 };
+oid hrMemorySize_oid[] = { 1, 3, 6, 1, 2, 1, 25, 2, 2 };
+oid hrStorageTable_oid[] = { 1, 3, 6, 1, 2, 1, 25, 2, 3, 1 };
+
+
+void
+init_hr_storage(void)
+{
+ char *appname;
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("host/hrMemorySize", handle_memsize,
+ hrMemorySize_oid, OID_LENGTH(hrMemorySize_oid),
+ HANDLER_CAN_RONLY));
+ REGISTER_MIB("host/hr_storage", hrstore_variables, variable2,
+ hrStorageTable_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_hrstoreEntry(...
+ * 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
+ *
+ */
+
+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 = (WriteMethod*)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", " (%p)\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
+ *
+ *********************/
+
+int
+handle_memsize(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_memory_info *mem_info;
+ int val;
+
+ /*
+ * 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();
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 0 );
+ if ( !mem_info || mem_info->size == -1 || mem_info->units == -1 )
+ netsnmp_set_request_error( reqinfo, requests, SNMP_NOSUCHOBJECT );
+ else {
+ val = mem_info->size; /* memtotal */
+ val *= (mem_info->units/1024);
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *)&val, sizeof(val));
+ }
+ return SNMP_ERR_NOERROR;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_memsize\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+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;
+
+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 (store_idx > NETSNMP_MEM_TYPE_MAX ) {
+ if ( netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
+ Check_HR_FileSys_NFS())
+ return NULL; /* or goto try_next; */
+ 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_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 && !(defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7))
+ /*
+ * hasmntopt takes "const struct mntent*", but HRFS_entry has been
+ * defined differently for AIX, so skip this for AIX
+ */
+ 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) {
+ strlcpy(string, HRFS_entry->HRFS_mount, sizeof(string));
+ *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 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/agent/mibgroup/host/hr_storage.h b/agent/mibgroup/host/hr_storage.h
new file mode 100644
index 0000000..2007c32
--- /dev/null
+++ b/agent/mibgroup/host/hr_storage.h
@@ -0,0 +1,43 @@
+/*
+ * Host Resources MIB - storage group interface - hr_storage.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/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c
new file mode 100644
index 0000000..4aa4593
--- /dev/null
+++ b/agent/mibgroup/host/hr_swinst.c
@@ -0,0 +1,736 @@
+/*
+ * Host Resources MIB - Installed Software group implementation - hr_swinst.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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_RPM_RPMFILEUTIL_H
+#include <rpm/rpmfileutil.h>
+#endif
+
+#ifdef HAVE_RPMGETPATH
+#include <rpm/rpmmacro.h>
+#endif
+
+#ifdef HAVE_RPM_RPMTS_H
+#include <rpm/rpmts.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
+
+netsnmp_feature_require(date_n_time)
+
+ /*********************
+ *
+ * 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 */
+ rpmts swi_rpmts;
+ 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 **);
+
+#define starttime (*(const struct timeval*)netsnmp_get_agent_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 int 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, NETSNMP_OLDAPI_RONLY,
+ var_hrswinst, 1, {1}},
+ {HRSWINST_UPDATE, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_hrswinst, 1, {2}},
+ {HRSWINST_INDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrswinst, 3, {3, 1, 1}},
+ {HRSWINST_NAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrswinst, 3, {3, 1, 2}},
+ {HRSWINST_ID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_hrswinst, 3, {3, 1, 3}},
+ {HRSWINST_TYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrswinst, 3, {3, 1, 4}},
+ {HRSWINST_DATE, ASN_OCTET_STR, NETSNMP_OLDAPI_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
+#if defined(linux) && !defined(HAVE_LIBRPM)
+#define _PATH_HRSW_directory "/var/cache/hrmib"
+#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
+ swi->swi_dbpath = "/var/lib/rpm"; /* Most likely */
+#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 = (WriteMethod*)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;
+ int err = 0, errcount = 0;
+
+ 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
+ */
+
+ do {
+ 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;
+ err = Save_HR_SW_info(LowIndex);
+ break;
+ }
+ if ((!exact && (result < 0)) &&
+ (LowIndex == -1 || swinst_idx < LowIndex)) {
+ LowIndex = swinst_idx;
+ err = Save_HR_SW_info(LowIndex);
+#ifdef HRSWINST_MONOTONICALLY_INCREASING
+ break;
+#endif
+ }
+ }
+ if (err != 0 )
+ errcount++;
+ /* restart until Save_HR_SW_info() succeeds,max. 3 times */
+ } while (err != 0 && errcount < 3);
+ if (err != 0) {
+ DEBUGMSGTL(("host/hr_swinst", "restart did not help, bailing out\n"));
+ return (MATCH_FAILED);
+ }
+
+ 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 = (WriteMethod*)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)
+ strlcpy(string, swi->swi_directory, sizeof(string));
+
+ 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
+ strlcpy(string, swi->swi_name, sizeof(string));
+
+/* 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 (pver &&
+ (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
+ int32_t *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(NULL, 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
+ ret = NULL;
+#else
+ sprintf(string, "back in the mists of time");
+ *var_len = strlen(string);
+ ret = (u_char *) string;
+#endif
+ }
+#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;
+
+ rpmdbMatchIterator mi = NULL;
+ Header h;
+ mi = rpmtsInitIterator(swi->swi_rpmts, RPMDBI_PACKAGES, NULL, 0);
+ while ((h = rpmdbNextIterator(mi)) != NULL) {
+ offset = rpmdbGetIteratorOffset(mi);
+
+ 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;
+ }
+ rpmdbFreeIterator(mi);
+
+ 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_rpmts != NULL)
+ return;
+ swi->swi_rpmts = rpmtsCreate();
+ rpmtsSetVSFlags( swi->swi_rpmts, (_RPMVSF_NOSIGNATURES|_RPMVSF_NODIGESTS));
+ 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;
+}
+
+int
+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];
+
+ {
+ rpmdbMatchIterator mi;
+ mi = rpmtsInitIterator(swi->swi_rpmts, RPMDBI_PACKAGES,
+ &offset, sizeof(offset));
+ if ((h = rpmdbNextIterator(mi)) != NULL)
+ h = headerLink(h);
+ rpmdbFreeIterator(mi);
+ }
+
+ if (h == NULL) {
+ DEBUGMSGTL(("host/hr_swinst",
+ "RPM cache has probably expired when reading entry %d, "
+ "reloading...\n", ix));
+ swi->swi_timestamp = 0;
+ return -1;
+ }
+ 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), "%s", swi->swi_dep->d_name);
+ swi->swi_name[ sizeof(swi->swi_name)-1 ] = 0;
+#endif
+ return 0;
+}
+
+#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
+ rpmtsFree(swi->swi_rpmts); /* or only on finishing ? */
+ swi->swi_rpmts = NULL;
+#else
+ if (swi->swi_dp != NULL)
+ closedir(swi->swi_dp);
+ swi->swi_dp = NULL;
+#endif
+}
diff --git a/agent/mibgroup/host/hr_swinst.h b/agent/mibgroup/host/hr_swinst.h
new file mode 100644
index 0000000..0c95ce1
--- /dev/null
+++ b/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/agent/mibgroup/host/hr_swrun.c b/agent/mibgroup/host/hr_swrun.c
new file mode 100644
index 0000000..644e7bd
--- /dev/null
+++ b/agent/mibgroup/host/hr_swrun.c
@@ -0,0 +1,1656 @@
+/* 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
+#if _SLASH_PROC_METHOD_ && defined _ILP32
+#include <net-snmp/agent/cache_handler.h>
+#include <net-snmp/agent/hardware/memory.h>
+#endif
+
+#include "kernel_sunos5.h"
+#endif
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+#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_GETPROC2
+struct kinfo_proc2 *proc_table;
+#elif HAVE_KVM_GETPROCS
+struct kinfo_proc *proc_table;
+#elif defined(solaris2)
+int *proc_table;
+#elif defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+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, NETSNMP_OLDAPI_RONLY,
+ var_hrswrun, 1, {1}},
+ {HRSWRUN_INDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrswrun, 3, {2, 1, 1}},
+ {HRSWRUN_NAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrswrun, 3, {2, 1, 2}},
+ {HRSWRUN_ID, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_hrswrun, 3, {2, 1, 3}},
+ {HRSWRUN_PATH, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrswrun, 3, {2, 1, 4}},
+ {HRSWRUN_PARAMS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrswrun, 3, {2, 1, 5}},
+ {HRSWRUN_TYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrswrun, 3, {2, 1, 6}},
+ {HRSWRUN_STATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrswrun, 3, {2, 1, 7}}
+};
+
+struct variable4 hrswrunperf_variables[] = {
+ {HRSWRUNPERF_CPU, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrswrun, 3, {1, 1, 1}},
+ {HRSWRUNPERF_MEM, ASN_INTEGER, NETSNMP_OLDAPI_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 = NULL;
+
+ 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 = (WriteMethod*)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 = (WriteMethod*)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
+ *
+ *********************/
+
+#if defined(linux)
+static char *
+skip_to_next_field(char *cp)
+{
+ while (*cp && ! isspace(*cp)) /* skip past non-space */
+ ++cp;
+ while (*cp && isspace(*cp)) /* skip past space */
+ ++cp;
+ return cp;
+
+}
+
+static char *
+get_proc_file_line(char *fmt,
+ int pid,
+ char *buf,
+ int buflen )
+{
+ static char string[1024];
+ FILE *fp;
+ *buf = '\0';
+ sprintf(string,fmt,pid);
+ if ( ((fp = fopen(string, "r")) == NULL)
+ || (fgets(buf, buflen, fp) == NULL) ) {
+ if (fp)
+ fclose(fp);
+ return NULL;
+ }
+ fclose(fp);
+ return buf;
+}
+
+static char *
+get_proc_stat_field(int pid,
+ char *buf,
+ int buflen,
+ int skip )
+{
+ int i;
+ char *cp;
+
+ if ((cp = get_proc_file_line("/proc/%d/stat", pid, buf, buflen)) == NULL )
+ return NULL;
+ for (i = 0; *cp && i < skip; ++i) {
+ cp = skip_to_next_field(cp);
+ }
+ return cp;
+}
+
+static char *
+get_proc_name_from_cmdline(int pid,
+ char *buf,
+ int buflen )
+{
+ return get_proc_file_line("/proc/%d/cmdline", pid, buf, buflen);
+}
+
+static char *
+get_proc_name_from_status(int pid,
+ char *buf,
+ int buflen )
+{
+ char *cp,*cp2;
+ if ((cp = get_proc_file_line("/proc/%d/status", pid, buf, buflen)) == NULL )
+ return NULL;
+ cp = strchr(cp, ':');
+ if ( cp == NULL ) {
+ return NULL; /* the process file is malformed */
+ }
+ cp = skip_to_next_field(cp);
+ cp2 = strchr(cp, '\n');
+ if (cp2)
+ *cp2 = 0;
+ return cp;
+}
+#endif
+
+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 (defined(HAVE_KVM_GETPROCS) || defined(HAVE_KVM_GETPROC2))
+ 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
+ strlcpy(string, proc_buf.pst_cmd, sizeof(string));
+ cp = strchr(string, ' ');
+ if (cp != NULL)
+ *cp = '\0';
+#elif defined(dynix)
+ strlcpy(string, lowpsinfo.pr_fname, sizeof(string));
+ 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 {
+ strlcpy(string, "<exited>", sizeof(string));
+ }
+#else
+ strlcpy(string, proc_buf->p_user.u_comm, sizeof(string));
+#endif
+#elif defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ strlcpy(string, proc_table[LowProcIndex].pi_comm, sizeof(string));
+ cp = strchr(string, ' ');
+ if (cp != NULL)
+ *cp = '\0';
+#elif HAVE_KVM_GETPROC2
+ strlcpy(string, proc_table[LowProcIndex].p_comm, sizeof(string));
+ /* process name: truncate the string at the first space */
+ 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);
+ #elif defined(dragonfly) && __DragonFly_version >= 190000
+ strcpy(string, proc_table[LowProcIndex].kp_comm);
+ #else
+ strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
+ #endif
+#elif defined(linux)
+ if( (cp=get_proc_name_from_status(pid,buf,sizeof(buf))) == NULL ) {
+ strcpy(string, "<exited>");
+ *var_len = strlen(string);
+ return (u_char *) string;
+ }
+ strcpy(string, cp);
+#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) || defined(aix7)
+ strlcpy(string, proc_table[LowProcIndex].pi_comm, sizeof(string));
+ cp = strchr(string, ' ');
+ if (cp != NULL)
+ *cp = '\0';
+#elif HAVE_KVM_GETPROC2
+ /* Should be path, but this is not available, just use argv[0] again */
+ strlcpy(string, proc_table[LowProcIndex].p_comm, sizeof(string));
+ 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);
+ #elif defined(dragonfly) && __DragonFly_version >= 190000
+ strcpy(string, proc_table[LowProcIndex].kp_comm);
+ #else
+ strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
+ #endif
+#elif defined(linux)
+ cp = get_proc_name_from_cmdline(pid,buf,sizeof(buf)-1);
+ if (cp != NULL && *cp) /* argv[0] '\0' argv[1] '\0' .... */
+ strcpy(string, cp);
+ else {
+ /*
+ * swapped out - no cmdline
+ */
+ if( (cp=get_proc_name_from_status(pid,buf,sizeof(buf)-1)) == NULL ) {
+ strcpy(string, "<exited>");
+ *var_len = strlen(string);
+ return (u_char *) string;
+ }
+ strcpy(string, cp);
+ }
+#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) || defined(aix7)
+ cp = strchr(proc_table[LowProcIndex].pi_comm, ' ');
+ if (cp != NULL) {
+ cp++;
+ sprintf(string, "%s", cp);
+ } else
+ string[0] = '\0';
+#elif HAVE_KVM_GETPROC2
+ string[0] = 0;
+ argv = kvm_getargv2(kd, proc_table + LowProcIndex, sizeof(string));
+ if (argv)
+ argv++;
+ while (argv && *argv) {
+ if (string[0] != 0)
+ strcat(string, " ");
+ strcat(string, *argv);
+ argv++;
+ }
+#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)
+ memset(buf, 0, sizeof(buf));
+ if( (cp=get_proc_name_from_cmdline(pid,buf,sizeof(buf)-2)) == NULL ) {
+ strcpy(string, "");
+ *var_len = 0;
+ return (u_char *) 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);
+#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) || defined(aix7)
+ if (proc_table[LowProcIndex].pi_flags & SKPROC) {
+ long_return = 2; /* kernel process */
+ } else
+ long_return = 4; /* application */
+#elif HAVE_KVM_GETPROC2
+ if (proc_table[LowProcIndex].p_flag & P_SYSTEM)
+ long_return = 2; /* operatingSystem */
+ 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 defined(dragonfly) && __DragonFly_version >= 190000
+ if (proc_table[LowProcIndex].kp_flags & P_SYSTEM)
+ #else
+ if (proc_table[LowProcIndex].kp_proc.p_flag & P_SYSTEM)
+ #endif
+ 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_GETPROC2
+ switch (proc_table[LowProcIndex].p_stat) {
+#elif HAVE_KVM_GETPROCS
+ #if defined(freebsd5) && __FreeBSD_version >= 500014
+ switch (proc_table[LowProcIndex].ki_stat) {
+ #elif defined(dragonfly) && __DragonFly_version >= 190000
+ switch (proc_table[LowProcIndex].kp_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) || defined(aix7)
+ 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
+ if ((cp = get_proc_stat_field(pid,buf,sizeof(buf),2)) != NULL ) {
+ 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;
+ }
+ } 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_GETPROC2
+ long_return = proc_table[LowProcIndex].p_uticks +
+ proc_table[LowProcIndex].p_sticks +
+ proc_table[LowProcIndex].p_iticks;
+#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;
+ #elif defined(dragonfly) && __DragonFly_version >= 190000
+ long_return = proc_table[LowProcIndex].kp_lwp.kl_uticks +
+ proc_table[LowProcIndex].kp_lwp.kl_sticks +
+ proc_table[LowProcIndex].kp_lwp.kl_iticks;
+ #elif defined(dragonfly)
+ long_return = proc_table[LowProcIndex].kp_eproc.e_uticks +
+ proc_table[LowProcIndex].kp_eproc.e_sticks +
+ proc_table[LowProcIndex].kp_eproc.e_iticks;
+ #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)
+ if ((cp = get_proc_stat_field(pid,buf,sizeof(buf),13)) == NULL ) {
+ long_return = 0;
+ return (u_char *) & long_return;
+ }
+
+ long_return = atoi(cp); /* utime */
+
+ cp = skip_to_next_field(cp);
+
+ long_return += atoi(cp); /* + stime */
+#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) || defined(aix7)
+ 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_
+#ifdef _ILP32
+ if(NULL != proc_buf && 0 == proc_buf->pr_rssize)
+ { /* Odds on that we are looking with a 32 bit app at a 64 bit psinfo.*/
+ netsnmp_memory_info *mem;
+ netsnmp_memory_load();
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 0 );
+ if (!mem)
+ {
+ snmp_log(LOG_INFO, "netsnmp_memory_get_byIdx returned NULL pointer\n");
+ long_return = 0;/* Tried my best, giving up.*/
+ }
+ else
+ {/* 0x8000 is the maximum range of pr_pctmem. devision of 1024 is to go from B to kB*/
+ uint32_t pct_unit = (mem->size/0x8000) * (mem->units/1024);
+ long_return = proc_buf ? proc_buf->pr_pctmem * pct_unit : 0;
+ }
+ }
+ else
+ {
+ long_return = proc_buf ? proc_buf->pr_rssize : 0;
+
+ }
+#else /*_LP64*/
+ long_return = proc_buf ? proc_buf->pr_rssize : 0;
+#endif /*_LP64*/
+
+#else
+ long_return = proc_buf->p_swrss;
+#endif
+#elif defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ long_return = proc_table[LowProcIndex].pi_size * getpagesize() / 1024;
+#elif HAVE_KVM_GETPROC2
+ long_return = proc_table[LowProcIndex].p_vm_tsize +
+ proc_table[LowProcIndex].p_vm_ssize +
+ proc_table[LowProcIndex].p_vm_dsize;
+ long_return = long_return * (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;
+ #elif defined(dragonfly) && __DragonFly_version >= 190000
+ proc_table[LowProcIndex].kp_vm_map_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)
+ if ((cp = get_proc_stat_field(pid,buf,sizeof(buf),23)) == NULL ) {
+ long_return = 0;
+ return (u_char *) & long_return;
+ }
+ long_return = atoi(cp) * (getpagesize() / 1024); /* rss */
+#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) || defined(aix7)
+ {
+ 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_GETPROC2
+ {
+ if (kd == NULL) {
+ nproc = 0;
+ return;
+ }
+ proc_table = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof (struct kinfo_proc2), &nproc);
+ }
+#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_GETPROC2
+ if (proc_table[current_proc_entry].p_stat != 0)
+ return proc_table[current_proc_entry++].p_pid;
+#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;
+ #elif defined(dragonfly) && __DragonFly_version >= 190000
+ if (proc_table[current_proc_entry].kp_stat != 0)
+ return proc_table[current_proc_entry++].kp_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) || defined(aix7)
+ 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 || HAVE_KVM_GETPROC2 || defined(dynix))
+ int i;
+#endif
+ int total = 0;
+
+ Init_HR_SWRun();
+#if defined(hpux10) || defined(hpux11) || HAVE_KVM_GETPROCS || HAVE_KVM_GETPROC2 || defined(solaris2)
+ total = nproc;
+#else
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ 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 && !HAVE_KVM_GETPROC2 && !solaris2 */
+ End_HR_SWRun();
+ return total;
+}
diff --git a/agent/mibgroup/host/hr_swrun.h b/agent/mibgroup/host/hr_swrun.h
new file mode 100644
index 0000000..ce19629
--- /dev/null
+++ b/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/agent/mibgroup/host/hr_system.c b/agent/mibgroup/host/hr_system.c
new file mode 100644
index 0000000..9fea4f4
--- /dev/null
+++ b/agent/mibgroup/host/hr_system.c
@@ -0,0 +1,731 @@
+/* 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>
+#include <net-snmp/net-snmp-features.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
+
+netsnmp_feature_require(date_n_time)
+
+#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);
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+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);
+extern int swrun_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)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+struct variable2 hrsystem_variables[] = {
+ {HRSYS_UPTIME, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {1}},
+ {HRSYS_DATE, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_hrsys, 1, {2}},
+ {HRSYS_LOAD_DEV, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {3}},
+ {HRSYS_LOAD_PARAM, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_hrsys, 1, {4}},
+ {HRSYS_USERS, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {5}},
+ {HRSYS_PROCS, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {6}},
+ {HRSYS_MAXPROCS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {7}}
+};
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+struct variable2 hrsystem_variables[] = {
+ {HRSYS_UPTIME, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {1}},
+ {HRSYS_DATE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {2}},
+ {HRSYS_LOAD_DEV, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {3}},
+ {HRSYS_LOAD_PARAM, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {4}},
+ {HRSYS_USERS, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {5}},
+ {HRSYS_PROCS, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {6}},
+ {HRSYS_MAXPROCS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {7}}
+};
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+#else
+struct variable2 hrsystem_variables[] = {
+ {HRSYS_UPTIME, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {1}},
+ {HRSYS_DATE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {2}},
+ {HRSYS_LOAD_DEV, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {3}},
+ {HRSYS_LOAD_PARAM, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {4}},
+ {HRSYS_USERS, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {5}},
+ {HRSYS_PROCS, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_hrsys, 1, {6}},
+ {HRSYS_MAXPROCS, ASN_INTEGER, NETSNMP_OLDAPI_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 = (WriteMethod*)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 };
+ size_t 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)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method=ns_set_time;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+#endif
+ 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)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method=set_solaris_bootcommand_parameter;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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_DATA_ACCESS_SWRUN_MODULE
+ long_return = swrun_count_processes();
+#elif 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);
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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;
+}
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+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=\"%.*s\"\n", key, var_val_len, value);
+
+ 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)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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 /* !NETSNMP_NO_WRITE_SUPPORT */
+#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/agent/mibgroup/host/hr_system.h b/agent/mibgroup/host/hr_system.h
new file mode 100644
index 0000000..feffa60
--- /dev/null
+++ b/agent/mibgroup/host/hr_system.h
@@ -0,0 +1,17 @@
+/*
+ * 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)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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 /* !NETSNMP_NO_WRITE_SUPPORT */
+#endif
+
+#endif /* _MIBGROUP_HRSYSTEM_H */
diff --git a/agent/mibgroup/host/hrh_filesys.c b/agent/mibgroup/host/hrh_filesys.c
new file mode 100644
index 0000000..4aab6a0
--- /dev/null
+++ b/agent/mibgroup/host/hrh_filesys.c
@@ -0,0 +1,429 @@
+/*
+ * Host Resources MIB - File System device group implementation (HAL rewrite) - hrh_filesys.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 (C) 2007 Apple, 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-features.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 <net-snmp/agent/hardware/fsys.h>
+#include "host_res.h"
+#include "hrh_filesys.h"
+#include "hrh_storage.h"
+#include "hr_disk.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) || defined(aix7)
+#include <sys/mntctl.h>
+#include <sys/vmount.h>
+#include <sys/statfs.h>
+#endif
+
+netsnmp_feature_require(date_n_time)
+netsnmp_feature_require(ctime_to_timet)
+
+#define HRFS_MONOTONICALLY_INCREASING
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+netsnmp_fsys_info *HRFS_entry;
+
+#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_hrhfilesys(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, NETSNMP_OLDAPI_RONLY,
+ var_hrhfilesys, 2, {1, 1}},
+ {HRFSYS_MOUNT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrhfilesys, 2, {1, 2}},
+ {HRFSYS_RMOUNT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrhfilesys, 2, {1, 3}},
+ {HRFSYS_TYPE, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_hrhfilesys, 2, {1, 4}},
+ {HRFSYS_ACCESS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrhfilesys, 2, {1, 5}},
+ {HRFSYS_BOOT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrhfilesys, 2, {1, 6}},
+ {HRFSYS_STOREIDX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrhfilesys, 2, {1, 7}},
+ {HRFSYS_FULLDUMP, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrhfilesys, 2, {1, 8}},
+ {HRFSYS_PARTDUMP, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrhfilesys, 2, {1, 9}},
+};
+oid hrfsys_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 3, 8 };
+
+void
+init_hrh_filesys(void)
+{
+ REGISTER_MIB("host/hr_filesys", hrfsys_variables, variable4,
+ hrfsys_variables_oid);
+}
+
+/*
+ * header_hrhfilesys(...
+ * 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_hrhfilesys(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_hrhfilesys: "));
+ 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_hrhfilesys(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int fsys_idx;
+ static char string[1024];
+
+ fsys_idx =
+ header_hrhfilesys(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), "%s", HRFS_entry->path);
+ string[ sizeof(string)-1 ] = 0;
+ *var_len = strlen(string);
+ return (u_char *) string;
+ case HRFSYS_RMOUNT:
+ if (HRFS_entry->flags & NETSNMP_FS_FLAG_REMOTE) {
+ snprintf(string, sizeof(string), "%s", HRFS_entry->device);
+ string[ sizeof(string)-1 ] = 0;
+ } else
+ string[0] = '\0';
+ *var_len = strlen(string);
+ return (u_char *) string;
+
+ case HRFSYS_TYPE:
+ fsys_type_id[fsys_type_len - 1] =
+ (HRFS_entry->type > _NETSNMP_FS_TYPE_LOCAL ?
+ NETSNMP_FS_TYPE_OTHER : HRFS_entry->type);
+ *var_len = sizeof(fsys_type_id);
+ return (u_char *) fsys_type_id;
+
+ case HRFSYS_ACCESS:
+ long_return = HRFS_entry->flags & NETSNMP_FS_FLAG_RONLY ? 2 : 1;
+ return (u_char *) & long_return;
+ case HRFSYS_BOOT:
+ long_return = HRFS_entry->flags & NETSNMP_FS_FLAG_BOOTABLE ? 1 : 2;
+ 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->path, FULL_DUMP, var_len);
+ case HRFSYS_PARTDUMP:
+ return when_dumped(HRFS_entry->path, PART_DUMP, var_len);
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrhfilesys\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+static int HRFS_index;
+
+void
+Init_HR_FileSys(void)
+{
+ netsnmp_cache *c = netsnmp_fsys_get_cache();
+ netsnmp_cache_check_and_reload( c );
+
+ HRFS_entry = NULL;
+ HRFS_index = 0;
+}
+
+int
+Get_Next_HR_FileSys(void)
+{
+ if ( HRFS_entry ) {
+ HRFS_entry = netsnmp_fsys_get_next( HRFS_entry );
+ } else {
+ HRFS_entry = netsnmp_fsys_get_first();
+ }
+ /* Skip "inactive" entries */
+ while ( HRFS_entry && !(HRFS_entry->flags & NETSNMP_FS_FLAG_ACTIVE))
+ HRFS_entry = netsnmp_fsys_get_next( HRFS_entry );
+
+ HRFS_index = (HRFS_entry ? HRFS_entry->idx.oids[0] : -1 );
+ return HRFS_index;
+}
+
+
+
+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(0xFF & *cp2))
+ ++cp2; /* Now find the dump level */
+
+ if (level == FULL_DUMP) {
+ if (*(cp2++) != '0')
+ continue; /* Not interested in partial dumps */
+ while (isspace(0xFF & *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(0xFF & *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))) {
+ strlcpy(cooked_dev, COOKED_DEVICE_PREFIX, sizeof(cooked_dev));
+ strlcat(cooked_dev, dev + strlen(RAW_DEVICE_PREFIX),
+ sizeof(cooked_dev));
+ } else {
+ strlcpy(cooked_dev, dev, sizeof(cooked_dev));
+ }
+
+ return cooked_dev;
+}
+
+
+int
+Get_FSIndex(char *dev)
+{
+ netsnmp_fsys_info *fsys;
+
+ fsys = netsnmp_fsys_by_device( dev, NETSNMP_FS_FIND_EXIST );
+ return (fsys ? fsys->idx.oids[0] : -1 );
+}
+
+long
+Get_FSSize(char *dev)
+{
+ netsnmp_fsys_info *fsys;
+
+ fsys = netsnmp_fsys_by_device( dev, NETSNMP_FS_FIND_EXIST );
+ if ( fsys )
+ return netsnmp_fsys_size( fsys );
+ else
+ return -1;
+}
+
+int
+Check_HR_FileSys_NFS (void)
+{
+ return (HRFS_entry->flags & NETSNMP_FS_FLAG_REMOTE) ? 1 : 0;
+}
diff --git a/agent/mibgroup/host/hrh_filesys.h b/agent/mibgroup/host/hrh_filesys.h
new file mode 100644
index 0000000..568917e
--- /dev/null
+++ b/agent/mibgroup/host/hrh_filesys.h
@@ -0,0 +1,19 @@
+/*
+ * Host Resources MIB - file system device group interface (HAL rewrite) - hrh_filesys.h
+ *
+ */
+#ifndef _MIBGROUP_HRFSYS_H
+#define _MIBGROUP_HRFSYS_H
+
+extern void init_hrh_filesys(void);
+extern void Init_HR_FileSys(void);
+extern FindVarMethod var_hrhfilesys;
+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 */
+
+config_exclude( host/hr_filesys )
+
+#endif /* _MIBGROUP_HRFSYS_H */
diff --git a/agent/mibgroup/host/hrh_storage.c b/agent/mibgroup/host/hrh_storage.c
new file mode 100644
index 0000000..ca2f854
--- /dev/null
+++ b/agent/mibgroup/host/hrh_storage.c
@@ -0,0 +1,520 @@
+/*
+ * Host Resources MIB - storage group implementation - hrh_storage.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 <net-snmp/agent/hardware/fsys.h>
+#include "host_res.h"
+#include "hrh_filesys.h"
+#include "hrh_storage.h"
+#include "hr_disk.h"
+#include <net-snmp/utilities.h>
+
+
+#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 HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/output_api.h>
+
+#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
+ *
+ *********************/
+
+
+extern netsnmp_fsys_info *HRFS_entry;
+
+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 **);
+Netsnmp_Node_Handler handle_memsize;
+
+
+#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 variable2 hrstore_variables[] = {
+ {HRSTORE_INDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {1}},
+ {HRSTORE_TYPE, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {2}},
+ {HRSTORE_DESCR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {3}},
+ {HRSTORE_UNITS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {4}},
+ {HRSTORE_SIZE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {5}},
+ {HRSTORE_USED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {6}},
+ {HRSTORE_FAILS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_hrstore, 1, {7}}
+};
+oid hrstore_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 2 };
+oid hrMemorySize_oid[] = { 1, 3, 6, 1, 2, 1, 25, 2, 2 };
+oid hrStorageTable_oid[] = { 1, 3, 6, 1, 2, 1, 25, 2, 3, 1 };
+
+
+void
+init_hrh_storage(void)
+{
+ char *appname;
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("host/hrMemorySize", handle_memsize,
+ hrMemorySize_oid, OID_LENGTH(hrMemorySize_oid),
+ HANDLER_CAN_RONLY));
+ REGISTER_MIB("host/hr_storage", hrstore_variables, variable2,
+ hrStorageTable_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);
+
+ netsnmp_ds_register_config(ASN_BOOLEAN, appname, "realStorageUnits",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_REALSTORAGEUNITS);
+
+ 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_hrstoreEntry(...
+ * 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
+ *
+ */
+
+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 = (WriteMethod*)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", " (%p)\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
+ *
+ *********************/
+
+int
+handle_memsize(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_memory_info *mem_info;
+ int val;
+
+ /*
+ * 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();
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 0 );
+ if ( !mem_info || mem_info->size == -1 || mem_info->units == -1 )
+ netsnmp_set_request_error( reqinfo, requests, SNMP_NOSUCHOBJECT );
+ else {
+ val = mem_info->size; /* memtotal */
+ val *= (mem_info->units/1024);
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *)&val, sizeof(val));
+ }
+ return SNMP_ERR_NOERROR;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_memsize\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+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];
+ void *ptr;
+ netsnmp_memory_info *mem = NULL;
+
+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 &&
+ store_idx > NETSNMP_MEM_TYPE_MAX &&
+ 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 ) {
+ mem = (netsnmp_memory_info*)ptr;
+ }
+
+
+
+ switch (vp->magic) {
+ case HRSTORE_INDEX:
+ long_return = store_idx;
+ return (u_char *) & long_return;
+ case HRSTORE_TYPE:
+ if (store_idx > NETSNMP_MEM_TYPE_MAX)
+ if (HRFS_entry->flags & NETSNMP_FS_FLAG_REMOTE )
+ storage_type_id[storage_type_len - 1] = 10; /* Network Disk */
+ else if (HRFS_entry->flags & NETSNMP_FS_FLAG_REMOVE )
+ storage_type_id[storage_type_len - 1] = 5; /* Removable Disk */
+ 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) {
+ strlcpy(string, HRFS_entry->path, sizeof(string));
+ *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 (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_REALSTORAGEUNITS))
+ long_return = HRFS_entry->units & 0xffffffff;
+ else
+ long_return = HRFS_entry->units_32;
+ } 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) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_REALSTORAGEUNITS))
+ long_return = HRFS_entry->size & 0xffffffff;
+ else
+ long_return = HRFS_entry->size_32;
+ } 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) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_REALSTORAGEUNITS))
+ long_return = HRFS_entry->used & 0xffffffff;
+ else
+ long_return = HRFS_entry->used_32;
+ } 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 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;
+ }
+ }
+}
+
diff --git a/agent/mibgroup/host/hrh_storage.h b/agent/mibgroup/host/hrh_storage.h
new file mode 100644
index 0000000..e872345
--- /dev/null
+++ b/agent/mibgroup/host/hrh_storage.h
@@ -0,0 +1,23 @@
+/*
+ * Host Resources MIB - storage group interface (HAL rewrite) - hrh_storage.h
+ *
+ */
+#ifndef _MIBGROUP_HRSTORAGE_H
+#define _MIBGROUP_HRSTORAGE_H
+
+config_require(hardware/memory)
+config_require(hardware/fsys)
+config_require(host/hrh_filesys)
+
+config_exclude( host/hr_storage )
+
+extern void init_hrh_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 */
+
+#endif /* _MIBGROUP_HRSTORAGE_H */
diff --git a/agent/mibgroup/host_res.h b/agent/mibgroup/host_res.h
new file mode 100644
index 0000000..1dba388
--- /dev/null
+++ b/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(NETSNMP_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
+#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 16
+#define HRDEV_TYPE_MASK 0xffff
+
+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/agent/mibgroup/if-mib.h b/agent/mibgroup/if-mib.h
new file mode 100644
index 0000000..998a46b
--- /dev/null
+++ b/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/agent/mibgroup/if-mib/data_access/interface.c b/agent/mibgroup/if-mib/data_access/interface.c
new file mode 100644
index 0000000..8cb73e8
--- /dev/null
+++ b/agent/mibgroup/if-mib/data_access/interface.c
@@ -0,0 +1,873 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/library/snmp_enum.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "mibII/mibII_common.h"
+#include "if-mib/ifTable/ifTable.h"
+#include "if-mib/data_access/interface.h"
+
+netsnmp_feature_child_of(interface_all, libnetsnmpmibs)
+netsnmp_feature_child_of(interface, interface_all)
+netsnmp_feature_child_of(interface_access_entry_set_admin_status, interface_all)
+netsnmp_feature_child_of(interface_legacy, interface_all)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_INTERFACE_ACCESS_ENTRY_SET_ADMIN_STATUS
+netsnmp_feature_require(interface_arch_set_admin_status)
+#endif /* NETSNMP_FEATURE_REQUIRE_INTERFACE_ACCESS_ENTRY_SET_ADMIN_STATUS */
+
+/**---------------------------------------------------------------------*/
+/*
+ * 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 = NETSNMP_REMOVE_CONST(char *, name);
+ return (netsnmp_interface_entry*)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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_INTERFACE_LEGACY
+/*
+ * 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 ifTable_rowreq_ctx *row = NULL;
+
+/**
+ * Setup an iterator for scanning the interfaces using the cached entry
+ * from if-mib/ifTable.
+ */
+void
+Interface_Scan_Init(void)
+{
+ netsnmp_container *cont = NULL;
+ netsnmp_cache *cache = NULL;
+
+ cache = netsnmp_cache_find_by_oid(ifTable_oid, ifTable_oid_size);
+ if (NULL != cache) {
+ netsnmp_cache_check_and_reload(cache);
+ cont = (netsnmp_container*) cache->magic;
+ }
+
+ if (NULL != cont) {
+ if (NULL != it)
+ ITERATOR_RELEASE(it);
+
+ it = CONTAINER_ITERATOR(cont);
+ }
+
+ if (NULL != it)
+ row = (ifTable_rowreq_ctx*)ITERATOR_FIRST(it);
+}
+
+int
+Interface_Scan_Next(short *index, char *name, netsnmp_interface_entry **entry,
+ void *dc)
+{
+ int returnIndex = 0;
+ int ret;
+ if (index)
+ returnIndex = *index;
+
+ ret = Interface_Scan_NextInt( &returnIndex, name, entry, dc );
+ if (index)
+ *index = (returnIndex & 0x8fff);
+ return ret;
+}
+
+int
+Interface_Scan_NextInt(int *index, char *name, netsnmp_interface_entry **entry,
+ void *dc)
+{
+ netsnmp_interface_entry* e = NULL;
+
+ if (NULL == row)
+ return 0;
+
+ e = row->data.ifentry;
+ if(index)
+ *index = e->index;
+
+ if(name)
+ strcpy(name, e->name);
+
+ if (entry)
+ *entry = e;
+
+ row = (ifTable_rowreq_ctx*) ITERATOR_NEXT(it);
+
+ return 1;
+}
+#endif /* NETSNMP_NO_BACKWARDS_COMPATABILITY */
+#endif /* NETSNMP_FEATURE_REMOVE_INTERFACE_LEGACY */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INTERFACE_ACCESS_ENTRY_SET_ADMIN_STATUS
+/**
+ *
+ * @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
+#endif /* NETSNMP_FEATURE_REMOVE_INTERFACE_ACCESS_ENTRY_SET_ADMIN_STATUS */
+
+/**---------------------------------------------------------------------*/
+/*
+ * 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)
+{
+ int 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 %" NETSNMP_PRIo "u for %s\n",
+ index, name));
+ }
+ else
+ if (index != (oid)tmp) {
+ NETSNMP_LOGONCE((LOG_ERR, "IfIndex of an interface changed. Such " \
+ "interfaces will appear multiple times in IF-MIB.\n"));
+ DEBUGMSGTL(("access:interface:ifIndex",
+ "index %" NETSNMP_PRIo "u != 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(prev_vals->stats));
+ }
+
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.ibytes,
+ &new_vals->stats.ibytes,
+ &prev_vals->old_stats->ibytes,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding ifHCInOctets to 64bits\n"));
+
+ if (new_vals->ns_flags & NETSNMP_INTERFACE_FLAGS_CALCULATE_UCAST) {
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.iall,
+ &new_vals->stats.iall,
+ &prev_vals->old_stats->iall,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding packet count to 64bits\n"));
+ } else {
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.iucast,
+ &new_vals->stats.iucast,
+ &prev_vals->old_stats->iucast,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding ifHCInUcastPkts to 64bits\n"));
+ }
+
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.iucast,
+ &new_vals->stats.iucast,
+ &prev_vals->old_stats->iucast,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding ifHCInUcastPkts to 64bits\n"));
+
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.imcast,
+ &new_vals->stats.imcast,
+ &prev_vals->old_stats->imcast,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding ifHCInMulticastPkts to 64bits\n"));
+
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.ibcast,
+ &new_vals->stats.ibcast,
+ &prev_vals->old_stats->ibcast,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding ifHCInBroadcastPkts to 64bits\n"));
+
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.obytes,
+ &new_vals->stats.obytes,
+ &prev_vals->old_stats->obytes,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding ifHCOutOctets to 64bits\n"));
+
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.oucast,
+ &new_vals->stats.oucast,
+ &prev_vals->old_stats->oucast,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding ifHCOutUcastPkts to 64bits\n"));
+
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.omcast,
+ &new_vals->stats.omcast,
+ &prev_vals->old_stats->omcast,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding ifHCOutMulticastPkts to 64bits\n"));
+
+ if (0 != netsnmp_c64_check32_and_update(&prev_vals->stats.obcast,
+ &new_vals->stats.obcast,
+ &prev_vals->old_stats->obcast,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:interface",
+ "Error expanding ifHCOutBroadcastPkts to 64bits\n"));
+
+ /*
+ * 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;
+}
+
+/**
+ * Calculate stats
+ *
+ * @retval 0 : success
+ * @retval -1 : error
+ */
+int
+netsnmp_access_interface_entry_calculate_stats(netsnmp_interface_entry *entry)
+{
+ DEBUGMSGTL(("access:interface", "calculate_stats\n"));
+ if (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_CALCULATE_UCAST) {
+ u64Subtract(&entry->stats.iall, &entry->stats.imcast,
+ &entry->stats.iucast);
+ }
+ 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);
+ netsnmp_access_interface_entry_calculate_stats(lhs);
+
+ /*
+ * update data
+ */
+ lhs->ns_flags = rhs->ns_flags;
+ if((NULL != lhs->descr) && (NULL != rhs->descr) &&
+ (0 == strcmp(lhs->descr, rhs->descr)))
+ ;
+ else {
+ 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 {
+ SNMP_FREE(lhs->paddr);
+ if (rhs->paddr) {
+ lhs->paddr = (char*)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;
+ entry->speed_high = entry->speed / 1000000LL;
+}
+
+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;
+ if (if_ptr->speed > 0xffffffff) {
+ entry->speed = 0xffffffff;
+ } else {
+ entry->speed = if_ptr->speed;
+ }
+ entry->speed_high = if_ptr->speed / 1000000LL;
+ }
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * 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 = strtoull(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(NETSNMP_REMOVE_CONST(char *, if_ptr->name));
+ free(if_ptr);
+ if_ptr = if_next;
+ }
+ conf_list = NULL;
+}
diff --git a/agent/mibgroup/if-mib/data_access/interface.h b/agent/mibgroup/if-mib/data_access/interface.h
new file mode 100644
index 0000000..353b254
--- /dev/null
+++ b/agent/mibgroup/if-mib/data_access/interface.h
@@ -0,0 +1,58 @@
+/*
+ * interface data access header
+ *
+ * $Id$
+ */
+#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(util_funcs)
+ config_require(if-mib/data_access/interface_linux)
+ config_require(if-mib/data_access/interface_ioctl)
+
+# elif defined( openbsd3 ) || \
+ defined( freebsd4 ) || defined( freebsd5 ) || defined( freebsd6 ) || \
+ defined( darwin ) || defined( dragonfly ) || defined( netbsd1 )
+
+ 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/agent/mibgroup/if-mib/data_access/interface_ioctl.c b/agent/mibgroup/if-mib/data_access/interface_ioctl.c
new file mode 100644
index 0000000..db2c245
--- /dev/null
+++ b/agent/mibgroup/if-mib/data_access/interface_ioctl.c
@@ -0,0 +1,506 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_child_of(interface_ioctl_flags_set, interface_all)
+
+#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;
+ }
+ }
+
+ strlcpy(ifrq->ifr_name, name, sizeof(ifrq->ifr_name));
+ 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 = (char*)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 = IANAIFTYPE_ETHERNETCSMACD;
+ 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 = IANAIFTYPE_TUNNEL;
+ break; /* tunnel */
+#endif
+#ifdef ARPHRD_INFINIBAND
+ case ARPHRD_INFINIBAND:
+ ifentry->type = IANAIFTYPE_INFINIBAND;
+ break;
+#endif
+#ifdef ARPHRD_SLIP
+ case ARPHRD_SLIP:
+ case ARPHRD_CSLIP:
+ case ARPHRD_SLIP6:
+ case ARPHRD_CSLIP6:
+ ifentry->type = IANAIFTYPE_SLIP;
+ break; /* slip */
+#endif
+#ifdef ARPHRD_PPP
+ case ARPHRD_PPP:
+ ifentry->type = IANAIFTYPE_PPP;
+ break; /* ppp */
+#endif
+#ifdef ARPHRD_LOOPBACK
+ case ARPHRD_LOOPBACK:
+ ifentry->type = IANAIFTYPE_SOFTWARELOOPBACK;
+ break; /* softwareLoopback */
+#endif
+#ifdef ARPHRD_FDDI
+ case ARPHRD_FDDI:
+ ifentry->type = IANAIFTYPE_FDDI;
+ break;
+#endif
+#ifdef ARPHRD_ARCNET
+ case ARPHRD_ARCNET:
+ ifentry->type = IANAIFTYPE_ARCNET;
+ break;
+#endif
+#ifdef ARPHRD_LOCALTLK
+ case ARPHRD_LOCALTLK:
+ ifentry->type = IANAIFTYPE_LOCALTALK;
+ break;
+#endif
+#ifdef ARPHRD_HIPPI
+ case ARPHRD_HIPPI:
+ ifentry->type = IANAIFTYPE_HIPPI;
+ break;
+#endif
+#ifdef ARPHRD_ATM
+ case ARPHRD_ATM:
+ ifentry->type = IANAIFTYPE_ATM;
+ 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));
+ ifentry->type = IANAIFTYPE_OTHER;
+ } /* 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_INTERFACE_IOCTL_FLAGS_SET
+/**
+ * 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;
+ }
+ }
+
+ strlcpy(ifrq.ifr_name, ifentry->name, sizeof(ifrq.ifr_name));
+ 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 /* NETSNMP_FEATURE_REMOVE_INTERFACE_IOCTL_FLAGS_SET */
+#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;
+ }
+
+#if defined(__FreeBSD__) /* ? Should use HAVE_STRUCT_IFREQ_IFR_INDEX */
+ return ifrq.ifr_index;
+#else
+ return ifrq.ifr_ifindex;
+#endif
+#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 != (int)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/agent/mibgroup/if-mib/data_access/interface_ioctl.h b/agent/mibgroup/if-mib/data_access/interface_ioctl.h
new file mode 100644
index 0000000..d765876
--- /dev/null
+++ b/agent/mibgroup/if-mib/data_access/interface_ioctl.h
@@ -0,0 +1,52 @@
+/*
+ * ioctl interface data access header
+ *
+ * $Id$
+ */
+#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/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c
new file mode 100644
index 0000000..3419811
--- /dev/null
+++ b/agent/mibgroup/if-mib/data_access/interface_linux.c
@@ -0,0 +1,1213 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+
+netsnmp_feature_require(fd_event_manager)
+netsnmp_feature_require(delete_prefix_info)
+netsnmp_feature_require(create_prefix_info)
+netsnmp_feature_child_of(interface_arch_set_admin_status, interface_all)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_INTERFACE_ARCH_SET_ADMIN_STATUS
+netsnmp_feature_require(interface_ioctl_flags_set)
+#endif /* NETSNMP_FEATURE_REQUIRE_INTERFACE_ARCH_SET_ADMIN_STATUS */
+
+#ifdef HAVE_PCI_LOOKUP_NAME
+#include <pci/pci.h>
+static struct pci_access *pci_access;
+#endif
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+#include <linux/types.h>
+#ifndef HAVE_PCI_LOOKUP_NAME
+typedef __u64 u64; /* hack, so we may include kernel's ethtool.h */
+typedef __u32 u32; /* ditto */
+typedef __u16 u16; /* ditto */
+typedef __u8 u8; /* ditto */
+#endif
+
+#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 "mibgroup/util_funcs.h"
+#include "interface_ioctl.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <linux/sockios.h>
+#include <linux/if_ether.h>
+
+#ifndef IF_NAMESIZE
+#define IF_NAMESIZE 16
+#endif
+
+#ifndef SIOCGMIIPHY
+#define SIOCGMIIPHY 0x8947
+#endif
+
+#ifndef SIOCGMIIREG
+#define SIOCGMIIREG 0x8948
+#endif
+
+#ifdef NETSNMP_ENABLE_IPV6
+#if defined(HAVE_LINUX_RTNETLINK_H)
+#include <linux/rtnetlink.h>
+#ifdef RTMGRP_IPV6_PREFIX
+#define SUPPORT_PREFIX_FLAGS 1
+#endif /* RTMGRP_IPV6_PREFIX */
+#endif /* HAVE_LINUX_RTNETLINK_H */
+#endif /* NETSNMP_ENABLE_IPV6 */
+unsigned long long
+netsnmp_linux_interface_get_if_speed(int fd, const char *name,
+ unsigned long long defaultspeed);
+#ifdef HAVE_LINUX_ETHTOOL_H
+unsigned long long
+netsnmp_linux_interface_get_if_speed_mii(int fd, const char *name,
+ unsigned long long defaultspeed);
+#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;
+#ifdef SUPPORT_PREFIX_FLAGS
+prefix_cbx *prefix_head_list = NULL;
+netsnmp_prefix_listen_info list_info;
+#define IF_PREFIX_ONLINK 0x01
+#define IF_PREFIX_AUTOCONF 0x02
+
+int netsnmp_prefix_listen(void);
+#endif
+
+
+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;
+ }
+
+#ifdef SUPPORT_PREFIX_FLAGS
+ list_info.list_head = &prefix_head_list;
+ netsnmp_prefix_listen();
+#endif
+
+#ifdef HAVE_PCI_LOOKUP_NAME
+ pci_access = pci_alloc();
+ if (pci_access)
+ pci_init(pci_access);
+ else
+ snmp_log(LOG_ERR, "Unable to create pci access method\n");
+#endif
+}
+
+/*
+ * 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;
+
+#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 HAVE_PCI_LOOKUP_NAME
+
+/* Get value from sysfs file */
+static int sysfs_get_id(const char *path, unsigned short *id)
+{
+ FILE *fin;
+ int n;
+
+ if (!(fin = fopen(path, "r"))) {
+ DEBUGMSGTL(("access:interface",
+ "Failed to open %s\n", path));
+ return 0;
+ }
+
+ n = fscanf(fin, "%hx", id);
+ fclose(fin);
+
+ return n == 1;
+}
+
+/* Get interface description for PCI device
+ * by using sysfs to find vendor and device
+ * then lookup name (-lpci)
+ *
+ * For software interfaces there is no PCI information
+ * so description will not be set.
+ */
+static void
+_arch_interface_description_get(netsnmp_interface_entry *entry)
+{
+ const char *descr;
+ char buf[256];
+ unsigned short vendor_id, device_id;
+
+ if (!pci_access)
+ return;
+
+ snprintf(buf, sizeof(buf),
+ "/sys/class/net/%s/device/vendor", entry->name);
+
+ if (!sysfs_get_id(buf, &vendor_id))
+ return;
+
+ snprintf(buf, sizeof(buf),
+ "/sys/class/net/%s/device/device", entry->name);
+
+ if (!sysfs_get_id(buf, &device_id))
+ return;
+
+ descr = pci_lookup_name(pci_access, buf, sizeof(buf),
+ PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
+ vendor_id, device_id, 0, 0);
+ if (descr) {
+ free(entry->descr);
+ entry->descr = strdup(descr);
+ } else {
+ DEBUGMSGTL(("access:interface",
+ "Failed pci_lookup_name vendor=%#hx device=%#hx\n",
+ vendor_id, device_id));
+ }
+}
+#endif
+
+
+#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",
+ strlen("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.
+ */
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_CALCULATE_UCAST;
+ entry->stats.ibytes.low = rec_oct & 0xffffffff;
+ entry->stats.iall.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.iall.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 %x)\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"));
+ NETSNMP_LOGONCE((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");
+ fclose(devin);
+ 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",
+ (int)(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 */
+
+#ifdef HAVE_PCI_LOOKUP_NAME
+ _arch_interface_description_get(entry);
+#endif
+
+
+ /*
+ * 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_INFINIBAND,"ib"},
+ {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, NULL} /* end of list */
+ };
+
+ int len;
+ register pmatch_if pm;
+
+ for (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;
+ }
+
+ /*
+ * interface identifier is specified based on physaddr and type
+ */
+ switch (entry->type) {
+ case IANAIFTYPE_ETHERNETCSMACD:
+ case IANAIFTYPE_ETHERNET3MBIT:
+ case IANAIFTYPE_FASTETHER:
+ case IANAIFTYPE_FASTETHERFX:
+ case IANAIFTYPE_GIGABITETHERNET:
+ case IANAIFTYPE_FDDI:
+ case IANAIFTYPE_ISO88025TOKENRING:
+ if (NULL != entry->paddr && ETH_ALEN != entry->paddr_len)
+ break;
+
+ entry->v6_if_id_len = entry->paddr_len + 2;
+ memcpy(entry->v6_if_id, entry->paddr, 3);
+ memcpy(entry->v6_if_id + 5, entry->paddr + 3, 3);
+ entry->v6_if_id[0] ^= 2;
+ entry->v6_if_id[3] = 0xFF;
+ entry->v6_if_id[4] = 0xFE;
+
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID;
+ break;
+
+ case IANAIFTYPE_SOFTWARELOOPBACK:
+ entry->v6_if_id_len = 0;
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID;
+ break;
+ }
+
+ if (IANAIFTYPE_ETHERNETCSMACD == entry->type) {
+ unsigned long long speed;
+ unsigned long long defaultspeed = NOMINAL_LINK_SPEED;
+ if (!(entry->os_flags & IFF_RUNNING)) {
+ /*
+ * use speed 0 if the if speed cannot be determined *and* the
+ * interface is down
+ */
+ defaultspeed = 0;
+ }
+ speed = netsnmp_linux_interface_get_if_speed(fd,
+ entry->name, defaultspeed);
+ if (speed > 0xffffffffL) {
+ entry->speed = 0xffffffff;
+ } else
+ entry->speed = speed;
+ entry->speed_high = speed / 1000000LL;
+ }
+#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);
+
+ 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_INTERFACE_ARCH_SET_ADMIN_STATUS
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INTERFACE_ARCH_SET_ADMIN_STATUS */
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+/**
+ * Determines network interface speed from ETHTOOL_GSET
+ */
+unsigned long long
+netsnmp_linux_interface_get_if_speed(int fd, const char *name,
+ unsigned long long defaultspeed)
+{
+ int ret;
+ struct ifreq ifr;
+ struct ethtool_cmd edata;
+ uint16_t speed_hi;
+ uint32_t speed;
+
+ memset(&ifr, 0, sizeof(ifr));
+ memset(&edata, 0, sizeof(edata));
+ edata.cmd = ETHTOOL_GSET;
+
+ strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+ ifr.ifr_data = (char *) &edata;
+
+ ret = ioctl(fd, SIOCETHTOOL, &ifr);
+ if (ret == -1 || edata.speed == 0) {
+ DEBUGMSGTL(("mibII/interfaces", "ETHTOOL_GSET on %s failed (%d / %d)\n",
+ ifr.ifr_name, ret, edata.speed));
+ return netsnmp_linux_interface_get_if_speed_mii(fd,name,defaultspeed);
+ }
+
+#ifdef HAVE_STRUCT_ETHTOOL_CMD_SPEED_HI
+ speed_hi = edata.speed_hi;
+#else
+ speed_hi = 0;
+#endif
+ speed = speed_hi << 16 | edata.speed;
+ if (speed == 0xffff || speed == 0xffffffffUL /*SPEED_UNKNOWN*/)
+ speed = defaultspeed;
+ /* return in bps */
+ DEBUGMSGTL(("mibII/interfaces", "ETHTOOL_GSET on %s speed = %#x -> %d\n",
+ ifr.ifr_name, speed_hi << 16 | edata.speed, speed));
+ return speed * 1000LL * 1000LL;
+}
+#endif
+
+/**
+ * Determines network interface speed from MII
+ */
+unsigned long long
+#ifdef HAVE_LINUX_ETHTOOL_H
+netsnmp_linux_interface_get_if_speed_mii(int fd, const char *name,
+ unsigned long long defaultspeed)
+#else
+netsnmp_linux_interface_get_if_speed(int fd, const char *name,
+ unsigned long long defaultspeed)
+#endif
+{
+ unsigned long long retspeed = defaultspeed;
+ 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 long long media_speeds[] = {10000000, 10000000, 100000000, 100000000, 10000000, 0};
+ /* It corresponds to "10baseT", "10baseT-FD", "100baseTx", "100baseTx-FD", "100baseT4", "Flow-control", 0, */
+
+ strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+ 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;
+}
+#ifdef SUPPORT_PREFIX_FLAGS
+void netsnmp_prefix_process(int fd, void *data);
+
+/* Open netlink socket to watch new ipv6 addresses and prefixes. */
+int netsnmp_prefix_listen()
+{
+ struct {
+ struct nlmsghdr n;
+ struct ifinfomsg r;
+ char buf[1024];
+ } req;
+
+ struct rtattr *rta;
+ int status;
+ struct sockaddr_nl localaddrinfo;
+ unsigned groups = 0;
+
+ int fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
+ if (fd < 0) {
+ snmp_log(LOG_ERR, "netsnmp_prefix_listen: Cannot create socket.\n");
+ return -1;
+ }
+
+ memset(&localaddrinfo, 0, sizeof(struct sockaddr_nl));
+
+ groups |= RTMGRP_IPV6_IFADDR;
+ groups |= RTMGRP_IPV6_PREFIX;
+ localaddrinfo.nl_family = AF_NETLINK;
+ localaddrinfo.nl_groups = groups;
+
+ if (bind(fd, (struct sockaddr*)&localaddrinfo, sizeof(localaddrinfo)) < 0) {
+ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Bind failed.\n");
+ close(fd);
+ return -1;
+ }
+
+ memset(&req, 0, sizeof(req));
+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
+ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;
+ req.n.nlmsg_type = RTM_GETLINK;
+ req.r.ifi_family = AF_INET6;
+ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.n.nlmsg_len));
+ rta->rta_len = RTA_LENGTH(16);
+
+ status = send(fd, &req, req.n.nlmsg_len, 0);
+ if (status < 0) {
+ snmp_log(LOG_ERR,"netsnmp_prefix_listen: send failed\n");
+ close(fd);
+ return -1;
+ }
+
+ if (register_readfd(fd, netsnmp_prefix_process, NULL) != 0) {
+ snmp_log(LOG_ERR,"netsnmp_prefix_listen: error registering netlink socket\n");
+ close(fd);
+ return -1;
+ }
+ return 0;
+}
+
+/* Process one incoming netlink packets.
+ * RTM_NEWADDR and RTM_NEWPREFIX usually arrive in separate packets
+ * -> information from these packets must be stored locally and
+ * new prefix is added when information from both packets is complete.
+ */
+void netsnmp_prefix_process(int fd, void *data)
+{
+ int status;
+ char buf[16384];
+ struct nlmsghdr *nlmp;
+ struct rtattr *rtatp;
+ struct ifaddrmsg *ifa;
+ struct prefixmsg *prefix;
+ struct in6_addr *in6p;
+
+ /* these values must persist between calls */
+ static char in6pAddr[40];
+ static int have_addr = 0,have_prefix = 0;
+ static int onlink = 2,autonomous = 2; /*Assume as false*/
+
+ int iret;
+ prefix_cbx *new;
+ int len, req_len, length;
+
+ status = recv(fd, buf, sizeof(buf), 0);
+ if (status < 0) {
+ if (errno == EINTR)
+ return;
+ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Receive failed.\n");
+ return;
+ }
+
+ if(status == 0){
+ DEBUGMSGTL(("access:interface:prefix", "End of File\n"));
+ return;
+ }
+
+ for(nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp);){
+ len = nlmp->nlmsg_len;
+ req_len = len - sizeof(*nlmp);
+
+ if (req_len < 0 || len > status) {
+ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Error in length.\n");
+ return;
+ }
+
+ if (!NLMSG_OK(nlmp, status)) {
+ DEBUGMSGTL(("access:interface:prefix", "NLMSG not OK\n"));
+ continue;
+ }
+
+ if (nlmp->nlmsg_type == RTM_NEWADDR || nlmp->nlmsg_type == RTM_DELADDR) {
+ ifa = NLMSG_DATA(nlmp);
+ length = nlmp->nlmsg_len;
+ length -= NLMSG_LENGTH(sizeof(*ifa));
+
+ if (length < 0) {
+ DEBUGMSGTL(("access:interface:prefix", "wrong nlmsg length %d\n", length));
+ continue;
+ }
+
+ if(!ifa->ifa_flags) {
+ rtatp = IFA_RTA(ifa);
+ while (RTA_OK(rtatp, length)) {
+ if (rtatp->rta_type == IFA_ADDRESS){
+ in6p = (struct in6_addr *) RTA_DATA(rtatp);
+ if(nlmp->nlmsg_type == RTM_DELADDR) {
+ snprintf(in6pAddr, sizeof(in6pAddr), "%04x%04x%04x%04x%04x%04x%04x%04x", NIP6(*in6p));
+ have_addr = -1;
+ break;
+ } else {
+ snprintf(in6pAddr, sizeof(in6pAddr), "%04x%04x%04x%04x%04x%04x%04x%04x", NIP6(*in6p));
+ have_addr = 1;
+ break;
+ }
+ }
+ rtatp = RTA_NEXT(rtatp,length);
+ }
+ }
+ }
+
+ if(nlmp->nlmsg_type == RTM_NEWPREFIX) {
+ prefix = NLMSG_DATA(nlmp);
+ length = nlmp->nlmsg_len;
+ length -= NLMSG_LENGTH(sizeof(*prefix));
+
+ if (length < 0) {
+ DEBUGMSGTL(("access:interface:prefix", "wrong nlmsg length %d\n", length));
+ continue;
+ }
+ have_prefix = 1;
+ if (prefix->prefix_flags & IF_PREFIX_ONLINK) {
+ onlink = 1;
+ }
+ if (prefix->prefix_flags & IF_PREFIX_AUTOCONF) {
+ autonomous = 1;
+ }
+ }
+ status -= NLMSG_ALIGN(len);
+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len));
+ }
+
+ if((have_addr == 1) && (have_prefix == 1)){
+ if(!(new = net_snmp_create_prefix_info (onlink, autonomous, in6pAddr)))
+ DEBUGMSGTL(("access:interface:prefix", "Unable to create prefix info\n"));
+ else {
+
+ iret = net_snmp_search_update_prefix_info (list_info.list_head, new, 0);
+ if(iret < 0) {
+ DEBUGMSGTL(("access:interface:prefix", "Unable to add/update prefix info\n"));
+ free(new);
+ }
+ if(iret == 2) /*Only when enrty already exists and we are only updating*/
+ free(new);
+ }
+ have_addr = have_prefix = 0;
+ onlink = autonomous = 2; /*Set to defaults again*/
+ } else if (have_addr == -1) {
+ iret = net_snmp_delete_prefix_info (list_info.list_head, in6pAddr);
+ if(iret < 0)
+ DEBUGMSGTL(("access:interface:prefix", "Unable to delete the prefix info\n"));
+ if(!iret)
+ DEBUGMSGTL(("access:interface:prefix", "Unable to find the node to delete\n"));
+ have_addr = 0;
+ }
+}
+#endif
+
diff --git a/agent/mibgroup/if-mib/data_access/interface_openbsd.c b/agent/mibgroup/if-mib/data_access/interface_openbsd.c
new file mode 100644
index 0000000..8340dc6
--- /dev/null
+++ b/agent/mibgroup/if-mib/data_access/interface_openbsd.c
@@ -0,0 +1,407 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+#include "if-mib/ifTable/ifTable_constants.h"
+
+netsnmp_feature_child_of(interface_arch_set_admin_status, interface_all)
+
+#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 <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>
+
+#define starttime (*(const struct timeval*)netsnmp_get_agent_starttime())
+
+int
+netsnmp_openbsd_interface_get_if_speed(char *name, u_int *speed, u_int *speed_high);
+
+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);
+}
+
+/* sa_len roundup macro. */
+#define ROUNDUP(a) \
+ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+
+/*
+ *
+ * @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:arch",
+ "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 = (u_char*)malloc(if_list_size);
+ if (if_list == NULL) {
+ snmp_log(LOG_ERR, "could not allocate memory for interface info (%u bytes)\n", if_list_size);
+ return -3;
+ } else {
+ DEBUGMSGTL(("access:interface:container:arch",
+ "allocated %u 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 = (char*)malloc(entry->paddr_len);
+ memcpy(entry->paddr, adl->sdl_data + adl->sdl_nlen, adl->sdl_alen);
+ DEBUGMSGTL(("access:interface:container:arch",
+ "%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 = (char*)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 {
+ entry->oper_status = IFOPERSTATUS_UNKNOWN;
+ }
+#else
+ entry->oper_status = IFOPERSTATUS_UP;
+#endif
+ } else {
+ entry->admin_status = IFADMINSTATUS_DOWN;
+ /* IF-MIB specifically says that ifOperStatus should be down in this case */
+ entry->oper_status = IFOPERSTATUS_DOWN;
+ }
+
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V4_REASMMAX;
+ entry->reasm_max = IP_MAXPACKET;
+
+ /* 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 & IFF_PROMISC) entry->promiscuous = 1;
+
+ /* try to guess the speed from media type */
+ netsnmp_openbsd_interface_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:arch",
+ "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:arch",
+ "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:arch",
+ "%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:arch",
+ "%s: flags=0x%x\n", entry->name, entry->ns_flags));
+ }
+
+ if (if_list != NULL)
+ free(if_list);
+
+ return 0;
+}
+
+/*
+ * subroutine to translate known media typed to speed.
+ * see /usr/include/net/if_media.h for definitions
+ */
+
+void
+_openbsd_interface_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_SX:
+ 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;
+ }
+ 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_openbsd_interface_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;
+ }
+
+ memset(&ifmr, 0, sizeof(ifmr));
+ strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name));
+
+ 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.
+ */
+
+ _openbsd_interface_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++) {
+
+ _openbsd_interface_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:arch",
+ "%s: speed: %u, speed_high: %u\n",
+ name, *speed, *speed_high));
+
+ return *speed;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_INTERFACE_ARCH_SET_ADMIN_STATUS
+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 is not (yet) implemented for FreeBSD.\n");
+
+ return -4;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INTERFACE_ARCH_SET_ADMIN_STATUS */
+
diff --git a/agent/mibgroup/if-mib/data_access/interface_solaris2.c b/agent/mibgroup/if-mib/data_access/interface_solaris2.c
new file mode 100644
index 0000000..8aa47f8
--- /dev/null
+++ b/agent/mibgroup/if-mib/data_access/interface_solaris2.c
@@ -0,0 +1,363 @@
+/*
+ * Interface MIB architecture support for Solaris
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "if-mib/ifTable/ifTable_constants.h"
+#include "kernel_sunos5.h"
+#include "mibII/mibII_common.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>
+
+netsnmp_feature_child_of(interface_arch_set_admin_status, interface_all)
+
+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 %u)\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 = (char*)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);
+ memset(ipv4e, '\0', 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);
+ }
+ memset(ipv6e, '\0', sizeof(*ipv6e));
+ return (0);
+}
+#endif /* SOLARIS_HAVE_IPV6_MIB_SUPPORT */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INTERFACE_ARCH_SET_ADMIN_STATUS
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INTERFACE_ARCH_SET_ADMIN_STATUS */
diff --git a/agent/mibgroup/if-mib/data_access/interface_sysctl.c b/agent/mibgroup/if-mib/data_access/interface_sysctl.c
new file mode 100644
index 0000000..1deff82
--- /dev/null
+++ b/agent/mibgroup/if-mib/data_access/interface_sysctl.c
@@ -0,0 +1,581 @@
+/*
+ * Interface MIB architecture support
+ *
+ * Based on patch 1362403, submited by Rojer
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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>
+
+netsnmp_feature_child_of(interface_arch_set_admin_status, interface_all)
+
+/*
+ * 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
+
+#define starttime (*(const struct timeval*)netsnmp_get_agent_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;
+#if defined(IFM_TOKEN)
+ 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 /* IFM_TOK_STP100 */
+ }
+ break;
+#endif /* IFM_TOKEN */
+#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;
+ }
+
+ memset(&ifmr, 0, sizeof(ifmr));
+ strlcpy(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 > m_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;
+}
+
+static void set_counter(struct counter64 *c, uint64_t v)
+{
+ c->low = (uint32_t)(v);
+ c->high = (v) >> 32;
+}
+
+/*
+ *
+ * @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;
+#ifdef HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_NSEC
+ struct timespec startspec;
+
+ TIMEVAL_TO_TIMESPEC(&starttime, &startspec);
+#endif
+
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "load (flags %u)\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 = (u_char*)malloc(if_list_size);
+ if (if_list == NULL) {
+ snmp_log(LOG_ERR, "could not allocate memory for interface info "
+ "(%zu bytes)\n", if_list_size);
+ return -3;
+ } else {
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "allocated %zu 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 = (char*)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 = (char*)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 */
+ set_counter(&entry->stats.ibytes, ifp->ifm_data.ifi_ibytes);
+ set_counter(&entry->stats.iucast, ifp->ifm_data.ifi_ipackets);
+ set_counter(&entry->stats.imcast, ifp->ifm_data.ifi_imcasts);
+ 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;
+
+ set_counter(&entry->stats.obytes, ifp->ifm_data.ifi_obytes);
+ set_counter(&entry->stats.oucast, ifp->ifm_data.ifi_opackets);
+ set_counter(&entry->stats.omcast, ifp->ifm_data.ifi_omcasts);
+ 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;
+
+#ifdef HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_NSEC
+ if (timespeccmp(&ifp->ifm_data.ifi_lastchange, &startspec, >)) {
+#else
+ if (timercmp(&ifp->ifm_data.ifi_lastchange, &starttime, >)) {
+#endif
+ 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 %d for %s\n", (int)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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_INTERFACE_ARCH_SET_ADMIN_STATUS
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INTERFACE_ARCH_SET_ADMIN_STATUS */
diff --git a/agent/mibgroup/if-mib/data_access/interface_sysctl.h b/agent/mibgroup/if-mib/data_access/interface_sysctl.h
new file mode 100644
index 0000000..2a267d4
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/if-mib/ifTable.h b/agent/mibgroup/if-mib/ifTable.h
new file mode 100644
index 0000000..65fa09a
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(if-mib/ifTable/ifTable)
diff --git a/agent/mibgroup/if-mib/ifTable/ifTable.c b/agent/mibgroup/if-mib/ifTable/ifTable.c
new file mode 100644
index 0000000..d9b7252
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifTable/ifTable.c
@@ -0,0 +1,2363 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(interface_access_entry_set_admin_status)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * 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/ipv6InterfaceTable/ipv6InterfaceTable.h"
+#endif
+#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
+# include "if-mib/ifXTable/ifXTable.h"
+#endif
+
+const oid ifTable_oid[] = { IFTABLE_OID };
+const int ifTable_oid_size = OID_LENGTH(ifTable_oid);
+
+ifTable_registration ifTable_user_context;
+static ifTable_registration *ifTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ ifTable_user_context_p = 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(ifTable_user_context_p, flags);
+
+ /*
+ * register scalar for ifNumber
+ */
+ {
+ const 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_p);
+ netsnmp_free_all_list_data(ifTable_user_context_p);
+ ifTable_user_context_p = NULL;
+}
+
+/**
+ * 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) {
+ /*
+ * notify library to save changed rows
+ */
+ snmp_store_needed(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) =
+ (char*)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) =
+ (char*)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) > (size_t)nullOidLen);
+ (*ifSpecific_val_ptr_len_ptr) = (size_t)nullOidLen;
+ memcpy(*ifSpecific_val_ptr_ptr, &nullOid, (size_t)nullOidLen);
+#endif
+
+ return MFD_SUCCESS;
+} /* ifSpecific_get */
+
+
+
+/** @} */
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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 */
+
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+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/agent/mibgroup/if-mib/ifTable/ifTable.h b/agent/mibgroup/if-mib/ifTable/ifTable.h
new file mode 100644
index 0000000..e90634f
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifTable/ifTable.h
@@ -0,0 +1,687 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+#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 _mfd_ifTable_undo_setup_allocate(ifTable_rowreq_ctx *rowreq_ctx);
+ void _mfd_ifTable_undo_setup_release(ifTable_rowreq_ctx *rowreq_ctx);
+ 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 const oid ifTable_oid[];
+ extern const 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);
+
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ *********************************************************************
+ * 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);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * 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/agent/mibgroup/if-mib/ifTable/ifTable_constants.h b/agent/mibgroup/if-mib/ifTable/ifTable_constants.h
new file mode 100644
index 0000000..1f5d87a
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/if-mib/ifTable/ifTable_data_access.c b/agent/mibgroup/if-mib/ifTable/ifTable_data_access.c
new file mode 100644
index 0000000..b8a09b5
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifTable/ifTable_data_access.c
@@ -0,0 +1,729 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+netsnmp_feature_require(container_linked_list)
+
+/*
+ * 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
+
+#ifdef USING_IP_MIB_IPV6INTERFACETABLE_IPV6INTERFACETABLE_MODULE
+# include "mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h"
+#endif
+
+typedef struct cd_container_s {
+ netsnmp_container *current;
+ netsnmp_container *deleted;
+} cd_container;
+
+/*
+ * flag so we know not to set row/table last change times
+ * during startup.
+ */
+static int _first_load = 1;
+
+/*
+ * Value of interface_fadeout config option
+ */
+static int fadeout = IFTABLE_REMOVE_MISSING_AFTER;
+/*
+ * Value of interface_replace_old config option
+ */
+static int replace_old = 0;
+
+static void
+_delete_missing_interface(ifTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_container *container);
+
+/** @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
+ */
+
+static void
+parse_interface_fadeout(const char *token, char *line)
+{
+ fadeout = atoi(line);
+}
+static void
+parse_interface_replace_old(const char *token, char *line)
+{
+ if (strcmp(line, "yes") == 0
+ || strcmp(line, "y") == 0
+ || strcmp(line, "true") == 0
+ || strcmp(line, "1") == 0) {
+ replace_old = 1;
+ return;
+ }
+ if (strcmp(line, "no") == 0
+ || strcmp(line, "n") == 0
+ || strcmp(line, "false") == 0
+ || strcmp(line, "0") == 0) {
+ replace_old = 0;
+ return;
+ }
+ snmp_log(LOG_ERR, "Invalid value of interface_replace_old parameter: '%s'\n",
+ line);
+}
+
+/**
+ * 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.
+ */
+ snmpd_register_config_handler("interface_fadeout", parse_interface_fadeout, NULL,
+ "interface_fadeout seconds");
+ snmpd_register_config_handler("interface_replace_old",
+ parse_interface_replace_old, NULL, "interface_replace_old yes|no");
+
+ 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 */
+
+void
+send_linkUpDownNotifications(oid *notification_oid, size_t notification_oid_len, int if_index, int if_admin_status, int if_oper_status)
+{
+ /*
+ * 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 -
+ * IF-MIB::ifIndex,
+ * IF-MIB::ifAdminStatus, and
+ * IF-MIB::ifOperStatus
+ */
+ oid if_index_oid[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 0 };
+ size_t if_index_oid_len = OID_LENGTH(if_index_oid);
+ oid if_admin_status_oid[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 7, 0 };
+ size_t if_admin_status_oid_len = OID_LENGTH(if_admin_status_oid);
+ oid if_oper_status_oid[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 8, 0 };
+ size_t if_oper_status_oid_len = OID_LENGTH(if_oper_status_oid);
+
+ /*
+ * here is where we store the variables to be sent in the trap
+ */
+ netsnmp_variable_list *notification_vars = NULL;
+
+ DEBUGMSGTL(("rsys:linkUpDownNotifications", "defining the trap\n"));
+
+ /*
+ * update the instance for each variable to be sent in the trap
+ */
+ if_index_oid[10] = if_index;
+ if_admin_status_oid[10] = if_index;
+ if_oper_status_oid[10] = if_index;
+
+ /*
+ * 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,
+ if_index_oid, if_index_oid_len,
+ ASN_INTEGER,
+ (u_char *)&if_index,
+ sizeof(if_index));
+
+ /*
+ * if we want to insert additional objects, we do it here
+ */
+ snmp_varlist_add_variable(&notification_vars,
+ if_admin_status_oid, if_admin_status_oid_len,
+ ASN_INTEGER,
+ (u_char *)&if_admin_status,
+ sizeof(if_admin_status));
+
+ snmp_varlist_add_variable(&notification_vars,
+ if_oper_status_oid, if_oper_status_oid_len,
+ ASN_INTEGER,
+ (u_char *)&if_oper_status,
+ sizeof(if_oper_status));
+
+ /*
+ * 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(("rsys:linkUpDownNotifications", "sending the trap\n"));
+ send_v2trap(notification_vars);
+
+ /*
+ * free the created notification variable list
+ */
+ DEBUGMSGTL(("rsys:linkUpDownNotifications", "cleaning up\n"));
+ snmp_free_varbind(notification_vars);
+}
+
+/**
+ * check entry for update
+ *
+ */
+static void
+_check_interface_entry_for_updates(ifTable_rowreq_ctx * rowreq_ctx,
+ cd_container *cdc)
+{
+ char oper_changed = 0;
+ int lastchanged = rowreq_ctx->data.ifLastChange;
+ netsnmp_container *ifcontainer = cdc->current;
+
+ /*
+ * check for matching entry. We can do this directly, since
+ * both containers use the same index.
+ */
+ netsnmp_interface_entry *ifentry =
+ (netsnmp_interface_entry*)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) {
+ rowreq_ctx->known_missing = 1;
+ DEBUGMSGTL(("ifTable:access", "updating missing entry %s\n",rowreq_ctx->data.ifName));
+ rowreq_ctx->data.ifAdminStatus = IFADMINSTATUS_DOWN;
+ rowreq_ctx->data.ifOperStatus = IFOPERSTATUS_DOWN;
+ oper_changed = 1;
+ }
+ if (rowreq_ctx->known_missing) {
+ time_t now = netsnmp_get_agent_uptime();
+ u_long diff = (now - rowreq_ctx->data.ifLastChange) / 100;
+ DEBUGMSGTL(("verbose:ifTable:access", "missing entry for %ld seconds\n", diff));
+ if (diff >= fadeout) {
+ DEBUGMSGTL(("ifTable:access", "marking missing entry %s for "
+ "removal after %d seconds\n", rowreq_ctx->data.ifName,
+ fadeout));
+ if (NULL == cdc->deleted)
+ cdc->deleted = netsnmp_container_find("ifTable_deleted:linked_list");
+ if (NULL == cdc->deleted)
+ snmp_log(LOG_ERR, "couldn't create container for deleted interface\n");
+ else {
+ CONTAINER_INSERT(cdc->deleted, rowreq_ctx);
+ }
+ }
+ }
+ } else {
+ DEBUGMSGTL(("ifTable:access", "updating existing entry %s\n",
+ rowreq_ctx->data.ifName));
+
+#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
+ {
+ int rc = strcmp(rowreq_ctx->data.ifName,
+ ifentry->name);
+ if (rc != 0) {
+ NETSNMP_LOGONCE((LOG_ERR, "Name of an interface changed. Such " \
+ "interfaces will keep its old name in IF-MIB.\n"));
+ 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();
+#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
+ if (rowreq_ctx->data.ifLinkUpDownTrapEnable == 1) {
+ if (rowreq_ctx->data.ifOperStatus == IFOPERSTATUS_UP) {
+ oid notification_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 5, 4 };
+ send_linkUpDownNotifications(notification_oid, OID_LENGTH(notification_oid),
+ rowreq_ctx->tbl_idx.ifIndex,
+ rowreq_ctx->data.ifAdminStatus,
+ rowreq_ctx->data.ifOperStatus);
+ } else if (rowreq_ctx->data.ifOperStatus == IFOPERSTATUS_DOWN) {
+ oid notification_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 5, 3 };
+ send_linkUpDownNotifications(notification_oid, OID_LENGTH(notification_oid),
+ rowreq_ctx->tbl_idx.ifIndex,
+ rowreq_ctx->data.ifAdminStatus,
+ rowreq_ctx->data.ifOperStatus);
+ }
+ }
+#endif
+ }
+
+ else
+ rowreq_ctx->data.ifLastChange = lastchanged;
+}
+
+/**
+ * Remove all old interfaces with the same name as the newly added one.
+ */
+static void
+_check_and_replace_old(netsnmp_interface_entry *ifentry,
+ netsnmp_container *container)
+{
+ netsnmp_iterator *it;
+ ifTable_rowreq_ctx * rowreq_ctx;
+ netsnmp_container *to_delete;
+
+ to_delete = netsnmp_container_find("ifTable_deleted:linked_list");
+ if (NULL == to_delete) {
+ snmp_log(LOG_ERR, "couldn't create container for deleted interface\n");
+ return;
+ }
+
+ it = CONTAINER_ITERATOR(container);
+ for (rowreq_ctx = ITERATOR_FIRST(it); rowreq_ctx; rowreq_ctx = ITERATOR_NEXT(it)) {
+ if (strcmp(ifentry->name, rowreq_ctx->data.ifentry->name) == 0) {
+ DEBUGMSGTL(("ifTable:access",
+ "removing interface %ld due to new %s\n",
+ (long) rowreq_ctx->data.ifentry->index, ifentry->name));
+ CONTAINER_INSERT(to_delete, rowreq_ctx);
+ }
+ }
+ ITERATOR_RELEASE(it);
+
+ CONTAINER_FOR_EACH(to_delete,
+ (netsnmp_container_obj_func *) _delete_missing_interface,
+ container);
+ CONTAINER_FREE(to_delete);
+}
+
+/**
+ * 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))) {
+ if (replace_old)
+ _check_and_replace_old(ifentry, container);
+
+ 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);
+ }
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_delete_missing_interface(ifTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_container *container)
+{
+ DEBUGMSGTL(("ifTable:access", "removing missing entry %s\n",
+ rowreq_ctx->data.ifName));
+
+ CONTAINER_REMOVE(container, rowreq_ctx);
+
+ ifTable_release_rowreq_ctx(rowreq_ctx);
+}
+
+/**
+ * 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)
+{
+ cd_container cdc;
+
+ 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.
+ */
+ cdc.current =
+ netsnmp_access_interface_container_load(NULL,
+ NETSNMP_ACCESS_INTERFACE_INIT_NOFLAGS);
+ if (NULL == cdc.current)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+
+ cdc.deleted = NULL; /* created as needed */
+
+ /*
+ * 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, &cdc);
+
+ /*
+ * now remove any missing interfaces
+ */
+ if (NULL != cdc.deleted) {
+ CONTAINER_FOR_EACH(cdc.deleted,
+ (netsnmp_container_obj_func *) _delete_missing_interface,
+ container);
+ CONTAINER_FREE(cdc.deleted);
+ }
+
+ /*
+ * now add any new interfaces
+ */
+ CONTAINER_FOR_EACH(cdc.current,
+ (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(cdc.current,
+ NETSNMP_ACCESS_INTERFACE_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:ifTable:ifTable_cache_load",
+ "%lu records\n", (unsigned long)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/agent/mibgroup/if-mib/ifTable/ifTable_data_access.h b/agent/mibgroup/if-mib/ifTable/ifTable_data_access.h
new file mode 100644
index 0000000..445929b
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifTable/ifTable_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$
+ */
+#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 3
+
+#define IFTABLE_REMOVE_MISSING_AFTER (5 * 60) /* seconds */
+
+ 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/agent/mibgroup/if-mib/ifTable/ifTable_defs.h b/agent/mibgroup/if-mib/ifTable/ifTable_defs.h
new file mode 100644
index 0000000..b9750e9
--- /dev/null
+++ b/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/agent/mibgroup/if-mib/ifTable/ifTable_interface.c b/agent/mibgroup/if-mib/ifTable/ifTable_interface.c
new file mode 100644
index 0000000..41d38ee
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifTable/ifTable_interface.c
@@ -0,0 +1,2019 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(ifTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+netsnmp_feature_child_of(iftable_container_get, ifTable_external_access)
+netsnmp_feature_child_of(ifxtable_shutdown_interface, netsnmp_unused)
+netsnmp_feature_child_of(ifXTable_container_size, ifXTable_external_access)
+netsnmp_feature_child_of(ifXTable_registration_set, ifXTable_external_access)
+netsnmp_feature_child_of(ifXTable_registration_get, ifXTable_external_access)
+netsnmp_feature_child_of(ifXTable_container_get, ifXTable_external_access)
+netsnmp_feature_child_of(iftable_container_size, ifTable_external_access)
+netsnmp_feature_child_of(iftable_registration_set, ifTable_external_access)
+netsnmp_feature_child_of(iftable_registration_get, ifTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFTABLE_CONTAINER_GET
+netsnmp_container *
+ifTable_container_get(void)
+{
+ return ifTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFTABLE_REGISTRATION_GET
+ifTable_registration *
+ifTable_registration_get(void)
+{
+ return ifTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFTABLE_REGISTRATION_SET
+ifTable_registration *
+ifTable_registration_set(ifTable_registration * newreg)
+{
+ ifTable_registration *old = ifTable_if_ctx.user_ctx;
+ ifTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFTABLE_CONTAINER_SIZE
+int
+ifTable_container_size(void)
+{
+ return CONTAINER_SIZE(ifTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFTABLE_CONTAINER_SIZE */
+
+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;
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+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);
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+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 retrieval.
+ */
+ 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;
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /*
+ * 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ /*************************************************
+ *
+ * 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 |
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ HANDLER_CAN_RWRITE
+#else
+ HANDLER_CAN_RONLY
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+ );
+
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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
+ */
+ {
+ const oid iftlc_oid[] = { IFTABLE_LAST_CHANGE };
+ netsnmp_register_watched_scalar2(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 = (ifTable_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 = (ifTable_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 = (ifTable_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 */
+
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+
+/***********************************************************************
+ *
+ * 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 = (ifTable_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 = (ifTable_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 = (ifTable_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 = (ifTable_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 = (ifTable_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 = (ifTable_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 = (ifTable_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 = (ifTable_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 = (ifTable_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 */
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+/***********************************************************************
+ *
+ * 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFTABLE_EXTERNAL_ACCESS
+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 = (ifTable_rowreq_ctx*)CONTAINER_FIND(ifTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFTABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/if-mib/ifTable/ifTable_interface.h b/agent/mibgroup/if-mib/ifTable/ifTable_interface.h
new file mode 100644
index 0000000..be2028a
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/if-mib/ifXTable.h b/agent/mibgroup/if-mib/ifXTable.h
new file mode 100644
index 0000000..5e99c0a
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifXTable.h
@@ -0,0 +1,6 @@
+/*
+ * module to include the modules
+ */
+
+config_require(if-mib/ifXTable/ifXTable)
+
diff --git a/agent/mibgroup/if-mib/ifXTable/ifXTable.c b/agent/mibgroup/if-mib/ifXTable/ifXTable.c
new file mode 100644
index 0000000..bb3e736
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable.c
@@ -0,0 +1,2541 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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-features.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"
+
+netsnmp_feature_require(ifTable_container_get)
+netsnmp_feature_require(ifTable_container_size)
+
+/*
+ * 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
+
+const oid ifXTable_oid[] = { IFXTABLE_OID };
+const int ifXTable_oid_size = OID_LENGTH(ifXTable_oid);
+
+ifXTable_registration ifXTable_user_context;
+static ifXTable_registration *ifXTable_user_context_p;
+
+/**
+ * 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)
+{
+ 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.
+ */
+ ifXTable_user_context_p = 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(ifXTable_user_context_p, 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 */
+
+void
+shutdown_ifXTable(void)
+{
+ netsnmp_free_all_list_data(ifXTable_user_context_p);
+ ifXTable_user_context_p = NULL;
+}
+
+/**
+ * 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) {
+ /*
+ * notify library to save changed rows
+ */
+ snmp_store_needed(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)
+{
+ size_t 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) = (char*)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 / 1000000;
+ 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);
+
+ (*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) = (char*)
+ 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 */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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 */
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/** @} */
+/** @{ */
diff --git a/agent/mibgroup/if-mib/ifXTable/ifXTable.h b/agent/mibgroup/if-mib/ifXTable/ifXTable.h
new file mode 100644
index 0000000..ba22f97
--- /dev/null
+++ b/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$
+ */
+#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 const oid ifXTable_oid[];
+ extern const 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
+ */
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * 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/agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h b/agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h
new file mode 100644
index 0000000..67e1996
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h
@@ -0,0 +1,148 @@
+/*
+ * 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$
+ */
+#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.
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#define IFXTABLE_SETTABLE_COLS (COLUMN_IFLINKUPDOWNTRAPENABLE_FLAG | COLUMN_IFALIAS_FLAG)
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+#define IFXTABLE_SETTABLE_COLS 0
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ /*
+ * 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/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.c b/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.c
new file mode 100644
index 0000000..188c6db
--- /dev/null
+++ b/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$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#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/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.h b/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.h
new file mode 100644
index 0000000..4bc9c30
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c b/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
new file mode 100644
index 0000000..6828ab2
--- /dev/null
+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
@@ -0,0 +1,2201 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.h>
+#include <net-snmp/net-snmp-features.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>
+
+netsnmp_feature_child_of(ifXTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(cache_find_by_oid)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFXTABLE_CONTAINER_GET
+netsnmp_container *
+ifXTable_container_get(void)
+{
+ return ifXTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFXTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFXTABLE_REGISTRATION_GET
+ifXTable_registration *
+ifXTable_registration_get(void)
+{
+ return ifXTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFXTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFXTABLE_REGISTRATION_SET
+ifXTable_registration *
+ifXTable_registration_set(ifXTable_registration * newreg)
+{
+ ifXTable_registration *old = ifXTable_if_ctx.user_ctx;
+ ifXTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFXTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFXTABLE_CONTAINER_SIZE
+int
+ifXTable_container_size(void)
+{
+ return CONTAINER_SIZE(ifXTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFXTABLE_CONTAINER_SIZE */
+
+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;
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+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);
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+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 retrieval.
+ */
+ 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;
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /*
+ * 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ /*************************************************
+ *
+ * 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 |
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ HANDLER_CAN_RWRITE
+#else
+ HANDLER_CAN_RONLY
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+ );
+
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_IFXTABLE_SHUTDOWN_INTERFACE
+void
+_ifXTable_shutdown_interface(ifXTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ifXTable_container_shutdown(&ifXTable_if_ctx);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFXTABLE_SHUTDOWN_INTERFACE */
+
+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 = (ifXTable_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 = (ifXTable_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 = (ifXTable_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 */
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+/***********************************************************************
+ *
+ * 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 = (ifXTable_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 = (ifXTable_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 = (ifXTable_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 = (ifXTable_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 = (ifXTable_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 = (ifXTable_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 = (ifXTable_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 = (ifXTable_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 = (ifXTable_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 */
+
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+/***********************************************************************
+ *
+ * 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 const 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)
+{
+ netsnmp_container **container_p;
+ int rc;
+
+ register_config_handler(NULL, row_token,
+ _ifXTable_container_row_restore, NULL, NULL);
+ netsnmp_assert(container);
+ memdup((u_char **)&container_p, &container, sizeof(container));
+ netsnmp_assert(container_p);
+ rc = snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_STORE_DATA,
+ _ifXTable_container_save_rows, container_p);
+
+ 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, remember to add space for the identifier and separator
+ * 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 = (ifXTable_rowreq_ctx*)CONTAINER_FIND(container, &index);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_DEBUG, "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 & 0xFF)) {
+ /*
+ * 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");
+ 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,
+ (u_char *) 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;
+}
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_IFXTABLE_EXTERNAL_ACCESS
+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 = (ifXTable_rowreq_ctx*)CONTAINER_FIND(ifXTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IFXTABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h b/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h
new file mode 100644
index 0000000..c7fbb77
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/ip-forward-mib.h b/agent/mibgroup/ip-forward-mib.h
new file mode 100644
index 0000000..969ba17
--- /dev/null
+++ b/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/agent/mibgroup/ip-forward-mib/data_access/route.h b/agent/mibgroup/ip-forward-mib/data_access/route.h
new file mode 100644
index 0000000..a2b4ee4
--- /dev/null
+++ b/agent/mibgroup/ip-forward-mib/data_access/route.h
@@ -0,0 +1,31 @@
+/*
+ * route data access header
+ *
+ * $Id$
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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
+config_error(the route data access library is not available in this environment.)
+#endif
+
+/** need interface for ifIndex */
+config_require(if-mib/data_access/interface)
+
diff --git a/agent/mibgroup/ip-forward-mib/data_access/route_common.c b/agent/mibgroup/ip-forward-mib/data_access/route_common.c
new file mode 100644
index 0000000..84c1810
--- /dev/null
+++ b/agent/mibgroup/ip-forward-mib/data_access/route_common.c
@@ -0,0 +1,281 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id$
+ */
+#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:fifo");
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_route\n");
+ return NULL;
+ }
+ }
+
+ container->container_name = strdup("_route");
+
+ 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
+ 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/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c b/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c
new file mode 100644
index 0000000..815c415
--- /dev/null
+++ b/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c
@@ -0,0 +1,193 @@
+/*
+ * 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
+
+#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 HAVE_STRUCT_RTENTRY_RT_DST
+# define rt_dst rt_nodes->rn_key
+#endif
+#ifndef HAVE_STRUCT_RTENTRY_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/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.h b/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.h
new file mode 100644
index 0000000..18c24af
--- /dev/null
+++ b/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/agent/mibgroup/ip-forward-mib/data_access/route_linux.c b/agent/mibgroup/ip-forward-mib/data_access/route_linux.c
new file mode 100644
index 0000000..7228e38
--- /dev/null
+++ b/agent/mibgroup/ip-forward-mib/data_access/route_linux.c
@@ -0,0 +1,415 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id$
+ */
+#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"))) {
+ NETSNMP_LOGONCE((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, rc;
+ uint32_t dest, nexthop, mask;
+ unsigned flags, 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 %d %u %d %x %*d %*d %*d\n",
+ rtent_name, &dest, &nexthop,
+ /*
+ * XXX: fix type of the args
+ */
+ &flags, &refcnt, &use, &entry->rt_metric1,
+ &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
+ */
+ strlcpy(name, rtent_name, sizeof(name));
+
+ /*
+ * 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);
+
+#ifdef USING_IP_FORWARD_MIB_IPCIDRROUTETABLE_IPCIDRROUTETABLE_MODULE
+ memcpy(&entry->rt_mask, &mask, 4);
+ /** 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
+ */
+ mask = htonl(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 than I want to get into now. Fix later.
+ */
+ if (0 == nexthop) {
+ entry->rt_policy = calloc(3, sizeof(oid));
+ entry->rt_policy[2] = entry->if_index;
+ entry->rt_policy_len = sizeof(oid)*3;
+ }
+#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;
+
+ 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"))) {
+ DEBUGMSGTL(("9:access:route:container", "cannot open /proc/net/ipv6_route\n"));
+ return -2;
+ }
+
+ 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", c_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 distinguish between them.
+ */
+ entry->rt_policy = calloc(3, sizeof(oid));
+ entry->rt_policy[2] = entry->ns_rt_index;
+ entry->rt_policy_len = sizeof(oid)*3;
+#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/agent/mibgroup/ip-forward-mib/data_access/route_linux.h b/agent/mibgroup/ip-forward-mib/data_access/route_linux.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/agent/mibgroup/ip-forward-mib/data_access/route_linux.h
diff --git a/agent/mibgroup/ip-forward-mib/inetCidrRouteTable.h b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable.h
new file mode 100644
index 0000000..542d516
--- /dev/null
+++ b/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/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c
new file mode 100644
index 0000000..0f013ea
--- /dev/null
+++ b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c
@@ -0,0 +1,2688 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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-features.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"
+
+netsnmp_feature_require(inetCidrRouteTable_container_get)
+netsnmp_feature_require(inetCidrRouteTable_container_size)
+
+const oid inetCidrRouteTable_oid[] = { INETCIDRROUTETABLE_OID };
+const int inetCidrRouteTable_oid_size =
+OID_LENGTH(inetCidrRouteTable_oid);
+
+inetCidrRouteTable_registration inetCidrRouteTable_user_context;
+static inetCidrRouteTable_registration *inetCidrRouteTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ inetCidrRouteTable_user_context_p =
+ 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
+ (inetCidrRouteTable_user_context_p, 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_p);
+ netsnmp_free_all_list_data(inetCidrRouteTable_user_context_p);
+ inetCidrRouteTable_user_context_p = NULL;
+}
+
+/**
+ * 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]);
+ /** 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 / sizeof(inetCidrRoutePolicy_val_ptr[0])))) {
+ snmp_log(LOG_ERR,
+ "inetCidrRoutePolicy: Not enough space for value (%d < %d)\n",
+ (int)tbl_idx->inetCidrRoutePolicy_len,
+ (int)(inetCidrRoutePolicy_val_ptr_len / sizeof(inetCidrRoutePolicy_val_ptr[0])));
+ return MFD_ERROR;
+ }
+ if (0 == inetCidrRoutePolicy_val_ptr_len) {
+ inetCidrRoutePolicy_val_ptr_len = nullOidLen;
+ inetCidrRoutePolicy_val_ptr = nullOid;
+ }
+ tbl_idx->inetCidrRoutePolicy_len = inetCidrRoutePolicy_val_ptr_len / sizeof(oid);
+ memcpy(tbl_idx->inetCidrRoutePolicy, inetCidrRoutePolicy_val_ptr,
+ inetCidrRoutePolicy_val_ptr_len);
+
+ /*
+ * 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 / sizeof(inetCidrRouteNextHop_val_ptr[0])))) {
+ snmp_log(LOG_ERR,
+ "inetCidrRouteNexthop: Not enough space for value (%d < %d)\n",
+ (int)tbl_idx->inetCidrRouteNextHop_len,
+ (int)(inetCidrRouteNextHop_val_ptr_len / sizeof(inetCidrRouteNextHop_val_ptr[0])));
+ return MFD_ERROR;
+ }
+ tbl_idx->inetCidrRouteNextHop_len = inetCidrRouteNextHop_val_ptr_len / sizeof(inetCidrRouteNextHop_val_ptr[0]);
+ 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/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
new file mode 100644
index 0000000..b8132e1
--- /dev/null
+++ b/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$
+ */
+#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 const oid inetCidrRouteTable_oid[];
+ extern const 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/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
new file mode 100644
index 0000000..0fe26b8
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c
new file mode 100644
index 0000000..beebb2c
--- /dev/null
+++ b/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$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#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,
+ (char *) 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,
+ (char *) 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", (int)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", (int)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/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
new file mode 100644
index 0000000..9ad9067
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
new file mode 100644
index 0000000..0dba9d2
--- /dev/null
+++ b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
@@ -0,0 +1,2402 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(inetCidrRouteTable_external_access, libnetsnmpmibs)
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(table_container_row_insert)
+netsnmp_feature_require(check_all_requests_error)
+
+netsnmp_feature_child_of(inetCidrRouteTable_container_size, inetCidrRouteTable_external_access)
+netsnmp_feature_child_of(inetCidrRouteTable_registration_set, inetCidrRouteTable_external_access)
+netsnmp_feature_child_of(inetCidrRouteTable_registration_get, inetCidrRouteTable_external_access)
+netsnmp_feature_child_of(inetCidrRouteTable_container_get, inetCidrRouteTable_external_access)
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_CONTAINER_GET
+netsnmp_container *
+inetCidrRouteTable_container_get(void)
+{
+ return inetCidrRouteTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_REGISTRATION_GET
+inetCidrRouteTable_registration *
+inetCidrRouteTable_registration_get(void)
+{
+ return inetCidrRouteTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_REGISTRATION_SET
+inetCidrRouteTable_registration *
+inetCidrRouteTable_registration_set(inetCidrRouteTable_registration *
+ newreg)
+{
+ inetCidrRouteTable_registration *old =
+ inetCidrRouteTable_if_ctx.user_ctx;
+ inetCidrRouteTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_CONTAINER_SIZE
+int
+inetCidrRouteTable_container_size(void)
+{
+ return CONTAINER_SIZE(inetCidrRouteTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_CONTAINER_SIZE */
+
+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;
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+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 retrieval.
+ */
+ 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;
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /*
+ * 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ /*************************************************
+ *
+ * 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
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ | HANDLER_CAN_RWRITE
+#endif
+ );
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 */
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+/***********************************************************************
+ *
+ * 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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 = (inetCidrRouteTable_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 */
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+/***********************************************************************
+ *
+ * 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(INETCIDRROUTETABLE_CACHE_TIMEOUT,
+ _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_ctx->container->container_name = strdup("inetCidrRouteTable");
+
+ /* set allow duplicates this makes insert O(1) */
+ netsnmp_binary_array_options_set(if_ctx->container, 1,
+ CONTAINER_KEY_ALLOW_DUPLICATES);
+
+ 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_EXTERNAL_ACCESS
+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 = (inetCidrRouteTable_rowreq_ctx*)
+ CONTAINER_FIND(inetCidrRouteTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETCIDRROUTETABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h b/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
new file mode 100644
index 0000000..bda0757
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/ip-forward-mib/ipCidrRouteTable.h b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable.h
new file mode 100644
index 0000000..0214caf
--- /dev/null
+++ b/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/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c
new file mode 100644
index 0000000..323c1bc
--- /dev/null
+++ b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c
@@ -0,0 +1,3361 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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"
+
+const oid ipCidrRouteTable_oid[] = { IPCIDRROUTETABLE_OID };
+const int ipCidrRouteTable_oid_size =
+OID_LENGTH(ipCidrRouteTable_oid);
+
+ipCidrRouteTable_registration ipCidrRouteTable_user_context;
+static ipCidrRouteTable_registration *ipCidrRouteTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ ipCidrRouteTable_user_context_p
+ = 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
+ (ipCidrRouteTable_user_context_p, flags);
+} /* initialize_table_ipCidrRouteTable */
+
+/**
+ * Shutdown the table ipCidrRouteTable
+ */
+void
+shutdown_table_ipCidrRouteTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipCidrRouteTable_shutdown_interface(ipCidrRouteTable_user_context_p);
+ netsnmp_free_all_list_data(ipCidrRouteTable_user_context_p);
+ ipCidrRouteTable_user_context_p = NULL;
+}
+
+/**
+ * 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) < (size_t)nullOidLen) {
+ (*ipCidrRouteInfo_val_ptr_ptr) = (oid*)malloc(nullOidLen);
+ if (NULL == (*ipCidrRouteInfo_val_ptr_ptr))
+ return MFD_ERROR;
+ }
+ (*ipCidrRouteInfo_val_ptr_len_ptr) = (size_t)nullOidLen;
+ memcpy((*ipCidrRouteInfo_val_ptr_ptr), nullOid, (size_t)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/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
new file mode 100644
index 0000000..95767e0
--- /dev/null
+++ b/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$
+ */
+#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 const oid ipCidrRouteTable_oid[];
+ extern const 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/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
new file mode 100644
index 0000000..ae7a3d3
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
new file mode 100644
index 0000000..3955519
--- /dev/null
+++ b/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$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#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", (int)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/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
new file mode 100644
index 0000000..c62cf39
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
new file mode 100644
index 0000000..5e855d4
--- /dev/null
+++ b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
@@ -0,0 +1,2354 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(ipCidrRouteTable_external_access, libnetsnmpmibs)
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(table_container_row_insert)
+netsnmp_feature_require(check_all_requests_error)
+
+
+netsnmp_feature_child_of(ipCidrRouteTable_container_size, ipCidrRouteTable_external_access)
+netsnmp_feature_child_of(ipCidrRouteTable_registration_set, ipCidrRouteTable_external_access)
+netsnmp_feature_child_of(ipCidrRouteTable_registration_get, ipCidrRouteTable_external_access)
+netsnmp_feature_child_of(ipCidrRouteTable_container_get, ipCidrRouteTable_external_access)
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_CONTAINER_GET
+netsnmp_container *
+ipCidrRouteTable_container_get(void)
+{
+ return ipCidrRouteTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_REGISTRATION_GET
+ipCidrRouteTable_registration *
+ipCidrRouteTable_registration_get(void)
+{
+ return ipCidrRouteTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_REGISTRATION_SET
+ipCidrRouteTable_registration *
+ipCidrRouteTable_registration_set(ipCidrRouteTable_registration * newreg)
+{
+ ipCidrRouteTable_registration *old = ipCidrRouteTable_if_ctx.user_ctx;
+ ipCidrRouteTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_CONTAINER_SIZE
+int
+ipCidrRouteTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipCidrRouteTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_CONTAINER_SIZE */
+
+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;
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+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);
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+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 retrieval.
+ */
+ 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;
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /*
+ * 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ /*************************************************
+ *
+ * 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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 = (ipCidrRouteTable_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 = (ipCidrRouteTable_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(in_addr_t);
+ (*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(in_addr_t);
+ (*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(in_addr_t);
+ (*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 = (ipCidrRouteTable_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 */
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+/***********************************************************************
+ *
+ * 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 = (ipCidrRouteTable_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 = (ipCidrRouteTable_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 = (ipCidrRouteTable_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 = (ipCidrRouteTable_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 = (ipCidrRouteTable_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 = (ipCidrRouteTable_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 = (ipCidrRouteTable_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 = (ipCidrRouteTable_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 */
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+/***********************************************************************
+ *
+ * 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(IPCIDRROUTETABLE_CACHE_TIMEOUT,
+ _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_ctx->container->container_name = strdup("ipCidrRouteTable");
+
+ /* set allow duplicates this makes insert O(1) */
+ netsnmp_binary_array_options_set(if_ctx->container, 1,
+ CONTAINER_KEY_ALLOW_DUPLICATES);
+
+ 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_EXTERNAL_ACCESS
+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 = (ipCidrRouteTable_rowreq_ctx*)
+ CONTAINER_FIND(ipCidrRouteTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPCIDRROUTETABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h b/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
new file mode 100644
index 0000000..596a46e
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/ip-mib.h b/agent/mibgroup/ip-mib.h
new file mode 100644
index 0000000..4e8317f
--- /dev/null
+++ b/agent/mibgroup/ip-mib.h
@@ -0,0 +1,15 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipAddressTable);
+config_require(ip-mib/ipAddressPrefixTable);
+config_require(ip-mib/ipDefaultRouterTable);
+config_require(ip-mib/inetNetToMediaTable);
+config_require(ip-mib/ipSystemStatsTable);
+config_require(ip-mib/ip_scalars);
+#ifdef linux
+config_require(ip-mib/ipv6ScopeZoneIndexTable);
+config_require(ip-mib/ipIfStatsTable);
+#endif
+config_add_mib(IP-MIB)
diff --git a/agent/mibgroup/ip-mib/data_access/arp.h b/agent/mibgroup/ip-mib/data_access/arp.h
new file mode 100644
index 0000000..0f536c3
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/arp.h
@@ -0,0 +1,31 @@
+/*
+ * arp data access header
+ *
+ * $Id$
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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( HAVE_LINUX_RTNETLINK_H )
+config_require(ip-mib/data_access/arp_netlink)
+#elif defined( linux )
+config_require(ip-mib/data_access/arp_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ */
+config_error(the arp data access library is not available in this environment.)
+#endif
+
diff --git a/agent/mibgroup/ip-mib/data_access/arp_common.c b/agent/mibgroup/ip-mib/data_access/arp_common.c
new file mode 100644
index 0000000..2958719
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/arp_common.c
@@ -0,0 +1,83 @@
+/*
+ * Arp MIB architecture support
+ *
+ * $Id$
+ */
+#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>
+
+/**---------------------------------------------------------------------*/
+/*
+ * arp_entry functions
+ */
+/**
+ */
+netsnmp_arp_entry *
+netsnmp_access_arp_entry_create(void)
+{
+ netsnmp_arp_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_arp_entry);
+
+ if (NULL == entry)
+ return NULL;
+
+ 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
+ */
+
+/**
+ * Update given entry with new data. Calculate new arp_last_updated, if any
+ * field is changed.
+ */
+void netsnmp_access_arp_entry_update(netsnmp_arp_entry *entry,
+ netsnmp_arp_entry *new_data)
+{
+ int modified = 0;
+
+ entry->generation = new_data->generation;
+ if (entry->arp_ipaddress_len != new_data->arp_ipaddress_len
+ || memcmp(entry->arp_ipaddress, new_data->arp_ipaddress, entry->arp_ipaddress_len) != 0 ) {
+ modified = 1;
+ entry->arp_ipaddress_len = new_data->arp_ipaddress_len;
+ memcpy(entry->arp_ipaddress, new_data->arp_ipaddress, sizeof(entry->arp_ipaddress));
+ }
+ if (entry->arp_physaddress_len != new_data->arp_physaddress_len ||
+ memcmp(entry->arp_physaddress, new_data->arp_physaddress, entry->arp_physaddress_len) != 0) {
+ modified = 1;
+ entry->arp_physaddress_len = new_data->arp_physaddress_len;
+ memcpy(entry->arp_physaddress, new_data->arp_physaddress, sizeof(entry->arp_physaddress_len));
+ }
+ if (entry->arp_state != new_data->arp_state) {
+ modified = 1;
+ entry->arp_state = new_data->arp_state;
+ }
+ if (entry->arp_type != new_data->arp_type) {
+ modified = 1;
+ entry->arp_type = new_data->arp_type;
+ }
+ if (entry->flags != new_data->flags) {
+ modified = 1;
+ entry->flags = new_data->flags;
+ }
+
+ if (modified)
+ entry->arp_last_updated = netsnmp_get_agent_uptime();
+}
diff --git a/agent/mibgroup/ip-mib/data_access/arp_linux.c b/agent/mibgroup/ip-mib/data_access/arp_linux.c
new file mode 100644
index 0000000..a2fa49a
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/arp_linux.c
@@ -0,0 +1,214 @@
+/*
+ * Interface MIB architecture support
+ */
+#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>
+#include <linux/types.h>
+#include <asm/types.h>
+
+static int _load_v4(netsnmp_arp_access *access);
+
+netsnmp_arp_access *
+netsnmp_access_arp_create(u_int init_flags,
+ NetsnmpAccessArpUpdate *update_hook,
+ NetsnmpAccessArpGC *gc_hook,
+ int *cache_timeout, int *cache_flags,
+ char *cache_expired)
+{
+ netsnmp_arp_access *access;
+
+ access = SNMP_MALLOC_TYPEDEF(netsnmp_arp_access);
+ if (NULL == access) {
+ snmp_log(LOG_ERR,"malloc error in netsnmp_access_arp_create\n");
+ return NULL;
+ }
+
+ access->arch_magic = NULL;
+ access->magic = NULL;
+ access->update_hook = update_hook;
+ access->gc_hook = gc_hook;
+ access->synchronized = 0;
+
+ if (cache_timeout != NULL)
+ *cache_timeout = 5;
+ if (cache_flags != NULL)
+ *cache_flags |= NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD
+ | NETSNMP_CACHE_AUTO_RELOAD;
+ access->cache_expired = cache_expired;
+
+ return access;
+}
+
+int netsnmp_access_arp_delete(netsnmp_arp_access *access)
+{
+ if (NULL == access)
+ return 0;
+
+ netsnmp_access_arp_unload(access);
+ free(access);
+
+ return 0;
+}
+
+int netsnmp_access_arp_load(netsnmp_arp_access *access)
+{
+ int rc = 0;
+
+ access->generation++;
+ rc =_load_v4(access);
+ access->gc_hook(access);
+ access->synchronized = (rc == 0);
+
+ return rc;
+}
+
+int netsnmp_access_arp_unload(netsnmp_arp_access *access)
+{
+ access->synchronized = 0;
+
+ return 0;
+}
+
+/**
+ */
+static int
+_load_v4(netsnmp_arp_access *access)
+{
+ FILE *in;
+ char line[128];
+ int rc = 0;
+ netsnmp_arp_entry *entry;
+ char arp[3*NETSNMP_ACCESS_ARP_PHYSADDR_BUF_SIZE+1];
+ char *arp_token;
+ int i;
+
+ netsnmp_assert(NULL != access);
+
+#define PROCFILE "/proc/net/arp"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ snmp_log(LOG_DEBUG,"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;
+ unsigned int tmp_flags;
+ char ifname[21];
+
+ rc = sscanf(line,
+ "%d.%d.%d.%d 0x%*x 0x%x %96s %*[^ ] %20s\n",
+ &za, &zb, &zc, &zd, &tmp_flags, arp, ifname);
+ if (7 != 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 "
+ "%s, name %s\n",
+ za,zb,zc,zd, tmp_flags, arp, ifname ));
+
+ /*
+ */
+ entry = netsnmp_access_arp_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ /*
+ * look up ifIndex
+ */
+ entry->generation = access->generation;
+ 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
+ */
+ for (arp_token = strtok(arp, ":"), i=0; arp_token != NULL; arp_token = strtok(NULL, ":"), i++) {
+ entry->arp_physaddress[i] = strtol(arp_token, NULL, 16);
+ }
+ entry->arp_physaddress_len = i;
+
+ /*
+ * 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
+ */
+ access->update_hook(access, entry);
+ }
+
+ fclose(in);
+ return 0;
+}
diff --git a/agent/mibgroup/ip-mib/data_access/arp_netlink.c b/agent/mibgroup/ip-mib/data_access/arp_netlink.c
new file mode 100644
index 0000000..2059c23
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/arp_netlink.c
@@ -0,0 +1,304 @@
+/*
+ * Interface MIB architecture support
+ */
+#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 <errno.h>
+#include <sys/types.h>
+#include <linux/types.h>
+#include <linux/rtnetlink.h>
+
+
+static int fillup_entry_info(netsnmp_arp_entry *entry, struct nlmsghdr *h);
+static void netsnmp_access_arp_read_netlink(int fd, void *data);
+
+/**
+ */
+netsnmp_arp_access *
+netsnmp_access_arp_create(u_int init_flags,
+ NetsnmpAccessArpUpdate *update_hook,
+ NetsnmpAccessArpGC *gc_hook,
+ int *cache_timeout, int *cache_flags,
+ char *cache_expired)
+{
+ netsnmp_arp_access *access;
+
+ access = SNMP_MALLOC_TYPEDEF(netsnmp_arp_access);
+ if (NULL == access) {
+ snmp_log(LOG_ERR,"malloc error in netsnmp_access_arp_create\n");
+ return NULL;
+ }
+
+ access->arch_magic = NULL;
+ access->magic = NULL;
+ access->update_hook = update_hook;
+ access->gc_hook = gc_hook;
+ access->synchronized = 0;
+
+ if (cache_timeout != NULL)
+ *cache_timeout = 5;
+ if (cache_flags != NULL)
+ *cache_flags |= NETSNMP_CACHE_RESET_TIMER_ON_USE | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD;
+ access->cache_expired = cache_expired;
+
+ DEBUGMSGTL(("access:netlink:arp", "create arp cache\n"));
+
+ return access;
+}
+
+int netsnmp_access_arp_delete(netsnmp_arp_access *access)
+{
+ if (NULL == access)
+ return 0;
+
+ netsnmp_access_arp_unload(access);
+ free(access);
+
+ return 0;
+}
+
+int netsnmp_access_arp_load(netsnmp_arp_access *access)
+{
+ int r, fd = (uintptr_t) access->arch_magic;
+ struct {
+ struct nlmsghdr n;
+ struct ndmsg r;
+ } req;
+
+ if (access->synchronized)
+ return 0;
+
+ if (fd == 0) {
+ struct sockaddr_nl sa;
+
+ fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
+ if (fd < 0) {
+ snmp_log(LOG_ERR,"netsnmp_access_arp_load: netlink socket create error\n");
+ return -1;
+ }
+ access->arch_magic = (void *)(uintptr_t)fd;
+
+ memset(&sa, 0, sizeof(sa));
+ sa.nl_family = AF_NETLINK;
+ sa.nl_groups = RTMGRP_NEIGH;
+ if (bind(fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
+ snmp_log(LOG_ERR,"netsnmp_access_arp_load: netlink bind failed\n");
+ return -1;
+ }
+
+ if (register_readfd(fd, netsnmp_access_arp_read_netlink, access) != 0) {
+ snmp_log(LOG_ERR,"netsnmp_access_arp_load: error registering netlink socket\n");
+ return -1;
+ }
+ }
+
+ DEBUGMSGTL(("access:netlink:arp", "synchronizing arp table\n"));
+
+ access->generation++;
+
+ memset(&req, 0, sizeof(req));
+ req.n.nlmsg_len = sizeof(req);
+ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;
+ req.n.nlmsg_type = RTM_GETNEIGH;
+ req.r.ndm_family = AF_UNSPEC;
+
+ r = send(fd, &req, req.n.nlmsg_len, 0);
+ if (r < 0) {
+ snmp_log(LOG_ERR,"netsnmp_access_arp_refresh: send failed\n");
+ return -1;
+ }
+
+ while (!access->synchronized)
+ netsnmp_access_arp_read_netlink(fd, access);
+ access->gc_hook(access);
+
+ return 0;
+}
+
+int netsnmp_access_arp_unload(netsnmp_arp_access *access)
+{
+ int fd;
+
+ DEBUGMSGTL(("access:netlink:arp", "unload arp cache\n"));
+
+ fd = (uintptr_t) access->arch_magic;
+ if (fd > 0) {
+ unregister_readfd(fd);
+ close(fd);
+ access->arch_magic = NULL;
+ access->synchronized = 0;
+ }
+ return 0;
+}
+
+static void netsnmp_access_arp_read_netlink(int fd, void *data)
+{
+ netsnmp_arp_access *access = (netsnmp_arp_access *) data;
+ netsnmp_arp_entry *entry;
+ char buf[16384];
+ struct nlmsghdr *h;
+ int r, len;
+
+ do {
+ r = recv(fd, buf, sizeof(buf), MSG_DONTWAIT);
+ if (r < 0) {
+ if (errno == EINTR)
+ continue;
+ if (errno == EAGAIN)
+ return;
+ snmp_log(LOG_WARNING, "netlink buffer overrun\n");
+ access->synchronized = 0;
+ if (access->cache_expired != NULL)
+ *access->cache_expired = 1;
+ return;
+ }
+ } while (0);
+ len = r;
+
+ for (h = (struct nlmsghdr *) buf; NLMSG_OK(h, len); h = NLMSG_NEXT(h, len)) {
+ if (h->nlmsg_type == NLMSG_DONE) {
+ access->synchronized = 1;
+ continue;
+ }
+
+ entry = netsnmp_access_arp_entry_create();
+ if (NULL == entry)
+ break;
+
+ DEBUGMSGTL(("access:netlink:arp", "arp netlink notification\n"));
+
+ entry->generation = access->generation;
+ r = fillup_entry_info (entry, h);
+ if (r > 0) {
+ access->update_hook(access, entry);
+ } else {
+ if (r < 0) {
+ NETSNMP_LOGONCE((LOG_ERR, "filling entry info failed\n"));
+ DEBUGMSGTL(("access:netlink:arp", "filling entry info failed\n"));
+ }
+ netsnmp_access_arp_entry_free(entry);
+ }
+ }
+}
+
+static int
+fillup_entry_info(netsnmp_arp_entry *entry, struct nlmsghdr *nlmp)
+{
+ struct ndmsg *rtmp;
+ struct rtattr *tb[NDA_MAX + 1], *rta;
+ int length;
+
+ rtmp = (struct ndmsg *) NLMSG_DATA(nlmp);
+ switch (nlmp->nlmsg_type) {
+ case RTM_NEWNEIGH:
+ if (rtmp->ndm_state == NUD_FAILED)
+ entry->flags = NETSNMP_ACCESS_ARP_ENTRY_FLAG_DELETE;
+ else
+ entry->flags = 0;
+ break;
+ case RTM_DELNEIGH:
+ entry->flags = NETSNMP_ACCESS_ARP_ENTRY_FLAG_DELETE;
+ break;
+ case RTM_GETNEIGH:
+ return 0;
+ default:
+ DEBUGMSGTL(("access:netlink:arp",
+ "Wrong Netlink message type %d\n", nlmp->nlmsg_type));
+ return -1;
+ }
+
+ if (rtmp->ndm_state == NUD_NOARP) {
+ /* NUD_NOARP is for broadcast addresses and similar,
+ * drop them silently */
+ return 0;
+ }
+
+ memset(tb, 0, sizeof(struct rtattr *) * (NDA_MAX + 1));
+ length = nlmp->nlmsg_len - NLMSG_LENGTH(sizeof(*rtmp));
+ rta = ((struct rtattr *) (((char *) (rtmp)) + NLMSG_ALIGN(sizeof(struct ndmsg))));
+ while (RTA_OK(rta, length)) {
+ if (rta->rta_type <= NDA_MAX)
+ tb[rta->rta_type] = rta;
+ rta = RTA_NEXT(rta, length);
+ }
+
+ /*
+ * Fill up the index and addresses
+ */
+ entry->if_index = rtmp->ndm_ifindex;
+ if (tb[NDA_DST]) {
+ entry->arp_ipaddress_len = RTA_PAYLOAD(tb[NDA_DST]);
+ if (entry->arp_ipaddress_len > sizeof(entry->arp_ipaddress)) {
+ snmp_log(LOG_ERR, "netlink ip address length %d is too long\n",
+ entry->arp_ipaddress_len);
+ return -1;
+ }
+ memcpy(entry->arp_ipaddress, RTA_DATA(tb[NDA_DST]),
+ entry->arp_ipaddress_len);
+ }
+ if (tb[NDA_LLADDR]) {
+ entry->arp_physaddress_len = RTA_PAYLOAD(tb[NDA_LLADDR]);
+ if (entry->arp_physaddress_len > sizeof(entry->arp_physaddress)) {
+ snmp_log(LOG_ERR, "netlink hw address length %d is too long\n",
+ entry->arp_physaddress_len);
+ return -1;
+ }
+ memcpy(entry->arp_physaddress, RTA_DATA(tb[NDA_LLADDR]),
+ entry->arp_physaddress_len);
+ }
+
+ switch (rtmp->ndm_state) {
+ case NUD_INCOMPLETE:
+ entry->arp_state = INETNETTOMEDIASTATE_INCOMPLETE;
+ break;
+ case NUD_REACHABLE:
+ case NUD_PERMANENT:
+ entry->arp_state = INETNETTOMEDIASTATE_REACHABLE;
+ break;
+ case NUD_STALE:
+ entry->arp_state = INETNETTOMEDIASTATE_STALE;
+ break;
+ case NUD_DELAY:
+ entry->arp_state = INETNETTOMEDIASTATE_DELAY;
+ break;
+ case NUD_PROBE:
+ entry->arp_state = INETNETTOMEDIASTATE_PROBE;
+ break;
+ case NUD_FAILED:
+ entry->arp_state = INETNETTOMEDIASTATE_INVALID;
+ break;
+ case NUD_NONE:
+ entry->arp_state = INETNETTOMEDIASTATE_UNKNOWN;
+ break;
+ default:
+ snmp_log(LOG_ERR, "Unrecognized ARP entry state %d", rtmp->ndm_state);
+ break;
+ }
+
+ switch (rtmp->ndm_state) {
+ case NUD_INCOMPLETE:
+ case NUD_FAILED:
+ case NUD_NONE:
+ entry->arp_type = INETNETTOMEDIATYPE_INVALID;
+ break;
+ case NUD_REACHABLE:
+ case NUD_STALE:
+ case NUD_DELAY:
+ case NUD_PROBE:
+ entry->arp_type = INETNETTOMEDIATYPE_DYNAMIC;
+ break;
+ case NUD_PERMANENT:
+ entry->arp_type = INETNETTOMEDIATYPE_STATIC;
+ break;
+ default:
+ entry->arp_type = INETNETTOMEDIATYPE_LOCAL;
+ break;
+ }
+
+ return 1;
+}
diff --git a/agent/mibgroup/ip-mib/data_access/defaultrouter.h b/agent/mibgroup/ip-mib/data_access/defaultrouter.h
new file mode 100644
index 0000000..a4dfbb1
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/defaultrouter.h
@@ -0,0 +1,28 @@
+/*
+ * defaultrouter data access header
+ *
+ * $Id: $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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/defaultrouter_common)
+#if defined( linux )
+config_require(ip-mib/data_access/defaultrouter_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ */
+config_error(the defaultrouter data access library is not available in this environment.)
+#endif
diff --git a/agent/mibgroup/ip-mib/data_access/defaultrouter_common.c b/agent/mibgroup/ip-mib/data_access/defaultrouter_common.c
new file mode 100644
index 0000000..ae85bfa
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/defaultrouter_common.c
@@ -0,0 +1,291 @@
+/*
+ * defaultrouter MIB architecture support
+ *
+ * $Id:$
+ */
+#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/defaultrouter.h>
+
+#include "ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h"
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static prototypes
+ */
+static int _access_defaultrouter_entry_compare_addr(const void *lhs,
+ const void *rhs);
+static void _access_defaultrouter_entry_release(netsnmp_defaultrouter_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_defaultrouter_entry_init(netsnmp_defaultrouter_entry *entry);
+
+extern int
+netsnmp_arch_defaultrouter_container_load(netsnmp_container* container,
+ u_int load_flags);
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ */
+netsnmp_container *
+netsnmp_access_defaultrouter_container_init(u_int flags)
+{
+ netsnmp_container *container1;
+
+ DEBUGMSGTL(("access:defaultrouter:container", "init\n"));
+
+ /*
+ * create the containers. one indexed by ifIndex, the other
+ * indexed by ifName.
+ */
+ container1 = netsnmp_container_find("access_defaultrouter:table_container");
+ if (NULL == container1) {
+ snmp_log(LOG_ERR, "defaultrouter primary container is not found\n");
+ return NULL;
+ }
+ container1->container_name = strdup("dr_index");
+
+ if (flags & NETSNMP_ACCESS_DEFAULTROUTER_INIT_ADDL_IDX_BY_ADDR) {
+ netsnmp_container *container2 =
+ netsnmp_container_find("defaultrouter_addr:access_defaultrouter:table_container");
+ if (NULL == container2) {
+ snmp_log(LOG_ERR, "defaultrouter secondary container not found\n");
+ CONTAINER_FREE(container1);
+ return NULL;
+ }
+
+ container2->compare = _access_defaultrouter_entry_compare_addr;
+ container2->container_name = strdup("dr_addr");
+
+ netsnmp_container_add_index(container1, container2);
+ }
+
+ return container1;
+}
+
+/**
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_defaultrouter_container_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ int rc;
+ u_int container_flags = 0;
+
+ DEBUGMSGTL(("access:defaultrouter:container", "load\n"));
+
+ if (NULL == container) {
+ if (load_flags & NETSNMP_ACCESS_DEFAULTROUTER_LOAD_ADDL_IDX_BY_ADDR) {
+ container_flags |=
+ NETSNMP_ACCESS_DEFAULTROUTER_INIT_ADDL_IDX_BY_ADDR;
+ }
+ container =
+ netsnmp_access_defaultrouter_container_init(container_flags);
+ }
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_defaultrouter\n");
+ return NULL;
+ }
+
+ rc = netsnmp_arch_defaultrouter_container_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_defaultrouter_container_free(container,
+ NETSNMP_ACCESS_DEFAULTROUTER_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_defaultrouter_container_free(netsnmp_container *container,
+ u_int free_flags)
+{
+ DEBUGMSGTL(("access:defaultrouter:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container for netsnmp_access_defaultrouter_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_DEFAULTROUTER_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_access_defaultrouter_entry_release,
+ NULL);
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_DEFAULTROUTER_FREE_KEEP_CONTAINER))
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * defaultrouter_entry functions
+ */
+/**
+ */
+/**
+ */
+netsnmp_defaultrouter_entry *
+netsnmp_access_defaultrouter_entry_create(void)
+{
+ int rc = 0;
+ netsnmp_defaultrouter_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_defaultrouter_entry);
+
+ DEBUGMSGTL(("access:defaultrouter:entry", "create\n"));
+
+ if(NULL == entry)
+ return NULL;
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = &entry->ns_dr_index;
+
+ /*
+ * set up defaults
+ */
+ entry->dr_lifetime = IPDEFAULTROUTERLIFETIME_MAX;
+ entry->dr_preference = IPDEFAULTROUTERPREFERENCE_MEDIUM;
+
+ rc = netsnmp_arch_defaultrouter_entry_init(entry);
+ if (SNMP_ERR_NOERROR != rc) {
+ DEBUGMSGT(("access:defaultrouter:create","error %d in arch init\n", rc));
+ netsnmp_access_defaultrouter_entry_free(entry);
+ entry = NULL;
+ }
+
+ return entry;
+}
+
+void
+netsnmp_access_defaultrouter_entry_free(netsnmp_defaultrouter_entry * entry)
+{
+ if (NULL == entry)
+ return;
+
+ free(entry);
+}
+
+/**
+ * update an old defaultrouter_entry from a new one
+ *
+ * @note: only mib related items are compared. Internal objects
+ * such as oid_index, ns_dr_index and flags are not compared.
+ *
+ * @retval -1 : error
+ * @retval >=0 : number of fields updated
+ */
+int
+netsnmp_access_defaultrouter_entry_update(netsnmp_defaultrouter_entry *lhs,
+ netsnmp_defaultrouter_entry *rhs)
+{
+ int changed = 0;
+
+ if (lhs->dr_addresstype != rhs->dr_addresstype) {
+ ++changed;
+ lhs->dr_addresstype = rhs->dr_addresstype;
+ }
+
+ if (lhs->dr_address_len != rhs->dr_address_len) {
+ changed += 2;
+ lhs->dr_address_len = rhs->dr_address_len;
+ memcpy(lhs->dr_address, rhs->dr_address, rhs->dr_address_len);
+ }
+ else if (memcmp(lhs->dr_address, rhs->dr_address, rhs->dr_address_len) != 0) {
+ ++changed;
+ memcpy(lhs->dr_address, rhs->dr_address, rhs->dr_address_len);
+ }
+
+ if (lhs->dr_if_index != rhs->dr_if_index) {
+ ++changed;
+ lhs->dr_if_index = rhs->dr_if_index;
+ }
+
+ if (lhs->dr_lifetime != rhs->dr_lifetime) {
+ ++changed;
+ lhs->dr_lifetime = rhs->dr_lifetime;
+ }
+
+ if (lhs->dr_preference != rhs->dr_preference) {
+ ++changed;
+ lhs->dr_preference = rhs->dr_preference;
+ }
+
+ return changed;
+}
+
+/**
+ * copy an defaultrouter_entry
+ *
+ * @retval -1 : error
+ * @retval 0 : no error
+ */
+int
+netsnmp_access_defaultrouter_entry_copy(netsnmp_defaultrouter_entry *lhs,
+ netsnmp_defaultrouter_entry *rhs)
+{
+ lhs->dr_addresstype = rhs->dr_addresstype;
+ lhs->dr_address_len = rhs->dr_address_len;
+ memcpy(lhs->dr_address, rhs->dr_address, rhs->dr_address_len);
+ lhs->dr_if_index = rhs->dr_if_index;
+ lhs->dr_lifetime = rhs->dr_lifetime;
+ lhs->dr_preference = rhs->dr_preference;
+
+ return 0;
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ */
+void
+_access_defaultrouter_entry_release(netsnmp_defaultrouter_entry * entry, void *context)
+{
+ netsnmp_access_defaultrouter_entry_free(entry);
+}
+
+static int _access_defaultrouter_entry_compare_addr(const void *lhs,
+ const void *rhs)
+{
+ const netsnmp_defaultrouter_entry *lh = (const netsnmp_defaultrouter_entry *)lhs;
+ const netsnmp_defaultrouter_entry *rh = (const netsnmp_defaultrouter_entry *)rhs;
+
+ netsnmp_assert(NULL != lhs);
+ netsnmp_assert(NULL != rhs);
+
+ /*
+ * compare address length
+ */
+ if (lh->dr_address_len < rh->dr_address_len)
+ return -1;
+ else if (lh->dr_address_len > rh->dr_address_len)
+ return 1;
+
+ /*
+ * length equal, compare address
+ */
+ return memcmp(lh->dr_address, rh->dr_address, lh->dr_address_len);
+}
diff --git a/agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c b/agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c
new file mode 100644
index 0000000..5a1fa46
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c
@@ -0,0 +1,328 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id:$
+ */
+#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/defaultrouter.h>
+
+#include "ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h"
+
+#include <asm/types.h>
+#ifdef HAVE_LINUX_RTNETLINK_H
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#endif
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#include <unistd.h>
+
+#define RCVBUF_SIZE 32768
+#define SNDBUF_SIZE 512
+
+#ifdef NETSNMP_ENABLE_IPV6
+#define DR_ADDRSTRLEN INET6_ADDRSTRLEN
+#else
+#define DR_ADDRSTRLEN INET_ADDRSTRLEN
+#endif
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static prototypes
+ */
+static int _load(netsnmp_container *container);
+
+
+/*
+ * initialize arch specific storage
+ *
+ * @retval 0: success
+ * @retval <0: error
+ */
+int
+netsnmp_arch_defaultrouter_entry_init(netsnmp_defaultrouter_entry *entry)
+{
+ /*
+ * init
+ */
+ return 0;
+}
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+int
+netsnmp_arch_defaultrouter_container_load(netsnmp_container *container,
+ u_int load_flags)
+{
+ int rc = 0;
+
+ DEBUGMSGTL(("access:defaultrouter:entry:arch", "load (linux)\n"));
+
+ rc = _load(container);
+ if (rc < 0) {
+ u_int flags = NETSNMP_ACCESS_DEFAULTROUTER_FREE_KEEP_CONTAINER;
+ netsnmp_access_defaultrouter_container_free(container, flags);
+ }
+
+ return rc;
+}
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load(netsnmp_container *container)
+{
+#ifndef HAVE_LINUX_RTNETLINK_H
+ DEBUGMSGTL(("access:defaultrouter",
+ "cannot get default router information"
+ "as netlink socket is not available\n"));
+ return -1;
+#else
+ int rc = 0;
+ int idx_offset = 0;
+ netsnmp_defaultrouter_entry *entry;
+ int nlsk;
+ struct sockaddr_nl addr;
+ int rcvbuf_size = RCVBUF_SIZE;
+ unsigned char rcvbufmem[RCVBUF_SIZE + sizeof(intmax_t)];
+ unsigned char sndbufmem[SNDBUF_SIZE + sizeof(intmax_t)];
+ /*
+ * Buffers must be memory aligned.
+ * Message structure internal alignment is maintained by the netlink API.
+ */
+ unsigned char *rcvbuf = rcvbufmem +
+ sizeof(intmax_t) - (((intptr_t)rcvbufmem) % sizeof(intmax_t));
+ unsigned char *sndbuf = sndbufmem +
+ sizeof(intmax_t) - (((intptr_t)sndbufmem) % sizeof(intmax_t));
+ struct nlmsghdr *hdr;
+ struct rtmsg *rthdr;
+ int count;
+ int end_of_message = 0;
+ long hz = sysconf(_SC_CLK_TCK);
+
+ netsnmp_assert(NULL != container);
+
+ /*
+ * Open a netlink socket
+ */
+ nlsk = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
+ if (nlsk < 0) {
+ snmp_log(LOG_ERR, "Could not open netlink socket : %s\n",
+ strerror(errno));
+ return -1;
+ }
+
+ if (setsockopt(nlsk, SOL_SOCKET, SO_RCVBUF,
+ &rcvbuf_size, sizeof(rcvbuf_size)) < 0) {
+ snmp_log(LOG_ERR, "Could not open netlink socket : %s\n",
+ strerror(errno));
+ close(nlsk);
+ return -1;
+ }
+
+ memset(&addr, '\0', sizeof(struct sockaddr_nl));
+ addr.nl_family = AF_NETLINK;
+
+ memset(sndbuf, '\0', SNDBUF_SIZE);
+ hdr = (struct nlmsghdr *)sndbuf;
+ hdr->nlmsg_type = RTM_GETROUTE;
+ hdr->nlmsg_pid = getpid();
+ hdr->nlmsg_seq = 0;
+ hdr->nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
+ hdr->nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg));
+ rthdr = (struct rtmsg *)NLMSG_DATA(hdr);
+ rthdr->rtm_table = RT_TABLE_MAIN;
+
+ /*
+ * Send a request to the kernel to dump the routing table to us
+ */
+ count = sendto(nlsk, sndbuf, hdr->nlmsg_len, 0,
+ (struct sockaddr *)&addr, sizeof(struct sockaddr_nl));
+ if (count < 0) {
+ snmp_log(LOG_ERR, "unable to send netlink message to kernel : %s\n",
+ strerror(errno));
+ close(nlsk);
+ return -2;
+ }
+
+ /*
+ * Now listen for response
+ */
+ do {
+ struct nlmsghdr *nlmhp;
+ struct rtmsg *rtmp;
+ struct rtattr *rtap;
+ struct rta_cacheinfo *rtci;
+ socklen_t sock_len;
+ int rtcount;
+
+ memset(rcvbuf, '\0', RCVBUF_SIZE);
+ sock_len = sizeof(struct sockaddr_nl);
+
+ /*
+ * Get the message
+ */
+ count = recvfrom(nlsk, rcvbuf, RCVBUF_SIZE, 0,
+ (struct sockaddr *)&addr, &sock_len);
+ if (count < 0) {
+ snmp_log(LOG_ERR, "unable to receive netlink messages: %s\n",
+ strerror(errno));
+ rc = -1;
+ break;
+ }
+
+ /*
+ * Walk all of the returned messages
+ */
+ nlmhp = (struct nlmsghdr *)rcvbuf;
+ while (NLMSG_OK(nlmhp, count)) {
+ u_char addresstype;
+ char address[NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE + 1];
+ size_t address_len = 0;
+ int if_index = -1;
+ u_long lifetime = 0;
+ int preference = -3;
+
+ /*
+ * Make sure the message is ok
+ */
+ if (nlmhp->nlmsg_type == NLMSG_ERROR) {
+ snmp_log(LOG_ERR, "kernel produced nlmsg err\n");
+ rc = -1;
+ break;
+ }
+
+ /*
+ * End of message, we're done
+ */
+ if (nlmhp->nlmsg_type & NLMSG_DONE) {
+ end_of_message = 1;
+ break;
+ }
+
+ /*
+ * Get the pointer to the rtmsg struct
+ */
+ rtmp = NLMSG_DATA(nlmhp);
+
+ /*
+ * zero length destination is a default route
+ */
+ if (rtmp->rtm_dst_len != 0)
+ goto next_nlmsghdr;
+
+ /*
+ * Start scanning the attributes for needed info
+ */
+ if (rtmp->rtm_family == AF_INET) {
+ addresstype = INETADDRESSTYPE_IPV4;
+ lifetime = IPDEFAULTROUTERLIFETIME_MAX; /* infinity */
+ }
+#ifdef NETSNMP_ENABLE_IPV6
+ else if (rtmp->rtm_family == AF_INET6) {
+ addresstype = INETADDRESSTYPE_IPV6;
+ /* router lifetime for IPv6 is retrieved by RTA_CACHEINFO */
+ lifetime = 0;
+ }
+#endif
+ else
+ goto next_nlmsghdr; /* skip, we don't care about this route */
+
+ preference = 0; /* preference is medium(0) for now */
+
+ rtap = RTM_RTA(rtmp);
+ rtcount = RTM_PAYLOAD(nlmhp);
+ while (RTA_OK(rtap, rtcount)) {
+ switch (rtap->rta_type) {
+ case RTA_OIF:
+ if_index = *(int *)(RTA_DATA(rtap));
+ break;
+
+ case RTA_GATEWAY:
+ address_len = RTA_PAYLOAD(rtap);
+ memset(address, '\0', sizeof(address));
+ memcpy(address, RTA_DATA(rtap), address_len);
+ break;
+
+#ifdef NETSNMP_ENABLE_IPV6
+ case RTA_CACHEINFO:
+ rtci = RTA_DATA(rtap);
+ if ((rtmp->rtm_flags & RTM_F_CLONED) ||
+ (rtci && rtci->rta_expires)) {
+ lifetime = rtci->rta_expires / hz;
+ }
+ break;
+#endif
+
+ default:
+ break;
+ } /* switch */
+
+ rtap = RTA_NEXT(rtap, rtcount);
+ } /* while RTA_OK(rtap) */
+
+ if (address_len != 0 && if_index != -1 &&
+ lifetime != 0 && preference != -3 ) {
+ DEBUGIF("access:defaultrouter") {
+ char addr_str[DR_ADDRSTRLEN];
+ memset(addr_str, '\0', DR_ADDRSTRLEN);
+
+ if (rtmp->rtm_family == AF_INET)
+ inet_ntop(AF_INET, address, addr_str, DR_ADDRSTRLEN);
+#ifdef NETSNMP_ENABLE_IPV6
+ else
+ inet_ntop(AF_INET6, address, addr_str, DR_ADDRSTRLEN);
+#endif
+ DEBUGMSGTL(("access:defaultrouter",
+ "found default route: %s if_index %d "
+ "lifetime %lu preference %d\n",
+ addr_str, if_index, lifetime, preference));
+ }
+
+ entry = netsnmp_access_defaultrouter_entry_create();
+ if (NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ entry->ns_dr_index = ++idx_offset;
+ entry->dr_addresstype = addresstype;
+ entry->dr_address_len = address_len;
+ memcpy(entry->dr_address, address,
+ NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE);
+ entry->dr_if_index = if_index;
+ entry->dr_lifetime = lifetime;
+ entry->dr_preference = preference;
+
+ if (CONTAINER_INSERT(container, entry) < 0)
+ {
+ DEBUGMSGTL(("access:arp:container",
+ "error with defaultrouter_entry: "
+ "insert into container failed.\n"));
+ netsnmp_access_defaultrouter_entry_free(entry);
+ }
+ }
+
+next_nlmsghdr:
+ nlmhp = NLMSG_NEXT(nlmhp, count);
+ } /* while NLMSG_OK(nlmhp) */
+
+ if (rc < 0)
+ break;
+
+ } while (!end_of_message);
+
+ close(nlsk);
+ return rc;
+#endif /* HAVE_LINUX_RTNETLINK_H */
+}
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress.h b/agent/mibgroup/ip-mib/data_access/ipaddress.h
new file mode 100644
index 0000000..9cf8181
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress.h
@@ -0,0 +1,28 @@
+/*
+ * ipaddress data access header
+ *
+ * $Id$
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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)
+#elif defined( solaris2 )
+config_require(ip-mib/data_access/ipaddress_solaris2)
+#else
+config_error(the ipaddress data access library is not available in this environment.)
+#endif
+
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
new file mode 100644
index 0000000..e305c9f
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
@@ -0,0 +1,519 @@
+/*
+ * Ipaddress MIB architecture support
+ *
+ * $Id$
+ */
+#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"
+
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_child_of(ipaddress_common, libnetsnmpmibs)
+
+netsnmp_feature_child_of(ipaddress_common_copy_utilities, ipaddress_common)
+netsnmp_feature_child_of(ipaddress_entry_copy, ipaddress_common)
+netsnmp_feature_child_of(ipaddress_entry_update, ipaddress_common)
+netsnmp_feature_child_of(ipaddress_prefix_copy, ipaddress_common_copy_utilities)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_IPADDRESS_ENTRY_COPY
+netsnmp_feature_require(ipaddress_arch_entry_copy)
+#endif /* NETSNMP_FEATURE_REQUIRE_IPADDRESS_ENTRY_COPY */
+
+/**---------------------------------------------------------------------*/
+/*
+ * 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 %" NETSNMP_PRIo "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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESS_ENTRY_UPDATE
+/**
+ * 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;
+ }
+
+ if (lhs->ia_onlink_flag != rhs->ia_onlink_flag) {
+ ++changed;
+ lhs->ia_onlink_flag = rhs->ia_onlink_flag;
+ }
+
+ if (lhs->ia_autonomous_flag != rhs->ia_autonomous_flag) {
+ ++changed;
+ lhs->ia_autonomous_flag = rhs->ia_autonomous_flag;
+ }
+
+ if (lhs->ia_prefered_lifetime != rhs->ia_prefered_lifetime) {
+ ++changed;
+ lhs->ia_prefered_lifetime = rhs->ia_prefered_lifetime;
+ }
+
+ if (lhs->ia_valid_lifetime != rhs->ia_valid_lifetime) {
+ ++changed;
+ lhs->ia_valid_lifetime = rhs->ia_valid_lifetime;
+ }
+
+
+ return changed;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESS_ENTRY_UPDATE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESS_ENTRY_COPY
+/**
+ * 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESS_ENTRY_COPY */
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESS_PREFIX_COPY
+/**
+ * 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESS_PREFIX_COPY */
+
+
+/**
+ * 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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESS_COMMON_COPY_UTILITIES
+int
+netsnmp_ipaddress_flags_copy(u_long *ipAddressPrefixAdvPreferredLifetime,
+ u_long *ipAddressPrefixAdvValidLifetime,
+ u_long *ipAddressPrefixOnLinkFlag,
+ u_long *ipAddressPrefixAutonomousFlag,
+ u_long *ia_prefered_lifetime,
+ u_long *ia_valid_lifetime,
+ u_char *ia_onlink_flag,
+ u_char *ia_autonomous_flag)
+{
+
+ /*Copy all the flags*/
+ *ipAddressPrefixAdvPreferredLifetime = *ia_prefered_lifetime;
+ *ipAddressPrefixAdvValidLifetime = *ia_valid_lifetime;
+ *ipAddressPrefixOnLinkFlag = *ia_onlink_flag;
+ *ipAddressPrefixAutonomousFlag = *ia_autonomous_flag;
+ return 0;
+}
+
+int
+netsnmp_ipaddress_prefix_origin_copy(u_long *ipAddressPrefixOrigin,
+ u_char ia_origin,
+ int flags,
+ u_long ipAddressAddrType)
+{
+ if(ipAddressAddrType == INETADDRESSTYPE_IPV4){
+ if(ia_origin == 6) /*Random*/
+ (*ipAddressPrefixOrigin) = 3 /*IPADDRESSPREFIXORIGINTC_WELLKNOWN*/;
+ else
+ (*ipAddressPrefixOrigin) = ia_origin;
+ } else {
+ if(ia_origin == 5) { /*Link Layer*/
+ if(!flags) /*Global address assigned by router adv*/
+ (*ipAddressPrefixOrigin) = 5 /*IPADDRESSPREFIXORIGINTC_ROUTERADV*/;
+ else
+ (*ipAddressPrefixOrigin) = 3 /*IPADDRESSPREFIXORIGINTC_WELLKNOWN*/;
+ }
+ else if(ia_origin == 6) /*Random*/
+ (*ipAddressPrefixOrigin) = 5 /*IPADDRESSPREFIXORIGINTC_ROUTERADV*/;
+ else
+ (*ipAddressPrefixOrigin) = ia_origin;
+ }
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESS_COMMON_COPY_UTILITIES */
+
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
new file mode 100644
index 0000000..cf65013
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
@@ -0,0 +1,746 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_child_of(ipadress_ioctl_entry_copy, ipaddress_common)
+
+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 (_ioctl_extras*)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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESS_IOCTL_ENTRY_COPY
+/**
+ * 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESS_IOCTL_ENTRY_COPY */
+
+/**
+ * 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;
+ struct address_flag_info addr_info;
+ in_addr_t ipval;
+ _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) {
+ netsnmp_ipaddress_entry *entry, *bcastentry = NULL;
+
+ DEBUGMSGTL(("access:ipaddress:container",
+ " interface %d, %s\n", i, ifrp->ifr_name));
+
+ if (AF_INET != ifrp->ifr_addr.sa_family) {
+ DEBUGMSGTL(("access:ipaddress:container",
+ " skipping %s; non AF_INET family %d\n",
+ ifrp->ifr_name, ifrp->ifr_addr.sa_family));
+ continue;
+ }
+
+ /*
+ */
+ 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
+ */
+ si = (struct sockaddr_in *) &ifrp->ifr_addr;
+ entry->ia_address_len = sizeof(si->sin_addr.s_addr);
+ ipval = 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 broadcast
+ */
+ memset(&addr_info, 0, sizeof(struct address_flag_info));
+#if defined (NETSNMP_ENABLE_IPV6)
+ addr_info = netsnmp_access_other_info_get(entry->if_index, AF_INET);
+ if(addr_info.bcastflg) {
+ bcastentry = netsnmp_access_ipaddress_entry_create();
+ if(NULL == bcastentry) {
+ rc = -3;
+ break;
+ }
+ bcastentry->if_index = entry->if_index;
+ bcastentry->ns_ia_index = ++idx_offset;
+ bcastentry->ia_address_len = sizeof(addr_info.addr);
+ memcpy(bcastentry->ia_address, &addr_info.addr,
+ bcastentry->ia_address_len);
+ }
+#endif
+
+ /*
+ * 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(ntohl(si->sin_addr.s_addr));
+ if(bcastentry)
+ bcastentry->ia_prefix_len = entry->ia_prefix_len;
+
+
+ /*
+ * 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;
+
+ if(bcastentry)
+ bcastentry->ia_type = IPADDRESSTYPE_BROADCAST;
+ if(addr_info.anycastflg)
+ entry->ia_type = IPADDRESSTYPE_ANYCAST;
+ else
+ entry->ia_type = IPADDRESSTYPE_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;
+ if(bcastentry)
+ bcastentry->ia_status = IPADDRESSSTATUSTC_PREFERRED;
+
+ /*
+ * can we figure out if an address is from DHCP?
+ * use manual until then...
+ */
+ if(IS_APIPA(ipval)) {
+ entry->ia_origin = IPADDRESSORIGINTC_RANDOM;
+ if(bcastentry)
+ bcastentry->ia_origin = IPADDRESSORIGINTC_RANDOM;
+ }
+ else {
+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
+ if(bcastentry)
+ bcastentry->ia_origin = IPADDRESSORIGINTC_MANUAL;
+ }
+
+ DEBUGIF("access:ipaddress:container") {
+ DEBUGMSGT_NC(("access:ipaddress:container",
+ " if %d: addr len %d, index 0x%" NETSNMP_PRIo "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(bcastentry){
+ if (CONTAINER_INSERT(container, bcastentry) < 0) {
+ DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert broadcast entry into container failed.\n"));
+ netsnmp_access_ipaddress_entry_free(bcastentry);
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+ bcastentry = NULL;
+ }
+
+ if (CONTAINER_INSERT(container, entry) < 0) {
+ DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert into container failed.\n"));
+ NETSNMP_LOGONCE((LOG_ERR, "Duplicate IPv4 address detected, some interfaces may not be visible in IP-MIB\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 = (int*)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) {
+ free(alias_list);
+ return i;
+ }
+ }
+
+ free(alias_list);
+ 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 %" NETSNMP_PRIo "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);
+ ifrq.ifr_name[sizeof(ifrq.ifr_name) - 1] = 0;
+ }
+ else
+ strlcpy(ifrq.ifr_name, (char *) extras->name, sizeof(ifrq.ifr_name));
+
+ 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));
+
+ strlcpy(ifrq.ifr_name, (char *) extras->name, sizeof(ifrq.ifr_name));
+
+ 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;
+}
+
+
+/**
+ * Add/remove IPv6 address using ioctl.
+ * @retval 0 : no error
+ * @retval -1 : bad parameter
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl failed
+ */
+int
+_netsnmp_ioctl_ipaddress_v6(netsnmp_ipaddress_entry * entry, int operation)
+{
+#ifdef linux
+ /*
+ * From linux/ipv6.h. It cannot be included because it collides
+ * with netinet/in.h
+ */
+ struct in6_ifreq {
+ struct in6_addr ifr6_addr;
+ uint32_t ifr6_prefixlen;
+ int ifr6_ifindex;
+ };
+
+ struct in6_ifreq ifrq;
+ int rc, fd = -1;
+
+ DEBUGMSGT(("access:ipaddress:set", "_netsnmp_ioctl_ipaddress_set_v6 started\n"));
+
+ if (NULL == entry)
+ return -1;
+
+ netsnmp_assert(16 == entry->ia_address_len);
+
+ fd = socket(AF_INET6, SOCK_DGRAM, 0);
+ if(fd < 0) {
+ snmp_log(LOG_ERR,"couldn't create socket\n");
+ return -2;
+ }
+ memset(&ifrq, 0, sizeof(ifrq));
+ ifrq.ifr6_ifindex = entry->if_index;
+ ifrq.ifr6_prefixlen = 64;
+
+ memcpy(&ifrq.ifr6_addr, entry->ia_address,
+ entry->ia_address_len);
+
+ rc = ioctl(fd, operation, &ifrq);
+ close(fd);
+ if(rc < 0) {
+ snmp_log(LOG_ERR,"error setting address: %s(%d)\n", strerror(errno), errno);
+ return -3;
+ }
+ DEBUGMSGT(("access:ipaddress:set", "_netsnmp_ioctl_ipaddress_set_v6 finished\n"));
+ return 0;
+#else
+ /* we don't support ipv6 on this platform (yet) */
+ return -3;
+#endif
+
+}
+
+/**
+ *
+ * @retval 0 : no error
+ * @retval -1 : bad parameter
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl failed
+ */
+int
+_netsnmp_ioctl_ipaddress_set_v6(netsnmp_ipaddress_entry * entry)
+{
+ return _netsnmp_ioctl_ipaddress_v6(entry, SIOCSIFADDR);
+}
+
+/**
+ *
+ * @retval 0 : no error
+ * @retval -1 : bad parameter
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl failed
+ */
+int
+_netsnmp_ioctl_ipaddress_delete_v6(netsnmp_ipaddress_entry * entry)
+{
+ return _netsnmp_ioctl_ipaddress_v6(entry, SIOCDIFADDR);
+}
+
+/**
+ * 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 = (caddr_t)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);
+ return -1;
+ }
+ /*
+ * 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;
+ size_t 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/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h
new file mode 100644
index 0000000..f2b7847
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h
@@ -0,0 +1,64 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * struct for netlink extras
+ */
+struct address_flag_info {
+ int bcastflg;
+ int anycastflg;
+ in_addr_t addr;
+};
+
+#define IS_APIPA(a) (((in_addr_t)(a << 16)) == 0xFEA90000)
+
+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_ioctl_ipaddress_set_v6(netsnmp_ipaddress_entry * entry);
+int
+_netsnmp_ioctl_ipaddress_remove_v6(netsnmp_ipaddress_entry * entry);
+
+int
+netsnmp_access_ipaddress_ioctl_get_interface_count(int sd, struct ifconf * ifc);
+
+struct address_flag_info
+netsnmp_access_other_info_get(int index, int family);
+
+/*
+ * 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);
+int
+_netsnmp_ioctl_ipaddress_delete_v6(netsnmp_ipaddress_entry * entry);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
new file mode 100644
index 0000000..f1cef0a
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
@@ -0,0 +1,600 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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 "ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h"
+#include "mibgroup/util_funcs.h"
+
+#include <errno.h>
+#include <sys/ioctl.h>
+
+netsnmp_feature_require(prefix_info)
+netsnmp_feature_require(find_prefix_info)
+
+netsnmp_feature_child_of(ipaddress_arch_entry_copy, ipaddress_common)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_IPADDRESS_ARCH_ENTRY_COPY
+netsnmp_feature_require(ipaddress_ioctl_entry_copy)
+#endif /* NETSNMP_FEATURE_REQUIRE_IPADDRESS_ARCH_ENTRY_COPY */
+
+#if defined (NETSNMP_ENABLE_IPV6)
+#include <linux/types.h>
+#include <asm/types.h>
+#if defined(HAVE_LINUX_RTNETLINK_H)
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#ifdef RTMGRP_IPV6_PREFIX
+#define SUPPORT_PREFIX_FLAGS 1
+#endif /* RTMGRP_IPV6_PREFIX */
+#endif /* HAVE_LINUX_RTNETLINK_H */
+#endif
+
+#include "ipaddress_ioctl.h"
+#ifdef SUPPORT_PREFIX_FLAGS
+extern prefix_cbx *prefix_head_list;
+#endif
+int _load_v6(netsnmp_container *container, int idx_offset);
+#ifdef HAVE_LINUX_RTNETLINK_H
+int
+netsnmp_access_ipaddress_extra_prefix_info(int index,
+ u_long *preferedlt,
+ ulong *validlt,
+ char *addr);
+#endif
+
+/*
+ * 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
+ */
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESS_ARCH_ENTRY_COPY
+/*
+ * 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESS_ARCH_ENTRY_COPY */
+
+/*
+ * create a new entry
+ */
+int
+netsnmp_arch_ipaddress_create(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ if (4 == entry->ia_address_len) {
+ return _netsnmp_ioctl_ipaddress_set_v4(entry);
+ } else if (16 == entry->ia_address_len) {
+ return _netsnmp_ioctl_ipaddress_set_v6(entry);
+ } else {
+ DEBUGMSGT(("access:ipaddress:create", "wrong length of IP address\n"));
+ return -2;
+ }
+}
+
+/*
+ * create a new entry
+ */
+int
+netsnmp_arch_ipaddress_delete(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ if (4 == entry->ia_address_len) {
+ return _netsnmp_ioctl_ipaddress_delete_v4(entry);
+ } else if (16 == entry->ia_address_len) {
+ return _netsnmp_ioctl_ipaddress_delete_v6(entry);
+ } else {
+ DEBUGMSGT(("access:ipaddress:create", "only ipv4 supported\n"));
+ return -2;
+ }
+}
+
+/**
+ *
+ * @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)
+{
+#ifndef HAVE_LINUX_RTNETLINK_H
+ DEBUGMSGTL(("access:ipaddress:container",
+ "cannot get ip address information"
+ "as netlink socket is not available\n"));
+ return -1;
+#else
+ 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;
+ struct address_flag_info addr_info;
+
+ netsnmp_assert(NULL != container);
+
+#define PROCFILE "/proc/net/if_inet6"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ DEBUGMSGTL(("access:ipaddress:container","could not open " PROCFILE "\n"));
+ return -2;
+ }
+
+ /*
+ * 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 %08x %08x %04x %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;
+ entry->flags = flags;
+ 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);
+ memset(&addr_info, 0, sizeof(struct address_flag_info));
+ addr_info = netsnmp_access_other_info_get(entry->if_index, AF_INET6);
+
+ /*
+ #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) || (!flags))
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED; /* ?? */
+#ifdef IFA_F_TEMPORARY
+ else if(flags & IFA_F_TEMPORARY)
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED; /* ?? */
+#endif
+ 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(addr_info.anycastflg)
+ 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 (!flags)
+ entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER;
+#ifdef IFA_F_TEMPORARY
+ else if (flags & IFA_F_TEMPORARY)
+ entry->ia_origin = IPADDRESSORIGINTC_RANDOM;
+#endif
+ else if (IN6_IS_ADDR_LINKLOCAL(entry->ia_address))
+ entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER;
+ else
+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
+
+ if(entry->ia_origin == IPADDRESSORIGINTC_LINKLAYER)
+ entry->ia_storagetype = STORAGETYPE_PERMANENT;
+
+ /* xxx-rks: what can we do with scope? */
+#ifdef HAVE_LINUX_RTNETLINK_H
+ if(netsnmp_access_ipaddress_extra_prefix_info(entry->if_index, &entry->ia_prefered_lifetime
+ ,&entry->ia_valid_lifetime, addr) < 0){
+ DEBUGMSGTL(("access:ipaddress:container", "unable to fetch extra prefix info\n"));
+ }
+#else
+ entry->ia_prefered_lifetime = 0;
+ entry->ia_valid_lifetime = 0;
+#endif
+#ifdef SUPPORT_PREFIX_FLAGS
+ {
+ prefix_cbx prefix_val;
+ memset(&prefix_val, 0, sizeof(prefix_cbx));
+ if(net_snmp_find_prefix_info(&prefix_head_list, addr, &prefix_val) < 0) {
+ DEBUGMSGTL(("access:ipaddress:container", "unable to find info\n"));
+ entry->ia_onlink_flag = 1; /*Set by default as true*/
+ entry->ia_autonomous_flag = 2; /*Set by default as false*/
+
+ } else {
+ entry->ia_onlink_flag = prefix_val.ipAddressPrefixOnLinkFlag;
+ entry->ia_autonomous_flag = prefix_val.ipAddressPrefixAutonomousFlag;
+ }
+ }
+#else
+ entry->ia_onlink_flag = 1; /*Set by default as true*/
+ entry->ia_autonomous_flag = 2; /*Set by default as false*/
+#endif
+
+ /*
+ * 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;
+ }
+ }
+
+ fclose(in);
+
+ if(rc<0)
+ return rc;
+
+ return idx_offset;
+}
+
+struct address_flag_info
+netsnmp_access_other_info_get(int index, int family)
+{
+ struct {
+ struct nlmsghdr n;
+ struct ifaddrmsg r;
+ char buf[1024];
+ } req;
+ struct address_flag_info addr;
+ struct rtattr *rta;
+ int status;
+ char buf[16384];
+ struct nlmsghdr *nlmp;
+ struct ifaddrmsg *rtmp;
+ struct rtattr *rtatp;
+ int rtattrlen;
+ int sd;
+
+ memset(&addr, 0, sizeof(struct address_flag_info));
+ sd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
+ if(sd < 0) {
+ snmp_log(LOG_ERR, "could not open netlink socket\n");
+ return addr;
+ }
+
+ memset(&req, 0, sizeof(req));
+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
+ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;
+ req.n.nlmsg_type = RTM_GETADDR;
+ req.r.ifa_family = family;
+ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.n.nlmsg_len));
+ if(family == AF_INET)
+ rta->rta_len = RTA_LENGTH(4);
+ else
+ rta->rta_len = RTA_LENGTH(16);
+
+ status = send(sd, &req, req.n.nlmsg_len, 0);
+ if (status < 0) {
+ snmp_log(LOG_ERR, "could not send netlink request\n");
+ return addr;
+ }
+
+ status = recv(sd, buf, sizeof(buf), 0);
+ if (status < 0) {
+ snmp_log (LOG_ERR, "could not recieve netlink request\n");
+ return addr;
+ }
+
+ if(status == 0) {
+ snmp_log (LOG_ERR, "nothing to read\n");
+ return addr;
+ }
+
+ for(nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp);) {
+ int len = nlmp->nlmsg_len;
+ int req_len = len - sizeof(*nlmp);
+
+ if (req_len < 0 || len > status) {
+ snmp_log (LOG_ERR, "invalid netlink message\n");
+ return addr;
+ }
+
+ if (!NLMSG_OK(nlmp, status)) {
+ snmp_log (LOG_ERR, "invalid NLMSG message\n");
+ return addr;
+ }
+ rtmp = (struct ifaddrmsg *)NLMSG_DATA(nlmp);
+ rtatp = (struct rtattr *)IFA_RTA(rtmp);
+ rtattrlen = IFA_PAYLOAD(nlmp);
+ if(index == rtmp->ifa_index){
+ for (; RTA_OK(rtatp, rtattrlen); rtatp = RTA_NEXT(rtatp, rtattrlen)) {
+ if(rtatp->rta_type == IFA_BROADCAST){
+ addr.addr = ((struct in_addr *)RTA_DATA(rtatp))->s_addr;
+ addr.bcastflg = 1;
+ }
+ if(rtatp->rta_type == IFA_ANYCAST){
+ addr.addr = ((struct in_addr *)RTA_DATA(rtatp))->s_addr;
+ addr.anycastflg = 1;
+ }
+ }
+ }
+ status -= NLMSG_ALIGN(len);
+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len));
+ }
+ close(sd);
+ return addr;
+#endif
+}
+
+#ifdef HAVE_LINUX_RTNETLINK_H
+int
+netsnmp_access_ipaddress_extra_prefix_info(int index, u_long *preferedlt,
+ ulong *validlt, char *addr)
+{
+
+ struct {
+ struct nlmsghdr nlhdr;
+ struct ifaddrmsg ifaceinfo;
+ char buf[1024];
+ } req;
+
+ struct rtattr *rta;
+ int status;
+ char buf[16384];
+ char tmpaddr[40];
+ struct nlmsghdr *nlmp;
+ struct ifaddrmsg *rtmp;
+ struct rtattr *rtatp;
+ struct ifa_cacheinfo *cache_info;
+ struct in6_addr *in6p;
+ int rtattrlen;
+ int sd;
+ int reqaddr = 0;
+ sd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
+ if(sd < 0) {
+ snmp_log(LOG_ERR, "could not open netlink socket\n");
+ return -1;
+ }
+ memset(&req, 0, sizeof(req));
+ req.nlhdr.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
+ req.nlhdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;
+ req.nlhdr.nlmsg_type = RTM_GETADDR;
+ req.ifaceinfo.ifa_family = AF_INET6;
+ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.nlhdr.nlmsg_len));
+ rta->rta_len = RTA_LENGTH(16); /*For ipv6*/
+
+ status = send (sd, &req, req.nlhdr.nlmsg_len, 0);
+ if (status < 0) {
+ snmp_log(LOG_ERR, "could not send netlink request\n");
+ return -1;
+ }
+ status = recv (sd, buf, sizeof(buf), 0);
+ if (status < 0) {
+ snmp_log (LOG_ERR, "could not recieve netlink request\n");
+ return -1;
+ }
+ if (status == 0) {
+ snmp_log (LOG_ERR, "nothing to read\n");
+ return -1;
+ }
+ for (nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp); ){
+
+ int len = nlmp->nlmsg_len;
+ int req_len = len - sizeof(*nlmp);
+
+ if (req_len < 0 || len > status) {
+ snmp_log (LOG_ERR, "invalid netlink message\n");
+ return -1;
+ }
+
+ if (!NLMSG_OK (nlmp, status)) {
+ snmp_log (LOG_ERR, "invalid NLMSG message\n");
+ return -1;
+ }
+ rtmp = (struct ifaddrmsg *)NLMSG_DATA(nlmp);
+ rtatp = (struct rtattr *)IFA_RTA(rtmp);
+ rtattrlen = IFA_PAYLOAD(nlmp);
+ if(index == rtmp->ifa_index) {
+ for (; RTA_OK(rtatp, rtattrlen); rtatp = RTA_NEXT(rtatp, rtattrlen)) {
+ if(rtatp->rta_type == IFA_ADDRESS) {
+ in6p = (struct in6_addr *)RTA_DATA(rtatp);
+ sprintf(tmpaddr, "%04x%04x%04x%04x%04x%04x%04x%04x", NIP6(*in6p));
+ if(!strcmp(tmpaddr ,addr))
+ reqaddr = 1;
+ }
+ if(rtatp->rta_type == IFA_CACHEINFO) {
+ cache_info = (struct ifa_cacheinfo *)RTA_DATA(rtatp);
+ if(reqaddr) {
+ reqaddr = 0;
+ *validlt = cache_info->ifa_valid;
+ *preferedlt = cache_info->ifa_prefered;
+ }
+
+ }
+
+ }
+ }
+ status -= NLMSG_ALIGN(len);
+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len));
+ }
+ close(sd);
+ return 0;
+}
+#endif
+#endif
+
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h
new file mode 100644
index 0000000..600ceaf
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h
@@ -0,0 +1,21 @@
+/*
+ * ipaddress data access header
+ *
+ * $Id$
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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_ioctl)
+config_require(util_funcs)
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c b/agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c
new file mode 100644
index 0000000..e2485e3
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_solaris2.c
@@ -0,0 +1,291 @@
+/*
+ * IP-MIB architecture support
+ *
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+#include "kernel_sunos5.h"
+#include "mibII/mibII_common.h"
+
+netsnmp_feature_child_of(ipaddress_arch_entry_copy, ipaddress_common)
+
+static int _load_v4(netsnmp_container *container, int idx_offset);
+#if defined( NETSNMP_ENABLE_IPV6 )
+static int _load_v6(netsnmp_container *container, int idx_offset);
+#endif
+
+/*
+ * initialize arch specific storage
+ *
+ * @retval 0: success
+ * @retval <0: error
+ */
+int
+netsnmp_arch_ipaddress_entry_init(netsnmp_ipaddress_entry *entry)
+{
+ init_kernel_sunos5();
+ return 0;
+}
+
+/*
+ * cleanup arch specific storage
+ */
+void
+netsnmp_arch_ipaddress_entry_cleanup(netsnmp_ipaddress_entry *entry)
+{
+ /*
+ * Nothing to do.
+ */
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESS_ARCH_ENTRY_COPY
+/*
+ * copy arch specific storage
+ */
+int
+netsnmp_arch_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs)
+{
+ /*
+ * Nothing to do.
+ */
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESS_ARCH_ENTRY_COPY */
+
+/*
+ * create a new entry
+ */
+int
+netsnmp_arch_ipaddress_create(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ DEBUGMSGT(("access:ipaddress:create", "not applicable\n"));
+ return 0;
+}
+
+/*
+ * delete an entry
+ */
+int
+netsnmp_arch_ipaddress_delete(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ DEBUGMSGT(("access:ipaddress:create", "not applicable\n"));
+ return 0;
+}
+
+/**
+ *
+ * @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 (!(load_flags & NETSNMP_ACCESS_IPADDRESS_LOAD_IPV6_ONLY)) {
+ rc = _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 (!(load_flags & NETSNMP_ACCESS_IPADDRESS_LOAD_IPV4_ONLY)) {
+ if (rc < 0)
+ rc = 0;
+
+ idx_offset = rc;
+
+ rc = _load_v6(container, idx_offset);
+ 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;
+}
+
+/*
+ * @retval >=idx_offset ok
+ * @retval -1 memory allocation error
+ * @retval -2 interface lookup error
+ * @retval -3 container error
+ */
+static int
+_load_v4(netsnmp_container *container, int idx_offset)
+{
+ mib2_ipAddrEntry_t ipae;
+ netsnmp_ipaddress_entry *entry;
+ req_e req = GET_FIRST;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:ipaddress:container", "loading v4\n"));
+ while ((rc = getMibstat(MIB_IP_ADDR, &ipae, sizeof(ipae), req,
+ &Get_everything, NULL)) == 0) {
+ req = GET_NEXT;
+ entry = netsnmp_access_ipaddress_entry_create();
+ if (entry == NULL)
+ return (-1);
+ if (ipae.ipAdEntAddr == INADDR_ANY)
+ continue;
+
+ ipae.ipAdEntIfIndex.o_bytes[ipae.ipAdEntIfIndex.o_length] = '\0';
+ DEBUGMSGTL(("access:ipaddress:container", "found if %s\n",
+ ipae.ipAdEntIfIndex.o_bytes));
+ /* Obtain interface index */
+ entry->if_index =
+ netsnmp_access_interface_index_find(ipae.ipAdEntIfIndex.o_bytes);
+ if (entry->if_index == 0) {
+ DEBUGMSGTL(("access:ipaddress:container", "cannot find if %s\n",
+ ipae.ipAdEntIfIndex.o_bytes));
+ netsnmp_access_ipaddress_entry_free(entry);
+ return (-2);
+ }
+
+ if (strchr((const char *)&ipae.ipAdEntIfIndex.o_bytes, ':') != 0)
+ entry->flags |= NETSNMP_ACCESS_IPADDRESS_ISALIAS;
+
+ /* Get the address */
+ entry->ia_address_len = sizeof(ipae.ipAdEntAddr);
+ netsnmp_assert(entry->ia_address_len == 4 &&
+ entry->ia_address_len <= sizeof(entry->ia_address));
+ memcpy(&entry->ia_address, &ipae.ipAdEntAddr, entry->ia_address_len);
+
+ /* prefix */
+ entry->ia_prefix_len = ipae.ipAdEntInfo.ae_subnet_len;
+
+ /* set the Origin */
+ if (ipae.ipAdEntInfo.ae_flags & IFF_DHCPRUNNING)
+ entry->ia_origin = IPADDRESSORIGINTC_DHCP;
+ else
+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
+
+ /* set ipv4 constants */
+ entry->ia_type = IPADDRESSTYPE_UNICAST;
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED;
+
+ entry->ns_ia_index = ++idx_offset;
+
+ DEBUGMSGTL(("access:ipaddress:container", "insert if %" NETSNMP_PRIo "u, addrlen %d\n",
+ entry->if_index, entry->ia_address_len));
+
+ if (CONTAINER_INSERT(container, entry) < 0) {
+ DEBUGMSGTL(("access:ipaddress:container", "unable to insert %s\n",
+ ipae.ipAdEntIfIndex.o_bytes));
+ netsnmp_access_ipaddress_entry_free(entry);
+ return (-3);
+ }
+ }
+ return (idx_offset);
+}
+
+/*
+ * @retval >=idx_offset ok
+ * @retval -1 memory allocation error
+ * @retval -2 interface lookup error
+ * @retval -3 container error
+ */
+#if defined( NETSNMP_ENABLE_IPV6 )
+static int
+_load_v6(netsnmp_container *container, int idx_offset)
+{
+ mib2_ipv6AddrEntry_t ip6ae;
+ netsnmp_ipaddress_entry *entry;
+ req_e req = GET_FIRST;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:ipaddress:container", "loading v6... cache %d\n",
+ MIB_IP6_ADDR));
+ while ((rc = getMibstat(MIB_IP6_ADDR, &ip6ae, sizeof(ip6ae), req,
+ &Get_everything, NULL)) == 0) {
+ req = GET_NEXT;
+ entry = netsnmp_access_ipaddress_entry_create();
+ if (entry == NULL)
+ return (-1);
+ if (memcmp((const void *)&ip6ae.ipv6AddrAddress,
+ (const void *)&in6addr_any,
+ sizeof (ip6ae.ipv6AddrAddress)) == 0)
+ continue;
+
+ ip6ae.ipv6AddrIfIndex.o_bytes[ip6ae.ipv6AddrIfIndex.o_length] = '\0';
+ DEBUGMSGTL(("access:ipaddress:container", "found if %s\n",
+ ip6ae.ipv6AddrIfIndex.o_bytes));
+
+ /* Obtain interface index */
+ entry->if_index =
+ netsnmp_access_interface_index_find(
+ ip6ae.ipv6AddrIfIndex.o_bytes);
+ if (entry->if_index == 0) {
+ DEBUGMSGTL(("access:ipaddress:container", "cannot find if %s\n",
+ ip6ae.ipv6AddrIfIndex.o_bytes));
+ netsnmp_access_ipaddress_entry_free(entry);
+ return (-2);
+ }
+
+ /* Get the address */
+ entry->ia_address_len = sizeof(ip6ae.ipv6AddrAddress);
+ netsnmp_assert(entry->ia_address_len == 16 &&
+ entry->ia_address_len <= sizeof(entry->ia_address));
+ memcpy(&entry->ia_address, &ip6ae.ipv6AddrAddress,
+ entry->ia_address_len);
+
+ /* prefix */
+ entry->ia_prefix_len = ip6ae.ipv6AddrPfxLength;
+
+ /* type is anycast? (mib2.h: 1 = yes, 2 = no) */
+ entry->ia_type = (ip6ae.ipv6AddrAnycastFlag == 1) ?
+ IPADDRESSTYPE_ANYCAST : IPADDRESSTYPE_UNICAST;
+
+ /* origin (mib2.h: 1 = stateless, 2 = stateful, 3 = unknown) */
+ DEBUGMSGTL(("access:ipaddress:container", "origin %d\n",
+ ip6ae.ipv6AddrType));
+ if (ip6ae.ipv6AddrType == 1)
+ entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER;
+ else if (ip6ae.ipv6AddrInfo.ae_flags & IFF_DHCPRUNNING)
+ entry->ia_origin = IPADDRESSORIGINTC_DHCP;
+ else
+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
+
+ /* status */
+ entry->ia_status = ip6ae.ipv6AddrStatus;
+
+ entry->ns_ia_index = ++idx_offset;
+
+ DEBUGMSGTL(("access:ipaddress:container", "insert if %" NETSNMP_PRIo "u, addrlen %d\n",
+ entry->if_index, entry->ia_address_len));
+
+ if (CONTAINER_INSERT(container, entry) < 0) {
+ DEBUGMSGTL(("access:ipaddress:container", "unable to insert %s\n",
+ ip6ae.ipv6AddrIfIndex.o_bytes));
+ netsnmp_access_ipaddress_entry_free(entry);
+ return (-3);
+ }
+ }
+ return (idx_offset);
+}
+#endif /* defined( NETSNMP_ENABLE_IPV6 ) */
diff --git a/agent/mibgroup/ip-mib/data_access/ipv6scopezone.h b/agent/mibgroup/ip-mib/data_access/ipv6scopezone.h
new file mode 100644
index 0000000..8d81b3f
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipv6scopezone.h
@@ -0,0 +1,30 @@
+/*
+ * scopezone data access header
+ *
+ * $Id: ipv6scopezone.h 14170 2007-04-29 02:22:12Z varun_c $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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/ipv6scopezone_common)
+#if defined( linux )
+config_require(ip-mib/data_access/ipv6scopezone_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(ip-mib/data_access/ipv6scopezone-unknown-arch);
+#endif
+
diff --git a/agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c
new file mode 100644
index 0000000..7462ebe
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c
@@ -0,0 +1,155 @@
+/*
+ * ipv6ScopeIndexTable MIB architecture support
+ *
+ * $Id: ipv6scopezone_common.c 14170 2007-04-29 02:22:12Z varun_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/scopezone.h>
+/*
+ * local static prototypes
+ */
+static void _entry_release(netsnmp_v6scopezone_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_scopezone_container_arch_load(netsnmp_container* container,
+ u_int load_flags);
+extern void
+netsnmp_access_scopezone_arch_init(void);
+
+/**
+ * initialize systemstats container
+ */
+netsnmp_container *
+netsnmp_access_scopezone_container_init(u_int flags)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("access:scopezone:container", "init\n"));
+ /*
+ * create the containers. one indexed by ifIndex, the other
+ * indexed by ifName.
+ */
+ container = netsnmp_container_find("access_scopezone:table_container");
+ if (NULL == container)
+ return NULL;
+
+ return container;
+}
+
+/**
+ * load scopezone 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_scopezone_container_load(netsnmp_container* container, u_int load_flags)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:scopezone:container", "load\n"));
+
+ if (NULL == container) {
+ container = netsnmp_access_scopezone_container_init(load_flags);
+ if (container)
+ container->container_name = strdup("scopezone");
+ }
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_scopezone\n");
+ return NULL;
+ }
+
+ rc = netsnmp_access_scopezone_container_arch_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_scopezone_container_free(container,
+ NETSNMP_ACCESS_SCOPEZONE_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_scopezone_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:scopezone:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_scopezone_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_SCOPEZONE_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_entry_release,
+ NULL);
+ }
+
+ CONTAINER_FREE(container);
+}
+
+/**
+ */
+netsnmp_v6scopezone_entry *
+netsnmp_access_scopezone_entry_create(void)
+{
+ netsnmp_v6scopezone_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_v6scopezone_entry);
+
+ DEBUGMSGTL(("access:scopezone:entry", "create\n"));
+
+ if(NULL == entry)
+ return NULL;
+
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = &entry->ns_scopezone_index;
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_scopezone_entry_free(netsnmp_v6scopezone_entry * entry)
+{
+ DEBUGMSGTL(("access:scopezone:entry", "free\n"));
+
+ if (NULL == entry)
+ return;
+
+
+ free(entry);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ * \internal
+ */
+static void
+_entry_release(netsnmp_v6scopezone_entry * entry, void *context)
+{
+ netsnmp_access_scopezone_entry_free(entry);
+}
+
diff --git a/agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c
new file mode 100644
index 0000000..7d60641
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c
@@ -0,0 +1,132 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: ipv6scopezone_linux.c 14170 2007-04-29 02:22:12Z varun_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/scopezone.h>
+
+#if defined (NETSNMP_ENABLE_IPV6)
+static int _scopezone_v6(netsnmp_container* container, int idx_offset);
+#endif
+
+/*
+ *
+ * @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_scopezone_container_arch_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ int rc1 = 0;
+#if defined (NETSNMP_ENABLE_IPV6)
+ int idx_offset = 0;
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_scopezone_\n");
+ return -1;
+ }
+
+ rc1 = _scopezone_v6(container, idx_offset);
+#endif
+ if(rc1 > 0)
+ rc1 = 0;
+ return rc1;
+}
+
+#if defined (NETSNMP_ENABLE_IPV6)
+
+/* scope identifiers, from kernel - include/net/ipv6.h */
+#define IPV6_ADDR_LOOPBACK 0x0010U
+#define IPV6_ADDR_LINKLOCAL 0x0020U
+#define IPV6_ADDR_SITELOCAL 0x0040U
+
+static int
+_scopezone_v6(netsnmp_container* container, int idx_offset)
+{
+
+ /*
+ * On Linux, we support only link-local scope zones.
+ * Each interface, which has link-local address, gets unique scope
+ * zone index.
+ */
+ FILE *in;
+ char line[80], addr[40];
+ int if_index, pfx_len, scope, flags, rc = 0;
+ int last_if_index = -1;
+ netsnmp_v6scopezone_entry *entry;
+
+ netsnmp_assert(NULL != container);
+
+#define PROCFILE "/proc/net/if_inet6"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ DEBUGMSGTL(("access:scopezone:container","could not open " PROCFILE "\n"));
+ return -2;
+ }
+
+ /*
+ * 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\n",
+ addr, &if_index, &pfx_len, &scope, &flags);
+ if( 5 != rc ) {
+ snmp_log(LOG_ERR, PROCFILE " data format error (%d!=5), line ==|%s|\n",
+ rc, line);
+ continue;
+ }
+ DEBUGMSGTL(("access:scopezone:container",
+ "addr %s, index %d, pfx %d, scope %d, flags 0x%X\n",
+ addr, if_index, pfx_len, scope, flags));
+
+ if (! (scope & IPV6_ADDR_LINKLOCAL)) {
+ DEBUGMSGTL(("access:scopezone:container",
+ "The address is not link-local, skipping\n"));
+ continue;
+ }
+ /*
+ * Check that the interface was not inserted before, just in case
+ * one interface has two or more link-local addresses.
+ */
+ if (last_if_index == if_index) {
+ DEBUGMSGTL(("access:scopezone:container",
+ "The interface was already inserted, skipping\n"));
+ continue;
+ }
+
+ last_if_index = if_index;
+ entry = netsnmp_access_scopezone_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+ entry->ns_scopezone_index = ++idx_offset;
+ entry->index = if_index;
+ entry->scopezone_linklocal = if_index;
+
+ CONTAINER_INSERT(container, entry);
+ }
+ fclose(in);
+ if(rc<0)
+ return rc;
+
+ return idx_offset;
+}
+#endif
diff --git a/agent/mibgroup/ip-mib/data_access/scalars_common.h b/agent/mibgroup/ip-mib/data_access/scalars_common.h
new file mode 100644
index 0000000..2f0a63a
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/scalars_common.h
@@ -0,0 +1,29 @@
+/*
+ * ip scalar data access header
+ *
+ * $Id$
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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/agent/mibgroup/ip-mib/data_access/scalars_linux.c b/agent/mibgroup/ip-mib/data_access/scalars_linux.c
new file mode 100644
index 0000000..6ba356b
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/scalars_linux.c
@@ -0,0 +1,148 @@
+/*
+ * Arp MIB architecture support
+ *
+ * $Id$
+ */
+#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/ipv4/conf/all/forwarding";
+static const char ipfw6_name[] = "/proc/sys/net/ipv6/conf/all/forwarding";
+
+int
+netsnmp_arch_ip_scalars_ipForwarding_get(u_long *value)
+{
+ FILE *filep;
+ int rc;
+
+ if (NULL == value)
+ return -1;
+
+
+ filep = fopen(ipfw_name, "r");
+ if (NULL == filep) {
+ DEBUGMSGTL(("access:ipForwarding", "could not open %s\n",
+ ipfw_name));
+ return -2;
+ }
+
+ rc = fscanf(filep, "%lu", value);
+ fclose(filep);
+ if (1 != rc) {
+ DEBUGMSGTL(("access:ipForwarding", "could not read %s\n",
+ ipfw_name));
+ return -3;
+ }
+
+ if ((0 != *value) && (1 != *value)) {
+ DEBUGMSGTL(("access:ipForwarding", "unexpected value %ld in %s\n",
+ *value, ipfw_name));
+ return -4;
+ }
+
+ return 0;
+}
+
+int
+netsnmp_arch_ip_scalars_ipForwarding_set(u_long value)
+{
+ FILE *filep;
+ int rc;
+
+ if (1 == value)
+ ;
+ else if (2 == value)
+ value = 0;
+ else {
+ DEBUGMSGTL(("access:ipForwarding", "bad value %ld for %s\n",
+ value, ipfw_name));
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ filep = fopen(ipfw_name, "w");
+ if (NULL == filep) {
+ DEBUGMSGTL(("access:ipForwarding", "could not open %s\n",
+ ipfw_name));
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+
+ rc = fprintf(filep, "%ld", value);
+ fclose(filep);
+ if (1 != rc) {
+ DEBUGMSGTL(("access:ipForwarding", "could not write %s\n",
+ ipfw_name));
+ return SNMP_ERR_GENERR;
+ }
+
+ return 0;
+}
+
+int
+netsnmp_arch_ip_scalars_ipv6IpForwarding_get(u_long *value)
+{
+ FILE *filep;
+ int rc;
+
+ if (NULL == value)
+ return -1;
+
+
+ filep = fopen(ipfw6_name, "r");
+ if (NULL == filep) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not open %s\n",
+ ipfw6_name));
+ return -2;
+ }
+
+ rc = fscanf(filep, "%lu", value);
+ fclose(filep);
+ if (1 != rc) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not read %s\n",
+ ipfw6_name));
+ return -3;
+ }
+
+ if ((0 != *value) && (1 != *value)) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "unexpected value %ld in %s\n",
+ *value, ipfw6_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(ipfw6_name, "w");
+ if (NULL == filep) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not open %s\n",
+ ipfw6_name));
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+
+ rc = fprintf(filep, "%ld", value);
+ fclose(filep);
+ if (1 != rc) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not write %s\n",
+ ipfw6_name));
+ return SNMP_ERR_GENERR;
+ }
+
+ return 0;
+}
diff --git a/agent/mibgroup/ip-mib/data_access/systemstats.h b/agent/mibgroup/ip-mib/data_access/systemstats.h
new file mode 100644
index 0000000..28810e3
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/systemstats.h
@@ -0,0 +1,27 @@
+/*
+ * systemstats data access header
+ *
+ * $Id$
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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)
+#elif defined( solaris2 )
+config_require(ip-mib/data_access/systemstats_solaris2)
+#else
+config_error(the systemstats data access library is not available in this environment.)
+#endif
diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_common.c b/agent/mibgroup/ip-mib/data_access/systemstats_common.c
new file mode 100644
index 0000000..f60caab
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/systemstats_common.c
@@ -0,0 +1,602 @@
+/*
+ * ipSystemStatsTable and ipIfStatsTable MIB architecture support
+ *
+ * $Id$
+ */
+#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)
+ container->container_name = strdup("systemstats_autocreate");
+ }
+ 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, int if_index,
+ const char *tableName)
+{
+ netsnmp_systemstats_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_systemstats_entry);
+
+ DEBUGMSGTL(("access:systemstats:entry", "create\n"));
+
+ if(NULL == entry)
+ return NULL;
+
+ entry->oid_index.len = 2;
+ entry->oid_index.oids = entry->index;
+ entry->index[0] = version;
+ entry->index[1] = if_index;
+ entry->tableName = tableName;
+ 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);
+}
+
+/*
+ * Calculates the entries, which are not provided by OS, but can be
+ * computed from the others.
+ */
+static void
+_calculate_entries(netsnmp_systemstats_entry * entry)
+{
+ /*
+ * HCInForwDatagrams = HCInNoRoutes + HCOutForwDatagrams
+ */
+ if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES]) {
+
+ entry->stats.HCInForwDatagrams = entry->stats.HCInNoRoutes;
+ u64Incr(&entry->stats.HCInForwDatagrams, &entry->stats.HCOutForwDatagrams);
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS] = 1;
+ }
+
+ /*
+ * HCOutFragReqds = HCOutFragOKs + HCOutFragFails
+ */
+ if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS]) {
+
+ entry->stats.HCOutFragReqds = entry->stats.HCOutFragOKs;
+ u64Incr(&entry->stats.HCOutFragReqds, &entry->stats.HCOutFragFails);
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS] = 1;
+ }
+
+ /*
+ * HCOutTransmits = HCOutRequests + HCOutForwDatagrams + HCOutFragCreates
+ * - HCOutFragReqds - HCOutNoRoutes - HCOutDiscards
+ */
+ if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS]) {
+
+ U64 tmp, tmp2, tmp3;
+ tmp = entry->stats.HCOutRequests;
+ u64Incr(&tmp, &entry->stats.HCOutForwDatagrams);
+ u64Incr(&tmp, &entry->stats.HCOutFragCreates);
+
+ u64Subtract(&tmp, &entry->stats.HCOutFragReqds, &tmp2);
+ u64Subtract(&tmp2, &entry->stats.HCOutNoRoutes, &tmp3);
+ u64Subtract(&tmp3, &entry->stats.HCOutDiscards, &entry->stats.HCOutTransmits);
+
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS] = 1;
+ }
+}
+
+/**
+ * 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->index[0] != new_vals->index[0])
+ || (prev_vals->index[1] != new_vals->index[1]))
+ 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));
+ _calculate_entries(prev_vals);
+ 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;
+ }
+ memcpy(&prev_vals->stats, &new_vals->stats, sizeof(new_vals->stats));
+ }
+ else {
+ /*
+ * update straight 32 bit counters
+ */
+ memcpy(&prev_vals->stats.columnAvail[0], &new_vals->stats.columnAvail[0], sizeof(new_vals->stats.columnAvail));
+ prev_vals->stats.InHdrErrors = new_vals->stats.InHdrErrors;
+ 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.ReasmReqds;
+ prev_vals->stats.ReasmOKs = new_vals->stats.ReasmOKs;
+ prev_vals->stats.ReasmFails = new_vals->stats.ReasmFails;
+ prev_vals->stats.InDiscards = new_vals->stats.InDiscards;
+
+ /*
+ * update 64bit counters
+ */
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCInNoRoutes,
+ &new_vals->stats.HCInNoRoutes,
+ &prev_vals->old_stats->HCInNoRoutes,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCInNoRoutes to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutNoRoutes,
+ &new_vals->stats.HCOutNoRoutes,
+ &prev_vals->old_stats->HCOutNoRoutes,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutNoRoutes to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutDiscards,
+ &new_vals->stats.HCOutDiscards,
+ &prev_vals->old_stats->HCOutDiscards,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutDiscards to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutFragReqds,
+ &new_vals->stats.HCOutFragReqds,
+ &prev_vals->old_stats->HCOutFragReqds,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutFragReqds to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutFragOKs,
+ &new_vals->stats.HCOutFragOKs,
+ &prev_vals->old_stats->HCOutFragOKs,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutFragOKs to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutFragFails,
+ &new_vals->stats.HCOutFragFails,
+ &prev_vals->old_stats->HCOutFragFails,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutFragFails to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutFragCreates,
+ &new_vals->stats.HCOutFragCreates,
+ &prev_vals->old_stats->HCOutFragCreates,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutFragCreates to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCInReceives,
+ &new_vals->stats.HCInReceives,
+ &prev_vals->old_stats->HCInReceives,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCInReceives to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCInOctets,
+ &new_vals->stats.HCInOctets,
+ &prev_vals->old_stats->HCInOctets,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCInOctets to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCInForwDatagrams,
+ &new_vals->stats.HCInForwDatagrams,
+ &prev_vals->old_stats->HCInForwDatagrams,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCInForwDatagrams to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCInDelivers,
+ &new_vals->stats.HCInDelivers,
+ &prev_vals->old_stats->HCInDelivers,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCInDelivers to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutRequests,
+ &new_vals->stats.HCOutRequests,
+ &prev_vals->old_stats->HCOutRequests,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutRequests to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutForwDatagrams,
+ &new_vals->stats.HCOutForwDatagrams,
+ &prev_vals->old_stats->HCOutForwDatagrams,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutForwDatagrams to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutTransmits,
+ &new_vals->stats.HCOutTransmits,
+ &prev_vals->old_stats->HCOutTransmits,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutTransmits to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutOctets,
+ &new_vals->stats.HCOutOctets,
+ &prev_vals->old_stats->HCOutOctets,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutOctets to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCInMcastPkts,
+ &new_vals->stats.HCInMcastPkts,
+ &prev_vals->old_stats->HCInMcastPkts,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCInMcastPkts to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCInMcastOctets,
+ &new_vals->stats.HCInMcastOctets,
+ &prev_vals->old_stats->HCInMcastOctets,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCInMcastOctets to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutMcastPkts,
+ &new_vals->stats.HCOutMcastPkts,
+ &prev_vals->old_stats->HCOutMcastPkts,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutMcastPkts to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutMcastOctets,
+ &new_vals->stats.HCOutMcastOctets,
+ &prev_vals->old_stats->HCOutMcastOctets,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutMcastOctets to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCInBcastPkts,
+ &new_vals->stats.HCInBcastPkts,
+ &prev_vals->old_stats->HCInBcastPkts,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCInBcastPkts to 64bits in %s\n",
+ prev_vals->tableName));
+
+ if (new_vals->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS])
+ if (0 != netsnmp_c64_check32_and_update(
+ &prev_vals->stats.HCOutBcastPkts,
+ &new_vals->stats.HCOutBcastPkts,
+ &prev_vals->old_stats->HCOutBcastPkts,
+ &need_wrap_check))
+ DEBUGMSGTL(("access:systemstats",
+ "Error expanding HCOutBcastPkts to 64bits in %s\n",
+ prev_vals->tableName));
+ }
+
+ /*
+ * 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));
+ }
+
+ _calculate_entries(prev_vals);
+
+ 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->index[0] != rhs->index[0])
+ || (lhs->index[1] != rhs->index[1]))
+ return -1;
+
+ /*
+ * update stats
+ */
+ netsnmp_access_systemstats_entry_update_stats(lhs, rhs);
+
+ /*
+ * update other data
+ */
+ lhs->flags = rhs->flags;
+
+ return 0;
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ *
+ */
diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
new file mode 100644
index 0000000..275b0bd
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
@@ -0,0 +1,685 @@
+/*
+ * ipSystemStatsTable and ipIfStatsTable interface MIB architecture support
+ *
+ * $Id$
+ */
+#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>
+
+#include "../ipSystemStatsTable/ipSystemStatsTable.h"
+
+#include <sys/types.h>
+#include <dirent.h>
+#include <ctype.h>
+
+static int _systemstats_v4(netsnmp_container* container, u_int load_flags);
+static int _additional_systemstats_v4(netsnmp_systemstats_entry* entry,
+ 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
+}
+
+/*
+ * Based on load_flags, load ipSystemStatsTable or ipIfStatsTable for ipv4 entries.
+ */
+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;
+ unsigned long long scan_vals[19];
+
+ DEBUGMSGTL(("access:systemstats:container:arch", "load v4 (flags %x)\n",
+ load_flags));
+
+ netsnmp_assert(container != NULL); /* load function shoulda checked this */
+
+ if (load_flags & NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE) {
+ /* we do not support ipIfStatsTable for ipv4 */
+ return 0;
+ }
+
+ if (!(devin = fopen("/proc/net/snmp", "r"))) {
+ DEBUGMSGTL(("access:systemstats",
+ "Failed to load Systemstats Table (linux1)\n"));
+ NETSNMP_LOGONCE((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, 0,
+ "ipSystemStatsTable.ipv4");
+ 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.HCOutForwDatagrams.low = scan_vals[5] & 0xffffffff;
+ entry->stats.HCOutForwDatagrams.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.HCOutDiscards.low = scan_vals[10] & 0xffffffff;;
+ entry->stats.HCOutDiscards.high = scan_vals[10] >> 32;
+ entry->stats.HCOutNoRoutes.low = scan_vals[11] & 0xffffffff;;
+ entry->stats.HCOutNoRoutes.high = scan_vals[11] >> 32;
+ /* 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.HCOutFragOKs.low = scan_vals[16] & 0xffffffff;;
+ entry->stats.HCOutFragOKs.high = scan_vals[16] >> 32;
+ entry->stats.HCOutFragFails.low = scan_vals[17] & 0xffffffff;;
+ entry->stats.HCOutFragFails.high = scan_vals[17] >> 32;
+ entry->stats.HCOutFragCreates.low = scan_vals[18] & 0xffffffff;;
+ entry->stats.HCOutFragCreates.high = scan_vals[18] >> 32;
+
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INADDRERRORS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INDISCARDS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMREQDS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMOKS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMFAILS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_DISCONTINUITYTIME] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REFRESHRATE] = 1;
+
+ /*
+ * load addtional statistics defined by RFC 4293
+ * As these are supported linux 2.6.22 or later, it is no problem
+ * if loading them are failed.
+ */
+ _additional_systemstats_v4(entry, load_flags);
+
+ /*
+ * add to container
+ */
+ if (CONTAINER_INSERT(container, entry) < 0)
+ {
+ DEBUGMSGTL(("access:systemstats:container","error with systemstats_entry: insert into container failed.\n"));
+ netsnmp_access_systemstats_entry_free(entry);
+ }
+ }
+
+ return 0;
+}
+
+#define IP_EXT_HEAD "IpExt:"
+static int
+_additional_systemstats_v4(netsnmp_systemstats_entry* entry,
+ u_int load_flags)
+{
+ FILE *devin;
+ char line[1024];
+ int scan_count;
+ unsigned long long scan_vals[6];
+ int retval = 0;
+
+ DEBUGMSGTL(("access:systemstats:container:arch",
+ "load addtional v4 (flags %u)\n", load_flags));
+
+ if (!(devin = fopen("/proc/net/netstat", "r"))) {
+ DEBUGMSGTL(("access:systemstats",
+ "cannot open /proc/net/netstat\n"));
+ NETSNMP_LOGONCE((LOG_ERR,"cannot open /proc/net/netstat\n"));
+ return -2;
+ }
+
+ /*
+ * Get header and stat lines
+ */
+ while (fgets(line, sizeof(line), devin)) {
+ if (strncmp(IP_EXT_HEAD, line, sizeof(IP_EXT_HEAD) - 1) == 0) {
+ /* next line should includes IPv4 addtional statistics */
+ if ((fgets(line, sizeof(line), devin)) == NULL) {
+ retval = -4;
+ break;
+ }
+ if (strncmp(IP_EXT_HEAD, line, sizeof(IP_EXT_HEAD) - 1) != 0) {
+ retval = -4;
+ break;
+ }
+
+ memset(scan_vals, 0x0, sizeof(scan_vals));
+ scan_count = sscanf(line,
+ "%*s" /* ignore `IpExt:' */
+ "%llu %llu %llu %llu %llu %llu",
+ &scan_vals[0], &scan_vals[1], &scan_vals[2],
+ &scan_vals[3], &scan_vals[4], &scan_vals[5]);
+ if (scan_count < 6) {
+ snmp_log(LOG_ERR,
+ "error scanning addtional systemstats data"
+ "(minimum expected %d, got %d)\n",
+ 6, scan_count);
+ retval = -4;
+ break;
+ }
+
+ entry->stats.HCInNoRoutes.low = scan_vals[0] & 0xffffffff;
+ entry->stats.HCInNoRoutes.high = scan_vals[0] >> 32;
+ entry->stats.InTruncatedPkts = scan_vals[1];
+ entry->stats.HCInMcastPkts.low = scan_vals[2] & 0xffffffff;
+ entry->stats.HCInMcastPkts.high = scan_vals[2] >> 32;
+ entry->stats.HCOutMcastPkts.low = scan_vals[3] & 0xffffffff;
+ entry->stats.HCOutMcastPkts.high = scan_vals[3] >> 32;
+ entry->stats.HCInBcastPkts.low = scan_vals[4] & 0xffffffff;
+ entry->stats.HCInBcastPkts.high = scan_vals[4] >> 32;
+ entry->stats.HCOutBcastPkts.low = scan_vals[5] & 0xffffffff;
+ entry->stats.HCOutBcastPkts.high = scan_vals[5] >> 32;
+
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS] = 1;
+ }
+ }
+
+ fclose(devin);
+
+ if (retval < 0)
+ DEBUGMSGTL(("access:systemstats",
+ "/proc/net/netstat does not include addtional stats\n"));
+
+ return retval;
+}
+
+#if defined (NETSNMP_ENABLE_IPV6)
+
+/*
+ * Load one /proc/net/snmp6 - like file (e.g. /proc/net/dev_snmp6)
+ */
+static int
+_systemstats_v6_load_file(netsnmp_systemstats_entry *entry, FILE *devin)
+{
+ char line[1024];
+ char *stats, *start = line;
+ int len, rc;
+ uintmax_t scan_val;
+
+ /*
+ * Read in each line in turn, isolate the systemstats name
+ * and retrieve (or create) the corresponding data structure.
+ */
+ rc = 0;
+ 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);
+
+ rc = 0;
+ if ('I' == line[3]) { /* In */
+ if ('A' == line[5]) {
+ entry->stats.InAddrErrors = scan_val;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INADDRERRORS] = 1;
+ } else if ('D' == line[5]) {
+ if ('e' == line[6]) {
+ entry->stats.HCInDelivers.low = scan_val & 0xffffffff;
+ entry->stats.HCInDelivers.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS] = 1;
+ } else if ('i' == line[6]) {
+ entry->stats.InDiscards = scan_val;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INDISCARDS] = 1;
+ } else
+ rc = 1;
+ } else if ('H' == line[5]) {
+ entry->stats.InHdrErrors = scan_val;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS] = 1;
+ } else if ('M' == line[5]) {
+ if ('P' == line[10]) {
+ entry->stats.HCInMcastPkts.low = scan_val & 0xffffffff;
+ entry->stats.HCInMcastPkts.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS] = 1;
+ } else if ('O' == line[10]) {
+ entry->stats.HCInMcastOctets.low = scan_val & 0xffffffff;
+ entry->stats.HCInMcastOctets.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS] = 1;
+ } else
+ rc = 1;
+ } else if ('N' == line[5]) {
+ entry->stats.HCInNoRoutes.low = scan_val & 0xffffffff;
+ entry->stats.HCInNoRoutes.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES] = 1;
+ } else if ('R' == line[5]) {
+ entry->stats.HCInReceives.low = scan_val & 0xffffffff;
+ entry->stats.HCInReceives.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES] = 1;
+ } else if ('T' == line[5]) {
+ if ('r' == line[6]) {
+ entry->stats.InTruncatedPkts = scan_val & 0xffffffff;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS] = 1;
+ } 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;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS] = 1;
+ } else if ('O' == line[5]) {
+ entry->stats.HCInOctets.low = scan_val & 0xffffffff;
+ entry->stats.HCInOctets.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS] = 1;
+ } else
+ rc = 1;
+ } else if ('O' == line[3]) { /* Out */
+ if ('D' == line[6]) {
+ entry->stats.HCOutDiscards.low = scan_val & 0xffffffff;
+ entry->stats.HCOutDiscards.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS] = 1;
+ } else if ('F' == line[6]) {
+ entry->stats.HCOutForwDatagrams.low = scan_val & 0xffffffff;
+ entry->stats.HCOutForwDatagrams.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS] = 1;
+ } else if ('M' == line[6]) {
+ if ('P' == line[11]) {
+ entry->stats.HCOutMcastPkts.low = scan_val & 0xffffffff;
+ entry->stats.HCOutMcastPkts.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS] = 1;
+ } else if ('O' == line[11]) {
+ entry->stats.HCOutMcastOctets.low = scan_val & 0xffffffff;
+ entry->stats.HCOutMcastOctets.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS] = 1;
+ } else
+ rc = -1;
+ } else if ('N' == line[6]) {
+ entry->stats.HCOutNoRoutes.low = scan_val & 0xffffffff;
+ entry->stats.HCOutNoRoutes.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES] = 1;
+ } else if ('R' == line[6]) {
+ entry->stats.HCOutRequests.low = scan_val & 0xffffffff;
+ entry->stats.HCOutRequests.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS] = 1;
+ } else if ('O' == line[6]) {
+ entry->stats.HCOutOctets.low = scan_val & 0xffffffff;
+ entry->stats.HCOutOctets.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS] = 1;
+ } else
+ rc = 1;
+ } else if ('R' == line[3]) { /* Reasm */
+ if ('F' == line[8]) {
+ entry->stats.ReasmFails = scan_val;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMFAILS] = 1;
+ } else if ('O' == line[8]) {
+ entry->stats.ReasmOKs = scan_val;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMOKS] = 1;
+ } else if ('R' == line[8]) {
+ entry->stats.ReasmReqds = scan_val;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMREQDS] = 1;
+ } 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.HCOutFragCreates.low = scan_val & 0xffffffff;
+ entry->stats.HCOutFragCreates.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES] = 1;
+ } else if ('O' == line[7]) {
+ entry->stats.HCOutFragOKs.low = scan_val & 0xffffffff;
+ entry->stats.HCOutFragOKs.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS] = 1;
+ } else if ('F' == line[7]) {
+ entry->stats.HCOutFragFails.low = scan_val & 0xffffffff;
+ entry->stats.HCOutFragFails.high = scan_val >> 32;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS] = 1;
+ } else
+ rc = 1;
+ } else
+ rc = 1;
+
+ if (rc)
+ DEBUGMSGTL(("access:systemstats", "unknown stat %s\n", line));
+ }
+ /*
+ * Let DiscontinuityTime and RefreshRate active
+ */
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_DISCONTINUITYTIME] = 1;
+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REFRESHRATE] = 1;
+
+ return rc;
+}
+
+/*
+ * load ipSystemStatsTable for ipv6 entries
+ */
+static int
+_systemstats_v6_load_systemstats(netsnmp_container* container, u_int load_flags)
+{
+ FILE *devin;
+ netsnmp_systemstats_entry *entry = NULL;
+ const char *filename = "/proc/net/snmp6";
+ int rc = 0;
+
+ entry = netsnmp_access_systemstats_entry_create(2, 0,
+ "ipSystemStatsTable.ipv6");
+ 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), cannot open %s\n",
+ filename));
+ return 0;
+ }
+
+ rc = _systemstats_v6_load_file(entry, devin);
+
+ fclose(devin);
+
+ /*
+ * add to container
+ */
+ if (CONTAINER_INSERT(container, entry) < 0)
+ {
+ DEBUGMSGTL(("access:systemstats:container","error with systemstats_entry: insert into container failed.\n"));
+ netsnmp_access_systemstats_entry_free(entry);
+ }
+
+
+ return rc;
+}
+
+#define DEV_SNMP6_DIRNAME "/proc/net/dev_snmp6"
+#define IFINDEX_LINE "ifIndex"
+#define DEV_FILENAME_LEN 64
+
+/*
+ * load ipIfStatsTable for ipv6 entries
+ */
+static int
+_systemstats_v6_load_ifstats(netsnmp_container* container, u_int load_flags)
+{
+ DIR *dev_snmp6_dir;
+ struct dirent *dev_snmp6_entry;
+ char dev_filename[DEV_FILENAME_LEN];
+ FILE *devin;
+ char line[1024];
+ char *start = line;
+ char *scan_str;
+ uintmax_t scan_val;
+ netsnmp_systemstats_entry *entry = NULL;
+
+ /*
+ * try to open /proc/net/dev_snmp6 directory. If we can't, that' ok -
+ * maybe it is not supported by the current running kernel.
+ */
+ if ((dev_snmp6_dir = opendir(DEV_SNMP6_DIRNAME)) == NULL) {
+ DEBUGMSGTL(("access:ifstats",
+ "Failed to load IPv6 IfStats Table (linux)\n"));
+ return 0;
+ }
+
+ /*
+ * Read each per interface statistics proc file
+ */
+ while ((dev_snmp6_entry = readdir(dev_snmp6_dir)) != NULL) {
+ if (dev_snmp6_entry->d_name[0] == '.')
+ continue;
+
+ if (snprintf(dev_filename, DEV_FILENAME_LEN, "%s/%s", DEV_SNMP6_DIRNAME,
+ dev_snmp6_entry->d_name) > DEV_FILENAME_LEN) {
+ snmp_log(LOG_ERR, "Interface name %s is too long\n",
+ dev_snmp6_entry->d_name);
+ continue;
+ }
+ if (NULL == (devin = fopen(dev_filename, "r"))) {
+ snmp_log(LOG_ERR, "Failed to open %s\n", dev_filename);
+ continue;
+ }
+
+ /*
+ * If a stat file name is made of digits, the name is interface index.
+ * If it is an interface name, the file includes a line labeled ifIndex.
+ */
+ if (isdigit(dev_snmp6_entry->d_name[0])) {
+ scan_val = strtoull(dev_snmp6_entry->d_name, NULL, 0);
+ } else {
+ if (NULL == (start = fgets(line, sizeof(line), devin))) {
+ snmp_log(LOG_ERR, "%s doesn't include any lines\n",
+ dev_filename);
+ fclose(devin);
+ continue;
+ }
+
+ if (0 != strncmp(start, IFINDEX_LINE, 7)) {
+ snmp_log(LOG_ERR, "%s doesn't include ifIndex line",
+ dev_filename);
+ fclose(devin);
+ continue;
+ }
+
+ scan_str = strrchr(line, ' ');
+ if (NULL == scan_str) {
+ snmp_log(LOG_ERR, "%s is wrong format", dev_filename);
+ fclose(devin);
+ continue;
+ }
+ scan_val = strtoull(scan_str, NULL, 0);
+ }
+
+ entry = netsnmp_access_systemstats_entry_create(2, scan_val,
+ "ipIfStatsTable.ipv6");
+ if(NULL == entry) {
+ fclose(devin);
+ closedir(dev_snmp6_dir);
+ return -3;
+ }
+
+ _systemstats_v6_load_file(entry, devin);
+ CONTAINER_INSERT(container, entry);
+ fclose(devin);
+ }
+ closedir(dev_snmp6_dir);
+ return 0;
+}
+
+/*
+ * Based on load_flags, load ipSystemStatsTable or ipIfStatsTable for ipv6 entries.
+ */
+static int
+_systemstats_v6(netsnmp_container* container, u_int load_flags)
+{
+ DEBUGMSGTL(("access:systemstats:container:arch", "load v6 (flags %u)\n",
+ load_flags));
+
+ netsnmp_assert(container != NULL); /* load function shoulda checked this */
+
+ if (load_flags & NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE) {
+ /* load ipIfStatsTable */
+ return _systemstats_v6_load_ifstats(container, load_flags);
+ } else {
+ /* load ipSystemStatsTable */
+ return _systemstats_v6_load_systemstats(container, load_flags);
+ }
+}
+#endif /* NETSNMP_ENABLE_IPV6 */
diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c b/agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c
new file mode 100644
index 0000000..f2ec497
--- /dev/null
+++ b/agent/mibgroup/ip-mib/data_access/systemstats_solaris2.c
@@ -0,0 +1,213 @@
+#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>
+
+#include "kernel_sunos5.h"
+
+static int _systemstats(mibgroup_e, netsnmp_container *, u_int);
+static void _add_ipstats(mib2_ipIfStatsEntry_t *, mib2_ipIfStatsEntry_t *);
+static int _insert_entry(netsnmp_container *, mib2_ipIfStatsEntry_t *);
+
+void
+netsnmp_access_systemstats_arch_init(void)
+{
+ init_kernel_sunos5();
+}
+
+/*
+ * @retval 0 success
+ * @retval -1 container error
+ * @retval -2 could not create entry (probably malloc)
+ */
+int
+netsnmp_access_systemstats_container_arch_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ int rc;
+
+ if (container == NULL)
+ return (-1);
+
+ if (load_flags & NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE)
+ return 0; /* we do not support ipIfStatsTable yet */
+
+ if ((rc = _systemstats(MIB_IP_TRAFFIC_STATS, container, load_flags)) < 0)
+ return (rc);
+#if defined(NETSNMP_ENABLE_IPV6)
+ if ((rc = _systemstats(MIB_IP6, container, load_flags)) < 0) {
+ netsnmp_access_systemstats_container_free(container,
+ NETSNMP_ACCESS_SYSTEMSTATS_FREE_NOFLAGS);
+ return (rc);
+ }
+#endif
+ return (0);
+}
+
+/*
+ * @retval 0 success
+ * @retval <0 error
+ */
+static int
+_systemstats(mibgroup_e mib, netsnmp_container *container, u_int load_flags)
+{
+ mib2_ipIfStatsEntry_t ipe, iptot;
+ req_e req = GET_FIRST;
+ int ipversion = (mib == MIB_IP6) ? MIB2_INETADDRESSTYPE_ipv6 :
+ MIB2_INETADDRESSTYPE_ipv4;
+ memset(&iptot, '\0', sizeof(iptot));
+
+ while (getMibstat(mib, &ipe, sizeof(ipe), req,
+ &Get_everything, NULL) == 0) {
+ req = GET_NEXT;
+ netsnmp_assert(ipe.ipIfStatsIPVersion == ipversion);
+ _add_ipstats(&iptot, &ipe);
+ }
+ iptot.ipIfStatsIPVersion = ipversion;
+ return _insert_entry(container, &iptot);
+}
+
+static void
+_add_ipstats(mib2_ipIfStatsEntry_t *o1, mib2_ipIfStatsEntry_t *o2)
+{
+ o1->ipIfStatsInHdrErrors += o2->ipIfStatsInHdrErrors;
+ o1->ipIfStatsInTooBigErrors += o2->ipIfStatsInTooBigErrors;
+ o1->ipIfStatsInNoRoutes += o2->ipIfStatsInNoRoutes;
+ o1->ipIfStatsInAddrErrors += o2->ipIfStatsInAddrErrors;
+ o1->ipIfStatsInUnknownProtos += o2->ipIfStatsInUnknownProtos;
+ o1->ipIfStatsInTruncatedPkts += o2->ipIfStatsInTruncatedPkts;
+ o1->ipIfStatsInDiscards += o2->ipIfStatsInDiscards;
+ o1->ipIfStatsOutDiscards += o2->ipIfStatsOutDiscards;
+ o1->ipIfStatsOutFragOKs += o2->ipIfStatsOutFragOKs;
+ o1->ipIfStatsOutFragFails += o2->ipIfStatsOutFragFails;
+ o1->ipIfStatsOutFragCreates += o2->ipIfStatsOutFragCreates;
+ o1->ipIfStatsReasmReqds += o2->ipIfStatsReasmReqds;
+ o1->ipIfStatsReasmOKs += o2->ipIfStatsReasmOKs;
+ o1->ipIfStatsReasmFails += o2->ipIfStatsReasmFails;
+ o1->ipIfStatsOutNoRoutes += o2->ipIfStatsOutNoRoutes;
+ o1->ipIfStatsReasmDuplicates += o2->ipIfStatsReasmDuplicates;
+ o1->ipIfStatsReasmPartDups += o2->ipIfStatsReasmPartDups;
+ o1->ipIfStatsForwProhibits += o2->ipIfStatsForwProhibits;
+ o1->udpInCksumErrs += o2->udpInCksumErrs;
+ o1->udpInOverflows += o2->udpInOverflows;
+ o1->rawipInOverflows += o2->rawipInOverflows;
+ o1->ipIfStatsInWrongIPVersion += o2->ipIfStatsInWrongIPVersion;
+ o1->ipIfStatsOutWrongIPVersion += o2->ipIfStatsOutWrongIPVersion;
+ o1->ipIfStatsOutSwitchIPVersion += o2->ipIfStatsOutSwitchIPVersion;
+ o1->ipIfStatsHCInReceives += o2->ipIfStatsHCInReceives;
+ o1->ipIfStatsHCInOctets += o2->ipIfStatsHCInOctets;
+ o1->ipIfStatsHCInForwDatagrams += o2->ipIfStatsHCInForwDatagrams;
+ o1->ipIfStatsHCInDelivers += o2->ipIfStatsHCInDelivers;
+ o1->ipIfStatsHCOutRequests += o2->ipIfStatsHCOutRequests;
+ o1->ipIfStatsHCOutForwDatagrams += o2->ipIfStatsHCOutForwDatagrams;
+ o1->ipIfStatsOutFragReqds += o2->ipIfStatsOutFragReqds;
+ o1->ipIfStatsHCOutTransmits += o2->ipIfStatsHCOutTransmits;
+ o1->ipIfStatsHCOutOctets += o2->ipIfStatsHCOutOctets;
+ o1->ipIfStatsHCInMcastPkts += o2->ipIfStatsHCInMcastPkts;
+ o1->ipIfStatsHCInMcastOctets += o2->ipIfStatsHCInMcastOctets;
+ o1->ipIfStatsHCOutMcastPkts += o2->ipIfStatsHCOutMcastPkts;
+ o1->ipIfStatsHCOutMcastOctets += o2->ipIfStatsHCOutMcastOctets;
+ o1->ipIfStatsHCInBcastPkts += o2->ipIfStatsHCInBcastPkts;
+ o1->ipIfStatsHCOutBcastPkts += o2->ipIfStatsHCOutBcastPkts;
+ o1->ipsecInSucceeded += o2->ipsecInSucceeded;
+ o1->ipsecInFailed += o2->ipsecInFailed;
+ o1->ipInCksumErrs += o2->ipInCksumErrs;
+ o1->tcpInErrs += o2->tcpInErrs;
+ o1->udpNoPorts += o2->udpNoPorts;
+}
+
+/*
+ * @retval 0 entry was successfully inserted in the container
+ * @retval -1 container error
+ * @retval -2 memory allocation error
+ */
+static int
+_insert_entry(netsnmp_container *container, mib2_ipIfStatsEntry_t *ipe)
+{
+ int i;
+
+ netsnmp_systemstats_entry *ep =
+ netsnmp_access_systemstats_entry_create(ipe->ipIfStatsIPVersion, 0,
+ "ipSystemStatsTable");
+
+ DEBUGMSGTL(("access:systemstats:arch", "insert entry for v%d\n",
+ ipe->ipIfStatsIPVersion));
+ if (ep == NULL) {
+ DEBUGMSGT(("access:systemstats:arch", "insert failed (alloc)"));
+ return (-2);
+ }
+
+ ep->stats.HCInReceives.low =
+ ipe->ipIfStatsHCInReceives & 0xffffffff;
+ ep->stats.HCInReceives.high = ipe->ipIfStatsHCInReceives >> 32;
+ ep->stats.HCInOctets.low =
+ ipe->ipIfStatsHCInOctets & 0xffffffff;
+ ep->stats.HCInOctets.high = ipe->ipIfStatsHCInOctets >> 32;
+ ep->stats.InHdrErrors = ipe->ipIfStatsInHdrErrors;
+ ep->stats.InAddrErrors = ipe->ipIfStatsInAddrErrors;
+ ep->stats.InUnknownProtos = ipe->ipIfStatsInUnknownProtos;
+ ep->stats.InTruncatedPkts = ipe->ipIfStatsInTruncatedPkts;
+ ep->stats.HCInForwDatagrams.low =
+ ipe->ipIfStatsHCInForwDatagrams & 0xffffffff;
+ ep->stats.HCInForwDatagrams.high =
+ ipe->ipIfStatsHCInForwDatagrams >> 32;
+ ep->stats.ReasmReqds = ipe->ipIfStatsReasmReqds;
+ ep->stats.ReasmOKs = ipe->ipIfStatsReasmOKs;
+ ep->stats.ReasmFails = ipe->ipIfStatsReasmFails;
+ ep->stats.InDiscards = ipe->ipIfStatsInDiscards;
+ ep->stats.HCInDelivers.low =
+ ipe->ipIfStatsHCInDelivers & 0xffffffff;
+ ep->stats.HCInDelivers.high =
+ ipe->ipIfStatsHCInDelivers >> 32;
+ ep->stats.HCOutRequests.low =
+ ipe->ipIfStatsHCOutRequests & 0xffffffff;
+ ep->stats.HCOutRequests.high =
+ ipe->ipIfStatsHCOutRequests >> 32;
+ ep->stats.HCOutNoRoutes.low = ipe->ipIfStatsOutNoRoutes & 0xffffffff;
+ ep->stats.HCOutNoRoutes.high = 0;
+ ep->stats.HCOutForwDatagrams.low =
+ ipe->ipIfStatsHCOutForwDatagrams & 0xffffffff;
+ ep->stats.HCOutForwDatagrams.high =
+ ipe->ipIfStatsHCOutForwDatagrams >> 32;
+ ep->stats.HCOutDiscards.low = ipe->ipIfStatsOutDiscards & 0xffffffff;
+ ep->stats.HCOutDiscards.high = 0;
+ ep->stats.HCOutFragOKs.low = ipe->ipIfStatsOutFragOKs & 0xffffffff;
+ ep->stats.HCOutFragOKs.high = 0;
+ ep->stats.HCOutFragFails.low = ipe->ipIfStatsOutFragFails & 0xffffffff;
+ ep->stats.HCOutFragFails.high = 0;
+ ep->stats.HCOutFragCreates.low = ipe->ipIfStatsOutFragCreates & 0xffffffff;
+ ep->stats.HCOutFragCreates.high = 0;
+ ep->stats.HCOutTransmits.low =
+ ipe->ipIfStatsHCOutTransmits & 0xffffffff;
+ ep->stats.HCOutTransmits.high = ipe->ipIfStatsHCOutTransmits >> 32;
+ ep->stats.HCOutOctets.low = ipe->ipIfStatsHCOutOctets & 0xffffffff;
+ ep->stats.HCOutOctets.high = ipe->ipIfStatsHCOutOctets >> 32;
+ ep->stats.HCInMcastPkts.low = ipe->ipIfStatsHCInMcastPkts & 0xffffffff;
+ ep->stats.HCInMcastPkts.high = ipe->ipIfStatsHCInMcastPkts >> 32;
+ ep->stats.HCInMcastOctets.low =
+ ipe->ipIfStatsHCInMcastOctets & 0xffffffff;
+ ep->stats.HCInMcastOctets.high = ipe->ipIfStatsHCInMcastOctets >> 32;
+ ep->stats.HCOutMcastPkts.low =
+ ipe->ipIfStatsHCOutMcastPkts & 0xffffffff;
+ ep->stats.HCOutMcastPkts.high = ipe->ipIfStatsHCOutMcastPkts >> 32;
+ ep->stats.HCOutMcastOctets.low =
+ ipe->ipIfStatsHCOutMcastOctets & 0xffffffff;
+ ep->stats.HCOutMcastOctets.high = ipe->ipIfStatsHCOutMcastOctets >> 32;
+ ep->stats.HCInBcastPkts.low = ipe->ipIfStatsHCInBcastPkts & 0xffffffff;
+ ep->stats.HCInBcastPkts.high = ipe->ipIfStatsHCInBcastPkts >> 32;
+ ep->stats.HCOutBcastPkts.low =
+ ipe->ipIfStatsHCOutBcastPkts & 0xffffffff;
+ ep->stats.HCOutBcastPkts.high = ipe->ipIfStatsHCOutBcastPkts >> 32;
+
+ for (i=0; i<=IPSYSTEMSTATSTABLE_LAST; i++)
+ ep->stats.columnAvail[i] = 1;
+
+ if (CONTAINER_INSERT(container, ep) < 0) {
+ DEBUGMSGT(("access:systemstats:arch", "unable to insert entry"));
+ netsnmp_access_systemstats_entry_free(ep);
+ return (-1);
+ }
+ return (0);
+}
diff --git a/agent/mibgroup/ip-mib/inetNetToMediaTable.h b/agent/mibgroup/ip-mib/inetNetToMediaTable.h
new file mode 100644
index 0000000..c2faab8
--- /dev/null
+++ b/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/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c
new file mode 100644
index 0000000..aaae2e3
--- /dev/null
+++ b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c
@@ -0,0 +1,1817 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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"
+
+const oid inetNetToMediaTable_oid[] = { INETNETTOMEDIATABLE_OID };
+const int inetNetToMediaTable_oid_size =
+OID_LENGTH(inetNetToMediaTable_oid);
+
+inetNetToMediaTable_registration inetNetToMediaTable_user_context;
+static inetNetToMediaTable_registration *inetNetToMediaTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ inetNetToMediaTable_user_context_p =
+ 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
+ (inetNetToMediaTable_user_context_p, flags);
+} /* initialize_table_inetNetToMediaTable */
+
+/**
+ * Shutdown the table inetNetToMediaTable
+ */
+void
+shutdown_table_inetNetToMediaTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _inetNetToMediaTable_shutdown_interface
+ (inetNetToMediaTable_user_context_p);
+ netsnmp_free_all_list_data(inetNetToMediaTable_user_context_p);
+ inetNetToMediaTable_user_context_p = NULL;
+}
+
+/**
+ * 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.
+ */
+ SNMP_FREE(rowreq_ctx->data);
+} /* 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
+ */
+ *inetNetToMediaLastUpdated_val_ptr = rowreq_ctx->data->arp_last_updated;
+ 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/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
new file mode 100644
index 0000000..73afae6
--- /dev/null
+++ b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
@@ -0,0 +1,420 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+#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 const oid inetNetToMediaTable_oid[];
+ extern const 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
+ inetNetToMediaRowStatus_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ inetNetToMediaRowStatus_val);
+
+
+ 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/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
new file mode 100644
index 0000000..0b23b9f
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
new file mode 100644
index 0000000..d877f8b
--- /dev/null
+++ b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
@@ -0,0 +1,670 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(container_lifo)
+static netsnmp_arp_access * arp_access = NULL;
+
+/** @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
+ *
+ */
+
+/**
+ * check entry for update
+ */
+static void
+_add_or_update_arp_entry(netsnmp_arp_entry *arp_entry,
+ netsnmp_container *container)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx, *old;
+ 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 16:
+ 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 try to find it in
+ * the cache.
+ */
+ 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,
+ (char *) rowreq_ctx->data->arp_ipaddress,
+ rowreq_ctx->data->arp_ipaddress_len))) {
+
+ /* try to find old entry */
+ old = (inetNetToMediaTable_rowreq_ctx*)CONTAINER_FIND(container, rowreq_ctx);
+ if (arp_entry->flags & NETSNMP_ACCESS_ARP_ENTRY_FLAG_DELETE) {
+ /* delete existing entry */
+ if (old != NULL) {
+ CONTAINER_REMOVE(container, old);
+ inetNetToMediaTable_release_rowreq_ctx(old);
+ }
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+ } else if (old != NULL) {
+ /* the entry is already there, update it */
+ netsnmp_access_arp_entry_update(old->data, arp_entry);
+ /* delete the auxiliary context we used to find the entry
+ * (this deletes also arp_entry) */
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ /* create new entry and add it to the cache*/
+ rowreq_ctx->inetNetToMediaRowStatus = ROWSTATUS_ACTIVE;
+ rowreq_ctx->data->arp_last_updated = netsnmp_get_agent_uptime();
+ 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);
+ }
+}
+
+static void _arp_hook_update(netsnmp_arp_access *access, netsnmp_arp_entry *entry)
+{
+ _add_or_update_arp_entry(entry, access->magic);
+}
+
+typedef struct {
+ unsigned generation;
+ netsnmp_container *to_delete;
+} _collect_ctx;
+
+/**
+ * Put all entries with outdated generation to deletion list.
+ */
+static void
+_collect_invalid_arp_ctx(inetNetToMediaTable_rowreq_ctx *ctx,
+ _collect_ctx *cctx)
+{
+ if (ctx->data->generation != cctx->generation)
+ CONTAINER_INSERT(cctx->to_delete, ctx);
+}
+
+static void _arp_hook_gc(netsnmp_arp_access *access)
+{
+ netsnmp_container *container = access->magic;
+ _collect_ctx cctx;
+
+ cctx.to_delete = netsnmp_container_find("lifo");
+ cctx.generation = access->generation;
+
+ CONTAINER_FOR_EACH(container,
+ (netsnmp_container_obj_func *) _collect_invalid_arp_ctx,
+ &cctx);
+
+ while (CONTAINER_SIZE(cctx.to_delete)) {
+ inetNetToMediaTable_rowreq_ctx *ctx = (inetNetToMediaTable_rowreq_ctx*)CONTAINER_FIRST(cctx.to_delete);
+ CONTAINER_REMOVE(container, ctx);
+ inetNetToMediaTable_release_rowreq_ctx(ctx);
+ CONTAINER_REMOVE(cctx.to_delete, NULL);
+ }
+ CONTAINER_FREE(cctx.to_delete);
+}
+
+/**
+ * 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;
+ }
+
+ arp_access = netsnmp_access_arp_create(
+ NETSNMP_ACCESS_ARP_CREATE_NOFLAGS,
+ _arp_hook_update,
+ _arp_hook_gc,
+ &cache->timeout,
+ &cache->flags,
+ &cache->expired);
+ if (arp_access == NULL) {
+ snmp_log(LOG_ERR,
+ "unable to create arp access in inetNetToMediaTable_container_init\n");
+ return;
+ }
+} /* inetNetToMediaTable_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 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 != arp_access) {
+ netsnmp_access_arp_delete(arp_access);
+ arp_access = NULL;
+ }
+
+ 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)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_cache_load", "called\n"));
+
+ arp_access->magic = container;
+ if (netsnmp_access_arp_load(arp_access) < 0)
+ return MFD_ERROR;
+
+ 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"));
+
+ if (NULL != arp_access) {
+ netsnmp_access_arp_unload(arp_access);
+ arp_access->magic = NULL;
+ }
+
+ /*
+ * 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/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
new file mode 100644
index 0000000..cc0434b
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
new file mode 100644
index 0000000..c18689a
--- /dev/null
+++ b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
@@ -0,0 +1,2032 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(inetNetToMediaTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(table_container_row_insert)
+netsnmp_feature_require(check_all_requests_error)
+
+
+netsnmp_feature_child_of(inetNetToMediaTable_container_size, inetNetToMediaTable_external_access)
+netsnmp_feature_child_of(inetNetToMediaTable_registration_set, inetNetToMediaTable_external_access)
+netsnmp_feature_child_of(inetNetToMediaTable_registration_get, inetNetToMediaTable_external_access)
+netsnmp_feature_child_of(inetNetToMediaTable_container_get, inetNetToMediaTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_CONTAINER_GET
+netsnmp_container *
+inetNetToMediaTable_container_get(void)
+{
+ return inetNetToMediaTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_REGISTRATION_GET
+inetNetToMediaTable_registration *
+inetNetToMediaTable_registration_get(void)
+{
+ return inetNetToMediaTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_REGISTRATION_SET
+inetNetToMediaTable_registration *
+inetNetToMediaTable_registration_set(inetNetToMediaTable_registration *
+ newreg)
+{
+ inetNetToMediaTable_registration *old =
+ inetNetToMediaTable_if_ctx.user_ctx;
+ inetNetToMediaTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_CONTAINER_SIZE
+int
+inetNetToMediaTable_container_size(void)
+{
+ return CONTAINER_SIZE(inetNetToMediaTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_CONTAINER_SIZE */
+
+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;
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+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);
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+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 retrieval.
+ */
+ 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;
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /*
+ * 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ /*************************************************
+ *
+ * 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
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ | HANDLER_CAN_RWRITE
+#endif
+ );
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 */
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+/***********************************************************************
+ *
+ * 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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 = (inetNetToMediaTable_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 */
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+/***********************************************************************
+ *
+ * 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 (if_ctx->container)
+ if_ctx->container->container_name = strdup("inetNetToMediaTable");
+ }
+ 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_EXTERNAL_ACCESS
+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 = (inetNetToMediaTable_rowreq_ctx*)
+ CONTAINER_FIND(inetNetToMediaTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INETNETTOMEDIATABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
new file mode 100644
index 0000000..8cbb36f
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/ip-mib/ipAddressPrefixTable.h b/agent/mibgroup/ip-mib/ipAddressPrefixTable.h
new file mode 100644
index 0000000..abfa100
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipAddressPrefixTable/ipAddressPrefixTable)
diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
new file mode 100644
index 0000000..f4bb085
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
@@ -0,0 +1,675 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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"
+
+const oid ipAddressPrefixTable_oid[] = { IPADDRESSPREFIXTABLE_OID };
+const int ipAddressPrefixTable_oid_size =
+OID_LENGTH(ipAddressPrefixTable_oid);
+
+ipAddressPrefixTable_registration ipAddressPrefixTable_user_context;
+static ipAddressPrefixTable_registration *ipAddressPrefixTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ ipAddressPrefixTable_user_context_p
+ = 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
+ (ipAddressPrefixTable_user_context_p, flags);
+} /* initialize_table_ipAddressPrefixTable */
+
+/**
+ * Shutdown the table ipAddressPrefixTable
+ */
+void
+shutdown_table_ipAddressPrefixTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipAddressPrefixTable_shutdown_interface
+ (ipAddressPrefixTable_user_context_p);
+ netsnmp_free_all_list_data(ipAddressPrefixTable_user_context_p);
+ ipAddressPrefixTable_user_context_p = NULL;
+}
+
+/**
+ * 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,
+ u_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,
+ u_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) = 4294967295U; /* 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) = 4294967295U; /* per MIB */
+ else
+ (*ipAddressPrefixAdvValidLifetime_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixAdvValidLifetime;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixAdvValidLifetime_get */
+
+
+
+/** @} */
+/** @} */
+/** @{ */
diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
new file mode 100644
index 0000000..24b22a2
--- /dev/null
+++ b/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$
+ */
+#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 const oid ipAddressPrefixTable_oid[];
+ extern const 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,
+ u_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,
+ u_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/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
new file mode 100644
index 0000000..5ecade4
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
@@ -0,0 +1,153 @@
+/*
+ * 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$
+ */
+#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 */
+/****************************************************************
+* Additional constants and definitions for common implementation
+*/
+#define INFINITY_LIFE_TIME 0xFFFFFFFFU
+#define NIP6(addr) \
+ ntohs((addr).s6_addr16[0]), \
+ ntohs((addr).s6_addr16[1]), \
+ ntohs((addr).s6_addr16[2]), \
+ ntohs((addr).s6_addr16[3]), \
+ ntohs((addr).s6_addr16[4]), \
+ ntohs((addr).s6_addr16[5]), \
+ ntohs((addr).s6_addr16[6]), \
+ ntohs((addr).s6_addr16[7])
+
diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
new file mode 100644
index 0000000..4437829
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
@@ -0,0 +1,383 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(ipAddressTable_container_get)
+netsnmp_feature_require(ipaddress_common_copy_utilities)
+netsnmp_feature_require(ipaddress_prefix_copy)
+
+/** @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;
+ int 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);
+ netsnmp_ipaddress_flags_copy(&rowreq_ctx->data.
+ ipAddressPrefixAdvPreferredLifetime,
+ &rowreq_ctx->data.
+ ipAddressPrefixAdvValidLifetime,
+ &rowreq_ctx->data.
+ ipAddressPrefixOnLinkFlag,
+ &rowreq_ctx->data.
+ ipAddressPrefixAutonomousFlag,
+ &addr_rowreq_ctx->data->
+ ia_prefered_lifetime,
+ &addr_rowreq_ctx->data->
+ ia_valid_lifetime,
+ &addr_rowreq_ctx->data->
+ ia_onlink_flag,
+ &addr_rowreq_ctx->data->
+ ia_autonomous_flag);
+
+ 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);
+ rowreq_ctx = NULL;
+ 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)
+ */
+ netsnmp_ipaddress_prefix_origin_copy(&rowreq_ctx->data.
+ ipAddressPrefixOrigin,
+ addr_rowreq_ctx->data->
+ ia_origin,
+ addr_rowreq_ctx->data->
+ flags,
+ addr_rowreq_ctx->tbl_idx.
+ ipAddressAddrType);
+
+ /** defer the rest til row prep */
+
+ /*
+ * insert into table container, clear ptr so we reallocate
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ rowreq_ctx = NULL;
+ ++count;
+ }
+ ITERATOR_RELEASE(addr_it);
+
+ 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/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
new file mode 100644
index 0000000..e50d7d0
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c
new file mode 100644
index 0000000..e14a337
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c
@@ -0,0 +1,1065 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+netsnmp_feature_child_of(ipaddressprefixtable_row_find_by_mib_index, ipaddressprefixtable_all)
+netsnmp_feature_child_of(ipaddressprefixtable_container_get, ipaddressprefixtable_all)
+netsnmp_feature_child_of(ipAddressPrefixTable_registration_get, ipaddressprefixtable_all)
+netsnmp_feature_child_of(ipAddressPrefixTable_registration_set, ipaddressprefixtable_all)
+netsnmp_feature_child_of(ipAddressPrefixTable_container_size, ipaddressprefixtable_all)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_CONTAINER_GET
+netsnmp_container *
+ipAddressPrefixTable_container_get(void)
+{
+ return ipAddressPrefixTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_REGISTRATION_GET
+ipAddressPrefixTable_registration *
+ipAddressPrefixTable_registration_get(void)
+{
+ return ipAddressPrefixTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_REGISTRATION_SET
+ipAddressPrefixTable_registration *
+ipAddressPrefixTable_registration_set(ipAddressPrefixTable_registration *
+ newreg)
+{
+ ipAddressPrefixTable_registration *old =
+ ipAddressPrefixTable_if_ctx.user_ctx;
+ ipAddressPrefixTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_CONTAINER_SIZE
+int
+ipAddressPrefixTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipAddressPrefixTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_CONTAINER_SIZE */
+
+/*
+ * 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 retrieval.
+ */
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /* XXX - are these actually necessary? */
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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 */
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+#endif
+
+/***********************************************************************
+ *
+ * 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_ROW_FIND_BY_MIB_INDEX
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSPREFIXTABLE_ROW_FIND_BY_MIB_INDEX */
diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
new file mode 100644
index 0000000..28308b5
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/ip-mib/ipAddressTable.h b/agent/mibgroup/ip-mib/ipAddressTable.h
new file mode 100644
index 0000000..8d4d274
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipAddressTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipAddressTable/ipAddressTable)
diff --git a/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
new file mode 100644
index 0000000..deff4e9
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
@@ -0,0 +1,2436 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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-features.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"
+
+netsnmp_feature_require(check_storage_transition)
+netsnmp_feature_require(ipaddress_entry_copy)
+netsnmp_feature_require(ipaddress_prefix_copy)
+
+const oid ipAddressTable_oid[] = { IPADDRESSTABLE_OID };
+const int ipAddressTable_oid_size = OID_LENGTH(ipAddressTable_oid);
+
+ipAddressTable_registration ipAddressTable_user_context;
+static ipAddressTable_registration *ipAddressTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ ipAddressTable_user_context_p = 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(ipAddressTable_user_context_p, flags);
+} /* initialize_table_ipAddressTable */
+
+/**
+ * Shutdown the table ipAddressTable
+ */
+void
+shutdown_table_ipAddressTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipAddressTable_shutdown_interface(ipAddressTable_user_context_p);
+ netsnmp_free_all_list_data(ipAddressTable_user_context_p);
+ ipAddressTable_user_context_p = NULL;
+}
+
+/**
+ * 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(long * mib_ipAddressAddrType_val_ptr,
+ 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,
+ long ipAddressAddrType_val,
+ u_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,
+ u_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];
+ size_t 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,
+ (u_char *) 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) = (oid*)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 */
+ if(rowreq_ctx->data->if_index)
+ (*ipAddressRowStatus_val_ptr) = rowreq_ctx->ipAddressRowStatus;
+ else
+ (*ipAddressRowStatus_val_ptr) = ROWSTATUS_NOTREADY;
+
+ 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 == (long)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 %ld\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 != (oid)ipAddressIfIndex_val)
+ rowreq_ctx->data->if_index = (oid)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 %lu\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/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
new file mode 100644
index 0000000..fe8f04a
--- /dev/null
+++ b/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$
+ */
+#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
+ */
+ 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 */
+ u_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 const oid ipAddressTable_oid[];
+ extern const 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(long *
+ mib_ipAddressAddrType_val_ptr,
+ 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,
+ long ipAddressAddrType_val,
+ u_char *ipAddressAddr_val_ptr,
+ size_t
+ ipAddressAddr_val_ptr_len);
+ int ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressAddrType_val,
+ u_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/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
new file mode 100644
index 0000000..7e88550
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
new file mode 100644
index 0000000..d80b3e7
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
@@ -0,0 +1,706 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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>
+
+netsnmp_feature_require(container_lifo)
+netsnmp_feature_require(ipaddress_entry_update)
+
+/** @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) {
+ (*container_ptr_ptr)->container_name = strdup("ipAddressTable");
+ 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 = (netsnmp_container*)magic[0];
+ netsnmp_container *to_delete = (netsnmp_container*)magic[1];
+
+ /*
+ * check for matching entry using secondary index.
+ */
+ netsnmp_ipaddress_entry *ipaddress_entry = (netsnmp_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 = (ipAddressTable_rowreq_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",
+ "%lu records\n", (unsigned long)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\n"));
+ return MFD_ERROR;
+ }
+ break;
+
+ case INETADDRESSTYPE_IPV6:
+ /** xxx-rks: allow 20? */
+ if (16 != rowreq_ctx->tbl_idx.ipAddressAddr_len) {
+ DEBUGMSGT(("ipAddressTable", "bad addr len\n"));
+ 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.
+ *
+ *
+ */
+ if ((4 != rowreq_ctx->tbl_idx.ipAddressAddr_len)
+ && (16 != 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 {
+ memcpy(rowreq_ctx->data->ia_address, rowreq_ctx->tbl_idx.ipAddressAddr,
+ rowreq_ctx->tbl_idx.ipAddressAddr_len);
+ rowreq_ctx->data->ia_address_len = rowreq_ctx->tbl_idx.ipAddressAddr_len;
+ }
+
+ return rc;
+} /* ipAddressTable_validate_index */
+
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
new file mode 100644
index 0000000..7bcd435
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
new file mode 100644
index 0000000..48770b0
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
@@ -0,0 +1,2092 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(ipAddressTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(table_container_row_insert)
+netsnmp_feature_require(check_all_requests_error)
+
+
+netsnmp_feature_child_of(ipAddressTable_container_size, ipAddressTable_external_access)
+netsnmp_feature_child_of(ipAddressTable_registration_set, ipAddressTable_external_access)
+netsnmp_feature_child_of(ipAddressTable_registration_get, ipAddressTable_external_access)
+netsnmp_feature_child_of(ipAddressTable_container_get, ipAddressTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_CONTAINER_GET
+netsnmp_container *
+ipAddressTable_container_get(void)
+{
+ return ipAddressTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_REGISTRATION_GET
+ipAddressTable_registration *
+ipAddressTable_registration_get(void)
+{
+ return ipAddressTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_REGISTRATION_SET
+ipAddressTable_registration *
+ipAddressTable_registration_set(ipAddressTable_registration * newreg)
+{
+ ipAddressTable_registration *old = ipAddressTable_if_ctx.user_ctx;
+ ipAddressTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_CONTAINER_SIZE
+int
+ipAddressTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipAddressTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_CONTAINER_SIZE */
+
+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;
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+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);
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+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 retrieval.
+ */
+ 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;
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /*
+ * 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ /*************************************************
+ *
+ * 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
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ | HANDLER_CAN_RWRITE
+#endif
+ );
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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
+ */
+ 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]);
+ }
+
+
+ }
+
+ /*
+ * 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 = (ipAddressTable_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 = (ipAddressTable_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 = (ipAddressTable_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 */
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+/***********************************************************************
+ *
+ * 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 = (ipAddressTable_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 = (ipAddressTable_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 = (ipAddressTable_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 = (ipAddressTable_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 = (ipAddressTable_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 = (ipAddressTable_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 = (ipAddressTable_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 = (ipAddressTable_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 = (ipAddressTable_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 */
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+/***********************************************************************
+ *
+ * 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_EXTERNAL_ACCESS
+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 = (ipAddressTable_rowreq_ctx*)CONTAINER_FIND(ipAddressTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPADDRESSTABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
new file mode 100644
index 0000000..ac54477
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/ip-mib/ipDefaultRouterTable.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable.h
new file mode 100644
index 0000000..28ed84b
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipDefaultRouterTable/ipDefaultRouterTable)
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c
new file mode 100644
index 0000000..180e317
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for ipDefaultRouterTable
+ *
+ * \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 "ipDefaultRouterTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipDefaultRouterTable_interface.h"
+
+const oid ipDefaultRouterTable_oid[] = { IPDEFAULTROUTERTABLE_OID };
+const int ipDefaultRouterTable_oid_size =
+OID_LENGTH(ipDefaultRouterTable_oid);
+
+ipDefaultRouterTable_registration ipDefaultRouterTable_user_context;
+static ipDefaultRouterTable_registration *ipDefaultRouterTable_user_context_p;
+
+void initialize_table_ipDefaultRouterTable(void);
+void shutdown_table_ipDefaultRouterTable(void);
+
+
+/**
+ * Initializes the ipDefaultRouterTable module
+ */
+void
+init_ipDefaultRouterTable(void)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:init_ipDefaultRouterTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipDefaultRouterTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipDefaultRouterTable"))
+ initialize_table_ipDefaultRouterTable();
+
+} /* init_ipDefaultRouterTable */
+
+/**
+ * Shut-down the ipDefaultRouterTable module (agent is exiting)
+ */
+void
+shutdown_ipDefaultRouterTable(void)
+{
+ if (should_init("ipDefaultRouterTable"))
+ shutdown_table_ipDefaultRouterTable();
+
+}
+
+/**
+ * Initialize the table ipDefaultRouterTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipDefaultRouterTable(void)
+{
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:initialize_table_ipDefaultRouterTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipDefaultRouterTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipDefaultRouterTable 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.
+ */
+ ipDefaultRouterTable_user_context_p =
+ netsnmp_create_data_list("ipDefaultRouterTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipDefaultRouterTable_initialize_interface
+ (ipDefaultRouterTable_user_context_p, flags);
+} /* initialize_table_ipDefaultRouterTable */
+
+/**
+ * Shutdown the table ipDefaultRouterTable
+ */
+void
+shutdown_table_ipDefaultRouterTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipDefaultRouterTable_shutdown_interface
+ (ipDefaultRouterTable_user_context_p);
+ netsnmp_free_all_list_data(ipDefaultRouterTable_user_context_p);
+ ipDefaultRouterTable_user_context_p = NULL;
+}
+
+/**
+ * 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
+ipDefaultRouterTable_rowreq_ctx_init(ipDefaultRouterTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipDefaultRouterTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipDefaultRouterTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipDefaultRouterTable_rowreq_ctx_cleanup(ipDefaultRouterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipDefaultRouterTable rowreq cleanup.
+ */
+ netsnmp_access_defaultrouter_entry_free(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+} /* ipDefaultRouterTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipDefaultRouterTable_pre_request(ipDefaultRouterTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipDefaultRouterTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipDefaultRouterTable_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
+ipDefaultRouterTable_post_request(ipDefaultRouterTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipDefaultRouterTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipDefaultRouterTable_post_request */
+
+
+/** @{ */
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
new file mode 100644
index 0000000..f2ef29a
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
@@ -0,0 +1,212 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef IPDEFAULTROUTERTABLE_H
+#define IPDEFAULTROUTERTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/defaultrouter.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-mib/data_access/defaultrouter)
+config_require(ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface)
+config_require(ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access)
+config_require(ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get)
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for ipDefaultRouterTable
+ */
+#include "ipDefaultRouterTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "ipDefaultRouterTable_enums.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipDefaultRouterTable(void);
+ void shutdown_ipDefaultRouterTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipDefaultRouterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.37, 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 ipDefaultRouterTable registration context.
+ */
+ typedef netsnmp_data_list ipDefaultRouterTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipDefaultRouterTable data context structure.
+ * This structure is used to represent the data for ipDefaultRouterTable.
+ */
+ typedef netsnmp_defaultrouter_entry ipDefaultRouterTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review ipDefaultRouterTable mib index.
+ * This structure is used to represent the index for ipDefaultRouterTable.
+ */
+ typedef struct ipDefaultRouterTable_mib_index_s {
+
+ /*
+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long ipDefaultRouterAddressType;
+
+ /*
+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 2(other indexes) - oid length(10) = 115 */
+ char ipDefaultRouterAddress[115];
+ size_t ipDefaultRouterAddress_len;
+
+ /*
+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ long ipDefaultRouterIfIndex;
+
+
+ } ipDefaultRouterTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipDefaultRouterTable 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_ipDefaultRouterTable_IDX_LEN 118
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipDefaultRouterTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipDefaultRouterTable_rowreq_ctx pointer.
+ */
+ typedef struct ipDefaultRouterTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipDefaultRouterTable_IDX_LEN];
+
+ ipDefaultRouterTable_mib_index tbl_idx;
+
+ ipDefaultRouterTable_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 ipDefaultRouterTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipDefaultRouterTable_data_list;
+
+ } ipDefaultRouterTable_rowreq_ctx;
+
+ typedef struct ipDefaultRouterTable_ref_rowreq_ctx_s {
+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx;
+ } ipDefaultRouterTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ ipDefaultRouterTable_pre_request(ipDefaultRouterTable_registration
+ * user_context);
+ int
+ ipDefaultRouterTable_post_request(ipDefaultRouterTable_registration
+ * user_context, int rc);
+
+ int
+ ipDefaultRouterTable_rowreq_ctx_init
+ (ipDefaultRouterTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ ipDefaultRouterTable_rowreq_ctx_cleanup
+ (ipDefaultRouterTable_rowreq_ctx * rowreq_ctx);
+
+ ipDefaultRouterTable_data *ipDefaultRouterTable_allocate_data(void);
+ void
+ ipDefaultRouterTable_release_data(ipDefaultRouterTable_data *
+ data);
+
+
+ ipDefaultRouterTable_rowreq_ctx
+ *ipDefaultRouterTable_row_find_by_mib_index
+ (ipDefaultRouterTable_mib_index * mib_idx);
+
+ extern const oid ipDefaultRouterTable_oid[];
+ extern const int ipDefaultRouterTable_oid_size;
+
+
+#include "ipDefaultRouterTable_interface.h"
+#include "ipDefaultRouterTable_data_access.h"
+#include "ipDefaultRouterTable_data_get.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPDEFAULTROUTERTABLE_H */
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c
new file mode 100644
index 0000000..7d7dcfe
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c
@@ -0,0 +1,423 @@
+/*
+ * 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipDefaultRouterTable.h"
+
+
+#include "ipDefaultRouterTable_data_access.h"
+
+netsnmp_feature_require(container_lifo)
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipDefaultRouterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.37, length: 8
+ */
+
+/**
+ * initialization for ipDefaultRouterTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipDefaultRouterTable_reg
+ * Pointer to ipDefaultRouterTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipDefaultRouterTable_init_data(ipDefaultRouterTable_registration *
+ ipDefaultRouterTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipDefaultRouterTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipDefaultRouterTable_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
+ipDefaultRouterTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipDefaultRouterTable_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 ipDefaultRouterTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipDefaultRouterTable 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 = IPDEFAULTROUTERTABLE_CACHE_TIMEOUT; /* seconds */
+} /* ipDefaultRouterTable_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 ipDefaultRouterTable_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
+ipDefaultRouterTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipDefaultRouterTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipDefaultRouterTable_container_shutdown */
+
+/**
+ * check entry for update
+ */
+static void
+_check_entry_for_updates(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx,
+ void **magic)
+{
+ netsnmp_container *defaultrouter_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ /*
+ * check for matching entry using secondary index.
+ */
+ netsnmp_defaultrouter_entry *defaultrouter_entry =
+ CONTAINER_FIND(defaultrouter_container, rowreq_ctx->data);
+ if (NULL == defaultrouter_entry) {
+ DEBUGMSGTL(("ipDefaultRouterTable: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(("ipDefaultRouterTable:access", "updating existing entry\n"));
+
+ /*
+ * Check for changes & update
+ */
+ netsnmp_access_defaultrouter_entry_update(rowreq_ctx->data,
+ defaultrouter_entry);
+
+ /*
+ * remove entry from ifcontainer
+ */
+ CONTAINER_REMOVE(defaultrouter_container, defaultrouter_entry);
+ netsnmp_access_defaultrouter_entry_free(defaultrouter_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_add_new_entry(netsnmp_defaultrouter_entry *defaultrouter_entry,
+ netsnmp_container *container)
+{
+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGMSGTL(("ipDefaultRouterTable:access", "creating new entry\n"));
+
+ netsnmp_assert(NULL != defaultrouter_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx = ipDefaultRouterTable_allocate_rowreq_ctx(defaultrouter_entry,
+ NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS ==
+ ipDefaultRouterTable_indexes_set(rowreq_ctx,
+ defaultrouter_entry->dr_addresstype,
+ defaultrouter_entry->dr_address,
+ defaultrouter_entry->dr_address_len,
+ defaultrouter_entry->dr_if_index))) {
+ if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
+ DEBUGMSGTL(("ipAddressTable:access",
+ "container insert failed for new entry\n"));
+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx);
+ return;
+ }
+ } else {
+ if (NULL != rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "ipDefaultRouterTable cache.\n");
+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "ipDefaultRouterTable cache.\n");
+ netsnmp_access_defaultrouter_entry_free(defaultrouter_entry);
+ }
+
+ return;
+ }
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipDefaultRouterTable 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
+ * ipDefaultRouterTable_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
+ipDefaultRouterTable_container_load(netsnmp_container * container)
+{
+ netsnmp_container *defaultrouter_container;
+ void *tmp_ptr[2];
+
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ipDefaultRouterTable container.
+ * loop over your ipDefaultRouterTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ defaultrouter_container =
+ netsnmp_access_defaultrouter_container_load(NULL,
+ NETSNMP_ACCESS_DEFAULTROUTER_LOAD_ADDL_IDX_BY_ADDR);
+
+ if (NULL == defaultrouter_container)
+ 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 adjustments, saving
+ * missing addresses to be deleted.
+ */
+ tmp_ptr[0] = defaultrouter_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(defaultrouter_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_defaultrouter_container_free(defaultrouter_container,
+ NETSNMP_ACCESS_DEFAULTROUTER_FREE_DONT_CLEAR);
+
+ /*
+ * remove deleted addresses from table container
+ */
+ if (NULL != tmp_ptr[1]) {
+ netsnmp_container *tmp_container =
+ (netsnmp_container *) tmp_ptr[1];
+ ipDefaultRouterTable_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);
+ ipDefaultRouterTable_release_rowreq_ctx(tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE(tmp_container, NULL);
+ }
+ }
+
+ DEBUGMSGT(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_load",
+ "%" NETSNMP_PRIz "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
+ipDefaultRouterTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipDefaultRouterTable container data.
+ */
+} /* ipDefaultRouterTable_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
+ipDefaultRouterTable_row_prep(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_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;
+} /* ipDefaultRouterTable_row_prep */
+
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h
new file mode 100644
index 0000000..ed033f0
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef IPDEFAULTROUTERTABLE_DATA_ACCESS_H
+#define IPDEFAULTROUTERTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipDefaultRouterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.37, length: 8
+ */
+
+
+ int
+ ipDefaultRouterTable_init_data(ipDefaultRouterTable_registration *
+ ipDefaultRouterTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ipDefaultRouterTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define IPDEFAULTROUTERTABLE_CACHE_TIMEOUT 60
+
+ void ipDefaultRouterTable_container_init(netsnmp_container
+ **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ ipDefaultRouterTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int ipDefaultRouterTable_container_load(netsnmp_container *
+ container);
+ void ipDefaultRouterTable_container_free(netsnmp_container *
+ container);
+
+ int ipDefaultRouterTable_cache_load(netsnmp_container *
+ container);
+ void ipDefaultRouterTable_cache_free(netsnmp_container *
+ container);
+ int
+ ipDefaultRouterTable_row_prep(ipDefaultRouterTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPDEFAULTROUTERTABLE_DATA_ACCESS_H */
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c
new file mode 100644
index 0000000..1177897
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c
@@ -0,0 +1,325 @@
+/*
+ * 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 "ipDefaultRouterTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement ipDefaultRouterTable get routines.
+ * TODO:240:M: Implement ipDefaultRouterTable 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 ipDefaultRouterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.37, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipDefaultRouterTable data context functions.
+ */
+/*
+ * ipDefaultRouterTable_allocate_data
+ *
+ * Purpose: create new ipDefaultRouterTable_data.
+ */
+ipDefaultRouterTable_data *
+ipDefaultRouterTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the ipDefaultRouterTable data context.
+ */
+ ipDefaultRouterTable_data *rtn =
+ netsnmp_access_defaultrouter_entry_create();
+
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipDefaultRouterTable_data.\n");
+ }
+
+ return rtn;
+} /* ipDefaultRouterTable_allocate_data */
+
+/*
+ * ipDefaultRouterTable_release_data
+ *
+ * Purpose: release ipDefaultRouterTable data.
+ */
+void
+ipDefaultRouterTable_release_data(ipDefaultRouterTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_release_data", "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the ipDefaultRouterTable data context.
+ */
+ netsnmp_access_defaultrouter_entry_free(data);
+} /* ipDefaultRouterTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipDefaultRouterAddressType_val
+ * @param ipDefaultRouterAddress_ptr
+ * @param ipDefaultRouterAddress_ptr_len
+ * @param ipDefaultRouterIfIndex_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
+ipDefaultRouterTable_indexes_set_tbl_idx(ipDefaultRouterTable_mib_index *
+ tbl_idx,
+ u_long
+ ipDefaultRouterAddressType_val,
+ char
+ *ipDefaultRouterAddress_val_ptr,
+ size_t
+ ipDefaultRouterAddress_val_ptr_len,
+ long ipDefaultRouterIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_defaultrouter_entry */
+ tbl_idx->ipDefaultRouterAddressType = ipDefaultRouterAddressType_val;
+
+ /*
+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->ipDefaultRouterAddress_len = sizeof(tbl_idx->ipDefaultRouterAddress) / sizeof(tbl_idx->ipDefaultRouterAddress[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_defaultrouter_entry */
+ /*
+ * make sure there is enough space for ipDefaultRouterAddress data
+ */
+ if ((NULL == tbl_idx->ipDefaultRouterAddress) ||
+ (tbl_idx->ipDefaultRouterAddress_len <
+ (ipDefaultRouterAddress_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->ipDefaultRouterAddress_len =
+ ipDefaultRouterAddress_val_ptr_len;
+ memcpy(tbl_idx->ipDefaultRouterAddress, ipDefaultRouterAddress_val_ptr,
+ ipDefaultRouterAddress_val_ptr_len *
+ sizeof(ipDefaultRouterAddress_val_ptr[0]));
+
+ /*
+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ /** WARNING: this code might not work for netsnmp_defaultrouter_entry */
+ tbl_idx->ipDefaultRouterIfIndex = ipDefaultRouterIfIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* ipDefaultRouterTable_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
+ipDefaultRouterTable_indexes_set(ipDefaultRouterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipDefaultRouterAddressType_val,
+ char *ipDefaultRouterAddress_val_ptr,
+ size_t ipDefaultRouterAddress_val_ptr_len,
+ long ipDefaultRouterIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipDefaultRouterTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipDefaultRouterAddressType_val,
+ ipDefaultRouterAddress_val_ptr,
+ ipDefaultRouterAddress_val_ptr_len,
+ ipDefaultRouterIfIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipDefaultRouterTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipDefaultRouterTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipDefaultRouterEntry.ipDefaultRouterLifetime
+ * ipDefaultRouterLifetime is subid 4 of ipDefaultRouterEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.37.1.4
+ * Description:
+The remaining length of time, in seconds, that this router
+ will continue to be useful as a default router. A value of
+ zero indicates that it is no longer useful as a default
+ router. It is left to the implementer of the MIB as to
+ whether a router with a lifetime of zero is removed from the
+ list.
+
+ For IPv6, this value should be extracted from the router
+ advertisement messages.
+ *
+ * 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 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 ipDefaultRouterLifetime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipDefaultRouterLifetime_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
+ipDefaultRouterLifetime_get(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipDefaultRouterLifetime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipDefaultRouterLifetime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterLifetime_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipDefaultRouterLifetime data.
+ * copy (* ipDefaultRouterLifetime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipDefaultRouterLifetime_val_ptr) = rowreq_ctx->data->dr_lifetime;
+
+ return MFD_SUCCESS;
+} /* ipDefaultRouterLifetime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipDefaultRouterEntry.ipDefaultRouterPreference
+ * ipDefaultRouterPreference is subid 5 of ipDefaultRouterEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.37.1.5
+ * Description:
+An indication of preference given to this router as a
+ default router as described in he Default Router
+ Preferences document. Treating the value as a
+ 2 bit signed integer allows for simple arithmetic
+ comparisons.
+
+ For IPv4 routers or IPv6 routers that are not using the
+ updated router advertisement format, this object is set to
+ medium (0).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: reserved(-2), low(-1), medium(0), high(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 ipDefaultRouterPreference data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipDefaultRouterPreference_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
+ipDefaultRouterPreference_get(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipDefaultRouterPreference_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipDefaultRouterPreference_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterPreference_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipDefaultRouterPreference data.
+ * copy (* ipDefaultRouterPreference_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipDefaultRouterPreference_val_ptr) = rowreq_ctx->data->dr_preference;
+
+ return MFD_SUCCESS;
+} /* ipDefaultRouterPreference_get */
+
+
+
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h
new file mode 100644
index 0000000..8698675
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h
@@ -0,0 +1,84 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file ipDefaultRouterTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef IPDEFAULTROUTERTABLE_DATA_GET_H
+#define IPDEFAULTROUTERTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipDefaultRouterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.37, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+ ipDefaultRouterLifetime_get(ipDefaultRouterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipDefaultRouterLifetime_val_ptr);
+ int
+ ipDefaultRouterPreference_get(ipDefaultRouterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipDefaultRouterPreference_val_ptr);
+
+
+ int
+ ipDefaultRouterTable_indexes_set_tbl_idx
+ (ipDefaultRouterTable_mib_index * tbl_idx,
+ u_long ipDefaultRouterAddressType_val,
+ char *ipDefaultRouterAddress_val_ptr,
+ size_t ipDefaultRouterAddress_val_ptr_len,
+ long ipDefaultRouterIfIndex_val);
+ int
+ ipDefaultRouterTable_indexes_set(ipDefaultRouterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipDefaultRouterAddressType_val,
+ char
+ *ipDefaultRouterAddress_val_ptr,
+ size_t
+ ipDefaultRouterAddress_val_ptr_len,
+ long ipDefaultRouterIfIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPDEFAULTROUTERTABLE_DATA_GET_H */
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h
new file mode 100644
index 0000000..bb46d10
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h
@@ -0,0 +1,93 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef IPDEFAULTROUTERTABLE_ENUMS_H
+#define IPDEFAULTROUTERTABLE_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 ipDefaultRouterTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipDefaultRouterLifetime (UNSIGNED32 / ASN_UNSIGNED)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPDEFAULTROUTERLIFETIME_ENUMS
+#define IPDEFAULTROUTERLIFETIME_ENUMS
+
+#define IPDEFAULTROUTERLIFETIME_MIN 0
+#define IPDEFAULTROUTERLIFETIME_MAX 0xFFFFFFFFUL
+
+#endif /* IPDEFAULTROUTERLIFETIME_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipDefaultRouterAddressType (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
+ * ipDefaultRouterPreference (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPDEFAULTROUTERPREFERENCE_ENUMS
+#define IPDEFAULTROUTERPREFERENCE_ENUMS
+
+#define IPDEFAULTROUTERPREFERENCE_RESERVED -2
+#define IPDEFAULTROUTERPREFERENCE_LOW -1
+#define IPDEFAULTROUTERPREFERENCE_MEDIUM 0
+#define IPDEFAULTROUTERPREFERENCE_HIGH 1
+
+#endif /* IPDEFAULTROUTERPREFERENCE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPDEFAULTROUTERTABLE_ENUMS_H */
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c
new file mode 100644
index 0000000..40ad72b
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c
@@ -0,0 +1,1026 @@
+/*
+ * 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipDefaultRouterTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipDefaultRouterTable_interface.h"
+
+#include <ctype.h>
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipDefaultRouterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.37, length: 8
+ */
+typedef struct ipDefaultRouterTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ipDefaultRouterTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} ipDefaultRouterTable_interface_ctx;
+
+static ipDefaultRouterTable_interface_ctx ipDefaultRouterTable_if_ctx;
+
+static void
+_ipDefaultRouterTable_container_init(ipDefaultRouterTable_interface_ctx *
+ if_ctx);
+static void
+_ipDefaultRouterTable_container_shutdown(ipDefaultRouterTable_interface_ctx
+ * if_ctx);
+
+
+netsnmp_container *
+ipDefaultRouterTable_container_get(void)
+{
+ return ipDefaultRouterTable_if_ctx.container;
+}
+
+ipDefaultRouterTable_registration *
+ipDefaultRouterTable_registration_get(void)
+{
+ return ipDefaultRouterTable_if_ctx.user_ctx;
+}
+
+ipDefaultRouterTable_registration *
+ipDefaultRouterTable_registration_set(ipDefaultRouterTable_registration *
+ newreg)
+{
+ ipDefaultRouterTable_registration *old =
+ ipDefaultRouterTable_if_ctx.user_ctx;
+ ipDefaultRouterTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipDefaultRouterTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipDefaultRouterTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipDefaultRouterTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipDefaultRouterTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipDefaultRouterTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipDefaultRouterTable_get_values;
+/**
+ * @internal
+ * Initialize the table ipDefaultRouterTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipDefaultRouterTable_initialize_interface
+ (ipDefaultRouterTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipDefaultRouterTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipDefaultRouterTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_ipDefaultRouterTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipDefaultRouterTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipDefaultRouterAddressType */
+ ASN_OCTET_STR,
+ /** index: ipDefaultRouterAddress */
+ ASN_INTEGER,
+ /** index: ipDefaultRouterIfIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrieval.
+ */
+ tbl_info->min_column = IPDEFAULTROUTERTABLE_MIN_COL;
+ tbl_info->max_column = IPDEFAULTROUTERTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipDefaultRouterTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipDefaultRouterTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipDefaultRouterTable_container_init(&ipDefaultRouterTable_if_ctx);
+ if (NULL == ipDefaultRouterTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipDefaultRouterTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipDefaultRouterTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipDefaultRouterTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_ipDefaultRouterTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipDefaultRouterTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipDefaultRouterTable:init_ipDefaultRouterTable",
+ "Registering ipDefaultRouterTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipDefaultRouterTable",
+ handler,
+ ipDefaultRouterTable_oid,
+ ipDefaultRouterTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table ipDefaultRouterTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipDefaultRouterTable_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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /* XXX - are these actually necessary? */
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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,
+ ipDefaultRouterTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ipDefaultRouterTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(ipDefaultRouterTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _ipDefaultRouterTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipDefaultRouterTable
+ */
+void
+_ipDefaultRouterTable_shutdown_interface(ipDefaultRouterTable_registration
+ * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipDefaultRouterTable_container_shutdown(&ipDefaultRouterTable_if_ctx);
+}
+
+void
+ipDefaultRouterTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipDefaultRouterTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipDefaultRouterTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipDefaultRouterTable_index_to_oid(netsnmp_index * oid_idx,
+ ipDefaultRouterTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipDefaultRouterAddressType;
+ /*
+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipDefaultRouterAddress;
+ /*
+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipDefaultRouterIfIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipDefaultRouterAddressType, 0x00,
+ sizeof(var_ipDefaultRouterAddressType));
+ var_ipDefaultRouterAddressType.type = ASN_INTEGER;
+ memset(&var_ipDefaultRouterAddress, 0x00,
+ sizeof(var_ipDefaultRouterAddress));
+ var_ipDefaultRouterAddress.type = ASN_OCTET_STR;
+ memset(&var_ipDefaultRouterIfIndex, 0x00,
+ sizeof(var_ipDefaultRouterIfIndex));
+ var_ipDefaultRouterIfIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipDefaultRouterAddressType.next_variable =
+ &var_ipDefaultRouterAddress;
+ var_ipDefaultRouterAddress.next_variable = &var_ipDefaultRouterIfIndex;
+ var_ipDefaultRouterIfIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_index_to_oid", "called\n"));
+
+ /*
+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_ipDefaultRouterAddressType,
+ (u_char *) & mib_idx->ipDefaultRouterAddressType,
+ sizeof(mib_idx->ipDefaultRouterAddressType));
+
+ /*
+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_ipDefaultRouterAddress,
+ (u_char *) & mib_idx->ipDefaultRouterAddress,
+ mib_idx->ipDefaultRouterAddress_len *
+ sizeof(mib_idx->ipDefaultRouterAddress[0]));
+
+ /*
+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_ipDefaultRouterIfIndex,
+ (u_char *) & mib_idx->ipDefaultRouterIfIndex,
+ sizeof(mib_idx->ipDefaultRouterIfIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipDefaultRouterAddressType);
+ 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_ipDefaultRouterAddressType);
+
+ return err;
+} /* ipDefaultRouterTable_index_to_oid */
+
+/**
+ * extract ipDefaultRouterTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipDefaultRouterTable_index_from_oid(netsnmp_index * oid_idx,
+ ipDefaultRouterTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipDefaultRouterAddressType;
+ /*
+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipDefaultRouterAddress;
+ /*
+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipDefaultRouterIfIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipDefaultRouterAddressType, 0x00,
+ sizeof(var_ipDefaultRouterAddressType));
+ var_ipDefaultRouterAddressType.type = ASN_INTEGER;
+ memset(&var_ipDefaultRouterAddress, 0x00,
+ sizeof(var_ipDefaultRouterAddress));
+ var_ipDefaultRouterAddress.type = ASN_OCTET_STR;
+ memset(&var_ipDefaultRouterIfIndex, 0x00,
+ sizeof(var_ipDefaultRouterIfIndex));
+ var_ipDefaultRouterIfIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipDefaultRouterAddressType.next_variable =
+ &var_ipDefaultRouterAddress;
+ var_ipDefaultRouterAddress.next_variable = &var_ipDefaultRouterIfIndex;
+ var_ipDefaultRouterIfIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipDefaultRouterAddressType);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipDefaultRouterAddressType =
+ *((u_long *) var_ipDefaultRouterAddressType.val.string);
+ /*
+ * NOTE: val_len is in bytes, ipDefaultRouterAddress_len might not be
+ */
+ if (var_ipDefaultRouterAddress.val_len >
+ sizeof(mib_idx->ipDefaultRouterAddress))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->ipDefaultRouterAddress,
+ var_ipDefaultRouterAddress.val.string,
+ var_ipDefaultRouterAddress.val_len);
+ mib_idx->ipDefaultRouterAddress_len =
+ var_ipDefaultRouterAddress.val_len /
+ sizeof(mib_idx->ipDefaultRouterAddress[0]);
+ }
+ mib_idx->ipDefaultRouterIfIndex =
+ *((long *) var_ipDefaultRouterIfIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipDefaultRouterAddressType);
+
+ return err;
+} /* ipDefaultRouterTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipDefaultRouterTable_rowreq_ctx
+ */
+ipDefaultRouterTable_rowreq_ctx *
+ipDefaultRouterTable_allocate_rowreq_ctx(ipDefaultRouterTable_data * data,
+ void *user_init_ctx)
+{
+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipDefaultRouterTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:ipDefaultRouterTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipDefaultRouterTable_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 =
+ ipDefaultRouterTable_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->ipDefaultRouterTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipDefaultRouterTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipDefaultRouterTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipDefaultRouterTable_rowreq_ctx
+ */
+void
+ipDefaultRouterTable_release_rowreq_ctx(ipDefaultRouterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:ipDefaultRouterTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipDefaultRouterTable_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))
+ ipDefaultRouterTable_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);
+} /* ipDefaultRouterTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipDefaultRouterTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipDefaultRouterTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipDefaultRouterTable_pre_request(ipDefaultRouterTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipDefaultRouterTable", "error %d from "
+ "ipDefaultRouterTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipDefaultRouterTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipDefaultRouterTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipDefaultRouterTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = ipDefaultRouterTable_post_request(ipDefaultRouterTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipDefaultRouterTable", "error %d from "
+ "ipDefaultRouterTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipDefaultRouterTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipDefaultRouterTable_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;
+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipDefaultRouterTable_interface_ctx *if_ctx =
+ * (ipDefaultRouterTable_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
+ ipDefaultRouterTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipDefaultRouterTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipDefaultRouterTable_get_column(ipDefaultRouterTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipDefaultRouterLifetime(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPDEFAULTROUTERLIFETIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipDefaultRouterLifetime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipDefaultRouterPreference(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPDEFAULTROUTERPREFERENCE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipDefaultRouterPreference_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (IPDEFAULTROUTERTABLE_MIN_COL <= column
+ && column <= IPDEFAULTROUTERTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipDefaultRouterTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _ipDefaultRouterTable_get_column */
+
+int
+_mfd_ipDefaultRouterTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipDefaultRouterTable_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:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_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 = _ipDefaultRouterTable_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_ipDefaultRouterTable_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:ipDefaultRouterTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for ipDefaultRouterTable_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 ipDefaultRouterTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in ipDefaultRouterTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipDefaultRouterTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipDefaultRouterTable_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
+_ipDefaultRouterTable_container_init(ipDefaultRouterTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_ipDefaultRouterTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipDefaultRouterTable_oid,
+ ipDefaultRouterTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for ipDefaultRouterTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipDefaultRouterTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipDefaultRouterTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipDefaultRouterTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ipDefaultRouterTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipDefaultRouterTable_container_shutdown(ipDefaultRouterTable_interface_ctx
+ * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_ipDefaultRouterTable_container_shutdown", "called\n"));
+
+ ipDefaultRouterTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipDefaultRouterTable_container_shutdown */
+
+
+ipDefaultRouterTable_rowreq_ctx *
+ipDefaultRouterTable_row_find_by_mib_index(ipDefaultRouterTable_mib_index *
+ mib_idx)
+{
+ ipDefaultRouterTable_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 = ipDefaultRouterTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipDefaultRouterTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h
new file mode 100644
index 0000000..a780491
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_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 IPDEFAULTROUTERTABLE_INTERFACE_H
+#define IPDEFAULTROUTERTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipDefaultRouterTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipDefaultRouterTable_initialize_interface
+ (ipDefaultRouterTable_registration * user_ctx, u_long flags);
+ void
+ _ipDefaultRouterTable_shutdown_interface
+ (ipDefaultRouterTable_registration * user_ctx);
+
+ ipDefaultRouterTable_registration
+ *ipDefaultRouterTable_registration_get(void);
+
+ ipDefaultRouterTable_registration
+ *ipDefaultRouterTable_registration_set
+ (ipDefaultRouterTable_registration * newreg);
+
+ netsnmp_container *ipDefaultRouterTable_container_get(void);
+ int ipDefaultRouterTable_container_size(void);
+
+ ipDefaultRouterTable_rowreq_ctx
+ *ipDefaultRouterTable_allocate_rowreq_ctx(ipDefaultRouterTable_data
+ *, void *);
+ void
+ ipDefaultRouterTable_release_rowreq_ctx
+ (ipDefaultRouterTable_rowreq_ctx * rowreq_ctx);
+
+ int ipDefaultRouterTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipDefaultRouterTable_mib_index
+ * mib_idx);
+ int ipDefaultRouterTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipDefaultRouterTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ ipDefaultRouterTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPDEFAULTROUTERTABLE_INTERFACE_H */
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h
new file mode 100644
index 0000000..6914e71
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_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 IPDEFAULTROUTERTABLE_OIDS_H
+#define IPDEFAULTROUTERTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipDefaultRouterTable
+ */
+#define IPDEFAULTROUTERTABLE_OID 1,3,6,1,2,1,4,37
+
+#define COLUMN_IPDEFAULTROUTERADDRESSTYPE 1
+
+#define COLUMN_IPDEFAULTROUTERADDRESS 2
+
+#define COLUMN_IPDEFAULTROUTERIFINDEX 3
+
+#define COLUMN_IPDEFAULTROUTERLIFETIME 4
+
+#define COLUMN_IPDEFAULTROUTERPREFERENCE 5
+
+
+#define IPDEFAULTROUTERTABLE_MIN_COL COLUMN_IPDEFAULTROUTERLIFETIME
+#define IPDEFAULTROUTERTABLE_MAX_COL COLUMN_IPDEFAULTROUTERPREFERENCE
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPDEFAULTROUTERTABLE_OIDS_H */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable.h b/agent/mibgroup/ip-mib/ipIfStatsTable.h
new file mode 100644
index 0000000..da1d85c
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable.h
@@ -0,0 +1,8 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/data_access/systemstats)
+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable)
+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable_interface)
+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable_data_access)
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c
new file mode 100644
index 0000000..43d807e
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c
@@ -0,0 +1,222 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for ipIfStatsTable
+ *
+ * \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 "ipIfStatsTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipIfStatsTable_interface.h"
+
+const oid ipIfStatsTable_oid[] = { IPIFSTATSTABLE_OID };
+const int ipIfStatsTable_oid_size = OID_LENGTH(ipIfStatsTable_oid);
+
+ipIfStatsTable_registration ipIfStatsTable_user_context;
+static ipIfStatsTable_registration *ipIfStatsTable_user_context_p;
+
+void initialize_table_ipIfStatsTable(void);
+void shutdown_table_ipIfStatsTable(void);
+
+
+/**
+ * Initializes the ipIfStatsTable module
+ */
+void
+init_ipIfStatsTable(void)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:init_ipIfStatsTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipIfStatsTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipIfStatsTable"))
+ initialize_table_ipIfStatsTable();
+
+ /*
+ * last changed should be 0 at startup
+ */
+ ipIfStatsTable_lastChange_set(0);
+} /* init_ipIfStatsTable */
+
+/**
+ * Shut-down the ipIfStatsTable module (agent is exiting)
+ */
+void
+shutdown_ipIfStatsTable(void)
+{
+ if (should_init("ipIfStatsTable"))
+ shutdown_table_ipIfStatsTable();
+
+}
+
+/**
+ * Initialize the table ipIfStatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipIfStatsTable(void)
+{
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:initialize_table_ipIfStatsTable",
+ "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipIfStatsTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipIfStatsTable 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.
+ */
+ ipIfStatsTable_user_context_p
+ = netsnmp_create_data_list("ipIfStatsTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipIfStatsTable_initialize_interface
+ (ipIfStatsTable_user_context_p, flags);
+} /* initialize_table_ipIfStatsTable */
+
+/**
+ * Shutdown the table ipIfStatsTable
+ */
+void
+shutdown_table_ipIfStatsTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipIfStatsTable_shutdown_interface(ipIfStatsTable_user_context_p);
+ netsnmp_free_all_list_data(ipIfStatsTable_user_context_p);
+ ipIfStatsTable_user_context_p = NULL;
+}
+
+/**
+ * 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
+ipIfStatsTable_rowreq_ctx_init(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_rowreq_ctx_init",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipIfStatsTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipIfStatsTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipIfStatsTable_rowreq_ctx_cleanup(ipIfStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_rowreq_ctx_cleanup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipIfStatsTable rowreq cleanup.
+ */
+ netsnmp_access_systemstats_entry_free(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+} /* ipIfStatsTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipIfStatsTable_pre_request(ipIfStatsTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipIfStatsTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipIfStatsTable_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
+ipIfStatsTable_post_request(ipIfStatsTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipIfStatsTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipIfStatsTable_post_request */
+
+
+/** @{ */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
new file mode 100644
index 0000000..bda956f
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
@@ -0,0 +1,200 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef IPIFSTATSTABLE_H
+#define IPIFSTATSTABLE_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/ipIfStatsTable/ipIfStatsTable_interface)
+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable_data_access)
+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable_data_get)
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for ipIfStatsTable
+ */
+#include "ipIfStatsTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "ipIfStatsTable_enums.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipIfStatsTable(void);
+ void shutdown_ipIfStatsTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipIfStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.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 ipIfStatsTable registration context.
+ */
+ typedef netsnmp_data_list ipIfStatsTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipIfStatsTable data context structure.
+ * This structure is used to represent the data for ipIfStatsTable.
+ */
+ typedef netsnmp_systemstats_entry ipIfStatsTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review ipIfStatsTable mib index.
+ * This structure is used to represent the index for ipIfStatsTable.
+ */
+ typedef struct ipIfStatsTable_mib_index_s {
+
+ /*
+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long ipIfStatsIPVersion;
+
+ /*
+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ long ipIfStatsIfIndex;
+
+
+ } ipIfStatsTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipIfStatsTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_ipIfStatsTable_IDX_LEN 2
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipIfStatsTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipIfStatsTable_rowreq_ctx pointer.
+ */
+ typedef struct ipIfStatsTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipIfStatsTable_IDX_LEN];
+
+ ipIfStatsTable_mib_index tbl_idx;
+
+ ipIfStatsTable_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 ipIfStatsTable rowreq context.
+ */
+ char known_missing;
+ uint32_t ipIfStatsDiscontinuityTime;
+ uint32_t ipIfStatsRefreshRate;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipIfStatsTable_data_list;
+
+ } ipIfStatsTable_rowreq_ctx;
+
+ typedef struct ipIfStatsTable_ref_rowreq_ctx_s {
+ ipIfStatsTable_rowreq_ctx *rowreq_ctx;
+ } ipIfStatsTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int ipIfStatsTable_pre_request(ipIfStatsTable_registration
+ * user_context);
+ int ipIfStatsTable_post_request(ipIfStatsTable_registration
+ * user_context, int rc);
+
+ int
+ ipIfStatsTable_rowreq_ctx_init(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ ipIfStatsTable_rowreq_ctx_cleanup(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ ipIfStatsTable_data *ipIfStatsTable_allocate_data(void);
+ void ipIfStatsTable_release_data(ipIfStatsTable_data *
+ data);
+
+
+ ipIfStatsTable_rowreq_ctx
+ *ipIfStatsTable_row_find_by_mib_index(ipIfStatsTable_mib_index *
+ mib_idx);
+
+ extern const oid ipIfStatsTable_oid[];
+ extern const int ipIfStatsTable_oid_size;
+
+
+#include "ipIfStatsTable_interface.h"
+#include "ipIfStatsTable_data_access.h"
+#include "ipIfStatsTable_data_get.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPIFSTATSTABLE_H */
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c
new file mode 100644
index 0000000..7919dea
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c
@@ -0,0 +1,410 @@
+/*
+ * 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 "ipIfStatsTable.h"
+
+
+#include "ipIfStatsTable_data_access.h"
+
+static int ipis_cache_refresh = IPIFSTATSTABLE_CACHE_TIMEOUT;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipIfStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.3, length: 9
+ */
+
+/**
+ * initialization for ipIfStatsTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipIfStatsTable_reg
+ * Pointer to ipIfStatsTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipIfStatsTable_init_data(ipIfStatsTable_registration * ipIfStatsTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipIfStatsTable data.
+ */
+ netsnmp_access_systemstats_init();
+
+ return MFD_SUCCESS;
+} /* ipIfStatsTable_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
+ipIfStatsTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipIfStatsTable_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("ipIfStatsTable:table_container");
+ if (NULL != *container_ptr_ptr) {
+ (*container_ptr_ptr)->container_name = strdup("ipIfStatsTable");
+ ipIfStatsTable_container_load(*container_ptr_ptr);
+ }
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to ipIfStatsTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipIfStatsTable 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 = IPIFSTATSTABLE_CACHE_TIMEOUT; /* seconds */
+
+ cache->flags |=
+ (NETSNMP_CACHE_DONT_AUTO_RELEASE | NETSNMP_CACHE_DONT_FREE_EXPIRED
+ | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD |
+ NETSNMP_CACHE_AUTO_RELOAD);
+} /* ipIfStatsTable_container_init */
+
+/**
+ * check entry for update
+ */
+static void
+_check_for_updates(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_container *stats)
+{
+ netsnmp_systemstats_entry *ifstats_entry;
+
+ /*
+ * check for matching entry. works because indexes are the same.
+ */
+ ifstats_entry = (netsnmp_systemstats_entry*)CONTAINER_FIND(stats, rowreq_ctx->data);
+ if (NULL == ifstats_entry) {
+ DEBUGMSGTL(("ipIfStatsTable: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(("ipIfStatsTable:access",
+ "updating existing entry\n"));
+
+ /*
+ * Check for changes & update
+ */
+ netsnmp_access_systemstats_entry_update(rowreq_ctx->data,
+ ifstats_entry);
+
+ /*
+ * set discontinuity if previously missing.
+ */
+ if (1 == rowreq_ctx->known_missing) {
+ rowreq_ctx->known_missing = 0;
+ rowreq_ctx->ipIfStatsDiscontinuityTime =
+ netsnmp_get_agent_uptime();
+ ipIfStatsTable_lastChange_set(netsnmp_get_agent_uptime());
+ }
+
+ /*
+ * remove entry from container
+ */
+ CONTAINER_REMOVE(stats, ifstats_entry);
+ netsnmp_access_systemstats_entry_free(ifstats_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_add_new(netsnmp_systemstats_entry *ifstats_entry,
+ netsnmp_container *container)
+{
+ ipIfStatsTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGMSGTL(("ipIfStatsTable:access", "creating new entry\n"));
+
+ netsnmp_assert(NULL != ifstats_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx =
+ ipIfStatsTable_allocate_rowreq_ctx(ifstats_entry, NULL);
+ if ((NULL != rowreq_ctx)
+ && (MFD_SUCCESS ==
+ ipIfStatsTable_indexes_set(rowreq_ctx,
+ ifstats_entry->index[0],
+ ifstats_entry->index[1]))) {
+ rowreq_ctx->ipIfStatsRefreshRate = ipis_cache_refresh * 1000; /* milli-seconds */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ipIfStatsTable_lastChange_set(netsnmp_get_agent_uptime());
+ } else {
+ if (NULL != rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "ipIfStatsTable cache.\n");
+ ipIfStatsTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "ipIfStatsTable cache.\n");
+ netsnmp_access_systemstats_entry_free(ifstats_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 ipIfStatsTable_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
+ipIfStatsTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_container_shutdown",
+ "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipIfStatsTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipIfStatsTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipIfStatsTable 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
+ * ipIfStatsTable_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
+ipIfStatsTable_container_load(netsnmp_container * container)
+{
+ netsnmp_container *stats;
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_container_load",
+ "called\n"));
+
+ netsnmp_assert(NULL != container);
+
+ stats = netsnmp_access_systemstats_container_load(NULL, NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE);
+ if (NULL == stats)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ipIfStatsTable container.
+ * loop over your ipIfStatsTable 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:ipIfStatsTable:ipIfStatsTable_container_load",
+ "%lu records\n", (unsigned long)CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* ipIfStatsTable_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
+ipIfStatsTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free ipIfStatsTable container data.
+ */
+} /* ipIfStatsTable_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
+ipIfStatsTable_row_prep(ipIfStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_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;
+} /* ipIfStatsTable_row_prep */
+
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h
new file mode 100644
index 0000000..5ef7682
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h
@@ -0,0 +1,70 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef IPIFSTATSTABLE_DATA_ACCESS_H
+#define IPIFSTATSTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipIfStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.3, length: 9
+ */
+
+
+ int ipIfStatsTable_init_data(ipIfStatsTable_registration *
+ ipIfStatsTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ipIfStatsTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define IPIFSTATSTABLE_CACHE_TIMEOUT 60
+
+ void ipIfStatsTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void ipIfStatsTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int ipIfStatsTable_container_load(netsnmp_container *
+ container);
+ void ipIfStatsTable_container_free(netsnmp_container *
+ container);
+
+ int ipIfStatsTable_cache_load(netsnmp_container *
+ container);
+ void ipIfStatsTable_cache_free(netsnmp_container *
+ container);
+
+ int ipIfStatsTable_row_prep(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPIFSTATSTABLE_DATA_ACCESS_H */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c
new file mode 100644
index 0000000..db673dc
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c
@@ -0,0 +1,3015 @@
+/*
+ * 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 "ipIfStatsTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement ipIfStatsTable get routines.
+ * TODO:240:M: Implement ipIfStatsTable 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 ipIfStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.3, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipIfStatsTable data context functions.
+ */
+/*
+ * ipIfStatsTable_allocate_data
+ *
+ * Purpose: create new ipIfStatsTable_data.
+ */
+ipIfStatsTable_data *
+ipIfStatsTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the ipIfStatsTable data context.
+ */
+ ipIfStatsTable_data *rtn = SNMP_MALLOC_TYPEDEF(ipIfStatsTable_data);
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_allocate_data",
+ "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipIfStatsTable_data.\n");
+ }
+
+ return rtn;
+} /* ipIfStatsTable_allocate_data */
+
+/*
+ * ipIfStatsTable_release_data
+ *
+ * Purpose: release ipIfStatsTable data.
+ */
+void
+ipIfStatsTable_release_data(ipIfStatsTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_release_data",
+ "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the ipIfStatsTable data context.
+ */
+ free(data);
+} /* ipIfStatsTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipIfStatsIPVersion_val
+ * @param ipIfStatsIfIndex_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
+ipIfStatsTable_indexes_set_tbl_idx(ipIfStatsTable_mib_index * tbl_idx,
+ u_long ipIfStatsIPVersion_val,
+ long ipIfStatsIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_ifstats_entry */
+ tbl_idx->ipIfStatsIPVersion = ipIfStatsIPVersion_val;
+
+ /*
+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ /** WARNING: this code might not work for netsnmp_ifstats_entry */
+ tbl_idx->ipIfStatsIfIndex = ipIfStatsIfIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* ipIfStatsTable_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
+ipIfStatsTable_indexes_set(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long ipIfStatsIPVersion_val,
+ long ipIfStatsIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipIfStatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipIfStatsIPVersion_val,
+ ipIfStatsIfIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipIfStatsTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipIfStatsTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInReceives
+ * ipIfStatsInReceives is subid 3 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInReceives data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInReceives_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
+ipIfStatsInReceives_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInReceives_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInReceives_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInReceives_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInReceives data.
+ * copy (* ipIfStatsInReceives_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES])
+ return MFD_SKIP;
+
+ (*ipIfStatsInReceives_val_ptr) =
+ rowreq_ctx->data->stats.HCInReceives.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInReceives_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInReceives
+ * ipIfStatsHCInReceives is subid 4 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.4
+ * Description:
+The total number of input IP datagrams received, including
+ those received in error. This object counts the same
+ datagrams as ipIfStatsInReceives, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCInReceives data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCInReceives_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
+ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCInReceives_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInReceives_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCInReceives data.
+ * get (* ipIfStatsHCInReceives_val_ptr ).low and (* ipIfStatsHCInReceives_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCInReceives_val_ptr).low =
+ rowreq_ctx->data->stats.HCInReceives.low;
+ (*ipIfStatsHCInReceives_val_ptr).high =
+ rowreq_ctx->data->stats.HCInReceives.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCInReceives_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInOctets
+ * ipIfStatsInOctets is subid 5 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.5
+ * Description:
+The total number of octets received in input IP datagrams,
+ including those received in error. Octets from datagrams
+ counted in ipIfStatsInReceives 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInOctets_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
+ipIfStatsInOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInOctets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInOctets data.
+ * copy (* ipIfStatsInOctets_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCInOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInOctets
+ * ipIfStatsHCInOctets is subid 6 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsInOctets, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCInOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCInOctets_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
+ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCInOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCInOctets data.
+ * get (* ipIfStatsHCInOctets_val_ptr ).low and (* ipIfStatsHCInOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCInOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCInOctets.low;
+ (*ipIfStatsHCInOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCInOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCInOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInHdrErrors
+ * ipIfStatsInHdrErrors is subid 7 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInHdrErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInHdrErrors_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
+ipIfStatsInHdrErrors_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInHdrErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInHdrErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInHdrErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInHdrErrors data.
+ * copy (* ipIfStatsInHdrErrors_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInHdrErrors_val_ptr) =
+ rowreq_ctx->data->stats.InHdrErrors;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInHdrErrors_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInNoRoutes
+ * ipIfStatsInNoRoutes is subid 8 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInNoRoutes data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInNoRoutes_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
+ipIfStatsInNoRoutes_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInNoRoutes_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInNoRoutes_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInNoRoutes_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInNoRoutes data.
+ * copy (* ipIfStatsInNoRoutes_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES])
+ return MFD_SKIP;
+
+ (*ipIfStatsInNoRoutes_val_ptr) =
+ rowreq_ctx->data->stats.HCInNoRoutes.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInNoRoutes_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInAddrErrors
+ * ipIfStatsInAddrErrors is subid 9 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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). For entities that
+ 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInAddrErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInAddrErrors_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
+ipIfStatsInAddrErrors_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInAddrErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInAddrErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInAddrErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInAddrErrors data.
+ * copy (* ipIfStatsInAddrErrors_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INADDRERRORS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInAddrErrors_val_ptr) =
+ rowreq_ctx->data->stats.InAddrErrors;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInAddrErrors_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInUnknownProtos
+ * ipIfStatsInUnknownProtos is subid 10 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+
+
+
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInUnknownProtos data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInUnknownProtos_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
+ipIfStatsInUnknownProtos_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInUnknownProtos_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInUnknownProtos_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInUnknownProtos_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInUnknownProtos data.
+ * copy (* ipIfStatsInUnknownProtos_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInUnknownProtos_val_ptr) =
+ rowreq_ctx->data->stats.InUnknownProtos;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInUnknownProtos_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInTruncatedPkts
+ * ipIfStatsInTruncatedPkts is subid 11 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInTruncatedPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInTruncatedPkts_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
+ipIfStatsInTruncatedPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInTruncatedPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInTruncatedPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInTruncatedPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInTruncatedPkts data.
+ * copy (* ipIfStatsInTruncatedPkts_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInTruncatedPkts_val_ptr) =
+ rowreq_ctx->data->stats.InTruncatedPkts;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInTruncatedPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInForwDatagrams
+ * ipIfStatsInForwDatagrams is subid 12 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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 that do not act as IP routers,
+ this counter will include only those datagrams that 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInForwDatagrams_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
+ipIfStatsInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInForwDatagrams_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInForwDatagrams_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInForwDatagrams data.
+ * copy (* ipIfStatsInForwDatagrams_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInForwDatagrams_val_ptr) =
+ rowreq_ctx->data->stats.HCInForwDatagrams.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInForwDatagrams
+ * ipIfStatsHCInForwDatagrams is subid 13 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+
+
+
+ ipIfStatsInForwDatagrams, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCInForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCInForwDatagrams_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
+ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCInForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInForwDatagrams_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCInForwDatagrams data.
+ * get (* ipIfStatsHCInForwDatagrams_val_ptr ).low and (* ipIfStatsHCInForwDatagrams_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCInForwDatagrams_val_ptr).low =
+ rowreq_ctx->data->stats.HCInForwDatagrams.low;
+ (*ipIfStatsHCInForwDatagrams_val_ptr).high =
+ rowreq_ctx->data->stats.HCInForwDatagrams.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCInForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsReasmReqds
+ * ipIfStatsReasmReqds is subid 14 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.14
+ * Description:
+The number of IP fragments received that 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsReasmReqds data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsReasmReqds_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
+ipIfStatsReasmReqds_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsReasmReqds_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsReasmReqds_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsReasmReqds_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsReasmReqds data.
+ * copy (* ipIfStatsReasmReqds_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMREQDS])
+ return MFD_SKIP;
+
+ (*ipIfStatsReasmReqds_val_ptr) =
+ rowreq_ctx->data->stats.ReasmReqds;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsReasmReqds_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsReasmOKs
+ * ipIfStatsReasmOKs is subid 15 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsReasmOKs data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsReasmOKs_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
+ipIfStatsReasmOKs_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsReasmOKs_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsReasmOKs_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsReasmOKs_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsReasmOKs data.
+ * copy (* ipIfStatsReasmOKs_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMOKS])
+ return MFD_SKIP;
+
+ (*ipIfStatsReasmOKs_val_ptr) =
+ rowreq_ctx->data->stats.ReasmOKs;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsReasmOKs_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsReasmFails
+ * ipIfStatsReasmFails is subid 16 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsReasmFails data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsReasmFails_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
+ipIfStatsReasmFails_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsReasmFails_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsReasmFails_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsReasmFails_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsReasmFails data.
+ * copy (* ipIfStatsReasmFails_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMFAILS])
+ return MFD_SKIP;
+
+ (*ipIfStatsReasmFails_val_ptr) =
+ rowreq_ctx->data->stats.ReasmFails;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsReasmFails_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInDiscards
+ * ipIfStatsInDiscards is subid 17 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.17
+ * Description:
+The number of input IP datagrams for which no problems were
+ encountered to prevent their continued processing, but
+ 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInDiscards data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInDiscards_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
+ipIfStatsInDiscards_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInDiscards_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInDiscards_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInDiscards_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInDiscards data.
+ * copy (* ipIfStatsInDiscards_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INDISCARDS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInDiscards_val_ptr) =
+ rowreq_ctx->data->stats.InDiscards;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInDiscards_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInDelivers
+ * ipIfStatsInDelivers is subid 18 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInDelivers data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInDelivers_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
+ipIfStatsInDelivers_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInDelivers_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInDelivers_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInDelivers_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInDelivers data.
+ * copy (* ipIfStatsInDelivers_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInDelivers_val_ptr) =
+ rowreq_ctx->data->stats.HCInDelivers.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInDelivers_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInDelivers
+ * ipIfStatsHCInDelivers is subid 19 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.19
+ * Description:
+The total number of datagrams successfully delivered to IP
+ user-protocols (including ICMP). This object counts the
+ same packets as ipIfStatsInDelivers, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCInDelivers data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCInDelivers_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
+ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCInDelivers_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInDelivers_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCInDelivers data.
+ * get (* ipIfStatsHCInDelivers_val_ptr ).low and (* ipIfStatsHCInDelivers_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCInDelivers_val_ptr).low =
+ rowreq_ctx->data->stats.HCInDelivers.low;
+ (*ipIfStatsHCInDelivers_val_ptr).high =
+ rowreq_ctx->data->stats.HCInDelivers.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCInDelivers_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutRequests
+ * ipIfStatsOutRequests is subid 20 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.20
+ * Description:
+The total number of IP datagrams that local IP user-
+ protocols (including ICMP) supplied to IP in requests for
+ transmission. Note that this counter does not include any
+ datagrams counted in ipIfStatsOutForwDatagrams.
+
+ 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutRequests data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutRequests_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
+ipIfStatsOutRequests_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutRequests_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutRequests_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutRequests_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutRequests data.
+ * copy (* ipIfStatsOutRequests_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutRequests_val_ptr) =
+ rowreq_ctx->data->stats.HCOutRequests.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutRequests_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutRequests
+ * ipIfStatsHCOutRequests is subid 21 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.21
+ * Description:
+The total number of IP datagrams that local IP user-
+ protocols (including ICMP) supplied to IP in requests for
+ transmission. This object counts the same packets as
+
+
+
+ ipIfStatsOutRequests, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCOutRequests data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCOutRequests_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
+ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCOutRequests_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutRequests_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCOutRequests data.
+ * get (* ipIfStatsHCOutRequests_val_ptr ).low and (* ipIfStatsHCOutRequests_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCOutRequests_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutRequests.low;
+ (*ipIfStatsHCOutRequests_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutRequests.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCOutRequests_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutForwDatagrams
+ * ipIfStatsOutForwDatagrams is subid 23 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ that do not act as IP routers, this counter will include
+ only those datagrams that 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutForwDatagrams_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
+ipIfStatsOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutForwDatagrams_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutForwDatagrams_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutForwDatagrams data.
+ * copy (* ipIfStatsOutForwDatagrams_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutForwDatagrams_val_ptr) =
+ rowreq_ctx->data->stats.HCOutForwDatagrams.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutForwDatagrams
+ * ipIfStatsHCOutForwDatagrams is subid 24 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsOutForwDatagrams, 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
+
+
+
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCOutForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCOutForwDatagrams_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
+ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCOutForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutForwDatagrams_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCOutForwDatagrams data.
+ * get (* ipIfStatsHCOutForwDatagrams_val_ptr ).low and (* ipIfStatsHCOutForwDatagrams_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCOutForwDatagrams_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutForwDatagrams.low;
+ (*ipIfStatsHCOutForwDatagrams_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutForwDatagrams.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCOutForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutDiscards
+ * ipIfStatsOutDiscards is subid 25 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.25
+ * Description:
+The number of output IP datagrams for which no problem was
+ encountered to prevent their transmission to their
+ destination, but were discarded (e.g., for lack of
+ buffer space). Note that this counter would include
+ datagrams counted in ipIfStatsOutForwDatagrams 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutDiscards data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutDiscards_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
+ipIfStatsOutDiscards_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutDiscards_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutDiscards_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutDiscards_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutDiscards data.
+ * copy (* ipIfStatsOutDiscards_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutDiscards_val_ptr) =
+ rowreq_ctx->data->stats.HCOutDiscards.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutDiscards_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutFragReqds
+ * ipIfStatsOutFragReqds is subid 26 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutFragReqds data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutFragReqds_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
+ipIfStatsOutFragReqds_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutFragReqds_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutFragReqds_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutFragReqds_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutFragReqds data.
+ * copy (* ipIfStatsOutFragReqds_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutFragReqds_val_ptr) =
+ rowreq_ctx->data->stats.HCOutFragReqds.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutFragReqds_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutFragOKs
+ * ipIfStatsOutFragOKs is subid 27 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutFragOKs data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutFragOKs_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
+ipIfStatsOutFragOKs_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutFragOKs_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutFragOKs_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutFragOKs_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutFragOKs data.
+ * copy (* ipIfStatsOutFragOKs_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutFragOKs_val_ptr) =
+ rowreq_ctx->data->stats.HCOutFragOKs.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutFragOKs_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutFragFails
+ * ipIfStatsOutFragFails is subid 28 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutFragFails data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutFragFails_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
+ipIfStatsOutFragFails_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutFragFails_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutFragFails_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutFragFails_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutFragFails data.
+ * copy (* ipIfStatsOutFragFails_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutFragFails_val_ptr) =
+ rowreq_ctx->data->stats.HCOutFragFails.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutFragFails_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutFragCreates
+ * ipIfStatsOutFragCreates is subid 29 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutFragCreates data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutFragCreates_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
+ipIfStatsOutFragCreates_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutFragCreates_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutFragCreates_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutFragCreates_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutFragCreates data.
+ * copy (* ipIfStatsOutFragCreates_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutFragCreates_val_ptr) =
+ rowreq_ctx->data->stats.HCOutFragCreates.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutFragCreates_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutTransmits
+ * ipIfStatsOutTransmits is subid 30 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.30
+ * Description:
+The total number of IP datagrams that this entity supplied
+ to the lower layers for transmission. This includes
+ datagrams generated locally 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutTransmits data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutTransmits_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
+ipIfStatsOutTransmits_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutTransmits_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutTransmits_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutTransmits_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutTransmits data.
+ * copy (* ipIfStatsOutTransmits_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutTransmits_val_ptr) =
+ rowreq_ctx->data->stats.HCOutTransmits.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutTransmits_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutTransmits
+ * ipIfStatsHCOutTransmits is subid 31 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsOutTransmits, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCOutTransmits data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCOutTransmits_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
+ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCOutTransmits_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutTransmits_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCOutTransmits data.
+ * get (* ipIfStatsHCOutTransmits_val_ptr ).low and (* ipIfStatsHCOutTransmits_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCOutTransmits_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutTransmits.low;
+ (*ipIfStatsHCOutTransmits_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutTransmits.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCOutTransmits_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutOctets
+ * ipIfStatsOutOctets is subid 32 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.32
+ * Description:
+The total number of octets in IP datagrams delivered to the
+ lower layers for transmission. Octets from datagrams
+ counted in ipIfStatsOutTransmits 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutOctets_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
+ipIfStatsOutOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutOctets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutOctets data.
+ * copy (* ipIfStatsOutOctets_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCOutOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutOctets
+ * ipIfStatsHCOutOctets is subid 33 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsOutOctets, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCOutOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCOutOctets_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
+ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCOutOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCOutOctets data.
+ * get (* ipIfStatsHCOutOctets_val_ptr ).low and (* ipIfStatsHCOutOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCOutOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutOctets.low;
+ (*ipIfStatsHCOutOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCOutOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInMcastPkts
+ * ipIfStatsInMcastPkts is subid 34 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInMcastPkts_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
+ipIfStatsInMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInMcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInMcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInMcastPkts data.
+ * copy (* ipIfStatsInMcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInMcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCInMcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInMcastPkts
+ * ipIfStatsHCInMcastPkts is subid 35 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.35
+ * Description:
+The number of IP multicast datagrams received. This object
+ counts the same datagrams as ipIfStatsInMcastPkts, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCInMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCInMcastPkts_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
+ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCInMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInMcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCInMcastPkts data.
+ * get (* ipIfStatsHCInMcastPkts_val_ptr ).low and (* ipIfStatsHCInMcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCInMcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCInMcastPkts.low;
+ (*ipIfStatsHCInMcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCInMcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCInMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInMcastOctets
+ * ipIfStatsInMcastOctets is subid 36 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.36
+ * Description:
+The total number of octets received in IP multicast
+
+
+
+ datagrams. Octets from datagrams counted in
+ ipIfStatsInMcastPkts 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInMcastOctets_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
+ipIfStatsInMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInMcastOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInMcastOctets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInMcastOctets data.
+ * copy (* ipIfStatsInMcastOctets_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInMcastOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCInMcastOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInMcastOctets
+ * ipIfStatsHCInMcastOctets is subid 37 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.37
+ * Description:
+The total number of octets received in IP multicast
+ datagrams. This object counts the same octets as
+ ipIfStatsInMcastOctets, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCInMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCInMcastOctets_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
+ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCInMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInMcastOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCInMcastOctets data.
+ * get (* ipIfStatsHCInMcastOctets_val_ptr ).low and (* ipIfStatsHCInMcastOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCInMcastOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCInMcastOctets.low;
+ (*ipIfStatsHCInMcastOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCInMcastOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCInMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutMcastPkts
+ * ipIfStatsOutMcastPkts is subid 38 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutMcastPkts_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
+ipIfStatsOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutMcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutMcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutMcastPkts data.
+ * copy (* ipIfStatsOutMcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutMcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCOutMcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutMcastPkts
+ * ipIfStatsHCOutMcastPkts is subid 39 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.39
+ * Description:
+The number of IP multicast datagrams transmitted. This
+ object counts the same datagrams as ipIfStatsOutMcastPkts,
+ 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCOutMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCOutMcastPkts_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
+ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCOutMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutMcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCOutMcastPkts data.
+ * get (* ipIfStatsHCOutMcastPkts_val_ptr ).low and (* ipIfStatsHCOutMcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCOutMcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutMcastPkts.low;
+ (*ipIfStatsHCOutMcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutMcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCOutMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutMcastOctets
+ * ipIfStatsOutMcastOctets is subid 40 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.40
+ * Description:
+The total number of octets transmitted in IP multicast
+ datagrams. Octets from datagrams counted in
+ ipIfStatsOutMcastPkts 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutMcastOctets_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
+ipIfStatsOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutMcastOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutMcastOctets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutMcastOctets data.
+ * copy (* ipIfStatsOutMcastOctets_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutMcastOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCOutMcastOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutMcastOctets
+ * ipIfStatsHCOutMcastOctets is subid 41 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.41
+ * Description:
+The total number of octets transmitted in IP multicast
+ datagrams. This object counts the same octets as
+ ipIfStatsOutMcastOctets, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCOutMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCOutMcastOctets_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
+ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCOutMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutMcastOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCOutMcastOctets data.
+ * get (* ipIfStatsHCOutMcastOctets_val_ptr ).low and (* ipIfStatsHCOutMcastOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCOutMcastOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutMcastOctets.low;
+ (*ipIfStatsHCOutMcastOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutMcastOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCOutMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsInBcastPkts
+ * ipIfStatsInBcastPkts is subid 42 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsInBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsInBcastPkts_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
+ipIfStatsInBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsInBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsInBcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInBcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInBcastPkts data.
+ * copy (* ipIfStatsInBcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsInBcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCInBcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsInBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInBcastPkts
+ * ipIfStatsHCInBcastPkts is subid 43 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.43
+ * Description:
+The number of IP broadcast datagrams received. This object
+ counts the same datagrams as ipIfStatsInBcastPkts, 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCInBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCInBcastPkts_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
+ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCInBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInBcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCInBcastPkts data.
+ * get (* ipIfStatsHCInBcastPkts_val_ptr ).low and (* ipIfStatsHCInBcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCInBcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCInBcastPkts.low;
+ (*ipIfStatsHCInBcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCInBcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCInBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutBcastPkts
+ * ipIfStatsOutBcastPkts is subid 44 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsOutBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsOutBcastPkts_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
+ipIfStatsOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsOutBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsOutBcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutBcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutBcastPkts data.
+ * copy (* ipIfStatsOutBcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsOutBcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCOutBcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsOutBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutBcastPkts
+ * ipIfStatsHCOutBcastPkts is subid 45 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.1.45
+ * Description:
+The number of IP broadcast datagrams transmitted. This
+ object counts the same datagrams as ipIfStatsOutBcastPkts,
+ 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
+ ipIfStatsDiscontinuityTime.
+ *
+ * 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 ipIfStatsHCOutBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsHCOutBcastPkts_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
+ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipIfStatsHCOutBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutBcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipIfStatsHCOutBcastPkts data.
+ * get (* ipIfStatsHCOutBcastPkts_val_ptr ).low and (* ipIfStatsHCOutBcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS])
+ return MFD_SKIP;
+
+ (*ipIfStatsHCOutBcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutBcastPkts.low;
+ (*ipIfStatsHCOutBcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutBcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsHCOutBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsDiscontinuityTime
+ * ipIfStatsDiscontinuityTime is subid 46 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsDiscontinuityTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsDiscontinuityTime_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
+ipIfStatsDiscontinuityTime_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsDiscontinuityTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsDiscontinuityTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsDiscontinuityTime_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsDiscontinuityTime data.
+ * copy (* ipIfStatsDiscontinuityTime_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_DISCONTINUITYTIME])
+ return MFD_SKIP;
+
+ (*ipIfStatsDiscontinuityTime_val_ptr) =
+ rowreq_ctx->ipIfStatsDiscontinuityTime;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsDiscontinuityTime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipIfStatsEntry.ipIfStatsRefreshRate
+ * ipIfStatsRefreshRate is subid 47 of ipIfStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsRefreshRate data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipIfStatsRefreshRate_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
+ipIfStatsRefreshRate_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipIfStatsRefreshRate_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsRefreshRate_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsRefreshRate_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipIfStatsRefreshRate data.
+ * copy (* ipIfStatsRefreshRate_val_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REFRESHRATE])
+ return MFD_SKIP;
+
+ (*ipIfStatsRefreshRate_val_ptr) =
+ rowreq_ctx->ipIfStatsRefreshRate;
+
+ return MFD_SUCCESS;
+} /* ipIfStatsRefreshRate_get */
+
+
+
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h
new file mode 100644
index 0000000..0cc7e47
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h
@@ -0,0 +1,246 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file ipIfStatsTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef IPIFSTATSTABLE_DATA_GET_H
+#define IPIFSTATSTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipIfStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.3, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int ipIfStatsInReceives_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInReceives_val_ptr);
+ int ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCInReceives_val_ptr);
+ int ipIfStatsInOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInOctets_val_ptr);
+ int ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCInOctets_val_ptr);
+ int ipIfStatsInHdrErrors_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInHdrErrors_val_ptr);
+ int ipIfStatsInNoRoutes_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInNoRoutes_val_ptr);
+ int ipIfStatsInAddrErrors_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInAddrErrors_val_ptr);
+ int ipIfStatsInUnknownProtos_get(ipIfStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipIfStatsInUnknownProtos_val_ptr);
+ int ipIfStatsInTruncatedPkts_get(ipIfStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipIfStatsInTruncatedPkts_val_ptr);
+ int ipIfStatsInForwDatagrams_get(ipIfStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipIfStatsInForwDatagrams_val_ptr);
+ int
+ ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCInForwDatagrams_val_ptr);
+ int ipIfStatsReasmReqds_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsReasmReqds_val_ptr);
+ int ipIfStatsReasmOKs_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsReasmOKs_val_ptr);
+ int ipIfStatsReasmFails_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsReasmFails_val_ptr);
+ int ipIfStatsInDiscards_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInDiscards_val_ptr);
+ int ipIfStatsInDelivers_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInDelivers_val_ptr);
+ int ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCInDelivers_val_ptr);
+ int ipIfStatsOutRequests_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutRequests_val_ptr);
+ int ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCOutRequests_val_ptr);
+ int ipIfStatsOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipIfStatsOutForwDatagrams_val_ptr);
+ int
+ ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCOutForwDatagrams_val_ptr);
+ int ipIfStatsOutDiscards_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutDiscards_val_ptr);
+ int ipIfStatsOutFragReqds_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutFragReqds_val_ptr);
+ int ipIfStatsOutFragOKs_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutFragOKs_val_ptr);
+ int ipIfStatsOutFragFails_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutFragFails_val_ptr);
+ int ipIfStatsOutFragCreates_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutFragCreates_val_ptr);
+ int ipIfStatsOutTransmits_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutTransmits_val_ptr);
+ int ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCOutTransmits_val_ptr);
+ int ipIfStatsOutOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutOctets_val_ptr);
+ int ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCOutOctets_val_ptr);
+ int ipIfStatsInMcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInMcastPkts_val_ptr);
+ int ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCInMcastPkts_val_ptr);
+ int ipIfStatsInMcastOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInMcastOctets_val_ptr);
+ int ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ U64 *
+ ipIfStatsHCInMcastOctets_val_ptr);
+ int ipIfStatsOutMcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutMcastPkts_val_ptr);
+ int ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCOutMcastPkts_val_ptr);
+ int ipIfStatsOutMcastOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutMcastOctets_val_ptr);
+ int ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ U64 *
+ ipIfStatsHCOutMcastOctets_val_ptr);
+ int ipIfStatsInBcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsInBcastPkts_val_ptr);
+ int ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCInBcastPkts_val_ptr);
+ int ipIfStatsOutBcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsOutBcastPkts_val_ptr);
+ int ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipIfStatsHCOutBcastPkts_val_ptr);
+ int
+ ipIfStatsDiscontinuityTime_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsDiscontinuityTime_val_ptr);
+ int ipIfStatsRefreshRate_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipIfStatsRefreshRate_val_ptr);
+
+
+ int
+ ipIfStatsTable_indexes_set_tbl_idx(ipIfStatsTable_mib_index *
+ tbl_idx,
+ u_long ipIfStatsIPVersion_val,
+ long ipIfStatsIfIndex_val);
+ int ipIfStatsTable_indexes_set(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipIfStatsIPVersion_val,
+ long ipIfStatsIfIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPIFSTATSTABLE_DATA_GET_H */
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h
new file mode 100644
index 0000000..c3657d5
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_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 IPIFSTATSTABLE_ENUMS_H
+#define IPIFSTATSTABLE_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 ipIfStatsTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipIfStatsIPVersion (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 /* IPIFSTATSTABLE_ENUMS_H */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c
new file mode 100644
index 0000000..559d1c1
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c
@@ -0,0 +1,1420 @@
+/*
+ * 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipIfStatsTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipIfStatsTable_interface.h"
+
+#include <ctype.h>
+
+netsnmp_feature_child_of(ipIfStatsTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+
+netsnmp_feature_child_of(ipIfStatsTable_container_size, ipIfStatsTable_external_access)
+netsnmp_feature_child_of(ipIfStatsTable_registration_set, ipIfStatsTable_external_access)
+netsnmp_feature_child_of(ipIfStatsTable_registration_get, ipIfStatsTable_external_access)
+netsnmp_feature_child_of(ipIfStatsTable_container_get, ipIfStatsTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipIfStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.3, length: 9
+ */
+typedef struct ipIfStatsTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ipIfStatsTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_long last_changed;
+
+} ipIfStatsTable_interface_ctx;
+
+static ipIfStatsTable_interface_ctx ipIfStatsTable_if_ctx;
+
+static void _ipIfStatsTable_container_init(ipIfStatsTable_interface_ctx
+ * if_ctx);
+static void
+_ipIfStatsTable_container_shutdown(ipIfStatsTable_interface_ctx * if_ctx);
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_CONTAINER_GET
+netsnmp_container *
+ipIfStatsTable_container_get(void)
+{
+ return ipIfStatsTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_REGISTRATION_GET
+ipIfStatsTable_registration *
+ipIfStatsTable_registration_get(void)
+{
+ return ipIfStatsTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_REGISTRATION_SET
+ipIfStatsTable_registration *
+ipIfStatsTable_registration_set(ipIfStatsTable_registration * newreg)
+{
+ ipIfStatsTable_registration *old = ipIfStatsTable_if_ctx.user_ctx;
+ ipIfStatsTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_CONTAINER_SIZE
+int
+ipIfStatsTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipIfStatsTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_CONTAINER_SIZE */
+
+/*
+ * ipIfStatsTableLastChanged, 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
+ipIfStatsTable_lastChange_set(u_long table_changed)
+{
+ DEBUGMSGTL(("ipIfStatsTable:lastChanged_set",
+ "called. was %ld, now %ld\n",
+ ipIfStatsTable_if_ctx.last_changed, table_changed));
+ ipIfStatsTable_if_ctx.last_changed = table_changed;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipIfStatsTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipIfStatsTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipIfStatsTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipIfStatsTable_get_values;
+/**
+ * @internal
+ * Initialize the table ipIfStatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipIfStatsTable_initialize_interface(ipIfStatsTable_registration * reg_ptr,
+ u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipIfStatsTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipIfStatsTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipIfStatsTable:_ipIfStatsTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipIfStatsTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipIfStatsIPVersion */
+ ASN_INTEGER,
+ /** index: ipIfStatsIfIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrieval.
+ */
+ tbl_info->min_column = IPIFSTATSTABLE_MIN_COL;
+ tbl_info->max_column = IPIFSTATSTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipIfStatsTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipIfStatsTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipIfStatsTable_container_init(&ipIfStatsTable_if_ctx);
+ if (NULL == ipIfStatsTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipIfStatsTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_ipIfStatsTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipIfStatsTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipIfStatsTable_pre_request;
+ access_multiplexer->post_request = _mfd_ipIfStatsTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipIfStatsTable:init_ipIfStatsTable",
+ "Registering ipIfStatsTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipIfStatsTable", handler,
+ ipIfStatsTable_oid,
+ ipIfStatsTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipIfStatsTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipIfStatsTable_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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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->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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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,
+ ipIfStatsTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ipIfStatsTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(ipIfStatsTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+ /*
+ * register LastChanged
+ */
+ {
+ oid lc_oid[] = { IPIFSTATSTABLELASTCHANGE_OID };
+ netsnmp_register_watched_scalar2(netsnmp_create_handler_registration
+ ("ipIfStatsTableLastChanged", NULL,
+ lc_oid, OID_LENGTH(lc_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_create_watcher_info((void
+ *)
+ &ipIfStatsTable_if_ctx.
+ last_changed,
+ sizeof
+ (u_long),
+ ASN_TIMETICKS,
+ WATCHER_FIXED_SIZE));
+ }
+} /* _ipIfStatsTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipIfStatsTable
+ */
+void
+_ipIfStatsTable_shutdown_interface(ipIfStatsTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipIfStatsTable_container_shutdown(&ipIfStatsTable_if_ctx);
+}
+
+void
+ipIfStatsTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipIfStatsTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipIfStatsTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipIfStatsTable_index_to_oid(netsnmp_index * oid_idx,
+ ipIfStatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipIfStatsIPVersion;
+ /*
+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipIfStatsIfIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipIfStatsIPVersion, 0x00, sizeof(var_ipIfStatsIPVersion));
+ var_ipIfStatsIPVersion.type = ASN_INTEGER;
+ memset(&var_ipIfStatsIfIndex, 0x00, sizeof(var_ipIfStatsIfIndex));
+ var_ipIfStatsIfIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipIfStatsIPVersion.next_variable = &var_ipIfStatsIfIndex;
+ var_ipIfStatsIfIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_ipIfStatsIPVersion,
+ (u_char *) & mib_idx->ipIfStatsIPVersion,
+ sizeof(mib_idx->ipIfStatsIPVersion));
+
+ /*
+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_ipIfStatsIfIndex,
+ (u_char *) & mib_idx->ipIfStatsIfIndex,
+ sizeof(mib_idx->ipIfStatsIfIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipIfStatsIPVersion);
+ 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_ipIfStatsIPVersion);
+
+ return err;
+} /* ipIfStatsTable_index_to_oid */
+
+/**
+ * extract ipIfStatsTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipIfStatsTable_index_from_oid(netsnmp_index * oid_idx,
+ ipIfStatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipIfStatsIPVersion;
+ /*
+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipIfStatsIfIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipIfStatsIPVersion, 0x00, sizeof(var_ipIfStatsIPVersion));
+ var_ipIfStatsIPVersion.type = ASN_INTEGER;
+ memset(&var_ipIfStatsIfIndex, 0x00, sizeof(var_ipIfStatsIfIndex));
+ var_ipIfStatsIfIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipIfStatsIPVersion.next_variable = &var_ipIfStatsIfIndex;
+ var_ipIfStatsIfIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipIfStatsIPVersion);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipIfStatsIPVersion =
+ *((u_long *) var_ipIfStatsIPVersion.val.string);
+ mib_idx->ipIfStatsIfIndex =
+ *((long *) var_ipIfStatsIfIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipIfStatsIPVersion);
+
+ return err;
+} /* ipIfStatsTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipIfStatsTable_rowreq_ctx
+ */
+ipIfStatsTable_rowreq_ctx *
+ipIfStatsTable_allocate_rowreq_ctx(ipIfStatsTable_data * data,
+ void *user_init_ctx)
+{
+ ipIfStatsTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipIfStatsTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ipIfStatsTable:ipIfStatsTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipIfStatsTable_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 = ipIfStatsTable_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->ipIfStatsTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipIfStatsTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ ipIfStatsTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipIfStatsTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipIfStatsTable_rowreq_ctx
+ */
+void
+ipIfStatsTable_release_rowreq_ctx(ipIfStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipIfStatsTable:ipIfStatsTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipIfStatsTable_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))
+ ipIfStatsTable_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);
+} /* ipIfStatsTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipIfStatsTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipIfStatsTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipIfStatsTable_pre_request(ipIfStatsTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipIfStatsTable", "error %d from "
+ "ipIfStatsTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipIfStatsTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipIfStatsTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipIfStatsTable_rowreq_ctx *rowreq_ctx = (ipIfStatsTable_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipIfStatsTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipIfStatsTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = ipIfStatsTable_post_request(ipIfStatsTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipIfStatsTable", "error %d from "
+ "ipIfStatsTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipIfStatsTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipIfStatsTable_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;
+ ipIfStatsTable_rowreq_ctx *rowreq_ctx = (ipIfStatsTable_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipIfStatsTable_interface_ctx *if_ctx =
+ * (ipIfStatsTable_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
+ ipIfStatsTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipIfStatsTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipIfStatsInReceives(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINRECEIVES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInReceives_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINRECEIVES:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInReceives_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInOctets(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInOctets_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInOctets_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInHdrErrors(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINHDRERRORS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInHdrErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInNoRoutes(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINNOROUTES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInNoRoutes_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInAddrErrors(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINADDRERRORS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInAddrErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInUnknownProtos(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINUNKNOWNPROTOS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInUnknownProtos_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInTruncatedPkts(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINTRUNCATEDPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInTruncatedPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInForwDatagrams(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINFORWDATAGRAMS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInForwDatagrams_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINFORWDATAGRAMS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInForwDatagrams_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsReasmReqds(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSREASMREQDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsReasmReqds_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsReasmOKs(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSREASMOKS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsReasmOKs_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsReasmFails(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSREASMFAILS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsReasmFails_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInDiscards(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINDISCARDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInDiscards_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInDelivers(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINDELIVERS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInDelivers_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINDELIVERS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInDelivers_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutRequests(20)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTREQUESTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutRequests_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTREQUESTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutRequests_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutForwDatagrams(23)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTFORWDATAGRAMS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutForwDatagrams_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTFORWDATAGRAMS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutForwDatagrams_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutDiscards(25)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTDISCARDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutDiscards_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutFragReqds(26)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTFRAGREQDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutFragReqds_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutFragOKs(27)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTFRAGOKS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutFragOKs_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutFragFails(28)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTFRAGFAILS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutFragFails_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutFragCreates(29)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTFRAGCREATES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutFragCreates_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutTransmits(30)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTTRANSMITS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutTransmits_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTTRANSMITS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutTransmits_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutOctets(32)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInMcastPkts(34)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINMCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInMcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINMCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInMcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInMcastOctets(36)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINMCASTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInMcastOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINMCASTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInMcastOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutMcastPkts(38)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTMCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutMcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTMCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutMcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutMcastOctets(40)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTMCASTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutMcastOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTMCASTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutMcastOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsInBcastPkts(42)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSINBCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsInBcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINBCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInBcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsOutBcastPkts(44)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSOUTBCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipIfStatsOutBcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTBCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutBcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsDiscontinuityTime(46)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSDISCONTINUITYTIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = ipIfStatsDiscontinuityTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipIfStatsRefreshRate(47)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSREFRESHRATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipIfStatsRefreshRate_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (IPIFSTATSTABLE_MIN_COL <= column
+ && column <= IPIFSTATSTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipIfStatsTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _ipIfStatsTable_get_column */
+
+int
+_mfd_ipIfStatsTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipIfStatsTable_rowreq_ctx *rowreq_ctx = (ipIfStatsTable_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_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 = _ipIfStatsTable_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_ipIfStatsTable_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:ipIfStatsTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for ipIfStatsTable_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 ipIfStatsTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipIfStatsTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in ipIfStatsTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipIfStatsTable_rowreq_ctx * rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:ipIfStatsTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipIfStatsTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:ipIfStatsTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipIfStatsTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipIfStatsTable_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
+_ipIfStatsTable_container_init(ipIfStatsTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipIfStatsTable:_ipIfStatsTable_container_init",
+ "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipIfStatsTable_oid,
+ ipIfStatsTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ipIfStatsTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipIfStatsTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipIfStatsTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipIfStatsTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ipIfStatsTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipIfStatsTable_container_shutdown(ipIfStatsTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipIfStatsTable:_ipIfStatsTable_container_shutdown", "called\n"));
+
+ ipIfStatsTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipIfStatsTable_container_shutdown */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_EXTERNAL_ACCESS
+ipIfStatsTable_rowreq_ctx *
+ipIfStatsTable_row_find_by_mib_index(ipIfStatsTable_mib_index * mib_idx)
+{
+ ipIfStatsTable_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 = ipIfStatsTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = (ipIfStatsTable_rowreq_ctx*)CONTAINER_FIND(ipIfStatsTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPIFSTATSTABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h
new file mode 100644
index 0000000..c43de84
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_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 IPIFSTATSTABLE_INTERFACE_H
+#define IPIFSTATSTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipIfStatsTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipIfStatsTable_initialize_interface(ipIfStatsTable_registration *
+ user_ctx, u_long flags);
+ void
+ _ipIfStatsTable_shutdown_interface(ipIfStatsTable_registration *
+ user_ctx);
+
+ ipIfStatsTable_registration *ipIfStatsTable_registration_get(void);
+
+ ipIfStatsTable_registration
+ *ipIfStatsTable_registration_set(ipIfStatsTable_registration *
+ newreg);
+
+ netsnmp_container *ipIfStatsTable_container_get(void);
+ int ipIfStatsTable_container_size(void);
+
+ ipIfStatsTable_rowreq_ctx
+ *ipIfStatsTable_allocate_rowreq_ctx(ipIfStatsTable_data *, void *);
+ void
+ ipIfStatsTable_release_rowreq_ctx(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipIfStatsTable_index_to_oid(netsnmp_index * oid_idx,
+ ipIfStatsTable_mib_index *
+ mib_idx);
+ int ipIfStatsTable_index_from_oid(netsnmp_index * oid_idx,
+ ipIfStatsTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void ipIfStatsTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+ /*
+ */
+ void ipIfStatsTable_lastChange_set(u_long uptime);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPIFSTATSTABLE_INTERFACE_H */
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h
new file mode 100644
index 0000000..76607a9
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h
@@ -0,0 +1,122 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef IPIFSTATSTABLE_OIDS_H
+#define IPIFSTATSTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipIfStatsTable
+ */
+#define IPIFSTATSTABLE_OID 1,3,6,1,2,1,4,31,3
+#define IPIFSTATSTABLELASTCHANGE_OID 1,3,6,1,2,1,4,31,2
+
+#define COLUMN_IPIFSTATSIPVERSION 1
+
+#define COLUMN_IPIFSTATSIFINDEX 2
+
+#define COLUMN_IPIFSTATSINRECEIVES 3
+
+#define COLUMN_IPIFSTATSHCINRECEIVES 4
+
+#define COLUMN_IPIFSTATSINOCTETS 5
+
+#define COLUMN_IPIFSTATSHCINOCTETS 6
+
+#define COLUMN_IPIFSTATSINHDRERRORS 7
+
+#define COLUMN_IPIFSTATSINNOROUTES 8
+
+#define COLUMN_IPIFSTATSINADDRERRORS 9
+
+#define COLUMN_IPIFSTATSINUNKNOWNPROTOS 10
+
+#define COLUMN_IPIFSTATSINTRUNCATEDPKTS 11
+
+#define COLUMN_IPIFSTATSINFORWDATAGRAMS 12
+
+#define COLUMN_IPIFSTATSHCINFORWDATAGRAMS 13
+
+#define COLUMN_IPIFSTATSREASMREQDS 14
+
+#define COLUMN_IPIFSTATSREASMOKS 15
+
+#define COLUMN_IPIFSTATSREASMFAILS 16
+
+#define COLUMN_IPIFSTATSINDISCARDS 17
+
+#define COLUMN_IPIFSTATSINDELIVERS 18
+
+#define COLUMN_IPIFSTATSHCINDELIVERS 19
+
+#define COLUMN_IPIFSTATSOUTREQUESTS 20
+
+#define COLUMN_IPIFSTATSHCOUTREQUESTS 21
+
+#define COLUMN_IPIFSTATSOUTFORWDATAGRAMS 23
+
+#define COLUMN_IPIFSTATSHCOUTFORWDATAGRAMS 24
+
+#define COLUMN_IPIFSTATSOUTDISCARDS 25
+
+#define COLUMN_IPIFSTATSOUTFRAGREQDS 26
+
+#define COLUMN_IPIFSTATSOUTFRAGOKS 27
+
+#define COLUMN_IPIFSTATSOUTFRAGFAILS 28
+
+#define COLUMN_IPIFSTATSOUTFRAGCREATES 29
+
+#define COLUMN_IPIFSTATSOUTTRANSMITS 30
+
+#define COLUMN_IPIFSTATSHCOUTTRANSMITS 31
+
+#define COLUMN_IPIFSTATSOUTOCTETS 32
+
+#define COLUMN_IPIFSTATSHCOUTOCTETS 33
+
+#define COLUMN_IPIFSTATSINMCASTPKTS 34
+
+#define COLUMN_IPIFSTATSHCINMCASTPKTS 35
+
+#define COLUMN_IPIFSTATSINMCASTOCTETS 36
+
+#define COLUMN_IPIFSTATSHCINMCASTOCTETS 37
+
+#define COLUMN_IPIFSTATSOUTMCASTPKTS 38
+
+#define COLUMN_IPIFSTATSHCOUTMCASTPKTS 39
+
+#define COLUMN_IPIFSTATSOUTMCASTOCTETS 40
+
+#define COLUMN_IPIFSTATSHCOUTMCASTOCTETS 41
+
+#define COLUMN_IPIFSTATSINBCASTPKTS 42
+
+#define COLUMN_IPIFSTATSHCINBCASTPKTS 43
+
+#define COLUMN_IPIFSTATSOUTBCASTPKTS 44
+
+#define COLUMN_IPIFSTATSHCOUTBCASTPKTS 45
+
+#define COLUMN_IPIFSTATSDISCONTINUITYTIME 46
+
+#define COLUMN_IPIFSTATSREFRESHRATE 47
+
+
+#define IPIFSTATSTABLE_MIN_COL COLUMN_IPIFSTATSINRECEIVES
+#define IPIFSTATSTABLE_MAX_COL COLUMN_IPIFSTATSREFRESHRATE
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPIFSTATSTABLE_OIDS_H */
diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable.h b/agent/mibgroup/ip-mib/ipSystemStatsTable.h
new file mode 100644
index 0000000..047db74
--- /dev/null
+++ b/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/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
new file mode 100644
index 0000000..10587e2
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
@@ -0,0 +1,3321 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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"
+
+const oid ipSystemStatsTable_oid[] = { IPSYSTEMSTATSTABLE_OID };
+const int ipSystemStatsTable_oid_size =
+OID_LENGTH(ipSystemStatsTable_oid);
+
+ipSystemStatsTable_registration ipSystemStatsTable_user_context;
+static ipSystemStatsTable_registration *ipSystemStatsTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ ipSystemStatsTable_user_context_p =
+ 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
+ (ipSystemStatsTable_user_context_p, flags);
+} /* initialize_table_ipSystemStatsTable */
+
+/**
+ * Shutdown the table ipSystemStatsTable
+ */
+void
+shutdown_table_ipSystemStatsTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipSystemStatsTable_shutdown_interface
+ (ipSystemStatsTable_user_context_p);
+ netsnmp_free_all_list_data(ipSystemStatsTable_user_context_p);
+ ipSystemStatsTable_user_context_p = NULL;
+}
+
+/**
+ * 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.
+ */
+ netsnmp_access_systemstats_entry_free(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+} /* 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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES])
+ return MFD_SKIP;
+
+ (*ipSystemStatsInNoRoutes_val_ptr) =
+ rowreq_ctx->data->stats.HCInNoRoutes.low;
+
+ 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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INADDRERRORS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMREQDS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMOKS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMFAILS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INDISCARDS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES])
+ return MFD_SKIP;
+
+ (*ipSystemStatsOutNoRoutes_val_ptr) =
+ rowreq_ctx->data->stats.HCOutNoRoutes.low;
+
+ 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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS])
+ return MFD_SKIP;
+
+ (*ipSystemStatsOutDiscards_val_ptr) =
+ rowreq_ctx->data->stats.HCOutDiscards.low;
+
+ 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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS])
+ return MFD_SKIP;
+
+ (*ipSystemStatsOutFragReqds_val_ptr) =
+ rowreq_ctx->data->stats.HCOutFragReqds.low;
+
+ 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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS])
+ return MFD_SKIP;
+
+ (*ipSystemStatsOutFragOKs_val_ptr) =
+ rowreq_ctx->data->stats.HCOutFragOKs.low;
+
+ 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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS])
+ return MFD_SKIP;
+
+ (*ipSystemStatsOutFragFails_val_ptr) =
+ rowreq_ctx->data->stats.HCOutFragFails.low;
+
+ 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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES])
+ return MFD_SKIP;
+
+ (*ipSystemStatsOutFragCreates_val_ptr) =
+ rowreq_ctx->data->stats.HCOutFragCreates.low;
+
+ 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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_DISCONTINUITYTIME])
+ return MFD_SKIP;
+
+ (*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
+ */
+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REFRESHRATE])
+ return MFD_SKIP;
+
+ (*ipSystemStatsRefreshRate_val_ptr) =
+ rowreq_ctx->ipSystemStatsRefreshRate;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsRefreshRate_get */
+
+
+
+/** @} */
+/** @} */
+/** @{ */
diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
new file mode 100644
index 0000000..ca1e1f3
--- /dev/null
+++ b/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$
+ */
+#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 const oid ipSystemStatsTable_oid[];
+ extern const 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/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
new file mode 100644
index 0000000..e9294c4
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c
new file mode 100644
index 0000000..d41bb25
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c
@@ -0,0 +1,400 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $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 "ipSystemStatsTable.h"
+
+
+#include "ipSystemStatsTable_data_access.h"
+
+static int ipss_cache_refresh = IPSYSTEMSTATSTABLE_CACHE_TIMEOUT;
+
+/** @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)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_init_data",
+ "called\n"));
+
+ /*
+ * 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 = netsnmp_container_find("ipSystemStatsTable:table_container");
+ if (NULL != *container_ptr_ptr)
+ (*container_ptr_ptr)->container_name = strdup("ipSystemStatsTable");
+
+ 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_load(*container_ptr_ptr);
+} /* 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 = (netsnmp_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->
+ index[0]))) {
+ 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",
+ "%" NETSNMP_PRIz "u 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/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
new file mode 100644
index 0000000..56cdb72
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
new file mode 100644
index 0000000..e1ca2cb
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
@@ -0,0 +1,1391 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(ipSystemStatsTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+
+netsnmp_feature_child_of(ipSystemStatsTable_container_size, ipSystemStatsTable_external_access)
+netsnmp_feature_child_of(ipSystemStatsTable_registration_set, ipSystemStatsTable_external_access)
+netsnmp_feature_child_of(ipSystemStatsTable_registration_get, ipSystemStatsTable_external_access)
+netsnmp_feature_child_of(ipSystemStatsTable_container_get, ipSystemStatsTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_CONTAINER_GET
+netsnmp_container *
+ipSystemStatsTable_container_get(void)
+{
+ return ipSystemStatsTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_REGISTRATION_GET
+ipSystemStatsTable_registration *
+ipSystemStatsTable_registration_get(void)
+{
+ return ipSystemStatsTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_REGISTRATION_SET
+ipSystemStatsTable_registration *
+ipSystemStatsTable_registration_set(ipSystemStatsTable_registration *
+ newreg)
+{
+ ipSystemStatsTable_registration *old =
+ ipSystemStatsTable_if_ctx.user_ctx;
+ ipSystemStatsTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_CONTAINER_SIZE
+int
+ipSystemStatsTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipSystemStatsTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_CONTAINER_SIZE */
+
+/*
+ * 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 retrieval.
+ */
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /* XXX - are these actually necessary? */
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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 = (ipSystemStatsTable_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 = (ipSystemStatsTable_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 = (ipSystemStatsTable_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 */
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+#endif
+
+/***********************************************************************
+ *
+ * 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_EXTERNAL_ACCESS
+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 = (ipSystemStatsTable_rowreq_ctx*)
+ CONTAINER_FIND(ipSystemStatsTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPSYSTEMSTATSTABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
new file mode 100644
index 0000000..89f6ae0
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/ip-mib/ip_scalars.c b/agent/mibgroup/ip-mib/ip_scalars.c
new file mode 100644
index 0000000..b697a75
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ip_scalars.c
@@ -0,0 +1,372 @@
+/*
+ * 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-features.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>
+
+netsnmp_feature_require(register_num_file_instance)
+
+#include "ip_scalars.h"
+
+int
+handle_ipForwarding(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+int
+handle_ipDefaultTTL(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+int
+handle_ipv6IpForwarding(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+int ipAddressSpinLockValue;
+
+int
+handle_ipAddressSpinLock(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 ipForwarding_oid[] = { 1, 3, 6, 1, 2, 1, 4, 1 };
+ static oid ipDefaultTTL_oid[] = { 1, 3, 6, 1, 2, 1, 4, 2, 0 };
+ 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 };
+ static oid ipAddressSpinLock_oid[] = { 1, 3, 6, 1, 2, 1, 4, 33 };
+
+ 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
+ ("ipForwarding", handle_ipForwarding,
+ ipForwarding_oid,
+ OID_LENGTH(ipForwarding_oid),
+ HANDLER_CAN_RWRITE));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("ipv6IpForwarding", handle_ipv6IpForwarding,
+ ipv6IpForwarding_oid,
+ OID_LENGTH(ipv6IpForwarding_oid),
+ HANDLER_CAN_RWRITE));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("ipAddressSpinLock", handle_ipAddressSpinLock,
+ ipAddressSpinLock_oid,
+ OID_LENGTH(ipAddressSpinLock_oid),
+ HANDLER_CAN_RWRITE));
+
+ /* Initialize spin lock with random value */
+ ipAddressSpinLockValue = (int) random();
+
+ 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);
+
+ netsnmp_register_num_file_instance
+ ("ipDefaultTTL",
+ ipDefaultTTL_oid, OID_LENGTH(ipDefaultTTL_oid),
+ "/proc/sys/net/ipv4/ip_default_ttl", ASN_INTEGER,
+ HANDLER_CAN_RWRITE, NULL, NULL);
+
+}
+
+int
+handle_ipForwarding(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_ipForwarding_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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * 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_ipForwarding_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:
+ /* XXX: free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* XXX: perform the value change here */
+ value = *(requests->requestvb->val.integer);
+ rc = netsnmp_arch_ip_scalars_ipForwarding_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_ipForwarding_set(value);
+ if ( 0 != rc ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_ipForwarding\n", reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+}
+
+int
+handle_ipAddressSpinLock(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ 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 *)&ipAddressSpinLockValue,
+ sizeof(ipAddressSpinLockValue));
+ break;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * 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:
+ case MODE_SET_RESERVE2:
+ /* just check the value */
+ value = *(requests->requestvb->val.integer);
+ if (value != ipAddressSpinLockValue)
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_INCONSISTENTVALUE);
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the final spinlock check and increase its value */
+ value = *(requests->requestvb->val.integer);
+ if (value != ipAddressSpinLockValue) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_INCONSISTENTVALUE);
+ } else {
+ ipAddressSpinLockValue++;
+ /* and check it for overflow */
+ if (ipAddressSpinLockValue > 2147483647 || ipAddressSpinLockValue < 0)
+ ipAddressSpinLockValue = 0;
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_ipAddressSpinLock\n", reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/ip-mib/ip_scalars.h b/agent/mibgroup/ip-mib/ip_scalars.h
new file mode 100644
index 0000000..7670a49
--- /dev/null
+++ b/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/agent/mibgroup/ip-mib/ipv4InterfaceTable.h b/agent/mibgroup/ip-mib/ipv4InterfaceTable.h
new file mode 100644
index 0000000..2ebd768
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv4InterfaceTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipv4InterfaceTable/ipv4InterfaceTable)
diff --git a/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c
new file mode 100644
index 0000000..351ddd1
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c
@@ -0,0 +1,959 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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"
+
+const oid ipv4InterfaceTable_oid[] = { IPV4INTERFACETABLE_OID };
+const int ipv4InterfaceTable_oid_size =
+OID_LENGTH(ipv4InterfaceTable_oid);
+
+ipv4InterfaceTable_registration ipv4InterfaceTable_user_context;
+static ipv4InterfaceTable_registration *ipv4InterfaceTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ ipv4InterfaceTable_user_context_p =
+ 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
+ (ipv4InterfaceTable_user_context_p, flags);
+} /* initialize_table_ipv4InterfaceTable */
+
+/**
+ * Shutdown the table ipv4InterfaceTable
+ */
+void
+shutdown_table_ipv4InterfaceTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipv4InterfaceTable_shutdown_interface
+ (ipv4InterfaceTable_user_context_p);
+ netsnmp_free_all_list_data(ipv4InterfaceTable_user_context_p);
+ ipv4InterfaceTable_user_context_p = NULL;
+}
+
+/**
+ * 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/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
new file mode 100644
index 0000000..8123908
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
@@ -0,0 +1,276 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+#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 initialize_table_ipv4InterfaceTable(void);
+ 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 const oid ipv4InterfaceTable_oid[];
+ extern const 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/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h
new file mode 100644
index 0000000..eb391ae
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c
new file mode 100644
index 0000000..c9e14ff
--- /dev/null
+++ b/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$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#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 %" NETSNMP_PRIo "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 %" NETSNMP_PRIo "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 %" NETSNMP_PRIo "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/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h
new file mode 100644
index 0000000..4fb5db3
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c
new file mode 100644
index 0000000..a851a30
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c
@@ -0,0 +1,1325 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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 "if-mib/ifTable/ifTable.h"
+
+#include <ctype.h>
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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;
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+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);
+#endif
+
+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 retrieval.
+ */
+ 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;
+
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ /*
+ * 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;
+#endif
+
+ /*************************************************
+ *
+ * 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
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ | HANDLER_CAN_RWRITE
+#endif
+ );
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ 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->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;
+#endif
+
+ 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_scalar2(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)
+{
+ 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 */
+
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+/***********************************************************************
+ *
+ * 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 */
+#endif
+
+/***********************************************************************
+ *
+ * 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;
+ }
+ if_ctx->container->container_name = strdup("ipv4InterfaceTable");
+
+} /* _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/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h
new file mode 100644
index 0000000..46b3049
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c
new file mode 100644
index 0000000..35b2e96
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c
@@ -0,0 +1,207 @@
+/*
+ * 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+netsnmp_feature_require(agentx_enable_subagent)
+netsnmp_feature_require(agent_check_and_process)
+netsnmp_feature_require(enable_stderrlog)
+
+/*
+ * 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/agent/mibgroup/ip-mib/ipv6InterfaceTable.h b/agent/mibgroup/ip-mib/ipv6InterfaceTable.h
new file mode 100644
index 0000000..471eaa0
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6InterfaceTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipv6InterfaceTable/ipv6InterfaceTable)
diff --git a/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c
new file mode 100644
index 0000000..92f0a5b
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c
@@ -0,0 +1,1421 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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"
+
+const oid ipv6InterfaceTable_oid[] = { IPV6INTERFACETABLE_OID };
+const int ipv6InterfaceTable_oid_size =
+OID_LENGTH(ipv6InterfaceTable_oid);
+
+ipv6InterfaceTable_registration ipv6InterfaceTable_user_context;
+static ipv6InterfaceTable_registration *ipv6InterfaceTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ ipv6InterfaceTable_user_context_p =
+ 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
+ (ipv6InterfaceTable_user_context_p, flags);
+} /* initialize_table_ipv6InterfaceTable */
+
+/**
+ * Shutdown the table ipv6InterfaceTable
+ */
+void
+shutdown_table_ipv6InterfaceTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipv6InterfaceTable_shutdown_interface
+ (ipv6InterfaceTable_user_context_p);
+ netsnmp_free_all_list_data(ipv6InterfaceTable_user_context_p);
+ ipv6InterfaceTable_user_context_p = NULL;
+}
+
+/**
+ * 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) ? 1 : 2;
+
+ 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/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h
new file mode 100644
index 0000000..e2a87a1
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h
@@ -0,0 +1,971 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+#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 initialize_table_ipv6InterfaceTable(void);
+ 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 const oid ipv6InterfaceTable_oid[];
+ extern const 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/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h
new file mode 100644
index 0000000..a8f371b
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c
new file mode 100644
index 0000000..33c65a9
--- /dev/null
+++ b/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$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#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 %" NETSNMP_PRIo "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 %" NETSNMP_PRIo "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 %" NETSNMP_PRIo "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", (int)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/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h
new file mode 100644
index 0000000..664c3d7
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h
@@ -0,0 +1,64 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id$
+ */
+#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_check_entry_for_updates(
+ const ifTable_rowreq_ctx * ift_rrc,
+ netsnmp_interface_entry *entry);
+
+ 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/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c
new file mode 100644
index 0000000..cbd533c
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c
@@ -0,0 +1,1406 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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;
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+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);
+#endif
+
+/**
+ * @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 retrieval.
+ */
+ 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;
+
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ /*
+ * 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;
+#endif
+
+ /*************************************************
+ *
+ * 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
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ | HANDLER_CAN_RWRITE
+#endif
+ );
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ 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->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;
+#endif
+
+ 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_scalar2(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 */
+
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+/***********************************************************************
+ *
+ * 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 */
+#endif
+
+/***********************************************************************
+ *
+ * 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;
+ }
+ if_ctx->container->container_name = strdup("ipv6InterfaceTable");
+} /* _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/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h b/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h
new file mode 100644
index 0000000..4cb8ff5
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h
new file mode 100644
index 0000000..779bd75
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable)
diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c
new file mode 100644
index 0000000..f794093
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c
@@ -0,0 +1,1009 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:ipv6ScopeZoneIndexTable.c 14170 2007-04-29 00:12:32Z varun_c$
+ */
+/** \page MFD helper for ipv6ScopeZoneIndexTable
+ *
+ * \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 "ipv6ScopeZoneIndexTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipv6ScopeZoneIndexTable_interface.h"
+
+const oid ipv6ScopeZoneIndexTable_oid[] =
+ { IPV6SCOPEZONEINDEXTABLE_OID };
+const int ipv6ScopeZoneIndexTable_oid_size =
+OID_LENGTH(ipv6ScopeZoneIndexTable_oid);
+
+ipv6ScopeZoneIndexTable_registration ipv6ScopeZoneIndexTable_user_context;
+static ipv6ScopeZoneIndexTable_registration *ipv6ScopeZoneIndexTable_user_context_p;
+
+void initialize_table_ipv6ScopeZoneIndexTable(void);
+void shutdown_table_ipv6ScopeZoneIndexTable(void);
+
+
+/**
+ * Initializes the ipv6ScopeZoneIndexTable module
+ */
+void
+init_ipv6ScopeZoneIndexTable(void)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:init_ipv6ScopeZoneIndexTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipv6ScopeZoneIndexTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipv6ScopeZoneIndexTable"))
+ initialize_table_ipv6ScopeZoneIndexTable();
+
+} /* init_ipv6ScopeZoneIndexTable */
+
+/**
+ * Shut-down the ipv6ScopeZoneIndexTable module (agent is exiting)
+ */
+void
+shutdown_ipv6ScopeZoneIndexTable(void)
+{
+ if (should_init("ipv6ScopeZoneIndexTable"))
+ shutdown_table_ipv6ScopeZoneIndexTable();
+
+}
+
+/**
+ * Initialize the table ipv6ScopeZoneIndexTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipv6ScopeZoneIndexTable(void)
+{
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:initialize_table_ipv6ScopeZoneIndexTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipv6ScopeZoneIndexTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipv6ScopeZoneIndexTable 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.
+ */
+ ipv6ScopeZoneIndexTable_user_context_p =
+ netsnmp_create_data_list("ipv6ScopeZoneIndexTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipv6ScopeZoneIndexTable_initialize_interface
+ (ipv6ScopeZoneIndexTable_user_context_p, flags);
+} /* initialize_table_ipv6ScopeZoneIndexTable */
+
+/**
+ * Shutdown the table ipv6ScopeZoneIndexTable
+ */
+void
+shutdown_table_ipv6ScopeZoneIndexTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipv6ScopeZoneIndexTable_shutdown_interface
+ (ipv6ScopeZoneIndexTable_user_context_p);
+ netsnmp_free_all_list_data(ipv6ScopeZoneIndexTable_user_context_p);
+ ipv6ScopeZoneIndexTable_user_context_p = NULL;
+}
+
+/**
+ * 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
+ipv6ScopeZoneIndexTable_rowreq_ctx_init(ipv6ScopeZoneIndexTable_rowreq_ctx
+ * rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipv6ScopeZoneIndexTable rowreq initialization. (eg DEFVALS)
+ */
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipv6ScopeZoneIndexTable_rowreq_ctx_cleanup
+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipv6ScopeZoneIndexTable rowreq cleanup.
+ */
+ netsnmp_access_scopezone_entry_free(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+} /* ipv6ScopeZoneIndexTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipv6ScopeZoneIndexTable_pre_request(ipv6ScopeZoneIndexTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipv6ScopeZoneIndexTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexTable_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
+ipv6ScopeZoneIndexTable_post_request(ipv6ScopeZoneIndexTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipv6ScopeZoneIndexTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexTable_post_request */
+
+/*
+ * ipv6ScopeZoneIndexTable_allocate_data
+ *
+ * Purpose: create new ipv6ScopeZoneIndexTable_data.
+ */
+ipv6ScopeZoneIndexTable_data *
+ipv6ScopeZoneIndexTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the ipv6ScopeZoneIndexTable data context.
+ */
+ ipv6ScopeZoneIndexTable_data *rtn = netsnmp_access_scopezone_entry_create();
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipv6ScopeZoneIndexTable_data.\n");
+ }
+
+ return rtn;
+} /* ipv6ScopeZoneIndexTable_allocate_data */
+
+/*
+ * ipv6ScopeZoneIndexTable_release_data
+ *
+ * Purpose: release ipv6ScopeZoneIndexTable data.
+ */
+void
+ipv6ScopeZoneIndexTable_release_data(ipv6ScopeZoneIndexTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_release_data", "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the ipv6ScopeZoneIndexTable data context.
+ */
+ netsnmp_access_scopezone_entry_free(data);
+} /* ipv6ScopeZoneIndexTable_release_data */
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement ipv6ScopeZoneIndexTable get routines.
+ * TODO:240:M: Implement ipv6ScopeZoneIndexTable 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 ipv6ScopeZoneIndexTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.36, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipv6ScopeZoneIndexTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipv6ScopeZoneIndexIfIndex_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
+ipv6ScopeZoneIndexTable_indexes_set_tbl_idx
+ (ipv6ScopeZoneIndexTable_mib_index * tbl_idx,
+ long ipv6ScopeZoneIndexIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ tbl_idx->ipv6ScopeZoneIndexIfIndex = ipv6ScopeZoneIndexIfIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexTable_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
+ipv6ScopeZoneIndexTable_indexes_set(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipv6ScopeZoneIndexIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipv6ScopeZoneIndexTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipv6ScopeZoneIndexIfIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipv6ScopeZoneIndexTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexLinkLocal
+ * ipv6ScopeZoneIndexLinkLocal is subid 2 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.2
+ * Description:
+The zone index for the link-local scope on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexLinkLocal data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndexLinkLocal_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
+ipv6ScopeZoneIndexLinkLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6ScopeZoneIndexLinkLocal_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndexLinkLocal_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexLinkLocal_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexLinkLocal data.
+ * copy (* ipv6ScopeZoneIndexLinkLocal_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndexLinkLocal_val_ptr) =
+ rowreq_ctx->data->scopezone_linklocal;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexLinkLocal_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndex3
+ * ipv6ScopeZoneIndex3 is subid 3 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.3
+ * Description:
+The zone index for scope 3 on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndex3 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndex3_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
+ipv6ScopeZoneIndex3_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6ScopeZoneIndex3_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndex3_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndex3_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndex3 data.
+ * copy (* ipv6ScopeZoneIndex3_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndex3_val_ptr) = 0;
+
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndex3_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexAdminLocal
+ * ipv6ScopeZoneIndexAdminLocal is subid 4 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.4
+ * Description:
+The zone index for the admin-local scope on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexAdminLocal data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndexAdminLocal_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
+ipv6ScopeZoneIndexAdminLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6ScopeZoneIndexAdminLocal_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndexAdminLocal_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexAdminLocal_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexAdminLocal data.
+ * copy (* ipv6ScopeZoneIndexAdminLocal_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndexAdminLocal_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexAdminLocal_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexSiteLocal
+ * ipv6ScopeZoneIndexSiteLocal is subid 5 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.5
+ * Description:
+The zone index for the site-local scope on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexSiteLocal data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndexSiteLocal_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
+ipv6ScopeZoneIndexSiteLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6ScopeZoneIndexSiteLocal_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndexSiteLocal_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexSiteLocal_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexSiteLocal data.
+ * copy (* ipv6ScopeZoneIndexSiteLocal_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndexSiteLocal_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexSiteLocal_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndex6
+ * ipv6ScopeZoneIndex6 is subid 6 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.6
+ * Description:
+The zone index for scope 6 on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndex6 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndex6_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
+ipv6ScopeZoneIndex6_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6ScopeZoneIndex6_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndex6_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndex6_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndex6 data.
+ * copy (* ipv6ScopeZoneIndex6_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndex6_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndex6_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndex7
+ * ipv6ScopeZoneIndex7 is subid 7 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.7
+ * Description:
+The zone index for scope 7 on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndex7 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndex7_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
+ipv6ScopeZoneIndex7_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6ScopeZoneIndex7_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndex7_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndex7_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndex7 data.
+ * copy (* ipv6ScopeZoneIndex7_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndex7_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndex7_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexOrganizationLocal
+ * ipv6ScopeZoneIndexOrganizationLocal is subid 8 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.8
+ * Description:
+The zone index for the organization-local scope on this
+ interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexOrganizationLocal data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndexOrganizationLocal_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
+ipv6ScopeZoneIndexOrganizationLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipv6ScopeZoneIndexOrganizationLocal_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndexOrganizationLocal_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexOrganizationLocal_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexOrganizationLocal data.
+ * copy (* ipv6ScopeZoneIndexOrganizationLocal_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndexOrganizationLocal_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexOrganizationLocal_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndex9
+ * ipv6ScopeZoneIndex9 is subid 9 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.9
+ * Description:
+The zone index for scope 9 on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndex9 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndex9_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
+ipv6ScopeZoneIndex9_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6ScopeZoneIndex9_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndex9_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndex9_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndex9 data.
+ * copy (* ipv6ScopeZoneIndex9_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndex9_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndex9_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexA
+ * ipv6ScopeZoneIndexA is subid 10 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.10
+ * Description:
+The zone index for scope A on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexA data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndexA_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
+ipv6ScopeZoneIndexA_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6ScopeZoneIndexA_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndexA_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexA_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexA data.
+ * copy (* ipv6ScopeZoneIndexA_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndexA_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexA_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexB
+ * ipv6ScopeZoneIndexB is subid 11 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.11
+ * Description:
+The zone index for scope B on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexB data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndexB_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
+ipv6ScopeZoneIndexB_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6ScopeZoneIndexB_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndexB_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexB_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexB data.
+ * copy (* ipv6ScopeZoneIndexB_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndexB_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexB_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexC
+ * ipv6ScopeZoneIndexC is subid 12 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.12
+ * Description:
+The zone index for scope C on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexC data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndexC_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
+ipv6ScopeZoneIndexC_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6ScopeZoneIndexC_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndexC_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexC_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexC data.
+ * copy (* ipv6ScopeZoneIndexC_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndexC_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexC_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexD
+ * ipv6ScopeZoneIndexD is subid 13 of ipv6ScopeZoneIndexEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.36.1.13
+ * Description:
+The zone index for scope D on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexD data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6ScopeZoneIndexD_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
+ipv6ScopeZoneIndexD_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6ScopeZoneIndexD_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6ScopeZoneIndexD_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexD_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexD data.
+ * copy (* ipv6ScopeZoneIndexD_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6ScopeZoneIndexD_val_ptr) = 0;
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexD_get */
+
+
+/** @{ */
diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
new file mode 100644
index 0000000..2974fee
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
@@ -0,0 +1,269 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:ipv6ScopeZoneIndexTable.h 14170 2007-04-29 00:12:32Z varun_c$
+ */
+#ifndef IPV6SCOPEZONEINDEXTABLE_H
+#define IPV6SCOPEZONEINDEXTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/scopezone.h>
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-mib/data_access/ipv6scopezone)
+config_require(ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface)
+config_require(ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for ipv6ScopeZoneIndexTable
+ */
+#include "ipv6ScopeZoneIndexTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "ipv6ScopeZoneIndexTable_enums.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipv6ScopeZoneIndexTable(void);
+ void shutdown_ipv6ScopeZoneIndexTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6ScopeZoneIndexTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.36, 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 ipv6ScopeZoneIndexTable registration context.
+ */
+ typedef netsnmp_data_list ipv6ScopeZoneIndexTable_registration;
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipv6ScopeZoneTable data context structure.
+ * This structure is used to represent the data for ipv6ScopeZoneTable.
+ */
+ typedef netsnmp_v6scopezone_entry ipv6ScopeZoneIndexTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review ipv6ScopeZoneIndexTable mib index.
+ * This structure is used to represent the index for ipv6ScopeZoneIndexTable.
+ */
+ typedef struct ipv6ScopeZoneIndexTable_mib_index_s {
+
+ /*
+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ long ipv6ScopeZoneIndexIfIndex;
+
+
+ } ipv6ScopeZoneIndexTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipv6ScopeZoneIndexTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_ipv6ScopeZoneIndexTable_IDX_LEN 1
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipv6ScopeZoneIndexTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipv6ScopeZoneIndexTable_rowreq_ctx pointer.
+ */
+ typedef struct ipv6ScopeZoneIndexTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipv6ScopeZoneIndexTable_IDX_LEN];
+
+ ipv6ScopeZoneIndexTable_mib_index tbl_idx;
+
+ ipv6ScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipv6ScopeZoneIndexTable_data_list;
+
+ } ipv6ScopeZoneIndexTable_rowreq_ctx;
+
+ typedef struct ipv6ScopeZoneIndexTable_ref_rowreq_ctx_s {
+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx;
+ } ipv6ScopeZoneIndexTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ ipv6ScopeZoneIndexTable_pre_request
+ (ipv6ScopeZoneIndexTable_registration * user_context);
+ int
+ ipv6ScopeZoneIndexTable_post_request
+ (ipv6ScopeZoneIndexTable_registration * user_context, int rc);
+
+ int
+ ipv6ScopeZoneIndexTable_rowreq_ctx_init
+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ ipv6ScopeZoneIndexTable_rowreq_ctx_cleanup
+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx);
+
+
+ ipv6ScopeZoneIndexTable_rowreq_ctx
+ *ipv6ScopeZoneIndexTable_row_find_by_mib_index
+ (ipv6ScopeZoneIndexTable_mib_index * mib_idx);
+
+ ipv6ScopeZoneIndexTable_data *
+ ipv6ScopeZoneIndexTable_allocate_data(void);
+
+ void
+ ipv6ScopeZoneIndexTable_release_data(ipv6ScopeZoneIndexTable_data * data);
+
+ extern const oid ipv6ScopeZoneIndexTable_oid[];
+ extern const int ipv6ScopeZoneIndexTable_oid_size;
+
+
+#include "ipv6ScopeZoneIndexTable_interface.h"
+#include "ipv6ScopeZoneIndexTable_data_access.h"
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6ScopeZoneIndexTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.36, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+ ipv6ScopeZoneIndexLinkLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipv6ScopeZoneIndexLinkLocal_val_ptr);
+ int
+ ipv6ScopeZoneIndex3_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipv6ScopeZoneIndex3_val_ptr);
+ int
+ ipv6ScopeZoneIndexAdminLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipv6ScopeZoneIndexAdminLocal_val_ptr);
+ int
+ ipv6ScopeZoneIndexSiteLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipv6ScopeZoneIndexSiteLocal_val_ptr);
+ int
+ ipv6ScopeZoneIndex6_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipv6ScopeZoneIndex6_val_ptr);
+ int
+ ipv6ScopeZoneIndex7_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipv6ScopeZoneIndex7_val_ptr);
+ int
+ ipv6ScopeZoneIndexOrganizationLocal_get
+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6ScopeZoneIndexOrganizationLocal_val_ptr);
+ int
+ ipv6ScopeZoneIndex9_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipv6ScopeZoneIndex9_val_ptr);
+ int
+ ipv6ScopeZoneIndexA_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipv6ScopeZoneIndexA_val_ptr);
+ int
+ ipv6ScopeZoneIndexB_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipv6ScopeZoneIndexB_val_ptr);
+ int
+ ipv6ScopeZoneIndexC_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipv6ScopeZoneIndexC_val_ptr);
+ int
+ ipv6ScopeZoneIndexD_get(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipv6ScopeZoneIndexD_val_ptr);
+
+
+ int
+ ipv6ScopeZoneIndexTable_indexes_set_tbl_idx
+ (ipv6ScopeZoneIndexTable_mib_index * tbl_idx,
+ long ipv6ScopeZoneIndexIfIndex_val);
+ int
+ ipv6ScopeZoneIndexTable_indexes_set
+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ long ipv6ScopeZoneIndexIfIndex_val);
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6SCOPEZONEINDEXTABLE_H */
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c
new file mode 100644
index 0000000..0025dd3
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c
@@ -0,0 +1,304 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:ipv6ScopeZoneIndexTable_data_access.c 14170 2007-04-29 00:12:32Z varun_c$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#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 "ipv6ScopeZoneIndexTable.h"
+
+
+#include "ipv6ScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.36, length: 8
+ */
+
+/**
+ * initialization for ipv6ScopeZoneIndexTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipv6ScopeZoneIndexTable_reg
+ * Pointer to ipv6ScopeZoneIndexTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipv6ScopeZoneIndexTable_init_data(ipv6ScopeZoneIndexTable_registration *
+ ipv6ScopeZoneIndexTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_init_data", "called\n"));
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexTable_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
+ipv6ScopeZoneIndexTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipv6ScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipv6ScopeZoneIndexTable 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 = 60; /* seconds */
+
+
+} /* ipv6ScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable_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
+ipv6ScopeZoneIndexTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipv6ScopeZoneIndexTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipv6ScopeZoneIndexTable_container_shutdown */
+
+/**
+ * check entry for update
+ *
+ */
+static void
+_snarf_zoneindex_entry(netsnmp_v6scopezone_entry *scopezone_entry,
+ netsnmp_container *container)
+{
+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGTRACE;
+ netsnmp_assert(NULL != scopezone_entry);
+ netsnmp_assert(NULL != container);
+ rowreq_ctx = ipv6ScopeZoneIndexTable_allocate_rowreq_ctx(scopezone_entry,NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS == ipv6ScopeZoneIndexTable_indexes_set
+ (rowreq_ctx, rowreq_ctx->data->index))) {
+ CONTAINER_INSERT(container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "ipv6ScopeZoneIndexTable cache.\n");
+ ipv6ScopeZoneIndexTable_release_rowreq_ctx(rowreq_ctx);
+ } else
+ netsnmp_access_scopezone_entry_free(scopezone_entry);
+ }
+
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipv6ScopeZoneIndexTable 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
+ * ipv6ScopeZoneIndexTable_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
+ipv6ScopeZoneIndexTable_container_load(netsnmp_container * container)
+{
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_container *zoneindex = netsnmp_access_scopezone_container_load(NULL, 0);
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_load", "called\n"));
+
+ if (NULL == zoneindex) {
+ DEBUGMSGTL(("ipv6ScopeZoneIndexTable:container_load",
+ "couldn't get scopezone iterator\n"));
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ /*
+ * TODO:351:M: |-> Load/update data in the ipv6ScopeZoneIndexTable container.
+ * loop over your ipv6ScopeZoneIndexTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+
+ CONTAINER_FOR_EACH(zoneindex,
+ (netsnmp_container_obj_func *) _snarf_zoneindex_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_scopezone_container_free(zoneindex,
+ 0x0001);
+
+ DEBUGMSGT(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_load", "inserted %lu records\n", (unsigned long)CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* ipv6ScopeZoneIndexTable_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
+ipv6ScopeZoneIndexTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipv6ScopeZoneIndexTable container data.
+ */
+} /* ipv6ScopeZoneIndexTable_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
+ipv6ScopeZoneIndexTable_row_prep(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_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;
+} /* ipv6ScopeZoneIndexTable_row_prep */
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h
new file mode 100644
index 0000000..8f98e91
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h
@@ -0,0 +1,70 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:ipv6ScopeZoneIndexTable_data_access.h 14170 2007-04-29 00:12:32Z varun_c$
+ */
+#ifndef IPV6SCOPEZONEINDEXTABLE_DATA_ACCESS_H
+#define IPV6SCOPEZONEINDEXTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6ScopeZoneIndexTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.36, length: 8
+ */
+
+
+ int
+ ipv6ScopeZoneIndexTable_init_data
+ (ipv6ScopeZoneIndexTable_registration *
+ ipv6ScopeZoneIndexTable_reg);
+
+
+ void
+ ipv6ScopeZoneIndexTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ ipv6ScopeZoneIndexTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int
+ ipv6ScopeZoneIndexTable_container_load(netsnmp_container *
+ container);
+ void
+ ipv6ScopeZoneIndexTable_container_free(netsnmp_container *
+ container);
+
+#define MAX_LINE_SIZE 256
+ int
+ ipv6ScopeZoneIndexTable_row_prep(ipv6ScopeZoneIndexTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6SCOPEZONEINDEXTABLE_DATA_ACCESS_H */
diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h
new file mode 100644
index 0000000..a79ec88
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_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:ipv6ScopeZoneIndexTable_enums.h 14170 2007-04-29 00:12:32Z varun_c$
+ */
+#ifndef IPV6SCOPEZONEINDEXTABLE_ENUMS_H
+#define IPV6SCOPEZONEINDEXTABLE_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 ipv6ScopeZoneIndexTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6SCOPEZONEINDEXTABLE_ENUMS_H */
diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c
new file mode 100644
index 0000000..ef2088b
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c
@@ -0,0 +1,1154 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:ipv6ScopeZoneIndexTable_interface.c 14170 2007-04-29 00:12:32Z varun_c$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv6ScopeZoneIndexTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipv6ScopeZoneIndexTable_interface.h"
+
+#include <ctype.h>
+
+netsnmp_feature_child_of(ipv6ScopeZoneIndexTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(table_container_row_insert)
+netsnmp_feature_require(check_all_requests_error)
+
+
+netsnmp_feature_child_of(ipv6ScopeZoneIndexTable_container_size, ipv6ScopeZoneIndexTable_external_access)
+netsnmp_feature_child_of(ipv6ScopeZoneIndexTable_registration_set, ipv6ScopeZoneIndexTable_external_access)
+netsnmp_feature_child_of(ipv6ScopeZoneIndexTable_registration_get, ipv6ScopeZoneIndexTable_external_access)
+netsnmp_feature_child_of(ipv6ScopeZoneIndexTable_container_get, ipv6ScopeZoneIndexTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6ScopeZoneIndexTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.36, length: 8
+ */
+typedef struct ipv6ScopeZoneIndexTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+ ipv6ScopeZoneIndexTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} ipv6ScopeZoneIndexTable_interface_ctx;
+
+static ipv6ScopeZoneIndexTable_interface_ctx
+ ipv6ScopeZoneIndexTable_if_ctx;
+
+static void
+_ipv6ScopeZoneIndexTable_container_init
+(ipv6ScopeZoneIndexTable_interface_ctx * if_ctx);
+static void
+_ipv6ScopeZoneIndexTable_container_shutdown
+(ipv6ScopeZoneIndexTable_interface_ctx * if_ctx);
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic);
+static void
+_cache_free(netsnmp_cache * cache, void *magic);
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_CONTAINER_GET
+netsnmp_container *
+ipv6ScopeZoneIndexTable_container_get(void)
+{
+ return ipv6ScopeZoneIndexTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_REGISTRATION_GET
+ipv6ScopeZoneIndexTable_registration *
+ipv6ScopeZoneIndexTable_registration_get(void)
+{
+ return ipv6ScopeZoneIndexTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_REGISTRATION_SET
+ipv6ScopeZoneIndexTable_registration *
+ipv6ScopeZoneIndexTable_registration_set
+ (ipv6ScopeZoneIndexTable_registration * newreg)
+{
+ ipv6ScopeZoneIndexTable_registration *old =
+ ipv6ScopeZoneIndexTable_if_ctx.user_ctx;
+ ipv6ScopeZoneIndexTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_CONTAINER_SIZE
+int
+ipv6ScopeZoneIndexTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipv6ScopeZoneIndexTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_CONTAINER_SIZE */
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipv6ScopeZoneIndexTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipv6ScopeZoneIndexTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipv6ScopeZoneIndexTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipv6ScopeZoneIndexTable_get_values;
+/**
+ * @internal
+ * Initialize the table ipv6ScopeZoneIndexTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipv6ScopeZoneIndexTable_initialize_interface
+ (ipv6ScopeZoneIndexTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipv6ScopeZoneIndexTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipv6ScopeZoneIndexTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_ipv6ScopeZoneIndexTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipv6ScopeZoneIndexTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipv6ScopeZoneIndexIfIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrieval.
+ */
+ tbl_info->min_column = IPV6SCOPEZONEINDEXTABLE_MIN_COL;
+ tbl_info->max_column = IPV6SCOPEZONEINDEXTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipv6ScopeZoneIndexTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipv6ScopeZoneIndexTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipv6ScopeZoneIndexTable_container_init
+ (&ipv6ScopeZoneIndexTable_if_ctx);
+ if (NULL == ipv6ScopeZoneIndexTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipv6ScopeZoneIndexTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipv6ScopeZoneIndexTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_ipv6ScopeZoneIndexTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_ipv6ScopeZoneIndexTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipv6ScopeZoneIndexTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipv6ScopeZoneIndexTable:init_ipv6ScopeZoneIndexTable",
+ "Registering ipv6ScopeZoneIndexTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipv6ScopeZoneIndexTable",
+ handler,
+ ipv6ScopeZoneIndexTable_oid,
+ ipv6ScopeZoneIndexTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table ipv6ScopeZoneIndexTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipv6ScopeZoneIndexTable_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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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->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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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,
+ ipv6ScopeZoneIndexTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ if (NULL != ipv6ScopeZoneIndexTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(ipv6ScopeZoneIndexTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _ipv6ScopeZoneIndexTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipv6ScopeZoneIndexTable
+ */
+void
+_ipv6ScopeZoneIndexTable_shutdown_interface
+ (ipv6ScopeZoneIndexTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipv6ScopeZoneIndexTable_container_shutdown
+ (&ipv6ScopeZoneIndexTable_if_ctx);
+}
+
+void
+ipv6ScopeZoneIndexTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipv6ScopeZoneIndexTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipv6ScopeZoneIndexTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipv6ScopeZoneIndexTable_index_to_oid(netsnmp_index * oid_idx,
+ ipv6ScopeZoneIndexTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipv6ScopeZoneIndexIfIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipv6ScopeZoneIndexIfIndex, 0x00,
+ sizeof(var_ipv6ScopeZoneIndexIfIndex));
+ var_ipv6ScopeZoneIndexIfIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipv6ScopeZoneIndexIfIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_index_to_oid", "called\n"));
+
+ /*
+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_ipv6ScopeZoneIndexIfIndex,
+ (u_char *) & mib_idx->ipv6ScopeZoneIndexIfIndex,
+ sizeof(mib_idx->ipv6ScopeZoneIndexIfIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipv6ScopeZoneIndexIfIndex);
+ 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_ipv6ScopeZoneIndexIfIndex);
+
+ return err;
+} /* ipv6ScopeZoneIndexTable_index_to_oid */
+
+/**
+ * extract ipv6ScopeZoneIndexTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipv6ScopeZoneIndexTable_index_from_oid(netsnmp_index * oid_idx,
+ ipv6ScopeZoneIndexTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipv6ScopeZoneIndexIfIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipv6ScopeZoneIndexIfIndex, 0x00,
+ sizeof(var_ipv6ScopeZoneIndexIfIndex));
+ var_ipv6ScopeZoneIndexIfIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipv6ScopeZoneIndexIfIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipv6ScopeZoneIndexIfIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipv6ScopeZoneIndexIfIndex =
+ *((long *) var_ipv6ScopeZoneIndexIfIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipv6ScopeZoneIndexIfIndex);
+
+ return err;
+} /* ipv6ScopeZoneIndexTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipv6ScopeZoneIndexTable_rowreq_ctx
+ */
+ipv6ScopeZoneIndexTable_rowreq_ctx *
+ipv6ScopeZoneIndexTable_allocate_rowreq_ctx(ipv6ScopeZoneIndexTable_data *data,
+ void *user_init_ctx)
+{
+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipv6ScopeZoneIndexTable_rowreq_ctx);
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipv6ScopeZoneIndexTable_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 =
+ ipv6ScopeZoneIndexTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->ipv6ScopeZoneIndexTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipv6ScopeZoneIndexTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ ipv6ScopeZoneIndexTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipv6ScopeZoneIndexTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipv6ScopeZoneIndexTable_rowreq_ctx
+ */
+void
+ipv6ScopeZoneIndexTable_release_rowreq_ctx
+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipv6ScopeZoneIndexTable_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))
+ ipv6ScopeZoneIndexTable_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);
+} /* ipv6ScopeZoneIndexTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv6ScopeZoneIndexTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipv6ScopeZoneIndexTable_pre_request
+ (ipv6ScopeZoneIndexTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6ScopeZoneIndexTable", "error %d from "
+ "ipv6ScopeZoneIndexTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6ScopeZoneIndexTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv6ScopeZoneIndexTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx = (ipv6ScopeZoneIndexTable_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipv6ScopeZoneIndexTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = ipv6ScopeZoneIndexTable_post_request
+ (ipv6ScopeZoneIndexTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6ScopeZoneIndexTable", "error %d from "
+ "ipv6ScopeZoneIndexTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6ScopeZoneIndexTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static ipv6ScopeZoneIndexTable_rowreq_ctx *
+_mfd_ipv6ScopeZoneIndexTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx;
+ ipv6ScopeZoneIndexTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_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 = ipv6ScopeZoneIndexTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("ipv6ScopeZoneIndexTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = ipv6ScopeZoneIndexTable_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));
+
+
+ /*
+ * 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_ipv6ScopeZoneIndexTable_rowreq_from_index */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv6ScopeZoneIndexTable_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;
+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx = (ipv6ScopeZoneIndexTable_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipv6ScopeZoneIndexTable_interface_ctx *if_ctx =
+ * (ipv6ScopeZoneIndexTable_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_ipv6ScopeZoneIndexTable_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
+ ipv6ScopeZoneIndexTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipv6ScopeZoneIndexTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6ScopeZoneIndexTable_get_column(ipv6ScopeZoneIndexTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv6ScopeZoneIndexLinkLocal(2)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEXLINKLOCAL:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndexLinkLocal_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndex3(3)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEX3:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndex3_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndexAdminLocal(4)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEXADMINLOCAL:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndexAdminLocal_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndexSiteLocal(5)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEXSITELOCAL:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndexSiteLocal_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndex6(6)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEX6:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndex6_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndex7(7)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEX7:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndex7_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndexOrganizationLocal(8)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEXORGANIZATIONLOCAL:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndexOrganizationLocal_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndex9(9)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEX9:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndex9_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndexA(10)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEXA:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndexA_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndexB(11)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEXB:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndexB_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndexC(12)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEXC:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndexC_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6ScopeZoneIndexD(13)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H
+ */
+ case COLUMN_IPV6SCOPEZONEINDEXD:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6ScopeZoneIndexD_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (IPV6SCOPEZONEINDEXTABLE_MIN_COL <= column
+ && column <= IPV6SCOPEZONEINDEXTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6ScopeZoneIndexTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _ipv6ScopeZoneIndexTable_get_column */
+
+int
+_mfd_ipv6ScopeZoneIndexTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx = (ipv6ScopeZoneIndexTable_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_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 = _ipv6ScopeZoneIndexTable_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_ipv6ScopeZoneIndexTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipv6ScopeZoneIndexTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipv6ScopeZoneIndexTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipv6ScopeZoneIndexTable_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
+_ipv6ScopeZoneIndexTable_container_init
+ (ipv6ScopeZoneIndexTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_ipv6ScopeZoneIndexTable_container_init", "called\n"));
+
+ /*
+ * container init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipv6ScopeZoneIndexTable_oid,
+ ipv6ScopeZoneIndexTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ipScopeZoneIndexTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipv6ScopeZoneIndexTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container) {
+ if_ctx->container =
+ netsnmp_container_find
+ ("ipv6ScopeZoneIndexTable:table_container");
+ if (if_ctx->container)
+ if_ctx->container->container_name =
+ strdup("ipv6ScopeZoneIndexTable");
+ }
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipv6ScopeZoneIndexTable_container_init\n");
+ return;
+ }
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+
+
+} /* _ipv6ScopeZoneIndexTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipv6ScopeZoneIndexTable_container_shutdown
+ (ipv6ScopeZoneIndexTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_ipv6ScopeZoneIndexTable_container_shutdown", "called\n"));
+
+ ipv6ScopeZoneIndexTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipv6ScopeZoneIndexTable_container_shutdown */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_EXTERNAL_ACCESS
+ipv6ScopeZoneIndexTable_rowreq_ctx *
+ipv6ScopeZoneIndexTable_row_find_by_mib_index
+ (ipv6ScopeZoneIndexTable_mib_index * mib_idx)
+{
+ ipv6ScopeZoneIndexTable_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 = ipv6ScopeZoneIndexTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = (ipv6ScopeZoneIndexTable_rowreq_ctx*)
+ CONTAINER_FIND(ipv6ScopeZoneIndexTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IPV6SCOPEZONEINDEXTABLE_EXTERNAL_ACCESS */
+
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:ipScopeZoneIndexTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for ipScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipScopeZoneIndexTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in ipScopeZoneIndexTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h
new file mode 100644
index 0000000..7fc3109
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h
@@ -0,0 +1,98 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:ipv6ScopeZoneIndexTable_interface.h 14170 2007-04-29 00:12:32Z varun_c$
+ */
+/** @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 IPV6SCOPEZONEINDEXTABLE_INTERFACE_H
+#define IPV6SCOPEZONEINDEXTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipv6ScopeZoneIndexTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipv6ScopeZoneIndexTable_initialize_interface
+ (ipv6ScopeZoneIndexTable_registration * user_ctx, u_long flags);
+ void
+ _ipv6ScopeZoneIndexTable_shutdown_interface
+ (ipv6ScopeZoneIndexTable_registration * user_ctx);
+
+ ipv6ScopeZoneIndexTable_registration
+ *ipv6ScopeZoneIndexTable_registration_get(void);
+
+ ipv6ScopeZoneIndexTable_registration
+ *ipv6ScopeZoneIndexTable_registration_set
+ (ipv6ScopeZoneIndexTable_registration * newreg);
+
+ netsnmp_container *ipv6ScopeZoneIndexTable_container_get(void);
+ int ipv6ScopeZoneIndexTable_container_size(void);
+
+ ipv6ScopeZoneIndexTable_rowreq_ctx
+ *ipv6ScopeZoneIndexTable_allocate_rowreq_ctx(ipv6ScopeZoneIndexTable_data *, void *);
+ void
+ ipv6ScopeZoneIndexTable_release_rowreq_ctx
+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx);
+
+ int ipv6ScopeZoneIndexTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipv6ScopeZoneIndexTable_mib_index
+ * mib_idx);
+ int ipv6ScopeZoneIndexTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipv6ScopeZoneIndexTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ ipv6ScopeZoneIndexTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6SCOPEZONEINDEXTABLE_INTERFACE_H */
+/** @} */
diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h
new file mode 100644
index 0000000..134daa2
--- /dev/null
+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h
@@ -0,0 +1,55 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:ipv6ScopeZoneIndexTable_oids.h 14170 2007-04-29 00:12:32Z varun_c$
+ */
+#ifndef IPV6SCOPEZONEINDEXTABLE_OIDS_H
+#define IPV6SCOPEZONEINDEXTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipv6ScopeZoneIndexTable
+ */
+#define IPV6SCOPEZONEINDEXTABLE_OID 1,3,6,1,2,1,4,36
+
+#define COLUMN_IPV6SCOPEZONEINDEXIFINDEX 1
+
+#define COLUMN_IPV6SCOPEZONEINDEXLINKLOCAL 2
+
+#define COLUMN_IPV6SCOPEZONEINDEX3 3
+
+#define COLUMN_IPV6SCOPEZONEINDEXADMINLOCAL 4
+
+#define COLUMN_IPV6SCOPEZONEINDEXSITELOCAL 5
+
+#define COLUMN_IPV6SCOPEZONEINDEX6 6
+
+#define COLUMN_IPV6SCOPEZONEINDEX7 7
+
+#define COLUMN_IPV6SCOPEZONEINDEXORGANIZATIONLOCAL 8
+
+#define COLUMN_IPV6SCOPEZONEINDEX9 9
+
+#define COLUMN_IPV6SCOPEZONEINDEXA 10
+
+#define COLUMN_IPV6SCOPEZONEINDEXB 11
+
+#define COLUMN_IPV6SCOPEZONEINDEXC 12
+
+#define COLUMN_IPV6SCOPEZONEINDEXD 13
+
+
+#define IPV6SCOPEZONEINDEXTABLE_MIN_COL COLUMN_IPV6SCOPEZONEINDEXLINKLOCAL
+#define IPV6SCOPEZONEINDEXTABLE_MAX_COL COLUMN_IPV6SCOPEZONEINDEXD
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6SCOPEZONEINDEXTABLE_OIDS_H */
diff --git a/agent/mibgroup/ipfwchains/README b/agent/mibgroup/ipfwchains/README
new file mode 100644
index 0000000..34088c1
--- /dev/null
+++ b/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/agent/mibgroup/kernel_sunos5.c b/agent/mibgroup/kernel_sunos5.c
new file mode 100644
index 0000000..9ee0284
--- /dev/null
+++ b/agent/mibgroup/kernel_sunos5.c
@@ -0,0 +1,2079 @@
+/* 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 <ctype.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, 50 * 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
+#ifdef SOLARIS_HAVE_RFC4293_SUPPORT
+ {MIB_IP_TRAFFIC_STATS, 20 * sizeof(mib2_ipIfStatsEntry_t), (void *)-1, 0,
+ 30, 0, 0},
+ {MIB_IP6, 20 * sizeof(mib2_ipIfStatsEntry_t), (void *)-1, 0, 30, 0, 0},
+#else
+ {MIB_IP6, 20 * sizeof(mib2_ipv6IfStatsEntry_t), (void *)-1, 0, 30, 0, 0},
+#endif
+ {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
+#ifdef MIB2_SCTP
+ {MIB_SCTP, sizeof(mib2_sctp_t), (void *)-1, 0, 60, 0, 0},
+ {MIB_SCTP_CONN, sizeof(mib2_sctpConnEntry_t), (void *)-1, 0, 60, 0, 0},
+ {MIB_SCTP_CONN_LOCAL, sizeof(mib2_sctpConnLocalEntry_t), (void *)-1, 0,
+ 60, 0, 0},
+ {MIB_SCTP_CONN_REMOTE, sizeof(mib2_sctpConnRemoteEntry_t), (void *)-1, 0,
+ 60, 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
+#ifdef SOLARIS_HAVE_RFC4293_SUPPORT
+ {MIB2_IP, MIB2_IP_TRAFFIC_STATS},
+#endif
+ {MIB2_IP6, 0},
+ {MIB2_IP6, MIB2_IP6_ADDR},
+ {MIB2_TCP6, MIB2_TCP6_CONN},
+ {MIB2_UDP6, MIB2_UDP6_ENTRY},
+#endif
+#ifdef MIB2_SCTP
+ {MIB2_SCTP, 0},
+ {MIB2_SCTP, MIB2_SCTP_CONN},
+ {MIB2_SCTP, MIB2_SCTP_CONN_LOCAL},
+ {MIB2_SCTP, MIB2_SCTP_CONN_REMOTE},
+#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, (int)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;
+ uint_t i;
+ int instance = 0;
+ 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;
+ strlcpy(buf, d->value.c, sizeof(buf));
+ 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", (long)d->value.i64));
+ break;
+ case KSTAT_DATA_UINT64:
+ *(uint64_t *)v = d->value.ui64;
+ DEBUGMSGTL(("kernel_sunos5", "value: %lu\n", (unsigned long)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 = 0;
+ 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:
+ strlcpy(value, d->value.c, value_len);
+ 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, (int)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, (int)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",
+ (int)len, (int)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;
+ size_t oldsize;
+
+ 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;
+ /*
+ * non-zero len field is used to request extended MIB statistics
+ * on Solaris 10 Update 4 and later. The LEGACY_MIB_SIZE macro is only
+ * available for S10U4+, so we use that to see what action to take.
+ */
+#ifdef LEGACY_MIB_SIZE
+ req->len = 1; /* ask for extended MIBs */
+#else
+ req->len = 0;
+#endif
+ 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:
+ oldsize = ( ((void *)strbuf.buf) - *statbuf) + strbuf.len;
+ strbuf.buf = (void *)realloc(*statbuf,oldsize+4096);
+ if(strbuf.buf != NULL) {
+ *statbuf = strbuf.buf;
+ *size = oldsize + 4096;
+ strbuf.buf = *statbuf + oldsize;
+ strbuf.maxlen = 4096;
+ break;
+ }
+ strbuf.buf = *statbuf + (oldsize - strbuf.len);
+ case 0:
+ /* fix buffer to real size & position */
+ strbuf.len += ((void *)strbuf.buf) - *statbuf;
+ strbuf.buf = *statbuf;
+ strbuf.maxlen = *size;
+
+ 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);
+
+ DEBUGMSGTL(("kernel_sunos5", "...... getmib buffer size is %d\n", (int)*size));
+
+ 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", (unsigned)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",
+ (unsigned)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 %ld, error %ld\n",
+ (long)errp->dl_errno, (long)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", (unsigned)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] & 0xFF)) {
+ 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);
+
+ /* some? VLAN interfaces don't have error counters, so ignore failure */
+ getKstatInt(NULL, name, "ierrors", &ifp->ifInErrors);
+ getKstatInt(NULL, name, "oerrors", &ifp->ifOutErrors);
+
+ /* 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/agent/mibgroup/kernel_sunos5.h b/agent/mibgroup/kernel_sunos5.h
new file mode 100644
index 0000000..0bffcb9
--- /dev/null
+++ b/agent/mibgroup/kernel_sunos5.h
@@ -0,0 +1,224 @@
+/*- 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
+#ifdef SOLARIS_HAVE_RFC4293_SUPPORT
+ MIB_IP_TRAFFIC_STATS,
+#endif
+ MIB_IP6,
+ MIB_IP6_ADDR,
+ MIB_TCP6_CONN,
+ MIB_UDP6_ENDPOINT,
+#endif
+#ifdef MIB2_SCTP
+ MIB_SCTP,
+ MIB_SCTP_CONN,
+ MIB_SCTP_CONN_LOCAL,
+ MIB_SCTP_CONN_REMOTE,
+#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/agent/mibgroup/mibII.h b/agent/mibgroup/mibII.h
new file mode 100644
index 0000000..1b94a59
--- /dev/null
+++ b/agent/mibgroup/mibII.h
@@ -0,0 +1,47 @@
+/*
+ * 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_version_require((mibII/snmp_mib, 5.5, mibII/snmp_mib_5_5))
+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(netbsd1) || defined(openbsd4))
+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)
+#elif defined(solaris2)
+config_require(tcp-mib udp-mib)
+#elif defined(freebsd4) || defined(dragonfly)
+config_require(tcp-mib udp-mib)
+#elif defined(openbsd4)
+config_require(tcp-mib udp-mib)
+#elif defined(netbsd1)
+config_require(tcp-mib udp-mib)
+#endif
+
+/*
+ * For Solaris, enable additional tables when it has extended MIB support.
+ */
+#if defined( solaris2 ) && defined( HAVE_MIB2_IPIFSTATSENTRY_T )
+config_require(ip-mib/ipSystemStatsTable ip-mib/ipAddressTable)
+#endif
diff --git a/agent/mibgroup/mibII/at.c b/agent/mibgroup/mibII/at.c
new file mode 100644
index 0000000..e968074
--- /dev/null
+++ b/agent/mibgroup/mibII/at.c
@@ -0,0 +1,1279 @@
+/*
+ * 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(NETSNMP_IFNET_NEEDS_KERNEL) && !defined(_KERNEL)
+#define _KERNEL 1
+#define _I_DEFINED_KERNEL
+#endif
+#include <sys/types.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_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
+
+#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(in_addr_t *, char *, int *, u_long *, u_short *);
+#else
+static int ARP_Scan_Next(in_addr_t *, char *, int *, 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, NETSNMP_OLDAPI_RONLY,
+ var_atEntry, 1, {1}},
+ {ATPHYSADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_atEntry, 1, {2}},
+ {ATNETADDRESS, ASN_IPADDRESS, NETSNMP_OLDAPI_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[MAX_MAC_ADDR_LEN], LowPhysAddr[MAX_MAC_ADDR_LEN];
+ static int PhysAddrLen, LowPhysAddrLen;
+ in_addr_t Addr, LowAddr;
+ int 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, &PhysAddrLen, &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, &PhysAddrLen, &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));
+ LowPhysAddrLen = PhysAddrLen;
+ 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));
+ LowPhysAddrLen = PhysAddrLen;
+ lowIfType = ifType;
+ }
+ }
+ }
+ if (foundone == 0)
+ return (NULL);
+
+ memcpy((char *) name, (char *) lowest, oid_length * sizeof(oid));
+ *length = oid_length;
+ *write_method = (WriteMethod*)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 = LowPhysAddrLen;
+ 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",
+ (unsigned long)mp->ipNetToMediaNetAddress,
+ (unsigned long)((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 = 0;
+ 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 HAVE_STRUCT_ARPHD_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);
+ memset(at, 0, ulen);
+ p.objid = ID_ipNetToMediaTable;
+ p.buffer = (void *) at;
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) < 0)
+ arptab_size = 0;
+ else
+ arptab_size = *p.len / sizeof(mib_ipNetToMediaEnt);
+ }
+
+ 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 HAVE_STRUCT_ARPHD_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 HAVE_STRUCT_ARPHD_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, j;
+ char line[128];
+ int za, zb, zc, zd;
+ char ifname[21];
+ char mac[3*MAX_MAC_ADDR_LEN+1];
+ char *tok;
+
+ 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;
+ unsigned 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 (7 !=
+ sscanf(line,
+ "%d.%d.%d.%d 0x%*x 0x%x %s %*[^ ] %20s\n",
+ &za, &zb, &zc, &zd, &tmp_flags, mac, 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;
+ 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);
+
+ for (j=0,tok=strtok(mac, ":"); tok != NULL; tok=strtok(NULL, ":"),j++) {
+ at[i].at_enaddr[j] = strtol(tok, NULL, 16);
+ }
+ at[i].at_enaddr_len = j;
+ 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;
+#if defined RTF_LLINFO
+ mib[5] = RTF_LLINFO;
+#else
+ mib[5] = 0;
+#endif
+
+ 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(in_addr_t * IPAddr, char *PhysAddr, int *PhysAddrLen,
+ u_long * ifType, u_short * ifIndex)
+#else
+static int
+ARP_Scan_Next(in_addr_t * IPAddr, char *PhysAddr, int *PhysAddrLen,
+ 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));
+ *PhysAddrLen = at[arptab_current].at_enaddr_len;
+
+ /*
+ * 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;
+ *PhysAddrLen = at[arptab_current].PhysAddr.o_length;
+ /*
+ * 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 HAVE_STRUCT_ARPHD_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 /* HAVE_STRUCT_ARPHD_AT_NEXT */
+ atab = &at[arptab_current++];
+#endif /* HAVE_STRUCT_ARPHD_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));
+ *PhysAddrLen = sizeof(atab->at_enaddr);
+#endif
+#if defined(mips) || defined(ibm032)
+ memcpy(PhysAddr, (char *) atab->at_enaddr,
+ sizeof(atab->at_enaddr));
+ *PhysAddrLen = 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);
+ *PhysAddrLen = sdl->sdl_alen;
+ *ifIndex = sdl->sdl_index;
+ *ifType = 1; /* XXX */
+ return (1);
+ }
+ }
+ return (0); /* "EOF" */
+#endif /* !NETSNMP_CAN_USE_SYSCTL */
+}
+#endif /* solaris2 */
+
+#elif defined(HAVE_IPHLPAPI_H) /* 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;
+ int j;
+ u_char dest_addr[4];
+ void *result = NULL;
+ 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 = malloc(dwActualSize);
+ if (pIpNetTable)
+ status = GetIpNetTable(pIpNetTable, &dwActualSize, TRUE);
+ }
+
+ i = -1;
+
+ 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 */
+ j = 11;
+ } else { /* at Table */
+
+ j = 12;
+ }
+
+ dest_addr[0] = (u_char) name[j];
+ dest_addr[1] = (u_char) name[j + 1];
+ dest_addr[2] = (u_char) name[j + 2];
+ dest_addr[3] = (u_char) name[j + 3];
+ arp_row->dwAddr = *((DWORD *) dest_addr);
+
+ arp_row->dwType = 4; /* Static */
+ arp_row->dwPhysAddrLen = 0;
+ }
+ goto out;
+ }
+
+ create_flag = 0;
+ memcpy((char *) name, (char *) lowest, oid_length * sizeof(oid));
+ *length = oid_length;
+ *write_method = write_arp;
+ netsnmp_assert(0 <= i && i < pIpNetTable->dwNumEntries);
+ *arp_row = pIpNetTable->table[i];
+
+ switch (vp->magic) {
+ case IPMEDIAIFINDEX: /* also ATIFINDEX */
+ *var_len = sizeof long_return;
+ long_return = pIpNetTable->table[i].dwIndex;
+ result = &long_return;
+ break;
+ case IPMEDIAPHYSADDRESS: /* also ATPHYSADDRESS */
+ *var_len = pIpNetTable->table[i].dwPhysAddrLen;
+ memcpy(return_buf, pIpNetTable->table[i].bPhysAddr, *var_len);
+ result = return_buf;
+ break;
+ case IPMEDIANETADDRESS: /* also ATNETADDRESS */
+ *var_len = sizeof(addr_ret);
+ addr_ret = pIpNetTable->table[i].dwAddr;
+ result = &addr_ret;
+ break;
+ case IPMEDIATYPE:
+ *var_len = sizeof long_return;
+ long_return = pIpNetTable->table[i].dwType;
+ result = &long_return;
+ break;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_atEntry\n",
+ vp->magic));
+ break;
+ }
+out:
+ free(pIpNetTable);
+ return result;
+}
+
+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 : %lu\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 : %lu\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 %lu\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/agent/mibgroup/mibII/at.h b/agent/mibgroup/mibII/at.h
new file mode 100644
index 0000000..5bee2eb
--- /dev/null
+++ b/agent/mibgroup/mibII/at.h
@@ -0,0 +1,49 @@
+/*
+ * 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 */
+
+/* InfiniBand uses HW addr > 6 */
+#define MAX_MAC_ADDR_LEN 32
+
+#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[MAX_MAC_ADDR_LEN];
+ int at_enaddr_len;
+ struct in_addr at_iaddr;
+ int if_index;
+ };
+#endif
+#endif /* _MIBGROUP_AT_H */
diff --git a/agent/mibgroup/mibII/icmp.c b/agent/mibgroup/mibII/icmp.c
new file mode 100644
index 0000000..14c73a6
--- /dev/null
+++ b/agent/mibgroup/mibII/icmp.c
@@ -0,0 +1,1433 @@
+/*
+ * 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
+
+#ifdef NETSNMP_ENABLE_IPV6
+#if HAVE_NETINET_ICMP6_H
+#include <netinet/icmp6.h>
+#endif
+#endif /* NETSNMP_ENABLE_IPV6 */
+
+#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 <net-snmp/agent/sysORTable.h>
+
+#include "util_funcs/MIB_STATS_CACHE_TIMEOUT.h"
+#include "icmp.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
+
+/* redefine ICMP6 message types from glibc < 2.4 to newer names */
+#ifndef MLD_LISTENER_QUERY
+#define MLD_LISTENER_QUERY ICMP6_MEMBERSHIP_QUERY
+#define MLD_LISTENER_REPORT ICMP6_MEMBERSHIP_REPORT
+#define MLD_LISTENER_REDUCTION ICMP6_MEMBERSHIP_REDUCTION
+#endif /* ICMP6_MEMBERSHIP_QUERY */
+
+
+#if defined(HAVE_LIBPERFSTAT_H) && (defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)) && !defined(FIRST_PROTOCOL)
+#ifdef HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#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
+ */
+static const oid icmp_oid[] = { SNMP_OID_MIB2, 5 };
+static const oid icmp_stats_tbl_oid[] = { SNMP_OID_MIB2, 5, 29 };
+static const oid icmp_msg_stats_tbl_oid[] = { SNMP_OID_MIB2, 5, 30 };
+#ifdef USING_MIBII_IP_MODULE
+extern oid ip_module_oid[];
+extern int ip_module_oid_len;
+extern int ip_module_count;
+#endif
+
+#ifdef linux
+struct icmp_stats_table_entry {
+ uint32_t ipVer;
+ uint32_t icmpStatsInMsgs;
+ uint32_t icmpStatsInErrors;
+ uint32_t icmpStatsOutMsgs;
+ uint32_t icmpStatsOutErrors;
+};
+
+struct icmp_stats_table_entry icmp_stats_table[2];
+
+#define ICMP_MSG_STATS_HAS_IN 1
+#define ICMP_MSG_STATS_HAS_OUT 2
+
+struct icmp_msg_stats_table_entry {
+ uint32_t ipVer;
+ uint32_t icmpMsgStatsType;
+ uint32_t icmpMsgStatsInPkts;
+ uint32_t icmpMsgStatsOutPkts;
+ int flags;
+};
+
+#define ICMP_MSG_STATS_IPV4_COUNT 11
+
+#ifdef NETSNMP_ENABLE_IPV6
+#define ICMP_MSG_STATS_IPV6_COUNT 14
+#else
+#define ICMP_MSG_STATS_IPV6_COUNT 0
+#endif /* NETSNMP_ENABLE_IPV6 */
+
+struct icmp_msg_stats_table_entry icmp_msg_stats_table[ICMP_MSG_STATS_IPV4_COUNT + ICMP_MSG_STATS_IPV6_COUNT];
+
+int
+icmp_stats_load(netsnmp_cache *cache, void *vmagic)
+{
+
+ /*
+ * note don't bother using the passed in cache
+ * and vmagic pointers. They are useless as they
+ * currently point to the icmp system stats cache
+ * since I see little point in registering another
+ * cache for this table. Its not really needed
+ */
+
+ int i;
+ struct icmp_mib v4icmp;
+ struct icmp6_mib v6icmp;
+ for(i=0;i<2;i++) {
+ switch(i) {
+ case 0:
+ linux_read_icmp_stat(&v4icmp);
+ icmp_stats_table[i].icmpStatsInMsgs = v4icmp.icmpInMsgs;
+ icmp_stats_table[i].icmpStatsInErrors = v4icmp.icmpInErrors;
+ icmp_stats_table[i].icmpStatsOutMsgs = v4icmp.icmpOutMsgs;
+ icmp_stats_table[i].icmpStatsOutErrors = v4icmp.icmpOutErrors;
+ break;
+ default:
+ memset(&icmp_stats_table[i],0,
+ sizeof(struct icmp_stats_table_entry));
+ linux_read_icmp6_stat(&v6icmp);
+ icmp_stats_table[i].icmpStatsInMsgs = v6icmp.icmp6InMsgs;
+ icmp_stats_table[i].icmpStatsInErrors = v6icmp.icmp6InErrors;
+ icmp_stats_table[i].icmpStatsOutMsgs = v6icmp.icmp6OutMsgs;
+ icmp_stats_table[i].icmpStatsOutErrors = v6icmp.icmp6OutDestUnreachs +
+ v6icmp.icmp6OutPktTooBigs + v6icmp.icmp6OutTimeExcds +
+ v6icmp.icmp6OutParmProblems;
+ break;
+ }
+ icmp_stats_table[i].ipVer=i+1;
+ }
+
+ return 0;
+}
+
+int
+icmp_msg_stats_load(netsnmp_cache *cache, void *vmagic)
+{
+ struct icmp_mib v4icmp;
+ struct icmp4_msg_mib v4icmpmsg;
+#ifdef NETSNMP_ENABLE_IPV6
+ struct icmp6_mib v6icmp;
+ struct icmp6_msg_mib v6icmpmsg;
+#endif
+ int i, j, k, flag, inc;
+
+ memset(&icmp_msg_stats_table, 0, sizeof(icmp_msg_stats_table));
+
+ i = 0;
+ flag = 0;
+ k = 0;
+ inc = 0;
+ linux_read_icmp_msg_stat(&v4icmp, &v4icmpmsg, &flag);
+ if (flag) {
+ while (254 != k) {
+ if (v4icmpmsg.vals[k].InType) {
+ icmp_msg_stats_table[i].ipVer = 1;
+ icmp_msg_stats_table[i].icmpMsgStatsType = k;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmpmsg.vals[k].InType;
+ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_IN;
+ inc = 1; /* Set this if we found a valid entry */
+ }
+ if (v4icmpmsg.vals[k].OutType) {
+ icmp_msg_stats_table[i].ipVer = 1;
+ icmp_msg_stats_table[i].icmpMsgStatsType = k;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmpmsg.vals[k].OutType;
+ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_OUT;
+ inc = 1; /* Set this if we found a valid entry */
+ }
+ if (inc) {
+ i++;
+ inc = 0;
+ }
+ k++;
+ }
+ } else {
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_ECHOREPLY;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInEchoReps;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutEchoReps;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_DEST_UNREACH;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInDestUnreachs;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutDestUnreachs;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_SOURCE_QUENCH;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInSrcQuenchs;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutSrcQuenchs;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_REDIRECT;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInRedirects;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutRedirects;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_ECHO;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInEchos;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutEchos;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_TIME_EXCEEDED;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInTimeExcds;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutTimeExcds;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_PARAMETERPROB;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInParmProbs;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutParmProbs;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_TIMESTAMP;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInTimestamps;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutTimestamps;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_TIMESTAMPREPLY;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInTimestampReps;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutTimestampReps;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_ADDRESS;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInAddrMasks;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutAddrMasks;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_ADDRESSREPLY;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInAddrMaskReps;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutAddrMaskReps;
+ i++;
+
+ /* set the IP version and default flags */
+ for (j = 0; j < ICMP_MSG_STATS_IPV4_COUNT; j++) {
+ icmp_msg_stats_table[j].ipVer = 1;
+ icmp_msg_stats_table[j].flags = ICMP_MSG_STATS_HAS_IN | ICMP_MSG_STATS_HAS_OUT;
+ }
+ }
+
+#ifdef NETSNMP_ENABLE_IPV6
+ flag = 0;
+ k = 0;
+ inc = 0;
+ linux_read_icmp6_msg_stat(&v6icmp, &v6icmpmsg, &flag);
+ if (flag) {
+ while (254 != k) {
+ if (v6icmpmsg.vals[k].InType) {
+ icmp_msg_stats_table[i].ipVer = 2;
+ icmp_msg_stats_table[i].icmpMsgStatsType = k;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmpmsg.vals[k].InType;
+ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_IN;
+ inc = 1; /* Set this if we found a valid entry */
+ }
+ if (v6icmpmsg.vals[k].OutType) {
+ icmp_msg_stats_table[i].ipVer = 2;
+ icmp_msg_stats_table[i].icmpMsgStatsType = k;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmpmsg.vals[k].OutType;
+ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_OUT;
+ inc = 1; /* Set this if we found a valid entry */
+ }
+ if (inc) {
+ i++;
+ inc = 0;
+ }
+ k++;
+ }
+ } else {
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_DST_UNREACH;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InDestUnreachs;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutDestUnreachs;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_PACKET_TOO_BIG;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InPktTooBigs;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutPktTooBigs;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_TIME_EXCEEDED;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InTimeExcds;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutTimeExcds;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_PARAM_PROB;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InParmProblems;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutParmProblems;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_ECHO_REQUEST;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InEchos;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = 0;
+ icmp_msg_stats_table[i].flags = ICMP_MSG_STATS_HAS_IN;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_ECHO_REPLY;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InEchoReplies;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutEchoReplies;
+ i++;
+
+#ifdef MLD_LISTENER_QUERY
+ icmp_msg_stats_table[i].icmpMsgStatsType = MLD_LISTENER_QUERY;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InGroupMembQueries;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = 0;
+ icmp_msg_stats_table[i].flags = ICMP_MSG_STATS_HAS_IN;
+ i++;
+ icmp_msg_stats_table[i].icmpMsgStatsType = MLD_LISTENER_REPORT;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InGroupMembResponses;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutGroupMembResponses;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = MLD_LISTENER_REDUCTION;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InGroupMembReductions;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutGroupMembReductions;
+ i++;
+#endif
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_ROUTER_SOLICIT;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InRouterSolicits;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutRouterSolicits;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_ROUTER_ADVERT;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InRouterAdvertisements;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = 0;
+ icmp_msg_stats_table[i].flags = ICMP_MSG_STATS_HAS_IN;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_NEIGHBOR_SOLICIT;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InNeighborSolicits;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutNeighborSolicits;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_NEIGHBOR_ADVERT;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InNeighborAdvertisements;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutNeighborAdvertisements;
+ i++;
+
+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_REDIRECT;
+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InRedirects;
+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutRedirects;
+
+ for (j = 0; j < ICMP_MSG_STATS_IPV6_COUNT; j++) {
+ icmp_msg_stats_table[ICMP_MSG_STATS_IPV4_COUNT + j].ipVer = 2;
+ icmp_msg_stats_table[ICMP_MSG_STATS_IPV4_COUNT + j].flags = ICMP_MSG_STATS_HAS_IN | ICMP_MSG_STATS_HAS_OUT;
+ }
+ }
+#endif /* NETSNMP_ENABLE_IPV6 */
+ return 0;
+}
+
+netsnmp_variable_list *
+icmp_stats_next_entry( void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ int i = (int)(intptr_t)(*loop_context);
+ netsnmp_variable_list *idx = index;
+
+ if(i > 1)
+ return NULL;
+
+
+ /*
+ *set IP version
+ */
+ snmp_set_var_typed_value(idx, ASN_INTEGER, (u_char *)&icmp_stats_table[i].ipVer,
+ sizeof(uint32_t));
+ idx = idx->next_variable;
+
+ *data_context = &icmp_stats_table[i];
+
+ *loop_context = (void *)(intptr_t)(++i);
+
+ return index;
+}
+
+
+netsnmp_variable_list *
+icmp_stats_first_entry( void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+
+ *loop_context = NULL;
+ *data_context = NULL;
+ return icmp_stats_next_entry(loop_context, data_context, index, data);
+}
+
+netsnmp_variable_list *
+icmp_msg_stats_next_entry(void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ int i = (int)(intptr_t)(*loop_context);
+ netsnmp_variable_list *idx = index;
+
+ if(i >= ICMP_MSG_STATS_IPV4_COUNT + ICMP_MSG_STATS_IPV6_COUNT)
+ return NULL;
+
+ /* set IP version */
+ snmp_set_var_typed_value(idx, ASN_INTEGER,
+ (u_char *)&icmp_msg_stats_table[i].ipVer,
+ sizeof(uint32_t));
+
+ /* set packet type */
+ idx = idx->next_variable;
+ snmp_set_var_typed_value(idx, ASN_INTEGER,
+ (u_char *)&icmp_msg_stats_table[i].icmpMsgStatsType,
+ sizeof(uint32_t));
+
+ *data_context = &icmp_msg_stats_table[i];
+ *loop_context = (void *)(intptr_t)(++i);
+
+ return index;
+}
+
+
+netsnmp_variable_list *
+icmp_msg_stats_first_entry(void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ *loop_context = NULL;
+ *data_context = NULL;
+ return icmp_msg_stats_next_entry(loop_context, data_context, index, data);
+}
+#endif
+
+void
+init_icmp(void)
+{
+#ifdef linux
+ netsnmp_handler_registration *msg_stats_reginfo = NULL;
+ netsnmp_handler_registration *table_reginfo = NULL;
+ netsnmp_iterator_info *iinfo;
+ netsnmp_iterator_info *msg_stats_iinfo;
+ netsnmp_table_registration_info *table_info;
+ netsnmp_table_registration_info *msg_stats_table_info;
+#endif
+ netsnmp_handler_registration *scalar_reginfo = NULL;
+ int rc;
+
+ /*
+ * register ourselves with the agent as a group of scalars...
+ */
+ DEBUGMSGTL(("mibII/icmp", "Initialising ICMP group\n"));
+ scalar_reginfo = netsnmp_create_handler_registration("icmp", icmp_handler,
+ icmp_oid, OID_LENGTH(icmp_oid), HANDLER_CAN_RONLY);
+ rc = netsnmp_register_scalar_group(scalar_reginfo, ICMPINMSGS, ICMPOUTADDRMASKREPS);
+ if (rc != SNMPERR_SUCCESS)
+ return;
+ /*
+ * .... with a local cache
+ * (except for HP-UX 11, which extracts objects individually)
+ */
+#ifndef hpux11
+ rc = netsnmp_inject_handler( scalar_reginfo,
+ netsnmp_get_cache_handler(ICMP_STATS_CACHE_TIMEOUT,
+ icmp_load, icmp_free,
+ icmp_oid, OID_LENGTH(icmp_oid)));
+ if (rc != SNMPERR_SUCCESS)
+ goto bail;
+#endif
+#ifdef linux
+
+ /* register icmpStatsTable */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (!table_info)
+ goto bail;
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, 0);
+ table_info->min_column = ICMP_STAT_INMSG;
+ table_info->max_column = ICMP_STAT_OUTERR;
+
+
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ if (!iinfo)
+ goto bail;
+ iinfo->get_first_data_point = icmp_stats_first_entry;
+ iinfo->get_next_data_point = icmp_stats_next_entry;
+ iinfo->table_reginfo = table_info;
+
+ table_reginfo = netsnmp_create_handler_registration("icmpStatsTable",
+ icmp_stats_table_handler, icmp_stats_tbl_oid,
+ OID_LENGTH(icmp_stats_tbl_oid), HANDLER_CAN_RONLY);
+
+ rc = netsnmp_register_table_iterator2(table_reginfo, iinfo);
+ if (rc != SNMPERR_SUCCESS) {
+ table_reginfo = NULL;
+ goto bail;
+ }
+ netsnmp_inject_handler( table_reginfo,
+ netsnmp_get_cache_handler(ICMP_STATS_CACHE_TIMEOUT,
+ icmp_load, icmp_free,
+ icmp_stats_tbl_oid, OID_LENGTH(icmp_stats_tbl_oid)));
+
+ /* register icmpMsgStatsTable */
+ msg_stats_table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (!msg_stats_table_info)
+ goto bail;
+ netsnmp_table_helper_add_indexes(msg_stats_table_info, ASN_INTEGER, ASN_INTEGER, 0);
+ msg_stats_table_info->min_column = ICMP_MSG_STAT_IN_PKTS;
+ msg_stats_table_info->max_column = ICMP_MSG_STAT_OUT_PKTS;
+
+ msg_stats_iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ if (!msg_stats_iinfo)
+ goto bail;
+ msg_stats_iinfo->get_first_data_point = icmp_msg_stats_first_entry;
+ msg_stats_iinfo->get_next_data_point = icmp_msg_stats_next_entry;
+ msg_stats_iinfo->table_reginfo = msg_stats_table_info;
+
+ msg_stats_reginfo = netsnmp_create_handler_registration("icmpMsgStatsTable",
+ icmp_msg_stats_table_handler, icmp_msg_stats_tbl_oid,
+ OID_LENGTH(icmp_msg_stats_tbl_oid), HANDLER_CAN_RONLY);
+
+ rc = netsnmp_register_table_iterator2(msg_stats_reginfo, msg_stats_iinfo);
+ if (rc != SNMPERR_SUCCESS) {
+ msg_stats_reginfo = NULL;
+ goto bail;
+ }
+
+ netsnmp_inject_handler( msg_stats_reginfo,
+ netsnmp_get_cache_handler(ICMP_STATS_CACHE_TIMEOUT,
+ icmp_load, icmp_free,
+ icmp_msg_stats_tbl_oid, OID_LENGTH(icmp_msg_stats_tbl_oid)));
+#endif /* linux */
+
+#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
+ return;
+
+#ifndef hpux11
+bail:
+#endif
+#ifdef linux
+ if (msg_stats_reginfo)
+ netsnmp_handler_registration_free(msg_stats_reginfo);
+ if (table_reginfo)
+ netsnmp_handler_registration_free(table_reginfo);
+#endif
+ if (scalar_reginfo)
+ netsnmp_handler_registration_free(scalar_reginfo);
+}
+
+
+ /*********************
+ *
+ * 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
+
+#ifdef NETBSD_STATS_VIA_SYSCTL
+#define ICMP_STAT_STRUCTURE struct icmp_mib
+#define USES_SNMP_DESIGNED_ICMPSTAT
+#undef ICMP_NSTATS
+#endif
+
+#ifdef HAVE_IPHLPAPI_H
+#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.
+ */
+#if defined(_USE_PERFSTAT_PROTOCOL)
+ icmp_load(NULL, NULL);
+#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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ snmp_log(LOG_WARNING, "mibII/icmp: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+#ifdef linux
+int
+icmp_stats_table_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;
+ struct icmp_stats_table_entry *entry;
+ oid subid;
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ requestvb = request->requestvb;
+ entry = (struct icmp_stats_table_entry *)netsnmp_extract_iterator_context(request);
+ if (!entry)
+ continue;
+ table_info = netsnmp_extract_table_info(request);
+ subid = table_info->colnum;
+
+ switch (subid) {
+ case ICMP_STAT_INMSG:
+ snmp_set_var_typed_value(requestvb, ASN_COUNTER,
+ (u_char *)&entry->icmpStatsInMsgs, sizeof(uint32_t));
+ break;
+ case ICMP_STAT_INERR:
+ snmp_set_var_typed_value(requestvb, ASN_COUNTER,
+ (u_char *)&entry->icmpStatsInErrors, sizeof(uint32_t));
+ break;
+ case ICMP_STAT_OUTMSG:
+ snmp_set_var_typed_value(requestvb, ASN_COUNTER,
+ (u_char *)&entry->icmpStatsOutMsgs, sizeof(uint32_t));
+ break;
+ case ICMP_STAT_OUTERR:
+ snmp_set_var_typed_value(requestvb, ASN_COUNTER,
+ (u_char *)&entry->icmpStatsOutErrors, sizeof(uint32_t));
+ break;
+ default:
+ snmp_log(LOG_WARNING, "mibII/icmpStatsTable: Unrecognised column (%d)\n",(int)subid);
+ }
+ }
+ break;
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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/icmpStatsTable: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ snmp_log(LOG_WARNING, "mibII/icmpStatsTable: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ break;
+
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+icmp_msg_stats_table_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;
+ struct icmp_msg_stats_table_entry *entry;
+ oid subid;
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ requestvb = request->requestvb;
+ entry = (struct icmp_msg_stats_table_entry *)netsnmp_extract_iterator_context(request);
+ if (!entry)
+ continue;
+ table_info = netsnmp_extract_table_info(request);
+ subid = table_info->colnum;
+
+ switch (subid) {
+ case ICMP_MSG_STAT_IN_PKTS:
+ if (entry->flags & ICMP_MSG_STATS_HAS_IN) {
+ snmp_set_var_typed_value(requestvb, ASN_COUNTER,
+ (u_char *)&entry->icmpMsgStatsInPkts, sizeof(uint32_t));
+ } else {
+ requestvb->type = SNMP_NOSUCHINSTANCE;
+ }
+ break;
+ case ICMP_MSG_STAT_OUT_PKTS:
+ if (entry->flags & ICMP_MSG_STATS_HAS_OUT) {
+ snmp_set_var_typed_value(requestvb, ASN_COUNTER,
+ (u_char *)&entry->icmpMsgStatsOutPkts, sizeof(uint32_t));
+ } else {
+ requestvb->type = SNMP_NOSUCHINSTANCE;
+ }
+ break;
+ default:
+ snmp_log(LOG_WARNING, "mibII/icmpMsgStatsTable: Unrecognised column (%d)\n",(int)subid);
+ }
+ }
+ break;
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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/icmpStatsTable: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ snmp_log(LOG_WARNING, "mibII/icmpStatsTable: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ break;
+
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+#endif /* linux */
+
+ /*********************
+ *
+ * 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"));
+ }
+ icmp_stats_load(cache, vmagic);
+ icmp_msg_stats_load(cache, vmagic);
+ 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(NETBSD_STATS_VIA_SYSCTL)
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value =- -1;
+
+ ret_value = netbsd_read_icmp_stat(&icmpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (netbsd)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (netbsd)\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/agent/mibgroup/mibII/icmp.h b/agent/mibgroup/mibII/icmp.h
new file mode 100644
index 0000000..9307654
--- /dev/null
+++ b/agent/mibgroup/mibII/icmp.h
@@ -0,0 +1,62 @@
+/*
+ * 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)
+config_arch_require(netbsd, mibII/kernel_netbsd)
+config_arch_require(netbsdelf, mibII/kernel_netbsd)
+
+#include <net-snmp/agent/cache_handler.h>
+
+extern void init_icmp(void);
+extern Netsnmp_Node_Handler icmp_handler;
+extern Netsnmp_Node_Handler icmp_stats_table_handler;
+extern Netsnmp_Node_Handler icmp_msg_stats_table_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
+
+#define ICMPSTATSTABLE 29
+#define ICMP_STAT_IPVER 1
+#define ICMP_STAT_INMSG 2
+#define ICMP_STAT_INERR 3
+#define ICMP_STAT_OUTMSG 4
+#define ICMP_STAT_OUTERR 5
+
+#define ICMPMSGSTATSTABLE 30
+#define ICMP_MSG_STAT_IPVER 1
+#define ICMP_MSG_STAT_TYPE 2
+#define ICMP_MSG_STAT_IN_PKTS 3
+#define ICMP_MSG_STAT_OUT_PKTS 4
+
+#endif /* _MIBGROUP_ICMP_H */
diff --git a/agent/mibgroup/mibII/ifTable.h b/agent/mibgroup/mibII/ifTable.h
new file mode 100644
index 0000000..65d155e
--- /dev/null
+++ b/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/agent/mibgroup/mibII/interfaces.c b/agent/mibgroup/mibII/interfaces.c
new file mode 100644
index 0000000..9dff4aa
--- /dev/null
+++ b/agent/mibgroup/mibII/interfaces.c
@@ -0,0 +1,2950 @@
+/*
+ * 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>
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_provide(interface_legacy)
+
+#if defined(NETSNMP_IFNET_NEEDS_KERNEL) && !defined(_KERNEL) && !defined(NETSNMP_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 defined(NETSNMP_IFNET_NEEDS_KERNEL) && !defined(_KERNEL) && defined(NETSNMP_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
+# 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_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/agent/sysORTable.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "interfaces.h"
+#include "struct.h"
+#include "util_funcs/header_generic.h"
+
+/* if you want caching enabled for speed retrieval 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
+
+#define starttime (*(const struct timeval*)netsnmp_get_agent_starttime())
+
+struct variable3 interfaces_variables[] = {
+ {NETSNMP_IFNUMBER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_interfaces, 1, {1}},
+ {NETSNMP_IFINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 1}},
+ {NETSNMP_IFDESCR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 2}},
+ {NETSNMP_IFTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 3}},
+ {NETSNMP_IFMTU, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 4}},
+ {NETSNMP_IFSPEED, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 5}},
+ {NETSNMP_IFPHYSADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 6}},
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#if defined (WIN32) || defined (cygwin)
+ {NETSNMP_IFADMINSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ifEntry, 3, {2, 1, 7}},
+#else
+ {NETSNMP_IFADMINSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 7}},
+#endif
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ {NETSNMP_IFADMINSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 7}},
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ {NETSNMP_IFOPERSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 8}},
+ {NETSNMP_IFLASTCHANGE, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 9}},
+ {NETSNMP_IFINOCTETS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 10}},
+ {NETSNMP_IFINUCASTPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 11}},
+ {NETSNMP_IFINNUCASTPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 12}},
+ {NETSNMP_IFINDISCARDS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 13}},
+ {NETSNMP_IFINERRORS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 14}},
+ {NETSNMP_IFINUNKNOWNPROTOS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 15}},
+ {NETSNMP_IFOUTOCTETS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 16}},
+ {NETSNMP_IFOUTUCASTPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 17}},
+ {NETSNMP_IFOUTNUCASTPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 18}},
+ {NETSNMP_IFOUTDISCARDS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 19}},
+ {NETSNMP_IFOUTERRORS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 20}},
+ {NETSNMP_IFOUTQLEN, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_ifEntry, 3, {2, 1, 21}},
+ {NETSNMP_IFSPECIFIC, ASN_OBJECT_ID, NETSNMP_OLDAPI_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 NETSNMP_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;
+ sprintf(if_name, "%.*s", ((const u_char *) a)[5],
+ ((const struct sockaddr_in *) a)->sin_zero);
+ *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 NETSNMP_IFINDEX:
+ long_return = interface;
+ return (u_char *) & long_return;
+ case NETSNMP_IFDESCR:
+ cp = if_name;
+ *var_len = strlen(if_name);
+ return (u_char *) cp;
+ case NETSNMP_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 NETSNMP_IFMTU:
+ long_return = (long) if_msg.ifm_data.ifi_mtu;
+ return (u_char *) & long_return;
+ case NETSNMP_IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else {
+#if HAVE_STRUCT_IFNET_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 NETSNMP_IFPHYSADDRESS:
+ /*
+ * XXX
+ */
+ return NULL;
+ case NETSNMP_IFADMINSTATUS:
+ long_return = if_msg.ifm_flags & IFF_UP ? 1 : 2;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOPERSTATUS:
+ long_return = if_msg.ifm_flags & IFF_RUNNING ? 1 : 2;
+ return (u_char *) & long_return;
+ /*
+ * ifLastChange
+ */
+ case NETSNMP_IFINOCTETS:
+ long_return = (u_long) if_msg.ifm_data.ifi_ibytes;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINUCASTPKTS:
+ long_return =
+ (u_long) if_msg.ifm_data.ifi_ipackets -
+ if_msg.ifm_data.ifi_imcasts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINNUCASTPKTS:
+ long_return = (u_long) if_msg.ifm_data.ifi_imcasts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINDISCARDS:
+ long_return = (u_long) if_msg.ifm_data.ifi_iqdrops;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINERRORS:
+ long_return = (u_long) if_msg.ifm_data.ifi_ierrors;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINUNKNOWNPROTOS:
+ long_return = (u_long) if_msg.ifm_data.ifi_noproto;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTOCTETS:
+ long_return = (u_long) if_msg.ifm_data.ifi_obytes;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTUCASTPKTS:
+ long_return =
+ (u_long) if_msg.ifm_data.ifi_opackets -
+ if_msg.ifm_data.ifi_omcasts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTNUCASTPKTS:
+ long_return = (u_long) if_msg.ifm_data.ifi_omcasts;
+ return (u_char *) & long_return;
+ case NETSNMP_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 NETSNMP_IFOUTERRORS:
+ long_return = (u_long) if_msg.ifm_data.ifi_oerrors;
+ return (u_char *) & long_return;
+ case NETSNMP_IFLASTCHANGE:
+#ifdef irix6
+ long_return = 0;
+#else
+ if (if_msg.ifm_data.ifi_lastchange.tv_sec == 0 &&
+#if STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_NSEC
+ if_msg.ifm_data.ifi_lastchange.tv_nsec == 0
+#else
+ if_msg.ifm_data.ifi_lastchange.tv_usec == 0
+#endif
+ )
+ 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 STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_NSEC
+ if_msg.ifm_data.ifi_lastchange.tv_nsec / 1000
+#else
+ if_msg.ifm_data.ifi_lastchange.tv_usec
+#endif
+ - 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;
+}
+
+int
+Interface_Scan_NextInt(int *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 HAVE_STRUCT_IFNET_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 NETSNMP_IFINDEX:
+ long_return = interface;
+ return (u_char *) & long_return;
+ case NETSNMP_IFDESCR:
+ cp = Name;
+ *var_len = strlen(cp);
+ return (u_char *) cp;
+ case NETSNMP_IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else {
+#if HAVE_STRUCT_IFNET_IF_TYPE
+ long_return = ifnet.if_type;
+#else
+ long_return = 1; /* OTHER */
+#endif
+ }
+ return (u_char *) & long_return;
+ case NETSNMP_IFMTU:{
+ long_return = (long) ifnet.if_mtu;
+ return (u_char *) & long_return;
+ }
+ case NETSNMP_IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else {
+#if HAVE_STRUCT_IFNET_IF_BAUDRATE
+ long_return = ifnet.if_baudrate;
+#elif HAVE_STRUCT_IFNET_IF_SPEED
+ long_return = ifnet.if_speed;
+#elif HAVE_STRUCT_IFNET_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 NETSNMP_IFPHYSADDRESS:
+ Interface_Get_Ether_By_Index(interface, return_buf);
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ *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 NETSNMP_IFADMINSTATUS:
+ long_return = ifnet.if_flags & IFF_UP ? 1 : 2;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOPERSTATUS:
+ long_return = ifnet.if_flags & IFF_RUNNING ? 1 : 2;
+ return (u_char *) & long_return;
+ case NETSNMP_IFLASTCHANGE:
+#if defined(HAVE_STRUCT_IFNET_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 NETSNMP_IFINOCTETS:
+#ifdef HAVE_STRUCT_IFNET_IF_IBYTES
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ 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 NETSNMP_IFINUCASTPKTS:
+ {
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ long_return = (u_long) ifnet.if_ipackets & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_ipackets;
+#endif
+#if HAVE_STRUCT_IFNET_IF_IMCASTS
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ long_return -= (u_long) ifnet.if_imcasts & 0xffffffff;
+#else
+ long_return -= (u_long) ifnet.if_imcasts;
+#endif
+#endif
+ }
+ return (u_char *) & long_return;
+ case NETSNMP_IFINNUCASTPKTS:
+#if HAVE_STRUCT_IFNET_IF_IMCASTS
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ 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 NETSNMP_IFINDISCARDS:
+#if HAVE_STRUCT_IFNET_IF_IQDROPS
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ 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 NETSNMP_IFINERRORS:
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ long_return = (u_long) ifnet.if_ierrors & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_ierrors;
+#endif
+ return (u_char *) & long_return;
+ case NETSNMP_IFINUNKNOWNPROTOS:
+#if HAVE_STRUCT_IFNET_IF_NOPROTO
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ 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 NETSNMP_IFOUTOCTETS:
+#ifdef HAVE_STRUCT_IFNET_IF_OBYTES
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ 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 NETSNMP_IFOUTUCASTPKTS:
+ {
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ long_return = (u_long) ifnet.if_opackets & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_opackets;
+#endif
+#if HAVE_STRUCT_IFNET_IF_OMCASTS
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ long_return -= (u_long) ifnet.if_omcasts & 0xffffffff;
+#else
+ long_return -= (u_long) ifnet.if_omcasts;
+#endif
+#endif
+ }
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTNUCASTPKTS:
+#if HAVE_STRUCT_IFNET_IF_OMCASTS
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ 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 NETSNMP_IFOUTDISCARDS:
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ long_return = ifnet.if_snd.ifq_drops & 0xffffffff;
+#else
+ long_return = ifnet.if_snd.ifq_drops;
+#endif
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTERRORS:
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ long_return = ifnet.if_oerrors & 0xffffffff;
+#else
+ long_return = ifnet.if_oerrors;
+#endif
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTQLEN:
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ long_return = ifnet.if_snd.ifq_len & 0xffffffff;
+#else
+ long_return = ifnet.if_snd.ifq_len;
+#endif
+ return (u_char *) & long_return;
+ case NETSNMP_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 HAVE_STRUCT_IFNET_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 NETSNMP_IFINDEX:
+ long_return = interface;
+ return (u_char *) & long_return;
+ case NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_IFINERRORS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifInErrors;
+#else
+ long_return = ifnet.if_ierrors;
+#endif
+ return (u_char *) & long_return;
+ case NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_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 NETSNMP_IFOUTERRORS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifOutErrors;
+#else
+ long_return = ifnet.if_oerrors;
+#endif
+ return (u_char *) & long_return;
+ case NETSNMP_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 NETSNMP_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 NETSNMP_IFINDEX:
+ long_return = ifstat.ifIndex;
+ return (u_char *) & long_return;
+ case NETSNMP_IFDESCR:
+ *var_len = ifstat.ifDescr.o_length;
+ (void) memcpy(return_buf, ifstat.ifDescr.o_bytes, *var_len);
+ return (u_char *) return_buf;
+ case NETSNMP_IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else
+ long_return = (u_long) ifstat.ifType;
+ return (u_char *) & long_return;
+ case NETSNMP_IFMTU:
+ long_return = (u_long) ifstat.ifMtu;
+ return (u_char *) & long_return;
+ case NETSNMP_IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else
+ long_return = (u_long) ifstat.ifSpeed;
+ return (u_char *) & long_return;
+ case NETSNMP_IFPHYSADDRESS:
+ *var_len = ifstat.ifPhysAddress.o_length;
+ (void) memcpy(return_buf, ifstat.ifPhysAddress.o_bytes, *var_len);
+ return (u_char *) return_buf;
+ case NETSNMP_IFADMINSTATUS:
+ long_return = (u_long) ifstat.ifAdminStatus;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOPERSTATUS:
+ long_return = (u_long) ifstat.ifOperStatus;
+ return (u_char *) & long_return;
+ case NETSNMP_IFLASTCHANGE:
+ long_return = (u_long) ifstat.ifLastChange;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINOCTETS:
+ long_return = (u_long) ifstat.ifInOctets;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINUCASTPKTS:
+ long_return = (u_long) ifstat.ifInUcastPkts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINNUCASTPKTS:
+ long_return = (u_long) ifstat.ifInNUcastPkts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINDISCARDS:
+ long_return = (u_long) ifstat.ifInDiscards;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINERRORS:
+ long_return = (u_long) ifstat.ifInErrors;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINUNKNOWNPROTOS:
+ long_return = (u_long) ifstat.ifInUnknownProtos;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTOCTETS:
+ long_return = (u_long) ifstat.ifOutOctets;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTUCASTPKTS:
+ long_return = (u_long) ifstat.ifOutUcastPkts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTNUCASTPKTS:
+ long_return = (u_long) ifstat.ifOutNUcastPkts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTDISCARDS:
+ long_return = (u_long) ifstat.ifOutDiscards;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTERRORS:
+ long_return = (u_long) ifstat.ifOutErrors;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTQLEN:
+ long_return = (u_long) ifstat.ifOutQLen;
+ return (u_char *) & long_return;
+ case NETSNMP_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, unsigned int defaultspeed)
+{
+#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,
+ unsigned long long defaultspeed);
+
+ return netsnmp_linux_interface_get_if_speed(fd, ifr.ifr_name, defaultspeed);
+#else /*!linux*/
+ return defaultspeed;
+#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 */
+ netsnmp_get_monotonic_clock(&et);
+ 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);
+ NETSNMP_LOGONCE((LOG_ERR, "cannot open /proc/net/dev.\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;
+ strlcpy(ifname_buf, ifstart, sizeof(ifname_buf));
+ *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;
+
+ strlcpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ if (ioctl(fd, SIOCGIFADDR, &ifrq) < 0)
+ memset((char *) &nnew->if_addr, 0, sizeof(nnew->if_addr));
+ else
+ nnew->if_addr = ifrq.ifr_addr;
+
+ strlcpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ if (ioctl(fd, SIOCGIFBRDADDR, &ifrq) < 0)
+ memset((char *) &nnew->ifu_broadaddr, 0,
+ sizeof(nnew->ifu_broadaddr));
+ else
+ nnew->ifu_broadaddr = ifrq.ifr_broadaddr;
+
+ strlcpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ if (ioctl(fd, SIOCGIFNETMASK, &ifrq) < 0)
+ memset((char *) &nnew->ia_subnetmask, 0,
+ sizeof(nnew->ia_subnetmask));
+ else
+ nnew->ia_subnetmask = ifrq.ifr_netmask;
+
+ strlcpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ 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);
+ strlcpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ 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
+ }
+
+ strlcpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ nnew->if_metric = ioctl(fd, SIOCGIFMETRIC, &ifrq) < 0
+ ? 0 : ifrq.ifr_metric;
+
+#ifdef SIOCGIFMTU
+ strlcpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ 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
+ */
+ unsigned int defaultspeed = NOMINAL_LINK_SPEED;
+ if (!(nnew->if_flags & IFF_RUNNING)) {
+ /*
+ * use speed 0 if the if speed cannot be determined *and* the
+ * interface is down
+ */
+ defaultspeed = 0;
+ }
+
+ if (!nnew->if_type)
+ nnew->if_type = if_type_from_name(nnew->if_name);
+ switch(nnew->if_type) {
+ case 6:
+ nnew->if_speed = getIfSpeed(fd, ifrq, defaultspeed);
+ break;
+ case 24:
+ nnew->if_speed = 10000000;
+ break;
+ case 9:
+ nnew->if_speed = 4000000;
+ break;
+ default:
+ nnew->if_speed = 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)
+{
+ int returnIndex = 0;
+ int ret;
+ if (Index)
+ returnIndex = *Index;
+
+ ret = Interface_Scan_NextInt( &returnIndex, Name, Retifnet, dummy );
+ if (Index)
+ *Index = (returnIndex & 0x8fff);
+ return ret;
+}
+
+int
+Interface_Scan_NextInt(int *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;
+ strlcpy(saveName, ifnet.if_name, sizeof(saveName));
+#endif
+
+ saveName[sizeof(saveName) - 1] = '\0';
+ cp = (char *) strchr(saveName, '\0');
+#ifdef linux
+ strlcat(saveName, ifnet.if_unit, sizeof(saveName));
+#else
+#ifdef NETSNMP_FEATURE_CHECKIN
+ /* this exists here just so we don't copy ifdef logic elsewhere */
+ netsnmp_feature_require(string_append_int);
+#endif
+ 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)
+{
+ int ifIndex = 0;
+ char ifName[20];
+
+ Interface_Scan_Init();
+ while (Interface_Scan_NextInt(&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)
+{
+ int returnIndex = 0;
+ int ret;
+ if (Index)
+ returnIndex = *Index;
+
+ ret = Interface_Scan_NextInt( &returnIndex, Name, Retifnet );
+ if (Index)
+ *Index = (returnIndex & 0x8fff);
+ return ret;
+}
+
+
+int
+Interface_Scan_NextInt(int *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);
+ if (if_ptr == NULL)
+ return (0);
+
+ } 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)
+{
+ int returnIndex = 0;
+ int ret;
+ if (Index)
+ returnIndex = *Index;
+
+ ret = Interface_Scan_NextInt( &returnIndex, Name, Retifnet, Retin_ifaddr );
+ if (Index)
+ *Index = (returnIndex & 0x8fff);
+ return ret;
+}
+
+
+int
+Interface_Scan_NextInt(int *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 !HAVE_STRUCT_IFNET_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 HAVE_STRUCT_IFNET_IF_XNAME
+#if defined(netbsd1) || defined(openbsd2)
+ strlcpy(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');
+#ifdef NETSNMP_FEATURE_CHECKIN
+ /* this exists here just so we don't copy ifdef logic elsewhere */
+ netsnmp_feature_require(string_append_int);
+#endif
+ 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(HAVE_STRUCT_IFNET_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)
+{
+ int i;
+
+ Interface_Scan_Init();
+ while (Interface_Scan_NextInt(&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)
+{
+ int i;
+
+ Interface_Scan_Init();
+ while (Interface_Scan_NextInt(&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 */
+
+int
+Interface_Scan_Get_Count(void)
+{
+ static time_t scan_time = 0;
+ 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_NextInt(NULL, NULL, NULL, NULL) != 0) {
+ Interface_Count++;
+ }
+ }
+ return (Interface_Count);
+}
+
+
+static int
+Interface_Get_Ether_By_Index(int Index, u_char * EtherAddr)
+{
+ int 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_NextInt(&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 NETSNMP_IFINDEX:
+ long_return = interface;
+ return (u_char *) & long_return;
+ case NETSNMP_IFDESCR:
+ cp = ifmd.ifmd_name;
+ *var_len = strlen(cp);
+ return (u_char *) cp;
+ case NETSNMP_IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else
+ long_return = ifmd.ifmd_data.ifi_type;
+ return (u_char *) & long_return;
+ case NETSNMP_IFMTU:
+ long_return = (long) ifmd.ifmd_data.ifi_mtu;
+ return (u_char *) & long_return;
+ case NETSNMP_IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else
+ long_return = ifmd.ifmd_data.ifi_baudrate;
+ return (u_char *) & long_return;
+ case NETSNMP_IFPHYSADDRESS:
+ {
+ char *cp;
+ if (get_phys_address(interface, &cp, var_len))
+ return NULL;
+ else
+ return cp;
+ }
+ case NETSNMP_IFADMINSTATUS:
+ long_return = ifmd.ifmd_flags & IFF_UP ? 1 : 2;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOPERSTATUS:
+ long_return = ifmd.ifmd_flags & IFF_RUNNING ? 1 : 2;
+ return (u_char *) & long_return;
+ case NETSNMP_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 NETSNMP_IFINOCTETS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_ibytes;
+ return (u_char *) & long_return;
+ case NETSNMP_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 NETSNMP_IFINNUCASTPKTS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_imcasts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINDISCARDS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_iqdrops;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINERRORS:
+ long_return = ifmd.ifmd_data.ifi_ierrors;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINUNKNOWNPROTOS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_noproto;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTOCTETS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_obytes;
+ return (u_char *) & long_return;
+ case NETSNMP_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 NETSNMP_IFOUTNUCASTPKTS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_omcasts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTDISCARDS:
+ long_return = ifmd.ifmd_snd_drops;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTERRORS:
+ long_return = ifmd.ifmd_data.ifi_oerrors;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTQLEN:
+ long_return = ifmd.ifmd_snd_len;
+ return (u_char *) & long_return;
+ case NETSNMP_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 */
+
+#elif defined(HAVE_IPHLPAPI_H) /* WIN32 cygwin */
+#include <iphlpapi.h>
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+WriteMethod writeIfEntry;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+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 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
+ */
+
+ status = GetIfTable(pIfTable, &dwActualSize, TRUE);
+ if (status == ERROR_INSUFFICIENT_BUFFER) {
+ pIfTable = malloc(dwActualSize);
+ if (pIfTable)
+ 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"));
+ count = MATCH_FAILED;
+ goto out;
+ }
+
+ 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;
+out:
+ 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 NETSNMP_IFNUMBER:
+ netsnmp_assert(sizeof(DWORD) == sizeof(long_return));
+ GetNumberOfInterfaces((DWORD *) &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 NETSNMP_IFINDEX:
+ long_return = ifIndex;
+ return (u_char *) & long_return;
+ case NETSNMP_IFDESCR:
+ *var_len = ifRow.dwDescrLen;
+ return (u_char *) ifRow.bDescr;
+ case NETSNMP_IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else
+ long_return = ifRow.dwType;
+ return (u_char *) & long_return;
+ case NETSNMP_IFMTU:
+ long_return = (long) ifRow.dwMtu;
+ return (u_char *) & long_return;
+ case NETSNMP_IFSPEED:
+ if (if_ptr)
+ long_return = (long) if_ptr->speed;
+ else
+ long_return = (long) ifRow.dwSpeed;
+ return (u_char *) & long_return;
+ case NETSNMP_IFPHYSADDRESS:
+ *var_len = ifRow.dwPhysAddrLen;
+ memcpy(return_buf, ifRow.bPhysAddr, *var_len);
+ return (u_char *) return_buf;
+ case NETSNMP_IFADMINSTATUS:
+ long_return = ifRow.dwAdminStatus;
+ admin_status = long_return;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = writeIfEntry;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ return (u_char *) & long_return;
+ case NETSNMP_IFOPERSTATUS:
+ long_return =
+ (MIB_IF_OPER_STATUS_OPERATIONAL == ifRow.dwOperStatus) ? 1 : 2;
+ return (u_char *) & long_return;
+ case NETSNMP_IFLASTCHANGE:
+ long_return = 0 /* XXX not a UNIX epochal time ifRow.dwLastChange */ ;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINOCTETS:
+ long_return = ifRow.dwInOctets;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINUCASTPKTS:
+ long_return = ifRow.dwInUcastPkts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINNUCASTPKTS:
+ long_return = ifRow.dwInNUcastPkts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINDISCARDS:
+ long_return = ifRow.dwInDiscards;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINERRORS:
+ long_return = ifRow.dwInErrors;
+ return (u_char *) & long_return;
+ case NETSNMP_IFINUNKNOWNPROTOS:
+ long_return = ifRow.dwInUnknownProtos;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTOCTETS:
+ long_return = ifRow.dwOutOctets;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTUCASTPKTS:
+ long_return = ifRow.dwOutUcastPkts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTNUCASTPKTS:
+ long_return = ifRow.dwOutNUcastPkts;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTDISCARDS:
+ long_return = ifRow.dwOutDiscards;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTERRORS:
+ long_return = ifRow.dwOutErrors;
+ return (u_char *) & long_return;
+ case NETSNMP_IFOUTQLEN:
+ long_return = ifRow.dwOutQLen;
+ return (u_char *) & long_return;
+ case NETSNMP_IFSPECIFIC:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ifEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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] != NETSNMP_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: %lu & adminStatus %lu\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 /* !NETSNMP_NO_WRITE_SUPPORT */
+#endif /* WIN32 cygwin */
diff --git a/agent/mibgroup/mibII/interfaces.h b/agent/mibgroup/mibII/interfaces.h
new file mode 100644
index 0000000..c19b7a6
--- /dev/null
+++ b/agent/mibgroup/mibII/interfaces.h
@@ -0,0 +1,127 @@
+/*
+ * Interfaces MIB group interface - interfaces.h
+ *
+ */
+#ifndef _MIBGROUP_INTERFACES_H
+#define _MIBGROUP_INTERFACES_H
+
+/***********************************************************************
+ * configure macros
+ */
+config_require(util_funcs/header_generic)
+
+/*
+ * 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 *);
+ int Interface_Scan_NextInt(int *, char *, nmapi_phystat *);
+#else
+ int Interface_Scan_Next(short *, char *, struct ifnet *,
+ struct in_ifaddr *);
+ int Interface_Scan_NextInt(int *, 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 NETSNMP_IFNUMBER 0
+#define NETSNMP_IFINDEX 1
+#define NETSNMP_IFDESCR 2
+#define NETSNMP_IFTYPE 3
+#define NETSNMP_IFMTU 4
+#define NETSNMP_IFSPEED 5
+#define NETSNMP_IFPHYSADDRESS 6
+#define NETSNMP_IFADMINSTATUS 7
+#define NETSNMP_IFOPERSTATUS 8
+#define NETSNMP_IFLASTCHANGE 9
+#define NETSNMP_IFINOCTETS 10
+#define NETSNMP_IFINUCASTPKTS 11
+#define NETSNMP_IFINNUCASTPKTS 12
+#define NETSNMP_IFINDISCARDS 13
+#define NETSNMP_IFINERRORS 14
+#define NETSNMP_IFINUNKNOWNPROTOS 15
+#define NETSNMP_IFOUTOCTETS 16
+#define NETSNMP_IFOUTUCASTPKTS 17
+#define NETSNMP_IFOUTNUCASTPKTS 18
+#define NETSNMP_IFOUTDISCARDS 19
+#define NETSNMP_IFOUTERRORS 20
+#define NETSNMP_IFOUTQLEN 21
+#define NETSNMP_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/agent/mibgroup/mibII/ip.c b/agent/mibgroup/mibII/ip.c
new file mode 100644
index 0000000..40b5d2f
--- /dev/null
+++ b/agent/mibgroup/mibII/ip.c
@@ -0,0 +1,1011 @@
+/*
+ * 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 <net-snmp/agent/sysORTable.h>
+
+#include "util_funcs/MIB_STATS_CACHE_TIMEOUT.h"
+#include "ip.h"
+#include "ipAddr.h"
+#include "interfaces.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(aix7)) && !defined(FIRST_PROTOCOL)
+#ifdef HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#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, NETSNMP_OLDAPI_RONLY,
+ var_ipAddrEntry, 1, {1}},
+ {IPADIFINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipAddrEntry, 1, {2}},
+#ifndef sunV3
+ {IPADNETMASK, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ipAddrEntry, 1, {3}},
+#endif
+ {IPADBCASTADDR, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipAddrEntry, 1, {4}},
+ {IPADREASMMAX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipAddrEntry, 1, {5}}
+};
+
+struct variable1 iproute_variables[] = {
+ {IPROUTEDEST, ASN_IPADDRESS, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {1}},
+ {IPROUTEIFINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {2}},
+ {IPROUTEMETRIC1, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {3}},
+ {IPROUTEMETRIC2, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {4}},
+ {IPROUTEMETRIC3, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {5}},
+ {IPROUTEMETRIC4, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {6}},
+ {IPROUTENEXTHOP, ASN_IPADDRESS, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {7}},
+ {IPROUTETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {8}},
+ {IPROUTEPROTO, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipRouteEntry, 1, {9}},
+ {IPROUTEAGE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {10}},
+ {IPROUTEMASK, ASN_IPADDRESS, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {11}},
+ {IPROUTEMETRIC5, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ipRouteEntry, 1, {12}},
+ {IPROUTEINFO, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_ipRouteEntry, 1, {13}}
+};
+
+struct variable1 ipmedia_variables[] = {
+#ifdef USING_MIBII_AT_MODULE
+#if defined (WIN32) || defined (cygwin)
+ {IPMEDIAIFINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_atEntry, 1, {1}},
+ {IPMEDIAPHYSADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_atEntry, 1, {2}},
+ {IPMEDIANETADDRESS, ASN_IPADDRESS, NETSNMP_OLDAPI_RWRITE,
+ var_atEntry, 1, {3}},
+ {IPMEDIATYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_atEntry, 1, {4}}
+#else
+ {IPMEDIAIFINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_atEntry, 1, {1}},
+ {IPMEDIAPHYSADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_atEntry, 1, {2}},
+ {IPMEDIANETADDRESS, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_atEntry, 1, {3}},
+ {IPMEDIATYPE, ASN_INTEGER, NETSNMP_OLDAPI_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;
+ int rc;
+
+ /*
+ * 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);
+ rc = netsnmp_register_scalar_group(reginfo, IPFORWARDING, IPROUTEDISCARDS);
+ if (rc != SNMPERR_SUCCESS)
+ return;
+
+ /*
+ * .... 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
+
+#ifdef NETBSD_STATS_VIA_SYSCTL
+#define IP_STAT_STRUCTURE struct ip_mib
+#define USES_SNMP_DESIGNED_IPSTAT
+#undef IP_NSTATS
+#endif
+
+#ifdef HAVE_IPHLPAPI_H
+#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
+
+#ifdef dragonfly
+#define IP_STAT_STRUCTURE struct ip_stats
+#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.
+ */
+#ifdef _USE_PERFSTAT_PROTOCOL
+ ip_load(NULL, NULL);
+#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 & 0xffffffff;
+ 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 & 0xffffffff;
+ break;
+ case IPOUTREQUESTS:
+ ret_value = ipstat.ipOutRequests & 0xffffffff;
+ 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 & 0xffffffff;
+ 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 HAVE_STRUCT_IPSTAT_IPS_NOPROTO
+ ret_value = ipstat.ips_noproto;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPINDISCARDS:
+#if HAVE_STRUCT_IPSTAT_IPS_FRAGDROPPED
+ ret_value = ipstat.ips_fragdropped; /* ?? */
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPINDELIVERS:
+#if HAVE_STRUCT_IPSTAT_IPS_DELIVERED
+ ret_value = ipstat.ips_delivered & 0xffffffff;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPOUTREQUESTS:
+#if HAVE_STRUCT_IPSTAT_IPS_LOCALOUT
+ ret_value = ipstat.ips_localout & 0xffffffff;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPOUTDISCARDS:
+#if HAVE_STRUCT_IPSTAT_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 HAVE_STRUCT_IPSTAT_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 HAVE_STRUCT_IPSTAT_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 HAVE_STRUCT_IPSTAT_IPS_CANTFRAG
+ ret_value = ipstat.ips_cantfrag;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPFRAGCREATES:
+#if HAVE_STRUCT_IPSTAT_IPS_OFRAGMENTS
+ ret_value = ipstat.ips_ofragments;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPROUTEDISCARDS:
+#if HAVE_STRUCT_IPSTAT_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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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 (NETBSD_STATS_VIA_SYSCTL)
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = netbsd_read_ip_stat(&ipstat);
+
+ if ( ret_value < 0) {
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (netbsd)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/ip", "Loaded IP Group (netbsd)\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/agent/mibgroup/mibII/ip.h b/agent/mibgroup/mibII/ip.h
new file mode 100644
index 0000000..04c5651
--- /dev/null
+++ b/agent/mibgroup/mibII/ip.h
@@ -0,0 +1,85 @@
+/*
+ * 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)
+config_arch_require(netbsd, mibII/kernel_netbsd)
+config_arch_require(netbsd5, mibII/kernel_netbsd)
+config_arch_require(netbsd6, mibII/kernel_netbsd)
+config_arch_require(netbsdelf, mibII/kernel_netbsd)
+config_arch_require(netbsdelf5, mibII/kernel_netbsd)
+
+#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/agent/mibgroup/mibII/ipAddr.c b/agent/mibgroup/mibII/ipAddr.c
new file mode 100644
index 0000000..a4d577e
--- /dev/null
+++ b/agent/mibgroup/mibII/ipAddr.c
@@ -0,0 +1,1077 @@
+/*
+ * 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>
+#include <net-snmp/net-snmp-features.h>
+
+#if defined(NETSNMP_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_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"
+
+#ifdef cygwin
+#include <windows.h>
+#endif
+
+netsnmp_feature_require(interface_legacy)
+
+ /*********************
+ *
+ * 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 HAVE_STRUCT_IFNET_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 = (WriteMethod*)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;
+ 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 */
+
+#elif defined(HAVE_IPHLPAPI_H) /* 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;
+ void *result = NULL;
+ 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)
+ goto out;
+
+ i = lowinterface;
+ memcpy(name, lowest, 14 * sizeof(oid));
+ *length = 14;
+ *write_method = 0;
+ switch (vp->magic) {
+ case IPADADDR:
+ *var_len = sizeof(addr_ret);
+ addr_ret = pIpAddrTable->table[i].dwAddr;
+ result = &addr_ret;
+ break;
+
+ case IPADIFINDEX:
+ *var_len = sizeof(long_return);
+ long_return = pIpAddrTable->table[i].dwIndex;
+ result = &long_return;
+ break;
+
+ case IPADNETMASK:
+ *var_len = sizeof(addr_ret);
+ addr_ret = pIpAddrTable->table[i].dwMask;
+ result = &addr_ret;
+ break;
+
+ case IPADBCASTADDR:
+ *var_len = sizeof(long_return);
+ long_return = pIpAddrTable->table[i].dwBCastAddr;
+ result = &long_return;
+ break;
+
+ case IPADREASMMAX:
+ *var_len = sizeof(long_return);
+ long_return = pIpAddrTable->table[i].dwReasmSize;
+ result = &long_return;
+ break;
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipAddrEntry\n",
+ vp->magic));
+ break;
+ }
+
+out:
+ free(pIpAddrTable);
+ return result;
+}
+#endif /* WIN32 cygwin */
diff --git a/agent/mibgroup/mibII/ipAddr.h b/agent/mibgroup/mibII/ipAddr.h
new file mode 100644
index 0000000..ec69cf3
--- /dev/null
+++ b/agent/mibgroup/mibII/ipAddr.h
@@ -0,0 +1,14 @@
+/*
+ * Template MIB group interface - ipAddr.h
+ *
+ */
+#ifndef _MIBGROUP_IPADDR_H
+#define _MIBGROUP_IPADDR_H
+
+#if !defined(NETSNMP_ENABLE_MFD_REWRITES)
+config_require(mibII/ip)
+#endif
+
+ extern FindVarMethod var_ipAddrEntry;
+
+#endif /* _MIBGROUP_IPADDR_H */
diff --git a/agent/mibgroup/mibII/ipCidrRouteTable.c b/agent/mibgroup/mibII/ipCidrRouteTable.c
new file mode 100644
index 0000000..c9ad6e7
--- /dev/null
+++ b/agent/mibgroup/mibII/ipCidrRouteTable.c
@@ -0,0 +1,1135 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate_access.conf$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(oid_stash)
+netsnmp_feature_require(get_routes)
+netsnmp_feature_require(oid_stash_get_data)
+netsnmp_feature_require(oid_stash_add_data)
+
+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 retrieval. */
+ 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_iterator2(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;
+
+ /** column and row index encoded portion */
+ const oid * const suffix =
+ requests->requestvb->name + reginfo->rootoid_len + 1;
+ const size_t 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/agent/mibgroup/mibII/ipCidrRouteTable.h b/agent/mibgroup/mibII/ipCidrRouteTable.h
new file mode 100644
index 0000000..3c508af
--- /dev/null
+++ b/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/agent/mibgroup/mibII/ipCidrRouteTable_access.c b/agent/mibgroup/mibII/ipCidrRouteTable_access.c
new file mode 100644
index 0000000..c905c4b
--- /dev/null
+++ b/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;
+static in_addr_t addr_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;
+ addr_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr;
+ *ret_len = sizeof(addr_ret);
+ return &addr_ret;
+}
+
+u_long *
+get_ipCidrRouteMask(void *data_context, size_t * ret_len)
+{
+ RTENTRY *ourroute = (RTENTRY *) data_context;
+ addr_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr;
+ *ret_len = sizeof(addr_ret);
+ return &addr_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;
+ addr_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr;
+ *ret_len = sizeof(addr_ret);
+ return &addr_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/agent/mibgroup/mibII/ipCidrRouteTable_access.h b/agent/mibgroup/mibII/ipCidrRouteTable_access.h
new file mode 100644
index 0000000..1ce2c1d
--- /dev/null
+++ b/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/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.c b/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.c
new file mode 100644
index 0000000..f307686
--- /dev/null
+++ b/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/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.h b/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.h
new file mode 100644
index 0000000..187611a
--- /dev/null
+++ b/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/agent/mibgroup/mibII/ipCidrRouteTable_columns.h b/agent/mibgroup/mibII/ipCidrRouteTable_columns.h
new file mode 100644
index 0000000..68c6b62
--- /dev/null
+++ b/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/agent/mibgroup/mibII/ipCidrRouteTable_enums.h b/agent/mibgroup/mibII/ipCidrRouteTable_enums.h
new file mode 100644
index 0000000..10039f7
--- /dev/null
+++ b/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/agent/mibgroup/mibII/ipv6.c b/agent/mibgroup/mibII/ipv6.c
new file mode 100644
index 0000000..99d50e8
--- /dev/null
+++ b/agent/mibgroup/mibII/ipv6.c
@@ -0,0 +1,2301 @@
+/*
+ * IP MIB group implementation - ipv6.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#if defined(NETSNMP_IFNET_NEEDS_KERNEL) && !defined(_KERNEL)
+#define _KERNEL 1
+#define _I_DEFINED_KERNEL
+#endif
+#if NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES
+#endif
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#if defined(freebsd3) || 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(freebsd3) || defined(darwin) || defined(openbsd4)
+# if HAVE_NETINET_IP_H
+# include <netinet/ip.h>
+# endif
+# 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 "ipv6.h"
+#include "interfaces.h"
+
+netsnmp_feature_require(linux_read_ip6_stat)
+
+#if defined(netbsd1) && !defined(openbsd4)
+#define inp_lport in6p_lport
+#define inp_fport in6p_fport
+#define inp_ppcb in6p_ppcb
+#endif
+
+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, NETSNMP_OLDAPI_RONLY,
+ var_ipv6, 1, {1}},
+ {IPV6DEFAULTHOPLIMIT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6, 1, {2}},
+ {IPV6INTERFACES, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_ipv6, 1, {3}},
+ {IPV6IFTBLLASTCHG, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_ipv6, 1, {4}},
+
+ {IPV6IFDESCR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 2}},
+ {IPV6IFLOWLAYER, ASN_OBJECT_ID, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 3}},
+ {IPV6IFEFFECTMTU, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 4}},
+ {IPV6IFREASMMAXSIZE, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 5}},
+
+ {IPV6IFTOKEN, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 6}},
+ {IPV6IFTOKENLEN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 7}},
+ {IPV6IFPHYSADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 8}},
+ {IPV6IFADMSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 9}},
+ {IPV6IFOPERSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 10}},
+ {IPV6IFLASTCHANGE, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {5, 1, 11}},
+
+ {IPV6IFSTATSINRCVS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 1}},
+ {IPV6IFSTATSINHDRERRS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 2}},
+ {IPV6IFSTATSTOOBIGERRS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 3}},
+ {IPV6IFSTATSINNOROUTES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 4}},
+ {IPV6IFSTATSINADDRERRS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 5}},
+ {IPV6IFSTATSINUNKNOWPROTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 6}},
+ {IPV6IFSTATSINTRUNCATPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 7}},
+ {IPV6IFSTATSINDISCARDS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 8}},
+ {IPV6IFSTATSINDELIVERS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 9}},
+ {IPV6IFSTATSOUTFORWDATAS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 10}},
+ {IPV6IFSTATSOUTREQS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 11}},
+ {IPV6IFSTATSOUTDISCARDS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 12}},
+ {IPV6IFSTATSOUTFRAGOKS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 13}},
+ {IPV6IFSTATSOUTFRAGFAILS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 14}},
+ {IPV6IFSTATSOUTFRAGCREATS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 15}},
+ {IPV6IFSTATSOUTREASMREQS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 16}},
+ {IPV6IFSTATSOUTREASMOKS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 17}},
+ {IPV6IFSTATSOUTREASMFAILS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 18}},
+ {IPV6IFSTATSINMCASTPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 19}},
+ {IPV6IFSTATSOUTMCASTPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ifv6Entry, 3, {6, 1, 20}},
+
+#if 0
+ {IPV6ADDRPREFIXONLINKFLG, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6AddrEntry, 3, {7, 1, 3}},
+ {IPV6ADDRPREFIXAUTONOMOUSFLAG, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6AddrEntry, 3, {7, 1, 4}},
+ {IPV6ADDRPREFIXADVPREFERLIFE, UNSIGNED32, NETSNMP_OLDAPI_RONLY,
+ var_ipv6AddrEntry, 3, {7, 1, 5}},
+ {IPV6ADDRPREFIXVALIDLIFE, UNSIGNED32, NETSNMP_OLDAPI_RONLY,
+ var_ipv6AddrEntry, 3, {7, 1, 6}},
+
+ {IPV6ADDRPFXLEN, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6AddrEntry, 3, {8, 1, 2}},
+ {IPV6ADDRTYPE, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6AddrEntry, 3, {8, 1, 3}},
+ {IPV6ADDRANYCASTFLAG, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6AddrEntry, 3, {8, 1, 4}},
+ {IPV6ADDRSTATUS, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6AddrEntry, 3, {8, 1, 5}},
+
+ {IPV6ROUTEIFINDEX, IpV6IFINDEX, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 4}},
+ {IPV6ROUTENEXTHOP, IpV6ADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 5}},
+ {IPV6ROUTETYPE, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 6}},
+ {IPV6ROUTEPROTOCOL, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 7}},
+ {IPV6ROUTEPOLICY, UNSIGNED32, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 8}},
+ {IPV6ROUTEAGE, UNSIGNED32, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 9}},
+ {IPV6ROUTENEXTHOPRDI, UNSIGNED32, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 10}},
+ {IPV6ROUTEMETRIC, UNSIGNED32, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 11}},
+ {IPV6ROUTEWEIGHT, UNSIGNED32, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 12}},
+ {IPV6ROUTEINFO, OBJID, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 13}},
+ {IPV6ROUTEVALID, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipv6RouteEntry, 3, {11, 1, 14}},
+
+ {IPV6NETTOMEDIAPHYADDR, STRING, NETSNMP_OLDAPI_RONLY,
+ var_ndpEntry, 3, {12, 1, 2}},
+ {IPV6NETTOMEDIATYPE, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ndpEntry, 3, {12, 1, 3}},
+ {IPV6NETTOMEDIASTATE, INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ndpEntry, 3, {12, 1, 4}},
+ {IPV6NETTOMEDIALASTUPDATE, TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_ndpEntry, 3, {12, 1, 5}},
+ {IPV6NETTOMEDIAVALID, INTEGER, NETSNMP_OLDAPI_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, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 1}},
+ {IPV6IFICMPINERRORS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 2}},
+ {IPV6IFICMPINDSTUNRCHS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 3}},
+ {IPV6IFICMPINADMPROHS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 4}},
+ {IPV6IFICMPINTIMEXCDS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 5}},
+ {IPV6IFICMPINPARMPROBS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 6}},
+ {IPV6IFICMPINPKTTOOBIGS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 7}},
+ {IPV6IFICMPINECHOS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 8}},
+ {IPV6IFICMPINECHOREPS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 9}},
+ {IPV6IFICMPINRTRSLICITS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 10}},
+ {IPV6IFICMPINRTRADVS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 11}},
+ {IPV6IFICMPINNBRSLICITS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 12}},
+ {IPV6IFICMPINNBRADVS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 13}},
+ {IPV6IFICMPINREDIRECTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 14}},
+ {IPV6IFICMPINGRPMEQERYS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 15}},
+ {IPV6IFICMPINGRPMERSPS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 16}},
+ {IPV6IFICMPINGRPMEREDCS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 17}},
+ {IPV6IFICMPOUTMSG, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 18}},
+ {IPV6IFICMPOUTERRORS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 19}},
+ {IPV6IFICMPOUTDSTUNRCHS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 20}},
+ {IPV6IFICMPOUTADMPROHS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 21}},
+ {IPV6IFICMPOUTTIMEXCDS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 22}},
+ {IPV6IFICMPOUTPARMPROBS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 23}},
+ {IPV6IFICMPOUTPKTTOOBIGS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 24}},
+ {IPV6IFICMPOUTECHOS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 25}},
+ {IPV6IFICMPOUTECHOREPS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 26}},
+ {IPV6IFICMPOUTRTRSLICITS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 27}},
+ {IPV6IFICMPOUTRTRADVS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 28}},
+ {IPV6IFICMPOUTNBRSLICITS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 29}},
+ {IPV6IFICMPOUTNBRADVS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 30}},
+ {IPV6IFICMPOUTREDIRECTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 31}},
+ {IPV6IFICMPOUTGRPMEQERYS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 32}},
+ {IPV6IFICMPOUTGRPMERSPS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_icmpv6Entry, 3, {1, 1, 33}},
+ {IPV6IFICMPOUTGRPMEREDCS, ASN_COUNTER, NETSNMP_OLDAPI_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[] = {
+ {IPV6UDPIFINDEX, ASN_INTEGER, NETSNMP_OLDAPI_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[] = {
+ {IPV6TCPCONNSTATE, ASN_INTEGER, NETSNMP_OLDAPI_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(void)
+{
+ /*
+ * 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 = (WriteMethod*)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 = (WriteMethod*)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(freebsd3) || 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;
+
+ /* Reload list of interfaces */
+ if (if_initialize() < 0)
+ return NULL;
+
+ 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;
+ strlcpy(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;
+#if defined(__DragonFly__) && __DragonFly_version >= 197700
+ struct ifaddr_container ifac;
+ struct ifaddrhead head;
+#endif
+ static struct sockaddr_dl sdl;
+ caddr_t ifa;
+
+ if (if_getifnet(interface, &ifnet) < 0)
+ break;
+#if defined(freebsd3) || defined(darwin)
+# if defined(__DragonFly__) && __DragonFly_version >= 197700
+ /*
+ * Locate ifaddr head on CPU0
+ */
+ if (!NETSNMP_KLOOKUP(ifnet.if_addrheads, (char *)&head, sizeof(head))) {
+ DEBUGMSGTL(("mibII/ipv6:var_ipv6", "klookup head failed\n"));
+ break;
+ }
+ if (TAILQ_FIRST(&head) != NULL) {
+ if (!NETSNMP_KLOOKUP(TAILQ_FIRST(&head), (char *) &ifac, sizeof(ifac))) {
+ DEBUGMSGTL(("mibII/ipv6:var_ipv6", "klookup ifac failed\n"));
+ break;
+ }
+ ifa = (caddr_t)ifac.ifa;
+ } else {
+ ifa = NULL;
+ }
+# else
+ ifa = (caddr_t) TAILQ_FIRST(&ifnet.if_addrhead);
+# endif
+#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(freebsd3) || defined(darwin)
+# if defined(__DragonFly__) && __DragonFly_version >= 197700
+ if (TAILQ_NEXT(&ifac, ifa_link) == NULL) {
+ ifa = NULL;
+ } else {
+ if (!NETSNMP_KLOOKUP(TAILQ_NEXT(&ifac, ifa_link), (char *)&ifac, sizeof(ifac))) {
+ DEBUGMSGTL(("mibII/ipv6:var_ipv6", "klookup ifac next failed\n"));
+ break;
+ }
+ ifa = (caddr_t)ifac.ifa;
+ }
+# else
+ ifa = (caddr_t) TAILQ_NEXT(&ifaddr, ifa_link);
+# endif
+#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 HAVE_STRUCT_IFNET_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));
+ strlcpy(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;
+
+ /* Reload list of interfaces */
+ if (if_initialize() < 0)
+ return NULL;
+
+ 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));
+ strlcpy(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;
+#if defined(openbsd4)
+ static struct inpcb in6pcb, savpcb;
+#else
+ static struct in6pcb in6pcb, savpcb;
+#endif
+ int found, savnameLen;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 || defined(openbsd4) /*1.6Y*/
+ struct inpcbtable udbtable;
+ caddr_t first;
+#elif defined(dragonfly)
+ char *sysctl_buf;
+ struct xinpcb *xig;
+ size_t sysctl_len;
+#elif defined(freebsd3) || defined(darwin)
+ char *sysctl_buf;
+ struct xinpgen *xig, *oxig;
+ 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 || defined(openbsd4) /*1.6Y*/
+ if (!auto_nlist("udbtable", (char *) &udbtable, sizeof(udbtable)))
+ return NULL;
+ first = p = (caddr_t)udbtable.inpt_queue.cqh_first;
+#elif !defined(freebsd3) && !defined(darwin)
+ if (!auto_nlist("udb6", (char *) &udb6, sizeof(udb6)))
+ return NULL;
+ p = (caddr_t) udb6.in6p_next;
+#elif defined(dragonfly)
+ {
+ const char *udblist = "net.inet.udp.pcblist";
+ const char *pp = udblist;
+
+ if (sysctlbyname(udblist, 0, &sysctl_len, 0, 0) < 0)
+ return NULL;
+ if ((sysctl_buf = malloc(sysctl_len)) == NULL)
+ return NULL;
+ udblist = pp;
+ if (sysctlbyname(udblist, sysctl_buf, &sysctl_len, 0, 0) < 0) {
+ free(sysctl_buf);
+ return NULL;
+ }
+ xig = (struct xinpcb *) sysctl_buf;
+ if (xig->xi_len != sizeof(*xig)) {
+ free(sysctl_buf);
+ return NULL;
+ }
+ p = (caddr_t) ((char *) xig); /* silence compiler warning */
+ }
+#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=%p\n", p));
+ while (
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 || defined(openbsd4) /*1.6Y*/
+ p
+#elif !defined(freebsd3) && !defined(darwin)
+ p && (u_long) p != auto_nlist_value("udb6")
+#elif defined(dragonfly)
+ (char *)xig + xig->xi_len <= sysctl_buf + sysctl_len && xig->xi_len != 0
+#else
+ xig->xig_len > sizeof(struct xinpgen)
+#endif
+ ) {
+ DEBUGMSGTL(("mibII/ipv6", "looping: p=%p\n", p));
+
+#if !defined(freebsd3) && !defined(darwin)
+ if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for udb6 at %p\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(freebsd3) || defined(darwin)
+ if (0 == (in6pcb.inp_vflag & INP_IPV6))
+ goto skip;
+#elif defined(openbsd4)
+ if (!(in6pcb.inp_flags & INP_IPV6))
+ goto skip;
+#endif
+
+ j = (int) vp->namelen;
+#if defined(openbsd4)
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.inp_laddr6.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.inp_lport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.inp_laddr6))
+ newname[j++] =
+ ntohs(*(uint16_t *) &in6pcb.inp_laddr6.s6_addr[2]);
+ else
+ newname[j++] = 0;
+#else
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_laddr.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.inp_lport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ newname[j++] =
+ ntohs(*(uint16_t *) &in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ newname[j++] = 0;
+#endif
+ /*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(openbsd4)
+ p = (caddr_t)in6pcb.inp_queue.cqe_next;
+ if (p == first) break;
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p = (caddr_t)in6pcb.in6p_queue.cqe_next;
+ if (p == first) break;
+#elif !defined(freebsd3) && !defined(darwin)
+ p = (caddr_t)in6pcb.in6p_next;
+#elif defined(__DragonFly__)
+ xig = (struct xinpcb *) ((char *) xig + xig->xi_len);
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+ }
+#if defined(freebsd3) || 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 IPV6UDPIFINDEX:
+#if defined(openbsd4)
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.inp_laddr6))
+ long_return =
+ ntohs(*(uint16_t *) & in6pcb.inp_laddr6.s6_addr[2]);
+ else
+ long_return = 0;
+#else
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ long_return =
+ ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ long_return = 0;
+#endif
+ 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(freebsd3) || 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(freebsd3) && !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(freebsd3) && !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(freebsd3) && !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(freebsd3) || 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.inp_lport);
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_faddr.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.inp_fport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ newname[j++] =
+ ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ newname[j++] = 0;
+
+ 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.inp_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(freebsd3) && !defined(darwin)
+ p = (caddr_t)in6pcb.in6p_next;
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+ }
+#if defined(freebsd3) || 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 IPV6TCPCONNSTATE:
+ long_return = tcp6statemap[in6pcb.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;
+#if defined(openbsd4)
+ static struct inpcb in6pcb, savpcb;
+#else
+ static struct in6pcb in6pcb, savpcb;
+#endif
+ struct tcpcb tcpcb;
+ int found, savnameLen;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 || defined(openbsd4) /*1.6Y*/
+ struct inpcbtable tcbtable;
+ caddr_t first;
+#elif defined(dragonfly)
+ char *sysctl_buf;
+ size_t sysctl_len;
+ struct xtcpcb *xtp;
+#elif defined(freebsd3) || defined(darwin)
+ char *sysctl_buf;
+ struct xinpgen *xig, *oxig;
+ 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 || defined(openbsd4) /*1.6Y*/
+ if (!auto_nlist("tcbtable", (char *) &tcbtable, sizeof(tcbtable)))
+ return NULL;
+ first = p = (caddr_t)tcbtable.inpt_queue.cqh_first;
+#elif !defined(freebsd3) && !defined(darwin)
+ if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6)))
+ return NULL;
+ p = (caddr_t) tcb6.in6p_next;
+#elif defined(dragonfly)
+ {
+ const char *tcblist = "net.inet.tcp.pcblist";
+ const char *pp = tcblist;
+
+ if (sysctlbyname(tcblist, 0, &sysctl_len, 0, 0) < 0)
+ return NULL;
+ if ((sysctl_buf = malloc(sysctl_len)) == NULL)
+ return NULL;
+ tcblist = pp;
+ if (sysctlbyname(tcblist, sysctl_buf, &sysctl_len, 0, 0) < 0) {
+ free(sysctl_buf);
+ return NULL;
+ }
+ xtp = (struct xtcpcb *) sysctl_buf;
+ if (xtp->xt_len != sizeof(*xtp)) {
+ free(sysctl_buf);
+ return NULL;
+ }
+ p = (caddr_t) ((char *) xtp); /* silence compiler warning */
+ }
+#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=%p\n", p));
+ while (
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 || defined(openbsd4) /*1.6Y*/
+ p
+#elif !defined(freebsd3) && !defined(darwin)
+ p && (u_long) p != auto_nlist_value("tcb6")
+#elif defined(dragonfly)
+ (char *)xtp + xtp->xt_len < sysctl_buf + sysctl_len
+#else
+ xig->xig_len > sizeof(struct xinpgen)
+#endif
+ ) {
+ DEBUGMSGTL(("mibII/ipv6", "looping: p=%p\n", p));
+
+#if !defined(freebsd3) && !defined(darwin)
+ if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %p\n",
+ p));
+ found = 0;
+ break;
+ }
+#elif defined(dragonfly)
+ in6pcb = xtp->xt_inp;
+#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(freebsd3) || defined(darwin)
+ if (0 == (in6pcb.inp_vflag & INP_IPV6))
+ goto skip;
+#elif defined(openbsd4)
+ if (0 == (in6pcb.inp_flags & INP_IPV6))
+ goto skip;
+#endif
+ j = (int) vp->namelen;
+#if defined(openbsd4)
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.inp_laddr6.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.inp_lport);
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.inp_faddr6.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.inp_fport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.inp_laddr6))
+ newname[j++] =
+ ntohs(*(uint16_t *) &in6pcb.inp_laddr6.s6_addr[2]);
+ else
+ newname[j++] = 0;
+#else
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_laddr.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.inp_lport);
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_faddr.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.inp_fport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ newname[j++] =
+ ntohs(*(uint16_t *) &in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ newname[j++] = 0;
+#endif
+
+ 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.inp_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(openbsd4)
+ p = (caddr_t)in6pcb.inp_queue.cqe_next;
+ if (p == first) break;
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 || defined(openbsd4) /*1.6Y*/
+ p = (caddr_t)in6pcb.in6p_queue.cqe_next;
+ if (p == first) break;
+#elif !defined(freebsd3) && !defined(darwin)
+ p = (caddr_t) in6pcb.in6p_next;
+#elif defined(dragonfly)
+ xtp = (struct xtcpcb *) ((char *)xtp + xtp->xt_len);
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+ }
+#if defined(freebsd3) || 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));
+ if (!NETSNMP_KLOOKUP(in6pcb.inp_ppcb, (char *) &tcpcb, sizeof(tcpcb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %p\n",
+ in6pcb.inp_ppcb));
+ found = 0;
+ return NULL;
+ }
+ *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 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;
+}
+
+static 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;
+
+ /* Reload list of interfaces */
+ if (if_initialize() < 0)
+ return NULL;
+
+ 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 (u_char *) 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;
+ strlcpy(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;
+ strlcpy(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;
+ strlcpy(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 = 0; ifndx[i].if_index; i++) {
+ free(ifndx[i].if_name);
+ }
+ free(ifndx);
+ ifndx = NULL;
+}
+
+#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;
+ static int last_if_count;
+
+ 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) {
+ if (last_if_count < if_index)
+ last_if_count = if_index;
+ tmp =
+ realloc(iflist,
+ (sizeof(struct if_nameindex)) * (last_if_count +
+ 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/agent/mibgroup/mibII/ipv6.h b/agent/mibgroup/mibII/ipv6.h
new file mode 100644
index 0000000..a377153
--- /dev/null
+++ b/agent/mibgroup/mibII/ipv6.h
@@ -0,0 +1,137 @@
+/*
+ * 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 IPV6UDPIFINDEX 3
+
+#define IPV6TCPCONNSTATE 6
+
+#endif /* _MIBGROUP_IPV6_H */
diff --git a/agent/mibgroup/mibII/kernel_linux.c b/agent/mibgroup/mibII/kernel_linux.c
new file mode 100644
index 0000000..b21a166
--- /dev/null
+++ b/agent/mibgroup/mibII/kernel_linux.c
@@ -0,0 +1,628 @@
+/*
+ * Linux kernel interface
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#include <sys/types.h>
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <errno.h>
+
+#include "kernel_linux.h"
+
+struct ip_mib cached_ip_mib;
+struct ip6_mib cached_ip6_mib;
+struct icmp_mib cached_icmp_mib;
+struct icmp6_mib cached_icmp6_mib;
+struct icmp4_msg_mib cached_icmp4_msg_mib;
+struct tcp_mib cached_tcp_mib;
+struct udp_mib cached_udp_mib;
+struct udp6_mib cached_udp6_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 ICMP_MSG_STATS_LINE "IcmpMsg: "
+#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 IP6_STATS_LINE "Ip6"
+#define ICMP6_STATS_LINE "Icmp6"
+#define UDP6_STATS_LINE "Udp6"
+
+#define IP_STATS_PREFIX_LEN 4
+#define ICMP_STATS_PREFIX_LEN 6
+#define ICMP_MSG_STATS_PREFIX_LEN 9
+#define TCP_STATS_PREFIX_LEN 5
+#define UDP_STATS_PREFIX_LEN 5
+#define IP6_STATS_PREFIX_LEN 3
+#define ICMP6_STATS_PREFIX_LEN 5
+#define UDP6_STATS_PREFIX_LEN 4
+
+netsnmp_feature_child_of(linux_ip6_stat_all, libnetsnmpmibs)
+
+netsnmp_feature_child_of(linux_read_ip6_stat, linux_ip6_stat_all)
+
+int
+decode_icmp_msg(char *line, char *data, struct icmp4_msg_mib *msg)
+{
+ char *token, *saveptr, *lineptr, *saveptr1, *dataptr, *delim = NULL;
+ char line_cpy[1024];
+ char data_cpy[1024];
+ long index;
+
+ if(data == NULL)
+ return -1;
+
+ /*
+ * Since we are using strtok, there is a possiblity of the orginal data
+ * getting modified. So we take a local copy for this purpose even though
+ * its expensive.
+ */
+ strlcpy(line_cpy, line, sizeof(line_cpy));
+ strlcpy(data_cpy, data, sizeof(data_cpy));
+
+ lineptr = line_cpy;
+ dataptr = data_cpy;
+ saveptr1 = NULL;
+ while (1) {
+ if(NULL == (token = strtok_r(lineptr, " ", &saveptr)))
+ break;
+ lineptr = NULL;
+ errno = 0;
+ if (0 == strncmp(strsep(&token, "e"), "OutTyp", 6)) {
+ index = strtol(token, &delim, 0);
+ if (ERANGE == errno) {
+ continue;
+ } else if (index > LONG_MAX) {
+ continue;
+ } else if (index < LONG_MIN) {
+ continue;
+ }
+ if (NULL == (token = strtok_r(dataptr, " ", &saveptr1)))
+ break;
+ dataptr = NULL;
+ msg->vals[index].OutType = atoi(token);
+ } else {
+ index = strtol(token, &delim, 0);
+ if (ERANGE == errno) {
+ continue;
+ } else if (index > LONG_MAX) {
+ continue;
+ } else if (index < LONG_MIN) {
+ continue;
+ }
+ if(NULL == (token = strtok_r(dataptr, " ", &saveptr1)))
+ break;
+ dataptr = NULL;
+ msg->vals[index].InType = atoi(token);
+ }
+ }
+ return 0;
+}
+
+int
+linux_read_mibII_stats(void)
+{
+ FILE *in = fopen("/proc/net/snmp", "r");
+ char line[1024], data[1024];
+ int ret = 0;
+ if (!in) {
+ DEBUGMSGTL(("mibII/kernel_linux","Unable to open /proc/net/snmp"));
+ return -1;
+ }
+
+
+ memset(line, '\0', sizeof(line));
+ memset(data, '\0', sizeof(data));
+ 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, ICMP_MSG_STATS_LINE, ICMP_MSG_STATS_PREFIX_LEN)) {
+ /*
+ * Note: We have to do this differently from other stats as the
+ * counters to this stats are dynamic. So we will not know the
+ * number of counters at a given time.
+ */
+ fgets(data, sizeof(data), in);
+ if(decode_icmp_msg(line + ICMP_MSG_STATS_PREFIX_LEN,
+ data + ICMP_MSG_STATS_PREFIX_LEN,
+ &cached_icmp4_msg_mib) < 0) {
+ continue;
+ }
+ ret = 1;
+ } 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);
+
+ /*
+ * 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 ret;
+}
+
+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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_LINUX_READ_IP6_STAT
+int linux_read_ip6_stat( struct ip6_mib *ip6stat)
+{
+#ifdef NETSNMP_ENABLE_IPV6
+ FILE *in;
+ char line[1024];
+ unsigned long stats;
+ char *endp;
+ int match;
+#endif
+
+ memset((char *) ip6stat, (0), sizeof(*ip6stat));
+
+#ifdef NETSNMP_ENABLE_IPV6
+ DEBUGMSGTL(("mibII/kernel_linux/ip6stats",
+ "Reading /proc/net/snmp6 stats\n"));
+ if (NULL == (in = fopen("/proc/net/snmp6", "r"))) {
+ DEBUGMSGTL(("mibII/kernel_linux/ip6stats",
+ "Failed to open /proc/net/snmp6\n"));
+ return -1;
+ }
+
+ while (NULL != fgets(line, sizeof(line), in)) {
+ if (0 != strncmp(line, IP6_STATS_LINE, IP6_STATS_PREFIX_LEN))
+ continue;
+
+ if (1 != sscanf(line, "%*s %lu", &stats))
+ continue;
+
+ endp = strchr(line, ' ');
+ *endp = '\0';
+ DEBUGMSGTL(("mibII/kernel_linux/ip6stats", "Find tag: %s\n", line));
+
+ match = 1;
+ if (0 == strncmp(line + 3, "In", 2)) { /* In */
+ if (0 == strcmp(line + 5, "AddrErrors")) {
+ cached_ip6_mib.ip6InAddrErrors = stats;
+ } else if (0 == strcmp(line + 5, "Delivers")) {
+ cached_ip6_mib.ip6InDelivers = stats;
+ } else if (0 == strcmp(line + 5, "Discards")) {
+ cached_ip6_mib.ip6InDiscards = stats;
+ } else if (0 == strcmp(line + 5, "HdrErrors")) {
+ cached_ip6_mib.ip6InHdrErrors = stats;
+ } else if (0 == strcmp(line + 5, "McastPkts")) {
+ cached_ip6_mib.ip6InMcastPkts = stats;
+ } else if (0 == strcmp(line + 5, "NoRoutes")) {
+ cached_ip6_mib.ip6InNoRoutes = stats;
+ } else if (0 == strcmp(line + 5, "Receives")) {
+ cached_ip6_mib.ip6InReceives = stats;
+ } else if (0 == strcmp(line + 5, "TruncatedPkts")) {
+ cached_ip6_mib.ip6InTruncatedPkts = stats;
+ } else if (0 == strcmp(line + 5, "TooBigErrors")) {
+ cached_ip6_mib.ip6InTooBigErrors = stats;
+ } else if (0 == strcmp(line + 5, "UnknownProtos")) {
+ cached_ip6_mib.ip6InUnknownProtos = stats;
+ } else {
+ match = 0;
+ }
+ } else if (0 == strncmp(line + 3, "Out", 3)) { /* Out */
+ if (0 == strcmp(line + 6, "Discards")) {
+ cached_ip6_mib.ip6OutDiscards = stats;
+ } else if (0 == strcmp(line + 6, "ForwDatagrams")) {
+ cached_ip6_mib.ip6OutForwDatagrams = stats;
+ } else if (0 == strcmp(line + 6, "McastPkts")) {
+ cached_ip6_mib.ip6OutMcastPkts = stats;
+ } else if (0 == strcmp(line + 6, "NoRoutes")) {
+ cached_ip6_mib.ip6OutNoRoutes = stats;
+ } else if (0 == strcmp(line + 6, "Requests")) {
+ cached_ip6_mib.ip6OutRequests = stats;
+ } else {
+ match = 0;
+ }
+ } else if (0 == strncmp(line + 3, "Reasm", 5)) { /* Reasm */
+ if (0 == strcmp(line + 8, "Fails")) {
+ cached_ip6_mib.ip6ReasmFails = stats;
+ } else if (0 == strcmp(line + 8, "OKs")) {
+ cached_ip6_mib.ip6ReasmOKs = stats;
+ } else if (0 == strcmp(line + 8, "Reqds")) {
+ cached_ip6_mib.ip6ReasmReqds = stats;
+ } else if (0 == strcmp(line + 8, "Timeout")) {
+ cached_ip6_mib.ip6ReasmTimeout = stats;
+ } else {
+ match = 0;
+ }
+ } else if (0 == strncmp(line + 3, "Frag", 4)) { /* Frag */
+ if (0 == strcmp(line + 7, "Creates")) {
+ cached_ip6_mib.ip6FragCreates = stats;
+ } else if (0 == strcmp(line + 7, "Fails")) {
+ cached_ip6_mib.ip6FragFails = stats;
+ } else if (0 == strcmp(line + 7, "OKs")) {
+ cached_ip6_mib.ip6FragOKs = stats;
+ } else {
+ match = 0;
+ }
+ } else {
+ match = 0;
+ }
+
+ if(!match)
+ DEBUGMSGTL(("mibII/kernel_linux/ip6stats",
+ "%s is an unknown tag\n", line));
+ }
+
+ fclose(in);
+#endif
+
+ memcpy((char *) ip6stat, (char *) &cached_ip6_mib, sizeof(*ip6stat));
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LINUX_READ_IP6_STAT */
+
+int
+linux_read_icmp_msg_stat(struct icmp_mib *icmpstat,
+ struct icmp4_msg_mib *icmpmsgstat,
+ int *flag)
+{
+ int ret;
+
+ memset(icmpstat, 0, sizeof(*icmpstat));
+ memset(icmpmsgstat, 0, sizeof(*icmpmsgstat));
+
+ if ((ret = linux_read_mibII_stats()) == -1) {
+ return -1;
+ } else if (ret) {
+ memcpy(icmpmsgstat, &cached_icmp4_msg_mib, sizeof(*icmpmsgstat));
+ *flag = 1; /* We have a valid icmpmsg */
+ }
+
+ memcpy(icmpstat, &cached_icmp_mib, sizeof(*icmpstat));
+ 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_icmp6_parse(struct icmp6_mib *icmp6stat,
+ struct icmp6_msg_mib *icmp6msgstat,
+ int *support)
+{
+#ifdef NETSNMP_ENABLE_IPV6
+ FILE *in;
+ char line[1024];
+ char name[255];
+ unsigned long stats;
+ char *endp, *vals;
+ int match;
+#endif
+
+ memset(icmp6stat, 0, sizeof(*icmp6stat));
+ if (NULL != icmp6msgstat)
+ memset(icmp6msgstat, 0, sizeof(*icmp6msgstat));
+
+#ifdef NETSNMP_ENABLE_IPV6
+ DEBUGMSGTL(("mibII/kernel_linux/icmp6stats",
+ "Reading /proc/net/snmp6 stats\n"));
+ if (NULL == (in = fopen("/proc/net/snmp6", "r"))) {
+ DEBUGMSGTL(("mibII/kernel_linux/icmp6stats",
+ "Failed to open /proc/net/snmp6\n"));
+ return -1;
+ }
+
+ while (NULL != fgets(line, sizeof(line), in)) {
+ if (0 != strncmp(line, ICMP6_STATS_LINE, ICMP6_STATS_PREFIX_LEN))
+ continue;
+
+ if (2 != sscanf(line, "%s %lu", name, &stats))
+ continue;
+
+ endp = strchr(line, ' ');
+ *endp = '\0';
+ DEBUGMSGTL(("mibII/kernel_linux/icmp6stats", "Find tag: %s\n", line));
+
+ vals = name;
+ if (NULL != icmp6msgstat) {
+ if (0 == strncmp(name, "Icmp6OutType", 12)) {
+ strsep(&vals, "e");
+ icmp6msgstat->vals[atoi(vals)].OutType = stats;
+ *support = 1;
+ continue;
+ } else if (0 == strncmp(name, "Icmp6InType", 11)) {
+ strsep(&vals, "e");
+ icmp6msgstat->vals[atoi(vals)].InType = stats;
+ *support = 1;
+ continue;
+ }
+ }
+
+ match = 1;
+ if (0 == strncmp(line + 5, "In", 2)) { /* In */
+ if (0 == strcmp(line + 7, "DestUnreachs")) {
+ cached_icmp6_mib.icmp6InDestUnreachs = stats;
+ } else if (0 == strcmp(line + 7, "Echos")) {
+ cached_icmp6_mib.icmp6InEchos = stats;
+ } else if (0 == strcmp(line + 7, "EchoReplies")) {
+ cached_icmp6_mib.icmp6InEchoReplies = stats;
+ } else if (0 == strcmp(line + 7, "Errors")) {
+ cached_icmp6_mib.icmp6InErrors = stats;
+ } else if (0 == strcmp(line + 7, "GroupMembQueries")) {
+ cached_icmp6_mib.icmp6InGroupMembQueries = stats;
+ } else if (0 == strcmp(line + 7, "GroupMembReductions")) {
+ cached_icmp6_mib.icmp6InGroupMembReductions = stats;
+ } else if (0 == strcmp(line + 7, "GroupMembResponses")) {
+ cached_icmp6_mib.icmp6InGroupMembResponses = stats;
+ } else if (0 == strcmp(line + 7, "Msgs")) {
+ cached_icmp6_mib.icmp6InMsgs = stats;
+ } else if (0 == strcmp(line + 7, "NeighborAdvertisements")) {
+ cached_icmp6_mib.icmp6InNeighborAdvertisements = stats;
+ } else if (0 == strcmp(line + 7, "NeighborSolicits")) {
+ cached_icmp6_mib.icmp6InNeighborSolicits = stats;
+ } else if (0 == strcmp(line + 7, "PktTooBigs")) {
+ cached_icmp6_mib.icmp6InPktTooBigs = stats;
+ } else if (0 == strcmp(line + 7, "ParmProblems")) {
+ cached_icmp6_mib.icmp6InParmProblems = stats;
+ } else if (0 == strcmp(line + 7, "Redirects")) {
+ cached_icmp6_mib.icmp6InRedirects = stats;
+ } else if (0 == strcmp(line + 7, "RouterAdvertisements")) {
+ cached_icmp6_mib.icmp6InRouterAdvertisements = stats;
+ } else if (0 == strcmp(line + 7, "RouterSolicits")) {
+ cached_icmp6_mib.icmp6InRouterSolicits = stats;
+ } else if (0 == strcmp(line + 7, "TimeExcds")) {
+ cached_icmp6_mib.icmp6InTimeExcds = stats;
+ } else {
+ match = 0;
+ }
+ } else if (0 == strncmp(line + 5, "Out", 3)) { /* Out */
+ if (0 == strcmp(line + 8, "DestUnreachs")) {
+ cached_icmp6_mib.icmp6OutDestUnreachs = stats;
+ } else if (0 == strcmp(line + 8, "EchoReplies")) {
+ cached_icmp6_mib.icmp6OutEchoReplies = stats;
+ } else if (0 == strcmp(line + 8, "GroupMembReductions")) {
+ cached_icmp6_mib.icmp6OutGroupMembReductions = stats;
+ } else if (0 == strcmp(line + 8, "GroupMembResponses")) {
+ cached_icmp6_mib.icmp6OutGroupMembResponses = stats;
+ } else if (0 == strcmp(line + 8, "Msgs")) {
+ cached_icmp6_mib.icmp6OutMsgs = stats;
+ } else if (0 == strcmp(line + 8, "NeighborAdvertisements")) {
+ cached_icmp6_mib.icmp6OutNeighborAdvertisements = stats;
+ } else if (0 == strcmp(line + 8, "NeighborSolicits")) {
+ cached_icmp6_mib.icmp6OutNeighborSolicits = stats;
+ } else if (0 == strcmp(line + 8, "PktTooBigs")) {
+ cached_icmp6_mib.icmp6OutPktTooBigs = stats;
+ } else if (0 == strcmp(line + 8, "ParmProblems")) {
+ cached_icmp6_mib.icmp6OutParmProblems = stats;
+ } else if (0 == strcmp(line + 8, "Redirects")) {
+ cached_icmp6_mib.icmp6OutRedirects = stats;
+ } else if (0 == strcmp(line + 8, "RouterSolicits")) {
+ cached_icmp6_mib.icmp6OutRouterSolicits = stats;
+ } else if (0 == strcmp(line + 8, "TimeExcds")) {
+ cached_icmp6_mib.icmp6OutTimeExcds = stats;
+ } else {
+ match = 0;
+ }
+ } else {
+ match = 0;
+ }
+ if(!match)
+ DEBUGMSGTL(("mibII/kernel_linux/icmp6stats",
+ "%s is an unknown tag\n", line));
+ }
+
+ fclose(in);
+#endif
+
+ memcpy((char *) icmp6stat, (char *) &cached_icmp6_mib,
+ sizeof(*icmp6stat));
+ return 0;
+}
+
+int
+linux_read_icmp6_msg_stat(struct icmp6_mib *icmp6stat,
+ struct icmp6_msg_mib *icmp6msgstat,
+ int *support)
+{
+ if (linux_read_icmp6_parse(icmp6stat, icmp6msgstat, support) < 0)
+ return -1;
+ else
+ return 0;
+}
+
+int
+linux_read_icmp6_stat(struct icmp6_mib *icmp6stat)
+{
+ if (linux_read_icmp6_parse(icmp6stat, NULL, NULL) < 0)
+ return -1;
+ else
+ 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;
+
+#ifdef NETSNMP_ENABLE_IPV6
+ {
+ struct udp6_mib udp6stat;
+ memset(&udp6stat, 0, sizeof(udp6stat));
+
+ if (linux_read_udp6_stat(&udp6stat) == 0) {
+ cached_udp_mib.udpOutDatagrams += udp6stat.udp6OutDatagrams;
+ cached_udp_mib.udpNoPorts += udp6stat.udp6NoPorts;
+ cached_udp_mib.udpInDatagrams += udp6stat.udp6InDatagrams;
+ cached_udp_mib.udpInErrors += udp6stat.udp6InErrors;
+ }
+ }
+#endif
+ memcpy((char *) udpstat, (char *) &cached_udp_mib, sizeof(*udpstat));
+ return 0;
+}
+
+int
+linux_read_udp6_stat(struct udp6_mib *udp6stat)
+{
+#ifdef NETSNMP_ENABLE_IPV6
+ FILE *in;
+ char line[1024];
+ unsigned long stats;
+ char *endp;
+#endif
+
+ memset(udp6stat, 0, sizeof(*udp6stat));
+
+#ifdef NETSNMP_ENABLE_IPV6
+ DEBUGMSGTL(("mibII/kernel_linux/udp6stats",
+ "Reading /proc/net/snmp6 stats\n"));
+ if (NULL == (in = fopen("/proc/net/snmp6", "r"))) {
+ DEBUGMSGTL(("mibII/kernel_linux/udp6stats",
+ "Failed to open /proc/net/snmp6\n"));
+ return -1;
+ }
+
+ while (NULL != fgets(line, sizeof(line), in)) {
+ if (0 != strncmp(line, UDP6_STATS_LINE, UDP6_STATS_PREFIX_LEN))
+ continue;
+
+ if (1 != sscanf(line, "%*s %lu", &stats))
+ continue;
+
+ endp = strchr(line, ' ');
+ *endp = '\0';
+ DEBUGMSGTL(("mibII/kernel_linux/udp6stats", "Find tag: %s\n", line));
+
+ if (0 == strcmp(line + 4, "OutDatagrams")) {
+ cached_udp6_mib.udp6OutDatagrams = stats;
+ } else if (0 == strcmp(line + 4, "NoPorts")) {
+ cached_udp6_mib.udp6NoPorts = stats;
+ } else if (0 == strcmp(line + 4, "InDatagrams")) {
+ cached_udp6_mib.udp6InDatagrams = stats;
+ } else if (0 == strcmp(line + 4, "InErrors")) {
+ cached_udp6_mib.udp6InErrors = stats;
+ } else {
+ DEBUGMSGTL(("mibII/kernel_linux/udp6stats",
+ "%s is an unknown tag\n", line));
+ }
+ }
+
+ fclose(in);
+#endif
+
+ memcpy((char *) udp6stat, (char *) &cached_udp6_mib, sizeof(*udp6stat));
+ return 0;
+}
diff --git a/agent/mibgroup/mibII/kernel_linux.h b/agent/mibgroup/mibII/kernel_linux.h
new file mode 100644
index 0000000..6bf5d47
--- /dev/null
+++ b/agent/mibgroup/mibII/kernel_linux.h
@@ -0,0 +1,179 @@
+/*
+ * 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 ip6_mib {
+ unsigned long ip6InReceives;
+ unsigned long ip6InHdrErrors;
+ unsigned long ip6InTooBigErrors;
+ unsigned long ip6InNoRoutes;
+ unsigned long ip6InAddrErrors;
+ unsigned long ip6InUnknownProtos;
+ unsigned long ip6InTruncatedPkts;
+ unsigned long ip6InDiscards;
+ unsigned long ip6InDelivers;
+ unsigned long ip6OutForwDatagrams;
+ unsigned long ip6OutRequests;
+ unsigned long ip6OutDiscards;
+ unsigned long ip6OutNoRoutes;
+ unsigned long ip6ReasmTimeout;
+ unsigned long ip6ReasmReqds;
+ unsigned long ip6ReasmOKs;
+ unsigned long ip6ReasmFails;
+ unsigned long ip6FragOKs;
+ unsigned long ip6FragFails;
+ unsigned long ip6FragCreates;
+ unsigned long ip6InMcastPkts;
+ unsigned long ip6OutMcastPkts;
+};
+
+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 icmp6_mib {
+ unsigned long icmp6InMsgs;
+ unsigned long icmp6InErrors;
+ unsigned long icmp6InDestUnreachs;
+ unsigned long icmp6InPktTooBigs;
+ unsigned long icmp6InTimeExcds;
+ unsigned long icmp6InParmProblems;
+ unsigned long icmp6InEchos;
+ unsigned long icmp6InEchoReplies;
+ unsigned long icmp6InGroupMembQueries;
+ unsigned long icmp6InGroupMembResponses;
+ unsigned long icmp6InGroupMembReductions;
+ unsigned long icmp6InRouterSolicits;
+ unsigned long icmp6InRouterAdvertisements;
+ unsigned long icmp6InNeighborSolicits;
+ unsigned long icmp6InNeighborAdvertisements;
+ unsigned long icmp6InRedirects;
+ unsigned long icmp6OutMsgs;
+ unsigned long icmp6OutDestUnreachs;
+ unsigned long icmp6OutPktTooBigs;
+ unsigned long icmp6OutTimeExcds;
+ unsigned long icmp6OutParmProblems;
+ unsigned long icmp6OutEchoReplies;
+ unsigned long icmp6OutRouterSolicits;
+ unsigned long icmp6OutNeighborSolicits;
+ unsigned long icmp6OutNeighborAdvertisements;
+ unsigned long icmp6OutRedirects;
+ unsigned long icmp6OutGroupMembResponses;
+ unsigned long icmp6OutGroupMembReductions;
+};
+
+struct icmp_msg_mib {
+ unsigned long InType;
+ unsigned long OutType;
+};
+
+/* Lets use wrapper structures for future expansion */
+struct icmp4_msg_mib {
+ struct icmp_msg_mib vals[255];
+};
+
+struct icmp6_msg_mib {
+ struct icmp_msg_mib vals[255];
+};
+
+struct udp_mib {
+ unsigned long udpInDatagrams;
+ unsigned long udpNoPorts;
+ unsigned long udpInErrors;
+ unsigned long udpOutDatagrams;
+};
+
+struct udp6_mib {
+ unsigned long udp6InDatagrams;
+ unsigned long udp6NoPorts;
+ unsigned long udp6InErrors;
+ unsigned long udp6OutDatagrams;
+};
+
+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_ip6_stat(struct ip6_mib *);
+int linux_read_icmp_stat(struct icmp_mib *);
+int linux_read_icmp6_stat(struct icmp6_mib *);
+int linux_read_udp_stat(struct udp_mib *);
+int linux_read_udp6_stat(struct udp6_mib *);
+int linux_read_tcp_stat(struct tcp_mib *);
+int linux_read_icmp_msg_stat(struct icmp_mib *,
+ struct icmp4_msg_mib *,
+ int *flag);
+int linux_read_icmp6_msg_stat(struct icmp6_mib *,
+ struct icmp6_msg_mib *,
+ int *support);
+
+#endif /* _MIBGROUP_KERNEL_LINUX_H */
diff --git a/agent/mibgroup/mibII/kernel_netbsd.c b/agent/mibgroup/mibII/kernel_netbsd.c
new file mode 100644
index 0000000..93f38b7
--- /dev/null
+++ b/agent/mibgroup/mibII/kernel_netbsd.c
@@ -0,0 +1,198 @@
+/*
+ * NetBSD implementation for mapping the IP stat arrays into struct's
+ * Required for NetBSD versions produced after April 7th 2008 (4+)
+ *
+ * Based on: http://mail-index.netbsd.org/pkgsrc-users/2008/04/27/msg007095.html
+ */
+
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/protosw.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/ip_var.h>
+#include <netinet/icmp_var.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.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 "kernel_netbsd.h"
+
+#if defined(NETBSD_STATS_VIA_SYSCTL)
+
+int
+netbsd_read_icmp_stat(struct icmp_mib *mib)
+{
+ uint64_t icmpstat[ICMP_NSTATS];
+ size_t size = sizeof(icmpstat);
+ int i;
+
+ (void)memset(mib, 0, sizeof(*mib));
+
+ if (-1 == sysctlbyname("net.inet.icmp.stats", icmpstat, &size, NULL, 0))
+ return -1;
+
+ mib->icmpInMsgs = icmpstat[ICMP_STAT_BADCODE]
+ + icmpstat[ICMP_STAT_TOOSHORT]
+ + icmpstat[ICMP_STAT_CHECKSUM]
+ + icmpstat[ICMP_STAT_BADLEN];
+ for (i = 0; i <= ICMP_MAXTYPE; i++)
+ mib->icmpInMsgs += icmpstat[ICMP_STAT_INHIST + i];
+ mib->icmpInErrors = icmpstat[ICMP_STAT_BADCODE]
+ + icmpstat[ICMP_STAT_TOOSHORT]
+ + icmpstat[ICMP_STAT_CHECKSUM]
+ + icmpstat[ICMP_STAT_BADLEN];
+ mib->icmpInDestUnreachs = icmpstat[ICMP_STAT_INHIST + ICMP_UNREACH];
+ mib->icmpInTimeExcds = icmpstat[ICMP_STAT_INHIST + ICMP_TIMXCEED];
+ mib->icmpInParmProbs = icmpstat[ICMP_STAT_INHIST + ICMP_PARAMPROB];
+ mib->icmpInSrcQuenchs = icmpstat[ICMP_STAT_INHIST + ICMP_SOURCEQUENCH];
+ mib->icmpInRedirects = icmpstat[ICMP_STAT_INHIST + ICMP_REDIRECT];
+ mib->icmpInEchos = icmpstat[ICMP_STAT_INHIST + ICMP_ECHO];
+ mib->icmpInEchoReps = icmpstat[ICMP_STAT_INHIST + ICMP_ECHOREPLY];
+ mib->icmpInTimestamps = icmpstat[ICMP_STAT_INHIST + ICMP_TSTAMP];
+ mib->icmpInTimestampReps
+ = icmpstat[ICMP_STAT_INHIST + ICMP_TSTAMPREPLY];
+ mib->icmpInAddrMasks = icmpstat[ICMP_STAT_INHIST + ICMP_MASKREQ];
+ mib->icmpInAddrMaskReps = icmpstat[ICMP_STAT_INHIST + ICMP_MASKREPLY];
+ mib->icmpOutMsgs = icmpstat[ICMP_STAT_OLDSHORT]
+ + icmpstat[ICMP_STAT_OLDICMP];
+ for (i = 0; i <= ICMP_MAXTYPE; i++)
+ mib->icmpOutMsgs += icmpstat[ICMP_STAT_OUTHIST + i];
+ mib->icmpOutErrors = icmpstat[ICMP_STAT_OLDSHORT]
+ + icmpstat[ICMP_STAT_OLDICMP];
+ mib->icmpOutDestUnreachs = icmpstat[ICMP_STAT_OUTHIST + ICMP_UNREACH];
+ mib->icmpOutTimeExcds = icmpstat[ICMP_STAT_OUTHIST + ICMP_TIMXCEED];
+ mib->icmpOutParmProbs = icmpstat[ICMP_STAT_OUTHIST + ICMP_PARAMPROB];
+ mib->icmpOutSrcQuenchs
+ = icmpstat[ICMP_STAT_OUTHIST + ICMP_SOURCEQUENCH];
+ mib->icmpOutRedirects = icmpstat[ICMP_STAT_OUTHIST + ICMP_REDIRECT];
+ mib->icmpOutEchos = icmpstat[ICMP_STAT_OUTHIST + ICMP_ECHO];
+ mib->icmpOutEchoReps = icmpstat[ICMP_STAT_OUTHIST + ICMP_ECHOREPLY];
+ mib->icmpOutTimestamps = icmpstat[ICMP_STAT_OUTHIST + ICMP_TSTAMP];
+ mib->icmpOutTimestampReps
+ = icmpstat[ICMP_STAT_OUTHIST + ICMP_TSTAMPREPLY];
+ mib->icmpOutAddrMasks = icmpstat[ICMP_STAT_OUTHIST + ICMP_MASKREQ];
+ mib->icmpOutAddrMaskReps = icmpstat[ICMP_STAT_OUTHIST + ICMP_MASKREPLY];
+
+ return 0;
+}
+
+int
+netbsd_read_ip_stat(struct ip_mib *mib)
+{
+ uint64_t ipstat[IP_NSTATS];
+ size_t size = sizeof(ipstat);
+ int i;
+ static int sname[4] = { 4, 2, 0, 0 }; /* CTL_NET, PF_INET, IPPROTO_IP, 0 */
+ size_t len;
+
+ (void)memset(mib, 0, sizeof(*mib));
+
+ if (-1 == sysctlbyname("net.inet.ip.stats", ipstat, &size, NULL, 0))
+ return -1;
+
+ mib->ipForwarding = 0;
+ len = sizeof i;
+ sname[3] = IPCTL_FORWARDING;
+ if (0 == sysctl(sname, 4, &i, &len, 0, 0)) {
+ mib->ipForwarding = (long)i;
+ }
+
+ mib->ipDefaultTTL = 0;
+ sname[3] = IPCTL_DEFTTL;
+ if (0 == sysctl(sname, 4, &i, &len, 0, 0)) {
+ mib->ipDefaultTTL = (long)i;
+ }
+
+ mib->ipInReceives = ipstat[IP_STAT_TOTAL];
+ mib->ipInHdrErrors = ipstat[IP_STAT_BADSUM]
+ + ipstat[IP_STAT_TOOSHORT] + ipstat[IP_STAT_TOOSMALL]
+ + ipstat[IP_STAT_BADHLEN] + ipstat[IP_STAT_BADLEN];
+ mib->ipInAddrErrors = ipstat[IP_STAT_CANTFORWARD];
+ mib->ipForwDatagrams = ipstat[IP_STAT_FORWARD];
+ mib->ipInUnknownProtos = ipstat[IP_STAT_NOPROTO];
+ mib->ipInDiscards = ipstat[IP_STAT_FRAGDROPPED]; /* FIXME */
+ mib->ipInDelivers = ipstat[IP_STAT_DELIVERED];
+ mib->ipOutRequests = ipstat[IP_STAT_LOCALOUT];
+ mib->ipOutDiscards = ipstat[IP_STAT_ODROPPED];
+ mib->ipOutNoRoutes = 0; /* FIXME */
+ mib->ipReasmTimeout = 0; /* IPFRAGTTL; */
+ mib->ipReasmReqds = ipstat[IP_STAT_FRAGMENTS];
+ mib->ipReasmOKs = ipstat[IP_STAT_REASSEMBLED];
+ mib->ipReasmFails = ipstat[IP_STAT_FRAGDROPPED]
+ + ipstat[IP_STAT_FRAGTIMEOUT];
+ mib->ipFragOKs = ipstat[IP_STAT_FRAGMENTS];
+ mib->ipFragFails = ipstat[IP_STAT_CANTFRAG];
+ mib->ipFragCreates = ipstat[IP_STAT_OFRAGMENTS];
+ mib->ipRoutingDiscards = ipstat[IP_STAT_NOROUTE];
+
+ return 0;
+}
+
+int
+netbsd_read_tcp_stat(struct tcp_mib *mib)
+{
+ uint64_t tcpstat[TCP_NSTATS];
+ size_t size = sizeof(tcpstat);
+
+ (void)memset(mib, 0, sizeof(*mib));
+
+ if (-1 == sysctlbyname("net.inet.tcp.stats", tcpstat, &size, NULL, 0))
+ return -1;
+
+ mib->tcpRtoAlgorithm = 4; /* Assume Van Jacobsen's algorithm */
+ mib->tcpRtoMin = TCPTV_MIN;
+ mib->tcpRtoMax = TCPTV_REXMTMAX;
+ mib->tcpMaxConn = -1; /* Dynamic Maximum */
+ mib->tcpActiveOpens = tcpstat[TCP_STAT_CONNATTEMPT];
+ mib->tcpPassiveOpens = tcpstat[TCP_STAT_ACCEPTS];
+ mib->tcpAttemptFails = tcpstat[TCP_STAT_CONNDROPS];
+ mib->tcpEstabResets = tcpstat[TCP_STAT_DROPS];
+ mib->tcpCurrEstab = 0; /* FIXME */
+ mib->tcpInSegs = tcpstat[TCP_STAT_RCVTOTAL];
+ mib->tcpOutSegs = tcpstat[TCP_STAT_SNDTOTAL]
+ - tcpstat[TCP_STAT_SNDREXMITPACK];
+ mib->tcpRetransSegs = tcpstat[TCP_STAT_SNDREXMITPACK];
+ mib->tcpInErrs = tcpstat[TCP_STAT_RCVBADSUM]
+ + tcpstat[TCP_STAT_RCVBADOFF]
+ + tcpstat[TCP_STAT_RCVMEMDROP]
+ + tcpstat[TCP_STAT_RCVSHORT];
+ mib->tcpOutRsts = tcpstat[TCP_STAT_SNDCTRL]
+ - tcpstat[TCP_STAT_CLOSED];
+ mib->tcpInErrsValid = mib->tcpInErrs; /* FIXME */
+ mib->tcpOutRstsValid = mib->tcpOutRsts; /* FIXME */
+
+ return 0;
+}
+
+int
+netbsd_read_udp_stat(struct udp_mib *mib)
+{
+ uint64_t udpstat[UDP_NSTATS];
+ size_t size = sizeof(udpstat);
+
+ (void)memset(mib, 0, sizeof(*mib));
+
+ if (-1 == sysctlbyname("net.inet.udp.stats", udpstat, &size, NULL, 0))
+ return -1;
+
+ mib->udpInDatagrams = udpstat[UDP_STAT_IPACKETS];
+ mib->udpNoPorts = udpstat[UDP_STAT_NOPORT];
+ mib->udpOutDatagrams = udpstat[UDP_STAT_OPACKETS];
+ mib->udpInErrors = udpstat[UDP_STAT_HDROPS]
+ + udpstat[UDP_STAT_BADSUM] /* + udpstat[UDP_STAT_DISCARD] /* FIXME */
+ + udpstat[UDP_STAT_FULLSOCK] + udpstat[UDP_STAT_BADLEN];
+
+ return 0;
+}
+
+#endif
diff --git a/agent/mibgroup/mibII/kernel_netbsd.h b/agent/mibgroup/mibII/kernel_netbsd.h
new file mode 100644
index 0000000..9000682
--- /dev/null
+++ b/agent/mibgroup/mibII/kernel_netbsd.h
@@ -0,0 +1,91 @@
+#ifndef _MIBGROUP_KERNEL_NETBSD_H
+#define _MIBGROUP_KERNEL_NETBSD_H
+
+#if defined(NETBSD_STATS_VIA_SYSCTL)
+
+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 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 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;
+};
+
+struct udp_mib {
+ unsigned long udpInDatagrams;
+ unsigned long udpNoPorts;
+ unsigned long udpInErrors;
+ unsigned long udpOutDatagrams;
+};
+
+int netbsd_read_icmp_stat(struct icmp_mib *);
+int netbsd_read_ip_stat(struct ip_mib *);
+int netbsd_read_tcp_stat(struct tcp_mib *);
+int netbsd_read_udp_stat(struct udp_mib *);
+
+#endif /* NETBSD_STATS_VIA_SYSCTL */
+
+#endif /* _MIBGROUP_KERNEL_NETBSD_H */
diff --git a/agent/mibgroup/mibII/mibII_common.h b/agent/mibgroup/mibII/mibII_common.h
new file mode 100644
index 0000000..160ab82
--- /dev/null
+++ b/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_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(NETSNMP_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
+#ifdef NETBSD_STATS_VIA_SYSCTL
+#include "kernel_netbsd.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/agent/mibgroup/mibII/mta_sendmail.c b/agent/mibgroup/mibII/mta_sendmail.c
new file mode 100644
index 0000000..00397d3
--- /dev/null
+++ b/agent/mibgroup/mibII/mta_sendmail.c
@@ -0,0 +1,1510 @@
+/*
+ * 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
+
+#include <errno.h>
+#include <stdarg.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, NETSNMP_OLDAPI_RONLY,
+ var_mtaEntry, 3, {1, 1, 1}},
+ {MTASTOREDMESSAGES, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_mtaEntry, 3, {1, 1, 2}},
+ {MTATRANSMITTEDMESSAGES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_mtaEntry, 3, {1, 1, 3}},
+ {MTARECEIVEDVOLUME, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_mtaEntry, 3, {1, 1, 4}},
+ {MTASTOREDVOLUME, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_mtaEntry, 3, {1, 1, 5}},
+ {MTATRANSMITTEDVOLUME, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_mtaEntry, 3, {1, 1, 6}},
+
+ {MTAGROUPRECEIVEDMESSAGES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_mtaGroupEntry, 3, {2, 1, 2}},
+ {MTAGROUPREJECTEDMESSAGES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_mtaGroupEntry, 3, {2, 1, 3}},
+ {MTAGROUPSTOREDMESSAGES, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_mtaGroupEntry, 3, {2, 1, 4}},
+ {MTAGROUPTRANSMITTEDMESSAGES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_mtaGroupEntry, 3, {2, 1, 5}},
+ {MTAGROUPRECEIVEDVOLUME, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_mtaGroupEntry, 3, {2, 1, 6}},
+ {MTAGROUPSTOREDVOLUME, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_mtaGroupEntry, 3, {2, 1, 7}},
+ {MTAGROUPTRANSMITTEDVOLUME, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_mtaGroupEntry, 3, {2, 1, 8}},
+ {MTAGROUPNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_mtaGroupEntry, 3, {2, 1, 25}},
+ {MTAGROUPHIERARCHY, ASN_INTEGER, NETSNMP_OLDAPI_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
+ *
+ */
+static void
+print_error(int priority, BOOL config, BOOL config_only,
+ const char *function, const char *format, ...)
+{
+ 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 */
+
+ va_start(ap, format);
+ 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[SNMP_MAXPATH];
+ 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) {
+ strlcpy(sendmailst_fn, filename, sizeof(sendmailst_fn));
+ 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 one past the next ,
+ */
+ while (*p && *p != ',') {
+ p++;
+ }
+ if (*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++;
+ }
+
+ fclose(sendmailcf_fp);
+
+ 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) {
+ netsnmp_config_error("couldn't open file \"%s\"", sendmailst_fn);
+ 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/agent/mibgroup/mibII/mta_sendmail.h b/agent/mibgroup/mibII/mta_sendmail.h
new file mode 100644
index 0000000..8368ca9
--- /dev/null
+++ b/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/agent/mibgroup/mibII/route_headers.h b/agent/mibgroup/mibII/route_headers.h
new file mode 100644
index 0000000..eace2e2
--- /dev/null
+++ b/agent/mibgroup/mibII/route_headers.h
@@ -0,0 +1,181 @@
+#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"
+
+#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
+# 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_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 HAVE_STRUCT_RTENTRY_RT_UNIT
+#define rt_unit rt_refcnt /* Reuse this field for device # */
+#endif
+#ifndef HAVE_STRUCT_RTENTRY_RT_DST
+#define rt_dst rt_nodes->rn_key
+#endif
+#else /* RTENTRY_4_3 */
+#ifndef HAVE_STRUCT_RTENTRY_RT_DST
+#define rt_dst rt_nodes->rn_key
+#endif
+#ifndef HAVE_STRUCT_RTENTRY_RT_HASH
+#define rt_hash rt_pad1
+#endif
+#ifndef HAVE_STRUCT_RTENTRY_RT_REFCNT
+#ifndef hpux10
+#define rt_refcnt rt_pad2
+#endif
+#endif
+#ifndef HAVE_STRUCT_RTENTRY_RT_USE
+#define rt_use rt_pad3
+#endif
+#ifndef HAVE_STRUCT_RTENTRY_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_NLIST_H
+#include <nlist.h>
+#endif
+
+#ifdef solaris2
+#include "kernel_sunos5.h"
+/* Solaris 2.6/7 need sys/stream.h (mblk_t) to include inet/ip.h */
+#ifdef HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+/* Solaris 2.6 needs inet/common.h (u16) to include inet/ip.h */
+#ifdef HAVE_INET_COMMON_H
+#include <inet/common.h>
+#endif
+#ifdef HAVE_INET_IP_H
+#include <inet/ip.h>
+#endif /* HAVE_INET_IP_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/agent/mibgroup/mibII/route_write.c b/agent/mibgroup/mibII/route_write.c
new file mode 100644
index 0000000..5820ee1
--- /dev/null
+++ b/agent/mibgroup/mibII/route_write.c
@@ -0,0 +1,831 @@
+/* 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
+
+#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 HAVE_STRUCT_RTENTRY_RT_DST
+#define rt_dst rt_nodes->rn_key
+#endif
+#ifndef HAVE_STRUCT_RTENTRY_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) || defined(__OpenBSD__) || defined(darwin))
+ 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;
+
+#elif (defined __OpenBSD__ || defined(darwin))
+
+ int s, rc;
+ struct {
+ struct rt_msghdr hdr;
+ struct sockaddr_in dst;
+ struct sockaddr_in gateway;
+ } rtmsg;
+
+ s = socket(PF_ROUTE, SOCK_RAW, 0);
+ if (s < 0) {
+ snmp_log_perror("socket");
+ return -1;
+ }
+
+ shutdown(s, SHUT_RD);
+
+ /* possible panic otherwise */
+ flags |= (RTF_UP | RTF_GATEWAY);
+
+ bzero(&rtmsg, sizeof(rtmsg));
+
+ rtmsg.hdr.rtm_type = RTM_ADD;
+ rtmsg.hdr.rtm_version = RTM_VERSION;
+ rtmsg.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY;
+ rtmsg.hdr.rtm_flags = RTF_GATEWAY;
+
+ rtmsg.dst.sin_len = sizeof(rtmsg.dst);
+ rtmsg.dst.sin_family = AF_INET;
+ rtmsg.dst.sin_addr.s_addr = htonl(dstip);
+
+ rtmsg.gateway.sin_len = sizeof(rtmsg.gateway);
+ rtmsg.gateway.sin_family = AF_INET;
+ rtmsg.gateway.sin_addr.s_addr = htonl(gwip);
+
+ rc = sizeof(rtmsg);
+ rtmsg.hdr.rtm_msglen = rc;
+
+ if ((rc = write(s, &rtmsg, rc)) < 0) {
+ snmp_log_perror("writing to routing socket");
+ return -1;
+ }
+ return (rc);
+#else /* SIOCADDRT */
+ return -1;
+#endif
+}
+
+
+
+int
+delRoute(u_long dstip, u_long gwip, u_long iff, u_short flags)
+{
+#if defined SIOCADDRT && !(defined(irix6) || defined(__OpenBSD__) || defined(darwin))
+
+ 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;
+#elif (defined __OpenBSD__ || defined(darwin))
+
+ int s, rc;
+ struct {
+ struct rt_msghdr hdr;
+ struct sockaddr_in dst;
+ struct sockaddr_in gateway;
+ } rtmsg;
+
+ s = socket(PF_ROUTE, SOCK_RAW, 0);
+ if (s < 0) {
+ snmp_log_perror("socket");
+ return -1;
+ }
+
+ shutdown(s, SHUT_RD);
+
+ /* possible panic otherwise */
+ flags |= (RTF_UP | RTF_GATEWAY);
+
+ bzero(&rtmsg, sizeof(rtmsg));
+
+ rtmsg.hdr.rtm_type = RTM_DELETE;
+ rtmsg.hdr.rtm_version = RTM_VERSION;
+ rtmsg.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY;
+ rtmsg.hdr.rtm_flags = RTF_GATEWAY;
+
+ rtmsg.dst.sin_len = sizeof(rtmsg.dst);
+ rtmsg.dst.sin_family = AF_INET;
+ rtmsg.dst.sin_addr.s_addr = htonl(dstip);
+
+ rtmsg.gateway.sin_len = sizeof(rtmsg.gateway);
+ rtmsg.gateway.sin_family = AF_INET;
+ rtmsg.gateway.sin_addr.s_addr = htonl(gwip);
+
+ rc = sizeof(rtmsg);
+ rtmsg.hdr.rtm_msglen = rc;
+
+ if ((rc = write(s, &rtmsg, rc)) < 0) {
+ snmp_log_perror("writing to routing socket");
+ return -1;
+ }
+ return (rc);
+#else /* SIOCDELRT */
+ return 0;
+#endif
+}
+
+
+#ifndef HAVE_STRUCT_RTENTRY_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 NULL;
+}
+
+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 NULL;
+
+}
+
+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 NULL; /* 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);
+
+ 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);
+
+ rp->xx_nextIR = *((u_long *) buf);
+
+ } else if (action == COMMIT) {
+ rp->rt_nextIR = rp->xx_nextIR;
+ }
+ break;
+
+
+ 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;
+}
+
+#elif defined(HAVE_IPHLPAPI_H) /* 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 %lu\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/agent/mibgroup/mibII/route_write.h b/agent/mibgroup/mibII/route_write.h
new file mode 100644
index 0000000..4d6b912
--- /dev/null
+++ b/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/agent/mibgroup/mibII/setSerialNo.c b/agent/mibgroup/mibII/setSerialNo.c
new file mode 100644
index 0000000..85a4098
--- /dev/null
+++ b/agent/mibgroup/mibII/setSerialNo.c
@@ -0,0 +1,84 @@
+/**
+ * This file implements the snmpSetSerialNo TestAndIncr counter
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+netsnmp_feature_require(watcher_spinlock)
+
+
+#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
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ netsnmp_register_watched_spinlock(
+ netsnmp_create_handler_registration("snmpSetSerialNo", NULL,
+ set_serial_oid,
+ OID_LENGTH(set_serial_oid),
+ HANDLER_CAN_RWRITE),
+ &setserialno );
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ netsnmp_register_watched_spinlock(
+ netsnmp_create_handler_registration("snmpSetSerialNo", NULL,
+ set_serial_oid,
+ OID_LENGTH(set_serial_oid),
+ HANDLER_CAN_RONLY),
+ &setserialno );
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ DEBUGMSGTL(("scalar_int", "Done initalizing example scalar int\n"));
+}
+
diff --git a/agent/mibgroup/mibII/setSerialNo.h b/agent/mibgroup/mibII/setSerialNo.h
new file mode 100644
index 0000000..4ffd871
--- /dev/null
+++ b/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/agent/mibgroup/mibII/snmp_mib.c b/agent/mibgroup/mibII/snmp_mib.c
new file mode 100644
index 0000000..a056d99
--- /dev/null
+++ b/agent/mibgroup/mibII/snmp_mib.c
@@ -0,0 +1,133 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/sysORTable.h>
+
+#include "snmp_mib.h"
+#include "updates.h"
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_truthvalue)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+static const oid snmp_oid[] = { 1, 3, 6, 1, 2, 1, 11 };
+
+extern long snmp_enableauthentraps;
+extern int snmp_enableauthentrapsset;
+
+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 %ld",
+ snmp_enableauthentraps);
+ snmpd_store_config(line);
+ }
+ return 0;
+}
+
+static int
+handle_truthvalue(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (reqinfo->mode == MODE_SET_RESERVE1) {
+ int res = netsnmp_check_vb_truthvalue(requests->requestvb);
+ if (res != SNMP_ERR_NOERROR)
+ netsnmp_request_set_error(requests, res);
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ return SNMP_ERR_NOERROR;
+}
+
+static netsnmp_mib_handler*
+netsnmp_get_truthvalue(void)
+{
+ return netsnmp_create_handler("truthvalue", handle_truthvalue);
+}
+
+static int
+handle_snmp(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ {
+ oid idx = requests->requestvb->name[OID_LENGTH(snmp_oid)];
+ switch(idx) {
+ case 7:
+ case 23:
+ case 30:
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_NOSUCHOBJECT);
+ break;
+ default:
+ {
+ u_int value =
+ snmp_get_statistic(idx - 1 + STAT_SNMPINPKTS);
+ snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER,
+ (u_char *)&value, sizeof(value));
+ }
+ break;
+ }
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_snmp\n", reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+#ifdef USING_MIBII_SYSTEM_MIB_MODULE
+extern oid system_module_oid[];
+extern int system_module_oid_len;
+extern int system_module_count;
+#endif
+
+/** Initializes the snmp module */
+void
+init_snmp_mib(void)
+{
+ DEBUGMSGTL(("snmp", "Initializing\n"));
+
+ netsnmp_register_scalar_group(
+ netsnmp_create_handler_registration(
+ "mibII/snmp", handle_snmp, snmp_oid, OID_LENGTH(snmp_oid),
+ HANDLER_CAN_RONLY), 1, 32);
+ {
+ const oid snmpEnableAuthenTraps_oid[] = { 1, 3, 6, 1, 2, 1, 11, 30, 0 };
+ static netsnmp_watcher_info enableauthen_info;
+ netsnmp_handler_registration *reg =
+ netsnmp_create_update_handler_registration(
+ "mibII/snmpEnableAuthenTraps",
+ snmpEnableAuthenTraps_oid,
+ OID_LENGTH(snmpEnableAuthenTraps_oid),
+ HANDLER_CAN_RWRITE, &snmp_enableauthentrapsset);
+ netsnmp_inject_handler(reg, netsnmp_get_truthvalue());
+ netsnmp_register_watched_instance(
+ reg,
+ netsnmp_init_watcher_info(
+ &enableauthen_info,
+ &snmp_enableauthentraps, sizeof(snmp_enableauthentraps),
+ ASN_INTEGER, WATCHER_FIXED_SIZE));
+ }
+
+#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);
+}
diff --git a/agent/mibgroup/mibII/snmp_mib.h b/agent/mibgroup/mibII/snmp_mib.h
new file mode 100644
index 0000000..39e0a3c
--- /dev/null
+++ b/agent/mibgroup/mibII/snmp_mib.h
@@ -0,0 +1,9 @@
+#ifndef _MIBGROUP_SNMP_H
+#define _MIBGROUP_SNMP_H
+
+config_require(mibII/updates)
+config_exclude(mibII/snmp_mib_5_5)
+
+void init_snmp_mib(void);
+
+#endif /* _MIBGROUP_SNMP_H */
diff --git a/agent/mibgroup/mibII/snmp_mib_5_5.c b/agent/mibgroup/mibII/snmp_mib_5_5.c
new file mode 100644
index 0000000..6484e3c
--- /dev/null
+++ b/agent/mibgroup/mibII/snmp_mib_5_5.c
@@ -0,0 +1,128 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/sysORTable.h>
+
+#include <net-snmp/agent/snmp_get_statistic.h>
+
+#include "snmp_mib_5_5.h"
+#include "updates.h"
+
+netsnmp_feature_require(helper_statistics)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_truthvalue)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+#define SNMP_OID 1, 3, 6, 1, 2, 1, 11
+
+static oid snmp_oid[] = { SNMP_OID };
+
+extern long snmp_enableauthentraps;
+extern int snmp_enableauthentrapsset;
+
+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 %ld",
+ snmp_enableauthentraps);
+ snmpd_store_config(line);
+ }
+ return 0;
+}
+
+static int
+handle_truthvalue(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (reqinfo->mode == MODE_SET_RESERVE1) {
+ int res = netsnmp_check_vb_truthvalue(requests->requestvb);
+ if (res != SNMP_ERR_NOERROR)
+ netsnmp_request_set_error(requests, res);
+ }
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ return SNMP_ERR_NOERROR;
+}
+
+static netsnmp_mib_handler*
+netsnmp_get_truthvalue(void)
+{
+ return netsnmp_create_handler("truthvalue", handle_truthvalue);
+}
+
+static int
+handle_snmp(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ switch(requests->requestvb->name[OID_LENGTH(snmp_oid)]) {
+ case 7:
+ case 23:
+ case 30:
+ netsnmp_set_request_error(reqinfo, requests, SNMP_NOSUCHOBJECT);
+ break;
+ default:
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+#ifdef USING_MIBII_SYSTEM_MIB_MODULE
+extern oid system_module_oid[];
+extern int system_module_oid_len;
+extern int system_module_count;
+#endif
+
+/** Initializes the snmp module */
+void
+init_snmp_mib_5_5(void)
+{
+ DEBUGMSGTL(("snmp", "Initializing\n"));
+
+ NETSNMP_REGISTER_STATISTIC_HANDLER(
+ netsnmp_create_handler_registration(
+ "mibII/snmp", handle_snmp, snmp_oid, OID_LENGTH(snmp_oid),
+ HANDLER_CAN_RONLY),
+ 1, SNMP);
+ {
+ oid snmpEnableAuthenTraps_oid[] = { SNMP_OID, 30, 0 };
+ static netsnmp_watcher_info enableauthen_info;
+ netsnmp_handler_registration *reg =
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ netsnmp_create_update_handler_registration(
+ "mibII/snmpEnableAuthenTraps",
+ snmpEnableAuthenTraps_oid,
+ OID_LENGTH(snmpEnableAuthenTraps_oid),
+ HANDLER_CAN_RWRITE, &snmp_enableauthentrapsset);
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ netsnmp_create_update_handler_registration(
+ "mibII/snmpEnableAuthenTraps",
+ snmpEnableAuthenTraps_oid,
+ OID_LENGTH(snmpEnableAuthenTraps_oid),
+ HANDLER_CAN_RONLY, &snmp_enableauthentrapsset);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ netsnmp_inject_handler(reg, netsnmp_get_truthvalue());
+ netsnmp_register_watched_instance(
+ reg,
+ netsnmp_init_watcher_info(
+ &enableauthen_info,
+ &snmp_enableauthentraps, sizeof(snmp_enableauthentraps),
+ ASN_INTEGER, WATCHER_FIXED_SIZE));
+ }
+
+#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);
+}
diff --git a/agent/mibgroup/mibII/snmp_mib_5_5.h b/agent/mibgroup/mibII/snmp_mib_5_5.h
new file mode 100644
index 0000000..2e56103
--- /dev/null
+++ b/agent/mibgroup/mibII/snmp_mib_5_5.h
@@ -0,0 +1,4 @@
+config_require(mibII/updates)
+config_exclude(mibII/snmp_mib)
+
+void init_snmp_mib_5_5(void);
diff --git a/agent/mibgroup/mibII/sysORTable.c b/agent/mibgroup/mibII/sysORTable.c
new file mode 100644
index 0000000..ed26919
--- /dev/null
+++ b/agent/mibgroup/mibII/sysORTable.c
@@ -0,0 +1,295 @@
+#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 <net-snmp/agent/agent_sysORTable.h>
+#include <net-snmp/agent/sysORTable.h>
+
+#include "sysORTable.h"
+
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_require(table_container)
+
+
+/** Typical data structure for a row entry */
+typedef struct sysORTable_entry_s {
+ netsnmp_index oid_index;
+ oid sysORIndex;
+ const struct sysORTable* data;
+} sysORTable_entry;
+
+/*
+ * column number definitions for table sysORTable
+ */
+#define COLUMN_SYSORINDEX 1
+#define COLUMN_SYSORID 2
+#define COLUMN_SYSORDESCR 3
+#define COLUMN_SYSORUPTIME 4
+
+static netsnmp_container *table = NULL;
+static u_long sysORLastChange;
+static oid sysORNextIndex = 1;
+
+/** create a new row in the table */
+static void
+register_foreach(const struct sysORTable* data, void* dummy)
+{
+ sysORTable_entry *entry;
+
+ sysORLastChange = data->OR_uptime;
+
+ entry = SNMP_MALLOC_TYPEDEF(sysORTable_entry);
+ if (!entry) {
+ snmp_log(LOG_ERR,
+ "could not allocate storage, sysORTable is inconsistent\n");
+ } else {
+ const oid firstNext = sysORNextIndex;
+ netsnmp_iterator* it = CONTAINER_ITERATOR(table);
+
+ do {
+ const sysORTable_entry* value;
+ const oid cur = sysORNextIndex;
+
+ if (sysORNextIndex == SNMP_MIN(MAX_SUBID, 2147483647UL))
+ sysORNextIndex = 1;
+ else
+ ++sysORNextIndex;
+
+ for (value = (sysORTable_entry*)it->curr(it);
+ value && value->sysORIndex < cur;
+ value = (sysORTable_entry*)ITERATOR_NEXT(it)) {
+ }
+
+ if (value && value->sysORIndex == cur) {
+ if (sysORNextIndex < cur)
+ it->reset(it);
+ } else {
+ entry->sysORIndex = cur;
+ break;
+ }
+ } while (firstNext != sysORNextIndex);
+
+ ITERATOR_RELEASE(it);
+
+ if(firstNext == sysORNextIndex) {
+ snmp_log(LOG_ERR, "Failed to locate a free index in sysORTable\n");
+ free(entry);
+ } else {
+ entry->data = data;
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = &entry->sysORIndex;
+
+ CONTAINER_INSERT(table, entry);
+ }
+ }
+}
+
+static int
+register_cb(int major, int minor, void* serv, void* client)
+{
+ DEBUGMSGTL(("mibII/sysORTable/register_cb",
+ "register_cb(%d, %d, %p, %p)\n", major, minor, serv, client));
+ register_foreach((struct sysORTable*)serv, NULL);
+ return SNMP_ERR_NOERROR;
+}
+
+/** remove a row from the table */
+static int
+unregister_cb(int major, int minor, void* serv, void* client)
+{
+ sysORTable_entry *value;
+ netsnmp_iterator* it = CONTAINER_ITERATOR(table);
+
+ DEBUGMSGTL(("mibII/sysORTable/unregister_cb",
+ "unregister_cb(%d, %d, %p, %p)\n", major, minor, serv, client));
+ sysORLastChange = ((struct sysORTable*)(serv))->OR_uptime;
+
+ while ((value = (sysORTable_entry*)ITERATOR_NEXT(it)) && value->data != serv);
+ ITERATOR_RELEASE(it);
+ if(value) {
+ CONTAINER_REMOVE(table, value);
+ free(value);
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/** handles requests for the sysORTable table */
+static int
+sysORTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+
+ DEBUGMSGTL(("mibII/sysORTable/sysORTable_handler",
+ "sysORTable_handler called\n"));
+
+ if (reqinfo->mode != MODE_GET) {
+ snmp_log(LOG_ERR,
+ "Got unexpected operation for sysORTable\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ request = requests;
+ while(request && request->processed)
+ request = request->next;
+ while(request) {
+ sysORTable_entry *table_entry;
+ netsnmp_table_request_info *table_info;
+
+ if (NULL == (table_info = netsnmp_extract_table_info(request))) {
+ snmp_log(LOG_ERR,
+ "could not extract table info for sysORTable\n");
+ snmp_set_var_typed_value(
+ request->requestvb, SNMP_ERR_GENERR, NULL, 0);
+ } else if(NULL == (table_entry = (sysORTable_entry *)
+ netsnmp_container_table_extract_context(request))) {
+ switch (table_info->colnum) {
+ case COLUMN_SYSORID:
+ case COLUMN_SYSORDESCR:
+ case COLUMN_SYSORUPTIME:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ break;
+ }
+ } else {
+ switch (table_info->colnum) {
+ case COLUMN_SYSORID:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_OBJECT_ID,
+ (const u_char*)table_entry->data->OR_oid,
+ table_entry->data->OR_oidlen * sizeof(oid));
+ break;
+ case COLUMN_SYSORDESCR:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_OCTET_STR,
+ (const u_char*)table_entry->data->OR_descr,
+ strlen(table_entry->data->OR_descr));
+ break;
+ case COLUMN_SYSORUPTIME:
+ snmp_set_var_typed_integer(
+ request->requestvb, ASN_TIMETICKS,
+ table_entry->data->OR_uptime);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ do {
+ request = request->next;
+ } while(request && request->processed);
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+#ifdef USING_MIBII_SYSTEM_MIB_MODULE
+extern oid system_module_oid[];
+extern int system_module_oid_len;
+extern int system_module_count;
+#endif
+
+static netsnmp_handler_registration *sysORLastChange_reg;
+static netsnmp_watcher_info sysORLastChange_winfo;
+static netsnmp_handler_registration *sysORTable_reg;
+static netsnmp_table_registration_info *sysORTable_table_info;
+
+/** Initializes the sysORTable module */
+void
+init_sysORTable(void)
+{
+ const oid sysORLastChange_oid[] = { 1, 3, 6, 1, 2, 1, 1, 8 };
+ const oid sysORTable_oid[] = { 1, 3, 6, 1, 2, 1, 1, 9 };
+
+ sysORTable_table_info =
+ SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+
+ table = netsnmp_container_find("sysORTable:table_container");
+
+ if (sysORTable_table_info == NULL || table == NULL) {
+ SNMP_FREE(sysORTable_table_info);
+ CONTAINER_FREE(table);
+ return;
+ }
+ table->container_name = strdup("sysORTable");
+
+ netsnmp_table_helper_add_indexes(sysORTable_table_info,
+ ASN_INTEGER, /** index: sysORIndex */
+ 0);
+ sysORTable_table_info->min_column = COLUMN_SYSORID;
+ sysORTable_table_info->max_column = COLUMN_SYSORUPTIME;
+
+ sysORLastChange_reg =
+ netsnmp_create_handler_registration(
+ "mibII/sysORLastChange", NULL,
+ sysORLastChange_oid, OID_LENGTH(sysORLastChange_oid),
+ HANDLER_CAN_RONLY);
+ netsnmp_init_watcher_info(
+ &sysORLastChange_winfo,
+ &sysORLastChange, sizeof(u_long),
+ ASN_TIMETICKS, WATCHER_FIXED_SIZE);
+ netsnmp_register_watched_scalar(sysORLastChange_reg,
+ &sysORLastChange_winfo);
+
+ sysORTable_reg =
+ netsnmp_create_handler_registration(
+ "mibII/sysORTable", sysORTable_handler,
+ sysORTable_oid, OID_LENGTH(sysORTable_oid), HANDLER_CAN_RONLY);
+ netsnmp_container_table_register(sysORTable_reg, sysORTable_table_info,
+ table, TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+
+ sysORLastChange = netsnmp_get_agent_uptime();
+
+ /*
+ * Initialise the contents of the table here
+ */
+ netsnmp_sysORTable_foreach(&register_foreach, NULL);
+
+ /*
+ * Register callbacks
+ */
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REG_SYSOR, register_cb, NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREG_SYSOR, unregister_cb, 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
+}
+
+void
+shutdown_sysORTable(void)
+{
+#ifdef USING_MIBII_SYSTEM_MIB_MODULE
+ if (system_module_count-- == 3)
+ UNREGISTER_SYSOR_TABLE(system_module_oid, system_module_oid_len);
+#endif
+
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREG_SYSOR, unregister_cb, NULL,
+ 1);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REG_SYSOR, register_cb, NULL, 1);
+
+ if (table)
+ CONTAINER_CLEAR(table, netsnmp_container_simple_free, NULL);
+ netsnmp_container_table_unregister(sysORTable_reg);
+ sysORTable_reg = NULL;
+ table = NULL;
+ netsnmp_table_registration_info_free(sysORTable_table_info);
+ sysORTable_table_info = NULL;
+ netsnmp_unregister_handler(sysORLastChange_reg);
+ sysORLastChange_reg = NULL;
+}
diff --git a/agent/mibgroup/mibII/sysORTable.h b/agent/mibgroup/mibII/sysORTable.h
new file mode 100644
index 0000000..e988fda
--- /dev/null
+++ b/agent/mibgroup/mibII/sysORTable.h
@@ -0,0 +1,15 @@
+#ifndef MIBGROUP_SYSORTABLE_H
+#define MIBGROUP_SYSORTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void init_sysORTable(void);
+extern void shutdown_sysORTable(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MIBGROUP_SYSORTABLE_H */
diff --git a/agent/mibgroup/mibII/system_mib.c b/agent/mibgroup/mibII/system_mib.c
new file mode 100644
index 0000000..65b0b7c
--- /dev/null
+++ b/agent/mibgroup/mibII/system_mib.c
@@ -0,0 +1,586 @@
+/*
+ * 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>
+#include <net-snmp/net-snmp-features.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_UTSNAME_H
+#include <utsname.h>
+#else
+#if HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/sysORTable.h>
+
+#include "util_funcs.h"
+#include "system_mib.h"
+#include "updates.h"
+
+netsnmp_feature_require(watcher_read_only_int_scalar)
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+#define SYS_STRING_LEN 256
+static char version_descr[SYS_STRING_LEN] = NETSNMP_VERS_DESC;
+static char sysContact[SYS_STRING_LEN] = NETSNMP_SYS_CONTACT;
+static char sysName[SYS_STRING_LEN] = NETSNMP_SYS_NAME;
+static char sysLocation[SYS_STRING_LEN] = NETSNMP_SYS_LOC;
+static oid sysObjectID[MAX_OID_LEN];
+static size_t sysObjectIDByteLength;
+
+extern oid version_sysoid[];
+extern int version_sysoid_len;
+
+static int sysServices = 72;
+static int sysServicesConfiged = 0;
+
+extern oid version_id[];
+extern int version_id_len;
+
+static int sysContactSet = 0, sysLocationSet = 0, sysNameSet = 0;
+
+#if (defined (WIN32) && defined (HAVE_WIN32_PLATFORM_SDK)) || defined (mingw32)
+static void windowsOSVersionString(char [], size_t);
+#endif
+
+ /*********************
+ *
+ * snmpd.conf config parsing
+ *
+ *********************/
+
+static void
+system_parse_config_string2(const char *token, char *cptr,
+ char* value, size_t size)
+{
+ if (strlen(cptr) < size) {
+ strcpy(value, cptr);
+ } else {
+ netsnmp_config_error("%s token too long (must be < %lu):\n\t%s",
+ token, (unsigned long)size, cptr);
+ }
+}
+
+static void
+system_parse_config_string(const char *token, char *cptr,
+ const char *name, char* value, size_t size,
+ int* guard)
+{
+ if (*token == 'p') {
+ if (*guard < 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- the value is
+ * already configured read-only.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only %s.0\n", name);
+ return;
+ } else {
+ *guard = 1;
+ }
+ } else {
+ if (*guard > 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- we already read a
+ * persistent value which we should ignore in favour of this one.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only %s.0\n", name);
+ /*
+ * Fall through and copy in this value.
+ */
+ }
+ *guard = -1;
+ }
+
+ system_parse_config_string2(token, cptr, value, size);
+}
+
+static void
+system_parse_config_sysdescr(const char *token, char *cptr)
+{
+ system_parse_config_string2(token, cptr, version_descr,
+ sizeof(version_descr));
+}
+
+static void
+system_parse_config_sysloc(const char *token, char *cptr)
+{
+ system_parse_config_string(token, cptr, "sysLocation", sysLocation,
+ sizeof(sysLocation), &sysLocationSet);
+}
+
+static void
+system_parse_config_syscon(const char *token, char *cptr)
+{
+ system_parse_config_string(token, cptr, "sysContact", sysContact,
+ sizeof(sysContact), &sysContactSet);
+}
+
+static void
+system_parse_config_sysname(const char *token, char *cptr)
+{
+ system_parse_config_string(token, cptr, "sysName", sysName,
+ sizeof(sysName), &sysNameSet);
+}
+
+static void
+system_parse_config_sysServices(const char *token, char *cptr)
+{
+ sysServices = atoi(cptr);
+ sysServicesConfiged = 1;
+}
+
+static void
+system_parse_config_sysObjectID(const char *token, char *cptr)
+{
+ size_t sysObjectIDLength = MAX_OID_LEN;
+ if (!read_objid(cptr, sysObjectID, &sysObjectIDLength)) {
+ netsnmp_config_error("sysobjectid token not a parsable OID:\n\t%s",
+ cptr);
+ sysObjectIDByteLength = version_sysoid_len * sizeof(oid);
+ memcpy(sysObjectID, version_sysoid, sysObjectIDByteLength);
+ } else
+
+ sysObjectIDByteLength = sysObjectIDLength * sizeof(oid);
+}
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+oid system_module_oid[] = { SNMP_OID_SNMPMODULES, 1 };
+int system_module_oid_len = OID_LENGTH(system_module_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;
+}
+
+static int
+handle_sysServices(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+#if NETSNMP_NO_DUMMY_VALUES
+ if (reqinfo->mode == MODE_GET && !sysServicesConfiged)
+ netsnmp_request_set_error(requests, SNMP_NOSUCHINSTANCE);
+#endif
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+handle_sysUpTime(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ snmp_set_var_typed_integer(requests->requestvb, ASN_TIMETICKS,
+ netsnmp_get_agent_uptime());
+ return SNMP_ERR_NOERROR;
+}
+
+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);
+ strlcpy(version_descr, extmp.output, sizeof(version_descr));
+ if (strlen(version_descr) >= 1)
+ 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
+ strlcpy(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);
+ strlcpy(sysName, extmp.output, sizeof(sysName));
+ if (strlen(sysName) >= 1)
+ 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));
+ sysObjectIDByteLength = version_sysoid_len * sizeof(oid);
+
+ {
+ const oid sysDescr_oid[] = { 1, 3, 6, 1, 2, 1, 1, 1 };
+ static netsnmp_watcher_info sysDescr_winfo;
+ netsnmp_register_watched_scalar(
+ netsnmp_create_handler_registration(
+ "mibII/sysDescr", NULL, sysDescr_oid, OID_LENGTH(sysDescr_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_init_watcher_info(&sysDescr_winfo, version_descr, 0,
+ ASN_OCTET_STR, WATCHER_SIZE_STRLEN));
+ }
+ {
+ const oid sysObjectID_oid[] = { 1, 3, 6, 1, 2, 1, 1, 2 };
+ static netsnmp_watcher_info sysObjectID_winfo;
+ netsnmp_register_watched_scalar(
+ netsnmp_create_handler_registration(
+ "mibII/sysObjectID", NULL,
+ sysObjectID_oid, OID_LENGTH(sysObjectID_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_init_watcher_info6(
+ &sysObjectID_winfo, sysObjectID, 0, ASN_OBJECT_ID,
+ WATCHER_MAX_SIZE | WATCHER_SIZE_IS_PTR,
+ MAX_OID_LEN, &sysObjectIDByteLength));
+ }
+ {
+ const oid sysUpTime_oid[] = { 1, 3, 6, 1, 2, 1, 1, 3 };
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration(
+ "mibII/sysUpTime", handle_sysUpTime,
+ sysUpTime_oid, OID_LENGTH(sysUpTime_oid),
+ HANDLER_CAN_RONLY));
+ }
+ {
+ const oid sysContact_oid[] = { 1, 3, 6, 1, 2, 1, 1, 4 };
+ static netsnmp_watcher_info sysContact_winfo;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ netsnmp_register_watched_scalar(
+ netsnmp_create_update_handler_registration(
+ "mibII/sysContact", sysContact_oid, OID_LENGTH(sysContact_oid),
+ HANDLER_CAN_RWRITE, &sysContactSet),
+ netsnmp_init_watcher_info(
+ &sysContact_winfo, sysContact, SYS_STRING_LEN - 1,
+ ASN_OCTET_STR, WATCHER_MAX_SIZE | WATCHER_SIZE_STRLEN));
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ netsnmp_register_watched_scalar(
+ netsnmp_create_update_handler_registration(
+ "mibII/sysContact", sysContact_oid, OID_LENGTH(sysContact_oid),
+ HANDLER_CAN_RONLY, &sysContactSet),
+ netsnmp_init_watcher_info(
+ &sysContact_winfo, sysContact, SYS_STRING_LEN - 1,
+ ASN_OCTET_STR, WATCHER_MAX_SIZE | WATCHER_SIZE_STRLEN));
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ {
+ const oid sysName_oid[] = { 1, 3, 6, 1, 2, 1, 1, 5 };
+ static netsnmp_watcher_info sysName_winfo;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ netsnmp_register_watched_scalar(
+ netsnmp_create_update_handler_registration(
+ "mibII/sysName", sysName_oid, OID_LENGTH(sysName_oid),
+ HANDLER_CAN_RWRITE, &sysNameSet),
+ netsnmp_init_watcher_info(
+ &sysName_winfo, sysName, SYS_STRING_LEN - 1, ASN_OCTET_STR,
+ WATCHER_MAX_SIZE | WATCHER_SIZE_STRLEN));
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ netsnmp_register_watched_scalar(
+ netsnmp_create_update_handler_registration(
+ "mibII/sysName", sysName_oid, OID_LENGTH(sysName_oid),
+ HANDLER_CAN_RONLY, &sysNameSet),
+ netsnmp_init_watcher_info(
+ &sysName_winfo, sysName, SYS_STRING_LEN - 1, ASN_OCTET_STR,
+ WATCHER_MAX_SIZE | WATCHER_SIZE_STRLEN));
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ {
+ const oid sysLocation_oid[] = { 1, 3, 6, 1, 2, 1, 1, 6 };
+ static netsnmp_watcher_info sysLocation_winfo;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ netsnmp_register_watched_scalar(
+ netsnmp_create_update_handler_registration(
+ "mibII/sysLocation", sysLocation_oid,
+ OID_LENGTH(sysLocation_oid),
+ HANDLER_CAN_RWRITE, &sysLocationSet),
+ netsnmp_init_watcher_info(
+ &sysLocation_winfo, sysLocation, SYS_STRING_LEN - 1,
+ ASN_OCTET_STR, WATCHER_MAX_SIZE | WATCHER_SIZE_STRLEN));
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ netsnmp_register_watched_scalar(
+ netsnmp_create_update_handler_registration(
+ "mibII/sysLocation", sysLocation_oid,
+ OID_LENGTH(sysLocation_oid),
+ HANDLER_CAN_RONLY, &sysLocationSet),
+ netsnmp_init_watcher_info(
+ &sysLocation_winfo, sysLocation, SYS_STRING_LEN - 1,
+ ASN_OCTET_STR, WATCHER_MAX_SIZE | WATCHER_SIZE_STRLEN));
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ {
+ const oid sysServices_oid[] = { 1, 3, 6, 1, 2, 1, 1, 7 };
+ netsnmp_register_read_only_int_scalar(
+ "mibII/sysServices", sysServices_oid, OID_LENGTH(sysServices_oid),
+ &sysServices, handle_sysServices);
+ }
+ 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);
+}
+
+ /*********************
+ *
+ * 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/agent/mibgroup/mibII/system_mib.h b/agent/mibgroup/mibII/system_mib.h
new file mode 100644
index 0000000..dd16f08
--- /dev/null
+++ b/agent/mibgroup/mibII/system_mib.h
@@ -0,0 +1,16 @@
+#ifndef _MIBGROUP_SYSTEM_MIB_H
+#define _MIBGROUP_SYSTEM_MIB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+config_require(util_funcs mibII/updates)
+
+void init_system_mib(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MIBGROUP_SYSTEM_MIB_H */
diff --git a/agent/mibgroup/mibII/tcp.c b/agent/mibgroup/mibII/tcp.c
new file mode 100644
index 0000000..3c79fad
--- /dev/null
+++ b/agent/mibgroup/mibII/tcp.c
@@ -0,0 +1,828 @@
+
+/*
+ * TCP MIB group implementation - tcp.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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 <net-snmp/agent/sysORTable.h>
+
+#include "util_funcs/MIB_STATS_CACHE_TIMEOUT.h"
+#include "tcp.h"
+#include "tcpTable.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(aix7)) && !defined(FIRST_PROTOCOL)
+#ifdef HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#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
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS
+extern int TCP_Count_Connections( void );
+#endif /* NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS */
+ /*********************
+ *
+ * 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;
+ int rc;
+
+ /*
+ * 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);
+ rc = netsnmp_register_scalar_group(reginfo, TCPRTOALGORITHM, TCPOUTRSTS);
+ if (rc != SNMPERR_SUCCESS)
+ return;
+
+ /*
+ * .... 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
+
+#ifdef NETBSD_STATS_VIA_SYSCTL
+#define TCP_STAT_STRUCTURE struct tcp_mib
+#define USES_SNMP_DESIGNED_TCPSTAT
+#undef TCP_NSTATS
+#endif
+
+#ifdef HAVE_IPHLPAPI_H
+#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
+
+#ifdef dragonfly
+#define TCP_STAT_STRUCTURE struct tcp_stats
+#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);
+#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 & 0xffffffff;
+ break;
+ case TCPOUTSEGS:
+ ret_value = tcpstat.tcpOutSegs & 0xffffffff;
+ 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 NETSNMP_FEATURE_CHECKING
+ netsnmp_feature_want(tcp_count_connections)
+#endif
+#ifndef NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS
+ ret_value = TCP_Count_Connections();
+#else
+ ret_value = 0;
+#endif /* NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS */
+ type = ASN_GAUGE;
+ break;
+ case TCPINSEGS:
+ ret_value = tcpstat.tcps_rcvtotal & 0xffffffff;
+ 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) & 0xffffffff;
+ break;
+ case TCPRETRANSSEGS:
+ ret_value = tcpstat.tcps_sndrexmitpack;
+ break;
+ case TCPINERRS:
+ ret_value = tcpstat.tcps_rcvbadsum + tcpstat.tcps_rcvbadoff
+#ifdef HAVE_STRUCT_TCPSTAT_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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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(NETBSD_STATS_VIA_SYSCTL)
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = netbsd_read_tcp_stat(&tcpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP scalar Group (netbsd)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/tcpScalar", "Loaded TCP scalar Group (netbsd)\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/agent/mibgroup/mibII/tcp.h b/agent/mibgroup/mibII/tcp.h
new file mode 100644
index 0000000..049ddd1
--- /dev/null
+++ b/agent/mibgroup/mibII/tcp.h
@@ -0,0 +1,39 @@
+/*
+ * TCP MIB group interface - tcp.h
+ *
+ */
+#ifndef _MIBGROUP_TCP_H
+#define _MIBGROUP_TCP_H
+
+
+config_require(mibII/tcpTable)
+
+config_arch_require(solaris2, kernel_sunos5)
+config_arch_require(linux, mibII/kernel_linux)
+config_arch_require(netbsd, mibII/kernel_netbsd)
+config_arch_require(netbsdelf, mibII/kernel_netbsd)
+
+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/agent/mibgroup/mibII/tcpTable.c b/agent/mibgroup/mibII/tcpTable.c
new file mode 100644
index 0000000..088dd06
--- /dev/null
+++ b/agent/mibgroup/mibII/tcpTable.c
@@ -0,0 +1,1058 @@
+/*
+ * 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 <net-snmp/net-snmp-features.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
+#if HAVE_NETLINK_NETLINK_H
+#include <netlink/netlink.h>
+#include <netlink/msg.h>
+#include <linux/inet_diag.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"
+
+netsnmp_feature_child_of(tcptable_all, libnetsnmpmibs)
+
+netsnmp_feature_child_of(tcp_count_connections, tcptable_all)
+
+#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
+
+#ifdef HAVE_IPHLPAPI_H
+#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;
+};
+#undef INP_NEXT_SYMBOL
+#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
+
+void
+init_tcpTable(void)
+{
+ const oid tcpTable_oid[] = { SNMP_OID_MIB2, 6, 13 };
+
+ netsnmp_table_registration_info *table_info;
+ netsnmp_iterator_info *iinfo;
+ netsnmp_handler_registration *reginfo;
+ int rc;
+
+ 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),
+ rc = netsnmp_register_table_iterator2(reginfo, iinfo);
+ if (rc != SNMPERR_SUCCESS)
+ return;
+
+ /*
+ * .... 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS
+int
+TCP_Count_Connections( void ) {
+ tcpTable_load(NULL, NULL);
+ return tcp_estab;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS */
+
+ /*
+ * 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 == NULL)
+ 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 (hpux11)\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (hpux11)\n"));
+ return -1;
+}
+#else /* hpux11 */
+
+#ifdef linux
+
+/* see <netinet/tcp.h> */
+#define TCP_ALL ((1 << (TCP_CLOSING + 1)) - 1)
+
+#if HAVE_NETLINK_NETLINK_H
+static int
+tcpTable_load_netlink(void)
+{
+ /* TODO: perhaps use permanent nl handle? */
+ struct nl_handle *nl = nl_handle_alloc();
+
+ if (nl == NULL) {
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to allocate netlink handle\n"));
+ snmp_log(LOG_ERR, "snmpd: Failed to allocate netlink handle\n");
+ return -1;
+ }
+
+ if (nl_connect(nl, NETLINK_INET_DIAG) < 0) {
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to connect to netlink: %s\n", nl_geterror()));
+ snmp_log(LOG_ERR, "snmpd: Couldn't connect to netlink: %s\n", nl_geterror());
+ nl_handle_destroy(nl);
+ return -1;
+ }
+
+ struct inet_diag_req req = {
+ .idiag_family = AF_INET,
+ .idiag_states = TCP_ALL,
+ };
+
+ struct nl_msg *nm = nlmsg_alloc_simple(TCPDIAG_GETSOCK, NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST);
+ nlmsg_append(nm, &req, sizeof(struct inet_diag_req), 0);
+
+ if (nl_send_auto_complete(nl, nm) < 0) {
+ DEBUGMSGTL(("mibII/tcpTable", "nl_send_autocomplete(): %s\n", nl_geterror()));
+ snmp_log(LOG_ERR, "snmpd: nl_send_autocomplete(): %s\n", nl_geterror());
+ nl_handle_destroy(nl);
+ return -1;
+ }
+ nlmsg_free(nm);
+
+ struct sockaddr_nl peer;
+ unsigned char *buf = NULL;
+ int running = 1, len;
+
+ while (running) {
+ if ((len = nl_recv(nl, &peer, &buf, NULL)) <= 0) {
+ DEBUGMSGTL(("mibII/tcpTable", "nl_recv(): %s\n", nl_geterror()));
+ snmp_log(LOG_ERR, "snmpd: nl_recv(): %s\n", nl_geterror());
+ nl_handle_destroy(nl);
+ return -1;
+ }
+
+ struct nlmsghdr *h = (struct nlmsghdr*)buf;
+ while (nlmsg_ok(h, len)) {
+ if (h->nlmsg_type == NLMSG_DONE) {
+ running = 0;
+ break;
+ }
+
+ struct inet_diag_msg *r = nlmsg_data(h);
+
+ if (r->idiag_family != AF_INET) {
+ h = nlmsg_next(h, &len);
+ continue;
+ }
+
+ struct inpcb pcb, *nnew;
+ static int linux_states[12] =
+ { 1, 5, 3, 4, 6, 7, 11, 1, 8, 9, 2, 10 };
+
+ memcpy(&pcb.inp_laddr.s_addr, r->id.idiag_src, r->idiag_family == AF_INET ? 4 : 6);
+ memcpy(&pcb.inp_faddr.s_addr, r->id.idiag_dst, r->idiag_family == AF_INET ? 4 : 6);
+
+ pcb.inp_lport = r->id.idiag_sport;
+ pcb.inp_fport = r->id.idiag_dport;
+
+ pcb.inp_state = (r->idiag_state & 0xf) < 12 ? linux_states[r->idiag_state & 0xf] : 2;
+ if (pcb.inp_state == 5 /* established */ ||
+ pcb.inp_state == 8 /* closeWait */ )
+ tcp_estab++;
+ pcb.uid = r->idiag_uid;
+
+ nnew = SNMP_MALLOC_TYPEDEF(struct inpcb);
+ if (nnew == NULL) {
+ running = 0;
+ /* XXX report malloc error and return -1? */
+ break;
+ }
+ memcpy(nnew, &pcb, sizeof(struct inpcb));
+ nnew->inp_next = tcp_head;
+ tcp_head = nnew;
+
+ h = nlmsg_next(h, &len);
+ }
+ free(buf);
+ }
+
+ nl_handle_destroy(nl);
+
+ if (tcp_head) {
+ DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table using netlink\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (netlink)\n"));
+ return -1;
+}
+#endif
+
+int
+tcpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ FILE *in;
+ char line[256];
+
+ tcpTable_free(cache, NULL);
+
+#if HAVE_NETLINK_NETLINK_H
+ if (tcpTable_load_netlink() == 0) {
+ return 0;
+ }
+#endif
+
+ if (!(in = fopen("/proc/net/tcp", "r"))) {
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (linux1)\n"));
+ NETSNMP_LOGONCE((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 };
+ unsigned int lp, fp;
+ int state, 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 (linux)\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 (solaris)\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 (WIN32)\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;
+#if defined(dragonfly)
+ struct xinpcb *xig = NULL;
+ int StateMap[] = { 1, 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+#else
+ struct xinpgen *xig = NULL;
+ int StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+#endif
+ netsnmp_inpcb *nnew;
+
+ 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)
+ */
+#if defined(dragonfly)
+ xig = (struct xinpcb *) tcpcb_buf;
+#else
+ xig = (struct xinpgen *) tcpcb_buf;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+
+#if defined(dragonfly)
+ while (xig && ((char *)xig + xig->xi_len < tcpcb_buf + len))
+#else
+ while (xig && (xig->xig_len > sizeof(struct xinpgen)))
+#endif
+ {
+ 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));
+
+ if (nnew->pcb.inp_vflag & INP_IPV6)
+ free(nnew);
+ else {
+ nnew->inp_next = tcp_head;
+ tcp_head = nnew;
+ }
+#if defined(dragonfly)
+ xig = (struct xinpcb *) ((char *) xig + xig->xi_len);
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+ }
+
+ free(tcpcb_buf);
+ if (tcp_head) {
+ DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table (sysctl)\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 (pcb_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 (tcp_symbol)\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/agent/mibgroup/mibII/tcpTable.h b/agent/mibgroup/mibII/tcpTable.h
new file mode 100644
index 0000000..55fe97b
--- /dev/null
+++ b/agent/mibgroup/mibII/tcpTable.h
@@ -0,0 +1,38 @@
+/*
+ * Template MIB group interface - tcp.h
+ *
+ */
+#ifndef _MIBGROUP_TCPTABLE_H
+#define _MIBGROUP_TCPTABLE_H
+
+config_arch_require(solaris2, kernel_sunos5)
+#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/agent/mibgroup/mibII/udp.c b/agent/mibgroup/mibII/udp.c
new file mode 100644
index 0000000..1ddcbc5
--- /dev/null
+++ b/agent/mibgroup/mibII/udp.c
@@ -0,0 +1,570 @@
+/*
+ * 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 <net-snmp/agent/sysORTable.h>
+
+#include "util_funcs/MIB_STATS_CACHE_TIMEOUT.h"
+
+#ifdef linux
+#include "tcp.h"
+#endif
+#include "udp.h"
+#include "udpTable.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(aix7)) && !defined(FIRST_PROTOCOL)
+#ifdef HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#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;
+ int rc;
+
+ /*
+ * 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);
+ rc = netsnmp_register_scalar_group(reginfo, UDPINDATAGRAMS, UDPOUTDATAGRAMS);
+ if (rc != SNMPERR_SUCCESS)
+ return;
+
+ /*
+ * .... 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 NETBSD_STATS_VIA_SYSCTL
+#define UDP_STAT_STRUCTURE struct udp_mib
+#define USES_SNMP_DESIGNED_UDPSTAT
+#undef UDP_NSTATS
+#endif
+
+#ifdef HAVE_IPHLPAPI_H
+#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);
+#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 HAVE_STRUCT_UDPSTAT_UDPS_IPACKETS
+ ret_value = udpstat.udps_ipackets;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+
+ case UDPNOPORTS:
+#if HAVE_STRUCT_UDPSTAT_UDPS_NOPORT
+ ret_value = udpstat.udps_noport;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+
+ case UDPOUTDATAGRAMS:
+#if HAVE_STRUCT_UDPSTAT_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 HAVE_STRUCT_UDPSTAT_UDPS_DISCARD
+ udpstat.udps_discard +
+#endif
+#ifdef HAVE_STRUCT_UDPSTAT_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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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(NETBSD_STATS_VIA_SYSCTL)
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = netbsd_read_udp_stat(&udpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP scalar Group (netbsd)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/udpScalar", "Loaded UDP scalar Group (netbsd)\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/agent/mibgroup/mibII/udp.h b/agent/mibgroup/mibII/udp.h
new file mode 100644
index 0000000..9d4671b
--- /dev/null
+++ b/agent/mibgroup/mibII/udp.h
@@ -0,0 +1,27 @@
+/*
+ * Template MIB group interface - udp.h
+ *
+ */
+#ifndef _MIBGROUP_UDP_H
+#define _MIBGROUP_UDP_H
+
+
+config_require(mibII/udpTable)
+
+config_arch_require(solaris2, kernel_sunos5)
+config_arch_require(linux, mibII/kernel_linux)
+config_arch_require(netbsd, mibII/kernel_netbsd)
+config_arch_require(netbsdelf, mibII/kernel_netbsd)
+
+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/agent/mibgroup/mibII/udpTable.c b/agent/mibgroup/mibII/udpTable.c
new file mode 100644
index 0000000..6228710
--- /dev/null
+++ b/agent/mibgroup/mibII/udpTable.c
@@ -0,0 +1,795 @@
+/*
+ * 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"
+
+#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
+
+#ifdef HAVE_IPHLPAPI_H
+#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
+#ifdef openbsd4
+#define INP_NEXT_SYMBOL inp_queue.cqe_next /* or set via <net-snmp/system/openbsd.h> */
+#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;
+ int rc;
+
+ 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),
+ rc = netsnmp_register_table_iterator2(reginfo, iinfo);
+ if (rc != SNMPERR_SUCCESS)
+ return;
+
+ /*
+ * .... 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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 == NULL)
+ 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;
+ long 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(addr));
+#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 (hpux11)\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"));
+ NETSNMP_LOGONCE((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;
+
+ memset(&pcb, 0, sizeof(pcb));
+
+ 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 (linux)\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 (solaris)\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 (win32)\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;
+#if defined(dragonfly)
+ struct xinpcb *xig = NULL;
+#else
+ struct xinpgen *xig = NULL;
+#endif
+ 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)
+ */
+#if defined(dragonfly)
+ xig = (struct xinpcb *) udpcb_buf;
+#else
+ xig = (struct xinpgen *) udpcb_buf;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+
+#if defined(dragonfly)
+ while (xig && ((char *)xig + xig->xi_len < udpcb_buf + len))
+#else
+ while (xig && (xig->xig_len > sizeof(struct xinpgen)))
+#endif
+ {
+ nnew = SNMP_MALLOC_TYPEDEF(UDPTABLE_ENTRY_TYPE);
+ if (!nnew)
+ break;
+ memcpy(&nnew->pcb, &((struct xinpcb *) xig)->xi_inp, sizeof(struct inpcb));
+ nnew->inp_next = udp_head;
+ udp_head = nnew;
+#if defined(dragonfly)
+ xig = (struct xinpcb *) ((char *) xig + xig->xi_len);
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+ }
+
+ free(udpcb_buf);
+ if (udp_head) {
+ DEBUGMSGTL(("mibII/udpTable", "Loaded UDP Table (sysctl)\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 (pcb_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 (udb_symbol)\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/agent/mibgroup/mibII/udpTable.h b/agent/mibgroup/mibII/udpTable.h
new file mode 100644
index 0000000..f9afd5a
--- /dev/null
+++ b/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(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/agent/mibgroup/mibII/updates.c b/agent/mibgroup/mibII/updates.c
new file mode 100644
index 0000000..9d681cc
--- /dev/null
+++ b/agent/mibgroup/mibII/updates.c
@@ -0,0 +1,33 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+static int
+handle_updates(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int *set = (int*)handler->myvoid;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (reqinfo->mode == MODE_SET_RESERVE1 && *set < 0)
+ netsnmp_request_set_error(requests, SNMP_ERR_NOTWRITABLE);
+ else if (reqinfo->mode == MODE_SET_COMMIT)
+ *set = 1;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ return SNMP_ERR_NOERROR;
+}
+
+netsnmp_handler_registration*
+netsnmp_create_update_handler_registration(
+ const char* name, const oid* id, size_t idlen, int mode, int* set)
+{
+ netsnmp_handler_registration *res = NULL;
+ netsnmp_mib_handler *hnd = netsnmp_create_handler("update", handle_updates);
+ if (hnd) {
+ hnd->myvoid = set;
+ res = netsnmp_handler_registration_create(name, hnd, id, idlen, mode);
+ }
+ return res;
+}
diff --git a/agent/mibgroup/mibII/updates.h b/agent/mibgroup/mibII/updates.h
new file mode 100644
index 0000000..b414e33
--- /dev/null
+++ b/agent/mibgroup/mibII/updates.h
@@ -0,0 +1,16 @@
+#ifndef UPDATES_H
+#define UPDATES_H
+
+/**
+ * Create a handler_registration that checks *set to determine how to proceede,
+ * if *set is less than 0 then the object is nonwriteable, otherwise, *set is
+ * set to 1 in the commit phase. All other parameters are as in
+ * netsnmp_create_handler_registration.
+ */
+
+extern netsnmp_handler_registration*
+netsnmp_create_update_handler_registration(const char* name,
+ const oid* id, size_t idlen,
+ int mode, int* set);
+
+#endif
diff --git a/agent/mibgroup/mibII/vacm_conf.c b/agent/mibgroup/mibII/vacm_conf.c
new file mode 100644
index 0000000..f2faf86
--- /dev/null
+++ b/agent/mibgroup/mibII/vacm_conf.c
@@ -0,0 +1,1494 @@
+/*
+ * 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
+
+#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 "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_const_config_handler("vacmView",
+ vacm_parse_config_view, NULL, NULL);
+ snmpd_register_const_config_handler("vacmGroup",
+ vacm_parse_config_group,
+ NULL, NULL);
+ snmpd_register_const_config_handler("vacmAccess",
+ vacm_parse_config_access,
+ NULL, NULL);
+ snmpd_register_const_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 [context]]]");
+
+ /* easy user auth handler */
+ snmpd_register_config_handler("authuser",
+ vacm_parse_authuser,
+ NULL, "authtype1,authtype2 [-s secmodel] user [noauth|auth|priv [oid|-V view [context]]]");
+ /* easy group auth handler */
+ snmpd_register_config_handler("authgroup",
+ vacm_parse_authuser,
+ NULL, "authtype1,authtype2 [-s secmodel] group [noauth|auth|priv [oid|-V view [context]]]");
+
+ 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_PRE_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|-V view [context]]]");
+ snmpd_register_config_handler("rocommunity", vacm_parse_rocommunity, NULL,
+ "community [default|hostname|network/bits [oid|-V view [context]]]");
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ snmpd_register_config_handler("rwcommunity6", vacm_parse_rwcommunity6, NULL,
+ "community [default|hostname|network/bits [oid|-V view [context]]]");
+ snmpd_register_config_handler("rocommunity6", vacm_parse_rocommunity6, NULL,
+ "community [default|hostname|network/bits [oid|-V view [context]]]");
+#endif
+#endif /* support for community based SNMP */
+ snmpd_register_config_handler("rwuser", vacm_parse_rwuser, NULL,
+ "user [noauth|auth|priv [oid|-V view [context]]]");
+ snmpd_register_config_handler("rouser", vacm_parse_rouser, NULL,
+ "user [noauth|auth|priv [oid|-V view [context]]]");
+}
+
+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[VACMSTRINGLEN], model[VACMSTRINGLEN], security[VACMSTRINGLEN];
+ int imodel;
+ struct vacm_groupEntry *gp = NULL;
+ char *st;
+
+ st = copy_nword(param, group, sizeof(group)-1);
+ st = copy_nword(st, model, sizeof(model)-1);
+ st = copy_nword(st, security, sizeof(security)-1);
+
+ if (group[0] == 0) {
+ config_perror("missing GROUP parameter");
+ return;
+ }
+ if (model[0] == 0) {
+ config_perror("missing MODEL parameter");
+ return;
+ }
+ if (security[0] == 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;
+ }
+ strlcpy(gp->groupName, group, sizeof(gp->groupName));
+ 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 || 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, *tmp;
+ const char *context;
+ 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 = tmp = strtok_r(NULL, " \t\n", &st);
+ if (tmp) {
+ tmp = (tmp + strlen(tmp)-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;
+ }
+
+ 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];
+ size_t 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) {
+ unsigned 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, const char *community, const char *addressname,
+ const char *publishtoken,
+ void (*parser)(const char *, char *),
+ char *secname, size_t secname_len,
+ char *viewname, size_t viewname_len, int version,
+ const char *context)
+{
+ char line[SPRINT_MAX_LEN];
+
+ /*
+ * com2sec6|comsec [-Cn CONTEXT] 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';
+ }
+ if ( context && *context )
+ snprintf(line, sizeof(line), "-Cn %s %s %s '%s'",
+ context, secname, addressname, community);
+ else
+ 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)
+#ifdef NETSNMP_TRANSPORT_UDP_DOMAIN
+ 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, context);
+ }
+#endif
+
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+ if (parsetype == VACM_CREATE_SIMPLE_COMUNIX ||
+ parsetype == VACM_CREATE_SIMPLE_COM) {
+ if ( *context )
+ snprintf(line, sizeof(line), "-Cn %s %s %s '%s'",
+ context, secname, addressname, community);
+ else
+ 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, context);
+ }
+#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 ) {
+ strlcpy(grpname, community, sizeof(grpname));
+ } else {
+ strlcpy(secname, community, sizeof(secname));
+
+ /*
+ * sec->group mapping
+ */
+ /*
+ * group anonymousGroupNameNUM any anonymousSecNameNUM
+ */
+ snprintf(grpname, sizeof(grpname), "grp%.28s", secname);
+ for (tmp=grpname; *tmp; tmp++)
+ if (!isalnum((unsigned char)(*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((unsigned char)(*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"
+ " (Config search path: %s)\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",
+ get_configuration_directory(), 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"
+ " (Config search path: %s)\n"
+ "This receiver will *NOT* accept any incoming notifications.\n",
+ get_configuration_directory());
+ }
+ }
+ 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;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_SET:
+ viewtype = VACM_VIEW_WRITE;
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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)
+{
+ return vacm_check_view_contents(pdu, name, namelen, check_subtree, viewtype,
+ VACM_CHECK_VIEW_CONTENTS_NO_FLAGS);
+}
+
+int
+vacm_check_view_contents(netsnmp_pdu *pdu, oid * name, size_t namelen,
+ int check_subtree, int viewtype, int flags)
+{
+ struct vacm_accessEntry *ap;
+ struct vacm_groupEntry *gp;
+ struct vacm_viewEntry *vp;
+ char vacm_default_context[1] = "";
+ const char *contextName = vacm_default_context;
+ const char *sn = NULL;
+ char *vn;
+ const 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 = (const char *) 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=%ld, 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 (0) {
+#ifdef NETSNMP_TRANSPORT_UDP_DOMAIN
+ } else 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,
+ 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_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,
+ 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,
+ 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=%ld, 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",
+ (int)pdu->contextNameLen));
+ return VACM_NOSUCHCONTEXT;
+ }
+ /*
+ * NULL termination of the pdu field is ugly here. Do in PDU parsing?
+ */
+ if (pdu->contextName)
+ memcpy(contextNameIndex, pdu->contextName, pdu->contextNameLen);
+ else
+ contextNameIndex[0] = '\0';
+
+ contextNameIndex[pdu->contextNameLen] = '\0';
+ if (!(flags & VACM_CHECK_VIEW_CONTENTS_DNE_CONTEXT_OK) &&
+ !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 == NULL) { /* 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/agent/mibgroup/mibII/vacm_conf.h b/agent/mibgroup/mibII/vacm_conf.h
new file mode 100644
index 0000000..7864ce1
--- /dev/null
+++ b/agent/mibgroup/mibII/vacm_conf.h
@@ -0,0 +1,51 @@
+/*
+ * SNMPv3 View-based Access Control Model
+ */
+
+#ifndef _MIBGROUP_VACM_CONF_H
+#define _MIBGROUP_VACM_CONF_H
+
+#include <net-snmp/library/vacm.h>
+
+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);
+ int vacm_check_view_contents(netsnmp_pdu *, oid *, size_t,
+ int, int, int);
+
+#define VACM_CHECK_VIEW_CONTENTS_NO_FLAGS 0
+#define VACM_CHECK_VIEW_CONTENTS_DNE_CONTEXT_OK 1
+
+#endif /* _MIBGROUP_VACM_CONF_H */
diff --git a/agent/mibgroup/mibII/vacm_context.c b/agent/mibgroup/mibII/vacm_context.c
new file mode 100644
index 0000000..8f43cd3
--- /dev/null
+++ b/agent/mibgroup/mibII/vacm_context.c
@@ -0,0 +1,165 @@
+#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);
+ SNMP_FREE(my_handler);
+ 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_iterator2(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/agent/mibgroup/mibII/vacm_context.h b/agent/mibgroup/mibII/vacm_context.h
new file mode 100644
index 0000000..924d065
--- /dev/null
+++ b/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/agent/mibgroup/mibII/vacm_vars.c b/agent/mibgroup/mibII/vacm_vars.c
new file mode 100644
index 0000000..85cef94
--- /dev/null
+++ b/agent/mibgroup/mibII/vacm_vars.c
@@ -0,0 +1,1843 @@
+/*
+ * 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
+
+#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/sysORTable.h>
+#include "vacm_vars.h"
+#include "util_funcs/header_generic.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
+
+static unsigned int vacmViewSpinLock = 0;
+
+void
+init_vacm_vars(void)
+{
+
+ oid reg[] = { SNMP_OID_SNMPMODULES, 16, 2, 2, 1 };
+
+#define PRIVRW (NETSNMP_SNMPV2ANY | 0x5000)
+
+ struct variable1 vacm_sec2group[] = {
+ {SECURITYGROUP, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_sec2group, 1, {3}},
+ {SECURITYSTORAGE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_sec2group, 1, {4}},
+ {SECURITYSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_sec2group, 1, {5}},
+ };
+
+ struct variable1 vacm_access[] = {
+ {ACCESSMATCH, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_access, 1, {4}},
+ {ACCESSREAD, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_access, 1, {5}},
+ {ACCESSWRITE, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_access, 1, {6}},
+ {ACCESSNOTIFY, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_access, 1, {7}},
+ {ACCESSSTORAGE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_access, 1, {8}},
+ {ACCESSSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_access, 1, {9}},
+ };
+
+ struct variable3 vacm_view[] = {
+ {VACMVIEWSPINLOCK, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_view, 1, {1}},
+ {VIEWMASK, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_view, 3, {2, 1, 3}},
+ {VIEWTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_view, 3, {2, 1, 4}},
+ {VIEWSTORAGE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_vacm_view, 3, {2, 1, 5}},
+ {VIEWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_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);
+
+ REGISTER_SYSOR_ENTRY(reg, "View-based Access Control Model for SNMP.");
+}
+
+
+
+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;
+ ssize_t 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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SECURITYGROUP:
+ *write_method = write_vacmGroupName;
+ break;
+ case SECURITYSTORAGE:
+ *write_method = write_vacmSecurityToGroupStorageType;
+ break;
+ case SECURITYSTATUS:
+ *write_method = write_vacmSecurityToGroupStatus;
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ *write_method = NULL;
+ }
+
+ *var_len = 0; /* assume 0 length until found */
+
+ 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 NULL; /* Either extra subids, or an incomplete string */
+ cp = secname;
+ while (groupSubtreeLen-- > 0) {
+ if (*groupSubtree > 255)
+ return NULL; /* illegal value */
+ if (cp - secname > VACM_MAX_STRING)
+ return NULL;
+ *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 NULL; /* illegal value */
+ if (cp - secname > VACM_MAX_STRING)
+ return NULL;
+ *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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ *write_method = NULL;
+ }
+
+ *var_len = 0; /* assume 0 length until found */
+
+ 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 NULL;
+ cp = groupName;
+ while (len-- > 0) {
+ if (*op > 255)
+ return NULL; /* illegal value */
+ *cp++ = (char) *op++;
+ }
+ *cp = 0;
+
+ /*
+ * ... followed by the context index ...
+ */
+ len = *op++;
+ if (len > VACM_MAX_STRING)
+ return NULL;
+ cp = contextPrefix;
+ while (len-- > 0) {
+ if (*op > 255)
+ return NULL; /* 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 NULL;
+ cp = groupName;
+ for (i = 0; i <= len; i++) {
+ if (*op > 255) {
+ return NULL; /* illegal value */
+ }
+ *cp++ = (char) *op++;
+ }
+ *cp = 0;
+ }
+ if (op >= name + *length) {
+ } else {
+ len = *op;
+ if (len > VACM_MAX_STRING)
+ return NULL;
+ cp = contextPrefix;
+ for (i = 0; i <= len; i++) {
+ if (*op > 255) {
+ return NULL; /* 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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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 NULL;
+ cp = viewName;
+ while (len-- > 0) {
+ if (*op > 255)
+ return NULL;
+ *cp++ = (char) *op++;
+ }
+ *cp = 0;
+
+ /*
+ * ... followed by the view OID index.
+ */
+ subtree[0] = len = *op++;
+ subtreeLen = 1;
+ if (len > MAX_OID_LEN)
+ return NULL;
+ 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 NULL;
+ cp = viewName;
+ for (i = 0; i <= len && op < name + *length; i++) {
+ if (*op > 255) {
+ return NULL;
+ }
+ *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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_vacmViewSpinLock;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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;
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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;
+}
+
+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 = NULL, *newContextPrefix = NULL;
+ 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++) {
+ subtree[0][i] = (oid) oidIndex[i + viewNameL + 1];
+ }
+
+ return 0;
+}
+
+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;
+}
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
diff --git a/agent/mibgroup/mibII/vacm_vars.h b/agent/mibgroup/mibII/vacm_vars.h
new file mode 100644
index 0000000..471f759
--- /dev/null
+++ b/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/header_generic)
+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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+#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/agent/mibgroup/mibII/var_route.c b/agent/mibgroup/mibII/var_route.c
new file mode 100644
index 0000000..52fcd86
--- /dev/null
+++ b/agent/mibgroup/mibII/var_route.c
@@ -0,0 +1,2122 @@
+/*
+ * 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 sysctl({CTL_NET,PF_ROUTE,...) by Simon Leinen
+ * (simon@switch.ch) 1997
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_child_of(get_routes, libnetsnmpmibs)
+
+#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 = NULL;
+static int rtsize = 0, rtallocate = 0;
+
+static void Route_Scan_Reload(void);
+
+#ifndef NETSNMP_FEATURE_REMOVE_GET_ROUTES
+RTENTRY **netsnmp_get_routes(size_t *size) {
+ Route_Scan_Reload();
+ if (size)
+ *size = rtsize;
+ return rthead;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_GET_ROUTES */
+#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 size_t saveNameLen = 0;
+ static int 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;
+#ifdef HAVE_DEFINED_IRE_CACHE
+ if(entry.ipRouteInfo.re_ire_type&IRE_CACHE)
+ continue;
+#endif /* HAVE_DEFINED_IRE_CACHE */
+ 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 !HAVE_STRUCT_IFNET_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 HAVE_STRUCT_IFNET_IF_XNAME
+#if defined(netbsd1) || defined(openbsd2)
+ strlcpy(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
+#ifdef NETSNMP_FEATURE_CHECKIN
+ /* this exists here just so we don't copy ifdef logic elsewhere */
+ netsnmp_feature_require(string_append_int);
+#endif
+ 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
+#ifdef NETSNMP_FEATURE_CHECKIN
+ netsnmp_feature_require(interface_legacy)
+#endif /* NETSNMP_FEATURE_CHECKIN */
+ 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 time_t Time_Of_Last_Reload;
+ struct timeval now;
+
+ netsnmp_get_monotonic_clock(&now);
+ 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 */
+#ifdef NETSNMP_FEATURE_CHECKIN
+ /* this exists here just so we don't copy ifdef logic elsewhere */
+ netsnmp_feature_require(string_append_int);
+ netsnmp_feature_require(interface_legacy)
+#endif
+ 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
+netsnmp_feature_require(string_append_int)
+netsnmp_feature_require(interface_legacy)
+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 time_t Time_Of_Last_Reload;
+ struct timeval now;
+ int hashsize;
+
+ netsnmp_get_monotonic_clock(&now);
+ 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 time_t Time_Of_Last_Reload;
+ struct timeval now;
+
+ netsnmp_get_monotonic_clock(&now);
+ 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"))) {
+ NETSNMP_LOGONCE((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, metric;
+ unsigned flags, 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 %d %u %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;
+
+ strlcpy(name, rt->rt_dev, sizeof(name));
+
+ 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 */
+
+#elif defined(HAVE_IPHLPAPI_H) /* 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 = 0;
+ 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 time_t Time_Of_Last_Reload;
+ 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));
+ }
+ netsnmp_get_monotonic_clock(&now);
+ 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) {
+ u_char dest_addr[4];
+ MIB_IPFORWARDROW temp_row;
+
+ 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];
+ memset(&temp_row, 0, sizeof(temp_row));
+ 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/agent/mibgroup/mibII/var_route.h b/agent/mibgroup/mibII/var_route.h
new file mode 100644
index 0000000..7862c43
--- /dev/null
+++ b/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)
+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/agent/mibgroup/mibdefs.h b/agent/mibgroup/mibdefs.h
new file mode 100644
index 0000000..260cae1
--- /dev/null
+++ b/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/agent/mibgroup/mibincl.h b/agent/mibgroup/mibincl.h
new file mode 100644
index 0000000..3d48768
--- /dev/null
+++ b/agent/mibgroup/mibincl.h
@@ -0,0 +1,48 @@
+/*
+ * 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
+# 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/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/agent/mibgroup/misc/ipfwacc.c b/agent/mibgroup/misc/ipfwacc.c
new file mode 100644
index 0000000..cca9871
--- /dev/null
+++ b/agent/mibgroup/misc/ipfwacc.c
@@ -0,0 +1,365 @@
+/****************************************************************************
+ * 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/header_simple_table.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((char *) rule, sizeof(rule), f)) {
+ fclose(f);
+ return 0;
+ }
+ for (i = 1; i != number; i++)
+ if (!fgets((char *) rule, sizeof(rule), f)) {
+ fclose(f);
+ return (number ? 0 : (i - 1));
+ }
+ if (!fgets((char *) 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, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCINDEX}},
+ {IPFWACCSRCADDR, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCSRCADDR}},
+ {IPFWACCSRCNM, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCSRCNM}},
+ {IPFWACCDSTADDR, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCDSTADDR}},
+ {IPFWACCDSTNM, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCDSTNM}},
+ {IPFWACCVIANAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCVIANAME}},
+ {IPFWACCVIAADDR, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCVIAADDR}},
+ {IPFWACCPROTO, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPROTO}},
+ {IPFWACCBIDIR, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCBIDIR}},
+ {IPFWACCDIR, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCDIR}},
+ {IPFWACCBYTES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCBYTES}},
+ {IPFWACCPACKETS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPACKETS}},
+ {IPFWACCNSRCPRTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCNSRCPRTS}},
+ {IPFWACCNDSTPRTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCNDSTPRTS}},
+ {IPFWACCSRCISRNG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCSRCISRNG}},
+ {IPFWACCDSTISRNG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCDSTISRNG}},
+ {IPFWACCPORT1, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPORT1}},
+ {IPFWACCPORT2, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPORT2}},
+ {IPFWACCPORT3, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPORT3}},
+ {IPFWACCPORT4, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPORT4}},
+ {IPFWACCPORT5, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPORT5}},
+ {IPFWACCPORT6, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPORT6}},
+ {IPFWACCPORT7, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPORT7}},
+ {IPFWACCPORT8, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPORT8}},
+ {IPFWACCPORT9, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ipfwacc, 1, {IPFWACCPORT9}},
+ {IPFWACCPORT10, ASN_INTEGER, NETSNMP_OLDAPI_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/agent/mibgroup/misc/ipfwacc.h b/agent/mibgroup/misc/ipfwacc.h
new file mode 100644
index 0000000..639c739
--- /dev/null
+++ b/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 header_simple_table from the util_funcs module
+ */
+
+config_require(util_funcs/header_simple_table)
+
+ /*
+ * 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/agent/mibgroup/notification-log-mib.h b/agent/mibgroup/notification-log-mib.h
new file mode 100644
index 0000000..925190d
--- /dev/null
+++ b/agent/mibgroup/notification-log-mib.h
@@ -0,0 +1,2 @@
+config_require(notification-log-mib/notification_log)
+config_require(notification/snmpNotifyTable)
diff --git a/agent/mibgroup/notification-log-mib/notification_log.c b/agent/mibgroup/notification-log-mib/notification_log.c
new file mode 100644
index 0000000..a12a338
--- /dev/null
+++ b/agent/mibgroup/notification-log-mib/notification_log.c
@@ -0,0 +1,770 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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 "net-snmp/agent/sysORTable.h"
+#include "notification_log.h"
+
+netsnmp_feature_require(register_ulong_instance_context)
+netsnmp_feature_require(register_read_only_counter32_instance_context)
+netsnmp_feature_require(delete_table_data_set)
+netsnmp_feature_require(table_dataset)
+netsnmp_feature_require(date_n_time)
+
+/*
+ * 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 oid nlm_module_oid[] = { SNMP_OID_MIB2, 92 }; /* NOTIFICATION-LOG-MIB::notificationLogMIB */
+
+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;
+ u_long uptime;
+
+ uptime = netsnmp_get_agent_uptime();
+
+ 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 %lu; max %lu\n",
+ count, max_logged));
+ if (count > max_logged) {
+ count = count - max_logged;
+ DEBUGMSGTL(("notification_log", "removing %lu 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 < ((u_long)(*(data->data.integer) + max_age * 100 * 60)))
+ break;
+ ++count;
+ }
+
+ if (count) {
+ DEBUGMSGTL(("notification_log", "removing %lu 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 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.
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (reqinfo->mode == MODE_SET_COMMIT)
+ check_log_size(0, NULL);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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
+
+ REGISTER_SYSOR_ENTRY(nlm_module_oid,
+ "The MIB module for logging SNMP Notifications.");
+}
+
+void
+shutdown_notification_log(void)
+{
+ max_logged = 0;
+ check_log_size(0, NULL);
+ netsnmp_delete_table_data_set(nlmLogTable);
+ nlmLogTable = NULL;
+
+ UNREGISTER_SYSOR_ENTRY(nlm_module_oid);
+}
+
+void
+log_notification(netsnmp_pdu *pdu, netsnmp_transport *transport)
+{
+ long tmpl;
+ 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;
+ netsnmp_pdu *orig_pdu = pdu;
+
+ if (!nlmLogVarTable
+ || 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
+ */
+ tmpl = netsnmp_get_agent_uptime();
+ netsnmp_set_row_column(row, COLUMN_NLMLOGTIME, ASN_TIMETICKS,
+ &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,
+ 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);
+
+ if (pdu->command == SNMP_MSG_TRAP)
+ pdu = convert_v1pdu_to_v2(orig_pdu);
+ 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, 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, & 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);
+ }
+ }
+
+ if (pdu != orig_pdu)
+ snmp_free_pdu( pdu );
+
+ /*
+ * 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/agent/mibgroup/notification-log-mib/notification_log.h b/agent/mibgroup/notification-log-mib/notification_log.h
new file mode 100644
index 0000000..9de7c7b
--- /dev/null
+++ b/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/agent/mibgroup/notification.h b/agent/mibgroup/notification.h
new file mode 100644
index 0000000..ff3a3ea
--- /dev/null
+++ b/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/agent/mibgroup/notification/snmpNotifyFilterProfileTable.c b/agent/mibgroup/notification/snmpNotifyFilterProfileTable.c
new file mode 100644
index 0000000..b12cdc8
--- /dev/null
+++ b/agent/mibgroup/notification/snmpNotifyFilterProfileTable.c
@@ -0,0 +1,847 @@
+/*
+ * 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_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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "snmpNotifyFilterProfileTable.h"
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(header_complex_find_entry)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * 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, NETSNMP_OLDAPI_RWRITE,
+ var_snmpNotifyFilterProfileTable, 2, {1, 1}},
+#define SNMPNOTIFYFILTERPROFILESTORTYPE 4
+ {SNMPNOTIFYFILTERPROFILESTORTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpNotifyFilterProfileTable, 2, {1, 2}},
+#define SNMPNOTIFYFILTERPROFILEROWSTATUS 5
+ {SNMPNOTIFYFILTERPROFILEROWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_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;
+ int retVal;
+
+ 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);
+
+ if (header_complex_maybe_add_data(&snmpNotifyFilterProfileTableStorage, vars,
+ thedata, 1) != NULL){
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "registered an entry\n"));
+ retVal = SNMPERR_SUCCESS;
+ }else{
+ retVal = SNMPERR_GENERR;
+ }
+
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "done.\n"));
+ return retVal;
+}
+
+
+/*
+ * 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");
+ SNMP_FREE(StorageTmp);
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->snmpNotifyFilterProfileStorType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->
+ snmpNotifyFilterProfileRowStatus, &tmpint);
+
+ if (snmpNotifyFilterProfileTable_add(StorageTmp) != SNMPERR_SUCCESS){
+ SNMP_FREE(StorageTmp->snmpTargetParamsName);
+ SNMP_FREE(StorageTmp->snmpNotifyFilterProfileName);
+ SNMP_FREE(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;
+ 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,
+ NULL);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ snmpNotifyFilterProfileRowStatus,
+ NULL);
+
+ 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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMPNOTIFYFILTERPROFILENAME:
+ *write_method = write_snmpNotifyFilterProfileName;
+ break;
+
+ case SNMPNOTIFYFILTERPROFILESTORTYPE:
+ *write_method = write_snmpNotifyFilterProfileStorType;
+ break;
+
+ case SNMPNOTIFYFILTERPROFILEROWSTATUS:
+ *write_method = write_snmpNotifyFilterProfileRowStatus;
+ break;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+
+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 = (char*)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);
+ snmp_store_needed(NULL);
+ 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!
+ */
+ snmp_store_needed(NULL);
+ 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);
+ if (StorageNew == NULL)
+ return SNMP_ERR_GENERR;
+ 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;
+ }
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+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,
+ (const 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/agent/mibgroup/notification/snmpNotifyFilterProfileTable.h b/agent/mibgroup/notification/snmpNotifyFilterProfileTable.h
new file mode 100644
index 0000000..616bcdc
--- /dev/null
+++ b/agent/mibgroup/notification/snmpNotifyFilterProfileTable.h
@@ -0,0 +1,69 @@
+/*
+ * 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ WriteMethod write_snmpNotifyFilterProfileName;
+ WriteMethod write_snmpNotifyFilterProfileStorType;
+ WriteMethod write_snmpNotifyFilterProfileRowStatus;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ char *get_FilterProfileName(const char *paramName,
+ size_t paramName_len,
+ size_t * profileName_len);
+
+
+#endif /* _MIBGROUP_SNMPNOTIFYFILTERPROFILETABLE_H */
diff --git a/agent/mibgroup/notification/snmpNotifyTable.c b/agent/mibgroup/notification/snmpNotifyTable.c
new file mode 100644
index 0000000..8d09c59
--- /dev/null
+++ b/agent/mibgroup/notification/snmpNotifyTable.c
@@ -0,0 +1,1222 @@
+/*
+ * 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 <net-snmp/net-snmp-features.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
+
+/*
+ * 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>
+#include "net-snmp/agent/sysORTable.h"
+
+#ifdef USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE
+# include "notification-log-mib/notification_log.h"
+#endif
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(header_complex_find_entry)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+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 };
+
+static oid snmpNotifyFullCompliance[] =
+ { SNMP_OID_SNMPMODULES, 13, 3, 1, 3 }; /* SNMP-NOTIFICATION-MIB::snmpNotifyFullCompliance */
+
+
+/*
+ * 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, NETSNMP_OLDAPI_RWRITE,
+ var_snmpNotifyTable, 2, {1, 2}},
+#define SNMPNOTIFYTYPE 5
+ {SNMPNOTIFYTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpNotifyTable, 2, {1, 3}},
+#define SNMPNOTIFYSTORAGETYPE 6
+ {SNMPNOTIFYSTORAGETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpNotifyTable, 2, {1, 4}},
+#define SNMPNOTIFYROWSTATUS 7
+ {SNMPNOTIFYROWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_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 const oid snmptrap_oid[];
+ extern const 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=%p, vars=%p\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
+ */
+ t = snmp_sess_transport(snmp_sess_pointer(ss));
+ if (!t) {
+ snmp_log(LOG_ERR,
+ "Cannot add new trap destination, transport is closed.");
+ snmp_sess_close(ss);
+ return 0;
+ }
+ ptr = snmpTargetAddrTable_create();
+ ptr->name = strdup(buf);
+ 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);
+ if (pptr->secName == NULL) {
+ snmpTargetParamTable_dispose(pptr);
+ return 0;
+ }
+ 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);
+ if (pptr->secName == NULL) {
+ snmpTargetParamTable_dispose(pptr);
+ return 0;
+ }
+ 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);
+ if (nptr == NULL)
+ return 0;
+ 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;
+
+ for (hptr = snmpNotifyTableStorage; hptr; hptr = nhptr) {
+ struct snmpNotifyTable_data *nptr = hptr->data;
+ nhptr = hptr->next;
+ if (nptr->snmpNotifyStorageType == ST_READONLY) {
+ header_complex_extract_entry(&snmpNotifyTableStorage, hptr);
+ free(nptr->snmpNotifyName);
+ free(nptr->snmpNotifyTag);
+ free(nptr);
+ }
+ }
+ snmpNotifyTableStorage = NULL;
+ 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);
+
+#ifndef DISABLE_SNMPV1
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_SEND_TRAP1, send_notifications,
+ NULL);
+#endif
+ 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
+ */
+
+ REGISTER_SYSOR_ENTRY(snmpNotifyFullCompliance,
+ "The MIB modules for managing SNMP Notification, plus filtering.");
+
+ DEBUGMSGTL(("snmpNotifyTable", "done.\n"));
+}
+
+void
+shutdown_snmpNotifyTable(void)
+{
+ DEBUGMSGTL(("snmpNotifyTable", "shutting down ... "));
+
+ notifyTable_unregister_notifications(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_PRE_UPDATE_CONFIG,
+ NULL,
+ NULL);
+
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_PRE_UPDATE_CONFIG,
+ notifyTable_unregister_notifications, NULL, FALSE);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_NOTIFICATIONS,
+ notifyTable_register_notifications, NULL, FALSE);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_SEND_TRAP2, send_notifications,
+ NULL, FALSE);
+#ifndef DISABLE_SNMPV1
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_SEND_TRAP1, send_notifications,
+ NULL, FALSE);
+#endif
+ snmp_unregister_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_snmpNotifyTable, NULL, FALSE);
+
+ UNREGISTER_SYSOR_ENTRY(snmpNotifyFullCompliance);
+
+ 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;
+ int retVal;
+
+ 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 */
+
+
+
+ if (header_complex_maybe_add_data(&snmpNotifyTableStorage, vars, thedata, 1)
+ != NULL){
+ DEBUGMSGTL(("snmpNotifyTable", "registered an entry\n"));
+ retVal = SNMPERR_SUCCESS;
+ }else{
+ retVal = SNMPERR_GENERR;
+ }
+
+
+ DEBUGMSGTL(("snmpNotifyTable", "done.\n"));
+ return retVal;
+}
+
+
+/*
+ * 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");
+ SNMP_FREE(StorageTmp);
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->snmpNotifyTag,
+ &StorageTmp->snmpNotifyTagLen);
+ if (StorageTmp->snmpNotifyTag == NULL) {
+ config_perror("invalid specification for snmpNotifyTag");
+ SNMP_FREE(StorageTmp);
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->snmpNotifyType, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->snmpNotifyStorageType, &tmpint);
+ if (!StorageTmp->snmpNotifyStorageType)
+ StorageTmp->snmpNotifyStorageType = ST_READONLY;
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->snmpNotifyRowStatus, &tmpint);
+ if (!StorageTmp->snmpNotifyRowStatus)
+ StorageTmp->snmpNotifyRowStatus = RS_ACTIVE;
+
+
+ if (snmpNotifyTable_add(StorageTmp) != SNMPERR_SUCCESS){
+ SNMP_FREE(StorageTmp->snmpNotifyName);
+ SNMP_FREE(StorageTmp->snmpNotifyTag);
+ SNMP_FREE(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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ *write_method = NULL;
+ }
+
+ if (!found) {
+ return NULL;
+ }
+
+#ifndef NETSNMP_NO_READ_SUPPORT
+ 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("");
+ }
+#endif /* !NETSNMP_NO_READ_SUPPORT */
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+
+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 > 255) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (!snmpTagValid((char *) var_val, var_val_len)) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ tmpvar = StorageTmp->snmpNotifyTag;
+ tmplen = StorageTmp->snmpNotifyTagLen;
+ StorageTmp->snmpNotifyTag = (char*)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);
+ snmp_store_needed(NULL);
+ 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 = (char*)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;
+ }
+ snmp_store_needed(NULL);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
diff --git a/agent/mibgroup/notification/snmpNotifyTable.h b/agent/mibgroup/notification/snmpNotifyTable.h
new file mode 100644
index 0000000..18bf1bd
--- /dev/null
+++ b/agent/mibgroup/notification/snmpNotifyTable.h
@@ -0,0 +1,76 @@
+/*
+ * 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);
+ void shutdown_snmpNotifyTable(void);
+ FindVarMethod var_snmpNotifyTable;
+ void parse_snmpNotifyTable(const char *, char *);
+
+ int snmpNotifyTable_add(struct snmpNotifyTable_data
+ *thedata);
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ WriteMethod write_snmpNotifyTag;
+ WriteMethod write_snmpNotifyType;
+ WriteMethod write_snmpNotifyStorageType;
+ WriteMethod write_snmpNotifyRowStatus;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+
+#endif /* _MIBGROUP_SNMPNOTIFYTABLE_H */
diff --git a/agent/mibgroup/rmon-mib.h b/agent/mibgroup/rmon-mib.h
new file mode 100644
index 0000000..6f09df7
--- /dev/null
+++ b/agent/mibgroup/rmon-mib.h
@@ -0,0 +1,8 @@
+/*
+ * module to include the modules
+ */
+
+config_require(rmon-mib/etherStatsTable)
+config_add_mib(RMON-MIB)
+
+
diff --git a/agent/mibgroup/rmon-mib/data_access/etherstats.h b/agent/mibgroup/rmon-mib/data_access/etherstats.h
new file mode 100644
index 0000000..e35dd61
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/data_access/etherstats.h
@@ -0,0 +1,7 @@
+/*
+ * module to include the modules
+ */
+
+#if defined(linux)
+config_require(rmon-mib/data_access/etherstats_linux)
+#endif
diff --git a/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c b/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c
new file mode 100644
index 0000000..d4b6e69
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c
@@ -0,0 +1,315 @@
+/*
+ * standard Net-SNMP includes
+ */
+#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 "rmon-mib/etherStatsTable/etherStatsTable.h"
+#include "rmon-mib/etherStatsTable/etherStatsTable_data_access.h"
+#include "rmon-mib/etherStatsTable/ioctl_imp_common.h"
+
+/*
+ * @retval 0 success
+ * @retval -1 getifaddrs failed
+ * @retval -2 memory allocation failed
+ */
+
+struct ifname *
+etherstats_interface_name_list_get (struct ifname *list_head, int *retval)
+{
+ struct ifaddrs *addrs = NULL, *p = NULL;
+ struct ifname *nameptr1=NULL, *nameptr2 = NULL;
+
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "called\n"));
+
+ if ((getifaddrs(&addrs)) < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "getifaddrs failed\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, getifaddrs failed\n");
+ *retval = -1;
+ return NULL;
+ }
+
+ for (p = addrs; p; p = p->ifa_next) {
+
+ if (!list_head) {
+ if ( (list_head = (struct ifname *) malloc (sizeof(struct ifname))) < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "memory allocation failed\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, memory allocation failed\n");
+ freeifaddrs(addrs);
+ *retval = -2;
+ return NULL;
+ }
+ memset(list_head, 0, sizeof(struct ifname));
+ strlcpy(list_head->name, p->ifa_name, IF_NAMESIZE);
+ continue;
+ }
+ for (nameptr1 = list_head; nameptr1; nameptr2 = nameptr1, nameptr1 = nameptr1->ifn_next)
+ if (!strncmp(p->ifa_name, nameptr1->name, IF_NAMESIZE))
+ break;
+
+ if (nameptr1)
+ continue;
+
+ if ( (nameptr2->ifn_next = (struct ifname *) malloc (sizeof(struct ifname))) < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "memory allocation failed\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, memory allocation failed\n");
+ etherstats_interface_name_list_free (list_head);
+ freeifaddrs(addrs);
+ *retval = -2;
+ return NULL;
+ }
+ nameptr2 = nameptr2->ifn_next;
+ memset(nameptr2, 0, sizeof(struct ifname));
+ strlcpy(nameptr2->name, p->ifa_name, IF_NAMESIZE);
+ continue;
+ }
+
+ freeifaddrs(addrs);
+ *retval = 0;
+ return list_head;
+}
+
+
+/*
+ * @retval 0 success
+ * @retval -1 invalid pointer
+ */
+
+int
+etherstats_interface_name_list_free (struct ifname *list_head)
+{
+ struct ifname *nameptr1 = NULL, *nameptr2 = NULL;
+
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_free",
+ "called\n"));
+
+ if (!list_head) {
+ snmp_log (LOG_ERR, "access:etherStatsTable:interface_name_list_free: invalid pointer list_head");
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_free",
+ "invalid pointer list_head\n"));
+ return -1;
+ }
+
+ for (nameptr1 = list_head; nameptr1; nameptr1 = nameptr2) {
+ nameptr2 = nameptr1->ifn_next;
+ free (nameptr1);
+ }
+
+ return 0;
+}
+
+/*
+ * @retval 0 : not found
+ * @retval !0 : ifIndex
+ */
+
+int
+etherstats_interface_ioctl_ifindex_get (int fd, const char *name) {
+#ifndef SIOCGIFINDEX
+ return 0;
+#else
+ struct ifreq ifrq;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:etherStatsTable:ioctl", "ifindex_get\n"));
+
+ rc = _etherStats_ioctl_get(fd, SIOCGIFINDEX, &ifrq, name);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:etherStats:ioctl",
+ "ifindex_get error on inerface '%s'\n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, ifindex_get error on inerface '%s'\n", name);
+ return 0;
+
+ }
+
+ return ifrq.ifr_ifindex;
+#endif /* SIOCGIFINDEX */
+}
+
+/*
+ * @retval 0 success
+ * @retval -1 cannot get ETHTOOL_DRVINFO failed
+ * @retval -2 n_stats zero - no statistcs available
+ * @retval -3 memory allocation for holding the statistics failed
+ * @retval -4 cannot get ETHTOOL_GSTRINGS information
+ * @retval -5 cannot get ETHTOOL_GSTATS information
+ * @retval -6 function not supported if HAVE_LINUX_ETHTOOL_H not defined
+ */
+
+int
+interface_ioctl_etherstats_get (etherStatsTable_rowreq_ctx *rowreq_ctx , int fd, const char *name) {
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+
+ etherStatsTable_data *data = &rowreq_ctx->data;
+ struct ethtool_drvinfo driver_info;
+ struct ethtool_gstrings *eth_strings;
+ struct ethtool_stats *eth_stats;
+ struct ifreq ifr;
+ unsigned int nstats, size_str, i;
+ int err;
+
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "called\n"));
+
+ memset(&ifr, 0, sizeof(ifr));
+ strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+
+ memset(&driver_info, 0, sizeof(driver_info));
+ driver_info.cmd = ETHTOOL_GDRVINFO;
+ ifr.ifr_data = (char *)&driver_info;
+
+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "ETHTOOL_GETDRVINFO failed on interface |%s| \n", name));
+ return -1;
+ }
+
+ nstats = driver_info.n_stats;
+ if (nstats < 1) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "no stats available for interface |%s| \n", name));
+ return -2;
+ }
+
+ size_str = nstats * ETH_GSTRING_LEN;
+
+ eth_strings = malloc(size_str + sizeof (struct ethtool_gstrings));
+ if (!eth_strings) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "no memory available\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no memory available\n");
+
+ return -3;
+ }
+ memset (eth_strings, 0, (size_str + sizeof (struct ethtool_gstrings)));
+
+ eth_stats = malloc (size_str + sizeof (struct ethtool_stats));
+ if (!eth_stats) {
+ free (eth_strings);
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "no memory available\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no memory available\n");
+
+ return -3;
+ }
+ memset (eth_stats, 0, (size_str + sizeof (struct ethtool_stats)));
+
+ eth_strings->cmd = ETHTOOL_GSTRINGS;
+ eth_strings->string_set = ETH_SS_STATS;
+ eth_strings->len = nstats;
+ ifr.ifr_data = (char *) eth_strings;
+
+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "cannot get stats strings information for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, cannot get stats strings information for interface |%s| \n", name);
+
+ free(eth_strings);
+ free(eth_stats);
+ return -4;
+ }
+
+ eth_stats->cmd = ETHTOOL_GSTATS;
+ eth_stats->n_stats = nstats;
+ ifr.ifr_data = (char *) eth_stats;
+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "cannot get stats strings information for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, cannot get stats information for interface |%s| \n", name);
+
+ free(eth_strings);
+ free(eth_stats);
+ return -5;
+ }
+
+ for (i = 0; i < nstats; i++) {
+ char s[ETH_GSTRING_LEN];
+
+ strlcpy(s, (const char *) &eth_strings->data[i * ETH_GSTRING_LEN],
+ sizeof(s));
+
+ if (ETHERSTATSJABBERS(s)) {
+ data->etherStatsJabbers = (u_long)eth_stats->data[i];
+ rowreq_ctx->column_exists_flags |= COLUMN_ETHERSTATSJABBERS_FLAG;
+ }
+ }
+ free(eth_strings);
+ free(eth_stats);
+
+ return 0;
+#else
+ return -6;
+#endif
+
+}
+
+
+/* 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
+ */
+int
+_etherStats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name)
+{
+ int ourfd = -1, rc = 0;
+
+ DEBUGMSGTL(("access:etherStatsTable:ioctl", "_etherStats_ioctl_get\n"));
+ /*
+ * sanity checks
+ */
+ if(NULL == name) {
+ DEBUGMSGTL(("access:etherStatsTable:ioctl",
+ "_etherStats_ioctl_get invalid ifname '%s'\n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, _etherStats_ioctl_get error on inerface '%s'\n", name);
+ return -1;
+ }
+
+ /*
+ * create socket for ioctls
+ */
+ if(fd < 0) {
+ fd = ourfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(ourfd < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:ioctl",
+ "_etherStats_ioctl_get couldn't create a socket\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, _etherStats_ioctl_get error on inerface '%s'\n", name);
+
+ return -2;
+ }
+ }
+
+ strlcpy(ifrq->ifr_name, name, sizeof(ifrq->ifr_name));
+ rc = ioctl(fd, which, ifrq);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:ioctl",
+ "_etherStats_ioctl_get ioctl %d returned %d\n", which, rc));
+ rc = -3;
+ }
+
+ if(ourfd >= 0)
+ close(ourfd);
+
+ return rc;
+}
+
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable.h b/agent/mibgroup/rmon-mib/etherStatsTable.h
new file mode 100644
index 0000000..772845e
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable.h
@@ -0,0 +1,11 @@
+/*
+ * module to include the modules
+ */
+
+config_require(rmon-mib/data_access/etherstats)
+config_require(rmon-mib/etherStatsTable/etherStatsTable)
+config_require(rmon-mib/etherStatsTable/etherStatsTable_data_get)
+config_require(rmon-mib/etherStatsTable/etherStatsTable_data_set)
+config_require(rmon-mib/etherStatsTable/etherStatsTable_data_access)
+config_require(rmon-mib/etherStatsTable/etherStatsTable_interface)
+
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c
new file mode 100644
index 0000000..05a6e22
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c
@@ -0,0 +1,233 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for etherStatsTable
+ *
+ * \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 "etherStatsTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "etherStatsTable_interface.h"
+
+oid etherStatsTable_oid[] = { ETHERSTATSTABLE_OID };
+int etherStatsTable_oid_size = OID_LENGTH(etherStatsTable_oid);
+
+etherStatsTable_registration etherStatsTable_user_context;
+static etherStatsTable_registration *etherStatsTable_user_context_p;
+
+void initialize_table_etherStatsTable(void);
+void shutdown_table_etherStatsTable(void);
+
+
+/**
+ * Initializes the etherStatsTable module
+ */
+void
+init_etherStatsTable(void)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:init_etherStatsTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform etherStatsTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("etherStatsTable"))
+ initialize_table_etherStatsTable();
+
+} /* init_etherStatsTable */
+
+/**
+ * Shut-down the etherStatsTable module (agent is exiting)
+ */
+void
+shutdown_etherStatsTable(void)
+{
+ if (should_init("etherStatsTable"))
+ shutdown_table_etherStatsTable();
+
+}
+
+/**
+ * Initialize the table etherStatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_etherStatsTable(void)
+{
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:etherStatsTable:initialize_table_etherStatsTable",
+ "called\n"));
+
+ /*
+ * TODO:301:o: Perform etherStatsTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize etherStatsTable 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.
+ */
+ etherStatsTable_user_context_p
+ = netsnmp_create_data_list("etherStatsTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _etherStatsTable_initialize_interface
+ (etherStatsTable_user_context_p, flags);
+} /* initialize_table_etherStatsTable */
+
+/**
+ * Shutdown the table etherStatsTable
+ */
+void
+shutdown_table_etherStatsTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _etherStatsTable_shutdown_interface(etherStatsTable_user_context_p);
+ netsnmp_free_all_list_data(etherStatsTable_user_context_p);
+ etherStatsTable_user_context_p = NULL;
+}
+
+/**
+ * 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
+etherStatsTable_rowreq_ctx_init(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_rowreq_ctx_init",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra etherStatsTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* etherStatsTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+etherStatsTable_rowreq_ctx_cleanup(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra etherStatsTable rowreq cleanup.
+ */
+} /* etherStatsTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+etherStatsTable_pre_request(etherStatsTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform etherStatsTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* etherStatsTable_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
+etherStatsTable_post_request(etherStatsTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform etherStatsTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (etherStatsTable_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
+ */
+ }
+
+ etherStatsTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* etherStatsTable_post_request */
+
+
+/** @{ */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h
new file mode 100644
index 0000000..9f7f03c
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h
@@ -0,0 +1,303 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef ETHERSTATSTABLE_H
+#define ETHERSTATSTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * OID and column number definitions for etherStatsTable
+ */
+#include "etherStatsTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "etherStatsTable_enums.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_etherStatsTable(void);
+ void shutdown_etherStatsTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table etherStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * RMON-MIB::etherStatsTable is subid 1 of statistics.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.16.1.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 etherStatsTable registration context.
+ */
+ typedef netsnmp_data_list etherStatsTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review etherStatsTable data context structure.
+ * This structure is used to represent the data for etherStatsTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * etherStatsTable.
+ */
+ typedef struct etherStatsTable_data_s {
+
+ /*
+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ oid etherStatsDataSource[128];
+ size_t etherStatsDataSource_len; /* # of oid elements, not bytes */
+
+ /*
+ * etherStatsDropEvents(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsDropEvents;
+
+ /*
+ * etherStatsOctets(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsOctets;
+
+ /*
+ * etherStatsPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsPkts;
+
+ /*
+ * etherStatsBroadcastPkts(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsBroadcastPkts;
+
+ /*
+ * etherStatsMulticastPkts(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsMulticastPkts;
+
+ /*
+ * etherStatsCRCAlignErrors(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsCRCAlignErrors;
+
+ /*
+ * etherStatsUndersizePkts(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsUndersizePkts;
+
+ /*
+ * etherStatsOversizePkts(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsOversizePkts;
+
+ /*
+ * etherStatsFragments(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsFragments;
+
+ /*
+ * etherStatsJabbers(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsJabbers;
+
+ /*
+ * etherStatsCollisions(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsCollisions;
+
+ /*
+ * etherStatsPkts64Octets(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsPkts64Octets;
+
+ /*
+ * etherStatsPkts65to127Octets(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsPkts65to127Octets;
+
+ /*
+ * etherStatsPkts128to255Octets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsPkts128to255Octets;
+
+ /*
+ * etherStatsPkts256to511Octets(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsPkts256to511Octets;
+
+ /*
+ * etherStatsPkts512to1023Octets(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsPkts512to1023Octets;
+
+ /*
+ * etherStatsPkts1024to1518Octets(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long etherStatsPkts1024to1518Octets;
+
+ /*
+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char etherStatsOwner[127];
+ size_t etherStatsOwner_len; /* # of char elements, not bytes */
+
+ /*
+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long etherStatsStatus;
+
+ } etherStatsTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review etherStatsTable 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 etherStatsTable_data etherStatsTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review etherStatsTable mib index.
+ * This structure is used to represent the index for etherStatsTable.
+ */
+ typedef struct etherStatsTable_mib_index_s {
+
+ /*
+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long etherStatsIndex;
+
+
+ } etherStatsTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review etherStatsTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_etherStatsTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review etherStatsTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * etherStatsTable_rowreq_ctx pointer.
+ */
+ typedef struct etherStatsTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_etherStatsTable_IDX_LEN];
+
+ etherStatsTable_mib_index tbl_idx;
+
+ etherStatsTable_data data;
+ unsigned int column_exists_flags; /* flags for existence */
+ etherStatsTable_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 etherStatsTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *etherStatsTable_data_list;
+
+ } etherStatsTable_rowreq_ctx;
+
+ typedef struct etherStatsTable_ref_rowreq_ctx_s {
+ etherStatsTable_rowreq_ctx *rowreq_ctx;
+ } etherStatsTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ etherStatsTable_pre_request(etherStatsTable_registration *
+ user_context);
+ int
+ etherStatsTable_post_request(etherStatsTable_registration *
+ user_context, int rc);
+
+ int
+ etherStatsTable_rowreq_ctx_init(etherStatsTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ etherStatsTable_rowreq_ctx_cleanup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int etherStatsTable_commit(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ etherStatsTable_rowreq_ctx
+ *etherStatsTable_row_find_by_mib_index(etherStatsTable_mib_index *
+ mib_idx);
+
+ extern oid etherStatsTable_oid[];
+ extern int etherStatsTable_oid_size;
+
+
+#include "etherStatsTable_interface.h"
+#include "etherStatsTable_data_access.h"
+#include "etherStatsTable_data_get.h"
+#include "etherStatsTable_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 /* ETHERSTATSTABLE_H */
+/** @} */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c
new file mode 100644
index 0000000..974636a
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c
@@ -0,0 +1,525 @@
+/*
+ * 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 "etherStatsTable.h"
+#include "etherStatsTable_data_access.h"
+
+#if defined(linux)
+#include "ioctl_imp_common.h"
+#endif
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table etherStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * RMON-MIB::etherStatsTable is subid 1 of statistics.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.16.1.1, length: 9
+ */
+
+/**
+ * initialization for etherStatsTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param etherStatsTable_reg
+ * Pointer to etherStatsTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+etherStatsTable_init_data(etherStatsTable_registration *
+ etherStatsTable_reg)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize etherStatsTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* etherStatsTable_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
+etherStatsTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to etherStatsTable_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 etherStatsTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up etherStatsTable 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 = ETHERSTATSTABLE_CACHE_TIMEOUT; /* seconds */
+} /* etherStatsTable_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 etherStatsTable_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
+etherStatsTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to etherStatsTable_container_shutdown\n");
+ return;
+ }
+
+} /* etherStatsTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement etherStatsTable 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
+ * etherStatsTable_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
+etherStatsTable_container_load(netsnmp_container * container)
+{
+ etherStatsTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_container_load",
+ "called\n"));
+
+ /*
+ * TODO:352:M: | |-> set indexes in new etherStatsTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+
+ /*
+ * temporary storage for index values
+ */
+
+ /*
+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+
+ long etherStatsIndex;
+ int fd;
+ int rc = 0, retval = 0;
+
+#if defined(linux)
+ struct ifname *list_head = NULL, *p = NULL;
+#endif
+
+ /*
+ * 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;
+ }
+
+ /*
+ * get the interface names of the devices present in the system, in case of failure retval suggests the reson for failure
+ * and list_head contains null
+ */
+
+#if defined(linux)
+ list_head = etherstats_interface_name_list_get (list_head, &retval);
+
+ if (!list_head) {
+ snmp_log (LOG_ERR, "access:etherStatsTable, error getting the interface names present in the system\n");
+ DEBUGMSGTL(("access:etherStatsTable", "error getting the interface names present in the system"));
+ close(fd);
+ return MFD_ERROR;
+ }
+
+ /*
+ * Walk over the list of interface names present in the system and retreive the statistics
+ */
+
+ for (p = list_head; p; p = p->ifn_next) {
+ DEBUGMSGTL(("access:etherStatsTable", "processing '%s'\n", p->name));
+
+ /*
+ * get index via ioctl.
+ */
+
+ etherStatsIndex = (long) etherstats_interface_ioctl_ifindex_get(-1, p->name);
+
+ /*
+ * get the etherstats contents populated, if the device is not an ethernet device
+ * the operation will not be supported and an error message will be logged
+ */
+
+ rowreq_ctx = etherStatsTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ close(fd);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ if (MFD_SUCCESS !=
+ etherStatsTable_indexes_set(rowreq_ctx, etherStatsIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "etherStatsTable data.\n");
+ etherStatsTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate etherStatsTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * non-TRANSIENT data: no need to copy. set pointer to data
+ */
+
+ memset (&rowreq_ctx->data, 0, sizeof (rowreq_ctx->data));
+ rc = interface_ioctl_etherstats_get (rowreq_ctx, fd, p->name);
+
+ if (rc < 0) {
+ DEBUGMSGTL(("access:etherStatsTable", "error getting the statistics for interface |%s| "
+ "etherStatsTable data, operation might not be supported\n", p->name));
+ etherStatsTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * insert into table container
+ */
+ rc = CONTAINER_INSERT(container, rowreq_ctx);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:etherStatsTable", "error inserting |%s| ", p->name));
+ etherStatsTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ ++count;
+ }
+
+ close(fd);
+
+ /*
+ * free the interface names list
+ */
+
+ if ( (etherstats_interface_name_list_free(list_head)) < 0) {
+ snmp_log(LOG_ERR, "access:etherStatsTable, error freeing the interface name list \n");
+ DEBUGMSGTL(("access:etherStatsTable", "error freeing the interface name list\n"));
+ return MFD_ERROR;
+ }
+#endif
+
+ DEBUGMSGT(("verbose:etherStatsTable:etherStatsTable_container_load",
+ "inserted %" NETSNMP_PRIz "d records\n", count));
+
+ return MFD_SUCCESS;
+}
+ /* etherStatsTable_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
+etherStatsTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free etherStatsTable container data.
+ */
+} /* etherStatsTable_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
+etherStatsTable_row_prep(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_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;
+} /* etherStatsTable_row_prep */
+
+/*
+ * TODO:420:r: Implement etherStatsTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsIndex
+ * etherStatsIndex is subid 1 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.1
+ * Description:
+The value of this object uniquely identifies this
+ etherStats entry.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * 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 validity of etherStatsIndex 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
+ * etherStatsTable_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 - 65535
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+etherStatsIndex_check_index(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsIndex_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check etherStatsTable index etherStatsIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.etherStatsIndex)
+ */
+
+ return MFD_SUCCESS; /* etherStatsIndex index ok */
+} /* etherStatsIndex_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 etherStatsTable_reg
+ * Pointer to the user registration data
+ * @param etherStatsTable_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
+etherStatsTable_validate_index(etherStatsTable_registration *
+ etherStatsTable_reg,
+ etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_validate_index",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential etherStatsTable index.
+ */
+ if (1) {
+ snmp_log(LOG_WARNING, "invalid index for a new row in the "
+ "etherStatsTable 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;
+} /* etherStatsTable_validate_index */
+
+/** @} */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h
new file mode 100644
index 0000000..00700f4
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h
@@ -0,0 +1,80 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef ETHERSTATSTABLE_DATA_ACCESS_H
+#define ETHERSTATSTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table etherStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * RMON-MIB::etherStatsTable is subid 1 of statistics.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.16.1.1, length: 9
+ */
+
+
+ int etherStatsTable_init_data(etherStatsTable_registration
+ * etherStatsTable_reg);
+
+
+ /*
+ * TODO:180:o: Review etherStatsTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define ETHERSTATSTABLE_CACHE_TIMEOUT 60
+
+ void etherStatsTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void etherStatsTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int etherStatsTable_container_load(netsnmp_container *
+ container);
+ void etherStatsTable_container_free(netsnmp_container *
+ container);
+
+ int etherStatsTable_cache_load(netsnmp_container *
+ container);
+ void etherStatsTable_cache_free(netsnmp_container *
+ container);
+
+#define MAX_LINE_SIZE 256
+
+ int etherStatsTable_row_prep(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsTable_validate_index(etherStatsTable_registration *
+ etherStatsTable_reg,
+ etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsIndex_check_index(etherStatsTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ETHERSTATSTABLE_DATA_ACCESS_H */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c
new file mode 100644
index 0000000..3ba51d7
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c
@@ -0,0 +1,1411 @@
+/*
+ * 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 "etherStatsTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement etherStatsTable get routines.
+ * TODO:240:M: Implement etherStatsTable 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 etherStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * RMON-MIB::etherStatsTable is subid 1 of statistics.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.16.1.1, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement etherStatsTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param etherStatsIndex_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
+etherStatsTable_indexes_set_tbl_idx(etherStatsTable_mib_index * tbl_idx,
+ long etherStatsIndex_val)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->etherStatsIndex = etherStatsIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* etherStatsTable_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
+etherStatsTable_indexes_set(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ long etherStatsIndex_val)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ etherStatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ etherStatsIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != etherStatsTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* etherStatsTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsDataSource
+ * etherStatsDataSource is subid 2 of etherStatsEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.16.1.1.1.2
+ * Description:
+This object identifies the source of the data that
+ this etherStats entry is configured to analyze. This
+ source can be any ethernet interface on this device.
+ In order to identify a particular interface, this object
+ shall identify the instance of the ifIndex object,
+ defined in RFC 2233 [17], for the desired interface.
+ For example, if an entry were to receive data from
+ interface #1, this object would be set to ifIndex.1.
+
+ The statistics in this group reflect all packets
+ on the local network segment attached to the identified
+ interface.
+
+ An agent may or may not be able to tell if fundamental
+ changes to the media of the interface have occurred and
+ necessitate an invalidation of this entry. For example, a
+ hot-pluggable ethernet card could be pulled out and replaced
+ by a token-ring card. In such a case, if the agent has such
+ knowledge of the change, it is recommended that it
+ invalidate this entry.
+
+ This object may not be modified if the associated
+ etherStatsStatus object is equal to valid(1).
+ *
+ * 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.
+ */
+/**
+ * Extract the current value of the etherStatsDataSource data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsDataSource_val_ptr_ptr
+ * Pointer to storage for a oid variable
+ * @param etherStatsDataSource_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by etherStatsDataSource.
+ * 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 (*etherStatsDataSource_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update etherStatsDataSource_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
+etherStatsDataSource_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ oid ** etherStatsDataSource_val_ptr_ptr,
+ size_t *etherStatsDataSource_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != etherStatsDataSource_val_ptr_ptr)
+ && (NULL != *etherStatsDataSource_val_ptr_ptr));
+ netsnmp_assert(NULL != etherStatsDataSource_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsDataSource data.
+ * copy (* etherStatsDataSource_val_ptr_ptr ) data and (* etherStatsDataSource_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for etherStatsDataSource data
+ */
+ if ((NULL == (*etherStatsDataSource_val_ptr_ptr)) ||
+ ((*etherStatsDataSource_val_ptr_len_ptr) <
+ (rowreq_ctx->data.etherStatsDataSource_len *
+ sizeof(rowreq_ctx->data.etherStatsDataSource[0])))) {
+ /*
+ * allocate space for etherStatsDataSource data
+ */
+ (*etherStatsDataSource_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.etherStatsDataSource_len *
+ sizeof(rowreq_ctx->data.etherStatsDataSource[0]));
+ if (NULL == (*etherStatsDataSource_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*etherStatsDataSource_val_ptr_len_ptr) =
+ rowreq_ctx->data.etherStatsDataSource_len *
+ sizeof(rowreq_ctx->data.etherStatsDataSource[0]);
+ memcpy((*etherStatsDataSource_val_ptr_ptr),
+ rowreq_ctx->data.etherStatsDataSource,
+ rowreq_ctx->data.etherStatsDataSource_len *
+ sizeof(rowreq_ctx->data.etherStatsDataSource[0]));
+
+ return MFD_SUCCESS;
+} /* etherStatsDataSource_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsDropEvents
+ * etherStatsDropEvents is subid 3 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.3
+ * Description:
+The total number of events in which packets
+ were dropped by the probe due to lack of resources.
+ Note that this number is not necessarily the number of
+ packets dropped; it is just the number of times this
+ condition has been detected.
+ *
+ * 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 etherStatsDropEvents data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsDropEvents_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
+etherStatsDropEvents_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsDropEvents_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsDropEvents_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDropEvents_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsDropEvents data.
+ * copy (* etherStatsDropEvents_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsDropEvents_val_ptr) =
+ rowreq_ctx->data.etherStatsDropEvents;
+
+ return MFD_SUCCESS;
+} /* etherStatsDropEvents_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsOctets
+ * etherStatsOctets is subid 4 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.4
+ * Description:
+The total number of octets of data (including
+ those in bad packets) received on the
+ network (excluding framing bits but including
+ FCS octets).
+
+ This object can be used as a reasonable estimate of
+ 10-Megabit ethernet utilization. If greater precision is
+ desired, the etherStatsPkts and etherStatsOctets objects
+ should be sampled before and after a common interval. The
+ differences in the sampled values are Pkts and Octets,
+ respectively, and the number of seconds in the interval is
+ Interval. These values are used to calculate the Utilization
+ as follows:
+
+ Pkts * (9.6 + 6.4) + (Octets * .8)
+ Utilization = -------------------------------------
+ Interval * 10,000
+
+ The result of this equation is the value Utilization which
+ is the percent utilization of the ethernet segment on a
+ scale of 0 to 100 percent.
+ *
+ * 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 etherStatsOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsOctets_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
+etherStatsOctets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOctets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsOctets data.
+ * copy (* etherStatsOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsOctets_val_ptr) = rowreq_ctx->data.etherStatsOctets;
+
+ return MFD_SUCCESS;
+} /* etherStatsOctets_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsPkts
+ * etherStatsPkts is subid 5 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.5
+ * Description:
+The total number of packets (including bad packets,
+ broadcast packets, and multicast packets) received.
+ *
+ * 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 etherStatsPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsPkts_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
+etherStatsPkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts data.
+ * copy (* etherStatsPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsPkts_val_ptr) = rowreq_ctx->data.etherStatsPkts;
+
+ return MFD_SUCCESS;
+} /* etherStatsPkts_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsBroadcastPkts
+ * etherStatsBroadcastPkts is subid 6 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.6
+ * Description:
+The total number of good packets received that were
+ directed to the broadcast address. Note that this
+ does not include multicast packets.
+ *
+ * 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 etherStatsBroadcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsBroadcastPkts_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
+etherStatsBroadcastPkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsBroadcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsBroadcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsBroadcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsBroadcastPkts data.
+ * copy (* etherStatsBroadcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsBroadcastPkts_val_ptr) =
+ rowreq_ctx->data.etherStatsBroadcastPkts;
+
+ return MFD_SUCCESS;
+} /* etherStatsBroadcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsMulticastPkts
+ * etherStatsMulticastPkts is subid 7 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.7
+ * Description:
+The total number of good packets received that were
+ directed to a multicast address. Note that this number
+ does not include packets directed to the broadcast
+
+ address.
+ *
+ * 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 etherStatsMulticastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsMulticastPkts_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
+etherStatsMulticastPkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsMulticastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsMulticastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsMulticastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsMulticastPkts data.
+ * copy (* etherStatsMulticastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsMulticastPkts_val_ptr) =
+ rowreq_ctx->data.etherStatsMulticastPkts;
+
+ return MFD_SUCCESS;
+} /* etherStatsMulticastPkts_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsCRCAlignErrors
+ * etherStatsCRCAlignErrors is subid 8 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.8
+ * Description:
+The total number of packets received that
+ had a length (excluding framing bits, but
+ including FCS octets) of between 64 and 1518
+ octets, inclusive, but had either a bad
+ Frame Check Sequence (FCS) with an integral
+ number of octets (FCS Error) or a bad FCS with
+ a non-integral number of octets (Alignment Error).
+ *
+ * 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 etherStatsCRCAlignErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsCRCAlignErrors_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
+etherStatsCRCAlignErrors_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsCRCAlignErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsCRCAlignErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsCRCAlignErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsCRCAlignErrors data.
+ * copy (* etherStatsCRCAlignErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsCRCAlignErrors_val_ptr) =
+ rowreq_ctx->data.etherStatsCRCAlignErrors;
+
+ return MFD_SUCCESS;
+} /* etherStatsCRCAlignErrors_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsUndersizePkts
+ * etherStatsUndersizePkts is subid 9 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.9
+ * Description:
+The total number of packets received that were
+ less than 64 octets long (excluding framing bits,
+ but including FCS octets) and were otherwise well
+ formed.
+ *
+ * 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 etherStatsUndersizePkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsUndersizePkts_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
+etherStatsUndersizePkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsUndersizePkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsUndersizePkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsUndersizePkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsUndersizePkts data.
+ * copy (* etherStatsUndersizePkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsUndersizePkts_val_ptr) =
+ rowreq_ctx->data.etherStatsUndersizePkts;
+
+ return MFD_SUCCESS;
+} /* etherStatsUndersizePkts_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsOversizePkts
+ * etherStatsOversizePkts is subid 10 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.10
+ * Description:
+The total number of packets received that were
+ longer than 1518 octets (excluding framing bits,
+ but including FCS octets) and were otherwise
+ well formed.
+ *
+ * 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 etherStatsOversizePkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsOversizePkts_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
+etherStatsOversizePkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsOversizePkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsOversizePkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOversizePkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsOversizePkts data.
+ * copy (* etherStatsOversizePkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsOversizePkts_val_ptr) =
+ rowreq_ctx->data.etherStatsOversizePkts;
+
+ return MFD_SUCCESS;
+} /* etherStatsOversizePkts_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsFragments
+ * etherStatsFragments is subid 11 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.11
+ * Description:
+The total number of packets received that were less than
+ 64 octets in length (excluding framing bits but including
+ FCS octets) and had either a bad Frame Check Sequence
+ (FCS) with an integral number of octets (FCS Error) or a
+ bad FCS with a non-integral number of octets (Alignment
+ Error).
+
+ Note that it is entirely normal for etherStatsFragments to
+ increment. This is because it counts both runts (which are
+ normal occurrences due to collisions) and noise hits.
+ *
+ * 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 etherStatsFragments data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsFragments_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
+etherStatsFragments_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsFragments_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsFragments_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsFragments_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsFragments data.
+ * copy (* etherStatsFragments_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsFragments_val_ptr) = rowreq_ctx->data.etherStatsFragments;
+
+ return MFD_SUCCESS;
+} /* etherStatsFragments_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsJabbers
+ * etherStatsJabbers is subid 12 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.12
+ * Description:
+The total number of packets received that were
+ longer than 1518 octets (excluding framing bits,
+ but including FCS octets), and had either a bad
+ Frame Check Sequence (FCS) with an integral number
+ of octets (FCS Error) or a bad FCS with a non-integral
+ number of octets (Alignment Error).
+
+ Note that this definition of jabber is different
+ than the definition in IEEE-802.3 section 8.2.1.5
+ (10BASE5) and section 10.3.1.4 (10BASE2). These
+ documents define jabber as the condition where any
+ packet exceeds 20 ms. The allowed range to detect
+ jabber is between 20 ms and 150 ms.
+ *
+ * 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 etherStatsJabbers data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsJabbers_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
+etherStatsJabbers_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsJabbers_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsJabbers_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsJabbers_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsJabbers data.
+ * copy (* etherStatsJabbers_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsJabbers_val_ptr) = rowreq_ctx->data.etherStatsJabbers;
+
+ return MFD_SUCCESS;
+} /* etherStatsJabbers_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsCollisions
+ * etherStatsCollisions is subid 13 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.13
+ * Description:
+The best estimate of the total number of collisions
+ on this Ethernet segment.
+
+ The value returned will depend on the location of the
+ RMON probe. Section 8.2.1.3 (10BASE-5) and section
+ 10.3.1.3 (10BASE-2) of IEEE standard 802.3 states that a
+ station must detect a collision, in the receive mode, if
+ three or more stations are transmitting simultaneously. A
+ repeater port must detect a collision when two or more
+
+ stations are transmitting simultaneously. Thus a probe
+ placed on a repeater port could record more collisions
+ than a probe connected to a station on the same segment
+ would.
+
+ Probe location plays a much smaller role when considering
+ 10BASE-T. 14.2.1.4 (10BASE-T) of IEEE standard 802.3
+ defines a collision as the simultaneous presence of signals
+ on the DO and RD circuits (transmitting and receiving
+ at the same time). A 10BASE-T station can only detect
+ collisions when it is transmitting. Thus probes placed on
+ a station and a repeater, should report the same number of
+ collisions.
+
+ Note also that an RMON probe inside a repeater should
+ ideally report collisions between the repeater and one or
+ more other hosts (transmit collisions as defined by IEEE
+ 802.3k) plus receiver collisions observed on any coax
+ segments to which the repeater is connected.
+ *
+ * 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 etherStatsCollisions data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsCollisions_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
+etherStatsCollisions_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsCollisions_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsCollisions_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsCollisions_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsCollisions data.
+ * copy (* etherStatsCollisions_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsCollisions_val_ptr) =
+ rowreq_ctx->data.etherStatsCollisions;
+
+ return MFD_SUCCESS;
+} /* etherStatsCollisions_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsPkts64Octets
+ * etherStatsPkts64Octets is subid 14 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.14
+ * Description:
+The total number of packets (including bad
+ packets) received that were 64 octets in length
+ (excluding framing bits but including FCS octets).
+ *
+ * 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 etherStatsPkts64Octets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsPkts64Octets_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
+etherStatsPkts64Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsPkts64Octets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsPkts64Octets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts64Octets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts64Octets data.
+ * copy (* etherStatsPkts64Octets_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsPkts64Octets_val_ptr) =
+ rowreq_ctx->data.etherStatsPkts64Octets;
+
+ return MFD_SUCCESS;
+} /* etherStatsPkts64Octets_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsPkts65to127Octets
+ * etherStatsPkts65to127Octets is subid 15 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.15
+ * Description:
+The total number of packets (including bad
+ packets) received that were between
+ 65 and 127 octets in length inclusive
+ (excluding framing bits but including FCS octets).
+ *
+ * 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 etherStatsPkts65to127Octets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsPkts65to127Octets_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
+etherStatsPkts65to127Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ etherStatsPkts65to127Octets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsPkts65to127Octets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts65to127Octets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts65to127Octets data.
+ * copy (* etherStatsPkts65to127Octets_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsPkts65to127Octets_val_ptr) =
+ rowreq_ctx->data.etherStatsPkts65to127Octets;
+
+ return MFD_SUCCESS;
+} /* etherStatsPkts65to127Octets_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsPkts128to255Octets
+ * etherStatsPkts128to255Octets is subid 16 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.16
+ * Description:
+The total number of packets (including bad
+ packets) received that were between
+ 128 and 255 octets in length inclusive
+ (excluding framing bits but including FCS octets).
+ *
+ * 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 etherStatsPkts128to255Octets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsPkts128to255Octets_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
+etherStatsPkts128to255Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ etherStatsPkts128to255Octets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsPkts128to255Octets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts128to255Octets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts128to255Octets data.
+ * copy (* etherStatsPkts128to255Octets_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsPkts128to255Octets_val_ptr) =
+ rowreq_ctx->data.etherStatsPkts128to255Octets;
+
+ return MFD_SUCCESS;
+} /* etherStatsPkts128to255Octets_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsPkts256to511Octets
+ * etherStatsPkts256to511Octets is subid 17 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.17
+ * Description:
+The total number of packets (including bad
+ packets) received that were between
+ 256 and 511 octets in length inclusive
+ (excluding framing bits but including FCS octets).
+ *
+ * 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 etherStatsPkts256to511Octets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsPkts256to511Octets_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
+etherStatsPkts256to511Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ etherStatsPkts256to511Octets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsPkts256to511Octets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts256to511Octets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts256to511Octets data.
+ * copy (* etherStatsPkts256to511Octets_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsPkts256to511Octets_val_ptr) =
+ rowreq_ctx->data.etherStatsPkts256to511Octets;
+
+ return MFD_SUCCESS;
+} /* etherStatsPkts256to511Octets_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsPkts512to1023Octets
+ * etherStatsPkts512to1023Octets is subid 18 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.18
+ * Description:
+The total number of packets (including bad
+ packets) received that were between
+ 512 and 1023 octets in length inclusive
+ (excluding framing bits but including FCS octets).
+ *
+ * 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 etherStatsPkts512to1023Octets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsPkts512to1023Octets_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
+etherStatsPkts512to1023Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ etherStatsPkts512to1023Octets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsPkts512to1023Octets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts512to1023Octets_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts512to1023Octets data.
+ * copy (* etherStatsPkts512to1023Octets_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsPkts512to1023Octets_val_ptr) =
+ rowreq_ctx->data.etherStatsPkts512to1023Octets;
+
+ return MFD_SUCCESS;
+} /* etherStatsPkts512to1023Octets_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsPkts1024to1518Octets
+ * etherStatsPkts1024to1518Octets is subid 19 of etherStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.16.1.1.1.19
+ * Description:
+The total number of packets (including bad
+ packets) received that were between
+ 1024 and 1518 octets in length inclusive
+ (excluding framing bits but including FCS octets).
+ *
+ * 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 etherStatsPkts1024to1518Octets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsPkts1024to1518Octets_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
+etherStatsPkts1024to1518Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ etherStatsPkts1024to1518Octets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsPkts1024to1518Octets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts1024to1518Octets_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts1024to1518Octets data.
+ * copy (* etherStatsPkts1024to1518Octets_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsPkts1024to1518Octets_val_ptr) =
+ rowreq_ctx->data.etherStatsPkts1024to1518Octets;
+
+ return MFD_SUCCESS;
+} /* etherStatsPkts1024to1518Octets_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsOwner
+ * etherStatsOwner is subid 20 of etherStatsEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.16.1.1.1.20
+ * Description:
+The entity that configured this entry and is therefore
+ using the resources assigned to it.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 127;
+ *
+ * Its syntax is OwnerString (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 127)
+ */
+/**
+ * Extract the current value of the etherStatsOwner data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsOwner_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param etherStatsOwner_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by etherStatsOwner.
+ * 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 (*etherStatsOwner_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update etherStatsOwner_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
+etherStatsOwner_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ char **etherStatsOwner_val_ptr_ptr,
+ size_t *etherStatsOwner_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != etherStatsOwner_val_ptr_ptr)
+ && (NULL != *etherStatsOwner_val_ptr_ptr));
+ netsnmp_assert(NULL != etherStatsOwner_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsOwner data.
+ * copy (* etherStatsOwner_val_ptr_ptr ) data and (* etherStatsOwner_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for etherStatsOwner data
+ */
+ if ((NULL == (*etherStatsOwner_val_ptr_ptr)) ||
+ ((*etherStatsOwner_val_ptr_len_ptr) <
+ (rowreq_ctx->data.etherStatsOwner_len *
+ sizeof(rowreq_ctx->data.etherStatsOwner[0])))) {
+ /*
+ * allocate space for etherStatsOwner data
+ */
+ (*etherStatsOwner_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.etherStatsOwner_len *
+ sizeof(rowreq_ctx->data.etherStatsOwner[0]));
+ if (NULL == (*etherStatsOwner_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*etherStatsOwner_val_ptr_len_ptr) =
+ rowreq_ctx->data.etherStatsOwner_len *
+ sizeof(rowreq_ctx->data.etherStatsOwner[0]);
+ memcpy((*etherStatsOwner_val_ptr_ptr),
+ rowreq_ctx->data.etherStatsOwner,
+ rowreq_ctx->data.etherStatsOwner_len *
+ sizeof(rowreq_ctx->data.etherStatsOwner[0]));
+
+ return MFD_SUCCESS;
+} /* etherStatsOwner_get */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsStatus
+ * etherStatsStatus is subid 21 of etherStatsEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.16.1.1.1.21
+ * Description:
+The status of this etherStats entry.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: valid(1), createRequest(2), underCreation(3), invalid(4)
+ *
+ * Its syntax is EntryStatus (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 etherStatsStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsStatus_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
+etherStatsStatus_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * etherStatsStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != etherStatsStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the etherStatsStatus data.
+ * copy (* etherStatsStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*etherStatsStatus_val_ptr) = rowreq_ctx->data.etherStatsStatus;
+
+ return MFD_SUCCESS;
+} /* etherStatsStatus_get */
+
+
+
+/** @} */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h
new file mode 100644
index 0000000..5775212
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h
@@ -0,0 +1,151 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file etherStatsTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef ETHERSTATSTABLE_DATA_GET_H
+#define ETHERSTATSTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table etherStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * RMON-MIB::etherStatsTable is subid 1 of statistics.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.16.1.1, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int etherStatsDataSource_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ oid **
+ etherStatsDataSource_val_ptr_ptr,
+ size_t
+ *etherStatsDataSource_val_ptr_len_ptr);
+ int etherStatsDropEvents_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsDropEvents_val_ptr);
+ int etherStatsOctets_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsOctets_val_ptr);
+ int etherStatsPkts_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * etherStatsPkts_val_ptr);
+ int etherStatsBroadcastPkts_get(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ etherStatsBroadcastPkts_val_ptr);
+ int etherStatsMulticastPkts_get(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ etherStatsMulticastPkts_val_ptr);
+ int etherStatsCRCAlignErrors_get(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ etherStatsCRCAlignErrors_val_ptr);
+ int etherStatsUndersizePkts_get(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ etherStatsUndersizePkts_val_ptr);
+ int etherStatsOversizePkts_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsOversizePkts_val_ptr);
+ int etherStatsFragments_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsFragments_val_ptr);
+ int etherStatsJabbers_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsJabbers_val_ptr);
+ int etherStatsCollisions_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsCollisions_val_ptr);
+ int etherStatsPkts64Octets_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsPkts64Octets_val_ptr);
+ int
+ etherStatsPkts65to127Octets_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsPkts65to127Octets_val_ptr);
+ int
+ etherStatsPkts128to255Octets_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsPkts128to255Octets_val_ptr);
+ int
+ etherStatsPkts256to511Octets_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsPkts256to511Octets_val_ptr);
+ int
+ etherStatsPkts512to1023Octets_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsPkts512to1023Octets_val_ptr);
+ int
+ etherStatsPkts1024to1518Octets_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsPkts1024to1518Octets_val_ptr);
+ int etherStatsOwner_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ char **etherStatsOwner_val_ptr_ptr,
+ size_t
+ *etherStatsOwner_val_ptr_len_ptr);
+ int etherStatsStatus_get(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ etherStatsStatus_val_ptr);
+
+
+ int
+ etherStatsTable_indexes_set_tbl_idx(etherStatsTable_mib_index *
+ tbl_idx,
+ long etherStatsIndex_val);
+ int etherStatsTable_indexes_set(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ long etherStatsIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ETHERSTATSTABLE_DATA_GET_H */
+/** @} */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c
new file mode 100644
index 0000000..27f3a26
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c
@@ -0,0 +1,977 @@
+/*
+ * 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 "etherStatsTable.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 etherStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * RMON-MIB::etherStatsTable is subid 1 of statistics.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.16.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
+ * +-------------+ +==============+
+ * | 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
+ * etherStatsTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * etherStatsTable_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 (etherStatsTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+etherStatsTable_undo_setup(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup etherStatsTable undo.
+ * set up etherStatsTable undo information, in preparation for a set.
+ * Undo storage is in (* etherStatsStatus_val_ptr )*
+ */
+
+ return rc;
+} /* etherStatsTable_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 (etherStatsTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+etherStatsTable_undo(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> etherStatsTable undo.
+ * etherStatsTable undo information, in response to a failed set.
+ * Undo storage is in (* etherStatsStatus_val_ptr )*
+ */
+
+ return rc;
+} /* etherStatsTable_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 (etherStatsTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+etherStatsTable_undo_cleanup(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_undo_cleanup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup etherStatsTable undo.
+ * Undo storage is in (* etherStatsStatus_val_ptr )*
+ */
+
+ return rc;
+} /* etherStatsTable_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
+ * etherStatsTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param etherStatsTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+etherStatsTable_commit(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_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 etherStatsTable 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_ETHERSTATSDATASOURCE_FLAG) {
+ save_flags &= ~COLUMN_ETHERSTATSDATASOURCE_FLAG; /* clear etherStatsDataSource */
+ /*
+ * TODO:482:o: |-> commit column etherStatsDataSource.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "etherStatsTable column etherStatsDataSource commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo etherStatsDataSource
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_ETHERSTATSDATASOURCE_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_ETHERSTATSOWNER_FLAG) {
+ save_flags &= ~COLUMN_ETHERSTATSOWNER_FLAG; /* clear etherStatsOwner */
+ /*
+ * TODO:482:o: |-> commit column etherStatsOwner.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "etherStatsTable column etherStatsOwner commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo etherStatsOwner
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSOWNER_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_ETHERSTATSSTATUS_FLAG) {
+ save_flags &= ~COLUMN_ETHERSTATSSTATUS_FLAG; /* clear etherStatsStatus */
+ /*
+ * TODO:482:o: |-> commit column etherStatsStatus.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "etherStatsTable column etherStatsStatus commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo etherStatsStatus
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSSTATUS_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;
+} /* etherStatsTable_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
+ * etherStatsTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param etherStatsTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+etherStatsTable_undo_commit(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo etherStatsTable 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;
+} /* etherStatsTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement etherStatsTable node value checks.
+ * TODO:450:M: Implement etherStatsTable undo functions.
+ * TODO:460:M: Implement etherStatsTable set functions.
+ * TODO:480:M: Implement etherStatsTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsDataSource
+ * etherStatsDataSource is subid 2 of etherStatsEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.16.1.1.1.2
+ * Description:
+This object identifies the source of the data that
+ this etherStats entry is configured to analyze. This
+ source can be any ethernet interface on this device.
+ In order to identify a particular interface, this object
+ shall identify the instance of the ifIndex object,
+ defined in RFC 2233 [17], for the desired interface.
+ For example, if an entry were to receive data from
+ interface #1, this object would be set to ifIndex.1.
+
+ The statistics in this group reflect all packets
+ on the local network segment attached to the identified
+ interface.
+
+ An agent may or may not be able to tell if fundamental
+ changes to the media of the interface have occurred and
+ necessitate an invalidation of this entry. For example, a
+ hot-pluggable ethernet card could be pulled out and replaced
+ by a token-ring card. In such a case, if the agent has such
+ knowledge of the change, it is recommended that it
+ invalidate this entry.
+
+ This object may not be modified if the associated
+ etherStatsStatus object is equal to valid(1).
+ *
+ * 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.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsDataSource_val_ptr
+ * A oid containing the new value.
+ * @param etherStatsDataSource_val_ptr_len
+ * The size (in bytes) of the data pointed to by etherStatsDataSource_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
+ * etherStatsTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OBJECT_ID
+ * The length is < sizeof(rowreq_ctx->data.etherStatsDataSource).
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+etherStatsDataSource_check_value(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ oid * etherStatsDataSource_val_ptr,
+ size_t etherStatsDataSource_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != etherStatsDataSource_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid etherStatsDataSource value.
+ */
+
+ return MFD_SUCCESS; /* etherStatsDataSource value not illegal */
+} /* etherStatsDataSource_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (etherStatsTable_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
+ * etherStatsTable_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
+etherStatsDataSource_undo_setup(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup etherStatsDataSource undo.
+ */
+ /*
+ * copy etherStatsDataSource and etherStatsDataSource_len data
+ * set rowreq_ctx->undo->etherStatsDataSource from rowreq_ctx->data.etherStatsDataSource
+ */
+ memcpy(rowreq_ctx->undo->etherStatsDataSource,
+ rowreq_ctx->data.etherStatsDataSource,
+ (rowreq_ctx->data.etherStatsDataSource_len *
+ sizeof(rowreq_ctx->undo->etherStatsDataSource[0])));
+ rowreq_ctx->undo->etherStatsDataSource_len =
+ rowreq_ctx->data.etherStatsDataSource_len;
+
+
+ return MFD_SUCCESS;
+} /* etherStatsDataSource_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 etherStatsDataSource_val_ptr
+ * A oid containing the new value.
+ * @param etherStatsDataSource_val_ptr_len
+ * The size (in bytes) of the data pointed to by etherStatsDataSource_val_ptr
+ */
+int
+etherStatsDataSource_set(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ oid * etherStatsDataSource_val_ptr,
+ size_t etherStatsDataSource_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != etherStatsDataSource_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set etherStatsDataSource value.
+ * set etherStatsDataSource value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data.etherStatsDataSource,
+ etherStatsDataSource_val_ptr, etherStatsDataSource_val_ptr_len);
+ /** convert bytes to number of oid */
+ rowreq_ctx->data.etherStatsDataSource_len =
+ etherStatsDataSource_val_ptr_len /
+ sizeof(etherStatsDataSource_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* etherStatsDataSource_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+etherStatsDataSource_undo(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up etherStatsDataSource undo.
+ */
+ /*
+ * copy etherStatsDataSource and etherStatsDataSource_len data
+ * set rowreq_ctx->data.etherStatsDataSource from rowreq_ctx->undo->etherStatsDataSource
+ */
+ memcpy(rowreq_ctx->data.etherStatsDataSource,
+ rowreq_ctx->undo->etherStatsDataSource,
+ (rowreq_ctx->undo->etherStatsDataSource_len *
+ sizeof(rowreq_ctx->data.etherStatsDataSource[0])));
+ rowreq_ctx->data.etherStatsDataSource_len =
+ rowreq_ctx->undo->etherStatsDataSource_len;
+
+
+ return MFD_SUCCESS;
+} /* etherStatsDataSource_undo */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsOwner
+ * etherStatsOwner is subid 20 of etherStatsEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.16.1.1.1.20
+ * Description:
+The entity that configured this entry and is therefore
+ using the resources assigned to it.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 127;
+ *
+ * Its syntax is OwnerString (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 127)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param etherStatsOwner_val_ptr
+ * A char containing the new value.
+ * @param etherStatsOwner_val_ptr_len
+ * The size (in bytes) of the data pointed to by etherStatsOwner_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
+ * etherStatsTable_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.etherStatsOwner).
+ * The length is in (one of) the range set(s): 0 - 127
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+etherStatsOwner_check_value(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ char *etherStatsOwner_val_ptr,
+ size_t etherStatsOwner_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != etherStatsOwner_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid etherStatsOwner value.
+ */
+
+ return MFD_SUCCESS; /* etherStatsOwner value not illegal */
+} /* etherStatsOwner_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (etherStatsTable_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
+ * etherStatsTable_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
+etherStatsOwner_undo_setup(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup etherStatsOwner undo.
+ */
+ /*
+ * copy etherStatsOwner and etherStatsOwner_len data
+ * set rowreq_ctx->undo->etherStatsOwner from rowreq_ctx->data.etherStatsOwner
+ */
+ memcpy(rowreq_ctx->undo->etherStatsOwner,
+ rowreq_ctx->data.etherStatsOwner,
+ (rowreq_ctx->data.etherStatsOwner_len *
+ sizeof(rowreq_ctx->undo->etherStatsOwner[0])));
+ rowreq_ctx->undo->etherStatsOwner_len =
+ rowreq_ctx->data.etherStatsOwner_len;
+
+
+ return MFD_SUCCESS;
+} /* etherStatsOwner_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 etherStatsOwner_val_ptr
+ * A char containing the new value.
+ * @param etherStatsOwner_val_ptr_len
+ * The size (in bytes) of the data pointed to by etherStatsOwner_val_ptr
+ */
+int
+etherStatsOwner_set(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ char *etherStatsOwner_val_ptr,
+ size_t etherStatsOwner_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != etherStatsOwner_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set etherStatsOwner value.
+ * set etherStatsOwner value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data.etherStatsOwner, etherStatsOwner_val_ptr,
+ etherStatsOwner_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data.etherStatsOwner_len =
+ etherStatsOwner_val_ptr_len / sizeof(etherStatsOwner_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* etherStatsOwner_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+etherStatsOwner_undo(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up etherStatsOwner undo.
+ */
+ /*
+ * copy etherStatsOwner and etherStatsOwner_len data
+ * set rowreq_ctx->data.etherStatsOwner from rowreq_ctx->undo->etherStatsOwner
+ */
+ memcpy(rowreq_ctx->data.etherStatsOwner,
+ rowreq_ctx->undo->etherStatsOwner,
+ (rowreq_ctx->undo->etherStatsOwner_len *
+ sizeof(rowreq_ctx->data.etherStatsOwner[0])));
+ rowreq_ctx->data.etherStatsOwner_len =
+ rowreq_ctx->undo->etherStatsOwner_len;
+
+
+ return MFD_SUCCESS;
+} /* etherStatsOwner_undo */
+
+/*---------------------------------------------------------------------
+ * RMON-MIB::etherStatsEntry.etherStatsStatus
+ * etherStatsStatus is subid 21 of etherStatsEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.16.1.1.1.21
+ * Description:
+The status of this etherStats entry.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: valid(1), createRequest(2), underCreation(3), invalid(4)
+ *
+ * Its syntax is EntryStatus (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 etherStatsStatus_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
+ * etherStatsTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of valid(1), createRequest(2), underCreation(3), invalid(4)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+etherStatsStatus_check_value(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long etherStatsStatus_val)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid etherStatsStatus value.
+ */
+
+ return MFD_SUCCESS; /* etherStatsStatus value not illegal */
+} /* etherStatsStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (etherStatsTable_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
+ * etherStatsTable_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
+etherStatsStatus_undo_setup(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup etherStatsStatus undo.
+ */
+ /*
+ * copy etherStatsStatus data
+ * set rowreq_ctx->undo->etherStatsStatus from rowreq_ctx->data.etherStatsStatus
+ */
+ rowreq_ctx->undo->etherStatsStatus = rowreq_ctx->data.etherStatsStatus;
+
+
+ return MFD_SUCCESS;
+} /* etherStatsStatus_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 etherStatsStatus_val
+ * A long containing the new value.
+ */
+int
+etherStatsStatus_set(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long etherStatsStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set etherStatsStatus value.
+ * set etherStatsStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.etherStatsStatus = etherStatsStatus_val;
+
+ return MFD_SUCCESS;
+} /* etherStatsStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+etherStatsStatus_undo(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up etherStatsStatus undo.
+ */
+ /*
+ * copy etherStatsStatus data
+ * set rowreq_ctx->data.etherStatsStatus from rowreq_ctx->undo->etherStatsStatus
+ */
+ rowreq_ctx->data.etherStatsStatus = rowreq_ctx->undo->etherStatsStatus;
+
+
+ return MFD_SUCCESS;
+} /* etherStatsStatus_undo */
+
+/** @} */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h
new file mode 100644
index 0000000..258e087
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h
@@ -0,0 +1,356 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef ETHERSTATSTABLE_DATA_SET_H
+#define ETHERSTATSTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table etherStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * RMON-MIB::etherStatsTable is subid 1 of statistics.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.16.1.1, length: 9
+ */
+
+
+ int etherStatsTable_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsTable_undo_cleanup(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+ int etherStatsTable_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsTable_commit(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsTable_undo_commit(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+ etherStatsDataSource_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ oid *
+ etherStatsDataSource_val_ptr,
+ size_t
+ etherStatsDataSource_val_ptr_len);
+ int
+ etherStatsDataSource_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsDataSource_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ oid *
+ etherStatsDataSource_val_ptr,
+ size_t
+ etherStatsDataSource_val_ptr_len);
+ int etherStatsDataSource_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsDropEvents_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long etherStatsDropEvents_val);
+ int
+ etherStatsDropEvents_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsDropEvents_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsDropEvents_val);
+ int etherStatsDropEvents_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int etherStatsOctets_check_value(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ etherStatsOctets_val);
+ int etherStatsOctets_undo_setup(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+ int etherStatsOctets_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long etherStatsOctets_val);
+ int etherStatsOctets_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int etherStatsPkts_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long etherStatsPkts_val);
+ int etherStatsPkts_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsPkts_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long etherStatsPkts_val);
+ int etherStatsPkts_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsBroadcastPkts_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsBroadcastPkts_val);
+ int
+ etherStatsBroadcastPkts_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsBroadcastPkts_set(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ etherStatsBroadcastPkts_val);
+ int etherStatsBroadcastPkts_undo(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ etherStatsMulticastPkts_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsMulticastPkts_val);
+ int
+ etherStatsMulticastPkts_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsMulticastPkts_set(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ etherStatsMulticastPkts_val);
+ int etherStatsMulticastPkts_undo(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ etherStatsCRCAlignErrors_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsCRCAlignErrors_val);
+ int
+ etherStatsCRCAlignErrors_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsCRCAlignErrors_set(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ etherStatsCRCAlignErrors_val);
+ int
+ etherStatsCRCAlignErrors_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsUndersizePkts_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsUndersizePkts_val);
+ int
+ etherStatsUndersizePkts_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsUndersizePkts_set(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ etherStatsUndersizePkts_val);
+ int etherStatsUndersizePkts_undo(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ etherStatsOversizePkts_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsOversizePkts_val);
+ int
+ etherStatsOversizePkts_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsOversizePkts_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsOversizePkts_val);
+ int etherStatsOversizePkts_undo(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ etherStatsFragments_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long etherStatsFragments_val);
+ int
+ etherStatsFragments_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsFragments_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsFragments_val);
+ int etherStatsFragments_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsJabbers_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long etherStatsJabbers_val);
+ int etherStatsJabbers_undo_setup(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+ int etherStatsJabbers_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long etherStatsJabbers_val);
+ int etherStatsJabbers_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsCollisions_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long etherStatsCollisions_val);
+ int
+ etherStatsCollisions_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsCollisions_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsCollisions_val);
+ int etherStatsCollisions_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsPkts64Octets_check_value(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsPkts64Octets_val);
+ int
+ etherStatsPkts64Octets_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsPkts64Octets_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsPkts64Octets_val);
+ int etherStatsPkts64Octets_undo(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ etherStatsPkts65to127Octets_check_value(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ etherStatsPkts65to127Octets_val);
+ int
+ etherStatsPkts65to127Octets_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ etherStatsPkts65to127Octets_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsPkts65to127Octets_val);
+ int
+ etherStatsPkts65to127Octets_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsPkts128to255Octets_check_value(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ etherStatsPkts128to255Octets_val);
+ int
+ etherStatsPkts128to255Octets_undo_setup(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ etherStatsPkts128to255Octets_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsPkts128to255Octets_val);
+ int
+ etherStatsPkts128to255Octets_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsPkts256to511Octets_check_value(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ etherStatsPkts256to511Octets_val);
+ int
+ etherStatsPkts256to511Octets_undo_setup(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ etherStatsPkts256to511Octets_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsPkts256to511Octets_val);
+ int
+ etherStatsPkts256to511Octets_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsPkts512to1023Octets_check_value
+ (etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long etherStatsPkts512to1023Octets_val);
+ int
+ etherStatsPkts512to1023Octets_undo_setup(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ etherStatsPkts512to1023Octets_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsPkts512to1023Octets_val);
+ int
+ etherStatsPkts512to1023Octets_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ etherStatsPkts1024to1518Octets_check_value
+ (etherStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long etherStatsPkts1024to1518Octets_val);
+ int
+ etherStatsPkts1024to1518Octets_undo_setup
+ (etherStatsTable_rowreq_ctx * rowreq_ctx);
+ int
+ etherStatsPkts1024to1518Octets_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ etherStatsPkts1024to1518Octets_val);
+ int
+ etherStatsPkts1024to1518Octets_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int etherStatsOwner_check_value(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *etherStatsOwner_val_ptr,
+ size_t
+ etherStatsOwner_val_ptr_len);
+ int etherStatsOwner_undo_setup(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+ int etherStatsOwner_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ char *etherStatsOwner_val_ptr,
+ size_t
+ etherStatsOwner_val_ptr_len);
+ int etherStatsOwner_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int etherStatsStatus_check_value(etherStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ etherStatsStatus_val);
+ int etherStatsStatus_undo_setup(etherStatsTable_rowreq_ctx
+ * rowreq_ctx);
+ int etherStatsStatus_set(etherStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long etherStatsStatus_val);
+ int etherStatsStatus_undo(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ etherStatsTable_check_dependencies(etherStatsTable_rowreq_ctx *
+ ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ETHERSTATSTABLE_DATA_SET_H */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h
new file mode 100644
index 0000000..a13c0b7
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h
@@ -0,0 +1,57 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef ETHERSTATSTABLE_ENUMS_H
+#define ETHERSTATSTABLE_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 etherStatsTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * etherStatsStatus (EntryStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ENTRYSTATUS_ENUMS
+#define ENTRYSTATUS_ENUMS
+
+#define ENTRYSTATUS_VALID 1
+#define ENTRYSTATUS_CREATEREQUEST 2
+#define ENTRYSTATUS_UNDERCREATION 3
+#define ENTRYSTATUS_INVALID 4
+
+#endif /* ENTRYSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ETHERSTATSTABLE_ENUMS_H */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c
new file mode 100644
index 0000000..221c608
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c
@@ -0,0 +1,2232 @@
+/*
+ * 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "etherStatsTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "etherStatsTable_interface.h"
+
+#include <ctype.h>
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(table_container_row_insert)
+netsnmp_feature_require(check_all_requests_error)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table etherStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * RMON-MIB::etherStatsTable is subid 1 of statistics.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.16.1.1, length: 9
+ */
+typedef struct etherStatsTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ etherStatsTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} etherStatsTable_interface_ctx;
+
+static etherStatsTable_interface_ctx etherStatsTable_if_ctx;
+
+static void
+_etherStatsTable_container_init(etherStatsTable_interface_ctx * if_ctx);
+static void
+_etherStatsTable_container_shutdown(etherStatsTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+etherStatsTable_container_get(void)
+{
+ return etherStatsTable_if_ctx.container;
+}
+
+etherStatsTable_registration *
+etherStatsTable_registration_get(void)
+{
+ return etherStatsTable_if_ctx.user_ctx;
+}
+
+etherStatsTable_registration *
+etherStatsTable_registration_set(etherStatsTable_registration * newreg)
+{
+ etherStatsTable_registration *old = etherStatsTable_if_ctx.user_ctx;
+ etherStatsTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+etherStatsTable_container_size(void)
+{
+ return CONTAINER_SIZE(etherStatsTable_if_ctx.container);
+}
+
+u_int
+etherStatsTable_dirty_get(void)
+{
+ return etherStatsTable_if_ctx.table_dirty;
+}
+
+void
+etherStatsTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("etherStatsTable:etherStatsTable_dirty_set",
+ "called. was %d, now %d\n",
+ etherStatsTable_if_ctx.table_dirty, status));
+ etherStatsTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_etherStatsTable_pre_request;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_post_request;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_get_values;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_check_objects;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_set_values;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_undo_values;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_commit;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_etherStatsTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_etherStatsTable_undo_column(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column);
+
+NETSNMP_STATIC_INLINE int
+_etherStatsTable_check_indexes(etherStatsTable_rowreq_ctx * rowreq_ctx);
+
+etherStatsTable_data *etherStatsTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table etherStatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+_etherStatsTable_initialize_interface(etherStatsTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &etherStatsTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &etherStatsTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for etherStatsTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: etherStatsIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrieval.
+ */
+ tbl_info->min_column = ETHERSTATSTABLE_MIN_COL;
+ tbl_info->max_column = ETHERSTATSTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ etherStatsTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ etherStatsTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _etherStatsTable_container_init(&etherStatsTable_if_ctx);
+ if (NULL == etherStatsTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for etherStatsTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_etherStatsTable_object_lookup;
+ access_multiplexer->get_values = _mfd_etherStatsTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_etherStatsTable_pre_request;
+ access_multiplexer->post_request = _mfd_etherStatsTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_etherStatsTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_etherStatsTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_etherStatsTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_etherStatsTable_set_values;
+ access_multiplexer->undo_sets = _mfd_etherStatsTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_etherStatsTable_commit;
+ access_multiplexer->undo_commit = _mfd_etherStatsTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_etherStatsTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("etherStatsTable:init_etherStatsTable",
+ "Registering etherStatsTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("etherStatsTable", handler,
+ etherStatsTable_oid,
+ etherStatsTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table etherStatsTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &etherStatsTable_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,
+ etherStatsTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != etherStatsTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(etherStatsTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _etherStatsTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table etherStatsTable
+ */
+void
+_etherStatsTable_shutdown_interface(etherStatsTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _etherStatsTable_container_shutdown(&etherStatsTable_if_ctx);
+}
+
+void
+etherStatsTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ etherStatsTable_if_ctx.tbl_info.valid_columns = vc;
+} /* etherStatsTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+etherStatsTable_index_to_oid(netsnmp_index * oid_idx,
+ etherStatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_etherStatsIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_etherStatsIndex, 0x00, sizeof(var_etherStatsIndex));
+ var_etherStatsIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_etherStatsIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_etherStatsIndex,
+ (u_char *) & mib_idx->etherStatsIndex,
+ sizeof(mib_idx->etherStatsIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_etherStatsIndex);
+ 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_etherStatsIndex);
+
+ return err;
+} /* etherStatsTable_index_to_oid */
+
+/**
+ * extract etherStatsTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+etherStatsTable_index_from_oid(netsnmp_index * oid_idx,
+ etherStatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_etherStatsIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_etherStatsIndex, 0x00, sizeof(var_etherStatsIndex));
+ var_etherStatsIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_etherStatsIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_etherStatsIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->etherStatsIndex =
+ *((long *) var_etherStatsIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_etherStatsIndex);
+
+ return err;
+} /* etherStatsTable_index_from_oid */
+
+
+/*
+ * etherStatsTable_allocate_data
+ *
+ * Purpose: create new etherStatsTable_data.
+ */
+etherStatsTable_data *
+etherStatsTable_allocate_data(void)
+{
+ etherStatsTable_data *rtn = SNMP_MALLOC_TYPEDEF(etherStatsTable_data);
+
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_allocate_data",
+ "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "etherStatsTable_data.\n");
+ }
+
+ return rtn;
+} /* etherStatsTable_allocate_data */
+
+/*
+ * etherStatsTable_release_data
+ *
+ * Purpose: release etherStatsTable data.
+ */
+void
+etherStatsTable_release_data(etherStatsTable_data * data)
+{
+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_release_data",
+ "called\n"));
+
+ free(data);
+} /* etherStatsTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a etherStatsTable_rowreq_ctx
+ */
+etherStatsTable_rowreq_ctx *
+etherStatsTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(etherStatsTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:etherStatsTable:etherStatsTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "etherStatsTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->etherStatsTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ etherStatsTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ etherStatsTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* etherStatsTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a etherStatsTable_rowreq_ctx
+ */
+void
+etherStatsTable_release_rowreq_ctx(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:etherStatsTable:etherStatsTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ etherStatsTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ etherStatsTable_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);
+} /* etherStatsTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_etherStatsTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:etherStatsTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = etherStatsTable_pre_request(etherStatsTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("etherStatsTable", "error %d from "
+ "etherStatsTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_etherStatsTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_etherStatsTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ etherStatsTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:etherStatsTable",
+ "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) && etherStatsTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "etherStatsTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = etherStatsTable_post_request(etherStatsTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("etherStatsTable", "error %d from "
+ "etherStatsTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_etherStatsTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static etherStatsTable_rowreq_ctx *
+_mfd_etherStatsTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ etherStatsTable_rowreq_ctx *rowreq_ctx;
+ etherStatsTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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 = etherStatsTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("etherStatsTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = etherStatsTable_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 = _etherStatsTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ etherStatsTable_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_etherStatsTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_etherStatsTable_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;
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * etherStatsTable_interface_ctx *if_ctx =
+ * (etherStatsTable_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_etherStatsTable_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
+ etherStatsTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_etherStatsTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_etherStatsTable_get_column(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_ETHERSTATSINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.etherStatsIndex;
+ break;
+
+ /*
+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSDATASOURCE:
+ if (!
+ (COLUMN_ETHERSTATSDATASOURCE_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsDataSource) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OBJECT_ID;
+ rc = etherStatsDataSource_get(rowreq_ctx,
+ (oid **) & var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * etherStatsDropEvents(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSDROPEVENTS:
+ if (!
+ (COLUMN_ETHERSTATSDROPEVENTS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsDropEvents) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsDropEvents_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsOctets(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSOCTETS:
+ if (!
+ (COLUMN_ETHERSTATSOCTETS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsOctets) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsOctets_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS:
+ if (!
+ (COLUMN_ETHERSTATSPKTS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsPkts_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsBroadcastPkts(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSBROADCASTPKTS:
+ if (!
+ (COLUMN_ETHERSTATSBROADCASTPKTS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsBroadcastPkts) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsBroadcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsMulticastPkts(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSMULTICASTPKTS:
+ if (!
+ (COLUMN_ETHERSTATSMULTICASTPKTS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsMulticastPkts) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsMulticastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsCRCAlignErrors(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSCRCALIGNERRORS:
+ if (!
+ (COLUMN_ETHERSTATSCRCALIGNERRORS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsCRCAlignErrors) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsCRCAlignErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsUndersizePkts(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSUNDERSIZEPKTS:
+ if (!
+ (COLUMN_ETHERSTATSUNDERSIZEPKTS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsUndersizePkts) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsUndersizePkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsOversizePkts(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSOVERSIZEPKTS:
+ if (!
+ (COLUMN_ETHERSTATSOVERSIZEPKTS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsOversizePkts) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsOversizePkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsFragments(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSFRAGMENTS:
+ if (!
+ (COLUMN_ETHERSTATSFRAGMENTS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsFragments) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsFragments_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsJabbers(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSJABBERS:
+ if (!
+ (COLUMN_ETHERSTATSJABBERS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsJabbers) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsJabbers_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsCollisions(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSCOLLISIONS:
+ if (!
+ (COLUMN_ETHERSTATSCOLLISIONS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsCollisions) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsCollisions_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsPkts64Octets(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS64OCTETS:
+ if (!
+ (COLUMN_ETHERSTATSPKTS64OCTETS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts64Octets) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsPkts64Octets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsPkts65to127Octets(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS65TO127OCTETS:
+ if (!
+ (COLUMN_ETHERSTATSPKTS65TO127OCTETS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts65to127Octets) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsPkts65to127Octets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsPkts128to255Octets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS128TO255OCTETS:
+ if (!
+ (COLUMN_ETHERSTATSPKTS128TO255OCTETS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts128to255Octets) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsPkts128to255Octets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsPkts256to511Octets(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS256TO511OCTETS:
+ if (!
+ (COLUMN_ETHERSTATSPKTS256TO511OCTETS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts256to511Octets) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsPkts256to511Octets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsPkts512to1023Octets(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS512TO1023OCTETS:
+ if (!
+ (COLUMN_ETHERSTATSPKTS512TO1023OCTETS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts512to1023Octets) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsPkts512to1023Octets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * etherStatsPkts1024to1518Octets(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS1024TO1518OCTETS:
+ if (!
+ (COLUMN_ETHERSTATSPKTS1024TO1518OCTETS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts1024to1518Octets) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = etherStatsPkts1024to1518Octets_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ETHERSTATSOWNER:
+ if (!
+ (COLUMN_ETHERSTATSOWNER_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsOwner) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+ rc = etherStatsOwner_get(rowreq_ctx, (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_ETHERSTATSSTATUS:
+ if (!
+ (COLUMN_ETHERSTATSSTATUS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = etherStatsStatus_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ default:
+ if (ETHERSTATSTABLE_MIN_COL <= column
+ && column <= ETHERSTATSTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _etherStatsTable_get_column.\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _etherStatsTable_get_column */
+
+int
+_mfd_etherStatsTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ etherStatsTable_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:etherStatsTable:_mfd_etherStatsTable_get_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:etherStatsTable:_mfd_etherStatsTable_get_values",
+ "exists %u\n", 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 = _etherStatsTable_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_etherStatsTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_etherStatsTable_check_indexes(etherStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_check_indexes",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) etherStatsIndex(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.etherStatsIndex < 1)
+ || (rowreq_ctx->tbl_idx.etherStatsIndex > 65535))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = etherStatsIndex_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return etherStatsTable_validate_index(etherStatsTable_if_ctx.user_ctx,
+ rowreq_ctx);
+} /* _etherStatsTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_etherStatsTable_check_column(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_ETHERSTATSINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSDATASOURCE:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OBJECT_ID,
+ sizeof(rowreq_ctx->data.
+ etherStatsDataSource));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("etherStatsTable:_etherStatsTable_check_column:etherStatsDataSource", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = etherStatsDataSource_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 etherStatsDataSource_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * etherStatsDropEvents(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSDROPEVENTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsOctets(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSOCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsBroadcastPkts(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSBROADCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsMulticastPkts(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSMULTICASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsCRCAlignErrors(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSCRCALIGNERRORS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsUndersizePkts(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSUNDERSIZEPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsOversizePkts(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSOVERSIZEPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsFragments(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSFRAGMENTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsJabbers(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSJABBERS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsCollisions(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSCOLLISIONS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsPkts64Octets(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS64OCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsPkts65to127Octets(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS65TO127OCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsPkts128to255Octets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS128TO255OCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsPkts256to511Octets(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS256TO511OCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsPkts512to1023Octets(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS512TO1023OCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsPkts1024to1518Octets(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSPKTS1024TO1518OCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ETHERSTATSOWNER:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data.
+ etherStatsOwner));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 127))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("etherStatsTable:_etherStatsTable_check_column:etherStatsOwner", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = etherStatsOwner_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 etherStatsOwner_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_ETHERSTATSSTATUS:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ etherStatsStatus));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != ENTRYSTATUS_VALID)
+ && (*var->val.integer != ENTRYSTATUS_CREATEREQUEST)
+ && (*var->val.integer != ENTRYSTATUS_UNDERCREATION)
+ && (*var->val.integer != ENTRYSTATUS_INVALID)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("etherStatsTable:_etherStatsTable_check_column:etherStatsStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = etherStatsStatus_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 etherStatsStatus_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 _etherStatsTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _etherStatsTable_check_column */
+
+int
+_mfd_etherStatsTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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 = _etherStatsTable_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_etherStatsTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_etherStatsTable_undo_setup_column(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSDATASOURCE:
+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSDATASOURCE_FLAG;
+ rc = etherStatsDataSource_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ETHERSTATSOWNER:
+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSOWNER_FLAG;
+ rc = etherStatsOwner_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_ETHERSTATSSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSSTATUS_FLAG;
+ rc = etherStatsStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _etherStatsTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _etherStatsTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_etherStatsTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_undo_setup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = etherStatsTable_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 = etherStatsTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from "
+ "etherStatsTable_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 = _etherStatsTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from "
+ "etherStatsTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_etherStatsTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_etherStatsTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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 = etherStatsTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from "
+ "etherStatsTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ etherStatsTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_etherStatsTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_etherStatsTable_set_column(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSDATASOURCE:
+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSDATASOURCE_FLAG;
+ rc = etherStatsDataSource_set(rowreq_ctx, (oid *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ETHERSTATSOWNER:
+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSOWNER_FLAG;
+ rc = etherStatsOwner_set(rowreq_ctx, (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_ETHERSTATSSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSSTATUS_FLAG;
+ rc = etherStatsStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _etherStatsTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _etherStatsTable_set_column */
+
+int
+_mfd_etherStatsTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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 = _etherStatsTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from "
+ "etherStatsTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_etherStatsTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_etherStatsTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = etherStatsTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from "
+ "etherStatsTable_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...
+ */
+ etherStatsTable_dirty_set(etherStatsTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_etherStatsTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = etherStatsTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ etherStatsTable_dirty_set(d - 1);
+ }
+
+ rc = etherStatsTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from "
+ "etherStatsTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "etherStatsTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_etherStatsTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_etherStatsTable_undo_column(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_ETHERSTATSDATASOURCE:
+ rc = etherStatsDataSource_undo(rowreq_ctx);
+ break;
+
+ /*
+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ETHERSTATSOWNER:
+ rc = etherStatsOwner_undo(rowreq_ctx);
+ break;
+
+ /*
+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_ETHERSTATSSTATUS:
+ rc = etherStatsStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _etherStatsTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _etherStatsTable_undo_column */
+
+int
+_mfd_etherStatsTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = etherStatsTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from "
+ "etherStatsTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _etherStatsTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from "
+ "etherStatsTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_etherStatsTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_etherStatsTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ etherStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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(etherStatsTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_irreversible_commit", "updating exists (%#x) w/set (%#x) = %#x\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(etherStatsTable_if_ctx.container, rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_etherStatsTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:etherStatsTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for etherStatsTable_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 etherStatsTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:etherStatsTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in etherStatsTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(etherStatsTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:etherStatsTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ etherStatsTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:etherStatsTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in etherStatsTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ etherStatsTable_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
+_etherStatsTable_container_init(etherStatsTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_container_init",
+ "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ etherStatsTable_oid,
+ etherStatsTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for etherStatsTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ etherStatsTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("etherStatsTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "etherStatsTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _etherStatsTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_etherStatsTable_container_shutdown(etherStatsTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_container_shutdown", "called\n"));
+
+ etherStatsTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _etherStatsTable_container_shutdown */
+
+
+etherStatsTable_rowreq_ctx *
+etherStatsTable_row_find_by_mib_index(etherStatsTable_mib_index * mib_idx)
+{
+ etherStatsTable_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 = etherStatsTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(etherStatsTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h
new file mode 100644
index 0000000..4e1457b
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_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 ETHERSTATSTABLE_INTERFACE_H
+#define ETHERSTATSTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "etherStatsTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _etherStatsTable_initialize_interface(etherStatsTable_registration
+ * user_ctx, u_long flags);
+ void
+ _etherStatsTable_shutdown_interface(etherStatsTable_registration *
+ user_ctx);
+
+ etherStatsTable_registration *etherStatsTable_registration_get(void);
+
+ etherStatsTable_registration
+ *etherStatsTable_registration_set(etherStatsTable_registration *
+ newreg);
+
+ netsnmp_container *etherStatsTable_container_get(void);
+ int etherStatsTable_container_size(void);
+
+ u_int etherStatsTable_dirty_get(void);
+ void etherStatsTable_dirty_set(u_int status);
+
+ etherStatsTable_rowreq_ctx *etherStatsTable_allocate_rowreq_ctx(void
+ *);
+ void
+ etherStatsTable_release_rowreq_ctx(etherStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int etherStatsTable_index_to_oid(netsnmp_index * oid_idx,
+ etherStatsTable_mib_index
+ * mib_idx);
+ int etherStatsTable_index_from_oid(netsnmp_index * oid_idx,
+ etherStatsTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void etherStatsTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ETHERSTATSTABLE_INTERFACE_H */
+/** @} */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h
new file mode 100644
index 0000000..60f1da3
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h
@@ -0,0 +1,107 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef ETHERSTATSTABLE_OIDS_H
+#define ETHERSTATSTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table etherStatsTable
+ */
+#define ETHERSTATSTABLE_OID 1,3,6,1,2,1,16,1,1
+
+#define COLUMN_ETHERSTATSINDEX 1
+#define COLUMN_ETHERSTATSINDEX_FLAG (0x1 << 0)
+
+#define COLUMN_ETHERSTATSDATASOURCE 2
+#define COLUMN_ETHERSTATSDATASOURCE_FLAG (0x1 << 1)
+
+#define COLUMN_ETHERSTATSDROPEVENTS 3
+#define COLUMN_ETHERSTATSDROPEVENTS_FLAG (0x1 << 2)
+
+#define COLUMN_ETHERSTATSOCTETS 4
+#define COLUMN_ETHERSTATSOCTETS_FLAG (0x1 << 3)
+
+#define COLUMN_ETHERSTATSPKTS 5
+#define COLUMN_ETHERSTATSPKTS_FLAG (0x1 << 4)
+
+#define COLUMN_ETHERSTATSBROADCASTPKTS 6
+#define COLUMN_ETHERSTATSBROADCASTPKTS_FLAG (0x1 << 5)
+
+#define COLUMN_ETHERSTATSMULTICASTPKTS 7
+#define COLUMN_ETHERSTATSMULTICASTPKTS_FLAG (0x1 << 6)
+
+#define COLUMN_ETHERSTATSCRCALIGNERRORS 8
+#define COLUMN_ETHERSTATSCRCALIGNERRORS_FLAG (0x1 << 7)
+
+#define COLUMN_ETHERSTATSUNDERSIZEPKTS 9
+#define COLUMN_ETHERSTATSUNDERSIZEPKTS_FLAG (0x1 << 8)
+
+#define COLUMN_ETHERSTATSOVERSIZEPKTS 10
+#define COLUMN_ETHERSTATSOVERSIZEPKTS_FLAG (0x1 << 9)
+
+#define COLUMN_ETHERSTATSFRAGMENTS 11
+#define COLUMN_ETHERSTATSFRAGMENTS_FLAG (0x1 << 10)
+
+#define COLUMN_ETHERSTATSJABBERS 12
+#define COLUMN_ETHERSTATSJABBERS_FLAG (0x1 << 11)
+
+#define COLUMN_ETHERSTATSCOLLISIONS 13
+#define COLUMN_ETHERSTATSCOLLISIONS_FLAG (0x1 << 12)
+
+#define COLUMN_ETHERSTATSPKTS64OCTETS 14
+#define COLUMN_ETHERSTATSPKTS64OCTETS_FLAG (0x1 << 13)
+
+#define COLUMN_ETHERSTATSPKTS65TO127OCTETS 15
+#define COLUMN_ETHERSTATSPKTS65TO127OCTETS_FLAG (0x1 << 14)
+
+#define COLUMN_ETHERSTATSPKTS128TO255OCTETS 16
+#define COLUMN_ETHERSTATSPKTS128TO255OCTETS_FLAG (0x1 << 15)
+
+#define COLUMN_ETHERSTATSPKTS256TO511OCTETS 17
+#define COLUMN_ETHERSTATSPKTS256TO511OCTETS_FLAG (0x1 << 16)
+
+#define COLUMN_ETHERSTATSPKTS512TO1023OCTETS 18
+#define COLUMN_ETHERSTATSPKTS512TO1023OCTETS_FLAG (0x1 << 17)
+
+#define COLUMN_ETHERSTATSPKTS1024TO1518OCTETS 19
+#define COLUMN_ETHERSTATSPKTS1024TO1518OCTETS_FLAG (0x1 << 18)
+
+#define COLUMN_ETHERSTATSOWNER 20
+#define COLUMN_ETHERSTATSOWNER_FLAG (0x1 << 19)
+
+#define COLUMN_ETHERSTATSSTATUS 21
+#define COLUMN_ETHERSTATSSTATUS_FLAG (0x1 << 20)
+
+
+#define ETHERSTATSTABLE_MIN_COL COLUMN_ETHERSTATSINDEX
+#define ETHERSTATSTABLE_MAX_COL COLUMN_ETHERSTATSSTATUS
+
+
+ /*
+ * TODO:405:r: Review ETHERSTATSTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define ETHERSTATSTABLE_SETTABLE_COLS (COLUMN_ETHERSTATSINDEX_FLAG | COLUMN_ETHERSTATSDATASOURCE_FLAG | COLUMN_ETHERSTATSDROPEVENTS_FLAG | COLUMN_ETHERSTATSOCTETS_FLAG | COLUMN_ETHERSTATSPKTS_FLAG | COLUMN_ETHERSTATSBROADCASTPKTS_FLAG | COLUMN_ETHERSTATSMULTICASTPKTS_FLAG | COLUMN_ETHERSTATSCRCALIGNERRORS_FLAG | COLUMN_ETHERSTATSUNDERSIZEPKTS_FLAG | COLUMN_ETHERSTATSOVERSIZEPKTS_FLAG | COLUMN_ETHERSTATSFRAGMENTS_FLAG | COLUMN_ETHERSTATSJABBERS_FLAG | COLUMN_ETHERSTATSCOLLISIONS_FLAG | COLUMN_ETHERSTATSPKTS64OCTETS_FLAG | COLUMN_ETHERSTATSPKTS65TO127OCTETS_FLAG | COLUMN_ETHERSTATSPKTS128TO255OCTETS_FLAG | COLUMN_ETHERSTATSPKTS256TO511OCTETS_FLAG | COLUMN_ETHERSTATSPKTS512TO1023OCTETS_FLAG | COLUMN_ETHERSTATSPKTS1024TO1518OCTETS_FLAG | COLUMN_ETHERSTATSOWNER_FLAG | COLUMN_ETHERSTATSSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review ETHERSTATSTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define ETHERSTATSTABLE_REQUIRED_COLS (COLUMN_ETHERSTATSDATASOURCE_FLAG | COLUMN_ETHERSTATSOWNER_FLAG | COLUMN_ETHERSTATSSTATUS_FLAG)
+
+#define ETHERSTATSTABLE_VALID_COL COLUMN_ETHERSTATSJABBERS_FLAG
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ETHERSTATSTABLE_OIDS_H */
diff --git a/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h b/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h
new file mode 100644
index 0000000..9819895
--- /dev/null
+++ b/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h
@@ -0,0 +1,35 @@
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <linux/sockios.h>
+#include <ifaddrs.h>
+
+/* use kernel's ethtool.h */
+
+#include <linux/types.h>
+typedef __u64 u64;
+typedef __u32 u32;
+typedef __u16 u16;
+typedef __u8 u8;
+#include <linux/ethtool.h>
+
+/* structure for storing the interface names in the system */
+
+struct ifname {
+ struct ifname *ifn_next;
+ char name [IF_NAMESIZE];
+};
+
+struct ifname *etherstats_interface_name_list_get (struct ifname *, int *);
+int etherstats_interface_name_list_free (struct ifname *list_head);
+int etherstats_interface_ioctl_ifindex_get (int fd, const char *name);
+int _etherStats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name);
+int interface_ioctl_etherstats_get(etherStatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name);
+
+/* for maintainability */
+
+#define BROADCOM_RECEIVE_JABBERS "rx_jabbers"
+
+#define ETHERSTATSJABBERS(x) strstr(x, BROADCOM_RECEIVE_JABBERS)
+
diff --git a/agent/mibgroup/sctp-mib.h b/agent/mibgroup/sctp-mib.h
new file mode 100644
index 0000000..d2844fb
--- /dev/null
+++ b/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/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c b/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c
new file mode 100644
index 0000000..d6023e5
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c
@@ -0,0 +1,296 @@
+/*
+ * 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;
+static netsnmp_table_registration_info *table_info;
+
+/** 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)
+{
+ shutdown_table_sctpAssocLocalAddrTable();
+}
+
+/** 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;
+
+ 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");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ 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);
+}
+
+void
+shutdown_table_sctpAssocLocalAddrTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+ sctpAssocLocalAddrTable_container_clear
+ (sctpAssocLocalAddrTable_container);
+}
+
+/** 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)
+{
+ 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/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h b/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h
new file mode 100644
index 0000000..eff080f
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h
@@ -0,0 +1,61 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c b/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c
new file mode 100644
index 0000000..38ca8a3
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c
@@ -0,0 +1,342 @@
+/*
+ * 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 "sctpAssocRemAddrTable.h"
+
+/*
+ * content of the sctpAssocRemAddrTable
+ */
+static netsnmp_container *sctpAssocRemAddrTable_container;
+static netsnmp_table_registration_info *table_info;
+
+/** 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)
+{
+ shutdown_table_sctpAssocRemAddrTable();
+}
+
+/** 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;
+
+ 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");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ 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);
+}
+
+void
+shutdown_table_sctpAssocRemAddrTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+ sctpAssocRemAddrTable_container_clear(sctpAssocRemAddrTable_container);
+}
+
+
+/** 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)
+{
+ 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/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h b/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h
new file mode 100644
index 0000000..5068561
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h
@@ -0,0 +1,72 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/sctp-mib/sctpAssocTable.c b/agent/mibgroup/sctp-mib/sctpAssocTable.c
new file mode 100644
index 0000000..9919075
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpAssocTable.c
@@ -0,0 +1,529 @@
+/*
+ * 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/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;
+static netsnmp_table_registration_info *table_info;
+
+/** 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)
+{
+ shutdown_table_sctpAssocTable();
+}
+
+/** 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_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;
+ }
+
+ netsnmp_cache_handler_owns_cache(handler);
+
+ 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");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ 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);
+}
+
+void
+shutdown_table_sctpAssocTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+ if (sctpAssocTable_container)
+ sctpAssocTable_container_clear(sctpAssocTable_container);
+}
+
+
+/** 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)
+{
+ 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/agent/mibgroup/sctp-mib/sctpAssocTable.h b/agent/mibgroup/sctp-mib/sctpAssocTable.h
new file mode 100644
index 0000000..c6257b0
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpAssocTable.h
@@ -0,0 +1,100 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c b/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c
new file mode 100644
index 0000000..1a6fd35
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c
@@ -0,0 +1,281 @@
+/*
+ * 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 "sctpLookupLocalPortTable.h"
+
+static netsnmp_container *sctpLookupLocalPortTable_container;
+static netsnmp_table_registration_info *table_info;
+
+/** 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)
+{
+ shutdown_table_sctpLookupLocalPortTable();
+}
+
+/** 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;
+
+ 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");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ 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);
+}
+
+void
+shutdown_table_sctpLookupLocalPortTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+ sctpLookupLocalPortTable_container_clear
+ (sctpLookupLocalPortTable_container);
+}
+
+/** 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)
+{
+ 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/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h b/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h
new file mode 100644
index 0000000..226c168
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h
@@ -0,0 +1,60 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c b/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c
new file mode 100644
index 0000000..ae2ec91
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c
@@ -0,0 +1,287 @@
+/*
+ * 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 "sctpLookupRemHostNameTable.h"
+
+static netsnmp_container *sctpLookupRemHostNameTable_container;
+static netsnmp_table_registration_info *table_info;
+
+/** 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)
+{
+ shutdown_table_sctpLookupRemHostNameTable();
+}
+
+/** 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;
+
+ 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");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ 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);
+}
+
+void
+shutdown_table_sctpLookupRemHostNameTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+ sctpLookupRemHostNameTable_container_clear
+ (sctpLookupRemHostNameTable_container);
+}
+
+/** 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)
+{
+ 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/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h b/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h
new file mode 100644
index 0000000..5bd3c48
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h
@@ -0,0 +1,65 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c b/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c
new file mode 100644
index 0000000..368dd51
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.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 "sctpLookupRemIPAddrTable.h"
+
+static netsnmp_container *sctpLookupRemIPAddrTable_container;
+static netsnmp_table_registration_info *table_info;
+
+/** 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)
+{
+ shutdown_table_sctpLookupRemIPAddrTable();
+}
+
+/** 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;
+
+ 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");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ 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);
+}
+
+void
+shutdown_table_sctpLookupRemIPAddrTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+ sctpLookupRemIPAddrTable_container_clear
+ (sctpLookupRemIPAddrTable_container);
+}
+
+/** 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)
+{
+ 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/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h b/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h
new file mode 100644
index 0000000..b74514c
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h
@@ -0,0 +1,64 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c b/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c
new file mode 100644
index 0000000..c8a8874
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c
@@ -0,0 +1,276 @@
+/*
+ * 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 "sctpLookupRemPortTable.h"
+
+static netsnmp_container *sctpLookupRemPortTable_container;
+static netsnmp_table_registration_info *table_info;
+
+/** 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)
+{
+ shutdown_table_sctpLookupRemPortTable();
+}
+
+/** 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;
+
+ 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");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ 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);
+}
+
+void
+shutdown_table_sctpLookupRemPortTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+ sctpLookupRemPortTable_container_clear
+ (sctpLookupRemPortTable_container);
+}
+
+/** 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)
+{
+ 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/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h b/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h
new file mode 100644
index 0000000..b2ac811
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h
@@ -0,0 +1,58 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c b/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c
new file mode 100644
index 0000000..d9966fc
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c
@@ -0,0 +1,292 @@
+/*
+ * 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 "sctpLookupRemPrimIPAddrTable.h"
+
+static netsnmp_container *sctpLookupRemPrimIPAddrTable_container;
+static netsnmp_table_registration_info *table_info;
+
+/** 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)
+{
+ shutdown_table_sctpLookupRemPrimIPAddrTable();
+}
+
+/** 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;
+
+ 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");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ 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);
+}
+
+void
+shutdown_table_sctpLookupRemPrimIPAddrTable(void)
+{
+ if (table_info) {
+ netsnmp_table_registration_info_free(table_info);
+ table_info = NULL;
+ }
+ sctpLookupRemPrimIPAddrTable_container_clear
+ (sctpLookupRemPrimIPAddrTable_container);
+}
+
+/** 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)
+{
+ 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/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h b/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h
new file mode 100644
index 0000000..f3becdc
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h
@@ -0,0 +1,66 @@
+/*
+ * 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);
+void shutdown_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/agent/mibgroup/sctp-mib/sctpScalars.c b/agent/mibgroup/sctp-mib/sctpScalars.c
new file mode 100644
index 0000000..821079a
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpScalars.c
@@ -0,0 +1,295 @@
+/*
+ * 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;
+ int rc;
+
+ 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);
+ if (!reginfo_stats)
+ return;
+
+ rc = netsnmp_register_scalar_group(reginfo_stats, SCTP_CURRESTAB,
+ SCTP_DISCONTINUITYTIME);
+ if (rc != SNMPERR_SUCCESS)
+ return;
+
+ 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);
+ if (!reginfo_params)
+ return;
+
+ rc = netsnmp_register_scalar_group(reginfo_params, SCTP_RTOALGORITHM,
+ SCTP_MAXINITRETR);
+ if (!rc)
+ return;
+ 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;
+
+ 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"));
+
+ 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;
+
+ 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"));
+
+ 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/agent/mibgroup/sctp-mib/sctpScalars.h b/agent/mibgroup/sctp-mib/sctpScalars.h
new file mode 100644
index 0000000..8dbb8b5
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpScalars.h
@@ -0,0 +1,27 @@
+/*
+ * 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)
+#elif defined( freebsd8 ) || defined ( freebsd7 )
+config_require(sctp-mib/sctpScalars_freebsd)
+#elif defined( solaris2 )
+config_require(sctp-mib/sctpScalars_solaris2)
+#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/agent/mibgroup/sctp-mib/sctpScalars_common.c b/agent/mibgroup/sctp-mib/sctpScalars_common.c
new file mode 100644
index 0000000..2a895a8
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpScalars_common.c
@@ -0,0 +1,169 @@
+#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 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
+ */
+ if (0 != 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_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpOutCtrlChunks to 64bits\n"));
+
+ if (0 != 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_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpOutOrderChunks to 64bits\n"));
+
+ if (0 != 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_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpOutUnorderChunks to 64bits\n"));
+
+ if (0 != 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_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpInCtrlChunks to 64bits\n"));
+
+ if (0 != 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_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpInOrderChunks to 64bits\n"));
+
+ if (0 != 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_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpInUnorderChunks to 64bits\n"));
+
+ if (0 != 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_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpFragUsrMsgs to 64bits\n"));
+
+ if (0 != 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_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpReasmUsrMsgs to 64bits\n"));
+
+ if (0 != 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_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpOutSCTPPacks to 64bits\n"));
+
+ if (0 != netsnmp_c64_check32_and_update(&sctp_stats.in_sctp_packs,
+ &new_stats.in_sctp_packs,
+ &prev_sctp_stats.in_sctp_packs,
+ &need_wrap_check))
+ NETSNMP_LOGONCE((LOG_ERR,
+ "SCTP: Error expanding sctpInSCTPPacks to 64bits\n"));
+
+ /*
+ * 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/agent/mibgroup/sctp-mib/sctpScalars_common.h b/agent/mibgroup/sctp-mib/sctpScalars_common.h
new file mode 100644
index 0000000..7e5ceb5
--- /dev/null
+++ b/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/agent/mibgroup/sctp-mib/sctpScalars_freebsd.c b/agent/mibgroup/sctp-mib/sctpScalars_freebsd.c
new file mode 100644
index 0000000..b8c723f
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpScalars_freebsd.c
@@ -0,0 +1,93 @@
+#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>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_constants.h>
+
+void
+netsnmp_access_sctp_stats_arch_init()
+{
+}
+
+int
+netsnmp_access_sctp_stats_arch_load(netsnmp_sctp_stats * sctp_stats)
+{
+ struct sctpstat stat;
+ size_t len = sizeof(struct sctpstat);
+
+ if (sysctlbyname("net.inet.sctp.stats", &stat, &len, NULL, 0) < 0) {
+ return(-1);
+ }
+ memset(sctp_stats, 0, sizeof(netsnmp_sctp_stats));
+ sctp_stats->curr_estab = stat.sctps_currestab;
+ sctp_stats->active_estabs = stat.sctps_activeestab;
+ sctp_stats->passive_estabs = stat.sctps_passiveestab;
+ sctp_stats->aborteds = stat.sctps_aborted;
+ sctp_stats->shutdowns = stat.sctps_shutdown;
+ sctp_stats->out_of_blues = stat.sctps_outoftheblue;
+ sctp_stats->checksum_errors = stat.sctps_checksumerrors;
+ sctp_stats->out_ctrl_chunks.low = stat.sctps_outcontrolchunks;
+ sctp_stats->out_order_chunks.low = stat.sctps_outorderchunks;
+ sctp_stats->out_unorder_chunks.low = stat.sctps_outunorderchunks;
+ sctp_stats->in_ctrl_chunks.low = stat.sctps_incontrolchunks;
+ sctp_stats->in_order_chunks.low = stat.sctps_inorderchunks;
+ sctp_stats->in_unorder_chunks.low = stat.sctps_inunorderchunks;
+ sctp_stats->frag_usr_msgs.low = stat.sctps_fragusrmsgs;
+ sctp_stats->reasm_usr_msgs.low = stat.sctps_reasmusrmsgs;
+ sctp_stats->out_sctp_packs.low = stat.sctps_outpackets;
+ sctp_stats->in_sctp_packs.low = stat.sctps_inpackets;
+ 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)
+{
+ size_t len = sizeof(uint32_t);
+
+ sctp_params->rto_algorithm = NETSNMP_SCTP_ALGORITHM_VANJ;
+ sctp_params->max_assocs = SCTP_MAX_NUM_OF_ASOC;
+ if (sysctlbyname("net.inet.sctp.rto_max",
+ &sctp_params->rto_max,
+ &len, NULL, 0) < 0) {
+ return(-1);
+ }
+ if (sysctlbyname("net.inet.sctp.rto_min",
+ &sctp_params->rto_min,
+ &len, NULL, 0) < 0) {
+ return(-1);
+ }
+ if (sysctlbyname("net.inet.sctp.rto_initial",
+ &sctp_params->rto_initial,
+ &len, NULL, 0) < 0) {
+ return(-1);
+ }
+ if (sysctlbyname("net.inet.sctp.valid_cookie_life",
+ &sctp_params->val_cookie_life,
+ &len, NULL, 0) < 0) {
+ return(-1);
+ }
+ if (sysctlbyname("net.inet.sctp.init_rtx_max",
+ &sctp_params->max_init_retr,
+ &len, NULL, 0) < 0) {
+ return(-1);
+ }
+ return 0;
+}
diff --git a/agent/mibgroup/sctp-mib/sctpScalars_linux.c b/agent/mibgroup/sctp-mib/sctpScalars_linux.c
new file mode 100644
index 0000000..2e5b5af
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpScalars_linux.c
@@ -0,0 +1,190 @@
+#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));
+ fclose(f);
+ 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];
+ unsigned long 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"));
+ fclose(f);
+ return -1;
+ }
+ errno = 0;
+ value = strtoull(delimiter + 1, NULL, 10);
+ if (errno != 0) {
+ DEBUGMSGTL(("sctp:scalars:stats:arch_load",
+ "Malformed value!'\n"));
+ fclose(f);
+ 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"));
+ fclose(f);
+ return ret;
+ }
+ }
+
+ sctp_stats->discontinuity_time = 0;
+ fclose(f);
+ 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/agent/mibgroup/sctp-mib/sctpScalars_solaris2.c b/agent/mibgroup/sctp-mib/sctpScalars_solaris2.c
new file mode 100644
index 0000000..c7ab546
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpScalars_solaris2.c
@@ -0,0 +1,95 @@
+#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>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <inet/mib2.h>
+
+#include "kernel_sunos5.h"
+
+void
+netsnmp_access_sctp_stats_arch_init()
+{
+}
+
+int
+netsnmp_access_sctp_stats_arch_load(netsnmp_sctp_stats * sctp_stats)
+{
+ mib2_sctp_t sctpstat;
+ size_t len = sizeof(sctpstat);
+ int ret;
+
+ ret = getMibstat(MIB_SCTP, &sctpstat, len, GET_FIRST, &Get_everything, NULL);
+ if (ret) {
+ snmp_log_perror("getMibstat MIB_SCTP");
+ return -1;
+ }
+ memset(sctp_stats, 0, sizeof(netsnmp_sctp_stats));
+ sctp_stats->curr_estab = sctpstat.sctpCurrEstab;
+ sctp_stats->active_estabs = sctpstat.sctpActiveEstab;
+ sctp_stats->passive_estabs = sctpstat.sctpPassiveEstab;
+ sctp_stats->aborteds = sctpstat.sctpAborted;
+ sctp_stats->shutdowns = sctpstat.sctpShutdowns;
+ sctp_stats->out_of_blues = sctpstat.sctpOutOfBlue;
+ sctp_stats->checksum_errors = sctpstat.sctpChecksumError;
+ sctp_stats->out_ctrl_chunks.low = sctpstat.sctpOutCtrlChunks & 0xFFFFFFFF;
+ sctp_stats->out_ctrl_chunks.high = sctpstat.sctpOutCtrlChunks >> 32;
+ sctp_stats->out_order_chunks.low = sctpstat.sctpOutOrderChunks & 0xFFFFFFFF;
+ sctp_stats->out_order_chunks.high = sctpstat.sctpOutOrderChunks >> 32;
+ sctp_stats->out_unorder_chunks.low = sctpstat.sctpOutUnorderChunks & 0xFFFFFFFF;
+ sctp_stats->out_unorder_chunks.high = sctpstat.sctpOutUnorderChunks >> 32;
+ sctp_stats->in_ctrl_chunks.low = sctpstat.sctpInCtrlChunks & 0xFFFFFFFF;
+ sctp_stats->in_ctrl_chunks.high = sctpstat.sctpInCtrlChunks >> 32;
+ sctp_stats->in_order_chunks.low = sctpstat.sctpInOrderChunks & 0xFFFFFFFF;
+ sctp_stats->in_order_chunks.high = sctpstat.sctpInOrderChunks >> 32;
+ sctp_stats->in_unorder_chunks.low = sctpstat.sctpInUnorderChunks & 0xFFFFFFFF;
+ sctp_stats->in_unorder_chunks.high = sctpstat.sctpInUnorderChunks >> 32;
+ sctp_stats->in_order_chunks.low = sctpstat.sctpInOrderChunks & 0xFFFFFFFF;
+ sctp_stats->in_order_chunks.high = sctpstat.sctpInOrderChunks >> 32;
+ sctp_stats->frag_usr_msgs.low = sctpstat.sctpFragUsrMsgs & 0xFFFFFFFF;
+ sctp_stats->frag_usr_msgs.high = sctpstat.sctpFragUsrMsgs >> 32;
+ sctp_stats->reasm_usr_msgs.low = sctpstat.sctpReasmUsrMsgs & 0xFFFFFFFF;
+ sctp_stats->reasm_usr_msgs.high = sctpstat.sctpReasmUsrMsgs >> 32;
+ sctp_stats->out_sctp_packs.low = sctpstat.sctpOutSCTPPkts & 0xFFFFFFFF;
+ sctp_stats->out_sctp_packs.high = sctpstat.sctpOutSCTPPkts >> 32;
+ sctp_stats->in_sctp_packs.low = sctpstat.sctpInSCTPPkts & 0xFFFFFFFF;
+ sctp_stats->in_sctp_packs.high = sctpstat.sctpInSCTPPkts >> 32;
+ 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)
+{
+ mib2_sctp_t sctpstat;
+ size_t len = sizeof(sctpstat);
+ int ret;
+
+ ret = getMibstat(MIB_SCTP, &sctpstat, len, GET_FIRST, &Get_everything, NULL);
+ if (ret) {
+ snmp_log_perror("getMibstat MIB_SCTP");
+ return -1;
+ }
+
+ sctp_params->rto_algorithm = sctpstat.sctpRtoAlgorithm;
+ sctp_params->max_assocs = sctpstat.sctpMaxAssocs;
+ sctp_params->rto_max = sctpstat.sctpRtoMax;
+ sctp_params->rto_min = sctpstat.sctpRtoMin;
+ sctp_params->rto_initial = sctpstat.sctpRtoInitial;
+ sctp_params->val_cookie_life = sctpstat.sctpValCookieLife;
+ sctp_params->max_init_retr = sctpstat.sctpMaxInitRetr;
+ return 0;
+}
diff --git a/agent/mibgroup/sctp-mib/sctpTables.h b/agent/mibgroup/sctp-mib/sctpTables.h
new file mode 100644
index 0000000..d22aea0
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpTables.h
@@ -0,0 +1,25 @@
+#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)
+config_require(util_funcs/get_pid_from_inode)
+#elif defined( freebsd7 ) || defined( freebsd8 )
+config_require(sctp-mib/sctpTables_freebsd)
+#elif defined( solaris2 )
+config_require(sctp-mib/sctpTables_solaris2)
+#else
+config_error(SCTP-MIB is not available in tihs environment)
+#endif
+#endif /* SCTP_TABLES_H */
diff --git a/agent/mibgroup/sctp-mib/sctpTables_common.c b/agent/mibgroup/sctp-mib/sctpTables_common.c
new file mode 100644
index 0000000..b28ea03
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpTables_common.c
@@ -0,0 +1,451 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#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"
+
+netsnmp_feature_require(container_lifo)
+
+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);
+ }
+ CONTAINER_FREE(to_delete);
+}
+
+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);
+ }
+ CONTAINER_FREE(to_delete);
+}
+
+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);
+ }
+ CONTAINER_FREE(to_delete);
+}
+
+
+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/agent/mibgroup/sctp-mib/sctpTables_common.h b/agent/mibgroup/sctp-mib/sctpTables_common.h
new file mode 100644
index 0000000..f457605
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpTables_common.h
@@ -0,0 +1,112 @@
+#ifndef SCTP_TABLES_COMMON_H
+#define SCTP_TABLES_COMMON_H
+
+#if defined(freebsd8) || defined(freebsd7)
+#define netsnmp_table_registration_info_free SNMP_FREE
+#endif
+
+#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/agent/mibgroup/sctp-mib/sctpTables_freebsd.c b/agent/mibgroup/sctp-mib/sctpTables_freebsd.c
new file mode 100644
index 0000000..516e9f5
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpTables_freebsd.c
@@ -0,0 +1,244 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "sctpAssocTable.h"
+#include "sctpAssocLocalAddrTable.h"
+#include "sctpAssocRemAddrTable.h"
+#include "sctpTables_common.h"
+
+#include <util_funcs.h>
+
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_constants.h>
+
+
+static int
+parse_assoc_local_addresses(sctpTables_containers * containers,
+ struct xsctp_laddr *xladdr)
+{
+ int ret;
+ sctpAssocLocalAddrTable_entry *entry;
+ entry = sctpAssocLocalAddrTable_entry_create();
+ if (entry == NULL)
+ return SNMP_ERR_GENERR;
+
+ entry->sctpAssocId = 0;
+ if (xladdr->address.sa.sa_family == AF_INET) {
+ entry->sctpAssocLocalAddrType = INETADDRESSTYPE_IPV4;
+ entry->sctpAssocLocalAddr_len = 4;
+ memcpy(entry->sctpAssocLocalAddr,
+ &xladdr->address.sin.sin_addr,
+ entry->sctpAssocLocalAddr_len);
+ } else if (xladdr->address.sa.sa_family == AF_INET6) {
+ entry->sctpAssocLocalAddrType = INETADDRESSTYPE_IPV6;
+ entry->sctpAssocLocalAddr_len = 16;
+ memcpy(entry->sctpAssocLocalAddr,
+ &xladdr->address.sin6.sin6_addr,
+ entry->sctpAssocLocalAddr_len);
+ }
+ entry->sctpAssocLocalAddrStartTime = xladdr->start_time.tv_sec;
+ ret = sctpAssocLocalAddrTable_add_or_update(containers->sctpAssocLocalAddrTable,
+ entry);
+ if (ret != SNMP_ERR_NOERROR)
+ return SNMP_ERR_GENERR;
+
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+parse_assoc_xstcb(sctpTables_containers * containers, struct xsctp_tcb *xstcb)
+{
+ int ret;
+ sctpAssocTable_entry *entry;
+
+ entry = sctpAssocTable_entry_create();
+ if (entry == NULL)
+ return SNMP_ERR_GENERR;
+
+ switch (xstcb->state) {
+ case SCTP_STATE_INUSE:
+ entry->sctpAssocState = SCTPASSOCSTATE_DELETETCB;
+ break;
+ case SCTP_STATE_COOKIE_WAIT:
+ entry->sctpAssocState = SCTPASSOCSTATE_COOKIEWAIT;
+ break;
+ case SCTP_STATE_COOKIE_ECHOED:
+ entry->sctpAssocState = SCTPASSOCSTATE_COOKIEECHOED;
+ break;
+ case SCTP_STATE_OPEN:
+ entry->sctpAssocState = SCTPASSOCSTATE_ESTABLISHED;
+ break;
+ case SCTP_STATE_SHUTDOWN_SENT:
+ entry->sctpAssocState = SCTPASSOCSTATE_SHUTDOWNSENT;
+ break;
+ case SCTP_STATE_SHUTDOWN_RECEIVED:
+ entry->sctpAssocState = SCTPASSOCSTATE_SHUTDOWNRECEIVED;
+ break;
+ case SCTP_STATE_SHUTDOWN_ACK_SENT:
+ entry->sctpAssocState = SCTPASSOCSTATE_SHUTDOWNACKSENT;
+ break;
+ default:
+ case SCTP_STATE_EMPTY:
+ entry->sctpAssocState = SCTPASSOCSTATE_CLOSED;
+ break;
+ };
+ entry->sctpAssocHeartBeatInterval = xstcb->heartbeat_interval;
+ entry->sctpAssocId = 0;
+ entry->sctpAssocPrimProcess = xstcb->primary_process;
+ entry->sctpAssocLocalPort = xstcb->local_port;
+ entry->sctpAssocRemPort = xstcb->remote_port;
+ entry->sctpAssocHeartBeatInterval = xstcb->heartbeat_interval;
+ entry->sctpAssocInStreams = xstcb->in_streams;
+ entry->sctpAssocOutStreams = xstcb->out_streams;
+ entry->sctpAssocMaxRetr = xstcb->max_nr_retrans;
+ entry->sctpAssocT1expireds = xstcb->T1_expireries;
+ entry->sctpAssocRtxChunks = xstcb->retransmitted_tsns;
+ entry->sctpAssocT2expireds = xstcb->T2_expireries;
+ entry->sctpAssocRemHostName[0] = 0;
+ entry->sctpAssocRemHostName_len = 0;
+ entry->sctpAssocDiscontinuityTime = xstcb->discontinuity_time.tv_sec;
+ entry->sctpAssocStartTime = xstcb->start_time.tv_sec;
+
+ ret = sctpAssocTable_add_or_update(containers->sctpAssocTable, entry);
+ if (ret != SNMP_ERR_NOERROR) {
+ return ret;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+static int
+parse_remaddr_xraddr(sctpTables_containers * containers,
+ struct xsctp_raddr *xraddr)
+{
+ int ret;
+ sctpAssocRemAddrTable_entry *entry;
+
+ entry = sctpAssocRemAddrTable_entry_create();
+ if (entry == NULL)
+ return SNMP_ERR_GENERR;
+
+
+ entry->sctpAssocId = 0;
+
+ if(xraddr->active)
+ entry->sctpAssocRemAddrActive = TRUTHVALUE_TRUE;
+ else
+ entry->sctpAssocRemAddrActive = TRUTHVALUE_FALSE;
+
+ if (xraddr->heartbeat_enabled)
+ entry->sctpAssocRemAddrHBActive = TRUTHVALUE_TRUE;
+ else
+ entry->sctpAssocRemAddrHBActive = TRUTHVALUE_FALSE;
+
+ entry->sctpAssocRemAddrRTO = xraddr->rto;
+ entry->sctpAssocRemAddrMaxPathRtx = xraddr->max_path_rtx;
+ entry->sctpAssocRemAddrRtx = xraddr->rtx;
+ entry->sctpAssocRemAddrStartTime = xraddr->start_time.tv_sec;
+
+ if (xraddr->address.sa.sa_family == AF_INET) {
+ entry->sctpAssocRemAddrType = INETADDRESSTYPE_IPV4;
+ entry->sctpAssocRemAddr_len = 4;
+ memcpy(entry->sctpAssocRemAddr,
+ &xraddr->address.sin.sin_addr,
+ entry->sctpAssocRemAddr_len);
+ } else if (xraddr->address.sa.sa_family == AF_INET6) {
+ entry->sctpAssocRemAddrType = INETADDRESSTYPE_IPV6;
+ entry->sctpAssocRemAddr_len = 16;
+ memcpy(entry->sctpAssocRemAddr,
+ &xraddr->address.sin6.sin6_addr,
+ entry->sctpAssocRemAddr_len);
+ }
+ ret =
+ sctpAssocRemAddrTable_add_or_update(containers->
+ sctpAssocRemAddrTable, entry);
+ if (ret != SNMP_ERR_NOERROR) {
+ return ret;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+sctpTables_arch_load(sctpTables_containers * containers, u_long * flags)
+{
+ int ret = SNMP_ERR_NOERROR;
+ size_t len;
+ caddr_t buf;
+ unsigned int offset;
+ struct xsctp_inpcb *xinp;
+ struct xsctp_tcb *xstcb;
+ struct xsctp_laddr *xladdr;
+ struct xsctp_raddr *xraddr;
+
+
+ *flags |= SCTP_TABLES_LOAD_FLAG_DELETE_INVALID;
+ *flags |= SCTP_TABLES_LOAD_FLAG_AUTO_LOOKUP;
+ len = 0;
+ if (sysctlbyname("net.inet.sctp.assoclist", 0, &len, 0, 0) < 0) {
+ printf("Error %d (%s) could not get the assoclist\n", errno, strerror(errno));
+ return(-1);
+ }
+ if ((buf = (caddr_t)malloc(len)) == 0) {
+ printf("malloc %lu bytes failed.\n", (long unsigned)len);
+ return(-1);
+ }
+ if (sysctlbyname("net.inet.sctp.assoclist", buf, &len, 0, 0) < 0) {
+ printf("Error %d (%s) could not get the assoclist\n", errno, strerror(errno));
+ free(buf);
+ return(-1);
+ }
+ offset = 0;
+ xinp = (struct xsctp_inpcb *)(buf + offset);
+ while (xinp->last == 0) {
+ /* for each INP */
+ offset += sizeof(struct xsctp_inpcb);
+ /* Local addresses */
+ xladdr = (struct xsctp_laddr *)(buf + offset);
+ while (xladdr->last == 0) {
+ offset += sizeof(struct xsctp_laddr);
+ xladdr = (struct xsctp_laddr *)(buf + offset);
+ }
+ offset += sizeof(struct xsctp_laddr);
+ /* Associations */
+ xstcb = (struct xsctp_tcb *)(buf + offset);
+ while (xstcb->last == 0) {
+ xstcb = (struct xsctp_tcb *)(buf + offset);
+ offset += sizeof(struct xsctp_tcb);
+ parse_assoc_xstcb(containers, xstcb);
+ /* Local addresses */
+ xladdr = (struct xsctp_laddr *)(buf + offset);
+ while (xladdr->last == 0) {
+ parse_assoc_local_addresses(containers, xladdr);
+ offset += sizeof(struct xsctp_laddr);
+ xladdr = (struct xsctp_laddr *)(buf + offset);
+ }
+ offset += sizeof(struct xsctp_laddr);
+
+ /* Remote addresses */
+ xraddr = (struct xsctp_raddr *)(buf + offset);
+ while (xraddr->last == 0) {
+ parse_remaddr_xraddr(containers, xraddr);
+ offset += sizeof(struct xsctp_raddr);
+ xraddr = (struct xsctp_raddr *)(buf + offset);
+ }
+ offset += sizeof(struct xsctp_raddr);
+ xstcb = (struct xsctp_tcb *)(buf + offset);
+ }
+ offset += sizeof(struct xsctp_tcb);
+ xinp = (struct xsctp_inpcb *)(buf + offset);
+ }
+ free((void *)buf);
+ return ret;
+}
diff --git a/agent/mibgroup/sctp-mib/sctpTables_linux.c b/agent/mibgroup/sctp-mib/sctpTables_linux.c
new file mode 100644
index 0000000..6c4d81b
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpTables_linux.c
@@ -0,0 +1,448 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "sctpAssocTable.h"
+#include "sctpAssocLocalAddrTable.h"
+#include "sctpAssocRemAddrTable.h"
+#include "sctpTables_common.h"
+
+#include "mibgroup/util_funcs/get_pid_from_inode.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)
+{
+ unsigned long 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 = strtoull(token, NULL, 10);
+ entry->sctpAssocPrimProcess = netsnmp_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;
+ }
+
+ netsnmp_get_pid_from_inode_init();
+
+ /*
+ * 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/agent/mibgroup/sctp-mib/sctpTables_solaris2.c b/agent/mibgroup/sctp-mib/sctpTables_solaris2.c
new file mode 100644
index 0000000..0993ab3
--- /dev/null
+++ b/agent/mibgroup/sctp-mib/sctpTables_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 "sctpAssocTable.h"
+#include "sctpAssocLocalAddrTable.h"
+#include "sctpAssocRemAddrTable.h"
+#include "sctpTables_common.h"
+
+#include <util_funcs.h>
+
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <inet/mib2.h>
+
+#include "kernel_sunos5.h"
+
+static int
+parse_assoc_local_address(sctpTables_containers * containers,
+ mib2_sctpConnLocalEntry_t *lce)
+{
+ int ret;
+ sctpAssocLocalAddrTable_entry *entry;
+ entry = sctpAssocLocalAddrTable_entry_create();
+ if (entry == NULL)
+ return SNMP_ERR_GENERR;
+
+ entry->sctpAssocId = 0;
+ entry->sctpAssocLocalAddrType = lce->sctpAssocLocalAddrType;
+ if (lce->sctpAssocLocalAddrType == INETADDRESSTYPE_IPV4) {
+ entry->sctpAssocLocalAddr_len = 4;
+ memcpy(entry->sctpAssocLocalAddr,
+ lce->sctpAssocLocalAddr.s6_addr+12,
+ entry->sctpAssocLocalAddr_len);
+ } else if (lce->sctpAssocLocalAddrType == INETADDRESSTYPE_IPV6) {
+ entry->sctpAssocLocalAddr_len = 16;
+ memcpy(entry->sctpAssocLocalAddr,
+ &lce->sctpAssocLocalAddr,
+ entry->sctpAssocLocalAddr_len);
+ }
+ entry->sctpAssocLocalAddrStartTime = 0;
+ ret = sctpAssocLocalAddrTable_add_or_update(containers->sctpAssocLocalAddrTable,
+ entry);
+ return ret;
+}
+
+static int
+parse_assoc(sctpTables_containers * containers, mib2_sctpConnEntry_t *sce)
+{
+ int ret;
+ sctpAssocTable_entry *entry;
+
+ entry = sctpAssocTable_entry_create();
+ if (entry == NULL)
+ return SNMP_ERR_GENERR;
+
+ switch (sce->sctpAssocState) {
+ case MIB2_SCTP_closed:
+ entry->sctpAssocState = SCTPASSOCSTATE_CLOSED;
+ break;
+ case MIB2_SCTP_cookieWait:
+ entry->sctpAssocState = SCTPASSOCSTATE_COOKIEWAIT;
+ break;
+ case MIB2_SCTP_cookieEchoed:
+ entry->sctpAssocState = SCTPASSOCSTATE_COOKIEECHOED;
+ break;
+ case MIB2_SCTP_established:
+ entry->sctpAssocState = SCTPASSOCSTATE_ESTABLISHED;
+ break;
+ case MIB2_SCTP_shutdownPending:
+ entry->sctpAssocState = SCTPASSOCSTATE_SHUTDOWNPENDING;
+ break;
+ case MIB2_SCTP_shutdownSent:
+ entry->sctpAssocState = SCTPASSOCSTATE_SHUTDOWNSENT;
+ break;
+ case MIB2_SCTP_shutdownReceived:
+ entry->sctpAssocState = SCTPASSOCSTATE_SHUTDOWNRECEIVED;
+ break;
+ case MIB2_SCTP_shutdownAckSent:
+ entry->sctpAssocState = SCTPASSOCSTATE_SHUTDOWNACKSENT;
+ break;
+ }
+ entry->sctpAssocHeartBeatInterval = sce->sctpAssocHeartBeatInterval;
+ entry->sctpAssocId = sce->sctpAssocId;
+ entry->sctpAssocPrimProcess = sce->sctpAssocPrimProcess;
+ entry->sctpAssocLocalPort = sce->sctpAssocLocalPort;
+ entry->sctpAssocRemPrimAddrType = sce->sctpAssocRemPrimAddrType;
+ if (entry->sctpAssocRemPrimAddrType == INETADDRESSTYPE_IPV4) {
+ entry->sctpAssocRemPrimAddr_len = 4;
+ memcpy(entry->sctpAssocRemPrimAddr, sce->sctpAssocRemPrimAddr.s6_addr+12,
+ entry->sctpAssocRemPrimAddr_len);
+ }
+ else {
+ entry->sctpAssocRemPrimAddr_len = 16;
+ memcpy(entry->sctpAssocRemPrimAddr, sce->sctpAssocRemPrimAddr.s6_addr,
+ entry->sctpAssocRemPrimAddr_len);
+ }
+ entry->sctpAssocRemPort = sce->sctpAssocRemPort;
+ entry->sctpAssocInStreams = sce->sctpAssocInStreams;
+ entry->sctpAssocOutStreams = sce->sctpAssocOutStreams;
+ entry->sctpAssocMaxRetr = sce->sctpAssocMaxRetr;
+ entry->sctpAssocT1expireds = sce->sctpAssocT1expired;
+ entry->sctpAssocRtxChunks = sce->sctpAssocRtxChunks;
+ entry->sctpAssocT2expireds = sce->sctpAssocT2expired;
+ entry->sctpAssocRemHostName[0] = 0;
+ entry->sctpAssocRemHostName_len = 0;
+ entry->sctpAssocDiscontinuityTime = 0;
+ entry->sctpAssocStartTime = sce->sctpAssocStartTime;
+
+ ret = sctpAssocTable_add_or_update(containers->sctpAssocTable, entry);
+ return ret;
+}
+
+
+static int
+parse_assoc_remote_address(sctpTables_containers * containers,
+ mib2_sctpConnRemoteEntry_t *rce)
+{
+ int ret;
+ sctpAssocRemAddrTable_entry *entry;
+
+ entry = sctpAssocRemAddrTable_entry_create();
+ if (entry == NULL)
+ return SNMP_ERR_GENERR;
+
+ entry->sctpAssocId = rce->sctpAssocId;
+ entry->sctpAssocRemAddrActive = rce->sctpAssocRemAddrActive;
+ entry->sctpAssocRemAddrHBActive = rce->sctpAssocRemAddrHBActive;
+ entry->sctpAssocRemAddrRTO = rce->sctpAssocRemAddrRTO;
+ entry->sctpAssocRemAddrMaxPathRtx = rce->sctpAssocRemAddrMaxPathRtx;
+ entry->sctpAssocRemAddrRtx = rce->sctpAssocRemAddrRtx;
+ entry->sctpAssocRemAddrStartTime = 0;
+
+ entry->sctpAssocRemAddrType = rce->sctpAssocRemAddrType;
+ if (rce->sctpAssocRemAddrType == INETADDRESSTYPE_IPV4) {
+ entry->sctpAssocRemAddr_len = 4;
+ memcpy(entry->sctpAssocRemAddr,
+ rce->sctpAssocRemAddr.s6_addr+12,
+ entry->sctpAssocRemAddr_len);
+ } else if (rce->sctpAssocRemAddrType == INETADDRESSTYPE_IPV6) {
+ entry->sctpAssocRemAddr_len = 16;
+ memcpy(entry->sctpAssocRemAddr,
+ &rce->sctpAssocRemAddr,
+ entry->sctpAssocRemAddr_len);
+ }
+ ret =
+ sctpAssocRemAddrTable_add_or_update(containers->sctpAssocRemAddrTable,
+ entry);
+ return ret;
+}
+
+
+int
+sctpTables_arch_load(sctpTables_containers * containers, u_long * flags)
+{
+ int ret = SNMP_ERR_NOERROR;
+ mib2_sctpConnEntry_t sce;
+ mib2_sctpConnLocalEntry_t lce;
+ mib2_sctpConnRemoteEntry_t rce;
+ req_e req = GET_FIRST;
+
+ while (getMibstat(MIB_SCTP_CONN, &sce, sizeof(sce), req, &Get_everything, 0) == 0) {
+ req = GET_NEXT;
+ parse_assoc(containers, &sce);
+ }
+ req = GET_FIRST;
+ while (getMibstat(MIB_SCTP_CONN_LOCAL, &lce, sizeof(lce), req, &Get_everything, 0) == 0) {
+ req = GET_NEXT;
+ parse_assoc_local_address(containers, &lce);
+ }
+ req = GET_FIRST;
+ while (getMibstat(MIB_SCTP_CONN_REMOTE, &rce, sizeof(rce), req, &Get_everything, 0) == 0) {
+ req = GET_NEXT;
+ parse_assoc_remote_address(containers, &rce);
+ }
+ return ret;
+}
diff --git a/agent/mibgroup/smux.h b/agent/mibgroup/smux.h
new file mode 100644
index 0000000..bc76929
--- /dev/null
+++ b/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/agent/mibgroup/smux/smux.c b/agent/mibgroup/smux/smux.c
new file mode 100644
index 0000000..4598c2b
--- /dev/null
+++ b/agent/mibgroup/smux/smux.c
@@ -0,0 +1,2114 @@
+/*
+ * Smux module authored by Rohit Dube.
+ * Rewritten by Nick Amato <naamato@merit.net>.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+# 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>
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#include <sys/stat.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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 "mibdefs.h"
+#include "snmpd.h"
+
+netsnmp_feature_require(snprint_objid)
+
+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, NETSNMP_OLDAPI_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 rv;
+
+ 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");
+ free(aptr);
+ return;
+ }
+
+ password_cptr = strchr(cptr, ' ');
+ if (password_cptr)
+ *(password_cptr++) = '\0';
+
+ /*
+ * oid
+ */
+ aptr->sa_active_fd = -1;
+ aptr->sa_oid_len = MAX_OID_LEN;
+ rv = read_objid( cptr, aptr->sa_oid, &aptr->sa_oid_len );
+ DEBUGMSGTL(("smux_conf", "parsing registration for: %s\n", cptr));
+ if (!rv)
+ config_perror("Error parsing smux oid");
+
+ if (password_cptr != NULL) { /* Do we have a password or not? */
+ DEBUGMSGTL(("smux_conf", "password is: %s\n",
+ SNMP_STRORNULL(password_cptr)));
+
+ /*
+ * password
+ */
+ if (*password_cptr)
+ strlcpy(aptr->sa_passwd, password_cptr, sizeof(aptr->sa_passwd));
+ } 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;
+ size_t len;
+ ssize_t tmp_len;
+ long reqid, errsts, erridx;
+ u_char *dataptr;
+
+ DEBUGMSGTL(("smux", "[var_smux_write] entering var_smux_write\n"));
+
+ len = SMUXMAXPKTSIZE;
+ reterr = SNMP_ERR_NOERROR;
+ var_len = var_val_len;
+ 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;
+ }
+
+ if (!rptr) {
+ DEBUGMSGTL(("smux", "[var_smux_write] unknown registration\n"));
+ return SNMP_ERR_GENERR;
+ }
+
+ 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, (void *) 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, (void *) buf,
+ SMUXMAXPKTSIZE, MSG_PEEK, NULL, NULL)) <= 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 %" NETSNMP_PRIz
+ "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, (void *) buf, len, 0, NULL, NULL);
+ }
+ 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 %" NETSNMP_PRIz
+ "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, (void *) 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;
+ socklen_t alen;
+ int length;
+ size_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, NULL);
+ }
+ 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,
+ NULL);
+ }
+ 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, NULL);
+ }
+ 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 %" NETSNMP_PRIz
+ "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)
+ {
+ 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 %ld, len %" NETSNMP_PRIz
+ "u, 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 %" NETSNMP_PRIz
+ "u, 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 %" NETSNMP_PRIz
+ "u, 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 %" NETSNMP_PRIz
+ "u, 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;
+ char oid_print[SMUXMAXSTRLEN];
+
+ if (snmp_get_do_debugging()) {
+ snprint_objid(oid_print, sizeof(oid_print), name, namelen);
+ DEBUGMSGTL(("smux:auth", "[smux_auth_peer] Authorizing: %s, %s\n",
+ oid_print, passwd));
+ }
+
+ for (i = 0; i < nauths; i++) {
+ if (snmp_get_do_debugging()) {
+ snprint_objid(oid_print, sizeof(oid_print),
+ Auths[i]->sa_oid, Auths[i]->sa_oid_len);
+ DEBUGMSGTL(("smux:auth", "[smux_auth_peer] Checking OID: %s (%d)\n",
+ oid_print, i));
+ }
+ if (snmp_oid_compare(Auths[i]->sa_oid, Auths[i]->sa_oid_len,
+ name, namelen) == 0) {
+ if (snmp_get_do_debugging()) {
+ DEBUGMSGTL(("smux:auth", "[smux_auth_peer] Checking P/W: %s (%d)\n",
+ Auths[i]->sa_passwd, Auths[i]->sa_active_fd));
+ }
+ 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 %ld\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 %ld\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 %ld\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);
+ if (register_mib("smux", (struct variable *)
+ smux_variables, sizeof(struct variable2),
+ 1, nrptr->sr_name, nrptr->sr_name_len)
+ != SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("smux", "[smux_rreq_process] Failed to register subtree\n"));
+ smux_list_detach(&ActiveRegs, nrptr);
+ free(nrptr);
+ smux_send_rrsp(sd, -1);
+ return NULL;
+ }
+
+ 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) {
+ *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) {
+ 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; 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) {
+ /*
+ * Same tree...
+ */
+ if (add->sr_priority == rptr->sr_priority) {
+ /*
+ * ... same pri : nope
+ */
+ return -1;
+ } else if (add->sr_priority < rptr->sr_priority) {
+ /*
+ * ... lower pri : insert and return
+ */
+ add->sr_next = rptr;
+ if ( prev ) { prev->sr_next = add; }
+ else { *head = add; }
+ return 0;
+#ifdef XXX
+ } else {
+ /*
+ * ... higher pri : put after
+ */
+ add->sr_next = rptr->sr_next;
+ rptr->sr_next = add;
+#endif
+ }
+ } else if (result < 0) {
+ /*
+ * Earlier tree : insert and return
+ */
+ add->sr_next = rptr;
+ if ( prev ) { prev->sr_next = add; }
+ else { *head = add; }
+ return 0;
+#ifdef XXX
+ } else {
+ /*
+ * Later tree : put after
+ */
+ add->sr_next = rptr->sr_next;
+ rptr->sr_next = add;
+ return 0;
+#endif
+ }
+ prev = rptr;
+ }
+ /*
+ * Otherwise, this entry must come last
+ */
+ if ( prev ) { prev->sr_next = add; }
+ else { *head = 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 || !bestptr) {
+ 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];
+ ssize_t 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, (size_t *) &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; %" NETSNMP_PRIz "d bytes\n",
+ (int) type, length));
+
+ while (1) {
+ /*
+ * peek at what's received
+ */
+ length = recvfrom(sd, (char *) result, SMUXMAXPKTSIZE, MSG_PEEK, NULL,
+ NULL);
+ 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 %" NETSNMP_PRIz "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, NULL);
+ }
+ 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 %" NETSNMP_PRIz "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, (size_t *) &length, &type);
+ smux_trap_process(ptr, (size_t *) &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 %ld, errstat %ld, \n\terrindex %ld\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 %" NETSNMP_PRIz
+ "u, 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 i;
+
+ /*
+ * 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 == NULL)
+ 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 == NULL)
+ 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(void)
+{
+ 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/agent/mibgroup/smux/smux.h b/agent/mibgroup/smux/smux.h
new file mode 100644
index 0000000..88b8a3d
--- /dev/null
+++ b/agent/mibgroup/smux/smux.h
@@ -0,0 +1,85 @@
+/*
+ * Smux module authored by Rohit Dube.
+ * Rewritten by Nick Amato <naamato@merit.net>.
+ */
+
+#ifndef NETSNMP_TRANSPORT_IPV4BASE_DOMAIN
+config_error(smux/smux depends on the IPv4Base transport domain)
+#endif
+
+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);
+
+/* 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/agent/mibgroup/smux/snmp_bgp.c b/agent/mibgroup/smux/snmp_bgp.c
new file mode 100644
index 0000000..16b0185
--- /dev/null
+++ b/agent/mibgroup/smux/snmp_bgp.c
@@ -0,0 +1,208 @@
+/*
+ * $Id$
+ */
+
+/*
+ * 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, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 1, {1}},
+ {BGPLOCALAS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 1, {2}},
+ {BGPIDENTIFIER, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 1, {4}},
+ {BGPPEERIDENTIFIER, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 1}},
+ {BGPPEERSTATE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 2}},
+ {BGPPEERADMINSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 3}},
+ {BGPPEERNEGOTIATEDVERSION, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 4}},
+ {BGPPEERLOCALADDR, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 5}},
+ {BGPPEERLOCALPORT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 6}},
+ {BGPPEERREMOTEADDR, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 7}},
+ {BGPPEERREMOTEPORT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 8}},
+ {BGPPEERREMOTEAS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 9}},
+ {BGPPEERINUPDATES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 10}},
+ {BGPPEEROUTUPDATES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 11}},
+ {BGPPEERINTOTALMESSAGES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 12}},
+ {BGPPEEROUTTOTALMESSAGES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 13}},
+ {BGPPEERLASTERROR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {3, 1, 14}},
+ {BGPPATHATTRPEER, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {5, 1, 1}},
+ {BGPPATHATTRDESTNETWORK, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {5, 1, 2}},
+ {BGPPATHATTRORIGIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {5, 1, 3}},
+ {BGPPATHATTRASPATH, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {5, 1, 4}},
+ {BGPPATHATTRNEXTHOP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {5, 1, 5}},
+ {BGPPATHATTRINTERASMETRIC, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_bgp, 3, {5, 1, 6}}
+};
+
+oid bgp_variables_oid[] = { NETSNMP_MIB2_OID, 15 };
+
+void
+init_snmp_bdp(void)
+{
+ REGISTER_MIB("smux/snmp_bgp", bgp_variables, variable13,
+ bgp_variables_oid);
+}
+
+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/agent/mibgroup/smux/snmp_bgp.h b/agent/mibgroup/smux/snmp_bgp.h
new file mode 100644
index 0000000..74ee6ec
--- /dev/null
+++ b/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/agent/mibgroup/smux/snmp_ospf.c b/agent/mibgroup/smux/snmp_ospf.c
new file mode 100644
index 0000000..73f0e43
--- /dev/null
+++ b/agent/mibgroup/smux/snmp_ospf.c
@@ -0,0 +1,378 @@
+/*
+ * $Id$
+ */
+
+/*
+ * 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, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {1, 1, 1}},
+ {ospfAdminStat, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {1, 1, 2}},
+ {ospfVersionNumber, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {1, 1, 3}},
+ {ospfAreaBdrRtrStatus, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {1, 1, 4}},
+ {ospfASBdrRtrStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {1, 1, 5}},
+ {ospfExternLsaCount, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {1, 1, 6}},
+ {ospfExternLsaCksumSum, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {1, 1, 7}},
+ {ospfTOSSupport, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {1, 1, 8}},
+ {ospfOriginateNewLsas, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {1, 1, 9}},
+ {ospfRxNewLsas, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {1, 1, 10, 0}},
+ {ospfExtLsdbLimit, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {1, 1, 11}},
+ {ospfMulticastExtensions, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {1, 1, 12}},
+ {ospfAreaId, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {2, 1, 1}},
+ {ospfAuthType, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {2, 1, 2}},
+ {ospfImportAsExtern, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {2, 1, 3}},
+ {ospfSpfRuns, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {2, 1, 4}},
+ {ospfAreaBdrRtrCount, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {2, 1, 5}},
+ {ospfAsBdrRtrCount, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {2, 1, 6}},
+ {ospfAreaLsaCount, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {2, 1, 7}},
+ {ospfAreaLsaCksumSum, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {2, 1, 8}},
+ {ospfAreaSummary, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {2, 1, 9}},
+ {ospfAreaStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {2, 1, 10}},
+ {ospfStubAreaId, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {3, 1, 1}},
+ {ospfStubTOS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {3, 1, 2}},
+ {ospfStubMetric, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {3, 1, 3}},
+ {ospfStubStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {3, 1, 4}},
+ {ospfStubMetricType, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {3, 1, 5}},
+ {ospfLsdbAreaId, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {4, 1, 1}},
+ {ospfLsdbType, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {4, 1, 2}},
+ {ospfLsdbLsid, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {4, 1, 3}},
+ {ospfLsdbRouterId, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {4, 1, 4}},
+ {ospfLsdbSequence, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {4, 1, 5}},
+ {ospfLsdbAge, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {4, 1, 6}},
+ {ospfLsdbChecksum, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {4, 1, 7}},
+ {ospfLsdbAdvertisement, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {4, 1, 8}},
+ {ospfAreaRangeAreaId, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {5, 1, 1}},
+ {ospfAreaRangeNet, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {5, 1, 2}},
+ {ospfAreaRangeMask, ASN_IPADDRESS, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {5, 1, 3}},
+ {ospfAreaRangeStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {5, 1, 4}},
+ {ospfAreaRangeEffect, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {5, 1, 5}},
+ {ospfHostIpAddress, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {6, 1, 1}},
+ {ospfHostTOS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {6, 1, 2}},
+ {ospfHostMetric, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {6, 1, 3}},
+ {ospfHostStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {6, 1, 4}},
+ {ospfHostAreaID, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {6, 1, 5}},
+ {ospfIfIpAddress, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {7, 1, 1}},
+ {ospfAddressLessIf, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {7, 1, 2}},
+ {ospfIfAreaId, ASN_IPADDRESS, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 3}},
+ {ospfIfType, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 4}},
+ {ospfIfAdminStat, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 5}},
+ {ospfIfRtrPriority, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 6}},
+ {ospfIfTransitDelay, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 7}},
+ {ospfIfRetransInterval, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 8}},
+ {ospfIfHelloInterval, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 9}},
+ {ospfIfRtrDeadInterval, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 10}},
+ {ospfIfPollInterval, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 11}},
+ {ospfIfState, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {7, 1, 12}},
+ {ospfIfDesignatedRouter, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {7, 1, 13}},
+ {ospfIfBackupDesignatedRouter, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {7, 1, 14}},
+ {ospfIfEvents, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {7, 1, 15}},
+ {ospfIfAuthKey, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 16}},
+ {ospfIfStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 17}},
+ {ospfIfMulticastForwarding, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {7, 1, 18}},
+ {ospfIfMetricIpAddress, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {8, 1, 1}},
+ {ospfIfMetricAddressLessIf, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {8, 1, 2}},
+ {ospfIfMetricTOS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {8, 1, 3}},
+ {ospfIfMetricValue, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {8, 1, 4}},
+ {ospfIfMetricStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {8, 1, 5}},
+ {ospfVirtIfAreaId, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {9, 1, 1}},
+ {ospfVirtIfNeighbor, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {9, 1, 2}},
+ {ospfVirtIfTransitDelay, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {9, 1, 3}},
+ {ospfVirtIfRetransInterval, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {9, 1, 4}},
+ {ospfVirtIfHelloInterval, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {9, 1, 5}},
+ {ospfVirtIfRtrDeadInterval, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {9, 1, 6}},
+ {ospfVirtIfState, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {9, 1, 7}},
+ {ospfVirtIfEvents, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {9, 1, 8}},
+ {ospfVirtIfAuthKey, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {9, 1, 9}},
+ {ospfVirtIfStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {9, 1, 10}},
+ {ospfNbrIpAddr, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {10, 1, 1}},
+ {ospfNbrAddressLessIndex, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {10, 1, 2}},
+ {ospfNbrRtrId, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {10, 1, 3}},
+ {ospfNbrOptions, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {10, 1, 4}},
+ {ospfNbrPriority, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {10, 1, 5}},
+ {ospfNbrState, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {10, 1, 6}},
+ {ospfNbrEvents, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {10, 1, 7}},
+ {ospfNbrLsRetransQLen, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {10, 1, 8}},
+ {ospfNbmaNbrStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {10, 1, 9}},
+ {ospfNbmaNbrPermanence, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {10, 1, 10}},
+ {ospfVirtNbrArea, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {11, 1, 1}},
+ {ospfVirtNbrRtrId, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {11, 1, 2}},
+ {ospfVirtNbrIpAddr, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {11, 1, 3}},
+ {ospfVirtNbrOptions, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {11, 1, 4}},
+ {ospfVirtNbrState, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {11, 1, 5}},
+ {ospfVirtNbrEvents, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {11, 1, 6}},
+ {ospfVirtNbrLsRetransQLen, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {11, 1, 7}},
+ {ospfExtLsdbType, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {12, 1, 1}},
+ {ospfExtLsdbLsid, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {12, 1, 2}},
+ {ospfExtLsdbRouterId, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {12, 1, 3}},
+ {ospfExtLsdbSequence, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {12, 1, 4}},
+ {ospfExtLsdbAge, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {12, 1, 5}},
+ {ospfExtLsdbChecksum, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {12, 1, 6}},
+ {ospfExtLsdbAdvertisement, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {12, 1, 7}},
+ {ospfAreaAggregateAreaID, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {14, 1, 1}},
+ {ospfAreaAggregateLsdbType, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {14, 1, 2}},
+ {ospfAreaAggregateNet, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_ospf, 3, {14, 1, 3}},
+ {ospfAreaAggregateMask, ASN_IPADDRESS, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {14, 1, 4}},
+ {ospfAreaAggregateStatus, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {14, 1, 5}},
+ {ospfAreaAggregateEffect, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_ospf, 3, {14, 1, 6}}
+};
+
+oid ospf_variables_oid[] = { NETSNMP_MIB2_OID, 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/agent/mibgroup/smux/snmp_ospf.h b/agent/mibgroup/smux/snmp_ospf.h
new file mode 100644
index 0000000..4cb50f6
--- /dev/null
+++ b/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/agent/mibgroup/smux/snmp_rip2.c b/agent/mibgroup/smux/snmp_rip2.c
new file mode 100644
index 0000000..b987a09
--- /dev/null
+++ b/agent/mibgroup/smux/snmp_rip2.c
@@ -0,0 +1,206 @@
+/*
+ * $Id$
+ */
+
+/*
+ * 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, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 2, {1, 1}},
+ {RIP2GLOBALQUERIES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 2, {1, 2}},
+ {RIP2IFSTATADDRESS, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {2, 1, 1}},
+ {RIP2IFSTATRCVBADPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {2, 1, 2}},
+ {RIP2IFSTATRCVBADROUTES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {2, 1, 3}},
+ {RIP2IFSTATSENTUPDATES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {2, 1, 4}},
+ {RIP2IFSTATSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_rip2, 3, {2, 1, 5}},
+ {RIP2IFCONFADDRESS, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {3, 1, 1}},
+ {RIP2IFCONFDOMAIN, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_rip2, 3, {3, 1, 2}},
+ {RIP2IFCONFAUTHTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_rip2, 3, {3, 1, 3}},
+ {RIP2IFCONFAUTHKEY, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_rip2, 3, {3, 1, 4}},
+ {RIP2IFCONFSEND, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_rip2, 3, {3, 1, 5}},
+ {RIP2IFCONFRECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_rip2, 3, {3, 1, 6}},
+ {RIP2IFCONFDEFAULTMETRIC, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_rip2, 3, {3, 1, 7}},
+ {RIP2IFCONFSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_rip2, 3, {3, 1, 8}},
+ {RIP2IFCONFSRCADDRESS, ASN_IPADDRESS, NETSNMP_OLDAPI_RWRITE,
+ var_rip2, 3, {3, 1, 9}},
+ {RIP2PEERADDRESS, ASN_IPADDRESS, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {4, 1, 1}},
+ {RIP2PEERDOMAIN, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {4, 1, 2}},
+ {RIP2PEERLASTUPDATE, ASN_TIMETICKS, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {4, 1, 3}},
+ {RIP2PEERVERSION, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {4, 1, 4}},
+ {RIP2PEERRCVBADPKTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {4, 1, 5}},
+ {RIP2PEERRCVBADROUTES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_rip2, 3, {4, 1, 6}}
+};
+
+oid rip2_variables_oid[] = { NETSNMP_MIB2_OID, 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/agent/mibgroup/smux/snmp_rip2.h b/agent/mibgroup/smux/snmp_rip2.h
new file mode 100644
index 0000000..99652a0
--- /dev/null
+++ b/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/agent/mibgroup/smux_gated.h b/agent/mibgroup/smux_gated.h
new file mode 100644
index 0000000..60de796
--- /dev/null
+++ b/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/agent/mibgroup/snmp-notification-mib.h b/agent/mibgroup/snmp-notification-mib.h
new file mode 100644
index 0000000..1fb84f7
--- /dev/null
+++ b/agent/mibgroup/snmp-notification-mib.h
@@ -0,0 +1,2 @@
+config_require(notification/snmpNotifyTable)
+config_require(snmp-notification-mib/snmpNotifyFilterTable)
diff --git a/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h
new file mode 100644
index 0000000..f9b6173
--- /dev/null
+++ b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h
@@ -0,0 +1 @@
+config_require(snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable)
diff --git a/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c
new file mode 100644
index 0000000..d1c575f
--- /dev/null
+++ b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c
@@ -0,0 +1,1933 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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-features.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"
+
+netsnmp_feature_require(check_storage_transition)
+
+const oid snmpNotifyFilterTable_oid[] =
+ { SNMPNOTIFYFILTERTABLE_OID };
+const int snmpNotifyFilterTable_oid_size =
+OID_LENGTH(snmpNotifyFilterTable_oid);
+
+snmpNotifyFilterTable_registration snmpNotifyFilterTable_user_context;
+static snmpNotifyFilterTable_registration *snmpNotifyFilterTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ snmpNotifyFilterTable_user_context_p =
+ 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
+ (snmpNotifyFilterTable_user_context_p, flags);
+} /* initialize_table_snmpNotifyFilterTable */
+
+/**
+ * Shutdown the table snmpNotifyFilterTable
+ */
+void
+shutdown_table_snmpNotifyFilterTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _snmpNotifyFilterTable_shutdown_interface
+ (snmpNotifyFilterTable_user_context_p);
+ netsnmp_free_all_list_data(snmpNotifyFilterTable_user_context_p);
+ snmpNotifyFilterTable_user_context_p = NULL;
+}
+
+/**
+ * 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) {
+ /*
+ * notify library to save changed rows
+ */
+ snmp_store_needed(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) = (char*)
+ 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/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
new file mode 100644
index 0000000..3ff2f94
--- /dev/null
+++ b/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$
+ */
+#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 const oid snmpNotifyFilterTable_oid[];
+ extern const 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/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
new file mode 100644
index 0000000..f0c0e60
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c
new file mode 100644
index 0000000..942a865
--- /dev/null
+++ b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c
@@ -0,0 +1,591 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(snmpNotifyFilterTable_container_get)
+
+/** @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 %" NETSNMP_PRIz "u 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;
+ size_t 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 = (struct vacm_viewEntry*)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/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
new file mode 100644
index 0000000..4615db4
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
new file mode 100644
index 0000000..ed3beaa
--- /dev/null
+++ b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
@@ -0,0 +1,2464 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(snmpNotifyFilterTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(table_container_row_insert)
+netsnmp_feature_require(check_all_requests_error)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_type_and_max_size)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+
+netsnmp_feature_child_of(snmpNotifyFilterTable_container_size, snmpNotifyFilterTable_external_access)
+netsnmp_feature_child_of(snmpNotifyFilterTable_registration_set, snmpNotifyFilterTable_external_access)
+netsnmp_feature_child_of(snmpNotifyFilterTable_registration_get, snmpNotifyFilterTable_external_access)
+netsnmp_feature_child_of(snmpNotifyFilterTable_container_get, snmpNotifyFilterTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_CONTAINER_GET
+netsnmp_container *
+snmpNotifyFilterTable_container_get(void)
+{
+ return snmpNotifyFilterTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_REGISTRATION_GET
+snmpNotifyFilterTable_registration *
+snmpNotifyFilterTable_registration_get(void)
+{
+ return snmpNotifyFilterTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_REGISTRATION_SET
+snmpNotifyFilterTable_registration *
+snmpNotifyFilterTable_registration_set(snmpNotifyFilterTable_registration *
+ newreg)
+{
+ snmpNotifyFilterTable_registration *old =
+ snmpNotifyFilterTable_if_ctx.user_ctx;
+ snmpNotifyFilterTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_CONTAINER_SIZE
+int
+snmpNotifyFilterTable_container_size(void)
+{
+ return CONTAINER_SIZE(snmpNotifyFilterTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_CONTAINER_SIZE */
+
+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;
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+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);
+#endif
+
+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 retrieval.
+ */
+ 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;
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /*
+ * 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ /*************************************************
+ *
+ * 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
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ | HANDLER_CAN_RWRITE
+#endif
+ );
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 */
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+/***********************************************************************
+ *
+ * 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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 = (snmpNotifyFilterTable_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 */
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+/***********************************************************************
+ *
+ * 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)
+{
+ netsnmp_container **container_p;
+ int rc;
+
+ register_config_handler(NULL, row_token,
+ _snmpNotifyFilterTable_container_row_restore,
+ NULL, NULL);
+ memdup((u_char **)&container_p, &container, sizeof(container));
+ netsnmp_assert(container_p);
+ rc = snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_STORE_DATA,
+ _snmpNotifyFilterTable_container_save_rows,
+ container_p);
+
+ 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 %" NETSNMP_PRIz "u 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, remember to add space for the identifier and separator
+ * 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((unsigned char)(*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,
+ (u_char *) 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;
+}
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_EXTERNAL_ACCESS
+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 = (snmpNotifyFilterTable_rowreq_ctx*)
+ CONTAINER_FIND(snmpNotifyFilterTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMPNOTIFYFILTERTABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h b/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
new file mode 100644
index 0000000..eb2da8a
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/snmp-usm-dh-objects-mib.h b/agent/mibgroup/snmp-usm-dh-objects-mib.h
new file mode 100644
index 0000000..3aacf43
--- /dev/null
+++ b/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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters.h
new file mode 100644
index 0000000..c277ab0
--- /dev/null
+++ b/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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c
new file mode 100644
index 0000000..d28225d
--- /dev/null
+++ b/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 **) (void *)&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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.h
new file mode 100644
index 0000000..37ac528
--- /dev/null
+++ b/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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable.h
new file mode 100644
index 0000000..84f2169
--- /dev/null
+++ b/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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c
new file mode 100644
index 0000000..5010197
--- /dev/null
+++ b/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$
+ */
+/** \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"
+
+const oid usmDHUserKeyTable_oid[] = { USMDHUSERKEYTABLE_OID };
+const 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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h
new file mode 100644
index 0000000..b343d78
--- /dev/null
+++ b/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$
+ */
+#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 const oid usmDHUserKeyTable_oid[];
+ extern const 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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c
new file mode 100644
index 0000000..a139c9f
--- /dev/null
+++ b/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$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#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", (int)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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h
new file mode 100644
index 0000000..ad36670
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c
new file mode 100644
index 0000000..427d26f
--- /dev/null
+++ b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c
@@ -0,0 +1,614 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.20 $ of : mfd-data-get.m2c,v $
+ *
+ * $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 <openssl/dh.h>
+
+/*
+ * include our parent header
+ */
+#define NEED_USMDH_FUNCTIONS
+#include "usmDHUserKeyTable.h"
+#include "snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.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,
+ u_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: %p %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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h
new file mode 100644
index 0000000..83c028e
--- /dev/null
+++ b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h
@@ -0,0 +1,109 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.20 $ of : mfd-data-get.m2c,v $
+ *
+ * $Id$
+ *
+ * @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,
+ u_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,
+ u_char
+ **usmDHUserAuthKeyChange_val_ptr_ptr,
+ size_t
+ *usmDHUserAuthKeyChange_val_ptr_len_ptr);
+ int
+ usmDHUserOwnAuthKeyChange_get(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx,
+ u_char
+ **usmDHUserOwnAuthKeyChange_val_ptr_ptr,
+ size_t
+ *usmDHUserOwnAuthKeyChange_val_ptr_len_ptr);
+ int usmDHUserPrivKeyChange_get(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx,
+ u_char
+ **usmDHUserPrivKeyChange_val_ptr_ptr,
+ size_t
+ *usmDHUserPrivKeyChange_val_ptr_len_ptr);
+ int
+ usmDHUserOwnPrivKeyChange_get(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx,
+ u_char
+ **usmDHUserOwnPrivKeyChange_val_ptr_ptr,
+ size_t
+ *usmDHUserOwnPrivKeyChange_val_ptr_len_ptr);
+
+
+ int
+ usmDHUserKeyTable_indexes_set_tbl_idx(usmDHUserKeyTable_mib_index *
+ tbl_idx,
+ u_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,
+ u_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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c
new file mode 100644
index 0000000..8536105
--- /dev/null
+++ b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c
@@ -0,0 +1,1280 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.19 $ of : mfd-data-set.m2c,v $
+ *
+ * $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 <openssl/dh.h>
+
+/*
+ * include our parent header
+ */
+#define NEED_USMDH_FUNCTIONS
+#include "usmDHUserKeyTable.h"
+
+int
+usmDHUserCheckValue(struct usmUser *user, int for_auth_key,
+ u_char *val, size_t val_len)
+{
+ /*
+ * The set value must be composed of 2 parts, the first being the
+ * current value
+ */
+ u_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,
+ u_char *val, size_t val_len)
+{
+ DH *dh;
+ BIGNUM *other_pub;
+ u_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;
+
+ 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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h
new file mode 100644
index 0000000..e7c7059
--- /dev/null
+++ b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h
@@ -0,0 +1,146 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.19 $ of : mfd-data-set.m2c,v $
+ *
+ * $Id$
+ */
+#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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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,
+ u_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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_doxygen.conf b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_doxygen.conf
new file mode 100644
index 0000000..93d7ef1
--- /dev/null
+++ b/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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h
new file mode 100644
index 0000000..0719a6d
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
new file mode 100644
index 0000000..04231f9
--- /dev/null
+++ b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
@@ -0,0 +1,1788 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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;
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+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);
+#endif
+
+/**
+ * @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 retrieval.
+ */
+ 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;
+
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ /*
+ * 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;
+#endif
+
+ /*************************************************
+ *
+ * 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
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ | HANDLER_CAN_RWRITE
+#endif
+ );
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+ 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->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;
+#endif
+
+ 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,
+ &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,
+ &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,
+ &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,
+ &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 */
+
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+/***********************************************************************
+ *
+ * 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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 */
+#endif
+
+/***********************************************************************
+ *
+ * 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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h
new file mode 100644
index 0000000..d544234
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h
new file mode 100644
index 0000000..31ec527
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/snmpv3/snmpEngine.c b/agent/mibgroup/snmpv3/snmpEngine.c
new file mode 100644
index 0000000..e756788
--- /dev/null
+++ b/agent/mibgroup/snmpv3/snmpEngine.c
@@ -0,0 +1,246 @@
+/*
+ * snmpEngine.c: implement's the SNMP-FRAMEWORK-MIB.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/sysORTable.h>
+
+#include "util_funcs/header_generic.h"
+#include "snmpEngine.h"
+
+netsnmp_feature_child_of(snmpengine_all, libnetsnmpmibs)
+
+netsnmp_feature_child_of(register_snmpEngine_scalars_context, snmpengine_all)
+
+struct variable2 snmpEngine_variables[] = {
+ {SNMPENGINEID, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_snmpEngine, 1, {1}},
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ {SNMPENGINEBOOTS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpEngine, 1, {2}},
+ {SNMPENGINETIME, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpEngine, 1, {3}},
+#else /* !NETSNMP_ENABLE_TESTING_CODE */
+ {SNMPENGINEBOOTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_snmpEngine, 1, {2}},
+ {SNMPENGINETIME, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_snmpEngine, 1, {3}},
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ {SNMPENGINEBOOTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_snmpEngine, 1, {2}},
+ {SNMPENGINETIME, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_snmpEngine, 1, {3}},
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ {SNMPENGINEMAXMESSAGESIZE, ASN_INTEGER, NETSNMP_OLDAPI_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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_REGISTER_SNMPENGINE_SCALARS_CONTEXT
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REGISTER_SNMPENGINE_SCALARS_CONTEXT */
+
+void
+init_snmpEngine(void)
+{
+ oid reg[] = { 1, 3, 6, 1, 6, 3, 10, 3, 1, 1 };
+ REGISTER_SYSOR_ENTRY(reg, "The SNMP Management Architecture MIB.");
+ register_snmpEngine_scalars();
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#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 */
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+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 = (WriteMethod*)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 NULL;
+
+ /*
+ * 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:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ *write_method = write_engineBoots;
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ long_ret = snmpv3_local_snmpEngineBoots();
+ return (unsigned char *) &long_ret;
+
+ case SNMPENGINETIME:
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ *write_method = write_engineTime;
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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 NULL;
+}
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#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 */
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
diff --git a/agent/mibgroup/snmpv3/snmpEngine.h b/agent/mibgroup/snmpv3/snmpEngine.h
new file mode 100644
index 0000000..b62a220
--- /dev/null
+++ b/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 from the util_funcs module
+ */
+
+config_require(util_funcs/header_generic)
+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/agent/mibgroup/snmpv3/snmpMPDStats.c b/agent/mibgroup/snmpv3/snmpMPDStats.c
new file mode 100644
index 0000000..ae792df
--- /dev/null
+++ b/agent/mibgroup/snmpv3/snmpMPDStats.c
@@ -0,0 +1,69 @@
+/*
+ * snmpMPDStats.c: tallies errors for SNMPv3 message processing.
+ */
+
+#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/sysORTable.h>
+
+#include "snmpMPDStats.h"
+#include "util_funcs/header_generic.h"
+
+
+struct variable2 snmpMPDStats_variables[] = {
+ {SNMPUNKNOWNSECURITYMODELS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_snmpMPDStats, 1, {1}},
+ {SNMPINVALIDMSGS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_snmpMPDStats, 1, {2}},
+ {SNMPUNKNOWNPDUHANDLERS, ASN_COUNTER, NETSNMP_OLDAPI_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)
+{
+ static oid reg[] = { 1, 3, 6, 1, 6, 3, 11, 3, 1, 1 };
+ REGISTER_SYSOR_ENTRY(reg,
+ "The MIB for Message Processing and Dispatching.");
+ 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/agent/mibgroup/snmpv3/snmpMPDStats.h b/agent/mibgroup/snmpv3/snmpMPDStats.h
new file mode 100644
index 0000000..41eab1d
--- /dev/null
+++ b/agent/mibgroup/snmpv3/snmpMPDStats.h
@@ -0,0 +1,30 @@
+
+/*
+ * 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 from the util_funcs module
+ */
+
+config_require(util_funcs/header_generic)
+config_exclude(snmpv3/snmpMPDStats_5_5)
+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/agent/mibgroup/snmpv3/snmpMPDStats_5_5.c b/agent/mibgroup/snmpv3/snmpMPDStats_5_5.c
new file mode 100644
index 0000000..a7fc2ce
--- /dev/null
+++ b/agent/mibgroup/snmpv3/snmpMPDStats_5_5.c
@@ -0,0 +1,51 @@
+/*
+ * snmpMPDStats.c: tallies errors for SNMPv3 message processing.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/sysORTable.h>
+
+#include "snmpMPDStats_5_5.h"
+
+#include <net-snmp/agent/snmp_get_statistic.h>
+
+#define snmpMPDMIB 1, 3, 6, 1, 6, 3, 11
+#define snmpMPDMIBObjects snmpMPDMIB, 2
+#define snmpMPDMIBCompliances snmpMPDMIB, 3, 1
+
+netsnmp_feature_require(helper_statistics)
+
+static oid snmpMPDStats[] = { snmpMPDMIBObjects, 1 };
+
+static netsnmp_handler_registration* snmpMPDStats_reg = NULL;
+static oid snmpMPDCompliance[] = { snmpMPDMIBCompliances, 1 };
+
+void
+init_snmpMPDStats_5_5(void)
+{
+ netsnmp_handler_registration* s =
+ netsnmp_create_handler_registration(
+ "snmpMPDStats", NULL, snmpMPDStats, OID_LENGTH(snmpMPDStats),
+ HANDLER_CAN_RONLY);
+ if (s &&
+ NETSNMP_REGISTER_STATISTIC_HANDLER(s, 1, MPD) == MIB_REGISTERED_OK) {
+ REGISTER_SYSOR_ENTRY(snmpMPDCompliance,
+ "The MIB for Message Processing and Dispatching.");
+ snmpMPDStats_reg = s;
+ }
+}
+
+void
+shutdown_snmpMPDStats_5_5(void)
+{
+ UNREGISTER_SYSOR_ENTRY(snmpMPDCompliance);
+ if (snmpMPDStats_reg) {
+ netsnmp_unregister_handler(snmpMPDStats_reg);
+ snmpMPDStats_reg = NULL;
+ }
+}
diff --git a/agent/mibgroup/snmpv3/snmpMPDStats_5_5.h b/agent/mibgroup/snmpv3/snmpMPDStats_5_5.h
new file mode 100644
index 0000000..78f3dff
--- /dev/null
+++ b/agent/mibgroup/snmpv3/snmpMPDStats_5_5.h
@@ -0,0 +1,10 @@
+#ifndef _MIBGROUP_SNMPMPDSTATS_H
+#define _MIBGROUP_SNMPMPDSTATS_H
+
+config_exclude(snmpv3/snmpMPDStats)
+config_add_mib(SNMP-MPD-MIB)
+
+void init_snmpMPDStats_5_5(void);
+void shutdown_snmpMPDStats_5_5(void);
+
+#endif /* _MIBGROUP_SNMPMPDSTATS_H */
diff --git a/agent/mibgroup/snmpv3/usmConf.c b/agent/mibgroup/snmpv3/usmConf.c
new file mode 100644
index 0000000..20bcff9
--- /dev/null
+++ b/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/agent/mibgroup/snmpv3/usmConf.h b/agent/mibgroup/snmpv3/usmConf.h
new file mode 100644
index 0000000..d27f12e
--- /dev/null
+++ b/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/agent/mibgroup/snmpv3/usmStats.c b/agent/mibgroup/snmpv3/usmStats.c
new file mode 100644
index 0000000..718e071
--- /dev/null
+++ b/agent/mibgroup/snmpv3/usmStats.c
@@ -0,0 +1,76 @@
+
+/*
+ * usmStats.c: implements the usmStats portion of the SNMP-USER-BASED-SM-MIB
+ */
+
+#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/sysORTable.h>
+
+#include "util_funcs/header_generic.h"
+#include "usmStats.h"
+
+struct variable2 usmStats_variables[] = {
+ {USMSTATSUNSUPPORTEDSECLEVELS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_usmStats, 1, {1}},
+ {USMSTATSNOTINTIMEWINDOWS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_usmStats, 1, {2}},
+ {USMSTATSUNKNOWNUSERNAMES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_usmStats, 1, {3}},
+ {USMSTATSUNKNOWNENGINEIDS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_usmStats, 1, {4}},
+ {USMSTATSWRONGDIGESTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_usmStats, 1, {5}},
+ {USMSTATSDECRYPTIONERRORS, ASN_COUNTER, NETSNMP_OLDAPI_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)
+{
+ static oid reg[] = { 1, 3, 6, 1, 6, 3, 15, 2, 1, 1 };
+ REGISTER_SYSOR_ENTRY(reg,
+ "The management information definitions for the "
+ "SNMP User-based Security Model.");
+ 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/agent/mibgroup/snmpv3/usmStats.h b/agent/mibgroup/snmpv3/usmStats.h
new file mode 100644
index 0000000..5685381
--- /dev/null
+++ b/agent/mibgroup/snmpv3/usmStats.h
@@ -0,0 +1,35 @@
+/*
+ * 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 from the util_funcs module
+ */
+
+config_require(util_funcs/header_generic)
+config_exclude(snmpv3/usmStats_5_5)
+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/agent/mibgroup/snmpv3/usmStats_5_5.c b/agent/mibgroup/snmpv3/usmStats_5_5.c
new file mode 100644
index 0000000..bcd04e1
--- /dev/null
+++ b/agent/mibgroup/snmpv3/usmStats_5_5.c
@@ -0,0 +1,51 @@
+/*
+ * usmStats.c: implements the usmStats portion of the SNMP-USER-BASED-SM-MIB
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/sysORTable.h>
+
+#include "usmStats_5_5.h"
+
+#include <net-snmp/agent/snmp_get_statistic.h>
+
+#define snmpUsmMIB 1, 3, 6, 1, 6, 3, 15
+#define usmMIBCompliances snmpUsmMIB, 2, 1
+
+static oid usmStats[] = { snmpUsmMIB, 1, 1 };
+
+static netsnmp_handler_registration* usmStats_reg = NULL;
+static oid usmMIBCompliance[] = { usmMIBCompliances, 1 };
+
+netsnmp_feature_require(helper_statistics)
+
+void
+init_usmStats_5_5(void)
+{
+ netsnmp_handler_registration* s =
+ netsnmp_create_handler_registration(
+ "usmStats", NULL, usmStats, OID_LENGTH(usmStats),
+ HANDLER_CAN_RONLY);
+ if (s &&
+ NETSNMP_REGISTER_STATISTIC_HANDLER(s, 1, USM) == MIB_REGISTERED_OK) {
+ REGISTER_SYSOR_ENTRY(usmMIBCompliance,
+ "The management information definitions for the "
+ "SNMP User-based Security Model.");
+ usmStats_reg = s;
+ }
+}
+
+void
+shutdown_usmStats_5_5(void)
+{
+ UNREGISTER_SYSOR_ENTRY(usmMIBCompliance);
+ if (usmStats_reg) {
+ netsnmp_unregister_handler(usmStats_reg);
+ usmStats_reg = NULL;
+ }
+}
diff --git a/agent/mibgroup/snmpv3/usmStats_5_5.h b/agent/mibgroup/snmpv3/usmStats_5_5.h
new file mode 100644
index 0000000..d30719e
--- /dev/null
+++ b/agent/mibgroup/snmpv3/usmStats_5_5.h
@@ -0,0 +1,10 @@
+#ifndef _MIBGROUP_USMSTATS_H
+#define _MIBGROUP_USMSTATS_H
+
+config_exclude(snmpv3/usmStats)
+config_add_mib(SNMP-USER-BASED-SM-MIB)
+
+void init_usmStats_5_5(void);
+void shutdown_usmStats_5_5(void);
+
+#endif /* _MIBGROUP_USMSTATS_H */
diff --git a/agent/mibgroup/snmpv3/usmUser.c b/agent/mibgroup/snmpv3/usmUser.c
new file mode 100644
index 0000000..41c525a
--- /dev/null
+++ b/agent/mibgroup/snmpv3/usmUser.c
@@ -0,0 +1,1608 @@
+/*
+ * usmUser.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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 "util_funcs/header_generic.h"
+#include "usmUser.h"
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+int usmStatusCheck(struct usmUser *uptr);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+netsnmp_feature_child_of(usmuser_all, libnetsnmpmibs)
+netsnmp_feature_child_of(init_register_usmuser_context, usmuser_all)
+
+struct variable4 usmUser_variables[] = {
+ {USMUSERSPINLOCK, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 1, {1}},
+ {USMUSERSECURITYNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_usmUser, 3, {2, 1, 3}},
+ {USMUSERCLONEFROM, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 3, {2, 1, 4}},
+ {USMUSERAUTHPROTOCOL, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 3, {2, 1, 5}},
+ {USMUSERAUTHKEYCHANGE, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 3, {2, 1, 6}},
+ {USMUSEROWNAUTHKEYCHANGE, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 3, {2, 1, 7}},
+ {USMUSERPRIVPROTOCOL, ASN_OBJECT_ID, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 3, {2, 1, 8}},
+ {USMUSERPRIVKEYCHANGE, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 3, {2, 1, 9}},
+ {USMUSEROWNPRIVKEYCHANGE, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 3, {2, 1, 10}},
+ {USMUSERPUBLIC, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 3, {2, 1, 11}},
+ {USMUSERSTORAGETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_usmUser, 3, {2, 1, 12}},
+ {USMUSERSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_INIT_REGISTER_USMUSER_CONTEXT
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INIT_REGISTER_USMUSER_CONTEXT */
+
+/*******************************************************************-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;
+ 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;
+
+ /* assume it isnt writable for the time being */
+ *write_method = (WriteMethod*)0;
+
+ /* assume an integer and change later if not */
+ *var_len = sizeof(long_ret);
+
+ 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 NULL;
+ }
+ 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(), uptr = NULL;
+ nptr != NULL; 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 NULL;
+ } /* endif -- vp->magic != USMUSERSPINLOCK */
+
+ switch (vp->magic) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 = uptr->userPublicStringLen;
+ 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));
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ DEBUGMSGTL(("snmpd", "no write support for var_usmUser\n"));
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return NULL;
+
+} /* end var_usmUser() */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+
+/*
+ * 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);
+ } 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);
+ } 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);
+ } 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);
+ } 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 > 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);
+ if (uptr->userPublicString == NULL) {
+ return SNMP_ERR_GENERR;
+ }
+ memcpy(uptr->userPublicString, var_val, var_val_len);
+ uptr->userPublicStringLen = var_val_len;
+ DEBUGMSG(("usmUser", "setting public string: %d - ", (int)var_val_len));
+ DEBUGMSGHEX(("usmUser", uptr->userPublicString, var_val_len));
+ DEBUGMSG(("usmUser", "\n"));
+ }
+ 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 %ld 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;
+} /* write_usmUserStatus */
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+#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/agent/mibgroup/snmpv3/usmUser.h b/agent/mibgroup/snmpv3/usmUser.h
new file mode 100644
index 0000000..53d1412
--- /dev/null
+++ b/agent/mibgroup/snmpv3/usmUser.h
@@ -0,0 +1,69 @@
+/*
+ * 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 from the util_funcs module
+ */
+
+config_require(util_funcs/header_generic)
+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);
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 /* !NETSNMP_NO_WRITE_SUPPORT */
+
+#endif /* _MIBGROUP_USMUSER_H */
diff --git a/agent/mibgroup/snmpv3mibs.h b/agent/mibgroup/snmpv3mibs.h
new file mode 100644
index 0000000..0cca9a3
--- /dev/null
+++ b/agent/mibgroup/snmpv3mibs.h
@@ -0,0 +1,16 @@
+#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_version_require((snmpv3/snmpMPDStats, 5.5, snmpv3/snmpMPDStats_5_5))
+#ifdef NETSNMP_SECMOD_USM
+config_version_require((snmpv3/usmStats, 5.5, snmpv3/usmStats_5_5))
+config_require(snmpv3/usmConf)
+config_require(snmpv3/usmUser)
+#endif /* NETSNMP_SECMOD_USM */
+#endif /* SNMPV3MIBS_H */
diff --git a/agent/mibgroup/struct.h b/agent/mibgroup/struct.h
new file mode 100644
index 0000000..d025ed0
--- /dev/null
+++ b/agent/mibgroup/struct.h
@@ -0,0 +1,46 @@
+#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;
+ oid miboid[MIBMAX];
+ size_t miblen;
+ int mibpriority;
+ netsnmp_pid_t pid;
+#if defined(WIN32)
+ HANDLE tid; /* WIN32 thread */
+#endif
+};
+
+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/agent/mibgroup/target.h b/agent/mibgroup/target.h
new file mode 100644
index 0000000..58c5b4b
--- /dev/null
+++ b/agent/mibgroup/target.h
@@ -0,0 +1,5 @@
+config_require(target/snmpTargetAddrEntry)
+config_require(target/snmpTargetParamsEntry)
+config_require(target/target)
+config_version_require((target/target_counters, 5.5, target/target_counters_5_5))
+config_add_mib(SNMP-TARGET-MIB)
diff --git a/agent/mibgroup/target/snmpTargetAddrEntry.c b/agent/mibgroup/target/snmpTargetAddrEntry.c
new file mode 100644
index 0000000..a77b467
--- /dev/null
+++ b/agent/mibgroup/target/snmpTargetAddrEntry.c
@@ -0,0 +1,1704 @@
+/*
+ * 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>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "snmpTargetAddrEntry.h"
+#include "util_funcs/header_generic.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 = NULL;
+
+
+/*
+ * 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 = NULL;
+
+ newEntry->tDomainLen = 0;
+ newEntry->tAddress = NULL;
+
+ newEntry->timeout = 1500;
+ newEntry->retryCount = 3;
+
+ newEntry->tagList = strdup("");
+ newEntry->params = NULL;
+
+ newEntry->storageType = SNMP_STORAGE_NONVOLATILE;
+ newEntry->rowStatus = SNMP_ROW_NONEXISTENT;
+ newEntry->sess = (netsnmp_session *) NULL;
+ newEntry->next = NULL;
+ }
+
+ return newEntry;
+} /* snmpTargetAddrTable_create */
+
+
+/*
+ * TargetAddrTable_dispose frees the space allocated to a
+ * targetAddrTable_struct
+ */
+void
+snmpTargetAddrTable_dispose(struct targetAddrTable_struct *reaped)
+{
+ if (reaped->sess)
+ snmp_close(reaped->sess);
+ else
+ SNMP_FREE(reaped->tAddress);
+ SNMP_FREE(reaped->name);
+ 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) == NULL) {
+ *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 != NULL) {
+ 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) == NULL)
+ return;
+ else if (tptr == oldEntry) {
+ *listPtr = (*listPtr)->next;
+ snmpTargetAddrTable_dispose(tptr);
+ return;
+ } else {
+ while (tptr->next != NULL) {
+ 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 != NULL;
+ 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 NULL;
+} /* 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 == NULL) ||
+ (entry->params == NULL))
+ 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, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRTDOMAINCOLUMN}},
+ {SNMPTARGETADDRTADDRESS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRTADDRESSCOLUMN}},
+ {SNMPTARGETADDRTIMEOUT, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRTIMEOUTCOLUMN}},
+ {SNMPTARGETADDRRETRYCOUNT, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRRETRYCOUNTCOLUMN}},
+ {SNMPTARGETADDRTAGLIST, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRTAGLISTCOLUMN}},
+ {SNMPTARGETADDRPARAMS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRPARAMSCOLUMN}},
+ {SNMPTARGETADDRSTORAGETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRSTORAGETYPECOLUMN}},
+ {SNMPTARGETADDRROWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRROWSTATUSCOLUMN}},
+
+};
+
+struct variable2 snmpTargetSpinLock_var[] = {
+ {SNMPTARGETSPINLOCK, ASN_INTEGER, NETSNMP_OLDAPI_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 = NULL;
+ 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,
+ (void (*)(void))0, NULL);
+
+ /*
+ * we need to be called back later
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_snmpTargetAddrEntry, NULL);
+
+} /* init_snmpTargetAddrEntry */
+
+void
+shutdown_snmpTargetAddrEntry(void)
+{
+ struct targetAddrTable_struct *ptr;
+ struct targetAddrTable_struct *next;
+
+ for (ptr = aAddrTable; ptr; ptr = next) {
+ next = ptr->next;
+ snmpTargetAddrTable_dispose(ptr);
+ }
+ aAddrTable = NULL;
+
+ snmp_unregister_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_snmpTargetAddrEntry, NULL, FALSE);
+}
+
+int
+snmpTargetAddr_addName(struct targetAddrTable_struct *entry, char *cptr)
+{
+ size_t len;
+ if (cptr == NULL) {
+ 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 = strdup(cptr);
+ }
+ return (1);
+} /* addName */
+
+
+int
+snmpTargetAddr_addTDomain(struct targetAddrTable_struct *entry, char *cptr)
+{
+ size_t len = 128;
+
+ if (cptr == NULL) {
+ 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 == NULL) {
+ 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 == NULL) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetParamsEntry: no Timeout in config string\n"));
+ return (0);
+ } else if (!(isdigit((unsigned char)(*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 == NULL) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetParamsEntry: no Retry Count in config string\n"));
+ return (0);
+ } else if (!(isdigit((unsigned char)(*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)
+{
+ if (cptr == NULL) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no tag list in config string\n"));
+ return (0);
+ } else {
+ size_t len = strlen(cptr);
+ /*
+ * spec check for string 0-255
+ */
+ if (len > 255) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: tag list out of range in config string\n"));
+ return (0);
+ }
+ SNMP_FREE(entry->tagList);
+ entry->tagList = strdup(cptr);
+ }
+ return (1);
+} /* snmpTargetAddr_addTagList */
+
+
+int
+snmpTargetAddr_addParams(struct targetAddrTable_struct *entry, char *cptr)
+{
+ size_t len;
+ if (cptr == NULL) {
+ 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 = strdup(cptr);
+ }
+ return (1);
+} /* snmpTargetAddr_addParams */
+
+
+int
+snmpTargetAddr_addStorageType(struct targetAddrTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == NULL) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no storage type in config "
+ "string\n"));
+ return (0);
+ } else if (!(isdigit((unsigned char)(*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)) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "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));
+ return (0);
+ }
+ return (1);
+} /* snmpTargetAddr_addStorageType */
+
+
+int
+snmpTargetAddr_addRowStatus(struct targetAddrTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == NULL) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no Row Status in config "
+ "string\n"));
+ return (0);
+ } else if (!(isdigit((unsigned char)(*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)) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "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));
+ 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", "%s", 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) != NULL) {
+ while (curr_struct != NULL) {
+ 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;
+ }
+ strlcat(line, " ", sizeof(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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ *write_method = NULL;
+ }
+
+ /* assume an integer and change later if not */
+ *var_len = sizeof(long_ret);
+
+ /*
+ * look for OID in current table
+ */
+ if ((temp_struct = search_snmpTargetAddrTable(vp->name, vp->namelen,
+ name, length,
+ exact)) == NULL) {
+ return NULL;
+ }
+
+ /*
+ * 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 NULL;
+ } 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 == NULL)
+ return NULL;
+ *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) {
+ strlcpy(string, temp_struct->tagList, sizeof(string));
+ *var_len = strlen(string);
+ return (unsigned char *) string;
+ } else {
+ return NULL;
+ }
+
+ case SNMPTARGETADDRPARAMS:
+ if (temp_struct->params == NULL)
+ return NULL;
+ strlcpy(string, temp_struct->params, sizeof(string));
+ *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 NULL;
+} /* var_snmpTargetAddrEntry */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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)) == NULL) {
+ 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)) == NULL) {
+ 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 = (char *) 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 = (u_char *) 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)) == NULL) {
+ 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)) != NULL) {
+ 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((char *) 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)) == NULL) {
+ 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 = 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(long)) {
+ 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",
+ (int)(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;
+ }
+ }
+ }
+ snmp_store_needed(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;
+}
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_targetSpinLock;
+#else
+ *write_method = NULL;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ return NULL;
+ }
+ if (vp->magic == SNMPTARGETSPINLOCK) {
+ *var_len = sizeof(unsigned long);
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ *write_method = write_targetSpinLock;
+#else
+ *write_method = NULL;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ return (u_char *) & (snmpTargetSpinLock);
+ }
+ return NULL;
+}
diff --git a/agent/mibgroup/target/snmpTargetAddrEntry.h b/agent/mibgroup/target/snmpTargetAddrEntry.h
new file mode 100644
index 0000000..790ed66
--- /dev/null
+++ b/agent/mibgroup/target/snmpTargetAddrEntry.h
@@ -0,0 +1,98 @@
+
+/*
+ * 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 from the util_funcs module
+ */
+
+config_require(util_funcs/header_generic)
+
+
+ /*
+ * 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);
+ void shutdown_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 *);
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ WriteMethod write_snmpTargetAddrTDomain;
+ WriteMethod write_snmpTargetAddrTAddress;
+ WriteMethod write_snmpTargetAddrTimeout;
+ WriteMethod write_snmpTargetAddrRetryCount;
+ WriteMethod write_snmpTargetAddrTagList;
+ WriteMethod write_snmpTargetAddrParams;
+ WriteMethod write_snmpTargetAddrStorageType;
+ WriteMethod write_snmpTargetAddrRowStatus;
+
+ WriteMethod write_targetSpinLock;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ FindVarMethod var_targetSpinLock;
+
+#endif /* _MIBGROUP_SNMPTARGETADDRENTRY_H */
diff --git a/agent/mibgroup/target/snmpTargetParamsEntry.c b/agent/mibgroup/target/snmpTargetParamsEntry.c
new file mode 100644
index 0000000..4e1f4e2
--- /dev/null
+++ b/agent/mibgroup/target/snmpTargetParamsEntry.c
@@ -0,0 +1,1407 @@
+/*
+ * 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>
+
+#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 = NULL;
+
+
+/*
+ * 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 = NULL;
+ newEntry->mpModel = -1;
+
+ newEntry->secModel = -1;
+ newEntry->secName = NULL;
+ newEntry->secLevel = -1;
+
+ newEntry->storageType = SNMP_STORAGE_NONVOLATILE;
+ newEntry->rowStatus = SNMP_ROW_NONEXISTENT;
+ newEntry->next = NULL;
+ 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) == NULL) {
+ *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 != NULL) {
+ 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) == NULL)
+ return;
+ else if (tptr == oldEntry) {
+ *listPtr = (*listPtr)->next;
+ snmpTargetParamTable_dispose(tptr);
+ return;
+ } else {
+ while (tptr->next != NULL) {
+ 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 != NULL;
+ 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 NULL;
+} /* 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 == NULL))
+ 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, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSMPMODELCOLUMN}},
+ {SNMPTARGETPARAMSSECURITYMODEL, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSSECURITYMODELCOLUMN}},
+ {SNMPTARGETPARAMSSECURITYNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSSECURITYNAMECOLUMN}},
+ {SNMPTARGETPARAMSSECURITYLEVEL, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSSECURITYLEVELCOLUMN}},
+ {SNMPTARGETPARAMSSTORAGETYPE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSSTORAGETYPECOLUMN}},
+ {SNMPTARGETPARAMSROWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_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 = NULL;
+
+ REGISTER_MIB("target/snmpTargetParamsEntry",
+ snmpTargetParamsEntry_variables, variable2,
+ snmpTargetParamsEntry_variables_oid);
+
+ snmpd_register_config_handler("targetParams",
+ snmpd_parse_config_targetParams,
+ (void (*)(void))0, NULL);
+
+ /*
+ * we need to be called back later
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_snmpTargetParamsEntry, NULL);
+} /* init_snmpTargetParmsEntry */
+
+void
+shutdown_snmpTargetParamsEntry(void)
+{
+ while (aPTable)
+ snmpTargetParamTable_remFromList(aPTable, &aPTable);
+}
+
+
+int
+snmpTargetParams_addParamName(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ size_t len;
+ if (cptr == NULL) {
+ 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 = strdup(cptr);
+ }
+ return (1);
+}
+
+
+int
+snmpTargetParams_addMPModel(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no mp model in config string\n"));
+ return (0);
+ } else if (!(isdigit((unsigned char)(*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 == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no sec model in config string\n"));
+ return (0);
+ } else if (!(isdigit((unsigned char)(*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)
+{
+ if (cptr == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no security name in config string\n"));
+ return (0);
+ } else {
+ entry->secName = strdup(cptr);
+ }
+ return (1);
+} /* snmpTargetParams_addSecName */
+
+
+int
+snmpTargetParams_addSecLevel(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no security level in config string\n"));
+ return (0);
+ } else if (!(isdigit((unsigned char)(*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 == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no storage type in config string\n"));
+ return (0);
+ } else if (!(isdigit((unsigned char)(*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 == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no row status in config string\n"));
+ return (0);
+ } else if (!(isdigit((unsigned char)(*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;
+ }
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "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));
+
+ 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) != NULL) {
+ while (curr_struct != NULL) {
+ 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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ default:
+ *write_method = NULL;
+ }
+
+ /* assume an integer and change later if not */
+ *var_len = sizeof(long_ret);
+
+ /*
+ * look for OID in current table
+ */
+ if ((temp_struct = search_snmpTargetParamsTable(vp->name, vp->namelen,
+ name, length,
+ exact)) == NULL) {
+ return NULL;
+ }
+
+ /*
+ * 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 NULL;
+ 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 NULL;
+ long_ret = temp_struct->secModel;
+ return (unsigned char *) &long_ret;
+
+ case SNMPTARGETPARAMSSECURITYNAME:
+ /*
+ * if unset value, (i.e. new row)
+ */
+ if (temp_struct->secName == NULL)
+ return NULL;
+ /*
+ * 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 NULL;
+ 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 NULL;
+} /* var_snmpTargetParamsEntry */
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+/*
+ * 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 %ld 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) {
+ 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",
+ (int)(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);
+ }
+ }
+ snmp_store_needed(NULL);
+ } 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;
+}
+
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+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/agent/mibgroup/target/snmpTargetParamsEntry.h b/agent/mibgroup/target/snmpTargetParamsEntry.h
new file mode 100644
index 0000000..bd30582
--- /dev/null
+++ b/agent/mibgroup/target/snmpTargetParamsEntry.h
@@ -0,0 +1,75 @@
+
+ /*
+ * 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
+
+ /*
+ * 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);
+ void snmpTargetParamTable_dispose(struct targetParamTable_struct *);
+
+ /*
+ * function definitions
+ */
+
+ void init_snmpTargetParamsEntry(void);
+ void shutdown_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 *);
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ WriteMethod write_snmpTargetParamsMPModel;
+ WriteMethod write_snmpTargetParamsSecModel;
+ WriteMethod write_snmpTargetParamsSecName;
+ WriteMethod write_snmpTargetParamsSecLevel;
+ WriteMethod write_snmpTargetParamsStorageType;
+ WriteMethod write_snmpTargetParamsRowStatus;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+
+#endif /* _MIBGROUP_SNMPTARGETPARAMSENTRY_H */
diff --git a/agent/mibgroup/target/target.c b/agent/mibgroup/target/target.c
new file mode 100644
index 0000000..e6aa07f
--- /dev/null
+++ b/agent/mibgroup/target/target.c
@@ -0,0 +1,302 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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>
+
+#if defined(NETSNMP_TRANSPORT_DTLSUDP_DOMAIN) || defined(NETSNMP_TRANSPORT_TLSTCP_DOMAIN)
+#include <openssl/ssl.h>
+#include <openssl/x509v3.h>
+#include <net-snmp/library/cert_util.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+#include <net-snmp/library/snmpTLSTCPDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+#include <net-snmp/library/snmpDTLSUDPDomain.h>
+#endif
+
+#include "snmpTargetAddrEntry.h"
+#include "snmpTargetParamsEntry.h"
+#include "target.h"
+
+netsnmp_feature_require(tdomain_support)
+netsnmp_feature_require(tdomain_transport_oid)
+netsnmp_feature_want(netsnmp_tlstmAddr_get_serverId)
+
+#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;
+#if defined(NETSNMP_TRANSPORT_DTLSUDP_DOMAIN) || defined(NETSNMP_TRANSPORT_TLSTCP_DOMAIN)
+ int tls = 0;
+#endif
+ 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);
+ }
+ }
+ /*
+ * if tDomain is tls related, check for tls config
+ */
+#ifdef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+ tls = snmp_oid_compare(targaddrs->tDomain,
+ targaddrs->tDomainLen,
+ netsnmpDTLSUDPDomain,
+ netsnmpDTLSUDPDomain_len);
+
+#endif
+#ifdef NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+ if (tls)
+ tls = snmp_oid_compare(targaddrs->tDomain,
+ targaddrs->tDomainLen,
+ netsnmpTLSTCPDomain,
+ netsnmpTLSTCPDomain_len);
+#endif
+#if defined(NETSNMP_TRANSPORT_DTLSUDP_DOMAIN) || defined(NETSNMP_TRANSPORT_TLSTCP_DOMAIN)
+ if (!tls) {
+ netsnmp_cert *cert;
+ char *server_id = NULL;
+
+ DEBUGMSGTL(("target_sessions",
+ " looking up our id: %s\n",
+ targaddrs->params));
+ cert =
+ netsnmp_cert_find(NS_CERT_IDENTITY,
+ NS_CERTKEY_TARGET_PARAM,
+ targaddrs->params);
+ netsnmp_assert(t->f_config);
+ if (cert) {
+ DEBUGMSGTL(("target_sessions",
+ " found fingerprint: %s\n",
+ cert->fingerprint));
+ t->f_config(t, "localCert",
+ cert->fingerprint);
+ }
+ DEBUGMSGTL(("target_sessions",
+ " looking up their id: %s\n",
+ targaddrs->name));
+ cert =
+ netsnmp_cert_find(NS_CERT_REMOTE_PEER,
+ NS_CERTKEY_TARGET_ADDR,
+ targaddrs->name);
+ if (cert) {
+ DEBUGMSGTL(("target_sessions",
+ " found fingerprint: %s\n",
+ cert->fingerprint));
+ t->f_config(t, "peerCert",
+ cert->fingerprint);
+ }
+#ifndef NETSNMP_FEATURE_REMOVE_TLSTMADDR_GET_SERVERID
+ server_id = netsnmp_tlstmAddr_get_serverId(
+ targaddrs->name);
+#endif /* NETSNMP_FEATURE_REMOVE_TLSTMADDR_GET_SERVERID */
+ if (server_id) {
+ DEBUGMSGTL(("target_sessions",
+ " found serverId: %s\n",
+ server_id));
+ t->f_config(t, "their_hostname", server_id);
+ }
+ }
+#endif
+ memset(&thissess, 0, sizeof(thissess));
+ thissess.timeout = (targaddrs->timeout) * 1000;
+ thissess.retries = targaddrs->retryCount;
+ DEBUGMSGTL(("target_sessions",
+ "timeout: %d -> %ld\n",
+ targaddrs->timeout,
+ thissess.timeout));
+
+ if (param->mpModel == SNMP_VERSION_3 &&
+ param->secModel != SNMP_SEC_MODEL_USM &&
+ param->secModel != SNMP_SEC_MODEL_TSM) {
+ snmp_log(LOG_ERR,
+ "unsupported mpModel/secModel combo %d/%d for target %s\n",
+ param->mpModel, param->secModel,
+ 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/agent/mibgroup/target/target.h b/agent/mibgroup/target/target.h
new file mode 100644
index 0000000..a528b23
--- /dev/null
+++ b/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/agent/mibgroup/target/target_counters.c b/agent/mibgroup/target/target_counters.c
new file mode 100644
index 0000000..0109974
--- /dev/null
+++ b/agent/mibgroup/target/target_counters.c
@@ -0,0 +1,81 @@
+#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>
+
+void
+init_target_counters(void)
+{
+ const oid unavailable_context_oid[] = { 1, 3, 6, 1, 6, 3, 12, 1, 4 };
+ const oid unknown_context_oid[] = { 1, 3, 6, 1, 6, 3, 12, 1, 5 };
+
+ 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/agent/mibgroup/target/target_counters.h b/agent/mibgroup/target/target_counters.h
new file mode 100644
index 0000000..355f391
--- /dev/null
+++ b/agent/mibgroup/target/target_counters.h
@@ -0,0 +1,10 @@
+/*
+ * testhandler.h
+ */
+
+config_exclude(target/target_counters)
+
+void init_target_counters(void);
+
+Netsnmp_Node_Handler get_unavailable_context_count;
+Netsnmp_Node_Handler get_unknown_context_count;
diff --git a/agent/mibgroup/target/target_counters_5_5.c b/agent/mibgroup/target/target_counters_5_5.c
new file mode 100644
index 0000000..a32207b
--- /dev/null
+++ b/agent/mibgroup/target/target_counters_5_5.c
@@ -0,0 +1,31 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-features.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_5_5.h"
+
+#include <net-snmp/agent/snmp_get_statistic.h>
+
+netsnmp_feature_require(helper_statistics)
+
+void
+init_target_counters_5_5(void)
+{
+ oid target_oid[] = { 1, 3, 6, 1, 6, 3, 12, 1 };
+
+ DEBUGMSGTL(("target_counters", "initializing\n"));
+
+ NETSNMP_REGISTER_STATISTIC_HANDLER(
+ netsnmp_create_handler_registration(
+ "target_counters", NULL, target_oid, OID_LENGTH(target_oid),
+ HANDLER_CAN_RONLY), 4, TARGET);
+}
diff --git a/agent/mibgroup/target/target_counters_5_5.h b/agent/mibgroup/target/target_counters_5_5.h
new file mode 100644
index 0000000..4960bf1
--- /dev/null
+++ b/agent/mibgroup/target/target_counters_5_5.h
@@ -0,0 +1,3 @@
+config_exclude(target/target_counters)
+
+void init_target_counters_5_5(void);
diff --git a/agent/mibgroup/tcp-mib.h b/agent/mibgroup/tcp-mib.h
new file mode 100644
index 0000000..866d1b4
--- /dev/null
+++ b/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/agent/mibgroup/tcp-mib/data_access/Makefile b/agent/mibgroup/tcp-mib/data_access/Makefile
new file mode 100644
index 0000000..3067611
--- /dev/null
+++ b/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/agent/mibgroup/tcp-mib/data_access/tcpConn.h b/agent/mibgroup/tcp-mib/data_access/tcpConn.h
new file mode 100644
index 0000000..0557102
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/data_access/tcpConn.h
@@ -0,0 +1,35 @@
+/*
+ * tcpConn data access header
+ *
+ * $Id$
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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)
+config_require(util_funcs/get_pid_from_inode)
+#elif defined( solaris2 )
+config_require(tcp-mib/data_access/tcpConn_solaris2)
+#elif defined(freebsd4) || defined(dragonfly)
+config_require(tcp-mib/data_access/tcpConn_freebsd4)
+#elif defined(openbsd4)
+config_require(tcp-mib/data_access/tcpConn_openbsd)
+#elif defined(netbsd1)
+config_require(tcp-mib/data_access/tcpConn_netbsd)
+#else
+# define NETSNMP_TCPCONN_COMMON_ONLY
+#endif
+
diff --git a/agent/mibgroup/tcp-mib/data_access/tcpConn_common.c b/agent/mibgroup/tcp-mib/data_access/tcpConn_common.c
new file mode 100644
index 0000000..bba01fe
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/data_access/tcpConn_common.c
@@ -0,0 +1,275 @@
+/*
+ * TcpConn MIB architecture support
+ *
+ * $Id$
+ */
+#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);
+}
+
+#ifdef TCPCONN_DELETE_SUPPORTED
+
+/* XXX TODO: these are currently unsupported everywhere; to enable the
+ functions first implement netsnmp_arch_tcpconn_entry_delete in the
+ tcpConn_{OS}.c file and then define TCPCONN_DELETE_SUPPORTED in the
+ tcpConn_{OS}.h file (which may need to be created first). */
+
+/**
+ * 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_entry_delete(entry);
+
+ return rc;
+}
+#endif /* TCPCONN_DELETE_SUPPORTED */
+
+/**
+ * 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/agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c b/agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c
new file mode 100644
index 0000000..fed1e84
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c
@@ -0,0 +1,223 @@
+/*
+ * tcpConnTable MIB architecture support for FreeBSD/DragonFlyBSD
+ */
+#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 "mibII/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
+
+static int _load(netsnmp_container *container, u_int flags);
+
+/*
+ * 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_entry_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 %x)\n", load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_tcpconn\n");
+ return -1;
+ }
+
+ rc = _load(container, load_flags);
+
+ return rc;
+}
+
+#if defined(freebsd4) || defined(darwin)
+ #define NS_ELEM struct xtcpcb
+#else
+ #define NS_ELEM struct xinpcb
+#endif
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load(netsnmp_container *container, u_int load_flags)
+{
+ size_t len;
+ int sname[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_PCBLIST };
+ char *tcpcb_buf = NULL;
+#if defined(dragonfly)
+ struct xinpcb *xig = NULL;
+ int StateMap[] = { 1, 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+#else
+ struct xinpgen *xig = NULL;
+ int StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+#endif
+ netsnmp_tcpconn_entry *entry;
+ int state;
+ int rc = 0;
+
+ /*
+ * 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)
+ */
+#if defined(dragonfly)
+ xig = (struct xinpcb *) tcpcb_buf;
+#else
+ xig = (struct xinpgen *) tcpcb_buf;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+
+#if defined(dragonfly)
+ while (xig && (xig->xi_len > sizeof(struct xinpcb)))
+#else
+ while (xig && (xig->xig_len > sizeof(struct xinpgen)))
+#endif
+ {
+ NS_ELEM pcb = *((NS_ELEM *) xig);
+#if defined(dragonfly)
+ xig = (struct xinpcb *) ((char *) xig + xig->xi_len);
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+ state = StateMap[pcb.xt_tp.t_state];
+
+ if (load_flags) {
+ if (state == TCPCONNECTIONSTATE_LISTEN) {
+ 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;
+ }
+ }
+
+#if !defined(NETSNMP_ENABLE_IPV6)
+ if (pcb.xt_inp.inp_vflag & INP_IPV6)
+ continue;
+#endif
+
+ 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 = htons(pcb.xt_inp.inp_lport);
+ entry->rmt_port = htons(pcb.xt_inp.inp_fport);
+ entry->tcpConnState = state;
+ entry->pid = 0;
+
+ /** the addr string may need work */
+ if (pcb.xt_inp.inp_vflag & INP_IPV6) {
+ entry->loc_addr_len = entry->rmt_addr_len = 16;
+ memcpy(entry->loc_addr, &pcb.xt_inp.in6p_laddr, 16);
+ memcpy(entry->rmt_addr, &pcb.xt_inp.in6p_faddr, 16);
+ }
+ else {
+ entry->loc_addr_len = entry->rmt_addr_len = 4;
+ memcpy(entry->loc_addr, &pcb.xt_inp.inp_laddr, 4);
+ memcpy(entry->rmt_addr, &pcb.xt_inp.inp_faddr, 4);
+ }
+
+ /*
+ * add entry to container
+ */
+ entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, entry);
+ }
+
+ if(rc<0)
+ return rc;
+
+ return 0;
+}
diff --git a/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c b/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c
new file mode 100644
index 0000000..26c9a73
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c
@@ -0,0 +1,392 @@
+/*
+ * tcpConnTable MIB architecture support
+ *
+ * $Id$
+ */
+#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 "mibgroup/util_funcs/get_pid_from_inode.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;
+}
+
+#ifdef TCPCONN_DELETE_SUPPORTED
+/*
+ * delete an entry
+ */
+int
+netsnmp_arch_tcpconn_entry_delete(netsnmp_tcpconn_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+ /** xxx-rks:9 tcpConn delete not implemented */
+ return -1;
+}
+#endif /* TCPCONN_DELETE_SUPPORTED */
+
+/**
+ *
+ * @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 %x)\n", load_flags));
+
+ /* Setup the pid_from_inode table, and fill it.*/
+ netsnmp_get_pid_from_inode_init();
+
+ 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;
+ unsigned int state, local_port, remote_port, tmp_state;
+ unsigned long long inode;
+ size_t buf_len, offset;
+ char local_addr[10], remote_addr[10];
+ u_char *tmp_ptr;
+
+ if (6 != (rc = sscanf(line, "%*d: %8[0-9A-Z]:%x %8[0-9A-Z]:%x %x %*x:%*x %*x:%*x %*x %*x %*x %llu",
+ local_addr, &local_port,
+ remote_addr, &remote_port, &tmp_state, &inode))) {
+ DEBUGMSGT(("access:tcpconn:container",
+ "error parsing line (%d != 6)\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;
+ entry->pid = netsnmp_get_pid_from_inode(inode);
+
+ /** 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];
+
+ netsnmp_assert(NULL != container);
+
+#undef PROCFILE
+#define PROCFILE "/proc/net/tcp6"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ DEBUGMSGTL(("access:tcpconn:container","could not open " PROCFILE "\n"));
+ return -2;
+ }
+
+ 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, local_port, remote_port, tmp_state;
+ unsigned long long inode;
+ size_t buf_len, offset;
+ char local_addr[48], remote_addr[48];
+ u_char *tmp_ptr;
+
+ if (6 != (rc = sscanf(line, "%*d: %47[0-9A-Z]:%x %47[0-9A-Z]:%x %x %*x:%*x %*x:%*x %*x %*x %*x %llu",
+ local_addr, &local_port,
+ remote_addr, &remote_port, &tmp_state, &inode))) {
+ DEBUGMSGT(("access:tcpconn:container",
+ "error parsing line (%d != 6)\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;
+ entry->pid = netsnmp_get_pid_from_inode(inode);
+
+ /** the addr string may need work */
+ buf_len = strlen(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/agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c b/agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c
new file mode 100644
index 0000000..b4229ff
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/data_access/tcpConn_netbsd.c
@@ -0,0 +1,229 @@
+/*
+ * tcpConnTable MIB architecture support for NetBSD
+ */
+#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 "mibII/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
+
+static int _load(netsnmp_container *container, u_int flags, int var);
+
+/*
+ * 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_entry_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 %x)\n", load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_tcpconn\n");
+ return -1;
+ }
+
+ rc = _load(container, load_flags, 4);
+#if defined(NETSNMP_ENABLE_IPV6)
+ rc = _load(container, load_flags, 6);
+#endif
+
+ return rc;
+}
+
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load(netsnmp_container *container, u_int load_flags, int ver)
+{
+ const char *mibname;
+ int mib[8];
+ size_t mib_len;
+ struct kinfo_pcb *pcblist;
+ size_t pcb_len;
+ int StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+ netsnmp_tcpconn_entry *entry;
+ int state;
+ int i, rc = 0;
+
+ /*
+ * Read in the buffer containing the TCP table data
+ */
+ switch (ver) {
+ case 4:
+ mibname = "net.inet.tcp.pcblist";
+ break;
+ case 6:
+ mibname = "net.inet6.tcp6.pcblist";
+ break;
+ default:
+ snmp_log(LOG_ERR, "tcp-mib:data_access:_load: bad version %d\n", ver);
+ return -1;
+ }
+
+ if (sysctlnametomib(mibname, mib, &mib_len) == -1) {
+ snmp_log(LOG_ERR, "tcp-mib:data_access:_load: cant resolve mib %s\n", mibname);
+ return -1;
+ }
+
+ if (sysctl(mib, sizeof(mib) / sizeof(*mib), NULL, &pcb_len, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "tcp-mib:data_access:_load: cant size mib %s\n", mibname);
+ return -1;
+ }
+
+ if ((pcblist = malloc(pcb_len)) == NULL) {
+ snmp_log(LOG_ERR, "tcp-mib:data_access:_load: cant allocate mib %s\n", mibname);
+ return -1;
+ }
+ memset(pcblist, 0, pcb_len);
+
+ mib[6] = sizeof(*pcblist);
+ mib[7] = pcb_len / sizeof(*pcblist);
+
+ if (sysctl(mib, sizeof(mib) / sizeof(*mib),
+ pcblist, &pcb_len, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "tcp-mib:data_access:_load: cant size mib %s\n", mibname);
+ return -1;
+ }
+
+ /*
+ * Unpick this into the constituent structures, and extract
+ * the 'inpcb' elements into a linked list (built in reverse)
+ */
+ for (i = 0; i < pcb_len / sizeof(*pcblist); i++) {
+ struct kinfo_pcb *pcb = pcblist+i;
+ state = StateMap[pcb->ki_tstate];
+
+ if (load_flags) {
+ if (state == TCPCONNECTIONSTATE_LISTEN) {
+ 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;
+ }
+
+ entry->tcpConnState = state;
+ entry->pid = 0;
+
+ if (ver == 6) {
+ struct sockaddr_in6 src, dst;
+ memcpy(&src, &pcb->ki_s, sizeof(src));
+ memcpy(&dst, &pcb->ki_d, sizeof(dst));
+ entry->loc_addr_len = entry->rmt_addr_len = 16;
+ memcpy(entry->loc_addr, &src.sin6_addr, 16);
+ memcpy(entry->rmt_addr, &dst.sin6_addr, 16);
+ entry->loc_port = ntohs(src.sin6_port);
+ entry->rmt_port = ntohs(dst.sin6_port);
+ }
+ else {
+ struct sockaddr_in src, dst;
+ memcpy(&src, &pcb->ki_s, sizeof(src));
+ memcpy(&dst, &pcb->ki_d, sizeof(dst));
+ entry->loc_addr_len = entry->rmt_addr_len = 4;
+ memcpy(entry->loc_addr, &src.sin_addr, 4);
+ memcpy(entry->rmt_addr, &dst.sin_addr, 4);
+ entry->loc_port = ntohs(src.sin_port);
+ entry->rmt_port = ntohs(dst.sin_port);
+ }
+
+ /*
+ * add entry to container
+ */
+ entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, entry);
+ }
+
+ if(rc<0)
+ return rc;
+
+ return 0;
+}
diff --git a/agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c b/agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c
new file mode 100644
index 0000000..001064f
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/data_access/tcpConn_openbsd.c
@@ -0,0 +1,211 @@
+/*
+ * tcpConnTable MIB architecture support for OpenBSD
+ */
+#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 <net-snmp/agent/auto_nlist.h>
+
+#include "tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h"
+#include "tcp-mib/data_access/tcpConn_private.h"
+
+#include "mibII/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
+
+static int _load(netsnmp_container *container, u_int flags);
+
+/*
+ * 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_entry_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 %x)\n", load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_tcpconn\n");
+ return -1;
+ }
+
+ rc = _load(container, load_flags);
+
+ return rc;
+}
+
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load(netsnmp_container *container, u_int load_flags)
+{
+ struct inpcbtable table;
+ struct inpcb *head, *next, *prev;
+ struct inpcb inpcb;
+ struct tcpcb tcpcb;
+ int StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+ netsnmp_tcpconn_entry *entry;
+ int state;
+ int rc = 0;
+
+ /*
+ * Read in the buffer containing the TCP table data
+ */
+ if (!auto_nlist(TCP_SYMBOL, (char *)&table, sizeof(table))) {
+ DEBUGMSGTL(("tcp-mib/tcpConn_openbsd", "Failed to read tcp_symbol\n"));
+ return -1;
+ }
+
+ prev = (struct inpcb *)&CIRCLEQ_FIRST(&table.inpt_queue);
+ prev = NULL;
+ head = next = CIRCLEQ_FIRST(&table.inpt_queue);
+
+ while (next) {
+ if (!NETSNMP_KLOOKUP(next, (char *)&inpcb, sizeof(inpcb))) {
+ DEBUGMSGTL(("tcp-mib/data_access/tcpConn", "klookup inpcb failed\n"));
+ break;
+ }
+ if (prev && CIRCLEQ_PREV(&inpcb, inp_queue) != prev) {
+ snmp_log(LOG_ERR,"tcbtable link error\n");
+ break;
+ }
+ prev = next;
+ next = CIRCLEQ_NEXT(&inpcb, inp_queue);
+ if (!NETSNMP_KLOOKUP(inpcb.inp_ppcb, (char *)&tcpcb, sizeof(tcpcb))) {
+ DEBUGMSGTL(("tcp-mib/data_access/tcpConn", "klookup tcpcb failed\n"));
+ break;
+ }
+ state = StateMap[tcpcb.t_state];
+
+ if (load_flags) {
+ if (state == TCPCONNECTIONSTATE_LISTEN) {
+ if (load_flags & NETSNMP_ACCESS_TCPCONN_LOAD_NOLISTEN) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " skipping listen\n"));
+ goto skip;
+ }
+ }
+ else if (load_flags & NETSNMP_ACCESS_TCPCONN_LOAD_ONLYLISTEN) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " skipping non-listen\n"));
+ goto skip;
+ }
+ }
+
+#if !defined(NETSNMP_ENABLE_IPV6)
+ if (inpcb.inp_flags & INP_IPV6)
+ goto skip;
+#endif
+
+ 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 = ntohs(inpcb.inp_lport);
+ entry->rmt_port = ntohs(inpcb.inp_fport);
+ entry->tcpConnState = state;
+ entry->pid = 0;
+
+ /** the addr string may need work */
+ if (inpcb.inp_flags & INP_IPV6) {
+ entry->loc_addr_len = entry->rmt_addr_len = 16;
+ memcpy(entry->loc_addr, &inpcb.inp_laddr6, 16);
+ memcpy(entry->rmt_addr, &inpcb.inp_faddr6, 16);
+ }
+ else {
+ entry->loc_addr_len = entry->rmt_addr_len = 4;
+ memcpy(entry->loc_addr, &inpcb.inp_laddr, 4);
+ memcpy(entry->rmt_addr, &inpcb.inp_faddr, 4);
+ }
+ DEBUGMSGTL(("tcp-mib/data_access", "tcp %d %d %d\n",
+ entry->loc_addr_len, entry->loc_port, entry->rmt_port));
+
+ /*
+ * add entry to container
+ */
+ entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, entry);
+skip:
+ if (head == next)
+ break;
+ }
+
+ if(rc<0)
+ return rc;
+
+ return 0;
+}
diff --git a/agent/mibgroup/tcp-mib/data_access/tcpConn_private.h b/agent/mibgroup/tcp-mib/data_access/tcpConn_private.h
new file mode 100644
index 0000000..c758f0e
--- /dev/null
+++ b/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/agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c b/agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c
new file mode 100644
index 0000000..889299a
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c
@@ -0,0 +1,184 @@
+#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;
+}
+
+#ifdef TCPCONN_DELETE_SUPPORTED
+int
+netsnmp_arch_tcpconn_entry_delete(netsnmp_tcpconn_entry *ep)
+{
+ /*
+ * Not implemented
+ */
+ return (-1);
+}
+#endif /* TCPCONN_DELETE_SUPPORTED */
+
+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/agent/mibgroup/tcp-mib/tcpConnTable.h b/agent/mibgroup/tcp-mib/tcpConnTable.h
new file mode 100644
index 0000000..f588c1c
--- /dev/null
+++ b/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/agent/mibgroup/tcp-mib/tcpConnectionTable.h b/agent/mibgroup/tcp-mib/tcpConnectionTable.h
new file mode 100644
index 0000000..c697aaa
--- /dev/null
+++ b/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/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c b/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c
new file mode 100644
index 0000000..c999a0e
--- /dev/null
+++ b/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$
+ */
+/** \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"
+
+const oid tcpConnectionTable_oid[] = { TCPCONNECTIONTABLE_OID };
+const 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.
+ */
+ netsnmp_access_tcpconn_entry_free(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+} /* 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,
+ const void
+ *tcpConnectionLocalAddress_val_ptr,
+ size_t
+ tcpConnectionLocalAddress_val_ptr_len,
+ u_long tcpConnectionLocalPort_val,
+ u_long
+ tcpConnectionRemAddressType_val,
+ const void
+ *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);
+
+ /*
+ * 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);
+
+ /*
+ * 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 rowreq_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,
+ const void *tcpConnectionLocalAddress_val_ptr,
+ size_t
+ tcpConnectionLocalAddress_val_ptr_len,
+ u_long tcpConnectionLocalPort_val,
+ u_long tcpConnectionRemAddressType_val,
+ const void *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/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h b/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
new file mode 100644
index 0000000..17d3105
--- /dev/null
+++ b/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$
+ */
+#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 const oid tcpConnectionTable_oid[];
+ extern const 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,
+ const void
+ *tcpConnectionLocalAddress_val_ptr,
+ size_t
+ tcpConnectionLocalAddress_val_ptr_len,
+ u_long
+ tcpConnectionLocalPort_val,
+ u_long
+ tcpConnectionRemAddressType_val,
+ const void
+ *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,
+ const void
+ *tcpConnectionLocalAddress_val_ptr,
+ size_t
+ tcpConnectionLocalAddress_val_ptr_len,
+ u_long tcpConnectionLocalPort_val,
+ u_long
+ tcpConnectionRemAddressType_val,
+ const void
+ *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/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h b/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h
new file mode 100644
index 0000000..f998a7f
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c b/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c
new file mode 100644
index 0000000..dfb9649
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c
@@ -0,0 +1,326 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $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 "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))) {
+ if (CONTAINER_INSERT(container, rowreq_ctx)) {
+ NETSNMP_LOGONCE((LOG_DEBUG,
+ "Error inserting entry to tcpConnectionTable,"\
+ " entry already exists.\n"));
+ tcpConnectionTable_release_rowreq_ctx(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", (int)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/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h b/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h
new file mode 100644
index 0000000..cd47815
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c b/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c
new file mode 100644
index 0000000..d0b27e5
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c
@@ -0,0 +1,1825 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(tcpConnectionTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+
+netsnmp_feature_child_of(tcpConnectionTable_container_size, tcpConnectionTable_external_access)
+netsnmp_feature_child_of(tcpConnectionTable_registration_set, tcpConnectionTable_external_access)
+netsnmp_feature_child_of(tcpConnectionTable_registration_get, tcpConnectionTable_external_access)
+netsnmp_feature_child_of(tcpConnectionTable_container_get, tcpConnectionTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_CONTAINER_GET
+netsnmp_container *
+tcpConnectionTable_container_get(void)
+{
+ return tcpConnectionTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_REGISTRATION_GET
+tcpConnectionTable_registration *
+tcpConnectionTable_registration_get(void)
+{
+ return tcpConnectionTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_REGISTRATION_SET
+tcpConnectionTable_registration *
+tcpConnectionTable_registration_set(tcpConnectionTable_registration *
+ newreg)
+{
+ tcpConnectionTable_registration *old =
+ tcpConnectionTable_if_ctx.user_ctx;
+ tcpConnectionTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_CONTAINER_SIZE
+int
+tcpConnectionTable_container_size(void)
+{
+ return CONTAINER_SIZE(tcpConnectionTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_CONTAINER_SIZE */
+
+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;
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+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);
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+/**
+ * @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 retrieval.
+ */
+ 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;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /*
+ * 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ /*************************************************
+ *
+ * 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
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ | HANDLER_CAN_RWRITE
+#endif
+ );
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 */
+
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+/***********************************************************************
+ *
+ * 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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 = (tcpConnectionTable_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 */
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+/***********************************************************************
+ *
+ * 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 (if_ctx->container)
+ if_ctx->container->container_name = strdup("tcpConnectionTable");
+ }
+ 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_EXTERNAL_ACCESS
+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 = (tcpConnectionTable_rowreq_ctx*)
+ CONTAINER_FIND(tcpConnectionTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPCONNECTIONTABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h b/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
new file mode 100644
index 0000000..c848bcb
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/tcp-mib/tcpListenerTable.h b/agent/mibgroup/tcp-mib/tcpListenerTable.h
new file mode 100644
index 0000000..7024f79
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/tcpListenerTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(tcp-mib/tcpListenerTable/tcpListenerTable)
diff --git a/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c b/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c
new file mode 100644
index 0000000..ebd672b
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c
@@ -0,0 +1,445 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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"
+
+const oid tcpListenerTable_oid[] = { TCPLISTENERTABLE_OID };
+const 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.
+ */
+ netsnmp_access_tcpconn_entry_free(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+} /* 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/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h b/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
new file mode 100644
index 0000000..08a741a
--- /dev/null
+++ b/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$
+ */
+#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 const oid tcpListenerTable_oid[];
+ extern const 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/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h b/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h
new file mode 100644
index 0000000..e7ecec6
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c b/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c
new file mode 100644
index 0000000..4aa14ff
--- /dev/null
+++ b/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$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#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,
+ (char *) 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", (int)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/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h b/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h
new file mode 100644
index 0000000..1787ccf
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c b/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c
new file mode 100644
index 0000000..2e41380
--- /dev/null
+++ b/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c
@@ -0,0 +1,1009 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(tcpListenerTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+
+netsnmp_feature_child_of(tcpListenerTable_container_size, tcpListenerTable_external_access)
+netsnmp_feature_child_of(tcpListenerTable_registration_set, tcpListenerTable_external_access)
+netsnmp_feature_child_of(tcpListenerTable_registration_get, tcpListenerTable_external_access)
+netsnmp_feature_child_of(tcpListenerTable_container_get, tcpListenerTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_CONTAINER_GET
+netsnmp_container *
+tcpListenerTable_container_get(void)
+{
+ return tcpListenerTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_REGISTRATION_GET
+tcpListenerTable_registration *
+tcpListenerTable_registration_get(void)
+{
+ return tcpListenerTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_REGISTRATION_SET
+tcpListenerTable_registration *
+tcpListenerTable_registration_set(tcpListenerTable_registration * newreg)
+{
+ tcpListenerTable_registration *old = tcpListenerTable_if_ctx.user_ctx;
+ tcpListenerTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_CONTAINER_SIZE
+int
+tcpListenerTable_container_size(void)
+{
+ return CONTAINER_SIZE(tcpListenerTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_CONTAINER_SIZE */
+
+/*
+ * 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 retrieval.
+ */
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /* XXX - are these actually necessary? */
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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 = (tcpListenerTable_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 = (tcpListenerTable_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 = (tcpListenerTable_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 (if_ctx->container)
+ if_ctx->container->container_name = strdup("tcpListenerTable");
+ }
+ 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_EXTERNAL_ACCESS
+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 = (tcpListenerTable_rowreq_ctx*)
+ CONTAINER_FIND(tcpListenerTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TCPLISTENERTABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h b/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
new file mode 100644
index 0000000..a584be6
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/testhandler.c b/agent/mibgroup/testhandler.c
new file mode 100644
index 0000000..8951319
--- /dev/null
+++ b/agent/mibgroup/testhandler.c
@@ -0,0 +1,425 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+netsnmp_feature_require(ulong_instance)
+netsnmp_feature_require(register_read_only_table_data)
+netsnmp_feature_require(table_build_result)
+netsnmp_feature_require(table_dataset)
+
+#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);
+ if (table_info == NULL)
+ return;
+
+ 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);
+ if (table_info == NULL)
+ return;
+
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ 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/agent/mibgroup/testhandler.h b/agent/mibgroup/testhandler.h
new file mode 100644
index 0000000..20806ab
--- /dev/null
+++ b/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/agent/mibgroup/tlstm-mib.h b/agent/mibgroup/tlstm-mib.h
new file mode 100644
index 0000000..50e6985
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib.h
@@ -0,0 +1,11 @@
+/*
+ * module to include the modules
+ */
+config_require(tlstm-mib/snmpTlstmSession)
+config_require(tlstm-mib/snmpTlstmAddrTable)
+config_require(tlstm-mib/snmpTlstmCertToTSNTable)
+config_require(tlstm-mib/snmpTlstmParamsTable)
+config_add_mib(SNMP-TLS-TM-MIB)
+config_add_mib(SNMP-TSM-MIB)
+
+#define SNMP_TLS_TM_BASE 1, 3, 6, 1, 2, 1, 198
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h b/agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h
new file mode 100644
index 0000000..7b10905
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmAddrTable.h
@@ -0,0 +1,7 @@
+#ifndef SNMPTLSTMADDRTABLE_H
+#define SNMPTLSTMADDRTABLE_H
+
+config_require(tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable)
+
+
+#endif /* SNMPTLSTMADDRTABLE_H */
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c b/agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c
new file mode 100644
index 0000000..5493ff9
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.c
@@ -0,0 +1,1438 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <openssl/ssl.h>
+#include <openssl/x509.h>
+#include <net-snmp/library/cert_util.h>
+#include "tlstm-mib.h"
+#include "snmpTlstmAddrTable.h"
+
+netsnmp_feature_require(table_tdata)
+netsnmp_feature_require(tlstmaddr_container)
+netsnmp_feature_require(table_tdata_delete_table)
+netsnmp_feature_require(table_tdata_extract_table)
+netsnmp_feature_require(table_tdata_remove_row)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_storagetype)
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(table_tdata_insert_row)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/** XXX - move these to table_data header? */
+#define FATE_NEWLY_CREATED 1
+#define FATE_NO_CHANGE 0
+#define FATE_DELETE_ME -1
+
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+ /*
+ * structure for undo storage and other vars for set processing
+ */
+typedef struct tlstmAddrTable_undo_s {
+ char fate;
+ char copied;
+ char is_consistent;
+ netsnmp_request_info *req[TLSTMADDRTABLE_MAX_COLUMN + 1];
+ /*
+ * undo Column space
+ */
+ char tlstmAddrServerFingerprint[TLSTMADDRSERVERFINGERPRINT_MAX_SIZE];
+ size_t tlstmAddrServerFingerprint_len;
+ char tlstmAddrServerIdentity[TLSTMADDRSERVERIDENTITY_MAX_SIZE];
+ size_t tlstmAddrServerIdentity_len;
+ char tlstmAddrStorageType;
+ char tlstmAddrRowStatus;
+ char hashType;
+} tlstmAddrTable_undo;
+
+ /*
+ * Typical data structure for a row entry
+ */
+typedef struct tlstmAddrTable_entry_s {
+ /*
+ * Index values
+ */
+ char snmpTargetAddrName[SNMPTARGETADDRNAME_MAX_SIZE];
+ size_t snmpTargetAddrName_len;
+
+ /*
+ * Column values
+ */
+ char tlstmAddrServerFingerprint[TLSTMADDRSERVERFINGERPRINT_MAX_SIZE];
+ size_t tlstmAddrServerFingerprint_len;
+ char tlstmAddrServerIdentity[TLSTMADDRSERVERIDENTITY_MAX_SIZE];
+ size_t tlstmAddrServerIdentity_len;
+ char tlstmAddrStorageType;
+ char tlstmAddrRowStatus;
+ char hashType;
+
+ /*
+ * used during set processing
+ */
+ tlstmAddrTable_undo *undo;
+
+ /*
+ * user data
+ */
+ struct netsnmp_cert_s *cert;
+ char addr_flags;
+
+} tlstmAddrTable_entry;
+
+netsnmp_tdata_row *tlstmAddrTable_createEntry(netsnmp_tdata * table_data,
+ char *snmpTargetAddrName,
+ size_t snmpTargetAddrName_len);
+void tlstmAddrTable_removeEntry(netsnmp_tdata * table_data,
+ netsnmp_tdata_row * row);
+
+static Netsnmp_Node_Handler tlstmAddrTable_handler;
+static int _cache_load(netsnmp_cache *cache, netsnmp_tdata *table);
+static void _cache_free(netsnmp_cache *cache, netsnmp_tdata *table);
+static uint32_t _last_changed = 0;
+static int _count_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+static void _tlstmAddr_init_persistence(void);
+static void _addrs_add(tlstmAddrTable_entry *entry);
+static void _addrs_remove(tlstmAddrTable_entry *entry);
+static void _addr_tweak_storage(tlstmAddrTable_entry *entry);
+static netsnmp_tdata *_table_data = NULL;
+
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+/** Initializes the tlstmAddrTable module */
+void
+init_snmpTlstmAddrTable(void)
+{
+ oid reg_oid[] = { SNMP_TLS_TM_ADDR_TABLE };
+ const size_t reg_oid_len = OID_LENGTH(reg_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+ netsnmp_cache *cache;
+ netsnmp_watcher_info *watcher;
+
+ DEBUGMSGTL(("tlstmAddrTable:init",
+ "initializing table tlstmAddrTable\n"));
+
+ reg =
+ netsnmp_create_handler_registration("tlstmAddrTable",
+ tlstmAddrTable_handler,
+ reg_oid, reg_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ _table_data = netsnmp_tdata_create_table("tlstmAddrTable", 0);
+ if (NULL == _table_data) {
+ snmp_log(LOG_ERR, "error creating tdata table for tlstmAddrTable\n");
+ return;
+ }
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR, "error creating table info for tlstmAddrTable\n");
+ netsnmp_tdata_delete_table(_table_data);
+ _table_data = NULL;
+ return;
+ }
+
+ /*
+ * cache init
+ */
+ cache = netsnmp_cache_create(30, (NetsnmpCacheLoad*)_cache_load,
+ (NetsnmpCacheFree*)_cache_free,
+ reg_oid, reg_oid_len);
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"error creating cache for tlstmCertToTSNTable\n");
+ netsnmp_tdata_delete_table(_table_data);
+ _table_data = NULL;
+ return;
+ }
+ cache->magic = (void *)_table_data;
+ cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ /*
+ * populate index types
+ */
+ netsnmp_table_helper_add_indexes(table_info,
+ /* index: snmpTargetAddrName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ table_info->min_column = TLSTMADDRTABLE_MIN_COLUMN;
+ table_info->max_column = TLSTMADDRTABLE_MAX_COLUMN;
+
+ netsnmp_tdata_register(reg, _table_data, table_info);
+
+ if (cache)
+ netsnmp_inject_handler_before( reg, netsnmp_cache_handler_get(cache),
+ "table_container");
+
+ /*
+ * register scalars
+ */
+ reg_oid[10] = 7;
+ reg = netsnmp_create_handler_registration("snmpTlstmAddrCount",
+ _count_handler, reg_oid,
+ OID_LENGTH(reg_oid),
+ HANDLER_CAN_RONLY);
+ if (NULL == reg)
+ snmp_log(LOG_ERR,
+ "could not create handler for snmpTlstmAddrCount\n");
+ else {
+ netsnmp_register_scalar(reg);
+ if (cache)
+ netsnmp_inject_handler_before(reg,
+ netsnmp_cache_handler_get(cache),
+ "snmpTlstmAddrCount");
+ }
+
+ reg_oid[10] = 8;
+ reg = netsnmp_create_handler_registration(
+ "snmpTlstmAddrTableLastChanged", NULL, reg_oid,
+ OID_LENGTH(reg_oid), HANDLER_CAN_RONLY);
+ watcher = netsnmp_create_watcher_info((void*)&_last_changed,
+ sizeof(_last_changed),
+ ASN_TIMETICKS,
+ WATCHER_FIXED_SIZE);
+ if ((NULL == reg) || (NULL == watcher))
+ snmp_log(LOG_ERR,
+ "could not create handler for snmpTlstmAddrTableLastChanged\n");
+ else
+ netsnmp_register_watched_scalar2(reg, watcher);
+
+ /*
+ * Initialise the contents of the table here
+ */
+ _tlstmAddr_init_persistence();
+}
+
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+/*
+ * create a new row in the table
+ */
+netsnmp_tdata_row *
+tlstmAddrTable_createEntry(netsnmp_tdata * table_data,
+ char *snmpTargetAddrName,
+ size_t snmpTargetAddrName_len)
+{
+ tlstmAddrTable_entry *entry;
+ netsnmp_tdata_row *row;
+
+ if (snmpTargetAddrName_len > sizeof(entry->snmpTargetAddrName))
+ return NULL;
+
+ entry = SNMP_MALLOC_TYPEDEF(tlstmAddrTable_entry);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+
+ DEBUGIF("tlstmAddrTable:entry:create") {
+ char name[sizeof(entry->snmpTargetAddrName)+1];
+ snprintf(name, sizeof(name), "%s", snmpTargetAddrName);
+ DEBUGMSGT(("tlstmAddrTable:entry:create", "entry %s %p / row %p\n",
+ name, entry, row));
+ }
+
+ /*
+ * populate index
+ */
+ memcpy(entry->snmpTargetAddrName, snmpTargetAddrName,
+ snmpTargetAddrName_len);
+ entry->snmpTargetAddrName_len = snmpTargetAddrName_len;
+ netsnmp_tdata_row_add_index(row, ASN_PRIV_IMPLIED_OCTET_STR,
+ entry->snmpTargetAddrName,
+ snmpTargetAddrName_len);
+
+ /*
+ * defaults
+ */
+ entry->tlstmAddrServerFingerprint[0] = '\0';
+ entry->tlstmAddrServerFingerprint_len = 0;
+ entry->hashType = 0;
+ entry->tlstmAddrServerIdentity[0] = '\0';
+ entry->tlstmAddrServerIdentity_len = 0;
+ entry->tlstmAddrStorageType = ST_NONVOLATILE;
+ entry->tlstmAddrRowStatus = RS_NOTREADY;
+
+ if (table_data) {
+ DEBUGMSGTL(("tlstmAddrTable:row:insert", "row %p\n",row));
+ netsnmp_tdata_add_row(table_data, row);
+ }
+ return row;
+}
+
+/*
+ * allocate undo resources
+ */
+static tlstmAddrTable_undo *
+_allocUndo(tlstmAddrTable_entry * entry)
+{
+ if (!entry)
+ return NULL;
+
+ entry->undo = SNMP_MALLOC_TYPEDEF(tlstmAddrTable_undo);
+ if (!entry->undo)
+ return NULL;
+
+ entry->undo->is_consistent = -1; /* don't know */
+
+ return entry->undo;
+}
+
+/*
+ * free undo resources
+ */
+static void
+_freeUndo(tlstmAddrTable_entry * entry)
+{
+ if (!entry || !entry->undo)
+ return;
+
+ SNMP_FREE(entry->undo);
+}
+
+/*
+ * remove a row from the table
+ */
+void
+tlstmAddrTable_removeEntry(netsnmp_tdata * table_data,
+ netsnmp_tdata_row * row)
+{
+ tlstmAddrTable_entry *entry;
+
+ if (!row)
+ return; /* Nothing to remove */
+
+ entry = (tlstmAddrTable_entry *) row->data;
+
+ if (table_data) {
+ DEBUGMSGTL(("tlstmAddrTable:row:remove", "row %p\n",row));
+ netsnmp_tdata_remove_and_delete_row(table_data, row);
+ }
+ else
+ netsnmp_tdata_delete_row(row);
+
+ DEBUGIF("tlstmAddrTable:entry:delete") {
+ char name[sizeof(entry->snmpTargetAddrName)+1];
+ snprintf(name, sizeof(name), "%s", entry->snmpTargetAddrName);
+ DEBUGMSGT(("tlstmAddrTable:entry:delete", "entry %s %p / row %p\n",
+ name, entry, row));
+ }
+ if (entry && entry->undo)
+ _freeUndo(entry);
+ SNMP_FREE(entry);
+}
+
+
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+/** handles requests for the tlstmAddrTable table */
+static int
+tlstmAddrTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request = NULL;
+ netsnmp_table_request_info *table_info;
+ netsnmp_tdata *table_data;
+ netsnmp_tdata_row *table_row;
+ tlstmAddrTable_entry *table_entry;
+ int ret = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("tlstmAddrTable:handler", "Processing mode %s (%d) request\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode),
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /** ######################################################### GET #####
+ *
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ table_entry = (tlstmAddrTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info(request);
+ switch (table_info->colnum) {
+ case COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT:
+ {
+ u_char bin[42], *ptr = bin;
+ size_t len = sizeof(bin), offset = 1;
+ int rc;
+
+ if ((table_entry->hashType == 0) ||
+ (table_entry->tlstmAddrServerFingerprint_len ==0))
+ offset = 0;
+ else {
+ bin[0] = table_entry->hashType;
+ rc = netsnmp_hex_to_binary(
+ &ptr, &len, &offset, 0,
+ table_entry->tlstmAddrServerFingerprint, NULL);
+ if (1 != rc)
+ ret = SNMP_ERR_GENERR;
+ }
+ if (ret == SNMP_ERR_NOERROR)
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ bin, offset);
+ }
+ break; /* case COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT */
+ case COLUMN_SNMPTLSTMADDRSERVERIDENTITY:
+ snmp_set_var_typed_value
+ (request->requestvb, ASN_OCTET_STR,
+ (u_char *) table_entry->tlstmAddrServerIdentity,
+ table_entry->tlstmAddrServerIdentity_len);
+ break; /* case COLUMN_SNMPTLSTMADDRSERVERIDENTITY */
+ case COLUMN_SNMPTLSTMADDRSTORAGETYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->tlstmAddrStorageType);
+ break; /* case COLUMN_SNMPTLSTMADDRSTORAGETYPE */
+ case COLUMN_SNMPTLSTMADDRROWSTATUS:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->tlstmAddrRowStatus);
+ break; /* case COLUMN_SNMPTLSTMADDRROWSTATUS */
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ break;
+ } /* switch colnum */
+ } /* for requests */
+ break; /* case MODE_GET */
+
+ /*
+ * Write-support
+ */
+ /** #################################################### RESERVE1 #####
+ *
+ * In RESERVE1 we are just checking basic ASN.1 size/type restrictions.
+ * You probably don't need to change any of this code. Don't change any
+ * of the column values here. Save that for the ACTION phase.
+ *
+ * The next phase is RESERVE2 or FREE.
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ table_entry = (tlstmAddrTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ if ((NULL != table_entry) &&
+ (ST_READONLY == table_entry->tlstmAddrStorageType)) {
+ ret = SNMP_ERR_NOTWRITABLE;
+ break;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT:
+ ret = netsnmp_check_vb_type_and_max_size
+ (request->requestvb, ASN_OCTET_STR,
+ sizeof(table_entry->tlstmAddrServerFingerprint));
+ /** check len/algorithm MIB requirements */
+ if (ret == SNMP_ERR_NOERROR)
+ ret = netsnmp_cert_check_vb_fingerprint(request->requestvb);
+ break; /* case COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT */
+ case COLUMN_SNMPTLSTMADDRSERVERIDENTITY:
+ ret = netsnmp_check_vb_type_and_max_size
+ (request->requestvb, ASN_OCTET_STR,
+ sizeof(table_entry->tlstmAddrServerIdentity));
+ break; /* case COLUMN_SNMPTLSTMADDRSERVERIDENTITY */
+ case COLUMN_SNMPTLSTMADDRSTORAGETYPE:
+ ret = netsnmp_check_vb_storagetype
+ (request->requestvb,
+ (table_entry ?
+ table_entry->tlstmAddrStorageType : ST_NONE));
+ break; /* case COLUMN_SNMPTLSTMADDRSTORAGETYPE */
+ case COLUMN_SNMPTLSTMADDRROWSTATUS:
+ ret = netsnmp_check_vb_rowstatus_with_storagetype
+ (request->requestvb,
+ (table_entry ?
+ table_entry->tlstmAddrRowStatus : RS_NONEXISTENT),
+ (table_entry ?
+ table_entry->tlstmAddrStorageType : ST_NONE));
+ break; /* case COLUMN_SNMPTLSTMADDRROWSTATUS */
+ default:
+ ret = SNMP_ERR_NOTWRITABLE;
+ } /* switch colnum */
+
+ if (ret != SNMP_ERR_NOERROR)
+ break;
+ } /* for requests */
+ break; /* case MODE_SET_RESERVE1 */
+
+ /** #################################################### RESERVE2 #####
+ *
+ * RESERVE2 is for checking additional restrictions from the MIB.
+ * Since these restrictions are often in the description of the object,
+ * mib2c can't generate code. It's possible that you need to add
+ * additional checks here. However, don't change any of the column
+ * values here. Save that for the ACTION phase.
+ *
+ * The next phase is ACTION or FREE.
+ */
+ case MODE_SET_RESERVE2:
+ for (request = requests; request; request = request->next) {
+ table_entry = (tlstmAddrTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info(request);
+ /*
+ * if no table_row, create one
+ */
+ if (!table_entry) {
+ table_row = tlstmAddrTable_createEntry
+ (table_data, (char*)table_info->indexes->val.string,
+ table_info->indexes->val_len);
+ if (!table_row) {
+ ret = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ table_entry = table_row->data;
+ _allocUndo(table_entry);
+ if (table_entry && !table_entry->undo) {
+ tlstmAddrTable_removeEntry(table_data, table_row);
+ table_row = NULL;
+ ret = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ table_entry->undo->fate = FATE_NEWLY_CREATED;
+ /** associate row with requests */
+ netsnmp_insert_tdata_row(request, table_row);
+ }
+
+ /** allocate undo structure, if needed */
+ if (!table_entry->undo) {
+ _allocUndo(table_entry);
+ if (!table_entry->undo) {
+ ret = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ }
+
+ /** don't allow multiple sets of same column */
+ if (table_entry->undo->req[table_info->colnum]) {
+ DEBUGMSGT(("tlstmAddrTable:reserve2",
+ "multiple sets to col %d in request\n",
+ table_info->colnum));
+ ret = SNMP_ERR_INCONSISTENTNAME;
+ break;
+ }
+ table_entry->undo->req[table_info->colnum] = request;
+
+ if (ret != SNMP_ERR_NOERROR)
+ break;
+ } /* for requests */
+
+ /** make sure rowstatus is used to create rows */
+ if (ret == SNMP_ERR_NOERROR) {
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ table_entry = (tlstmAddrTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ if ((table_entry->undo->fate != FATE_NEWLY_CREATED) ||
+ (table_entry->undo->req[COLUMN_SNMPTLSTMADDRROWSTATUS]))
+ continue;
+ ret = SNMP_ERR_INCONSISTENTNAME;
+ break;
+ } /* for requests / creation */
+ } /* if no error */
+ break; /* case MODE_SET_RESERVE2 */
+
+ /** ######################################################## FREE #####
+ *
+ * FREE is for cleaning up after a failed request (during either
+ * RESERVE1 or RESERVE2). So any allocated resources need to be
+ * released.
+ *
+ * This the final phase for this path in the state machine.
+ */
+ case MODE_SET_FREE:
+ /*
+ * release undo resources, remove any newly created rows
+ */
+ for (request = requests; request; request = request->next) {
+ table_row = netsnmp_tdata_extract_row(request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_entry =
+ (tlstmAddrTable_entry *) table_row ? table_row->
+ data : NULL;
+
+ if (!table_entry || !table_entry->undo)
+ continue;
+
+ /** disassociate row with requests */
+ netsnmp_remove_tdata_row(request, table_row);
+
+ if (FATE_NEWLY_CREATED == table_entry->undo->fate)
+ tlstmAddrTable_removeEntry(table_data, table_row);
+ else
+ _freeUndo(table_entry);
+ }
+ break; /* case MODE_SET_FREE */
+
+ /** ###################################################### ACTION #####
+ *
+ * In the ACTION phase, we perform any sets that can be undone.
+ * (Save anything that can't be undone for the COMMIT phase.)
+ *
+ * After individual columns have been done, you should check that the
+ * row as a whole is consistent.
+ *
+ * The next phase is UNDO or COMMIT.
+ */
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ table_entry = (tlstmAddrTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT:
+ {
+ u_char *tmp = (u_char*)table_entry->tlstmAddrServerFingerprint;
+
+ memcpy(table_entry->undo->tlstmAddrServerFingerprint,
+ table_entry->tlstmAddrServerFingerprint,
+ sizeof(table_entry->tlstmAddrServerFingerprint));
+ table_entry->undo->tlstmAddrServerFingerprint_len =
+ table_entry->tlstmAddrServerFingerprint_len;
+ table_entry->undo->hashType = table_entry->hashType;
+
+ table_entry->hashType = request->requestvb->val.string[0];
+ table_entry->tlstmAddrServerFingerprint_len =
+ sizeof(table_entry->tlstmAddrServerFingerprint);
+ memset(table_entry->tlstmAddrServerFingerprint, 0,
+ sizeof(table_entry->tlstmAddrServerFingerprint));
+ table_entry->tlstmAddrServerFingerprint_len =
+ netsnmp_binary_to_hex(&tmp, &table_entry->tlstmAddrServerFingerprint_len,
+ 0, &request->requestvb->val.string[1],
+ request->requestvb->val_len - 1);
+ if (0 == table_entry->tlstmAddrServerFingerprint_len)
+ ret = SNMP_ERR_GENERR;
+ }
+ break; /* case COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT */
+ case COLUMN_SNMPTLSTMADDRSERVERIDENTITY:
+ memcpy(table_entry->undo->tlstmAddrServerIdentity,
+ table_entry->tlstmAddrServerIdentity,
+ sizeof(table_entry->tlstmAddrServerIdentity));
+ table_entry->undo->tlstmAddrServerIdentity_len =
+ table_entry->tlstmAddrServerIdentity_len;
+ memset(table_entry->tlstmAddrServerIdentity, 0,
+ sizeof(table_entry->tlstmAddrServerIdentity));
+ memcpy(table_entry->tlstmAddrServerIdentity,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ table_entry->tlstmAddrServerIdentity_len =
+ request->requestvb->val_len;
+ break; /* case COLUMN_SNMPTLSTMADDRSERVERIDENTITY */
+ case COLUMN_SNMPTLSTMADDRSTORAGETYPE:
+ table_entry->undo->tlstmAddrStorageType =
+ table_entry->tlstmAddrStorageType;
+ table_entry->tlstmAddrStorageType =
+ *request->requestvb->val.integer;
+ break; /* case COLUMN_SNMPTLSTMADDRSTORAGETYPE */
+ case COLUMN_SNMPTLSTMADDRROWSTATUS:
+ table_entry->undo->tlstmAddrRowStatus =
+ table_entry->tlstmAddrRowStatus;
+ table_entry->tlstmAddrRowStatus =
+ *request->requestvb->val.integer;
+ break; /* case COLUMN_SNMPTLSTMADDRROWSTATUS */
+ } /* switch colnum */
+ if (ret != SNMP_ERR_NOERROR)
+ break;
+ } /* set values for requests */
+
+ if (ret == SNMP_ERR_NOERROR) {
+
+ /*
+ * All columns now have their final values set. check the
+ * internal consistency of each row.
+ */
+ for (request = requests; request; request = request->next) {
+ table_entry = (tlstmAddrTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ if (table_entry->undo->is_consistent != -1)
+ continue; /* already checked */
+
+ /** assume consistency */
+ table_entry->undo->is_consistent = 1;
+
+ /*
+ * per mib, can't have empty fingerprint and wildcard id
+ */
+ if ( (0 == table_entry->tlstmAddrServerFingerprint_len) &&
+ (1 == table_entry->tlstmAddrServerIdentity_len) &&
+ ('*' == table_entry->tlstmAddrServerIdentity[0]) ) {
+ DEBUGMSGTL(("tlstmAddrTable", "fingerprint must not "
+ "be empty for wildcard (*) identity\n"));
+ table_entry->undo->is_consistent = 0;
+ }
+
+ if ((RS_IS_ACTIVE(table_entry->tlstmAddrRowStatus)) &&
+ ((!table_entry->undo->req[COLUMN_SNMPTLSTMADDRROWSTATUS]) ||
+ (RS_IS_ACTIVE(table_entry->undo->tlstmAddrRowStatus)))) {
+ /*
+ * check mib restrictions on active rows.
+ */
+ if (table_entry->undo->req[COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT]) {
+ table_entry->undo->is_consistent = 0;
+ request = table_entry->undo->req[COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT];
+ }
+ else if (table_entry->undo->req[COLUMN_SNMPTLSTMADDRSERVERIDENTITY]) {
+ table_entry->undo->is_consistent = 0;
+ request = table_entry->undo->req[COLUMN_SNMPTLSTMADDRSERVERIDENTITY];
+ }
+ else if (table_entry->undo->req[COLUMN_SNMPTLSTMADDRSTORAGETYPE]) {
+ table_entry->undo->is_consistent = 0;
+ request = table_entry->undo->req[COLUMN_SNMPTLSTMADDRSTORAGETYPE];
+ }
+
+ if (!table_entry->undo->is_consistent)
+ ret = SNMP_ERR_INCONSISTENTVALUE; /* per mib */
+ } /* active row */
+ else if (RS_IS_GOING_ACTIVE
+ (table_entry->tlstmAddrRowStatus)) {
+ /** if going active, inconsistency is fatal */
+ if (!table_entry->undo->is_consistent) {
+ if (FATE_NEWLY_CREATED == table_entry->undo->fate)
+ ret = SNMP_ERR_INCONSISTENTNAME;
+ else
+ ret = SNMP_ERR_INCONSISTENTVALUE;
+ request = table_entry->undo->req[COLUMN_SNMPTLSTMADDRROWSTATUS];
+ }
+ } /* going active */
+ else if (RS_DESTROY == table_entry->tlstmAddrRowStatus) {
+ /** can't delete active row */
+ if (RS_IS_ACTIVE(table_entry->undo->tlstmAddrRowStatus)) {
+ ret = SNMP_ERR_INCONSISTENTVALUE;
+ request = table_entry->undo->req[COLUMN_SNMPTLSTMADDRROWSTATUS];
+ }
+ } /* destroy */
+ if (ret != SNMP_ERR_NOERROR)
+ break;
+ } /* consistency for requests */
+ } /* if no error */
+ break; /* case MODE_SET_ACTION */
+
+ /** ######################################################## UNDO #####
+ *
+ * UNDO is for cleaning up any failed requests that went through the
+ * ACTION phase.
+ *
+ * This the final phase for this path in the state machine.
+ */
+ case MODE_SET_UNDO:
+ for (request = requests; request; request = request->next) {
+ table_row = netsnmp_tdata_extract_row(request);
+ table_entry =
+ (tlstmAddrTable_entry *) table_row ? table_row->
+ data : NULL;
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT:
+ /*
+ * restore tlstmAddrServerFingerprint value
+ */
+ memcpy(table_entry->tlstmAddrServerFingerprint,
+ table_entry->undo->tlstmAddrServerFingerprint,
+ sizeof(table_entry->tlstmAddrServerFingerprint));
+ table_entry->tlstmAddrServerFingerprint_len =
+ table_entry->undo->tlstmAddrServerFingerprint_len;
+ table_entry->hashType = table_entry->undo->hashType;
+ break; /* case COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT */
+ case COLUMN_SNMPTLSTMADDRSERVERIDENTITY:
+ /*
+ * restore tlstmAddrServerIdentity value
+ */
+ memcpy(table_entry->tlstmAddrServerIdentity,
+ table_entry->undo->tlstmAddrServerIdentity,
+ sizeof(table_entry->tlstmAddrServerIdentity));
+ table_entry->tlstmAddrServerIdentity_len =
+ table_entry->undo->tlstmAddrServerIdentity_len;
+ break; /* case COLUMN_SNMPTLSTMADDRSERVERIDENTITY */
+ case COLUMN_SNMPTLSTMADDRSTORAGETYPE:
+ /*
+ * restore tlstmAddrStorageType value
+ */
+ table_entry->tlstmAddrStorageType =
+ table_entry->undo->tlstmAddrStorageType;
+ break; /* case COLUMN_SNMPTLSTMADDRSTORAGETYPE */
+ case COLUMN_SNMPTLSTMADDRROWSTATUS:
+ /*
+ * restore tlstmAddrRowStatus value
+ */
+ table_entry->tlstmAddrRowStatus =
+ table_entry->undo->tlstmAddrRowStatus;
+ break; /* case COLUMN_SNMPTLSTMADDRROWSTATUS */
+ } /* switch colnum */
+ } /* for requests */
+
+ /*
+ * release undo data
+ * or remove any newly created rows
+ */
+ for (request = requests; request; request = request->next) {
+ table_row = netsnmp_tdata_extract_row(request);
+ table_entry =
+ (tlstmAddrTable_entry *) table_row ? table_row->
+ data : NULL;
+
+ if (!table_entry || !table_entry->undo)
+ continue;
+
+ /** disassociate row with requests */
+ netsnmp_remove_tdata_row(request, table_row);
+
+ if (FATE_NEWLY_CREATED == table_entry->undo->fate)
+ tlstmAddrTable_removeEntry(table_data, table_row);
+ else
+ _freeUndo(table_entry);
+ } /* for requests */
+ break; /* case MODE_SET_UNDO */
+
+ /** ###################################################### COMMIT #####
+ *
+ * COMMIT is the final success state, when all changes are finalized.
+ * There is not recovery state should something faile here.
+ *
+ * This the final phase for this path in the state machine.
+ */
+ case MODE_SET_COMMIT:
+ for (request = requests; request; request = request->next) {
+ table_row = netsnmp_tdata_extract_row(request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info(request);
+ table_entry = (tlstmAddrTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+
+ if (!table_entry || !table_entry->undo)
+ continue;
+
+ if ((RS_NOTREADY == table_entry->tlstmAddrRowStatus) &&
+ table_entry->undo->is_consistent)
+ table_entry->tlstmAddrRowStatus = RS_NOTINSERVICE;
+ else if ((RS_NOTINSERVICE == table_entry->tlstmAddrRowStatus) &&
+ (0 == table_entry->undo->is_consistent))
+ table_entry->tlstmAddrRowStatus = RS_NOTREADY;
+
+ /** release undo data for requests with no rowstatus */
+ if (table_entry->undo &&
+ !table_entry->undo->req[COLUMN_SNMPTLSTMADDRROWSTATUS] != 0) {
+
+ _freeUndo(table_entry);
+
+ /** update active addrs */
+ if ((0 == table_entry->addr_flags) &&
+ (table_entry->tlstmAddrRowStatus == RS_ACTIVE))
+ _addrs_add(table_entry);
+ else if ((0 != table_entry->addr_flags) &&
+ (table_entry->tlstmAddrRowStatus == RS_DESTROY))
+ _addrs_remove(table_entry);
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SNMPTLSTMADDRROWSTATUS:
+ switch (table_entry->tlstmAddrRowStatus) {
+ case RS_CREATEANDGO:
+ /** Fall-through */
+ case RS_ACTIVE:
+ table_entry->tlstmAddrRowStatus = RS_ACTIVE;
+ if (0 == table_entry->addr_flags)
+ _addrs_add(table_entry);
+ break;
+
+ case RS_CREATEANDWAIT:
+ /** Fall-through */
+ case RS_NOTINSERVICE:
+ /** simply set status based on consistency */
+ if (table_entry->undo->is_consistent)
+ table_entry->tlstmAddrRowStatus =
+ RS_NOTINSERVICE;
+ else
+ table_entry->tlstmAddrRowStatus = RS_NOTREADY;
+ if (0 != table_entry->addr_flags)
+ _addrs_remove(table_entry);
+ break;
+
+ case RS_DESTROY:
+ if (0 != table_entry->addr_flags)
+ _addrs_remove(table_entry);
+ /** disassociate row with requests */
+ netsnmp_remove_tdata_row(request, table_row);
+ tlstmAddrTable_removeEntry(table_data, table_row);
+ table_row = NULL;
+ table_entry = NULL;
+ }
+ /** release undo data */
+ _freeUndo(table_entry);
+ break; /* case COLUMN_SNMPTLSTMADDRROWSTATUS */
+
+ case COLUMN_SNMPTLSTMADDRSTORAGETYPE:
+ if (RS_ACTIVE == table_entry->tlstmAddrRowStatus)
+ _addr_tweak_storage(table_entry);
+ break;
+
+ case COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT:
+ case COLUMN_SNMPTLSTMADDRSERVERIDENTITY:
+ break;
+ } /* switch colnum */
+ } /* for requests */
+
+ /** update last changed */
+ _last_changed = netsnmp_get_agent_uptime();
+
+ /** set up to save persistent store */
+ snmp_store_needed(NULL);
+
+ break; /* case MODE_SET_COMMIT */
+ } /* switch (reqinfo->mode) */
+
+ if (ret != SNMP_ERR_NOERROR)
+ netsnmp_set_request_error(reqinfo, request, ret);
+
+ return SNMP_ERR_NOERROR;
+}
+
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+static int
+_count_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int val;
+
+ if (MODE_GET != reqinfo->mode) {
+ snmp_log(LOG_ERR, "bad mode in RO handler");
+ return SNMP_ERR_GENERR;
+ }
+
+ if ((NULL == _table_data) || (NULL == _table_data->container))
+ val = 0;
+ else
+ val = CONTAINER_SIZE(_table_data->container);
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE,
+ (u_char *) &val, sizeof(val));
+
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+
+ return SNMP_ERR_NOERROR;
+}
+
+/** **************************************************************************
+ *
+ * handle cache / interactions with tlstmAddr container in snmplib
+ *
+ ** *************************************************************************/
+static void
+_addrs_add(tlstmAddrTable_entry *entry)
+{
+ netsnmp_container *addrs;
+ snmpTlstmAddr *addr;
+
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("tlstmAddrTable:addrs:add", "name %s, fp %s\n",
+ entry->snmpTargetAddrName, entry->tlstmAddrServerFingerprint));
+
+ /** get current active addrs */
+ addrs = netsnmp_tlstmAddr_container();
+ if (NULL == addrs)
+ return;
+
+ addr = netsnmp_tlstmAddr_create(entry->snmpTargetAddrName);
+ if (NULL == addr)
+ return;
+
+ if (entry->tlstmAddrServerFingerprint_len)
+ addr->fingerprint = strdup(entry->tlstmAddrServerFingerprint);
+ if (entry->tlstmAddrServerIdentity_len)
+ addr->identity = strdup(entry->tlstmAddrServerIdentity);
+ addr->hashType = entry->hashType;
+
+ addr->flags = TLSTM_ADDR_FROM_MIB;
+ if (entry->tlstmAddrStorageType == ST_NONVOLATILE)
+ addr->flags |= TLSTM_ADDR_NONVOLATILE;
+
+ if (CONTAINER_INSERT(addrs, addr) != 0) {
+ netsnmp_tlstmAddr_free(addr);
+ snmp_log(LOG_ERR, "could not insert new tlstm addr");
+ }
+}
+
+static void
+_addrs_remove(tlstmAddrTable_entry *entry)
+{
+ netsnmp_container *addrs;
+ snmpTlstmAddr addr;
+
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("tlstmAddrTable:addr:remove", "name %s, fp %s\n",
+ entry->snmpTargetAddrName, entry->tlstmAddrServerFingerprint));
+
+ /** get current active addrs */
+ addrs = netsnmp_tlstmAddr_container();
+ if (NULL == addrs)
+ return;
+
+ addr.name = entry->snmpTargetAddrName;
+ if (CONTAINER_REMOVE(addrs, &addr) != 0) {
+ snmp_log(LOG_ERR, "could not remove tlstm addr");
+ }
+ entry->addr_flags = 0;
+}
+
+static void
+_addr_tweak_storage(tlstmAddrTable_entry *entry)
+{
+ netsnmp_container *addrs;
+ snmpTlstmAddr *addr, index;
+
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("tlstmAddrTable:addr:tweak", "name %s, st %d\n",
+ entry->snmpTargetAddrName, entry->tlstmAddrStorageType));
+
+ /** get current active addrs */
+ addrs = netsnmp_tlstmAddr_container();
+ if (NULL == addrs)
+ return;
+
+ index.name = entry->snmpTargetAddrName;
+ addr = CONTAINER_FIND(addrs, &index);
+ if (NULL == addr) {
+ DEBUGMSGTL(("tlstmAddrTable:addr:tweak", "couldn't find addr!\n"));
+ return;
+ }
+
+ if (entry->tlstmAddrStorageType == ST_NONVOLATILE)
+ addr->flags |= TLSTM_ADDR_NONVOLATILE;
+ else
+ addr->flags &= ~TLSTM_ADDR_NONVOLATILE;
+}
+
+static netsnmp_tdata_row *
+_entry_from_addr(snmpTlstmAddr *addr)
+{
+ netsnmp_tdata_row *row;
+ tlstmAddrTable_entry *entry;
+
+ row = tlstmAddrTable_createEntry(NULL, addr->name, strlen(addr->name));
+ if (NULL == row) {
+ snmp_log(LOG_ERR, "can create tlstmAddr row entry\n");
+ return NULL;
+ }
+ entry = row->data;
+
+ if (addr->flags & TLSTM_ADDR_FROM_CONFIG)
+ entry->tlstmAddrStorageType = ST_PERMANENT;
+ else if (! (addr->flags & TLSTM_ADDR_NONVOLATILE))
+ entry->tlstmAddrStorageType = ST_VOLATILE;
+
+ entry->tlstmAddrRowStatus = RS_ACTIVE;
+
+ if (addr->fingerprint) {
+ entry->tlstmAddrServerFingerprint_len = strlen(addr->fingerprint);
+ if (entry->tlstmAddrServerFingerprint_len >
+ sizeof(entry->tlstmAddrServerFingerprint))
+ entry->tlstmAddrServerFingerprint_len =
+ sizeof(entry->tlstmAddrServerFingerprint) - 1;
+ memcpy(entry->tlstmAddrServerFingerprint, addr->fingerprint,
+ entry->tlstmAddrServerFingerprint_len);
+ entry->tlstmAddrServerFingerprint[sizeof(entry->tlstmAddrServerFingerprint) - 1] = 0;
+ }
+
+ if (addr->identity) {
+ entry->tlstmAddrServerIdentity_len = strlen(addr->identity);
+ if (entry->tlstmAddrServerIdentity_len >
+ sizeof(entry->tlstmAddrServerIdentity))
+ entry->tlstmAddrServerIdentity_len =
+ sizeof(entry->tlstmAddrServerIdentity) - 1;
+ memcpy(entry->tlstmAddrServerIdentity, addr->identity,
+ entry->tlstmAddrServerIdentity_len);
+ entry->tlstmAddrServerIdentity[sizeof(entry->tlstmAddrServerIdentity) - 1] = 0;
+ }
+
+ entry->hashType = addr->hashType;
+ entry->addr_flags = addr->flags;
+
+ return row;
+}
+
+static int
+_cache_load(netsnmp_cache *cache, netsnmp_tdata *table)
+{
+ netsnmp_container *addrs;
+ netsnmp_iterator *itr;
+ snmpTlstmAddr *addr;
+ netsnmp_tdata_row *row;
+ int rc = 0;
+
+ DEBUGMSGTL(("tlstmAddrTable:cache:load", "called, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+
+ /** get current active rows */
+ addrs = netsnmp_tlstmAddr_container();
+ if (NULL == addrs)
+ return 0;
+
+ DEBUGMSGTL(("tlstmAddrTable:cache:load", "tlstmAddr %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(addrs)));
+ itr = CONTAINER_ITERATOR(addrs);
+ if (NULL == itr) {
+ DEBUGMSGTL(("tlstmAddrTable:cache:load",
+ "cant get iterator\n"));
+ return -1;
+ }
+
+ /*
+ * insert rows for active addrs into tbl container
+ */
+ addr = ITERATOR_FIRST(itr);
+ for( ; addr; addr = ITERATOR_NEXT(itr)) {
+
+ row = _entry_from_addr(addr);
+ if (NULL == row) {
+ rc =-1;
+ break;
+ }
+
+ if (netsnmp_tdata_add_row(table, row) != SNMPERR_SUCCESS) {
+ tlstmAddrTable_removeEntry(NULL, row);
+ rc = -1;
+ break;
+ }
+ }
+ ITERATOR_RELEASE(itr);
+
+ DEBUGMSGTL(("tlstmAddrTable:cache:load", "done, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+
+ return rc;
+}
+
+static void
+_cache_free(netsnmp_cache *cache, netsnmp_tdata *table)
+{
+ netsnmp_tdata_row *row;
+ netsnmp_iterator *tbl_itr;
+ tlstmAddrTable_entry *entry;
+
+ DEBUGMSGTL(("tlstmAddrTable:cache:free", "called, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+
+ tbl_itr = CONTAINER_ITERATOR(table->container);
+ if (NULL == tbl_itr) {
+ DEBUGMSGTL(("tlstmAddrTable:cache:free",
+ "cant get entry iterator\n"));
+ return;
+ }
+
+ row = ITERATOR_FIRST(tbl_itr);
+ for( ; row; row = ITERATOR_NEXT(tbl_itr)) {
+ entry = row->data;
+
+ /*
+ * remove all active rows (they are in the addrs container kept
+ * by the library). Keep inactive ones for next time.
+ */
+ if (entry->tlstmAddrRowStatus == RS_ACTIVE) {
+ tlstmAddrTable_removeEntry(NULL, row);
+ ITERATOR_REMOVE(tbl_itr);
+ continue;
+ }
+ }
+ ITERATOR_RELEASE(tbl_itr);
+
+ DEBUGMSGTL(("tlstmAddrTable:cache:free", "done, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+}
+
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+
+static int _tlstmAddrTable_save_rows(int majorID, int minorID,
+ void *serverarg,
+ void *clientarg);
+static void _tlstmAddrTable_row_restore_mib(const char *token,
+ char *buf);
+static const char mib_token[] = "snmpTlstmAddrEntry";
+
+/************************************************************
+ * *_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.
+ */
+static void
+_tlstmAddr_init_persistence(void)
+{
+ int rc;
+
+ if (NULL == _table_data) {
+ snmp_log(LOG_ERR, "no table data for tlstmAddr persistence!\n");
+ return;
+ }
+
+ register_config_handler(NULL, mib_token,
+ _tlstmAddrTable_row_restore_mib, NULL,
+ NULL);
+ rc = snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_STORE_DATA,
+ _tlstmAddrTable_save_rows,
+ _table_data->container);
+
+ if (rc != SNMP_ERR_NOERROR)
+ snmp_log(LOG_ERR, "error registering for STORE_DATA callback "
+ "in _tlstmAddrTable_init_persistence\n");
+}
+
+static int
+_save_entry(tlstmAddrTable_entry *entry, void *type)
+{
+ char buf[SNMP_MAXBUF_SMALL], *hashType;
+
+ hashType = se_find_label_in_slist("cert_hash_alg", entry->hashType);
+ if (NULL == hashType) {
+ snmp_log(LOG_ERR, "skipping entry unknown hash type %d\n",
+ entry->hashType);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * build the line
+ */
+ netsnmp_assert(0 == entry->snmpTargetAddrName[
+ entry->snmpTargetAddrName_len]);
+ netsnmp_assert(0 == entry->tlstmAddrServerFingerprint[
+ entry->tlstmAddrServerFingerprint_len]);
+ snprintf(buf, sizeof(buf), "%s %s --%s %s %s %d", mib_token,
+ entry->snmpTargetAddrName, hashType,
+ entry->tlstmAddrServerFingerprint,
+ entry->tlstmAddrServerIdentity,
+ entry->tlstmAddrRowStatus);
+ buf[sizeof(buf)-1] = 0;
+
+ read_config_store(type, buf);
+ DEBUGMSGTL(("tlstmAddrTable:row:save", "saving entry '%s'\n", buf));
+
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+_save_addrs(snmpTlstmAddr *addrs, void *app_type)
+{
+ char buf[SNMP_MAXBUF_SMALL], *hashType;
+
+ if (NULL == addrs)
+ return SNMP_ERR_GENERR;
+
+ hashType = se_find_label_in_slist("cert_hash_alg", addrs->hashType);
+ if (NULL == hashType) {
+ snmp_log(LOG_ERR, "skipping entry unknown hash type %d\n",
+ addrs->hashType);
+ return SNMP_ERR_GENERR;
+ }
+ snprintf(buf, sizeof(buf), "%s %s --%s %s %s %d", mib_token, addrs->name,
+ hashType, addrs->fingerprint, addrs->identity, RS_ACTIVE);
+
+ DEBUGMSGTL(("tlstmAddrTable:addrs:save", "saving addrs '%s'\n",
+ buf));
+ read_config_store(app_type, buf);
+
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+_tlstmAddrTable_save_rows(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char sep[] =
+ "##############################################################";
+ char buf[] = "#\n" "# tlstmAddr persistent data\n" "#";
+ char *type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+
+ netsnmp_container *mib_addrs = (netsnmp_container *) clientarg;
+ netsnmp_container *active_addrs = netsnmp_tlstmAddr_container();
+ netsnmp_iterator *tbl_itr, *addrs_itr = NULL;
+ netsnmp_tdata_row *row;
+ snmpTlstmAddr *addr;
+ tlstmAddrTable_entry *entry;
+
+ if (((NULL == mib_addrs) || (CONTAINER_SIZE(mib_addrs) == 0)) &&
+ ((NULL == active_addrs) || (CONTAINER_SIZE(active_addrs) == 0)))
+ return SNMPERR_SUCCESS;
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, buf);
+
+ /*
+ * save active rows from addr container
+ */
+ if (NULL != active_addrs) {
+ addrs_itr = CONTAINER_ITERATOR(active_addrs);
+ if (NULL == addrs_itr) {
+ DEBUGMSGTL(("tlstmAddrTable:save", "cant get addrs iterator\n"));
+ addr = NULL;
+ }
+ else
+ addr = ITERATOR_FIRST(addrs_itr);
+
+ for( ; addr; addr = ITERATOR_NEXT(addrs_itr)) {
+ /** don't store config rows */
+ if ((addr->flags & TLSTM_ADDR_FROM_CONFIG) ||
+ ! (addr->flags & TLSTM_ADDR_NONVOLATILE))
+ continue;
+ _save_addrs(addr, type);
+ }
+ }
+ ITERATOR_RELEASE(addrs_itr);
+
+ /*
+ * save inactive rows from mib
+ */
+ tbl_itr = CONTAINER_ITERATOR(mib_addrs);
+ if (NULL == tbl_itr)
+ DEBUGMSGTL(("tlstmAddrTable:save", "cant get table iterator\n"));
+ else {
+ row = ITERATOR_FIRST(tbl_itr);
+ for( ; row; row = ITERATOR_NEXT(tbl_itr)) {
+ entry = row->data;
+
+ /*
+ * skip all active rows (should be in active_addrs and thus saved
+ * above) and volatile rows.
+ */
+ if ((entry->tlstmAddrRowStatus == RS_ACTIVE) ||
+ (entry->tlstmAddrStorageType != ST_NONVOLATILE))
+ continue;
+
+ _save_entry(entry, type);
+ }
+ ITERATOR_RELEASE(tbl_itr);
+ }
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, "\n");
+
+ /*
+ * never fails
+ */
+ return SNMPERR_SUCCESS;
+}
+
+static void
+_tlstmAddrTable_row_restore_mib(const char *token, char *buf)
+{
+ char name[SNMPADMINLENGTH + 1], id[SNMPADMINLENGTH + 1],
+ fingerprint[SNMPTLSFINGERPRINT_MAX_LEN + 1];
+ size_t name_len = sizeof(name), id_len = sizeof(id),
+ fp_len = sizeof(fingerprint);
+ u_char hashType, rowStatus;
+ int rc;
+
+ /** need somewhere to save rows */
+ netsnmp_assert(_table_data && _table_data->container);
+
+ rc = netsnmp_tlstmAddr_restore_common(&buf, name, &name_len, id, &id_len,
+ fingerprint, &fp_len, &hashType);
+ if (rc < 0)
+ return;
+
+ if (NULL == buf) {
+ config_perror("incomplete line");
+ return;
+ }
+ rowStatus = atoi(buf);
+
+ /*
+ * if row is active, add it to the addrs container so it is available
+ * for use. Do not add it to the table, since it will be added
+ * during cache_load.
+ */
+ if (RS_ACTIVE == rowStatus) {
+ snmpTlstmAddr *addr;
+
+ addr = netsnmp_tlstmAddr_create(name);
+ if (!addr)
+ return;
+
+ if (fp_len)
+ addr->fingerprint = strdup(fingerprint);
+ if (id_len)
+ addr->identity = strdup(id);
+ addr->hashType = hashType;
+ addr->flags = TLSTM_ADDR_FROM_MIB | TLSTM_ADDR_NONVOLATILE;
+
+ netsnmp_tlstmAddr_add(addr);
+ }
+ else {
+ netsnmp_tdata_row *row;
+ tlstmAddrTable_entry *entry;
+
+ row = tlstmAddrTable_createEntry(_table_data, name, name_len);
+ if (!row)
+ return;
+
+ entry = row->data;
+
+ entry->hashType = hashType;
+ memcpy(entry->tlstmAddrServerFingerprint,fingerprint, fp_len);
+ entry->tlstmAddrServerFingerprint_len = fp_len;
+ memcpy(entry->tlstmAddrServerIdentity, id, id_len);
+ entry->tlstmAddrServerIdentity_len = id_len;
+ entry->tlstmAddrStorageType = ST_NONVOLATILE;
+ entry->tlstmAddrRowStatus = rowStatus;
+ }
+}
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h b/agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h
new file mode 100644
index 0000000..8c0b80a
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h
@@ -0,0 +1,37 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf 15999 2007-03-25 22:32:02Z dts12 $
+ */
+#ifndef SNMPTLSTMADDRTABLE_H
+#define SNMPTLSTMADDRTABLE_H
+
+#define SNMP_TLS_TM_ADDR_COUNT SNMP_TLS_TM_BASE, 2, 2, 1, 7
+#define SNMP_TLS_TM_ADDR_CHANGED SNMP_TLS_TM_BASE, 2, 2, 1, 8
+#define SNMP_TLS_TM_ADDR_TABLE SNMP_TLS_TM_BASE, 2, 2, 1, 9
+
+/*
+ * function declarations
+ */
+void init_snmpTlstmAddrTable(void);
+
+/*
+ * index definitions for table tlstmAddrTable
+ */
+#define SNMPTARGETADDRNAME_MAX_SIZE 255
+
+/*
+ * column number definitions for table tlstmAddrTable
+ */
+#define COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT 1
+#define COLUMN_SNMPTLSTMADDRSERVERIDENTITY 2
+#define COLUMN_SNMPTLSTMADDRSTORAGETYPE 3
+#define COLUMN_SNMPTLSTMADDRROWSTATUS 4
+
+#define TLSTMADDRTABLE_MIN_COLUMN COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT
+#define TLSTMADDRTABLE_MAX_COLUMN COLUMN_SNMPTLSTMADDRROWSTATUS
+
+#define TLSTMADDRSERVERFINGERPRINT_MAX_SIZE 255
+#define TLSTMADDRSERVERIDENTITY_MAX_SIZE 255
+
+
+#endif /* SNMPTLSTMADDRTABLE_H */
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable.h b/agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable.h
new file mode 100644
index 0000000..ebfa0ec
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable.h
@@ -0,0 +1,6 @@
+#ifndef SNMPTLSTMCERTTOTSNTABLE_H
+#define SNMPTLSTMCERTTOTSNTABLE_H
+
+config_require(tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable)
+
+#endif /* SNMPTLSTMCERTTOTSNTABLE_H */
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c b/agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c
new file mode 100644
index 0000000..84d1afb
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.c
@@ -0,0 +1,1377 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <openssl/ssl.h>
+#include <openssl/x509.h>
+#include <net-snmp/library/cert_util.h>
+#include "tlstm-mib.h"
+#include "snmpTlstmCertToTSNTable.h"
+
+netsnmp_feature_require(table_tdata)
+netsnmp_feature_require(cert_fingerprints)
+netsnmp_feature_require(table_tdata_delete_table)
+netsnmp_feature_require(table_tdata_extract_table)
+netsnmp_feature_require(table_tdata_remove_row)
+netsnmp_feature_require(tls_fingerprint_build)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_storagetype)
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(check_vb_rowstatus_with_storagetype)
+netsnmp_feature_require(table_tdata_insert_row)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/** XXX - move these to table_data header? */
+#define FATE_NEWLY_CREATED 1
+#define FATE_NO_CHANGE 0
+#define FATE_DELETE_ME -1
+
+#define MAP_MIB_CONFIG_TOKEN "snmpTlstmCertToTSNEntry"
+
+extern netsnmp_cert_map *netsnmp_certToTSN_parse_common(char **line);
+
+
+ /*
+ * structure for undo storage and other vars for set processing
+ */
+typedef struct certToTSN_undo_s {
+ char fate;
+ char copied;
+ char is_consistent;
+ netsnmp_request_info *req[SNMPTLSTMCERTTOTSN_TABLE_MAX_COL+1];
+
+ /*
+ * undo Column space
+ */
+ char fingerprint[SNMPTLSTMCERTTOTSN_FINGERPRINT_MAX_SIZE];
+ size_t fingerprint_len;
+ int mapType;
+ char data[SNMPTLSTMCERTTOTSN_DATA_MAX_SIZE];
+ size_t data_len;
+ u_char hashType;
+ char storageType;
+ char rowStatus;
+} certToTSN_undo;
+
+ /*
+ * Typical data structure for a row entry
+ */
+typedef struct certToTSN_entry_s {
+ /*
+ * Index values
+ */
+ u_long tlstmCertToTSNID;
+
+ /*
+ * Column values
+ */
+ char fingerprint[SNMPTLSTMCERTTOTSN_FINGERPRINT_MAX_SIZE];
+ size_t fingerprint_len;
+ int mapType;
+ char data[SNMPTLSTMCERTTOTSN_DATA_MAX_SIZE];
+ size_t data_len;
+ char storageType;
+ char rowStatus;
+ u_char hashType;
+ char map_flags;
+
+ /*
+ * used during set processing
+ */
+ certToTSN_undo *undo;
+} certToTSN_entry;
+
+static Netsnmp_Node_Handler tlstmCertToTSNTable_handler;
+static oid _oid2type(oid *val, int val_len);
+/** static int _type2oid(int type, oid *val, int *val_len); */
+static int _cache_load(netsnmp_cache *cache, netsnmp_tdata *table);
+static void _cache_free(netsnmp_cache *cache, netsnmp_tdata *table);
+static void _cert_map_add(certToTSN_entry *entry);
+static void _cert_map_remove(certToTSN_entry *entry);
+static int _count_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+static void _parse_mib_maps(const char *token, char *line);
+static int _save_maps(int majorID, int minorID, void *server, void *client);
+static int _save_map(netsnmp_cert_map *map, int row_status, void *type);
+static void _cert_map_tweak_storage(certToTSN_entry *entry);
+
+static netsnmp_tdata *_table = NULL;
+static uint32_t _last_changed = 0;
+
+
+/** Initializes the tlstmCertToTSNTable module */
+void
+init_snmpTlstmCertToTSNTable(void)
+{
+ init_snmpTlstmCertToTSNTable_context(NULL);
+}
+
+void
+init_snmpTlstmCertToTSNTable_context(const char *contextName)
+{
+ oid reg_oid[] = { SNMP_TLS_TM_CERT_TABLE };
+ const size_t reg_oid_len = OID_LENGTH(reg_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *info;
+ netsnmp_cache *cache;
+ netsnmp_watcher_info *watcher;
+ const char *mib_map_help =
+ MAP_MIB_CONFIG_TOKEN " table persistence (internal use)";
+
+ DEBUGMSGTL(("tlstmCertToSN:init",
+ "initializing table tlstmCertToTSNTable\n"));
+
+ reg = netsnmp_create_handler_registration
+ ("tlstmCertToTSNTable", tlstmCertToTSNTable_handler,
+ reg_oid, reg_oid_len,
+ HANDLER_CAN_RWRITE);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,
+ "error creating handler registration for tlstmCertToSN\n");
+ return;
+ }
+
+ if (NULL != contextName)
+ reg->contextName = strdup(contextName);
+
+ _table = netsnmp_tdata_create_table("tlstmCertToTSNTable", 0);
+ if (NULL == _table) {
+ snmp_log(LOG_ERR,
+ "error creating tdata table for tlstmCertToTSNTable\n");
+ return;
+ }
+ info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == info) {
+ snmp_log(LOG_ERR,
+ "error creating table info for tlstmCertToTSNTable\n");
+ netsnmp_tdata_delete_table(_table);
+ _table = NULL;
+ return;
+ }
+ netsnmp_table_helper_add_indexes(info,
+ /* index: tlstmCertToTSNID */
+ ASN_UNSIGNED, 0);
+
+ info->min_column = SNMPTLSTMCERTTOTSN_TABLE_MIN_COL;
+ info->max_column = SNMPTLSTMCERTTOTSN_TABLE_MAX_COL;
+
+ /*
+ * cache init
+ */
+ cache = netsnmp_cache_create(30, (NetsnmpCacheLoad*)_cache_load,
+ (NetsnmpCacheFree*)_cache_free,
+ reg_oid,
+ reg_oid_len);
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"error creating cache for tlstmCertToTSNTable\n");
+ netsnmp_tdata_delete_table(_table);
+ _table = NULL;
+ return;
+ }
+ cache->magic = (void *)_table;
+ cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ netsnmp_tdata_register(reg, _table, info);
+
+ if (cache)
+ netsnmp_inject_handler_before( reg, netsnmp_cache_handler_get(cache),
+ "table_container");
+
+ /*
+ * register scalars
+ */
+ reg_oid[10] = 1;
+ reg = netsnmp_create_handler_registration("snmpTlstmCertToTSNCount",
+ _count_handler, reg_oid,
+ OID_LENGTH(reg_oid),
+ HANDLER_CAN_RONLY);
+ if (NULL == reg)
+ snmp_log(LOG_ERR,
+ "could not create handler for snmpTlstmCertToTSNCount\n");
+ else {
+ if (NULL != contextName)
+ reg->contextName = strdup(contextName);
+
+ netsnmp_register_scalar(reg);
+ if (cache)
+ netsnmp_inject_handler_before(reg, netsnmp_cache_handler_get(cache),
+ "table_container");
+ }
+
+ reg_oid[10] = 2;
+ reg = netsnmp_create_handler_registration(
+ "snmpTlstmCertToTSNTableLastChanged", NULL, reg_oid,
+ OID_LENGTH(reg_oid), HANDLER_CAN_RONLY);
+ watcher = netsnmp_create_watcher_info((void*)&_last_changed,
+ sizeof(_last_changed),
+ ASN_TIMETICKS,
+ WATCHER_FIXED_SIZE);
+ if ((NULL == reg) || (NULL == watcher))
+ snmp_log(LOG_ERR,
+ "could not create handler for snmpTlstmCertToTSNCount\n");
+ else {
+ if (NULL != contextName)
+ reg->contextName = strdup(contextName);
+ netsnmp_register_watched_scalar2(reg, watcher);
+ }
+
+ /*
+ * persistence
+ */
+ register_config_handler(NULL, MAP_MIB_CONFIG_TOKEN, _parse_mib_maps, NULL,
+ mib_map_help);
+ if (snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ _save_maps, NULL) != SNMP_ERR_NOERROR)
+ snmp_log(LOG_ERR, "error registering for STORE_DATA callback "
+ "for certToTSN\n");
+
+}
+
+/*
+ * create a new row in the table
+ */
+netsnmp_tdata_row *
+tlstmCertToTSNTable_createEntry(netsnmp_tdata * table, u_long tlstmCertToTSNID)
+{
+ certToTSN_entry *entry;
+ netsnmp_tdata_row *row;
+
+ entry = SNMP_MALLOC_TYPEDEF(certToTSN_entry);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+
+ DEBUGMSGT(("tlstmCertToSN:entry:create", "entry %p / row %p\n",
+ entry, row));
+ /*
+ * populate index
+ */
+ entry->tlstmCertToTSNID = tlstmCertToTSNID;
+ netsnmp_tdata_row_add_index(row, ASN_UNSIGNED,
+ &(entry->tlstmCertToTSNID),
+ sizeof(entry->tlstmCertToTSNID));
+ /*
+ * assign default column values
+ */
+ entry->mapType = TSNM_tlstmCertSpecified;
+ entry->storageType = ST_NONVOLATILE;
+ entry->rowStatus = RS_NOTREADY;
+
+ if (table) {
+ DEBUGMSGTL(("tlstmCertToTSN:row:insert", "row %p\n", row));
+ netsnmp_tdata_add_row(table, row);
+ }
+ return row;
+}
+
+/*
+ * allocate undo resources
+ */
+static certToTSN_undo *
+_allocUndo(certToTSN_entry * entry)
+{
+ if (!entry)
+ return NULL;
+
+ netsnmp_assert(!entry->undo);
+
+ entry->undo = SNMP_MALLOC_TYPEDEF(certToTSN_undo);
+ if (!entry->undo)
+ return NULL;
+
+ entry->undo->is_consistent = -1; /* don't know */
+
+ return entry->undo;
+}
+
+/*
+ * free undo resources
+ */
+static void
+_freeUndo(certToTSN_entry * entry)
+{
+ if (!entry || !entry->undo)
+ return;
+
+ /*
+ * TODO: release any allocated resources
+ */
+ SNMP_FREE(entry->undo);
+}
+
+/*
+ * remove a row from the table
+ */
+void
+tlstmCertToTSNTable_removeEntry(netsnmp_tdata * table,
+ netsnmp_tdata_row * row)
+{
+ certToTSN_entry *entry;
+
+ if (!row)
+ return; /* Nothing to remove */
+
+ entry = (certToTSN_entry *) row->data;
+
+ DEBUGMSGT(("tlstmCertToSN:entry:delete", "entry %p / row %p\n",
+ entry, row));
+
+ if (entry && entry->undo)
+ _freeUndo(entry);
+ SNMP_FREE(entry);
+
+ if (table) {
+ DEBUGMSGTL(("tlstmCertToSN:row:remove", "row %p\n", row));
+ netsnmp_tdata_remove_and_delete_row(table, row);
+ }
+ else
+ netsnmp_tdata_delete_row(row);
+}
+
+
+/** handles requests for the tlstmCertToTSNTable table */
+static int
+tlstmCertToTSNTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ oid tsnm[] = { SNMP_TLS_TM_BASE, 1, 1, 0 };
+ static const int tsnm_pos = OID_LENGTH(tsnm) - 1;
+ netsnmp_request_info *request = NULL;
+ netsnmp_table_request_info *info;
+ netsnmp_tdata *table;
+ netsnmp_tdata_row *row;
+ certToTSN_entry *entry;
+ int ret = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("tlstmCertToSN:handler", "Processing request (mode %s (%d))\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode),
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /** ######################################################### GET #####
+ *
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ entry = (certToTSN_entry *) netsnmp_tdata_extract_entry(request);
+ info = netsnmp_extract_table_info(request);
+ netsnmp_assert(entry && info);
+
+ switch (info->colnum) {
+ case COL_SNMPTLSTMCERTTOTSN_FINGERPRINT:
+ {
+ /*
+ * build SnmpTLSFingerprint
+ */
+ u_char bin[42], *ptr = bin;
+ size_t len = sizeof(bin);
+ int rc;
+ rc = netsnmp_tls_fingerprint_build(entry->hashType,
+ entry->fingerprint,
+ &ptr, &len, 0);
+ if (SNMPERR_SUCCESS != rc)
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_GENERR);
+ else
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ bin, len);
+ }
+ break; /* case COL_SNMPTLSTMCERTTOTSN_FINGERPRINT */
+ case COL_SNMPTLSTMCERTTOTSN_MAPTYPE:
+ tsnm[tsnm_pos] = entry->mapType;
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ tsnm, sizeof(tsnm));
+ break; /* case COL_SNMPTLSTMCERTTOTSN_MAPTYPE */
+ case COL_SNMPTLSTMCERTTOTSN_DATA:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->data, entry->data_len);
+ break; /* case COL_SNMPTLSTMCERTTOTSN_DATA */
+ case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->storageType);
+ break; /* case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE */
+ case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->rowStatus);
+ break; /* case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS */
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ break;
+ } /* switch colnum */
+ } /* for requests */
+ break; /* case MODE_GET */
+
+ /*
+ * Write-support
+ */
+ /** #################################################### RESERVE1 #####
+ *
+ * In RESERVE1 we are just checking basic ASN.1 size/type restrictions.
+ * You probably don't need to change any of this code. Don't change any
+ * of the column values here. Save that for the ACTION phase.
+ *
+ * The next phase is RESERVE2 or FREE.
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ netsnmp_assert(request->processed == 0);
+
+ entry = (certToTSN_entry *) netsnmp_tdata_extract_entry(request);
+ info = netsnmp_extract_table_info(request);
+
+ if ((NULL != entry) && (ST_READONLY == entry->storageType)) {
+ ret = SNMP_ERR_NOTWRITABLE;
+ break;
+ }
+
+ switch (info->colnum) {
+ case COL_SNMPTLSTMCERTTOTSN_FINGERPRINT:
+ ret = netsnmp_check_vb_type_and_max_size
+ (request->requestvb, ASN_OCTET_STR,
+ sizeof(entry->fingerprint));
+ /** check len/algorithm MIB requirements */
+ if (ret == SNMP_ERR_NOERROR)
+ ret = netsnmp_cert_check_vb_fingerprint(request->requestvb);
+ break; /* case COL_SNMPTLSTMCERTTOTSN_FINGERPRINT */
+ case COL_SNMPTLSTMCERTTOTSN_MAPTYPE:
+ ret = netsnmp_check_vb_type_and_max_size
+ (request->requestvb, ASN_OBJECT_ID,
+ SNMPTLSTMCERTTOTSN_MAPTYPE_MAX_SIZE);
+ if (ret == SNMP_ERR_NOERROR) {
+ if (_oid2type(request->requestvb->val.objid,
+ request->requestvb->val_len) >
+ TSNM_tlstmCert_MAX)
+ ret = SNMP_ERR_WRONGVALUE;
+ }
+ break; /* case COL_SNMPTLSTMCERTTOTSN_MAPTYPE */
+ case COL_SNMPTLSTMCERTTOTSN_DATA:
+ ret = netsnmp_check_vb_type_and_max_size
+ (request->requestvb, ASN_OCTET_STR, sizeof(entry->data));
+ break; /* case COL_SNMPTLSTMCERTTOTSN_DATA */
+ case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE:
+ ret = netsnmp_check_vb_storagetype
+ (request->requestvb,(entry ? entry->storageType : ST_NONE));
+ break; /* case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE */
+ case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS:
+ ret = netsnmp_check_vb_rowstatus_with_storagetype
+ (request->requestvb,
+ (entry ? entry->rowStatus :RS_NONEXISTENT),
+ (entry ? entry->storageType :ST_NONE));
+ break; /* case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS */
+ default:
+ ret = SNMP_ERR_NOTWRITABLE;
+ } /* switch colnum */
+
+ if (ret != SNMP_ERR_NOERROR)
+ break;
+ } /* for requests */
+ break; /* case MODE_SET_RESERVE1 */
+
+ /** #################################################### RESERVE2 #####
+ *
+ * RESERVE2 is for checking additional restrictions from the MIB.
+ * Since these restrictions are often in the description of the object,
+ * mib2c can't generate code. It's possible that you need to add
+ * additional checks here. However, don't change any of the column
+ * values here. Save that for the ACTION phase.
+ *
+ * The next phase is ACTION or FREE.
+ */
+ case MODE_SET_RESERVE2:
+ for (request = requests; request; request = request->next) {
+ netsnmp_assert(request->processed == 0);
+
+ entry = (certToTSN_entry *) netsnmp_tdata_extract_entry(request);
+ table = netsnmp_tdata_extract_table(request);
+ info = netsnmp_extract_table_info(request);
+ /*
+ * if no row, create one
+ */
+ if (!entry) {
+ row = tlstmCertToTSNTable_createEntry
+ (table,*info->indexes->val.integer);
+ if (!row) {
+ ret = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ entry = row->data;
+ _allocUndo(entry);
+ if (!entry->undo) {
+ tlstmCertToTSNTable_removeEntry(table, row);
+ row = NULL;
+ ret = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ entry->undo->fate = FATE_NEWLY_CREATED;
+ /** associate row with requests */
+ netsnmp_insert_tdata_row(request, row);
+ }
+
+ /** allocate undo structure, if needed */
+ if (!entry->undo) {
+ _allocUndo(entry);
+ if (!entry->undo) {
+ ret = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ }
+
+ /*
+ * save request ptr for column. if we already
+ * have a value, bail.
+ */
+ if (entry->undo->req[info->colnum]) {
+ DEBUGMSGT(("tlstmCertToSN:reserve2",
+ "multiple sets to col %d in request\n",
+ info->colnum));
+ if (FATE_NEWLY_CREATED == entry->undo->fate)
+ ret = SNMP_ERR_INCONSISTENTNAME;
+ else
+ ret = SNMP_ERR_INCONSISTENTVALUE;
+ break;
+ }
+ entry->undo->req[info->colnum] = request;
+ if (ret != SNMP_ERR_NOERROR)
+ break;
+ } /* for requests */
+
+ if (ret == SNMP_ERR_NOERROR) {
+ /** make sure rowstatus is used to create rows */
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ entry = (certToTSN_entry *)
+ netsnmp_tdata_extract_entry(request);
+ if ((entry->undo->fate != FATE_NEWLY_CREATED) ||
+ (entry->undo->req[COL_SNMPTLSTMCERTTOTSN_ROWSTATUS]))
+ continue;
+ ret = SNMP_ERR_INCONSISTENTNAME;
+ break;
+ } /* creation for requests */
+ } /* no error */
+ break; /* case MODE_SET_RESERVE2 */
+
+ /** ######################################################## FREE #####
+ *
+ * FREE is for cleaning up after a failed request (during either
+ * RESERVE1 or RESERVE2). So any allocated resources need to be
+ * released.
+ *
+ * This the final phase for this path in the state machine.
+ */
+ case MODE_SET_FREE:
+ /*
+ * release undo resources
+ * remove any newly created rows
+ */
+ for (request = requests; request; request = request->next) {
+ table = netsnmp_tdata_extract_table(request);
+ row = netsnmp_tdata_extract_row(request);
+ entry = (certToTSN_entry *) netsnmp_tdata_extract_entry(request);
+
+ if (!entry || !entry->undo)
+ continue;
+
+ /** disassociate row with requests */
+ netsnmp_remove_tdata_row(request, row);
+
+ if (FATE_NEWLY_CREATED == entry->undo->fate)
+ tlstmCertToTSNTable_removeEntry(table, row);
+ else
+ _freeUndo(entry);
+ }
+ break; /* case MODE_SET_FREE */
+
+ /** ###################################################### ACTION #####
+ *
+ * In the ACTION phase, we perform any sets that can be undone.
+ * (Save anything that can't be undone for the COMMIT phase.)
+ *
+ * After individual columns have been done, you should check that the
+ * row as a whole is consistent.
+ *
+ * The next phase is UNDO or COMMIT.
+ */
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ entry = (certToTSN_entry *) netsnmp_tdata_extract_entry(request);
+ info = netsnmp_extract_table_info(request);
+
+ /** reserve2 should enforce this */
+ netsnmp_assert(request == entry->undo->req[info->colnum]);
+
+ /*
+ * for each col, save old value and the set new value
+ */
+ switch (info->colnum) {
+ case COL_SNMPTLSTMCERTTOTSN_FINGERPRINT:
+ {
+ u_char *tmp = (u_char*)entry->fingerprint;
+ u_int size = sizeof(entry->fingerprint);
+ netsnmp_variable_list *vb = request->requestvb;
+
+ memcpy(entry->undo->fingerprint,
+ entry->fingerprint, sizeof(entry->fingerprint));
+ entry->undo->fingerprint_len = entry->fingerprint_len;
+ entry->undo->hashType = entry->hashType;
+ memset(entry->fingerprint, 0, sizeof(entry->fingerprint));
+
+ (void)netsnmp_tls_fingerprint_parse(vb->val.string, vb->val_len,
+ (char**)&tmp, &size, 0,
+ &entry->hashType);
+ entry->fingerprint_len = size;
+ if (0 == entry->fingerprint_len)
+ ret = SNMP_ERR_GENERR;
+ }
+ break; /* case COL_SNMPTLSTMCERTTOTSN_FINGERPRINT */
+ case COL_SNMPTLSTMCERTTOTSN_MAPTYPE:
+ entry->undo->mapType = entry->mapType;
+ entry->mapType = _oid2type(request->requestvb->val.objid,
+ request->requestvb->val_len);
+ break; /* case COL_SNMPTLSTMCERTTOTSN_MAPTYPE */
+ case COL_SNMPTLSTMCERTTOTSN_DATA:
+ memcpy(entry->undo->data, entry->data, sizeof(entry->data));
+ entry->undo->data_len = entry->data_len;
+ memset(entry->data, 0, sizeof(entry->data));
+ memcpy(entry->data, request->requestvb->val.string,
+ request->requestvb->val_len);
+ entry->data_len = request->requestvb->val_len;
+ break; /* case COL_SNMPTLSTMCERTTOTSN_DATA */
+ case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE:
+ entry->undo->storageType = entry->storageType;
+ entry->storageType = *request->requestvb->val.integer;
+ break; /* case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE */
+ case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS:
+ entry->undo->rowStatus = entry->rowStatus;
+ entry->rowStatus = *request->requestvb->val.integer;
+ break; /* case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS */
+ } /* switch colnum */
+ } /* set values for requests */
+
+ if (ret != SNMP_ERR_NOERROR)
+ break; /* skip consistency if we've already got error */
+
+ /*
+ * All columns now have their final values set. check the
+ * internal consistency of each row.
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (certToTSN_entry *) netsnmp_tdata_extract_entry(request);
+ info = netsnmp_extract_table_info(request);
+
+ if (entry->undo->is_consistent != -1)
+ continue; /* already checked */
+
+ /** assume consistency */
+ entry->undo->is_consistent = 1;
+
+ /*
+ * per mib, can't have empty fingerprint and must
+ * have data if indicated by map type.
+ */
+ if (0 == entry->fingerprint_len) {
+ DEBUGMSGTL(("tlstmCertToTSNTable:inconsistent",
+ "fingerprint must not be empty\n"));
+ entry->undo->is_consistent = 0;
+ }
+ else if ((TSNM_tlstmCertSpecified == entry->mapType) &&
+ (0 == entry->data_len)) {
+ DEBUGMSGTL(("tlstmCertToTSNTable:inconsistent",
+ "must specify Data for CertSpecified identity\n"));
+ entry->undo->is_consistent = 0;
+ }
+
+ if ((RS_IS_ACTIVE(entry->rowStatus)) &&
+ ((!entry->undo->req[COL_SNMPTLSTMCERTTOTSN_ROWSTATUS]) ||
+ (RS_IS_ACTIVE(entry->undo->rowStatus)))) {
+ /*
+ * per mib, can't modify these while row active
+ */
+ char _cols[3] = { COL_SNMPTLSTMCERTTOTSN_FINGERPRINT,
+ COL_SNMPTLSTMCERTTOTSN_MAPTYPE, COL_SNMPTLSTMCERTTOTSN_DATA };
+ int i;
+ for (i=0; i < 3; ++i ) {
+ if (!entry->undo->req[i])
+ continue;
+ DEBUGMSGTL(("tlstmCertToTSNTable:inconsistent",
+ "can't modify row %d while active\n",
+ _cols[i]));
+ entry->undo->is_consistent = 0;
+ ret = SNMP_ERR_NOTWRITABLE;
+ request= entry->undo->req[i];
+ break;
+ }
+ } else if (RS_IS_GOING_ACTIVE(entry->rowStatus)) {
+ /*
+ * if going active, inconsistency is fatal
+ */
+ if (!entry->undo->is_consistent) {
+ netsnmp_assert(entry->undo->req[COL_SNMPTLSTMCERTTOTSN_ROWSTATUS]);
+ if (FATE_NEWLY_CREATED == entry->undo->fate)
+ ret = SNMP_ERR_INCONSISTENTNAME;
+ else
+ ret = SNMP_ERR_INCONSISTENTVALUE;
+ request = entry->undo->req[COL_SNMPTLSTMCERTTOTSN_ROWSTATUS];
+ }
+ } else if (RS_DESTROY == entry->rowStatus) {
+ /*
+ * can't destroy active row
+ */
+ if (RS_IS_ACTIVE(entry->undo->rowStatus)) {
+ DEBUGMSGTL(("tlstmCertToTSNTable:inconsistent",
+ "can't destroy active row\n"));
+ netsnmp_assert(entry->undo->req[COL_SNMPTLSTMCERTTOTSN_ROWSTATUS]);
+ ret = SNMP_ERR_INCONSISTENTVALUE;
+ request = entry->undo->req[COL_SNMPTLSTMCERTTOTSN_ROWSTATUS];
+ }
+ }
+ if (ret != SNMP_ERR_NOERROR)
+ break;
+ } /* consistency for requests */
+ break; /* case MODE_SET_ACTION */
+
+ /** ######################################################## UNDO #####
+ *
+ * UNDO is for cleaning up any failed requests that went through the
+ * ACTION phase.
+ *
+ * This the final phase for this path in the state machine.
+ */
+ case MODE_SET_UNDO:
+ for (request = requests; request; request = request->next) {
+ row = netsnmp_tdata_extract_row(request);
+ entry = (certToTSN_entry *) netsnmp_tdata_extract_entry(request);
+ info = netsnmp_extract_table_info(request);
+
+ /*
+ * skip newly created rows, as we're going to delete
+ * them below anyways
+ */
+ if (FATE_NEWLY_CREATED == entry->undo->fate)
+ continue;
+
+ /*
+ * restore values
+ */
+ switch (info->colnum) {
+ case COL_SNMPTLSTMCERTTOTSN_FINGERPRINT:
+ memcpy(entry->fingerprint, entry->undo->fingerprint,
+ sizeof(entry->fingerprint));
+ entry->fingerprint_len = entry->undo->fingerprint_len;
+ entry->hashType = entry->undo->hashType;
+ break; /* case COL_SNMPTLSTMCERTTOTSN_FINGERPRINT */
+ case COL_SNMPTLSTMCERTTOTSN_MAPTYPE:
+ entry->mapType = entry->undo->mapType;
+ break; /* case COL_SNMPTLSTMCERTTOTSN_MAPTYPE */
+ case COL_SNMPTLSTMCERTTOTSN_DATA:
+ memcpy(entry->data, entry->undo->data, sizeof(entry->data));
+ entry->data_len = entry->undo->data_len;
+ break; /* case COL_SNMPTLSTMCERTTOTSN_DATA */
+ case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE:
+ entry->storageType = entry->undo->storageType;
+ break; /* case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE */
+ case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS:
+ entry->rowStatus = entry->undo->rowStatus;
+ break; /* case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS */
+ } /* switch colnum */
+ } /* for requests */
+
+ /*
+ * release undo data
+ * or remove any newly created rows
+ */
+ for (request = requests; request; request = request->next) {
+ table = netsnmp_tdata_extract_table(request);
+ row = netsnmp_tdata_extract_row(request);
+ entry = (certToTSN_entry *) netsnmp_tdata_extract_entry(request);
+
+ if (!entry || !entry->undo)
+ continue;
+
+ /** disassociate row with requests */
+ netsnmp_remove_tdata_row(request, row);
+
+ if (FATE_NEWLY_CREATED == entry->undo->fate)
+ tlstmCertToTSNTable_removeEntry(table, row);
+ else
+ _freeUndo(entry);
+ } /* for requests */
+ break; /* case MODE_SET_UNDO */
+
+ /** ###################################################### COMMIT #####
+ *
+ * COMMIT is the final success state, when all changes are finalized.
+ * There is not recovery state should something faile here.
+ *
+ * This the final phase for this path in the state machine.
+ */
+ case MODE_SET_COMMIT:
+ for (request = requests; request; request = request->next) {
+ row = netsnmp_tdata_extract_row(request);
+ table = netsnmp_tdata_extract_table(request);
+ info = netsnmp_extract_table_info(request);
+ entry = (certToTSN_entry *) netsnmp_tdata_extract_entry(request);
+
+ if ((RS_NOTREADY == entry->rowStatus) && entry->undo->is_consistent)
+ entry->rowStatus = RS_NOTINSERVICE;
+ else if ((RS_NOTINSERVICE == entry->rowStatus) &&
+ (0 == entry->undo->is_consistent))
+ entry->rowStatus = RS_NOTREADY;
+
+ /** release undo data for requests with no rowstatus */
+ if (entry->undo && !entry->undo->req[COL_SNMPTLSTMCERTTOTSN_ROWSTATUS]) {
+ _freeUndo(entry);
+ if ((0 == entry->map_flags) && (entry->rowStatus == RS_ACTIVE))
+ _cert_map_add(entry);
+ else if ((0 != entry->map_flags) &&
+ (entry->rowStatus == RS_DESTROY))
+ _cert_map_remove(entry);
+ }
+
+ switch (info->colnum) {
+ case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS:
+ switch (entry->rowStatus) {
+ case RS_CREATEANDGO:
+ /** Fall-through */
+ case RS_ACTIVE:
+ netsnmp_assert(entry->undo->is_consistent);
+ entry->rowStatus = RS_ACTIVE;
+ if (0 == entry->map_flags)
+ _cert_map_add(entry);
+ break;
+
+ case RS_CREATEANDWAIT:
+ /** Fall-through */
+ case RS_NOTINSERVICE:
+ /** simply set status based on consistency */
+ if (entry->undo->is_consistent)
+ entry->rowStatus = RS_NOTINSERVICE;
+ else
+ entry->rowStatus = RS_NOTREADY;
+ if (0 != entry->map_flags)
+ _cert_map_remove(entry);
+ break;
+
+ case RS_DESTROY:
+ /** remove from cert map */
+ if (0 != entry->map_flags)
+ _cert_map_remove(entry);
+ /** disassociate row with requests */
+ netsnmp_remove_tdata_row(request, row);
+ tlstmCertToTSNTable_removeEntry(table, row);
+ row = NULL;
+ entry = NULL;
+ }
+ /** release undo data */
+ _freeUndo(entry);
+ break; /* case COL_SNMPTLSTMCERTTOTSN_ROWSTATUS */
+
+ case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE:
+ if (RS_ACTIVE == entry->rowStatus)
+ _cert_map_tweak_storage(entry);
+ break; /* case COL_SNMPTLSTMCERTTOTSN_STORAGETYPE */
+
+ case COL_SNMPTLSTMCERTTOTSN_FINGERPRINT:
+ case COL_SNMPTLSTMCERTTOTSN_MAPTYPE:
+ case COL_SNMPTLSTMCERTTOTSN_DATA:
+ break;
+ } /* switch colnum */
+
+ } /* for requests */
+
+ /** update last changed */
+ _last_changed = netsnmp_get_agent_uptime();
+
+ /** set up to save persistent store */
+ snmp_store_needed(NULL);
+
+ break; /* case MODE_SET_COMMIT */
+ } /* switch (reqinfo->mode) */
+
+ if (ret != SNMP_ERR_NOERROR)
+ netsnmp_set_request_error(reqinfo, request, ret);
+
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+_count_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int val;
+
+ if (MODE_GET != reqinfo->mode) {
+ snmp_log(LOG_ERR, "bad mode in RO handler");
+ return SNMP_ERR_GENERR;
+ }
+
+ if (NULL == _table->container)
+ val = 0;
+ else
+ val = CONTAINER_SIZE(_table->container);
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE,
+ (u_char *) &val, sizeof(val));
+
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+
+ return SNMP_ERR_NOERROR;
+}
+
+static void
+_cert_map_add(certToTSN_entry *entry)
+{
+ netsnmp_cert_map *map;
+
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("tlstmCertToTSNTable:map:add", "pri %ld, fp %s\n",
+ entry->tlstmCertToTSNID, entry->fingerprint));
+
+ map = netsnmp_cert_map_alloc(entry->fingerprint, NULL);
+ if (NULL == map)
+ return;
+
+ map->priority = entry->tlstmCertToTSNID;
+ map->mapType = entry->mapType;
+ if (entry->data)
+ map->data = strdup(entry->data);
+ map->hashType = entry->hashType;
+
+ map->flags = NSCM_FROM_MIB;
+ if (entry->storageType == ST_NONVOLATILE)
+ map->flags |= NSCM_NONVOLATILE;
+
+ if (netsnmp_cert_map_add(map) != 0)
+ netsnmp_cert_map_free(map);
+}
+
+static void
+_cert_map_tweak_storage(certToTSN_entry *entry)
+{
+ netsnmp_container *maps;
+ netsnmp_cert_map *map, index;
+
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("tlstmCertToTSNTable:map:tweak", "pri %ld, st %d\n",
+ entry->tlstmCertToTSNID, entry->storageType));
+
+ /** get current active maps */
+ maps = netsnmp_cert_map_container();
+ if (NULL == maps)
+ return;
+
+ index.priority = entry->tlstmCertToTSNID;
+ map = CONTAINER_FIND(maps, &index);
+ if (NULL == map) {
+ DEBUGMSGTL(("tlstmCertToTSNTable:map:tweak", "couldn't find map!\n"));
+ return;
+ }
+
+ if (entry->storageType == ST_NONVOLATILE)
+ map->flags |= NSCM_NONVOLATILE;
+ else
+ map->flags &= ~NSCM_NONVOLATILE;
+}
+
+static void
+_cert_map_remove(certToTSN_entry *entry)
+{
+ netsnmp_container *maps;
+ netsnmp_cert_map map;
+
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("tlstmCertToTSNTable:map:remove", "pri %ld, fp %s\n",
+ entry->tlstmCertToTSNID, entry->fingerprint));
+
+ /** get current active maps */
+ maps = netsnmp_cert_map_container();
+ if (NULL == maps)
+ return;
+
+ map.priority = entry->tlstmCertToTSNID;
+ map.fingerprint = entry->fingerprint;
+
+ if (CONTAINER_REMOVE(maps, &map) != 0) {
+ snmp_log(LOG_ERR, "could not remove certificate map");
+ }
+ entry->map_flags = 0;
+}
+
+static netsnmp_tdata_row *
+_entry_from_map(netsnmp_cert_map *map)
+{
+ netsnmp_tdata_row *row;
+ certToTSN_entry *entry;
+
+ row = tlstmCertToTSNTable_createEntry(NULL, map->priority);
+ if (NULL == row) {
+ snmp_log(LOG_ERR, "can create tlstmCertToTSN row entry\n");
+ return NULL;
+ }
+ entry = row->data;
+
+ if (map->flags & NSCM_FROM_CONFIG)
+ entry->storageType = ST_PERMANENT;
+ else if (! (map->flags & NSCM_NONVOLATILE))
+ entry->storageType = ST_VOLATILE;
+ entry->map_flags = map->flags;
+
+ entry->fingerprint_len = strlen(map->fingerprint);
+ if (entry->fingerprint_len > sizeof(entry->fingerprint))
+ entry->fingerprint_len = sizeof(entry->fingerprint) - 1;
+ memcpy(entry->fingerprint, map->fingerprint, entry->fingerprint_len);
+ entry->fingerprint[sizeof(entry->fingerprint) - 1] = 0;
+ entry->hashType = map->hashType;
+
+ if (map->data) {
+ entry->data_len = strlen(map->data);
+ if (entry->data_len) {
+ if (entry->data_len > sizeof(entry->data))
+ entry->data_len = sizeof(entry->data) - 1;
+ memcpy(entry->data, map->data, entry->data_len);
+ entry->data[sizeof(entry->data) - 1] = 0;
+ }
+ }
+ entry->mapType = map->mapType;
+
+ return row;
+}
+
+static int
+_cache_load(netsnmp_cache *cache, netsnmp_tdata *table)
+{
+ netsnmp_container *maps;
+ netsnmp_iterator *map_itr;
+ netsnmp_cert_map *map;
+ netsnmp_tdata_row *row;
+ certToTSN_entry *entry;
+ int rc = 0;
+
+ DEBUGMSGTL(("tlstmCertToTSNTable:cache:load", "called, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+
+ /** get current active maps */
+ maps = netsnmp_cert_map_container();
+ if (NULL == maps)
+ return 0;
+ DEBUGMSGTL(("tlstmCertToTSNTable:cache:load", "maps %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(maps)));
+
+ map_itr = CONTAINER_ITERATOR(maps);
+ if (NULL == map_itr) {
+ DEBUGMSGTL(("tlstmCertToTSNTable:cache:load",
+ "cant get map iterator\n"));
+ return -1;
+ }
+
+ /*
+ * insert rows for active maps into tbl container
+ */
+ map = ITERATOR_FIRST(map_itr);
+ for( ; map; map = ITERATOR_NEXT(map_itr)) {
+
+ row = _entry_from_map(map);
+ if (NULL == row) {
+ rc =-1;
+ break;
+ }
+ entry = (certToTSN_entry*)row->data;
+ entry->rowStatus = RS_ACTIVE;
+
+ if (netsnmp_tdata_add_row(table, row) != SNMPERR_SUCCESS) {
+ tlstmCertToTSNTable_removeEntry(NULL, row);
+ rc = -1;
+ break;
+ }
+ }
+ ITERATOR_RELEASE(map_itr);
+
+ DEBUGMSGTL(("tlstmCertToTSNTable:cache:load", "done, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+
+ return rc;
+}
+
+static void
+_cache_free(netsnmp_cache *cache, netsnmp_tdata *table)
+{
+ netsnmp_tdata_row *row;
+ netsnmp_iterator *tbl_itr;
+ certToTSN_entry *entry;
+
+ DEBUGMSGTL(("tlstmCertToTSNTable:cache:free", "called, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+
+ /** insert rows for active maps into tbl container */
+ tbl_itr = CONTAINER_ITERATOR(table->container);
+ if (NULL == tbl_itr) {
+ DEBUGMSGTL(("tlstmCertToTSNTable:cache:free",
+ "cant get map iterator\n"));
+ return;
+ }
+
+ row = ITERATOR_FIRST(tbl_itr);
+ for( ; row; row = ITERATOR_NEXT(tbl_itr)) {
+ entry = row->data;
+
+ /*
+ * remove all active rows (they are in the maps container kept
+ * by the library). Keep inactive ones for next time.
+ */
+ if (entry->rowStatus == RS_ACTIVE) {
+ tlstmCertToTSNTable_removeEntry(NULL, row);
+ ITERATOR_REMOVE(tbl_itr);
+ continue;
+ }
+ }
+ ITERATOR_RELEASE(tbl_itr);
+
+ DEBUGMSGTL(("tlstmCertToTSNTable:cache:free", "done, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+}
+
+static void
+_parse_mib_maps(const char *token, char *line)
+{
+ netsnmp_tdata_row *row;
+ certToTSN_entry *entry;
+ netsnmp_cert_map *map = netsnmp_certToTSN_parse_common(&line);
+
+ if (NULL == line) {
+ netsnmp_config_error("incomplete line");
+ netsnmp_cert_map_free(map);
+ return;
+ }
+
+ map->flags = NSCM_FROM_MIB | NSCM_NONVOLATILE;
+ row = _entry_from_map(map);
+ if (NULL == row) {
+ netsnmp_cert_map_free(map);
+ return;
+ }
+
+ entry = (certToTSN_entry*)row->data;
+ entry->rowStatus = atoi(line);
+ entry->storageType = ST_NONVOLATILE;
+
+ /*
+ * if row is active, add it to the maps container so it is available
+ * for use. Do not add it to the table, since it will be added
+ * during cache_load.
+ */
+ if (RS_ACTIVE == entry->rowStatus) {
+ if (netsnmp_cert_map_add(map) != 0)
+ netsnmp_cert_map_free(map);
+ }
+ else {
+ netsnmp_cert_map_free(map);
+ if (netsnmp_tdata_add_row(_table, row) != SNMPERR_SUCCESS)
+ tlstmCertToTSNTable_removeEntry(NULL, row);
+ }
+}
+
+static int
+_save_entry(certToTSN_entry *entry, void *app_type)
+{
+ char buf[SNMP_MAXBUF_SMALL], *hashType, *mapType, *data = NULL;
+
+ if (NULL == entry)
+ return SNMP_ERR_GENERR;
+
+ hashType = se_find_label_in_slist("cert_hash_alg", entry->hashType);
+ if (NULL == hashType) {
+ snmp_log(LOG_ERR, "skipping entry unknown hash type %d\n",
+ entry->hashType);
+ return SNMP_ERR_GENERR;
+ }
+ mapType = se_find_label_in_slist("cert_map_type", entry->mapType);
+ if (TSNM_tlstmCertSpecified == entry->mapType)
+ data = entry->data;
+ snprintf(buf, sizeof(buf), "%s %ld --%s %s --%s %s %d",
+ MAP_MIB_CONFIG_TOKEN, entry->tlstmCertToTSNID, hashType,
+ entry->fingerprint, mapType, data ? data : "", entry->rowStatus);
+
+ DEBUGMSGTL(("tlstmCertToTSNTable:save", "saving '%s'\n", buf));
+ read_config_store(app_type, buf);
+
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+_save_map(netsnmp_cert_map *map, int row_status, void *app_type)
+{
+ char buf[SNMP_MAXBUF_SMALL], *hashType, *mapType, *data = NULL;
+
+ if (NULL == map)
+ return SNMP_ERR_GENERR;
+
+ /** don't store values from conf files */
+ if (! (map->flags & NSCM_NONVOLATILE)) {
+ DEBUGMSGT(("tlstmCertToTSNTable:save",
+ "skipping RO/permanent/volatile row\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ hashType = se_find_label_in_slist("cert_hash_alg", map->hashType);
+ if (NULL == hashType) {
+ snmp_log(LOG_ERR, "skipping entry unknown hash type %d\n",
+ map->hashType);
+ return SNMP_ERR_GENERR;
+ }
+ mapType = se_find_label_in_slist("cert_map_type", map->mapType);
+ if (TSNM_tlstmCertSpecified == map->mapType)
+ data = (char*)map->data;
+ snprintf(buf, sizeof(buf), "%s %d --%s %s --%s %s %d",
+ MAP_MIB_CONFIG_TOKEN, map->priority, hashType, map->fingerprint,
+ mapType, data ? data : "", row_status);
+
+ DEBUGMSGTL(("tlstmCertToTSNTable:save", "saving '%s'\n", buf));
+ read_config_store(app_type, buf);
+
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+_save_maps(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ char sep[] =
+ "\n##############################################################";
+ char buf[] =
+ "#\n" "# certificate secName mapping persistent data\n" "#";
+ char *type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ netsnmp_container *maps = netsnmp_cert_map_container();
+ netsnmp_tdata_row *row;
+ netsnmp_iterator *tbl_itr, *map_itr;
+ netsnmp_cert_map *map;
+ certToTSN_entry *entry;
+
+ if ((NULL == maps) || ((CONTAINER_SIZE(maps) == 0) &&
+ (CONTAINER_SIZE(_table->container) == 0)))
+ return SNMPERR_SUCCESS;
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, buf);
+
+ /*
+ * save active rows from maps
+ */
+ if (NULL != maps) {
+ map_itr = CONTAINER_ITERATOR(maps);
+ if (NULL == map_itr) {
+ DEBUGMSGTL(("tlstmCertToTSNTable:save",
+ "cant get map iterator\n"));
+ map = NULL;
+ }
+ else
+ map = ITERATOR_FIRST(map_itr);
+
+ for( ; map; map = ITERATOR_NEXT(map_itr)) {
+ /** don't store config rows */
+ if (map->flags & NSCM_FROM_CONFIG)
+ continue;
+ _save_map(map, RS_ACTIVE, type);
+ }
+ }
+ ITERATOR_RELEASE(map_itr);
+
+ /*
+ * save inactive rows from mib
+ */
+ tbl_itr = CONTAINER_ITERATOR(_table->container);
+ if (NULL == tbl_itr)
+ DEBUGMSGTL(("tlstmCertToTSNTable:save", "cant get table iterator\n"));
+ else {
+ row = ITERATOR_FIRST(tbl_itr);
+ for( ; row; row = ITERATOR_NEXT(tbl_itr)) {
+ entry = row->data;
+
+ /*
+ * skip all active rows (should be in maps and thus saved
+ * above) and volatile rows.
+ */
+ if ((entry->rowStatus == RS_ACTIVE) ||
+ (entry->storageType != ST_NONVOLATILE))
+ continue;
+
+ _save_entry(entry, type);
+ }
+ ITERATOR_RELEASE(tbl_itr);
+ }
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, "\n");
+
+ /*
+ * never fails
+ */
+ return SNMPERR_SUCCESS;
+}
+
+
+static const oid _tsnm_base[] = { SNMP_TLS_TM_BASE, 1, 1 };
+static const int _tsnm_base_len = sizeof(_tsnm_base);
+
+static oid
+_oid2type(oid *val, int val_len)
+{
+ netsnmp_assert(val);
+
+ if (val_len != (_tsnm_base_len + sizeof(oid)))
+ return -1;
+
+ if (memcmp(_tsnm_base,val,_tsnm_base_len) != 0)
+ return -2;
+
+ if ((val[OID_LENGTH(_tsnm_base)] > TSNM_tlstmCert_MAX) ||
+ (0 == val[OID_LENGTH(_tsnm_base)]))
+ return -3;
+
+ return val[OID_LENGTH(_tsnm_base)];
+}
+
+#if 0
+static int
+_type2oid(int type, oid *val, int *val_len)
+{
+ netsnmp_assert( val && val_len );
+
+ if (*val_len < _tsnm_base_len + sizeof(oid))
+ return -1;
+
+ memcpy(val, _tsnm_base, _tsnm_base_len + sizeof(oid));
+ val[_tsnm_base_len + sizeof(oid)] = type;
+
+ return 0;
+}
+#endif
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h b/agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h
new file mode 100644
index 0000000..42b8097
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h
@@ -0,0 +1,47 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SNMPTLSTMCERTTOTSN_TABLE_H
+#define SNMPTLSTMCERTTOTSN_TABLE_H
+
+#define SNMP_TLS_TM_CERT_COUNT SNMP_TLS_TM_BASE, 2, 2, 1, 1
+#define SNMP_TLS_TM_CERT_CHANGED SNMP_TLS_TM_BASE, 2, 2, 1, 2
+#define SNMP_TLS_TM_CERT_TABLE SNMP_TLS_TM_BASE, 2, 2, 1, 3
+
+/*
+ * function declarations
+ */
+void init_snmpTlstmCertToTSNTable(void);
+void init_snmpTlstmCertToTSNTable_context(const char *);
+
+/*
+ * index definitions for table tlstmCertToTSNTable
+ */
+
+/*
+ * column number definitions for table tlstmCertToTSNTable
+ */
+#define COL_SNMPTLSTMCERTTOTSN_ID 1
+#define COL_SNMPTLSTMCERTTOTSN_FINGERPRINT 2
+#define COL_SNMPTLSTMCERTTOTSN_MAPTYPE 3
+#define COL_SNMPTLSTMCERTTOTSN_DATA 4
+#define COL_SNMPTLSTMCERTTOTSN_STORAGETYPE 5
+#define COL_SNMPTLSTMCERTTOTSN_ROWSTATUS 6
+
+#define SNMPTLSTMCERTTOTSN_TABLE_MIN_COL COL_SNMPTLSTMCERTTOTSN_FINGERPRINT
+#define SNMPTLSTMCERTTOTSN_TABLE_MAX_COL COL_SNMPTLSTMCERTTOTSN_ROWSTATUS
+
+#define SNMPTLSTMCERTTOTSN_FINGERPRINT_MAX_SIZE 255
+#define SNMPTLSTMCERTTOTSN_MAPTYPE_MAX_SIZE 128
+#define SNMPTLSTMCERTTOTSN_DATA_MAX_SIZE 1024
+
+#define TSNM_tlstmCertSpecified 1
+#define TSNM_tlstmCertSANRFC822Name 2
+#define TSNM_tlstmCertSANDNSName 3
+#define TSNM_tlstmCertSANIpAddress 4
+#define TSNM_tlstmCertSANAny 5
+#define TSNM_tlstmCertCommonName 6
+#define TSNM_tlstmCert_MAX TSNM_tlstmCertCommonName
+
+#endif /* SNMPTLSTMCERTTOTSN_TABLE_H */
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmParamsTable.h b/agent/mibgroup/tlstm-mib/snmpTlstmParamsTable.h
new file mode 100644
index 0000000..d814be2
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmParamsTable.h
@@ -0,0 +1,6 @@
+#ifndef SNMPTLSTMPARAMSTABLE_H
+#define SNMPTLSTMPARAMSTABLE_H
+
+config_require(tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable)
+
+#endif /* SNMPTLSTMPARAMSTABLE_H */
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c b/agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c
new file mode 100644
index 0000000..cd54452
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.c
@@ -0,0 +1,1286 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <openssl/ssl.h>
+#include <openssl/x509.h>
+#include <net-snmp/library/cert_util.h>
+#include "tlstm-mib.h"
+
+#include "snmpTlstmParamsTable.h"
+
+netsnmp_feature_require(table_tdata)
+netsnmp_feature_require(tlstmparams_find)
+netsnmp_feature_require(tlstmparams_external)
+netsnmp_feature_require(cert_fingerprints)
+netsnmp_feature_require(table_tdata_delete_table)
+netsnmp_feature_require(table_tdata_extract_table)
+netsnmp_feature_require(table_tdata_remove_row)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+netsnmp_feature_require(check_vb_storagetype)
+netsnmp_feature_require(check_vb_type_and_max_size)
+netsnmp_feature_require(check_vb_rowstatus_with_storagetype)
+netsnmp_feature_require(table_tdata_insert_row)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/** XXX - move these to table_data header? */
+#define FATE_NEWLY_CREATED 1
+#define FATE_NO_CHANGE 0
+#define FATE_DELETE_ME -1
+
+/** **************************************************************************
+ *
+ * table structures
+ *
+ */
+ /*
+ * structure for undo storage and other vars for set processing
+ */
+ typedef struct snmpTlstmParamsTable_undo_s {
+ char fate;
+ char copied;
+ char is_consistent;
+ netsnmp_request_info *req[SNMPTLSTMPARAMSTABLE_MAX_COLUMN + 1];
+ /* undo Column space */
+ char snmpTlstmParamsClientFingerprint[SNMPTLSTMPARAMSCLIENTFINGERPRINT_MAX_SIZE];
+ size_t snmpTlstmParamsClientFingerprint_len;
+ char snmpTlstmParamsStorageType;
+ char snmpTlstmParamsRowStatus;
+ } snmpTlstmParamsTable_undo;
+
+ /*
+ * Typical data structure for a row entry
+ */
+typedef struct snmpTlstmParamsTable_entry_s {
+ /* Index values */
+ char snmpTargetParamsName[SNMPTARGETPARAMSNAME_MAX_SIZE];
+ size_t snmpTargetParamsName_len;
+
+ /* Column values */
+ char snmpTlstmParamsClientFingerprint[SNMPTLSTMPARAMSCLIENTFINGERPRINT_MAX_SIZE];
+ size_t snmpTlstmParamsClientFingerprint_len;
+ char snmpTlstmParamsStorageType;
+ char snmpTlstmParamsRowStatus;
+
+ char hashType;
+ char params_flags;
+
+ /* used during set processing */
+ snmpTlstmParamsTable_undo *undo;
+} snmpTlstmParamsTable_entry;
+
+static Netsnmp_Node_Handler snmpTlstmParamsTable_handler;
+static NetsnmpCacheLoad snmpTlstmParamsTable_load;
+static NetsnmpCacheFree snmpTlstmParamsTable_free;
+
+static int _count_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+static void _tlstmParams_init_persistence(void);
+static void _params_add(snmpTlstmParamsTable_entry *entry);
+static void _params_remove(snmpTlstmParamsTable_entry *entry);
+static void _params_tweak_storage(snmpTlstmParamsTable_entry *entry);
+
+static uint32_t _last_changed = 0;
+static netsnmp_tdata *_table_data = NULL;
+
+/*
+ * Initialize the snmpTlstmParamsTable table by defining its contents
+ * and how it's structured
+ */
+void
+init_snmpTlstmParamsTable(void)
+{
+ oid reg_oid[] = {SNMP_TLS_TM_BASE,2,2,1,6};
+ const size_t reg_oid_len = OID_LENGTH(reg_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+ netsnmp_cache *cache;
+ netsnmp_watcher_info *watcher;
+
+ DEBUGMSGTL(("tlstmParamsTable:init", "initializing table snmpTlstmParamsTable\n"));
+
+ reg = netsnmp_create_handler_registration
+ ("snmpTlstmParamsTable", snmpTlstmParamsTable_handler, reg_oid,
+ reg_oid_len, HANDLER_CAN_RWRITE);
+
+ _table_data = netsnmp_tdata_create_table( "snmpTlstmParamsTable", 0 );
+ if (NULL == _table_data) {
+ snmp_log(LOG_ERR,"error creating tdata table for snmpTlstmParamsTable\n");
+ return;
+ }
+ cache = netsnmp_cache_create(SNMPTLSTMPARAMSTABLE_TIMEOUT,
+ snmpTlstmParamsTable_load,
+ snmpTlstmParamsTable_free,
+ reg_oid, reg_oid_len);
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"error creating cache for snmpTlstmParamsTable\n");
+ netsnmp_tdata_delete_table(_table_data);
+ _table_data = NULL;
+ return;
+ }
+ cache->magic = (void *)_table_data;
+ cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,"error creating table info for snmpTlstmParamsTable\n");
+ netsnmp_tdata_delete_table(_table_data);
+ _table_data = NULL;
+ netsnmp_cache_free(cache);
+ return;
+ }
+ /*
+ * populate index types
+ */
+ netsnmp_table_helper_add_indexes(table_info,
+ /* index: snmpTargetParamsName */
+ ASN_PRIV_IMPLIED_OCTET_STR, 0);
+
+ table_info->min_column = SNMPTLSTMPARAMSTABLE_MIN_COLUMN;
+ table_info->max_column = SNMPTLSTMPARAMSTABLE_MAX_COLUMN;
+
+ netsnmp_tdata_register( reg, _table_data, table_info );
+ netsnmp_inject_handler_before( reg, netsnmp_cache_handler_get(cache),
+ "table_container");
+
+ /*
+ * register scalars
+ */
+ reg_oid[10] = 4;
+ reg = netsnmp_create_handler_registration("snmpTlstmParamsCount",
+ _count_handler, reg_oid,
+ OID_LENGTH(reg_oid),
+ HANDLER_CAN_RONLY);
+ if (NULL == reg)
+ snmp_log(LOG_ERR,
+ "could not create handler for snmpTlstmParamsCount\n");
+ else {
+ netsnmp_register_scalar(reg);
+ if (cache)
+ netsnmp_inject_handler_before(reg,
+ netsnmp_cache_handler_get(cache),
+ "snmpTlstmParamsCount");
+ }
+
+ reg_oid[10] = 5;
+ reg = netsnmp_create_handler_registration(
+ "snmpTlstmParamsTableLastChanged", NULL, reg_oid,
+ OID_LENGTH(reg_oid), HANDLER_CAN_RONLY);
+ watcher = netsnmp_create_watcher_info((void*)&_last_changed,
+ sizeof(_last_changed),
+ ASN_TIMETICKS,
+ WATCHER_FIXED_SIZE);
+ if ((NULL == reg) || (NULL == watcher))
+ snmp_log(LOG_ERR,
+ "could not create handler for snmpTlstmParamsTableLastChanged\n");
+ else
+ netsnmp_register_watched_scalar2(reg, watcher);
+
+ /*
+ * Initialise the contents of the table here
+ */
+ _tlstmParams_init_persistence();
+}
+
+/** **************************************************************************
+ *
+ * utility functions for table structures
+ *
+ */
+/* create a new row in the table */
+netsnmp_tdata_row *
+snmpTlstmParamsTable_createEntry(netsnmp_tdata *table_data,
+ char* snmpTargetParamsName,
+ size_t snmpTargetParamsName_len ) {
+ snmpTlstmParamsTable_entry *entry;
+ netsnmp_tdata_row *row;
+
+ if ((NULL == snmpTargetParamsName) || (snmpTargetParamsName_len >
+ sizeof(entry->snmpTargetParamsName)))
+ return NULL;
+
+ entry = SNMP_MALLOC_TYPEDEF(snmpTlstmParamsTable_entry);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+
+ DEBUGMSGT(("tlstmParamsTable:entry:create", "entry %p / row %p\n",
+ entry, row));
+
+ DEBUGIF("snmpTlstmParamTable:entry:create") {
+ char name[sizeof(entry->snmpTargetParamsName)+1];
+ snprintf(name, sizeof(name), "%s", snmpTargetParamsName);
+ DEBUGMSGT(("tlstmParamsTable:entry:create",
+ "entry %s %p / row %p\n",
+ name, entry, row));
+ }
+
+ /*
+ * populate index
+ */
+ memcpy(entry->snmpTargetParamsName, snmpTargetParamsName,
+ snmpTargetParamsName_len);
+ entry->snmpTargetParamsName_len = snmpTargetParamsName_len;
+ netsnmp_tdata_row_add_index( row, ASN_PRIV_IMPLIED_OCTET_STR,
+ entry->snmpTargetParamsName,
+ snmpTargetParamsName_len);
+
+ entry->snmpTlstmParamsClientFingerprint[0] = '\0';
+ entry->snmpTlstmParamsClientFingerprint_len = 0;
+ entry->snmpTlstmParamsRowStatus = RS_NOTREADY;
+ entry->snmpTlstmParamsStorageType = ST_NONVOLATILE;
+
+ if (table_data) {
+ DEBUGMSGTL(("tlstmParamsTable:row:insert", "row %p\n",
+ row));
+ netsnmp_tdata_add_row( table_data, row );
+ }
+ return row;
+}
+
+/* allocate undo resources */
+static snmpTlstmParamsTable_undo *
+_allocUndo(snmpTlstmParamsTable_entry *entry)
+{
+ if (!entry)
+ return NULL;
+
+ entry->undo = SNMP_MALLOC_TYPEDEF(snmpTlstmParamsTable_undo);
+ if (!entry->undo)
+ return NULL;
+
+ entry->undo->is_consistent = -1; /* don't know */
+
+ /* TODO: allocated any other resources needed */
+
+ return entry->undo;
+}
+
+/* free undo resources */
+static void
+_freeUndo(snmpTlstmParamsTable_entry *entry)
+{
+ if (!entry || !entry->undo)
+ return;
+
+ /* TODO: release any allocated resources */
+ SNMP_FREE(entry->undo);
+}
+
+/* remove a row from the table */
+void
+snmpTlstmParamsTable_removeEntry(netsnmp_tdata *table_data,
+ netsnmp_tdata_row *row)
+{
+ snmpTlstmParamsTable_entry *entry;
+
+ if (!row)
+ return; /* Nothing to remove */
+
+ entry = (snmpTlstmParamsTable_entry *)row->data;
+
+ DEBUGMSGT(("tlstmParamsTable:entry:delete", "entry %p / row %p\n",
+ entry, row));
+
+ if (table_data) {
+ DEBUGMSGTL(("tlstmParamsTable:row:remove", "row %p\n", row));
+ netsnmp_tdata_remove_and_delete_row( table_data, row );
+ }
+ else
+ netsnmp_tdata_delete_row( row );
+
+ if (entry && entry->undo)
+ _freeUndo(entry);
+ SNMP_FREE( entry ); /* TODO - release any other internal resources */
+}
+
+/** **************************************************************************
+ *
+ * handle cache / interactions with snmpTlstmParams container in snmplib
+ *
+ */
+static void
+_params_add(snmpTlstmParamsTable_entry *entry)
+{
+ snmpTlstmParams *params;
+
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("tlstmParamsTable:params:add", "name %s, fp %s\n",
+ entry->snmpTargetParamsName, entry->snmpTlstmParamsClientFingerprint));
+
+ params =
+ netsnmp_tlstmParams_create(entry->snmpTargetParamsName,
+ entry->hashType,
+ entry->snmpTlstmParamsClientFingerprint,
+ entry->snmpTlstmParamsClientFingerprint_len);
+ if (NULL == params)
+ return;
+
+ params->flags = TLSTM_PARAMS_FROM_MIB;
+ if (entry->snmpTlstmParamsStorageType == ST_NONVOLATILE)
+ params->flags |= TLSTM_PARAMS_NONVOLATILE;
+
+ if (netsnmp_tlstmParams_add(params) != 0) {
+ netsnmp_tlstmParams_free(params);
+ }
+}
+
+static void
+_params_remove(snmpTlstmParamsTable_entry *entry)
+{
+ snmpTlstmParams index, *found;
+
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("tlstmParamsTable:params:remove", "name %s\n",
+ entry->snmpTargetParamsName));
+
+ index.name = entry->snmpTargetParamsName;
+ found = netsnmp_tlstmParams_find(&index);
+ if (found) {
+ netsnmp_tlstmParams_remove(found);
+ netsnmp_tlstmParams_free(found);
+ }
+ entry->params_flags = 0;
+}
+
+static void
+_params_tweak_storage(snmpTlstmParamsTable_entry *entry)
+{
+ snmpTlstmParams *params, index;
+
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("tlstmParamsTable:params:tweak", "name %s, st %d\n",
+ entry->snmpTargetParamsName, entry->snmpTlstmParamsStorageType));
+
+ index.name = entry->snmpTargetParamsName;
+ params = netsnmp_tlstmParams_find(&index);
+ if (NULL == params) {
+ DEBUGMSGTL(("tlstmParamsTable:params:tweak",
+ "couldn't find params!\n"));
+ return;
+ }
+
+ if (entry->snmpTlstmParamsStorageType == ST_NONVOLATILE)
+ params->flags |= TLSTM_PARAMS_NONVOLATILE;
+ else
+ params->flags &= ~TLSTM_PARAMS_NONVOLATILE;
+}
+
+static netsnmp_tdata_row *
+_entry_from_params(snmpTlstmParams *params)
+{
+ netsnmp_tdata_row *row;
+ snmpTlstmParamsTable_entry *entry;
+
+ row = snmpTlstmParamsTable_createEntry(NULL, params->name,
+ strlen(params->name));
+ if (NULL == row) {
+ snmp_log(LOG_ERR, "can create snmpTlstmParams row entry\n");
+ return NULL;
+ }
+ entry = row->data;
+
+ if (params->flags & TLSTM_PARAMS_FROM_CONFIG)
+ entry->snmpTlstmParamsStorageType = ST_PERMANENT;
+ else if (! (params->flags & TLSTM_PARAMS_NONVOLATILE))
+ entry->snmpTlstmParamsStorageType = ST_VOLATILE;
+
+ entry->snmpTlstmParamsRowStatus = RS_ACTIVE;
+
+ if (params->fingerprint) {
+ entry->snmpTlstmParamsClientFingerprint_len =
+ strlen(params->fingerprint);
+ if (entry->snmpTlstmParamsClientFingerprint_len >
+ sizeof(entry->snmpTlstmParamsClientFingerprint))
+ entry->snmpTlstmParamsClientFingerprint_len =
+ sizeof(entry->snmpTlstmParamsClientFingerprint) - 1;
+ memcpy(entry->snmpTlstmParamsClientFingerprint, params->fingerprint,
+ entry->snmpTlstmParamsClientFingerprint_len);
+ entry->snmpTlstmParamsClientFingerprint[sizeof(entry->snmpTlstmParamsClientFingerprint) - 1] = 0;
+ }
+ entry->hashType = params->hashType;
+ entry->params_flags = params->flags;
+
+ return row;
+}
+
+static int
+snmpTlstmParamsTable_load( netsnmp_cache *cache, void *vmagic )
+ {
+ netsnmp_tdata *table = (netsnmp_tdata *)vmagic;
+ netsnmp_tdata_row *row;
+ netsnmp_container *active_params;
+ netsnmp_iterator *itr;
+ snmpTlstmParams *params;
+ int rc = 0;
+
+ active_params = netsnmp_tlstmParams_container();
+ if (NULL == active_params)
+ return 0;
+
+ DEBUGMSGTL(("tlstmParamsTable:cache:load", "snmpTlstmParams %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(active_params)));
+ itr = CONTAINER_ITERATOR(active_params);
+ if (NULL == itr) {
+ DEBUGMSGTL(("tlstmParamsTable:cache:load",
+ "cant get iterator\n"));
+ return -1;
+ }
+
+ /*
+ * insert rows for active params into tbl container
+ */
+ params = ITERATOR_FIRST(itr);
+ for( ; params; params = ITERATOR_NEXT(itr)) {
+
+ row = _entry_from_params(params);
+ if (NULL == row) {
+ rc =-1;
+ break;
+ }
+ if (netsnmp_tdata_add_row(table, row) != SNMPERR_SUCCESS) {
+ snmpTlstmParamsTable_removeEntry(NULL, row);
+ rc = -1;
+ break;
+ }
+ }
+ ITERATOR_RELEASE(itr);
+
+ DEBUGMSGTL(("tlstmParamsTable:cache:load", "done, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+
+ return rc;
+}
+
+static void
+snmpTlstmParamsTable_free( netsnmp_cache *cache, void *vmagic )
+{
+ netsnmp_tdata *table = (netsnmp_tdata *)vmagic;
+ netsnmp_tdata_row *row;
+ netsnmp_iterator *tbl_itr;
+ snmpTlstmParamsTable_entry *entry;
+
+ DEBUGMSGTL(("tlstmParamsTable:cache:free", "called, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+
+ tbl_itr = CONTAINER_ITERATOR(table->container);
+ if (NULL == tbl_itr) {
+ DEBUGMSGTL(("tlstmParamsTable:cache:free",
+ "cant get entry iterator\n"));
+ return;
+ }
+
+ row = ITERATOR_FIRST(tbl_itr);
+ for( ; row; row = ITERATOR_NEXT(tbl_itr)) {
+ entry = row->data;
+
+ /*
+ * remove all active rows (they are in the params container kept
+ * by the library). Keep inactive ones for next time.
+ */
+ if (entry->snmpTlstmParamsRowStatus == RS_ACTIVE) {
+ snmpTlstmParamsTable_removeEntry(NULL, row);
+ ITERATOR_REMOVE(tbl_itr);
+ continue;
+ }
+ }
+ ITERATOR_RELEASE(tbl_itr);
+
+ DEBUGMSGTL(("tlstmParamsTable:cache:free", "done, %" NETSNMP_PRIz "d rows\n",
+ CONTAINER_SIZE(table->container)));
+}
+
+/** **************************************************************************
+ *
+ * handles requests for the snmpTlstmParamsTable table
+ *
+ */
+static int
+snmpTlstmParamsTable_handler(
+ netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests) {
+
+ netsnmp_request_info *request = NULL;
+ netsnmp_table_request_info *table_info;
+ netsnmp_tdata *table_data;
+ netsnmp_tdata_row *table_row;
+ snmpTlstmParamsTable_entry *table_entry;
+ int ret = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("tlstmParamsTable:handler", "Processing %s mode (%d) request\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode),
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /** ######################################################### GET #####
+ *
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info( request);
+ switch (table_info->colnum) {
+ case COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT:
+ {
+ u_char bin[42], *ptr = bin;
+ size_t len = sizeof(bin), offset = 1;
+ int rc;
+ bin[0] = table_entry->hashType;
+ netsnmp_assert(table_entry->hashType != 0);
+ rc = netsnmp_hex_to_binary(
+ &ptr, &len, &offset, 0,
+ table_entry->snmpTlstmParamsClientFingerprint, NULL);
+ if (1 != rc)
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_GENERR);
+ else
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ bin, offset);
+ }
+ break; /* case COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT */
+ case COLUMN_SNMPTLSTMPARAMSSTORAGETYPE:
+ snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+ table_entry->snmpTlstmParamsStorageType);
+ break; /* case COLUMN_SNMPTLSTMPARAMSSTORAGETYPE */
+ case COLUMN_SNMPTLSTMPARAMSROWSTATUS:
+ snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+ table_entry->snmpTlstmParamsRowStatus);
+ break; /* case COLUMN_SNMPTLSTMPARAMSROWSTATUS */
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ } /* switch colnum */
+ } /* for requests */
+ break; /* case MODE_GET */
+
+ /*
+ * Write-support
+ */
+ /** #################################################### RESERVE1 #####
+ *
+ * In RESERVE1 we are just checking basic ASN.1 size/type restrictions.
+ * You probably don't need to change any of this code. Don't change any
+ * of the column values here. Save that for the ACTION phase.
+ *
+ * The next phase is RESERVE2 or FREE.
+ */
+ case MODE_SET_RESERVE1:
+ for (request=requests; request; request=request->next) {
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ if ((NULL != table_entry) &&
+ (ST_READONLY == table_entry->snmpTlstmParamsStorageType)) {
+ ret = SNMP_ERR_NOTWRITABLE;
+ break;
+ }
+
+ /*
+ * for each column, allocate any additional resources needed
+ * beyond what is in the undo structure.
+ */
+ switch (table_info->colnum) {
+ case COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, sizeof(table_entry->snmpTlstmParamsClientFingerprint));
+ /** check len/algorithm MIB requirements */
+ if (SNMP_ERR_NOERROR == ret)
+ ret = netsnmp_cert_check_vb_fingerprint(request->requestvb);
+
+ break; /* case COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT */
+
+ case COLUMN_SNMPTLSTMPARAMSSTORAGETYPE:
+ ret = netsnmp_check_vb_storagetype(request->requestvb,
+ (table_entry ? table_entry->snmpTlstmParamsStorageType : ST_NONE ));
+ break; /* case COLUMN_SNMPTLSTMPARAMSSTORAGETYPE */
+
+ case COLUMN_SNMPTLSTMPARAMSROWSTATUS:
+ ret = netsnmp_check_vb_rowstatus_with_storagetype(request->requestvb,
+ (table_entry ? table_entry->snmpTlstmParamsRowStatus : RS_NONEXISTENT ),
+ (table_entry ? table_entry->snmpTlstmParamsStorageType : ST_NONE));
+ break; /* case COLUMN_SNMPTLSTMPARAMSROWSTATUS */
+ default:
+ ret = SNMP_ERR_NOTWRITABLE;
+ } /* switch colnum */
+
+ if ( ret != SNMP_ERR_NOERROR )
+ break;
+ }/* for requests */
+ break; /* case MODE_SET_RESERVE1 */
+
+ /** #################################################### RESERVE2 #####
+ *
+ * RESERVE2 is for checking additional restrictions from the MIB.
+ * Since these restrictions are often in the description of the object,
+ * mib2c can't generate code. It's possible that you need to add
+ * additional checks here. However, don't change any of the column
+ * values here. Save that for the ACTION phase.
+ *
+ * The next phase is ACTION or FREE.
+ */
+ case MODE_SET_RESERVE2:
+ for (request=requests; request; request=request->next) {
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info( request);
+ /*
+ * if no table_row, create one
+ */
+ if ( !table_entry ) {
+ table_row = snmpTlstmParamsTable_createEntry
+ (table_data, (char*)table_info->indexes->val.string,
+ table_info->indexes->val_len);
+ if (!table_row) {
+ ret = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ table_entry = table_row->data;
+ _allocUndo(table_entry);
+ if (table_entry && !table_entry->undo) {
+ snmpTlstmParamsTable_removeEntry(table_data, table_row);
+ table_row = NULL;
+ ret = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ table_entry->undo->fate = FATE_NEWLY_CREATED;
+ /** associate row with requests */
+ netsnmp_insert_tdata_row( request, table_row );
+ }
+
+ /** allocate undo structure, if needed */
+ if(!table_entry->undo) {
+ _allocUndo(table_entry);
+ if (!table_entry->undo) {
+ ret = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ }
+
+ /** don't allow multiple sets of same column */
+ if (table_entry->undo->req[table_info->colnum]) {
+ DEBUGMSGT(("tlstmParamsTable:reserve2",
+ "multiple sets to col %d in request\n",
+ table_info->colnum));
+ ret = SNMP_ERR_INCONSISTENTNAME;
+ break;
+ }
+ table_entry->undo->req[table_info->colnum] = request;
+
+ if ( ret != SNMP_ERR_NOERROR )
+ break;
+ } /* for requests */
+
+ /** make sure rowstatus is used to create rows */
+ if ( ret == SNMP_ERR_NOERROR ) {
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ if ((table_entry->undo->fate != FATE_NEWLY_CREATED) ||
+ (table_entry->undo->req[COLUMN_SNMPTLSTMPARAMSROWSTATUS]))
+ continue;
+ ret = SNMP_ERR_INCONSISTENTNAME;
+ break;
+ } /* for requests / creation */
+ } /* if no error */
+ break; /* case MODE_SET_RESERVE2 */
+
+ /** ######################################################## FREE #####
+ *
+ * FREE is for cleaning up after a failed request (during either
+ * RESERVE1 or RESERVE2). So any allocated resources need to be
+ * released.
+ *
+ * This the final phase for this path in the state machine.
+ */
+ case MODE_SET_FREE:
+ /*
+ * release undo resources
+ * remove any newly created rows
+ */
+ for (request=requests; request; request=request->next) {
+ table_row = netsnmp_tdata_extract_row( request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+
+ if ( !table_entry || !table_entry->undo )
+ continue;
+
+ /** disassociate row with requests */
+ netsnmp_remove_tdata_row( request, table_row );
+
+ if (FATE_NEWLY_CREATED == table_entry->undo->fate )
+ snmpTlstmParamsTable_removeEntry( table_data, table_row );
+ else
+ _freeUndo(table_entry);
+ }
+ break; /* case MODE_SET_FREE */
+
+ /** ###################################################### ACTION #####
+ *
+ * In the ACTION phase, we perform any sets that can be undone.
+ * (Save anything that can't be undone for the COMMIT phase.)
+ *
+ * After individual columns have been done, you should check that the
+ * row as a whole is consistent.
+ *
+ * The next phase is UNDO or COMMIT.
+ */
+ case MODE_SET_ACTION:
+ for (request=requests; request; request=request->next) {
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ case COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT:
+ {
+ u_char *tmp = (u_char*)table_entry->snmpTlstmParamsClientFingerprint;
+
+ memcpy( table_entry->undo->snmpTlstmParamsClientFingerprint,
+ table_entry->snmpTlstmParamsClientFingerprint,
+ sizeof(table_entry->snmpTlstmParamsClientFingerprint));
+ table_entry->undo->snmpTlstmParamsClientFingerprint_len =
+ table_entry->snmpTlstmParamsClientFingerprint_len;
+
+ table_entry->hashType = request->requestvb->val.string[0];
+ memset( table_entry->snmpTlstmParamsClientFingerprint, 0,
+ sizeof(table_entry->snmpTlstmParamsClientFingerprint));
+ table_entry->snmpTlstmParamsClientFingerprint_len =
+ sizeof(table_entry->snmpTlstmParamsClientFingerprint);
+ table_entry->snmpTlstmParamsClientFingerprint_len =
+ netsnmp_binary_to_hex(&tmp, &table_entry->snmpTlstmParamsClientFingerprint_len,
+ 0, &request->requestvb->val.string[1],
+ request->requestvb->val_len - 1);
+ if (0 == table_entry->snmpTlstmParamsClientFingerprint_len)
+ ret = SNMP_ERR_GENERR;
+ }
+ break; /* case COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT */
+
+ case COLUMN_SNMPTLSTMPARAMSSTORAGETYPE:
+ /* save snmpTlstmParamsStorageType value */
+ table_entry->undo->snmpTlstmParamsStorageType = table_entry->snmpTlstmParamsStorageType;
+ /* get value from varbind */
+ table_entry->snmpTlstmParamsStorageType = *request->requestvb->val.integer;
+ break; /* case COLUMN_SNMPTLSTMPARAMSSTORAGETYPE */
+
+ case COLUMN_SNMPTLSTMPARAMSROWSTATUS:
+ /* save snmpTlstmParamsRowStatus value */
+ table_entry->undo->snmpTlstmParamsRowStatus = table_entry->snmpTlstmParamsRowStatus;
+ /* get value from varbind */
+ table_entry->snmpTlstmParamsRowStatus = *request->requestvb->val.integer;
+ break; /* case COLUMN_SNMPTLSTMPARAMSROWSTATUS */
+ } /* switch colnum */
+ if ( ret != SNMP_ERR_NOERROR )
+ break;
+ } /* set values for requests */
+
+ if ( ret == SNMP_ERR_NOERROR ) {
+
+ /*
+ * All columns now have their final values set. check the
+ * internal consistency of each row.
+ */
+ for (request=requests; request; request=request->next) {
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ if (table_entry->undo->is_consistent != -1)
+ continue; /* already checked */
+
+ /** assume consistency */
+ table_entry->undo->is_consistent = 1;
+
+ if ((RS_IS_ACTIVE(table_entry->snmpTlstmParamsRowStatus)) &&
+ ((!table_entry->undo->req[COLUMN_SNMPTLSTMPARAMSROWSTATUS]) ||
+ (RS_IS_ACTIVE(table_entry->undo->snmpTlstmParamsRowStatus)))) {
+ /*
+ * check mib restrictions on active rows.
+ */
+ if (table_entry->undo->req[COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT]) {
+ table_entry->undo->is_consistent = 0;
+ request = table_entry->undo->req[COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT];
+ ret = SNMP_ERR_INCONSISTENTVALUE; /* per mib */
+ }
+ } /* active row */
+ else if (RS_IS_GOING_ACTIVE(table_entry->snmpTlstmParamsRowStatus)) {
+ /*
+ * check restrictions for activating a row
+ */
+ /** if going active, inconsistency is fatal */
+ if (!table_entry->undo->is_consistent) {
+ if (FATE_NEWLY_CREATED == table_entry->undo->fate)
+ ret = SNMP_ERR_INCONSISTENTNAME;
+ else
+ ret = SNMP_ERR_INCONSISTENTVALUE;
+ request = table_entry->undo->req[COLUMN_SNMPTLSTMPARAMSROWSTATUS];
+ }
+ } /* going active */
+ else if (RS_DESTROY == table_entry->snmpTlstmParamsRowStatus) {
+ /*
+ * TODO: check restrictions for deleting a row
+ */
+ /** can't delete active row */
+ if (RS_IS_ACTIVE(table_entry->undo->snmpTlstmParamsRowStatus)) {
+ ret = SNMP_ERR_INCONSISTENTVALUE;
+ request = table_entry->undo->req[COLUMN_SNMPTLSTMPARAMSROWSTATUS];
+ }
+ } /* destroy */
+ if ( ret != SNMP_ERR_NOERROR )
+ break;
+ } /* consistency for requests */
+ } /* if no error */
+ break; /* case MODE_SET_ACTION */
+
+ /** ######################################################## UNDO #####
+ *
+ * UNDO is for cleaning up any failed requests that went through the
+ * ACTION phase.
+ *
+ * This the final phase for this path in the state machine.
+ */
+ case MODE_SET_UNDO:
+ for (request=requests; request; request=request->next) {
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_row = netsnmp_tdata_extract_row( request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ case COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT:
+ /* restore snmpTlstmParamsClientFingerprint value */
+ memcpy( table_entry->snmpTlstmParamsClientFingerprint,
+ table_entry->undo->snmpTlstmParamsClientFingerprint,
+ sizeof(table_entry->snmpTlstmParamsClientFingerprint));
+ table_entry->snmpTlstmParamsClientFingerprint_len =
+ table_entry->undo->snmpTlstmParamsClientFingerprint_len;
+ break; /* case COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT */
+
+ case COLUMN_SNMPTLSTMPARAMSSTORAGETYPE:
+ /* restore snmpTlstmParamsStorageType value */
+ table_entry->snmpTlstmParamsStorageType =
+ table_entry->undo->snmpTlstmParamsStorageType;
+ break; /* case COLUMN_SNMPTLSTMPARAMSSTORAGETYPE */
+
+ case COLUMN_SNMPTLSTMPARAMSROWSTATUS:
+ /* restore snmpTlstmParamsRowStatus value */
+ table_entry->snmpTlstmParamsRowStatus = table_entry->undo->snmpTlstmParamsRowStatus;
+ break; /* case COLUMN_SNMPTLSTMPARAMSROWSTATUS */
+ } /* switch colnum */
+ } /* for requests */
+
+ /*
+ * release undo data
+ * or remove any newly created rows
+ */
+ for (request=requests; request; request=request->next) {
+ table_row = netsnmp_tdata_extract_row( request);
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+
+ if ( !table_entry || !table_entry->undo )
+ continue;
+
+ /** disassociate row with requests */
+ netsnmp_remove_tdata_row( request, table_row );
+
+ if (FATE_NEWLY_CREATED == table_entry->undo->fate )
+ snmpTlstmParamsTable_removeEntry( table_data, table_row );
+ else
+ _freeUndo(table_entry);
+ } /* for requests */
+ break; /* case MODE_SET_UNDO */
+
+ /** ###################################################### COMMIT #####
+ *
+ * COMMIT is the final success state, when all changes are finalized.
+ * There is not recovery state should something faile here.
+ *
+ * This the final phase for this path in the state machine.
+ */
+ case MODE_SET_COMMIT:
+ for (request=requests; request; request=request->next) {
+ table_row = netsnmp_tdata_extract_row( request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = (snmpTlstmParamsTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+
+ if (!table_entry || !table_entry->undo)
+ continue;
+
+ if ((RS_NOTREADY == table_entry->snmpTlstmParamsRowStatus) &&
+ table_entry->undo->is_consistent)
+ table_entry->snmpTlstmParamsRowStatus = RS_NOTINSERVICE;
+ else if ((RS_NOTINSERVICE == table_entry->snmpTlstmParamsRowStatus) &&
+ (0 == table_entry->undo->is_consistent))
+ table_entry->snmpTlstmParamsRowStatus = RS_NOTREADY;
+
+ /** release undo data for requests with no rowstatus */
+ if (table_entry->undo &&
+ !table_entry->undo->req[COLUMN_SNMPTLSTMPARAMSROWSTATUS] != 0) {
+ _freeUndo(table_entry);
+
+ /** update active addrs */
+ if ((0 == table_entry->params_flags) &&
+ (table_entry->snmpTlstmParamsRowStatus == RS_ACTIVE))
+ _params_add(table_entry);
+ else if ((0 != table_entry->params_flags) &&
+ (table_entry->snmpTlstmParamsRowStatus == RS_DESTROY))
+ _params_remove(table_entry);
+ }
+
+ switch (table_info->colnum) {
+
+ case COLUMN_SNMPTLSTMPARAMSROWSTATUS:
+ switch (table_entry->snmpTlstmParamsRowStatus) {
+ case RS_CREATEANDGO:
+ /** Fall-through */
+ case RS_ACTIVE:
+ table_entry->snmpTlstmParamsRowStatus = RS_ACTIVE;
+ if (0 == table_entry->params_flags)
+ _params_add(table_entry);
+ break;
+
+ case RS_CREATEANDWAIT:
+ /** Fall-through */
+ case RS_NOTINSERVICE:
+ /** simply set status based on consistency */
+ if (table_entry->undo->is_consistent)
+ table_entry->snmpTlstmParamsRowStatus = RS_NOTINSERVICE;
+ else
+ table_entry->snmpTlstmParamsRowStatus = RS_NOTREADY;
+ if (0 != table_entry->params_flags)
+ _params_remove(table_entry);
+ break;
+
+ case RS_DESTROY:
+ if (0 != table_entry->params_flags)
+ _params_remove(table_entry);
+ /** disassociate row with requests */
+ netsnmp_remove_tdata_row( request, table_row );
+ snmpTlstmParamsTable_removeEntry(table_data, table_row );
+ table_row = NULL;
+ table_entry = NULL;
+ }
+ /** release undo data */
+ _freeUndo(table_entry);
+ break; /* case COLUMN_SNMPTLSTMPARAMSROWSTATUS */
+
+ case COLUMN_SNMPTLSTMPARAMSSTORAGETYPE:
+ if (RS_ACTIVE == table_entry->snmpTlstmParamsRowStatus)
+ _params_tweak_storage(table_entry);
+ break;
+
+ case COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT:
+ break;
+ } /* switch colnum */
+ } /* for requests */
+
+ /** update last changed */
+ _last_changed = netsnmp_get_agent_uptime();
+
+ /** set up to save persistent store */
+ snmp_store_needed(NULL);
+
+ break; /* case MODE_SET_COMMIT */
+ } /* switch (reqinfo->mode) */
+
+ if ( ret != SNMP_ERR_NOERROR )
+ netsnmp_set_request_error( reqinfo, request, ret);
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+static int
+_count_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int val;
+
+ if (MODE_GET != reqinfo->mode) {
+ snmp_log(LOG_ERR, "bad mode in RO handler");
+ return SNMP_ERR_GENERR;
+ }
+
+ if (NULL == _table_data->container)
+ val = 0;
+ else
+ val = CONTAINER_SIZE(_table_data->container);
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE,
+ (u_char *) &val, sizeof(val));
+
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+
+ return SNMP_ERR_NOERROR;
+}
+
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+
+static int _tlstmParamsTable_save(int majorID, int minorID,
+ void *serverarg, void *clientarg);
+static int _save_params(snmpTlstmParams *params, void *app_type);
+static int _save_entry(snmpTlstmParamsTable_entry *entry, void *type);
+static void _tlstmParamsTable_row_restore_mib(const char *token, char *buf);
+
+static const char mib_token[] = "snmpTlstmParamsEntry";
+
+/************************************************************
+ * *_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
+_tlstmParams_init_persistence(void)
+{
+ int rc;
+
+ register_config_handler(NULL, mib_token, _tlstmParamsTable_row_restore_mib,
+ NULL, NULL);
+ rc = snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_STORE_DATA,
+ _tlstmParamsTable_save,
+ _table_data->container);
+
+ if (rc != SNMP_ERR_NOERROR)
+ snmp_log(LOG_ERR, "error registering for STORE_DATA callback "
+ "in _tlstmParams_init_persistence\n");
+}
+
+static int
+_tlstmParamsTable_save(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char sep[] =
+ "##############################################################";
+ char buf[] = "#\n" "# tlstmParams persistent data\n" "#";
+ char *type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+
+ netsnmp_container *active_params = netsnmp_tlstmParams_container();
+ netsnmp_tdata_row *row;
+ netsnmp_iterator *tbl_itr, *params_itr;
+ snmpTlstmParams *params;
+ snmpTlstmParamsTable_entry *entry;
+
+ if ((CONTAINER_SIZE(active_params) == 0) &&
+ (CONTAINER_SIZE(_table_data->container) == 0))
+ return SNMPERR_SUCCESS;
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, buf);
+
+ /*
+ * save active rows from params container
+ */
+ if (NULL != active_params) {
+ params_itr = CONTAINER_ITERATOR(active_params);
+ if (NULL == params_itr) {
+ DEBUGMSGTL(("tlstmParamsTable:save",
+ "cant get params iterator\n"));
+ params = NULL;
+ }
+ else
+ params = ITERATOR_FIRST(params_itr);
+
+ for( ; params; params = ITERATOR_NEXT(params_itr)) {
+ /** don't store config rows */
+ if ((params->flags & TLSTM_PARAMS_FROM_CONFIG) ||
+ ! (params->flags & TLSTM_PARAMS_NONVOLATILE))
+ continue;
+ _save_params(params, type);
+ }
+ }
+ ITERATOR_RELEASE(params_itr);
+
+ /*
+ * save inactive rows from mib
+ */
+ tbl_itr = CONTAINER_ITERATOR(_table_data->container);
+ if (NULL == tbl_itr)
+ DEBUGMSGTL(("tlstmParamsTable:save", "cant get table iterator\n"));
+ else {
+ row = ITERATOR_FIRST(tbl_itr);
+ for( ; row; row = ITERATOR_NEXT(tbl_itr)) {
+ entry = row->data;
+
+ /*
+ * skip all active rows (should be in active_params and thus saved
+ * above) and volatile rows.
+ */
+ if ((entry->snmpTlstmParamsRowStatus == RS_ACTIVE) ||
+ (entry->snmpTlstmParamsStorageType != ST_NONVOLATILE))
+ continue;
+
+ _save_entry(entry, type);
+ }
+ ITERATOR_RELEASE(tbl_itr);
+ }
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, "\n");
+
+ /*
+ * never fails
+ */
+ return SNMPERR_SUCCESS;
+}
+
+/************************************************************
+ * _tlstmParamsTable_container_row_save
+ */
+static int
+_save_entry(snmpTlstmParamsTable_entry *entry, void *type)
+{
+ char buf[SNMP_MAXBUF_SMALL], *hashType;
+
+ hashType = se_find_label_in_slist("cert_hash_alg", entry->hashType);
+ if (NULL == hashType) {
+ snmp_log(LOG_ERR, "skipping entry unknown hash type %d\n",
+ entry->hashType);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * build the line
+ */
+ netsnmp_assert(0 == entry->snmpTargetParamsName[
+ entry->snmpTargetParamsName_len]);
+ netsnmp_assert(0 == entry->snmpTlstmParamsClientFingerprint[
+ entry->snmpTlstmParamsClientFingerprint_len]);
+ snprintf(buf, sizeof(buf), "%s %s %s %s %d", mib_token,
+ entry->snmpTargetParamsName, hashType,
+ entry->snmpTlstmParamsClientFingerprint,
+ entry->snmpTlstmParamsRowStatus);
+ buf[sizeof(buf)-1] = 0;
+
+ read_config_store(type, buf);
+ DEBUGMSGTL(("tlstmParamsTable:row:save", "saving entry '%s'\n", buf));
+
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+_save_params(snmpTlstmParams *params, void *app_type)
+{
+ char buf[SNMP_MAXBUF_SMALL], *hashType;
+
+ if (NULL == params)
+ return SNMP_ERR_GENERR;
+
+ hashType = se_find_label_in_slist("cert_hash_alg", params->hashType);
+ if (NULL == hashType) {
+ snmp_log(LOG_ERR, "skipping entry unknown hash type %d\n",
+ params->hashType);
+ return SNMP_ERR_GENERR;
+ }
+ snprintf(buf, sizeof(buf), "%s %s --%s %s %d", mib_token, params->name,
+ hashType, params->fingerprint, RS_ACTIVE);
+
+ DEBUGMSGTL(("tlstmParamsTable:params:save", "saving params '%s'\n",
+ buf));
+ read_config_store(app_type, buf);
+
+ return SNMP_ERR_NOERROR;
+}
+
+static void
+_tlstmParamsTable_row_restore_mib(const char *token, char *buf)
+{
+ u_char rowStatus;
+ snmpTlstmParams *params;
+
+ /** need somewhere to save rows */
+ netsnmp_assert(_table_data && _table_data->container);
+
+ params = netsnmp_tlstmParams_restore_common(&buf);
+ if (NULL == params)
+ return;
+
+ if (NULL == buf) {
+ config_perror("incomplete line");
+ return;
+ }
+ rowStatus = atoi(buf);
+
+ /*
+ * if row is active, add it to the params container so it is available
+ * for use. Do not add it to the table, since it will be added
+ * during cache_load.
+ */
+ if (RS_ACTIVE == rowStatus) {
+ params->flags = TLSTM_PARAMS_FROM_MIB | TLSTM_PARAMS_NONVOLATILE;
+
+ if (netsnmp_tlstmParams_add(params) != 0)
+ netsnmp_tlstmParams_free(params);
+ }
+ else {
+ netsnmp_tdata_row *row;
+ snmpTlstmParamsTable_entry *entry;
+
+ row = snmpTlstmParamsTable_createEntry(_table_data, params->name,
+ strlen(params->name));
+ if (!row)
+ return;
+
+ entry = row->data;
+
+ entry->hashType = params->hashType;
+ strlcpy(entry->snmpTlstmParamsClientFingerprint, params->fingerprint,
+ sizeof(entry->snmpTlstmParamsClientFingerprint));
+ entry->snmpTlstmParamsClientFingerprint_len =
+ strlen(entry->snmpTlstmParamsClientFingerprint);
+ entry->snmpTlstmParamsStorageType = ST_NONVOLATILE;
+ entry->snmpTlstmParamsRowStatus = rowStatus;
+ netsnmp_tlstmParams_free(params);
+ }
+}
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h b/agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h
new file mode 100644
index 0000000..ae33cac
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h
@@ -0,0 +1,30 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SNMPTLSTMPARAMSTABLE_H
+#define SNMPTLSTMPARAMSTABLE_H
+
+#define SNMP_TLS_TM_PARAMS_COUNT SNMP_TLS_TM_BASE, 2, 2, 1, 4
+#define SNMP_TLS_TM_PARAMS_CHANGED SNMP_TLS_TM_BASE, 2, 2, 1, 5
+#define SNMP_TLS_TM_PARAMS_TABLE SNMP_TLS_TM_BASE, 2, 2, 1, 6
+
+/* function declarations */
+void init_snmpTlstmParamsTable(void);
+void initialize_table_snmpTlstmParamsTable(void);
+#define SNMPTLSTMPARAMSTABLE_TIMEOUT 60
+
+/* index definitions for table snmpTlstmParamsTable */
+#define SNMPTARGETPARAMSNAME_MAX_SIZE 32
+
+/* column number definitions for table snmpTlstmParamsTable */
+#define COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT 1
+#define COLUMN_SNMPTLSTMPARAMSSTORAGETYPE 2
+#define COLUMN_SNMPTLSTMPARAMSROWSTATUS 3
+
+#define SNMPTLSTMPARAMSCLIENTFINGERPRINT_MAX_SIZE 255
+
+#define SNMPTLSTMPARAMSTABLE_MIN_COLUMN COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT
+#define SNMPTLSTMPARAMSTABLE_MAX_COLUMN COLUMN_SNMPTLSTMPARAMSROWSTATUS
+
+#endif /* SNMPTLSTMPARAMSTABLE_H */
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmSession.h b/agent/mibgroup/tlstm-mib/snmpTlstmSession.h
new file mode 100644
index 0000000..9bf4ef8
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmSession.h
@@ -0,0 +1,6 @@
+#ifndef SNMPTLSTMSESSION_H
+#define SNMPTLSTMSESSION_H
+
+config_require(tlstm-mib/snmpTlstmSession/snmpTlstmSession)
+
+#endif /* SNMPTLSTMSESSION_H */
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.c b/agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.c
new file mode 100644
index 0000000..09c7b60
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.c
@@ -0,0 +1,49 @@
+/*
+ * snmpTlstmSession
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "tlstm-mib.h"
+#include "snmpTlstmSession.h"
+
+static netsnmp_handler_registration* _myreg = NULL;
+
+/** Initializes the snmpTlstmSession module */
+void
+init_snmpTlstmSession(void)
+{
+ static oid myoid[] = { SNMP_TLS_TM_BASE, 2, 1 };
+ int rc;
+
+ DEBUGMSGTL(("tlstmSession", "Initializing\n"));
+
+ _myreg = netsnmp_create_handler_registration("snmpTlstmSession", NULL,
+ myoid, OID_LENGTH(myoid),
+ HANDLER_CAN_RONLY);
+ if (NULL == _myreg) {
+ snmp_log(LOG_ERR, "failed to create handler registration for "
+ "snmpTlstmSession\n");
+ return;
+ }
+
+ rc = NETSNMP_REGISTER_STATISTIC_HANDLER(_myreg, 1, TLSTM);
+ if (MIB_REGISTERED_OK != rc) {
+ snmp_log(LOG_ERR, "failed to register snmpTlstmSession mdoule\n");
+ netsnmp_handler_registration_free(_myreg);
+ _myreg = NULL;
+ }
+
+}
+
+
+void
+shutdown_snmpTlstmSession(void)
+{
+ if (_myreg) {
+ netsnmp_unregister_handler(_myreg);
+ _myreg = NULL;
+ }
+}
diff --git a/agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h b/agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h
new file mode 100644
index 0000000..2fcc03c
--- /dev/null
+++ b/agent/mibgroup/tlstm-mib/snmpTlstmSession/snmpTlstmSession.h
@@ -0,0 +1,9 @@
+#ifndef SNMPTLSTMSESSION_H
+#define SNMPTLSTMSESSION_H
+
+/** Initializes the snmpTlstmSession module */
+void init_snmpTlstmSession(void);
+void shutdown_snmpTlstmSession(void);
+
+#endif /* SNMPTLSTMSESSION_H */
+
diff --git a/agent/mibgroup/tsm-mib.h b/agent/mibgroup/tsm-mib.h
new file mode 100644
index 0000000..aec01fe
--- /dev/null
+++ b/agent/mibgroup/tsm-mib.h
@@ -0,0 +1,6 @@
+/*
+ * module to include the modules
+ */
+config_require(tsm-mib/snmpTsmStats)
+config_require(tsm-mib/snmpTsmConfigurationUsePrefix)
+config_add_mib(SNMP-TSM-MIB)
diff --git a/agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.c b/agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.c
new file mode 100644
index 0000000..c3976c4
--- /dev/null
+++ b/agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.c
@@ -0,0 +1,110 @@
+/*
+ * 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 "snmpTsmConfigurationUsePrefix.h"
+
+/** Initializes the snmpTsmConfigurationUsePrefix module */
+void
+init_snmpTsmConfigurationUsePrefix(void)
+{
+ const oid snmpTsmConfigurationUsePrefix_oid[] =
+ { 1, 3, 6, 1, 2, 1, 190, 1, 2, 1 };
+
+ DEBUGMSGTL(("snmpTsmConfigurationUsePrefix", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("snmpTsmConfigurationUsePrefix",
+ handle_snmpTsmConfigurationUsePrefix,
+ snmpTsmConfigurationUsePrefix_oid,
+ OID_LENGTH(snmpTsmConfigurationUsePrefix_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+int
+handle_snmpTsmConfigurationUsePrefix(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.
+ */
+
+ long current_value = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TSM_USE_PREFIX);
+ static long original_value = 0;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ if (current_value == 0)
+ current_value = TV_FALSE;
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ &current_value,
+ sizeof(current_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:
+ /*
+ * 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 (*(requests->requestvb->val.integer) != 2 &&
+ *(requests->requestvb->val.integer) != 1)
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGVALUE);
+ original_value = current_value;
+ break;
+
+ case MODE_SET_ACTION:
+ if (TV_FALSE == *(requests->requestvb->val.integer))
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TSM_USE_PREFIX, 0);
+ else
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TSM_USE_PREFIX, 1);
+ break;
+
+ case MODE_SET_UNDO:
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TSM_USE_PREFIX,
+ original_value);
+ break;
+
+ /* we don't need these */
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_RESERVE2:
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_snmpTsmConfigurationUsePrefix\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.h b/agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.h
new file mode 100644
index 0000000..ba0c5b3
--- /dev/null
+++ b/agent/mibgroup/tsm-mib/snmpTsmConfigurationUsePrefix.h
@@ -0,0 +1,14 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SNMPTSMCONFIGURATIONUSEPREFIX_H
+#define SNMPTSMCONFIGURATIONUSEPREFIX_H
+
+/*
+ * function declarations
+ */
+void init_snmpTsmConfigurationUsePrefix(void);
+Netsnmp_Node_Handler handle_snmpTsmConfigurationUsePrefix;
+
+#endif /* SNMPTSMCONFIGURATIONUSEPREFIX_H */
diff --git a/agent/mibgroup/tsm-mib/snmpTsmStats.h b/agent/mibgroup/tsm-mib/snmpTsmStats.h
new file mode 100644
index 0000000..d1c4101
--- /dev/null
+++ b/agent/mibgroup/tsm-mib/snmpTsmStats.h
@@ -0,0 +1,6 @@
+#ifndef SNMPTSMSTATS_H
+#define SNMPTSMSTATS_H
+
+config_require(tsm-mib/snmpTsmStats/snmpTsmStats)
+
+#endif /* SNMPTSMSTATS_H */
diff --git a/agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c b/agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c
new file mode 100644
index 0000000..a567d2e
--- /dev/null
+++ b/agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.c
@@ -0,0 +1,53 @@
+/*
+ * snmpTsmStats
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/library/snmp_api.h>
+#include "snmpTsmStats.h"
+
+static netsnmp_handler_registration* _myreg = NULL;
+
+netsnmp_feature_require(helper_statistics)
+
+netsnmp_feature_child_of(shutdown_snmptsmsession, netsnmp_unused)
+
+/** Initializes the snmpTsmStats module */
+void
+init_snmpTsmStats(void)
+{
+ static oid snmpTsmStats_oid[] = { 1, 3, 6, 1, 2, 1, 190, 1, 1 };
+ int rc;
+
+ DEBUGMSGTL(("snmpTsmStats", "Initializing\n"));
+
+ _myreg = netsnmp_create_handler_registration("snmpTsmStats", NULL,
+ snmpTsmStats_oid,
+ OID_LENGTH(snmpTsmStats_oid),
+ HANDLER_CAN_RONLY);
+ if (NULL == _myreg) {
+ snmp_log(LOG_ERR, "failed to create handler registration for "
+ "snmpTsmStats\n");
+ return;
+ }
+ rc = NETSNMP_REGISTER_STATISTIC_HANDLER(_myreg, 1, TSM);
+ if (MIB_REGISTERED_OK != rc) {
+ snmp_log(LOG_ERR, "failed to register snmpTsmStats mdoule\n");
+ netsnmp_handler_registration_free(_myreg);
+ _myreg = NULL;
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SHUTDOWN_SNMPTSMSESSION
+void
+shutdown_snmpTsmSession(void)
+{
+ if (_myreg) {
+ netsnmp_unregister_handler(_myreg);
+ _myreg = NULL;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SHUTDOWN_SNMPTSMSESSION */
diff --git a/agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h b/agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h
new file mode 100644
index 0000000..95007cf
--- /dev/null
+++ b/agent/mibgroup/tsm-mib/snmpTsmStats/snmpTsmStats.h
@@ -0,0 +1,8 @@
+#ifndef SNMPTSMSTATS_H
+#define SNMPTSMSTATS_H
+
+/** Initializes the snmpTsmStats module */
+void init_snmpTsmStats(void);
+void shutdown_snmpTsmStats(void);
+
+#endif /* SNMPTSMSTATS_H */
diff --git a/agent/mibgroup/tunnel.h b/agent/mibgroup/tunnel.h
new file mode 100644
index 0000000..232ddb3
--- /dev/null
+++ b/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/agent/mibgroup/tunnel/tunnel.c b/agent/mibgroup/tunnel/tunnel.c
new file mode 100644
index 0000000..f9649ef
--- /dev/null
+++ b/agent/mibgroup/tunnel/tunnel.c
@@ -0,0 +1,1001 @@
+/*
+ * 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 <net-snmp/agent/sysORTable.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, NETSNMP_OLDAPI_RWRITE,
+ var_tunnelIfEntry, 3, {1, 1, 1}},
+#define REMOTEADDRESS 2
+ {REMOTEADDRESS, ASN_IPADDRESS, NETSNMP_OLDAPI_RWRITE,
+ var_tunnelIfEntry, 3, {1, 1, 2}},
+#define ENCAPSMETHOD 3
+ {ENCAPSMETHOD, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_tunnelIfEntry, 3, {1, 1, 3}},
+#define HOPLIMIT 4
+ {HOPLIMIT, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_tunnelIfEntry, 3, {1, 1, 4}},
+#define SECURITY 5
+ {SECURITY, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_tunnelIfEntry, 3, {1, 1, 5}},
+#define TOS 6
+ {TOS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_tunnelIfEntry, 3, {1, 1, 6}},
+
+#define IFINDEX 7
+ {IFINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_tunnelConfigEntry, 3, {2, 1, 5}},
+#define ROWSTATUS 8
+ {ROWSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_tunnelConfigEntry, 3, {2, 1, 6}},
+};
+
+
+
+static oid sysORTable_reg[] = { 1, 3, 6, 1, 2, 1, 10, 131 };
+
+static struct tunnel *tunnels;
+
+
+
+void
+deinit_tunnel(void)
+{
+ UNREGISTER_SYSOR_ENTRY(sysORTable_reg);
+}
+
+
+
+int
+term_tunnel(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ deinit_tunnel();
+ return 0;
+}
+
+
+
+void
+init_tunnel(void)
+{
+ REGISTER_SYSOR_ENTRY(sysORTable_reg,
+ "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, NETSNMP_OLDAPI_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 const 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, NETSNMP_OLDAPI_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;
+ const char *ifname;
+ int type;
+
+ /*
+ * uptime the tunnels we have so far
+ */
+ for (tunnel = tunnels; tunnel; tunnel = tunnel->next) {
+ DEBUGMSG(("tunnel",
+ "updateTunnels(): updating %s (index=%" NETSNMP_PRIo "u)\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=%" NETSNMP_PRIo
+ "u 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=%" NETSNMP_PRIo "u)\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=%" NETSNMP_PRIo "u)\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=%" NETSNMP_PRIo "u)\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=%" NETSNMP_PRIo "u)\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/agent/mibgroup/tunnel/tunnel.h b/agent/mibgroup/tunnel/tunnel.h
new file mode 100644
index 0000000..147f765
--- /dev/null
+++ b/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/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c
new file mode 100644
index 0000000..324fbc4
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/disk.c
@@ -0,0 +1,934 @@
+/*
+ * disk.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+/* workaround for bug in autoconf 2.60b and 2.61 */
+#ifdef HAVE_GETMNTENT
+#undef HAVE_GETMNTENT
+#define HAVE_GETMNTENT 1 /* previously might be only "#define HAVE_GETMNTENT" */
+#endif
+
+#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
+#if !defined(dragonfly)
+#ifdef HAVE_SYS_VNODE_H
+#include <sys/vnode.h>
+#endif
+#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(__FreeBSD__) && __FreeBSD_version >= 700055 /* Or HAVE_SYS_UCRED_H */
+#include <sys/ucred.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
+# 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 <net-snmp/agent/auto_nlist.h>
+
+#include "struct.h"
+#include "disk.h"
+#include "util_funcs/header_simple_table.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 *);
+#if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS
+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);
+#endif
+
+struct diskpart {
+ char device[STRMAX];
+ char path[STRMAX];
+ int minimumspace;
+ int minpercent;
+};
+
+#define MAX_INT_32 0x7fffffff
+#define MAX_UINT_32 0xffffffff
+
+unsigned int numdisks;
+int allDisksIncluded = 0;
+unsigned int maxdisks = 0;
+struct diskpart *disks;
+
+struct variable2 extensible_disk_variables[] = {
+ {MIBINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {ERRORNAME}},
+ {DISKDEVICE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKDEVICE}},
+ {DISKMINIMUM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKMINIMUM}},
+ {DISKMINPERCENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKMINPERCENT}},
+ {DISKTOTAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKTOTAL}},
+ {DISKAVAIL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKAVAIL}},
+ {DISKUSED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKUSED}},
+ {DISKPERCENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKPERCENT}},
+ {DISKPERCENTNODE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKPERCENTNODE}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {ERRORMSG}},
+ {DISKTOTALLOW, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKTOTALLOW}},
+ {DISKTOTALHIGH, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKTOTALHIGH}},
+ {DISKAVAILLOW, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKAVAILLOW}},
+ {DISKAVAILHIGH, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKAVAILHIGH}},
+ {DISKUSEDLOW, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKUSEDLOW}},
+ {DISKUSEDHIGH, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKUSEDHIGH}},
+};
+
+/*
+ * 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)
+{
+ unsigned 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 path[STRMAX];
+ int minpercent;
+ int minspace;
+
+ if (numdisks == maxdisks) {
+ if (maxdisks == 0) {
+ maxdisks = 50;
+ disks = (struct diskpart *)malloc(maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ netsnmp_config_error("\tignoring: %s", cptr);
+ return;
+ }
+ memset(disks, 0, maxdisks * sizeof(struct diskpart));
+ } else {
+ maxdisks *= 2;
+ disks = (struct diskpart *)realloc(disks, maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ netsnmp_config_error("\tignoring: %s", cptr);
+ 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, '%') == NULL) {
+ 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
+ int minpercent = DISKMINPERCENT;
+
+ if (numdisks == maxdisks) {
+ if (maxdisks == 0) {
+ maxdisks = 50;
+ disks = (struct diskpart *)malloc(maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ netsnmp_config_error("\tignoring: %s", cptr);
+ return;
+ }
+ memset(disks, 0, maxdisks * sizeof(struct diskpart));
+ } else {
+ maxdisks *= 2;
+ disks = (struct diskpart *)realloc(disks, maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ netsnmp_config_error("\tignoring: %s", cptr);
+ return;
+ }
+ memset(disks + maxdisks/2, 0, maxdisks/2 * sizeof(struct diskpart));
+ }
+ }
+ /*
+ * read the minimum disk usage percent
+ */
+ if(cptr != NULL) {
+ if(strchr(cptr, '%') != NULL) {
+ 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.");
+ netsnmp_config_error("\tignoring: includeAllDisks %s", cptr);
+ }
+ else {
+ allDisksIncluded = 1;
+ find_and_add_allDisks(minpercent);
+ }
+#endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */
+}
+
+
+#if 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 = (struct diskpart *)malloc(maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ netsnmp_config_error("\tignoring: %s", device);
+ return;
+ }
+ memset(disks, 0, maxdisks * sizeof(struct diskpart));
+ } else {
+ maxdisks *= 2;
+ disks = (struct diskpart *)realloc(disks, maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ netsnmp_config_error("\tignoring: %s", device);
+ 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' */
+ strlcpy(disks[numdisks].path, path, sizeof(disks[numdisks].path));
+ strlcpy(disks[numdisks].device, device, sizeof(disks[numdisks].device));
+ 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)
+{
+ unsigned 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
+
+#if defined(HAVE_GETMNTENT) || defined(HAVE_FSTAB_H)
+ int dummy = 0;
+#endif
+
+ /*
+ * 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) {
+ netsnmp_config_error("Can't open %s (setmntent)\n", ETC_MNTTAB);
+ 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) {
+ netsnmp_config_error("Can't open %s (fopen)\n", ETC_MNTTAB);
+ 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 defined(__FreeBSD__) && __FreeBSD_version >= 700055
+ {
+ struct statfs *mntbuf;
+ size_t i, mntsize;
+ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
+ for (i = 0; i < mntsize; i++) {
+ if (strncmp(mntbuf[i].f_fstypename, "zfs", 3) == 0) {
+ add_device(mntbuf[i].f_mntonname, mntbuf[i].f_mntfromname, -1, minpercent, 0);
+ }
+ }
+ }
+#endif
+ 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;
+ }
+ netsnmp_config_warn("Couldn't find device for disk %s",
+ disks[numdisks].path);
+ 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
+ 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) {
+ netsnmp_config_error("Can't open %s (setmntent)\n", ETC_MNTTAB);
+ return NULL;
+ }
+ while (mntfp && NULL != (mntent = getmntent(mntfp)))
+ if (strcmp(path, mntent->mnt_dir) == 0) {
+ strlcpy(device, mntent->mnt_fsname, sizeof(device));
+ 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) {
+ netsnmp_config_error("Can't open %s (fopen)\n", ETC_MNTTAB);
+ 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)
+ strlcpy(device, mnttab.mnt_special, sizeof(device));
+#endif /* HAVE_SETMNTENT */
+#elif HAVE_FSTAB_H
+ stat(path, &stat1);
+ setfsent();
+ if ((fstab = getfsfile(path)))
+ strlcpy(device, fstab->fs_spec, sizeof(device));
+ endfsent();
+ if (device[0] != '\0') {
+ /*
+ * dummy clause for else below
+ */
+ }
+
+#elif HAVE_STATFS
+ if (statfs(path, &statf) == 0) {
+ strlcpy(device, statf.f_mntfromname, sizeof(device));
+ DEBUGMSGTL(("ucd-snmp/disk", "Disk: %s\n",
+ statf.f_mntfromname));
+ }
+#endif
+ else {
+ netsnmp_config_warn("Couldn't find device for disk %s", path);
+ }
+#else
+ config_perror("'disk' checks not supported on this architecture.");
+#endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */
+ return device;
+}
+#endif
+
+/*
+ * Part of UCD-SNMP-MIB::dskEntry, which is so hard to fill
+ * (i.e. platform dependent parts).
+ */
+struct dsk_entry {
+ unsigned long long dskTotal;
+ unsigned long long dskUsed;
+ unsigned long long dskAvail;
+ unsigned long dskPercent;
+ unsigned long dskPercentInode;
+ unsigned long dskErrorFlag;
+};
+
+/**
+ * Fill in the provided dsk_entry structure.
+ * Returns -1 on error, 0 on success.
+ */
+
+static int
+fill_dsk_entry(int disknum, struct dsk_entry *entry)
+{
+#if defined(HAVE_STATVFS) || defined(HAVE_STATFS)
+ float multiplier;
+#endif
+#if defined(HAVE_FSTAB_H) && !defined(HAVE_SYS_STATVFS_H) && !defined(HAVE_STATFS)
+ double totalblks, free, used, avail, availblks;
+#endif
+
+#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
+
+ entry->dskPercentInode = -1;
+
+#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");
+ return -1;
+ }
+#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
+
+ multiplier = (float)vfs.f_bsize / (float)1024.0;
+#ifdef HAVE_STRUCT_STATVFS_F_FRSIZE
+ if (vfs.f_frsize > 255)
+ multiplier = (float)vfs.f_frsize / (float)1024.0;
+#endif
+
+ entry->dskTotal = (unsigned long long)(vfs.f_blocks * multiplier);
+ entry->dskAvail = (unsigned long long)(vfs.f_bavail * multiplier);
+ entry->dskUsed = (unsigned long long)((vfs.f_blocks - vfs.f_bfree) * multiplier);
+
+ entry->dskPercent =
+ 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);
+
+#if defined(HAVE_STRUCT_STATVFS_F_FILES) || defined HAVE_STRUCT_STATFS_F_FAVAIL
+ entry->dskPercentInode = 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(HAVE_STRUCT_STATFS_F_FILES) && defined(HAVE_STRUCT_STATFS_F_FFREE)
+ entry->dskPercentInode = 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(HAVE_STRUCT_STATVFS_F_FILES) */
+
+#elif 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");
+ return -1;
+ }
+ 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);
+ return -1;
+ }
+ 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;
+ entry->dskPercent =
+ totalblks == 0 ? 0 :
+ availblks == 0 ? 100 :
+ (int) ((double) used / (double) totalblks * 100.0 + 0.5);
+ multiplier = (float)filesys.fs_fsize / (float)1024.0;
+ entry->dskTotal = (unsigned long long)(totalblks * multiplier);
+ entry->dskAvail = (unsigned long long)(avail * multiplier);
+ entry->dskUsed = (unsigned long long)(used * multiplier);
+#else
+ /* MinGW */
+ entry->dskPercent = 0;
+ entry->dskTotal = 0;
+ entry->dskAvail = 0;
+ entry->dskUsed = 0;
+#endif
+
+ entry->dskErrorFlag =
+ (disks[disknum].minimumspace >= 0
+ ? entry->dskAvail < (unsigned long long)disks[disknum].minimumspace
+ : 100 - entry->dskPercent <= (unsigned int)disks[disknum].minpercent) ? 1 : 0;
+
+ return 0;
+}
+
+/*
+ * 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 ret;
+ unsigned int disknum = 0;
+ struct dsk_entry entry;
+ static long long_ret;
+ static char errmsg[300];
+
+tryAgain:
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, numdisks))
+ return (NULL);
+ disknum = name[*length - 1] - 1;
+ if (disknum > maxdisks)
+ return NULL;
+ 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));
+ }
+
+ ret = fill_dsk_entry(disknum, &entry);
+ if (ret < 0) {
+ if (!exact)
+ goto tryAgain;
+ return NULL;
+ }
+
+ switch (vp->magic) {
+ case DISKTOTAL:
+ if (entry.dskTotal > MAX_INT_32)
+ long_ret = MAX_INT_32;
+ else
+ long_ret = (long)(entry.dskTotal);
+ return ((u_char *) (&long_ret));
+ case DISKTOTALLOW:
+ long_ret = entry.dskTotal & MAX_UINT_32;
+ return ((u_char *) (&long_ret));
+ case DISKTOTALHIGH:
+ long_ret = entry.dskTotal >> 32;
+ return ((u_char *) (&long_ret));
+
+ case DISKAVAIL:
+ if (entry.dskAvail > MAX_INT_32)
+ long_ret = MAX_INT_32;
+ else
+ long_ret = (long)(entry.dskAvail);
+ return ((u_char *) (&long_ret));
+ case DISKAVAILLOW:
+ long_ret = entry.dskAvail & MAX_UINT_32;
+ return ((u_char *) (&long_ret));
+ case DISKAVAILHIGH:
+ long_ret = entry.dskAvail >> 32;
+ return ((u_char *) (&long_ret));
+
+ case DISKUSED:
+ if (entry.dskUsed > MAX_INT_32)
+ long_ret = MAX_INT_32;
+ else
+ long_ret = (long)(entry.dskUsed);
+ return ((u_char *) (&long_ret));
+ case DISKUSEDLOW:
+ long_ret = entry.dskUsed & MAX_UINT_32;
+ return ((u_char *) (&long_ret));
+ case DISKUSEDHIGH:
+ long_ret = entry.dskUsed >> 32;
+ return ((u_char *) (&long_ret));
+
+ case DISKPERCENT:
+ long_ret = entry.dskPercent;
+ return ((u_char *) (&long_ret));
+
+ case DISKPERCENTNODE:
+ long_ret = entry.dskPercentInode;
+ return ((u_char *) (&long_ret));
+
+ case ERRORFLAG:
+ long_ret = entry.dskErrorFlag;
+ return ((u_char *) (&long_ret));
+
+ case ERRORMSG:
+ if (entry.dskErrorFlag) {
+ if (disks[disknum].minimumspace >= 0)
+ snprintf(errmsg, sizeof(errmsg),
+ "%s: less than %d free (= %d)",
+ disks[disknum].path, disks[disknum].minimumspace,
+ (int) entry.dskAvail);
+ else
+ snprintf(errmsg, sizeof(errmsg),
+ "%s: less than %d%% free (= %d%%)",
+ disks[disknum].path, disks[disknum].minpercent,
+ (int)entry.dskPercent);
+ errmsg[ sizeof(errmsg)-1 ] = 0;
+ } else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ }
+ return NULL;
+}
diff --git a/agent/mibgroup/ucd-snmp/disk.h b/agent/mibgroup/ucd-snmp/disk.h
new file mode 100644
index 0000000..20e9332
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/disk.h
@@ -0,0 +1,31 @@
+/*
+ * Template MIB group interface - disk.h
+ *
+ */
+#ifndef _MIBGROUP_DISK_H
+#define _MIBGROUP_DISK_H
+
+void init_disk(void);
+
+config_require(util_funcs/header_simple_table)
+
+ 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
+#define DISKTOTALLOW 11
+#define DISKTOTALHIGH 12
+#define DISKAVAILLOW 13
+#define DISKAVAILHIGH 14
+#define DISKUSEDLOW 15
+#define DISKUSEDHIGH 16
+
+#endif /* _MIBGROUP_DISK_H */
diff --git a/agent/mibgroup/ucd-snmp/disk_hw.c b/agent/mibgroup/ucd-snmp/disk_hw.c
new file mode 100644
index 0000000..93ecde3
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/disk_hw.c
@@ -0,0 +1,421 @@
+/*
+ * disk_hw.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 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 <net-snmp/agent/hardware/fsys.h>
+
+#include "struct.h"
+#include "disk.h"
+#include "util_funcs/header_simple_table.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 netsnmp_fsys_info ** _expand_disk_array( char *cptr );
+
+#define MAX_INT_32 0x7fffffff
+#define MAX_UINT_32 0xffffffff
+
+int numdisks;
+int allDisksIncluded = 0;
+int maxdisks = 0;
+netsnmp_fsys_info **disks = NULL;
+
+struct variable2 extensible_disk_variables[] = {
+ {MIBINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {ERRORNAME}},
+ {DISKDEVICE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKDEVICE}},
+ {DISKMINIMUM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKMINIMUM}},
+ {DISKMINPERCENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKMINPERCENT}},
+ {DISKTOTAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKTOTAL}},
+ {DISKAVAIL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKAVAIL}},
+ {DISKUSED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKUSED}},
+ {DISKPERCENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKPERCENT}},
+ {DISKPERCENTNODE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKPERCENTNODE}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {ERRORMSG}},
+ {DISKTOTALLOW, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKTOTALLOW}},
+ {DISKTOTALHIGH, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKTOTALHIGH}},
+ {DISKAVAILLOW, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKAVAILLOW}},
+ {DISKAVAILHIGH, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKAVAILHIGH}},
+ {DISKUSEDLOW, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKUSEDLOW}},
+ {DISKUSEDHIGH, ASN_UNSIGNED, NETSNMP_OLDAPI_RONLY,
+ var_extensible_disk, 1, {DISKUSEDHIGH}},
+};
+
+/*
+ * 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_hw(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)
+{
+ netsnmp_fsys_info *entry;
+
+ for ( entry = netsnmp_fsys_get_first();
+ entry != NULL;
+ entry = netsnmp_fsys_get_next( entry )) {
+
+ entry->minspace = -1;
+ entry->minpercent = -1;
+ entry->flags &= ~NETSNMP_FS_FLAG_UCD;
+ }
+ if (disks) {
+ free( disks );
+ disks = NULL;
+ maxdisks = numdisks = 0;
+ }
+ allDisksIncluded = 0;
+}
+
+static void
+disk_parse_config(const char *token, char *cptr)
+{
+ char path[STRMAX];
+ int minpercent;
+ int minspace;
+ netsnmp_fsys_info *entry;
+
+ /*
+ * Ensure there is space for the new entry
+ */
+ if (numdisks == maxdisks) {
+ if (!_expand_disk_array( cptr ))
+ return;
+ }
+
+ /*
+ * 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, '%') == NULL) {
+ 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
+ */
+ entry = netsnmp_fsys_by_path( path, NETSNMP_FS_FIND_CREATE );
+ if ( entry ) {
+ entry->minspace = minspace;
+ entry->minpercent = minpercent;
+ entry->flags |= NETSNMP_FS_FLAG_UCD;
+ disks[numdisks++] = entry;
+ }
+}
+
+static void
+disk_parse_config_all(const char *token, char *cptr)
+{
+ int minpercent = DISKMINPERCENT;
+ netsnmp_fsys_info *entry;
+
+ /*
+ * read the minimum disk usage percent
+ */
+ if(cptr != NULL) {
+ if(strchr(cptr, '%') != NULL) {
+ 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.");
+ netsnmp_config_error("\tignoring: includeAllDisks %s", cptr);
+ }
+ else {
+
+ netsnmp_fsys_load( NULL, NULL ); /* Prime the fsys H/W module */
+ for ( entry = netsnmp_fsys_get_first();
+ entry != NULL;
+ entry = netsnmp_fsys_get_next( entry )) {
+
+ if ( !(entry->flags & NETSNMP_FS_FLAG_ACTIVE ))
+ continue;
+ entry->minspace = -1;
+ entry->minpercent = minpercent;
+ entry->flags |= NETSNMP_FS_FLAG_UCD;
+ /*
+ * Ensure there is space for the new entry
+ */
+ if (numdisks == maxdisks) {
+ if (!_expand_disk_array( entry->device ))
+ return;
+ }
+ disks[numdisks++] = entry;
+ }
+ allDisksIncluded = 1;
+ }
+}
+
+
+static int _percent( unsigned long long value, unsigned long long total ) {
+ float v=value, t=total, pct;
+
+ /* avoid division by zero */
+ if (total == 0)
+ return 0;
+
+ pct = (v*100)/t; /* Calculate percentage using floating point
+ arithmetic, to avoid overflow errors */
+ pct += 0.5; /* rounding */
+ return (int)pct;
+}
+
+static netsnmp_fsys_info **
+_expand_disk_array( char *cptr ) {
+
+ if ( maxdisks == 0 )
+ maxdisks = 50;
+ else
+ maxdisks *= 2;
+
+ disks = realloc( disks, maxdisks * sizeof( netsnmp_fsys_info*));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ netsnmp_config_error("\tignoring: %s", cptr);
+ return NULL;
+ }
+
+ if ( maxdisks == 50 )
+ memset(disks, 0, maxdisks * sizeof( netsnmp_fsys_info*));
+ else
+ memset(disks + maxdisks/2, 0, maxdisks/2 * sizeof( netsnmp_fsys_info*));
+
+ return disks;
+}
+
+
+/*
+ * 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 disknum = 0;
+ netsnmp_fsys_info *entry;
+ unsigned long long val;
+ static long long_ret;
+ static char errmsg[300];
+
+ netsnmp_fsys_load( NULL, NULL ); /* Update the fsys H/W module */
+
+tryAgain:
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, numdisks))
+ return (NULL);
+ disknum = name[*length - 1] - 1;
+ entry = disks[disknum];
+ if ( !entry ) {
+ if (!exact || !(entry->flags & NETSNMP_FS_FLAG_UCD))
+ goto tryAgain;
+ return NULL;
+ }
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = disknum + 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* DISKPATH */
+ *var_len = strlen(entry->path);
+ return ((u_char *)entry->path);
+ case DISKDEVICE:
+ *var_len = strlen(entry->device);
+ return ((u_char *)entry->device);
+ case DISKMINIMUM:
+ long_ret = entry->minspace;
+ return ((u_char *) (&long_ret));
+ case DISKMINPERCENT:
+ long_ret = entry->minpercent;
+ return ((u_char *) (&long_ret));
+
+ case DISKTOTAL:
+ val = netsnmp_fsys_size_ull(entry);
+ if (val > MAX_INT_32)
+ long_ret = MAX_INT_32;
+ else
+ long_ret = (long)val;
+ return ((u_char *) (&long_ret));
+ case DISKTOTALLOW:
+ long_ret = netsnmp_fsys_size_ull(entry) & MAX_UINT_32;
+ return ((u_char *) (&long_ret));
+ case DISKTOTALHIGH:
+ long_ret = netsnmp_fsys_size_ull(entry) >> 32;
+ return ((u_char *) (&long_ret));
+
+ case DISKAVAIL:
+ val = netsnmp_fsys_avail_ull(entry);
+ if (val > MAX_INT_32)
+ long_ret = MAX_INT_32;
+ else
+ long_ret = (long)val;
+ return ((u_char *) (&long_ret));
+ case DISKAVAILLOW:
+ long_ret = netsnmp_fsys_avail_ull(entry) & MAX_UINT_32;
+ return ((u_char *) (&long_ret));
+ case DISKAVAILHIGH:
+ long_ret = netsnmp_fsys_avail_ull(entry) >> 32;
+ return ((u_char *) (&long_ret));
+
+ case DISKUSED:
+ val = netsnmp_fsys_used_ull(entry);
+ if (val > MAX_INT_32)
+ long_ret = MAX_INT_32;
+ else
+ long_ret = (long)val;
+ return ((u_char *) (&long_ret));
+ case DISKUSEDLOW:
+ long_ret = netsnmp_fsys_used_ull(entry) & MAX_UINT_32;
+ return ((u_char *) (&long_ret));
+ case DISKUSEDHIGH:
+ long_ret = netsnmp_fsys_used_ull(entry) >> 32;
+ return ((u_char *) (&long_ret));
+
+ case DISKPERCENT:
+ long_ret = _percent( entry->used, entry->size );
+ return ((u_char *) (&long_ret));
+
+ case DISKPERCENTNODE:
+ long_ret = _percent( entry->inums_total - entry->inums_avail, entry->inums_total );
+ return ((u_char *) (&long_ret));
+
+ case ERRORFLAG:
+ long_ret = 0;
+ val = netsnmp_fsys_avail_ull(entry);
+ if (( entry->minspace >= 0 ) &&
+ ( val < entry->minspace ))
+ long_ret = 1;
+ else if (( entry->minpercent >= 0 ) &&
+ (_percent( entry->avail, entry->size ) < entry->minpercent ))
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+
+ case ERRORMSG:
+ errmsg[0] = 0;
+ val = netsnmp_fsys_avail_ull(entry);
+ if (( entry->minspace >= 0 ) &&
+ ( val < entry->minspace ))
+ snprintf(errmsg, sizeof(errmsg),
+ "%s: less than %d free (= %d)",
+ entry->path, entry->minspace,
+ (int) val);
+ else if (( entry->minpercent >= 0 ) &&
+ (_percent( entry->avail, entry->size ) < entry->minpercent ))
+ snprintf(errmsg, sizeof(errmsg),
+ "%s: less than %d%% free (= %d%%)",
+ entry->path, entry->minpercent,
+ _percent( entry->avail, entry->size ));
+ errmsg[ sizeof(errmsg)-1 ] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ }
+ return NULL;
+}
diff --git a/agent/mibgroup/ucd-snmp/disk_hw.h b/agent/mibgroup/ucd-snmp/disk_hw.h
new file mode 100644
index 0000000..ff42ed9
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/disk_hw.h
@@ -0,0 +1,32 @@
+/*
+ * Template MIB group interface - disk.h
+ *
+ */
+#ifndef _MIBGROUP_DISK_HW_H
+#define _MIBGROUP_DISK_HW_H
+
+void init_disk_hw(void);
+
+config_require(util_funcs/header_simple_table)
+config_require(hardware/fsys)
+
+ 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
+#define DISKTOTALLOW 11
+#define DISKTOTALHIGH 12
+#define DISKAVAILLOW 13
+#define DISKAVAILHIGH 14
+#define DISKUSEDLOW 15
+#define DISKUSEDHIGH 16
+
+#endif /* _MIBGROUP_DISK_HW_H */
diff --git a/agent/mibgroup/ucd-snmp/diskio.c b/agent/mibgroup/ucd-snmp/diskio.c
new file mode 100644
index 0000000..4d6d05c
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/diskio.c
@@ -0,0 +1,1466 @@
+/* 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 <math.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs/header_simple_table.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) || defined(aix7)
+/*
+ * handle disk statistics via libperfstat
+ */
+#ifdef HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#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 */
+#elif !defined(dragonfly)
+#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 (linux)
+#define DISKIO_SAMPLE_INTERVAL 5
+void devla_getstats(unsigned int regno, void * dummy);
+#endif /* linux */
+
+#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 */
+
+#ifndef solaris2
+static int getstats(void);
+#endif
+
+#if defined (freebsd4) || defined(freebsd5)
+void devla_getstats(unsigned int regno, void *dummy);
+#endif
+
+FILE *file;
+
+#if 0
+static void diskio_free_config(void);
+#endif
+
+ /*********************
+ *
+ * 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, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {1}},
+ {DISKIO_DEVICE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {2}},
+ {DISKIO_NREAD, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {3}},
+ {DISKIO_NWRITTEN, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {4}},
+ {DISKIO_READS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {5}},
+ {DISKIO_WRITES, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {6}},
+#if defined(freebsd4) || defined(freebsd5) || defined(linux)
+ {DISKIO_LA1, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {9}},
+ {DISKIO_LA5, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {10}},
+ {DISKIO_LA15, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {11}},
+#endif
+ {DISKIO_NREADX, ASN_COUNTER64, NETSNMP_OLDAPI_RONLY,
+ var_diskio, 1, {12}},
+ {DISKIO_NWRITTENX, ASN_COUNTER64, NETSNMP_OLDAPI_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) || defined(aix7)
+ /*
+ * initialize values to gather information on first request
+ */
+ ps_numdisks = 0;
+ ps_disk = NULL;
+#endif
+
+#if defined (freebsd4) || defined(freebsd5) || defined(linux)
+ devla_getstats(0, NULL);
+ /* collect LA data regularly */
+ snmp_alarm_register(DISKIO_SAMPLE_INTERVAL, SA_REPEAT, devla_getstats, NULL);
+#endif
+
+
+#ifdef linux
+ char *app = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ netsnmp_ds_register_config(ASN_BOOLEAN, app, "diskio_exclude_fd",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISKIO_NO_FD);
+ netsnmp_ds_register_config(ASN_BOOLEAN, app, "diskio_exclude_loop",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISKIO_NO_LOOP);
+ netsnmp_ds_register_config(ASN_BOOLEAN, app, "diskio_exclude_ram",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISKIO_NO_RAM);
+
+ /* or possible an exclusion pattern? */
+#endif
+}
+
+#if 0
+/* to do: make sure diskio_free_config() gets invoked upon SIGHUP. */
+static void
+diskio_free_config(void)
+{
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISKIO_NO_FD, 0);
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISKIO_NO_LOOP, 0);
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISKIO_NO_RAM, 0);
+}
+#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;
+ size_t size, dkn_size;
+ int 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 */
+
+#ifdef __NetBSD__
+#include <sys/sysctl.h>
+static int ndisk;
+#ifdef HW_IOSTATNAMES
+static int nmib[2] = {CTL_HW, HW_IOSTATNAMES};
+#else
+static int nmib[2] = {CTL_HW, HW_DISKNAMES};
+#endif
+#ifdef HW_DISKSTATS
+#include <sys/disk.h>
+static int dmib[3] = {CTL_HW, HW_DISKSTATS, sizeof(struct disk_sysctl)};
+static struct disk_sysctl *dk;
+#endif
+#ifdef HW_IOSTATS
+#include <sys/iostat.h>
+static int dmib[3] = {CTL_HW, HW_IOSTATS, sizeof(struct io_sysctl)};
+static struct io_sysctl *dk;
+#endif
+static char **dkname;
+
+static int
+getstats(void)
+{
+ time_t now;
+ char *t, *tp;
+ size_t size, dkn_size;
+ int i;
+
+ now = time(NULL);
+ if (cache_time + CACHE_TIMEOUT > now) {
+ return 1;
+ }
+ size = 0;
+ if (sysctl(dmib, 3, NULL, &size, NULL, 0) < 0) {
+ perror("Can't get size of HW_DISKSTATS/HW_IOSTATS mib");
+ return 0;
+ }
+ if (ndisk != size / dmib[2]) {
+ if (dk)
+ free(dk);
+ if (dkname) {
+ for (i = 0; i < ndisk; i++)
+ if (dkname[i])
+ free(dkname[i]);
+ free(dkname);
+ }
+ ndisk = size / dmib[2];
+ if (ndisk == 0)
+ return 0;
+ dkname = malloc(ndisk * sizeof(char *));
+ dkn_size = 0;
+ if (sysctl(nmib, 2, NULL, &dkn_size, NULL, 0) < 0) {
+ perror("Can't get size of HW_DISKNAMES mib");
+ return 0;
+ }
+ t = malloc(dkn_size);
+ if (sysctl(nmib, 2, t, &dkn_size, NULL, 0) < 0) {
+ perror("Can't get size of HW_DISKNAMES mib");
+ return 0;
+ }
+ for (i = 0, tp = strtok(t, " "); tp && i < ndisk; i++,
+ tp = strtok(NULL, " ")) {
+ dkname[i] = strdup(tp);
+ }
+ free(t);
+ dk = malloc(ndisk * sizeof(*dk));
+ }
+ if (sysctl(dmib, 3, dk, &size, NULL, 0) < 0) {
+ perror("Can't get HW_DISKSTATS/HW_IOSTATS 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:
+#ifdef HW_DISKSTATS
+ long_ret = dk[indx].dk_rbytes;
+#endif
+#ifdef HW_IOSTATS
+ if (dk[indx].type == IOSTAT_DISK)
+ long_ret = dk[indx].rbytes;
+#endif
+ return (u_char *) & long_ret;
+
+ case DISKIO_NWRITTEN:
+#ifdef HW_DISKSTATS
+ long_ret = dk[indx].dk_wbytes;
+#endif
+#ifdef HW_IOSTATS
+ if (dk[indx].type == IOSTAT_DISK)
+ long_ret = dk[indx].wbytes;
+#endif
+ return (u_char *) & long_ret;
+
+ case DISKIO_READS:
+#ifdef HW_DISKSTATS
+ long_ret = dk[indx].dk_rxfer;
+#endif
+#ifdef HW_IOSTATS
+ if (dk[indx].type == IOSTAT_DISK)
+ long_ret = dk[indx].rxfer;
+#endif
+ return (u_char *) & long_ret;
+
+ case DISKIO_WRITES:
+#ifdef HW_DISKSTATS
+ long_ret = dk[indx].dk_wxfer;
+#endif
+#ifdef HW_IOSTATS
+ if (dk[indx].type == IOSTAT_DISK)
+ long_ret = dk[indx].wxfer;
+#endif
+ return (u_char *) & long_ret;
+
+ default:
+ ERROR_MSG("diskio.c: don't know how to handle this request.");
+ }
+ return NULL;
+}
+#endif /* __NetBSD__ */
+
+#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));
+ memset(devloads, '\0', 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;
+
+/* disk load averages */
+typedef struct linux_diskio_la
+{
+ unsigned long use_prev;
+ double la1, la5, la15;
+} linux_diskio_la;
+
+typedef struct linux_diskio_header
+{
+ linux_diskio* indices;
+ int length;
+ int alloc;
+} linux_diskio_header;
+
+typedef struct linux_diskio_la_header
+{
+ linux_diskio_la * indices;
+ int length;
+} linux_diskio_la_header;
+
+static linux_diskio_header head;
+static linux_diskio_la_header la_head;
+
+void devla_getstats(unsigned int regno, void * dummy) {
+
+ static double expon1, expon5, expon15;
+ double busy_time, busy_percent;
+ int idx;
+
+ if (getstats() == 1) {
+ ERROR_MSG("can't do diskio getstats()\n");
+ return;
+ }
+
+ if (!la_head.length) {
+ la_head.indices = (linux_diskio_la *) malloc(head.length * sizeof(linux_diskio_la));
+ for (idx=0; idx<head.length; idx++) {
+ la_head.indices[idx].la1 = la_head.indices[idx].la5 = la_head.indices[idx].la15 = 0.;
+ la_head.indices[idx].use_prev = head.indices[idx].use;
+ }
+ la_head.length = head.length;
+ expon1 = exp(-(((double)DISKIO_SAMPLE_INTERVAL) / ((double)60)));
+ expon5 = exp(-(((double)DISKIO_SAMPLE_INTERVAL) / ((double)300)));
+ expon15 = exp(-(((double)DISKIO_SAMPLE_INTERVAL) / ((double)900)));
+ }
+ else if (head.length - la_head.length) {
+ la_head.indices = (linux_diskio_la *) realloc(la_head.indices, head.length * sizeof(linux_diskio_la));
+ for (idx=la_head.length; idx<head.length; idx++) {
+ la_head.indices[idx].la1 = la_head.indices[idx].la5 = la_head.indices[idx].la15 = 0.;
+ la_head.indices[idx].use_prev = head.indices[idx].use;
+ }
+ la_head.length = head.length;
+ }
+
+ for (idx=0; idx<head.length; idx++) {
+ busy_time = head.indices[idx].use - la_head.indices[idx].use_prev;
+ busy_percent = busy_time * 100. / ((double) DISKIO_SAMPLE_INTERVAL) / 1000.;
+ la_head.indices[idx].la1 = la_head.indices[idx].la1 * expon1 + busy_percent * (1. - expon1);
+ la_head.indices[idx].la5 = la_head.indices[idx].la5 * expon5 + busy_percent * (1. - expon5);
+ la_head.indices[idx].la15 = la_head.indices[idx].la15 * expon15 + busy_percent * (1. - expon15);
+ /*
+ fprintf(stderr, "(%d) update la1=%f la5=%f la15=%f\n",
+ idx, la_head.indices[idx].la1, la_head.indices[idx].la5, la_head.indices[idx].la15);
+ */
+ la_head.indices[idx].use_prev = head.indices[idx].use;
+ }
+}
+
+int is_excluded(const char *name)
+{
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISKIO_NO_FD)
+ && !(strncmp(name, "fd", 2)))
+ return 1;
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISKIO_NO_LOOP)
+ && !(strncmp(name, "loop", 4)))
+ return 1;
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISKIO_NO_RAM)
+ && !(strncmp(name, "ram", 3)))
+ return 1;
+ return 0;
+}
+
+static 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);
+ if (!is_excluded(pTemp->name))
+ 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");
+ fclose(parts);
+ return 1;
+ }
+ if (!is_excluded(pTemp->name))
+ 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_LA1:
+ long_ret = la_head.indices[indx].la1;
+ return (u_char *) & long_ret;
+ case DISKIO_LA5:
+ long_ret = la_head.indices[indx].la5;
+ return (u_char *) & long_ret;
+ case DISKIO_LA15:
+ long_ret = la_head.indices[indx].la15;
+ 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, "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) || defined(aix7)
+/*
+ * 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/agent/mibgroup/ucd-snmp/diskio.h b/agent/mibgroup/ucd-snmp/diskio.h
new file mode 100644
index 0000000..8cd206b
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/diskio.h
@@ -0,0 +1,38 @@
+#ifndef _MIBGROUP_DISKIO_H
+#define _MIBGROUP_DISKIO_H
+
+config_require(util_funcs/header_simple_table)
+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/agent/mibgroup/ucd-snmp/dlmod.c b/agent/mibgroup/ucd-snmp/dlmod.c
new file mode 100644
index 0000000..e9742f2
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/dlmod.c
@@ -0,0 +1,614 @@
+/*
+ * Dynamic Loadable Agent Modules MIB (UCD-DLMOD-MIB) - dlmod.c
+ *
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <stdio.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 <dlfcn.h>
+#include "dlmod.h"
+
+#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;
+};
+
+#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
+
+static struct dlmod *dlmods = NULL;
+static unsigned int dlmod_next_index = 1;
+static char dlmod_path[1024];
+
+static 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 = (int)dlmod_next_index++;
+ dlm->status = DLMOD_UNLOADED;
+
+ for (pdlmod = &dlmods; *pdlmod != NULL; pdlmod = &((*pdlmod)->next));
+ (*pdlmod) = dlm;
+
+ return dlm;
+}
+
+static 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;
+ }
+}
+
+static void
+dlmod_load_module(struct dlmod *dlm)
+{
+ 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 {
+ char *st, *p, tmp_path[255];
+
+ 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;
+ }
+ }
+ strlcpy(dlm->path, tmp_path, sizeof(dlm->path));
+ if (dlm->status == DLMOD_ERROR)
+ return;
+ }
+ {
+ char sym_init[64 + sizeof("init_")];
+ int (*dl_init) (void);
+
+ 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;
+}
+
+static void
+dlmod_unload_module(struct dlmod *dlm)
+{
+ char sym_deinit[64 + sizeof("shutdown_")];
+ 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) {
+ snprintf(sym_deinit, sizeof(sym_deinit), "shutdown_%s", dlm->name);
+ dl_deinit = dlsym(dlm->handle, sym_deinit);
+ }
+ if (dl_deinit) {
+ DEBUGMSGTL(("dlmod", "Calling %s()\n", sym_deinit));
+ dl_deinit();
+ } else {
+ DEBUGMSGTL(("dlmod", "No destructor for %s\n", dlm->name));
+ }
+ dlclose(dlm->handle);
+ dlm->status = DLMOD_UNLOADED;
+ DEBUGMSGTL(("dlmod", "Module %s unloaded\n", dlm->name));
+}
+
+static 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;
+}
+
+/*
+ * Functions to parse config lines
+ */
+
+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;
+ }
+ strlcpy(dlm->name, dlm_name, sizeof(dlm->name));
+
+ /*
+ * dynamic module path
+ */
+ dlm_path = strtok_r(NULL, "\t ", &st);
+ if (dlm_path)
+ strlcpy(dlm->path, dlm_path, sizeof(dlm->path));
+ else
+ strlcpy(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;
+}
+
+/*
+ * Functions to handle SNMP management
+ */
+
+#define DLMODNEXTINDEX 1
+#define DLMODINDEX 2
+#define DLMODNAME 3
+#define DLMODPATH 4
+#define DLMODERROR 5
+#define DLMODSTATUS 6
+
+/*
+ * 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;
+}
+
+
+static 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 NULL;
+
+ /*
+ * 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 NULL;
+}
+
+
+static 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;
+}
+
+static 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;
+}
+
+static 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;
+}
+
+/*
+ * 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 = NULL;
+ unsigned 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;
+}
+
+static 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 NULL;
+
+ /*
+ * 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 NULL;
+}
+
+/*
+ * this variable defines function callbacks and type return
+ * information for the dlmod mib
+ */
+static struct variable4 dlmod_variables[] = {
+ {DLMODNEXTINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_dlmod, 1, {1}},
+ {DLMODNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_dlmodEntry, 3, {2, 1, 2}},
+ {DLMODPATH, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_dlmodEntry, 3, {2, 1, 3}},
+ {DLMODERROR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_dlmodEntry, 3, {2, 1, 4}},
+ {DLMODSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_dlmodEntry, 3, {2, 1, 5}},
+};
+
+static oid dlmod_variables_oid[] = { 1, 3, 6, 1, 4, 1, 2021, 13, 14 };
+
+void
+init_dlmod(void)
+{
+ 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");
+
+ {
+ const char * const p = getenv("SNMPDLMODPATH");
+ strncpy(dlmod_path, SNMPDLMODPATH, sizeof(dlmod_path));
+ dlmod_path[ sizeof(dlmod_path) - 1 ] = 0;
+ if (p) {
+ if (p[0] == ':') {
+ int 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));
+}
+
+netsnmp_feature_require(snmpd_unregister_config_handler)
+
+void
+shutdown_dlmod(void)
+{
+ snmpd_unregister_config_handler("dlmod");
+ unregister_mib(dlmod_variables_oid, OID_LENGTH(dlmod_variables_oid));
+}
diff --git a/agent/mibgroup/ucd-snmp/dlmod.h b/agent/mibgroup/ucd-snmp/dlmod.h
new file mode 100644
index 0000000..df8bef7
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/dlmod.h
@@ -0,0 +1,18 @@
+/*
+ * Dynamic Loadable Agent Modules MIB (UCD-DLMOD-MIB) - dlmod.h
+ *
+ */
+
+#ifndef MIBGROUP_DLMOD_H
+#define MIBGROUP_DLMOD_H
+
+#if !defined(HAVE_DLFCN_H) || !defined(HAVE_DLOPEN)
+config_error(Dynamic modules not supported on this platform)
+#endif
+
+config_add_mib(UCD-DLMOD-MIB)
+
+void init_dlmod(void);
+void shutdown_dlmod(void);
+
+#endif /* MIBGROUP_DLMOD_H */
diff --git a/agent/mibgroup/ucd-snmp/errormib.c b/agent/mibgroup/ucd-snmp/errormib.c
new file mode 100644
index 0000000..7f3bcb1
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/errormib.c
@@ -0,0 +1,228 @@
+#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
+# 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_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
+#if !defined(dragonfly)
+#ifdef HAVE_SYS_VNODE_H
+#include <sys/vnode.h>
+#endif
+#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
+
+#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/header_generic.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))) {
+ strlcpy(errorstring, to, sizeof(errorstring));
+ 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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_errors, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_errors, 1, {ERRORNAME}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_errors, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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) {
+ strlcpy(errmsg, errorstring, sizeof(errmsg));
+ } else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ }
+ return NULL;
+}
diff --git a/agent/mibgroup/ucd-snmp/errormib.h b/agent/mibgroup/ucd-snmp/errormib.h
new file mode 100644
index 0000000..501642c
--- /dev/null
+++ b/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/header_generic)
+
+ void setPerrorstatus(const char *);
+ void seterrorstatus(const char *, int);
+ extern FindVarMethod var_extensible_errors;
+
+#include "mibdefs.h"
+
+#endif /* _MIBGROUP_ERRORMIB_H */
diff --git a/agent/mibgroup/ucd-snmp/extensible.c b/agent/mibgroup/ucd-snmp/extensible.c
new file mode 100644
index 0000000..d1752ef
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/extensible.c
@@ -0,0 +1,687 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+# include <sys/time.h>
+# 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>
+
+#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 <net-snmp/library/system.h>
+
+#include "struct.h"
+#include "extensible.h"
+#include "mibgroup/util_funcs.h"
+#include "utilities/execute.h"
+#include "util_funcs/header_simple_table.h"
+
+netsnmp_feature_require(get_exten_instance)
+netsnmp_feature_require(parse_miboid)
+
+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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_relocatable, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_relocatable, 1, {ERRORNAME}},
+ {SHELLCOMMAND, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_relocatable, 1, {SHELLCOMMAND}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_relocatable, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_relocatable, 1, {ERRORMSG}},
+ {ERRORFIX, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_relocatable, 1, {ERRORFIX}},
+ {ERRORFIXCMD, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_relocatable, 1, {ERRORFIXCMD}}
+};
+
+
+void
+init_extensible(void)
+{
+
+ struct variable2 extensible_extensible_variables[] = {
+ {MIBINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_shell, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_shell, 1, {ERRORNAME}},
+ {SHELLCOMMAND, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_shell, 1, {SHELLCOMMAND}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_shell, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_shell, 1, {ERRORMSG}},
+ {ERRORFIX, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_shell, 1, {ERRORFIX}},
+ {ERRORFIXCMD, ASN_OCTET_STR, NETSNMP_OLDAPI_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;
+ sprintf(ptmp->command, "%.*s", (int) (tcptr - cptr), cptr);
+ }
+#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;
+ }
+
+ strlcpy(execp->fixcmd, cptr, sizeof(execp->fixcmd));
+}
+
+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;
+ strlcpy(errmsg, cp1, sizeof(errmsg));
+ *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/agent/mibgroup/ucd-snmp/extensible.h b/agent/mibgroup/ucd-snmp/extensible.h
new file mode 100644
index 0000000..24bd16d
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/extensible.h
@@ -0,0 +1,33 @@
+/*
+ * Template MIB group interface - extensible.h
+ *
+ */
+#ifndef _MIBGROUP_EXTENSIBLE_H
+#define _MIBGROUP_EXTENSIBLE_H
+
+void init_extensible(void);
+
+config_require(util_funcs/header_simple_table)
+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/agent/mibgroup/ucd-snmp/file.c b/agent/mibgroup/ucd-snmp/file.c
new file mode 100644
index 0000000..9e345d8
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/file.c
@@ -0,0 +1,184 @@
+/* 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
+# 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_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/header_simple_table.h"
+
+#define MAXFILE 20
+
+struct filestat fileTable[MAXFILE];
+int fileCount;
+
+void
+init_file(void)
+{
+ struct variable2 file_table[] = {
+ {FILE_INDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_file_table, 1, {1}},
+ {FILE_NAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_file_table, 1, {2}},
+ {FILE_SIZE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_file_table, 1, {3}},
+ {FILE_MAX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_file_table, 1, {4}},
+ {FILE_ERROR, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_file_table, 1, {100}},
+ {FILE_MSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/file.h b/agent/mibgroup/ucd-snmp/file.h
new file mode 100644
index 0000000..455086f
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/file.h
@@ -0,0 +1,38 @@
+/*
+ * Template MIB group interface - file.h
+ *
+ */
+#ifndef _MIBGROUP_FILE_H
+#define _MIBGROUP_FILE_H
+
+#include "mibdefs.h"
+
+config_require(util_funcs/header_simple_table)
+
+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/agent/mibgroup/ucd-snmp/hpux.c b/agent/mibgroup/ucd-snmp/hpux.c
new file mode 100644
index 0000000..9c5f9f9
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/hpux.c
@@ -0,0 +1,125 @@
+/*
+ * 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, NETSNMP_OLDAPI_RWRITE,
+ var_hp, 1, {HPCONF}},
+ {HPRECONFIG, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_hp, 1, {HPRECONFIG}},
+ {HPFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_hp, 1, {HPFLAG}},
+ {HPLOGMASK, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_hp, 1, {ERRORFLAG}},
+ {HPSTATUS, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_hp, 1, {ERRORMSG}}
+ };
+
+ struct variable2 hptrap_variables[] = {
+ {HPTRAP, ASN_IPADDRESS, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/hpux.h b/agent/mibgroup/ucd-snmp/hpux.h
new file mode 100644
index 0000000..02f72c7
--- /dev/null
+++ b/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/agent/mibgroup/ucd-snmp/lmSensors.c b/agent/mibgroup/ucd-snmp/lmSensors.c
new file mode 100644
index 0000000..05c60b7
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/lmSensors.c
@@ -0,0 +1,1071 @@
+/* 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * minimal include directives
+ */
+
+#include "util_funcs/header_simple_table.h"
+#include <time.h>
+
+netsnmp_feature_require(table_container)
+
+
+/*
+ * Load required drivers and libraries.
+ */
+
+#ifdef solaris2
+ #include <kstat.h>
+ #ifdef HAVE_PICL_H
+ #include <picl.h> /* accesses the picld daemon */
+ #else
+ /* the following should be sufficient for any Sun-based sensors */
+ #include </usr/platform/sun4u/include/sys/envctrl.h>
+ #endif
+#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, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {2, 1, 1}},
+#define LMTEMPSENSORSDEVICE 4
+ {LMTEMPSENSORSDEVICE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {2, 1, 2}},
+#define LMTEMPSENSORSVALUE 5
+ {LMTEMPSENSORSVALUE, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {2, 1, 3}},
+#define LMFANSENSORSINDEX 8
+ {LMFANSENSORSINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {3, 1, 1}},
+#define LMFANSENSORSDEVICE 9
+ {LMFANSENSORSDEVICE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {3, 1, 2}},
+#define LMFANSENSORSVALUE 10
+ {LMFANSENSORSVALUE, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {3, 1, 3}},
+#define LMVOLTSENSORSINDEX 13
+ {LMVOLTSENSORSINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {4, 1, 1}},
+#define LMVOLTSENSORSDEVICE 14
+ {LMVOLTSENSORSDEVICE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {4, 1, 2}},
+#define LMVOLTSENSORSVALUE 15
+ {LMVOLTSENSORSVALUE, ASN_GAUGE, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {4, 1, 3}},
+#define LMMISCSENSORSINDEX 18
+ {LMMISCSENSORSINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {5, 1, 1}},
+#define LMMISCSENSORSDEVICE 19
+ {LMMISCSENSORSDEVICE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_lmSensorsTable, 3, {5, 1, 2}},
+#define LMMISCSENSORSVALUE 20
+ {LMMISCSENSORSVALUE, ASN_GAUGE, NETSNMP_OLDAPI_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 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:
+ strlcpy(string, s.name, sizeof(string));
+ *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 */
+leaving:
+#endif /* not solaris2 */
+
+ 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, const 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, const 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 void
+process_num_sensor(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX],
+ const 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 void
+process_enum_sensor(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX],
+ int typ, const 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 void
+process_individual_fan(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "AtoDSensorValue", FAN_TYPE, 1);
+}
+
+
+static void
+process_newtype_fan(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "Speed", FAN_TYPE, 1);
+}
+
+
+static void
+process_temperature_sensor(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "Temperature", TEMP_TYPE, 1000);
+} /* MIB asks for mC */
+
+static void
+process_voltage_sensor(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "Voltage", VOLT_TYPE, 1000);
+} /* MIB asks for mV */
+
+static void
+process_digital_sensor(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "AtoDSensorValue", VOLT_TYPE, 1);
+}
+
+
+static void
+process_switch(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX])
+{
+
+ const char *settings[]={"OFF","ON","NORMAL","LOCKED","UNKNOWN",
+ "DIAG","SECURE",NULL};
+
+ process_enum_sensor(childh, propname, MISC_TYPE, settings);
+}
+
+static void
+process_led(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX])
+{
+
+ const char *settings[]={"OFF","ON","BLINK",NULL};
+ process_enum_sensor(childh, propname, MISC_TYPE, settings);
+}
+
+static void
+process_i2c(picl_nodehdl_t childh,
+ const char propname[PICL_PROPNAMELEN_MAX])
+{
+ const 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;
+#ifdef HAVE_PICL_H
+ int er_code;
+ picl_errno_t error_code;
+ int level=0;
+ picl_nodehdl_t rooth;
+#else
+ 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;
+#endif
+
+/* 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
+
+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 */
+
+#else /* 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;
+ strlcpy(sensor_array[typ].sensor[other].name, "FSP",
+ MAX_NAME);
+ 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;
+ strlcpy(sensor_array[typ].sensor[temp].name, "Ambient",
+ MAX_NAME);
+ 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;
+ strlcpy(sensor_array[typ].sensor[other].name, "Backplane4",
+ MAX_NAME);
+ 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;
+ strlcpy(sensor_array[typ].sensor[other].name, "Backplane8",
+ MAX_NAME);
+ 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 */
+#endif
+
+#else /* end solaris2 only ie. ifdef everything else */
+
+ const sensors_chip_name *chip;
+ const sensors_feature_data *data;
+ int chip_nr = 0;
+ unsigned int i = 0;
+
+ DEBUGMSG(("ucd-snmp/lmSensors", "=> sensor_load\n"));
+
+ 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 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 = 0;
+ _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 1;
+ } /* end if array->sensor */
+ array->current_len = new_size / sizeof(_sensor);
+ DEBUGMSG(("ucd-snmp/lmSensors", "type #%d increased to %d elements\n", type, (int)array->current_len));
+ } /* end if array->current */
+ strlcpy(array->sensor[array->n].name, label, MAX_NAME);
+ array->sensor[array->n].value = (int) (val * mul);
+ DEBUGMSGTL(("sensors","sensor %s, 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 */
+ DEBUGMSG(("ucd-snmp/lmSensors", "<= sensor_load\n"));
+#endif /* end else ie. ifdef everything else */
+ /* Update the timestamp after a load. */
+ timestamp = t;
+ return 0;
+}
+
+#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/agent/mibgroup/ucd-snmp/lmSensors.h b/agent/mibgroup/ucd-snmp/lmSensors.h
new file mode 100644
index 0000000..92098a6
--- /dev/null
+++ b/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/header_simple_table)
+config_add_mib(LM-SENSORS-MIB)
+
+ void init_lmSensors(void);
+ void shutdown_lmSensors(void);
+ FindVarMethod var_lmSensorsTable;
+
+#endif /* _MIBGROUP_LMSENSORS_H */
diff --git a/agent/mibgroup/ucd-snmp/lmsensorsMib.c b/agent/mibgroup/ucd-snmp/lmsensorsMib.c
new file mode 100644
index 0000000..5a50697
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/lmsensorsMib.c
@@ -0,0 +1,206 @@
+#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/sensors.h>
+#include "hardware/sensors/hw_sensors.h"
+#include "ucd-snmp/lmsensorsMib.h"
+
+netsnmp_container *sensorContainer = NULL;
+
+void initialize_lmSensorsTable(const char *tableName, const oid *tableOID,
+ netsnmp_container_op *filter, int mult );
+
+int _sensor_filter_temp( netsnmp_container *c, const void *v );
+int _sensor_filter_fan( netsnmp_container *c, const void *v );
+int _sensor_filter_volt( netsnmp_container *c, const void *v );
+int _sensor_filter_misc( netsnmp_container *c, const void *v );
+
+static const oid lmTempSensorsTable_oid[] = {1,3,6,1,4,1,2021,13,16,2};
+static const oid lmFanSensorsTable_oid[] = {1,3,6,1,4,1,2021,13,16,3};
+static const oid lmVoltSensorsTable_oid[] = {1,3,6,1,4,1,2021,13,16,4};
+static const oid lmMiscSensorsTable_oid[] = {1,3,6,1,4,1,2021,13,16,5};
+ /* All the tables have the same length root OID */
+const size_t lmSensorsTables_oid_len = OID_LENGTH(lmMiscSensorsTable_oid);
+
+
+/* Initialise the LM Sensors MIB module */
+void
+init_lmsensorsMib(void)
+{
+ DEBUGMSGTL(("ucd-snmp/lmsensorsMib","Initializing LM-SENSORS-MIB tables\n"));
+
+ /*
+ * Initialise the four LM-SENSORS-MIB tables
+ *
+ * They are almost identical, so we can use the same registration code.
+ */
+ initialize_lmSensorsTable( "lmTempSensorsTable", lmTempSensorsTable_oid,
+ _sensor_filter_temp, 1000 ); /* MIB asks for mC */
+ initialize_lmSensorsTable( "lmFanSensorsTable", lmFanSensorsTable_oid,
+ _sensor_filter_fan, 1);
+ initialize_lmSensorsTable( "lmVoltSensorsTable", lmVoltSensorsTable_oid,
+ _sensor_filter_volt, 1000 ); /* MIB asks for mV */
+ initialize_lmSensorsTable( "lmMiscSensorsTable", lmMiscSensorsTable_oid,
+ _sensor_filter_misc, 1 );
+}
+
+/*
+ * Common initialisation code, used for setting up all four tables
+ */
+void
+initialize_lmSensorsTable(const char *tableName, const oid *tableOID,
+ netsnmp_container_op *filter, int mult )
+{
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+ netsnmp_cache *cache;
+ netsnmp_container *container;
+
+ /*
+ * Ensure the HAL sensors module has been initialised,
+ * and retrieve the main sensors container.
+ * This table will then be registered using a filter on this container.
+ */
+ sensorContainer = get_sensor_container();
+ if ( !sensorContainer ) {
+ init_hw_sensors( );
+ sensorContainer = get_sensor_container();
+ }
+ container = netsnmp_container_find("sensorTable:table_container");
+ container->insert_filter = filter;
+ netsnmp_container_add_index( sensorContainer, container );
+
+
+ /*
+ * Create a basic registration structure for the table
+ */
+ reg = netsnmp_create_handler_registration(
+ tableName, lmSensorsTables_handler,
+ tableOID, lmSensorsTables_oid_len, HANDLER_CAN_RONLY
+ );
+
+ /*
+ * Register the table using the filtered container
+ * Include an indicator of any scaling to be applied to the sensor value
+ */
+ reg->my_reg_void = (void *)mult;
+ table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, 0);
+ table_info->min_column = COLUMN_LMSENSORS_INDEX;
+ table_info->max_column = COLUMN_LMSENSORS_VALUE;
+ netsnmp_container_table_register( reg, table_info, container, 0 );
+
+ /*
+ * If the HAL sensors module was configured as an on-demand caching
+ * module (rather than being automatically loaded regularly),
+ * then ensure this table makes use of that cache.
+ */
+ cache = get_sensor_cache();
+ if ( cache ) {
+ netsnmp_inject_handler_before( reg, netsnmp_cache_handler_get( cache ),
+ "table_container");
+ }
+
+}
+
+
+/*
+ * Container filters for the four tables
+ *
+ * Used to ensure that sensor entries appear in the appropriate table.
+ */
+int _sensor_filter_temp( netsnmp_container *c, const void *v ) {
+ const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
+ /* Only matches temperature sensors */
+ return (( sp->type == NETSNMP_SENSOR_TYPE_TEMPERATURE ) ? 0 : 1 );
+}
+
+int _sensor_filter_fan( netsnmp_container *c, const void *v ) {
+ const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
+ /* Only matches fan sensors */
+ return (( sp->type == NETSNMP_SENSOR_TYPE_RPM ) ? 0 : 1 );
+}
+
+int _sensor_filter_volt( netsnmp_container *c, const void *v ) {
+ const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
+ /* Only matches voltage sensors (AC or DC) */
+ return ((( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_DC ) ||
+ ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_AC )) ? 0 : 1 );
+}
+
+int _sensor_filter_misc( netsnmp_container *c, const void *v ) {
+ const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
+ /* Matches everything except temperature, fan or voltage sensors */
+ return ((( sp->type == NETSNMP_SENSOR_TYPE_TEMPERATURE ) ||
+ ( sp->type == NETSNMP_SENSOR_TYPE_RPM ) ||
+ ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_DC ) ||
+ ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_AC )) ? 1 : 0 );
+}
+
+
+/*
+ * Handle requests for any of the four lmXxxxSensorsTables
+ *
+ * This is possible because all the table share the
+ * same structure and behaviour.
+ */
+int
+lmSensorsTables_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_sensor_info *sensor_info;
+ int mult = (int)reginfo->my_reg_void;
+
+ DEBUGMSGTL(( "ucd-snmp/lmsensorsMib","lmSensorsTables_handler - root: "));
+ DEBUGMSGOID(("ucd-snmp/lmsensorsMib", reginfo->rootoid, reginfo->rootoid_len));
+ DEBUGMSG(( "ucd-snmp/lmsensorsMib",", mode %d\n", reqinfo->mode ));
+ /*
+ * This is a read-only table, so we only need to handle GET requests.
+ * (The container helper converts GETNEXT->GET requests automatically).
+ */
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ sensor_info = (netsnmp_sensor_info *)
+ netsnmp_container_table_extract_context(request);
+ if ( !sensor_info ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+
+ table_info = netsnmp_extract_table_info(request);
+ switch (table_info->colnum) {
+ case COLUMN_LMSENSORS_INDEX:
+ snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+ sensor_info->idx.oids[0]);
+ break;
+ case COLUMN_LMSENSORS_DEVICE:
+ if ( sensor_info->descr[0] != '\0' ) {
+ snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR,
+ sensor_info->descr, strlen(sensor_info->descr));
+ } else {
+ snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR,
+ sensor_info->name, strlen(sensor_info->name));
+ }
+ break;
+ case COLUMN_LMSENSORS_VALUE:
+ /* Multiply the value by the appropriate scaling factor for this table */
+ snmp_set_var_typed_integer( request->requestvb, ASN_GAUGE,
+ (int)(mult*sensor_info->value));
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/ucd-snmp/lmsensorsMib.h b/agent/mibgroup/ucd-snmp/lmsensorsMib.h
new file mode 100644
index 0000000..9d85dd1
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/lmsensorsMib.h
@@ -0,0 +1,23 @@
+#ifndef LM_SENSORS_MIB_H
+#define LM_SENSORS_MIB_H
+
+config_require(hardware/sensors)
+config_add_mib(LM-SENSORS-MIB)
+
+/* function declarations */
+void init_lmsensorsMib(void);
+
+/*
+ * Handler and Column definitions for lmXxxxSensorsTable
+ *
+ * Note that the same handler (and hence the same
+ * column identifiers) are used for all four tables.
+ * This is possible because all the table share the
+ * same structure and behaviour.
+ */
+Netsnmp_Node_Handler lmSensorsTables_handler;
+#define COLUMN_LMSENSORS_INDEX 1
+#define COLUMN_LMSENSORS_DEVICE 2
+#define COLUMN_LMSENSORS_VALUE 3
+
+#endif /* LM_SENSORS_MIB_H */
diff --git a/agent/mibgroup/ucd-snmp/loadave.c b/agent/mibgroup/ucd-snmp/loadave.c
new file mode 100644
index 0000000..6efc5e9
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/loadave.c
@@ -0,0 +1,496 @@
+#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
+#if !defined(dragonfly)
+#ifdef HAVE_SYS_VNODE_H
+#include <sys/vnode.h>
+#endif
+#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
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#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) || defined(aix7)
+#ifdef HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#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/header_simple_table.h"
+#include "kernel.h"
+
+static double maxload[3];
+static int laConfigSet = 0;
+
+static int
+loadave_store_config(int a, int b, void *c, void *d)
+{
+ char line[SNMP_MAXBUF_SMALL];
+ if (laConfigSet > 0) {
+ snprintf(line, SNMP_MAXBUF_SMALL, "pload %.02f %.02f %.02f", maxload[0], maxload[1], maxload[2]);
+ snmpd_store_config(line);
+ }
+ return SNMPERR_SUCCESS;
+}
+
+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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_loadave, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_loadave, 1, {ERRORNAME}},
+ {LOADAVE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_loadave, 1, {LOADAVE}},
+ {LOADMAXVAL, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_loadave, 1, {LOADMAXVAL}},
+ {LOADAVEINT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_loadave, 1, {LOADAVEINT}},
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ {LOADAVEFLOAT, ASN_OPAQUE_FLOAT, NETSNMP_OLDAPI_RONLY,
+ var_extensible_loadave, 1, {LOADAVEFLOAT}},
+#endif
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_loadave, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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);
+
+ laConfigSet = 0;
+
+ snmpd_register_config_handler("load", loadave_parse_config,
+ loadave_free_config,
+ "max1 [max5] [max15]");
+
+ snmpd_register_config_handler("pload",
+ loadave_parse_config, NULL, NULL);
+
+
+ /*
+ * we need to be called back later
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ loadave_store_config, NULL);
+
+}
+
+void
+loadave_parse_config(const char *token, char *cptr)
+{
+ int i;
+
+ if (strcmp(token, "pload") == 0) {
+ if (laConfigSet < 0) {
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only load\n");
+ return;
+ } else {
+ laConfigSet++;
+ }
+ } else {
+ if (laConfigSet > 0) {
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only load\n");
+ /*
+ * Fall through and copy in this value.
+ */
+ }
+ laConfigSet = -1;
+ }
+
+ 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)
+{
+#if defined(HAVE_GETLOADAVG) || defined(linux) || defined(ultrix) \
+ || defined(sun) || defined(__alpha) || defined(dynix) \
+ || !defined(cygwin) && defined(NETSNMP_CAN_USE_NLIST) \
+ && defined(LOADAVE_SYMBOL)
+ double *pave = r_ave;
+#endif
+#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) || defined(aix7)
+ 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) {
+ NETSNMP_LOGONCE((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) || defined(aix7)
+ 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;
+}
+
+static int
+write_laConfig(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 double laConfig = 0;
+
+ switch (action) {
+ case RESERVE1: /* Check values for acceptability */
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("ucd-snmp/loadave",
+ "write to laConfig not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > 8 || var_val_len <= 0) {
+ DEBUGMSGTL(("ucd-snmp/loadave",
+ "write to laConfig: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ if (laConfigSet < 0) {
+ /*
+ * The object is set in a read-only configuration file.
+ */
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+ case RESERVE2: /* Allocate memory and similar resources */
+ {
+ char buf[8];
+ int old_errno = errno;
+ double val;
+ char *endp;
+
+ sprintf(buf, "%.*s", (int) var_val_len, (char *)var_val);
+ val = strtod(buf, &endp);
+
+ if (errno == ERANGE || *endp != '\0' || val < 0 || val > 65536.00) {
+ errno = old_errno;
+ DEBUGMSGTL(("ucd-snmp/loadave",
+ "write to laConfig: invalid value\n"));
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ errno = old_errno;
+
+ laConfig = val;
+ }
+ break;
+
+ case COMMIT:
+ {
+ int idx = name[name_len - 1] - 1;
+ maxload[idx] = laConfig;
+ laConfigSet = 1;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+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 LOADMAXVAL:
+ /* setup write method, but don't return yet */
+ *write_method = write_laConfig;
+ break;
+ 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 NULL;
+ 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]) {
+ snprintf(errmsg, sizeof(errmsg),
+ "%d min Load Average too high (= %.2f)",
+ (name[*length - 1] ==
+ 1) ? 1 : ((name[*length - 1] == 2) ? 5 : 15),
+ avenrun[name[*length - 1] - 1]);
+ errmsg[sizeof(errmsg) - 1] = '\0';
+ } else {
+ errmsg[0] = 0;
+ }
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ }
+ return NULL;
+}
diff --git a/agent/mibgroup/ucd-snmp/loadave.h b/agent/mibgroup/ucd-snmp/loadave.h
new file mode 100644
index 0000000..4f5e7a5
--- /dev/null
+++ b/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/header_simple_table)
+
+ 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/agent/mibgroup/ucd-snmp/logmatch.c b/agent/mibgroup/ucd-snmp/logmatch.c
new file mode 100644
index 0000000..abca5ce
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/logmatch.c
@@ -0,0 +1,651 @@
+/* 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 "logmatch.h"
+
+#ifdef HAVE_REGEX_H
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <regex.h>
+#include <time.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs/header_generic.h"
+#include "util_funcs/header_simple_table.h"
+
+/*
+ * ------------------------------------------------
+ * This function checks if the filename pattern
+ * contains the % character indicating a variable
+ * filename (i.e. it uses date/time format control
+ * codes, see 'man date') then expands those control
+ * codes based on current time and sets the
+ * filename field in the struct.
+ * Returns 1 if the filename changed, 0 otherwise
+ * -------------------------------------------------
+ */
+
+static int
+logmatch_update_filename(const char * pattern, char * currentFilename)
+{
+ time_t t;
+ struct tm *tmp;
+ char newFilename[256];
+
+ /*
+ * -------------------------------------------------------------------
+ * if the filename pattern doesn't have the "%" character just return,
+ * since there is no need for further processing
+ * -------------------------------------------------------------------
+ */
+ if (strchr(pattern, '%') == NULL) {
+ return 0;
+ }
+
+ t = time(NULL);
+ tmp = localtime(&t);
+
+ if (tmp == NULL) {
+ perror("localtime");
+ return 0;
+ }
+
+ /* result of expansion must fit into newFilename, otherwise returning */
+ if (strftime(newFilename, sizeof(newFilename), pattern, tmp) == 0) {
+ return 0;
+ }
+
+ /* if same as current filename, just return */
+ if (strcmp(currentFilename, newFilename) == 0) {
+ return 0;
+ } else {
+ /* otherwise update currentFilename and return 1 */
+ strcpy(currentFilename, newFilename);
+ return 1;
+ }
+}
+
+struct logmatchstat {
+ char filenamePattern[256];
+ 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;
+};
+
+#define MAXLOGMATCH 250
+
+static struct logmatchstat logmatchTable[MAXLOGMATCH];
+static int logmatchCount = 0;
+
+/***************************************************************
+* *
+* updateLogmatch *
+* this function is called back by snmpd alarms *
+* *
+***************************************************************/
+
+static void
+updateLogmatch(int iindex)
+{
+
+ 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;
+ char lastFilename[256];
+
+ /*
+ * ------------------------------------
+ * 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 %s",
+ &pos, &ccounter, &counter, lastFilename)) {
+
+
+ /*
+ * ------------------------------------
+ * the data could be read; now let's
+ * try to open the logfile to be
+ * scanned
+ * ------------------------------------
+ */
+
+ if (logmatch_update_filename(logmatchTable[iindex].filenamePattern,
+ lastFilename) == 0) {
+
+ /*
+ * ---------------------------------
+ * the filename is still the same as
+ * the one stored in the persistent
+ * data file.
+ * ---------------------------------
+ */
+
+ 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;
+ }
+
+ fclose(logmatchTable[iindex].logfile);
+ }
+ }
+ logmatchTable[iindex].globalMatchCounter = counter;
+ }
+
+ fclose(perfile);
+ }
+
+ logmatchTable[iindex].virgin = FALSE;
+ }
+
+ /*
+ * -------------------------------------------
+ * check if a new input file needs to be opened
+ * if yes, reset counter and position
+ * -------------------------------------------
+ */
+
+ if (logmatch_update_filename(logmatchTable[iindex].filenamePattern,
+ logmatchTable[iindex].filename) == 1) {
+ logmatchTable[iindex].currentFilePosition = 0;
+ logmatchTable[iindex].currentMatchCounter = 0;
+ }
+
+
+ /*
+ * ------------------------------------
+ * 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, NULL, 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 %s\n",
+ logmatchTable[iindex].currentFilePosition,
+ logmatchTable[iindex].currentMatchCounter,
+ logmatchTable[iindex].globalMatchCounter,
+ logmatchTable[iindex].filename);
+
+ fclose(perfile);
+ }
+
+}
+
+
+static void
+updateLogmatch_Scheduled(unsigned int registrationNumber,
+ struct logmatchstat *logmatchtable)
+{
+ updateLogmatch(logmatchtable->thisIndex);
+}
+
+/***************************************************************
+* *
+* logmatch_parse_config *
+* parse one line from snmpd.conf *
+* *
+***************************************************************/
+
+static 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].filenamePattern,
+ &space_path,
+ &(logmatchTable[logmatchCount].frequency),
+ logmatchTable[logmatchCount].regEx);
+
+ /* fill in filename with initial data */
+ strcpy(logmatchTable[logmatchCount].filename,
+ logmatchTable[logmatchCount].filenamePattern);
+ logmatch_update_filename(logmatchTable[logmatchCount].filenamePattern,
+ logmatchTable[logmatchCount].filename);
+
+ /*
+ * 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++;
+ }
+}
+
+/***************************************************************
+* *
+* logmatch_free_config *
+* free memory allocated by this mib module *
+* *
+***************************************************************/
+
+static 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;
+}
+
+
+#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
+
+/*
+ * OID functions
+ */
+
+static 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;
+}
+
+void
+init_logmatch(void)
+{
+ struct variable2 logmatch_info[] = {
+ {LOGMATCH_INFO, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 0}
+ };
+
+ struct variable2 logmatch_table[] = {
+ {LOGMATCH_INDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {1}},
+ {LOGMATCH_NAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {2}},
+ {LOGMATCH_FILENAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {3}},
+ {LOGMATCH_REGEX, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {4}},
+ {LOGMATCH_GLOBALCTR, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {5}},
+ {LOGMATCH_GLOBALCNT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {6}},
+ {LOGMATCH_CURRENTCTR, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {7}},
+ {LOGMATCH_CURRENTCNT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {8}},
+ {LOGMATCH_COUNTER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {9}},
+ {LOGMATCH_COUNT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {10}},
+ {LOGMATCH_FREQ, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {11}},
+ {LOGMATCH_ERROR, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_logmatch_table, 1, {100}},
+ {LOGMATCH_MSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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");
+
+}
+
+#endif /* HAVE_REGEX_H */
diff --git a/agent/mibgroup/ucd-snmp/logmatch.h b/agent/mibgroup/ucd-snmp/logmatch.h
new file mode 100644
index 0000000..b94ad3a
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/logmatch.h
@@ -0,0 +1,13 @@
+/*
+ * Template MIB group interface - logmatch.h
+ *
+ */
+#ifndef _MIBGROUP_LOGMATCH_H
+#define _MIBGROUP_LOGMATCH_H
+
+config_require(util_funcs/header_generic)
+config_require(util_funcs/header_simple_table)
+
+void init_logmatch(void);
+
+#endif /* _MIBGROUP_LOGMATCH_H */
diff --git a/agent/mibgroup/ucd-snmp/memory.c b/agent/mibgroup/ucd-snmp/memory.c
new file mode 100644
index 0000000..742186f
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory.c
@@ -0,0 +1,230 @@
+/*
+ * 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 */
+static int minimum_swap;
+
+/** Initializes the memory module */
+void
+init_memory(void)
+{
+ const oid memory_oid[] = { 1, 3, 6, 1, 4, 1, 2021, 4 };
+ const oid memSwapError_oid[] = { 1, 3, 6, 1, 4, 1, 2021, 4, 100 };
+ const oid memSwapErrMsg_oid[] = { 1, 3, 6, 1, 4, 1, 2021, 4, 101 };
+
+ DEBUGMSGTL(("memory", "Initializing\n"));
+
+ netsnmp_register_scalar_group(
+ netsnmp_create_handler_registration("memory", handle_memory,
+ memory_oid, OID_LENGTH(memory_oid),
+ HANDLER_CAN_RONLY),
+ 1, 17);
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("memSwapError", handle_memory,
+ memSwapError_oid, OID_LENGTH(memSwapError_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("memSwapErrMsg", handle_memory,
+ memSwapErrMsg_oid, OID_LENGTH(memSwapErrMsg_oid),
+ 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[ reginfo->rootoid_len - 2 ]) {
+ 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 (%" NETSNMP_PRIo "u) in handle_memory\n",
+ requests->requestvb->name[ reginfo->rootoid_len - 2 ]);
+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/agent/mibgroup/ucd-snmp/memory.h b/agent/mibgroup/ucd-snmp/memory.h
new file mode 100644
index 0000000..a44d82e
--- /dev/null
+++ b/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/agent/mibgroup/ucd-snmp/memory_aix4.c b/agent/mibgroup/ucd-snmp/memory_aix4.c
new file mode 100644
index 0000000..786e5eb
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_aix4.c
@@ -0,0 +1,254 @@
+/*
+ * 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/header_generic.h" /* utility function declarations */
+#include "memory.h" /* the module-specific header */
+#include "memory_aix4.h" /* the module-specific header */
+
+#ifdef HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/memory_aix4.h b/agent/mibgroup/ucd-snmp/memory_aix4.h
new file mode 100644
index 0000000..c39596c
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_aix4.h
@@ -0,0 +1,14 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_AIX4_H
+#define _MIBGROUP_MEMORY_AIX4_H
+
+config_require(util_funcs/header_generic)
+
+#include "mibdefs.h"
+
+void init_memory_aix4(void);
+
+#endif /* _MIBGROUP_MEMORY_AIX4_H */
diff --git a/agent/mibgroup/ucd-snmp/memory_darwin7.c b/agent/mibgroup/ucd-snmp/memory_darwin7.c
new file mode 100644
index 0000000..74d5365
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_darwin7.c
@@ -0,0 +1,411 @@
+/*
+ * 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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/memory_darwin7.h b/agent/mibgroup/ucd-snmp/memory_darwin7.h
new file mode 100644
index 0000000..ab5d264
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_darwin7.h
@@ -0,0 +1,14 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_DARWIN7_H
+#define _MIBGROUP_MEMORY_DARWIN7_H
+
+config_require(util_funcs/header_generic)
+
+#include "mibdefs.h"
+
+extern void init_memory_darwin7(void);
+
+#endif /* _MIBGROUP_MEMORY_DARWIN7_H */
diff --git a/agent/mibgroup/ucd-snmp/memory_dynix.c b/agent/mibgroup/ucd-snmp/memory_dynix.c
new file mode 100644
index 0000000..261c4cd
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_dynix.c
@@ -0,0 +1,229 @@
+#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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/memory_dynix.h b/agent/mibgroup/ucd-snmp/memory_dynix.h
new file mode 100644
index 0000000..4fb5294
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_dynix.h
@@ -0,0 +1,29 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_DYNIX_H
+#define _MIBGROUP_MEMORY_DYNIX_H
+
+config_require(util_funcs/header_generic)
+
+#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/agent/mibgroup/ucd-snmp/memory_freebsd2.c b/agent/mibgroup/ucd-snmp/memory_freebsd2.c
new file mode 100644
index 0000000..22dde4c
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_freebsd2.c
@@ -0,0 +1,389 @@
+/*
+ * 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>
+#ifdef dragonfly
+#include <sys/user.h>
+#else
+#include <sys/proc.h>
+#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 "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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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];
+
+#ifdef dragonfly
+ static struct vmstats mem;
+ size_t vmstats_size = sizeof(mem);
+#endif
+ static struct vmmeter mem;
+#endif
+ 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
+ */
+#ifdef dragonfly
+ sysctlbyname("vm.vmstats", &vmstats, &vmstats_size, NULL, 0);
+#else
+ auto_nlist(SUM_SYMBOL, (char *) &mem, sizeof(mem));
+#endif
+ 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);
+#elif defined(dragonfly)
+ long_ret = ptok(mem.v_cache_count);
+#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/agent/mibgroup/ucd-snmp/memory_freebsd2.h b/agent/mibgroup/ucd-snmp/memory_freebsd2.h
new file mode 100644
index 0000000..ef2e0b9
--- /dev/null
+++ b/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/agent/mibgroup/ucd-snmp/memory_hpux.c b/agent/mibgroup/ucd-snmp/memory_hpux.c
new file mode 100644
index 0000000..c2b2478
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_hpux.c
@@ -0,0 +1,293 @@
+#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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/memory_hpux.h b/agent/mibgroup/ucd-snmp/memory_hpux.h
new file mode 100644
index 0000000..ffc3a9b
--- /dev/null
+++ b/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/agent/mibgroup/ucd-snmp/memory_netbsd1.c b/agent/mibgroup/ucd-snmp/memory_netbsd1.c
new file mode 100644
index 0000000..3d26a44
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_netbsd1.c
@@ -0,0 +1,257 @@
+/*
+ * 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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/memory_netbsd1.h b/agent/mibgroup/ucd-snmp/memory_netbsd1.h
new file mode 100644
index 0000000..a195f85
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_netbsd1.h
@@ -0,0 +1,14 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_NETBSD1_H
+#define _MIBGROUP_MEMORY_NETBSD1_H
+
+config_require(util_funcs/header_generic)
+
+#include "mibdefs.h"
+
+extern void init_memory_netbsd1(void);
+
+#endif /* _MIBGROUP_MEMORY_NETBSD1_H */
diff --git a/agent/mibgroup/ucd-snmp/memory_solaris2.c b/agent/mibgroup/ucd-snmp/memory_solaris2.c
new file mode 100644
index 0000000..2d36278
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_solaris2.c
@@ -0,0 +1,280 @@
+#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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_mem, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/memory_solaris2.h b/agent/mibgroup/ucd-snmp/memory_solaris2.h
new file mode 100644
index 0000000..fff5f79
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/memory_solaris2.h
@@ -0,0 +1,14 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_SOLARIS2_H
+#define _MIBGROUP_MEMORY_SOLARIS2_H
+
+config_require(util_funcs/header_generic)
+
+#include "mibdefs.h"
+
+void init_memory_solaris2(void);
+
+#endif /* _MIBGROUP_MEMORY_SOLARIS2_H */
diff --git a/agent/mibgroup/ucd-snmp/pass.c b/agent/mibgroup/ucd-snmp/pass.c
new file mode 100644
index 0000000..4aae728
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/pass.c
@@ -0,0 +1,325 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+#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 "pass_common.h"
+#include "extensible.h"
+#include "util_funcs.h"
+
+netsnmp_feature_require(get_exten_instance)
+netsnmp_feature_require(parse_miboid)
+
+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, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_pass, 0, {MIBINDEX}},
+};
+
+
+
+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;
+ unsigned long priority;
+
+ /*
+ * options
+ */
+ priority = DEFAULT_MIB_PRIORITY;
+ while (*cptr == '-') {
+ cptr++;
+ switch (*cptr) {
+ case 'p':
+ /* change priority level */
+ cptr++;
+ cptr = skip_white(cptr);
+ if (! isdigit((unsigned char)(*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((unsigned char)(*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)->mibpriority = priority;
+
+ (*ppass)->miblen = parse_miboid(cptr, (*ppass)->miboid);
+ while (isdigit((unsigned char)(*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++);
+ sprintf((*ppass)->command, "%.*s", (int) (tcptr - cptr), cptr);
+ }
+ strlcpy((*ppass)->name, (*ppass)->command, sizeof((*ppass)->name));
+ (*ppass)->next = NULL;
+
+ register_mib_priority("pass",
+ (struct variable *) extensible_passthru_variables,
+ sizeof(struct variable2), 1, (*ppass)->miboid,
+ (*ppass)->miblen, (*ppass)->mibpriority);
+
+ /*
+ * 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 != NULL; 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_priority(etmp2->miboid, etmp2->miblen, etmp2->mibpriority);
+ 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;
+ char buf[SNMP_MAXBUF];
+ static char buf2[SNMP_MAXBUF];
+ struct extensible *passthru;
+ FILE *file;
+
+ for (i = 1; i <= numpassthrus; i++) {
+ passthru = get_exten_instance(passthrus, i);
+ rtest = snmp_oidtree_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);
+
+ return netsnmp_internal_pass_parse(buf, buf2, var_len, vp);
+ }
+ *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];
+
+ for (i = 1; i <= numpassthrus; i++) {
+ passthru = get_exten_instance(passthrus, i);
+ rtest = snmp_oidtree_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;
+ netsnmp_internal_pass_set_format(buf, var_val, var_val_type, var_val_len);
+ strlcat(passthru->command, buf, sizeof(passthru->command));
+ DEBUGMSGTL(("ucd-snmp/pass", "pass-running: %s",
+ passthru->command));
+ exec_command(passthru);
+ DEBUGMSGTL(("ucd-snmp/pass", "pass-running returned: %s",
+ passthru->output));
+ return netsnmp_internal_pass_str_to_errno(passthru->output);
+ }
+ }
+ 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/agent/mibgroup/ucd-snmp/pass.h b/agent/mibgroup/ucd-snmp/pass.h
new file mode 100644
index 0000000..51c0689
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/pass.h
@@ -0,0 +1,26 @@
+/*
+ * pass: pass through extensiblity
+ */
+#ifndef _MIBGROUP_PASS_H
+#define _MIBGROUP_PASS_H
+
+void init_pass(void);
+
+config_require(ucd-snmp/pass_common)
+config_require(util_funcs)
+config_require(utilities/execute)
+config_add_mib(NET-SNMP-PASS-MIB)
+
+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/agent/mibgroup/ucd-snmp/pass_common.c b/agent/mibgroup/ucd-snmp/pass_common.c
new file mode 100644
index 0000000..38a0443
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/pass_common.c
@@ -0,0 +1,264 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <ctype.h>
+#if HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+#include <stdio.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 "mibgroup/util_funcs.h"
+#include "pass_common.h"
+
+static int
+netsnmp_internal_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;
+}
+
+static int
+netsnmp_internal_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((unsigned char) (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;
+}
+
+int
+netsnmp_internal_pass_str_to_errno(const char *buf)
+{
+ if (!strncasecmp(buf, "too-big", 7)) {
+ /* Shouldn't happen */
+ return SNMP_ERR_TOOBIG;
+ } else if (!strncasecmp(buf, "no-such-name", 12)) {
+ return SNMP_ERR_NOSUCHNAME;
+ } else if (!strncasecmp(buf, "bad-value", 9)) {
+ return SNMP_ERR_BADVALUE;
+ } else if (!strncasecmp(buf, "read-only", 9)) {
+ return SNMP_ERR_READONLY;
+ } else if (!strncasecmp(buf, "gen-error", 9)) {
+ return SNMP_ERR_GENERR;
+ } else if (!strncasecmp(buf, "no-access", 9)) {
+ return SNMP_ERR_NOACCESS;
+ } 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-encoding", 14)) {
+ return SNMP_ERR_WRONGENCODING;
+ } else if (!strncasecmp(buf, "wrong-value", 11)) {
+ return SNMP_ERR_WRONGVALUE;
+ } else if (!strncasecmp(buf, "no-creation", 11)) {
+ return SNMP_ERR_NOCREATION;
+ } else if (!strncasecmp(buf, "inconsistent-value", 18)) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ } else if (!strncasecmp(buf, "resource-unavailable", 20)) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ } else if (!strncasecmp(buf, "commit-failed", 13)) {
+ return SNMP_ERR_COMMITFAILED;
+ } else if (!strncasecmp(buf, "undo-failed", 11)) {
+ return SNMP_ERR_UNDOFAILED;
+ } else if (!strncasecmp(buf, "authorization-error", 19)) {
+ return SNMP_ERR_AUTHORIZATIONERROR;
+ } else if (!strncasecmp(buf, "not-writable", 12)) {
+ return SNMP_ERR_NOTWRITABLE;
+ } else if (!strncasecmp(buf, "inconsistent-name", 17)) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+unsigned char *
+netsnmp_internal_pass_parse(char * buf,
+ char * buf2,
+ size_t * var_len,
+ struct variable *vp)
+{
+ static long long_ret;
+ static in_addr_t addr_ret;
+ int newlen;
+ static oid objid[MAX_OID_LEN];
+
+ /*
+ * 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);
+ }
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ else if (!strncasecmp(buf, "integer64", 9)) {
+ static struct counter64 c64;
+ uint64_t v64 = strtoull(buf2, NULL, 10);
+ c64.high = (unsigned long)(v64 >> 32);
+ c64.low = (unsigned long)(v64 & 0xffffffff);
+ *var_len = sizeof(c64);
+ vp->type = ASN_INTEGER64;
+ return ((unsigned char *) &c64);
+ }
+#endif
+ 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, "counter64", 9)) {
+ static struct counter64 c64;
+ uint64_t v64 = strtoull(buf2, NULL, 10);
+ c64.high = (unsigned long)(v64 >> 32);
+ c64.low = (unsigned long)(v64 & 0xffffffff);
+ *var_len = sizeof(c64);
+ vp->type = ASN_COUNTER64;
+ return ((unsigned char *) &c64);
+ }
+ 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 = netsnmp_internal_asc2bin(buf2);
+ vp->type = ASN_OCTET_STR;
+ return ((unsigned char *) buf2);
+ } else if (!strncasecmp(buf, "opaque", 6)) {
+ *var_len = netsnmp_internal_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);
+ }
+ addr_ret =
+ (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
+ (objid[2] << 8) + objid[3];
+ addr_ret = htonl(addr_ret);
+ *var_len = sizeof(addr_ret);
+ vp->type = ASN_IPADDRESS;
+ return ((unsigned char *) &addr_ret);
+ }
+ *var_len = 0;
+ return (NULL);
+}
+
+void
+netsnmp_internal_pass_set_format(char *buf,
+ const u_char *var_val,
+ u_char var_val_type,
+ size_t var_val_len)
+{
+ char buf2[SNMP_MAXBUF];
+ long tmp;
+ unsigned long utmp;
+
+ switch (var_val_type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ tmp = *((const 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 = *((const 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 (netsnmp_internal_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, (const oid *) var_val, var_val_len/sizeof(oid));
+ snprintf(buf, sizeof(buf), "objectid \"%s\"\n", buf2);
+ buf[ sizeof(buf)-1 ] = 0;
+ break;
+ }
+}
diff --git a/agent/mibgroup/ucd-snmp/pass_common.h b/agent/mibgroup/ucd-snmp/pass_common.h
new file mode 100644
index 0000000..b1d7e4b
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/pass_common.h
@@ -0,0 +1,20 @@
+#ifndef NETSNMP_AGENT_MIBGROUP_PASS_COMMON_H
+#define NETSNMP_AGENT_MIBGROUP_PASS_COMMON_H
+
+/*
+ * This is an internal header file. The functions declared here might change
+ * or disappear at any time
+ */
+
+int
+netsnmp_internal_pass_str_to_errno(const char *buf);
+
+unsigned char *
+netsnmp_internal_pass_parse(char *buf, char *buf2, size_t *var_len,
+ struct variable *vp);
+
+void
+netsnmp_internal_pass_set_format(char *buf, const u_char *var_val,
+ u_char var_val_type, size_t var_val_len);
+
+#endif /* !NETSNMP_AGENT_MIBGROUP_PASS_COMMON_H */
diff --git a/agent/mibgroup/ucd-snmp/pass_persist.c b/agent/mibgroup/ucd-snmp/pass_persist.c
new file mode 100644
index 0000000..cc44232
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/pass_persist.c
@@ -0,0 +1,730 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+#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 "pass_common.h"
+#include "extensible.h"
+#include "util_funcs.h"
+
+netsnmp_feature_require(get_exten_instance)
+netsnmp_feature_require(parse_miboid)
+
+struct extensible *persistpassthrus = NULL;
+int numpersistpassthrus = 0;
+struct persist_pipe_type {
+ FILE *fIn, *fOut;
+ int fdIn, fdOut;
+ netsnmp_pid_t pid;
+} *persist_pipes = (struct persist_pipe_type *) NULL;
+static unsigned pipe_check_alarm_id;
+static int init_persist_pipes(void);
+static void close_persist_pipe(int iindex);
+static int open_persist_pipe(int iindex, char *command);
+static void check_persist_pipes(unsigned clientreg, void *clientarg);
+static void destruct_persist_pipes(void);
+static int write_persist_pipe(int iindex, const char *data);
+
+/*
+ * the relocatable extensible commands variables
+ */
+struct variable2 extensible_persist_passthru_variables[] = {
+ /*
+ * bogus entry. Only some of it is actually used.
+ */
+ {MIBINDEX, ASN_INTEGER, NETSNMP_OLDAPI_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");
+ pipe_check_alarm_id = snmp_alarm_register(10, SA_REPEAT, check_persist_pipes, NULL);
+}
+
+void
+shutdown_pass_persist(void)
+{
+ if (pipe_check_alarm_id) {
+ snmp_alarm_unregister(pipe_check_alarm_id);
+ pipe_check_alarm_id = 0;
+ }
+
+ /* Close any open pipes. */
+ destruct_persist_pipes();
+}
+
+void
+pass_persist_parse_config(const char *token, char *cptr)
+{
+ struct extensible **ppass = &persistpassthrus, **etmp, *ptmp;
+ char *tcptr, *endopt;
+ int i;
+ long int priority;
+
+ /*
+ * options
+ */
+ priority = DEFAULT_MIB_PRIORITY;
+ while (*cptr == '-') {
+ cptr++;
+ switch (*cptr) {
+ case 'p':
+ /* change priority level */
+ cptr++;
+ cptr = skip_white(cptr);
+ if (! isdigit((unsigned char)(*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((unsigned char)(*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)->mibpriority = priority;
+
+ (*ppass)->miblen = parse_miboid(cptr, (*ppass)->miboid);
+ while (isdigit((unsigned char)(*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++);
+ sprintf((*ppass)->command, "%.*s", (int) (tcptr - cptr), cptr);
+ }
+ strlcpy((*ppass)->name, (*ppass)->command, sizeof((*ppass)->name));
+ (*ppass)->next = NULL;
+
+ register_mib_priority("pass_persist",
+ (struct variable *) extensible_persist_passthru_variables,
+ sizeof(struct variable2), 1, (*ppass)->miboid,
+ (*ppass)->miblen, (*ppass)->mibpriority);
+
+ /*
+ * 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 != NULL; 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;
+
+ for (etmp = persistpassthrus; etmp != NULL;) {
+ etmp2 = etmp;
+ etmp = etmp->next;
+ unregister_mib_priority(etmp2->miboid, etmp2->miblen, etmp2->mibpriority);
+ 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;
+ char buf[SNMP_MAXBUF];
+ static char buf2[SNMP_MAXBUF];
+ struct extensible *persistpassthru;
+ FILE *file;
+
+ /*
+ * 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_oidtree_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);
+ }
+ return netsnmp_internal_pass_parse(buf, buf2, var_len, vp);
+ }
+ *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];
+
+ /*
+ * 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_oidtree_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;
+ netsnmp_internal_pass_set_format(buf, var_val, var_val_type, var_val_len);
+ strlcat(persistpassthru->command, buf,
+ sizeof(persistpassthru->command));
+ 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;
+ }
+
+ return netsnmp_internal_pass_str_to_errno(buf);
+ }
+ }
+ 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 = NETSNMP_NO_SUCH_PROCESS;
+ }
+ }
+ return persist_pipes ? 1 : 0;
+}
+
+/**
+ * Return true if and only if the process associated with the persistent
+ * pipe has stopped.
+ *
+ * @param[in] idx Persistent pipe index.
+ */
+static int process_stopped(int idx)
+{
+ if (persist_pipes[idx].pid != NETSNMP_NO_SUCH_PROCESS) {
+#if HAVE_SYS_WAIT_H
+ return waitpid(persist_pipes[idx].pid, NULL, WNOHANG) > 0;
+#endif
+#if defined(WIN32) && !defined (mingw32) && !defined(HAVE_SIGNAL)
+ return WaitForSingleObject(persist_pipes[idx].pid, 0) == WAIT_OBJECT_0;
+#endif
+ }
+ return 0;
+}
+
+/**
+ * Iterate over all persistent pipes and close those pipes of which the
+ * associated process has stopped.
+ */
+static void check_persist_pipes(unsigned clientreg, void *clientarg)
+{
+ int i;
+
+ if (!persist_pipes)
+ return;
+
+ for (i = 0; i <= numpersistpassthrus; i++) {
+ if (process_stopped(i)) {
+ snmp_log(LOG_INFO, "pass_persist[%d]: child process stopped - closing pipe\n", i);
+ close_persist_pipe(i);
+ }
+ }
+}
+
+/*
+ * 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') recurse=%d\n",
+ iindex, command, recurse));
+ /*
+ * Open if it's not already open
+ */
+ if (persist_pipes[iindex].pid == NETSNMP_NO_SUCH_PROCESS) {
+ int fdIn, fdOut;
+ netsnmp_pid_t pid;
+
+ /*
+ * Did we fail?
+ */
+ if ((0 == get_exec_pipes(command, &fdIn, &fdOut, &pid)) ||
+ (pid == NETSNMP_NO_SUCH_PROCESS)) {
+ 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);
+ DEBUGMSGTL(("ucd-snmp/pass_persist", "open_persist_pipe: opened the pipes\n"));
+ }
+
+ /*
+ * 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) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist", "open_persist_pipe: recursing to reopen\n"));
+ 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: Got %s instead of PONG!\n", buf));
+ close_persist_pipe(iindex);
+ recurse = 0;
+ return 0;
+ }
+ }
+
+ recurse = 0;
+ return 1;
+}
+
+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 == NETSNMP_NO_SUCH_PROCESS) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "write_persist_pipe: not writing %s, process is non-existent",
+ data));
+ return 0;
+ }
+
+ /*
+ * Setup our signal action to ignore SIGPIPEs
+ */
+ sa.sa_handler = SIG_IGN;
+ 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 != EPIPE) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "write_persist_pipe: write returned unknown error %d (%s)\n",
+ werrno, strerror(werrno)));
+ }
+ 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) {
+#ifndef WIN32
+ /*
+ * The sequence open()/fdopen()/fclose()/close() triggers an access
+ * violation with the MSVC runtime. Hence skip the close() call when
+ * using the MSVC runtime.
+ */
+ close(persist_pipes[iindex].fdOut);
+#endif
+ 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) {
+#ifndef WIN32
+ /*
+ * The sequence open()/fdopen()/fclose()/close() triggers an access
+ * violation with the MSVC runtime. Hence skip the close() call when
+ * using the MSVC runtime.
+ */
+ close(persist_pipes[iindex].fdIn);
+#endif
+ persist_pipes[iindex].fdIn = -1;
+ }
+
+#ifdef __uClinux__
+ /*remove the pipes*/
+ unlink(fifo_in_path);
+ unlink(fifo_out_path);
+#endif
+
+ if (persist_pipes[iindex].pid != NETSNMP_NO_SUCH_PROCESS) {
+#if HAVE_SYS_WAIT_H
+ waitpid(persist_pipes[iindex].pid, NULL, 0);
+#endif
+#if defined(WIN32) && !defined (mingw32) && !defined (HAVE_SIGNAL)
+ if (!CloseHandle(persist_pipes[iindex].pid)) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist","close_persist_pipe pid: close error\n"));
+ }
+#endif
+ persist_pipes[iindex].pid = NETSNMP_NO_SUCH_PROCESS;
+ }
+
+}
diff --git a/agent/mibgroup/ucd-snmp/pass_persist.h b/agent/mibgroup/ucd-snmp/pass_persist.h
new file mode 100644
index 0000000..0537abc
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/pass_persist.h
@@ -0,0 +1,25 @@
+/*
+ * pass: pass through extensiblity
+ */
+#ifndef _MIBGROUP_PASS_PERSIST_H
+#define _MIBGROUP_PASS_PERSIST_H
+
+config_require(ucd-snmp/pass_common)
+config_require(util_funcs)
+config_require(utilities/execute)
+
+void init_pass_persist(void);
+void shutdown_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/agent/mibgroup/ucd-snmp/proc.c b/agent/mibgroup/ucd-snmp/proc.c
new file mode 100644
index 0000000..e90c2e8
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/proc.c
@@ -0,0 +1,876 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+# 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_KVM_H
+#include <kvm.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_HOST_DATA_ACCESS_SWRUN_MODULE
+#include <net-snmp/data_access/swrun.h>
+#endif
+#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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_proc, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_proc, 1, {ERRORNAME}},
+ {PROCMIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_proc, 1, {PROCMIN}},
+ {PROCMAX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_proc, 1, {PROCMAX}},
+ {PROCCOUNT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_proc, 1, {PROCCOUNT}},
+ {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_proc, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_proc, 1, {ERRORMSG}},
+ {ERRORFIX, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_proc, 1, {ERRORFIX}},
+ {ERRORFIXCMD, ASN_OCTET_STR, NETSNMP_OLDAPI_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 {
+ /* Default to asssume that we require at least one
+ * such process to be running, but no upper limit */
+ (*procp)->max = 0;
+ (*procp)->min = 1;
+ /* This frees "proc <procname> 0 0" to monitor
+ * processes that should _not_ be running. */
+ }
+#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 &&
+ /* Too few processes running */
+ ((proc->min && long_ret < proc->min) ||
+ /* Too many processes running */
+ (proc->max && long_ret > proc->max) ||
+ /* Processes running that shouldn't be */
+ (proc->min == 0 && proc->max == 0 && long_ret > 0))) {
+ 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) {
+ if ( long_ret > 0 )
+ snprintf(errmsg, sizeof(errmsg),
+ "Too few %s running (# = %d)",
+ proc->name, (int) long_ret);
+ else
+ snprintf(errmsg, sizeof(errmsg),
+ "No %s process running", proc->name);
+ } 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 > 0) {
+ snprintf(errmsg, sizeof(errmsg),
+ "%s process should not be 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 USING_HOST_DATA_ACCESS_SWRUN_MODULE
+netsnmp_feature_require(swrun_count_processes_by_name)
+int
+sh_count_procs(char *procname)
+{
+ return swrun_count_processes_by_name( procname );
+}
+#else
+
+#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 size_t nproc = 0;
+static size_t 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) || defined(aix7)
+#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) {
+ strlcpy(pinfo_name, pinfo.pi_comm, sizeof(pinfo_name));
+ 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]);
+ if(len <= 0) continue;
+ 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);
+ continue;
+ }
+ /* 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
+netsnmp_feature_require(find_field)
+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
+#endif /* !USING_HOST_DATA_ACCESS_SWRUN_MODULE */
diff --git a/agent/mibgroup/ucd-snmp/proc.h b/agent/mibgroup/ucd-snmp/proc.h
new file mode 100644
index 0000000..ff97cec
--- /dev/null
+++ b/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/agent/mibgroup/ucd-snmp/proxy.c b/agent/mibgroup/ucd-snmp/proxy.c
new file mode 100644
index 0000000..017fd5c
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/proxy.c
@@ -0,0 +1,705 @@
+/* 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 @ 2009 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-features.h>
+
+#include <sys/types.h>
+#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"
+
+netsnmp_feature_require(handler_mark_requests_as_delegated)
+netsnmp_feature_require(request_set_error_idx)
+
+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 = netsnmp_parse_args(argn, argv, &session, "C:", proxyOptProc,
+ NETSNMP_PARSE_ARGS_NOLOGGING |
+ NETSNMP_PARSE_ARGS_NOZERO);
+
+ /* 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 = strdup("-c");
+ DEBUGMSGTL(("proxy", "pdu has community string\n"));
+ session->community_len = reqinfo->asp->pdu->community_len;
+ session->community = malloc(session->community_len + 1);
+ sprintf((char *)session->community, "%.*s",
+ (int) session->community_len,
+ (const char *)reqinfo->asp->pdu->community);
+ }
+ }
+#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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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);
+ if (pdu)
+ snmp_free_pdu(pdu);
+ return SNMP_ERR_NOERROR;
+ }
+
+ while (request) {
+ ourname = request->requestvb->name;
+ ourlength = request->requestvb->name_length;
+
+ if (sp->base_len &&
+ reqinfo->mode == MODE_GETNEXT &&
+ (snmp_oid_compare(ourname, ourlength,
+ sp->base, sp->base_len) < 0)) {
+ DEBUGMSGTL(( "proxy", "request is out of registered range\n"));
+ /*
+ * Create GETNEXT request with an OID so the
+ * master returns the first OID in the registered range.
+ */
+ memcpy(ourname, sp->base, sp->base_len * sizeof(oid));
+ ourlength = sp->base_len;
+ if (ourname[ourlength-1] <= 1) {
+ /*
+ * The registered range ends with x.y.z.1
+ * -> ask for the next of x.y.z
+ */
+ ourlength--;
+ } else {
+ /*
+ * The registered range ends with x.y.z.A
+ * -> ask for the next of x.y.z.A-1.MAX_SUBID
+ */
+ ourname[ourlength-1]--;
+ ourname[ourlength] = MAX_SUBID;
+ ourlength++;
+ }
+ } else if (sp->base_len > 0) {
+ if ((ourlength - sp->name_len + sp->base_len) > MAX_OID_LEN) {
+ /*
+ * too large
+ */
+ if (pdu)
+ snmp_free_pdu(pdu);
+ 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",
+ (int)ourlength, (int)sp->base_len, (int)sp->name_len));
+ if (ourlength > 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);
+ if (pdu)
+ snmp_free_pdu(pdu);
+ 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 = %8p\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 (%ld)\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);
+ }
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 %ld\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);
+ }
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ 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) != ", (int)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) != ", (int)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/agent/mibgroup/ucd-snmp/proxy.h b/agent/mibgroup/ucd-snmp/proxy.h
new file mode 100644
index 0000000..b715d43
--- /dev/null
+++ b/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/agent/mibgroup/ucd-snmp/versioninfo.c b/agent/mibgroup/ucd-snmp/versioninfo.c
new file mode 100644
index 0000000..f7a8c63
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/versioninfo.c
@@ -0,0 +1,219 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <sys/types.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_NETINET_IN_H
+#include <netinet/in.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/header_generic.h"
+#include "util_funcs/restart.h"
+#include "util_funcs.h" /* clear_cache */
+
+netsnmp_feature_require(clear_cache)
+
+
+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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_version, 1, {MIBINDEX}},
+ {VERTAG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_version, 1, {VERTAG}},
+ {VERDATE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_version, 1, {VERDATE}},
+ {VERCDATE, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_version, 1, {VERCDATE}},
+ {VERIDENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_version, 1, {VERIDENT}},
+ {VERCONFIG, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_version, 1, {VERCONFIG}},
+ {VERCLEARCACHE, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_version, 1, {VERCLEARCACHE}},
+ {VERUPDATECONFIG, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_version, 1, {VERUPDATECONFIG}},
+ {VERRESTARTAGENT, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_version, 1, {VERRESTARTAGENT}},
+ {VERSAVEPERSISTENT, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
+ var_extensible_version, 1, {VERSAVEPERSISTENT}},
+ {VERDEBUGGING, ASN_INTEGER, NETSNMP_OLDAPI_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:
+ strlcpy(errmsg, netsnmp_get_version(), sizeof(errmsg));
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ case VERDATE:
+ strlcpy(errmsg, "$Date$", sizeof(errmsg));
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ case VERCDATE:
+ curtime = time(NULL);
+ cptr = ctime(&curtime);
+ strlcpy(errmsg, cptr, sizeof(errmsg));
+ *var_len = strlen(errmsg) - 1; /* - 1 to strip trailing newline */
+ return ((u_char *) errmsg);
+ case VERIDENT:
+ strlcpy(errmsg, "$Id$", sizeof(errmsg));
+ *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
+ strlcpy(errmsg, "", sizeof(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)
+{
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("versioninfo", "Wrong type != int\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (action == COMMIT) {
+ snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE));
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/agent/mibgroup/ucd-snmp/versioninfo.h b/agent/mibgroup/ucd-snmp/versioninfo.h
new file mode 100644
index 0000000..007424e
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/versioninfo.h
@@ -0,0 +1,35 @@
+/*
+ * 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/header_generic)
+config_require(util_funcs/restart)
+config_require(util_funcs)
+
+#endif /* _MIBGROUP_VERSIONINFO_H */
diff --git a/agent/mibgroup/ucd-snmp/vmstat.c b/agent/mibgroup/ucd-snmp/vmstat.c
new file mode 100644
index 0000000..d52a5b6
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat.c
@@ -0,0 +1,279 @@
+#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)
+{
+ const 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, CPURAWGUESTNICE);
+}
+
+
+int
+vmstat_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ oid obj;
+ unsigned long 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 & 0xffffffff);
+ break;
+ case CPURAWNICE:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->nice_ticks & 0xffffffff);
+ 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 ) & 0xffffffff);
+ break;
+ case CPURAWIDLE:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->idle_ticks & 0xffffffff);
+ break;
+ case CPURAWWAIT:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->wait_ticks & 0xffffffff);
+ break;
+ case CPURAWKERNEL:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->kern_ticks & 0xffffffff);
+ break;
+ case CPURAWINTR:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->intrpt_ticks & 0xffffffff);
+ break;
+ case CPURAWSOFTIRQ:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->sirq_ticks & 0xffffffff);
+ break;
+ case CPURAWSTEAL:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->steal_ticks & 0xffffffff);
+ break;
+ case CPURAWGUEST:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->guest_ticks & 0xffffffff);
+ break;
+ case CPURAWGUESTNICE:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->guestnice_ticks & 0xffffffff);
+ 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;
+ if ( info->total_ticks - info->history[0].total_hist)
+ value /= (info->total_ticks - info->history[0].total_hist);
+ else
+ value = 0; /* or skip this entry */
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value & 0x7fffffff);
+ }
+ break;
+ case CPUSYSTEM:
+ if ( info->history && info->history[0].total_hist ) {
+ /* or sys2_ticks ??? */
+ value = (info->sys_ticks - info->history[0].sys_hist)*100;
+ if ( info->total_ticks - info->history[0].total_hist)
+ value /= (info->total_ticks - info->history[0].total_hist);
+ else
+ value = 0; /* or skip this entry */
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value & 0x7fffffff);
+ }
+ break;
+ case CPUIDLE:
+ if ( info->history && info->history[0].total_hist ) {
+ value = (info->idle_ticks - info->history[0].idle_hist)*100;
+ if ( info->total_ticks - info->history[0].total_hist)
+ value /= (info->total_ticks - info->history[0].total_hist);
+ else
+ value = 0; /* or skip this entry */
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value & 0x7fffffff);
+ }
+ 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 & 0xffffffff);
+ break;
+ case SYSRAWCONTEXT:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->nCtxSwitches & 0xffffffff);
+ 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 & 0x7fffffff);
+ }
+ 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 & 0x7fffffff);
+ }
+ break;
+
+ /*
+ * Similarly for the Swap statistics...
+ */
+ case RAWSWAPIN:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->swapIn & 0xffffffff);
+ break;
+ case RAWSWAPOUT:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->swapOut & 0xffffffff);
+ 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 & 0x7fffffff);
+ }
+ 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 & 0x7fffffff);
+ }
+ break;
+
+ /*
+ * ... and the I/O statistics.
+ */
+ case IORAWSENT:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->pageOut & 0xffffffff);
+ break;
+ case IORAWRECEIVE:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->pageIn & 0xffffffff);
+ 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 & 0x7fffffff);
+ }
+ 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 & 0x7fffffff);
+ }
+ 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/agent/mibgroup/ucd-snmp/vmstat.h b/agent/mibgroup/ucd-snmp/vmstat.h
new file mode 100644
index 0000000..eedb5b4
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat.h
@@ -0,0 +1,43 @@
+/*
+ * 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
+#define CPURAWSTEAL 64
+#define CPURAWGUEST 65
+#define CPURAWGUESTNICE 66
+
+#endif /* _MIBGROUP_VMSTAT_H */
diff --git a/agent/mibgroup/ucd-snmp/vmstat_aix4.c b/agent/mibgroup/ucd-snmp/vmstat_aix4.c
new file mode 100644
index 0000000..62d7ce6
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_aix4.c
@@ -0,0 +1,664 @@
+/*
+ * 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
+ */
+#ifdef HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWUSER}},
+ {CPURAWSYSTEM, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWIDLE}},
+ {CPURAWWAIT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWWAIT}},
+ {CPURAWKERNEL, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWKERNEL}},
+ {IORAWSENT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWRECEIVE}},
+ {SYSRAWINTERRUPTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSRAWINTERRUPTS}},
+ {SYSRAWCONTEXT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSRAWCONTEXT}},
+ /*
+ * Future use:
+ * {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ * var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/vmstat_aix4.h b/agent/mibgroup/ucd-snmp/vmstat_aix4.h
new file mode 100644
index 0000000..a13fcce
--- /dev/null
+++ b/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/header_generic)
+
+ /*
+ * 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/agent/mibgroup/ucd-snmp/vmstat_bsdi4.c b/agent/mibgroup/ucd-snmp/vmstat_bsdi4.c
new file mode 100644
index 0000000..e35b6cd
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_bsdi4.c
@@ -0,0 +1,288 @@
+/*
+ * 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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWIDLE}},
+ {CPURAWKERNEL, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWKERNEL}},
+ {CPURAWINTR, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWINTR}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ * var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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 };
+ size_t mem_size = sizeof(struct vmmeter);
+ int cpu_mib[] = { CTL_KERN, KERN_CPUSTATS };
+ size_t 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/agent/mibgroup/ucd-snmp/vmstat_bsdi4.h b/agent/mibgroup/ucd-snmp/vmstat_bsdi4.h
new file mode 100644
index 0000000..74bf31b
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_bsdi4.h
@@ -0,0 +1,14 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_BSDI4_H
+#define _MIBGROUP_VMSTAT_BSDI4_H
+
+config_require(util_funcs/header_generic)
+
+#include "mibdefs.h"
+
+void init_vmstat_bsdi4(void);
+
+#endif /* _MIBGROUP_VMSTAT_BSDI4_H */
diff --git a/agent/mibgroup/ucd-snmp/vmstat_darwin7.c b/agent/mibgroup/ucd-snmp/vmstat_darwin7.c
new file mode 100644
index 0000000..d96c55c
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_darwin7.c
@@ -0,0 +1,324 @@
+/*
+ * 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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWIDLE}},
+ {CPURAWKERNEL, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWKERNEL}},
+ {CPURAWINTR, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWINTR}},
+ {SYSRAWINTERRUPTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSRAWINTERRUPTS}},
+ {SYSRAWCONTEXT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSRAWCONTEXT}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ * var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/vmstat_darwin7.h b/agent/mibgroup/ucd-snmp/vmstat_darwin7.h
new file mode 100644
index 0000000..b1a301d
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_darwin7.h
@@ -0,0 +1,14 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_DARWIN7_H
+#define _MIBGROUP_VMSTAT_DARWIN7_H
+
+config_require(util_funcs/header_generic)
+
+#include "mibdefs.h"
+
+void init_vmstat_darwin7(void);
+
+#endif /* _MIBGROUP_VMSTAT_DARWIN7_H */
diff --git a/agent/mibgroup/ucd-snmp/vmstat_dynix.c b/agent/mibgroup/ucd-snmp/vmstat_dynix.c
new file mode 100644
index 0000000..33f5412
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_dynix.c
@@ -0,0 +1,797 @@
+/*
+ * 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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWUSER}},
+ {CPURAWSYSTEM, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWIDLE}},
+ {CPURAWWAIT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWWAIT}},
+ {CPURAWKERNEL, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWKERNEL}},
+ {IORAWSENT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWRECEIVE}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ * var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/vmstat_dynix.h b/agent/mibgroup/ucd-snmp/vmstat_dynix.h
new file mode 100644
index 0000000..8954e35
--- /dev/null
+++ b/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/header_generic)
+
+ /*
+ * 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/agent/mibgroup/ucd-snmp/vmstat_freebsd2.c b/agent/mibgroup/ucd-snmp/vmstat_freebsd2.c
new file mode 100644
index 0000000..3de89b2
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_freebsd2.c
@@ -0,0 +1,400 @@
+/*
+ * 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>
+#if defined(dragonfly)
+#include <sys/user.h>
+#else
+#include <sys/proc.h>
+#endif
+#if defined(freebsd5) && __FreeBSD_version >= 500101
+#include <sys/resource.h>
+#elif defined(dragonfly)
+#include <kinfo.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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWIDLE}},
+ {CPURAWKERNEL, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWKERNEL}},
+ {CPURAWINTR, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWINTR}},
+ {SYSRAWINTERRUPTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSRAWINTERRUPTS}},
+ {SYSRAWCONTEXT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSRAWCONTEXT}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ * var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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(dragonfly)
+ static struct kinfo_cputime cpu_old, cpu_new, cpu_diff;
+ static uint64_t cpu_total;
+ uint64_t cpu_sum;
+ static int pagesize;
+#else
+ static long cpu_old[CPUSTATES];
+ static long cpu_new[CPUSTATES];
+ static long cpu_diff[CPUSTATES];
+ static long cpu_total;
+ long cpu_sum;
+#endif
+ double cpu_prc;
+
+ static struct vmmeter mem_old, mem_new;
+
+ static long long_ret;
+ static char errmsg[300];
+
+#if defined(dragonfly)
+ if (pagesize == 0)
+ pagesize = getpagesize() >> 10;
+#endif
+
+ 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
+ */
+
+ cpu_total = 0;
+
+#if defined(dragonfly)
+ kinfo_get_sched_cputime(&cpu_new);
+#define CP_UPDATE(field) cpu_diff.field = cpu_new.field - cpu_old.field; cpu_total += cpu_diff.field;
+ CP_UPDATE(cp_user);
+ CP_UPDATE(cp_nice);
+ CP_UPDATE(cp_sys);
+ CP_UPDATE(cp_intr);
+ CP_UPDATE(cp_idle);
+ cpu_old = cpu_new;
+#undef CP_UPDATE
+#else
+ auto_nlist(CPTIME_SYMBOL, (char *) cpu_new, sizeof(cpu_new));
+
+ 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];
+ }
+#endif
+
+ 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
+ */
+#if defined(dragonfly)
+#define ptok(p) ((p) * pagesize)
+#else
+#define ptok(p) ((p) * (mem_new.v_page_size >> 10))
+#endif
+
+ 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:
+#if defined(dragonfly)
+ cpu_sum = cpu_diff.cp_user + cpu_diff.cp_nice;
+#else
+ cpu_sum = cpu_diff[CP_USER] + cpu_diff[CP_NICE];
+#endif
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUSYSTEM:
+#if defined(dragonfly)
+ cpu_sum = cpu_diff.cp_sys + cpu_diff.cp_intr;
+#else
+ cpu_sum = cpu_diff[CP_SYS] + cpu_diff[CP_INTR];
+#endif
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUIDLE:
+#if defined(dragonfly)
+ cpu_sum = cpu_diff.cp_idle;
+#else
+ cpu_sum = cpu_diff[CP_IDLE];
+#endif
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPURAWUSER:
+#if defined(dragonfly)
+ long_ret = cpu_new.cp_user;
+#else
+ long_ret = cpu_new[CP_USER];
+#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWNICE:
+#if defined(dragonfly)
+ long_ret = cpu_new.cp_nice;
+#else
+ long_ret = cpu_new[CP_NICE];
+#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWSYSTEM:
+#if defined(dragonfly)
+ long_ret = cpu_new.cp_sys + cpu_new.cp_nice;
+#else
+ long_ret = cpu_new[CP_SYS] + cpu_new[CP_INTR];
+#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+#if defined(dragonfly)
+ long_ret = cpu_new.cp_idle;
+#else
+ long_ret = cpu_new[CP_IDLE];
+#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+#if defined(dragonfly)
+ long_ret = cpu_new.cp_sys;
+#else
+ long_ret = cpu_new[CP_SYS];
+#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWINTR:
+#if defined(dragonfly)
+ long_ret = cpu_new.cp_intr;
+#else
+ long_ret = cpu_new[CP_INTR];
+#endif
+ 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/agent/mibgroup/ucd-snmp/vmstat_freebsd2.h b/agent/mibgroup/ucd-snmp/vmstat_freebsd2.h
new file mode 100644
index 0000000..26b44b6
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_freebsd2.h
@@ -0,0 +1,14 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_FREEBSD2_H
+#define _MIBGROUP_VMSTAT_FREEBSD2_H
+
+config_require(util_funcs/header_generic)
+
+#include "mibdefs.h"
+
+void init_vmstat_freebsd2(void);
+
+#endif /* _MIBGROUP_VMSTAT_FREEBSD2_H */
diff --git a/agent/mibgroup/ucd-snmp/vmstat_hpux.c b/agent/mibgroup/ucd-snmp/vmstat_hpux.c
new file mode 100644
index 0000000..a784502
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_hpux.c
@@ -0,0 +1,721 @@
+/*
+ * 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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWIDLE}},
+ {CPURAWWAIT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWWAIT}},
+ {CPURAWKERNEL, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWKERNEL}},
+ {IORAWSENT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWRECEIVE}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ * var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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/agent/mibgroup/ucd-snmp/vmstat_hpux.h b/agent/mibgroup/ucd-snmp/vmstat_hpux.h
new file mode 100644
index 0000000..8f26594
--- /dev/null
+++ b/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/header_generic)
+
+ /*
+ * 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/agent/mibgroup/ucd-snmp/vmstat_linux.c b/agent/mibgroup/ucd-snmp/vmstat_linux.c
new file mode 100644
index 0000000..d6eff50
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_linux.c
@@ -0,0 +1,582 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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/header_generic.h"
+#include "vmstat.h"
+
+netsnmp_feature_require(hardware_cpu_load)
+
+
+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 MAX_INT32 0x7fffffff
+#define MAX_COUNTER 0xffffffff
+
+#define STAT_FILE "/proc/stat"
+#define VMSTAT_FILE "/proc/vmstat"
+
+
+void
+init_vmstat(void)
+{
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPOUT}},
+ {RAWSWAPIN, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {RAWSWAPIN}},
+ {RAWSWAPOUT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {RAWSWAPOUT}},
+ {IOSENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORECEIVE}},
+ {IORAWSENT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWRECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSYSTEM}},
+ {CPURAWKERNEL, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWKERNEL}},
+ {CPURAWIDLE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWIDLE}},
+ {SYSRAWINTERRUPTS, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSRAWINTERRUPTS}},
+ {SYSRAWCONTEXT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSRAWCONTEXT}},
+ {CPURAWWAIT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWWAIT}},
+ {CPURAWINTR, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWINTR}},
+ {CPURAWSOFTIRQ, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSOFTIRQ}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ * var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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);
+ if (vmstatfd == -1) {
+ snmp_log(LOG_ERR, "cannot open %s\n", VMSTAT_FILE);
+ has_vmstat = 0;
+ } else {
+ 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);
+ }
+ }
+ 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) & MAX_INT32;
+ return ((u_char *) (&long_ret));
+ case SWAPOUT:
+ long_ret = vmstat(swapout) & MAX_INT32;
+ return ((u_char *) (&long_ret));
+ case RAWSWAPIN:
+ long_ret = vmstat(rawswapin) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case RAWSWAPOUT:
+ long_ret = vmstat(rawswapout) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case IOSENT:
+ long_ret = vmstat(iosent) & MAX_INT32;
+ return ((u_char *) (&long_ret));
+ case IORECEIVE:
+ long_ret = vmstat(ioreceive) & MAX_INT32;
+ return ((u_char *) (&long_ret));
+ case IORAWSENT:
+ long_ret = vmstat(rawiosent) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case IORAWRECEIVE:
+ long_ret = vmstat(rawioreceive) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case SYSINTERRUPTS:
+ long_ret = vmstat(sysinterrupts) & MAX_INT32;
+ return ((u_char *) (&long_ret));
+ case SYSCONTEXT:
+ long_ret = vmstat(syscontext) & MAX_INT32;
+ return ((u_char *) (&long_ret));
+ case CPUUSER:
+ long_ret = vmstat(cpuuser) & MAX_INT32;
+ return ((u_char *) (&long_ret));
+ case CPUSYSTEM:
+ long_ret = vmstat(cpusystem) & MAX_INT32;
+ return ((u_char *) (&long_ret));
+ case CPUIDLE:
+ long_ret = vmstat(cpuidle) & MAX_INT32;
+ return ((u_char *) (&long_ret));
+ case CPURAWUSER:
+ long_ret = vmstat(cpurawuser) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case CPURAWNICE:
+ long_ret = vmstat(cpurawnice) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case CPURAWSYSTEM:
+ long_ret = (vmstat(cpurawsystem)+vmstat(cpurawinter)+vmstat(cpurawsoft)) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+ long_ret = vmstat(cpurawsystem) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+ long_ret = vmstat(cpurawidle) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case SYSRAWINTERRUPTS:
+ long_ret = vmstat(rawinterrupts) & MAX_COUNTER;
+ return (u_char *)&long_ret;
+ case SYSRAWCONTEXT:
+ long_ret = vmstat(rawcontext) & MAX_COUNTER;
+ return (u_char *)&long_ret;
+ case CPURAWWAIT:
+ if (!has_cpu_26) return NULL;
+ long_ret = vmstat(cpurawwait) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case CPURAWINTR:
+ if (!has_cpu_26) return NULL;
+ long_ret = vmstat(cpurawinter) & MAX_COUNTER;
+ return ((u_char *) (&long_ret));
+ case CPURAWSOFTIRQ:
+ if (!has_cpu_26) return NULL;
+ long_ret = vmstat(cpurawsoft) & MAX_COUNTER;
+ 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/agent/mibgroup/ucd-snmp/vmstat_linux.h b/agent/mibgroup/ucd-snmp/vmstat_linux.h
new file mode 100644
index 0000000..6f7c50f
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_linux.h
@@ -0,0 +1,41 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_H
+#define _MIBGROUP_VMSTAT_H
+
+config_require(util_funcs/header_generic)
+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/agent/mibgroup/ucd-snmp/vmstat_netbsd1.c b/agent/mibgroup/ucd-snmp/vmstat_netbsd1.c
new file mode 100644
index 0000000..9706c42
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_netbsd1.c
@@ -0,0 +1,322 @@
+/*
+ * 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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWIDLE}},
+ {CPURAWKERNEL, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWKERNEL}},
+ {CPURAWINTR, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWINTR}},
+
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ * var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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 };
+ size_t 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 };
+ size_t 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 };
+ size_t 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/agent/mibgroup/ucd-snmp/vmstat_netbsd1.h b/agent/mibgroup/ucd-snmp/vmstat_netbsd1.h
new file mode 100644
index 0000000..adf5d46
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_netbsd1.h
@@ -0,0 +1,14 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_NETBSD1_H
+#define _MIBGROUP_VMSTAT_NETBSD1_H
+
+config_require(util_funcs/header_generic)
+
+#include "mibdefs.h"
+
+void init_vmstat_netbsd1(void);
+
+#endif /* _MIBGROUP_VMSTAT_NETBSD1_H */
diff --git a/agent/mibgroup/ucd-snmp/vmstat_solaris2.c b/agent/mibgroup/ucd-snmp/vmstat_solaris2.c
new file mode 100644
index 0000000..3715045
--- /dev/null
+++ b/agent/mibgroup/ucd-snmp/vmstat_solaris2.c
@@ -0,0 +1,782 @@
+/*
+ * 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/header_generic.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, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWUSER}},
+ {CPURAWSYSTEM, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWIDLE}},
+ {CPURAWWAIT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWWAIT}},
+ {CPURAWKERNEL, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {CPURAWKERNEL}},
+ {IORAWSENT, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, NETSNMP_OLDAPI_RONLY,
+ var_extensible_vmstat, 1, {IORAWRECEIVE}},
+ /*
+ * Future use:
+ * {ERRORFLAG, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
+ * var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, NETSNMP_OLDAPI_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;
+ if ( time_diff == 0 ) { time_diff = 1; } /* Protect against division-by-zero */
+
+ 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/agent/mibgroup/ucd-snmp/vmstat_solaris2.h b/agent/mibgroup/ucd-snmp/vmstat_solaris2.h
new file mode 100644
index 0000000..77fbb3b
--- /dev/null
+++ b/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/header_generic)
+
+ /*
+ * 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/agent/mibgroup/ucd_snmp.h b/agent/mibgroup/ucd_snmp.h
new file mode 100644
index 0000000..0d87ec1
--- /dev/null
+++ b/agent/mibgroup/ucd_snmp.h
@@ -0,0 +1,19 @@
+/* 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_version_require((ucd-snmp/disk, 5.7, ucd-snmp/disk_hw))
+config_require(ucd-snmp/loadave)
+config_require(agent/extend)
+config_require(ucd-snmp/errormib)
+config_require(ucd-snmp/file)
+#if defined(HAVE_DLFCN_H) && defined(HAVE_DLOPEN)
+config_require(ucd-snmp/dlmod)
+#endif
+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/agent/mibgroup/udp-mib.h b/agent/mibgroup/udp-mib.h
new file mode 100644
index 0000000..754e506
--- /dev/null
+++ b/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/agent/mibgroup/udp-mib/data_access/udp_endpoint.h b/agent/mibgroup/udp-mib/data_access/udp_endpoint.h
new file mode 100644
index 0000000..ce85be9
--- /dev/null
+++ b/agent/mibgroup/udp-mib/data_access/udp_endpoint.h
@@ -0,0 +1,34 @@
+/*
+ * udp_endpoint data access header
+ *
+ * $Id$
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * 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)
+config_require(util_funcs/get_pid_from_inode)
+#elif defined( solaris2 )
+config_require(udp-mib/data_access/udp_endpoint_solaris2)
+#elif defined(freebsd4) || defined(dragonfly)
+config_require(udp-mib/data_access/udp_endpoint_freebsd4)
+#elif defined(openbsd4)
+config_require(udp-mib/data_access/udp_endpoint_openbsd)
+#elif defined(netbsd1)
+config_require(udp-mib/data_access/udp_endpoint_netbsd)
+#else
+# define NETSNMP_UDP_ENDPOINT_COMMON_ONLY
+#endif
diff --git a/agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c b/agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c
new file mode 100644
index 0000000..63f8549
--- /dev/null
+++ b/agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c
@@ -0,0 +1,158 @@
+/*
+ * UDP-MIB endpoint architecture support
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_child_of(udp_endpoint_common, libnetsnmpmibs)
+
+netsnmp_feature_child_of(udp_endpoint_entry_create, udp_endpoint_common)
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static vars
+ */
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * initialization
+ */
+
+/**---------------------------------------------------------------------*/
+/*
+ * 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*)
+ netsnmp_access_udp_endpoint_entry_free,
+ NULL);
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER))
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * entry functions
+ */
+/**
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_UDP_ENDPOINT_ENTRY_CREATE
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UDP_ENDPOINT_ENTRY_CREATE */
+
+/**
+ */
+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);
+}
diff --git a/agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c b/agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c
new file mode 100644
index 0000000..efb8bb6
--- /dev/null
+++ b/agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c
@@ -0,0 +1,194 @@
+/*
+ * UDP MIB architecture support for FreeBSD/DragonFlyBsd
+ */
+#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 "mibII/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
+
+static int _load(netsnmp_container *container, u_int flags);
+
+/*
+ * 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_entry_delete(netsnmp_udp_endpoint_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_udp_endpoint_container_load(netsnmp_container *container,
+ u_int load_flags )
+{
+ int rc = 0;
+
+ DEBUGMSGTL(("access:udp_endpoint:container",
+ "udp_endpoint_container_arch_load (flags %x)\n", load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_udp_endpoint\n");
+ return -1;
+ }
+
+ rc = _load(container, load_flags);
+
+ return rc;
+}
+
+#define NS_ELEM struct xinpcb
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load(netsnmp_container *container, u_int load_flags)
+{
+ size_t len;
+ int sname[] = { CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_PCBLIST };
+ char *udpcb_buf = NULL;
+#if defined(dragonfly)
+ struct xinpcb *xig = NULL;
+#else
+ struct xinpgen *xig = NULL;
+#endif
+ netsnmp_udp_endpoint_entry *entry;
+ int rc = 0;
+
+ /*
+ * Read in the buffer containing the TCP 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)
+ */
+#if defined(dragonfly)
+ xig = (struct xinpcb *) udpcb_buf;
+#else
+ xig = (struct xinpgen *) udpcb_buf;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+
+#if defined(dragonfly)
+ while (xig && (xig->xi_len >= sizeof(struct xinpcb)))
+#else
+ while (xig && (xig->xig_len > sizeof(struct xinpgen)))
+#endif
+ {
+ NS_ELEM pcb = *((NS_ELEM *) xig);
+#if defined(dragonfly)
+ xig = (struct xinpcb *) ((char *) xig + xig->xi_len);
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+
+#if !defined(NETSNMP_ENABLE_IPV6)
+ if (pcb.xi_inp.inp_vflag & INP_IPV6)
+ continue;
+#endif
+
+ entry = netsnmp_access_udp_endpoint_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ /** oddly enough, these appear to already be in network order */
+ entry->loc_port = htons(pcb.xi_inp.inp_lport);
+ entry->rmt_port = htons(pcb.xi_inp.inp_fport);
+ entry->pid = 0;
+
+ /** the addr string may need work */
+ if (pcb.xi_inp.inp_vflag & INP_IPV6) {
+ entry->loc_addr_len = entry->rmt_addr_len = 16;
+ memcpy(entry->loc_addr, &pcb.xi_inp.in6p_laddr, 16);
+ memcpy(entry->rmt_addr, &pcb.xi_inp.in6p_faddr, 16);
+ }
+ else {
+ entry->loc_addr_len = entry->rmt_addr_len = 4;
+ memcpy(entry->loc_addr, &pcb.xi_inp.inp_laddr, 4);
+ memcpy(entry->rmt_addr, &pcb.xi_inp.inp_faddr, 4);
+ }
+
+ /*
+ * add entry to container
+ */
+ entry->index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, entry);
+ }
+
+ if(rc<0)
+ return rc;
+
+ return 0;
+}
diff --git a/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c b/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c
new file mode 100644
index 0000000..6edbdc1
--- /dev/null
+++ b/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c
@@ -0,0 +1,313 @@
+/*
+ * udpEndpointTable MIB architecture support
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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 "mibgroup/util_funcs/get_pid_from_inode.h"
+#include "udp_endpoint_private.h"
+
+#include <fcntl.h>
+
+netsnmp_feature_require(text_utils)
+netsnmp_feature_child_of(udp_endpoint_all, libnetsnmpmibs)
+netsnmp_feature_child_of(udp_endpoint_writable, udp_endpoint_all)
+
+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
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_UDP_ENDPOINT_WRITABLE
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UDP_ENDPOINT_WRITABLE */
+
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+int
+netsnmp_arch_udp_endpoint_container_load(netsnmp_container *container,
+ u_int load_flags )
+{
+ int rc = 0;
+
+ /* Setup the pid_from_inode table, and fill it.*/
+ netsnmp_get_pid_from_inode_init();
+
+ 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",
+ (int)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",
+ (int)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",
+ (int)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",
+ (int)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;
+
+ /*
+ * get the pid also
+ */
+ ep->pid = netsnmp_get_pid_from_inode(inode);
+
+ ep->index = (uintptr_t)(lpi->user_context);
+ lpi->user_context = (void*)((char*)(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);
+ netsnmp_file_release(fp);
+ 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);
+ netsnmp_file_release(fp);
+ return (NULL == container);
+}
+#endif /* NETSNMP_ENABLE_IPV6 */
diff --git a/agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c b/agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c
new file mode 100644
index 0000000..f68314b
--- /dev/null
+++ b/agent/mibgroup/udp-mib/data_access/udp_endpoint_netbsd.c
@@ -0,0 +1,207 @@
+/*
+ * udp_endpointTable MIB architecture support for NetBSD
+ *
+ * $Id: udp_endpoint_linux.c 18994 2010-06-16 13:13:25Z 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/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 "mibII/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
+
+static int _load(netsnmp_container *container, u_int flags, int var);
+
+/*
+ * 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_entry_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;
+
+ DEBUGMSGTL(("access:udp_endpoint:container",
+ "udp_endpoint_container_arch_load (flags %x)\n", load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_udp_endpoint\n");
+ return -1;
+ }
+
+ rc = _load(container, load_flags, 4);
+#if defined(NETSNMP_ENABLE_IPV6)
+ rc = _load(container, load_flags, 6);
+#endif
+
+ return rc;
+}
+
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load(netsnmp_container *container, u_int load_flags, int ver)
+{
+ const char *mibname;
+ int mib[8];
+ size_t mib_len;
+ struct kinfo_pcb *pcblist;
+ size_t pcb_len;
+ netsnmp_udp_endpoint_entry *entry;
+ int i, rc = 0;
+
+ /*
+ * Read in the buffer containing the TCP table data
+ */
+ switch (ver) {
+ case 4:
+ mibname = "net.inet.udp.pcblist";
+ break;
+ case 6:
+ mibname = "net.inet6.udp6.pcblist";
+ break;
+ default:
+ snmp_log(LOG_ERR, "udp-mib:data_access:_load: bad version %d\n", ver);
+ return -1;
+ }
+
+ if (sysctlnametomib(mibname, mib, &mib_len) == -1) {
+ snmp_log(LOG_ERR, "udp-mib:data_access:_load: cant resolve mib %s\n", mibname);
+ return -1;
+ }
+
+ if (sysctl(mib, sizeof(mib) / sizeof(*mib), NULL, &pcb_len, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "udp-mib:data_access:_load: cant size mib %s\n", mibname);
+ return -1;
+ }
+
+ if ((pcblist = malloc(pcb_len)) == NULL) {
+ snmp_log(LOG_ERR, "udp-mib:data_access:_load: cant allocate mib %s\n", mibname);
+ return -1;
+ }
+ memset(pcblist, 0, pcb_len);
+
+ mib[6] = sizeof(*pcblist);
+ mib[7] = pcb_len / sizeof(*pcblist);
+
+ if (sysctl(mib, sizeof(mib) / sizeof(*mib),
+ pcblist, &pcb_len, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "udp-mib:data_access:_load: cant size mib %s\n", mibname);
+ return -1;
+ }
+
+ /*
+ * Unpick this into the constituent structures, and extract
+ * the 'inpcb' elements into a linked list (built in reverse)
+ */
+ for (i = 0; i < pcb_len / sizeof(*pcblist); i++) {
+ struct kinfo_pcb *pcb = pcblist+i;
+
+ entry = netsnmp_access_udp_endpoint_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ entry->pid = 0;
+
+ if (ver == 6) {
+ struct sockaddr_in6 src, dst;
+ memcpy(&src, &pcb->ki_s, sizeof(src));
+ memcpy(&dst, &pcb->ki_d, sizeof(dst));
+ entry->loc_addr_len = entry->rmt_addr_len = 16;
+ memcpy(entry->loc_addr, &src.sin6_addr, 16);
+ memcpy(entry->rmt_addr, &dst.sin6_addr, 16);
+ entry->loc_port = ntohs(src.sin6_port);
+ entry->rmt_port = ntohs(dst.sin6_port);
+ }
+ else {
+ struct sockaddr_in src, dst;
+ memcpy(&src, &pcb->ki_s, sizeof(src));
+ memcpy(&dst, &pcb->ki_d, sizeof(dst));
+ entry->loc_addr_len = entry->rmt_addr_len = 4;
+ memcpy(entry->loc_addr, &src.sin_addr, 4);
+ memcpy(entry->rmt_addr, &dst.sin_addr, 4);
+ entry->loc_port = ntohs(src.sin_port);
+ entry->rmt_port = ntohs(dst.sin_port);
+ }
+
+ /*
+ * add entry to container
+ */
+ entry->index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, entry);
+ }
+
+ if(rc<0)
+ return rc;
+
+ return 0;
+}
diff --git a/agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c b/agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c
new file mode 100644
index 0000000..99b67dc
--- /dev/null
+++ b/agent/mibgroup/udp-mib/data_access/udp_endpoint_openbsd.c
@@ -0,0 +1,177 @@
+/*
+ * udp_endpointTable MIB architecture support for OpenBSD
+ */
+#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 <net-snmp/agent/auto_nlist.h>
+
+#include "udp-mib/udpEndpointTable/udpEndpointTable_constants.h"
+#include "udp-mib/data_access/udp_endpoint_private.h"
+
+#include "mibII/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
+
+static int _load(netsnmp_container *container, u_int flags);
+
+/*
+ * 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_entry_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;
+
+ DEBUGMSGTL(("access:udp_endpoint:container",
+ "udp_endpoint_container_arch_load (flags %x)\n", load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_udp_endpoint\n");
+ return -1;
+ }
+
+ rc = _load(container, load_flags);
+
+ return rc;
+}
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load(netsnmp_container *container, u_int load_flags)
+{
+ struct inpcbtable table;
+ struct inpcb *head, *next, *prev;
+ struct inpcb inpcb;
+ netsnmp_udp_endpoint_entry *entry;
+ int rc = 0;
+
+ /*
+ * Read in the buffer containing the TCP table data
+ */
+ if (!auto_nlist(UDB_SYMBOL, (char *) &table, sizeof(table))) {
+ DEBUGMSGTL(("udp-mib/udp_endpoint_openbsd", "Failed to read udp_symbol\n"));
+ return -1;
+ }
+
+ prev = (struct inpcb *)&CIRCLEQ_FIRST(&table.inpt_queue);
+ prev = NULL;
+ head = next = CIRCLEQ_FIRST(&table.inpt_queue);
+
+ while (next) {
+ NETSNMP_KLOOKUP(next, (char *)&inpcb, sizeof(inpcb));
+ if (prev && CIRCLEQ_PREV(&inpcb, inp_queue) != prev) {
+ snmp_log(LOG_ERR,"udbtable link error\n");
+ break;
+ }
+ prev = next;
+ next = CIRCLEQ_NEXT(&inpcb, inp_queue);
+
+#if !defined(NETSNMP_ENABLE_IPV6)
+ if (inpcb.inp_flags & INP_IPV6)
+ goto skip;
+#endif
+ entry = netsnmp_access_udp_endpoint_entry_create();
+ if (NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ /** oddly enough, these appear to already be in network order */
+ entry->loc_port = ntohs(inpcb.inp_lport);
+ entry->rmt_port = ntohs(inpcb.inp_fport);
+ entry->pid = 0;
+
+ /** the addr string may need work */
+ if (inpcb.inp_flags & INP_IPV6) {
+ entry->loc_addr_len = entry->rmt_addr_len = 16;
+ memcpy(entry->loc_addr, &inpcb.inp_laddr6, 16);
+ memcpy(entry->rmt_addr, &inpcb.inp_faddr6, 16);
+ }
+ else {
+ entry->loc_addr_len = entry->rmt_addr_len = 4;
+ memcpy(entry->loc_addr, &inpcb.inp_laddr, 4);
+ memcpy(entry->rmt_addr, &inpcb.inp_faddr, 4);
+ }
+
+ /*
+ * add entry to container
+ */
+ entry->index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, entry);
+#if !defined(NETSNMP_ENABLE_IPV6)
+ skip:
+#endif
+ if (next == head)
+ break;
+ }
+
+ if (rc < 0)
+ return rc;
+
+ return 0;
+}
diff --git a/agent/mibgroup/udp-mib/data_access/udp_endpoint_private.h b/agent/mibgroup/udp-mib/data_access/udp_endpoint_private.h
new file mode 100644
index 0000000..3ca9b2a
--- /dev/null
+++ b/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/agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c b/agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c
new file mode 100644
index 0000000..f52244a
--- /dev/null
+++ b/agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c
@@ -0,0 +1,205 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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"
+
+netsnmp_feature_require(netsnmp_access_udp_endpoint_entry_create)
+netsnmp_feature_child_of(udp_endpoint_all, libnetsnmpmibs)
+netsnmp_feature_child_of(udp_endpoint_writable, udp_endpoint_all)
+
+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
+
+#ifndef NETSNMP_FEATURE_REMOVE_UDP_ENDPOINT_WRITABLE
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UDP_ENDPOINT_WRITABLE */
+
+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/agent/mibgroup/udp-mib/udpEndpointTable.h b/agent/mibgroup/udp-mib/udpEndpointTable.h
new file mode 100644
index 0000000..95f49fd
--- /dev/null
+++ b/agent/mibgroup/udp-mib/udpEndpointTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(udp-mib/udpEndpointTable/udpEndpointTable)
diff --git a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c
new file mode 100644
index 0000000..145f4ce
--- /dev/null
+++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c
@@ -0,0 +1,426 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+/** \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"
+
+const oid udpEndpointTable_oid[] = { UDPENDPOINTTABLE_OID };
+const int udpEndpointTable_oid_size =
+OID_LENGTH(udpEndpointTable_oid);
+
+udpEndpointTable_registration udpEndpointTable_user_context;
+static udpEndpointTable_registration *udpEndpointTable_user_context_p;
+
+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)
+{
+ 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.
+ */
+ udpEndpointTable_user_context_p =
+ 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
+ (udpEndpointTable_user_context_p, flags);
+} /* initialize_table_udpEndpointTable */
+
+/**
+ * Shutdown the table udpEndpointTable
+ */
+void
+shutdown_table_udpEndpointTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _udpEndpointTable_shutdown_interface(udpEndpointTable_user_context_p);
+ netsnmp_free_all_list_data(udpEndpointTable_user_context_p);
+ udpEndpointTable_user_context_p = NULL;
+}
+
+/**
+ * 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,
+ u_long udpEndpointProcess_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;
+ /*
+ * udpEndpointProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
+ */
+ tbl_idx->udpEndpointProcess = udpEndpointProcess_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,
+ u_long udpEndpointProcess_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,
+ udpEndpointProcess_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->tbl_idx.udpEndpointProcess
+ */
+ (*udpEndpointProcess_val_ptr) = rowreq_ctx->tbl_idx.udpEndpointProcess;
+
+ return MFD_SUCCESS;
+} /* udpEndpointProcess_get */
+
+
+
+/** @} */
+/** @} */
+/** @{ */
diff --git a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
new file mode 100644
index 0000000..0deda03
--- /dev/null
+++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
@@ -0,0 +1,314 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id$
+ */
+#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;
+
+ /*
+ * udpEndpointProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
+ */
+ u_long udpEndpointProcess;
+
+
+ } 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 const oid udpEndpointTable_oid[];
+ extern const 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,
+ u_long
+ udpEndpointProcess_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,
+ u_long udpEndpointProcess_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/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
new file mode 100644
index 0000000..35a4c2d
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
new file mode 100644
index 0000000..0e25c21
--- /dev/null
+++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
@@ -0,0 +1,357 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $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 <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_it) {
+ netsnmp_access_udp_endpoint_container_free(ep_c, 0);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ for (ep = (netsnmp_udp_endpoint_entry*)ITERATOR_FIRST(ep_it); ep;
+ ep = (netsnmp_udp_endpoint_entry*)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,
+ (char *) ep->loc_addr,
+ ep->loc_addr_len,
+ ep->loc_port,
+ udpEndpointRemoteAddressType,
+ (char *) ep->rmt_addr,
+ ep->rmt_addr_len,
+ ep->rmt_port,
+ ep->instance,
+ ep->pid)) {
+ 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, 0);
+
+
+ DEBUGMSGT(("verbose:udpEndpointTable:udpEndpointTable_container_load",
+ "inserted %d records\n", (int)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/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
new file mode 100644
index 0000000..df7ea87
--- /dev/null
+++ b/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$
+ */
+#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/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c
new file mode 100644
index 0000000..60d37e9
--- /dev/null
+++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c
@@ -0,0 +1,1099 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $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-features.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>
+
+netsnmp_feature_child_of(udpEndpointTable_external_access, libnetsnmpmibs)
+
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(check_all_requests_error)
+
+
+netsnmp_feature_child_of(udpEndpointTable_container_size, udpEndpointTable_external_access)
+netsnmp_feature_child_of(udpEndpointTable_registration_set, udpEndpointTable_external_access)
+netsnmp_feature_child_of(udpEndpointTable_registration_get, udpEndpointTable_external_access)
+netsnmp_feature_child_of(udpEndpointTable_container_get, udpEndpointTable_external_access)
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** 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);
+
+#ifndef NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_CONTAINER_GET
+netsnmp_container *
+udpEndpointTable_container_get(void)
+{
+ return udpEndpointTable_if_ctx.container;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_CONTAINER_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_REGISTRATION_GET
+udpEndpointTable_registration *
+udpEndpointTable_registration_get(void)
+{
+ return udpEndpointTable_if_ctx.user_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_REGISTRATION_GET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_REGISTRATION_SET
+udpEndpointTable_registration *
+udpEndpointTable_registration_set(udpEndpointTable_registration * newreg)
+{
+ udpEndpointTable_registration *old = udpEndpointTable_if_ctx.user_ctx;
+ udpEndpointTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_REGISTRATION_SET */
+
+#ifndef NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_CONTAINER_SIZE
+int
+udpEndpointTable_container_size(void)
+{
+ return CONTAINER_SIZE(udpEndpointTable_if_ctx.container);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_CONTAINER_SIZE */
+
+/*
+ * 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 retrieval.
+ */
+ 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->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ /* XXX - are these actually necessary? */
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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 = (udpEndpointTable_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 = (udpEndpointTable_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 = (udpEndpointTable_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_ctx->container->container_name = strdup("udpEndpointTable");
+
+ 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 */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_EXTERNAL_ACCESS
+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 = (udpEndpointTable_rowreq_ctx*)
+ CONTAINER_FIND(udpEndpointTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UDPENDPOINTTABLE_EXTERNAL_ACCESS */
diff --git a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
new file mode 100644
index 0000000..a7016e0
--- /dev/null
+++ b/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$
+ */
+/** @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/agent/mibgroup/util_funcs.c b/agent/mibgroup/util_funcs.c
new file mode 100644
index 0000000..4c34c32
--- /dev/null
+++ b/agent/mibgroup/util_funcs.c
@@ -0,0 +1,1129 @@
+/*
+ * 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>
+#include <net-snmp/net-snmp-features.h>
+
+#include <sys/types.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
+#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
+# 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_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_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 <net-snmp/library/snmp_logging.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
+
+netsnmp_feature_child_of(util_funcs, libnetsnmpmibs)
+
+netsnmp_feature_child_of(shell_command, util_funcs)
+netsnmp_feature_child_of(get_exten_instance, util_funcs)
+netsnmp_feature_child_of(clear_cache, util_funcs)
+netsnmp_feature_child_of(find_field, util_funcs)
+netsnmp_feature_child_of(parse_miboid, util_funcs)
+netsnmp_feature_child_of(string_append_int, util_funcs)
+netsnmp_feature_child_of(internal_mib_table, util_funcs)
+
+#if defined(HAVE_LINUX_RTNETLINK_H)
+netsnmp_feature_child_of(prefix_info_all, util_funcs)
+netsnmp_feature_child_of(prefix_info, prefix_info_all)
+netsnmp_feature_child_of(update_prefix_info, prefix_info_all)
+netsnmp_feature_child_of(delete_prefix_info, prefix_info_all)
+netsnmp_feature_child_of(find_prefix_info, prefix_info_all)
+netsnmp_feature_child_of(create_prefix_info, prefix_info_all)
+#endif /* HAVE_LINUX_RTNETLINK_H */
+
+#ifdef NETSNMP_EXCACHETIME
+static long cachetime;
+#endif
+
+extern int numprocs, numextens;
+
+/** deprecated, use netsnmp_mktemp instead */
+const char *
+make_tempfile(void)
+{
+ return netsnmp_mktemp();
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SHELL_COMMAND
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SHELL_COMMAND */
+
+#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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_GET_EXTEN_INSTANCE
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_GET_EXTEN_INSTANCE */
+
+void
+wait_on_exec(struct extensible *ex)
+{
+#if defined(WIN32) && !defined (mingw32)
+ int rc;
+ if (ex->tid != 0 && ex->pid != 0) {
+ HANDLE hThread = ex->tid;
+ HANDLE hProcess = 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)
+{
+#ifndef USING_UTILITIES_EXECUTE_MODULE
+ ex->result = -1;
+ NETSNMP_LOGONCE((LOG_WARNING, "support for run_exec_command not available\n"));
+#else
+#if HAVE_EXECV
+ char cachefile[STRMAX];
+ char cache[NETSNMP_MAXCACHESIZE];
+ int 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, 0600)) < 0) {
+ snmp_log(LOG_ERR,"can not create cache file\n");
+ setPerrorstatus(cachefile);
+#ifdef NETSNMP_EXCACHETIME
+ cachetime = 0;
+#endif
+ 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: %lu\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: %lu\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: %lu\n", GetLastError()));
+ CloseHandle(hErrorWrite);
+ return -1;
+ }
+
+ /* Close the temporary output and input handles */
+ if (!CloseHandle(hOutputReadTmp)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_output CloseHandle (hOutputReadTmp): %lu\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' %lu\n",ex->command, GetLastError()));
+ CloseHandle(hErrorWrite);
+ CloseHandle(hOutputRead);
+ return -1;
+ }
+
+ /* Set global child process handle */
+ ex->pid = pi.hProcess;
+ ex->tid = 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: %lu\n",
+ GetLastError()));
+ return -1;
+ }
+ if (!CloseHandle(hErrorWrite)) {
+ DEBUGMSGTL(("util_funcs","get_exec_output CloseHandle hErrorWrite: %lu\n",
+ GetLastError()));
+ return -1;
+ }
+ return fd;
+#endif /* WIN32 */
+#endif
+#endif /* !defined(USING_UTILITIES_EXECUTE_MODULE) */
+ return -1;
+}
+int
+get_exec_pipes(char *cmd, int *fdIn, int *fdOut, netsnmp_pid_t *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;
+ }
+
+ DEBUGMSGTL(("util_funcs","child hProcess (stored in pid): %d\n",(int)pi.hProcess));
+ DEBUGMSGTL(("util_funcs","child dwProcessId (task manager): %d\n",(int)pi.dwProcessId));
+
+ /* Set global child process handle */
+ *pid = pi.hProcess;
+
+ /* Cleanup */
+ if (!CloseHandle(pi.hThread))
+ DEBUGMSGTL(("util_funcs","get_exec_pipes CloseHandle pi.hThread: %d\n",cmd));
+
+ /* 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CLEAR_CACHE
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CLEAR_CACHE */
+
+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, const oid *name, size_t len)
+{
+ int i;
+
+ for (i = 0; i < (int) len; i++)
+ buf += sprintf(buf, ".%" NETSNMP_PRIo "u", name[i]);
+}
+
+/*
+ * 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));
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_FIND_FIELD
+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((unsigned char)(*ptr)) && init <= ptr)
+ ptr--;
+ while (*ptr != 0 && !isspace((unsigned char)(*ptr)) && init <= ptr)
+ ptr--;
+ if (isspace((unsigned char)(*ptr)))
+ ptr++; /* past space */
+ if (ptr < init)
+ ptr = init;
+ if (!isspace((unsigned char)(*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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_FIND_FIELD */
+
+#ifndef NETSNMP_FEATURE_REMOVE_PARSE_MIBOID
+int
+parse_miboid(const char *buf, oid * oidout)
+{
+ int i;
+
+ if (!buf)
+ return 0;
+ if (*buf == '.')
+ buf++;
+ for (i = 0; isdigit((unsigned char)(*buf)); i++) {
+ /* Subidentifiers are unsigned values, up to 2^32-1
+ * so we need to use 'strtoul' rather than 'atoi'
+ */
+ oidout[i] = strtoul(buf, NULL, 10) & 0xffffffff;
+ while (isdigit((unsigned char)(*buf++)));
+ if (*buf == '.')
+ buf++;
+ }
+ /*
+ * oidout[i] = -1; hmmm
+ */
+ return i;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_PARSE_MIBOID */
+
+#ifndef NETSNMP_FEATURE_REMOVE_STRING_APPEND_INT
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_STRING_APPEND_INT */
+
+#ifndef NETSNMP_FEATURE_REMOVE_INTERNAL_MIB_TABLE
+
+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_markerM;
+ 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_markerM = 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_markerM &&
+ !(netsnmp_ready_monotonic(table->cache_markerM,
+ 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
+ */
+ netsnmp_set_monotonic_marker(&table->cache_markerM);
+
+ table->next_index = 1;
+ if (table->reload((mib_table_t) table) < 0) {
+ free(table->cache_markerM);
+ table->cache_markerM = 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_INTERNAL_MIB_TABLE */
+
+#if defined(HAVE_LINUX_RTNETLINK_H)
+
+#ifndef NETSNMP_FEATURE_REMOVE_CREATE_PREFIX_INFO
+prefix_cbx *net_snmp_create_prefix_info(unsigned long OnLinkFlag,
+ unsigned long AutonomousFlag,
+ char *in6ptr)
+{
+ prefix_cbx *node = SNMP_MALLOC_TYPEDEF(prefix_cbx);
+ if(!in6ptr) {
+ free(node);
+ return NULL;
+ }
+ if(!node) {
+ free(node);
+ return NULL;
+ }
+ node->next_info = NULL;
+ node->ipAddressPrefixOnLinkFlag = OnLinkFlag;
+ node->ipAddressPrefixAutonomousFlag = AutonomousFlag;
+ memcpy(node->in6p, in6ptr, sizeof(node->in6p));
+
+ return node;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CREATE_PREFIX_INFO */
+
+#ifndef NETSNMP_FEATURE_REMOVE_FIND_PREFIX_INFO
+int net_snmp_find_prefix_info(prefix_cbx **head,
+ char *address,
+ prefix_cbx *node_to_find)
+{
+ int iret;
+ memset(node_to_find, 0, sizeof(prefix_cbx));
+ if(!*head)
+ return -1;
+ memcpy(node_to_find->in6p, address, sizeof(node_to_find->in6p));
+
+ iret = net_snmp_search_update_prefix_info(head, node_to_find, 1);
+ if(iret < 0) {
+ DEBUGMSGTL(("util_funcs:prefix", "Unable to search the list\n"));
+ return -1;
+ } else if (!iret) {
+ DEBUGMSGTL(("util_funcs:prefix", "Could not find prefix info\n"));
+ return -1;
+ } else
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_FIND_PREFIX_INFO */
+
+#ifndef NETSNMP_FEATURE_REMOVE_UPDATE_PREFIX_INFO
+int net_snmp_update_prefix_info(prefix_cbx **head,
+ prefix_cbx *node_to_update)
+{
+ int iret;
+ iret = net_snmp_search_update_prefix_info(head, node_to_update, 0);
+ if(iret < 0) {
+ DEBUGMSGTL(("util_funcs:prefix", "Unable to update prefix info\n"));
+ return -1;
+ } else if (!iret) {
+ DEBUGMSGTL(("util_funcs:prefix", "Unable to find the node to update\n"));
+ return -1;
+ } else
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UPDATE_PREFIX_INFO */
+
+int net_snmp_search_update_prefix_info(prefix_cbx **head,
+ prefix_cbx *node_to_use,
+ int functionality)
+{
+
+ /* We define functionality based on need *
+ * 0 - Need to do a search and update. We have to provide the node_to_use structure filled fully *
+ * 1 - Need to do only search. Provide the node_to_use with in6p value filled */
+
+ prefix_cbx *temp_node;
+ netsnmp_assert(NULL != head);
+ netsnmp_assert(NULL != node_to_use);
+
+ if(functionality > 1)
+ return -1;
+ if(!node_to_use)
+ return -1;
+
+
+ if (!functionality) {
+ if (!*head) {
+ *head = node_to_use;
+ return 1;
+ }
+
+ for (temp_node = *head; temp_node->next_info != NULL ; temp_node = temp_node->next_info) {
+ if (0 == strcmp(temp_node->in6p, node_to_use->in6p)) {
+ temp_node->ipAddressPrefixOnLinkFlag = node_to_use->ipAddressPrefixOnLinkFlag;
+ temp_node->ipAddressPrefixAutonomousFlag = node_to_use->ipAddressPrefixAutonomousFlag;
+ return 2;
+ }
+ }
+ temp_node->next_info = node_to_use;
+ return 1;
+ } else {
+ for (temp_node = *head; temp_node != NULL ; temp_node = temp_node->next_info) {
+ if (0 == strcmp(temp_node->in6p, node_to_use->in6p)) {
+ /*need yo put sem here as i read here */
+ node_to_use->ipAddressPrefixOnLinkFlag = temp_node->ipAddressPrefixOnLinkFlag;
+ node_to_use->ipAddressPrefixAutonomousFlag = temp_node->ipAddressPrefixAutonomousFlag;
+ return 1;
+ }
+ }
+ return 0;
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_DELETE_PREFIX_INFO
+int net_snmp_delete_prefix_info(prefix_cbx **head,
+ char *address)
+{
+
+ prefix_cbx *temp_node,*prev_node;
+ if(!address)
+ return -1;
+ if(!head)
+ return -1;
+
+ for (temp_node = *head, prev_node = NULL; temp_node;
+ prev_node = temp_node, temp_node = temp_node->next_info) {
+
+ if (temp_node->in6p && strcmp(temp_node->in6p, address) == 0) {
+ if (prev_node)
+ prev_node->next_info = temp_node->next_info;
+ else
+ *head = temp_node->next_info;
+ free(temp_node);
+ return 1;
+ }
+
+ }
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DELETE_PREFIX_INFO */
+
+#endif /* HAVE_LINUX_RTNETLINK_H */
+
diff --git a/agent/mibgroup/util_funcs.h b/agent/mibgroup/util_funcs.h
new file mode 100644
index 0000000..7f59780
--- /dev/null
+++ b/agent/mibgroup/util_funcs.h
@@ -0,0 +1,97 @@
+/*
+ * util_funcs.h: utilitiy functions for extensible groups.
+ */
+#ifndef _MIBGROUP_UTIL_FUNCS_H
+#define _MIBGROUP_UTIL_FUNCS_H
+
+config_require(util_funcs/header_generic)
+config_require(util_funcs/header_simple_table)
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include "util_funcs/header_generic.h"
+#include "util_funcs/header_simple_table.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "struct.h"
+
+typedef struct prefix_info
+{
+ struct prefix_info *next_info;
+ unsigned long ipAddressPrefixOnLinkFlag;
+ unsigned long ipAddressPrefixAutonomousFlag;
+ char in6p[40];
+}prefix_cbx;
+#ifndef WIN32
+typedef struct
+{
+ prefix_cbx **list_head;
+}netsnmp_prefix_listen_info;
+#endif
+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 *);
+#if defined(WIN32) && !defined(cygwin)
+int get_exec_pipes(char *cmd, int *fdIn, int *fdOut, HANDLE *pid);
+#else
+int get_exec_pipes(char *cmd, int *fdIn, int *fdOut, pid_t *pid);
+#endif
+WriteMethod clear_cache;
+void print_mib_oid(oid *, size_t);
+void sprint_mib_oid(char *, const oid *, size_t);
+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);
+
+prefix_cbx *net_snmp_create_prefix_info(unsigned long OnLinkFlag,
+ unsigned long AutonomousFlag,
+ char *in6ptr);
+#ifndef WIN32
+int net_snmp_find_prefix_info(prefix_cbx **head,
+ char *address,
+ prefix_cbx *node_to_find);
+int net_snmp_update_prefix_info(prefix_cbx **head,
+ prefix_cbx *node_to_update);
+int net_snmp_search_update_prefix_info(prefix_cbx **head,
+ prefix_cbx *node_to_use,
+ int functionality);
+int net_snmp_delete_prefix_info(prefix_cbx **head,
+ char *address);
+#endif
+#define NIP6(addr) \
+ ntohs((addr).s6_addr16[0]), \
+ ntohs((addr).s6_addr16[1]), \
+ ntohs((addr).s6_addr16[2]), \
+ ntohs((addr).s6_addr16[3]), \
+ ntohs((addr).s6_addr16[4]), \
+ ntohs((addr).s6_addr16[5]), \
+ ntohs((addr).s6_addr16[6]), \
+ ntohs((addr).s6_addr16[7])
+
+#define satosin(x) ((struct sockaddr_in *) &(x))
+#define SOCKADDR(x) (satosin(x)->sin_addr.s_addr)
+
+#include "util_funcs/MIB_STATS_CACHE_TIMEOUT.h"
+
+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/agent/mibgroup/util_funcs/Exit.c b/agent/mibgroup/util_funcs/Exit.c
new file mode 100644
index 0000000..c848fd8
--- /dev/null
+++ b/agent/mibgroup/util_funcs/Exit.c
@@ -0,0 +1,23 @@
+/*
+ * 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_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <net-snmp/library/snmp_logging.h>
+
+#include "Exit.h"
+
+void
+Exit(int var)
+{
+ snmp_log(LOG_ERR, "Server Exiting with code %d\n", var);
+ exit(var);
+}
diff --git a/agent/mibgroup/util_funcs/Exit.h b/agent/mibgroup/util_funcs/Exit.h
new file mode 100644
index 0000000..54f0cd5
--- /dev/null
+++ b/agent/mibgroup/util_funcs/Exit.h
@@ -0,0 +1,17 @@
+/*
+ * Exit.h: verbose terminaion routine
+ */
+#ifndef _MIBGROUP_UTIL_FUNCS_EXIT_H
+#define _MIBGROUP_UTIL_FUNCS_EXIT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void Exit(int);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MIBGROUP_UTIL_FUNCS_EXIT_H */
diff --git a/agent/mibgroup/util_funcs/MIB_STATS_CACHE_TIMEOUT.h b/agent/mibgroup/util_funcs/MIB_STATS_CACHE_TIMEOUT.h
new file mode 100644
index 0000000..848bacd
--- /dev/null
+++ b/agent/mibgroup/util_funcs/MIB_STATS_CACHE_TIMEOUT.h
@@ -0,0 +1,12 @@
+/*
+ * util_funcs/MIB_STATS_CACHE_TIMEOUT.h: utilitiy functions for extensible
+ * groups.
+ */
+#ifndef _MIBGROUP_UTIL_FUNCS_MIB_STATS_CACHE_TIMEOUT_H
+#define _MIBGROUP_UTIL_FUNCS_MIB_STATS_CACHE_TIMEOUT_H
+
+#ifndef MIB_STATS_CACHE_TIMEOUT
+#define MIB_STATS_CACHE_TIMEOUT 5
+#endif
+
+#endif /* _MIBGROUP_UTIL_FUNCS_MIB_STATS_CACHE_TIMEOUT_H */
diff --git a/agent/mibgroup/util_funcs/get_pid_from_inode.c b/agent/mibgroup/util_funcs/get_pid_from_inode.c
new file mode 100644
index 0000000..8e157ae
--- /dev/null
+++ b/agent/mibgroup/util_funcs/get_pid_from_inode.c
@@ -0,0 +1,186 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include "get_pid_from_inode.h"
+
+#include <net-snmp/output_api.h>
+
+#include <ctype.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
+
+# define PROC_PATH "/proc"
+# define SOCKET_TYPE_1 "socket:["
+# define SOCKET_TYPE_2 "[0000]:"
+
+/* Definition of a simple open addressing hash table.*/
+/* When inode == 0 then the entry is empty.*/
+typedef struct {
+ ino64_t inode;
+ pid_t pid;
+} inode_pid_ent_t;
+
+#define INODE_PID_TABLE_MAX_COLLISIONS 1000
+#define INODE_PID_TABLE_LENGTH 20000
+#define INODE_PID_TABLE_SIZE (INODE_PID_TABLE_LENGTH * sizeof (inode_pid_ent_t))
+static inode_pid_ent_t inode_pid_table[INODE_PID_TABLE_LENGTH];
+
+static uint32_t
+_hash(uint64_t key)
+{
+ key = (~key) + (key << 18);
+ key = key ^ (key >> 31);
+ key = key * 21;
+ key = key ^ (key >> 11);
+ key = key + (key << 6);
+ key = key ^ (key >> 22);
+ return key;
+}
+
+static void
+_clear(void)
+{
+ /* Clear the inode/pid hash table.*/
+ memset(inode_pid_table, 0, INODE_PID_TABLE_SIZE);
+}
+
+static void
+_set(ino64_t inode, pid_t pid)
+{
+ uint32_t hash = _hash(inode);
+ uint32_t i;
+ inode_pid_ent_t *entry;
+
+ /* We will try for a maximum number of collisions.*/
+ for (i = 0; i < INODE_PID_TABLE_MAX_COLLISIONS; i++) {
+ entry = &inode_pid_table[(hash + i) % INODE_PID_TABLE_LENGTH];
+
+ /* Check if this entry is empty, or the actual inode we were looking for.*/
+ /* The second part should never happen, but it is here for completeness.*/
+ if (entry->inode == 0 || entry->inode == inode) {
+ entry->inode = inode;
+ entry->pid = pid;
+ return;
+ }
+ }
+
+ /* We will silently fail to insert the inode if we get too many collisions.*/
+ /* the _get function will return a zero pid.*/
+}
+
+static pid_t _get(ino64_t inode)
+{
+ uint32_t hash = _hash(inode);
+ uint32_t i;
+ inode_pid_ent_t *entry;
+
+ /* We will try for a maximum number of collisions.*/
+ for (i = 0; i < INODE_PID_TABLE_MAX_COLLISIONS; i++) {
+ entry = &inode_pid_table[(hash + i) % INODE_PID_TABLE_LENGTH];
+
+ /* Check if this entry is empty, or the actual inode we were looking for.*/
+ /* If the entry is empty it means the inode is not in the table and we*/
+ /* should return 0, the entry will also have a zero pid.*/
+ if (entry->inode == 0 || entry->inode == inode) {
+ return entry->pid;
+ }
+ }
+
+ /* We could not find the pid.*/
+ return 0;
+}
+
+void
+netsnmp_get_pid_from_inode_init(void)
+{
+ DIR *procdirs = NULL, *piddirs = NULL;
+ char path_name[PATH_MAX + 1];
+ char socket_lnk[NAME_MAX + 1];
+ int filelen = 0, readlen = 0;
+ struct dirent *procinfo, *pidinfo;
+ pid_t pid = 0;
+ ino64_t temp_inode;
+
+ _clear();
+
+ /* walk over all directories in /proc*/
+ if (!(procdirs = opendir(PROC_PATH))) {
+ NETSNMP_LOGONCE((LOG_ERR, "snmpd: cannot open /proc\n"));
+ return;
+ }
+
+ while ((procinfo = readdir(procdirs)) != NULL) {
+ const char* name = procinfo->d_name;
+
+ /* A pid directory only contains digits, check for those.*/
+ for (; *name; name++) {
+ if (!isdigit(*name))
+ break;
+ }
+ if(*name)
+ continue;
+
+ /* Create the /proc/<pid>/fd/ path name.*/
+ memset(path_name, '\0', PATH_MAX + 1);
+ filelen = snprintf(path_name, PATH_MAX,
+ PROC_PATH "/%s/fd/", procinfo->d_name);
+ if (filelen <= 0 || PATH_MAX < filelen)
+ continue;
+
+ /* walk over all the files in /proc/<pid>/fd/*/
+ if (!(piddirs = opendir(path_name)))
+ continue;
+
+ while ((pidinfo = readdir(piddirs)) != NULL) {
+ if (filelen + strlen(pidinfo->d_name) > PATH_MAX)
+ continue;
+
+ strcpy(path_name + filelen, pidinfo->d_name);
+
+ /* The file discriptor is a symbolic link to a socket or a file.*/
+ /* Thus read the symbolic link.*/
+ memset(socket_lnk, '\0', NAME_MAX + 1);
+ readlen = readlink(path_name, socket_lnk, NAME_MAX);
+ if (readlen < 0)
+ continue;
+
+ socket_lnk[readlen] = '\0';
+
+ /* Check if to see if the file descriptor is a socket by comparing*/
+ /* the start to a string. Also extract the inode number from this*/
+ /* symbolic link.*/
+ if (!strncmp(socket_lnk, SOCKET_TYPE_1, 8)) {
+ temp_inode = strtoull(socket_lnk + 8, NULL, 0);
+ } else if (!strncmp(socket_lnk, SOCKET_TYPE_2, 7)) {
+ temp_inode = strtoull(socket_lnk + 7, NULL, 0);
+ } else {
+ temp_inode = 0;
+ }
+
+ /* Add the inode/pid combination to our hash table.*/
+ if (temp_inode != 0) {
+ pid = strtoul(procinfo->d_name, NULL, 0);
+ _set(temp_inode, pid);
+ }
+ }
+ closedir(piddirs);
+ }
+ if (procdirs)
+ closedir(procdirs);
+}
+
+pid_t
+netsnmp_get_pid_from_inode(ino64_t inode)
+{
+ return _get(inode);
+}
+
diff --git a/agent/mibgroup/util_funcs/get_pid_from_inode.h b/agent/mibgroup/util_funcs/get_pid_from_inode.h
new file mode 100644
index 0000000..7c58760
--- /dev/null
+++ b/agent/mibgroup/util_funcs/get_pid_from_inode.h
@@ -0,0 +1,34 @@
+/*
+ * util_funcs/get_pid_from_inode.h: utilitiy function to retrieve the pid
+ * that controls a given inode on linux.
+ */
+#ifndef NETSNMP_MIBGROUP_UTIL_FUNCS_GET_PID_FROM_INODE_H
+#define NETSNMP_MIBGROUP_UTIL_FUNCS_HEADER_SIMPLE_TABLE_H
+
+#ifndef linux
+config_error(get_pid_from_inode is only suppored on linux)
+#endif
+
+#define _LARGEFILE64_SOURCE 1
+
+#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
+
+#include <sys/types.h>
+
+void netsnmp_get_pid_from_inode_init(void);
+pid_t netsnmp_get_pid_from_inode(ino64_t);
+
+#endif /* NETSNMP_MIBGROUP_UTIL_FUNCS_HEADER_SIMPLE_TABLE_H */
diff --git a/agent/mibgroup/util_funcs/header_generic.c b/agent/mibgroup/util_funcs/header_generic.c
new file mode 100644
index 0000000..9154be9
--- /dev/null
+++ b/agent/mibgroup/util_funcs/header_generic.c
@@ -0,0 +1,64 @@
+#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_generic.h"
+
+/*
+ * 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 = (WriteMethod*)0;
+ *var_len = sizeof(long); /* default to 'long' results */
+ return (MATCH_SUCCEEDED);
+}
diff --git a/agent/mibgroup/util_funcs/header_generic.h b/agent/mibgroup/util_funcs/header_generic.h
new file mode 100644
index 0000000..9861040
--- /dev/null
+++ b/agent/mibgroup/util_funcs/header_generic.h
@@ -0,0 +1,18 @@
+/*
+ * util_funcs/header_generic.h: utilitiy functions for extensible groups.
+ */
+#ifndef _MIBGROUP_UTIL_FUNCS_HEADER_GENERIC_H
+#define _MIBGROUP_UTIL_FUNCS_HEADER_GENERIC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int header_generic(struct variable *, oid *, size_t *, int, size_t *,
+ WriteMethod **);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MIBGROUP_UTIL_FUNCS_HEADER_GENERIC_H */
diff --git a/agent/mibgroup/util_funcs/header_simple_table.c b/agent/mibgroup/util_funcs/header_simple_table.c
new file mode 100644
index 0000000..81fe160
--- /dev/null
+++ b/agent/mibgroup/util_funcs/header_simple_table.c
@@ -0,0 +1,110 @@
+#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_simple_table.h"
+
+#include <limits.h>
+
+/*******************************************************************-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] < MAX_SUBID) {
+ 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] < MAX_SUBID) {
+ 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 = (WriteMethod*)0;
+ if (var_len)
+ *var_len = sizeof(long); /* default */
+ return (MATCH_SUCCEEDED);
+}
diff --git a/agent/mibgroup/util_funcs/header_simple_table.h b/agent/mibgroup/util_funcs/header_simple_table.h
new file mode 100644
index 0000000..2a95d69
--- /dev/null
+++ b/agent/mibgroup/util_funcs/header_simple_table.h
@@ -0,0 +1,19 @@
+/*
+ * util_funcs/header_simple_table.h: utilitiy functions for extensible
+ * groups.
+ */
+#ifndef _MIBGROUP_UTIL_FUNCS_HEADER_SIMPLE_TABLE_H
+#define _MIBGROUP_UTIL_FUNCS_HEADER_SIMPLE_TABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int header_simple_table(struct variable *, oid *, size_t *, int, size_t *,
+ WriteMethod **, int);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MIBGROUP_UTIL_FUNCS_HEADER_SIMPLE_TABLE_H */
diff --git a/agent/mibgroup/util_funcs/restart.c b/agent/mibgroup/util_funcs/restart.c
new file mode 100644
index 0000000..5cad737
--- /dev/null
+++ b/agent/mibgroup/util_funcs/restart.c
@@ -0,0 +1,93 @@
+/*
+ * 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_UNISTD_H
+#include <unistd.h>
+#endif
+#include <signal.h>
+
+#if HAVE_RAISE
+#define alarm raise
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/library/snmp_logging.h>
+
+#ifdef USING_UCD_SNMP_ERRORMIB_MODULE
+#include "ucd-snmp/errormib.h"
+#else
+#define setPerrorstatus(x) snmp_log_perror(x)
+#endif
+
+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.
+ *
+ * A quote from the sigprocmask() man page:
+ * The use of sigprocmask() is unspecified in a multithreaded process; see
+ * pthread_sigmask(3).
+ */
+#if HAVE_SIGPROCMASK
+ {
+ sigset_t empty_set;
+
+ sigemptyset(&empty_set);
+ sigprocmask(SIG_SETMASK, &empty_set, NULL);
+ }
+#elif 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;
+}
diff --git a/agent/mibgroup/util_funcs/restart.h b/agent/mibgroup/util_funcs/restart.h
new file mode 100644
index 0000000..82760a1
--- /dev/null
+++ b/agent/mibgroup/util_funcs/restart.h
@@ -0,0 +1,15 @@
+#ifndef _MIBGROUP_UTIL_FUNCS_RESTART_H
+#define _MIBGROUP_UTIL_FUNCS_RESTART_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+RETSIGTYPE restart_doit(int);
+WriteMethod restart_hook;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MIBGROUP_UTIL_FUNCS_RESTART_H */
diff --git a/agent/mibgroup/utilities.h b/agent/mibgroup/utilities.h
new file mode 100644
index 0000000..ffb9240
--- /dev/null
+++ b/agent/mibgroup/utilities.h
@@ -0,0 +1,3 @@
+config_require(utilities/override)
+config_require(utilities/execute)
+config_require(utilities/iquery)
diff --git a/agent/mibgroup/utilities/execute.c b/agent/mibgroup/utilities/execute.c
new file mode 100644
index 0000000..68f3654
--- /dev/null
+++ b/agent/mibgroup/utilities/execute.c
@@ -0,0 +1,408 @@
+/*
+ * 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 "execute.h"
+#include "struct.h"
+
+#define setPerrorstatus(x) snmp_log_perror(x)
+
+#ifdef _MSC_VER
+#define popen _popen
+#define pclose _pclose
+#endif
+
+
+int
+run_shell_command( char *command, char *input,
+ char *output, int *out_len) /* Or realloc style ? */
+{
+#if HAVE_SYSTEM
+ 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));
+
+ result = -1;
+
+ /*
+ * Set up the command and run it.
+ */
+ if (input) {
+ FILE *file;
+
+ if (output) {
+ const char *ifname;
+ const char *ofname; /* Filename for output redirection */
+ char shellline[STRMAX]; /* The full command to run */
+
+ 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 );
+
+ ofname = netsnmp_mktemp();
+ if(NULL == ofname) {
+ if(ifname)
+ unlink(ifname);
+ return -1;
+ }
+ snprintf( shellline, sizeof(shellline), "(%s) < \"%s\" > \"%s\"",
+ command, ifname, ofname );
+ result = system(shellline);
+ /*
+ * If output was requested, then retrieve & return it.
+ * Tidy up, and return the result of the command.
+ */
+ if (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);
+ unlink(ifname);
+ } else {
+ file = popen(command, "w");
+ if (file) {
+ fwrite(input, 1, strlen(input), file);
+ result = pclose(file);
+ }
+ }
+ } else {
+ if (output) {
+ FILE* file;
+
+ file = popen(command, "r");
+ if (file) {
+ *out_len = fread(output, 1, *out_len - 1, file);
+ if (*out_len >= 0)
+ output[*out_len] = 0;
+ else
+ output[0] = 0;
+ result = pclose(file);
+ }
+ } else
+ result = system(command);
+ }
+
+ 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] = NULL;
+ *argc = i;
+
+ 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", (int)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", (int)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/agent/mibgroup/utilities/execute.h b/agent/mibgroup/utilities/execute.h
new file mode 100644
index 0000000..3c9e84b
--- /dev/null
+++ b/agent/mibgroup/utilities/execute.h
@@ -0,0 +1,11 @@
+#ifndef _MIBGROUP_EXECUTE_H
+#define _MIBGROUP_EXECUTE_H
+
+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/agent/mibgroup/utilities/iquery.c b/agent/mibgroup/utilities/iquery.c
new file mode 100644
index 0000000..e2aea74
--- /dev/null
+++ b/agent/mibgroup/utilities/iquery.c
@@ -0,0 +1,212 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "utilities/iquery.h"
+
+netsnmp_feature_child_of(iquery_all, libnetsnmpmibs)
+netsnmp_feature_child_of(iquery, iquery_all)
+netsnmp_feature_child_of(iquery_community_session, iquery_all)
+netsnmp_feature_child_of(iquery_pdu_session, iquery_all)
+
+netsnmp_feature_require(query_set_default_session)
+
+#ifndef NETSNMP_FEATURE_REMOVE_IQUERY
+
+void
+netsnmp_parse_iquerySecLevel(const char *token, char *line)
+{
+ 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 {
+ netsnmp_config_error("Unknown security level: %s", line);
+ }
+}
+
+void
+netsnmp_parse_iqueryVersion(const char *token, char *line)
+{
+#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 {
+ netsnmp_config_error("Unknown version: %s", line);
+ }
+}
+
+ /*
+ * 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_unchecked();
+
+ 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
+ *
+ **************************/
+
+#ifndef NETSNMP_FEATURE_REMOVE_IQUERY_PDU_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((char *) pdu->community,
+ pdu->version,
+ pdu->version+1,
+ SNMP_SEC_LEVEL_NOAUTH,
+ pdu->securityEngineID,
+ pdu->securityEngineIDLen);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IQUERY_PDU_SESSION */
+
+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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_IQUERY_COMMUNITY_SESSION
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_IQUERY_COMMUNITY_SESSION */
+
+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((u_char**)&(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;
+}
+
+#else /* NETSNMP_FEATURE_REMOVE_IQUERY */
+netsnmp_feature_unused(iquery);
+#endif /* NETSNMP_FEATURE_REMOVE_IQUERY */
+
diff --git a/agent/mibgroup/utilities/iquery.h b/agent/mibgroup/utilities/iquery.h
new file mode 100644
index 0000000..f98bd91
--- /dev/null
+++ b/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/agent/mibgroup/utilities/override.c b/agent/mibgroup/utilities/override.c
new file mode 100644
index 0000000..2b083a9
--- /dev/null
+++ b/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>
+
+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 = (override_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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ 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 = MAX_OID_LEN;
+ 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((u_char *)(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);
+ /* We need the size of the value in bytes, not in oids */
+ thedata->value_len *= sizeof(oid);
+ 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);
+ the_reg->rootoid = snmp_duplicate_objid(oidbuf, oidbuf_len);
+ 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/agent/mibgroup/utilities/override.h b/agent/mibgroup/utilities/override.h
new file mode 100644
index 0000000..5b07842
--- /dev/null
+++ b/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/agent/mibgroup/winExtDLL.c b/agent/mibgroup/winExtDLL.c
new file mode 100644
index 0000000..c693913
--- /dev/null
+++ b/agent/mibgroup/winExtDLL.c
@@ -0,0 +1,1763 @@
+/**
+ * @brief winExtDLL Net-SNMP agent extension module.
+ *
+ * Copyright (c) 2006-2009 Alex Burger.
+ * Copyright (c) 2009-2010 Bart Van Assche <bart.vanassche@gmail.com>.
+ *
+ * This Net-SNMP agent extension module loads Windows SNMP Extension Agent
+ * DLLs in the Net-SNMP agent. Not only extension DLLs provided with Windows
+ * (e.g. hostmib.dll) but also third-party extension DLLs are supported. This
+ * allows Net-SNMP to be a replacement for the Windows SNMP service, and makes
+ * it possible to use the SNMPv3 protocol.
+ *
+ * @see See also <a href="http://msdn.microsoft.com/en-us/library/aa378988(VS.85).aspx">SNMP Functions</a>
+ * for more information about Microsoft's SNMP Extension Agent API.
+ *
+ * @note In order to use this agent extension module, the Windows SNMP service
+ * must be installed first and must be disabled. Installing the Windows SNMP
+ * service is the only way to install the Windows Extension DLLs and to make
+ * sure that information about these DLLs is present in the registry.
+ *
+ * @note All Windows extension DLLs are loaded during startup of the Net-SNMP
+ * service. The Net-SNMP service must be restarted to load new modules. This
+ * extension is NOT for dynamically loading Net-SNMP extensions.
+ *
+ *
+ * History:
+ * - 2010/03/19:
+ * * Multi-varbind set request PDUs are now handled correctly.
+ * * If loading an extension DLL fails, the reason why this failed is now
+ * logged.
+ * * Fixed a memory leak that occurred when SnmpExtensionQuery() or
+ * SnmpExtensionQueryEx() failed while processing an SNMP PDU. Note:
+ * occurrence of an SNMP error does not make these functions fail, and
+ * it is not yet known whether or not it was possible to trigger this
+ * memory leak.
+ * - 2010/03/17: Fixed bug 2971257. Multi-varbind getNext requests with OIDs
+ * in reverse lexicographical order are again processed correctly.
+ * - 2010/01/22: Compiles now with MinGW too.
+ * - 2009/12/11:
+ * * The value of sysUpTime.0 reported by inetmib1.dll is now correct.
+ * * A linkUp or linkDown trap is now sent after the status of a network
+ * interface has changed.
+ * - 2009/03/26:
+ * * Removed several artificial limits. Result: more than 100 SNMP extension
+ * DLLs can now be loaded simultaneously and more than 100 OID ranges can
+ * now be registered. Loading e.g. the Dell OpenManage SNMP extension DLL
+ * does no longer crash Net-SNMP.
+ * * Number of OID ranges registered during startup is now logged.
+ * * It is no longer attempted to free the Broadcom SNMP extension DLLs
+ * bcmif.dll and baspmgnt.dll since doing so triggers a deadlock.
+ * * Added support for reregistration of an OID prefix. As an example, both
+ * both Microsoft's inetmib1.dll and the Eicon Diva divasnmpx.dll register
+ * the OID prefix iso.org.dod.internet.mgmt.mib-2.interfaces
+ * (.1.3.6.1.2.1.2). WinExtDLL will process OIDs with this prefix by using
+ * the handler that was registered last for the OID prefix. A message will
+ * be logged indicating that a handler has been replaced.
+ * - 2009/03/10:
+ * * Fixed several bugs in var_winExtDLL(): looking up extension DLL info
+ * based on the OID in a varbind is wrong. It does happen during GetNext
+ * processing that Net-SNMP passes intentionally varbinds to a handler
+ * with OIDs that are outside the range registered by the handler. Fixed
+ * this by filling in a pointer to the extension DLL info in
+ * netsnmp_mib_handler::myvoid and by using that information in the
+ * var_winExtDLL() handler function.
+ * * SetRequest PDUs are now passed once to an extension DLL instead of
+ * four times.
+ * * The error status and error index of a multi-varbind set request is now
+ * filled in correctly.
+ * * Added support for the SNMP extension DLL three-phase SNMP set.
+ * * Made traps SNMPv2 compliant by adding the sysUpTime.0 varbind.
+ * * The varbind list generated by extension DLLs for e.g. linkUp and
+ * linkDown traps is now passed to Net-SNMP. Previously this varbind list
+ * was discarded for generic traps.
+ * * Fixed memory leaks triggered by Get and GetNext PDU processing.
+ * * Added missing RegCloseKey() calls.
+ * * Added shutdown function shutdown_winExtDLL().
+ * * Replaced #include <cstdio> by #include <stdio.h> such that this source
+ * file compiles with Visual Studio 2005.
+ * * Removed many unused local variables.
+ * * Fixed several other compiler warnings.
+ * - 2006/09/09: creation of this file.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/agent/mib_module_config.h>
+
+#ifdef USING_WINEXTDLL_MODULE
+
+#include <net-snmp/types.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <windows.h>
+#include "../../win32/Snmp-winExtDLL.h"
+#include "../../win32/MgmtApi-winExtDLL.h"
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/library/snmp_assert.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "util_funcs.h"
+#include "winExtDLL.h"
+
+netsnmp_feature_require(oid_is_subtree)
+
+
+#define MAX_VALUE_NAME 16383
+#define MS_ASN_UINTEGER32 MS_ASN_UNSIGNED32
+
+
+typedef BOOL(WINAPI *
+ PFNSNMPEXTENSIONINIT) (DWORD dwUpTimeReference,
+ HANDLE * phSubagentTrapEvent,
+ AsnObjectIdentifier *
+ pFirstSupportedRegion);
+
+typedef BOOL(WINAPI *
+ PFNSNMPEXTENSIONINITEX) (AsnObjectIdentifier *
+ pNextSupportedRegion);
+
+typedef BOOL(WINAPI *
+ PFNSNMPEXTENSIONMONITOR) (LPVOID pAgentMgmtData);
+
+typedef BOOL(WINAPI * PFNSNMPEXTENSIONQUERY) (BYTE bPduType,
+ SnmpVarBindList *
+ pVarBindList,
+ AsnInteger32 *
+ pErrorStatus,
+ AsnInteger32 *
+ pErrorIndex);
+
+typedef BOOL(WINAPI * PFNSNMPEXTENSIONQUERYEX) (UINT nRequestType,
+ UINT
+ nTransactionId,
+ SnmpVarBindList *
+ pVarBindList,
+ AsnOctetString *
+ pContextInfo,
+ AsnInteger32 *
+ pErrorStatus,
+ AsnInteger32 *
+ pErrorIndex);
+
+typedef BOOL(WINAPI * PFNSNMPEXTENSIONTRAP) (AsnObjectIdentifier *
+ pEnterpriseOid,
+ AsnInteger32 *
+ pGenericTrapId,
+ AsnInteger32 *
+ pSpecificTrapId,
+ AsnTimeticks *
+ pTimeStamp,
+ SnmpVarBindList *
+ pVarBindList);
+
+typedef VOID(WINAPI * PFNSNMPEXTENSIONCLOSE) (void);
+
+/**
+ * Extensible array, a data structure similar to the C++ STL class
+ * std::vector<>.
+ */
+typedef struct {
+ /** Pointer to the memory allocated for the array. */
+ void *p;
+ /** Number of bytes occupied by a single element. */
+ size_t elem_size;
+ /** Number of elements that have been allocated. */
+ int reserved;
+ /** Number of elements currently in use. */
+ int size;
+} xarray;
+
+/**
+ * Information managed by winExtDLL about Windows SNMP extension DLL's.
+ */
+typedef struct {
+ char *dll_name; /**< Dynamically allocated DLL name. */
+ HANDLE dll_handle; /**< DLL handle. */
+ PFNSNMPEXTENSIONINIT pfSnmpExtensionInit;
+ PFNSNMPEXTENSIONINITEX pfSnmpExtensionInitEx;
+ PFNSNMPEXTENSIONQUERY pfSnmpExtensionQuery;
+ PFNSNMPEXTENSIONQUERYEX pfSnmpExtensionQueryEx;
+ PFNSNMPEXTENSIONTRAP pfSnmpExtensionTrap;
+ HANDLE subagentTrapEvent;
+} winextdll;
+
+/**
+ * Information managed by winExtDLL about a single view of a Windows SNMP
+ * extension DLL.
+ */
+typedef struct {
+ winextdll *winextdll_info;
+ netsnmp_handler_registration *my_handler;
+ oid name[MAX_OID_LEN]; /**< OID of this view. */
+ size_t name_length;
+} winextdll_view;
+
+/**
+ * Per varbind SNMP extension DLL context information for SNMP set operations.
+ */
+typedef struct context_info_s {
+ struct context_info_s *next;
+ int index;
+ AsnOctetString context_info;
+} context_info;
+
+
+/*
+ * External function declarations.
+ */
+void __declspec(dllimport) WINAPI SnmpSvcInitUptime(void);
+
+
+/*
+ * Local functions declarations.
+ */
+static int basename_equals(const char *path, const char *basename);
+static int register_netsnmp_handler(winextdll_view *
+ const ext_dll_view_info);
+static void read_extension_dlls_from_registry(void);
+static void read_extension_dlls_from_registry_at(const char *const subkey);
+static char *read_extension_dll_path_from_registry(const TCHAR *);
+static void subagentTrapCheck(unsigned int clientreg, void *clientarg);
+static int var_winExtDLL(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+static int append_windows_varbind_list(netsnmp_variable_list **
+ const net_snmp_varbinds,
+ const SnmpVarBindList *
+ const win_varbinds);
+static int append_windows_varbind(netsnmp_variable_list **
+ const net_snmp_varbinds,
+ const SnmpVarBind *
+ const win_varbind);
+static int convert_to_windows_varbind_list(SnmpVarBindList *
+ pVarBindList,
+ netsnmp_variable_list *
+ netsnmp_varbinds);
+static int convert_win_snmp_err(const int win_snmp_err);
+static winextdll_view *lookup_view_by_oid(oid * const name,
+ const size_t name_len);
+static int snmp_oid_compare_n_w(const oid * name1, size_t len1,
+ const UINT * name2, UINT len2);
+static int snmp_oid_compare_w_n(const UINT * name1, UINT len1,
+ const oid * name2, size_t len2);
+static int netsnmp_oid_is_subtree_n_w(const oid * name1, size_t len1,
+ const UINT * name2, UINT len2);
+static void copy_oid(oid * const to_name, size_t * const to_name_len,
+ const oid * const from_name,
+ const size_t from_name_len);
+static void copy_oid_n_w(oid * const to_name, size_t * const to_name_len,
+ const UINT * const from_name,
+ const UINT from_name_len);
+static UINT *copy_oid_to_new_windows_oid(AsnObjectIdentifier *
+ const windows_oid,
+ const oid * const name,
+ const size_t name_len);
+static int snmp_set_var_objid_w(netsnmp_variable_list * var,
+ const UINT * name, UINT name_length);
+static netsnmp_variable_list *
+snmp_varlist_add_variable_w(netsnmp_variable_list ** varlist,
+ const UINT * name, UINT name_length,
+ u_char type, const void * value, size_t len);
+static void send_trap(const AsnObjectIdentifier * const,
+ const AsnInteger, const AsnInteger,
+ const AsnTimeticks,
+ const SnmpVarBindList * const);
+static u_char *winsnmp_memdup(const void *src, const size_t len);
+#if 0
+static void xarray_init(xarray * a, size_t elem_size);
+#endif
+static void xarray_destroy(xarray * a);
+static void *xarray_push_back(xarray * a, const void *elem);
+#if 0
+static void xarray_erase(xarray * a, void *const elem);
+#endif
+static void *xarray_reserve(xarray * a, int reserved);
+
+
+/*
+ * Local variable definitions.
+ */
+#define WINEXTDLL(i) ((winextdll*)s_winextdll.p)[i]
+#define WINEXTDLL_VIEW(i) ((winextdll_view*)s_winextdll_view.p)[i]
+#define TRAPEVENT(i) ((HANDLE*)s_trapevent.p)[i]
+#define TRAPEVENT_TO_DLLINFO(i) ((winextdll**)s_trapevent_to_dllinfo.p)[i]
+static xarray s_winextdll = { 0, sizeof(winextdll) };
+static xarray s_winextdll_view = { 0, sizeof(winextdll_view) };
+static xarray s_trapevent = { 0, sizeof(HANDLE) };
+static xarray s_trapevent_to_dllinfo = { 0, sizeof(winextdll *) };
+static context_info *context_info_head;
+
+
+/*
+ * Function definitions.
+ */
+
+/** Initialize the winExtDLL extension agent. */
+void
+init_winExtDLL(void)
+{
+ BOOL result;
+ int i;
+
+ DEBUGMSG(("winExtDLL", "init_winExtDLL started.\n"));
+
+ SnmpSvcInitUptime();
+
+ read_extension_dlls_from_registry();
+
+ DEBUGMSG(("winExtDLL",
+ "init_winExtDLL: found %d extension DLLs in the registry.\n",
+ s_winextdll.size));
+
+ xarray_reserve(&s_winextdll, 128);
+
+ /*
+ * Load all the DLLs
+ */
+ for (i = 0; i < s_winextdll.size; i++) {
+ winextdll *const ext_dll_info = &WINEXTDLL(i);
+ AsnObjectIdentifier view;
+ winextdll_view ext_dll_view_info;
+
+ netsnmp_assert(ext_dll_info);
+ if (!ext_dll_info->dll_name)
+ continue;
+
+ DEBUGMSG(("winExtDLL", "loading DLL %s.\n",
+ ext_dll_info->dll_name));
+ ext_dll_info->dll_handle = LoadLibrary(ext_dll_info->dll_name);
+
+ if (ext_dll_info->dll_handle == NULL) {
+ const DWORD dwErrorcode = GetLastError();
+ LPTSTR lpMsgBuf;
+
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorcode,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) & lpMsgBuf, 0, NULL);
+ if (lpMsgBuf) {
+ LPTSTR p;
+
+ /*
+ * Remove trailing "\r\n".
+ */
+ p = strchr(lpMsgBuf, '\r');
+ if (p)
+ *p = '\0';
+ }
+ snmp_log(LOG_ERR,
+ "init_winExtDLL: could not load SNMP extension"
+ " DLL %s: %s\n",
+ ext_dll_info->dll_name, lpMsgBuf ? lpMsgBuf : "(?)");
+ if (lpMsgBuf)
+ LocalFree(lpMsgBuf);
+ continue;
+ }
+
+ /*
+ * Store DLL name and functions in s_extension_dll_info array.
+ */
+ ext_dll_info->pfSnmpExtensionInit = (PFNSNMPEXTENSIONINIT)
+ GetProcAddress(ext_dll_info->dll_handle, "SnmpExtensionInit");
+ ext_dll_info->pfSnmpExtensionInitEx = (PFNSNMPEXTENSIONINITEX)
+ GetProcAddress(ext_dll_info->dll_handle,
+ "SnmpExtensionInitEx");
+ ext_dll_info->pfSnmpExtensionQuery = (PFNSNMPEXTENSIONQUERY)
+ GetProcAddress(ext_dll_info->dll_handle, "SnmpExtensionQuery");
+ ext_dll_info->pfSnmpExtensionQueryEx = (PFNSNMPEXTENSIONQUERYEX)
+ GetProcAddress(ext_dll_info->dll_handle,
+ "SnmpExtensionQueryEx");
+ ext_dll_info->pfSnmpExtensionTrap = (PFNSNMPEXTENSIONTRAP)
+ GetProcAddress(ext_dll_info->dll_handle, "SnmpExtensionTrap");
+
+
+ if (ext_dll_info->pfSnmpExtensionQuery == NULL
+ && ext_dll_info->pfSnmpExtensionQueryEx == NULL) {
+ snmp_log(LOG_ERR,
+ "error in extension DLL %s: SNMP query function missing.\n",
+ ext_dll_info->dll_name);
+ }
+
+ /*
+ * Init and get first supported view from Windows SNMP extension DLL.
+ * Note: although according to the documentation of SnmpExtensionInit()
+ * the first argument of this function should be ignored by extension
+ * DLLs, passing the value GetTickCount() / 10 is necessary to make
+ * inetmib1.dll work correctly. Passing zero as the first argument
+ * causes inetmib1.dll to report an incorrect value for sysUpTime.0
+ * and also causes the same DLL not to send linkUp or linkDown traps.
+ */
+ ext_dll_info->subagentTrapEvent = NULL;
+ view.idLength = 0;
+ view.ids = 0;
+ result =
+ ext_dll_info->pfSnmpExtensionInit(GetTickCount() / 10,
+ &ext_dll_info->
+ subagentTrapEvent, &view);
+
+ if (!result) {
+ snmp_log(LOG_ERR,
+ "init_winExtDLL: initialization of DLL %s failed.\n",
+ ext_dll_info->dll_name);
+ FreeLibrary(ext_dll_info->dll_handle);
+ ext_dll_info->dll_handle = 0;
+ continue;
+ }
+
+ if (ext_dll_info->subagentTrapEvent != NULL) {
+ xarray_push_back(&s_trapevent,
+ &ext_dll_info->subagentTrapEvent);
+ xarray_push_back(&s_trapevent_to_dllinfo, &ext_dll_info);
+ }
+
+ memset(&ext_dll_view_info, 0, sizeof(ext_dll_view_info));
+ ext_dll_view_info.winextdll_info = ext_dll_info;
+ copy_oid_n_w(ext_dll_view_info.name, &ext_dll_view_info.name_length,
+ view.ids, view.idLength);
+ xarray_push_back(&s_winextdll_view, &ext_dll_view_info);
+
+ /*
+ * Loop looking for more supported views.
+ */
+ while (ext_dll_info->pfSnmpExtensionInitEx
+ && ext_dll_info->pfSnmpExtensionInitEx(&view)) {
+ memset(&ext_dll_view_info, 0, sizeof(ext_dll_view_info));
+ ext_dll_view_info.winextdll_info = ext_dll_info;
+ copy_oid_n_w(ext_dll_view_info.name,
+ &ext_dll_view_info.name_length, view.ids,
+ view.idLength);
+ xarray_push_back(&s_winextdll_view, &ext_dll_view_info);
+ }
+ }
+
+ /*
+ * Note: since register_netsnmp_handler() writes a pointer to the
+ * winextdll_view in one of the Net-SNMP data structures, it is not
+ * allowed to move winextdll_view data structures in memory after
+ * registration with Net-SNMP. Or: register_snmp_handler() must be called
+ * only once it is sure that the size of array s_winextdll_view won't change
+ * anymore.
+ */
+ for (i = 0; i < s_winextdll_view.size; i++)
+ register_netsnmp_handler(&WINEXTDLL_VIEW(i));
+
+ DEBUGMSG(("winExtDLL",
+ "init_winExtDLL: registered %d OID ranges.\n",
+ s_winextdll_view.size));
+
+ /*
+ * Let Net-SNMP call subagentTrapCheck() once per second.
+ */
+ if (s_trapevent.size)
+ snmp_alarm_register(1, SA_REPEAT, subagentTrapCheck, NULL);
+
+ DEBUGMSG(("winExtDLL", "init_winExtDLL finished.\n"));
+}
+
+void
+shutdown_winExtDLL(void)
+{
+ int i;
+
+ DEBUGMSG(("winExtDLL", "shutdown_winExtDLL() started.\n"));
+
+ for (i = s_winextdll_view.size - 1; i >= 0; i--) {
+ winextdll_view *const v = &WINEXTDLL_VIEW(i);
+ if (v && v->my_handler) {
+ DEBUGIF("winExtDLL") {
+ DEBUGMSG(("winExtDLL",
+ "unregistering handler for DLL %s and OID prefix ",
+ v->winextdll_info->dll_name));
+ DEBUGMSGOID(("winExtDLL", v->name, v->name_length));
+ DEBUGMSG(("winExtDLL", " ("));
+ DEBUGMSGSUBOID(("winExtDLL", v->name, v->name_length));
+ DEBUGMSG(("winExtDLL", ").\n"));
+ }
+ netsnmp_unregister_handler(v->my_handler);
+ }
+ }
+ xarray_destroy(&s_winextdll_view);
+
+ for (i = s_winextdll.size - 1; i >= 0; i--) {
+ winextdll *const ext_dll_info = &WINEXTDLL(i);
+ /*
+ * Freeing the Broadcom SNMP extension libraries triggers a deadlock,
+ * so skip bcmif.dll and baspmgnt.dll.
+ */
+ if (ext_dll_info->dll_handle != 0
+ && !basename_equals(ext_dll_info->dll_name, "bcmif.dll")
+ && !basename_equals(ext_dll_info->dll_name, "baspmgnt.dll")) {
+ DEBUGMSG(("winExtDLL", "unloading %s.\n",
+ ext_dll_info->dll_name));
+ FreeLibrary(ext_dll_info->dll_handle);
+ }
+ free(ext_dll_info->dll_name);
+ }
+ xarray_destroy(&s_winextdll);
+
+ xarray_destroy(&s_trapevent_to_dllinfo);
+
+ xarray_destroy(&s_trapevent);
+
+ DEBUGMSG(("winExtDLL", "shutdown_winExtDLL() finished.\n"));
+}
+
+/**
+ * Compare the basename of a path with a given string.
+ *
+ * @return 1 if the basename matches, 0 if not.
+ */
+static int
+basename_equals(const char *path, const char *basename)
+{
+ const size_t path_len = strlen(path);
+ const size_t basename_len = strlen(basename);
+
+ netsnmp_assert(strchr(path, '/') == 0);
+ netsnmp_assert(strchr(basename, '/') == 0);
+ netsnmp_assert(strchr(basename, '\\') == 0);
+
+ return path_len >= basename_len + 1
+ && path[path_len - basename_len - 1] == '\\'
+ && stricmp(path + path_len - basename_len, basename) == 0;
+}
+
+/**
+ * Register a single OID subtree with Net-SNMP.
+ *
+ * @return 1 if successful, 0 if not.
+ */
+int
+register_netsnmp_handler(winextdll_view * const ext_dll_view_info)
+{
+ winextdll *ext_dll_info;
+ winextdll_view *previously_registered_view;
+
+ ext_dll_info = ext_dll_view_info->winextdll_info;
+
+ previously_registered_view
+ = lookup_view_by_oid(ext_dll_view_info->name,
+ ext_dll_view_info->name_length);
+
+ if (previously_registered_view) {
+ size_t oid_namelen, outlen;
+ char *oid_name;
+ int buffer_large_enough;
+
+ oid_namelen = 0;
+ outlen = 0;
+ oid_name = NULL;
+ buffer_large_enough =
+ sprint_realloc_objid((u_char **) & oid_name, &oid_namelen,
+ &outlen, 1, ext_dll_view_info->name,
+ ext_dll_view_info->name_length);
+ snmp_log(LOG_INFO, "OID range %s%s: replacing handler %s by %s.\n",
+ oid_name ? oid_name : "",
+ buffer_large_enough ? "" : " [TRUNCATED]",
+ previously_registered_view->winextdll_info->dll_name,
+ ext_dll_view_info->winextdll_info->dll_name);
+ if (oid_name)
+ free(oid_name);
+
+ previously_registered_view->winextdll_info = ext_dll_info;
+ memset(ext_dll_view_info, 0, sizeof(*ext_dll_view_info));
+ return 1;
+ } else {
+ // Create handler registration
+ ext_dll_view_info->my_handler
+ = netsnmp_create_handler_registration(ext_dll_info->dll_name,
+ var_winExtDLL,
+ ext_dll_view_info->name,
+ ext_dll_view_info->
+ name_length,
+ HANDLER_CAN_RWRITE);
+
+ if (ext_dll_view_info->my_handler) {
+ ext_dll_view_info->my_handler->handler->myvoid =
+ ext_dll_view_info;
+ if (netsnmp_register_handler(ext_dll_view_info->my_handler)
+ == MIB_REGISTERED_OK) {
+ DEBUGIF("winExtDLL") {
+ DEBUGMSG(("winExtDLL",
+ "registering handler for DLL %s and OID prefix ",
+ ext_dll_info->dll_name));
+ DEBUGMSGOID(("winExtDLL", ext_dll_view_info->name,
+ ext_dll_view_info->name_length));
+ DEBUGMSG(("winExtDLL", " ("));
+ DEBUGMSGSUBOID(("winExtDLL", ext_dll_view_info->name,
+ ext_dll_view_info->name_length));
+ DEBUGMSG(("winExtDLL", ").\n"));
+ }
+ return 1;
+ } else {
+ snmp_log(LOG_ERR, "handler registration failed.\n");
+ ext_dll_view_info->my_handler = 0;
+ }
+ } else {
+ snmp_log(LOG_ERR, "handler creation failed.\n");
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * Allocate SNMP extension DLL context information. Such context information
+ * is necessary to allow an extension DLL to process a set request.
+ *
+ * @param[in] index Varbind index in original PDU.
+ *
+ * @return NULL if context information for the specified index was already
+ * allocated, and otherwise a pointer to the newly allocated context
+ * information.
+ */
+static context_info *
+alloc_context_info(const int index)
+{
+ context_info *p;
+
+ DEBUGMSG(("winExtDLL:context_info", "alloc_context_info(%d)\n",
+ index));
+
+ for (p = context_info_head; p; p = p->next) {
+ if (p->index == index) {
+ netsnmp_assert(FALSE);
+ return NULL;
+ }
+ }
+
+ p = calloc(1, sizeof(context_info));
+ p->next = context_info_head;
+ context_info_head = p;
+ p->index = index;
+
+ return p;
+}
+
+/**
+ * Deallocate SNMP extension DLL context information.
+ *
+ * @param[in] index Varbind index in original PDU.
+ */
+static void
+free_context_info(const int index)
+{
+ context_info **pprev = &context_info_head;
+ context_info *p;
+
+ DEBUGMSG(("winExtDLL:context_info", "free_context_info(%d)\n", index));
+
+ for (p = context_info_head; p; p = p->next) {
+ if (p->index == index) {
+ *pprev = p->next;
+ free(p);
+ break;
+ }
+ pprev = &p->next;
+ }
+}
+
+/**
+ * Look up SNMP extension DLL context information.
+ *
+ * @param[in] index Varbind index in original PDU.
+ */
+static AsnOctetString *
+get_context_info(const int index)
+{
+ context_info *p;
+
+ DEBUGMSG(("winExtDLL:context_info", "get_context_info(%d)\n", index));
+
+ for (p = context_info_head; p; p = p->next)
+ if (p->index == index)
+ return &p->context_info;
+
+ netsnmp_assert(FALSE);
+ return NULL;
+}
+
+static int
+var_winExtDLL(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ winextdll_view *const ext_dll_view_info = handler->myvoid;
+ winextdll *ext_dll_info;
+ netsnmp_request_info *request;
+ UINT nRequestType;
+ int rc;
+
+ netsnmp_assert(ext_dll_view_info);
+ ext_dll_info = ext_dll_view_info->winextdll_info;
+#if ! defined(NDEBUG)
+ netsnmp_assert(ext_dll_view_info ==
+ lookup_view_by_oid(reginfo->rootoid, reginfo->rootoid_len));
+#endif
+
+ if (ext_dll_info == 0) {
+ DEBUGMSG(("winExtDLL",
+ "internal error: no matching extension DLL found.\n"));
+ netsnmp_assert(0);
+ return SNMP_ERR_GENERR;
+ }
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ nRequestType = SNMP_EXTENSION_GET;
+ netsnmp_assert(!context_info_head);
+ break;
+ case MODE_GETNEXT:
+ nRequestType = SNMP_EXTENSION_GET_NEXT;
+ netsnmp_assert(!context_info_head);
+ break;
+ case MODE_SET_RESERVE1:
+ nRequestType = SNMP_EXTENSION_SET_TEST;
+ break;
+ case MODE_SET_RESERVE2:
+ return SNMP_ERR_NOERROR;
+ case MODE_SET_ACTION:
+ return SNMP_ERR_NOERROR;
+ case MODE_SET_UNDO:
+ nRequestType = SNMP_EXTENSION_SET_UNDO;
+ break;
+ case MODE_SET_COMMIT:
+ nRequestType = SNMP_EXTENSION_SET_COMMIT;
+ break;
+ case MODE_SET_FREE:
+ nRequestType = SNMP_EXTENSION_SET_CLEANUP;
+ break;
+ default:
+ DEBUGMSG(("winExtDLL",
+ "internal error: invalid mode %d.\n", reqinfo->mode));
+ netsnmp_assert(0);
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = SNMP_ERR_NOERROR;
+
+ for (request = requests; request; request = request->next) {
+ netsnmp_variable_list *varbind;
+ SnmpVarBindList win_varbinds;
+ AsnInteger32 ErrorStatus;
+ AsnInteger32 ErrorIndex;
+ BOOL result;
+ BOOL copy_value;
+
+ memset(&win_varbinds, 0, sizeof(win_varbinds));
+
+ if (request->processed || rc != SNMP_ERR_NOERROR)
+ goto free_win_varbinds;
+
+ if (reqinfo->mode == MODE_SET_RESERVE1)
+ alloc_context_info(request->index);
+
+ varbind = request->requestvb;
+ netsnmp_assert(varbind);
+
+ /*
+ * Convert the Net-SNMP varbind to a Windows SNMP varbind list.
+ */
+ rc = convert_to_windows_varbind_list(&win_varbinds, varbind);
+ if (rc != SNMP_ERR_NOERROR) {
+ DEBUGMSG(("winExtDLL",
+ "converting varbind list to Windows format failed with"
+ " error code %d.\n", request->status));
+ netsnmp_request_set_error(requests, rc);
+ goto free_win_varbinds;
+ }
+
+ netsnmp_assert(win_varbinds.len == 1);
+
+ /*
+ * For a GetNext PDU, if the varbind OID comes lexicographically
+ * before the root OID of this handler, replace it by the root OID.
+ */
+ if (reqinfo->mode == MODE_GETNEXT
+ && snmp_oid_compare_w_n(win_varbinds.list[0].name.ids,
+ win_varbinds.list[0].name.idLength,
+ reginfo->rootoid,
+ reginfo->rootoid_len) < 0) {
+
+ SnmpUtilOidFree(&win_varbinds.list[0].name);
+ memset(&win_varbinds.list[0].name, 0,
+ sizeof(win_varbinds.list[0].name));
+ copy_oid_to_new_windows_oid(&win_varbinds.list[0].name,
+ reginfo->rootoid,
+ reginfo->rootoid_len);
+ }
+
+ if (ext_dll_info->pfSnmpExtensionQueryEx) {
+ result = ext_dll_info->pfSnmpExtensionQueryEx(nRequestType,
+ 1,
+ &win_varbinds,
+ get_context_info(request->index),
+ &ErrorStatus,
+ &ErrorIndex);
+ } else if (ext_dll_info->pfSnmpExtensionQuery) {
+ result =
+ ext_dll_info->pfSnmpExtensionQuery((BYTE) nRequestType,
+ &win_varbinds,
+ &ErrorStatus,
+ &ErrorIndex);
+ } else {
+ snmp_log(LOG_ERR,
+ "error in extension DLL %s: SNMP query function missing.\n",
+ ext_dll_info->dll_name);
+ result = FALSE;
+ }
+
+ if (!result) {
+ snmp_log(LOG_ERR,
+ "extension DLL %s: SNMP query function failed.\n",
+ ext_dll_info->dll_name);
+ rc = SNMP_ERR_GENERR;
+ goto free_win_varbinds;
+ }
+
+ rc = convert_win_snmp_err(ErrorStatus);
+ if (rc != SNMP_ERR_NOERROR) {
+ DEBUGMSG(("winExtDLL",
+ "extension DLL %s: SNMP query function returned error code %lu (Windows) / %d (Net-SNMP).\n",
+ ext_dll_info->dll_name, ErrorStatus, rc));
+ netsnmp_assert(ErrorIndex == 1);
+ netsnmp_request_set_error(requests, rc);
+ if (rc == SNMP_NOSUCHOBJECT || rc == SNMP_NOSUCHINSTANCE
+ || rc == SNMP_ERR_NOSUCHNAME)
+ rc = SNMP_ERR_NOERROR;
+ goto free_win_varbinds;
+ }
+
+ copy_value = FALSE;
+ if (reqinfo->mode == MODE_GET)
+ copy_value = TRUE;
+ else if (reqinfo->mode == MODE_GETNEXT) {
+ const SnmpVarBind *win_varbind;
+
+ win_varbind = &win_varbinds.list[0];
+
+ /*
+ * Verify whether the OID returned by the extension DLL fits
+ * inside the OID range this handler has been registered
+ * with. Also compare the OID passed to the extension DLL with
+ * the OID returned by the same DLL. If the DLL returned a
+ * lexicographically earlier OID, this means that there is no
+ * next OID in the MIB implemented by the DLL.
+ *
+ * Note: for some GetNext requests BoundsChecker will report
+ * that the code below accesses a dangling pointer. This is
+ * a limitation of BoundsChecker: apparently BoundsChecker is
+ * not able to cope with reallocation of memory for
+ * win_varbind by an SNMP extension DLL that has not been
+ * instrumented by BoundsChecker.
+ */
+ if (netsnmp_oid_is_subtree_n_w(ext_dll_view_info->name,
+ ext_dll_view_info->name_length,
+ win_varbind->name.ids,
+ win_varbind->name.idLength) == 0
+ && snmp_oid_compare_n_w(varbind->name, varbind->name_length,
+ win_varbind->name.ids,
+ win_varbind->name.idLength) < 0) {
+ /*
+ * Copy the OID returned by the extension DLL to the
+ * Net-SNMP varbind.
+ */
+ snmp_set_var_objid_w(varbind,
+ win_varbind->name.ids,
+ win_varbind->name.idLength);
+ copy_value = TRUE;
+ }
+ }
+ if (copy_value) {
+ netsnmp_variable_list *result_vb;
+
+ /*
+ * Copy the value returned by the extension DLL to the Net-SNMP
+ * varbind.
+ */
+ result_vb = NULL;
+ rc = append_windows_varbind(&result_vb, &win_varbinds.list[0]);
+ netsnmp_assert(result_vb || rc != SNMP_ERR_NOERROR);
+ if (result_vb) {
+ snmp_set_var_typed_value(varbind,
+ result_vb->type,
+ result_vb->val.string,
+ result_vb->val_len);
+ snmp_free_varbind(result_vb);
+ } else {
+ netsnmp_request_set_error(requests, rc);
+ goto free_win_varbinds;
+ }
+ }
+
+free_win_varbinds:
+ if (reqinfo->mode == MODE_SET_COMMIT
+ || reqinfo->mode == MODE_SET_UNDO
+ || reqinfo->mode == MODE_SET_FREE)
+ free_context_info(request->index);
+ if (win_varbinds.list)
+ SnmpUtilVarBindListFree(&win_varbinds);
+ }
+
+ return rc;
+}
+
+/**
+ * Iterate over the SNMP extension DLL information in the registry and store
+ * the retrieved information in s_winextdll[].
+ *
+ * At the time an SNMP extension DLL is installed, some information about the
+ * DLL is written to the registry at one of the two following locations:
+ * HKLM\SYSTEM\CurrentControlSet\Control\SNMP\Parameters\ExtensionAgents for
+ * Windows Vista, Windows 7 and Windows 2008 or
+ * HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents for
+ * earlier Windows versions. Under this key zero or more REG_SZ values are
+ * stored with the names of registry keys containing the DLL path.
+ */
+void
+read_extension_dlls_from_registry()
+{
+ DEBUGMSGTL(("winExtDLL",
+ "read_extension_dlls_from_registry called\n"));
+
+ read_extension_dlls_from_registry_at
+ ("SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\ExtensionAgents");
+ read_extension_dlls_from_registry_at
+ ("SYSTEM\\CurrentControlSet\\Control\\SNMP\\Parameters\\ExtensionAgents");
+}
+
+void
+read_extension_dlls_from_registry_at(const char *const subkey)
+{
+ DWORD retCode;
+ HKEY hKey;
+ int i;
+ DWORD valueSize;
+ TCHAR valueName[MAX_VALUE_NAME];
+ DWORD dataType;
+ TCHAR data[MAX_VALUE_NAME];
+ DWORD dataSize;
+
+ retCode = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey,
+ 0, KEY_QUERY_VALUE, &hKey);
+
+ if (retCode == ERROR_SUCCESS) {
+ for (i = 0; ; i++) {
+ valueSize = sizeof(valueName);
+ dataSize = sizeof(data);
+ retCode = RegEnumValue(hKey, i, valueName, &valueSize, NULL,
+ &dataType, (BYTE *) data, &dataSize);
+
+ if (retCode != ERROR_SUCCESS)
+ break;
+ if (dataType == REG_SZ) {
+ winextdll ext_dll_info;
+
+ memset(&ext_dll_info, 0, sizeof(ext_dll_info));
+ ext_dll_info.dll_name =
+ read_extension_dll_path_from_registry(data);
+ if (ext_dll_info.dll_name) {
+ xarray_push_back(&s_winextdll, &ext_dll_info);
+ DEBUGMSG(("winExtDLL", "registry key %s: DLL %s.\n",
+ data, ext_dll_info.dll_name));
+ }
+ }
+ }
+ RegCloseKey(hKey);
+ }
+}
+
+/** Store the DLL path in dynamically allocated memory. */
+char *
+read_extension_dll_path_from_registry(const TCHAR * keyName)
+{
+ HKEY hKey;
+ DWORD key_value_type = 0;
+ TCHAR valueName[MAX_VALUE_NAME];
+ DWORD key_value_size = MAX_VALUE_NAME;
+ TCHAR valueNameExpanded[MAX_VALUE_NAME];
+ DWORD retCode;
+ char *result = 0;
+
+ retCode = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
+ keyName, 0, KEY_QUERY_VALUE, &hKey);
+
+ if (retCode != ERROR_SUCCESS)
+ return 0;
+
+ retCode = RegQueryValueExA(hKey,
+ "Pathname",
+ NULL,
+ &key_value_type,
+ (BYTE *) valueName, &key_value_size);
+
+ if (retCode != ERROR_SUCCESS) {
+ RegCloseKey(hKey);
+ return 0;
+ }
+
+ if (key_value_type == REG_EXPAND_SZ) {
+ if (ExpandEnvironmentStrings
+ (valueName, valueNameExpanded, MAX_VALUE_NAME))
+ result = strdup(valueNameExpanded);
+ } else if (key_value_type == REG_SZ)
+ result = strdup(valueName);
+
+ RegCloseKey(hKey);
+ return result;
+}
+
+/**
+ * Callback function called by the Net-SNMP agent to check for traps waiting
+ * to be processed.
+ */
+void
+subagentTrapCheck(unsigned int clientreg, void *clientarg)
+{
+ while (1) {
+ DWORD dwWaitResult;
+ BOOL bResult;
+ int i;
+ int j;
+ const winextdll *ext_dll_info;
+
+ if (s_trapevent.size == 0)
+ return;
+
+ dwWaitResult = WaitForMultipleObjects(s_trapevent.size,
+ &TRAPEVENT(0), FALSE, 0);
+
+ i = dwWaitResult - WAIT_OBJECT_0;
+ if (i < 0 || i >= s_trapevent.size) {
+ netsnmp_assert(dwWaitResult == WAIT_TIMEOUT);
+ return;
+ }
+
+ netsnmp_assert(s_trapevent.size == s_trapevent_to_dllinfo.size);
+ ext_dll_info = TRAPEVENT_TO_DLLINFO(i);
+ netsnmp_assert(ext_dll_info->subagentTrapEvent == TRAPEVENT(i));
+
+ /*
+ * Reset the signalled event just in case the extension DLL erroneously
+ * allocated a manual-reset event instead of an auto-reset event. It is
+ * important to reset the event BEFORE traps are processed, otherwise a
+ * race condition is triggered between the extension DLL setting the
+ * event and this code resetting the event.
+ */
+ ResetEvent(TRAPEVENT(i));
+
+ if (!ext_dll_info->pfSnmpExtensionTrap) {
+ snmp_log(LOG_ERR,
+ "internal error in SNMP extension DLL %s: a trap is ready"
+ " but the function SnmpExtensionTrap() is missing.\n",
+ ext_dll_info->dll_name);
+ return;
+ }
+
+ /*
+ * Process at most hundred traps per extension DLL. If the extension DLL
+ * has more traps waiting, that's probably a bug in the extension DLL.
+ */
+ for (j = 0; j < 100; j++) {
+ AsnObjectIdentifier Enterprise = { 0, NULL };
+ AsnInteger GenericTrap = 0;
+ AsnInteger SpecificTrap = 0;
+ AsnTimeticks TimeStamp = 0;
+ SnmpVarBindList TrapVarbinds = { NULL, 0 };
+
+ bResult = ext_dll_info->pfSnmpExtensionTrap(&Enterprise,
+ &GenericTrap,
+ &SpecificTrap,
+ &TimeStamp,
+ &TrapVarbinds);
+
+ if (!bResult)
+ break;
+
+ send_trap(&Enterprise, GenericTrap, SpecificTrap, TimeStamp,
+ &TrapVarbinds);
+
+ SnmpUtilVarBindListFree(&TrapVarbinds);
+ }
+ }
+}
+
+void
+send_trap(const AsnObjectIdentifier * const pEnterprise,
+ const AsnInteger GenericTrap,
+ const AsnInteger SpecificTrap,
+ const AsnTimeticks TimeStamp,
+ const SnmpVarBindList * const pTrapVarbinds)
+{
+ /*
+ * A quote from the paragraph in RFC 1908 about SNMPv1 to SNMPv2c
+ * trap translation (http://www.ietf.org/rfc/rfc1908.txt):
+ * <quote>
+ * If a Trap-PDU is received, then it is mapped into a SNMPv2-Trap-
+ * PDU. This is done by prepending onto the variable-bindings field
+ * two new bindings: sysUpTime.0 [6], which takes its value from the
+ * timestamp field of the Trap-PDU; and, snmpTrapOID.0 [6], which is
+ * calculated thusly: if the value of generic-trap field is
+ * `enterpriseSpecific', then the value used is the concatenation of
+ * the enterprise field from the Trap-PDU with two additional sub-
+ * identifiers, `0', and the value of the specific-trap field;
+ * otherwise, the value of the corresponding trap defined in [6] is
+ * used.
+ * </quote>
+ *
+ * Reference [6] refers to RFC 1907 (http://www.ietf.org/rfc/rfc1907.txt),
+ * where the generic trap OIDs have been defined as follows:
+ * coldStart ::= { snmpTraps 1 }
+ * warmStart ::= { snmpTraps 2 }
+ * linkDown ::= { snmpTraps 3 }
+ * linkUp ::= { snmpTraps 4 }
+ * authenticationFailure ::= { snmpTraps 5 }
+ * egpNeighborLoss ::= { snmpTraps 6 }
+ */
+ static const oid sysuptime_oid[] = { 1, 3, 6, 1, 2, 1, 1, 3, 0 };
+ static const size_t sysuptime_oid_len = OID_LENGTH(sysuptime_oid);
+
+ static const oid snmptrap_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+ static const size_t snmptrap_oid_len = OID_LENGTH(snmptrap_oid);
+
+ static const oid snmptraps_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 5 };
+ static const size_t snmptraps_oid_len = OID_LENGTH(snmptraps_oid);
+
+ oid vb2_oid[MAX_OID_LEN];
+ size_t vb2_oid_len;
+
+ netsnmp_variable_list *notification_vars = NULL;
+
+
+ /*
+ * Append the varbind (sysUpTime.0, TimeStamp).
+ */
+ snmp_varlist_add_variable(&notification_vars,
+ sysuptime_oid, sysuptime_oid_len,
+ ASN_TIMETICKS,
+ (const u_char *) &TimeStamp,
+ sizeof(TimeStamp));
+
+ if (GenericTrap == SNMP_GENERICTRAP_ENTERSPECIFIC) {
+ /*
+ * Enterprise specific trap: compute the OID
+ * *pEnterprise + ".0." + SpecificTrap.
+ */
+ copy_oid_n_w(vb2_oid, &vb2_oid_len,
+ pEnterprise->ids, pEnterprise->idLength);
+ vb2_oid[vb2_oid_len++] = 0;
+ vb2_oid[vb2_oid_len++] = SpecificTrap;
+ } else {
+ /*
+ * Generic trap: compute the OID snmpTraps + "." + GenericTrap.
+ * Since the GenericTrap values are those defined in SNMPv1, since
+ * these values start at zero, and since the corresponding values in
+ * SNMPv2 start at one, translate the GenericTrap value accordingly.
+ * See also http://www.ietf.org/rfc/rfc1214.txt and
+ * http://www.ietf.org/rfc/rfc3418.txt.
+ */
+ copy_oid(vb2_oid, &vb2_oid_len, snmptraps_oid, snmptraps_oid_len);
+ vb2_oid[vb2_oid_len++] = GenericTrap + 1;
+ }
+
+ /*
+ * Append the varbind (snmpTrap, vb2_oid).
+ */
+ snmp_varlist_add_variable(&notification_vars,
+ snmptrap_oid, snmptrap_oid_len,
+ ASN_OBJECT_ID,
+ (u_char *) vb2_oid,
+ vb2_oid_len * sizeof(vb2_oid[0]));
+
+ /*
+ * Append all the varbinds in pTrapVarbinds.
+ */
+ append_windows_varbind_list(&notification_vars, pTrapVarbinds);
+
+ /*
+ * Send trap.
+ */
+ send_v2trap(notification_vars);
+
+ /*
+ * Free the memory allocated for notification_vars.
+ */
+ snmp_free_varbind(notification_vars);
+}
+
+/**
+ * Convert a Windows varbind to a Net-SNMP varbind and add it to the list of
+ * varbinds 'net_snmp_varbinds'.
+ *
+ * @note The memory allocated inside this function must be freed by the caller
+ * as follows: snmp_free_varbind(*net_snmp_varbinds).
+ */
+static int
+append_windows_varbind_list(netsnmp_variable_list **
+ const net_snmp_varbinds,
+ const SnmpVarBindList * const win_varbinds)
+{
+ int i, status = SNMP_ERR_NOERROR;
+
+ for (i = 0; i < win_varbinds->len; i++) {
+ status =
+ append_windows_varbind(net_snmp_varbinds,
+ &win_varbinds->list[i]);
+ if (status != SNMP_ERR_NOERROR)
+ break;
+ }
+ return status;
+}
+
+static int
+append_windows_varbind(netsnmp_variable_list ** const net_snmp_varbinds,
+ const SnmpVarBind * const win_varbind)
+{
+ switch (win_varbind->value.asnType) {
+ case MS_ASN_INTEGER:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_INTEGER,
+ &win_varbind->value.asnValue.number,
+ sizeof(win_varbind->value.asnValue.
+ number));
+ break;
+ case MS_ASN_BITS:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_BIT_STR,
+ win_varbind->value.asnValue.bits.stream,
+ win_varbind->value.asnValue.bits.length);
+ break;
+ case MS_ASN_OCTETSTRING:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_OCTET_STR,
+ win_varbind->value.asnValue.string.
+ stream,
+ win_varbind->value.asnValue.string.
+ length);
+ break;
+ case MS_ASN_NULL:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_NULL, 0, 0);
+ break;
+ case MS_ASN_OBJECTIDENTIFIER:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_OBJECT_ID,
+ win_varbind->value.asnValue.
+ object.ids,
+ win_varbind->value.asnValue.object.
+ idLength * sizeof(oid));
+ break;
+
+ /*
+ * MS_ASN_INTEGER32: synonym for MS_ASN_INTEGER.
+ */
+
+ case MS_ASN_SEQUENCE:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_SEQUENCE,
+ win_varbind->value.asnValue.sequence.
+ stream,
+ win_varbind->value.asnValue.sequence.
+ length);
+ break;
+ case MS_ASN_IPADDRESS:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_IPADDRESS,
+ win_varbind->value.asnValue.address.
+ stream,
+ win_varbind->value.asnValue.address.
+ length);
+ break;
+ case MS_ASN_COUNTER32:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_COUNTER,
+ &win_varbind->value.asnValue.counter,
+ sizeof(win_varbind->value.asnValue.
+ counter));
+ break;
+ case MS_ASN_GAUGE32:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_GAUGE,
+ &win_varbind->value.asnValue.gauge,
+ sizeof(win_varbind->value.asnValue.
+ gauge));
+ break;
+ case MS_ASN_TIMETICKS:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_TIMETICKS,
+ &win_varbind->value.asnValue.ticks,
+ sizeof(win_varbind->value.asnValue.
+ ticks));
+ break;
+ case MS_ASN_OPAQUE: // AsnOctetString
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_OPAQUE,
+ win_varbind->value.asnValue.arbitrary.
+ stream,
+ win_varbind->value.asnValue.arbitrary.
+ length);
+ break;
+ case MS_ASN_COUNTER64:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_COUNTER64,
+ &win_varbind->value.asnValue.counter64,
+ sizeof(win_varbind->value.asnValue.
+ counter64));
+ break;
+ case MS_ASN_UINTEGER32:
+ snmp_varlist_add_variable_w(net_snmp_varbinds, win_varbind->name.ids,
+ win_varbind->name.idLength,
+ ASN_UNSIGNED,
+ &win_varbind->value.asnValue.unsigned32,
+ sizeof(win_varbind->value.asnValue.
+ unsigned32));
+ break;
+ default:
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+snmp_set_var_objid_w(netsnmp_variable_list * var, const UINT * name,
+ UINT name_length)
+{
+ netsnmp_static_assert(sizeof(oid) == sizeof(UINT));
+ return snmp_set_var_objid(var, (const oid *) name, name_length);
+}
+
+static netsnmp_variable_list *
+snmp_varlist_add_variable_w(netsnmp_variable_list ** varlist, const UINT * name,
+ UINT name_length, u_char type, const void * value,
+ size_t len)
+{
+ netsnmp_static_assert(sizeof(oid) == sizeof(UINT));
+ return snmp_varlist_add_variable(varlist, (const oid *) name, name_length, type,
+ value, len);
+}
+
+/**
+ * Convert a Net-SNMP varbind to a WinSNMP varbind list.
+ *
+ * @param[out] pVarBindList WinSNMP varbind list, initialized by this
+ * function.
+ * @param[in] varbind Net-SNMP varbind.
+ */
+int
+convert_to_windows_varbind_list(SnmpVarBindList * pVarBindList,
+ netsnmp_variable_list * varbind)
+{
+ SnmpVarBind *win_varbind;
+
+ netsnmp_assert(pVarBindList);
+ netsnmp_assert(varbind);
+
+ pVarBindList->len = 1;
+ pVarBindList->list
+ = (SnmpVarBind *) SnmpUtilMemAlloc(pVarBindList->len
+ *
+ sizeof(pVarBindList->list[0]));
+ if (pVarBindList->list == 0)
+ goto generr;
+
+ memset(&pVarBindList->list[0], 0, sizeof(pVarBindList->list[0]));
+
+ win_varbind = &pVarBindList->list[0];
+
+ if (varbind->name
+ && !copy_oid_to_new_windows_oid(&win_varbind->name,
+ varbind->name,
+ varbind->name_length))
+ goto generr;
+
+ switch (varbind->type) {
+ case ASN_BOOLEAN:
+ // There is no equivalent type in Microsoft's <snmp.h>.
+ netsnmp_assert(0);
+ win_varbind->value.asnType = MS_ASN_INTEGER;
+ win_varbind->value.asnValue.number = *(varbind->val.integer);
+ break;
+ case ASN_INTEGER:
+ win_varbind->value.asnType = MS_ASN_INTEGER;
+ win_varbind->value.asnValue.number = *(varbind->val.integer);
+ break;
+ case ASN_BIT_STR:
+ win_varbind->value.asnType = MS_ASN_BITS;
+ win_varbind->value.asnValue.string.stream
+ = winsnmp_memdup(varbind->val.string, varbind->val_len);
+ win_varbind->value.asnValue.string.length =
+ (UINT) (varbind->val_len);
+ win_varbind->value.asnValue.string.dynamic = TRUE;
+ break;
+ case ASN_OCTET_STR:
+ win_varbind->value.asnType = MS_ASN_OCTETSTRING;
+ win_varbind->value.asnValue.string.stream
+ = winsnmp_memdup(varbind->val.string, varbind->val_len);
+ win_varbind->value.asnValue.string.length =
+ (UINT) (varbind->val_len);
+ win_varbind->value.asnValue.string.dynamic = TRUE;
+ break;
+ case ASN_NULL:
+ win_varbind->value.asnType = MS_ASN_NULL;
+ memset(&win_varbind->value, 0, sizeof(win_varbind->value));
+ break;
+ case ASN_OBJECT_ID:
+ win_varbind->value.asnType = MS_ASN_OBJECTIDENTIFIER;
+ if (!copy_oid_to_new_windows_oid
+ (&win_varbind->value.asnValue.object, varbind->val.objid,
+ varbind->val_len / sizeof(varbind->val.objid[0])))
+ return SNMP_ERR_GENERR;
+ break;
+ case ASN_SEQUENCE:
+ win_varbind->value.asnType = MS_ASN_SEQUENCE;
+ win_varbind->value.asnValue.string.stream
+ = winsnmp_memdup(varbind->val.string, varbind->val_len);
+ win_varbind->value.asnValue.string.length =
+ (UINT) (varbind->val_len);
+ win_varbind->value.asnValue.string.dynamic = TRUE;
+ break;
+ case ASN_SET:
+ // There is no equivalent type in Microsoft's <snmp.h>.
+ netsnmp_assert(0);
+ win_varbind->value.asnType = MS_ASN_INTEGER;
+ win_varbind->value.asnValue.number = *(varbind->val.integer);
+ break;
+ case ASN_IPADDRESS:
+ win_varbind->value.asnType = MS_ASN_IPADDRESS;
+ win_varbind->value.asnValue.string.stream
+ = winsnmp_memdup(varbind->val.string, varbind->val_len);
+ win_varbind->value.asnValue.string.length =
+ (UINT) (varbind->val_len);
+ win_varbind->value.asnValue.string.dynamic = TRUE;
+ break;
+ case ASN_COUNTER:
+ win_varbind->value.asnType = MS_ASN_COUNTER32;
+ win_varbind->value.asnValue.counter = *(varbind->val.integer);
+ break;
+ /*
+ * ASN_GAUGE == ASN_UNSIGNED
+ */
+ case ASN_UNSIGNED:
+ win_varbind->value.asnType = MS_ASN_UNSIGNED32;
+ win_varbind->value.asnValue.unsigned32 = *(varbind->val.integer);
+ break;
+ case ASN_TIMETICKS:
+ win_varbind->value.asnType = MS_ASN_TIMETICKS;
+ win_varbind->value.asnValue.ticks = *(varbind->val.integer);
+ break;
+ case ASN_OPAQUE:
+ win_varbind->value.asnType = MS_ASN_OPAQUE;
+ win_varbind->value.asnValue.string.stream
+ = winsnmp_memdup(varbind->val.string, varbind->val_len);
+ win_varbind->value.asnValue.string.length =
+ (UINT) (varbind->val_len);
+ win_varbind->value.asnValue.string.dynamic = TRUE;
+ break;
+ case ASN_COUNTER64:
+ win_varbind->value.asnType = MS_ASN_COUNTER64;
+ win_varbind->value.asnValue.counter64.HighPart
+ = varbind->val.counter64->high;
+ win_varbind->value.asnValue.counter64.LowPart
+ = varbind->val.counter64->low;
+ break;
+ default:
+ netsnmp_assert(0);
+ goto generr;
+ }
+
+ return SNMP_ERR_NOERROR;
+
+ generr:
+ SnmpUtilVarBindListFree(pVarBindList);
+ memset(pVarBindList, 0, sizeof(*pVarBindList));
+ return SNMP_ERR_GENERR;
+}
+
+/** Convert a Windows SNMP error code to the equivalent Net-SNMP error code. */
+int
+convert_win_snmp_err(const int win_snmp_err)
+{
+ switch (win_snmp_err) {
+ case SNMP_ERRORSTATUS_NOERROR:
+ return SNMP_ERR_NOERROR;
+ case SNMP_ERRORSTATUS_TOOBIG:
+ return SNMP_ERR_TOOBIG;
+ case SNMP_ERRORSTATUS_NOSUCHNAME:
+ /*
+ * Note: SNMP extension DLLs return SNMP_ERRORSTATUS_NOSUCHNAME
+ * when either noSuchObject or noSuchInstance should be returned to
+ * the SNMP manager (assuming SNMPv2c or SNMPv3). Unfortunately it
+ * is not possible without consulting the MIB to find out whether
+ * either SNMP_NOSUCHINSTANCE or SNMP_NOSUCHOBJECT should be returned.
+ * See also RFC 1448.
+ */
+ return SNMP_NOSUCHINSTANCE;
+ case SNMP_ERRORSTATUS_BADVALUE:
+ return SNMP_ERR_BADVALUE;
+ case SNMP_ERRORSTATUS_READONLY:
+ return SNMP_ERR_READONLY;
+ case SNMP_ERRORSTATUS_GENERR:
+ return SNMP_ERR_GENERR;
+ case SNMP_ERRORSTATUS_NOACCESS:
+ return SNMP_ERR_NOACCESS;
+ case SNMP_ERRORSTATUS_WRONGTYPE:
+ return SNMP_ERR_WRONGTYPE;
+ case SNMP_ERRORSTATUS_WRONGLENGTH:
+ return SNMP_ERR_WRONGLENGTH;
+ case SNMP_ERRORSTATUS_WRONGENCODING:
+ return SNMP_ERR_WRONGENCODING;
+ case SNMP_ERRORSTATUS_WRONGVALUE:
+ return SNMP_ERR_WRONGVALUE;
+ case SNMP_ERRORSTATUS_NOCREATION:
+ return SNMP_ERR_NOCREATION;
+ case SNMP_ERRORSTATUS_INCONSISTENTVALUE:
+ return SNMP_ERR_INCONSISTENTVALUE;
+ case SNMP_ERRORSTATUS_RESOURCEUNAVAILABLE:
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ case SNMP_ERRORSTATUS_COMMITFAILED:
+ return SNMP_ERR_COMMITFAILED;
+ case SNMP_ERRORSTATUS_UNDOFAILED:
+ return SNMP_ERR_UNDOFAILED;
+ case SNMP_ERRORSTATUS_AUTHORIZATIONERROR:
+ return SNMP_ERR_AUTHORIZATIONERROR;
+ case SNMP_ERRORSTATUS_NOTWRITABLE:
+ return SNMP_ERR_NOTWRITABLE;
+ case SNMP_ERRORSTATUS_INCONSISTENTNAME:
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ netsnmp_assert(0);
+ return SNMP_ERR_GENERR;
+}
+
+/**
+ * Look up the extension DLL view that was registered with the given OID.
+ */
+static winextdll_view *
+lookup_view_by_oid(oid * const name, const size_t name_len)
+{
+ int i;
+
+ for (i = 0; i < s_winextdll_view.size; i++) {
+ if (netsnmp_oid_equals(WINEXTDLL_VIEW(i).name,
+ WINEXTDLL_VIEW(i).name_length,
+ name, name_len) == 0
+ && WINEXTDLL_VIEW(i).my_handler) {
+ return &WINEXTDLL_VIEW(i);
+ }
+ }
+
+ return NULL;
+}
+
+static int
+snmp_oid_compare_n_w(const oid * name1, size_t len1, const UINT * name2,
+ UINT len2)
+{
+ netsnmp_static_assert(sizeof(oid) == sizeof(UINT));
+ return snmp_oid_compare(name1, len1, (const oid *) name2, len2);
+}
+
+static int
+snmp_oid_compare_w_n(const UINT * name1, UINT len1, const oid * name2,
+ size_t len2)
+{
+ netsnmp_static_assert(sizeof(oid) == sizeof(UINT));
+ return snmp_oid_compare((const oid *) name1, len1, name2, len2);
+}
+
+static int
+netsnmp_oid_is_subtree_n_w(const oid * name1, size_t len1, const UINT * name2,
+ UINT len2)
+{
+ netsnmp_static_assert(sizeof(oid) == sizeof(UINT));
+ return netsnmp_oid_is_subtree(name1, len1, (const oid *) name2, len2);
+}
+
+/**
+ * Copy an OID.
+ *
+ * @param[out] to_name Number of elements written to destination OID.
+ * @param[out] to_name_len Length of destination OID. Must have at least
+ * min(from_name_len, MAX_OID_LEN) elements.
+ * @param[in] from_name Original OID.
+ * @param[in] from_name_len Length of original OID.
+ */
+static void
+copy_oid(oid * const to_name, size_t * const to_name_len,
+ const oid * const from_name, const size_t from_name_len)
+{
+ int j;
+
+ netsnmp_assert(to_name);
+ netsnmp_assert(to_name_len);
+ netsnmp_assert(from_name);
+
+ for (j = 0; j < from_name_len && j < MAX_OID_LEN; j++)
+ to_name[j] = from_name[j];
+
+ *to_name_len = j;
+}
+
+/**
+ * Copy an OID.
+ *
+ * @param[out] to_name Number of elements written to destination OID.
+ * @param[out] to_name_len Length of destination OID. Must have at least
+ * min(from_name_len, MAX_OID_LEN) elements.
+ * @param[in] from_name Original OID.
+ * @param[in] from_name_len Length of original OID.
+ */
+static void
+copy_oid_n_w(oid * const to_name, size_t * const to_name_len,
+ const UINT * const from_name, const UINT from_name_len)
+{
+ netsnmp_static_assert(sizeof(oid) == sizeof(UINT));
+ copy_oid(to_name, to_name_len, (const oid *) from_name, from_name_len);
+}
+
+/**
+ * Convert a Net-SNMP OID into a Windows OID and allocate memory for the
+ * Windows OID.
+ *
+ * @param[out] windows_oid Pointer to a AsnObjectIdentifier.
+ * @param[in] name Pointer to an array with elements of type oid
+ * and length name_len.
+ * @param[in] name_len Number of elements of input and output OID.
+ */
+static UINT *
+copy_oid_to_new_windows_oid(AsnObjectIdentifier * const windows_oid,
+ const oid * const name, const size_t name_len)
+{
+ netsnmp_assert(windows_oid);
+ netsnmp_assert(windows_oid->ids == 0);
+ netsnmp_assert(windows_oid->idLength == 0);
+ netsnmp_assert(name);
+
+ windows_oid->ids
+ =
+ (UINT *) winsnmp_memdup(name,
+ sizeof(windows_oid->ids[0]) * name_len);
+ windows_oid->idLength = (UINT) name_len;
+ return windows_oid->ids;
+}
+
+static u_char *
+winsnmp_memdup(const void *src, const size_t len)
+{
+ u_char *p;
+
+ netsnmp_assert(len == (UINT) len);
+
+ p = SnmpUtilMemAlloc((UINT) len);
+ if (p)
+ memcpy(p, src, len);
+ return p;
+}
+
+#if 0
+/** Initialize array 'a'. */
+static void
+xarray_init(xarray * a, size_t elem_size)
+{
+ netsnmp_assert(a);
+
+ memset(a, 0, sizeof(*a));
+ a->elem_size = elem_size;
+}
+#endif
+
+/** Deallocate any memory that was dynamically allocated for 'a'. */
+static void
+xarray_destroy(xarray * a)
+{
+ netsnmp_assert(a);
+
+ xarray_reserve(a, 0);
+}
+
+/**
+ * Append the contents of the address range [ elem, elem + a->elem_size [ to a.
+ *
+ * Resize a if necessary.
+ *
+ * @return A pointer to the address where the data has been copied upon success,
+ * or NULL upon failure.
+ */
+static void *
+xarray_push_back(xarray * a, const void *elem)
+{
+ netsnmp_assert(a);
+ netsnmp_assert(elem);
+ netsnmp_assert(a->size <= a->reserved);
+
+ if (a->size == a->reserved)
+ xarray_reserve(a, a->reserved == 0 ? 16 : 2 * a->reserved);
+ if (a->size < a->reserved) {
+ netsnmp_assert(a->size < a->reserved);
+ return memcpy((char *) (a->p) + a->elem_size * a->size++, elem,
+ a->elem_size);
+ }
+ return NULL;
+}
+
+#if 0
+/** Erase [ elem, elem + a->elem_size [ from a. */
+static void
+xarray_erase(xarray * a, void *const elem)
+{
+ netsnmp_assert(a);
+ netsnmp_assert(a->size >= 1);
+ netsnmp_assert(a->p <= elem);
+ netsnmp_assert((const char *) elem + a->elem_size <=
+ (char *) a->p + a->size * a->elem_size);
+ netsnmp_assert(((const char *) elem - (char *) a->p) % a->elem_size == 0);
+
+ a->size--;
+ memmove((char *) elem, (char *) elem + a->elem_size,
+ a->size - ((const char *) elem -
+ (char *) a->p) / a->elem_size);
+}
+#endif
+
+/**
+ * Change the number of allocated elements to 'reserved'.
+ *
+ * Can be used either for enlarging or for shrinking the memory allocated for
+ * 'a'. Does not modify 'a' if memory allocation fails. Newly allocted memory
+ * is not initialized.
+ *
+ * @return != NULL upon success, NULL upon failure.
+ */
+static void *
+xarray_reserve(xarray * a, int reserved)
+{
+ netsnmp_assert(a);
+ netsnmp_assert(a->size <= a->reserved);
+
+ if ((a->p = realloc(a->p, a->elem_size * reserved)))
+ a->reserved = reserved;
+ else
+ a->reserved = 0;
+ return a->p;
+}
+
+#endif /* USING_WINEXTDLL_MODULE */
diff --git a/agent/mibgroup/winExtDLL.h b/agent/mibgroup/winExtDLL.h
new file mode 100644
index 0000000..c90f669
--- /dev/null
+++ b/agent/mibgroup/winExtDLL.h
@@ -0,0 +1,26 @@
+/*
+ * Don't include ourselves twice
+ */
+#ifndef _WINEXTDLL_H
+#define _WINEXTDLL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * 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);
+ void shutdown_winExtDLL(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINEXTDLL_H */
diff --git a/agent/object_monitor.c b/agent/object_monitor.c
new file mode 100644
index 0000000..2ab8c9b
--- /dev/null
+++ b/agent/object_monitor.c
@@ -0,0 +1,757 @@
+/*
+ * object_monitor.c
+ *
+ * $Id$
+ *
+ * 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/agent/snmp_agent.c b/agent/snmp_agent.c
new file mode 100644
index 0000000..0b44a81
--- /dev/null
+++ b/agent/snmp_agent.c
@@ -0,0 +1,3838 @@
+/*
+ * 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 <net-snmp/net-snmp-features.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
+# 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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <errno.h>
+
+#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 <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
+
+netsnmp_feature_child_of(snmp_agent, libnetsnmpagent)
+netsnmp_feature_child_of(agent_debugging_utilities, libnetsnmpagent)
+
+netsnmp_feature_child_of(allocate_globalcacheid, snmp_agent)
+netsnmp_feature_child_of(free_agent_snmp_session_by_session, snmp_agent)
+netsnmp_feature_child_of(check_all_requests_error, snmp_agent)
+netsnmp_feature_child_of(check_requests_error, snmp_agent)
+netsnmp_feature_child_of(request_set_error_idx, snmp_agent)
+netsnmp_feature_child_of(set_agent_uptime, snmp_agent)
+netsnmp_feature_child_of(agent_check_and_process, snmp_agent)
+
+netsnmp_feature_child_of(dump_sess_list, agent_debugging_utilities)
+
+netsnmp_feature_child_of(agent_remove_list_data, netsnmp_unused)
+netsnmp_feature_child_of(set_all_requests_error, netsnmp_unused)
+netsnmp_feature_child_of(addrcache_age, netsnmp_unused)
+netsnmp_feature_child_of(delete_subtree_cache, netsnmp_unused)
+
+
+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;
+ }
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_AGENT_REMOVE_LIST_DATA
+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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_AGENT_REMOVE_LIST_DATA */
+
+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);
+ }
+}
+
+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 lastHitM;
+};
+
+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;
+
+#ifndef NETSNMP_FEATURE_REMOVE_ALLOCATE_GLOBALCACHEID
+int
+netsnmp_allocate_globalcacheid(void)
+{
+ return ++current_globalid;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_ALLOCATE_GLOBALCACHEID */
+
+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 (tmpp != NULL) {
+ 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 condition. -- 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 condition. -- 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);
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_AGENT_CHECK_AND_PROCESS
+/**
+ * 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.
+ */
+
+ timerclear(tvp);
+ }
+
+ count = select(numfds, &fdset, NULL, NULL, 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 */
+
+ /*
+ * see if persistent store needs to be saved
+ */
+ snmp_store_if_needed();
+
+ /*
+ * Run requested alarms.
+ */
+ run_alarms();
+
+ netsnmp_check_outstanding_agent_requests();
+
+ return count;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_AGENT_CHECK_AND_PROCESS */
+
+/*
+ * 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;
+ }
+}
+
+void netsnmp_addrcache_destroy(void)
+{
+ int i = 0;
+
+ for (i = 0; i < SNMP_ADDRCACHE_SIZE; i++) {
+ if (addrCache[i].status == SNMP_ADDRCACHE_USED) {
+ free(addrCache[i].addr);
+ 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
+ */
+ netsnmp_get_monotonic_clock(&now);
+ 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
+ */
+ addrCache[i].lastHitM = now;
+ if (timercmp(&addrCache[i].lastHitM, &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].lastHitM, &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].lastHitM,
+ &addrCache[oldest].lastHitM, <))
+ 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;
+ addrCache[unused].lastHitM = now;
+ }
+ 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);
+ addrCache[oldest].lastHitM = now;
+ }
+ 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
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_ADDRCACHE_AGE
+void
+netsnmp_addrcache_age(void)
+{
+ (void)netsnmp_addrcache_add(NULL);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_ADDRCACHE_AGE */
+
+/*******************************************************************-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 = NULL, *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 "[" */
+ if (addr_string)
+ tcpudpaddr = strstr(addr_string, "[");
+ if ( tcpudpaddr != 0 ) {
+ char sbuf[64];
+ char *xp;
+
+ strlcpy(sbuf, tcpudpaddr + 1, sizeof(sbuf));
+ 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;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_SET:
+ snmp_log(LOG_DEBUG, " SET message\n");
+ break;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+
+ /* Optional supplimental transport configuration information and
+ final call to actually open the transport */
+ if (netsnmp_sess_config_transport(s->transport_configuration, t)
+ != SNMPERR_SUCCESS) {
+ SNMP_FREE(s);
+ SNMP_FREE(n);
+ return -1;
+ }
+
+
+ if (t->f_open)
+ t = t->f_open(t);
+
+ if (NULL == t) {
+ SNMP_FREE(s);
+ SNMP_FREE(n);
+ return -1;
+ }
+
+ t->flags |= NETSNMP_TRANSPORT_FLAG_OPENED;
+
+ 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 (snmp_sess_session_lookup(a->s)) {
+ 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 = NULL;
+ 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 */
+ }
+
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ /*
+ * Have specific agent ports been specified?
+ */
+ cptr = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS);
+
+ if (cptr) {
+ buf = strdup(cptr);
+ if (!buf) {
+ snmp_log(LOG_ERR,
+ "Error processing transport \"%s\"\n", cptr);
+ return 1;
+ }
+ } else {
+ /*
+ * No, so just specify the default port.
+ */
+ buf = strdup("");
+ }
+
+ 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"));
+ break;
+ }
+ 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');
+ SNMP_FREE(buf);
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+#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
+
+ 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 %8p 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 %8p 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);
+ SNMP_FREE(asp->treecache);
+ 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 == %8p\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 == %8p\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 "
+ "%8p\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)
+{
+ /*
+ * 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 = %8p\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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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)) {
+ netsnmp_variable_list *var_ptr = asp->pdu->variables;
+ int i = 1;
+
+ while (var_ptr != NULL) {
+ 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;
+ }
+ var_ptr = var_ptr->next_variable;
+ ++i;
+ }
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+#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)) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ snmp_increment_statistic_by((asp->pdu->command == SNMP_MSG_SET ?
+ STAT_SNMPINTOTALSETVARS :
+ STAT_SNMPINTOTALREQVARS),
+ count_varbinds(asp->pdu->variables));
+#else /* NETSNMP_NO_WRITE_SUPPORT */
+ snmp_increment_statistic_by(STAT_SNMPINTOTALREQVARS,
+ count_varbinds(asp->pdu->variables));
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ } 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) &&
+ asp->session->s_snmp_errno != SNMPERR_SUCCESS) {
+ 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;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_DUMP_SESS_LIST
+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", "%8p[session %8p] -> ", a, a->session));
+ }
+ DEBUGMSG(("snmp_agent", "[NIL]\n"));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DUMP_SESS_LIST */
+
+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 == %8p\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);
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_FREE_AGENT_SNMP_SESSION_BY_SESSION
+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 == %8p\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;
+ }
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_FREE_AGENT_SNMP_SESSION_BY_SESSION */
+
+/** 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 = %8p\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;
+
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_SET:
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ case SNMP_MSG_GET:
+ varbind_ptr->type = SNMP_NOSUCHOBJECT;
+ break;
+
+ default:
+ return NULL; /* shouldn't get here */
+ }
+ } else {
+ int cacheid;
+
+ 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
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (!MODE_IS_SET(asp->pdu->command)) {
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * 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 =
+ (netsnmp_tree_cache *)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 =
+ (netsnmp_tree_cache *)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)(INT_MAX / sizeof(struct varbind_list *)))
+ maxresponses = (int)(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 %ld\n",
+ asp->pdu->errindex));
+ }
+
+ asp->bulkcache =
+ (netsnmp_variable_list **) malloc(
+ (n + 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 = %ld, 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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));
+
+ if (asp->treecache == NULL)
+ return SNMP_ERR_GENERR;
+
+ 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)) {
+ SNMP_FREE(old_treecache);
+ }
+ } 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)) {
+ SNMP_FREE(old_treecache);
+ }
+ }
+ }
+
+ 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;
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_DELETE_SUBTREE_CACHE
+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--;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DELETE_SUBTREE_CACHE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_ALL_REQUESTS_ERROR
+/*
+ * 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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_ALL_REQUESTS_ERROR */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_REQUESTS_ERROR
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_REQUESTS_ERROR */
+
+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) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 = %8p\n", asp));
+ break;
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * 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 = %8p\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;
+
+ for (asp = agent_delegated_list; 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 = %8p\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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+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;
+}
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+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 = %8p\n", asp));
+ return 1;
+ }
+
+ /*
+ * check for set request
+ */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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 = %8p\n",
+ asp));
+ netsnmp_add_queued(asp);
+ return 1;
+ }
+ }
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ }
+
+ /*
+ * 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;
+}
+
+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) {
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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
+ */
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_INTERNAL_SET_BEGIN:
+ case SNMP_MSG_INTERNAL_SET_RESERVE1:
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ 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;
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ 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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ 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;
+ break;
+
+ /*
+ * 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;
+ */
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_INTERNAL_SET_RESERVE1:
+ request->status = SNMP_ERR_NOCREATION;
+ break;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ default:
+ request->status = SNMP_ERR_NOSUCHNAME; /* WWW: correct? */
+ break;
+ }
+ 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;
+ }
+ break;
+ }
+ 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);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_REQUEST_SET_ERROR_IDX
+/** 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);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_REQUEST_SET_ERROR_IDX */
+
+/** 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;
+}
+
+/**
+ * Return the difference between pm and the agent start time in hundredths of
+ * a second.
+ * \deprecated Don't use in new code.
+ *
+ * @param[in] pm An absolute time as e.g. reported by gettimeofday().
+ */
+u_long
+netsnmp_marker_uptime(marker_t pm)
+{
+ u_long res;
+ const_marker_t start = netsnmp_get_agent_starttime();
+
+ res = uatime_hdiff(start, pm);
+ return res;
+}
+
+/**
+ * Return the difference between tv and the agent start time in hundredths of
+ * a second.
+ *
+ * \deprecated Use netsnmp_get_agent_uptime() instead.
+ *
+ * @param[in] tv An absolute time as e.g. reported by gettimeofday().
+ */
+u_long
+netsnmp_timeval_uptime(struct timeval * tv)
+{
+ return netsnmp_marker_uptime((marker_t) tv);
+}
+
+
+struct timeval starttime;
+static struct timeval starttimeM;
+
+/**
+ * Return a pointer to the variable in which the Net-SNMP start time has
+ * been stored.
+ *
+ * @note Use netsnmp_get_agent_runtime() instead of this function if you need
+ * to know how much time elapsed since netsnmp_set_agent_starttime() has been
+ * called.
+ */
+const_marker_t
+netsnmp_get_agent_starttime(void)
+{
+ return &starttime;
+}
+
+/**
+ * Report the time that elapsed since the agent start time in hundredths of a
+ * second.
+ *
+ * @see See also netsnmp_set_agent_starttime().
+ */
+uint64_t
+netsnmp_get_agent_runtime(void)
+{
+ struct timeval now, delta;
+
+ netsnmp_get_monotonic_clock(&now);
+ NETSNMP_TIMERSUB(&now, &starttimeM, &delta);
+ return delta.tv_sec * (uint64_t)100 + delta.tv_usec / 10000;
+}
+
+/**
+ * Set the time at which Net-SNMP started either to the current time
+ * (if s == NULL) or to *s (if s is not NULL).
+ *
+ * @see See also netsnmp_set_agent_uptime().
+ */
+void
+netsnmp_set_agent_starttime(marker_t s)
+{
+ if (s) {
+ struct timeval nowA, nowM;
+
+ starttime = *(struct timeval*)s;
+ gettimeofday(&nowA, NULL);
+ netsnmp_get_monotonic_clock(&nowM);
+ NETSNMP_TIMERSUB(&starttime, &nowA, &starttimeM);
+ NETSNMP_TIMERADD(&starttimeM, &nowM, &starttimeM);
+ } else {
+ gettimeofday(&starttime, NULL);
+ netsnmp_get_monotonic_clock(&starttimeM);
+ }
+}
+
+
+/**
+ * Return the current value of 'sysUpTime'
+ */
+u_long
+netsnmp_get_agent_uptime(void)
+{
+ struct timeval now, delta;
+
+ netsnmp_get_monotonic_clock(&now);
+ NETSNMP_TIMERSUB(&now, &starttimeM, &delta);
+ return delta.tv_sec * 100UL + delta.tv_usec / 10000;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SET_AGENT_UPTIME
+/**
+ * Set the start time from which 'sysUpTime' is computed.
+ *
+ * @param[in] hsec New sysUpTime in hundredths of a second.
+ *
+ * @see See also netsnmp_set_agent_starttime().
+ */
+void
+netsnmp_set_agent_uptime(u_long hsec)
+{
+ struct timeval nowA, nowM;
+ struct timeval new_uptime;
+
+ gettimeofday(&nowA, NULL);
+ netsnmp_get_monotonic_clock(&nowM);
+ new_uptime.tv_sec = hsec / 100;
+ new_uptime.tv_usec = (uint32_t)(hsec - new_uptime.tv_sec * 100) * 10000L;
+ NETSNMP_TIMERSUB(&nowA, &new_uptime, &starttime);
+ NETSNMP_TIMERSUB(&nowM, &new_uptime, &starttimeM);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SET_AGENT_UPTIME */
+
+
+/*************************************************************************
+ *
+ * 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
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_SET_ALL_REQUESTS_ERROR
+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;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SET_ALL_REQUESTS_ERROR */
+/** @} */
diff --git a/agent/snmp_perl.c b/agent/snmp_perl.c
new file mode 100644
index 0000000..48d9695
--- /dev/null
+++ b/agent/snmp_perl.c
@@ -0,0 +1,186 @@
+#if defined(_WIN32) && !defined(_WIN32_WINNT)
+#define _WIN32_WINNT 0x501
+#endif
+
+#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>
+
+#include "snmp_perl.h"
+
+static PerlInterpreter *my_perl;
+
+void boot_DynaLoader(pTHX_ CV * cv);
+
+void
+xs_init(pTHX)
+{
+ char myfile[] = __FILE__;
+ char modulename[] = "DynaLoader::boot_DynaLoader";
+ /*
+ * DynaLoader is a special case
+ */
+ newXS(modulename, boot_DynaLoader, myfile);
+}
+
+void
+maybe_source_perl_startup(void)
+{
+ int argc;
+ char **argv;
+ char **env;
+ char *embedargs[] = { NULL, NULL };
+ const char *perl_init_file = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PERL_INIT_FILE);
+ char init_file[SNMP_MAXBUF];
+ int res;
+
+ static int have_done_init = 0;
+
+ if (have_done_init)
+ return;
+ have_done_init = 1;
+
+ embedargs[0] = strdup("");
+ if (!perl_init_file) {
+ snprintf(init_file, sizeof(init_file) - 1,
+ "%s/%s", SNMPSHAREPATH, "snmp_perl.pl");
+ perl_init_file = init_file;
+ }
+ embedargs[1] = strdup(perl_init_file);
+
+ DEBUGMSGTL(("perl", "initializing perl (%s)\n", embedargs[1]));
+ argc = 0;
+ argv = NULL;
+ env = NULL;
+ PERL_SYS_INIT3(&argc, &argv, &env);
+ my_perl = perl_alloc();
+ if (!my_perl) {
+ snmp_log(LOG_ERR,
+ "embedded perl support failed to initialize (perl_alloc())\n");
+ goto bail_out;
+ }
+
+ perl_construct(my_perl);
+
+#ifdef PERL_EXIT_DESTRUCT_END
+ PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
+#endif
+
+ res = perl_parse(my_perl, xs_init, 2, embedargs, NULL);
+ if (res) {
+ snmp_log(LOG_ERR,
+ "embedded perl support failed to initialize (perl_parse(%s)"
+ " returned %d)\n", embedargs[1], res);
+ goto bail_out;
+ }
+
+ res = perl_run(my_perl);
+ if (res) {
+ snmp_log(LOG_ERR,
+ "embedded perl support failed to initialize (perl_run()"
+ " returned %d)\n", res);
+ goto bail_out;
+ }
+
+ free(embedargs[0]);
+ free(embedargs[1]);
+
+ DEBUGMSGTL(("perl", "done initializing perl\n"));
+
+ return;
+
+ bail_out:
+ free(embedargs[0]);
+ free(embedargs[1]);
+ 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) ||
+ my_perl == NULL) {
+ return;
+ }
+ DEBUGMSGTL(("perl", "shutting down perl\n"));
+ perl_destruct(my_perl);
+ my_perl = NULL;
+ DEBUGMSGTL(("perl", "finished shutting down perl\n"));
+}
diff --git a/agent/snmp_perl.h b/agent/snmp_perl.h
new file mode 100644
index 0000000..00fcc1c
--- /dev/null
+++ b/agent/snmp_perl.h
@@ -0,0 +1,15 @@
+#ifndef SNMP_PERL_H
+#define SNMP_PERL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void init_perl(void);
+void shutdown_perl(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SNMP_PERL_H */
diff --git a/agent/snmp_perl.pl b/agent/snmp_perl.pl
new file mode 100644
index 0000000..246d355
--- /dev/null
+++ b/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/agent/snmp_vars.c b/agent/snmp_vars.c
new file mode 100644
index 0000000..c069ab0
--- /dev/null
+++ b/agent/snmp_vars.c
@@ -0,0 +1,463 @@
+/*
+ * 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_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#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>
+#include <errno.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_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 <net-snmp/agent/agent_sysORTable.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"
+
+#if defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL)
+#include <openssl/ssl.h>
+#include <openssl/x509v3.h>
+#include <net-snmp/library/cert_util.h>
+#endif
+
+#include "snmp_perl.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
+
+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)
+ */
+ netsnmp_set_agent_starttime(NULL);
+
+ /*
+ * 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
+ r = init_kmem("/dev/kmem") ? 0 : -EACCES;
+#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();
+ init_agent_sysORTable();
+
+#if defined(USING_AGENTX_SUBAGENT_MODULE) || defined(USING_AGENTX_MASTER_MODULE)
+ /*
+ * initialize agentx configs
+ */
+ agentx_config_init();
+#if defined(USING_AGENTX_SUBAGENT_MODULE)
+ if(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE) == SUB_AGENT)
+ subagent_init();
+#endif
+#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
+
+#if defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL)
+ /** init secname mapping */
+ netsnmp_certs_agent_init();
+#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();
+ shutdown_agent_sysORTable();
+ netsnmp_container_free_list();
+ clear_sec_mod();
+ clear_snmp_enum();
+ clear_callback();
+ shutdown_secmod();
+ netsnmp_addrcache_destroy();
+#ifdef NETSNMP_CAN_USE_NLIST
+ free_kmem();
+#endif
+
+ 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/agent/snmpd.c b/agent/snmpd.c
new file mode 100644
index 0000000..b177d5b
--- /dev/null
+++ b/agent/snmpd.c
@@ -0,0 +1,1517 @@
+/*
+ * 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>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/types.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
+# 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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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
+#ifdef HAVE_CRTDBG_H
+#include <crtdbg.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 <net-snmp/library/large_fd_set.h>
+
+#include "m2m.h"
+#include <net-snmp/agent/agent_module_config.h>
+#include <net-snmp/agent/mib_module_config.h>
+
+#include "snmpd.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include <net-snmp/agent/agent_trap.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_iterator.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
+
+netsnmp_feature_want(logging_file)
+netsnmp_feature_want(logging_stdio)
+netsnmp_feature_want(logging_syslog)
+
+/*
+ * Globals.
+ */
+#ifdef NETSNMP_USE_LIBWRAP
+#include <tcpd.h>
+#endif /* NETSNMP_USE_LIBWRAP */
+
+#define TIMETICK 500000L
+
+int snmp_dump_packet;
+static 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 */
+LPCTSTR app_name_long = _T("Net-SNMP Agent"); /* Application Name */
+#endif
+
+const char *app_name = "snmpd";
+
+extern int netsnmp_running;
+#ifdef USING_UTIL_FUNCS_RESTART_MODULE
+extern char **argvrestartp;
+extern char *argvrestart;
+extern char *argvrestartname;
+#endif /* USING_UTIL_FUNCS_RESTART_MODULE */
+
+#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]"
+ "\n %s [-unregister] [-quiet]", prog, prog);
+#else
+ printf("\nUsage: %s [OPTIONS] [LISTENING ADDRESSES]", prog);
+#endif
+ printf("\n"
+ "\n\tVersion: %s\n%s"
+ "\t\t\t (config search path: %s)\n%s%s",
+ netsnmp_get_version(),
+ "\tWeb: http://www.net-snmp.org/\n"
+ "\tEmail: net-snmp-coders@lists.sourceforge.net\n"
+ "\n -a\t\t\tlog addresses\n"
+ " -A\t\t\tappend to the logfile rather than truncating it\n"
+ " -c FILE[,...]\t\tread FILE(s) as configuration file(s)\n"
+ " -C\t\t\tdo not read the default configuration files\n",
+ get_configuration_directory(),
+ " -d\t\t\tdump sent and received SNMP packets\n"
+ " -D[TOKEN[,...]]\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"
+ " -f\t\t\tdo not fork from the shell\n",
+#if HAVE_UNISTD_H
+ " -g GID\t\tchange to this numeric gid after opening\n"
+ "\t\t\t transport endpoints\n"
+#endif
+ " -h, --help\t\tdisplay this usage message\n"
+ " -H\t\t\tdisplay configuration file directives understood\n"
+ " -I [-]INITLIST\tlist of mib modules to initialize (or not)\n"
+ "\t\t\t (run snmpd with -Dmib_init for a list)\n"
+ " -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"
+ " -M DIRLIST\t\tuse DIRLIST as the list of locations to look for MIBs\n"
+ "\t\t\t (default %s)\n%s%s",
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ netsnmp_get_mib_directory(),
+#else
+ "MIBs not loaded",
+#endif
+ " -p FILE\t\tstore process id in FILE\n"
+ " -q\t\t\tprint information in a more parsable format\n"
+ " -r\t\t\tdo not exit if files only accessible to root\n"
+ "\t\t\t cannot be opened\n"
+#ifdef WIN32SERVICE
+ " -register\t\tregister as a Windows service\n"
+ " \t\t\t (followed by -quiet to prevent message popups)\n"
+ " \t\t\t (followed by the startup parameter list)\n"
+ " \t\t\t Note that some parameters are not relevant when running as a service\n"
+#endif
+#if HAVE_UNISTD_H
+ " -u UID\t\tchange to this uid (numeric or textual) after\n"
+ "\t\t\t opening transport endpoints\n"
+#endif
+#ifdef WIN32SERVICE
+ " -unregister\t\tunregister as a Windows service\n"
+ " \t\t\t (followed -quiet to prevent message popups)\n"
+#endif
+ " -v, --version\t\tdisplay version information\n"
+ " -V\t\t\tverbose display\n"
+#if defined(USING_AGENTX_SUBAGENT_MODULE)|| defined(USING_AGENTX_MASTER_MODULE)
+ " -x ADDRESS\t\tuse ADDRESS as AgentX address\n"
+#endif
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+ " -X\t\t\trun as an AgentX subagent rather than as an\n"
+ "\t\t\t SNMP master agent\n"
+#endif
+ ,
+ "\nDeprecated options:\n"
+ " -l FILE\t\tuse -Lf <FILE> instead\n"
+ " -P\t\t\tuse -p instead\n"
+ " -s\t\t\tuse -Lsd instead\n"
+ " -S d|i|0-7\t\tuse -Ls <facility> instead\n"
+ "\n"
+ );
+ exit(1);
+}
+
+static void
+version(void)
+{
+ printf("\nNET-SNMP version: %s\n"
+ "Web: http://www.net-snmp.org/\n"
+ "Email: net-snmp-coders@lists.sourceforge.net\n\n",
+ netsnmp_get_version());
+ 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();
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+ snmp_enable_syslog();
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+ snmp_log(LOG_ERR, "Exiting on signal %d\n", a);
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+ snmp_disable_syslog();
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_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 agent_mode = -1;
+ char *pid_file = NULL;
+ char option_compatability[] = "-Le";
+#if HAVE_GETPID
+ int fd;
+ FILE *PID;
+#endif
+
+#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;
+ }
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+#ifdef WIN32
+ snmp_log_syslogname(app_name_long);
+#else
+ snmp_log_syslogname(app_name);
+#endif
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+ 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':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET,
+ ++snmp_dump_packet);
+ 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 HAVE_GETGRNAM && HAVE_PWD_H
+ if (*ecp) {
+ struct group *info;
+
+ info = getgrnam(optarg);
+ gid = info ? info->gr_gid : -1;
+ endgrent();
+ }
+#endif
+ if (gid < 0) {
+ fprintf(stderr, "Bad group id: %s\n", optarg);
+ exit(1);
+ }
+ 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;
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+ 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;
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+
+ 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':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT, 1);
+ break;
+
+ case 'r':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS);
+ break;
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+ 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;
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+ 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 HAVE_GETPWNAM && HAVE_PWD_H
+ if (*ecp) {
+ struct passwd *info;
+
+ info = getpwnam(optarg);
+ uid = info ? info->pw_uid : -1;
+ endpwent();
+ }
+#endif
+ if (uid < 0) {
+ fprintf(stderr, "Bad user id: %s\n", optarg);
+ exit(1);
+ }
+ 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) {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ /*
+ * 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 = (char*)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)));
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ fprintf(stderr, "You specified ports to open; this agent was built to only send notifications\n");
+ exit(1);
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ }
+
+#ifdef NETSNMP_LOGFILE
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+ if (0 == log_set)
+ snmp_enable_filelog(NETSNMP_LOGFILE,
+ netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPEND_LOGFILES));
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+#endif
+
+#ifdef USING_UTIL_FUNCS_RESTART_MODULE
+ {
+ /*
+ * Initialize a argv set to the current for restarting the agent.
+ */
+ char *cptr, **argvptr;
+
+ 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]);
+
+ for (cptr = argvrestart, i = 0; i < argc; i++) {
+ strcpy(cptr, argv[i]);
+ *(argvptr++) = cptr;
+ cptr += strlen(argv[i]) + 1;
+ }
+ }
+#endif /* USING_UTIL_FUNCS_RESTART_MODULE */
+
+ if (agent_mode == -1) {
+ if (strstr(argv[0], "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);
+ }
+
+ SOCK_STARTUP;
+ if (init_agent(app_name) != 0) {
+ snmp_log(LOG_ERR, "Agent initialization failed\n");
+ exit(1);
+ }
+ init_mib_modules();
+
+ /*
+ * start library
+ */
+ init_snmp(app_name);
+
+ if ((ret = init_master_agent()) != 0) {
+ /*
+ * Some error opening one of the specified agent transports.
+ */
+ snmp_log(LOG_ERR, "Server Exiting with code 1\n");
+ exit(1);
+ }
+
+ /*
+ * 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,
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+ snmp_stderrlog_status()
+#else /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+ 0
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+ );
+ /*
+ * xxx-rks: do we care if fork fails? I think we should...
+ */
+ if(ret != 0) {
+ snmp_log(LOG_ERR, "Server Exiting with code 1\n");
+ exit(1);
+ }
+ }
+
+#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);
+ }
+#ifndef _MSC_VER
+ /* The sequence open()/fdopen()/fclose()/close() makes MSVC crash,
+ hence skip the close() call when using the MSVC runtime. */
+ close(fd);
+#endif
+ }
+ }
+#endif
+
+#if defined(HAVE_UNISTD_H) && (defined(HAVE_CHOWN) || defined(HAVE_SETGID) || defined(HAVE_SETUID))
+ {
+ const char *persistent_dir;
+ int uid, gid;
+
+ persistent_dir = get_persistent_directory();
+ mkdirhier( persistent_dir, 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( persistent_dir, 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) {
+#if HAVE_GETPWNAM && HAVE_PWD_H && HAVE_INITGROUPS
+ struct passwd *info;
+
+ /*
+ * Set supplementary groups before changing UID
+ * (which probably involves giving up privileges)
+ */
+ info = getpwuid(uid);
+ if (info) {
+ DEBUGMSGTL(("snmpd/main", "Supplementary groups for %s.\n", info->pw_name));
+ if (initgroups(info->pw_name, (gid != 0 ? (gid_t)gid : info->pw_gid)) == -1) {
+ snmp_log_perror("initgroups failed");
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ exit(1);
+ }
+ }
+ }
+ endpwent();
+#endif
+ 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);
+ shutdown_master_agent();
+ shutdown_agent();
+
+ 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
+
+#ifdef USING_UTIL_FUNCS_RESTART_MODULE
+ SNMP_FREE(argvrestartname);
+ SNMP_FREE(argvrestart);
+ SNMP_FREE(argvrestartp);
+#endif /* USING_UTIL_FUNCS_RESTART_MODULE */
+
+ SOCK_CLEANUP;
+ return 0;
+} /* End main() -- snmpd */
+
+#if defined(WIN32)
+
+#include <process.h>
+#include <net-snmp/library/snmp_assert.h>
+
+static unsigned s_threadid;
+HANDLE s_thread_handle;
+
+static unsigned __stdcall wait_for_stdin(void* arg)
+{
+ if (getc(stdin) != EOF)
+ netsnmp_running = 0;
+ return 0;
+}
+
+static void create_stdin_waiter_thread(void)
+{
+ netsnmp_assert(s_thread_handle == 0);
+ s_thread_handle = (HANDLE)_beginthreadex(0, 0, wait_for_stdin, 0, 0, &s_threadid);
+ netsnmp_assert(s_thread_handle != 0);
+}
+
+static void join_stdin_waiter_thread(void)
+{
+ int result;
+
+ netsnmp_assert(s_thread_handle != 0);
+ result = WaitForSingleObject(s_thread_handle, 1000);
+ netsnmp_assert(result != WAIT_TIMEOUT);
+ CloseHandle(s_thread_handle);
+ s_thread_handle = 0;
+}
+#endif
+
+/*******************************************************************-o-******
+ * receive
+ *
+ * Parameters:
+ *
+ * Returns:
+ * 0 On success.
+ * -1 System error.
+ *
+ * Infinite while-loop which monitors incoming messages for the agent.
+ * Invoke the established message handlers for incoming messages on a per
+ * port basis. Handle timeouts.
+ */
+static int
+receive(void)
+{
+ int numfds;
+ netsnmp_large_fd_set readfds, writefds, exceptfds;
+ struct timeval timeout, *tvp = &timeout;
+ int count, block, i;
+#ifdef USING_SMUX_MODULE
+ int sd;
+#endif /* USING_SMUX_MODULE */
+
+ netsnmp_large_fd_set_init(&readfds, FD_SETSIZE);
+ netsnmp_large_fd_set_init(&writefds, FD_SETSIZE);
+ netsnmp_large_fd_set_init(&exceptfds, FD_SETSIZE);
+
+ /*
+ * ignore early sighup during startup
+ */
+ reconfig = 0;
+
+#if defined(WIN32)
+ create_stdin_waiter_thread();
+#endif
+
+ /*
+ * 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
+ }
+
+ /*
+ * 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;
+ NETSNMP_LARGE_FD_ZERO(&readfds);
+ NETSNMP_LARGE_FD_ZERO(&writefds);
+ NETSNMP_LARGE_FD_ZERO(&exceptfds);
+ block = 0;
+ snmp_select_info2(&numfds, &readfds, tvp, &block);
+ if (block == 1) {
+ tvp = NULL; /* block without timeout */
+ }
+
+#ifdef USING_SMUX_MODULE
+ if (smux_listen_sd >= 0) {
+ NETSNMP_LARGE_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)
+ {
+ NETSNMP_LARGE_FD_SET(sd, &readfds);
+ numfds = sd >= numfds ? sd + 1 : numfds;
+ }
+ }
+ }
+#endif /* USING_SMUX_MODULE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER
+ netsnmp_external_event_info2(&numfds, &readfds, &writefds, &exceptfds);
+#endif /* NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER */
+
+ reselect:
+ for (i = 0; i < NUM_EXTERNAL_SIGS; i++) {
+ if (external_signal_scheduled[i]) {
+ external_signal_scheduled[i]--;
+ external_signal_handler[i](i);
+ }
+ }
+
+ DEBUGMSGTL(("snmpd/select", "select( numfds=%d, ..., tvp=%p)\n",
+ numfds, tvp));
+ if (tvp)
+ DEBUGMSGTL(("timer", "tvp %ld.%ld\n", (long) tvp->tv_sec,
+ (long) tvp->tv_usec));
+ count = netsnmp_large_fd_set_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 (NETSNMP_LARGE_FD_ISSET(sd, &readfds)) {
+ if (smux_process(sd) < 0) {
+ smux_snmp_select_list_del(sd);
+ }
+ }
+ }
+ /*
+ * new connection
+ */
+ if (NETSNMP_LARGE_FD_ISSET(smux_listen_sd, &readfds)) {
+ if ((sd = smux_accept(smux_listen_sd)) >= 0) {
+ smux_snmp_select_list_add(sd);
+ }
+ }
+ }
+
+#endif /* USING_SMUX_MODULE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER
+ netsnmp_dispatch_external_events2(&count, &readfds,
+ &writefds, &exceptfds);
+#endif /* NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER */
+
+ /* If there are still events leftover, process them */
+ if (count > 0) {
+ snmp_read2(&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 */
+
+ /*
+ * see if persistent store needs to be saved
+ */
+ snmp_store_if_needed();
+
+ /*
+ * run requested alarms
+ */
+ run_alarms();
+
+ netsnmp_check_outstanding_agent_requests();
+
+ } /* endwhile */
+
+ netsnmp_large_fd_set_cleanup(&readfds);
+ netsnmp_large_fd_set_cleanup(&writefds);
+ netsnmp_large_fd_set_cleanup(&exceptfds);
+
+#if defined(WIN32)
+ join_stdin_waiter_thread();
+#endif
+
+ 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;
+
+#if 0
+ _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF /*| _CRTDBG_CHECK_ALWAYS_DF*/);
+#endif
+
+ 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/agent/snmpd.h b/agent/snmpd.h
new file mode 100644
index 0000000..89bcd31
--- /dev/null
+++ b/agent/snmpd.h
@@ -0,0 +1,27 @@
+/*
+ * snmpd.h
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#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 *);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/apps/Makefile.depend b/apps/Makefile.depend
new file mode 100644
index 0000000..b507930
--- /dev/null
+++ b/apps/Makefile.depend
@@ -0,0 +1,2081 @@
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+./agentxtrap.lo: ../include/net-snmp/net-snmp-config.h
+./agentxtrap.lo: ../include/net-snmp/system/linux.h
+./agentxtrap.lo: ../include/net-snmp/system/sysv.h
+./agentxtrap.lo: ../include/net-snmp/system/generic.h
+./agentxtrap.lo: ../include/net-snmp/net-snmp-features.h
+./agentxtrap.lo: ../include/net-snmp/net-snmp-includes.h
+./agentxtrap.lo: ../include/net-snmp/definitions.h
+./agentxtrap.lo: ../include/net-snmp/types.h
+./agentxtrap.lo: ../include/net-snmp/library/oid.h
+./agentxtrap.lo: ../include/net-snmp/library/types.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_api.h
+./agentxtrap.lo: ../include/net-snmp/varbind_api.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_client.h
+./agentxtrap.lo: ../include/net-snmp/pdu_api.h
+./agentxtrap.lo: ../include/net-snmp/library/asn1.h
+./agentxtrap.lo: ../include/net-snmp/output_api.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_debug.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_logging.h
+./agentxtrap.lo: ../include/net-snmp/session_api.h
+./agentxtrap.lo: ../include/net-snmp/library/callback.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_transport.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_service.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./agentxtrap.lo: ../include/net-snmp/library/ucd_compat.h
+./agentxtrap.lo: ../include/net-snmp/library/mib.h
+./agentxtrap.lo: ../include/net-snmp/mib_api.h
+./agentxtrap.lo: ../include/net-snmp/library/parse.h
+./agentxtrap.lo: ../include/net-snmp/library/oid_stash.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_impl.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp-tc.h
+./agentxtrap.lo: ../include/net-snmp/library/getopt.h
+./agentxtrap.lo: ../include/net-snmp/utilities.h
+./agentxtrap.lo: ../include/net-snmp/library/system.h
+./agentxtrap.lo: ../include/net-snmp/library/tools.h
+./agentxtrap.lo: ../include/net-snmp/library/int64.h
+./agentxtrap.lo: ../include/net-snmp/library/mt_support.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_alarm.h
+./agentxtrap.lo: ../include/net-snmp/library/data_list.h
+./agentxtrap.lo: ../include/net-snmp/library/check_varbind.h
+./agentxtrap.lo: ../include/net-snmp/library/container.h
+./agentxtrap.lo: ../include/net-snmp/library/factory.h
+./agentxtrap.lo: ../include/net-snmp/library/container_binary_array.h
+./agentxtrap.lo: ../include/net-snmp/library/container_list_ssll.h
+./agentxtrap.lo: ../include/net-snmp/library/container_iterator.h
+./agentxtrap.lo: ../include/net-snmp/library/container.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_assert.h
+./agentxtrap.lo: ../include/net-snmp/version.h
+./agentxtrap.lo: ../include/net-snmp/config_api.h
+./agentxtrap.lo: ../include/net-snmp/library/read_config.h
+./agentxtrap.lo: ../include/net-snmp/library/default_store.h
+./agentxtrap.lo: ../include/net-snmp/net-snmp-config.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_parse_args.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_enum.h
+./agentxtrap.lo: ../include/net-snmp/library/vacm.h
+./agentxtrap.lo: ../include/net-snmp/snmpv3_api.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpv3.h
+./agentxtrap.lo: ../include/net-snmp/library/transform_oids.h
+./agentxtrap.lo: ../include/net-snmp/library/keytools.h
+./agentxtrap.lo: ../include/net-snmp/library/scapi.h
+./agentxtrap.lo: ../include/net-snmp/library/lcd_time.h
+./agentxtrap.lo: ../include/net-snmp/library/snmp_secmod.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./agentxtrap.lo: ../include/net-snmp/library/snmptsm.h
+./agentxtrap.lo: ../include/net-snmp/library/snmpusm.h
+./agentxtrap.lo: ../include/net-snmp/agent/ds_agent.h
+./agentxtrap.lo: ../agent/mibgroup/agentx/agentx_config.h
+./agentxtrap.lo: ../agent/mibgroup/agentx/client.h
+./agentxtrap.lo: ../agent/mibgroup/agentx/protocol.h
+./encode_keychange.lo: ../include/net-snmp/net-snmp-config.h
+./encode_keychange.lo: ../include/net-snmp/net-snmp-includes.h
+./encode_keychange.lo: ../include/net-snmp/definitions.h
+./encode_keychange.lo: ../include/net-snmp/types.h
+./encode_keychange.lo: ../include/net-snmp/library/oid.h
+./encode_keychange.lo: ../include/net-snmp/library/types.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_api.h
+./encode_keychange.lo: ../include/net-snmp/varbind_api.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_client.h
+./encode_keychange.lo: ../include/net-snmp/pdu_api.h
+./encode_keychange.lo: ../include/net-snmp/library/asn1.h
+./encode_keychange.lo: ../include/net-snmp/output_api.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_debug.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_logging.h
+./encode_keychange.lo: ../include/net-snmp/session_api.h
+./encode_keychange.lo: ../include/net-snmp/library/callback.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_transport.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_service.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./encode_keychange.lo: ../include/net-snmp/library/ucd_compat.h
+./encode_keychange.lo: ../include/net-snmp/library/mib.h
+./encode_keychange.lo: ../include/net-snmp/mib_api.h
+./encode_keychange.lo: ../include/net-snmp/library/parse.h
+./encode_keychange.lo: ../include/net-snmp/library/oid_stash.h
+./encode_keychange.lo: ../include/net-snmp/net-snmp-features.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_impl.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp-tc.h
+./encode_keychange.lo: ../include/net-snmp/library/getopt.h
+./encode_keychange.lo: ../include/net-snmp/utilities.h
+./encode_keychange.lo: ../include/net-snmp/library/system.h
+./encode_keychange.lo: ../include/net-snmp/library/tools.h
+./encode_keychange.lo: ../include/net-snmp/library/int64.h
+./encode_keychange.lo: ../include/net-snmp/library/mt_support.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_alarm.h
+./encode_keychange.lo: ../include/net-snmp/library/data_list.h
+./encode_keychange.lo: ../include/net-snmp/library/check_varbind.h
+./encode_keychange.lo: ../include/net-snmp/library/container.h
+./encode_keychange.lo: ../include/net-snmp/library/factory.h
+./encode_keychange.lo: ../include/net-snmp/library/container_binary_array.h
+./encode_keychange.lo: ../include/net-snmp/library/container_list_ssll.h
+./encode_keychange.lo: ../include/net-snmp/library/container_iterator.h
+./encode_keychange.lo: ../include/net-snmp/library/container.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_assert.h
+./encode_keychange.lo: ../include/net-snmp/version.h
+./encode_keychange.lo: ../include/net-snmp/config_api.h
+./encode_keychange.lo: ../include/net-snmp/library/read_config.h
+./encode_keychange.lo: ../include/net-snmp/library/default_store.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_parse_args.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_enum.h
+./encode_keychange.lo: ../include/net-snmp/library/vacm.h
+./encode_keychange.lo: ../include/net-snmp/snmpv3_api.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpv3.h
+./encode_keychange.lo: ../include/net-snmp/library/transform_oids.h
+./encode_keychange.lo: ../include/net-snmp/library/keytools.h
+./encode_keychange.lo: ../include/net-snmp/library/scapi.h
+./encode_keychange.lo: ../include/net-snmp/library/lcd_time.h
+./encode_keychange.lo: ../include/net-snmp/library/snmp_secmod.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./encode_keychange.lo: ../include/net-snmp/library/snmptsm.h
+./encode_keychange.lo: ../include/net-snmp/library/snmpusm.h
+./snmpbulkget.lo: ../include/net-snmp/net-snmp-config.h
+./snmpbulkget.lo: ../include/net-snmp/utilities.h
+./snmpbulkget.lo: ../include/net-snmp/types.h
+./snmpbulkget.lo: ../include/net-snmp/library/oid.h
+./snmpbulkget.lo: ../include/net-snmp/library/types.h
+./snmpbulkget.lo: ../include/net-snmp/definitions.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_api.h
+./snmpbulkget.lo: ../include/net-snmp/varbind_api.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_client.h
+./snmpbulkget.lo: ../include/net-snmp/pdu_api.h
+./snmpbulkget.lo: ../include/net-snmp/library/asn1.h
+./snmpbulkget.lo: ../include/net-snmp/output_api.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpbulkget.lo: ../include/net-snmp/session_api.h
+./snmpbulkget.lo: ../include/net-snmp/library/callback.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_service.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpbulkget.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpbulkget.lo: ../include/net-snmp/library/mib.h
+./snmpbulkget.lo: ../include/net-snmp/mib_api.h
+./snmpbulkget.lo: ../include/net-snmp/library/parse.h
+./snmpbulkget.lo: ../include/net-snmp/library/oid_stash.h
+./snmpbulkget.lo: ../include/net-snmp/net-snmp-features.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpbulkget.lo: ../include/net-snmp/library/system.h
+./snmpbulkget.lo: ../include/net-snmp/library/tools.h
+./snmpbulkget.lo: ../include/net-snmp/library/int64.h
+./snmpbulkget.lo: ../include/net-snmp/library/mt_support.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpbulkget.lo: ../include/net-snmp/library/data_list.h
+./snmpbulkget.lo: ../include/net-snmp/library/check_varbind.h
+./snmpbulkget.lo: ../include/net-snmp/library/container.h
+./snmpbulkget.lo: ../include/net-snmp/library/factory.h
+./snmpbulkget.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpbulkget.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpbulkget.lo: ../include/net-snmp/library/container_iterator.h
+./snmpbulkget.lo: ../include/net-snmp/library/container.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpbulkget.lo: ../include/net-snmp/version.h
+./snmpbulkget.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpbulkget.lo: ../include/net-snmp/library/getopt.h
+./snmpbulkget.lo: ../include/net-snmp/config_api.h
+./snmpbulkget.lo: ../include/net-snmp/library/read_config.h
+./snmpbulkget.lo: ../include/net-snmp/library/default_store.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpbulkget.lo: ../include/net-snmp/library/vacm.h
+./snmpbulkget.lo: ../include/net-snmp/snmpv3_api.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpv3.h
+./snmpbulkget.lo: ../include/net-snmp/library/transform_oids.h
+./snmpbulkget.lo: ../include/net-snmp/library/keytools.h
+./snmpbulkget.lo: ../include/net-snmp/library/scapi.h
+./snmpbulkget.lo: ../include/net-snmp/library/lcd_time.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmptsm.h
+./snmpbulkget.lo: ../include/net-snmp/library/snmpusm.h
+./snmpbulkwalk.lo: ../include/net-snmp/net-snmp-config.h
+./snmpbulkwalk.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpbulkwalk.lo: ../include/net-snmp/definitions.h
+./snmpbulkwalk.lo: ../include/net-snmp/types.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/oid.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/types.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_api.h
+./snmpbulkwalk.lo: ../include/net-snmp/varbind_api.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_client.h
+./snmpbulkwalk.lo: ../include/net-snmp/pdu_api.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/asn1.h
+./snmpbulkwalk.lo: ../include/net-snmp/output_api.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpbulkwalk.lo: ../include/net-snmp/session_api.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/callback.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_service.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/mib.h
+./snmpbulkwalk.lo: ../include/net-snmp/mib_api.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/parse.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/oid_stash.h
+./snmpbulkwalk.lo: ../include/net-snmp/net-snmp-features.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/getopt.h
+./snmpbulkwalk.lo: ../include/net-snmp/utilities.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/system.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/tools.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/int64.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/mt_support.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/data_list.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/check_varbind.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/container.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/factory.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/container_iterator.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/container.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpbulkwalk.lo: ../include/net-snmp/version.h
+./snmpbulkwalk.lo: ../include/net-snmp/config_api.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/read_config.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/default_store.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/vacm.h
+./snmpbulkwalk.lo: ../include/net-snmp/snmpv3_api.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpv3.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/transform_oids.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/keytools.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/scapi.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/lcd_time.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmptsm.h
+./snmpbulkwalk.lo: ../include/net-snmp/library/snmpusm.h
+./snmpdelta.lo: ../include/net-snmp/net-snmp-config.h
+./snmpdelta.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpdelta.lo: ../include/net-snmp/definitions.h
+./snmpdelta.lo: ../include/net-snmp/types.h
+./snmpdelta.lo: ../include/net-snmp/library/oid.h
+./snmpdelta.lo: ../include/net-snmp/library/types.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_api.h
+./snmpdelta.lo: ../include/net-snmp/varbind_api.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_client.h
+./snmpdelta.lo: ../include/net-snmp/pdu_api.h
+./snmpdelta.lo: ../include/net-snmp/library/asn1.h
+./snmpdelta.lo: ../include/net-snmp/output_api.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpdelta.lo: ../include/net-snmp/session_api.h
+./snmpdelta.lo: ../include/net-snmp/library/callback.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_service.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpdelta.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpdelta.lo: ../include/net-snmp/library/mib.h
+./snmpdelta.lo: ../include/net-snmp/mib_api.h
+./snmpdelta.lo: ../include/net-snmp/library/parse.h
+./snmpdelta.lo: ../include/net-snmp/library/oid_stash.h
+./snmpdelta.lo: ../include/net-snmp/net-snmp-features.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpdelta.lo: ../include/net-snmp/library/getopt.h
+./snmpdelta.lo: ../include/net-snmp/utilities.h
+./snmpdelta.lo: ../include/net-snmp/library/system.h
+./snmpdelta.lo: ../include/net-snmp/library/tools.h
+./snmpdelta.lo: ../include/net-snmp/library/int64.h
+./snmpdelta.lo: ../include/net-snmp/library/mt_support.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpdelta.lo: ../include/net-snmp/library/data_list.h
+./snmpdelta.lo: ../include/net-snmp/library/check_varbind.h
+./snmpdelta.lo: ../include/net-snmp/library/container.h
+./snmpdelta.lo: ../include/net-snmp/library/factory.h
+./snmpdelta.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpdelta.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpdelta.lo: ../include/net-snmp/library/container_iterator.h
+./snmpdelta.lo: ../include/net-snmp/library/container.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpdelta.lo: ../include/net-snmp/version.h
+./snmpdelta.lo: ../include/net-snmp/config_api.h
+./snmpdelta.lo: ../include/net-snmp/library/read_config.h
+./snmpdelta.lo: ../include/net-snmp/library/default_store.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpdelta.lo: ../include/net-snmp/library/vacm.h
+./snmpdelta.lo: ../include/net-snmp/snmpv3_api.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpv3.h
+./snmpdelta.lo: ../include/net-snmp/library/transform_oids.h
+./snmpdelta.lo: ../include/net-snmp/library/keytools.h
+./snmpdelta.lo: ../include/net-snmp/library/scapi.h
+./snmpdelta.lo: ../include/net-snmp/library/lcd_time.h
+./snmpdelta.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpdelta.lo: ../include/net-snmp/library/snmptsm.h
+./snmpdelta.lo: ../include/net-snmp/library/snmpusm.h
+./snmpdf.lo: ../include/net-snmp/net-snmp-config.h
+./snmpdf.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpdf.lo: ../include/net-snmp/definitions.h
+./snmpdf.lo: ../include/net-snmp/types.h
+./snmpdf.lo: ../include/net-snmp/library/oid.h
+./snmpdf.lo: ../include/net-snmp/library/types.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_api.h
+./snmpdf.lo: ../include/net-snmp/varbind_api.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_client.h
+./snmpdf.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./snmpdf.lo: ../include/net-snmp/output_api.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpdf.lo: ../include/net-snmp/session_api.h
+./snmpdf.lo: ../include/net-snmp/library/callback.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_service.h
+./snmpdf.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpdf.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpdf.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpdf.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpdf.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpdf.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpdf.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpdf.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpdf.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpdf.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpdf.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpdf.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmpdf.lo: ../include/net-snmp/library/parse.h
+./snmpdf.lo: ../include/net-snmp/library/oid_stash.h
+./snmpdf.lo: ../include/net-snmp/net-snmp-features.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpdf.lo: ../include/net-snmp/library/snmp.h
+./snmpdf.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpdf.lo: ../include/net-snmp/library/getopt.h
+./snmpdf.lo: ../include/net-snmp/utilities.h
+./snmpdf.lo: ../include/net-snmp/library/system.h
+./snmpdf.lo: ../include/net-snmp/library/tools.h
+./snmpdf.lo: ../include/net-snmp/library/int64.h
+./snmpdf.lo: ../include/net-snmp/library/mt_support.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpdf.lo: ../include/net-snmp/library/data_list.h
+./snmpdf.lo: ../include/net-snmp/library/check_varbind.h
+./snmpdf.lo: ../include/net-snmp/library/container.h
+./snmpdf.lo: ../include/net-snmp/library/factory.h
+./snmpdf.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpdf.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpdf.lo: ../include/net-snmp/library/container_iterator.h
+./snmpdf.lo: ../include/net-snmp/library/container.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpdf.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./snmpdf.lo: ../include/net-snmp/library/read_config.h
+./snmpdf.lo: ../include/net-snmp/library/default_store.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpdf.lo: ../include/net-snmp/library/vacm.h
+./snmpdf.lo: ../include/net-snmp/snmpv3_api.h
+./snmpdf.lo: ../include/net-snmp/library/snmpv3.h
+./snmpdf.lo: ../include/net-snmp/library/transform_oids.h
+./snmpdf.lo: ../include/net-snmp/library/keytools.h
+./snmpdf.lo: ../include/net-snmp/library/scapi.h
+./snmpdf.lo: ../include/net-snmp/library/lcd_time.h
+./snmpdf.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpdf.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpdf.lo: ../include/net-snmp/library/snmptsm.h
+./snmpdf.lo: ../include/net-snmp/library/snmpusm.h
+./snmpget.lo: ../include/net-snmp/net-snmp-config.h
+./snmpget.lo: ../include/net-snmp/utilities.h ../include/net-snmp/types.h
+./snmpget.lo: ../include/net-snmp/library/oid.h
+./snmpget.lo: ../include/net-snmp/library/types.h
+./snmpget.lo: ../include/net-snmp/definitions.h
+./snmpget.lo: ../include/net-snmp/library/snmp_api.h
+./snmpget.lo: ../include/net-snmp/varbind_api.h
+./snmpget.lo: ../include/net-snmp/library/snmp_client.h
+./snmpget.lo: ../include/net-snmp/pdu_api.h
+./snmpget.lo: ../include/net-snmp/library/asn1.h
+./snmpget.lo: ../include/net-snmp/output_api.h
+./snmpget.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpget.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpget.lo: ../include/net-snmp/session_api.h
+./snmpget.lo: ../include/net-snmp/library/callback.h
+./snmpget.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpget.lo: ../include/net-snmp/library/snmp_service.h
+./snmpget.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpget.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpget.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpget.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpget.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpget.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpget.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpget.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpget.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpget.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpget.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpget.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmpget.lo: ../include/net-snmp/library/parse.h
+./snmpget.lo: ../include/net-snmp/library/oid_stash.h
+./snmpget.lo: ../include/net-snmp/net-snmp-features.h
+./snmpget.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpget.lo: ../include/net-snmp/library/snmp.h
+./snmpget.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpget.lo: ../include/net-snmp/library/system.h
+./snmpget.lo: ../include/net-snmp/library/tools.h
+./snmpget.lo: ../include/net-snmp/library/int64.h
+./snmpget.lo: ../include/net-snmp/library/mt_support.h
+./snmpget.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpget.lo: ../include/net-snmp/library/data_list.h
+./snmpget.lo: ../include/net-snmp/library/check_varbind.h
+./snmpget.lo: ../include/net-snmp/library/container.h
+./snmpget.lo: ../include/net-snmp/library/factory.h
+./snmpget.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpget.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpget.lo: ../include/net-snmp/library/container_iterator.h
+./snmpget.lo: ../include/net-snmp/library/container.h
+./snmpget.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpget.lo: ../include/net-snmp/version.h
+./snmpget.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpget.lo: ../include/net-snmp/library/getopt.h
+./snmpget.lo: ../include/net-snmp/config_api.h
+./snmpget.lo: ../include/net-snmp/library/read_config.h
+./snmpget.lo: ../include/net-snmp/library/default_store.h
+./snmpget.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpget.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpget.lo: ../include/net-snmp/library/vacm.h
+./snmpget.lo: ../include/net-snmp/snmpv3_api.h
+./snmpget.lo: ../include/net-snmp/library/snmpv3.h
+./snmpget.lo: ../include/net-snmp/library/transform_oids.h
+./snmpget.lo: ../include/net-snmp/library/keytools.h
+./snmpget.lo: ../include/net-snmp/library/scapi.h
+./snmpget.lo: ../include/net-snmp/library/lcd_time.h
+./snmpget.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpget.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpget.lo: ../include/net-snmp/library/snmptsm.h
+./snmpget.lo: ../include/net-snmp/library/snmpusm.h
+./snmpgetnext.lo: ../include/net-snmp/net-snmp-config.h
+./snmpgetnext.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpgetnext.lo: ../include/net-snmp/definitions.h
+./snmpgetnext.lo: ../include/net-snmp/types.h
+./snmpgetnext.lo: ../include/net-snmp/library/oid.h
+./snmpgetnext.lo: ../include/net-snmp/library/types.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_api.h
+./snmpgetnext.lo: ../include/net-snmp/varbind_api.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_client.h
+./snmpgetnext.lo: ../include/net-snmp/pdu_api.h
+./snmpgetnext.lo: ../include/net-snmp/library/asn1.h
+./snmpgetnext.lo: ../include/net-snmp/output_api.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpgetnext.lo: ../include/net-snmp/session_api.h
+./snmpgetnext.lo: ../include/net-snmp/library/callback.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_service.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpgetnext.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpgetnext.lo: ../include/net-snmp/library/mib.h
+./snmpgetnext.lo: ../include/net-snmp/mib_api.h
+./snmpgetnext.lo: ../include/net-snmp/library/parse.h
+./snmpgetnext.lo: ../include/net-snmp/library/oid_stash.h
+./snmpgetnext.lo: ../include/net-snmp/net-snmp-features.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpgetnext.lo: ../include/net-snmp/library/getopt.h
+./snmpgetnext.lo: ../include/net-snmp/utilities.h
+./snmpgetnext.lo: ../include/net-snmp/library/system.h
+./snmpgetnext.lo: ../include/net-snmp/library/tools.h
+./snmpgetnext.lo: ../include/net-snmp/library/int64.h
+./snmpgetnext.lo: ../include/net-snmp/library/mt_support.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpgetnext.lo: ../include/net-snmp/library/data_list.h
+./snmpgetnext.lo: ../include/net-snmp/library/check_varbind.h
+./snmpgetnext.lo: ../include/net-snmp/library/container.h
+./snmpgetnext.lo: ../include/net-snmp/library/factory.h
+./snmpgetnext.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpgetnext.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpgetnext.lo: ../include/net-snmp/library/container_iterator.h
+./snmpgetnext.lo: ../include/net-snmp/library/container.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpgetnext.lo: ../include/net-snmp/version.h
+./snmpgetnext.lo: ../include/net-snmp/config_api.h
+./snmpgetnext.lo: ../include/net-snmp/library/read_config.h
+./snmpgetnext.lo: ../include/net-snmp/library/default_store.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpgetnext.lo: ../include/net-snmp/library/vacm.h
+./snmpgetnext.lo: ../include/net-snmp/snmpv3_api.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpv3.h
+./snmpgetnext.lo: ../include/net-snmp/library/transform_oids.h
+./snmpgetnext.lo: ../include/net-snmp/library/keytools.h
+./snmpgetnext.lo: ../include/net-snmp/library/scapi.h
+./snmpgetnext.lo: ../include/net-snmp/library/lcd_time.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmptsm.h
+./snmpgetnext.lo: ../include/net-snmp/library/snmpusm.h
+./snmpset.lo: ../include/net-snmp/net-snmp-config.h
+./snmpset.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpset.lo: ../include/net-snmp/definitions.h
+./snmpset.lo: ../include/net-snmp/types.h
+./snmpset.lo: ../include/net-snmp/library/oid.h
+./snmpset.lo: ../include/net-snmp/library/types.h
+./snmpset.lo: ../include/net-snmp/library/snmp_api.h
+./snmpset.lo: ../include/net-snmp/varbind_api.h
+./snmpset.lo: ../include/net-snmp/library/snmp_client.h
+./snmpset.lo: ../include/net-snmp/pdu_api.h
+./snmpset.lo: ../include/net-snmp/library/asn1.h
+./snmpset.lo: ../include/net-snmp/output_api.h
+./snmpset.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpset.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpset.lo: ../include/net-snmp/session_api.h
+./snmpset.lo: ../include/net-snmp/library/callback.h
+./snmpset.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpset.lo: ../include/net-snmp/library/snmp_service.h
+./snmpset.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpset.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpset.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpset.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpset.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpset.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpset.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpset.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpset.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpset.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpset.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpset.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmpset.lo: ../include/net-snmp/library/parse.h
+./snmpset.lo: ../include/net-snmp/library/oid_stash.h
+./snmpset.lo: ../include/net-snmp/net-snmp-features.h
+./snmpset.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpset.lo: ../include/net-snmp/library/snmp.h
+./snmpset.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpset.lo: ../include/net-snmp/library/getopt.h
+./snmpset.lo: ../include/net-snmp/utilities.h
+./snmpset.lo: ../include/net-snmp/library/system.h
+./snmpset.lo: ../include/net-snmp/library/tools.h
+./snmpset.lo: ../include/net-snmp/library/int64.h
+./snmpset.lo: ../include/net-snmp/library/mt_support.h
+./snmpset.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpset.lo: ../include/net-snmp/library/data_list.h
+./snmpset.lo: ../include/net-snmp/library/check_varbind.h
+./snmpset.lo: ../include/net-snmp/library/container.h
+./snmpset.lo: ../include/net-snmp/library/factory.h
+./snmpset.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpset.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpset.lo: ../include/net-snmp/library/container_iterator.h
+./snmpset.lo: ../include/net-snmp/library/container.h
+./snmpset.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpset.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./snmpset.lo: ../include/net-snmp/library/read_config.h
+./snmpset.lo: ../include/net-snmp/library/default_store.h
+./snmpset.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpset.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpset.lo: ../include/net-snmp/library/vacm.h
+./snmpset.lo: ../include/net-snmp/snmpv3_api.h
+./snmpset.lo: ../include/net-snmp/library/snmpv3.h
+./snmpset.lo: ../include/net-snmp/library/transform_oids.h
+./snmpset.lo: ../include/net-snmp/library/keytools.h
+./snmpset.lo: ../include/net-snmp/library/scapi.h
+./snmpset.lo: ../include/net-snmp/library/lcd_time.h
+./snmpset.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpset.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpset.lo: ../include/net-snmp/library/snmptsm.h
+./snmpset.lo: ../include/net-snmp/library/snmpusm.h
+./snmpstatus.lo: ../include/net-snmp/net-snmp-config.h
+./snmpstatus.lo: ../include/net-snmp/utilities.h ../include/net-snmp/types.h
+./snmpstatus.lo: ../include/net-snmp/library/oid.h
+./snmpstatus.lo: ../include/net-snmp/library/types.h
+./snmpstatus.lo: ../include/net-snmp/definitions.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_api.h
+./snmpstatus.lo: ../include/net-snmp/varbind_api.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_client.h
+./snmpstatus.lo: ../include/net-snmp/pdu_api.h
+./snmpstatus.lo: ../include/net-snmp/library/asn1.h
+./snmpstatus.lo: ../include/net-snmp/output_api.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpstatus.lo: ../include/net-snmp/session_api.h
+./snmpstatus.lo: ../include/net-snmp/library/callback.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_service.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpstatus.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpstatus.lo: ../include/net-snmp/library/mib.h
+./snmpstatus.lo: ../include/net-snmp/mib_api.h
+./snmpstatus.lo: ../include/net-snmp/library/parse.h
+./snmpstatus.lo: ../include/net-snmp/library/oid_stash.h
+./snmpstatus.lo: ../include/net-snmp/net-snmp-features.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpstatus.lo: ../include/net-snmp/library/system.h
+./snmpstatus.lo: ../include/net-snmp/library/tools.h
+./snmpstatus.lo: ../include/net-snmp/library/int64.h
+./snmpstatus.lo: ../include/net-snmp/library/mt_support.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpstatus.lo: ../include/net-snmp/library/data_list.h
+./snmpstatus.lo: ../include/net-snmp/library/check_varbind.h
+./snmpstatus.lo: ../include/net-snmp/library/container.h
+./snmpstatus.lo: ../include/net-snmp/library/factory.h
+./snmpstatus.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpstatus.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpstatus.lo: ../include/net-snmp/library/container_iterator.h
+./snmpstatus.lo: ../include/net-snmp/library/container.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpstatus.lo: ../include/net-snmp/version.h
+./snmpstatus.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpstatus.lo: ../include/net-snmp/library/getopt.h
+./snmpstatus.lo: ../include/net-snmp/config_api.h
+./snmpstatus.lo: ../include/net-snmp/library/read_config.h
+./snmpstatus.lo: ../include/net-snmp/library/default_store.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpstatus.lo: ../include/net-snmp/library/vacm.h
+./snmpstatus.lo: ../include/net-snmp/snmpv3_api.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpv3.h
+./snmpstatus.lo: ../include/net-snmp/library/transform_oids.h
+./snmpstatus.lo: ../include/net-snmp/library/keytools.h
+./snmpstatus.lo: ../include/net-snmp/library/scapi.h
+./snmpstatus.lo: ../include/net-snmp/library/lcd_time.h
+./snmpstatus.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpstatus.lo: ../include/net-snmp/library/snmptsm.h
+./snmpstatus.lo: ../include/net-snmp/library/snmpusm.h
+./snmptable.lo: ../include/net-snmp/net-snmp-config.h
+./snmptable.lo: ../include/net-snmp/net-snmp-includes.h
+./snmptable.lo: ../include/net-snmp/definitions.h
+./snmptable.lo: ../include/net-snmp/types.h
+./snmptable.lo: ../include/net-snmp/library/oid.h
+./snmptable.lo: ../include/net-snmp/library/types.h
+./snmptable.lo: ../include/net-snmp/library/snmp_api.h
+./snmptable.lo: ../include/net-snmp/varbind_api.h
+./snmptable.lo: ../include/net-snmp/library/snmp_client.h
+./snmptable.lo: ../include/net-snmp/pdu_api.h
+./snmptable.lo: ../include/net-snmp/library/asn1.h
+./snmptable.lo: ../include/net-snmp/output_api.h
+./snmptable.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptable.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptable.lo: ../include/net-snmp/session_api.h
+./snmptable.lo: ../include/net-snmp/library/callback.h
+./snmptable.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptable.lo: ../include/net-snmp/library/snmp_service.h
+./snmptable.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptable.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptable.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptable.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptable.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptable.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptable.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptable.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptable.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptable.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptable.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptable.lo: ../include/net-snmp/library/mib.h
+./snmptable.lo: ../include/net-snmp/mib_api.h
+./snmptable.lo: ../include/net-snmp/library/parse.h
+./snmptable.lo: ../include/net-snmp/library/oid_stash.h
+./snmptable.lo: ../include/net-snmp/net-snmp-features.h
+./snmptable.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptable.lo: ../include/net-snmp/library/snmp.h
+./snmptable.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptable.lo: ../include/net-snmp/library/getopt.h
+./snmptable.lo: ../include/net-snmp/utilities.h
+./snmptable.lo: ../include/net-snmp/library/system.h
+./snmptable.lo: ../include/net-snmp/library/tools.h
+./snmptable.lo: ../include/net-snmp/library/int64.h
+./snmptable.lo: ../include/net-snmp/library/mt_support.h
+./snmptable.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptable.lo: ../include/net-snmp/library/data_list.h
+./snmptable.lo: ../include/net-snmp/library/check_varbind.h
+./snmptable.lo: ../include/net-snmp/library/container.h
+./snmptable.lo: ../include/net-snmp/library/factory.h
+./snmptable.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptable.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptable.lo: ../include/net-snmp/library/container_iterator.h
+./snmptable.lo: ../include/net-snmp/library/container.h
+./snmptable.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptable.lo: ../include/net-snmp/version.h
+./snmptable.lo: ../include/net-snmp/config_api.h
+./snmptable.lo: ../include/net-snmp/library/read_config.h
+./snmptable.lo: ../include/net-snmp/library/default_store.h
+./snmptable.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptable.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptable.lo: ../include/net-snmp/library/vacm.h
+./snmptable.lo: ../include/net-snmp/snmpv3_api.h
+./snmptable.lo: ../include/net-snmp/library/snmpv3.h
+./snmptable.lo: ../include/net-snmp/library/transform_oids.h
+./snmptable.lo: ../include/net-snmp/library/keytools.h
+./snmptable.lo: ../include/net-snmp/library/scapi.h
+./snmptable.lo: ../include/net-snmp/library/lcd_time.h
+./snmptable.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmptable.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmptable.lo: ../include/net-snmp/library/snmptsm.h
+./snmptable.lo: ../include/net-snmp/library/snmpusm.h
+./snmptest.lo: ../include/net-snmp/net-snmp-config.h
+./snmptest.lo: ../include/net-snmp/net-snmp-includes.h
+./snmptest.lo: ../include/net-snmp/definitions.h
+./snmptest.lo: ../include/net-snmp/types.h
+./snmptest.lo: ../include/net-snmp/library/oid.h
+./snmptest.lo: ../include/net-snmp/library/types.h
+./snmptest.lo: ../include/net-snmp/library/snmp_api.h
+./snmptest.lo: ../include/net-snmp/varbind_api.h
+./snmptest.lo: ../include/net-snmp/library/snmp_client.h
+./snmptest.lo: ../include/net-snmp/pdu_api.h
+./snmptest.lo: ../include/net-snmp/library/asn1.h
+./snmptest.lo: ../include/net-snmp/output_api.h
+./snmptest.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptest.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptest.lo: ../include/net-snmp/session_api.h
+./snmptest.lo: ../include/net-snmp/library/callback.h
+./snmptest.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptest.lo: ../include/net-snmp/library/snmp_service.h
+./snmptest.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptest.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptest.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptest.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptest.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptest.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptest.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptest.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptest.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptest.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptest.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptest.lo: ../include/net-snmp/library/mib.h
+./snmptest.lo: ../include/net-snmp/mib_api.h
+./snmptest.lo: ../include/net-snmp/library/parse.h
+./snmptest.lo: ../include/net-snmp/library/oid_stash.h
+./snmptest.lo: ../include/net-snmp/net-snmp-features.h
+./snmptest.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptest.lo: ../include/net-snmp/library/snmp.h
+./snmptest.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptest.lo: ../include/net-snmp/library/getopt.h
+./snmptest.lo: ../include/net-snmp/utilities.h
+./snmptest.lo: ../include/net-snmp/library/system.h
+./snmptest.lo: ../include/net-snmp/library/tools.h
+./snmptest.lo: ../include/net-snmp/library/int64.h
+./snmptest.lo: ../include/net-snmp/library/mt_support.h
+./snmptest.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptest.lo: ../include/net-snmp/library/data_list.h
+./snmptest.lo: ../include/net-snmp/library/check_varbind.h
+./snmptest.lo: ../include/net-snmp/library/container.h
+./snmptest.lo: ../include/net-snmp/library/factory.h
+./snmptest.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptest.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptest.lo: ../include/net-snmp/library/container_iterator.h
+./snmptest.lo: ../include/net-snmp/library/container.h
+./snmptest.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptest.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./snmptest.lo: ../include/net-snmp/library/read_config.h
+./snmptest.lo: ../include/net-snmp/library/default_store.h
+./snmptest.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptest.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptest.lo: ../include/net-snmp/library/vacm.h
+./snmptest.lo: ../include/net-snmp/snmpv3_api.h
+./snmptest.lo: ../include/net-snmp/library/snmpv3.h
+./snmptest.lo: ../include/net-snmp/library/transform_oids.h
+./snmptest.lo: ../include/net-snmp/library/keytools.h
+./snmptest.lo: ../include/net-snmp/library/scapi.h
+./snmptest.lo: ../include/net-snmp/library/lcd_time.h
+./snmptest.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmptest.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmptest.lo: ../include/net-snmp/library/snmptsm.h
+./snmptest.lo: ../include/net-snmp/library/snmpusm.h
+./snmptls.lo: ../include/net-snmp/net-snmp-config.h
+./snmptls.lo: ../include/net-snmp/net-snmp-features.h
+./snmptls.lo: ../include/net-snmp/net-snmp-includes.h
+./snmptls.lo: ../include/net-snmp/definitions.h ../include/net-snmp/types.h
+./snmptls.lo: ../include/net-snmp/library/oid.h
+./snmptls.lo: ../include/net-snmp/library/types.h
+./snmptls.lo: ../include/net-snmp/library/snmp_api.h
+./snmptls.lo: ../include/net-snmp/varbind_api.h
+./snmptls.lo: ../include/net-snmp/library/snmp_client.h
+./snmptls.lo: ../include/net-snmp/pdu_api.h
+./snmptls.lo: ../include/net-snmp/library/asn1.h
+./snmptls.lo: ../include/net-snmp/output_api.h
+./snmptls.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptls.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptls.lo: ../include/net-snmp/session_api.h
+./snmptls.lo: ../include/net-snmp/library/callback.h
+./snmptls.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptls.lo: ../include/net-snmp/library/snmp_service.h
+./snmptls.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptls.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptls.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptls.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptls.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptls.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptls.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptls.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptls.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptls.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptls.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptls.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmptls.lo: ../include/net-snmp/library/parse.h
+./snmptls.lo: ../include/net-snmp/library/oid_stash.h
+./snmptls.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptls.lo: ../include/net-snmp/library/snmp.h
+./snmptls.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptls.lo: ../include/net-snmp/library/getopt.h
+./snmptls.lo: ../include/net-snmp/utilities.h
+./snmptls.lo: ../include/net-snmp/library/system.h
+./snmptls.lo: ../include/net-snmp/library/tools.h
+./snmptls.lo: ../include/net-snmp/library/int64.h
+./snmptls.lo: ../include/net-snmp/library/mt_support.h
+./snmptls.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptls.lo: ../include/net-snmp/library/data_list.h
+./snmptls.lo: ../include/net-snmp/library/check_varbind.h
+./snmptls.lo: ../include/net-snmp/library/container.h
+./snmptls.lo: ../include/net-snmp/library/factory.h
+./snmptls.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptls.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptls.lo: ../include/net-snmp/library/container_iterator.h
+./snmptls.lo: ../include/net-snmp/library/container.h
+./snmptls.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptls.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./snmptls.lo: ../include/net-snmp/library/read_config.h
+./snmptls.lo: ../include/net-snmp/library/default_store.h
+./snmptls.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptls.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptls.lo: ../include/net-snmp/library/vacm.h
+./snmptls.lo: ../include/net-snmp/snmpv3_api.h
+./snmptls.lo: ../include/net-snmp/library/snmpv3.h
+./snmptls.lo: ../include/net-snmp/library/transform_oids.h
+./snmptls.lo: ../include/net-snmp/library/keytools.h
+./snmptls.lo: ../include/net-snmp/library/scapi.h
+./snmptls.lo: ../include/net-snmp/library/lcd_time.h
+./snmptls.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmptls.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmptls.lo: ../include/net-snmp/library/snmptsm.h
+./snmptls.lo: ../include/net-snmp/library/snmpusm.h
+./snmptls.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmptls.lo: ../include/net-snmp/agent/mib_module_config.h
+./snmptls.lo: ../include/net-snmp/agent/agent_module_config.h
+./snmptls.lo: ../include/net-snmp/agent/snmp_agent.h
+./snmptls.lo: ../include/net-snmp/agent/snmp_vars.h
+./snmptls.lo: ../include/net-snmp/agent/agent_handler.h
+./snmptls.lo: ../include/net-snmp/agent/var_struct.h
+./snmptls.lo: ../include/net-snmp/agent/agent_registry.h
+./snmptls.lo: ../include/net-snmp/library/fd_event_manager.h
+./snmptls.lo: ../include/net-snmp/agent/ds_agent.h
+./snmptls.lo: ../include/net-snmp/agent/agent_read_config.h
+./snmptls.lo: ../include/net-snmp/agent/agent_trap.h
+./snmptls.lo: ../include/net-snmp/agent/all_helpers.h
+./snmptls.lo: ../include/net-snmp/agent/instance.h
+./snmptls.lo: ../include/net-snmp/agent/baby_steps.h
+./snmptls.lo: ../include/net-snmp/agent/scalar.h
+./snmptls.lo: ../include/net-snmp/agent/scalar_group.h
+./snmptls.lo: ../include/net-snmp/agent/watcher.h
+./snmptls.lo: ../include/net-snmp/agent/multiplexer.h
+./snmptls.lo: ../include/net-snmp/agent/null.h
+./snmptls.lo: ../include/net-snmp/agent/debug_handler.h
+./snmptls.lo: ../include/net-snmp/agent/cache_handler.h
+./snmptls.lo: ../include/net-snmp/agent/old_api.h
+./snmptls.lo: ../include/net-snmp/agent/read_only.h
+./snmptls.lo: ../include/net-snmp/agent/row_merge.h
+./snmptls.lo: ../include/net-snmp/agent/serialize.h
+./snmptls.lo: ../include/net-snmp/agent/bulk_to_next.h
+./snmptls.lo: ../include/net-snmp/agent/mode_end_call.h
+./snmptls.lo: ../include/net-snmp/agent/table.h
+./snmptls.lo: ../include/net-snmp/agent/table_data.h
+./snmptls.lo: ../include/net-snmp/agent/table_dataset.h
+./snmptls.lo: ../include/net-snmp/agent/table_tdata.h
+./snmptls.lo: ../include/net-snmp/agent/table_iterator.h
+./snmptls.lo: ../include/net-snmp/agent/table_container.h
+./snmptls.lo: ../include/net-snmp/agent/table_array.h
+./snmptls.lo: ../include/net-snmp/agent/mfd.h
+./snmptls.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./snmptls.lo: ../include/net-snmp/library/cert_util.h
+./snmptls.lo: ../agent/mibgroup/tlstm-mib.h
+./snmptls.lo: ../agent/mibgroup/tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h
+./snmptls.lo: ../agent/mibgroup/tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h
+./snmptls.lo: ../agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h
+./snmptranslate.lo: ../include/net-snmp/net-snmp-config.h
+./snmptranslate.lo: ../include/net-snmp/utilities.h
+./snmptranslate.lo: ../include/net-snmp/types.h
+./snmptranslate.lo: ../include/net-snmp/library/oid.h
+./snmptranslate.lo: ../include/net-snmp/library/types.h
+./snmptranslate.lo: ../include/net-snmp/definitions.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_api.h
+./snmptranslate.lo: ../include/net-snmp/varbind_api.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_client.h
+./snmptranslate.lo: ../include/net-snmp/pdu_api.h
+./snmptranslate.lo: ../include/net-snmp/library/asn1.h
+./snmptranslate.lo: ../include/net-snmp/output_api.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptranslate.lo: ../include/net-snmp/session_api.h
+./snmptranslate.lo: ../include/net-snmp/library/callback.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_service.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptranslate.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptranslate.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptranslate.lo: ../include/net-snmp/library/mib.h
+./snmptranslate.lo: ../include/net-snmp/mib_api.h
+./snmptranslate.lo: ../include/net-snmp/library/parse.h
+./snmptranslate.lo: ../include/net-snmp/library/oid_stash.h
+./snmptranslate.lo: ../include/net-snmp/net-snmp-features.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptranslate.lo: ../include/net-snmp/library/system.h
+./snmptranslate.lo: ../include/net-snmp/library/tools.h
+./snmptranslate.lo: ../include/net-snmp/library/int64.h
+./snmptranslate.lo: ../include/net-snmp/library/mt_support.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptranslate.lo: ../include/net-snmp/library/data_list.h
+./snmptranslate.lo: ../include/net-snmp/library/check_varbind.h
+./snmptranslate.lo: ../include/net-snmp/library/container.h
+./snmptranslate.lo: ../include/net-snmp/library/factory.h
+./snmptranslate.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptranslate.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptranslate.lo: ../include/net-snmp/library/container_iterator.h
+./snmptranslate.lo: ../include/net-snmp/library/container.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptranslate.lo: ../include/net-snmp/version.h
+./snmptranslate.lo: ../include/net-snmp/config_api.h
+./snmptranslate.lo: ../include/net-snmp/library/read_config.h
+./snmptranslate.lo: ../include/net-snmp/library/default_store.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptranslate.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptranslate.lo: ../include/net-snmp/library/vacm.h
+./snmptrap.lo: ../include/net-snmp/net-snmp-config.h
+./snmptrap.lo: ../include/net-snmp/net-snmp-includes.h
+./snmptrap.lo: ../include/net-snmp/definitions.h
+./snmptrap.lo: ../include/net-snmp/types.h
+./snmptrap.lo: ../include/net-snmp/library/oid.h
+./snmptrap.lo: ../include/net-snmp/library/types.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_api.h
+./snmptrap.lo: ../include/net-snmp/varbind_api.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_client.h
+./snmptrap.lo: ../include/net-snmp/pdu_api.h
+./snmptrap.lo: ../include/net-snmp/library/asn1.h
+./snmptrap.lo: ../include/net-snmp/output_api.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptrap.lo: ../include/net-snmp/session_api.h
+./snmptrap.lo: ../include/net-snmp/library/callback.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_service.h
+./snmptrap.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptrap.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptrap.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptrap.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptrap.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptrap.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptrap.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptrap.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptrap.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptrap.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptrap.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptrap.lo: ../include/net-snmp/library/mib.h
+./snmptrap.lo: ../include/net-snmp/mib_api.h
+./snmptrap.lo: ../include/net-snmp/library/parse.h
+./snmptrap.lo: ../include/net-snmp/library/oid_stash.h
+./snmptrap.lo: ../include/net-snmp/net-snmp-features.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptrap.lo: ../include/net-snmp/library/snmp.h
+./snmptrap.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptrap.lo: ../include/net-snmp/library/getopt.h
+./snmptrap.lo: ../include/net-snmp/utilities.h
+./snmptrap.lo: ../include/net-snmp/library/system.h
+./snmptrap.lo: ../include/net-snmp/library/tools.h
+./snmptrap.lo: ../include/net-snmp/library/int64.h
+./snmptrap.lo: ../include/net-snmp/library/mt_support.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptrap.lo: ../include/net-snmp/library/data_list.h
+./snmptrap.lo: ../include/net-snmp/library/check_varbind.h
+./snmptrap.lo: ../include/net-snmp/library/container.h
+./snmptrap.lo: ../include/net-snmp/library/factory.h
+./snmptrap.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptrap.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptrap.lo: ../include/net-snmp/library/container_iterator.h
+./snmptrap.lo: ../include/net-snmp/library/container.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptrap.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./snmptrap.lo: ../include/net-snmp/library/read_config.h
+./snmptrap.lo: ../include/net-snmp/library/default_store.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptrap.lo: ../include/net-snmp/library/vacm.h
+./snmptrap.lo: ../include/net-snmp/snmpv3_api.h
+./snmptrap.lo: ../include/net-snmp/library/snmpv3.h
+./snmptrap.lo: ../include/net-snmp/library/transform_oids.h
+./snmptrap.lo: ../include/net-snmp/library/keytools.h
+./snmptrap.lo: ../include/net-snmp/library/scapi.h
+./snmptrap.lo: ../include/net-snmp/library/lcd_time.h
+./snmptrap.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmptrap.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmptrap.lo: ../include/net-snmp/library/snmptsm.h
+./snmptrap.lo: ../include/net-snmp/library/snmpusm.h
+./snmptrapd_auth.lo: ../include/net-snmp/net-snmp-config.h
+./snmptrapd_auth.lo: ../include/net-snmp/net-snmp-includes.h
+./snmptrapd_auth.lo: ../include/net-snmp/definitions.h
+./snmptrapd_auth.lo: ../include/net-snmp/types.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/oid.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/types.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_api.h
+./snmptrapd_auth.lo: ../include/net-snmp/varbind_api.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_client.h
+./snmptrapd_auth.lo: ../include/net-snmp/pdu_api.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/asn1.h
+./snmptrapd_auth.lo: ../include/net-snmp/output_api.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptrapd_auth.lo: ../include/net-snmp/session_api.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/callback.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_service.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/mib.h
+./snmptrapd_auth.lo: ../include/net-snmp/mib_api.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/parse.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/oid_stash.h
+./snmptrapd_auth.lo: ../include/net-snmp/net-snmp-features.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/getopt.h
+./snmptrapd_auth.lo: ../include/net-snmp/utilities.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/system.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/tools.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/int64.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/mt_support.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/data_list.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/check_varbind.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/container.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/factory.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/container_iterator.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/container.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptrapd_auth.lo: ../include/net-snmp/version.h
+./snmptrapd_auth.lo: ../include/net-snmp/config_api.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/read_config.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/default_store.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/vacm.h
+./snmptrapd_auth.lo: ../include/net-snmp/snmpv3_api.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpv3.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/transform_oids.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/keytools.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/scapi.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/lcd_time.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmptsm.h
+./snmptrapd_auth.lo: ../include/net-snmp/library/snmpusm.h
+./snmptrapd_auth.lo: snmptrapd_handlers.h snmptrapd_auth.h snmptrapd_ds.h
+./snmptrapd_auth.lo: ../include/net-snmp/agent/agent_module_config.h
+./snmptrapd_auth.lo: ../include/net-snmp/agent/mib_module_config.h
+./snmptrapd_auth.lo: ../agent/mibgroup/mibII/vacm_conf.h
+./snmptrapd_auth.lo: ../include/net-snmp/agent/agent_trap.h
+./snmptrapd.lo: ../include/net-snmp/net-snmp-config.h
+./snmptrapd.lo: ../include/net-snmp/net-snmp-includes.h
+./snmptrapd.lo: ../include/net-snmp/definitions.h
+./snmptrapd.lo: ../include/net-snmp/types.h
+./snmptrapd.lo: ../include/net-snmp/library/oid.h
+./snmptrapd.lo: ../include/net-snmp/library/types.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_api.h
+./snmptrapd.lo: ../include/net-snmp/varbind_api.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_client.h
+./snmptrapd.lo: ../include/net-snmp/pdu_api.h
+./snmptrapd.lo: ../include/net-snmp/library/asn1.h
+./snmptrapd.lo: ../include/net-snmp/output_api.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptrapd.lo: ../include/net-snmp/session_api.h
+./snmptrapd.lo: ../include/net-snmp/library/callback.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_service.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptrapd.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptrapd.lo: ../include/net-snmp/library/mib.h
+./snmptrapd.lo: ../include/net-snmp/mib_api.h
+./snmptrapd.lo: ../include/net-snmp/library/parse.h
+./snmptrapd.lo: ../include/net-snmp/library/oid_stash.h
+./snmptrapd.lo: ../include/net-snmp/net-snmp-features.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptrapd.lo: ../include/net-snmp/library/getopt.h
+./snmptrapd.lo: ../include/net-snmp/utilities.h
+./snmptrapd.lo: ../include/net-snmp/library/system.h
+./snmptrapd.lo: ../include/net-snmp/library/tools.h
+./snmptrapd.lo: ../include/net-snmp/library/int64.h
+./snmptrapd.lo: ../include/net-snmp/library/mt_support.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptrapd.lo: ../include/net-snmp/library/data_list.h
+./snmptrapd.lo: ../include/net-snmp/library/check_varbind.h
+./snmptrapd.lo: ../include/net-snmp/library/container.h
+./snmptrapd.lo: ../include/net-snmp/library/factory.h
+./snmptrapd.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptrapd.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptrapd.lo: ../include/net-snmp/library/container_iterator.h
+./snmptrapd.lo: ../include/net-snmp/library/container.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptrapd.lo: ../include/net-snmp/version.h
+./snmptrapd.lo: ../include/net-snmp/config_api.h
+./snmptrapd.lo: ../include/net-snmp/library/read_config.h
+./snmptrapd.lo: ../include/net-snmp/library/default_store.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptrapd.lo: ../include/net-snmp/library/vacm.h
+./snmptrapd.lo: ../include/net-snmp/snmpv3_api.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpv3.h
+./snmptrapd.lo: ../include/net-snmp/library/transform_oids.h
+./snmptrapd.lo: ../include/net-snmp/library/keytools.h
+./snmptrapd.lo: ../include/net-snmp/library/scapi.h
+./snmptrapd.lo: ../include/net-snmp/library/lcd_time.h
+./snmptrapd.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmptrapd.lo: ../include/net-snmp/library/snmptsm.h
+./snmptrapd.lo: ../include/net-snmp/library/snmpusm.h
+./snmptrapd.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmptrapd.lo: ../include/net-snmp/agent/mib_module_config.h
+./snmptrapd.lo: ../include/net-snmp/agent/agent_module_config.h
+./snmptrapd.lo: ../include/net-snmp/agent/snmp_agent.h
+./snmptrapd.lo: ../include/net-snmp/agent/snmp_vars.h
+./snmptrapd.lo: ../include/net-snmp/agent/agent_handler.h
+./snmptrapd.lo: ../include/net-snmp/agent/var_struct.h
+./snmptrapd.lo: ../include/net-snmp/agent/agent_registry.h
+./snmptrapd.lo: ../include/net-snmp/library/fd_event_manager.h
+./snmptrapd.lo: ../include/net-snmp/agent/ds_agent.h
+./snmptrapd.lo: ../include/net-snmp/agent/agent_read_config.h
+./snmptrapd.lo: ../include/net-snmp/agent/agent_trap.h
+./snmptrapd.lo: ../include/net-snmp/agent/all_helpers.h
+./snmptrapd.lo: ../include/net-snmp/agent/instance.h
+./snmptrapd.lo: ../include/net-snmp/agent/baby_steps.h
+./snmptrapd.lo: ../include/net-snmp/agent/scalar.h
+./snmptrapd.lo: ../include/net-snmp/agent/scalar_group.h
+./snmptrapd.lo: ../include/net-snmp/agent/watcher.h
+./snmptrapd.lo: ../include/net-snmp/agent/multiplexer.h
+./snmptrapd.lo: ../include/net-snmp/agent/null.h
+./snmptrapd.lo: ../include/net-snmp/agent/debug_handler.h
+./snmptrapd.lo: ../include/net-snmp/agent/cache_handler.h
+./snmptrapd.lo: ../include/net-snmp/agent/old_api.h
+./snmptrapd.lo: ../include/net-snmp/agent/read_only.h
+./snmptrapd.lo: ../include/net-snmp/agent/row_merge.h
+./snmptrapd.lo: ../include/net-snmp/agent/serialize.h
+./snmptrapd.lo: ../include/net-snmp/agent/bulk_to_next.h
+./snmptrapd.lo: ../include/net-snmp/agent/mode_end_call.h
+./snmptrapd.lo: ../include/net-snmp/agent/table.h
+./snmptrapd.lo: ../include/net-snmp/agent/table_data.h
+./snmptrapd.lo: ../include/net-snmp/agent/table_dataset.h
+./snmptrapd.lo: ../include/net-snmp/agent/table_tdata.h
+./snmptrapd.lo: ../include/net-snmp/agent/table_iterator.h
+./snmptrapd.lo: ../include/net-snmp/agent/table_container.h
+./snmptrapd.lo: ../include/net-snmp/agent/table_array.h
+./snmptrapd.lo: ../include/net-snmp/agent/mfd.h
+./snmptrapd.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./snmptrapd.lo: snmptrapd_handlers.h snmptrapd_log.h snmptrapd_ds.h
+./snmptrapd.lo: snmptrapd_auth.h
+./snmptrapd.lo: ../agent/mibgroup/notification-log-mib/notification_log.h
+./snmptrapd.lo: ../agent/mibgroup/tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h
+./snmptrapd.lo: ../agent/mibgroup/mibII/vacm_conf.h
+./snmptrapd_handlers.lo: ../include/net-snmp/net-snmp-config.h
+./snmptrapd_handlers.lo: ../include/net-snmp/net-snmp-features.h
+./snmptrapd_handlers.lo: ../include/net-snmp/config_api.h
+./snmptrapd_handlers.lo: ../include/net-snmp/types.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/oid.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/types.h
+./snmptrapd_handlers.lo: ../include/net-snmp/definitions.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_api.h
+./snmptrapd_handlers.lo: ../include/net-snmp/varbind_api.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_client.h
+./snmptrapd_handlers.lo: ../include/net-snmp/pdu_api.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/asn1.h
+./snmptrapd_handlers.lo: ../include/net-snmp/output_api.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptrapd_handlers.lo: ../include/net-snmp/session_api.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/callback.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_service.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/mib.h
+./snmptrapd_handlers.lo: ../include/net-snmp/mib_api.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/parse.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/oid_stash.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/read_config.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/default_store.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/vacm.h
+./snmptrapd_handlers.lo: ../include/net-snmp/utilities.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/system.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/tools.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/int64.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/mt_support.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/data_list.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/check_varbind.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/container.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/factory.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/container_iterator.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/container.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptrapd_handlers.lo: ../include/net-snmp/version.h
+./snmptrapd_handlers.lo: ../include/net-snmp/net-snmp-includes.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/getopt.h
+./snmptrapd_handlers.lo: ../include/net-snmp/snmpv3_api.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpv3.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/transform_oids.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/keytools.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/scapi.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/lcd_time.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmptsm.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/snmpusm.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/mib_module_config.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/agent_module_config.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/snmp_agent.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/snmp_vars.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/agent_handler.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/var_struct.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/agent_registry.h
+./snmptrapd_handlers.lo: ../include/net-snmp/library/fd_event_manager.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/ds_agent.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/agent_read_config.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/agent_trap.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/all_helpers.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/instance.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/baby_steps.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/scalar.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/scalar_group.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/watcher.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/multiplexer.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/null.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/debug_handler.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/cache_handler.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/old_api.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/read_only.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/row_merge.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/serialize.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/bulk_to_next.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/mode_end_call.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/table.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/table_data.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/table_dataset.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/table_tdata.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/table_iterator.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/table_container.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/table_array.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/mfd.h
+./snmptrapd_handlers.lo: ../include/net-snmp/agent/snmp_get_statistic.h
+./snmptrapd_handlers.lo: ../agent/mibgroup/utilities/execute.h
+./snmptrapd_handlers.lo: snmptrapd_handlers.h snmptrapd_auth.h
+./snmptrapd_handlers.lo: snmptrapd_log.h snmptrapd_ds.h
+./snmptrapd_handlers.lo: ../agent/mibgroup/notification-log-mib/notification_log.h
+./snmptrapd_log.lo: ../include/net-snmp/net-snmp-config.h
+./snmptrapd_log.lo: ../include/net-snmp/net-snmp-includes.h
+./snmptrapd_log.lo: ../include/net-snmp/definitions.h
+./snmptrapd_log.lo: ../include/net-snmp/types.h
+./snmptrapd_log.lo: ../include/net-snmp/library/oid.h
+./snmptrapd_log.lo: ../include/net-snmp/library/types.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_api.h
+./snmptrapd_log.lo: ../include/net-snmp/varbind_api.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_client.h
+./snmptrapd_log.lo: ../include/net-snmp/pdu_api.h
+./snmptrapd_log.lo: ../include/net-snmp/library/asn1.h
+./snmptrapd_log.lo: ../include/net-snmp/output_api.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptrapd_log.lo: ../include/net-snmp/session_api.h
+./snmptrapd_log.lo: ../include/net-snmp/library/callback.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_service.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptrapd_log.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptrapd_log.lo: ../include/net-snmp/library/mib.h
+./snmptrapd_log.lo: ../include/net-snmp/mib_api.h
+./snmptrapd_log.lo: ../include/net-snmp/library/parse.h
+./snmptrapd_log.lo: ../include/net-snmp/library/oid_stash.h
+./snmptrapd_log.lo: ../include/net-snmp/net-snmp-features.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptrapd_log.lo: ../include/net-snmp/library/getopt.h
+./snmptrapd_log.lo: ../include/net-snmp/utilities.h
+./snmptrapd_log.lo: ../include/net-snmp/library/system.h
+./snmptrapd_log.lo: ../include/net-snmp/library/tools.h
+./snmptrapd_log.lo: ../include/net-snmp/library/int64.h
+./snmptrapd_log.lo: ../include/net-snmp/library/mt_support.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptrapd_log.lo: ../include/net-snmp/library/data_list.h
+./snmptrapd_log.lo: ../include/net-snmp/library/check_varbind.h
+./snmptrapd_log.lo: ../include/net-snmp/library/container.h
+./snmptrapd_log.lo: ../include/net-snmp/library/factory.h
+./snmptrapd_log.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptrapd_log.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptrapd_log.lo: ../include/net-snmp/library/container_iterator.h
+./snmptrapd_log.lo: ../include/net-snmp/library/container.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptrapd_log.lo: ../include/net-snmp/version.h
+./snmptrapd_log.lo: ../include/net-snmp/config_api.h
+./snmptrapd_log.lo: ../include/net-snmp/library/read_config.h
+./snmptrapd_log.lo: ../include/net-snmp/library/default_store.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptrapd_log.lo: ../include/net-snmp/library/vacm.h
+./snmptrapd_log.lo: ../include/net-snmp/snmpv3_api.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpv3.h
+./snmptrapd_log.lo: ../include/net-snmp/library/transform_oids.h
+./snmptrapd_log.lo: ../include/net-snmp/library/keytools.h
+./snmptrapd_log.lo: ../include/net-snmp/library/scapi.h
+./snmptrapd_log.lo: ../include/net-snmp/library/lcd_time.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmptsm.h
+./snmptrapd_log.lo: ../include/net-snmp/library/snmpusm.h snmptrapd_log.h
+./snmptrapd_log.lo: snmptrapd_ds.h
+./snmptrapd_sql.lo: ../include/net-snmp/net-snmp-config.h
+./snmptrapd_sql.lo: ../include/net-snmp/net-snmp-features.h
+./snmpusm.lo: ../include/net-snmp/net-snmp-config.h
+./snmpusm.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpusm.lo: ../include/net-snmp/definitions.h
+./snmpusm.lo: ../include/net-snmp/types.h
+./snmpusm.lo: ../include/net-snmp/library/oid.h
+./snmpusm.lo: ../include/net-snmp/library/types.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_api.h
+./snmpusm.lo: ../include/net-snmp/varbind_api.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_client.h
+./snmpusm.lo: ../include/net-snmp/pdu_api.h
+./snmpusm.lo: ../include/net-snmp/library/asn1.h
+./snmpusm.lo: ../include/net-snmp/output_api.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpusm.lo: ../include/net-snmp/session_api.h
+./snmpusm.lo: ../include/net-snmp/library/callback.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_service.h
+./snmpusm.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpusm.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpusm.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmpusm.lo: ../include/net-snmp/library/parse.h
+./snmpusm.lo: ../include/net-snmp/library/oid_stash.h
+./snmpusm.lo: ../include/net-snmp/net-snmp-features.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpusm.lo: ../include/net-snmp/library/snmp.h
+./snmpusm.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpusm.lo: ../include/net-snmp/library/getopt.h
+./snmpusm.lo: ../include/net-snmp/utilities.h
+./snmpusm.lo: ../include/net-snmp/library/system.h
+./snmpusm.lo: ../include/net-snmp/library/tools.h
+./snmpusm.lo: ../include/net-snmp/library/int64.h
+./snmpusm.lo: ../include/net-snmp/library/mt_support.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpusm.lo: ../include/net-snmp/library/data_list.h
+./snmpusm.lo: ../include/net-snmp/library/check_varbind.h
+./snmpusm.lo: ../include/net-snmp/library/container.h
+./snmpusm.lo: ../include/net-snmp/library/factory.h
+./snmpusm.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpusm.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpusm.lo: ../include/net-snmp/library/container_iterator.h
+./snmpusm.lo: ../include/net-snmp/library/container.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpusm.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./snmpusm.lo: ../include/net-snmp/library/read_config.h
+./snmpusm.lo: ../include/net-snmp/library/default_store.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpusm.lo: ../include/net-snmp/library/vacm.h
+./snmpusm.lo: ../include/net-snmp/snmpv3_api.h
+./snmpusm.lo: ../include/net-snmp/library/snmpv3.h
+./snmpusm.lo: ../include/net-snmp/library/transform_oids.h
+./snmpusm.lo: ../include/net-snmp/library/keytools.h
+./snmpusm.lo: ../include/net-snmp/library/scapi.h
+./snmpusm.lo: ../include/net-snmp/library/lcd_time.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpusm.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpusm.lo: ../include/net-snmp/library/snmptsm.h
+./snmpusm.lo: ../include/net-snmp/library/snmpusm.h
+./snmpvacm.lo: ../include/net-snmp/net-snmp-config.h
+./snmpvacm.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpvacm.lo: ../include/net-snmp/definitions.h
+./snmpvacm.lo: ../include/net-snmp/types.h
+./snmpvacm.lo: ../include/net-snmp/library/oid.h
+./snmpvacm.lo: ../include/net-snmp/library/types.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_api.h
+./snmpvacm.lo: ../include/net-snmp/varbind_api.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_client.h
+./snmpvacm.lo: ../include/net-snmp/pdu_api.h
+./snmpvacm.lo: ../include/net-snmp/library/asn1.h
+./snmpvacm.lo: ../include/net-snmp/output_api.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpvacm.lo: ../include/net-snmp/session_api.h
+./snmpvacm.lo: ../include/net-snmp/library/callback.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_service.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpvacm.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpvacm.lo: ../include/net-snmp/library/mib.h
+./snmpvacm.lo: ../include/net-snmp/mib_api.h
+./snmpvacm.lo: ../include/net-snmp/library/parse.h
+./snmpvacm.lo: ../include/net-snmp/library/oid_stash.h
+./snmpvacm.lo: ../include/net-snmp/net-snmp-features.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpvacm.lo: ../include/net-snmp/library/getopt.h
+./snmpvacm.lo: ../include/net-snmp/utilities.h
+./snmpvacm.lo: ../include/net-snmp/library/system.h
+./snmpvacm.lo: ../include/net-snmp/library/tools.h
+./snmpvacm.lo: ../include/net-snmp/library/int64.h
+./snmpvacm.lo: ../include/net-snmp/library/mt_support.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpvacm.lo: ../include/net-snmp/library/data_list.h
+./snmpvacm.lo: ../include/net-snmp/library/check_varbind.h
+./snmpvacm.lo: ../include/net-snmp/library/container.h
+./snmpvacm.lo: ../include/net-snmp/library/factory.h
+./snmpvacm.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpvacm.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpvacm.lo: ../include/net-snmp/library/container_iterator.h
+./snmpvacm.lo: ../include/net-snmp/library/container.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpvacm.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./snmpvacm.lo: ../include/net-snmp/library/read_config.h
+./snmpvacm.lo: ../include/net-snmp/library/default_store.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpvacm.lo: ../include/net-snmp/library/vacm.h
+./snmpvacm.lo: ../include/net-snmp/snmpv3_api.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpv3.h
+./snmpvacm.lo: ../include/net-snmp/library/transform_oids.h
+./snmpvacm.lo: ../include/net-snmp/library/keytools.h
+./snmpvacm.lo: ../include/net-snmp/library/scapi.h
+./snmpvacm.lo: ../include/net-snmp/library/lcd_time.h
+./snmpvacm.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpvacm.lo: ../include/net-snmp/library/snmptsm.h
+./snmpvacm.lo: ../include/net-snmp/library/snmpusm.h
+./snmpwalk.lo: ../include/net-snmp/net-snmp-config.h
+./snmpwalk.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpwalk.lo: ../include/net-snmp/definitions.h
+./snmpwalk.lo: ../include/net-snmp/types.h
+./snmpwalk.lo: ../include/net-snmp/library/oid.h
+./snmpwalk.lo: ../include/net-snmp/library/types.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_api.h
+./snmpwalk.lo: ../include/net-snmp/varbind_api.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_client.h
+./snmpwalk.lo: ../include/net-snmp/pdu_api.h
+./snmpwalk.lo: ../include/net-snmp/library/asn1.h
+./snmpwalk.lo: ../include/net-snmp/output_api.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpwalk.lo: ../include/net-snmp/session_api.h
+./snmpwalk.lo: ../include/net-snmp/library/callback.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_service.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpwalk.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpwalk.lo: ../include/net-snmp/library/mib.h
+./snmpwalk.lo: ../include/net-snmp/mib_api.h
+./snmpwalk.lo: ../include/net-snmp/library/parse.h
+./snmpwalk.lo: ../include/net-snmp/library/oid_stash.h
+./snmpwalk.lo: ../include/net-snmp/net-snmp-features.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpwalk.lo: ../include/net-snmp/library/getopt.h
+./snmpwalk.lo: ../include/net-snmp/utilities.h
+./snmpwalk.lo: ../include/net-snmp/library/system.h
+./snmpwalk.lo: ../include/net-snmp/library/tools.h
+./snmpwalk.lo: ../include/net-snmp/library/int64.h
+./snmpwalk.lo: ../include/net-snmp/library/mt_support.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpwalk.lo: ../include/net-snmp/library/data_list.h
+./snmpwalk.lo: ../include/net-snmp/library/check_varbind.h
+./snmpwalk.lo: ../include/net-snmp/library/container.h
+./snmpwalk.lo: ../include/net-snmp/library/factory.h
+./snmpwalk.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpwalk.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpwalk.lo: ../include/net-snmp/library/container_iterator.h
+./snmpwalk.lo: ../include/net-snmp/library/container.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpwalk.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./snmpwalk.lo: ../include/net-snmp/library/read_config.h
+./snmpwalk.lo: ../include/net-snmp/library/default_store.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpwalk.lo: ../include/net-snmp/library/vacm.h
+./snmpwalk.lo: ../include/net-snmp/snmpv3_api.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpv3.h
+./snmpwalk.lo: ../include/net-snmp/library/transform_oids.h
+./snmpwalk.lo: ../include/net-snmp/library/keytools.h
+./snmpwalk.lo: ../include/net-snmp/library/scapi.h
+./snmpwalk.lo: ../include/net-snmp/library/lcd_time.h
+./snmpwalk.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpwalk.lo: ../include/net-snmp/library/snmptsm.h
+./snmpwalk.lo: ../include/net-snmp/library/snmpusm.h
+./sshtosnmp.lo: ../include/net-snmp/net-snmp-config.h
+./snmpnetstat/if.lo: ../include/net-snmp/net-snmp-config.h
+./snmpnetstat/if.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpnetstat/if.lo: ../include/net-snmp/definitions.h
+./snmpnetstat/if.lo: ../include/net-snmp/types.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/oid.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/types.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_api.h
+./snmpnetstat/if.lo: ../include/net-snmp/varbind_api.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_client.h
+./snmpnetstat/if.lo: ../include/net-snmp/pdu_api.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/asn1.h
+./snmpnetstat/if.lo: ../include/net-snmp/output_api.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpnetstat/if.lo: ../include/net-snmp/session_api.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/callback.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_service.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/mib.h
+./snmpnetstat/if.lo: ../include/net-snmp/mib_api.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/parse.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/oid_stash.h
+./snmpnetstat/if.lo: ../include/net-snmp/net-snmp-features.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/getopt.h
+./snmpnetstat/if.lo: ../include/net-snmp/utilities.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/system.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/tools.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/int64.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/mt_support.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/data_list.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/check_varbind.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/factory.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/container_iterator.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpnetstat/if.lo: ../include/net-snmp/version.h
+./snmpnetstat/if.lo: ../include/net-snmp/config_api.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/read_config.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/default_store.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/vacm.h
+./snmpnetstat/if.lo: ../include/net-snmp/snmpv3_api.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpv3.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/transform_oids.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/keytools.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/scapi.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/lcd_time.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmptsm.h
+./snmpnetstat/if.lo: ../include/net-snmp/library/snmpusm.h
+./snmpnetstat/if.lo: ./snmpnetstat/main.h
+./snmpnetstat/if.lo: ./snmpnetstat/netstat.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/net-snmp-config.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/definitions.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/types.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/oid.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/types.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_api.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/varbind_api.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_client.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/pdu_api.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/asn1.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/output_api.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/session_api.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/callback.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_service.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/mib.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/mib_api.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/parse.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/oid_stash.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/net-snmp-features.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/getopt.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/utilities.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/system.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/tools.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/int64.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/mt_support.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/data_list.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/check_varbind.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/factory.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/container_iterator.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/version.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/config_api.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/read_config.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/default_store.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/vacm.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/snmpv3_api.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpv3.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/transform_oids.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/keytools.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/scapi.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/lcd_time.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmptsm.h
+./snmpnetstat/inet6.lo: ../include/net-snmp/library/snmpusm.h
+./snmpnetstat/inet6.lo: ./snmpnetstat/main.h ./snmpnetstat/netstat.h
+./snmpnetstat/inet.lo: ../include/net-snmp/net-snmp-config.h
+./snmpnetstat/inet.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpnetstat/inet.lo: ../include/net-snmp/definitions.h
+./snmpnetstat/inet.lo: ../include/net-snmp/types.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/oid.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/types.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_api.h
+./snmpnetstat/inet.lo: ../include/net-snmp/varbind_api.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_client.h
+./snmpnetstat/inet.lo: ../include/net-snmp/pdu_api.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/asn1.h
+./snmpnetstat/inet.lo: ../include/net-snmp/output_api.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpnetstat/inet.lo: ../include/net-snmp/session_api.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/callback.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_service.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/mib.h
+./snmpnetstat/inet.lo: ../include/net-snmp/mib_api.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/parse.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/oid_stash.h
+./snmpnetstat/inet.lo: ../include/net-snmp/net-snmp-features.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/getopt.h
+./snmpnetstat/inet.lo: ../include/net-snmp/utilities.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/system.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/tools.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/int64.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/mt_support.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/data_list.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/check_varbind.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/factory.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/container_iterator.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpnetstat/inet.lo: ../include/net-snmp/version.h
+./snmpnetstat/inet.lo: ../include/net-snmp/config_api.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/read_config.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/default_store.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/vacm.h
+./snmpnetstat/inet.lo: ../include/net-snmp/snmpv3_api.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpv3.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/transform_oids.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/keytools.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/scapi.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/lcd_time.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmptsm.h
+./snmpnetstat/inet.lo: ../include/net-snmp/library/snmpusm.h
+./snmpnetstat/inet.lo: ./snmpnetstat/main.h ./snmpnetstat/netstat.h
+./snmpnetstat/main.lo: ../include/net-snmp/net-snmp-config.h
+./snmpnetstat/main.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpnetstat/main.lo: ../include/net-snmp/definitions.h
+./snmpnetstat/main.lo: ../include/net-snmp/types.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/oid.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/types.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_api.h
+./snmpnetstat/main.lo: ../include/net-snmp/varbind_api.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_client.h
+./snmpnetstat/main.lo: ../include/net-snmp/pdu_api.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/asn1.h
+./snmpnetstat/main.lo: ../include/net-snmp/output_api.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpnetstat/main.lo: ../include/net-snmp/session_api.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/callback.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_service.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/mib.h
+./snmpnetstat/main.lo: ../include/net-snmp/mib_api.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/parse.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/oid_stash.h
+./snmpnetstat/main.lo: ../include/net-snmp/net-snmp-features.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/getopt.h
+./snmpnetstat/main.lo: ../include/net-snmp/utilities.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/system.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/tools.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/int64.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/mt_support.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/data_list.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/check_varbind.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/factory.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/container_iterator.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpnetstat/main.lo: ../include/net-snmp/version.h
+./snmpnetstat/main.lo: ../include/net-snmp/config_api.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/read_config.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/default_store.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/vacm.h
+./snmpnetstat/main.lo: ../include/net-snmp/snmpv3_api.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpv3.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/transform_oids.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/keytools.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/scapi.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/lcd_time.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmptsm.h
+./snmpnetstat/main.lo: ../include/net-snmp/library/snmpusm.h
+./snmpnetstat/main.lo: ./snmpnetstat/main.h ./snmpnetstat/netstat.h
+./snmpnetstat/route.lo: ../include/net-snmp/net-snmp-config.h
+./snmpnetstat/route.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpnetstat/route.lo: ../include/net-snmp/definitions.h
+./snmpnetstat/route.lo: ../include/net-snmp/types.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/oid.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/types.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_api.h
+./snmpnetstat/route.lo: ../include/net-snmp/varbind_api.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_client.h
+./snmpnetstat/route.lo: ../include/net-snmp/pdu_api.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/asn1.h
+./snmpnetstat/route.lo: ../include/net-snmp/output_api.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpnetstat/route.lo: ../include/net-snmp/session_api.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/callback.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_service.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/mib.h
+./snmpnetstat/route.lo: ../include/net-snmp/mib_api.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/parse.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/oid_stash.h
+./snmpnetstat/route.lo: ../include/net-snmp/net-snmp-features.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/getopt.h
+./snmpnetstat/route.lo: ../include/net-snmp/utilities.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/system.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/tools.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/int64.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/mt_support.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/data_list.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/check_varbind.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/factory.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/container_iterator.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpnetstat/route.lo: ../include/net-snmp/version.h
+./snmpnetstat/route.lo: ../include/net-snmp/config_api.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/read_config.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/default_store.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/vacm.h
+./snmpnetstat/route.lo: ../include/net-snmp/snmpv3_api.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpv3.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/transform_oids.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/keytools.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/scapi.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/lcd_time.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmptsm.h
+./snmpnetstat/route.lo: ../include/net-snmp/library/snmpusm.h
+./snmpnetstat/route.lo: ./snmpnetstat/main.h ./snmpnetstat/netstat.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/net-snmp-config.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/definitions.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/types.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/oid.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/types.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_api.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/varbind_api.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_client.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/pdu_api.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/asn1.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/output_api.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/session_api.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/callback.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_service.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/mib.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/mib_api.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/parse.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/oid_stash.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/net-snmp-features.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/getopt.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/utilities.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/system.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/tools.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/int64.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/mt_support.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/data_list.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/check_varbind.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/factory.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/container_iterator.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/container.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/version.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/config_api.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/read_config.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/default_store.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/vacm.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/snmpv3_api.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpv3.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/transform_oids.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/keytools.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/scapi.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/lcd_time.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmptsm.h
+./snmpnetstat/winstub.lo: ../include/net-snmp/library/snmpusm.h
diff --git a/apps/Makefile.in b/apps/Makefile.in
new file mode 100644
index 0000000..77404dd
--- /dev/null
+++ b/apps/Makefile.in
@@ -0,0 +1,230 @@
+#
+# Makefile for snmpget, snmpwalk, snmpbulkwalk, snmptest, snmptranslate,
+# snmptrapd, snmptable, snmpset, snmpgetnext, and other utilities.
+#
+
+top_builddir=..
+mysubdir=apps
+
+# 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)
+
+#
+# Things to install
+#
+
+@NETSNMP_BUILD_SSH_PROG_TRUE@SSHINSTALLBINPROG = sshtosnmp$(EXEEXT)
+@NETSNMP_BUILD_SSH_PROG_FALSE@SSHINSTALLBINPROG =
+@NETSNMP_BUILD_SSH_PROG_TRUE@SSHFEATUREPROG = sshtosnmp.ft
+@NETSNMP_BUILD_SSH_PROG_FALSE@SSHFEATUREPROG =
+@NETSNMP_BUILD_TLS_PROG_TRUE@TLSINSTALLBINPROG = snmptls$(EXEEXT)
+@NETSNMP_BUILD_TLS_PROG_FALSE@TLSINSTALLBINPROG =
+@NETSNMP_BUILD_TLS_PROG_TRUE@TLSFEATUREPROG = snmptls.ft
+@NETSNMP_BUILD_TLS_PROG_FALSE@TLSFEATUREPROG =
+@NETSNMP_BUILD_USM_PROG_TRUE@USMINSTALLBINPROG = snmpusm$(EXEEXT)
+@NETSNMP_BUILD_USM_PROG_FALSE@USMINSTALLBINPROG =
+@NETSNMP_BUILD_USM_PROG_TRUE@USMFEATUREPROG = snmpusm.ft
+@NETSNMP_BUILD_USM_PROG_FALSE@USMFEATUREPROG =
+@NETSNMP_BUILD_USM_PROG_TRUE@EKCSTALLBINPROG = encode_keychange$(EXEEXT)
+@NETSNMP_BUILD_USM_PROG_FALSE@EKCSTALLBINPROG =
+@NETSNMP_BUILD_USM_PROG_TRUE@EKCFEATUREPROG = encode_keychange.ft
+@NETSNMP_BUILD_USM_PROG_FALSE@EKCFEATUREPROG =
+@NETSNMP_BUILD_SET_PROG_TRUE@SNMPSETINSTALLBINPROG = snmpset$(EXEEXT)
+@NETSNMP_BUILD_SET_PROG_FALSE@SNMPSETINSTALLBINPROG =
+@NETSNMP_BUILD_SET_PROG_TRUE@SNMPSETFEATUREPROG = snmpset.ft
+@NETSNMP_BUILD_SET_PROG_FALSE@SNMPSETFEATUREPROG =
+@NETSNMP_BUILD_SET_PROG_TRUE@SNMPVACMINSTALLBINPROG = snmpvacm$(EXEEXT)
+@NETSNMP_BUILD_SET_PROG_FALSE@SNMPVACMINSTALLBINPROG =
+@NETSNMP_BUILD_SET_PROG_TRUE@SNMPVACMFEATUREPROG = snmpvacm.ft
+@NETSNMP_BUILD_SET_PROG_FALSE@SNMPVACMFEATUREPROG =
+
+@NETSNMP_HAVE_AGENTX_LIBS_TRUE@AGENTXTRAP = agentxtrap$(EXEEXT)
+@NETSNMP_HAVE_AGENTX_LIBS_FALSE@AGENTXTRAP =
+
+INSTALLBINPROGS = snmpget$(EXEEXT) \
+ snmpgetnext$(EXEEXT) \
+ $(SNMPSETINSTALLBINPROG) \
+ snmpwalk$(EXEEXT) \
+ snmpbulkwalk$(EXEEXT) \
+ snmptable$(EXEEXT) \
+ snmptrap$(EXEEXT) \
+ snmpbulkget$(EXEEXT) \
+ snmptranslate$(EXEEXT) \
+ snmpstatus$(EXEEXT) \
+ snmpdelta$(EXEEXT) \
+ snmptest$(EXEEXT) \
+ snmpdf$(EXEEXT) \
+ $(AGENTXTRAP) \
+ $(SNMPVACMINSTALLBINPROG) \
+ $(SSHINSTALLBINPROG) $(TLSINSTALLBINPROG) \
+ $(USMINSTALLBINPROG) $(EKCSTALLBINPROG)
+
+INSTALLSBINPROGS = snmptrapd$(EXEEXT)
+
+INSTALLLIBS = libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION)
+
+SUBDIRS = snmpnetstat
+
+FEATUREFILE=../include/net-snmp/features-apps.h
+
+#
+# build variables.
+#
+
+# USELIBS/USEAGENTLIBS are for dependencies
+USELIBS = ../snmplib/libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION)
+AGENTLIB = ../agent/libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
+MIBLIB = ../agent/libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
+USEAGENTLIBS = $(MIBLIB) $(AGENTLIB) $(USELIBS)
+MYSQL_LIBS = @MYSQL_LIBS@
+MYSQL_INCLUDES = @MYSQL_INCLUDES@
+
+VAL_LIBS = @VAL_LIBS@
+LIBS = $(USELIBS) $(VAL_LIBS) @LIBS@
+PERLLDOPTS_FOR_APPS = @PERLLDOPTS_FOR_APPS@
+PERLLDOPTS_FOR_LIBS = @PERLLDOPTS_FOR_LIBS@
+
+#
+# hack for compiling trapd when agent is disabled
+TRAPDWITHAGENT = $(USETRAPLIBS) $(MYSQL_LIBS) $(VAL_LIBS) @AGENTLIBS@
+TRAPDWITHOUTAGENT = $(LIBS) $(MYSQL_LIBS) $(VAL_LIBS)
+
+# these will be set by configure to one of the above 2 lines
+TRAPLIBS = @TRAPLIBS@ $(PERLLDOPTS_FOR_APPS)
+USETRAPLIBS = @USETRAPLIBS@
+
+CPPFLAGS = $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(HELPER_INCLUDES) \
+ $(MIBGROUP_INCLUDES) \
+ $(SNMPLIB_INCLUDES) $(MYSQL_INCLUDES) @CPPFLAGS@
+
+OSUFFIX = lo
+TRAPD_OBJECTS = snmptrapd.$(OSUFFIX) @other_trapd_objects@
+LIBTRAPD_OBJS = snmptrapd_handlers.o snmptrapd_log.o \
+ snmptrapd_auth.o snmptrapd_sql.o
+LLIBTRAPD_OBJS = snmptrapd_handlers.lo snmptrapd_log.lo \
+ snmptrapd_auth.lo snmptrapd_sql.lo
+LIBTRAPD_FTS = snmptrapd_handlers.ft snmptrapd_log.ft \
+ snmptrapd_auth.ft snmptrapd_sql.ft
+OBJS = *.o
+LOBJS = *.lo
+FTOBJS=$(LIBTRAPD_FTS) \
+ snmpwalk.ft \
+ snmpbulkwalk.ft \
+ snmpbulkget.ft \
+ snmptranslate.ft \
+ snmpstatus.ft \
+ snmpget.ft \
+ snmpdelta.ft \
+ snmptable.ft \
+ snmptest.ft \
+ snmptrapd.ft \
+ snmptrap.ft \
+ $(SNMPSETFEATUREPROG) \
+ $(SNMPVACMFEATUREPROG) \
+ $(USMFEATUREPROG) \
+ $(TLSFEATUREPROG) \
+ agentxtrap.ft \
+ snmpgetnext.ft \
+ $(EKCFEATUREPROG) \
+ snmpdf.ft \
+ $(SSHFEATUREPROG)
+
+all: standardall
+
+OTHERINSTALL=snmpinforminstall snmptrapdperlinstall
+OTHERUNINSTALL=snmpinformuninstall snmptrapdperluninstall
+
+#
+# build rules
+#
+snmpwalk$(EXEEXT): snmpwalk.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpwalk.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmpbulkwalk$(EXEEXT): snmpbulkwalk.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpbulkwalk.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmpbulkget$(EXEEXT): snmpbulkget.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpbulkget.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmptranslate$(EXEEXT): snmptranslate.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmptranslate.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmpstatus$(EXEEXT): snmpstatus.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpstatus.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmpget$(EXEEXT): snmpget.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpget.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmpdelta$(EXEEXT): snmpdelta.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpdelta.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmptable$(EXEEXT): snmptable.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmptable.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmptest$(EXEEXT): snmptest.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
+ $(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS}
+
+snmptrap$(EXEEXT): snmptrap.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmpinform$(EXEEXT): snmptrap$(EXEEXT)
+ rm -f snmpinform
+ $(LN_S) snmptrap$(EXEEXT) snmpinform$(EXEEXT)
+
+snmpset$(EXEEXT): snmpset.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpset.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmpusm$(EXEEXT): snmpusm.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpusm.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmpvacm$(EXEEXT): snmpvacm.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpvacm.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmptls$(EXEEXT): snmptls.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmptls.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+agentxtrap$(EXEEXT): agentxtrap.$(OSUFFIX) $(USEAGENTLIBS)
+ $(LINK) ${CFLAGS} -o $@ agentxtrap.$(OSUFFIX) ${LDFLAGS} $(USEAGENTLIBS) $(PERLLDOPTS_FOR_APPS) ${LIBS}
+
+snmpgetnext$(EXEEXT): snmpgetnext.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpgetnext.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+encode_keychange$(EXEEXT): encode_keychange.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ encode_keychange.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+snmpdf$(EXEEXT): snmpdf.$(OSUFFIX) $(USELIBS)
+ $(LINK) ${CFLAGS} -o $@ snmpdf.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+
+libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION): $(LLIBTRAPD_OBJS)
+ $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS)
+ $(RANLIB) $@
+
+snmpinforminstall:
+ rm -f $(INSTALL_PREFIX)$(bindir)/snmpinform$(EXEEXT)
+ $(LN_S) snmptrap$(EXEEXT) $(INSTALL_PREFIX)$(bindir)/snmpinform$(EXEEXT)
+
+snmpinformuninstall:
+ rm -f $(INSTALL_PREFIX)$(bindir)/snmpinform$(EXEEXT)
+
+snmptrapdperlinstall: installdirs
+ @$(INSTALL_DATA) $(srcdir)/snmp_perl_trapd.pl $(INSTALL_PREFIX)$(snmplibdir)/snmp_perl_trapd.pl
+ @echo "install: installed snmp_perl_trapd.pl in $(INSTALL_PREFIX)$(snmplibdir)"
+
+snmptrapdperluninstall: installdirs
+ @rm -f $(INSTALL_PREFIX)$(snmplibdir)/snmp_perl_trapd.pl
+ @echo "removed snmp_perl_trapd.pl from $(INSTALL_PREFIX)$(snmplibdir)"
+
+sshtosnmp$(EXEEXT): sshtosnmp.$(OSUFFIX)
+ $(LINK) ${CFLAGS} -o $@ sshtosnmp.$(OSUFFIX)
+
+
+installdirs:
+ @$(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(snmplibdir)
diff --git a/apps/agentxtrap.c b/apps/agentxtrap.c
new file mode 100644
index 0000000..f366f61
--- /dev/null
+++ b/apps/agentxtrap.c
@@ -0,0 +1,607 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h> /* optind, optarg and optopt */
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/ds_agent.h>
+
+#include "../agent/mibgroup/agentx/agentx_config.h"
+#include "../agent/mibgroup/agentx/client.h"
+#include "../agent/mibgroup/agentx/protocol.h"
+
+netsnmp_feature_require(snmp_split_pdu)
+netsnmp_feature_require(snmp_reset_var_types)
+
+
+#ifdef __GNUC__
+#define UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#endif
+
+extern const oid sysuptime_oid[];
+extern const size_t sysuptime_oid_len;
+extern const oid snmptrap_oid[];
+extern const size_t snmptrap_oid_len;
+
+static void
+usage(const char* progname)
+{
+ fprintf(stderr,
+ "USAGE: %s [OPTIONS] TRAP-PARAMETERS\n"
+ "\n"
+ " Version: %s\n"
+ " Web: http://www.net-snmp.org/\n"
+ " Email: net-snmp-coders@lists.sourceforge.net\n"
+ "\n"
+ "OPTIONS:\n", progname, netsnmp_get_version());
+
+ fprintf(stderr,
+ " -h\t\t\tdisplay this help message\n"
+ " -V\t\t\tdisplay package version number\n"
+ " -m MIB[:...]\t\tload given list of MIBs (ALL loads "
+ "everything)\n"
+ " -M DIR[:...]\t\tlook in given list of directories for MIBs\n"
+ " -D[TOKEN[,...]]\tturn on debugging output for the specified "
+ "TOKENs\n"
+ "\t\t\t (ALL gives extremely verbose debugging output)\n"
+ " -d\t\t\tdump all traffic\n");
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ fprintf(stderr,
+ " -P MIBOPTS\t\tToggle various defaults controlling mib "
+ "parsing:\n");
+ snmp_mib_toggle_options_usage("\t\t\t ", stderr);
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ fprintf(stderr,
+ " -L LOGOPTS\t\tToggle various defaults controlling logging:\n");
+ snmp_log_options_usage("\t\t\t ", stderr);
+
+ fprintf(stderr,
+ " -c context\n"
+ " -U uptime\n"
+ " -x ADDRESS\t\tuse ADDRESS as AgentX address\n"
+ "\n"
+ "TRAP-PARAMETERS:\n"
+ " trapoid [OID TYPE VALUE] ...\n");
+}
+
+struct tState_s;
+typedef const struct tState_s* tState;
+struct tState_s {
+ void (*entry)(tState self); /**<< State entry action */
+ void (*exit)(tState self); /**<< State exit action */
+ /** Handler for AgentX-Response-PDU's */
+ void (*response)(tState self, netsnmp_pdu *res);
+ /** State to change to if an AgentX timeout occurs or the timer runs out */
+ tState timeout;
+ void (*disconnect)(tState self); /**<< Handler for disconnect indications */
+ /** Handler for Close-PDU indications */
+ void (*close)(tState self, netsnmp_pdu *res);
+ const char* name; /**<< Name of the current state */
+ int is_open; /**<< If the connection is open in this state */
+};
+
+static tState state; /**<< Current state of the state machine */
+static tState next_state; /**<< Next state of the state machine */
+
+static const char *context = NULL; /**<< Context that delivers the trap */
+static size_t contextLen; /**<< Length of eventual context */
+static int result = 1; /**<< Program return value */
+static netsnmp_pdu *pdu = NULL; /**<< The trap pdu that is to be sent */
+/** The reference number of the next packet */
+static long packetid = 0;
+/** The session id of the session to the master */
+static long session;
+static void *sessp = NULL; /**<< The current communication session */
+
+#define STATE_CALL(method) \
+ if(!state->method) { \
+ snmp_log(LOG_ERR, "No " #method " method in %s, terminating\n", \
+ state->name); \
+ abort(); \
+ } else \
+ state->method
+
+static void
+change_state(tState new_state)
+{
+ if (next_state && next_state != new_state)
+ DEBUGMSGTL(("process", "Ignore transition to %s\n", next_state->name));
+ next_state = new_state;
+}
+
+static int
+handle_agentx_response(int operation, netsnmp_session *sp, UNUSED int reqid,
+ netsnmp_pdu *act, UNUSED void *magic)
+{
+ switch(operation) {
+ case NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE:
+ if(act->command == AGENTX_MSG_CLEANUPSET) {
+ /* Do nothing - no response and no action as nothing get
+ * allocated in any handler here
+ */
+ } else if(act->command != AGENTX_MSG_RESPONSE) {
+ /* Copy the head to a response */
+ netsnmp_pdu* res = snmp_split_pdu(act, 0, 0);
+ res->command = AGENTX_MSG_RESPONSE;
+ if (act->sessid != session || !state->is_open)
+ res->errstat = AGENTX_ERR_NOT_OPEN;
+ if(res->errstat == AGENTX_ERR_NOERROR)
+ switch(act->command) {
+ case AGENTX_MSG_GET:
+ res->variables = snmp_clone_varbind(act->variables);
+ snmp_reset_var_types(res->variables, SNMP_NOSUCHOBJECT);
+ break;
+ case AGENTX_MSG_GETNEXT:
+ case AGENTX_MSG_GETBULK:
+ res->variables = snmp_clone_varbind(act->variables);
+ snmp_reset_var_types(res->variables, SNMP_ENDOFMIBVIEW);
+ break;
+ case AGENTX_MSG_TESTSET:
+ res->errstat = SNMP_ERR_NOTWRITABLE;
+ res->errindex = 1;
+ break;
+ case AGENTX_MSG_COMMITSET:
+ res->errstat = SNMP_ERR_COMMITFAILED;
+ res->errindex = 1;
+ break;
+ case AGENTX_MSG_UNDOSET:
+ /* Success - could undo not setting any value :-) */
+ break;
+ case AGENTX_MSG_CLOSE:
+ /* Always let the master succeed! */
+ break;
+ default:
+ /* Unknown command */
+ res->errstat = AGENTX_ERR_PARSE_FAILED;
+ break;
+ }
+ if(snmp_send(sp, res) == 0)
+ snmp_free_pdu(res);
+ switch(act->command) {
+ case AGENTX_MSG_CLOSE:
+ /* Take action once the answer is sent! */
+ STATE_CALL(close)(state, act);
+ break;
+ default:
+ /* Do nothing */
+ break;
+ }
+ } else
+ /* RESPONSE act->time, act->errstat, act->errindex, varlist */
+ STATE_CALL(response)(state, act);
+ break;
+ case NETSNMP_CALLBACK_OP_TIMED_OUT:
+ change_state(state->timeout);
+ break;
+ case NETSNMP_CALLBACK_OP_DISCONNECT:
+ STATE_CALL(disconnect)(state);
+ break;
+ }
+ return 0;
+}
+
+extern const struct tState_s Connecting;
+extern const struct tState_s Opening;
+extern const struct tState_s Notifying;
+extern const struct tState_s Closing;
+extern const struct tState_s Disconnecting;
+extern const struct tState_s Exit;
+
+static void
+StateDisconnect(UNUSED tState self)
+{
+ snmp_log(LOG_ERR, "Unexpected disconnect in state %s\n", self->name);
+ change_state(&Disconnecting);
+}
+
+static void
+StateClose(UNUSED tState self, netsnmp_pdu *act)
+{
+ snmp_log(LOG_ERR, "Unexpected close with reason code %ld in state %s\n",
+ act->errstat, self->name);
+ change_state(&Disconnecting);
+}
+
+static void
+ConnectingEntry(UNUSED tState self)
+{
+ netsnmp_session init;
+ netsnmp_transport* t;
+ void* sess;
+
+ if(sessp) {
+ snmp_sess_close(sessp);
+ sessp = NULL;
+ }
+
+ snmp_sess_init(&init);
+ init.version = AGENTX_VERSION_1;
+ init.retries = 0; /* Retries are handled by the state machine */
+ init.timeout = SNMP_DEFAULT_TIMEOUT;
+ init.flags |= SNMP_FLAGS_STREAM_SOCKET;
+ init.callback = handle_agentx_response;
+ init.authenticator = NULL;
+
+ if(!(t = netsnmp_transport_open_client(
+ "agentx", netsnmp_ds_get_string(
+ NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET)))) {
+ snmp_perror("Failed to connect to AgentX server");
+ change_state(&Exit);
+ } else if(!(sess = snmp_sess_add_ex(
+ &init, t, NULL, agentx_parse, NULL, NULL,
+ agentx_realloc_build, agentx_check_packet, NULL))) {
+ snmp_perror("Failed to create session");
+ change_state(&Exit);
+ } else {
+ sessp = sess;
+ change_state(&Opening);
+ }
+}
+
+const struct tState_s Connecting = {
+ ConnectingEntry,
+ NULL,
+ NULL,
+ NULL,
+ StateDisconnect,
+ NULL,
+ "Connnecting",
+ 0
+};
+
+static netsnmp_pdu*
+pdu_create_opt_context(int command, const char* context, size_t len)
+{
+ netsnmp_pdu* res = snmp_pdu_create(command);
+ if (res)
+ if (context) {
+ if (snmp_clone_mem((void**)&res->contextName, context, len)) {
+ snmp_free_pdu(res);
+ res = NULL;
+ } else
+ res->contextNameLen = len;
+ }
+ return res;
+}
+
+static void
+OpeningEntry(UNUSED tState self)
+{
+ netsnmp_pdu* act =
+ pdu_create_opt_context(AGENTX_MSG_OPEN, context, contextLen);
+ if(act) {
+ act->sessid = 0;
+ act->transid = 0;
+ act->reqid = ++packetid;
+ act->time = 0;
+ snmp_pdu_add_variable(act, NULL, 0, ASN_OCTET_STR, NULL, 0);
+ if(snmp_sess_send(sessp, act) == 0)
+ snmp_free_pdu(act);
+ }
+}
+
+static void
+OpeningRes(UNUSED tState self, netsnmp_pdu *act)
+{
+ if(act->errstat == AGENTX_ERR_NOERROR) {
+ session = act->sessid;
+ change_state(&Notifying);
+ } else {
+ snmp_perror("Failed to open session");
+ change_state(&Exit);
+ }
+}
+
+const struct tState_s Opening = {
+ OpeningEntry,
+ NULL,
+ OpeningRes,
+ &Disconnecting,
+ StateDisconnect,
+ StateClose,
+ "Opening",
+ 0
+};
+
+static void
+NotifyingEntry(UNUSED tState self)
+{
+ netsnmp_pdu* act = snmp_clone_pdu(pdu);
+ if(act) {
+ act->sessid = session;
+ act->transid = 0;
+ act->reqid = ++packetid;
+ if(snmp_sess_send(sessp, act) == 0)
+ snmp_free_pdu(act);
+ }
+}
+
+static void
+NotifyingRes(UNUSED tState self, netsnmp_pdu *act)
+{
+ if(act->errstat == AGENTX_ERR_NOERROR)
+ result = 0;
+ else
+ snmp_perror("Failed to send notification");
+ /** \todo: Retry handling --- ClosingReconnect??? */
+ change_state(&Closing);
+}
+
+const struct tState_s Notifying = {
+ NotifyingEntry,
+ NULL,
+ NotifyingRes,
+ NULL, /** \todo: Retry handling? */
+ StateDisconnect, /** \todo: Retry handling? */
+ StateClose,
+ "Notifying",
+ 1
+};
+
+static void
+ClosingEntry(UNUSED tState self)
+{
+ /* CLOSE pdu->errstat */
+ netsnmp_pdu* act =
+ pdu_create_opt_context(AGENTX_MSG_CLOSE, context, contextLen);
+ if(act) {
+ act->sessid = session;
+ act->transid = 0;
+ act->reqid = ++packetid;
+ act->errstat = AGENTX_CLOSE_SHUTDOWN;
+ if(snmp_sess_send(sessp, act) == 0)
+ snmp_free_pdu(act);
+ }
+}
+
+static void
+ClosingRes(UNUSED tState self, netsnmp_pdu *act)
+{
+ if(act->errstat != AGENTX_ERR_NOERROR) {
+ snmp_log(LOG_ERR, "AgentX error status of %ld\n", act->errstat);
+ }
+ change_state(&Disconnecting);
+}
+
+static void
+ClosingDisconnect(UNUSED tState self)
+{
+ change_state(&Disconnecting);
+}
+
+static void
+ClosingClose(UNUSED tState self, UNUSED netsnmp_pdu *act)
+{
+ change_state(&Disconnecting);
+}
+
+const struct tState_s Closing = {
+ ClosingEntry,
+ NULL,
+ ClosingRes,
+ &Disconnecting,
+ ClosingDisconnect,
+ ClosingClose,
+ "Closing",
+ 1
+};
+
+static void
+DisconnectingEntry(UNUSED tState self)
+{
+ snmp_sess_close(sessp);
+ sessp = NULL;
+ change_state(&Exit);
+}
+
+const struct tState_s Disconnecting = {
+ DisconnectingEntry,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Disconnecting",
+ 0
+};
+
+const struct tState_s Exit = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Exit",
+ 0
+};
+
+int
+main(int argc, char *argv[])
+{
+ int arg;
+ char *prognam;
+ char *cp = NULL;
+
+ const char* sysUpTime = NULL;
+
+ prognam = strrchr(argv[0], '/');
+ if (prognam)
+ ++prognam;
+ else
+ prognam = argv[0];
+
+ putenv(strdup("POSIXLY_CORRECT=1"));
+
+ while ((arg = getopt(argc, argv, ":Vhm:M:D:dP:L:U:c:x:")) != -1) {
+ switch (arg) {
+ case 'h':
+ usage(prognam);
+ exit(0);
+ case 'm':
+ setenv("MIBS", optarg, 1);
+ break;
+ case 'M':
+ setenv("MIBDIRS", optarg, 1);
+ break;
+ case 'c':
+ context = optarg;
+ contextLen = strlen(context);
+ break;
+ case 'D':
+ debug_register_tokens(optarg);
+ snmp_set_do_debugging(1);
+ break;
+ case 'd':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET, 1);
+ break;
+ case 'U':
+ sysUpTime = optarg;
+ break;
+ case 'V':
+ fprintf(stderr, "NET-SNMP version: %s\n", netsnmp_get_version());
+ exit(0);
+ break;
+#ifndef DISABLE_MIB_LOADING
+ case 'P':
+ cp = snmp_mib_toggle_options(optarg);
+ if (cp != NULL) {
+ fprintf(stderr, "Unknown parser option to -P: %c.\n", *cp);
+ usage(prognam);
+ exit(1);
+ }
+ break;
+#endif /* DISABLE_MIB_LOADING */
+ case 'L':
+ if (snmp_log_options(optarg, argc, argv) < 0) {
+ exit(1);
+ }
+ break;
+ case 'x':
+ if (optarg != NULL) {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET, optarg);
+ } else
+ usage(argv[0]);
+ break;
+
+ case ':':
+ fprintf(stderr, "Option -%c requires an operand\n", optopt);
+ usage(prognam);
+ exit(1);
+ break;
+ case '?':
+ fprintf(stderr, "Unrecognized option: -%c\n", optopt);
+ usage(prognam);
+ exit(1);
+ break;
+ }
+ }
+
+ arg = optind;
+
+ /* initialize tcpip, if necessary */
+ SOCK_STARTUP;
+
+ init_snmp("snmpapp");
+ agentx_config_init();
+
+ /* NOTIFY varlist */
+ pdu = pdu_create_opt_context(AGENTX_MSG_NOTIFY, context, contextLen);
+
+ if (sysUpTime)
+ snmp_add_var(pdu, sysuptime_oid, sysuptime_oid_len, 't', sysUpTime);
+
+ if (arg == argc) {
+ fprintf(stderr, "Missing trap-oid parameter\n");
+ usage(prognam);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ if (snmp_add_var(pdu, snmptrap_oid, snmptrap_oid_len, 'o', argv[arg])) {
+ snmp_perror(argv[arg]);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ ++arg;
+
+ while (arg < argc) {
+ oid name[MAX_OID_LEN];
+ size_t name_length = MAX_OID_LEN;
+ arg += 3;
+ if (arg > argc) {
+ fprintf(stderr, "%s: Missing type/value for variable\n",
+ argv[arg - 3]);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ if (!snmp_parse_oid(argv[arg - 3], name, &name_length)) {
+ snmp_perror(argv[arg - 3]);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ if (snmp_add_var(pdu, name, name_length, argv[arg - 2][0],
+ argv[arg - 1]) != 0) {
+ snmp_perror(argv[arg - 3]);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ }
+
+ packetid = 0;
+
+ state = &Connecting;
+ next_state = NULL;
+ if(state->entry) state->entry(state);
+
+ /* main loop here... */
+ for(;;) {
+ int block = 1;
+ int numfds = 0;
+ int count;
+ fd_set fdset;
+ struct timeval timeout;
+
+ while(next_state) {
+ if(state->exit) state->exit(state);
+ DEBUGMSGTL(("process", "State transition: %s -> %s\n",
+ state->name, next_state->name));
+ state = next_state;
+ next_state = NULL;
+ if(state->entry) state->entry(state);
+ }
+
+ if(state == &Exit)
+ break;
+
+ FD_ZERO(&fdset);
+ snmp_sess_select_info(sessp, &numfds, &fdset, &timeout, &block);
+ count = select(numfds, &fdset, NULL, NULL, !block ? &timeout : NULL);
+ if (count > 0)
+ snmp_sess_read(sessp, &fdset);
+ else if (count == 0)
+ snmp_sess_timeout(sessp);
+ else if (errno != EINTR) {
+ snmp_log(LOG_ERR, "select error [%s]\n", strerror(errno));
+ change_state(&Exit);
+ }
+ }
+
+ /* at shutdown time */
+ snmp_free_pdu(pdu);
+ pdu = NULL;
+
+ snmp_shutdown("snmpapp");
+
+ SOCK_CLEANUP;
+ exit(result);
+}
diff --git a/apps/encode_keychange.c b/apps/encode_keychange.c
new file mode 100644
index 0000000..5bf8e4c
--- /dev/null
+++ b/apps/encode_keychange.c
@@ -0,0 +1,803 @@
+/*
+ * encode_keychange.c
+ *
+ * Collect information to build a KeyChange encoding, per the textual
+ * convention given in RFC 2274, Section 5. Compute the value and
+ * dump to stdout as a string of hex nibbles.
+ *
+ *
+ * Passphrase material may come from many sources. The following are
+ * checked in order (see get_user_passphrases()):
+ * - Prompt always if -f is given.
+ * - Commandline arguments.
+ * - PASSPHRASE_FILE.
+ * - Prompts on stdout. Use -P to turn off prompt tags.
+ *
+ *
+ * FIX Better name?
+ * FIX Change encode_keychange() to take random bits?
+ * FIX QUITFUN not quite appropriate here...
+ * FIX This is slow...
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#include <stdlib.h>
+
+/*
+ * Globals, &c...
+ */
+char *local_progname;
+char *local_passphrase_filename;
+
+#define NL "\n"
+
+#define USAGE "Usage: %s [-fhPvV] -t (md5|sha1) [-O \"<old_passphrase>\"][-N \"<new_passphrase>\"][-E [0x]<engineID>]"
+
+#define OPTIONLIST "E:fhN:O:Pt:vVD"
+
+#define PASSPHRASE_DIR ".snmp"
+ /*
+ * Rooted at $HOME.
+ */
+#define PASSPHRASE_FILE "passphrase.ek"
+ /*
+ * Format: two lines containing old and new passphrases, nothing more.
+ *
+ * XXX Add creature comforts like: comments and
+ * tokens identifying passphrases, separate directory check,
+ * check in current directory (?), traverse a path of
+ * directories (?)...
+ * FIX Better name?
+ */
+
+
+int forcepassphrase = 0, /* Always prompt for passphrases. */
+ promptindicator = 1, /* Output an indicator that input
+ * is requested. */
+ visible = 0, /* Echo passphrases to terminal. */
+ verbose = 0; /* Output progress to stderr. */
+size_t engineid_len = 0;
+
+u_char *engineid = NULL; /* Both input & final binary form. */
+char *newpass = NULL, *oldpass = NULL;
+
+char *transform_type_input = NULL;
+
+const oid *transform_type = NULL; /* Type of HMAC hash to use. */
+
+
+
+/*
+ * Prototypes.
+ */
+void usage_to_file(FILE * ofp);
+void usage_synopsis(FILE * ofp);
+int get_user_passphrases(void);
+int snmp_ttyecho(const int fd, const int echo);
+char *snmp_getpassphrase(const char *prompt, int fvisible);
+
+#ifdef WIN32
+#define HAVE_GETPASS 1
+char *getpass(const char *prompt);
+int isatty(int);
+int _cputs(const char *);
+int _getch(void);
+#endif
+
+/*******************************************************************-o-******
+ */
+int
+main(int argc, char **argv)
+{
+ int rval = 1;
+ size_t oldKu_len = SNMP_MAXBUF_SMALL,
+ newKu_len = SNMP_MAXBUF_SMALL,
+ oldkul_len = SNMP_MAXBUF_SMALL,
+ newkul_len = SNMP_MAXBUF_SMALL, keychange_len = SNMP_MAXBUF_SMALL;
+
+ char *s = NULL;
+ u_char oldKu[SNMP_MAXBUF_SMALL],
+ newKu[SNMP_MAXBUF_SMALL],
+ oldkul[SNMP_MAXBUF_SMALL],
+ newkul[SNMP_MAXBUF_SMALL], keychange[SNMP_MAXBUF_SMALL];
+
+ int i;
+ int arg = 1;
+
+ local_progname = argv[0];
+ local_passphrase_filename = (char *) malloc(sizeof(PASSPHRASE_DIR) +
+ sizeof(PASSPHRASE_FILE) +
+ 4);
+ if (!local_passphrase_filename) {
+ fprintf(stderr, "%s: out of memory!", local_progname);
+ exit(-1);
+ }
+ sprintf(local_passphrase_filename, "%s/%s", PASSPHRASE_DIR,
+ PASSPHRASE_FILE);
+
+
+
+ /*
+ * Parse.
+ */
+ for (; (arg < argc) && (argv[arg][0] == '-'); arg++) {
+ switch (argv[arg][1]) {
+ case 'D':
+ snmp_set_do_debugging(1);
+ break;
+ case 'E':
+ engineid = (u_char *) argv[++arg];
+ break;
+ case 'f':
+ forcepassphrase = 1;
+ break;
+ case 'N':
+ newpass = argv[++arg];
+ break;
+ case 'O':
+ oldpass = argv[++arg];
+ break;
+ case 'P':
+ promptindicator = 0;
+ break;
+ case 't':
+ transform_type_input = argv[++arg];
+ break;
+ case 'v':
+ verbose = 1;
+ break;
+ case 'V':
+ visible = 1;
+ break;
+ case 'h':
+ rval = 0;
+ /* fallthrough */
+ default:
+ usage_to_file(stdout);
+ exit(rval);
+ }
+ }
+
+ if (!transform_type_input) {
+ fprintf(stderr, "The -t option is mandatory.\n");
+ usage_synopsis(stdout);
+ exit(1000);
+ }
+
+
+
+ /*
+ * Convert and error check transform_type.
+ */
+#ifndef NETSNMP_DISABLE_MD5
+ if (!strcmp(transform_type_input, "md5")) {
+ transform_type = usmHMACMD5AuthProtocol;
+
+ } else
+#endif
+ if (!strcmp(transform_type_input, "sha1")) {
+ transform_type = usmHMACSHA1AuthProtocol;
+
+ } else {
+ fprintf(stderr,
+ "Unrecognized hash transform: \"%s\".\n",
+ transform_type_input);
+ usage_synopsis(stderr);
+ QUITFUN(SNMPERR_GENERR, main_quit);
+ }
+
+ if (verbose) {
+ fprintf(stderr, "Hash:\t\t%s\n",
+#ifndef NETSNMP_DISABLE_MD5
+ (transform_type == usmHMACMD5AuthProtocol)
+ ? "usmHMACMD5AuthProtocol" :
+#endif
+ "usmHMACSHA1AuthProtocol"
+ );
+ }
+
+
+
+ /*
+ * Build engineID. Accept hex engineID as the bits
+ * "in-and-of-themselves", otherwise create an engineID with the
+ * given string as text.
+ *
+ * If no engineID is given, lookup the first IP address for the
+ * localhost and use that (see setup_engineID()).
+ */
+ if (engineid && (tolower(*(engineid + 1)) == 'x')) {
+ engineid_len = hex_to_binary2(engineid + 2,
+ strlen((char *) engineid) - 2,
+ (char **) &engineid);
+ DEBUGMSGTL(("encode_keychange", "engineIDLen: %lu\n",
+ (unsigned long)engineid_len));
+ } else {
+ engineid_len = setup_engineID(&engineid, (char *) engineid);
+
+ }
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ if (verbose) {
+ fprintf(stderr, "EngineID:\t%s\n",
+ /*
+ * XXX =
+ */ dump_snmpEngineID(engineid, &engineid_len));
+ }
+#endif
+
+
+ /*
+ * Get passphrases from user.
+ */
+ rval = get_user_passphrases();
+ QUITFUN(rval, main_quit);
+
+ if (strlen(oldpass) < USM_LENGTH_P_MIN) {
+ fprintf(stderr, "Old passphrase must be greater than %d "
+ "characters in length.\n", USM_LENGTH_P_MIN);
+ QUITFUN(SNMPERR_GENERR, main_quit);
+
+ } else if (strlen(newpass) < USM_LENGTH_P_MIN) {
+ fprintf(stderr, "New passphrase must be greater than %d "
+ "characters in length.\n", USM_LENGTH_P_MIN);
+ QUITFUN(SNMPERR_GENERR, main_quit);
+ }
+
+ if (verbose) {
+ fprintf(stderr,
+ "Old passphrase:\t%s\nNew passphrase:\t%s\n",
+ oldpass, newpass);
+ }
+
+
+
+ /*
+ * Compute Ku and Kul's from old and new passphrases, then
+ * compute the keychange string & print it out.
+ */
+ rval = sc_init();
+ QUITFUN(rval, main_quit);
+
+
+ rval = generate_Ku(transform_type, USM_LENGTH_OID_TRANSFORM,
+ (u_char *) oldpass, strlen(oldpass),
+ oldKu, &oldKu_len);
+ QUITFUN(rval, main_quit);
+
+
+ rval = generate_Ku(transform_type, USM_LENGTH_OID_TRANSFORM,
+ (u_char *) newpass, strlen(newpass),
+ newKu, &newKu_len);
+ QUITFUN(rval, main_quit);
+
+
+ DEBUGMSGTL(("encode_keychange", "EID (%lu): ", (unsigned long)engineid_len));
+ for (i = 0; i < (int) engineid_len; i++)
+ DEBUGMSGTL(("encode_keychange", "%02x", (int) (engineid[i])));
+ DEBUGMSGTL(("encode_keychange", "\n"));
+
+ DEBUGMSGTL(("encode_keychange", "old Ku (%lu) (from %s): ", (unsigned long)oldKu_len,
+ oldpass));
+ for (i = 0; i < (int) oldKu_len; i++)
+ DEBUGMSGTL(("encode_keychange", "%02x", (int) (oldKu[i])));
+ DEBUGMSGTL(("encode_keychange", "\n"));
+
+ rval = generate_kul(transform_type, USM_LENGTH_OID_TRANSFORM,
+ engineid, engineid_len,
+ oldKu, oldKu_len, oldkul, &oldkul_len);
+ QUITFUN(rval, main_quit);
+
+
+ DEBUGMSGTL(("encode_keychange", "generating old Kul (%lu) (from Ku): ",
+ (unsigned long)oldkul_len));
+ for (i = 0; i < (int) oldkul_len; i++)
+ DEBUGMSGTL(("encode_keychange", "%02x", (int) (oldkul[i])));
+ DEBUGMSGTL(("encode_keychange", "\n"));
+
+ rval = generate_kul(transform_type, USM_LENGTH_OID_TRANSFORM,
+ engineid, engineid_len,
+ newKu, newKu_len, newkul, &newkul_len);
+ QUITFUN(rval, main_quit);
+
+ DEBUGMSGTL(("encode_keychange", "generating new Kul (%lu) (from Ku): ",
+ (unsigned long)oldkul_len));
+ for (i = 0; i < (int) newkul_len; i++)
+ DEBUGMSGTL(("encode_keychange", "%02x", newkul[i]));
+ DEBUGMSGTL(("encode_keychange", "\n"));
+
+ rval = encode_keychange(transform_type, USM_LENGTH_OID_TRANSFORM,
+ oldkul, oldkul_len,
+ newkul, newkul_len, keychange, &keychange_len);
+ QUITFUN(rval, main_quit);
+
+
+
+ binary_to_hex(keychange, keychange_len, &s);
+ printf("%s%s\n", (verbose) ? "KeyChange string:\t" : "", /* XXX stdout */
+ s);
+
+
+ /*
+ * Cleanup.
+ */
+ main_quit:
+ snmp_call_callbacks(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_SHUTDOWN,
+ NULL);
+
+
+ SNMP_ZERO(oldpass, strlen(oldpass));
+ SNMP_ZERO(newpass, strlen(newpass));
+
+ memset(oldKu, 0, oldKu_len);
+ memset(newKu, 0, newKu_len);
+
+ memset(oldkul, 0, oldkul_len);
+ memset(newkul, 0, newkul_len);
+
+ SNMP_ZERO(s, strlen(s));
+
+ return rval;
+
+} /* end main() */
+
+
+
+
+/*******************************************************************-o-******
+ */
+void
+usage_synopsis(FILE * ofp)
+{
+ fprintf(ofp, USAGE "\n\
+\n\
+ -E [0x]<engineID> EngineID used for kul generation.\n\
+ -f Force passphrases to be read from stdin.\n\
+ -h Help.\n\
+ -N \"<new_passphrase>\" Passphrase used to generate new Ku.\n\
+ -O \"<old_passphrase>\" Passphrase used to generate old Ku.\n\
+ -P Turn off prompt indicators.\n\
+ -t md5 | sha1 HMAC hash transform type.\n\
+ -v Verbose.\n\
+ -V Visible. Echo passphrases to terminal.\n\
+ " NL, local_progname);
+
+} /* end usage_synopsis() */
+
+void
+usage_to_file(FILE * ofp)
+{
+ char *s;
+
+ usage_synopsis(ofp);
+
+ fprintf(ofp, "\n%s\
+ a) Commandline options,\n\
+ b) The file \"%s/%s\",\n\
+ c) stdin -or- User input from the terminal.\n\n%s\
+ " NL,
+ "Only -t is mandatory. The transform is used to convert P=>Ku, convert\n\
+ Ku=>Kul, and to hash the old Kul with the random bits.\n\
+\n\
+ Passphrase will be taken from the first successful source as follows:\n",
+ (s = getenv("HOME")) ? s : "$HOME", local_passphrase_filename,
+ "-f will require reading from the stdin/terminal, ignoring a) and b).\n\
+ -P will prevent prompts for passphrases to stdout from being printed.\n\
+\n\
+ <engineID> is interpreted as a hex string when preceeded by \"0x\",\n\
+ otherwise it is created to contain \"text\". If nothing is given,\n\
+ <engineID> is constructed from the first IP address for the local host.\n");
+
+
+ /*
+ * FIX -- make this possible?
+ * -r [0x]<random_bits> Random bits used in KeyChange XOR.
+ *
+ * <engineID> and <random_bits> are interpreted as hex strings when
+ * preceeded by \"0x\", otherwise <engineID> is created to contain \"text\"
+ * and <random_bits> are the same as the ascii input.
+ *
+ * <random_bits> will be generated by SCAPI if not given. If value is
+ * too long, it will be truncated; if too short, the remainder will be
+ * filled in with zeros.
+ */
+
+} /* end usage() */
+
+
+/*
+ * this defined for HPUX aCC because the aCC doesn't drop the
+ */
+/*
+ * snmp_parse_args.c functionality if compile with -g, PKY
+ */
+
+void
+usage(void)
+{
+ usage_to_file(stdout);
+}
+
+
+
+
+
+/*******************************************************************-o-******
+ * get_user_passphrases
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMPERR_GENERR Otherwise.
+ *
+ *
+ * Acquire new and old passphrases from the user:
+ *
+ * + Always prompt if 'forcepassphrase' is set.
+ * + Use given arguments if they are defined.
+ * + Otherwise read file format from PASSPHRASE_FILE.
+ * Sanity check existence and permissions of the path.
+ * ASSUME for now that PASSPHRASE_FILE is rooted only at $HOME.
+ * + Otherwise prompt user for passphrase(s).
+ * Echo input if 'visible' is set.
+ * Turning off 'promptindicator' makes piping in input cleaner.
+ *
+ * NOTE Only using forcepassphrase mandates taking both passphrases
+ * from the same source. Otherwise processing continues until both
+ * passphrases are defined.
+ */
+int
+get_user_passphrases(void)
+{
+ int rval = SNMPERR_SUCCESS;
+ size_t len;
+
+ char *obuf = NULL, *nbuf = NULL;
+
+ char path[SNMP_MAXBUF], buf[SNMP_MAXBUF], *s = NULL;
+
+ struct stat statbuf;
+ FILE *fp = NULL;
+
+
+
+ /*
+ * Allow prompts to the user to override all other sources.
+ * Nothing to do otherwise if oldpass and newpass are already defined.
+ */
+ if (forcepassphrase)
+ goto get_user_passphrases_prompt;
+ if (oldpass && newpass)
+ goto get_user_passphrases_quit;
+
+
+
+ /*
+ * Read passphrases out of PASSPHRASE_FILE. Sanity check the
+ * path for existence and access first. Refuse to read
+ * if the permissions are wrong.
+ */
+ s = getenv("HOME");
+ snprintf(path, sizeof(path), "%s/%s", s, PASSPHRASE_DIR);
+ path[ sizeof(path)-1 ] = 0;
+
+ /*
+ * Test directory.
+ */
+ if (stat(path, &statbuf) < 0) {
+ fprintf(stderr, "Cannot access directory \"%s\".\n", path);
+ QUITFUN(SNMPERR_GENERR, get_user_passphrases_quit);
+#ifndef WIN32
+ } else if (statbuf.st_mode & (S_IRWXG | S_IRWXO)) {
+ fprintf(stderr,
+ "Directory \"%s\" is accessible by group or world.\n",
+ path);
+ QUITFUN(SNMPERR_GENERR, get_user_passphrases_quit);
+#endif /* !WIN32 */
+ }
+
+ /*
+ * Test file.
+ */
+ snprintf(path, sizeof(path), "%s/%s", s, local_passphrase_filename);
+ path[ sizeof(path)-1 ] = 0;
+ if (stat(path, &statbuf) < 0) {
+ fprintf(stderr, "Cannot access file \"%s\".\n", path);
+ QUITFUN(SNMPERR_GENERR, get_user_passphrases_quit);
+#ifndef WIN32
+ } else if (statbuf.st_mode & (S_IRWXG | S_IRWXO)) {
+ fprintf(stderr,
+ "File \"%s\" is accessible by group or world.\n", path);
+ QUITFUN(SNMPERR_GENERR, get_user_passphrases_quit);
+#endif /* !WIN32 */
+ }
+
+ /*
+ * Open the file.
+ */
+ if ((fp = fopen(path, "r")) == NULL) {
+ fprintf(stderr, "Cannot open \"%s\".", path);
+ QUITFUN(SNMPERR_GENERR, get_user_passphrases_quit);
+ }
+
+ /*
+ * Read 1st line.
+ */
+ if (!fgets(buf, sizeof(buf), fp)) {
+ if (verbose) {
+ fprintf(stderr, "Passphrase file \"%s\" is empty...\n", path);
+ }
+ goto get_user_passphrases_prompt;
+
+ } else if (!oldpass) {
+ len = strlen(buf);
+ if (buf[len - 1] == '\n')
+ buf[--len] = '\0';
+ oldpass = (char *) calloc(1, len + 1);
+ if (oldpass)
+ memcpy(oldpass, buf, len + 1);
+ }
+ /*
+ * Read 2nd line.
+ */
+ if (!fgets(buf, sizeof(buf), fp)) {
+ if (verbose) {
+ fprintf(stderr, "Only one line in file \"%s\"...\n", path);
+ }
+
+ } else if (!newpass) {
+ len = strlen(buf);
+ if (buf[len - 1] == '\n')
+ buf[--len] = '\0';
+ newpass = (char *) calloc(1, len + 1);
+ if (newpass)
+ memcpy(newpass, buf, len + 1);
+ }
+
+ if (oldpass && newpass)
+ goto get_user_passphrases_quit;
+
+
+
+ /*
+ * Prompt the user for passphrase entry. Visible prompts
+ * may be omitted, and invisible entry may turned off.
+ */
+ get_user_passphrases_prompt:
+ if (forcepassphrase) {
+ oldpass = newpass = NULL;
+ }
+
+ if (!oldpass) {
+ oldpass = obuf
+ = snmp_getpassphrase((promptindicator) ? "Old passphrase: " :
+ "", visible);
+ }
+ if (!newpass) {
+ newpass = nbuf
+ = snmp_getpassphrase((promptindicator) ? "New passphrase: " :
+ "", visible);
+ }
+
+
+
+ /*
+ * Check that both passphrases were defined.
+ */
+ if (oldpass && newpass) {
+ goto get_user_passphrases_quit;
+ } else {
+ rval = SNMPERR_GENERR;
+ }
+
+
+ get_user_passphrases_quit:
+ memset(buf, 0, SNMP_MAXBUF);
+
+ if (obuf != oldpass) {
+ SNMP_ZERO(obuf, strlen(obuf));
+ SNMP_FREE(obuf);
+ }
+ if (nbuf != newpass) {
+ SNMP_ZERO(nbuf, strlen(nbuf));
+ SNMP_FREE(nbuf);
+ }
+
+ if (fp)
+ fclose (fp);
+
+ return rval;
+
+} /* end get_user_passphrases() */
+
+/*******************************************************************-o-******
+ * snmp_ttyecho
+ *
+ * Parameters:
+ * fd Descriptor of terminal on which to toggle echoing.
+ * echo TRUE if echoing should be on; FALSE otherwise.
+ *
+ * Returns:
+ * Previous value of echo setting.
+ *
+ *
+ * FIX Put HAVE_TCGETATTR in autoconf?
+ */
+#ifndef HAVE_GETPASS
+#ifdef HAVE_TCGETATTR
+#include <termios.h>
+int
+snmp_ttyecho(const int fd, const int echo)
+{
+ struct termios tio;
+ int was_echo;
+
+
+ if (!isatty(fd))
+ return (-1);
+ tcgetattr(fd, &tio);
+ was_echo = (tio.c_lflag & ECHO) != 0;
+ if (echo)
+ tio.c_lflag |= (ECHO | ECHONL);
+ else
+ tio.c_lflag &= ~(ECHO | ECHONL);
+ tcsetattr(fd, TCSANOW, &tio);
+
+ return (was_echo);
+
+} /* end snmp_ttyecho() */
+
+#else
+#include <sgtty.h>
+int
+snmp_ttyecho(const int fd, const int echo)
+{
+ struct sgttyb ttyparams;
+ int was_echo;
+
+
+ if (!isatty(fd))
+ was_echo = -1;
+ else {
+ ioctl(fd, TIOCGETP, &ttyparams);
+ was_echo = (ttyparams.sg_flags & ECHO) != 0;
+ if (echo)
+ ttyparams.sg_flags = ttyparams.sg_flags | ECHO;
+ else
+ ttyparams.sg_flags = ttyparams.sg_flags & ~ECHO;
+ ioctl(fd, TIOCSETP, &ttyparams);
+ }
+
+ return (was_echo);
+
+} /* end snmp_ttyecho() */
+#endif /* HAVE_TCGETATTR */
+#endif /* HAVE_GETPASS */
+
+
+
+
+/*******************************************************************-o-******
+ * snmp_getpassphrase
+ *
+ * Parameters:
+ * *prompt (May be NULL.)
+ * bvisible TRUE means echo back user input.
+ *
+ * Returns:
+ * Pointer to newly allocated, null terminated string containing
+ * passphrase -OR-
+ * NULL on error.
+ *
+ *
+ * Prompt stdin for a string (or passphrase). Return a copy of the
+ * input in a null terminated string.
+ *
+ * FIX Put HAVE_GETPASS in autoconf.
+ */
+char *
+snmp_getpassphrase(const char *prompt, int bvisible)
+{
+ int ti = 0;
+ size_t len;
+
+ char *bufp = NULL;
+ static char buffer[SNMP_MAXBUF];
+
+ FILE *ofp = stdout;
+
+
+ /*
+ * Query stdin for a passphrase.
+ */
+#ifdef HAVE_GETPASS
+ if (isatty(0)) {
+ return getpass((prompt) ? prompt : "");
+ }
+#endif
+
+ fputs((prompt) ? prompt : "", ofp);
+
+ if (!bvisible) {
+ ti = snmp_ttyecho(0, 0);
+ }
+
+ bufp = fgets(buffer, sizeof(buffer), stdin);
+
+ if (!bvisible) {
+ ti = snmp_ttyecho(0, ti);
+ fputs("\n", ofp);
+ }
+ if (!bufp) {
+ fprintf(stderr, "Aborted...\n");
+ exit(1);
+ }
+
+
+ /*
+ * Copy the input and zero out the read-in buffer.
+ */
+ len = strlen(buffer);
+ if (buffer[len - 1] == '\n')
+ buffer[--len] = '\0';
+
+ bufp = (char *) calloc(1, len + 1);
+ if (bufp)
+ memcpy(bufp, buffer, len + 1);
+
+ memset(buffer, 0, SNMP_MAXBUF);
+
+
+ return bufp;
+
+} /* end snmp_getpassphrase() */
+
+#ifdef WIN32
+
+int
+snmp_ttyecho(const int fd, const int echo)
+{
+ return 0;
+}
+
+/*
+ * stops at the first newline, carrier return, or backspace.
+ * WARNING! _getch does NOT read <Ctrl-C>
+ */
+char *
+getpass(const char *prompt)
+{
+ static char pbuf[128];
+ int ch, lim;
+
+ _cputs(prompt);
+ for (ch = 0, lim = 0; ch != '\n' && lim < sizeof(pbuf)-1;) {
+ ch = _getch(); /* look ma, no echo ! */
+ if (ch == '\r' || ch == '\n' || ch == '\b')
+ break;
+ pbuf[lim++] = ch;
+ }
+ pbuf[lim] = '\0';
+ puts("\n");
+
+ return pbuf;
+}
+#endif /* WIN32 */
diff --git a/apps/snmp_perl_trapd.pl b/apps/snmp_perl_trapd.pl
new file mode 100644
index 0000000..edae3ae
--- /dev/null
+++ b/apps/snmp_perl_trapd.pl
@@ -0,0 +1,15 @@
+##
+## SNMPTRAPD perl initialization file.
+##
+
+# DO NOT EDIT THIS FILE
+#
+# This file is intended for initialization of the perl subsystem used by
+# snmptrapd. Though it could be modified by a local administrator to do
+# things, it should not be as it will be overwritten by future
+# Net-SNMP installations. Run "perldoc NetSNMP::TrapReceiver" for
+# documentation on how to use perl within snmptrapd.
+
+use NetSNMP::TrapReceiver;
+
+
diff --git a/apps/snmpbulkget.c b/apps/snmpbulkget.c
new file mode 100644
index 0000000..2e9ee34
--- /dev/null
+++ b/apps/snmpbulkget.c
@@ -0,0 +1,250 @@
+/*
+ * snmpbulkget.c - send SNMPv2 Bulk requests to a network entity.
+ *
+ */
+/*********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+**********************************************************************/
+#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
+#include <net-snmp/utilities.h>
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+oid objid_mib[] = { 1, 3, 6, 1, 2, 1 };
+int max_repetitions = 10;
+int non_repeaters = 0;
+struct nameStruct {
+ oid name[MAX_OID_LEN];
+ size_t name_len;
+} *name, *namep;
+int names;
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmpbulkget ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " OID [OID]...\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr,
+ " -C APPOPTS\t\tSet various application specific behaviours:\n");
+ fprintf(stderr, "\t\t\t n<NUM>: set non-repeaters to <NUM>\n");
+ fprintf(stderr, "\t\t\t r<NUM>: set max-repeaters to <NUM>\n");
+}
+
+static
+ void
+optProc(int argc, char *const *argv, int opt)
+{
+ char *endptr = NULL;
+
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'n':
+ case 'r':
+ if (*(optarg - 1) == 'r') {
+ max_repetitions = strtol(optarg, &endptr, 0);
+ } else {
+ non_repeaters = strtol(optarg, &endptr, 0);
+ }
+
+ if (endptr == optarg) {
+ /*
+ * No number given -- error.
+ */
+ usage();
+ exit(1);
+ } else {
+ optarg = endptr;
+ if (isspace((unsigned char)(*optarg))) {
+ return;
+ }
+ }
+ break;
+
+ default:
+ fprintf(stderr, "Unknown flag passed to -C: %c\n",
+ optarg[-1]);
+ exit(1);
+ }
+ }
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu;
+ netsnmp_pdu *response;
+ netsnmp_variable_list *vars;
+ int arg;
+ int count;
+ int status;
+ int exitval = 0;
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ names = argc - arg;
+ if (names < non_repeaters) {
+ fprintf(stderr, "snmpbulkget: need more objects than <nonrep>\n");
+ exit(1);
+ }
+
+ namep = name = (struct nameStruct *) calloc(names, sizeof(*name));
+ while (arg < argc) {
+ namep->name_len = MAX_OID_LEN;
+ if (snmp_parse_oid(argv[arg], namep->name, &namep->name_len) ==
+ NULL) {
+ snmp_perror(argv[arg]);
+ exit(1);
+ }
+ arg++;
+ namep++;
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpbulkget", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ /*
+ * create PDU for GETBULK request and add object name to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETBULK);
+ pdu->non_repeaters = non_repeaters;
+ pdu->max_repetitions = max_repetitions; /* fill the packet */
+ for (arg = 0; arg < names; arg++)
+ snmp_add_null_var(pdu, name[arg].name, name[arg].name_len);
+
+ /*
+ * do the request
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ /*
+ * check resulting variables
+ */
+ for (vars = response->variables; vars;
+ vars = vars->next_variable)
+ print_variable(vars->name, vars->name_length, vars);
+ } else {
+ /*
+ * error in response, print it
+ */
+ if (response->errstat == SNMP_ERR_NOSUCHNAME) {
+ printf("End of MIB.\n");
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && (count != response->errindex);
+ vars = vars->next_variable, count++)
+ /*EMPTY*/;
+ if (vars)
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ session.peername);
+ exitval = 1;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpbulkget", ss);
+ exitval = 1;
+ }
+
+ if (response)
+ snmp_free_pdu(response);
+
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return exitval;
+}
diff --git a/apps/snmpbulkwalk.c b/apps/snmpbulkwalk.c
new file mode 100644
index 0000000..379d2ae
--- /dev/null
+++ b/apps/snmpbulkwalk.c
@@ -0,0 +1,386 @@
+/*
+ * snmpbulkwalk.c - send SNMPv2 Bulk requests to a network entity, walking a
+ * subtree.
+ *
+ */
+/*********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+**********************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#define NETSNMP_DS_WALK_INCLUDE_REQUESTED 1
+#define NETSNMP_DS_WALK_PRINT_STATISTICS 2
+#define NETSNMP_DS_WALK_DONT_CHECK_LEXICOGRAPHIC 3
+
+oid objid_mib[] = { 1, 3, 6, 1, 2, 1 };
+int numprinted = 0;
+int reps = 10, non_reps = 0;
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmpbulkwalk ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " [OID]\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr,
+ " -C APPOPTS\t\tSet various application specific behaviours:\n");
+ fprintf(stderr,
+ "\t\t\t c: do not check returned OIDs are increasing\n");
+ fprintf(stderr,
+ "\t\t\t i: include given OIDs in the search range\n");
+ fprintf(stderr, "\t\t\t n<NUM>: set non-repeaters to <NUM>\n");
+ fprintf(stderr,
+ "\t\t\t p: print the number of variables found\n");
+ fprintf(stderr, "\t\t\t r<NUM>: set max-repeaters to <NUM>\n");
+}
+
+static void
+snmp_get_and_print(netsnmp_session * ss, oid * theoid, size_t theoid_len)
+{
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ int status;
+
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+ snmp_add_null_var(pdu, theoid, theoid_len);
+
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS && response->errstat == SNMP_ERR_NOERROR) {
+ for (vars = response->variables; vars; vars = vars->next_variable) {
+ numprinted++;
+ print_variable(vars->name, vars->name_length, vars);
+ }
+ }
+ if (response) {
+ snmp_free_pdu(response);
+ }
+}
+
+static
+ void
+optProc(int argc, char *const *argv, int opt)
+{
+ char *endptr = NULL;
+
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'c':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_DONT_CHECK_LEXICOGRAPHIC);
+ break;
+
+ case 'i':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_INCLUDE_REQUESTED);
+ break;
+
+ case 'n':
+ case 'r':
+ if (*(optarg - 1) == 'r') {
+ reps = strtol(optarg, &endptr, 0);
+ } else {
+ non_reps = strtol(optarg, &endptr, 0);
+ }
+
+ if (endptr == optarg) {
+ /*
+ * No number given -- error.
+ */
+ usage();
+ exit(1);
+ } else {
+ optarg = endptr;
+ if (isspace((unsigned char)(*optarg))) {
+ return;
+ }
+ }
+ break;
+
+ case 'p':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_PRINT_STATISTICS);
+ break;
+
+ default:
+ fprintf(stderr, "Unknown flag passed to -C: %c\n",
+ optarg[-1]);
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ int arg;
+ oid name[MAX_OID_LEN];
+ size_t name_length;
+ oid root[MAX_OID_LEN];
+ size_t rootlen;
+ int count;
+ int running;
+ int status = STAT_ERROR;
+ int check;
+ int exitval = 0;
+
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmpwalk", "includeRequested",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_INCLUDE_REQUESTED);
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmpwalk", "printStatistics",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_PRINT_STATISTICS);
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmpwalk", "dontCheckOrdering",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_DONT_CHECK_LEXICOGRAPHIC);
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ /*
+ * get the initial object and subtree
+ */
+ if (arg < argc) {
+ /*
+ * specified on the command line
+ */
+ rootlen = MAX_OID_LEN;
+ if (snmp_parse_oid(argv[arg], root, &rootlen) == NULL) {
+ snmp_perror(argv[arg]);
+ exit(1);
+ }
+ } else {
+ /*
+ * use default value
+ */
+ memmove(root, objid_mib, sizeof(objid_mib));
+ rootlen = sizeof(objid_mib) / sizeof(oid);
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpbulkwalk", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ /*
+ * setup initial object name
+ */
+ memmove(name, root, rootlen * sizeof(oid));
+ name_length = rootlen;
+
+ running = 1;
+
+ check = !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_DONT_CHECK_LEXICOGRAPHIC);
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_INCLUDE_REQUESTED)) {
+ snmp_get_and_print(ss, root, rootlen);
+ }
+
+ while (running) {
+ /*
+ * create PDU for GETBULK request and add object name to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETBULK);
+ pdu->non_repeaters = non_reps;
+ pdu->max_repetitions = reps; /* fill the packet */
+ snmp_add_null_var(pdu, name, name_length);
+
+ /*
+ * do the request
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ /*
+ * check resulting variables
+ */
+ for (vars = response->variables; vars;
+ vars = vars->next_variable) {
+ if ((vars->name_length < rootlen)
+ || (memcmp(root, vars->name, rootlen * sizeof(oid))
+ != 0)) {
+ /*
+ * not part of this subtree
+ */
+ running = 0;
+ continue;
+ }
+ numprinted++;
+ print_variable(vars->name, vars->name_length, vars);
+ if ((vars->type != SNMP_ENDOFMIBVIEW) &&
+ (vars->type != SNMP_NOSUCHOBJECT) &&
+ (vars->type != SNMP_NOSUCHINSTANCE)) {
+ /*
+ * not an exception value
+ */
+ if (check
+ && snmp_oid_compare(name, name_length,
+ vars->name,
+ vars->name_length) >= 0) {
+ fprintf(stderr, "Error: OID not increasing: ");
+ fprint_objid(stderr, name, name_length);
+ fprintf(stderr, " >= ");
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ fprintf(stderr, "\n");
+ running = 0;
+ exitval = 1;
+ }
+ /*
+ * Check if last variable, and if so, save for next request.
+ */
+ if (vars->next_variable == NULL) {
+ memmove(name, vars->name,
+ vars->name_length * sizeof(oid));
+ name_length = vars->name_length;
+ }
+ } else {
+ /*
+ * an exception value, so stop
+ */
+ running = 0;
+ }
+ }
+ } else {
+ /*
+ * error in response, print it
+ */
+ running = 0;
+ if (response->errstat == SNMP_ERR_NOSUCHNAME) {
+ printf("End of MIB\n");
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++)
+ /*EMPTY*/;
+ if (vars)
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ session.peername);
+ running = 0;
+ exitval = 1;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpbulkwalk", ss);
+ running = 0;
+ exitval = 1;
+ }
+ if (response)
+ snmp_free_pdu(response);
+ }
+
+ if (numprinted == 0 && status == STAT_SUCCESS) {
+ /*
+ * no printed successful results, which may mean we were
+ * pointed at an only existing instance. Attempt a GET, just
+ * for get measure.
+ */
+ snmp_get_and_print(ss, root, rootlen);
+ }
+ snmp_close(ss);
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_PRINT_STATISTICS)) {
+ printf("Variables found: %d\n", numprinted);
+ }
+
+ SOCK_CLEANUP;
+ return exitval;
+}
diff --git a/apps/snmpdelta.c b/apps/snmpdelta.c
new file mode 100644
index 0000000..08e2ebc
--- /dev/null
+++ b/apps/snmpdelta.c
@@ -0,0 +1,748 @@
+/*
+ * snmpdelta.c - Monitor deltas of integer valued SNMP variables
+ *
+ */
+/**********************************************************************
+ *
+ * Copyright 1996 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.
+ *
+ **********************************************************************/
+
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#define MAX_ARGS 256
+#define NETSNMP_DS_APP_DONT_FIX_PDUS 0
+
+const char *SumFile = "Sum";
+
+/*
+ * Information about the handled variables
+ */
+struct varInfo {
+ char *name;
+ oid *info_oid;
+ int type;
+ size_t oidlen;
+ char descriptor[64];
+ u_int value;
+ struct counter64 c64value;
+ float max;
+ time_t time;
+ int peak_count;
+ float peak;
+ float peak_average;
+ int spoiled;
+};
+
+struct varInfo varinfo[MAX_ARGS];
+int current_name = 0;
+int period = 1;
+int deltat = 0, timestamp = 0, fileout = 0, dosum =
+ 0, printmax = 0;
+int keepSeconds = 0, peaks = 0;
+int tableForm = 0;
+int varbindsPerPacket = 60;
+
+void processFileArgs(char *fileName);
+
+void
+usage(void)
+{
+ fprintf(stderr,
+ "Usage: snmpdelta [-Cf] [-CF commandFile] [-Cl] [-CL SumFileName]\n\t[-Cs] [-Ck] [-Ct] [-CS] [-Cv vars/pkt] [-Cp period]\n\t[-CP peaks] ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " oid [oid ...]\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr, "snmpdelta specific options\n");
+ fprintf(stderr, " -Cf\t\tDon't fix errors and retry the request.\n");
+ fprintf(stderr, " -Cl\t\twrite configuration to file\n");
+ fprintf(stderr, " -CF config\tload configuration from file\n");
+ fprintf(stderr, " -Cp period\tspecifies the poll period\n");
+ fprintf(stderr, " -CP peaks\treporting period in poll periods\n");
+ fprintf(stderr, " -Cv vars/pkt\tnumber of variables per packet\n");
+ fprintf(stderr, " -Ck\t\tkeep seconds in output time\n");
+ fprintf(stderr, " -Cm\t\tshow max values\n");
+ fprintf(stderr, " -CS\t\tlog to a sum file\n");
+ fprintf(stderr, " -Cs\t\tshow timestamps\n");
+ fprintf(stderr, " -Ct\t\tget timing from agent\n");
+ fprintf(stderr, " -CT\t\tprint output in tabular form\n");
+ fprintf(stderr, " -CL sumfile\tspecifies the sum file name\n");
+}
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch ((opt = *optarg++)) {
+ case 'f':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_DONT_FIX_PDUS);
+ break;
+ case 'p':
+ period = atoi(argv[optind++]);
+ break;
+ case 'P':
+ peaks = atoi(argv[optind++]);
+ break;
+ case 'v':
+ varbindsPerPacket = atoi(argv[optind++]);
+ break;
+ case 't':
+ deltat = 1;
+ break;
+ case 's':
+ timestamp = 1;
+ break;
+ case 'S':
+ dosum = 1;
+ break;
+ case 'm':
+ printmax = 1;
+ break;
+ case 'F':
+ processFileArgs(argv[optind++]);
+ break;
+ case 'l':
+ fileout = 1;
+ break;
+ case 'L':
+ SumFile = argv[optind++];
+ break;
+ case 'k':
+ keepSeconds = 1;
+ break;
+ case 'T':
+ tableForm = 1;
+ break;
+ default:
+ fprintf(stderr, "Bad -C options: %c\n", opt);
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+int
+wait_for_peak_start(int period, int peak)
+{
+ struct timeval m_time, *tv = &m_time;
+ struct tm tm;
+ time_t SecondsAtNextHour;
+ int target = 0;
+ int seconds;
+
+ seconds = period * peak;
+
+ /*
+ * Find the current time
+ */
+ gettimeofday(tv, (struct timezone *) 0);
+
+ /*
+ * Create a tm struct from it
+ */
+ memcpy(&tm, localtime((time_t *) & tv->tv_sec), sizeof(tm));
+
+ /*
+ * Calculate the next hour
+ */
+ tm.tm_sec = 0;
+ tm.tm_min = 0;
+ tm.tm_hour++;
+ SecondsAtNextHour = mktime(&tm);
+
+ /*
+ * Now figure out the amount of time to sleep
+ */
+ target = (int)(SecondsAtNextHour - tv->tv_sec) % seconds;
+
+ return target;
+}
+
+void
+print_log(char *file, char *message)
+{
+ FILE *fp;
+
+ fp = fopen(file, "a");
+ if (fp == NULL) {
+ fprintf(stderr, "Couldn't open %s\n", file);
+ return;
+ }
+ fprintf(fp, "%s\n", message);
+ fclose(fp);
+}
+
+void
+sprint_descriptor(char *buffer, struct varInfo *vip)
+{
+ char *buf = NULL, *cp = NULL;
+ size_t buf_len = 0, out_len = 0;
+
+ if (!sprint_realloc_objid((u_char **)&buf, &buf_len, &out_len, 1,
+ vip->info_oid, vip->oidlen)) {
+ if (buf != NULL) {
+ free(buf);
+ }
+ return;
+ }
+
+ for (cp = buf; *cp; cp++);
+ while (cp >= buf) {
+ if (isalpha((unsigned char)(*cp)))
+ break;
+ cp--;
+ }
+ while (cp >= buf) {
+ if (*cp == '.')
+ break;
+ cp--;
+ }
+ cp++;
+ if (cp < buf)
+ cp = buf;
+ strcpy(buffer, cp);
+
+ if (buf != NULL) {
+ free(buf);
+ }
+}
+
+void
+processFileArgs(char *fileName)
+{
+ FILE *fp;
+ char buf[260] = { 0 }, *cp;
+ int blank, linenumber = 0;
+
+ fp = fopen(fileName, "r");
+ if (fp == NULL)
+ return;
+ while (fgets(buf, sizeof(buf), fp)) {
+ linenumber++;
+ if (strlen(buf) > (sizeof(buf) - 2)) {
+ fprintf(stderr, "Line too long on line %d of %s\n",
+ linenumber, fileName);
+ exit(1);
+ }
+ if (buf[0] == '#')
+ continue;
+ blank = TRUE;
+ for (cp = buf; *cp; cp++)
+ if (!isspace((unsigned char)(*cp))) {
+ blank = FALSE;
+ break;
+ }
+ if (blank)
+ continue;
+ buf[strlen(buf) - 1] = 0;
+ if (current_name >= MAX_ARGS) {
+ fprintf(stderr, "Too many variables read at line %d of %s (max %d)\n",
+ linenumber, fileName, MAX_ARGS);
+ exit(1);
+ }
+ varinfo[current_name++].name = strdup(buf);
+ }
+ fclose(fp);
+ return;
+}
+
+void
+wait_for_period(int period)
+{
+#ifdef WIN32
+ Sleep(period * 1000);
+#else /* WIN32 */
+ struct timeval m_time, *tv = &m_time;
+ struct tm tm;
+ int count;
+ static int target = 0;
+ time_t nexthour;
+
+ gettimeofday(tv, (struct timezone *) 0);
+
+ if (target) {
+ target += period;
+ } else {
+ memcpy(&tm, localtime((time_t *) & tv->tv_sec), sizeof(tm));
+ tm.tm_sec = 0;
+ tm.tm_min = 0;
+ tm.tm_hour++;
+ nexthour = mktime(&tm);
+
+ target = (nexthour - tv->tv_sec) % period;
+ if (target == 0)
+ target = period;
+ target += tv->tv_sec;
+ }
+
+ tv->tv_sec = target - tv->tv_sec;
+ if (tv->tv_usec != 0) {
+ tv->tv_sec--;
+ tv->tv_usec = 1000000 - tv->tv_usec;
+ }
+ if (tv->tv_sec < 0) {
+ /*
+ * ran out of time, schedule immediately
+ */
+ tv->tv_sec = 0;
+ tv->tv_usec = 0;
+ }
+ count = 1;
+ while (count != 0) {
+ count = select(0, NULL, NULL, NULL, tv);
+ switch (count) {
+ case 0:
+ break;
+ case -1:
+ /*
+ * FALLTHRU
+ */
+ default:
+ snmp_log_perror("select");
+ break;
+ }
+ }
+#endif /* WIN32 */
+}
+
+oid sysUpTimeOid[9] = { 1, 3, 6, 1, 2, 1, 1, 3, 0 };
+size_t sysUpTimeLen = 9;
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ int arg;
+ char *gateway;
+
+ int count;
+ struct varInfo *vip;
+ u_int value = 0;
+ struct counter64 c64value;
+ float printvalue;
+ time_t last_time = 0;
+ time_t this_time;
+ time_t delta_time;
+ int sum; /* what the heck is this for, its never used? */
+ char filename[128] = { 0 };
+ struct timeval tv;
+ struct tm tm;
+ char timestring[64] = { 0 }, valueStr[64] = {
+ 0}, maxStr[64] = {
+ 0};
+ char outstr[256] = { 0 }, peakStr[64] = {
+ 0};
+ int status;
+ int begin, end, last_end;
+ int print = 1;
+ int exit_code = 0;
+
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", &optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ gateway = session.peername;
+
+ for (; optind < argc; optind++) {
+ if (current_name >= MAX_ARGS) {
+ fprintf(stderr, "%s: Too many variables specified (max %d)\n",
+ argv[optind], MAX_ARGS);
+ exit(1);
+ }
+ varinfo[current_name++].name = argv[optind];
+ }
+
+ if (current_name == 0) {
+ usage();
+ exit(1);
+ }
+
+ if (dosum) {
+ if (current_name >= MAX_ARGS) {
+ fprintf(stderr, "Too many variables specified (max %d)\n",
+ MAX_ARGS);
+ exit(1);
+ }
+ varinfo[current_name++].name = NULL;
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpdelta", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ if (tableForm && timestamp) {
+ printf("%s", gateway);
+ }
+ for (count = 0; count < current_name; count++) {
+ vip = varinfo + count;
+ if (vip->name) {
+ vip->oidlen = MAX_OID_LEN;
+ vip->info_oid = (oid *) malloc(sizeof(oid) * vip->oidlen);
+ if (snmp_parse_oid(vip->name, vip->info_oid, &vip->oidlen) ==
+ NULL) {
+ snmp_perror(vip->name);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ sprint_descriptor(vip->descriptor, vip);
+ if (tableForm)
+ printf("\t%s", vip->descriptor);
+ } else {
+ vip->oidlen = 0;
+ strlcpy(vip->descriptor, SumFile, sizeof(vip->descriptor));
+ }
+ vip->value = 0;
+ zeroU64(&vip->c64value);
+ vip->time = 0;
+ vip->max = 0;
+ if (peaks) {
+ vip->peak_count = -1;
+ vip->peak = 0;
+ vip->peak_average = 0;
+ }
+ }
+
+ wait_for_period(period);
+
+ end = current_name;
+ sum = 0;
+ while (1) {
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+
+ if (deltat)
+ snmp_add_null_var(pdu, sysUpTimeOid, sysUpTimeLen);
+
+ if (end == current_name)
+ count = 0;
+ else
+ count = end;
+ begin = count;
+ for (; count < current_name
+ && count < begin + varbindsPerPacket - deltat; count++) {
+ if (varinfo[count].oidlen)
+ snmp_add_null_var(pdu, varinfo[count].info_oid,
+ varinfo[count].oidlen);
+ }
+ last_end = end;
+ end = count;
+
+ retry:
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ if (timestamp) {
+ gettimeofday(&tv, (struct timezone *) 0);
+ memcpy(&tm, localtime((time_t *) & tv.tv_sec),
+ sizeof(tm));
+ if (((period % 60)
+ && (!peaks || ((period * peaks) % 60)))
+ || keepSeconds)
+ sprintf(timestring, " [%02d:%02d:%02d %d/%d]",
+ tm.tm_hour, tm.tm_min, tm.tm_sec,
+ tm.tm_mon + 1, tm.tm_mday);
+ else
+ sprintf(timestring, " [%02d:%02d %d/%d]",
+ tm.tm_hour, tm.tm_min,
+ tm.tm_mon + 1, tm.tm_mday);
+ }
+
+ vars = response->variables;
+ if (deltat) {
+ if (!vars || !vars->val.integer) {
+ fprintf(stderr, "Missing variable in reply\n");
+ continue;
+ } else {
+ this_time = *(vars->val.integer);
+ }
+ vars = vars->next_variable;
+ } else {
+ this_time = 1;
+ }
+
+ for (count = begin; count < end; count++) {
+ vip = varinfo + count;
+
+ if (vip->oidlen) {
+ if (!vars || !vars->val.integer) {
+ fprintf(stderr, "Missing variable in reply\n");
+ break;
+ }
+ vip->type = vars->type;
+ if (vars->type == ASN_COUNTER64) {
+ u64Subtract(vars->val.counter64,
+ &vip->c64value, &c64value);
+ memcpy(&vip->c64value, vars->val.counter64,
+ sizeof(struct counter64));
+ } else {
+ value = *(vars->val.integer) - vip->value;
+ vip->value = *(vars->val.integer);
+ }
+ vars = vars->next_variable;
+ } else {
+ value = sum;
+ sum = 0;
+ }
+ delta_time = this_time - vip->time;
+ if (delta_time <= 0)
+ delta_time = 100;
+ last_time = vip->time;
+ vip->time = this_time;
+ if (last_time == 0)
+ continue;
+
+ if (vip->oidlen && vip->type != ASN_COUNTER64) {
+ sum += value;
+ }
+
+ if (tableForm) {
+ if (count == begin) {
+ sprintf(outstr, "%s", timestring + 1);
+ } else {
+ outstr[0] = '\0';
+ }
+ } else {
+ sprintf(outstr, "%s %s", timestring,
+ vip->descriptor);
+ }
+
+ if (deltat || tableForm) {
+ if (vip->type == ASN_COUNTER64) {
+ fprintf(stderr,
+ "time delta and table form not supported for counter64s\n");
+ exit(1);
+ } else {
+ printvalue =
+ ((float) value * 100) / delta_time;
+ if (tableForm)
+ sprintf(valueStr, "\t%.2f", printvalue);
+ else
+ sprintf(valueStr, " /sec: %.2f",
+ printvalue);
+ }
+ } else {
+ printvalue = (float) value;
+ sprintf(valueStr, " /%d sec: ", period);
+ if (vip->type == ASN_COUNTER64)
+ printU64(valueStr + strlen(valueStr),
+ &c64value);
+ else
+ sprintf(valueStr + strlen(valueStr), "%u",
+ value);
+ }
+
+ if (!peaks) {
+ strcat(outstr, valueStr);
+ } else {
+ print = 0;
+ if (vip->peak_count == -1) {
+ if (wait_for_peak_start(period, peaks) == 0)
+ vip->peak_count = 0;
+ } else {
+ vip->peak_average += printvalue;
+ if (vip->peak < printvalue)
+ vip->peak = printvalue;
+ if (++vip->peak_count == peaks) {
+ if (deltat)
+ sprintf(peakStr,
+ " /sec: %.2f (%d sec Peak: %.2f)",
+ vip->peak_average /
+ vip->peak_count, period,
+ vip->peak);
+ else
+ sprintf(peakStr,
+ " /%d sec: %.0f (%d sec Peak: %.0f)",
+ period,
+ vip->peak_average /
+ vip->peak_count, period,
+ vip->peak);
+ vip->peak_average = 0;
+ vip->peak = 0;
+ vip->peak_count = 0;
+ print = 1;
+ strcat(outstr, peakStr);
+ }
+ }
+ }
+
+ if (printmax) {
+ if (printvalue > vip->max) {
+ vip->max = printvalue;
+ }
+ if (deltat)
+ sprintf(maxStr, " (Max: %.2f)", vip->max);
+ else
+ sprintf(maxStr, " (Max: %.0f)", vip->max);
+ strcat(outstr, maxStr);
+ }
+
+ if (print) {
+ if (fileout) {
+ sprintf(filename, "%s-%s", gateway,
+ vip->descriptor);
+ print_log(filename, outstr + 1);
+ } else {
+ if (tableForm)
+ printf("%s", outstr);
+ else
+ printf("%s\n", outstr + 1);
+ fflush(stdout);
+ }
+ }
+ }
+ if (end == last_end && tableForm)
+ printf("\n");
+ } else {
+ if (response->errstat == SNMP_ERR_TOOBIG) {
+ if (response->errindex <= varbindsPerPacket
+ && response->errindex > 0) {
+ varbindsPerPacket = response->errindex - 1;
+ } else {
+ if (varbindsPerPacket > 30)
+ varbindsPerPacket -= 5;
+ else
+ varbindsPerPacket--;
+ }
+ if (varbindsPerPacket <= 0) {
+ exit_code = 5;
+ break;
+ }
+ end = last_end;
+ continue;
+ } else if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++);
+ if (vars)
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ fprintf(stderr, "\n");
+ /*
+ * Don't exit when OIDs from file are not found on agent
+ * exit_code = 1;
+ * break;
+ */
+ } else {
+ fprintf(stderr, "Error in packet: %s\n",
+ snmp_errstring(response->errstat));
+ exit_code = 1;
+ break;
+ }
+
+ /*
+ * retry if the errored variable was successfully removed
+ */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_DONT_FIX_PDUS)) {
+ pdu = snmp_fix_pdu(response, SNMP_MSG_GET);
+ snmp_free_pdu(response);
+ response = NULL;
+ if (pdu != NULL)
+ goto retry;
+ }
+ }
+
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n", gateway);
+ response = NULL;
+ exit_code = 1;
+ break;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpdelta", ss);
+ response = NULL;
+ exit_code = 1;
+ break;
+ }
+
+ if (response)
+ snmp_free_pdu(response);
+ if (end == current_name) {
+ wait_for_period(period);
+ }
+ }
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return (exit_code);
+}
diff --git a/apps/snmpdf.c b/apps/snmpdf.c
new file mode 100644
index 0000000..6a5ef19
--- /dev/null
+++ b/apps/snmpdf.c
@@ -0,0 +1,389 @@
+/*
+ * snmpdf.c - display disk space usage on a network entity via SNMP.
+ *
+ */
+
+/* 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, 1991, 1992 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.
+ */
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+void
+usage(void)
+{
+ fprintf(stderr, "Usage: snmpdf [-Cu] ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, "\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr, "\nsnmpdf options:\n");
+ fprintf(stderr,
+ "\t-Cu\tUse UCD-SNMP dskTable to do the calculations.\n");
+ fprintf(stderr,
+ "\t\t[Normally the HOST-RESOURCES-MIB is consulted first.]\n");
+}
+
+int ucd_mib = 0;
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'u':
+ ucd_mib = 1;
+ break;
+ default:
+ fprintf(stderr,
+ "Unknown flag passed to -C: %c\n", optarg[-1]);
+ exit(1);
+ }
+ }
+ }
+}
+
+struct hrStorageTable {
+ u_long hrStorageIndex;
+ oid *hrStorageType;
+ char *hrStorageDescr;
+ u_long hrStorageAllocationUnits;
+ u_long hrStorageSize;
+ u_long hrStorageUsed;
+};
+
+int
+add(netsnmp_pdu *pdu, const char *mibnodename,
+ oid * index, size_t indexlen)
+{
+ oid base[MAX_OID_LEN];
+ size_t base_length = MAX_OID_LEN;
+
+ memset(base, 0, MAX_OID_LEN * sizeof(oid));
+
+ if (!snmp_parse_oid(mibnodename, base, &base_length)) {
+ snmp_perror(mibnodename);
+ fprintf(stderr, "couldn't find mib node %s, giving up\n",
+ mibnodename);
+ exit(1);
+ }
+
+ if (index && indexlen) {
+ memcpy(&(base[base_length]), index, indexlen * sizeof(oid));
+ base_length += indexlen;
+ }
+ DEBUGMSGTL(("add", "created: "));
+ DEBUGMSGOID(("add", base, base_length));
+ DEBUGMSG(("add", "\n"));
+ snmp_add_null_var(pdu, base, base_length);
+
+ return base_length;
+}
+
+netsnmp_variable_list *
+collect(netsnmp_session * ss, netsnmp_pdu *pdu,
+ oid * base, size_t base_length)
+{
+ netsnmp_pdu *response;
+ int running = 1;
+ netsnmp_variable_list *saved = NULL, **vlpp = &saved;
+ int status;
+
+ while (running) {
+ /*
+ * gotta catch em all, gotta catch em all!
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status != STAT_SUCCESS || !response) {
+ snmp_sess_perror("snmpdf", ss);
+ exit(1);
+ }
+ if (response->errstat != SNMP_ERR_NOERROR) {
+ fprintf(stderr, "snmpdf: Error in packet: %s\n",
+ snmp_errstring(response->errstat));
+ exit(1);
+ }
+ if (response && snmp_oid_compare(response->variables->name,
+ SNMP_MIN(base_length,
+ response->variables->
+ name_length), base,
+ base_length) != 0)
+ running = 0;
+ else {
+ /*
+ * get response
+ */
+ *vlpp = response->variables;
+ (*vlpp)->next_variable = NULL; /* shouldn't be any, but just in case */
+
+ /*
+ * create the next request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ snmp_add_null_var(pdu, (*vlpp)->name, (*vlpp)->name_length);
+
+ /*
+ * finish loop setup
+ */
+ vlpp = &((*vlpp)->next_variable);
+ response->variables = NULL; /* ahh, forget about it */
+ }
+ snmp_free_pdu(response);
+ }
+ return saved;
+}
+
+/* Computes value*units/divisor in an overflow-proof way.
+ */
+unsigned long
+convert_units(unsigned long value, size_t units, size_t divisor)
+{
+ return (unsigned long)((double)value * units / (double)divisor);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu;
+ netsnmp_pdu *response;
+ int arg;
+ oid base[MAX_OID_LEN];
+ size_t base_length;
+ int status;
+ netsnmp_variable_list *saved = NULL, *vlp = saved, *vlp2;
+ int count = 0;
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ if (arg != argc) {
+ fprintf(stderr, "snmpdf: extra argument: %s\n", argv[arg]);
+ exit(1);
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * Open an SNMP session.
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpdf", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ printf("%-18s %15s %15s %15s %5s\n", "Description", "size (kB)",
+ "Used", "Available", "Used%");
+ if (ucd_mib == 0) {
+ /*
+ * * Begin by finding all the storage pieces that are of
+ * * type hrStorageFixedDisk, which is a standard disk.
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ base_length =
+ add(pdu, "HOST-RESOURCES-MIB:hrStorageIndex", NULL, 0);
+ memcpy(base, pdu->variables->name, base_length * sizeof(oid));
+
+ vlp = collect(ss, pdu, base, base_length);
+
+ while (vlp) {
+ size_t units;
+ unsigned long hssize, hsused;
+ char descr[SPRINT_MAX_LEN];
+ int len;
+
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+
+ add(pdu, "HOST-RESOURCES-MIB:hrStorageDescr",
+ &(vlp->name[base_length]), vlp->name_length - base_length);
+ add(pdu, "HOST-RESOURCES-MIB:hrStorageAllocationUnits",
+ &(vlp->name[base_length]), vlp->name_length - base_length);
+ add(pdu, "HOST-RESOURCES-MIB:hrStorageSize",
+ &(vlp->name[base_length]), vlp->name_length - base_length);
+ add(pdu, "HOST-RESOURCES-MIB:hrStorageUsed",
+ &(vlp->name[base_length]), vlp->name_length - base_length);
+
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status != STAT_SUCCESS || !response) {
+ snmp_sess_perror("snmpdf", ss);
+ exit(1);
+ }
+
+ vlp2 = response->variables;
+ len = vlp2->val_len;
+ if (len >= SPRINT_MAX_LEN) len = SPRINT_MAX_LEN-1;
+ memcpy(descr, vlp2->val.string, len);
+ descr[len] = '\0';
+
+ vlp2 = vlp2->next_variable;
+ units = vlp2->val.integer ? *(vlp2->val.integer) : 0;
+
+ vlp2 = vlp2->next_variable;
+ hssize = vlp2->val.integer ? *(vlp2->val.integer) : 0;
+
+ vlp2 = vlp2->next_variable;
+ hsused = vlp2->val.integer ? *(vlp2->val.integer) : 0;
+
+ printf("%-18s %15lu %15lu %15lu %4lu%%\n", descr,
+ units ? convert_units(hssize, units, 1024) : hssize,
+ units ? convert_units(hsused, units, 1024) : hsused,
+ units ? convert_units(hssize-hsused, units, 1024) : hssize -
+ hsused, hssize ? convert_units(hsused, 100, hssize) :
+ hsused);
+
+ vlp = vlp->next_variable;
+ snmp_free_pdu(response);
+ count++;
+ }
+ }
+
+ if (count == 0) {
+ size_t units = 0;
+ /*
+ * the host resources mib must not be supported. Lets try the
+ * UCD-SNMP-MIB and its dskTable
+ */
+
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ base_length = add(pdu, "UCD-SNMP-MIB:dskIndex", NULL, 0);
+ memcpy(base, pdu->variables->name, base_length * sizeof(oid));
+
+ vlp = collect(ss, pdu, base, base_length);
+
+ while (vlp) {
+ unsigned long hssize, hsused;
+ char descr[SPRINT_MAX_LEN];
+
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+
+ add(pdu, "UCD-SNMP-MIB:dskPath",
+ &(vlp->name[base_length]), vlp->name_length - base_length);
+ add(pdu, "UCD-SNMP-MIB:dskTotal",
+ &(vlp->name[base_length]), vlp->name_length - base_length);
+ add(pdu, "UCD-SNMP-MIB:dskUsed",
+ &(vlp->name[base_length]), vlp->name_length - base_length);
+
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status != STAT_SUCCESS || !response) {
+ snmp_sess_perror("snmpdf", ss);
+ exit(1);
+ }
+
+ vlp2 = response->variables;
+ memcpy(descr, vlp2->val.string, vlp2->val_len);
+ descr[vlp2->val_len] = '\0';
+
+ vlp2 = vlp2->next_variable;
+ hssize = *(vlp2->val.integer);
+
+ vlp2 = vlp2->next_variable;
+ hsused = *(vlp2->val.integer);
+
+ printf("%-18s %15lu %15lu %15lu %4lu%%\n", descr,
+ units ? convert_units(hssize, units, 1024) : hssize,
+ units ? convert_units(hsused, units, 1024) : hsused,
+ units ? convert_units(hssize-hsused, units, 1024) : hssize -
+ hsused, hssize ? convert_units(hsused, 100, hssize) :
+ hsused);
+
+ vlp = vlp->next_variable;
+ snmp_free_pdu(response);
+ count++;
+ }
+ }
+
+ if (count == 0) {
+ fprintf(stderr, "Failed to locate any partitions.\n");
+ exit(1);
+ }
+
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return 0;
+
+} /* end main() */
diff --git a/apps/snmpget.c b/apps/snmpget.c
new file mode 100644
index 0000000..701f536
--- /dev/null
+++ b/apps/snmpget.c
@@ -0,0 +1,255 @@
+/*
+ * snmpget.c - send snmp GET requests to a network entity.
+ *
+ */
+/***********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/net-snmp-includes.h>
+
+#define NETSNMP_DS_APP_DONT_FIX_PDUS 0
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'f':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_DONT_FIX_PDUS);
+ break;
+ default:
+ fprintf(stderr, "Unknown flag passed to -C: %c\n",
+ optarg[-1]);
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmpget ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " OID [OID]...\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr,
+ " -C APPOPTS\t\tSet various application specific behaviours:\n");
+ fprintf(stderr,
+ "\t\t\t f: do not fix errors and retry the request\n");
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu;
+ netsnmp_pdu *response;
+ netsnmp_variable_list *vars;
+ int arg;
+ int count;
+ int current_name = 0;
+ char *names[SNMP_MAX_CMDLINE_OIDS];
+ oid name[MAX_OID_LEN];
+ size_t name_length;
+ int status;
+ int failures = 0;
+ int exitval = 0;
+
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ if (arg >= argc) {
+ fprintf(stderr, "Missing object name\n");
+ usage();
+ exit(1);
+ }
+ if ((argc - arg) > SNMP_MAX_CMDLINE_OIDS) {
+ fprintf(stderr, "Too many object identifiers specified. ");
+ fprintf(stderr, "Only %d allowed in one request.\n", SNMP_MAX_CMDLINE_OIDS);
+ usage();
+ exit(1);
+ }
+
+ /*
+ * get the object names
+ */
+ for (; arg < argc; arg++)
+ names[current_name++] = argv[arg];
+
+ SOCK_STARTUP;
+
+
+ /*
+ * Open an SNMP session.
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpget", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+
+ /*
+ * Create PDU for GET request and add object names to request.
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+ for (count = 0; count < current_name; count++) {
+ name_length = MAX_OID_LEN;
+ if (!snmp_parse_oid(names[count], name, &name_length)) {
+ snmp_perror(names[count]);
+ failures++;
+ } else
+ snmp_add_null_var(pdu, name, name_length);
+ }
+ if (failures) {
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+
+ /*
+ * Perform the request.
+ *
+ * If the Get Request fails, note the OID that caused the error,
+ * "fix" the PDU (removing the error-prone OID) and retry.
+ */
+ retry:
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ for (vars = response->variables; vars;
+ vars = vars->next_variable)
+ print_variable(vars->name, vars->name_length, vars);
+
+ } else {
+ fprintf(stderr, "Error in packet\nReason: %s\n",
+ snmp_errstring(response->errstat));
+
+ if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++)
+ /*EMPTY*/;
+ if (vars) {
+ fprint_objid(stderr, vars->name, vars->name_length);
+ }
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+
+ /*
+ * retry if the errored variable was successfully removed
+ */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_DONT_FIX_PDUS)) {
+ pdu = snmp_fix_pdu(response, SNMP_MSG_GET);
+ snmp_free_pdu(response);
+ response = NULL;
+ if (pdu != NULL) {
+ goto retry;
+ }
+ }
+ } /* endif -- SNMP_ERR_NOERROR */
+
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s.\n",
+ session.peername);
+ exitval = 1;
+
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpget", ss);
+ exitval = 1;
+
+ } /* endif -- STAT_SUCCESS */
+
+
+ if (response)
+ snmp_free_pdu(response);
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return exitval;
+
+} /* end main() */
diff --git a/apps/snmpgetnext.c b/apps/snmpgetnext.c
new file mode 100644
index 0000000..7de13f3
--- /dev/null
+++ b/apps/snmpgetnext.c
@@ -0,0 +1,236 @@
+/*
+ * snmpgetnext.c - send snmp GETNEXT requests to a network entity.
+ *
+ */
+/***********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#define NETSNMP_DS_APP_DONT_FIX_PDUS 0
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'f':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_DONT_FIX_PDUS);
+ break;
+ default:
+ fprintf(stderr, "Unknown flag passed to -C: %c\n",
+ optarg[-1]);
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmpgetnext ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " OID [OID]...\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr,
+ " -C APPOPTS\t\tSet various application specific behaviours:\n");
+ fprintf(stderr,
+ "\t\t\t f: do not fix errors and retry the request\n");
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ int arg;
+ int count;
+ int current_name = 0;
+ char *names[SNMP_MAX_CMDLINE_OIDS];
+ oid name[MAX_OID_LEN];
+ size_t name_length;
+ int status;
+ int failures = 0;
+ int exitval = 0;
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", &optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ if (arg >= argc) {
+ fprintf(stderr, "Missing object name\n");
+ usage();
+ exit(1);
+ }
+ if ((argc - arg) > SNMP_MAX_CMDLINE_OIDS) {
+ fprintf(stderr, "Too many object identifiers specified. ");
+ fprintf(stderr, "Only %d allowed in one request.\n", SNMP_MAX_CMDLINE_OIDS);
+ usage();
+ exit(1);
+ }
+
+ /*
+ * get the object names
+ */
+ for (; arg < argc; arg++)
+ names[current_name++] = argv[arg];
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpgetnext", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ /*
+ * create PDU for GET request and add object names to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+
+ for (count = 0; count < current_name; count++) {
+ name_length = MAX_OID_LEN;
+ if (snmp_parse_oid(names[count], name, &name_length) == NULL) {
+ snmp_perror(names[count]);
+ failures++;
+ } else
+ snmp_add_null_var(pdu, name, name_length);
+ }
+ if (failures) {
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ /*
+ * do the request
+ */
+ retry:
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ for (vars = response->variables; vars;
+ vars = vars->next_variable)
+ print_variable(vars->name, vars->name_length, vars);
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++);
+ if (vars)
+ fprint_objid(stderr, vars->name, vars->name_length);
+ fprintf(stderr, "\n");
+ exitval = 2;
+ }
+
+ /*
+ * retry if the errored variable was successfully removed
+ */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_DONT_FIX_PDUS)) {
+ pdu = snmp_fix_pdu(response, SNMP_MSG_GETNEXT);
+ snmp_free_pdu(response);
+ response = NULL;
+ if (pdu != NULL)
+ goto retry;
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s.\n",
+ session.peername);
+ exitval = 1;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpgetnext", ss);
+ exitval = 1;
+ }
+
+ if (response)
+ snmp_free_pdu(response);
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return exitval;
+}
diff --git a/apps/snmpnetstat/Makefile.depend b/apps/snmpnetstat/Makefile.depend
new file mode 100644
index 0000000..6bfc11a
--- /dev/null
+++ b/apps/snmpnetstat/Makefile.depend
@@ -0,0 +1,425 @@
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+./if.lo: ../../include/net-snmp/net-snmp-config.h
+./if.lo: ../../include/net-snmp/system/linux.h
+./if.lo: ../../include/net-snmp/system/sysv.h
+./if.lo: ../../include/net-snmp/system/generic.h
+./if.lo: ../../include/net-snmp/net-snmp-includes.h
+./if.lo: ../../include/net-snmp/definitions.h ../../include/net-snmp/types.h
+./if.lo: ../../include/net-snmp/library/oid.h
+./if.lo: ../../include/net-snmp/library/types.h
+./if.lo: ../../include/net-snmp/library/snmp_api.h
+./if.lo: ../../include/net-snmp/varbind_api.h
+./if.lo: ../../include/net-snmp/library/snmp_client.h
+./if.lo: ../../include/net-snmp/pdu_api.h
+./if.lo: ../../include/net-snmp/library/asn1.h
+./if.lo: ../../include/net-snmp/output_api.h
+./if.lo: ../../include/net-snmp/library/snmp_debug.h
+./if.lo: ../../include/net-snmp/library/snmp_logging.h
+./if.lo: ../../include/net-snmp/session_api.h
+./if.lo: ../../include/net-snmp/library/callback.h
+./if.lo: ../../include/net-snmp/library/snmp_transport.h
+./if.lo: ../../include/net-snmp/library/snmp_service.h
+./if.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./if.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./if.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./if.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./if.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./if.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./if.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./if.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./if.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./if.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./if.lo: ../../include/net-snmp/library/ucd_compat.h
+./if.lo: ../../include/net-snmp/library/mib.h
+./if.lo: ../../include/net-snmp/mib_api.h
+./if.lo: ../../include/net-snmp/library/parse.h
+./if.lo: ../../include/net-snmp/library/oid_stash.h
+./if.lo: ../../include/net-snmp/net-snmp-features.h
+./if.lo: ../../include/net-snmp/library/snmp_impl.h
+./if.lo: ../../include/net-snmp/library/snmp.h
+./if.lo: ../../include/net-snmp/library/snmp-tc.h
+./if.lo: ../../include/net-snmp/library/getopt.h
+./if.lo: ../../include/net-snmp/utilities.h
+./if.lo: ../../include/net-snmp/library/system.h
+./if.lo: ../../include/net-snmp/library/tools.h
+./if.lo: ../../include/net-snmp/library/int64.h
+./if.lo: ../../include/net-snmp/library/mt_support.h
+./if.lo: ../../include/net-snmp/library/snmp_alarm.h
+./if.lo: ../../include/net-snmp/library/data_list.h
+./if.lo: ../../include/net-snmp/library/check_varbind.h
+./if.lo: ../../include/net-snmp/library/container.h
+./if.lo: ../../include/net-snmp/library/factory.h
+./if.lo: ../../include/net-snmp/library/container_binary_array.h
+./if.lo: ../../include/net-snmp/library/container_list_ssll.h
+./if.lo: ../../include/net-snmp/library/container_iterator.h
+./if.lo: ../../include/net-snmp/library/container.h
+./if.lo: ../../include/net-snmp/library/snmp_assert.h
+./if.lo: ../../include/net-snmp/version.h ../../include/net-snmp/config_api.h
+./if.lo: ../../include/net-snmp/library/read_config.h
+./if.lo: ../../include/net-snmp/library/default_store.h
+./if.lo: ../../include/net-snmp/net-snmp-config.h
+./if.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./if.lo: ../../include/net-snmp/library/snmp_enum.h
+./if.lo: ../../include/net-snmp/library/vacm.h
+./if.lo: ../../include/net-snmp/snmpv3_api.h
+./if.lo: ../../include/net-snmp/library/snmpv3.h
+./if.lo: ../../include/net-snmp/library/transform_oids.h
+./if.lo: ../../include/net-snmp/library/keytools.h
+./if.lo: ../../include/net-snmp/library/scapi.h
+./if.lo: ../../include/net-snmp/library/lcd_time.h
+./if.lo: ../../include/net-snmp/library/snmp_secmod.h
+./if.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./if.lo: ../../include/net-snmp/library/snmptsm.h
+./if.lo: ../../include/net-snmp/library/snmpusm.h
+./if.lo: main.h netstat.h
+./inet6.lo: ../../include/net-snmp/net-snmp-config.h
+./inet6.lo: ../../include/net-snmp/net-snmp-includes.h
+./inet6.lo: ../../include/net-snmp/definitions.h
+./inet6.lo: ../../include/net-snmp/types.h
+./inet6.lo: ../../include/net-snmp/library/oid.h
+./inet6.lo: ../../include/net-snmp/library/types.h
+./inet6.lo: ../../include/net-snmp/library/snmp_api.h
+./inet6.lo: ../../include/net-snmp/varbind_api.h
+./inet6.lo: ../../include/net-snmp/library/snmp_client.h
+./inet6.lo: ../../include/net-snmp/pdu_api.h
+./inet6.lo: ../../include/net-snmp/library/asn1.h
+./inet6.lo: ../../include/net-snmp/output_api.h
+./inet6.lo: ../../include/net-snmp/library/snmp_debug.h
+./inet6.lo: ../../include/net-snmp/library/snmp_logging.h
+./inet6.lo: ../../include/net-snmp/session_api.h
+./inet6.lo: ../../include/net-snmp/library/callback.h
+./inet6.lo: ../../include/net-snmp/library/snmp_transport.h
+./inet6.lo: ../../include/net-snmp/library/snmp_service.h
+./inet6.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./inet6.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./inet6.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./inet6.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./inet6.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./inet6.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./inet6.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./inet6.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./inet6.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./inet6.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./inet6.lo: ../../include/net-snmp/library/ucd_compat.h
+./inet6.lo: ../../include/net-snmp/library/mib.h
+./inet6.lo: ../../include/net-snmp/mib_api.h
+./inet6.lo: ../../include/net-snmp/library/parse.h
+./inet6.lo: ../../include/net-snmp/library/oid_stash.h
+./inet6.lo: ../../include/net-snmp/net-snmp-features.h
+./inet6.lo: ../../include/net-snmp/library/snmp_impl.h
+./inet6.lo: ../../include/net-snmp/library/snmp.h
+./inet6.lo: ../../include/net-snmp/library/snmp-tc.h
+./inet6.lo: ../../include/net-snmp/library/getopt.h
+./inet6.lo: ../../include/net-snmp/utilities.h
+./inet6.lo: ../../include/net-snmp/library/system.h
+./inet6.lo: ../../include/net-snmp/library/tools.h
+./inet6.lo: ../../include/net-snmp/library/int64.h
+./inet6.lo: ../../include/net-snmp/library/mt_support.h
+./inet6.lo: ../../include/net-snmp/library/snmp_alarm.h
+./inet6.lo: ../../include/net-snmp/library/data_list.h
+./inet6.lo: ../../include/net-snmp/library/check_varbind.h
+./inet6.lo: ../../include/net-snmp/library/container.h
+./inet6.lo: ../../include/net-snmp/library/factory.h
+./inet6.lo: ../../include/net-snmp/library/container_binary_array.h
+./inet6.lo: ../../include/net-snmp/library/container_list_ssll.h
+./inet6.lo: ../../include/net-snmp/library/container_iterator.h
+./inet6.lo: ../../include/net-snmp/library/container.h
+./inet6.lo: ../../include/net-snmp/library/snmp_assert.h
+./inet6.lo: ../../include/net-snmp/version.h
+./inet6.lo: ../../include/net-snmp/config_api.h
+./inet6.lo: ../../include/net-snmp/library/read_config.h
+./inet6.lo: ../../include/net-snmp/library/default_store.h
+./inet6.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./inet6.lo: ../../include/net-snmp/library/snmp_enum.h
+./inet6.lo: ../../include/net-snmp/library/vacm.h
+./inet6.lo: ../../include/net-snmp/snmpv3_api.h
+./inet6.lo: ../../include/net-snmp/library/snmpv3.h
+./inet6.lo: ../../include/net-snmp/library/transform_oids.h
+./inet6.lo: ../../include/net-snmp/library/keytools.h
+./inet6.lo: ../../include/net-snmp/library/scapi.h
+./inet6.lo: ../../include/net-snmp/library/lcd_time.h
+./inet6.lo: ../../include/net-snmp/library/snmp_secmod.h
+./inet6.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./inet6.lo: ../../include/net-snmp/library/snmptsm.h
+./inet6.lo: ../../include/net-snmp/library/snmpusm.h main.h netstat.h
+./inet.lo: ../../include/net-snmp/net-snmp-config.h
+./inet.lo: ../../include/net-snmp/net-snmp-includes.h
+./inet.lo: ../../include/net-snmp/definitions.h
+./inet.lo: ../../include/net-snmp/types.h
+./inet.lo: ../../include/net-snmp/library/oid.h
+./inet.lo: ../../include/net-snmp/library/types.h
+./inet.lo: ../../include/net-snmp/library/snmp_api.h
+./inet.lo: ../../include/net-snmp/varbind_api.h
+./inet.lo: ../../include/net-snmp/library/snmp_client.h
+./inet.lo: ../../include/net-snmp/pdu_api.h
+./inet.lo: ../../include/net-snmp/library/asn1.h
+./inet.lo: ../../include/net-snmp/output_api.h
+./inet.lo: ../../include/net-snmp/library/snmp_debug.h
+./inet.lo: ../../include/net-snmp/library/snmp_logging.h
+./inet.lo: ../../include/net-snmp/session_api.h
+./inet.lo: ../../include/net-snmp/library/callback.h
+./inet.lo: ../../include/net-snmp/library/snmp_transport.h
+./inet.lo: ../../include/net-snmp/library/snmp_service.h
+./inet.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./inet.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./inet.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./inet.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./inet.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./inet.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./inet.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./inet.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./inet.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./inet.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./inet.lo: ../../include/net-snmp/library/ucd_compat.h
+./inet.lo: ../../include/net-snmp/library/mib.h
+./inet.lo: ../../include/net-snmp/mib_api.h
+./inet.lo: ../../include/net-snmp/library/parse.h
+./inet.lo: ../../include/net-snmp/library/oid_stash.h
+./inet.lo: ../../include/net-snmp/net-snmp-features.h
+./inet.lo: ../../include/net-snmp/library/snmp_impl.h
+./inet.lo: ../../include/net-snmp/library/snmp.h
+./inet.lo: ../../include/net-snmp/library/snmp-tc.h
+./inet.lo: ../../include/net-snmp/library/getopt.h
+./inet.lo: ../../include/net-snmp/utilities.h
+./inet.lo: ../../include/net-snmp/library/system.h
+./inet.lo: ../../include/net-snmp/library/tools.h
+./inet.lo: ../../include/net-snmp/library/int64.h
+./inet.lo: ../../include/net-snmp/library/mt_support.h
+./inet.lo: ../../include/net-snmp/library/snmp_alarm.h
+./inet.lo: ../../include/net-snmp/library/data_list.h
+./inet.lo: ../../include/net-snmp/library/check_varbind.h
+./inet.lo: ../../include/net-snmp/library/container.h
+./inet.lo: ../../include/net-snmp/library/factory.h
+./inet.lo: ../../include/net-snmp/library/container_binary_array.h
+./inet.lo: ../../include/net-snmp/library/container_list_ssll.h
+./inet.lo: ../../include/net-snmp/library/container_iterator.h
+./inet.lo: ../../include/net-snmp/library/container.h
+./inet.lo: ../../include/net-snmp/library/snmp_assert.h
+./inet.lo: ../../include/net-snmp/version.h
+./inet.lo: ../../include/net-snmp/config_api.h
+./inet.lo: ../../include/net-snmp/library/read_config.h
+./inet.lo: ../../include/net-snmp/library/default_store.h
+./inet.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./inet.lo: ../../include/net-snmp/library/snmp_enum.h
+./inet.lo: ../../include/net-snmp/library/vacm.h
+./inet.lo: ../../include/net-snmp/snmpv3_api.h
+./inet.lo: ../../include/net-snmp/library/snmpv3.h
+./inet.lo: ../../include/net-snmp/library/transform_oids.h
+./inet.lo: ../../include/net-snmp/library/keytools.h
+./inet.lo: ../../include/net-snmp/library/scapi.h
+./inet.lo: ../../include/net-snmp/library/lcd_time.h
+./inet.lo: ../../include/net-snmp/library/snmp_secmod.h
+./inet.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./inet.lo: ../../include/net-snmp/library/snmptsm.h
+./inet.lo: ../../include/net-snmp/library/snmpusm.h main.h netstat.h
+./main.lo: ../../include/net-snmp/net-snmp-config.h
+./main.lo: ../../include/net-snmp/net-snmp-includes.h
+./main.lo: ../../include/net-snmp/definitions.h
+./main.lo: ../../include/net-snmp/types.h
+./main.lo: ../../include/net-snmp/library/oid.h
+./main.lo: ../../include/net-snmp/library/types.h
+./main.lo: ../../include/net-snmp/library/snmp_api.h
+./main.lo: ../../include/net-snmp/varbind_api.h
+./main.lo: ../../include/net-snmp/library/snmp_client.h
+./main.lo: ../../include/net-snmp/pdu_api.h
+./main.lo: ../../include/net-snmp/library/asn1.h
+./main.lo: ../../include/net-snmp/output_api.h
+./main.lo: ../../include/net-snmp/library/snmp_debug.h
+./main.lo: ../../include/net-snmp/library/snmp_logging.h
+./main.lo: ../../include/net-snmp/session_api.h
+./main.lo: ../../include/net-snmp/library/callback.h
+./main.lo: ../../include/net-snmp/library/snmp_transport.h
+./main.lo: ../../include/net-snmp/library/snmp_service.h
+./main.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./main.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./main.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./main.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./main.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./main.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./main.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./main.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./main.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./main.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./main.lo: ../../include/net-snmp/library/ucd_compat.h
+./main.lo: ../../include/net-snmp/library/mib.h
+./main.lo: ../../include/net-snmp/mib_api.h
+./main.lo: ../../include/net-snmp/library/parse.h
+./main.lo: ../../include/net-snmp/library/oid_stash.h
+./main.lo: ../../include/net-snmp/net-snmp-features.h
+./main.lo: ../../include/net-snmp/library/snmp_impl.h
+./main.lo: ../../include/net-snmp/library/snmp.h
+./main.lo: ../../include/net-snmp/library/snmp-tc.h
+./main.lo: ../../include/net-snmp/library/getopt.h
+./main.lo: ../../include/net-snmp/utilities.h
+./main.lo: ../../include/net-snmp/library/system.h
+./main.lo: ../../include/net-snmp/library/tools.h
+./main.lo: ../../include/net-snmp/library/int64.h
+./main.lo: ../../include/net-snmp/library/mt_support.h
+./main.lo: ../../include/net-snmp/library/snmp_alarm.h
+./main.lo: ../../include/net-snmp/library/data_list.h
+./main.lo: ../../include/net-snmp/library/check_varbind.h
+./main.lo: ../../include/net-snmp/library/container.h
+./main.lo: ../../include/net-snmp/library/factory.h
+./main.lo: ../../include/net-snmp/library/container_binary_array.h
+./main.lo: ../../include/net-snmp/library/container_list_ssll.h
+./main.lo: ../../include/net-snmp/library/container_iterator.h
+./main.lo: ../../include/net-snmp/library/container.h
+./main.lo: ../../include/net-snmp/library/snmp_assert.h
+./main.lo: ../../include/net-snmp/version.h
+./main.lo: ../../include/net-snmp/config_api.h
+./main.lo: ../../include/net-snmp/library/read_config.h
+./main.lo: ../../include/net-snmp/library/default_store.h
+./main.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./main.lo: ../../include/net-snmp/library/snmp_enum.h
+./main.lo: ../../include/net-snmp/library/vacm.h
+./main.lo: ../../include/net-snmp/snmpv3_api.h
+./main.lo: ../../include/net-snmp/library/snmpv3.h
+./main.lo: ../../include/net-snmp/library/transform_oids.h
+./main.lo: ../../include/net-snmp/library/keytools.h
+./main.lo: ../../include/net-snmp/library/scapi.h
+./main.lo: ../../include/net-snmp/library/lcd_time.h
+./main.lo: ../../include/net-snmp/library/snmp_secmod.h
+./main.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./main.lo: ../../include/net-snmp/library/snmptsm.h
+./main.lo: ../../include/net-snmp/library/snmpusm.h main.h netstat.h
+./route.lo: ../../include/net-snmp/net-snmp-config.h
+./route.lo: ../../include/net-snmp/net-snmp-includes.h
+./route.lo: ../../include/net-snmp/definitions.h
+./route.lo: ../../include/net-snmp/types.h
+./route.lo: ../../include/net-snmp/library/oid.h
+./route.lo: ../../include/net-snmp/library/types.h
+./route.lo: ../../include/net-snmp/library/snmp_api.h
+./route.lo: ../../include/net-snmp/varbind_api.h
+./route.lo: ../../include/net-snmp/library/snmp_client.h
+./route.lo: ../../include/net-snmp/pdu_api.h
+./route.lo: ../../include/net-snmp/library/asn1.h
+./route.lo: ../../include/net-snmp/output_api.h
+./route.lo: ../../include/net-snmp/library/snmp_debug.h
+./route.lo: ../../include/net-snmp/library/snmp_logging.h
+./route.lo: ../../include/net-snmp/session_api.h
+./route.lo: ../../include/net-snmp/library/callback.h
+./route.lo: ../../include/net-snmp/library/snmp_transport.h
+./route.lo: ../../include/net-snmp/library/snmp_service.h
+./route.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./route.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./route.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./route.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./route.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./route.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./route.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./route.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./route.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./route.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./route.lo: ../../include/net-snmp/library/ucd_compat.h
+./route.lo: ../../include/net-snmp/library/mib.h
+./route.lo: ../../include/net-snmp/mib_api.h
+./route.lo: ../../include/net-snmp/library/parse.h
+./route.lo: ../../include/net-snmp/library/oid_stash.h
+./route.lo: ../../include/net-snmp/net-snmp-features.h
+./route.lo: ../../include/net-snmp/library/snmp_impl.h
+./route.lo: ../../include/net-snmp/library/snmp.h
+./route.lo: ../../include/net-snmp/library/snmp-tc.h
+./route.lo: ../../include/net-snmp/library/getopt.h
+./route.lo: ../../include/net-snmp/utilities.h
+./route.lo: ../../include/net-snmp/library/system.h
+./route.lo: ../../include/net-snmp/library/tools.h
+./route.lo: ../../include/net-snmp/library/int64.h
+./route.lo: ../../include/net-snmp/library/mt_support.h
+./route.lo: ../../include/net-snmp/library/snmp_alarm.h
+./route.lo: ../../include/net-snmp/library/data_list.h
+./route.lo: ../../include/net-snmp/library/check_varbind.h
+./route.lo: ../../include/net-snmp/library/container.h
+./route.lo: ../../include/net-snmp/library/factory.h
+./route.lo: ../../include/net-snmp/library/container_binary_array.h
+./route.lo: ../../include/net-snmp/library/container_list_ssll.h
+./route.lo: ../../include/net-snmp/library/container_iterator.h
+./route.lo: ../../include/net-snmp/library/container.h
+./route.lo: ../../include/net-snmp/library/snmp_assert.h
+./route.lo: ../../include/net-snmp/version.h
+./route.lo: ../../include/net-snmp/config_api.h
+./route.lo: ../../include/net-snmp/library/read_config.h
+./route.lo: ../../include/net-snmp/library/default_store.h
+./route.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./route.lo: ../../include/net-snmp/library/snmp_enum.h
+./route.lo: ../../include/net-snmp/library/vacm.h
+./route.lo: ../../include/net-snmp/snmpv3_api.h
+./route.lo: ../../include/net-snmp/library/snmpv3.h
+./route.lo: ../../include/net-snmp/library/transform_oids.h
+./route.lo: ../../include/net-snmp/library/keytools.h
+./route.lo: ../../include/net-snmp/library/scapi.h
+./route.lo: ../../include/net-snmp/library/lcd_time.h
+./route.lo: ../../include/net-snmp/library/snmp_secmod.h
+./route.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./route.lo: ../../include/net-snmp/library/snmptsm.h
+./route.lo: ../../include/net-snmp/library/snmpusm.h main.h netstat.h
+./winstub.lo: ../../include/net-snmp/net-snmp-config.h
+./winstub.lo: ../../include/net-snmp/net-snmp-includes.h
+./winstub.lo: ../../include/net-snmp/definitions.h
+./winstub.lo: ../../include/net-snmp/types.h
+./winstub.lo: ../../include/net-snmp/library/oid.h
+./winstub.lo: ../../include/net-snmp/library/types.h
+./winstub.lo: ../../include/net-snmp/library/snmp_api.h
+./winstub.lo: ../../include/net-snmp/varbind_api.h
+./winstub.lo: ../../include/net-snmp/library/snmp_client.h
+./winstub.lo: ../../include/net-snmp/pdu_api.h
+./winstub.lo: ../../include/net-snmp/library/asn1.h
+./winstub.lo: ../../include/net-snmp/output_api.h
+./winstub.lo: ../../include/net-snmp/library/snmp_debug.h
+./winstub.lo: ../../include/net-snmp/library/snmp_logging.h
+./winstub.lo: ../../include/net-snmp/session_api.h
+./winstub.lo: ../../include/net-snmp/library/callback.h
+./winstub.lo: ../../include/net-snmp/library/snmp_transport.h
+./winstub.lo: ../../include/net-snmp/library/snmp_service.h
+./winstub.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./winstub.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./winstub.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./winstub.lo: ../../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./winstub.lo: ../../include/net-snmp/library/snmpIPv4BaseDomain.h
+./winstub.lo: ../../include/net-snmp/library/snmpUDPBaseDomain.h
+./winstub.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./winstub.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./winstub.lo: ../../include/net-snmp/library/snmpIPv6BaseDomain.h
+./winstub.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./winstub.lo: ../../include/net-snmp/library/ucd_compat.h
+./winstub.lo: ../../include/net-snmp/library/mib.h
+./winstub.lo: ../../include/net-snmp/mib_api.h
+./winstub.lo: ../../include/net-snmp/library/parse.h
+./winstub.lo: ../../include/net-snmp/library/oid_stash.h
+./winstub.lo: ../../include/net-snmp/net-snmp-features.h
+./winstub.lo: ../../include/net-snmp/library/snmp_impl.h
+./winstub.lo: ../../include/net-snmp/library/snmp.h
+./winstub.lo: ../../include/net-snmp/library/snmp-tc.h
+./winstub.lo: ../../include/net-snmp/library/getopt.h
+./winstub.lo: ../../include/net-snmp/utilities.h
+./winstub.lo: ../../include/net-snmp/library/system.h
+./winstub.lo: ../../include/net-snmp/library/tools.h
+./winstub.lo: ../../include/net-snmp/library/int64.h
+./winstub.lo: ../../include/net-snmp/library/mt_support.h
+./winstub.lo: ../../include/net-snmp/library/snmp_alarm.h
+./winstub.lo: ../../include/net-snmp/library/data_list.h
+./winstub.lo: ../../include/net-snmp/library/check_varbind.h
+./winstub.lo: ../../include/net-snmp/library/container.h
+./winstub.lo: ../../include/net-snmp/library/factory.h
+./winstub.lo: ../../include/net-snmp/library/container_binary_array.h
+./winstub.lo: ../../include/net-snmp/library/container_list_ssll.h
+./winstub.lo: ../../include/net-snmp/library/container_iterator.h
+./winstub.lo: ../../include/net-snmp/library/container.h
+./winstub.lo: ../../include/net-snmp/library/snmp_assert.h
+./winstub.lo: ../../include/net-snmp/version.h
+./winstub.lo: ../../include/net-snmp/config_api.h
+./winstub.lo: ../../include/net-snmp/library/read_config.h
+./winstub.lo: ../../include/net-snmp/library/default_store.h
+./winstub.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./winstub.lo: ../../include/net-snmp/library/snmp_enum.h
+./winstub.lo: ../../include/net-snmp/library/vacm.h
+./winstub.lo: ../../include/net-snmp/snmpv3_api.h
+./winstub.lo: ../../include/net-snmp/library/snmpv3.h
+./winstub.lo: ../../include/net-snmp/library/transform_oids.h
+./winstub.lo: ../../include/net-snmp/library/keytools.h
+./winstub.lo: ../../include/net-snmp/library/scapi.h
+./winstub.lo: ../../include/net-snmp/library/lcd_time.h
+./winstub.lo: ../../include/net-snmp/library/snmp_secmod.h
+./winstub.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./winstub.lo: ../../include/net-snmp/library/snmptsm.h
+./winstub.lo: ../../include/net-snmp/library/snmpusm.h
diff --git a/apps/snmpnetstat/Makefile.in b/apps/snmpnetstat/Makefile.in
new file mode 100644
index 0000000..ac6e775
--- /dev/null
+++ b/apps/snmpnetstat/Makefile.in
@@ -0,0 +1,38 @@
+#
+# snmpnetstat Makefile
+#
+
+top_builddir=../..
+mysubdir=apps/snmpnetstat
+
+INSTALLBINPROGS=snmpnetstat$(EXEEXT)
+
+# 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)
+
+#
+# build info
+#
+SRCS= inet.c inet6.c if.c main.c route.c winstub.c ffs.c
+OBJS= inet.o inet6.o if.o main.o route.o winstub.o ffs.o
+LOBJS= inet.lo inet6.lo if.lo main.lo route.lo winstub.lo ffs.lo
+FTOBJS= inet.ft inet6.ft if.ft main.ft route.ft winstub.ft ffs.ft
+TARG= snmpnetstat$(EXEEXT)
+
+FEATUREFILE=../../include/net-snmp/features-snmpnetstat.h
+
+CPPFLAGS= $(TOP_INCLUDES) @CPPFLAGS@
+
+VAL_LIBS = @VAL_LIBS@
+USELIBS= ../../snmplib/libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION)
+LIBS= ../../snmplib/libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION) $(VAL_LIBS) @LIBS@
+
+all: standardall
+
+snmpnetstat$(EXEEXT): ${LOBJS} ${USELIBS}
+ ${LINK} ${CFLAGS} -o $@ ${LOBJS} ${LOCAL_LIBS} ${LDFLAGS} ${LIBS}
diff --git a/apps/snmpnetstat/ffs.c b/apps/snmpnetstat/ffs.c
new file mode 100644
index 0000000..5997339
--- /dev/null
+++ b/apps/snmpnetstat/ffs.c
@@ -0,0 +1,38 @@
+/* $OpenBSD: ffs.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
+
+/*
+ * Public domain.
+ * Written by Dale Rahn.
+ */
+
+/*
+ * ffs -- vax ffs instruction
+ */
+int
+_ffs(int mask)
+{
+ int bit;
+ unsigned int r = mask;
+ static const signed char t[16] = {
+ -28, 1, 2, 1,
+ 3, 1, 2, 1,
+ 4, 1, 2, 1,
+ 3, 1, 2, 1
+ };
+
+ bit = 0;
+ if (!(r & 0xffff)) {
+ bit += 16;
+ r >>= 16;
+ }
+ if (!(r & 0xff)) {
+ bit += 8;
+ r >>= 8;
+ }
+ if (!(r & 0xf)) {
+ bit += 4;
+ r >>= 4;
+ }
+
+ return (bit + t[ r & 0xf ]);
+}
diff --git a/apps/snmpnetstat/if.c b/apps/snmpnetstat/if.c
new file mode 100644
index 0000000..f7e7554
--- /dev/null
+++ b/apps/snmpnetstat/if.c
@@ -0,0 +1,870 @@
+/* $OpenBSD: if.c,v 1.42 2005/03/13 16:05:50 mpf Exp $ */
+/* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1983, 1988, 1993
+ * 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef INHERITED_CODE
+#ifndef lint
+#if 0
+static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
+#else
+static char *rcsid = "$OpenBSD: if.c,v 1.42 2005/03/13 16:05:50 mpf Exp $";
+#endif
+#endif /* not lint */
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#endif
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED 1
+#endif
+#include <signal.h>
+
+#include "main.h"
+#include "netstat.h"
+
+#define YES 1
+#define NO 0
+
+static void sidewaysintpr(u_int);
+static void timerSet(int interval_seconds);
+static void timerPause(void);
+
+ struct _if_info {
+ char name[128];
+ char ip[128], route[128];
+ int mtu;
+ int drops;
+ unsigned int ifindex;
+ /*
+ * Save "expandable" fields as string values
+ * rather than integer statistics
+ */
+ char s_ipkts[20], s_ierrs[20];
+ char s_opkts[20], s_oerrs[20];
+ char s_ibytes[20], s_obytes[20];
+ char s_outq[20];
+ unsigned long ipkts, opkts; /* Need to combine 2 MIB values */
+ int operstatus;
+/*
+ u_long netmask;
+ struct in_addr ifip, ifroute;
+ */
+ struct _if_info *next;
+ };
+
+
+/*
+ * Retrieve the interface addressing information
+ * XXX - This could also be extended to handle non-IP interfaces
+ */
+void
+_set_address( struct _if_info *cur_if )
+{
+ oid ipaddr_oid[] = { 1,3,6,1,2,1,4,20,1,0 };
+ size_t ipaddr_len = OID_LENGTH( ipaddr_oid );
+ static netsnmp_variable_list *addr_if_var =NULL;
+ static netsnmp_variable_list *addr_mask_var=NULL;
+ netsnmp_variable_list *vp, *vp2;
+ union {
+ in_addr_t addr;
+ char data[4];
+ } tmpAddr;
+ char *cp;
+ in_addr_t ifAddr, mask;
+
+ /*
+ * Note that this information only needs to be retrieved
+ * once, and can be re-used for subsequent calls.
+ */
+ if ( addr_if_var == NULL ) {
+ ipaddr_oid[ 9 ] = 2; /* ipAdEntIfIndex */
+ snmp_varlist_add_variable( &addr_if_var, ipaddr_oid, ipaddr_len,
+ ASN_NULL, NULL, 0);
+ netsnmp_query_walk( addr_if_var, ss );
+
+ ipaddr_oid[ 9 ] = 3; /* ipAdEntNetMask */
+ snmp_varlist_add_variable( &addr_mask_var, ipaddr_oid, ipaddr_len,
+ ASN_NULL, NULL, 0);
+ netsnmp_query_walk( addr_mask_var, ss );
+ }
+
+ /*
+ * Find the address row relevant to this interface
+ */
+ for (vp=addr_if_var, vp2=addr_mask_var; vp;
+ vp=vp->next_variable, vp2=vp2->next_variable) {
+ if ( vp->val.integer && *vp->val.integer == (int)cur_if->ifindex )
+ break;
+ }
+ if (vp2) {
+ /*
+ * Always want a numeric interface IP address
+ */
+ snprintf( cur_if->ip, 128, "%" NETSNMP_PRIo "u.%" NETSNMP_PRIo "u."
+ "%" NETSNMP_PRIo "u.%" NETSNMP_PRIo "u",
+ vp2->name[10],
+ vp2->name[11],
+ vp2->name[12],
+ vp2->name[13]);
+
+ /*
+ * But re-use the routing table utilities/code for
+ * displaying the local network information
+ */
+ cp = tmpAddr.data;
+ cp[0] = vp2->name[ 10 ] & 0xff;
+ cp[1] = vp2->name[ 11 ] & 0xff;
+ cp[2] = vp2->name[ 12 ] & 0xff;
+ cp[3] = vp2->name[ 13 ] & 0xff;
+ ifAddr = tmpAddr.addr;
+ cp = tmpAddr.data;
+ cp[0] = vp2->val.string[ 0 ] & 0xff;
+ cp[1] = vp2->val.string[ 1 ] & 0xff;
+ cp[2] = vp2->val.string[ 2 ] & 0xff;
+ cp[3] = vp2->val.string[ 3 ] & 0xff;
+ mask = tmpAddr.addr;
+ snprintf( cur_if->route, 128, "%s", netname(ifAddr, mask));
+ }
+}
+
+
+/*
+ * Print a description of the network interfaces.
+ */
+void
+intpr(int interval)
+{
+ oid ifcol_oid[] = { 1,3,6,1,2,1,2,2,1,0 };
+ size_t ifcol_len = OID_LENGTH( ifcol_oid );
+
+ struct _if_info *if_head, *if_tail, *cur_if;
+ netsnmp_variable_list *var, *vp;
+ /*
+ * Track maximum field widths, expanding as necessary
+ * This is one reason why results can't be
+ * displayed immediately they are retrieved.
+ */
+ int max_name = 4, max_ip = 7, max_route = 7, max_outq = 5;
+ int max_ipkts = 5, max_ierrs = 5, max_opkts = 5, max_oerrs = 5;
+ int max_ibytes = 6, max_obytes = 6;
+ int i;
+
+
+ if (interval) {
+ sidewaysintpr((unsigned)interval);
+ return;
+ }
+
+ /*
+ * The traditional "netstat -i" output combines information
+ * from two SNMP tables:
+ * ipAddrTable (for the IP address/network)
+ * ifTable (for the interface statistics)
+ *
+ * The previous approach was to retrieve (and save) the
+ * address information first. Then walk the main ifTable,
+ * add the relevant stored addresses, and saving the
+ * full information for each interface, before displaying
+ * the results as a separate pass.
+ *
+ * This code reverses this general structure, by first retrieving
+ * (and storing) the interface statistics for the whole table,
+ * then inserting the address information obtained from the
+ * ipAddrTable, and finally displaying the results.
+ * Such an arrangement should make it easier to extend this
+ * to handle non-IP interfaces (hence not in ipAddrTable)
+ */
+ if_head = NULL;
+ if_tail = NULL;
+ var = NULL;
+
+#define ADD_IFVAR( x ) ifcol_oid[ ifcol_len-1 ] = x; \
+ snmp_varlist_add_variable( &var, ifcol_oid, ifcol_len, ASN_NULL, NULL, 0)
+ ADD_IFVAR( 2 ); /* ifName */
+ ADD_IFVAR( 4 ); /* ifMtu */
+ ADD_IFVAR( 8 ); /* ifOperStatus */
+ /*
+ * The Net/Open-BSD behaviour is to display *either* byte
+ * counts *or* packet/error counts (but not both). FreeBSD
+ * integrates the byte counts into the traditional display.
+ *
+ * The previous 'snmpnetstat' implementation followed the
+ * separatist model. This re-write offers an opportunity
+ * to adopt the (more useful, IMO) Free-BSD approach.
+ *
+ * Or we could perhaps support both styles? :-)
+ */
+ if (bflag || oflag) {
+ ADD_IFVAR( 10 ); /* ifInOctets */
+ ADD_IFVAR( 16 ); /* ifOutOctets */
+ }
+ if (!oflag) {
+ ADD_IFVAR( 11 ); /* ifInUcastPkts */
+ ADD_IFVAR( 12 ); /* ifInNUcastPkts */
+ ADD_IFVAR( 14 ); /* ifInErrors */
+ ADD_IFVAR( 17 ); /* ifOutUcastPkts */
+ ADD_IFVAR( 18 ); /* ifOutNUcastPkts */
+ ADD_IFVAR( 20 ); /* ifOutErrors */
+ ADD_IFVAR( 21 ); /* ifOutQLen */
+ }
+#if 0
+ if (tflag) {
+ ADD_IFVAR( XX ); /* ??? */
+ }
+#endif
+ if (dflag) {
+ ADD_IFVAR( 19 ); /* ifOutDiscards */
+ }
+#undef ADD_IFVAR
+
+ /*
+ * Now walk the ifTable, creating a list of interfaces
+ */
+ while ( 1 ) {
+ if (netsnmp_query_getnext( var, ss ) != SNMP_ERR_NOERROR)
+ break;
+ ifcol_oid[ ifcol_len-1 ] = 2; /* ifDescr */
+ if ( snmp_oid_compare( ifcol_oid, ifcol_len,
+ var->name, ifcol_len) != 0 )
+ break; /* End of Table */
+ cur_if = SNMP_MALLOC_TYPEDEF( struct _if_info );
+ if (!cur_if)
+ break;
+ cur_if->ifindex = var->name[ var->name_length-1 ];
+ for ( vp=var; vp; vp=vp->next_variable ) {
+ if ( ! vp->val.integer )
+ continue;
+ if ( var->name[ var->name_length-1 ] != cur_if->ifindex ) {
+ /*
+ * Inconsistent index information
+ * XXX - Try to recover ?
+ */
+ SNMP_FREE( cur_if );
+ break; /* not for now, no */
+ }
+ switch ( vp->name[ var->name_length-2 ] ) {
+ case 2: /* ifDescr */
+ if (vp->val_len >= sizeof(cur_if->name))
+ vp->val_len = sizeof(cur_if->name)-1;
+ memmove( cur_if->name, vp->val.string, vp->val_len );
+ cur_if->name[vp->val_len] = 0;
+ if ((i = strlen(cur_if->name) + 1) > max_name)
+ max_name = i;
+ break;
+ case 4: /* ifMtu */
+ cur_if->mtu = *vp->val.integer;
+ break;
+ case 8: /* ifOperStatus */
+ cur_if->operstatus = *vp->val.integer;
+ /* XXX - any special processing ?? */
+ break;
+ case 10: /* ifInOctets */
+ sprintf(cur_if->s_ibytes, "%lu", *vp->val.integer);
+ i = strlen(cur_if->s_ibytes);
+ if (i > max_ibytes)
+ max_ibytes = i;
+ break;
+ case 11: /* ifInUcastPkts */
+ cur_if->ipkts += *vp->val.integer;
+ sprintf(cur_if->s_ipkts, "%lu", cur_if->ipkts);
+ i = strlen(cur_if->s_ipkts);
+ if (i > max_ipkts)
+ max_ipkts = i;
+ break;
+ case 12: /* ifInNUcastPkts */
+ cur_if->ipkts += *vp->val.integer;
+ sprintf(cur_if->s_ipkts, "%lu", cur_if->ipkts);
+ i = strlen(cur_if->s_ipkts);
+ if (i > max_ipkts)
+ max_ipkts = i;
+ break;
+ case 14: /* ifInErrors */
+ sprintf(cur_if->s_ierrs, "%lu", *vp->val.integer);
+ i = strlen(cur_if->s_ierrs);
+ if (i > max_ierrs)
+ max_ierrs = i;
+ break;
+ case 16: /* ifOutOctets */
+ sprintf(cur_if->s_obytes, "%lu", *vp->val.integer);
+ i = strlen(cur_if->s_obytes);
+ if (i > max_obytes)
+ max_obytes = i;
+ break;
+ case 17: /* ifOutUcastPkts */
+ cur_if->opkts += *vp->val.integer;
+ sprintf(cur_if->s_opkts, "%lu", cur_if->opkts);
+ i = strlen(cur_if->s_opkts);
+ if (i > max_opkts)
+ max_opkts = i;
+ break;
+ case 18: /* ifOutNUcastPkts */
+ cur_if->opkts += *vp->val.integer;
+ sprintf(cur_if->s_opkts, "%lu", cur_if->opkts);
+ i = strlen(cur_if->s_opkts);
+ if (i > max_opkts)
+ max_opkts = i;
+ break;
+ case 19: /* ifOutDiscards */
+ cur_if->drops = *vp->val.integer;
+ break;
+ case 20: /* ifOutErrors */
+ sprintf(cur_if->s_oerrs, "%lu", *vp->val.integer);
+ i = strlen(cur_if->s_oerrs);
+ if (i > max_oerrs)
+ max_oerrs = i;
+ break;
+ case 21: /* ifOutQLen */
+ sprintf(cur_if->s_outq, "%lu", *vp->val.integer);
+ i = strlen(cur_if->s_outq);
+ if (i > max_outq)
+ max_outq = i;
+ break;
+ }
+ }
+
+ /*
+ * XXX - Perhaps query ifXTable for additional info ??
+ * (ifName/ifAlias, or HC counters)
+ */
+
+ /*
+ * If we're to monitor a particular interface, then
+ * ignore all others. It would be more efficient
+ * to check this earlier (as part of processing
+ * the varbind list). But performing this test here
+ * means we can recognise ifXTable names as well)
+ */
+ if ( intrface && strcmp( cur_if->name, intrface ) != 0) {
+ SNMP_FREE( cur_if );
+ }
+
+ /*
+ * Insert the IP address and network settings, and
+ * add the new _if_stat structure to the list.
+ */
+ if ( cur_if ) {
+ _set_address( cur_if );
+ i = strlen(cur_if->ip);
+ if (i > max_ip)
+ max_ip = i;
+ i = strlen(cur_if->route);
+ if (i > max_route)
+ max_route = i;
+
+ if ( if_tail ) {
+ if_tail->next = cur_if;
+ if_tail = cur_if;
+ } else {
+ if_head = cur_if;
+ if_tail = cur_if;
+ }
+ }
+ } /* while (1) */
+
+ /*
+ * Now display the specified results (in Free-BSD format)
+ * setting the field widths appropriately....
+ */
+ printf("%*.*s %5.5s %*.*s %*.*s",
+ -max_name, max_name, "Name", "Mtu",
+ -max_route, max_route, "Network",
+ -max_ip, max_ip, "Address");
+ if (oflag) {
+ printf(" %*s %*s", max_ibytes, "Ibytes",
+ max_obytes, "Obytes");
+ } else {
+ printf(" %*s %*s", max_ipkts, "Ipkts",
+ max_ierrs, "Ierrs");
+ if (bflag)
+ printf(" %*s", max_ibytes, "Ibytes");
+
+ printf(" %*s %*s", max_opkts, "Opkts",
+ max_oerrs, "Oerrs");
+ if (bflag)
+ printf(" %*s", max_obytes, "Obytes");
+
+ printf(" %*s", max_outq, "Queue");
+ }
+ /* if (tflag)
+ printf(" %s", "Time");
+ */
+ if (dflag)
+ printf(" %s", "Drop");
+ putchar('\n');
+
+ for (cur_if = if_head; cur_if; cur_if=cur_if->next) {
+ if (cur_if->name[0] == 0)
+ continue;
+ printf( "%*.*s %5d", -max_name, max_name, cur_if->name, cur_if->mtu);
+ printf(" %*.*s", -max_route, max_route, cur_if->route);
+ printf(" %*.*s", -max_ip, max_ip, cur_if->ip);
+
+ if (oflag) {
+ printf(" %*s %*s", max_ibytes, cur_if->s_ibytes,
+ max_obytes, cur_if->s_obytes);
+ } else {
+ printf(" %*s %*s", max_ipkts, cur_if->s_ipkts,
+ max_ierrs, cur_if->s_ierrs);
+ if (bflag)
+ printf(" %*s", max_ibytes, cur_if->s_ibytes);
+
+ printf(" %*s %*s", max_opkts, cur_if->s_opkts,
+ max_oerrs, cur_if->s_oerrs);
+ if (bflag)
+ printf(" %*s", max_obytes, cur_if->s_obytes);
+ printf(" %*s", max_outq, cur_if->s_outq);
+ }
+ /* if (tflag)
+ printf(" %4d", cur_if->???);
+ */
+ if (dflag)
+ printf(" %4d", cur_if->drops);
+ putchar('\n');
+ }
+
+ /*
+ * ... and tidy up.
+ */
+ for (cur_if = if_head; cur_if; cur_if=if_head) {
+ if_head=cur_if->next;
+ cur_if->next = NULL;
+ SNMP_FREE( cur_if );
+ }
+}
+
+
+#define MAXIF 100
+struct iftot {
+ char ift_name[128]; /* interface name */
+ int ifIndex;
+ u_long ift_ip; /* input packets */
+ u_long ift_ib; /* input bytes */
+ u_long ift_ie; /* input errors */
+ u_long ift_op; /* output packets */
+ u_long ift_ob; /* output bytes */
+ u_long ift_oe; /* output errors */
+ u_long ift_co; /* collisions */
+ u_long ift_dr; /* drops */
+};
+
+int signalled; /* set if alarm goes off "early" */
+
+/*
+ * Print a running summary of interface statistics.
+ * Repeat display every interval seconds, showing statistics
+ * collected over that interval. Assumes that interval is non-zero.
+ * First line printed at top of screen is always cumulative.
+ */
+static void
+sidewaysintpr(unsigned int interval)
+{
+ /*
+ * As with the "one-shot" interface display, there are
+ * two different possible output formats. The Net/
+ * Open-BSD style displays both information about a
+ * single interface *and* the overall totals.
+ * The equivalent Free-BSD approach is to report on one
+ * or the other (rather than both). This is probably
+ * more useful (IMO), and significantly more efficient.
+ * So that's the style implemented here.
+ *
+ * Note that the 'ifcol' OID buffer can represent a full
+ * instance (including ifIndex), rather than just a
+ * column object OID, as with the one-shot code.
+ */
+ oid ifcol_oid[] = { 1,3,6,1,2,1,2,2,1,0,0 };
+ size_t ifcol_len = OID_LENGTH( ifcol_oid );
+ netsnmp_variable_list *var, *vp;
+ struct iftot *ip = NULL, *cur_if = NULL; /* single I/F display */
+ struct iftot *sum = NULL, *total = NULL; /* overall summary */
+ int line;
+ int first;
+ size_t i;
+
+ var = NULL;
+ if ( intrface ) {
+ /*
+ * Locate the ifIndex of the interface to monitor,
+ * by walking the ifDescr column of the ifTable
+ */
+ ifcol_oid[ ifcol_len-2 ] = 2; /* ifDescr */
+ snmp_varlist_add_variable( &var, ifcol_oid, ifcol_len-1,
+ ASN_NULL, NULL, 0);
+ i = strlen(intrface);
+ netsnmp_query_walk( var, ss );
+ for (vp=var; vp; vp=vp->next_variable) {
+ if (strncmp(intrface, (char *)vp->val.string, i) == 0 &&
+ i == vp->val_len)
+ break; /* found requested interface */
+ }
+ /*
+ * XXX - Might be worth searching ifName/ifAlias as well
+ */
+ if (!vp) {
+ fprintf(stderr, "%s: unknown interface\n", intrface );
+ exit(1);
+ }
+
+ /*
+ * Prepare the current and previous 'iftot' structures,
+ * and set the ifIndex value in the OID buffer.
+ */
+ ip = SNMP_MALLOC_TYPEDEF( struct iftot );
+ cur_if = SNMP_MALLOC_TYPEDEF( struct iftot );
+ if (!ip || !cur_if) {
+ fprintf(stderr, "internal error\n");
+ exit(1);
+ }
+ ifcol_oid[ ifcol_len-1 ] = vp->name[ ifcol_len-1 ];
+ snmp_free_var( var );
+ var = NULL;
+ } else {
+ /*
+ * Prepare the current and previous 'iftot' structures.
+ * (using different pointers, for consistency with *BSD code)
+ */
+ sum = SNMP_MALLOC_TYPEDEF( struct iftot );
+ total = SNMP_MALLOC_TYPEDEF( struct iftot );
+ if (!sum || !total) {
+ fprintf(stderr, "internal error\n");
+ exit(1);
+ }
+ }
+
+ timerSet( interval );
+ first = 1;
+banner:
+ printf( "%17s %14s %16s", "input",
+ intrface ? intrface : "(Total)", "output");
+ putchar('\n');
+ printf( "%10s %5s %10s %10s %5s %10s %5s",
+ "packets", "errs", "bytes", "packets", "errs", "bytes", "colls");
+ if (dflag)
+ printf(" %5.5s", "drops");
+ putchar('\n');
+ fflush(stdout);
+ line = 0;
+loop:
+ if ( intrface ) {
+#define ADD_IFVAR( x ) ifcol_oid[ ifcol_len-2 ] = x; \
+ snmp_varlist_add_variable( &var, ifcol_oid, ifcol_len, ASN_NULL, NULL, 0)
+ /* if (bflag) { */
+ ADD_IFVAR( 10 ); /* ifInOctets */
+ ADD_IFVAR( 16 ); /* ifOutOctets */
+ /* } */
+ ADD_IFVAR( 11 ); /* ifInUcastPkts */
+ ADD_IFVAR( 12 ); /* ifInNUcastPkts */
+ ADD_IFVAR( 14 ); /* ifInErrors */
+ ADD_IFVAR( 17 ); /* ifOutUcastPkts */
+ ADD_IFVAR( 18 ); /* ifOutNUcastPkts */
+ ADD_IFVAR( 20 ); /* ifOutErrors */
+ ADD_IFVAR( 21 ); /* ifOutQLen */
+ if (dflag) {
+ ADD_IFVAR( 19 ); /* ifOutDiscards */
+ }
+#undef ADD_IFVAR
+
+ netsnmp_query_get( var, ss ); /* Or parallel walk ?? */
+ cur_if->ift_ip = 0;
+ cur_if->ift_ib = 0;
+ cur_if->ift_ie = 0;
+ cur_if->ift_op = 0;
+ cur_if->ift_ob = 0;
+ cur_if->ift_oe = 0;
+ cur_if->ift_co = 0;
+ cur_if->ift_dr = 0;
+ cur_if->ifIndex = var->name[ ifcol_len-1 ];
+ for (vp=var; vp; vp=vp->next_variable) {
+ if ( ! vp->val.integer )
+ continue;
+ switch (vp->name[ifcol_len-2]) {
+ case 10: /* ifInOctets */
+ cur_if->ift_ib = *vp->val.integer;
+ break;
+ case 11: /* ifInUcastPkts */
+ cur_if->ift_ip += *vp->val.integer;
+ break;
+ case 12: /* ifInNUcastPkts */
+ cur_if->ift_ip += *vp->val.integer;
+ break;
+ case 14: /* ifInErrors */
+ cur_if->ift_ie = *vp->val.integer;
+ break;
+ case 16: /* ifOutOctets */
+ cur_if->ift_ob = *vp->val.integer;
+ break;
+ case 17: /* ifOutUcastPkts */
+ cur_if->ift_op += *vp->val.integer;
+ break;
+ case 18: /* ifOutNUcastPkts */
+ cur_if->ift_op += *vp->val.integer;
+ break;
+ case 19: /* ifOutDiscards */
+ cur_if->ift_dr = *vp->val.integer;
+ break;
+ case 20: /* ifOutErrors */
+ cur_if->ift_oe = *vp->val.integer;
+ break;
+ case 21: /* ifOutQLen */
+ cur_if->ift_co = *vp->val.integer;
+ break;
+ }
+ }
+ snmp_free_varbind( var );
+ var = NULL;
+
+ if (!first) {
+ printf("%10lu %5lu %10lu %10lu %5lu %10lu %5lu",
+ cur_if->ift_ip - ip->ift_ip,
+ cur_if->ift_ie - ip->ift_ie,
+ cur_if->ift_ib - ip->ift_ib,
+ cur_if->ift_op - ip->ift_op,
+ cur_if->ift_oe - ip->ift_oe,
+ cur_if->ift_ob - ip->ift_ob,
+ cur_if->ift_co - ip->ift_co);
+ if (dflag)
+ printf(" %5lu", cur_if->ift_dr - ip->ift_dr);
+ putchar('\n');
+ fflush(stdout);
+ }
+ ip->ift_ip = cur_if->ift_ip;
+ ip->ift_ie = cur_if->ift_ie;
+ ip->ift_ib = cur_if->ift_ib;
+ ip->ift_op = cur_if->ift_op;
+ ip->ift_oe = cur_if->ift_oe;
+ ip->ift_ob = cur_if->ift_ob;
+ ip->ift_co = cur_if->ift_co;
+ ip->ift_dr = cur_if->ift_dr;
+ } /* (single) interface */
+ else {
+ sum->ift_ip = 0;
+ sum->ift_ib = 0;
+ sum->ift_ie = 0;
+ sum->ift_op = 0;
+ sum->ift_ob = 0;
+ sum->ift_oe = 0;
+ sum->ift_co = 0;
+ sum->ift_dr = 0;
+#define ADD_IFVAR( x ) ifcol_oid[ ifcol_len-2 ] = x; \
+ snmp_varlist_add_variable( &var, ifcol_oid, ifcol_len-1, ASN_NULL, NULL, 0)
+ ADD_IFVAR( 11 ); /* ifInUcastPkts */
+ ADD_IFVAR( 12 ); /* ifInNUcastPkts */
+ ADD_IFVAR( 14 ); /* ifInErrors */
+ ADD_IFVAR( 17 ); /* ifOutUcastPkts */
+ ADD_IFVAR( 18 ); /* ifOutNUcastPkts */
+ ADD_IFVAR( 20 ); /* ifOutErrors */
+ ADD_IFVAR( 21 ); /* ifOutQLen */
+ /* if (bflag) { */
+ ADD_IFVAR( 10 ); /* ifInOctets */
+ ADD_IFVAR( 16 ); /* ifOutOctets */
+ /* } */
+ if (dflag) {
+ ADD_IFVAR( 19 ); /* ifOutDiscards */
+ }
+#undef ADD_IFVAR
+
+ ifcol_oid[ ifcol_len-2 ] = 11; /* ifInUcastPkts */
+ while ( 1 ) {
+ if (netsnmp_query_getnext( var, ss ) != SNMP_ERR_NOERROR)
+ break;
+ if ( snmp_oid_compare( ifcol_oid, ifcol_len-2,
+ var->name, ifcol_len-2) != 0 )
+ break; /* End of Table */
+
+ for ( vp=var; vp; vp=vp->next_variable ) {
+ if ( ! vp->val.integer )
+ continue;
+ switch ( vp->name[ ifcol_len-2 ] ) {
+ case 10: /* ifInOctets */
+ sum->ift_ib += *vp->val.integer;
+ break;
+ case 11: /* ifInUcastPkts */
+ sum->ift_ip += *vp->val.integer;
+ break;
+ case 12: /* ifInNUcastPkts */
+ sum->ift_ip += *vp->val.integer;
+ break;
+ case 14: /* ifInErrors */
+ sum->ift_ie += *vp->val.integer;
+ break;
+ case 16: /* ifOutOctets */
+ sum->ift_ob += *vp->val.integer;
+ break;
+ case 17: /* ifOutUcastPkts */
+ sum->ift_op += *vp->val.integer;
+ break;
+ case 18: /* ifOutNUcastPkts */
+ sum->ift_op += *vp->val.integer;
+ break;
+ case 19: /* ifOutDiscards */
+ sum->ift_dr += *vp->val.integer;
+ break;
+ case 20: /* ifOutErrors */
+ sum->ift_oe += *vp->val.integer;
+ break;
+ case 21: /* ifOutQLen */
+ sum->ift_co += *vp->val.integer;
+ break;
+ }
+ }
+ /*
+ * Now loop to retrieve the next entry from the table.
+ */
+ } /* while (1) */
+
+ snmp_free_varbind( var );
+ var = NULL;
+
+ if (!first) {
+ printf("%10lu %5lu %10lu %10lu %5lu %10lu %5lu",
+ sum->ift_ip - total->ift_ip,
+ sum->ift_ie - total->ift_ie,
+ sum->ift_ib - total->ift_ib,
+ sum->ift_op - total->ift_op,
+ sum->ift_oe - total->ift_oe,
+ sum->ift_ob - total->ift_ob,
+ sum->ift_co - total->ift_co);
+ if (dflag)
+ printf(" %5lu", sum->ift_dr - total->ift_dr);
+ putchar('\n');
+ fflush(stdout);
+ }
+ total->ift_ip = sum->ift_ip;
+ total->ift_ie = sum->ift_ie;
+ total->ift_ib = sum->ift_ib;
+ total->ift_op = sum->ift_op;
+ total->ift_oe = sum->ift_oe;
+ total->ift_ob = sum->ift_ob;
+ total->ift_co = sum->ift_co;
+ total->ift_dr = sum->ift_dr;
+ } /* overall summary */
+
+ timerPause();
+ timerSet(interval);
+ line++;
+ first = 0;
+ if (line == 21)
+ goto banner;
+ else
+ goto loop;
+ /*NOTREACHED*/
+}
+
+
+/*
+ * timerSet sets or resets the timer to fire in "interval" seconds.
+ * timerPause waits only if the timer has not fired.
+ * timing precision is not considered important.
+ */
+
+#if (defined(WIN32) || defined(cygwin))
+static int sav_int;
+static time_t timezup;
+static void
+timerSet(int interval_seconds)
+{
+ sav_int = interval_seconds;
+ timezup = time(0) + interval_seconds;
+}
+
+/*
+ * you can do better than this !
+ */
+static void
+timerPause(void)
+{
+ time_t now;
+ while (time(&now) < timezup)
+#ifdef WIN32
+ Sleep(400);
+#else
+ {
+ struct timeval tx;
+ tx.tv_sec = 0;
+ tx.tv_usec = 400 * 1000; /* 400 milliseconds */
+ select(0, 0, 0, 0, &tx);
+ }
+#endif
+}
+
+#else
+
+/*
+ * Called if an interval expires before sidewaysintpr has completed a loop.
+ * Sets a flag to not wait for the alarm.
+ */
+RETSIGTYPE
+catchalarm(int sig)
+{
+ signalled = YES;
+}
+
+static void
+timerSet(int interval_seconds)
+{
+#ifdef HAVE_SIGSET
+ (void) sigset(SIGALRM, catchalarm);
+#else
+ (void) signal(SIGALRM, catchalarm);
+#endif
+ signalled = NO;
+ (void) alarm(interval_seconds);
+}
+
+static void
+timerPause(void)
+{
+#ifdef HAVE_SIGHOLD
+ sighold(SIGALRM);
+ if (!signalled) {
+ sigpause(SIGALRM);
+ }
+#else
+ int oldmask;
+ oldmask = sigblock(sigmask(SIGALRM));
+ if (!signalled) {
+ sigpause(0);
+ }
+ sigsetmask(oldmask);
+#endif
+}
+
+#endif /* !WIN32 && !cygwin */
diff --git a/apps/snmpnetstat/inet.c b/apps/snmpnetstat/inet.c
new file mode 100644
index 0000000..0ae810d
--- /dev/null
+++ b/apps/snmpnetstat/inet.c
@@ -0,0 +1,649 @@
+/* $OpenBSD: inet.c,v 1.92 2005/02/10 14:25:08 itojun Exp $ */
+/* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1983, 1988, 1993
+ * 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef INHERITED_CODE
+#ifndef lint
+#if 0
+static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94";
+#else
+static const char *rcsid = "$OpenBSD: inet.c,v 1.92 2005/02/10 14:25:08 itojun Exp $";
+#endif
+#endif /* not lint */
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_WINSOCK_H
+#include "winstub.h"
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#include "main.h"
+#include "netstat.h"
+
+struct stat_table {
+ unsigned int entry; /* entry number in table */
+ /*
+ * format string to printf(description, value)
+ * warning: the %d must be before the %s
+ */
+ char description[80];
+};
+
+char *inetname(struct in_addr *);
+void inetprint(struct in_addr *, int, const char *, int);
+
+ /*
+ * Print a summary of connections related to
+ * an Internet protocol (kread-based) - Omitted
+ */
+
+/*
+ * Print a summary of TCP connections
+ * Listening processes are suppressed unless the
+ * -a (all) flag is specified.
+ */
+const char *tcpstates[] = {
+ "",
+ "CLOSED",
+ "LISTEN",
+ "SYNSENT",
+ "SYNRECEIVED",
+ "ESTABLISHED",
+ "FINWAIT1",
+ "FINWAIT2",
+ "CLOSEWAIT",
+ "LASTACK",
+ "CLOSING",
+ "TIMEWAIT"
+};
+#define TCP_NSTATES 11
+
+static void
+tcpprotoprint_line(const char *name, netsnmp_variable_list *vp, int *first)
+{
+ int state, width;
+ char *cp;
+ union {
+ struct in_addr addr;
+ char data[4];
+ } tmpAddr;
+ oid localPort, remotePort;
+ struct in_addr localAddr, remoteAddr;
+
+ state = *vp->val.integer;
+ if (!aflag && state == MIB_TCPCONNSTATE_LISTEN) {
+ return;
+ }
+
+ if (*first) {
+ printf("Active Internet (%s) Connections", name);
+ if (aflag)
+ printf(" (including servers)");
+ putchar('\n');
+ width = Aflag ? 18 : 22;
+ printf("%-5.5s %*.*s %*.*s %s\n",
+ "Proto", -width, width, "Local Address",
+ -width, width, "Remote Address", "(state)");
+ *first = 0;
+ }
+
+ /* Extract the local/remote information from the index values */
+ cp = tmpAddr.data;
+ cp[0] = vp->name[ 10 ] & 0xff;
+ cp[1] = vp->name[ 11 ] & 0xff;
+ cp[2] = vp->name[ 12 ] & 0xff;
+ cp[3] = vp->name[ 13 ] & 0xff;
+ localAddr.s_addr = tmpAddr.addr.s_addr;
+ localPort = ntohs(vp->name[ 14 ]);
+ cp = tmpAddr.data;
+ cp[0] = vp->name[ 15 ] & 0xff;
+ cp[1] = vp->name[ 16 ] & 0xff;
+ cp[2] = vp->name[ 17 ] & 0xff;
+ cp[3] = vp->name[ 18 ] & 0xff;
+ remoteAddr.s_addr = tmpAddr.addr.s_addr;
+ remotePort = ntohs(vp->name[ 19 ]);
+
+ printf("%-5.5s", name);
+ inetprint(&localAddr, localPort, name, 1);
+ inetprint(&remoteAddr, remotePort, name, 0);
+ if (state < 1 || state > TCP_NSTATES) {
+ printf("%d\n", state );
+ } else {
+ printf("%s\n", tcpstates[state]);
+ }
+}
+
+static void
+tcpprotopr_get(const char *name, oid *root, size_t root_len)
+{
+ netsnmp_variable_list *var, *vp;
+ int first = 1;
+
+ /*
+ * Walking the tcpConnState column will provide all
+ * the necessary information.
+ */
+ var = NULL;
+ snmp_varlist_add_variable( &var, root, root_len,
+ ASN_NULL, NULL, 0);
+ if (!var)
+ return;
+ if (netsnmp_query_walk( var, ss ) != SNMP_ERR_NOERROR)
+ return;
+
+ for (vp = var; vp ; vp=vp->next_variable) {
+ tcpprotoprint_line(name, vp, &first);
+ }
+ snmp_free_varbind( var );
+}
+
+/*
+ * Print a summary of UDP "connections"
+ * XXX - what about "listening" services ??
+ */
+void
+udpprotopr(const char *name)
+{
+ netsnmp_variable_list *var, *vp;
+ oid udpLocalAddress_oid[] = { 1,3,6,1,2,1,7,5,1,1 };
+ size_t udpLocalAddress_len = OID_LENGTH( udpLocalAddress_oid );
+ union {
+ struct in_addr addr;
+ char data[4];
+ } tmpAddr;
+ struct in_addr localAddr;
+ oid localPort;
+ char *cp;
+
+ /*
+ * Walking a single column of the udpTable will provide
+ * all the necessary information from the index values.
+ */
+ var = NULL;
+ snmp_varlist_add_variable( &var, udpLocalAddress_oid, udpLocalAddress_len,
+ ASN_NULL, NULL, 0);
+ if (!var)
+ return;
+ if (netsnmp_query_walk( var, ss ) != SNMP_ERR_NOERROR)
+ return;
+
+ printf("Active Internet (%s) Connections\n", name);
+ printf("%-5.5s %-28.28s\n", "Proto", "Local Address");
+ for (vp = var; vp ; vp=vp->next_variable) {
+ printf("%-5.5s", name);
+ /*
+ * Extract the local port from the index values, but take
+ * the IP address from the varbind value, (which is why
+ * we walked udpLocalAddress rather than udpLocalPort)
+ */
+ cp = tmpAddr.data;
+ cp[0] = vp->name[ 10 ] & 0xff;
+ cp[1] = vp->name[ 11 ] & 0xff;
+ cp[2] = vp->name[ 12 ] & 0xff;
+ cp[3] = vp->name[ 13 ] & 0xff;
+ localAddr.s_addr = tmpAddr.addr.s_addr;
+ localPort = ntohs( (u_short)(vp->name[ 14 ]));
+ inetprint(&localAddr, localPort, name, 1);
+ putchar('\n');
+ }
+ snmp_free_varbind( var );
+}
+
+void
+tcpprotopr_bulkget(const char *name, oid *root, size_t root_len)
+{
+ netsnmp_variable_list *vp;
+ netsnmp_pdu *pdu, *response;
+ oid tcpConnState_oid[MAX_OID_LEN];
+ size_t tcpConnState_len;
+ int first = 1;
+ int running = 1;
+ int status;
+
+ /*
+ * setup initial object name
+ */
+ memmove(tcpConnState_oid, root, sizeof(oid) * root_len);
+ tcpConnState_len = root_len;
+
+ /*
+ * Walking the tcpConnState column will provide all
+ * the necessary information.
+ */
+ while (running) {
+ /*
+ * create PDU for GETBULK request and add object name to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETBULK);
+ pdu->non_repeaters = 0;
+ pdu->max_repetitions = max_getbulk; /* fill the packet */
+ snmp_add_null_var(pdu, tcpConnState_oid, tcpConnState_len);
+
+ /*
+ * do the request
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ for (vp = response->variables; vp ; vp=vp->next_variable) {
+ if ((vp->name_length < root_len) ||
+ (memcmp(root, vp->name, sizeof(oid) * root_len) != 0)) {
+ /*
+ * not part of this subtree
+ */
+ running = 0;
+ continue;
+ }
+
+ tcpprotoprint_line(name, vp, &first);
+
+ if ((vp->type != SNMP_ENDOFMIBVIEW) &&
+ (vp->type != SNMP_NOSUCHOBJECT) &&
+ (vp->type != SNMP_NOSUCHINSTANCE)) {
+ /*
+ * Check if last variable, and if so, save for next request.
+ */
+ if (vp->next_variable == NULL) {
+ memmove(tcpConnState_oid, vp->name,
+ vp->name_length * sizeof(oid));
+ tcpConnState_len = vp->name_length;
+ }
+ } else {
+ /*
+ * an exception value, so stop
+ */
+ running = 0;
+ }
+ }
+ } else {
+ /*
+ * error in response, print it
+ */
+ running = 0;
+ }
+ } else if (status == STAT_TIMEOUT) {
+ running = 0;
+ } else { /* status == STAT_ERROR */
+ running = 0;
+ }
+
+ if (response) {
+ snmp_free_pdu(response);
+ }
+ }
+}
+
+void
+tcpprotopr(const char *name)
+{
+ oid tcpConnState_oid[] = { 1,3,6,1,2,1,6,13,1,1 };
+ size_t tcpConnState_len = OID_LENGTH( tcpConnState_oid );
+ int use_getbulk = 1;
+
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (ss->version == SNMP_VERSION_1) {
+ use_getbulk = 0;
+ }
+#endif
+
+ if (use_getbulk) {
+ tcpprotopr_bulkget(name, tcpConnState_oid, tcpConnState_len);
+ } else {
+ tcpprotopr_get(name, tcpConnState_oid, tcpConnState_len);
+ }
+}
+
+
+ /*********************
+ *
+ * Internet-protocol statistics
+ *
+ *********************/
+
+void
+_dump_stats( const char *name, oid *oid_buf, size_t buf_len,
+ struct stat_table *stable )
+{
+ netsnmp_variable_list *var, *vp;
+ struct stat_table *sp;
+ oid stat;
+
+ var = NULL;
+ for (sp=stable; sp->entry; sp++) {
+ oid_buf[buf_len-2] = sp->entry;
+ snmp_varlist_add_variable( &var, oid_buf, buf_len,
+ ASN_NULL, NULL, 0);
+ }
+
+ if (netsnmp_query_get( var, ss ) != SNMP_ERR_NOERROR) {
+ /* Need to fix and re-try SNMPv1 errors */
+ snmp_free_var( var );
+ return;
+ }
+
+ printf("%s:\n", name);
+ sp=stable;
+ for (vp=var; vp; vp=vp->next_variable, sp++) {
+ /*
+ * Match the returned results against
+ * the original stats table.
+ */
+ stat = vp->name[buf_len-2];
+ while (sp->entry < stat) {
+ sp++;
+ if (sp->entry == 0)
+ break;
+ }
+ if (sp->entry > stat)
+ continue;
+
+ /* Skip exceptions or missing values */
+ if ( !vp->val.integer )
+ continue;
+ /*
+ * If '-Cs' was specified twice,
+ * then only display non-zero stats.
+ */
+ if ( *vp->val.integer > 0 || sflag == 1 ) {
+ putchar('\t');
+ printf(sp->description, *vp->val.integer,
+ plural(*vp->val.integer));
+ putchar('\n');
+ }
+ }
+ snmp_free_varbind( var );
+}
+
+
+/*
+ * Dump IP statistics.
+ */
+void
+ip_stats(const char *name)
+{
+ oid ipstats_oid[] = { 1, 3, 6, 1, 2, 1, 4, 0, 0 };
+ size_t ipstats_len = OID_LENGTH( ipstats_oid );
+ struct stat_table ipstats_tbl[] = {
+ {3, "%d total datagram%s received"},
+ {4, "%d datagram%s with header errors"},
+ {5, "%d datagram%s with an invalid destination address"},
+ {6, "%d datagram%s forwarded"},
+ {7, "%d datagram%s with unknown protocol"},
+ {8, "%d datagram%s discarded"},
+ {9, "%d datagram%s delivered"},
+ {10, "%d output datagram request%s"},
+ {11, "%d output datagram%s discarded"},
+ {12, "%d datagram%s with no route"},
+ {14, "%d fragment%s received"},
+ {15, "%d datagram%s reassembled"},
+ {16, "%d reassembly failure%s"},
+ {17, "%d datagram%s fragmented"},
+ {18, "%d fragmentation failure%s"},
+ {19, "%d fragment%s created"},
+ {23, "%d route%s discarded"},
+ {0, ""}
+ };
+
+ _dump_stats( name, ipstats_oid, ipstats_len, ipstats_tbl );
+}
+
+
+/*
+ * Dump ICMP statistics.
+ */
+void
+icmp_stats(const char *name)
+{
+ oid icmpstats_oid[] = { 1, 3, 6, 1, 2, 1, 5, 0, 0 };
+ size_t icmpstats_len = OID_LENGTH( icmpstats_oid );
+ struct stat_table icmpstats_tbl[] = {
+ {1, "%d total message%s received"},
+ {2, "%d message%s dropped due to errors"},
+ {14, "%d ouput message request%s"},
+ {15, "%d output message%s discarded"},
+ {0, ""}
+ };
+ struct stat_table icmp_inhistogram[] = {
+ {3, "Destination unreachable: %d"},
+ {4, "Time Exceeded: %d"},
+ {5, "Parameter Problem: %d"},
+ {6, "Source Quench: %d"},
+ {7, "Redirect: %d"},
+ {8, "Echo Request: %d"},
+ {9, "Echo Reply: %d"},
+ {10, "Timestamp Request: %d"},
+ {11, "Timestamp Reply: %d"},
+ {12, "Address Mask Request: %d"},
+ {13, "Address Mask Reply: %d"},
+ {0, ""}
+ };
+ struct stat_table icmp_outhistogram[] = {
+ {16, "Destination unreachable: %d"},
+ {17, "Time Exceeded: %d"},
+ {18, "Parameter Problem: %d"},
+ {19, "Source Quench: %d"},
+ {20, "Redirect: %d"},
+ {21, "Echo Request: %d"},
+ {22, "Echo Reply: %d"},
+ {23, "Timestamp Request: %d"},
+ {24, "Timestamp Reply: %d"},
+ {25, "Address Mask Request: %d"},
+ {26, "Address Mask Reply: %d"},
+ {0, ""}
+ };
+
+ _dump_stats( name, icmpstats_oid, icmpstats_len, icmpstats_tbl );
+ _dump_stats( " Input Histogram",
+ icmpstats_oid, icmpstats_len, icmp_inhistogram );
+ _dump_stats( " Output Histogram",
+ icmpstats_oid, icmpstats_len, icmp_outhistogram );
+}
+
+
+/*
+ * Dump TCP statistics.
+ */
+void
+tcp_stats(const char *name)
+{
+ oid tcpstats_oid[] = { 1, 3, 6, 1, 2, 1, 6, 0, 0 };
+ size_t tcpstats_len = OID_LENGTH( tcpstats_oid );
+ struct stat_table tcpstats_tbl[] = {
+ {5, "%d active open%s"},
+ {6, "%d passive open%s"},
+ {7, "%d failed attempt%s"},
+ {8, "%d reset%s of established connections"},
+ {9, "%d current established connection%s"},
+ {10, "%d segment%s received"},
+ {11, "%d segment%s sent"},
+ {12, "%d segment%s retransmitted"},
+ {14, "%d invalid segment%s received"},
+ {15, "%d reset%s sent"},
+ {0, ""}
+ };
+ _dump_stats( name, tcpstats_oid, tcpstats_len, tcpstats_tbl );
+}
+
+
+/*
+ * Dump UDP statistics.
+ */
+void
+udp_stats(const char *name)
+{
+ oid udpstats_oid[] = { 1, 3, 6, 1, 2, 1, 7, 0, 0 };
+ size_t udpstats_len = OID_LENGTH( udpstats_oid );
+ struct stat_table udpstats_tbl[] = {
+ {1, "%d total datagram%s received"},
+ {2, "%d datagram%s to invalid port"},
+ {3, "%d datagram%s dropped due to errors"},
+ {4, "%d output datagram request%s"},
+ {0, ""}
+ };
+ _dump_stats( name, udpstats_oid, udpstats_len, udpstats_tbl );
+}
+
+
+/*
+ * Omitted:
+ * Dump IGMP statistics
+ * Dump PIM statistics
+ * Dump AH statistics
+ * Dump etherip statistics
+ * Dump ESP statistics
+ * Dump IP-in-IP statistics
+ * Dump CARP statistics
+ * Dump pfsync statistics
+ * Dump IPCOMP statistics
+ */
+
+ /*
+ * Utility routines
+ */
+
+/*
+ * Translation of RPC service names - Omitted
+ */
+
+/*
+ * Pretty print an Internet address (net address + port).
+ * If the nflag was specified, use numbers instead of names.
+ */
+void
+inetprint(struct in_addr *in, int port, const char *proto, int local)
+{
+ struct servent *sp = NULL;
+ char line[80], *cp;
+ int width;
+
+ snprintf(line, sizeof line, "%.*s.", (Aflag && !nflag) ? 12 : 16,
+ inetname(in));
+ cp = strchr(line, '\0');
+ if (!nflag && port)
+ sp = getservbyport((int)port, proto);
+ if (sp || port == 0)
+ snprintf(cp, line + sizeof line - cp, "%.8s",
+ sp ? sp->s_name : "*");
+ /*
+ * Translation of RPC service names - Omitted
+ */
+ else
+ snprintf(cp, line + sizeof line - cp, "%d", ntohs(port));
+ width = Aflag ? 18 : 22;
+ printf(" %-*.*s", width, width, line);
+}
+
+/*
+ * Construct an Internet address representation.
+ * If the nflag has been supplied, give
+ * numeric value, otherwise try for symbolic name.
+ */
+char *
+inetname(struct in_addr *inp)
+{
+ char *cp;
+ static char line[50];
+ struct hostent *hp;
+ struct netent *np;
+ static char domain[MAXHOSTNAMELEN];
+ static int first = 1;
+#if defined (WIN32) || defined (cygwin)
+ char host_temp[] = "localhost";
+#endif
+
+ if (first && !nflag) {
+ first = 0;
+ if (gethostname(domain, sizeof(domain)) == 0 &&
+ (cp = strchr(domain, '.')))
+ (void) strlcpy(domain, cp + 1, sizeof domain);
+ else
+ domain[0] = '\0';
+ }
+ cp = NULL;
+ if (!nflag && inp->s_addr != INADDR_ANY) {
+ int net = inet_netof(*inp);
+ int lna = inet_lnaof(*inp);
+
+ if (lna == INADDR_ANY) {
+ np = getnetbyaddr(net, AF_INET);
+ if (np)
+ cp = np->n_name;
+ }
+ if (cp == NULL) {
+ hp = netsnmp_gethostbyaddr((char *)inp, sizeof (*inp),
+ AF_INET);
+ if (hp) {
+ if ((cp = strchr(hp->h_name, '.')) &&
+ !strcmp(cp + 1, domain))
+ *cp = '\0';
+#if defined (WIN32) || defined (cygwin)
+ /* Windows insists on returning the computer name for 127.0.0.1
+ * even if the hosts file lists something else such as 'localhost'.
+ * If we are trying to look up 127.0.0.1, just return 'localhost' */
+ if (!strcmp(inet_ntoa(*inp),"127.0.0.1"))
+ cp = host_temp;
+ else
+#endif
+ cp = hp->h_name;
+ }
+ }
+ }
+ if (inp->s_addr == INADDR_ANY)
+ snprintf(line, sizeof line, "*");
+ else if (cp)
+ snprintf(line, sizeof line, "%s", cp);
+ else {
+ inp->s_addr = ntohl(inp->s_addr);
+#define C(x) (unsigned)((x) & 0xff)
+ snprintf(line, sizeof line, "%u.%u.%u.%u",
+ C(inp->s_addr >> 24), C(inp->s_addr >> 16),
+ C(inp->s_addr >> 8), C(inp->s_addr));
+ }
+ return (line);
+}
diff --git a/apps/snmpnetstat/inet6.c b/apps/snmpnetstat/inet6.c
new file mode 100644
index 0000000..d4ad391
--- /dev/null
+++ b/apps/snmpnetstat/inet6.c
@@ -0,0 +1,516 @@
+/* $OpenBSD: inet6.c,v 1.31 2004/11/17 01:47:20 itojun Exp $ */
+/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
+/*
+ * Copyright (c) 1983, 1988, 1993
+ * 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef INHERITED_CODE
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94";
+#else
+/*__RCSID("$OpenBSD: inet6.c,v 1.31 2004/11/17 01:47:20 itojun Exp $");*/
+/*__RCSID("KAME Id: inet6.c,v 1.10 2000/02/09 10:49:31 itojun Exp");*/
+#endif
+#endif /* not lint */
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_WINSOCK_H
+#include "winstub.h"
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#include "main.h"
+#include "netstat.h"
+
+struct stat_table {
+ unsigned int entry; /* entry number in table */
+ /*
+ * format string to printf(description, value)
+ * warning: the %d must be before the %s
+ */
+ char description[80];
+};
+
+char *inet6name(const unsigned char *);
+void inet6print(unsigned char *, int, const char *, int);
+
+/*
+ * Print a summary of TCPv6 connections
+ * Listening processes are suppressed unless the
+ * -a (all) flag is specified.
+ */
+const char *tcp6states[] = {
+ "",
+ "CLOSED",
+ "LISTEN",
+ "SYNSENT",
+ "SYNRECEIVED",
+ "ESTABLISHED",
+ "FINWAIT1",
+ "FINWAIT2",
+ "CLOSEWAIT",
+ "LASTACK",
+ "CLOSING",
+ "TIMEWAIT"
+};
+#define TCP_NSTATES 11
+
+void
+tcp6protopr(const char *name)
+{
+ netsnmp_variable_list *var, *vp;
+ oid ipv6TcpConnState_oid[] = { 1,3,6,1,2,1,6,16,1,6 };
+ size_t ipv6TcpConnState_len = OID_LENGTH( ipv6TcpConnState_oid );
+ int state, i;
+ unsigned char localAddr[16], remoteAddr[16];
+ int localPort, remotePort, ifIndex;
+ int first = 1;
+
+ /*
+ * Walking the v6 tcpConnState column will provide all
+ * the necessary information.
+ */
+ var = NULL;
+ snmp_varlist_add_variable( &var, ipv6TcpConnState_oid,
+ ipv6TcpConnState_len,
+ ASN_NULL, NULL, 0);
+ if (netsnmp_query_walk( var, ss ) != SNMP_ERR_NOERROR)
+ return;
+ if (var->type == ASN_NULL) /* No entries */
+ return;
+
+ for (vp = var; vp ; vp=vp->next_variable) {
+ state = *vp->val.integer;
+ if (!aflag && state == MIB_TCPCONNSTATE_LISTEN)
+ continue;
+
+ if (first) {
+ printf("Active Internet Connections");
+ if (aflag)
+ printf(" (including servers)");
+ putchar('\n');
+ printf("%-5.5s %-28.28s %-28.28s %4s %s\n",
+ "Proto", "Local Address", "Remote Address", "I/F", "(state)");
+ first = 0;
+ }
+
+ /* Extract the local/remote information from the index values */
+ for (i=0; i<16; i++)
+ localAddr[i] = vp->name[ 10+i ];
+ localPort = vp->name[ 26 ];
+ for (i=0; i<16; i++)
+ remoteAddr[i] = vp->name[ 27+i ];
+ remotePort = vp->name[ 43 ];
+ ifIndex = vp->name[ 44 ];
+
+ printf("%-5.5s", name);
+ inet6print(localAddr, localPort, name, 1);
+ inet6print(remoteAddr, remotePort, name, 0);
+ if ( state < 1 || state > TCP_NSTATES )
+ printf(" %4d %d\n", ifIndex, state );
+ else
+ printf(" %4d %s\n", ifIndex, tcp6states[ state ]);
+ }
+ snmp_free_varbind( var );
+}
+
+/*
+ * Print a summary of UDPv6 "connections"
+ * XXX - what about "listening" services ??
+ */
+void
+udp6protopr(const char *name)
+{
+ netsnmp_variable_list *var, *vp;
+ oid ipv6UdpLocalAddress_oid[] = { 1,3,6,1,2,1,7,6,1,1 };
+ size_t ipv6UdpLocalAddress_len = OID_LENGTH( ipv6UdpLocalAddress_oid );
+ int localPort, ifIndex;
+
+ /*
+ * Walking a single column of the udpTable will provide
+ * all the necessary information from the index values.
+ */
+ var = NULL;
+ snmp_varlist_add_variable( &var, ipv6UdpLocalAddress_oid,
+ ipv6UdpLocalAddress_len,
+ ASN_NULL, NULL, 0);
+ if (netsnmp_query_walk( var, ss ) != SNMP_ERR_NOERROR)
+ return;
+ if (var->type == ASN_NULL) /* No entries */
+ return;
+
+ printf("Active Internet Connections\n");
+ printf("%-5.5s %-28.28s %4s\n", "Proto", "Local Address", "I/F");
+ for (vp = var; vp ; vp=vp->next_variable) {
+ printf("%-5.5s", name);
+ /*
+ * Extract the local port from the index values, but take
+ * the IP address from the varbind value, (which is why
+ * we walked udpLocalAddress rather than udpLocalPort)
+ */
+ localPort = vp->name[ vp->name_length-2 ];
+ ifIndex = vp->name[ vp->name_length-1 ];
+ inet6print(vp->val.string, localPort, name, 1);
+ printf(" %4d\n", ifIndex );
+ }
+ snmp_free_varbind( var );
+}
+
+
+ /*********************
+ *
+ * IPv6 statistics
+ *
+ *********************/
+
+/*
+ * Unlike the equivalent IPv4 statistics display routine,
+ * the IPv6 version must walk the columns of a table
+ * and total the statistics for each column (rather
+ * than simply retrieving individual scalar values)
+ */
+void
+_dump_v6stats( const char *name, oid *oid_buf, size_t buf_len,
+ struct stat_table *stable )
+{
+ netsnmp_variable_list *var, *vp;
+ struct stat_table *sp;
+ long *stats;
+ oid stat;
+ unsigned int max_stat = 0;
+ int active = 0;
+
+ var = NULL;
+ for (sp=stable; sp->entry; sp++) {
+ oid_buf[buf_len-1] = sp->entry;
+ if (sp->entry > max_stat)
+ max_stat = sp->entry;
+ snmp_varlist_add_variable( &var, oid_buf, buf_len,
+ ASN_NULL, NULL, 0);
+ }
+ oid_buf[buf_len-1] = stable[0].entry;
+ stats = (long *)calloc(max_stat+1, sizeof(long));
+
+ /*
+ * Walk the specified column(s), and total the individual statistics
+ */
+ while (1) {
+ if (netsnmp_query_getnext( var, ss ) != SNMP_ERR_NOERROR)
+ break;
+ if ( snmp_oid_compare( oid_buf, buf_len,
+ var->name, buf_len) != 0 )
+ break; /* End of Table */
+
+ for ( vp=var; vp; vp=vp->next_variable ) {
+ stat = vp->name[ buf_len-1 ];
+ stats[stat] += *vp->val.integer;
+ }
+ active=1;
+ }
+ if (!active) {
+ free( stats );
+ snmp_free_varbind( var );
+ return; /* No statistics to display */
+ }
+
+ /*
+ * Display the results
+ */
+ printf("%s:\n", name);
+ for (sp=stable; sp->entry; sp++) {
+ /*
+ * If '-Cs' was specified twice,
+ * then only display non-zero stats.
+ */
+ if ( stats[sp->entry] > 0 || sflag == 1 ) {
+ putchar('\t');
+ printf(sp->description, stats[sp->entry],
+ plural(stats[sp->entry]));
+ putchar('\n');
+ }
+ }
+ free( stats );
+ snmp_free_varbind( var );
+}
+
+
+/*
+ * Dump IP6 statistics.
+ */
+void
+ip6_stats(const char *name)
+{
+ oid ip6stats_oid[] = { 1, 3, 6, 1, 2, 1, 55, 1, 6, 1, 0 };
+ size_t ip6stats_len = OID_LENGTH( ip6stats_oid );
+ struct stat_table ip6stats_tbl[] = {
+ {1, "%d total datagram%s received"},
+ {2, "%d datagram%s with header errors"},
+ {3, "%d oversized datagram%s"},
+ {4, "%d datagram%s with no route"},
+ {5, "%d datagram%s with an invalid destination address"},
+ {6, "%d datagram%s with unknown protocol"},
+ {7, "%d short datagram%s discarded"},
+ {8, "%d datagram%s discarded"},
+ {9, "%d datagram%s delivered"},
+ {10, "%d datagram%s forwarded"},
+ {11, "%d output datagram request%s"},
+ {12, "%d output datagram%s discarded"},
+ {13, "%d datagram%s fragmented"},
+ {14, "%d fragmentation failure%s"},
+ {15, "%d fragment%s created"},
+ {16, "%d fragment%s received"},
+ {17, "%d datagram%s reassembled"},
+ {18, "%d reassembly failure%s"},
+ {19, "%d multicast datagram%s received"},
+ {20, "%d multicast datagram%s transmitted"},
+ {0, ""}
+ };
+
+ _dump_v6stats( name, ip6stats_oid, ip6stats_len, ip6stats_tbl );
+}
+
+/*
+ * Dump IPv6 per-interface statistics - Omitted
+ */
+
+
+/*
+ * Dump ICMP6 statistics.
+ */
+void
+icmp6_stats(const char *name)
+{
+ oid icmp6stats_oid[] = { 1, 3, 6, 1, 2, 1, 56, 1, 1, 1, 0 };
+ size_t icmp6stats_len = OID_LENGTH( icmp6stats_oid );
+ struct stat_table icmp6stats_tbl[] = {
+ {1, "%d total message%s received"},
+ {2, "%d message%s dropped due to errors"},
+ {18, "%d ouput message request%s"},
+ {19, "%d output message%s discarded"},
+ {0, ""}
+ };
+ struct stat_table icmp6_inhistogram[] = {
+ {3, "Destination unreachable: %d"},
+ {4, "Admin Prohibit: %d"},
+ {5, "Time Exceeded: %d"},
+ {6, "Parameter Problem: %d"},
+ {7, "Too Big: %d"},
+ {8, "Echo Request: %d"},
+ {9, "Echo Reply: %d"},
+ {10, "Router Solicit: %d"},
+ {11, "Router Advert: %d"},
+ {12, "Neighbor Solicit: %d"},
+ {13, "Neighbor Advert: %d"},
+ {14, "Redirect: %d"},
+ {15, "Group Member Request: %d"},
+ {16, "Group Member Reply:%d"},
+ {17, "Group Member Reduce:%d"},
+ {0, ""}
+ };
+ struct stat_table icmp6_outhistogram[] = {
+ {20, "Destination unreachable: %d"},
+ {21, "Admin Prohibit: %d"},
+ {22, "Time Exceeded: %d"},
+ {23, "Parameter Problem: %d"},
+ {24, "Too Big: %d"},
+ {25, "Echo Request: %d"},
+ {26, "Echo Reply: %d"},
+ {27, "Router Solicit: %d"},
+ {28, "Router Advert: %d"},
+ {29, "Neighbor Solicit: %d"},
+ {30, "Neighbor Advert: %d"},
+ {31, "Redirect: %d"},
+ {32, "Group Member Request: %d"},
+ {33, "Group Member Reply:%d"},
+ {34, "Group Member Reduce:%d"},
+ {0, ""}
+ };
+
+ _dump_v6stats( name, icmp6stats_oid, icmp6stats_len, icmp6stats_tbl );
+ _dump_v6stats( " Input Histogram",
+ icmp6stats_oid, icmp6stats_len, icmp6_inhistogram );
+ _dump_v6stats( " Output Histogram",
+ icmp6stats_oid, icmp6stats_len, icmp6_outhistogram );
+}
+
+/*
+ * Dump ICMPv6 per-interface statistics - Omitted
+ */
+
+
+/*
+ * Ommitted:
+ * Dump PIM statistics
+ * Dump raw ip6 statistics
+ */
+
+
+
+/*
+ * Pretty print an Internet address (net address + port).
+ * If the nflag was specified, use numbers instead of names.
+ */
+
+void
+inet6print(unsigned char *in6, int port, const char *proto, int local)
+{
+
+#define GETSERVBYPORT6(port, proto, ret) do { \
+ if (strcmp((proto), "tcp6") == 0) \
+ (ret) = getservbyport((int)(port), "tcp"); \
+ else if (strcmp((proto), "udp6") == 0) \
+ (ret) = getservbyport((int)(port), "udp"); \
+ else \
+ (ret) = getservbyport((int)(port), (proto)); \
+ } while (0)
+
+ struct servent *sp = NULL;
+ char line[80], *cp;
+ unsigned width;
+ int len = sizeof line;
+
+ width = Aflag ? 12 : 16;
+ if (vflag && width < strlen(inet6name(in6)))
+ width = strlen(inet6name(in6));
+ snprintf(line, len, "%.*s.", width, inet6name(in6));
+ len -= strlen(line);
+ if (len <= 0)
+ goto bail;
+
+ cp = strchr(line, '\0');
+ if (!nflag && port && local)
+ GETSERVBYPORT6(port, proto, sp);
+ if (sp || port == 0)
+ snprintf(cp, len, "%.8s", sp ? sp->s_name : "*");
+ else
+ snprintf(cp, len, "%d", ntohs((u_short)port));
+ width = Aflag ? 18 : 22;
+ if (vflag && width < strlen(line))
+ width = strlen(line);
+bail:
+ printf(" %-*.*s", width, width, line);
+}
+
+/*
+ * Construct an Internet address representation.
+ * If the nflag has been supplied, give
+ * numeric value, otherwise try for symbolic name.
+ */
+
+char *
+inet6name(const unsigned char *in6)
+{
+ char *cp;
+ static char line[NI_MAXHOST];
+ static char domain[MAXHOSTNAMELEN];
+ static int first = 1;
+#ifdef NETSNMP_ENABLE_IPV6
+ struct hostent *hp;
+ char hbuf[NI_MAXHOST];
+ const int niflag = NI_NUMERICHOST;
+ struct sockaddr_in6 sin6;
+ const struct in6_addr *in6p = (const struct in6_addr *)in6;
+#endif
+
+ if (first && !nflag) {
+ first = 0;
+ if (gethostname(domain, sizeof(domain)) == 0 &&
+ (cp = strchr(domain, '.')))
+ (void) strlcpy(domain, cp + 1, sizeof domain);
+ else
+ domain[0] = '\0';
+ }
+#ifdef NETSNMP_ENABLE_IPV6
+ cp = NULL;
+ if (!nflag && !IN6_IS_ADDR_UNSPECIFIED(in6p)) {
+ hp = netsnmp_gethostbyaddr((const char *)in6p, sizeof(*in6p),
+ AF_INET6);
+ if (hp) {
+ if ((cp = strchr(hp->h_name, '.')) &&
+ !strcmp(cp + 1, domain))
+ *cp = 0;
+ cp = hp->h_name;
+ }
+ }
+ if (IN6_IS_ADDR_UNSPECIFIED(in6p))
+ strlcpy(line, "*", sizeof(line));
+ else if (cp)
+ strlcpy(line, cp, sizeof(line));
+ else {
+ memset(&sin6, 0, sizeof(sin6));
+/* sin6.sin6_len = sizeof(sin6); */
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_addr = *in6p;
+#ifdef __KAME__
+ if (IN6_IS_ADDR_LINKLOCAL(in6p) ||
+ IN6_IS_ADDR_MC_LINKLOCAL(in6p)) {
+ sin6.sin6_scope_id =
+ ntohs(*(const uint16_t *)&in6p->s6_addr[2]);
+ sin6.sin6_addr.s6_addr[2] = 0;
+ sin6.sin6_addr.s6_addr[3] = 0;
+ }
+#endif
+ if (getnameinfo((struct sockaddr *)&sin6, sizeof(sin6),
+ hbuf, sizeof(hbuf), NULL, 0, niflag) != 0)
+ strlcpy(hbuf, "?", sizeof hbuf);
+ strlcpy(line, hbuf, sizeof(line));
+ }
+#else
+ strlcpy(line, "[[XXX - inet6 address]]", sizeof(line));
+#endif
+ return (line);
+}
+
+#ifdef TCP6
+/*
+ * Dump the contents of a TCP6 PCB - Omitted
+ */
+#endif
diff --git a/apps/snmpnetstat/main.c b/apps/snmpnetstat/main.c
new file mode 100644
index 0000000..2e09d5e
--- /dev/null
+++ b/apps/snmpnetstat/main.c
@@ -0,0 +1,539 @@
+/* $OpenBSD: main.c,v 1.52 2005/02/10 14:25:08 itojun Exp $ */
+/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1983, 1988, 1993
+ * 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef lint
+char copyright[] =
+"@(#) Copyright (c) 1983, 1988, 1993\n\
+ Regents of the University of California. All rights reserved.\n";
+#endif /* not lint */
+
+#ifdef INHERITED_CODE
+#ifndef lint
+#if 0
+static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94";
+#else
+static char *rcsid = "$OpenBSD: main.c,v 1.52 2005/02/10 14:25:08 itojun Exp $";
+#endif
+#endif /* not lint */
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/utilities.h>
+
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#include "main.h"
+#include "netstat.h"
+
+#if HAVE_WINSOCK_H
+#include "winstub.h"
+#endif
+
+int Aflag; /* show addresses of protocol control block */
+int aflag; /* show all sockets (including servers) */
+int bflag; /* show bytes instead of packets */
+int dflag; /* show i/f dropped packets */
+int gflag; /* show group (multicast) routing or stats */
+int iflag; /* show interfaces */
+int lflag; /* show routing table with use and ref */
+int mflag; /* show memory stats */
+int nflag; /* show addresses numerically */
+int oflag; /* Open/Net-BSD style octet output */
+int pflag; /* show given protocol */
+int qflag; /* only display non-zero values for output */
+int rflag; /* show routing tables (or routing stats) */
+int Sflag; /* show source address in routing table */
+int sflag; /* show protocol statistics */
+int tflag; /* show i/f watchdog timers */
+int vflag; /* be verbose */
+
+
+int interval; /* repeat interval for i/f stats */
+char *intrface; /* desired i/f for stats, or NULL for all i/fs */
+int af; /* address family */
+int max_getbulk = 32; /* specifies the max-repeaters value to use with GETBULK requests */
+
+char *progname = NULL;
+
+ /*
+ * struct nlist nl[] - Omitted
+ */
+
+typedef void (stringfun)(const char*);
+
+struct protox {
+ /* pr_index/pr_sindex - Omitted */
+ int pr_wanted; /* 1 if wanted, 0 otherwise */
+ stringfun *pr_cblocks; /* control blocks printing routine */
+ stringfun *pr_stats; /* statistics printing routine */
+ const char *pr_name; /* well-known name */
+} protox[] = {
+ { 1, tcpprotopr, tcp_stats, "tcp" },
+ { 1, udpprotopr, udp_stats, "udp" },
+
+ { 1, (stringfun*)0, ip_stats, "ip" }, /* protopr Omitted */
+ { 1, (stringfun*)0, icmp_stats, "icmp" },
+ /* igmp/ah/esp/ipencap/etherip/ipcomp/carp/pfsync/pim - Omitted */
+ { 0, (stringfun*)0, (stringfun*)0, NULL }
+};
+
+struct protox ip6protox[] = {
+ { 1, tcp6protopr, (stringfun*)0, "tcp6" },
+ { 1, udp6protopr, (stringfun*)0, "udp6" },
+
+ { 1, (stringfun*)0, ip6_stats, "ip6" },/* ip6protopr Omitted */
+ { 1, (stringfun*)0, icmp6_stats, "icmp6" },
+ /* pim6/rip6 - Omitted */
+ { 0, (stringfun*)0, (stringfun*)0, NULL }
+};
+
+ /* {ipx,ns,atalk}protox Omitted */
+
+struct protox *protoprotox[] = {
+ protox, ip6protox, NULL
+};
+
+static void printproto(struct protox *, const char *);
+static void usage(void);
+static struct protox *name2protox(const char *);
+static struct protox *knownname(const char *);
+
+netsnmp_session *ss;
+struct protox *tp = NULL; /* for printing cblocks & stats */
+
+static void
+optProc( int argc, char *const *argv, int opt )
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ /* case 'A': *BSD: display PCB addresses
+ Linux: protocol family
+ Aflag = 1;
+ break;
+ */
+ case 'a':
+ aflag = 1;
+ break;
+ case 'b':
+ bflag = 1;
+ break;
+ case 'd':
+ dflag = 1;
+ break;
+ case 'f':
+ if (!*optarg)
+ optarg = argv[optind++];
+ if (strcmp(optarg, "inet") == 0)
+ af = AF_INET;
+ else if (strcmp(optarg, "inet6") == 0)
+ af = AF_INET6;
+ /*
+ else if (strcmp(optarg, "local") == 0)
+ af = AF_LOCAL;
+ else if (strcmp(optarg, "unix") == 0)
+ af = AF_UNIX;
+ else if (strcmp(optarg, "ipx") == 0)
+ af = AF_IPX;
+ else if (strcmp(optarg, "ns") == 0)
+ af = AF_NS;
+ else if (strcmp(optarg, "encap") == 0)
+ af = PF_KEY;
+ else if (strcmp(optarg, "atalk") == 0)
+ af = AF_APPLETALK;
+ */
+ else {
+ (void)fprintf(stderr,
+ "%s: %s: unknown address family\n",
+ progname, optarg);
+ exit(1);
+ }
+ return;
+ case 'g':
+ gflag = 1;
+ break;
+ case 'I':
+ iflag = 1;
+ if (!*optarg)
+ optarg = argv[optind++];
+ intrface = optarg;
+ return;
+ case 'i':
+ iflag = 1;
+ break;
+ /* case 'L': FreeBSD: Display listen queue lengths
+ NetBSD: Suppress link-level routes */
+ /* case 'l': OpenBSD: Wider IPv6 display
+ Linux: Listening sockets only
+ lflag = 1;
+ break;
+ case 'M': *BSD: Memory image
+ Linux: Masqueraded connections
+ memf = optarg;
+ break;
+ */
+ case 'm':
+ mflag = 1;
+ break;
+ /* case 'N': *BSD: Kernel image
+ nlistf = optarg;
+ break;
+ */
+ case 'n':
+ nflag = 1;
+ break;
+ case 'o':
+ oflag = 1;
+ break;
+ /* case 'P': NetBSD:
+ OpenBSD: dump PCB block */
+ case 'p':
+ if (!*optarg)
+ optarg = argv[optind++];
+ if ((tp = name2protox(optarg)) == NULL) {
+ (void)fprintf(stderr,
+ "%s: %s: unknown protocol\n",
+ progname, optarg);
+ exit(1);
+ }
+ pflag = 1;
+ return;
+ /* case 'q': NetBSD: IRQ information
+ OpenBSD: Suppress inactive I/Fs
+ qflag = 1;
+ break;
+ */
+ case 'r':
+ rflag = 1;
+ break;
+ case 'R':
+ if (optind < argc) {
+ if (argv[optind]) {
+ max_getbulk = atoi(argv[optind]);
+ if (max_getbulk == 0) {
+ usage();
+ fprintf(stderr, "Bad -CR option: %s\n",
+ argv[optind]);
+ exit(1);
+ }
+ }
+ } else {
+ usage();
+ fprintf(stderr, "Bad -CR option: no argument given\n");
+ exit(1);
+ }
+ optind++;
+ break;
+ case 'S': /* FreeBSD:
+ NetBSD: Semi-numeric display
+ OpenBSD: Show route source selector */
+ Sflag = 1;
+ break;
+ case 's':
+ ++sflag;
+ break;
+ /* case 't': FreeBSD:
+ OpenBSD: Display watchdog timers
+ tflag = 1;
+ break;
+ case 'u': OpenBSD: unix sockets only
+ af = AF_UNIX;
+ break;
+ */
+ case 'v':
+ vflag = 1;
+ break;
+ case 'w':
+ if (!*optarg)
+ optarg = argv[optind++];
+ interval = atoi(optarg);
+ iflag = 1;
+ return;
+ case '?':
+ default:
+ usage();
+ }
+ }
+ break; /* End of '-Cx' switch */
+
+ /*
+ * Backward compatability for the main display modes
+ * (where this doesn't clash with standard SNMP flags)
+ */
+ case 'i':
+ iflag = 1;
+ break;
+ case 'R':
+ rflag = 1; /* -r sets the retry count */
+ break;
+ case 's':
+ ++sflag;
+ break;
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session;
+ struct protoent *p;
+ char *cp;
+
+ af = AF_UNSPEC;
+ cp = strrchr( argv[0], '/' );
+ if (cp)
+ progname = cp+1;
+ else
+ progname = argv[0];
+
+ switch (snmp_parse_args( argc, argv, &session, "C:iRs", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ /*
+ * Check argc vs optind ??
+ */
+ argv += optind;
+ argc -= optind;
+
+ /*
+ * Open an SNMP session.
+ */
+ SOCK_STARTUP;
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpnetstat", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ /*
+ * Omitted:
+ * Privilege handling
+ * "Backward Compatibility"
+ * Kernel namelis handling
+ */
+
+ if (mflag) {
+ /*
+ mbpr(nl[N_MBSTAT].n_value, nl[N_MBPOOL].n_value,
+ nl[N_MCLPOOL].n_value);
+ */
+ exit(0);
+ }
+ if (pflag) {
+ printproto(tp, tp->pr_name);
+ exit(0);
+ }
+ /*
+ * Keep file descriptors open to avoid overhead
+ * of open/close on each call to get* routines.
+ */
+ sethostent(1);
+ setnetent(1);
+ if (iflag) {
+ intpr(interval);
+ exit(0);
+ }
+ if (rflag) {
+ /*
+ if (sflag)
+ rt_stats();
+ else
+ */
+ routepr();
+ exit(0);
+ }
+ /*
+ if (gflag) {
+ if (sflag) {
+ if (af == AF_INET || af == AF_UNSPEC)
+ mrt_stats(nl[N_MRTPROTO].n_value,
+ nl[N_MRTSTAT].n_value);
+#ifdef NETSNMP_ENABLE_IPV6
+ if (af == AF_INET6 || af == AF_UNSPEC)
+ mrt6_stats(nl[N_MRT6PROTO].n_value,
+ nl[N_MRT6STAT].n_value);
+#endif
+ }
+ else {
+ if (af == AF_INET || af == AF_UNSPEC)
+ mroutepr(nl[N_MRTPROTO].n_value,
+ nl[N_MFCHASHTBL].n_value,
+ nl[N_MFCHASH].n_value,
+ nl[N_VIFTABLE].n_value);
+#ifdef NETSNMP_ENABLE_IPV6
+ if (af == AF_INET6 || af == AF_UNSPEC)
+ mroute6pr(nl[N_MRT6PROTO].n_value,
+ nl[N_MF6CTABLE].n_value,
+ nl[N_MIF6TABLE].n_value);
+#endif
+ }
+ exit(0);
+ }
+ */
+ if (af == AF_INET || af == AF_UNSPEC) {
+ setprotoent(1);
+ setservent(1);
+ /* ugh, this is O(MN) ... why do we do this? */
+ while ((p = getprotoent())) {
+ for (tp = protox; tp->pr_name; tp++)
+ if (strcmp(tp->pr_name, p->p_name) == 0)
+ break;
+ if (tp->pr_name == NULL || tp->pr_wanted == 0)
+ continue;
+ printproto(tp, p->p_name);
+ }
+ endprotoent();
+ }
+ if (af == AF_INET6 || af == AF_UNSPEC)
+ for (tp = ip6protox; tp->pr_name; tp++)
+ printproto(tp, tp->pr_name);
+ /*
+ if (af == AF_IPX || af == AF_UNSPEC)
+ for (tp = ipxprotox; tp->pr_name; tp++)
+ printproto(tp, tp->pr_name);
+ if (af == AF_NS || af == AF_UNSPEC)
+ for (tp = nsprotox; tp->pr_name; tp++)
+ printproto(tp, tp->pr_name);
+ if ((af == AF_UNIX || af == AF_UNSPEC) && !sflag)
+ unixpr(nl[N_UNIXSW].n_value);
+ if (af == AF_APPLETALK || af == AF_UNSPEC)
+ for (tp = atalkprotox; tp->pr_name; tp++)
+ printproto(tp, tp->pr_name);
+ */
+ exit(0);
+}
+
+/*
+ * Print out protocol statistics or control blocks (per sflag).
+ * Namelist checks - Omitted
+ */
+static void
+printproto(struct protox *tp, const char *name)
+{
+ void (*pr)(const char *);
+
+ if (sflag) {
+ pr = tp->pr_stats;
+ } else {
+ pr = tp->pr_cblocks;
+ }
+ if (pr != NULL)
+ (*pr)(name);
+}
+
+/*
+ * Read kernel memory - Omitted
+ */
+
+const char *
+plural(int n)
+{
+ return (n != 1 ? "s" : "");
+}
+
+/*
+ * Find the protox for the given "well-known" name.
+ */
+static struct protox *
+knownname(const char *name)
+{
+ struct protox **tpp, *tp;
+
+ for (tpp = protoprotox; *tpp; tpp++)
+ for (tp = *tpp; tp->pr_name; tp++)
+ if (strcmp(tp->pr_name, name) == 0)
+ return (tp);
+ return (NULL);
+}
+
+/*
+ * Find the protox corresponding to name.
+ */
+static struct protox *
+name2protox(const char *name)
+{
+ struct protox *tp;
+ char **alias; /* alias from p->aliases */
+ struct protoent *p;
+
+ /*
+ * Try to find the name in the list of "well-known" names. If that
+ * fails, check if name is an alias for an Internet protocol.
+ */
+ if ((tp = knownname(name)))
+ return (tp);
+
+ setprotoent(1); /* make protocol lookup cheaper */
+ while ((p = getprotoent())) {
+ /* netsnmp_assert: name not same as p->name */
+ for (alias = p->p_aliases; *alias; alias++)
+ if (strcmp(name, *alias) == 0) {
+ endprotoent();
+ return (knownname(p->p_name));
+ }
+ }
+ endprotoent();
+ return (NULL);
+}
+
+static void
+usage(void)
+{
+ (void)fprintf(stderr,
+"usage: %s [snmp_opts] [-Can] [-Cf address_family]\n", progname);
+ (void)fprintf(stderr,
+" %s [snmp_opts] [-CbdgimnrSs] [-Cf address_family]\n", progname);
+ (void)fprintf(stderr,
+" %s [snmp_opts] [-Cbdn] [-CI interface] [-Cw wait]\n", progname);
+ (void)fprintf(stderr,
+" %s [snmp_opts] [-Cs] [-Cp protocol]\n", progname);
+ (void)fprintf(stderr,
+" %s [snmp_opts] [-Ca] [-Cf address_family] [-Ci | -CI interface]\n", progname);
+ exit(1);
+}
diff --git a/apps/snmpnetstat/main.h b/apps/snmpnetstat/main.h
new file mode 100644
index 0000000..1272321
--- /dev/null
+++ b/apps/snmpnetstat/main.h
@@ -0,0 +1,23 @@
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64
+#endif
+
+extern netsnmp_session *ss;
+NETSNMP_IMPORT
+int netsnmp_query_get( netsnmp_variable_list *list,
+ netsnmp_session *session);
+NETSNMP_IMPORT
+int netsnmp_query_getnext(netsnmp_variable_list *list,
+ netsnmp_session *session);
+NETSNMP_IMPORT
+int netsnmp_query_walk( netsnmp_variable_list *list,
+ netsnmp_session *session);
+
+#ifndef AF_INET6
+#define AF_INET6 10
+#endif
+
+#ifndef NI_MAXHOST
+#define NI_MAXHOST 1025
+#endif
diff --git a/apps/snmpnetstat/netstat.h b/apps/snmpnetstat/netstat.h
new file mode 100644
index 0000000..2841bf2
--- /dev/null
+++ b/apps/snmpnetstat/netstat.h
@@ -0,0 +1,94 @@
+/* $OpenBSD: netstat.h,v 1.31 2005/02/10 14:25:08 itojun Exp $ */
+/* $NetBSD: netstat.h,v 1.6 1996/05/07 02:55:05 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1992, 1993
+ * 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)netstat.h 8.2 (Berkeley) 1/4/94
+ */
+
+#ifdef HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* What is the max length of a pointer printed with %p (including 0x)? */
+#define PLEN (LONG_BIT / 4 + 2)
+
+extern int Aflag; /* show addresses of protocol control block */
+extern int aflag; /* show all sockets (including servers) */
+extern int bflag; /* show bytes instead of packets */
+extern int dflag; /* show i/f dropped packets */
+extern int gflag; /* show group (multicast) routing or stats */
+extern int iflag; /* show interfaces */
+extern int lflag; /* show routing table with use and ref */
+extern int mflag; /* show memory stats */
+extern int nflag; /* show addresses numerically */
+extern int oflag; /* Open/Net-BSD style octet output */
+extern int pflag; /* show given protocol */
+extern int qflag; /* only display non-zero values for output */
+extern int rflag; /* show routing tables (or routing stats) */
+extern int Sflag; /* show source address in routing table */
+extern int sflag; /* show protocol statistics */
+extern int tflag; /* show i/f watchdog timers */
+extern int vflag; /* be verbose */
+
+extern int interval; /* repeat interval for i/f stats */
+
+extern char *intrface; /* desired i/f for stats, or NULL for all i/fs */
+
+extern int af; /* address family */
+extern int max_getbulk; /* specifies the max-repeaters value to use with GETBULK requests */
+
+extern char *__progname; /* program name, from crt0.o */
+
+const char *plural(int);
+
+void tcpprotopr(const char *);
+void udpprotopr(const char *);
+void tcp_stats( const char *);
+void udp_stats( const char *);
+void ip_stats( const char *);
+void icmp_stats(const char *);
+
+void tcp6protopr(const char *);
+void udp6protopr(const char *);
+void ip6_stats( const char *);
+void icmp6_stats(const char *);
+
+void pr_rthdr(int);
+void pr_encaphdr(void);
+void pr_family(int);
+void rt_stats(void);
+
+char *routename(in_addr_t);
+char *netname(in_addr_t, in_addr_t);
+char *ns_print(struct sockaddr *);
+void routepr(void);
+
+void intpr(int);
+
diff --git a/apps/snmpnetstat/route.c b/apps/snmpnetstat/route.c
new file mode 100644
index 0000000..e5526dc
--- /dev/null
+++ b/apps/snmpnetstat/route.c
@@ -0,0 +1,487 @@
+/* $OpenBSD: route.c,v 1.66 2004/11/17 01:47:20 itojun Exp $ */
+/* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1983, 1988, 1993
+ * 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef INHERITED_CODE
+#ifndef lint
+#if 0
+static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
+#else
+static char *rcsid = "$OpenBSD: route.c,v 1.66 2004/11/17 01:47:20 itojun Exp $";
+#endif
+#endif /* not lint */
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifndef INET
+#define INET
+#endif
+
+#include "main.h"
+#include "netstat.h"
+#if HAVE_WINSOCK_H
+#include "winstub.h"
+#endif
+
+#define SET_MASK 0x01
+#define SET_GWAY 0x02
+#define SET_IFNO 0x04
+#define SET_TYPE 0x08
+#define SET_PRTO 0x10
+#define SET_ALL 0x1f
+
+struct route_entry {
+ oid instance[4];
+ in_addr_t destination;
+ in_addr_t mask;
+ in_addr_t gateway;
+ int ifNumber;
+ int type;
+ int proto;
+ int set_bits;
+ char ifname[64];
+};
+
+void p_rtnode( struct route_entry *rp );
+extern int _ffs(int mask);
+
+/*
+ * Print routing tables.
+ */
+void
+routepr(void)
+{
+ struct route_entry route, *rp = &route;
+ oid rtcol_oid[] = { 1,3,6,1,2,1,4,21,1,0 };
+ size_t rtcol_len = OID_LENGTH( rtcol_oid );
+ union {
+ in_addr_t addr;
+ char data[4];
+ } tmpAddr;
+ netsnmp_variable_list *var=NULL, *vp;
+ char *cp;
+
+ printf("Routing tables\n");
+ pr_rthdr(AF_INET);
+
+#define ADD_RTVAR( x ) rtcol_oid[ rtcol_len-1 ] = x; \
+ snmp_varlist_add_variable( &var, rtcol_oid, rtcol_len, ASN_NULL, NULL, 0)
+ ADD_RTVAR( 2 ); /* ipRouteIfIndex */
+ ADD_RTVAR( 7 ); /* ipRouteNextHop */
+ ADD_RTVAR( 8 ); /* ipRouteType */
+ ADD_RTVAR( 9 ); /* ipRouteProto */
+ ADD_RTVAR( 11 ); /* ipRouteMask */
+#undef ADD_RTVAR
+
+ /*
+ * Now walk the ipRouteTable, reporting the various route entries
+ */
+ while ( 1 ) {
+ if (netsnmp_query_getnext( var, ss ) != SNMP_ERR_NOERROR)
+ break;
+ rtcol_oid[ rtcol_len-1 ] = 2; /* ifRouteIfIndex */
+ if ( snmp_oid_compare( rtcol_oid, rtcol_len,
+ var->name, rtcol_len) != 0 )
+ break; /* End of Table */
+ memset( &route, 0, sizeof( struct route_entry ));
+ /* Extract ipRouteDest index value */
+ cp = tmpAddr.data;
+ cp[0] = var->name[ 10 ] & 0xff;
+ cp[1] = var->name[ 11 ] & 0xff;
+ cp[2] = var->name[ 12 ] & 0xff;
+ cp[3] = var->name[ 13 ] & 0xff;
+ rp->destination = tmpAddr.addr;
+
+ for ( vp=var; vp; vp=vp->next_variable ) {
+ switch ( vp->name[ 9 ] ) {
+ case 2: /* ifRouteIfIndex */
+ rp->ifNumber = *vp->val.integer;
+ rp->set_bits |= SET_IFNO;
+ break;
+ case 7: /* ipRouteNextHop */
+ memmove(&rp->gateway, vp->val.string, 4);
+ rp->set_bits |= SET_GWAY;
+ break;
+ case 8: /* ipRouteType */
+ rp->type = *vp->val.integer;
+ rp->set_bits |= SET_TYPE;
+ break;
+ case 9: /* ipRouteProto */
+ rp->proto = *vp->val.integer;
+ rp->set_bits |= SET_PRTO;
+ break;
+ case 11: /* ipRouteMask */
+ memmove(&rp->mask, vp->val.string, 4);
+ rp->set_bits |= SET_MASK;
+ break;
+ }
+ }
+ if (rp->set_bits != SET_ALL) {
+ continue; /* Incomplete query */
+ }
+
+ p_rtnode( rp );
+ }
+}
+
+
+
+struct iflist {
+ int index;
+ char name[64];
+ struct iflist *next;
+} *Iflist = NULL;
+
+void
+get_ifname(char *name, int ifIndex)
+{
+ oid ifdescr_oid[] = { 1,3,6,1,2,1,2,2,1,2,0 };
+ size_t ifdescr_len = OID_LENGTH( ifdescr_oid );
+ netsnmp_variable_list *var = NULL;
+ struct iflist *ip;
+
+ for (ip = Iflist; ip; ip = ip->next) {
+ if (ip->index == ifIndex)
+ break;
+ }
+ if (ip) {
+ strcpy(name, ip->name);
+ return;
+ }
+ ip = (struct iflist *) malloc(sizeof(struct iflist));
+ if (ip == NULL)
+ return;
+ ip->next = Iflist;
+ Iflist = ip;
+ ip->index = ifIndex;
+
+ ifdescr_oid[ ifdescr_len-1 ] = ifIndex;
+ snmp_varlist_add_variable( &var, ifdescr_oid, ifdescr_len,
+ ASN_NULL, NULL, 0);
+ if (netsnmp_query_get( var, ss ) == SNMP_ERR_NOERROR) {
+ if (var->val_len >= sizeof(ip->name))
+ var->val_len = sizeof(ip->name) - 1;
+ memmove(ip->name, var->val.string, var->val_len);
+ ip->name[var->val_len] = '\0';
+ } else {
+ sprintf(ip->name, "if%d", ifIndex);
+ }
+ strcpy(name, ip->name);
+}
+
+/* column widths; each followed by one space */
+#ifndef NETSNMP_ENABLE_IPV6
+#define WID_DST(af) 26 /* width of destination column */
+#define WID_GW(af) 18 /* width of gateway column */
+#else
+/* width of destination/gateway column */
+#if 1
+/* strlen("fe80::aaaa:bbbb:cccc:dddd@gif0") == 30, strlen("/128") == 4 */
+#define WID_DST(af) ((af) == AF_INET6 ? (nflag ? 34 : 26) : 26)
+#define WID_GW(af) ((af) == AF_INET6 ? (nflag ? 30 : 18) : 18)
+#else
+/* strlen("fe80::aaaa:bbbb:cccc:dddd") == 25, strlen("/128") == 4 */
+#define WID_DST(af) ((af) == AF_INET6 ? (nflag ? 29 : 18) : 18)
+#define WID_GW(af) ((af) == AF_INET6 ? (nflag ? 25 : 18) : 18)
+#endif
+#endif /* NETSNMP_ENABLE_IPV6 */
+
+/*
+ * Print header for routing table columns.
+ */
+void
+pr_rthdr(int af)
+{
+ /*
+ if (Aflag)
+ printf("%-*.*s ", PLEN, PLEN, "Address");
+ if (Sflag)
+ printf("%-*.*s ",
+ WID_DST(af), WID_DST(af), "Source");
+ */
+ printf("%-*.*s ",
+ WID_DST(af), WID_DST(af), "Destination");
+ printf("%-*.*s %-6.6s %s\n",
+ WID_GW(af), WID_GW(af), "Gateway",
+ "Flags", "Interface");
+}
+
+/*
+ * Print header for PF_KEY entries.
+void
+pr_encaphdr(void)
+{
+ if (Aflag)
+ printf("%-*s ", PLEN, "Address");
+ printf("%-18s %-5s %-18s %-5s %-5s %-22s\n",
+ "Source", "Port", "Destination",
+ "Port", "Proto", "SA(Address/Proto/Type/Direction)");
+}
+ */
+
+char *
+routename(in_addr_t in)
+{
+ char *cp;
+ static char line[MAXHOSTNAMELEN];
+ struct hostent *hp;
+ static char domain[MAXHOSTNAMELEN];
+ static int first = 1;
+
+ if (first) {
+ first = 0;
+ if (gethostname(domain, sizeof domain) == 0 &&
+ (cp = strchr(domain, '.')))
+ (void) strlcpy(domain, cp + 1, sizeof domain);
+ else
+ domain[0] = '\0';
+ }
+ cp = NULL;
+ if (!nflag) {
+ hp = netsnmp_gethostbyaddr((char *)&in, sizeof (struct in_addr),
+ AF_INET);
+ if (hp) {
+ if ((cp = strchr(hp->h_name, '.')) &&
+ !strcmp(cp + 1, domain))
+ *cp = '\0';
+ cp = hp->h_name;
+ }
+ }
+ if (cp) {
+ strlcpy(line, cp, sizeof(line));
+ } else {
+#define C(x) (unsigned)((x) & 0xff)
+ in = ntohl(in);
+ snprintf(line, sizeof line, "%u.%u.%u.%u",
+ C(in >> 24), C(in >> 16), C(in >> 8), C(in));
+ }
+ return (line);
+}
+
+/*
+ * Return the name of the network whose address is given.
+ * The address is assumed to be that of a net or subnet, not a host.
+ */
+char *
+netname(in_addr_t in, in_addr_t mask)
+{
+ char *cp = NULL;
+ static char line[MAXHOSTNAMELEN];
+ struct netent *np = NULL;
+ int mbits;
+
+ in = ntohl(in);
+ mask = ntohl(mask);
+ if (!nflag && in != INADDR_ANY) {
+ if ((np = getnetbyaddr(in, AF_INET)) != NULL)
+ cp = np->n_name;
+ }
+ mbits = mask ? 33 - _ffs(mask) : 0;
+ if (cp) {
+ strlcpy(line, cp, sizeof(line));
+ } else if (mbits < 9)
+ snprintf(line, sizeof line, "%u/%d", C(in >> 24), mbits);
+ else if (mbits < 17)
+ snprintf(line, sizeof line, "%u.%u/%d",
+ C(in >> 24) , C(in >> 16), mbits);
+ else if (mbits < 25)
+ snprintf(line, sizeof line, "%u.%u.%u/%d",
+ C(in >> 24), C(in >> 16), C(in >> 8), mbits);
+ else
+ snprintf(line, sizeof line, "%u.%u.%u.%u/%d", C(in >> 24),
+ C(in >> 16), C(in >> 8), C(in), mbits);
+ return (line);
+}
+
+#undef NETSNMP_ENABLE_IPV6
+#ifdef NETSNMP_ENABLE_IPV6
+char *
+netname6(struct sockaddr_in6 *sa6, struct in6_addr *mask)
+{
+ static char line[MAXHOSTNAMELEN + 1];
+ struct sockaddr_in6 sin6;
+ u_char *p;
+ u_char *lim;
+ int masklen, final = 0, illegal = 0;
+ int i;
+ char hbuf[NI_MAXHOST];
+ int flag = 0;
+ int error;
+
+ sin6 = *sa6;
+
+ masklen = 0;
+ lim = (u_char *)(mask + 1);
+ i = 0;
+ if (mask) {
+ for (p = (u_char *)mask; p < lim; p++) {
+ if (final && *p) {
+ illegal++;
+ sin6.sin6_addr.s6_addr[i++] = 0x00;
+ continue;
+ }
+
+ switch (*p & 0xff) {
+ case 0xff:
+ masklen += 8;
+ break;
+ case 0xfe:
+ masklen += 7;
+ final++;
+ break;
+ case 0xfc:
+ masklen += 6;
+ final++;
+ break;
+ case 0xf8:
+ masklen += 5;
+ final++;
+ break;
+ case 0xf0:
+ masklen += 4;
+ final++;
+ break;
+ case 0xe0:
+ masklen += 3;
+ final++;
+ break;
+ case 0xc0:
+ masklen += 2;
+ final++;
+ break;
+ case 0x80:
+ masklen += 1;
+ final++;
+ break;
+ case 0x00:
+ final++;
+ break;
+ default:
+ final++;
+ illegal++;
+ break;
+ }
+
+ if (!illegal)
+ sin6.sin6_addr.s6_addr[i++] &= *p;
+ else
+ sin6.sin6_addr.s6_addr[i++] = 0x00;
+ }
+ } else
+ masklen = 128;
+
+ if (masklen == 0 && IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr))
+ return("default");
+
+ if (illegal)
+ fprintf(stderr, "illegal prefixlen\n");
+
+ if (nflag)
+ flag |= NI_NUMERICHOST;
+ error = getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len,
+ hbuf, sizeof(hbuf), NULL, 0, flag);
+ if (error)
+ snprintf(hbuf, sizeof(hbuf), "invalid");
+
+ snprintf(line, sizeof(line), "%s/%d", hbuf, masklen);
+ return line;
+}
+
+char *
+routename6(struct sockaddr_in6 *sa6)
+{
+ static char line[NI_MAXHOST];
+ const int niflag = NI_NUMERICHOST;
+
+ if (getnameinfo((struct sockaddr *)sa6, sa6->sin6_len,
+ line, sizeof(line), NULL, 0, niflag) != 0)
+ strlcpy(line, "", sizeof line);
+ return line;
+}
+#endif /*NETSNMP_ENABLE_IPV6*/
+
+char *
+s_rtflags( struct route_entry *rp )
+{
+ static char flag_buf[10];
+ char *cp = flag_buf;
+
+ memset( flag_buf, 0, sizeof(flag_buf));
+ *cp++ = '<';
+ *cp++ = 'U'; /* route is in use */
+ if (rp->mask == 0xffffffff)
+ *cp++ = 'H'; /* host */
+ if (rp->proto == 4)
+ *cp++ = 'D'; /* ICMP redirect */
+ if (rp->type == 4)
+ *cp++ = 'G'; /* remote destination/net */
+ *cp++ = '>';
+ return flag_buf;
+}
+
+void
+p_rtnode( struct route_entry *rp )
+{
+ get_ifname(rp->ifname, rp->ifNumber);
+ printf("%-*.*s ",
+ WID_DST(AF_INET), WID_DST(AF_INET),
+ (rp->destination == INADDR_ANY) ? "default" :
+ (rp->set_bits & SET_MASK) ?
+ (rp->mask == 0xffffffff ?
+ routename(rp->destination) :
+ netname(rp->destination, rp->mask)) :
+ netname(rp->destination, 0L));
+ printf("%-*.*s %-6.6s %s\n",
+ WID_GW(af), WID_GW(af),
+ rp->gateway ? routename(rp->gateway) : "*",
+ s_rtflags(rp), rp->ifname);
+}
diff --git a/apps/snmpnetstat/winstub.c b/apps/snmpnetstat/winstub.c
new file mode 100644
index 0000000..5e2dd64
--- /dev/null
+++ b/apps/snmpnetstat/winstub.c
@@ -0,0 +1,285 @@
+/*
+ * cheap and dirty network database lookup functions
+ */
+/*
+ * uses local files only
+ */
+/*
+ * currently searches the protocols only
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#if (defined(WIN32) || defined(cygwin) || defined(aix4))
+
+#ifdef aix4
+#define _NO_PROTO /* Hack, you say ? */
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+static int h_stay_open, s_stay_open, p_stay_open, n_stay_open;
+static FILE *h_fp, *s_fp, *p_fp, *n_fp;
+static char *p_fn;
+#ifdef notused
+static char *h_fn, *s_fn, *n_fn;
+#endif
+
+#ifdef aix4
+#define ROOT_BASE "/etc/"
+#define PROT_FN "protocols"
+#else
+#define ROOT_BASE "\\SYSTEM32\\DRIVERS\\ETC\\"
+#define PROT_FN "protocol"
+#endif
+#define HOST_FN "hosts"
+#define SERV_FN "services"
+#define NETW_FN "networks"
+
+static int pre_env_done = 0;
+static void
+pre_env(void)
+{
+ const char *cproot;
+ const char *cp = "";
+
+ if (pre_env_done)
+ return;
+ pre_env_done = 1;
+
+#ifndef aix4
+ cp = getenv("SYSTEMROOT");
+ if (cp) {
+ ;
+ /*
+ * printf ("Root is '%s'\n", cp);
+ */
+ } else
+ cp = "C:\\WINNT";
+#endif
+
+ cproot = ROOT_BASE;
+ p_fn =
+ (char *) malloc(3 + strlen(cp) + strlen(cproot) + strlen(PROT_FN));
+ if (p_fn)
+ sprintf(p_fn, "%s%s%s", cp, cproot, PROT_FN);
+#ifdef notused
+ h_fn =
+ (char *) malloc(3 + strlen(cp) + strlen(cproot) + strlen(HOST_FN));
+ if (h_fn)
+ sprintf(h_fn, "%s%s%s", cp, cproot, HOST_FN);
+ s_fn =
+ (char *) malloc(3 + strlen(cp) + strlen(cproot) + strlen(SERV_FN));
+ if (s_fn)
+ sprintf(s_fn, "%s%s%s", cp, cproot, SERV_FN);
+ n_fn =
+ (char *) malloc(3 + strlen(cp) + strlen(cproot) + strlen(NETW_FN));
+ if (n_fn)
+ sprintf(n_fn, "%s%s%s", cp, cproot, NETW_FN);
+#endif
+}
+
+/*
+ * sets can open. ends must close.
+ */
+void
+endhostent(void)
+{
+ if (h_fp)
+ fclose(h_fp);
+ h_fp = 0;
+}
+
+void
+endservent(void)
+{
+ if (s_fp)
+ fclose(s_fp);
+ s_fp = 0;
+}
+
+void
+endprotoent(void)
+{
+ if (p_fp)
+ fclose(p_fp);
+ p_fp = 0;
+}
+
+void
+endnetent(void)
+{
+ if (n_fp)
+ fclose(n_fp);
+ n_fp = 0;
+}
+
+void
+sethostent(int stay_open)
+{
+ pre_env();
+ endhostent();
+ h_stay_open = stay_open;
+}
+
+void
+setservent(int stay_open)
+{
+ pre_env();
+ endservent();
+ s_stay_open = stay_open;
+}
+
+void
+setprotoent(int stay_open)
+{
+ pre_env();
+ endprotoent();
+ p_stay_open = stay_open;
+}
+
+void
+setnetent(int stay_open)
+{
+ pre_env();
+ endnetent();
+ n_stay_open = stay_open;
+}
+
+#define STRTOK_DELIMS " \t\n"
+
+/*
+ * get next entry from data base file, or from NIS if possible.
+ */
+/*
+ * returns 0 if there are no more entries to read.
+ */
+struct hostent *
+gethostent(void)
+{
+ return 0;
+}
+struct servent *
+getservent(void)
+{
+ return 0;
+}
+
+struct protoent *
+getprotoent(void)
+{
+ char *cp, **alp, lbuf[256];
+ static struct protoent spx;
+ static char *ali[10];
+ struct protoent *px = &spx;
+ int linecnt = 0;
+ char *st;
+
+ for (alp = ali; *alp; free(*alp), *alp = 0, alp++);
+ if (px->p_name)
+ free(px->p_name);
+ px->p_aliases = ali;
+
+ if (!p_fn)
+ return 0;
+ if (!p_fp)
+ p_fp = fopen(p_fn, "r");
+
+ if (!p_fp)
+ return 0;
+ while (fgets(lbuf, sizeof(lbuf), p_fp)) {
+ linecnt++;
+ cp = lbuf;
+ if (*cp == '#')
+ continue;
+
+ cp = strtok_r(lbuf, STRTOK_DELIMS, &st);
+ if (!cp)
+ continue;
+ if (cp)
+ px->p_name = strdup(cp);
+
+ cp = strtok_r(NULL, STRTOK_DELIMS, &st);
+ if (!cp) {
+ free(px->p_name);
+ continue;
+ }
+ px->p_proto = (short) atoi(cp);
+
+ for (alp = px->p_aliases; cp; alp++) {
+ cp = strtok_r(NULL, STRTOK_DELIMS, &st);
+ if (!cp)
+ break;
+ if (*cp == '#')
+ break;
+ *alp = strdup(cp);
+ }
+
+ return (px);
+ }
+
+ return 0;
+}
+struct netent *
+getnetent(void)
+{
+ return 0;
+}
+
+struct netent *
+getnetbyaddr(long net, int type)
+{
+ return 0;
+}
+
+/*
+ * Return the network number from an internet address
+ */
+u_long
+inet_netof(struct in_addr in)
+{
+ register u_long i = ntohl(in.s_addr);
+ u_long ii = (i >> 24) & 0xff;
+ if (0 == (ii & 0x80))
+ return ((0xff000000 & i) >> 24);
+ if (0x80 == (ii & 0xc0))
+ return ((0xffff0000 & i) >> 16);
+ /*
+ * if (0xc0 == (ii & 0xe0))
+ */
+ return ((0xffffff00 & i) >> 8);
+}
+
+/*
+ * Return the host number from an internet address
+ */
+u_long
+inet_lnaof(struct in_addr in)
+{
+ register u_long i = ntohl(in.s_addr);
+ u_long ii = (i >> 24) & 0xff;
+ if (0 == (ii & 0x80))
+ return (0x00ffffff & i);
+ if (0x80 == (ii & 0xc0))
+ return (0x0000ffff & i);
+ /*
+ * if (0xc0 == (ii & 0xe0))
+ */
+ return (0x000000ff & i);
+}
+
+#endif /* WIN32 or cygwin */
diff --git a/apps/snmpnetstat/winstub.h b/apps/snmpnetstat/winstub.h
new file mode 100644
index 0000000..8fc51dd
--- /dev/null
+++ b/apps/snmpnetstat/winstub.h
@@ -0,0 +1,50 @@
+
+#ifndef _WINSTUB_H_
+#define _WINSTUB_H_
+
+#include <net-snmp/types.h>
+
+#if (defined(WIN32) || defined(cygwin))
+
+/*
+ * database access functions for host, services, protocols, networks
+ */
+
+/*
+ * sets can open. ends must close.
+ */
+void sethostent(int stay_open);
+void setservent(int stay_open);
+void setprotoent(int stay_open);
+void setnetent(int stay_open);
+void endhostent(void);
+void endservent(void);
+void endprotoent(void);
+void endnetent(void);
+
+/*
+ * get next entry from data base file, or from NIS if possible.
+ */
+/*
+ * returns 0 if there are no more entries to read.
+ */
+struct hostent *gethostent(void);
+struct servent *getservent(void);
+struct protoent *getprotoent(void);
+struct netent *getnetent(void);
+
+struct netent *getnetbyaddr(long net, int type);
+
+/*
+ * Return the network number from an internet address
+ */
+u_long inet_netof(struct in_addr in);
+
+/*
+ * Return the host number from an internet address
+ */
+u_long inet_lnaof(struct in_addr in);
+
+#endif /* WIN32 or cygwin */
+
+#endif /*_WINSTUB_H_ */
diff --git a/apps/snmpset.c b/apps/snmpset.c
new file mode 100644
index 0000000..1b29a6c
--- /dev/null
+++ b/apps/snmpset.c
@@ -0,0 +1,284 @@
+/*
+ * snmpset.c - send snmp SET requests to a network entity.
+ *
+ */
+/***********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmpset ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " OID TYPE VALUE [OID TYPE VALUE]...\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr,
+ " -C APPOPTS\t\tSet various application specific behaviours:\n");
+ fprintf(stderr, "\t\t\t q: don't print results on success\n");
+ fprintf(stderr, "\n TYPE: one of i, u, t, a, o, s, x, d, b\n");
+ fprintf(stderr,
+ "\ti: INTEGER, u: unsigned INTEGER, t: TIMETICKS, a: IPADDRESS\n");
+ fprintf(stderr,
+ "\to: OBJID, s: STRING, x: HEX STRING, d: DECIMAL STRING, b: BITS\n");
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ fprintf(stderr,
+ "\tU: unsigned int64, I: signed int64, F: float, D: double\n");
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+
+}
+
+static int quiet = 0;
+
+static
+ void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'q':
+ quiet = 1;
+ break;
+
+ default:
+ fprintf(stderr, "Unknown flag passed to -C: %c\n",
+ optarg[-1]);
+ exit(1);
+ }
+ }
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu, *response = NULL;
+ netsnmp_variable_list *vars;
+ int arg;
+ int count;
+ int current_name = 0;
+ int current_type = 0;
+ int current_value = 0;
+ char *names[SNMP_MAX_CMDLINE_OIDS];
+ char types[SNMP_MAX_CMDLINE_OIDS];
+ char *values[SNMP_MAX_CMDLINE_OIDS];
+ oid name[MAX_OID_LEN];
+ size_t name_length;
+ int status;
+ int failures = 0;
+ int exitval = 0;
+
+ putenv(strdup("POSIXLY_CORRECT=1"));
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ if (arg >= argc) {
+ fprintf(stderr, "Missing object name\n");
+ usage();
+ exit(1);
+ }
+ if ((argc - arg) > 3*SNMP_MAX_CMDLINE_OIDS) {
+ fprintf(stderr, "Too many assignments specified. ");
+ fprintf(stderr, "Only %d allowed in one request.\n", SNMP_MAX_CMDLINE_OIDS);
+ usage();
+ exit(1);
+ }
+
+ /*
+ * get object names, types, and values
+ */
+ for (; arg < argc; arg++) {
+ DEBUGMSGTL(("snmp_parse_args", "handling (#%d): %s %s %s\n",
+ arg,argv[arg], arg+1 < argc ? argv[arg+1] : NULL,
+ arg+2 < argc ? argv[arg+2] : NULL));
+ names[current_name++] = argv[arg++];
+ if (arg < argc) {
+ switch (*argv[arg]) {
+ case '=':
+ case 'i':
+ case 'u':
+ case '3':
+ case 't':
+ case 'a':
+ case 'o':
+ case 's':
+ case 'x':
+ case 'd':
+ case 'b':
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case 'I':
+ case 'U':
+ case 'F':
+ case 'D':
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ types[current_type++] = *argv[arg++];
+ break;
+ default:
+ fprintf(stderr, "%s: Bad object type: %c\n", argv[arg - 1],
+ *argv[arg]);
+ exit(1);
+ }
+ } else {
+ fprintf(stderr, "%s: Needs type and value\n", argv[arg - 1]);
+ exit(1);
+ }
+ if (arg < argc)
+ values[current_value++] = argv[arg];
+ else {
+ fprintf(stderr, "%s: Needs value\n", argv[arg - 2]);
+ exit(1);
+ }
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpset", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ /*
+ * create PDU for SET request and add object names and values to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_SET);
+ for (count = 0; count < current_name; count++) {
+ name_length = MAX_OID_LEN;
+ if (snmp_parse_oid(names[count], name, &name_length) == NULL) {
+ snmp_perror(names[count]);
+ failures++;
+ } else
+ if (snmp_add_var
+ (pdu, name, name_length, types[count], values[count])) {
+ snmp_perror(names[count]);
+ failures++;
+ }
+ }
+
+ if (failures) {
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ /*
+ * do the request
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ if (!quiet) {
+ for (vars = response->variables; vars;
+ vars = vars->next_variable)
+ print_variable(vars->name, vars->name_length, vars);
+ }
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && (count != response->errindex);
+ vars = vars->next_variable, count++);
+ if (vars)
+ fprint_objid(stderr, vars->name, vars->name_length);
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ session.peername);
+ exitval = 1;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpset", ss);
+ exitval = 1;
+ }
+
+ if (response)
+ snmp_free_pdu(response);
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return exitval;
+}
diff --git a/apps/snmpstatus.c b/apps/snmpstatus.c
new file mode 100644
index 0000000..166ff3d
--- /dev/null
+++ b/apps/snmpstatus.c
@@ -0,0 +1,382 @@
+/*
+ * snmpstatus.c - retrieves a fixed set of management information from
+ * a network entity.
+ *
+ */
+/***********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/net-snmp-includes.h>
+
+oid objid_sysDescr[] = { 1, 3, 6, 1, 2, 1, 1, 1, 0 };
+size_t length_sysDescr = sizeof(objid_sysDescr) / sizeof(oid);
+oid objid_sysUpTime[] = { 1, 3, 6, 1, 2, 1, 1, 3, 0 };
+size_t length_sysUpTime = sizeof(objid_sysUpTime) / sizeof(oid);
+oid objid_ifOperStatus[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 8 };
+size_t length_ifOperStatus =
+ sizeof(objid_ifOperStatus) / sizeof(oid);
+oid objid_ifInUCastPkts[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 11 };
+size_t length_ifInUCastPkts =
+ sizeof(objid_ifInUCastPkts) / sizeof(oid);
+oid objid_ifInNUCastPkts[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 12 };
+size_t length_ifInNUCastPkts =
+ sizeof(objid_ifInNUCastPkts) / sizeof(oid);
+oid objid_ifOutUCastPkts[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 17 };
+size_t length_ifOutUCastPkts =
+ sizeof(objid_ifOutUCastPkts) / sizeof(oid);
+oid objid_ifOutNUCastPkts[] =
+ { 1, 3, 6, 1, 2, 1, 2, 2, 1, 18 };
+size_t length_ifOutNUCastPkts =
+ sizeof(objid_ifOutNUCastPkts) / sizeof(oid);
+oid objid_ipInReceives[] = { 1, 3, 6, 1, 2, 1, 4, 3, 0 };
+size_t length_ipInReceives =
+ sizeof(objid_ipInReceives) / sizeof(oid);
+oid objid_ipOutRequests[] = { 1, 3, 6, 1, 2, 1, 4, 10, 0 };
+size_t length_ipOutRequests =
+ sizeof(objid_ipOutRequests) / sizeof(oid);
+
+#define NETSNMP_DS_APP_DONT_FIX_PDUS 0
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'f':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_DONT_FIX_PDUS);
+ break;
+ default:
+ fprintf(stderr, "Unknown flag passed to -C: %c\n",
+ optarg[-1]);
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmpstatus ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, "\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr,
+ " -C APPOPTS\t\tSet various application specific behaviours:\n");
+ fprintf(stderr,
+ "\t\t\t f: do not fix errors and retry the request\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ netsnmp_transport *transport = NULL;
+ char *sysdescr = NULL;
+ u_long uptime = 0;
+ int status;
+ int ipin = 0, ipout = 0, ipackets = 0, opackets = 0;
+ int good_var;
+ int down_interfaces = 0;
+ char buf[40];
+ int interfaces;
+ int count;
+ int exitval = 0;
+
+ /*
+ * get the common command line arguments
+ */
+ switch (snmp_parse_args(argc, argv, &session, "C:", &optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpstatus", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ /*
+ * create PDU for GET request and add object names to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+ snmp_add_null_var(pdu, objid_sysDescr, length_sysDescr);
+ snmp_add_null_var(pdu, objid_sysUpTime, length_sysUpTime);
+ snmp_add_null_var(pdu, objid_ipInReceives, length_ipInReceives);
+ snmp_add_null_var(pdu, objid_ipOutRequests, length_ipOutRequests);
+
+ /*
+ * do the request
+ */
+ retry:
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ for (vars = response->variables; vars;
+ vars = vars->next_variable) {
+ if (vars->name_length == length_sysDescr
+ && !memcmp(objid_sysDescr, vars->name,
+ sizeof(objid_sysDescr))) {
+ sysdescr = (char *) malloc(vars->val_len + 1);
+ memcpy(sysdescr, vars->val.string, vars->val_len);
+ sysdescr[vars->val_len] = '\0';
+ }
+ if (vars->name_length == length_sysUpTime &&
+ !memcmp(objid_sysUpTime, vars->name,
+ sizeof(objid_sysUpTime)) &&
+ vars->val.integer) {
+ uptime = *vars->val.integer;
+ }
+ if (vars->name_length == length_ipInReceives &&
+ !memcmp(objid_ipInReceives, vars->name,
+ sizeof(objid_ipInReceives)) &&
+ vars->val.integer) {
+ ipin = *vars->val.integer;
+ }
+ if (vars->name_length == length_ipOutRequests &&
+ !memcmp(objid_ipOutRequests, vars->name,
+ sizeof(objid_ipOutRequests)) &&
+ vars->val.integer) {
+ ipout = *vars->val.integer;
+ }
+ }
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++);
+ if (vars)
+ fprint_objid(stderr, vars->name, vars->name_length);
+ fprintf(stderr, "\n");
+ }
+
+ /*
+ * retry if the errored variable was successfully removed
+ */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_DONT_FIX_PDUS)) {
+ pdu = snmp_fix_pdu(response, SNMP_MSG_GET);
+ snmp_free_pdu(response);
+ response = NULL;
+ if (pdu != NULL)
+ goto retry;
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ session.peername);
+ SOCK_CLEANUP;
+ exit(1);
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpstatus", ss);
+ SOCK_CLEANUP;
+ exit(2);
+ }
+
+ transport = snmp_sess_transport(snmp_sess_pointer(ss));
+ if (transport != NULL && transport->f_fmtaddr != NULL) {
+ char *addr_string = transport->f_fmtaddr(transport,
+ response->transport_data,
+ response->
+ transport_data_length);
+ if (addr_string != NULL) {
+ printf("[%s]=>[%s] Up: %s\n", addr_string, sysdescr,
+ uptime_string(uptime, buf));
+ free(addr_string);
+ }
+ } else {
+ printf("[<UNKNOWN>]=>[%s] Up: %s\n", sysdescr,
+ uptime_string(uptime, buf));
+ }
+
+ if (response)
+ snmp_free_pdu(response);
+
+ /*
+ * create PDU for GET request and add object names to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ snmp_add_null_var(pdu, objid_ifOperStatus, length_ifOperStatus);
+ snmp_add_null_var(pdu, objid_ifInUCastPkts, length_ifInUCastPkts);
+ snmp_add_null_var(pdu, objid_ifInNUCastPkts, length_ifInNUCastPkts);
+ snmp_add_null_var(pdu, objid_ifOutUCastPkts, length_ifOutUCastPkts);
+ snmp_add_null_var(pdu, objid_ifOutNUCastPkts, length_ifOutNUCastPkts);
+
+ /*
+ * ?? note: this code is not quite complete
+ */
+ good_var = 5;
+ interfaces = 0;
+ while (good_var == 5) {
+ good_var = 0;
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ for (vars = response->variables; vars;
+ vars = vars->next_variable) {
+ if (vars->name_length >= length_ifOperStatus
+ && !memcmp(objid_ifOperStatus, vars->name,
+ sizeof(objid_ifOperStatus))) {
+ if (*vars->val.integer != MIB_IFSTATUS_UP)
+ down_interfaces++;
+ snmp_add_null_var(pdu, vars->name,
+ vars->name_length);
+ good_var++;
+ } else if (vars->name_length >= length_ifInUCastPkts &&
+ !memcmp(objid_ifInUCastPkts, vars->name,
+ sizeof(objid_ifInUCastPkts))) {
+ ipackets += *vars->val.integer;
+ snmp_add_null_var(pdu, vars->name,
+ vars->name_length);
+ good_var++;
+ } else if (vars->name_length >= length_ifInNUCastPkts
+ && !memcmp(objid_ifInNUCastPkts, vars->name,
+ sizeof(objid_ifInNUCastPkts))) {
+ ipackets += *vars->val.integer;
+ snmp_add_null_var(pdu, vars->name,
+ vars->name_length);
+ good_var++;
+ } else if (vars->name_length >= length_ifOutUCastPkts
+ && !memcmp(objid_ifOutUCastPkts, vars->name,
+ sizeof(objid_ifOutUCastPkts))) {
+ opackets += *vars->val.integer;
+ snmp_add_null_var(pdu, vars->name,
+ vars->name_length);
+ good_var++;
+ } else if (vars->name_length >= length_ifOutNUCastPkts
+ && !memcmp(objid_ifOutNUCastPkts,
+ vars->name,
+ sizeof(objid_ifOutNUCastPkts))) {
+ opackets += *vars->val.integer;
+ snmp_add_null_var(pdu, vars->name,
+ vars->name_length);
+ good_var++;
+ }
+ }
+ if (good_var == 5)
+ interfaces++;
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++);
+ if (vars)
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ session.peername);
+ exitval = 1;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpstatus", ss);
+ exitval = 1;
+ }
+
+ if (response)
+ snmp_free_pdu(response);
+ }
+ printf("Interfaces: %d, Recv/Trans packets: %d/%d | IP: %d/%d\n",
+ interfaces, ipackets, opackets, ipin, ipout);
+ if (down_interfaces > 0) {
+ printf("%d interface%s down!\n",
+ down_interfaces, down_interfaces > 1 ? "s are" : " is");
+ }
+
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return exitval;
+}
diff --git a/apps/snmptable.c b/apps/snmptable.c
new file mode 100644
index 0000000..c9c7d26
--- /dev/null
+++ b/apps/snmptable.c
@@ -0,0 +1,1010 @@
+/*
+ * snmptable.c - walk a table and print it nicely
+ *
+ * Update: 1999-10-26 <rs-snmp@revelstone.com>
+ * Added ability to use MIB to query tables with non-sequential column OIDs
+ * Added code to handle sparse tables
+ *
+ * Update: 1998-07-17 <jhy@gsu.edu>
+ * Added text <special options> to usage().
+ */
+/**********************************************************************
+ Copyright 1997 Niels Baggesen
+
+ 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.
+
+I DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+I 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 HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+# include <netinet/in.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include <stdio.h>
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+struct column {
+ int width;
+ oid subid;
+ char *label;
+ char *fmt;
+} *column = NULL;
+
+static char **data = NULL;
+static char **indices = NULL;
+static int index_width = sizeof("index ") - 1;
+static int fields;
+static int entries;
+static int allocated;
+static int end_of_table = 1;
+static int headers_only = 0;
+static int no_headers = 0;
+static int max_width = 0;
+static int column_width = 0;
+static int brief = 0;
+static int show_index = 0;
+static const char *left_justify_flag = "";
+static char *field_separator = NULL;
+static char *table_name;
+static oid name[MAX_OID_LEN];
+static size_t name_length;
+static oid root[MAX_OID_LEN];
+static size_t rootlen;
+static int localdebug;
+static int exitval = 0;
+static int use_getbulk = 1;
+static int max_getbulk = 10;
+static int extra_columns = 0;
+
+void usage(void);
+void get_field_names(void);
+void get_table_entries(netsnmp_session * ss);
+void getbulk_table_entries(netsnmp_session * ss);
+void print_table(void);
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ /*
+ * Handle new '-C' command-specific meta-options
+ */
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'w':
+ if (optind < argc) {
+ if (argv[optind]) {
+ max_width = atoi(argv[optind]);
+ if (max_width == 0) {
+ usage();
+ fprintf(stderr, "Bad -Cw option: %s\n",
+ argv[optind]);
+ exit(1);
+ }
+ }
+ } else {
+ usage();
+ fprintf(stderr, "Bad -Cw option: no argument given\n");
+ exit(1);
+ }
+ optind++;
+ break;
+ case 'c':
+ if (optind < argc) {
+ if (argv[optind]) {
+ column_width = atoi(argv[optind]);
+ if (column_width <= 2) {
+ usage();
+ fprintf(stderr, "Bad -Cc option: %s\n",
+ argv[optind]);
+ exit(1);
+ }
+ /* Reduce by one for space at end of column */
+ column_width -= 1;
+ }
+ } else {
+ usage();
+ fprintf(stderr, "Bad -Cc option: no argument given\n");
+ exit(1);
+ }
+ optind++;
+ break;
+ case 'l':
+ left_justify_flag = "-";
+ break;
+ case 'f':
+ if (optind < argc) {
+ field_separator = argv[optind];
+ } else {
+ usage();
+ fprintf(stderr, "Bad -Cf option: no argument given\n");
+ exit(1);
+ }
+ optind++;
+ break;
+ case 'h':
+ headers_only = 1;
+ break;
+ case 'H':
+ no_headers = 1;
+ break;
+ case 'B':
+ use_getbulk = 0;
+ break;
+ case 'b':
+ brief = 1;
+ break;
+ case 'i':
+ show_index = 1;
+ break;
+ case 'r':
+ if (optind < argc) {
+ if (argv[optind]) {
+ max_getbulk = atoi(argv[optind]);
+ if (max_getbulk == 0) {
+ usage();
+ fprintf(stderr, "Bad -Cr option: %s\n",
+ argv[optind]);
+ exit(1);
+ }
+ }
+ } else {
+ usage();
+ fprintf(stderr, "Bad -Cr option: no argument given\n");
+ exit(1);
+ }
+ optind++;
+ break;
+ default:
+ fprintf(stderr, "Bad option after -C: %c\n", optarg[-1]);
+ usage();
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmptable ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " TABLE-OID\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr,
+ " -C APPOPTS\t\tSet various application specific behaviours:\n");
+ fprintf(stderr, "\t\t\t b: brief field names\n");
+ fprintf(stderr, "\t\t\t B: do not use GETBULK requests\n");
+ fprintf(stderr, "\t\t\t c<NUM>: print table in columns of <NUM> chars width\n");
+ fprintf(stderr, "\t\t\t f<STR>: print table delimitied with <STR>\n");
+ fprintf(stderr, "\t\t\t h: print only the column headers\n");
+ fprintf(stderr, "\t\t\t H: print no column headers\n");
+ fprintf(stderr, "\t\t\t i: print index values\n");
+ fprintf(stderr, "\t\t\t l: left justify output\n");
+ fprintf(stderr, "\t\t\t r<NUM>: for GETBULK: set max-repeaters to <NUM>\n");
+ fprintf(stderr, "\t\t\t for GETNEXT: retrieve <NUM> entries at a time\n");
+ fprintf(stderr, "\t\t\t w<NUM>: print table in parts of <NUM> chars width\n");
+}
+
+void
+reverse_fields(void)
+{
+ struct column tmp;
+ int i;
+
+ for (i = 0; i < fields / 2; i++) {
+ memcpy(&tmp, &(column[i]), sizeof(struct column));
+ memcpy(&(column[i]), &(column[fields - 1 - i]),
+ sizeof(struct column));
+ memcpy(&(column[fields - 1 - i]), &tmp, sizeof(struct column));
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ int total_entries = 0;
+
+ netsnmp_set_line_buffering(stdout);
+
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT, 1);
+
+ /*
+ * get the common command line arguments
+ */
+ switch (snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ /*
+ * get the initial object and subtree
+ */
+ /*
+ * specified on the command line
+ */
+ if (optind + 1 != argc) {
+ fprintf(stderr, "Must have exactly one table name\n");
+ usage();
+ exit(1);
+ }
+
+ rootlen = MAX_OID_LEN;
+ if (!snmp_parse_oid(argv[optind], root, &rootlen)) {
+ snmp_perror(argv[optind]);
+ exit(1);
+ }
+ localdebug = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET);
+
+ get_field_names();
+ reverse_fields();
+
+ /*
+ * open an SNMP session
+ */
+ SOCK_STARTUP;
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmptable", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (ss->version == SNMP_VERSION_1)
+ use_getbulk = 0;
+#endif
+
+ do {
+ entries = 0;
+ allocated = 0;
+ if (!headers_only) {
+ if (use_getbulk)
+ getbulk_table_entries(ss);
+ else
+ get_table_entries(ss);
+ }
+
+ if (exitval) {
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return exitval;
+ }
+
+ if (entries || headers_only)
+ print_table();
+
+ if (data) {
+ free (data);
+ data = NULL;
+ }
+
+ if (indices) {
+ free (indices);
+ indices = NULL;
+ }
+
+ total_entries += entries;
+
+ } while (!end_of_table);
+
+ snmp_close(ss);
+ SOCK_CLEANUP;
+
+ if (total_entries == 0)
+ printf("%s: No entries\n", table_name);
+ if (extra_columns)
+ printf("%s: WARNING: More columns on agent than in MIB\n", table_name);
+
+ return 0;
+}
+
+void
+print_table(void)
+{
+ int entry, field, first_field, last_field = 0, width, part = 0;
+ char **dp;
+ char string_buf[SPRINT_MAX_LEN];
+ char *index_fmt = NULL;
+ static int first_pass = 1;
+
+ if (!no_headers && !headers_only && first_pass)
+ printf("SNMP table: %s\n\n", table_name);
+
+ for (field = 0; field < fields; field++) {
+ if (column_width != 0)
+ sprintf(string_buf, "%%%s%d.%ds", left_justify_flag,
+ column_width + 1, column_width );
+ else if (field_separator == NULL)
+ sprintf(string_buf, "%%%s%ds", left_justify_flag,
+ column[field].width + 1);
+ else if (field == 0 && !show_index)
+ sprintf(string_buf, "%%s");
+ else
+ sprintf(string_buf, "%s%%s", field_separator);
+ column[field].fmt = strdup(string_buf);
+ }
+ if (show_index) {
+ if (column_width)
+ sprintf(string_buf, "\nindex: %%s\n");
+ else if (field_separator == NULL)
+ sprintf(string_buf, "%%%s%ds", left_justify_flag, index_width);
+ else
+ sprintf(string_buf, "%%s");
+ index_fmt = strdup(string_buf);
+ }
+
+ while (last_field != fields) {
+ part++;
+ if (part != 1 && !no_headers)
+ printf("\nSNMP table %s, part %d\n\n", table_name, part);
+ first_field = last_field;
+ dp = data;
+ if (show_index && !no_headers && !column_width && first_pass) {
+ width = index_width;
+ printf(index_fmt, "index");
+ } else
+ width = 0;
+ for (field = first_field; field < fields; field++) {
+ if (max_width)
+ {
+ if (column_width) {
+ if (!no_headers && first_pass) {
+ width += column_width + 1;
+ if (field != first_field && width > max_width) {
+ printf("\n");
+ width = column_width + 1;
+ }
+ }
+ }
+ else {
+ width += column[field].width + 1;
+ if (field != first_field && width > max_width)
+ break;
+ }
+ }
+ if (!no_headers && first_pass)
+ printf(column[field].fmt, column[field].label);
+ }
+ last_field = field;
+ if (!no_headers && first_pass)
+ printf("\n");
+ for (entry = 0; entry < entries; entry++) {
+ width = 0;
+ if (show_index)
+ {
+ if (!column_width)
+ width = index_width;
+ printf(index_fmt, indices[entry]);
+ }
+ for (field = first_field; field < last_field; field++) {
+ if (column_width && max_width) {
+ width += column_width + 1;
+ if (field != first_field && width > max_width) {
+ printf("\n");
+ width = column_width + 1;
+ }
+ }
+ printf(column[field].fmt, dp[field] ? dp[field] : "?");
+ }
+ dp += fields;
+ printf("\n");
+ }
+ }
+
+ first_pass = 0;
+}
+
+void
+get_field_names(void)
+{
+ char *buf = NULL, *name_p = NULL;
+ size_t buf_len = 0, out_len = 0;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ struct tree *tbl = NULL;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ int going = 1;
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ tbl = get_tree(root, rootlen, get_tree_head());
+ if (tbl) {
+ tbl = tbl->child_list;
+ if (tbl) {
+ root[rootlen++] = tbl->subid;
+ tbl = tbl->child_list;
+ } else {
+ root[rootlen++] = 1;
+ going = 0;
+ }
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+ if (sprint_realloc_objid
+ ((u_char **)&buf, &buf_len, &out_len, 1, root, rootlen - 1)) {
+ table_name = buf;
+ buf = NULL;
+ buf_len = out_len = 0;
+ } else {
+ table_name = strdup("[TRUNCATED]");
+ out_len = 0;
+ }
+
+ fields = 0;
+ while (going) {
+ fields++;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (tbl) {
+ if (tbl->access == MIB_ACCESS_NOACCESS) {
+ fields--;
+ tbl = tbl->next_peer;
+ if (!tbl) {
+ going = 0;
+ }
+ continue;
+ }
+ root[rootlen] = tbl->subid;
+ tbl = tbl->next_peer;
+ if (!tbl)
+ going = 0;
+ } else {
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ root[rootlen] = fields;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ out_len = 0;
+ if (sprint_realloc_objid
+ ((u_char **)&buf, &buf_len, &out_len, 1, root, rootlen + 1)) {
+ name_p = strrchr(buf, '.');
+ if (name_p == NULL) {
+ name_p = strrchr(buf, ':');
+ }
+ if (name_p == NULL) {
+ name_p = buf;
+ } else {
+ name_p++;
+ }
+ } else {
+ break;
+ }
+ if (localdebug) {
+ printf("%s %c\n", buf, name_p[0]);
+ }
+ if ('0' <= name_p[0] && name_p[0] <= '9') {
+ fields--;
+ break;
+ }
+ if (fields == 1) {
+ column = (struct column *) malloc(sizeof(*column));
+ } else {
+ column =
+ (struct column *) realloc(column,
+ fields * sizeof(*column));
+ }
+ column[fields - 1].label = strdup(name_p);
+ column[fields - 1].width = strlen(name_p);
+ column[fields - 1].subid = root[rootlen];
+ }
+ if (fields == 0) {
+ fprintf(stderr, "Was that a table? %s\n", table_name);
+ exit(1);
+ }
+ if (name_p) {
+ *name_p = 0;
+ memmove(name, root, rootlen * sizeof(oid));
+ name_length = rootlen + 1;
+ name_p = strrchr(buf, '.');
+ if (name_p == NULL) {
+ name_p = strrchr(buf, ':');
+ }
+ if (name_p != NULL) {
+ *name_p = 0;
+ }
+ }
+ if (brief && fields > 1) {
+ char *f1, *f2;
+ int common = strlen(column[0].label);
+ int field, len;
+ for (field = 1; field < fields; field++) {
+ f1 = column[field - 1].label;
+ f2 = column[field].label;
+ while (*f1 && *f1++ == *f2++);
+ len = f2 - column[field].label - 1;
+ if (len < common)
+ common = len;
+ }
+ if (common) {
+ for (field = 0; field < fields; field++) {
+ column[field].label += common;
+ column[field].width -= common;
+ }
+ }
+ }
+ if (buf != NULL) {
+ free(buf);
+ }
+}
+
+void
+get_table_entries(netsnmp_session * ss)
+{
+ int running = 1;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ int count;
+ int status;
+ int i;
+ int col;
+ char *buf = NULL;
+ size_t out_len = 0, buf_len = 0;
+ char *cp;
+ char *name_p = NULL;
+ char **dp;
+ int have_current_index;
+
+ /*
+ * TODO:
+ * 1) Deal with multiple index fields
+ * 2) Deal with variable length index fields
+ * 3) optimize to remove a sparse column from get-requests
+ */
+
+ while (running &&
+ ((max_width && !column_width) || (entries < max_getbulk))) {
+ /*
+ * create PDU for GETNEXT request and add object name to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ for (i = 1; i <= fields; i++) {
+ name[rootlen] = column[i - 1].subid;
+ snmp_add_null_var(pdu, name, name_length);
+ }
+
+ /*
+ * do the request
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ /*
+ * check resulting variables
+ */
+ vars = response->variables;
+ entries++;
+ if (entries >= allocated) {
+ if (allocated == 0) {
+ allocated = 10;
+ data =
+ (char **) malloc(allocated * fields *
+ sizeof(char *));
+ memset(data, 0,
+ allocated * fields * sizeof(char *));
+ if (show_index)
+ indices =
+ (char **) malloc(allocated *
+ sizeof(char *));
+ } else {
+ allocated += 10;
+ data =
+ (char **) realloc(data,
+ allocated * fields *
+ sizeof(char *));
+ memset(data + entries * fields, 0,
+ (allocated -
+ entries) * fields * sizeof(char *));
+ if (show_index)
+ indices =
+ (char **) realloc(indices,
+ allocated *
+ sizeof(char *));
+ }
+ }
+ dp = data + (entries - 1) * fields;
+ col = -1;
+ end_of_table = 1; /* assume end of table */
+ have_current_index = 0;
+ name_length = rootlen + 1;
+ for (vars = response->variables; vars;
+ vars = vars->next_variable) {
+ col++;
+ name[rootlen] = column[col].subid;
+ if ((vars->name_length < name_length) ||
+ (vars->name[rootlen] != column[col].subid) ||
+ memcmp(name, vars->name,
+ name_length * sizeof(oid)) != 0
+ || vars->type == SNMP_ENDOFMIBVIEW) {
+ /*
+ * not part of this subtree
+ */
+ if (localdebug) {
+ fprint_variable(stderr, vars->name,
+ vars->name_length, vars);
+ fprintf(stderr, " => ignored\n");
+ }
+ continue;
+ }
+
+ /*
+ * save index off
+ */
+ if (!have_current_index) {
+ end_of_table = 0;
+ have_current_index = 1;
+ name_length = vars->name_length;
+ memcpy(name, vars->name,
+ name_length * sizeof(oid));
+ out_len = 0;
+ if (!sprint_realloc_objid
+ ((u_char **)&buf, &buf_len, &out_len, 1, vars->name,
+ vars->name_length)) {
+ break;
+ }
+ i = vars->name_length - rootlen + 1;
+ if (localdebug || show_index) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_EXTENDED_INDEX)) {
+ name_p = strchr(buf, '[');
+ } else {
+ switch (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT)) {
+ case NETSNMP_OID_OUTPUT_MODULE:
+ case 0:
+ name_p = strchr(buf, ':');
+ break;
+ case NETSNMP_OID_OUTPUT_SUFFIX:
+ name_p = buf;
+ break;
+ case NETSNMP_OID_OUTPUT_FULL:
+ case NETSNMP_OID_OUTPUT_NUMERIC:
+ case NETSNMP_OID_OUTPUT_UCD:
+ name_p = buf + strlen(table_name)+1;
+ name_p = strchr(name_p, '.')+1;
+ break;
+ default:
+ fprintf(stderr, "Unrecognized -O option: %d\n",
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT));
+ exit(1);
+ }
+ name_p = strchr(name_p, '.') + 1;
+ }
+ }
+ if (localdebug) {
+ printf("Name: %s Index: %s\n", buf, name_p);
+ }
+ if (show_index) {
+ indices[entries - 1] = strdup(name_p);
+ i = strlen(name_p);
+ if (i > index_width)
+ index_width = i;
+ }
+ }
+
+ if (localdebug && buf) {
+ printf("%s => taken\n", buf);
+ }
+ out_len = 0;
+ sprint_realloc_value((u_char **)&buf, &buf_len, &out_len, 1,
+ vars->name, vars->name_length,
+ vars);
+ for (cp = buf; *cp; cp++) {
+ if (*cp == '\n') {
+ *cp = ' ';
+ }
+ }
+ dp[col] = buf;
+ i = out_len;
+ buf = NULL;
+ buf_len = 0;
+ if (i > column[col].width) {
+ column[col].width = i;
+ }
+ }
+
+ if (end_of_table) {
+ --entries;
+ /*
+ * not part of this subtree
+ */
+ if (localdebug) {
+ printf("End of table: %s\n",
+ buf ? (char *) buf : "[NIL]");
+ }
+ running = 0;
+ continue;
+ }
+ } else {
+ /*
+ * error in response, print it
+ */
+ running = 0;
+ if (response->errstat == SNMP_ERR_NOSUCHNAME) {
+ printf("End of MIB\n");
+ end_of_table = 1;
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++)
+ /*EMPTY*/;
+ if (vars) {
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ }
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ ss->peername);
+ running = 0;
+ exitval = 1;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmptable", ss);
+ running = 0;
+ exitval = 1;
+ }
+ if (response)
+ snmp_free_pdu(response);
+ }
+}
+
+void
+getbulk_table_entries(netsnmp_session * ss)
+{
+ int running = 1;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars, *last_var;
+ int count;
+ int status;
+ int i;
+ int row, col;
+ char *buf = NULL;
+ size_t buf_len = 0, out_len = 0;
+ char *cp;
+ char *name_p = NULL;
+ char **dp;
+
+ while (running) {
+ /*
+ * create PDU for GETBULK request and add object name to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETBULK);
+ pdu->non_repeaters = 0;
+ pdu->max_repetitions = max_getbulk;
+ snmp_add_null_var(pdu, name, name_length);
+
+ /*
+ * do the request
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ /*
+ * check resulting variables
+ */
+ vars = response->variables;
+ last_var = NULL;
+ while (vars) {
+ out_len = 0;
+ sprint_realloc_objid((u_char **)&buf, &buf_len, &out_len, 1,
+ vars->name, vars->name_length);
+ if (vars->type == SNMP_ENDOFMIBVIEW ||
+ memcmp(vars->name, name,
+ rootlen * sizeof(oid)) != 0) {
+ if (localdebug) {
+ printf("%s => end of table\n",
+ buf ? (char *) buf : "[NIL]");
+ }
+ running = 0;
+ break;
+ }
+ if (localdebug) {
+ printf("%s => taken\n",
+ buf ? (char *) buf : "[NIL]");
+ }
+ for (col = 0; col < fields; col++)
+ if (column[col].subid == vars->name[rootlen])
+ break;
+ if (col == fields) {
+ extra_columns = 1;
+ last_var = vars;
+ vars = vars->next_variable;
+ continue;
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_EXTENDED_INDEX)) {
+ name_p = strchr(buf, '[');
+ } else {
+ switch (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT)) {
+ case NETSNMP_OID_OUTPUT_MODULE:
+ case 0:
+ name_p = strchr(buf, ':')+1;
+ break;
+ case NETSNMP_OID_OUTPUT_SUFFIX:
+ name_p = buf;
+ break;
+ case NETSNMP_OID_OUTPUT_FULL:
+ case NETSNMP_OID_OUTPUT_NUMERIC:
+ case NETSNMP_OID_OUTPUT_UCD:
+ name_p = buf + strlen(table_name)+1;
+ name_p = strchr(name_p, '.')+1;
+ break;
+ default:
+ fprintf(stderr, "Unrecognized -O option: %d\n",
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT));
+ exit(1);
+ }
+ name_p = strchr(name_p, '.');
+ if ( name_p == NULL ) {
+ /* The 'strchr' call above failed, i.e. the results
+ * don't seem to include instance subidentifiers! */
+ running = 0;
+ break;
+ }
+ name_p++; /* Move on to the instance identifier */
+ }
+ for (row = 0; row < entries; row++)
+ if (strcmp(name_p, indices[row]) == 0)
+ break;
+ if (row == entries) {
+ entries++;
+ if (entries >= allocated) {
+ if (allocated == 0) {
+ allocated = 10;
+ data =
+ (char **) malloc(allocated * fields *
+ sizeof(char *));
+ memset(data, 0,
+ allocated * fields *
+ sizeof(char *));
+ indices =
+ (char **) malloc(allocated *
+ sizeof(char *));
+ } else {
+ allocated += 10;
+ data =
+ (char **) realloc(data,
+ allocated * fields *
+ sizeof(char *));
+ memset(data + entries * fields, 0,
+ (allocated -
+ entries) * fields *
+ sizeof(char *));
+ indices =
+ (char **) realloc(indices,
+ allocated *
+ sizeof(char *));
+ }
+ }
+ indices[row] = strdup(name_p);
+ i = strlen(name_p);
+ if (i > index_width)
+ index_width = i;
+ }
+ dp = data + row * fields;
+ out_len = 0;
+ sprint_realloc_value((u_char **)&buf, &buf_len, &out_len, 1,
+ vars->name, vars->name_length,
+ vars);
+ for (cp = buf; *cp; cp++)
+ if (*cp == '\n')
+ *cp = ' ';
+ dp[col] = buf;
+ i = out_len;
+ buf = NULL;
+ buf_len = 0;
+ if (i > column[col].width)
+ column[col].width = i;
+ last_var = vars;
+ vars = vars->next_variable;
+ }
+ if (last_var) {
+ name_length = last_var->name_length;
+ memcpy(name, last_var->name,
+ name_length * sizeof(oid));
+ }
+ } else {
+ /*
+ * error in response, print it
+ */
+ running = 0;
+ if (response->errstat == SNMP_ERR_NOSUCHNAME) {
+ printf("End of MIB\n");
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errstat == SNMP_ERR_NOSUCHNAME) {
+ fprintf(stderr,
+ "The request for this object identifier failed: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++)
+ /*EMPTY*/;
+ if (vars) {
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ }
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ ss->peername);
+ running = 0;
+ exitval = 1;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmptable", ss);
+ running = 0;
+ exitval = 1;
+ }
+ if (response)
+ snmp_free_pdu(response);
+ }
+}
diff --git a/apps/snmptest.c b/apps/snmptest.c
new file mode 100644
index 0000000..24de47b
--- /dev/null
+++ b/apps/snmptest.c
@@ -0,0 +1,535 @@
+/*
+ * snmptest.c - send snmp requests to a network entity.
+ *
+ * Usage: snmptest -v 1 [-q] hostname community [objectID]
+ *
+ */
+/***********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+int command = SNMP_MSG_GET;
+
+int input_variable(netsnmp_variable_list *);
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmptest ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, "\n\n");
+ snmp_parse_args_descriptions(stderr);
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu = NULL, *response, *copy = NULL;
+ netsnmp_variable_list *vars, *vp;
+ netsnmp_transport *transport = NULL;
+ int ret;
+ int status, count;
+ char input[128];
+ int varcount, nonRepeaters = -1, maxRepetitions;
+
+ /*
+ * get the common command line arguments
+ */
+ switch (snmp_parse_args(argc, argv, &session, NULL, NULL)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmptest", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ varcount = 0;
+ for(;;) {
+ vars = NULL;
+ for (ret = 1; ret != 0;) {
+ vp = (netsnmp_variable_list *)
+ malloc(sizeof(netsnmp_variable_list));
+ memset(vp, 0, sizeof(netsnmp_variable_list));
+
+ while ((ret = input_variable(vp)) == -1);
+ if (ret == 1) {
+ varcount++;
+ /*
+ * add it to the list
+ */
+ if (vars == NULL) {
+ /*
+ * if first variable
+ */
+ pdu = snmp_pdu_create(command);
+ pdu->variables = vp;
+ } else {
+ vars->next_variable = vp;
+ }
+ vars = vp;
+ } else {
+ /*
+ * free the last (unused) variable
+ */
+ if (vp->name)
+ free((char *) vp->name);
+ if (vp->val.string)
+ free((char *) vp->val.string);
+ free((char *) vp);
+
+ if (command == SNMP_MSG_GETBULK) {
+ if (nonRepeaters == -1) {
+ nonRepeaters = varcount;
+ ret = -1; /* so we collect more variables */
+ printf("Now input the repeating variables\n");
+ } else {
+ printf("What repeat count? ");
+ fflush(stdout);
+ if (!fgets(input, sizeof(input), stdin)) {
+ printf("Quitting, Goodbye\n");
+ SOCK_CLEANUP;
+ exit(0);
+ }
+ maxRepetitions = atoi(input);
+ pdu->non_repeaters = nonRepeaters;
+ pdu->max_repetitions = maxRepetitions;
+ }
+ }
+ }
+ if (varcount == 0 && ret == 0) {
+ if (!copy) {
+ printf("No PDU to send.\n");
+ ret = -1;
+ } else {
+ pdu = snmp_clone_pdu(copy);
+ printf("Resending last PDU.\n");
+ }
+ }
+ }
+ copy = snmp_clone_pdu(pdu);
+ if (command == SNMP_MSG_TRAP2) {
+ /*
+ * No response needed
+ */
+ if (!snmp_send(ss, pdu)) {
+ snmp_free_pdu(pdu);
+ snmp_sess_perror("snmptest", ss);
+ }
+ } else {
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (command == SNMP_MSG_INFORM &&
+ response->errstat == SNMP_ERR_NOERROR) {
+ printf("Inform Acknowledged\n");
+ } else {
+ switch (response->command) {
+ case SNMP_MSG_GET:
+ printf("Received Get Request ");
+ break;
+ case SNMP_MSG_GETNEXT:
+ printf("Received Getnext Request ");
+ break;
+ case SNMP_MSG_RESPONSE:
+ printf("Received Get Response ");
+ break;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_SET:
+ printf("Received Set Request ");
+ break;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ case SNMP_MSG_TRAP:
+ printf("Received Trap Request ");
+ break;
+ case SNMP_MSG_GETBULK:
+ printf("Received Bulk Request ");
+ break;
+ case SNMP_MSG_INFORM:
+ printf("Received Inform Request ");
+ break;
+ case SNMP_MSG_TRAP2:
+ printf("Received SNMPv2 Trap Request ");
+ break;
+ }
+ transport = snmp_sess_transport(snmp_sess_pointer(ss));
+ if (transport != NULL && transport->f_fmtaddr != NULL) {
+ char *addr_string = transport->f_fmtaddr(transport,
+ response->
+ transport_data,
+ response->
+ transport_data_length);
+ if (addr_string != NULL) {
+ printf("from %s\n", addr_string);
+ free(addr_string);
+ }
+ } else {
+ printf("from <UNKNOWN>\n");
+ }
+ printf
+ ("requestid 0x%lX errstat 0x%lX errindex 0x%lX\n",
+ response->reqid, response->errstat,
+ response->errindex);
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ for (vars = response->variables; vars;
+ vars = vars->next_variable)
+ print_variable(vars->name, vars->name_length,
+ vars);
+ } else {
+ printf("Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++);
+ if (vars) {
+ printf("Failed object: ");
+ print_objid(vars->name, vars->name_length);
+ }
+ printf("\n");
+ }
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ printf("Timeout: No Response from %s\n", session.peername);
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmptest", ss);
+ }
+
+ if (response)
+ snmp_free_pdu(response);
+ }
+ varcount = 0;
+ nonRepeaters = -1;
+ }
+ /* NOTREACHED */
+}
+
+int
+input_variable(netsnmp_variable_list * vp)
+{
+ char buf[256];
+ size_t val_len;
+ u_char ch;
+
+ printf("Variable: ");
+ fflush(stdout);
+ if (!fgets(buf, sizeof(buf), stdin)) {
+ printf("Quitting, Goobye\n");
+ SOCK_CLEANUP;
+ exit(0);
+ }
+ val_len = strlen(buf);
+
+ if (val_len == 0 || *buf == '\n') {
+ vp->name_length = 0;
+ return 0;
+ }
+ if (buf[val_len - 1] == '\n')
+ buf[--val_len] = 0;
+ if (*buf == '$') {
+ switch (toupper((unsigned char)(buf[1]))) {
+ case 'G':
+ command = SNMP_MSG_GET;
+ printf("Request type is Get Request\n");
+ break;
+ case 'N':
+ command = SNMP_MSG_GETNEXT;
+ printf("Request type is Getnext Request\n");
+ break;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case 'S':
+ command = SNMP_MSG_SET;
+ printf("Request type is Set Request\n");
+ break;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ case 'B':
+ command = SNMP_MSG_GETBULK;
+ printf("Request type is Bulk Request\n");
+ printf
+ ("Enter a blank line to terminate the list of non-repeaters\n");
+ printf("and to begin the repeating variables\n");
+ break;
+ case 'I':
+ command = SNMP_MSG_INFORM;
+ printf("Request type is Inform Request\n");
+ printf("(Are you sending to the right port?)\n");
+ break;
+ case 'T':
+ command = SNMP_MSG_TRAP2;
+ printf("Request type is SNMPv2 Trap Request\n");
+ printf("(Are you sending to the right port?)\n");
+ break;
+ case 'D':
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET)) {
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET, 0);
+ printf("Turned packet dump off\n");
+ } else {
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET, 1);
+ printf("Turned packet dump on\n");
+ }
+ break;
+ case 'Q':
+ switch ((toupper((unsigned char)(buf[2])))) {
+ case '\n':
+ case 0:
+ printf("Quitting, Goodbye\n");
+ SOCK_CLEANUP;
+ exit(0);
+ break;
+ case 'P':
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT)) {
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT, 0);
+ printf("Turned quick printing off\n");
+ } else {
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT, 1);
+ printf("Turned quick printing on\n");
+ }
+ break;
+ }
+ break;
+ default:
+ printf("Bad command\n");
+ }
+ return -1;
+ }
+ {
+ oid name[MAX_OID_LEN];
+ vp->name_length = MAX_OID_LEN;
+ if (!snmp_parse_oid(buf, name, &vp->name_length)) {
+ snmp_perror(buf);
+ return -1;
+ }
+ vp->name = snmp_duplicate_objid(name, vp->name_length);
+ }
+
+ if (command == SNMP_MSG_INFORM
+ || command == SNMP_MSG_TRAP2
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ || command == SNMP_MSG_SET
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ ) {
+ printf("Type [i|u|s|x|d|n|o|t|a]: ");
+ fflush(stdout);
+ if (!fgets(buf, sizeof(buf), stdin)) {
+ printf("Quitting, Goodbye\n");
+ SOCK_CLEANUP;
+ exit(0);
+ }
+ ch = *buf;
+ switch (ch) {
+ case 'i':
+ vp->type = ASN_INTEGER;
+ break;
+ case 'u':
+ vp->type = ASN_UNSIGNED;
+ break;
+ case 's':
+ vp->type = ASN_OCTET_STR;
+ break;
+ case 'x':
+ vp->type = ASN_OCTET_STR;
+ break;
+ case 'd':
+ vp->type = ASN_OCTET_STR;
+ break;
+ case 'n':
+ vp->type = ASN_NULL;
+ break;
+ case 'o':
+ vp->type = ASN_OBJECT_ID;
+ break;
+ case 't':
+ vp->type = ASN_TIMETICKS;
+ break;
+ case 'a':
+ vp->type = ASN_IPADDRESS;
+ break;
+ default:
+ printf
+ ("bad type \"%c\", use \"i\", \"u\", \"s\", \"x\", \"d\", \"n\", \"o\", \"t\", or \"a\".\n",
+ *buf);
+ return -1;
+ }
+ getValue:
+ printf("Value: ");
+ fflush(stdout);
+ if (!fgets(buf, sizeof(buf), stdin)) {
+ printf("Quitting, Goodbye\n");
+ SOCK_CLEANUP;
+ exit(0);
+ }
+ switch (vp->type) {
+ case ASN_INTEGER:
+ vp->val.integer = (long *) malloc(sizeof(long));
+ *(vp->val.integer) = atoi(buf);
+ vp->val_len = sizeof(long);
+ break;
+ case ASN_UNSIGNED:
+ vp->val.integer = (long *) malloc(sizeof(long));
+ *(vp->val.integer) = strtoul(buf, NULL, 0);
+ vp->val_len = sizeof(long);
+ break;
+ case ASN_OCTET_STR:
+ if (ch == 'd') {
+ size_t buf_len = 256;
+ val_len = 0;
+ if ((vp->val.string = (u_char *) malloc(buf_len)) == NULL) {
+ printf("malloc failure\n");
+ goto getValue;
+ }
+ if (!snmp_decimal_to_binary(&(vp->val.string), &buf_len,
+ &val_len, 1, buf)) {
+ printf("Bad value or no sub-identifier > 255\n");
+ free(vp->val.string);
+ goto getValue;
+ }
+ vp->val_len = val_len;
+ } else if (ch == 's') {
+ /*
+ * -1 to omit trailing newline
+ */
+ vp->val.string = (u_char *) malloc(strlen(buf) - 1);
+ if (vp->val.string == NULL) {
+ printf("malloc failure\n");
+ goto getValue;
+ }
+ memcpy(vp->val.string, buf, strlen(buf) - 1);
+ vp->val.string[sizeof(vp->val.string)-1] = 0;
+ vp->val_len = strlen(buf) - 1;
+ } else if (ch == 'x') {
+ size_t buf_len = 256;
+ val_len = 0;
+ if ((vp->val.string = (u_char *) malloc(buf_len)) == NULL) {
+ printf("malloc failure\n");
+ goto getValue;
+ }
+ if (!snmp_hex_to_binary(&(vp->val.string), &buf_len,
+ &val_len, 1, buf)) {
+ printf("Bad value (need pairs of hex digits)\n");
+ free(vp->val.string);
+ goto getValue;
+ }
+ vp->val_len = val_len;
+ }
+ break;
+ case ASN_NULL:
+ vp->val_len = 0;
+ vp->val.string = NULL;
+ break;
+ case ASN_OBJECT_ID:
+ if ('\n' == buf[strlen(buf) - 1])
+ buf[strlen(buf) - 1] = '\0';
+ else {
+ oid value[MAX_OID_LEN];
+ vp->val_len = MAX_OID_LEN;
+ if (0 == read_objid(buf, value, &vp->val_len)) {
+ printf("Unrecognised OID value\n");
+ goto getValue;
+ }
+ vp->val.objid = snmp_duplicate_objid(value, vp->val_len);
+ vp->val_len *= sizeof(oid);
+ }
+ break;
+ case ASN_TIMETICKS:
+ vp->val.integer = (long *) malloc(sizeof(long));
+ *(vp->val.integer) = atoi(buf);
+ vp->val_len = sizeof(long);
+ break;
+ case ASN_IPADDRESS:
+ vp->val.integer = (long *) malloc(sizeof(long));
+ *(vp->val.integer) = inet_addr(buf);
+ vp->val_len = sizeof(long);
+ break;
+ default:
+ printf("Internal error\n");
+ break;
+ }
+ } else { /* some form of get message */
+ vp->type = ASN_NULL;
+ vp->val_len = 0;
+ }
+ return 1;
+}
diff --git a/apps/snmptls.c b/apps/snmptls.c
new file mode 100644
index 0000000..93b648b
--- /dev/null
+++ b/apps/snmptls.c
@@ -0,0 +1,559 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#undef NETSNMP_USE_ASSERT
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+netsnmp_feature_require(tls_fingerprint_build)
+
+#include <ctype.h>
+
+#include <openssl/ssl.h>
+#include <openssl/x509.h>
+#include <net-snmp/library/cert_util.h>
+
+#include "tlstm-mib.h"
+#include "tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable.h"
+#include "tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable.h"
+#include "tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h"
+
+
+
+/*
+#define COL_SNMPTLSTMCERTTOTSN_ID 1
+#define COL_SNMPTLSTMCERTTOTSN_FINGERPRINT 2
+#define COL_SNMPTLSTMCERTTOTSN_MAPTYPE 3
+#define COL_SNMPTLSTMCERTTOTSN_DATA 4
+#define COL_SNMPTLSTMCERTTOTSN_STORAGETYPE 5
+#define COL_SNMPTLSTMCERTTOTSN_ROWSTATUS 6
+*/
+const oid certNum[] = { SNMP_TLS_TM_CERT_COUNT };
+const oid certChg[] = { SNMP_TLS_TM_CERT_CHANGED };
+const oid certTbl[] = { SNMP_TLS_TM_CERT_TABLE };
+
+/*
+#define COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT 1
+#define COLUMN_SNMPTLSTMPARAMSSTORAGETYPE 2
+#define COLUMN_SNMPTLSTMPARAMSROWSTATUS 3
+*/
+
+const oid paramsNum[] = { SNMP_TLS_TM_PARAMS_COUNT };
+const oid paramsChg[] = { SNMP_TLS_TM_PARAMS_CHANGED };
+const oid paramsTbl[] = { SNMP_TLS_TM_PARAMS_TABLE };
+
+const oid addrNum[] = { SNMP_TLS_TM_ADDR_COUNT };
+const oid addrChg[] = { SNMP_TLS_TM_ADDR_CHANGED };
+const oid addrTbl[] = { SNMP_TLS_TM_ADDR_TABLE };
+
+
+const oid tlstmCertSpecified[] = { SNMP_TLS_TM_BASE, 1, 1, 1 };
+const oid tlstmCertSANRFC822Name[] = { SNMP_TLS_TM_BASE, 1, 1, 2 };
+const oid tlstmCertSANDNSName[] = { SNMP_TLS_TM_BASE, 1, 1, 3 };
+const oid tlstmCertSANIpAddress[] = { SNMP_TLS_TM_BASE, 1, 1, 4 };
+const oid tlstmCertSANAny[] = { SNMP_TLS_TM_BASE, 1, 1, 5 };
+const oid tlstmCertCommonName[] = { SNMP_TLS_TM_BASE, 1, 1, 6 };
+
+const oid *certMapTypes[TSNM_tlstmCert_MAX + 1] = {
+ 0, tlstmCertSpecified, tlstmCertSANRFC822Name, tlstmCertSANDNSName,
+ tlstmCertSANIpAddress, tlstmCertSANAny, tlstmCertCommonName };
+
+/** **************************************************************************
+ *
+ * cert rows
+ *
+ */
+netsnmp_variable_list *
+cert_row_create(uint32_t priority, int hash_type, const char *fp,
+ const oid *map_type, int map_type_len, const u_char *data,
+ int data_len, uint32_t st, int *row_status_index)
+{
+ oid name[] = { SNMP_TLS_TM_CERT_TABLE, 1, -1, -1 };
+ int name_len = OID_LENGTH(name), col_pos = name_len - 2;
+ int rs_index = 4;
+ u_char bin_fp[SNMP_MAXBUF_SMALL], *bin_fp_ptr = bin_fp;
+ u_int rs;
+ size_t bin_fp_len;
+ netsnmp_variable_list *vl = NULL, *vb;
+
+ netsnmp_require_ptr_LRV( fp, NULL );
+
+ DEBUGMSGT(("cert:create", "creating varbinds for pri %d, fp %s\n", priority,
+ fp));
+
+ bin_fp_len = sizeof(bin_fp);
+ netsnmp_tls_fingerprint_build(hash_type, fp, &bin_fp_ptr, &bin_fp_len, 0);
+
+ name[name_len-1] = priority;
+ name[col_pos] = COL_SNMPTLSTMCERTTOTSN_FINGERPRINT;
+ vl = snmp_varlist_add_variable(&vl, name, name_len, ASN_OCTET_STR,
+ &bin_fp, bin_fp_len);
+ netsnmp_require_ptr_LRV(vl, NULL);
+
+ if (map_type_len && map_type) {
+ name[col_pos] = COL_SNMPTLSTMCERTTOTSN_MAPTYPE;
+ vb = snmp_varlist_add_variable(&vl, name, name_len, ASN_OBJECT_ID,
+ map_type, map_type_len * sizeof(oid));
+ if (NULL == vb) {
+ snmp_free_varbind(vl);
+ return NULL;
+ }
+ }
+ else
+ --rs_index;
+
+ if (data) {
+ name[col_pos] = COL_SNMPTLSTMCERTTOTSN_DATA;
+ vb = snmp_varlist_add_variable(&vl, name, name_len, ASN_OCTET_STR,
+ data, data_len);
+ if (NULL == vb) {
+ snmp_free_varbind(vl);
+ return NULL;
+ }
+ }
+ else
+ --rs_index;
+
+ if (st) {
+ name[col_pos] = COL_SNMPTLSTMCERTTOTSN_STORAGETYPE;
+ vb = snmp_varlist_add_variable(&vl, name, name_len, ASN_INTEGER,
+ &st, sizeof(st));
+ if (NULL == vb) {
+ snmp_free_varbind(vl);
+ return NULL;
+ }
+ }
+ else
+ --rs_index;
+
+ name[col_pos] = COL_SNMPTLSTMCERTTOTSN_ROWSTATUS;
+ rs = RS_CREATEANDGO;
+ vb = snmp_varlist_add_variable(&vl, name, name_len, ASN_INTEGER,
+ &rs, sizeof(rs));
+ if (NULL == vb) {
+ snmp_free_varbind(vl);
+ return NULL;
+ }
+
+ if (row_status_index)
+ *row_status_index = rs_index;
+
+ return vl;
+}
+
+/** **************************************************************************
+ *
+ * param rows
+ *
+ */
+netsnmp_variable_list *
+params_row_create(const char *param_name, int hash_type, const char *fp,
+ uint32_t st, int *row_status_index)
+{
+ oid name[MAX_OID_LEN];
+ int name_len, col_pos, rs_index = 2;
+ u_char bin_fp[SNMP_MAXBUF_SMALL], *bin_fp_ptr = bin_fp;
+ u_int rs;
+ size_t bin_fp_len;
+ netsnmp_variable_list *vl = NULL, *vb;
+
+ netsnmp_require_ptr_LRV( param_name, NULL );
+ netsnmp_require_ptr_LRV( fp, NULL );
+
+ DEBUGMSGT(("params:create", "creating varbinds for %s params, fp %s\n",
+ param_name, fp));
+
+ /*
+ * build base name
+ */
+ name_len = OID_LENGTH(paramsTbl);
+ memcpy(name, paramsTbl, sizeof(paramsTbl));
+ name[name_len++] = 1; /* entry */
+ col_pos = name_len++; /* column */
+ while (*param_name)
+ name[name_len++] = *param_name++;
+
+ bin_fp_len = sizeof(bin_fp);
+ netsnmp_tls_fingerprint_build(hash_type, fp, &bin_fp_ptr, &bin_fp_len, 0);
+
+ name[col_pos] = COLUMN_SNMPTLSTMPARAMSCLIENTFINGERPRINT;
+ vl = snmp_varlist_add_variable(&vl, name, name_len, ASN_OCTET_STR,
+ &bin_fp, bin_fp_len);
+ netsnmp_require_ptr_LRV(vl, NULL);
+
+ if (st) {
+ name[col_pos] = COLUMN_SNMPTLSTMPARAMSSTORAGETYPE;
+ vb = snmp_varlist_add_variable(&vl, name, name_len, ASN_INTEGER,
+ &st, sizeof(st));
+ if (NULL == vb) {
+ snmp_free_varbind(vl);
+ return NULL;
+ }
+ }
+ else
+ --rs_index;
+
+ name[col_pos] = COLUMN_SNMPTLSTMPARAMSROWSTATUS;
+ rs = RS_CREATEANDGO;
+ vb = snmp_varlist_add_variable(&vl, name, name_len, ASN_INTEGER,
+ &rs, sizeof(rs));
+ if (NULL == vb) {
+ snmp_free_varbind(vl);
+ return NULL;
+ }
+
+ if (row_status_index)
+ *row_status_index = rs_index;
+
+ return vl;
+}
+
+/** **************************************************************************
+ *
+ * addr rows
+ *
+ */
+netsnmp_variable_list *
+addr_row_create(const char *target_name, int hash_type, const char *fp,
+ const char *identity, uint32_t st, int *row_status_index)
+{
+ oid name[MAX_OID_LEN];
+ int name_len, col_pos, rs_index = 3;
+ u_char bin_fp[SNMP_MAXBUF_SMALL], *bin_fp_ptr = bin_fp;
+ u_int rs;
+ size_t bin_fp_len;
+ netsnmp_variable_list *vl = NULL, *vb;
+
+ netsnmp_require_ptr_LRV( target_name, NULL );
+
+ DEBUGMSGT(("addr:create", "creating varbinds for %s addr, fp %s, id %s\n",
+ target_name, fp, identity));
+
+ /*
+ * build base name
+ */
+ name_len = OID_LENGTH(addrTbl);
+ memcpy(name, addrTbl, sizeof(addrTbl));
+ name[name_len++] = 1; /* entry */
+ col_pos = name_len++; /* column */
+ while (*target_name)
+ name[name_len++] = *target_name++;
+
+ if (fp) {
+ bin_fp_len = sizeof(bin_fp);
+ netsnmp_tls_fingerprint_build(hash_type, fp, &bin_fp_ptr,
+ &bin_fp_len, 0);
+
+ name[col_pos] = COLUMN_SNMPTLSTMADDRSERVERFINGERPRINT;
+ vl = snmp_varlist_add_variable(&vl, name, name_len, ASN_OCTET_STR,
+ &bin_fp, bin_fp_len);
+ netsnmp_require_ptr_LRV(vl, NULL);
+ }
+ else
+ --rs_index;
+
+ if (identity) {
+ name[col_pos] = COLUMN_SNMPTLSTMADDRSERVERIDENTITY;
+ vl = snmp_varlist_add_variable(&vl, name, name_len, ASN_OCTET_STR,
+ identity, strlen(identity));
+ netsnmp_require_ptr_LRV(vl, NULL);
+ }
+ else
+ --rs_index;
+
+ if (st) {
+ name[col_pos] = COLUMN_SNMPTLSTMADDRSTORAGETYPE;
+ vb = snmp_varlist_add_variable(&vl, name, name_len, ASN_INTEGER,
+ &st, sizeof(st));
+ if (NULL == vb) {
+ snmp_free_varbind(vl);
+ return NULL;
+ }
+ }
+ else
+ --rs_index;
+
+ name[col_pos] = COLUMN_SNMPTLSTMADDRROWSTATUS;
+ rs = RS_CREATEANDGO;
+ vb = snmp_varlist_add_variable(&vl, name, name_len, ASN_INTEGER,
+ &rs, sizeof(rs));
+ if (NULL == vb) {
+ snmp_free_varbind(vl);
+ return NULL;
+ }
+
+ if (row_status_index)
+ *row_status_index = rs_index;
+
+ return vl;
+}
+
+/** **************************************************************************
+ *
+ * application code
+ *
+ */
+static char *_data = NULL, *_map_type_str = NULL, *_id_str = NULL;
+static char *_storage_type_str = NULL, *_fp_str = NULL;
+static int _storage_type = ST_NONE, _hash_type = NS_HASH_NONE;
+static size_t _data_len;
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ if ('C' != opt)
+ return;
+
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'm':
+ if (optind < argc)
+ _map_type_str = argv[optind++];
+ else {
+ fprintf(stderr, "Bad -Cm option: no argument given\n");
+ exit(1);
+ }
+ break;
+
+ case 'd':
+ if (optind < argc) {
+ _data = argv[optind++];
+ _data_len = strlen(_data);
+ }
+ else {
+ fprintf(stderr, "Bad -Cd option: no argument given\n");
+ exit(1);
+ }
+ break;
+
+ case 's':
+ if (optind < argc) {
+ if (isdigit(0xFF & argv[optind][0]))
+ _storage_type = atoi(argv[optind++]);
+ else
+ _storage_type_str = argv[optind++];
+ }
+ else {
+ fprintf(stderr, "Bad -Cs option: no argument given\n");
+ exit(1);
+ }
+ break;
+
+ case 'h':
+ if (optind < argc) {
+ if (isdigit(0xFF & argv[optind][0]))
+ _hash_type = atoi(argv[optind++]);
+ }
+ else {
+ fprintf(stderr, "Bad -Ch option: no argument given\n");
+ exit(1);
+ }
+ break;
+
+ case 'f':
+ if (optind < argc)
+ _fp_str = argv[optind++];
+ else {
+ fprintf(stderr, "Bad -Cf option: no argument given\n");
+ exit(1);
+ }
+ break;
+
+ case 'i':
+ if (optind < argc)
+ _id_str = argv[optind++];
+ else {
+ fprintf(stderr, "Bad -Ci option: no argument given\n");
+ exit(1);
+ }
+ break;
+
+ default:
+ fprintf(stderr, "Unknown flag passed to -C: %c\n",
+ optarg[-1]);
+ exit(1);
+ }
+ }
+}
+
+void
+_parse_storage_type(const char *arg)
+{
+ netsnmp_pdu dummy;
+ oid name[] = { SNMP_TLS_TM_CERT_TABLE, 1,
+ COL_SNMPTLSTMCERTTOTSN_STORAGETYPE };
+ int name_len = OID_LENGTH(name);
+
+ if (NULL == arg)
+ return;
+
+ memset(&dummy, 0x00, sizeof(dummy));
+ snmp_add_var(&dummy, name, name_len, 'i', arg);
+ if (dummy.variables) {
+ _storage_type = *dummy.variables->val.integer;
+ snmp_free_varbind(dummy.variables);
+ }
+ else {
+ fprintf(stderr, "unknown storage type %s for -Cs\n", arg);
+ exit(1);
+ }
+
+ return;
+}
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmptls [-Cm mapTypeOID] [-Cd data] [-Cs storageType] ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, "<command> [command options]\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr, " [options] certToSecName add <priority> <hashType> <fingerprint>\n");
+ fprintf(stderr, "\t-Cm\t\tMaptype; [snmpTlstmCertCommonName|snmpTlstmCertSANRFC822Name|snmpTlstmCertSANIpAddress|snmpTlstmCertSANDNSName|snmpTlstmCertSpecified]\n");
+ fprintf(stderr, "\t\t\t(default is snmpTlstmCertSpecified)\n");
+ fprintf(stderr, "\t-Cd\t\tData; data for snmpTlstmCertSpecified.\n");
+ fprintf(stderr, "\t-Cs\t\tstorageType; default is nonVolatile.\n");
+
+ fprintf(stderr, " [options] targetParamsFingerprint add <params-name> <hashType> <fingerprint>\n");
+ fprintf(stderr, "\t-Cs\t\tstorageType; default is nonVolatile.\n");
+
+ fprintf(stderr, " [options] targetAddr add <target-name> <hashType> [<hash_type> <remote-fingerprint>] [server-identity]\n");
+ fprintf(stderr, "\t-Cs\t\tstorageType; default is nonVolatile.\n");
+
+ exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+ netsnmp_session session, *ss;
+ netsnmp_variable_list *var_list = NULL;
+ int arg, rs_idx;
+ u_int hash_type;
+ char *fingerprint, *tmp;
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ default:
+ break;
+ }
+
+ /*
+ * Open an SNMP session.
+ */
+ SOCK_STARTUP;
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmptls", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ if (strcmp(argv[arg], "certToSecName") == 0) {
+
+ oid map_type[MAX_OID_LEN];
+ u_int pri;
+ size_t map_type_len;
+
+ if (strcmp(argv[++arg], "add") != 0) {
+ fprintf(stderr, "only add is supported at this time\n");
+ exit(1);
+ }
+
+ pri = atoi(argv[++arg]);
+ tmp = argv[++arg];
+ hash_type = atoi(tmp);
+ fingerprint = argv[++arg];
+
+ DEBUGMSGT(("snmptls",
+ "create pri %d, hash type %d, fp %s",
+ pri, hash_type, fingerprint));
+ if (_map_type_str) {
+ map_type_len = MAX_OID_LEN;
+ if (snmp_parse_oid(_map_type_str, map_type, &map_type_len)
+ == NULL) {
+ snmp_perror(_map_type_str);
+ exit(1);
+ }
+ DEBUGMSG(("snmptls", ", map type "));
+ DEBUGMSGOID(("snmptls", map_type, map_type_len));
+ }
+ if (_data)
+ DEBUGMSG(("snmptls", ", data %s", _data));
+
+ _parse_storage_type(_storage_type_str);
+
+ DEBUGMSG(("snmptls", "\n"));
+ var_list = cert_row_create(pri, hash_type, fingerprint, map_type,
+ map_type_len, (u_char*)_data, _data_len,
+ _storage_type, &rs_idx);
+ }
+ else if (strcmp(argv[arg], "targetParamsFingerprint") == 0) {
+
+ char * params_name;
+
+ if (strcmp(argv[++arg], "add") != 0) {
+ fprintf(stderr, "only add is supported at this time\n");
+ exit(1);
+ }
+
+ params_name = argv[++arg];
+ hash_type = atoi(argv[++arg]);
+ fingerprint = argv[++arg];
+
+ _parse_storage_type(_storage_type_str);
+
+ DEBUGMSGT(("snmptls",
+ "create %s param fp, hash type %d, fp %s\n",
+ params_name, hash_type, fingerprint));
+
+ var_list = params_row_create(params_name, hash_type, fingerprint,
+ _storage_type, &rs_idx);
+ }
+
+ else if (strcmp(argv[arg], "targetAddr") == 0) {
+
+ char * addr_name;
+
+ if (strcmp(argv[++arg], "add") != 0) {
+ fprintf(stderr, "only add is supported at this time\n");
+ exit(1);
+ }
+
+ addr_name = argv[++arg];
+
+ _parse_storage_type(_storage_type_str);
+
+ DEBUGMSGT(("snmptls",
+ "create %s addr fp, hash type %d, fp %s, id %s\n",
+ addr_name, _hash_type, _fp_str, _id_str));
+
+ var_list = addr_row_create(addr_name, _hash_type, _fp_str, _id_str,
+ _storage_type, &rs_idx);
+ }
+
+ if (! var_list) {
+ fprintf(stderr, "no command specified\n");
+ usage();
+ }
+
+ netsnmp_row_create(ss, var_list, rs_idx);
+
+ SOCK_CLEANUP;
+ return 0;
+}
diff --git a/apps/snmptranslate.c b/apps/snmptranslate.c
new file mode 100644
index 0000000..c3d47ae
--- /dev/null
+++ b/apps/snmptranslate.c
@@ -0,0 +1,367 @@
+/*
+ * snmptranslate.c - report or translate info about oid from mibs
+ *
+ * Update: 1998-07-17 <jhy@gsu.edu>
+ * Added support for dumping alternate oid reports (-t and -T options).
+ * Added more detailed (useful?) usage info.
+ */
+/************************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+
+
+#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
+#include <sys/types.h>
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#include <net-snmp/utilities.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/mib_api.h>
+
+int show_all_matched_objects(FILE *, const char *, oid *,
+ size_t *, int, int);
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmptranslate [OPTIONS] OID [OID]...\n\n");
+ fprintf(stderr, " Version: %s\n", netsnmp_get_version());
+ fprintf(stderr, " Web: http://www.net-snmp.org/\n");
+ fprintf(stderr,
+ " Email: net-snmp-coders@lists.sourceforge.net\n\nOPTIONS:\n");
+
+ fprintf(stderr, " -h\t\t\tdisplay this help message\n");
+ fprintf(stderr, " -V\t\t\tdisplay package version number\n");
+ fprintf(stderr,
+ " -m MIB[:...]\t\tload given list of MIBs (ALL loads everything)\n");
+ fprintf(stderr,
+ " -M DIR[:...]\t\tlook in given list of directories for MIBs\n");
+ fprintf(stderr,
+ " -D[TOKEN[,...]]\tturn on debugging output for the specified TOKENs\n\t\t\t (ALL gives extremely verbose debugging output)\n");
+ fprintf(stderr, " -w WIDTH\t\tset width of tree and detail output\n");
+ fprintf(stderr,
+ " -T TRANSOPTS\t\tSet various options controlling report produced:\n");
+ fprintf(stderr,
+ "\t\t\t B: print all matching objects for a regex search\n");
+ fprintf(stderr, "\t\t\t d: print full details of the given OID\n");
+ fprintf(stderr, "\t\t\t p: print tree format symbol table\n");
+ fprintf(stderr, "\t\t\t a: print ASCII format symbol table\n");
+ fprintf(stderr, "\t\t\t l: enable labeled OID report\n");
+ fprintf(stderr, "\t\t\t o: enable OID report\n");
+ fprintf(stderr, "\t\t\t s: enable dotted symbolic report\n");
+ fprintf(stderr, "\t\t\t z: enable MIB child OID report\n");
+ fprintf(stderr,
+ "\t\t\t t: enable alternate format symbolic suffix report\n");
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ fprintf(stderr,
+ " -P MIBOPTS\t\tToggle various defaults controlling mib parsing:\n");
+ snmp_mib_toggle_options_usage("\t\t\t ", stderr);
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ fprintf(stderr,
+ " -O OUTOPTS\t\tToggle various defaults controlling output display:\n");
+ snmp_out_toggle_options_usage("\t\t\t ", stderr);
+ fprintf(stderr,
+ " -I INOPTS\t\tToggle various defaults controlling input parsing:\n");
+ snmp_in_toggle_options_usage("\t\t\t ", stderr);
+ fprintf(stderr,
+ " -L LOGOPTS\t\tToggle various defaults controlling logging:\n");
+ snmp_log_options_usage("\t\t\t ", stderr);
+ exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int arg;
+ char *current_name = NULL, *cp = NULL;
+ oid name[MAX_OID_LEN];
+ size_t name_length;
+ int description = 0;
+ int print = 0;
+ int find_all = 0;
+ int width = 1000000;
+
+ /*
+ * usage: snmptranslate name
+ */
+ while ((arg = getopt(argc, argv, "Vhm:M:w:D:P:T:O:I:L:")) != EOF) {
+ switch (arg) {
+ case 'h':
+ usage();
+ exit(1);
+
+ case 'm':
+ setenv("MIBS", optarg, 1);
+ break;
+ case 'M':
+ setenv("MIBDIRS", optarg, 1);
+ break;
+ case 'D':
+ debug_register_tokens(optarg);
+ snmp_set_do_debugging(1);
+ break;
+ case 'V':
+ fprintf(stderr, "NET-SNMP version: %s\n",
+ netsnmp_get_version());
+ exit(0);
+ break;
+ case 'w':
+ width = atoi(optarg);
+ if (width <= 0) {
+ fprintf(stderr, "Invalid width specification: %s\n", optarg);
+ exit (1);
+ }
+ break;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ case 'P':
+ cp = snmp_mib_toggle_options(optarg);
+ if (cp != NULL) {
+ fprintf(stderr, "Unknown parser option to -P: %c.\n", *cp);
+ usage();
+ exit(1);
+ }
+ break;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ case 'O':
+ cp = snmp_out_toggle_options(optarg);
+ if (cp != NULL) {
+ fprintf(stderr, "Unknown OID option to -O: %c.\n", *cp);
+ usage();
+ exit(1);
+ }
+ break;
+ case 'I':
+ cp = snmp_in_toggle_options(optarg);
+ if (cp != NULL) {
+ fprintf(stderr, "Unknown OID option to -I: %c.\n", *cp);
+ usage();
+ exit(1);
+ }
+ break;
+ case 'T':
+ for (cp = optarg; *cp; cp++) {
+ switch (*cp) {
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ case 'l':
+ print = 3;
+ print_oid_report_enable_labeledoid();
+ break;
+ case 'o':
+ print = 3;
+ print_oid_report_enable_oid();
+ break;
+ case 's':
+ print = 3;
+ print_oid_report_enable_symbolic();
+ break;
+ case 't':
+ print = 3;
+ print_oid_report_enable_suffix();
+ break;
+ case 'z':
+ print = 3;
+ print_oid_report_enable_mibchildoid();
+ break;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ case 'd':
+ description = 1;
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS, 1);
+ break;
+ case 'B':
+ find_all = 1;
+ break;
+ case 'p':
+ print = 1;
+ break;
+ case 'a':
+ print = 2;
+ break;
+ default:
+ fprintf(stderr, "Invalid -T<lostpad> character: %c\n",
+ *cp);
+ usage();
+ exit(1);
+ break;
+ }
+ }
+ break;
+ case 'L':
+ if (snmp_log_options(optarg, argc, argv) < 0) {
+ return (-1);
+ }
+ break;
+ default:
+ fprintf(stderr, "invalid option: -%c\n", arg);
+ usage();
+ exit(1);
+ break;
+ }
+ }
+
+ init_snmp("snmpapp");
+ if (optind < argc)
+ current_name = argv[optind];
+
+ if (current_name == NULL) {
+ switch (print) {
+ default:
+ usage();
+ exit(1);
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ case 1:
+ print_mib_tree(stdout, get_tree_head(), width);
+ break;
+ case 2:
+ print_ascii_dump(stdout);
+ break;
+ case 3:
+ print_oid_report(stdout);
+ break;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ }
+ exit(0);
+ }
+
+ do {
+ name_length = MAX_OID_LEN;
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_RANDOM_ACCESS)) {
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (!get_node(current_name, name, &name_length)) {
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ fprintf(stderr, "Unknown object identifier: %s\n",
+ current_name);
+ exit(2);
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ } else if (find_all) {
+ if (0 == show_all_matched_objects(stdout, current_name,
+ name, &name_length,
+ description, width)) {
+ fprintf(stderr,
+ "Unable to find a matching object identifier for \"%s\"\n",
+ current_name);
+ exit(1);
+ }
+ exit(0);
+ } else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_REGEX_ACCESS)) {
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (0 == get_wild_node(current_name, name, &name_length)) {
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ fprintf(stderr,
+ "Unable to find a matching object identifier for \"%s\"\n",
+ current_name);
+ exit(1);
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ } else {
+ if (!read_objid(current_name, name, &name_length)) {
+ snmp_perror(current_name);
+ exit(2);
+ }
+ }
+
+
+ if (print == 1) {
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ struct tree *tp;
+ tp = get_tree(name, name_length, get_tree_head());
+ if (tp == NULL) {
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ snmp_log(LOG_ERR,
+ "Unable to find a matching object identifier for \"%s\"\n",
+ current_name);
+ exit(1);
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ }
+ print_mib_tree(stdout, tp, width);
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ } else {
+ print_objid(name, name_length);
+ if (description) {
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ print_description(name, name_length, width);
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ }
+ }
+ current_name = argv[++optind];
+ if (current_name != NULL)
+ printf("\n");
+ } while (optind < argc);
+
+ return (0);
+}
+
+/*
+ * Show all object identifiers that match the pattern.
+ */
+
+int
+show_all_matched_objects(FILE * fp, const char *patmatch, oid * name, size_t * name_length, int f_desc, /* non-zero if descriptions should be shown */
+ int width)
+{
+ int result = 0, count = 0;
+ size_t savlen = *name_length;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ clear_tree_flags(get_tree_head());
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+ while (1) {
+ *name_length = savlen;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ result = get_wild_node(patmatch, name, name_length);
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ if (!result)
+ break;
+ count++;
+
+ fprint_objid(fp, name, *name_length);
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (f_desc)
+ fprint_description(fp, name, *name_length, width);
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ }
+
+ return (count);
+}
diff --git a/apps/snmptrap.c b/apps/snmptrap.c
new file mode 100644
index 0000000..7c086db
--- /dev/null
+++ b/apps/snmptrap.c
@@ -0,0 +1,392 @@
+/*
+ * snmptrap.c - send snmp traps to a network entity.
+ *
+ */
+/******************************************************************
+ Copyright 1989, 1991, 1992 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.
+******************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+# include <netinet/in.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include <stdio.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+oid objid_enterprise[] = { 1, 3, 6, 1, 4, 1, 3, 1, 1 };
+oid objid_sysdescr[] = { 1, 3, 6, 1, 2, 1, 1, 1, 0 };
+oid objid_sysuptime[] = { 1, 3, 6, 1, 2, 1, 1, 3, 0 };
+oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+int inform = 0;
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: %s ", inform ? "snmpinform" : "snmptrap");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " TRAP-PARAMETERS\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr,
+ " -C APPOPTS\t\tSet various application specific behaviour:\n");
+ fprintf(stderr, "\t\t\t i: send an INFORM instead of a TRAP\n");
+ fprintf(stderr,
+ "\n -v 1 TRAP-PARAMETERS:\n\t enterprise-oid agent trap-type specific-type uptime [OID TYPE VALUE]...\n");
+ fprintf(stderr, " or\n");
+ fprintf(stderr,
+ " -v 2 TRAP-PARAMETERS:\n\t uptime trapoid [OID TYPE VALUE] ...\n");
+}
+
+int
+snmp_input(int operation,
+ netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu, void *magic)
+{
+ return 1;
+}
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'i':
+ inform = 1;
+ break;
+ default:
+ fprintf(stderr,
+ "Unknown flag passed to -C: %c\n", optarg[-1]);
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu, *response;
+ oid name[MAX_OID_LEN];
+ size_t name_length;
+ int arg;
+ int status;
+ char *trap = NULL;
+ char *prognam;
+ int exitval = 0;
+#ifndef NETSNMP_DISABLE_SNMPV1
+ char *specific = NULL, *description = NULL, *agent = NULL;
+ in_addr_t *pdu_in_addr_t;
+#endif
+
+ prognam = strrchr(argv[0], '/');
+ if (prognam)
+ prognam++;
+ else
+ prognam = argv[0];
+
+ putenv(strdup("POSIXLY_CORRECT=1"));
+
+ if (strcmp(prognam, "snmpinform") == 0)
+ inform = 1;
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ SOCK_STARTUP;
+
+ session.callback = snmp_input;
+ session.callback_magic = NULL;
+
+ /*
+ * setup the local engineID which may be for either or both of the
+ * contextEngineID and/or the securityEngineID.
+ */
+ setup_engineID(NULL, NULL);
+
+ /* if we don't have a contextEngineID set via command line
+ arguments, use our internal engineID as the context. */
+ if (session.contextEngineIDLen == 0 ||
+ session.contextEngineID == NULL) {
+ session.contextEngineID =
+ snmpv3_generate_engineID(&session.contextEngineIDLen);
+ }
+
+ if (session.version == SNMP_VERSION_3 && !inform) {
+ /*
+ * for traps, we use ourselves as the authoritative engine
+ * which is really stupid since command line apps don't have a
+ * notion of a persistent engine. Hence, our boots and time
+ * values are probably always really wacked with respect to what
+ * a manager would like to see.
+ *
+ * The following should be enough to:
+ *
+ * 1) prevent the library from doing discovery for engineid & time.
+ * 2) use our engineid instead of the remote engineid for
+ * authoritative & privacy related operations.
+ * 3) The remote engine must be configured with users for our engineID.
+ *
+ * -- Wes
+ */
+
+ /*
+ * pick our own engineID
+ */
+ if (session.securityEngineIDLen == 0 ||
+ session.securityEngineID == NULL) {
+ session.securityEngineID =
+ snmpv3_generate_engineID(&session.securityEngineIDLen);
+ }
+
+ /*
+ * set boots and time, which will cause problems if this
+ * machine ever reboots and a remote trap receiver has cached our
+ * boots and time... I'll cause a not-in-time-window report to
+ * be sent back to this machine.
+ */
+ if (session.engineBoots == 0)
+ session.engineBoots = 1;
+ if (session.engineTime == 0) /* not really correct, */
+ session.engineTime = get_uptime(); /* but it'll work. Sort of. */
+ }
+
+ ss = snmp_add(&session,
+ netsnmp_transport_open_client("snmptrap", session.peername),
+ NULL, NULL);
+ if (ss == NULL) {
+ /*
+ * diagnose netsnmp_transport_open_client and snmp_add errors with
+ * the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmptrap", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (session.version == SNMP_VERSION_1) {
+ if (inform) {
+ fprintf(stderr, "Cannot send INFORM as SNMPv1 PDU\n");
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ pdu = snmp_pdu_create(SNMP_MSG_TRAP);
+ if ( !pdu ) {
+ fprintf(stderr, "Failed to create trap PDU\n");
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ pdu_in_addr_t = (in_addr_t *) pdu->agent_addr;
+ if (arg == argc) {
+ fprintf(stderr, "No enterprise oid\n");
+ usage();
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ if (argv[arg][0] == 0) {
+ pdu->enterprise = (oid *) malloc(sizeof(objid_enterprise));
+ memcpy(pdu->enterprise, objid_enterprise,
+ sizeof(objid_enterprise));
+ pdu->enterprise_length =
+ sizeof(objid_enterprise) / sizeof(oid);
+ } else {
+ name_length = MAX_OID_LEN;
+ if (!snmp_parse_oid(argv[arg], name, &name_length)) {
+ snmp_perror(argv[arg]);
+ usage();
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ pdu->enterprise = (oid *) malloc(name_length * sizeof(oid));
+ memcpy(pdu->enterprise, name, name_length * sizeof(oid));
+ pdu->enterprise_length = name_length;
+ }
+ if (++arg >= argc) {
+ fprintf(stderr, "Missing agent parameter\n");
+ usage();
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ agent = argv[arg];
+ if (agent != NULL && strlen(agent) != 0) {
+ int ret = netsnmp_gethostbyname_v4(agent, pdu_in_addr_t);
+ if (ret < 0) {
+ fprintf(stderr, "unknown host: %s\n", agent);
+ exit(1);
+ }
+ } else {
+ *pdu_in_addr_t = get_myaddr();
+ }
+ if (++arg == argc) {
+ fprintf(stderr, "Missing generic-trap parameter\n");
+ usage();
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ trap = argv[arg];
+ pdu->trap_type = atoi(trap);
+ if (++arg == argc) {
+ fprintf(stderr, "Missing specific-trap parameter\n");
+ usage();
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ specific = argv[arg];
+ pdu->specific_type = atoi(specific);
+ if (++arg == argc) {
+ fprintf(stderr, "Missing uptime parameter\n");
+ usage();
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ description = argv[arg];
+ if (description == NULL || *description == 0)
+ pdu->time = get_uptime();
+ else
+ pdu->time = atol(description);
+ } else
+#endif
+ {
+ long sysuptime;
+ char csysuptime[20];
+
+ pdu = snmp_pdu_create(inform ? SNMP_MSG_INFORM : SNMP_MSG_TRAP2);
+ if ( !pdu ) {
+ fprintf(stderr, "Failed to create notification PDU\n");
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ if (arg == argc) {
+ fprintf(stderr, "Missing up-time parameter\n");
+ usage();
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ trap = argv[arg];
+ if (*trap == 0) {
+ sysuptime = get_uptime();
+ sprintf(csysuptime, "%ld", sysuptime);
+ trap = csysuptime;
+ }
+ snmp_add_var(pdu, objid_sysuptime,
+ sizeof(objid_sysuptime) / sizeof(oid), 't', trap);
+ if (++arg == argc) {
+ fprintf(stderr, "Missing trap-oid parameter\n");
+ usage();
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ if (snmp_add_var
+ (pdu, objid_snmptrap, sizeof(objid_snmptrap) / sizeof(oid),
+ 'o', argv[arg]) != 0) {
+ snmp_perror(argv[arg]);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ }
+ arg++;
+
+ while (arg < argc) {
+ arg += 3;
+ if (arg > argc) {
+ fprintf(stderr, "%s: Missing type/value for variable\n",
+ argv[arg - 3]);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ name_length = MAX_OID_LEN;
+ if (!snmp_parse_oid(argv[arg - 3], name, &name_length)) {
+ snmp_perror(argv[arg - 3]);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ if (snmp_add_var
+ (pdu, name, name_length, argv[arg - 2][0],
+ argv[arg - 1]) != 0) {
+ snmp_perror(argv[arg - 3]);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+ }
+
+ if (inform)
+ status = snmp_synch_response(ss, pdu, &response);
+ else
+ status = snmp_send(ss, pdu) == 0;
+ if (status) {
+ snmp_sess_perror(inform ? "snmpinform" : "snmptrap", ss);
+ if (!inform)
+ snmp_free_pdu(pdu);
+ exitval = 1;
+ } else if (inform)
+ snmp_free_pdu(response);
+
+ snmp_close(ss);
+ snmp_shutdown("snmpapp");
+ SOCK_CLEANUP;
+ return exitval;
+}
diff --git a/apps/snmptrapd.c b/apps/snmptrapd.c
new file mode 100644
index 0000000..1a52080
--- /dev/null
+++ b/apps/snmptrapd.c
@@ -0,0 +1,1464 @@
+/*
+ * snmptrapd.c - receive and log snmp traps
+ *
+ */
+/*****************************************************************
+ Copyright 1989, 1991, 1992 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.
+******************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#if !defined(mingw32) && defined(HAVE_SYS_TIME_H)
+# include <sys/time.h>
+# if TIME_WITH_SYS_TIME
+# include <time.h>
+# endif
+#else
+# include <time.h>
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_PROCESS_H /* Win32-getpid */
+#include <process.h>
+#endif
+#if HAVE_PWD_H
+#include <pwd.h>
+#endif
+#if HAVE_GRP_H
+#include <grp.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 <net-snmp/library/fd_event_manager.h>
+#include "snmptrapd_handlers.h"
+#include "snmptrapd_log.h"
+#include "snmptrapd_auth.h"
+#include "notification-log-mib/notification_log.h"
+#include "tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable.h"
+#include "mibII/vacm_conf.h"
+#ifdef NETSNMP_EMBEDDED_PERL
+#include "snmp_perl.h"
+#endif
+
+/*
+ * Include winservice.h to support Windows Service
+ */
+#ifdef WIN32
+#include <windows.h>
+#include <tchar.h>
+#include <net-snmp/library/winservice.h>
+
+#define WIN32SERVICE
+
+#endif
+
+#if NETSNMP_USE_LIBWRAP
+#include <tcpd.h>
+#endif
+
+#include <net-snmp/net-snmp-features.h>
+
+#ifndef BSD4_3
+#define BSD4_2
+#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
+
+char *logfile = NULL;
+extern int SyslogTrap;
+extern int dropauth;
+static int reconfig = 0;
+char ddefault_port[] = "udp:162"; /* Default default port */
+char *default_port = ddefault_port;
+#if HAVE_GETPID
+ FILE *PID;
+ char *pid_file = NULL;
+#endif
+extern void parse_format(const char *token, char *line);
+char *trap1_fmt_str_remember = NULL;
+int dofork = 1;
+
+extern int netsnmp_running;
+
+#ifdef NETSNMP_USE_MYSQL
+extern int netsnmp_mysql_init(void);
+extern void snmptrapd_register_sql_configs( void );
+#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
+
+/*
+ * Include an extra Facility variable to allow command line adjustment of
+ * syslog destination
+ */
+int Facility = LOG_DAEMON;
+
+#ifdef WIN32SERVICE
+/*
+ * SNMP Trap Receiver Status
+ */
+#define SNMPTRAPD_RUNNING 1
+#define SNMPTRAPD_STOPPED 0
+int trapd_status = SNMPTRAPD_STOPPED;
+/* app_name_long used for SCM, registry etc */
+LPCTSTR app_name_long = _T("Net-SNMP Trap Handler"); /* Application Name */
+#endif
+
+const char *app_name = "snmptrapd";
+
+void trapd_update_config(void);
+
+#ifdef WIN32SERVICE
+void StopSnmpTrapd(void);
+int SnmpTrapdMain(int argc, TCHAR * argv[]);
+int __cdecl _tmain(int argc, TCHAR * argv[]);
+#else
+int main(int, char **);
+#endif
+
+#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(NETSNMP_SNMPTRAPD_DISABLE_AGENTX)
+extern void subagent_init(void);
+#endif
+
+
+void
+usage(void)
+{
+#ifdef WIN32SERVICE
+ fprintf(stderr, "\nUsage: snmptrapd [-register] [-quiet] [OPTIONS] [LISTENING ADDRESSES]");
+ fprintf(stderr, "\n snmptrapd [-unregister] [-quiet]");
+#else
+ fprintf(stderr, "Usage: snmptrapd [OPTIONS] [LISTENING ADDRESSES]\n");
+#endif
+ fprintf(stderr, "\n\tNET-SNMP Version: %s\n", netsnmp_get_version());
+ fprintf(stderr, "\tWeb: http://www.net-snmp.org/\n");
+ fprintf(stderr, "\tEmail: net-snmp-coders@lists.sourceforge.net\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, " -a\t\t\tignore authentication failure traps\n");
+ fprintf(stderr, " -A\t\t\tappend to log file rather than truncating it\n");
+ fprintf(stderr, " -c FILE\t\tread FILE as a configuration file\n");
+ fprintf(stderr,
+ " -C\t\t\tdo not read the default configuration files\n");
+ fprintf(stderr, " -d\t\t\tdump sent and received SNMP packets\n");
+ fprintf(stderr, " -D[TOKEN[,...]]\t\tturn on debugging output for the specified TOKENs\n\t\t\t (ALL gives extremely verbose debugging output)\n");
+ fprintf(stderr, " -f\t\t\tdo not fork from the shell\n");
+ fprintf(stderr,
+ " -F FORMAT\t\tuse specified format for logging to standard error\n");
+#if HAVE_UNISTD_H
+ fprintf(stderr, " -g GID\t\tchange to this numeric gid after opening\n"
+ "\t\t\t transport endpoints\n");
+#endif
+ fprintf(stderr, " -h, --help\t\tdisplay this usage message\n");
+ fprintf(stderr,
+ " -H\t\t\tdisplay configuration file directives understood\n");
+ fprintf(stderr,
+ " -m MIBLIST\t\tuse MIBLIST instead of the default MIB list\n");
+ fprintf(stderr,
+ " -M DIRLIST\t\tuse DIRLIST as the list of locations\n\t\t\t to look for MIBs\n");
+ fprintf(stderr,
+ " -n\t\t\tuse numeric addresses instead of attempting\n\t\t\t hostname lookups (no DNS)\n");
+#if HAVE_GETPID
+ fprintf(stderr, " -p FILE\t\tstore process id in FILE\n");
+#endif
+#ifdef WIN32SERVICE
+ fprintf(stderr, " -register\t\tregister as a Windows service\n");
+ fprintf(stderr, " \t\t\t (followed by -quiet to prevent message popups)\n");
+ fprintf(stderr, " \t\t\t (followed by the startup parameter list)\n");
+ fprintf(stderr, " \t\t\t Note that some parameters are not relevant when running as a service\n");
+#endif
+ fprintf(stderr, " -t\t\t\tPrevent traps from being logged to syslog\n");
+#if HAVE_UNISTD_H
+ fprintf(stderr, " -u UID\t\tchange to this uid (numeric or textual) after\n"
+ "\t\t\t opening transport endpoints\n");
+#endif
+#ifdef WIN32SERVICE
+ fprintf(stderr, " -unregister\t\tunregister as a Windows service\n");
+ fprintf(stderr, " \t\t\t (followed -quiet to prevent message popups)\n");
+#endif
+ fprintf(stderr, " -v, --version\t\tdisplay version information\n");
+#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(NETSNMP_SNMPTRAPD_DISABLE_AGENTX)
+ fprintf(stderr, " -x ADDRESS\t\tuse ADDRESS as AgentX address\n");
+#endif
+ fprintf(stderr,
+ " -O <OUTOPTS>\t\ttoggle options controlling output display\n");
+ snmp_out_toggle_options_usage("\t\t\t", stderr);
+ fprintf(stderr,
+ " -L <LOGOPTS>\t\ttoggle options controlling where to log to\n");
+ snmp_log_options_usage("\t\t\t", stderr);
+}
+
+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
+term_handler(int sig)
+{
+#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
+hup_handler(int sig)
+{
+ reconfig = 1;
+ signal(SIGHUP, hup_handler);
+}
+#endif
+
+static int
+pre_parse(netsnmp_session * session, netsnmp_transport *transport,
+ void *transport_data, int transport_data_length)
+{
+#if NETSNMP_USE_LIBWRAP
+ char *addr_string = NULL;
+
+ 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.
+ */
+ }
+
+ if (addr_string != NULL) {
+ /* Catch udp,udp6,tcp,tcp6 transports using "[" */
+ char *tcpudpaddr = strstr(addr_string, "[");
+ if ( tcpudpaddr != 0 ) {
+ char sbuf[64];
+ char *xp;
+
+ strlcpy(sbuf, tcpudpaddr + 1, sizeof(sbuf));
+ xp = strstr(sbuf, "]");
+ if (xp)
+ *xp = '\0';
+
+ if (hosts_ctl("snmptrapd", STRING_UNKNOWN,
+ sbuf, STRING_UNKNOWN) == 0) {
+ DEBUGMSGTL(("snmptrapd:libwrap", "%s rejected", addr_string));
+ SNMP_FREE(addr_string);
+ return 0;
+ }
+ }
+ SNMP_FREE(addr_string);
+ } else {
+ if (hosts_ctl("snmptrapd", STRING_UNKNOWN,
+ STRING_UNKNOWN, STRING_UNKNOWN) == 0) {
+ DEBUGMSGTL(("snmptrapd:libwrap", "[unknown] rejected"));
+ return 0;
+ }
+ }
+#endif/* NETSNMP_USE_LIBWRAP */
+ return 1;
+}
+
+static netsnmp_session *
+snmptrapd_add_session(netsnmp_transport *t)
+{
+ netsnmp_session sess, *session = &sess, *rc = NULL;
+
+ snmp_sess_init(session);
+ session->peername = SNMP_DEFAULT_PEERNAME; /* Original code had NULL here */
+ session->version = SNMP_DEFAULT_VERSION;
+ session->community_len = SNMP_DEFAULT_COMMUNITY_LEN;
+ session->retries = SNMP_DEFAULT_RETRIES;
+ session->timeout = SNMP_DEFAULT_TIMEOUT;
+ session->callback = snmp_input;
+ session->callback_magic = (void *) t;
+ session->authenticator = NULL;
+ sess.isAuthoritative = SNMP_SESS_UNKNOWNAUTH;
+
+ rc = snmp_add(session, t, pre_parse, NULL);
+ if (rc == NULL) {
+ snmp_sess_perror("snmptrapd", session);
+ }
+ return rc;
+}
+
+static void
+snmptrapd_close_sessions(netsnmp_session * sess_list)
+{
+ netsnmp_session *s = NULL, *next = NULL;
+
+ for (s = sess_list; s != NULL; s = next) {
+ next = s->next;
+ snmp_close(s);
+ }
+}
+
+void
+parse_trapd_address(const char *token, char *cptr)
+{
+ char buf[BUFSIZ];
+ char *p;
+ cptr = copy_nword(cptr, buf, sizeof(buf));
+
+ if (default_port == ddefault_port) {
+ default_port = strdup(buf);
+ } else {
+ p = malloc(strlen(buf) + 1 + strlen(default_port) + 1);
+ if (p) {
+ strcat(p, buf);
+ strcat(p, ",");
+ strcat(p, default_port );
+ }
+ free(default_port);
+ default_port = p;
+ }
+}
+
+void
+free_trapd_address(void)
+{
+ if (default_port != ddefault_port) {
+ free(default_port);
+ }
+}
+
+void
+parse_config_doNotLogTraps(const char *token, char *cptr)
+{
+ if (atoi(cptr) > 0)
+ SyslogTrap++;
+}
+
+void
+free_config_pidFile(void)
+{
+ if (pid_file)
+ free(pid_file);
+ pid_file = NULL;
+}
+
+void
+parse_config_pidFile(const char *token, char *cptr)
+{
+ free_config_pidFile();
+ pid_file = strdup (cptr);
+}
+
+#ifdef HAVE_UNISTD_H
+void
+parse_config_agentuser(const char *token, char *cptr)
+{
+ 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 {
+ struct passwd *info;
+
+ info = getpwnam(cptr);
+ if (info)
+ 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
+parse_config_agentgroup(const char *token, char *cptr)
+{
+ 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 {
+ struct group *info;
+
+ info = getgrnam(cptr);
+ if (info)
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_GROUPID, info->gr_gid);
+ else
+ config_perror("Group not found in group database");
+ endgrent();
+#endif
+ }
+}
+#endif
+
+void
+parse_config_doNotFork(const char *token, char *cptr)
+{
+ if (netsnmp_ds_parse_boolean(cptr) == 1)
+ dofork = 0;
+}
+
+void
+parse_config_ignoreAuthFailure(const char *token, char *cptr)
+{
+ if (netsnmp_ds_parse_boolean(cptr) == 1)
+ dropauth = 1;
+}
+
+void
+parse_config_outputOption(const char *token, char *cptr)
+{
+ char *cp;
+
+ cp = snmp_out_toggle_options(cptr);
+ if (cp != NULL) {
+ fprintf(stderr, "Unknown output option passed to -O: %c\n",
+ *cp);
+ }
+}
+
+static void
+snmptrapd_main_loop(void)
+{
+ int count, numfds, block;
+ fd_set readfds,writefds,exceptfds;
+ struct timeval timeout, *tvp;
+
+ while (netsnmp_running) {
+ if (reconfig) {
+ /*
+ * If we are logging to a file, receipt of SIGHUP also
+ * indicates that the log file should be closed and
+ * re-opened. This is useful for users that want to
+ * rotate logs in a more predictable manner.
+ */
+ netsnmp_logging_restart();
+ snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n",
+ netsnmp_get_version());
+ trapd_update_config();
+ if (trap1_fmt_str_remember) {
+ parse_format( NULL, trap1_fmt_str_remember );
+ }
+ reconfig = 0;
+ }
+ numfds = 0;
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptfds);
+ block = 0;
+ tvp = &timeout;
+ timerclear(tvp);
+ tvp->tv_sec = 5;
+ snmp_select_info(&numfds, &readfds, tvp, &block);
+ if (block == 1)
+ tvp = NULL; /* block without timeout */
+#ifndef NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER
+ netsnmp_external_event_info(&numfds, &readfds, &writefds, &exceptfds);
+#endif /* NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER */
+ count = select(numfds, &readfds, &writefds, &exceptfds, tvp);
+ if (count > 0) {
+#ifndef NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER
+ netsnmp_dispatch_external_events(&count, &readfds, &writefds,
+ &exceptfds);
+#endif /* NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER */
+ /* If there are any more events after external events, then
+ * try SNMP events. */
+ if (count > 0) {
+ snmp_read(&readfds);
+ }
+ } else {
+ switch (count) {
+ case 0:
+ snmp_timeout();
+ break;
+ case -1:
+ if (errno == EINTR)
+ continue;
+ snmp_log_perror("select");
+ netsnmp_running = 0;
+ break;
+ default:
+ fprintf(stderr, "select returned %d\n", count);
+ netsnmp_running = 0;
+ }
+ }
+ run_alarms();
+ }
+}
+
+/*******************************************************************-o-******
+ * main - Non Windows
+ * SnmpTrapdMain - Windows to support windows service
+ *
+ * Parameters:
+ * argc
+ * *argv[]
+ *
+ * Returns:
+ * 0 Always succeeds. (?)
+ *
+ *
+ * Setup and start the trap receiver daemon.
+ *
+ * Also successfully EXITs with zero for some options.
+ */
+int
+#ifdef WIN32SERVICE
+SnmpTrapdMain(int argc, TCHAR * argv[])
+#else
+main(int argc, char *argv[])
+#endif
+{
+ char options[128] = "aAc:CdD::efF:g:hHI:L:m:M:no:O:PqsS:tu:vx:-:";
+ netsnmp_session *sess_list = NULL, *ss = NULL;
+ netsnmp_transport *transport = NULL;
+ int arg, i = 0;
+ int uid = 0, gid = 0;
+ char *cp, *listen_ports = NULL;
+#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(NETSNMP_SNMPTRAPD_DISABLE_AGENTX)
+ int agentx_subagent = 1;
+#endif
+ netsnmp_trapd_handler *traph;
+
+
+#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 */
+
+#ifdef SIGTERM
+ signal(SIGTERM, term_handler);
+#endif
+#ifdef SIGHUP
+ signal(SIGHUP, SIG_IGN); /* do not terminate on early SIGHUP */
+#endif
+
+#ifdef SIGINT
+ signal(SIGINT, term_handler);
+#endif
+#ifdef SIGPIPE
+ signal(SIGPIPE, SIG_IGN); /* 'Inline' failure of wayward readers */
+#endif
+
+ /*
+ * register our configuration handlers now so -H properly displays them
+ */
+ snmptrapd_register_configs( );
+#ifdef NETSNMP_USE_MYSQL
+ snmptrapd_register_sql_configs( );
+#endif
+#ifdef NETSNMP_SECMOD_USM
+ init_usm_conf( "snmptrapd" );
+#endif /* NETSNMP_SECMOD_USM */
+ register_config_handler("snmptrapd", "snmpTrapdAddr",
+ parse_trapd_address, free_trapd_address, "string");
+
+ register_config_handler("snmptrapd", "doNotLogTraps",
+ parse_config_doNotLogTraps, NULL, "(1|yes|true|0|no|false)");
+#if HAVE_GETPID
+ register_config_handler("snmptrapd", "pidFile",
+ parse_config_pidFile, NULL, "string");
+#endif
+#ifdef HAVE_UNISTD_H
+ register_config_handler("snmptrapd", "agentuser",
+ parse_config_agentuser, NULL, "userid");
+ register_config_handler("snmptrapd", "agentgroup",
+ parse_config_agentgroup, NULL, "groupid");
+#endif
+
+ register_config_handler("snmptrapd", "doNotFork",
+ parse_config_doNotFork, NULL, "(1|yes|true|0|no|false)");
+
+ register_config_handler("snmptrapd", "ignoreAuthFailure",
+ parse_config_ignoreAuthFailure, NULL, "(1|yes|true|0|no|false)");
+
+ register_config_handler("snmptrapd", "outputOption",
+ parse_config_outputOption, NULL, "string");
+
+ /*
+ * Add some options if they are available.
+ */
+#if HAVE_GETPID
+ strcat(options, "p:");
+#endif
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+#ifdef WIN32
+ snmp_log_syslogname(app_name_long);
+#else
+ snmp_log_syslogname(app_name);
+#endif
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+ /*
+ * Now process options normally.
+ */
+
+ while ((arg = getopt(argc, argv, options)) != EOF) {
+ switch (arg) {
+ case '-':
+ if (strcasecmp(optarg, "help") == 0) {
+ usage();
+ exit(0);
+ }
+ if (strcasecmp(optarg, "version") == 0) {
+ version();
+ exit(0);
+ }
+
+ handle_long_opt(optarg);
+ break;
+
+ case 'a':
+ dropauth = 1;
+ 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();
+ exit(1);
+ }
+ break;
+
+ case 'C':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_READ_CONFIGS, 1);
+ break;
+
+ case 'd':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET, 1);
+ break;
+
+ case 'D':
+ debug_register_tokens(optarg);
+ snmp_set_do_debugging(1);
+ break;
+
+ case 'f':
+ dofork = 0;
+ break;
+
+ case 'F':
+ if (optarg != NULL) {
+ if (( strncmp( optarg, "print", 5 ) == 0 ) ||
+ ( strncmp( optarg, "syslog", 6 ) == 0 ) ||
+ ( strncmp( optarg, "execute", 7 ) == 0 )) {
+ /* New style: "type=format" */
+ trap1_fmt_str_remember = strdup(optarg);
+ cp = strchr( trap1_fmt_str_remember, '=' );
+ if (cp)
+ *cp = ' ';
+ } else {
+ /* Old style: implicitly "print=format" */
+ trap1_fmt_str_remember = malloc(strlen(optarg) + 7);
+ sprintf( trap1_fmt_str_remember, "print %s", optarg );
+ }
+ } else {
+ usage();
+ exit(1);
+ }
+ break;
+
+#if HAVE_UNISTD_H
+ case 'g':
+ if (optarg != NULL) {
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_GROUPID, gid = atoi(optarg));
+ } else {
+ usage();
+ exit(1);
+ }
+ break;
+#endif
+
+ case 'h':
+ usage();
+ exit(0);
+
+ case 'H':
+ init_agent("snmptrapd");
+#ifdef USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE
+ init_notification_log();
+#endif
+#ifdef NETSNMP_EMBEDDED_PERL
+ init_perl();
+#endif
+ init_snmp("snmptrapd");
+ fprintf(stderr, "Configuration directives understood:\n");
+ read_config_print_usage(" ");
+ exit(0);
+
+ case 'I':
+ if (optarg != NULL) {
+ add_to_init_list(optarg);
+ } else {
+ usage();
+ }
+ break;
+
+ case 'S':
+ fprintf(stderr,
+ "Warning: -S option has been withdrawn; use -Ls <facility> instead\n");
+ exit(1);
+ break;
+
+ case 'm':
+ if (optarg != NULL) {
+ setenv("MIBS", optarg, 1);
+ } else {
+ usage();
+ exit(1);
+ }
+ break;
+
+ case 'M':
+ if (optarg != NULL) {
+ setenv("MIBDIRS", optarg, 1);
+ } else {
+ usage();
+ exit(1);
+ }
+ break;
+
+ case 'n':
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_NUMERIC_IP, 1);
+ break;
+
+ case 'o':
+ fprintf(stderr,
+ "Warning: -o option has been withdrawn; use -Lf <file> instead\n");
+ exit(1);
+ break;
+
+ case 'O':
+ cp = snmp_out_toggle_options(optarg);
+ if (cp != NULL) {
+ fprintf(stderr, "Unknown output option passed to -O: %c\n",
+ *cp);
+ usage();
+ exit(1);
+ }
+ break;
+
+ case 'L':
+ if (snmp_log_options( optarg, argc, argv ) < 0 ) {
+ usage();
+ exit(1);
+ }
+ break;
+
+#if HAVE_GETPID
+ case 'p':
+ if (optarg != NULL) {
+ parse_config_pidFile(NULL, optarg);
+ } else {
+ usage();
+ exit(1);
+ }
+ break;
+#endif
+
+ case 'P':
+ fprintf(stderr,
+ "Warning: -P option has been withdrawn; use -f -Le instead\n");
+ exit(1);
+ break;
+
+ case 's':
+ fprintf(stderr,
+ "Warning: -s option has been withdrawn; use -Lsd instead\n");
+ exit(1);
+ break;
+
+ case 't':
+ SyslogTrap++;
+ break;
+
+#if HAVE_UNISTD_H
+ case 'u':
+ if (optarg != NULL) {
+ char *ecp;
+
+ uid = strtoul(optarg, &ecp, 10);
+#if HAVE_GETPWNAM && HAVE_PWD_H
+ if (*ecp) {
+ struct passwd *info;
+
+ info = getpwnam(optarg);
+ uid = info ? info->pw_uid : -1;
+ endpwent();
+ }
+#endif
+ if (uid < 0) {
+ fprintf(stderr, "Bad user id: %s\n", optarg);
+ exit(1);
+ }
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_USERID, uid);
+ } else {
+ usage();
+ exit(1);
+ }
+ break;
+#endif
+
+ case 'v':
+ version();
+ exit(0);
+ break;
+
+ case 'x':
+ if (optarg != NULL) {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET, optarg);
+ } else {
+ usage();
+ exit(1);
+ }
+ break;
+
+ default:
+ fprintf(stderr, "invalid option: -%c\n", arg);
+ usage();
+ exit(1);
+ break;
+ }
+ }
+
+ if (optind < argc) {
+ /*
+ * There are optional transport addresses on the command line.
+ */
+ for (i = optind; i < argc; i++) {
+ char *astring;
+ if (listen_ports != NULL) {
+ astring = malloc(strlen(listen_ports) + 2 + strlen(argv[i]));
+ if (astring == NULL) {
+ fprintf(stderr, "malloc failure processing argv[%d]\n", i);
+ exit(1);
+ }
+ sprintf(astring, "%s,%s", listen_ports, argv[i]);
+ free(listen_ports);
+ listen_ports = astring;
+ } else {
+ listen_ports = strdup(argv[i]);
+ if (listen_ports == NULL) {
+ fprintf(stderr, "malloc failure processing argv[%d]\n", i);
+ exit(1);
+ }
+ }
+ }
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * I'm being lazy here, and not checking the
+ * return value from these registration calls.
+ * Don't try this at home, children!
+ */
+ if (0 == snmp_get_do_logging()) {
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+ traph = netsnmp_add_global_traphandler(NETSNMPTRAPD_PRE_HANDLER,
+ syslog_handler);
+ traph->authtypes = TRAP_AUTH_LOG;
+ snmp_enable_syslog();
+#else /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+ traph = netsnmp_add_global_traphandler(NETSNMPTRAPD_PRE_HANDLER,
+ print_handler);
+ traph->authtypes = TRAP_AUTH_LOG;
+ snmp_enable_stderr();
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+ } else {
+ traph = netsnmp_add_global_traphandler(NETSNMPTRAPD_PRE_HANDLER,
+ print_handler);
+ traph->authtypes = TRAP_AUTH_LOG;
+ }
+
+#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(NETSNMP_SNMPTRAPD_DISABLE_AGENTX)
+ /*
+ * we're an agentx subagent?
+ */
+ if (agentx_subagent) {
+ /*
+ * make us a agentx client.
+ */
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE, 1);
+ }
+#endif
+
+ /*
+ * don't fail if we can't do agentx (ie, socket not there, or not root)
+ */
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS);
+ /*
+ * ignore any warning messages.
+ */
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS);
+
+ /*
+ * initialize the agent library
+ */
+ init_agent("snmptrapd");
+
+#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(NETSNMP_SNMPTRAPD_DISABLE_AGENTX)
+#ifdef NETSNMP_FEATURE_CHECKING
+ netsnmp_feature_require(register_snmpEngine_scalars_context)
+#endif /* NETSNMP_FEATURE_CHECKING */
+ /*
+ * initialize local modules
+ */
+ if (agentx_subagent) {
+#ifdef USING_SNMPV3_SNMPENGINE_MODULE
+ extern void register_snmpEngine_scalars_context(const char *);
+#endif
+ subagent_init();
+#ifdef USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE
+ /* register the notification log table */
+ if (should_init("notificationLogMib")) {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_NOTIF_LOG_CTX,
+ "snmptrapd");
+ traph = netsnmp_add_global_traphandler(NETSNMPTRAPD_POST_HANDLER,
+ notification_handler);
+ traph->authtypes = TRAP_AUTH_LOG;
+ init_notification_log();
+ }
+#endif
+#ifdef USING_SNMPV3_SNMPENGINE_MODULE
+ /*
+ * register scalars from SNMP-FRAMEWORK-MIB::snmpEngineID group;
+ * allows engineID probes via the master agent under the
+ * snmptrapd context
+ */
+ register_snmpEngine_scalars_context("snmptrapd");
+#endif
+ }
+#endif /* USING_AGENTX_SUBAGENT_MODULE && !NETSNMP_SNMPTRAPD_DISABLE_AGENTX */
+
+ /* register our authorization handler */
+ init_netsnmp_trapd_auth();
+
+#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(NETSNMP_SNMPTRAPD_DISABLE_AGENTX)
+ if (agentx_subagent) {
+#ifdef USING_AGENT_NSVACMACCESSTABLE_MODULE
+ extern void init_register_nsVacm_context(const char *);
+#endif
+#ifdef USING_SNMPV3_USMUSER_MODULE
+#ifdef NETSNMP_FEATURE_CHECKING
+ netsnmp_feature_require(init_register_usmUser_context)
+#endif /* NETSNMP_FEATURE_CHECKING */
+ extern void init_register_usmUser_context(const char *);
+ /* register ourselves as having a USM user database */
+ init_register_usmUser_context("snmptrapd");
+#endif
+#ifdef USING_AGENT_NSVACMACCESSTABLE_MODULE
+ /* register net-snmp vacm extensions */
+ init_register_nsVacm_context("snmptrapd");
+#endif
+#ifdef USING_TLSTM_MIB_SNMPTLSTMCERTTOTSNTABLE_MODULE
+ init_snmpTlstmCertToTSNTable_context("snmptrapd");
+#endif
+ }
+#endif
+
+#ifdef NETSNMP_EMBEDDED_PERL
+ init_perl();
+ {
+ /* set the default path to load */
+ char init_file[SNMP_MAXBUF];
+ snprintf(init_file, sizeof(init_file) - 1,
+ "%s/%s", SNMPSHAREPATH, "snmp_perl_trapd.pl");
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PERL_INIT_FILE,
+ init_file);
+ }
+#endif
+
+ /*
+ * Initialize the world.
+ */
+ init_snmp("snmptrapd");
+
+#ifdef SIGHUP
+ signal(SIGHUP, hup_handler);
+#endif
+
+ if (trap1_fmt_str_remember) {
+ parse_format( NULL, trap1_fmt_str_remember );
+ }
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY)) {
+ /*
+ * just starting up to process specific configuration and then
+ * shutting down immediately.
+ */
+ netsnmp_running = 0;
+ }
+
+ /*
+ * if no logging options on command line or in conf files, use syslog
+ */
+ if (0 == snmp_get_do_logging()) {
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+#ifdef WIN32
+ snmp_enable_syslog_ident(app_name_long, Facility);
+#else
+ snmp_enable_syslog_ident(app_name, Facility);
+#endif
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+ }
+
+ if (listen_ports)
+ cp = listen_ports;
+ else
+ cp = default_port;
+
+ while (cp != NULL) {
+ char *sep = strchr(cp, ',');
+
+ if (sep != NULL) {
+ *sep = 0;
+ }
+
+ transport = netsnmp_transport_open_server("snmptrap", cp);
+ if (transport == NULL) {
+ snmp_log(LOG_ERR, "couldn't open %s -- errno %d (\"%s\")\n",
+ cp, errno, strerror(errno));
+ snmptrapd_close_sessions(sess_list);
+ SOCK_CLEANUP;
+ exit(1);
+ } else {
+ ss = snmptrapd_add_session(transport);
+ if (ss == NULL) {
+ /*
+ * Shouldn't happen? We have already opened the transport
+ * successfully so what could have gone wrong?
+ */
+ snmptrapd_close_sessions(sess_list);
+ netsnmp_transport_free(transport);
+ snmp_log(LOG_ERR, "couldn't open snmp - %s", strerror(errno));
+ SOCK_CLEANUP;
+ exit(1);
+ } else {
+ ss->next = sess_list;
+ sess_list = ss;
+ }
+ }
+
+ /*
+ * Process next listen address, if there is one.
+ */
+
+ if (sep != NULL) {
+ *sep = ',';
+ cp = sep + 1;
+ } else {
+ cp = NULL;
+ }
+ }
+ SNMP_FREE(listen_ports); /* done with them */
+
+#ifdef NETSNMP_USE_MYSQL
+ if( netsnmp_mysql_init() ) {
+ fprintf(stderr, "MySQL initialization failed\n");
+ exit(1);
+ }
+#endif
+
+#ifndef WIN32
+ /*
+ * fork the process to the background if we are not printing to stderr
+ */
+ if (dofork && netsnmp_running) {
+ int fd;
+
+ switch (fork()) {
+ case -1:
+ fprintf(stderr, "bad fork - %s\n", strerror(errno));
+ _exit(1);
+
+ case 0:
+ /*
+ * become process group leader
+ */
+ if (setsid() == -1) {
+ fprintf(stderr, "bad setsid - %s\n", strerror(errno));
+ _exit(1);
+ }
+
+ /*
+ * if we are forked, we don't want to print out to stdout or stderr
+ */
+ fd = open("/dev/null", O_RDWR);
+ dup2(fd, STDIN_FILENO);
+ dup2(fd, STDOUT_FILENO);
+ dup2(fd, STDERR_FILENO);
+ close(fd);
+ break;
+
+ default:
+ _exit(0);
+ }
+ }
+#endif /* WIN32 */
+#if HAVE_GETPID
+ if (pid_file != NULL) {
+ if ((PID = fopen(pid_file, "w")) == NULL) {
+ snmp_log_perror("fopen");
+ exit(1);
+ }
+ fprintf(PID, "%d\n", (int) getpid());
+ fclose(PID);
+ free_config_pidFile();
+ }
+#endif
+
+ snmp_log(LOG_INFO, "NET-SNMP version %s\n", netsnmp_get_version());
+
+ /*
+ * ignore early sighup during startup
+ */
+ reconfig = 0;
+
+#if HAVE_UNISTD_H
+#ifdef HAVE_SETGID
+ if ((gid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_GROUPID)) != 0) {
+ DEBUGMSGTL(("snmptrapd/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(("snmptrapd/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
+
+#ifdef WIN32SERVICE
+ trapd_status = SNMPTRAPD_RUNNING;
+#endif
+
+ snmptrapd_main_loop();
+
+ if (snmp_get_do_logging()) {
+ struct tm *tm;
+ time_t timer;
+ time(&timer);
+ tm = localtime(&timer);
+ snmp_log(LOG_INFO,
+ "%.4d-%.2d-%.2d %.2d:%.2d:%.2d NET-SNMP version %s Stopped.\n",
+ tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
+ tm->tm_min, tm->tm_sec, netsnmp_get_version());
+ }
+ snmp_log(LOG_INFO, "Stopping snmptrapd\n");
+
+#ifdef NETSNMP_EMBEDDED_PERL
+ shutdown_perl();
+#endif
+ snmptrapd_close_sessions(sess_list);
+ snmp_shutdown("snmptrapd");
+#ifdef WIN32SERVICE
+ trapd_status = SNMPTRAPD_STOPPED;
+#endif
+ snmp_disable_log();
+ SOCK_CLEANUP;
+ return 0;
+}
+
+/*
+ * Read the configuration files. Implemented as a signal handler so that
+ * receipt of SIGHUP will cause configuration to be re-read when the
+ * trap daemon is running detatched from the console.
+ *
+ */
+void
+trapd_update_config(void)
+{
+ free_config();
+#ifdef USING_MIBII_VACM_CONF_MODULE
+ vacm_standard_views(0,0,NULL,NULL);
+#endif
+ read_configs();
+}
+
+
+#if !defined(HAVE_GETDTABLESIZE) && !defined(WIN32)
+#include <sys/resource.h>
+int
+getdtablesize(void)
+{
+ struct rlimit rl;
+ getrlimit(RLIMIT_NOFILE, &rl);
+ return (rl.rlim_cur);
+}
+#endif
+
+/*
+ * 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 Trap Handler"); /* Display Name */
+ LPCTSTR lpszServiceDescription =
+#ifdef IFDESCR
+ _T("SNMPv2c / SNMPv3 trap/inform receiver from Net-SNMP. Supports MIB objects for IP,ICMP,TCP,UDP, and network interface sub-layers.");
+#else
+ _T("SNMPv2c / SNMPv3 trap/inform receiver 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));
+ exit(0);
+ break;
+ case RUN_AS_SERVICE:
+ /*
+ * Run as service
+ */
+ /*
+ * Register Stop Function
+ */
+ RegisterStopFunction(StopSnmpTrapd);
+ return RunAsService(SnmpTrapdMain);
+ break;
+ default:
+ /*
+ * Run in console mode
+ */
+ return SnmpTrapdMain(argc, argv);
+ break;
+ }
+}
+
+/*
+ * To stop Snmp Trap Receiver daemon
+ * This portion is still not working
+ */
+void
+StopSnmpTrapd(void)
+{
+ /*
+ * Shut Down Service
+ */
+ term_handler(1);
+
+ /*
+ * Wait till trap receiver is completely stopped
+ */
+
+ while (trapd_status != SNMPTRAPD_STOPPED) {
+ Sleep(100);
+ }
+}
+
+#endif /*WIN32SERVICE*/
diff --git a/apps/snmptrapd_auth.c b/apps/snmptrapd_auth.c
new file mode 100644
index 0000000..be21e5e
--- /dev/null
+++ b/apps/snmptrapd_auth.c
@@ -0,0 +1,182 @@
+/*
+ * snmptrapd_auth.c - authorize notifications for further processing
+ *
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#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 "snmptrapd_handlers.h"
+#include "snmptrapd_auth.h"
+#include "snmptrapd_ds.h"
+
+#include <net-snmp/agent/agent_module_config.h>
+#include <net-snmp/agent/mib_module_config.h>
+
+#ifdef USING_MIBII_VACM_CONF_MODULE
+#include "mibII/vacm_conf.h"
+#endif
+
+#include <net-snmp/agent/agent_trap.h>
+
+/**
+ * initializes the snmptrapd authorization code registering needed
+ * handlers and config parsers.
+ */
+void
+init_netsnmp_trapd_auth(void)
+{
+ /* register our function as a authorization handler */
+ netsnmp_trapd_handler *traph;
+ traph = netsnmp_add_global_traphandler(NETSNMPTRAPD_AUTH_HANDLER,
+ netsnmp_trapd_auth);
+ traph->authtypes = TRAP_AUTH_NONE;
+
+#ifdef USING_MIBII_VACM_CONF_MODULE
+ /* register our configuration tokens for VACM configs */
+ init_vacm_config_tokens();
+#endif
+
+ /* register a config token for turning off the authorization entirely */
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmptrapd", "disableAuthorization",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_NO_AUTHORIZATION);
+}
+
+/* XXX: store somewhere in the PDU instead */
+static int lastlookup;
+
+/**
+ * Authorizes incoming notifications for further processing
+ */
+int
+netsnmp_trapd_auth(netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler)
+{
+ int ret = 0;
+ oid snmptrapoid[] = { 1,3,6,1,6,3,1,1,4,1,0 };
+ size_t snmptrapoid_len = OID_LENGTH(snmptrapoid);
+ int i;
+ netsnmp_pdu *newpdu = pdu;
+ netsnmp_variable_list *var;
+
+ /* check to see if authorization was not disabled */
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_NO_AUTHORIZATION)) {
+ DEBUGMSGTL(("snmptrapd:auth",
+ "authorization turned off: not checking\n"));
+ return NETSNMPTRAPD_HANDLER_OK;
+ }
+
+ /* bail early if called illegally */
+ if (!pdu || !transport || !handler)
+ return NETSNMPTRAPD_HANDLER_FINISH;
+
+ /* convert to v2 so we can check it in a consistent manner */
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (pdu->version == SNMP_VERSION_1) {
+ newpdu = convert_v1pdu_to_v2(pdu);
+ if (!newpdu) {
+ snmp_log(LOG_ERR, "Failed to duplicate incoming PDU. Refusing to authorize.\n");
+ return NETSNMPTRAPD_HANDLER_FINISH;
+ }
+ }
+#endif
+
+ if (!vacm_is_configured()) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (newpdu != pdu)
+ snmp_free_pdu(newpdu);
+#endif
+ snmp_log(LOG_WARNING, "No access configuration - dropping trap.\n");
+ return NETSNMPTRAPD_HANDLER_FINISH;
+ }
+
+ /* loop through each variable and find the snmpTrapOID.0 var
+ indicating what the trap is we're staring at. */
+ for (var = newpdu->variables; var != NULL; var = var->next_variable) {
+ if (netsnmp_oid_equals(var->name, var->name_length,
+ snmptrapoid, snmptrapoid_len) == 0)
+ break;
+ }
+
+ /* make sure we can continue: we found the snmpTrapOID.0 and its an oid */
+ if (!var || var->type != ASN_OBJECT_ID) {
+ snmp_log(LOG_ERR, "Can't determine trap identifier; refusing to authorize it\n");
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (newpdu != pdu)
+ snmp_free_pdu(newpdu);
+#endif
+ return NETSNMPTRAPD_HANDLER_FINISH;
+ }
+
+#ifdef USING_MIBII_VACM_CONF_MODULE
+ /* check the pdu against each typo of VACM access we may want to
+ check up on later. We cache the results for future lookup on
+ each call to netsnmp_trapd_check_auth */
+ for(i = 0; i < VACM_MAX_VIEWS; i++) {
+ /* pass the PDU to the VACM routine for handling authorization */
+ DEBUGMSGTL(("snmptrapd:auth", "Calling VACM for checking phase %d:%s\n",
+ i, se_find_label_in_slist(VACM_VIEW_ENUM_NAME, i)));
+ if (vacm_check_view_contents(newpdu, var->val.objid,
+ var->val_len/sizeof(oid), 0, i,
+ VACM_CHECK_VIEW_CONTENTS_DNE_CONTEXT_OK)
+ == VACM_SUCCESS) {
+ DEBUGMSGTL(("snmptrapd:auth", " result: authorized\n"));
+ ret |= 1 << i;
+ } else {
+ DEBUGMSGTL(("snmptrapd:auth", " result: not authorized\n"));
+ }
+ }
+ DEBUGMSGTL(("snmptrapd:auth", "Final bitmask auth: %x\n", ret));
+#endif
+
+ if (ret) {
+ /* we have policy to at least do "something". Remember and continue. */
+ lastlookup = ret;
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (newpdu != pdu)
+ snmp_free_pdu(newpdu);
+#endif
+ return NETSNMPTRAPD_HANDLER_OK;
+ }
+
+ /* No policy was met, so we drop the PDU from further processing */
+ DEBUGMSGTL(("snmptrapd:auth", "Dropping unauthorized message\n"));
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (newpdu != pdu)
+ snmp_free_pdu(newpdu);
+#endif
+ return NETSNMPTRAPD_HANDLER_FINISH;
+}
+
+/**
+ * Checks to see if the pdu is authorized for a set of given action types.
+ * @returns 1 if authorized, 0 if not.
+ */
+int
+netsnmp_trapd_check_auth(int authtypes)
+{
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_NO_AUTHORIZATION)) {
+ DEBUGMSGTL(("snmptrapd:auth", "authorization turned off\n"));
+ return 1;
+ }
+
+ DEBUGMSGTL(("snmptrapd:auth",
+ "Comparing auth types: result=%d, request=%d, result=%d\n",
+ lastlookup, authtypes,
+ ((authtypes & lastlookup) == authtypes)));
+ return ((authtypes & lastlookup) == authtypes);
+}
+
diff --git a/apps/snmptrapd_auth.h b/apps/snmptrapd_auth.h
new file mode 100644
index 0000000..07427b2
--- /dev/null
+++ b/apps/snmptrapd_auth.h
@@ -0,0 +1,16 @@
+#ifndef SNMPTRAPD_AUTH_H
+#define SNMPTRAPD_AUTH_H
+
+void init_netsnmp_trapd_auth(void);
+int netsnmp_trapd_auth(netsnmp_pdu *pdu, netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler);
+int netsnmp_trapd_check_auth(int authtypes);
+
+#define TRAP_AUTH_LOG (1 << VACM_VIEW_LOG) /* displaying and logging */
+#define TRAP_AUTH_EXE (1 << VACM_VIEW_EXECUTE) /* executing code or binaries */
+#define TRAP_AUTH_NET (1 << VACM_VIEW_NET) /* forwarding and net access */
+
+#define TRAP_AUTH_ALL (TRAP_AUTH_LOG | TRAP_AUTH_EXE | TRAP_AUTH_NET)
+#define TRAP_AUTH_NONE 0
+
+#endif /* SNMPTRAPD_AUTH_H */
diff --git a/apps/snmptrapd_ds.h b/apps/snmptrapd_ds.h
new file mode 100644
index 0000000..03eba14
--- /dev/null
+++ b/apps/snmptrapd_ds.h
@@ -0,0 +1,19 @@
+#ifndef SNMPTRAPD_DS_H
+#define SNMPTRAPD_DS_H
+
+/* booleans
+ *
+ * WARNING: These must not conflict with the agent's DS booleans
+ * If you define additional entries here, check in <agent/ds_agent.h> first
+ * (and consider repeating the definitions there) */
+
+#define NETSNMP_DS_APP_NUMERIC_IP 16
+#define NETSNMP_DS_APP_NO_AUTHORIZATION 17
+
+/*
+ * NB: The NETSNMP_DS_APP_NO_AUTHORIZATION definition is repeated
+ * in the code file agent/mibgroup/mibII/vacm_conf.c
+ * If this definition is changed, it should be updated there too.
+ */
+
+#endif /* SNMPTRAPD_DS_H */
diff --git a/apps/snmptrapd_handlers.c b/apps/snmptrapd_handlers.c
new file mode 100644
index 0000000..5a8e3c8
--- /dev/null
+++ b/apps/snmptrapd_handlers.c
@@ -0,0 +1,1109 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#include <net-snmp/config_api.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/mib_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "utilities/execute.h"
+#include "snmptrapd_handlers.h"
+#include "snmptrapd_auth.h"
+#include "snmptrapd_log.h"
+#include "notification-log-mib/notification_log.h"
+
+netsnmp_feature_child_of(add_default_traphandler, snmptrapd)
+
+char *syslog_format1 = NULL;
+char *syslog_format2 = NULL;
+char *print_format1 = NULL;
+char *print_format2 = NULL;
+char *exec_format1 = NULL;
+char *exec_format2 = NULL;
+
+int SyslogTrap = 0;
+int dropauth = 0;
+
+const char *trap1_std_str = "%.4y-%.2m-%.2l %.2h:%.2j:%.2k %B [%b] (via %A [%a]): %N\n\t%W Trap (%q) Uptime: %#T\n%v\n";
+const char *trap2_std_str = "%.4y-%.2m-%.2l %.2h:%.2j:%.2k %B [%b]:\n%v\n";
+
+void snmptrapd_free_traphandle(void);
+
+const char *
+trap_description(int trap)
+{
+ switch (trap) {
+ case SNMP_TRAP_COLDSTART:
+ return "Cold Start";
+ case SNMP_TRAP_WARMSTART:
+ return "Warm Start";
+ case SNMP_TRAP_LINKDOWN:
+ return "Link Down";
+ case SNMP_TRAP_LINKUP:
+ return "Link Up";
+ case SNMP_TRAP_AUTHFAIL:
+ return "Authentication Failure";
+ case SNMP_TRAP_EGPNEIGHBORLOSS:
+ return "EGP Neighbor Loss";
+ case SNMP_TRAP_ENTERPRISESPECIFIC:
+ return "Enterprise Specific";
+ default:
+ return "Unknown Type";
+ }
+}
+
+
+
+void
+snmptrapd_parse_traphandle(const char *token, char *line)
+{
+ char buf[STRINGMAX];
+ oid obuf[MAX_OID_LEN];
+ size_t olen = MAX_OID_LEN;
+ char *cptr, *cp;
+ netsnmp_trapd_handler *traph;
+ int flags = 0;
+ char *format = NULL;
+
+ memset( buf, 0, sizeof(buf));
+ memset(obuf, 0, sizeof(obuf));
+ cptr = copy_nword(line, buf, sizeof(buf));
+
+ if ( buf[0] == '-' && buf[1] == 'F' ) {
+ cptr = copy_nword(cptr, buf, sizeof(buf));
+ format = strdup( buf );
+ cptr = copy_nword(cptr, buf, sizeof(buf));
+ }
+ if ( !cptr ) {
+ netsnmp_config_error("Missing traphandle command (%s)", buf);
+ return;
+ }
+
+ DEBUGMSGTL(("read_config:traphandle", "registering handler for: "));
+ if (!strcmp(buf, "default")) {
+ DEBUGMSG(("read_config:traphandle", "default"));
+ traph = netsnmp_add_global_traphandler(NETSNMPTRAPD_DEFAULT_HANDLER,
+ command_handler );
+ } else {
+ cp = buf+strlen(buf)-1;
+ if ( *cp == '*' ) {
+ flags |= NETSNMP_TRAPHANDLER_FLAG_MATCH_TREE;
+ *(cp--) = '\0';
+ if ( *cp == '.' ) {
+ /*
+ * Distinguish between 'oid.*' & 'oid*'
+ */
+ flags |= NETSNMP_TRAPHANDLER_FLAG_STRICT_SUBTREE;
+ *(cp--) = '\0';
+ }
+ }
+ if (!read_objid(buf, obuf, &olen)) {
+ netsnmp_config_error("Bad trap OID in traphandle directive: %s",
+ buf);
+ return;
+ }
+ DEBUGMSGOID(("read_config:traphandle", obuf, olen));
+ traph = netsnmp_add_traphandler( command_handler, obuf, olen );
+ }
+
+ DEBUGMSG(("read_config:traphandle", "\n"));
+
+ if (traph) {
+ traph->flags = flags;
+ traph->authtypes = TRAP_AUTH_EXE;
+ traph->token = strdup(cptr);
+ if (format)
+ traph->format = format;
+ }
+}
+
+
+static void
+parse_forward(const char *token, char *line)
+{
+ char buf[STRINGMAX];
+ oid obuf[MAX_OID_LEN];
+ size_t olen = MAX_OID_LEN;
+ char *cptr, *cp;
+ netsnmp_trapd_handler *traph;
+ int flags = 0;
+ char *format = NULL;
+
+ memset( buf, 0, sizeof(buf));
+ memset(obuf, 0, sizeof(obuf));
+ cptr = copy_nword(line, buf, sizeof(buf));
+
+ if ( buf[0] == '-' && buf[1] == 'F' ) {
+ cptr = copy_nword(cptr, buf, sizeof(buf));
+ format = strdup( buf );
+ cptr = copy_nword(cptr, buf, sizeof(buf));
+ }
+ DEBUGMSGTL(("read_config:forward", "registering forward for: "));
+ if (!strcmp(buf, "default")) {
+ DEBUGMSG(("read_config:forward", "default"));
+ if ( !strcmp( cptr, "agentx" ))
+ traph = netsnmp_add_global_traphandler(NETSNMPTRAPD_DEFAULT_HANDLER,
+ axforward_handler );
+ else
+ traph = netsnmp_add_global_traphandler(NETSNMPTRAPD_DEFAULT_HANDLER,
+ forward_handler );
+ } else {
+ cp = buf+strlen(buf)-1;
+ if ( *cp == '*' ) {
+ flags |= NETSNMP_TRAPHANDLER_FLAG_MATCH_TREE;
+ *(cp--) = '\0';
+ if ( *cp == '.' ) {
+ /*
+ * Distinguish between 'oid.*' & 'oid*'
+ */
+ flags |= NETSNMP_TRAPHANDLER_FLAG_STRICT_SUBTREE;
+ *(cp--) = '\0';
+ }
+ }
+
+ if (!read_objid(buf, obuf, &olen)) {
+ netsnmp_config_error("Bad trap OID in forward directive: %s", buf);
+ return;
+ }
+ DEBUGMSGOID(("read_config:forward", obuf, olen));
+ if ( !strcmp( cptr, "agentx" ))
+ traph = netsnmp_add_traphandler( axforward_handler, obuf, olen );
+ else
+ traph = netsnmp_add_traphandler( forward_handler, obuf, olen );
+ }
+
+ DEBUGMSG(("read_config:forward", "\n"));
+
+ if (traph) {
+ traph->flags = flags;
+ traph->authtypes = TRAP_AUTH_NET;
+ traph->token = strdup(cptr);
+ if (format)
+ traph->format = format;
+ }
+}
+
+
+void
+parse_format(const char *token, char *line)
+{
+ char *cp, *sep;
+
+ /*
+ * Extract the first token from the value
+ * which tells us which style of format this is
+ */
+ cp = line;
+ while (*cp && !isspace((unsigned char)(*cp)))
+ cp++;
+ if (!(*cp)) {
+ /*
+ * If we haven't got anything left,
+ * then this entry is malformed.
+ * So report this, and give up
+ */
+ return;
+ }
+
+ sep = cp;
+ *(cp++) = '\0';
+ while (*cp && isspace((unsigned char)(*cp)))
+ cp++;
+
+ /*
+ * OK - now "line" contains the format type,
+ * and cp points to the actual format string.
+ * So update the appropriate pointer(s).
+ */
+ if (!strcmp( line, "print1")) {
+ SNMP_FREE( print_format1 );
+ print_format1 = strdup(cp);
+ } else if (!strcmp( line, "print2")) {
+ SNMP_FREE( print_format2 );
+ print_format2 = strdup(cp);
+ } else if (!strcmp( line, "print")) {
+ SNMP_FREE( print_format1 );
+ SNMP_FREE( print_format2 );
+ print_format1 = strdup(cp);
+ print_format2 = strdup(cp);
+ } else if (!strcmp( line, "syslog1")) {
+ SNMP_FREE( syslog_format1 );
+ syslog_format1 = strdup(cp);
+ } else if (!strcmp( line, "syslog2")) {
+ SNMP_FREE( syslog_format2 );
+ syslog_format2 = strdup(cp);
+ } else if (!strcmp( line, "syslog")) {
+ SNMP_FREE( syslog_format1 );
+ SNMP_FREE( syslog_format2 );
+ syslog_format1 = strdup(cp);
+ syslog_format2 = strdup(cp);
+ } else if (!strcmp( line, "execute1")) {
+ SNMP_FREE( exec_format1 );
+ exec_format1 = strdup(cp);
+ } else if (!strcmp( line, "execute2")) {
+ SNMP_FREE( exec_format2 );
+ exec_format2 = strdup(cp);
+ } else if (!strcmp( line, "execute")) {
+ SNMP_FREE( exec_format1 );
+ SNMP_FREE( exec_format2 );
+ exec_format1 = strdup(cp);
+ exec_format2 = strdup(cp);
+ }
+
+ *sep = ' ';
+}
+
+
+static void
+parse_trap1_fmt(const char *token, char *line)
+{
+ print_format1 = strdup(line);
+}
+
+
+void
+free_trap1_fmt(void)
+{
+ if (print_format1 && print_format1 != trap1_std_str)
+ free((char *) print_format1);
+ print_format1 = NULL;
+}
+
+
+static void
+parse_trap2_fmt(const char *token, char *line)
+{
+ print_format2 = strdup(line);
+}
+
+
+void
+free_trap2_fmt(void)
+{
+ if (print_format2 && print_format2 != trap2_std_str)
+ free((char *) print_format2);
+ print_format2 = NULL;
+}
+
+
+void
+snmptrapd_register_configs( void )
+{
+ register_config_handler("snmptrapd", "traphandle",
+ snmptrapd_parse_traphandle,
+ snmptrapd_free_traphandle,
+ "oid|\"default\" program [args ...] ");
+ register_config_handler("snmptrapd", "format1",
+ parse_trap1_fmt, free_trap1_fmt, "format");
+ register_config_handler("snmptrapd", "format2",
+ parse_trap2_fmt, free_trap2_fmt, "format");
+ register_config_handler("snmptrapd", "format",
+ parse_format, NULL,
+ "[print{,1,2}|syslog{,1,2}|execute{,1,2}] format");
+ register_config_handler("snmptrapd", "forward",
+ parse_forward, NULL, "OID|\"default\" destination");
+}
+
+
+
+/*-----------------------------
+ *
+ * Routines to implement a "registry" of trap handlers
+ *
+ *-----------------------------*/
+
+netsnmp_trapd_handler *netsnmp_auth_global_traphandlers = NULL;
+netsnmp_trapd_handler *netsnmp_pre_global_traphandlers = NULL;
+netsnmp_trapd_handler *netsnmp_post_global_traphandlers = NULL;
+netsnmp_trapd_handler *netsnmp_default_traphandlers = NULL;
+netsnmp_trapd_handler *netsnmp_specific_traphandlers = NULL;
+
+typedef struct netsnmp_handler_map_t {
+ netsnmp_trapd_handler **handler;
+ const char *descr;
+} netsnmp_handler_map;
+
+static netsnmp_handler_map handlers[] = {
+ { &netsnmp_auth_global_traphandlers, "auth trap" },
+ { &netsnmp_pre_global_traphandlers, "pre-global trap" },
+ { NULL, "trap specific" },
+ { &netsnmp_post_global_traphandlers, "global" },
+ { NULL, NULL }
+};
+
+/*
+ * Register a new "global" traphandler,
+ * to be applied to *all* incoming traps
+ */
+netsnmp_trapd_handler *
+netsnmp_add_global_traphandler(int list, Netsnmp_Trap_Handler *handler)
+{
+ netsnmp_trapd_handler *traph;
+
+ if ( !handler )
+ return NULL;
+
+ traph = SNMP_MALLOC_TYPEDEF(netsnmp_trapd_handler);
+ if ( !traph )
+ return NULL;
+
+ /*
+ * Add this new handler to the front of the appropriate list
+ * (or should it go on the end?)
+ */
+ traph->handler = handler;
+ traph->authtypes = TRAP_AUTH_ALL; /* callers will likely change this */
+ switch (list) {
+ case NETSNMPTRAPD_AUTH_HANDLER:
+ traph->nexth = netsnmp_auth_global_traphandlers;
+ netsnmp_auth_global_traphandlers = traph;
+ break;
+ case NETSNMPTRAPD_PRE_HANDLER:
+ traph->nexth = netsnmp_pre_global_traphandlers;
+ netsnmp_pre_global_traphandlers = traph;
+ break;
+ case NETSNMPTRAPD_POST_HANDLER:
+ traph->nexth = netsnmp_post_global_traphandlers;
+ netsnmp_post_global_traphandlers = traph;
+ break;
+ case NETSNMPTRAPD_DEFAULT_HANDLER:
+ traph->nexth = netsnmp_default_traphandlers;
+ netsnmp_default_traphandlers = traph;
+ break;
+ default:
+ free( traph );
+ return NULL;
+ }
+ return traph;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_ADD_DEFAULT_TRAPHANDLER
+/*
+ * Register a new "default" traphandler, to be applied to all
+ * traps with no specific trap handlers of their own.
+ */
+netsnmp_trapd_handler *
+netsnmp_add_default_traphandler(Netsnmp_Trap_Handler *handler) {
+ return netsnmp_add_global_traphandler(NETSNMPTRAPD_DEFAULT_HANDLER,
+ handler);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_ADD_DEFAULT_TRAPHANDLER */
+
+
+/*
+ * Register a new trap-specific traphandler
+ */
+netsnmp_trapd_handler *
+netsnmp_add_traphandler(Netsnmp_Trap_Handler* handler,
+ oid *trapOid, int trapOidLen ) {
+ netsnmp_trapd_handler *traph, *traph2;
+
+ if ( !handler )
+ return NULL;
+
+ traph = SNMP_MALLOC_TYPEDEF(netsnmp_trapd_handler);
+ if ( !traph )
+ return NULL;
+
+ /*
+ * Populate this new handler with the trap information
+ * (NB: the OID fields were not used in the default/global lists)
+ */
+ traph->authtypes = TRAP_AUTH_ALL; /* callers will likely change this */
+ traph->handler = handler;
+ traph->trapoid_len = trapOidLen;
+ traph->trapoid = snmp_duplicate_objid(trapOid, trapOidLen);
+
+ /*
+ * Now try to find the appropriate place in the trap-specific
+ * list for this particular trap OID. If there's a matching OID
+ * already, then find it. Otherwise find the one that follows.
+ * If we run out of entried, the new one should be tacked onto the end.
+ */
+ for (traph2 = netsnmp_specific_traphandlers;
+ traph2; traph2 = traph2->nextt) {
+ /* XXX - check this! */
+ if (snmp_oid_compare(traph2->trapoid, traph2->trapoid_len,
+ trapOid, trapOidLen) <= 0)
+ break;
+ }
+ if (traph2) {
+ /*
+ * OK - We've either got an exact match, or we've found the
+ * entry *after* where the new one should go.
+ */
+ if (!snmp_oid_compare(traph->trapoid, traph->trapoid_len,
+ traph2->trapoid, traph2->trapoid_len)) {
+ /*
+ * Exact match, so find the end of the *handler* list
+ * and tack on this new entry...
+ */
+ while (traph2->nexth)
+ traph2 = traph2->nexth;
+ traph2->nexth = traph;
+ traph->nextt = traph2->nextt; /* Might as well... */
+ traph->prevt = traph2->prevt;
+ } else {
+ /*
+ * .. or the following entry, so insert the new one before it.
+ */
+ traph->prevt = traph2->prevt;
+ if (traph2->prevt)
+ traph2->prevt->nextt = traph;
+ else
+ netsnmp_specific_traphandlers = traph;
+ traph2->prevt = traph;
+ traph->nextt = traph2;
+ }
+ } else {
+ /*
+ * If we've run out of entries without finding a suitable spot,
+ * the new one should be tacked onto the end.....
+ */
+ if (netsnmp_specific_traphandlers) {
+ traph2 = netsnmp_specific_traphandlers;
+ while (traph2->nextt)
+ traph2 = traph2->nextt;
+ traph2->nextt = traph;
+ traph->prevt = traph2;
+ } else {
+ /*
+ * .... unless this is the very first entry, of course!
+ */
+ netsnmp_specific_traphandlers = traph;
+ }
+ }
+
+ return traph;
+}
+
+void
+snmptrapd_free_traphandle(void)
+{
+ netsnmp_trapd_handler *traph = NULL, *nextt = NULL, *nexth = NULL;
+
+ DEBUGMSGTL(("snmptrapd", "Freeing trap handler lists\n"));
+
+ /*
+ * Free default trap handlers
+ */
+ traph = netsnmp_default_traphandlers;
+ /* loop over handlers */
+ while (traph) {
+ DEBUGMSG(("snmptrapd", "Freeing default trap handler\n"));
+ nexth = traph->nexth;
+ SNMP_FREE(traph->token);
+ SNMP_FREE(traph);
+ traph = nexth;
+ }
+ netsnmp_default_traphandlers = NULL;
+
+ /*
+ * Free specific trap handlers
+ */
+ traph = netsnmp_specific_traphandlers;
+ /* loop over traps */
+ while (traph) {
+ nextt = traph->nextt;
+ /* loop over handlers for this trap */
+ while (traph) {
+ DEBUGMSG(("snmptrapd", "Freeing specific trap handler\n"));
+ nexth = traph->nexth;
+ SNMP_FREE(traph->token);
+ SNMP_FREE(traph->trapoid);
+ SNMP_FREE(traph);
+ traph = nexth;
+ }
+ traph = nextt;
+ }
+ netsnmp_specific_traphandlers = NULL;
+}
+
+/*
+ * Locate the list of handlers for this particular Trap OID
+ * Returns NULL if there are no relevant traps
+ */
+netsnmp_trapd_handler *
+netsnmp_get_traphandler( oid *trapOid, int trapOidLen ) {
+ netsnmp_trapd_handler *traph;
+
+ if (!trapOid || !trapOidLen) {
+ DEBUGMSGTL(( "snmptrapd:lookup", "get_traphandler no OID!\n"));
+ return NULL;
+ }
+ DEBUGMSGTL(( "snmptrapd:lookup", "Looking up Trap OID: "));
+ DEBUGMSGOID(("snmptrapd:lookup", trapOid, trapOidLen));
+ DEBUGMSG(( "snmptrapd:lookup", "\n"));
+
+ /*
+ * Look for a matching OID, and return that list...
+ */
+ for (traph = netsnmp_specific_traphandlers;
+ traph; traph=traph->nextt ) {
+
+ /*
+ * If the trap handler wasn't wildcarded, then the trapOID
+ * should match the registered OID exactly.
+ */
+ if (!(traph->flags & NETSNMP_TRAPHANDLER_FLAG_MATCH_TREE)) {
+ if (snmp_oid_compare(traph->trapoid, traph->trapoid_len,
+ trapOid, trapOidLen) == 0) {
+ DEBUGMSGTL(( "snmptrapd:lookup",
+ "get_traphandler exact match (%p)\n", traph));
+ return traph;
+ }
+ } else {
+ /*
+ * If the trap handler *was* wildcarded, then the trapOID
+ * should have the registered OID as a prefix...
+ */
+ if (snmp_oidsubtree_compare(traph->trapoid,
+ traph->trapoid_len,
+ trapOid, trapOidLen) == 0) {
+ if (traph->flags & NETSNMP_TRAPHANDLER_FLAG_STRICT_SUBTREE) {
+ /*
+ * ... and (optionally) *strictly* as a prefix
+ * i.e. not including an exact match.
+ */
+ if (snmp_oid_compare(traph->trapoid, traph->trapoid_len,
+ trapOid, trapOidLen) != 0) {
+ DEBUGMSGTL(( "snmptrapd:lookup", "get_traphandler strict subtree match (%p)\n", traph));
+ return traph;
+ }
+ } else {
+ DEBUGMSGTL(( "snmptrapd:lookup", "get_traphandler subtree match (%p)\n", traph));
+ return traph;
+ }
+ }
+ }
+ }
+
+ /*
+ * .... or failing that, return the "default" list (which may be NULL)
+ */
+ DEBUGMSGTL(( "snmptrapd:lookup", "get_traphandler default (%p)\n",
+ netsnmp_default_traphandlers));
+ return netsnmp_default_traphandlers;
+}
+
+/*-----------------------------
+ *
+ * Standard traphandlers for the common requirements
+ *
+ *-----------------------------*/
+
+#define SYSLOG_V1_STANDARD_FORMAT "%a: %W Trap (%q) Uptime: %#T%#v\n"
+#define SYSLOG_V1_ENTERPRISE_FORMAT "%a: %W Trap (%q) Uptime: %#T%#v\n" /* XXX - (%q) become (.N) ??? */
+#define SYSLOG_V23_NOTIFICATION_FORMAT "%B [%b]: Trap %#v\n" /* XXX - introduces a leading " ," */
+
+/*
+ * Trap handler for logging via syslog
+ */
+int syslog_handler( netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler)
+{
+ u_char *rbuf = NULL;
+ size_t r_len = 64, o_len = 0;
+ int trunc = 0;
+
+ DEBUGMSGTL(( "snmptrapd", "syslog_handler\n"));
+
+ if (SyslogTrap)
+ return NETSNMPTRAPD_HANDLER_OK;
+
+ if ((rbuf = (u_char *) calloc(r_len, 1)) == NULL) {
+ snmp_log(LOG_ERR, "couldn't display trap -- malloc failed\n");
+ return NETSNMPTRAPD_HANDLER_FAIL; /* Failed but keep going */
+ }
+
+ /*
+ * If there's a format string registered for this trap, then use it.
+ */
+ if (handler && handler->format) {
+ DEBUGMSGTL(( "snmptrapd", "format = '%s'\n", handler->format));
+ if (*handler->format) {
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ handler->format, pdu, transport);
+ } else {
+ free(rbuf);
+ return NETSNMPTRAPD_HANDLER_OK; /* A 0-length format string means don't log */
+ }
+
+ /*
+ * Otherwise (i.e. a NULL handler format string),
+ * use a standard output format setting
+ * either configurable, or hardwired
+ *
+ * XXX - v1 traps use a different hardwired formats for
+ * standard and enterprise specific traps
+ * Do we actually need this?
+ */
+ } else {
+ if ( pdu->command == SNMP_MSG_TRAP ) {
+ if (syslog_format1) {
+ DEBUGMSGTL(( "snmptrapd", "syslog_format v1 = '%s'\n", syslog_format1));
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ syslog_format1, pdu, transport);
+
+ } else if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) {
+ DEBUGMSGTL(( "snmptrapd", "v1 enterprise format\n"));
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ SYSLOG_V1_ENTERPRISE_FORMAT,
+ pdu, transport);
+ } else {
+ DEBUGMSGTL(( "snmptrapd", "v1 standard trap format\n"));
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ SYSLOG_V1_STANDARD_FORMAT,
+ pdu, transport);
+ }
+ } else { /* SNMPv2/3 notifications */
+ if (syslog_format2) {
+ DEBUGMSGTL(( "snmptrapd", "syslog_format v1 = '%s'\n", syslog_format2));
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ syslog_format2, pdu, transport);
+ } else {
+ DEBUGMSGTL(( "snmptrapd", "v2/3 format\n"));
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ SYSLOG_V23_NOTIFICATION_FORMAT,
+ pdu, transport);
+ }
+ }
+ }
+ snmp_log(LOG_WARNING, "%s%s", rbuf, (trunc?" [TRUNCATED]\n":""));
+ free(rbuf);
+ return NETSNMPTRAPD_HANDLER_OK;
+}
+
+
+#define PRINT_V23_NOTIFICATION_FORMAT "%.4y-%.2m-%.2l %.2h:%.2j:%.2k %B [%b]:\n%v\n"
+
+/*
+ * Trap handler for logging to a file
+ */
+int print_handler( netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler)
+{
+ u_char *rbuf = NULL;
+ size_t r_len = 64, o_len = 0;
+ int trunc = 0;
+
+ DEBUGMSGTL(( "snmptrapd", "print_handler\n"));
+
+ /*
+ * Don't bother logging authentication failures
+ * XXX - can we handle this via suitable handler entries instead?
+ */
+ if (pdu->trap_type == SNMP_TRAP_AUTHFAIL && dropauth)
+ return NETSNMPTRAPD_HANDLER_OK;
+
+ if ((rbuf = (u_char *) calloc(r_len, 1)) == NULL) {
+ snmp_log(LOG_ERR, "couldn't display trap -- malloc failed\n");
+ return NETSNMPTRAPD_HANDLER_FAIL; /* Failed but keep going */
+ }
+
+ /*
+ * If there's a format string registered for this trap, then use it.
+ */
+ if (handler && handler->format) {
+ DEBUGMSGTL(( "snmptrapd", "format = '%s'\n", handler->format));
+ if (*handler->format) {
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ handler->format, pdu, transport);
+ } else {
+ free(rbuf);
+ return NETSNMPTRAPD_HANDLER_OK; /* A 0-length format string means don't log */
+ }
+
+ /*
+ * Otherwise (i.e. a NULL handler format string),
+ * use a standard output format setting
+ * either configurable, or hardwired
+ *
+ * XXX - v1 traps use a different routine for hardwired output
+ * Do we actually need this separate v1 routine?
+ * Or would a suitable format string be sufficient?
+ */
+ } else {
+ if ( pdu->command == SNMP_MSG_TRAP ) {
+ if (print_format1) {
+ DEBUGMSGTL(( "snmptrapd", "print_format v1 = '%s'\n", print_format1));
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ print_format1, pdu, transport);
+ } else {
+ DEBUGMSGTL(( "snmptrapd", "v1 format\n"));
+ trunc = !realloc_format_plain_trap(&rbuf, &r_len, &o_len, 1,
+ pdu, transport);
+ }
+ } else {
+ if (print_format2) {
+ DEBUGMSGTL(( "snmptrapd", "print_format v2 = '%s'\n", print_format2));
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ print_format2, pdu, transport);
+ } else {
+ DEBUGMSGTL(( "snmptrapd", "v2/3 format\n"));
+ trunc = !realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ PRINT_V23_NOTIFICATION_FORMAT,
+ pdu, transport);
+ }
+ }
+ }
+ snmp_log(LOG_INFO, "%s%s", rbuf, (trunc?" [TRUNCATED]\n":""));
+ free(rbuf);
+ return NETSNMPTRAPD_HANDLER_OK;
+}
+
+
+#define EXECUTE_FORMAT "%B\n%b\n%V\n%v\n"
+
+/*
+ * Trap handler for invoking a suitable script
+ */
+int command_handler( netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler)
+{
+#ifndef USING_UTILITIES_EXECUTE_MODULE
+ NETSNMP_LOGONCE((LOG_WARNING,
+ "support for run_shell_command not available\n"));
+ return NETSNMPTRAPD_HANDLER_FAIL;
+#else
+ u_char *rbuf = NULL;
+ size_t r_len = 64, o_len = 0;
+ int oldquick;
+
+ DEBUGMSGTL(( "snmptrapd", "command_handler\n"));
+ DEBUGMSGTL(( "snmptrapd", "token = '%s'\n", handler->token));
+ if (handler && handler->token && *handler->token) {
+ netsnmp_pdu *v2_pdu = NULL;
+ if (pdu->command == SNMP_MSG_TRAP)
+ v2_pdu = convert_v1pdu_to_v2(pdu);
+ else
+ v2_pdu = pdu;
+ oldquick = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT);
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT, 1);
+
+ /*
+ * Format the trap and pass this string to the external command
+ */
+ if ((rbuf = (u_char *) calloc(r_len, 1)) == NULL) {
+ snmp_log(LOG_ERR, "couldn't display trap -- malloc failed\n");
+ return NETSNMPTRAPD_HANDLER_FAIL; /* Failed but keep going */
+ }
+
+ /*
+ * If there's a format string registered for this trap, then use it.
+ * Otherwise use the standard execution format setting.
+ */
+ if (handler && handler->format && *handler->format) {
+ DEBUGMSGTL(( "snmptrapd", "format = '%s'\n", handler->format));
+ realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ handler->format,
+ v2_pdu, transport);
+ } else {
+ if ( pdu->command == SNMP_MSG_TRAP && exec_format1 ) {
+ DEBUGMSGTL(( "snmptrapd", "exec v1 = '%s'\n", exec_format1));
+ realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ exec_format1, pdu, transport);
+ } else if ( pdu->command != SNMP_MSG_TRAP && exec_format2 ) {
+ DEBUGMSGTL(( "snmptrapd", "exec v2/3 = '%s'\n", exec_format2));
+ realloc_format_trap(&rbuf, &r_len, &o_len, 1,
+ exec_format2, pdu, transport);
+ } else {
+ DEBUGMSGTL(( "snmptrapd", "execute format\n"));
+ realloc_format_trap(&rbuf, &r_len, &o_len, 1, EXECUTE_FORMAT,
+ v2_pdu, transport);
+ }
+ }
+
+ /*
+ * and pass this formatted string to the command specified
+ */
+ run_shell_command(handler->token, (char*)rbuf, NULL, NULL); /* Not interested in output */
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT, oldquick);
+ if (pdu->command == SNMP_MSG_TRAP)
+ snmp_free_pdu(v2_pdu);
+ free(rbuf);
+ }
+ return NETSNMPTRAPD_HANDLER_OK;
+#endif /* !def USING_UTILITIES_EXECUTE_MODULE */
+}
+
+
+
+
+/*
+ * Trap handler for forwarding to the AgentX master agent
+ */
+int axforward_handler( netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler)
+{
+ send_v2trap( pdu->variables );
+ return NETSNMPTRAPD_HANDLER_OK;
+}
+
+/*
+ * Trap handler for forwarding to another destination
+ */
+int forward_handler( netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler)
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu2;
+ char buf[BUFSIZ], *cp;
+
+ DEBUGMSGTL(( "snmptrapd", "forward_handler (%s)\n", handler->token));
+
+ snmp_sess_init( &session );
+ if (strchr( handler->token, ':') == NULL) {
+ snprintf( buf, BUFSIZ, "%s:%d", handler->token, SNMP_TRAP_PORT);
+ cp = buf;
+ } else {
+ cp = handler->token;
+ }
+ session.peername = cp;
+ session.version = pdu->version;
+ ss = snmp_open( &session );
+ if (!ss)
+ return NETSNMPTRAPD_HANDLER_FAIL;
+
+ /* XXX: wjh we should be caching sessions here and not always
+ reopening a session. It's very ineffecient, especially with v3
+ INFORMS which may require engineID probing */
+
+ pdu2 = snmp_clone_pdu(pdu);
+ if (pdu2->transport_data) {
+ free(pdu2->transport_data);
+ pdu2->transport_data = NULL;
+ pdu2->transport_data_length = 0;
+ }
+ if (!snmp_send( ss, pdu2 )) {
+ snmp_sess_perror("Forward failed", ss);
+ snmp_free_pdu(pdu2);
+ }
+ snmp_close( ss );
+ return NETSNMPTRAPD_HANDLER_OK;
+}
+
+#if defined(USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE) && defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(NETSNMP_SNMPTRAPD_DISABLE_AGENTX)
+/*
+ * "Notification" handler for implementing NOTIFICATION-MIB
+ * (presumably)
+ */
+int notification_handler(netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler)
+{
+ DEBUGMSGTL(( "snmptrapd", "notification_handler\n"));
+ log_notification(pdu, transport);
+ return NETSNMPTRAPD_HANDLER_OK;
+}
+#endif
+
+/*-----------------------------
+ *
+ * Main driving code, to process an incoming trap
+ *
+ *-----------------------------*/
+
+
+
+int
+snmp_input(int op, netsnmp_session *session,
+ int reqid, netsnmp_pdu *pdu, void *magic)
+{
+ oid stdTrapOidRoot[] = { 1, 3, 6, 1, 6, 3, 1, 1, 5 };
+ oid snmpTrapOid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+ oid trapOid[MAX_OID_LEN+2] = {0};
+ int trapOidLen;
+ netsnmp_variable_list *vars;
+ netsnmp_trapd_handler *traph;
+ netsnmp_transport *transport = (netsnmp_transport *) magic;
+ int ret, idx;
+
+ switch (op) {
+ case NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE:
+ /*
+ * Drops packets with reception problems
+ */
+ if (session->s_snmp_errno) {
+ /* drop problem packets */
+ return 1;
+ }
+
+ /*
+ * Determine the OID that identifies the trap being handled
+ */
+ DEBUGMSGTL(("snmptrapd", "input: %x\n", pdu->command));
+ switch (pdu->command) {
+ case SNMP_MSG_TRAP:
+ /*
+ * Convert v1 traps into a v2-style trap OID
+ * (following RFC 2576)
+ */
+ if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) {
+ trapOidLen = pdu->enterprise_length;
+ memcpy(trapOid, pdu->enterprise, sizeof(oid) * trapOidLen);
+ if (trapOid[trapOidLen - 1] != 0) {
+ trapOid[trapOidLen++] = 0;
+ }
+ trapOid[trapOidLen++] = pdu->specific_type;
+ } else {
+ memcpy(trapOid, stdTrapOidRoot, sizeof(stdTrapOidRoot));
+ trapOidLen = OID_LENGTH(stdTrapOidRoot); /* 9 */
+ trapOid[trapOidLen++] = pdu->trap_type+1;
+ }
+ break;
+
+ case SNMP_MSG_TRAP2:
+ case SNMP_MSG_INFORM:
+ /*
+ * v2c/v3 notifications *should* have snmpTrapOID as the
+ * second varbind, so we can go straight there.
+ * But check, just to make sure
+ */
+ vars = pdu->variables;
+ if (vars)
+ vars = vars->next_variable;
+ if (!vars || snmp_oid_compare(vars->name, vars->name_length,
+ snmpTrapOid, OID_LENGTH(snmpTrapOid))) {
+ /*
+ * Didn't find it!
+ * Let's look through the full list....
+ */
+ for ( vars = pdu->variables; vars; vars=vars->next_variable) {
+ if (!snmp_oid_compare(vars->name, vars->name_length,
+ snmpTrapOid, OID_LENGTH(snmpTrapOid)))
+ break;
+ }
+ if (!vars) {
+ /*
+ * Still can't find it! Give up.
+ */
+ snmp_log(LOG_ERR, "Cannot find TrapOID in TRAP2 PDU\n");
+ return 1; /* ??? */
+ }
+ }
+ memcpy(trapOid, vars->val.objid, vars->val_len);
+ trapOidLen = vars->val_len /sizeof(oid);
+ break;
+
+ default:
+ /* SHOULDN'T HAPPEN! */
+ return 1; /* ??? */
+ }
+ DEBUGMSGTL(( "snmptrapd", "Trap OID: "));
+ DEBUGMSGOID(("snmptrapd", trapOid, trapOidLen));
+ DEBUGMSG(( "snmptrapd", "\n"));
+
+
+ /*
+ * OK - We've found the Trap OID used to identify this trap.
+ * Call each of the various lists of handlers:
+ * a) authentication-related handlers,
+ * b) other handlers to be applied to all traps
+ * (*before* trap-specific handlers)
+ * c) the handler(s) specific to this trap
+t * d) any other global handlers
+ *
+ * In each case, a particular trap handler can abort further
+ * processing - either just for that particular list,
+ * or for the trap completely.
+ *
+ * This is particularly designed for authentication-related
+ * handlers, but can also be used elsewhere.
+ *
+ * OK - Enough waffling, let's get to work.....
+ */
+
+ for( idx = 0; handlers[idx].descr; ++idx ) {
+ DEBUGMSGTL(("snmptrapd", "Running %s handlers\n",
+ handlers[idx].descr));
+ if (NULL == handlers[idx].handler) /* specific */
+ traph = netsnmp_get_traphandler(trapOid, trapOidLen);
+ else
+ traph = *handlers[idx].handler;
+
+ for( ; traph; traph = traph->nexth) {
+ if (!netsnmp_trapd_check_auth(traph->authtypes))
+ continue; /* we continue on and skip this one */
+
+ ret = (*(traph->handler))(pdu, transport, traph);
+ if(NETSNMPTRAPD_HANDLER_FINISH == ret)
+ return 1;
+ if (ret == NETSNMPTRAPD_HANDLER_BREAK)
+ break; /* move on to next type */
+ } /* traph */
+ } /* handlers */
+
+
+ if (pdu->command == SNMP_MSG_INFORM) {
+ netsnmp_pdu *reply = snmp_clone_pdu(pdu);
+ if (!reply) {
+ snmp_log(LOG_ERR, "couldn't clone PDU for INFORM response\n");
+ } else {
+ reply->command = SNMP_MSG_RESPONSE;
+ reply->errstat = 0;
+ reply->errindex = 0;
+ if (!snmp_send(session, reply)) {
+ snmp_sess_perror("snmptrapd: Couldn't respond to inform pdu",
+ session);
+ snmp_free_pdu(reply);
+ }
+ }
+ }
+
+ break;
+
+ case NETSNMP_CALLBACK_OP_TIMED_OUT:
+ snmp_log(LOG_ERR, "Timeout: This shouldn't happen!\n");
+ break;
+
+ case NETSNMP_CALLBACK_OP_SEND_FAILED:
+ snmp_log(LOG_ERR, "Send Failed: This shouldn't happen either!\n");
+ break;
+
+ case NETSNMP_CALLBACK_OP_CONNECT:
+ case NETSNMP_CALLBACK_OP_DISCONNECT:
+ /* Ignore silently */
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "Unknown operation (%d): This shouldn't happen!\n", op);
+ break;
+ }
+ return 0;
+}
+
diff --git a/apps/snmptrapd_handlers.h b/apps/snmptrapd_handlers.h
new file mode 100644
index 0000000..097c02d
--- /dev/null
+++ b/apps/snmptrapd_handlers.h
@@ -0,0 +1,68 @@
+#ifndef SNMPTRAPD_HANDLERS_H
+#define SNMPTRAPD_HANDLERS_H
+
+typedef struct netsnmp_trapd_handler_s netsnmp_trapd_handler;
+
+typedef int (Netsnmp_Trap_Handler)(netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler);
+
+
+#define NETSNMP_TRAPHANDLER_FLAG_MATCH_TREE 0x1
+#define NETSNMP_TRAPHANDLER_FLAG_STRICT_SUBTREE 0x2
+
+struct netsnmp_trapd_handler_s {
+ oid *trapoid;
+ int trapoid_len;
+ char *token; /* Or an array of tokens? */
+ char *format; /* Formatting string */
+ int version; /* ??? */
+ int authtypes;
+ int flags;
+ Netsnmp_Trap_Handler *handler;
+ void *handler_data;
+
+ netsnmp_trapd_handler *nexth; /* Next handler for this trap */
+ /* Doubly-linked list of traps with registered handlers */
+ netsnmp_trapd_handler *prevt;
+ netsnmp_trapd_handler *nextt;
+};
+
+Netsnmp_Trap_Handler syslog_handler;
+Netsnmp_Trap_Handler print_handler;
+Netsnmp_Trap_Handler command_handler;
+Netsnmp_Trap_Handler event_handler;
+Netsnmp_Trap_Handler forward_handler;
+Netsnmp_Trap_Handler axforward_handler;
+Netsnmp_Trap_Handler notification_handler;
+Netsnmp_Trap_Handler mysql_handler;
+
+void free_trap1_fmt(void);
+void free_trap2_fmt(void);
+extern char *print_format1;
+extern char *print_format2;
+
+#define NETSNMPTRAPD_AUTH_HANDLER 1
+#define NETSNMPTRAPD_PRE_HANDLER 2
+#define NETSNMPTRAPD_POST_HANDLER 3
+#define NETSNMPTRAPD_DEFAULT_HANDLER 4
+
+#define NETSNMPTRAPD_HANDLER_OK 1 /* Succeed, & keep going */
+#define NETSNMPTRAPD_HANDLER_FAIL 2 /* Failed but keep going */
+#define NETSNMPTRAPD_HANDLER_BREAK 3 /* Move to the next list */
+#define NETSNMPTRAPD_HANDLER_FINISH 4 /* No further processing */
+
+void snmptrapd_register_configs( void );
+netsnmp_trapd_handler *netsnmp_add_global_traphandler(int list, Netsnmp_Trap_Handler* handler);
+netsnmp_trapd_handler *netsnmp_add_default_traphandler(Netsnmp_Trap_Handler* handler);
+netsnmp_trapd_handler *netsnmp_add_traphandler(Netsnmp_Trap_Handler* handler,
+ oid *trapOid, int trapOidLen);
+netsnmp_trapd_handler *netsnmp_get_traphandler(oid *trapOid, int trapOidLen);
+
+const char *trap_description(int trap);
+void do_external(char *cmd, struct hostent *host,
+ netsnmp_pdu *pdu, netsnmp_transport *transport);
+int snmp_input(int op, netsnmp_session *session,
+ int reqid, netsnmp_pdu *pdu, void *magic);
+
+#endif /* SNMPTRAPD_HANDLERS_H */
diff --git a/apps/snmptrapd_log.c b/apps/snmptrapd_log.c
new file mode 100644
index 0000000..774f797
--- /dev/null
+++ b/apps/snmptrapd_log.c
@@ -0,0 +1,1802 @@
+/*
+ * snmptrapd_log.c - format SNMP trap information for logging
+ *
+ */
+/*****************************************************************
+ Copyright 1989, 1991, 1992 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.
+******************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#if !defined(mingw32) && defined(HAVE_SYS_TIME_H)
+# include <sys/time.h>
+# if TIME_WITH_SYS_TIME
+# include <time.h>
+# endif
+#else
+# include <time.h>
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include "snmptrapd_log.h"
+
+
+#ifndef BSD4_3
+#define BSD4_2
+#endif
+
+/*
+ * These flags mark undefined values in the options structure
+ */
+#define UNDEF_CMD '*'
+#define UNDEF_PRECISION -1
+
+/*
+ * This structure holds the options for a single format command
+ */
+typedef struct {
+ char cmd; /* the format command itself */
+ size_t width; /* the field's minimum width */
+ int precision; /* the field's precision */
+ int left_justify; /* if true, left justify this field */
+ int alt_format; /* if true, display in alternate format */
+ int leading_zeroes; /* if true, display with leading zeroes */
+} options_type;
+
+char separator[32];
+
+/*
+ * These symbols define the characters that the parser recognizes.
+ * The rather odd choice of symbols comes from an attempt to avoid
+ * colliding with the ones that printf uses, so that someone could add
+ * printf functionality to this code and turn it into a library
+ * routine in the future.
+ */
+typedef enum {
+ CHR_FMT_DELIM = '%', /* starts a format command */
+ CHR_LEFT_JUST = '-', /* left justify */
+ CHR_LEAD_ZERO = '0', /* use leading zeroes */
+ CHR_ALT_FORM = '#', /* use alternate format */
+ CHR_FIELD_SEP = '.', /* separates width and precision fields */
+
+ /* Date / Time Information */
+ CHR_CUR_TIME = 't', /* current time, Unix format */
+ CHR_CUR_YEAR = 'y', /* current year */
+ CHR_CUR_MONTH = 'm', /* current month */
+ CHR_CUR_MDAY = 'l', /* current day of month */
+ CHR_CUR_HOUR = 'h', /* current hour */
+ CHR_CUR_MIN = 'j', /* current minute */
+ CHR_CUR_SEC = 'k', /* current second */
+ CHR_UP_TIME = 'T', /* uptime, Unix format */
+ CHR_UP_YEAR = 'Y', /* uptime year */
+ CHR_UP_MONTH = 'M', /* uptime month */
+ CHR_UP_MDAY = 'L', /* uptime day of month */
+ CHR_UP_HOUR = 'H', /* uptime hour */
+ CHR_UP_MIN = 'J', /* uptime minute */
+ CHR_UP_SEC = 'K', /* uptime second */
+
+ /* transport information */
+ CHR_AGENT_IP = 'a', /* agent's IP address */
+ CHR_AGENT_NAME = 'A', /* agent's host name if available */
+
+ /* authentication information */
+ CHR_SNMP_VERSION = 's', /* SNMP Version Number */
+ CHR_SNMP_SECMOD = 'S', /* SNMPv3 Security Model Version Number */
+ CHR_SNMP_USER = 'u', /* SNMPv3 secName or v1/v2c community */
+ CHR_TRAP_CONTEXTID = 'E', /* SNMPv3 context engineID if available */
+
+ /* PDU information */
+ CHR_PDU_IP = 'b', /* PDU's IP address */
+ CHR_PDU_NAME = 'B', /* PDU's host name if available */
+ CHR_PDU_ENT = 'N', /* PDU's enterprise string */
+ CHR_PDU_WRAP = 'P', /* PDU's wrapper info (community, security) */
+ CHR_TRAP_NUM = 'w', /* trap number */
+ CHR_TRAP_DESC = 'W', /* trap's description (textual) */
+ CHR_TRAP_STYPE = 'q', /* trap's subtype */
+ CHR_TRAP_VARSEP = 'V', /* character (or string) to separate variables */
+ CHR_TRAP_VARS = 'v' /* tab-separated list of trap's variables */
+
+} parse_chr_type;
+
+/*
+ * These symbols define the states for the parser's state machine
+ */
+typedef enum {
+ PARSE_NORMAL, /* looking for next character */
+ PARSE_BACKSLASH, /* saw a backslash */
+ PARSE_IN_FORMAT, /* saw a % sign, in a format command */
+ PARSE_GET_WIDTH, /* getting field width */
+ PARSE_GET_PRECISION, /* getting field precision */
+ PARSE_GET_SEPARATOR /* getting field separator */
+} parse_state_type;
+
+/*
+ * macros
+ */
+
+#define is_cur_time_cmd(chr) ((((chr) == CHR_CUR_TIME) \
+ || ((chr) == CHR_CUR_YEAR) \
+ || ((chr) == CHR_CUR_MONTH) \
+ || ((chr) == CHR_CUR_MDAY) \
+ || ((chr) == CHR_CUR_HOUR) \
+ || ((chr) == CHR_CUR_MIN) \
+ || ((chr) == CHR_CUR_SEC)) ? TRUE : FALSE)
+ /*
+ * Function:
+ * Returns true if the character is a format command that outputs
+ * some field that deals with the current time.
+ *
+ * Input Parameters:
+ * chr - character to check
+ */
+
+#define is_up_time_cmd(chr) ((((chr) == CHR_UP_TIME) \
+ || ((chr) == CHR_UP_YEAR) \
+ || ((chr) == CHR_UP_MONTH) \
+ || ((chr) == CHR_UP_MDAY) \
+ || ((chr) == CHR_UP_HOUR) \
+ || ((chr) == CHR_UP_MIN) \
+ || ((chr) == CHR_UP_SEC)) ? TRUE : FALSE)
+ /*
+ * Function:
+ * Returns true if the character is a format command that outputs
+ * some field that deals with up-time.
+ *
+ * Input Parameters:
+ * chr - character to check
+ */
+
+#define is_agent_cmd(chr) ((((chr) == CHR_AGENT_IP) \
+ || ((chr) == CHR_AGENT_NAME)) ? TRUE : FALSE)
+ /*
+ * Function:
+ * Returns true if the character outputs information about the
+ * agent.
+ *
+ * Input Parameters:
+ * chr - the character to check
+ */
+
+#define is_pdu_ip_cmd(chr) ((((chr) == CHR_PDU_IP) \
+ || ((chr) == CHR_PDU_NAME)) ? TRUE : FALSE)
+
+ /*
+ * Function:
+ * Returns true if the character outputs information about the SNMP
+ * authentication information
+ * Input Parameters:
+ * chr - the character to check
+ */
+
+#define is_auth_cmd(chr) ((((chr) == CHR_SNMP_VERSION \
+ || (chr) == CHR_SNMP_SECMOD \
+ || (chr) == CHR_SNMP_USER)) ? TRUE : FALSE)
+
+ /*
+ * Function:
+ * Returns true if the character outputs information about the PDU's
+ * host name or IP address.
+ *
+ * Input Parameters:
+ * chr - the character to check
+ */
+
+#define is_trap_cmd(chr) ((((chr) == CHR_TRAP_NUM) \
+ || ((chr) == CHR_TRAP_DESC) \
+ || ((chr) == CHR_TRAP_STYPE) \
+ || ((chr) == CHR_TRAP_VARS)) ? TRUE : FALSE)
+
+ /*
+ * Function:
+ * Returns true if the character outputs information about the trap.
+ *
+ * Input Parameters:
+ * chr - the character to check
+ */
+
+#define is_fmt_cmd(chr) ((is_cur_time_cmd (chr) \
+ || is_up_time_cmd (chr) \
+ || is_auth_cmd (chr) \
+ || is_agent_cmd (chr) \
+ || is_pdu_ip_cmd (chr) \
+ || ((chr) == CHR_PDU_ENT) \
+ || ((chr) == CHR_TRAP_CONTEXTID) \
+ || ((chr) == CHR_PDU_WRAP) \
+ || is_trap_cmd (chr)) ? TRUE : FALSE)
+ /*
+ * Function:
+ * Returns true if the character is a format command.
+ *
+ * Input Parameters:
+ * chr - character to check
+ */
+
+#define is_numeric_cmd(chr) ((is_cur_time_cmd(chr) \
+ || is_up_time_cmd(chr) \
+ || (chr) == CHR_TRAP_NUM) ? TRUE : FALSE)
+ /*
+ * Function:
+ * Returns true if this is a numeric format command.
+ *
+ * Input Parameters:
+ * chr - character to check
+ */
+
+#define reference(var) ((var) == (var))
+
+ /*
+ * Function:
+ * Some compiler options will tell the compiler to be picky and
+ * warn you if you pass a parameter to a function but don't use it.
+ * This macro lets you reference a parameter so that the compiler won't
+ * generate the warning. It has no other effect.
+ *
+ * Input Parameters:
+ * var - the parameter to reference
+ */
+
+/*
+ * prototypes
+ */
+extern const char *trap_description(int trap);
+
+static void
+init_options(options_type * options)
+
+ /*
+ * Function:
+ * Initialize a structure that contains the option settings for
+ * a format command.
+ *
+ * Input Parameters:
+ * options - points to the structure to initialize
+ */
+{
+ /*
+ * initialize the structure's fields
+ */
+ options->cmd = '*';
+ options->width = 0;
+ options->precision = UNDEF_PRECISION;
+ options->left_justify = FALSE;
+ options->alt_format = FALSE;
+ options->leading_zeroes = FALSE;
+ return;
+}
+
+
+static int
+realloc_output_temp_bfr(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ u_char ** temp_buf, options_type * options)
+
+ /*
+ * Function:
+ * Append the contents of the temporary buffer to the specified
+ * buffer using the correct justification, leading zeroes, width,
+ * precision, and other characteristics specified in the options
+ * structure.
+ *
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * temp_buf - pointer to string to append onto output buffer. THIS
+ * STRING IS free()d BY THIS FUNCTION.
+ * options - what options to use when appending string
+ */
+{
+ size_t temp_len; /* length of temporary buffer */
+ size_t temp_to_write; /* # of chars to write from temp bfr */
+ size_t char_to_write; /* # of other chars to write */
+ size_t zeroes_to_write; /* fill to precision with zeroes for numbers */
+
+ if (temp_buf == NULL || *temp_buf == NULL) {
+ return 1;
+ }
+
+ /*
+ * Figure out how many characters are in the temporary buffer now,
+ * and how many of them we'll write.
+ */
+ temp_len = strlen((char *) *temp_buf);
+ temp_to_write = temp_len;
+
+ if (options->precision != UNDEF_PRECISION &&
+ temp_to_write > (size_t)options->precision) {
+ temp_to_write = options->precision;
+ }
+
+ /*
+ * Handle leading characters.
+ */
+ if ((!options->left_justify) && (temp_to_write < options->width)) {
+ zeroes_to_write = options->precision - temp_to_write;
+ if (!is_numeric_cmd(options->cmd)) {
+ zeroes_to_write = 0;
+ }
+
+ for (char_to_write = options->width - temp_to_write;
+ char_to_write > 0; char_to_write--) {
+ if ((*out_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ *(*buf + *out_len) = '\0';
+ free(*temp_buf);
+ return 0;
+ }
+ }
+ if (options->leading_zeroes || zeroes_to_write-- > 0) {
+ *(*buf + *out_len) = '0';
+ } else {
+ *(*buf + *out_len) = ' ';
+ }
+ (*out_len)++;
+ }
+ }
+
+ /*
+ * Truncate the temporary buffer and append its contents.
+ */
+ *(*temp_buf + temp_to_write) = '\0';
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, *temp_buf)) {
+ free(*temp_buf);
+ return 0;
+ }
+
+ /*
+ * Handle trailing characters.
+ */
+ if ((options->left_justify) && (temp_to_write < options->width)) {
+ for (char_to_write = options->width - temp_to_write;
+ char_to_write > 0; char_to_write--) {
+ if ((*out_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ *(*buf + *out_len) = '\0';
+ free(*temp_buf);
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = '0';
+ (*out_len)++;
+ }
+ }
+
+ /*
+ * Slap on a trailing \0 for good measure.
+ */
+
+ *(*buf + *out_len) = '\0';
+ free(*temp_buf);
+ *temp_buf = NULL;
+ return 1;
+}
+
+
+static int
+realloc_handle_time_fmt(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ options_type * options, netsnmp_pdu *pdu)
+
+ /*
+ * Function:
+ * Handle a format command that deals with the current or up-time.
+ * Append the correct time information to the buffer subject to the
+ * buffer's length limit.
+ *
+ * Input Parameters:
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * options - options governing how to write the field
+ * pdu - information about this trap
+ */
+{
+ time_t time_val; /* the time value to output */
+ unsigned long time_ul; /* u_long time/timeticks */
+ struct tm *parsed_time; /* parsed version of current time */
+ char *safe_bfr = NULL;
+ char fmt_cmd = options->cmd; /* the format command to use */
+
+ if ((safe_bfr = (char *) calloc(30, 1)) == NULL) {
+ return 0;
+ }
+
+ /*
+ * Get the time field to output.
+ */
+ if (is_up_time_cmd(fmt_cmd)) {
+ time_ul = pdu->time;
+ } else {
+ /*
+ * Note: a time_t is a signed long.
+ */
+ time(&time_val);
+ time_ul = (unsigned long) time_val;
+ }
+
+ /*
+ * Handle output in Unix time format.
+ */
+ if (fmt_cmd == CHR_CUR_TIME) {
+ sprintf(safe_bfr, "%lu", time_ul);
+ } else if (fmt_cmd == CHR_UP_TIME && !options->alt_format) {
+ sprintf(safe_bfr, "%lu", time_ul);
+ } else if (fmt_cmd == CHR_UP_TIME) {
+ unsigned int centisecs, seconds, minutes, hours, days;
+
+ centisecs = time_ul % 100;
+ time_ul /= 100;
+ days = time_ul / (60 * 60 * 24);
+ time_ul %= (60 * 60 * 24);
+
+ hours = time_ul / (60 * 60);
+ time_ul %= (60 * 60);
+
+ minutes = time_ul / 60;
+ seconds = time_ul % 60;
+
+ switch (days) {
+ case 0:
+ sprintf(safe_bfr, "%u:%02u:%02u.%02u",
+ hours, minutes, seconds, centisecs);
+ break;
+ case 1:
+ sprintf(safe_bfr, "1 day, %u:%02u:%02u.%02u",
+ hours, minutes, seconds, centisecs);
+ break;
+ default:
+ sprintf(safe_bfr, "%u days, %u:%02u:%02u.%02u",
+ days, hours, minutes, seconds, centisecs);
+ }
+ } else {
+ /*
+ * Handle other time fields.
+ */
+
+ if (options->alt_format) {
+ parsed_time = gmtime(&time_val);
+ } else {
+ parsed_time = localtime(&time_val);
+ }
+
+ switch (fmt_cmd) {
+
+ /*
+ * Output year. The year field is unusual: if there's a restriction
+ * on precision, we want to truncate from the left of the number,
+ * not the right, so someone printing the year 1972 with 2 digit
+ * precision gets "72" not "19".
+ */
+ case CHR_CUR_YEAR:
+ case CHR_UP_YEAR:
+ sprintf(safe_bfr, "%d", parsed_time->tm_year + 1900);
+ break;
+
+ /*
+ * output month
+ */
+ case CHR_CUR_MONTH:
+ case CHR_UP_MONTH:
+ sprintf(safe_bfr, "%d", parsed_time->tm_mon + 1);
+ break;
+
+ /*
+ * output day of month
+ */
+ case CHR_CUR_MDAY:
+ case CHR_UP_MDAY:
+ sprintf(safe_bfr, "%d", parsed_time->tm_mday);
+ break;
+
+ /*
+ * output hour
+ */
+ case CHR_CUR_HOUR:
+ case CHR_UP_HOUR:
+ sprintf(safe_bfr, "%d", parsed_time->tm_hour);
+ break;
+
+ /*
+ * output minute
+ */
+ case CHR_CUR_MIN:
+ case CHR_UP_MIN:
+ sprintf(safe_bfr, "%d", parsed_time->tm_min);
+ break;
+
+ /*
+ * output second
+ */
+ case CHR_CUR_SEC:
+ case CHR_UP_SEC:
+ sprintf(safe_bfr, "%d", parsed_time->tm_sec);
+ break;
+
+ /*
+ * unknown format command - just output the character
+ */
+ default:
+ sprintf(safe_bfr, "%c", fmt_cmd);
+ }
+ }
+
+ /*
+ * Output with correct justification, leading zeroes, etc.
+ */
+ return realloc_output_temp_bfr(buf, buf_len, out_len, allow_realloc,
+ (u_char **) & safe_bfr, options);
+}
+
+
+static int
+realloc_handle_ip_fmt(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ options_type * options, netsnmp_pdu *pdu,
+ netsnmp_transport *transport)
+
+ /*
+ * Function:
+ * Handle a format command that deals with an IP address
+ * or host name. Append the information to the buffer subject to
+ * the buffer's length limit.
+ *
+ * Input Parameters:
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * options - options governing how to write the field
+ * pdu - information about this trap
+ * transport - the transport descriptor
+ */
+{
+ struct in_addr *agent_inaddr = (struct in_addr *) pdu->agent_addr;
+ struct hostent *host = NULL; /* corresponding host name */
+ char fmt_cmd = options->cmd; /* what we're formatting */
+ u_char *temp_buf = NULL;
+ size_t temp_buf_len = 64, temp_out_len = 0;
+ char *tstr;
+ unsigned int oflags;
+
+ if ((temp_buf = (u_char*)calloc(temp_buf_len, 1)) == NULL) {
+ return 0;
+ }
+
+ /*
+ * Decide exactly what to output.
+ */
+ switch (fmt_cmd) {
+ case CHR_AGENT_IP:
+ /*
+ * Write a numerical address.
+ */
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len, 1,
+ (u_char *)inet_ntoa(*agent_inaddr))) {
+ if (temp_buf != NULL) {
+ free(temp_buf);
+ }
+ return 0;
+ }
+ break;
+
+ case CHR_AGENT_NAME:
+ /*
+ * Try to resolve the agent_addr field as a hostname; fall back
+ * to numerical address.
+ */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_NUMERIC_IP)) {
+ host = netsnmp_gethostbyaddr((char *) pdu->agent_addr, 4, AF_INET);
+ }
+ if (host != NULL) {
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len, 1,
+ (const u_char *)host->h_name)) {
+ if (temp_buf != NULL) {
+ free(temp_buf);
+ }
+ return 0;
+ }
+ } else {
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len, 1,
+ (u_char *)inet_ntoa(*agent_inaddr))) {
+ if (temp_buf != NULL) {
+ free(temp_buf);
+ }
+ return 0;
+ }
+ }
+ break;
+
+ case CHR_PDU_IP:
+ /*
+ * Write the numerical transport information.
+ */
+ if (transport != NULL && transport->f_fmtaddr != NULL) {
+ oflags = transport->flags;
+ transport->flags &= ~NETSNMP_TRANSPORT_FLAG_HOSTNAME;
+ tstr = transport->f_fmtaddr(transport, pdu->transport_data,
+ pdu->transport_data_length);
+ transport->flags = oflags;
+
+ if (!tstr) goto noip;
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len,
+ 1, (u_char *)tstr)) {
+ SNMP_FREE(temp_buf);
+ SNMP_FREE(tstr);
+ return 0;
+ }
+ SNMP_FREE(tstr);
+ } else {
+noip:
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len, 1,
+ (const u_char*)"<UNKNOWN>")) {
+ SNMP_FREE(temp_buf);
+ return 0;
+ }
+ }
+ break;
+
+ case CHR_PDU_NAME:
+ /*
+ * Try to convert the numerical transport information
+ * into a hostname. Or rather, have the transport-specific
+ * address formatting routine do this.
+ * Otherwise falls back to the numeric address format.
+ */
+ if (transport != NULL && transport->f_fmtaddr != NULL) {
+ oflags = transport->flags;
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_NUMERIC_IP))
+ transport->flags |= NETSNMP_TRANSPORT_FLAG_HOSTNAME;
+ tstr = transport->f_fmtaddr(transport, pdu->transport_data,
+ pdu->transport_data_length);
+ transport->flags = oflags;
+
+ if (!tstr) goto nohost;
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len,
+ 1, (u_char *)tstr)) {
+ SNMP_FREE(temp_buf);
+ SNMP_FREE(tstr);
+ return 0;
+ }
+ SNMP_FREE(tstr);
+ } else {
+nohost:
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len, 1,
+ (const u_char*)"<UNKNOWN>")) {
+ SNMP_FREE(temp_buf);
+ return 0;
+ }
+ }
+ break;
+
+ /*
+ * Don't know how to handle this command - write the character itself.
+ */
+ default:
+ temp_buf[0] = fmt_cmd;
+ }
+
+ /*
+ * Output with correct justification, leading zeroes, etc.
+ */
+ return realloc_output_temp_bfr(buf, buf_len, out_len, allow_realloc,
+ &temp_buf, options);
+}
+
+
+static int
+realloc_handle_ent_fmt(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ options_type * options, netsnmp_pdu *pdu)
+
+ /*
+ * Function:
+ * Handle a format command that deals with OID strings.
+ * Append the information to the buffer subject to the
+ * buffer's length limit.
+ *
+ * Input Parameters:
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * options - options governing how to write the field
+ * pdu - information about this trap
+ */
+{
+ char fmt_cmd = options->cmd; /* what we're formatting */
+ u_char *temp_buf = NULL;
+ size_t temp_buf_len = 64, temp_out_len = 0;
+
+ if ((temp_buf = (u_char *) calloc(temp_buf_len, 1)) == NULL) {
+ return 0;
+ }
+
+ /*
+ * Decide exactly what to output.
+ */
+ switch (fmt_cmd) {
+ case CHR_PDU_ENT:
+ /*
+ * Write the enterprise oid.
+ */
+ if (!sprint_realloc_objid
+ (&temp_buf, &temp_buf_len, &temp_out_len, 1, pdu->enterprise,
+ pdu->enterprise_length)) {
+ free(temp_buf);
+ return 0;
+ }
+ break;
+
+ case CHR_TRAP_CONTEXTID:
+ /*
+ * Write the context oid.
+ */
+ if (!sprint_realloc_hexstring
+ (&temp_buf, &temp_buf_len, &temp_out_len, 1, pdu->contextEngineID,
+ pdu->contextEngineIDLen)) {
+ free(temp_buf);
+ return 0;
+ }
+ break;
+
+ /*
+ * Don't know how to handle this command - write the character itself.
+ */
+ default:
+ temp_buf[0] = fmt_cmd;
+ }
+
+ /*
+ * Output with correct justification, leading zeroes, etc.
+ */
+ return realloc_output_temp_bfr(buf, buf_len, out_len, allow_realloc,
+ &temp_buf, options);
+}
+
+
+static int
+realloc_handle_trap_fmt(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ options_type * options, netsnmp_pdu *pdu)
+
+ /*
+ * Function:
+ * Handle a format command that deals with the trap itself.
+ * Append the information to the buffer subject to the buffer's
+ * length limit.
+ *
+ * Input Parameters:
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * options - options governing how to write the field
+ * pdu - information about this trap
+ */
+{
+ netsnmp_variable_list *vars; /* variables assoc with trap */
+ char fmt_cmd = options->cmd; /* what we're outputting */
+ u_char *temp_buf = NULL;
+ size_t tbuf_len = 64, tout_len = 0;
+ const char *sep = separator;
+ const char *default_sep = "\t";
+ const char *default_alt_sep = ", ";
+
+ if ((temp_buf = (u_char *) calloc(tbuf_len, 1)) == NULL) {
+ return 0;
+ }
+
+ /*
+ * Decide exactly what to output.
+ */
+ switch (fmt_cmd) {
+ case CHR_TRAP_NUM:
+ /*
+ * Write the trap's number.
+ */
+ tout_len = sprintf((char*)temp_buf, "%ld", pdu->trap_type);
+ break;
+
+ case CHR_TRAP_DESC:
+ /*
+ * Write the trap's description.
+ */
+ tout_len =
+ sprintf((char*)temp_buf, "%s", trap_description(pdu->trap_type));
+ break;
+
+ case CHR_TRAP_STYPE:
+ /*
+ * Write the trap's subtype.
+ */
+ if (pdu->trap_type != SNMP_TRAP_ENTERPRISESPECIFIC) {
+ tout_len = sprintf((char*)temp_buf, "%ld", pdu->specific_type);
+ } else {
+ /*
+ * Get object ID for the trap.
+ */
+ size_t obuf_len = 64, oout_len = 0, trap_oid_len = 0;
+ oid trap_oid[MAX_OID_LEN + 2] = { 0 };
+ u_char *obuf = NULL;
+ char *ptr = NULL;
+
+ if ((obuf = (u_char *) calloc(obuf_len, 1)) == NULL) {
+ free(temp_buf);
+ return 0;
+ }
+
+ trap_oid_len = pdu->enterprise_length;
+ memcpy(trap_oid, pdu->enterprise, trap_oid_len * sizeof(oid));
+ if (trap_oid[trap_oid_len - 1] != 0) {
+ trap_oid[trap_oid_len] = 0;
+ trap_oid_len++;
+ }
+ trap_oid[trap_oid_len] = pdu->specific_type;
+ trap_oid_len++;
+
+ /*
+ * Find the element after the last dot.
+ */
+ if (!sprint_realloc_objid(&obuf, &obuf_len, &oout_len, 1,
+ trap_oid, trap_oid_len)) {
+ if (obuf != NULL) {
+ free(obuf);
+ }
+ free(temp_buf);
+ return 0;
+ }
+
+ ptr = strrchr((char *) obuf, '.');
+ if (ptr != NULL) {
+ if (!snmp_strcat
+ (&temp_buf, &tbuf_len, &tout_len, 1, (u_char *) ptr)) {
+ free(obuf);
+ if (temp_buf != NULL) {
+ free(temp_buf);
+ }
+ return 0;
+ }
+ free(obuf);
+ } else {
+ free(temp_buf);
+ temp_buf = obuf;
+ tbuf_len = obuf_len;
+ tout_len = oout_len;
+ }
+ }
+ break;
+
+ case CHR_TRAP_VARS:
+ /*
+ * Write the trap's variables.
+ */
+ if (!sep || !*sep)
+ sep = (options->alt_format ? default_alt_sep : default_sep);
+ for (vars = pdu->variables; vars != NULL;
+ vars = vars->next_variable) {
+ /*
+ * Print a separator between variables,
+ * (plus beforehand if the alt format is used)
+ */
+ if (options->alt_format ||
+ vars != pdu->variables ) {
+ if (!snmp_strcat(&temp_buf, &tbuf_len, &tout_len, 1, (const u_char *)sep)) {
+ if (temp_buf != NULL) {
+ free(temp_buf);
+ }
+ return 0;
+ }
+ }
+ if (!sprint_realloc_variable
+ (&temp_buf, &tbuf_len, &tout_len, 1, vars->name,
+ vars->name_length, vars)) {
+ if (temp_buf != NULL) {
+ free(temp_buf);
+ }
+ return 0;
+ }
+ }
+ break;
+
+ default:
+ /*
+ * Don't know how to handle this command - write the character itself.
+ */
+ temp_buf[0] = fmt_cmd;
+ }
+
+ /*
+ * Output with correct justification, leading zeroes, etc.
+ */
+ return realloc_output_temp_bfr(buf, buf_len, out_len, allow_realloc,
+ &temp_buf, options);
+}
+
+static int
+realloc_handle_auth_fmt(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ options_type * options, netsnmp_pdu *pdu)
+ /*
+ * Function:
+ * Handle a format command that deals with authentication
+ * information.
+ * Append the information to the buffer subject to the buffer's
+ * length limit.
+ *
+ * Input Parameters:
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * options - options governing how to write the field
+ * pdu - information about this trap
+ */
+{
+ char fmt_cmd = options->cmd; /* what we're outputting */
+ u_char *temp_buf = NULL;
+ size_t tbuf_len = 64;
+ unsigned int i;
+
+ if ((temp_buf = (u_char*)calloc(tbuf_len, 1)) == NULL) {
+ return 0;
+ }
+
+ switch (fmt_cmd) {
+
+ case CHR_SNMP_VERSION:
+ snprintf((char*)temp_buf, tbuf_len, "%ld", pdu->version);
+ break;
+
+ case CHR_SNMP_SECMOD:
+ snprintf((char*)temp_buf, tbuf_len, "%d", pdu->securityModel);
+ break;
+
+ case CHR_SNMP_USER:
+ switch ( pdu->version ) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+#endif
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ while ((*out_len + pdu->community_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ if (temp_buf)
+ free(temp_buf);
+ return 0;
+ }
+ }
+
+ for (i = 0; i < pdu->community_len; i++) {
+ if (isprint(pdu->community[i])) {
+ *(*buf + *out_len) = pdu->community[i];
+ } else {
+ *(*buf + *out_len) = '.';
+ }
+ (*out_len)++;
+ }
+ *(*buf + *out_len) = '\0';
+ break;
+#endif
+ default:
+ snprintf((char*)temp_buf, tbuf_len, "%s", pdu->securityName);
+ }
+ break;
+
+ default:
+ /*
+ * Don't know how to handle this command - write the character itself.
+ */
+ temp_buf[0] = fmt_cmd;
+ }
+
+ /*
+ * Output with correct justification, leading zeroes, etc.
+ */
+ return realloc_output_temp_bfr(buf, buf_len, out_len, allow_realloc,
+ &temp_buf, options);
+}
+
+static int
+realloc_handle_wrap_fmt(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc, netsnmp_pdu *pdu)
+{
+ size_t i = 0;
+
+ switch (pdu->command) {
+ case SNMP_MSG_TRAP:
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "TRAP")) {
+ return 0;
+ }
+ break;
+ case SNMP_MSG_TRAP2:
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "TRAP2")) {
+ return 0;
+ }
+ break;
+ case SNMP_MSG_INFORM:
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "INFORM")) {
+ return 0;
+ }
+ break;
+ }
+
+ switch (pdu->version) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) ", SNMP v1")) {
+ return 0;
+ }
+ break;
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) ", SNMP v2c")) {
+ return 0;
+ }
+ break;
+#endif
+ case SNMP_VERSION_3:
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) ", SNMP v3")) {
+ return 0;
+ }
+ break;
+ }
+
+ switch (pdu->version) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+#endif
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) ", community ")) {
+ return 0;
+ }
+
+ while ((*out_len + pdu->community_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ for (i = 0; i < pdu->community_len; i++) {
+ if (isprint(pdu->community[i])) {
+ *(*buf + *out_len) = pdu->community[i];
+ } else {
+ *(*buf + *out_len) = '.';
+ }
+ (*out_len)++;
+ }
+ *(*buf + *out_len) = '\0';
+ break;
+#endif
+ case SNMP_VERSION_3:
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) ", user ")) {
+ return 0;
+ }
+
+ while ((*out_len + pdu->securityNameLen + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ for (i = 0; i < pdu->securityNameLen; i++) {
+ if (isprint((unsigned char)(pdu->securityName[i]))) {
+ *(*buf + *out_len) = pdu->securityName[i];
+ } else {
+ *(*buf + *out_len) = '.';
+ }
+ (*out_len)++;
+ }
+ *(*buf + *out_len) = '\0';
+
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) ", context ")) {
+ return 0;
+ }
+
+ while ((*out_len + pdu->contextNameLen + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ for (i = 0; i < pdu->contextNameLen; i++) {
+ if (isprint((unsigned char)(pdu->contextName[i]))) {
+ *(*buf + *out_len) = pdu->contextName[i];
+ } else {
+ *(*buf + *out_len) = '.';
+ }
+ (*out_len)++;
+ }
+ *(*buf + *out_len) = '\0';
+ }
+ return 1;
+}
+
+
+static int
+realloc_dispatch_format_cmd(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ options_type * options, netsnmp_pdu *pdu,
+ netsnmp_transport *transport)
+
+ /*
+ * Function:
+ * Dispatch a format command to the appropriate command handler.
+ *
+ * Input Parameters:
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * options - options governing how to write the field
+ * pdu - information about this trap
+ * transport - the transport descriptor
+ */
+{
+ char fmt_cmd = options->cmd; /* for speed */
+
+ /*
+ * choose the appropriate command handler
+ */
+
+ if (is_cur_time_cmd(fmt_cmd) || is_up_time_cmd(fmt_cmd)) {
+ return realloc_handle_time_fmt(buf, buf_len, out_len,
+ allow_realloc, options, pdu);
+ } else if (is_agent_cmd(fmt_cmd) || is_pdu_ip_cmd(fmt_cmd)) {
+ return realloc_handle_ip_fmt(buf, buf_len, out_len, allow_realloc,
+ options, pdu, transport);
+ } else if (is_trap_cmd(fmt_cmd)) {
+ return realloc_handle_trap_fmt(buf, buf_len, out_len,
+ allow_realloc, options, pdu);
+ } else if (is_auth_cmd(fmt_cmd)) {
+ return realloc_handle_auth_fmt(buf, buf_len, out_len,
+ allow_realloc, options, pdu);
+ } else if (fmt_cmd == CHR_PDU_ENT || fmt_cmd == CHR_TRAP_CONTEXTID) {
+ return realloc_handle_ent_fmt(buf, buf_len, out_len, allow_realloc,
+ options, pdu);
+ } else if (fmt_cmd == CHR_PDU_WRAP) {
+ return realloc_handle_wrap_fmt(buf, buf_len, out_len,
+ allow_realloc, pdu);
+ } else {
+ /*
+ * unknown format command - just output the character
+ */
+ char fmt_cmd_string[2] = { 0, 0 };
+ fmt_cmd_string[0] = fmt_cmd;
+
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) fmt_cmd_string);
+ }
+}
+
+
+static int
+realloc_handle_backslash(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc, char fmt_cmd)
+
+ /*
+ * Function:
+ * Handle a character following a backslash. Append the resulting
+ * character to the buffer subject to the buffer's length limit.
+ * This routine currently isn't sophisticated enough to handle
+ * \nnn or \xhh formats.
+ *
+ * Input Parameters:
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * fmt_cmd - the character after the backslash
+ */
+{
+ char temp_bfr[3]; /* for bulding temporary strings */
+
+ /*
+ * select the proper output character(s)
+ */
+ switch (fmt_cmd) {
+ case 'a':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\a");
+ case 'b':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\b");
+ case 'f':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\f");
+ case 'n':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\n");
+ case 'r':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\r");
+ case 't':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\t");
+ case 'v':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\v");
+ case '\\':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\\");
+ case '?':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "?");
+ case '%':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "%");
+ case '\'':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\'");
+ case '"':
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\"");
+ default:
+ sprintf(temp_bfr, "\\%c", fmt_cmd);
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) temp_bfr);
+ }
+}
+
+
+int
+realloc_format_plain_trap(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ netsnmp_pdu *pdu, netsnmp_transport *transport)
+
+ /*
+ * Function:
+ * Format the trap information in the default way and put the results
+ * into the buffer, truncating at the buffer's length limit. This
+ * routine returns 1 if the output was completed successfully or
+ * 0 if it is truncated due to a memory allocation failure.
+ *
+ * Input Parameters:
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * pdu - the pdu information
+ * transport - the transport descriptor
+ */
+{
+ time_t now; /* the current time */
+ struct tm *now_parsed; /* time in struct format */
+ char safe_bfr[200]; /* holds other strings */
+ struct in_addr *agent_inaddr = (struct in_addr *) pdu->agent_addr;
+ struct hostent *host = NULL; /* host name */
+ netsnmp_variable_list *vars; /* variables assoc with trap */
+
+ if (buf == NULL) {
+ return 0;
+ }
+
+ /*
+ * Print the current time. Since we don't know how long the buffer is,
+ * and snprintf isn't yet standard, build the timestamp in a separate
+ * buffer of guaranteed length and then copy it to the output buffer.
+ */
+ time(&now);
+ now_parsed = localtime(&now);
+ sprintf(safe_bfr, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d ",
+ now_parsed->tm_year + 1900, now_parsed->tm_mon + 1,
+ now_parsed->tm_mday, now_parsed->tm_hour,
+ now_parsed->tm_min, now_parsed->tm_sec);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) safe_bfr)) {
+ return 0;
+ }
+
+ /*
+ * Get info about the sender.
+ */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_NUMERIC_IP)) {
+ host = netsnmp_gethostbyaddr((char *) pdu->agent_addr, 4, AF_INET);
+ }
+ if (host != (struct hostent *) NULL) {
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) host->h_name)) {
+ return 0;
+ }
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " [")) {
+ return 0;
+ }
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) inet_ntoa(*agent_inaddr))) {
+ return 0;
+ }
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "] ")) {
+ return 0;
+ }
+ } else {
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) inet_ntoa(*agent_inaddr))) {
+ return 0;
+ }
+ }
+
+ /*
+ * Append PDU transport info.
+ */
+ if (transport != NULL && transport->f_fmtaddr != NULL) {
+ char *tstr =
+ transport->f_fmtaddr(transport, pdu->transport_data,
+ pdu->transport_data_length);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "(via ")) {
+ if (tstr != NULL) {
+ free(tstr);
+ }
+ return 0;
+ }
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, (u_char *)tstr)) {
+ if (tstr != NULL) {
+ free(tstr);
+ }
+ return 0;
+ }
+ if (tstr != NULL) {
+ free(tstr);
+ }
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) ") ")) {
+ return 0;
+ }
+ }
+
+ /*
+ * Add security wrapper information.
+ */
+ if (!realloc_handle_wrap_fmt
+ (buf, buf_len, out_len, allow_realloc, pdu)) {
+ return 0;
+ }
+
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) "\n\t")) {
+ return 0;
+ }
+
+ /*
+ * Add enterprise information.
+ */
+ if (!sprint_realloc_objid(buf, buf_len, out_len, allow_realloc,
+ pdu->enterprise, pdu->enterprise_length)) {
+ return 0;
+ }
+
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) " ")) {
+ return 0;
+ }
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *)trap_description(pdu->trap_type))) {
+ return 0;
+ }
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " Trap (")) {
+ return 0;
+ }
+
+ /*
+ * Handle enterprise specific traps.
+ */
+ if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) {
+ size_t obuf_len = 64, oout_len = 0, trap_oid_len = 0;
+ oid trap_oid[MAX_OID_LEN + 2] = { 0 };
+ char *ent_spec_code = NULL;
+ u_char *obuf = NULL;
+
+ if ((obuf = (u_char *) calloc(obuf_len, 1)) == NULL) {
+ return 0;
+ }
+
+ /*
+ * Get object ID for the trap.
+ */
+ trap_oid_len = pdu->enterprise_length;
+ memcpy(trap_oid, pdu->enterprise, trap_oid_len * sizeof(oid));
+ if (trap_oid[trap_oid_len - 1] != 0) {
+ trap_oid[trap_oid_len] = 0;
+ trap_oid_len++;
+ }
+ trap_oid[trap_oid_len] = pdu->specific_type;
+ trap_oid_len++;
+
+ /*
+ * Find the element after the last dot.
+ */
+ if (!sprint_realloc_objid(&obuf, &obuf_len, &oout_len, 1,
+ trap_oid, trap_oid_len)) {
+ if (obuf != NULL) {
+ free(obuf);
+ }
+ return 0;
+ }
+ ent_spec_code = strrchr((char *) obuf, '.');
+ if (ent_spec_code != NULL) {
+ ent_spec_code++;
+ } else {
+ ent_spec_code = (char *) obuf;
+ }
+
+ /*
+ * Print trap info.
+ */
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) ent_spec_code)) {
+ free(obuf);
+ return 0;
+ }
+ free(obuf);
+ } else {
+ /*
+ * Handle traps that aren't enterprise specific.
+ */
+ sprintf(safe_bfr, "%ld", pdu->specific_type);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) safe_bfr)) {
+ return 0;
+ }
+ }
+
+ /*
+ * Finish the line.
+ */
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) ") Uptime: ")) {
+ return 0;
+ }
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) uptime_string(pdu->time,
+ safe_bfr))) {
+ return 0;
+ }
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) "\n")) {
+ return 0;
+ }
+
+ /*
+ * Finally, output the PDU variables.
+ */
+ for (vars = pdu->variables; vars != NULL; vars = vars->next_variable) {
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "\t")) {
+ return 0;
+ }
+ if (!sprint_realloc_variable(buf, buf_len, out_len, allow_realloc,
+ vars->name, vars->name_length,
+ vars)) {
+ return 0;
+ }
+ }
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) "\n")) {
+ return 0;
+ }
+
+ /*
+ * String is already null-terminated. That's all folks!
+ */
+ return 1;
+}
+
+
+int
+realloc_format_trap(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc, const char *format_str,
+ netsnmp_pdu *pdu, netsnmp_transport *transport)
+
+ /*
+ * Function:
+ * Format the trap information for display in a log. Place the results
+ * in the specified buffer (truncating to the length of the buffer).
+ * Returns the number of characters it put in the buffer.
+ *
+ * Input Parameters:
+ * buf, buf_len, out_len, allow_realloc - standard relocatable
+ * buffer parameters
+ * format_str - specifies how to format the trap info
+ * pdu - the pdu information
+ * transport - the transport descriptor
+ */
+{
+ unsigned long fmt_idx = 0; /* index into the format string */
+ options_type options; /* formatting options */
+ parse_state_type state = PARSE_NORMAL; /* state of the parser */
+ char next_chr; /* for speed */
+ int reset_options = TRUE; /* reset opts on next NORMAL state */
+
+ if (buf == NULL) {
+ return 0;
+ }
+
+ memset(separator, 0, sizeof(separator));
+ /*
+ * Go until we reach the end of the format string:
+ */
+ for (fmt_idx = 0; format_str[fmt_idx] != '\0'; fmt_idx++) {
+ next_chr = format_str[fmt_idx];
+ switch (state) {
+ case PARSE_NORMAL:
+ /*
+ * Looking for next character.
+ */
+ if (reset_options) {
+ init_options(&options);
+ reset_options = FALSE;
+ }
+ if (next_chr == '\\') {
+ state = PARSE_BACKSLASH;
+ } else if (next_chr == CHR_FMT_DELIM) {
+ state = PARSE_IN_FORMAT;
+ } else {
+ if ((*out_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = next_chr;
+ (*out_len)++;
+ }
+ break;
+
+ case PARSE_GET_SEPARATOR:
+ /*
+ * Parse the separator character
+ * XXX - Possibly need to handle quoted strings ??
+ */
+ { char *sep = separator;
+ size_t i, j;
+ i = sizeof(separator);
+ j = 0;
+ memset(separator, 0, i);
+ while (j < i && next_chr && next_chr != CHR_FMT_DELIM) {
+ if (next_chr == '\\') {
+ /*
+ * Handle backslash interpretation
+ * Print to "separator" string rather than the output buffer
+ * (a bit of a hack, but it should work!)
+ */
+ next_chr = format_str[++fmt_idx];
+ if (!realloc_handle_backslash
+ ((u_char **)&sep, &i, &j, 0, next_chr)) {
+ return 0;
+ }
+ } else {
+ separator[j++] = next_chr;
+ }
+ next_chr = format_str[++fmt_idx];
+ }
+ }
+ state = PARSE_IN_FORMAT;
+ break;
+
+ case PARSE_BACKSLASH:
+ /*
+ * Found a backslash.
+ */
+ if (!realloc_handle_backslash
+ (buf, buf_len, out_len, allow_realloc, next_chr)) {
+ return 0;
+ }
+ state = PARSE_NORMAL;
+ break;
+
+ case PARSE_IN_FORMAT:
+ /*
+ * In a format command.
+ */
+ reset_options = TRUE;
+ if (next_chr == CHR_LEFT_JUST) {
+ options.left_justify = TRUE;
+ } else if (next_chr == CHR_LEAD_ZERO) {
+ options.leading_zeroes = TRUE;
+ } else if (next_chr == CHR_ALT_FORM) {
+ options.alt_format = TRUE;
+ } else if (next_chr == CHR_FIELD_SEP) {
+ state = PARSE_GET_PRECISION;
+ } else if (next_chr == CHR_TRAP_VARSEP) {
+ state = PARSE_GET_SEPARATOR;
+ } else if ((next_chr >= '1') && (next_chr <= '9')) {
+ options.width =
+ ((unsigned long) next_chr) - ((unsigned long) '0');
+ state = PARSE_GET_WIDTH;
+ } else if (is_fmt_cmd(next_chr)) {
+ options.cmd = next_chr;
+ if (!realloc_dispatch_format_cmd
+ (buf, buf_len, out_len, allow_realloc, &options, pdu,
+ transport)) {
+ return 0;
+ }
+ state = PARSE_NORMAL;
+ } else {
+ if ((*out_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = next_chr;
+ (*out_len)++;
+ state = PARSE_NORMAL;
+ }
+ break;
+
+ case PARSE_GET_WIDTH:
+ /*
+ * Parsing a width field.
+ */
+ reset_options = TRUE;
+ if (isdigit((unsigned char)(next_chr))) {
+ options.width *= 10;
+ options.width +=
+ (unsigned long) next_chr - (unsigned long) '0';
+ } else if (next_chr == CHR_FIELD_SEP) {
+ state = PARSE_GET_PRECISION;
+ } else if (is_fmt_cmd(next_chr)) {
+ options.cmd = next_chr;
+ if (!realloc_dispatch_format_cmd
+ (buf, buf_len, out_len, allow_realloc, &options, pdu,
+ transport)) {
+ return 0;
+ }
+ state = PARSE_NORMAL;
+ } else {
+ if ((*out_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = next_chr;
+ (*out_len)++;
+ state = PARSE_NORMAL;
+ }
+ break;
+
+ case PARSE_GET_PRECISION:
+ /*
+ * Parsing a precision field.
+ */
+ reset_options = TRUE;
+ if (isdigit((unsigned char)(next_chr))) {
+ if (options.precision == UNDEF_PRECISION) {
+ options.precision =
+ (unsigned long) next_chr - (unsigned long) '0';
+ } else {
+ options.precision *= 10;
+ options.precision +=
+ (unsigned long) next_chr - (unsigned long) '0';
+ }
+ } else if (is_fmt_cmd(next_chr)) {
+ options.cmd = next_chr;
+ if ((options.precision != UNDEF_PRECISION) &&
+ (options.width < (size_t)options.precision)) {
+ options.width = (size_t)options.precision;
+ }
+ if (!realloc_dispatch_format_cmd
+ (buf, buf_len, out_len, allow_realloc, &options, pdu,
+ transport)) {
+ return 0;
+ }
+ state = PARSE_NORMAL;
+ } else {
+ if ((*out_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = next_chr;
+ (*out_len)++;
+ state = PARSE_NORMAL;
+ }
+ break;
+
+ default:
+ /*
+ * Unknown state.
+ */
+ reset_options = TRUE;
+ if ((*out_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = next_chr;
+ (*out_len)++;
+ state = PARSE_NORMAL;
+ }
+ }
+
+ *(*buf + *out_len) = '\0';
+ return 1;
+}
diff --git a/apps/snmptrapd_log.h b/apps/snmptrapd_log.h
new file mode 100644
index 0000000..e8d797a
--- /dev/null
+++ b/apps/snmptrapd_log.h
@@ -0,0 +1,18 @@
+#ifndef _SNMPTRAPD_LOG_H
+#define _SNMPTRAPD_LOG_H
+
+#include "snmptrapd_ds.h"
+
+int realloc_format_trap(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const char *format_str,
+ netsnmp_pdu *pdu,
+ struct netsnmp_transport_s *transport);
+
+int realloc_format_plain_trap(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ netsnmp_pdu *pdu,
+ struct netsnmp_transport_s
+ *transport);
+#endif /* _SNMPTRAPD_LOG_H */
diff --git a/apps/snmptrapd_sql.c b/apps/snmptrapd_sql.c
new file mode 100644
index 0000000..ccba258
--- /dev/null
+++ b/apps/snmptrapd_sql.c
@@ -0,0 +1,1118 @@
+/*
+ * File : snmptrapd_sql
+ * Author : Robert Story
+ *
+ * Copyright © 2009 Science Logic, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ *
+ * This file implements a handler for snmptrapd which will cache incoming
+ * traps and then write them to a MySQL database.
+ *
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#ifdef NETSNMP_USE_MYSQL
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <ctype.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 "snmptrapd_handlers.h"
+#include "snmptrapd_auth.h"
+#include "snmptrapd_log.h"
+
+/*
+ * SQL includes
+ */
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#include <mysql/my_global.h>
+#include <mysql/my_sys.h>
+#include <mysql/mysql.h>
+#include <mysql/errmsg.h>
+
+netsnmp_feature_require(container_fifo)
+
+/*
+ * define a structure to hold all the file globals
+ */
+typedef struct netsnmp_sql_globals_t {
+ char *host_name; /* server host (def=localhost) */
+ char *user_name; /* username (def=login name) */
+ char *password; /* password (def=none) */
+ u_int port_num; /* port number (built-in value) */
+ char *socket_name; /* socket name (built-in value) */
+ const char *db_name; /* database name (def=none) */
+ u_int flags; /* connection flags (none) */
+ MYSQL *conn; /* connection */
+ u_char connected; /* connected flag */
+ const char *groups[3];
+ MYSQL_STMT *trap_stmt, *vb_stmt; /* prepared statements */
+ u_int alarm_id; /* id of periodic save alarm */
+ netsnmp_container *queue; /* container; traps pending database write */
+ u_int queue_max; /* auto save queue when it gets this big */
+ int queue_interval; /* auto save every N seconds */
+} netsnmp_sql_globals;
+
+static netsnmp_sql_globals _sql = {
+ NULL, /* host */
+ NULL, /* username */
+ NULL, /* password */
+ 0, /* port */
+ NULL, /* socket */
+ "net_snmp", /* database */
+ 0, /* conn flags */
+ NULL, /* connection */
+ 0, /* connected */
+ { "client", "snmptrapd", NULL }, /* groups to read from .my.cnf */
+ NULL, /* trap_stmt */
+ NULL, /* vb_stmt */
+ 0, /* alarm_id */
+ NULL, /* queue */
+ 1, /* queue_max */
+ -1 /* queue_interval */
+};
+
+/*
+ * log traps as text, or binary blobs?
+ */
+#define NETSNMP_MYSQL_TRAP_VALUE_TEXT 1
+
+/*
+ * We will be using prepared statements for performance reasons. This
+ * requires a sql bind structure for each cell to be inserted in the
+ * database. We will be using 2 global static structures to bind to,
+ * and a netsnmp container to store the necessary data until it is
+ * written to the database. Fixed size buffers are also used to
+ * simplify memory management.
+ */
+/** enums for the trap fields to be bound */
+enum{
+ TBIND_DATE = 0, /* time received */
+ TBIND_HOST, /* src ip */
+ TBIND_USER, /* auth/user information */
+ TBIND_TYPE, /* pdu type */
+ TBIND_VER, /* snmp version */
+ TBIND_REQID, /* request id */
+ TBIND_OID, /* trap OID */
+ TBIND_TRANSPORT, /* transport */
+ TBIND_SECURITY_MODEL, /* security model */
+ TBIND_v3_MSGID, /* v3 msg id */
+ TBIND_v3_SECURITY_LEVEL, /* security level */
+ TBIND_v3_CONTEXT_NAME, /* context */
+ TBIND_v3_CONTEXT_ENGINE, /* context engine id */
+ TBIND_v3_SECURITY_NAME, /* security name */
+ TBIND_v3_SECURITY_ENGINE, /* security engine id */
+ TBIND_MAX
+};
+
+/** enums for the varbind fields to be bound */
+enum {
+ VBIND_ID = 0, /* trap_id */
+ VBIND_OID, /* varbind oid */
+ VBIND_TYPE, /* varbind type */
+ VBIND_VAL, /* varbind value */
+ VBIND_MAX
+};
+
+/** buffer struct for varbind data */
+typedef struct sql_vb_buf_t {
+
+ char *oid;
+ u_long oid_len;
+
+ u_char *val;
+ u_long val_len;
+
+ uint16_t type;
+
+} sql_vb_buf;
+
+/** buffer struct for trap data */
+typedef struct sql_buf_t {
+ char *host;
+ u_long host_len;
+
+ char *oid;
+ u_long oid_len;
+
+ char *user;
+ u_long user_len;
+
+ MYSQL_TIME time;
+ uint16_t version, type;
+ uint32_t reqid;
+
+ char *transport;
+ u_long transport_len;
+
+ uint16_t security_level, security_model;
+ uint32_t msgid;
+
+ char *context;
+ u_long context_len;
+
+ char *context_engine;
+ u_long context_engine_len;
+
+ char *security_name;
+ u_long security_name_len;
+
+ char *security_engine;
+ u_long security_engine_len;
+
+ netsnmp_container *varbinds;
+
+ char logged;
+} sql_buf;
+
+/*
+ * static bind structures, plus 2 static buffers to bind to.
+ */
+static MYSQL_BIND _tbind[TBIND_MAX], _vbind[VBIND_MAX];
+static my_bool _no_v3;
+
+static void _sql_process_queue(u_int dontcare, void *meeither);
+
+/*
+ * parse the sqlMaxQueue configuration token
+ */
+static void
+_parse_queue_fmt(const char *token, char *cptr)
+{
+ _sql.queue_max = atoi(cptr);
+ DEBUGMSGTL(("sql:queue","queue max now %d\n", _sql.queue_max));
+}
+
+/*
+ * parse the sqlSaveInterval configuration token
+ */
+static void
+_parse_interval_fmt(const char *token, char *cptr)
+{
+ _sql.queue_interval = atoi(cptr);
+ DEBUGMSGTL(("sql:queue","queue interval now %d seconds\n",
+ _sql.queue_interval));
+}
+
+/*
+ * register sql related configuration tokens
+ */
+void
+snmptrapd_register_sql_configs( void )
+{
+ register_config_handler("snmptrapd", "sqlMaxQueue",
+ _parse_queue_fmt, NULL, "integer");
+ register_config_handler("snmptrapd", "sqlSaveInterval",
+ _parse_interval_fmt, NULL, "seconds");
+}
+
+static void
+netsnmp_sql_disconnected(void)
+{
+ DEBUGMSGTL(("sql:connection","disconnected\n"));
+
+ _sql.connected = 0;
+
+ /** release prepared statements */
+ if (_sql.trap_stmt) {
+ mysql_stmt_close(_sql.trap_stmt);
+ _sql.trap_stmt = NULL;
+ }
+ if (_sql.vb_stmt) {
+ mysql_stmt_close(_sql.vb_stmt);
+ _sql.vb_stmt = NULL;
+ }
+}
+
+/*
+ * convenience function to log mysql errors
+ */
+static void
+netsnmp_sql_error(const char *message)
+{
+ u_int err = mysql_errno(_sql.conn);
+ snmp_log(LOG_ERR, "%s\n", message);
+ if (_sql.conn != NULL) {
+#if MYSQL_VERSION_ID >= 40101
+ snmp_log(LOG_ERR, "Error %u (%s): %s\n",
+ err, mysql_sqlstate(_sql.conn), mysql_error(_sql.conn));
+#else
+ snmp(LOG_ERR, "Error %u: %s\n",
+ mysql_errno(_sql.conn), mysql_error(_sql.conn));
+#endif
+ }
+ if (CR_SERVER_GONE_ERROR == err)
+ netsnmp_sql_disconnected();
+}
+
+/*
+ * convenience function to log mysql statement errors
+ */
+static void
+netsnmp_sql_stmt_error (MYSQL_STMT *stmt, const char *message)
+{
+ u_int err = mysql_errno(_sql.conn);
+
+ snmp_log(LOG_ERR, "%s\n", message);
+ if (stmt) {
+ snmp_log(LOG_ERR, "SQL Error %u (%s): %s\n",
+ mysql_stmt_errno(stmt), mysql_stmt_sqlstate(stmt),
+ mysql_stmt_error(stmt));
+ }
+
+ if (CR_SERVER_GONE_ERROR == err)
+ netsnmp_sql_disconnected();
+}
+
+/*
+ * sql cleanup function, called at exit
+ */
+static void
+netsnmp_mysql_cleanup(void)
+{
+ DEBUGMSGTL(("sql:cleanup"," called\n"));
+
+ /** unregister alarm */
+ if (_sql.alarm_id)
+ snmp_alarm_unregister(_sql.alarm_id);
+
+ /** save any queued traps */
+ if (CONTAINER_SIZE(_sql.queue))
+ _sql_process_queue(0,NULL);
+
+ CONTAINER_FREE(_sql.queue);
+ _sql.queue = NULL;
+
+ if (_sql.trap_stmt) {
+ mysql_stmt_close(_sql.trap_stmt);
+ _sql.trap_stmt = NULL;
+ }
+ if (_sql.vb_stmt) {
+ mysql_stmt_close(_sql.vb_stmt);
+ _sql.vb_stmt = NULL;
+ }
+
+ /** disconnect from server */
+ netsnmp_sql_disconnected();
+
+ if (_sql.conn) {
+ mysql_close(_sql.conn);
+ _sql.conn = NULL;
+ }
+
+ mysql_library_end();
+}
+
+/*
+ * setup (initialize, prepare and bind) a prepared statement
+ */
+static int
+netsnmp_mysql_bind(const char *text, size_t text_size, MYSQL_STMT **stmt,
+ MYSQL_BIND *bind)
+{
+ if ((NULL == text) || (NULL == stmt) || (NULL == bind)) {
+ snmp_log(LOG_ERR,"invalid paramaters to netsnmp_mysql_bind()\n");
+ return -1;
+ }
+
+ *stmt = mysql_stmt_init(_sql.conn);
+ if (NULL == *stmt) {
+ netsnmp_sql_error("could not initialize trap statement handler");
+ return -1;
+ }
+
+ if (mysql_stmt_prepare(*stmt, text, text_size) != 0) {
+ netsnmp_sql_stmt_error(*stmt, "Could not prepare INSERT");
+ mysql_stmt_close(*stmt);
+ *stmt = NULL;
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * connect to the database and do initial setup
+ */
+static int
+netsnmp_mysql_connect(void)
+{
+ char trap_stmt[] = "INSERT INTO notifications "
+ "(date_time, host, auth, type, version, request_id, snmpTrapOID, transport, security_model, v3msgid, v3security_level, v3context_name, v3context_engine, v3security_name, v3security_engine) "
+ "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+ char vb_stmt[] = "INSERT INTO varbinds "
+ "(trap_id, oid, type, value) VALUES (?,?,?,?)";
+
+ /** initialize connection handler */
+ if (_sql.connected)
+ return 0;
+
+ DEBUGMSGTL(("sql:connection","connecting\n"));
+
+ /** connect to server */
+ if (mysql_real_connect (_sql.conn, _sql.host_name, _sql.user_name,
+ _sql.password, _sql.db_name, _sql.port_num,
+ _sql.socket_name, _sql.flags) == NULL) {
+ netsnmp_sql_error("mysql_real_connect() failed");
+ goto err;
+ }
+ _sql.connected = 1;
+
+ /** disable autocommit */
+ if(0 != mysql_autocommit(_sql.conn, 0)) {
+ netsnmp_sql_error("mysql_autocommit(0) failed");
+ goto err;
+ }
+
+ netsnmp_assert((_sql.trap_stmt == NULL) && (_sql.vb_stmt == NULL));
+
+ /** prepared statement for inserts */
+ if (0 != netsnmp_mysql_bind(trap_stmt,sizeof(trap_stmt), &_sql.trap_stmt,
+ _tbind))
+ goto err;
+
+ if (0 != netsnmp_mysql_bind(vb_stmt,sizeof(vb_stmt),&_sql.vb_stmt,
+ _vbind)) {
+ mysql_stmt_close(_sql.trap_stmt);
+ _sql.trap_stmt = NULL;
+ goto err;
+ }
+
+ return 0;
+
+ err:
+ if (_sql.connected)
+ _sql.connected = 0;
+
+ return -1;
+}
+
+/** one-time initialization for mysql */
+int
+netsnmp_mysql_init(void)
+{
+ int not_argc = 0, i;
+ char *not_args[] = { NULL };
+ char **not_argv = not_args;
+ netsnmp_trapd_handler *traph;
+
+ DEBUGMSGTL(("sql:init","called\n"));
+
+ /** negative or 0 interval disables sql logging */
+ if (_sql.queue_interval <= 0) {
+ DEBUGMSGTL(("sql:init",
+ "mysql not enabled (sqlSaveInterval is <= 0)\n"));
+ return 0;
+ }
+
+ /** create queue for storing traps til they are written to the db */
+ _sql.queue = netsnmp_container_find("fifo");
+ if (NULL == _sql.queue) {
+ snmp_log(LOG_ERR, "Could not allocate sql buf container\n");
+ return -1;
+ }
+
+#ifdef HAVE_BROKEN_LIBMYSQLCLIENT
+ my_init();
+#else
+ MY_INIT("snmptrapd");
+#endif
+
+ /** load .my.cnf values */
+ load_defaults ("my", _sql.groups, &not_argc, &not_argv);
+ for(i=0; i < not_argc; ++i) {
+ if (NULL == not_argv[i])
+ continue;
+ if (strncmp(not_argv[i],"--password=",11) == 0)
+ _sql.password = &not_argv[i][11];
+ else if (strncmp(not_argv[i],"--host=",7) == 0)
+ _sql.host_name = &not_argv[i][7];
+ else if (strncmp(not_argv[i],"--user=",7) == 0)
+ _sql.user_name = &not_argv[i][7];
+ else if (strncmp(not_argv[i],"--port=",7) == 0)
+ _sql.port_num = atoi(&not_argv[i][7]);
+ else if (strncmp(not_argv[i],"--socket=",9) == 0)
+ _sql.socket_name = &not_argv[i][9];
+ else
+ snmp_log(LOG_WARNING, "unknown argument[%d] %s\n", i, not_argv[i]);
+ }
+
+ /** init bind structures */
+ memset(_tbind, 0x0, sizeof(_tbind));
+ memset(_vbind, 0x0, sizeof(_vbind));
+
+ /** trap static bindings */
+ _tbind[TBIND_HOST].buffer_type = MYSQL_TYPE_STRING;
+ _tbind[TBIND_HOST].length = &_tbind[TBIND_HOST].buffer_length;
+
+ _tbind[TBIND_OID].buffer_type = MYSQL_TYPE_STRING;
+ _tbind[TBIND_OID].length = &_tbind[TBIND_OID].buffer_length;
+
+ _tbind[TBIND_REQID].buffer_type = MYSQL_TYPE_LONG;
+ _tbind[TBIND_REQID].is_unsigned = 1;
+
+ _tbind[TBIND_VER].buffer_type = MYSQL_TYPE_SHORT;
+ _tbind[TBIND_VER].is_unsigned = 1;
+
+ _tbind[TBIND_TYPE].buffer_type = MYSQL_TYPE_SHORT;
+ _tbind[TBIND_TYPE].is_unsigned = 1;
+
+ _tbind[TBIND_DATE].buffer_type = MYSQL_TYPE_DATETIME;
+
+ _tbind[TBIND_USER].buffer_type = MYSQL_TYPE_STRING;
+ _tbind[TBIND_USER].length = &_tbind[TBIND_USER].buffer_length;
+
+ _tbind[TBIND_TRANSPORT].buffer_type = MYSQL_TYPE_STRING;
+ _tbind[TBIND_TRANSPORT].length = &_tbind[TBIND_TRANSPORT].buffer_length;
+
+ _tbind[TBIND_SECURITY_MODEL].buffer_type = MYSQL_TYPE_SHORT;
+ _tbind[TBIND_SECURITY_MODEL].is_unsigned = 1;
+
+ _tbind[TBIND_v3_MSGID].buffer_type = MYSQL_TYPE_LONG;
+ _tbind[TBIND_v3_MSGID].is_unsigned = 1;
+ _tbind[TBIND_v3_SECURITY_LEVEL].buffer_type = MYSQL_TYPE_SHORT;
+ _tbind[TBIND_v3_SECURITY_LEVEL].is_unsigned = 1;
+ _tbind[TBIND_v3_CONTEXT_NAME].buffer_type = MYSQL_TYPE_STRING;
+ _tbind[TBIND_v3_CONTEXT_ENGINE].buffer_type = MYSQL_TYPE_STRING;
+ _tbind[TBIND_v3_SECURITY_NAME].buffer_type = MYSQL_TYPE_STRING;
+ _tbind[TBIND_v3_SECURITY_NAME].length =
+ &_tbind[TBIND_v3_SECURITY_NAME].buffer_length;
+ _tbind[TBIND_v3_CONTEXT_NAME].length =
+ &_tbind[TBIND_v3_CONTEXT_NAME].buffer_length;
+ _tbind[TBIND_v3_SECURITY_ENGINE].buffer_type = MYSQL_TYPE_STRING;
+ _tbind[TBIND_v3_SECURITY_ENGINE].length =
+ &_tbind[TBIND_v3_SECURITY_ENGINE].buffer_length;
+ _tbind[TBIND_v3_CONTEXT_ENGINE].length =
+ &_tbind[TBIND_v3_CONTEXT_ENGINE].buffer_length;
+
+ _tbind[TBIND_v3_MSGID].is_null =
+ _tbind[TBIND_v3_SECURITY_LEVEL].is_null =
+ _tbind[TBIND_v3_CONTEXT_NAME].is_null =
+ _tbind[TBIND_v3_CONTEXT_ENGINE].is_null =
+ _tbind[TBIND_v3_SECURITY_NAME].is_null =
+ _tbind[TBIND_v3_SECURITY_ENGINE].is_null = &_no_v3;
+
+ /** variable static bindings */
+ _vbind[VBIND_ID].buffer_type = MYSQL_TYPE_LONG;
+ _vbind[VBIND_ID].is_unsigned = 1;
+
+ _vbind[VBIND_OID].buffer_type = MYSQL_TYPE_STRING;
+ _vbind[VBIND_OID].length = &_vbind[VBIND_OID].buffer_length;
+
+ _vbind[VBIND_TYPE].buffer_type = MYSQL_TYPE_SHORT;
+ _vbind[VBIND_TYPE].is_unsigned = 1;
+
+#ifdef NETSNMP_MYSQL_TRAP_VALUE_TEXT
+ _vbind[VBIND_VAL].buffer_type = MYSQL_TYPE_STRING;
+#else
+ _vbind[VBIND_VAL].buffer_type = MYSQL_TYPE_BLOB;
+#endif
+ _vbind[VBIND_VAL].length = &_vbind[VBIND_VAL].buffer_length;
+
+ _sql.conn = mysql_init (NULL);
+ if (_sql.conn == NULL) {
+ netsnmp_sql_error("mysql_init() failed (out of memory?)");
+ return -1;
+ }
+
+ /** try to connect; we'll try again later if we fail */
+ (void) netsnmp_mysql_connect();
+
+ /** register periodic queue save */
+ _sql.alarm_id = snmp_alarm_register(_sql.queue_interval, /* seconds */
+ 1, /* repeat */
+ _sql_process_queue, /* function */
+ NULL); /* client args */
+
+ /** add handler */
+ traph = netsnmp_add_global_traphandler(NETSNMPTRAPD_PRE_HANDLER,
+ mysql_handler);
+ if (NULL == traph) {
+ snmp_log(LOG_ERR, "Could not allocate sql trap handler\n");
+ return -1;
+ }
+ traph->authtypes = TRAP_AUTH_LOG;
+
+ atexit(netsnmp_mysql_cleanup);
+ return 0;
+}
+
+/*
+ * log CSV version of trap.
+ * dontcare param is there so this function can be passed directly
+ * to CONTAINER_FOR_EACH.
+ */
+static void
+_sql_log(sql_buf *sqlb, void* dontcare)
+{
+ netsnmp_iterator *it;
+ sql_vb_buf *sqlvb;
+
+ if ((NULL == sqlb) || sqlb->logged)
+ return;
+
+ /*
+ * log trap info
+ * nothing done to protect against data insertion attacks with
+ * respect to bad data (commas, newlines, etc)
+ */
+ snmp_log(LOG_ERR,
+ "trap:%d-%d-%d %d:%d:%d,%s,%d,%d,%d,%s,%s,%d,%d,%d,%s,%s,%s,%s\n",
+ sqlb->time.year,sqlb->time.month,sqlb->time.day,
+ sqlb->time.hour,sqlb->time.minute,sqlb->time.second,
+ sqlb->user,
+ sqlb->type, sqlb->version, sqlb->reqid, sqlb->oid,
+ sqlb->transport, sqlb->security_model, sqlb->msgid,
+ sqlb->security_level, sqlb->context,
+ sqlb->context_engine, sqlb->security_name,
+ sqlb->security_engine);
+
+ sqlb->logged = 1; /* prevent multiple logging */
+
+ it = CONTAINER_ITERATOR(sqlb->varbinds);
+ if (NULL == it) {
+ snmp_log(LOG_ERR,
+ "error creating iterator; incomplete trap logged\n");
+ return;
+ }
+
+ /** log varbind info */
+ for( sqlvb = ITERATOR_FIRST(it); sqlvb; sqlvb = ITERATOR_NEXT(it)) {
+#ifdef NETSNMP_MYSQL_TRAP_VALUE_TEXT
+ snmp_log(LOG_ERR,"varbind:%s,%s\n", sqlvb->oid, sqlvb->val);
+#else
+ char *hex;
+ int len = binary_to_hex(sqlvb->val, sqlvb->val_len, &hex);
+ if (hex) {
+ snmp_log(LOG_ERR,"varbind:%d,%s,%s\n", sqlvb->oid, hex);
+ free(hex);
+ }
+ else {
+ snmp_log(LOG_ERR,"malloc failed for varbind hex value\n");
+ snmp_log(LOG_ERR,"varbind:%s,\n", sqlvb->oid);
+ }
+#endif
+ }
+ ITERATOR_RELEASE(it);
+
+}
+
+/*
+ * free a buffer
+ * dontcare param is there so this function can be passed directly
+ * to CONTAINER_FOR_EACH.
+ */
+static void
+_sql_vb_buf_free(sql_vb_buf *sqlvb, void* dontcare)
+{
+ if (NULL == sqlvb)
+ return;
+
+ SNMP_FREE(sqlvb->oid);
+ SNMP_FREE(sqlvb->val);
+
+ free(sqlvb);
+}
+
+/*
+ * free a buffer
+ * dontcare param is there so this function can be passed directly
+ * to CONTAINER_FOR_EACH.
+ */
+static void
+_sql_buf_free(sql_buf *sqlb, void* dontcare)
+{
+ if (NULL == sqlb)
+ return;
+
+ /** do varbinds first */
+ if (sqlb->varbinds) {
+ CONTAINER_CLEAR(sqlb->varbinds,
+ (netsnmp_container_obj_func*)_sql_vb_buf_free, NULL);
+ CONTAINER_FREE(sqlb->varbinds);
+ }
+
+ SNMP_FREE(sqlb->host);
+ SNMP_FREE(sqlb->oid);
+ SNMP_FREE(sqlb->user);
+
+ SNMP_FREE(sqlb->context);
+ SNMP_FREE(sqlb->security_name);
+ SNMP_FREE(sqlb->context_engine);
+ SNMP_FREE(sqlb->security_engine);
+ SNMP_FREE(sqlb->transport);
+
+ free(sqlb);
+}
+
+/*
+ * allocate buffer to store trap and varbinds
+ */
+static sql_buf *
+_sql_buf_get(void)
+{
+ sql_buf *sqlb;
+
+ /** buffer for trap info */
+ sqlb = SNMP_MALLOC_TYPEDEF(sql_buf);
+ if (NULL == sqlb)
+ return NULL;
+
+ /** fifo for varbinds */
+ sqlb->varbinds = netsnmp_container_find("fifo");
+ if (NULL == sqlb->varbinds) {
+ free(sqlb);
+ return NULL;
+ }
+
+ return sqlb;
+}
+
+/*
+ * save info from incoming trap
+ *
+ * return 0 on success, anything else is an error
+ */
+static int
+_sql_save_trap_info(sql_buf *sqlb, netsnmp_pdu *pdu,
+ netsnmp_transport *transport)
+{
+ static oid trapoids[] = { 1, 3, 6, 1, 6, 3, 1, 1, 5, 0 };
+ oid *trap_oid, tmp_oid[MAX_OID_LEN];
+ time_t now;
+ struct tm *cur_time;
+ size_t tmp_size;
+ size_t buf_host_len_t, buf_oid_len_t, buf_user_len_t;
+ int oid_overflow, trap_oid_len;
+ netsnmp_variable_list *vars;
+
+ if ((NULL == sqlb) || (NULL == pdu) || (NULL == transport))
+ return -1;
+
+ DEBUGMSGTL(("sql:queue", "queueing incoming trap\n"));
+
+ /** time */
+ (void) time(&now);
+ cur_time = localtime(&now);
+ sqlb->time.year = cur_time->tm_year + 1900;
+ sqlb->time.month = cur_time->tm_mon + 1;
+ sqlb->time.day = cur_time->tm_mday;
+ sqlb->time.hour = cur_time->tm_hour;
+ sqlb->time.minute = cur_time->tm_min;
+ sqlb->time.second = cur_time->tm_sec;
+ sqlb->time.second_part = 0;
+ sqlb->time.neg = 0;
+
+ /** host name */
+ buf_host_len_t = 0;
+ tmp_size = sizeof(sqlb->host);
+ realloc_format_trap((u_char**)&sqlb->host, &tmp_size,
+ &buf_host_len_t, 1, "%B", pdu, transport);
+ sqlb->host_len = buf_host_len_t;
+
+ /* snmpTrapOID */
+ if (pdu->command == SNMP_MSG_TRAP) {
+ /*
+ * convert a v1 trap to a v2 varbind
+ */
+ if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) {
+ trap_oid_len = pdu->enterprise_length;
+ memcpy(tmp_oid, pdu->enterprise, sizeof(oid) * trap_oid_len);
+ if (tmp_oid[trap_oid_len - 1] != 0)
+ tmp_oid[trap_oid_len++] = 0;
+ tmp_oid[trap_oid_len++] = pdu->specific_type;
+ trap_oid = tmp_oid;
+ } else {
+ trapoids[9] = pdu->trap_type + 1;
+ trap_oid = trapoids;
+ trap_oid_len = OID_LENGTH(trapoids);
+ }
+ }
+ else {
+ vars = pdu->variables;
+ if (vars && vars->next_variable) {
+ trap_oid_len = vars->next_variable->val_len / sizeof(oid);
+ trap_oid = vars->next_variable->val.objid;
+ }
+ else {
+ static oid null_oid[] = { 0, 0 };
+ trap_oid_len = OID_LENGTH(null_oid);
+ trap_oid = null_oid;
+ }
+ }
+ tmp_size = 0;
+ buf_oid_len_t = oid_overflow = 0;
+ netsnmp_sprint_realloc_objid_tree((u_char**)&sqlb->oid,&tmp_size,
+ &buf_oid_len_t, 1, &oid_overflow,
+ trap_oid, trap_oid_len);
+ sqlb->oid_len = buf_oid_len_t;
+ if (oid_overflow)
+ snmp_log(LOG_WARNING,"OID truncated in sql buffer\n");
+
+ /** request id */
+ sqlb->reqid = pdu->reqid;
+
+ /** version (convert to 1 based, for sql enum) */
+ sqlb->version = pdu->version + 1;
+
+ /** command type (convert to 1 based, for sql enum) */
+ sqlb->type = pdu->command - 159;
+
+ /** community string/user name */
+ tmp_size = 0;
+ buf_user_len_t = 0;
+ realloc_format_trap((u_char**)&sqlb->user, &tmp_size,
+ &buf_user_len_t, 1, "%u", pdu, transport);
+ sqlb->user_len = buf_user_len_t;
+
+ /** transport */
+ sqlb->transport = transport->f_fmtaddr(transport, pdu->transport_data,
+ pdu->transport_data_length);
+
+ /** security model */
+ sqlb->security_model = pdu->securityModel;
+
+ if ((SNMP_MP_MODEL_SNMPv3+1) == sqlb->version) {
+
+ sqlb->msgid = pdu->msgid;
+ sqlb->security_level = pdu->securityLevel;
+
+ if (pdu->contextName) {
+ sqlb->context = netsnmp_strdup_and_null((u_char*)pdu->contextName,
+ pdu->contextNameLen);
+ sqlb->context_len = pdu->contextNameLen;
+ }
+ if (pdu->contextEngineID) {
+ sqlb->context_engine_len =
+ binary_to_hex(pdu->contextEngineID, pdu->contextEngineIDLen,
+ &sqlb->context_engine);
+ }
+
+ if (pdu->securityName) {
+ sqlb->security_name =
+ netsnmp_strdup_and_null((u_char*)pdu->securityName,
+ pdu->securityNameLen);
+ sqlb->security_name_len = pdu->securityNameLen;
+ }
+ if (pdu->securityEngineID) {
+ sqlb->security_engine_len =
+ binary_to_hex(pdu->securityEngineID, pdu->securityEngineIDLen,
+ &sqlb->security_engine);
+ }
+ }
+
+ return 0;
+}
+
+/*
+ * save varbind info from incoming trap
+ *
+ * return 0 on success, anything else is an error
+ */
+static int
+_sql_save_varbind_info(sql_buf *sqlb, netsnmp_pdu *pdu)
+{
+ netsnmp_variable_list *var;
+ sql_vb_buf *sqlvb;
+ size_t tmp_size, buf_oid_len_t;
+ int oid_overflow, rc;
+#ifdef NETSNMP_MYSQL_TRAP_VALUE_TEXT
+ size_t buf_val_len_t;
+#endif
+
+ if ((NULL == sqlb) || (NULL == pdu))
+ return -1;
+
+ var = pdu->variables;
+ while(var) {
+ sqlvb = SNMP_MALLOC_TYPEDEF(sql_vb_buf);
+ if (NULL == sqlvb)
+ break;
+
+ /** OID */
+ tmp_size = 0;
+ buf_oid_len_t = oid_overflow = 0;
+ netsnmp_sprint_realloc_objid_tree((u_char**)&sqlvb->oid, &tmp_size,
+ &buf_oid_len_t,
+ 1, &oid_overflow, var->name,
+ var->name_length);
+ sqlvb->oid_len = buf_oid_len_t;
+ if (oid_overflow)
+ snmp_log(LOG_WARNING,"OID truncated in sql insert\n");
+
+ /** type */
+ if (var->type > ASN_OBJECT_ID)
+ /** convert application types to sql enum */
+ sqlvb->type = ASN_OBJECT_ID + 1 + (var->type & ~ASN_APPLICATION);
+ else
+ sqlvb->type = var->type;
+
+ /** value */
+#ifdef NETSNMP_MYSQL_TRAP_VALUE_TEXT
+ tmp_size = 0;
+ buf_val_len_t = 0;
+ sprint_realloc_by_type((u_char**)&sqlvb->val, &tmp_size,
+ &buf_val_len_t, 1, var, 0, 0, 0);
+ sqlvb->val_len = buf_val_len_t;
+#else
+ memdup(&sqlvb->val, var->val.string, var->val_len);
+ sqlvb->val_len = var->val_len;
+#endif
+
+ var = var->next_variable;
+
+ /** insert into container */
+ rc = CONTAINER_INSERT(sqlb->varbinds,sqlvb);
+ if(rc)
+ snmp_log(LOG_ERR, "couldn't insert varbind into trap container\n");
+ }
+
+ return 0;
+}
+
+/*
+ * sql trap handler
+ */
+int
+mysql_handler(netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler)
+{
+ sql_buf *sqlb;
+ int old_format, rc;
+
+ DEBUGMSGTL(("sql:handler", "called\n"));
+
+ /** allocate a buffer to save data */
+ sqlb = _sql_buf_get();
+ if (NULL == sqlb) {
+ snmp_log(LOG_ERR, "Could not allocate trap sql buffer\n");
+ return syslog_handler( pdu, transport, handler );
+ }
+
+ /** save OID output format and change to numeric */
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+
+
+ rc = _sql_save_trap_info(sqlb, pdu, transport);
+ rc = _sql_save_varbind_info(sqlb, pdu);
+
+ /** restore previous OID output format */
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ old_format);
+
+ /** insert into queue */
+ rc = CONTAINER_INSERT(_sql.queue, sqlb);
+ if(rc) {
+ snmp_log(LOG_ERR, "Could not log queue sql trap buffer\n");
+ _sql_log(sqlb, NULL);
+ _sql_buf_free(sqlb, 0);
+ return -1;
+ }
+
+ /** save queue if size is > max */
+ if (CONTAINER_SIZE(_sql.queue) >= _sql.queue_max)
+ _sql_process_queue(0,NULL);
+
+ return 0;
+}
+
+/*
+ * save a buffered trap to sql database
+ */
+static void
+_sql_save(sql_buf *sqlb, void *dontcare)
+{
+ netsnmp_iterator *it;
+ sql_vb_buf *sqlvb;
+ u_long trap_id;
+
+ /*
+ * don't even try if we don't have a database connection
+ */
+ if (0 == _sql.connected) {
+ _sql_log(sqlb, NULL);
+ return;
+ }
+
+ /*
+ * the prepared statements are bound to the static buffer objects,
+ * so copy the queued data to the static version.
+ */
+ _tbind[TBIND_HOST].buffer = sqlb->host;
+ _tbind[TBIND_HOST].buffer_length = sqlb->host_len;
+
+ _tbind[TBIND_OID].buffer = sqlb->oid;
+ _tbind[TBIND_OID].buffer_length = sqlb->oid_len;
+
+ _tbind[TBIND_REQID].buffer = (void *)&sqlb->reqid;
+ _tbind[TBIND_VER].buffer = (void *)&sqlb->version;
+ _tbind[TBIND_TYPE].buffer = (void *)&sqlb->type;
+ _tbind[TBIND_SECURITY_MODEL].buffer = (void *)&sqlb->security_model;
+
+ _tbind[TBIND_DATE].buffer = (void *)&sqlb->time;
+
+ _tbind[TBIND_USER].buffer = sqlb->user;
+ _tbind[TBIND_USER].buffer_length = sqlb->user_len;
+
+ _tbind[TBIND_TRANSPORT].buffer = sqlb->transport;
+ if (sqlb->transport)
+ _tbind[TBIND_TRANSPORT].buffer_length = strlen(sqlb->transport);
+ else
+ _tbind[TBIND_TRANSPORT].buffer_length = 0;
+
+
+ if ((SNMP_MP_MODEL_SNMPv3+1) == sqlb->version) {
+ _no_v3 = 0;
+
+ _tbind[TBIND_v3_MSGID].buffer = &sqlb->msgid;
+
+ _tbind[TBIND_v3_SECURITY_LEVEL].buffer = &sqlb->security_level;
+
+ _tbind[TBIND_v3_CONTEXT_NAME].buffer = sqlb->context;
+ _tbind[TBIND_v3_CONTEXT_NAME].buffer_length = sqlb->context_len;
+
+ _tbind[TBIND_v3_CONTEXT_ENGINE].buffer = sqlb->context_engine;
+ _tbind[TBIND_v3_CONTEXT_ENGINE].buffer_length =
+ sqlb->context_engine_len;
+
+ _tbind[TBIND_v3_SECURITY_NAME].buffer = sqlb->security_name;
+ _tbind[TBIND_v3_SECURITY_NAME].buffer_length = sqlb->security_name_len;
+
+ _tbind[TBIND_v3_SECURITY_ENGINE].buffer = sqlb->security_engine;
+ _tbind[TBIND_v3_SECURITY_ENGINE].buffer_length =
+ sqlb->security_engine_len;
+ }
+ else {
+ _no_v3 = 1;
+ }
+
+ if (mysql_stmt_bind_param(_sql.trap_stmt, _tbind) != 0) {
+ netsnmp_sql_stmt_error(_sql.trap_stmt,
+ "Could not bind parameters for INSERT");
+ _sql_log(sqlb, NULL);
+ return;
+ }
+
+ /** execute the prepared statement */
+ if (mysql_stmt_execute(_sql.trap_stmt) != 0) {
+ netsnmp_sql_stmt_error(_sql.trap_stmt,
+ "Could not execute insert statement for trap");
+ _sql_log(sqlb, NULL);
+ return;
+ }
+ trap_id = mysql_insert_id(_sql.conn);
+
+ /*
+ * iterate over the varbinds, copy data and insert
+ */
+ it = CONTAINER_ITERATOR(sqlb->varbinds);
+ if (NULL == it) {
+ snmp_log(LOG_ERR,"Could not allocate iterator\n");
+ _sql_log(sqlb, NULL);
+ return;
+ }
+
+ for( sqlvb = ITERATOR_FIRST(it); sqlvb; sqlvb = ITERATOR_NEXT(it)) {
+
+ _vbind[VBIND_ID].buffer = (void *)&trap_id;
+ _vbind[VBIND_TYPE].buffer = (void *)&sqlvb->type;
+
+ _vbind[VBIND_OID].buffer = sqlvb->oid;
+ _vbind[VBIND_OID].buffer_length = sqlvb->oid_len;
+
+ _vbind[VBIND_VAL].buffer = sqlvb->val;
+ _vbind[VBIND_VAL].buffer_length = sqlvb->val_len;
+
+ if (mysql_stmt_bind_param(_sql.vb_stmt, _vbind) != 0) {
+ netsnmp_sql_stmt_error(_sql.vb_stmt,
+ "Could not bind parameters for INSERT");
+ _sql_log(sqlb, NULL);
+ break;
+ }
+
+ if (mysql_stmt_execute(_sql.vb_stmt) != 0) {
+ netsnmp_sql_stmt_error(_sql.vb_stmt,
+ "Could not execute insert statement for varbind");
+ _sql_log(sqlb, NULL);
+ break;
+ }
+ }
+ ITERATOR_RELEASE(it);
+}
+
+/*
+ * process (save) queued items to sql database.
+ *
+ * dontcare & meeither are dummy params so this function can be used
+ * as a netsnmp_alarm callback function.
+ */
+static void
+_sql_process_queue(u_int dontcare, void *meeither)
+{
+ int rc;
+
+ /** bail if the queue is empty */
+ if( 0 == CONTAINER_SIZE(_sql.queue))
+ return;
+
+ DEBUGMSGT(("sql:process", "processing %d queued traps\n",
+ (int)CONTAINER_SIZE(_sql.queue)));
+
+ /*
+ * if we don't have a database connection, try to reconnect. We
+ * don't care if we fail - traps will be logged in that case.
+ */
+ if (0 == _sql.connected) {
+ DEBUGMSGT(("sql:process", "no sql connection; reconnecting\n"));
+ (void) netsnmp_mysql_connect();
+ }
+
+ CONTAINER_FOR_EACH(_sql.queue, (netsnmp_container_obj_func*)_sql_save,
+ NULL);
+
+ if (_sql.connected) {
+ rc = mysql_commit(_sql.conn);
+ if (rc) { /* nuts... now what? */
+ netsnmp_sql_error("commit failed");
+ CONTAINER_FOR_EACH(_sql.queue,
+ (netsnmp_container_obj_func*)_sql_log,
+ NULL);
+ }
+ }
+
+ CONTAINER_CLEAR(_sql.queue, (netsnmp_container_obj_func*)_sql_buf_free,
+ NULL);
+}
+
+#else
+int unused; /* Suppress "empty translation unit" warning */
+#endif /* NETSNMP_USE_MYSQL */
diff --git a/apps/snmpusm.c b/apps/snmpusm.c
new file mode 100644
index 0000000..42919bd
--- /dev/null
+++ b/apps/snmpusm.c
@@ -0,0 +1,1023 @@
+/*
+ * snmpusm.c - send snmp SET requests to a network entity to change the
+ * usm user database
+ *
+ * XXX get engineID dynamically.
+ * XXX read passwords from prompts
+ * XXX customize responses with user names, etc.
+ */
+/* 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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#if defined(HAVE_OPENSSL_DH_H) && defined(HAVE_LIBCRYPTO)
+#include <openssl/dh.h>
+#endif /* HAVE_OPENSSL_DH_H && HAVE_LIBCRYPTO */
+
+#include <net-snmp/net-snmp-includes.h>
+
+int main(int, char **);
+
+#define CMD_PASSWD_NAME "passwd"
+#define CMD_PASSWD 1
+#define CMD_CREATE_NAME "create"
+#define CMD_CREATE 2
+#define CMD_DELETE_NAME "delete"
+#define CMD_DELETE 3
+#define CMD_CLONEFROM_NAME "cloneFrom"
+#define CMD_CLONEFROM 4
+#define CMD_ACTIVATE_NAME "activate"
+#define CMD_ACTIVATE 5
+#define CMD_DEACTIVATE_NAME "deactivate"
+#define CMD_DEACTIVATE 6
+#define CMD_CHANGEKEY_NAME "changekey"
+#define CMD_CHANGEKEY 7
+
+#define CMD_NUM 7
+
+static const char *successNotes[CMD_NUM] = {
+ "SNMPv3 Key(s) successfully changed.",
+ "User successfully created.",
+ "User successfully deleted.",
+ "User successfully cloned.",
+ "User successfully activated.",
+ "User successfully deactivated.",
+ "SNMPv3 Key(s) successfully changed."
+};
+
+#define USM_OID_LEN 12
+#define DH_USM_OID_LEN 11
+
+static oid
+
+authKeyOid[MAX_OID_LEN] = { 1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 6 },
+ownAuthKeyOid[MAX_OID_LEN] = {1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 7},
+privKeyOid[MAX_OID_LEN] = {1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 9},
+ownPrivKeyOid[MAX_OID_LEN] = {1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 10},
+usmUserCloneFrom[MAX_OID_LEN] = {1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 4},
+usmUserSecurityName[MAX_OID_LEN] = {1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 3},
+usmUserPublic[MAX_OID_LEN] = {1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 11},
+usmUserStatus[MAX_OID_LEN] = {1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 13},
+/* diffie helman change key objects */
+usmDHUserAuthKeyChange[MAX_OID_LEN] = {1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 1 },
+usmDHUserPrivKeyChange[MAX_OID_LEN] = {1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 3 },
+#if defined(HAVE_OPENSSL_DH_H) && defined(HAVE_LIBCRYPTO)
+usmDHUserOwnAuthKeyChange[MAX_OID_LEN] = {1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 2 },
+usmDHUserOwnPrivKeyChange[MAX_OID_LEN] = {1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 4 },
+#endif /* HAVE_OPENSSL_DH_H && HAVE_LIBCRYPTO */
+usmDHParameters[] = { 1,3,6,1,3,101,1,1,1,0 }
+;
+size_t usmDHParameters_len = OID_LENGTH(usmDHParameters);
+
+static
+oid *authKeyChange = authKeyOid, *privKeyChange = privKeyOid;
+oid *dhauthKeyChange = usmDHUserAuthKeyChange,
+ *dhprivKeyChange = usmDHUserPrivKeyChange;
+int doauthkey = 0, doprivkey = 0, uselocalizedkey = 0;
+size_t usmUserEngineIDLen = 0;
+u_char *usmUserEngineID = NULL;
+char *usmUserPublic_val = NULL;
+int docreateandwait = 0;
+
+
+void
+usage(void)
+{
+ fprintf(stderr, "Usage: snmpusm ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " COMMAND\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr, "\nsnmpusm commands:\n");
+ fprintf(stderr, " [options] create USER [CLONEFROM-USER]\n");
+ fprintf(stderr, " [options] delete USER\n");
+ fprintf(stderr, " [options] activate USER\n");
+ fprintf(stderr, " [options] deactivate USER\n");
+ fprintf(stderr, " [options] [-Cw] cloneFrom USER CLONEFROM-USER\n");
+ fprintf(stderr, " [options] [-Ca] [-Cx] changekey [USER]\n");
+ fprintf(stderr,
+ " [options] [-Ca] [-Cx] passwd OLD-PASSPHRASE NEW-PASSPHRASE [USER]\n");
+ fprintf(stderr,
+ " [options] (-Ca|-Cx) -Ck passwd OLD-KEY-OR-PASS NEW-KEY-OR-PASS [USER]\n");
+ fprintf(stderr, "\nsnmpusm options:\n");
+ fprintf(stderr, "\t-CE ENGINE-ID\tSet usmUserEngineID (e.g. 800000020109840301).\n");
+ fprintf(stderr, "\t-Cp STRING\tSet usmUserPublic value to STRING.\n");
+ fprintf(stderr, "\t-Cw\t\tCreate the user with createAndWait.\n");
+ fprintf(stderr, "\t\t\t(it won't be active until you active it)\n");
+ fprintf(stderr, "\t-Cx\t\tChange the privacy key.\n");
+ fprintf(stderr, "\t-Ca\t\tChange the authentication key.\n");
+ fprintf(stderr, "\t-Ck\t\tAllows to use localized key (must start with 0x)\n");
+ fprintf(stderr, "\t\t\tinstead of passphrase.\n");
+}
+
+/*
+ * setup_oid appends to the oid the index for the engineid/user
+ */
+void
+setup_oid(oid * it, size_t * len, u_char * id, size_t idlen,
+ const char *user)
+{
+ int i, itIndex = *len;
+
+ *len = itIndex + 1 + idlen + 1 + strlen(user);
+
+ it[itIndex++] = idlen;
+ for (i = 0; i < (int) idlen; i++) {
+ it[itIndex++] = id[i];
+ }
+
+ it[itIndex++] = strlen(user);
+ for (i = 0; i < (int) strlen(user); i++) {
+ it[itIndex++] = user[i];
+ }
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ fprintf(stdout, "setup_oid: ");
+ fprint_objid(stdout, it, *len);
+ fprintf(stdout, "\n");
+#endif
+}
+
+#if defined(HAVE_OPENSSL_DH_H) && defined(HAVE_LIBCRYPTO)
+int
+get_USM_DH_key(netsnmp_variable_list *vars, netsnmp_variable_list *dhvar,
+ size_t outkey_len,
+ netsnmp_pdu *pdu, const char *keyname,
+ oid *keyoid, size_t keyoid_len) {
+ u_char *dhkeychange;
+ DH *dh;
+ BIGNUM *other_pub;
+ u_char *key;
+ size_t key_len;
+
+ dhkeychange = (u_char *) malloc(2 * vars->val_len * sizeof(char));
+ if (!dhkeychange)
+ return SNMPERR_GENERR;
+
+ memcpy(dhkeychange, vars->val.string, vars->val_len);
+
+ {
+ const unsigned char *cp = dhvar->val.string;
+ dh = d2i_DHparams(NULL, &cp, dhvar->val_len);
+ }
+
+ if (!dh || !dh->g || !dh->p) {
+ SNMP_FREE(dhkeychange);
+ return SNMPERR_GENERR;
+ }
+
+ DH_generate_key(dh);
+ if (!dh->pub_key) {
+ SNMP_FREE(dhkeychange);
+ return SNMPERR_GENERR;
+ }
+
+ if (vars->val_len != (unsigned int)BN_num_bytes(dh->pub_key)) {
+ SNMP_FREE(dhkeychange);
+ fprintf(stderr,"incorrect diffie-helman lengths (%lu != %d)\n",
+ (unsigned long)vars->val_len, BN_num_bytes(dh->pub_key));
+ return SNMPERR_GENERR;
+ }
+
+ BN_bn2bin(dh->pub_key, dhkeychange + vars->val_len);
+
+ key_len = DH_size(dh);
+ if (!key_len) {
+ SNMP_FREE(dhkeychange);
+ return SNMPERR_GENERR;
+ }
+ key = (u_char *) malloc(key_len * sizeof(u_char));
+
+ if (!key) {
+ SNMP_FREE(dhkeychange);
+ return SNMPERR_GENERR;
+ }
+
+ other_pub = BN_bin2bn(vars->val.string, vars->val_len, NULL);
+ if (!other_pub) {
+ SNMP_FREE(dhkeychange);
+ SNMP_FREE(key);
+ return SNMPERR_GENERR;
+ }
+
+ if (DH_compute_key(key, other_pub, dh)) {
+ u_char *kp;
+
+ printf("new %s key: 0x", keyname);
+ for(kp = key + key_len - outkey_len;
+ kp - key < (int)key_len; kp++) {
+ printf("%02x", (unsigned char) *kp);
+ }
+ printf("\n");
+ }
+
+ snmp_pdu_add_variable(pdu, keyoid, keyoid_len,
+ ASN_OCTET_STR, dhkeychange,
+ 2 * vars->val_len);
+
+ SNMP_FREE(dhkeychange);
+ SNMP_FREE(other_pub);
+ SNMP_FREE(key);
+
+ return SNMPERR_SUCCESS;
+}
+#endif /* HAVE_OPENSSL_DH_H */
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'a':
+ doauthkey = 1;
+ break;
+
+ case 'x':
+ doprivkey = 1;
+ break;
+
+ case 'k':
+ uselocalizedkey = 1;
+ break;
+
+ case 'p':
+ if (optind < argc) {
+ usmUserPublic_val = argv[optind];
+ } else {
+ fprintf(stderr, "Bad -Cp option: no argument given\n");
+ exit(1);
+ }
+ optind++;
+ break;
+
+ case 'w':
+ docreateandwait = 1;
+ break;
+
+ case 'E': {
+ size_t ebuf_len = MAX_ENGINEID_LENGTH;
+ u_char *ebuf;
+ if (optind < argc) {
+ if (argv[optind]) {
+ ebuf = (u_char *)malloc(ebuf_len);
+ if (ebuf == NULL) {
+ fprintf(stderr,
+ "malloc failure processing -CE option.\n");
+ exit(1);
+ }
+ if (!snmp_hex_to_binary(&ebuf, &ebuf_len,
+ &usmUserEngineIDLen, 1, argv[optind])) {
+ fprintf(stderr,
+ "Bad usmUserEngineID value after -CE option.\n");
+ free(ebuf);
+ exit(1);
+ }
+ usmUserEngineID = ebuf;
+ DEBUGMSGTL(("snmpusm", "usmUserEngineID set to: "));
+ DEBUGMSGHEX(("snmpusm", usmUserEngineID, usmUserEngineIDLen));
+ DEBUGMSG(("snmpusm", "\n"));
+
+ }
+ } else {
+ fprintf(stderr, "Bad -CE option: no argument given\n");
+ exit(1);
+ }
+ optind++;
+ break;
+ }
+
+ default:
+ fprintf(stderr, "Unknown flag passed to -C: %c\n",
+ optarg[-1]);
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu = NULL, *response = NULL;
+
+ int arg;
+ size_t name_length = USM_OID_LEN;
+ size_t name_length2 = USM_OID_LEN;
+ int status;
+ int exitval = 0;
+ int rval;
+ int command = 0;
+ long longvar;
+
+ size_t oldKu_len = SNMP_MAXBUF_SMALL,
+ newKu_len = SNMP_MAXBUF_SMALL,
+ oldkul_len = SNMP_MAXBUF_SMALL,
+ oldkulpriv_len = SNMP_MAXBUF_SMALL,
+ newkulpriv_len = SNMP_MAXBUF_SMALL,
+ newkul_len = SNMP_MAXBUF_SMALL,
+ keychange_len = SNMP_MAXBUF_SMALL,
+ keychangepriv_len = SNMP_MAXBUF_SMALL;
+
+ char *newpass = NULL, *oldpass = NULL;
+ u_char oldKu[SNMP_MAXBUF_SMALL],
+ newKu[SNMP_MAXBUF_SMALL],
+ oldkul[SNMP_MAXBUF_SMALL],
+ oldkulpriv[SNMP_MAXBUF_SMALL],
+ newkulpriv[SNMP_MAXBUF_SMALL],
+ newkul[SNMP_MAXBUF_SMALL], keychange[SNMP_MAXBUF_SMALL],
+ keychangepriv[SNMP_MAXBUF_SMALL];
+
+ authKeyChange = authKeyOid;
+ privKeyChange = privKeyOid;
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ if (arg >= argc) {
+ fprintf(stderr, "Please specify an operation to perform.\n");
+ usage();
+ exit(1);
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ /*
+ * Note: this needs to obtain the engineID used below
+ */
+ session.flags &= ~SNMP_FLAGS_DONT_PROBE;
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpusm", &session);
+ exit(1);
+ }
+
+ /*
+ * set usmUserEngineID from ss->contextEngineID
+ * if not already set (via -CE)
+ */
+ if (usmUserEngineID == NULL) {
+ usmUserEngineID = ss->contextEngineID;
+ usmUserEngineIDLen = ss->contextEngineIDLen;
+ }
+
+ /*
+ * create PDU for SET request and add object names and values to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_SET);
+ if (!pdu) {
+ fprintf(stderr, "Failed to create request\n");
+ exit(1);
+ }
+
+
+ if (strcmp(argv[arg], CMD_PASSWD_NAME) == 0) {
+
+ /*
+ * passwd: change a users password.
+ *
+ * XXX: Uses the auth type of the calling user, a MD5 user can't
+ * change a SHA user's key.
+ */
+ char *passwd_user;
+
+ command = CMD_PASSWD;
+ oldpass = argv[++arg];
+ newpass = argv[++arg];
+ passwd_user = argv[++arg];
+
+ if (doprivkey == 0 && doauthkey == 0)
+ doprivkey = doauthkey = 1;
+
+ if (newpass == NULL || strlen(newpass) < USM_LENGTH_P_MIN) {
+ fprintf(stderr,
+ "New passphrase must be greater than %d characters in length.\n",
+ USM_LENGTH_P_MIN);
+ exit(1);
+ }
+
+ if (oldpass == NULL || strlen(oldpass) < USM_LENGTH_P_MIN) {
+ fprintf(stderr,
+ "Old passphrase must be greater than %d characters in length.\n",
+ USM_LENGTH_P_MIN);
+ exit(1);
+ }
+
+ /*
+ * Change the user supplied on command line.
+ */
+ if ((passwd_user != NULL) && (strlen(passwd_user) > 0)) {
+ session.securityName = passwd_user;
+ } else {
+ /*
+ * Use own key object if no user was supplied.
+ */
+ authKeyChange = ownAuthKeyOid;
+ privKeyChange = ownPrivKeyOid;
+ }
+
+ /*
+ * do we have a securityName? If not, copy the default
+ */
+ if (session.securityName == NULL) {
+ session.securityName =
+ strdup(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SECNAME));
+ }
+
+ /*
+ * the old Ku is in the session, but we need the new one
+ */
+ if (session.securityAuthProto == NULL) {
+ /*
+ * get .conf set default
+ */
+ const oid *def =
+ get_default_authtype(&session.securityAuthProtoLen);
+ session.securityAuthProto =
+ snmp_duplicate_objid(def, session.securityAuthProtoLen);
+ }
+ if (session.securityAuthProto == NULL) {
+ /*
+ * assume MD5
+ */
+#ifndef NETSNMP_DISABLE_MD5
+ session.securityAuthProtoLen =
+ sizeof(usmHMACMD5AuthProtocol) / sizeof(oid);
+ session.securityAuthProto =
+ snmp_duplicate_objid(usmHMACMD5AuthProtocol,
+ session.securityAuthProtoLen);
+#else
+ session.securityAuthProtoLen =
+ sizeof(usmHMACSHA1AuthProtocol) / sizeof(oid);
+ session.securityAuthProto =
+ snmp_duplicate_objid(usmHMACSHA1AuthProtocol,
+ session.securityAuthProtoLen);
+#endif
+
+ }
+
+ if (uselocalizedkey && (strncmp(oldpass, "0x", 2) == 0)) {
+ /*
+ * use the localized key from the command line
+ */
+ u_char *buf;
+ size_t buf_len = SNMP_MAXBUF_SMALL;
+ buf = (u_char *) malloc (buf_len * sizeof(u_char));
+
+ oldkul_len = 0; /* initialize the offset */
+ if (!snmp_hex_to_binary((u_char **) (&buf), &buf_len, &oldkul_len, 0, oldpass)) {
+ snmp_perror(argv[0]);
+ fprintf(stderr, "generating the old Kul from localized key failed\n");
+ exit(1);
+ }
+
+ memcpy(oldkul, buf, oldkul_len);
+ SNMP_FREE(buf);
+ }
+ else {
+ /*
+ * the old Ku is in the session, but we need the new one
+ */
+ rval = generate_Ku(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ (u_char *) oldpass, strlen(oldpass),
+ oldKu, &oldKu_len);
+
+ if (rval != SNMPERR_SUCCESS) {
+ snmp_perror(argv[0]);
+ fprintf(stderr, "generating the old Ku failed\n");
+ exit(1);
+ }
+
+ /*
+ * generate the two Kul's
+ */
+ rval = generate_kul(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ usmUserEngineID, usmUserEngineIDLen,
+ oldKu, oldKu_len, oldkul, &oldkul_len);
+
+ if (rval != SNMPERR_SUCCESS) {
+ snmp_perror(argv[0]);
+ fprintf(stderr, "generating the old Kul failed\n");
+ exit(1);
+ }
+ }
+ if (uselocalizedkey && (strncmp(newpass, "0x", 2) == 0)) {
+ /*
+ * use the localized key from the command line
+ */
+ u_char *buf;
+ size_t buf_len = SNMP_MAXBUF_SMALL;
+ buf = (u_char *) malloc (buf_len * sizeof(u_char));
+
+ newkul_len = 0; /* initialize the offset */
+ if (!snmp_hex_to_binary((u_char **) (&buf), &buf_len, &newkul_len, 0, newpass)) {
+ snmp_perror(argv[0]);
+ fprintf(stderr, "generating the new Kul from localized key failed\n");
+ exit(1);
+ }
+
+ memcpy(newkul, buf, newkul_len);
+ SNMP_FREE(buf);
+ } else {
+ rval = generate_Ku(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ (u_char *) newpass, strlen(newpass),
+ newKu, &newKu_len);
+
+ if (rval != SNMPERR_SUCCESS) {
+ snmp_perror(argv[0]);
+ fprintf(stderr, "generating the new Ku failed\n");
+ exit(1);
+ }
+
+ rval = generate_kul(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ usmUserEngineID, usmUserEngineIDLen,
+ newKu, newKu_len, newkul, &newkul_len);
+
+ if (rval != SNMPERR_SUCCESS) {
+ snmp_perror(argv[0]);
+ fprintf(stderr, "generating the new Kul failed\n");
+ exit(1);
+ }
+ }
+
+ /*
+ * for encryption, we may need to truncate the key to the proper length
+ * so we need two copies. For simplicity, we always just copy even if
+ * they're the same lengths.
+ */
+ if (doprivkey) {
+ if (!session.securityPrivProto) {
+ snmp_log(LOG_ERR, "no encryption type specified, which I need in order to know to change the key\n");
+ exit(1);
+ }
+
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(session.securityPrivProto, DESPriv)) {
+ /* DES uses a 128 bit key, 64 bits of which is a salt */
+ oldkulpriv_len = newkulpriv_len = 16;
+ }
+#endif
+#ifdef HAVE_AES
+ if (ISTRANSFORM(session.securityPrivProto, AESPriv)) {
+ oldkulpriv_len = newkulpriv_len = 16;
+ }
+#endif
+ memcpy(oldkulpriv, oldkul, oldkulpriv_len);
+ memcpy(newkulpriv, newkul, newkulpriv_len);
+ }
+
+
+ /*
+ * create the keychange string
+ */
+ if (doauthkey) {
+ rval = encode_keychange(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ oldkul, oldkul_len,
+ newkul, newkul_len,
+ keychange, &keychange_len);
+
+ if (rval != SNMPERR_SUCCESS) {
+ snmp_perror(argv[0]);
+ fprintf(stderr, "encoding the keychange failed\n");
+ usage();
+ exit(1);
+ }
+ }
+
+ /* which is slightly different for encryption if lengths are
+ different */
+ if (doprivkey) {
+ rval = encode_keychange(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ oldkulpriv, oldkulpriv_len,
+ newkulpriv, newkulpriv_len,
+ keychangepriv, &keychangepriv_len);
+
+ if (rval != SNMPERR_SUCCESS) {
+ snmp_perror(argv[0]);
+ fprintf(stderr, "encoding the keychange failed\n");
+ usage();
+ exit(1);
+ }
+ }
+
+ /*
+ * add the keychange string to the outgoing packet
+ */
+ if (doauthkey) {
+ setup_oid(authKeyChange, &name_length,
+ usmUserEngineID, usmUserEngineIDLen,
+ session.securityName);
+ snmp_pdu_add_variable(pdu, authKeyChange, name_length,
+ ASN_OCTET_STR, keychange, keychange_len);
+ }
+ if (doprivkey) {
+ setup_oid(privKeyChange, &name_length2,
+ usmUserEngineID, usmUserEngineIDLen,
+ session.securityName);
+ snmp_pdu_add_variable(pdu, privKeyChange, name_length2,
+ ASN_OCTET_STR,
+ keychangepriv, keychangepriv_len);
+ }
+
+ } else if (strcmp(argv[arg], CMD_CREATE_NAME) == 0) {
+ /*
+ * create: create a user
+ *
+ * create USER [CLONEFROM]
+ */
+ if (++arg >= argc) {
+ fprintf(stderr, "You must specify the user name to create\n");
+ usage();
+ exit(1);
+ }
+
+ command = CMD_CREATE;
+
+ if (++arg < argc) {
+ /*
+ * clone the new user from an existing user
+ * (and make them active immediately)
+ */
+ setup_oid(usmUserStatus, &name_length,
+ usmUserEngineID, usmUserEngineIDLen, argv[arg-1]);
+ if (docreateandwait) {
+ longvar = RS_CREATEANDWAIT;
+ } else {
+ longvar = RS_CREATEANDGO;
+ }
+ snmp_pdu_add_variable(pdu, usmUserStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+
+ name_length = USM_OID_LEN;
+ setup_oid(usmUserCloneFrom, &name_length,
+ usmUserEngineID, usmUserEngineIDLen,
+ argv[arg - 1]);
+ setup_oid(usmUserSecurityName, &name_length2,
+ usmUserEngineID, usmUserEngineIDLen,
+ argv[arg]);
+ snmp_pdu_add_variable(pdu, usmUserCloneFrom, name_length,
+ ASN_OBJECT_ID,
+ (u_char *) usmUserSecurityName,
+ sizeof(oid) * name_length2);
+ } else {
+ /*
+ * create a new (unauthenticated) user from scratch
+ * The Net-SNMP agent won't allow such a user to be made active.
+ */
+ setup_oid(usmUserStatus, &name_length,
+ usmUserEngineID, usmUserEngineIDLen, argv[arg-1]);
+ longvar = RS_CREATEANDWAIT;
+ snmp_pdu_add_variable(pdu, usmUserStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ }
+
+ } else if (strcmp(argv[arg], CMD_CLONEFROM_NAME) == 0) {
+ /*
+ * create: clone a user from another
+ *
+ * cloneFrom USER FROM
+ */
+ if (++arg >= argc) {
+ fprintf(stderr,
+ "You must specify the user name to operate on\n");
+ usage();
+ exit(1);
+ }
+
+ command = CMD_CLONEFROM;
+ setup_oid(usmUserStatus, &name_length,
+ usmUserEngineID, usmUserEngineIDLen, argv[arg]);
+ longvar = RS_ACTIVE;
+ snmp_pdu_add_variable(pdu, usmUserStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ name_length = USM_OID_LEN;
+ setup_oid(usmUserCloneFrom, &name_length,
+ usmUserEngineID, usmUserEngineIDLen, argv[arg]);
+
+ if (++arg >= argc) {
+ fprintf(stderr,
+ "You must specify the user name to clone from\n");
+ usage();
+ exit(1);
+ }
+
+ setup_oid(usmUserSecurityName, &name_length2,
+ usmUserEngineID, usmUserEngineIDLen, argv[arg]);
+ snmp_pdu_add_variable(pdu, usmUserCloneFrom, name_length,
+ ASN_OBJECT_ID,
+ (u_char *) usmUserSecurityName,
+ sizeof(oid) * name_length2);
+
+ } else if (strcmp(argv[arg], CMD_DELETE_NAME) == 0) {
+ /*
+ * delete: delete a user
+ *
+ * delete USER
+ */
+ if (++arg >= argc) {
+ fprintf(stderr, "You must specify the user name to delete\n");
+ exit(1);
+ }
+
+ command = CMD_DELETE;
+ setup_oid(usmUserStatus, &name_length,
+ usmUserEngineID, usmUserEngineIDLen, argv[arg]);
+ longvar = RS_DESTROY;
+ snmp_pdu_add_variable(pdu, usmUserStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ } else if (strcmp(argv[arg], CMD_ACTIVATE_NAME) == 0) {
+ /*
+ * activate: activate a user
+ *
+ * activate USER
+ */
+ if (++arg >= argc) {
+ fprintf(stderr, "You must specify the user name to activate\n");
+ exit(1);
+ }
+
+ command = CMD_ACTIVATE;
+ setup_oid(usmUserStatus, &name_length,
+ usmUserEngineID, usmUserEngineIDLen, argv[arg]);
+ longvar = RS_ACTIVE;
+ snmp_pdu_add_variable(pdu, usmUserStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ } else if (strcmp(argv[arg], CMD_DEACTIVATE_NAME) == 0) {
+ /*
+ * deactivate: deactivate a user
+ *
+ * deactivate USER
+ */
+ if (++arg >= argc) {
+ fprintf(stderr, "You must specify the user name to deactivate\n");
+ exit(1);
+ }
+
+ command = CMD_DEACTIVATE;
+ setup_oid(usmUserStatus, &name_length,
+ usmUserEngineID, usmUserEngineIDLen, argv[arg]);
+ longvar = RS_NOTINSERVICE;
+ snmp_pdu_add_variable(pdu, usmUserStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+#if defined(HAVE_OPENSSL_DH_H) && defined(HAVE_LIBCRYPTO)
+ } else if (strcmp(argv[arg], CMD_CHANGEKEY_NAME) == 0) {
+ /*
+ * change the key of a user if DH is available
+ */
+
+ char *passwd_user;
+ netsnmp_pdu *dhpdu, *dhresponse = NULL;
+ netsnmp_variable_list *vars, *dhvar;
+
+ command = CMD_CHANGEKEY;
+ name_length = DH_USM_OID_LEN;
+ name_length2 = DH_USM_OID_LEN;
+
+ passwd_user = argv[++arg];
+
+ if (doprivkey == 0 && doauthkey == 0)
+ doprivkey = doauthkey = 1;
+
+ /*
+ * Change the user supplied on command line.
+ */
+ if ((passwd_user != NULL) && (strlen(passwd_user) > 0)) {
+ session.securityName = passwd_user;
+ } else {
+ /*
+ * Use own key object if no user was supplied.
+ */
+ dhauthKeyChange = usmDHUserOwnAuthKeyChange;
+ dhprivKeyChange = usmDHUserOwnPrivKeyChange;
+ }
+
+ /*
+ * do we have a securityName? If not, copy the default
+ */
+ if (session.securityName == NULL) {
+ session.securityName =
+ strdup(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SECNAME));
+ }
+
+ /* fetch the needed diffie helman parameters */
+ dhpdu = snmp_pdu_create(SNMP_MSG_GET);
+ if (!dhpdu) {
+ fprintf(stderr, "Failed to create DH request\n");
+ exit(1);
+ }
+
+ /* get the current DH parameters */
+ snmp_add_null_var(dhpdu, usmDHParameters, usmDHParameters_len);
+
+ /* maybe the auth key public value */
+ if (doauthkey) {
+ setup_oid(dhauthKeyChange, &name_length,
+ usmUserEngineID, usmUserEngineIDLen,
+ session.securityName);
+ snmp_add_null_var(dhpdu, dhauthKeyChange, name_length);
+ }
+
+ /* maybe the priv key public value */
+ if (doprivkey) {
+ setup_oid(dhprivKeyChange, &name_length2,
+ usmUserEngineID, usmUserEngineIDLen,
+ session.securityName);
+ snmp_add_null_var(dhpdu, dhprivKeyChange, name_length2);
+ }
+
+ /* fetch the values */
+ status = snmp_synch_response(ss, dhpdu, &dhresponse);
+
+ if (status != SNMPERR_SUCCESS || dhresponse == NULL ||
+ dhresponse->errstat != SNMP_ERR_NOERROR ||
+ dhresponse->variables->type != ASN_OCTET_STR) {
+ snmp_sess_perror("snmpusm", ss);
+ if (dhresponse && dhresponse->variables &&
+ dhresponse->variables->type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "Can't get diffie-helman exchange from the agent\n");
+ fprintf(stderr,
+ " (maybe it doesn't support the SNMP-USM-DH-OBJECTS-MIB MIB)\n");
+ }
+ exitval = 1;
+ goto begone;
+ }
+
+ dhvar = dhresponse->variables;
+ vars = dhvar->next_variable;
+ /* complete the DH equation & print resulting keys */
+ if (doauthkey) {
+ if (get_USM_DH_key(vars, dhvar,
+ sc_get_properlength(ss->securityAuthProto,
+ ss->securityAuthProtoLen),
+ pdu, "auth",
+ dhauthKeyChange, name_length) != SNMPERR_SUCCESS)
+ goto begone;
+ vars = vars->next_variable;
+ }
+ if (doprivkey) {
+ size_t dhprivKeyLen = 0;
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(ss->securityPrivProto, DESPriv)) {
+ /* DES uses a 128 bit key, 64 bits of which is a salt */
+ dhprivKeyLen = 16;
+ }
+#endif
+#ifdef HAVE_AES
+ if (ISTRANSFORM(ss->securityPrivProto, AESPriv)) {
+ dhprivKeyLen = 16;
+ }
+#endif
+ if (get_USM_DH_key(vars, dhvar,
+ dhprivKeyLen,
+ pdu, "priv",
+ dhprivKeyChange, name_length2)
+ != SNMPERR_SUCCESS)
+ goto begone;
+ vars = vars->next_variable;
+ }
+ /* snmp_free_pdu(dhresponse); */ /* parts still in use somewhere */
+#endif /* HAVE_OPENSSL_DH_H && HAVE_LIBCRYPTO */
+ } else {
+ fprintf(stderr, "Unknown command\n");
+ usage();
+ exit(1);
+ }
+
+ /*
+ * add usmUserPublic if specified (via -Cp)
+ */
+ if (usmUserPublic_val) {
+ name_length = USM_OID_LEN;
+ setup_oid(usmUserPublic, &name_length,
+ usmUserEngineID, usmUserEngineIDLen,
+ session.securityName);
+ snmp_pdu_add_variable(pdu, usmUserPublic, name_length,
+ ASN_OCTET_STR, usmUserPublic_val,
+ strlen(usmUserPublic_val));
+ }
+
+ /*
+ * do the request
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ fprintf(stdout, "%s\n", successNotes[command - 1]);
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ int count;
+ netsnmp_variable_list *vars;
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++)
+ /*EMPTY*/;
+ if (vars)
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ session.peername);
+ exitval = 1;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpset", ss);
+ exitval = 1;
+ }
+
+#if defined(HAVE_OPENSSL_DH_H) && defined(HAVE_LIBCRYPTO)
+ begone:
+#endif /* HAVE_OPENSSL_DH_H && HAVE_LIBCRYPTO */
+ if (response)
+ snmp_free_pdu(response);
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return exitval;
+}
diff --git a/apps/snmpvacm.c b/apps/snmpvacm.c
new file mode 100644
index 0000000..f88ede6
--- /dev/null
+++ b/apps/snmpvacm.c
@@ -0,0 +1,711 @@
+/*
+ * snmpvacm.c - send snmp SET requests to a network entity to change the
+ * vacm database
+ *
+ */
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <ctype.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+int main(int, char **);
+
+#define CMD_CREATESEC2GROUP_NAME "createSec2Group"
+#define CMD_CREATESEC2GROUP 1
+#define CMD_DELETESEC2GROUP_NAME "deleteSec2Group"
+#define CMD_DELETESEC2GROUP 2
+#define CMD_CREATEACCESS_NAME "createAccess"
+#define CMD_CREATEACCESS 3
+#define CMD_DELETEACCESS_NAME "deleteAccess"
+#define CMD_DELETEACCESS 4
+#define CMD_CREATEVIEW_NAME "createView"
+#define CMD_CREATEVIEW 5
+#define CMD_DELETEVIEW_NAME "deleteView"
+#define CMD_DELETEVIEW 6
+#define CMD_CREATEAUTH_NAME "createAuth"
+#define CMD_CREATEAUTH 7
+#define CMD_DELETEAUTH_NAME "deleteAuth"
+#define CMD_DELETEAUTH 8
+
+#define CMD_NUM 8
+
+static const char *successNotes[CMD_NUM] = {
+ "Sec2group successfully created.",
+ "Sec2group successfully deleted.",
+ "Access successfully created.",
+ "Access successfully deleted.",
+ "View successfully created.",
+ "View successfully deleted.",
+ "AuthAccess successfully created.",
+ "AuthAccess successfully deleted."
+};
+
+#define SEC2GROUP_OID_LEN 11
+#define ACCESS_OID_LEN 11
+#define VIEW_OID_LEN 12
+#define AUTH_OID_LEN 12
+
+static oid vacmGroupName[MAX_OID_LEN] =
+ { 1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 3 },
+ vacmSec2GroupStatus[MAX_OID_LEN] = {
+1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 5}, vacmAccessContextMatch[MAX_OID_LEN] = {
+1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 4}, vacmAccessReadViewName[MAX_OID_LEN] = {
+1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 5}, vacmAccessWriteViewName[MAX_OID_LEN] = {
+1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 6}, vacmAccessNotifyViewName[MAX_OID_LEN] = {
+1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 7}, vacmAccessStatus[MAX_OID_LEN] = {
+1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 9}, vacmViewTreeFamilyMask[MAX_OID_LEN] = {
+1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 3}, vacmViewTreeFamilyType[MAX_OID_LEN] = {
+1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 4},
+ vacmViewTreeFamilyStatus[MAX_OID_LEN] = {
+1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 6}
+
+;
+
+#define NSVACMACCESSTABLE 1, 3, 6, 1, 4, 1, 8072, 1, 9, 1
+static oid nsVacmContextPfx[MAX_OID_LEN] = { NSVACMACCESSTABLE, 1, 2 };
+static oid nsVacmViewName[MAX_OID_LEN] = { NSVACMACCESSTABLE, 1, 3 };
+static oid nsVacmRowStatus[MAX_OID_LEN] = { NSVACMACCESSTABLE, 1, 5 };
+
+int viewTreeFamilyType = 1;
+
+void
+usage(void)
+{
+ fprintf(stderr, "Usage: snmpvacm ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " COMMAND\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr, "\nsnmpvacm commands:\n");
+ fprintf(stderr, " createAccess GROUPNAME [CONTEXTPREFIX] SECURITYMODEL SECURITYLEVEL CONTEXTMATCH READVIEWNAME WRITEVIEWNAME NOTIFYVIEWNAME\n");
+ fprintf(stderr, " deleteAccess GROUPNAME [CONTEXTPREFIX] SECURITYMODEL SECURITYLEVEL\n");
+ fprintf(stderr, " createSec2Group MODEL SECURITYNAME GROUPNAME\n");
+ fprintf(stderr, " deleteSec2Group MODEL SECURITYNAME\n");
+ fprintf(stderr, " [-Ce] createView NAME SUBTREE [MASK]\n");
+ fprintf(stderr, " deleteView NAME SUBTREE\n");
+ fprintf(stderr, " createAuth GROUPNAME [CONTEXTPREFIX] SECURITYMODEL SECURITYLEVEL AUTHTYPE CONTEXTMATCH VIEWNAME\n");
+ fprintf(stderr, " deleteAuth GROUPNAME [CONTEXTPREFIX] SECURITYMODEL SECURITYLEVEL AUTHTYPE\n");
+}
+
+
+void
+auth_oid(oid * it, size_t * len, const char *groupName,
+ const char *prefix, int model, int level, const char *authtype)
+{
+ int i;
+ int itIndex = AUTH_OID_LEN;
+
+ it[itIndex++] = strlen(groupName);
+ for (i = 0; i < (int) strlen(groupName); i++)
+ it[itIndex++] = groupName[i];
+
+ if (prefix) {
+ *len += strlen(prefix);
+ it[itIndex++] = strlen(prefix);
+ for (i = 0; i < (int) strlen(prefix); i++)
+ it[itIndex++] = prefix[i];
+ } else
+ it[itIndex++] = 0;
+
+ it[itIndex++] = model;
+ it[itIndex++] = level;
+
+ it[itIndex++] = strlen(authtype);
+ for (i = 0; i < (int) strlen(authtype); i++)
+ it[itIndex++] = authtype[i];
+
+ *len = itIndex;
+}
+
+void
+access_oid(oid * it, size_t * len, const char *groupName,
+ const char *prefix, int model, int level)
+{
+ int i;
+
+ int itIndex = ACCESS_OID_LEN;
+
+ *len = itIndex + 4 + +strlen(groupName);
+
+ it[itIndex++] = strlen(groupName);
+ for (i = 0; i < (int) strlen(groupName); i++)
+ it[itIndex++] = groupName[i];
+
+ if (prefix) {
+ *len += strlen(prefix);
+ it[itIndex++] = strlen(prefix);
+ for (i = 0; i < (int) strlen(prefix); i++)
+ it[itIndex++] = prefix[i];
+ } else
+ it[itIndex++] = 0;
+
+ it[itIndex++] = model;
+ it[itIndex++] = level;
+}
+
+
+void
+sec2group_oid(oid * it, size_t * len, int model, const char *name)
+{
+ int i;
+
+ int itIndex = SEC2GROUP_OID_LEN;
+
+ *len = itIndex + 2 + strlen(name);
+
+ it[itIndex++] = model;
+
+ it[itIndex++] = strlen(name);
+ for (i = 0; i < (int) strlen(name); i++)
+ it[itIndex++] = name[i];
+}
+
+void
+view_oid(oid * it, size_t * len, const char *viewName, char *viewSubtree)
+{
+ int i;
+ oid c_oid[SPRINT_MAX_LEN];
+ size_t c_oid_length = SPRINT_MAX_LEN;
+
+ int itIndex = VIEW_OID_LEN;
+
+ if (!snmp_parse_oid(viewSubtree, c_oid, &c_oid_length)) {
+ printf("Error parsing subtree (%s)\n", viewSubtree);
+ exit(1);
+ }
+
+ *len = itIndex + 2 + strlen(viewName) + c_oid_length;
+
+ it[itIndex++] = strlen(viewName);
+ for (i = 0; i < (int) strlen(viewName); i++)
+ it[itIndex++] = viewName[i];
+
+
+ it[itIndex++] = c_oid_length;
+ for (i = 0; i < (int) c_oid_length; i++)
+ it[itIndex++] = c_oid[i];
+
+ /*
+ * sprint_objid(c_oid, it, *len);
+ */
+}
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'e':
+ viewTreeFamilyType = 2;
+ break;
+
+ default:
+ fprintf(stderr,
+ "Unknown flag passed to -C: %c\n", optarg[-1]);
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu = NULL, *response = NULL;
+#ifdef notused
+ netsnmp_variable_list *vars;
+#endif
+
+ int arg;
+#ifdef notused
+ int count;
+ int current_name = 0;
+ int current_type = 0;
+ int current_value = 0;
+ char *names[128];
+ char types[128];
+ char *values[128];
+ oid name[MAX_OID_LEN];
+#endif
+ size_t name_length;
+ int status;
+ int exitval = 0;
+ int command = 0;
+ long longvar;
+ int secModel, secLevel, contextMatch;
+ unsigned int val, i = 0;
+ char *mask, *groupName, *prefix, *authtype;
+ u_char viewMask[VACMSTRINGLEN];
+ char *st;
+
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ /*
+ * Note: this wil obtain the engineID needed below
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpvacm", &session);
+ exit(1);
+ }
+
+ /*
+ * create PDU for SET request and add object names and values to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_SET);
+
+ if (arg >= argc) {
+ fprintf(stderr, "Please specify a operation to perform.\n");
+ usage();
+ exit(1);
+ }
+
+ if (strcmp(argv[arg], CMD_DELETEVIEW_NAME) == 0)
+ /*
+ * deleteView: delete a view
+ *
+ * deleteView NAME SUBTREE
+ *
+ */
+ {
+ if (++arg + 2 != argc) {
+ fprintf(stderr, "You must specify the view to delete\n");
+ usage();
+ exit(1);
+ }
+
+ command = CMD_DELETEVIEW;
+ name_length = VIEW_OID_LEN;
+ view_oid(vacmViewTreeFamilyStatus, &name_length, argv[arg],
+ argv[arg + 1]);
+ longvar = RS_DESTROY;
+ snmp_pdu_add_variable(pdu, vacmViewTreeFamilyStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ } else if (strcmp(argv[arg], CMD_CREATEVIEW_NAME) == 0)
+ /*
+ * createView: create a view
+ *
+ * createView NAME SUBTREE MASK
+ *
+ */
+ {
+ if (++arg + 2 > argc) {
+ fprintf(stderr, "You must specify name, subtree and mask\n");
+ usage();
+ exit(1);
+ }
+ command = CMD_CREATEVIEW;
+ name_length = VIEW_OID_LEN;
+ view_oid(vacmViewTreeFamilyStatus, &name_length, argv[arg],
+ argv[arg + 1]);
+ longvar = RS_CREATEANDGO;
+ snmp_pdu_add_variable(pdu, vacmViewTreeFamilyStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ /*
+ * Mask
+ */
+ if (arg + 3 == argc) {
+ mask = argv[arg + 2];
+ for (mask = strtok_r(mask, ".:", &st); mask; mask = strtok_r(NULL, ".:", &st)) {
+ if (i >= sizeof(viewMask)) {
+ printf("MASK too long\n");
+ exit(1);
+ }
+ if (sscanf(mask, "%x", &val) == 0) {
+ printf("invalid MASK\n");
+ exit(1);
+ }
+ viewMask[i] = val;
+ i++;
+ }
+ } else {
+ for (i=0 ; i < (name_length+7)/8; i++)
+ viewMask[i] = (u_char)0xff;
+ }
+ view_oid(vacmViewTreeFamilyMask, &name_length, argv[arg],
+ argv[arg + 1]);
+ snmp_pdu_add_variable(pdu, vacmViewTreeFamilyMask, name_length,
+ ASN_OCTET_STR, viewMask, i);
+
+ view_oid(vacmViewTreeFamilyType, &name_length, argv[arg],
+ argv[arg + 1]);
+ snmp_pdu_add_variable(pdu, vacmViewTreeFamilyType, name_length,
+ ASN_INTEGER, (u_char *) & viewTreeFamilyType,
+ sizeof(viewTreeFamilyType));
+
+ } else if (strcmp(argv[arg], CMD_DELETESEC2GROUP_NAME) == 0)
+ /*
+ * deleteSec2Group: delete security2group
+ *
+ * deleteSec2Group MODEL SECURITYNAME
+ *
+ */
+ {
+ if (++arg + 2 != argc) {
+ fprintf(stderr, "You must specify the sec2group to delete\n");
+ usage();
+ exit(1);
+ }
+
+ command = CMD_DELETESEC2GROUP;
+ name_length = SEC2GROUP_OID_LEN;
+ if (sscanf(argv[arg], "%d", &secModel) == 0) {
+ printf("invalid security model\n");
+ usage();
+ exit(1);
+ }
+ sec2group_oid(vacmSec2GroupStatus, &name_length, secModel,
+ argv[arg + 1]);
+ longvar = RS_DESTROY;
+ snmp_pdu_add_variable(pdu, vacmSec2GroupStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ } else if (strcmp(argv[arg], CMD_CREATESEC2GROUP_NAME) == 0)
+ /*
+ * createSec2Group: create a security2group
+ *
+ * createSec2Group MODEL SECURITYNAME GROUPNAME
+ *
+ */
+ {
+ if (++arg + 3 != argc) {
+ fprintf(stderr,
+ "You must specify model, security name and group name\n");
+ usage();
+ exit(1);
+ }
+
+ command = CMD_CREATESEC2GROUP;
+ name_length = SEC2GROUP_OID_LEN;
+ if (sscanf(argv[arg], "%d", &secModel) == 0) {
+ printf("invalid security model\n");
+ usage();
+ exit(1);
+ }
+ sec2group_oid(vacmSec2GroupStatus, &name_length, secModel,
+ argv[arg + 1]);
+ longvar = RS_CREATEANDGO;
+ snmp_pdu_add_variable(pdu, vacmSec2GroupStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ sec2group_oid(vacmGroupName, &name_length, secModel,
+ argv[arg + 1]);
+ snmp_pdu_add_variable(pdu, vacmGroupName, name_length,
+ ASN_OCTET_STR, (u_char *) argv[arg + 2],
+ strlen(argv[arg + 2]));
+ } else if (strcmp(argv[arg], CMD_DELETEACCESS_NAME) == 0)
+ /*
+ * deleteAccess: delete access entry
+ *
+ * deleteAccess GROUPNAME [CONTEXTPREFIX] SECURITYMODEL SECURITYLEVEL
+ *
+ */
+ {
+ if (++arg + 3 > argc) {
+ fprintf(stderr,
+ "You must specify the access entry to delete\n");
+ usage();
+ exit(1);
+ }
+
+ command = CMD_DELETEACCESS;
+ name_length = ACCESS_OID_LEN;
+ groupName = argv[arg];
+ if (arg + 4 == argc)
+ prefix = argv[++arg];
+ else
+ prefix = NULL;
+
+ if (sscanf(argv[arg + 1], "%d", &secModel) == 0) {
+ printf("invalid security model\n");
+ usage();
+ exit(1);
+ }
+ if (sscanf(argv[arg + 2], "%d", &secLevel) == 0) {
+ printf("invalid security level\n");
+ usage();
+ exit(1);
+ }
+ access_oid(vacmAccessStatus, &name_length, groupName, prefix,
+ secModel, secLevel);
+ longvar = RS_DESTROY;
+ snmp_pdu_add_variable(pdu, vacmAccessStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ } else if (strcmp(argv[arg], CMD_CREATEACCESS_NAME) == 0)
+ /*
+ * createAccess: create access entry
+ *
+ * createAccess GROUPNAME [CONTEXTPREFIX] SECURITYMODEL SECURITYLEVEL CONTEXTMATCH READVIEWNAME WRITEVIEWNAME NOTIFYVIEWNAME
+ *
+ */
+ {
+ if (++arg + 7 > argc) {
+ fprintf(stderr,
+ "You must specify the access entry to create\n");
+ usage();
+ exit(1);
+ }
+
+ command = CMD_CREATEACCESS;
+ name_length = ACCESS_OID_LEN;
+ groupName = argv[arg];
+ if (arg + 8 == argc)
+ prefix = argv[++arg];
+ else
+ prefix = NULL;
+
+ if (sscanf(argv[arg + 1], "%d", &secModel) == 0) {
+ printf("invalid security model\n");
+ usage();
+ exit(1);
+ }
+ if (sscanf(argv[arg + 2], "%d", &secLevel) == 0) {
+ printf("invalid security level\n");
+ usage();
+ exit(1);
+ }
+ access_oid(vacmAccessStatus, &name_length, groupName, prefix,
+ secModel, secLevel);
+ longvar = RS_CREATEANDGO;
+ snmp_pdu_add_variable(pdu, vacmAccessStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+
+ access_oid(vacmAccessContextMatch, &name_length, groupName, prefix,
+ secModel, secLevel);
+ if (sscanf(argv[arg + 3], "%d", &contextMatch) == 0) {
+ printf("invalid contextMatch\n");
+ usage();
+ exit(1);
+ }
+ snmp_pdu_add_variable(pdu, vacmAccessContextMatch, name_length,
+ ASN_INTEGER, (u_char *) & contextMatch,
+ sizeof(contextMatch));
+
+ access_oid(vacmAccessReadViewName, &name_length, groupName, prefix,
+ secModel, secLevel);
+ snmp_pdu_add_variable(pdu, vacmAccessReadViewName, name_length,
+ ASN_OCTET_STR, (u_char *) argv[arg + 4],
+ strlen(argv[arg + 4]));
+
+ access_oid(vacmAccessWriteViewName, &name_length, groupName,
+ prefix, secModel, secLevel);
+ snmp_pdu_add_variable(pdu, vacmAccessWriteViewName, name_length,
+ ASN_OCTET_STR, (u_char *) argv[arg + 5],
+ strlen(argv[arg + 5]));
+
+ access_oid(vacmAccessNotifyViewName, &name_length, groupName,
+ prefix, secModel, secLevel);
+ snmp_pdu_add_variable(pdu, vacmAccessNotifyViewName, name_length,
+ ASN_OCTET_STR, (u_char *) argv[arg + 6],
+ strlen(argv[arg + 6]));
+ } else if (strcmp(argv[arg], CMD_DELETEAUTH_NAME) == 0)
+ /*
+ * deleteAuth: delete authAccess entry
+ *
+ * deleteAuth GROUPNAME [CONTEXTPREFIX] SECURITYMODEL SECURITYLEVEL AUTHTYPE
+ *
+ */
+ {
+ if (++arg + 4 > argc) {
+ fprintf(stderr,
+ "You must specify the authAccess entry to delete\n");
+ usage();
+ exit(1);
+ }
+
+ command = CMD_DELETEAUTH;
+ name_length = AUTH_OID_LEN;
+ groupName = argv[arg];
+ if (arg + 5 == argc)
+ prefix = argv[++arg];
+ else
+ prefix = NULL;
+
+ if (sscanf(argv[arg + 1], "%d", &secModel) == 0) {
+ printf("invalid security model\n");
+ usage();
+ exit(1);
+ }
+ if (sscanf(argv[arg + 2], "%d", &secLevel) == 0) {
+ printf("invalid security level\n");
+ usage();
+ exit(1);
+ }
+ authtype = argv[arg+3];
+ auth_oid(nsVacmRowStatus, &name_length, groupName, prefix,
+ secModel, secLevel, authtype);
+ longvar = RS_DESTROY;
+ snmp_pdu_add_variable(pdu, nsVacmRowStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+ } else if (strcmp(argv[arg], CMD_CREATEAUTH_NAME) == 0)
+ /*
+ * createAuth: create authAccess entry
+ *
+ * createAuth GROUPNAME [CONTEXTPREFIX] SECURITYMODEL SECURITYLEVEL AUTHTYPE CONTEXTMATCH VIEWNAME
+ *
+ */
+ {
+ if (++arg + 6 > argc) {
+ fprintf(stderr,
+ "You must specify the authAccess entry to create\n");
+ usage();
+ exit(1);
+ }
+
+ command = CMD_CREATEAUTH;
+ name_length = AUTH_OID_LEN;
+ groupName = argv[arg];
+ if (arg + 7 == argc)
+ prefix = argv[++arg];
+ else
+ prefix = NULL;
+
+ if (sscanf(argv[arg + 1], "%d", &secModel) == 0) {
+ printf("invalid security model\n");
+ usage();
+ exit(1);
+ }
+ if (sscanf(argv[arg + 2], "%d", &secLevel) == 0) {
+ printf("invalid security level\n");
+ usage();
+ exit(1);
+ }
+ authtype = argv[arg+3];
+ auth_oid(nsVacmRowStatus, &name_length, groupName, prefix,
+ secModel, secLevel, authtype);
+ longvar = RS_CREATEANDGO;
+ snmp_pdu_add_variable(pdu, nsVacmRowStatus, name_length,
+ ASN_INTEGER, (u_char *) & longvar,
+ sizeof(longvar));
+
+ auth_oid(nsVacmContextPfx, &name_length, groupName, prefix,
+ secModel, secLevel, authtype);
+ if (sscanf(argv[arg + 4], "%d", &contextMatch) == 0) {
+ printf("invalid contextMatch\n");
+ usage();
+ exit(1);
+ }
+ snmp_pdu_add_variable(pdu, nsVacmContextPfx, name_length,
+ ASN_INTEGER, (u_char *) & contextMatch,
+ sizeof(contextMatch));
+
+ auth_oid(nsVacmViewName, &name_length, groupName, prefix,
+ secModel, secLevel, authtype);
+ snmp_pdu_add_variable(pdu, nsVacmViewName, name_length,
+ ASN_OCTET_STR, (u_char *) argv[arg + 5],
+ strlen(argv[arg + 5]));
+ } else {
+ printf("Unknown command\n");
+ usage();
+ exit(1);
+ }
+
+ /*
+ * do the request
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (response) {
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ fprintf(stderr, "%s\n", successNotes[command - 1]);
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0){
+ int count;
+ struct variable_list *vars = response->variables;
+ fprintf(stderr, "Failed object: ");
+ for(count = 1; vars && (count != response->errindex);
+ vars = vars->next_variable, count++)
+ ;
+ if (vars)
+ fprint_objid(stderr, vars->name, vars->name_length);
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ session.peername);
+ exitval = 1;
+ } else {
+ snmp_sess_perror("snmpset", ss);
+ exitval = 1;
+ }
+
+ if (response)
+ snmp_free_pdu(response);
+
+ snmp_close(ss);
+ SOCK_CLEANUP;
+ return exitval;
+}
diff --git a/apps/snmpwalk.c b/apps/snmpwalk.c
new file mode 100644
index 0000000..659d7de
--- /dev/null
+++ b/apps/snmpwalk.c
@@ -0,0 +1,432 @@
+/*
+ * snmpwalk.c - send snmp GETNEXT requests to a network entity, walking a
+ * subtree.
+ *
+ */
+/**********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+#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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+# include <netinet/in.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include <stdio.h>
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#define NETSNMP_DS_WALK_INCLUDE_REQUESTED 1
+#define NETSNMP_DS_WALK_PRINT_STATISTICS 2
+#define NETSNMP_DS_WALK_DONT_CHECK_LEXICOGRAPHIC 3
+#define NETSNMP_DS_WALK_TIME_RESULTS 4
+#define NETSNMP_DS_WALK_DONT_GET_REQUESTED 5
+#define NETSNMP_DS_WALK_TIME_RESULTS_SINGLE 6
+
+oid objid_mib[] = { 1, 3, 6, 1, 2, 1 };
+int numprinted = 0;
+
+char *end_name = NULL;
+
+void
+usage(void)
+{
+ fprintf(stderr, "USAGE: snmpwalk ");
+ snmp_parse_args_usage(stderr);
+ fprintf(stderr, " [OID]\n\n");
+ snmp_parse_args_descriptions(stderr);
+ fprintf(stderr,
+ " -C APPOPTS\t\tSet various application specific behaviours:\n");
+ fprintf(stderr, "\t\t\t p: print the number of variables found\n");
+ fprintf(stderr, "\t\t\t i: include given OID in the search range\n");
+ fprintf(stderr, "\t\t\t I: don't include the given OID, even if no results are returned\n");
+ fprintf(stderr,
+ "\t\t\t c: do not check returned OIDs are increasing\n");
+ fprintf(stderr,
+ "\t\t\t t: Display wall-clock time to complete the walk\n");
+ fprintf(stderr,
+ "\t\t\t T: Display wall-clock time to complete each request\n");
+ fprintf(stderr, "\t\t\t E {OID}: End the walk at the specified OID\n");
+}
+
+void
+snmp_get_and_print(netsnmp_session * ss, oid * theoid, size_t theoid_len)
+{
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ int status;
+
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+ snmp_add_null_var(pdu, theoid, theoid_len);
+
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS && response->errstat == SNMP_ERR_NOERROR) {
+ for (vars = response->variables; vars; vars = vars->next_variable) {
+ numprinted++;
+ print_variable(vars->name, vars->name_length, vars);
+ }
+ }
+ if (response) {
+ snmp_free_pdu(response);
+ }
+}
+
+static void
+optProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'i':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_INCLUDE_REQUESTED);
+ break;
+
+ case 'I':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_DONT_GET_REQUESTED);
+ break;
+
+ case 'p':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_PRINT_STATISTICS);
+ break;
+
+ case 'c':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_DONT_CHECK_LEXICOGRAPHIC);
+ break;
+
+ case 't':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_TIME_RESULTS);
+ break;
+
+ case 'E':
+ end_name = argv[optind++];
+ break;
+
+ case 'T':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_TIME_RESULTS_SINGLE);
+ break;
+
+ default:
+ fprintf(stderr, "Unknown flag passed to -C: %c\n",
+ optarg[-1]);
+ exit(1);
+ }
+ }
+ break;
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ int arg;
+ oid name[MAX_OID_LEN];
+ size_t name_length;
+ oid root[MAX_OID_LEN];
+ size_t rootlen;
+ oid end_oid[MAX_OID_LEN];
+ size_t end_len = 0;
+ int count;
+ int running;
+ int status = STAT_ERROR;
+ int check;
+ int exitval = 0;
+ struct timeval tv1, tv2, tv_a, tv_b;
+
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmpwalk", "includeRequested",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_INCLUDE_REQUESTED);
+
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmpwalk", "excludeRequested",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_DONT_GET_REQUESTED);
+
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmpwalk", "printStatistics",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_PRINT_STATISTICS);
+
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmpwalk", "dontCheckOrdering",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_DONT_CHECK_LEXICOGRAPHIC);
+
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmpwalk", "timeResults",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_TIME_RESULTS);
+
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmpwalk", "timeResultsSingle",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_TIME_RESULTS_SINGLE);
+
+ /*
+ * get the common command line arguments
+ */
+ switch (arg = snmp_parse_args(argc, argv, &session, "C:", optProc)) {
+ case NETSNMP_PARSE_ARGS_ERROR:
+ exit(1);
+ case NETSNMP_PARSE_ARGS_SUCCESS_EXIT:
+ exit(0);
+ case NETSNMP_PARSE_ARGS_ERROR_USAGE:
+ usage();
+ exit(1);
+ default:
+ break;
+ }
+
+ /*
+ * get the initial object and subtree
+ */
+ if (arg < argc) {
+ /*
+ * specified on the command line
+ */
+ rootlen = MAX_OID_LEN;
+ if (snmp_parse_oid(argv[arg], root, &rootlen) == NULL) {
+ snmp_perror(argv[arg]);
+ exit(1);
+ }
+ } else {
+ /*
+ * use default value
+ */
+ memmove(root, objid_mib, sizeof(objid_mib));
+ rootlen = sizeof(objid_mib) / sizeof(oid);
+ }
+
+ /*
+ * If we've been given an explicit end point,
+ * then convert this to an OID, otherwise
+ * move to the next sibling of the start.
+ */
+ if ( end_name ) {
+ end_len = MAX_OID_LEN;
+ if (snmp_parse_oid(end_name, end_oid, &end_len) == NULL) {
+ snmp_perror(end_name);
+ exit(1);
+ }
+ } else {
+ memmove(end_oid, root, rootlen*sizeof(oid));
+ end_len = rootlen;
+ end_oid[end_len-1]++;
+ }
+
+ SOCK_STARTUP;
+
+ /*
+ * open an SNMP session
+ */
+ ss = snmp_open(&session);
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpwalk", &session);
+ SOCK_CLEANUP;
+ exit(1);
+ }
+
+ /*
+ * get first object to start walk
+ */
+ memmove(name, root, rootlen * sizeof(oid));
+ name_length = rootlen;
+
+ running = 1;
+
+ check =
+ !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_DONT_CHECK_LEXICOGRAPHIC);
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_WALK_INCLUDE_REQUESTED)) {
+ snmp_get_and_print(ss, root, rootlen);
+ }
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_TIME_RESULTS))
+ netsnmp_get_monotonic_clock(&tv1);
+ while (running) {
+ /*
+ * create PDU for GETNEXT request and add object name to request
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ snmp_add_null_var(pdu, name, name_length);
+
+ /*
+ * do the request
+ */
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_WALK_TIME_RESULTS_SINGLE))
+ netsnmp_get_monotonic_clock(&tv_a);
+ status = snmp_synch_response(ss, pdu, &response);
+ if (status == STAT_SUCCESS) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_WALK_TIME_RESULTS_SINGLE))
+ netsnmp_get_monotonic_clock(&tv_b);
+ if (response->errstat == SNMP_ERR_NOERROR) {
+ /*
+ * check resulting variables
+ */
+ for (vars = response->variables; vars;
+ vars = vars->next_variable) {
+ if (snmp_oid_compare(end_oid, end_len,
+ vars->name, vars->name_length) <= 0) {
+ /*
+ * not part of this subtree
+ */
+ running = 0;
+ continue;
+ }
+ numprinted++;
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_WALK_TIME_RESULTS_SINGLE))
+ fprintf(stdout, "%f s: ",
+ (double) (tv_b.tv_usec - tv_a.tv_usec)/1000000 +
+ (double) (tv_b.tv_sec - tv_a.tv_sec));
+ print_variable(vars->name, vars->name_length, vars);
+ if ((vars->type != SNMP_ENDOFMIBVIEW) &&
+ (vars->type != SNMP_NOSUCHOBJECT) &&
+ (vars->type != SNMP_NOSUCHINSTANCE)) {
+ /*
+ * not an exception value
+ */
+ if (check
+ && snmp_oid_compare(name, name_length,
+ vars->name,
+ vars->name_length) >= 0) {
+ fprintf(stderr, "Error: OID not increasing: ");
+ fprint_objid(stderr, name, name_length);
+ fprintf(stderr, " >= ");
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ fprintf(stderr, "\n");
+ running = 0;
+ exitval = 1;
+ }
+ memmove((char *) name, (char *) vars->name,
+ vars->name_length * sizeof(oid));
+ name_length = vars->name_length;
+ } else
+ /*
+ * an exception value, so stop
+ */
+ running = 0;
+ }
+ } else {
+ /*
+ * error in response, print it
+ */
+ running = 0;
+ if (response->errstat == SNMP_ERR_NOSUCHNAME) {
+ printf("End of MIB\n");
+ } else {
+ fprintf(stderr, "Error in packet.\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ if (response->errindex != 0) {
+ fprintf(stderr, "Failed object: ");
+ for (count = 1, vars = response->variables;
+ vars && count != response->errindex;
+ vars = vars->next_variable, count++)
+ /*EMPTY*/;
+ if (vars)
+ fprint_objid(stderr, vars->name,
+ vars->name_length);
+ fprintf(stderr, "\n");
+ }
+ exitval = 2;
+ }
+ }
+ } else if (status == STAT_TIMEOUT) {
+ fprintf(stderr, "Timeout: No Response from %s\n",
+ session.peername);
+ running = 0;
+ exitval = 1;
+ } else { /* status == STAT_ERROR */
+ snmp_sess_perror("snmpwalk", ss);
+ running = 0;
+ exitval = 1;
+ }
+ if (response)
+ snmp_free_pdu(response);
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_TIME_RESULTS))
+ netsnmp_get_monotonic_clock(&tv2);
+
+ if (numprinted == 0 && status == STAT_SUCCESS) {
+ /*
+ * no printed successful results, which may mean we were
+ * pointed at an only existing instance. Attempt a GET, just
+ * for get measure.
+ */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_WALK_DONT_GET_REQUESTED)) {
+ snmp_get_and_print(ss, root, rootlen);
+ }
+ }
+ snmp_close(ss);
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_PRINT_STATISTICS)) {
+ printf("Variables found: %d\n", numprinted);
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_WALK_TIME_RESULTS)) {
+ fprintf (stderr, "Total traversal time = %f seconds\n",
+ (double) (tv2.tv_usec - tv1.tv_usec)/1000000 +
+ (double) (tv2.tv_sec - tv1.tv_sec));
+ }
+
+ SOCK_CLEANUP;
+ return exitval;
+}
diff --git a/apps/sshtosnmp.c b/apps/sshtosnmp.c
new file mode 100644
index 0000000..d26067d
--- /dev/null
+++ b/apps/sshtosnmp.c
@@ -0,0 +1,233 @@
+/* Copyright 2009 SPARTA, Inc. All rights reserved
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * This is merely a wrapper around stdin/out for sshd to call. It
+ * simply passes traffic to the running snmpd through a unix domain
+ * socket after first passing any needed SSH Domain information.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
+#include <sys/select.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <stdio.h>
+
+#ifndef MAXPATHLEN
+#warn no system max path length detected
+#define MAXPATHLEN 2048
+#endif
+
+#define DEFAULT_SOCK_PATH "/var/net-snmp/sshdomainsocket"
+
+#define NETSNMP_SSHTOSNMP_VERSION_NUMBER 1
+
+
+
+/*
+ * Extra debugging output for, um, debugging.
+ */
+
+#undef DEBUGGING
+
+#ifdef DEBUGGING
+#define DEBUG(x) deb(x)
+FILE *debf = NULL;
+void
+deb(const char *string) {
+ if (NULL == debf) {
+ debf = fopen("/tmp/sshtosnmp.log", "a");
+ }
+ if (NULL != debf) {
+ fprintf(debf, "%s\n", string);
+ fflush(debf);
+ }
+}
+#else /* !DEBUGGING */
+#define DEBUG(x)
+#endif /* DEBUGGING code */
+
+int
+main(int argc, char **argv) {
+
+ int sock;
+ struct sockaddr_un addr;
+ u_char buf[4096];
+ size_t buf_len = sizeof(buf);
+ int rc = 0, pktsize = 0;
+
+ fd_set read_set;
+
+ DEBUG("----------\nstarting up");
+
+ /* Open a connection to the UNIX domain socket or fail */
+
+ addr.sun_family = AF_UNIX;
+ if (argc > 1) {
+ strcpy(addr.sun_path, argv[1]);
+ } else {
+ strcpy(addr.sun_path, DEFAULT_SOCK_PATH);
+ }
+
+ sock = socket(PF_UNIX, SOCK_STREAM, 0);
+ DEBUG("created socket");
+ if (sock <= 0) {
+ exit(1);
+ }
+
+ /* set the SO_PASSCRED option so we can pass uid */
+ /* XXX: according to the unix(1) manual this shouldn't be needed
+ on the sending side? */
+ {
+ int one = 1;
+ setsockopt(sock, SOL_SOCKET, SO_PASSCRED, (void *) &one,
+ sizeof(one));
+ }
+
+ if (connect(sock, (struct sockaddr *) &addr,
+ sizeof(struct sockaddr_un)) != 0) {
+ DEBUG("FAIL CONNECT");
+ exit(1);
+ }
+
+ DEBUG("opened socket");
+
+ /*
+ * we are running as the user that ssh authenticated us as, and this
+ * is the name/uid that the agent needs for processing as a SNMPv3
+ * security name. So this is the only thing needed to pass to the
+ * agent.
+ */
+
+ /* version 1 of our internal ssh to snmp wrapper is just a single
+ byte version number and indicates we're also passing unix
+ socket credentials containing our user id */
+
+ /* In case of future changes, we'll pass a version number first */
+
+ buf[0] = NETSNMP_SSHTOSNMP_VERSION_NUMBER;
+ buf_len = 1;
+
+ /* send the prelim message and the credentials together using sendmsg() */
+ {
+ struct msghdr m;
+ struct {
+ struct cmsghdr cm;
+ struct ucred ouruser;
+ } cmsg;
+ struct iovec iov = { buf, buf_len };
+
+ /* Make sure that even padding fields get initialized.*/
+ memset(&cmsg, 0, sizeof(cmsg));
+ memset(&m, 0, sizeof(m));
+
+ /* set up the basic message */
+ cmsg.cm.cmsg_len = sizeof(struct cmsghdr) + sizeof(struct ucred);
+ cmsg.cm.cmsg_level = SOL_SOCKET;
+ cmsg.cm.cmsg_type = SCM_CREDENTIALS;
+
+ cmsg.ouruser.uid = getuid();
+ cmsg.ouruser.gid = getgid();
+ cmsg.ouruser.pid = getpid();
+
+ m.msg_iov = &iov;
+ m.msg_iovlen = 1;
+ m.msg_control = &cmsg;
+ m.msg_controllen = sizeof(cmsg);
+ m.msg_flags = 0;
+
+ DEBUG("sending to sock");
+ rc = sendmsg(sock, &m, MSG_NOSIGNAL|MSG_DONTWAIT);
+ if (rc < 0) {
+ fprintf(stderr, "failed to send startup message\n");
+ DEBUG("failed to send startup message\n");
+ exit(1);
+ }
+ }
+
+ DEBUG("sent name");
+
+ /* now we just send and receive from both the socket and stdin/stdout */
+
+ while(1) {
+ /* read from stdin and the socket */
+ FD_SET(sock, &read_set);
+ FD_SET(STDIN_FILENO, &read_set);
+
+ /* blocking without a timeout be fine fine */
+ select(sock+1, &read_set, NULL, NULL, NULL);
+
+ if (FD_ISSET(STDIN_FILENO, &read_set)) {
+ /* read from stdin to get stuff from sshd to send to the agent */
+ DEBUG("data from stdin");
+ rc = read(STDIN_FILENO, buf, sizeof(buf));
+
+ if (rc <= 0) {
+ /* end-of-file */
+#ifndef HAVE_CLOSESOCKET
+ rc = close(sock);
+#else
+ rc = closesocket(sock);
+#endif
+ exit(0);
+ }
+ DEBUG("read from stdin");
+
+ /* send it up the pipe */
+ pktsize = rc;
+ rc = -1;
+ while (rc < 0) {
+ DEBUG("sending to socket");
+ rc = sendto(sock, buf, pktsize, 0, NULL, 0);
+ DEBUG("back from sendto");
+ if (rc < 0)
+ DEBUG("sentto failed");
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ if (rc > 0)
+ DEBUG("sent to socket");
+ else
+ DEBUG("failed to send to socket!!");
+ }
+
+ if (FD_ISSET(sock, &read_set)) {
+ /* read from the socket and send to to stdout which goes to sshd */
+ DEBUG("data on unix socket");
+
+ rc = -1;
+ while (rc < 0) {
+ rc = recvfrom(sock, buf, sizeof(buf), 0, NULL, NULL);
+ if (rc < 0 && errno != EINTR) {
+ close(sock);
+ exit(0);
+ }
+ }
+ DEBUG("read from socket");
+
+ pktsize = rc;
+ rc = write(STDOUT_FILENO, buf, pktsize);
+ /* XXX: check that counts match */
+ if (rc > 0) {
+ DEBUG("wrote to stdout");
+ } else {
+ DEBUG("failed to write to stdout");
+ }
+ }
+ }
+}
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..2852378
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1505 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+# Free Software Foundation, Inc.
+
+timestamp='2010-08-21'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' HUP INT TERM
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-tilera-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..320e303
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1739 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+# Free Software Foundation, Inc.
+
+timestamp='2010-09-11'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile-* | tilegx-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ # This must be matched before tile*.
+ tilegx*)
+ basic_machine=tilegx-unknown
+ os=-linux-gnu
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure b/configure
new file mode 100755
index 0000000..edb2071
--- /dev/null
+++ b/configure
@@ -0,0 +1,31649 @@
+#! /bin/sh
+# From configure.ac Revision.
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for Net-SNMP 5.7.2.
+#
+# Report bugs to <net-snmp-coders@lists.sourceforge.net>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: net-snmp-coders@lists.sourceforge.net about your
+$0: system, including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='Net-SNMP'
+PACKAGE_TARNAME='net-snmp'
+PACKAGE_VERSION='5.7.2'
+PACKAGE_STRING='Net-SNMP 5.7.2'
+PACKAGE_BUGREPORT='net-snmp-coders@lists.sourceforge.net'
+PACKAGE_URL=''
+
+ac_unique_file="agent/snmpd.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_config_libobj_dir=snmplib
+ac_subst_vars='LTLIBOBJS
+ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE
+PARTIALTARGETFLAGS
+DLLIBS
+OTHERAGENTLIBLFTS
+OTHERAGENTLIBLOBJS
+OTHERAGENTLIBOBJS
+AGENTLIBS
+LMIBLIBS
+PSCMD
+LPSTAT_PATH
+LIBOBJS
+ALLOCA
+VAL_LIBS
+LAGENTLIBS
+LNETSNMPLIBS
+PYTHONFEATURES
+PYTHONARGS
+PYTHONCLEANTARGS
+PYTHONUNINSTALLTARGS
+PYTHONINSTALLTARGS
+PYTHONTARGS
+PERLFEATURES
+PERLARGS
+PERLUNINSTALLTARGS
+PERLINSTALLTARGS
+PERLTARGS
+PERLLDOPTS_FOR_APPS
+PERLLDOPTS_FOR_LIBS
+EMBEDPERLUNINSTALL
+EMBEDPERLINSTALL
+MYSQL_INCLUDES
+MYSQL_LIBS
+MYSQLCONFIG
+crypto_files_lo
+crypto_files_o
+crypto_files_c
+NETSNMP_BUILD_SET_PROG_FALSE
+NETSNMP_BUILD_SET_PROG_TRUE
+NETSNMP_BUILD_USM_PROG_FALSE
+NETSNMP_BUILD_USM_PROG_TRUE
+NETSNMP_BUILD_TLS_PROG_FALSE
+NETSNMP_BUILD_TLS_PROG_TRUE
+NETSNMP_BUILD_SSH_PROG_FALSE
+NETSNMP_BUILD_SSH_PROG_TRUE
+NETSNMP_HAVE_AGENTX_LIBS_FALSE
+NETSNMP_HAVE_AGENTX_LIBS_TRUE
+NETSNMP_DEFAULT_MIBS
+ENV_SEPARATOR
+dllcleans
+default_mibs_install
+krb5_config
+security_ftobj_list
+security_lobj_list
+security_obj_list
+security_hdr_list
+security_src_list
+transport_ftobj_list
+transport_lobj_list
+transport_obj_list
+transport_src_list
+transport_hdr_list
+other_trapd_objects
+other_ftagentobjs
+other_lagentobjs
+other_agentobjs
+other_ftobjs_list
+other_lobjs_list
+other_objs_list
+other_src_list
+SNMPCONFPATH
+NETSNMP_DEFAULT_MIBDIRS
+SNMPSHAREPATH
+SNMPLIBPATH
+VERSION
+DPKG_QUERY_PATH
+CCPATH
+EXTRACPPFLAGS
+LD_NO_UNDEFINED
+target_os
+target_vendor
+target_cpu
+target
+NON_GNU_VPATH
+GNU_vpath
+MIBGROUP_INCLUDES
+HELPER_INCLUDES
+AGENT_INCLUDES
+SNMPLIB_INCLUDES
+TOP_INCLUDES
+DEVFLAGS
+LIBTOOL_DEPS
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+AWK
+RANLIB
+STRIP
+ac_ct_AR
+AR
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+LIBTOOL
+OBJDUMP
+DLLTOOL
+AS
+LINKCC
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+PERL_SYSTEM_INVOKES_POSIX_SHELL
+UNAMEPROG
+PYTHONPROG
+PSPROG
+PERLPROG
+AUTOHEADER
+AUTOCONF
+WHOAMI
+FIND
+FILE
+SED
+SET_MAKE
+LN_S
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+EGREP
+GREP
+COPY_PERSISTENT_FILES
+UCDPERSISTENT_DIRECTORY
+PERSISTENT_DIRECTORY
+FEATUREHEADERS
+FEATURETARGS
+FEATURE_REMOVE_FLAGS
+FEATURE_ADD_FLAGS
+installucdlibs
+installucdheaders
+FTMAINSUBS
+MAINSUBS
+USETRAPLIBS
+TRAPLIBS
+SNMPD
+INSTALL_PREFIX
+LIBTOOLFLAGS
+CONFIGURE_OPTIONS
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files='MODULE_LIST
+module_list_c
+module_list_o
+module_list_lo
+module_list_ft
+mib_module_list_c
+mib_module_list_o
+mib_module_list_lo
+mib_module_list_ft
+agent_module_list_c
+agent_module_list_o
+agent_module_list_lo
+agent_module_list_ft
+mibgroup_list_o
+mibgroup_list_lo
+mibgroup_list_ft
+agentgroup_list_o
+agentgroup_list_lo
+agentgroup_list_ft
+module_rules
+module_list_deps
+mib_module_list_deps
+agent_module_list_deps'
+ac_user_opts='
+enable_option_checking
+with_cc
+with_linkcc
+with_ar
+with_endianness
+with_cflags
+with_ldflags
+enable_as_needed
+with_libs
+enable_silent_libtool
+with_dmalloc
+enable_dmalloc
+with_efence
+enable_efence
+with_rsaref
+enable_rsaref
+with_openssl
+enable_openssl
+with_ssl
+enable_ssl
+with_pkcs
+enable_pkcs
+with_krb5
+enable_krb5
+with_dnssec_local_validation
+enable_dnssec_local_validation
+with_dnssec
+enable_dnssec
+with_rpm
+enable_rpm
+with_install_prefix
+enable_agent
+with_agent
+enable_applications
+with_applications
+enable_manuals
+with_manuals
+enable_scripts
+with_scripts
+enable_mibs
+enable_mib_config_checking
+with_mib_config_checking
+enable_mib_config_debug
+with_mib_config_debug
+enable_new_features
+enable_old_features
+with_features_of
+with_defaults
+enable_defaults
+enable_ucd_snmp_compatibility
+with_ucd_snmp_compatibility
+enable_mib_loading
+with_mib_loading
+with_mibdirs
+enable_mibdirs
+with_mibs
+with_mibfiles
+enable_mibfiles
+enable_des
+with_des
+enable_privacy
+with_privacy
+enable_md5
+with_md5
+enable_internal_md5
+with_internal_md5
+with_opaque_special_types
+enable_opaque_special_types
+enable_ipv6
+with_ipv6
+with_logfile
+enable_logfile
+with_persistent_directory
+enable_persistent_directory
+with_persistent_mask
+enable_persistent_mask
+with_copy_persistent_files
+enable_copy_persistent_files
+with_temp_file_pattern
+enable_temp_file_pattern
+enable_snmpv1
+with_snmpv1
+enable_snmpv2c
+with_snmpv2c
+with_default_snmp_version
+enable_default_snmp_version
+with_transports
+with_out_transports
+with_transport
+with_out_transport
+with_security_modules
+enable_security_modules
+with_out_security_modules
+enable_out_security_modules
+enable_debugging
+with_debugging
+enable_developer
+with_developer
+enable_testing_code
+with_testing_code
+enable_reentrant
+with_reentrant
+enable_deprecated
+with_deprecated
+with_root_access
+enable_root_access
+with_kmem_usage
+enable_kmem_usage
+with_dummy_values
+enable_dummy_values
+enable_set_support
+with_set_support
+with_sys_contact
+enable_sys_contact
+with_sys_location
+enable_sys_location
+enable_local_smux
+with_local_smux
+enable_agentx_dom_sock_only
+with_agentx_dom_sock_only
+enable_snmptrapd_subagent
+with_snmptrapd_subagent
+with_agentx_socket
+enable_agentx_socket
+with_features
+enable_features
+with_out_features
+enable_out_features
+with_feature
+with_out_feature
+enable_minimalist
+with_minimalist
+enable_notify_only
+with_notify_only
+enable_notifyonly
+enable_no_listen
+with_no_listen
+enable_nolisten
+enable_read_only
+with_read_only
+enable_readonly
+enable_mini_agent
+with_mini_agent
+with_miniagent
+enable_miniagent
+enable_mfd_rewrites
+with_mfd_rewrites
+with_mib_modules
+enable_mib_modules
+with_out_mib_modules
+enable_out_mib_modules
+with_mib_module
+with_module
+with_modules
+with_out_mib_module
+with_out_module
+with_out_modules
+with_enterprise_oid
+enable_enterprise_oid
+with_enterprise_sysoid
+enable_enterprise_sysoid
+with_enterprise_notification_oid
+enable_enterprise_notification_oid
+with_perl_modules
+enable_perl_modules
+enable_embedded_perl
+with_embedded_perl
+enable_perl_cc_checks
+with_perl_cc_checks
+with_python_modules
+with_server_send_buf
+enable_server_send_buf
+with_server_recv_buf
+enable_server_recv_buf
+with_client_send_buf
+enable_client_send_buf
+with_client_recv_buf
+enable_client_recv_buf
+with_elf
+enable_elf
+with_nl
+enable_nl
+with_libwrap
+enable_libwrap
+with_zlib
+enable_zlib
+with_bzip2
+with_mnttab
+enable_mnttab
+with_mysql
+enable_mysql
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures Net-SNMP 5.7.2 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/net-snmp]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of Net-SNMP 5.7.2:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-as-needed Link libperl against applications rather
+ than Net-SNMP libraries. Use only if the other
+ way doesn't work.
+ --enable-silent-libtool Pass --silent to libtool.
+
+ --disable-agent Do not build the agent (snmpd).
+ --disable-applications Do not build the apps (snmpget, ...).
+ --disable-manuals Do not install the manuals.
+ --disable-scripts Do not install the scripts (mib2c, ...).
+ --disable-mibs Do not install the mib files.
+ --enable-mib-config-checking Turns on extra checks during configuration
+ of mib modules. Any conflicts will cause
+ configure to abort (default is to issue a
+ warning and continue.)
+ --enable-mib-config-debug Turns on verbose output during mib module
+ configure processing.
+ --enable-new-features Compile in new MIB modules and other experimental
+ features which are due to be included in future
+ releases.
+ --enable-old-features Compile in old MIB modules and other deprecated
+ features which were replaced in the default build of
+ this release.
+ --enable-ucd-snmp-compatibility Install ucd-snmp look-alike headers and libs.
+
+ --disable-mib-loading Do not include code that parses and
+ manipulates the mib files.
+ --disable-des Do not support DES encryption.
+ --disable-privacy Don't compile in support for privacy (encryption).
+ --disable-md5 Do not support MD5 authentication.
+ --enable-internal-md5 Use the internal MD5 support.
+ --enable-ipv6 Generate IPv6 ready version.
+ --disable-snmpv1 Do not include code that implements SNMPv1.
+ --disable-snmpv2c Do not include code that implements SNMPv2c.
+ --enable-debugging Outputs extra debugging information at all
+ times. Normally, you should not enable this,
+ but instead use the -D flag of the commands,
+ which toggles debuging output at runtime.
+ --disable-debugging Disallows debugging code to be built in.
+ This might provide some speed benefits.
+ --enable-developer Turns on super-duper-extra-compile-warnings
+ when using gcc.
+ --enable-testing-code Enables some code sections that should
+ only be used for testing of certain
+ SNMP functionalities. This should *not*
+ be turned on for production use. Ever.
+ --enable-reentrant Enables locking functions that protect
+ library resources in some multi-threading
+ environments. This does not guarantee
+ thread-safe operation.
+ Currently an experimental setting.
+ --disable-deprecated Don't compile in deprecated functions.
+ --disable-set-support Do not allow SNMP set requests.
+ --enable-local-smux Restrict SMUX connections to localhost (by default).
+ --enable-agentx-dom-sock-only Disable UDP/TCP transports for agentx.
+ --disable-snmptrapd-subagent Disable agentx subagent code in snmptrapd.
+ --enable-minimalist Remove all non-essential code features.
+ --enable-notify-only Build tools that can only send notifications.
+ --enable-no-listen Build tools that can't listen to ports.
+ --enable-read-only Remove all SET support from the code.
+ --enable-mini-agent Build a minimal agent.
+ --enable-mfd-rewrites Use new MFD rewrites of mib modules,
+ where available. (default is to use
+ original mib module code).
+ --disable-embedded-perl Disable embedded Perl in the SNMP agent and
+ snmptrapd. enabled by default
+ --disable-perl-cc-checks Disable configure checks for whether Perl's
+ C Compiler is compatible with ours when
+ embedded Perl is enabled.
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+
+Compiler Options:
+ --with-cc=CC use CC to compile (default=gcc).
+
+ --with-linkcc=CC use CC to link (default=gcc).
+ --with-ar=AR use AR as the archiver.
+ --with-endianness=big|little define endianness of target platform when
+ cross-compiling.
+ --with-cflags=CFLAGS use CFLAGS as compile time arguments.
+ --with-ldflags=LDFLAGS use LDFLAGS as link time arguments to ld.
+ --with-libs=LIBS use LIBS as link time arguments to ld.
+ --with-dmalloc=PATH Use dmalloc library (www.dmalloc.com)
+ --with-efence Look for and use libefence (malloc).
+ --with-rsaref=PATH Look for librsaref in PATH/lib.
+ --with-openssl=PATH Look for openssl in PATH/lib,
+ or PATH may be "internal" to build with
+ minimal copied OpenSSL code for USM only.
+
+ --with-pkcs=PATH Look for pkcs11 in PATH/lib.
+ --with-krb5=PATH Look for krb5 in PATH/lib.
+ --with-dnssec-local-validation Enable local DNSSEC validation using libval (no)
+ --without-rpm Don't include support for the RPM package
+ management system when building the host MIB
+ module.
+ --with-install-prefix=PATH Just for installing, prefix all
+ directories with PATH. This is known not
+ to work on some systems with shared
+ libraries (eg, HPUX)
+ --with-features-of=version
+ Compile in MIB modules and other features as if this
+ was release "version" (default is 5.7.2).
+
+Miscellaneous:
+ --with-defaults Use defaults for prompted values.
+ --with-mibdirs="dir1:dir2:" Default directories to look for mibs.
+ (Default: \$HOME/.snmp/mibs:DATADIR/snmp/mibs)
+ --with-mibs="item1:item2:" Default mib IDs to read.
+ (The default list is
+ "SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB"
+ with the addition of any mibs used
+ by the mib modules the agent is
+ configured with)
+ --with-mibfiles="file1:file2" Default mib files to load.
+ (Default: none. uses IDs above instead.)
+ --without-opaque-special-types Don't use special opaque encodings.
+ SNMP normally cannot handle
+ floating numbers, nor large 64 bit
+ integers well. By default, the
+ net-snmp package compiles in
+ support for these extra datatypes
+ (in a legal way)
+ --with-logfile="location" Default log file location for snmpd.
+ --with-persistent-directory="directory"
+ Default directory for persistent data storage.
+ --with-persistent-mask="mask" Default mask for persistent data storage.
+ (Default: 077)
+ --with-copy-persistent-files="no" Don't copy persistent files
+ (or use "yes" to copy them).
+ (Default: yes)
+ --with-temp-file-pattern=PATTERN Pattern of temporary files (Default: /tmp/snmpdXXXXXX)
+ --with-default-snmp-version="3" Default version of SNMP to use.
+ (Default: 3)
+ Legal values: 1, 2 (for SNMPv2c) or 3.
+ --with-transports="t1 t2 ..." Compile in the given SNMP transport
+ modules (space or comma separated list).
+ --with-out-transports="t1 ..." Exclude listed SNMP transports
+ (space or comma separated list).
+
+ Available SNMP transport modules are:
+
+ UDP support for SNMP over UDP/IP.
+ This transport is always compiled in.
+ UDPIPv6 support for SNMP over UDP/IPv6.
+ This transport is available for Linux, Solaris and
+ FreeBSD at least.
+ This transport is compiled in by default if IPv6 support is enabled.
+ TCPIPv6 support for SNMP over UDP/IPv6.
+ This transport is available for Linux, Solaris and
+ FreeBSD at least.
+ This transport is compiled in by default if IPv6 support is enabled.
+ TCP support for SNMP over TCP/IP.
+ This transport is compiled in by default, but may be omitted.
+ Unix support for SNMP over Unix domain protocols.
+ This transport is compiled in by default except on Win32
+ platforms, and may be omitted.
+ Callback support for SNMP over an internal locally connected pair
+ of snmp_sessions.
+ Alias The alias transport simply lets you define more complex
+ transport strings and alias them to simple names in
+ the snmp.conf file.
+ AAL5PVC support for SNMP over AAL5 PVCs.
+ This transport is presently only available for Linux,
+ is never compiled in by default and may be omitted.
+ IPX support for SNMP over IPX per RFC 1420.
+ This transport is presently only available for Linux,
+ is never compiled in by default and may be omitted.
+ DTLSUDP support for tunneling SNMP over DTLS/UDP
+ TLSTCP support for tunneling SNMP over TLS/TCP
+ SSH (alpha) support for tunneling SNMP over SSH
+
+ --with-security-modules="s1 s2 ..." Compile in the given SNMP security
+ module services (space separated list).
+
+ Available SNMP security services:
+
+ usm support for user based SNMP security
+ ksm support for kerberos based SNMP security
+ tsm support for the Transport-based security
+ (for use with the SSH, DTLSUDP and TLSTCP transports)
+
+ --with-out-security-modules="s1 s2 ..." Removes the given SNMP security
+ module services from the default list.
+
+
+Configuring the agent:
+ --without-root-access The snmpd agent won't require root access to
+ run it. The information it returns in the
+ mib-II tree may not be correct, however.
+ --without-kmem-usage Do not include any code related to the use
+ of kmem.
+ --with-dummy-values Provide 'placeholder' dummy values where
+ the necessary information is not available.
+ This is technically not compliant with the
+ SNMP specifications, but was how the agent
+ operated for versions < 4.0.
+ --with-sys-contact="who@where" Default system contact.
+ (Default: LOGIN@DOMAINNAME)
+ --with-sys-location="location" Default system location.
+ (Default: Unknown)
+ --with-agentx-socket=FILE AgentX socket (Default: /var/agentx/master as specified in RFC2741)
+ --with-features="feat1 feat2" Request extra features to be turned on.
+ (only useful with --enable-minimalist)
+ --with-out-features="feat1..." Remove specific features.
+ (implies --enable-minimalist)
+ --with-mib-modules="item1 ..." Compile with additional mib modules
+ (Space separated list).
+ --with-out-mib-modules="list" Compile without these mib modules.
+
+ Default mib modules compiled into the agent (which can be removed):
+
+ mibII support for the mib-II tree.
+ snmpv3mibs support for the snmpv3 mib modules.
+ ucd_snmp UCD-SNMP-MIB specific extensions.
+ agent_mibs NET-SNMP-AGENT-MIB extensions
+ agentx AgentX support (see below)
+ notification mibs supporting specification of trap destinations.
+ target Support for the SNMP WGs TARGET-MIB.
+ utilities general agent configuration utilities.
+ disman/event support for the DISMAN-EVENT-MIB
+ (supports self monitoring and notification
+ delivery when error conditions are found)
+ disman/schedule support for the DISMAN-SCHEDULE-MIB
+ (trigger SET requests at specified times)
+ host host resources mib support.
+ (only on major supported platforms)
+
+ Optional mib modules that can be built into the agent include:
+ smux smux support to allow subagents to attach to snmpd.
+ mibII/mta_sendmail Sendmail statistics monitoring (MTA-MIB)
+ ucd-snmp/diskio Table of io-devices and how much data they have
+ read/written. (only tested on Solaris, Linux)
+ disman/old-event-mib previous implementation of the DISMAN-EVENT-MIB
+
+ Optional modules for specific platforms
+ Linux
+ ucd-snmp/lmSensors hardware monitoring (LM-SENSORS-MIB)
+ ip-mib/ipv4InterfaceTable (experimental)
+ ip-mib/ipv6InterfaceTable (experimental)
+ tunnel Linux TUNNEL-MIB support (ifTable extension)
+ mibII/interfaces (old ifTable implementation)
+ misc/ipfwacc accounting rules IP firewall information
+ ipfwchains/ipfwchains firewall chains under ipfw
+ (See agent/mibgroup/ipfwchains/README)
+ sctp-mib support for the SCTP-MIB
+ etherlike-mib support for the EtherLike-MIB
+
+ Solaris
+ ucd-snmp/lmSensors hardware monitoring (LM-SENSORS-MIB)
+ if-mib IF-MIB rewrite (add --enable-mfd-rewrites)
+ tcp-mib TCP-MIB rewrite (tcpConnectionTable and
+ tcpListenerTable; add --enable-mfd-rewrites)
+ udp-mib UDP-MIB rewrite (udpEndpointTable;
+ add --enable-mfd-rewrites)
+
+ FreeBSD/OpenBSD
+ if-mib IF-MIB rewrite (add --enable-mfd-rewrites)
+
+ AgentX support:
+ agentx/subagent allows the agent to run as either a snmp agent
+ or as an agentX sub-agent.
+ agentx/master makes the agent run as an agentX master agent
+ as well as a normal snmp agent.
+ agentx includes both agentx/master and agentx/client.
+
+ Optional modules for C coders to look at and/or include as extension examples:
+
+ examples/ucdDemoPublic SNMPv3 interoperability testing mib.
+ examples/example example C code extension.
+Enterprise OIDs: (warning: this should be used with caution.)
+
+ --with-enterprise-oid The enterprise number assigned to the
+ vendor by IANA. See
+ http://www.iana.org/cgi-bin/enterprise.pl
+ to get one, though using the default is
+ probably the right choice is most cases.
+ (default 8072 = "enterprise.net-snmp")
+
+ --with-enterprise-sysoid The base OID for the sysObjectID
+ of the system group
+ (default .1.3.6.1.4.1.8072.3.2... =
+ "netSnmpAgentOIDs...")
+
+ --with-enterprise-notification-oid The OID used for the root of
+ enterprise specific notifications.
+ (default .1.3.6.1.4.1.8072.4 =
+ "netSnmpNotificationPrefix")
+
+Perl:
+ --with-perl-modules=ARGS Install the Perl modules along with the rest
+ of the net-snmp toolkit. If ARGS is
+ specified, they're passed to the
+ Makefile.PL script.
+
+Python:
+ --with-python-modules=ARGS Install the python bindings along with the
+ rest of the net-snmp toolkit. If ARGS is
+ specified, they're passed to the
+ setup.py script as arguments.
+
+Network Buffers:
+ --with-server-send-buf=ARG Use ARG for the default UDP/TCP send buffer instead
+ of the OS buffer for server sockets that are
+ created (snmpd, snmptrapd).
+ This default can be overridden in the runtime
+ configuration files.
+ The ARG should be the size in bytes
+ --with-server-recv-buf=ARG Similar as previous option, but for receive buffer
+ --with-client-send-buf=ARG Similar as previous options, but for the
+ receive buffer of client sockets
+ --with-client-recv-buf=ARG Similar as previous options, but for the send buffer
+ --without-elf use elf libraries
+ --with-nl use libnl to get netlink data (linux only).
+ --with-libwrap=LIBPATH Compile in libwrap (tcp_wrappers) support.
+ --with-zlib=DIR use libz in DIR
+ --with-bzip2=DIR use libbz2 in DIR
+ --with-mnttab="/etc/mnttab"
+ Mount table location. The default is to autodetect
+ this.
+ --with-mysql Include support for MySQL.
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <net-snmp-coders@lists.sourceforge.net>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+Net-SNMP configure 5.7.2
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ---------------------------------------------------- ##
+## Report this to net-snmp-coders@lists.sourceforge.net ##
+## ---------------------------------------------------- ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+
+# ac_fn_c_find_intX_t LINENO BITS VAR
+# -----------------------------------
+# Finds a signed integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_intX_t ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
+$as_echo_n "checking for int$2_t... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ # Order is important - never check a type that is potentially smaller
+ # than half of the expected target width.
+ for ac_type in int$2_t 'int' 'long int' \
+ 'long long int' 'short int' 'signed char'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+ < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ case $ac_type in #(
+ int$2_t) :
+ eval "$3=yes" ;; #(
+ *) :
+ eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+ break
+fi
+ done
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_intX_t
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ # Order is important - never check a type that is potentially smaller
+ # than half of the expected target width.
+ for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ case $ac_type in #(
+ uint$2_t) :
+ eval "$3=yes" ;; #(
+ *) :
+ eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+ break
+fi
+ done
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_uintX_t
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by Net-SNMP $as_me 5.7.2, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+ac_config_headers="$ac_config_headers include/net-snmp/net-snmp-config.h"
+
+
+
+ rm -f configure-summary
+
+
+#
+# save the configure arguments
+#
+
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_CONFIGURE_OPTIONS "$ac_configure_args"
+_ACEOF
+
+CONFIGURE_OPTIONS="\"$ac_configure_args\""
+
+
+##
+## Recommended structure:
+##
+# information on the package
+# checks for programs
+# checks for libraries
+# checks for header files
+# checks for types
+# checks for structures
+# checks for compiler characteristics
+# checks for library functions
+# checks for system services
+
+# -*- autoconf -*-
+#########################################
+##
+# Command-line processing - --with/--enable
+##
+#########################################
+
+##
+# System: Compiler settings
+##
+
+
+# Check whether --with-cc was given.
+if test "${with_cc+set}" = set; then :
+ withval=$with_cc; CC=$with_cc;export CC
+fi
+
+
+
+# Check whether --with-linkcc was given.
+if test "${with_linkcc+set}" = set; then :
+ withval=$with_linkcc; LINKCC=$with_linkcc;export LINKCC
+fi
+
+
+
+# Check whether --with-ar was given.
+if test "${with_ar+set}" = set; then :
+ withval=$with_ar; AR=$with_ar; export AR
+fi
+
+
+
+# Check whether --with-endianness was given.
+if test "${with_endianness+set}" = set; then :
+ withval=$with_endianness; if test $with_endianness != "big" -a $with_endianness != "little" ; then
+ as_fn_error $? "Endianness must be big or little, not \"$with_endianness\"." "$LINENO" 5;
+ fi
+
+fi
+
+
+
+# Check whether --with-cflags was given.
+if test "${with_cflags+set}" = set; then :
+ withval=$with_cflags; CFLAGS=$with_cflags; export CFLAGS
+fi
+
+
+
+# Check whether --with-ldflags was given.
+if test "${with_ldflags+set}" = set; then :
+ withval=$with_ldflags; LDFLAGS=$with_ldflags; export LDFLAGS
+fi
+
+
+# Check whether --enable-as-needed was given.
+if test "${enable_as_needed+set}" = set; then :
+ enableval=$enable_as_needed;
+fi
+
+
+
+# Check whether --with-libs was given.
+if test "${with_libs+set}" = set; then :
+ withval=$with_libs; LIBS=$with_libs; export LIBS
+fi
+
+
+# Check whether --enable-silent-libtool was given.
+if test "${enable_silent_libtool+set}" = set; then :
+ enableval=$enable_silent_libtool; LIBTOOLFLAGS=--silent
+fi
+
+
+
+
+##
+# System: Library settings
+##
+
+
+# Check whether --with-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then :
+ withval=$with_dmalloc;
+fi
+
+ # Check whether --enable-dmalloc was given.
+if test "${enable_dmalloc+set}" = set; then :
+ enableval=$enable_dmalloc; as_fn_error $? "Invalid option. Use --with-dmalloc/--without-dmalloc instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-efence was given.
+if test "${with_efence+set}" = set; then :
+ withval=$with_efence; use_efence="$withval"
+fi
+
+ # Check whether --enable-efence was given.
+if test "${enable_efence+set}" = set; then :
+ enableval=$enable_efence; as_fn_error $? "Invalid option. Use --with-efence/--without-efence instead" "$LINENO" 5
+fi
+
+
+tryrsaref=no
+
+# Check whether --with-rsaref was given.
+if test "${with_rsaref+set}" = set; then :
+ withval=$with_rsaref; if test "x$withval" = "xyes"; then
+ tryrsaref=yes
+ elif test "x$withval" = "xno"; then
+ tryrsaref=no
+ elif test -d "$withval"; then
+
+ if test "x$withval" != x -a -d $withval; then
+ if test -d $withval/lib; then
+ LDFLAGS="-L$withval/lib $LDFLAGS"
+ fi
+ if test -d $withval/include; then
+ CPPFLAGS="-I$withval/include $CPPFLAGS"
+ fi
+ fi
+
+ tryrsaref=yes
+ fi
+fi
+
+ # Check whether --enable-rsaref was given.
+if test "${enable_rsaref+set}" = set; then :
+ enableval=$enable_rsaref; as_fn_error $? "Invalid option. Use --with-rsaref/--without-rsaref instead" "$LINENO" 5
+fi
+
+
+tryopenssl=defaultyes
+askedopenssl=no
+
+# Check whether --with-openssl was given.
+if test "${with_openssl+set}" = set; then :
+ withval=$with_openssl; if test "x$withval" = "xyes"; then
+ tryopenssl=yes
+ askedopenssl=yes
+ elif test "x$withval" = "xinternal"; then
+ tryopenssl=internal
+ askedopenssl=internal
+ elif test "x$withval" = "xno"; then
+ tryopenssl=no
+ elif test -d "$withval"; then
+ if test -d "$withval/lib/MinGW"; then
+ LDFLAGS="-L$withval/lib/MinGW $LDFLAGS"
+ CPPFLAGS="-I$withval/include $CPPFLAGS"
+ else
+
+ if test "x$withval" != x -a -d $withval; then
+ if test -d $withval/lib; then
+ LDFLAGS="-L$withval/lib $LDFLAGS"
+ fi
+ if test -d $withval/include; then
+ CPPFLAGS="-I$withval/include $CPPFLAGS"
+ fi
+ fi
+
+ fi
+ tryopenssl=yes
+ askedopenssl=yes
+ fi
+fi
+
+ # Check whether --enable-openssl was given.
+if test "${enable_openssl+set}" = set; then :
+ enableval=$enable_openssl; as_fn_error $? "Invalid option. Use --with-openssl/--without-openssl instead" "$LINENO" 5
+fi
+
+if test "x$tryopenssl" = "xdefaultyes"; then
+
+ if test "x/usr/local/ssl" != x -a -d /usr/local/ssl; then
+ if test -d /usr/local/ssl/lib; then
+ LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
+ fi
+ if test -d /usr/local/ssl/include; then
+ CPPFLAGS="-I/usr/local/ssl/include $CPPFLAGS"
+ fi
+ fi
+
+ tryopenssl=yes
+fi
+
+# Check whether --with-ssl was given.
+if test "${with_ssl+set}" = set; then :
+ withval=$with_ssl; as_fn_error $? "Invalid option. Use --with-openssl/--without-openssl instead" "$LINENO" 5
+fi
+
+# Check whether --enable-ssl was given.
+if test "${enable_ssl+set}" = set; then :
+ enableval=$enable_ssl; as_fn_error $? "Invalid option. Use --with-openssl/--without-openssl instead" "$LINENO" 5
+fi
+
+
+askedpkcs=no
+
+# Check whether --with-pkcs was given.
+if test "${with_pkcs+set}" = set; then :
+ withval=$with_pkcs; if test "x$withval" = "xyes"; then
+ askedpkcs=yes
+ elif test "x$withval" = "xno"; then
+ askedpkcs=no
+ elif test -d "$withval"; then
+
+ if test "x$withval" != x -a -d $withval; then
+ if test -d $withval/lib; then
+ LDFLAGS="-L$withval/lib $LDFLAGS"
+ fi
+ if test -d $withval/include; then
+ CPPFLAGS="-I$withval/include $CPPFLAGS"
+ fi
+ fi
+
+ askedpkcs=yes
+ fi
+fi
+
+ # Check whether --enable-pkcs was given.
+if test "${enable_pkcs+set}" = set; then :
+ enableval=$enable_pkcs; as_fn_error $? "Invalid option. Use --with-pkcs/--without-pkcs instead" "$LINENO" 5
+fi
+
+
+trykrb5=defaultyes
+askedkrb5=no
+
+# Check whether --with-krb5 was given.
+if test "${with_krb5+set}" = set; then :
+ withval=$with_krb5; if test "x$withval" = "xyes"; then
+ trykrb5=yes
+ askedkrb5=yes
+ krb5path=undef
+ elif test "x$withval" = "xno"; then
+ trykrb5=no
+ krb5path=undef
+ elif test -d "$withval"; then
+ trykrb5=yes
+ askedkrb5=yes
+ krb5path=$withval
+ fi
+fi
+
+ # Check whether --enable-krb5 was given.
+if test "${enable_krb5+set}" = set; then :
+ enableval=$enable_krb5; as_fn_error $? "Invalid option. Use --with-krb5/--without-krb5 instead" "$LINENO" 5
+fi
+
+if test "x$trykrb5" = "xdefaultyes"; then
+ trykrb5=yes
+ krb5path=/usr/kerberos
+fi
+
+
+# Check whether --with-dnssec-local-validation was given.
+if test "${with_dnssec_local_validation+set}" = set; then :
+ withval=$with_dnssec_local_validation; want_dnssec=$withval
+else
+ want_dnssec=no
+fi
+
+# Check whether --enable-dnssec-local-validation was given.
+if test "${enable_dnssec_local_validation+set}" = set; then :
+ enableval=$enable_dnssec_local_validation; as_fn_error $? "Invalid option. Use --with-dnssec-local-validation/--without-dnssec-local-validation instead" "$LINENO" 5
+fi
+
+
+# Check whether --with-dnssec was given.
+if test "${with_dnssec+set}" = set; then :
+ withval=$with_dnssec; as_fn_error $? "Invalid option. Use --with-dnssec-local-validation/--without-dnssec-local-validation instead" "$LINENO" 5
+fi
+
+# Check whether --enable-dnssec was given.
+if test "${enable_dnssec+set}" = set; then :
+ enableval=$enable_dnssec; as_fn_error $? "Invalid option. Use --with-dnssec-local-validation/--without-dnssec-local-validation instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-rpm was given.
+if test "${with_rpm+set}" = set; then :
+ withval=$with_rpm;
+fi
+
+ # Check whether --enable-rpm was given.
+if test "${enable_rpm+set}" = set; then :
+ enableval=$enable_rpm; as_fn_error $? "Invalid option. Use --with-rpm/--without-rpm instead" "$LINENO" 5
+fi
+
+
+
+##
+# Project: Build configuration settings
+##
+
+# Install prefix
+#
+
+# Check whether --with-install-prefix was given.
+if test "${with_install_prefix+set}" = set; then :
+ withval=$with_install_prefix; INSTALL_PREFIX="$withval"
+fi
+
+
+if test "x$INSTALL_PREFIX" = "xyes" ; then
+ as_fn_error $? "--with-install-prefix requires an argument" "$LINENO" 5
+fi
+if test "x$INSTALL_PREFIX" = "xno" ; then
+ INSTALL_PREFIX=""
+fi
+
+
+
+#
+# Subsystems to build:
+# Library
+#
+FEATUREHEADERS="library/features.h"
+FTMAINSUBS=""
+
+#
+# Agent
+#
+# Check whether --enable-agent was given.
+if test "${enable_agent+set}" = set; then :
+ enableval=$enable_agent;
+fi
+
+
+# Check whether --with-agent was given.
+if test "${with_agent+set}" = set; then :
+ withval=$with_agent; as_fn_error $? "Invalid option. Use --enable-agent/--disable-agent instead" "$LINENO" 5
+fi
+
+if test "x$enable_agent" != "xno"; then
+ SNMPD='snmpd$(EXEEXT)'
+ MAINSUBS="$MAINSUBS agent"
+ FEATUREHEADERS="$FEATUREHEADERS agent/features-mibgroups.h agent/features.h"
+ FTMAINSUBS="agent $FTMAINSUBS"
+ TRAPLIBS='$(TRAPDWITHAGENT)'
+ USETRAPLIBS='$(USEAGENTLIBS)'
+else
+ SNMPD=""
+ # we still need/want the agentlibs (for subagents, e.g. snmptrapd)
+ MAINSUBS="$MAINSUBS agent"
+ # building snmptrapd w/o agentlibs doesn't work atm
+ #TRAPLIBS='$(TRAPDWITHOUTAGENT)'
+ #USETRAPLIBS='$(USELIBS)'
+ TRAPLIBS='$(TRAPDWITHAGENT)'
+ USETRAPLIBS='$(USEAGENTLIBS)'
+
+$as_echo "#define NETSNMP_DISABLE_AGENT 1" >>confdefs.h
+
+fi
+
+
+
+
+
+# Applications
+#
+# Check whether --enable-applications was given.
+if test "${enable_applications+set}" = set; then :
+ enableval=$enable_applications;
+fi
+
+
+# Check whether --with-applications was given.
+if test "${with_applications+set}" = set; then :
+ withval=$with_applications; as_fn_error $? "Invalid option. Use --enable-applications/--disable-applications instead" "$LINENO" 5
+fi
+
+if test "x$enable_applications" != "xno"; then
+ MAINSUBS="$MAINSUBS apps"
+ FEATUREHEADERS="$FEATUREHEADERS features-snmpnetstat.h features-apps.h"
+ FTMAINSUBS="apps $FTMAINSUBS"
+else
+
+$as_echo "#define NETSNMP_DISABLE_APPS 1" >>confdefs.h
+
+fi
+
+# Manual pages
+#
+# Check whether --enable-manuals was given.
+if test "${enable_manuals+set}" = set; then :
+ enableval=$enable_manuals;
+fi
+
+
+# Check whether --with-manuals was given.
+if test "${with_manuals+set}" = set; then :
+ withval=$with_manuals; as_fn_error $? "Invalid option. Use --enable-manuals/--disable-manuals instead" "$LINENO" 5
+fi
+
+if test "x$enable_manuals" != "xno"; then
+ MAINSUBS="$MAINSUBS man"
+fi
+
+# Supporting scripts
+#
+# Check whether --enable-scripts was given.
+if test "${enable_scripts+set}" = set; then :
+ enableval=$enable_scripts;
+fi
+
+
+# Check whether --with-scripts was given.
+if test "${with_scripts+set}" = set; then :
+ withval=$with_scripts; as_fn_error $? "Invalid option. Use --enable-scripts/--disable-scripts instead" "$LINENO" 5
+fi
+
+if test "x$enable_scripts" != "xno"; then
+ MAINSUBS="$MAINSUBS local"
+fi
+
+# MIB files
+#
+# Check whether --enable-mibs was given.
+if test "${enable_mibs+set}" = set; then :
+ enableval=$enable_mibs;
+fi
+
+if test "x$enable_mibs" != "xno"; then
+ MAINSUBS="$MAINSUBS mibs"
+fi
+# with-mibs is valid too, but means something else
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what to build and install" >&5
+$as_echo_n "checking what to build and install... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAINSUBS" >&5
+$as_echo "$MAINSUBS" >&6; }
+
+
+# MIB module validation (during "configure")
+#
+# Check whether --enable-mib-config-checking was given.
+if test "${enable_mib_config_checking+set}" = set; then :
+ enableval=$enable_mib_config_checking; if test "$enableval" = yes -o "$enableval" = no ; then
+ with_mib_cfg_checks="$enableval"
+ else
+ as_fn_error $? "Please use --enable/--disable-mib-config-checking" "$LINENO" 5
+ fi
+else
+ with_mib_cfg_checks="no"
+fi
+
+
+# Check whether --with-mib-config-checking was given.
+if test "${with_mib_config_checking+set}" = set; then :
+ withval=$with_mib_config_checking; as_fn_error $? "Invalid option. Use --enable-mib-config-checking/--disable-mib-config-checking instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-mib-config-debug was given.
+if test "${enable_mib_config_debug+set}" = set; then :
+ enableval=$enable_mib_config_debug; if test "$enableval" = yes -o "$enableval" = no ; then
+ with_mib_cfg_debug="$enableval"
+ else
+ as_fn_error $? "Please use --enable/--disable-mib-config-debug" "$LINENO" 5
+ fi
+else
+ with_mib_cfg_debug="no"
+fi
+
+
+# Check whether --with-mib-config-debug was given.
+if test "${with_mib_config_debug+set}" = set; then :
+ withval=$with_mib_config_debug; as_fn_error $? "Invalid option. Use --enable-mib-config-debug/--disable-mib-config-debug instead" "$LINENO" 5
+fi
+
+
+
+# Version-specific features
+#
+# Check whether --enable-new-features was given.
+if test "${enable_new_features+set}" = set; then :
+ enableval=$enable_new_features;
+fi
+
+
+# Check whether --enable-old-features was given.
+if test "${enable_old_features+set}" = set; then :
+ enableval=$enable_old_features;
+fi
+
+
+
+# Check whether --with-features-of was given.
+if test "${with_features_of+set}" = set; then :
+ withval=$with_features_of;
+else
+ with_features_of=$PACKAGE_VERSION
+fi
+
+
+
+# Manual prompting during "configure"
+#
+
+# Check whether --with-defaults was given.
+if test "${with_defaults+set}" = set; then :
+ withval=$with_defaults; if test "$withval" = yes -o "$withval" = no ; then
+ defaults="$withval"
+ else
+ as_fn_error $? "Please use --with/--without-defaults" "$LINENO" 5
+ fi
+else
+ defaults="no"
+fi
+
+ # Check whether --enable-defaults was given.
+if test "${enable_defaults+set}" = set; then :
+ enableval=$enable_defaults; as_fn_error $? "Invalid option. Use --with-defaults/--without-defaults instead" "$LINENO" 5
+fi
+
+
+
+# UCD compatability
+#
+# Check whether --enable-ucd-snmp-compatibility was given.
+if test "${enable_ucd_snmp_compatibility+set}" = set; then :
+ enableval=$enable_ucd_snmp_compatibility;
+fi
+
+
+# Check whether --with-ucd-snmp-compatibility was given.
+if test "${with_ucd_snmp_compatibility+set}" = set; then :
+ withval=$with_ucd_snmp_compatibility; as_fn_error $? "Invalid option. Use --enable-ucd-snmp-compatibility/--disable-ucd-snmp-compatibility instead" "$LINENO" 5
+fi
+
+
+if test "x$enable_ucd_snmp_compatibility" = "xyes" ; then
+ installucdheaders=installucdheaders
+ installucdlibs=installucdlibs
+
+ cat >> configure-summary << EOF
+ UCD-SNMP compatability: enabled
+EOF
+
+fi
+
+
+
+
+##
+# Project: Library: MIB configuration settings
+##
+
+# Check whether --enable-mib-loading was given.
+if test "${enable_mib_loading+set}" = set; then :
+ enableval=$enable_mib_loading;
+fi
+
+
+# Check whether --with-mib-loading was given.
+if test "${with_mib_loading+set}" = set; then :
+ withval=$with_mib_loading; as_fn_error $? "Invalid option. Use --enable-mib-loading/--disable-mib-loading instead" "$LINENO" 5
+fi
+
+if test "x$enable_mib_loading" = "xno"; then
+
+$as_echo "#define NETSNMP_DISABLE_MIB_LOADING 1" >>confdefs.h
+
+fi
+
+
+# Check whether --with-mibdirs was given.
+if test "${with_mibdirs+set}" = set; then :
+ withval=$with_mibdirs; NETSNMP_DEFAULT_MIBDIRS="$with_mibdirs"
+
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_MIBDIRS "$with_mibdirs"
+_ACEOF
+
+fi
+
+ # Check whether --enable-mibdirs was given.
+if test "${enable_mibdirs+set}" = set; then :
+ enableval=$enable_mibdirs; as_fn_error $? "Invalid option. Use --with-mibdirs/--without-mibdirs instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-mibs was given.
+if test "${with_mibs+set}" = set; then :
+ withval=$with_mibs; NETSNMP_DEFAULT_MIBS="$with_mibs"
+fi
+
+# enable-mibs is valid too, but means something else
+
+
+# Check whether --with-mibfiles was given.
+if test "${with_mibfiles+set}" = set; then :
+ withval=$with_mibfiles;
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_MIBFILES "$with_mibfiles"
+_ACEOF
+
+fi
+
+ # Check whether --enable-mibfiles was given.
+if test "${enable_mibfiles+set}" = set; then :
+ enableval=$enable_mibfiles; as_fn_error $? "Invalid option. Use --with-mibfiles/--without-mibfiles instead" "$LINENO" 5
+fi
+
+
+
+##
+# Project: Library: Security configuration
+##
+
+# Check whether --enable-des was given.
+if test "${enable_des+set}" = set; then :
+ enableval=$enable_des;
+fi
+
+
+# Check whether --with-des was given.
+if test "${with_des+set}" = set; then :
+ withval=$with_des; as_fn_error $? "Invalid option. Use --enable-des/--disable-des instead" "$LINENO" 5
+fi
+
+if test "x$enable_des" = "xno"; then
+
+$as_echo "#define NETSNMP_DISABLE_DES 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-privacy was given.
+if test "${enable_privacy+set}" = set; then :
+ enableval=$enable_privacy;
+fi
+
+
+# Check whether --with-privacy was given.
+if test "${with_privacy+set}" = set; then :
+ withval=$with_privacy; as_fn_error $? "Invalid option. Use --enable-privacy/--disable-privacy instead" "$LINENO" 5
+fi
+
+if test "x$enable_privacy" != "xno"; then
+
+$as_echo "#define NETSNMP_ENABLE_SCAPI_AUTHPRIV 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-md5 was given.
+if test "${enable_md5+set}" = set; then :
+ enableval=$enable_md5;
+fi
+
+
+# Check whether --with-md5 was given.
+if test "${with_md5+set}" = set; then :
+ withval=$with_md5; as_fn_error $? "Invalid option. Use --enable-md5/--disable-md5 instead" "$LINENO" 5
+fi
+
+if test "x$enable_md5" = "xno"; then
+
+$as_echo "#define NETSNMP_DISABLE_MD5 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-internal-md5 was given.
+if test "${enable_internal_md5+set}" = set; then :
+ enableval=$enable_internal_md5;
+fi
+
+
+# Check whether --with-internal-md5 was given.
+if test "${with_internal_md5+set}" = set; then :
+ withval=$with_internal_md5; as_fn_error $? "Invalid option. Use --enable-internal-md5/--disable-internal-md5 instead" "$LINENO" 5
+fi
+
+if test "x$enable_internal_md5" = "xyes"; then
+ if test "x$enable_md5" = "xno"; then
+ as_fn_error $? "You can not specify both --enable-internal-md5 and --disable-md5" "$LINENO" 5
+ else
+
+$as_echo "#define NETSNMP_USE_INTERNAL_MD5 1" >>confdefs.h
+
+ fi
+fi
+
+
+##
+# Project: Library: Misc configuration
+##
+
+
+# Check whether --with-opaque-special-types was given.
+if test "${with_opaque_special_types+set}" = set; then :
+ withval=$with_opaque_special_types;
+fi
+
+ # Check whether --enable-opaque-special-types was given.
+if test "${enable_opaque_special_types+set}" = set; then :
+ enableval=$enable_opaque_special_types; as_fn_error $? "Invalid option. Use --with-opaque-special-types/--without-opaque-special-types instead" "$LINENO" 5
+fi
+
+# Only define if specifically chosen as --without (i.e., default to true).
+if test "x$with_opaque_special_types" != "xno"; then
+
+$as_echo "#define NETSNMP_WITH_OPAQUE_SPECIAL_TYPES 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then :
+ enableval=$enable_ipv6; if test "x$enable_ipv6" = "xyes"; then
+
+$as_echo "#define NETSNMP_ENABLE_IPV6 1" >>confdefs.h
+
+ fi
+fi
+
+
+# Check whether --with-ipv6 was given.
+if test "${with_ipv6+set}" = set; then :
+ withval=$with_ipv6; as_fn_error $? "Invalid option. Use --enable-ipv6/--disable-ipv6 instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-logfile was given.
+if test "${with_logfile+set}" = set; then :
+ withval=$with_logfile; ac_cv_user_prompt_NETSNMP_LOGFILE="$with_logfile"
+fi
+
+ # Check whether --enable-logfile was given.
+if test "${enable_logfile+set}" = set; then :
+ enableval=$enable_logfile; as_fn_error $? "Invalid option. Use --with-logfile/--without-logfile instead" "$LINENO" 5
+fi
+
+if test "$ac_cv_user_prompt_NETSNMP_LOGFILE" = "no"; then
+ ac_cv_user_prompt_NETSNMP_LOGFILE="none"
+fi
+
+
+# Check whether --with-persistent-directory was given.
+if test "${with_persistent_directory+set}" = set; then :
+ withval=$with_persistent_directory; ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY="$with_persistent_directory"
+fi
+
+ # Check whether --enable-persistent-directory was given.
+if test "${enable_persistent_directory+set}" = set; then :
+ enableval=$enable_persistent_directory; as_fn_error $? "Invalid option. Use --with-persistent-directory/--without-persistent-directory instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-persistent-mask was given.
+if test "${with_persistent_mask+set}" = set; then :
+ withval=$with_persistent_mask; if test `expr "X$withval" : 'X[0-7]*$'` -eq 4 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using persistent mask $withval" >&5
+$as_echo "using persistent mask $withval" >&6; }
+ withval="0$withval"
+ else
+ as_fn_error $? "Please provide a three digit octal persistent mask value" "$LINENO" 5
+ fi
+else
+ withval=077
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using default persistent mask $withval" >&5
+$as_echo "using default persistent mask $withval" >&6; }
+fi
+
+ # Check whether --enable-persistent-mask was given.
+if test "${enable_persistent_mask+set}" = set; then :
+ enableval=$enable_persistent_mask; as_fn_error $? "Invalid option. Use --with-persistent-mask/--without-persistent-mask instead" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_PERSISTENT_MASK $withval
+_ACEOF
+
+
+
+# Check whether --with-copy_persistent_files was given.
+if test "${with_copy_persistent_files+set}" = set; then :
+ withval=$with_copy_persistent_files; ac_cv_user_prompt_COPY_PERSISTENT_FILES="$with_copy_persistent_files"
+fi
+
+ # Check whether --enable-copy_persistent_files was given.
+if test "${enable_copy_persistent_files+set}" = set; then :
+ enableval=$enable_copy_persistent_files; as_fn_error $? "Invalid option. Use --with-copy_persistent_files/--without-copy_persistent_files instead" "$LINENO" 5
+fi
+
+
+default_temp_file_pattern="/tmp/snmpdXXXXXX"
+
+# Check whether --with-temp-file-pattern was given.
+if test "${with_temp_file_pattern+set}" = set; then :
+ withval=$with_temp_file_pattern; if test `expr "X$withval" : ".*XXXXXX$"` -ne 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using temporary file pattern $withval" >&5
+$as_echo "using temporary file pattern $withval" >&6; }
+ else
+ as_fn_error $? "temporary file pattens must end with 6 X's" "$LINENO" 5
+ fi
+else
+ withval="$default_temp_file_pattern"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using default temporary file pattern $withval" >&5
+$as_echo "using default temporary file pattern $withval" >&6; }
+fi
+
+ # Check whether --enable-temp-file-pattern was given.
+if test "${enable_temp_file_pattern+set}" = set; then :
+ enableval=$enable_temp_file_pattern; as_fn_error $? "Invalid option. Use --with-temp-file-pattern/--without-temp-file-pattern instead" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_TEMP_FILE_PATTERN "$withval"
+_ACEOF
+
+
+
+##
+# Project: Library: Version configuration
+##
+
+SNMP_VERSIONS=""
+# Check whether --enable-snmpv1 was given.
+if test "${enable_snmpv1+set}" = set; then :
+ enableval=$enable_snmpv1;
+fi
+
+
+# Check whether --with-snmpv1 was given.
+if test "${with_snmpv1+set}" = set; then :
+ withval=$with_snmpv1; as_fn_error $? "Invalid option. Use --enable-snmpv1/--disable-snmpv1 instead" "$LINENO" 5
+fi
+
+if test "x$enable_snmpv1" = "xno"; then
+
+$as_echo "#define NETSNMP_DISABLE_SNMPV1 1" >>confdefs.h
+
+else
+ SNMP_VERSIONS="$SNMP_VERSIONS 1"
+fi
+
+# Check whether --enable-snmpv2c was given.
+if test "${enable_snmpv2c+set}" = set; then :
+ enableval=$enable_snmpv2c;
+fi
+
+
+# Check whether --with-snmpv2c was given.
+if test "${with_snmpv2c+set}" = set; then :
+ withval=$with_snmpv2c; as_fn_error $? "Invalid option. Use --enable-snmpv2c/--disable-snmpv2c instead" "$LINENO" 5
+fi
+
+if test "x$enable_snmpv2c" = "xno"; then
+
+$as_echo "#define NETSNMP_DISABLE_SNMPV2C 1" >>confdefs.h
+
+else
+ SNMP_VERSIONS="$SNMP_VERSIONS 2c"
+fi
+
+SNMP_VERSIONS="$SNMP_VERSIONS 3"
+
+ cat >> configure-summary << EOF
+ SNMP Versions Supported: $SNMP_VERSIONS
+EOF
+
+
+
+# Check whether --with-default-snmp-version was given.
+if test "${with_default_snmp_version+set}" = set; then :
+ withval=$with_default_snmp_version; ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION="$with_default_snmp_version"
+fi
+
+ # Check whether --enable-default-snmp-version was given.
+if test "${enable_default_snmp_version+set}" = set; then :
+ enableval=$enable_default_snmp_version; as_fn_error $? "Invalid option. Use --with-default-snmp-version/--without-default-snmp-version instead" "$LINENO" 5
+fi
+
+
+# we test this now and later as well. we test it now so configure can die
+# early on with an error rather than waiting till the end of the script.
+case "${ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION-3}" in
+ [123]) ;;
+ 2c) ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION=2 ;;
+ *)
+ as_fn_error $? "Illegal version number. Only 1, 2 (for SNMPv2c) and 3 are supported." "$LINENO" 5
+ ;;
+esac
+
+
+##
+# Project: Library: Transport modules
+##
+
+
+# Check whether --with-transports was given.
+if test "${with_transports+set}" = set; then :
+ withval=$with_transports;
+fi
+
+
+# Check whether --with-out_transports was given.
+if test "${with_out_transports+set}" = set; then :
+ withval=$with_out_transports;
+fi
+
+
+#
+# Catch common mistakes in transport options
+#
+
+# Check whether --with-transport was given.
+if test "${with_transport+set}" = set; then :
+ withval=$with_transport; as_fn_error $? "Invalid option. Use --with-transports/--without-transports instead" "$LINENO" 5
+fi
+
+
+# Check whether --with-out-transport was given.
+if test "${with_out_transport+set}" = set; then :
+ withval=$with_out_transport; as_fn_error $? "Invalid option. Use --with-out-transports/--without-out-transports instead" "$LINENO" 5
+fi
+
+
+
+##
+# Project: Library: Security modules
+##
+
+
+# Check whether --with-security-modules was given.
+if test "${with_security_modules+set}" = set; then :
+ withval=$with_security_modules;
+fi
+
+ # Check whether --enable-security-modules was given.
+if test "${enable_security_modules+set}" = set; then :
+ enableval=$enable_security_modules; as_fn_error $? "Invalid option. Use --with-security-modules/--without-security-modules instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-out-security-modules was given.
+if test "${with_out_security_modules+set}" = set; then :
+ withval=$with_out_security_modules;
+fi
+
+ # Check whether --enable-out-security-modules was given.
+if test "${enable_out_security_modules+set}" = set; then :
+ enableval=$enable_out_security_modules; as_fn_error $? "Invalid option. Use --with-out-security-modules/--without-out-security-modules instead" "$LINENO" 5
+fi
+
+
+
+##
+# Project: Library: Developer-related settings
+##
+
+# Check whether --enable-debugging was given.
+if test "${enable_debugging+set}" = set; then :
+ enableval=$enable_debugging; $as_echo "#define NETSNMP_ALWAYS_DEBUG 1" >>confdefs.h
+
+fi
+
+
+# Check whether --with-debugging was given.
+if test "${with_debugging+set}" = set; then :
+ withval=$with_debugging; as_fn_error $? "Invalid option. Use --enable-debugging/--disable-debugging instead" "$LINENO" 5
+fi
+
+if test "x$enable_debugging" = "xno"; then
+ $as_echo "#define NETSNMP_NO_DEBUGGING 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-developer was given.
+if test "${enable_developer+set}" = set; then :
+ enableval=$enable_developer; if test "$enableval" = yes ; then
+ developer="yes"
+ elif test "$enableval" != no ; then
+ as_fn_error $? "Please use --enable/--disable-developer" "$LINENO" 5
+ else
+ developer="no"
+ fi
+fi
+
+
+# Check whether --with-developer was given.
+if test "${with_developer+set}" = set; then :
+ withval=$with_developer; as_fn_error $? "Invalid option. Use --enable-developer/--disable-developer instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-testing-code was given.
+if test "${enable_testing_code+set}" = set; then :
+ enableval=$enable_testing_code; if test "$enableval" = yes ; then
+
+$as_echo "#define NETSNMP_ENABLE_TESTING_CODE 1" >>confdefs.h
+
+ elif test "$enableval" != no ; then
+ as_fn_error $? "Please use --enable/--disable-testing-code" "$LINENO" 5
+ fi
+fi
+
+
+# Check whether --with-testing-code was given.
+if test "${with_testing_code+set}" = set; then :
+ withval=$with_testing_code; as_fn_error $? "Invalid option. Use --enable-testing-code/--disable-testing-code instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-reentrant was given.
+if test "${enable_reentrant+set}" = set; then :
+ enableval=$enable_reentrant; if test "$enableval" = yes -o "$enableval" = no ; then
+ with_res_locks="$enableval"
+ else
+ as_fn_error $? "Please use --enable/--disable-reentrant" "$LINENO" 5
+ fi
+else
+ with_res_locks="no"
+fi
+
+
+# Check whether --with-reentrant was given.
+if test "${with_reentrant+set}" = set; then :
+ withval=$with_reentrant; as_fn_error $? "Invalid option. Use --enable-reentrant/--disable-reentrant instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-deprecated was given.
+if test "${enable_deprecated+set}" = set; then :
+ enableval=$enable_deprecated;
+fi
+
+
+# Check whether --with-deprecated was given.
+if test "${with_deprecated+set}" = set; then :
+ withval=$with_deprecated; as_fn_error $? "Invalid option. Use --enable-deprecated/--disable-deprecated instead" "$LINENO" 5
+fi
+
+if test "$enable_deprecated" = no ; then
+
+$as_echo "#define NETSNMP_NO_DEPRECATED_FUNCTIONS 1" >>confdefs.h
+
+fi
+
+
+
+##
+# Project: Agent configuration settings
+##
+
+
+# Check whether --with-root-access was given.
+if test "${with_root_access+set}" = set; then :
+ withval=$with_root_access;
+fi
+
+ # Check whether --enable-root-access was given.
+if test "${enable_root_access+set}" = set; then :
+ enableval=$enable_root_access; as_fn_error $? "Invalid option. Use --with-root-access/--without-root-access instead" "$LINENO" 5
+fi
+
+# Only define if specifically chosen as --without (i.e., default to true).
+if test "x$with_root_access" = "xno"; then
+
+$as_echo "#define NETSNMP_NO_ROOT_ACCESS 1" >>confdefs.h
+
+fi
+
+
+# Check whether --with-kmem-usage was given.
+if test "${with_kmem_usage+set}" = set; then :
+ withval=$with_kmem_usage;
+fi
+
+ # Check whether --enable-kmem-usage was given.
+if test "${enable_kmem_usage+set}" = set; then :
+ enableval=$enable_kmem_usage; as_fn_error $? "Invalid option. Use --with-kmem-usage/--without-kmem-usage instead" "$LINENO" 5
+fi
+
+# Only define if specifically chosen as --without (i.e., default to true).
+if test "x$with_kmem_usage" = "xno"; then
+
+$as_echo "#define NETSNMP_NO_KMEM_USAGE 1" >>confdefs.h
+
+fi
+
+
+# Check whether --with-dummy-values was given.
+if test "${with_dummy_values+set}" = set; then :
+ withval=$with_dummy_values;
+fi
+
+ # Check whether --enable-dummy-values was given.
+if test "${enable_dummy_values+set}" = set; then :
+ enableval=$enable_dummy_values; as_fn_error $? "Invalid option. Use --with-dummy-values/--without-dummy-values instead" "$LINENO" 5
+fi
+
+# Define unless specifically suppressed (i.e., option defaults to false).
+if test "x$with_dummy_values" != "xyes"; then
+
+$as_echo "#define NETSNMP_NO_DUMMY_VALUES 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-set-support was given.
+if test "${enable_set_support+set}" = set; then :
+ enableval=$enable_set_support;
+fi
+
+
+# Check whether --with-set-support was given.
+if test "${with_set_support+set}" = set; then :
+ withval=$with_set_support; as_fn_error $? "Invalid option. Use --enable-set-support/--disable-set-support instead" "$LINENO" 5
+fi
+
+if test "x$enable_set_support" = "xno"; then
+
+$as_echo "#define NETSNMP_DISABLE_SET_SUPPORT 1" >>confdefs.h
+
+fi
+
+
+
+# Check whether --with-sys_contact was given.
+if test "${with_sys_contact+set}" = set; then :
+ withval=$with_sys_contact; ac_cv_user_prompt_NETSNMP_SYS_CONTACT="$with_sys_contact"
+fi
+
+ # Check whether --enable-sys_contact was given.
+if test "${enable_sys_contact+set}" = set; then :
+ enableval=$enable_sys_contact; as_fn_error $? "Invalid option. Use --with-sys_contact/--without-sys_contact instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-sys_location was given.
+if test "${with_sys_location+set}" = set; then :
+ withval=$with_sys_location; ac_cv_user_prompt_NETSNMP_SYS_LOC="$with_sys_location"
+fi
+
+ # Check whether --enable-sys_location was given.
+if test "${enable_sys_location+set}" = set; then :
+ enableval=$enable_sys_location; as_fn_error $? "Invalid option. Use --with-sys_location/--without-sys_location instead" "$LINENO" 5
+fi
+
+
+
+
+##
+# Project: Agent: Extensibility configuration
+##
+
+# Check whether --enable-local-smux was given.
+if test "${enable_local_smux+set}" = set; then :
+ enableval=$enable_local_smux; if test "x$enable_local_smux" = "xyes"; then
+
+$as_echo "#define NETSNMP_ENABLE_LOCAL_SMUX 1" >>confdefs.h
+
+ fi
+fi
+
+
+# Check whether --with-local-smux was given.
+if test "${with_local_smux+set}" = set; then :
+ withval=$with_local_smux; as_fn_error $? "Invalid option. Use --enable-local-smux/--disable-local-smux instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-agentx-dom-sock-only was given.
+if test "${enable_agentx_dom_sock_only+set}" = set; then :
+ enableval=$enable_agentx_dom_sock_only;
+$as_echo "#define NETSNMP_AGENTX_DOM_SOCK_ONLY 1" >>confdefs.h
+
+fi
+
+
+# Check whether --with-agentx-dom-sock-only was given.
+if test "${with_agentx_dom_sock_only+set}" = set; then :
+ withval=$with_agentx_dom_sock_only; as_fn_error $? "Invalid option. Use --enable-agentx-dom-sock-only/--disable-agentx-dom-sock-only instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-snmptrapd-subagent was given.
+if test "${enable_snmptrapd_subagent+set}" = set; then :
+ enableval=$enable_snmptrapd_subagent;
+fi
+
+
+# Check whether --with-snmptrapd-subagent was given.
+if test "${with_snmptrapd_subagent+set}" = set; then :
+ withval=$with_snmptrapd_subagent; as_fn_error $? "Invalid option. Use --enable-snmptrapd-subagent/--disable-snmptrapd-subagent instead" "$LINENO" 5
+fi
+
+if test "x$enable_snmptrapd_subagent" = "xno"; then
+
+$as_echo "#define NETSNMP_SNMPTRAPD_DISABLE_AGENTX 1" >>confdefs.h
+
+fi
+
+default_agentx_socket="/var/agentx/master"
+
+# Check whether --with-agentx-socket was given.
+if test "${with_agentx_socket+set}" = set; then :
+ withval=$with_agentx_socket;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a full path " "$LINENO" 5;
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using AgentX socket $withval" >&5
+$as_echo "using AgentX socket $withval" >&6; }
+
+else
+
+ withval=$default_agentx_socket
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using default AgentX socket $default_agentx_socket" >&5
+$as_echo "using default AgentX socket $default_agentx_socket" >&6; }
+
+fi
+
+ # Check whether --enable-agentx-socket was given.
+if test "${enable_agentx_socket+set}" = set; then :
+ enableval=$enable_agentx_socket; as_fn_error $? "Invalid option. Use --with-agentx-socket/--without-agentx-socket instead" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_AGENTX_SOCKET "$withval"
+_ACEOF
+
+
+#
+# feature addition/removal and minimialist support
+#
+FEATURE_ADD_FLAGS=""
+
+# Check whether --with-features was given.
+if test "${with_features+set}" = set; then :
+ withval=$with_features;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a list of features " "$LINENO" 5;
+ fi
+ FEATURE_ADD_FLAGS="--add $withval"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: adding in features: $withval" >&5
+$as_echo "adding in features: $withval" >&6; }
+
+fi
+
+ # Check whether --enable-features was given.
+if test "${enable_features+set}" = set; then :
+ enableval=$enable_features; as_fn_error $? "Invalid option. Use --with-features/--without-features instead" "$LINENO" 5
+fi
+
+
+
+
+FEATURE_REMOVE_FLAGS=""
+
+# Check whether --with-out-features was given.
+if test "${with_out_features+set}" = set; then :
+ withval=$with_out_features;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a list of features " "$LINENO" 5;
+ fi
+ FEATURE_REMOVE_FLAGS="--remove $withval"
+ FEATURETARGS="features"
+
+$as_echo "#define NETSNMP_MINIMAL_CODE 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: removing features: $withval" >&5
+$as_echo "removing features: $withval" >&6; }
+
+fi
+
+ # Check whether --enable-out-features was given.
+if test "${enable_out_features+set}" = set; then :
+ enableval=$enable_out_features; as_fn_error $? "Invalid option. Use --with-out-features/--without-out-features instead" "$LINENO" 5
+fi
+
+
+
+
+# Catch common mistakes
+
+# Check whether --with-feature was given.
+if test "${with_feature+set}" = set; then :
+ withval=$with_feature; as_fn_error $? "Invalid option. Use --with-features/--without-features instead" "$LINENO" 5
+fi
+
+
+# Check whether --with-out-feature was given.
+if test "${with_out_feature+set}" = set; then :
+ withval=$with_out_feature; as_fn_error $? "Invalid option. Use --with-out-features/--without-out-features instead" "$LINENO" 5
+fi
+
+
+FEATURETARGS=""
+# Check whether --enable-minimalist was given.
+if test "${enable_minimalist+set}" = set; then :
+ enableval=$enable_minimalist;
+fi
+
+
+# Check whether --with-minimalist was given.
+if test "${with_minimalist+set}" = set; then :
+ withval=$with_minimalist; as_fn_error $? "Invalid option. Use --enable-minimalist/--disable-minimalist instead" "$LINENO" 5
+fi
+
+if test "x$enable_minimalist" = "xyes"; then
+ # we'll assume the mini agent is desired here as well
+ mini_agent="yes"
+ FEATURETARGS="features"
+
+ # needed to bootstrap later checks
+ echo "" > include/net-snmp/feature-details.h
+
+$as_echo "#define NETSNMP_MINIMAL_CODE 1" >>confdefs.h
+
+else
+ FEATUREHEADERS=""
+fi
+
+# Check whether --with-minimalist was given.
+if test "${with_minimalist+set}" = set; then :
+ withval=$with_minimalist; as_fn_error $? "Invalid option. Use --enable-minimalist/--disable-minimalist instead" "$LINENO" 5
+fi
+
+
+
+
+# Check whether --enable-notify-only was given.
+if test "${enable_notify_only+set}" = set; then :
+ enableval=$enable_notify_only;
+fi
+
+
+# Check whether --with-notify-only was given.
+if test "${with_notify_only+set}" = set; then :
+ withval=$with_notify_only; as_fn_error $? "Invalid option. Use --enable-notify-only/--disable-notify-only instead" "$LINENO" 5
+fi
+
+if test "x$enable_notify_only" = "xyes"; then
+
+$as_echo "#define NETSNMP_NOTIFY_ONLY 1" >>confdefs.h
+
+fi
+
+# Check whether --with-notify-only was given.
+if test "${with_notify_only+set}" = set; then :
+ withval=$with_notify_only; as_fn_error $? "Invalid option. Use --enable-notify-only/--disable-notify-only instead" "$LINENO" 5
+fi
+
+# Check whether --enable-notifyonly was given.
+if test "${enable_notifyonly+set}" = set; then :
+ enableval=$enable_notifyonly; as_fn_error $? "Invalid option. Use --enable-notify-only/--disable-notify-only instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-no-listen was given.
+if test "${enable_no_listen+set}" = set; then :
+ enableval=$enable_no_listen;
+fi
+
+
+# Check whether --with-no-listen was given.
+if test "${with_no_listen+set}" = set; then :
+ withval=$with_no_listen; as_fn_error $? "Invalid option. Use --enable-no-listen/--disable-no-listen instead" "$LINENO" 5
+fi
+
+if test "x$enable_no_listen" = "xyes" -o "x$enable_notify_only" = "xyes"; then
+ enable_no_listen="yes"
+
+$as_echo "#define NETSNMP_NO_LISTEN_SUPPORT 1" >>confdefs.h
+
+fi
+
+# Check whether --with-no-listen was given.
+if test "${with_no_listen+set}" = set; then :
+ withval=$with_no_listen; as_fn_error $? "Invalid option. Use --enable-no-listen/--disable-no-listen instead" "$LINENO" 5
+fi
+
+# Check whether --enable-nolisten was given.
+if test "${enable_nolisten+set}" = set; then :
+ enableval=$enable_nolisten; as_fn_error $? "Invalid option. Use --enable-no-listen/--disable-no-listen instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-read-only was given.
+if test "${enable_read_only+set}" = set; then :
+ enableval=$enable_read_only;
+fi
+
+
+# Check whether --with-read-only was given.
+if test "${with_read_only+set}" = set; then :
+ withval=$with_read_only; as_fn_error $? "Invalid option. Use --enable-read-only/--disable-read-only instead" "$LINENO" 5
+fi
+
+if test "x$enable_read_only" = "xyes" -o "x$enable_notify_only" = "xyes" ; then
+ enable_read_only="yes"
+
+$as_echo "#define NETSNMP_NO_WRITE_SUPPORT 1" >>confdefs.h
+
+fi
+
+# Check whether --with-read-only was given.
+if test "${with_read_only+set}" = set; then :
+ withval=$with_read_only; as_fn_error $? "Invalid option. Use --enable-read-only/--disable-read-only instead" "$LINENO" 5
+fi
+
+# Check whether --enable-readonly was given.
+if test "${enable_readonly+set}" = set; then :
+ enableval=$enable_readonly; as_fn_error $? "Invalid option. Use --enable-read-only/--disable-read-only instead" "$LINENO" 5
+fi
+
+
+
+##
+# Project: Agent: MIB module configuration
+##
+
+# Check whether --enable-mini_agent was given.
+if test "${enable_mini_agent+set}" = set; then :
+ enableval=$enable_mini_agent;
+fi
+
+
+# Check whether --with-mini_agent was given.
+if test "${with_mini_agent+set}" = set; then :
+ withval=$with_mini_agent; as_fn_error $? "Invalid option. Use --enable-mini_agent/--disable-mini_agent instead" "$LINENO" 5
+fi
+
+if test "x$enable_mini_agent" = "xyes"; then
+ mini_agent="yes"
+else
+ mini_agent="no"
+fi
+
+# Check whether --with-miniagent was given.
+if test "${with_miniagent+set}" = set; then :
+ withval=$with_miniagent; as_fn_error $? "Invalid option. Use --enable-mini-agent/--disable-mini-agent instead" "$LINENO" 5
+fi
+
+# Check whether --enable-miniagent was given.
+if test "${enable_miniagent+set}" = set; then :
+ enableval=$enable_miniagent; as_fn_error $? "Invalid option. Use --enable-mini-agent/--disable-mini-agent instead" "$LINENO" 5
+fi
+
+
+
+
+
+# Check whether --enable-mfd-rewrites was given.
+if test "${enable_mfd_rewrites+set}" = set; then :
+ enableval=$enable_mfd_rewrites;
+fi
+
+
+# Check whether --with-mfd-rewrites was given.
+if test "${with_mfd_rewrites+set}" = set; then :
+ withval=$with_mfd_rewrites; as_fn_error $? "Invalid option. Use --enable-mfd-rewrites/--disable-mfd-rewrites instead" "$LINENO" 5
+fi
+
+if test "x$enable_mfd_rewrites" = "xyes"; then
+
+$as_echo "#define NETSNMP_ENABLE_MFD_REWRITES 1" >>confdefs.h
+
+fi
+
+
+
+# Check whether --with-mib_modules was given.
+if test "${with_mib_modules+set}" = set; then :
+ withval=$with_mib_modules;
+fi
+
+ # Check whether --enable-mib_modules was given.
+if test "${enable_mib_modules+set}" = set; then :
+ enableval=$enable_mib_modules; as_fn_error $? "Invalid option. Use --with-mib_modules/--without-mib_modules instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-out_mib_modules was given.
+if test "${with_out_mib_modules+set}" = set; then :
+ withval=$with_out_mib_modules;
+fi
+
+ # Check whether --enable-out_mib_modules was given.
+if test "${enable_out_mib_modules+set}" = set; then :
+ enableval=$enable_out_mib_modules; as_fn_error $? "Invalid option. Use --with-out_mib_modules/--without-out_mib_modules instead" "$LINENO" 5
+fi
+
+
+
+#
+# Catch common mistakes in configure options
+#
+
+# Check whether --with-mib-module was given.
+if test "${with_mib_module+set}" = set; then :
+ withval=$with_mib_module; as_fn_error $? "Invalid option. Use --with-mib-modules/--without-mib-modules instead" "$LINENO" 5
+fi
+
+
+# Check whether --with-module was given.
+if test "${with_module+set}" = set; then :
+ withval=$with_module; as_fn_error $? "Invalid option. Use --with-mib-modules/--without-mib-modules instead" "$LINENO" 5
+fi
+
+
+# Check whether --with-modules was given.
+if test "${with_modules+set}" = set; then :
+ withval=$with_modules; as_fn_error $? "Invalid option. Use --with-mib-modules/--without-mib-modules instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-out-mib-module was given.
+if test "${with_out_mib_module+set}" = set; then :
+ withval=$with_out_mib_module; as_fn_error $? "Invalid option. Use --with-out-mib-modules/--without-out-mib-modules instead" "$LINENO" 5
+fi
+
+
+# Check whether --with-out-module was given.
+if test "${with_out_module+set}" = set; then :
+ withval=$with_out_module; as_fn_error $? "Invalid option. Use --with-out-mib-modules/--without-out-mib-modules instead" "$LINENO" 5
+fi
+
+
+# Check whether --with-out-modules was given.
+if test "${with_out_modules+set}" = set; then :
+ withval=$with_out_modules; as_fn_error $? "Invalid option. Use --with-out-mib-modules/--without-out-mib-modules instead" "$LINENO" 5
+fi
+
+
+
+##
+# Project: Enterprise settings (? Agent/Library/Both?)
+##
+
+
+# Check whether --with-enterprise-oid was given.
+if test "${with_enterprise_oid+set}" = set; then :
+ withval=$with_enterprise_oid;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a value for the enterprise number " "$LINENO" 5;
+ fi
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_ENTERPRISE_OID $withval
+_ACEOF
+
+ ent_oid="1,3,6,1,4,1,$withval"
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_ENTERPRISE_MIB $ent_oid
+_ACEOF
+
+ ent_dot_oid="1.3.6.1.4.1.$withval"
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_ENTERPRISE_DOT_MIB $ent_dot_oid
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using enterprise number $withval" >&5
+$as_echo "using enterprise number $withval" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using default \"enterprise.net-snmp\"" >&5
+$as_echo "using default \"enterprise.net-snmp\"" >&6; }
+
+fi
+
+ # Check whether --enable-enterprise-oid was given.
+if test "${enable_enterprise_oid+set}" = set; then :
+ enableval=$enable_enterprise_oid; as_fn_error $? "Invalid option. Use --with-enterprise-oid/--without-enterprise-oid instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-enterprise-sysoid was given.
+if test "${with_enterprise_sysoid+set}" = set; then :
+ withval=$with_enterprise_sysoid;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a base OID value " "$LINENO" 5;
+ fi
+ sys_oid=`echo "$withval" | sed 's/^\.//' | sed 's/\./\,/g'`
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_SYSTEM_MIB $sys_oid
+_ACEOF
+
+ sys_dot_oid=`echo "$withval" | sed 's/^\.//'`
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_SYSTEM_DOT_MIB $sys_dot_oid
+_ACEOF
+
+ sysoid_len=`echo "$withval" | sed 's/^\.//g' | awk -F\. '{ print NF }'`
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_SYSTEM_DOT_MIB_LENGTH $sysoid_len
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using enterprise sysOID $withval ...." >&5
+$as_echo "using enterprise sysOID $withval ...." >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using default enterprise sysOID \"NET-SNMP-MIB::netSnmpAgentOIDs...\"" >&5
+$as_echo "using default enterprise sysOID \"NET-SNMP-MIB::netSnmpAgentOIDs...\"" >&6; }
+
+fi
+
+ # Check whether --enable-enterprise-sysoid was given.
+if test "${enable_enterprise_sysoid+set}" = set; then :
+ enableval=$enable_enterprise_sysoid; as_fn_error $? "Invalid option. Use --with-enterprise-sysoid/--without-enterprise-sysoid instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-enterprise-notification-oid was given.
+if test "${with_enterprise_notification_oid+set}" = set; then :
+ withval=$with_enterprise_notification_oid;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a base OID value " "$LINENO" 5;
+ fi
+ notification_oid=`echo "$withval" | sed 's/^\.//' | sed 's/\./\,/g'`
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_NOTIFICATION_MIB $notification_oid
+_ACEOF
+
+ notification_dot_oid=`echo "$withval" | sed 's/^\.//'`
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_NOTIFICATION_DOT_MIB $notification_dot_oid
+_ACEOF
+
+ notificationoid_len=`echo "$withval" | sed 's/^\.//g' | awk -F\. '{ print NF }'`
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_NOTIFICATION_DOT_MIB_LENGTH $notificationoid_len
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using enterprise notifications $withval" >&5
+$as_echo "using enterprise notifications $withval" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using default notifications \"NET-SNMP-MIB::netSnmpNotifications\"" >&5
+$as_echo "using default notifications \"NET-SNMP-MIB::netSnmpNotifications\"" >&6; }
+
+fi
+
+ # Check whether --enable-enterprise-notification-oid was given.
+if test "${enable_enterprise_notification_oid+set}" = set; then :
+ enableval=$enable_enterprise_notification_oid; as_fn_error $? "Invalid option. Use --with-enterprise-notification-oid/--without-enterprise-notification-oid instead" "$LINENO" 5
+fi
+
+
+
+##
+# Project: Perl settings
+##
+
+
+# Check whether --with-perl-modules was given.
+if test "${with_perl_modules+set}" = set; then :
+ withval=$with_perl_modules;
+ if test "$withval" = "no"; then
+ install_perl="no"
+ else
+ install_perl="yes"
+ if test "$withval" != "yes"; then
+ PERLARGS="$withval"
+ fi
+ fi
+
+else
+ install_perl="try"
+fi
+
+ # Check whether --enable-perl-modules was given.
+if test "${enable_perl_modules+set}" = set; then :
+ enableval=$enable_perl_modules; as_fn_error $? "Invalid option. Use --with-perl-modules/--without-perl-modules instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-embedded-perl was given.
+if test "${enable_embedded_perl+set}" = set; then :
+ enableval=$enable_embedded_perl; embed_perl="$enableval"
+else
+ embed_perl="try"
+fi
+
+
+# Check whether --with-embedded-perl was given.
+if test "${with_embedded_perl+set}" = set; then :
+ withval=$with_embedded_perl; as_fn_error $? "Invalid option. Use --enable-embedded-perl/--disable-embedded-perl instead" "$LINENO" 5
+fi
+
+
+# Check whether --enable-perl-cc-checks was given.
+if test "${enable_perl_cc_checks+set}" = set; then :
+ enableval=$enable_perl_cc_checks;
+fi
+
+
+# Check whether --with-perl-cc-checks was given.
+if test "${with_perl_cc_checks+set}" = set; then :
+ withval=$with_perl_cc_checks; as_fn_error $? "Invalid option. Use --enable-perl-cc-checks/--disable-perl-cc-checks instead" "$LINENO" 5
+fi
+
+
+
+##
+# Project: Python settings
+##
+
+
+# Check whether --with-python-modules was given.
+if test "${with_python_modules+set}" = set; then :
+ withval=$with_python_modules;
+ install_python="yes"
+ if test "$withval" = "yes"; then
+ PYTHONARGS=""
+ elif test "$withval" = "no"; then
+ PYTHONARGS=""
+ install_python="no"
+ else
+ PYTHONARGS="$withval"
+ fi
+
+else
+ install_python="no"
+fi
+
+
+
+##
+# Project: Library settings
+##
+
+
+# Check whether --with-server-send-buf was given.
+if test "${with_server_send_buf+set}" = set; then :
+ withval=$with_server_send_buf;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a positive number for the server send buffer " "$LINENO" 5
+ fi
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_SERVER_SEND_BUF $withval
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using OS default send buffer size for server sockets" >&5
+$as_echo "using OS default send buffer size for server sockets" >&6; }
+fi
+
+ # Check whether --enable-server-send-buf was given.
+if test "${enable_server_send_buf+set}" = set; then :
+ enableval=$enable_server_send_buf; as_fn_error $? "Invalid option. Use --with-server-send-buf/--without-server-send-buf instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-server-recv-buf was given.
+if test "${with_server_recv_buf+set}" = set; then :
+ withval=$with_server_recv_buf;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a positive number for the server recv buffer " "$LINENO" 5
+ fi
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_SERVER_RECV_BUF $withval
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using OS default recv buffer size for server sockets" >&5
+$as_echo "using OS default recv buffer size for server sockets" >&6; }
+fi
+
+ # Check whether --enable-server-recv-buf was given.
+if test "${enable_server_recv_buf+set}" = set; then :
+ enableval=$enable_server_recv_buf; as_fn_error $? "Invalid option. Use --with-server-recv-buf/--without-server-recv-buf instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-client-send-buf was given.
+if test "${with_client_send_buf+set}" = set; then :
+ withval=$with_client_send_buf;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a positive number for the client send buffer " "$LINENO" 5
+ fi
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_CLIENT_SEND_BUF $withval
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using OS default send buffer size for client sockets" >&5
+$as_echo "using OS default send buffer size for client sockets" >&6; }
+fi
+
+ # Check whether --enable-client-send-buf was given.
+if test "${enable_client_send_buf+set}" = set; then :
+ enableval=$enable_client_send_buf; as_fn_error $? "Invalid option. Use --with-client-send-buf/--without-client-send-buf instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-client-recv-buf was given.
+if test "${with_client_recv_buf+set}" = set; then :
+ withval=$with_client_recv_buf;
+ if test "$withval" = yes; then
+ as_fn_error $? " Please provide a positive number for the client recv buffer " "$LINENO" 5
+ fi
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_CLIENT_RECV_BUF $withval
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using OS default recv buffer size for client sockets" >&5
+$as_echo "using OS default recv buffer size for client sockets" >&6; }
+fi
+
+ # Check whether --enable-client-recv-buf was given.
+if test "${enable_client_recv_buf+set}" = set; then :
+ enableval=$enable_client_recv_buf; as_fn_error $? "Invalid option. Use --with-client-recv-buf/--without-client-recv-buf instead" "$LINENO" 5
+fi
+
+
+##
+# System: library settings (more)
+##
+
+
+# Check whether --with-elf was given.
+if test "${with_elf+set}" = set; then :
+ withval=$with_elf;
+fi
+
+ # Check whether --enable-elf was given.
+if test "${enable_elf+set}" = set; then :
+ enableval=$enable_elf; as_fn_error $? "Invalid option. Use --with-elf/--without-elf instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-nl was given.
+if test "${with_nl+set}" = set; then :
+ withval=$with_nl;
+fi
+
+ # Check whether --enable-nl was given.
+if test "${enable_nl+set}" = set; then :
+ enableval=$enable_nl; as_fn_error $? "Invalid option. Use --with-nl/--without-nl instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-libwrap was given.
+if test "${with_libwrap+set}" = set; then :
+ withval=$with_libwrap;
+else
+ with_libwrap="no"
+fi
+
+ # Check whether --enable-libwrap was given.
+if test "${enable_libwrap+set}" = set; then :
+ enableval=$enable_libwrap; as_fn_error $? "Invalid option. Use --with-libwrap/--without-libwrap instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+ withval=$with_zlib;
+else
+ with_zlib="no"
+fi
+
+ # Check whether --enable-zlib was given.
+if test "${enable_zlib+set}" = set; then :
+ enableval=$enable_zlib; as_fn_error $? "Invalid option. Use --with-zlib/--without-zlib instead" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-bzip2 was given.
+if test "${with_bzip2+set}" = set; then :
+ withval=$with_bzip2;
+else
+ with_bzip2="no"
+fi
+
+
+
+# Check whether --with-mnttab was given.
+if test "${with_mnttab+set}" = set; then :
+ withval=$with_mnttab;
+fi
+
+ # Check whether --enable-mnttab was given.
+if test "${enable_mnttab+set}" = set; then :
+ enableval=$enable_mnttab; as_fn_error $? "Invalid option. Use --with-mnttab/--without-mnttab instead" "$LINENO" 5
+fi
+
+
+##
+# Project: mysql
+##
+
+
+# Check whether --with-mysql was given.
+if test "${with_mysql+set}" = set; then :
+ withval=$with_mysql;
+fi
+
+ # Check whether --enable-mysql was given.
+if test "${enable_mysql+set}" = set; then :
+ enableval=$enable_mysql; as_fn_error $? "Invalid option. Use --with-mysql/--without-mysql instead" "$LINENO" 5
+fi
+
+if test "x$with_mysql" = "xyes"; then
+
+$as_echo "#define NETSNMP_USE_MYSQL 1" >>confdefs.h
+
+fi
+
+# -*- autoconf -*-
+#
+# Prompt for various bits of user information
+#
+
+if test "x$ac_cv_user_prompt_NETSNMP_LOGFILE" = "x" -o "x$ac_cv_user_prompt_NETSNMP_SYS_LOC" = "x" -o "x$ac_cv_user_prompt_NETSNMP_SYS_CONTACT" = "x" -o "x$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" = "x"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to prompt for values" >&5
+$as_echo_n "checking whether to prompt for values... " >&6; }
+if ${ac_cv_have_warned+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+if test "x$defaults" = "xno"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}:
+
+ ************** Configuration Section **************
+
+ You are about to be prompted with a series of questions. Answer
+them carefully, as they determine how the SNMP agent and related
+applications are to function.
+
+ After the configure script finishes, you can browse the newly
+created net-snmp-config.h file for further - less important - parameters to
+modify. Be careful if you re-run configure though, since net-snmp-config.h
+will be overwritten.
+
+-Press return to continue-
+" >&5
+$as_echo "$as_me:
+
+ ************** Configuration Section **************
+
+ You are about to be prompted with a series of questions. Answer
+them carefully, as they determine how the SNMP agent and related
+applications are to function.
+
+ After the configure script finishes, you can browse the newly
+created net-snmp-config.h file for further - less important - parameters to
+modify. Be careful if you re-run configure though, since net-snmp-config.h
+will be overwritten.
+
+-Press return to continue-
+" >&6;}
+
+read tmpinput <&7
+ac_cv_have_warned="yes"
+else
+ ac_cv_have_warned="no"
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_warned" >&5
+$as_echo "$ac_cv_have_warned" >&6; }
+else
+ ac_cv_have_warned="yes"
+fi
+
+ME=`$WHOAMI`
+if test -f /etc/resolv.conf; then
+ LOC=`awk '/^domain/{loc=$NF}END{print loc}' /etc/resolv.conf`
+fi
+if test "x$LOC" = x; then
+ LOC="@no.where"
+fi
+
+
+MSG_CHECK="Default version of SNMP to use"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $MSG_CHECK" >&5
+$as_echo_n "checking $MSG_CHECK... " >&6; }
+if ${ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo "" >&6
+
+if test "x$defaults" = "xno"; then
+echo $ECHO_N "
+
+*** Default SNMP Version:
+
+ Starting with Net-SNMP 5.0, you can choose the default version of
+the SNMP protocol to use when no version is given explicitly on the
+command line, or via an 'snmp.conf' file. In the past this was set to
+SNMPv1, but you can use this to switch to SNMPv3 if desired. SNMPv3
+will provide a more secure management environment (and thus you're
+encouraged to switch to SNMPv3), but may break existing scripts that
+rely on the old behaviour. (Though such scripts will probably need to
+be changed to use the '-c' community flag anyway, as the SNMPv1
+command line usage has changed as well.).
+ At this prompt you can select \"1\", \"2\" (for SNMPv2c), or \"3\" as
+the default version for the command tools (snmpget, ...) to use. This
+can always be overridden at runtime using the -v flag to the tools, or
+by using the \"defVersion\" token in your snmp.conf file.
+ Providing the --with-default-snmp-version=\"x\" parameter to ./configure
+will avoid this prompt.
+
+Default version of SNMP to use (3): $ECHO_C"
+read tmpinput <&7
+if test "$tmpinput" = "" -a "3" != ""; then
+ tmpinput="3"
+fi
+eval NETSNMP_DEFAULT_SNMP_VERSION=\"$tmpinput\"
+else
+tmpinput="3"
+eval NETSNMP_DEFAULT_SNMP_VERSION=\"$tmpinput\"
+fi
+
+eval ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION=\$NETSNMP_DEFAULT_SNMP_VERSION
+echo $ECHO_N "setting $MSG_CHECK to... $ECHO_C" >&6
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" >&5
+$as_echo "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" >&6; }
+if test "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" != "none"; then
+ if test "xunquoted" = "xquoted" -o "xunquoted" = "xQUOTED"; then
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_SNMP_VERSION "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION"
+_ACEOF
+
+ else
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_SNMP_VERSION $ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION
+_ACEOF
+
+ fi
+fi
+
+
+# we tested this above before the prompt, but the prompt may give a new value.
+case "${ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION}" in
+ [123]) ;;
+ 2c) ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION=2 ;;
+ *)
+ as_fn_error $? "Illegal version number. Only 1, 2 (for SNMPv2c) and 3 are supported." "$LINENO" 5
+ ;;
+esac
+
+
+MSG_CHECK="System Contact Information"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $MSG_CHECK" >&5
+$as_echo_n "checking $MSG_CHECK... " >&6; }
+if ${ac_cv_user_prompt_NETSNMP_SYS_CONTACT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo "" >&6
+
+if test "x$defaults" = "xno"; then
+echo $ECHO_N "
+
+*** System Contact Information:
+
+ Describes who should be contacted about the host the agent is
+running on. This information is available in the MIB-II tree. This
+can also be over-ridden using the \"syscontact\" syntax in the agent's
+configuration files.
+ Providing the --with-sys-contact=\"contact\" parameter to ./configure
+will avoid this prompt.
+
+System Contact Information ($ME@$LOC): $ECHO_C"
+read tmpinput <&7
+if test "$tmpinput" = "" -a "$ME@$LOC" != ""; then
+ tmpinput="$ME@$LOC"
+fi
+eval NETSNMP_SYS_CONTACT=\"$tmpinput\"
+else
+tmpinput="$ME@$LOC"
+eval NETSNMP_SYS_CONTACT=\"$tmpinput\"
+fi
+
+eval ac_cv_user_prompt_NETSNMP_SYS_CONTACT=\$NETSNMP_SYS_CONTACT
+echo $ECHO_N "setting $MSG_CHECK to... $ECHO_C" >&6
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_user_prompt_NETSNMP_SYS_CONTACT" >&5
+$as_echo "$ac_cv_user_prompt_NETSNMP_SYS_CONTACT" >&6; }
+if test "$ac_cv_user_prompt_NETSNMP_SYS_CONTACT" != "none"; then
+ if test "xquoted" = "xquoted" -o "xquoted" = "xQUOTED"; then
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_SYS_CONTACT "$ac_cv_user_prompt_NETSNMP_SYS_CONTACT"
+_ACEOF
+
+ else
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_SYS_CONTACT $ac_cv_user_prompt_NETSNMP_SYS_CONTACT
+_ACEOF
+
+ fi
+fi
+
+
+
+MSG_CHECK="System Location"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $MSG_CHECK" >&5
+$as_echo_n "checking $MSG_CHECK... " >&6; }
+if ${ac_cv_user_prompt_NETSNMP_SYS_LOC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo "" >&6
+
+if test "x$defaults" = "xno"; then
+echo $ECHO_N "
+
+*** System Location:
+
+ Describes the location of the system. This information is
+available in the MIB-II tree. this can also be over-ridden using the
+\"syslocation\" syntax in the agent's configuration files.
+ Providing the --with-sys-location=\"location\" parameter to ./configure
+will avoid this prompt.
+
+System Location (Unknown): $ECHO_C"
+read tmpinput <&7
+if test "$tmpinput" = "" -a "Unknown" != ""; then
+ tmpinput="Unknown"
+fi
+eval NETSNMP_SYS_LOC=\"$tmpinput\"
+else
+tmpinput="Unknown"
+eval NETSNMP_SYS_LOC=\"$tmpinput\"
+fi
+
+eval ac_cv_user_prompt_NETSNMP_SYS_LOC=\$NETSNMP_SYS_LOC
+echo $ECHO_N "setting $MSG_CHECK to... $ECHO_C" >&6
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_user_prompt_NETSNMP_SYS_LOC" >&5
+$as_echo "$ac_cv_user_prompt_NETSNMP_SYS_LOC" >&6; }
+if test "$ac_cv_user_prompt_NETSNMP_SYS_LOC" != "none"; then
+ if test "xquoted" = "xquoted" -o "xquoted" = "xQUOTED"; then
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_SYS_LOC "$ac_cv_user_prompt_NETSNMP_SYS_LOC"
+_ACEOF
+
+ else
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_SYS_LOC $ac_cv_user_prompt_NETSNMP_SYS_LOC
+_ACEOF
+
+ fi
+fi
+
+
+if test -d /var/log; then
+ defaultlog="/var/log/snmpd.log"
+else
+ defaultlog="/usr/adm/snmpd.log"
+fi
+
+
+MSG_CHECK="Location to write logfile"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $MSG_CHECK" >&5
+$as_echo_n "checking $MSG_CHECK... " >&6; }
+if ${ac_cv_user_prompt_NETSNMP_LOGFILE+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo "" >&6
+
+if test "x$defaults" = "xno"; then
+echo $ECHO_N "
+
+*** Logfile location:
+
+ Enter the default location for the snmpd agent to dump
+information & errors to. If not defined (enter the keyword \"none\"
+at the prompt below) the agent will use stdout and stderr instead.
+(Note: This value can be over-ridden using command line options.)
+ Providing the --with-logfile=\"path\" parameter to ./configure
+will avoid this prompt.
+
+Location to write logfile ($defaultlog): $ECHO_C"
+read tmpinput <&7
+if test "$tmpinput" = "" -a "$defaultlog" != ""; then
+ tmpinput="$defaultlog"
+fi
+eval NETSNMP_LOGFILE=\"$tmpinput\"
+else
+tmpinput="$defaultlog"
+eval NETSNMP_LOGFILE=\"$tmpinput\"
+fi
+
+eval ac_cv_user_prompt_NETSNMP_LOGFILE=\$NETSNMP_LOGFILE
+echo $ECHO_N "setting $MSG_CHECK to... $ECHO_C" >&6
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_user_prompt_NETSNMP_LOGFILE" >&5
+$as_echo "$ac_cv_user_prompt_NETSNMP_LOGFILE" >&6; }
+if test "$ac_cv_user_prompt_NETSNMP_LOGFILE" != "none"; then
+ if test "xquoted" = "xquoted" -o "xquoted" = "xQUOTED"; then
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_LOGFILE "$ac_cv_user_prompt_NETSNMP_LOGFILE"
+_ACEOF
+
+ else
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_LOGFILE $ac_cv_user_prompt_NETSNMP_LOGFILE
+_ACEOF
+
+ fi
+fi
+
+
+if test -d /var; then
+ defaultstore="/var/net-snmp"
+ ucddefaultstore="/var/ucd-snmp"
+else
+ defaultstore="/etc/net-snmp"
+ ucddefaultstore="/etc/ucd-snmp"
+fi
+
+
+MSG_CHECK="Location to write persistent information"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $MSG_CHECK" >&5
+$as_echo_n "checking $MSG_CHECK... " >&6; }
+if ${ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo "" >&6
+
+if test "x$defaults" = "xno"; then
+echo $ECHO_N "
+
+*** snmpd persistent storage location:
+
+ Enter a directory for the SNMP library to store persistent
+data in the form of a configuration file. This default location is
+different than the old default location (which was for ucd-snmp). If
+you stay with the new path, I'll ask you in a second if you wish to
+copy your files over to the new location (once only). If you pick
+some other path than the default, you'll have to copy them yourself.
+There is nothing wrong with picking the old path ($ucddefaultstore) if
+you'd rather.
+ Providing the --with-persistent-directory=\"path\" parameter to
+./configure will avoid this prompt.
+
+Location to write persistent information ($defaultstore): $ECHO_C"
+read tmpinput <&7
+if test "$tmpinput" = "" -a "$defaultstore" != ""; then
+ tmpinput="$defaultstore"
+fi
+eval NETSNMP_PERSISTENT_DIRECTORY=\"$tmpinput\"
+else
+tmpinput="$defaultstore"
+eval NETSNMP_PERSISTENT_DIRECTORY=\"$tmpinput\"
+fi
+
+eval ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY=\$NETSNMP_PERSISTENT_DIRECTORY
+echo $ECHO_N "setting $MSG_CHECK to... $ECHO_C" >&6
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY" >&5
+$as_echo "$ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY" >&6; }
+if test "$ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY" != "none"; then
+ if test "xquoted" = "xquoted" -o "xquoted" = "xQUOTED"; then
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_PERSISTENT_DIRECTORY "$ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY"
+_ACEOF
+
+ else
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_PERSISTENT_DIRECTORY $ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY
+_ACEOF
+
+ fi
+fi
+
+
+PERSISTENT_DIRECTORY=$ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY
+
+UCDPERSISTENT_DIRECTORY=$ucddefaultstore
+
+
+if test $PERSISTENT_DIRECTORY = "$defaultstore" -a -d "$ucddefaultstore" -a ! -d "$defaultstore" ; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking If we should copy the old persistent directory" >&5
+$as_echo_n "checking If we should copy the old persistent directory... " >&6; }
+if ${ac_cv_user_prompt_COPY_PERSISTENT_FILES+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+if test "x$defaults" = "xno"; then
+echo $ECHO_N "
+
+*** Copying old ucd-snmp persistent files to net-snmp persistent directory:
+
+ Would you like to copy the older ucd-snmp persistent files
+into your new net-snmp persistent file path? This will functionally
+save all your ucd-snmp data and let it be used within the net-snmp
+tools. This will only be done once when you run make install. If you
+wish to do this, enter "yes" at the prompt.
+ Providing the --with-copy-persistent-files=\"no\" (or \"yes\")
+parameters to ./configure will avoid this prompt.
+
+Copy ucd-snmp data into the net-snmp data directory ("yes"): $ECHO_C"
+read tmpinput <&7
+if test "$tmpinput" = "" -a ""yes"" != ""; then
+ tmpinput=""yes""
+fi
+eval ac_cv_user_prompt_COPY_PERSISTENT_FILES=\"$tmpinput\"
+else
+tmpinput=""yes""
+eval ac_cv_user_prompt_COPY_PERSISTENT_FILES=\"$tmpinput\"
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_user_prompt_COPY_PERSISTENT_FILES" >&5
+$as_echo "$ac_cv_user_prompt_COPY_PERSISTENT_FILES" >&6; }
+else
+ac_cv_user_prompt_COPY_PERSISTENT_FILES="no"
+fi
+COPY_PERSISTENT_FILES="$ac_cv_user_prompt_COPY_PERSISTENT_FILES"
+
+
+# -*- autoconf -*-
+#########################################
+##
+# Checks for programs
+##
+#########################################
+
+##
+# Shell checks:
+##
+
+# Check for 'sh' overflow (HP-UX)
+# (taken from Perl's configure script)
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if I need to feed myself to ksh" >&5
+$as_echo_n "checking if I need to feed myself to ksh... " >&6; }
+if test -f /hp-ux -a -f /bin/ksh; then
+ if (PATH=.; alias -x) >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ if test "x$1" = "x"; then
+ exec /bin/ksh $0
+ else
+ exec /bin/ksh $0 "$@"
+ fi
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+##
+# Standard and path program checks:
+##
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+
+for ac_prog in file
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_FILE+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$FILE"; then
+ ac_cv_prog_FILE="$FILE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_FILE="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+FILE=$ac_cv_prog_FILE
+if test -n "$FILE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FILE" >&5
+$as_echo "$FILE" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$FILE" && break
+done
+
+if test x$ac_cv_prog_FILE = x; then
+ # The file program is not included in the default Cygwin setup, although
+ # this program is essential for libtool to work properly. It is nontrivial
+ # to deduce from the message printed by libtool that the 'file' tool is
+ # missing and libtool does not abort when the file program is not found. So
+ # stop now if the file program has not been found.
+ as_fn_error 1 "file program not found although it is needed by libtool." "$LINENO" 5
+fi
+
+for ac_prog in find
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_FIND+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$FIND"; then
+ ac_cv_prog_FIND="$FIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_FIND="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+FIND=$ac_cv_prog_FIND
+if test -n "$FIND"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIND" >&5
+$as_echo "$FIND" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$FIND" && break
+done
+
+for ac_prog in whoami logname
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_WHOAMI+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$WHOAMI"; then
+ ac_cv_prog_WHOAMI="$WHOAMI" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_WHOAMI="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+WHOAMI=$ac_cv_prog_WHOAMI
+if test -n "$WHOAMI"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WHOAMI" >&5
+$as_echo "$WHOAMI" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$WHOAMI" && break
+done
+test -n "$WHOAMI" || WHOAMI="whoami"
+
+
+# Extract the first word of "autoconf", so it can be a program name with args.
+set dummy autoconf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_AUTOCONF+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $AUTOCONF in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_AUTOCONF="$AUTOCONF" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_AUTOCONF="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+AUTOCONF=$ac_cv_path_AUTOCONF
+if test -n "$AUTOCONF"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AUTOCONF" >&5
+$as_echo "$AUTOCONF" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "autoheader", so it can be a program name with args.
+set dummy autoheader; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_AUTOHEADER+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $AUTOHEADER in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_AUTOHEADER="$AUTOHEADER" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_AUTOHEADER="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+AUTOHEADER=$ac_cv_path_AUTOHEADER
+if test -n "$AUTOHEADER"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AUTOHEADER" >&5
+$as_echo "$AUTOHEADER" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PERLPROG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PERLPROG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PERLPROG="$PERLPROG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PERLPROG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PERLPROG=$ac_cv_path_PERLPROG
+if test -n "$PERLPROG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERLPROG" >&5
+$as_echo "$PERLPROG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "ps", so it can be a program name with args.
+set dummy ps; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PSPROG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PSPROG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PSPROG="$PSPROG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PSPROG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PSPROG=$ac_cv_path_PSPROG
+if test -n "$PSPROG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PSPROG" >&5
+$as_echo "$PSPROG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PYTHONPROG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PYTHONPROG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PYTHONPROG="$PYTHONPROG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PYTHONPROG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PYTHONPROG=$ac_cv_path_PYTHONPROG
+if test -n "$PYTHONPROG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONPROG" >&5
+$as_echo "$PYTHONPROG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Extract the first word of "uname", so it can be a program name with args.
+set dummy uname; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_UNAMEPROG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $UNAMEPROG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_UNAMEPROG="$UNAMEPROG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_UNAMEPROG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+UNAMEPROG=$ac_cv_path_UNAMEPROG
+if test -n "$UNAMEPROG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNAMEPROG" >&5
+$as_echo "$UNAMEPROG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define UNAMEPROG "$UNAMEPROG"
+_ACEOF
+
+
+if test "x$ac_cv_prog_AUTOCONF" = "x"; then
+ AUTOCONF=":"
+
+fi
+if test "x$ac_cv_prog_AUTOHEADER" = "x"; then
+ AUTOHEADER=":"
+
+fi
+
+MAKE=${MAKE-"make"}
+$MAKE -v -f /dev/null 2>/dev/null | $GREP GNU >/dev/null
+have_gnu_make=$?
+
+
+##
+# The Perl function system() is used for running the Net-SNMP regression
+# tests. Find out whether that function invokes a POSIX shell, which is
+# necessary in order to run the regression tests. When using Windows + MSYS
+# + ActiveState Perl, Perl's system() function does invoke Windows' cmd.exe
+# which is not a POSIX shell.
+##
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Perl function system() invokes a POSIX shell" >&5
+$as_echo_n "checking whether the Perl function system() invokes a POSIX shell... " >&6; }
+if test "x$PERLPROG" != 'x' && test -x "$PERLPROG" && test "x`$PERLPROG -e 'system('"'"'echo $OSTYPE'"'"');'`" != 'x$OSTYPE'; then
+ PERL_SYSTEM_INVOKES_POSIX_SHELL=yes
+else
+ PERL_SYSTEM_INVOKES_POSIX_SHELL=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+##
+# Compilation-related program checks:
+##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+LINKCC=${LINKCC-"$CC"}
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
+ MINIX=yes
+else
+ MINIX=
+fi
+
+
+ if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define __EXTENSIONS__ 1
+ $ac_includes_default
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_safe_to_define___extensions__=yes
+else
+ ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+
+# libtool stuff for shared/static libraries.
+#
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4'
+macro_revision='1.3293'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case "$ECHO" in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AS"; then
+ ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AS="${ac_tool_prefix}as"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+$as_echo "$AS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+ ac_ct_AS=$AS
+ # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AS"; then
+ ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AS="as"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AS" = x; then
+ AS="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AS=$ac_ct_AS
+ fi
+else
+ AS="$ac_cv_prog_AS"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+ ;;
+esac
+
+test -z "$AS" && AS=as
+
+
+
+
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+ enable_dlopen=no
+
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ lt_prog_compiler_pic='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+
+##
+# Build environment:
+##
+
+# developer build
+# (enabled by default when building from SVN checkout)
+#
+if test "x$developer" != "xno" -a -f $srcdir/remove-files; then
+ developer="yes"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for developer gcc flags" >&5
+$as_echo_n "checking for developer gcc flags... " >&6; }
+if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
+
+ # WWWXXX - strict type checking
+ #
+ DEVFLAGS="-Wall -Wstrict-prototypes -Wwrite-strings -Wcast-qual"
+else
+ DEVFLAGS=""
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVFLAGS" >&5
+$as_echo "$DEVFLAGS" >&6; }
+
+
+
+# building outside source directory
+#
+# a) ensure build include paths are before source
+# b) ensure GNU make uses 'vpath' instead of 'VPATH'
+#
+NON_GNU_VPATH="VPATH ="
+GNU_vpath="#vpath"
+
+# define include paths relative to top_srcdir
+# tweak includes if we're building outside of the source dir
+#
+if test "x$srcdir" = "x."; then
+ TOP_INCLUDES=SRC_TOP_INCLUDES
+ SNMPLIB_INCLUDES=SRC_SNMPLIB_INCLUDES
+ AGENT_INCLUDES=SRC_AGENT_INCLUDES
+ HELPER_INCLUDES=SRC_HELPER_INCLUDES
+ MIBGROUP_INCLUDES=SRC_MIBGROUP_INCLUDES
+else
+ TOP_INCLUDES=BLD_TOP_INCLUDES
+ SNMPLIB_INCLUDES=BLD_SNMPLIB_INCLUDES
+ AGENT_INCLUDES=BLD_AGENT_INCLUDES
+ HELPER_INCLUDES=BLD_HELPER_INCLUDES
+ MIBGROUP_INCLUDES=BLD_MIBGROUP_INCLUDES
+ if test $have_gnu_make -eq 0 ; then
+ NON_GNU_VPATH="#VPATH ="
+ GNU_vpath="vpath"
+ fi
+fi
+
+
+
+
+
+
+
+
+
+##
+# System-related compilation checks:
+##
+
+# What system are we building for
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if ${ac_cv_target+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$target_alias" = x; then
+ ac_cv_target=$ac_cv_host
+else
+ ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'`
+
+
+ cat >> configure-summary << EOF
+ Building for: $PARTIALTARGETOS
+EOF
+
+
+
+#
+# Whether or not Cygwin's ld recognizes the flag -no-undefined.
+#
+
+case x$target_os in
+xcygwin*)
+ saved_LDFLAGS=$LDFLAGS
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker supports -no-undefined" >&5
+$as_echo_n "checking whether the linker supports -no-undefined... " >&6; }
+ LDFLAGS="$saved_LDFLAGS -Wl,-no-undefined"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }; LD_NO_UNDEFINED=-no-undefined
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ LDFLAGS="$saved_LDFLAGS"
+ ;;
+esac
+
+
+
+
+#
+# Socket library: either 'default' (non-MinGW) or 'winsock2' (MinGW).
+#
+case x$target_os in
+ xmingw*)
+ with_socklib=winsock2
+ if test "x$enable_ipv6" = "xyes"; then
+ CFLAGS="-D_WIN32_WINNT=0x0501 $CFLAGS"
+ fi
+ ;;
+ *)
+ with_socklib=default;;
+esac
+
+
+# Check system define behaviour
+# Does "-Ux -Dx=x" work as expected?
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to un-define target system token (before redefining)" >&5
+$as_echo_n "checking whether to un-define target system token (before redefining)... " >&6; }
+OLD_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+[
+#ifdef $PARTIALTARGETOS
+yes
+#endif
+ ]
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ PARTIALTARGETFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ PARTIALTARGETFLAGS="-D$PARTIALTARGETOS=$PARTIALTARGETOS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f conftest*
+
+CFLAGS="$CFLAGS $PARTIALTARGETFLAGS"
+CPPFLAGS="$OLD_CPPFLAGS"
+
+
+# Determine appropriate <net-snmp/system/{os}.h> include
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for system include file" >&5
+$as_echo_n "checking for system include file... " >&6; }
+
+filebase=$target_os
+# ignore binary format indication
+filebase=`echo $filebase | $SED 's/elf//'`
+filebase=`echo $filebase | $SED 's/aout//'`
+filebase=`echo $filebase | $SED 's/ecoff//'`
+filebase=`echo $filebase | $SED 's/coff//'`
+while test "x$filebase" != "x$last" -a ! -f $srcdir/include/net-snmp/system/$filebase.h
+do
+ last=$filebase
+ filebase=`echo $filebase | $SED 's/[-._][^-._]*$//'`
+ if test "x$filebase" = "x$last"; then
+ filebase=`echo $filebase | $SED 's/[0-9]*$//'`
+ fi
+done
+
+if test "x$filebase" = "x$last"; then
+ filebase="generic"
+fi
+ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE="net-snmp/system/$filebase.h"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE" >&5
+$as_echo "$ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_SYSTEM_INCLUDE_FILE "$ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE"
+_ACEOF
+
+
+
+# Determine appropriate <net-snmp/machine/{cpu}.h> include
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for machine-type include file" >&5
+$as_echo_n "checking for machine-type include file... " >&6; }
+
+filebase=$target_cpu
+while test "x$filebase" != "x$last" -a ! -f $srcdir/include/net-snmp/machine/$filebase.h
+do
+ last=$filebase
+ filebase=`echo $filebase | $SED 's/[-._][^-._]*$//'`
+done
+
+if test "x$filebase" = "x$last"; then
+ filebase="generic"
+fi
+ac_cv_NETSNMP_MACHINE_INCLUDE_FILE="net-snmp/machine/$filebase.h"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_NETSNMP_MACHINE_INCLUDE_FILE" >&5
+$as_echo "$ac_cv_NETSNMP_MACHINE_INCLUDE_FILE" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_MACHINE_INCLUDE_FILE "$ac_cv_NETSNMP_MACHINE_INCLUDE_FILE"
+_ACEOF
+
+
+
+##
+# Platform-specific compilation checks:
+##
+
+# Preprocessor checks:
+#
+
+# More sensible system identifier (MinGW)
+#
+if test "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ CFLAGS="$CFLAGS -Dmingw32"
+fi
+
+# Handle .in file extension (GCC)
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for additional cpp flags" >&5
+$as_echo_n "checking for additional cpp flags... " >&6; }
+if test "x$GCC" = "xyes" -a "x$CPP" = "x$CC -E"; then
+ EXTRACPPFLAGS="-x c"
+else
+ EXTRACPPFLAGS=""
+fi
+
+# Solaris extra CPP flags (Solaris)
+#
+if test "x$GCC" != "xyes"; then
+ case $target_os in
+ solaris*) EXTRACPPFLAGS="$EXTRACPPFLAGS -Xs" ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXTRACPPFLAGS" >&5
+$as_echo "$EXTRACPPFLAGS" >&6; }
+
+
+# Compiler checks:
+#
+
+# Extract the first word of "$CC", so it can be a program name with args.
+set dummy $CC; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CCPATH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $CCPATH in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CCPATH="$CCPATH" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_CCPATH="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+CCPATH=$ac_cv_path_CCPATH
+if test -n "$CCPATH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCPATH" >&5
+$as_echo "$CCPATH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+case $target_os in
+ bsdi*)
+ # Check for bundled compiler (BSDi)
+ #
+ if test "x$CCPATH" = "x/usr/ucb/cc" -o "x$CCPATH" = "x/usr/bin/cc"; then
+ as_fn_error $? "
+
+*** The BSDI /usr/ucb/cc compiler does not work with this package.
+*** Please run configure with --with-cc=gcc
+" "$LINENO" 5
+ fi
+ ;;
+ solaris*)
+ # Check for bundled compiler (Solaris)
+ #
+ if test "x$CCPATH" = "x/usr/ucb/cc"; then
+ as_fn_error $? "
+
+*** The solaris /usr/ucb/cc compiler does not work with this package.
+*** Please put a different compiler in your path first or run
+*** configure with --with-cc=XX, where XX is the compiler you want to use.
+" "$LINENO" 5
+ fi
+ ;;
+esac
+
+
+# Compiler flags:
+#
+
+# The Net-SNMP source code is not strict-aliasing safe, so add
+# -fno-strict-aliasing to $CFLAGS if the compiler supports it.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-strict-aliasing" >&5
+$as_echo_n "checking whether the compiler supports -fno-strict-aliasing... " >&6; }
+netsnmp_save_CFLAGS="$CFLAGS"
+CFLAGS="-fno-strict-aliasing $CFLAGS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$netsnmp_save_CFLAGS"
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
+# Linker checks:
+#
+
+case $target_os in
+ aix4.2*|aix4.3*|aix5*|aix6*|aix7*)
+ # Runtime linking flags (AIX)
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking what linker flags to add to enable runtime linking on AIX" >&5
+$as_echo_n "checking what linker flags to add to enable runtime linking on AIX... " >&6; }
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ netsnmp_aix_runtimelinking_flags_ok=yes
+ break
+ fi
+ done
+ if test "X$netsnmp_aix_runtimelinking_flags_ok" != "Xyes"; then
+ if test "x$GCC" = "xyes"; then
+ netsnmp_aix_ldflags="-Wl,-brtl"
+ else
+ netsnmp_aix_ldflags="-brtl"
+ fi
+ LDFLAGS="$netsnmp_aix_ldflags $LDFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_aix_ldflags" >&5
+$as_echo "$netsnmp_aix_ldflags" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+ fi
+ ;;
+
+ darwin8*|darwin9*|darwin10*)
+ # Flat Namespace linking (Mac OS/X)
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether darwin ld might need -flat_namespace" >&5
+$as_echo_n "checking whether darwin ld might need -flat_namespace... " >&6; }
+ if test -z "$MACOSX_DEPLOYMENT_TARGET"; then
+ LDFLAGS="-flat_namespace $LDFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+
+ *)
+ ;;
+esac
+
+
+# dpkg package (swintst_apt)
+# used in agent only
+#
+# Extract the first word of "dpkg-query", so it can be a program name with args.
+set dummy dpkg-query; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_DPKG_QUERY_PATH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $DPKG_QUERY_PATH in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_DPKG_QUERY_PATH="$DPKG_QUERY_PATH" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_DPKG_QUERY_PATH="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+DPKG_QUERY_PATH=$ac_cv_path_DPKG_QUERY_PATH
+if test -n "$DPKG_QUERY_PATH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DPKG_QUERY_PATH" >&5
+$as_echo "$DPKG_QUERY_PATH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x$DPKG_QUERY_PATH != x; then
+
+$as_echo "#define HAVE_DPKG_QUERY 1" >>confdefs.h
+
+fi
+
+
+##
+# Non-program/compilation checks:
+##
+
+# Substitute version number.
+#
+VERSION=$PACKAGE_VERSION
+
+
+ cat >> configure-summary << EOF
+ Net-SNMP Version: $PACKAGE_VERSION
+EOF
+
+
+
+# -*- autoconf -*-
+#########################################
+##
+# Configure paths
+##
+#########################################
+
+##
+# Prefix paths:
+##
+
+# Main prefix
+#
+if test "x$prefix" = "xNONE"; then
+ prefix=/usr/local
+fi
+
+# Prefix must be an absolute path
+# i.e. begin with "/" (Unix)
+# or "[A-Z]:" (Windows)
+#
+firstchar=`echo $prefix | $SED 's/\(.\).*/\1/'`
+if test "x$firstchar" != "x/" ; then
+ secondchar=`echo $prefix | $SED 's/.\(.\).*/\1/'`
+ if test "x$secondchar" != "x:" ; then
+ prefix=`pwd`/$prefix
+ echo "adjusting prefix to $prefix"
+ fi
+fi
+
+
+# Exec prefix
+#
+# Prefix must be an absolute path
+# i.e. begin with "/" (Unix)
+# or "[A-Z]:" (Windows)
+#
+if test "x$exec_prefix" = "xNONE"; then
+ exec_prefix='${prefix}'
+else
+ firstchar=`echo $exec_prefix | $SED 's/\(.\).*/\1/'`
+ if test "x$firstchar" != "x/" ; then
+ secondchar=`echo $exec_prefix | $SED 's/.\(.\).*/\1/'`
+ if test "x$secondchar" != "x:" ; then
+ exec_prefix=`pwd`/$exec_prefix
+ echo "adjusting exec_prefix to $exec_prefix"
+ fi
+ fi
+fi
+
+
+##
+# Environmental variables:
+##
+
+# SNMPLIBPATH
+#
+SNMPLIBPATH=""
+tmpset="$libdir/snmp"
+while test "x$tmpset" != "x$SNMPLIBPATH"; do
+ SNMPLIBPATH="$tmpset"
+ eval tmpset="$tmpset"
+done
+cat >>confdefs.h <<_ACEOF
+#define SNMPLIBPATH "$SNMPLIBPATH"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SNMPDLMODPATH "$SNMPLIBPATH/dlmod"
+_ACEOF
+
+
+# SNMPSHAREPATH
+#
+SNMPSHAREPATH=""
+tmpset="$datadir/snmp"
+while test "x$tmpset" != "x$SNMPSHAREPATH"; do
+ SNMPSHAREPATH="$tmpset"
+ eval tmpset="$tmpset"
+done
+cat >>confdefs.h <<_ACEOF
+#define SNMPSHAREPATH "$SNMPSHAREPATH"
+_ACEOF
+
+
+
+# MIBDIRS (default)
+#
+if test "x$NETSNMP_DEFAULT_MIBDIRS" = "x"; then
+ NETSNMP_DEFAULT_MIBDIRS="\$HOME/.snmp/mibs:$SNMPSHAREPATH/mibs"
+ if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" -o "x$PARTIALTARGETOS" = "xcygwin"; then
+ #
+ # USe Windows-style path separator
+ NETSNMP_DEFAULT_MIBDIRS=`echo "$NETSNMP_DEFAULT_MIBDIRS" | $SED 's/:/;/g'`
+ fi
+ cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_MIBDIRS "$NETSNMP_DEFAULT_MIBDIRS"
+_ACEOF
+
+fi
+
+
+# SNMPCONFPATH
+#
+SNMPCONFPATH=""
+tmpset="$sysconfdir/snmp"
+while test "x$tmpset" != "x$SNMPCONFPATH"; do
+ SNMPCONFPATH="$tmpset"
+ eval tmpset="$tmpset"
+done
+cat >>confdefs.h <<_ACEOF
+#define SNMPCONFPATH "$SNMPCONFPATH"
+_ACEOF
+
+
+
+#########################################
+##
+# Checks for header files.
+##
+#########################################
+
+##
+# Standard checks:
+##
+# Core:
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+ # <stdlib.h>, <stdarg.h>, <string.h> & <float.h>
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if eval \${$as_ac_Header+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$as_ac_Header=yes"
+else
+ eval "$as_ac_Header=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_ac_Header
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dir; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+ # <dirent.h>, <sys/ndir.h>, <sys/dir.h> & <ndir.h>
+# Apps:
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
+$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
+if ${ac_cv_header_sys_wait_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main ()
+{
+ int s;
+ wait (&s);
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_sys_wait_h=yes
+else
+ ac_cv_header_sys_wait_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5
+$as_echo "$ac_cv_header_sys_wait_h" >&6; }
+if test $ac_cv_header_sys_wait_h = yes; then
+
+$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+ # <sys/wait.h>
+
+# allow for quick module/library/etc processing checks
+if test "x$NETSNMP_QUICK_CHECK" = "x" ; then
+
+##
+# Stand-alone headers:
+##
+# Core:
+for ac_header in getopt.h pthread.h regex.h string.h syslog.h unistd.h stdint.h inttypes.h sys/param.h sys/select.h sys/socket.h sys/time.h sys/timeb.h sys/un.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Library and Agent:
+for ac_header in nlist.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "nlist.h" "ac_cv_header_nlist_h" "
+$ac_includes_default
+
+#ifndef LIBBSD_DISABLE_DEPRECATED
+#define LIBBSD_DISABLE_DEPRECATED 1
+#endif
+
+"
+if test "x$ac_cv_header_nlist_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NLIST_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# Library:
+for ac_header in fcntl.h io.h kstat.h limits.h locale.h sys/file.h sys/ioctl.h sys/sockio.h sys/stat.h sys/systemcfg.h sys/systeminfo.h sys/times.h sys/uio.h sys/utsname.h netipx/ipx.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Agent:
+for ac_header in dlfcn.h err.h fcntl.h fstab.h grp.h io.h ioctls.h kstat.h kvm.h limits.h mntent.h mtab.h pkglocs.h pwd.h utmpx.h utsname.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/diskio.h sys/dkio.h sys/file.h sys/filio.h sys/fixpoint.h sys/fs.h sys/ioctl.h sys/loadavg.h sys/mntent.h sys/mnttab.h sys/pool.h sys/protosw.h sys/pstat.h sys/sockio.h sys/stat.h sys/statfs.h sys/statvfs.h sys/stream.h sys/sysget.h sys/sysmp.h sys/tcpipstats.h sys/utsname.h sys/vfs.h sys/vm.h sys/vmmac.h sys/vmmeter.h sys/vmparam.h sys/vmsystm.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in asm/page.h asm/types.h inet/mib2.h linux/hdreg.h linux/tasks.h machine/param.h netinet/tcp_fsm.h ufs/fs.h uvm/uvm_extern.h uvm/uvm_param.h vm/vm.h vm/vm_extern.h vm/vm_param.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Apps:
+for ac_header in fcntl.h grp.h pwd.h sys/cdefs.h sys/ioctl.h sys/socket.h sys/sockio.h sys/time.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Not-Used:
+for ac_header in search.h sgtty.h xti.h sys/dmap.h sys/poll.h sys/timeout.h machine/pte.h pci/pci.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+# Valgrind
+for ac_header in valgrind/valgrind.h valgrind/memcheck.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+# OpenSSL
+for ac_header in openssl/aes.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+ # (Core)
+for ac_header in openssl/dh.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+ # (Apps)
+# Not-Used:
+for ac_header in openssl/des.h openssl/hmac.h openssl/evp.h security/cryptoki.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# RPM subdirectory path (Agent)
+if test "x$with_rpm" != "xno"; then
+ for ac_header in rpm/rpmts.h rpm/rpmfileutil.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <rpm/rpmlib.h>
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+
+##
+# Pre-requisite on other headers:
+##
+
+# requiring <sys/param.h> (MAXPATHLEN) (OpenBSD 3.4)
+# Agent:
+#
+for ac_header in sys/swap.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/swap.h" "ac_cv_header_sys_swap_h" "$ac_includes_default
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+"
+if test "x$ac_cv_header_sys_swap_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SWAP_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# requiring <sys/param.h> (FreeBSD)
+#
+# Core: (? Tested above? )
+for ac_header in stdlib.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+#
+# Library:
+for ac_header in malloc.h net/if_dl.h sys/sysctl.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+#
+# Agent:
+for ac_header in malloc.h osreldate.h machine/types.h net/if_dl.h net/if_types.h sys/dkstat.h sys/conf.h sys/mbuf.h sys/mount.h sys/proc.h sys/queue.h sys/sysctl.h sys/user.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# requiring <sys/sema.h> (IRIX 6.5)
+# Agent:
+#
+for ac_header in sys/sema.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/sema.h" "ac_cv_header_sys_sema_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_sema_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SEMA_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sys/hashing.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/hashing.h" "ac_cv_header_sys_hashing_h" "$ac_includes_default
+
+#if HAVE_SYS_SEMA_H
+#include <sys/sema.h>
+#endif
+
+"
+if test "x$ac_cv_header_sys_hashing_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_HASHING_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# requiring <sys/socket.h> (Solaris 9)
+# Agent:
+#
+for ac_header in sys/socketvar.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/socketvar.h" "ac_cv_header_sys_socketvar_h" "$ac_includes_default
+
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+"
+if test "x$ac_cv_header_sys_socketvar_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SOCKETVAR_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# requiring _KMEMUSER and <sys/types.h> (BSDi3/IRIX)
+# Agent:
+#
+for ac_header in sys/vnode.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/vnode.h" "ac_cv_header_sys_vnode_h" "
+#define _KMEMUSER 1
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+"
+if test "x$ac_cv_header_sys_vnode_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_VNODE_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# requiring <machine/types.h> (NetBSD)
+# Agent:
+#
+for ac_header in sys/disklabel.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/disklabel.h" "ac_cv_header_sys_disklabel_h" "
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_MACHINE_TYPES_H
+#include <machine/types.h>
+#endif
+
+"
+if test "x$ac_cv_header_sys_disklabel_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_DISKLABEL_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# QNX
+for ac_header in nbutil.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "nbutil.h" "ac_cv_header_nbutil_h" "$ac_includes_default"
+if test "x$ac_cv_header_nbutil_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NBUTIL_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# UFS headers
+# Agent:
+#
+for ac_header in ufs/ufs/dinode.h ufs/ufs/quota.h ufs/ufs/inode.h ufs/ffs/fs.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_UFS_UFS_DINODE_H
+#include <ufs/ufs/dinode.h>
+#endif
+#if HAVE_UFS_UFS_QUOTA_H
+#include <ufs/ufs/quota.h>
+#endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# requiring <vm/vm.h> (BSDi2)
+# Agent:
+#
+for ac_header in vm/swap_pager.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "vm/swap_pager.h" "ac_cv_header_vm_swap_pager_h" "
+#if HAVE_VM_VM_H
+#include <vm/vm.h>
+#endif
+
+"
+if test "x$ac_cv_header_vm_swap_pager_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VM_SWAP_PAGER_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# netlink/rtnetlink (Linux)
+# Agent:
+#
+for ac_header in linux/netlink.h linux/rtnetlink.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+#if HAVE_ASM_TYPES_H
+#include <asm/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_LINUX_NETLINK_H
+#include <linux/netlink.h>
+#endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+# Network headers
+# Core or Library/Agent/Apps:
+#
+for ac_header in arpa/inet.h net/if.h netinet/in.h netdb.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_TIMEOUT_H
+#include <sys/timeout.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_SOCKETVAR_H
+#include <sys/socketvar.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_IP_ICMP_H
+#include <netinet/ip_icmp.h>
+#endif
+#if HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_TCP_TIMER_H
+#include <netinet/tcp_timer.h>
+#endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+#
+# Agent:
+for ac_header in net/if_arp.h net/if_mib.h net/if_var.h netinet/if_ether.h netinet/in_systm.h netinet/in_var.h netinet/ip.h netinet/ip_icmp.h netinet/icmp_var.h netinet/ip_var.h netinet/tcp.h netinet/tcp_timer.h netinet/tcp_var.h netinet/tcpip.h netinet/udp.h netinet/udp_var.h net/route.h netinet/icmp6.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_TIMEOUT_H
+#include <sys/timeout.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_SOCKETVAR_H
+#include <sys/socketvar.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_IP_ICMP_H
+#include <netinet/ip_icmp.h>
+#endif
+#if HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_TCP_TIMER_H
+#include <netinet/tcp_timer.h>
+#endif
+#if HAVE_NETINET_ICMP6_H
+#include <netinet/icmp6.h>
+#endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# KAME (IPv6) headers
+# Agent:
+#
+# KAME
+for ac_header in netinet/ip6.h netinet6/in6_var.h netinet6/in6_pcb.h netinet6/ip6_var.h netinet6/nd6.h netinet6/tcp6.h netinet6/tcp6_fsm.h netinet6/tcp6_timer.h netinet6/tcp6_var.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP6_H
+#include <netinet/ip6.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# requiring <netinet/in.h> (OpenBSD 2.6)
+# Agent:
+#
+for ac_header in netinet/in_pcb.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "netinet/in_pcb.h" "ac_cv_header_netinet_in_pcb_h" "
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_TIMEOUT_H
+#include <sys/timeout.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+"
+if test "x$ac_cv_header_netinet_in_pcb_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NETINET_IN_PCB_H 1
+_ACEOF
+
+fi
+
+done
+
+
+##
+# Pre-requisite on specific types
+##
+
+# Special hack to get around various problems on older Linux kernels
+# (major ugh!)
+# Agent:
+#
+for ac_header in linux/ethtool.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "linux/ethtool.h" "ac_cv_header_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 */
+
+"
+if test "x$ac_cv_header_linux_ethtool_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LINUX_ETHTOOL_H 1
+_ACEOF
+
+fi
+
+done
+
+
+##
+# Headers requiring particular libraries
+##
+
+# for HostRes (Solaris 2.x)
+# Agent:
+#
+for ac_header in pkginfo.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "pkginfo.h" "ac_cv_header_pkginfo_h" "$ac_includes_default"
+if test "x$ac_cv_header_pkginfo_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PKGINFO_H 1
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pkginfo" >&5
+$as_echo_n "checking for library containing pkginfo... " >&6; }
+if ${netsnmp_cv_func_pkginfo_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pkginfo ();
+int
+main ()
+{
+return pkginfo ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in adm ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pkginfo ();
+int
+main ()
+{
+return pkginfo ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_pkginfo_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_pkginfo_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_pkginfo_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_pkginfo_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_pkginfo_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+$as_echo "#define HAVE_PKGINFO 1" >>confdefs.h
+
+
+ fi
+
+fi
+
+done
+
+
+case $target_os in
+ aix*)
+ # for CPU/memory statistics (AIX)
+ # Agent:
+ #
+ for ac_header in libperfstat.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "libperfstat.h" "ac_cv_header_libperfstat_h" "
+#if HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+
+"
+if test "x$ac_cv_header_libperfstat_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPERFSTAT_H 1
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing perfstat_cpu_total" >&5
+$as_echo_n "checking for library containing perfstat_cpu_total... " >&6; }
+if ${netsnmp_cv_func_perfstat_cpu_total_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char perfstat_cpu_total ();
+int
+main ()
+{
+return perfstat_cpu_total ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in perfstat ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char perfstat_cpu_total ();
+int
+main ()
+{
+return perfstat_cpu_total ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_perfstat_cpu_total_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_perfstat_cpu_total_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_perfstat_cpu_total_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_perfstat_cpu_total_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_perfstat_cpu_total_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+$as_echo "#define HAVE_PERFSTAT 1" >>confdefs.h
+
+ else
+ as_fn_error $? "
+
+*** To monitor CPU/memory values in AIX you need to install
+*** libperfstat which can be found in bos.perf
+" "$LINENO" 5
+ fi
+
+fi
+
+done
+
+ ;;
+ hpux*)
+ # HP-UX agent needs open_mib (XXX - not a header check!)
+ #
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing open_mib" >&5
+$as_echo_n "checking for library containing open_mib... " >&6; }
+if ${netsnmp_cv_func_open_mib_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char open_mib ();
+int
+main ()
+{
+return open_mib ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in nm ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char open_mib ();
+int
+main ()
+{
+return open_mib ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_open_mib_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_open_mib_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_open_mib_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_open_mib_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_open_mib_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+$as_echo "#define HAVE_LIBNM 1" >>confdefs.h
+
+
+ fi
+
+ ;;
+ *)
+ ;;
+esac
+
+# for MIB-2 info (Cygwin and MinGW)
+# Core:
+#
+for ac_header in windows.h iphlpapi.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# for MIB-2 info (MinGW)
+# Core:
+#
+if test x$with_socklib = xwinsock2; then
+ for ac_header in winsock.h winsock2.h ws2tcpip.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+#
+# for ucd-snmp/lmsensorsMib
+#
+for ac_header in sensors/sensors.h picl.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+fi # NETSNMP_QUICK_CHECK
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+# -*- autoconf -*-
+#########################################
+##
+# Checks for types
+##
+#########################################
+
+##
+# Standard checks:
+##
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if ${ac_cv_sizeof_long_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intmax_t" >&5
+$as_echo_n "checking size of intmax_t... " >&6; }
+if ${ac_cv_sizeof_intmax_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intmax_t))" "ac_cv_sizeof_intmax_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_intmax_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (intmax_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_intmax_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_intmax_t" >&5
+$as_echo "$ac_cv_sizeof_intmax_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+_ACEOF
+
+
+
+ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t"
+case $ac_cv_c_int8_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int8_t $ac_cv_c_int8_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t"
+case $ac_cv_c_int16_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int16_t $ac_cv_c_int16_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t"
+case $ac_cv_c_int32_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int32_t $ac_cv_c_int32_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
+case $ac_cv_c_int64_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int64_t $ac_cv_c_int64_t
+_ACEOF
+;;
+esac
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
+if ${ac_cv_type_long_long_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
+int
+main ()
+{
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if test "$cross_compiling" = yes; then :
+ ac_cv_type_long_long_int=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ #ifndef LLONG_MAX
+ # define HALF \
+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ # define LLONG_MAX (HALF - 1 + HALF)
+ #endif
+int
+main ()
+{
+long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+ {
+ long long int m = n << i;
+ if (m >> i != n)
+ return 1;
+ if (LLONG_MAX / 2 < m)
+ break;
+ }
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_type_long_long_int=yes
+else
+ ac_cv_type_long_long_int=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+else
+ ac_cv_type_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
+$as_echo "$ac_cv_type_long_long_int" >&6; }
+ if test $ac_cv_type_long_long_int = yes; then
+
+$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default"
+if test "x$ac_cv_type_intmax_t" = xyes; then :
+
+$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
+
+else
+ test $ac_cv_type_long_long_int = yes \
+ && ac_type='long long int' \
+ || ac_type='long int'
+
+cat >>confdefs.h <<_ACEOF
+#define intmax_t $ac_type
+_ACEOF
+
+fi
+
+
+ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
+case $ac_cv_c_uint8_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT8_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint8_t $ac_cv_c_uint8_t
+_ACEOF
+;;
+ esac
+
+ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
+case $ac_cv_c_uint16_t in #(
+ no|yes) ;; #(
+ *)
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint16_t $ac_cv_c_uint16_t
+_ACEOF
+;;
+ esac
+
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT32_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+ esac
+
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT64_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+ esac
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
+if ${ac_cv_type_unsigned_long_long_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
+int
+main ()
+{
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_type_unsigned_long_long_int=yes
+else
+ ac_cv_type_unsigned_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintmax_t" = xyes; then :
+
+$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h
+
+else
+ test $ac_cv_type_unsigned_long_long_int = yes \
+ && ac_type='unsigned long long int' \
+ || ac_type='unsigned long int'
+
+cat >>confdefs.h <<_ACEOF
+#define uintmax_t $ac_type
+_ACEOF
+
+fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_intptr_t" = xyes; then :
+
+$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
+
+else
+ for ac_type in 'int' 'long int' 'long long int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define intptr_t $ac_type
+_ACEOF
+
+ ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -z "$ac_type" && break
+ done
+fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+
+else
+ for ac_type in 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $ac_type
+_ACEOF
+
+ ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -z "$ac_type" && break
+ done
+fi
+
+
+
+##
+# Other type checks:
+##
+
+ac_fn_c_check_type "$LINENO" "off64_t" "ac_cv_type_off64_t" "$ac_includes_default"
+if test "x$ac_cv_type_off64_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_OFF64_T 1
+_ACEOF
+
+
+fi
+
+ac_fn_c_check_type "$LINENO" "nfds_t" "ac_cv_type_nfds_t" "#include <sys/poll.h>
+"
+if test "x$ac_cv_type_nfds_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_NFDS_T 1
+_ACEOF
+
+
+fi
+
+
+# Solaris specific checks
+# (taken from Perl's configure script)
+#
+ac_fn_c_check_type "$LINENO" "Counter64" "ac_cv_type_Counter64" "#include <inet/mib2.h>
+"
+if test "x$ac_cv_type_Counter64" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_COUNTER64 1
+_ACEOF
+
+
+fi
+
+ac_fn_c_check_type "$LINENO" "mib2_ipIfStatsEntry_t" "ac_cv_type_mib2_ipIfStatsEntry_t" "#include <inet/mib2.h>
+"
+if test "x$ac_cv_type_mib2_ipIfStatsEntry_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_MIB2_IPIFSTATSENTRY_T 1
+_ACEOF
+
+
+fi
+
+
+# N.B: The above checks could safely be moved to
+# the later 'config_types' sub-script
+#
+
+
+##
+# Determine the IPv6 stack type
+##
+
+# These checks also set the LIBS/CFLAGS variables,
+# which may be needed for subsequent function tests
+#
+
+if test "x$enable_ipv6" = "xyes"; then
+ v6type=unknown
+ v6lib=none
+ v6trylibc=no
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking ipv6 stack type" >&5
+$as_echo_n "checking ipv6 stack type... " >&6; }
+ for i in v6d toshiba kame inria zeta linux-glibc linux-inet6 cygwin winsock2 generic; do
+ case $i in
+ v6d)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include </usr/local/v6/include/sys/types.h>
+#ifdef __V6D__
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ v6type=$i; v6lib=v6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-I/usr/local/v6/include $CFLAGS"
+fi
+rm -f conftest*
+
+ ;;
+ toshiba)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/param.h>
+#ifdef _TOSHIBA_INET6
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ v6type=$i; v6lib=inet6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+fi
+rm -f conftest*
+
+ ;;
+ kame)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <netinet/in.h>
+#ifdef __KAME__
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ v6type=$i; v6lib=inet6;
+ v6libdir=/usr/local/v6/lib;
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+fi
+rm -f conftest*
+
+ ;;
+ inria)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <netinet/in.h>
+#ifdef IPV6_INRIA_VERSION
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ v6type=$i;
+ v6lib=dummy;
+ v6libdir=none;
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+fi
+rm -f conftest*
+
+ ;;
+ zeta)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/param.h>
+#ifdef _ZETA_MINAMI_INET6
+A
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ v6type=$i; v6lib=inet6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+fi
+rm -f conftest*
+
+ ;;
+ linux-glibc)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <features.h>
+#if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC_ > 2))
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ v6type=$i;
+ v6lib=dummy;
+ v6libdir=none;
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+fi
+rm -f conftest*
+
+ ;;
+ linux-inet6)
+ if test -d /usr/inet6; then
+ v6type=$i
+ v6lib=inet6
+ v6libdir=/usr/inet6/lib
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+ fi
+ ;;
+ cygwin)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <netinet/in.h>
+#ifdef _CYGWIN_IN6_H
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ v6type=$i;
+ v6lib=dummy;
+ v6libdir=none
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+fi
+rm -f conftest*
+
+ ;;
+ winsock2)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <ws2tcpip.h>
+#if defined(_WS2TCPIP_H)
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ v6type=$i;
+ v6lib=dummy;
+ v6libdir=none
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+fi
+rm -f conftest*
+
+ ;;
+ generic)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: postponed" >&5
+$as_echo "postponed" >&6; }
+ ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_addr" "ac_cv_member_struct_sockaddr_in6_sin6_addr" "
+$ac_includes_default
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_in6_sin6_addr" = xyes; then :
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking ipv6 stack type" >&5
+$as_echo_n "checking ipv6 stack type... " >&6; }
+ if test "x$ac_cv_member_struct_sockaddr_in6_sin6_addr" = "xyes"; then
+ v6type=$i
+ v6lib=dummy
+ v6libdir=none
+ v6trylibc=yes
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+ fi
+ ;;
+ esac
+ if test "$v6type" != "unknown"; then
+ break
+ fi
+ done
+
+ if test "$v6lib" != "none"; then
+ if test -d $v6libdir -a -f $v6libdir/lib$v6lib.a; then
+ LIBS="-L$v6libdir -l$v6lib $LIBS"
+ enable_ipv6="yes"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$v6type, $enable_ipv6, using lib$v6lib\"" >&5
+$as_echo "\"$v6type, $enable_ipv6, using lib$v6lib\"" >&6; }
+ elif test "$v6trylibc" = "yes"; then
+ enable_ipv6="yes"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$v6type, $enable_ipv6, using libc\"" >&5
+$as_echo "\"$v6type, $enable_ipv6, using libc\"" >&6; }
+ else
+ as_fn_error $? "no IPv6 library lib$v6lib.a found." "$LINENO" 5
+ exit 1
+ fi
+ else
+ enable_ipv6="no"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$v6type, $enable_ipv6\"" >&5
+$as_echo "\"$v6type, $enable_ipv6\"" >&6; }
+ fi
+fi
+
+# -*- autoconf -*-
+#
+# Maybe add library extensions for thread mutex locking.
+#
+
+if test "x$with_res_locks" = "xyes"; then
+
+$as_echo "#define NETSNMP_REENTRANT 1" >>confdefs.h
+
+
+ case $target_os in
+
+ aix*)
+ CC_RUNTIME_ARG="$CC_RUNTIME_ARG -lpthreads"
+ ;;
+
+ *)
+ ;;
+
+ esac
+fi
+
+#
+# Add platform-specific source files.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for platform-specific source" >&5
+$as_echo_n "checking for platform-specific source... " >&6; }
+other_src_list=""
+other_ftobjs_list=""
+other_lobjs_list=""
+other_objs_list=""
+other_agentobjs=""
+other_lagentobjs=""
+other_ftagentobjs=""
+other_trapd_objects=""
+
+# Win32 service code
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ other_src_list="$other_src_list winservice.c winservicerc.rc"
+ other_objs_list="$other_objs_list winservice.o winservicerc.o"
+ other_lobjs_list="$other_lobjs_list winservice.lo winservicerc.lo"
+ other_ftobjs_list="$other_ftobjs_list winservice.ft winservicerc.ft"
+ other_agentobjs="../snmplib/winservicerc.o"
+ other_lagentobjs="../snmplib/winservicerc.lo"
+ other_ftagentobjs="../snmplib/winservicerc.lo"
+ other_trapd_objects="../snmplib/winservicerc.o"
+fi
+
+# Win32 pipes
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ other_src_list="$other_src_list winpipe.c"
+ other_objs_list="$other_objs_list winpipe.o"
+ other_lobjs_list="$other_lobjs_list winpipe.lo"
+ other_ftobjs_list="$other_ftobjs_list winpipe.ft"
+fi
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $other_src_list $other_objs_list $other_lobjs_list" >&5
+$as_echo "$other_src_list $other_objs_list $other_lobjs_list" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $other_agentobjs $other_lagentobjs $other_trapd_objects" >&5
+$as_echo "$other_agentobjs $other_lagentobjs $other_trapd_objects" >&6; }
+
+#
+# Create directory structure for build
+#
+if test ! -d include; then
+ mkdir include
+fi
+if test ! -d include/net-snmp; then
+ mkdir include/net-snmp
+fi
+if test ! -d include/net-snmp/agent; then
+ mkdir include/net-snmp/agent
+fi
+if test ! -d include/net-snmp/library; then
+ mkdir include/net-snmp/library
+fi
+if test ! -d include/ucd-snmp; then
+ mkdir include/ucd-snmp
+fi
+
+if test ! -d snmplib; then
+ mkdir snmplib
+fi
+if test ! -d snmplib/transports ; then
+ mkdir snmplib/transports
+fi
+
+#
+# Do transport module processing.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for and configuring transport modules to use" >&5
+$as_echo_n "checking for and configuring transport modules to use... " >&6; }
+
+# include the actual code checking
+# -*- sh -*-
+transport_src_list=""
+transport_hdr_list=""
+transport_def_list=""
+transport_result_list=""
+transport_add_list=""
+new_with_transport_list=`echo $with_transports | $SED 's/,/ /g;'`
+new_with_out_transport_list=`echo $with_out_transports | $SED 's/,/ /g;'`
+
+# set up the CPP command
+MODULECPP="$CPP $PARTIALTARGETFLAGS -I${srcdir} -I${srcdir}/include"
+
+#
+# Add the default transports to the list
+#
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ transport_default_list="UDP TCP Alias Callback"
+else
+ transport_default_list="UDP TCP Alias Unix Callback"
+fi
+if test "x$enable_ipv6" = "xyes"; then
+ transport_default_list="UDPIPv6 TCPIPv6 $transport_default_list"
+fi
+for i in $transport_default_list; do
+ if echo " $new_with_transport_list " | $GREP " $i " >/dev/null; then
+ :
+ else
+ transport_add_list="$i $transport_add_list"
+ fi
+done
+new_transport_list="$transport_add_list $new_with_transport_list"
+
+if test "x$ctor_header" = "x" ; then
+ ctor_header="snmplib/transports/snmp_transport_inits.h"
+fi
+
+echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $ctor_header
+while test "x$new_transport_list" != "x"; do
+ future_new_transport_list=""
+ for i in $new_transport_list; do
+ if echo " $new_with_out_transport_list " | $GREP " $i " >/dev/null; then
+ true
+ else
+ if test "x$enable_ipv6" != "xyes"; then
+ if test "x$i" = "xUDPIPv6" -o "x$i" = "xTCPIPv6"; then
+ as_fn_error $? "IPv6 transports not available if IPv6 support is not enabled" "$LINENO" 5
+ fi
+ fi
+ transport_src="transports/snmp"$i"Domain.c"
+ transport_hdr="snmp"$i"Domain.h"
+ rel_transport_src="snmplib/"$transport_src
+ rel_transport_hdr="include/net-snmp/library/"$transport_hdr
+ lc_i=`echo $i | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ ctor_fn="netsnmp_"$lc_i"_ctor"
+ if test -f "$srcdir/$rel_transport_src"; then
+ transport_result_list="$transport_result_list $i"
+ transport_src_list="$transport_src $transport_src_list"
+ if test -f "$srcdir/$rel_transport_hdr"; then
+ transport_hdr_list="$transport_hdr $transport_hdr_list"
+ fi
+ transport_def=`echo $i | $SED 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ transport_def_list="NETSNMP_TRANSPORT_"$transport_def"_DOMAIN $transport_def_list"
+ else
+ echo
+ as_fn_error $? "Cannot find file $srcdir/$rel_transport_src to support SNMP transport domain $i." "$LINENO" 5
+ fi
+
+ #---------------------
+ # build a pseudo include header that includes current config and
+ # system symbols:
+ rm -f conftest.$ac_ext module_tmp_header.h
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include NETSNMP_SYSTEM_INCLUDE_FILE
+#undef NETSNMP_MINIMAL_CODE
+#define NET_SNMP_CONFIG_H
+#undef config_require
+#define config_require(foo) config_checkit_require(foo)
+#undef config_error
+#define config_error(foo) config_checkit_error(foo)
+#include "$rel_transport_hdr"
+_ACEOF
+ mv conftest.$ac_ext module_tmp_header.h
+
+ #
+ # check for dependencies using config_require() macro
+ #
+ sub_list=`$MODULECPP module_tmp_header.h | $GREP config_checkit_require | $SED 's/.*config_checkit_require *( *\(.*\) *).*/\1/'`
+ if test "x$sub_list" != "x" ; then
+ for j in $sub_list ; do
+ if echo " $future_new_transport_list $new_transport_list " | $GREP " $j " > /dev/null ; then
+ :
+ else
+ future_new_transport_list="$future_new_transport_list $j"
+ fi
+ done
+ fi
+
+ #
+ # check for errors using config_error() macro
+ #
+ error_list=`$MODULECPP module_tmp_header.h | $GREP config_checkit_error | $SED 's/.*config_checkit_error(\(.*\)).*/\1/g'`
+ if test "x$error_list" != "x" ; then
+ echo ""
+ as_fn_error $? "$error_list" "$LINENO" 5
+ fi
+
+ #
+ # Check for needed constructor initialization routines to call
+ #
+ found=`grep $ctor_fn $srcdir/$rel_transport_src`
+ if grep $ctor_fn $srcdir/$rel_transport_src > /dev/null ; then
+ # we add them down below instead of here to make sure
+ # config_require dependency constructors get called first.
+ tr_init_list="$ctor_fn $tr_init_list"
+ fi
+ fi
+ done # for each new transport
+ new_transport_list="$future_new_transport_list"
+done # while new transports exist
+transport_obj_list=`echo " $transport_src_list " | $SED 's/\.c/\.o/g'`
+transport_lobj_list=`echo " $transport_src_list " | $SED 's/\.c/\.lo/g'`
+transport_ftobj_list=`echo " $transport_src_list " | $SED 's/\.c/\.ft/g'`
+for i in $tr_init_list ; do
+ echo "$i();" >> $ctor_header
+done
+
+## win32 platforms require inet_ntop etc.
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" -o "x$PARTIALTARGETOS" = "xcygwin"; then
+ if echo "$transport_def_list" | $GREP "IPV6" >/dev/null; then
+ transport_obj_list="$transport_obj_list inet_ntop.o inet_pton.o"
+ transport_lobj_list="$transport_lobj_list inet_ntop.lo inet_pton.lo"
+ transport_ftobj_list="$transport_ftobj_list inet_ntop.ft inet_pton.ft"
+ fi
+fi
+
+if test "x$transport_result_list" = x ; then
+ as_fn_error $? "No transports configured, at least one must be provided" "$LINENO" 5
+fi
+
+
+
+
+
+
+
+for i in $transport_def_list; do
+ cat >>confdefs.h <<_ACEOF
+#define $i 1
+_ACEOF
+
+done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $transport_result_list." >&5
+$as_echo "$transport_result_list." >&6; }
+
+ cat >> configure-summary << EOF
+ Network transport support: $transport_result_list
+EOF
+
+
+# cleanup
+rm -f module_tmp_header.h
+
+#
+# Security modules to use
+#
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security modules to use" >&5
+$as_echo_n "checking for security modules to use... " >&6; }
+# -*- sh -*-
+security_def_list="usm"
+security_src_list=""
+security_obj_list=""
+security_lobj_list=""
+security_ftobj_list=""
+security_mod_list=" "
+
+new_with_security=
+new_with_out_security=`echo $with_out_security_modules | tr , ' '`
+
+# Assign additional security modules
+for i in `echo $with_security_modules | tr , ' '`; do
+ if echo " $new_with_out_security " | $GREP " $i " > /dev/null; then
+ echo
+ as_fn_error $? "security module conflict - $i both included and excluded" "$LINENO" 5
+ elif echo " $new_with_security " | $GREP " $i " > /dev/null ; then
+ : # Double define, ignore
+ else
+ new_with_security="$new_with_security $i"
+ fi
+done
+
+# Add default security modules
+for i in $security_def_list; do
+ if echo " $new_with_out_security " | $GREP " $i " > /dev/null; then
+ : # Excluded, ignore
+ elif echo " $new_with_security " | $GREP " $i " > /dev/null ; then
+ : # Double define, ignore
+ else
+ new_with_security="$new_with_security $i"
+ fi
+done
+
+# Generate output files
+: ${security_init_file:='snmplib/snmpsm_init.h'}
+: ${security_shutdown_file:='snmplib/snmpsm_shutdown.h'}
+: ${security_incl_file:='include/net-snmp/library/snmpv3-security-includes.h'}
+
+echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_init_file
+echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_shutdown_file
+echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_incl_file
+
+for i in $new_with_security; do
+ cfile="snmp"$i".c"
+ hfile="snmp"$i".h"
+
+ # make sure support exists for it
+ if test -f $srcdir"/snmplib/"$cfile -a -f $srcdir"/include/net-snmp/library/"$hfile; then
+ :
+ else
+ echo
+ as_fn_error $? "No such security module: $i / $cfile / $hfile" "$LINENO" 5
+ fi
+
+ # define a bunch of stuff to enable it
+ security_mod_list="${security_mod_list} $i"
+ security_src_list="$security_src_list $cfile"
+ security_src_list="$security_src_list $cfile"
+ security_hdr_list="$security_hdr_list $hfile"
+ security_obj_list="$security_obj_list snmp"$i".o"
+ security_lobj_list="$security_lobj_list snmp"$i".lo"
+ security_ftobj_list="$security_ftobj_list snmp"$i".ft"
+ echo "init_"$i"();" >> $security_init_file
+ echo "shutdown_"$i"();" >> $security_shutdown_file
+ echo "#include <net-snmp/library/$hfile>" >> $security_incl_file
+ def_name="`$as_echo "NETSNMP_SECMOD_$i" | $as_tr_cpp`"
+ cat >>confdefs.h <<_ACEOF
+#define $def_name 1
+_ACEOF
+
+done
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $new_with_security" >&5
+$as_echo "$new_with_security" >&6; }
+
+ cat >> configure-summary << EOF
+ SNMPv3 Security Modules: $new_with_security
+EOF
+
+
+#
+# Handle the special case of KSM to see which crypto API we support
+#
+
+ac_cv_NETSNMP_USE_KERBEROS_MIT=no
+rebuilt_new_with_security=
+already_checked_krb5=no
+
+for sec in $new_with_security
+do
+ if test "x$sec" = "xksm" -a "xyes" = "x$already_checked_krb5"; then
+ continue
+ fi
+ already_checked_krb5=yes
+
+ if test x$sec != xksm; then
+ rebuilt_new_with_security="$rebuilt_new_with_security $sec"
+ else
+ if test no = $trykrb5; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: configured not to use krb5. disabling ksm" >&5
+$as_echo "$as_me: configured not to use krb5. disabling ksm" >&6;}
+ continue
+ fi
+
+ # Extract the first word of "krb5-config", so it can be a program name with args.
+set dummy krb5-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_krb5_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $krb5_config in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_krb5_config="$krb5_config" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$krb5path/bin:$PATH"
+for as_dir in $as_dummy
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_krb5_config="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_krb5_config" && ac_cv_path_krb5_config="no"
+ ;;
+esac
+fi
+krb5_config=$ac_cv_path_krb5_config
+if test -n "$krb5_config"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $krb5_config" >&5
+$as_echo "$krb5_config" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ if test no != $krb5_config; then
+ CPPFLAGS="$CPPFLAGS `$krb5_config --cflags`"
+ LIBS="$LIBS `$krb5_config --libs`"
+ elif test $krb5path != no; then
+
+ if test "x$krb5path" != x -a -d $krb5path; then
+ if test -d $krb5path/lib; then
+ LDFLAGS="-L$krb5path/lib $LDFLAGS"
+ fi
+ if test -d $krb5path/include; then
+ CPPFLAGS="-I$krb5path/include $CPPFLAGS"
+ fi
+ fi
+
+ else
+
+ if test "x/usr/kerberos" != x -a -d /usr/kerberos; then
+ if test -d /usr/kerberos/lib; then
+ LDFLAGS="-L/usr/kerberos/lib $LDFLAGS"
+ fi
+ if test -d /usr/kerberos/include; then
+ CPPFLAGS="-I/usr/kerberos/include $CPPFLAGS"
+ fi
+ fi
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5" >&5
+$as_echo_n "checking for krb5... " >&6; }
+ if ${ac_cv_have_krb5+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_init_context in -lkrb5" >&5
+$as_echo_n "checking for krb5_init_context in -lkrb5... " >&6; }
+if ${ac_cv_lib_krb5_krb5_init_context+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb5 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_init_context ();
+int
+main ()
+{
+return krb5_init_context ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_krb5_krb5_init_context=yes
+else
+ ac_cv_lib_krb5_krb5_init_context=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_init_context" >&5
+$as_echo "$ac_cv_lib_krb5_krb5_init_context" >&6; }
+if test "x$ac_cv_lib_krb5_krb5_init_context" = xyes; then :
+ ac_cv_have_krb5=yes
+else
+ ac_cv_have_krb5=no
+
+fi
+
+
+fi
+
+
+ if test $ac_cv_have_krb5 = no; then
+ if test "x$askedkrb5" = "xyes"; then
+ as_fn_error $? "Asked to use krb5 but I couldn't find it." "$LINENO" 5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no. disabling ksm" >&5
+$as_echo "no. disabling ksm" >&6; }
+ continue
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ rebuilt_new_with_security="$rebuilt_new_with_security ksm"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for heimdal" >&5
+$as_echo_n "checking for heimdal... " >&6; }
+ if ${ac_cv_heimdal+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <krb5.h>
+int
+main ()
+{
+const char *v = heimdal_version;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_heimdal=yes
+else
+ ac_cv_heimdal=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_heimdal" >&5
+$as_echo "$ac_cv_heimdal" >&6; }
+ if test $ac_cv_heimdal = yes; then
+
+$as_echo "#define NETSNMP_USE_KERBEROS_HEIMDAL 1" >>confdefs.h
+
+ if test no = $krb5_config; then
+ LIBS="$LIBS -lkrb5 -lasn1 -lcom_err -lroken"
+ fi
+ elif test no = $krb5_config; then
+ LIBS="$LIBS -lkrb5 -lcom_err"
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see which crypto API we need to use" >&5
+$as_echo_n "checking to see which crypto API we need to use... " >&6; }
+ ac_fn_c_check_func "$LINENO" "krb5_c_encrypt" "ac_cv_func_krb5_c_encrypt"
+if test "x$ac_cv_func_krb5_c_encrypt" = xyes; then :
+
+ if ${ac_cv_NETSNMP_USE_KERBEROS_MIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_init_context in -lk5crypto" >&5
+$as_echo_n "checking for krb5_init_context in -lk5crypto... " >&6; }
+if ${ac_cv_lib_k5crypto_krb5_init_context+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lk5crypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_init_context ();
+int
+main ()
+{
+return krb5_init_context ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_k5crypto_krb5_init_context=yes
+else
+ ac_cv_lib_k5crypto_krb5_init_context=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_k5crypto_krb5_init_context" >&5
+$as_echo "$ac_cv_lib_k5crypto_krb5_init_context" >&6; }
+if test "x$ac_cv_lib_k5crypto_krb5_init_context" = xyes; then :
+ ac_cv_NETSNMP_USE_KERBEROS_MIT=yes
+else
+ ac_cv_MIT_NEW_CRYPTo=no
+
+fi
+
+
+fi
+
+
+ if test yes = $ac_cv_NETSNMP_USE_KERBEROS_MIT; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: new MIT crypto API" >&5
+$as_echo "new MIT crypto API" >&6; }
+
+$as_echo "#define NETSNMP_USE_KERBEROS_MIT 1" >>confdefs.h
+
+ if test no = $krb5_config; then
+ LIBS="$LIBS -lk5crypto"
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: old MIT crypto API" >&5
+$as_echo "old MIT crypto API" >&6; }
+fi
+
+ fi
+ fi
+done
+
+new_with_security=$rebuilt_new_with_security
+
+#
+# Detect lm_sensors version
+#
+if test "x$ac_cv_header_sensors_sensors_h" = "xyes"; then
+ ac_fn_c_check_decl "$LINENO" "sensors_get_all_subfeatures" "ac_cv_have_decl_sensors_get_all_subfeatures" "#include <sensors/sensors.h>
+"
+if test "x$ac_cv_have_decl_sensors_get_all_subfeatures" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SENSORS_GET_ALL_SUBFEATURES $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+
+$as_echo "#define NETSNMP_USE_SENSORS_V3 1" >>confdefs.h
+
+fi
+
+fi
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+# -*- autoconf -*-
+#########################################
+##
+# Checks for libraries that are run
+# before the agent module tests.
+##
+#########################################
+
+
+##
+# RPM checks
+#
+##
+for ac_header in rpm/rpmlib.h rpm/header.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "rpm/rpmlib.h" "ac_cv_header_rpm_rpmlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_rpm_rpmlib_h" = xyes; then :
+ rpmlib_h=yes
+else
+ rpmlib_h=no
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "rpm/header.h" "ac_cv_header_rpm_header_h" "$ac_includes_default"
+if test "x$ac_cv_header_rpm_header_h" = xyes; then :
+ rpmheader_h=yes
+else
+ rpmheader_h=no
+fi
+
+
+
+if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then
+ if test "x$with_rpm" = "xyes" ; then
+ as_fn_error $? "Could not find either the RPM header files needed and was specifically asked to use RPM support" "$LINENO" 5
+ else
+ with_rpm=no
+ fi
+fi
+
+#
+# rpm libraries only needed for the host resources mib software
+# installed tables (on linux in particular)
+#
+if test "x$with_rpm" != "xno"; then
+ # ARG. RPM is a real pain.
+ # FWIW librpm.la, librpmio.la, and libpopt.la have correct dependencies.
+ _rpmlibs=""
+
+ # rpm-4.0.x needs rpmio.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing rpmGetPath" >&5
+$as_echo_n "checking for library containing rpmGetPath... " >&6; }
+if ${netsnmp_cv_func_rpmGetPath__rpmlibs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$_rpmlibs"
+ netsnmp_temp_LIBS="${netsnmp_target_val} $LMIBLIBS ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rpmGetPath ();
+int
+main ()
+{
+return rpmGetPath ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in rpmio ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rpmGetPath ();
+int
+main ()
+{
+return rpmGetPath ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_rpmGetPath__rpmlibs="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_rpmGetPath__rpmlibs" >&5
+$as_echo "$netsnmp_cv_func_rpmGetPath__rpmlibs" >&6; }
+ if test "${netsnmp_cv_func_rpmGetPath__rpmlibs}" != "no" ; then
+ if test "${netsnmp_cv_func_rpmGetPath__rpmlibs}" != "none required" ; then
+ _rpmlibs="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+
+ fi
+
+
+ # rpm-4.0.3 librpmdb actually contains what we need.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing rpmdbOpen" >&5
+$as_echo_n "checking for library containing rpmdbOpen... " >&6; }
+if ${netsnmp_cv_func_rpmdbOpen__rpmlibs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$_rpmlibs"
+ netsnmp_temp_LIBS="${netsnmp_target_val} $LMIBLIBS ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rpmdbOpen ();
+int
+main ()
+{
+return rpmdbOpen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in rpmdb ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rpmdbOpen ();
+int
+main ()
+{
+return rpmdbOpen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_rpmdbOpen__rpmlibs="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_rpmdbOpen__rpmlibs" >&5
+$as_echo "$netsnmp_cv_func_rpmdbOpen__rpmlibs" >&6; }
+ if test "${netsnmp_cv_func_rpmdbOpen__rpmlibs}" != "no" ; then
+ if test "${netsnmp_cv_func_rpmdbOpen__rpmlibs}" != "none required" ; then
+ _rpmlibs="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+
+ fi
+
+ # now check for rpm using the appropriate libraries.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing rpmReadConfigFiles" >&5
+$as_echo_n "checking for library containing rpmReadConfigFiles... " >&6; }
+if ${netsnmp_cv_func_rpmReadConfigFiles__rpmlibs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$_rpmlibs"
+ netsnmp_temp_LIBS="${netsnmp_target_val} $LMIBLIBS ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rpmReadConfigFiles ();
+int
+main ()
+{
+return rpmReadConfigFiles ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in rpm ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rpmReadConfigFiles ();
+int
+main ()
+{
+return rpmReadConfigFiles ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_rpmReadConfigFiles__rpmlibs="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_rpmReadConfigFiles__rpmlibs" >&5
+$as_echo "$netsnmp_cv_func_rpmReadConfigFiles__rpmlibs" >&6; }
+ if test "${netsnmp_cv_func_rpmReadConfigFiles__rpmlibs}" != "no" ; then
+ if test "${netsnmp_cv_func_rpmReadConfigFiles__rpmlibs}" != "none required" ; then
+ _rpmlibs="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+
+$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
+
+ LMIBLIBS="$_rpmlibs $LMIBLIBS"
+
+
+ fi
+
+
+ # rpm 4.6 has incompatible API, turn on the legacy one
+ ac_fn_c_check_decl "$LINENO" "headerGetEntry" "ac_cv_have_decl_headerGetEntry" "#include <rpm/rpmlib.h>
+
+"
+if test "x$ac_cv_have_decl_headerGetEntry" = xyes; then :
+ :
+else
+
+$as_echo "#define _RPM_4_4_COMPAT /**/" >>confdefs.h
+
+fi
+
+fi
+
+#
+# getfsstat/getvfsstat
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getfsstat" >&5
+$as_echo_n "checking for library containing getfsstat... " >&6; }
+if ${ac_cv_search_getfsstat+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getfsstat ();
+int
+main ()
+{
+return getfsstat ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nbutil; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getfsstat=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getfsstat+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getfsstat+:} false; then :
+
+else
+ ac_cv_search_getfsstat=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getfsstat" >&5
+$as_echo "$ac_cv_search_getfsstat" >&6; }
+ac_res=$ac_cv_search_getfsstat
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+for ac_func in getfsstat
+do :
+ ac_fn_c_check_func "$LINENO" "getfsstat" "ac_cv_func_getfsstat"
+if test "x$ac_cv_func_getfsstat" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETFSSTAT 1
+_ACEOF
+
+fi
+done
+
+for ac_func in getvfsstat
+do :
+ ac_fn_c_check_func "$LINENO" "getvfsstat" "ac_cv_func_getvfsstat"
+if test "x$ac_cv_func_getvfsstat" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETVFSSTAT 1
+_ACEOF
+
+fi
+done
+
+# getmntent is in the standard C library on UNICOS, in -lsun on Irix 4,
+# -lseq on Dynix/PTX, -lgen on Unixware.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getmntent" >&5
+$as_echo_n "checking for library containing getmntent... " >&6; }
+if ${ac_cv_search_getmntent+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getmntent ();
+int
+main ()
+{
+return getmntent ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' sun seq gen; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getmntent=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getmntent+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getmntent+:} false; then :
+
+else
+ ac_cv_search_getmntent=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getmntent" >&5
+$as_echo "$ac_cv_search_getmntent" >&6; }
+ac_res=$ac_cv_search_getmntent
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ ac_cv_func_getmntent=yes
+
+$as_echo "#define HAVE_GETMNTENT 1" >>confdefs.h
+
+else
+ ac_cv_func_getmntent=no
+fi
+
+
+
+#
+# kinfo_get_cpus
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kinfo_get_cpus" >&5
+$as_echo_n "checking for library containing kinfo_get_cpus... " >&6; }
+if ${ac_cv_search_kinfo_get_cpus+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kinfo_get_cpus ();
+int
+main ()
+{
+return kinfo_get_cpus ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' kinfo; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_kinfo_get_cpus=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_kinfo_get_cpus+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_kinfo_get_cpus+:} false; then :
+
+else
+ ac_cv_search_kinfo_get_cpus=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_kinfo_get_cpus" >&5
+$as_echo "$ac_cv_search_kinfo_get_cpus" >&6; }
+ac_res=$ac_cv_search_kinfo_get_cpus
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+for ac_func in kinfo_get_cpus
+do :
+ ac_fn_c_check_func "$LINENO" "kinfo_get_cpus" "ac_cv_func_kinfo_get_cpus"
+if test "x$ac_cv_func_kinfo_get_cpus" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_KINFO_GET_CPUS 1
+_ACEOF
+
+fi
+done
+
+
+#
+# diskIOLAx requires exp which may require -lm
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing exp" >&5
+$as_echo_n "checking for library containing exp... " >&6; }
+if ${ac_cv_search_exp+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char exp ();
+int
+main ()
+{
+return exp ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_exp=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_exp+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_exp+:} false; then :
+
+else
+ ac_cv_search_exp=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_exp" >&5
+$as_echo "$ac_cv_search_exp" >&6; }
+ac_res=$ac_cv_search_exp
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+#
+# libkvm
+#
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_read" >&5
+$as_echo_n "checking for library containing kvm_read... " >&6; }
+if ${netsnmp_cv_func_kvm_read_LAGENTLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LAGENTLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_read ();
+int
+main ()
+{
+return kvm_read ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in kvm ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_read ();
+int
+main ()
+{
+return kvm_read ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_kvm_read_LAGENTLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_kvm_read_LAGENTLIBS" >&5
+$as_echo "$netsnmp_cv_func_kvm_read_LAGENTLIBS" >&6; }
+ if test "${netsnmp_cv_func_kvm_read_LAGENTLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_kvm_read_LAGENTLIBS}" != "none required" ; then
+ LAGENTLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_openfiles" >&5
+$as_echo_n "checking for library containing kvm_openfiles... " >&6; }
+if ${netsnmp_cv_func_kvm_openfiles_LAGENTLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LAGENTLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_openfiles ();
+int
+main ()
+{
+return kvm_openfiles ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in kvm ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_openfiles ();
+int
+main ()
+{
+return kvm_openfiles ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_kvm_openfiles_LAGENTLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_kvm_openfiles_LAGENTLIBS" >&5
+$as_echo "$netsnmp_cv_func_kvm_openfiles_LAGENTLIBS" >&6; }
+ if test "${netsnmp_cv_func_kvm_openfiles_LAGENTLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_kvm_openfiles_LAGENTLIBS}" != "none required" ; then
+ LAGENTLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_getprocs" >&5
+$as_echo_n "checking for library containing kvm_getprocs... " >&6; }
+if ${netsnmp_cv_func_kvm_getprocs_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_getprocs ();
+int
+main ()
+{
+return kvm_getprocs ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in kvm ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_getprocs ();
+int
+main ()
+{
+return kvm_getprocs ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_kvm_getprocs_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_kvm_getprocs_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_kvm_getprocs_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_kvm_getprocs_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_kvm_getprocs_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_getproc2" >&5
+$as_echo_n "checking for library containing kvm_getproc2... " >&6; }
+if ${netsnmp_cv_func_kvm_getproc2_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_getproc2 ();
+int
+main ()
+{
+return kvm_getproc2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in kvm ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_getproc2 ();
+int
+main ()
+{
+return kvm_getproc2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_kvm_getproc2_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_kvm_getproc2_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_kvm_getproc2_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_kvm_getproc2_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_kvm_getproc2_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_getswapinfo" >&5
+$as_echo_n "checking for library containing kvm_getswapinfo... " >&6; }
+if ${netsnmp_cv_func_kvm_getswapinfo_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_getswapinfo ();
+int
+main ()
+{
+return kvm_getswapinfo ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in kvm ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_getswapinfo ();
+int
+main ()
+{
+return kvm_getswapinfo ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_kvm_getswapinfo_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_kvm_getswapinfo_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_kvm_getswapinfo_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_kvm_getswapinfo_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_kvm_getswapinfo_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+
+ fi
+
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LAGENTLIBS $LMIBLIBS $LIBS"
+for ac_func in kvm_openfiles kvm_getprocs kvm_getproc2 kvm_getswapinfo
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+LIBS="$netsnmp_save_LIBS"
+
+#
+# dynamic module support
+#
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
+$as_echo_n "checking for library containing dlopen... " >&6; }
+if ${netsnmp_cv_func_dlopen_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} $LAGENTLIBS $LSNMPLIBS ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in dl ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_dlopen_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_dlopen_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_dlopen_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_dlopen_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_dlopen_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+
+ fi
+
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LMIBLIBS $LAGENTLIBS $LSNMPLIBS $LIBS"
+for ac_func in dlopen
+do :
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLOPEN 1
+_ACEOF
+
+fi
+done
+
+LIBS="$netsnmp_save_LIBS"
+
+# -*- autoconf -*-
+#
+# generate empty files
+#
+# Create include file list for snmp_vars.h to use.
+mibdir="agent/mibgroup"
+if test ! -d agent; then
+ mkdir agent
+fi
+if test ! -d agent/mibgroup; then
+ mkdir agent/mibgroup
+fi
+j="$mibdir/mib_module_includes.h $mibdir/agent_module_includes.h \
+ $mibdir/mib_module_inits.h $mibdir/agent_module_inits.h \
+ $mibdir/mib_module_shutdown.h $mibdir/agent_module_shutdown.h \
+ include/net-snmp/agent/mib_module_config.h \
+ include/net-snmp/agent/agent_module_config.h \
+ $mibdir/mib_module_dot_conf.h $mibdir/agent_module_dot_conf.h"
+
+for i in $j; do
+ rm -f $i
+ echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $i
+done
+
+#
+# Do hairy agent module processing.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for and configuring mib modules to use" >&5
+$as_echo_n "checking for and configuring mib modules to use... " >&6; }
+
+# set up the CPP command
+MODULECPP="$CPP $PARTIALTARGETFLAGS -DNETSNMP_FEATURE_CHECKING -I${srcdir}/include -I${srcdir}/agent/mibgroup"
+if test "x$enable_mfd_rewrites" = "xyes"; then
+ MODULECPP="$MODULECPP -DNETSNMP_ENABLE_MFD_REWRITES"
+fi
+
+module_list=""
+mib_module_list=""
+agent_module_list=""
+new_with_mib_modules=`echo $with_mib_modules | $SED 's/,/ /g;'`
+new_with_out_mib_modules=`echo $with_out_mib_modules | $SED 's/,/ /g;'`
+
+# set up initial module list
+new_module_list="$new_with_mib_modules default_modules"
+
+# minor modifications
+if test "x$enable_agent" = "xno"; then
+ # minimum mib module list for snmptrapd
+ new_module_list="mibII/vacm_vars mibII/vacm_conf utilities/execute $new_with_mib_modules"
+ default_mibs=SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB
+ default_mibs_install=" "
+elif test "x$mini_agent" = "xyes"; then
+ # define the mini agent flag to reduce our load list from default_mibs.h
+ MODULECPP="$MODULECPP -DNETSNMP_MINI_AGENT"
+fi
+
+test_modules="$new_module_list"
+new_module_list=""
+
+# remove modules that were explicitly excluded
+for i in $test_modules
+ do
+ if echo " $new_with_out_mib_modules " | $GREP " $i " > /dev/null; then
+ mib_cfg_msg="mib module '$i' is both included and excluded."
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mib module conflict" >&5
+$as_echo "$as_me: WARNING: mib module conflict" >&2;}
+ if test "x$with_mib_cfg_checks" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: user with : $with_mib_modules" >&5
+$as_echo "$as_me: WARNING: user with : $with_mib_modules" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: final with : $new_module_list" >&5
+$as_echo "$as_me: WARNING: final with : $new_module_list" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: user without : $with_out_mib_modules" >&5
+$as_echo "$as_me: WARNING: user without : $with_out_mib_modules" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: final without: $new_with_out_mib_modules" >&5
+$as_echo "$as_me: WARNING: final without: $new_with_out_mib_modules" >&2;}
+ as_fn_error $? "$mib_cfg_msg" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $mib_cfg_msg It will be excluded" >&5
+$as_echo "$as_me: WARNING: $mib_cfg_msg It will be excluded" >&2;}
+
+ cat >> configure-summary << EOF
+ *** MIB Module warning *** $mib_cfg_msg It has been excluded.
+EOF
+
+ fi
+ else
+ new_module_list="$new_module_list $i"
+ fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $new_module_list." >&5
+$as_echo "$new_module_list." >&6; }
+
+#---------------------
+# loop over module list
+#
+all_warnings=""
+if test "x$with_mib_cfg_debug" = "xyes"; then
+ module_debug=1
+else
+ module_debug=0
+fi
+first_pass=1
+output_to=normal
+
+if test ! -d mk ; then
+ mkdir mk
+fi
+
+
+module_rules=mk/module_rules.mk
+echo "# contents below built automatically by configure; do not edit by hand" > $module_rules
+
+#
+# make file sub-pieces
+#
+for i in module_list_deps mib_module_list_deps agent_module_list_deps ; do
+ eval "$i=mk/${i}.mk"
+ echo "# contents below built automatically by configure; do not edit by hand" > mk/${i}.mk
+done
+
+#
+# variable settings sub-pieces
+#
+for i in module_list_code mib_module_list_code agent_module_list_code module_list mib_module_list agent_module_list ; do
+ eval "$i=mk/${i}.mk"
+ echo "# contents below built automatically by configure; do not edit by hand" > mk/${i}.mk
+ echo "$i= \\" >> mk/${i}.mk
+done
+
+echo $ECHO_N "echo " $ECHO_C > mk/MODULE_LIST.mk
+MODULE_LIST=mk/MODULE_LIST.mk
+
+
+#---------------------
+# until we have an empty module list...
+# (modules may add new modules, and until all dependencies are done...)
+#
+while test "x$new_module_list" != "x"; do
+
+ if test $module_debug = 1; then
+ echo -e "\n****************************************************************"
+ fi
+
+
+
+ if test $module_debug = 1; then
+ echo "nml: $new_module_list"
+ fi
+
+
+
+ #---------------------
+ # loop over all the modules in the current list
+ #
+ for j in $new_module_list
+ do
+
+ #---------------------
+ # figure out which sub-blocks to build in parts
+ if echo "$j" | $GREP "=" ; then
+ # build a shared object file
+ # format: sofilename=module1:module2
+ # XXX: currently doesn't do this
+ dl_name=`echo $j | $SED 's/=.*//'`
+ dl_names="$dl_names $dl_name"
+ dl_objects=`echo $j | $SED 's/.*=//'`
+ module_sublist=`echo $dl_objects | $SED 's/:/ /g'`
+ saved_sublist=""
+ saved_sublist_code=""
+ output_to=separate
+
+ # create output files
+ # these actually get nuked later
+ output_inits="agent/mibgroup/${dl_name}-dll.c"
+ output_hdrs="agent/mibgroup/${dl_name}-hdrs.h"
+ else
+ # not a special token invocation
+ module_sublist=$j
+ output_to=normal
+ output_t=
+ fi
+
+ while test "x$module_sublist" != "x" ; do
+
+ #---------------------
+ # loop over all the modules in the sub list
+ for i in $module_sublist
+ do
+
+
+ if test $module_debug = 1; then
+ echo -e "\n================================================================"
+ fi
+
+
+
+ if test $module_debug = 1; then
+ echo "testing $i"
+ fi
+
+
+ need_header=0
+
+ #---------------------
+ # build a pseudo include header that includes current config and
+ # system symbols:
+ rm -f conftest.$ac_ext module_tmp_header.h
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include NETSNMP_SYSTEM_INCLUDE_FILE
+#include "$srcdir/$mibdir/$i.h"
+_ACEOF
+ mv conftest.$ac_ext module_tmp_header.h
+
+ #---------------------
+ # macro: config_belongs_in(ARG)
+ # ARG: either
+ # - mib_module => libnetsnmpmibs (default)
+ # - agent_module => libnetsnmpagent
+ #
+
+ module_type=mib_module
+ if test -f $srcdir/$mibdir/$i.h; then
+
+ module_type=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's@.*config_belongs_in(\([^)]*\)).*@\1@p'`
+
+ fi
+ if test "x$module_type" = "x" ; then
+ module_type=mib_module
+ fi
+ if test "x$output_to" = "xnormal" ; then
+ output_inits="$mibdir/${module_type}_inits.h"
+ output_hdrs="$mibdir/${module_type}_includes.h"
+ fi
+
+ #--------------------
+ # check for duplicates within the dll system.
+ # - if found in a dll, then remove from the dll and add to main
+ dblfix=""
+ for dltest in $dl_names ; do
+ eval mod_files="\"\$dl_${dltest}_files\""
+ if echo " $mod_files " | $GREP " $i " > /dev/null; then
+ # some dll module has already seen this, unload it from that list
+ # and include it in the core (again)
+
+ if test $module_debug = 1; then
+ echo "removing $i from $dltest"
+ fi
+
+
+ mod_files=`echo " $mod_files " | $SED "s@ $i @@"`
+ dblfix="__XXX__"
+ eval "dl_${dltest}_files=\"$mod_files\""
+
+ module_list="$module_list $i"
+ echo "read_config.lo: mibgroup/$i.h" >> $module_list_deps
+ if test $module_type = "agent_module" ; then
+ echo "snmp_vars.lo: mibgroup/$i.h" >> $agent_module_list_deps
+ else
+ echo "mib_modules.lo: mibgroup/$i.h" >> $mib_module_list_deps
+ fi
+ eval ${module_type}_list="\"\$${module_type}_list $i\""
+ echo " $i \\" >> $module_list_code
+ echo $ECHO_N " $i" $ECHO_C >> $MODULE_LIST
+ eval tmpfilevar=\$`echo ${module_type}_list_code`
+ echo " $i \\" >> $tmpfilevar
+
+ # XXX: add this to the main init list; this is possible not
+ # quite in the right spot any longer but we're stuck with it.
+ # Adding it back to the original ordered spot would be a
+ # nightmare. Ok, we're already in nightmare code so that
+ # wolud have to be a night-terror.
+ mnm=`echo $i | $SED 's/.*\///;s/\.c$//;'`
+ output_inits_tmp="$mibdir/${module_type}_inits.h"
+ echo " if (should_init(\"$mnm\")) init_$mnm();" >> $output_inits_tmp
+ # XXX: even worse, we loose whether the header is needed or not.
+ output_hdrs_tmp="$mibdir/${module_type}_includes.h"
+ echo '#include "'"mibgroup/$i.h"'"' >> $output_hdrs_tmp
+ fi
+ done
+
+ #---------------------
+ # make sure module wasn't explicitly excluded, or already added
+ #
+ if test "x$dblfix" != "x" ; then
+
+ if test $module_debug = 1; then
+ echo "$i was duplicated -- putting into main"
+ fi
+
+
+ elif echo " $new_with_out_mib_modules " | $GREP " $i " > /dev/null; then
+
+ if test $module_debug = 1; then
+ echo "$i was excluded"
+ fi
+
+
+ elif echo " $module_list " | $GREP " $i " > /dev/null; then
+
+ if test $module_debug = 1; then
+ echo "$i already tested"
+ fi
+
+
+ else
+
+ #---------------------
+ # process modules header, checking for config_ pseudo-macros
+ #
+
+ #---------------------
+ # does the header file for the module exist?
+ # macros are only processed if it does
+ if test -f $srcdir/$mibdir/$i.h; then
+ new_list=""
+
+ #---------------------
+ # macro: config_exclude(modules)
+ # - lists conflicts with other modules
+ # - EG: new MIB implementations exclude old and vice-versa
+ #
+ # check if $i has any conflicts
+ #
+
+ new_list_excl=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_exclude(\(.*\)).*/\1/p'`
+ if test "x$new_list_excl" != "x"; then
+
+ if test $module_debug = 1; then
+ echo "$i excludes $new_list_excl"
+ fi
+
+
+ for j in $new_list_excl
+ do
+ if echo " $module_list $new_mib_module_list $new_list_two " | $GREP " $j " > /dev/null; then
+ mib_cfg_msg="mib module '$i' excludes module '$j' but another module requires it"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mib module error" >&5
+$as_echo "$as_me: WARNING: mib module error" >&2;}
+ if test "x$with_mib_cfg_checks" = "xyes"; then
+ as_fn_error $? "$mib_cfg_msg" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $mib_cfg_msg" >&5
+$as_echo "$as_me: WARNING: $mib_cfg_msg" >&2;}
+
+ cat >> configure-summary << EOF
+ *** MIB Module warning *** $mib_cfg_msg
+EOF
+
+ fi
+ else
+ new_with_out_mib_modules="$j $new_with_out_mib_modules"
+
+ if test $module_debug = 1; then
+ echo "$j added to excluded list"
+ fi
+
+
+ fi
+ done
+ fi
+
+ #---------------------
+ # macro: config_arch_require(ARCH,modules)
+ # - lists modules required for a given ARCH
+ #
+ # check if $i has any architecture specific requirements
+ #
+
+
+ new_list_arch=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_arch_require( *\([^ ]*\) *, *\([^ ]*\) *).*/\1-xarchx-\2/p'`
+
+ if test "x$new_list_arch" != "x"; then
+ for j in $new_list_arch
+ do
+ archtest=`echo $j | $SED 's/-xarchx-.*//'`
+ # target_os may have been changed to a #define of 1...
+ if test "x$archtest" = "x1" -o "x$target_os" = "x$archtest" -o "x$PARTIALTARGETOS" = "x$archtest"; then
+ new_list="$new_list `echo $j | $SED 's/.*-xarchx-//'`"
+
+ if test $module_debug = 1; then
+ echo " $i required adding arch files: `echo $j | $SED 's/.*-xarchx-//'`"
+ fi
+
+
+ fi
+ done
+ fi
+
+ if test $module_debug = 1; then
+ echo " $i required arch files: $new_list"
+ fi
+
+
+
+ #---------------------
+ # macro: config_version_require((base, version, version-modules, ...))
+ # - lists alternative modules used from different versions.
+ #
+
+ new_list_alt3=`$MODULECPP module_tmp_header.h | \
+ $AWK '
+ BEGIN {
+ if("'"$enable_new_features"'" == "yes")
+ method="max";
+ else if("'"$enable_old_features"'" == "yes")
+ method="max-less";
+ else
+ method="max-less-equal";
+ FS = ".";
+ split("'"$with_features_of"'", a);
+ version=sprintf("%03d%03d%03d%03d", a[1], a[2], a[3], a[4]);
+ }
+ /config_version_require/ {
+ gsub("^.*config_version_require *\\\\(\\\\(", "");
+ gsub("\\\\)\\\\).*$", "");
+ gsub(", *", ",");
+ FS = ",";
+ n = split($0, a);
+ FS = ".";
+ actver = "000000000000";
+ actstr = a[1];
+ for(i = 2; i < n; i += 2) {
+ split(a[i], b);
+ curver=sprintf("%03d%03d%03d%03d", b[1], b[2], b[3], b[4]);
+ if (curver > actver && (method != "max-less" || curver < version) && (method != "max-less-equal" || curver <= version)) {
+ actver = curver;
+ actstr = a[i + 1];
+ }
+ }
+ printf(" %s", actstr);
+ }'`
+
+ if test $module_debug = 1; then
+ echo " $i required versioned features: $new_list_alt3"
+ fi
+
+
+ new_list="${new_list}${new_list_alt3}"
+
+ #---------------------
+ # macro: config_require(modules)
+ # - lists modules required for this module
+ #
+ # check if $i has any other required modules
+ #
+
+ new_list="$new_list `$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_require(\(.*\)).*/\1/p'`"
+
+ if test $module_debug = 1; then
+ echo " $i will test: $new_list"
+ fi
+
+
+ if test "x$new_list" != "x"; then
+ for j in $new_list
+ do
+
+ if test $module_debug = 1; then
+ echo -n " $i wants to add $j: "
+ fi
+
+
+ if test ! -f $srcdir/$mibdir/$j.h -a ! -f $srcdir/$mibdir/$j.c; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mib module error" >&5
+$as_echo "$as_me: WARNING: mib module error" >&2;}
+ as_fn_error $? "mib module \"$i\" requires module \"$j\" but $j.h or $j.c could not be found in $srcdir/$mibdir" "$LINENO" 5
+ elif echo " $new_with_out_mib_modules " | $GREP " $j " > /dev/null; then
+ if test "x$i" != "xdefault_modules" ; then
+ mib_cfg_msg="mib module '$i' requires module '$j' but someone told me to compile without it"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mib module error" >&5
+$as_echo "$as_me: WARNING: mib module error" >&2;}
+ if test "x$with_mib_cfg_checks" = "xyes"; then
+ as_fn_error $? "$mib_cfg_msg" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $mib_cfg_msg" >&5
+$as_echo "$as_me: WARNING: $mib_cfg_msg" >&2;}
+
+ cat >> configure-summary << EOF
+ *** MIB Module warning *** $mib_cfg_msg
+EOF
+
+ fi
+# elif echo " $module_list $new_list_two $new_module_list " | $GREP " $j " > /dev/null; then
+# AC_MSG_MODULE_DBG(" $j included previously")
+ fi
+ else
+ new_list_two="$new_list_two $j"
+
+ if test $module_debug = 1; then
+ echo " $j included"
+ fi
+
+
+ fi
+ done
+ fi
+
+ #---------------------
+ # macro: config_add_mib(SOME-MIB)
+ # - lists MIBs to be added to the default to-load list.
+ #
+ # check if $i has any mibs to add
+ #
+
+ new_mibs=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_add_mib(\(.*\)).*/\1/p'`
+ if test "x$new_mibs" != "x"; then
+ for j in $new_mibs
+ do
+ if test "x`echo :$default_mibs: | $GREP :$j:`" = "x"; then
+ default_mibs="$default_mibs:$j"
+ fi
+ if test -f $srcdir/mibs/$j.txt; then
+ if echo $default_mibs_install | $GREP " $j " > /dev/null; then
+ :
+ else
+ default_mibs_install="$default_mibs_install $j.txt"
+ fi
+ fi
+ done
+ fi # new mibs
+
+ #-------------------
+ # add the current module to the list of stuff to compile, etc.
+ #
+ # add $i to module list
+ #
+
+ if test $module_debug = 1; then
+ echo " $i added (based on $i.h)"
+ fi
+
+
+ module_list="$module_list $i"
+ eval ${module_type}_list="\"\$${module_type}_list $i\""
+
+ echo "read_config.lo: mibgroup/$i.h" >> $module_list_deps
+ if test $module_type = "agent_module" ; then
+ echo "snmp_vars.lo: mibgroup/$i.h" >> $agent_module_list_deps
+ else
+ echo "mib_modules.lo: mibgroup/$i.h" >> $mib_module_list_deps
+ fi
+
+ #-------------------
+ # check for unsupported config_load_mib
+ #
+ if $MODULECPP module_tmp_header.h | $GREP -q config_load_mib; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mib module error" >&5
+$as_echo "$as_me: WARNING: mib module error" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mib module \"$i\" uses the \"config_load_mib\" directive, which is no longer supported. It probably won't work." >&5
+$as_echo "$as_me: WARNING: mib module \"$i\" uses the \"config_load_mib\" directive, which is no longer supported. It probably won't work." >&2;}
+ fi # grep config_load_mib
+
+ #-------------------
+ # check for config_parse_dot_conf
+ # (generally not used any longer; old auto-load a .conf token)
+ #
+
+
+ $MODULECPP module_tmp_header.h | \
+ $SED -n 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@p' >> $mibdir/mib_module_dot_conf.h
+
+
+ #---------------------
+ # macro: config_error(error text)
+ # - used to signal a configuration error from a module
+ #
+ # check if $i has any errors, or warnings
+ #
+
+ error=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_error(\(.*\)).*/\1/p'`
+ if test "x$error" != "x"; then
+ echo
+ echo
+ as_fn_error $? "$i: *** $error ***" "$LINENO" 5
+ fi
+
+ #---------------------
+ # macro: config_warning(warning text)
+ # - used to signal a configuration "warning" to be printed to the user
+ #
+
+ warning=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_warning(\(.*\)).*/\1/p'`
+ if test "x$warning" != "x"; then
+ all_warnings="$all_warnings $warning
+"
+ fi
+
+ #---------------------
+ # Check for a .c file if the .h didn't exist
+ #
+ elif test -f $srcdir/$mibdir/$i.c; then
+ if echo " $module_list $new_list_two $new_module_list " | $GREP " $i " > /dev/null; then
+
+ if test $module_debug = 1; then
+ echo " $i already included"
+ fi
+
+
+ else
+
+ if test $module_debug = 1; then
+ echo " $i added (based on $i.c)"
+ fi
+
+
+ module_list="$module_list $i"
+ mib_module_list="$mib_module_list $i"
+ fi
+
+ #---------------------
+ # No .h or .c = error! (typo?)
+ #
+ else # no $i.h or $i.c
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mib module error" >&5
+$as_echo "$as_me: WARNING: mib module error" >&2;}
+ as_fn_error $? "module files $i.h or $i.c could not be found in $srcdir/$mibdir" "$LINENO" 5
+ fi # no $i.h
+
+ #-------------------
+ # check for init/shutdown routines too
+ #
+ has_c_code=no
+ if test -f $srcdir/$mibdir/$i.c; then
+ if test "x$output_to" = "xnormal" ; then
+ echo " $i \\" >> $module_list_code
+ echo $ECHO_N " $i" $ECHO_C >> $MODULE_LIST
+ eval tmpfilevar=\$`echo ${module_type}_list_code`
+ echo " $i \\" >> $tmpfilevar
+ else
+ eval "dl_${dl_name}_files=\"\$dl_${dl_name}_files $i\""
+ saved_sublist_code="$saved_sublist_code $i"
+ fi
+ mnm=`echo $i | $SED 's/.*\///;s/\.c$//;'`
+
+ if test $module_debug = 1; then
+ echo -e "\nchecking '$srcdir/$mibdir/$i.c' ($mnm/`basename $i`) C file for init/shutdown"
+ fi
+
+
+ if test "x$mnm" != "x`basename $i`"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mib module error" >&5
+$as_echo "$as_me: WARNING: mib module error" >&2;}
+ as_fn_error $? "conflicting names: $mnm != \`basename $i\`" "$LINENO" 5
+ fi
+ temp_init=`$GREP init_$mnm $srcdir/$mibdir/$i.c | $GREP -v _init_$mnm`
+ if test "x$temp_init" != "x"; then
+
+ if test $module_debug = 1; then
+ echo -e "adding init_$mnm() to list"
+ fi
+
+
+ need_header=1
+ echo " if (should_init(\"$mnm\")) init_$mnm();" >> $output_inits
+ fi
+ $GREP shutdown_$mnm $srcdir/$mibdir/$i.c > /dev/null
+ if test $? -eq 0 ; then
+ if test $module_debug -eq 1; then
+ echo -e "\nadding shutdown_$mnm() to list"
+ fi
+ need_header=1
+ echo " if (should_init(\"$mnm\")) shutdown_$mnm();" >> $mibdir/${module_type}_shutdown.h
+ fi
+ fi # test -f $srcdir/$mibdir/$i.c
+
+ #-------------------
+ # if there is a shutdown/init list,
+ #
+ if test $need_header -eq 1 ; then
+ echo '#include "'"mibgroup/$i.h"'"' >> $output_hdrs
+ else
+ echo '/*#include "'"mibgroup/$i.h"'"*/' >> $output_hdrs
+ fi
+
+ #-------------------
+ # check for output directory (for building outside of source tree
+ #
+
+ if test "x`echo $i | $SED 's/\///g;'`" != "x$i"; then
+ mnd=`echo $i | $SED 's/\/[^/]*$//;'`
+ if test ! -d ./$mibdir/$mnd; then
+ module_directories="$module_directories ./$mibdir/$mnd"
+ fi
+ fi # module directory test
+
+
+ #-------------------
+ # define USING_*_MODULE
+ #
+
+ sym="`echo ${i} | $SED 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
+
+ echo "/* Define if compiling with the ${i} module files. */" >> include/net-snmp/agent/${module_type}_config.h
+ echo "#define USING_${sym}_MODULE 1" >> include/net-snmp/agent/${module_type}_config.h
+ echo " " >> include/net-snmp/agent/${module_type}_config.h
+
+ #-------------------
+ echo $ECHO_N " $i$ECHO_C"
+ fi #
+ done # for i in $module_sublist
+
+ if test "$output_to" = "separate" ; then
+ if test "x$new_list_two" = "x" ; then
+ # no new sub-modules to add to the current target
+ output_to="normal"
+
+ dllcleans="$saved_sublist_o $dllcleans"
+ output_inits=""
+ module_sublist=""
+ else
+ # a module had sub-modules required; keep goin'
+ saved_sublist="$saved_sublist $module_sublist"
+ module_sublist="$new_list_two"
+ new_list_two=""
+ fi
+ else
+ module_sublist=""
+ fi
+
+ done # while module_sublist
+ done # for j in $new_module_list
+
+ # remember the top level modules for later reporting
+ if test $first_pass = 1 ; then
+ # remember this list for later reporting
+ top_level_modules="$new_module_list => $new_list_two"
+ first_pass=0
+ fi
+ #-------------------
+ # if $i added new modules vis config_*,
+ # check those modules for requirements too
+ #
+ # transfer the new module to check list to the normal variable
+ #
+ if test "x$new_list_two" ; then
+ output_to=normal
+ fi
+ new_module_list="$new_list_two"
+ new_list_two=""
+done # while test "x$new_module_list" != "x"; do
+echo ""
+
+#--------------------
+# construct the dll code files and make rules. This can't be done
+# until now because duplicate use of a module means it gets removed
+# from the dll and put into the main agent.
+#
+for i in $dl_names ; do
+ eval mod_files="\"\$dl_${i}_files\""
+ echo "components in the $i dll: $mod_files"
+
+ output_inits="agent/mibgroup/${i}-dll.c"
+ output_hdrs="agent/mibgroup/${i}-hdrs.h"
+
+
+ if test $module_debug = 1; then
+ echo "creating dll file: $output_inits"
+ fi
+
+
+ for ofile in $output_inits $output_hdrs ; do
+ if test -f $ofile ; then
+ if $GREP "this file created automatically by configure" $ofile > /dev/null 2>&1 ; then
+ :
+ else
+ as_fn_error $? "$ofile already existed ; can't build dll object $i" "$LINENO" 5
+ fi
+ fi
+ cat > $ofile << EOFIF
+/* xDo not edit; this file created automatically by configure */
+EOFIF
+ done
+
+ cat >> $output_inits << EOFOC
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${i}-hdrs.h"
+void
+init_$i(void) {
+EOFOC
+
+ # create the .so rule
+ saved_sublist_o=`echo "$mod_files " | $SED 's/^ *//g;s/ */.o /g;'`
+
+ # create the rules for each object
+ for j in $mod_files ; do
+ cat >> $module_rules << EOFR
+$j.o: $j.c
+ \$(CC) -c \$(CPPFLAGS) \$(CFLAGS) \$(DLFLAGS) -o \$@ \$<
+
+EOFR
+ mnm=`echo $j | $SED 's/.*\///;s/\.c$//;'`
+ echo " if (should_init(\"$mnm\")) init_$mnm();" >> $output_inits
+ done
+
+ # create the rule for the .so and wrapper code
+ cat >> $module_rules << EOFM
+${i}-dll.o: ${i}-dll.c
+ \$(CC) -c \$(CPPFLAGS) \$(CFLAGS) \$(DLFLAGS) -o \$@ \$<
+
+${i}.so: $saved_sublist_o ${i}-dll.o
+ \$(CC) \$(CPPFLAGS) \$(CFLAGS) \$(DLFLAGS) -o \$@ $saved_sublist_o ${i}-dll.o
+
+EOFM
+ cat >> $output_inits << EOFOCFIN
+}
+EOFOCFIN
+
+done
+
+# cleanup
+rm -f conftest.$ac_ext module_tmp_header.h
+
+#-------------------
+# build module lists for Makefiles
+#
+
+
+for i in module_list_o module_list_c module_list_lo module_list_ft mib_module_list_o mib_module_list_c mib_module_list_lo mib_module_list_ft mibgroup_list_o mibgroup_list_lo mibgroup_list_ft agent_module_list_o agent_module_list_c agent_module_list_lo agent_module_list_ft agentgroup_list_o agentgroup_list_lo agentgroup_list_ft ; do
+ eval "$i=mk/${i}.mk"
+done
+
+$SED 's/^module_list_code/module_list_o/;s/\([^=]\) *\\/\1.o \\/g' < $module_list_code > $module_list_o
+$SED 's/^module_list_code/module_list_c/;s/\([^=]\) *\\/\1.c \\/g' < $module_list_code > $module_list_c
+$SED 's/^module_list_code/module_list_lo/;s/\([^=]\) *\\/\1.lo \\/g' < $module_list_code > $module_list_lo
+$SED 's/^module_list_code/module_list_ft/;s/\([^=]\) *\\/\1.ft \\/g' < $module_list_code > $module_list_ft
+
+$SED 's/^mib_module_list_code/mib_module_list_o/;s/\([^=]\) *\\/\1.o \\/g' < $mib_module_list_code > $mib_module_list_o
+$SED 's/^mib_module_list_code/mib_module_list_c/;s/\([^=]\) *\\/\1.c \\/g' < $mib_module_list_code > $mib_module_list_c
+$SED 's/^mib_module_list_code/mib_module_list_lo/;s/\([^=]\) *\\/\1.lo \\/g' < $mib_module_list_code > $mib_module_list_lo
+$SED 's/^mib_module_list_code/mib_module_list_ft/;s/\([^=]\) *\\/\1.ft \\/g' < $mib_module_list_code > $mib_module_list_ft
+
+$SED 's/^mib_module_list_o/mibgroup_list_o/;s@\([^ ]*\)\.o@mibgroup/\1.o@g' < $mib_module_list_o > $mibgroup_list_o
+$SED 's/^mib_module_list_lo/mibgroup_list_lo/;s@\([^ ]*\)\.lo@mibgroup/\1.lo@g' < $mib_module_list_lo > $mibgroup_list_lo
+$SED 's/^mib_module_list_ft/mibgroup_list_ft/;s@\([^ ]*\)\.ft@mibgroup/\1.ft@g' < $mib_module_list_ft > $mibgroup_list_ft
+
+$SED 's/^agent_module_list_code/agent_module_list_o/;s/\([^=]\) *\\/\1.o \\/g' < $agent_module_list_code > $agent_module_list_o
+$SED 's/^agent_module_list_code/agent_module_list_c/;s/\([^=]\) *\\/\1.c \\/g' < $agent_module_list_code > $agent_module_list_c
+$SED 's/^agent_module_list_code/agent_module_list_lo/;s/\([^=]\) *\\/\1.lo \\/g' < $agent_module_list_code > $agent_module_list_lo
+$SED 's/^agent_module_list_code/agent_module_list_ft/;s/\([^=]\) *\\/\1.ft \\/g' < $agent_module_list_code > $agent_module_list_ft
+
+$SED 's/^agent_module_list_o/agentgroup_list_o/;s@\([^ ]*\)\.o@mibgroup/\1.o@g' < $agent_module_list_o > $agentgroup_list_o
+$SED 's/^agent_module_list_lo/agentgroup_list_lo/;s@\([^ ]*\)\.lo@mibgroup/\1.lo@g' < $agent_module_list_lo > $agentgroup_list_lo
+$SED 's/^agent_module_list_ft/agentgroup_list_ft/;s@\([^ ]*\)\.ft@mibgroup/\1.ft@g' < $agent_module_list_ft > $agentgroup_list_ft
+
+for i in module_list_o module_list_c module_list_lo module_list_ft mib_module_list_o mib_module_list_c mib_module_list_lo mib_module_list_ft mibgroup_list_o mibgroup_list_lo mibgroup_list_ft agent_module_list_o agent_module_list_c agent_module_list_lo agent_module_list_ft agentgroup_list_o agentgroup_list_lo agentgroup_list_ft ; do
+ # hpux make (at least) doesn't like a trailing \ on the last
+ # line even when the next line contains nothing but
+ # whitespace.
+ lasttoken=`awk '{lasttoken=$1}END{print lasttoken}' mk/$i.mk`
+ $SED "s#$lasttoken \\\\#$lasttoken#" < mk/$i.mk > mk/$i.mk.tmp
+ mv mk/$i.mk.tmp mk/$i.mk
+
+ # add a closing comment
+ echo "" >> mk/$i.mk
+ echo "# end configure generated code" >> mk/$i.mk
+done
+
+
+
+if test $module_debug -eq 1; then
+ echo -e "\nFinal module list: $module_list_code"
+ exit
+fi
+if test "x$with_mib_cfg_checks" = "xyes"; then
+
+ cat >> configure-summary << EOF
+ Agent Module list: $module_list_code
+EOF
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ." >&5
+$as_echo "." >&6; }
+
+if test $module_debug -eq 1; then
+
+ cat >> configure-summary << EOF
+ Agent MIB code: $module_list
+EOF
+
+fi
+
+ cat >> configure-summary << EOF
+ Agent MIB code: $top_level_modules
+EOF
+
+
+# end hairy agent module processing
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if directories need to be created" >&5
+$as_echo_n "checking if directories need to be created... " >&6; }
+for i in $module_directories; do
+ $srcdir/mkinstalldirs $i
+done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ." >&5
+$as_echo "." >&6; }
+
+#-------------------
+# Define default mibs
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default mib files to read" >&5
+$as_echo_n "checking default mib files to read... " >&6; }
+if test "x$NETSNMP_DEFAULT_MIBS" = "x"; then
+ NETSNMP_DEFAULT_MIBS="$default_mibs"
+fi
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" -o "x$PARTIALTARGETOS" = "xcygwin"; then
+ # mingw32 and cygwin use ';' as the environment variable separator char
+ ENV_SEPARATOR=";"
+ NETSNMP_DEFAULT_MIBS=`echo "$NETSNMP_DEFAULT_MIBS" | $SED 's/:/;/g'`
+ default_mibs=`echo "$default_mibs" | $SED 's/:/;/g'`
+else
+ ENV_SEPARATOR=":"
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_DEFAULT_MIBS "$NETSNMP_DEFAULT_MIBS"
+_ACEOF
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $NETSNMP_DEFAULT_MIBS" >&5
+$as_echo "$NETSNMP_DEFAULT_MIBS" >&6; }
+
+#-------------------
+# Define symbols for conditional compilation in makefiles
+#
+
+if echo " $agent_module_list " | \
+ fgrep ' agentx/agentx_config ' | \
+ fgrep ' agentx/client ' | \
+ fgrep ' agentx/protocol ' > /dev/null ; then
+ NETSNMP_HAVE_AGENTX_LIBS_TRUE=''
+ NETSNMP_HAVE_AGENTX_LIBS_FALSE='#'
+else
+ NETSNMP_HAVE_AGENTX_LIBS_TRUE='#'
+ NETSNMP_HAVE_AGENTX_LIBS_FALSE=''
+fi
+
+
+
+# -*- autoconf -*-
+#########################################
+##
+# Miscellaneous checks
+##
+#########################################
+
+##
+# Compilation-related
+##
+
+# Dynamic modules require Position-Independent Code
+# LIB_CFLAGS/DLLIBS: used in agent Makefile only
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to build PIC code" >&5
+$as_echo_n "checking whether we have to build PIC code... " >&6; }
+echo " $module_list " | $GREP " ucd-snmp/dlmod " >/dev/null
+if test $? -eq 0 ; then
+ LIB_CFLAGS="$LIB_CFLAGS $SHLIB_CFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ DLLIBS=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# -*- autoconf -*-
+#########################################
+##
+# Checks for libraries that are run
+# after the agent module tests.
+##
+#########################################
+
+# HAVE_LIB Definitions used in the Net-SNMP code base:
+#
+# HAVE_LIBCRYPTO: apps
+# HAVE_LIBRPM: agent
+#
+
+##
+# Simple checks:
+##
+
+# AC_CHECK_LIB(des, main)
+# AC_CHECK_LIB(m, asin)
+
+# dmalloc
+#
+if test "${with_dmalloc+set}" = set; then
+ if test "$with_dmalloc" = yes -a -d $with_dmalloc ; then
+
+ if test "x$with_dmalloc" != x -a -d $with_dmalloc; then
+ if test -d $with_dmalloc/lib; then
+ LDFLAGS="-L$with_dmalloc/lib $LDFLAGS"
+ fi
+ if test -d $with_dmalloc/include; then
+ CPPFLAGS="-I$with_dmalloc/include $CPPFLAGS"
+ fi
+ fi
+
+ fi
+ for ac_header in dmalloc.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "dmalloc.h" "ac_cv_header_dmalloc_h" "$ac_includes_default"
+if test "x$ac_cv_header_dmalloc_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DMALLOC_H 1
+_ACEOF
+
+fi
+
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dmalloc_message" >&5
+$as_echo_n "checking for library containing dmalloc_message... " >&6; }
+if ${ac_cv_search_dmalloc_message+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dmalloc_message ();
+int
+main ()
+{
+return dmalloc_message ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dmalloc; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_dmalloc_message=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_dmalloc_message+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_dmalloc_message+:} false; then :
+
+else
+ ac_cv_search_dmalloc_message=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dmalloc_message" >&5
+$as_echo "$ac_cv_search_dmalloc_message" >&6; }
+ac_res=$ac_cv_search_dmalloc_message
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+# EFence
+# (This used to be on by default for developer checkout)
+#
+if test "x$use_efence" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing EF_Exit" >&5
+$as_echo_n "checking for library containing EF_Exit... " >&6; }
+if ${ac_cv_search_EF_Exit+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char EF_Exit ();
+int
+main ()
+{
+return EF_Exit ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' efence; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_EF_Exit=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_EF_Exit+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_EF_Exit+:} false; then :
+
+else
+ ac_cv_search_EF_Exit=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_EF_Exit" >&5
+$as_echo "$ac_cv_search_EF_Exit" >&6; }
+ac_res=$ac_cv_search_EF_Exit
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+
+# ELF libraries
+# Typically used for 'nlist' (needed for uptime)
+#
+if test "x$with_elf" != "xno"; then
+case $target_os in
+ linux*) # add hosts which don't use nlist here
+ ;;
+ irix*) # Check for nlist in mld (irix)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist in -lelf" >&5
+$as_echo_n "checking for nlist in -lelf... " >&6; }
+if ${ac_cv_lib_elf_nlist+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lelf $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nlist ();
+int
+main ()
+{
+return nlist ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_elf_nlist=yes
+else
+ ac_cv_lib_elf_nlist=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_nlist" >&5
+$as_echo "$ac_cv_lib_elf_nlist" >&6; }
+if test "x$ac_cv_lib_elf_nlist" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBELF 1
+_ACEOF
+
+ LIBS="-lelf $LIBS"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist64 in -lelf" >&5
+$as_echo_n "checking for nlist64 in -lelf... " >&6; }
+if ${ac_cv_lib_elf_nlist64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lelf $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nlist64 ();
+int
+main ()
+{
+return nlist64 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_elf_nlist64=yes
+else
+ ac_cv_lib_elf_nlist64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_nlist64" >&5
+$as_echo "$ac_cv_lib_elf_nlist64" >&6; }
+if test "x$ac_cv_lib_elf_nlist64" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBELF 1
+_ACEOF
+
+ LIBS="-lelf $LIBS"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist in -lmld" >&5
+$as_echo_n "checking for nlist in -lmld... " >&6; }
+if ${ac_cv_lib_mld_nlist+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nlist ();
+int
+main ()
+{
+return nlist ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_mld_nlist=yes
+else
+ ac_cv_lib_mld_nlist=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mld_nlist" >&5
+$as_echo "$ac_cv_lib_mld_nlist" >&6; }
+if test "x$ac_cv_lib_mld_nlist" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBMLD 1
+_ACEOF
+
+ LIBS="-lmld $LIBS"
+
+fi
+
+ ;;
+ *) # default
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist in -lelf" >&5
+$as_echo_n "checking for nlist in -lelf... " >&6; }
+if ${ac_cv_lib_elf_nlist+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lelf $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nlist ();
+int
+main ()
+{
+return nlist ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_elf_nlist=yes
+else
+ ac_cv_lib_elf_nlist=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_nlist" >&5
+$as_echo "$ac_cv_lib_elf_nlist" >&6; }
+if test "x$ac_cv_lib_elf_nlist" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBELF 1
+_ACEOF
+
+ LIBS="-lelf $LIBS"
+
+fi
+
+ ;;
+esac
+fi
+
+
+# libsocket
+# Needed for 'socket(2)' (Solaris)
+# Possibly also for 'gethostname(3)' (non-Solaris)
+# (alternatively in libnsl (Solaris)
+# or in libws2_32) (MinGW)
+#
+case x$with_socklib in
+xwinsock2)
+ # libws2_w32 (MinGW)
+ #
+ netsnmp_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <winsock2.h>
+
+int
+main ()
+{
+
+ socket(0, 0, 0);
+ gethostbyname(0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ # Keep LIBS.
+ true
+
+else
+
+ # Restore LIBS and complain.
+ LIBS="$netsnmp_save_LIBS"
+ as_fn_error $? "libws2_32 not found." "$LINENO" 5
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ;;
+*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+$as_echo_n "checking for library containing socket... " >&6; }
+if ${ac_cv_search_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_socket=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_socket+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_socket+:} false; then :
+
+else
+ ac_cv_search_socket=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+$as_echo "$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+ as_fn_error $? "socket(2) not found." "$LINENO" 5
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
+$as_echo_n "checking for library containing gethostbyname... " >&6; }
+if ${ac_cv_search_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_gethostbyname=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_gethostbyname+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_gethostbyname+:} false; then :
+
+else
+ ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
+$as_echo "$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ for ac_func in gethostbyname
+do :
+ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETHOSTBYNAME 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyaddr" >&5
+$as_echo_n "checking for library containing gethostbyaddr... " >&6; }
+if ${ac_cv_search_gethostbyaddr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyaddr ();
+int
+main ()
+{
+return gethostbyaddr ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_gethostbyaddr=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_gethostbyaddr+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_gethostbyaddr+:} false; then :
+
+else
+ ac_cv_search_gethostbyaddr=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyaddr" >&5
+$as_echo "$ac_cv_search_gethostbyaddr" >&6; }
+ac_res=$ac_cv_search_gethostbyaddr
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ for ac_func in gethostbyaddr
+do :
+ ac_fn_c_check_func "$LINENO" "gethostbyaddr" "ac_cv_func_gethostbyaddr"
+if test "x$ac_cv_func_gethostbyaddr" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETHOSTBYADDR 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+
+
+# libiphlpapi (Cygwin and MinGW)
+#
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LIBS -liphlpapi"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <winsock2.h>
+ #include <iphlpapi.h>
+
+int
+main ()
+{
+
+ IpRenewAddress(0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ # Keep LIBS.
+ true
+
+else
+
+ # Restore LIBS and complain.
+ LIBS="$netsnmp_save_LIBS"
+ case x$with_socklib in
+ xwinsock2)
+ as_fn_error $? "libiphlpapi not found." "$LINENO" 5
+ ;;
+ esac
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
+# libregex (MinGW)
+#
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LIBS -lregex"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <regex.h>
+
+int
+main ()
+{
+
+ regcomp(0, 0, 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ # Keep LIBS.
+ true
+
+else
+
+ # Restore LIBS.
+ LIBS="$netsnmp_save_LIBS"
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
+# libsnmpapi (MinGW)
+#
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LIBS -lsnmpapi"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <snmp.h>
+
+int
+main ()
+{
+
+ SnmpUtilMemAlloc(0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ # Keep LIBS.
+ true
+
+else
+
+ # Restore LIBS.
+ LIBS="$netsnmp_save_LIBS"
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
+# kstat library (Solaris)
+#
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kstat_lookup" >&5
+$as_echo_n "checking for library containing kstat_lookup... " >&6; }
+if ${netsnmp_cv_func_kstat_lookup_LNETSNMPLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LNETSNMPLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kstat_lookup ();
+int
+main ()
+{
+return kstat_lookup ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in kstat ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kstat_lookup ();
+int
+main ()
+{
+return kstat_lookup ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_kstat_lookup_LNETSNMPLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_kstat_lookup_LNETSNMPLIBS" >&5
+$as_echo "$netsnmp_cv_func_kstat_lookup_LNETSNMPLIBS" >&6; }
+ if test "${netsnmp_cv_func_kstat_lookup_LNETSNMPLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_kstat_lookup_LNETSNMPLIBS}" != "none required" ; then
+ LNETSNMPLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+$as_echo "#define HAVE_LIBKSTAT 1" >>confdefs.h
+
+
+ fi
+
+
+
+#
+# librt
+#
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if ${netsnmp_cv_func_clock_gettime_LNETSNMPLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LNETSNMPLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in rt ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_clock_gettime_LNETSNMPLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_clock_gettime_LNETSNMPLIBS" >&5
+$as_echo "$netsnmp_cv_func_clock_gettime_LNETSNMPLIBS" >&6; }
+ if test "${netsnmp_cv_func_clock_gettime_LNETSNMPLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_clock_gettime_LNETSNMPLIBS}" != "none required" ; then
+ LNETSNMPLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
+
+ fi
+
+
+
+##
+# MIB-module-specific checks
+##
+
+# libdevstat
+# (for diskIO MIB)
+#
+# Not-Used: HAVE_GETDEVS/HAVE_DEVSTAT_GETDEVS
+#
+echo " $module_list " | $GREP " ucd-snmp/diskio " >/dev/null
+if test $? -eq 0 ; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getdevs" >&5
+$as_echo_n "checking for library containing getdevs... " >&6; }
+if ${netsnmp_cv_func_getdevs_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getdevs ();
+int
+main ()
+{
+return getdevs ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in devstat ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getdevs ();
+int
+main ()
+{
+return getdevs ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_getdevs_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_getdevs_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_getdevs_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_getdevs_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_getdevs_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+$as_echo "#define HAVE_GETDEVS 1" >>confdefs.h
+
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing devstat_getdevs" >&5
+$as_echo_n "checking for library containing devstat_getdevs... " >&6; }
+if ${netsnmp_cv_func_devstat_getdevs_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char devstat_getdevs ();
+int
+main ()
+{
+return devstat_getdevs ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in devstat ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char devstat_getdevs ();
+int
+main ()
+{
+return devstat_getdevs ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_devstat_getdevs_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_devstat_getdevs_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_devstat_getdevs_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_devstat_getdevs_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_devstat_getdevs_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+$as_echo "#define HAVE_DEVSTAT_GETDEVS 1" >>confdefs.h
+
+
+ fi
+
+fi
+
+# libpci
+# (for if-mib description)
+#
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pci_lookup_name" >&5
+$as_echo_n "checking for library containing pci_lookup_name... " >&6; }
+if ${netsnmp_cv_func_pci_lookup_name_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pci_lookup_name ();
+int
+main ()
+{
+return pci_lookup_name ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in pci ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pci_lookup_name ();
+int
+main ()
+{
+return pci_lookup_name ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_pci_lookup_name_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_pci_lookup_name_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_pci_lookup_name_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_pci_lookup_name_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_pci_lookup_name_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+$as_echo "#define HAVE_PCI_LOOKUP_NAME 1" >>confdefs.h
+
+
+ fi
+
+
+# LM-SENSORS-MIB support
+#
+echo " $module_list " | $GREP -i "ucd-snmp/lmsensor" > /dev/null
+if test $? -eq 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors support" >&5
+$as_echo_n "checking for sensors support... " >&6; }
+ case $target_os in
+ solaris*)
+ # Agent: HAVE_PICL_H
+ #
+ ac_fn_c_check_header_mongrel "$LINENO" "picl.h" "ac_cv_header_picl_h" "$ac_includes_default"
+if test "x$ac_cv_header_picl_h" = xyes; then :
+ LMIBLIBS="${LMIBLIBS} -lpicl"
+fi
+
+
+ for ac_header in picl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "picl.h" "ac_cv_header_picl_h" "$ac_includes_default"
+if test "x$ac_cv_header_picl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PICL_H 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+ *)
+ # Not-Used: HAVE_SENSORS_SENSORS_H
+ #
+ ac_fn_c_check_header_mongrel "$LINENO" "sensors/sensors.h" "ac_cv_header_sensors_sensors_h" "$ac_includes_default"
+if test "x$ac_cv_header_sensors_sensors_h" = xyes; then :
+
+else
+ as_fn_error $? "asked to use lm_sensors but I couldn't find sensors/sensors.h" "$LINENO" 5
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sensors_get_detected_chips" >&5
+$as_echo_n "checking for library containing sensors_get_detected_chips... " >&6; }
+if ${netsnmp_cv_func_sensors_get_detected_chips_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sensors_get_detected_chips ();
+int
+main ()
+{
+return sensors_get_detected_chips ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in sensors ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sensors_get_detected_chips ();
+int
+main ()
+{
+return sensors_get_detected_chips ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_sensors_get_detected_chips_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_sensors_get_detected_chips_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_sensors_get_detected_chips_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_sensors_get_detected_chips_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_sensors_get_detected_chips_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+
+ else
+ as_fn_error $? "asked to use lm_sensors but I couldn't find -lsensors" "$LINENO" 5
+ fi
+
+ ;;
+ esac
+fi
+
+#
+# libnl (netlink)
+#
+
+if test "x$with_nl" != "xno"; then
+ case $target_os in
+ linux*) # Check for libnl (linux)
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nl_connect" >&5
+$as_echo_n "checking for library containing nl_connect... " >&6; }
+if ${netsnmp_cv_func_nl_connect_LMIBLIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ netsnmp_func_search_save_LIBS="$LIBS"
+ netsnmp_target_val="$LMIBLIBS"
+ netsnmp_temp_LIBS="${netsnmp_target_val} ${LIBS}"
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nl_connect ();
+int
+main ()
+{
+return nl_connect ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result="none required"
+else
+ for netsnmp_cur_lib in nl ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nl_connect ();
+int
+main ()
+{
+return nl_connect ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ netsnmp_result=-l${netsnmp_cur_lib}
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ netsnmp_cv_func_nl_connect_LMIBLIBS="${netsnmp_result}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_func_nl_connect_LMIBLIBS" >&5
+$as_echo "$netsnmp_cv_func_nl_connect_LMIBLIBS" >&6; }
+ if test "${netsnmp_cv_func_nl_connect_LMIBLIBS}" != "no" ; then
+ if test "${netsnmp_cv_func_nl_connect_LMIBLIBS}" != "none required" ; then
+ LMIBLIBS="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+ for ac_header in netlink/netlink.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "netlink/netlink.h" "ac_cv_header_netlink_netlink_h" "$ac_includes_default"
+if test "x$ac_cv_header_netlink_netlink_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NETLINK_NETLINK_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ fi
+
+ ;;
+ esac
+fi
+
+
+
+##
+# More complex checks:
+##
+
+# Security related functions
+#
+NONAGENTLIBS=$LIBS # save old libraries
+SSHPROG=no
+TLSPROG=no
+if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then
+ # check for libpkcs11 if asked
+ if test "x$askedopenssl" != "xyes" -a "x$askedpkcs" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C_Initialize in -lpkcs11" >&5
+$as_echo_n "checking for C_Initialize in -lpkcs11... " >&6; }
+if ${ac_cv_lib_pkcs11_C_Initialize+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpkcs11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char C_Initialize ();
+int
+main ()
+{
+return C_Initialize ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pkcs11_C_Initialize=yes
+else
+ ac_cv_lib_pkcs11_C_Initialize=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pkcs11_C_Initialize" >&5
+$as_echo "$ac_cv_lib_pkcs11_C_Initialize" >&6; }
+if test "x$ac_cv_lib_pkcs11_C_Initialize" = xyes; then :
+
+$as_echo "#define HAVE_LIBPKCS11 1" >>confdefs.h
+
+ LIBPKCS11="-lpkcs11"
+fi
+
+ else
+ if test "x$tryrsaref" != "xno"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RSAPrivateDecrypt in -lrsaref" >&5
+$as_echo_n "checking for RSAPrivateDecrypt in -lrsaref... " >&6; }
+if ${ac_cv_lib_rsaref_RSAPrivateDecrypt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrsaref $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char RSAPrivateDecrypt ();
+int
+main ()
+{
+return RSAPrivateDecrypt ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rsaref_RSAPrivateDecrypt=yes
+else
+ ac_cv_lib_rsaref_RSAPrivateDecrypt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rsaref_RSAPrivateDecrypt" >&5
+$as_echo "$ac_cv_lib_rsaref_RSAPrivateDecrypt" >&6; }
+if test "x$ac_cv_lib_rsaref_RSAPrivateDecrypt" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRSAREF 1
+_ACEOF
+
+ LIBS="-lrsaref $LIBS"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RSA_PKCS1_RSAref in -lRSAglue" >&5
+$as_echo_n "checking for RSA_PKCS1_RSAref in -lRSAglue... " >&6; }
+if ${ac_cv_lib_RSAglue_RSA_PKCS1_RSAref+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lRSAglue $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char RSA_PKCS1_RSAref ();
+int
+main ()
+{
+return RSA_PKCS1_RSAref ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_RSAglue_RSA_PKCS1_RSAref=yes
+else
+ ac_cv_lib_RSAglue_RSA_PKCS1_RSAref=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_RSAglue_RSA_PKCS1_RSAref" >&5
+$as_echo "$ac_cv_lib_RSAglue_RSA_PKCS1_RSAref" >&6; }
+if test "x$ac_cv_lib_RSAglue_RSA_PKCS1_RSAref" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRSAGLUE 1
+_ACEOF
+
+ LIBS="-lRSAglue $LIBS"
+
+fi
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -leay32" >&5
+$as_echo_n "checking for -leay32... " >&6; }
+ netsnmp_save_LIBS="$LIBS"
+ LIBS="-leay32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <openssl/evp.h>
+int
+main ()
+{
+return EVP_md5();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }; ac_cv_lib_eay32_EVP_md5=yes; CRYPTO="eay32"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$netsnmp_save_LIBS"
+
+ if test x$CRYPTO = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_md5 in -lcrypto" >&5
+$as_echo_n "checking for EVP_md5 in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_EVP_md5+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char EVP_md5 ();
+int
+main ()
+{
+return EVP_md5 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_EVP_md5=yes
+else
+ ac_cv_lib_crypto_EVP_md5=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_md5" >&5
+$as_echo "$ac_cv_lib_crypto_EVP_md5" >&6; }
+if test "x$ac_cv_lib_crypto_EVP_md5" = xyes; then :
+ CRYPTO="crypto"
+fi
+
+ fi
+
+ if test x$CRYPTO != x; then
+
+$as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h
+
+ LIBCRYPTO="-l${CRYPTO}"
+ as_ac_Lib=`$as_echo "ac_cv_lib_${CRYPTO}''_AES_cfb128_encrypt" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AES_cfb128_encrypt in -l${CRYPTO}" >&5
+$as_echo_n "checking for AES_cfb128_encrypt in -l${CRYPTO}... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l${CRYPTO} $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char AES_cfb128_encrypt ();
+int
+main ()
+{
+return AES_cfb128_encrypt ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$as_ac_Lib=yes"
+else
+ eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+
+$as_echo "#define HAVE_AES_CFB128_ENCRYPT 1" >>confdefs.h
+
+fi
+
+
+ as_ac_Lib=`$as_echo "ac_cv_lib_${CRYPTO}''_EVP_MD_CTX_create" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_create in -l${CRYPTO}" >&5
+$as_echo_n "checking for EVP_MD_CTX_create in -l${CRYPTO}... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l${CRYPTO} $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char EVP_MD_CTX_create ();
+int
+main ()
+{
+return EVP_MD_CTX_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$as_ac_Lib=yes"
+else
+ eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+
+$as_echo "#define HAVE_EVP_MD_CTX_CREATE /**/" >>confdefs.h
+
+
+$as_echo "#define HAVE_EVP_MD_CTX_DESTROY /**/" >>confdefs.h
+
+fi
+
+ fi
+ if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DTLSv1_method in -lssl" >&5
+$as_echo_n "checking for DTLSv1_method in -lssl... " >&6; }
+if ${ac_cv_lib_ssl_DTLSv1_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl -lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char DTLSv1_method ();
+int
+main ()
+{
+return DTLSv1_method ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ssl_DTLSv1_method=yes
+else
+ ac_cv_lib_ssl_DTLSv1_method=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_DTLSv1_method" >&5
+$as_echo "$ac_cv_lib_ssl_DTLSv1_method" >&6; }
+if test "x$ac_cv_lib_ssl_DTLSv1_method" = xyes; then :
+
+$as_echo "#define HAVE_LIBSSL_DTLS 1" >>confdefs.h
+
+ LIBCRYPTO=" -lssl $LIBCRYPTO"
+else
+ as_fn_error $? "The DTLS based transports require the libssl library from OpenSSL to be available and support DTLS" "$LINENO" 5
+fi
+
+ TLSPROG=yes
+ fi
+ if echo " $transport_result_list " | $GREP "TLS" > /dev/null; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
+$as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
+if ${ac_cv_lib_ssl_SSL_library_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl -lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SSL_library_init ();
+int
+main ()
+{
+return SSL_library_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ssl_SSL_library_init=yes
+else
+ ac_cv_lib_ssl_SSL_library_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5
+$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; }
+if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then :
+
+$as_echo "#define HAVE_LIBSSL 1" >>confdefs.h
+
+ LIBCRYPTO=" -lssl $LIBCRYPTO"
+else
+ as_fn_error $? "The DTLS based transports require the libssl library from OpenSSL to be available" "$LINENO" 5
+fi
+
+ TLSPROG=yes
+ fi
+ if echo " $transport_result_list " | $GREP " SSH " > /dev/null; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssh2_session_startup in -lssh2" >&5
+$as_echo_n "checking for libssh2_session_startup in -lssh2... " >&6; }
+if ${ac_cv_lib_ssh2_libssh2_session_startup+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssh2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char libssh2_session_startup ();
+int
+main ()
+{
+return libssh2_session_startup ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ssh2_libssh2_session_startup=yes
+else
+ ac_cv_lib_ssh2_libssh2_session_startup=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssh2_libssh2_session_startup" >&5
+$as_echo "$ac_cv_lib_ssh2_libssh2_session_startup" >&6; }
+if test "x$ac_cv_lib_ssh2_libssh2_session_startup" = xyes; then :
+
+$as_echo "#define HAVE_LIBSSH2 1" >>confdefs.h
+
+ LIBCRYPTO=" -lssh2 $LIBCRYPTO"
+else
+ as_fn_error $? "The SSH transport requires the libssh2 library to be available" "$LINENO" 5
+fi
+
+ SSHPROG=yes
+ fi
+ fi
+elif test "x$askedpkcs" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C_Initialize in -lpkcs11" >&5
+$as_echo_n "checking for C_Initialize in -lpkcs11... " >&6; }
+if ${ac_cv_lib_pkcs11_C_Initialize+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpkcs11 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char C_Initialize ();
+int
+main ()
+{
+return C_Initialize ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pkcs11_C_Initialize=yes
+else
+ ac_cv_lib_pkcs11_C_Initialize=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pkcs11_C_Initialize" >&5
+$as_echo "$ac_cv_lib_pkcs11_C_Initialize" >&6; }
+if test "x$ac_cv_lib_pkcs11_C_Initialize" = xyes; then :
+ $as_echo "#define HAVE_LIBPKCS11 1" >>confdefs.h
+
+ LIBPKCS11="-lpkcs11"
+fi
+
+fi
+if test "x$TLSPROG" = "xyes"; then
+ ac_fn_c_check_decl "$LINENO" "EVP_sha224" "ac_cv_have_decl_EVP_sha224" "#include <openssl/evp.h>
+"
+if test "x$ac_cv_have_decl_EVP_sha224" = xyes; then :
+ :
+else
+
+$as_echo "#define HAVE_EVP_SHA224 /**/" >>confdefs.h
+
+fi
+
+ ac_fn_c_check_decl "$LINENO" "EVP_sha384" "ac_cv_have_decl_EVP_sha384" "#include <openssl/evp.h>
+"
+if test "x$ac_cv_have_decl_EVP_sha384" = xyes; then :
+ :
+else
+
+$as_echo "#define HAVE_EVP_SHA384 /**/" >>confdefs.h
+
+fi
+
+fi
+
+LIBS=$NONAGENTLIBS # restore old libraries
+if test "x$SSHPROG" = "xyes"; then
+ NETSNMP_BUILD_SSH_PROG_TRUE=''
+ NETSNMP_BUILD_SSH_PROG_FALSE='#'
+else
+ NETSNMP_BUILD_SSH_PROG_TRUE='#'
+ NETSNMP_BUILD_SSH_PROG_FALSE=''
+fi
+if test "x$TLSPROG" = "xyes" -a "x$enable_read_only" != "xyes" ; then
+ NETSNMP_BUILD_TLS_PROG_TRUE=''
+ NETSNMP_BUILD_TLS_PROG_FALSE='#'
+else
+ NETSNMP_BUILD_TLS_PROG_TRUE='#'
+ NETSNMP_BUILD_TLS_PROG_FALSE=''
+fi
+if echo " ${security_mod_list} " | grep ' usm ' ; then
+ if test "x$enable_read_only" != "xyes" ; then
+ NETSNMP_BUILD_USM_PROG_TRUE=''
+ NETSNMP_BUILD_USM_PROG_FALSE='#'
+ else
+ NETSNMP_BUILD_USM_PROG_TRUE='#'
+ NETSNMP_BUILD_USM_PROG_FALSE=''
+ fi
+else
+ NETSNMP_BUILD_USM_PROG_TRUE='#'
+ NETSNMP_BUILD_USM_PROG_FALSE=''
+fi
+if test "x$enable_read_only" != "xyes" ; then
+ NETSNMP_BUILD_SET_PROG_TRUE=""
+ NETSNMP_BUILD_SET_PROG_FALSE="#"
+else
+ NETSNMP_BUILD_SET_PROG_TRUE="#"
+ NETSNMP_BUILD_SET_PROG_FALSE=""
+fi
+
+
+
+
+
+
+
+
+
+#
+# If we're using internal crypto support we need to compile in extra files
+#
+crypto_files_c=""
+crypto_files_o=""
+crypto_files_lo=""
+if test "x$tryopenssl" != "xno" -a "x$CRYPTO" = "x"; then
+ # If we:
+ # 1) couldn't find needed openssl support
+ # 2) OR were asked to use internal support
+ # 3) AND we have the needed files
+ # then use it
+ CRYPTO="internal"
+ crypto_files_c="openssl/openssl_sha1.c openssl/openssl_md5.c openssl/openssl_set_key.c openssl/openssl_des_enc.c openssl/openssl_cbc_enc.c openssl/openssl_aes_cfb.c openssl/openssl_aes_core.c openssl/openssl_cfb128.c"
+ crypto_files_o="openssl/openssl_sha1.o openssl/openssl_md5.o openssl/openssl_set_key.o openssl/openssl_des_enc.o openssl/openssl_cbc_enc.o openssl/openssl_aes_cfb.o openssl/openssl_aes_core.oo openssl/openssl_cfb128.o"
+ crypto_files_lo="openssl/openssl_sha1.lo openssl/openssl_md5.lo openssl/openssl_set_key.lo openssl/openssl_des_enc.lo openssl/openssl_cbc_enc.lo openssl/openssl_aes_cfb.lo openssl/openssl_aes_core.lo openssl/openssl_cfb128.lo"
+ $as_echo "#define HAVE_AES_CFB128_ENCRYPT 1" >>confdefs.h
+
+fi
+
+
+
+
+#
+# if we can do any sort of crypto then note it
+#
+if test "x$CRYPTO" != "x" ; then
+
+$as_echo "#define NETSNMP_CAN_DO_CRYPTO 1" >>confdefs.h
+
+fi
+
+# TCP wrapper support
+#
+_cppflags="${CPPFLAGS}"
+_ldflags="${LDFLAGS}"
+if test "$with_libwrap" != "no"; then
+ if test "$with_libwrap" != "yes"; then
+ CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
+ LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
+ fi
+
+ _libs=${LIBS}
+ ac_fn_c_check_header_mongrel "$LINENO" "tcpd.h" "ac_cv_header_tcpd_h" "$ac_includes_default"
+if test "x$ac_cv_header_tcpd_h" = xyes; then :
+
+else
+ as_fn_error $? "Asked to use libwrap but I couldn't find tcpd.h." "$LINENO" 5
+fi
+
+
+
+ LIBS="$LIBS -lwrap"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TCP wrappers library -lwrap" >&5
+$as_echo_n "checking for TCP wrappers library -lwrap... " >&6; }
+ # XXX: should check for hosts_ctl
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <tcpd.h>
+ int allow_severity = 0;
+ int deny_severity = 0;
+int
+main ()
+{
+hosts_access((void *)0)
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ $as_echo "#define NETSNMP_USE_LIBWRAP 1" >>confdefs.h
+
+ test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
+ _wraplibs="$_wraplibs -lwrap"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ # Linux RedHat 6.1 won't link libwrap without libnsl
+ ac_fn_c_check_func "$LINENO" "yp_get_default_domain" "ac_cv_func_yp_get_default_domain"
+if test "x$ac_cv_func_yp_get_default_domain" = xyes; then :
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yp_get_default_domain in -lnsl" >&5
+$as_echo_n "checking for yp_get_default_domain in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_yp_get_default_domain+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char yp_get_default_domain ();
+int
+main ()
+{
+return yp_get_default_domain ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_yp_get_default_domain=yes
+else
+ ac_cv_lib_nsl_yp_get_default_domain=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_yp_get_default_domain" >&5
+$as_echo "$ac_cv_lib_nsl_yp_get_default_domain" >&6; }
+if test "x$ac_cv_lib_nsl_yp_get_default_domain" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
+_ACEOF
+
+ LIBS="-lnsl $LIBS"
+
+fi
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TCP wrappers library -lwrap linked with -lnsl" >&5
+$as_echo_n "checking for TCP wrappers library -lwrap linked with -lnsl... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <tcpd.h>
+ int allow_severity = 0;
+ int deny_severity = 0;
+int
+main ()
+{
+hosts_access((void *)0)
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ $as_echo "#define NETSNMP_USE_LIBWRAP 1" >>confdefs.h
+
+ test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
+ _wraplibs="$_wraplibs -lwrap -lnsl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "Asked to use libwrap but I couldn't find it." "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LAGENTLIBS="$_wraplibs"
+ CPPFLAGS=${_cppflags}
+ LDFLAGS=${_ldflags}
+ LIBS=${_libs}
+fi
+
+
+##
+# mysql
+##
+if test "x$with_mysql" = "xyes" ; then
+ for ac_prog in mysql_config
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MYSQLCONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MYSQLCONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MYSQLCONFIG="$MYSQLCONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_MYSQLCONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+MYSQLCONFIG=$ac_cv_path_MYSQLCONFIG
+if test -n "$MYSQLCONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQLCONFIG" >&5
+$as_echo "$MYSQLCONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$MYSQLCONFIG" && break
+done
+
+ for ac_header in mysql/mysql.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "mysql/mysql.h" "ac_cv_header_mysql_mysql_h" "$ac_includes_default"
+if test "x$ac_cv_header_mysql_mysql_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MYSQL_MYSQL_H 1
+_ACEOF
+
+fi
+
+done
+
+ ac_fn_c_check_header_mongrel "$LINENO" "mysql/mysql.h" "ac_cv_header_mysql_mysql_h" "$ac_includes_default"
+if test "x$ac_cv_header_mysql_mysql_h" = xyes; then :
+ mysql_h=yes
+else
+ mysql_h=no
+fi
+
+
+ if test "x$MYSQLCONFIG" = "x" -o "x$mysql_h" = "xno"; then
+ as_fn_error $? "Could not find mysql_config or mysql.h and was specifically asked to use MySQL support" "$LINENO" 5
+ fi
+ MYSQL_LIBS=`$MYSQLCONFIG --libs`
+ MYSQL_INCLUDES=`$MYSQLCONFIG --cflags`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether MY_INIT() works" >&5
+$as_echo_n "checking whether MY_INIT() works... " >&6; }
+ _libs="${LIBS}"
+ _cppflags="${CPPFLAGS}"
+ LIBS="${LIBS} ${MYSQL_LIBS}"
+ CPPFLAGS="${CPPFLAGS} ${MYSQL_INCLUDES}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <mysql/my_global.h>
+ #include <mysql/my_sys.h>
+int
+main ()
+{
+MY_INIT("my_init_test")
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define HAVE_BROKEN_LIBMYSQLCLIENT 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CPPFLAGS="${_cppflags}"
+ LIBS="${_libs}"
+
+ cat >> configure-summary << EOF
+ MYSQL Trap Logging: enabled
+EOF
+
+else
+
+ cat >> configure-summary << EOF
+ MYSQL Trap Logging: unavailable
+EOF
+
+fi
+
+
+
+
+##
+# Non-library checks
+##
+
+# nlist
+for ac_func in nlist nlist64 knlist
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+# -*- autoconf -*-
+#########################################
+##
+# Perl & Python support
+##
+#########################################
+
+##
+# Check whether Net-SNMP configuration will support Perl
+##
+
+# Inputs:
+# install_perl: whether or not to install the Perl modules
+# yes/no/try (i.e. 'maybe' - the default)
+# embed_perl: whether or not to embed Perl support within the agent
+# yes/no/try (i.e. 'maybe' - the default)
+#
+# ac_cv_path_PERLPROG: Path to perl binary
+
+
+# Embedded Perl requires Perl modules, and the perl binary
+#
+if test "x$embed_perl" = "xtry" ; then
+ if test "x$install_perl" = "xno" ; then
+ install_perl="try"
+ fi
+ if test "x$ac_cv_path_PERLPROG" = "x" -o "x$ac_cv_path_PERLPROG" = "xno" ; then
+ install_perl="no"
+ embed_perl="no"
+ fi
+fi
+
+# Perl modules require the perl binary
+#
+if test "x$install_perl" != "xno" ; then
+ myperl=$ac_cv_path_PERLPROG
+ if test $myperl = "no" ; then
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ as_fn_error $? "--enable-embedded-perl requested but no perl executable found" "$LINENO" 5
+ fi
+ fi
+fi
+
+# Perl modules require shared libraries
+#
+if test "x$install_perl" != "xno" ; then
+ if test "x$enable_shared" != "xyes"; then
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ as_fn_error $? "Perl support requires --enable-shared" "$LINENO" 5
+ fi
+ fi
+fi
+
+# Perl modules can only be installed from within the source tree
+#
+if test "x$install_perl" != "xno" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we are in the source tree so we can install Perl modules" >&5
+$as_echo_n "checking if we are in the source tree so we can install Perl modules... " >&6; }
+ if test "x$srcdir" = "x." -o -d perl/agent/default_store ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Yes" >&5
+$as_echo "Yes" >&6; }
+ else
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: No" >&5
+$as_echo "No" >&6; }
+ else
+ as_fn_error $? "Perl modules can not be built outside the source directory" "$LINENO" 5
+ fi
+ fi
+fi
+
+
+# The rest of the Perl-related checks aren't relevant
+# if we're not using the Perl modules
+#
+if test "x$install_perl" != "xno" ; then
+
+
+##
+# Check compiler compatability
+##
+
+ # What compiler was used to build the perl binary?
+ #
+ if test "xenable_perl_cc_checks" != "xno" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl cc" >&5
+$as_echo_n "checking for Perl cc... " >&6; }
+
+ PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'`
+
+ if test "x$PERLCC" != "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERLCC" >&5
+$as_echo "$PERLCC" >&6; }
+ else
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ as_fn_error $? "Could not determine the compiler that was used to build $myperl. Either set the environment variable PERLPROG to a different perl binary or use --without-perl-modules to build without Perl." "$LINENO" 5
+ fi
+ fi
+ fi
+
+ # Was GCC used to build the perl binary?
+ #
+ if test "x$install_perl" != "xno" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PERLCC is a GNU C compiler" >&5
+$as_echo_n "checking whether $PERLCC is a GNU C compiler... " >&6; }
+ OLDCC=$CC
+ CC="$PERLCC"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ perlcc_is_gnu=yes
+else
+ perlcc_is_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perlcc_is_gnu" >&5
+$as_echo "$perlcc_is_gnu" >&6; }
+ CC=$OLDCC
+
+ # Check compatability: Gnu Net-SNMP vs Non-Gnu perl
+ #
+ if test "x$GCC" = "xyes" -a "x$perlcc_is_gnu" = "xno" ; then
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ as_fn_error $? "This build is using a GNU C compiler ($CC) while Perl has been compiled with a non-GNU (or non-working) compiler ($PERLCC). This likely won't work for building with Perl support. Either specify a different compiler (--with-cc=PATH), disable this check (--disable-perl-cc-checks) or build without Perl (--without-perl-modules)." "$LINENO" 5
+ fi
+ fi
+ fi
+
+ # Check compatability: Non-Gnu Net-SNMP vs Gnu perl
+ #
+ if test "x$install_perl" != "xno" ; then
+ if test "x$GCC" != "xyes" -a "x$perlcc_is_gnu" = "xyes" ; then
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ as_fn_error $? "This build is using a non-GNU C compiler ($CC) while Perl has been compiled with a GNU compiler ($PERLCC). This likely won't work for building with Perl support. Either specify a different compiler (--with-cc=PATH), disable this check (--disable-perl-cc-checks) or build without Perl (--without-perl-modules)." "$LINENO" 5
+ fi
+ fi
+ fi
+
+ # Are we clear to proceed?
+ #
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="yes"
+ else
+ if test "x$install_perl" = "xno" ; then
+ install_perl="no"
+ embed_perl="no"
+ fi
+ fi
+
+
+##
+# Determine compilation environment needed for embedded Perl
+##
+
+# System-specific requirements
+#
+case $target_os in
+ solaris*)
+ if test "x$embed_perl" != "xno" ; then
+ # Check for LARGEFILE support (Solaris)
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for problematic Perl cc flags on Suns" >&5
+$as_echo_n "checking for problematic Perl cc flags on Suns... " >&6; }
+ if $myperl -V:ccflags | $GREP LARGEFILE > /dev/null ; then
+ if test "x$embed_perl" = "xtry" ; then
+ embed_perl="no"
+ else
+ as_fn_error $? "Perl was compiled with LARGEFILE support which will break Net-SNMP. Either set the environment variable PERLPROG to a different perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether." "$LINENO" 5
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none known" >&5
+$as_echo "none known" >&6; }
+ fi
+ fi
+ ;;
+
+ # Embedded perl typically fails on HP-UX and Mac OS X
+ # We really need to investigate why, and check for this explicitly
+ # But for the time being, turn this off by default
+ hpux*|darwin8*|darwin9*|darwin10*)
+ if test "x$embed_perl" = "xtry" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Embedded perl defaulting to off" >&5
+$as_echo "$as_me: WARNING: Embedded perl defaulting to off" >&2;}
+ embed_perl="no"
+ fi
+ ;;
+
+ *)
+ ;;
+esac
+
+# Compiler flags
+#
+if test "x$embed_perl" != "xno" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl CFLAGS" >&5
+$as_echo_n "checking for Perl CFLAGS... " >&6; }
+ perlcflags=`$myperl -MExtUtils::Embed -e ccopts`
+ if test "x$perlcflags" != "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perlcflags" >&5
+$as_echo "$perlcflags" >&6; }
+ CFLAGS="$CFLAGS $perlcflags"
+ else
+ if test "x$embed_perl" = "xtry" ; then
+ embed_perl="no"
+ else
+ as_fn_error $? "Could not determine the C compiler flags that were used to build $myperl. Either set the environment variable PERLPROG to a different Perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether." "$LINENO" 5
+ fi
+ fi
+fi
+
+# Linker flags
+#
+if test "x$embed_perl" != "xno" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl LDFLAGS" >&5
+$as_echo_n "checking for Perl LDFLAGS... " >&6; }
+ netsnmp_perlldopts=`$myperl -MExtUtils::Embed -e ldopts`
+ if test "x$netsnmp_perlldopts" != "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_perlldopts" >&5
+$as_echo "$netsnmp_perlldopts" >&6; }
+ else
+ if test "x$embed_perl" = "xtry" ; then
+ embed_perl="no"
+ else
+ as_fn_error $? "Could not determine the linker options that were used to build $myperl. Either set the environment variable PERLPROG to a different Perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether." "$LINENO" 5
+ fi
+ fi
+ if test "x$enable_as_needed" != "xno" ; then
+ # Just-in-time linking will embed the Perl library within
+ # the Net-SNMP library (rather than the agent application)
+ #
+ PERLLDOPTS_FOR_LIBS="$netsnmp_perlldopts"
+ # Perl ccdlflags (RPATH to libperl, hopefully)
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl CCDLFLAGS" >&5
+$as_echo_n "checking for Perl CCDLFLAGS... " >&6; }
+
+ netsnmp_perlccdlflags=`$myperl -V:ccdlflags | $myperl -n -e 'print $1 '"if (/^\s*ccdlflags='([^']+)';/);"`
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_perlccdlflags" >&5
+$as_echo "$netsnmp_perlccdlflags" >&6; }
+ PERLLDOPTS_FOR_APPS="$netsnmp_perlccdlflags"
+ else
+ # Otherwise embed the Perl library within the application
+ #
+ PERLLDOPTS_FOR_LIBS="$netsnmp_perlldopts"
+ # link *applications* against libperl
+ PERLLDOPTS_FOR_APPS="$netsnmp_perlldopts"
+ fi
+fi
+
+# 'Perl_eval_pv' function (and equivalents)
+#
+if test "x$embed_perl" != "xno" ; then
+ # Three possible versions of this routine:
+ # eval_pv (to 5.003_97d)
+ # perl_eval_pv (5.004/5.005)
+ # Perl_eval_pv (from 5.6ff)
+ #
+ OLDLIBS="$LIBS"
+ LIBS="$LIBS $netsnmp_perlldopts"
+ for ac_func in eval_pv
+do :
+ ac_fn_c_check_func "$LINENO" "eval_pv" "ac_cv_func_eval_pv"
+if test "x$ac_cv_func_eval_pv" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_EVAL_PV 1
+_ACEOF
+
+fi
+done
+
+ ac_fn_c_check_func "$LINENO" "perl_eval_pv" "ac_cv_func_perl_eval_pv"
+if test "x$ac_cv_func_perl_eval_pv" = xyes; then :
+
+$as_echo "#define HAVE_PERL_EVAL_PV_LC 1" >>confdefs.h
+
+fi
+
+ ac_fn_c_check_func "$LINENO" "Perl_eval_pv" "ac_cv_func_Perl_eval_pv"
+if test "x$ac_cv_func_Perl_eval_pv" = xyes; then :
+
+$as_echo "#define HAVE_PERL_EVAL_PV_UC 1" >>confdefs.h
+
+fi
+
+ LIBS="$OLDLIBS"
+ #
+ # Note that autoconf flattens case when defining tokens,
+ # so we need to explicitly distinguish between the latter two.
+
+ if test "x$ac_cv_func_perl_eval_pv" != "xyes" -a "x$ac_cv_func_Perl_eval_pv" != "xyes" -a "x$ac_cv_func_eval_pv" != "xyes" ; then
+ if test "x$embed_perl" = "xtry" ; then
+ embed_perl="no"
+ else
+ as_fn_error $? "Could not find the eval_pv, perl_eval_pv or Perl_eval_pv functions needed for embedded Perl support. Either set the environment variable PERLPROG to a different perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether." "$LINENO" 5
+ fi
+ else
+ # Activate Embedded Perl
+ #
+
+$as_echo "#define NETSNMP_EMBEDDED_PERL 1" >>confdefs.h
+
+ OTHERAGENTLIBOBJS="snmp_perl.o"
+ OTHERAGENTLIBLOBJS="snmp_perl.lo"
+ OTHERAGENTLIBLFTS="snmp_perl.ft"
+
+ EMBEDPERLINSTALL="embedperlinstall"
+ EMBEDPERLUNINSTALL="embedperluninstall"
+ embed_perl="yes"
+ fi
+else
+ EMBEDPERLINSTALL=""
+ EMBEDPERLUNINSTALL=""
+ embed_perl="no"
+ fi
+fi
+
+
+##
+# Report and configure results
+##
+
+
+
+
+
+
+# Results of Embedded Perl checks
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for potential embedded Perl support" >&5
+$as_echo_n "checking for potential embedded Perl support... " >&6; }
+if test "x$embed_perl" != "xyes" ; then
+
+ cat >> configure-summary << EOF
+ Embedded Perl support: disabled
+EOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+else
+
+ cat >> configure-summary << EOF
+ Embedded Perl support: enabled
+EOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5
+$as_echo "enabled" >&6; }
+fi
+
+# Results of Perl Module checks
+#
+PERLTARGS=""
+PERLINSTALLTARGS=""
+PERLUNINSTALLTARGS=""
+PERLFEATURES=""
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can install the Perl modules" >&5
+$as_echo_n "checking if we can install the Perl modules... " >&6; }
+if test "x$install_perl" = "xyes" ; then
+ PERLTARGS="perlmodules"
+ PERLINSTALLTARGS="perlinstall"
+ PERLUNINSTALLTARGS="perluninstall"
+ PERLFEATURES="perlfeatures"
+ if test "x$embed_perl" = "xyes" ; then
+
+ cat >> configure-summary << EOF
+ SNMP Perl modules: building -- embeddable
+EOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes -- and embeddable" >&5
+$as_echo "yes -- and embeddable" >&6; }
+ else
+
+ cat >> configure-summary << EOF
+ SNMP Perl modules: building -- not embeddable
+EOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes -- not embeddable" >&5
+$as_echo "yes -- not embeddable" >&6; }
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ cat >> configure-summary << EOF
+ SNMP Perl modules: disabled
+EOF
+
+fi
+
+
+
+
+
+
+
+# Reset LIBS to pre-libwrap value (???)
+#
+AGENTLIBS=$LIBS
+LIBS=$NONAGENTLIBS
+
+
+
+##
+# Python checks
+##
+
+PYTHONTARGS=""
+PYTHONINSTALLTARGS=""
+PYTHONUNINSTALLTARGS=""
+PYTHONCLEANTARGS=""
+PYTHONFEATURES=""
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should install the python bindings" >&5
+$as_echo_n "checking if we should install the python bindings... " >&6; }
+if test "x$install_python" = "xyes" ; then
+ PYTHONTARGS="pythonmodules"
+ PYTHONINSTALLTARGS="pythoninstall"
+ PYTHONUNINSTALLTARGS="pythonuninstall"
+ PYTHONCLEANTARGS="pythonclean"
+ PYTHONFEATURES="pythonfeatures"
+
+ cat >> configure-summary << EOF
+ SNMP Python modules: building for $PYTHONPROG
+EOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+
+ cat >> configure-summary << EOF
+ SNMP Python modules: disabled
+EOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+# -*- autoconf -*-
+#########################################
+##
+# Miscellaneous checks
+##
+#########################################
+
+##
+# Package characteristics
+# Authentication/Encryption support
+##
+
+# Check for PKCS11
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for authentication support" >&5
+$as_echo_n "checking for authentication support... " >&6; }
+useopenssl=no
+usepkcs=no
+if test "x$ac_cv_lib_pkcs11_C_Initialize" != "xyes" -o "x$ac_cv_header_security_cryptoki_h" != "xyes"; then
+ if test "x$askedpkcs" = "xyes"; then
+ as_fn_error $? "Asked to use PKCS11 but I couldn't find it." "$LINENO" 5
+ fi
+else
+ if test "x$askedpkcs" = "xyes"; then
+ usepkcs=yes
+ fi
+fi
+
+# Check for OpenSSL
+#
+if test "x$ac_cv_lib_crypto_EVP_md5" != "xyes" -a "x$ac_cv_lib_eay32_EVP_md5" != "xyes" -o "x$ac_cv_header_openssl_hmac_h" != "xyes"; then
+ if test "x$askedopenssl" = "xyes"; then
+ as_fn_error $? "Asked to use OpenSSL but I couldn't find it." "$LINENO" 5
+ fi
+else
+ if test "x$askedopenssl" = "xyes"; then
+ useopenssl=yes
+ elif test "x$tryopenssl" = "xyes"; then
+ if test "x$usepkcs" != "xyes"; then
+ useopenssl=yes
+ fi
+ fi
+fi
+
+# Available authentication/encryption modes
+#
+if test "x$CRYPTO" = "xinternal" ; then
+ authmodes="MD5 SHA1"
+ if test "x$enable_privacy" != "xno" ; then
+ encrmodes="DES AES"
+ else
+ encrmodes="disabled"
+ fi
+
+$as_echo "#define NETSNMP_USE_INTERNAL_CRYPTO 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Internal Crypto Support" >&5
+$as_echo "Internal Crypto Support" >&6; }
+elif test "x$useopenssl" != "xno" ; then
+ authmodes="MD5 SHA1"
+ if test "x$enable_privacy" != "xno" ; then
+ if test "x$ac_cv_header_openssl_aes_h" = "xyes" ; then
+ encrmodes="DES AES"
+ else
+ encrmodes="DES"
+ fi
+ else
+ encrmodes="disabled"
+ fi
+ $as_echo "#define NETSNMP_USE_OPENSSL 1" >>confdefs.h
+
+ LNETSNMPLIBS="$LNETSNMPLIBS $LIBCRYPTO"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL Support" >&5
+$as_echo "OpenSSL Support" >&6; }
+elif test "x$usepkcs" != "xno" ; then
+ authmodes="MD5 SHA1"
+ if test "x$enable_privacy" != "xno" ; then
+ encrmodes="DES"
+ else
+ encrmodes="disabled"
+ fi
+
+$as_echo "#define NETSNMP_USE_PKCS11 1" >>confdefs.h
+
+ LNETSNMPLIBS="$LNETSNMPLIBS $LIBPKCS11"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: PKCS11 Support" >&5
+$as_echo "PKCS11 Support" >&6; }
+elif test "x$enable_md5" != "xno"; then
+ authmodes="MD5"
+ encrmodes=""
+ $as_echo "#define NETSNMP_USE_INTERNAL_MD5 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Internal MD5 Support" >&5
+$as_echo "Internal MD5 Support" >&6; }
+fi
+if test "x$enable_md5" = "xno"; then
+ authmodes=`echo $authmodes | $SED 's/MD5 *//;'`
+fi
+
+
+
+
+ cat >> configure-summary << EOF
+ Crypto support from: $CRYPTO
+EOF
+
+
+ cat >> configure-summary << EOF
+ Authentication support: $authmodes
+EOF
+
+
+ cat >> configure-summary << EOF
+ Encryption support: $encrmodes
+EOF
+
+
+if test "x$all_warnings" != "x"; then
+
+ cat >> configure-summary << EOF
+ WARNING: $all_warnings
+EOF
+
+fi
+
+#
+# Check whether user wants DNSSEC local validation support
+#
+_libs=${LIBS}
+if ! test "x-$want_dnssec" = "x-no" ; then
+ for ac_header in validator/validator-config.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "validator/validator-config.h" "ac_cv_header_validator_validator_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_validator_validator_config_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VALIDATOR_VALIDATOR_CONFIG_H 1
+_ACEOF
+
+fi
+
+done
+
+ if test "$ac_cv_header_validator_validator_config_h" != yes; then
+ as_fn_error $? "Can't find validator.h" "$LINENO" 5
+ fi
+ if test "x$ac_cv_lib_crypto_EVP_md5" != "xyes" -a \
+ "x$ac_cv_lib_eay32_EVP_md5" != "xyes" -o \
+ "x$ac_cv_header_openssl_hmac_h" != "xyes"; then
+ as_fn_error $? "Couldn't find OpenSSL for local DNSSEC validation support." "$LINENO" 5
+ fi
+ LIBS="$LIBS $LIBCRYPTO"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for query_send in -lsres" >&5
+$as_echo_n "checking for query_send in -lsres... " >&6; }
+if ${ac_cv_lib_sres_query_send+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsres $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char query_send ();
+int
+main ()
+{
+return query_send ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_sres_query_send=yes
+else
+ ac_cv_lib_sres_query_send=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sres_query_send" >&5
+$as_echo "$ac_cv_lib_sres_query_send" >&6; }
+if test "x$ac_cv_lib_sres_query_send" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSRES 1
+_ACEOF
+
+ LIBS="-lsres $LIBS"
+
+else
+ as_fn_error $? "Can't find libsres" "$LINENO" 5
+fi
+
+ VAL_LIBS="-lsres $LIBCRYPTO"
+ LIBS="$LIBS -lsres"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for p_val_status in -lval" >&5
+$as_echo_n "checking for p_val_status in -lval... " >&6; }
+if ${ac_cv_lib_val_p_val_status+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lval $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char p_val_status ();
+int
+main ()
+{
+return p_val_status ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_val_p_val_status=yes
+else
+ ac_cv_lib_val_p_val_status=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_val_p_val_status" >&5
+$as_echo "$ac_cv_lib_val_p_val_status" >&6; }
+if test "x$ac_cv_lib_val_p_val_status" = xyes; then :
+ LIBS="$LIBS -lval"
+ VAL_LIBS="$VAL_LIBS -lval"
+ have_val_res_query=yes
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_init in -lpthread" >&5
+$as_echo_n "checking for pthread_rwlock_init in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_rwlock_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_rwlock_init ();
+int
+main ()
+{
+return pthread_rwlock_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_rwlock_init=yes
+else
+ ac_cv_lib_pthread_pthread_rwlock_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_init" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_rwlock_init" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_rwlock_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+ LIBS="-lpthread $LIBS"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for p_val_status in -lval-threads" >&5
+$as_echo_n "checking for p_val_status in -lval-threads... " >&6; }
+if ${ac_cv_lib_val_threads_p_val_status+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lval-threads $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char p_val_status ();
+int
+main ()
+{
+return p_val_status ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_val_threads_p_val_status=yes
+else
+ ac_cv_lib_val_threads_p_val_status=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_val_threads_p_val_status" >&5
+$as_echo "$ac_cv_lib_val_threads_p_val_status" >&6; }
+if test "x$ac_cv_lib_val_threads_p_val_status" = xyes; then :
+ have_val_res_query=yes
+ LIBS="-lval-threads $LIBS"
+ VAL_LIBS="-lval-threads -lpthread $VAL_LIBS"
+ LIBVAL_SUFFIX="-threads"
+else
+ as_fn_error $? "Can't find libval or libval-threads" "$LINENO" 5
+fi
+
+
+fi
+
+
+$as_echo "#define DNSSEC_LOCAL_VALIDATION 1" >>confdefs.h
+
+ DNSSEC="enabled"
+else
+ DNSSEC="disabled"
+fi
+
+LIBS=${_libs}
+
+
+
+ cat >> configure-summary << EOF
+ Local DNSSEC validation: $DNSSEC
+EOF
+
+
+
+
+# -*- autoconf -*-
+#########################################
+##
+# Checks for types
+##
+#########################################
+
+##
+# Standard checks:
+##
+
+# Checks for typedefs, structures, and compiler characteristics.
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+
+
+##
+# More complex checks:
+##
+
+# Check for 'socklen_t' (HP-UX)
+#
+ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+"
+if test "x$ac_cv_type_socklen_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKLEN_T 1
+_ACEOF
+
+
+fi
+
+
+
+# Check for 'in_addr_t'
+# May be in <netinet/in.h> (AIX)
+#
+ac_fn_c_check_type "$LINENO" "in_addr_t" "ac_cv_type_in_addr_t" "
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+"
+if test "x$ac_cv_type_in_addr_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_IN_ADDR_T 1
+_ACEOF
+
+
+fi
+
+
+
+# Check for 'ssize_t'
+# Not necessarily in <sys/types.h> (older MinGW)
+#
+ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+"
+if test "x$ac_cv_type_ssize_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SSIZE_T 1
+_ACEOF
+
+
+fi
+
+
+# -*- autoconf -*-
+#########################################
+##
+# Miscellaneous checks
+##
+#########################################
+
+##
+# Compilation characteristics
+##
+
+# Byte order
+#
+if test "$with_endianness" = "big"; then
+ ac_cv_c_bigendian=yes
+elif test "$with_endianness" = "little" ; then
+ ac_cv_c_bigendian=no
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "Failed to figure out host endianness, please use --with-endianness to specify it." "$LINENO" 5 ;;
+ esac
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+# -*- autoconf -*-
+#########################################
+##
+# Checks for library functions.
+##
+#########################################
+
+##
+# Standard checks:
+##
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if ${ac_cv_working_alloca_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_working_alloca_h=yes
+else
+ ac_cv_working_alloca_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if ${ac_cv_func_alloca_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca (size_t);
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_alloca_works=yes
+else
+ ac_cv_func_alloca_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+else
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if ${ac_cv_os_cray+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "webecray" >/dev/null 2>&1; then :
+ ac_cv_os_cray=yes
+else
+ ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+ break
+fi
+
+ done
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if ${ac_cv_c_stack_direction+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_c_stack_direction=0
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+
+int
+main ()
+{
+ return find_stack_direction () < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_stack_direction=1
+else
+ ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+ # alloca()
+if test $ac_cv_c_compiler_gnu = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
+if ${ac_cv_prog_gcc_traditional+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+
+if test "$cross_compiling" = yes -a "${ac_cv_func_memcmp_working+set}" != set
+then
+ # Cross-compiling and ac_cv_func_memcmp_working has not been set - assume
+ # that memcmp() is available.
+ ac_cv_func_memcmp_working=yes
+else
+ # Native compilation - test for the availability of memcmp().
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
+$as_echo_n "checking for working memcmp... " >&6; }
+if ${ac_cv_func_memcmp_working+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_memcmp_working=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Some versions of memcmp are not 8-bit clean. */
+ char c0 = '\100', c1 = '\200', c2 = '\201';
+ if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+ return 1;
+
+ /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+ or more and with at least one buffer not starting on a 4-byte boundary.
+ William Lewis provided this test program. */
+ {
+ char foo[21];
+ char bar[21];
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ char *a = foo + i;
+ char *b = bar + i;
+ strcpy (a, "--------01111111");
+ strcpy (b, "--------10000000");
+ if (memcmp (a, b, 16) >= 0)
+ return 1;
+ }
+ return 0;
+ }
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_memcmp_working=yes
+else
+ ac_cv_func_memcmp_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
+$as_echo "$ac_cv_func_memcmp_working" >&6; }
+test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
+ *" memcmp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
+ ;;
+esac
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if ${ac_cv_type_signal+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_type_signal=int
+else
+ ac_cv_type_signal=void
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+
+##
+# Stand-alone function checks:
+##
+# Core:
+for ac_func in lrand48 rand random signal sigset
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# Library:
+for ac_func in closedir fgetc_unlocked flockfile fork funlockfile getipnodebyname gettimeofday if_nametoindex mkstemp opendir readdir regcomp setenv setitimer setlocale setsid snprintf strcasestr strdup strerror strncasecmp sysconf times vsnprintf
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# IPv4/IPv6 function checks. AC_CHECK_FUNC() can't find these on MinGW
+# since these functions have the __cdecl calling convention on MinGW.
+case x$target_os in
+ xmingw*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ws2tcpip.h>
+int
+main ()
+{
+ gai_strerror(0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_gai_strerror=yes
+ $as_echo "#define HAVE_GAI_STRERROR 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ws2tcpip.h>
+int
+main ()
+{
+ getaddrinfo(NULL, NULL, NULL, NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_getaddrinfo=yes
+ $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <winsock2.h>
+int
+main ()
+{
+ gethostbyname(NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_gethostbyname=yes
+ $as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <winsock2.h>
+int
+main ()
+{
+ gethostbyaddr(NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_gethostaddr=yes
+ $as_echo "#define HAVE_GETHOSTBYADDR 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <winsock2.h>
+int
+main ()
+{
+ gethostname(NULL, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_gethostname=yes
+ $as_echo "#define HAVE_GETHOSTNAME 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ;;
+
+ *)
+ for ac_func in gai_strerror getaddrinfo gethostbyname gethostbyname2 gethostname gethostbyaddr
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+
+
+
+ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt"
+if test "x$ac_cv_func_getopt" = xyes; then :
+ $as_echo "#define HAVE_GETOPT 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" getopt.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
+if test "x$ac_cv_func_inet_ntop" = xyes; then :
+ $as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" inet_ntop.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS inet_ntop.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
+if test "x$ac_cv_func_inet_pton" = xyes; then :
+ $as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" inet_pton.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS inet_pton.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
+if test "x$ac_cv_func_strlcat" = xyes; then :
+ $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" strlcat.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strlcat.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
+if test "x$ac_cv_func_strlcpy" = xyes; then :
+ $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" strlcpy.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r"
+if test "x$ac_cv_func_strtok_r" = xyes; then :
+ $as_echo "#define HAVE_STRTOK_R 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" strtok_r.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtok_r.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol"
+if test "x$ac_cv_func_strtol" = xyes; then :
+ $as_echo "#define HAVE_STRTOL 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" strtol.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtol.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul"
+if test "x$ac_cv_func_strtoul" = xyes; then :
+ $as_echo "#define HAVE_STRTOUL 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" strtoul.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtoul.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull"
+if test "x$ac_cv_func_strtoull" = xyes; then :
+ $as_echo "#define HAVE_STRTOULL 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" strtoull.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtoull.$ac_objext"
+ ;;
+esac
+
+fi
+
+
+
+# Agent:
+for ac_func in cgetnext chown execv gai_strerror getgrnam gethostname getloadavg getpid getpwnam hasmntopt initgroups if_nameindex if_indextoname if_nametoindex localtime_r mkstemp mktime poll regcomp setgid setgroups setmntent setuid sigaction sigblock sighold sigprocmask statfs statvfs stime strncasecmp system uname usleep
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# Apps:
+for ac_func in getdtablesize getgrnam getpid getpwnam setgid setgroups setuid tcgetattr
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# Not-Used:
+for ac_func in if_freenameindex getpagesize lseek64 pread64 select sigalrm socket
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+##
+# More complex function checks:
+# (Agent)
+##
+
+# rpmGetPath check needs clean LIBS environment (Linux)
+#
+if test "x$with_rpm" != "xno"; then
+ OLDLIBS=$LIBS
+ LIBS=$LMIBLIBS
+ for ac_func in rpmGetPath
+do :
+ ac_fn_c_check_func "$LINENO" "rpmGetPath" "ac_cv_func_rpmGetPath"
+if test "x$ac_cv_func_rpmGetPath" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RPMGETPATH 1
+_ACEOF
+
+fi
+done
+
+ LIBS=$OLDLIBS
+fi
+
+# statfs( char *, struct fs_data* ) (Ultrix)
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
+$as_echo_n "checking for two-argument statfs with struct fs_data (Ultrix)... " >&6; }
+if ${fu_cv_sys_stat_fs_data+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ fu_cv_sys_stat_fs_data=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_FS_TYPES_H
+#include <sys/fs_types.h>
+#endif
+main ()
+{
+struct fs_data fsd;
+/* Ultrix's statfs returns 1 for success,
+ 0 for not mounted, -1 for failure. */
+exit (statfs (".", &fsd) != 1);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ fu_cv_sys_stat_fs_data=yes
+else
+ fu_cv_sys_stat_fs_data=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_fs_data" >&5
+$as_echo "$fu_cv_sys_stat_fs_data" >&6; }
+if test $fu_cv_sys_stat_fs_data = yes; then
+
+$as_echo "#define STAT_STATFS_FS_DATA 1" >>confdefs.h
+
+fi
+
+
+##
+# Other function-related checks:
+# (general build)
+##
+
+# How to get the name of the current function
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the name of the current function" >&5
+$as_echo_n "checking how to get the name of the current function... " >&6; }
+if ${netsnmp_cv__func__name+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ netsnmp_cv__func__name=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+const char* cp = __func__;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv__func__name=__func__
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test "$netsnmp_cv__func__name" = no ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+const char* cp = __FUNCTION__;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv__func__name=__FUNCTION__
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv__func__name" >&5
+$as_echo "$netsnmp_cv__func__name" >&6; }
+if test "$netsnmp_cv__func__name" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_FUNCTION $netsnmp_cv__func__name
+_ACEOF
+
+fi
+
+
+# Whether static inline functions are broken (SCO Unixware)
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether static inline functions are broken (Unixware)" >&5
+$as_echo_n "checking whether static inline functions are broken (Unixware)... " >&6; }
+if ${netsnmp_cv_c_broken_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+static inline int nested_inline_function(void) {
+ return 0;
+}
+inline int main_inline_function( void ) {
+ return nested_inline_function();
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_broken_inline=no
+else
+ netsnmp_cv_broken_inline=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_c_broken_inline" >&5
+$as_echo "$netsnmp_cv_c_broken_inline" >&6; }
+
+
+# Yes - static inline functions are broken (Solaris 2.x)
+#
+case "$target_os" in
+ solaris*)
+ netsnmp_cv_broken_inline=yes
+ ;;
+ *)
+ ;;
+esac
+
+if test "$netsnmp_cv_broken_inline" = yes ; then
+
+$as_echo "#define NETSNMP_BROKEN_INLINE 1" >>confdefs.h
+
+fi
+
+
+##
+# Mis-placed (non-function) checks:
+##
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIOCGIFADDR in sys/ioctl.h" >&5
+$as_echo_n "checking for SIOCGIFADDR in sys/ioctl.h... " >&6; }
+if ${netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#ifndef SIOCGIFADDR
+No SIOCGIFADDR found here.
+#endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR=yes
+else
+ netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR" >&5
+$as_echo "$netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR" >&6; }
+if test $netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR = yes; then
+
+$as_echo "#define SYS_IOCTL_H_HAS_SIOCGIFADDR 1" >>confdefs.h
+
+fi
+
+##
+# Check how to print a size_t variable
+##
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the underlying type of a size_t" >&5
+$as_echo_n "checking the underlying type of a size_t... " >&6; }
+if ${netsnmp_cv_size_t_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if [ x$netsnmp_cv_size_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned int variable;
+extern size_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_size_t_type="int"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if [ x$netsnmp_cv_size_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned long variable;
+extern size_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_size_t_type="long"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if [ x$netsnmp_cv_size_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned long long variable;
+extern size_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_size_t_type="long long"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if [ x$netsnmp_cv_size_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned short variable;
+extern size_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_size_t_type="short"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if [ x$netsnmp_cv_size_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned char variable;
+extern size_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_size_t_type="char"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_size_t_type" >&5
+$as_echo "$netsnmp_cv_size_t_type" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to printf a size_t" >&5
+$as_echo_n "checking how to printf a size_t... " >&6; }
+case "$netsnmp_cv_size_t_type" in
+ char|short|int) netsnmp_PRIz="" ;;
+ long) netsnmp_PRIz="l" ;;
+ "long long") netsnmp_PRIz="ll" ;;
+ *) as_fn_error $? "underlying type of size_t not known" "$LINENO" 5 ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_PRIz" >&5
+$as_echo "$netsnmp_PRIz" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_PRIz "$netsnmp_PRIz"
+_ACEOF
+
+
+##
+# Check how to print a uint32_t variable
+##
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the underlying type of an uint32_t" >&5
+$as_echo_n "checking the underlying type of an uint32_t... " >&6; }
+if ${netsnmp_cv_uint32_t_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if [ x$netsnmp_cv_uint32_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned char variable;
+extern uint32_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_uint32_t_type="char"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if [ x$netsnmp_cv_uint32_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned short variable;
+extern uint32_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_uint32_t_type="short"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if [ x$netsnmp_cv_uint32_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned int variable;
+extern uint32_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_uint32_t_type="int"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if [ x$netsnmp_cv_uint32_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned long variable;
+extern uint32_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_uint32_t_type="long"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if [ x$netsnmp_cv_uint32_t_type = x ] ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+extern unsigned long long variable;
+extern uint32_t variable;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_cv_uint32_t_type="long long"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_cv_uint32_t_type" >&5
+$as_echo "$netsnmp_cv_uint32_t_type" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to printf a uint32_t" >&5
+$as_echo_n "checking how to printf a uint32_t... " >&6; }
+case "$netsnmp_cv_uint32_t_type" in
+ char|short|int) netsnmp_PRI32="" ;;
+ long) netsnmp_PRI32="l" ;;
+ "long long") netsnmp_PRI32="ll" ;;
+ *) as_fn_error $? "underlying type of uint32_t not known" "$LINENO" 5 ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_PRI32" >&5
+$as_echo "$netsnmp_PRI32" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define NETSNMP_PRI32 "$netsnmp_PRI32"
+_ACEOF
+
+
+# check to see if the openssl is good enough for DTLS
+# (BIO_dgram_get_peer is a macro, not a true function)
+if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then
+ if ${netsnmp_cv_bio_dgram_get_peer+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIO_dgram_get_peer" >&5
+$as_echo_n "checking for BIO_dgram_get_peer... " >&6; }
+
+ oldLIBS="$LIBS"
+ LIBS="$LIBS -lcrypto"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <openssl/bio.h>
+int
+main ()
+{
+BIO_dgram_get_peer(NULL, NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+ as_fn_error $? "DTLS support requires a newer version of OpenSSL" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ LIBS="$oldLIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+fi
+
+
+# -*- autoconf -*-
+#########################################
+##
+# Checks for data structures & members
+##
+#########################################
+
+##
+# Simple checks:
+##
+
+# struct arphd
+# Agent:
+#
+ac_fn_c_check_member "$LINENO" "struct arphd" "at_next" "ac_cv_member_struct_arphd_at_next" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <net/if.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IF_ETHER_H
+#include <netinet/if_ether.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_arphd_at_next" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_ARPHD_AT_NEXT 1
+_ACEOF
+
+
+fi
+
+
+# struct des_ks_struct
+# ('weak_key' indicates older version of OpenSSL)
+# Library:
+#
+if test "x$ac_cv_header_openssl_des_h" = "xyes" ; then
+ ac_fn_c_check_member "$LINENO" "struct des_ks_struct" "weak_key" "ac_cv_member_struct_des_ks_struct_weak_key" "
+#ifdef HAVE_OPENSSL_DES_H
+#include <openssl/des.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_des_ks_struct_weak_key" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_DES_KS_STRUCT_WEAK_KEY 1
+_ACEOF
+
+
+fi
+
+fi
+
+# struct dirent
+# (see also AC_STRUCT_DIRENT_D_TYPE)
+# Library:
+#
+ac_fn_c_check_member "$LINENO" "struct dirent" "d_type" "ac_cv_member_struct_dirent_d_type" "
+ $ac_includes_default
+
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_dirent_d_type" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_DIRENT_D_TYPE 1
+_ACEOF
+
+
+fi
+
+
+# struct ethtool_cmd
+#
+if test "x$ac_cv_header_linux_ethtool_h" = "xyes" ; then
+ac_fn_c_check_member "$LINENO" "struct ethtool_cmd" "speed_hi" "ac_cv_member_struct_ethtool_cmd_speed_hi" "
+ $ac_includes_default
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+#include <linux/ethtool.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ethtool_cmd_speed_hi" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_ETHTOOL_CMD_SPEED_HI 1
+_ACEOF
+
+
+fi
+
+fi
+
+# struct ipstat
+# Agent:
+#
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_cantfrag" "ac_cv_member_struct_ipstat_ips_cantfrag" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_cantfrag" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_CANTFRAG 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_delivered" "ac_cv_member_struct_ipstat_ips_delivered" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_delivered" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_DELIVERED 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_fragdropped" "ac_cv_member_struct_ipstat_ips_fragdropped" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_fragdropped" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_FRAGDROPPED 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_fragmented" "ac_cv_member_struct_ipstat_ips_fragmented" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_fragmented" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_FRAGMENTED 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_localout" "ac_cv_member_struct_ipstat_ips_localout" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_localout" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_LOCALOUT 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_noproto" "ac_cv_member_struct_ipstat_ips_noproto" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_noproto" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_NOPROTO 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_noroute" "ac_cv_member_struct_ipstat_ips_noroute" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_noroute" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_NOROUTE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_odropped" "ac_cv_member_struct_ipstat_ips_odropped" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_odropped" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_ODROPPED 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_ofragments" "ac_cv_member_struct_ipstat_ips_ofragments" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_ofragments" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_OFRAGMENTS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_reassembled" "ac_cv_member_struct_ipstat_ips_reassembled" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_reassembled" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_REASSEMBLED 1
+_ACEOF
+
+
+fi
+
+#
+# Not-Used:
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_cantforward" "ac_cv_member_struct_ipstat_ips_cantforward" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_cantforward" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_CANTFORWARD 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_fragtimeout" "ac_cv_member_struct_ipstat_ips_fragtimeout" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ipstat_ips_fragtimeout" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IPSTAT_IPS_FRAGTIMEOUT 1
+_ACEOF
+
+
+fi
+
+
+# struct mbstat
+# Not-Used:
+#
+ac_fn_c_check_member "$LINENO" "struct mbstat" "m_clusters" "ac_cv_member_struct_mbstat_m_clusters" "
+ $ac_includes_default
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MBUF_H
+#include <sys/mbuf.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_mbstat_m_clusters" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_MBSTAT_M_CLUSTERS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct mbstat" "m_clfree" "ac_cv_member_struct_mbstat_m_clfree" "
+ $ac_includes_default
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MBUF_H
+#include <sys/mbuf.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_mbstat_m_clfree" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_MBSTAT_M_CLFREE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct mbstat" "m_mbufs" "ac_cv_member_struct_mbstat_m_mbufs" "
+ $ac_includes_default
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MBUF_H
+#include <sys/mbuf.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_mbstat_m_mbufs" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_MBSTAT_M_MBUFS 1
+_ACEOF
+
+
+fi
+
+
+# struct nlist
+#
+ac_fn_c_check_member "$LINENO" "struct nlist" "n_value" "ac_cv_member_struct_nlist_n_value" "
+ $ac_includes_default
+
+#if HAVE_NLIST_H
+#include <nlist.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_nlist_n_value" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_NLIST_N_VALUE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct nlist64" "n_value" "ac_cv_member_struct_nlist64_n_value" "
+ $ac_includes_default
+
+#if HAVE_NLIST_H
+#include <nlist.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_nlist64_n_value" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_NLIST64_N_VALUE 1
+_ACEOF
+
+
+fi
+
+
+# struct sigaction
+# Agent:
+#
+ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SIGNAL_H
+#include <sys/signal.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1
+_ACEOF
+
+
+fi
+
+
+# struct sockaddr
+# Library:
+#
+ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#elif defined(HAVE_WINSOCK2_H)
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_union.sa_generic.sa_family2" "ac_cv_member_struct_sockaddr_sa_union_sa_generic_sa_family2" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#elif defined(HAVE_WINSOCK2_H)
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_sa_union_sa_generic_sa_family2" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_SA_UNION_SA_GENERIC_SA_FAMILY2 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#elif defined(HAVE_WINSOCK2_H)
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#elif defined(HAVE_WINSOCK2_H)
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
+_ACEOF
+
+
+fi
+
+
+# struct sockaddr_in6 (see RFC 2553)
+# Library:
+#
+ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_scope_id" "ac_cv_member_struct_sockaddr_in6_sin6_scope_id" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_in6_sin6_scope_id" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1
+_ACEOF
+
+
+fi
+
+
+# struct msghdr
+# Library:
+#
+ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_MSGHDR_MSG_CONTROL 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_flags" "ac_cv_member_struct_msghdr_msg_flags" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_msghdr_msg_flags" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_MSGHDR_MSG_FLAGS 1
+_ACEOF
+
+
+fi
+
+
+# struct sockaddr_un
+# Library:
+#
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of sockaddr_un.sun_path" >&5
+$as_echo_n "checking size of sockaddr_un.sun_path... " >&6; }
+if ${ac_cv_sizeof_sockaddr_un_sun_path+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (sockaddr_un.sun_path))" "ac_cv_sizeof_sockaddr_un_sun_path" "
+ $ac_includes_default
+
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+struct sockaddr_un sockaddr_un;
+
+"; then :
+
+else
+ if test "$ac_cv_type_sockaddr_un_sun_path" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (sockaddr_un.sun_path)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_sockaddr_un_sun_path=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_sockaddr_un_sun_path" >&5
+$as_echo "$ac_cv_sizeof_sockaddr_un_sun_path" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SOCKADDR_UN_SUN_PATH $ac_cv_sizeof_sockaddr_un_sun_path
+_ACEOF
+
+
+
+# struct statfs
+# Agent:
+#
+ac_fn_c_check_member "$LINENO" "struct statfs" "f_favail" "ac_cv_member_struct_statfs_f_favail" "
+ $ac_includes_default
+
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_NBUTIL_H
+#include <nbutil.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_statfs_f_favail" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATFS_F_FAVAIL 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct statfs" "f_ffree" "ac_cv_member_struct_statfs_f_ffree" "
+ $ac_includes_default
+
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_NBUTIL_H
+#include <nbutil.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_statfs_f_ffree" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATFS_F_FFREE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct statfs" "f_files" "ac_cv_member_struct_statfs_f_files" "
+ $ac_includes_default
+
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_NBUTIL_H
+#include <nbutil.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_statfs_f_files" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATFS_F_FILES 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct statfs" "f_flags" "ac_cv_member_struct_statfs_f_flags" "
+ $ac_includes_default
+
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_NBUTIL_H
+#include <nbutil.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_statfs_f_flags" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATFS_F_FLAGS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct statfs" "f_frsize" "ac_cv_member_struct_statfs_f_frsize" "
+ $ac_includes_default
+
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_NBUTIL_H
+#include <nbutil.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_statfs_f_frsize" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATFS_F_FRSIZE 1
+_ACEOF
+
+
+fi
+
+
+# struct statvfs
+# Agent:
+#
+ac_fn_c_check_member "$LINENO" "struct statvfs" "f_files" "ac_cv_member_struct_statvfs_f_files" "
+ $ac_includes_default
+
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_statvfs_f_files" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATVFS_F_FILES 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct statvfs" "f_frsize" "ac_cv_member_struct_statvfs_f_frsize" "
+ $ac_includes_default
+
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_statvfs_f_frsize" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATVFS_F_FRSIZE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct statvfs" "mnt_dir" "ac_cv_member_struct_statvfs_mnt_dir" "
+ $ac_includes_default
+
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_statvfs_mnt_dir" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATVFS_MNT_DIR 1
+_ACEOF
+
+
+fi
+
+
+# struct swdevt
+# Not-Used:
+#
+ac_fn_c_check_member "$LINENO" "struct swdevt" "sw_nblksenabled" "ac_cv_member_struct_swdevt_sw_nblksenabled" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_CONF_H
+#include <sys/conf.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_swdevt_sw_nblksenabled" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SWDEVT_SW_NBLKSENABLED 1
+_ACEOF
+
+
+fi
+
+
+# struct tcpstat
+# Agent:
+#
+ac_fn_c_check_member "$LINENO" "struct tcpstat" "tcp_rcvmemdrop" "ac_cv_member_struct_tcpstat_tcp_rcvmemdrop" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_TIMEOUT_H
+#include <sys/timeout.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#ifdef HAVE_NETINET_TCP_TIMER_H
+#include <netinet/tcp_timer.h>
+#endif
+#ifdef HAVE_NETINET_TCP_VAR_H
+#include <netinet/tcp_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_tcpstat_tcp_rcvmemdrop" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TCPSTAT_TCP_RCVMEMDROP 1
+_ACEOF
+
+
+fi
+
+
+# struct tm
+# Library:
+#
+ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "
+ $ac_includes_default
+
+#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 test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TM_TM_GMTOFF 1
+_ACEOF
+
+
+fi
+
+
+# extern timezone
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking extern timezone" >&5
+$as_echo_n "checking extern timezone... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.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
+
+int
+main ()
+{
+
+ return timezone;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_TIMEZONE_VARIABLE 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+# struct timezone
+# Library:
+#
+ac_fn_c_check_member "$LINENO" "struct timezone" "tz_dsttime" "ac_cv_member_struct_timezone_tz_dsttime" "
+ $ac_includes_default
+
+#ifdef HAVE_SYS_TIMEB_H
+# include <sys/timeb.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+"
+if test "x$ac_cv_member_struct_timezone_tz_dsttime" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TIMEZONE_TZ_DSTTIME 1
+_ACEOF
+
+
+fi
+
+
+# struct udpstat
+# Agent:
+#
+ac_fn_c_check_member "$LINENO" "struct udpstat" "udps_discard" "ac_cv_member_struct_udpstat_udps_discard" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_udpstat_udps_discard" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UDPSTAT_UDPS_DISCARD 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct udpstat" "udps_fullsock" "ac_cv_member_struct_udpstat_udps_fullsock" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_udpstat_udps_fullsock" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UDPSTAT_UDPS_FULLSOCK 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct udpstat" "udps_noport" "ac_cv_member_struct_udpstat_udps_noport" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_udpstat_udps_noport" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UDPSTAT_UDPS_NOPORT 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct udpstat" "udps_noportbcast" "ac_cv_member_struct_udpstat_udps_noportbcast" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_udpstat_udps_noportbcast" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UDPSTAT_UDPS_NOPORTBCAST 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct udpstat" "udps_opackets" "ac_cv_member_struct_udpstat_udps_opackets" "
+ $ac_includes_default
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_udpstat_udps_opackets" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UDPSTAT_UDPS_OPACKETS 1
+_ACEOF
+
+
+fi
+
+
+
+
+##
+# ifnet-related checks:
+##
+
+# Does "struct ifnet" need _KERNEL defined? (Irix)
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if _KERNEL needs to be defined for if_mtu" >&5
+$as_echo_n "checking if _KERNEL needs to be defined for if_mtu... " >&6; }
+if ${ac_cv_IFNET_NEEDS_KERNEL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_IFNET_NEEDS_KERNEL=unknown
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+
+int
+main ()
+{
+struct ifnet test; test.if_mtu = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_IFNET_NEEDS_KERNEL=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test "$ac_cv_IFNET_NEEDS_KERNEL" = unknown ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _KERNEL 1
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+
+int
+main ()
+{
+struct ifnet test; test.if_mtu = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_IFNET_NEEDS_KERNEL=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_IFNET_NEEDS_KERNEL" >&5
+$as_echo "$ac_cv_IFNET_NEEDS_KERNEL" >&6; }
+
+if test "x$ac_cv_IFNET_NEEDS_KERNEL" = "xyes"; then
+
+$as_echo "#define NETSNMP_IFNET_NEEDS_KERNEL 1" >>confdefs.h
+
+fi
+
+# Does "struct ifnet" need _KERNEL_STRUCTURES defined? (DragonFly 3)
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if _KERNEL_STRUCTURES needs to be defined for if_mtu" >&5
+$as_echo_n "checking if _KERNEL_STRUCTURES needs to be defined for if_mtu... " >&6; }
+if ${ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES=unknown
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+
+int
+main ()
+{
+struct ifnet test; test.if_mtu = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test "$ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES" = unknown ; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _KERNEL_STRUCTURES 1
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+
+int
+main ()
+{
+struct ifnet test; test.if_mtu = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES" >&5
+$as_echo "$ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES" >&6; }
+
+if test "x$ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES" = "xyes"; then
+
+$as_echo "#define NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES 1" >>confdefs.h
+
+fi
+
+
+# struct ifaddr
+# Not-Used:
+#
+ac_fn_c_check_member "$LINENO" "struct ifaddr" "ifa_next" "ac_cv_member_struct_ifaddr_ifa_next" "
+
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+
+ $ac_includes_default
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifaddr_ifa_next" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFADDR_IFA_NEXT 1
+_ACEOF
+
+
+fi
+
+
+# struct ifnet
+# (Broken on FreeBSD - #define'd in <net/if.h>)
+# Agent: (?or Not-Used?)
+#
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_addrlist" "ac_cv_member_struct_ifnet_if_addrlist" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_addrlist" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_ADDRLIST 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_addrhead.tqh_first" "ac_cv_member_struct_ifnet_if_addrhead_tqh_first" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_addrhead_tqh_first" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_ADDRHEAD_TQH_FIRST 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_baudrate" "ac_cv_member_struct_ifnet_if_baudrate" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_baudrate" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_BAUDRATE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_baudrate.ifs_value" "ac_cv_member_struct_ifnet_if_baudrate_ifs_value" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_baudrate_ifs_value" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_BAUDRATE_IFS_VALUE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_ibytes" "ac_cv_member_struct_ifnet_if_ibytes" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_ibytes" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_IBYTES 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_imcasts" "ac_cv_member_struct_ifnet_if_imcasts" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_imcasts" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_IMCASTS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_iqdrops" "ac_cv_member_struct_ifnet_if_iqdrops" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_iqdrops" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_IQDROPS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_lastchange.tv_sec" "ac_cv_member_struct_ifnet_if_lastchange_tv_sec" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_lastchange_tv_sec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_SEC 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_lastchange.tv_nsec" "ac_cv_member_struct_ifnet_if_lastchange_tv_nsec" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_lastchange_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_NSEC 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_mtu" "ac_cv_member_struct_ifnet_if_mtu" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_mtu" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_MTU 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_noproto" "ac_cv_member_struct_ifnet_if_noproto" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_noproto" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_NOPROTO 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_obytes" "ac_cv_member_struct_ifnet_if_obytes" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_obytes" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_OBYTES 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_omcasts" "ac_cv_member_struct_ifnet_if_omcasts" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_omcasts" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_OMCASTS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_speed" "ac_cv_member_struct_ifnet_if_speed" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_speed" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_SPEED 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_type" "ac_cv_member_struct_ifnet_if_type" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_type" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_TYPE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifnet" "if_xname" "ac_cv_member_struct_ifnet_if_xname" "
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. \"en\" or \"lo\" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+
+"
+if test "x$ac_cv_member_struct_ifnet_if_xname" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFNET_IF_XNAME 1
+_ACEOF
+
+
+fi
+
+
+
+##
+# rtentry structure checks:
+##
+
+# Check struct rtentry for common fields
+# Agent:
+#
+ac_fn_c_check_member "$LINENO" "struct rtentry" "rt_dst" "ac_cv_member_struct_rtentry_rt_dst" "
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#endif
+#ifdef HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_rtentry_rt_dst" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_RTENTRY_RT_DST 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct rtentry" "rt_hash" "ac_cv_member_struct_rtentry_rt_hash" "
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#endif
+#ifdef HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_rtentry_rt_hash" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_RTENTRY_RT_HASH 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct rtentry" "rt_next" "ac_cv_member_struct_rtentry_rt_next" "
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#endif
+#ifdef HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_rtentry_rt_next" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_RTENTRY_RT_NEXT 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct rtentry" "rt_refcnt" "ac_cv_member_struct_rtentry_rt_refcnt" "
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#endif
+#ifdef HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_rtentry_rt_refcnt" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_RTENTRY_RT_REFCNT 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct rtentry" "rt_unit" "ac_cv_member_struct_rtentry_rt_unit" "
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#endif
+#ifdef HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_rtentry_rt_unit" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_RTENTRY_RT_UNIT 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct rtentry" "rt_use" "ac_cv_member_struct_rtentry_rt_use" "
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#endif
+#ifdef HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_rtentry_rt_use" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_RTENTRY_RT_USE 1
+_ACEOF
+
+
+fi
+
+
+
+# Check for BSD 4.3 vs 4.4 struct rtentry
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of rtentry structure" >&5
+$as_echo_n "checking type of rtentry structure... " >&6; }
+if ${ac_cv_RTENTRY_TYPE+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # BSD 4.4 compatible structure
+ # ('rt_nodes' array)
+ #
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#include <net/route.h>
+
+int
+main ()
+{
+
+
+#ifndef HAVE_STRUCT_RTENTRY_RT_DST
+#define rt_dst rt_nodes->rn_key
+#endif
+
+ struct rtentry rt;
+ rt.rt_nodes[0].rn_flags = 1;
+ rt.rt_dst;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_RTENTRY_TYPE="BSD-4.4"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ if test "x$ac_cv_RTENTRY_TYPE" = "x"; then
+ # BSD 4.3 compatible structure
+ # ('rt_hash')
+ #
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#include <net/route.h>
+
+int
+main ()
+{
+
+
+struct rtentry rt;
+rt.rt_hash;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_RTENTRY_TYPE="BSD-4.3"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+ if test "x$ac_cv_RTENTRY_TYPE" = "x"; then
+ # Neither BSD 4.3 nor 4.4 compatible structure
+ #
+ ac_cv_RTENTRY_TYPE="unknown"
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_RTENTRY_TYPE" >&5
+$as_echo "$ac_cv_RTENTRY_TYPE" >&6; }
+
+if test "x$ac_cv_RTENTRY_TYPE" = "xBSD-4.4"; then
+
+$as_echo "#define RTENTRY_4_4 1" >>confdefs.h
+
+fi
+
+# Check for ortentry (Alpha)
+#
+if test "x$ac_cv_RTENTRY_TYPE" = "xunknown"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rtentry" >&5
+$as_echo_n "checking for struct rtentry... " >&6; }
+if ${ac_cv_struct_rtentry+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define KERNEL
+#include <net/route.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "ortentry" >/dev/null 2>&1; then :
+ ac_cv_struct_rtentry=ortentry
+else
+ ac_cv_struct_rtentry=rtentry
+fi
+rm -f conftest*
+
+ if test "x$ac_cv_struct_rtentry" = "xrtentry" ; then
+ ac_cv_struct_rtentry="rtentry"
+ else
+ ac_cv_struct_rtentry="ortentry"
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_rtentry" >&5
+$as_echo "$ac_cv_struct_rtentry" >&6; }
+else
+ RTENTRY_TYPE="rtentry"
+ ac_cv_struct_rtentry="rtentry"
+fi
+
+if test "x$ac_cv_struct_rtentry" = "x"; then
+ ac_cv_struct_rtentry=rtentry
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define RTENTRY struct ${ac_cv_struct_rtentry}
+_ACEOF
+
+
+
+# -*- autoconf -*-
+#########################################
+##
+# Miscellaneous Operating-System characteristics
+##
+#########################################
+
+
+# Determine how to test for character devices
+# [We assume that /dev/null does actually exist!]
+#
+if test -c /dev/null; then
+ CDEV_TEST_FLAG="-c"
+elif test -f /dev/null; then
+ CDEV_TEST_FLAG="-f"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't reliably detect character devices" >&5
+$as_echo "$as_me: WARNING: Can't reliably detect character devices" >&2;}
+ # Is it actually sensible to fall back on "test -f" ?
+ CDEV_TEST_FLAG="-f"
+fi
+
+# Kernel Location
+# used in library/agent
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of system kernel" >&5
+$as_echo_n "checking for location of system kernel... " >&6; }
+if ${ac_cv_KERNEL_LOC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_KERNEL_LOC="unknown"
+ for i in /vmunix /hp-ux /stand/vmunix /dev/ksyms /kernel/unix /kernel/genunix /netbsd /unix /kernel /bsd /mach_kernel /boot/kernel/kernel
+ do
+ if test $CDEV_TEST_FLAG $i; then
+ ac_cv_KERNEL_LOC="$i"
+ break;
+ fi
+ done
+ #
+ # In principle, this test is meant to provide a default path to the kernel
+ # In practice, the test is broken and the kernel path is set to "unknown"
+ #
+ # Note that on certain systems (e.g. some Linux distributions),
+ # it is impossible to predict the name of the kernel,
+ # particularly if it includes the kernel version, architecture, etc
+ #
+ # Since this default will never actually be used, then don't try to set it
+ #
+ if test $i = "unknown"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find system kernel... hopefully this won't be needed!" >&5
+$as_echo "$as_me: WARNING: Can't find system kernel... hopefully this won't be needed!" >&2;}
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_KERNEL_LOC" >&5
+$as_echo "$ac_cv_KERNEL_LOC" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define KERNEL_LOC "$ac_cv_KERNEL_LOC"
+_ACEOF
+
+
+
+# /dev/kmem existence
+# used in agent only
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/kmem" >&5
+$as_echo_n "checking for /dev/kmem... " >&6; }
+if ${ac_cv_HAVE_KMEM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test $CDEV_TEST_FLAG /dev/kmem; then
+ ac_cv_HAVE_KMEM="/dev/kmem"
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_HAVE_KMEM" >&5
+$as_echo "$ac_cv_HAVE_KMEM" >&6; }
+#
+# Note that it's OK if this device is not found
+#
+if test "x$ac_cv_HAVE_KMEM" = "x/dev/kmem"; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_KMEM "$ac_cv_HAVE_KMEM"
+_ACEOF
+
+fi
+
+
+# Swap device Location
+# (/dev/dmem or /dev/drum)
+# used in agent only
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of swap device" >&5
+$as_echo_n "checking for location of swap device... " >&6; }
+if ${ac_cv_DMEM_LOC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test $CDEV_TEST_FLAG /dev/dmem; then
+ ac_cv_DMEM_LOC="/dev/dmem"
+ elif test $CDEV_TEST_FLAG /dev/drum; then
+ ac_cv_DMEM_LOC="/dev/drum"
+ else
+ ac_cv_DMEM_LOC="none"
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_DMEM_LOC" >&5
+$as_echo "$ac_cv_DMEM_LOC" >&6; }
+#
+# Note that it's OK if this device is not found
+#
+if test "x$ac_cv_DMEM_LOC" != "xnone"; then
+
+cat >>confdefs.h <<_ACEOF
+#define DMEM_LOC "$ac_cv_DMEM_LOC"
+_ACEOF
+
+fi
+
+
+# Mount table Location
+# used in agent only
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mount table location" >&5
+$as_echo_n "checking for mount table location... " >&6; }
+if ${ac_cv_ETC_MNTTAB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_ETC_MNTTAB="${with_mnttab:-unknown}"
+ if test "$ac_cv_ETC_MNTTAB" = "unknown"; then
+ for i in /etc/mnttab /etc/mtab /etc/filesystems /dev/mnttab
+ do
+ if test -f $i -o -c $i; then
+ ac_cv_ETC_MNTTAB="$i"
+ break;
+ fi
+ done
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ETC_MNTTAB" >&5
+$as_echo "$ac_cv_ETC_MNTTAB" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define ETC_MNTTAB "$ac_cv_ETC_MNTTAB"
+_ACEOF
+
+
+
+# Printing
+# used in agent only
+#
+# Extract the first word of "lpstat", so it can be a program name with args.
+set dummy lpstat; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_LPSTAT_PATH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $LPSTAT_PATH in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_LPSTAT_PATH="$LPSTAT_PATH" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_LPSTAT_PATH="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+LPSTAT_PATH=$ac_cv_path_LPSTAT_PATH
+if test -n "$LPSTAT_PATH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LPSTAT_PATH" >&5
+$as_echo "$LPSTAT_PATH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x$LPSTAT_PATH != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define LPSTAT_PATH "$LPSTAT_PATH"
+_ACEOF
+
+
+$as_echo "#define HAVE_LPSTAT 1" >>confdefs.h
+
+fi
+if test -r /etc/printcap; then
+
+$as_echo "#define HAVE_PRINTCAP 1" >>confdefs.h
+
+fi
+
+
+# Check ps args
+# used in agent only
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct flags to ps" >&5
+$as_echo_n "checking for correct flags to ps... " >&6; }
+if ${ac_cv_ps_flags+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+if test "`($PSPROG -e 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="-e"
+elif test "`($PSPROG -el 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="-el"
+elif test "`($PSPROG acx 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="acx"
+elif test "`($PSPROG -acx 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="-acx"
+elif test "`($PSPROG -o pid,tt,state,time,ucomm 2>&1) | $EGREP ' ps *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="-o pid,tt,state,time,ucomm"
+elif test "`($PSPROG ax 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="ax"
+elif test "x$PARTIALTARGETOS" = "xcygwin"; then
+ ac_cv_ps_flags="-e"
+elif test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ ac_cv_ps_flags="-e"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to determine valid ps flags... defaulting..." >&5
+$as_echo "$as_me: WARNING: Unable to determine valid ps flags... defaulting..." >&2;}
+ ac_cv_ps_flags="-acx"
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_flags" >&5
+$as_echo "$ac_cv_ps_flags" >&6; }
+
+PSCMD="$PSPROG $ac_cv_ps_flags"
+
+
+cat >>confdefs.h <<_ACEOF
+#define PSCMD "$PSPROG $ac_cv_ps_flags"
+_ACEOF
+
+
+
+##
+# System/Compilation-related
+##
+
+# Test for SIGHUP
+#
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGHUP" >&5
+$as_echo_n "checking for SIGHUP... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <signal.h>
+int
+main ()
+{
+return SIGHUP
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ netsnmp_have_sighup=yes
+else
+ netsnmp_have_sighup=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netsnmp_have_sighup" >&5
+$as_echo "$netsnmp_have_sighup" >&6; }
+if test "x$netsnmp_have_sighup" = xyes; then
+
+$as_echo "#define HAVE_SIGHUP 1" >>confdefs.h
+
+fi
+
+
+# Check whether sysctl() is usable
+# used in library/agent
+#
+if test $cross_compiling = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't check sysctl, manually define NETSNMP_CAN_USE_SYSCTL if platform support available" >&5
+$as_echo "$as_me: WARNING: Can't check sysctl, manually define NETSNMP_CAN_USE_SYSCTL if platform support available" >&2;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sysctl can read kernel information" >&5
+$as_echo_n "checking if sysctl can read kernel information... " >&6; }
+if ${ac_cv_NETSNMP_CAN_USE_SYSCTL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_NETSNMP_CAN_USE_SYSCTL=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.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_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#include <sys/types.h>
+#if HAVE_SYS_SYSCTL_H
+# include <sys/sysctl.h>
+#endif
+
+main() {
+ int mib[2];
+ size_t len;
+ struct timeval boottime;
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_BOOTTIME;
+
+ len = sizeof(boottime);
+ sysctl(mib, 2, &boottime, &len, NULL, NULL);
+ if (boottime.tv_sec != 0)
+ exit(0);
+ else
+ exit(1);
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_NETSNMP_CAN_USE_SYSCTL=yes
+else
+ ac_cv_NETSNMP_CAN_USE_SYSCTL=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_NETSNMP_CAN_USE_SYSCTL" >&5
+$as_echo "$ac_cv_NETSNMP_CAN_USE_SYSCTL" >&6; }
+fi
+
+if test "x$ac_cv_NETSNMP_CAN_USE_SYSCTL" = "xyes"; then
+
+$as_echo "#define NETSNMP_CAN_USE_SYSCTL 1" >>confdefs.h
+
+fi
+
+
+# Check whether TCP timer constants are indeed constant
+# or depend on the kernel clock tick 'hz'. (FreeBSD 4.x)
+#
+# If the latter, then we will need to have a local
+# variable 'hz' defined and with a suitable value,
+# whenever we want to use one one of these 'constants'.
+#
+# used in agent only
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether TCP timers depend on 'hz'" >&5
+$as_echo_n "checking whether TCP timers depend on 'hz'... " >&6; }
+if ${ac_cv_TCPTV_NEEDS_HZ+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <netinet/tcp_timer.h>
+TCPTV_SRTTDFLT
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "hz" >/dev/null 2>&1; then :
+ ac_cv_TCPTV_NEEDS_HZ=yes
+else
+ ac_cv_TCPTV_NEEDS_HZ=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_TCPTV_NEEDS_HZ" >&5
+$as_echo "$ac_cv_TCPTV_NEEDS_HZ" >&6; }
+
+if test "x$ac_cv_TCPTV_NEEDS_HZ" = "xyes"; then
+
+$as_echo "#define TCPTV_NEEDS_HZ 1" >>confdefs.h
+
+fi
+
+
+# Check whether IP Route table is cached (Solaris)
+# used in agent only
+#
+case $target_os in
+ solaris*)
+ # Header checks (Solaris 2.6/7)
+ #
+ for ac_header in inet/common.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "inet/common.h" "ac_cv_header_inet_common_h" "$ac_includes_default"
+if test "x$ac_cv_header_inet_common_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INET_COMMON_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in inet/ip.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "inet/ip.h" "ac_cv_header_inet_ip_h" "$ac_includes_default
+
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#if HAVE_INET_COMMON_H
+#include <inet/common.h>
+#endif
+
+"
+if test "x$ac_cv_header_inet_ip_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INET_IP_H 1
+_ACEOF
+ ac_inet_ip_h=yes
+else
+ ac_inet_ip_h=no
+fi
+
+done
+
+ if test $ac_inet_ip_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mib2_ipRouteEntry_t in inet/mib2.h" >&5
+$as_echo_n "checking for mib2_ipRouteEntry_t in inet/mib2.h... " >&6; }
+if ${ac_cv_mib2_ipRouteEntry_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+
+int
+main ()
+{
+
+ mib2_ipRouteEntry_t testit;
+ if(sizeof(testit))
+ return(0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_mib2_ipRouteEntry_t=yes
+else
+ ac_cv_mib2_ipRouteEntry_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mib2_ipRouteEntry_t" >&5
+$as_echo "$ac_cv_mib2_ipRouteEntry_t" >&6; }
+
+ if test "x$ac_cv_mib2_ipRouteEntry_t" = "xyes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether IRE_CACHE is defined in inet/ip.h" >&5
+$as_echo_n "checking whether IRE_CACHE is defined in inet/ip.h... " >&6; }
+if ${ac_cv_ire_cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_INET_IP_H
+#include <inet/ip.h>
+#endif
+
+int
+main ()
+{
+
+ int testit=IRE_CACHE;
+ if(testit)
+ return(0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_ire_cache=yes
+else
+ ac_cv_ire_cache=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ire_cache" >&5
+$as_echo "$ac_cv_ire_cache" >&6; }
+ else
+ ac_cv_ire_cache=no
+ fi
+
+ if test "x$ac_cv_ire_cache" = "xyes" ; then
+
+$as_echo "#define HAVE_DEFINED_IRE_CACHE /**/" >>confdefs.h
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: It seems that you have inet/ip.h, but IRE_CACHE is not defined. \
+That means that your query to ipRoute MIB could generate over 20k results! \
+And this can be very slow." >&5
+$as_echo "$as_me: WARNING: It seems that you have inet/ip.h, but IRE_CACHE is not defined. \
+That means that your query to ipRoute MIB could generate over 20k results! \
+And this can be very slow." >&2;}
+ fi
+ fi # "test $ac_inet_ip_h = yes"
+ ;;
+esac
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+#
+# define the agent libraries variables
+#
+
+
+
+
+
+
+
+
+
+
+
+ac_config_files="$ac_config_files Makefile:Makefile.top:Makefile.in:Makefile.rules"
+
+ac_config_files="$ac_config_files snmplib/Makefile:Makefile.top:snmplib/Makefile.in:Makefile.rules:snmplib/Makefile.depend"
+
+ac_config_files="$ac_config_files apps/Makefile:Makefile.top:apps/Makefile.in:Makefile.rules:apps/Makefile.depend"
+
+ac_config_files="$ac_config_files apps/snmpnetstat/Makefile:Makefile.top:apps/snmpnetstat/Makefile.in:Makefile.rules:apps/snmpnetstat/Makefile.depend"
+
+ac_config_files="$ac_config_files agent/Makefile:Makefile.top:agent/Makefile.in:Makefile.rules:agent/Makefile.depend"
+
+ac_config_files="$ac_config_files agent/helpers/Makefile:Makefile.top:agent/helpers/Makefile.in:Makefile.rules:agent/helpers/Makefile.depend"
+
+ac_config_files="$ac_config_files agent/mibgroup/Makefile:Makefile.top:agent/mibgroup/Makefile.in:Makefile.rules:agent/mibgroup/Makefile.depend"
+
+ac_config_files="$ac_config_files local/Makefile:Makefile.top:local/Makefile.in:Makefile.rules"
+
+ac_config_files="$ac_config_files testing/Makefile:Makefile.top:testing/Makefile.in"
+
+ac_config_files="$ac_config_files man/Makefile:Makefile.top:man/Makefile.in:Makefile.rules"
+
+ac_config_files="$ac_config_files mibs/Makefile:Makefile.top:mibs/Makefile.in:Makefile.rules"
+
+ac_config_files="$ac_config_files net-snmp-config:net-snmp-config.in"
+
+ac_config_files="$ac_config_files net-snmp-create-v3-user:net-snmp-create-v3-user.in"
+
+ac_config_files="$ac_config_files dist/generation-scripts/gen-variables:dist/generation-scripts/gen-variables.in"
+
+
+ac_config_commands="$ac_config_commands default"
+
+
+#
+# protect PACKAGE_* variables
+#
+
+
+
+
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by Net-SNMP $as_me 5.7.2, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <net-snmp-coders@lists.sourceforge.net>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+Net-SNMP config.status 5.7.2
+configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in AS \
+DLLTOOL \
+OBJDUMP \
+SHELL \
+ECHO \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "include/net-snmp/net-snmp-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/net-snmp/net-snmp-config.h" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:Makefile.top:Makefile.in:Makefile.rules" ;;
+ "snmplib/Makefile") CONFIG_FILES="$CONFIG_FILES snmplib/Makefile:Makefile.top:snmplib/Makefile.in:Makefile.rules:snmplib/Makefile.depend" ;;
+ "apps/Makefile") CONFIG_FILES="$CONFIG_FILES apps/Makefile:Makefile.top:apps/Makefile.in:Makefile.rules:apps/Makefile.depend" ;;
+ "apps/snmpnetstat/Makefile") CONFIG_FILES="$CONFIG_FILES apps/snmpnetstat/Makefile:Makefile.top:apps/snmpnetstat/Makefile.in:Makefile.rules:apps/snmpnetstat/Makefile.depend" ;;
+ "agent/Makefile") CONFIG_FILES="$CONFIG_FILES agent/Makefile:Makefile.top:agent/Makefile.in:Makefile.rules:agent/Makefile.depend" ;;
+ "agent/helpers/Makefile") CONFIG_FILES="$CONFIG_FILES agent/helpers/Makefile:Makefile.top:agent/helpers/Makefile.in:Makefile.rules:agent/helpers/Makefile.depend" ;;
+ "agent/mibgroup/Makefile") CONFIG_FILES="$CONFIG_FILES agent/mibgroup/Makefile:Makefile.top:agent/mibgroup/Makefile.in:Makefile.rules:agent/mibgroup/Makefile.depend" ;;
+ "local/Makefile") CONFIG_FILES="$CONFIG_FILES local/Makefile:Makefile.top:local/Makefile.in:Makefile.rules" ;;
+ "testing/Makefile") CONFIG_FILES="$CONFIG_FILES testing/Makefile:Makefile.top:testing/Makefile.in" ;;
+ "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile:Makefile.top:man/Makefile.in:Makefile.rules" ;;
+ "mibs/Makefile") CONFIG_FILES="$CONFIG_FILES mibs/Makefile:Makefile.top:mibs/Makefile.in:Makefile.rules" ;;
+ "net-snmp-config") CONFIG_FILES="$CONFIG_FILES net-snmp-config:net-snmp-config.in" ;;
+ "net-snmp-create-v3-user") CONFIG_FILES="$CONFIG_FILES net-snmp-create-v3-user:net-snmp-create-v3-user.in" ;;
+ "dist/generation-scripts/gen-variables") CONFIG_FILES="$CONFIG_FILES dist/generation-scripts/gen-variables:dist/generation-scripts/gen-variables.in" ;;
+ "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
+ ac_cs_awk_getline=:
+ ac_cs_awk_pipe_init=
+ ac_cs_awk_read_file='
+ while ((getline aline < (F[key])) > 0)
+ print(aline)
+ close(F[key])'
+ ac_cs_awk_pipe_fini=
+else
+ ac_cs_awk_getline=false
+ ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
+ ac_cs_awk_read_file='
+ print "|#_!!_#|"
+ print "cat " F[key] " &&"
+ '$ac_cs_awk_pipe_init
+ # The final `:' finishes the AND list.
+ ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
+fi
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+# Create commands to substitute file output variables.
+{
+ echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
+ echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' &&
+ echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' &&
+ echo "_ACAWK" &&
+ echo "_ACEOF"
+} >conf$$files.sh &&
+. ./conf$$files.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+rm -f conf$$files.sh
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+ \$ac_cs_awk_pipe_init
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+ if (nfields == 3 && !substed) {
+ key = field[2]
+ if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) {
+ \$ac_cs_awk_read_file
+ next
+ }
+ }
+ print line
+}
+\$ac_cs_awk_pipe_fini
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
+if $ac_cs_awk_getline; then
+ $AWK -f "$ac_tmp/subs.awk"
+else
+ $AWK -f "$ac_tmp/subs.awk" | $SHELL
+fi \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Assembler program.
+AS=$lt_AS
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Object dumper program.
+OBJDUMP=$lt_OBJDUMP
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
+ "net-snmp-config":F) chmod +x net-snmp-config ;;
+ "net-snmp-create-v3-user":F) chmod +x net-snmp-create-v3-user ;;
+ "default":C) echo timestamp > stamp-h ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+
+ echo ""
+ echo "---------------------------------------------------------"
+ echo " Net-SNMP configuration summary:"
+ echo "---------------------------------------------------------"
+ echo ""
+ cat configure-summary
+ echo ""
+ echo "---------------------------------------------------------"
+ echo ""
+
+# Local Variables:
+# mode: Autoconf
+# comment-start: "#"
+# End:
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..5facb29
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,131 @@
+# Portions of this file are subject to the following copyright. See
+# the Net-SNMP's COPYING file for more details and other copyrights
+# that may apply:
+#
+# Portions 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.
+#
+
+#
+# Process this file with autoconf to produce a configure script.
+#
+AC_INIT([Net-SNMP], [5.7.2], [net-snmp-coders@lists.sourceforge.net])
+AC_PREREQ([2.63])
+AC_CONFIG_SRCDIR([agent/snmpd.c])
+AC_REVISION([$Revision$])
+
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADER(include/net-snmp/net-snmp-config.h)
+
+AC_MSG_CACHE_INIT()
+
+#
+# save the configure arguments
+#
+AC_DEFINE_UNQUOTED(NETSNMP_CONFIGURE_OPTIONS,"$ac_configure_args",
+ [configure options specified])
+CONFIGURE_OPTIONS="\"$ac_configure_args\""
+AC_SUBST(CONFIGURE_OPTIONS)
+
+##
+## Recommended structure:
+##
+# information on the package
+# checks for programs
+# checks for libraries
+# checks for header files
+# checks for types
+# checks for structures
+# checks for compiler characteristics
+# checks for library functions
+# checks for system services
+
+m4_include([configure.d/config_project_with_enable])
+m4_include([configure.d/config_project_manual])
+m4_include([configure.d/config_os_progs])
+m4_include([configure.d/config_project_paths])
+m4_include([configure.d/config_os_headers])
+AC_CACHE_SAVE
+m4_include([configure.d/config_project_ipv6_types])
+m4_include([configure.d/config_modules_lib])
+AC_CACHE_SAVE
+m4_include([configure.d/config_os_libs1])
+m4_include([configure.d/config_modules_agent])
+m4_include([configure.d/config_os_misc1])
+m4_include([configure.d/config_os_libs2])
+AC_CACHE_SAVE
+m4_include([configure.d/config_project_perl_python])
+m4_include([configure.d/config_os_misc2])
+m4_include([configure.d/config_project_types])
+m4_include([configure.d/config_os_misc3])
+AC_CACHE_SAVE
+m4_include([configure.d/config_os_functions])
+m4_include([configure.d/config_os_struct_members])
+m4_include([configure.d/config_os_misc4])
+AC_CACHE_SAVE
+
+#
+# define the agent libraries variables
+#
+AC_SUBST(LMIBLIBS)
+AC_SUBST(AGENTLIBS)
+AC_SUBST(OTHERAGENTLIBOBJS)
+AC_SUBST(OTHERAGENTLIBLOBJS)
+AC_SUBST(OTHERAGENTLIBLFTS)
+
+AC_SUBST(DLLIBS)
+
+AC_SUBST(PARTIALTARGETFLAGS)
+AC_SUBST(ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE)
+
+AC_CONFIG_FILES([Makefile:Makefile.top:Makefile.in:Makefile.rules])
+AC_CONFIG_FILES([snmplib/Makefile:Makefile.top:snmplib/Makefile.in:Makefile.rules:snmplib/Makefile.depend])
+AC_CONFIG_FILES([apps/Makefile:Makefile.top:apps/Makefile.in:Makefile.rules:apps/Makefile.depend])
+AC_CONFIG_FILES([apps/snmpnetstat/Makefile:Makefile.top:apps/snmpnetstat/Makefile.in:Makefile.rules:apps/snmpnetstat/Makefile.depend])
+AC_CONFIG_FILES([agent/Makefile:Makefile.top:agent/Makefile.in:Makefile.rules:agent/Makefile.depend])
+AC_CONFIG_FILES([agent/helpers/Makefile:Makefile.top:agent/helpers/Makefile.in:Makefile.rules:agent/helpers/Makefile.depend])
+AC_CONFIG_FILES([agent/mibgroup/Makefile:Makefile.top:agent/mibgroup/Makefile.in:Makefile.rules:agent/mibgroup/Makefile.depend])
+AC_CONFIG_FILES([local/Makefile:Makefile.top:local/Makefile.in:Makefile.rules])
+AC_CONFIG_FILES([testing/Makefile:Makefile.top:testing/Makefile.in])
+AC_CONFIG_FILES([man/Makefile:Makefile.top:man/Makefile.in:Makefile.rules])
+AC_CONFIG_FILES([mibs/Makefile:Makefile.top:mibs/Makefile.in:Makefile.rules])
+AC_CONFIG_FILES([net-snmp-config:net-snmp-config.in],
+ [chmod +x net-snmp-config])
+AC_CONFIG_FILES([net-snmp-create-v3-user:net-snmp-create-v3-user.in],
+ [chmod +x net-snmp-create-v3-user])
+AC_CONFIG_FILES([dist/generation-scripts/gen-variables:dist/generation-scripts/gen-variables.in])
+
+AC_CONFIG_COMMANDS([default], echo timestamp > stamp-h)
+
+#
+# protect PACKAGE_* variables
+#
+AH_VERBATIM([PACKAGE_BUGREPORT],[/* Define to the address where bug reports for this package should be sent. */
+#ifndef PACKAGE_BUGREPORT
+#undef PACKAGE_BUGREPORT
+#endif])
+AH_VERBATIM([PACKAGE_NAME],[/* Define to the full name of this package. */
+#ifndef PACKAGE_NAME
+#undef PACKAGE_NAME
+#endif])
+AH_VERBATIM([PACKAGE_STRING],[/* Define to the full name and version of this package. */
+#ifndef PACKAGE_STRING
+#undef PACKAGE_STRING
+#endif])
+AH_VERBATIM([PACKAGE_TARNAME],[/* Define to the one symbol short name of this package. */
+#ifndef PACKAGE_TARNAME
+#undef PACKAGE_TARNAME
+#endif])
+AH_VERBATIM([PACKAGE_VERSION],[/* Define to the version of this package. */
+#ifndef PACKAGE_VERSION
+#undef PACKAGE_VERSION
+#endif])
+
+AC_OUTPUT
+
+AC_MSG_CACHE_DISPLAY()
+# Local Variables:
+# mode: Autoconf
+# comment-start: "#"
+# End:
diff --git a/configure.d/config_modules_agent b/configure.d/config_modules_agent
new file mode 100644
index 0000000..3272679
--- /dev/null
+++ b/configure.d/config_modules_agent
@@ -0,0 +1,814 @@
+# -*- autoconf -*-
+#
+# generate empty files
+#
+# Create include file list for snmp_vars.h to use.
+mibdir="agent/mibgroup"
+if test ! -d agent; then
+ mkdir agent
+fi
+if test ! -d agent/mibgroup; then
+ mkdir agent/mibgroup
+fi
+j="$mibdir/mib_module_includes.h $mibdir/agent_module_includes.h \
+ $mibdir/mib_module_inits.h $mibdir/agent_module_inits.h \
+ $mibdir/mib_module_shutdown.h $mibdir/agent_module_shutdown.h \
+ include/net-snmp/agent/mib_module_config.h \
+ include/net-snmp/agent/agent_module_config.h \
+ $mibdir/mib_module_dot_conf.h $mibdir/agent_module_dot_conf.h"
+
+for i in $j; do
+ rm -f $i
+ echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $i
+done
+
+#
+# Do hairy agent module processing.
+#
+AC_MSG_CHECKING([for and configuring mib modules to use])
+
+# set up the CPP command
+MODULECPP="$CPP $PARTIALTARGETFLAGS -DNETSNMP_FEATURE_CHECKING -I${srcdir}/include -I${srcdir}/agent/mibgroup"
+if test "x$enable_mfd_rewrites" = "xyes"; then
+ MODULECPP="$MODULECPP -DNETSNMP_ENABLE_MFD_REWRITES"
+fi
+
+module_list=""
+mib_module_list=""
+agent_module_list=""
+new_with_mib_modules=`echo $with_mib_modules | $SED 's/,/ /g;'`
+new_with_out_mib_modules=`echo $with_out_mib_modules | $SED 's/,/ /g;'`
+
+# set up initial module list
+new_module_list="$new_with_mib_modules default_modules"
+
+# minor modifications
+if test "x$enable_agent" = "xno"; then
+ # minimum mib module list for snmptrapd
+ new_module_list="mibII/vacm_vars mibII/vacm_conf utilities/execute $new_with_mib_modules"
+ default_mibs=SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB
+ default_mibs_install=" "
+elif test "x$mini_agent" = "xyes"; then
+ # define the mini agent flag to reduce our load list from default_mibs.h
+ MODULECPP="$MODULECPP -DNETSNMP_MINI_AGENT"
+fi
+
+test_modules="$new_module_list"
+new_module_list=""
+
+# remove modules that were explicitly excluded
+for i in $test_modules
+ do
+ if echo " $new_with_out_mib_modules " | $GREP " $i " > /dev/null; then
+ mib_cfg_msg="mib module '$i' is both included and excluded."
+ AC_MSG_WARN([mib module conflict])
+ if test "x$with_mib_cfg_checks" = "xyes"; then
+ AC_MSG_WARN([user with : $with_mib_modules])
+ AC_MSG_WARN([final with : $new_module_list])
+ AC_MSG_WARN([user without : $with_out_mib_modules])
+ AC_MSG_WARN([final without: $new_with_out_mib_modules])
+ AC_MSG_ERROR([$mib_cfg_msg])
+ else
+ AC_MSG_WARN([$mib_cfg_msg It will be excluded])
+ AC_MSG_CACHE_ADD([*** MIB Module warning *** $mib_cfg_msg It has been excluded.])
+ fi
+ else
+ new_module_list="$new_module_list $i"
+ fi
+done
+
+AC_MSG_RESULT([$new_module_list.])
+
+#---------------------
+# loop over module list
+#
+all_warnings=""
+if test "x$with_mib_cfg_debug" = "xyes"; then
+ module_debug=1
+else
+ module_debug=0
+fi
+first_pass=1
+output_to=normal
+
+if test ! -d mk ; then
+ mkdir mk
+fi
+
+
+module_rules=mk/module_rules.mk
+echo "# contents below built automatically by configure; do not edit by hand" > $module_rules
+
+#
+# make file sub-pieces
+#
+for i in module_list_deps mib_module_list_deps agent_module_list_deps ; do
+ eval "$i=mk/${i}.mk"
+ echo "# contents below built automatically by configure; do not edit by hand" > mk/${i}.mk
+done
+
+#
+# variable settings sub-pieces
+#
+for i in module_list_code mib_module_list_code agent_module_list_code module_list mib_module_list agent_module_list ; do
+ eval "$i=mk/${i}.mk"
+ echo "# contents below built automatically by configure; do not edit by hand" > mk/${i}.mk
+ echo "$i= \\" >> mk/${i}.mk
+done
+
+echo $ECHO_N "echo " $ECHO_C > mk/MODULE_LIST.mk
+MODULE_LIST=mk/MODULE_LIST.mk
+
+
+#---------------------
+# until we have an empty module list...
+# (modules may add new modules, and until all dependencies are done...)
+#
+while test "x$new_module_list" != "x"; do
+ AC_MSG_MODULE_DBG(-e,"\n****************************************************************")
+ AC_MSG_MODULE_DBG("nml: $new_module_list")
+
+ #---------------------
+ # loop over all the modules in the current list
+ #
+ for j in $new_module_list
+ do
+
+ #---------------------
+ # figure out which sub-blocks to build in parts
+ if echo "$j" | $GREP "=" ; then
+ # build a shared object file
+ # format: sofilename=module1:module2
+ # XXX: currently doesn't do this
+ dl_name=`echo $j | $SED 's/=.*//'`
+ dl_names="$dl_names $dl_name"
+ dl_objects=`echo $j | $SED 's/.*=//'`
+ module_sublist=`echo $dl_objects | $SED 's/:/ /g'`
+ saved_sublist=""
+ saved_sublist_code=""
+ output_to=separate
+
+ # create output files
+ # these actually get nuked later
+ output_inits="agent/mibgroup/${dl_name}-dll.c"
+ output_hdrs="agent/mibgroup/${dl_name}-hdrs.h"
+ else
+ # not a special token invocation
+ module_sublist=$j
+ output_to=normal
+ output_t=
+ fi
+
+ while test "x$module_sublist" != "x" ; do
+
+ #---------------------
+ # loop over all the modules in the sub list
+ for i in $module_sublist
+ do
+
+ AC_MSG_MODULE_DBG(-e "\n================================================================")
+ AC_MSG_MODULE_DBG("testing $i")
+ need_header=0
+
+ #---------------------
+ # build a pseudo include header that includes current config and
+ # system symbols:
+ rm -f conftest.$ac_ext module_tmp_header.h
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include NETSNMP_SYSTEM_INCLUDE_FILE
+#include "$srcdir/$mibdir/$i.h"]])])
+ mv conftest.$ac_ext module_tmp_header.h
+
+ #---------------------
+ # macro: config_belongs_in(ARG)
+ # ARG: either
+ # - mib_module => libnetsnmpmibs (default)
+ # - agent_module => libnetsnmpagent
+ #
+ AH_TOP([#define config_belongs_in(x)])
+ module_type=mib_module
+ if test -f $srcdir/$mibdir/$i.h; then
+ changequote(, )
+ module_type=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's@.*config_belongs_in(\([^)]*\)).*@\1@p'`
+ changequote([, ])
+ fi
+ if test "x$module_type" = "x" ; then
+ module_type=mib_module
+ fi
+ if test "x$output_to" = "xnormal" ; then
+ output_inits="$mibdir/${module_type}_inits.h"
+ output_hdrs="$mibdir/${module_type}_includes.h"
+ fi
+
+ #--------------------
+ # check for duplicates within the dll system.
+ # - if found in a dll, then remove from the dll and add to main
+ dblfix=""
+ for dltest in $dl_names ; do
+ eval mod_files="\"\$dl_${dltest}_files\""
+ if echo " $mod_files " | $GREP " $i " > /dev/null; then
+ # some dll module has already seen this, unload it from that list
+ # and include it in the core (again)
+ AC_MSG_MODULE_DBG("removing $i from $dltest")
+ mod_files=`echo " $mod_files " | $SED "s@ $i @@"`
+ dblfix="__XXX__"
+ eval "dl_${dltest}_files=\"$mod_files\""
+
+ module_list="$module_list $i"
+ echo "read_config.lo: mibgroup/$i.h" >> $module_list_deps
+ if test $module_type = "agent_module" ; then
+ echo "snmp_vars.lo: mibgroup/$i.h" >> $agent_module_list_deps
+ else
+ echo "mib_modules.lo: mibgroup/$i.h" >> $mib_module_list_deps
+ fi
+ eval ${module_type}_list="\"\$${module_type}_list $i\""
+ echo " $i \\" >> $module_list_code
+ echo $ECHO_N " $i" $ECHO_C >> $MODULE_LIST
+ eval tmpfilevar=\$`echo ${module_type}_list_code`
+ echo " $i \\" >> $tmpfilevar
+
+ # XXX: add this to the main init list; this is possible not
+ # quite in the right spot any longer but we're stuck with it.
+ # Adding it back to the original ordered spot would be a
+ # nightmare. Ok, we're already in nightmare code so that
+ # wolud have to be a night-terror.
+ mnm=`echo $i | $SED 's/.*\///;s/\.c$//;'`
+ output_inits_tmp="$mibdir/${module_type}_inits.h"
+ echo " if (should_init(\"$mnm\")) init_$mnm();" >> $output_inits_tmp
+ # XXX: even worse, we loose whether the header is needed or not.
+ output_hdrs_tmp="$mibdir/${module_type}_includes.h"
+ echo '#include "'"mibgroup/$i.h"'"' >> $output_hdrs_tmp
+ fi
+ done
+
+ #---------------------
+ # make sure module wasn't explicitly excluded, or already added
+ #
+ if test "x$dblfix" != "x" ; then
+ AC_MSG_MODULE_DBG("$i was duplicated -- putting into main")
+ elif echo " $new_with_out_mib_modules " | $GREP " $i " > /dev/null; then
+ AC_MSG_MODULE_DBG("$i was excluded")
+ elif echo " $module_list " | $GREP " $i " > /dev/null; then
+ AC_MSG_MODULE_DBG("$i already tested")
+ else
+
+ #---------------------
+ # process modules header, checking for config_ pseudo-macros
+ #
+
+ #---------------------
+ # does the header file for the module exist?
+ # macros are only processed if it does
+ if test -f $srcdir/$mibdir/$i.h; then
+ new_list=""
+
+ #---------------------
+ # macro: config_exclude(modules)
+ # - lists conflicts with other modules
+ # - EG: new MIB implementations exclude old and vice-versa
+ #
+ # check if $i has any conflicts
+ #
+ AH_TOP([#define config_exclude(x)])
+ new_list_excl=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_exclude(\(.*\)).*/\1/p'`
+ if test "x$new_list_excl" != "x"; then
+ AC_MSG_MODULE_DBG("$i excludes $new_list_excl")
+ for j in $new_list_excl
+ do
+ if echo " $module_list $new_mib_module_list $new_list_two " | $GREP " $j " > /dev/null; then
+ mib_cfg_msg="mib module '$i' excludes module '$j' but another module requires it"
+ AC_MSG_WARN([mib module error])
+ if test "x$with_mib_cfg_checks" = "xyes"; then
+ AC_MSG_ERROR([$mib_cfg_msg])
+ else
+ AC_MSG_WARN([$mib_cfg_msg])
+ AC_MSG_CACHE_ADD([*** MIB Module warning *** $mib_cfg_msg])
+ fi
+ else
+ new_with_out_mib_modules="$j $new_with_out_mib_modules"
+ AC_MSG_MODULE_DBG("$j added to excluded list")
+ fi
+ done
+ fi
+
+ #---------------------
+ # macro: config_arch_require(ARCH,modules)
+ # - lists modules required for a given ARCH
+ #
+ # check if $i has any architecture specific requirements
+ #
+ AH_TOP([#define config_arch_require(x,y)])
+ changequote(, )
+ new_list_arch=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_arch_require( *\([^ ]*\) *, *\([^ ]*\) *).*/\1-xarchx-\2/p'`
+ changequote([, ])
+ if test "x$new_list_arch" != "x"; then
+ for j in $new_list_arch
+ do
+ archtest=`echo $j | $SED 's/-xarchx-.*//'`
+ # target_os may have been changed to a #define of 1...
+ if test "x$archtest" = "x1" -o "x$target_os" = "x$archtest" -o "x$PARTIALTARGETOS" = "x$archtest"; then
+ new_list="$new_list `echo $j | $SED 's/.*-xarchx-//'`"
+ AC_MSG_MODULE_DBG(" $i required adding arch files: `echo $j | $SED 's/.*-xarchx-//'`")
+ fi
+ done
+ fi
+ AC_MSG_MODULE_DBG(" $i required arch files: $new_list")
+
+ #---------------------
+ # macro: config_version_require((base, version, version-modules, ...))
+ # - lists alternative modules used from different versions.
+ #
+ AH_TOP([#define config_version_require(x)])
+ [new_list_alt3=`$MODULECPP module_tmp_header.h | \
+ $AWK '
+ BEGIN {
+ if("'"$enable_new_features"'" == "yes")
+ method="max";
+ else if("'"$enable_old_features"'" == "yes")
+ method="max-less";
+ else
+ method="max-less-equal";
+ FS = ".";
+ split("'"$with_features_of"'", a);
+ version=sprintf("%03d%03d%03d%03d", a[1], a[2], a[3], a[4]);
+ }
+ /config_version_require/ {
+ gsub("^.*config_version_require *\\\\(\\\\(", "");
+ gsub("\\\\)\\\\).*$", "");
+ gsub(", *", ",");
+ FS = ",";
+ n = split($0, a);
+ FS = ".";
+ actver = "000000000000";
+ actstr = a[1];
+ for(i = 2; i < n; i += 2) {
+ split(a[i], b);
+ curver=sprintf("%03d%03d%03d%03d", b[1], b[2], b[3], b[4]);
+ if (curver > actver && (method != "max-less" || curver < version) && (method != "max-less-equal" || curver <= version)) {
+ actver = curver;
+ actstr = a[i + 1];
+ }
+ }
+ printf(" %s", actstr);
+ }'`]
+ AC_MSG_MODULE_DBG(" $i required versioned features: $new_list_alt3")
+ new_list="${new_list}${new_list_alt3}"
+
+ #---------------------
+ # macro: config_require(modules)
+ # - lists modules required for this module
+ #
+ # check if $i has any other required modules
+ #
+ AH_TOP([#define config_require(x)])
+ new_list="$new_list `$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_require(\(.*\)).*/\1/p'`"
+ AC_MSG_MODULE_DBG(" $i will test: $new_list")
+ if test "x$new_list" != "x"; then
+ for j in $new_list
+ do
+ AC_MSG_MODULE_DBG(-n " $i wants to add $j: ")
+ if test ! -f $srcdir/$mibdir/$j.h -a ! -f $srcdir/$mibdir/$j.c; then
+ AC_MSG_WARN([mib module error])
+ AC_MSG_ERROR([mib module "$i" requires module "$j" but $j.h or $j.c could not be found in $srcdir/$mibdir])
+ elif echo " $new_with_out_mib_modules " | $GREP " $j " > /dev/null; then
+ if test "x$i" != "xdefault_modules" ; then
+ mib_cfg_msg="mib module '$i' requires module '$j' but someone told me to compile without it"
+ AC_MSG_WARN([mib module error])
+ if test "x$with_mib_cfg_checks" = "xyes"; then
+ AC_MSG_ERROR([$mib_cfg_msg])
+ else
+ AC_MSG_WARN([$mib_cfg_msg])
+ AC_MSG_CACHE_ADD([*** MIB Module warning *** $mib_cfg_msg])
+ fi
+# elif echo " $module_list $new_list_two $new_module_list " | $GREP " $j " > /dev/null; then
+# AC_MSG_MODULE_DBG(" $j included previously")
+ fi
+ else
+ new_list_two="$new_list_two $j"
+ AC_MSG_MODULE_DBG(" $j included")
+ fi
+ done
+ fi
+
+ #---------------------
+ # macro: config_add_mib(SOME-MIB)
+ # - lists MIBs to be added to the default to-load list.
+ #
+ # check if $i has any mibs to add
+ #
+ AH_TOP([#define config_add_mib(x)])
+ new_mibs=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_add_mib(\(.*\)).*/\1/p'`
+ if test "x$new_mibs" != "x"; then
+ for j in $new_mibs
+ do
+ if test "x`echo :$default_mibs: | $GREP :$j:`" = "x"; then
+ default_mibs="$default_mibs:$j"
+ fi
+ if test -f $srcdir/mibs/$j.txt; then
+ if echo $default_mibs_install | $GREP " $j " > /dev/null; then
+ :
+ else
+ default_mibs_install="$default_mibs_install $j.txt"
+ fi
+ fi
+ done
+ fi # new mibs
+
+ #-------------------
+ # add the current module to the list of stuff to compile, etc.
+ #
+ # add $i to module list
+ #
+ AC_MSG_MODULE_DBG(" $i added (based on $i.h)")
+ module_list="$module_list $i"
+ eval ${module_type}_list="\"\$${module_type}_list $i\""
+
+ echo "read_config.lo: mibgroup/$i.h" >> $module_list_deps
+ if test $module_type = "agent_module" ; then
+ echo "snmp_vars.lo: mibgroup/$i.h" >> $agent_module_list_deps
+ else
+ echo "mib_modules.lo: mibgroup/$i.h" >> $mib_module_list_deps
+ fi
+
+ #-------------------
+ # check for unsupported config_load_mib
+ #
+ if $MODULECPP module_tmp_header.h | $GREP -q config_load_mib; then
+ AC_MSG_WARN([mib module error])
+ AC_MSG_WARN([mib module "$i" uses the "config_load_mib" directive, which is no longer supported. It probably won't work.])
+ fi # grep config_load_mib
+
+ #-------------------
+ # check for config_parse_dot_conf
+ # (generally not used any longer; old auto-load a .conf token)
+ #
+ AH_TOP([#define config_parse_dot_conf(w,x,y,z)])
+ changequote(, )
+ $MODULECPP module_tmp_header.h | \
+ $SED -n 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@p' >> $mibdir/mib_module_dot_conf.h
+ changequote([, ])
+
+ #---------------------
+ # macro: config_error(error text)
+ # - used to signal a configuration error from a module
+ #
+ # check if $i has any errors, or warnings
+ #
+ AH_TOP([#define config_error(x)])
+ error=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_error(\(.*\)).*/\1/p'`
+ if test "x$error" != "x"; then
+ echo
+ echo
+ AC_MSG_ERROR([$i: *** $error ***])
+ fi
+
+ #---------------------
+ # macro: config_warning(warning text)
+ # - used to signal a configuration "warning" to be printed to the user
+ #
+ AH_TOP([#define config_warning(x)])
+ warning=`$MODULECPP module_tmp_header.h | \
+ $SED -n 's/.*config_warning(\(.*\)).*/\1/p'`
+ if test "x$warning" != "x"; then
+ all_warnings="$all_warnings $warning
+"
+ fi
+
+ #---------------------
+ # Check for a .c file if the .h didn't exist
+ #
+ elif test -f $srcdir/$mibdir/$i.c; then
+ if echo " $module_list $new_list_two $new_module_list " | $GREP " $i " > /dev/null; then
+ AC_MSG_MODULE_DBG(" $i already included")
+ else
+ AC_MSG_MODULE_DBG(" $i added (based on $i.c)")
+ module_list="$module_list $i"
+ mib_module_list="$mib_module_list $i"
+ fi
+
+ #---------------------
+ # No .h or .c = error! (typo?)
+ #
+ else # no $i.h or $i.c
+ AC_MSG_WARN([mib module error])
+ AC_MSG_ERROR([module files $i.h or $i.c could not be found in $srcdir/$mibdir])
+ fi # no $i.h
+
+ #-------------------
+ # check for init/shutdown routines too
+ #
+ has_c_code=no
+ if test -f $srcdir/$mibdir/$i.c; then
+ if test "x$output_to" = "xnormal" ; then
+ echo " $i \\" >> $module_list_code
+ echo $ECHO_N " $i" $ECHO_C >> $MODULE_LIST
+ eval tmpfilevar=\$`echo ${module_type}_list_code`
+ echo " $i \\" >> $tmpfilevar
+ else
+ eval "dl_${dl_name}_files=\"\$dl_${dl_name}_files $i\""
+ saved_sublist_code="$saved_sublist_code $i"
+ fi
+ mnm=`echo $i | $SED 's/.*\///;s/\.c$//;'`
+ AC_MSG_MODULE_DBG(-e "\nchecking '$srcdir/$mibdir/$i.c' ($mnm/`basename $i`) C file for init/shutdown")
+ if test "x$mnm" != "x`basename $i`"; then
+ AC_MSG_WARN([mib module error])
+ AC_MSG_ERROR([conflicting names: $mnm != `basename $i`])
+ fi
+ temp_init=`$GREP init_$mnm $srcdir/$mibdir/$i.c | $GREP -v _init_$mnm`
+ if test "x$temp_init" != "x"; then
+ AC_MSG_MODULE_DBG(-e "adding init_$mnm() to list")
+ need_header=1
+ echo " if (should_init(\"$mnm\")) init_$mnm();" >> $output_inits
+ fi
+ $GREP shutdown_$mnm $srcdir/$mibdir/$i.c > /dev/null
+ if test $? -eq 0 ; then
+ if test $module_debug -eq 1; then
+ echo -e "\nadding shutdown_$mnm() to list"
+ fi
+ need_header=1
+ echo " if (should_init(\"$mnm\")) shutdown_$mnm();" >> $mibdir/${module_type}_shutdown.h
+ fi
+ fi # test -f $srcdir/$mibdir/$i.c
+
+ #-------------------
+ # if there is a shutdown/init list,
+ #
+ if test $need_header -eq 1 ; then
+ echo '#include "'"mibgroup/$i.h"'"' >> $output_hdrs
+ else
+ echo '/*#include "'"mibgroup/$i.h"'"*/' >> $output_hdrs
+ fi
+
+ #-------------------
+ # check for output directory (for building outside of source tree
+ #
+ changequote(, )
+ if test "x`echo $i | $SED 's/\///g;'`" != "x$i"; then
+ mnd=`echo $i | $SED 's/\/[^/]*$//;'`
+ if test ! -d ./$mibdir/$mnd; then
+ module_directories="$module_directories ./$mibdir/$mnd"
+ fi
+ fi # module directory test
+ changequote([, ])
+
+ #-------------------
+ # define USING_*_MODULE
+ #
+ changequote(, )
+ sym="`echo ${i} | $SED 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
+ changequote([, ])
+ echo "/* Define if compiling with the ${i} module files. */" >> include/net-snmp/agent/${module_type}_config.h
+ echo "#define USING_${sym}_MODULE 1" >> include/net-snmp/agent/${module_type}_config.h
+ echo " " >> include/net-snmp/agent/${module_type}_config.h
+
+ #-------------------
+ echo $ECHO_N " $i$ECHO_C"
+ fi #
+ done # for i in $module_sublist
+
+ if test "$output_to" = "separate" ; then
+ if test "x$new_list_two" = "x" ; then
+ # no new sub-modules to add to the current target
+ output_to="normal"
+
+ dllcleans="$saved_sublist_o $dllcleans"
+ output_inits=""
+ module_sublist=""
+ else
+ # a module had sub-modules required; keep goin'
+ saved_sublist="$saved_sublist $module_sublist"
+ module_sublist="$new_list_two"
+ new_list_two=""
+ fi
+ else
+ module_sublist=""
+ fi
+
+ done # while module_sublist
+ done # for j in $new_module_list
+
+ # remember the top level modules for later reporting
+ if test $first_pass = 1 ; then
+ # remember this list for later reporting
+ top_level_modules="$new_module_list => $new_list_two"
+ first_pass=0
+ fi
+ #-------------------
+ # if $i added new modules vis config_*,
+ # check those modules for requirements too
+ #
+ # transfer the new module to check list to the normal variable
+ #
+ if test "x$new_list_two" ; then
+ output_to=normal
+ fi
+ new_module_list="$new_list_two"
+ new_list_two=""
+done # while test "x$new_module_list" != "x"; do
+echo ""
+
+#--------------------
+# construct the dll code files and make rules. This can't be done
+# until now because duplicate use of a module means it gets removed
+# from the dll and put into the main agent.
+#
+for i in $dl_names ; do
+ eval mod_files="\"\$dl_${i}_files\""
+ echo "components in the $i dll: $mod_files"
+
+ output_inits="agent/mibgroup/${i}-dll.c"
+ output_hdrs="agent/mibgroup/${i}-hdrs.h"
+
+ AC_MSG_MODULE_DBG("creating dll file: $output_inits")
+ for ofile in $output_inits $output_hdrs ; do
+ if test -f $ofile ; then
+ if $GREP "this file created automatically by configure" $ofile > /dev/null 2>&1 ; then
+ :
+ else
+ AC_MSG_ERROR([$ofile already existed ; can't build dll object $i])
+ fi
+ fi
+ cat > $ofile << EOFIF
+/* xDo not edit; this file created automatically by configure */
+EOFIF
+ done
+
+ cat >> $output_inits << EOFOC
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${i}-hdrs.h"
+void
+init_$i(void) {
+EOFOC
+
+ # create the .so rule
+ saved_sublist_o=`echo "$mod_files " | $SED 's/^ *//g;s/ */.o /g;'`
+
+ # create the rules for each object
+ for j in $mod_files ; do
+ cat >> $module_rules << EOFR
+$j.o: $j.c
+ \$(CC) -c \$(CPPFLAGS) \$(CFLAGS) \$(DLFLAGS) -o \$@ \$<
+
+EOFR
+ mnm=`echo $j | $SED 's/.*\///;s/\.c$//;'`
+ echo " if (should_init(\"$mnm\")) init_$mnm();" >> $output_inits
+ done
+
+ # create the rule for the .so and wrapper code
+ cat >> $module_rules << EOFM
+${i}-dll.o: ${i}-dll.c
+ \$(CC) -c \$(CPPFLAGS) \$(CFLAGS) \$(DLFLAGS) -o \$@ \$<
+
+${i}.so: $saved_sublist_o ${i}-dll.o
+ \$(CC) \$(CPPFLAGS) \$(CFLAGS) \$(DLFLAGS) -o \$@ $saved_sublist_o ${i}-dll.o
+
+EOFM
+ cat >> $output_inits << EOFOCFIN
+}
+EOFOCFIN
+
+done
+
+# cleanup
+rm -f conftest.$ac_ext module_tmp_header.h
+
+#-------------------
+# build module lists for Makefiles
+#
+changequote(, )
+
+for i in module_list_o module_list_c module_list_lo module_list_ft mib_module_list_o mib_module_list_c mib_module_list_lo mib_module_list_ft mibgroup_list_o mibgroup_list_lo mibgroup_list_ft agent_module_list_o agent_module_list_c agent_module_list_lo agent_module_list_ft agentgroup_list_o agentgroup_list_lo agentgroup_list_ft ; do
+ eval "$i=mk/${i}.mk"
+done
+
+$SED 's/^module_list_code/module_list_o/;s/\([^=]\) *\\/\1.o \\/g' < $module_list_code > $module_list_o
+$SED 's/^module_list_code/module_list_c/;s/\([^=]\) *\\/\1.c \\/g' < $module_list_code > $module_list_c
+$SED 's/^module_list_code/module_list_lo/;s/\([^=]\) *\\/\1.lo \\/g' < $module_list_code > $module_list_lo
+$SED 's/^module_list_code/module_list_ft/;s/\([^=]\) *\\/\1.ft \\/g' < $module_list_code > $module_list_ft
+
+$SED 's/^mib_module_list_code/mib_module_list_o/;s/\([^=]\) *\\/\1.o \\/g' < $mib_module_list_code > $mib_module_list_o
+$SED 's/^mib_module_list_code/mib_module_list_c/;s/\([^=]\) *\\/\1.c \\/g' < $mib_module_list_code > $mib_module_list_c
+$SED 's/^mib_module_list_code/mib_module_list_lo/;s/\([^=]\) *\\/\1.lo \\/g' < $mib_module_list_code > $mib_module_list_lo
+$SED 's/^mib_module_list_code/mib_module_list_ft/;s/\([^=]\) *\\/\1.ft \\/g' < $mib_module_list_code > $mib_module_list_ft
+
+$SED 's/^mib_module_list_o/mibgroup_list_o/;s@\([^ ]*\)\.o@mibgroup/\1.o@g' < $mib_module_list_o > $mibgroup_list_o
+$SED 's/^mib_module_list_lo/mibgroup_list_lo/;s@\([^ ]*\)\.lo@mibgroup/\1.lo@g' < $mib_module_list_lo > $mibgroup_list_lo
+$SED 's/^mib_module_list_ft/mibgroup_list_ft/;s@\([^ ]*\)\.ft@mibgroup/\1.ft@g' < $mib_module_list_ft > $mibgroup_list_ft
+
+$SED 's/^agent_module_list_code/agent_module_list_o/;s/\([^=]\) *\\/\1.o \\/g' < $agent_module_list_code > $agent_module_list_o
+$SED 's/^agent_module_list_code/agent_module_list_c/;s/\([^=]\) *\\/\1.c \\/g' < $agent_module_list_code > $agent_module_list_c
+$SED 's/^agent_module_list_code/agent_module_list_lo/;s/\([^=]\) *\\/\1.lo \\/g' < $agent_module_list_code > $agent_module_list_lo
+$SED 's/^agent_module_list_code/agent_module_list_ft/;s/\([^=]\) *\\/\1.ft \\/g' < $agent_module_list_code > $agent_module_list_ft
+
+$SED 's/^agent_module_list_o/agentgroup_list_o/;s@\([^ ]*\)\.o@mibgroup/\1.o@g' < $agent_module_list_o > $agentgroup_list_o
+$SED 's/^agent_module_list_lo/agentgroup_list_lo/;s@\([^ ]*\)\.lo@mibgroup/\1.lo@g' < $agent_module_list_lo > $agentgroup_list_lo
+$SED 's/^agent_module_list_ft/agentgroup_list_ft/;s@\([^ ]*\)\.ft@mibgroup/\1.ft@g' < $agent_module_list_ft > $agentgroup_list_ft
+
+for i in module_list_o module_list_c module_list_lo module_list_ft mib_module_list_o mib_module_list_c mib_module_list_lo mib_module_list_ft mibgroup_list_o mibgroup_list_lo mibgroup_list_ft agent_module_list_o agent_module_list_c agent_module_list_lo agent_module_list_ft agentgroup_list_o agentgroup_list_lo agentgroup_list_ft ; do
+ # hpux make (at least) doesn't like a trailing \ on the last
+ # line even when the next line contains nothing but
+ # whitespace.
+ lasttoken=`awk '{lasttoken=$1}END{print lasttoken}' mk/$i.mk`
+ $SED "s#$lasttoken \\\\#$lasttoken#" < mk/$i.mk > mk/$i.mk.tmp
+ mv mk/$i.mk.tmp mk/$i.mk
+
+ # add a closing comment
+ echo "" >> mk/$i.mk
+ echo "# end configure generated code" >> mk/$i.mk
+done
+
+changequote([, ])
+
+if test $module_debug -eq 1; then
+ echo -e "\nFinal module list: $module_list_code"
+ exit
+fi
+if test "x$with_mib_cfg_checks" = "xyes"; then
+ AC_MSG_CACHE_ADD([Agent Module list: $module_list_code])
+fi
+AC_SUBST_FILE(MODULE_LIST)
+AC_SUBST_FILE(module_list_c)
+AC_SUBST_FILE(module_list_o)
+AC_SUBST_FILE(module_list_lo)
+AC_SUBST_FILE(module_list_ft)
+AC_SUBST_FILE(mib_module_list_c)
+AC_SUBST_FILE(mib_module_list_o)
+AC_SUBST_FILE(mib_module_list_lo)
+AC_SUBST_FILE(mib_module_list_ft)
+AC_SUBST_FILE(agent_module_list_c)
+AC_SUBST_FILE(agent_module_list_o)
+AC_SUBST_FILE(agent_module_list_lo)
+AC_SUBST_FILE(agent_module_list_ft)
+AC_SUBST_FILE(mibgroup_list_o)
+AC_SUBST_FILE(mibgroup_list_lo)
+AC_SUBST_FILE(mibgroup_list_ft)
+AC_SUBST_FILE(agentgroup_list_o)
+AC_SUBST_FILE(agentgroup_list_lo)
+AC_SUBST_FILE(agentgroup_list_ft)
+
+AC_SUBST(default_mibs_install)
+AC_SUBST(dllcleans)
+AC_SUBST_FILE(module_rules)
+AC_SUBST_FILE(module_list_deps)
+AC_SUBST_FILE(mib_module_list_deps)
+AC_SUBST_FILE(agent_module_list_deps)
+
+AC_MSG_RESULT(.)
+
+if test $module_debug -eq 1; then
+AC_MSG_CACHE_ADD(Agent MIB code: $module_list)
+fi
+AC_MSG_CACHE_ADD(Agent MIB code: $top_level_modules)
+
+# end hairy agent module processing
+
+AC_MSG_CHECKING([if directories need to be created])
+for i in $module_directories; do
+ $srcdir/mkinstalldirs $i
+done
+AC_MSG_RESULT(.)
+
+#-------------------
+# Define default mibs
+#
+AC_MSG_CHECKING([default mib files to read])
+if test "x$NETSNMP_DEFAULT_MIBS" = "x"; then
+ NETSNMP_DEFAULT_MIBS="$default_mibs"
+fi
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" -o "x$PARTIALTARGETOS" = "xcygwin"; then
+ # mingw32 and cygwin use ';' as the environment variable separator char
+ ENV_SEPARATOR=";"
+ NETSNMP_DEFAULT_MIBS=`echo "$NETSNMP_DEFAULT_MIBS" | $SED 's/:/;/g'`
+ default_mibs=`echo "$default_mibs" | $SED 's/:/;/g'`
+else
+ ENV_SEPARATOR=":"
+fi
+AC_SUBST(ENV_SEPARATOR)
+AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBS,"$NETSNMP_DEFAULT_MIBS")
+AC_SUBST(NETSNMP_DEFAULT_MIBS)
+AC_MSG_RESULT($NETSNMP_DEFAULT_MIBS)
+
+#-------------------
+# Define symbols for conditional compilation in makefiles
+#
+
+if echo " $agent_module_list " | \
+ fgrep ' agentx/agentx_config ' | \
+ fgrep ' agentx/client ' | \
+ fgrep ' agentx/protocol ' > /dev/null ; then
+ NETSNMP_HAVE_AGENTX_LIBS_TRUE=''
+ NETSNMP_HAVE_AGENTX_LIBS_FALSE='#'
+else
+ NETSNMP_HAVE_AGENTX_LIBS_TRUE='#'
+ NETSNMP_HAVE_AGENTX_LIBS_FALSE=''
+fi
+AC_SUBST([NETSNMP_HAVE_AGENTX_LIBS_TRUE])
+AC_SUBST([NETSNMP_HAVE_AGENTX_LIBS_FALSE])
diff --git a/configure.d/config_modules_lib b/configure.d/config_modules_lib
new file mode 100644
index 0000000..b6609c1
--- /dev/null
+++ b/configure.d/config_modules_lib
@@ -0,0 +1,232 @@
+# -*- autoconf -*-
+#
+# Maybe add library extensions for thread mutex locking.
+#
+
+if test "x$with_res_locks" = "xyes"; then
+ AC_DEFINE(NETSNMP_REENTRANT, 1,
+ [Define to 1 if you want to build with reentrant/threaded
+ code (incomplete).])
+
+ case $target_os in
+
+ aix*)
+ CC_RUNTIME_ARG="$CC_RUNTIME_ARG -lpthreads"
+ ;;
+
+ *)
+ ;;
+
+ esac
+fi
+
+#
+# Add platform-specific source files.
+#
+AC_MSG_CHECKING([for platform-specific source])
+other_src_list=""
+other_ftobjs_list=""
+other_lobjs_list=""
+other_objs_list=""
+other_agentobjs=""
+other_lagentobjs=""
+other_ftagentobjs=""
+other_trapd_objects=""
+
+# Win32 service code
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ other_src_list="$other_src_list winservice.c winservicerc.rc"
+ other_objs_list="$other_objs_list winservice.o winservicerc.o"
+ other_lobjs_list="$other_lobjs_list winservice.lo winservicerc.lo"
+ other_ftobjs_list="$other_ftobjs_list winservice.ft winservicerc.ft"
+ other_agentobjs="../snmplib/winservicerc.o"
+ other_lagentobjs="../snmplib/winservicerc.lo"
+ other_ftagentobjs="../snmplib/winservicerc.lo"
+ other_trapd_objects="../snmplib/winservicerc.o"
+fi
+
+# Win32 pipes
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ other_src_list="$other_src_list winpipe.c"
+ other_objs_list="$other_objs_list winpipe.o"
+ other_lobjs_list="$other_lobjs_list winpipe.lo"
+ other_ftobjs_list="$other_ftobjs_list winpipe.ft"
+fi
+
+AC_SUBST(other_src_list)
+AC_SUBST(other_objs_list)
+AC_SUBST(other_lobjs_list)
+AC_SUBST(other_ftobjs_list)
+AC_SUBST(other_agentobjs)
+AC_SUBST(other_lagentobjs)
+AC_SUBST(other_ftagentobjs)
+AC_SUBST(other_trapd_objects)
+
+AC_MSG_RESULT([$other_src_list $other_objs_list $other_lobjs_list])
+AC_MSG_RESULT([$other_agentobjs $other_lagentobjs $other_trapd_objects])
+
+#
+# Create directory structure for build
+#
+if test ! -d include; then
+ mkdir include
+fi
+if test ! -d include/net-snmp; then
+ mkdir include/net-snmp
+fi
+if test ! -d include/net-snmp/agent; then
+ mkdir include/net-snmp/agent
+fi
+if test ! -d include/net-snmp/library; then
+ mkdir include/net-snmp/library
+fi
+if test ! -d include/ucd-snmp; then
+ mkdir include/ucd-snmp
+fi
+
+if test ! -d snmplib; then
+ mkdir snmplib
+fi
+if test ! -d snmplib/transports ; then
+ mkdir snmplib/transports
+fi
+
+#
+# Do transport module processing.
+#
+AC_MSG_CHECKING([for and configuring transport modules to use])
+
+# include the actual code checking
+m4_include(configure.d/config_modules_transports)
+
+AC_SUBST(transport_hdr_list)
+AC_SUBST(transport_src_list)
+AC_SUBST(transport_obj_list)
+AC_SUBST(transport_lobj_list)
+AC_SUBST(transport_ftobj_list)
+for i in $transport_def_list; do
+ AC_DEFINE_UNQUOTED($i)
+done
+AC_MSG_RESULT($transport_result_list.)
+AC_MSG_CACHE_ADD(Network transport support: $transport_result_list)
+
+# cleanup
+rm -f module_tmp_header.h
+
+#
+# Security modules to use
+#
+
+AC_MSG_CHECKING([for security modules to use])
+m4_include(configure.d/config_modules_security_modules)
+AC_SUBST(security_src_list)
+AC_SUBST(security_hdr_list)
+AC_SUBST(security_obj_list)
+AC_SUBST(security_lobj_list)
+AC_SUBST(security_ftobj_list)
+AC_MSG_RESULT($new_with_security)
+AC_MSG_CACHE_ADD(SNMPv3 Security Modules: $new_with_security)
+
+#
+# Handle the special case of KSM to see which crypto API we support
+#
+
+ac_cv_NETSNMP_USE_KERBEROS_MIT=no
+rebuilt_new_with_security=
+already_checked_krb5=no
+
+for sec in $new_with_security
+do
+ if test "x$sec" = "xksm" -a "xyes" = "x$already_checked_krb5"; then
+ continue
+ fi
+ already_checked_krb5=yes
+
+ if test x$sec != xksm; then
+ rebuilt_new_with_security="$rebuilt_new_with_security $sec"
+ else
+ if test no = $trykrb5; then
+ AC_MSG_NOTICE([configured not to use krb5. disabling ksm])
+ continue
+ fi
+
+ AC_PATH_PROG([krb5_config],krb5-config,[no],$krb5path/bin:$PATH)
+
+ if test no != $krb5_config; then
+ CPPFLAGS="$CPPFLAGS `$krb5_config --cflags`"
+ LIBS="$LIBS `$krb5_config --libs`"
+ elif test $krb5path != no; then
+ AC_ADD_SEARCH_PATH($krb5path)
+ else
+ AC_ADD_SEARCH_PATH(/usr/kerberos)
+ fi
+
+ AC_MSG_CHECKING([for krb5])
+ AC_CACHE_VAL(ac_cv_have_krb5,
+ AC_CHECK_LIB(krb5, krb5_init_context,
+ ac_cv_have_krb5=yes, ac_cv_have_krb5=no
+ )
+ )
+
+ if test $ac_cv_have_krb5 = no; then
+ if test "x$askedkrb5" = "xyes"; then
+ AC_MSG_ERROR(Asked to use krb5 but I couldn't find it.)
+ fi
+ AC_MSG_RESULT(no. disabling ksm)
+ continue
+ fi
+
+ AC_MSG_RESULT(yes)
+ rebuilt_new_with_security="$rebuilt_new_with_security ksm"
+
+ AC_MSG_CHECKING([[for heimdal]])
+ AC_CACHE_VAL(ac_cv_heimdal,
+ [AC_TRY_COMPILE(
+ [#include <krb5.h>],
+ [const char *v = heimdal_version;],
+ ac_cv_heimdal=yes,
+ ac_cv_heimdal=no
+ )])
+ AC_MSG_RESULT($ac_cv_heimdal)
+ if test $ac_cv_heimdal = yes; then
+ AC_DEFINE(NETSNMP_USE_KERBEROS_HEIMDAL, 1,
+ [Define this if you're using Heimdal Kerberos])
+ if test no = $krb5_config; then
+ LIBS="$LIBS -lkrb5 -lasn1 -lcom_err -lroken"
+ fi
+ elif test no = $krb5_config; then
+ LIBS="$LIBS -lkrb5 -lcom_err"
+ fi
+
+ AC_MSG_CHECKING([to see which crypto API we need to use])
+ AC_CHECK_FUNC(krb5_c_encrypt,[
+ AC_CACHE_VAL(ac_cv_NETSNMP_USE_KERBEROS_MIT,
+ AC_CHECK_LIB(k5crypto, krb5_init_context,
+ ac_cv_NETSNMP_USE_KERBEROS_MIT=yes, ac_cv_MIT_NEW_CRYPTo=no
+ )
+ )
+
+ if test yes = $ac_cv_NETSNMP_USE_KERBEROS_MIT; then
+ AC_MSG_RESULT(new MIT crypto API)
+ AC_DEFINE(NETSNMP_USE_KERBEROS_MIT, 1,
+ [Define this if we're using the new MIT crypto API])
+ if test no = $krb5_config; then
+ LIBS="$LIBS -lk5crypto"
+ fi
+ else
+ AC_MSG_RESULT(old MIT crypto API)])
+ fi
+ fi
+done
+
+new_with_security=$rebuilt_new_with_security
+
+#
+# Detect lm_sensors version
+#
+if test "x$ac_cv_header_sensors_sensors_h" = "xyes"; then
+ AC_CHECK_DECLS([sensors_get_all_subfeatures],
+ [AC_DEFINE(NETSNMP_USE_SENSORS_V3, 1,
+ [Define this if you have lm_sensors v3 or later])],,
+ [[#include <sensors/sensors.h>]])
+fi
diff --git a/configure.d/config_modules_security_modules b/configure.d/config_modules_security_modules
new file mode 100644
index 0000000..823ca7d
--- /dev/null
+++ b/configure.d/config_modules_security_modules
@@ -0,0 +1,70 @@
+# -*- sh -*-
+security_def_list="usm"
+security_src_list=""
+security_obj_list=""
+security_lobj_list=""
+security_ftobj_list=""
+security_mod_list=" "
+
+new_with_security=
+new_with_out_security=`echo $with_out_security_modules | tr , ' '`
+
+# Assign additional security modules
+for i in `echo $with_security_modules | tr , ' '`; do
+ if echo " $new_with_out_security " | $GREP " $i " > /dev/null; then
+ echo
+ AC_MSG_ERROR([security module conflict - $i both included and excluded])
+ elif echo " $new_with_security " | $GREP " $i " > /dev/null ; then
+ : # Double define, ignore
+ else
+ new_with_security="$new_with_security $i"
+ fi
+done
+
+# Add default security modules
+for i in $security_def_list; do
+ if echo " $new_with_out_security " | $GREP " $i " > /dev/null; then
+ : # Excluded, ignore
+ elif echo " $new_with_security " | $GREP " $i " > /dev/null ; then
+ : # Double define, ignore
+ else
+ new_with_security="$new_with_security $i"
+ fi
+done
+
+# Generate output files
+: ${security_init_file:='snmplib/snmpsm_init.h'}
+: ${security_shutdown_file:='snmplib/snmpsm_shutdown.h'}
+: ${security_incl_file:='include/net-snmp/library/snmpv3-security-includes.h'}
+
+echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_init_file
+echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_shutdown_file
+echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_incl_file
+
+for i in $new_with_security; do
+ cfile="snmp"$i".c"
+ hfile="snmp"$i".h"
+
+ # make sure support exists for it
+ if test -f $srcdir"/snmplib/"$cfile -a -f $srcdir"/include/net-snmp/library/"$hfile; then
+ :
+ else
+ echo
+ AC_MSG_ERROR(No such security module: $i / $cfile / $hfile)
+ fi
+
+ # define a bunch of stuff to enable it
+ security_mod_list="${security_mod_list} $i"
+ security_src_list="$security_src_list $cfile"
+ security_src_list="$security_src_list $cfile"
+ security_hdr_list="$security_hdr_list $hfile"
+ security_obj_list="$security_obj_list snmp"$i".o"
+ security_lobj_list="$security_lobj_list snmp"$i".lo"
+ security_ftobj_list="$security_ftobj_list snmp"$i".ft"
+ echo "init_"$i"();" >> $security_init_file
+ echo "shutdown_"$i"();" >> $security_shutdown_file
+ echo "#include <net-snmp/library/$hfile>" >> $security_incl_file
+ def_name="AS_TR_CPP([NETSNMP_SECMOD_$i])"
+ AC_DEFINE_UNQUOTED($def_name)
+done
+
diff --git a/configure.d/config_modules_transports b/configure.d/config_modules_transports
new file mode 100644
index 0000000..b10b960
--- /dev/null
+++ b/configure.d/config_modules_transports
@@ -0,0 +1,137 @@
+# -*- sh -*-
+transport_src_list=""
+transport_hdr_list=""
+transport_def_list=""
+transport_result_list=""
+transport_add_list=""
+new_with_transport_list=`echo $with_transports | $SED 's/,/ /g;'`
+new_with_out_transport_list=`echo $with_out_transports | $SED 's/,/ /g;'`
+
+# set up the CPP command
+MODULECPP="$CPP $PARTIALTARGETFLAGS -I${srcdir} -I${srcdir}/include"
+
+#
+# Add the default transports to the list
+#
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ transport_default_list="UDP TCP Alias Callback"
+else
+ transport_default_list="UDP TCP Alias Unix Callback"
+fi
+if test "x$enable_ipv6" = "xyes"; then
+ transport_default_list="UDPIPv6 TCPIPv6 $transport_default_list"
+fi
+for i in $transport_default_list; do
+ if echo " $new_with_transport_list " | $GREP " $i " >/dev/null; then
+ :
+ else
+ transport_add_list="$i $transport_add_list"
+ fi
+done
+new_transport_list="$transport_add_list $new_with_transport_list"
+
+if test "x$ctor_header" = "x" ; then
+ ctor_header="snmplib/transports/snmp_transport_inits.h"
+fi
+
+echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $ctor_header
+while test "x$new_transport_list" != "x"; do
+ future_new_transport_list=""
+ for i in $new_transport_list; do
+ if echo " $new_with_out_transport_list " | $GREP " $i " >/dev/null; then
+ true
+ else
+ if test "x$enable_ipv6" != "xyes"; then
+ if test "x$i" = "xUDPIPv6" -o "x$i" = "xTCPIPv6"; then
+ AC_MSG_ERROR(IPv6 transports not available if IPv6 support is not enabled)
+ fi
+ fi
+ transport_src="transports/snmp"$i"Domain.c"
+ transport_hdr="snmp"$i"Domain.h"
+ rel_transport_src="snmplib/"$transport_src
+ rel_transport_hdr="include/net-snmp/library/"$transport_hdr
+ lc_i=`echo $i | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ ctor_fn="netsnmp_"$lc_i"_ctor"
+ if test -f "$srcdir/$rel_transport_src"; then
+ transport_result_list="$transport_result_list $i"
+ transport_src_list="$transport_src $transport_src_list"
+ if test -f "$srcdir/$rel_transport_hdr"; then
+ transport_hdr_list="$transport_hdr $transport_hdr_list"
+ fi
+ transport_def=`echo $i | $SED 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ transport_def_list="NETSNMP_TRANSPORT_"$transport_def"_DOMAIN $transport_def_list"
+ else
+ echo
+ AC_MSG_ERROR(Cannot find file $srcdir/$rel_transport_src to support SNMP transport domain $i.)
+ fi
+
+ #---------------------
+ # build a pseudo include header that includes current config and
+ # system symbols:
+ rm -f conftest.$ac_ext module_tmp_header.h
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include NETSNMP_SYSTEM_INCLUDE_FILE
+#undef NETSNMP_MINIMAL_CODE
+#define NET_SNMP_CONFIG_H
+#undef config_require
+#define config_require(foo) config_checkit_require(foo)
+#undef config_error
+#define config_error(foo) config_checkit_error(foo)
+#include "$rel_transport_hdr"]])])
+ mv conftest.$ac_ext module_tmp_header.h
+
+ #
+ # check for dependencies using config_require() macro
+ #
+ sub_list=`$MODULECPP module_tmp_header.h | $GREP config_checkit_require | $SED 's/.*config_checkit_require *( *\(.*\) *).*/\1/'`
+ if test "x$sub_list" != "x" ; then
+ for j in $sub_list ; do
+ if echo " $future_new_transport_list $new_transport_list " | $GREP " $j " > /dev/null ; then
+ :
+ else
+ future_new_transport_list="$future_new_transport_list $j"
+ fi
+ done
+ fi
+
+ #
+ # check for errors using config_error() macro
+ #
+ error_list=`$MODULECPP module_tmp_header.h | $GREP config_checkit_error | $SED 's/.*config_checkit_error(\(.*\)).*/\1/g'`
+ if test "x$error_list" != "x" ; then
+ echo ""
+ AC_MSG_ERROR($error_list)
+ fi
+
+ #
+ # Check for needed constructor initialization routines to call
+ #
+ found=`grep $ctor_fn $srcdir/$rel_transport_src`
+ if grep $ctor_fn $srcdir/$rel_transport_src > /dev/null ; then
+ # we add them down below instead of here to make sure
+ # config_require dependency constructors get called first.
+ tr_init_list="$ctor_fn $tr_init_list"
+ fi
+ fi
+ done # for each new transport
+ new_transport_list="$future_new_transport_list"
+done # while new transports exist
+transport_obj_list=`echo " $transport_src_list " | $SED 's/\.c/\.o/g'`
+transport_lobj_list=`echo " $transport_src_list " | $SED 's/\.c/\.lo/g'`
+transport_ftobj_list=`echo " $transport_src_list " | $SED 's/\.c/\.ft/g'`
+for i in $tr_init_list ; do
+ echo "$i();" >> $ctor_header
+done
+
+## win32 platforms require inet_ntop etc.
+if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" -o "x$PARTIALTARGETOS" = "xcygwin"; then
+ if echo "$transport_def_list" | $GREP "IPV6" >/dev/null; then
+ transport_obj_list="$transport_obj_list inet_ntop.o inet_pton.o"
+ transport_lobj_list="$transport_lobj_list inet_ntop.lo inet_pton.lo"
+ transport_ftobj_list="$transport_ftobj_list inet_ntop.ft inet_pton.ft"
+ fi
+fi
+
+if test "x$transport_result_list" = x ; then
+ AC_MSG_ERROR([No transports configured, at least one must be provided])
+fi
diff --git a/configure.d/config_os_functions b/configure.d/config_os_functions
new file mode 100644
index 0000000..3c5385b
--- /dev/null
+++ b/configure.d/config_os_functions
@@ -0,0 +1,324 @@
+# -*- autoconf -*-
+#########################################
+##
+# Checks for library functions.
+##
+#########################################
+
+##
+# Standard checks:
+##
+AC_FUNC_ALLOCA # alloca()
+AC_PROG_GCC_TRADITIONAL
+
+if test "$cross_compiling" = yes -a "${ac_cv_func_memcmp_working+set}" != set
+then
+ # Cross-compiling and ac_cv_func_memcmp_working has not been set - assume
+ # that memcmp() is available.
+ ac_cv_func_memcmp_working=yes
+else
+ # Native compilation - test for the availability of memcmp().
+ AC_FUNC_MEMCMP
+fi
+
+AC_TYPE_SIGNAL
+
+##
+# Stand-alone function checks:
+##
+# Core:
+AC_CHECK_FUNCS([lrand48 rand random ] dnl
+ [signal sigset ] )
+
+# Library:
+AC_CHECK_FUNCS([closedir fgetc_unlocked flockfile ] dnl
+ [fork funlockfile getipnodebyname ] dnl
+ [gettimeofday if_nametoindex mkstemp ] dnl
+ [opendir readdir regcomp ] dnl
+ [setenv setitimer setlocale ] dnl
+ [setsid snprintf strcasestr ] dnl
+ [strdup strerror strncasecmp ] dnl
+ [sysconf times vsnprintf ] )
+
+# IPv4/IPv6 function checks. AC_CHECK_FUNC() can't find these on MinGW
+# since these functions have the __cdecl calling convention on MinGW.
+case x$target_os in
+ xmingw*)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ws2tcpip.h>],
+ [ gai_strerror(0); ])],
+ [ ac_cv_func_gai_strerror=yes
+ AS_ECHO "#define HAVE_GAI_STRERROR 1" >>confdefs.h
+ ], [ ])
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ws2tcpip.h>],
+ [ getaddrinfo(NULL, NULL, NULL, NULL); ])],
+ [ ac_cv_func_getaddrinfo=yes
+ AS_ECHO "#define HAVE_GETADDRINFO 1" >>confdefs.h
+ ], [ ])
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <winsock2.h>],
+ [ gethostbyname(NULL); ])],
+ [ ac_cv_func_gethostbyname=yes
+ AS_ECHO "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
+ ], [ ])
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <winsock2.h>],
+ [ gethostbyaddr(NULL); ])],
+ [ ac_cv_func_gethostaddr=yes
+ AS_ECHO "#define HAVE_GETHOSTBYADDR 1" >>confdefs.h
+ ], [ ])
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <winsock2.h>],
+ [ gethostname(NULL, 0); ])],
+ [ ac_cv_func_gethostname=yes
+ AS_ECHO "#define HAVE_GETHOSTNAME 1" >>confdefs.h
+ ], [ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNCS([gai_strerror getaddrinfo gethostbyname gethostbyname2 gethostname gethostbyaddr])
+ ;;
+esac
+
+AC_CONFIG_LIBOBJ_DIR([snmplib])
+
+AC_REPLACE_FUNCS([getopt inet_ntop inet_pton ] dnl
+ [strlcat strlcpy strtok_r ] dnl
+ [strtol strtoul strtoull ] )
+
+# Agent:
+AC_CHECK_FUNCS([cgetnext chown execv ] dnl
+ [gai_strerror getgrnam ] dnl
+ [gethostname getloadavg ] dnl
+ [getpid getpwnam ] dnl
+ [hasmntopt initgroups ] dnl
+ [if_nameindex if_indextoname if_nametoindex ] dnl
+ [localtime_r mkstemp mktime ] dnl
+ [poll regcomp ] dnl
+ [setgid setgroups ] dnl
+ [setmntent setuid ] dnl
+ [sigaction sigblock sighold ] dnl
+ [sigprocmask ] dnl
+ [statfs statvfs stime ] dnl
+ [strncasecmp system ] dnl
+ [uname usleep ] )
+
+# Apps:
+AC_CHECK_FUNCS([getdtablesize ] dnl
+ [getgrnam getpid getpwnam ] dnl
+ [setgid setgroups setuid ] dnl
+ [tcgetattr ] )
+
+# Not-Used:
+AC_CHECK_FUNCS([if_freenameindex getpagesize ] dnl
+ [lseek64 pread64 ] dnl
+ [select sigalrm socket ] )
+
+
+##
+# More complex function checks:
+# (Agent)
+##
+
+# rpmGetPath check needs clean LIBS environment (Linux)
+#
+if test "x$with_rpm" != "xno"; then
+ OLDLIBS=$LIBS
+ LIBS=$LMIBLIBS
+ AC_CHECK_FUNCS(rpmGetPath)
+ LIBS=$OLDLIBS
+fi
+
+# statfs( char *, struct fs_data* ) (Ultrix)
+#
+AC_MSG_CHECKING([[for two-argument statfs with struct fs_data (Ultrix)]])
+AC_CACHE_VAL(
+ fu_cv_sys_stat_fs_data,
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_FS_TYPES_H
+#include <sys/fs_types.h>
+#endif
+main ()
+{
+struct fs_data fsd;
+/* Ultrix's statfs returns 1 for success,
+ 0 for not mounted, -1 for failure. */
+exit (statfs (".", &fsd) != 1);
+}]])],
+ [fu_cv_sys_stat_fs_data=yes],
+ [fu_cv_sys_stat_fs_data=no],
+ [fu_cv_sys_stat_fs_data=no])])
+AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
+if test $fu_cv_sys_stat_fs_data = yes; then
+ AC_DEFINE(STAT_STATFS_FS_DATA, 1,
+ [Define if statfs takes 2 args and the second argument has
+ type struct fs_data. @<:@Ultrix@:>@])
+fi
+
+
+##
+# Other function-related checks:
+# (general build)
+##
+
+# How to get the name of the current function
+#
+AC_CACHE_CHECK([how to get the name of the current function],
+ [netsnmp_cv__func__name],[
+ netsnmp_cv__func__name=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(,[[const char* cp = __func__;]])],
+ [netsnmp_cv__func__name=__func__])
+ if test "$netsnmp_cv__func__name" = no ; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(,[[const char* cp = __FUNCTION__;]])],
+ [netsnmp_cv__func__name=__FUNCTION__])
+ fi])
+if test "$netsnmp_cv__func__name" != no; then
+ AC_DEFINE_UNQUOTED([NETSNMP_FUNCTION],[$netsnmp_cv__func__name],
+ [Should evaluate to the name of the current function if defined])
+fi
+
+
+# Whether static inline functions are broken (SCO Unixware)
+#
+AC_CACHE_CHECK([[whether static inline functions are broken (Unixware)]],
+ [netsnmp_cv_c_broken_inline],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+static inline int nested_inline_function(void) {
+ return 0;
+}
+inline int main_inline_function( void ) {
+ return nested_inline_function();
+}
+ ])],
+ netsnmp_cv_broken_inline=no,
+ netsnmp_cv_broken_inline=yes))
+
+
+# Yes - static inline functions are broken (Solaris 2.x)
+#
+case "$target_os" in
+ solaris*)
+ netsnmp_cv_broken_inline=yes
+ ;;
+ *)
+ ;;
+esac
+
+if test "$netsnmp_cv_broken_inline" = yes ; then
+ AC_DEFINE(NETSNMP_BROKEN_INLINE, 1,
+ [Define if static inline functions are unsupported])
+fi
+
+
+##
+# Mis-placed (non-function) checks:
+##
+
+AC_CACHE_CHECK([for SIOCGIFADDR in sys/ioctl.h],
+ netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR,
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#ifndef SIOCGIFADDR
+No SIOCGIFADDR found here.
+#endif
+ ]])],
+ [netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR=yes],
+ [netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR=no]))
+if test $netsnmp_cv_sys_ioctl_h_has_SIOCGIFADDR = yes; then
+ AC_DEFINE(SYS_IOCTL_H_HAS_SIOCGIFADDR, 1,
+ [define if SIOCGIFADDR exists in sys/ioctl.h])
+fi
+
+##
+# Check how to print a size_t variable
+##
+
+AC_CACHE_CHECK(
+ [the underlying type of a size_t],
+ netsnmp_cv_size_t_type,
+ [m4_foreach([TYPE], [[int],[long],[long long],[short],[char]],
+ [if [[ x$netsnmp_cv_size_t_type = x ]] ; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+[AC_INCLUDES_DEFAULT()
+extern unsigned TYPE variable;
+extern size_t variable;],
+ [])],
+ [netsnmp_cv_size_t_type="TYPE"])
+ fi
+ ])])
+
+AC_MSG_CHECKING([how to printf a size_t])
+case "$netsnmp_cv_size_t_type" in
+ char|short|int) netsnmp_PRIz="" ;;
+ long) netsnmp_PRIz="l" ;;
+ "long long") netsnmp_PRIz="ll" ;;
+ *) AC_MSG_ERROR([underlying type of size_t not known]) ;;
+esac
+AC_MSG_RESULT($netsnmp_PRIz)
+AC_DEFINE_UNQUOTED([NETSNMP_PRIz], ["$netsnmp_PRIz"],
+ [Size prefix to use to printf a size_t or ssize_t])
+
+##
+# Check how to print a uint32_t variable
+##
+
+AC_CACHE_CHECK(
+ [the underlying type of an uint32_t],
+ netsnmp_cv_uint32_t_type,
+ [m4_foreach([TYPE], [[char],[short],[int],[long],[long long]],
+ [if [[ x$netsnmp_cv_uint32_t_type = x ]] ; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+[AC_INCLUDES_DEFAULT()
+extern unsigned TYPE variable;
+extern uint32_t variable;],
+ [])],
+ [netsnmp_cv_uint32_t_type="TYPE"])
+ fi
+ ])])
+
+AC_MSG_CHECKING([how to printf a uint32_t])
+case "$netsnmp_cv_uint32_t_type" in
+ char|short|int) netsnmp_PRI32="" ;;
+ long) netsnmp_PRI32="l" ;;
+ "long long") netsnmp_PRI32="ll" ;;
+ *) AC_MSG_ERROR([underlying type of uint32_t not known]) ;;
+esac
+AC_MSG_RESULT($netsnmp_PRI32)
+AC_DEFINE_UNQUOTED([NETSNMP_PRI32], ["$netsnmp_PRI32"],
+ [Size prefix to use to printf a uint32_t])
+
+# check to see if the openssl is good enough for DTLS
+# (BIO_dgram_get_peer is a macro, not a true function)
+if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then
+ AC_CACHE_VAL(
+ netsnmp_cv_bio_dgram_get_peer,
+ AC_MSG_CHECKING([[for BIO_dgram_get_peer]])
+ [
+ oldLIBS="$LIBS"
+ LIBS="$LIBS -lcrypto"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <openssl/bio.h>]],
+ [[BIO_dgram_get_peer(NULL, NULL);]])], [],
+ [AC_MSG_ERROR(DTLS support requires a newer version of OpenSSL)])
+
+ LIBS="$oldLIBS"
+ ]
+ AC_MSG_RESULT(yes)
+ )
+fi
+
diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers
new file mode 100644
index 0000000..d903f58
--- /dev/null
+++ b/configure.d/config_os_headers
@@ -0,0 +1,523 @@
+#########################################
+##
+# Checks for header files.
+##
+#########################################
+
+##
+# Standard checks:
+##
+# Core:
+AC_HEADER_STDC # <stdlib.h>, <stdarg.h>, <string.h> & <float.h>
+AC_HEADER_DIRENT # <dirent.h>, <sys/ndir.h>, <sys/dir.h> & <ndir.h>
+# Apps:
+AC_HEADER_SYS_WAIT # <sys/wait.h>
+
+# allow for quick module/library/etc processing checks
+if test "x$NETSNMP_QUICK_CHECK" = "x" ; then
+
+##
+# Stand-alone headers:
+##
+# Core:
+AC_CHECK_HEADERS([getopt.h pthread.h regex.h ] dnl
+ [string.h syslog.h unistd.h ] dnl
+ [stdint.h inttypes.h ] dnl
+ [sys/param.h ] dnl
+ [sys/select.h ] dnl
+ [sys/socket.h ] dnl
+ [sys/time.h ] dnl
+ [sys/timeb.h ] dnl
+ [sys/un.h ])
+
+# Library and Agent:
+AC_CHECK_HEADERS([nlist.h],,,[
+AC_INCLUDES_DEFAULT
+[
+#ifndef LIBBSD_DISABLE_DEPRECATED
+#define LIBBSD_DISABLE_DEPRECATED 1
+#endif
+]])
+
+# Library:
+AC_CHECK_HEADERS([fcntl.h io.h kstat.h ] dnl
+ [limits.h locale.h ] dnl
+ [sys/file.h sys/ioctl.h ] dnl
+ [sys/sockio.h sys/stat.h ] dnl
+ [sys/systemcfg.h sys/systeminfo.h ] dnl
+ [sys/times.h sys/uio.h ] dnl
+ [sys/utsname.h ] dnl
+ [netipx/ipx.h ])
+
+# Agent:
+AC_CHECK_HEADERS([dlfcn.h err.h fcntl.h fstab.h ] dnl
+ [ grp.h io.h ] dnl
+ [ioctls.h kstat.h kvm.h limits.h ] dnl
+ [ mntent.h mtab.h ] dnl
+ [ pkglocs.h pwd.h ] dnl
+ [ utmpx.h utsname.h ])
+
+AC_CHECK_HEADERS([sys/diskio.h sys/dkio.h ] dnl
+ [sys/file.h sys/filio.h sys/fixpoint.h ] dnl
+ [sys/fs.h sys/ioctl.h sys/loadavg.h sys/mntent.h ] dnl
+ [sys/mnttab.h sys/pool.h sys/protosw.h sys/pstat.h ] dnl
+ [sys/sockio.h sys/stat.h sys/statfs.h sys/statvfs.h ] dnl
+ [sys/stream.h sys/sysget.h sys/sysmp.h ] dnl
+ [sys/tcpipstats.h sys/utsname.h sys/vfs.h ] dnl
+ [sys/vm.h sys/vmmac.h sys/vmmeter.h sys/vmparam.h ] dnl
+ [sys/vmsystm.h ])
+
+AC_CHECK_HEADERS([asm/page.h asm/types.h ] dnl
+ [inet/mib2.h ] dnl
+ [linux/hdreg.h linux/tasks.h ] dnl
+ [machine/param.h ] dnl
+ [netinet/tcp_fsm.h ] dnl
+ [ufs/fs.h ] dnl
+ [uvm/uvm_extern.h uvm/uvm_param.h ] dnl
+ [vm/vm.h vm/vm_extern.h vm/vm_param.h ])
+
+# Apps:
+AC_CHECK_HEADERS([fcntl.h grp.h pwd.h ] dnl
+ [sys/cdefs.h sys/ioctl.h ] dnl
+ [sys/socket.h sys/sockio.h ] dnl
+ [sys/time.h ])
+
+# Not-Used:
+AC_CHECK_HEADERS([search.h sgtty.h xti.h ] dnl
+ [sys/dmap.h sys/poll.h ] dnl
+ [sys/timeout.h ] dnl
+ [machine/pte.h ] dnl
+ [pci/pci.h ])
+
+
+# Valgrind
+AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h])
+# OpenSSL
+AC_CHECK_HEADERS([openssl/aes.h ]) # (Core)
+AC_CHECK_HEADERS([openssl/dh.h ]) # (Apps)
+# Not-Used:
+AC_CHECK_HEADERS([openssl/des.h openssl/hmac.h ] dnl
+ [openssl/evp.h security/cryptoki.h])
+
+# RPM subdirectory path (Agent)
+if test "x$with_rpm" != "xno"; then
+ AC_CHECK_HEADERS([rpm/rpmts.h rpm/rpmfileutil.h], [], [],
+ [[#include <rpm/rpmlib.h>]])
+fi
+
+
+##
+# Pre-requisite on other headers:
+##
+
+# requiring <sys/param.h> (MAXPATHLEN) (OpenBSD 3.4)
+# Agent:
+#
+AC_CHECK_HEADERS(sys/swap.h,,,
+ AC_INCLUDES_DEFAULT([])
+ [
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+ ])
+
+# requiring <sys/param.h> (FreeBSD)
+#
+# Core: (? Tested above? )
+AC_CHECK_HEADERS([stdlib.h ],,,
+ [[
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+ ]])
+#
+# Library:
+AC_CHECK_HEADERS([malloc.h net/if_dl.h sys/sysctl.h ],,,
+ [[
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+ ]])
+#
+# Agent:
+AC_CHECK_HEADERS([malloc.h osreldate.h ] dnl
+ [machine/types.h net/if_dl.h net/if_types.h ] dnl
+ [sys/dkstat.h sys/conf.h sys/mbuf.h ] dnl
+ [sys/mount.h sys/proc.h sys/queue.h ] dnl
+ [sys/sysctl.h sys/user.h ],,,
+ [[
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+ ]])
+
+# requiring <sys/sema.h> (IRIX 6.5)
+# Agent:
+#
+AC_CHECK_HEADERS([sys/sema.h])
+AC_CHECK_HEADERS(sys/hashing.h,,,
+ AC_INCLUDES_DEFAULT([])
+ [
+#if HAVE_SYS_SEMA_H
+#include <sys/sema.h>
+#endif
+ ])
+
+# requiring <sys/socket.h> (Solaris 9)
+# Agent:
+#
+AC_CHECK_HEADERS(sys/socketvar.h,,,
+ AC_INCLUDES_DEFAULT([])
+ [
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+ ])
+
+# requiring _KMEMUSER and <sys/types.h> (BSDi3/IRIX)
+# Agent:
+#
+AC_CHECK_HEADERS(sys/vnode.h,,,
+ [
+#define _KMEMUSER 1
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+ ])
+
+# requiring <machine/types.h> (NetBSD)
+# Agent:
+#
+AC_CHECK_HEADERS(sys/disklabel.h,,,
+ [[
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_MACHINE_TYPES_H
+#include <machine/types.h>
+#endif
+ ]])
+
+# QNX
+AC_CHECK_HEADERS([nbutil.h])
+
+# UFS headers
+# Agent:
+#
+AC_CHECK_HEADERS([ufs/ufs/dinode.h ufs/ufs/quota.h ufs/ufs/inode.h ufs/ffs/fs.h],,,
+ [[
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_UFS_UFS_DINODE_H
+#include <ufs/ufs/dinode.h>
+#endif
+#if HAVE_UFS_UFS_QUOTA_H
+#include <ufs/ufs/quota.h>
+#endif
+ ]])
+
+# requiring <vm/vm.h> (BSDi2)
+# Agent:
+#
+AC_CHECK_HEADERS(vm/swap_pager.h,,,
+ [[
+#if HAVE_VM_VM_H
+#include <vm/vm.h>
+#endif
+ ]])
+
+# netlink/rtnetlink (Linux)
+# Agent:
+#
+AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],,,
+ [[
+#if HAVE_ASM_TYPES_H
+#include <asm/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_LINUX_NETLINK_H
+#include <linux/netlink.h>
+#endif
+ ]])
+
+
+# Network headers
+# Core or Library/Agent/Apps:
+#
+AC_CHECK_HEADERS([arpa/inet.h net/if.h ] dnl
+ [netinet/in.h netdb.h ],,,
+ [[
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_TIMEOUT_H
+#include <sys/timeout.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_SOCKETVAR_H
+#include <sys/socketvar.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_IP_ICMP_H
+#include <netinet/ip_icmp.h>
+#endif
+#if HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_TCP_TIMER_H
+#include <netinet/tcp_timer.h>
+#endif
+ ]])
+#
+# Agent:
+AC_CHECK_HEADERS([net/if_arp.h net/if_mib.h net/if_var.h ] dnl
+ [netinet/if_ether.h netinet/in_systm.h netinet/in_var.h ] dnl
+ [netinet/ip.h netinet/ip_icmp.h ] dnl
+ [netinet/icmp_var.h netinet/ip_var.h ] dnl
+ [netinet/tcp.h netinet/tcp_timer.h netinet/tcp_var.h] dnl
+ [netinet/tcpip.h netinet/udp.h netinet/udp_var.h] dnl
+ [net/route.h netinet/icmp6.h ],,,
+ [[
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_TIMEOUT_H
+#include <sys/timeout.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_SOCKETVAR_H
+#include <sys/socketvar.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_IP_ICMP_H
+#include <netinet/ip_icmp.h>
+#endif
+#if HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_TCP_TIMER_H
+#include <netinet/tcp_timer.h>
+#endif
+#if HAVE_NETINET_ICMP6_H
+#include <netinet/icmp6.h>
+#endif
+ ]])
+
+# KAME (IPv6) headers
+# Agent:
+#
+# KAME
+AC_CHECK_HEADERS([netinet/ip6.h ] dnl
+ [netinet6/in6_var.h netinet6/in6_pcb.h ] dnl
+ [netinet6/ip6_var.h netinet6/nd6.h ] dnl
+ [netinet6/tcp6.h netinet6/tcp6_fsm.h ] dnl
+ [netinet6/tcp6_timer.h netinet6/tcp6_var.h],,,
+ [[
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP6_H
+#include <netinet/ip6.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+ ]])
+
+# requiring <netinet/in.h> (OpenBSD 2.6)
+# Agent:
+#
+AC_CHECK_HEADERS(netinet/in_pcb.h,,,
+ [[
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_TIMEOUT_H
+#include <sys/timeout.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+ ]])
+
+##
+# Pre-requisite on specific types
+##
+
+# Special hack to get around various problems on older Linux kernels
+# (major ugh!)
+# Agent:
+#
+AC_CHECK_HEADERS([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 */
+]])
+
+##
+# Headers requiring particular libraries
+##
+
+# for HostRes (Solaris 2.x)
+# Agent:
+#
+AC_CHECK_HEADERS(pkginfo.h,
+ NETSNMP_SEARCH_LIBS(pkginfo, adm,
+ AC_DEFINE(HAVE_PKGINFO, 1, [define if you have pkginfo]),,,LMIBLIBS))
+
+case $target_os in
+ aix*)
+ # for CPU/memory statistics (AIX)
+ # Agent:
+ #
+ AC_CHECK_HEADERS(libperfstat.h,
+ NETSNMP_SEARCH_LIBS(perfstat_cpu_total, perfstat,
+ AC_DEFINE(HAVE_PERFSTAT, 1, [on aix, if you have perfstat]),
+ AC_MSG_ERROR([
+
+*** To monitor CPU/memory values in AIX you need to install
+*** libperfstat which can be found in bos.perf
+]),,
+ LMIBLIBS),,
+ [[
+#if HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+ ]])
+ ;;
+ hpux*)
+ # HP-UX agent needs open_mib (XXX - not a header check!)
+ #
+ NETSNMP_SEARCH_LIBS(open_mib, nm,
+ AC_DEFINE(HAVE_LIBNM, 1, [define if you have libnm]),,,LMIBLIBS)
+ ;;
+ *)
+ ;;
+esac
+
+# for MIB-2 info (Cygwin and MinGW)
+# Core:
+#
+AC_CHECK_HEADERS([windows.h iphlpapi.h], [], [], [
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+])
+
+# for MIB-2 info (MinGW)
+# Core:
+#
+if test x$with_socklib = xwinsock2; then
+ AC_CHECK_HEADERS([winsock.h winsock2.h ws2tcpip.h])
+fi
+
+#
+# for ucd-snmp/lmsensorsMib
+#
+AC_CHECK_HEADERS([sensors/sensors.h picl.h])
+
+fi # NETSNMP_QUICK_CHECK
diff --git a/configure.d/config_os_libs1 b/configure.d/config_os_libs1
new file mode 100644
index 0000000..35f052a
--- /dev/null
+++ b/configure.d/config_os_libs1
@@ -0,0 +1,95 @@
+# -*- autoconf -*-
+#########################################
+##
+# Checks for libraries that are run
+# before the agent module tests.
+##
+#########################################
+
+
+##
+# RPM checks
+#
+##
+AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h)
+
+AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no)
+AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no)
+
+if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then
+ if test "x$with_rpm" = "xyes" ; then
+ AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support])
+ else
+ with_rpm=no
+ fi
+fi
+
+#
+# rpm libraries only needed for the host resources mib software
+# installed tables (on linux in particular)
+#
+if test "x$with_rpm" != "xno"; then
+ # ARG. RPM is a real pain.
+ # FWIW librpm.la, librpmio.la, and libpopt.la have correct dependencies.
+ _rpmlibs=""
+
+ # rpm-4.0.x needs rpmio.
+ NETSNMP_SEARCH_LIBS(rpmGetPath, rpmio,,, $LMIBLIBS, _rpmlibs)
+
+ # rpm-4.0.3 librpmdb actually contains what we need.
+ NETSNMP_SEARCH_LIBS(rpmdbOpen, rpmdb,,, $LMIBLIBS, _rpmlibs)
+ # now check for rpm using the appropriate libraries.
+ NETSNMP_SEARCH_LIBS(rpmReadConfigFiles, rpm, [
+ AC_DEFINE(HAVE_LIBRPM, 1,
+ [Define to 1 if you have the `rpm' library (-lrpm).])
+ LMIBLIBS="$_rpmlibs $LMIBLIBS"
+ ],, $LMIBLIBS, _rpmlibs)
+
+ # rpm 4.6 has incompatible API, turn on the legacy one
+ AC_CHECK_DECL([headerGetEntry],
+ : ,
+ AC_DEFINE([_RPM_4_4_COMPAT], [], [Define if you have RPM 4.6 or newer to turn on legacy API]),
+ [[#include <rpm/rpmlib.h>]]
+ )
+fi
+
+#
+# getfsstat/getvfsstat
+#
+AC_SEARCH_LIBS(getfsstat, [nbutil])
+AC_CHECK_FUNCS(getfsstat)
+AC_CHECK_FUNCS(getvfsstat)
+AC_FUNC_GETMNTENT
+
+#
+# kinfo_get_cpus
+#
+AC_SEARCH_LIBS(kinfo_get_cpus, [kinfo])
+AC_CHECK_FUNCS(kinfo_get_cpus)
+
+#
+# diskIOLAx requires exp which may require -lm
+#
+AC_SEARCH_LIBS(exp, [m])
+
+#
+# libkvm
+#
+NETSNMP_SEARCH_LIBS(kvm_read, kvm,,,, LAGENTLIBS)
+NETSNMP_SEARCH_LIBS(kvm_openfiles, kvm,,,, LAGENTLIBS)
+NETSNMP_SEARCH_LIBS(kvm_getprocs, kvm,,,, LMIBLIBS)
+NETSNMP_SEARCH_LIBS(kvm_getproc2, kvm,,,, LMIBLIBS)
+NETSNMP_SEARCH_LIBS(kvm_getswapinfo, kvm,,,, LMIBLIBS)
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LAGENTLIBS $LMIBLIBS $LIBS"
+AC_CHECK_FUNCS([kvm_openfiles kvm_getprocs kvm_getproc2 kvm_getswapinfo])
+LIBS="$netsnmp_save_LIBS"
+
+#
+# dynamic module support
+#
+NETSNMP_SEARCH_LIBS([dlopen], [dl],,, [$LAGENTLIBS $LSNMPLIBS], [LMIBLIBS])
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LMIBLIBS $LAGENTLIBS $LSNMPLIBS $LIBS"
+AC_CHECK_FUNCS([dlopen])
+LIBS="$netsnmp_save_LIBS"
diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2
new file mode 100644
index 0000000..677f3e6
--- /dev/null
+++ b/configure.d/config_os_libs2
@@ -0,0 +1,487 @@
+# -*- autoconf -*-
+#########################################
+##
+# Checks for libraries that are run
+# after the agent module tests.
+##
+#########################################
+
+# HAVE_LIB Definitions used in the Net-SNMP code base:
+#
+# HAVE_LIBCRYPTO: apps
+# HAVE_LIBRPM: agent
+#
+
+##
+# Simple checks:
+##
+
+# AC_CHECK_LIB(des, main)
+# AC_CHECK_LIB(m, asin)
+
+# dmalloc
+#
+if test "${with_dmalloc+set}" = set; then
+ if test "$with_dmalloc" = yes -a -d $with_dmalloc ; then
+ AC_ADD_SEARCH_PATH($with_dmalloc)
+ fi
+ AC_CHECK_HEADERS([dmalloc.h])
+ AC_SEARCH_LIBS([dmalloc_message], [dmalloc])
+fi
+
+# EFence
+# (This used to be on by default for developer checkout)
+#
+if test "x$use_efence" = "xyes"; then
+ AC_SEARCH_LIBS([EF_Exit], [efence])
+fi
+
+
+# ELF libraries
+# Typically used for 'nlist' (needed for uptime)
+#
+if test "x$with_elf" != "xno"; then
+case $target_os in
+ linux*) # add hosts which don't use nlist here
+ ;;
+ irix*) # Check for nlist in mld (irix)
+ AC_CHECK_LIB(elf, nlist)
+ AC_CHECK_LIB(elf, nlist64)
+ AC_CHECK_LIB(mld, nlist)
+ ;;
+ *) # default
+ AC_CHECK_LIB(elf, nlist)
+ ;;
+esac
+fi
+
+
+# libsocket
+# Needed for 'socket(2)' (Solaris)
+# Possibly also for 'gethostname(3)' (non-Solaris)
+# (alternatively in libnsl (Solaris)
+# or in libws2_32) (MinGW)
+#
+case x$with_socklib in
+xwinsock2)
+ # libws2_w32 (MinGW)
+ #
+ netsnmp_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ #include <winsock2.h>
+ ], [
+ socket(0, 0, 0);
+ gethostbyname(0);
+ ])], [
+ # Keep LIBS.
+ true
+ ], [
+ # Restore LIBS and complain.
+ LIBS="$netsnmp_save_LIBS"
+ AC_MSG_ERROR([libws2_32 not found.])
+ ])
+ ;;
+*)
+ AC_SEARCH_LIBS(socket, socket,,AC_MSG_ERROR([socket(2) not found.]))
+ AC_SEARCH_LIBS(gethostbyname, [nsl socket])
+ AC_CHECK_FUNCS(gethostbyname)
+ AC_SEARCH_LIBS(gethostbyaddr, [nsl socket])
+ AC_CHECK_FUNCS(gethostbyaddr)
+ ;;
+esac
+
+
+# libiphlpapi (Cygwin and MinGW)
+#
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LIBS -liphlpapi"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ #include <winsock2.h>
+ #include <iphlpapi.h>
+], [
+ IpRenewAddress(0);
+])], [
+ # Keep LIBS.
+ true
+], [
+ # Restore LIBS and complain.
+ LIBS="$netsnmp_save_LIBS"
+ case x$with_socklib in
+ xwinsock2)
+ AC_MSG_ERROR([libiphlpapi not found.])
+ ;;
+ esac
+])
+
+
+# libregex (MinGW)
+#
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LIBS -lregex"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ #include <sys/types.h>
+ #include <regex.h>
+], [
+ regcomp(0, 0, 0);
+])], [
+ # Keep LIBS.
+ true
+], [
+ # Restore LIBS.
+ LIBS="$netsnmp_save_LIBS"
+])
+
+
+# libsnmpapi (MinGW)
+#
+netsnmp_save_LIBS="$LIBS"
+LIBS="$LIBS -lsnmpapi"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ #include <snmp.h>
+], [
+ SnmpUtilMemAlloc(0);
+])], [
+ # Keep LIBS.
+ true
+], [
+ # Restore LIBS.
+ LIBS="$netsnmp_save_LIBS"
+])
+
+
+# kstat library (Solaris)
+#
+NETSNMP_SEARCH_LIBS(kstat_lookup, kstat,
+ AC_DEFINE(HAVE_LIBKSTAT, 1,
+ [Define to 1 if you have the `kstat' library (-lkstat).]),,,
+ LNETSNMPLIBS)
+
+
+#
+# librt
+#
+
+NETSNMP_SEARCH_LIBS(clock_gettime, rt,
+ AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
+ [Define to 1 if you have the `clock_gettime' library]),,,
+ LNETSNMPLIBS)
+
+
+##
+# MIB-module-specific checks
+##
+
+# libdevstat
+# (for diskIO MIB)
+#
+# Not-Used: HAVE_GETDEVS/HAVE_DEVSTAT_GETDEVS
+#
+echo " $module_list " | $GREP " ucd-snmp/diskio " >/dev/null
+if test $? -eq 0 ; then
+ NETSNMP_SEARCH_LIBS(getdevs, devstat,
+ AC_DEFINE(HAVE_GETDEVS, 1,
+ [define if you have getdevs()]),,,LMIBLIBS)
+ NETSNMP_SEARCH_LIBS(devstat_getdevs, devstat,
+ AC_DEFINE(HAVE_DEVSTAT_GETDEVS, 1,
+ [define if you have devstat_getdevs()]),,,LMIBLIBS)
+fi
+
+# libpci
+# (for if-mib description)
+#
+NETSNMP_SEARCH_LIBS(pci_lookup_name, pci,
+ AC_DEFINE(HAVE_PCI_LOOKUP_NAME, 1,
+ [define if you have pci_lookup_name()]),,,LMIBLIBS)
+
+# LM-SENSORS-MIB support
+#
+echo " $module_list " | $GREP -i "ucd-snmp/lmsensor" > /dev/null
+if test $? -eq 0 ; then
+ AC_MSG_CHECKING([for sensors support])
+ case $target_os in
+ solaris*)
+ # Agent: HAVE_PICL_H
+ #
+ AC_CHECK_HEADER(picl.h, LMIBLIBS="${LMIBLIBS} -lpicl",)
+ AC_CHECK_HEADERS(picl.h)
+ ;;
+ *)
+ # Not-Used: HAVE_SENSORS_SENSORS_H
+ #
+ AC_CHECK_HEADER(sensors/sensors.h,,
+ [AC_MSG_ERROR([asked to use lm_sensors but I couldn't find sensors/sensors.h])])
+ NETSNMP_SEARCH_LIBS(sensors_get_detected_chips, sensors,,
+ [AC_MSG_ERROR([asked to use lm_sensors but I couldn't find -lsensors])],,
+ LMIBLIBS)
+ ;;
+ esac
+fi
+
+#
+# libnl (netlink)
+#
+
+if test "x$with_nl" != "xno"; then
+ case $target_os in
+ linux*) # Check for libnl (linux)
+ NETSNMP_SEARCH_LIBS(
+ nl_connect, nl,
+ [AC_CHECK_HEADERS(netlink/netlink.h)],,, LMIBLIBS)
+ ;;
+ esac
+fi
+
+
+
+##
+# More complex checks:
+##
+
+# Security related functions
+#
+NONAGENTLIBS=$LIBS # save old libraries
+SSHPROG=no
+TLSPROG=no
+if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then
+ # check for libpkcs11 if asked
+ if test "x$askedopenssl" != "xyes" -a "x$askedpkcs" = "xyes"; then
+ AC_CHECK_LIB(pkcs11, C_Initialize,
+ AC_DEFINE(HAVE_LIBPKCS11, 1,
+ [Define to 1 if you have the `pkcs11' library (-lpkcs11).])
+ LIBPKCS11="-lpkcs11")
+ else
+ if test "x$tryrsaref" != "xno"; then
+ AC_CHECK_LIB(rsaref, RSAPrivateDecrypt)
+ AC_CHECK_LIB(RSAglue, RSA_PKCS1_RSAref)
+ fi
+
+ AC_MSG_CHECKING([for -leay32])
+ netsnmp_save_LIBS="$LIBS"
+ LIBS="-leay32"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ #include <openssl/evp.h>],
+ [return EVP_md5();])],
+ [AC_MSG_RESULT(yes); ac_cv_lib_eay32_EVP_md5=yes; CRYPTO="eay32"],
+ [AC_MSG_RESULT(no)]
+ )
+ LIBS="$netsnmp_save_LIBS"
+
+ if test x$CRYPTO = x; then
+ AC_CHECK_LIB([crypto], [EVP_md5], [CRYPTO="crypto"])
+ fi
+
+ if test x$CRYPTO != x; then
+ AC_DEFINE(HAVE_LIBCRYPTO, 1,
+ [Define to 1 if you have the OpenSSL library (-lcrypto or -leay32).])
+ LIBCRYPTO="-l${CRYPTO}"
+ AC_CHECK_LIB(${CRYPTO}, AES_cfb128_encrypt,
+ AC_DEFINE(HAVE_AES_CFB128_ENCRYPT, 1,
+ [Define to 1 if you have the `AES_cfb128_encrypt' function.]))
+
+ AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_create,
+ AC_DEFINE([HAVE_EVP_MD_CTX_CREATE], [],
+ [Define to 1 if you have the `EVP_MD_CTX_create' function.])
+ AC_DEFINE([HAVE_EVP_MD_CTX_DESTROY], [],
+ [Define to 1 if you have the `EVP_MD_CTX_destroy' function.]))
+ fi
+ if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then
+ AC_CHECK_LIB(ssl, DTLSv1_method,
+ AC_DEFINE(HAVE_LIBSSL_DTLS, 1,
+ [Define to 1 if your `ssl' library supports DTLS (-lssl).])
+ LIBCRYPTO=" -lssl $LIBCRYPTO",
+ AC_MSG_ERROR([The DTLS based transports require the libssl library from OpenSSL to be available and support DTLS]) ,-lcrypto)
+ TLSPROG=yes
+ fi
+ if echo " $transport_result_list " | $GREP "TLS" > /dev/null; then
+ AC_CHECK_LIB(ssl, SSL_library_init,
+ AC_DEFINE(HAVE_LIBSSL, 1,
+ [Define to 1 if you have the `ssl' library (-lssl).])
+ LIBCRYPTO=" -lssl $LIBCRYPTO",
+ AC_MSG_ERROR([The DTLS based transports require the libssl library from OpenSSL to be available]) ,-lcrypto)
+ TLSPROG=yes
+ fi
+ if echo " $transport_result_list " | $GREP " SSH " > /dev/null; then
+ AC_CHECK_LIB(ssh2, libssh2_session_startup,
+ AC_DEFINE(HAVE_LIBSSH2, 1,
+ [Define to 1 if you have the `ssh2' library (-lssh2).])
+ LIBCRYPTO=" -lssh2 $LIBCRYPTO",
+ AC_MSG_ERROR([The SSH transport requires the libssh2 library to be available]),)
+ SSHPROG=yes
+ fi
+ fi
+elif test "x$askedpkcs" = "xyes"; then
+ AC_CHECK_LIB(pkcs11, C_Initialize,
+ AC_DEFINE(HAVE_LIBPKCS11)
+ LIBPKCS11="-lpkcs11")
+fi
+if test "x$TLSPROG" = "xyes"; then
+ AC_CHECK_DECL([EVP_sha224],
+ : ,
+ AC_DEFINE([HAVE_EVP_SHA224], [], [Define if you have EVP_sha224/256 in openssl]),
+ [[#include <openssl/evp.h>]])
+ AC_CHECK_DECL([EVP_sha384],
+ : ,
+ AC_DEFINE([HAVE_EVP_SHA384], [], [Define if you have EVP_sha384/256 in openssl]),
+ [[#include <openssl/evp.h>]])
+fi
+
+LIBS=$NONAGENTLIBS # restore old libraries
+if test "x$SSHPROG" = "xyes"; then
+ NETSNMP_BUILD_SSH_PROG_TRUE=''
+ NETSNMP_BUILD_SSH_PROG_FALSE='#'
+else
+ NETSNMP_BUILD_SSH_PROG_TRUE='#'
+ NETSNMP_BUILD_SSH_PROG_FALSE=''
+fi
+if test "x$TLSPROG" = "xyes" -a "x$enable_read_only" != "xyes" ; then
+ NETSNMP_BUILD_TLS_PROG_TRUE=''
+ NETSNMP_BUILD_TLS_PROG_FALSE='#'
+else
+ NETSNMP_BUILD_TLS_PROG_TRUE='#'
+ NETSNMP_BUILD_TLS_PROG_FALSE=''
+fi
+if echo " ${security_mod_list} " | grep ' usm ' ; then
+ if test "x$enable_read_only" != "xyes" ; then
+ NETSNMP_BUILD_USM_PROG_TRUE=''
+ NETSNMP_BUILD_USM_PROG_FALSE='#'
+ else
+ NETSNMP_BUILD_USM_PROG_TRUE='#'
+ NETSNMP_BUILD_USM_PROG_FALSE=''
+ fi
+else
+ NETSNMP_BUILD_USM_PROG_TRUE='#'
+ NETSNMP_BUILD_USM_PROG_FALSE=''
+fi
+if test "x$enable_read_only" != "xyes" ; then
+ NETSNMP_BUILD_SET_PROG_TRUE=""
+ NETSNMP_BUILD_SET_PROG_FALSE="#"
+else
+ NETSNMP_BUILD_SET_PROG_TRUE="#"
+ NETSNMP_BUILD_SET_PROG_FALSE=""
+fi
+AC_SUBST(NETSNMP_BUILD_SSH_PROG_TRUE)
+AC_SUBST(NETSNMP_BUILD_SSH_PROG_FALSE)
+AC_SUBST(NETSNMP_BUILD_TLS_PROG_TRUE)
+AC_SUBST(NETSNMP_BUILD_TLS_PROG_FALSE)
+AC_SUBST(NETSNMP_BUILD_USM_PROG_TRUE)
+AC_SUBST(NETSNMP_BUILD_USM_PROG_FALSE)
+AC_SUBST(NETSNMP_BUILD_SET_PROG_TRUE)
+AC_SUBST(NETSNMP_BUILD_SET_PROG_FALSE)
+
+#
+# If we're using internal crypto support we need to compile in extra files
+#
+crypto_files_c=""
+crypto_files_o=""
+crypto_files_lo=""
+if test "x$tryopenssl" != "xno" -a "x$CRYPTO" = "x"; then
+ # If we:
+ # 1) couldn't find needed openssl support
+ # 2) OR were asked to use internal support
+ # 3) AND we have the needed files
+ # then use it
+ CRYPTO="internal"
+ crypto_files_c="openssl/openssl_sha1.c openssl/openssl_md5.c openssl/openssl_set_key.c openssl/openssl_des_enc.c openssl/openssl_cbc_enc.c openssl/openssl_aes_cfb.c openssl/openssl_aes_core.c openssl/openssl_cfb128.c"
+ crypto_files_o="openssl/openssl_sha1.o openssl/openssl_md5.o openssl/openssl_set_key.o openssl/openssl_des_enc.o openssl/openssl_cbc_enc.o openssl/openssl_aes_cfb.o openssl/openssl_aes_core.oo openssl/openssl_cfb128.o"
+ crypto_files_lo="openssl/openssl_sha1.lo openssl/openssl_md5.lo openssl/openssl_set_key.lo openssl/openssl_des_enc.lo openssl/openssl_cbc_enc.lo openssl/openssl_aes_cfb.lo openssl/openssl_aes_core.lo openssl/openssl_cfb128.lo"
+ AC_DEFINE(HAVE_AES_CFB128_ENCRYPT)
+fi
+AC_SUBST(crypto_files_c)
+AC_SUBST(crypto_files_o)
+AC_SUBST(crypto_files_lo)
+
+#
+# if we can do any sort of crypto then note it
+#
+if test "x$CRYPTO" != "x" ; then
+ AC_DEFINE(NETSNMP_CAN_DO_CRYPTO, 1, "Define if crytography support is possible")
+fi
+
+# TCP wrapper support
+#
+_cppflags="${CPPFLAGS}"
+_ldflags="${LDFLAGS}"
+if test "$with_libwrap" != "no"; then
+ if test "$with_libwrap" != "yes"; then
+ CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
+ LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
+ fi
+
+ _libs=${LIBS}
+ AC_CHECK_HEADER(tcpd.h, ,
+ AC_MSG_ERROR([Asked to use libwrap but I couldn't find tcpd.h.]))
+
+ LIBS="$LIBS -lwrap"
+ AC_MSG_CHECKING([for TCP wrappers library -lwrap])
+ # XXX: should check for hosts_ctl
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <tcpd.h>
+ int allow_severity = 0;
+ int deny_severity = 0;]],
+ [[hosts_access((void *)0)]])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(NETSNMP_USE_LIBWRAP)
+ test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
+ _wraplibs="$_wraplibs -lwrap"],
+ [AC_MSG_RESULT([no])
+ # Linux RedHat 6.1 won't link libwrap without libnsl
+ AC_CHECK_FUNC(yp_get_default_domain, ,
+ AC_CHECK_LIB(nsl, yp_get_default_domain))
+ AC_MSG_CHECKING([for TCP wrappers library -lwrap linked with -lnsl])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <tcpd.h>
+ int allow_severity = 0;
+ int deny_severity = 0;]],
+ [[hosts_access((void *)0)]])],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(NETSNMP_USE_LIBWRAP)
+ test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
+ _wraplibs="$_wraplibs -lwrap -lnsl"],
+ [AC_MSG_RESULT(no)
+ AC_MSG_ERROR(Asked to use libwrap but I couldn't find it.)])])
+ LAGENTLIBS="$_wraplibs"
+ CPPFLAGS=${_cppflags}
+ LDFLAGS=${_ldflags}
+ LIBS=${_libs}
+fi
+
+
+##
+# mysql
+##
+if test "x$with_mysql" = "xyes" ; then
+ AC_PATH_PROGS(MYSQLCONFIG,mysql_config)
+ AC_CHECK_HEADERS(mysql/mysql.h)
+ AC_CHECK_HEADER(mysql/mysql.h,mysql_h=yes,mysql_h=no)
+ if test "x$MYSQLCONFIG" = "x" -o "x$mysql_h" = "xno"; then
+ AC_MSG_ERROR([Could not find mysql_config or mysql.h and was specifically asked to use MySQL support])
+ fi
+ MYSQL_LIBS=`$MYSQLCONFIG --libs`
+ MYSQL_INCLUDES=`$MYSQLCONFIG --cflags`
+ AC_MSG_CHECKING([whether MY_INIT() works])
+ _libs="${LIBS}"
+ _cppflags="${CPPFLAGS}"
+ LIBS="${LIBS} ${MYSQL_LIBS}"
+ CPPFLAGS="${CPPFLAGS} ${MYSQL_INCLUDES}"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mysql/my_global.h>
+ #include <mysql/my_sys.h>]], [[MY_INIT("my_init_test")]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
+ AC_DEFINE([HAVE_BROKEN_LIBMYSQLCLIENT], 1,
+ [Define if using MY_INIT() causes a linker error])])
+ CPPFLAGS="${_cppflags}"
+ LIBS="${_libs}"
+ AC_MSG_CACHE_ADD(MYSQL Trap Logging: enabled)
+else
+ AC_MSG_CACHE_ADD(MYSQL Trap Logging: unavailable)
+fi
+AC_SUBST(MYSQL_LIBS)
+AC_SUBST(MYSQL_INCLUDES)
+
+
+##
+# Non-library checks
+##
+
+# nlist
+AC_CHECK_FUNCS(nlist nlist64 knlist)
+
diff --git a/configure.d/config_os_misc1 b/configure.d/config_os_misc1
new file mode 100644
index 0000000..feec9a9
--- /dev/null
+++ b/configure.d/config_os_misc1
@@ -0,0 +1,24 @@
+# -*- autoconf -*-
+#########################################
+##
+# Miscellaneous checks
+##
+#########################################
+
+##
+# Compilation-related
+##
+
+# Dynamic modules require Position-Independent Code
+# LIB_CFLAGS/DLLIBS: used in agent Makefile only
+#
+AC_MSG_CHECKING([whether we have to build PIC code])
+echo " $module_list " | $GREP " ucd-snmp/dlmod " >/dev/null
+if test $? -eq 0 ; then
+ LIB_CFLAGS="$LIB_CFLAGS $SHLIB_CFLAGS"
+ AC_MSG_RESULT(yes)
+else
+ DLLIBS=""
+ AC_MSG_RESULT(no)
+fi
+
diff --git a/configure.d/config_os_misc2 b/configure.d/config_os_misc2
new file mode 100644
index 0000000..e2a8ff5
--- /dev/null
+++ b/configure.d/config_os_misc2
@@ -0,0 +1,142 @@
+# -*- autoconf -*-
+#########################################
+##
+# Miscellaneous checks
+##
+#########################################
+
+##
+# Package characteristics
+# Authentication/Encryption support
+##
+
+# Check for PKCS11
+#
+AC_MSG_CHECKING([for authentication support])
+useopenssl=no
+usepkcs=no
+if test "x$ac_cv_lib_pkcs11_C_Initialize" != "xyes" -o "x$ac_cv_header_security_cryptoki_h" != "xyes"; then
+ if test "x$askedpkcs" = "xyes"; then
+ AC_MSG_ERROR(Asked to use PKCS11 but I couldn't find it.)
+ fi
+else
+ if test "x$askedpkcs" = "xyes"; then
+ usepkcs=yes
+ fi
+fi
+
+# Check for OpenSSL
+#
+if test "x$ac_cv_lib_crypto_EVP_md5" != "xyes" -a "x$ac_cv_lib_eay32_EVP_md5" != "xyes" -o "x$ac_cv_header_openssl_hmac_h" != "xyes"; then
+ if test "x$askedopenssl" = "xyes"; then
+ AC_MSG_ERROR(Asked to use OpenSSL but I couldn't find it.)
+ fi
+else
+ if test "x$askedopenssl" = "xyes"; then
+ useopenssl=yes
+ elif test "x$tryopenssl" = "xyes"; then
+ if test "x$usepkcs" != "xyes"; then
+ useopenssl=yes
+ fi
+ fi
+fi
+
+# Available authentication/encryption modes
+#
+if test "x$CRYPTO" = "xinternal" ; then
+ authmodes="MD5 SHA1"
+ if test "x$enable_privacy" != "xno" ; then
+ encrmodes="DES AES"
+ else
+ encrmodes="[disabled]"
+ fi
+ AC_DEFINE(NETSNMP_USE_INTERNAL_CRYPTO, 1, "Define if internal cryptography code should be used")
+ AC_MSG_RESULT(Internal Crypto Support)
+elif test "x$useopenssl" != "xno" ; then
+ authmodes="MD5 SHA1"
+ if test "x$enable_privacy" != "xno" ; then
+ if test "x$ac_cv_header_openssl_aes_h" = "xyes" ; then
+ encrmodes="DES AES"
+ else
+ encrmodes="DES"
+ fi
+ else
+ encrmodes="[disabled]"
+ fi
+ AC_DEFINE(NETSNMP_USE_OPENSSL)
+ LNETSNMPLIBS="$LNETSNMPLIBS $LIBCRYPTO"
+ AC_MSG_RESULT(OpenSSL Support)
+elif test "x$usepkcs" != "xno" ; then
+ authmodes="MD5 SHA1"
+ if test "x$enable_privacy" != "xno" ; then
+ encrmodes="DES"
+ else
+ encrmodes="[disabled]"
+ fi
+ AC_DEFINE(NETSNMP_USE_PKCS11, 1,
+ [Define if you are using the codeS11 library ...])
+ LNETSNMPLIBS="$LNETSNMPLIBS $LIBPKCS11"
+ AC_MSG_RESULT(PKCS11 Support)
+elif test "x$enable_md5" != "xno"; then
+ authmodes="MD5"
+ encrmodes=""
+ AC_DEFINE(NETSNMP_USE_INTERNAL_MD5)
+ AC_MSG_RESULT(Internal MD5 Support)
+fi
+if test "x$enable_md5" = "xno"; then
+ authmodes=`echo $authmodes | $SED 's/MD5 *//;'`
+fi
+AC_SUBST(LNETSNMPLIBS)
+AC_SUBST(LAGENTLIBS)
+
+AC_MSG_CACHE_ADD(Crypto support from: $CRYPTO)
+AC_MSG_CACHE_ADD(Authentication support: $authmodes)
+AC_MSG_CACHE_ADD(Encryption support: $encrmodes)
+
+if test "x$all_warnings" != "x"; then
+ AC_MSG_CACHE_ADD(WARNING: $all_warnings)
+fi
+
+#
+# Check whether user wants DNSSEC local validation support
+#
+_libs=${LIBS}
+if ! test "x-$want_dnssec" = "x-no" ; then
+ AC_CHECK_HEADERS([validator/validator-config.h])
+ if test "$ac_cv_header_validator_validator_config_h" != yes; then
+ AC_MSG_ERROR(Can't find validator.h)
+ fi
+ if test "x$ac_cv_lib_crypto_EVP_md5" != "xyes" -a \
+ "x$ac_cv_lib_eay32_EVP_md5" != "xyes" -o \
+ "x$ac_cv_header_openssl_hmac_h" != "xyes"; then
+ AC_MSG_ERROR(Couldn't find OpenSSL for local DNSSEC validation support.)
+ fi
+ LIBS="$LIBS $LIBCRYPTO"
+ AC_CHECK_LIB(sres, query_send,,AC_MSG_ERROR([Can't find libsres]))
+ VAL_LIBS="-lsres $LIBCRYPTO"
+ LIBS="$LIBS -lsres"
+ AC_CHECK_LIB(val, p_val_status,
+ LIBS="$LIBS -lval"
+ VAL_LIBS="$VAL_LIBS -lval"
+ have_val_res_query=yes,
+ [ AC_CHECK_LIB(pthread, pthread_rwlock_init)
+ AC_CHECK_LIB(val-threads, p_val_status,
+ have_val_res_query=yes
+ LIBS="-lval-threads $LIBS"
+ VAL_LIBS="-lval-threads -lpthread $VAL_LIBS"
+ LIBVAL_SUFFIX="-threads",
+ AC_MSG_ERROR(Can't find libval or libval-threads))
+ ])
+ AC_DEFINE(DNSSEC_LOCAL_VALIDATION, 1,
+ [Define if you want local DNSSEC validation support])
+ DNSSEC="enabled"
+else
+ DNSSEC="disabled"
+fi
+
+LIBS=${_libs}
+
+AC_SUBST(VAL_LIBS)
+AC_MSG_CACHE_ADD(Local DNSSEC validation: $DNSSEC)
+
+
diff --git a/configure.d/config_os_misc3 b/configure.d/config_os_misc3
new file mode 100644
index 0000000..17aff48
--- /dev/null
+++ b/configure.d/config_os_misc3
@@ -0,0 +1,20 @@
+# -*- autoconf -*-
+#########################################
+##
+# Miscellaneous checks
+##
+#########################################
+
+##
+# Compilation characteristics
+##
+
+# Byte order
+#
+if test "$with_endianness" = "big"; then
+ ac_cv_c_bigendian=yes
+elif test "$with_endianness" = "little" ; then
+ ac_cv_c_bigendian=no
+fi
+AC_C_BIGENDIAN(,,
+ [AC_MSG_ERROR([Failed to figure out host endianness, please use --with-endianness to specify it.])])
diff --git a/configure.d/config_os_misc4 b/configure.d/config_os_misc4
new file mode 100644
index 0000000..b6cb040
--- /dev/null
+++ b/configure.d/config_os_misc4
@@ -0,0 +1,319 @@
+# -*- autoconf -*-
+#########################################
+##
+# Miscellaneous Operating-System characteristics
+##
+#########################################
+
+
+# Determine how to test for character devices
+# [We assume that /dev/null does actually exist!]
+#
+if test -c /dev/null; then
+ CDEV_TEST_FLAG="-c"
+elif test -f /dev/null; then
+ CDEV_TEST_FLAG="-f"
+else
+ AC_MSG_WARN([Can't reliably detect character devices])
+ # Is it actually sensible to fall back on "test -f" ?
+ CDEV_TEST_FLAG="-f"
+fi
+
+# Kernel Location
+# used in library/agent
+#
+AC_CACHE_CHECK([for location of system kernel],
+ ac_cv_KERNEL_LOC,
+ [ac_cv_KERNEL_LOC="unknown"
+ for i in /vmunix /hp-ux /stand/vmunix /dev/ksyms /kernel/unix /kernel/genunix /netbsd /unix /kernel /bsd /mach_kernel /boot/kernel/kernel
+ do
+ if test $CDEV_TEST_FLAG $i; then
+ ac_cv_KERNEL_LOC="$i"
+ break;
+ fi
+ done
+ #
+ # In principle, this test is meant to provide a default path to the kernel
+ # In practice, the test is broken and the kernel path is set to "unknown"
+ #
+ # Note that on certain systems (e.g. some Linux distributions),
+ # it is impossible to predict the name of the kernel,
+ # particularly if it includes the kernel version, architecture, etc
+ #
+ # Since this default will never actually be used, then don't try to set it
+ #
+ if test $i = "unknown"; then
+ AC_MSG_WARN([Can't find system kernel... hopefully this won't be needed!])
+ fi
+])
+AC_DEFINE_UNQUOTED(KERNEL_LOC,"$ac_cv_KERNEL_LOC", [location of UNIX kernel])
+
+
+# /dev/kmem existence
+# used in agent only
+#
+AC_CACHE_CHECK([for /dev/kmem],
+ ac_cv_HAVE_KMEM,
+ [if test $CDEV_TEST_FLAG /dev/kmem; then
+ ac_cv_HAVE_KMEM="/dev/kmem"
+ fi
+])
+#
+# Note that it's OK if this device is not found
+#
+if test "x$ac_cv_HAVE_KMEM" = "x/dev/kmem"; then
+ AC_DEFINE_UNQUOTED(HAVE_KMEM,"$ac_cv_HAVE_KMEM", [Define if you have /dev/kmem])
+fi
+
+
+# Swap device Location
+# (/dev/dmem or /dev/drum)
+# used in agent only
+#
+AC_CACHE_CHECK([for location of swap device],
+ ac_cv_DMEM_LOC,
+ [if test $CDEV_TEST_FLAG /dev/dmem; then
+ ac_cv_DMEM_LOC="/dev/dmem"
+ elif test $CDEV_TEST_FLAG /dev/drum; then
+ ac_cv_DMEM_LOC="/dev/drum"
+ else
+ ac_cv_DMEM_LOC="none"
+ fi
+])
+#
+# Note that it's OK if this device is not found
+#
+if test "x$ac_cv_DMEM_LOC" != "xnone"; then
+ AC_DEFINE_UNQUOTED(DMEM_LOC,"$ac_cv_DMEM_LOC", [location of swap device])
+fi
+
+
+# Mount table Location
+# used in agent only
+#
+AC_CACHE_CHECK([for mount table location],
+ ac_cv_ETC_MNTTAB,
+ [ac_cv_ETC_MNTTAB="${with_mnttab:-unknown}"
+ if test "$ac_cv_ETC_MNTTAB" = "unknown"; then
+ for i in /etc/mnttab /etc/mtab /etc/filesystems /dev/mnttab
+ do
+ if test -f $i -o -c $i; then
+ ac_cv_ETC_MNTTAB="$i"
+ break;
+ fi
+ done
+ fi
+])
+AC_DEFINE_UNQUOTED(ETC_MNTTAB,"$ac_cv_ETC_MNTTAB", [location of mount table list])
+
+
+# Printing
+# used in agent only
+#
+AC_PATH_PROG([LPSTAT_PATH],lpstat)
+if test x$LPSTAT_PATH != x; then
+ AC_DEFINE_UNQUOTED(LPSTAT_PATH, "$LPSTAT_PATH",
+ [Path to the lpstat command])
+ AC_DEFINE(HAVE_LPSTAT, 1, [Set if the lpstat command is available])
+fi
+if test -r /etc/printcap; then
+ AC_DEFINE(HAVE_PRINTCAP, 1, [Set if /etc/printcap exists])
+fi
+
+
+# Check ps args
+# used in agent only
+#
+AC_CACHE_CHECK([for correct flags to ps],
+ ac_cv_ps_flags,
+ [
+if test "`($PSPROG -e 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="-e"
+elif test "`($PSPROG -el 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="-el"
+elif test "`($PSPROG acx 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="acx"
+elif test "`($PSPROG -acx 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="-acx"
+elif test "`($PSPROG -o pid,tt,state,time,ucomm 2>&1) | $EGREP ' ps *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="-o pid,tt,state,time,ucomm"
+elif test "`($PSPROG ax 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
+ ac_cv_ps_flags="ax"
+elif test "x$PARTIALTARGETOS" = "xcygwin"; then
+ ac_cv_ps_flags="-e"
+elif test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ ac_cv_ps_flags="-e"
+else
+ AC_MSG_WARN([Unable to determine valid ps flags... defaulting...])
+ ac_cv_ps_flags="-acx"
+fi
+])
+
+PSCMD="$PSPROG $ac_cv_ps_flags"
+AC_SUBST(PSCMD)
+AC_DEFINE_UNQUOTED(PSCMD, "$PSPROG $ac_cv_ps_flags",
+ [Command to generate ps output, the final column must be the process
+ name withOUT arguments])
+
+
+##
+# System/Compilation-related
+##
+
+# Test for SIGHUP
+#
+
+AC_MSG_CHECKING([for SIGHUP])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([#include <signal.h>], [return SIGHUP])],
+ [netsnmp_have_sighup=yes],
+ [netsnmp_have_sighup=no]
+)
+AC_MSG_RESULT([$netsnmp_have_sighup])
+if test "x$netsnmp_have_sighup" = xyes; then
+ AC_DEFINE([HAVE_SIGHUP], [1],
+ [Define if SIGHUP is defined in <signal.h>.])
+fi
+
+
+# Check whether sysctl() is usable
+# used in library/agent
+#
+if test $cross_compiling = yes; then
+ AC_MSG_WARN([Can't check sysctl, manually define NETSNMP_CAN_USE_SYSCTL if platform support available])
+else
+ AC_CACHE_CHECK([if sysctl can read kernel information],
+ ac_cv_NETSNMP_CAN_USE_SYSCTL,
+ [AC_TRY_RUN([
+#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_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#include <sys/types.h>
+#if HAVE_SYS_SYSCTL_H
+# include <sys/sysctl.h>
+#endif
+
+main() {
+ int mib[2];
+ size_t len;
+ struct timeval boottime;
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_BOOTTIME;
+
+ len = sizeof(boottime);
+ sysctl(mib, 2, &boottime, &len, NULL, NULL);
+ if (boottime.tv_sec != 0)
+ exit(0);
+ else
+ exit(1);
+}
+ ],
+ ac_cv_NETSNMP_CAN_USE_SYSCTL=yes,
+ ac_cv_NETSNMP_CAN_USE_SYSCTL=no,
+ ac_cv_NETSNMP_CAN_USE_SYSCTL=no)])
+fi
+
+if test "x$ac_cv_NETSNMP_CAN_USE_SYSCTL" = "xyes"; then
+ AC_DEFINE(NETSNMP_CAN_USE_SYSCTL, 1, [sysctl works to get boottime, etc...])
+fi
+
+
+# Check whether TCP timer constants are indeed constant
+# or depend on the kernel clock tick 'hz'. (FreeBSD 4.x)
+#
+# If the latter, then we will need to have a local
+# variable 'hz' defined and with a suitable value,
+# whenever we want to use one one of these 'constants'.
+#
+# used in agent only
+#
+AC_CACHE_CHECK([whether TCP timers depend on 'hz'],
+ ac_cv_TCPTV_NEEDS_HZ,
+ [AC_EGREP_CPP(hz,
+ [
+#include <netinet/tcp_timer.h>
+TCPTV_SRTTDFLT
+ ],
+ ac_cv_TCPTV_NEEDS_HZ=yes,
+ ac_cv_TCPTV_NEEDS_HZ=no)])
+
+if test "x$ac_cv_TCPTV_NEEDS_HZ" = "xyes"; then
+ AC_DEFINE(TCPTV_NEEDS_HZ, 1,
+ [Define if the TCP timer constants in <netinet/tcp_timer.h>
+ depend on the integer variable 'hz'. @<:@FreeBSD 4.x@:>@])
+fi
+
+
+# Check whether IP Route table is cached (Solaris)
+# used in agent only
+#
+case $target_os in
+ solaris*)
+ # Header checks (Solaris 2.6/7)
+ #
+ AC_CHECK_HEADERS(inet/common.h)
+ AC_CHECK_HEADERS(inet/ip.h,ac_inet_ip_h=yes,ac_inet_ip_h=no,
+ AC_INCLUDES_DEFAULT([])
+ [
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#if HAVE_INET_COMMON_H
+#include <inet/common.h>
+#endif
+ ])
+ if test $ac_inet_ip_h = yes ; then
+ AC_CACHE_CHECK([for mib2_ipRouteEntry_t in inet/mib2.h],
+ ac_cv_mib2_ipRouteEntry_t,
+ [AC_TRY_COMPILE([
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+ ],[
+ mib2_ipRouteEntry_t testit;
+ if(sizeof(testit))
+ return(0);
+ ],
+ ac_cv_mib2_ipRouteEntry_t=yes,
+ ac_cv_mib2_ipRouteEntry_t=no)])
+
+ if test "x$ac_cv_mib2_ipRouteEntry_t" = "xyes" ; then
+ AC_CACHE_CHECK([whether IRE_CACHE is defined in inet/ip.h],
+ ac_cv_ire_cache,
+ [AC_TRY_COMPILE([
+#if HAVE_INET_IP_H
+#include <inet/ip.h>
+#endif
+ ],[
+ int testit=IRE_CACHE;
+ if(testit)
+ return(0);
+ ],
+ ac_cv_ire_cache=yes,
+ ac_cv_ire_cache=no)])
+ else
+ ac_cv_ire_cache=no
+ fi
+
+ if test "x$ac_cv_ire_cache" = "xyes" ; then
+ AC_DEFINE(HAVE_DEFINED_IRE_CACHE,[],
+ [define to 1 if you have IRE_CACHE defined in <inet/ip.h> header file.])
+ else
+ AC_MSG_WARN([It seems that you have inet/ip.h, but IRE_CACHE is not defined. \
+That means that your query to ipRoute MIB could generate over 20k results! \
+And this can be very slow.])
+ fi
+ fi # "test $ac_inet_ip_h = yes"
+ ;;
+esac
diff --git a/configure.d/config_os_progs b/configure.d/config_os_progs
new file mode 100644
index 0000000..6ab38f4
--- /dev/null
+++ b/configure.d/config_os_progs
@@ -0,0 +1,437 @@
+# -*- autoconf -*-
+#########################################
+##
+# Checks for programs
+##
+#########################################
+
+##
+# Shell checks:
+##
+
+# Check for 'sh' overflow (HP-UX)
+# (taken from Perl's configure script)
+#
+AC_MSG_CHECKING([if I need to feed myself to ksh])
+if test -f /hp-ux -a -f /bin/ksh; then
+ if (PATH=.; alias -x) >/dev/null 2>&1; then
+ AC_MSG_RESULT(no)
+ else
+ AC_MSG_RESULT(yes)
+ if test "x$1" = "x"; then
+ exec /bin/ksh $0
+ else
+ exec /bin/ksh $0 "$@"
+ fi
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
+
+##
+# Standard and path program checks:
+##
+
+AC_PROG_EGREP
+AC_PROG_GREP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_SED
+
+AC_CHECK_PROGS([FILE], [file])
+if test x$ac_cv_prog_FILE = x; then
+ # The file program is not included in the default Cygwin setup, although
+ # this program is essential for libtool to work properly. It is nontrivial
+ # to deduce from the message printed by libtool that the 'file' tool is
+ # missing and libtool does not abort when the file program is not found. So
+ # stop now if the file program has not been found.
+ AC_MSG_ERROR([file program not found although it is needed by libtool.], [1])
+fi
+
+AC_CHECK_PROGS(FIND, find)
+AC_CHECK_PROGS(WHOAMI, whoami logname, whoami)
+
+AC_PATH_PROG(AUTOCONF, autoconf)
+AC_PATH_PROG(AUTOHEADER, autoheader)
+AC_PATH_PROG([PERLPROG], perl)
+AC_PATH_PROG([PSPROG], ps)
+AC_PATH_PROG([PYTHONPROG],python)
+
+AC_PATH_PROG([UNAMEPROG], uname)
+AC_DEFINE_UNQUOTED(UNAMEPROG,"$UNAMEPROG", [Where is the uname command])
+
+if test "x$ac_cv_prog_AUTOCONF" = "x"; then
+ AUTOCONF=":"
+ AC_SUBST(AUTOCONF)
+fi
+if test "x$ac_cv_prog_AUTOHEADER" = "x"; then
+ AUTOHEADER=":"
+ AC_SUBST(AUTOHEADER)
+fi
+
+MAKE=${MAKE-"make"}
+$MAKE -v -f /dev/null 2>/dev/null | $GREP GNU >/dev/null
+have_gnu_make=$?
+
+
+##
+# The Perl function system() is used for running the Net-SNMP regression
+# tests. Find out whether that function invokes a POSIX shell, which is
+# necessary in order to run the regression tests. When using Windows + MSYS
+# + ActiveState Perl, Perl's system() function does invoke Windows' cmd.exe
+# which is not a POSIX shell.
+##
+
+AC_MSG_CHECKING([whether the Perl function system() invokes a POSIX shell])
+if test "x$PERLPROG" != 'x' && test -x "$PERLPROG" && test "x`$PERLPROG -e 'system('"'"'echo $OSTYPE'"'"');'`" != 'x$OSTYPE'; then
+ PERL_SYSTEM_INVOKES_POSIX_SHELL=yes
+else
+ PERL_SYSTEM_INVOKES_POSIX_SHELL=no
+fi
+AC_SUBST([PERL_SYSTEM_INVOKES_POSIX_SHELL])
+AC_MSG_RESULT([yes])
+
+
+##
+# Compilation-related program checks:
+##
+
+AC_LANG([C])
+AC_PROG_CC
+AC_PROG_CPP
+LINKCC=${LINKCC-"$CC"}
+AC_SUBST(LINKCC)
+
+AC_AIX
+AC_C_CONST
+AC_C_INLINE
+
+# libtool stuff for shared/static libraries.
+#
+LT_PREREQ([2.2.6])
+LT_INIT([win32-dll])
+AC_SUBST(LIBTOOL_DEPS)
+
+
+##
+# Build environment:
+##
+
+# developer build
+# (enabled by default when building from SVN checkout)
+#
+if test "x$developer" != "xno" -a -f $srcdir/remove-files; then
+ developer="yes"
+fi
+AC_MSG_CHECKING([for developer gcc flags])
+if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
+
+ # WWWXXX - strict type checking
+ #
+ DEVFLAGS="-Wall -Wstrict-prototypes -Wwrite-strings -Wcast-qual"
+else
+ DEVFLAGS=""
+fi
+AC_MSG_RESULT($DEVFLAGS)
+AC_SUBST(DEVFLAGS)
+
+
+# building outside source directory
+#
+# a) ensure build include paths are before source
+# b) ensure GNU make uses 'vpath' instead of 'VPATH'
+#
+NON_GNU_VPATH="VPATH ="
+GNU_vpath="#vpath"
+
+# define include paths relative to top_srcdir
+# tweak includes if we're building outside of the source dir
+#
+if test "x$srcdir" = "x."; then
+ TOP_INCLUDES=SRC_TOP_INCLUDES
+ SNMPLIB_INCLUDES=SRC_SNMPLIB_INCLUDES
+ AGENT_INCLUDES=SRC_AGENT_INCLUDES
+ HELPER_INCLUDES=SRC_HELPER_INCLUDES
+ MIBGROUP_INCLUDES=SRC_MIBGROUP_INCLUDES
+else
+ TOP_INCLUDES=BLD_TOP_INCLUDES
+ SNMPLIB_INCLUDES=BLD_SNMPLIB_INCLUDES
+ AGENT_INCLUDES=BLD_AGENT_INCLUDES
+ HELPER_INCLUDES=BLD_HELPER_INCLUDES
+ MIBGROUP_INCLUDES=BLD_MIBGROUP_INCLUDES
+ if test $have_gnu_make -eq 0 ; then
+ NON_GNU_VPATH="#VPATH ="
+ GNU_vpath="vpath"
+ fi
+fi
+AC_SUBST(TOP_INCLUDES)
+AC_SUBST(SNMPLIB_INCLUDES)
+AC_SUBST(AGENT_INCLUDES)
+AC_SUBST(HELPER_INCLUDES)
+AC_SUBST(MIBGROUP_INCLUDES)
+AC_SUBST(GNU_vpath)
+AC_SUBST(NON_GNU_VPATH)
+
+
+##
+# System-related compilation checks:
+##
+
+# What system are we building for
+#
+AC_CANONICAL_TARGET
+changequote(, )
+PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'`
+changequote([, ])
+AC_MSG_CACHE_ADD(Building for: $PARTIALTARGETOS)
+
+
+#
+# Whether or not Cygwin's ld recognizes the flag -no-undefined.
+#
+
+case x$target_os in
+xcygwin*)
+ saved_LDFLAGS=$LDFLAGS
+
+ AC_MSG_CHECKING([whether the linker supports -no-undefined])
+ LDFLAGS="$saved_LDFLAGS -Wl,-no-undefined"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AC_MSG_RESULT([yes]); dnl
+ LD_NO_UNDEFINED=-no-undefined],
+ [AC_MSG_RESULT([no])])
+
+ LDFLAGS="$saved_LDFLAGS"
+ ;;
+esac
+
+AC_SUBST(LD_NO_UNDEFINED)
+
+
+#
+# Socket library: either 'default' (non-MinGW) or 'winsock2' (MinGW).
+#
+case x$target_os in
+ xmingw*)
+ with_socklib=winsock2
+ if test "x$enable_ipv6" = "xyes"; then
+ CFLAGS="-D_WIN32_WINNT=0x0501 $CFLAGS"
+ fi
+ ;;
+ *)
+ with_socklib=default;;
+esac
+
+
+# Check system define behaviour
+# Does "-Ux -Dx=x" work as expected?
+#
+AC_MSG_CHECKING([whether to un-define target system token (before redefining)])
+OLD_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
+
+AC_EGREP_CPP(yes,
+ [[
+#ifdef $PARTIALTARGETOS
+yes
+#endif
+ ]],
+ [ PARTIALTARGETFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
+ AC_MSG_RESULT([yes])],
+ [ PARTIALTARGETFLAGS="-D$PARTIALTARGETOS=$PARTIALTARGETOS"
+ AC_MSG_RESULT([no])])
+CFLAGS="$CFLAGS $PARTIALTARGETFLAGS"
+CPPFLAGS="$OLD_CPPFLAGS"
+
+
+# Determine appropriate <net-snmp/system/{os}.h> include
+#
+AC_MSG_CHECKING([for system include file])
+changequote(, )
+filebase=$target_os
+# ignore binary format indication
+filebase=`echo $filebase | $SED 's/elf//'`
+filebase=`echo $filebase | $SED 's/aout//'`
+filebase=`echo $filebase | $SED 's/ecoff//'`
+filebase=`echo $filebase | $SED 's/coff//'`
+while test "x$filebase" != "x$last" -a ! -f $srcdir/include/net-snmp/system/$filebase.h
+do
+ last=$filebase
+ filebase=`echo $filebase | $SED 's/[-._][^-._]*$//'`
+ if test "x$filebase" = "x$last"; then
+ filebase=`echo $filebase | $SED 's/[0-9]*$//'`
+ fi
+done
+
+if test "x$filebase" = "x$last"; then
+ filebase="generic"
+fi
+ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE="net-snmp/system/$filebase.h"
+changequote([, ])
+AC_MSG_RESULT($ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE)
+AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_INCLUDE_FILE, "$ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE")
+
+
+# Determine appropriate <net-snmp/machine/{cpu}.h> include
+#
+AC_MSG_CHECKING([for machine-type include file])
+changequote(, )
+filebase=$target_cpu
+while test "x$filebase" != "x$last" -a ! -f $srcdir/include/net-snmp/machine/$filebase.h
+do
+ last=$filebase
+ filebase=`echo $filebase | $SED 's/[-._][^-._]*$//'`
+done
+
+if test "x$filebase" = "x$last"; then
+ filebase="generic"
+fi
+ac_cv_NETSNMP_MACHINE_INCLUDE_FILE="net-snmp/machine/$filebase.h"
+changequote([, ])
+AC_MSG_RESULT([$ac_cv_NETSNMP_MACHINE_INCLUDE_FILE])
+AC_DEFINE_UNQUOTED(NETSNMP_MACHINE_INCLUDE_FILE, "$ac_cv_NETSNMP_MACHINE_INCLUDE_FILE")
+
+
+##
+# Platform-specific compilation checks:
+##
+
+# Preprocessor checks:
+#
+
+# More sensible system identifier (MinGW)
+#
+if test "x$PARTIALTARGETOS" = "xmingw32msvc"; then
+ CFLAGS="$CFLAGS -Dmingw32"
+fi
+
+# Handle .in file extension (GCC)
+#
+AC_MSG_CHECKING([for additional cpp flags])
+if test "x$GCC" = "xyes" -a "x$CPP" = "x$CC -E"; then
+ EXTRACPPFLAGS="-x c"
+else
+ EXTRACPPFLAGS=""
+fi
+
+# Solaris extra CPP flags (Solaris)
+#
+if test "x$GCC" != "xyes"; then
+ case $target_os in
+ solaris*) EXTRACPPFLAGS="$EXTRACPPFLAGS -Xs" ;;
+ esac
+fi
+
+AC_SUBST(EXTRACPPFLAGS)
+AC_MSG_RESULT($EXTRACPPFLAGS)
+
+
+# Compiler checks:
+#
+
+AC_PATH_PROG([CCPATH],$CC)
+case $target_os in
+ bsdi*)
+ # Check for bundled compiler (BSDi)
+ #
+ if test "x$CCPATH" = "x/usr/ucb/cc" -o "x$CCPATH" = "x/usr/bin/cc"; then
+ AC_MSG_ERROR([
+
+*** The BSDI /usr/ucb/cc compiler does not work with this package.
+*** Please run configure with --with-cc=gcc
+])
+ fi
+ ;;
+ solaris*)
+ # Check for bundled compiler (Solaris)
+ #
+ if test "x$CCPATH" = "x/usr/ucb/cc"; then
+ AC_MSG_ERROR([
+
+*** The solaris /usr/ucb/cc compiler does not work with this package.
+*** Please put a different compiler in your path first or run
+*** configure with --with-cc=XX, where XX is the compiler you want to use.
+])
+ fi
+ ;;
+esac
+
+
+# Compiler flags:
+#
+
+# The Net-SNMP source code is not strict-aliasing safe, so add
+# -fno-strict-aliasing to $CFLAGS if the compiler supports it.
+AC_MSG_CHECKING([whether the compiler supports -fno-strict-aliasing])
+netsnmp_save_CFLAGS="$CFLAGS"
+CFLAGS="-fno-strict-aliasing $CFLAGS"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [AC_MSG_RESULT([yes])], [
+ AC_MSG_RESULT([no])
+ CFLAGS="$netsnmp_save_CFLAGS"
+])
+
+
+# Linker checks:
+#
+
+case $target_os in
+ aix4.2*|aix4.3*|aix5*|aix6*|aix7*)
+ # Runtime linking flags (AIX)
+ #
+ AC_MSG_CHECKING([what linker flags to add to enable runtime linking on AIX])
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ netsnmp_aix_runtimelinking_flags_ok=yes
+ break
+ fi
+ done
+ if test "X$netsnmp_aix_runtimelinking_flags_ok" != "Xyes"; then
+ if test "x$GCC" = "xyes"; then
+ netsnmp_aix_ldflags="-Wl,-brtl"
+ else
+ netsnmp_aix_ldflags="-brtl"
+ fi
+ LDFLAGS="$netsnmp_aix_ldflags $LDFLAGS"
+ AC_MSG_RESULT($netsnmp_aix_ldflags)
+ else
+ AC_MSG_RESULT([none])
+ fi
+ ;;
+
+ darwin8*|darwin9*|darwin10*)
+ # Flat Namespace linking (Mac OS/X)
+ #
+ AC_MSG_CHECKING([whether darwin ld might need -flat_namespace])
+ if test -z "$MACOSX_DEPLOYMENT_TARGET"; then
+ LDFLAGS="-flat_namespace $LDFLAGS"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+
+ *)
+ ;;
+esac
+
+
+# dpkg package (swintst_apt)
+# used in agent only
+#
+AC_PATH_PROG([DPKG_QUERY_PATH], dpkg-query)
+if test x$DPKG_QUERY_PATH != x; then
+ AC_DEFINE(HAVE_DPKG_QUERY, 1, [Set if the dpkg-query command is available])
+fi
+
+
+##
+# Non-program/compilation checks:
+##
+
+# Substitute version number.
+#
+AC_SUBST(VERSION, $PACKAGE_VERSION)
+AC_MSG_CACHE_ADD(Net-SNMP Version: $PACKAGE_VERSION)
+
diff --git a/configure.d/config_os_struct_members b/configure.d/config_os_struct_members
new file mode 100644
index 0000000..b26cf77
--- /dev/null
+++ b/configure.d/config_os_struct_members
@@ -0,0 +1,754 @@
+# -*- autoconf -*-
+#########################################
+##
+# Checks for data structures & members
+##
+#########################################
+
+##
+# Simple checks:
+##
+
+# struct arphd
+# Agent:
+#
+AC_CHECK_MEMBERS([struct arphd.at_next],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <net/if.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IF_ETHER_H
+#include <netinet/if_ether.h>
+#endif
+ ]])
+
+# struct des_ks_struct
+# ('weak_key' indicates older version of OpenSSL)
+# Library:
+#
+if test "x$ac_cv_header_openssl_des_h" = "xyes" ; then
+ AC_CHECK_MEMBERS([struct des_ks_struct.weak_key],,,[[
+#ifdef HAVE_OPENSSL_DES_H
+#include <openssl/des.h>
+#endif
+ ]])
+fi
+
+# struct dirent
+# (see also AC_STRUCT_DIRENT_D_TYPE)
+# Library:
+#
+AC_CHECK_MEMBERS([struct dirent.d_type],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+ ]])
+
+# struct ethtool_cmd
+#
+if test "x$ac_cv_header_linux_ethtool_h" = "xyes" ; then
+AC_CHECK_MEMBERS([struct ethtool_cmd.speed_hi],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_LINUX_ETHTOOL_H
+#include <linux/ethtool.h>
+#endif
+ ]])
+fi
+
+# struct ipstat
+# Agent:
+#
+AC_CHECK_MEMBERS([struct ipstat.ips_cantfrag,
+ struct ipstat.ips_delivered,
+ struct ipstat.ips_fragdropped,
+ struct ipstat.ips_fragmented,
+ struct ipstat.ips_localout,
+ struct ipstat.ips_noproto,
+ struct ipstat.ips_noroute,
+ struct ipstat.ips_odropped,
+ struct ipstat.ips_ofragments,
+ struct ipstat.ips_reassembled],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+ ]])
+#
+# Not-Used:
+AC_CHECK_MEMBERS([struct ipstat.ips_cantforward,
+ struct ipstat.ips_fragtimeout],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+ ]])
+
+# struct mbstat
+# Not-Used:
+#
+AC_CHECK_MEMBERS([struct mbstat.m_clusters,
+ struct mbstat.m_clfree,
+ struct mbstat.m_mbufs],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MBUF_H
+#include <sys/mbuf.h>
+#endif
+ ]])
+
+# struct nlist
+#
+AC_CHECK_MEMBERS([struct nlist.n_value,
+ struct nlist64.n_value],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#if HAVE_NLIST_H
+#include <nlist.h>
+#endif
+ ]])
+
+# struct sigaction
+# Agent:
+#
+AC_CHECK_MEMBERS([struct sigaction.sa_sigaction],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SIGNAL_H
+#include <sys/signal.h>
+#endif
+ ]])
+
+# struct sockaddr
+# Library:
+#
+AC_CHECK_MEMBERS([struct sockaddr.sa_len,
+ struct sockaddr.sa_union.sa_generic.sa_family2,
+ struct sockaddr_storage.ss_family,
+ struct sockaddr_storage.__ss_family],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#elif defined(HAVE_WINSOCK2_H)
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+ ]])
+
+# struct sockaddr_in6 (see RFC 2553)
+# Library:
+#
+AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+ ]])
+
+# struct msghdr
+# Library:
+#
+AC_CHECK_MEMBERS([struct msghdr.msg_control,
+ struct msghdr.msg_flags],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+ ]])
+
+# struct sockaddr_un
+# Library:
+#
+AC_CHECK_SIZEOF([sockaddr_un.sun_path],,[
+ AC_INCLUDES_DEFAULT
+ [
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+struct sockaddr_un sockaddr_un;
+ ]])
+
+# struct statfs
+# Agent:
+#
+AC_CHECK_MEMBERS([struct statfs.f_favail,
+ struct statfs.f_ffree,
+ struct statfs.f_files,
+ struct statfs.f_flags,
+ struct statfs.f_frsize],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_NBUTIL_H
+#include <nbutil.h>
+#endif
+ ]])
+
+# struct statvfs
+# Agent:
+#
+AC_CHECK_MEMBERS([struct statvfs.f_files,
+ struct statvfs.f_frsize,
+ struct statvfs.mnt_dir],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+ ]])
+
+# struct swdevt
+# Not-Used:
+#
+AC_CHECK_MEMBERS([struct swdevt.sw_nblksenabled],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_CONF_H
+#include <sys/conf.h>
+#endif
+ ]])
+
+# struct tcpstat
+# Agent:
+#
+AC_CHECK_MEMBERS([struct tcpstat.tcp_rcvmemdrop],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_TIMEOUT_H
+#include <sys/timeout.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#ifdef HAVE_NETINET_TCP_TIMER_H
+#include <netinet/tcp_timer.h>
+#endif
+#ifdef HAVE_NETINET_TCP_VAR_H
+#include <netinet/tcp_var.h>
+#endif
+ ]])
+
+# struct tm
+# Library:
+#
+AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#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
+ ]])
+
+# extern timezone
+AC_MSG_CHECKING([extern timezone])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#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
+]], [[
+ return timezone;
+]])], [
+AC_MSG_RESULT([yes])
+AC_DEFINE([HAVE_TIMEZONE_VARIABLE], [1], [Define if a timezone variable is declared in <sys/time.h>])
+], [
+AC_MSG_RESULT([no])
+])
+
+# struct timezone
+# Library:
+#
+AC_CHECK_MEMBERS([struct timezone.tz_dsttime],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_SYS_TIMEB_H
+# include <sys/timeb.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+ ]])
+
+# struct udpstat
+# Agent:
+#
+AC_CHECK_MEMBERS([struct udpstat.udps_discard,
+ struct udpstat.udps_fullsock,
+ struct udpstat.udps_noport,
+ struct udpstat.udps_noportbcast,
+ struct udpstat.udps_opackets],,,[
+ AC_INCLUDES_DEFAULT()
+ [
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif
+ ]])
+
+
+
+##
+# ifnet-related checks:
+##
+
+# Does "struct ifnet" need _KERNEL defined? (Irix)
+#
+AC_CACHE_CHECK([if _KERNEL needs to be defined for if_mtu],
+ [ac_cv_IFNET_NEEDS_KERNEL],
+ [ac_cv_IFNET_NEEDS_KERNEL=unknown
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+ ], [[struct ifnet test; test.if_mtu = 0;]])],
+ [ac_cv_IFNET_NEEDS_KERNEL=no])
+ if test "$ac_cv_IFNET_NEEDS_KERNEL" = unknown ; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+#define _KERNEL 1
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+ ], [[struct ifnet test; test.if_mtu = 0;]])],
+ [ac_cv_IFNET_NEEDS_KERNEL=yes])
+ fi])
+
+if test "x$ac_cv_IFNET_NEEDS_KERNEL" = "xyes"; then
+ AC_DEFINE(NETSNMP_IFNET_NEEDS_KERNEL, 1,
+ [ifnet needs to have _KERNEL defined])
+fi
+
+# Does "struct ifnet" need _KERNEL_STRUCTURES defined? (DragonFly 3)
+#
+AC_CACHE_CHECK([if _KERNEL_STRUCTURES needs to be defined for if_mtu],
+ [ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES],
+ [ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES=unknown
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+ ], [[struct ifnet test; test.if_mtu = 0;]])],
+ [ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES=no])
+ if test "$ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES" = unknown ; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+#define _KERNEL_STRUCTURES 1
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+ ], [[struct ifnet test; test.if_mtu = 0;]])],
+ [ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES=yes])
+ fi])
+
+if test "x$ac_cv_IFNET_NEEDS_KERNEL_STRUCTURES" = "xyes"; then
+ AC_DEFINE(NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES, 1,
+ [ifnet needs to have _KERNEL_STRUCTURES defined])
+fi
+
+
+# struct ifaddr
+# Not-Used:
+#
+AC_CHECK_MEMBERS([struct ifaddr.ifa_next],,,[
+ [
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+ ]
+ AC_INCLUDES_DEFAULT()
+ [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+ ]])
+
+# struct ifnet
+# (Broken on FreeBSD - #define'd in <net/if.h>)
+# Agent: (?or Not-Used?)
+#
+AC_CHECK_MEMBERS([struct ifnet.if_addrlist,
+ struct ifnet.if_addrhead.tqh_first,
+ struct ifnet.if_baudrate,
+ struct ifnet.if_baudrate.ifs_value,
+ struct ifnet.if_ibytes,
+ struct ifnet.if_imcasts,
+ struct ifnet.if_iqdrops,
+ struct ifnet.if_lastchange.tv_sec,
+ struct ifnet.if_lastchange.tv_nsec,
+ struct ifnet.if_mtu,
+ struct ifnet.if_noproto,
+ struct ifnet.if_obytes,
+ struct ifnet.if_omcasts,
+ struct ifnet.if_speed,
+ struct ifnet.if_type,
+ struct ifnet.if_xname],,,[[
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#ifdef linux
+struct ifnet {
+ char *if_name; /* name, e.g. "en" or "lo" */
+ short 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 */
+ int 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 */
+ int if_ibytes; /* octets received on interface */
+ int if_ipackets; /* packets received on interface */
+ int if_ierrors; /* input errors on interface */
+ int if_iqdrops; /* input queue overruns */
+ int if_obytes; /* octets sent on interface */
+ int if_opackets; /* packets sent on interface */
+ int if_oerrors; /* output errors on interface */
+ int if_collisions; /* collisions on csma interfaces */
+/* end statistics */
+ struct ifnet *if_next;
+};
+#endif
+ ]])
+
+
+##
+# rtentry structure checks:
+##
+
+# Check struct rtentry for common fields
+# Agent:
+#
+AC_CHECK_MEMBERS([struct rtentry.rt_dst,
+ struct rtentry.rt_hash,
+ struct rtentry.rt_next,
+ struct rtentry.rt_refcnt,
+ struct rtentry.rt_unit,
+ struct rtentry.rt_use],,,
+ [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#endif
+#ifdef HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+ ])
+
+
+# Check for BSD 4.3 vs 4.4 struct rtentry
+#
+AC_CACHE_CHECK([type of rtentry structure],
+ [ac_cv_RTENTRY_TYPE],
+ [
+ # BSD 4.4 compatible structure
+ # ('rt_nodes' array)
+ #
+ AC_TRY_COMPILE([
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#include <net/route.h>
+ ],[
+
+#ifndef HAVE_STRUCT_RTENTRY_RT_DST
+#define rt_dst rt_nodes->rn_key
+#endif
+
+ struct rtentry rt;
+ rt.rt_nodes[0].rn_flags = 1;
+ rt.rt_dst;
+ ], ac_cv_RTENTRY_TYPE="BSD-4.4")
+
+ if test "x$ac_cv_RTENTRY_TYPE" = "x"; then
+ # BSD 4.3 compatible structure
+ # ('rt_hash')
+ #
+ AC_TRY_COMPILE([
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+#define _KERNEL_STRUCTURES 1
+#endif
+#ifdef NETSNMP_IFNET_NEEDS_KERNEL
+#define KERNEL
+#if !defined(__DragonFly__)
+#define _KERNEL 1
+#endif
+#endif
+#include <sys/socket.h>
+#undef KERNEL
+#undef _KERNEL
+#include <net/route.h>
+ ],[
+
+struct rtentry rt;
+rt.rt_hash;
+ ], ac_cv_RTENTRY_TYPE="BSD-4.3")
+ fi
+
+ if test "x$ac_cv_RTENTRY_TYPE" = "x"; then
+ # Neither BSD 4.3 nor 4.4 compatible structure
+ #
+ ac_cv_RTENTRY_TYPE="unknown"
+ fi
+ ])
+
+if test "x$ac_cv_RTENTRY_TYPE" = "xBSD-4.4"; then
+ AC_DEFINE(RTENTRY_4_4, 1, [Use BSD 4.4 routing table entries?])
+fi
+
+# Check for ortentry (Alpha)
+#
+if test "x$ac_cv_RTENTRY_TYPE" = "xunknown"; then
+ AC_CACHE_CHECK([for struct rtentry],
+ [ac_cv_struct_rtentry],
+ [AC_EGREP_CPP(ortentry,
+ [
+#define KERNEL
+#include <net/route.h>
+ ],
+ [ac_cv_struct_rtentry=ortentry],
+ [ac_cv_struct_rtentry=rtentry ])
+ if test "x$ac_cv_struct_rtentry" = "xrtentry" ; then
+ ac_cv_struct_rtentry="rtentry"
+ else
+ ac_cv_struct_rtentry="ortentry"
+ fi
+ ])
+else
+ RTENTRY_TYPE="rtentry"
+ ac_cv_struct_rtentry="rtentry"
+fi
+
+if test "x$ac_cv_struct_rtentry" = "x"; then
+ ac_cv_struct_rtentry=rtentry
+fi
+AC_DEFINE_UNQUOTED(RTENTRY,struct ${ac_cv_struct_rtentry},
+ [define rtentry to ortentry on SYSV machines (alphas)])
+
diff --git a/configure.d/config_project_ipv6_types b/configure.d/config_project_ipv6_types
new file mode 100644
index 0000000..35886a1
--- /dev/null
+++ b/configure.d/config_project_ipv6_types
@@ -0,0 +1,208 @@
+# -*- autoconf -*-
+#########################################
+##
+# Checks for types
+##
+#########################################
+
+##
+# Standard checks:
+##
+
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(intmax_t)
+
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INTMAX_T
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINTMAX_T
+AC_TYPE_INTPTR_T
+AC_TYPE_UINTPTR_T
+
+##
+# Other type checks:
+##
+
+AC_CHECK_TYPES([off64_t])
+AC_CHECK_TYPES([nfds_t],,,[#include <sys/poll.h>])
+
+# Solaris specific checks
+# (taken from Perl's configure script)
+#
+AC_CHECK_TYPES([Counter64],,,[#include <inet/mib2.h>])
+AC_CHECK_TYPES([mib2_ipIfStatsEntry_t],,,[#include <inet/mib2.h>])
+
+# N.B: The above checks could safely be moved to
+# the later 'config_types' sub-script
+#
+
+
+##
+# Determine the IPv6 stack type
+##
+
+# These checks also set the LIBS/CFLAGS variables,
+# which may be needed for subsequent function tests
+#
+
+if test "x$enable_ipv6" = "xyes"; then
+ v6type=unknown
+ v6lib=none
+ v6trylibc=no
+
+ AC_MSG_CHECKING([[ipv6 stack type]])
+ for i in v6d toshiba kame inria zeta linux-glibc linux-inet6 cygwin winsock2 generic; do
+ case $i in
+ v6d)
+ AC_EGREP_CPP(yes, [
+#include </usr/local/v6/include/sys/types.h>
+#ifdef __V6D__
+yes
+#endif],
+ [v6type=$i; v6lib=v6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-I/usr/local/v6/include $CFLAGS"])
+ ;;
+ toshiba)
+ AC_EGREP_CPP(yes, [
+#include <sys/param.h>
+#ifdef _TOSHIBA_INET6
+yes
+#endif],
+ [v6type=$i; v6lib=inet6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
+ ;;
+ kame)
+ AC_EGREP_CPP(yes, [
+#include <netinet/in.h>
+#ifdef __KAME__
+yes
+#endif],
+ [v6type=$i; v6lib=inet6;
+ v6libdir=/usr/local/v6/lib;
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
+ ;;
+ inria)
+ AC_EGREP_CPP(yes, [
+#include <netinet/in.h>
+#ifdef IPV6_INRIA_VERSION
+yes
+#endif],
+ [v6type=$i;
+ v6lib=dummy;
+ v6libdir=none;
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
+ ;;
+ zeta)
+ AC_EGREP_CPP(yes, [
+#include <sys/param.h>
+#ifdef _ZETA_MINAMI_INET6
+A
+yes
+#endif],
+ [v6type=$i; v6lib=inet6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
+ ;;
+ linux-glibc)
+ AC_EGREP_CPP(yes, [
+#include <features.h>
+#if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC_ > 2))
+yes
+#endif],
+ [v6type=$i;
+ v6lib=dummy;
+ v6libdir=none;
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
+ ;;
+ linux-inet6)
+ if test -d /usr/inet6; then
+ v6type=$i
+ v6lib=inet6
+ v6libdir=/usr/inet6/lib
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+ fi
+ ;;
+ cygwin)
+ AC_EGREP_CPP(yes, [
+#include <netinet/in.h>
+#ifdef _CYGWIN_IN6_H
+yes
+#endif],
+ [v6type=$i;
+ v6lib=dummy;
+ v6libdir=none
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
+ ;;
+ winsock2)
+ AC_EGREP_CPP(yes, [
+#include <ws2tcpip.h>
+#if defined(_WS2TCPIP_H)
+yes
+#endif],
+ [v6type=$i;
+ v6lib=dummy;
+ v6libdir=none
+ v6trylibc=yes;
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
+ ;;
+ generic)
+ AC_MSG_RESULT([[postponed]])
+ AC_CHECK_MEMBER([struct sockaddr_in6.sin6_addr],,,[
+AC_INCLUDES_DEFAULT()
+[#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+]])
+ AC_MSG_CHECKING([[ipv6 stack type]])
+ if test "x$ac_cv_member_struct_sockaddr_in6_sin6_addr" = "xyes"; then
+ v6type=$i
+ v6lib=dummy
+ v6libdir=none
+ v6trylibc=yes
+ CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
+ fi
+ ;;
+ esac
+ if test "$v6type" != "unknown"; then
+ break
+ fi
+ done
+
+ if test "$v6lib" != "none"; then
+ if test -d $v6libdir -a -f $v6libdir/lib$v6lib.a; then
+ LIBS="-L$v6libdir -l$v6lib $LIBS"
+ enable_ipv6="yes"
+ AC_MSG_RESULT(["$v6type, $enable_ipv6, using lib$v6lib"])
+ elif test "$v6trylibc" = "yes"; then
+ enable_ipv6="yes"
+ AC_MSG_RESULT(["$v6type, $enable_ipv6, using libc"])
+ else
+ AC_MSG_ERROR(no IPv6 library lib$v6lib.a found.)
+ exit 1
+ fi
+ else
+ enable_ipv6="no"
+ AC_MSG_RESULT(["$v6type, $enable_ipv6"])
+ fi
+fi
diff --git a/configure.d/config_project_manual b/configure.d/config_project_manual
new file mode 100644
index 0000000..31efdd3
--- /dev/null
+++ b/configure.d/config_project_manual
@@ -0,0 +1,170 @@
+# -*- autoconf -*-
+#
+# Prompt for various bits of user information
+#
+
+if test "x$ac_cv_user_prompt_NETSNMP_LOGFILE" = "x" -o "x$ac_cv_user_prompt_NETSNMP_SYS_LOC" = "x" -o "x$ac_cv_user_prompt_NETSNMP_SYS_CONTACT" = "x" -o "x$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" = "x"; then
+AC_CACHE_CHECK(whether to prompt for values, ac_cv_have_warned,
+[
+if test "x$defaults" = "xno"; then
+AC_MSG_NOTICE([
+
+ ************** Configuration Section **************
+
+ You are about to be prompted with a series of questions. Answer
+them carefully, as they determine how the SNMP agent and related
+applications are to function.
+
+ After the configure script finishes, you can browse the newly
+created net-snmp-config.h file for further - less important - parameters to
+modify. Be careful if you re-run configure though, since net-snmp-config.h
+will be overwritten.
+
+-Press return to continue-
+])
+
+read tmpinput <&AS_ORIGINAL_STDIN_FD
+ac_cv_have_warned="yes"
+else
+ ac_cv_have_warned="no"
+fi
+])
+else
+ ac_cv_have_warned="yes"
+fi
+
+ME=`$WHOAMI`
+if test -f /etc/resolv.conf; then
+ LOC=`awk '/^domain/{loc=$NF}END{print loc}' /etc/resolv.conf`
+fi
+if test "x$LOC" = x; then
+ LOC="@no.where"
+fi
+
+AC_PROMPT_USER(NETSNMP_DEFAULT_SNMP_VERSION,[
+
+*** Default SNMP Version:
+
+ Starting with Net-SNMP 5.0, you can choose the default version of
+the SNMP protocol to use when no version is given explicitly on the
+command line, or via an 'snmp.conf' file. In the past this was set to
+SNMPv1, but you can use this to switch to SNMPv3 if desired. SNMPv3
+will provide a more secure management environment (and thus you're
+encouraged to switch to SNMPv3), but may break existing scripts that
+rely on the old behaviour. (Though such scripts will probably need to
+be changed to use the '-c' community flag anyway, as the SNMPv1
+command line usage has changed as well.).
+ At this prompt you can select \"1\", \"2\" (for SNMPv2c), or \"3\" as
+the default version for the command tools (snmpget, ...) to use. This
+can always be overridden at runtime using the -v flag to the tools, or
+by using the \"defVersion\" token in your snmp.conf file.
+ Providing the --with-default-snmp-version=\"x\" parameter to ./configure
+will avoid this prompt.
+
+Default version of SNMP to use],3,unquoted)
+
+# we tested this above before the prompt, but the prompt may give a new value.
+case "${ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION}" in
+ [[123]]) ;;
+ 2c) ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION=2 ;;
+ *)
+ AC_MSG_ERROR([Illegal version number. Only 1, 2 (for SNMPv2c) and 3 are supported.])
+ ;;
+esac
+
+AC_PROMPT_USER(NETSNMP_SYS_CONTACT,[
+
+*** System Contact Information:
+
+ Describes who should be contacted about the host the agent is
+running on. This information is available in the MIB-II tree. This
+can also be over-ridden using the \"syscontact\" syntax in the agent's
+configuration files.
+ Providing the --with-sys-contact=\"contact\" parameter to ./configure
+will avoid this prompt.
+
+System Contact Information],$ME@$LOC,quoted)
+
+AC_PROMPT_USER(NETSNMP_SYS_LOC,[
+
+*** System Location:
+
+ Describes the location of the system. This information is
+available in the MIB-II tree. this can also be over-ridden using the
+\"syslocation\" syntax in the agent's configuration files.
+ Providing the --with-sys-location=\"location\" parameter to ./configure
+will avoid this prompt.
+
+System Location],Unknown,quoted)
+
+if test -d /var/log; then
+ defaultlog="/var/log/snmpd.log"
+else
+ defaultlog="/usr/adm/snmpd.log"
+fi
+
+AC_PROMPT_USER(NETSNMP_LOGFILE,[
+
+*** Logfile location:
+
+ Enter the default location for the snmpd agent to dump
+information & errors to. If not defined (enter the keyword \"none\"
+at the prompt below) the agent will use stdout and stderr instead.
+(Note: This value can be over-ridden using command line options.)
+ Providing the --with-logfile=\"path\" parameter to ./configure
+will avoid this prompt.
+
+Location to write logfile],$defaultlog,quoted)
+
+if test -d /var; then
+ defaultstore="/var/net-snmp"
+ ucddefaultstore="/var/ucd-snmp"
+else
+ defaultstore="/etc/net-snmp"
+ ucddefaultstore="/etc/ucd-snmp"
+fi
+
+AC_PROMPT_USER(NETSNMP_PERSISTENT_DIRECTORY,[
+
+*** snmpd persistent storage location:
+
+ Enter a directory for the SNMP library to store persistent
+data in the form of a configuration file. This default location is
+different than the old default location (which was for ucd-snmp). If
+you stay with the new path, I'll ask you in a second if you wish to
+copy your files over to the new location (once only). If you pick
+some other path than the default, you'll have to copy them yourself.
+There is nothing wrong with picking the old path ($ucddefaultstore) if
+you'd rather.
+ Providing the --with-persistent-directory=\"path\" parameter to
+./configure will avoid this prompt.
+
+Location to write persistent information],$defaultstore,quoted)
+
+PERSISTENT_DIRECTORY=$ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY
+AC_SUBST(PERSISTENT_DIRECTORY)
+UCDPERSISTENT_DIRECTORY=$ucddefaultstore
+AC_SUBST(UCDPERSISTENT_DIRECTORY)
+
+if test $PERSISTENT_DIRECTORY = "$defaultstore" -a -d "$ucddefaultstore" -a ! -d "$defaultstore" ; then
+AC_CACHE_CHECK(If we should copy the old persistent directory, ac_cv_user_prompt_COPY_PERSISTENT_FILES,
+[
+AC_PROMPT_USER_NO_DEFINE(ac_cv_user_prompt_COPY_PERSISTENT_FILES,[
+
+*** Copying old ucd-snmp persistent files to net-snmp persistent directory:
+
+ Would you like to copy the older ucd-snmp persistent files
+into your new net-snmp persistent file path? This will functionally
+save all your ucd-snmp data and let it be used within the net-snmp
+tools. This will only be done once when you run make install. If you
+wish to do this, enter "yes" at the prompt.
+ Providing the --with-copy-persistent-files=\"no\" (or \"yes\")
+parameters to ./configure will avoid this prompt.
+
+Copy ucd-snmp data into the net-snmp data directory],"yes")
+])
+else
+ac_cv_user_prompt_COPY_PERSISTENT_FILES="no"
+fi
+COPY_PERSISTENT_FILES="$ac_cv_user_prompt_COPY_PERSISTENT_FILES"
+AC_SUBST(COPY_PERSISTENT_FILES)
diff --git a/configure.d/config_project_paths b/configure.d/config_project_paths
new file mode 100644
index 0000000..9690c84
--- /dev/null
+++ b/configure.d/config_project_paths
@@ -0,0 +1,101 @@
+# -*- autoconf -*-
+#########################################
+##
+# Configure paths
+##
+#########################################
+
+##
+# Prefix paths:
+##
+
+# Main prefix
+#
+if test "x$prefix" = "xNONE"; then
+ prefix=/usr/local
+fi
+
+# Prefix must be an absolute path
+# i.e. begin with "/" (Unix)
+# or "[A-Z]:" (Windows)
+#
+firstchar=`echo $prefix | $SED 's/\(.\).*/\1/'`
+if test "x$firstchar" != "x/" ; then
+ secondchar=`echo $prefix | $SED 's/.\(.\).*/\1/'`
+ if test "x$secondchar" != "x:" ; then
+ prefix=`pwd`/$prefix
+ echo "adjusting prefix to $prefix"
+ fi
+fi
+
+
+# Exec prefix
+#
+# Prefix must be an absolute path
+# i.e. begin with "/" (Unix)
+# or "[A-Z]:" (Windows)
+#
+if test "x$exec_prefix" = "xNONE"; then
+ exec_prefix='${prefix}'
+else
+ firstchar=`echo $exec_prefix | $SED 's/\(.\).*/\1/'`
+ if test "x$firstchar" != "x/" ; then
+ secondchar=`echo $exec_prefix | $SED 's/.\(.\).*/\1/'`
+ if test "x$secondchar" != "x:" ; then
+ exec_prefix=`pwd`/$exec_prefix
+ echo "adjusting exec_prefix to $exec_prefix"
+ fi
+ fi
+fi
+
+
+##
+# Environmental variables:
+##
+
+# SNMPLIBPATH
+#
+SNMPLIBPATH=""
+tmpset="$libdir/snmp"
+while test "x$tmpset" != "x$SNMPLIBPATH"; do
+ SNMPLIBPATH="$tmpset"
+ eval tmpset="$tmpset"
+done
+AC_DEFINE_UNQUOTED(SNMPLIBPATH,"$SNMPLIBPATH")
+AC_SUBST(SNMPLIBPATH)
+AC_DEFINE_UNQUOTED(SNMPDLMODPATH,"$SNMPLIBPATH/dlmod")
+
+# SNMPSHAREPATH
+#
+SNMPSHAREPATH=""
+tmpset="$datadir/snmp"
+while test "x$tmpset" != "x$SNMPSHAREPATH"; do
+ SNMPSHAREPATH="$tmpset"
+ eval tmpset="$tmpset"
+done
+AC_DEFINE_UNQUOTED(SNMPSHAREPATH,"$SNMPSHAREPATH")
+AC_SUBST(SNMPSHAREPATH)
+
+# MIBDIRS (default)
+#
+if test "x$NETSNMP_DEFAULT_MIBDIRS" = "x"; then
+ NETSNMP_DEFAULT_MIBDIRS="\$HOME/.snmp/mibs:$SNMPSHAREPATH/mibs"
+ if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" -o "x$PARTIALTARGETOS" = "xcygwin"; then
+ #
+ # USe Windows-style path separator
+ NETSNMP_DEFAULT_MIBDIRS=`echo "$NETSNMP_DEFAULT_MIBDIRS" | $SED 's/:/;/g'`
+ fi
+ AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBDIRS,"$NETSNMP_DEFAULT_MIBDIRS")
+fi
+AC_SUBST(NETSNMP_DEFAULT_MIBDIRS)
+
+# SNMPCONFPATH
+#
+SNMPCONFPATH=""
+tmpset="$sysconfdir/snmp"
+while test "x$tmpset" != "x$SNMPCONFPATH"; do
+ SNMPCONFPATH="$tmpset"
+ eval tmpset="$tmpset"
+done
+AC_DEFINE_UNQUOTED(SNMPCONFPATH,"$SNMPCONFPATH")
+AC_SUBST(SNMPCONFPATH)
diff --git a/configure.d/config_project_perl_python b/configure.d/config_project_perl_python
new file mode 100644
index 0000000..23f8c7e
--- /dev/null
+++ b/configure.d/config_project_perl_python
@@ -0,0 +1,379 @@
+# -*- autoconf -*-
+#########################################
+##
+# Perl & Python support
+##
+#########################################
+
+##
+# Check whether Net-SNMP configuration will support Perl
+##
+
+# Inputs:
+# install_perl: whether or not to install the Perl modules
+# yes/no/try (i.e. 'maybe' - the default)
+# embed_perl: whether or not to embed Perl support within the agent
+# yes/no/try (i.e. 'maybe' - the default)
+#
+# ac_cv_path_PERLPROG: Path to perl binary
+
+
+# Embedded Perl requires Perl modules, and the perl binary
+#
+if test "x$embed_perl" = "xtry" ; then
+ if test "x$install_perl" = "xno" ; then
+ install_perl="try"
+ fi
+ if test "x$ac_cv_path_PERLPROG" = "x" -o "x$ac_cv_path_PERLPROG" = "xno" ; then
+ install_perl="no"
+ embed_perl="no"
+ fi
+fi
+
+# Perl modules require the perl binary
+#
+if test "x$install_perl" != "xno" ; then
+ myperl=$ac_cv_path_PERLPROG
+ if test $myperl = "no" ; then
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ AC_MSG_ERROR(--enable-embedded-perl requested but no perl executable found)
+ fi
+ fi
+fi
+
+# Perl modules require shared libraries
+#
+if test "x$install_perl" != "xno" ; then
+ if test "x$enable_shared" != "xyes"; then
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ AC_MSG_ERROR(Perl support requires --enable-shared)
+ fi
+ fi
+fi
+
+# Perl modules can only be installed from within the source tree
+#
+if test "x$install_perl" != "xno" ; then
+ AC_MSG_CHECKING([if we are in the source tree so we can install Perl modules])
+ if test "x$srcdir" = "x." -o -d perl/agent/default_store ; then
+ AC_MSG_RESULT([Yes])
+ else
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ AC_MSG_RESULT([No])
+ else
+ AC_MSG_ERROR([Perl modules can not be built outside the source directory])
+ fi
+ fi
+fi
+
+
+# The rest of the Perl-related checks aren't relevant
+# if we're not using the Perl modules
+#
+if test "x$install_perl" != "xno" ; then
+
+
+##
+# Check compiler compatability
+##
+
+ # What compiler was used to build the perl binary?
+ #
+ if test "xenable_perl_cc_checks" != "xno" ; then
+ AC_MSG_CHECKING([for Perl cc])
+ changequote(, )
+ PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'`
+ changequote([, ])
+ if test "x$PERLCC" != "x" ; then
+ AC_MSG_RESULT([$PERLCC])
+ else
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ AC_MSG_ERROR([Could not determine the compiler that was used to build $myperl. Either set the environment variable PERLPROG to a different perl binary or use --without-perl-modules to build without Perl.])
+ fi
+ fi
+ fi
+
+ # Was GCC used to build the perl binary?
+ #
+ if test "x$install_perl" != "xno" ; then
+ AC_MSG_CHECKING([whether $PERLCC is a GNU C compiler])
+ OLDCC=$CC
+ CC="$PERLCC"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([], [[
+#ifndef __GNUC__
+ choke me
+#endif
+ ]])], [perlcc_is_gnu=yes], [perlcc_is_gnu=no])
+ AC_MSG_RESULT([$perlcc_is_gnu])
+ CC=$OLDCC
+
+ # Check compatability: Gnu Net-SNMP vs Non-Gnu perl
+ #
+ if test "x$GCC" = "xyes" -a "x$perlcc_is_gnu" = "xno" ; then
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ AC_MSG_ERROR([This build is using a GNU C compiler ($CC) while Perl has been compiled with a non-GNU (or non-working) compiler ($PERLCC). This likely won't work for building with Perl support. Either specify a different compiler (--with-cc=PATH), disable this check (--disable-perl-cc-checks) or build without Perl (--without-perl-modules).])
+ fi
+ fi
+ fi
+
+ # Check compatability: Non-Gnu Net-SNMP vs Gnu perl
+ #
+ if test "x$install_perl" != "xno" ; then
+ if test "x$GCC" != "xyes" -a "x$perlcc_is_gnu" = "xyes" ; then
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="no"
+ else
+ AC_MSG_ERROR([This build is using a non-GNU C compiler ($CC) while Perl has been compiled with a GNU compiler ($PERLCC). This likely won't work for building with Perl support. Either specify a different compiler (--with-cc=PATH), disable this check (--disable-perl-cc-checks) or build without Perl (--without-perl-modules).])
+ fi
+ fi
+ fi
+
+ # Are we clear to proceed?
+ #
+ if test "x$install_perl" = "xtry" ; then
+ install_perl="yes"
+ else
+ if test "x$install_perl" = "xno" ; then
+ install_perl="no"
+ embed_perl="no"
+ fi
+ fi
+
+
+##
+# Determine compilation environment needed for embedded Perl
+##
+
+# System-specific requirements
+#
+case $target_os in
+ solaris*)
+ if test "x$embed_perl" != "xno" ; then
+ # Check for LARGEFILE support (Solaris)
+ #
+ AC_MSG_CHECKING([for problematic Perl cc flags on Suns])
+ if $myperl -V:ccflags | $GREP LARGEFILE > /dev/null ; then
+ if test "x$embed_perl" = "xtry" ; then
+ embed_perl="no"
+ else
+ AC_MSG_ERROR([Perl was compiled with LARGEFILE support which will break Net-SNMP. Either set the environment variable PERLPROG to a different perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether.])
+ fi
+ else
+ AC_MSG_RESULT([none known])
+ fi
+ fi
+ ;;
+
+ # Embedded perl typically fails on HP-UX and Mac OS X
+ # We really need to investigate why, and check for this explicitly
+ # But for the time being, turn this off by default
+ hpux*|darwin8*|darwin9*|darwin10*)
+ if test "x$embed_perl" = "xtry" ; then
+ AC_MSG_WARN([Embedded perl defaulting to off])
+ embed_perl="no"
+ fi
+ ;;
+
+ *)
+ ;;
+esac
+
+# Compiler flags
+#
+if test "x$embed_perl" != "xno" ; then
+ AC_MSG_CHECKING([for Perl CFLAGS])
+ perlcflags=`$myperl -MExtUtils::Embed -e ccopts`
+ if test "x$perlcflags" != "x" ; then
+ AC_MSG_RESULT([$perlcflags])
+ CFLAGS="$CFLAGS $perlcflags"
+ else
+ if test "x$embed_perl" = "xtry" ; then
+ embed_perl="no"
+ else
+ AC_MSG_ERROR([Could not determine the C compiler flags that were used to build $myperl. Either set the environment variable PERLPROG to a different Perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether.])
+ fi
+ fi
+fi
+
+# Linker flags
+#
+if test "x$embed_perl" != "xno" ; then
+ AC_MSG_CHECKING([for Perl LDFLAGS])
+ netsnmp_perlldopts=`$myperl -MExtUtils::Embed -e ldopts`
+ if test "x$netsnmp_perlldopts" != "x" ; then
+ AC_MSG_RESULT([$netsnmp_perlldopts])
+ else
+ if test "x$embed_perl" = "xtry" ; then
+ embed_perl="no"
+ else
+ AC_MSG_ERROR([Could not determine the linker options that were used to build $myperl. Either set the environment variable PERLPROG to a different Perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether.])
+ fi
+ fi
+ if test "x$enable_as_needed" != "xno" ; then
+ # Just-in-time linking will embed the Perl library within
+ # the Net-SNMP library (rather than the agent application)
+ #
+ PERLLDOPTS_FOR_LIBS="$netsnmp_perlldopts"
+ # Perl ccdlflags (RPATH to libperl, hopefully)
+ #
+ AC_MSG_CHECKING([for Perl CCDLFLAGS])
+ changequote(, )
+ netsnmp_perlccdlflags=`$myperl -V:ccdlflags | $myperl -n -e 'print $1 '"if (/^\s*ccdlflags='([^']+)';/);"`
+ changequote([, ])
+ AC_MSG_RESULT([$netsnmp_perlccdlflags])
+ PERLLDOPTS_FOR_APPS="$netsnmp_perlccdlflags"
+ else
+ # Otherwise embed the Perl library within the application
+ #
+ PERLLDOPTS_FOR_LIBS="$netsnmp_perlldopts"
+ # link *applications* against libperl
+ PERLLDOPTS_FOR_APPS="$netsnmp_perlldopts"
+ fi
+fi
+
+# 'Perl_eval_pv' function (and equivalents)
+#
+if test "x$embed_perl" != "xno" ; then
+ # Three possible versions of this routine:
+ # eval_pv (to 5.003_97d)
+ # perl_eval_pv (5.004/5.005)
+ # Perl_eval_pv (from 5.6ff)
+ #
+ OLDLIBS="$LIBS"
+ LIBS="$LIBS $netsnmp_perlldopts"
+ AC_CHECK_FUNCS(eval_pv)
+ AC_CHECK_FUNC(perl_eval_pv,
+ AC_DEFINE(HAVE_PERL_EVAL_PV_LC, 1,
+ [Define to 1 if you have `the perl_eval_pv' function.]))
+ AC_CHECK_FUNC(Perl_eval_pv,
+ AC_DEFINE(HAVE_PERL_EVAL_PV_UC, 1,
+ [Define to 1 if you have the `Perl_eval_pv' function.]))
+ LIBS="$OLDLIBS"
+ #
+ # Note that autoconf flattens case when defining tokens,
+ # so we need to explicitly distinguish between the latter two.
+
+ if test "x$ac_cv_func_perl_eval_pv" != "xyes" -a "x$ac_cv_func_Perl_eval_pv" != "xyes" -a "x$ac_cv_func_eval_pv" != "xyes" ; then
+ if test "x$embed_perl" = "xtry" ; then
+ embed_perl="no"
+ else
+ AC_MSG_ERROR([Could not find the eval_pv, perl_eval_pv or Perl_eval_pv functions needed for embedded Perl support. Either set the environment variable PERLPROG to a different perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether.])
+ fi
+ else
+ # Activate Embedded Perl
+ #
+ AC_DEFINE(NETSNMP_EMBEDDED_PERL, 1,
+ [Define if you are embedding perl in the main agent.])
+ OTHERAGENTLIBOBJS="snmp_perl.o"
+ OTHERAGENTLIBLOBJS="snmp_perl.lo"
+ OTHERAGENTLIBLFTS="snmp_perl.ft"
+
+ EMBEDPERLINSTALL="embedperlinstall"
+ EMBEDPERLUNINSTALL="embedperluninstall"
+ embed_perl="yes"
+ fi
+else
+ EMBEDPERLINSTALL=""
+ EMBEDPERLUNINSTALL=""
+ embed_perl="no"
+ fi
+fi
+
+
+##
+# Report and configure results
+##
+
+AC_SUBST(EMBEDPERLINSTALL)
+AC_SUBST(EMBEDPERLUNINSTALL)
+AC_SUBST(PERLLDOPTS_FOR_LIBS)
+AC_SUBST(PERLLDOPTS_FOR_APPS)
+
+# Results of Embedded Perl checks
+#
+AC_MSG_CHECKING([for potential embedded Perl support])
+if test "x$embed_perl" != "xyes" ; then
+ AC_MSG_CACHE_ADD(Embedded Perl support: disabled)
+ AC_MSG_RESULT([disabled])
+else
+ AC_MSG_CACHE_ADD(Embedded Perl support: enabled)
+ AC_MSG_RESULT([enabled])
+fi
+
+# Results of Perl Module checks
+#
+PERLTARGS=""
+PERLINSTALLTARGS=""
+PERLUNINSTALLTARGS=""
+PERLFEATURES=""
+AC_MSG_CHECKING([if we can install the Perl modules])
+if test "x$install_perl" = "xyes" ; then
+ PERLTARGS="perlmodules"
+ PERLINSTALLTARGS="perlinstall"
+ PERLUNINSTALLTARGS="perluninstall"
+ PERLFEATURES="perlfeatures"
+ if test "x$embed_perl" = "xyes" ; then
+ AC_MSG_CACHE_ADD(SNMP Perl modules: building -- embeddable)
+ AC_MSG_RESULT([yes -- and embeddable])
+ else
+ AC_MSG_CACHE_ADD(SNMP Perl modules: building -- not embeddable)
+ AC_MSG_RESULT([yes -- not embeddable])
+ fi
+else
+ AC_MSG_RESULT([no])
+ AC_MSG_CACHE_ADD(SNMP Perl modules: disabled)
+fi
+AC_SUBST(PERLTARGS)
+AC_SUBST(PERLINSTALLTARGS)
+AC_SUBST(PERLUNINSTALLTARGS)
+AC_SUBST(PERLARGS)
+AC_SUBST(PERLFEATURES)
+
+
+# Reset LIBS to pre-libwrap value (???)
+#
+AGENTLIBS=$LIBS
+LIBS=$NONAGENTLIBS
+
+
+
+##
+# Python checks
+##
+
+PYTHONTARGS=""
+PYTHONINSTALLTARGS=""
+PYTHONUNINSTALLTARGS=""
+PYTHONCLEANTARGS=""
+PYTHONFEATURES=""
+AC_MSG_CHECKING([if we should install the python bindings])
+if test "x$install_python" = "xyes" ; then
+ PYTHONTARGS="pythonmodules"
+ PYTHONINSTALLTARGS="pythoninstall"
+ PYTHONUNINSTALLTARGS="pythonuninstall"
+ PYTHONCLEANTARGS="pythonclean"
+ PYTHONFEATURES="pythonfeatures"
+ AC_MSG_CACHE_ADD(SNMP Python modules: building for $PYTHONPROG)
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_CACHE_ADD(SNMP Python modules: disabled)
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST(PYTHONTARGS)
+AC_SUBST(PYTHONINSTALLTARGS)
+AC_SUBST(PYTHONUNINSTALLTARGS)
+AC_SUBST(PYTHONCLEANTARGS)
+AC_SUBST(PYTHONARGS)
+AC_SUBST(PYTHONFEATURES)
+
+
diff --git a/configure.d/config_project_types b/configure.d/config_project_types
new file mode 100644
index 0000000..ec9c85a
--- /dev/null
+++ b/configure.d/config_project_types
@@ -0,0 +1,57 @@
+# -*- autoconf -*-
+#########################################
+##
+# Checks for types
+##
+#########################################
+
+##
+# Standard checks:
+##
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_HEADER_TIME
+
+
+##
+# More complex checks:
+##
+
+# Check for 'socklen_t' (HP-UX)
+#
+AC_CHECK_TYPES([socklen_t],,,[
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif])
+
+
+# Check for 'in_addr_t'
+# May be in <netinet/in.h> (AIX)
+#
+AC_CHECK_TYPES([in_addr_t],,,[
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif])
+
+
+# Check for 'ssize_t'
+# Not necessarily in <sys/types.h> (older MinGW)
+#
+AC_CHECK_TYPES([ssize_t],,,[
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif])
diff --git a/configure.d/config_project_with_enable b/configure.d/config_project_with_enable
new file mode 100644
index 0000000..61ba026
--- /dev/null
+++ b/configure.d/config_project_with_enable
@@ -0,0 +1,1150 @@
+# -*- autoconf -*-
+#########################################
+##
+# Command-line processing - --with/--enable
+##
+#########################################
+
+##
+# System: Compiler settings
+##
+
+AC_ARG_WITH(cc, [
+Compiler Options:
+ --with-cc=CC use CC to compile (default=gcc).],
+ [CC=$with_cc;export CC])
+
+AC_ARG_WITH(linkcc, [
+ --with-linkcc=CC use CC to link (default=gcc).],
+ [LINKCC=$with_linkcc;export LINKCC])
+
+AC_ARG_WITH(ar,
+[ --with-ar=AR use AR as the archiver.],
+ [AR=$with_ar; export AR])
+
+AC_ARG_WITH(endianness,
+[ --with-endianness=big|little define endianness of target platform when
+ cross-compiling.],
+ [if test $with_endianness != "big" -a $with_endianness != "little" ; then
+ AC_MSG_ERROR([Endianness must be big or little, not "$with_endianness".]);
+ fi
+])
+
+AC_ARG_WITH(cflags,
+[ --with-cflags=CFLAGS use CFLAGS as compile time arguments.],
+ [CFLAGS=$with_cflags; export CFLAGS])
+
+AC_ARG_WITH(ldflags,
+[ --with-ldflags=LDFLAGS use LDFLAGS as link time arguments to ld.],
+ [LDFLAGS=$with_ldflags; export LDFLAGS])
+
+AC_ARG_ENABLE(as-needed,
+[ --disable-as-needed Link libperl against applications rather
+ than Net-SNMP libraries. Use only if the other
+ way doesn't work.])
+
+AC_ARG_WITH(libs,
+[ --with-libs=LIBS use LIBS as link time arguments to ld.],
+ [LIBS=$with_libs; export LIBS])
+
+AC_ARG_ENABLE(silent-libtool,
+[ --enable-silent-libtool Pass --silent to libtool.],
+ LIBTOOLFLAGS=--silent)
+AC_SUBST(LIBTOOLFLAGS)
+
+
+##
+# System: Library settings
+##
+
+NETSNMP_ARG_WITH(dmalloc,
+ AS_HELP_STRING([--with-dmalloc=PATH],
+ [Use dmalloc library (www.dmalloc.com)]))
+
+NETSNMP_ARG_WITH(efence,
+[ --with-efence Look for and use libefence (malloc).],
+ use_efence="$withval")
+
+tryrsaref=no
+NETSNMP_ARG_WITH(rsaref,
+[ --with-rsaref=PATH Look for librsaref in PATH/lib.],
+ if test "x$withval" = "xyes"; then
+ tryrsaref=yes
+ elif test "x$withval" = "xno"; then
+ tryrsaref=no
+ elif test -d "$withval"; then
+ AC_ADD_SEARCH_PATH($withval)
+ tryrsaref=yes
+ fi,
+)
+
+tryopenssl=defaultyes
+askedopenssl=no
+NETSNMP_ARG_WITH(openssl,
+[ --with-openssl=PATH Look for openssl in PATH/lib,
+ or PATH may be "internal" to build with
+ minimal copied OpenSSL code for USM only.],
+ if test "x$withval" = "xyes"; then
+ tryopenssl=yes
+ askedopenssl=yes
+ elif test "x$withval" = "xinternal"; then
+ tryopenssl=internal
+ askedopenssl=internal
+ elif test "x$withval" = "xno"; then
+ tryopenssl=no
+ elif test -d "$withval"; then
+ if test -d "$withval/lib/MinGW"; then
+ LDFLAGS="-L$withval/lib/MinGW $LDFLAGS"
+ CPPFLAGS="-I$withval/include $CPPFLAGS"
+ else
+ AC_ADD_SEARCH_PATH($withval)
+ fi
+ tryopenssl=yes
+ askedopenssl=yes
+ fi,
+)
+if test "x$tryopenssl" = "xdefaultyes"; then
+ AC_ADD_SEARCH_PATH(/usr/local/ssl)
+ tryopenssl=yes
+fi
+AC_ARG_WITH([ssl],,NETSNMP_INVALID_WITH([openssl]))
+AC_ARG_ENABLE([ssl],,NETSNMP_INVALID_WITH([openssl]))
+
+askedpkcs=no
+NETSNMP_ARG_WITH(pkcs,
+[ --with-pkcs=PATH Look for pkcs11 in PATH/lib.],
+ if test "x$withval" = "xyes"; then
+ askedpkcs=yes
+ elif test "x$withval" = "xno"; then
+ askedpkcs=no
+ elif test -d "$withval"; then
+ AC_ADD_SEARCH_PATH($withval)
+ askedpkcs=yes
+ fi,
+)
+
+trykrb5=defaultyes
+askedkrb5=no
+NETSNMP_ARG_WITH(krb5,
+[ --with-krb5=PATH Look for krb5 in PATH/lib.],
+ if test "x$withval" = "xyes"; then
+ trykrb5=yes
+ askedkrb5=yes
+ krb5path=undef
+ elif test "x$withval" = "xno"; then
+ trykrb5=no
+ krb5path=undef
+ elif test -d "$withval"; then
+ trykrb5=yes
+ askedkrb5=yes
+ krb5path=$withval
+ fi,
+)
+if test "x$trykrb5" = "xdefaultyes"; then
+ trykrb5=yes
+ krb5path=/usr/kerberos
+fi
+
+AC_ARG_WITH(dnssec-local-validation,
+ [ --with-dnssec-local-validation Enable local DNSSEC validation using libval (no)], want_dnssec=$withval, want_dnssec=no)
+AC_ARG_ENABLE([dnssec-local-validation],,
+ NETSNMP_INVALID_WITH([dnssec-local-validation]))
+AC_ARG_WITH([dnssec],,NETSNMP_INVALID_WITH([dnssec-local-validation]))
+AC_ARG_ENABLE([dnssec],,NETSNMP_INVALID_WITH([dnssec-local-validation]))
+
+NETSNMP_ARG_WITH(rpm,
+[ --without-rpm Don't include support for the RPM package
+ management system when building the host MIB
+ module.])
+
+
+##
+# Project: Build configuration settings
+##
+
+# Install prefix
+#
+AC_ARG_WITH(install-prefix,
+[ --with-install-prefix=PATH Just for installing, prefix all
+ directories with PATH. This is known not
+ to work on some systems with shared
+ libraries (eg, HPUX)],
+ INSTALL_PREFIX="$withval")
+
+if test "x$INSTALL_PREFIX" = "xyes" ; then
+ AC_MSG_ERROR([--with-install-prefix requires an argument])
+fi
+if test "x$INSTALL_PREFIX" = "xno" ; then
+ INSTALL_PREFIX=""
+fi
+AC_SUBST(INSTALL_PREFIX)
+
+
+#
+# Subsystems to build:
+# Library
+#
+FEATUREHEADERS="library/features.h"
+FTMAINSUBS=""
+
+#
+# Agent
+#
+NETSNMP_ARG_ENABLE(agent,
+[ --disable-agent Do not build the agent (snmpd).])
+if test "x$enable_agent" != "xno"; then
+ SNMPD='snmpd$(EXEEXT)'
+ MAINSUBS="$MAINSUBS agent"
+ FEATUREHEADERS="$FEATUREHEADERS agent/features-mibgroups.h agent/features.h"
+ FTMAINSUBS="agent $FTMAINSUBS"
+ TRAPLIBS='$(TRAPDWITHAGENT)'
+ USETRAPLIBS='$(USEAGENTLIBS)'
+else
+ SNMPD=""
+ # we still need/want the agentlibs (for subagents, e.g. snmptrapd)
+ MAINSUBS="$MAINSUBS agent"
+ # building snmptrapd w/o agentlibs doesn't work atm
+ #TRAPLIBS='$(TRAPDWITHOUTAGENT)'
+ #USETRAPLIBS='$(USELIBS)'
+ TRAPLIBS='$(TRAPDWITHAGENT)'
+ USETRAPLIBS='$(USEAGENTLIBS)'
+ AC_DEFINE([NETSNMP_DISABLE_AGENT], 1, [Define if no agent is built])
+fi
+
+AC_SUBST(SNMPD)
+AC_SUBST(TRAPLIBS)
+AC_SUBST(USETRAPLIBS)
+
+# Applications
+#
+NETSNMP_ARG_ENABLE(applications,
+[ --disable-applications Do not build the apps (snmpget, ...).])
+if test "x$enable_applications" != "xno"; then
+ MAINSUBS="$MAINSUBS apps"
+ FEATUREHEADERS="$FEATUREHEADERS features-snmpnetstat.h features-apps.h"
+ FTMAINSUBS="apps $FTMAINSUBS"
+else
+ AC_DEFINE([NETSNMP_DISABLE_APPS], 1, [Define if no apps are built])
+fi
+
+# Manual pages
+#
+NETSNMP_ARG_ENABLE(manuals,
+[ --disable-manuals Do not install the manuals.])
+if test "x$enable_manuals" != "xno"; then
+ MAINSUBS="$MAINSUBS man"
+fi
+
+# Supporting scripts
+#
+NETSNMP_ARG_ENABLE(scripts,
+[ --disable-scripts Do not install the scripts (mib2c, ...).])
+if test "x$enable_scripts" != "xno"; then
+ MAINSUBS="$MAINSUBS local"
+fi
+
+# MIB files
+#
+AC_ARG_ENABLE(mibs,
+[ --disable-mibs Do not install the mib files.])
+if test "x$enable_mibs" != "xno"; then
+ MAINSUBS="$MAINSUBS mibs"
+fi
+# with-mibs is valid too, but means something else
+
+AC_SUBST(MAINSUBS)
+AC_SUBST(FTMAINSUBS)
+AC_MSG_CHECKING([what to build and install])
+AC_MSG_RESULT([$MAINSUBS])
+
+
+# MIB module validation (during "configure")
+#
+NETSNMP_ARG_ENABLE(mib-config-checking,
+[ --enable-mib-config-checking Turns on extra checks during configuration
+ of mib modules. Any conflicts will cause
+ configure to abort (default is to issue a
+ warning and continue.)],
+ [if test "$enableval" = yes -o "$enableval" = no ; then
+ with_mib_cfg_checks="$enableval"
+ else
+ AC_MSG_ERROR([Please use --enable/--disable-mib-config-checking])
+ fi],
+ [with_mib_cfg_checks="no"])
+
+NETSNMP_ARG_ENABLE(mib-config-debug,
+[ --enable-mib-config-debug Turns on verbose output during mib module
+ configure processing.],
+ [if test "$enableval" = yes -o "$enableval" = no ; then
+ with_mib_cfg_debug="$enableval"
+ else
+ AC_MSG_ERROR([Please use --enable/--disable-mib-config-debug])
+ fi],
+ [with_mib_cfg_debug="no"])
+
+
+# Version-specific features
+#
+AC_ARG_ENABLE([new-features],
+ [AS_HELP_STRING([--enable-new-features],
+ [Compile in new MIB modules and other experimental features
+ which are due to be included in future releases.])])
+
+AC_ARG_ENABLE([old-features],
+ [AS_HELP_STRING([--enable-old-features],
+ [Compile in old MIB modules and other deprecated features
+ which were replaced in the default build of this release.])])
+
+AC_ARG_WITH([features-of],
+ [AS_HELP_STRING([--with-features-of=version],
+ [Compile in MIB modules and other features as if this was
+ release "version" (default is ]AC_PACKAGE_VERSION[).])],,
+ [with_features_of=$PACKAGE_VERSION])
+
+
+# Manual prompting during "configure"
+#
+NETSNMP_ARG_WITH(defaults,
+[
+Miscellaneous:
+ --with-defaults Use defaults for prompted values.],
+ [if test "$withval" = yes -o "$withval" = no ; then
+ defaults="$withval"
+ else
+ AC_MSG_ERROR([Please use --with/--without-defaults])
+ fi],
+ [defaults="no"])
+
+
+# UCD compatability
+#
+NETSNMP_ARG_ENABLE(ucd-snmp-compatibility,
+[ --enable-ucd-snmp-compatibility Install ucd-snmp look-alike headers and libs.
+])
+
+if test "x$enable_ucd_snmp_compatibility" = "xyes" ; then
+ installucdheaders=installucdheaders
+ installucdlibs=installucdlibs
+ AC_MSG_CACHE_ADD(UCD-SNMP compatability: enabled)
+fi
+AC_SUBST(installucdheaders)
+AC_SUBST(installucdlibs)
+
+
+##
+# Project: Library: MIB configuration settings
+##
+
+NETSNMP_ARG_ENABLE(mib-loading,
+[ --disable-mib-loading Do not include code that parses and
+ manipulates the mib files.])
+if test "x$enable_mib_loading" = "xno"; then
+ AC_DEFINE([NETSNMP_DISABLE_MIB_LOADING], 1,
+ [Define if mib loading and parsing code should not be included])
+fi
+
+NETSNMP_ARG_WITH(mibdirs,
+[ --with-mibdirs="dir1:dir2:" Default directories to look for mibs.
+ (Default: \$HOME/.snmp/mibs:DATADIR/snmp/mibs)],
+ [NETSNMP_DEFAULT_MIBDIRS="$with_mibdirs"
+ AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBDIRS,"$with_mibdirs",
+ [default location to look for mibs to load using the above tokens
+ and/or those in the MIBS envrionment variable])])
+
+AC_ARG_WITH(mibs,
+[ --with-mibs="item1:item2:" Default mib IDs to read.
+ (The default list is
+ "SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB"
+ with the addition of any mibs used
+ by the mib modules the agent is
+ configured with)],
+ NETSNMP_DEFAULT_MIBS="$with_mibs")
+# enable-mibs is valid too, but means something else
+
+NETSNMP_ARG_WITH(mibfiles,
+[ --with-mibfiles="file1:file2" Default mib files to load.
+ (Default: none. uses IDs above instead.)],
+ AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBFILES,"$with_mibfiles",
+ [default mib files to load, specified by path.]))
+
+
+##
+# Project: Library: Security configuration
+##
+
+NETSNMP_ARG_ENABLE(des,
+[ --disable-des Do not support DES encryption.])
+if test "x$enable_des" = "xno"; then
+ AC_DEFINE([NETSNMP_DISABLE_DES], 1,
+ [Define if DES encryption should not be supported])
+fi
+
+NETSNMP_ARG_ENABLE(privacy,
+[ --disable-privacy Don't compile in support for privacy (encryption).])
+if test "x$enable_privacy" != "xno"; then
+ AC_DEFINE(NETSNMP_ENABLE_SCAPI_AUTHPRIV, 1,
+ [define if you want to compile support for both authentication and
+ privacy support.])
+fi
+
+NETSNMP_ARG_ENABLE(md5,
+[ --disable-md5 Do not support MD5 authentication.])
+if test "x$enable_md5" = "xno"; then
+ AC_DEFINE([NETSNMP_DISABLE_MD5], 1,
+ [Define if MD5 authentication should not be supported])
+fi
+
+NETSNMP_ARG_ENABLE(internal-md5,
+[ --enable-internal-md5 Use the internal MD5 support.])
+if test "x$enable_internal_md5" = "xyes"; then
+ if test "x$enable_md5" = "xno"; then
+ AC_MSG_ERROR(You can not specify both --enable-internal-md5 and --disable-md5)
+ else
+ AC_DEFINE(NETSNMP_USE_INTERNAL_MD5, 1,
+ [define if you are using the MD5 code ...])
+ fi
+fi
+
+
+##
+# Project: Library: Misc configuration
+##
+
+NETSNMP_ARG_WITH(opaque-special-types,
+[ --without-opaque-special-types Don't use special opaque encodings.
+ SNMP normally cannot handle
+ floating numbers, nor large 64 bit
+ integers well. By default, the
+ net-snmp package compiles in
+ support for these extra datatypes
+ (in a legal way)])
+# Only define if specifically chosen as --without (i.e., default to true).
+if test "x$with_opaque_special_types" != "xno"; then
+ AC_DEFINE(NETSNMP_WITH_OPAQUE_SPECIAL_TYPES, 1,
+ [Should we compile to use special opaque types: float, double, counter64,
+ i64, ui64, union?])
+fi
+
+NETSNMP_ARG_ENABLE(ipv6,
+[ --enable-ipv6 Generate IPv6 ready version.],
+ [if test "x$enable_ipv6" = "xyes"; then
+ AC_DEFINE(NETSNMP_ENABLE_IPV6, 1,
+ [define if you want to enable IPv6 support])
+ fi])
+
+NETSNMP_ARG_WITH(logfile,
+[ --with-logfile="location" Default log file location for snmpd.],
+ ac_cv_user_prompt_NETSNMP_LOGFILE="$with_logfile")
+if test "$ac_cv_user_prompt_NETSNMP_LOGFILE" = "no"; then
+ ac_cv_user_prompt_NETSNMP_LOGFILE="none"
+fi
+
+NETSNMP_ARG_WITH(persistent-directory,
+[ --with-persistent-directory="directory"
+ Default directory for persistent data storage.],ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY="$with_persistent_directory")
+
+NETSNMP_ARG_WITH(persistent-mask,
+[ --with-persistent-mask="mask" Default mask for persistent data storage.
+ (Default: 077)],
+ [if test [`expr "X$withval" : 'X[0-7]*$'`] -eq 4 ; then
+ AC_MSG_RESULT([using persistent mask $withval])
+ withval="0$withval"
+ else
+ AC_MSG_ERROR([Please provide a three digit octal persistent mask value])
+ fi],
+ [withval=077
+ AC_MSG_RESULT([using default persistent mask $withval])])
+AC_DEFINE_UNQUOTED(NETSNMP_PERSISTENT_MASK,$withval,
+ [umask permissions to set up persistent files with])
+
+NETSNMP_ARG_WITH(copy_persistent_files,
+[ --with-copy-persistent-files="no" Don't copy persistent files
+ (or use "yes" to copy them).
+ (Default: yes)],
+ ac_cv_user_prompt_COPY_PERSISTENT_FILES="$with_copy_persistent_files")
+
+default_temp_file_pattern="/tmp/snmpdXXXXXX"
+NETSNMP_ARG_WITH(temp-file-pattern,
+[ --with-temp-file-pattern=PATTERN Pattern of temporary files (Default: /tmp/snmpdXXXXXX)],
+ [if test `expr "X$withval" : ".*XXXXXX$"` -ne 0 ; then
+ AC_MSG_RESULT(using temporary file pattern $withval)
+ else
+ AC_MSG_ERROR([temporary file pattens must end with 6 X's])
+ fi],
+ [withval="$default_temp_file_pattern"
+ AC_MSG_RESULT(using default temporary file pattern $withval)])
+AC_DEFINE_UNQUOTED(NETSNMP_TEMP_FILE_PATTERN,"$withval",
+ [Pattern of temporary files])
+
+
+##
+# Project: Library: Version configuration
+##
+
+SNMP_VERSIONS=""
+NETSNMP_ARG_ENABLE(snmpv1,
+[ --disable-snmpv1 Do not include code that implements SNMPv1.])
+if test "x$enable_snmpv1" = "xno"; then
+ AC_DEFINE([NETSNMP_DISABLE_SNMPV1], 1,
+ [Define if SNMPv1 code should not be included])
+else
+ SNMP_VERSIONS="$SNMP_VERSIONS 1"
+fi
+
+NETSNMP_ARG_ENABLE(snmpv2c,
+[ --disable-snmpv2c Do not include code that implements SNMPv2c.])
+if test "x$enable_snmpv2c" = "xno"; then
+ AC_DEFINE([NETSNMP_DISABLE_SNMPV2C], 1,
+ [Define if SNMPv2c code should not be included])
+else
+ SNMP_VERSIONS="$SNMP_VERSIONS 2c"
+fi
+
+SNMP_VERSIONS="$SNMP_VERSIONS 3"
+AC_MSG_CACHE_ADD(SNMP Versions Supported: $SNMP_VERSIONS)
+
+NETSNMP_ARG_WITH(default-snmp-version,
+[ --with-default-snmp-version="3" Default version of SNMP to use.
+ (Default: 3)
+ Legal values: 1, 2 (for SNMPv2c) or 3.],
+ ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION="$with_default_snmp_version")
+
+# we test this now and later as well. we test it now so configure can die
+# early on with an error rather than waiting till the end of the script.
+case "${ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION-3}" in
+ [[123]]) ;;
+ 2c) ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION=2 ;;
+ *)
+ AC_MSG_ERROR([Illegal version number. Only 1, 2 (for SNMPv2c) and 3 are supported.])
+ ;;
+esac
+
+
+##
+# Project: Library: Transport modules
+##
+
+AC_ARG_WITH(transports,
+[ --with-transports="t1 t2 ..." Compile in the given SNMP transport
+ modules (space or comma separated list).])
+AC_ARG_WITH(out_transports,
+[ --with-out-transports="t1 ..." Exclude listed SNMP transports
+ (space or comma separated list).
+
+ Available SNMP transport modules are:
+
+ UDP support for SNMP over UDP/IP.
+ This transport is always compiled in.
+ UDPIPv6 support for SNMP over UDP/IPv6.
+ This transport is available for Linux, Solaris and
+ FreeBSD at least.
+ This transport is compiled in by default if IPv6 support is enabled.
+ TCPIPv6 support for SNMP over UDP/IPv6.
+ This transport is available for Linux, Solaris and
+ FreeBSD at least.
+ This transport is compiled in by default if IPv6 support is enabled.
+ TCP support for SNMP over TCP/IP.
+ This transport is compiled in by default, but may be omitted.
+ Unix support for SNMP over Unix domain protocols.
+ This transport is compiled in by default except on Win32
+ platforms, and may be omitted.
+ Callback support for SNMP over an internal locally connected pair
+ of snmp_sessions.
+ Alias The alias transport simply lets you define more complex
+ transport strings and alias them to simple names in
+ the snmp.conf file.
+ AAL5PVC support for SNMP over AAL5 PVCs.
+ This transport is presently only available for Linux,
+ is never compiled in by default and may be omitted.
+ IPX support for SNMP over IPX per RFC 1420.
+ This transport is presently only available for Linux,
+ is never compiled in by default and may be omitted.
+ DTLSUDP support for tunneling SNMP over DTLS/UDP
+ TLSTCP support for tunneling SNMP over TLS/TCP
+ SSH (alpha) support for tunneling SNMP over SSH
+])
+
+#
+# Catch common mistakes in transport options
+#
+AC_ARG_WITH(transport,, NETSNMP_INVALID_WITH([transports]))
+AC_ARG_WITH(out-transport,, NETSNMP_INVALID_WITH([out-transports]))
+
+
+##
+# Project: Library: Security modules
+##
+
+NETSNMP_ARG_WITH(security-modules,
+[ --with-security-modules="s1 s2 ..." Compile in the given SNMP security
+ module services (space separated list).
+
+ Available SNMP security services:
+
+ usm support for user based SNMP security
+ ksm support for kerberos based SNMP security
+ tsm support for the Transport-based security
+ (for use with the SSH, DTLSUDP and TLSTCP transports)
+])
+
+NETSNMP_ARG_WITH(out-security-modules,
+[ --with-out-security-modules="s1 s2 ..." Removes the given SNMP security
+ module services from the default list.
+])
+
+
+##
+# Project: Library: Developer-related settings
+##
+
+NETSNMP_ARG_ENABLE(debugging,
+[ --enable-debugging Outputs extra debugging information at all
+ times. Normally, you should not enable this,
+ but instead use the -D flag of the commands,
+ which toggles debuging output at runtime.
+ --disable-debugging Disallows debugging code to be built in.
+ This might provide some speed benefits.],
+ AC_DEFINE(NETSNMP_ALWAYS_DEBUG))
+if test "x$enable_debugging" = "xno"; then
+ AC_DEFINE(NETSNMP_NO_DEBUGGING)
+fi
+
+NETSNMP_ARG_ENABLE(developer,
+[ --enable-developer Turns on super-duper-extra-compile-warnings
+ when using gcc.],
+ [if test "$enableval" = yes ; then
+ developer="yes"
+ elif test "$enableval" != no ; then
+ AC_MSG_ERROR([Please use --enable/--disable-developer])
+ else
+ developer="no"
+ fi])
+
+NETSNMP_ARG_ENABLE(testing-code,
+[ --enable-testing-code Enables some code sections that should
+ only be used for testing of certain
+ SNMP functionalities. This should *not*
+ be turned on for production use. Ever.],
+ [if test "$enableval" = yes ; then
+ AC_DEFINE(NETSNMP_ENABLE_TESTING_CODE, 1, [testing code sections.])
+ elif test "$enableval" != no ; then
+ AC_MSG_ERROR([Please use --enable/--disable-testing-code])
+ fi])
+
+NETSNMP_ARG_ENABLE(reentrant,
+[ --enable-reentrant Enables locking functions that protect
+ library resources in some multi-threading
+ environments. This does not guarantee
+ thread-safe operation.
+ Currently an experimental setting.],
+ [if test "$enableval" = yes -o "$enableval" = no ; then
+ with_res_locks="$enableval"
+ else
+ AC_MSG_ERROR([Please use --enable/--disable-reentrant])
+ fi],
+ [with_res_locks="no"])
+
+NETSNMP_ARG_ENABLE(deprecated,
+[ --disable-deprecated Don't compile in deprecated functions.])
+if test "$enable_deprecated" = no ; then
+ AC_DEFINE([NETSNMP_NO_DEPRECATED_FUNCTIONS], 1,
+ [Define to suppress inclusion of deprecated functions])
+fi
+
+
+
+##
+# Project: Agent configuration settings
+##
+
+NETSNMP_ARG_WITH(root-access,
+[
+Configuring the agent:
+ --without-root-access The snmpd agent won't require root access to
+ run it. The information it returns in the
+ mib-II tree may not be correct, however.])
+# Only define if specifically chosen as --without (i.e., default to true).
+if test "x$with_root_access" = "xno"; then
+ AC_DEFINE(NETSNMP_NO_ROOT_ACCESS, 1,
+ [If you don't have root access don't exit upon kmem errors])
+fi
+
+NETSNMP_ARG_WITH(kmem-usage,
+[ --without-kmem-usage Do not include any code related to the use
+ of kmem.])
+# Only define if specifically chosen as --without (i.e., default to true).
+if test "x$with_kmem_usage" = "xno"; then
+ AC_DEFINE(NETSNMP_NO_KMEM_USAGE, 1, [If we don't want to use kmem.])
+fi
+
+NETSNMP_ARG_WITH(dummy-values,
+[ --with-dummy-values Provide 'placeholder' dummy values where
+ the necessary information is not available.
+ This is technically not compliant with the
+ SNMP specifications, but was how the agent
+ operated for versions < 4.0.])
+# Define unless specifically suppressed (i.e., option defaults to false).
+if test "x$with_dummy_values" != "xyes"; then
+ AC_DEFINE(NETSNMP_NO_DUMMY_VALUES, 1,
+ [If you don't want the agent to report on variables it doesn't have
+ data for])
+fi
+
+NETSNMP_ARG_ENABLE(set-support,
+[ --disable-set-support Do not allow SNMP set requests.])
+if test "x$enable_set_support" = "xno"; then
+ AC_DEFINE([NETSNMP_DISABLE_SET_SUPPORT], 1,
+ [Define if SNMP SET support should be disabled])
+fi
+
+
+NETSNMP_ARG_WITH(sys_contact,
+[ --with-sys-contact="who@where" Default system contact.
+ (Default: LOGIN@DOMAINNAME)],
+ ac_cv_user_prompt_NETSNMP_SYS_CONTACT="$with_sys_contact")
+
+NETSNMP_ARG_WITH(sys_location,
+[ --with-sys-location="location" Default system location.
+ (Default: Unknown)],
+ ac_cv_user_prompt_NETSNMP_SYS_LOC="$with_sys_location")
+
+
+
+##
+# Project: Agent: Extensibility configuration
+##
+
+NETSNMP_ARG_ENABLE(local-smux,
+[ --enable-local-smux Restrict SMUX connections to localhost (by default).],
+ [if test "x$enable_local_smux" = "xyes"; then
+ AC_DEFINE(NETSNMP_ENABLE_LOCAL_SMUX, 1,
+ [define if you want to restrict SMUX connections to localhost
+ by default])
+ fi])
+
+NETSNMP_ARG_ENABLE(agentx-dom-sock-only,
+[ --enable-agentx-dom-sock-only Disable UDP/TCP transports for agentx.],
+AC_DEFINE(NETSNMP_AGENTX_DOM_SOCK_ONLY, 1,
+ [define if agentx transport is to use domain sockets only]))
+
+NETSNMP_ARG_ENABLE(snmptrapd-subagent,
+[ --disable-snmptrapd-subagent Disable agentx subagent code in snmptrapd.])
+if test "x$enable_snmptrapd_subagent" = "xno"; then
+ AC_DEFINE(NETSNMP_SNMPTRAPD_DISABLE_AGENTX, 1,
+ [define if you do not want snmptrapd to register as an AgentX subagent])
+fi
+
+default_agentx_socket="/var/agentx/master"
+NETSNMP_ARG_WITH(agentx-socket,
+[ --with-agentx-socket=FILE AgentX socket (Default: /var/agentx/master as specified in RFC2741)],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a full path ]);
+ fi
+ AC_MSG_RESULT(using AgentX socket $withval)
+],[
+ withval=$default_agentx_socket
+ AC_MSG_RESULT(using default AgentX socket $default_agentx_socket)
+])
+AC_DEFINE_UNQUOTED(NETSNMP_AGENTX_SOCKET,"$withval",
+ [Unix domain socket for AgentX master-subagent communication])
+
+#
+# feature addition/removal and minimialist support
+#
+FEATURE_ADD_FLAGS=""
+NETSNMP_ARG_WITH(features,
+[ --with-features="feat1 feat2" Request extra features to be turned on.
+ (only useful with --enable-minimalist)],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a list of features ]);
+ fi
+ FEATURE_ADD_FLAGS="--add $withval"
+ AC_MSG_RESULT(adding in features: $withval)
+])
+AC_SUBST(FEATURE_ADD_FLAGS)
+
+
+FEATURE_REMOVE_FLAGS=""
+NETSNMP_ARG_WITH(out-features,
+[ --with-out-features="feat1..." Remove specific features.
+ (implies --enable-minimalist)],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a list of features ]);
+ fi
+ FEATURE_REMOVE_FLAGS="--remove $withval"
+ FEATURETARGS="features"
+ AC_DEFINE(NETSNMP_MINIMAL_CODE, 1,
+ [Define if you want to remove all non-essential code features.])
+ AC_MSG_RESULT(removing features: $withval)
+])
+AC_SUBST(FEATURE_REMOVE_FLAGS)
+
+
+# Catch common mistakes
+AC_ARG_WITH(feature,, NETSNMP_INVALID_WITH([features]))
+AC_ARG_WITH(out-feature,, NETSNMP_INVALID_WITH([out-features]))
+
+FEATURETARGS=""
+NETSNMP_ARG_ENABLE(minimalist,
+[ --enable-minimalist Remove all non-essential code features.])
+if test "x$enable_minimalist" = "xyes"; then
+ # we'll assume the mini agent is desired here as well
+ mini_agent="yes"
+ FEATURETARGS="features"
+
+ # needed to bootstrap later checks
+ echo "" > include/net-snmp/feature-details.h
+ AC_DEFINE(NETSNMP_MINIMAL_CODE, 1,
+ [Define if you want to remove all non-essential code features.])
+else
+ FEATUREHEADERS=""
+fi
+AC_ARG_WITH([minimalist],,NETSNMP_INVALID_ENABLE([minimalist]))
+AC_SUBST(FEATURETARGS)
+AC_SUBST(FEATUREHEADERS)
+
+NETSNMP_ARG_ENABLE(notify-only,
+[ --enable-notify-only Build tools that can only send notifications.])
+if test "x$enable_notify_only" = "xyes"; then
+ AC_DEFINE(NETSNMP_NOTIFY_ONLY, 1,
+ [Define if you want to only support sending notifications])
+fi
+AC_ARG_WITH([notify-only],,NETSNMP_INVALID_ENABLE([notify-only]))
+AC_ARG_ENABLE([notifyonly],,NETSNMP_INVALID_ENABLE([notify-only]))
+
+NETSNMP_ARG_ENABLE(no-listen,
+[ --enable-no-listen Build tools that can't listen to ports.])
+if test "x$enable_no_listen" = "xyes" -o "x$enable_notify_only" = "xyes"; then
+ enable_no_listen="yes"
+ AC_DEFINE(NETSNMP_NO_LISTEN_SUPPORT, 1,
+ [Define if you want to remove all listening support from the code])
+fi
+AC_ARG_WITH([no-listen],,NETSNMP_INVALID_ENABLE([no-listen]))
+AC_ARG_ENABLE([nolisten],,NETSNMP_INVALID_ENABLE([no-listen]))
+
+NETSNMP_ARG_ENABLE(read-only,
+[ --enable-read-only Remove all SET support from the code.])
+if test "x$enable_read_only" = "xyes" -o "x$enable_notify_only" = "xyes" ; then
+ enable_read_only="yes"
+ AC_DEFINE(NETSNMP_NO_WRITE_SUPPORT, 1,
+ [Define if you want to remove all SET/write access from the code])
+fi
+AC_ARG_WITH([read-only],,NETSNMP_INVALID_ENABLE([read-only]))
+AC_ARG_ENABLE([readonly],,NETSNMP_INVALID_ENABLE([read-only]))
+
+
+##
+# Project: Agent: MIB module configuration
+##
+
+NETSNMP_ARG_ENABLE(mini_agent,
+[ --enable-mini-agent Build a minimal agent.])
+if test "x$enable_mini_agent" = "xyes"; then
+ mini_agent="yes"
+else
+ mini_agent="no"
+fi
+AC_ARG_WITH([miniagent],,NETSNMP_INVALID_ENABLE([mini-agent]))
+AC_ARG_ENABLE([miniagent],,NETSNMP_INVALID_ENABLE([mini-agent]))
+
+
+
+
+NETSNMP_ARG_ENABLE(mfd-rewrites,
+[ --enable-mfd-rewrites Use new MFD rewrites of mib modules,
+ where available. (default is to use
+ original mib module code).])
+if test "x$enable_mfd_rewrites" = "xyes"; then
+ AC_DEFINE(NETSNMP_ENABLE_MFD_REWRITES, 1,
+ [Define if you want to build MFD module rewrites])
+fi
+
+
+NETSNMP_ARG_WITH(mib_modules,
+[ --with-mib-modules="item1 ..." Compile with additional mib modules
+ (Space separated list).])
+
+NETSNMP_ARG_WITH(out_mib_modules,
+[ --with-out-mib-modules="list" Compile without these mib modules.
+
+ Default mib modules compiled into the agent (which can be removed):
+
+ mibII support for the mib-II tree.
+ snmpv3mibs support for the snmpv3 mib modules.
+ ucd_snmp UCD-SNMP-MIB specific extensions.
+ agent_mibs NET-SNMP-AGENT-MIB extensions
+ agentx AgentX support (see below)
+ notification mibs supporting specification of trap destinations.
+ target Support for the SNMP WGs TARGET-MIB.
+ utilities general agent configuration utilities.
+ disman/event support for the DISMAN-EVENT-MIB
+ (supports self monitoring and notification
+ delivery when error conditions are found)
+ disman/schedule support for the DISMAN-SCHEDULE-MIB
+ (trigger SET requests at specified times)
+ host host resources mib support.
+ (only on major supported platforms)
+
+ Optional mib modules that can be built into the agent include:
+ smux smux support to allow subagents to attach to snmpd.
+ mibII/mta_sendmail Sendmail statistics monitoring (MTA-MIB)
+ ucd-snmp/diskio Table of io-devices and how much data they have
+ read/written. (only tested on Solaris, Linux)
+ disman/old-event-mib previous implementation of the DISMAN-EVENT-MIB
+
+ Optional modules for specific platforms
+ Linux
+ ucd-snmp/lmSensors hardware monitoring (LM-SENSORS-MIB)
+ ip-mib/ipv4InterfaceTable (experimental)
+ ip-mib/ipv6InterfaceTable (experimental)
+ tunnel Linux TUNNEL-MIB support (ifTable extension)
+ mibII/interfaces (old ifTable implementation)
+ misc/ipfwacc accounting rules IP firewall information
+ ipfwchains/ipfwchains firewall chains under ipfw
+ (See agent/mibgroup/ipfwchains/README)
+ sctp-mib support for the SCTP-MIB
+ etherlike-mib support for the EtherLike-MIB
+
+ Solaris
+ ucd-snmp/lmSensors hardware monitoring (LM-SENSORS-MIB)
+ if-mib IF-MIB rewrite (add --enable-mfd-rewrites)
+ tcp-mib TCP-MIB rewrite (tcpConnectionTable and
+ tcpListenerTable; add --enable-mfd-rewrites)
+ udp-mib UDP-MIB rewrite (udpEndpointTable;
+ add --enable-mfd-rewrites)
+
+ FreeBSD/OpenBSD
+ if-mib IF-MIB rewrite (add --enable-mfd-rewrites)
+
+ AgentX support:
+ agentx/subagent allows the agent to run as either a snmp agent
+ or as an agentX sub-agent.
+ agentx/master makes the agent run as an agentX master agent
+ as well as a normal snmp agent.
+ agentx includes both agentx/master and agentx/client.
+
+ Optional modules for C coders to look at and/or include as extension examples:
+
+ examples/ucdDemoPublic SNMPv3 interoperability testing mib.
+ examples/example example C code extension.])
+
+
+#
+# Catch common mistakes in configure options
+#
+AC_ARG_WITH(mib-module,, NETSNMP_INVALID_WITH([mib-modules]))
+AC_ARG_WITH(module,, NETSNMP_INVALID_WITH([mib-modules]))
+AC_ARG_WITH(modules,, NETSNMP_INVALID_WITH([mib-modules]))
+
+AC_ARG_WITH(out-mib-module,, NETSNMP_INVALID_WITH([out-mib-modules]))
+AC_ARG_WITH(out-module,, NETSNMP_INVALID_WITH([out-mib-modules]))
+AC_ARG_WITH(out-modules,, NETSNMP_INVALID_WITH([out-mib-modules]))
+
+
+##
+# Project: Enterprise settings (? Agent/Library/Both?)
+##
+
+NETSNMP_ARG_WITH(enterprise-oid,
+[Enterprise OIDs: (warning: this should be used with caution.)
+
+ --with-enterprise-oid The enterprise number assigned to the
+ vendor by IANA. See
+ http://www.iana.org/cgi-bin/enterprise.pl
+ to get one, though using the default is
+ probably the right choice is most cases.
+ (default 8072 = "enterprise.net-snmp")],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a value for the enterprise number ]);
+ fi
+ AC_DEFINE_UNQUOTED(NETSNMP_ENTERPRISE_OID, $withval)
+ ent_oid="1,3,6,1,4,1,$withval"
+ AC_DEFINE_UNQUOTED(NETSNMP_ENTERPRISE_MIB, $ent_oid)
+ ent_dot_oid="1.3.6.1.4.1.$withval"
+ AC_DEFINE_UNQUOTED(NETSNMP_ENTERPRISE_DOT_MIB, $ent_dot_oid)
+ AC_MSG_RESULT(using enterprise number $withval)
+],[
+ AC_MSG_RESULT(using default "enterprise.net-snmp")
+])
+
+NETSNMP_ARG_WITH(enterprise-sysoid,
+[
+ --with-enterprise-sysoid The base OID for the sysObjectID
+ of the system group
+ (default .1.3.6.1.4.1.8072.3.2... =
+ "netSnmpAgentOIDs...")],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a base OID value ]);
+ fi
+ sys_oid=`echo "$withval" | sed 's/^\.//' | sed 's/\./\,/g'`
+ AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_MIB, $sys_oid)
+ sys_dot_oid=`echo "$withval" | sed 's/^\.//'`
+ AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_DOT_MIB, $sys_dot_oid)
+ sysoid_len=`echo "$withval" | sed 's/[^\.]//g' | awk -F\. '{ print NF }'`
+ AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_DOT_MIB_LENGTH, $sysoid_len)
+ AC_MSG_RESULT(using enterprise sysOID $withval ....)
+],[
+ AC_MSG_RESULT(using default enterprise sysOID "NET-SNMP-MIB::netSnmpAgentOIDs...")
+])
+
+NETSNMP_ARG_WITH(enterprise-notification-oid,
+[
+ --with-enterprise-notification-oid The OID used for the root of
+ enterprise specific notifications.
+ (default .1.3.6.1.4.1.8072.4 =
+ "netSnmpNotificationPrefix")],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a base OID value ]);
+ fi
+ notification_oid=`echo "$withval" | sed 's/^\.//' | sed 's/\./\,/g'`
+ AC_DEFINE_UNQUOTED(NETSNMP_NOTIFICATION_MIB, $notification_oid)
+ notification_dot_oid=`echo "$withval" | sed 's/^\.//'`
+ AC_DEFINE_UNQUOTED(NETSNMP_NOTIFICATION_DOT_MIB, $notification_dot_oid)
+ notificationoid_len=`echo "$withval" | sed 's/[^\.]//g' | awk -F\. '{ print NF }'`
+ AC_DEFINE_UNQUOTED(NETSNMP_NOTIFICATION_DOT_MIB_LENGTH, $notificationoid_len)
+ AC_MSG_RESULT(using enterprise notifications $withval)
+],[
+ AC_MSG_RESULT(using default notifications "NET-SNMP-MIB::netSnmpNotifications")
+])
+
+
+##
+# Project: Perl settings
+##
+
+NETSNMP_ARG_WITH(perl-modules,
+[
+Perl:
+ --with-perl-modules[=ARGS] Install the Perl modules along with the rest
+ of the net-snmp toolkit. If ARGS is
+ specified, they're passed to the
+ Makefile.PL script.],[
+ if test "$withval" = "no"; then
+ install_perl="no"
+ else
+ install_perl="yes"
+ if test "$withval" != "yes"; then
+ PERLARGS="$withval"
+ fi
+ fi
+], install_perl="try")
+
+NETSNMP_ARG_ENABLE(embedded-perl,
+[ --disable-embedded-perl Disable embedded Perl in the SNMP agent and
+ snmptrapd. [enabled by default]],
+ embed_perl="$enableval", embed_perl="try")
+
+NETSNMP_ARG_ENABLE(perl-cc-checks,
+[ --disable-perl-cc-checks Disable configure checks for whether Perl's
+ C Compiler is compatible with ours when
+ embedded Perl is enabled.])
+
+
+##
+# Project: Python settings
+##
+
+AC_ARG_WITH(python-modules,
+[
+Python:
+ --with-python-modules[=ARGS] Install the python bindings along with the
+ rest of the net-snmp toolkit. If ARGS is
+ specified, they're passed to the
+ setup.py script as arguments.],[
+ install_python="yes"
+ if test "$withval" = "yes"; then
+ PYTHONARGS=""
+ elif test "$withval" = "no"; then
+ PYTHONARGS=""
+ install_python="no"
+ else
+ PYTHONARGS="$withval"
+ fi
+], install_python="no")
+
+
+##
+# Project: Library settings
+##
+
+NETSNMP_ARG_WITH(server-send-buf,
+[
+Network Buffers:
+ --with-server-send-buf[=ARG] Use ARG for the default UDP/TCP send buffer instead
+ of the OS buffer for server sockets that are
+ created (snmpd, snmptrapd).
+ This default can be overridden in the runtime
+ configuration files.
+ The ARG should be the size in bytes],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a positive number for the server send buffer ])
+ fi
+ AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_SERVER_SEND_BUF, $withval)],
+ AC_MSG_RESULT([using OS default send buffer size for server sockets]) )
+
+NETSNMP_ARG_WITH(server-recv-buf,
+[ --with-server-recv-buf[=ARG] Similar as previous option, but for receive buffer],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a positive number for the server recv buffer ])
+ fi
+ AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_SERVER_RECV_BUF, $withval)],
+ AC_MSG_RESULT([using OS default recv buffer size for server sockets]) )
+
+NETSNMP_ARG_WITH(client-send-buf,
+[ --with-client-send-buf[=ARG] Similar as previous options, but for the
+ receive buffer of client sockets],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a positive number for the client send buffer ])
+ fi
+ AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_CLIENT_SEND_BUF, $withval)],
+ AC_MSG_RESULT([using OS default send buffer size for client sockets]) )
+
+NETSNMP_ARG_WITH(client-recv-buf,
+[ --with-client-recv-buf[=ARG] Similar as previous options, but for the send buffer],[
+ if test "$withval" = yes; then
+ AC_MSG_ERROR([ Please provide a positive number for the client recv buffer ])
+ fi
+ AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_CLIENT_RECV_BUF, $withval)],
+ AC_MSG_RESULT([using OS default recv buffer size for client sockets]) )
+
+##
+# System: library settings (more)
+##
+
+NETSNMP_ARG_WITH(elf,
+ [AS_HELP_STRING([--without-elf],[use elf libraries])])
+
+NETSNMP_ARG_WITH(nl,
+ [AS_HELP_STRING([--with-nl],[use libnl to get netlink data (linux only).])])
+
+NETSNMP_ARG_WITH(libwrap,
+ [ --with-libwrap[=LIBPATH] Compile in libwrap (tcp_wrappers) support.],
+ [],
+ [with_libwrap="no"])
+
+NETSNMP_ARG_WITH(zlib,
+ [ --with-zlib[=DIR] use libz in DIR],
+ [],
+ [with_zlib="no"])
+
+AC_ARG_WITH(bzip2,
+ [ --with-bzip2[=DIR] use libbz2 in DIR],
+ [],
+ [with_bzip2="no"])
+
+NETSNMP_ARG_WITH(
+ [mnttab],
+ AS_HELP_STRING(
+ [--with-mnttab="/etc/mnttab"],
+ [Mount table location. The default is to autodetect this.]))
+
+##
+# Project: mysql
+##
+
+NETSNMP_ARG_WITH(mysql,
+ [ --with-mysql Include support for MySQL.])
+if test "x$with_mysql" = "xyes"; then
+ AC_DEFINE(NETSNMP_USE_MYSQL, 1,
+ [define if you are using the mysql code for snmptrapd ...])
+fi
diff --git a/dist/Makefile b/dist/Makefile
new file mode 100644
index 0000000..c771f93
--- /dev/null
+++ b/dist/Makefile
@@ -0,0 +1,133 @@
+# ======================================================================
+# $Source$
+# $Revision$
+# $Date$
+# $Author$
+# $Name$
+# $State$
+# ======================================================================
+
+# Makefile for generating rpm package files (.rpm) for net-snmp.
+
+# GNU 'make'-specific features are used in this makefile.
+# Other makes may or may not work with it.
+# See http://www.gnu.org/manual/make/index.html for details.
+
+SHELL = /bin/sh
+
+# Define the RPM package name
+NAME = net-snmp
+
+# Define the default RPM release number. Set by Version-Munge.pl
+VERSION = 5.7.2
+
+VERSION_TAG=`echo Ext-$(VERSION) | sed 's/\./-/g;'`
+
+WITH_PERL=1
+EMBED_PERL=1
+
+# Define the RPM architecture, i.e., 'ppc', 'i386', etc.
+ARCH = `uname -i`
+
+# Directory structure expected by 'rpm' program
+RPM_BASE := $(PWD)/rpm
+
+RPM_TREE := \
+ $(RPM_BASE)/BUILD \
+ $(RPM_BASE)/RPMS \
+ $(RPM_BASE)/SOURCES \
+ $(RPM_BASE)/SPECS \
+ $(RPM_BASE)/SRPMS
+
+.PHONY: all clean rpm_files binary_rpm source_rpm all_rpm
+
+all: all_rpm_files
+
+# Delete all generated files.
+clean:
+ rm -rf $(RPM_BASE)
+
+# --------------------------------------------------------------------
+# Macros and rules for updating net-snmp-x.x.x.tar.gz.
+# 'rpm' expects a compressed archive (.tar.gz) of the source directory
+# to exist (in the rpm/SOURCES directory) before it is run.
+# --------------------------------------------------------------------
+CVSROOT = :pserver:anonymous@net-snmp.cvs.sourceforge.net:/cvsroot/net-snmp
+
+PKG_VER := $(NAME)-$(VERSION)
+
+GZIP_TAR := $(RPM_BASE)/SOURCES/$(PKG_VER).tar.gz
+
+gzip_tar: $(GZIP_TAR)
+
+$(GZIP_TAR):
+ @echo "Creating a compressed archive of the package's source files..."
+ (cd $(RPM_BASE)/SOURCES; \
+ cvs -d$(CVSROOT) login; \
+ cvs -z3 -d$(CVSROOT) export -r$(VERSION_TAG) $(NAME); \
+ mv $(NAME) $(PKG_VER); \
+ tar cf $(PKG_VER).tar $(PKG_VER); \
+ gzip $(PKG_VER).tar)
+ @echo "A compressed archive of the package's source-file tree has been created."
+
+# --------------------------------------------------------------------
+# Macros and rules for updating the binary and source RPM package files.
+# --------------------------------------------------------------------
+# Redefine '%_topdir' to allow an RPM package file to be built anywhere,
+# instead of in the /usr/src/redhat directory tree.
+#
+# Don't want 'rpmbuild' to strip your executable programs?
+# Then add this line:
+# --define='_os_install_post /usr/lib/rpm/brp-compress' \
+# to the RPM_OPTS macro definition. This will eliminate the
+# stripping of binaries, but still retain the compression of
+# manual pages.
+#
+ifeq ($(WITH_PERL),0)
+PERLOPTS = --without perl_modules
+endif
+ifeq ($(EMBED_PERL),0)
+PERLOPTS += --without embedded_perl
+endif
+
+RPM_OPTS := \
+ --define='_topdir $(RPM_BASE)' \
+ --define='_includedir /usr/include/net-snmp' \
+ --target $(ARCH) $(PERLOPTS)
+
+SPEC_FILE := $(NAME).spec
+RPM_SPEC := $(RPM_BASE)/SPECS/$(SPEC_FILE)
+
+BINARY_RPM := $(RPM_BASE)/RPMS/$(ARCH)/$(PKG_VER)-$(RELEASE).$(ARCH).rpm
+SOURCE_RPM := $(RPM_BASE)/SRPMS/$(PKG_VER)-$(RELEASE).src.rpm
+
+rpm_files: $(GZIP_TAR) all_rpm_files
+binary_rpm: $(BINARY_RPM)
+source_rpm: $(SOURCE_RPM)
+rpm_tree: $(RPM_TREE)
+
+all_rpm_files: $(RPM_TREE) $(RPM_SPEC)
+ (cd $(RPM_BASE)/SPECS; \
+ rpmbuild -ba $(RPM_OPTS) $(SPEC_FILE))
+
+$(BINARY_RPM): $(RPM_TREE) $(RPM_SPEC)
+ (cd $(RPM_BASE)/SPECS; \
+ rpmbuild -bb $(RPM_OPTS) $(SPEC_FILE))
+
+$(SOURCE_RPM): $(RPM_TREE) $(RPM_SPEC)
+ (cd $(RPM_BASE)/SPECS; \
+ rpmbuild -bs $(RPM_OPTS) $(SPEC_FILE))
+
+$(RPM_SPEC): $(RPM_BASE)/SPECS $(SPEC_FILE)
+ cp $(SPEC_FILE) $@
+
+$(RPM_TREE):
+ mkdir -p $@
+
+$(SPEC_FILE):
+ @echo "ERROR: missing '$(SPEC_FILE)' in the current directory"
+ @exit 1
+
+FORCE:
+
+# === End of Makefile === #
diff --git a/dist/README.build-scripts b/dist/README.build-scripts
new file mode 100644
index 0000000..9e06dfb
--- /dev/null
+++ b/dist/README.build-scripts
@@ -0,0 +1,108 @@
+******************************************************************************
+*
+* README.build-scripts
+*
+* Author: Robert Story <rstory@freesnmp.com>
+*
+* $Id$
+*
+******************************************************************************
+
+
+Introduction
+============
+
+The automated build script will automatically run configure, 'make all',
+'make test' and 'make install'. Log files are kept for each step, and the
+scripts should abort when errors occur.
+
+The usage of nsb-package is:
+
+ Usage: nsb-package [-c] [-d] [-p] [-s SRCD] [-b BUILDD] [-i INSTALLD] VERSION
+
+ VERSION : release number (eg 5.2.2)
+ -s SRCDIR : soure directory [$HOME/src/net-snmp-VERSION]
+ -b BUILDD : build directory [$HOME/build/]
+ NOTE-platform will be appended to build directory
+ -i INSTALLD: install directory [$HOME/build/\$PLATFORM/usr/local]
+
+ -c : skip configure
+ -d : dirty build (don't make distclean)
+ -m : skip 'make all'
+ -p : don't pause at prompts in between stages
+ -t : skip 'make test'
+
+
+The defaults assume you have a 'src', 'build' and 'binaries' directory in
+your home directory.
+
+
+
+Recommended Procedure
+=====================
+
+1) Log into Sourceforge Compile Farm Server
+
+2) Update source (this will likely be automated in the future)
+
+ For example, for release 5.0.3:
+
+ $ cd ~/src
+ $ CVS_RSH=ssh cvs -d $USER@cvs.net-snmp.org:/cvsroot/net-snmp \
+ -q co -r Ext-5-0-3 -d ~/src/net-snmp-Ext-5-0-3 net-snmp
+
+3) Run the package script.
+
+ $ $HOME/src/net-snmp-cvs/dist/nsb-package -r \
+ -s $HOME/src/net-snmp-5.0.5 5.0.5
+
+4) Create tarball (assuming no errors; see next section if there are errors)
+
+ $ cd ~/build/`nsb-platform`
+ $ tar cvf net-snmp-5.0.3-`nsb-platform`.tar usr
+ $ gzip --best *.tar
+
+5) Copy tarball to Sourceforge shell sever
+
+ $ scp *.gz net-snmp.sourceforge.net:~/binaries/
+
+6) Log out of compile farm server, log into shell server
+
+7) Upload to Sourceforge
+
+ $ ftp upload.sourceforge.net
+ >bin
+ >put *.gz
+
+8) Update binaries via Sourceforge admin page
+
+
+
+Builds with errors
+==================
+
+Should you encounter a build error, you will most likely want to skip the
+'make distclean' and configure step (assuming the problem wasn't with
+configure!). To do this, specify the 'dirty' and 'skip configure' options:
+
+ $ nsb-package -p -d -c Ext-5-0-3
+
+
+Should the build succeed, but some tests fail during 'make test', you probably
+can to skip the test step to get to the install step:
+
+ $ nsb-package -p -d -c -t Ext-5-0-3
+
+
+OTHER PROBLEMS
+--------------
+* "Cannot find nsb-functions"
+
+ It's a hack, but symlink nsb-functions and nsb-package to your local
+ bin directory ($HOME/bin). I'm trying to think of a better solution.
+
+* "gcc: snmp_version.lo: No such file or directory"
+
+ This is a good indication that you have previously build in your
+ source directory. 'make distclean' in your source directory, or
+ check out a fresh new version from CVS.
diff --git a/dist/RELEASE-INSTRUCTIONS b/dist/RELEASE-INSTRUCTIONS
new file mode 100644
index 0000000..56a4161
--- /dev/null
+++ b/dist/RELEASE-INSTRUCTIONS
@@ -0,0 +1,1001 @@
+This is a summary of the steps required to make a new release. Do not
+attempt to run these manually - instead use the 'makerelease'
+application and makerelease.xml file. Get 'makerelease' from the
+makerelease SVN repository:
+
+ svn co https://makerelease.svn.sourceforge.net/svnroot/makerelease/trunk/makerelease
+ cd makerelease
+ perl Makefile.PL
+ make
+ sudo make install
+
+Then to run it from a directory to release:
+
+ makerelease -c NETSNMPTRUNK/dist/makerelease.xml
+
+It will prompt you for all needed information and tasks to be done.
+
+IMPORTANT NOTE:
+ Don't *ever* release a second tar ball under the same name as the
+ first. It's much much much better to release another version
+ instead, since you don't have to figure out from the bug reports
+ that a user really grabbed the first snapshot instead of the
+ second when they complain about version "XXX" not working.
+
+====== makerelease -n output showing makerelease documented steps ======
+
+STEP: 1: Setup Steps
+
+ This set of steps will do some preliminary "safety" checks to ensure the
+ local environment is ok and setup some important information.
+
+ ===== Entering Step: 1 =====
+
+STEP: 1.1: Setup Checck
+
+ This should show the last version number published in this branch by
+ looking at the time line in the README file:
+
+ Commands to execute:
+
+ head -1 README
+
+STEP: 1.2: Pick a Version Number
+
+ Please enter the version number to publish. Net-SNMP convention dictates
+ that this be a version number like 5.4 or 5.4.1. Pre-releases that occur
+ before a branch freezes should be appended with ".preN" like 5.4.1.pre2.
+ Release-candidates should be labeled ".rcN" like 5.4.1.rc1.
+
+ Decide on a value for parameter 'VERSION'
+
+ parameter: VERSION
+
+ prompt: Enter the new version number:
+
+STEP: 1.3: Defining a second internal version string
+
+ Internal perl code will be executed
+
+STEP: 1.4: Release Parameter Information
+
+ Here is the configured information we'll be using:
+
+ VERSION: {VERSION}
+
+ VERSION with dashes: {VERSIONDASHES}
+
+ Floating point VERSION: {VERSIONFLOAT}
+
+ SVN Branch URL: {BRANCHPATH}
+
+STEP: 1.5: update
+
+ We need to make sure your code is up to date and matches the latest
+ sources in this branch.
+
+ Commands to execute:
+
+ svn update
+
+STEP: 1.6: Check for changes
+
+ This steps looks for outstanding files that have been modified. There
+ should be no outstanding modifications! If this step finds outstanding
+ modified files you need to check them in or revert them before
+ continuing!
+
+ Commands to execute:
+
+ svn -u status | egrep '^[^\?]'
+
+ (Leaving Step: 1)
+
+STEP: 2: Source Code Setup
+
+ This set of steps will modify various places within the source code tree
+ to bring it up to date with the new version number about to be published.
+
+ ===== Entering Step: 2 =====
+
+STEP: 2.1: Libtool / Library versioning setup
+
+ These steps will modify the various files in the source tree that contain
+ the version number, show you the changes that will be made and then check
+ in the resulting changes if you approve of them.
+
+ ===== Entering Step: 2.1 =====
+
+STEP: 2.1.1: version:libtoolmanualedit
+
+ You (may) need to edit Makefile.top to update the library version
+ numbering (usually just for the first pre-release of a given version).
+ See the comments in RELEASE-INSTRUCTIONS about LIBCURRENT, LIBAGE and
+ LIBREVISION.
+
+ This script will commit the file for you after you're done.
+
+STEP: 2.1.2: version:commit
+
+ We'll now commit the Makefile.top file if you've modified it.
+
+ Commands to execute:
+
+ svn commit -m "version update" Makefile.top
+
+ (Leaving Step: 2.1)
+
+STEP: 2.2: Change The Version Number
+
+ These steps will modify the various files in the source tree that contain
+ the version number, show you the changes that will be made and then check
+ in the resulting changes if you approve of them.
+
+ ===== Entering Step: 2.2 =====
+
+STEP: 2.2.1: Modify the source files
+
+ We will now modify files through the code to replace the version number
+ with the newer one.
+
+ Modifying files:
+
+ replacing: 'VERSION = '(.*)'' with: 'VERSION = \'{VERSIONFLOAT}\''
+
+
+ files: glob=ARRAY(0x8dc9064)
+
+ perl/SNMP/SNMP.pm
+
+ perl/agent/agent.pm
+
+ perl/agent/Support/Support.pm
+
+ perl/agent/default_store/default_store.pm
+
+ perl/default_store/default_store.pm
+
+ perl/OID/OID.pm
+
+ perl/ASN/ASN.pm
+
+ perl/AnyData_SNMP/Storage.pm
+
+ perl/AnyData_SNMP/Format.pm
+
+ perl/TrapReceiver/TrapReceiver.pm
+
+
+
+ Modifying files:
+
+ replacing: 'NetSnmpVersionInfo = "[\d\.]+"' with: 'NetSnmpVersionInfo =
+ "{VERSION}"'
+
+
+ files: glob=ARRAY(0x8dc8fd4)
+
+ snmplib/snmp_version.c
+
+
+
+ Modifying files:
+
+ replacing: 'Version: [\.0-9a-zA-Z]+' with: 'Version: {VERSION}'
+
+
+ files: glob=ARRAY(0x8dc8f44)
+
+ README
+
+ FAQ
+
+ dist/net-snmp.spec
+
+
+
+ Modifying files:
+
+ replacing: 'VERSION = [\.0-9a-zA-Z]+' with: 'VERSION = {VERSION}'
+
+
+ files: glob=ARRAY(0x8dc8ed4)
+
+ dist/Makefile
+
+
+
+ Modifying files:
+
+ replacing: 'AC_INIT\(\[Net-SNMP\], \[([^\]]+)\]' with:
+ 'AC_INIT([Net-SNMP], [{VERSION}]'
+
+
+ files: glob=ARRAY(0x8dc8e64)
+
+ configure.in
+
+
+
+ Modifying files:
+
+ replacing: 'NetSnmpVersionInfo = "[^"]+"' with: 'NetSnmpVersionInfo =
+ "{VERSION}"'
+
+
+ files: glob=ARRAY(0x8dc8df4)
+
+ snmplib/snmp_version.c
+
+
+
+STEP: 2.2.2: Running autoconf to rebuild configure
+
+ We modified configure.in, so we now need to run autoconf to rebuild
+ configure.
+
+ XXX: in the future we should verify the correct autoconf version number
+
+ Commands to execute:
+
+ autoconf
+
+STEP: 2.2.3: Running svn diff to check changes
+
+ Check the following changes for proper version number differences before
+ we commit the chances.
+
+ Commands to execute:
+
+ svn diff
+
+STEP: 2.2.4: Running svn commit to commit the changes
+
+ Check the changes in the above diff and then we'll commit the results
+ here if they look ok.
+
+ Commands to execute:
+
+ svn commit -m "Version number update"
+
+ (Leaving Step: 2.2)
+
+STEP: 2.3: docs:make
+
+ This step will create manual pages from doxygen instrumented code files.
+
+ Commands to execute:
+
+ make docs
+
+ make mancp
+
+STEP: 2.4: docs:update
+
+ This will run svn status to figure out what files have changed since the
+ previous man page generation steps were done. After this step, we'll
+ commit all the modified files.
+
+ You may find additional files (marked with a ?) that should be added to
+ the svn repository and you'll need to do this by hand before going on to
+ the next step.
+
+ Note: based on a recent net-snmp-admin discussion, we're no longer going
+ to be adding the bazillions of man pages that doxygen generates by
+ default. Only important ones should be added.
+
+ Commands to execute:
+
+ svn -u status man
+
+STEP: 2.5: docs:manualaddnewman
+
+ Update man/Makefile.in with details of any new man pages, and run 'svn
+ add' on them.
+
+ I'll commit these changes for you after you're done.
+
+STEP: 2.6: docs:commit
+
+ Commands to execute:
+
+ svn commit -m "documentation update" man
+
+ (Leaving Step: 2)
+
+STEP: 3: Testing Steps
+
+ These steps will help you test the source code to ensure it passes some
+ simple "it works" tests.
+
+ ===== Entering Step: 3 =====
+
+STEP: 3.1: build:distclean
+
+ First we need to clean the existing build tree and start from scratch.
+
+ Commands to execute:
+
+ make distclean
+
+STEP: 3.2: build:configure
+
+ We need to run configure to set up the build tree.
+
+ Commands to execute:
+
+ ./configure --cache=config.cache --with-defaults
+ --with-mib-modules='host examples examples/example testhandler smux Rmon
+ disman/event-mib' --with-transports=IPX --enable-ipv6
+ --enable-embedded-perl --enable-shared
+
+STEP: 3.3: build:make
+
+ Then we need to build the code
+
+ Commands to execute:
+
+ make
+
+STEP: 3.4: build:test
+
+ Now we run "make test" which should produce a perfect set up test
+ results. If not, this needs to be fixed or at least understood and
+ accepted as is for some other reason.
+
+ Commands to execute:
+
+ make test TESTOPTS=-n
+
+STEP: 3.5: code:checkcomments
+
+ This command looks for source code oddities and policy violations.
+
+ Commands to execute:
+
+ make checks
+
+ (Leaving Step: 3)
+
+STEP: 4: Release File Steps
+
+ Certain files in the distribution and built on a per-release basis.
+ These steps will help set up these files.
+
+ ===== Entering Step: 4 =====
+
+STEP: 4.1: code:makedepend
+
+ This step creates Makefile dependencies using the "distdepend" rule in
+ the top level Makefile.
+
+ Commands to execute:
+
+ make distdepend
+
+STEP: 4.2: code:commitdepend
+
+ This step commits the dependency changes done in the previous step.
+
+ Commands to execute:
+
+ svn commit -m "make depend" `find . -name Makefile.depend`
+
+STEP: 4.3: changelog:svn2cl
+
+ We need to extract the portions of the change logs committed to the
+ repository.
+
+ Commands to execute:
+
+ svn2cl -f ChangeLog.add --break-before-msg --stop-on-copy
+
+ perl dist/changelogfix < ChangeLog.add > ChangeLog.reallyadd
+
+STEP: 4.4: changelog:manualedit
+
+ You need to manually insert the *relevent* portions of
+ 'ChangeLog.reallyadd' into the ChangeLog file. I'll commit these changes
+ for you after you finish cutting out the proper changes.
+
+STEP: 4.5: changelog:commit
+
+ Commands to execute:
+
+ svn commit -m "version update" ChangeLog
+
+STEP: 4.6: docs:newnews
+
+ Commands to execute:
+
+ perl dist/extractnews -s ----- -e ----- ChangeLog
+
+STEP: 4.7: docs:newnews
+
+ Commands to execute:
+
+ perl dist/extractnews -c CHANGES.new2 -n NEWS.new2 ChangeLog.reallyadd
+
+STEP: 4.8: docs:README
+
+ You need to manually insert the relevent portions of 'CHANGES.new' and
+ 'NEWS.new' into the CHANGES and NEWS file. (There are alternative
+ versions in 'CHANGES.new2' and 'NEWS.new2') You may wish to update the
+ README file as well. I'll commit these changes for you afterwards
+
+STEP: 4.9: docs:commit
+
+ Commands to execute:
+
+ svn commit -m "version update" README NEWS CHANGES
+
+STEP: 4.10: release:update
+
+ One more svn update and status to make sure nothing odd exists in your
+ source tree. Please check the results!
+
+ Commands to execute:
+
+ svn -u status
+
+ (Leaving Step: 4)
+
+STEP: 5: Make the Release
+
+ This is it! After this point it's much harder to turn back. If
+ everything is ok until this point and you're ready to actually stamp the
+ release in SVN and make release files, these steps will do that for you.
+
+ ===== Entering Step: 5 =====
+
+STEP: 5.1: release:tag
+
+ This will actually svn copy the current checked out branch to the new tag
+ name. Specifically:
+
+ svn copy {BRANCHPATH} .../tags/Ext-{VERSIONDASHES}
+
+ Commands to execute:
+
+ svn copy -m "{VERSION} release" {BRANCHPATH}
+ https://net-snmp.svn.sourceforge.net/svnroot/net-snmp/tags/Ext-{VERSIONDA
+ SHES}
+
+STEP: 5.2: release:makedist
+
+ Commands to execute:
+
+ svn export
+ https://net-snmp.svn.sourceforge.net/svnroot/net-snmp/tags/Ext-{VERSIONDA
+ SHES}/net-snmp net-snmp-{VERSION}
+
+STEP: 5.3: release:removefiles
+
+ Commands to execute:
+
+ net-snmp-{VERSION}/remove-files net-snmp-{VERSION}
+
+STEP: 5.4: release:makedist
+
+ Commands to execute:
+
+ star artype=ustar -c -z -f net-snmp-{VERSION}.tar.gz
+ net-snmp-{VERSION}
+
+STEP: 5.5: release:makezipclean
+
+ Commands to execute:
+
+ rm -f net-snmp-{VERSION}.zip
+
+STEP: 5.6: release:makezip
+
+ Commands to execute:
+
+ zip -r net-snmp-{VERSION}.zip net-snmp-{VERSION}
+
+STEP: 5.7: release:searching-gpg-keys
+
+ Commands to execute:
+
+ gpg --list-secret-keys net-snmp-admin
+
+STEP: 5.8: release:gpg
+
+ Commands to execute:
+
+ gpg -u 317F8F64 -a --detach-sign net-snmp-{VERSION}.tar.gz
+
+STEP: 5.9: release:gpg
+
+ Commands to execute:
+
+ gpg -u 317F8F64 -a --detach-sign net-snmp-{VERSION}.zip
+
+STEP: 5.10: Release File Test
+
+ We'll also re-build the source and retest a few things to ensure the
+ packaged file can actually be built.
+
+ ===== Entering Step: 5.10 =====
+
+STEP: 5.10.1: posttest:untar
+
+ Commands to execute:
+
+ rm -rf net-snmp-{VERSION}
+
+STEP: 5.10.2: posttest:untar
+
+ Commands to execute:
+
+ tar xzf net-snmp-{VERSION}.tar.gz
+
+STEP: 5.10.3: posttest:configure
+
+ Commands to execute:
+
+ cd net-snmp-{VERSION} && ./configure --cache=config.cache
+ --with-defaults --with-mib-modules='host examples examples/example
+ testhandler smux Rmon disman/event-mib' --with-transports=IPX
+ --enable-ipv6 --enable-embedded-perl --enable-shared
+
+STEP: 5.10.4: posttest:make
+
+ Commands to execute:
+
+ cd net-snmp-{VERSION} && make
+
+STEP: 5.10.5: posttest:test
+
+ Commands to execute:
+
+ cd net-snmp-{VERSION} && make test
+
+ (Leaving Step: 5.10)
+
+ (Leaving Step: 5)
+
+STEP: 6: Release the results
+
+ Now we'll publish the results to the SF server
+
+ ===== Entering Step: 6 =====
+
+STEP: 6.1: rsync the new files
+
+ This will copy the results to the SF uploads directory in your account on
+ frs.sourceforge.net
+
+ Commands to execute:
+
+ rsync -v net-snmp-{VERSION}.tar.gz net-snmp-{VERSION}.tar.gz.asc
+ net-snmp-{VERSION}.zip net-snmp-{VERSION}.zip.asc
+ frs.sourceforge.net:uploads/
+
+STEP: 6.2: Update the SF release web page
+
+ Commands to execute:
+
+ firefox
+ 'http://sourceforge.net/project/admin/editpackages.php?group_id=12694'
+
+ (Leaving Step: 6)
+
+STEP: 7:
+
+ Binaries: build rpms, .tar.gzs, etc.
+
+STEP: 8: Advertise it!
+
+ ===== Entering Step: 8 =====
+
+STEP: 8.1:
+
+ Add a note to the source forge news system:
+
+ http://sourceforge.net/news/submit.php?group_id=12694
+
+ Commands to execute:
+
+ firefox 'http://sourceforge.net/news/submit.php?group_id=12694'
+
+STEP: 8.2:
+
+ Send an announcement message to one of the following mailing lists based
+ on it's type:
+
+ pre: net-snmp-coders@lists.sourceforge.net
+
+ rc: net-snmp-users@lists.sourceforge.net
+
+ final: net-snmp-announce@lists.sourceforge.net
+
+STEP: 8.3:
+
+ Update the topic on the #Net-SNMP channel if this is a trunk based
+ release.
+
+STEP: 8.4:
+
+ Update the freshmeat listing (Wes needs to do this):
+
+ http://freshmeat.net/projects/net-snmp/
+
+ Commands to execute:
+
+ firefox http://freshmeat.net/projects/net-snmp/
+
+ (Leaving Step: 8)
+
+STEP: 9:
+
+ Advertise: NEWS upload to sf, publish on -announce, freshmeat, and the
+ GNU FSF directory (http://directory.fsf.org/project/net-snmp/)... (send
+ mail to bug-directory@gnu.org)
+
+
+
+
+
+====== BEGIN OBSOLETE (pre-makerelease) DOCUMENTATION ======
+
+***************************************************************************
+TESTING:
+
+ 1) Update the source tree to catch all recent commits,
+ and check that all local changes have been committed.
+
+ $ svn -u status
+ $ svn update
+
+ 2) Change the libtool version information in Makefile.top.
+ See MANUAL - STEP 1 later in these instructions.
+ 'makerelease' will commit this file automatically.
+
+ 3) Configure the suite with as many modules as possible,
+ build and test it. The makerelease script will use
+ the options:
+
+ $ ./configure '--with-mib-modules=host examples examples/example \
+ testhandler smux Rmon disman/event-mib' \
+ --with-transports=IPX --enable-ipv6 \
+ --enable-embedded-perl --enable-shared
+
+ Ideally this should be repeated on as many systems as possible
+ (including running "make install"). However the makerelease
+ script will only test things on the current box, and will not
+ try to install the software.
+
+
+***************************************************************************
+DOCUMENTATION:
+
+ 4) Update the version number in the doxygen.conf file
+ (handled automatically by 'makerelease') and generate
+ the doxygen extracted manual pages.
+
+ $ make docs
+ $ make mancp
+
+ 'makerelease' will commit this file automatically.
+ Note that any new man pages should be added to Makefile.in.
+ This is *NOT* currently handled by the makerelease script.
+
+ 5) Check the code for illegal constructs (e.g. C++ style comments
+ or GNU make specific constructs in Makefiles):
+
+ $ make checks
+
+ 6) Update Makefile dependencies:
+
+ $ make distdepend
+
+ 'makerelease' will commit these dependencies automatically.
+
+ 7) Update the ChangeLog file with details of all (recent) changes
+ to the suite. See MANUAL - STEP 2 later in these instructions.
+ 'makerelease' will commit this file automatically.
+
+ 8) Update the README, NEWS, and CHANGES files with details of
+ significant changes to the suite. See MANUAL - STEP 3 later
+ in these instructions.
+ 'makerelease' will commit these files automatically.
+
+
+***************************************************************************
+RELEASE:
+
+ 9) Make sure all changes are checked in:
+
+ $ svn -u status
+ $ svn update
+
+ [Note that this step is omitted when running "makerelease"]
+
+ 10) Change the version number in various files
+ (README, FAQ, configure.in, net-snmp.spec and assorted Perl modules).
+ 'makerelease' will update and commit these files automatically.
+
+ 11) Create a tag checkpoint for this release:
+
+ $ svn copy /trunk /tags/Ext-5-x
+ or
+ $ svn copy /branches/V5-x-patches /tags/Ext-5-x-y
+
+ 12) Construct the source packages:
+
+ $ svn export /tags/Ext-5-x-y/net-snmp net-snmp-5.x.y
+ $ net-snmp-5.x.y/remove-files net-snmp-5.x.y
+ $ star artype=ustar -c -z -f net-snmp-5.x.y.tar.gz net-snmp-5.x.y
+ $ rm -f net-snmp-5.x.y.zip"
+ $ zip -r net-snmp-5.x.y.zip net-snmp-5.x.y"
+
+
+ 13) Sign (or checksum) the packages:
+
+ Wes/Robert:
+ $ gpg -u net-snmp-admin -a --detach-sign net-snmp-5.x.y.tar.gz
+ $ gpg -u net-snmp-admin -a --detach-sign net-snmp-5.x.y.zip
+ Others:
+ $ md5sum net-snmp-5.x.y.tar.gz > net-snmp-5.x.y.tar.gz.md5
+ $ md5sum net-snmp-5.x.y.zip > net-snmp-5.x.y.zip.md5
+
+
+***************************************************************************
+RELEASE TESTING:
+
+ 14) Unpack a clean copy of the tarball, configure, build and
+ test the release tarball.
+
+ 15) Double-check that there are no outstanding changes that have
+ been missed from the CVS checkin:
+
+ $ svn status
+
+Note: This is the last stage that is handled by the "makerelease" script
+ Everything following will need to be done manually.
+
+ 15) Upload the packages (and signature files) to the SourceForge server:
+
+ $ ncftpput upload.sf.net incoming net-snmp-5.x.y.tar.gz
+ $ ncftpput upload.sf.net incoming net-snmp-5.x.y.zip
+ * SF pages: "Admin" -> "File Releases"
+ * net-snmp: "Add Release" (or "Edit Release")
+ * Create (or choose) an appropriate release name
+ e.g. "5.x.y source code" (or "5.x.y pre-releases")
+ * "Edit This Release"
+ * Select the tarball and/or other relevant files
+
+ 16) Announce the release on the appropriate list.
+ Pre-release announcements (and a call for testing) should be
+ sent to net-snmp-coders, release-candidates to net-snmp-users.
+
+ Full releases should be announced on net-snmp-users, and as a
+ news item on the project home page - including the NEWS snippet
+ of significant changes since the last release.
+
+ 17) Update the following htdocs files (in the main SVN trunk):
+ htdocs/download.html
+ htdocs/dev/schedule.html
+
+ [Make sure you have permissions set up properly on the web
+ server so that files created become group-writable!!!]
+
+ That concludes the process for pre-releases and release-candidates.
+ For full releases, wait a week to ensure that there are no major
+ problems, before continuing with the remaining steps.
+
+ If there are known problems and another release is planned to
+ fix them, don't announce the broken version - wait for the updated
+ one instead.
+
+ 18) Once this week has elapsed, submit an announement of the new
+ release to net-snmp-announce. This message will need to be
+ explicitly authorized via MailMan.
+
+ Also update the IRC topic to include mention of this release.
+
+ 19) For a release on the most recent development line, start bugging
+ Wes to update the freshmeat, Free Software Directory and
+ Wikipedia entries.
+
+ 20) For a release on the most recent development line, update the
+ 'htdocs/page-top.html' file (in the main SVN trunk) to reference
+ the latest version.
+
+ Update the following files with any changes:
+
+ htdocs/docs/readmefiles/NEWS
+ htdocs/docs/readmefiles/CHANGES
+ htdocs/docs/readmefiles/README*
+ htdocs/COPYING
+
+ [Make sure you have permissions set up properly on the web
+ server so that files created become group-writable!!!]
+
+
+ 21) For a major new-feature release (i.e. 5.x), create the patches
+ branch:
+
+ $ svn copy /tags/Ext-5-x /branches/V5-x-patches
+
+ and update the SVN main trunk with a new version number:
+
+ $ local/Version-Munge.pl -v 5.(x+1).dev -M -P -C
+
+ The 1 week delay (and continued code freeze) is to to ensure that
+ developer effort is concentrated on immediate problems following
+ the release. Any major problems should hopefully come to light
+ during this period, so after a week it should be safe to create
+ the patches branch and officially end the code freeze on MAIN.
+
+ 22) Update the official patches tracker set:
+
+ - any patches for this new release tarball should be given
+ priority 9
+ - all patches for the previous release on this line should
+ be marked at priority 5
+ - all patches for earlier releases on this line should
+ be marked at priority 1, and closed
+
+ If a line has been designated closed, then all official
+ patches for that line should be marked as closed as well.
+
+ 23) Hide the pre-release repository from the File Releases
+ admin pages.
+
+ 24) Clean up the 'dist' dir of the relevant V5-x-patches branch.
+ Only leave the following files:
+
+ changelogfix cvsshow cvsup extractnews makerelease
+ net-snmp.spec snmpd-init.d snmptrapd-init.d
+
+ Note that any files removed should also be deleted from
+ SVN repository.
+
+
+***************************************************************************
+CREATING BINARY DISTRIBUTIONS
+
+ 0) Always REMOVE ALL PREVIOUS INSTALLS FIRST, then do a make install
+ from the tar-ball extracted sources and *THEN* rebuild all
+ binaries again. This ensures that everything (especially perl
+ modules) are properly linked against the right libraries.
+
+ 1) always build releases from a tarball, not from SVN.
+
+ 2) Add mib modules that are common. Basically, add:
+
+ host -- where supported.
+ disman/event-mib
+ smux
+
+ 3) use --with-defaults --with-syscontact="Unknown"
+ --with-syslocation="Unknown"
+
+ 4) when running make install, do it like:
+
+ $ make install prefix=/some/path/to/home/ARCH/usr/local \
+ exec_prefix=/some/path/to/home/ARCH/usr/local
+
+ 5) Tar it up:
+
+ $ cd /some/path/to/home/ARCH
+ $ tar czf net-snmp-5.0.3-ARCH.tar.gz usr/local
+
+ 6) upload and release, like you did for the source code but with a
+ different package name for binaries (5.0.3 binaries).
+
+ 7) RPMs [do this in main line even if its for a patch branch]:
+ $ cd dist
+ $ cp ../net-snmp-5.0.8.tar.gz rpm/SOURCES
+ $ make RELEASE=1
+
+ This should put multiple binary rpm files in:
+ dist/rpm/RPMS/i386/
+ And one source RPM in:
+ dist/rpm/SRPMS/
+
+ *** These files need to be renamed to include the OS version.
+
+ EG: ...i386.rpm needs to become ...fc5.i386.rpm
+
+ 8) Remove (or hide) binaries from older releases of the same line,
+ where you have submitted a newer binary for the same architecture.
+ Once the last binary for a particular release version has been
+ removed, hide that repository.
+
+
+***************************************************************************
+***************************************************************************
+MANUAL - STEP 1
+
+ Changing the libtool version information in Makefile.top.
+
+ - If any interfaces/structures have been removed or changed since the
+ last update, increment current (+5), and set age and revision to 0.
+ Stop!
+
+ - If any interfaces have been added since the last public release,
+ then increment current and age, and set revision to 0.
+ Stop!
+
+ - If the source code has changed at all since the last update,
+ then increment revision (c:r:a becomes c:r+1:a).
+
+ Note: maintenance releases (eg 5.2.x) should never have changes
+ that would require current to be incremented.
+
+ The check-api-changes script in the dist directory will construct a
+ diff of all headers, which can be useful for determining if anything
+ needs bumping.
+
+ Update these variables now, so that when you run
+ make in a second to test things you can spot libtool yelling
+ about improper numbering before you make the release and not
+ after you've uploaded the tar ball :-/
+
+
+***************************************************************************
+MANUAL - STEP 2
+
+ Changing the libtool version information in Makefile.top.
+ Updating the ChangeLog file
+
+ - The ChangeLog entries are extracted (normally automatically)
+ using the command:
+
+ $ svn2cl -f ChangeLog.add --break-before-msg --stop-on-copy
+
+ If you don't have svn2cl installed, you can try and find a
+ suitable binary package for your architecture, or you can
+ get it directly from
+ http://ch.tudelft.nl/~arthur/svn2cl
+ You may need to rename the script from 'svn2cl.sh' to 'svn2cl'
+
+ - In either case, they are fixed up (automatically) using:
+
+ $ perl dist/changelogfix < ChangeLog.add > ChangeLog.reallyadd
+ or
+ $ perl dist/changelogfix V5-{N}-patches < ChangeLog.add > ChangeLog.reallyadd
+
+ - The manual processing step is to insert the appropriate portion
+ of the file 'ChangeLog.reallyadd' into 'ChangeLog'. You can
+ usually find the point where the previous release started in
+ the file by searching for "version tag".
+
+ - Please keep the line of dashes at the top of the file, as this
+ makes it easier to copy during the next release.
+
+ - If using emacs, switch from changelog-mode to text-mode.
+
+ - Check in the new ChangeLog:
+
+ $ svn commit -m "update for release X" ChangeLog
+
+ This is done automatically by "makerelease"
+
+
+***************************************************************************
+MANUAL - STEP 3
+
+Updating README, NEWS, and CHANGES files
+
+ [ This information has been moved to:
+
+ http://www.net-snmp.org/wiki/index.php/Commit_message_auto-extraction_formats
+
+ ]
+
+However, leaving some examples here for quick referral:
+
+ SVN commit messages that generate auto-NEWS and auto-CHANGES
+ extractions should be formatted like the following examples:
+
+ NEWS: snmpd: I did something really cool to the agent
+ CHANGES: snmptrapd: fixed something minor in snmptrapd
+ NEWS: perl: PATCH: 123,456: Applied patches 123 and 456 to support perl6
+ CHANGES: BUG: 13: Fixed bug 13 & secured the world at large against hackers
+ NEWS: perl: PATCH: 123: from Robert: did something
+ NEWS: perl: PATCH: 123: from "Robert Story": did something else
diff --git a/dist/autoconf-version b/dist/autoconf-version
new file mode 100644
index 0000000..264f2ce
--- /dev/null
+++ b/dist/autoconf-version
@@ -0,0 +1 @@
+2.68
diff --git a/dist/changelogfix b/dist/changelogfix
new file mode 100755
index 0000000..92ac93f
--- /dev/null
+++ b/dist/changelogfix
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+#
+# Tidies up the output of svn2cl to clean it up a touch.
+# It is fancier than before, but probably no better written.
+# (though there are noticably more comments!)
+
+
+my $inFileList = 0;
+my $stuff = "";
+my $prefix = "trunk/net-snmp/";
+
+if ( $ARGV[0] =~ /^V/ ) {
+ $b = shift @ARGV;
+ $prefix = "branches/$b/net-snmp/";
+}
+
+$line1 = <>;
+if ( $line1 !~ /^svn/ ) { print $line1; }
+while (<>) {
+ s/^\t/ /;
+ #
+ # Note when we're just starting to look at
+ # the list of files....
+ #
+ if (/^ *\*/) {
+ $_ =~ s/^ *\* //;
+ $inFileList = 1;
+ $stuff = "";
+ }
+ if ( $inFileList ) {
+ #
+ # ... and filter out just those from the branch
+ # that we're working with.
+ #
+ if (/$prefix/) {
+ #
+ # XXX: This code implicitly assumes that each entry
+ # appears on a separate line. Which is *probably*
+ # true given the folding done by svn2cl.
+ # But short paths (e.g. top-level files) may
+ # break this assumption, as would extending the
+ # folding point for svn2cl
+ # ToDo: Strip the prefix (or skip the entry) for
+ # each token individually, rather than per-line.
+ #
+ $z = $_;
+ $z =~ s/[ \t]*$prefix/ /;
+ $stuff .= $z;
+ } else {
+ $stuff .= " ".$_;
+ }
+ if ( /:/ ) {
+ #
+ # At the end of this list, we need to reformat it
+ # so that the lines aren't too long or too short
+ #
+ # Flatten things into a single line,
+ # and make sure it ends in a colon
+ $stuff =~ s/\n//g;
+ if ( $stuff =~ /,$/) { $stuff =~ s/,$/:/; }
+
+ #
+ # If the line is too long, then start re-folding it
+ #
+ if ( $stuff =~ /.{70}/ ) {
+ @z = split /\s/, $stuff;
+ $line = "*";
+ while ($#z >= 0) {
+ $z = shift @z;
+ if ( "$line $z" =~ /.{70}/ ) {
+ print " $line\n";
+ $line = " $z";
+ } else {
+ $line .= " $z";
+ }
+ }
+ print " $line\n\n";
+ } else {
+ #
+ # Otherwise, print the list as it stands
+ #
+ print " *$stuff\n\n";
+ }
+ $stuff = "";
+ $inFileList = 0;
+ }
+ } else {
+
+ #
+ # If we're not processing the list of files,
+ # then just pass things through.
+ print $_;
+ }
+}
diff --git a/dist/check-api-change b/dist/check-api-change
new file mode 100755
index 0000000..1f61e42
--- /dev/null
+++ b/dist/check-api-change
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# simplistic script to check all header files for
+# differences. Intended to help detect api changes
+# between releases.
+#
+# it's not pretty or efficient, and inspection of
+# the results must be done manually.
+#
+# it's also not secure (don't run as root)
+# or portable. Tested on Linux.
+#
+
+if [ "x$1" = "x" -o "x$2" = "x" ]; then
+ echo "Usage: $0 <old-dir> <new-dir>"
+ exit 1
+fi
+
+od=$1
+nd=$2
+DIR=/tmp
+OUTPUT=$DIR/api-diff.pat
+ODT=$DIR/api-od
+
+if [ ! -d $od ]; then
+ echo "old dir $od doesn't exist"
+ exit 1
+fi
+
+if [ ! -d $nd ]; then
+ echo "old dir $nd doesn't exist"
+ exit 1
+fi
+
+# find header in nd
+rm -f $OUTPUT $ODT 2>/dev/null
+(cd $od && find . -type f -name "*.h"|sort > $ODT)
+
+OH=`cat $ODT`
+for h in $OH
+do
+ nh=$nd/$h
+ oh=$od/$h
+ echo "* $nh"
+ if [ -f "$nh" ]; then
+ echo "* diff: $h vs $nh" >> $OUTPUT
+ diff -u $oh $nh >> $OUTPUT 2>&1
+ else
+ echo "* Old header $h not found in new headers" >> $OUTPUT
+ fi
+done
+
+echo "Inspect output in $OUTPUT"
+echo "See Makefile.top for libtool version bumping rules."
diff --git a/dist/cvsshow b/dist/cvsshow
new file mode 100755
index 0000000..7539595
--- /dev/null
+++ b/dist/cvsshow
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+export CVS_RSH=ssh
+TAG=
+
+do_cvs()
+{
+ DIR=$1
+ if [ ! -f $DIR/CVS/Repository ]; then
+ echo "'$DIR' has no CVS/Repository!"
+ exit
+ fi
+
+ if [ ! -f $DIR/CVS/Root ]; then
+ echo "'$DIR' has no CVS/Root!"
+ exit
+ fi
+
+ if [ -f $DIR/CVS/Tag ]; then
+ TAG="-r `cat $DIR/CVS/Tag | cut -c 2-`"
+ fi
+
+ REP="`cat $DIR/CVS/Repository`"
+ ROOT="`cat $DIR/CVS/Root`"
+
+ echo "Directory $DIR is rooted at $ROOT, $TAG $REP..."
+ echo " update with cvs -z3 -d $ROOT -q co $TAG -d $DIR $REP"
+}
+
+do_svn()
+{
+ DIR=$1
+ if [ ! -d $DIR/.svn ]; then
+ echo "'$DIR' has no .svn/ subdir!"
+ exit
+ fi
+
+ ROOT=`svn info | grep URL|cut -f2 -d " "`
+ if [ -z "$ROOT" ]; then
+ echo "Couldn't find root from $DIR/.svn/entries"
+ exit 1
+ fi
+
+ echo "Directory $DIR is rooted at $ROOT..."
+ echo " update with svn co $ROOT $DIR"
+}
+
+if [ $# -eq 0 ]; then
+ DIRS=.
+else
+ DIRS=$@
+fi
+
+for d in $DIRS
+do
+ if [ ! -d $d ]; then
+ echo "no such directory '$d'"
+ exit
+ fi
+
+ if [ -d $d/CVS ]; then
+ do_cvs $d
+ elif [ -d $d/.svn ]; then
+ do_svn $d
+ else
+ echo "'$d' has neither CVS nor SVN information!"
+ fi
+done
+
diff --git a/dist/cvsup b/dist/cvsup
new file mode 100755
index 0000000..ca07b0f
--- /dev/null
+++ b/dist/cvsup
@@ -0,0 +1,118 @@
+#!/bin/sh
+#
+# $Id$
+#
+CVS_RSH=ssh; export CVS_RSH
+TAG=
+WO=0
+DEST=
+
+if [ "x$1" = "x-u" ]; then
+ DEST=$2
+ shift 2
+
+ # gnu tar (as of 1.15.1) is unable to create portable tar archives,
+ # especially if long file names (>100 char) are present.
+ # star is a better replacement.
+ if [ -x /usr/bin/star ]; then
+ TAR='/usr/bin/star -Hustar -not -pat="*/CVS/*" -c -f'
+ elif [ -x /bin/tar ]; then
+ TAR="/bin/tar --exclude=CVS -c -f"
+ echo "warning: star not available, using (less portable) tar..."
+ else
+ echo "neither /usr/bin/star nor /bin/tar found."
+ exit
+ fi
+fi
+
+if [ $# -eq 0 ]; then
+ DIR=$PWD
+else
+ if [ $# -ne 1 ]; then
+ echo "usage: $0 <working directory>"
+ exit
+ fi
+ DIR=$1
+fi
+
+if [ -z ${DIR##*/} ];then
+ DIR=${DIR%/*}
+fi
+SUBD=${DIR##*/}
+PARENT=${DIR%*$SUBD}
+#echo "$DIR = $PARENT + $SUBD"
+
+if [ ! -d $DIR ]; then
+ echo "no such directory '$DIR'"
+ exit
+fi
+
+if [ ! -d $DIR/CVS ]; then
+ echo "'$DIR' has no CVS directory!"
+ exit
+fi
+
+if [ ! -f $DIR/CVS/Repository ]; then
+ echo "'$DIR' has no CVS/Repository!"
+ exit
+fi
+
+if [ ! -f $DIR/CVS/Root ]; then
+ echo "'$DIR' has no CVS/Root!"
+ exit
+fi
+
+if [ -f $DIR/CVS/Tag ]; then
+ TAG=`cat $DIR/CVS/Tag | cut -c 2-`
+ CMDTAG="-r $TAG"
+fi
+
+REP="`cat $DIR/CVS/Repository`"
+ROOT="`cat $DIR/CVS/Root`"
+
+cd $DIR
+#echo $PWD
+# COMMAND="cvs -q -z3 -d $ROOT co $TAG -d $DIR $REP"
+
+COMMAND="cvs -q -z3 -d $ROOT update -P -d $CMDTAG"
+
+if [ ! -w $DIR/CVS ]; then
+ if [ -O $DIR/CVS ]; then
+ WO=1
+ echo "Making $DIR writable"
+ chmod -R u+w $DIR
+ fi
+fi
+
+echo "Updating directory $DIR with $TAG $REP..."
+echo "$COMMAND"
+
+$COMMAND
+rc=$?
+if [ $rc -ne 0 ]; then
+ echo "cvs command returned $?"
+fi
+
+if [ $WO -eq 1 ]; then
+ echo "Making $DIR read-only"
+ chmod -R a-w $DIR
+fi
+
+if [ ! -z $DEST ]; then
+ if [ -z $TAG ]; then
+ TAG=MAIN
+ fi
+
+ if [ $rc -ne 0 ]; then
+ echo "skipping upload"
+ else
+ cd ..
+# echo $PWD
+ DATE=`date +%Y%m%d_%H%M`
+ SOURCE=$REP-cvs-$TAG"_$DATE"
+ $TAR /tmp/$SOURCE.tar $SUBD
+ gzip -f --best /tmp/$SOURCE.tar
+ scp /tmp/$SOURCE.tar.gz $DEST
+ rm -f /tmp/$SOURCE.tar.gz
+ fi
+fi
diff --git a/dist/extractnews b/dist/extractnews
new file mode 100755
index 0000000..bce94c9
--- /dev/null
+++ b/dist/extractnews
@@ -0,0 +1,183 @@
+#!/usr/bin/perl
+
+use strict;
+use Text::Wrap;
+my %output;
+my $text;
+my %stash;
+
+use Getopt::Long;
+
+my %opts = (
+ c => 'CHANGES.new',
+ n => 'NEWS.new',
+ );
+
+LocalGetOptions(\%opts,
+ ['s|start-regexp=s','A regexp to look for in files to start converting at'],
+ ['e|end-regexp=s','A regexp to look for in files to end converting at'],
+ "",
+ ['c|changes-file=s','A file to save CHANGES entries to'],
+ ['n|news-file=s','A file to save NEWS entries to'],
+ ['d|debug-line=s', 'Debugging output for lines matching STRING'],
+ "",
+ ['GUI:otherargs_text','Input files to parse'],
+ );
+
+my $maybecontinue = 0;
+my $lasttext = "";
+my $lastfile;
+my $lastcomponent;
+
+foreach my $argv (@ARGV) {
+ open(I, $argv);
+ if ($opts{'s'}) {
+ while (<I>) {
+ last if (/$opts{'s'}/o);
+ }
+ }
+
+ while (<I>) {
+ my ($file, $component, $patbug, $nums, $text);
+
+ last if ($opts{'e'} && /$opts{e}/o);
+
+ print STDERR "here: $_" if ($opts{'d'} && /$opts{'d'}/o);
+
+ # don't use this:
+ # FILE: BUGS: 123,456: text
+ ($file, $patbug, $nums, $text) =
+ /(NEWS|CHANGES):\s*-*\s*\[*(BUG|PATCH)(?:ES|S|):*\s*([\d,\s*]*)\]*:*\s*-*\s*(.*)/;
+
+ print STDERR " 1:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o);
+
+ # or this:
+ # FILE: component - text
+ ($file, $component, $text) =
+ /(NEWS|CHANGES):\s*(\w+)\s*-+\s*(.*)/ if (!$file);
+
+ print STDERR " 2:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o);
+
+ # what you should use:
+ # FILE: component: BUGS: 123,456: text
+ #
+ # or
+ # FILE: component: PATCH: 123,456: from someone text
+ # FILE: component: PATCH: 123,456: from "someone long" text
+ ($file, $component, $patbug, $nums, $text) =
+ /(NEWS|CHANGES):\s*([^:]+):\s*-*\s*\[*(BUG|PATCH)(?:ES|S):*\s*([\d,\s*]*)\]*:*\s*-*\s*(?:from ["'][^"]+["']|from \w+|):*\s*(.*)/ if (!$file);
+
+ print STDERR " 3:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o);
+
+ # or at least:
+ # FILE: component: text
+ ($file, $component, $text) =
+ /(NEWS|CHANGES):\s*([^:]+):\s*-*\s*(.*)/ if (!$file);
+
+ print STDERR " 4:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o);
+
+ # component left out
+ # FILE: [BUGS: 123,456]: text
+ ($file, $patbug, $nums, $text) =
+ /(NEWS|CHANGES):\s*\[*(BUG|PATCH)*(?:ES|S|):*\s*([\d,\s*]*)\]*:*\s*-*\s*(.*)/ if (!$file);
+
+ print STDERR " 5:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o);
+
+ if ($opts{'d'} && /$opts{'d'}/o) {
+ my $bogus = 1; # breakable point
+ }
+
+ if (!$file && $maybecontinue) {
+ if (/^\s*(.+)$/) {
+ $text = $1;
+ $file = $lastfile;
+ $component = $lastcomponent;
+
+ # we're going to re-add these
+ pop @{$output{$opts{'c'}}{$component}};
+ pop @{$output{$opts{'n'}}{$component}} if ($file eq 'NEWS');
+ } else {
+ $maybecontinue = 0;
+ $lasttext = "";
+ next;
+ }
+ } elsif (!$file) {
+ next;
+ }
+
+ next if (exists($stash{$text}));
+ $stash{$text} = 1;
+
+ $component = "unspecified" if (!$component);
+ if ($patbug) {
+ $lasttext .= " [$patbug $nums]: $text";
+ } else {
+ $lasttext .= " $text";
+ }
+ $lasttext =~ s/^ //; # get rid of leading spaces
+ $lasttext =~ s/^([a-z])/uc($1)/e; # capitalize the first letter
+ $text = wrap(" - "," ","$lasttext") . "\n";
+
+ #
+ # Assist with displaying categories in a sensible order
+ # snmplib first
+ # snmpd/snmp{apps}
+ # various other
+ # O/S specific (relies on upper case)
+ #
+ $component =~ s/^snmplib/00snmplib/;
+ $component =~ s/^snmp/0snmp/;
+ $component =~ s/^agent/0snmpd/; # Merge "agent" into "snmpd"
+ $component =~ s/^([A-Z])/zz\1/;
+ print STDERR " t:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o);
+ push @{$output{$opts{'c'}}{$component}}, $text;
+ push @{$output{$opts{'n'}}{$component}}, $text if ($file eq 'NEWS');
+ $lastfile = $file;
+ $lastcomponent = $component;
+ $maybecontinue = 1;
+ }
+}
+
+
+
+# save the news and changes to appropriate files
+foreach my $f ($opts{'c'}, $opts{'n'}) {
+ my $cat2;
+ open(O,">$f");
+ foreach my $cat (sort (keys(%{$output{$f}}))) {
+ ($cat2 = $cat) =~ s/^00?|^zz//;
+ print O " $cat2:\n";
+ print O sort @{$output{$f}{$cat}};
+ print O "\n";
+ }
+ close(O);
+}
+
+#######################################################################
+# getopt long gui portability code
+#
+sub LocalGetOptions {
+ if (eval {require Getopt::GUI::Long;}) {
+ import Getopt::GUI::Long;
+ Getopt::GUI::Long::Configure(qw(display_help no_ignore_case));
+ return GetOptions(@_);
+ } else {
+ require Getopt::Long;
+ Getopt::Long::Configure(qw(auto_help no_ignore_case));
+ import Getopt::Long;
+ }
+ GetOptions(LocalOptionsMap(@_));
+}
+
+sub LocalOptionsMap {
+ my ($st, $cb, @opts) = ((ref($_[0]) eq 'HASH')
+ ? (1, 1, $_[0]) : (0, 2));
+ for (my $i = $st; $i <= $#_; $i += $cb) {
+ if ($_[$i]) {
+ next if (ref($_[$i]) eq 'ARRAY' && $_[$i][0] =~ /^GUI:/);
+ push @opts, ((ref($_[$i]) eq 'ARRAY') ? $_[$i][0] : $_[$i]);
+ push @opts, $_[$i+1] if ($cb == 2);
+ }
+ }
+ return @opts;
+}
diff --git a/dist/find-requires b/dist/find-requires
new file mode 100755
index 0000000..4309fcc
--- /dev/null
+++ b/dist/find-requires
@@ -0,0 +1,5 @@
+#!/bin/sh
+# This is rpmbuild helper script used to filter out perl(Tk) and
+# perl(Term::ReadKey) dependencies.
+
+/usr/lib/rpm/find-requires | grep -v "perl(Tk)\|perl(Term::ReadKey)"
diff --git a/dist/generation-scripts/gen-security-headers.in b/dist/generation-scripts/gen-security-headers.in
new file mode 100644
index 0000000..4e5881a
--- /dev/null
+++ b/dist/generation-scripts/gen-security-headers.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# we should be able to do this without creating a full configure-like
+# script, but we need to figure out how to call m4 directly.
+AC_INIT([Net-SNMP], [5.6.pre2], [net-snmp-coders@lists.sourceforge.net])
+
+AC_ARG_WITH(security-modules,
+[ --with-security-modules="s1 s2 ..." Compile in the given SNMP security
+ modules (space or comma separated list).])
+AC_ARG_WITH(output-header,
+[ --with-output-header="file" Where to store the header file])
+AC_ARG_WITH(output-init,
+[ --with-output-init="file" Where to store the init file])
+
+m4_include(dist/generation-scripts/gen-variables)
+
+AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_INCLUDE_FILE, "$NETSNMP_SYSTEM_INCLUDE_FILE")
+
+if test "x$with_output_header" != "x" ; then
+ security_incl_file="$with_output_header"
+fi
+
+if test "x$with_output_init" != "x" ; then
+ security_init_file="$with_output_init"
+fi
+
+m4_include(configure.d/config_modules_security_modules)
+
+
diff --git a/dist/generation-scripts/gen-transport-headers.in b/dist/generation-scripts/gen-transport-headers.in
new file mode 100644
index 0000000..71a7bd9
--- /dev/null
+++ b/dist/generation-scripts/gen-transport-headers.in
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# we should be able to do this without creating a full configure-like
+# script, but we need to figure out how to call m4 directly.
+AC_INIT([Net-SNMP], [5.6.pre2], [net-snmp-coders@lists.sourceforge.net])
+
+AC_ARG_WITH(transports,
+[ --with-transports="t1 t2 ..." Compile in the given SNMP transport
+ modules (space or comma separated list).])
+AC_ARG_WITH(out_transports,
+[ --with-out-transports="t1 ..." Exclude listed SNMP transports
+ (space or comma separated list).])
+
+AC_ARG_WITH(output,
+[ --with-output="file" Where to store the header file])
+
+m4_include(dist/generation-scripts/gen-variables)
+
+AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_INCLUDE_FILE, "$NETSNMP_SYSTEM_INCLUDE_FILE")
+
+if test "x$with_output" != "x" ; then
+ ctor_header=$with_output
+fi
+
+m4_include(configure.d/config_modules_transports)
+
+
diff --git a/dist/generation-scripts/gen-variables.in b/dist/generation-scripts/gen-variables.in
new file mode 100644
index 0000000..4329206
--- /dev/null
+++ b/dist/generation-scripts/gen-variables.in
@@ -0,0 +1,10 @@
+#
+# common variables used by configure scripts
+#
+SED="@SED@"
+CPP="@CPP@"
+GREP="@GREP@"
+PARTIALTARGETFLAGS="@PARTIALTARGETFLAGS@"
+NETSNMP_SYSTEM_INCLUDE_FILE="@ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE@"
+
+srcdir=@srcdir@
diff --git a/dist/makerelease.xml b/dist/makerelease.xml
new file mode 100644
index 0000000..b02e626
--- /dev/null
+++ b/dist/makerelease.xml
@@ -0,0 +1,726 @@
+<!-- this is a makerelease script: http://github.com/hardaker/makerelease -->
+<makerelease>
+ <!-- TODO:
+ - make mancp below happens before configure is run, which
+ doesn't work if it's a complete work.
+ - configure options should be prompted into a variable and used
+ -->
+ <steps>
+ <step type="section" title="Setup Steps" mandatory="1">
+ <text>
+ This set of steps will do some preliminary "safety" checks to
+ ensure the local environment is ok and setup some important
+ information.
+ </text>
+ <steps>
+ <step type="system" title="Old Code">
+ <text>
+ This checks for old tarballs (and particularly unpacked
+ distributions) which might confuse the later processing.
+ If this step finds outstanding files you need to remove
+ them before continuing!
+ </text>
+ <commands>
+ <command expectfailure="1">find . -name 'net-snmp-5*' | egrep '^[^\?]'</command>
+ </commands>
+ </step>
+ <step type="system" title="Setup Check">
+ <text>
+ This should show the last version number published in this
+ branch by looking at the time line in the README file:
+ </text>
+ <commands>
+ <command>head -1 README</command>
+ </commands>
+ </step>
+ <step type="prompt" prompt="Enter the new version number:"
+ title="Pick a Version Number"
+ parameter="VERSION">
+ <text>
+ Please enter the version number to publish. Net-SNMP
+ convention dictates that this be a version number like 5.4 or
+ 5.4.1. Pre-releases that occur before a branch freezes should
+ be appended with ".preN" like 5.4.1.pre2. Release-candidates
+ should be labeled ".rcN" like 5.4.1.rc1.
+ </text>
+ </step>
+ <step type="prompt" prompt="Enter the last version number:"
+ title="Enter the last version number"
+ parameter="LASTVERSION">
+ <text>
+ Please enter the last version number that the changelog should be
+ generated from. This should be easy for a new release on a branch,
+ but may be more tricky for a main release.
+ </text>
+ </step>
+ <step type="perl" title="Defining a second internal version string"
+ mandatory="1">
+ <perl>
+ <code>
+ # version number with dashes instead of dots
+ $self->{'parameters'}{'VERSIONTAGNAME'} =
+ "v" . $self->{'parameters'}{'VERSION'};
+
+ $self->{'parameters'}{'LASTVERSIONTAGNAME'} =
+ "v" . $self->{'parameters'}{'LASTVERSION'};
+
+ # target version number (without preN/rcN)
+ $self->{'parameters'}{'VERSIONTARGET'} =
+ $self->{'parameters'}{'VERSION'};
+ if ( $self->{'parameters'}{'VERSIONTARGET'} =~ /\.pre.*/ ) {
+ $self->{'parameters'}{'VERSIONTARGET'} =~ s/\.pre.*//;
+ $self->{'parameters'}{'RELEASETYPE'} = "pre";
+ } elsif ( $self->{'parameters'}{'VERSIONTARGET'} =~ /\.rc.*/ ) {
+ $self->{'parameters'}{'VERSIONTARGET'} =~ s/\.rc.*//;
+ $self->{'parameters'}{'RELEASETYPE'} = "rc";
+ } else {
+ $self->{'parameters'}{'RELEASETYPE'} = "full";
+ }
+
+ # version in floating point form for perl modules
+ my ($major, $minor, $patch, $opps) =
+ ($self->{'parameters'}{'VERSION'} =~
+ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ $self->{'parameters'}{'VERSIONFLOAT'} =
+ $major + $minor/100 + $patch/10000 + $opps/100000;
+
+ # find out the git branch we're on.
+ open(GITINFO,"git branch|");
+ while(&lt;GITINFO&gt;) {
+ if (/^\*\s+(.*)/) {
+ $self->{'parameters'}{'BRANCHPATH'} = $1;
+ my ($nextBranch);
+ $nextBranch = &lt;GITINFO&gt;;
+ $nextBranch =~ s/^\s+//;
+ $self->{'parameters'}{'NEXTBRANCH'} = $nextBranch;
+ last;
+ }
+ }
+ close(GITINFO);
+
+ return 0;
+ </code>
+ </perl>
+ </step>
+ <step type="Informational" title="Release Parameter Information" pause="1">
+ <text>
+ Here is the configured information we'll be using:
+
+ VERSION: {VERSION}
+
+ VERSION tag name: {VERSIONTAGNAME}
+
+ Floating point VERSION: {VERSIONFLOAT}
+
+ Git Branch Name: {BRANCHPATH}
+ </text>
+ </step>
+ <step type="system" stepname="update" title="update">
+ <text>We need to make sure your code is up to date and
+ matches the latest sources in this branch.</text>
+ <commands>
+ <command>git pull</command>
+ </commands>
+ </step>
+ <step type="system" stepname="update" title="Check for changes">
+ <text>This steps looks for outstanding files that have been
+ modified. There should be no outstanding modifications! If
+ this step finds outstanding modified files you need to check
+ them in or revert them before continuing!</text>
+ <commands>
+ <command expectfailure="1">git status --porcelain | egrep '^[^\?]'</command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+ <step type="section" title="Source Code Setup">
+ <text>
+ This set of steps will modify various places within the source
+ code tree to bring it up to date with the new version number
+ about to be published.
+ </text>
+ <steps>
+ <step type="section" title="Libtool / Library versioning setup">
+ <text>
+ These steps will modify the various files in the source tree
+ that contain the version number, show you the changes that
+ will be made and then check in the resulting changes if you
+ approve of them.
+ </text>
+ <steps>
+ <step type="informational" pause="true"
+ skipunless="'{RELEASETYPE}' eq 'pre'"
+ stepname="version:manualedit" title="version:libtoolmanualedit">
+ <text>
+ You may need to edit Makefile.top to update the library
+ version numbering - see the comments there about LIBCURRENT,
+ LIBAGE and LIBREVISION for details. This is usually only
+ needed for the first pre-release of a given version.
+
+ This script will commit the file for you after you're done.
+ </text>
+ </step>
+ <step prompt="true" type="system" stepname="version:libtoolcommit"
+ title="version:commit">
+ <text>We'll now commit the Makefile.top file if you've
+ modified it.</text>
+ <commands>
+ <command ignoreerror="1">git commit -m "version update for {VERSION}" Makefile.top</command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+ <step type="section" title="Change The Version Number">
+ <text>
+ These steps will modify the various files in the source tree
+ that contain the version number, show you the changes that
+ will be made and then check in the resulting changes if you
+ approve of them.
+ </text>
+ <steps>
+ <step type="modify" title="Modify the source files"
+ stepname="release:versionstamp">
+ <text>
+ We will now modify files through the code to replace the
+ version number with the newer one.
+ </text>
+ <modifications>
+ <modify
+ find="VERSION = '(.*)'"
+ replace="VERSION = \'{VERSIONFLOAT}\'">
+ <files>
+ <file>perl/SNMP/SNMP.pm</file>
+ <file>perl/agent/agent.pm</file>
+ <file>perl/agent/Support/Support.pm*</file>
+ <file>perl/agent/default_store/default_store.pm</file>
+ <file>perl/default_store/default_store.pm</file>
+ <file>perl/OID/OID.pm</file>
+ <file>perl/ASN/ASN.pm</file>
+ <file>perl/AnyData_SNMP/Storage.pm</file>
+ <file>perl/AnyData_SNMP/Format.pm</file>
+ <file>perl/TrapReceiver/TrapReceiver.pm</file>
+ </files>
+ </modify>
+ <!-- this will fail (ok) against future versions with
+ configure generated PACKAGE_VERSION usage -->
+ <modify
+ find="NetSnmpVersionInfo = &quot;[\d\.]+&quot;"
+ replace="NetSnmpVersionInfo = &quot;{VERSION}&quot;">
+ <files>
+ <file>snmplib/snmp_version.c</file>
+ </files>
+ </modify>
+ <modify
+ find="Version: [\.0-9a-zA-Z]+"
+ replace="Version: {VERSION}">
+ <files>
+ <file>README</file>
+ <file>FAQ</file>
+ <file>dist/net-snmp.spec</file>
+ </files>
+ </modify>
+ <modify
+ find="VERSION = [\.0-9a-zA-Z]+"
+ replace="VERSION = {VERSION}">
+ <files>
+ <file>dist/Makefile*</file>
+ </files>
+ </modify>
+ <modify
+ find="AC_INIT\(\[Net-SNMP\], \[([^\]]+)\]"
+ replace="AC_INIT([Net-SNMP], [{VERSION}]">
+ <files>
+ <file>configure.in*</file>
+ <file>configure.ac*</file>
+ </files>
+ </modify>
+ <modify
+ find="NetSnmpVersionInfo = &quot;[^&quot;]+&quot;"
+ replace="NetSnmpVersionInfo = &quot;{VERSION}&quot;">
+ <files>
+ <file>snmplib/snmp_version.c</file>
+ </files>
+ </modify>
+ </modifications>
+ </step>
+ <step type="system" stepname="release:versionautoconf"
+ title="Running autoconf to rebuild configure">
+ <text>We modified configure.in, so we now need to run
+ autoconf to rebuild configure.</text>
+ <commands>
+ <command>rm -f configure</command>
+ <command>dist/run-autoconf</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:versiondiff"
+ title="Running svn diff to check changes">
+
+ <text>Check the following changes for proper version number
+ differences before we commit the chances.</text>
+ <commands>
+ <command>git diff</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:versioncommit" pause="true"
+ title="Running git commit to commit the changes">
+
+ <text>Check the changes in the above diff and then we'll
+ commit the results here if they look ok.</text>
+ <commands>
+ <command>git commit -a -m "Version number update: {VERSION}"</command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+ <step type="section" title="Handle dist/release">
+ <steps>
+ <step type="system" skipunless="'{RELEASETYPE}' eq 'rc'">
+ <text>Note in 'dist/release' that this branch is in release candidate mode
+ </text>
+ <commands>
+ <command>git checkout V5-4-patches</command>
+ <command>echo {BRANCHPATH} rc >> dist/release </command>
+ <command ignoreerror="1">git commit -m "Release Candidate for {BRANCHPATH}" dist/release</command>
+ <command>git checkout {BRANCHPATH} </command>
+ <command>git merge V5-4-patches </command>
+ <command>git commit </command>
+ </commands>
+ </step>
+ <step type="system" skipif="'{RELEASETYPE}' eq 'rc'">
+ <text>Ensure that 'dist/release' doesn't reference this branch
+ </text>
+ <commands>
+ <command>git checkout V5-4-patches</command>
+ <command>grep -v {BRANCHPATH} dist/release > dist/release.new </command>
+ <command>mv dist/release.new dist/release </command>
+ <command ignoreerror="1">git commit -m "{BRANCHPATH} out of Release Candidate" dist/release</command>
+ <command>git checkout {BRANCHPATH} </command>
+ <command>git merge V5-4-patches </command>
+ <command>git commit </command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+ <step type="system" stepname="docs:make" title="docs:make">
+ <text>This step will create manual pages from doxygen
+ instrumented code files.</text>
+ <commands>
+ <command>
+ if [ -f Makefile ]
+ then
+ make docs
+ make mancp
+ fi
+ </command>
+ </commands>
+ </step>
+ <step type="system" stepname="docs:update" title="docs:update">
+ <text>This will run git status to figure out what files have
+ changed since the previous man page generation steps were
+ done. After this step, we'll commit all the modified files.
+
+ You may find additional files (marked with a ?) that should
+ be added to the svn repository and you'll need to do this by
+ hand before going on to the next step.
+
+ Note: based on a recent net-snmp-admin discussion, we're no
+ longer going to be adding the bazillions of man pages that
+ doxygen generates by default. Only important ones should be
+ added.</text>
+ <commands>
+ <command>git status --porcelain man</command>
+ </commands>
+ </step>
+ <step type="informational" pause="true" stepname="docs:manualaddnewman" title="docs:manualaddnewman">
+ <text>
+ Update man/Makefile.in with details of any new man pages,
+ and run 'git add' on them.
+
+ I'll commit these changes for you after you're done.
+ </text>
+ </step>
+ <step prompt="true" type="system" stepname="docs:commit" title="docs:commit">
+ <commands>
+ <command ignoreerror="1">git commit -m "documentation update for {VERSION}" man</command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+ <step type="section" title="Testing Steps">
+ <text>
+ These steps will help you test the source code to ensure it
+ passes some simple "it works" tests.
+ </text>
+ <steps>
+ <step type="system" stepname="build:distclean" title="build:distclean">
+ <text>First we need to clean the existing build tree and
+ start from scratch.</text>
+ <commands>
+ <command>NETSNMP_DONT_CHECK_VERSION=1 make distclean</command>
+ </commands>
+ </step>
+ <step type="system" stepname="build:configure" title="build:configure">
+ <text>We need to run configure to set up the build tree.</text>
+ <commands>
+ <command>./configure --cache=config.cache --with-defaults --with-mib-modules='host examples examples/example testhandler tlstm-mib tsm-mib smux Rmon disman/event-mib' --with-transports="IPX TLSTCP DTLSUDP" --with-security-modules="tsm" --enable-ipv6 --enable-embedded-perl --enable-shared</command>
+ </commands>
+ </step>
+ <step type="system" stepname="build:make" title="build:make">
+ <text>Then we need to build the code</text>
+ <commands>
+ <command>NETSNMP_DONT_CHECK_VERSION=1 make</command>
+ </commands>
+ </step>
+ <step type="system" stepname="build:test" title="testing: default tests">
+ <text>Now we run "make test" which should produce a perfect
+ set up test results. If not, this needs to be fixed or at
+ least understood and accepted as is for some other reason.</text>
+ <commands>
+ <command>make test</command>
+ </commands>
+ </step>
+ <step type="system" stepname="build:test:unit" title="testing: unit-tests">
+ <text>Now we run the unit-tests which should also produce a perfect
+ set up test results. If not, this needs to be fixed or at
+ least understood and accepted as is for some other reason.</text>
+ <commands>
+ <command>cd testing &amp;&amp; ./RUNFULLTESTS -g unit-tests</command>
+ </commands>
+ </step>
+ <step type="system" stepname="build:test:transports" title="testing: transports">
+ <text>Now we run the transport tests which should also
+ produce a perfect set up test results, if your machine
+ supports all the transports. If not, this needs to be fixed
+ or at least understood and accepted as is for some other
+ reason (like you can't do IPv6 on your system).</text>
+ <commands>
+ <command>cd testing &amp;&amp; ./RUNFULLTESTS -g transports</command>
+ </commands>
+ </step>
+ <step type="system" stepname="code:checkcomments" title="code:checkcomments">
+ <text>This command looks for source code oddities and policy
+ violations.</text>
+ <commands>
+ <command>make checks</command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+ <step type="section" title="Release File Steps">
+ <text>Certain files in the distribution are built on a
+ per-release basis. These steps will help set up these files.</text>
+ <steps>
+ <step type="system" stepname="code:makedepend" title="code:makedepend">
+ <text>This step creates Makefile dependencies using the
+ "distdepend" rule in the top level Makefile.
+
+ Note that if you have any additional MIB module code files in the
+ source tree, these will be included in the Makefile dependency list.
+ You may wish to remove these and re-run "make distdepend" before
+ committing the changes.
+ </text>
+ <commands>
+ <command>make distdepend</command>
+ </commands>
+ </step>
+ <step prompt="true" type="system" stepname="code:commitdepend" title="code:commitdepend">
+ <text>This step commits the dependency changes done in the
+ previous step.</text>
+ <commands>
+ <command ignoreerror="1">git commit -m "make depend for {VERSION}" `find . -name Makefile.depend`</command>
+ </commands>
+ </step>
+ <step type="system" stepname="changelog:create" title="Creating a changelog update">
+ <text>We need to extract the portions of the change logs
+ committed to the repository.</text>
+ <commands>
+ <command>git log --no-merges {LASTVERSIONTAGNAME}..HEAD &gt; ChangeLog.add</command>
+ </commands>
+ </step>
+ <step type="informational" pause="true" stepname="changelog:manualedit" title="changelog:manualedit">
+ <text>
+ You need to manually insert the *relevent* portions of
+ 'ChangeLog.add' into the ChangeLog file.
+
+ I also suggest truncating ChangeLog.add to only contain
+ the *relevent* portions for this release, as this will make
+ CHANGES.new2 and NEWS.new2 more accurate later on.
+
+ I'll commit these changes for you after you finish cutting
+ out the proper changes.
+ </text>
+ </step>
+ <step prompt="true" type="system" stepname="changelog:commit" title="changelog:commit">
+ <commands>
+ <command>git commit -m "version update for {VERSION}" ChangeLog</command>
+ </commands>
+ </step>
+ <step type="system" stepname="docs:newnews" title="docs:newnews">
+ <commands>
+ <command>perl dist/extractnews -s ----- -e ----- ChangeLog</command>
+ </commands>
+ </step>
+ <step type="system" stepname="docs:newnews" title="docs:newnews">
+ <commands>
+ <command>perl dist/extractnews -c CHANGES.new2 -n NEWS.new2 ChangeLog.add</command>
+ </commands>
+ </step>
+ <step type="informational" pause="true" stepname="docs:README-and-NEWS" title="docs:README">
+ <text>
+ You need to manually insert the relevent portions of
+ 'CHANGES.new' and 'NEWS.new' into the CHANGES and NEWS file.
+ (There are alternative versions in 'CHANGES.new2' and 'NEWS.new2')
+ You may wish to update the README file as well.
+ I'll commit these changes for you afterwards
+ </text>
+ </step>
+ <step prompt="true" type="system" stepname="docs:commit" title="docs:commit">
+ <commands>
+ <command ignoreerror="1">git commit -m "version update for {VERSION}" README NEWS CHANGES</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:update" title="release:update">
+ <text>One more git pull and status to make sure nothing
+ odd exists in your source tree. Please check the results!</text>
+ <commands>
+ <command>git pull</command>
+ <command>git status --porcelain</command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+
+ <step type="section" title="Make the Release" prompt="yes">
+ <text>This is it! After this point it's much harder to turn
+ back. If everything is ok until this point and you're ready to
+ actually tag the release in git and make release files, these
+ steps will do that for you.
+ </text>
+ <steps>
+ <step prompt="true" type="system" stepname="release:tag" title="release:tag">
+ <text>
+ This will actually svn copy the current checked out branch
+ to the new tag name. Specifically:
+
+ git tag -u A77C5329 -s {VERSIONTAGNAME} -m "Tagging of version {VERSION} as {VERSIONTAGNAME}"
+ </text>
+ <commands>
+ <command>git tag -u A77C5329 -s {VERSIONTAGNAME} -m "Tagging of version {VERSION} as {VERSIONTAGNAME}"</command>
+ </commands>
+ </step>
+ <step prompt="true" type="system" stepname="release:makedist" title="release:makedist">
+ <commands>
+ <command>git archive --prefix=net-snmp-{VERSION}/ {BRANCHPATH} | tar xf -</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:removefiles" title="release:removefiles">
+ <commands>
+ <command>net-snmp-{VERSION}/remove-files net-snmp-{VERSION}</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:makedist" title="release:makedist">
+ <commands>
+ <command>star artype=ustar -c -z -f net-snmp-{VERSION}.tar.gz net-snmp-{VERSION}</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:makezipclean" title="release:makezipclean">
+ <commands>
+ <command>rm -f net-snmp-{VERSION}.zip</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:makezip" title="release:makezip">
+ <commands>
+ <command>zip -r net-snmp-{VERSION}.zip net-snmp-{VERSION}</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:searching-gpg-keys" title="release:searching-gpg-keys">
+ <commands>
+ <command>gpg --list-secret-keys net-snmp-admin</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:gpg" title="release:gpg">
+ <commands>
+ <command>gpg -u A77C5329 -a --detach-sign net-snmp-{VERSION}.tar.gz</command>
+ </commands>
+ </step>
+ <step type="system" stepname="release:gpg" title="release:gpg">
+ <commands>
+ <command>gpg -u A77C5329 -a --detach-sign net-snmp-{VERSION}.zip</command>
+ </commands>
+ </step>
+ <step type="command" name="release:nextbranch" title="Don't propagate code modifications"
+ pause="0" mandatory="0">
+ <text>
+ Mark these code modifications as specific to this particular branch
+ </text>
+ <commands>
+ <command>git checkout {NEXTBRANCH}</command>
+ <command>git merge -s ours -m "Release {VERSION} specific changes" {BRANCHPATH}</command>
+ <command>git checkout {BRANCHPATH}</command>
+ </commands>
+ </step>
+ <step type="command" name="release:push" title="Push the code modifications"
+ pause="0" mandatory="0">
+ <text>
+ Push the code modifications to the upstream branch
+ </text>
+ <commands>
+ <command>git push</command>
+ <command>git push --tags origin {VERSIONTAGNAME}</command>
+ </commands>
+ </step>
+
+ <step type="section" title="Release File Test">
+ <text>We'll also re-build the source and retest a few things to
+ ensure the packaged file can actually be built.
+ </text>
+ <steps>
+ <step type="system" stepname="posttest:untar" title="posttest:untar">
+ <commands>
+ <command>rm -rf net-snmp-{VERSION}</command>
+ </commands>
+ </step>
+ <step type="system" stepname="posttest:untar" title="posttest:untar">
+ <commands>
+ <command>tar xzf net-snmp-{VERSION}.tar.gz</command>
+ </commands>
+ </step>
+ <step type="system" stepname="posttest:configure" title="posttest:configure">
+ <commands>
+ <command>cd net-snmp-{VERSION} &amp;&amp; ./configure --cache=config.cache --with-defaults --with-mib-modules='host examples examples/example testhandler smux Rmon disman/event-mib' --with-transports=IPX --enable-ipv6 --enable-embedded-perl --enable-shared</command>
+ </commands>
+ </step>
+ <step type="system" stepname="posttest:make" title="posttest:make">
+ <commands>
+ <command>cd net-snmp-{VERSION} &amp;&amp; make</command>
+ </commands>
+ </step>
+ <step type="system" stepname="posttest:test" title="posttest:test">
+ <commands>
+ <command>cd net-snmp-{VERSION} &amp;&amp; make test</command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+ </steps>
+ </step>
+ <step type="section" title="Release the results">
+ <text>Now we'll publish the results to the SF server</text>
+ <steps>
+ <step pause="true" type="system" skipif="'{RELEASETYPE}' eq 'full'"
+ stepname="publish:rsync" title="rsync the new files">
+ <text>This will copy the results to the SF uploads directory
+ in your account on frs.sourceforge.net. The following command
+ is just as an example - this script does *not* upload the
+ files automatically. You must do something like:</text>
+ <commands>
+ <command>echo rsync -v net-snmp-{VERSION}.tar.gz net-snmp-{VERSION}.tar.gz.asc net-snmp-{VERSION}.zip net-snmp-{VERSION}.zip.asc hardaker,net-snmp@frs.sourceforge.net:/home/frs/project/n/ne/net-snmp/net-snmp/{VERSIONTARGET}-pre-releases/</command>
+ </commands>
+ </step>
+ <step pause="true" type="system" skipunless="'{RELEASETYPE}' eq 'full'"
+ stepname="publish:rsync" title="rsync the new files">
+ <text>This will copy the results to the SF uploads directory
+ in your account on frs.sourceforge.net. The following command
+ is just as an example - this script does *not* upload the
+ files automatically. You must do something like:</text>
+ <commands>
+ <command>echo rsync -v net-snmp-{VERSION}.tar.gz net-snmp-{VERSION}.tar.gz.asc net-snmp-{VERSION}.zip net-snmp-{VERSION}.zip.asc hardaker,net-snmp@frs.sourceforge.net:/home/frs/project/n/ne/net-snmp/net-snmp/{VERSIONTARGET}/</command>
+ </commands>
+ </step>
+ <step type="informational" stepname="publish:editrelease"
+ title="Update the SF release web page">
+ <text>
+ Update the project download web page (http://www.net-snmp.org/download.html) to mention this new release
+ </text>
+<!-- Doesn't work
+ <commands>
+ <command>firefox 'http://sourceforge.net/project/admin/editpackages.php?group_id=12694'</command>
+ </commands>
+ -->
+ </step>
+ <step type="system" stepname="publish:editpatches"
+ skipunless="'{RELEASETYPE}' eq 'full'"
+ title="Update the SF Official Patch tracker">
+ <text>
+ If this the final version of this release, then:
+ Any official patches for the previous release should be re-prioritised to level 5.
+ Any official patches for the earlier releases should be re-prioritised to level 1 and closed.
+ </text>
+ <commands>
+ <command>firefox 'http://www.net-snmp.org/official_patches/'</command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+ <step type="informational">
+ <text>
+ Binaries: build rpms, .tar.gzs, etc.
+ </text>
+ </step>
+ <step type="Informational" name="cleanup:nsrollup" title="Run nsrollup"
+ pause="1" mandatory="1">
+ <text>
+ You need to run nsrollup now to sync all the changes we've
+ made into any upstream branches. This will likely cause merge
+ conflicts because of the version number clashes and will need
+ to be resolved.
+
+ Run (in bash):
+
+ . local/gittools/shell-functions
+ nsrollup
+ nssync
+
+ XXX: For conflicts, we can probably pick -s ours but needs to
+ be checked and documented.
+ </text>
+ </step>
+ <step type="section" title="Advertise it!">
+ <steps>
+ <step type="system" pause="1" title="Add note to the news system">
+ <text>Add a note to the source forge news system:
+
+ http://sourceforge.net/news/submit.php?group_id=12694
+ </text>
+ <commands>
+ <command>echo firefox 'http://sourceforge.net/news/submit.php?group_id=12694'</command>
+ </commands>
+ </step>
+ <step type="informational" pause="1">
+ <text>Send an announcement message to one of the following
+ mailing lists based on its type:
+
+ pre: net-snmp-coders@lists.sourceforge.net
+
+ rc: net-snmp-users@lists.sourceforge.net
+
+ final: net-snmp-announce@lists.sourceforge.net
+ (one week after the source tarball is made available)
+ </text>
+ </step>
+ <step type="informational" skipunless="'{RELEASETYPE}' eq 'full'" pause="1">
+ <text>Update the topic on the #Net-SNMP channel if this is a
+ trunk based release.
+ </text>
+ </step>
+ <step type="system" skipunless="'{RELEASETYPE}' eq 'full'" pause="1">
+ <text>Update the freshmeat listing (Wes needs to do this):
+
+ http://freshmeat.net/projects/net-snmp/
+ </text>
+ <commands>
+ <command>echo firefox http://freshmeat.net/projects/net-snmp/</command>
+ </commands>
+ </step>
+ </steps>
+ </step>
+ <step type="informational" skipunless="'{RELEASETYPE}' eq 'full'" pause="1">
+ <text>
+ Advertise: NEWS upload to sf, publish on -announce, freshmeat,
+ and the GNU FSF directory
+ (http://directory.fsf.org/project/net-snmp/)...
+ (send mail to bug-directory@gnu.org)
+ </text>
+ </step>
+ </steps>
+</makerelease>
diff --git a/dist/net-snmp-solaris-build/DEVENV b/dist/net-snmp-solaris-build/DEVENV
new file mode 100644
index 0000000..b905cae
--- /dev/null
+++ b/dist/net-snmp-solaris-build/DEVENV
@@ -0,0 +1,44 @@
+PREFIX=/opt/OSS
+export PREFIX
+
+PATH=$PREFIX/bin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb
+export PATH
+
+LD_LIBRARY_PATH=$PREFIX/lib
+LD_RUN_PATH=$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH LD_RUN_PATH
+
+CC=gcc
+export CC
+
+CPPFLAGS="-I$PREFIX/include"
+CFLAGS="-mv8 -mtune=ultrasparc"
+LDFLAGS="-L$PREFIX/lib -R$PREFIX/lib"
+export CPPFLAGS CFLAGS LDFLAGS
+
+TMP=/tmp
+export TMP
+
+TOP=/ctbto/idc/cicn/source/build/`basename $PREFIX`
+export TOP
+
+SRC=$TOP/dist
+export SRC
+
+WORK=$TOP/work
+export WORK
+
+
+# for superpack:
+
+CHECKLIST=$TOP/Checklist; export CHECKLIST
+MAKE=$PREFIX/bin/make
+export MAKE
+
+#CATEGORY=OpenSource; export CATEGORY
+#VENDOR="Free Software Foundation"; export VENDOR
+BASEDIR=/opt; export BASEDIR
+PREFIX=$BASEDIR/`basename $TOP`; export PREFIX
+RELEASE_AREA=$TOP/../packages/`/bin/uname -p`/`/bin/uname -r`; export RELEASE_AREA
+
+umask 022
diff --git a/dist/net-snmp-solaris-build/README b/dist/net-snmp-solaris-build/README
new file mode 100644
index 0000000..53e25a6
--- /dev/null
+++ b/dist/net-snmp-solaris-build/README
@@ -0,0 +1,19 @@
+The "buildpackage-solaris" script does a "one-shot" build
+and packaging of an untarred net-snmp distribution
+on Solaris without requiring root access.
+
+The resulting native Solaris package can then be
+(automatically) installed/removed using the Solaris
+pkgadd(1)/pkgrm(1) commands.
+
+The script requires customization of your
+development environment - see attached file
+DEVENV - before it can be used.
+
+ Basic usage: ./buildpackage-solaris distclean
+
+The script "elfdepend.sh" is required to
+determine the dependencies of all built ELF binaries
+and libraries to create a "package dependency file" -
+see depend(4).
+
diff --git a/dist/net-snmp-solaris-build/buildpackage-solaris b/dist/net-snmp-solaris-build/buildpackage-solaris
new file mode 100644
index 0000000..31f4f0c
--- /dev/null
+++ b/dist/net-snmp-solaris-build/buildpackage-solaris
@@ -0,0 +1,182 @@
+#!/bin/ksh
+#
+# automatic build (configure/make/package) script
+# for NET-SNMP on Solaris
+#
+# 2004/11 Rewrite to strictly build the package jfrank@fastrieve.com
+# 2002/11 Stefan.Radman@CTBTO.ORG
+
+
+# If you define DEBUG, the script will be verbose, and we won't remove temporary files
+
+#DEBUG=Y
+if [ ! -z $DEBUG ]; then
+ set -x # be verbose
+fi
+
+# TMP is where we are temporarily installing the package to
+TMP=`pwd`/pkgroot
+
+# PKG is the internal and external name for the package
+PKG=OSSnet-snmp
+
+#PREFIX is the top level architecture dependent directory.
+# This should be normally determined by configure
+#prefix=/opt/${PKG}
+prefix=/usr/local
+
+# VARDIR is the persistent dir from configure
+VARDIR=/var/net-snmp
+
+expandedprefix=${TMP}/${prefix}
+
+PERL=${PERL:=`which perl`}
+MAKE=${MAKE:=`which make`}
+
+if [ -d ${TMP} ]; then
+ rm -rf ${TMP};
+fi
+
+# install to temporary package build root
+cd ../..
+
+$MAKE install prefix=${expandedprefix} exec_prefix=${expandedprefix} || exit 1
+
+# We now have the main software installed, copy over the auxillary files
+cd -
+
+awk /^___snmpd-init.d/,/___EOF/ $0 | grep -v ^___ | sed "s,@prefix@,$prefix,g" >|snmpd-init.d
+
+# create persistent directory if it does not exist
+[ -d $TMP/$VARDIR ] || install -d -m 0755 $TMP/$VARDIR
+
+# postinstall
+LD_LIBRARY_PATH=$TMP$prefix/lib:$LD_LIBRARY_PATH $TMP/$prefix/bin/snmptranslate\
+ -M$TMP/$prefix/share/snmp/mibs -m SNMPv2-SMI .1 >&- || exit $? # create MIB index
+
+# package
+version=`../../net-snmp-config --version`
+os=`uname -s`
+rel=`uname -r`
+class=snmp
+owner=$LOGNAME
+groups | awk '{print $1}' | read group
+cat <<== >|pkginfo
+PKG="${PKG}"
+NAME="net-snmp-$version"
+ARCH="`uname -p`"
+VERSION="$version, $os $rel, `date +%Y.%m.%d.%H.%M.%S`"
+CATEGORY="OpenSource"
+DESC="The NET-SNMP Tools and Library"
+VENDOR="http://net-snmp.sourceforge.net"
+CLASSES="$class"
+BASEDIR="$prefix"
+==
+. ./pkginfo
+
+echo 'checking dependencies'
+unset LD_LIBRARY_PATH # binaries and libraries should have RPATH now
+./elfdepend.sh $TMP | grep -v "P *$PKG " >|depend # ignore own package
+
+echo 'creating prototype file'
+cat <<== >|prototype
+i pkginfo
+i copyright=../../COPYING
+#i preinstall=./preinstall-postremove
+#i postinstall=./preinstall-postremove
+i depend
+# set default mode, owner and group
+! default 0775 root sys
+d snmp /etc 0755 root sys
+d snmp /etc/init.d 0755 root sys
+f snmp /etc/init.d/snmpd=./snmpd-init.d 0755 root sys
+#l snmp /etc/rc2.d/S76snmpd=/etc/init.d/snmpd # not yet
+==
+
+pkgproto -c snmp $TMP=/ |\
+egrep -v '^d .* / |^d .* /var |^d .* /opt |^ .*perllocal.pod=' |\
+sed -e "s/ $owner $group\$//" >> prototype || exit $?
+# and ignore top level directories (must pre-exist)
+
+echo 'creating package'
+pkgmk -od . || exit $?
+pkgtrans . $PKG-$version-$ARCH-$os$rel.pkg $PKG || exit $?
+
+# We should really do some cleanup here
+if [ -z $DEBUG ]; then
+ rm -rf snmpd-init.d $PKG $TMP pkginfo prototype depend
+fi
+
+echo "build was successfull"
+exit 0
+
+# /etc/init/snmpd
+# This is packaged inside of buildpackage-solaris because we need to substitute
+# in the actual server name.
+
+___snmpd-init.d___
+#! /bin/sh
+#
+# start/stop the NET-SNMP master agent (snmpd)
+#
+# Location: /etc/init.d/snmpd
+# /etc/rc3.d/S??snmpd
+#
+name="NET-SNMP agent"
+daemon=@prefix@/sbin/snmpd
+
+case "$1" in
+start)
+ [ ! -x $daemon ] && echo "ERROR: cannot start $name ($daemon)" && exit 1
+ echo "Starting $name ... \c"
+ PGREP=`which pgrep`
+ if [ -z $PGREP ]; then
+ pid=`pgrep -fx $daemon`
+ else
+ pid=`ps -ef | grep $daemon | grep -v grep | awk '{print $2}'`
+ fi
+
+ [ ! -z "$pid" ] && echo "already running with pid $pid." && exit 0
+ $daemon && echo "done."
+ ;;
+stop)
+ echo "Stopping $name ... \c"
+ PGREP=`which pgrep`
+ if [ -z $PGREP ]; then
+ pid=`pgrep -fx $daemon`
+ else
+ pid=`ps -ef | grep $daemon | grep -v grep | awk '{print $2}'`
+ fi
+ [ ! -z "$pid" ] && (kill $pid && echo "done" ) || echo "not running"
+
+ ;;
+status)
+ echo "$name is \c"
+ PGREP=`which pgrep`
+ if [ -z $PGREP ]; then
+ pid=`pgrep -fx $daemon`
+ else
+ pid=`ps -ef | grep $daemon | grep -v grep | awk '{print $2}'`
+ fi
+ [ -z "$pid" ] && echo "not running" || echo "running with pid $pid"
+ ;;
+restart)
+ $0 stop && $0 start
+ ;;
+reload)
+ echo "Re-initializing $name ...\c"
+ PGREP=`which pgrep`
+ if [ -z $PGREP ]; then
+ pid=`pgrep -fx $daemon`
+ else
+ pid=`ps -ef | grep $daemon | grep -v grep | awk '{print $2}'`
+ fi
+ [ ! -z "$pid" ] && (kill -HUP $pid && echo "done" ) || echo "not running"
+ ;;
+*)
+ echo "Usage: $0 { start | stop | status | restart | reload }"
+ ;;
+esac
+
+exit 0
+___EOF___
diff --git a/dist/net-snmp-solaris-build/elfdepend.sh b/dist/net-snmp-solaris-build/elfdepend.sh
new file mode 100755
index 0000000..547c4cc
--- /dev/null
+++ b/dist/net-snmp-solaris-build/elfdepend.sh
@@ -0,0 +1,87 @@
+#!/bin/ksh
+#
+# elfdepend.sh
+#
+# given a path, this scripts searches for ELF binaries and libraries
+# and generates package dependency file entries according to ther dependencies
+#
+# Usage: elfdepend <ELF-binary>|<directory>
+#
+# 2002/11 Stefan.Radman@CTBTO.ORG
+#
+# /var/sadm/install/contents format:
+#
+# /dev d none 0775 root sys SUNWcsr SUNWcsd
+# path type class mode owner group packages
+# /etc/.login f renamenew 0644 root sys 516 37956 904647695 SUNWcsr
+# /etc/acct/holidays e preserve 0664 bin bin 289 22090 904647603 SUNWaccr
+# path type class mode owner group x x x packages
+# /bin=./usr/bin s none SUNWcsr
+# path=link type class packages
+# /devices/pseudo/clone@0:hme c none 11 7 0600 root sys SUNWcsd
+# path type class x x owner mode packages
+#
+# types e (sed), v (volatile) have same format like type f (file)
+# type l (hardlink) has same format like type s (symlink)
+#
+prog=`basename $0`
+LAST_CHANCE=/opt/OSS/lib
+
+if [ -d "$1" ] ; then
+ find $1 -type f -exec file {} \;
+elif [ -x "$1" ] ; then
+ file $1
+else
+ echo 1>&2 "usage: $0 <directory>|<ELF executable>"
+ exit 1
+fi | awk '$2 == "ELF" { print }' | cut -d: -f1 |\
+while read elf
+do
+ ldd "$elf" | while read lib x path
+ do
+ [ -z "$path" ] && continue
+ if [ "$path" = '(file not found)' ]
+ then
+ if [ -x $LAST_CHANCE/$lib ]
+ then
+ path="$LAST_CHANCE/$lib"
+ else
+ echo "# $prog: $lib $x $path"
+ continue # not found
+ fi
+ fi
+ echo "$path"
+ # need symlink handling here - see /usr/platform/SUNW,*/lib/*
+ done
+done | sort -u | while read libpath other
+do
+ [ "$libpath" = "#" ] && echo "$libpath $other" && continue # error message
+ set -- `grep "^$libpath[ =]" /var/sadm/install/contents | head -1`
+ path=$1; type=$2
+ case $type in
+ f) # file
+ shift 9 # first package
+ ;;
+ s|l) # link
+ shift 3 # first package
+ ;;
+ '') # not found
+ echo "# $prog: $libpath is not associated with any package"
+ continue
+ ;;
+ *) # dubious file type
+ echo "# $prog: path $1 has dubious file type $2"
+ continue
+ ;;
+ esac
+ set -- `echo $1 | tr : ' '`
+ echo $1 # strip off classes
+done | sort -u | while read pkg other
+do
+ if [ "$pkg" = "#" ] ; then # error message
+ echo 1>&2 "$other" # goes to stderr
+ continue
+ fi
+ eval `pkgparam -v $pkg PKG NAME`
+ printf "P %-15s%s\n" "$PKG" "$NAME"
+done
diff --git a/dist/net-snmp.spec b/dist/net-snmp.spec
new file mode 100644
index 0000000..490049f
--- /dev/null
+++ b/dist/net-snmp.spec
@@ -0,0 +1,303 @@
+#
+# 5.4+ enables Perl by default
+#
+%define netsnmp_embedded_perl 1
+%define netsnmp_perl_modules 1
+%define netsnmp_cflags ""
+
+# ugly RHEL detector
+# SuSE build service defines rhel_version, RHEL itself defines nothing
+%if 0%{?rhel_version}
+%define rhel %{?rhel_version}
+%else
+%define is_rhel %(grep -E "Red Hat Enterprise Linux|CentOS" /etc/redhat-release &>/dev/null && echo 1 || echo 0)
+%if %{is_rhel}
+%define rhel %(sed </etc/redhat-release -e 's/.*release \\(.\\).*/\\1/' )
+%endif
+%endif
+
+# because perl(Tk) is optional, automatic dependencies will never succeed:
+%define _use_internal_dependency_generator 0
+%define __find_requires %{_builddir}/net-snmp-%{version}/dist/find-requires
+%define __find_provides /usr/lib/rpm/find-provides
+
+#
+# Check for -without embedded_perl
+#
+%{?_without_embedded_perl:%define netsnmp_embedded_perl 0}
+#
+# check for -without perl_modules
+#
+%{?_without_perl_modules:%define netsnmp_perl_modules 0}
+#
+# if embedded_perl or perl_modules specified, include some Perl stuff
+#
+%if 0%{?netsnmp_embedded_perl} || 0%{?netsnmp_perl_modules}
+%define netsnmp_include_perl 1
+%endif
+Summary: Tools and servers for the SNMP protocol
+Name: net-snmp
+Version: 5.7.2
+# update release for vendor release. (eg 1.fc6, 1.rh72, 1.ydl3, 1.ydl23)
+Release: 1
+URL: http://www.net-snmp.org/
+License: BSDish
+Group: System Environment/Daemons
+Vendor: Net-SNMP project
+Source: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz
+Prereq: openssl
+Obsoletes: cmu-snmp ucd-snmp ucd-snmp-utils
+BuildRoot: /tmp/%{name}-root
+Packager: The Net-SNMP Coders <http://sourceforge.net/projects/net-snmp/>
+Requires: openssl, popt, rpm, zlib, bzip2-libs, elfutils-libelf, glibc
+BuildRequires: perl, elfutils-libelf-devel, openssl-devel, bzip2-devel, rpm-devel
+%if %{netsnmp_embedded_perl}
+BuildRequires: perl(ExtUtils::Embed)
+Requires: perl
+%endif
+
+%if 0%{?fedora}%{?rhel}
+# Fedora & RHEL specific requires/provides
+Provides: net-snmp-libs, net-snmp-utils
+Obsoletes: net-snmp-libs, net-snmp-utils
+Epoch: 2
+
+%if 0%{?fedora} >= 9
+Provides: net-snmp-gui
+Obsoletes: net-snmp-gui
+# newer fedoras need following macro to compile with new rpm
+%define netsnmp_cflags "-D_RPM_4_4_COMPAT"
+%else
+BuildRequires: beecrypt-devel
+%endif
+%endif # RHEL or Fedora
+
+%description
+
+Net-SNMP provides tools and libraries relating to the Simple Network
+Management Protocol including: An extensible agent, An SNMP library,
+tools to request or set information from SNMP agents, tools to
+generate and handle SNMP traps, etc. Using SNMP you can check the
+status of a network of computers, routers, switches, servers, ... to
+evaluate the state of your network.
+
+%if %{netsnmp_embedded_perl}
+This package includes embedded Perl support within the agent.
+%endif
+
+%package devel
+Group: Development/Libraries
+Summary: The includes and static libraries from the Net-SNMP package.
+AutoReqProv: no
+Requires: net-snmp = %{epoch}:%{version}
+Obsoletes: cmu-snmp-devel ucd-snmp-devel
+
+%description devel
+The net-snmp-devel package contains headers and libraries which are
+useful for building SNMP applications, agents, and sub-agents.
+
+%if %{netsnmp_include_perl}
+%package perlmods
+Group: System Environment/Libraries
+Summary: The Perl modules provided with Net-SNMP
+AutoReqProv: no
+Requires: net-snmp = %{epoch}:%{version}, perl
+
+%if 0%{?fedora}%{?rhel}
+Provides: net-snmp-perl
+Provides: perl(SNMP) perl(NetSNMP::OID)
+Provides: perl(NetSNMP::ASN)
+Provides: perl(NetSNMP::AnyData::Format::SNMP) perl(NetSNMP::AnyData::Storage::SNMP)
+Provides: perl(NetSNMP::agent)
+Provides: perl(NetSNMP::manager) perl(NetSNMP::TrapReceiver)
+Provides: perl(NetSNMP::default_store) perl(NetSNMP::agent::default_store)
+Obsoletes: net-snmp-perl
+%endif
+
+%description perlmods
+Net-SNMP provides a number of Perl modules useful when using the SNMP
+protocol. Both client and agent support modules are provided.
+%endif
+
+%prep
+%if %{netsnmp_embedded_perl} == 1 && %{netsnmp_perl_modules} == 0
+echo "'-with embedded_perl' requires '-with perl_modules'"
+exit 1
+%endif
+%setup -q
+
+%build
+%configure --with-defaults --with-sys-contact="Unknown" \
+ --with-mib-modules="smux" \
+ --with-sysconfdir="/etc/net-snmp" \
+ --enable-shared \
+ %{?netsnmp_perl_modules: --with-perl-modules="INSTALLDIRS=vendor"} \
+ %{!?netsnmp_perl_modules: --without-perl-modules} \
+ %{?netsnmp_embedded_perl: --enable-embedded-perl} \
+ %{!?netsnmp_embedded_perl: --disable-embedded-perl} \
+ --with-cflags="$RPM_OPT_FLAGS %{netsnmp_cflags}"
+
+make
+
+%install
+# ----------------------------------------------------------------------
+# 'install' sets the current directory to _topdir/BUILD/{name}-{version}
+# ----------------------------------------------------------------------
+rm -rf $RPM_BUILD_ROOT
+
+make DESTDIR=%{buildroot} install
+
+# Remove 'snmpinform' from the temporary directory because it is a
+# symbolic link, which cannot be handled by the rpm installation process.
+%__rm -f $RPM_BUILD_ROOT%{_prefix}/bin/snmpinform
+# install the init script
+mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
+perl -i -p -e 's@/usr/local/share/snmp/@/etc/snmp/@g;s@usr/local@%{_prefix}@g' dist/snmpd-init.d
+install -m 755 dist/snmpd-init.d $RPM_BUILD_ROOT/etc/rc.d/init.d/snmpd
+
+%if %{netsnmp_include_perl}
+# unneeded Perl stuff
+find $RPM_BUILD_ROOT/%{_libdir}/perl5/ -name Bundle -type d | xargs rm -rf
+find $RPM_BUILD_ROOT/%{_libdir}/perl5/ -name perllocal.pod | xargs rm -f
+
+# store a copy of installed Perl stuff. It's too complex to predict
+(xxdir=`pwd` && cd $RPM_BUILD_ROOT && find usr/lib*/perl5 -type f | sed 's/^/\//' > $xxdir/net-snmp-perl-files)
+%endif
+
+%post
+# ----------------------------------------------------------------------
+# The 'post' script is executed just after the package is installed.
+# ----------------------------------------------------------------------
+# Create the symbolic link 'snmpinform' after all other files have
+# been installed.
+%__rm -f $RPM_INSTALL_PREFIX/bin/snmpinform
+%__ln_s $RPM_INSTALL_PREFIX/bin/snmptrap $RPM_INSTALL_PREFIX/bin/snmpinform
+
+# run ldconfig
+PATH="$PATH:/sbin" ldconfig -n $RPM_INSTALL_PREFIX/lib
+
+%preun
+# ----------------------------------------------------------------------
+# The 'preun' script is executed just before the package is erased.
+# ----------------------------------------------------------------------
+# Remove the symbolic link 'snmpinform' before anything else, in case
+# it is in a directory that rpm wants to remove (at present, it isn't).
+%__rm -f $RPM_INSTALL_PREFIX/bin/snmpinform
+
+%postun
+# ----------------------------------------------------------------------
+# The 'postun' script is executed just after the package is erased.
+# ----------------------------------------------------------------------
+PATH="$PATH:/sbin" ldconfig -n $RPM_INSTALL_PREFIX/lib
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+
+# Install the following documentation in _defaultdocdir/{name}-{version}/
+%doc AGENT.txt ChangeLog CodingStyle COPYING
+%doc EXAMPLE.conf.def FAQ INSTALL NEWS PORTING TODO
+%doc README README.agentx README.hpux11 README.krb5
+%doc README.snmpv3 README.solaris README.thread README.win32
+%doc README.aix README.osX README.tru64 README.irix README.agent-mibs
+%doc README.Panasonic_AM3X.txt
+
+#%config(noreplace) /etc/net-snmp/snmpd.conf
+
+#%{_datadir}/snmp/snmpconf-data
+%{_datadir}/snmp
+
+%{_bindir}
+%{_sbindir}
+%{_mandir}/man1/*
+# don't include Perl man pages, which start with caps
+%{_mandir}/man3/[^A-Z]*
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+%{_libdir}/*.so*
+/etc/rc.d/init.d/snmpd
+
+%files devel
+%defattr(-,root,root)
+
+%{_includedir}
+%{_libdir}/*.a
+%{_libdir}/*.la
+
+%if %{netsnmp_include_perl}
+%files -f net-snmp-perl-files perlmods
+%defattr(-,root,root)
+%{_mandir}/man3/*::*
+%{_mandir}/man3/SNMP*
+%endif
+
+%verifyscript
+echo "No additional verification is done for net-snmp"
+
+%changelog
+* Thu Jul 26 2012 Dave Shield <D.T.Shield@liverpool.ac.uk>
+- Additional "Provides:" to complete the list of perl modules
+ Triggered by Bug ID #3540621
+
+* Thu Oct 7 2010 Peter Green <peter.green@az-tek.co.uk>
+- Modified RHEL detection to include CentOS.
+- Added extra "Provides:" to the perlmods package definition;
+ otherwise subsequent package installations that require certain
+ Perl modules try to re-install RHEL/CentOS stock net-snmp
+
+* Tue May 6 2008 Jan Safranek <jsafranek@users.sf.net>
+- remove %{libcurrent}
+- add openssl-devel to build requirements
+- don't use Provides: unless necessary, let rpmbuild compute the provided
+ libraries
+
+* Tue Jun 19 2007 Thomas Anders <tanders@users.sf.net>
+- add "BuildRequires: perl-ExtUtils-Embed", e.g. for Fedora 7
+
+* Wed Nov 23 2006 Thomas Anders <tanders@users.sf.net>
+- fixes for 5.4 and 64-bit platforms
+- enable Perl by default, but allow for --without perl_modules|embedded_perl
+- add netsnmp_ prefix for local defines
+
+* Fri Sep 1 2006 Thomas Anders <tanders@users.sf.net>
+- Update to 5.4.dev
+- introduce %{libcurrent}
+- use new disman/event name
+- add: README.aix README.osX README.tru64 README.irix README.agent-mibs
+ README.Panasonic_AM3X.txt
+- add new NetSNMP::agent::Support
+
+* Fri Jan 13 2006 hardaker <hardaker@users.sf.net>
+- Update to 5.3.0.1
+
+* Wed Dec 28 2005 hardaker <hardaker@users.sf.net>
+- Update to 5.3
+
+* Tue Oct 28 2003 rs <rstory@users.sourceforge.net>
+- fix conditional perl build after reading rpm docs
+
+* Sat Oct 4 2003 rs <rstory@users.sourceforge.net> - 5.0.9-4
+- fix to build without requiring arguments
+- separate embedded perl and perl modules options
+- fix fix for init.d script for non-/usr/local installation
+
+* Fri Sep 26 2003 Wes Hardaker <hardaker@users.sourceforge.net>
+- fix perl's UseNumeric
+- fix init.d script for non-/usr/local installation
+
+* Fri Sep 12 2003 Wes Hardaker <hardaker@users.sourceforge.net>
+- fixes for 5.0.9's perl support
+
+* Mon Sep 01 2003 Wes Hardaker <hardaker@users.sourceforge.net>
+- added perl support
+
+* Wed Oct 09 2002 Wes Hardaker <hardaker@users.sourceforge.net>
+- Incorperated most of Mark Harig's better version of the rpm spec and Makefile
+
+* Wed Oct 09 2002 Wes Hardaker <hardaker@users.sourceforge.net>
+- Made it possibly almost usable.
+
+* Mon Apr 22 2002 Robert Story <rstory@users.sourceforge.net>
+- created
diff --git a/dist/nsb-config b/dist/nsb-config
new file mode 100755
index 0000000..0944fe6
--- /dev/null
+++ b/dist/nsb-config
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# $Id$
+# Author: Robert Story <rstory@freesnmp.com>
+#
+########################################################################
+########################################################################
+
+usage()
+{
+ echo "Usage: $0 [-d|-x] [-s SRCD]"
+ echo ""
+ echo " -s SRCDIR : soure directory [$HOME/src/net-snmp-VERSION]"
+ echo ""
+ echo " -x : configure extra features for pre-release testing"
+ echo " -d : configure for binary distribution"
+ exit 1
+}
+
+#set -x
+
+
+#
+# find nsb-platform based on the path to this script
+#
+EXE_PATH=`dirname $0`
+if [ -f $EXE_PATH/nsb-functions ];then
+ . $EXE_PATH/nsb-functions
+elif [ -f $HOME/bin/nsb-functions ]; then
+ . $HOME/bin/nsb-functions
+elif [ -f nsb-functions ];then
+ . nsb-functions
+else
+ echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD"
+ exit 1
+fi
+
+
+########################################################################
+########################################################################
+NSB_CONFIG_ALL=2
+
+# x) x=$OPTARG ;;
+while getopts ds:x opt
+do
+ case "$opt" in
+ d) NSB_CONFIG_ALL=0;;
+ s) SRCD=$OPTARG ;;
+ x) NSB_CONFIG_ALL=1;;
+ \?)# unknown flag
+ usage;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $NSB_CONFIG_ALL -eq 2 ]; then
+ echo "You must specify -d or -x"
+ usage
+fi
+
+if [ "x$SRCD" = "x" ]; then
+ for x in . $HOME/src/net-snmp
+ do
+ if [ -f $x/configure ]; then
+ SRCD=$x
+ break
+ fi
+ done
+ if [ "x$SRCD" = "x" ]; then
+ echo "Couldn't find a source directory. Please specify one for me."
+ usage
+ fi
+fi
+
+
+########################################################################
+########################################################################
+if [ $NSB_CONFIG_ALL -eq 0 ];then
+ nsb_config_dist $SRCD
+else
+ nsb_config_all $SRCD
+fi
diff --git a/dist/nsb-functions b/dist/nsb-functions
new file mode 100644
index 0000000..4865cc2
--- /dev/null
+++ b/dist/nsb-functions
@@ -0,0 +1,508 @@
+#!/bin/sh
+#----------------------------------------------------------------------
+# $Id$
+# Author: Robert Story <rstory@freesnmp.com>
+
+#----------------------------------------------------------------------
+#
+# source user config
+if [ -f $HOME/.snmp/nsb-rc ]; then
+ . $HOME/.snmp/nsb-rc
+fi
+
+
+#----------------------------------------------------------------------
+#
+nsb_sysname()
+{
+ echo `uname -mrs | tr ' /' '__'`
+}
+
+#----------------------------------------------------------------------
+#
+# Utility vars
+#
+NSB_VERSION=${NSB_VERSION:=""}
+NSB_BUILD_DIR=${NSB_BUILD_DIR:=""}
+NSB_BUILD_SUFFIX=${NSB_BUILD_SUFFIX:=""}
+NSB_SRC_DIR=${NSB_SRC_DIR:=""}
+NSB_INSTALL_DIR=${NSB_INSTALL_DIR:=""}
+NSB_INSTALL_DIR_DEFAULT=${NSB_INSTALL_DIR_DEFAULT:="$NSB_BUILD_DIR/usr"}
+NSB_PLATFORM=${NSB_PLATFORM:=`nsb_sysname`}
+# sun doesn't support hostname -s
+NSB_HOST=${NSB_HOST:=`hostname | cut -f1 -d.`}
+NSB_QUIET=${NSB_QUIET:=0}
+NSB_PROMPT=${NSB_PROMPT:=0}
+NSB_CLEAN=${NSB_CLEAN:=1}
+NSB_CONFIG_ALL=${NSB_CONFIG_ALL:=0}
+NSB_SKIP_CONFIG=${NSB_SKIP_CONFIG:=0}
+NSB_SKIP_BUILD=${NSB_SKIP_BUILD:=0}
+NSB_SKIP_TEST=${NSB_SKIP_TEST:=0}
+NSB_SKIP_INSTALL=${NSB_SKIP_INSTALL:=0}
+NSB_ERR_CTX_LINES=${NSB_ERR_CTX_LINES:=25}
+NSB_DIST_TRANSPORTS="UDP TCP Unix Callback"
+NSB_EXTRA_TRANSPORTS=""
+NSB_DIST_MODULES=${NSB_DIST_MODULES:="host disman/event-mib smux"}
+NSB_EXTRA_MODULES=${NSB_EXTRA_MODULES:="examples examples/example smux Rmon"}
+#testhandler
+NSB_EXTRA_CONFIG=${NSB_EXTRA_CONFIG:=""}
+NSB_PREFIX=${NSB_PREFIX:="/usr"}
+NSB_EXTRA_INSTALL=${NSB_EXTRA_INSTALL:=""}
+NSB_SHARED=${NSB_SHARED:="--enable-shared"}
+NSB_VIEW=cat
+NSB_FLOW=
+NSB_DATE=${NSB_DATE:=`date +%y%m%d_%H%M`}
+
+## embedded perl
+NSB_DIRLINK_DIRS="perl mibs include python"
+NSB_PERL=${NSB_PERL:=""}
+#NSB_PERL=${NSB_PERL:="--enable-embedded-perl"}
+if [ "x$NSB_PERL" != "x" ]; then
+ NSB_SKIP_DIRLINK=${NSB_SKIP_DIRLINK:=0}
+else
+ NSB_SKIP_DIRLINK=${NSB_SKIP_DIRLINK:=1}
+fi
+
+#
+# System specific additions
+#
+case `uname -s` in
+
+ SunOS)
+ NSB_TAIL_ARGS="-$NSB_ERR_CTX_LINES"
+ ;;
+
+ *)
+ NSB_TAIL_ARGS="-n $NSB_ERR_CTX_LINES"
+ ;;
+esac
+
+
+#----------------------------------------------------------------------
+#
+# Utility functions
+#
+
+nsb_abort()
+{
+ echo
+ echo "ABORTING: $@" >&2
+ exit 255
+}
+
+nsb_info()
+{
+ if [ $NSB_QUIET -ne 1 ]; then
+ echo $@
+ fi
+}
+
+nsb_prompt()
+{
+ if [ "x$1" = "x-f" ]; then
+ shift 1
+ tmp_nsb_prompt=1
+ else
+ tmp_nsb_prompt=$NSB_PROMPT
+ fi
+ if [ $tmp_nsb_prompt -eq 1 ]; then
+ echo $@
+ read nsb_prompt_dummy
+ else
+ echo "$@ (PROMPT SKIPPED)"
+ fi
+}
+
+nsb_flow()
+{
+ NSB_FLOW=$NSB_FLOW:$@
+ echo "Running $@" >&2
+}
+
+#----------------------------------------------------------------------
+#
+nsb_config_dist()
+{
+ nsb_flow config_dist
+ if [ $# -lt 1 ]; then
+ nsb_abort "usage: nsb_config_dist src_dir"
+ fi
+ ngc_src=$1
+ if [ ! -d $ngc_src ]; then
+ nsb_abort "$ngc_src does not exist!"
+ fi
+ if [ ! -d $ngc_src/agent/mibgroup ]; then
+ nsb_abort "agent/mibgroup directory in $ngc_src does not exist!"
+ fi
+ ngc_dest=$2
+ if [ "X$ngc_dest" != "X" -a ! -d $ngc_dest ]; then
+ nsb_abort "$ngc_dest does not exist!"
+ fi
+
+ #
+ # some modules might be release specific, so make sure they
+ # exist before we send them off to configure
+ #
+ NSB_FINAL_MODULES=
+ for ncd_x in $NSB_DIST_MODULES
+ do
+ if [ -r $ngc_src/agent/mibgroup/$ncd_x.h ]; then
+ NSB_FINAL_MODULES="$NSB_FINAL_MODULES $ncd_x"
+ fi
+ done
+
+ #
+ # NOTE: for some reason, bash does not expand variables
+ # inside of single quotes, so use double quotes
+ #
+ echo $ngc_src/configure --with-sys-location=Unknown \
+ --prefix="$NSB_PREFIX" \
+ --disable-developer $NSB_EXTRA_CONFIG \
+ --with-sys-contact='System Administrator' \
+ --with-defaults --with-mib-modules="$NSB_FINAL_MODULES"
+ $ngc_src/configure --with-sys-location=Unknown \
+ --prefix="$NSB_PREFIX" \
+ --disable-developer $NSB_EXTRA_CONFIG \
+ --with-sys-contact='System Administrator' \
+ --with-defaults --with-mib-modules="$NSB_FINAL_MODULES"
+ # I'd like to add ' | tee nsb_config.$NSB_DATE' to save output, but then
+ # I'd lose the rc from configure, which I need... sigh
+ ngc_rc=$?
+ if [ $ngc_rc -ne 0 ];then
+ nsb_abort "Error during configure dist (rc=$ngc_rc)"
+ fi
+}
+
+nsb_config_all()
+{
+ nsb_flow config_all
+ if [ $# -lt 1 ]; then
+ nsb_abort "usage: nsb_config_all src_dir"
+ fi
+ ngc_src=$1
+ if [ ! -d $ngc_src ]; then
+ nsb_abort "$ngc_src does not exist!"
+ fi
+ if [ ! -d $ngc_src/agent/mibgroup ]; then
+ nsb_abort "agent/mibgroup directory in $ngc_src does not exist!"
+ fi
+ ngc_dest=$2
+ if [ "X$ngc_dest" != "X" -a ! -d $ngc_dest ]; then
+ nsb_abort "$ngc_dest does not exist!"
+ fi
+
+ #
+ # System specific additions
+ #
+ case `uname -s` in
+
+ Linux)
+ NSB_IPV6=${NSB_IPV6:="--enable-ipv6"}
+ NSB_EXTRA_TRANSPORTS="IPX"
+ ;;
+
+ #Darwin)
+ # ;;
+
+ *)
+ NSB_IPV6=${NSB_IPV6:="--enable-ipv6"}
+ ;;
+ esac
+
+ #
+ # use libwrap if we can find the header
+ #
+ if [ -f /usr/include/tcpd.h ]; then
+ NSB_LIBWRAP=${NSB_LIBWRAP:="--with-libwrap"}
+ NSB_EXTRA_CONFIG="$NSB_EXTRA_CONFIG $NSB_LIBWRAP"
+ fi
+
+ #
+ # some modules might be release specific, so make sure they
+ # exist before we send them off to configure
+ #
+ NSB_FINAL_MODULES=
+ for ncd_x in $NSB_DIST_MODULES $NSB_EXTRA_MODULES
+ do
+ if [ -r $ngc_src/agent/mibgroup/$ncd_x.h ]; then
+ NSB_FINAL_MODULES="$NSB_FINAL_MODULES $ncd_x"
+ fi
+ done
+
+ #
+ # configure
+ #
+ # NOTE: for some reason, bash does not expand variables
+ # inside of single quotes, so use double quotes
+ #
+ echo $ngc_src/configure --with-defaults \
+ --prefix="$NSB_PREFIX" \
+ --disable-developer $NSB_EXTRA_CONFIG \
+ "--with-mib-modules=$NSB_FINAL_MODULES" \
+ "--with-transports=$NSB_DIST_TRANSPORTS $NSB_EXTRA_TRANSPORTS" \
+ $NSB_SHARED $NSB_IPV6 $NSB_PERL
+ $ngc_src/configure --with-defaults \
+ --prefix="$NSB_PREFIX" \
+ --disable-developer $NSB_EXTRA_CONFIG \
+ "--with-mib-modules=$NSB_FINAL_MODULES" \
+ "--with-transports=$NSB_DIST_TRANSPORTS $NSB_EXTRA_TRANSPORTS" \
+ $NSB_SHARED $NSB_IPV6 $NSB_PERL
+ # I'd like to add ' | tee nsb_config.$NSB_DATE' to save output, but then
+ # I'd lose the rc from configure, which I need... sigh
+ ngc_rc=$?
+ if [ $ngc_rc -ne 0 ];then
+ nsb_abort "Error during configure all (rc=$ngc_rc)"
+ fi
+}
+
+nsb_zip()
+{
+ if [ $# -ne 3 ]; then
+ nsb_abort "usage: $0 release build_directory dest_dir"
+ fi
+
+ release=$1
+ build_dir=$2
+ dest_dir=$3
+
+ build=$build_dir/$NSB_PLATFORM
+
+ if [ ! -d $build ]; then
+ nsb_abort "$build directory does not exist!"
+ fi
+
+ if [ ! -d $build/usr ]; then
+ nsb_abort "install directory $build/usr directory does not exist!"
+ fi
+
+ cd $build
+
+ rm -f $dest_dir/$release-$NSB_PLATFORM.tar
+ nsb_info "tar cf $dest_dir/$release-$NSB_PLATFORM.tar usr"
+ tar cf $dest_dir/$release-$NSB_PLATFORM.tar usr
+
+ nsb_info "gzip --best $dest_dir/$release-$NSB_PLATFORM.tar"
+ gzip --best $dest_dir/$release-$NSB_PLATFORM.tar
+
+ if [ $NSB_QUIET -ne 1 ]; then
+ ls -lt $dest_dir
+ fi
+}
+
+nsb_upload()
+{
+ build_dir=$1
+ target=$2
+ nsb_flow upload to $target: config.log configure-summary nsb_make-all.$NSB_DATE nsb_make-test.$NSB_DATE
+ dir=$PWD
+ cd $build_dir
+ /usr/bin/scp config.log configure-summary nsb_make-all.$NSB_DATE nsb_make-test.$NSB_DATE\
+ $target
+ cd $dir
+}
+
+nsb_dir_link()
+{
+ if [ $# -lt 2 ]; then
+ nsb_abort "usage: nsb_dir_link src_dir dst_dir"
+ fi
+ link_src_dir=$1
+ link_dst_dir=$2
+ if [ -d $link_src_dir ]; then
+ nsb_flow set up shadow directory $link_dst_dir
+ $NSB_DIRLINK $link_src_dir $link_dst_dir
+ rc=$?
+ if [ $rc -ne 0 ];then
+ nsb_abort "Error during nsb_dir_link (rc=$rc)"
+ fi
+ else
+ nsb_info "Skipping $link_src_dir"
+ fi
+ }
+
+nsb_make()
+{
+ nsb_flow make $1
+ target=$1
+ shift 1
+ parms=$@
+
+ if [ "x$NSB_MAKE" = "x" ];then
+ #nsb_info "Searching for GNU make (set NSB_MAKE to skip this step)"
+ for p in `echo $PATH | tr ':' ' '`
+ do
+ #echo $p
+ if [ -x $p/make ];then
+ dummy=`$p/make --version 2>&1 | grep GNU`
+ if [ $? -eq 0 ];then
+ #nsb_info "using $p/make ($dummy)"
+ NSB_MAKE=$p/make
+ break
+ fi
+ fi
+ if [ -x $p/gmake ];then
+ dummy=`$p/gmake --version 2>&1 | grep GNU`
+ if [ $? -eq 0 ];then
+ #nsb_info "using $p/gmake ($dummy)"
+ NSB_MAKE=$p/gmake
+ break
+ fi
+ fi
+ done
+ if [ "x$NSB_MAKE" = "x" ];then
+ nsb_abort "GNU make not found. Set NSB_MAKE to your make executable."
+ fi
+ fi
+
+ nsb_make_OUTPUT=nsb_make-$target.$NSB_DATE
+ nsb_info "Making $target... (log is $nsb_make_OUTPUT)"
+ #
+ if [ "x$target" = "xall" ]; then
+ $NSB_MAKE NOAUTODEPS=y touchit 2>&1 | tee $nsb_make_OUTPUT
+ fi
+ $NSB_MAKE $NSB_MAKE_EXTRA NOAUTODEPS=y start-flag $target $parms end-flag 2>&1 | tee -a $nsb_make_OUTPUT
+ # checking $? would only get us the rc from tee, which is useless
+
+ nsb_info "Checking for errors..."
+ egrep -i "error|fail|warn|no such|exists|t find |ermission denied" $nsb_make_OUTPUT \
+ > nsb_make-$target-allerrs.$NSB_DATE
+ # allow for a few exceptions
+ egrep -v -i "^ok|testing .*failure|[a-z&_](fail|error)|warn|error(mib|\.3)|(LOG|SNMP)_ERR|In function|= FAILURE|DEBUGMSG|/\*|static library .* is not portable" nsb_make-$target-allerrs.$NSB_DATE \
+ > nsb_make-$target-errs.$NSB_DATE
+ if [ -s nsb_make-$target-errs.$NSB_DATE ]; then
+ nsb_prompt "press enter to view errors"
+# grep ':' $nsb_make_OUTPUT > nsb_make-$target-errs2.$NSB_DATE
+# tail -n $NSB_ERR_CTX_LINES nsb_make-$target-errs2.$NSB_DATE >&2
+ tail $NSB_TAIL_ARGS nsb_make-$target-errs.$NSB_DATE >&2
+ nsb_abort "Error(s) during make $target"
+ fi
+
+ if [ -f build-in-progress-flag ];then
+ nsb_abort "make $target incomplete"
+ fi
+}
+
+nsb_default_paths()
+{
+ if [ "x$NSB_VERSION" = "x" ]; then
+ NSB_VERSION="unknown-version"
+ fi
+ if [ "x$NSB_SRC_DIR" = "x" ]; then
+ NSB_SRC_DIR=$HOME/src/net-snmp-$NSB_VERSION
+ fi
+ if [ "x$NSB_BUILD_DIR" = "x" ]; then
+ NSB_BUILD_DIR=$HOME/build/$NSB_VERSION
+ if [ "x$NSB_SUFFIX" != "x" ]; then
+ NSB_BUILD_DIR=$NSB_BUILD_DIR/$NSB_SUFFIX
+ fi
+ fi
+ if [ "x$NSB_INSTALL_DIR" = "x" ]; then
+ NSB_INSTALL_DIR="$NSB_INSTALL_DIR_DEFAULT"
+ fi
+}
+
+nsb_build()
+{
+ if [ $# -lt 5 ]; then
+ nsb_abort "usage: $0 release src_dir build_directory dest_dir config_all_flag ($@)"
+ fi
+
+ nsb_config_all_flag=0
+ release=$1
+ src_dir=$2
+ build_dir=$3
+ dest_dir=$4
+ nsb_config_all_flag=$5
+ shift 5
+
+ nsb_flow build in $build_dir
+ nsb_flow host $NSB_HOST
+ nsb_flow platform $NSB_PLATFORM
+
+ if [ ! -d $src_dir ]; then
+ nsb_abort "$src_dir does not exist!"
+ fi
+
+ if [ ! -d $build_dir ]; then
+ mkdir $build_dir
+ if [ ! -d $build_dir ]; then
+ nsb_abort "$build_dir directory does not exist!"
+ fi
+ fi
+
+ nsb_info "Changing directories to $build_dir"
+ cd $build_dir
+
+ if [ $NSB_CLEAN -gt 0 ]; then
+ nsb_info "Cleaning up..."
+ if [ $NSB_CLEAN -eq 2 ];then
+ if [ "x$PWD" = "x/" ]; then
+ nsb_abort "Not running rm -fR from /"
+ fi
+ nsb_info "rm -fR * .[a-zA-Z]* > /dev/null 2>&1"
+ rm -fR * .[a-zA-Z]* > /dev/null 2>&1
+ else
+ if [ "x$dest_dir" != "x" -a "x$dest_dir" != "x/" ]; then
+ nsb_info "rm -fR nsb_* $dest_dir > /dev/null 2>&1"
+ #rm -fR nsb_* $dest_dir > /dev/null 2>&1
+ fi
+ if [ -f Makefile ]; then
+ nsb_make NOAUTODEPS=y distclean
+ nsb_build_rc=$?
+ if [ $nsb_build_rc -ne 0 ]; then
+ nsb_abort "Error during make distclean (rc=$nsb_build_rc)"
+ fi
+ fi
+ fi
+ fi
+
+ if [ "X$dest_dir" != "X" -a ! -d $dest_dir ]; then
+ mkdir -p $dest_dir
+ if [ ! -d $dest_dir ]; then
+ nsb_abort "$dest_dir directory does not exist!"
+ fi
+ fi
+
+ if [ $NSB_SKIP_DIRLINK -eq 1 ]; then
+ nsb_info "Skipping nsb_dir_link"
+ else
+ for d in $NSB_DIRLINK_DIRS; do
+ nsb_dir_link $src_dir/$d $build_dir/$d
+ done
+ fi
+
+ if [ $NSB_SKIP_CONFIG -ne 1 ]; then
+ nsb_info "Configuring... (log is nsb_config.$NSB_DATE)"
+ if [ "x$nsb_config_all_flag" = "x0" ]; then
+ nsb_config_dist $src_dir "$dest_dir"
+ else
+ nsb_config_all $src_dir "$dest_dir"
+ fi
+ nsb_prompt "press enter to continue"
+ fi
+
+ if [ $NSB_SKIP_BUILD -eq 1 ]; then
+ nsb_info "Skipping 'make all'"
+ else
+ nsb_make all
+ fi
+
+ if [ $NSB_SKIP_TEST -eq 1 ]; then
+ nsb_info "Skipping 'make test'"
+ else
+ nsb_prompt "No errors found, press enter to run tests"
+ SNMP_TMPDIR_BASE=$build_dir/tests
+ export SNMP_TMPDIR_BASE
+ nsb_make test
+ fi
+
+ if [ $NSB_SKIP_INSTALL -eq 1 ]; then
+ nsb_info "Skipping 'make install'"
+ else
+ nsb_prompt "No errors found, press enter to install"
+ # DESTDIR makes sure the perl stuff goes into $dest_dir, too
+ nsb_make install DESTDIR="$dest_dir" $NSB_EXTRA_INSTALL
+ fi
+
+ return 0
+}
diff --git a/dist/nsb-nightly b/dist/nsb-nightly
new file mode 100755
index 0000000..3298a26
--- /dev/null
+++ b/dist/nsb-nightly
@@ -0,0 +1,188 @@
+#!/bin/sh
+#
+# $Id$
+# Author: Robert Story <rstory@freesnmp.com>
+#
+########################################################################
+########################################################################
+
+usage()
+{
+ echo "Usage: $0 [optional params] VERSION"
+ echo ""
+ echo " optional params: [-x] [-s SRCD] [-b BUILDD] [-i INSTALLD]"
+ echo " [-h host] [-p path]"
+ echo " VERSION : release number (eg 5.2.2)"
+ echo " -s SRCDIR : soure directory [$HOME/src/net-snmp-VERSION]"
+ echo " -b BUILDD : build directory [$HOME/build/]"
+ echo " NOTE-platform will be appended to build directory"
+ echo " -i INSTALLD: install directory [$HOME/build/\$PLATFORM/usr]"
+ echo ""
+ echo " -x : configure extra features for pre-release testing"
+ echo " -C : don't source $HOME/.snmp/nsb-nightly"
+ echo ""
+ echo " -f : from address for email results"
+ echo " -e : address to email error results to"
+ echo " -o : address to email success results to"
+ echo " -h : host to upload results to"
+ echo " -p : path to upload results to"
+ exit 1
+}
+
+#set -x
+
+# make getopts work on Tru64 by respawning in Posix mode
+if [ "`uname`" = "OSF1" -a "$BIN_SH" != "xpg4" ]; then
+ BIN_SH=xpg4
+ export BIN_SH
+ exec $0 $*
+fi
+
+#
+# find nsb-platform based on the path to this script
+#
+EXE_PATH=`dirname $0`
+if [ ! -f $EXE_PATH/nsb-functions ];then
+ if [ -f $HOME/bin/nsb-functions ]; then
+ EXE_PATH=$HOME/bin
+ elif [ -f nsb-functions ];then
+ EXE_PATH=$PWD
+ else
+ echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD"
+ exit 1
+ fi
+fi
+
+if [ "x$1" = "x-C" ]; then
+ shift
+else
+ if [ -f $HOME/.snmp/nsb-nightly ];then
+ . $HOME/.snmp/nsb-nightly
+ fi
+fi
+
+########################################################################
+########################################################################
+
+# -r : remove build dir before
+# -R : remove build dir after
+PARMS="$PARMS -r"
+NIGHTLY_VERBOSE=0
+NSB_ERR_RESULTS_TO=""
+NSB_OK_RESULTS_TO=""
+
+while getopts b:e:f:i:o:s:xh:p:v opt
+do
+ case "$opt" in
+ b) NSB_BUILD_DIR=$OPTARG;;
+ e) NSB_ERR_RESULTS_TO=$OPTARG;;
+ f) NSB_FROM=$OPTARG;;
+ o) NSB_OK_RESULTS_TO=$OPTARG;;
+ i) PARMS="-i $OPTARG $PARMS";;
+ s) NSB_SRC_DIR=$OPTARG;;
+ h) NSB_SCP_HOST=$OPTARG
+ PARMS="-h $NSB_SCP_HOST $PARMS"
+ ;;
+ p) NSB_SCP_DEST=$OPTARG
+ PARMS="-p $NSB_SCP_DEST $PARMS"
+ ;;
+ x) PARMS="-x $PARMS";;
+ v) NIGHTLY_VERBOSE=1;;
+ \?)# unknown flag
+ usage;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $# -ne 1 ]; then
+ echo "expecting 1 argument, got $# ($@)"
+ usage
+fi
+
+NSB_VERSION=$1
+
+. $EXE_PATH/nsb-functions
+
+nsb_default_paths
+
+PARMS="$PARMS -b $NSB_BUILD_DIR -s $NSB_SRC_DIR"
+
+########################################################################
+########################################################################
+echo "Start: `date`"
+echo "Running nsb-package $PARMS $NSB_VERSION"
+if [ $NIGHTLY_VERBOSE = 1 ]; then
+ $EXE_PATH/nsb-package $PARMS $NSB_VERSION
+else
+ $EXE_PATH/nsb-package $PARMS $NSB_VERSION > /dev/null
+fi
+RC=$?
+echo "Finish: `date`"
+cd $NSB_BUILD_DIR
+case $RC in
+ 0) RESULT="Success"
+ NSB_RESULTS_TO=$NSB_OK_RESULTS_TO
+ FILES=""
+ ;;
+ *) RESULT="Error (rc $RC)"
+ NSB_RESULTS_TO=$NSB_ERR_RESULTS_TO
+ FILES=`ls nsb-make-*-errs.* 2>/dev/null`
+ if [ "x$NSB_SCP_HOST" != "x" ]; then
+ nsb_upload $NSB_BUILD_DIR $NSB_SCP_HOST:$NSB_SCP_DEST/$NSB_VERSION/$NSB_SUFFIX
+ fi
+ ;;
+esac
+echo "Result: $RESULT"
+
+if [ "x$NSB_RESULTS_TO" != "x" ]; then
+ SUBJECT="$NSB_VERSION $RESULT on $NSB_HOST ($NSB_PLATFORM)"
+ echo "Sending mail to $NSB_RESULTS_TO: $SUBJECT"
+ case `uname -s` in
+ OpenBSD|FreeBSD) # mail doesn't allow setting From
+ # seems to be in /usr/sbin, which isn't in all paths
+ PATH=/usr/sbin/:$PATH
+ echo "From: $NSB_FROM" > mail.results
+ echo "To: $NSB_RESULTS_TO" >> mail.results
+ # mail-related errors to OK address (usully buildmaster)
+ echo "Errors-To: $NSB_OK_RESULTS_TO" >> mail.results
+ echo "Subject: $SUBJECT" >> mail.results
+ echo "" >> mail.results
+ grep CONFIGURE_OPTIONS include/net-snmp/net-snmp-config.h|sed 's:/home/[^ ]*/build:$HOME:g' >> mail.results
+ echo "Result: $RESULT" >> mail.results
+ if [ "x$FILES" != "x" ]; then
+ cat $FILES >> mail.results
+ fi
+ sendmail -t < mail.results
+ ;;
+ SunOS) # no sendmail, no mail -s, need -t for To
+ echo "From: $NSB_FROM" > mail.results
+ # mail-related errors to OK address (usully buildmaster)
+ echo "Errors-To: $NSB_OK_RESULTS_TO" >> mail.results
+ echo "Subject: $SUBJECT" >> mail.results
+ echo "" >> mail.results
+ grep CONFIGURE_OPTIONS include/net-snmp/net-snmp-config.h|sed 's:/home/[^ ]*/build:$HOME:g' >> mail.results
+ echo "Result: $RESULT" >> mail.results
+ if [ "x$FILES" != "x" ]; then
+ cat $FILES >> mail.results
+ fi
+ mail -t $NSB_RESULTS_TO < mail.results
+ ;;
+ *)
+ echo "Result: $RESULT" >> mail.results
+ if [ "x$FILES" != "x" ]; then
+ cat $FILES >> mail.results
+ fi
+ mail -s "$SUBJECT" $NSB_RESULTS_TO < mail.results
+ ;;
+ esac
+fi
+
+if [ $RC -eq 0 ]; then
+ if [ "x$NSB_BUILD_DIR" = "/" ]; then
+ nsb_abort "Not running rm -fR from /"
+ else
+ /bin/rm -fR $NSB_BUILD_DIR > /dev/null 2>&1
+ fi
+fi
+
+exit $RC
diff --git a/dist/nsb-package b/dist/nsb-package
new file mode 100755
index 0000000..f51c150
--- /dev/null
+++ b/dist/nsb-package
@@ -0,0 +1,137 @@
+#!/bin/sh
+#
+# $Id$
+# Author: Robert Story <rstory@freesnmp.com>
+#
+########################################################################
+########################################################################
+
+usage()
+{
+ echo "Usage: $0 [params] VERSION"
+ echo ""
+ echo " params: [-c] [-d] [-P] [-s NSB_SRC_DIR] [-b BUILDD] [-i NSB_INSTALL_DIR]"
+ echo " [-h host] [-p path]"
+ echo ""
+ echo " VERSION : release number (eg 5.2.2)"
+ echo " -s NSB_SRC_DIR : source directory [$HOME/src/net-snmp-VERSION]"
+ echo " -b BUILDD : build directory [$HOME/build/]"
+ echo " NOTE-platform will be appended to build directory"
+ echo " -i NSB_INSTALL_DIR: install directory [$HOME/build/\$PLATFORM/usr]"
+ echo ""
+ echo " -x : configure extra features for pre-release testing"
+ echo " -c : skip configure"
+ echo " -d : dirty build (don't make distclean)"
+ echo " -m : skip 'make all'"
+ echo " -P : pause at prompts in between stages"
+ echo " -r : remove build dir (rm -fR) before build"
+ echo " -R : remove build dir (rm -fR) after successful build"
+ echo " -t : skip 'make test'"
+ echo " -C : don't source $HOME/.snmp/nsb-package"
+ echo ""
+ echo " -h : host to upload results to"
+ echo " -p : path to upload results to"
+ exit 1
+}
+
+#trap exit SIGINT
+
+#set -x
+
+# make getopts work on Tru64 by respawning in Posix mode
+if [ "`uname`" = "OSF1" -a "$BIN_SH" != "xpg4" ]; then
+ BIN_SH=xpg4
+ export BIN_SH
+ exec $0 $*
+fi
+
+#
+# find nsb-platform based on the path to this script
+#
+EXE_PATH=`dirname $0`
+if [ ! -f $EXE_PATH/nsb-functions ];then
+ if [ -f $HOME/bin/nsb-functions ]; then
+ EXE_PATH=$HOME/bin
+ elif [ -f nsb-functions ];then
+ EXE_PATH=$PWD
+ else
+ echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD"
+ exit 1
+ fi
+fi
+
+if [ "x$1" = "x-C" ]; then
+ shift
+else
+ if [ -f $HOME/.snmp/nsb-package ];then
+ . $HOME/.snmp/nsb-package
+ fi
+fi
+
+########################################################################
+########################################################################
+
+REMOVE_SUCCESS=0
+
+# x) x=$OPTARG ;;
+while getopts b:cdh:i:mPp:rRs:tx opt
+do
+ case "$opt" in
+ b) NSB_BUILD_DIR=$OPTARG ;;
+ c) NSB_SKIP_CONFIG=1 ;;
+ d) NSB_CLEAN=0 ;;
+ h) NSB_SCP_HOST=$OPTARG ;;
+ i) NSB_INSTALL_DIR=$OPTARG ;;
+ m) NSB_SKIP_BUILD=1 ;;
+ P) NSB_PROMPT=1 ;;
+ p) NSB_SCP_DEST=$OPTARG ;;
+ r) NSB_CLEAN=2 ;;
+ R) REMOVE_SUCCESS=1 ;;
+ s) NSB_SRC_DIR=$OPTARG ;;
+ t) NSB_SKIP_TEST=1 ;;
+ x) NSB_CONFIG_ALL=1;;
+ \?)# unknown flag
+ usage;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $# -ne 1 ]; then
+ echo "expecting 1 argument, got $# ($@)"
+ usage
+fi
+
+NSB_VERSION=$1
+
+. $EXE_PATH/nsb-functions
+
+nsb_default_paths
+
+if [ $NSB_CLEAN -eq 1 ]; then
+ if [ $NSB_SKIP_CONFIG -eq 1 ]; then
+ echo "A clean build also requires configuration (-d and -c"
+ echo "cannot both be specified)."
+ usage
+ fi
+fi
+
+
+########################################################################
+########################################################################
+nsb_prompt "press enter to build $NSB_SRC_DIR in $NSB_BUILD_DIR, and install in $NSB_INSTALL_DIR"
+nsb_build $NSB_VERSION $NSB_SRC_DIR $NSB_BUILD_DIR $NSB_INSTALL_DIR $NSB_CONFIG_ALL
+rc=$?
+if [ "x$NSB_SCP_HOST" != "x" ]; then
+ nsb_upload $NSB_BUILD_DIR $NSB_SCP_HOST:$NSB_SCP_DEST/$NSB_VERSION/$NSB_HOST/
+fi
+if [ $rc -eq 0 ] && [ $REMOVE_SUCCESS -eq 1 ];then
+ nsb_prompt "press enter to remove $NSB_BUILD_DIR"
+ if [ "x$NSB_BUILD_DIR" = "/" ]; then
+ nsb_abort "Not running rm -fR from /"
+ else
+ /bin/rm -fR $NSB_BUILD_DIR > /dev/null 2>&1
+ fi
+fi
+
+nsb_prompt "press enter to exit with rc $RC"
+exit $rc
diff --git a/dist/nsb-platform b/dist/nsb-platform
new file mode 100755
index 0000000..a7550a3
--- /dev/null
+++ b/dist/nsb-platform
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# $Id$
+# Author: Robert Story <rstory@freesnmp.com>
+#
+########################################################################
+########################################################################
+
+#
+# find nsb-platform based on the path to this script
+#
+EXE_PATH=`dirname $0`
+if [ -f $EXE_PATH/nsb-functions ];then
+ . $EXE_PATH/nsb-functions
+elif [ -f $HOME/bin/nsb-functions ]; then
+ . $HOME/bin/nsb-functions
+elif [ -f nsb-functions ];then
+ . nsb-functions
+else
+ echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD"
+ exit 1
+fi
+
+########################################################################
+########################################################################
+
+nsb_sysname
diff --git a/dist/patme b/dist/patme
new file mode 100755
index 0000000..0fd50ee
--- /dev/null
+++ b/dist/patme
@@ -0,0 +1,351 @@
+#!/usr/bin/perl
+
+use Getopt::GUI::Long;
+use QWizard;
+use QWizard::API;
+use Data::Dumper;
+use Cwd;
+
+use Getopt::Std;
+Getopt::GUI::Long::Configure(qw(display_help no_ignore_case));
+
+use strict;
+
+our %opts =
+(
+ 'd' => $ENV{'HOME'} . "/src/snmp/patme/",
+ 'b' => 'main,5.6,5.5,5.4,5.3',
+ 'p' => '-p0',
+);
+
+# sets the order shown
+our @codetrees = ('main',
+ '5.6',
+ '5.5',
+ '5.4',
+ '5.3',
+ '5.2',
+ '5.1',
+ '5.0',
+ 'UCD');
+
+our %codetrees = ('5.0' => 'V5-0-patches',
+ '5.1' => 'V5-1-patches',
+ '5.2' => 'V5-2-patches',
+ '5.3' => 'V5-3-patches',
+ '5.4' => 'V5-4-patches',
+ '5.5' => 'V5-5-patches',
+ '5.6' => 'V5-6-patches',
+ 'main' => 'net-snmp',
+ 'UCD' => 'V4-2-patches');
+
+our (@captures, $capfilt, $result, %captures, $capturenum);
+
+GetOptions(\%opts,
+ ['f|file=s', 'Patch file'],
+ ['d|base-directory=s', 'Base directory of checkouts'],
+ ['p|patch-args=s', 'Default patch arguments (-p1)'],
+
+ ['GUI:separator', 'Patch application specifics;'],
+ ['b|braches=s', 'Branches to apply to (eg 5.1,5.2,...)'],
+ ['m|commit-msg=s', 'Default commit message to use'],
+ ['D|subdir=s', 'Apply patches to a subdirectory'],
+ ['u|no-update', 'Do not run svn status/update in the directory first. Only use this if it\'s known clean.'],
+ );
+
+my %bs;
+if ($opts{'b'}) {
+ map { $bs{$_} = 1; } split(/,\s*/,$opts{'b'});
+}
+$opts{'d'} .= "/" if ($opts{'d'} !~ /\/$/);
+
+my $qw = new QWizard();
+my $pris = load_primaries();
+$qw->{'primaries'} = $pris;
+
+$qw->qwparam('svncommit',$opts{'m'}) if ($opts{'m'});
+
+$qw->magic('top');
+
+sub make_tops {
+ my @tops;
+ foreach my $k (@codetrees) {
+ push @tops,
+ qw_checkbox($k, "Apply to $k", 1, 0,
+ default => $qw->qwparam($k) || $bs{$k},
+ override => 1);
+ }
+ return @tops;
+}
+
+sub load_primaries {
+ my @tops = make_tops();
+ return
+ {
+ top =>
+ qw_primary('top','Select packages to apply the patch to:', '',
+ [@tops,
+ qw_text('basedir', 'Base code directory:',
+ default => $opts{'d'}),
+ qw_hidden('no_confirm',1),
+ qw_text('patchfile','Patch file:', default => $opts{f},
+ check_value => sub {
+ return "patch file doesn't exist" if (! -f qwparam('patchfile'))
+ }),
+ qw_checkbox('noupdate','Don\'t run svn update/revert first:',
+ 1, 0, default => $opts{'u'} || 0)],
+ [],[],sub_modules => ['commit', 'commitmsg', 'maketest',
+ 'edit', 'applying', 'check',
+ 'patch_info']),
+
+ patch_info =>
+ qw_primary('check','Checking code directory status:', '',
+ [qw_paragraph('patch pieces:',
+ sub { capture("egrep '^(---|\\+\\+\\+)' " .
+ qwparam('patchfile'))},
+ width => 80,
+ height => 30),
+ qw_text('patchargs','Patch arguments',
+ default => $opts{'p'}),
+ qw_text('subdir', 'Apply in package subdir:',
+ default => $opts{'D'}),
+ qw_paragraph('Note:','Hitting next below will first clean your local repositories which could take a bit (watch the console for deails on what it\'s doing at any moment)', doif => sub {!qwparam('noupdate')}),
+]),
+
+
+ check =>
+ qw_primary('check','Checking code directory status:', '',
+ [qw_paragraph('removed .rej files:',
+ sub { my $it = captureeachdir('find . -name \*.rej');
+ captureeachdir('find . -name \*.rej | xargs rm -f');
+ return $it;
+ },
+ preformatted => 1,
+ width => 80,
+ height => 60,
+ ),
+ qw_paragraph('svn update:',
+ sub {
+ my ($res, $one);
+ foreach my $k (@codetrees) {
+ next if (!qwparam($k));
+ $res .= "$k:\n";
+ $one = capturedir($codetrees{$k},
+ "svn update");
+ $res .= $one;
+ $one = capturedir($codetrees{$k},
+ "svn revert -R .");
+ $res .= $one;
+ }
+ return $res;
+ },
+ preformatted => 1,
+ width => 80,
+ height => 60,
+ doif => sub{!qwparam('noupdate')}
+ ) ],
+ ),
+
+ applying =>
+ qw_primary("applying", 'Applying patches to the code bases', '',
+ [{type => 'table',
+ text => 'Results:',
+ values => sub {
+ my @tab;
+ foreach my $k (@codetrees) {
+ next if (!qwparam($k));
+ push @tab, [$k,
+ qw_paragraph("r$k","",
+ preformatted => 1,
+ width => 80,
+ height => 20,
+ values =>
+ sub { my $cmd = "patch " . qwparam('patchargs') . " < " . qwparam('patchfile');
+ my $results = "Running on $k: $cmd" . "\n" . capturedir($codetrees{$k},$cmd);
+ return $results})];
+ }
+ return [\@tab];
+ }}],[],[]),
+
+ edit =>
+ qw_primary('edit','Fix the following files:','',
+ [qw_paragraph('Fix these (maybe):',
+ sub {
+ $capfilt = '(.*.rej)';
+ my $res =
+ captureeachdir('find . -name \*.rej');
+ print Dumper(\%captures);
+ $capfilt = undef;
+ return $res;
+ },
+ preformatted => 1,
+ width => 80,
+ height => 60,
+ ),
+ qw_label('failed files:',
+ sub { $capturenum = 0;
+ map { $capturenum += $#{$captures{$_}} + 1;
+ } (keys(%captures));
+ return $capturenum;
+ }),
+ qw_checkbox('edithem','Open an editor on the failed files?',
+ 1, 0, doif => sub { return $capturenum > 0 }),
+ qw_text('editor','Editor:',default => $ENV{'EDITOR'} || 'vi',
+ doif => sub { return $capturenum > 0 })],
+ [sub {
+ if (qwparam('edithem')) {
+ foreach my $k (keys(%captures)) {
+ foreach my $f (@{$captures{$k}}) {
+ my $file = qwparam('basedir') .
+ $codetrees{$k} .
+ qwparam('subdir') . '/' . $f->[0];
+ print STDERR "editing: $file\n";
+ system(qwparam('editor') . " " . $file);
+ }
+ }
+ }
+ }]
+ ),
+
+ maketest =>
+ qw_primary("maketest", "Run make?",'',
+ [qw_checkbox('makeit','Run make?', 1, 0),
+ qw_checkbox('maketest', 'Run make test?', 1, 0)
+ ],
+ [sub {
+ if (qwparam('makeit') || qwparam('maketest')) {
+ $_[0]->add_todos(-early, 'domake');
+ }
+ }]
+ ),
+
+ domake =>
+ qw_primary("domake", "Make results",'',
+ [qw_paragraph('Make results:',
+ sub { return captureeachdir('make'); },
+ preformatted => 1,
+ width => 80,
+ height => 20,
+ doif => sub { qwparam('makeit') }
+ ),
+ qw_paragraph('Make test results:',
+ sub { return captureeachdir('make test'); },
+ preformatted => 1,
+ width => 80,
+ height => 20,
+ doif => sub { qwparam('maketest') }
+ )]
+ ),
+
+ commitmsg =>
+ qw_primary("commitmsg", 'Commit info:', '',
+ [qw_text('svncommit','Commit message',
+ default => qwparam('svncommit') || $opts{'m'}),
+ {type => 'dynamic',
+ values => sub { my @tops = make_tops(1); return \@tops}}]),
+
+ commit =>
+ qw_primary("commit", 'running commit:', '',
+ [qw_paragraph('committing files:',
+ sub { my $msg = qwparam('svncommit');
+ $msg =~ s/\'/\'\"\'\"\'/g; # escape 's
+ return capturedir($opts{'d'},
+ 'svn commit -m \'' . $msg . '\' ' . get_codedirs_str()); },
+ preformatted => 1,
+ width => 80,
+ height => 20,
+ )]),
+
+ editing =>
+ qw_primary("applying", 'Edit the following files:', '',
+ [{type => 'table',
+ text => 'Results:',
+ values => sub { return [\@captures]},
+ }],[],[])
+ }
+}
+
+sub capture {
+ my $cmd = join(" ",@_);
+ my $results = "Running: $cmd\n";
+ my @a;
+ print $results;
+ open(I,"$cmd 2>&1|");
+ while (<I>) {
+ $results .= $_;
+ print $_;
+ if ($capfilt) {
+ print "capfilt: $capfilt\n";
+ @a = /$capfilt/;
+ print " capfilt: @a\n";
+ push @captures, [@a];
+ }
+ }
+ close(I);
+ $result = $? >> 8;
+ $results .= "RESULT: " . (($result) ? "FAIL" : "SUCCESS") . "($result)\n";
+ return $results;
+}
+
+sub capturedir {
+ my $dir = shift;
+ $dir .= "/" if ($dir !~ /\/$/);
+ my $basedir = qwparam('basedir');
+ $basedir .= "/" if ($basedir !~ /\/$/);
+ my $olddir = getcwd();
+ my $newdir = "$basedir$dir" . qwparam('subdir');
+ my $res = "changing to: $newdir\n";
+ print $res;
+ chdir($newdir);
+ $res .= capture(@_);
+ chdir($olddir);
+ return $res;
+}
+
+sub get_codedirs_str() {
+ my $res = "";
+ foreach my $k (@codetrees) {
+ next if (!qwparam($k));
+ $res .= " $opts{'d'}$codetrees{$k}";
+ }
+ $res =~ s/^ //;
+ return $res;
+}
+
+sub captureeachdir {
+ my $out;
+ %captures = ();
+ foreach my $k (@codetrees) {
+ next if (!qwparam($k));
+ $out .= "$k:\n";
+ $out .= capturedir($codetrees{$k}, @_) . "\n";
+ if ($#captures > -1) {
+ @{$captures{$k}} = @captures;
+ @captures = ();
+ }
+ }
+ return $out;
+}
+
+sub dodir {
+ my $text = shift;
+ return
+ [{type => 'table',
+ text => $text,
+ values => [[sub {
+ my @tab;
+ foreach my $k (@codetrees) {
+ next if (!qwparam($k));
+ push @tab, [$k,
+ qw_paragraph("r$k","",
+ preformatted => 1,
+ width => 80,
+ height => 20,
+ values =>
+ [[sub { $_->[0]($k)},
+ @_]])];
+ }
+ return [\@tab];
+ }, @_]]
+ }];
+}
diff --git a/dist/release b/dist/release
new file mode 100644
index 0000000..6da7b93
--- /dev/null
+++ b/dist/release
@@ -0,0 +1,8 @@
+#
+# Insert lines in this file to prevent the 'rollup' utility from
+# applying patches to a given branch. Right now, the file should contain
+# a branch name followed by 'rc' when the branch is in rc phase of a release.
+#
+V5-7-patches rc
+V5-7-patches rc
+V5-7-patches rc
diff --git a/dist/run-autoconf b/dist/run-autoconf
new file mode 100755
index 0000000..2969a59
--- /dev/null
+++ b/dist/run-autoconf
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+version=`cat dist/autoconf-version`
+prog='autoconf'
+# TODO: accept a different tool (autoheader) from the command line
+
+searchprefixes="/usr/local"
+for path in $searchprefixes ; do
+ if [ -d "$path/autoconf-$version" ]; then
+ prog="$path/autoconf-$version/bin/$prog"
+ break;
+ fi
+done
+
+echo "trying $prog version"
+echo "$prog --version"
+toolversion=`$prog --version | head -1 | awk '{print $NF}'`
+
+echo "Expected: $version"
+echo "Found: $toolversion"
+
+if [ "$version" != "$toolversion" ] ; then
+ echo "$prog doesn't match the expected version"
+ echo ""
+ echo "If you want this tool to auto-find versions, build the right"
+ echo "autoconf version using --prefix=/usr/local/autoconf-$version"
+ echo "and then re-run this tool ($0) once it's installed"
+ exit 1
+fi
+
+echo "Running $prog"
+autoconf "$@"
diff --git a/dist/schema-snmptrapd.sql b/dist/schema-snmptrapd.sql
new file mode 100644
index 0000000..f496f17
--- /dev/null
+++ b/dist/schema-snmptrapd.sql
@@ -0,0 +1,31 @@
+USE net_snmp;
+DROP TABLE IF EXISTS notifications;
+CREATE TABLE IF NOT EXISTS `notifications` (
+ `trap_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `date_time` datetime NOT NULL,
+ `host` varchar(255) NOT NULL,
+ `auth` varchar(255) NOT NULL,
+ `type` ENUM('get','getnext','response','set','trap','getbulk','inform','trap2','report') NOT NULL,
+ `version` ENUM('v1','v2c', 'unsupported(v2u)','v3') NOT NULL,
+ `request_id` int(11) unsigned NOT NULL,
+ `snmpTrapOID` varchar(1024) NOT NULL,
+ `transport` varchar(255) NOT NULL,
+ `security_model` ENUM('snmpV1','snmpV2c','USM') NOT NULL,
+ `v3msgid` int(11) unsigned,
+ `v3security_level` ENUM('noAuthNoPriv','authNoPriv','authPriv'),
+ `v3context_name` varchar(32),
+ `v3context_engine` varchar(64),
+ `v3security_name` varchar(32),
+ `v3security_engine` varchar(64),
+ PRIMARY KEY (`trap_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+
+DROP TABLE IF EXISTS varbinds;
+CREATE TABLE IF NOT EXISTS `varbinds` (
+ `trap_id` int(11) unsigned NOT NULL default '0',
+ `oid` varchar(1024) NOT NULL,
+ `type` ENUM('boolean','integer','bit','octet','null','oid','ipaddress','counter','unsigned','timeticks','opaque','unused1','counter64','unused2') NOT NULL,
+ `value` blob NOT NULL,
+ KEY `trap_id` (`trap_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
diff --git a/dist/snmpd-init.d b/dist/snmpd-init.d
new file mode 100755
index 0000000..bd15b00
--- /dev/null
+++ b/dist/snmpd-init.d
@@ -0,0 +1,73 @@
+#!/bin/sh
+#
+# snmpd This shell script takes care of starting and stopping
+# the net-snmp SNMP daemon
+#
+# chkconfig: - 26 74
+# description: snmpd is net-snmp SNMP daemon.
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+RETVAL=0
+name="snmpd"
+prog="/usr/local/sbin/snmpd"
+
+[ -x $prog -a -f /usr/local/share/snmp/snmpd.conf ] || exit 0
+
+start() {
+ # Start daemons.
+ echo -n $"Starting $name: "
+ daemon $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
+ return $RETVAL
+}
+
+stop() {
+ # Stop daemons.
+ echo -n $"Shutting down $name: "
+ killproc $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status $name
+ RETVAL=$?
+ ;;
+ restart|reload)
+ stop
+ start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$name ]; then
+ stop
+ start
+ RETVAL=$?
+ fi
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/dist/snmptrapd-init.d b/dist/snmptrapd-init.d
new file mode 100644
index 0000000..8225242
--- /dev/null
+++ b/dist/snmptrapd-init.d
@@ -0,0 +1,73 @@
+#!/bin/sh
+#
+# snmptrapd This shell script takes care of starting and stopping
+# the net-snmp SNMPTRAP daemon
+#
+# chkconfig: - 25 75
+# description: snmptrapd is net-snmp SNMPTRAP daemon.
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+RETVAL=0
+name="snmptrapd"
+prog="/usr/local/sbin/snmptrapd"
+
+[ -x $prog ] || exit 0
+
+start() {
+ # Start daemons.
+ echo -n $"Starting $name: "
+ daemon $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
+ return $RETVAL
+}
+
+stop() {
+ # Stop daemons.
+ echo -n $"Shutting down $name: "
+ killproc $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status $name
+ RETVAL=$?
+ ;;
+ restart|reload)
+ stop
+ start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$name ]; then
+ stop
+ start
+ RETVAL=$?
+ fi
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/dist/svnup b/dist/svnup
new file mode 100755
index 0000000..40353f0
--- /dev/null
+++ b/dist/svnup
@@ -0,0 +1,130 @@
+#!/bin/sh
+#
+# $Id: cvsup 15788 2007-01-24 13:49:38Z dts12 $
+#
+TAG=
+WO=0
+DEST=
+TMPDIR=/tmp
+
+if [ "x$1" = "x-u" ]; then
+ DEST=$2
+ shift 2
+
+ # gnu tar (as of 1.15.1) is unable to create portable tar archives,
+ # especially if long file names (>100 char) are present.
+ # star is a better replacement.
+ if [ -x /usr/bin/star ]; then
+ TAR='/usr/bin/star -Hustar -not -pat=*/.svn/* -c -f'
+ elif [ -x /bin/tar ]; then
+ TAR="/bin/tar --exclude=.svn -c -f"
+ echo "warning: star not available, using (less portable) tar..."
+ else
+ echo "neither /usr/bin/star nor /bin/tar found."
+ exit
+ fi
+fi
+
+if [ $# -eq 0 ]; then
+ DIR=$PWD
+else
+ if [ $# -ne 1 ]; then
+ echo "usage: $0 <working directory>"
+ exit
+ fi
+ DIR=$1
+fi
+
+if [ -z ${DIR##*/} ];then
+ DIR=${DIR%/*}
+fi
+SUBD=${DIR##*/}
+PARENT=${DIR%*$SUBD}
+#echo "$DIR = $PARENT + $SUBD"
+
+if [ ! -d $DIR ]; then
+ echo "no such directory '$DIR'"
+ exit
+fi
+
+if [ ! -d $DIR/.svn ]; then
+ echo "'$DIR' has no .svn directory!"
+ exit
+fi
+
+if [ ! -f $DIR/.svn/entries ]; then
+ echo "'$DIR' has no .svn/entries!"
+ exit
+fi
+
+SVNURL=`svn info $DIR| grep URL|cut -f2 -d " "`
+SVNTLD=`echo $SVNURL | sed 's:.*svnroot/net-snmp/\([^/]*\).*:\1:'`
+if [ "x$SVNTLD" = "xtrunk" ]; then
+ TAG="main"
+else
+ TAG=`echo $SVNURL | sed 's:.*svnroot/net-snmp/[^/]*/\([^/]*\).*:\1:'`
+fi
+
+if [ ! -z $DEST ]; then
+ if [ -z $TAG ]; then
+ echo "no TAG found in $DIR!"
+ exit 1
+ fi
+fi
+
+COMMAND="svn update -q $SVNURL $DIR"
+
+if [ ! -w $DIR/.svn ]; then
+ if [ -O $DIR/.svn ]; then
+ WO=1
+ echo "Making $DIR writable"
+ chmod -R u+w $DIR
+ fi
+fi
+
+echo "Updating directory $DIR from $TAG..."
+echo "$COMMAND"
+
+$COMMAND
+rc=$?
+if [ $rc -ne 0 ]; then
+ echo "svn command returned $?"
+fi
+
+if [ $WO -eq 1 ]; then
+ echo "Making $DIR read-only"
+ chmod -R a-w $DIR
+fi
+
+if [ ! -z $DEST ]; then
+ if [ $rc -ne 0 ]; then
+ echo "skipping upload due to rc $rc from svn command"
+ exit $rc
+ else
+ cd $DIR/..
+ #echo $PWD
+ DATE=`date +%Y%m%d_%H%M`
+ SOURCE=net-snmp-svn-$TAG"_$DATE"
+ $TAR $TMPDIR/$SOURCE.tar $SUBD
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ echo "skipping upload due to rc $rc from tar command"
+ rm -f $TMPDIR/$SOURCE.tar.gz
+ exit $rc
+ fi
+ gzip -f --best $TMPDIR/$SOURCE.tar
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ echo "skipping upload due to rc $rc from gzip command"
+ rm -f $TMPDIR/$SOURCE.tar.gz
+ exit $rc
+ fi
+ scp $TMPDIR/$SOURCE.tar.gz $DEST
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ echo "warning: rc $rc from scp command (tarball in $TMPDIR)"
+ else
+ rm -f $TMPDIR/$SOURCE.tar.gz
+ fi
+ fi
+fi
diff --git a/dotgdbinit b/dotgdbinit
new file mode 100644
index 0000000..6fdcc8c
--- /dev/null
+++ b/dotgdbinit
@@ -0,0 +1,138 @@
+#
+# this file defines some utilities for printing various structures
+# found in the net-snmp source code. You can source it from within
+# gdb and then use it to print variable chains, oids, etc directly
+# from memory.
+#
+# as an example, consider the variables:
+#
+# oid *name;
+# size_t name_len;
+#
+# normally display oids is difficult under gdb, and the best you can
+# do is to use x/12dw name or so to print the first 12 numbers of the
+# oid array. however, with this file you can now use:
+#
+# gdb> printoid name_len name
+# .1.3.6.1.2.1.1.0
+#
+# which will print oids in a more readable fashion. etc...
+#
+
+define initme
+ set $varindent = ""
+end
+
+define hookpost-run
+ initme
+end
+
+define printvarval
+ printf "value: "
+ if $arg0->type == 2
+ printf "int: %d\n", $arg0->val.integer
+ end
+ if $arg0->type == 4
+ printf "string: %s\n", $arg0->val.string
+ end
+ if $arg0->type == 5
+ printf "ASN NULL\n"
+ end
+ if $arg0->type == 6
+ printoid (($arg0->val_len)/sizeof(oid)) $arg0->val.objid
+ end
+ if $arg0->type == 128
+ printf "NO SUCH NAME\n"
+ end
+ if $arg0->type == 129
+ printf "NO SUCH INSTANCE\n"
+ end
+ if $arg0->type == 130
+ printf "END OF MIB VIEW\n"
+ end
+ if $arg0->type == 194
+ printf "AGENTX INCL RANGE: "
+ printoid (($arg0->val_len)/sizeof(oid)) $arg0->val.objid
+ end
+ if $arg0->type == 195
+ printf "AGENTX EXCL RANGE: "
+ printoid (($arg0->val_len)/sizeof(oid)) $arg0->val.objid
+ end
+end
+document printvarval
+ printvarval VARPTR
+ prints the value part of a net-snmp "struct variable".
+ This is called from inside printvar.
+end
+
+
+
+define printvar
+ printf "%stype: %d\n", $varindent, $arg0->type
+ printf "%soid: ", $varindent
+ printoid $arg0->name_length $arg0->name
+ printf "%s", $varindent
+ printvarval $arg0
+end
+document printvar
+ printvar VARPTR
+ prints the variable information contained in a net-snmp struct
+ variable. printvarval POINTER will print it's oid, value type and
+ value contents
+end
+
+define printvars
+ set $tmpcount = 1
+ set $tmpvar = $arg0
+ set $varindent = " "
+ while $tmpvar != 0
+ printf "VARIABLE #%d\n", $tmpcount
+ printvar $tmpvar
+ set $tmpvar = $tmpvar->next_variable
+ set $tmpcount = $tmpcount + 1
+ end
+ set $varindent = ""
+end
+document printvars
+ printvars VARPTR
+ calls printvar repeatedly on a chain of variables, displaying all
+ the variables in a net-snmp struct variable chain.
+end
+
+define printoid
+ set $printoid_tmp = 0
+ while $printoid_tmp < $arg0
+ printf ".%d", $arg1[$printoid_tmp]
+ set $printoid_tmp = $printoid_tmp + 1
+ end
+ printf "\n"
+end
+document printoid
+ printoid LENGTH OIDPTR
+ prints an oid (.x.y.z...) given it's length and a pointer.
+end
+
+define poid
+ printoid $arg0_len $arg0
+end
+document poid
+ poid NAME
+ shorthand for 'printoid NAME_len NAME"
+end
+
+define poidl
+ printoid $arg0_length $arg0
+end
+document poidl
+ poid NAME
+ shorthand for 'printoid NAME_length NAME"
+end
+
+define printindex
+ printoid $arg0->len $arg0->oids
+end
+document printindex
+ printindex NETSNMP_INDEX_PTR
+ prints the OID contained in a netsnmp_index struct variable.
+end
+
diff --git a/doxygen.conf b/doxygen.conf
new file mode 100644
index 0000000..20e457d
--- /dev/null
+++ b/doxygen.conf
@@ -0,0 +1,838 @@
+# Doxyfile 1.2.11
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# 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 = net-snmp
+
+# 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 = $(VERSION)
+
+# 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
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Brazilian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French,
+# German, Hungarian, Italian, Japanese, Korean, Norwegian, Polish,
+# Portuguese, Romanian, Russian, Slovak, Slovene, Spanish and Swedish.
+
+OUTPUT_LANGUAGE = English
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these class will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH =
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a class diagram (in Html and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off.
+
+CLASS_DIAGRAMS = YES
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower case letters. If set to YES upper case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# users are adviced to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explict @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# reimplements.
+
+INHERIT_DOCS = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consist of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C.
+# For instance some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text.
+
+WARN_FORMAT =
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# 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 = $(srcdir) $(srcdir)/agent $(srcdir)/snmplib $(srcdir)/agent/helpers $(srcdir)/agent/mibgroup/examples $(srcdir)/include/net-snmp $(srcdir)/include/net-snmp/library $(srcdir)/include/net-snmp/agent
+
+# 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 =
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH = $(srcdir)/agent/mibgroup/examples
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_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.
+
+EXAMPLE_PATTERNS =
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse.
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT =
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the Html help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript and frames is required (for instance Netscape 4.0+
+# or Internet explorer 4.0+).
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT =
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimised for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT =
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assigments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT =
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION =
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_XML = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed.
+
+PREDEFINED = HAVE_STDARG_H
+
+# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line and do not end with a semicolon. Such function macros are typically
+# used for boiler-plate code, and will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermedate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
+
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
+
+CGI_NAME =
+
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
+# details.
+
+CGI_URL =
+
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL =
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
+
+DOC_ABSPATH =
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
+
+BIN_ABSPATH =
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS =
diff --git a/include/net-snmp/agent/agent_callbacks.h b/include/net-snmp/agent/agent_callbacks.h
new file mode 100644
index 0000000..d8e8b47
--- /dev/null
+++ b/include/net-snmp/agent/agent_callbacks.h
@@ -0,0 +1,21 @@
+#ifndef AGENT_CALLBACKS_H
+#define AGENT_CALLBACKS_H
+
+#define SNMPD_CALLBACK_ACM_CHECK 0
+#define SNMPD_CALLBACK_REGISTER_OID 1
+#define SNMPD_CALLBACK_UNREGISTER_OID 2
+#define SNMPD_CALLBACK_REG_SYSOR 3
+#define SNMPD_CALLBACK_UNREG_SYSOR 4
+#define SNMPD_CALLBACK_ACM_CHECK_INITIAL 5
+#define SNMPD_CALLBACK_SEND_TRAP1 6
+#define SNMPD_CALLBACK_SEND_TRAP2 7
+#define SNMPD_CALLBACK_REGISTER_NOTIFICATIONS 8
+#define SNMPD_CALLBACK_PRE_UPDATE_CONFIG 9
+#define SNMPD_CALLBACK_INDEX_START 10
+#define SNMPD_CALLBACK_INDEX_STOP 11
+#define SNMPD_CALLBACK_ACM_CHECK_SUBTREE 12
+#define SNMPD_CALLBACK_REQ_REG_SYSOR 13
+#define SNMPD_CALLBACK_REQ_UNREG_SYSOR 14
+#define SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS 15
+
+#endif /* AGENT_CALLBACKS_H */
diff --git a/include/net-snmp/agent/agent_handler.h b/include/net-snmp/agent/agent_handler.h
new file mode 100644
index 0000000..ec930fe
--- /dev/null
+++ b/include/net-snmp/agent/agent_handler.h
@@ -0,0 +1,283 @@
+/* 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.
+ */
+#ifndef AGENT_HANDLER_H
+#define AGENT_HANDLER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file agent_handler.h
+ *
+ * @addtogroup handler
+ *
+ * @{
+ */
+
+struct netsnmp_handler_registration_s;
+
+/*
+ * per mib handler flags.
+ * NOTE: Lower bits are reserved for the agent handler's use.
+ * The high 4 bits (31-28) are reserved for use by the handler.
+ */
+#define MIB_HANDLER_AUTO_NEXT 0x00000001
+#define MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE 0x00000002
+#define MIB_HANDLER_INSTANCE 0x00000004
+
+#define MIB_HANDLER_CUSTOM4 0x10000000
+#define MIB_HANDLER_CUSTOM3 0x20000000
+#define MIB_HANDLER_CUSTOM2 0x40000000
+#define MIB_HANDLER_CUSTOM1 0x80000000
+
+
+/** @typedef struct netsnmp_mib_handler_s netsnmp_mib_handler
+ * Typedefs the netsnmp_mib_handler_s struct into netsnmp_mib_handler */
+
+/** @struct netsnmp_mib_handler_s
+ * the mib handler structure to be registered
+ */
+typedef struct netsnmp_mib_handler_s {
+ char *handler_name;
+ /** for handler's internal use */
+ void *myvoid;
+ /** for agent_handler's internal use */
+ int flags;
+
+ /** if you add more members, you probably also want to update */
+ /** _clone_handler in agent_handler.c. */
+
+ int (*access_method) (struct netsnmp_mib_handler_s *,
+ struct
+ netsnmp_handler_registration_s *,
+ struct
+ netsnmp_agent_request_info_s *,
+ struct netsnmp_request_info_s *);
+ /** data clone hook for myvoid
+ * deep copy the myvoid member - default is to copy the pointer
+ * This method is only called if myvoid != NULL
+ * myvoid is the current myvoid pointer.
+ * returns NULL on failure
+ */
+ void *(*data_clone)(void *myvoid);
+ /** data free hook for myvoid
+ * delete the myvoid member - default is to do nothing
+ * This method is only called if myvoid != NULL
+ */
+ void (*data_free)(void *myvoid); /**< data free hook for myvoid */
+
+ struct netsnmp_mib_handler_s *next;
+ struct netsnmp_mib_handler_s *prev;
+} netsnmp_mib_handler;
+
+/*
+ * per registration flags
+ */
+#define HANDLER_CAN_GETANDGETNEXT 0x01 /* must be able to do both */
+#define HANDLER_CAN_SET 0x02 /* implies create, too */
+#define HANDLER_CAN_GETBULK 0x04
+#define HANDLER_CAN_NOT_CREATE 0x08 /* auto set if ! CAN_SET */
+#define HANDLER_CAN_BABY_STEP 0x10
+#define HANDLER_CAN_STASH 0x20
+
+
+#define HANDLER_CAN_RONLY (HANDLER_CAN_GETANDGETNEXT)
+#define HANDLER_CAN_RWRITE (HANDLER_CAN_GETANDGETNEXT | HANDLER_CAN_SET)
+#define HANDLER_CAN_SET_ONLY (HANDLER_CAN_SET | HANDLER_CAN_NOT_CREATE)
+#define HANDLER_CAN_DEFAULT (HANDLER_CAN_RONLY | HANDLER_CAN_NOT_CREATE)
+
+/** @typedef struct netsnmp_handler_registration_s netsnmp_handler_registration
+ * Typedefs the netsnmp_handler_registration_s struct into netsnmp_handler_registration */
+
+/** @struct netsnmp_handler_registration_s
+ * Root registration info.
+ * The variables handlerName, contextName, and rootoid need to be allocated
+ * on the heap, when the registration structure is unregistered using
+ * unregister_mib_context() the code attempts to free them.
+ */
+typedef struct netsnmp_handler_registration_s {
+
+ /** for mrTable listings, and other uses */
+ char *handlerName;
+ /** NULL = default context */
+ char *contextName;
+
+ /**
+ * where are we registered at?
+ */
+ oid *rootoid;
+ size_t rootoid_len;
+
+ /**
+ * handler details
+ */
+ netsnmp_mib_handler *handler;
+ int modes;
+
+ /**
+ * more optional stuff
+ */
+ int priority;
+ int range_subid;
+ oid range_ubound;
+ int timeout;
+ int global_cacheid;
+
+ /**
+ * void ptr for registeree
+ */
+ void * my_reg_void;
+
+} netsnmp_handler_registration;
+
+/*
+ * function handler definitions
+ */
+
+typedef int (Netsnmp_Node_Handler) (netsnmp_mib_handler *handler,
+ /** pointer to registration struct */
+ netsnmp_handler_registration *reginfo,
+ /** pointer to current transaction */
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+ typedef struct netsnmp_handler_args_s {
+ netsnmp_mib_handler *handler;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_agent_request_info *reqinfo;
+ netsnmp_request_info *requests;
+ } netsnmp_handler_args;
+
+ typedef struct netsnmp_delegated_cache_s {
+ int transaction_id;
+ netsnmp_mib_handler *handler;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_agent_request_info *reqinfo;
+ netsnmp_request_info *requests;
+ void *localinfo;
+ } netsnmp_delegated_cache;
+
+ /*
+ * handler API functions
+ */
+ void netsnmp_init_handler_conf(void);
+ int netsnmp_register_handler(netsnmp_handler_registration
+ *reginfo);
+ int netsnmp_unregister_handler(netsnmp_handler_registration
+ *reginfo);
+ int
+ netsnmp_register_handler_nocallback(netsnmp_handler_registration
+ *reginfo);
+ int netsnmp_inject_handler(netsnmp_handler_registration
+ *reginfo,
+ netsnmp_mib_handler *handler);
+ int
+ netsnmp_inject_handler_before(netsnmp_handler_registration *reginfo,
+ netsnmp_mib_handler *handler,
+ const char *before_what);
+ netsnmp_mib_handler
+ *netsnmp_find_handler_by_name(netsnmp_handler_registration
+ *reginfo, const char *name);
+ void
+ *netsnmp_find_handler_data_by_name(netsnmp_handler_registration
+ *reginfo, const char *name);
+ int netsnmp_call_handlers(netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests);
+ int netsnmp_call_handler(netsnmp_mib_handler *next_handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests);
+ int netsnmp_call_next_handler(netsnmp_mib_handler *current,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests);
+ 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_mib_handler *netsnmp_create_handler(const char *name,
+ Netsnmp_Node_Handler *
+ handler_access_method);
+ netsnmp_handler_registration *
+ netsnmp_handler_registration_create(const char *name,
+ netsnmp_mib_handler *handler,
+ const oid * reg_oid, size_t reg_oid_len,
+ int modes);
+ netsnmp_handler_registration *
+ netsnmp_create_handler_registration(const char *name, Netsnmp_Node_Handler*
+ handler_access_method,
+ const oid *reg_oid, size_t reg_oid_len,
+ int modes);
+
+ netsnmp_delegated_cache
+ *netsnmp_create_delegated_cache(netsnmp_mib_handler *,
+ netsnmp_handler_registration *,
+ netsnmp_agent_request_info *,
+ netsnmp_request_info *, void *);
+ void netsnmp_free_delegated_cache(netsnmp_delegated_cache *dcache);
+ netsnmp_delegated_cache
+ *netsnmp_handler_check_cache(netsnmp_delegated_cache *dcache);
+ void netsnmp_register_handler_by_name(const char *,
+ netsnmp_mib_handler
+ *);
+
+ void netsnmp_clear_handler_list(void);
+
+ void
+ netsnmp_request_add_list_data(netsnmp_request_info *request,
+ netsnmp_data_list *node);
+ int netsnmp_request_remove_list_data(netsnmp_request_info *request,
+ const char *name);
+
+ int
+ netsnmp_request_remove_list_data(netsnmp_request_info *request,
+ const char *name);
+
+ void *netsnmp_request_get_list_data(netsnmp_request_info
+ *request,
+ const char *name);
+
+ void
+ netsnmp_free_request_data_set(netsnmp_request_info *request);
+
+ void
+ netsnmp_free_request_data_sets(netsnmp_request_info *request);
+
+ void netsnmp_handler_free(netsnmp_mib_handler *);
+ netsnmp_mib_handler *netsnmp_handler_dup(netsnmp_mib_handler *);
+ netsnmp_handler_registration
+ *netsnmp_handler_registration_dup(netsnmp_handler_registration *);
+ void
+ netsnmp_handler_registration_free(netsnmp_handler_registration *);
+
+#define REQUEST_IS_DELEGATED 1
+#define REQUEST_IS_NOT_DELEGATED 0
+ void
+ netsnmp_handler_mark_requests_as_delegated(netsnmp_request_info *,
+ int);
+ void *netsnmp_handler_get_parent_data(netsnmp_request_info *,
+ const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AGENT_HANDLER_H */
+/** @} */
diff --git a/include/net-snmp/agent/agent_index.h b/include/net-snmp/agent/agent_index.h
new file mode 100644
index 0000000..49ee7fd
--- /dev/null
+++ b/include/net-snmp/agent/agent_index.h
@@ -0,0 +1,46 @@
+#ifndef AGENT_INDEX_H
+#define AGENT_INDEX_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ALLOCATE_THIS_INDEX 0x0
+#define ALLOCATE_ANY_INDEX 0x1
+#define ALLOCATE_NEW_INDEX 0x3
+ /*
+ * N.B: it's deliberate that NEW_INDEX & ANY_INDEX == ANY_INDEX
+ */
+
+#define ANY_INTEGER_INDEX -1
+#define ANY_STRING_INDEX NULL
+#define ANY_OID_INDEX NULL
+
+#define INDEX_ERR_GENERR -1
+#define INDEX_ERR_WRONG_TYPE -2
+#define INDEX_ERR_NOT_ALLOCATED -3
+#define INDEX_ERR_WRONG_SESSION -4
+
+char *register_string_index(oid *, size_t, char *);
+int register_int_index(oid *, size_t, int);
+netsnmp_variable_list *register_oid_index(oid *, size_t, oid *, size_t);
+netsnmp_variable_list *register_index(netsnmp_variable_list *, int,
+ netsnmp_session *);
+
+int unregister_string_index(oid *, size_t, char *);
+int unregister_int_index(oid *, size_t, int);
+int unregister_oid_index(oid *, size_t, oid *, size_t);
+
+int release_index(netsnmp_variable_list *);
+int remove_index(netsnmp_variable_list *, netsnmp_session *);
+void unregister_index_by_session(netsnmp_session *);
+int unregister_index(netsnmp_variable_list *, int,
+ netsnmp_session *);
+
+unsigned long count_indexes(oid * name, size_t namelen,
+ int include_unallocated);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AGENT_INDEX_H */
diff --git a/include/net-snmp/agent/agent_read_config.h b/include/net-snmp/agent/agent_read_config.h
new file mode 100644
index 0000000..e6b3540
--- /dev/null
+++ b/include/net-snmp/agent/agent_read_config.h
@@ -0,0 +1,31 @@
+/*
+ * agent_read_config.h: reads configuration files for extensible sections.
+ *
+ */
+#ifndef _AGENT_READ_CONFIG_H
+#define _AGENT_READ_CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ void init_agent_read_config(const char *);
+ void update_config(void);
+ void snmpd_register_config_handler(const char *token,
+ void (*parser) (const
+ char *,
+ char *),
+ void (*releaser) (void),
+ const char *help);
+ void snmpd_register_const_config_handler(
+ const char *,
+ void (*parser) (const char *, const char *),
+ void (*releaser) (void),
+ const char *);
+ void snmpd_unregister_config_handler(const char *);
+ void snmpd_store_config(const char *);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _AGENT_READ_CONFIG_H */
diff --git a/include/net-snmp/agent/agent_registry.h b/include/net-snmp/agent/agent_registry.h
new file mode 100644
index 0000000..6a907bf
--- /dev/null
+++ b/include/net-snmp/agent/agent_registry.h
@@ -0,0 +1,184 @@
+#ifndef AGENT_REGISTRY_H
+#define AGENT_REGISTRY_H
+
+/***********************************************************************/
+/*
+ * new version2 agent handler API structures
+ */
+/***********************************************************************/
+
+#include <net-snmp/agent/snmp_agent.h>
+#include <net-snmp/library/fd_event_manager.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/***********************************************************************/
+ /*
+ * requests api definitions
+ */
+/***********************************************************************/
+
+ /*
+ * the structure of parameters passed to registered ACM modules
+ */
+struct view_parameters {
+ netsnmp_pdu *pdu;
+ oid *name;
+ size_t namelen;
+ int test;
+ int errorcode; /* Do not change unless you're
+ specifying an error, as it starts
+ in a success state. */
+ int check_subtree;
+};
+
+struct register_parameters {
+ oid *name;
+ size_t namelen;
+ int priority;
+ int range_subid;
+ oid range_ubound;
+ int timeout;
+ u_char flags;
+ const char *contextName;
+ netsnmp_session *session;
+ netsnmp_handler_registration *reginfo;
+};
+
+typedef struct subtree_context_cache_s {
+ const char *context_name;
+ struct netsnmp_subtree_s *first_subtree;
+ struct subtree_context_cache_s *next;
+} subtree_context_cache;
+
+
+
+void setup_tree (void);
+void shutdown_tree (void);
+
+
+netsnmp_subtree *netsnmp_subtree_find (const oid *, size_t,
+ netsnmp_subtree *,
+ const char *context_name);
+
+netsnmp_subtree *netsnmp_subtree_find_next(const oid *, size_t,
+ netsnmp_subtree *,
+ const char *context_name);
+
+netsnmp_subtree *netsnmp_subtree_find_prev(const oid *, size_t,
+ netsnmp_subtree *,
+ const char *context_name);
+
+netsnmp_subtree *netsnmp_subtree_find_first(const char *context_name);
+
+netsnmp_session *get_session_for_oid (const oid *, size_t,
+ const char *context_name);
+
+subtree_context_cache *get_top_context_cache(void);
+
+void netsnmp_set_lookup_cache_size(int newsize);
+int netsnmp_get_lookup_cache_size(void);
+
+#define MIB_REGISTERED_OK 0
+#define MIB_DUPLICATE_REGISTRATION -1
+#define MIB_REGISTRATION_FAILED -2
+#define MIB_UNREGISTERED_OK 0
+#define MIB_NO_SUCH_REGISTRATION -1
+#define MIB_UNREGISTRATION_FAILED -2
+#define DEFAULT_MIB_PRIORITY 127
+
+int register_mib (const char *, struct variable *,
+ size_t, size_t, const oid *,
+ size_t);
+
+int register_mib_priority (const char *, struct variable *,
+ size_t, size_t, const oid *, size_t,
+ int);
+
+int register_mib_range (const char *, struct variable *,
+ size_t, size_t, const oid *,
+ size_t, int, int, oid,
+ netsnmp_session *);
+
+int register_mib_context (const char *, struct variable *,
+ size_t, size_t, const oid *, size_t,
+ int, int, oid, netsnmp_session *,
+ const char *, int, int);
+
+int netsnmp_register_mib_table_row (const char *, struct variable *,
+ size_t, size_t, oid *,
+ size_t, int, int, netsnmp_session *,
+ const char *, int, int);
+
+int unregister_mib (oid *, size_t);
+
+int unregister_mib_priority (oid *, size_t, int);
+int unregister_mib_range (oid *, size_t, int, int, oid);
+int unregister_mib_context (oid *, size_t, int, int, oid,
+ const char *);
+void clear_context (void);
+void unregister_mibs_by_session (netsnmp_session *);
+int netsnmp_unregister_mib_table_row (oid *mibloc, size_t mibloclen,
+ int priority, int var_subid,
+ oid range_ubound,
+ const char *context);
+
+int compare_tree (const oid *, size_t,
+ const oid *, size_t);
+int in_a_view (oid *, size_t *,
+ netsnmp_pdu *, int);
+int check_access (netsnmp_pdu *pdu);
+int netsnmp_acm_check_subtree (netsnmp_pdu *, oid *, size_t);
+void register_mib_reattach (void);
+void register_mib_detach (void);
+
+/*
+ * REGISTER_MIB(): This macro simply loads register_mib with less pain:
+ *
+ * descr: A short description of the mib group being loaded.
+ * var: The variable structure to load.
+ * vartype: The variable structure used to define it (variable[2, 4, ...])
+ * theoid: An *initialized* *exact length* oid pointer.
+ * (sizeof(theoid) *must* return the number of elements!)
+ */
+
+#define REGISTER_MIB(descr, var, vartype, theoid) \
+ if (register_mib(descr, (struct variable *) var, sizeof(struct vartype), \
+ sizeof(var)/sizeof(struct vartype), \
+ theoid, sizeof(theoid)/sizeof(oid)) != MIB_REGISTERED_OK ) \
+ DEBUGMSGTL(("register_mib", "%s registration failed\n", descr));
+
+
+#define NUM_EXTERNAL_SIGS 32
+#define SIG_REGISTERED_OK 0
+#define SIG_REGISTRATION_FAILED -2
+#define SIG_UNREGISTERED_OK 0
+
+extern int external_signal_scheduled[NUM_EXTERNAL_SIGS];
+extern void (*external_signal_handler[NUM_EXTERNAL_SIGS])(int);
+
+int register_signal(int, void (*func)(int));
+int unregister_signal(int);
+
+
+
+/*
+ * internal API. Don't use this. Use netsnmp_register_handler instead
+ */
+
+struct netsnmp_handler_registration_s;
+
+int netsnmp_register_mib(const char *, struct variable *,
+ size_t, size_t, oid *, size_t,
+ int, int, oid, netsnmp_session *,
+ const char *, int, int,
+ struct netsnmp_handler_registration_s *,
+ int);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AGENT_REGISTRY_H */
diff --git a/include/net-snmp/agent/agent_sysORTable.h b/include/net-snmp/agent/agent_sysORTable.h
new file mode 100644
index 0000000..5626e4a
--- /dev/null
+++ b/include/net-snmp/agent/agent_sysORTable.h
@@ -0,0 +1,28 @@
+#ifndef AGENT_SYSORTABLE_H
+#define AGENT_SYSORTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct sysORTable;
+
+extern void init_agent_sysORTable(void);
+extern void shutdown_agent_sysORTable(void);
+
+extern void netsnmp_sysORTable_foreach(void (*)(const struct sysORTable*,
+ void*),
+ void*);
+
+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 *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AGENT_SYSORTABLE_H */
diff --git a/include/net-snmp/agent/agent_trap.h b/include/net-snmp/agent/agent_trap.h
new file mode 100644
index 0000000..26e2223
--- /dev/null
+++ b/include/net-snmp/agent/agent_trap.h
@@ -0,0 +1,54 @@
+#ifndef AGENT_TRAP_H
+#define AGENT_TRAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct agent_add_trap_args {
+ netsnmp_session *ss;
+ int confirm;
+};
+
+void init_traps(void);
+void send_easy_trap(int, int);
+void send_trap_pdu(netsnmp_pdu *);
+void send_v2trap(netsnmp_variable_list *);
+void send_v3trap(netsnmp_variable_list *vars, const char *context);
+void send_trap_vars(int, int, netsnmp_variable_list *);
+void send_trap_vars_with_context(int trap, int specific,
+ netsnmp_variable_list *vars,
+ const char *context);
+void send_enterprise_trap_vars(int trap, int specific,
+ const oid * enterprise,
+ int enterprise_length,
+ netsnmp_variable_list * vars);
+int netsnmp_send_traps(int trap, int specific,
+ const oid * enterprise, int enterprise_length,
+ netsnmp_variable_list * vars,
+ /* flags are currently unused */
+ const char * context, int flags);
+void snmpd_parse_config_authtrap(const char *, char *);
+void snmpd_parse_config_trapsink(const char *, char *);
+void snmpd_parse_config_trap2sink(const char *, char *);
+void snmpd_parse_config_informsink(const char *, char *);
+void snmpd_parse_config_trapsess(const char *, char *);
+void snmpd_free_trapsinks(void);
+void snmpd_parse_config_trapcommunity(const char *, char *);
+void snmpd_free_trapcommunity(void);
+void send_trap_to_sess(netsnmp_session * sess,
+ netsnmp_pdu *template_pdu);
+
+int create_trap_session(char *, u_short, char *, int, int);
+int add_trap_session(netsnmp_session *, int, int, int);
+int remove_trap_session(netsnmp_session *);
+
+void convert_v2_to_v1(netsnmp_variable_list *, netsnmp_pdu *);
+netsnmp_variable_list *convert_v1_to_v2(netsnmp_pdu *);
+netsnmp_pdu *convert_v2pdu_to_v1(netsnmp_pdu *);
+netsnmp_pdu *convert_v1pdu_to_v2(netsnmp_pdu *);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AGENT_TRAP_H */
diff --git a/include/net-snmp/agent/all_helpers.h b/include/net-snmp/agent/all_helpers.h
new file mode 100644
index 0000000..d0d5c22
--- /dev/null
+++ b/include/net-snmp/agent/all_helpers.h
@@ -0,0 +1,43 @@
+#ifndef ALL_HANDLERS_H
+#define ALL_HANDLERS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/agent/instance.h>
+#include <net-snmp/agent/baby_steps.h>
+#include <net-snmp/agent/scalar.h>
+#include <net-snmp/agent/scalar_group.h>
+#include <net-snmp/agent/watcher.h>
+#include <net-snmp/agent/multiplexer.h>
+#include <net-snmp/agent/null.h>
+#include <net-snmp/agent/debug_handler.h>
+#include <net-snmp/agent/cache_handler.h>
+#include <net-snmp/agent/old_api.h>
+#include <net-snmp/agent/read_only.h>
+#include <net-snmp/agent/row_merge.h>
+#include <net-snmp/agent/serialize.h>
+#include <net-snmp/agent/bulk_to_next.h>
+#include <net-snmp/agent/mode_end_call.h>
+/*
+ * #include <net-snmp/agent/set_helper.h>
+ */
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_data.h>
+#include <net-snmp/agent/table_dataset.h>
+#include <net-snmp/agent/table_tdata.h>
+#include <net-snmp/agent/table_iterator.h>
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/agent/table_array.h>
+
+#include <net-snmp/agent/mfd.h>
+#include <net-snmp/agent/snmp_get_statistic.h>
+
+
+void netsnmp_init_helpers(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ALL_HANDLERS_H */
diff --git a/include/net-snmp/agent/auto_nlist.h b/include/net-snmp/agent/auto_nlist.h
new file mode 100644
index 0000000..21b6b8c
--- /dev/null
+++ b/include/net-snmp/agent/auto_nlist.h
@@ -0,0 +1,28 @@
+/*
+ * auto_nlist.h
+ */
+#ifndef AUTO_NLIST_H
+#define AUTO_NLIST_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(irix6) && defined(IRIX64)
+#define nlist nlist64
+#endif
+
+#ifdef NETSNMP_CAN_USE_NLIST
+int auto_nlist(const char *, char *, size_t);
+long auto_nlist_value(const char *);
+int KNLookup(struct nlist *, int, char *, size_t);
+#else
+int auto_nlist_noop(void);
+# define auto_nlist(x,y,z) auto_nlist_noop()
+# define auto_nlist_value(z) auto_nlist_noop()
+# define KNLookup(w,x,y,z) auto_nlist_noop()
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/baby_steps.h b/include/net-snmp/agent/baby_steps.h
new file mode 100644
index 0000000..d256550
--- /dev/null
+++ b/include/net-snmp/agent/baby_steps.h
@@ -0,0 +1,117 @@
+/*
+ * $Id$
+ */
+#ifndef BABY_STEPS_H
+#define BABY_STEPS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/agent/agent_handler.h>
+
+ /*
+ * Flags for baby step modes
+ */
+#define BABY_STEP_NONE 0
+#define BABY_STEP_PRE_REQUEST (0x1 << 1)
+#define BABY_STEP_OBJECT_LOOKUP (0x1 << 2)
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#define BABY_STEP_CHECK_VALUE (0x1 << 3)
+#define BABY_STEP_ROW_CREATE (0x1 << 4)
+#define BABY_STEP_UNDO_SETUP (0x1 << 5)
+#define BABY_STEP_SET_VALUE (0x1 << 6)
+#define BABY_STEP_CHECK_CONSISTENCY (0x1 << 7)
+#define BABY_STEP_UNDO_SET (0x1 << 8)
+#define BABY_STEP_COMMIT (0x1 << 9)
+#define BABY_STEP_UNDO_COMMIT (0x1 << 10)
+#define BABY_STEP_IRREVERSIBLE_COMMIT (0x1 << 11)
+#define BABY_STEP_UNDO_CLEANUP (0x1 << 12)
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+#define BABY_STEP_POST_REQUEST (0x1 << 13)
+
+#define BABY_STEP_ALL (0xffffffff)
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#define BABY_STEP_CHECK_OBJECT BABY_STEP_CHECK_VALUE
+#define BABY_STEP_SET_VALUES BABY_STEP_SET_VALUE
+#define BABY_STEP_UNDO_SETS BABY_STEP_UNDO_SET
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/** @name baby_steps
+ *
+ * This helper expands the original net-snmp set modes into the newer, finer
+ * grained modes.
+ *
+ * @{ */
+
+ typedef struct netsnmp_baby_steps_modes_s {
+ /** Number of handlers whose myvoid pointer points at this object. */
+ int refcnt;
+ u_int registered;
+ u_int completed;
+ } netsnmp_baby_steps_modes;
+
+void netsnmp_baby_steps_init(void);
+
+netsnmp_mib_handler *netsnmp_baby_steps_handler_get(u_long modes);
+
+/** @} */
+
+
+/** @name access_multiplexer
+ *
+ * This helper calls individual access methods based on the mode. All
+ * access methods share the same handler, and the same myvoid pointer.
+ * If you need individual myvoid pointers, check out the multiplexer
+ * handler (though it currently only works for traditional modes).
+ *
+ * @{ */
+
+/** @struct netsnmp_mib_handler_access_methods
+ * Defines the access methods to be called by the access_multiplexer helper
+ */
+typedef struct netsnmp_baby_steps_access_methods_s {
+
+ /*
+ * baby step modes
+ */
+ Netsnmp_Node_Handler *pre_request;
+ Netsnmp_Node_Handler *object_lookup;
+ Netsnmp_Node_Handler *get_values;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ Netsnmp_Node_Handler *object_syntax_checks;
+ Netsnmp_Node_Handler *row_creation;
+ Netsnmp_Node_Handler *undo_setup;
+ Netsnmp_Node_Handler *set_values;
+ Netsnmp_Node_Handler *consistency_checks;
+ Netsnmp_Node_Handler *commit;
+ Netsnmp_Node_Handler *undo_sets;
+ Netsnmp_Node_Handler *undo_cleanup;
+ Netsnmp_Node_Handler *undo_commit;
+ Netsnmp_Node_Handler *irreversible_commit;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ Netsnmp_Node_Handler *post_request;
+
+ void *my_access_void;
+
+} netsnmp_baby_steps_access_methods;
+
+ netsnmp_mib_handler * netsnmp_baby_steps_access_multiplexer_get(
+ netsnmp_baby_steps_access_methods *);
+
+ int netsnmp_baby_step_mode2flag( u_int mode );
+
+/** @} */
+
+
+/** backwards compatability. don't use in new code */
+#define netsnmp_get_baby_steps_handler netsnmp_baby_steps_handler_get
+#define netsnmp_init_baby_steps_helper netsnmp_baby_steps_handler_init
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* baby_steps */
diff --git a/include/net-snmp/agent/bulk_to_next.h b/include/net-snmp/agent/bulk_to_next.h
new file mode 100644
index 0000000..b578da5
--- /dev/null
+++ b/include/net-snmp/agent/bulk_to_next.h
@@ -0,0 +1,28 @@
+/*
+ * bulk_to_next.h
+ */
+#ifndef BULK_TO_NEXT_H
+#define BULK_TO_NEXT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*
+ * The helper merely intercepts GETBULK requests and converts them to
+ * * GETNEXT reequests.
+ */
+
+
+netsnmp_mib_handler *netsnmp_get_bulk_to_next_handler(void);
+void netsnmp_init_bulk_to_next_helper(void);
+void netsnmp_bulk_to_next_fix_requests(netsnmp_request_info
+ *requests);
+
+Netsnmp_Node_Handler netsnmp_bulk_to_next_helper;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/cache_handler.h b/include/net-snmp/agent/cache_handler.h
new file mode 100644
index 0000000..1e4751c
--- /dev/null
+++ b/include/net-snmp/agent/cache_handler.h
@@ -0,0 +1,130 @@
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#ifndef NETSNMP_CACHE_HANDLER_H
+#define NETSNMP_CACHE_HANDLER_H
+
+/*
+ * This caching helper provides a generalised (SNMP-manageable) caching
+ * mechanism. Individual SNMP table and scalar/scalar group MIB
+ * implementations can use data caching in a consistent manner, without
+ * needing to handle the generic caching details themselves.
+ */
+
+#include <net-snmp/library/tools.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define CACHE_NAME "cache_info"
+
+ typedef struct netsnmp_cache_s netsnmp_cache;
+
+ typedef int (NetsnmpCacheLoad)(netsnmp_cache *, void*);
+ typedef void (NetsnmpCacheFree)(netsnmp_cache *, void*);
+
+ struct netsnmp_cache_s {
+ /** Number of handlers whose myvoid member points at this structure. */
+ int refcnt;
+ /*
+ * For operation of the data caches
+ */
+ int flags;
+ int enabled;
+ int valid;
+ char expired;
+ int timeout; /* Length of time the cache is valid (in s) */
+ marker_t timestampM; /* When the cache was last loaded */
+ u_long timer_id; /* periodic timer id */
+
+ NetsnmpCacheLoad *load_cache;
+ NetsnmpCacheFree *free_cache;
+
+ /*
+ * void pointer for the user that created the cache.
+ * You never know when it might not come in useful ....
+ */
+ void *magic;
+
+ /*
+ * hint from the cache helper. contains the standard
+ * handler arguments.
+ */
+ netsnmp_handler_args *cache_hint;
+
+ /*
+ * For SNMP-management of the data caches
+ */
+ netsnmp_cache *next, *prev;
+ oid *rootoid;
+ int rootoid_len;
+
+ };
+
+
+ void netsnmp_cache_reqinfo_insert(netsnmp_cache* cache,
+ netsnmp_agent_request_info * reqinfo,
+ const char *name);
+ netsnmp_cache *
+ netsnmp_cache_reqinfo_extract(netsnmp_agent_request_info * reqinfo,
+ const char *name);
+ netsnmp_cache* netsnmp_extract_cache_info(netsnmp_agent_request_info *);
+
+ int netsnmp_cache_check_and_reload(netsnmp_cache * cache);
+ int netsnmp_cache_check_expired(netsnmp_cache *cache);
+ int netsnmp_cache_is_valid( netsnmp_agent_request_info *,
+ const char *name);
+ /** for backwards compat */
+ int netsnmp_is_cache_valid( netsnmp_agent_request_info *);
+ netsnmp_mib_handler *netsnmp_get_cache_handler(int, NetsnmpCacheLoad *,
+ NetsnmpCacheFree *,
+ const oid*, int);
+ int netsnmp_register_cache_handler(netsnmp_handler_registration *reginfo,
+ int, NetsnmpCacheLoad *,
+ NetsnmpCacheFree *);
+
+ Netsnmp_Node_Handler netsnmp_cache_helper_handler;
+
+ netsnmp_cache *
+ netsnmp_cache_create(int timeout, NetsnmpCacheLoad * load_hook,
+ NetsnmpCacheFree * free_hook,
+ const oid * rootoid, int rootoid_len);
+ int netsnmp_cache_remove(netsnmp_cache *cache);
+ int netsnmp_cache_free(netsnmp_cache *cache);
+
+ netsnmp_mib_handler *
+ netsnmp_cache_handler_get(netsnmp_cache* cache);
+ void netsnmp_cache_handler_owns_cache(netsnmp_mib_handler *handler);
+
+ netsnmp_cache * netsnmp_cache_find_by_oid(const oid * rootoid,
+ int rootoid_len);
+
+ unsigned int netsnmp_cache_timer_start(netsnmp_cache *cache);
+ void netsnmp_cache_timer_stop(netsnmp_cache *cache);
+
+/*
+ * Flags affecting cache handler operation
+ */
+#define NETSNMP_CACHE_DONT_INVALIDATE_ON_SET 0x0001
+#define NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD 0x0002
+#define NETSNMP_CACHE_DONT_FREE_EXPIRED 0x0004
+#define NETSNMP_CACHE_DONT_AUTO_RELEASE 0x0008
+#define NETSNMP_CACHE_PRELOAD 0x0010
+#define NETSNMP_CACHE_AUTO_RELOAD 0x0020
+#define NETSNMP_CACHE_RESET_TIMER_ON_USE 0x0040
+
+#define NETSNMP_CACHE_HINT_HANDLER_ARGS 0x1000
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* NETSNMP_CACHE_HANDLER_H */
diff --git a/include/net-snmp/agent/debug_handler.h b/include/net-snmp/agent/debug_handler.h
new file mode 100644
index 0000000..0d612db
--- /dev/null
+++ b/include/net-snmp/agent/debug_handler.h
@@ -0,0 +1,16 @@
+#ifndef DEBUG_HANDLER_H
+#define DEBUG_HANDLER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+netsnmp_mib_handler *netsnmp_get_debug_handler(void);
+void netsnmp_init_debug_helper(void);
+
+Netsnmp_Node_Handler netsnmp_debug_helper;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DEBUG_HANDLER_H */
diff --git a/include/net-snmp/agent/ds_agent.h b/include/net-snmp/agent/ds_agent.h
new file mode 100644
index 0000000..f6f639d
--- /dev/null
+++ b/include/net-snmp/agent/ds_agent.h
@@ -0,0 +1,74 @@
+#ifndef NETSNMP_DS_AGENT_H
+#define NETSNMP_DS_AGENT_H
+/*
+ * defines agent's default store registrations
+ */
+/*
+ * Note:
+ * If new ds_agent entries are added to this header file,
+ * then remember to run 'perl/agent/default_store/gen' to
+ * update the corresponding perl interface.
+ */
+
+/*
+ * booleans
+ */
+#define NETSNMP_DS_AGENT_VERBOSE 0 /* 1 if verbose output desired */
+#define NETSNMP_DS_AGENT_ROLE 1 /* 0 if master, 1 if client */
+#define NETSNMP_DS_AGENT_NO_ROOT_ACCESS 2 /* 1 if we can't get root access */
+#define NETSNMP_DS_AGENT_AGENTX_MASTER 3 /* 1 if AgentX desired */
+#define NETSNMP_DS_AGENT_QUIT_IMMEDIATELY 4 /* 1 to never start the agent */
+#define NETSNMP_DS_AGENT_DISABLE_PERL 5 /* 1 to never enable perl */
+#define NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS 6 /* 1 = !see !connect msgs */
+#define NETSNMP_DS_AGENT_LEAVE_PIDFILE 7 /* 1 = leave PID file on exit */
+#define NETSNMP_DS_AGENT_NO_CACHING 8 /* 1 = disable netsnmp_cache */
+#define NETSNMP_DS_AGENT_STRICT_DISMAN 9 /* 1 = "correct" object ordering */
+#define NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS 10 /* 1 = disable trap logging */
+#define NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS 12 /* 1 = disable logging */
+#define NETSNMP_DS_APP_DONT_LOG NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS /* compat */
+#define NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES 13 /* 1 = don't store NFS entries in hrStorageTable */
+#define NETSNMP_DS_AGENT_REALSTORAGEUNITS 14 /* 1 = use real allocation units in hrStorageTable, 0 = recalculate it to fit 32bits */
+
+ /* Repeated from "apps/snmptrapd_ds.h" */
+#define NETSNMP_DS_APP_NUMERIC_IP 16
+#define NETSNMP_DS_APP_NO_AUTHORIZATION 17
+
+#define NETSNMP_DS_AGENT_DISKIO_NO_FD 18 /* 1 = don't report /dev/fd* entries in diskIOTable */
+#define NETSNMP_DS_AGENT_DISKIO_NO_LOOP 19 /* 1 = don't report /dev/loop* entries in diskIOTable */
+#define NETSNMP_DS_AGENT_DISKIO_NO_RAM 20 /* 1 = don't report /dev/ram* entries in diskIOTable */
+
+/* WARNING: The trap receiver also uses DS flags and must not conflict with these!
+ * If you define additional boolean entries, check in "apps/snmptrapd_ds.h" first */
+
+/*
+ * strings
+ */
+#define NETSNMP_DS_AGENT_PROGNAME 0 /* argv[0] */
+#define NETSNMP_DS_AGENT_X_SOCKET 1 /* AF_UNIX or ip:port socket addr */
+#define NETSNMP_DS_AGENT_PORTS 2 /* localhost:9161,tcp:localhost:9161... */
+#define NETSNMP_DS_AGENT_INTERNAL_SECNAME 3 /* used by disman/mteTriggerTable. */
+#define NETSNMP_DS_AGENT_PERL_INIT_FILE 4 /* used by embedded perl */
+#define NETSNMP_DS_SMUX_SOCKET 5 /* ip:port socket addr */
+#define NETSNMP_DS_NOTIF_LOG_CTX 6 /* "" | "snmptrapd" */
+#define NETSNMP_DS_AGENT_TRAP_ADDR 7 /* used as v1 trap agent address */
+
+/*
+ * integers
+ */
+#define NETSNMP_DS_AGENT_FLAGS 0 /* session.flags */
+#define NETSNMP_DS_AGENT_USERID 1
+#define NETSNMP_DS_AGENT_GROUPID 2
+#define NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL 3 /* ping master every SECONDS */
+#define NETSNMP_DS_AGENT_AGENTX_TIMEOUT 4
+#define NETSNMP_DS_AGENT_AGENTX_RETRIES 5
+#define NETSNMP_DS_AGENT_X_SOCK_PERM 6 /* permissions for the */
+#define NETSNMP_DS_AGENT_X_DIR_PERM 7 /* AgentX socket */
+#define NETSNMP_DS_AGENT_X_SOCK_USER 8 /* ownership for the */
+#define NETSNMP_DS_AGENT_X_SOCK_GROUP 9 /* AgentX socket */
+#define NETSNMP_DS_AGENT_CACHE_TIMEOUT 10 /* default cache timeout */
+#define NETSNMP_DS_AGENT_INTERNAL_VERSION 11 /* used by internal queries */
+#define NETSNMP_DS_AGENT_INTERNAL_SECLEVEL 12 /* used by internal queries */
+#define NETSNMP_DS_AGENT_MAX_GETBULKREPEATS 13 /* max getbulk repeats */
+#define NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES 14 /* max getbulk respones */
+
+#endif
diff --git a/include/net-snmp/agent/hardware/cpu.h b/include/net-snmp/agent/hardware/cpu.h
new file mode 100644
index 0000000..f6e43e5
--- /dev/null
+++ b/include/net-snmp/agent/hardware/cpu.h
@@ -0,0 +1,68 @@
+typedef struct netsnmp_cpu_info_s netsnmp_cpu_info;
+extern int cpu_num;
+
+ /* For rolling averages */
+struct netsnmp_cpu_history {
+ unsigned long long user_hist;
+ unsigned long long sys_hist;
+ unsigned long long idle_hist;
+ unsigned long long nice_hist;
+ unsigned long long total_hist;
+
+ unsigned long long ctx_hist;
+ unsigned long long intr_hist;
+ unsigned long long swpi_hist;
+ unsigned long long swpo_hist;
+ unsigned long long pagei_hist;
+ unsigned long long pageo_hist;
+};
+
+struct netsnmp_cpu_info_s {
+ int idx;
+ /* For hrDeviceTable */
+ char name[ SNMP_MAXBUF ];
+ char descr[ SNMP_MAXBUF ];
+ int status;
+
+ /* For UCD cpu stats */
+ unsigned long long user_ticks;
+ unsigned long long nice_ticks;
+ unsigned long long sys_ticks;
+ unsigned long long idle_ticks;
+ unsigned long long wait_ticks;
+ unsigned long long kern_ticks;
+ unsigned long long intrpt_ticks;
+ unsigned long long sirq_ticks;
+ unsigned long long steal_ticks;
+ unsigned long long guest_ticks;
+ unsigned long long guestnice_ticks;
+
+ unsigned long long total_ticks;
+ unsigned long long sys2_ticks; /* For non-atomic system counts */
+
+ /* For paging-related UCD stats */
+ /* XXX - Do these belong elsewhere ?? */
+ /* XXX - Do Not Use - Subject to Change */
+ unsigned long long pageIn;
+ unsigned long long pageOut;
+ unsigned long long swapIn;
+ unsigned long long swapOut;
+ unsigned long long nInterrupts;
+ unsigned long long nCtxSwitches;
+
+ struct netsnmp_cpu_history *history;
+
+ netsnmp_cpu_info *next;
+};
+
+
+ /*
+ * Possibly not all needed ??
+ */
+netsnmp_cpu_info *netsnmp_cpu_get_first( void );
+netsnmp_cpu_info *netsnmp_cpu_get_next( netsnmp_cpu_info* );
+netsnmp_cpu_info *netsnmp_cpu_get_byIdx( int, int );
+netsnmp_cpu_info *netsnmp_cpu_get_byName( char*, int );
+
+netsnmp_cache *netsnmp_cpu_get_cache( void );
+int netsnmp_cpu_load( void );
diff --git a/include/net-snmp/agent/hardware/fsys.h b/include/net-snmp/agent/hardware/fsys.h
new file mode 100644
index 0000000..91e8e17
--- /dev/null
+++ b/include/net-snmp/agent/hardware/fsys.h
@@ -0,0 +1,109 @@
+typedef struct netsnmp_fsys_info_s netsnmp_fsys_info;
+
+#define _NETSNMP_FS_TYPE_SKIP_BIT 0x2000
+#define _NETSNMP_FS_TYPE_LOCAL 0x1000
+
+ /*
+ * Enumeration from HOST-RESOURCES-TYPES mib
+ */
+#define NETSNMP_FS_TYPE_OTHER 1
+#define NETSNMP_FS_TYPE_UNKNOWN 2
+#define NETSNMP_FS_TYPE_BERKELEY 3
+#define NETSNMP_FS_TYPE_SYSV 4
+#define NETSNMP_FS_TYPE_FAT 5
+#define NETSNMP_FS_TYPE_HPFS 6
+#define NETSNMP_FS_TYPE_HFS 7
+#define NETSNMP_FS_TYPE_MFS 8
+#define NETSNMP_FS_TYPE_NTFS 9
+#define NETSNMP_FS_TYPE_VNODE 10
+#define NETSNMP_FS_TYPE_JFS 11
+#define NETSNMP_FS_TYPE_ISO9660 12
+#define NETSNMP_FS_TYPE_ROCKRIDGE 13
+#define NETSNMP_FS_TYPE_NFS 14
+#define NETSNMP_FS_TYPE_NETWARE 15
+#define NETSNMP_FS_TYPE_AFS 16
+#define NETSNMP_FS_TYPE_DFS 17
+#define NETSNMP_FS_TYPE_APPLESHARE 18
+#define NETSNMP_FS_TYPE_RFS 19
+#define NETSNMP_FS_TYPE_DGCS 20
+#define NETSNMP_FS_TYPE_BOOTFS 21
+#define NETSNMP_FS_TYPE_FAT32 22
+#define NETSNMP_FS_TYPE_EXT2 23
+
+ /*
+ * Additional enumerationis - not listed in that MIB
+ */
+#define NETSNMP_FS_TYPE_IGNORE 1 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT
+
+#define NETSNMP_FS_TYPE_PROC 2 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT
+
+#define NETSNMP_FS_TYPE_DEVPTS 3 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT
+#define NETSNMP_FS_TYPE_SYSFS 4 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT
+#define NETSNMP_FS_TYPE_TMPFS 5 | _NETSNMP_FS_TYPE_LOCAL
+#define NETSNMP_FS_TYPE_USBFS 6 | _NETSNMP_FS_TYPE_LOCAL
+
+#define NETSNMP_FS_FLAG_ACTIVE 0x01
+#define NETSNMP_FS_FLAG_REMOTE 0x02
+#define NETSNMP_FS_FLAG_RONLY 0x04
+#define NETSNMP_FS_FLAG_BOOTABLE 0x08
+#define NETSNMP_FS_FLAG_REMOVE 0x10
+#define NETSNMP_FS_FLAG_UCD 0x20
+
+#define NETSNMP_FS_FIND_CREATE 1 /* or use one of the type values */
+#define NETSNMP_FS_FIND_EXIST 0
+
+struct netsnmp_fsys_info_s {
+ netsnmp_index idx;
+ /* int idx; */
+
+ char path[ SNMP_MAXPATH+1];
+ char device[SNMP_MAXPATH+1];
+ int type;
+
+ unsigned long long size;
+ unsigned long long used;
+ unsigned long long avail;
+ unsigned long long units;
+
+ /* artificially computed values, both 'size_32' and 'units_32' fit INT32 */
+ unsigned long size_32;
+ unsigned long used_32;
+ unsigned long avail_32;
+ unsigned long units_32;
+
+ unsigned long long inums_total;
+ unsigned long long inums_avail;
+
+ int minspace;
+ int minpercent;
+
+ long flags;
+
+ netsnmp_fsys_info *next;
+};
+
+
+ /*
+ * Possibly not all needed ??
+ */
+netsnmp_fsys_info *netsnmp_fsys_get_first( void );
+netsnmp_fsys_info *netsnmp_fsys_get_next( netsnmp_fsys_info* );
+netsnmp_fsys_info *netsnmp_fsys_get_byIdx( int, int );
+netsnmp_fsys_info *netsnmp_fsys_get_next_byIdx(int,int );
+
+netsnmp_fsys_info *netsnmp_fsys_by_device( char*, int );
+netsnmp_fsys_info *netsnmp_fsys_by_path( char*, int );
+
+netsnmp_cache *netsnmp_fsys_get_cache( void );
+int netsnmp_fsys_load( netsnmp_cache *cache, void *data );
+void netsnmp_fsys_free( netsnmp_cache *cache, void *data );
+
+int netsnmp_fsys_size( netsnmp_fsys_info* );
+int netsnmp_fsys_used( netsnmp_fsys_info* );
+int netsnmp_fsys_avail(netsnmp_fsys_info* );
+
+unsigned long long netsnmp_fsys_size_ull( netsnmp_fsys_info* );
+unsigned long long netsnmp_fsys_used_ull( netsnmp_fsys_info* );
+unsigned long long netsnmp_fsys_avail_ull(netsnmp_fsys_info* );
+
+void netsnmp_fsys_calculate32( netsnmp_fsys_info *f);
diff --git a/include/net-snmp/agent/hardware/memory.h b/include/net-snmp/agent/hardware/memory.h
new file mode 100644
index 0000000..aba0a6c
--- /dev/null
+++ b/include/net-snmp/agent/hardware/memory.h
@@ -0,0 +1,39 @@
+typedef struct netsnmp_memory_info_s netsnmp_memory_info;
+
+#define NETSNMP_MEM_TYPE_PHYSMEM 1
+#define NETSNMP_MEM_TYPE_USERMEM 2
+#define NETSNMP_MEM_TYPE_VIRTMEM 3
+#define NETSNMP_MEM_TYPE_STEXT 4
+#define NETSNMP_MEM_TYPE_RTEXT 5
+#define NETSNMP_MEM_TYPE_MBUF 6
+#define NETSNMP_MEM_TYPE_CACHED 7
+#define NETSNMP_MEM_TYPE_SHARED 8
+#define NETSNMP_MEM_TYPE_SHARED2 9
+#define NETSNMP_MEM_TYPE_SWAP 10
+ /* Leave space for individual swap devices */
+#define NETSNMP_MEM_TYPE_MAX 30
+
+struct netsnmp_memory_info_s {
+ int idx;
+ int type;
+ char *descr;
+
+ long units;
+ long size;
+ long free;
+ long other;
+
+ netsnmp_memory_info *next;
+};
+
+
+ /*
+ * Possibly not all needed ??
+ */
+netsnmp_memory_info *netsnmp_memory_get_first( int );
+netsnmp_memory_info *netsnmp_memory_get_next( netsnmp_memory_info*, int );
+netsnmp_memory_info *netsnmp_memory_get_byIdx( int, int );
+netsnmp_memory_info *netsnmp_memory_get_next_byIdx(int,int );
+
+netsnmp_cache *netsnmp_memory_get_cache( void );
+int netsnmp_memory_load( void );
diff --git a/include/net-snmp/agent/hardware/sensors.h b/include/net-snmp/agent/hardware/sensors.h
new file mode 100644
index 0000000..d59eca7
--- /dev/null
+++ b/include/net-snmp/agent/hardware/sensors.h
@@ -0,0 +1,48 @@
+/*
+ * Hardware Abstraction Layer - Sensors module
+ *
+ * Public interface
+ */
+
+#define NETSNMP_SENSOR_TYPE_OTHER 1
+#define NETSNMP_SENSOR_TYPE_VOLTAGE_AC 3
+#define NETSNMP_SENSOR_TYPE_VOLTAGE_DC 4
+#define NETSNMP_SENSOR_TYPE_CURRENT 5
+#define NETSNMP_SENSOR_TYPE_POWER 6
+#define NETSNMP_SENSOR_TYPE_FREQUENCY 7
+#define NETSNMP_SENSOR_TYPE_TEMPERATURE 8
+#define NETSNMP_SENSOR_TYPE_HUMIDITY 9
+#define NETSNMP_SENSOR_TYPE_RPM 10
+#define NETSNMP_SENSOR_TYPE_VOLUME 11
+#define NETSNMP_SENSOR_TYPE_BOOLEAN 12
+
+
+#define NETSNMP_SENSOR_FLAG_ACTIVE 0x01
+#define NETSNMP_SENSOR_FLAG_NAVAIL 0x02
+#define NETSNMP_SENSOR_FLAG_BROKEN 0x04
+#define NETSNMP_SENSOR_FLAG_DISABLE 0x08
+
+#define NETSNMP_SENSOR_MASK_STATUS 0x06 /* NAVAIL|BROKEN */
+
+
+#define NETSNMP_SENSOR_FIND_CREATE 1 /* or use one of the sensor type values */
+#define NETSNMP_SENSOR_FIND_EXIST 0
+
+typedef struct netsnmp_sensor_info_s netsnmp_sensor_info;
+struct netsnmp_sensor_info_s {
+
+ netsnmp_index idx;
+ /* int idx; */
+ char name[256];
+
+ int type;
+ float value;
+ char descr[256];
+ long flags;
+};
+
+netsnmp_container *get_sensor_container( void );
+netsnmp_cache *get_sensor_cache( void );
+netsnmp_sensor_info *sensor_by_name( const char *, int );
+NetsnmpCacheLoad netsnmp_sensor_load;
+NetsnmpCacheFree netsnmp_sensor_free;
diff --git a/include/net-snmp/agent/instance.h b/include/net-snmp/agent/instance.h
new file mode 100644
index 0000000..82f2edd
--- /dev/null
+++ b/include/net-snmp/agent/instance.h
@@ -0,0 +1,145 @@
+/*
+ * instance.h
+ */
+#ifndef NETSNMP_INSTANCE_H
+#define NETSNMP_INSTANCE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The instance helper is designed to simplify the task of adding simple
+ * * instances to the mib tree.
+ */
+
+/*
+ * GETNEXTs are auto-converted to a GET.
+ * * non-valid GETs are dropped.
+ * * The client can assume that if you're called for a GET, it shouldn't
+ * * have to check the oid at all. Just answer.
+ */
+
+int
+netsnmp_register_instance(netsnmp_handler_registration * reginfo);
+
+int
+netsnmp_register_read_only_instance(netsnmp_handler_registration *reginfo);
+
+#define INSTANCE_HANDLER_NAME "instance"
+
+netsnmp_mib_handler *netsnmp_get_instance_handler(void);
+
+int
+netsnmp_register_read_only_ulong_instance(const char * name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler);
+int
+netsnmp_register_ulong_instance(const char * name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler);
+int
+netsnmp_register_read_only_counter32_instance(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler *subhandler);
+int
+netsnmp_register_read_only_long_instance(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler * subhandler);
+int
+netsnmp_register_long_instance(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler * subhandler);
+
+int
+netsnmp_register_read_only_int_instance(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len, int *it,
+ Netsnmp_Node_Handler * subhandler);
+
+int
+netsnmp_register_int_instance(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len, int *it,
+ Netsnmp_Node_Handler * subhandler);
+
+/* identical functions that register a in a particular context */
+int
+netsnmp_register_read_only_ulong_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler
+ * subhandler,
+ const char *contextName);
+int
+netsnmp_register_ulong_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName);
+int
+netsnmp_register_read_only_counter32_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler
+ * subhandler,
+ const char *contextName);
+int
+netsnmp_register_read_only_long_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler
+ * subhandler,
+ const char *contextName);
+int
+netsnmp_register_long_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName);
+
+int
+netsnmp_register_read_only_int_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len, int *it,
+ Netsnmp_Node_Handler *
+ subhandler,
+ const char *contextName);
+
+int
+netsnmp_register_int_instance_context(const char *name,
+ const oid * reg_oid,
+ size_t reg_oid_len, int *it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName);
+
+int
+netsnmp_register_num_file_instance(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ const char *file_name, int asn_type, int mode,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName);
+
+Netsnmp_Node_Handler netsnmp_instance_helper_handler;
+Netsnmp_Node_Handler netsnmp_instance_num_file_handler;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** NETSNMP_INSTANCE_H */
diff --git a/include/net-snmp/agent/mfd.h b/include/net-snmp/agent/mfd.h
new file mode 100644
index 0000000..15d0d91
--- /dev/null
+++ b/include/net-snmp/agent/mfd.h
@@ -0,0 +1,84 @@
+/*
+ * MIBs For Dummies header
+ *
+ * $Id$
+ */
+#ifndef NETSNMP_MFD_H
+#define NETSNMP_MFD_H
+
+/***********************************************************************
+ *
+ * return codes
+ *
+ **********************************************************************/
+
+/*----------------------------------------------------------------------
+ * general success/failure
+ */
+#define MFD_SUCCESS SNMP_ERR_NOERROR
+#define MFD_ERROR SNMP_ERR_GENERR
+
+/*
+ * object not currently available
+ */
+#define MFD_SKIP SNMP_NOSUCHINSTANCE
+
+/*
+ * no more data in table (get-next)
+ */
+#define MFD_END_OF_DATA SNMP_ENDOFMIBVIEW
+
+/*----------------------------------------------------------------------
+ * set processing errors
+ */
+/*
+ * row creation errors
+ */
+#define MFD_CANNOT_CREATE_NOW SNMP_ERR_INCONSISTENTNAME
+#define MFD_CANNOT_CREATE_EVER SNMP_ERR_NOCREATION
+
+/*
+ * not writable or resource unavailable
+ */
+#define MFD_NOT_WRITABLE SNMP_ERR_NOTWRITABLE
+#define MFD_RESOURCE_UNAVAILABLE SNMP_ERR_RESOURCEUNAVAILABLE
+
+/*
+ * new value errors
+ */
+#define MFD_NOT_VALID_NOW SNMP_ERR_INCONSISTENTVALUE
+#define MFD_NOT_VALID_EVER SNMP_ERR_WRONGVALUE
+
+
+/***********************************************************************
+ *
+ * rowreq flags
+ *
+ **********************************************************************/
+
+/*----------------------------------------------------------------------
+ * 8 flags resevered for the user
+ */
+#define MFD_ROW_FLAG_USER_1 0x00000001 /* user flag 1 */
+#define MFD_ROW_FLAG_USER_2 0x00000002 /* user flag 2 */
+#define MFD_ROW_FLAG_USER_3 0x00000004 /* user flag 3 */
+#define MFD_ROW_FLAG_USER_4 0x00000008 /* user flag 4 */
+#define MFD_ROW_FLAG_USER_5 0x00000010 /* user flag 5 */
+#define MFD_ROW_FLAG_USER_6 0x00000020 /* user flag 6 */
+#define MFD_ROW_FLAG_USER_7 0x00000040 /* user flag 7 */
+#define MFD_ROW_FLAG_USER_8 0x00000080 /* user flag 8 */
+#define MFD_ROW_FLAG_USER_MASK 0x000000ff /* user flag mask */
+
+/*----------------------------------------------------------------------
+ * MFD flags
+ *
+ * grow left to right, in case we want to add more user flags later
+ */
+#define MFD_ROW_MASK 0xffffff00 /* mask to clear user flags */
+#define MFD_ROW_CREATED 0x80000000 /* newly created row */
+#define MFD_ROW_DATA_FROM_USER 0x40000000 /* we didn't allocate data */
+#define MFD_ROW_DELETED 0x20000000 /* deleted row */
+#define MFD_ROW_DIRTY 0x10000000 /* changed row */
+
+
+#endif /* NETSNMP_MFD_H */
diff --git a/include/net-snmp/agent/mib_modules.h b/include/net-snmp/agent/mib_modules.h
new file mode 100644
index 0000000..7003a11
--- /dev/null
+++ b/include/net-snmp/agent/mib_modules.h
@@ -0,0 +1,23 @@
+#ifndef MIB_MODULES_H
+#define MIB_MODULES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define DO_INITIALIZE 1
+#define DONT_INITIALIZE 0
+
+struct module_init_list {
+ char *module_name;
+ struct module_init_list *next;
+};
+
+void add_to_init_list(char *module_list);
+int should_init(const char *module_name);
+void init_mib_modules(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/mode_end_call.h b/include/net-snmp/agent/mode_end_call.h
new file mode 100644
index 0000000..eb56d0a
--- /dev/null
+++ b/include/net-snmp/agent/mode_end_call.h
@@ -0,0 +1,39 @@
+/*
+ * mode_end_call.h
+ */
+#ifndef MODE_END_CALL_H
+#define MODE_END_CALL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define NETSNMP_MODE_END_ALL_MODES -999
+
+typedef struct netsnmp_mode_handler_list_s {
+ struct netsnmp_mode_handler_list_s *next;
+ int mode;
+ netsnmp_mib_handler *callback_handler;
+} netsnmp_mode_handler_list;
+
+/*
+ * The helper calls another handler after each mode has been
+ * processed.
+ */
+
+/* public functions */
+netsnmp_mib_handler *
+netsnmp_get_mode_end_call_handler(netsnmp_mode_handler_list *endlist);
+
+netsnmp_mode_handler_list *
+netsnmp_mode_end_call_add_mode_callback(netsnmp_mode_handler_list *endlist,
+ int mode,
+ netsnmp_mib_handler *callbackh);
+
+/* internal */
+Netsnmp_Node_Handler netsnmp_mode_end_call_helper;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/multiplexer.h b/include/net-snmp/agent/multiplexer.h
new file mode 100644
index 0000000..2bbb7b1
--- /dev/null
+++ b/include/net-snmp/agent/multiplexer.h
@@ -0,0 +1,39 @@
+#ifndef NETSNMP_MULTIPLEXER_H
+#define NETSNMP_MULTIPLEXER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The multiplexer helper
+ */
+
+/** @name multiplexer
+ * @{ */
+
+/** @struct netsnmp_mib_handler_methods
+ * Defines the subhandlers to be called by the multiplexer helper
+ */
+typedef struct netsnmp_mib_handler_methods_s {
+ /** called when a GET request is received */
+ netsnmp_mib_handler *get_handler;
+ /** called when a GETNEXT request is received */
+ netsnmp_mib_handler *getnext_handler;
+ /** called when a GETBULK request is received */
+ netsnmp_mib_handler *getbulk_handler;
+ /** called when a SET request is received */
+ netsnmp_mib_handler *set_handler;
+} netsnmp_mib_handler_methods;
+
+/** @} */
+
+netsnmp_mib_handler
+ *netsnmp_get_multiplexer_handler(netsnmp_mib_handler_methods *);
+
+Netsnmp_Node_Handler netsnmp_multiplexer_helper_handler;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* NETSNMP_MULTIPLEXER_H */
diff --git a/include/net-snmp/agent/net-snmp-agent-includes.h b/include/net-snmp/agent/net-snmp-agent-includes.h
new file mode 100644
index 0000000..925349e
--- /dev/null
+++ b/include/net-snmp/agent/net-snmp-agent-includes.h
@@ -0,0 +1,22 @@
+/*
+ * A simple helpful wrapper to include lots of agent specific include
+ * * files for people wanting to embed and snmp agent into an external
+ * * application
+ */
+#ifndef NET_SNMP_AGENT_INCLUDES_H
+#define NET_SNMP_AGENT_INCLUDES_H
+
+#include <net-snmp/agent/mib_module_config.h>
+#include <net-snmp/agent/agent_module_config.h>
+
+#include <net-snmp/agent/snmp_agent.h>
+#include <net-snmp/agent/snmp_vars.h>
+#include <net-snmp/agent/ds_agent.h>
+#include <net-snmp/agent/agent_handler.h>
+#include <net-snmp/agent/agent_read_config.h>
+#include <net-snmp/agent/agent_trap.h>
+#include <net-snmp/agent/agent_handler.h>
+#include <net-snmp/agent/all_helpers.h>
+#include <net-snmp/agent/var_struct.h>
+
+#endif /* NET_SNMP_AGENT_INCLUDES_H */
diff --git a/include/net-snmp/agent/null.h b/include/net-snmp/agent/null.h
new file mode 100644
index 0000000..f24a0b4
--- /dev/null
+++ b/include/net-snmp/agent/null.h
@@ -0,0 +1,26 @@
+#ifndef AGENT_NULL_H
+#define AGENT_NULL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * null.h
+ */
+
+/*
+ * literally does nothing and is used as a final handler for
+ * "do-nothing" nodes that must exist solely for mib tree storage
+ * usage..
+ */
+
+int netsnmp_register_null(oid *, size_t);
+int netsnmp_register_null_context(oid *, size_t, const char *contextName);
+
+Netsnmp_Node_Handler netsnmp_null_handler;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/object_monitor.h b/include/net-snmp/agent/object_monitor.h
new file mode 100644
index 0000000..8ac3eca
--- /dev/null
+++ b/include/net-snmp/agent/object_monitor.h
@@ -0,0 +1,186 @@
+/**************************************************************************
+ * object_monitor.h
+ *
+ * Contributed by: Robert Story <rstory@freesnmp.com>
+ *
+ * $Id$
+ *
+ * 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!
+ */
+#ifndef OBJECT_MONITOR_H
+#define OBJECT_MONITOR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * notification types
+ */
+ enum {
+ /*
+ * cooperative notification from the object being watched
+ */
+ NOTIFICATION_COOPERATIVE = 1,
+ /*
+ * notification that an object has been set vi SNMP-SET
+ */
+ NOTIFICATION_SET_REQUEST,
+ /*
+ * end of current notification types
+ */
+ NOTIFICATION_END
+ };
+
+ /*
+ * COOPERATIVE event types
+ */
+ enum {
+ EVENT_ROW_ADD = 1,
+ EVENT_ROW_MOD,
+ EVENT_ROW_DEL,
+ EVENT_COL_MOD,
+ EVENT_OBJ_MOD,
+ EVENT_END
+ };
+
+ /*
+ * data structures
+ */
+
+
+ /**
+ * callback header
+ */
+ typedef struct netsnmp_monitor_callback_header_s {
+
+ /** callback type */
+ unsigned int event;
+
+ /** registered oid */
+ netsnmp_index monitored_object;
+
+ /** priority */
+ int priority;
+
+ /** pointer given by watcher at registration */
+ void *watcher_data;
+
+ /** pointer passed from the monitored object */
+ void *object_info;
+
+ /** DO NOT USE, INTERNAL USE ONLY */
+ struct netsnmp_monitor_callback_header_s *private;
+ int refs;
+
+
+ } netsnmp_monitor_callback_header;
+
+ /*
+ *
+ */
+ typedef struct netsnmp_monitor_callback_set_request_s {
+
+ /** header */
+ netsnmp_monitor_callback_header hdr;
+
+ /** handler that registered to handle this object */
+ netsnmp_mib_handler *handler;
+
+ /** pdu containing the set request */
+ netsnmp_pdu *pdu;
+
+ /** the set request */
+ netsnmp_request_info *request;
+
+ } netsnmp_monitor_set_request_data;
+
+ /*
+ *
+ */
+ typedef struct netsnmp_monitor_callback_cooperative_s {
+
+ /** header */
+ netsnmp_monitor_callback_header hdr;
+
+ } netsnmp_monitor_callback_cooperative;
+
+
+
+ typedef void
+ (netsnmp_object_monitor_callback) (netsnmp_monitor_callback_header
+ *);
+
+
+
+
+ /**********************************************************************
+ * Registration function prototypes
+ */
+
+ /*
+ * Register a callback for the specified object.
+ */
+ int netsnmp_monitor_register(oid * object, size_t oid_len,
+ int priority,
+ unsigned int events,
+ void *watcher_data,
+ netsnmp_object_monitor_callback
+ * cb);
+
+ /*
+ * Unregister a callback for the specified object.
+ */
+ int netsnmp_monitor_unregister(oid * object,
+ size_t oid_len,
+ int priority,
+ void *watcher_data,
+ netsnmp_object_monitor_callback
+ * cb);
+
+ /*
+ * check to see if a registration exists for an object/event combination
+ */
+ int netsnmp_monitor_check_registered(int event, oid * oid,
+ int oid_len);
+
+
+ /**********************************************************************
+ * function prototypes
+ */
+
+ /*
+ * Notifies the object monitor of an event.
+ */
+ void netsnmp_notify_monitor(netsnmp_monitor_callback_header
+ * cbh);
+
+
+
+
+ /**********************************************************************
+ * function prototypes
+ */
+
+ /*
+ * Notifies the object monitor of a cooperative event.
+ */
+ void netsnmp_notify_cooperative(int event, oid * object,
+ size_t len, char oid_steal,
+ void *object_info);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /** OBJECT_MONITOR_H */
diff --git a/include/net-snmp/agent/old_api.h b/include/net-snmp/agent/old_api.h
new file mode 100644
index 0000000..1ae171c
--- /dev/null
+++ b/include/net-snmp/agent/old_api.h
@@ -0,0 +1,49 @@
+#ifndef OLD_API_H
+#define OLD_API_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define OLD_API_NAME "old_api"
+
+typedef struct netsnmp_old_api_info_s {
+ struct variable *var;
+ size_t varsize;
+ size_t numvars;
+
+ /*
+ * old stuff
+ */
+ netsnmp_session *ss;
+ int flags;
+} netsnmp_old_api_info;
+
+typedef struct old_opi_cache_s {
+ u_char *data;
+ WriteMethod *write_method;
+} netsnmp_old_api_cache;
+
+int netsnmp_register_old_api(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ const oid * mibloc,
+ size_t mibloclen,
+ int priority,
+ int range_subid,
+ oid range_ubound,
+ netsnmp_session * ss,
+ const char *context,
+ int timeout, int flags);
+Netsnmp_Node_Handler netsnmp_old_api_helper;
+
+/*
+ * really shouldn't be used
+ */
+netsnmp_agent_session *netsnmp_get_current_agent_session(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* OLD_API_H */
diff --git a/include/net-snmp/agent/read_only.h b/include/net-snmp/agent/read_only.h
new file mode 100644
index 0000000..41635b0
--- /dev/null
+++ b/include/net-snmp/agent/read_only.h
@@ -0,0 +1,29 @@
+#ifndef READ_ONLY_H
+#define READ_ONLY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * read_only.h
+ */
+
+/*
+ * The helper merely intercepts SET requests and handles them early on
+ * making everything read-only (no SETs are actually permitted).
+ * Useful as a helper to handlers that are implementing MIBs with no
+ * SET support.
+ */
+
+
+netsnmp_mib_handler *netsnmp_get_read_only_handler(void);
+void netsnmp_init_read_only_helper(void);
+
+Netsnmp_Node_Handler netsnmp_read_only_helper;
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/row_merge.h b/include/net-snmp/agent/row_merge.h
new file mode 100644
index 0000000..3e98957
--- /dev/null
+++ b/include/net-snmp/agent/row_merge.h
@@ -0,0 +1,38 @@
+#ifndef ROW_MERGE_H
+#define ROW_MERGE_H
+
+/*
+ * This row_merge 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ typedef struct netsnmp_row_merge_status_x {
+ char count; /* number of requests */
+ char rows; /* number of rows (unique indexes) */
+ char current; /* current row number */
+ char reserved; /* reserver for future use */
+
+ netsnmp_request_info **saved_requests; /* internal use */
+ char *saved_status; /* internal use */
+ } netsnmp_row_merge_status;
+
+ netsnmp_mib_handler *netsnmp_get_row_merge_handler(int);
+ int netsnmp_register_row_merge(netsnmp_handler_registration *reginfo);
+ void netsnmp_init_row_merge(void);
+
+ int netsnmp_row_merge_status_first(netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo);
+ int netsnmp_row_merge_status_last(netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo);
+
+ Netsnmp_Node_Handler netsnmp_row_merge_helper_handler;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/scalar.h b/include/net-snmp/agent/scalar.h
new file mode 100644
index 0000000..9af92cb
--- /dev/null
+++ b/include/net-snmp/agent/scalar.h
@@ -0,0 +1,36 @@
+/*
+ * scalar.h
+ */
+#ifndef NETSNMP_SCALAR_H
+#define NETSNMP_SCALAR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The scalar helper is designed to simplify the task of adding simple
+ * scalar objects to the mib tree.
+ */
+
+/*
+ * GETNEXTs are auto-converted to a GET.
+ * * non-valid GETs are dropped.
+ * * The client can assume that if you're called for a GET, it shouldn't
+ * * have to check the oid at all. Just answer.
+ */
+
+int netsnmp_register_scalar(netsnmp_handler_registration *reginfo);
+int netsnmp_register_read_only_scalar(netsnmp_handler_registration *reginfo);
+
+#define SCALAR_HANDLER_NAME "scalar"
+
+netsnmp_mib_handler *netsnmp_get_scalar_handler(void);
+
+Netsnmp_Node_Handler netsnmp_scalar_helper_handler;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** NETSNMP_SCALAR_H */
diff --git a/include/net-snmp/agent/scalar_group.h b/include/net-snmp/agent/scalar_group.h
new file mode 100644
index 0000000..f421337
--- /dev/null
+++ b/include/net-snmp/agent/scalar_group.h
@@ -0,0 +1,36 @@
+/*
+ * scalar.h
+ */
+#ifndef NETSNMP_SCALAR_GROUP_H
+#define NETSNMP_SCALAR_GROUP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The scalar group helper is designed to implement a group of
+ * scalar objects all in one go, making use of the scalar and
+ * instance helpers.
+ *
+ * GETNEXTs are auto-converted to a GET. Non-valid GETs are dropped.
+ * The client-provided handler just needs to check the OID name to
+ * see which object is being requested, but can otherwise assume that
+ * things are fine.
+ */
+
+typedef struct netsnmp_scalar_group_s {
+ oid lbound; /* XXX - or do we need a more flexible arrangement? */
+ oid ubound;
+} netsnmp_scalar_group;
+
+int netsnmp_register_scalar_group(netsnmp_handler_registration *reginfo,
+ oid first, oid last);
+netsnmp_mib_handler *netsnmp_get_scalar_group_handler(oid first, oid last);
+Netsnmp_Node_Handler netsnmp_scalar_group_helper_handler;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** NETSNMP_SCALAR_GROUP_H */
diff --git a/include/net-snmp/agent/serialize.h b/include/net-snmp/agent/serialize.h
new file mode 100644
index 0000000..08b38c1
--- /dev/null
+++ b/include/net-snmp/agent/serialize.h
@@ -0,0 +1,24 @@
+#ifndef SERIALIZE_H
+#define SERIALIZE_H
+
+/*
+ * The serialized helper merely calls its clients multiple times for a
+ * * given request set, so they don't have to loop through the requests
+ * * themselves.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ netsnmp_mib_handler *netsnmp_get_serialize_handler(void);
+ int netsnmp_register_serialize(netsnmp_handler_registration
+ *reginfo);
+ void netsnmp_init_serialize(void);
+
+ Netsnmp_Node_Handler netsnmp_serialize_helper_handler;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/set_helper.h b/include/net-snmp/agent/set_helper.h
new file mode 100644
index 0000000..81d887c
--- /dev/null
+++ b/include/net-snmp/agent/set_helper.h
@@ -0,0 +1,25 @@
+#ifndef SET_HELPER_H
+#define SET_HELPER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct netsnmp_set_info_s {
+ int action;
+ void *stateRef;
+
+ /*
+ * don't use yet:
+ */
+ void **oldData;
+ int setCleanupFlags; /* XXX: client sets this to: */
+#define AUTO_FREE_STATEREF 0x01 /* calls free(stateRef) */
+#define AUTO_FREE_OLDDATA 0x02 /* calls free(*oldData) */
+#define AUTO_UNDO 0x04 /* ... */
+} netsnmp_set_info;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/snmp_agent.h b/include/net-snmp/agent/snmp_agent.h
new file mode 100644
index 0000000..aad8837
--- /dev/null
+++ b/include/net-snmp/agent/snmp_agent.h
@@ -0,0 +1,322 @@
+/* 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.
+ */
+/*
+ * @file snmp_agent.h
+ *
+ * @addtogroup agent
+ * @addtogroup table
+ * External definitions for functions and variables in snmp_agent.c.
+ *
+ * @{
+ */
+
+#ifndef SNMP_AGENT_H
+#define SNMP_AGENT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/library/snmp_impl.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/data_list.h>
+
+#define SNMP_MAX_PDU_SIZE 64000 /* local constraint on PDU size sent by agent
+ * (see also SNMP_MAX_MSG_SIZE in snmp_api.h) */
+
+ /*
+ * If non-zero, causes the addresses of peers to be logged when receptions
+ * occur.
+ */
+
+ extern int log_addresses;
+
+ /*
+ * How many ticks since we last aged the address cache entries.
+ */
+
+ extern int lastAddrAge;
+
+ /** @typedef struct netsnmp_request_info_s netsnmp_request_info
+ * Typedefs the netsnmp_request_info_s struct into
+ * netsnmp_request_info*/
+ /** @struct netsnmp_request_info_s
+ * The netsnmp request info structure.
+ */
+ typedef struct netsnmp_request_info_s {
+ /**
+ * variable bindings
+ */
+ netsnmp_variable_list *requestvb;
+
+ /**
+ * can be used to pass information on a per-request basis from a
+ * helper to the later handlers
+ */
+ netsnmp_data_list *parent_data;
+
+ /*
+ * pointer to the agent_request_info for this request
+ */
+ struct netsnmp_agent_request_info_s *agent_req_info;
+
+ /** don't free, reference to (struct tree)->end */
+ oid *range_end;
+ size_t range_end_len;
+
+ /*
+ * flags
+ */
+ int delegated;
+ int processed;
+ int inclusive;
+
+ int status;
+ /** index in original pdu */
+ int index;
+
+ /** get-bulk */
+ int repeat;
+ int orig_repeat;
+ netsnmp_variable_list *requestvb_start;
+
+ /* internal use */
+ struct netsnmp_request_info_s *next;
+ struct netsnmp_request_info_s *prev;
+ struct netsnmp_subtree_s *subtree;
+ } netsnmp_request_info;
+
+ typedef struct netsnmp_set_info_s {
+ int action;
+ void *stateRef;
+
+ /*
+ * don't use yet:
+ */
+ void **oldData;
+ int setCleanupFlags;
+#define AUTO_FREE_STATEREF 0x01 /* calls free(stateRef) */
+#define AUTO_FREE_OLDDATA 0x02 /* calls free(*oldData) */
+#define AUTO_UNDO 0x03 /* ... */
+ } netsnmp_set_info;
+
+ typedef struct netsnmp_tree_cache_s {
+ struct netsnmp_subtree_s *subtree;
+ netsnmp_request_info *requests_begin;
+ netsnmp_request_info *requests_end;
+ } netsnmp_tree_cache;
+
+#define MODE_GET SNMP_MSG_GET
+#define MODE_GETNEXT SNMP_MSG_GETNEXT
+#define MODE_GETBULK SNMP_MSG_GETBULK
+#define MODE_GET_STASH SNMP_MSG_INTERNAL_GET_STASH
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#define MODE_IS_GET(x) ((x >= 128) && (x != -1) && (x != SNMP_MSG_SET))
+#else /* NETSNMP_NO_WRITE_SUPPORT */
+#define MODE_IS_GET(x) ((x >= 128) && (x != -1))
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+ /* #define MODE_IS_GET(x) ((x == SNMP_MSG_GET) || (x == SNMP_MSG_GETNEXT) || (x == SNMP_MSG_GETBULK) || (x == SNMP_MSG_INTERNAL_GET_STASH)) */
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#define MODE_SET_BEGIN SNMP_MSG_INTERNAL_SET_BEGIN
+#define MODE_SET_RESERVE1 SNMP_MSG_INTERNAL_SET_RESERVE1
+#define MODE_SET_RESERVE2 SNMP_MSG_INTERNAL_SET_RESERVE2
+#define MODE_SET_ACTION SNMP_MSG_INTERNAL_SET_ACTION
+#define MODE_SET_COMMIT SNMP_MSG_INTERNAL_SET_COMMIT
+#define MODE_SET_FREE SNMP_MSG_INTERNAL_SET_FREE
+#define MODE_SET_UNDO SNMP_MSG_INTERNAL_SET_UNDO
+#define MODE_IS_SET(x) ((x < 128) || (x == -1) || (x == SNMP_MSG_SET))
+ /* #define MODE_IS_SET(x) (!MODE_IS_GET(x)) */
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+#define MODE_BSTEP_PRE_REQUEST SNMP_MSG_INTERNAL_PRE_REQUEST
+#define MODE_BSTEP_POST_REQUEST SNMP_MSG_INTERNAL_POST_REQUEST
+
+#define MODE_BSTEP_OBJECT_LOOKUP SNMP_MSG_INTERNAL_OBJECT_LOOKUP
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#define MODE_BSTEP_CHECK_VALUE SNMP_MSG_INTERNAL_CHECK_VALUE
+#define MODE_BSTEP_ROW_CREATE SNMP_MSG_INTERNAL_ROW_CREATE
+#define MODE_BSTEP_UNDO_SETUP SNMP_MSG_INTERNAL_UNDO_SETUP
+#define MODE_BSTEP_SET_VALUE SNMP_MSG_INTERNAL_SET_VALUE
+#define MODE_BSTEP_CHECK_CONSISTENCY SNMP_MSG_INTERNAL_CHECK_CONSISTENCY
+#define MODE_BSTEP_UNDO_SET SNMP_MSG_INTERNAL_UNDO_SET
+#define MODE_BSTEP_COMMIT SNMP_MSG_INTERNAL_COMMIT
+#define MODE_BSTEP_UNDO_COMMIT SNMP_MSG_INTERNAL_UNDO_COMMIT
+#define MODE_BSTEP_IRREVERSIBLE_COMMIT SNMP_MSG_INTERNAL_IRREVERSIBLE_COMMIT
+#define MODE_BSTEP_UNDO_CLEANUP SNMP_MSG_INTERNAL_UNDO_CLEANUP
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/** @typedef struct netsnmp_agent_request_info_s netsnmp_agent_request_info
+ * Typedefs the netsnmp_agent_request_info_s struct into
+ * netsnmp_agent_request_info
+ */
+
+/** @struct netsnmp_agent_request_info_s
+ * The agent transaction request structure
+ */
+ typedef struct netsnmp_agent_request_info_s {
+ int mode;
+ /** pdu contains authinfo, eg */
+/* netsnmp_pdu *pdu; */
+ struct netsnmp_agent_session_s *asp; /* may not be needed */
+ /*
+ * can be used to pass information on a per-pdu basis from a
+ * helper to the later handlers
+ */
+ netsnmp_data_list *agent_data;
+ } netsnmp_agent_request_info;
+
+ typedef struct netsnmp_cachemap_s {
+ int globalid;
+ int cacheid;
+ struct netsnmp_cachemap_s *next;
+ } netsnmp_cachemap;
+
+ typedef struct netsnmp_agent_session_s {
+ int mode;
+ netsnmp_session *session;
+ netsnmp_pdu *pdu;
+ netsnmp_pdu *orig_pdu;
+ int rw;
+ int exact;
+ int status;
+ int index;
+ int oldmode;
+
+ struct netsnmp_agent_session_s *next;
+
+ /*
+ * new API pointers
+ */
+ netsnmp_agent_request_info *reqinfo;
+ netsnmp_request_info *requests;
+ netsnmp_tree_cache *treecache;
+ netsnmp_variable_list **bulkcache;
+ int treecache_len; /* length of cache array */
+ int treecache_num; /* number of current cache entries */
+ netsnmp_cachemap *cache_store;
+ int vbcount;
+ } netsnmp_agent_session;
+
+ /*
+ * Address cache handling functions.
+ */
+
+ void netsnmp_addrcache_initialise(void);
+ void netsnmp_addrcache_destroy(void);
+ void netsnmp_addrcache_age(void);
+
+
+ /*
+ * config file parsing routines
+ */
+ int handle_snmp_packet(int, netsnmp_session *, int,
+ netsnmp_pdu *, void *);
+ void snmp_agent_parse_config(char *, char *);
+ netsnmp_agent_session *init_agent_snmp_session(netsnmp_session *,
+ netsnmp_pdu *);
+ void free_agent_snmp_session(netsnmp_agent_session *);
+ void
+ netsnmp_remove_and_free_agent_snmp_session(netsnmp_agent_session
+ *asp);
+#ifdef SNMP_NEED_REQUEST_LIST
+ void
+ netsnmp_free_agent_snmp_session_by_session(netsnmp_session * sess,
+ void (*free_request)
+ (netsnmp_request_list
+ *));
+#endif
+ int getNextSessID(void);
+ void dump_sess_list(void);
+ int init_master_agent(void);
+ void shutdown_master_agent(void);
+ int agent_check_and_process(int block);
+ void netsnmp_check_outstanding_agent_requests(void);
+
+ int netsnmp_request_set_error(netsnmp_request_info *request,
+ int error_value);
+ int netsnmp_check_requests_error(netsnmp_request_info *reqs);
+ int netsnmp_check_all_requests_error(netsnmp_agent_session *asp,
+ int look_for_specific);
+ int
+ netsnmp_set_all_requests_error(netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests,
+ int error_value);
+ int netsnmp_request_set_error_idx(netsnmp_request_info *requests,
+ int error_value, int idx);
+ int
+ netsnmp_request_set_error_all(netsnmp_request_info *requests,
+ int error_value);
+
+ /** deprecated, use netsnmp_request_set_error instead */
+ int netsnmp_set_request_error(netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *request, int error_value);
+ /** deprecated, use netsnmp_request_set_error instead */
+ int netsnmp_set_mode_request_error(int mode,
+ netsnmp_request_info
+ *request,
+ int error_value);
+
+ u_long netsnmp_marker_uptime(marker_t pm);
+ u_long netsnmp_timeval_uptime(struct timeval *tv);
+ const_marker_t netsnmp_get_agent_starttime(void);
+ uint64_t netsnmp_get_agent_runtime(void);
+ void netsnmp_set_agent_starttime(marker_t s);
+ u_long netsnmp_get_agent_uptime(void);
+ void netsnmp_set_agent_uptime(u_long hsec);
+ int netsnmp_check_transaction_id(int transaction_id);
+ int netsnmp_agent_check_packet(netsnmp_session *,
+ struct netsnmp_transport_s
+ *, void *, int);
+ int netsnmp_agent_check_parse(netsnmp_session *,
+ netsnmp_pdu *, int);
+ int netsnmp_allocate_globalcacheid(void);
+
+ int netsnmp_remove_delegated_requests_for_session(netsnmp_session *sess);
+
+ /*
+ * Register and de-register agent NSAPs.
+ */
+
+ struct netsnmp_transport_s;
+
+ int netsnmp_register_agent_nsap(struct netsnmp_transport_s
+ *t);
+ void netsnmp_deregister_agent_nsap(int handle);
+
+ void
+ netsnmp_agent_add_list_data(netsnmp_agent_request_info *agent,
+ netsnmp_data_list *node);
+
+ int
+ netsnmp_agent_remove_list_data(netsnmp_agent_request_info *ari,
+ const char * name);
+
+ void *
+ netsnmp_agent_get_list_data(netsnmp_agent_request_info
+ *agent, const char *name);
+
+ void
+ netsnmp_free_agent_data_set(netsnmp_agent_request_info *agent);
+
+ void
+ netsnmp_free_agent_data_sets(netsnmp_agent_request_info *agent);
+ void
+ netsnmp_free_agent_request_info(netsnmp_agent_request_info *ari);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+/** @} */
diff --git a/include/net-snmp/agent/snmp_get_statistic.h b/include/net-snmp/agent/snmp_get_statistic.h
new file mode 100644
index 0000000..cc5d486
--- /dev/null
+++ b/include/net-snmp/agent/snmp_get_statistic.h
@@ -0,0 +1,20 @@
+#ifndef SNMP_GET_STATISTIC_H
+#define SNMP_GET_STATISTIC_H
+
+/** Registers a scalar group with statistics from @ref snmp_get_statistic.
+ * as reginfo.[start, start + end - begin].
+ * @param reginfo registration to register the items under
+ * @param start offset to the begin item
+ * @param begin first snmp_get_statistic key to return
+ * @param end last snmp_get_statistic key to return
+ */
+int
+netsnmp_register_statistic_handler(netsnmp_handler_registration *reginfo,
+ oid start, int begin, int end);
+
+#define NETSNMP_REGISTER_STATISTIC_HANDLER(reginfo, start, stat) \
+ netsnmp_register_statistic_handler(reginfo, start, \
+ STAT_ ## stat ## _STATS_START, \
+ STAT_ ## stat ## _STATS_END)
+
+#endif
diff --git a/include/net-snmp/agent/snmp_vars.h b/include/net-snmp/agent/snmp_vars.h
new file mode 100644
index 0000000..5ca2ffc
--- /dev/null
+++ b/include/net-snmp/agent/snmp_vars.h
@@ -0,0 +1,138 @@
+/*
+ * Definitions for SNMP (RFC 1067) agent variable finder.
+ *
+ */
+
+#ifndef _SNMP_VARS_H_
+#define _SNMP_VARS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* 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.
+ */
+
+ struct variable;
+
+ /**
+ * Duplicates a variable.
+ *
+ * @return Pointer to the duplicate variable upon success; NULL upon
+ * failure.
+ *
+ * @see struct variable
+ * @see struct variable1
+ * @see struct variable2
+ * @see struct variable3
+ * @see struct variable4
+ * @see struct variable7
+ * @see struct variable8
+ * @see struct variable13
+ */
+ struct variable *netsnmp_duplicate_variable(struct variable *var);
+
+ /*
+ * Function pointer called by the master agent for writes.
+ */
+ typedef int (WriteMethod) (int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t length);
+
+ /*
+ * Function pointer called by the master agent for mib information retrieval
+ */
+ typedef u_char *(FindVarMethod) (struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len,
+ WriteMethod ** write_method);
+
+ /*
+ * Function pointer called by the master agent for setting up subagent requests
+ */
+ typedef int (AddVarMethod) (netsnmp_agent_session *asp,
+ netsnmp_variable_list * vbp);
+
+ struct nlist;
+
+ extern long long_return;
+ extern u_char return_buf[];
+
+ extern oid nullOid[];
+ extern int nullOidLen;
+
+#define INST 0xFFFFFFFF /* used to fill out the instance field of the variables table */
+
+ struct variable {
+ u_char magic; /* passed to function as a hint */
+ char type; /* type of variable */
+ /*
+ * See important comment in snmp_vars.c relating to acl
+ */
+ u_short acl; /* access control list for variable */
+ FindVarMethod *findVar; /* function that finds variable */
+ u_char namelen; /* length of above */
+ oid name[MAX_OID_LEN]; /* object identifier of variable */
+ };
+
+ int init_agent(const char *);
+ void shutdown_agent(void);
+
+ int should_init(const char *module_name);
+ void add_to_init_list(char *module_list);
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+ void netsnmp_enable_subagent(void);
+#endif
+
+#ifndef _AGENT_REGISTRY_H
+#include <net-snmp/agent/agent_handler.h>
+#include <net-snmp/agent/var_struct.h>
+#include <net-snmp/agent/agent_registry.h>
+#endif
+
+ /*
+ * fail overloads non-negative integer value. it must be -1 !
+ */
+#define MATCH_FAILED (-1)
+#define MATCH_SUCCEEDED 0
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _SNMP_VARS_H_ */
diff --git a/include/net-snmp/agent/stash_cache.h b/include/net-snmp/agent/stash_cache.h
new file mode 100644
index 0000000..3709a27
--- /dev/null
+++ b/include/net-snmp/agent/stash_cache.h
@@ -0,0 +1,35 @@
+#ifndef STASH_CACHE_H
+#define STASH_CACHE_H
+
+#include <net-snmp/library/oid_stash.h>
+#include <net-snmp/library/tools.h>
+
+#define STASH_CACHE_NAME "stash_cache"
+
+typedef struct netsnmp_stash_cache_info_s {
+ int cache_valid;
+ marker_t cache_time;
+ netsnmp_oid_stash_node *cache;
+ int cache_length;
+} netsnmp_stash_cache_info;
+
+typedef struct netsnmp_stash_cache_data_s {
+ void *data;
+ size_t data_len;
+ u_char data_type;
+} netsnmp_stash_cache_data;
+
+/* function prototypes */
+void netsnmp_init_stash_cache_helper(void);
+netsnmp_mib_handler *netsnmp_get_bare_stash_cache_handler(void);
+netsnmp_mib_handler *netsnmp_get_stash_cache_handler(void);
+netsnmp_mib_handler *netsnmp_get_timed_bare_stash_cache_handler(int timeout,
+ oid *rootoid, size_t rootoid_len);
+netsnmp_mib_handler *netsnmp_get_timed_stash_cache_handler(int timeout,
+ oid *rootoid, size_t rootoid_len);
+Netsnmp_Node_Handler netsnmp_stash_cache_helper;
+netsnmp_oid_stash_node **netsnmp_extract_stash_cache(netsnmp_agent_request_info *reqinfo);
+int netsnmp_stash_cache_update(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests, netsnmp_stash_cache_info *cinfo);
+
+
+#endif /* STASH_CACHE_H */
diff --git a/include/net-snmp/agent/stash_to_next.h b/include/net-snmp/agent/stash_to_next.h
new file mode 100644
index 0000000..200b5aa
--- /dev/null
+++ b/include/net-snmp/agent/stash_to_next.h
@@ -0,0 +1,24 @@
+/*
+ * stash_to_next.h
+ */
+#ifndef STASH_TO_NEXT_H
+#define STASH_TO_NEXT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*
+ * The helper merely intercepts GETSTASH requests and converts them to
+ * GETNEXT reequests.
+ */
+
+
+netsnmp_mib_handler *netsnmp_get_stash_to_next_handler(void);
+Netsnmp_Node_Handler netsnmp_stash_to_next_helper;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/agent/sysORTable.h b/include/net-snmp/agent/sysORTable.h
new file mode 100644
index 0000000..bfebad2
--- /dev/null
+++ b/include/net-snmp/agent/sysORTable.h
@@ -0,0 +1,62 @@
+#ifndef NETSNMP_SYSORTABLE_H
+#define NETSNMP_SYSORTABLE_H
+
+struct sysORTable {
+ char *OR_descr;
+ oid *OR_oid;
+ size_t OR_oidlen;
+ netsnmp_session *OR_sess;
+ u_long OR_uptime;
+};
+
+struct register_sysOR_parameters {
+ char *descr;
+ oid *name;
+ size_t namelen;
+};
+
+#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
+
+#include <net-snmp/agent/agent_callbacks.h>
+
+#define REGISTER_SYSOR_TABLE(theoid, len, descr) \
+ do { \
+ struct sysORTable t; \
+ t.OR_descr = NETSNMP_REMOVE_CONST(char *, descr); \
+ t.OR_oid = theoid; \
+ t.OR_oidlen = len; \
+ t.OR_sess = NULL; \
+ t.OR_uptime = 0; \
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION, \
+ SNMPD_CALLBACK_REQ_REG_SYSOR, &t); \
+ } while(0);
+
+#define REGISTER_SYSOR_ENTRY(theoid, descr) \
+ REGISTER_SYSOR_TABLE(theoid, sizeof(theoid) / sizeof(oid), \
+ descr)
+
+#define UNREGISTER_SYSOR_TABLE(theoid, len) \
+ do { \
+ struct sysORTable t; \
+ t.OR_descr = NULL; \
+ t.OR_oid = theoid; \
+ t.OR_oidlen = len; \
+ t.OR_sess = NULL; \
+ t.OR_uptime = 0; \
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION, \
+ SNMPD_CALLBACK_REQ_UNREG_SYSOR, &t); \
+ } while(0);
+
+#define UNREGISTER_SYSOR_ENTRY(theoid) \
+ UNREGISTER_SYSOR_TABLE(theoid, sizeof(theoid) / sizeof(oid))
+
+#define UNREGISTER_SYSOR_SESS(sess) \
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION, \
+ SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS, \
+ sess);
+
+
+#endif /* NETSNMP_SYSORTABLE_H */
diff --git a/include/net-snmp/agent/table.h b/include/net-snmp/agent/table.h
new file mode 100644
index 0000000..79e588c
--- /dev/null
+++ b/include/net-snmp/agent/table.h
@@ -0,0 +1,200 @@
+/* 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.
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+/*
+ * @file table.h
+ *
+ * @addtogroup table
+ *
+ * @{
+ */
+#ifndef _TABLE_HANDLER_H_
+#define _TABLE_HANDLER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The table helper is designed to simplify the task of writing a
+ * table handler for the net-snmp agent. You should create a normal
+ * handler and register it using the netsnmp_register_table() function
+ * instead of the netsnmp_register_handler() function.
+ */
+
+/**
+ * Notes:
+ *
+ * 1) illegal indexes automatically get handled for get/set cases.
+ * Simply check to make sure the value is type ASN_NULL before
+ * you answer a request.
+ */
+
+/**
+ * used as an index to parent_data lookups
+ */
+#define TABLE_HANDLER_NAME "table"
+
+/** @typedef struct netsnmp_column_info_t netsnmp_column_info
+ * Typedefs the netsnmp_column_info_t struct into netsnmp_column_info */
+
+/**
+ * @struct netsnmp_column_info_t
+ * column info struct. OVERLAPPING RANGES ARE NOT SUPPORTED.
+ */
+ typedef struct netsnmp_column_info_t {
+ char isRange;
+ /** only useful if isRange == 0 */
+ char list_count;
+
+ union {
+ unsigned int range[2];
+ unsigned int *list;
+ } details;
+
+ struct netsnmp_column_info_t *next;
+
+ } netsnmp_column_info;
+
+/** @typedef struct netsnmp_table_registration_info_s netsnmp_table_registration_info
+ * Typedefs the netsnmp_table_registration_info_s struct into
+ * netsnmp_table_registration_info */
+
+/**
+ * @struct netsnmp_table_registration_info_s
+ * Table registration structure.
+ */
+ typedef struct netsnmp_table_registration_info_s {
+ /** list of varbinds with only 'type' set */
+ netsnmp_variable_list *indexes;
+ /** calculated automatically */
+ unsigned int number_indexes;
+
+ /**
+ * the minimum columns number. If there are columns
+ * in-between which are not valid, use valid_columns to get
+ * automatic column range checking.
+ */
+ unsigned int min_column;
+ /** the maximum columns number */
+ unsigned int max_column;
+
+ /** more details on columns */
+ netsnmp_column_info *valid_columns;
+
+ } netsnmp_table_registration_info;
+
+/** @typedef struct netsnmp_table_request_info_s netsnmp_table_request_info
+ * Typedefs the netsnmp_table_request_info_s struct into
+ * netsnmp_table_request_info */
+
+/**
+ * @struct netsnmp_table_request_info_s
+ * The table request info structure.
+ */
+ typedef struct netsnmp_table_request_info_s {
+ /** 0 if OID not long enough */
+ unsigned int colnum;
+ /** 0 if failure to parse any */
+ unsigned int number_indexes;
+ /** contents freed by helper upon exit */
+ netsnmp_variable_list *indexes;
+
+ oid index_oid[MAX_OID_LEN];
+ size_t index_oid_len;
+ netsnmp_table_registration_info *reg_info;
+ } netsnmp_table_request_info;
+
+ netsnmp_mib_handler
+ *netsnmp_get_table_handler(netsnmp_table_registration_info
+ *tabreq);
+ void netsnmp_handler_owns_table_info(netsnmp_mib_handler *handler);
+ void netsnmp_registration_owns_table_info(netsnmp_handler_registration *reg);
+ int netsnmp_register_table( netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreq);
+ int netsnmp_unregister_table(netsnmp_handler_registration *reginfo);
+ int netsnmp_table_build_oid( netsnmp_handler_registration *reginfo,
+ netsnmp_request_info *reqinfo,
+ netsnmp_table_request_info *table_info);
+ int
+ netsnmp_table_build_oid_from_index(netsnmp_handler_registration
+ *reginfo,
+ netsnmp_request_info *reqinfo,
+ netsnmp_table_request_info
+ *table_info);
+ 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);
+ int
+ netsnmp_update_variable_list_from_index(netsnmp_table_request_info
+ *);
+ int
+ netsnmp_update_indexes_from_variable_list
+ (netsnmp_table_request_info *tri);
+ netsnmp_table_registration_info
+ *netsnmp_find_table_registration_info(netsnmp_handler_registration
+ *reginfo);
+ netsnmp_table_registration_info *
+ netsnmp_table_registration_info_clone(netsnmp_table_registration_info *tri);
+ void netsnmp_table_registration_info_free(netsnmp_table_registration_info *);
+
+ netsnmp_index * netsnmp_table_index_find_next_row(netsnmp_container *c,
+ netsnmp_table_request_info *tblreq);
+
+ unsigned int netsnmp_closest_column(unsigned int current,
+ netsnmp_column_info
+ *valid_columns);
+
+ Netsnmp_Node_Handler table_helper_handler;
+
+#define netsnmp_table_helper_add_index(tinfo, type) snmp_varlist_add_variable(&tinfo->indexes, NULL, 0, (u_char)type, NULL, 0);
+
+ void
+ netsnmp_table_helper_add_indexes(netsnmp_table_registration_info
+ *tinfo, ...);
+
+ int netsnmp_check_getnext_reply(netsnmp_request_info *request,
+ oid * prefix, size_t prefix_len,
+ netsnmp_variable_list * newvar,
+ netsnmp_variable_list ** outvar);
+
+ netsnmp_table_request_info
+ *netsnmp_extract_table_info(netsnmp_request_info *);
+ netsnmp_oid_stash_node
+ **netsnmp_table_get_or_create_row_stash(netsnmp_agent_request_info
+ *reqinfo,
+ const u_char *
+ storage_name);
+ unsigned int
+ netsnmp_table_next_column(netsnmp_table_request_info *table_info);
+
+
+ int netsnmp_sparse_table_register(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreq);
+
+ netsnmp_mib_handler *netsnmp_sparse_table_handler_get(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TABLE_HANDLER_H_ */
+/** @} */
diff --git a/include/net-snmp/agent/table_array.h b/include/net-snmp/agent/table_array.h
new file mode 100644
index 0000000..afe0717
--- /dev/null
+++ b/include/net-snmp/agent/table_array.h
@@ -0,0 +1,158 @@
+/*
+ * table_array.h
+ * $Id$
+ */
+#ifndef _TABLE_ARRAY_HANDLER_H_
+#define _TABLE_ARRAY_HANDLER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * The table array helper is designed to simplify the task of
+ * writing a table handler for the net-snmp agent when the data being
+ * accessed is in an oid sorted form and must be accessed externally.
+ *
+ * Functionally, it is a specialized version of the more
+ * generic table helper but easies the burden of GETNEXT processing by
+ * retrieving the appropriate row for ead index through
+ * function calls which should be supplied by the module that wishes
+ * help. The module the table_array helps should, afterwards,
+ * never be called for the case of "MODE_GETNEXT" and only for the GET
+ * and SET related modes instead.
+ */
+
+#include <net-snmp/library/container.h>
+#include <net-snmp/agent/table.h>
+
+#define TABLE_ARRAY_NAME "table_array"
+
+ /*
+ * group_item is to allow us to keep a list of requests without
+ * disrupting the actual netsnmp_request_info list.
+ */
+ typedef struct netsnmp_request_group_item_s {
+ netsnmp_request_info *ri;
+ netsnmp_table_request_info *tri;
+ struct netsnmp_request_group_item_s *next;
+ } netsnmp_request_group_item;
+
+ /*
+ * structure to keep a list of requests for each unique index
+ */
+ typedef struct netsnmp_request_group_s {
+ /*
+ * index for this row. points to someone else's memory, so
+ * don't free it!
+ */
+ netsnmp_index index;
+
+ /*
+ * container in which rows belong
+ */
+ netsnmp_container *table;
+
+ /*
+ * actual old and new rows
+ */
+ netsnmp_index *existing_row;
+ netsnmp_index *undo_info;
+
+ /*
+ * flags
+ */
+ char row_created;
+ char row_deleted;
+ char fill1;
+ char fill2;
+
+ /*
+ * requests for this row
+ */
+ netsnmp_request_group_item *list;
+
+ int status;
+
+ void *rg_void;
+
+ } netsnmp_request_group;
+
+ typedef int (Netsnmp_User_Row_Operation_c) (const void *lhs,
+ const void *rhs);
+ typedef int (Netsnmp_User_Row_Operation) (void *lhs, void *rhs);
+ typedef int (Netsnmp_User_Get_Processor) (netsnmp_request_info *,
+ netsnmp_index
+ *,
+ netsnmp_table_request_info
+ *);
+ typedef netsnmp_index
+ *(UserRowMethod) (netsnmp_index *);
+ typedef int (Netsnmp_User_Row_Action) (netsnmp_index *,
+ netsnmp_index *,
+ netsnmp_request_group *);
+ typedef void (Netsnmp_User_Group_Method) (netsnmp_request_group *);
+
+ /*
+ * structure for array callbacks
+ */
+ typedef struct netsnmp_table_array_callbacks_s {
+
+ Netsnmp_User_Row_Operation *row_copy;
+ Netsnmp_User_Row_Operation_c *row_compare;
+
+ Netsnmp_User_Get_Processor *get_value;
+
+
+ Netsnmp_User_Row_Action *can_activate;
+ Netsnmp_User_Row_Action *activated;
+ Netsnmp_User_Row_Action *can_deactivate;
+ Netsnmp_User_Row_Action *deactivated;
+ Netsnmp_User_Row_Action *can_delete;
+
+ UserRowMethod *create_row;
+ UserRowMethod *duplicate_row;
+ UserRowMethod *delete_row; /* always returns NULL */
+
+ Netsnmp_User_Group_Method *set_reserve1;
+ Netsnmp_User_Group_Method *set_reserve2;
+ Netsnmp_User_Group_Method *set_action;
+ Netsnmp_User_Group_Method *set_commit;
+ Netsnmp_User_Group_Method *set_free;
+ Netsnmp_User_Group_Method *set_undo;
+
+ /** not callbacks, but this is a useful place for them... */
+ netsnmp_container* container;
+ char can_set;
+
+ } netsnmp_table_array_callbacks;
+
+
+ int
+ netsnmp_table_container_register(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info
+ *tabreq,
+ netsnmp_table_array_callbacks *cb,
+ netsnmp_container *container,
+ int group_rows);
+
+ int netsnmp_table_array_register(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreq,
+ netsnmp_table_array_callbacks *cb,
+ netsnmp_container *container,
+ int group_rows);
+
+ netsnmp_container * netsnmp_extract_array_context(netsnmp_request_info *);
+
+ Netsnmp_Node_Handler netsnmp_table_array_helper_handler;
+
+ int
+ netsnmp_table_array_check_row_status(netsnmp_table_array_callbacks *cb,
+ netsnmp_request_group *ag,
+ long *rs_new, long *rs_old);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TABLE_ARRAY_HANDLER_H_ */
diff --git a/include/net-snmp/agent/table_container.h b/include/net-snmp/agent/table_container.h
new file mode 100644
index 0000000..b342110
--- /dev/null
+++ b/include/net-snmp/agent/table_container.h
@@ -0,0 +1,108 @@
+/*
+ * table_container.h
+ * $Id$
+ */
+#ifndef _TABLE_CONTAINER_HANDLER_H_
+#define _TABLE_CONTAINER_HANDLER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * The table container helper is designed to simplify the task of
+ * writing a table handler for the net-snmp agent when the data being
+ * accessed is accessible via a netsnmp_container.
+ *
+ * Functionally, it is a specialized version of the more
+ * generic table helper but easies the burden of GETNEXT processing by
+ * retrieving the appropriate row for each index through
+ * function calls which should be supplied by the module that wishes
+ * help. The module the table_container helps should, afterwards,
+ * never be called for the case of "MODE_GETNEXT" and only for the GET
+ * and SET related modes instead.
+ */
+
+#include <net-snmp/library/container.h>
+#include <net-snmp/agent/table.h>
+
+#define TABLE_CONTAINER_ROW "table_container:row"
+#define TABLE_CONTAINER_CONTAINER "table_container:container"
+
+#define TABLE_CONTAINER_KEY_NETSNMP_INDEX 1 /* default */
+#define TABLE_CONTAINER_KEY_VARBIND_INDEX 2
+#define TABLE_CONTAINER_KEY_VARBIND_RAW 3
+
+/* ====================================
+ * Container Table API: MIB maintenance
+ * ==================================== */
+
+ /*
+ * get an injectable container table handler
+ */
+ netsnmp_mib_handler *
+ netsnmp_container_table_handler_get(netsnmp_table_registration_info *tabreq,
+ netsnmp_container *container,
+ char key_type);
+ /*
+ * register a container table
+ */
+ int
+ netsnmp_container_table_register(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreq,
+ netsnmp_container *container,
+ char key_type);
+ int
+ netsnmp_container_table_unregister(netsnmp_handler_registration *reginfo);
+
+ /** retrieve the container used by the table_container helper */
+ netsnmp_container*
+ netsnmp_container_table_container_extract(netsnmp_request_info *request);
+
+ /** find the context data used by the table_container helper */
+#ifdef NETSNMP_USE_INLINE
+ NETSNMP_STATIC_INLINE 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);
+ }
+
+ NETSNMP_STATIC_INLINE 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);
+ }
+#else
+ void *
+ netsnmp_container_table_row_extract(netsnmp_request_info *request);
+ void *
+ netsnmp_container_table_extract_context(netsnmp_request_info *request);
+#endif /* inline */
+
+ void netsnmp_container_table_row_insert(netsnmp_request_info *request,
+ netsnmp_index *row);
+ void netsnmp_container_table_row_remove(netsnmp_request_info *request,
+ netsnmp_index *row);
+
+/* ===================================
+ * Container Table API: Row operations
+ * =================================== */
+
+ void *
+ netsnmp_container_table_find_next_row(netsnmp_request_info *request,
+ netsnmp_table_request_info *tblreq,
+ netsnmp_container *container,
+ char key_type );
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TABLE_CONTAINER_HANDLER_H_ */
diff --git a/include/net-snmp/agent/table_data.h b/include/net-snmp/agent/table_data.h
new file mode 100644
index 0000000..f64475e
--- /dev/null
+++ b/include/net-snmp/agent/table_data.h
@@ -0,0 +1,124 @@
+/*
+ * table_iterator.h
+ */
+#ifndef _TABLE_DATA_HANDLER_H_
+#define _TABLE_DATA_HANDLER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * This helper is designed to completely automate the task of storing
+ * tables of data within the agent that are not tied to external data
+ * sources (like the kernel, hardware, or other processes, etc). IE,
+ * all rows within a table are expected to be added manually using
+ * functions found below.
+ */
+
+#define TABLE_DATA_NAME "table_data"
+#define TABLE_DATA_ROW "table_data"
+#define TABLE_DATA_TABLE "table_data_table"
+
+ typedef struct netsnmp_table_row_s {
+ netsnmp_variable_list *indexes; /* stored permanently if store_indexes = 1 */
+ oid *index_oid;
+ size_t index_oid_len;
+ void *data; /* the data to store */
+
+ struct netsnmp_table_row_s *next, *prev; /* if used in a list */
+ } netsnmp_table_row;
+
+ typedef struct netsnmp_table_data_s {
+ netsnmp_variable_list *indexes_template; /* containing only types */
+ char *name; /* if !NULL, it's registered globally */
+ int flags; /* not currently used */
+ int store_indexes;
+ netsnmp_table_row *first_row;
+ netsnmp_table_row *last_row;
+ } netsnmp_table_data;
+
+/* =================================
+ * Table Data API: Table maintenance
+ * ================================= */
+
+ void netsnmp_table_data_generate_index_oid( netsnmp_table_row *row);
+
+ netsnmp_table_data *netsnmp_create_table_data(const char *name);
+ netsnmp_table_row *netsnmp_create_table_data_row(void);
+ netsnmp_table_row *netsnmp_table_data_clone_row( netsnmp_table_row *row);
+ void *netsnmp_table_data_delete_row(netsnmp_table_row *row);
+ int netsnmp_table_data_add_row( netsnmp_table_data *table,
+ netsnmp_table_row *row);
+ void
+ netsnmp_table_data_replace_row(netsnmp_table_data *table,
+ netsnmp_table_row *origrow,
+ netsnmp_table_row *newrow);
+ netsnmp_table_row *netsnmp_table_data_remove_row(netsnmp_table_data *table,
+ netsnmp_table_row *row);
+ void *netsnmp_table_data_remove_and_delete_row(netsnmp_table_data *table,
+ netsnmp_table_row *row);
+ void netsnmp_table_data_delete_table( netsnmp_table_data *table );
+
+/* =================================
+ * Table Data API: MIB maintenance
+ * ================================= */
+
+ netsnmp_mib_handler *
+ netsnmp_get_table_data_handler(netsnmp_table_data *table);
+
+ int netsnmp_register_table_data(netsnmp_handler_registration *reginfo,
+ netsnmp_table_data *table,
+ netsnmp_table_registration_info *table_info);
+ int netsnmp_register_read_only_table_data(
+ netsnmp_handler_registration *reginfo,
+ netsnmp_table_data *table,
+ netsnmp_table_registration_info *table_info);
+ Netsnmp_Node_Handler netsnmp_table_data_helper_handler;
+
+ netsnmp_table_data *netsnmp_extract_table( netsnmp_request_info *);
+ netsnmp_table_row *netsnmp_extract_table_row(netsnmp_request_info *);
+ void *netsnmp_extract_table_row_data(netsnmp_request_info *);
+ void netsnmp_insert_table_row(netsnmp_request_info *, netsnmp_table_row *);
+
+ 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);
+
+/* =================================
+ * Table Data API: Row operations
+ * ================================= */
+
+ netsnmp_table_row *netsnmp_table_data_get_first_row(
+ netsnmp_table_data *table);
+ netsnmp_table_row *netsnmp_table_data_get_next_row(
+ netsnmp_table_data *table,
+ netsnmp_table_row *row);
+
+ netsnmp_table_row *netsnmp_table_data_get(netsnmp_table_data *table,
+ netsnmp_variable_list *indexes);
+
+ netsnmp_table_row *netsnmp_table_data_get_from_oid(
+ netsnmp_table_data *table,
+ oid * searchfor,
+ size_t searchfor_len);
+
+ int netsnmp_table_data_num_rows(netsnmp_table_data *table);
+
+
+/* =================================
+ * Table Data API: Index operations
+ * ================================= */
+
+#define netsnmp_table_data_add_index(thetable, type) snmp_varlist_add_variable(&thetable->indexes_template, NULL, 0, type, NULL, 0)
+#define netsnmp_table_row_add_index(row, type, value, value_len) snmp_varlist_add_variable(&row->indexes, NULL, 0, type, (const u_char *) value, value_len)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TABLE_DATA_HANDLER_H_ */
diff --git a/include/net-snmp/agent/table_dataset.h b/include/net-snmp/agent/table_dataset.h
new file mode 100644
index 0000000..66e3b3c
--- /dev/null
+++ b/include/net-snmp/agent/table_dataset.h
@@ -0,0 +1,196 @@
+/*
+ * table_iterator.h
+ */
+#ifndef _TABLE_DATA_SET_HANDLER_H_
+#define _TABLE_DATA_SET_HANDLER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * This helper is designed to completely automate the task of storing
+ * tables of data within the agent that are not tied to external data
+ * sources (like the kernel, hardware, or other processes, etc). IE,
+ * all rows within a table are expected to be added manually using
+ * functions found below.
+ */
+
+ void netsnmp_init_table_dataset(void);
+
+#define TABLE_DATA_SET_NAME "netsnmp_table_data_set"
+
+ /*
+ * return SNMP_ERR_NOERROR or some SNMP specific protocol error id
+ */
+ typedef int (Netsnmp_Value_Change_Ok) (char *old_value,
+ size_t old_value_len,
+ char *new_value,
+ size_t new_value_len,
+ void *mydata);
+
+ /*
+ * stored within a given row
+ */
+ typedef struct netsnmp_table_data_set_storage_s {
+ unsigned int column;
+
+ /*
+ * info about it?
+ */
+ char writable;
+ Netsnmp_Value_Change_Ok *change_ok_fn;
+ void *my_change_data;
+
+ /*
+ * data actually stored
+ */
+ u_char type;
+ union { /* value of variable */
+ void *voidp;
+ long *integer;
+ u_char *string;
+ oid *objid;
+ u_char *bitstring;
+ struct counter64 *counter64;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ float *floatVal;
+ double *doubleVal;
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ } data;
+ u_long data_len;
+
+ struct netsnmp_table_data_set_storage_s *next;
+ } netsnmp_table_data_set_storage;
+
+ typedef struct netsnmp_table_data_set_s {
+ netsnmp_table_data *table;
+ netsnmp_table_data_set_storage *default_row;
+ int allow_creation; /* set to 1 to allow creation of new rows */
+ unsigned int rowstatus_column;
+ } netsnmp_table_data_set;
+
+
+/* ============================
+ * DataSet API: Table maintenance
+ * ============================ */
+
+ netsnmp_table_data_set *netsnmp_create_table_data_set(const char *);
+ netsnmp_table_row *netsnmp_table_data_set_clone_row( netsnmp_table_row *row);
+ void netsnmp_table_dataset_delete_all_data(
+ netsnmp_table_data_set_storage *data);
+ void netsnmp_table_dataset_delete_row(netsnmp_table_row *row);
+
+ void netsnmp_table_dataset_add_row(netsnmp_table_data_set
+ *table,
+ netsnmp_table_row *row);
+ void
+ netsnmp_table_dataset_replace_row(netsnmp_table_data_set *table,
+ netsnmp_table_row *origrow,
+ netsnmp_table_row *newrow);
+ void netsnmp_table_dataset_remove_row(netsnmp_table_data_set
+ *table,
+ netsnmp_table_row *row);
+ void
+ netsnmp_table_dataset_remove_and_delete_row(netsnmp_table_data_set
+ *table,
+ netsnmp_table_row *row);
+ void netsnmp_delete_table_data_set(netsnmp_table_data_set *table_set);
+
+/* ============================
+ * DataSet API: Default row operations
+ * ============================ */
+
+ /*
+ * to set, add column, type, (writable) ? 1 : 0
+ */
+ /*
+ * default value, if not NULL, is the default value used in row
+ * creation. It is copied into the storage template (free your
+ * calling argument).
+ */
+ int netsnmp_table_set_add_default_row(netsnmp_table_data_set *,
+ unsigned int, int, int,
+ void *default_value,
+ size_t default_value_len);
+ void netsnmp_table_set_multi_add_default_row(netsnmp_table_data_set *,
+ ...);
+
+
+/* ============================
+ * DataSet API: MIB maintenance
+ * ============================ */
+
+ netsnmp_mib_handler
+ *netsnmp_get_table_data_set_handler(netsnmp_table_data_set *);
+ Netsnmp_Node_Handler netsnmp_table_data_set_helper_handler;
+ int netsnmp_register_table_data_set(netsnmp_handler_registration *,
+ netsnmp_table_data_set *,
+ netsnmp_table_registration_info *);
+ netsnmp_table_data_set
+ *netsnmp_extract_table_data_set(netsnmp_request_info *request);
+ netsnmp_table_data_set_storage
+ *netsnmp_extract_table_data_set_column(netsnmp_request_info *,
+ unsigned int);
+ netsnmp_oid_stash_node **
+ netsnmp_table_dataset_get_or_create_stash(netsnmp_agent_request_info *ari,
+ netsnmp_table_data_set *tds,
+ netsnmp_table_request_info *tri);
+ netsnmp_table_row *
+ netsnmp_table_dataset_get_newrow(netsnmp_request_info *request,
+ netsnmp_agent_request_info *reqinfo,
+ int rootoid_len,
+ netsnmp_table_data_set *datatable,
+ netsnmp_table_request_info *table_info);
+
+
+/* ============================
+ * DataSet API: Config-based operations
+ * ============================ */
+
+ void netsnmp_register_auto_data_table(netsnmp_table_data_set *table_set,
+ char *registration_name);
+ void netsnmp_unregister_auto_data_table(netsnmp_table_data_set *table_set,
+ char *registration_name);
+ void netsnmp_config_parse_table_set(const char *token, char *line);
+ void netsnmp_config_parse_add_row( const char *token, char *line);
+
+
+/* ============================
+ * DataSet API: Row operations
+ * ============================ */
+
+ netsnmp_table_row *netsnmp_table_data_set_get_first_row(netsnmp_table_data_set *table);
+ netsnmp_table_row *netsnmp_table_data_set_get_next_row( netsnmp_table_data_set *table,
+ netsnmp_table_row *row);
+ int netsnmp_table_set_num_rows(netsnmp_table_data_set *table);
+
+
+/* ============================
+ * DataSet API: Column operations
+ * ============================ */
+
+ netsnmp_table_data_set_storage
+ *netsnmp_table_data_set_find_column(netsnmp_table_data_set_storage *,
+ unsigned int);
+ int netsnmp_mark_row_column_writable( netsnmp_table_row *row,
+ int column, int writable);
+ int netsnmp_set_row_column( netsnmp_table_row *,
+ unsigned int, int, const void *,
+ size_t);
+
+/* ============================
+ * DataSet API: Index operations
+ * ============================ */
+
+ void netsnmp_table_dataset_add_index(netsnmp_table_data_set
+ *table, u_char type);
+ void netsnmp_table_set_add_indexes(netsnmp_table_data_set *tset, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#define netsnmp_table_row_add_column(row, type, value, value_len) snmp_varlist_add_variable(&row->indexes, NULL, 0, type, (u_char *) value, value_len)
+
+#endif /* _TABLE_DATA_SET_HANDLER_H_ */
diff --git a/include/net-snmp/agent/table_iterator.h b/include/net-snmp/agent/table_iterator.h
new file mode 100644
index 0000000..c71dd4e
--- /dev/null
+++ b/include/net-snmp/agent/table_iterator.h
@@ -0,0 +1,165 @@
+/* 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.
+ */
+/**
+ * @file table_iterator.h
+ * @addtogroup table_iterator
+ * @{
+ */
+#ifndef _TABLE_ITERATOR_HANDLER_H_
+#define _TABLE_ITERATOR_HANDLER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ struct netsnmp_iterator_info_s;
+
+ typedef netsnmp_variable_list *
+ (Netsnmp_First_Data_Point) (void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *,
+ struct netsnmp_iterator_info_s *);
+ typedef netsnmp_variable_list *
+ (Netsnmp_Next_Data_Point) (void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *,
+ struct netsnmp_iterator_info_s *);
+ typedef void *(Netsnmp_Make_Data_Context) (void *loop_context,
+ struct netsnmp_iterator_info_s *);
+ typedef void (Netsnmp_Free_Loop_Context) (void *,
+ struct netsnmp_iterator_info_s *);
+ typedef void (Netsnmp_Free_Data_Context) (void *,
+ struct netsnmp_iterator_info_s *);
+
+ /** @typedef struct netsnmp_iterator_info_s netsnmp_iterator_info
+ * Typedefs the netsnmp_iterator_info_s struct into netsnmp_iterator_info */
+
+ /** @struct netsnmp_iterator_info_s
+
+ * Holds iterator information containing functions which should be
+ called by the iterator_handler to loop over your data set and
+ sort it in a SNMP specific manner.
+
+ The netsnmp_iterator_info typedef can be used instead of directly calling this struct if you would prefer.
+ */
+ typedef struct netsnmp_iterator_info_s {
+ /** Number of handlers that own this data structure. */
+ int refcnt;
+
+ /** Responsible for: returning the first set of "index" data, a
+ loop-context pointer, and optionally a data context
+ pointer */
+ Netsnmp_First_Data_Point *get_first_data_point;
+
+ /** Given the previous loop context, this should return the
+ next loop context, associated index set and optionally a
+ data context */
+ Netsnmp_Next_Data_Point *get_next_data_point;
+
+ /** If a data context wasn't supplied by the
+ get_first_data_point or get_next_data_point functions and
+ the make_data_context pointer is defined, it will be called
+ to convert a loop context into a data context. */
+ Netsnmp_Make_Data_Context *make_data_context;
+
+ /** A function which should free the loop context. This
+ function is called at *each* iteration step, which is
+ not-optimal for speed purposes. The use of
+ free_loop_context_at_end instead is strongly
+ encouraged. This can be set to NULL to avoid its usage. */
+ Netsnmp_Free_Loop_Context *free_loop_context;
+
+ /** Frees a data context. This will be called at any time a
+ data context needs to be freed. This may be at the same
+ time as a correspondng loop context is freed, or much much
+ later. Multiple data contexts may be kept in existence at
+ any time. */
+ Netsnmp_Free_Data_Context *free_data_context;
+
+ /** Frees a loop context at the end of the entire iteration
+ sequence. Generally, this would free the loop context
+ allocated by the get_first_data_point function (which would
+ then be updated by each call to the get_next_data_point
+ function). It is not called until the get_next_data_point
+ function returns a NULL */
+ Netsnmp_Free_Loop_Context *free_loop_context_at_end;
+
+ /** This can be used by client handlers to store any
+ information they need */
+ void *myvoid;
+ int flags;
+#define NETSNMP_ITERATOR_FLAG_SORTED 0x01
+#define NETSNMP_HANDLER_OWNS_IINFO 0x02
+
+ /** A pointer to the netsnmp_table_registration_info object
+ this iterator is registered along with. */
+ netsnmp_table_registration_info *table_reginfo;
+
+ /* Experimental extension - Use At Your Own Risk
+ (these two fields may change/disappear without warning) */
+ Netsnmp_First_Data_Point *get_row_indexes;
+ netsnmp_variable_list *indexes;
+ } netsnmp_iterator_info;
+
+#define TABLE_ITERATOR_NAME "table_iterator"
+
+/* ============================
+ * Iterator API: Table maintenance
+ * ============================ */
+ /* N/A */
+
+/* ============================
+ * Iterator API: MIB maintenance
+ * ============================ */
+
+ void netsnmp_handler_owns_iterator_info(netsnmp_mib_handler *h);
+ netsnmp_mib_handler
+ *netsnmp_get_table_iterator_handler(netsnmp_iterator_info *iinfo);
+ int netsnmp_register_table_iterator(netsnmp_handler_registration *reginfo,
+ netsnmp_iterator_info *iinfo);
+ void netsnmp_iterator_delete_table(netsnmp_iterator_info *iinfo);
+
+ void *netsnmp_extract_iterator_context(netsnmp_request_info *);
+ void netsnmp_insert_iterator_context(netsnmp_request_info *, void *);
+
+ Netsnmp_Node_Handler netsnmp_table_iterator_helper_handler;
+
+#define netsnmp_register_table_iterator2(reginfo, iinfo) \
+ (((iinfo)->flags |= NETSNMP_HANDLER_OWNS_IINFO), \
+ netsnmp_register_table_iterator((reginfo), (iinfo)))
+
+
+/* ============================
+ * Iterator API: Row operations
+ * ============================ */
+
+void *netsnmp_iterator_row_first( netsnmp_iterator_info *);
+void *netsnmp_iterator_row_get( netsnmp_iterator_info *, void *);
+void *netsnmp_iterator_row_next( netsnmp_iterator_info *, void *);
+void *netsnmp_iterator_row_get_byidx( netsnmp_iterator_info *,
+ netsnmp_variable_list *);
+void *netsnmp_iterator_row_next_byidx( netsnmp_iterator_info *,
+ netsnmp_variable_list *);
+void *netsnmp_iterator_row_get_byoid( netsnmp_iterator_info *, oid *, size_t);
+void *netsnmp_iterator_row_next_byoid( netsnmp_iterator_info *, oid *, size_t);
+int netsnmp_iterator_row_count( netsnmp_iterator_info *);
+
+
+/* ============================
+ * Iterator API: Index operations
+ * ============================ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TABLE_ITERATOR_HANDLER_H_ */
+/** @} */
diff --git a/include/net-snmp/agent/table_tdata.h b/include/net-snmp/agent/table_tdata.h
new file mode 100644
index 0000000..b0a1689
--- /dev/null
+++ b/include/net-snmp/agent/table_tdata.h
@@ -0,0 +1,147 @@
+/*
+ * table_tdata.h
+ */
+#ifndef _TABLE_TDATA_HANDLER_H_
+#define _TABLE_TDATA_HANDLER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * This helper is designed to completely automate the task of storing
+ * tables of data within the agent that are not tied to external data
+ * sources (like the kernel, hardware, or other processes, etc). IE,
+ * all rows within a table are expected to be added manually using
+ * functions found below.
+ */
+
+#define TABLE_TDATA_NAME "table_tdata"
+#define TABLE_TDATA_ROW "table_tdata"
+#define TABLE_TDATA_TABLE "table_tdata_table"
+
+#define TDATA_FLAG_NO_STORE_INDEXES 0x01
+#define TDATA_FLAG_NO_CONTAINER 0x02 /* user will provide container */
+
+ /*
+ * The (table-independent) per-row data structure
+ * This is a wrapper round the table-specific per-row data
+ * structure, which is referred to as a "table entry"
+ *
+ * It should be regarded as an opaque, private data structure,
+ * and shouldn't be accessed directly.
+ */
+ typedef struct netsnmp_tdata_row_s {
+ netsnmp_index oid_index; /* table_container index format */
+ netsnmp_variable_list *indexes; /* stored permanently if store_indexes = 1 */
+ void *data; /* the data to store */
+ } netsnmp_tdata_row;
+
+ /*
+ * The data structure to hold a complete table.
+ *
+ * This should be regarded as an opaque, private data structure,
+ * and shouldn't be accessed directly.
+ */
+ typedef struct netsnmp_tdata_s {
+ netsnmp_variable_list *indexes_template; /* containing only types */
+ char *name; /* if !NULL, it's registered globally */
+ int flags; /* This field may legitimately be accessed by external code */
+ netsnmp_container *container;
+ } netsnmp_tdata;
+
+/* Backwards compatability with the previous (poorly named) data structures */
+typedef struct netsnmp_tdata_row_s netsnmp_table_data2row;
+typedef struct netsnmp_tdata_s netsnmp_table_data2;
+
+
+/* ============================
+ * TData API: Table maintenance
+ * ============================ */
+
+ netsnmp_tdata *netsnmp_tdata_create_table(const char *name, long flags);
+ void netsnmp_tdata_delete_table(netsnmp_tdata *table);
+ netsnmp_tdata_row *netsnmp_tdata_create_row(void);
+ netsnmp_tdata_row *netsnmp_tdata_clone_row( netsnmp_tdata_row *row);
+ int netsnmp_tdata_copy_row( netsnmp_tdata_row *dst_row,
+ netsnmp_tdata_row *src_row);
+ void *netsnmp_tdata_delete_row( netsnmp_tdata_row *row);
+
+ int netsnmp_tdata_add_row( netsnmp_tdata *table,
+ netsnmp_tdata_row *row);
+ void netsnmp_tdata_replace_row( netsnmp_tdata *table,
+ netsnmp_tdata_row *origrow,
+ netsnmp_tdata_row *newrow);
+ netsnmp_tdata_row *netsnmp_tdata_remove_row(netsnmp_tdata *table,
+ netsnmp_tdata_row *row);
+ void *netsnmp_tdata_remove_and_delete_row(netsnmp_tdata *table,
+ netsnmp_tdata_row *row);
+
+
+/* ============================
+ * TData API: MIB maintenance
+ * ============================ */
+
+ netsnmp_mib_handler *netsnmp_get_tdata_handler(netsnmp_tdata *table);
+
+ int netsnmp_tdata_register( netsnmp_handler_registration *reginfo,
+ netsnmp_tdata *table,
+ netsnmp_table_registration_info *table_info);
+ int netsnmp_tdata_unregister(netsnmp_handler_registration *reginfo);
+
+ netsnmp_tdata *netsnmp_tdata_extract_table( netsnmp_request_info *);
+ netsnmp_container *netsnmp_tdata_extract_container(netsnmp_request_info *);
+ netsnmp_tdata_row *netsnmp_tdata_extract_row( netsnmp_request_info *);
+ void *netsnmp_tdata_extract_entry( netsnmp_request_info *);
+
+ void netsnmp_insert_tdata_row(netsnmp_request_info *, netsnmp_tdata_row *);
+ void netsnmp_remove_tdata_row(netsnmp_request_info *, netsnmp_tdata_row *);
+
+
+/* ============================
+ * TData API: Row operations
+ * ============================ */
+
+ void * netsnmp_tdata_row_entry( netsnmp_tdata_row *row );
+ netsnmp_tdata_row *netsnmp_tdata_row_first(netsnmp_tdata *table);
+ netsnmp_tdata_row *netsnmp_tdata_row_get( netsnmp_tdata *table,
+ netsnmp_tdata_row *row);
+ netsnmp_tdata_row *netsnmp_tdata_row_next( netsnmp_tdata *table,
+ netsnmp_tdata_row *row);
+
+ netsnmp_tdata_row *netsnmp_tdata_row_get_byidx(netsnmp_tdata *table,
+ netsnmp_variable_list *indexes);
+ netsnmp_tdata_row *netsnmp_tdata_row_get_byoid(netsnmp_tdata *table,
+ oid *searchfor,
+ size_t searchfor_len);
+ netsnmp_tdata_row *netsnmp_tdata_row_next_byidx(netsnmp_tdata *table,
+ netsnmp_variable_list *indexes);
+ netsnmp_tdata_row *netsnmp_tdata_row_next_byoid(netsnmp_tdata *table,
+ oid *searchfor,
+ size_t searchfor_len);
+
+ int netsnmp_tdata_row_count(netsnmp_tdata *table);
+
+
+/* ============================
+ * TData API: Index operations
+ * ============================ */
+
+#define netsnmp_tdata_add_index(thetable, type) snmp_varlist_add_variable(&thetable->indexes_template, NULL, 0, type, NULL, 0)
+#define netsnmp_tdata_row_add_index(row, type, value, value_len) snmp_varlist_add_variable(&row->indexes, NULL, 0, type, (const u_char *) value, value_len)
+
+ int netsnmp_tdata_compare_idx( netsnmp_tdata_row *row,
+ netsnmp_variable_list *indexes);
+ int netsnmp_tdata_compare_oid( netsnmp_tdata_row *row,
+ oid *compareto, size_t compareto_len);
+ int netsnmp_tdata_compare_subtree_idx(netsnmp_tdata_row *row,
+ netsnmp_variable_list *indexes);
+ int netsnmp_tdata_compare_subtree_oid(netsnmp_tdata_row *row,
+ oid *compareto, size_t compareto_len);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TABLE_TDATA_HANDLER_H_ */
diff --git a/include/net-snmp/agent/var_struct.h b/include/net-snmp/agent/var_struct.h
new file mode 100644
index 0000000..15b5770
--- /dev/null
+++ b/include/net-snmp/agent/var_struct.h
@@ -0,0 +1,116 @@
+#ifndef VAR_STRUCT_H
+#define VAR_STRUCT_H
+/*
+ * The subtree structure contains a subtree prefix which applies to
+ * all variables in the associated variable list.
+ *
+ * By converting to a tree of subtree structures, entries can
+ * now be subtrees of another subtree in the structure. i.e:
+ * 1.2
+ * 1.2.0
+ */
+
+#define UCD_REGISTRY_OID_MAX_LEN 128
+
+/*
+ * subtree flags
+ */
+#define FULLY_QUALIFIED_INSTANCE 0x01
+#define SUBTREE_ATTACHED 0x02
+
+typedef struct netsnmp_subtree_s {
+ oid *name_a; /* objid prefix of registered subtree */
+ u_char namelen; /* number of subid's in name above */
+ oid *start_a; /* objid of start of covered range */
+ u_char start_len; /* number of subid's in start name */
+ oid *end_a; /* objid of end of covered range */
+ u_char end_len; /* number of subid's in end name */
+ struct variable *variables; /* pointer to variables array */
+ int variables_len; /* number of entries in above array */
+ int variables_width; /* sizeof each variable entry */
+ char *label_a; /* calling module's label */
+ netsnmp_session *session;
+ u_char flags;
+ u_char priority;
+ int timeout;
+ struct netsnmp_subtree_s *next; /* List of 'sibling' subtrees */
+ struct netsnmp_subtree_s *prev; /* (doubly-linked list) */
+ struct netsnmp_subtree_s *children; /* List of 'child' subtrees */
+ int range_subid;
+ oid range_ubound;
+ netsnmp_handler_registration *reginfo; /* new API */
+ int cacheid;
+ int global_cacheid;
+ size_t oid_off;
+} netsnmp_subtree;
+
+/*
+ * This is a new variable structure that doesn't have as much memory
+ * tied up in the object identifier. It's elements have also been re-arranged
+ * so that the name field can be variable length. Any number of these
+ * structures can be created with lengths tailor made to a particular
+ * application. The first 5 elements of the structure must remain constant.
+ */
+struct variable1 {
+ u_char magic; /* passed to function as a hint */
+ u_char type; /* type of variable */
+ u_short acl; /* access control list for variable */
+ FindVarMethod *findVar; /* function that finds variable */
+ u_char namelen; /* length of name below */
+ oid name[1]; /* object identifier of variable */
+};
+
+struct variable2 {
+ u_char magic; /* passed to function as a hint */
+ u_char type; /* type of variable */
+ u_short acl; /* access control list for variable */
+ FindVarMethod *findVar; /* function that finds variable */
+ u_char namelen; /* length of name below */
+ oid name[2]; /* object identifier of variable */
+};
+
+struct variable3 {
+ u_char magic; /* passed to function as a hint */
+ u_char type; /* type of variable */
+ u_short acl; /* access control list for variable */
+ FindVarMethod *findVar; /* function that finds variable */
+ u_char namelen; /* length of name below */
+ oid name[3]; /* object identifier of variable */
+};
+
+struct variable4 {
+ u_char magic; /* passed to function as a hint */
+ u_char type; /* type of variable */
+ u_short acl; /* access control list for variable */
+ FindVarMethod *findVar; /* function that finds variable */
+ u_char namelen; /* length of name below */
+ oid name[4]; /* object identifier of variable */
+};
+
+struct variable7 {
+ u_char magic; /* passed to function as a hint */
+ u_char type; /* type of variable */
+ u_short acl; /* access control list for variable */
+ FindVarMethod *findVar; /* function that finds variable */
+ u_char namelen; /* length of name below */
+ oid name[7]; /* object identifier of variable */
+};
+
+struct variable8 {
+ u_char magic; /* passed to function as a hint */
+ u_char type; /* type of variable */
+ u_short acl; /* access control list for variable */
+ FindVarMethod *findVar; /* function that finds variable */
+ u_char namelen; /* length of name below */
+ oid name[8]; /* object identifier of variable */
+};
+
+struct variable13 {
+ u_char magic; /* passed to function as a hint */
+ u_char type; /* type of variable */
+ u_short acl; /* access control list for variable */
+ FindVarMethod *findVar; /* function that finds variable */
+ u_char namelen; /* length of name below */
+ oid name[13]; /* object identifier of variable */
+};
+#endif /* VAR_STRUCT_H */
diff --git a/include/net-snmp/agent/watcher.h b/include/net-snmp/agent/watcher.h
new file mode 100644
index 0000000..67104ee
--- /dev/null
+++ b/include/net-snmp/agent/watcher.h
@@ -0,0 +1,148 @@
+/*
+ * watcher.h
+ */
+#ifndef NETSNMP_WATCHER_H
+#define NETSNMP_WATCHER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @ingroup watcher
+ * @{
+ */
+
+/*
+ * if handler flag has this bit set, the timestamp will be
+ * treated as a pointer to the timestamp. If this bit is
+ * not set (the default), the timestamp is a struct timeval
+ * that must be compared to the agent starttime.
+ */
+#define NETSNMP_WATCHER_DIRECT MIB_HANDLER_CUSTOM1
+
+/** The size of the watched object is constant.
+ * @hideinitializer
+ */
+#define WATCHER_FIXED_SIZE 0x01
+/** The maximum size of the watched object is stored in max_size.
+ * If WATCHER_SIZE_STRLEN is set then it is supposed that max_size + 1
+ * bytes could be stored in the buffer.
+ * @hideinitializer
+ */
+#define WATCHER_MAX_SIZE 0x02
+/** If set then the variable data_size_p points to is supposed to hold the
+ * current size of the watched object and will be updated on writes.
+ * @hideinitializer
+ * @since Net-SNMP 5.5
+ */
+#define WATCHER_SIZE_IS_PTR 0x04
+/** If set then data is suppposed to be a zero-terminated character array
+ * and both data_size and data_size_p are ignored. Additionally \\0 is a
+ * forbidden character in the data set.
+ * @hideinitializer
+ * @since Net-SNMP 5.5
+ */
+#define WATCHER_SIZE_STRLEN 0x08
+/** If set then size is in units of object identifiers.
+ * This is useful if you have an OID and tracks the OID_LENGTH of it as
+ * opposed to it's size.
+ * @hideinitializer
+ * @since Net-SNMP 5.5.1
+ */
+#define WATCHER_SIZE_UNIT_OIDS 0x10
+
+typedef struct netsnmp_watcher_info_s {
+ void *data;
+ size_t data_size;
+ size_t max_size;
+ u_char type;
+ int flags;
+ size_t *data_size_p;
+} netsnmp_watcher_info;
+
+/** @} */
+
+int netsnmp_register_watched_instance( netsnmp_handler_registration *reginfo,
+ netsnmp_watcher_info *winfo);
+int netsnmp_register_watched_instance2(netsnmp_handler_registration *reginfo,
+ netsnmp_watcher_info *winfo);
+int netsnmp_register_watched_scalar( netsnmp_handler_registration *reginfo,
+ netsnmp_watcher_info *winfo);
+int netsnmp_register_watched_scalar2( netsnmp_handler_registration *reginfo,
+ netsnmp_watcher_info *winfo);
+int netsnmp_register_watched_timestamp(netsnmp_handler_registration *reginfo,
+ marker_t timestamp);
+int netsnmp_watched_timestamp_register(netsnmp_mib_handler *whandler,
+ netsnmp_handler_registration *reginfo,
+ marker_t timestamp);
+int netsnmp_register_watched_spinlock(netsnmp_handler_registration *reginfo,
+ int *spinlock);
+
+/*
+ * Convenience registration calls
+ */
+
+int netsnmp_register_ulong_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler);
+int netsnmp_register_read_only_ulong_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler);
+int netsnmp_register_long_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ long * it,
+ Netsnmp_Node_Handler * subhandler);
+int netsnmp_register_read_only_long_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ long * it,
+ Netsnmp_Node_Handler * subhandler);
+int netsnmp_register_int_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ int * it,
+ Netsnmp_Node_Handler * subhandler);
+int netsnmp_register_read_only_int_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ int * it,
+ Netsnmp_Node_Handler * subhandler);
+int netsnmp_register_read_only_counter32_scalar(const char *name,
+ const oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler);
+
+#define WATCHER_HANDLER_NAME "watcher"
+
+netsnmp_mib_handler *netsnmp_get_watcher_handler(void);
+
+netsnmp_watcher_info *
+netsnmp_init_watcher_info(netsnmp_watcher_info *, void *, size_t, u_char, int);
+
+netsnmp_watcher_info *
+netsnmp_init_watcher_info6(netsnmp_watcher_info *,
+ void *, size_t, u_char, int, size_t, size_t*);
+
+netsnmp_watcher_info *
+netsnmp_create_watcher_info(void *, size_t, u_char, int);
+
+netsnmp_watcher_info *
+netsnmp_create_watcher_info6(void *, size_t, u_char, int, size_t, size_t*);
+
+netsnmp_watcher_info *
+netsnmp_clone_watcher_info(netsnmp_watcher_info *winfo);
+void
+netsnmp_owns_watcher_info(netsnmp_mib_handler *handler);
+
+Netsnmp_Node_Handler netsnmp_watcher_helper_handler;
+
+netsnmp_mib_handler *netsnmp_get_watched_timestamp_handler(void);
+Netsnmp_Node_Handler netsnmp_watched_timestamp_handler;
+
+netsnmp_mib_handler *netsnmp_get_watched_spinlock_handler(void);
+Netsnmp_Node_Handler netsnmp_watched_spinlock_handler;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** NETSNMP_WATCHER_H */
diff --git a/include/net-snmp/config_api.h b/include/net-snmp/config_api.h
new file mode 100644
index 0000000..048eed9
--- /dev/null
+++ b/include/net-snmp/config_api.h
@@ -0,0 +1,100 @@
+#ifndef NET_SNMP_CONFIG_API_H
+#define NET_SNMP_CONFIG_API_H
+
+ /**
+ * Library API routines concerned with configuration and control
+ * of the behaviour of the library, agent and other applications.
+ */
+
+#include <net-snmp/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Config Handlers */
+ NETSNMP_IMPORT
+ struct config_line *register_config_handler(const char *filePrefix,
+ const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void),
+ const char *usageLine);
+ NETSNMP_IMPORT
+ struct config_line *register_const_config_handler(const char *filePrefix,
+ const char *token,
+ void (*parser) (const char *, const char *),
+ void (*releaser) (void),
+ const char *usageLine);
+ NETSNMP_IMPORT
+ struct config_line *register_prenetsnmp_mib_handler(const char *filePrefix,
+ const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void),
+ const char *usageLine);
+ NETSNMP_IMPORT
+ void unregister_config_handler(const char *filePrefix, const char *token);
+
+ /* Defined in mib.c, rather than read_config.c */
+ void register_mib_handlers(void);
+ void unregister_all_config_handlers(void);
+
+ /* Application Handlers */
+ NETSNMP_IMPORT
+ struct config_line *register_app_config_handler(
+ const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void),
+ const char *usageLine);
+
+ NETSNMP_IMPORT
+ struct config_line *register_app_prenetsnmp_mib_handler(
+ const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void),
+ const char *usageLine);
+ NETSNMP_IMPORT
+ void unregister_app_config_handler( const char *token);
+
+ /* Reading Config Files */
+ NETSNMP_IMPORT
+ void read_configs(void);
+ NETSNMP_IMPORT
+ void read_premib_configs(void);
+
+ /* Help Strings and Errors */
+ NETSNMP_IMPORT
+ void read_config_print_usage(const char *lead);
+ NETSNMP_IMPORT
+ void config_perror(const char *);
+ NETSNMP_IMPORT
+ void config_pwarn(const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+ /*
+ * Having extracted the main ("public API") calls relevant
+ * to this area of the Net-SNMP project, the next step is to
+ * identify the related "public internal API" routines.
+ *
+ * In due course, these should probably be gathered
+ * together into a companion 'library/config_api.h' header file.
+ * [Or some suitable name]
+ *
+ * But for the time being, the expectation is that the
+ * traditional headers that provided the above definitions
+ * will probably also cover the relevant internal API calls.
+ * Hence they are listed here:
+ */
+#include <net-snmp/library/snmp_api.h>
+
+#include <net-snmp/library/read_config.h>
+#include <net-snmp/library/default_store.h>
+
+#include <stdio.h> /* for FILE definition */
+#include <net-snmp/library/snmp_parse_args.h>
+#include <net-snmp/library/snmp_enum.h>
+#include <net-snmp/library/vacm.h>
+
+#endif /* NET_SNMP_CONFIG_API_H */
diff --git a/include/net-snmp/data_access/arp.h b/include/net-snmp/data_access/arp.h
new file mode 100644
index 0000000..ba4bb21
--- /dev/null
+++ b/include/net-snmp/data_access/arp.h
@@ -0,0 +1,146 @@
+/*
+ * arp data access header
+ *
+ * $Id$
+ */
+#ifndef NETSNMP_ACCESS_ARP_H
+#define NETSNMP_ACCESS_ARP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**---------------------------------------------------------------------*/
+#if defined( NETSNMP_ENABLE_IPV6 )
+# define NETSNMP_ACCESS_ARP_IPADDR_BUF_SIZE 16
+#else
+# define NETSNMP_ACCESS_ARP_IPADDR_BUF_SIZE 4
+#endif
+
+/** MAC address is 6, InfiniBand uses more, 32 must be enough for near future.*/
+#define NETSNMP_ACCESS_ARP_PHYSADDR_BUF_SIZE 32
+
+/*************************************************************
+ * 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 redifinitions 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 */
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ */
+/*
+ * netsnmp_arp_entry
+ * - primary arp structure for both ipv4 & ipv6
+ */
+typedef struct netsnmp_arp_s {
+
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid ns_arp_index; /* arbitrary index */
+
+ int flags; /* for net-snmp use */
+
+ unsigned generation;
+ oid if_index;
+
+ u_char arp_physaddress[NETSNMP_ACCESS_ARP_PHYSADDR_BUF_SIZE];
+ u_char arp_ipaddress[NETSNMP_ACCESS_ARP_IPADDR_BUF_SIZE];
+
+ u_char arp_physaddress_len;/* phys address len, max 32 */
+ u_char arp_ipaddress_len; /* ip address len, 4 | 16 */
+ u_char arp_type; /* inetNetToMediaType 1-5 */
+ u_char arp_state; /* inetNetToMediaState 1-7 */
+
+ u_long arp_last_updated; /* timeticks of last update */
+} netsnmp_arp_entry;
+
+#define NETSNMP_ACCESS_ARP_ENTRY_FLAG_DELETE 0x00000001
+
+/**---------------------------------------------------------------------*/
+/*
+ * ACCESS function prototypes
+ */
+struct netsnmp_arp_access_s;
+typedef struct netsnmp_arp_access_s netsnmp_arp_access;
+
+typedef void (NetsnmpAccessArpUpdate)(netsnmp_arp_access *, netsnmp_arp_entry*);
+typedef void (NetsnmpAccessArpGC) (netsnmp_arp_access *);
+
+struct netsnmp_arp_access_s {
+ void *magic;
+ void *arch_magic;
+ int synchronized;
+ unsigned generation;
+ NetsnmpAccessArpUpdate *update_hook;
+ NetsnmpAccessArpGC *gc_hook;
+ char *cache_expired;
+};
+
+netsnmp_arp_access *
+netsnmp_access_arp_create(u_int init_flags,
+ NetsnmpAccessArpUpdate *update_hook,
+ NetsnmpAccessArpGC *gc_hook,
+ int *cache_timeout, int *cache_flags,
+ char *cache_expired);
+#define NETSNMP_ACCESS_ARP_CREATE_NOFLAGS 0x0000
+
+int netsnmp_access_arp_delete(netsnmp_arp_access *access);
+int netsnmp_access_arp_load(netsnmp_arp_access *access);
+int netsnmp_access_arp_unload(netsnmp_arp_access *access);
+
+/*
+ * create/free a arp+entry
+ */
+netsnmp_arp_entry *
+netsnmp_access_arp_entry_create(void);
+
+void netsnmp_access_arp_entry_free(netsnmp_arp_entry * entry);
+
+void netsnmp_access_arp_entry_update(netsnmp_arp_entry *entry,
+ netsnmp_arp_entry *new_data);
+
+/*
+ * find entry in container
+ */
+/** not yet */
+
+/**---------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_ARP_H */
diff --git a/include/net-snmp/data_access/defaultrouter.h b/include/net-snmp/data_access/defaultrouter.h
new file mode 100644
index 0000000..93ac18f
--- /dev/null
+++ b/include/net-snmp/data_access/defaultrouter.h
@@ -0,0 +1,114 @@
+/*
+ * defaultrouter data access header
+ *
+ * $Id:$
+ */
+#ifndef NETSNMP_ACCESS_DEFAULTROUTER_H
+#define NETSNMP_ACCESS_DEFAULTROUTER_H
+
+# ifdef __cplusplus
+extern "C" {
+#endif
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ */
+#if defined( NETSNMP_ENABLE_IPV6 )
+# define NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE 16 /* XXX: 20, for ip6z? */
+#else
+# define NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE 4
+#endif
+
+
+/*
+ * netsnmp_default_route_entry
+ */
+typedef struct netsnmp_defaultrouter_s {
+
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid ns_dr_index; /* arbitrary index */
+
+ int flags; /* for net-snmp use */
+
+ /*
+ * mib related data
+ */
+ u_char dr_addresstype; /* ipDefaultRouterAddressType */
+ char dr_address[NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE]; /* ipDefaultRouterAddress */
+ size_t dr_address_len; /* length of ipDefaultRouterAddress */
+ oid dr_if_index; /* ipDefaultRouterIfIndex */
+ uint32_t dr_lifetime; /* ipDefaultRouterLifetime (0-65535) */
+ char dr_preference; /* ipDefaultRouterPreference (-2,-1,0,1) */
+
+} netsnmp_defaultrouter_entry;
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * ACCESS function prototypes
+ */
+/*
+ * container init
+ */
+netsnmp_container *
+netsnmp_access_defaultrouter_container_init(u_int flags);
+#define NETSNMP_ACCESS_DEFAULTROUTER_INIT_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_DEFAULTROUTER_INIT_ADDL_IDX_BY_ADDR 0x0001
+
+/*
+ * container load
+ */
+netsnmp_container*
+netsnmp_access_defaultrouter_container_load(netsnmp_container* container,
+ u_int load_flags);
+#define NETSNMP_ACCESS_DEFAULTROUTER_LOAD_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_DEFAULTROUTER_LOAD_IPV4_ONLY 0x0001
+#define NETSNMP_ACCESS_DEFAULTROUTER_LOAD_IPV6_ONLY 0x0002
+#define NETSNMP_ACCESS_DEFAULTROUTER_LOAD_ADDL_IDX_BY_ADDR 0x0004
+
+/*
+ * container free
+ */
+void
+netsnmp_access_defaultrouter_container_free(netsnmp_container *container,
+ u_int free_flags);
+#define NETSNMP_ACCESS_DEFAULTROUTER_FREE_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_DEFAULTROUTER_FREE_DONT_CLEAR 0x0001
+#define NETSNMP_ACCESS_DEFAULTROUTER_FREE_KEEP_CONTAINER 0x0002
+
+/*
+ * entry create
+ */
+netsnmp_defaultrouter_entry *
+netsnmp_access_defaultrouter_entry_create(void);
+
+/*
+ * entry load
+ */
+int
+netsnmp_access_defaultrouter_entry_load(size_t *num_entries,
+ netsnmp_defaultrouter_entry **entries);
+
+/*
+ * entry update
+ */
+int
+netsnmp_access_defaultrouter_entry_update(netsnmp_defaultrouter_entry *lhs,
+ netsnmp_defaultrouter_entry *rhs);
+
+/*
+ * entry free
+ */
+void
+netsnmp_access_defaultrouter_entry_free(netsnmp_defaultrouter_entry *entry);
+
+
+
+/**---------------------------------------------------------------------*/
+
+# ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_DEFAULTROUTER_H */
diff --git a/include/net-snmp/data_access/interface.h b/include/net-snmp/data_access/interface.h
new file mode 100644
index 0000000..20013ed
--- /dev/null
+++ b/include/net-snmp/data_access/interface.h
@@ -0,0 +1,306 @@
+/*
+ * interface data access header
+ *
+ * $Id$
+ */
+#ifndef NETSNMP_ACCESS_INTERFACE_H
+#define NETSNMP_ACCESS_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * define flags to indicate the availability of certain data
+ */
+#define NETSNMP_INTERFACE_FLAGS_ACTIVE 0x00000001
+#define NETSNMP_INTERFACE_FLAGS_HAS_BYTES 0x00000002
+#define NETSNMP_INTERFACE_FLAGS_HAS_DROPS 0x00000004
+#define NETSNMP_INTERFACE_FLAGS_HAS_MCAST_PKTS 0x00000008
+#define NETSNMP_INTERFACE_FLAGS_HAS_HIGH_BYTES 0x00000010
+#define NETSNMP_INTERFACE_FLAGS_HAS_HIGH_PACKETS 0x00000020
+#define NETSNMP_INTERFACE_FLAGS_HAS_HIGH_SPEED 0x00000040
+#define NETSNMP_INTERFACE_FLAGS_DYNAMIC_SPEED 0x00000080
+#define NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE 0x00000100
+#define NETSNMP_INTERFACE_FLAGS_HAS_DISCONTINUITY 0x00000200
+#define NETSNMP_INTERFACE_FLAGS_HAS_IF_FLAGS 0x00000400
+#define NETSNMP_INTERFACE_FLAGS_CAN_DOWN_PROTOCOL 0x00000800
+#define NETSNMP_INTERFACE_FLAGS_HAS_IPV4 0x00001000
+#define NETSNMP_INTERFACE_FLAGS_HAS_IPV6 0x00002000
+#define NETSNMP_INTERFACE_FLAGS_HAS_V4_RETRANSMIT 0x00004000
+#define NETSNMP_INTERFACE_FLAGS_HAS_V4_REASMMAX 0x00008000
+#define NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT 0x00010000
+#define NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX 0x00020000
+#define NETSNMP_INTERFACE_FLAGS_HAS_V6_REACHABLE 0x00040000
+#define NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID 0x00080000
+#define NETSNMP_INTERFACE_FLAGS_HAS_V6_FORWARDING 0x00100000
+/* Some platforms, e.g.Linux, do not provide standalone counter
+ * for incoming unicast packets - they provide counter of all packets
+ * + separate counter for the multicast ones.
+ * That means the counter of all packets must watched and checked
+ * for overflows to reconstruct its 64-bit value (i.e. as usual
+ * for counter of unicast packets), and after its expansion to 64-bits,
+ * nr.of multicast packets must be substracted to get nr. of unicast
+ * packets.
+ * This flag marks stats of such platforms. Nr. of all incoming packets,
+ * provided by the platform, must be stored in
+ * netsnmp_interface_stats.iall and netsnmp_interface_stats.iucast will
+ * be automatically calculated later.
+ */
+#define NETSNMP_INTERFACE_FLAGS_CALCULATE_UCAST 0x00200000
+
+/*************************************************************
+ * 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 redifinitions 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 redifinitions 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 */
+
+/* nominal speed of network interface - used when the real speed is unknown */
+#define NOMINAL_LINK_SPEED 10000000
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ *
+ * NOTE: if you add fields, update code dealing with
+ * stats in interface_common.c, particularly
+ * netsnmp_access_interface_entry_update_stats()
+ *
+ */
+typedef struct netsnmp_interface_stats_s {
+ /*
+ * "Dynamic" fields
+ * Cached versions of byte/packet counters, etc
+ * (saved as a 'struct counter64' even if the
+ * high order half isn't actually used)
+ *
+ */
+ /** input */
+ struct counter64 ibytes;
+ /*
+ * nr. of all packets (to calculate iucast, when underlying platform does
+ * not provide it)
+ */
+ struct counter64 iall;
+ struct counter64 iucast;
+ struct counter64 imcast;
+ struct counter64 ibcast;
+ unsigned int ierrors;
+ unsigned int idiscards;
+ unsigned int iunknown_protos;
+ unsigned int inucast;
+ /** output */
+ struct counter64 obytes;
+ struct counter64 oucast;
+ struct counter64 omcast;
+ struct counter64 obcast;
+ unsigned int oerrors;
+ unsigned int odiscards;
+ unsigned int oqlen;
+ unsigned int collisions;
+ unsigned int onucast;
+} netsnmp_interface_stats;
+
+/*
+ *
+ * NOTE: if you add fields, update code dealing with
+ * them in interface_common.c, particularly
+ * netsnmp_access_interface_entry_copy().
+ */
+typedef struct netsnmp_interface_entry_s {
+ netsnmp_index oid_index;
+
+ u_int ns_flags; /* net-snmp flags */
+ oid index;
+
+ /*
+ * "Static" information
+ * Typically constant for a given interface
+ */
+ char *name;
+ char *descr;
+ int type;
+ u_int speed;
+ u_int speed_high;
+ char *paddr;
+ u_int paddr_len;
+ u_int mtu;
+
+ u_int retransmit_v4; /* milliseconds */
+ u_int retransmit_v6; /* milliseconds */
+
+ u_int reachable_time; /* ipv6 / milliseconds */
+
+ u_long lastchange;
+ time_t discontinuity;
+
+ uint16_t reasm_max_v4; /* 0..65535 */
+ uint16_t reasm_max_v6; /* 1500..65535 */
+ char admin_status;
+ char oper_status;
+
+ /** booleans (not TruthValues!) */
+ char promiscuous;
+ char connector_present;
+ char forwarding_v6;
+
+ char v6_if_id_len;
+ u_char v6_if_id[8];
+
+ /*-----------------------------------------------
+ * platform/arch/access specific data
+ */
+ u_int os_flags; /* iff NETSNMP_INTERFACE_FLAGS_HAS_IF_FLAGS */
+
+ /*
+ * statistics
+ */
+ netsnmp_interface_stats stats;
+
+ /** old_stats is used in netsnmp_access_interface_entry_update_stats */
+ netsnmp_interface_stats *old_stats;
+
+} netsnmp_interface_entry;
+
+/*
+ * conf file overrides
+ */
+typedef struct _conf_if_list {
+ const char *name;
+ int type;
+ uint64_t speed;
+ struct _conf_if_list *next;
+} netsnmp_conf_if_list;
+
+ typedef netsnmp_conf_if_list conf_if_list; /* backwards compat */
+
+/**---------------------------------------------------------------------*/
+/*
+ * ACCESS function prototypes
+ */
+void init_interface(void);
+void netsnmp_access_interface_init(void);
+
+/*
+ * ifcontainer init
+ */
+netsnmp_container * netsnmp_access_interface_container_init(u_int init_flags);
+#define NETSNMP_ACCESS_INTERFACE_INIT_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_INTERFACE_INIT_ADDL_IDX_BY_NAME 0x0001
+
+/*
+ * ifcontainer load and free
+ */
+netsnmp_container*
+netsnmp_access_interface_container_load(netsnmp_container* container,
+ u_int load_flags);
+#define NETSNMP_ACCESS_INTERFACE_LOAD_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_INTERFACE_LOAD_NO_STATS 0x0001
+#define NETSNMP_ACCESS_INTERFACE_LOAD_IP4_ONLY 0x0002
+#define NETSNMP_ACCESS_INTERFACE_LOAD_IP6_ONLY 0x0004
+
+void netsnmp_access_interface_container_free(netsnmp_container *container,
+ u_int free_flags);
+#define NETSNMP_ACCESS_INTERFACE_FREE_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_INTERFACE_FREE_DONT_CLEAR 0x0001
+
+
+/*
+ * create/free an ifentry
+ */
+netsnmp_interface_entry *
+netsnmp_access_interface_entry_create(const char *name, oid if_index);
+
+void netsnmp_access_interface_entry_free(netsnmp_interface_entry * entry);
+
+int
+netsnmp_access_interface_entry_set_admin_status(netsnmp_interface_entry * entry,
+ int ifAdminStatus);
+
+/*
+ * find entry in container
+ */
+netsnmp_interface_entry *
+netsnmp_access_interface_entry_get_by_name(netsnmp_container *container,
+ const char *name);
+netsnmp_interface_entry *
+netsnmp_access_interface_entry_get_by_index(netsnmp_container *container,
+ oid index);
+
+/*
+ * find ifIndex for given interface. 0 == not found.
+ */
+oid netsnmp_access_interface_index_find(const char *name);
+
+/*
+ * find name for given index
+ */
+const char *netsnmp_access_interface_name_find(oid index);
+
+/*
+ * copy interface entry data
+ */
+int netsnmp_access_interface_entry_copy(netsnmp_interface_entry * lhs,
+ netsnmp_interface_entry * rhs);
+
+/*
+ * utility routines
+ */
+void netsnmp_access_interface_entry_guess_speed(netsnmp_interface_entry *);
+void netsnmp_access_interface_entry_overrides(netsnmp_interface_entry *);
+
+
+netsnmp_conf_if_list *
+netsnmp_access_interface_entry_overrides_get(const char * name);
+
+/**---------------------------------------------------------------------*/
+
+#if defined( USING_IF_MIB_IFTABLE_IFTABLE_DATA_ACCESS_MODULE ) && \
+ ! defined( NETSNMP_NO_BACKWARDS_COMPATABILITY )
+void
+Interface_Scan_Init(void);
+int
+Interface_Scan_Next(short *index, char *name, netsnmp_interface_entry **entry,
+ void *dc);
+int
+Interface_Scan_NextInt(int *index, char *name, netsnmp_interface_entry **entry,
+ void *dc);
+#endif
+
+/**---------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_INTERFACE_H */
diff --git a/include/net-snmp/data_access/ip_scalars.h b/include/net-snmp/data_access/ip_scalars.h
new file mode 100644
index 0000000..f7b2e31
--- /dev/null
+++ b/include/net-snmp/data_access/ip_scalars.h
@@ -0,0 +1,19 @@
+#ifndef NETSNMP_ACCESS_IP_SCALARS_H
+#define NETSNMP_ACCESS_IP_SCALARS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int netsnmp_arch_ip_scalars_ipForwarding_get(u_long *value);
+int netsnmp_arch_ip_scalars_ipForwarding_set(u_long value);
+
+int netsnmp_arch_ip_scalars_ipv6IpForwarding_get(u_long *value);
+int netsnmp_arch_ip_scalars_ipv6IpForwarding_set(u_long value);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_IP_SCALARS_H */
diff --git a/include/net-snmp/data_access/ipaddress.h b/include/net-snmp/data_access/ipaddress.h
new file mode 100644
index 0000000..75056f2
--- /dev/null
+++ b/include/net-snmp/data_access/ipaddress.h
@@ -0,0 +1,168 @@
+/*
+ * ipaddress data access header
+ *
+ * $Id$
+ */
+#ifndef NETSNMP_ACCESS_IPADDRESS_H
+#define NETSNMP_ACCESS_IPADDRESS_H
+
+# ifdef __cplusplus
+extern "C" {
+#endif
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ */
+#if defined( NETSNMP_ENABLE_IPV6 )
+# define NETSNMP_ACCESS_IPADDRESS_BUF_SIZE 16 /* xxx-rks: 20, for ip6z? */
+#else
+# define NETSNMP_ACCESS_IPADDRESS_BUF_SIZE 4
+#endif
+
+
+/*
+ * netsnmp_ipaddress_entry
+ * - primary ipaddress structure for both ipv4 & ipv6
+ */
+typedef struct netsnmp_ipaddress_s {
+
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid ns_ia_index; /* arbitrary index */
+
+ int flags; /* for net-snmp use */
+
+ /*
+ * mib related data (considered for
+ * netsnmp_access_ipaddress_entry_update)
+ */
+
+ u_char ia_address[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
+
+ oid if_index;
+
+ u_char ia_address_len;/* address len, 4 | 16 */
+ u_char ia_prefix_len; /* 1-128 bits */
+ u_char ia_type; /* 1-3 */
+ u_char ia_status; /* IpAddressStatus (1-7) */
+ u_char ia_origin; /* IpAddressOrigin (1-6) */
+ u_char ia_storagetype; /* IpAddressStorageType (1-5) */
+ u_char ia_onlink_flag; /* IpOnlinkFlag */
+ u_char ia_autonomous_flag; /*IpAutonomousFlag */
+ u_long ia_prefered_lifetime;/*IpPreferedLifeTime*/
+ u_long ia_valid_lifetime;/*IpValidLifeTime*/
+ netsnmp_data_list *arch_data; /* arch specific data */
+
+} netsnmp_ipaddress_entry;
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * ACCESS function prototypes
+ */
+/*
+ * ifcontainer init
+ */
+netsnmp_container * netsnmp_access_ipaddress_container_init(u_int init_flags);
+#define NETSNMP_ACCESS_IPADDRESS_INIT_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_IPADDRESS_INIT_ADDL_IDX_BY_ADDR 0x0001
+
+/*
+ * ifcontainer load and free
+ */
+netsnmp_container*
+netsnmp_access_ipaddress_container_load(netsnmp_container* container,
+ u_int load_flags);
+#define NETSNMP_ACCESS_IPADDRESS_LOAD_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_IPADDRESS_LOAD_IPV4_ONLY 0x0001
+#define NETSNMP_ACCESS_IPADDRESS_LOAD_IPV6_ONLY 0x0002
+#define NETSNMP_ACCESS_IPADDRESS_LOAD_ADDL_IDX_BY_ADDR 0x0004
+
+void netsnmp_access_ipaddress_container_free(netsnmp_container *container,
+ u_int free_flags);
+#define NETSNMP_ACCESS_IPADDRESS_FREE_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_IPADDRESS_FREE_DONT_CLEAR 0x0001
+#define NETSNMP_ACCESS_IPADDRESS_FREE_KEEP_CONTAINER 0x0002
+
+
+/*
+ * create/free a ipaddress+entry
+ */
+netsnmp_ipaddress_entry *
+netsnmp_access_ipaddress_entry_create(void);
+
+void netsnmp_access_ipaddress_entry_free(netsnmp_ipaddress_entry * entry);
+
+/*
+ * copy
+ */
+int
+netsnmp_access_ipaddress_entry_copy(netsnmp_ipaddress_entry *old,
+ netsnmp_ipaddress_entry *new_val);
+
+/*
+ * update/compare
+ */
+int
+netsnmp_access_ipaddress_entry_update(netsnmp_ipaddress_entry *old,
+ netsnmp_ipaddress_entry *new_val);
+
+/*
+ * find entry in container
+ */
+/** not yet */
+
+/*
+ * create/change/delete
+ */
+int
+netsnmp_access_ipaddress_entry_set(netsnmp_ipaddress_entry * entry);
+
+
+/*
+ * ipaddress flags
+ * upper bits for internal use
+ * lower bits indicate changed fields. see FLAG_IPADDRESS* definitions in
+ * ipAddressTable_constants.h
+ */
+#define NETSNMP_ACCESS_IPADDRESS_CREATE 0x80000000
+#define NETSNMP_ACCESS_IPADDRESS_DELETE 0x40000000
+#define NETSNMP_ACCESS_IPADDRESS_CHANGE 0x20000000
+
+#define NETSNMP_ACCESS_IPADDRESS_ISALIAS 0x10000000
+
+/*
+ * mask for change flag bits
+ */
+#define NETSNMP_ACCESS_IPADDRESS_RESERVED_BITS 0x0000001f
+
+
+/*
+ * utility routines
+ */
+int netsnmp_ipaddress_prefix_copy(u_char *dst, u_char *src,
+ int addr_len, int pfx_len);
+
+int netsnmp_ipaddress_ipv4_prefix_len(in_addr_t mask);
+
+int netsnmp_ipaddress_flags_copy(u_long *ipAddressPrefixAdvPreferredLifetime,
+ u_long *ipAddressPrefixAdvValidLifetime,
+ u_long *ipAddressPrefixOnLinkFlag,
+ u_long *ipAddressPrefixAutonomousFlag,
+ u_long *ia_prefered_lifetime,
+ u_long *ia_valid_lifetime,
+ u_char *ia_onlink_flag,
+ u_char *ia_autonomous_flag);
+
+int netsnmp_ipaddress_prefix_origin_copy(u_long *ipAddressPrefixOrigin,
+ u_char ia_origin,
+ int flags,
+ u_long ipAddressAddrType);
+
+/**---------------------------------------------------------------------*/
+
+# ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_IPADDRESS_H */
diff --git a/include/net-snmp/data_access/ipstats.h b/include/net-snmp/data_access/ipstats.h
new file mode 100644
index 0000000..f782459
--- /dev/null
+++ b/include/net-snmp/data_access/ipstats.h
@@ -0,0 +1,110 @@
+/*
+ * ipstats data access header
+ *
+ * $Id$
+ */
+#ifndef NETSNMP_ACCESS_IPSTATS_H
+#define NETSNMP_ACCESS_IPSTATS_H
+
+# ifdef __cplusplus
+extern "C" {
+#endif
+
+#define IPSYSTEMSTATSTABLE_HCINRECEIVES 1
+#define IPSYSTEMSTATSTABLE_HCINOCTETS 2
+#define IPSYSTEMSTATSTABLE_INHDRERRORS 3
+#define IPSYSTEMSTATSTABLE_HCINNOROUTES 4
+#define IPSYSTEMSTATSTABLE_INADDRERRORS 5
+#define IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS 6
+#define IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS 7
+#define IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS 8
+#define IPSYSTEMSTATSTABLE_REASMREQDS 9
+#define IPSYSTEMSTATSTABLE_REASMOKS 10
+#define IPSYSTEMSTATSTABLE_REASMFAILS 11
+#define IPSYSTEMSTATSTABLE_INDISCARDS 12
+#define IPSYSTEMSTATSTABLE_HCINDELIVERS 13
+#define IPSYSTEMSTATSTABLE_HCOUTREQUESTS 14
+#define IPSYSTEMSTATSTABLE_HCOUTNOROUTES 15
+#define IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS 16
+#define IPSYSTEMSTATSTABLE_HCOUTDISCARDS 17
+#define IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS 18
+#define IPSYSTEMSTATSTABLE_HCOUTFRAGOKS 19
+#define IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS 20
+#define IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES 21
+#define IPSYSTEMSTATSTABLE_HCOUTTRANSMITS 22
+#define IPSYSTEMSTATSTABLE_HCOUTOCTETS 23
+#define IPSYSTEMSTATSTABLE_HCINMCASTPKTS 24
+#define IPSYSTEMSTATSTABLE_HCINMCASTOCTETS 25
+#define IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS 26
+#define IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS 27
+#define IPSYSTEMSTATSTABLE_HCINBCASTPKTS 28
+#define IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS 29
+#define IPSYSTEMSTATSTABLE_DISCONTINUITYTIME 30
+#define IPSYSTEMSTATSTABLE_REFRESHRATE 31
+
+#define IPSYSTEMSTATSTABLE_LAST IPSYSTEMSTATSTABLE_REFRESHRATE
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ */
+
+/*
+ * netsnmp_ipstats_entry
+ */
+typedef struct netsnmp_ipstats_s {
+
+ /* Columns of ipStatsTable. Some of them are HC for computation of the
+ * other columns, when underlying OS does not provide them.
+ * Always fill at least 32 bits, the table is periodically polled -> 32 bit
+ * overflow shall be detected and 64 bit value should be computed automatically. */
+ U64 HCInReceives;
+ U64 HCInOctets;
+ u_long InHdrErrors;
+ U64 HCInNoRoutes;
+ u_long InAddrErrors;
+ u_long InUnknownProtos;
+ u_long InTruncatedPkts;
+
+ /* optional, can be computed from HCInNoRoutes and HCOutForwDatagrams */
+ U64 HCInForwDatagrams;
+
+ u_long ReasmReqds;
+ u_long ReasmOKs;
+ u_long ReasmFails;
+ u_long InDiscards;
+ U64 HCInDelivers;
+ U64 HCOutRequests;
+ U64 HCOutNoRoutes;
+ U64 HCOutForwDatagrams;
+ U64 HCOutDiscards;
+
+ /* optional, can be computed from HCOutFragOKs + HCOutFragFails*/
+ U64 HCOutFragReqds;
+ U64 HCOutFragOKs;
+ U64 HCOutFragFails;
+ U64 HCOutFragCreates;
+
+ /* optional, can be computed from
+ * HCOutRequests +HCOutForwDatagrams + HCOutFragCreates
+ * - HCOutFragReqds - HCOutNoRoutes - HCOutDiscards */
+ U64 HCOutTransmits;
+
+ U64 HCOutOctets;
+ U64 HCInMcastPkts;
+ U64 HCInMcastOctets;
+ U64 HCOutMcastPkts;
+ U64 HCOutMcastOctets;
+ U64 HCInBcastPkts;
+ U64 HCOutBcastPkts;
+
+ /* Array of available columns.*/
+ int columnAvail[IPSYSTEMSTATSTABLE_LAST+1];
+} netsnmp_ipstats;
+
+
+# ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_IPSTATS_H */
diff --git a/include/net-snmp/data_access/net-snmp-data-access-includes.h b/include/net-snmp/data_access/net-snmp-data-access-includes.h
new file mode 100644
index 0000000..09faa14
--- /dev/null
+++ b/include/net-snmp/data_access/net-snmp-data-access-includes.h
@@ -0,0 +1,14 @@
+/*
+ * A simple helpful wrapper to include data access includes.
+ */
+#ifndef NETSNMP_DATA_ACCESS_INCLUDES
+#define NETSNMP_DATA_ACCESS_INCLUDES
+
+#include <net-snmp/data_access/arp.h>
+#include <net-snmp/data_access/interface.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/route.h>
+#include <net-snmp/data_access/ipstats.h>
+#include <net-snmp/data_access/systemstats.h>
+
+#endif /* NETSNMP_DATA_ACCESS_INCLUDES */
diff --git a/include/net-snmp/data_access/route.h b/include/net-snmp/data_access/route.h
new file mode 100644
index 0000000..d944d10
--- /dev/null
+++ b/include/net-snmp/data_access/route.h
@@ -0,0 +1,158 @@
+/*
+ * route data access header
+ *
+ * $Id$
+ */
+#ifndef NETSNMP_ACCESS_ROUTE_H
+#define NETSNMP_ACCESS_ROUTE_H
+
+# ifdef __cplusplus
+extern "C" {
+#endif
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ */
+#if defined( NETSNMP_ENABLE_IPV6 )
+# define NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE 16
+#else
+# define NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE 4
+#endif
+
+
+/*
+ * netsnmp_route_entry
+ * - primary route structure for both ipv4 & ipv6
+ */
+typedef struct netsnmp_route_s {
+
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid ns_rt_index; /* arbitrary index */
+
+ int flags; /* for net-snmp use */
+
+ oid if_index;
+
+ /*
+ * addresses, in network byte order
+ */
+ u_char rt_dest[NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE];
+ u_char rt_nexthop[NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE];
+
+#ifdef USING_IP_FORWARD_MIB_INETCIDRROUTETABLE_INETCIDRROUTETABLE_MODULE
+ /*
+ * define the maximum oid length for a policy, for use by the
+ * inetCidrRouteTable. Must be at least 2, for default nullOid case.
+ */
+#define NETSNMP_POLICY_OID_MAX_LEN 3
+ oid *rt_policy; /* NULL should be interpreted as { 0, 0 } */
+ u_char rt_policy_len; /* 0-128 oids */
+#endif
+
+ u_char rt_dest_len; /* 4 | 16 since we only do ipv4|ipv6 */
+ u_char rt_dest_type; /* InetAddressType 0-16 */
+ u_char rt_nexthop_len; /* 4 | 16 since we only do ipv4|ipv6*/
+ u_char rt_nexthop_type;/* InetAddressType 0-16 */
+ u_char rt_pfx_len; /* 0-128 bits */
+ u_char rt_type; /* ip(1-4) != inet(1-5) */
+ u_char rt_proto; /* ip(enum 1-16) ?= inet(IANAipRouteProtocol 1-17) */
+
+#ifdef USING_IP_FORWARD_MIB_IPCIDRROUTETABLE_IPCIDRROUTETABLE_MODULE
+ /** rt_info != inet_policy, because that would have made sense */
+ uint8_t rt_info_len; /* 0-128 oids */
+ oid *rt_info; /* NULL should be interpreted as { 0, 0 } */
+
+ uint32_t rt_mask; /* ipv4 only */
+ uint32_t rt_tos; /* Integer32 (0..2147483647) */
+#endif
+
+ uint32_t rt_age; /* seconds (ip == inet) */
+ int32_t rt_nexthop_as; /* ip(int32) == inet(InetAutonomousSystemNumber) */
+
+ int32_t rt_metric1;
+ int32_t rt_metric2;
+ int32_t rt_metric3;
+ int32_t rt_metric4;
+ int32_t rt_metric5;
+
+} netsnmp_route_entry;
+
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * ACCESS function prototypes
+ */
+/*
+ * ifcontainer init
+ */
+netsnmp_container * netsnmp_access_route_container_init(u_int init_flags);
+#define NETSNMP_ACCESS_ROUTE_INIT_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_ROUTE_INIT_ADDL_IDX_BY_NAME 0x0001
+
+/*
+ * ifcontainer load and free
+ */
+netsnmp_container*
+netsnmp_access_route_container_load(netsnmp_container* container,
+ u_int load_flags);
+#define NETSNMP_ACCESS_ROUTE_LOAD_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_ROUTE_LOAD_IPV4_ONLY 0x0001
+
+void netsnmp_access_route_container_free(netsnmp_container *container,
+ u_int free_flags);
+#define NETSNMP_ACCESS_ROUTE_FREE_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_ROUTE_FREE_DONT_CLEAR 0x0001
+#define NETSNMP_ACCESS_ROUTE_FREE_KEEP_CONTAINER 0x0002
+
+
+/*
+ * create/copy/free a route entry
+ */
+netsnmp_route_entry *
+netsnmp_access_route_entry_create(void);
+
+void netsnmp_access_route_entry_free(netsnmp_route_entry * entry);
+
+int
+netsnmp_access_route_entry_copy(netsnmp_route_entry *lhs,
+ netsnmp_route_entry *rhs);
+
+/*
+ * find entry in container
+ */
+/** not yet */
+
+/*
+ * create/change/delete
+ */
+int
+netsnmp_access_route_entry_set(netsnmp_route_entry * entry);
+
+/*
+ * route flags
+ * upper bits for internal use
+ * lower bits indicate changed fields. see FLAG_INETCIDRROUTE* definitions in
+ * inetCidrRouteTable_constants.h
+ */
+#define NETSNMP_ACCESS_ROUTE_CREATE 0x80000000
+#define NETSNMP_ACCESS_ROUTE_DELETE 0x40000000
+#define NETSNMP_ACCESS_ROUTE_CHANGE 0x20000000
+#define NETSNMP_ACCESS_ROUTE_POLICY_STATIC 0x10000000
+#define NETSNMP_ACCESS_ROUTE_POLICY_DEEP_COPY 0x08000000
+
+/*
+ * mask for change flag bits
+ */
+#define NETSNMP_ACCESS_ROUTE_RESERVED_BITS 0x000001ff
+
+
+
+/**---------------------------------------------------------------------*/
+
+# ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_ROUTE_H */
diff --git a/include/net-snmp/data_access/scopezone.h b/include/net-snmp/data_access/scopezone.h
new file mode 100644
index 0000000..de5c8bf
--- /dev/null
+++ b/include/net-snmp/data_access/scopezone.h
@@ -0,0 +1,68 @@
+/*
+ * scopezone data access header
+ *
+ * $Id: scopezone.h 14170 2007-04-29 02:22:12Z varun_c $
+ */
+#ifndef NETSNMP_ACCESS_SCOPEZONE_H
+#define NETSNMP_ACCESS_SCOPEZONE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ *
+ *
+ * NOTE: if you add fields, update code dealing with
+ * them in ipv6scopezone_common.c
+ */
+typedef struct netsnmp_v6scopezone_entry_s {
+ netsnmp_index oid_index;
+ oid ns_scopezone_index;
+ u_int ns_flags; /* net-snmp flags */
+ oid index;
+ int scopezone_linklocal;
+
+} netsnmp_v6scopezone_entry;
+
+/**---------------------------------------------------------------------*/
+/*
+ * ACCESS function prototypes
+ */
+
+/*
+ * scopezone container init
+ */
+netsnmp_container * netsnmp_access_scopezone_container_init(u_int init_flags);
+
+/*
+ * scopezone container load and free
+ */
+netsnmp_container*
+netsnmp_access_scopezone_container_load(netsnmp_container* container,
+ u_int load_flags);
+
+void netsnmp_access_scopezone_container_free(netsnmp_container *container,
+ u_int free_flags);
+#define NETSNMP_ACCESS_SCOPEZONE_FREE_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_SCOPEZONE_FREE_DONT_CLEAR 0x0001
+#define NETSNMP_ACCESS_SCOPEZONE_FREE_KEEP_CONTAINER 0x0002
+
+
+/*
+ * create/free an scopezone entry
+ */
+netsnmp_v6scopezone_entry *
+netsnmp_access_scopezone_entry_create(void);
+
+void netsnmp_access_scopezone_entry_free(netsnmp_v6scopezone_entry * entry);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_SCOPEZONE_H */
diff --git a/include/net-snmp/data_access/swinst.h b/include/net-snmp/data_access/swinst.h
new file mode 100644
index 0000000..0e28df1
--- /dev/null
+++ b/include/net-snmp/data_access/swinst.h
@@ -0,0 +1,77 @@
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#ifndef NETSNMP_SWINST_H
+#define NETSNMP_SWINST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * Data structure for a swinst entry
+ */
+ typedef struct hrSWInstalledTable_entry {
+ netsnmp_index oid_index;
+
+ /*
+ * Index values; MIB type is int32, but we use oid so this
+ * structure can be used directly with a table_container.
+ */
+ oid swIndex;
+
+ /*
+ * Column values
+ */
+ char swName[64];
+ char swDate[11];
+#ifdef NETSNMP_HAVE_SWID
+ oid *swID;
+ u_char swID_len;
+#endif
+ u_char swType;
+ u_char swName_len;
+ u_char swDate_len;
+ } netsnmp_swinst_entry;
+
+#define HRSWINSTALLEDTYPE_UNKNOWN 1
+#define HRSWINSTALLEDTYPE_OPERATINGSYSTEM 2
+#define HRSWINSTALLEDTYPE_DEVICEDRIVER 3
+#define HRSWINSTALLEDTYPE_APPLICATION 4
+
+
+#define NETSNMP_SWINST_NOFLAGS 0x00000000
+
+#define NETSNMP_SWINST_ALL_OR_NONE 0x00000001
+#define NETSNMP_SWINST_DONT_FREE_ITEMS 0x00000002
+
+ netsnmp_container *
+ netsnmp_swinst_container_load(netsnmp_container *container, int flags );
+
+ void netsnmp_swinst_container_free(netsnmp_container *container,
+ u_int flags);
+ void netsnmp_swinst_container_free_items(netsnmp_container *container);
+
+ void netsnmp_swinst_entry_remove(netsnmp_container * container,
+ netsnmp_swinst_entry *entry);
+
+ netsnmp_swinst_entry * netsnmp_swinst_entry_create(int32_t index);
+ void netsnmp_swinst_entry_free(netsnmp_swinst_entry *entry);
+
+ int32_t netsnmp_swinst_add_name(const char *name);
+ int32_t netsnmp_swinst_get_id(const char *name);
+ const char * netsnmp_swinst_get_name(int32_t id);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* NETSNMP_SWINST_H */
diff --git a/include/net-snmp/data_access/swrun.h b/include/net-snmp/data_access/swrun.h
new file mode 100644
index 0000000..3e15c41
--- /dev/null
+++ b/include/net-snmp/data_access/swrun.h
@@ -0,0 +1,104 @@
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#ifndef NETSNMP_SWRUN_H
+#define NETSNMP_SWRUN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*-*****************************************************************
+ *
+ * Data structure for a row entry
+ */
+ typedef struct hrSWRunTable_entry {
+ netsnmp_index oid_index;
+
+ /*
+ * Index values
+ */
+ oid hrSWRunIndex;
+
+ /*
+ * Column values
+ */
+ char hrSWRunName[ 64+1]; /* size per MIB + 1 */
+ char hrSWRunPath[128+1]; /* size per MIB + 1 */
+ char hrSWRunParameters[128+1]; /* size per MIB + 1 */
+#ifdef NETSNMP_SWRUN_HAVE_ID /* if not defined, will always use nullOid */
+ oid hrSWRunID[SNMP_MAXOID];
+ u_char hrSWRunID_len;
+#endif
+ u_char hrSWRunName_len;
+ u_char hrSWRunPath_len;
+ u_char hrSWRunParameters_len;
+
+ u_char hrSWRunType;
+ u_char hrSWRunStatus;
+ u_char old_hrSWRunStatus;
+
+ /*
+ * Perf values
+ */
+ int32_t hrSWRunPerfCPU;
+ int32_t hrSWRunPerfMem;
+
+ } netsnmp_swrun_entry;
+
+ /*
+ * enums for column hrSWRunType
+ */
+#define HRSWRUNTYPE_UNKNOWN 1
+#define HRSWRUNTYPE_OPERATINGSYSTEM 2
+#define HRSWRUNTYPE_DEVICEDRIVER 3
+#define HRSWRUNTYPE_APPLICATION 4
+
+ /*
+ * enums for column hrSWRunStatus
+ */
+#define HRSWRUNSTATUS_RUNNING 1
+#define HRSWRUNSTATUS_RUNNABLE 2
+#define HRSWRUNSTATUS_NOTRUNNABLE 3
+#define HRSWRUNSTATUS_INVALID 4
+
+ /*-*****************************************************************
+ *
+ * Prototypes
+ */
+ netsnmp_container *
+ netsnmp_swrun_container_load(netsnmp_container *container, u_int flags );
+
+ void netsnmp_swrun_container_free(netsnmp_container *container, u_int flags);
+ void netsnmp_swrun_container_free_items(netsnmp_container * container);
+
+ netsnmp_swrun_entry *
+ netsnmp_swrun_entry_create(int32_t swIndex);
+
+ void netsnmp_swrun_entry_free(netsnmp_swrun_entry *entry);
+
+ int swrun_count_processes( void );
+ int swrun_max_processes( void );
+ int swrun_count_processes_by_name( char *name );
+
+#define NETSNMP_SWRUN_NOFLAGS 0x00000000
+#define NETSNMP_SWRUN_ALL_OR_NONE 0x00000001
+#define NETSNMP_SWRUN_DONT_FREE_ITEMS 0x00000002
+/*#define NETSNMP_SWRUN_xx 0x00000004 */
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* NETSNMP_SWRUN_H */
+
+
diff --git a/include/net-snmp/data_access/systemstats.h b/include/net-snmp/data_access/systemstats.h
new file mode 100644
index 0000000..c72dfbb
--- /dev/null
+++ b/include/net-snmp/data_access/systemstats.h
@@ -0,0 +1,106 @@
+/*
+ * systemstats data access header
+ *
+ * $Id$
+ */
+#ifndef NETSNMP_ACCESS_SYSTEMSTATS_H
+#define NETSNMP_ACCESS_SYSTEMSTATS_H
+
+# ifdef __cplusplus
+extern "C" {
+#endif
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ */
+
+
+/*
+ * netsnmp_systemstats_entry
+ */
+typedef struct netsnmp_systemstats_s {
+
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ /*
+ * Index of the table
+ * First entry = ip version
+ * Second entry = interface index (0 for ipSystemStatsTable */
+ oid index[2];
+
+ int flags; /* for net-snmp use */
+
+ /*
+ * mib related data (considered for
+ * netsnmp_access_systemstats_entry_update)
+ */
+ netsnmp_ipstats stats;
+
+ /*
+ * for logging
+ */
+ const char* tableName;
+
+ /** old_stats is used in netsnmp_access_interface_entry_update_stats */
+ netsnmp_ipstats *old_stats;
+
+} netsnmp_systemstats_entry;
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * ACCESS function prototypes
+ */
+/*
+ * init
+ */
+void netsnmp_access_systemstats_init(void);
+
+/*
+ * init
+ */
+netsnmp_container * netsnmp_access_systemstats_container_init(u_int init_flags);
+#define NETSNMP_ACCESS_SYSTEMSTATS_INIT_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_SYSTEMSTATS_INIT_ADDL_IDX_BY_ADDR 0x0001
+
+/**
+ * Load container. If the NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE is set
+ * the ipIfSystemStats table is loaded, else ipSystemStatsTable is loaded.
+ */
+netsnmp_container*
+netsnmp_access_systemstats_container_load(netsnmp_container* container,
+ u_int load_flags);
+#define NETSNMP_ACCESS_SYSTEMSTATS_LOAD_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE 0x0001
+
+void netsnmp_access_systemstats_container_free(netsnmp_container *container,
+ u_int free_flags);
+#define NETSNMP_ACCESS_SYSTEMSTATS_FREE_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_SYSTEMSTATS_FREE_DONT_CLEAR 0x0001
+#define NETSNMP_ACCESS_SYSTEMSTATS_FREE_KEEP_CONTAINER 0x0002
+
+
+/*
+ * create/free an entry
+ */
+netsnmp_systemstats_entry *
+netsnmp_access_systemstats_entry_create(int version, int if_index,
+ const char* tableName);
+
+void netsnmp_access_systemstats_entry_free(netsnmp_systemstats_entry * entry);
+
+/*
+ * update/compare
+ */
+int
+netsnmp_access_systemstats_entry_update(netsnmp_systemstats_entry *old,
+ netsnmp_systemstats_entry *new_val);
+
+
+/**---------------------------------------------------------------------*/
+
+# ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_SYSTEMSTATS_H */
diff --git a/include/net-snmp/data_access/tcpConn.h b/include/net-snmp/data_access/tcpConn.h
new file mode 100644
index 0000000..d9ef7b2
--- /dev/null
+++ b/include/net-snmp/data_access/tcpConn.h
@@ -0,0 +1,130 @@
+/*
+ * tcpConn data access header
+ *
+ * $Id$
+ */
+#ifndef NETSNMP_ACCESS_TCPCONN_H
+#define NETSNMP_ACCESS_TCPCONN_H
+
+/** need def of NETSNMP_ACCESS_IPADDRESS_BUF_SIZE */
+#include <net-snmp/data_access/ipaddress.h>
+
+# ifdef __cplusplus
+extern "C" {
+#endif
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ */
+
+/*
+ * netsnmp_tcpconn_entry
+ * - primary tcpconn structure for both ipv4 & ipv6
+ */
+ typedef struct netsnmp_tcpconn_s {
+
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid arbitrary_index; /* arbitrary index */
+
+ int flags; /* for net-snmp use */
+
+ u_char loc_addr[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
+ u_char rmt_addr[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
+
+ u_char loc_addr_len;/* address len, 4 | 16 */
+ u_char rmt_addr_len;/* address len, 4 | 16 */
+
+ u_short loc_port;
+ u_short rmt_port;
+
+ /*
+ * mib related data (considered for
+ * netsnmp_access_tcpconn_entry_update)
+ */
+
+ /*
+ * tcpconnState(1)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_int tcpConnState; /* 1-12 */
+
+ u_int pid;
+
+ netsnmp_data_list *arch_data; /* arch specific data */
+
+ } netsnmp_tcpconn_entry;
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * ACCESS function prototypes
+ */
+/*
+ * ifcontainer init
+ */
+ netsnmp_container * netsnmp_access_tcpconn_container_init(u_int init_flags);
+#define NETSNMP_ACCESS_TCPCONN_INIT_NOFLAGS 0x0000
+
+/*
+ * ifcontainer load and free
+ */
+ netsnmp_container*
+ netsnmp_access_tcpconn_container_load(netsnmp_container* container,
+ u_int load_flags);
+#define NETSNMP_ACCESS_TCPCONN_LOAD_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_TCPCONN_LOAD_NOLISTEN 0x0001
+#define NETSNMP_ACCESS_TCPCONN_LOAD_ONLYLISTEN 0x0002
+#define NETSNMP_ACCESS_TCPCONN_LOAD_IPV4_ONLY 0x0004
+
+ void netsnmp_access_tcpconn_container_free(netsnmp_container *container,
+ u_int free_flags);
+#define NETSNMP_ACCESS_TCPCONN_FREE_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_TCPCONN_FREE_DONT_CLEAR 0x0001
+#define NETSNMP_ACCESS_TCPCONN_FREE_KEEP_CONTAINER 0x0002
+
+
+/*
+ * create/free a tcpconn entry
+ */
+ netsnmp_tcpconn_entry *
+ netsnmp_access_tcpconn_entry_create(void);
+
+ void netsnmp_access_tcpconn_entry_free(netsnmp_tcpconn_entry * entry);
+
+/*
+ * update/compare
+ */
+ int
+ netsnmp_access_tcpconn_entry_update(netsnmp_tcpconn_entry *old,
+ netsnmp_tcpconn_entry *new_val);
+
+/*
+ * find entry in container
+ */
+/** not yet */
+
+/*
+ * create/change/delete
+ */
+ int
+ netsnmp_access_tcpconn_entry_set(netsnmp_tcpconn_entry * entry);
+
+
+/*
+ * tcpconn flags
+ * upper bits for internal use
+ * lower bits indicate changed fields. see FLAG_TCPCONN* definitions in
+ * tcpConnTable_constants.h
+ */
+#define NETSNMP_ACCESS_TCPCONN_CREATE 0x80000000
+#define NETSNMP_ACCESS_TCPCONN_DELETE 0x40000000
+#define NETSNMP_ACCESS_TCPCONN_CHANGE 0x20000000
+
+
+/**---------------------------------------------------------------------*/
+
+# ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_TCPCONN_H */
diff --git a/include/net-snmp/data_access/udp_endpoint.h b/include/net-snmp/data_access/udp_endpoint.h
new file mode 100644
index 0000000..36231ee
--- /dev/null
+++ b/include/net-snmp/data_access/udp_endpoint.h
@@ -0,0 +1,100 @@
+/*
+ * udp_endpoint data access header
+ *
+ * $Id$
+ */
+#ifndef NETSNMP_ACCESS_UDP_ENDPOINT_H
+#define NETSNMP_ACCESS_UDP_ENDPOINT_H
+
+#ifndef NETSNMP_ACCESS_IPADDRESS_BUF_SIZE
+# error "include <net-snmp/data_access/ipaddress.h> before this file"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**---------------------------------------------------------------------*/
+/*
+ * structure definitions
+ */
+
+/*
+ * netsnmp_udp_endpoint_entry
+ * - primary udp_endpoint structure for both ipv4 & ipv6
+ */
+ typedef struct netsnmp_udp_endpoint_s {
+
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid index; /* sl */
+
+ int flags; /* for net-snmp use */
+
+ u_char loc_addr[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
+ u_char rmt_addr[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
+
+ u_char loc_addr_len;/* address len, 4 | 16 */
+ u_char rmt_addr_len;/* address len, 4 | 16 */
+ u_char state; /* not in the mib, but what the heck */
+
+ u_short loc_port;
+ u_short rmt_port;
+
+ u_int instance;
+ u_int pid;
+
+ } netsnmp_udp_endpoint_entry;
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * ACCESS function prototypes
+ */
+/*
+ * ifcontainer init
+ */
+ netsnmp_container *
+ netsnmp_access_udp_endpoint_container_init(u_int init_flags);
+#define NETSNMP_ACCESS_UDP_ENDPOINT_INIT_NOFLAGS 0x0000
+
+/*
+ * ifcontainer load and free
+ */
+ netsnmp_container*
+ netsnmp_access_udp_endpoint_container_load(netsnmp_container* c,
+ u_int load_flags);
+#define NETSNMP_ACCESS_UDP_ENDPOINT_LOAD_NOFLAGS 0x0000
+
+ void netsnmp_access_udp_endpoint_container_free(netsnmp_container *c,
+ u_int free_flags);
+#define NETSNMP_ACCESS_UDP_ENDPOINT_FREE_NOFLAGS 0x0000
+#define NETSNMP_ACCESS_UDP_ENDPOINT_FREE_DONT_CLEAR 0x0001
+#define NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER 0x0002
+
+
+/*
+ * create/free a udp_endpoint entry
+ */
+ netsnmp_udp_endpoint_entry *
+ netsnmp_access_udp_endpoint_entry_create(void);
+
+ void netsnmp_access_udp_endpoint_entry_free(netsnmp_udp_endpoint_entry *e);
+
+/*
+ * update/compare
+ */
+
+/*
+ * find entry in container
+ */
+/** not yet */
+
+
+
+/**---------------------------------------------------------------------*/
+
+# ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_UDP_ENDPOINT_H */
diff --git a/include/net-snmp/definitions.h b/include/net-snmp/definitions.h
new file mode 100644
index 0000000..27405c4
--- /dev/null
+++ b/include/net-snmp/definitions.h
@@ -0,0 +1,32 @@
+#ifndef NET_SNMP_DEFINITIONS_H
+#define NET_SNMP_DEFINITIONS_H
+
+ /**
+ * Defined constants, and other similar enumerations.
+ */
+
+#define MAX_OID_LEN 128 /* max subid's in an oid */
+
+#define ONE_SEC 1000000L
+
+ /*
+ * For the initial release, this will just refer to the
+ * relevant UCD header files.
+ * In due course, the relevant definitions will be
+ * identified, and listed here directly.
+ *
+ * But for the time being, this header file is primarily a placeholder,
+ * to allow application writers to adopt the new header file names.
+ */
+
+#include <net-snmp/types.h> /* for oid */
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_impl.h>
+#include <net-snmp/library/snmp.h>
+#include <net-snmp/library/snmp-tc.h>
+/*
+ * #include <net-snmp/library/libsnmp.h>
+ */
+
+#endif /* NET_SNMP_DEFINITIONS_H */
diff --git a/include/net-snmp/library/README b/include/net-snmp/library/README
new file mode 100644
index 0000000..daac670
--- /dev/null
+++ b/include/net-snmp/library/README
@@ -0,0 +1,67 @@
+One of the goals of the Net-SNMP v5 development line, is to try and
+clarify the distinction between the "public" library API, and routines
+that are regarded as being more "internal" to the library.
+
+ This doesn't mean that application writers are discouraged from
+making use of such internal routines. There is a strong feeling
+within the development team that as much as possible of the library
+should be made externally visible, to support writing as wide a
+range of applications as possible. To that end, most routines
+will be declared within an installed header file, rather than
+privately within the library code files themselves.
+
+ The public/internal categorisation is rather concerned with issues
+of documentation, stability, and ease of programming. The public
+API routines have been selected as those covering the more common
+requirements (e.g. creating SNMP requests, sending them to other SNMP
+agents, and interpreting the results), together with certain supporting
+activities (e.g. run-time configuration).
+
+ The intention is that these routines should be properly documented,
+and remain relatively stable. We will attempt to avoid changing the
+profile of these interfaces, and would normally provide some mechanism
+to retain backward compatability if need be.
+
+ On the other hand, the internal API routines are regarded as just
+that - "internal" - so may legitimately be changed without providing
+any compatability mechanism. You are perfectly free to make use of
+these routines, but be aware that you do so "at your own risk".
+
+[This statement is in no way intended to challenge or amend the status
+ of the disclaimers in the top-level 'COPYING' file, which remain
+ unchanged as the legal basis for using this code]
+
+
+ There are (currently) eight main "public API" header files, relating
+to various areas of SNMP programming, plus a combined "all-in-one"
+header file (net-snmp-includes.h).
+ Currently these simply include the relevant library header files
+following the UCD-SNMP organisation. However, the intention is for
+future releases to declare the public API calls directly within these
+top-level header files, and use the 'library/*.h' files for the more
+internal calls. (i.e. those that are more likely to change over time).
+
+ Until this process can be started, the best approximation to the
+"public API" list is probably those routines that are documented
+in manual pages. Apologies for any confusion, but hopefully this
+process will result in a clearer end result than at present.
+
+Applications writers are encouraged to start #including the new header
+files as soon as possible - either individually, or using the combined
+wrapper file. Hopefully, with only a handful of top-level files, it
+will be reasonably clear which file(s) might be appropriate for any
+particular programming requirement.
+
+
+
+ One final disclaimer: The above description represents my own
+personal aims and understanding of the likely development of the
+library API. While I have every confidence in having the support of
+the other developers (or being able to persuade them of the benefits
+of this approach!), it may turn out that things actually take a different
+route. Anyone wishing to influence the organisation of the eventual
+library API is encouraged to subscribe to the net-snmp-coders mailing
+list, and contribute to the discussions there.
+
+Dave Shield
+February 2002
diff --git a/include/net-snmp/library/asn1.h b/include/net-snmp/library/asn1.h
new file mode 100644
index 0000000..52ecc3b
--- /dev/null
+++ b/include/net-snmp/library/asn1.h
@@ -0,0 +1,455 @@
+#ifndef ASN1_H
+#define ASN1_H
+
+#include <net-snmp/library/oid.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PARSE_PACKET 0
+#define DUMP_PACKET 1
+
+ /*
+ * Definitions for Abstract Syntax Notation One, ASN.1
+ * As defined in ISO/IS 8824 and ISO/IS 8825
+ *
+ *
+ */
+/***********************************************************
+ 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.
+******************************************************************/
+
+
+#define MIN_OID_LEN 2
+#define MAX_OID_LEN 128 /* max subid's in an oid */
+#ifndef MAX_NAME_LEN /* conflicts with some libraries */
+#define MAX_NAME_LEN MAX_OID_LEN /* obsolete. use MAX_OID_LEN */
+#endif
+
+#define OID_LENGTH(x) (sizeof(x)/sizeof(oid))
+
+
+#define ASN_BOOLEAN ((u_char)0x01)
+#define ASN_INTEGER ((u_char)0x02)
+#define ASN_BIT_STR ((u_char)0x03)
+#define ASN_OCTET_STR ((u_char)0x04)
+#define ASN_NULL ((u_char)0x05)
+#define ASN_OBJECT_ID ((u_char)0x06)
+#define ASN_SEQUENCE ((u_char)0x10)
+#define ASN_SET ((u_char)0x11)
+
+#define ASN_UNIVERSAL ((u_char)0x00)
+#define ASN_APPLICATION ((u_char)0x40)
+#define ASN_CONTEXT ((u_char)0x80)
+#define ASN_PRIVATE ((u_char)0xC0)
+
+#define ASN_PRIMITIVE ((u_char)0x00)
+#define ASN_CONSTRUCTOR ((u_char)0x20)
+
+#define ASN_LONG_LEN (0x80)
+#define ASN_EXTENSION_ID (0x1F)
+#define ASN_BIT8 (0x80)
+
+#define IS_CONSTRUCTOR(byte) ((byte) & ASN_CONSTRUCTOR)
+#define IS_EXTENSION_ID(byte) (((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
+
+ struct counter64 {
+ u_long high;
+ u_long low;
+ };
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ typedef struct counter64 integer64;
+ typedef struct counter64 unsigned64;
+
+ /*
+ * The BER inside an OPAQUE is an context specific with a value of 48 (0x30)
+ * plus the "normal" tag. For a Counter64, the tag is 0x46 (i.e., an
+ * applications specific tag with value 6). So the value for a 64 bit
+ * counter is 0x46 + 0x30, or 0x76 (118 base 10). However, values
+ * greater than 30 can not be encoded in one octet. So the first octet
+ * has the class, in this case context specific (ASN_CONTEXT), and
+ * the special value (i.e., 31) to indicate that the real value follows
+ * in one or more octets. The high order bit of each following octet
+ * indicates if the value is encoded in additional octets. A high order
+ * bit of zero, indicates the last. For this "hack", only one octet
+ * will be used for the value.
+ */
+
+ /*
+ * first octet of the tag
+ */
+#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
+ /*
+ * base value for the second octet of the tag - the
+ * second octet was the value for the tag
+ */
+#define ASN_OPAQUE_TAG2 ((u_char)0x30)
+
+#define ASN_OPAQUE_TAG2U ((u_char)0x2f) /* second octet of tag for union */
+
+ /*
+ * All the ASN.1 types for SNMP "should have been" defined in this file,
+ * but they were not. (They are defined in snmp_impl.h) Thus, the tag for
+ * Opaque and Counter64 is defined, again, here with a different names.
+ */
+#define ASN_APP_OPAQUE (ASN_APPLICATION | 4)
+#define ASN_APP_COUNTER64 (ASN_APPLICATION | 6)
+#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
+#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
+#define ASN_APP_I64 (ASN_APPLICATION | 10)
+#define ASN_APP_U64 (ASN_APPLICATION | 11)
+#define ASN_APP_UNION (ASN_PRIVATE | 1) /* or ASN_PRIV_UNION ? */
+
+ /*
+ * value for Counter64
+ */
+#define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
+ /*
+ * max size of BER encoding of Counter64
+ */
+#define ASN_OPAQUE_COUNTER64_MX_BER_LEN 12
+
+ /*
+ * value for Float
+ */
+#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
+ /*
+ * size of BER encoding of Float
+ */
+#define ASN_OPAQUE_FLOAT_BER_LEN 7
+
+ /*
+ * value for Double
+ */
+#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
+ /*
+ * size of BER encoding of Double
+ */
+#define ASN_OPAQUE_DOUBLE_BER_LEN 11
+
+ /*
+ * value for Integer64
+ */
+#define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
+ /*
+ * max size of BER encoding of Integer64
+ */
+#define ASN_OPAQUE_I64_MX_BER_LEN 11
+
+ /*
+ * value for Unsigned64
+ */
+#define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
+ /*
+ * max size of BER encoding of Unsigned64
+ */
+#define ASN_OPAQUE_U64_MX_BER_LEN 12
+
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+
+
+#define ASN_PRIV_INCL_RANGE (ASN_PRIVATE | 2)
+#define ASN_PRIV_EXCL_RANGE (ASN_PRIVATE | 3)
+#define ASN_PRIV_DELEGATED (ASN_PRIVATE | 5)
+#define ASN_PRIV_IMPLIED_OCTET_STR (ASN_PRIVATE | ASN_OCTET_STR) /* 4 */
+#define ASN_PRIV_IMPLIED_OBJECT_ID (ASN_PRIVATE | ASN_OBJECT_ID) /* 6 */
+#define ASN_PRIV_RETRY (ASN_PRIVATE | 7) /* 199 */
+#define IS_DELEGATED(x) ((x) == ASN_PRIV_DELEGATED)
+
+
+ int asn_check_packet(u_char *, size_t);
+ NETSNMP_IMPORT
+ u_char *asn_parse_int(u_char *, size_t *, u_char *, long *,
+ size_t);
+ NETSNMP_IMPORT
+ u_char *asn_build_int(u_char *, size_t *, u_char, const long *,
+ size_t);
+ NETSNMP_IMPORT
+ u_char *asn_parse_unsigned_int(u_char *, size_t *, u_char *,
+ u_long *, size_t);
+ NETSNMP_IMPORT
+ u_char *asn_build_unsigned_int(u_char *, size_t *, u_char,
+ const u_long *, size_t);
+ NETSNMP_IMPORT
+ u_char *asn_parse_string(u_char *, size_t *, u_char *,
+ u_char *, size_t *);
+ NETSNMP_IMPORT
+ u_char *asn_build_string(u_char *, size_t *, u_char,
+ const u_char *, size_t);
+ NETSNMP_IMPORT
+ u_char *asn_parse_header(u_char *, size_t *, u_char *);
+ u_char *asn_parse_sequence(u_char *, size_t *, u_char *, u_char expected_type, /* must be this type */
+ const char *estr); /* error message prefix */
+ NETSNMP_IMPORT
+ u_char *asn_build_header(u_char *, size_t *, u_char, size_t);
+ NETSNMP_IMPORT
+ u_char *asn_build_sequence(u_char *, size_t *, u_char, size_t);
+ NETSNMP_IMPORT
+ u_char *asn_parse_length(u_char *, u_long *);
+ NETSNMP_IMPORT
+ u_char *asn_build_length(u_char *, size_t *, size_t);
+ NETSNMP_IMPORT
+ u_char *asn_parse_objid(u_char *, size_t *, u_char *, oid *,
+ size_t *);
+ NETSNMP_IMPORT
+ u_char *asn_build_objid(u_char *, size_t *, u_char, oid *,
+ size_t);
+ NETSNMP_IMPORT
+ u_char *asn_parse_null(u_char *, size_t *, u_char *);
+ NETSNMP_IMPORT
+ u_char *asn_build_null(u_char *, size_t *, u_char);
+ NETSNMP_IMPORT
+ u_char *asn_parse_bitstring(u_char *, size_t *, u_char *,
+ u_char *, size_t *);
+ NETSNMP_IMPORT
+ u_char *asn_build_bitstring(u_char *, size_t *, u_char,
+ const u_char *, size_t);
+ NETSNMP_IMPORT
+ u_char *asn_parse_unsigned_int64(u_char *, size_t *, u_char *,
+ struct counter64 *, size_t);
+ NETSNMP_IMPORT
+ u_char *asn_build_unsigned_int64(u_char *, size_t *, u_char,
+ const struct counter64 *, size_t);
+ u_char *asn_parse_signed_int64(u_char *, size_t *, u_char *,
+ struct counter64 *, size_t);
+ u_char *asn_build_signed_int64(u_char *, size_t *, u_char,
+ const struct counter64 *, size_t);
+ u_char *asn_build_float(u_char *, size_t *, u_char, const float *,
+ size_t);
+ u_char *asn_parse_float(u_char *, size_t *, u_char *, float *,
+ size_t);
+ u_char *asn_build_double(u_char *, size_t *, u_char, const double *,
+ size_t);
+ u_char *asn_parse_double(u_char *, size_t *, u_char *,
+ double *, size_t);
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+
+ /*
+ * Re-allocator function for below.
+ */
+
+ int asn_realloc(u_char **, size_t *);
+
+ /*
+ * Re-allocating reverse ASN.1 encoder functions. Synopsis:
+ *
+ * u_char *buf = (u_char*)malloc(100);
+ * u_char type = (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER);
+ * size_t buf_len = 100, offset = 0;
+ * long data = 12345;
+ * int allow_realloc = 1;
+ *
+ * if (asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data, sizeof(long)) == 0) {
+ * error;
+ * }
+ *
+ * NOTE WELL: after calling one of these functions with allow_realloc
+ * non-zero, buf might have moved, buf_len might have grown and
+ * offset will have increased by the size of the encoded data.
+ * You should **NEVER** do something like this:
+ *
+ * u_char *buf = (u_char *)malloc(100), *ptr;
+ * u_char type = (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER);
+ * size_t buf_len = 100, offset = 0;
+ * long data1 = 1234, data2 = 5678;
+ * int rc = 0, allow_realloc = 1;
+ *
+ * rc = asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data1, sizeof(long));
+ * ptr = buf[buf_len - offset]; / * points at encoding of data1 * /
+ * if (rc == 0) {
+ * error;
+ * }
+ * rc = asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data2, sizeof(long));
+ * make use of ptr here;
+ *
+ *
+ * ptr is **INVALID** at this point. In general, you should store the
+ * offset value and compute pointers when you need them:
+ *
+ *
+ *
+ * u_char *buf = (u_char *)malloc(100), *ptr;
+ * u_char type = (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER);
+ * size_t buf_len = 100, offset = 0, ptr_offset;
+ * long data1 = 1234, data2 = 5678;
+ * int rc = 0, allow_realloc = 1;
+ *
+ * rc = asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data1, sizeof(long));
+ * ptr_offset = offset;
+ * if (rc == 0) {
+ * error;
+ * }
+ * rc = asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data2, sizeof(long));
+ * ptr = buf + buf_len - ptr_offset
+ * make use of ptr here;
+ *
+ *
+ *
+ * Here, you can see that ptr will be a valid pointer even if the block of
+ * memory has been moved, as it may well have been. Plenty of examples of
+ * usage all over asn1.c, snmp_api.c, snmpusm.c.
+ *
+ * The other thing you should **NEVER** do is to pass a pointer to a buffer
+ * on the stack as the first argument when allow_realloc is non-zero, unless
+ * you really know what you are doing and your machine/compiler allows you to
+ * free non-heap memory. There are rumours that such things exist, but many
+ * consider them no more than the wild tales of a fool.
+ *
+ * Of course, you can pass allow_realloc as zero, to indicate that you do not
+ * wish the packet buffer to be reallocated for some reason; perhaps because
+ * it is on the stack. This may be useful to emulate the functionality of
+ * the old API:
+ *
+ * u_char my_static_buffer[100], *cp = NULL;
+ * size_t my_static_buffer_len = 100;
+ * float my_pi = (float)22/(float)7;
+ *
+ * cp = asn_rbuild_float(my_static_buffer, &my_static_buffer_len,
+ * ASN_OPAQUE_FLOAT, &my_pi, sizeof(float));
+ * if (cp == NULL) {
+ * error;
+ * }
+ *
+ *
+ * IS EQUIVALENT TO:
+ *
+ *
+ * u_char my_static_buffer[100];
+ * size_t my_static_buffer_len = 100, my_offset = 0;
+ * float my_pi = (float)22/(float)7;
+ * int rc = 0;
+ *
+ * rc = asn_realloc_rbuild_float(&my_static_buffer, &my_static_buffer_len,
+ * &my_offset, 0,
+ * ASN_OPAQUE_FLOAT, &my_pi, sizeof(float));
+ * if (rc == 0) {
+ * error;
+ * }
+ *
+ *
+ */
+
+
+ int asn_realloc_rbuild_int(u_char ** pkt, size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc, u_char type,
+ const long *data, size_t data_size);
+
+ int asn_realloc_rbuild_string(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type,
+ const u_char * data,
+ size_t data_size);
+
+ int asn_realloc_rbuild_unsigned_int(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type,
+ const u_long * data,
+ size_t data_size);
+
+ int asn_realloc_rbuild_header(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type,
+ size_t data_size);
+
+ int asn_realloc_rbuild_sequence(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type,
+ size_t data_size);
+
+ int asn_realloc_rbuild_length(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ size_t data_size);
+
+ int asn_realloc_rbuild_objid(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type, const oid *,
+ size_t);
+
+ int asn_realloc_rbuild_null(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type);
+
+ int asn_realloc_rbuild_bitstring(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type,
+ const u_char * data,
+ size_t data_size);
+
+ int asn_realloc_rbuild_unsigned_int64(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type,
+ struct counter64
+ const *data, size_t);
+
+ int asn_realloc_rbuild_signed_int64(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type,
+ const struct counter64 *data,
+ size_t);
+
+ int asn_realloc_rbuild_float(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type, const float *data,
+ size_t data_size);
+
+ int asn_realloc_rbuild_double(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ u_char type, const double *data,
+ size_t data_size);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ASN1_H */
diff --git a/include/net-snmp/library/callback.h b/include/net-snmp/library/callback.h
new file mode 100644
index 0000000..56cdbae
--- /dev/null
+++ b/include/net-snmp/library/callback.h
@@ -0,0 +1,85 @@
+/*
+ * callback.c: A generic callback mechanism
+ */
+
+#ifndef CALLBACK_H
+#define CALLBACK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MAX_CALLBACK_IDS 2
+#define MAX_CALLBACK_SUBIDS 16
+
+ /*
+ * Callback Major Types
+ */
+#define SNMP_CALLBACK_LIBRARY 0
+#define SNMP_CALLBACK_APPLICATION 1
+
+ /*
+ * SNMP_CALLBACK_LIBRARY minor types
+ */
+#define SNMP_CALLBACK_POST_READ_CONFIG 0
+#define SNMP_CALLBACK_STORE_DATA 1
+#define SNMP_CALLBACK_SHUTDOWN 2
+#define SNMP_CALLBACK_POST_PREMIB_READ_CONFIG 3
+#define SNMP_CALLBACK_LOGGING 4
+#define SNMP_CALLBACK_SESSION_INIT 5
+#define SNMP_CALLBACK_PRE_READ_CONFIG 7
+#define SNMP_CALLBACK_PRE_PREMIB_READ_CONFIG 8
+
+
+ /*
+ * Callback priority (lower priority numbers called first(
+ */
+#define NETSNMP_CALLBACK_HIGHEST_PRIORITY -1024
+#define NETSNMP_CALLBACK_DEFAULT_PRIORITY 0
+#define NETSNMP_CALLBACK_LOWEST_PRIORITY 1024
+
+ typedef int (SNMPCallback) (int majorID, int minorID,
+ void *serverarg, void *clientarg);
+
+ struct snmp_gen_callback {
+ SNMPCallback *sc_callback;
+ void *sc_client_arg;
+ int priority;
+ struct snmp_gen_callback *next;
+ };
+
+ /*
+ * function prototypes
+ */
+ NETSNMP_IMPORT
+ void init_callbacks(void);
+
+ NETSNMP_IMPORT
+ int netsnmp_register_callback(int major, int minor,
+ SNMPCallback * new_callback,
+ void *arg, int priority);
+ NETSNMP_IMPORT
+ int snmp_register_callback(int major, int minor,
+ SNMPCallback * new_callback,
+ void *arg);
+ NETSNMP_IMPORT
+ int snmp_call_callbacks(int major, int minor,
+ void *caller_arg);
+ NETSNMP_IMPORT
+ int snmp_callback_available(int major, int minor); /* is >1 available */
+ NETSNMP_IMPORT
+ int snmp_count_callbacks(int major, int minor); /* ret the number registered */
+ NETSNMP_IMPORT
+ int snmp_unregister_callback(int major, int minor,
+ SNMPCallback * new_callback,
+ void *arg, int matchargs);
+ NETSNMP_IMPORT
+ void clear_callback (void);
+ int netsnmp_callback_clear_client_arg(void *, int i, int j);
+
+ struct snmp_gen_callback *snmp_callback_list(int major, int minor);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* CALLBACK_H */
diff --git a/include/net-snmp/library/cert_util.h b/include/net-snmp/library/cert_util.h
new file mode 100644
index 0000000..34a79dc
--- /dev/null
+++ b/include/net-snmp/library/cert_util.h
@@ -0,0 +1,226 @@
+#ifndef NETSNMP_CERT_UTIL_H
+
+#if defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL)
+
+#ifndef HEADER_SSL_H
+#error "must include <openssl/ssl.h> before cert_util.h"
+#endif
+#ifndef HEADER_X509_H
+#error "must include <openssl/x509.h> before cert_util.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*************************************************************************
+ *
+ * netsnmp_cert structures, defines and function definitions
+ *
+ *************************************************************************/
+
+void netsnmp_certs_init(void);
+void netsnmp_certs_agent_init(void);
+void netsnmp_certs_shutdown(void);
+void netsnmp_certs_load(void);
+netsnmp_container *netsnmp_cert_get_trustlist(void);
+
+ typedef struct netsnmp_cert_common_s {
+ char *dir;
+ char *filename;
+
+ u_char type;
+ u_char allowed_uses;
+ u_char _pad[2]; /* for future use */
+ } netsnmp_cert_common;
+
+ typedef struct netsnmp_key_s {
+ netsnmp_cert_common info;
+
+ EVP_PKEY *okey;
+ struct netsnmp_cert_s *cert;
+ } netsnmp_key;
+
+ typedef struct netsnmp_cert_s {
+ netsnmp_cert_common info;
+
+ X509 *ocert;
+ netsnmp_key *key;
+ struct netsnmp_cert_s *issuer_cert;
+
+ char *issuer;
+ char *subject;
+ char *fingerprint;
+ char *common_name;
+
+ u_char hash_type;
+ u_char _pad[3]; /* for future use */
+ } netsnmp_cert;
+
+/** types */
+ enum { NS_CERT_TYPE_UNKNOWN = 0, NS_CERT_TYPE_PEM, NS_CERT_TYPE_DER,
+ NS_CERT_TYPE_PKCS12, NS_CERT_TYPE_KEY };
+
+/** uses */
+#define NS_CERT_IDENTITY 0x0001
+#define NS_CERT_REMOTE_PEER 0x0002
+#define NS_CERT_RESERVED1 0x0004
+#define NS_CERT_CA 0x0008
+
+/** source */
+#define NS_CERTKEY_DEFAULT 0x000 /* get default from DS store */
+#define NS_CERTKEY_FILE 0x001 /* filename/full path */
+#define NS_CERTKEY_FINGERPRINT 0x002 /* public key fingerprint */
+#define NS_CERTKEY_CA 0x004 /* trusted CA */
+#define NS_CERTKEY_SAN_RFC822 0x008 /* subj alt name: rfc822 */
+#define NS_CERTKEY_SAN_DNS 0x010 /* subj alt name: DNS */
+#define NS_CERTKEY_SAN_IPADDR 0x020 /* subj alt name: IP address */
+#define NS_CERTKEY_COMMON_NAME 0x040 /* common name */
+#define NS_CERTKEY_TARGET_PARAM 0x080 /* tlstmParamsTable */
+#define NS_CERTKEY_TARGET_ADDR 0x100 /* tlstmAddrTable */
+#define NS_CERTKEY_MULTIPLE 0x200 /* try multiple sources */
+
+/** RFC 5246 hash algorithms (Section 7.4.1.4.1) */
+#define NS_HASH_NONE 0
+#define NS_HASH_MD5 1
+#define NS_HASH_SHA1 2
+#define NS_HASH_SHA224 3
+#define NS_HASH_SHA256 4
+#define NS_HASH_SHA384 5
+#define NS_HASH_SHA512 6
+#define NS_HASH_MAX NS_HASH_SHA512
+
+/** SNMP-TLS-TM-MIB */
+#define SNMPTLSFINGERPRINT_MAX_LEN 255
+
+ /*************************************************************************
+ * netsnmp_cert function definitions
+ *************************************************************************/
+
+ netsnmp_cert *netsnmp_cert_find(int what, int where, void *hint);
+
+ int netsnmp_cert_check_vb_fingerprint(const netsnmp_variable_list *var);
+
+ void netsnmp_fp_lowercase_and_strip_colon(char *fp);
+ int netsnmp_cert_parse_hash_type(const char *str);
+ int netsnmp_tls_fingerprint_build(int hash_type, const char *hex_fp,
+ u_char **tls_fp, size_t *tls_fp_len,
+ int allow_realloc);
+ int netsnmp_tls_fingerprint_parse(const u_char *binary_fp, int fp_len,
+ char **fp_str_ptr, u_int *fp_str_len,
+ int allow_realloc, u_char *hash_type_ptr);
+
+
+ int netsnmp_cert_trust(SSL_CTX *ctx, netsnmp_cert *thiscert);
+ int netsnmp_cert_trust_ca(SSL_CTX *ctx, netsnmp_cert *thiscertsrootca);
+
+ /*************************************************************************
+ *
+ * certificate to Transport Security Name mapping (netsnmp_cert_map)
+ *
+ *************************************************************************/
+
+#define TSNM_tlstmCertSpecified 1
+#define TSNM_tlstmCertSANRFC822Name 2
+#define TSNM_tlstmCertSANDNSName 3
+#define TSNM_tlstmCertSANIpAddress 4
+#define TSNM_tlstmCertSANAny 5
+#define TSNM_tlstmCertCommonName 6
+#define TSNM_tlstmCert_MAX TSNM_tlstmCertCommonName
+
+#define NSCM_FROM_CONFIG 0x0001
+#define NSCM_FROM_MIB 0x0002
+#define NSCM_NONVOLATILE 0x0004
+
+ typedef struct netsnmp_cert_map_s {
+ int priority;
+ char *fingerprint;
+ int mapType;
+ char *data;
+
+ char hashType;
+ char flags;
+
+ X509 *ocert;
+ } netsnmp_cert_map;
+
+ netsnmp_cert_map *netsnmp_cert_map_alloc(char *fp, X509 *ocert);
+ void netsnmp_cert_map_free(netsnmp_cert_map *cert_map);
+ int netsnmp_cert_map_add(netsnmp_cert_map *map);
+ int netsnmp_cert_map_remove(netsnmp_cert_map *map);
+ netsnmp_cert_map *netsnmp_cert_map_find(netsnmp_cert_map *map);
+
+ void netsnmp_cert_map_container_free(netsnmp_container *c);
+ netsnmp_container *netsnmp_cert_map_container_create(int with_fp);
+ netsnmp_container *netsnmp_cert_map_container(void);
+
+ int netsnmp_cert_get_secname_maps(netsnmp_container *cm);
+
+ /*************************************************************************
+ *
+ * snmpTlstmParamsTable data
+ *
+ *************************************************************************/
+ typedef struct snmpTlstmParams_s {
+ char *name;
+ char *fingerprint;
+ char hashType;
+ u_char flags;
+ u_char fingerprint_len;
+ } snmpTlstmParams;
+
+#define TLSTM_PARAMS_FROM_CONFIG 0x01
+#define TLSTM_PARAMS_FROM_MIB 0x02
+#define TLSTM_PARAMS_NONVOLATILE 0x04
+/** ine TLSTM_PARAMS_XXX 0x08 */
+
+ snmpTlstmParams *netsnmp_tlstmParams_create(const char *tag, int hashType,
+ const char *fp, int fp_len);
+ void netsnmp_tlstmParams_free(snmpTlstmParams *stp);
+ snmpTlstmParams *netsnmp_tlstmParams_restore_common(char **line);
+
+ netsnmp_container *netsnmp_tlstmParams_container(void);
+ int netsnmp_tlstmParams_add(snmpTlstmParams *stp);
+ int netsnmp_tlstmParams_remove(snmpTlstmParams *stp);
+ snmpTlstmParams *netsnmp_tlstmParams_find(snmpTlstmParams *stp);
+
+ /*************************************************************************
+ *
+ * snmpTlstmAddrTable data
+ *
+ *************************************************************************/
+ typedef struct snmpTlstmAddr_s {
+ char *name;
+ char *fingerprint;
+ char *identity;
+
+ u_char hashType;
+ u_char flags;
+
+ } snmpTlstmAddr;
+
+#define TLSTM_ADDR_FROM_CONFIG 0x01
+#define TLSTM_ADDR_FROM_MIB 0x02
+#define TLSTM_ADDR_NONVOLATILE 0x04
+/** ine TLSTM_ADDR_XXX 0x08 */
+
+ int netsnmp_tlstmAddr_restore_common(char **line, char *name,
+ size_t *name_len, char *id,
+ size_t *id_len, char *fp,
+ size_t *fp_len, u_char *ht);
+ netsnmp_container *netsnmp_tlstmAddr_container(void);
+ snmpTlstmAddr *netsnmp_tlstmAddr_find(snmpTlstmAddr *entry);
+ snmpTlstmAddr *netsnmp_tlstmAddr_create(char *targetAddrName);
+ void netsnmp_tlstmAddr_free(snmpTlstmAddr *entry);
+ int netsnmp_tlstmAddr_add(snmpTlstmAddr *entry);
+ int netsnmp_tlstmAddr_remove(snmpTlstmAddr *entry);
+ char *netsnmp_tlstmAddr_get_serverId(const char *name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL) */
+
+#endif /* NETSNMP_CERT_UTIL_H */
+
diff --git a/include/net-snmp/library/check_varbind.h b/include/net-snmp/library/check_varbind.h
new file mode 100644
index 0000000..1e1615a
--- /dev/null
+++ b/include/net-snmp/library/check_varbind.h
@@ -0,0 +1,53 @@
+#ifndef SNMP_CHECK_VARBIND_H
+#define SNMP_CHECK_VARBIND_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * Assorted convience routines to check the contents of a
+ * netsnmp_variable_list instance.
+ */
+
+ int netsnmp_check_vb_type(const netsnmp_variable_list *var, int type);
+ int netsnmp_check_vb_size(const netsnmp_variable_list *var, size_t size );
+ int netsnmp_check_vb_max_size(const netsnmp_variable_list *var, size_t size );
+ int netsnmp_check_vb_range(const netsnmp_variable_list *var,
+ size_t low, size_t high );
+ int netsnmp_check_vb_size_range(const netsnmp_variable_list *var,
+ size_t low, size_t high );
+
+ NETSNMP_IMPORT
+ int netsnmp_check_vb_type_and_size(const netsnmp_variable_list *var,
+ int type, size_t size);
+ NETSNMP_IMPORT
+ int netsnmp_check_vb_type_and_max_size(const netsnmp_variable_list *var,
+ int type, size_t size);
+
+ NETSNMP_IMPORT
+ int netsnmp_check_vb_oid(const netsnmp_variable_list *var);
+ NETSNMP_IMPORT
+ int netsnmp_check_vb_int(const netsnmp_variable_list *var);
+ NETSNMP_IMPORT
+ int netsnmp_check_vb_uint(const netsnmp_variable_list *var);
+ NETSNMP_IMPORT
+ int netsnmp_check_vb_int_range(const netsnmp_variable_list *var, int low,
+ int high);
+
+ NETSNMP_IMPORT
+ int netsnmp_check_vb_truthvalue(const netsnmp_variable_list *var);
+
+ NETSNMP_IMPORT
+ int netsnmp_check_vb_rowstatus_value(const netsnmp_variable_list *var);
+ NETSNMP_IMPORT
+ int netsnmp_check_vb_rowstatus(const netsnmp_variable_list *var, int old_val);
+ int netsnmp_check_vb_rowstatus_with_storagetype(const netsnmp_variable_list *var, int old_val, int old_storage);
+
+ int netsnmp_check_vb_storagetype(const netsnmp_variable_list *var, int old_val);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_CHECK_VARBIND_H */
diff --git a/include/net-snmp/library/container.h b/include/net-snmp/library/container.h
new file mode 100644
index 0000000..963289e
--- /dev/null
+++ b/include/net-snmp/library/container.h
@@ -0,0 +1,501 @@
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#ifndef NETSNMP_CONTAINER_H
+#define NETSNMP_CONTAINER_H
+
+/*
+ * $Id$
+ *
+ * WARNING: This is a recently created file, and all of it's contents are
+ * subject to change at any time.
+ *
+ * A basic container template. A generic way for code to store and
+ * retrieve data. Allows for interchangable storage algorithms.
+ */
+#ifndef NET_SNMP_CONFIG_H
+#error "Please include <net-snmp/net-snmp-config.h> before this file"
+#endif
+
+#include <stdlib.h> /* free() */
+#include <net-snmp/types.h>
+#include <net-snmp/library/factory.h>
+#include <net-snmp/library/snmp_logging.h>
+#include <net-snmp/library/tools.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*************************************************************************
+ *
+ * function pointer definitions
+ *
+ *************************************************************************/
+ struct netsnmp_iterator_s; /** forward declare */
+ struct netsnmp_container_s; /** forward declare */
+
+ /*
+ * function for performing an operation on a container which
+ * returns (maybe the same) container.
+ */
+ typedef struct netsnmp_container_s* (netsnmp_container_mod_op)
+ (struct netsnmp_container_s *, void *context, u_int flags);
+
+ /*
+ * function for setting an option on a container
+ */
+ typedef int (netsnmp_container_option)(struct netsnmp_container_s *,
+ int set, u_int flags);
+
+ /*
+ * function returning an int for an operation on a container
+ */
+ typedef int (netsnmp_container_rc)(struct netsnmp_container_s *);
+
+ /*
+ * function returning an iterator for a container
+ */
+ typedef struct netsnmp_iterator_s * (netsnmp_container_it)
+ (struct netsnmp_container_s *);
+
+ /*
+ * function returning a size_t for an operation on a container
+ */
+ typedef size_t (netsnmp_container_size)(struct netsnmp_container_s *);
+
+ /*
+ * function returning an int for an operation on an object and
+ * a container
+ */
+ typedef int (netsnmp_container_op)(struct netsnmp_container_s *,
+ const void *data);
+
+ /*
+ * function returning an oject for an operation on an object and a
+ * container
+ */
+ typedef void * (netsnmp_container_rtn)(struct netsnmp_container_s *,
+ const void *data);
+
+ /*
+ * function with no return which acts on an object
+ */
+ typedef void (netsnmp_container_obj_func)(void *data, void *context);
+
+ /*
+ * function with no return which calls a function on an object
+ */
+ typedef void (netsnmp_container_func)(struct netsnmp_container_s *,
+ netsnmp_container_obj_func *,
+ void *context);
+
+ /*
+ * function returning an array of objects for an operation on an
+ * ojbect and a container
+ */
+ typedef netsnmp_void_array * (netsnmp_container_set)
+ (struct netsnmp_container_s *, void *data);
+
+ /*
+ * function returning an int for a comparison between two objects
+ */
+ typedef int (netsnmp_container_compare)(const void *lhs,
+ const void *rhs);
+
+ /*************************************************************************
+ *
+ * Basic container
+ *
+ *************************************************************************/
+ typedef struct netsnmp_container_s {
+
+ /*
+ * pointer for container implementation
+ */
+ void * container_data;
+
+ /*
+ * returns the number of items in a container
+ */
+ netsnmp_container_size *get_size;
+
+ /*
+ * initialize a container
+ */
+ netsnmp_container_rc *init;
+
+ /*
+ * release memory used by a container.
+ *
+ * Note: if your data structures contained allocated
+ * memory, you are responsible for releasing that
+ * memory before calling this function!
+ */
+ netsnmp_container_rc *cfree;
+
+ /*
+ * add an entry to the container
+ */
+ netsnmp_container_op *insert;
+
+ /*
+ * remove an entry from the container
+ */
+ netsnmp_container_op *remove;
+
+ /*
+ * release memory for an entry from the container
+ */
+ netsnmp_container_op *release; /* NOTE: deprecated. Use free_item */
+ netsnmp_container_obj_func *free_item;
+
+ /*
+ * find the entry in the container with the same key
+ *
+ * Note: do not change the key! If you need to
+ * change a key, remove the entry, change the key,
+ * and the re-add the entry.
+ */
+ netsnmp_container_rtn *find;
+
+ /*
+ * find the entry in the container with the next highest key
+ *
+ * If the key is NULL, return the first item in the container.
+ */
+ netsnmp_container_rtn *find_next;
+
+ /*
+ * find all entries in the container which match the partial key
+ * returns allocated memory (netsnmp_void_array). User is responsible
+ * for releasing this memory (free(array->array), free(array)).
+ * DO NOT FREE ELEMENTS OF THE ARRAY, because they are the same pointers
+ * stored in the container.
+ */
+ netsnmp_container_set *get_subset;
+
+ /*
+ * function to return an iterator for the container
+ */
+ netsnmp_container_it *get_iterator;
+
+ /*
+ * function to call another function for each object in the container
+ */
+ netsnmp_container_func *for_each;
+
+ /*
+ * specialized version of for_each used to optimize cleanup.
+ * clear the container, optionally calling a function for each item.
+ */
+ netsnmp_container_func *clear;
+
+ /*
+ * OPTIONAL function to filter inserts to the container
+ * (intended for a secondary container, which only wants
+ * a sub-set of the objects in the primary/parent container)
+ * Returns:
+ * 1 : filter matched (don't insert)
+ * 0 : no match (insert)
+ */
+ netsnmp_container_op *insert_filter;
+
+ /*
+ * OPTIONAL function to duplicate a container. Defaults to a shallow
+ * copy. Only the specified container is copied (i.e. sub-containers
+ * not included).
+ */
+ netsnmp_container_mod_op *duplicate;
+
+
+ /*
+ * function to compare two object stored in the container.
+ *
+ * Returns:
+ *
+ * -1 LHS < RHS
+ * 0 LHS = RHS
+ * 1 LHS > RHS
+ */
+ netsnmp_container_compare *compare;
+
+ /*
+ * same as compare, but RHS will be a partial key
+ */
+ netsnmp_container_compare *ncompare;
+
+ /*
+ * function to set container options
+ */
+ netsnmp_container_option *options;
+
+ /*
+ * unique name for finding a particular container in a list
+ */
+ char *container_name;
+
+ /*
+ * sort count, for iterators to track (insert/delete
+ * bumps counter, invalidates iterator)
+ */
+ u_long sync;
+
+ /*
+ * flags
+ */
+ u_int flags;
+
+ /*
+ * containers can contain other containers (additional indexes)
+ */
+ struct netsnmp_container_s *next, *prev;
+
+ } netsnmp_container;
+
+ /*
+ * initialize/free a container of container factories. used by
+ * netsnmp_container_find* functions.
+ */
+ NETSNMP_IMPORT
+ void netsnmp_container_init_list(void);
+ NETSNMP_IMPORT
+ void netsnmp_container_free_list(void);
+
+ /*
+ * register a new container factory
+ */
+ int netsnmp_container_register_with_compare(const char* name,
+ netsnmp_factory *f,
+ netsnmp_container_compare *c);
+ int netsnmp_container_register(const char* name, netsnmp_factory *f);
+
+ /*
+ * search for and create a container from a list of types or a
+ * specific type.
+ */
+ NETSNMP_IMPORT
+ netsnmp_container * netsnmp_container_find(const char *type_list);
+ netsnmp_container * netsnmp_container_get(const char *type);
+
+ /*
+ * utility routines
+ */
+ NETSNMP_IMPORT
+ void netsnmp_container_add_index(netsnmp_container *primary,
+ netsnmp_container *new_index);
+
+
+ netsnmp_factory *netsnmp_container_get_factory(const char *type);
+
+ /*
+ * common comparison routines
+ */
+ /** first data element is a 'netsnmp_index' */
+ NETSNMP_IMPORT
+ int netsnmp_compare_netsnmp_index(const void *lhs, const void *rhs);
+ NETSNMP_IMPORT
+ int netsnmp_ncompare_netsnmp_index(const void *lhs, const void *rhs);
+
+ /** first data element is a 'char *' */
+ int netsnmp_compare_cstring(const void * lhs, const void * rhs);
+ int netsnmp_ncompare_cstring(const void * lhs, const void * rhs);
+
+ /** useful for octet strings */
+ int netsnmp_compare_mem(const char * lhs, size_t lhs_len,
+ const char * rhs, size_t rhs_len);
+
+ /** no structure, just 'char *' pointers */
+ int netsnmp_compare_direct_cstring(const void * lhs, const void * rhs);
+
+ int netsnmp_compare_long(const void * lhs, const void * rhs);
+ int netsnmp_compare_ulong(const void * lhs, const void * rhs);
+ int netsnmp_compare_int32(const void * lhs, const void * rhs);
+ int netsnmp_compare_uint32(const void * lhs, const void * rhs);
+
+ /** for_each callback to call free on data item */
+ NETSNMP_IMPORT
+ void netsnmp_container_simple_free(void *data, void *context);
+
+/*
+ * container optionflags
+ */
+#define CONTAINER_KEY_ALLOW_DUPLICATES 0x00000001
+#define CONTAINER_KEY_UNSORTED 0x00000002
+
+#define CONTAINER_SET_OPTIONS(x,o,rc) do { \
+ if (NULL==(x)->options) \
+ rc = -1; \
+ else { \
+ rc = (x)->options(x, 1, o); \
+ if (rc != -1 ) \
+ (x)->flags |= o; \
+ } \
+ } while(0)
+
+#define CONTAINER_CHECK_OPTION(x,o,rc) do { \
+ rc = x->flags & 0; \
+ } while(0)
+
+
+ /*
+ * useful macros (x = container; k = key; c = user context)
+ */
+#define CONTAINER_FIRST(x) (x)->find_next(x,NULL)
+#define CONTAINER_FIND(x,k) (x)->find(x,k)
+#define CONTAINER_NEXT(x,k) (x)->find_next(x,k)
+/*
+ * GET_SUBSET returns allocated memory (netsnmp_void_array). User is responsible
+ * for releasing this memory (free(array->array), free(array)).
+ * DO NOT FREE ELEMENTS OF THE ARRAY, because they are the same pointers
+ * stored in the container.
+ */
+#define CONTAINER_GET_SUBSET(x,k) (x)->get_subset(x,k)
+#define CONTAINER_SIZE(x) (x)->get_size(x)
+#define CONTAINER_ITERATOR(x) (x)->get_iterator(x)
+#define CONTAINER_COMPARE(x,l,r) (x)->compare(l,r)
+#define CONTAINER_FOR_EACH(x,f,c) (x)->for_each(x,f,c)
+
+ /*
+ * if you are getting multiple definitions of these three
+ * inline functions, you most likely have optimizations turned off.
+ * Either turn them back on, or define NETSNMP_NO_INLINE
+ */
+ /*
+ * insert k into all containers
+ */
+ NETSNMP_IMPORT
+ int CONTAINER_INSERT(netsnmp_container *x, const void *k);
+
+ /*
+ * remove k from all containers
+ */
+ NETSNMP_IMPORT
+ int CONTAINER_REMOVE(netsnmp_container *x, const void *k);
+
+ /*
+ * duplicate container
+ */
+ NETSNMP_IMPORT
+ netsnmp_container *CONTAINER_DUP(netsnmp_container *x, void *ctx,
+ u_int flags);
+
+ /*
+ * clear all containers. When clearing the *first* container, and
+ * *only* the first container, call the function f for each item.
+ * After calling this function, all containers should be empty.
+ */
+ NETSNMP_IMPORT
+ void CONTAINER_CLEAR(netsnmp_container *x, netsnmp_container_obj_func *f,
+ void *c);
+
+ /*
+ * clear all containers. When clearing the *first* container, and
+ * *only* the first container, call the free_item function for each item.
+ * After calling this function, all containers should be empty.
+ */
+ NETSNMP_IMPORT
+ void CONTAINER_FREE_ALL(netsnmp_container *x, void *c);
+
+ /*
+ * free all containers
+ */
+ NETSNMP_IMPORT
+ int CONTAINER_FREE(netsnmp_container *x);
+
+ NETSNMP_IMPORT
+ netsnmp_container *SUBCONTAINER_FIND(netsnmp_container *x,
+ const char* name);
+
+ /*
+ * INTERNAL utility routines for container implementations
+ */
+ void netsnmp_init_container(netsnmp_container *c,
+ netsnmp_container_rc *init,
+ netsnmp_container_rc *cfree,
+ netsnmp_container_size *size,
+ netsnmp_container_compare *cmp,
+ netsnmp_container_op *ins,
+ netsnmp_container_op *rem,
+ netsnmp_container_rtn *fnd);
+ /** Duplicate container meta-data. */
+ int netsnmp_container_data_dup(netsnmp_container *dup,
+ netsnmp_container *c);
+
+
+ /*************************************************************************
+ *
+ * container iterator
+ *
+ *************************************************************************/
+ /*
+ * function returning an int for an operation on an iterator
+ */
+ typedef int (netsnmp_iterator_rc)(struct netsnmp_iterator_s *);
+
+ /*
+ * function returning an oject for an operation on an iterator
+ */
+ typedef void * (netsnmp_iterator_rtn)(struct netsnmp_iterator_s *);
+
+
+ /*
+ * iterator structure
+ */
+ typedef struct netsnmp_iterator_s {
+
+ netsnmp_container *container;
+
+ /*
+ * sync from container when iterator created. used to invalidate
+ * the iterator when the container changes.
+ */
+ u_long sync;
+
+ /*
+ * reset iterator position to beginning of container.
+ */
+ netsnmp_iterator_rc *reset;
+
+ /*
+ * release iterator and memory it uses
+ */
+ netsnmp_iterator_rc *release;
+
+ /*
+ * first, last and current DO NOT advance the iterator
+ */
+ netsnmp_iterator_rtn *first;
+ netsnmp_iterator_rtn *curr;
+ netsnmp_iterator_rtn *last;
+
+ netsnmp_iterator_rtn *next;
+
+ /*
+ * remove will remove the item at the current position, then back up
+ * the iterator to the previous item. That way next will move to the
+ * item (the one that replaced the removed item.
+ */
+ netsnmp_iterator_rc *remove;
+
+ } netsnmp_iterator;
+
+
+#define ITERATOR_FIRST(x) x->first(x)
+#define ITERATOR_NEXT(x) x->next(x)
+#define ITERATOR_LAST(x) x->last(x)
+#define ITERATOR_REMOVE(x) x->remove(x)
+#define ITERATOR_RELEASE(x) do { x->release(x); x = NULL; } while(0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** NETSNMP_CONTAINER_H */
diff --git a/include/net-snmp/library/container_binary_array.h b/include/net-snmp/library/container_binary_array.h
new file mode 100644
index 0000000..336a8e9
--- /dev/null
+++ b/include/net-snmp/library/container_binary_array.h
@@ -0,0 +1,46 @@
+/*
+ * binary_array.h
+ * $Id$
+ */
+
+#ifndef BINARY_ARRAY_H
+#define BINARY_ARRAY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/factory.h>
+
+ /*
+ * initialize binary array container. call at startup.
+ */
+ void netsnmp_container_binary_array_init(void);
+
+ /*
+ * get an container which uses an binary_array for storage
+ */
+ netsnmp_container * netsnmp_container_get_binary_array(void);
+
+ /*
+ * get a factory for producing binary_array objects
+ */
+ netsnmp_factory * netsnmp_container_get_binary_array_factory(void);
+
+
+ int netsnmp_binary_array_remove(netsnmp_container *c, const void *key,
+ void **save);
+
+ void netsnmp_binary_array_release(netsnmp_container *c);
+
+ void netsnmp_container_binary_array_init(void);
+
+ int netsnmp_binary_array_options_set(netsnmp_container *c, int set, u_int flags);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/library/container_iterator.h b/include/net-snmp/library/container_iterator.h
new file mode 100644
index 0000000..6878292
--- /dev/null
+++ b/include/net-snmp/library/container_iterator.h
@@ -0,0 +1,62 @@
+/**
+ * @file container_iterator.h
+ * @addtogroup container_iterator
+ * @{
+ */
+#ifndef _CONTAINER_ITERATOR_HANDLER_H_
+#define _CONTAINER_ITERATOR_HANDLER_H_
+
+#include "container.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ typedef int (Netsnmp_Iterator_Loop_Key) (void *iterator_ctx,
+ netsnmp_ref_void* loop_ctx,
+ netsnmp_ref_void* key);
+ typedef int (Netsnmp_Iterator_Loop_Data)(void *iterator_ctx,
+ netsnmp_ref_void* loop_ctx,
+ netsnmp_ref_void* data);
+ typedef int (Netsnmp_Iterator_Ctx) (void *iterator_ctx,
+ netsnmp_ref_void* loop_ctx);
+ typedef int (Netsnmp_Iterator_Ctx_Dup) (void *iterator_ctx,
+ netsnmp_ref_void* loop_ctx,
+ netsnmp_ref_void* dup_ctx,
+ int reuse);
+ typedef int (Netsnmp_Iterator_Op) (void *iterator_ctx);
+ typedef int (Netsnmp_Iterator_Data) (void *iterator_ctx,
+ const void *data);
+
+ void netsnmp_container_iterator_init(void);
+
+ netsnmp_container* netsnmp_container_iterator_get(
+ void *iterator_user_ctx,
+ netsnmp_container_compare * compare,
+ Netsnmp_Iterator_Loop_Key * get_first,
+ Netsnmp_Iterator_Loop_Key * get_next,
+ Netsnmp_Iterator_Loop_Data * get_data,
+ Netsnmp_Iterator_Ctx_Dup * save_pos, /* iff returning static data */
+ Netsnmp_Iterator_Ctx * init_loop_ctx,
+ Netsnmp_Iterator_Ctx * cleanup_loop_ctx,
+ Netsnmp_Iterator_Data * free_user_ctx,
+ int sorted);
+
+ /*
+ * set up optional callbacks/
+ * NOTE: even though the first parameter is a generic netsnmp_container,
+ * this function should only be called for a container created
+ * by netsnmp_container_iterator_get.
+ */
+ void
+ netsnmp_container_iterator_set_data_cb(netsnmp_container *c,
+ Netsnmp_Iterator_Data * insert_data,
+ Netsnmp_Iterator_Data * remove_data,
+ Netsnmp_Iterator_Op * get_size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _CONTAINER_ITERATOR_HANDLER_H_ */
+/** @} */
diff --git a/include/net-snmp/library/container_list_ssll.h b/include/net-snmp/library/container_list_ssll.h
new file mode 100644
index 0000000..494f213
--- /dev/null
+++ b/include/net-snmp/library/container_list_ssll.h
@@ -0,0 +1,27 @@
+/*
+ * container_list_sl.h
+ * $Id$
+ *
+ */
+#ifndef NETSNMP_CONTAINER_SSLL_H
+#define NETSNMP_CONTAINER_SSLL_H
+
+
+#include <net-snmp/library/container.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ netsnmp_container *netsnmp_container_get_sorted_singly_linked_list(void);
+ netsnmp_container *netsnmp_container_get_singly_linked_list(int fifo);
+
+ NETSNMP_IMPORT
+ void netsnmp_container_ssll_init(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** NETSNMP_CONTAINER_SSLL_H */
diff --git a/include/net-snmp/library/container_null.h b/include/net-snmp/library/container_null.h
new file mode 100644
index 0000000..a55d342
--- /dev/null
+++ b/include/net-snmp/library/container_null.h
@@ -0,0 +1,21 @@
+#ifndef NETSNMP_CONTAINER_NULL_H
+#define NETSNMP_CONTAINER_NULL_H
+
+
+#include <net-snmp/library/container.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+netsnmp_container *netsnmp_container_get_null(void);
+
+ NETSNMP_IMPORT
+ void netsnmp_container_null_init(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** NETSNMP_CONTAINER_NULL_H */
diff --git a/include/net-snmp/library/data_list.h b/include/net-snmp/library/data_list.h
new file mode 100644
index 0000000..54a3a5d
--- /dev/null
+++ b/include/net-snmp/library/data_list.h
@@ -0,0 +1,105 @@
+/* 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.
+ */
+/*
+ * @file netsnmp_data_list.h
+ *
+ * @addtogroup agent
+ * @addtogroup library *
+ *
+ * $Id$
+ *
+ * External definitions for functions and variables in netsnmp_data_list.c.
+ *
+ * @{
+ */
+
+#ifndef DATA_LIST_H
+#define DATA_LIST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/library/snmp_impl.h>
+#include <net-snmp/library/tools.h>
+
+ typedef void (Netsnmp_Free_List_Data) (void *);
+ typedef int (Netsnmp_Save_List_Data) (char *buf, size_t buf_len, void *);
+ typedef void * (Netsnmp_Read_List_Data) (char *buf, size_t buf_len);
+
+/** @struct netsnmp_data_list_s
+ * used to iterate through lists of data
+ */
+ typedef struct netsnmp_data_list_s {
+ struct netsnmp_data_list_s *next;
+ char *name;
+ /** The pointer to the data passed on. */
+ void *data;
+ /** must know how to free netsnmp_data_list->data */
+ Netsnmp_Free_List_Data *free_func;
+ } netsnmp_data_list;
+
+ typedef struct netsnmp_data_list_saveinfo_s {
+ netsnmp_data_list **datalist;
+ const char *type;
+ const char *token;
+ Netsnmp_Save_List_Data *data_list_save_ptr;
+ Netsnmp_Read_List_Data *data_list_read_ptr;
+ Netsnmp_Free_List_Data *data_list_free_ptr;
+ } netsnmp_data_list_saveinfo;
+
+ NETSNMP_IMPORT
+ netsnmp_data_list *
+ netsnmp_create_data_list(const char *, void *, Netsnmp_Free_List_Data* );
+ void netsnmp_data_list_add_node(netsnmp_data_list **head,
+ netsnmp_data_list *node);
+ netsnmp_data_list *
+ netsnmp_data_list_add_data(netsnmp_data_list **head,
+ const char *name, void *data,
+ Netsnmp_Free_List_Data * beer);
+ NETSNMP_IMPORT
+ void *netsnmp_get_list_data(netsnmp_data_list *head,
+ const char *node);
+ NETSNMP_IMPORT
+ void netsnmp_free_list_data(netsnmp_data_list *head); /* single */
+ NETSNMP_IMPORT
+ void netsnmp_free_all_list_data(netsnmp_data_list *head); /* multiple */
+ NETSNMP_IMPORT
+ int netsnmp_remove_list_node(netsnmp_data_list **realhead,
+ const char *name);
+ NETSNMP_IMPORT
+ netsnmp_data_list *
+ netsnmp_get_list_node(netsnmp_data_list *head,
+ const char *name);
+
+ /** depreciated: use netsnmp_data_list_add_node() */
+ NETSNMP_IMPORT
+ void netsnmp_add_list_data(netsnmp_data_list **head,
+ netsnmp_data_list *node);
+
+
+ void
+ netsnmp_register_save_list(netsnmp_data_list **datalist,
+ const char *type, const char *token,
+ Netsnmp_Save_List_Data *data_list_save_ptr,
+ Netsnmp_Read_List_Data *data_list_read_ptr,
+ Netsnmp_Free_List_Data *data_list_free_ptr);
+ int
+ netsnmp_save_all_data(netsnmp_data_list *head,
+ const char *type, const char *token,
+ Netsnmp_Save_List_Data * data_list_save_ptr);
+ SNMPCallback netsnmp_save_all_data_callback;
+ void netsnmp_read_data_callback(const char *token, char *line);
+#ifdef __cplusplus
+}
+#endif
+#endif
+/** @} */
diff --git a/include/net-snmp/library/default_store.h b/include/net-snmp/library/default_store.h
new file mode 100644
index 0000000..3c3c519
--- /dev/null
+++ b/include/net-snmp/library/default_store.h
@@ -0,0 +1,214 @@
+/* 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.
+ */
+/*
+ * Note:
+ * If new default_store entries are added to this header file,
+ * then remember to run 'perl/default_store/gen' to update the
+ * corresponding perl interface.
+ */
+/*
+ * @file default_store.h: storage space for defaults
+ *
+ * @addtogroup default_store
+ *
+ * @{
+ */
+#ifndef DEFAULT_STORE_H
+#define DEFAULT_STORE_H
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define NETSNMP_DS_MAX_IDS 3
+#define NETSNMP_DS_MAX_SUBIDS 48 /* needs to be a multiple of 8 */
+
+ /*
+ * begin storage definitions
+ */
+/**
+ * @def NETSNMP_DS_LIBRARY_ID
+ * These definitions correspond with the "storid" argument to the API.
+ */
+#define NETSNMP_DS_LIBRARY_ID 0
+#define NETSNMP_DS_APPLICATION_ID 1
+#define NETSNMP_DS_TOKEN_ID 2
+
+ /*
+ * These definitions correspond with the "which" argument to the API,
+ * when the storeid argument is NETSNMP_DS_LIBRARY_ID
+ */
+ /*
+ * library booleans
+ */
+#define NETSNMP_DS_LIB_MIB_ERRORS 0
+#define NETSNMP_DS_LIB_SAVE_MIB_DESCRS 1
+#define NETSNMP_DS_LIB_MIB_COMMENT_TERM 2
+#define NETSNMP_DS_LIB_MIB_PARSE_LABEL 3
+#define NETSNMP_DS_LIB_DUMP_PACKET 4
+#define NETSNMP_DS_LIB_LOG_TIMESTAMP 5
+#define NETSNMP_DS_LIB_DONT_READ_CONFIGS 6 /* don't read normal config files */
+#define NETSNMP_DS_LIB_DISABLE_CONFIG_LOAD NETSNMP_DS_LIB_DONT_READ_CONFIGS
+#define NETSNMP_DS_LIB_MIB_REPLACE 7 /* replace objects from latest module */
+#define NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM 8 /* print only numeric enum values */
+#define NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS 9 /* print only numeric enum values */
+#define NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS 10 /* dont print oid indexes specially */
+#define NETSNMP_DS_LIB_ALARM_DONT_USE_SIG 11 /* don't use the alarm() signal */
+#define NETSNMP_DS_LIB_PRINT_FULL_OID 12 /* print fully qualified oids */
+#define NETSNMP_DS_LIB_QUICK_PRINT 13 /* print very brief output for parsing */
+#define NETSNMP_DS_LIB_RANDOM_ACCESS 14 /* random access to oid labels */
+#define NETSNMP_DS_LIB_REGEX_ACCESS 15 /* regex matching to oid labels */
+#define NETSNMP_DS_LIB_DONT_CHECK_RANGE 16 /* don't check values for ranges on send */
+#define NETSNMP_DS_LIB_NO_TOKEN_WARNINGS 17 /* no warn about unknown config tokens */
+#define NETSNMP_DS_LIB_NUMERIC_TIMETICKS 18 /* print timeticks as a number */
+#define NETSNMP_DS_LIB_ESCAPE_QUOTES 19 /* shell escape quote marks in oids */
+#define NETSNMP_DS_LIB_REVERSE_ENCODE 20 /* encode packets from back to front */
+#define NETSNMP_DS_LIB_PRINT_BARE_VALUE 21 /* just print value (not OID = value) */
+#define NETSNMP_DS_LIB_EXTENDED_INDEX 22 /* print extended index format [x1][x2] */
+#define NETSNMP_DS_LIB_PRINT_HEX_TEXT 23 /* print ASCII text along with hex strings */
+#define NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID 24 /* print OID's using the UCD-style prefix suppression */
+#define NETSNMP_DS_LIB_READ_UCD_STYLE_OID 25 /* require top-level OIDs to be prefixed with a dot */
+#define NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG 26 /* have the pre-mib parsing config tokens been processed */
+#define NETSNMP_DS_LIB_HAVE_READ_CONFIG 27 /* have the config tokens been processed */
+#define NETSNMP_DS_LIB_QUICKE_PRINT 28
+#define NETSNMP_DS_LIB_DONT_PRINT_UNITS 29 /* don't print UNITS suffix */
+#define NETSNMP_DS_LIB_NO_DISPLAY_HINT 30 /* don't apply DISPLAY-HINTs */
+#define NETSNMP_DS_LIB_16BIT_IDS 31 /* restrict requestIDs, etc to 16-bit values */
+#define NETSNMP_DS_LIB_DONT_PERSIST_STATE 32 /* don't load config and don't load/save persistent file */
+#define NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT 33 /* print a leading 0 on hex values <= 'f' */
+#define NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY 34 /* don't complain if no community is specified in the command arguments */
+#define NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD 35 /* don't load persistent file */
+#define NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE 36 /* don't save persistent file */
+#define NETSNMP_DS_LIB_APPEND_LOGFILES 37 /* append, don't overwrite, log files */
+#define NETSNMP_DS_LIB_NO_DISCOVERY 38 /* don't support RFC5343 contextEngineID discovery */
+#define NETSNMP_DS_LIB_TSM_USE_PREFIX 39 /* TSM's simple security name mapping */
+#define NETSNMP_DS_LIB_DONT_LOAD_HOST_FILES 40 /* don't read host.conf files */
+#define NETSNMP_DS_LIB_DNSSEC_WARN_ONLY 41 /* tread DNSSEC errors as warnings */
+#define NETSNMP_DS_LIB_MAX_BOOL_ID 48 /* match NETSNMP_DS_MAX_SUBIDS */
+
+ /*
+ * library integers
+ */
+#define NETSNMP_DS_LIB_MIB_WARNINGS 0
+#define NETSNMP_DS_LIB_SECLEVEL 1
+#define NETSNMP_DS_LIB_SNMPVERSION 2
+#define NETSNMP_DS_LIB_DEFAULT_PORT 3
+#define NETSNMP_DS_LIB_OID_OUTPUT_FORMAT 4
+#define NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY NETSNMP_DS_LIB_OID_OUTPUT_FORMAT
+#define NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT 5
+#define NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH 6
+#define NETSNMP_DS_LIB_SERVERSENDBUF 7 /* send buffer (server) */
+#define NETSNMP_DS_LIB_SERVERRECVBUF 8 /* receive buffer (server) */
+#define NETSNMP_DS_LIB_CLIENTSENDBUF 9 /* send buffer (client) */
+#define NETSNMP_DS_LIB_CLIENTRECVBUF 10 /* receive buffer (client) */
+#define NETSNMP_DS_SSHDOMAIN_SOCK_PERM 11
+#define NETSNMP_DS_SSHDOMAIN_DIR_PERM 12
+#define NETSNMP_DS_SSHDOMAIN_SOCK_USER 12
+#define NETSNMP_DS_SSHDOMAIN_SOCK_GROUP 13
+#define NETSNMP_DS_LIB_TIMEOUT 14
+#define NETSNMP_DS_LIB_RETRIES 15
+#define NETSNMP_DS_LIB_MAX_INT_ID 48 /* match NETSNMP_DS_MAX_SUBIDS */
+
+ /*
+ * special meanings for the default SNMP version slot (NETSNMP_DS_LIB_SNMPVERSION)
+ */
+#ifndef NETSNMP_DISABLE_SNMPV1
+#define NETSNMP_DS_SNMP_VERSION_1 128 /* bogus */
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+#define NETSNMP_DS_SNMP_VERSION_2c 1 /* real */
+#endif
+#define NETSNMP_DS_SNMP_VERSION_3 3 /* real */
+
+
+ /*
+ * library strings
+ */
+#define NETSNMP_DS_LIB_SECNAME 0
+#define NETSNMP_DS_LIB_CONTEXT 1
+#define NETSNMP_DS_LIB_PASSPHRASE 2
+#define NETSNMP_DS_LIB_AUTHPASSPHRASE 3
+#define NETSNMP_DS_LIB_PRIVPASSPHRASE 4
+#define NETSNMP_DS_LIB_OPTIONALCONFIG 5
+#define NETSNMP_DS_LIB_APPTYPE 6
+#define NETSNMP_DS_LIB_COMMUNITY 7
+#define NETSNMP_DS_LIB_PERSISTENT_DIR 8
+#define NETSNMP_DS_LIB_CONFIGURATION_DIR 9
+#define NETSNMP_DS_LIB_SECMODEL 10
+#define NETSNMP_DS_LIB_MIBDIRS 11
+#define NETSNMP_DS_LIB_OIDSUFFIX 12
+#define NETSNMP_DS_LIB_OIDPREFIX 13
+#define NETSNMP_DS_LIB_CLIENT_ADDR 14
+#define NETSNMP_DS_LIB_TEMP_FILE_PATTERN 15
+#define NETSNMP_DS_LIB_AUTHMASTERKEY 16
+#define NETSNMP_DS_LIB_PRIVMASTERKEY 17
+#define NETSNMP_DS_LIB_AUTHLOCALIZEDKEY 18
+#define NETSNMP_DS_LIB_PRIVLOCALIZEDKEY 19
+#define NETSNMP_DS_LIB_APPTYPES 20
+#define NETSNMP_DS_LIB_KSM_KEYTAB 21
+#define NETSNMP_DS_LIB_KSM_SERVICE_NAME 22
+#define NETSNMP_DS_LIB_X509_CLIENT_PUB 23
+#define NETSNMP_DS_LIB_X509_SERVER_PUB 24
+#define NETSNMP_DS_LIB_SSHTOSNMP_SOCKET 25
+#define NETSNMP_DS_LIB_CERT_EXTRA_SUBDIR 26
+#define NETSNMP_DS_LIB_HOSTNAME 27
+#define NETSNMP_DS_LIB_X509_CRL_FILE 28
+#define NETSNMP_DS_LIB_TLS_ALGORITMS 29
+#define NETSNMP_DS_LIB_TLS_LOCAL_CERT 30
+#define NETSNMP_DS_LIB_TLS_PEER_CERT 31
+#define NETSNMP_DS_LIB_SSH_USERNAME 32
+#define NETSNMP_DS_LIB_SSH_PUBKEY 33
+#define NETSNMP_DS_LIB_SSH_PRIVKEY 34
+#define NETSNMP_DS_LIB_MAX_STR_ID 48 /* match NETSNMP_DS_MAX_SUBIDS */
+
+ /*
+ * end storage definitions
+ */
+
+ NETSNMP_IMPORT
+ int netsnmp_ds_set_boolean(int storeid, int which, int value);
+ NETSNMP_IMPORT
+ int netsnmp_ds_get_boolean(int storeid, int which);
+ NETSNMP_IMPORT
+ int netsnmp_ds_toggle_boolean(int storeid, int which);
+ NETSNMP_IMPORT
+ int netsnmp_ds_set_int(int storeid, int which, int value);
+ NETSNMP_IMPORT
+ int netsnmp_ds_get_int(int storeid, int which);
+ NETSNMP_IMPORT
+ int netsnmp_ds_set_string(int storeid, int which,
+ const char *value);
+ NETSNMP_IMPORT
+ char *netsnmp_ds_get_string(int storeid, int which);
+ NETSNMP_IMPORT
+ int netsnmp_ds_set_void(int storeid, int which, void *value);
+ NETSNMP_IMPORT
+ void *netsnmp_ds_get_void(int storeid, int which);
+ NETSNMP_IMPORT
+ int netsnmp_ds_register_config(u_char type, const char *ftype,
+ const char *token, int storeid,
+ int which);
+ NETSNMP_IMPORT
+ int netsnmp_ds_register_premib(u_char type, const char *ftype,
+ const char *token, int storeid,
+ int which);
+ NETSNMP_IMPORT
+ int netsnmp_ds_parse_boolean(char *line);
+ NETSNMP_IMPORT
+ void netsnmp_ds_shutdown(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DEFAULT_STORE_H */
+/** @} */
diff --git a/include/net-snmp/library/dir_utils.h b/include/net-snmp/library/dir_utils.h
new file mode 100644
index 0000000..471bb0b
--- /dev/null
+++ b/include/net-snmp/library/dir_utils.h
@@ -0,0 +1,63 @@
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#ifndef NETSNMP_DIR_UTILS_H
+#define NETSNMP_DIR_UTILS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * filter function; return 1 to include file, 0 to exclude
+ */
+#define NETSNMP_DIR_EXCLUDE 0
+#define NETSNMP_DIR_INCLUDE 1
+ typedef int (netsnmp_directory_filter)(const void *text, void *ctx);
+
+
+ /*------------------------------------------------------------------
+ *
+ * Prototypes
+ */
+ netsnmp_container *
+ netsnmp_directory_container_read_some(netsnmp_container *user_container,
+ const char *dirname,
+ netsnmp_directory_filter *filter,
+ void *filter_ctx, u_int flags);
+
+#define netsnmp_directory_container_read(c,d,f) \
+ netsnmp_directory_container_read_some(c,d,NULL,NULL,f);
+
+ void netsnmp_directory_container_free(netsnmp_container *c);
+
+
+
+ /*------------------------------------------------------------------
+ *
+ * flags
+ */
+#define NETSNMP_DIR_RECURSE 0x0001
+#define NETSNMP_DIR_RELATIVE_PATH 0x0002
+#define NETSNMP_DIR_SORTED 0x0004
+/** don't return null if dir empty */
+#define NETSNMP_DIR_EMPTY_OK 0x0008
+/** store netsnmp_file instead of filenames */
+#define NETSNMP_DIR_NSFILE 0x0010
+/** load stats in netsnmp_file */
+#define NETSNMP_DIR_NSFILE_STATS 0x0020
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_DIR_UTILS_H */
diff --git a/include/net-snmp/library/factory.h b/include/net-snmp/library/factory.h
new file mode 100644
index 0000000..faf82a2
--- /dev/null
+++ b/include/net-snmp/library/factory.h
@@ -0,0 +1,72 @@
+#ifndef NETSNMP_FACTORY_H
+#define NETSNMP_FACTORY_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ typedef void * (netsnmp_factory_produce_f)(void);
+ typedef int (netsnmp_factory_produce_noalloc_f)(void *);
+
+ typedef struct netsnmp_factory_s {
+ /*
+ * a string describing the product the factory creates
+ */
+ const char *product;
+
+ /*
+ * a function to create an object in newly allcoated memory
+ */
+ netsnmp_factory_produce_f *produce;
+
+ /*
+ * a function to create an object in previously allcoated memory
+ */
+ netsnmp_factory_produce_noalloc_f *produce_noalloc;
+
+ } netsnmp_factory;
+
+ /*
+ * init factory registry
+ */
+ void netsnmp_factory_init(void);
+
+ /*
+ * register a factory type
+ */
+ int netsnmp_factory_register(netsnmp_factory *f);
+
+ /*
+ * get a factory
+ */
+ netsnmp_factory* netsnmp_factory_get(const char* product);
+
+ /*
+ * ask a factory to produce an object
+ */
+ void * netsnmp_factory_produce(const char* product);
+
+ /*
+ * ask a factory to produce an object in the provided memory
+ */
+ int netsnmp_factory_produce_noalloc(const char *product, void *memory);
+
+ /*
+ * factory return codes
+ */
+ enum {
+ FACTORY_NOERROR = 0,
+ FACTORY_EXISTS,
+ FACTORY_NOTFOUND,
+ FACTORY_NOMEMORY,
+ FACTORY_GENERR,
+ FACTORY_MAXIMUM_ERROR
+ };
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* NETSNMP_FACTORY_H */
diff --git a/include/net-snmp/library/fd_event_manager.h b/include/net-snmp/library/fd_event_manager.h
new file mode 100644
index 0000000..ede67b4
--- /dev/null
+++ b/include/net-snmp/library/fd_event_manager.h
@@ -0,0 +1,134 @@
+/**************************************************************************
+ * UNIT: File Descriptor (FD) Event Manager
+ *
+ * OVERVIEW: This unit contains functions to register a FD with the FD
+ * event manager for callbacks when activity is received on that
+ * FD. Notification of read, write, and exception activity can
+ * all be registered for individually. Once a registered FD is
+ * closed by the user, the FD must be unregistered. To use
+ * the FD Event manager you need to make calls to
+ * netsnmp_external_event_info() and
+ * netsnmp_dispatch_external_events() in your event loop to receive
+ * callbacks for registered events. See snmpd.c and snmptrapd.c
+ * for examples.
+ *
+ * LIMITATIONS:
+ **************************************************************************/
+#ifndef FD_EVENT_MANAGER_H
+#define FD_EVENT_MANAGER_H
+
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define NUM_EXTERNAL_FDS 32
+#define FD_REGISTERED_OK 0
+#define FD_REGISTRATION_FAILED -2
+#define FD_UNREGISTERED_OK 0
+#define FD_NO_SUCH_REGISTRATION -1
+
+/* Since the inception of netsnmp_external_event_info and
+ * netsnmp_dispatch_external_events, there is no longer a need for the data
+ * below to be globally visible. We will leave it global for now for
+ * compatibility purposes. */
+extern int external_readfd[NUM_EXTERNAL_FDS], external_readfdlen;
+extern int external_writefd[NUM_EXTERNAL_FDS], external_writefdlen;
+extern int external_exceptfd[NUM_EXTERNAL_FDS], external_exceptfdlen;
+
+extern void (*external_readfdfunc[NUM_EXTERNAL_FDS]) (int, void *);
+extern void (*external_writefdfunc[NUM_EXTERNAL_FDS]) (int, void *);
+extern void (*external_exceptfdfunc[NUM_EXTERNAL_FDS]) (int, void *);
+
+extern void *external_readfd_data[NUM_EXTERNAL_FDS];
+extern void *external_writefd_data[NUM_EXTERNAL_FDS];
+extern void *external_exceptfd_data[NUM_EXTERNAL_FDS];
+
+/* Here are the key functions of this unit. Use register_xfd to register
+ * a callback to be called when there is x activity on the register fd.
+ * x can be read, write, or except (for exception). When registering,
+ * you can pass in a pointer to some data that you have allocated that
+ * you would like to have back when the callback is called. */
+int register_readfd(int, void (*func)(int, void *), void *);
+int register_writefd(int, void (*func)(int, void *), void *);
+int register_exceptfd(int, void (*func)(int, void *), void *);
+
+/* Unregisters a given fd for events */
+int unregister_readfd(int);
+int unregister_writefd(int);
+int unregister_exceptfd(int);
+
+/*
+ * External Event Info
+ *
+ * Description:
+ * Call this function to add an external event fds to your read, write,
+ * exception fds that your application already has. When this function
+ * returns, your fd_sets will be ready for select(). It returns the
+ * biggest fd in the fd_sets so far.
+ *
+ * Input Parameters: None
+ *
+ * Output Parameters: None
+ *
+ * In/Out Parameters:
+ * numfds - The biggest fd so far. On exit to this function, numfds
+ * could of changed since we pass out the new biggest fd.
+ * readfds - Set of read FDs that we are monitoring. This function
+ * can modify this set to have more FDs that we are monitoring.
+ * writefds - Set of write FDs that we are monitoring. This function
+ * can modify this set to have more FDs that we are monitoring.
+ * exceptfds - Set of exception FDs that we are monitoring. This function
+ * can modify this set to have more FDs that we are monitoring.
+ *
+ * Return Value: None
+ *
+ * Side Effects: None
+ */
+NETSNMP_IMPORT
+void netsnmp_external_event_info(int *numfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds);
+
+NETSNMP_IMPORT
+void netsnmp_external_event_info2(int *numfds,
+ netsnmp_large_fd_set *readfds,
+ netsnmp_large_fd_set *writefds,
+ netsnmp_large_fd_set *exceptfds);
+
+/*
+ * Dispatch External Events
+ *
+ * Description:
+ * Call this function after select returns with pending events. If any of
+ * them were NETSNMP external events, the registered callback will be called.
+ * The corresponding fd_set will have the FD cleared after the event is
+ * dispatched.
+ *
+ * Input Parameters: None
+ *
+ * Output Parameters: None
+ *
+ * In/Out Parameters:
+ * count - Number of FDs that have activity. In this function, we decrement
+ * count as we dispatch an event.
+ * readfds - Set of read FDs that have activity
+ * writefds - Set of write FDs that have activity
+ * exceptfds - Set of exception FDs that have activity
+ *
+ * Return Value: None
+ *
+ * Side Effects: None
+ */
+NETSNMP_IMPORT
+void netsnmp_dispatch_external_events(int *count, fd_set *readfds, fd_set *writefds, fd_set *exceptfds);
+NETSNMP_IMPORT
+void netsnmp_dispatch_external_events2(int *count,
+ netsnmp_large_fd_set *readfds,
+ netsnmp_large_fd_set *writefds,
+ netsnmp_large_fd_set *exceptfds);
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/library/file_utils.h b/include/net-snmp/library/file_utils.h
new file mode 100644
index 0000000..9f5cdce
--- /dev/null
+++ b/include/net-snmp/library/file_utils.h
@@ -0,0 +1,88 @@
+#ifndef NETSNMP_FILE_UTILS_H
+#define NETSNMP_FILE_UTILS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*------------------------------------------------------------------
+ *
+ * structures
+ *
+ */
+ typedef struct netsnmp_file_s {
+
+ /** file name */
+ char *name;
+
+ /** file descriptor for the file */
+ int fd;
+
+ /** filesystem flags */
+ int fs_flags;
+
+ /** open/create mode */
+ mode_t mode;
+
+ /** netsnmp flags */
+ u_int ns_flags;
+
+ /** file stats */
+ struct stat *stats;
+
+ /*
+ * future expansion
+ */
+ netsnmp_data_list *extras;
+
+ } netsnmp_file;
+
+
+
+ /*------------------------------------------------------------------
+ *
+ * Prototypes
+ *
+ */
+ netsnmp_file *netsnmp_file_new(const char *name, int fs_flags, mode_t mode,
+ u_int ns_flags);
+
+ netsnmp_file * netsnmp_file_create(void);
+ netsnmp_file * netsnmp_file_fill(netsnmp_file * filei, const char* name,
+ int fs_flags, mode_t mode, u_int ns_flags);
+ int netsnmp_file_release(netsnmp_file * filei);
+
+ int netsnmp_file_open(netsnmp_file * filei);
+ int netsnmp_file_close(netsnmp_file * filei);
+
+ /** support netsnmp_file containers */
+ int netsnmp_file_compare_name(netsnmp_file *lhs, netsnmp_file *rhs);
+ void netsnmp_file_container_free(netsnmp_file *file, void *context);
+
+
+
+ /*------------------------------------------------------------------
+ *
+ * flags
+ *
+ */
+#define NETSNMP_FILE_NO_AUTOCLOSE 0x00000001
+#define NETSNMP_FILE_STATS 0x00000002
+#define NETSNMP_FILE_AUTO_OPEN 0x00000004
+
+ /*------------------------------------------------------------------
+ *
+ * macros
+ *
+ */
+#define NS_FI_AUTOCLOSE(x) (0 == (x & NETSNMP_FILE_NO_AUTOCLOSE))
+#define NS_FI_(x) (0 == (x & NETSNMP_FILE_))
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_FILE_UTILS_H */
diff --git a/include/net-snmp/library/getopt.h b/include/net-snmp/library/getopt.h
new file mode 100644
index 0000000..f70ffe4
--- /dev/null
+++ b/include/net-snmp/library/getopt.h
@@ -0,0 +1,24 @@
+#ifndef _GETOPT_H_
+#define _GETOPT_H_ 1
+
+#ifndef NET_SNMP_CONFIG_H
+#error <net-snmp/net-snmp-config.h> must be included before <net-snmp/library/getopt.h>.
+#endif
+
+#if !defined(HAVE_GETOPT_H)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+NETSNMP_IMPORT int getopt(int, char *const *, const char *);
+NETSNMP_IMPORT char *optarg;
+NETSNMP_IMPORT int optind, opterr, optopt, optreset;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HAVE_GETOPT_H */
+
+#endif
diff --git a/include/net-snmp/library/int64.h b/include/net-snmp/library/int64.h
new file mode 100644
index 0000000..9c7c894
--- /dev/null
+++ b/include/net-snmp/library/int64.h
@@ -0,0 +1,43 @@
+#ifndef INT64_INCLUDED
+#define INT64_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ typedef struct counter64 U64;
+
+#define I64CHARSZ 21
+
+ void divBy10(U64, U64 *, unsigned int *);
+ void multBy10(U64, U64 *);
+ void incrByU16(U64 *, unsigned int);
+ void incrByU32(U64 *, unsigned int);
+ NETSNMP_IMPORT
+ void zeroU64(U64 *);
+ int isZeroU64(const U64 *);
+ NETSNMP_IMPORT
+ void printU64(char *, const U64 *);
+ NETSNMP_IMPORT
+ void printI64(char *, const U64 *);
+ int read64(U64 *, const char *);
+ NETSNMP_IMPORT
+ void u64Subtract(const U64 * pu64one, const U64 * pu64two,
+ U64 * pu64out);
+ void u64Incr(U64 * pu64out, const U64 * pu64one);
+ void u64UpdateCounter(U64 * pu64out, const U64 * pu64one,
+ const U64 * pu64two);
+ void u64Copy(U64 * pu64one, const U64 * pu64two);
+
+ int netsnmp_c64_check_for_32bit_wrap(U64 *old_val, U64 *new_val,
+ int adjust);
+ NETSNMP_IMPORT
+ int netsnmp_c64_check32_and_update(struct counter64 *prev_val,
+ struct counter64 *new_val,
+ struct counter64 *old_prev_val,
+ int *need_wrap_check);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/library/keytools.h b/include/net-snmp/library/keytools.h
new file mode 100644
index 0000000..44acc48
--- /dev/null
+++ b/include/net-snmp/library/keytools.h
@@ -0,0 +1,64 @@
+/*
+ * keytools.h
+ */
+
+#ifndef _KEYTOOLS_H
+#define _KEYTOOLS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define USM_LENGTH_EXPANDED_PASSPHRASE (1024 * 1024) /* 1Meg. */
+
+#define USM_LENGTH_KU_HASHBLOCK 64 /* In bytes. */
+
+#define USM_LENGTH_P_MIN 8 /* In characters. */
+ /*
+ * Recommended practice given in <draft-ietf-snmpv3-usm-v2-02.txt>,
+ * * Section 11.2 "Defining Users". Move into cmdline app argument
+ * * parsing, and out of the internal routine? XXX
+ */
+
+ /*
+ * Prototypes.h
+ */
+ NETSNMP_IMPORT
+ int generate_Ku(const oid * hashtype, u_int hashtype_len,
+ const u_char * P, size_t pplen,
+ u_char * Ku, size_t * kulen);
+
+ NETSNMP_IMPORT
+ int generate_kul(const oid * hashtype, u_int hashtype_len,
+ const u_char * engineID, size_t engineID_len,
+ const u_char * Ku, size_t ku_len,
+ u_char * Kul, size_t * kul_len);
+
+ NETSNMP_IMPORT
+ int encode_keychange(const oid * hashtype,
+ u_int hashtype_len, u_char * oldkey,
+ size_t oldkey_len, u_char * newkey,
+ size_t newkey_len, u_char * kcstring,
+ size_t * kcstring_len);
+
+ NETSNMP_IMPORT
+ int decode_keychange(const oid * hashtype,
+ u_int hashtype_len, u_char * oldkey,
+ size_t oldkey_len, u_char * kcstring,
+ size_t kcstring_len, u_char * newkey,
+ size_t * newkey_len);
+
+
+ /*
+ * All functions devolve to the following block if we can't do cryptography
+ */
+#define _KEYTOOLS_NOT_AVAILABLE \
+{ \
+ return SNMPERR_KT_NOT_AVAILABLE; \
+}
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _KEYTOOLS_H */
diff --git a/include/net-snmp/library/large_fd_set.h b/include/net-snmp/library/large_fd_set.h
new file mode 100644
index 0000000..9b547cd
--- /dev/null
+++ b/include/net-snmp/library/large_fd_set.h
@@ -0,0 +1,171 @@
+/**
+ * @file large_fd_set.h
+ *
+ * @brief Macro's and functions for manipulation of large file descriptor sets.
+ */
+
+
+#ifndef LARGE_FD_SET_H
+#define LARGE_FD_SET_H
+
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/types.h>
+
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+#if defined(HAVE_WINSOCK_H) && !defined(_WINSOCKAPI_) && !defined(_WINSOCK_H)
+#error <winsock.h> or <winsock2.h> must have been included before this file.
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+/**
+ * Add socket fd to the set *fdset if not yet present.
+ * Enlarges the set if necessary.
+ */
+#define NETSNMP_LARGE_FD_SET(fd, fdset) \
+ netsnmp_large_fd_setfd(fd, fdset)
+
+/**
+ * Remove socket fd from the set *fdset.
+ * Do nothing if fd is not present in *fdset.
+ * Do nothing if fd >= fdset->lfs_setsize.
+ */
+#define NETSNMP_LARGE_FD_CLR(fd, fdset) \
+ netsnmp_large_fd_clr(fd, fdset)
+
+/**
+ * Test whether set *fdset contains socket fd.
+ * Evaluates to zero (false) if fd >= fdset->lfs_setsize.
+ */
+#define NETSNMP_LARGE_FD_ISSET(fd, fdset) \
+ netsnmp_large_fd_is_set(fd, fdset)
+
+#if !defined(cygwin) && defined(HAVE_WINSOCK_H)
+
+/**
+ * Number of bytes needed to store a number of file descriptors as a
+ * struct fd_set.
+ */
+#define NETSNMP_FD_SET_BYTES(setsize) \
+ (sizeof(fd_set) + ((setsize) - FD_SETSIZE) * sizeof(SOCKET))
+
+/** Remove all sockets from the set *fdset. */
+#define NETSNMP_LARGE_FD_ZERO(fdset) \
+ do { (fdset)->lfs_setptr->fd_count = 0; } while(0)
+
+
+NETSNMP_IMPORT
+void netsnmp_large_fd_setfd( SOCKET fd, netsnmp_large_fd_set *fdset);
+NETSNMP_IMPORT
+void netsnmp_large_fd_clr( SOCKET fd, netsnmp_large_fd_set *fdset);
+NETSNMP_IMPORT
+int netsnmp_large_fd_is_set(SOCKET fd, netsnmp_large_fd_set *fdset);
+
+#else
+
+/**
+ * Size of a single element of the array with file descriptor bitmasks.
+ *
+ * According to SUSv2, this array must have the name fds_bits. See also
+ * <a href="http://www.opengroup.org/onlinepubs/007908775/xsh/systime.h.html">The Single UNIX Specification, Version 2, &lt;sys/time.h&gt;</a>.
+ */
+#define NETSNMP_FD_MASK_SIZE sizeof(((fd_set*)0)->fds_bits[0])
+
+/** Number of bits in one element of the fd_set.fds_bits array. */
+#define NETSNMP_BITS_PER_FD_MASK (8 * NETSNMP_FD_MASK_SIZE)
+
+/** Number of elements needed for the fds_bits array. */
+#define NETSNMP_FD_SET_ELEM_COUNT(setsize) \
+ (setsize + NETSNMP_BITS_PER_FD_MASK - 1) / NETSNMP_BITS_PER_FD_MASK
+
+/**
+ * Number of bytes needed to store a number of file descriptors as a
+ * struct fd_set.
+ */
+#define NETSNMP_FD_SET_BYTES(setsize) \
+ (sizeof(fd_set) + NETSNMP_FD_SET_ELEM_COUNT((setsize) - FD_SETSIZE) \
+ * NETSNMP_FD_MASK_SIZE)
+
+/** Remove all file descriptors from the set *fdset. */
+#define NETSNMP_LARGE_FD_ZERO(fdset) \
+ do { \
+ memset((fdset)->lfs_setptr, 0, \
+ NETSNMP_FD_SET_BYTES((fdset)->lfs_setsize)); \
+ } while (0)
+
+
+void netsnmp_large_fd_setfd( int fd, netsnmp_large_fd_set *fdset);
+void netsnmp_large_fd_clr( int fd, netsnmp_large_fd_set *fdset);
+int netsnmp_large_fd_is_set(int fd, netsnmp_large_fd_set *fdset);
+
+#endif
+
+/**
+ * Initialize a netsnmp_large_fd_set structure.
+ *
+ * Note: this function only initializes the lfs_setsize and lfs_setptr
+ * members of netsnmp_large_fd_set, not the file descriptor set itself.
+ * The file descriptor set must be initialized separately, e.g. via
+ * NETSNMP_LARGE_FD_CLR().
+ */
+NETSNMP_IMPORT
+void netsnmp_large_fd_set_init( netsnmp_large_fd_set *fdset, int setsize);
+
+/**
+ * Modify the size of a file descriptor set and preserve the first
+ * min(fdset->lfs_setsize, setsize) file descriptors.
+ *
+ * Returns 1 upon success or 0 if memory allocation failed.
+ */
+int netsnmp_large_fd_set_resize( netsnmp_large_fd_set *fdset, int setsize);
+
+/**
+ * Synchronous I/O multiplexing for large file descriptor sets.
+ *
+ * On POSIX systems, any file descriptor set with size below numfds will be
+ * resized before invoking select().
+ *
+ * @see See also select(2) for more information.
+ */
+NETSNMP_IMPORT
+int netsnmp_large_fd_set_select(int numfds, netsnmp_large_fd_set *readfds,
+ netsnmp_large_fd_set *writefds,
+ netsnmp_large_fd_set *exceptfds,
+ struct timeval *timeout);
+
+/** Deallocate the memory allocated by netsnmp_large_fd_set_init. */
+NETSNMP_IMPORT
+void netsnmp_large_fd_set_cleanup(netsnmp_large_fd_set *fdset);
+
+/**
+ * Copy an fd_set to a netsnmp_large_fd_set structure.
+ *
+ * @note dst must have been initialized before this function is called.
+ */
+void netsnmp_copy_fd_set_to_large_fd_set(netsnmp_large_fd_set *dst,
+ const fd_set *src);
+
+/**
+ * Copy a netsnmp_large_fd_set structure into an fd_set.
+ *
+ * @return 0 upon success, -1 when copying fails because *src is too large to
+ * fit into *dst.
+ */
+int netsnmp_copy_large_fd_set_to_fd_set( fd_set *dst,
+ const netsnmp_large_fd_set *src);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* LARGE_FD_SET_H */
diff --git a/include/net-snmp/library/lcd_time.h b/include/net-snmp/library/lcd_time.h
new file mode 100644
index 0000000..da8c3c1
--- /dev/null
+++ b/include/net-snmp/library/lcd_time.h
@@ -0,0 +1,137 @@
+/*
+ * lcd_time.h
+ */
+
+#ifndef _LCD_TIME_H
+#define _LCD_TIME_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * undefine to enable time synchronization only on authenticated packets
+ */
+#define LCD_TIME_SYNC_OPT 1
+
+ /*
+ * Macros and definitions.
+ */
+#define ETIMELIST_SIZE 23
+
+
+
+ typedef struct enginetime_struct {
+ u_char *engineID;
+ u_int engineID_len;
+
+ u_int engineTime;
+ u_int engineBoot;
+ /*
+ * Time & boots values received from last authenticated
+ * * message within the previous time window.
+ */
+
+ time_t lastReceivedEngineTime;
+ /*
+ * Timestamp made when engineTime/engineBoots was last
+ * * updated. Measured in seconds.
+ */
+
+#ifdef LCD_TIME_SYNC_OPT
+ u_int authenticatedFlag;
+#endif
+ struct enginetime_struct *next;
+ } enginetime , *Enginetime;
+
+
+
+
+ /*
+ * Macros for streamlined engineID existence checks --
+ *
+ * e is char *engineID,
+ * e_l is u_int engineID_len.
+ *
+ *
+ * ISENGINEKNOWN(e, e_l)
+ * Returns:
+ * TRUE If engineID is recoreded in the EngineID List;
+ * FALSE Otherwise.
+ *
+ * ENSURE_ENGINE_RECORD(e, e_l)
+ * Adds the given engineID to the EngineID List if it does not exist
+ * already. engineID is added with a <enginetime, engineboots>
+ * tuple of <0,0>. ALWAYS succeeds -- except in case of a
+ * fatal internal error.
+ * Returns:
+ * SNMPERR_SUCCESS On success;
+ * SNMPERR_GENERR Otherwise.
+ *
+ * MAKENEW_ENGINE_RECORD(e, e_l)
+ * Returns:
+ * SNMPERR_SUCCESS If engineID already exists in the EngineID List;
+ * SNMPERR_GENERR Otherwise -and- invokes ENSURE_ENGINE_RECORD()
+ * to add an entry to the EngineID List.
+ *
+ * XXX Requres the following declaration in modules calling ISENGINEKNOWN():
+ * static u_int dummy_etime, dummy_eboot;
+ */
+#define ISENGINEKNOWN(e, e_l) \
+ ( (get_enginetime(e, e_l, \
+ &dummy_eboot, &dummy_etime, TRUE) == SNMPERR_SUCCESS) \
+ ? TRUE \
+ : FALSE )
+
+#define ENSURE_ENGINE_RECORD(e, e_l) \
+ ( (set_enginetime(e, e_l, 0, 0, FALSE) == SNMPERR_SUCCESS) \
+ ? SNMPERR_SUCCESS \
+ : SNMPERR_GENERR )
+
+#define MAKENEW_ENGINE_RECORD(e, e_l) \
+ ( (ISENGINEKNOWN(e, e_l) == TRUE) \
+ ? SNMPERR_SUCCESS \
+ : (ENSURE_ENGINE_RECORD(e, e_l), SNMPERR_GENERR) )
+
+
+
+ /*
+ * Prototypes.
+ */
+ int get_enginetime(const u_char * engineID, u_int engineID_len,
+ u_int * engine_boot,
+ u_int * engine_time,
+ u_int authenticated);
+
+ int get_enginetime_ex(u_char * engineID,
+ u_int engineID_len,
+ u_int * engine_boot,
+ u_int * engine_time,
+ u_int * last_engine_time,
+ u_int authenticated);
+
+ int set_enginetime(const u_char * engineID, u_int engineID_len,
+ u_int engine_boot, u_int engine_time,
+ u_int authenticated);
+
+
+
+
+
+
+
+ Enginetime
+ search_enginetime_list(const u_char * engineID, u_int engineID_len);
+
+ int hash_engineID(const u_char * engineID, u_int engineID_len);
+
+ void dump_etimelist_entry(Enginetime e, int count);
+ void dump_etimelist(void);
+ void free_etimelist(void);
+ void free_enginetime(unsigned char *engineID, size_t engineID_len);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _LCD_TIME_H */
diff --git a/include/net-snmp/library/libsnmp.h b/include/net-snmp/library/libsnmp.h
new file mode 100644
index 0000000..6a07300
--- /dev/null
+++ b/include/net-snmp/library/libsnmp.h
@@ -0,0 +1,174 @@
+#ifndef _LIBSNMP_H_
+#define _LIBSNMP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * Definitions for the Simple Network Management Protocol (RFC 1067).
+ *
+ */
+/**********************************************************************
+ *
+ * Copyright 1998 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.
+ *
+ * $Id$
+ *
+ **********************************************************************/
+
+#include <ucd-snmp/ucd-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
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef UCD_SNMP_LIBRARY
+
+#include <ucd-snmp/asn1.h>
+#include <ucd-snmp/snmp_api.h>
+#include <ucd-snmp/snmp_impl.h>
+#include <ucd-snmp/snmp_client.h>
+#include <ucd-snmp/mib.h>
+#include <ucd-snmp/parse.h>
+#include <ucd-snmp/snmp.h>
+#include <ucd-snmp/system.h>
+#include <ucd-snmp/int64.h>
+#include <ucd-snmp/version.h>
+
+#define Version version /* netsnmp_session member */
+
+#define SMI_NOSUCHOBJECT SNMP_NOSUCHOBJECT
+#define SMI_NOSUCHINSTANCE SNMP_NOSUCHINSTANCE
+#define SMI_ENDOFMIBVIEW SNMP_ENDOFMIBVIEW
+
+
+#else /* !UCD_SNMP_LIBRARY */
+
+#include <sys/types.h>
+#ifndef WIN32
+#include <netinet/in.h>
+#endif
+
+#include <snmp/asn1.h>
+#include <snmp/snmp_error.h>
+#include <snmp/mibii.h>
+#include <snmp/snmp_extra.h>
+#include <snmp/snmp_dump.h>
+
+#include <snmp/snmp_session.h>
+
+#include <snmp/snmp_vars.h>
+#include <snmp/snmp_pdu.h>
+#include <snmp/snmp_msg.h>
+
+#include <snmp/snmp_coexist.h>
+#include <snmp/version.h>
+#include <snmp/snmp_api_error.h>
+#include <snmp/mini-client.h>
+
+#include <snmp/snmp_impl.h>
+#include <snmp/snmp_api.h>
+#include <snmp/snmp_client.h>
+#include <snmp/snmp-internal.h>
+#include <snmp/mib.h>
+#include <snmp/parse.h>
+#include <snmp/snmp_compat.h>
+
+ /*
+ * Load UC-Davis differential
+ */
+
+#define SNMP_MSG_GET GET_REQ_MSG
+#define SNMP_MSG_GETNEXT GETNEXT_REQ_MSG
+#define SNMP_MSG_RESPONSE GET_RSP_MSG
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#define SNMP_MSG_SET SET_REQ_MSG
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+#define SNMP_MSG_TRAP TRP_REQ_MSG
+#define SNMP_MSG_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5)
+#define SNMP_MSG_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
+#define SNMP_MSG_TRAP2 (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7)
+#define SNMP_MSG_REPORT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8)
+#define SNMP_NOSUCHOBJECT SMI_NOSUCHOBJECT
+#define SNMP_NOSUCHINSTANCE SMI_NOSUCHINSTANCE
+#define SNMP_ENDOFMIBVIEW SMI_ENDOFMIBVIEW
+
+#define ASN_IPADDRESS (ASN_APPLICATION | 0)
+#define ASN_UNSIGNED (ASN_APPLICATION | 2) /* RFC 1902 - same as GAUGE */
+#define ASN_TIMETICKS (ASN_APPLICATION | 3)
+
+#define snmp_perror(X) perror(X)
+#define snmp_set_dump_packet(X)
+#define snmp_set_quick_print(X)
+#define snmp_set_do_debugging(X)
+#define snmp_set_full_objid(X)
+#define snmp_set_suffix_only(X)
+
+#define VersionInfo snmp_Version
+#define get_node read_objid
+#define version Version /* netsnmp_session member */
+
+#define SNMP_VERSION_2c SNMP_VERSION_2
+#define SNMP_VERSION_2p 129
+
+#define SOCK_STARTUP winsock_startup()
+#define SOCK_CLEANUP winsock_cleanup()
+
+#endif /* !UCD_SNMP_LIBRARY */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _LIBSNMP_H_ */
diff --git a/include/net-snmp/library/md5.h b/include/net-snmp/library/md5.h
new file mode 100644
index 0000000..12b192a
--- /dev/null
+++ b/include/net-snmp/library/md5.h
@@ -0,0 +1,71 @@
+/*
+ * ** **************************************************************************
+ * ** md5.h -- Header file for implementation of MD5 Message Digest Algorithm **
+ * ** Updated: 2/13/90 by Ronald L. Rivest **
+ * ** (C) 1990 RSA Data Security, Inc. **
+ * ** **************************************************************************
+ */
+
+#ifndef MD5_H
+#define MD5_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * MDstruct is the data structure for a message digest computation.
+ */
+ typedef struct {
+ unsigned int buffer[4]; /* Holds 4-word result of MD computation */
+ unsigned char count[8]; /* Number of bits processed so far */
+ unsigned int done; /* Nonzero means MD computation finished */
+ } MDstruct , *MDptr;
+
+ /*
+ * MDbegin(MD)
+ * ** Input: MD -- an MDptr
+ * ** Initialize the MDstruct prepatory to doing a message digest computation.
+ */
+ NETSNMP_IMPORT void MDbegin(MDptr);
+
+ /*
+ * MDupdate(MD,X,count)
+ * ** Input: MD -- an MDptr
+ * ** X -- a pointer to an array of unsigned characters.
+ * ** count -- the number of bits of X to use (an unsigned int).
+ * ** Updates MD using the first ``count'' bits of X.
+ * ** The array pointed to by X is not modified.
+ * ** If count is not a multiple of 8, MDupdate uses high bits of last byte.
+ * ** This is the basic input routine for a user.
+ * ** The routine terminates the MD computation when count < 512, so
+ * ** every MD computation should end with one call to MDupdate with a
+ * ** count less than 512. Zero is OK for a count.
+ */
+ NETSNMP_IMPORT int MDupdate(MDptr, const unsigned char *, unsigned int);
+
+ /*
+ * MDprint(MD)
+ * ** Input: MD -- an MDptr
+ * ** Prints message digest buffer MD as 32 hexadecimal digits.
+ * ** Order is from low-order byte of buffer[0] to high-order byte of buffer[3].
+ * ** Each byte is printed with high-order hexadecimal digit first.
+ */
+ extern void MDprint(MDptr);
+
+ int MDchecksum(const u_char * data, size_t len, u_char * mac,
+ size_t maclen);
+ int MDsign(const u_char * data, size_t len, u_char * mac,
+ size_t maclen, const u_char * secret,
+ size_t secretlen);
+ void MDget(MDstruct * MD, u_char * buf, size_t buflen);
+
+ /*
+ * ** End of md5.h
+ * ****************************(cut)****************************************
+ */
+#ifdef __cplusplus
+}
+#endif
+#endif /* MD5_H */
diff --git a/include/net-snmp/library/mib.h b/include/net-snmp/library/mib.h
new file mode 100644
index 0000000..18d98e1
--- /dev/null
+++ b/include/net-snmp/library/mib.h
@@ -0,0 +1,518 @@
+#ifndef MIB_H
+#define MIB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /*
+ * mib.h - Definitions for the variables as defined in the MIB
+ *
+ * Update: 1998-07-17 <jhy@gsu.edu>
+ * Added prototypes for print_oid_report* functions.
+ */
+/***********************************************************
+ 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.
+******************************************************************/
+
+#include <stdio.h> /* for FILE */
+
+#include <net-snmp/mib_api.h>
+
+#define NETSNMP_MIB2_OID 1, 3, 6, 1, 2, 1
+
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+#define MIB NETSNMP_MIB2_OID
+#endif
+
+#define MIB_IFTYPE_OTHER 1
+#define MIB_IFTYPE_REGULAR1822 2
+#define MIB_IFTYPE_HDH1822 3
+#define MIB_IFTYPE_DDNX25 4
+#define MIB_IFTYPE_RFC877X25 5
+#define MIB_IFTYPE_ETHERNETCSMACD 6
+#define MIB_IFTYPE_ISO88023CSMACD 7
+#define MIB_IFTYPE_ISO88024TOKENBUS 8
+#define MIB_IFTYPE_ISO88025TOKENRING 9
+#define MIB_IFTYPE_ISO88026MAN 10
+#define MIB_IFTYPE_STARLAN 11
+#define MIB_IFTYPE_PROTEON10MBIT 12
+#define MIB_IFTYPE_PROTEON80MBIT 13
+#define MIB_IFTYPE_HYPERCHANNEL 14
+#define MIB_IFTYPE_FDDI 15
+#define MIB_IFTYPE_LAPB 16
+#define MIB_IFTYPE_SDLC 17
+#define MIB_IFTYPE_T1CARRIER 18
+#define MIB_IFTYPE_CEPT 19
+#define MIB_IFTYPE_BASICISDN 20
+#define MIB_IFTYPE_PRIMARYISDN 21
+#define MIB_IFTYPE_PROPPOINTTOPOINTSERIAL 22
+
+#define MIB_IFSTATUS_UP 1
+#define MIB_IFSTATUS_DOWN 2
+#define MIB_IFSTATUS_TESTING 3
+
+#define MIB_FORWARD_GATEWAY 1
+#define MIB_FORWARD_HOST 2
+
+#define MIB_IPROUTETYPE_OTHER 1
+#define MIB_IPROUTETYPE_INVALID 2
+#define MIB_IPROUTETYPE_DIRECT 3
+#define MIB_IPROUTETYPE_REMOTE 4
+
+#define MIB_IPROUTEPROTO_OTHER 1
+#define MIB_IPROUTEPROTO_LOCAL 2
+#define MIB_IPROUTEPROTO_NETMGMT 3
+#define MIB_IPROUTEPROTO_ICMP 4
+#define MIB_IPROUTEPROTO_EGP 5
+#define MIB_IPROUTEPROTO_GGP 6
+#define MIB_IPROUTEPROTO_HELLO 7
+#define MIB_IPROUTEPROTO_RIP 8
+#define MIB_IPROUTEPROTO_ISIS 9
+#define MIB_IPROUTEPROTO_ESIS 10
+#define MIB_IPROUTEPROTO_CISCOIGRP 11
+#define MIB_IPROUTEPROTO_BBNSPFIGP 12
+#define MIB_IPROUTEPROTO_OIGP 13
+
+#define MIB_TCPRTOALG_OTHER 1
+#define MIB_TCPRTOALG_CONSTANT 2
+#define MIB_TCPRTOALG_RSRE 3
+#define MIB_TCPRTOALG_VANJ 4
+
+#define MIB_TCPCONNSTATE_CLOSED 1
+#define MIB_TCPCONNSTATE_LISTEN 2
+#define MIB_TCPCONNSTATE_SYNSENT 3
+#define MIB_TCPCONNSTATE_SYNRECEIVED 4
+#define MIB_TCPCONNSTATE_ESTABLISHED 5
+#define MIB_TCPCONNSTATE_FINWAIT1 6
+#define MIB_TCPCONNSTATE_FINWAIT2 7
+#define MIB_TCPCONNSTATE_CLOSEWAIT 8
+#define MIB_TCPCONNSTATE_LASTACK 9
+#define MIB_TCPCONNSTATE_CLOSING 10
+#define MIB_TCPCONNSTATE_TIMEWAIT 11
+
+#define MIB_EGPNEIGHSTATE_IDLE 1
+#define MIB_EGPNEIGHSTATE_AQUISITION 2
+#define MIB_EGPNEIGHSTATE_DOWN 3
+#define MIB_EGPNEIGHSTATE_UP 4
+#define MIB_EGPNEIGHSTATE_CEASE 5
+
+ struct variable_list;
+ struct enum_list;
+
+ NETSNMP_IMPORT
+ void print_ascii_dump(FILE *);
+ void register_mib_handlers(void);
+ void netsnmp_set_mib_directory(const char *dir);
+ NETSNMP_IMPORT
+ char *netsnmp_get_mib_directory(void);
+ void netsnmp_fixup_mib_directory(void);
+ void netsnmp_mibindex_load( void );
+ char * netsnmp_mibindex_lookup( const char * );
+ FILE * netsnmp_mibindex_new( const char * );
+ int sprint_realloc_description(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ oid * objid, size_t objidlen, int width);
+ NETSNMP_IMPORT
+ int get_wild_node(const char *, oid *, size_t *);
+ NETSNMP_IMPORT
+ int get_node(const char *, oid *, size_t *);
+ NETSNMP_IMPORT
+ struct tree *get_tree(const oid *, size_t, struct tree *);
+ NETSNMP_IMPORT
+ struct tree *get_tree_head(void);
+ void set_function(struct tree *);
+
+ NETSNMP_IMPORT
+ int parse_one_oid_index(oid ** oidStart, size_t * oidLen,
+ netsnmp_variable_list * data,
+ int complete);
+ NETSNMP_IMPORT
+ int parse_oid_indexes(oid * oidIndex, size_t oidLen,
+ netsnmp_variable_list * data);
+ NETSNMP_IMPORT
+ int build_oid_noalloc(oid * in, size_t in_len,
+ size_t * out_len, oid * prefix,
+ size_t prefix_len,
+ netsnmp_variable_list * indexes);
+ NETSNMP_IMPORT
+ int build_oid(oid ** out, size_t * out_len, oid * prefix,
+ size_t prefix_len,
+ netsnmp_variable_list * indexes);
+ int build_oid_segment(netsnmp_variable_list * var);
+
+ NETSNMP_IMPORT
+ int sprint_realloc_variable(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable);
+
+ NETSNMP_IMPORT
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ struct tree *
+#else
+ void
+#endif
+ netsnmp_sprint_realloc_objid_tree(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ int *buf_overflow,
+ const oid * objid,
+ size_t objidlen);
+
+ NETSNMP_IMPORT
+ void
+ netsnmp_sprint_realloc_objid(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ int *buf_overflow,
+ const oid * objid,
+ size_t objidlen);
+
+ NETSNMP_IMPORT
+ int sprint_realloc_value(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable);
+
+ NETSNMP_IMPORT
+ int sprint_realloc_objid(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const oid * objid, size_t objidlen);
+
+ NETSNMP_IMPORT
+ int sprint_realloc_by_type(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint,
+ const char *units);
+
+ NETSNMP_IMPORT
+ int sprint_realloc_hexstring(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const u_char *, size_t);
+
+ NETSNMP_IMPORT
+ int sprint_realloc_asciistring(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const u_char * cp,
+ size_t len);
+
+ int sprint_realloc_octet_string(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *,
+ const char *);
+
+ int sprint_realloc_opaque(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int sprint_realloc_object_identifier(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list
+ *, const struct enum_list *,
+ const char *,
+ const char *);
+
+ int sprint_realloc_timeticks(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int sprint_realloc_hinted_integer(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc, long,
+ const char, const char *,
+ const char *);
+
+ int sprint_realloc_integer(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int sprint_realloc_uinteger(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int sprint_realloc_gauge(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int sprint_realloc_counter(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int sprint_realloc_networkaddress(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *,
+ const char *);
+
+ int sprint_realloc_ipaddress(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int sprint_realloc_null(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int sprint_realloc_bitstring(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int sprint_realloc_nsapaddress(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int sprint_realloc_counter64(u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int sprint_realloc_badtype(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ int sprint_realloc_float(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int sprint_realloc_double(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+#endif
+
+
+ int snprint_by_type(char *buf, size_t buf_len,
+ netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units);
+
+ int snprint_hexstring(char *buf, size_t buf_len,
+ const u_char *, size_t);
+
+ int snprint_asciistring(char *buf, size_t buf_len,
+ const u_char * cp, size_t len);
+
+ int snprint_octet_string(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_opaque(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_object_identifier(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int snprint_timeticks(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_hinted_integer(char *buf, size_t buf_len,
+ long, const char *,
+ const char *);
+
+ int snprint_integer(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_uinteger(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_gauge(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_counter(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_networkaddress(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *,
+ const char *, const char *);
+
+ int snprint_ipaddress(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_null(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ NETSNMP_IMPORT
+ int snprint_bitstring(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_nsapaddress(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_counter64(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_badtype(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ int snprint_float(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+
+ int snprint_double(char *buf, size_t buf_len,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+#endif
+
+ NETSNMP_IMPORT
+ void print_oid_report(FILE *);
+ NETSNMP_IMPORT
+ void print_oid_report_enable_labeledoid(void);
+ NETSNMP_IMPORT
+ void print_oid_report_enable_oid(void);
+ NETSNMP_IMPORT
+ void print_oid_report_enable_suffix(void);
+ NETSNMP_IMPORT
+ void print_oid_report_enable_symbolic(void);
+ NETSNMP_IMPORT
+ void print_oid_report_enable_mibchildoid(void);
+
+ const char *parse_octet_hint(const char *hint, const char *value,
+ unsigned char **new_val, int *new_val_len);
+
+ NETSNMP_IMPORT
+ void clear_tree_flags(register struct tree *tp);
+
+ NETSNMP_IMPORT
+ char *snmp_out_toggle_options(char *);
+ NETSNMP_IMPORT
+ void snmp_out_toggle_options_usage(const char *, FILE *);
+ NETSNMP_IMPORT
+ char *snmp_in_toggle_options(char *);
+ char *snmp_in_options(char *, int, char * const *);
+ NETSNMP_IMPORT
+ void snmp_in_toggle_options_usage(const char *, FILE *);
+ NETSNMP_IMPORT
+ u_char mib_to_asn_type(int mib_type);
+
+
+ int netsnmp_str2oid(const char *S, oid * O, int L);
+
+
+#define NETSNMP_STRING_OUTPUT_GUESS 1
+#define NETSNMP_STRING_OUTPUT_ASCII 2
+#define NETSNMP_STRING_OUTPUT_HEX 3
+
+#define NETSNMP_OID_OUTPUT_SUFFIX 1
+#define NETSNMP_OID_OUTPUT_MODULE 2
+#define NETSNMP_OID_OUTPUT_FULL 3
+#define NETSNMP_OID_OUTPUT_NUMERIC 4
+#define NETSNMP_OID_OUTPUT_UCD 5
+#define NETSNMP_OID_OUTPUT_NONE 6
+#ifdef __cplusplus
+}
+#endif
+#endif /* MIB_H */
diff --git a/include/net-snmp/library/mt_support.h b/include/net-snmp/library/mt_support.h
new file mode 100644
index 0000000..4e35d33
--- /dev/null
+++ b/include/net-snmp/library/mt_support.h
@@ -0,0 +1,89 @@
+/*
+ * mt_support.h - multi-thread resource locking support declarations
+ */
+/*
+ * Author: Markku Laukkanen
+ * Created: 6-Sep-1999
+ * History:
+ * 8-Sep-1999 M. Slifcak method names changed;
+ * use array of resource locking structures.
+ */
+
+#ifndef MT_SUPPORT_H
+#define MT_SUPPORT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Lock group identifiers
+ */
+
+#define MT_LIBRARY_ID 0
+#define MT_APPLICATION_ID 1
+#define MT_TOKEN_ID 2
+
+#define MT_MAX_IDS 3 /* one greater than last from above */
+#define MT_MAX_SUBIDS 10
+
+
+/*
+ * Lock resource identifiers for library resources
+ */
+
+#define MT_LIB_NONE 0
+#define MT_LIB_SESSION 1
+#define MT_LIB_REQUESTID 2
+#define MT_LIB_MESSAGEID 3
+#define MT_LIB_SESSIONID 4
+#define MT_LIB_TRANSID 5
+
+#define MT_LIB_MAXIMUM 6 /* must be one greater than the last one */
+
+
+#if defined(NETSNMP_REENTRANT) || defined(WIN32)
+
+#if HAVE_PTHREAD_H
+#include <pthread.h>
+typedef pthread_mutex_t mutex_type;
+#ifdef pthread_mutexattr_default
+#define MT_MUTEX_INIT_DEFAULT pthread_mutexattr_default
+#else
+#define MT_MUTEX_INIT_DEFAULT 0
+#endif
+
+#elif defined(WIN32) || defined(cygwin)
+
+#include <windows.h>
+typedef CRITICAL_SECTION mutex_type;
+
+#else /* HAVE_PTHREAD_H */
+error "There is no re-entrant support as defined."
+#endif /* HAVE_PTHREAD_H */
+
+
+NETSNMP_IMPORT
+int snmp_res_init(void);
+NETSNMP_IMPORT
+int snmp_res_lock(int groupID, int resourceID);
+NETSNMP_IMPORT
+int snmp_res_unlock(int groupID, int resourceID);
+NETSNMP_IMPORT
+int snmp_res_destroy_mutex(int groupID, int resourceID);
+
+#else /* NETSNMP_REENTRANT */
+
+#ifndef WIN32
+#define snmp_res_init() do {} while (0)
+#define snmp_res_lock(x,y) do {} while (0)
+#define snmp_res_unlock(x,y) do {} while (0)
+#define snmp_res_destroy_mutex(x,y) do {} while (0)
+#endif /* WIN32 */
+
+#endif /* NETSNMP_REENTRANT */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MT_SUPPORT_H */
diff --git a/include/net-snmp/library/oid.h b/include/net-snmp/library/oid.h
new file mode 100644
index 0000000..e7adf41
--- /dev/null
+++ b/include/net-snmp/library/oid.h
@@ -0,0 +1,18 @@
+#ifndef NETSNMP_LIBRARY_OID_H
+#define NETSNMP_LIBRARY_OID_H
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#ifndef EIGHTBIT_SUBIDS
+typedef u_long oid;
+#define MAX_SUBID 0xFFFFFFFFUL
+#define NETSNMP_PRIo "l"
+#else
+typedef uint8_t oid;
+#define MAX_SUBID 0xFF
+#define NETSNMP_PRIo ""
+#endif
+
+#endif /* NETSNMP_LIBRARY_OID_H */
diff --git a/include/net-snmp/library/oid_stash.h b/include/net-snmp/library/oid_stash.h
new file mode 100644
index 0000000..290bb40
--- /dev/null
+++ b/include/net-snmp/library/oid_stash.h
@@ -0,0 +1,82 @@
+#ifndef OID_STASH_H
+#define OID_STASH_H
+
+/*
+ * designed to store/retrieve information associated with a given oid.
+ * Storage is done in an efficient tree manner for fast lookups.
+ */
+
+#define OID_STASH_CHILDREN_SIZE 31
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ struct netsnmp_oid_stash_node_s;
+
+ /* args: buffer, sizeof(buffer), yourdata, stashnode */
+ typedef int (NetSNMPStashDump) (char *, size_t,
+ void *,
+ struct netsnmp_oid_stash_node_s *);
+
+ typedef void (NetSNMPStashFreeNode) (void *);
+
+ typedef struct netsnmp_oid_stash_node_s {
+ oid value;
+ struct netsnmp_oid_stash_node_s **children; /* array of children */
+ size_t children_size;
+ struct netsnmp_oid_stash_node_s *next_sibling; /* cache too small links */
+ struct netsnmp_oid_stash_node_s *prev_sibling;
+ struct netsnmp_oid_stash_node_s *parent;
+
+ void *thedata;
+ } netsnmp_oid_stash_node;
+
+ typedef struct netsnmp_oid_stash_save_info_s {
+ const char *token;
+ netsnmp_oid_stash_node **root;
+ NetSNMPStashDump *dumpfn;
+ } netsnmp_oid_stash_save_info;
+
+ NETSNMP_IMPORT
+ int netsnmp_oid_stash_add_data(netsnmp_oid_stash_node **root,
+ const oid * lookup,
+ size_t lookup_len,
+ void *mydata);
+ SNMPCallback netsnmp_oid_stash_store_all;
+
+
+ netsnmp_oid_stash_node
+ *netsnmp_oid_stash_get_node(netsnmp_oid_stash_node *root,
+ const oid * lookup, size_t lookup_len);
+ NETSNMP_IMPORT
+ void *netsnmp_oid_stash_get_data(netsnmp_oid_stash_node *root,
+ const oid * lookup,
+ size_t lookup_len);
+ NETSNMP_IMPORT
+ netsnmp_oid_stash_node *
+ netsnmp_oid_stash_getnext_node(netsnmp_oid_stash_node *root,
+ oid * lookup, size_t lookup_len);
+
+ netsnmp_oid_stash_node *netsnmp_oid_stash_create_sized_node(size_t
+ mysize);
+ netsnmp_oid_stash_node *netsnmp_oid_stash_create_node(void); /* returns a malloced node */
+
+ void netsnmp_oid_stash_store(netsnmp_oid_stash_node *root,
+ const char *tokenname,
+ NetSNMPStashDump *dumpfn,
+ oid *curoid, size_t curoid_len);
+
+ /* frees all data in the stash and cleans it out. Sets root = NULL */
+ NETSNMP_IMPORT
+ void netsnmp_oid_stash_free(netsnmp_oid_stash_node **root,
+ NetSNMPStashFreeNode *freefn);
+
+
+ /* a noop function that can be passed to netsnmp_oid_stash_node to
+ NOT free the data */
+ NetSNMPStashFreeNode netsnmp_oid_stash_no_free;
+#ifdef __cplusplus
+}
+#endif
+#endif /* OID_STASH_H */
diff --git a/include/net-snmp/library/openssl_aes.h b/include/net-snmp/library/openssl_aes.h
new file mode 100644
index 0000000..bddf083
--- /dev/null
+++ b/include/net-snmp/library/openssl_aes.h
@@ -0,0 +1,140 @@
+/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ */
+
+#ifndef HEADER_AES_H
+#define HEADER_AES_H
+
+#ifdef OPENSSL_NO_AES
+#error AES is disabled.
+#endif
+
+#include <stddef.h>
+
+#define AES_ENCRYPT 1
+#define AES_DECRYPT 0
+
+/* Because array size can't be a const in C, the following two are macros.
+ Both sizes are in bytes. */
+#define AES_MAXNR 14
+#define AES_BLOCK_SIZE 16
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This should be a hidden type, but EVP requires that the size be known */
+struct aes_key_st {
+#ifdef AES_LONG
+ unsigned long rd_key[4 *(AES_MAXNR + 1)];
+#else
+ unsigned int rd_key[4 *(AES_MAXNR + 1)];
+#endif
+ int rounds;
+};
+typedef struct aes_key_st AES_KEY;
+
+const char *AES_options(void);
+
+int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+
+void AES_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void AES_decrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+
+void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key, const int enc);
+void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, const int enc);
+void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num);
+void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char ivec[AES_BLOCK_SIZE],
+ unsigned char ecount_buf[AES_BLOCK_SIZE],
+ unsigned int *num);
+/* NB: the IV is _two_ blocks long */
+void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, const int enc);
+/* NB: the IV is _four_ blocks long */
+void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ const AES_KEY *key2, const unsigned char *ivec,
+ const int enc);
+
+int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, unsigned int inlen);
+int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, unsigned int inlen);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !HEADER_AES_H */
diff --git a/include/net-snmp/library/openssl_des.h b/include/net-snmp/library/openssl_des.h
new file mode 100644
index 0000000..44e7baf
--- /dev/null
+++ b/include/net-snmp/library/openssl_des.h
@@ -0,0 +1,236 @@
+/* crypto/des/des.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+/* Copied roughly from opensslconf.h which it's a little more complex */
+#define DES_LONG unsigned long
+
+#ifndef HEADER_NEW_DES_H
+#define HEADER_NEW_DES_H
+
+#ifdef OPENSSL_NO_DES
+#error DES is disabled.
+#endif
+
+#ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef unsigned char DES_cblock[8];
+typedef /* const */ unsigned char const_DES_cblock[8];
+/* With "const", gcc 2.8.1 on Solaris thinks that DES_cblock *
+ * and const_DES_cblock * are incompatible pointer types. */
+
+typedef struct DES_ks
+ {
+ union
+ {
+ DES_cblock cblock;
+ /* make sure things are correct size on machines with
+ * 8 byte longs */
+ DES_LONG deslong[2];
+ } ks[16];
+ } DES_key_schedule;
+
+#ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT
+# ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT
+# define OPENSSL_ENABLE_OLD_DES_SUPPORT
+# endif
+#endif
+
+#define DES_KEY_SZ (sizeof(DES_cblock))
+#define DES_SCHEDULE_SZ (sizeof(DES_key_schedule))
+
+#define DES_ENCRYPT 1
+#define DES_DECRYPT 0
+
+#define DES_CBC_MODE 0
+#define DES_PCBC_MODE 1
+
+#define DES_ecb2_encrypt(i,o,k1,k2,e) \
+ DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+
+#define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
+ DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+
+#define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
+ DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+
+#define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
+ DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+
+const char *DES_options(void);
+void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
+ DES_key_schedule *ks1,DES_key_schedule *ks2,
+ DES_key_schedule *ks3, int enc);
+DES_LONG DES_cbc_cksum(const unsigned char *input,DES_cblock *output,
+ long length,DES_key_schedule *schedule,
+ const_DES_cblock *ivec);
+/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */
+void DES_cbc_encrypt(const unsigned char *input,unsigned char *output,
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ int enc);
+void DES_ncbc_encrypt(const unsigned char *input,unsigned char *output,
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ int enc);
+void DES_xcbc_encrypt(const unsigned char *input,unsigned char *output,
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ const_DES_cblock *inw,const_DES_cblock *outw,int enc);
+void DES_cfb_encrypt(const unsigned char *in,unsigned char *out,int numbits,
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ int enc);
+void DES_ecb_encrypt(const_DES_cblock *input,DES_cblock *output,
+ DES_key_schedule *ks,int enc);
+
+/* This is the DES encryption function that gets called by just about
+ every other DES routine in the library. You should not use this
+ function except to implement 'modes' of DES. I say this because the
+ functions that call this routine do the conversion from 'char *' to
+ long, and this needs to be done to make sure 'non-aligned' memory
+ access do not occur. The characters are loaded 'little endian'.
+ Data is a pointer to 2 unsigned long's and ks is the
+ DES_key_schedule to use. enc, is non zero specifies encryption,
+ zero if decryption. */
+void DES_encrypt1(DES_LONG *data,DES_key_schedule *ks, int enc);
+
+/* This functions is the same as DES_encrypt1() except that the DES
+ initial permutation (IP) and final permutation (FP) have been left
+ out. As for DES_encrypt1(), you should not use this function.
+ It is used by the routines in the library that implement triple DES.
+ IP() DES_encrypt2() DES_encrypt2() DES_encrypt2() FP() is the same
+ as DES_encrypt1() DES_encrypt1() DES_encrypt1() except faster :-). */
+void DES_encrypt2(DES_LONG *data,DES_key_schedule *ks, int enc);
+
+void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3);
+void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3);
+void DES_ede3_cbc_encrypt(const unsigned char *input,unsigned char *output,
+ long length,
+ DES_key_schedule *ks1,DES_key_schedule *ks2,
+ DES_key_schedule *ks3,DES_cblock *ivec,int enc);
+void DES_ede3_cbcm_encrypt(const unsigned char *in,unsigned char *out,
+ long length,
+ DES_key_schedule *ks1,DES_key_schedule *ks2,
+ DES_key_schedule *ks3,
+ DES_cblock *ivec1,DES_cblock *ivec2,
+ int enc);
+void DES_ede3_cfb64_encrypt(const unsigned char *in,unsigned char *out,
+ long length,DES_key_schedule *ks1,
+ DES_key_schedule *ks2,DES_key_schedule *ks3,
+ DES_cblock *ivec,int *num,int enc);
+void DES_ede3_cfb_encrypt(const unsigned char *in,unsigned char *out,
+ int numbits,long length,DES_key_schedule *ks1,
+ DES_key_schedule *ks2,DES_key_schedule *ks3,
+ DES_cblock *ivec,int enc);
+void DES_ede3_ofb64_encrypt(const unsigned char *in,unsigned char *out,
+ long length,DES_key_schedule *ks1,
+ DES_key_schedule *ks2,DES_key_schedule *ks3,
+ DES_cblock *ivec,int *num);
+#if 0
+void DES_xwhite_in2out(const_DES_cblock *DES_key,const_DES_cblock *in_white,
+ DES_cblock *out_white);
+#endif
+
+int DES_enc_read(int fd,void *buf,int len,DES_key_schedule *sched,
+ DES_cblock *iv);
+int DES_enc_write(int fd,const void *buf,int len,DES_key_schedule *sched,
+ DES_cblock *iv);
+char *DES_fcrypt(const char *buf,const char *salt, char *ret);
+char *DES_crypt(const char *buf,const char *salt);
+void DES_ofb_encrypt(const unsigned char *in,unsigned char *out,int numbits,
+ long length,DES_key_schedule *schedule,DES_cblock *ivec);
+void DES_pcbc_encrypt(const unsigned char *input,unsigned char *output,
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ int enc);
+DES_LONG DES_quad_cksum(const unsigned char *input,DES_cblock output[],
+ long length,int out_count,DES_cblock *seed);
+int DES_random_key(DES_cblock *ret);
+void DES_set_odd_parity(DES_cblock *key);
+int DES_check_key_parity(const_DES_cblock *key);
+int DES_is_weak_key(const_DES_cblock *key);
+/* DES_set_key (= set_key = DES_key_sched = key_sched) calls
+ * DES_set_key_checked if global variable DES_check_key is set,
+ * DES_set_key_unchecked otherwise. */
+int DES_set_key(const_DES_cblock *key,DES_key_schedule *schedule);
+int DES_key_sched(const_DES_cblock *key,DES_key_schedule *schedule);
+int DES_set_key_checked(const_DES_cblock *key,DES_key_schedule *schedule);
+void DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule);
+void DES_string_to_key(const char *str,DES_cblock *key);
+void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2);
+void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length,
+ DES_key_schedule *schedule,DES_cblock *ivec,int *num,
+ int enc);
+void DES_ofb64_encrypt(const unsigned char *in,unsigned char *out,long length,
+ DES_key_schedule *schedule,DES_cblock *ivec,int *num);
+
+int DES_read_password(DES_cblock *key, const char *prompt, int verify);
+int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2, const char *prompt,
+ int verify);
+
+#define DES_fixup_key_parity DES_set_odd_parity
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/net-snmp/library/openssl_md5.h b/include/net-snmp/library/openssl_md5.h
new file mode 100644
index 0000000..1e85f31
--- /dev/null
+++ b/include/net-snmp/library/openssl_md5.h
@@ -0,0 +1,116 @@
+/* crypto/md5/md5.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_MD5_H
+#define HEADER_MD5_H
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef OPENSSL_NO_MD5
+#error MD5 is disabled.
+#endif
+
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! MD5_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+#if defined(__LP32__)
+#define MD5_LONG unsigned long
+#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+#define MD5_LONG unsigned long
+#define MD5_LONG_LOG2 3
+/*
+ * _CRAY note. I could declare short, but I have no idea what impact
+ * does it have on performance on none-T3E machines. I could declare
+ * int, but at least on C90 sizeof(int) can be chosen at compile time.
+ * So I've chosen long...
+ * <appro@fy.chalmers.se>
+ */
+#else
+#define MD5_LONG unsigned int
+#endif
+
+#define MD5_CBLOCK 64
+#define MD5_LBLOCK (MD5_CBLOCK/4)
+#define MD5_DIGEST_LENGTH 16
+
+typedef struct MD5state_st
+ {
+ MD5_LONG A,B,C,D;
+ MD5_LONG Nl,Nh;
+ MD5_LONG data[MD5_LBLOCK];
+ unsigned int num;
+ } MD5_CTX;
+
+int MD5_Init(MD5_CTX *c);
+int MD5_Update(MD5_CTX *c, const void *data, size_t len);
+int MD5_Final(unsigned char *md, MD5_CTX *c);
+unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
+void MD5_Transform(MD5_CTX *c, const unsigned char *b);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/net-snmp/library/openssl_sha.h b/include/net-snmp/library/openssl_sha.h
new file mode 100644
index 0000000..ec2ff09
--- /dev/null
+++ b/include/net-snmp/library/openssl_sha.h
@@ -0,0 +1,199 @@
+/* crypto/sha/sha.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_SHA_H
+#define HEADER_SHA_H
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1))
+#error SHA is disabled.
+#endif
+
+#if defined(OPENSSL_FIPS)
+#define FIPS_SHA_SIZE_T size_t
+#endif
+
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! SHA_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+#if defined(__LP32__)
+#define SHA_LONG unsigned long
+#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+#define SHA_LONG unsigned long
+#define SHA_LONG_LOG2 3
+#else
+#define SHA_LONG unsigned int
+#endif
+
+#define SHA_LBLOCK 16
+#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a
+ * contiguous array of 32 bit
+ * wide big-endian values. */
+#define SHA_LAST_BLOCK (SHA_CBLOCK-8)
+#define SHA_DIGEST_LENGTH 20
+
+typedef struct SHAstate_st
+ {
+ SHA_LONG h0,h1,h2,h3,h4;
+ SHA_LONG Nl,Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num;
+ } SHA_CTX;
+
+#ifndef OPENSSL_NO_SHA0
+int SHA_Init(SHA_CTX *c);
+int SHA_Update(SHA_CTX *c, const void *data, size_t len);
+int SHA_Final(unsigned char *md, SHA_CTX *c);
+unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md);
+void SHA_Transform(SHA_CTX *c, const unsigned char *data);
+#endif
+#ifndef OPENSSL_NO_SHA1
+int SHA1_Init(SHA_CTX *c);
+int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
+int SHA1_Final(unsigned char *md, SHA_CTX *c);
+unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
+void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
+#endif
+
+#define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a
+ * contiguous array of 32 bit
+ * wide big-endian values. */
+#define SHA224_DIGEST_LENGTH 28
+#define SHA256_DIGEST_LENGTH 32
+
+typedef struct SHA256state_st
+ {
+ SHA_LONG h[8];
+ SHA_LONG Nl,Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num,md_len;
+ } SHA256_CTX;
+
+#ifndef OPENSSL_NO_SHA256
+int SHA224_Init(SHA256_CTX *c);
+int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
+int SHA224_Final(unsigned char *md, SHA256_CTX *c);
+unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md);
+int SHA256_Init(SHA256_CTX *c);
+int SHA256_Update(SHA256_CTX *c, const void *data, size_t len);
+int SHA256_Final(unsigned char *md, SHA256_CTX *c);
+unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md);
+void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
+#endif
+
+#define SHA384_DIGEST_LENGTH 48
+#define SHA512_DIGEST_LENGTH 64
+
+#ifndef OPENSSL_NO_SHA512
+/*
+ * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
+ * being exactly 64-bit wide. See Implementation Notes in sha512.c
+ * for further details.
+ */
+#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a
+ * contiguous array of 64 bit
+ * wide big-endian values. */
+#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
+#define SHA_LONG64 unsigned __int64
+#define U64(C) C##UI64
+#elif defined(__arch64__)
+#define SHA_LONG64 unsigned long
+#define U64(C) C##UL
+#else
+#define SHA_LONG64 unsigned long long
+#define U64(C) C##ULL
+#endif
+
+typedef struct SHA512state_st
+ {
+ SHA_LONG64 h[8];
+ SHA_LONG64 Nl,Nh;
+ union {
+ SHA_LONG64 d[SHA_LBLOCK];
+ unsigned char p[SHA512_CBLOCK];
+ } u;
+ unsigned int num,md_len;
+ } SHA512_CTX;
+#endif
+
+#ifndef OPENSSL_NO_SHA512
+int SHA384_Init(SHA512_CTX *c);
+int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
+int SHA384_Final(unsigned char *md, SHA512_CTX *c);
+unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md);
+int SHA512_Init(SHA512_CTX *c);
+int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
+int SHA512_Final(unsigned char *md, SHA512_CTX *c);
+unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md);
+void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/net-snmp/library/parse.h b/include/net-snmp/library/parse.h
new file mode 100644
index 0000000..ce46ab9
--- /dev/null
+++ b/include/net-snmp/library/parse.h
@@ -0,0 +1,250 @@
+#ifndef PARSE_H
+#define PARSE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/mib_api.h>
+
+ /*
+ * parse.h
+ */
+/***********************************************************
+ Copyright 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.
+******************************************************************/
+
+#define NETSNMP_MAXLABEL 64 /* maximum characters in a label */
+#define MAXTOKEN 128 /* maximum characters in a token */
+#define MAXQUOTESTR 4096 /* maximum characters in a quoted string */
+
+/*
+ * MAXLABEL appears to be unused in code, and conflicts with
+ * <arpa/nameser.h>. Only define it if requested. This will
+ * cause problems if local DNSSEC validation is also enabled.
+ */
+#ifdef UCD_COMPATIBLE
+#define MAXLABEL NETSNMP_MAXLABEL
+#endif
+
+ struct variable_list;
+
+ /*
+ * A linked list of tag-value pairs for enumerated integers.
+ */
+ struct enum_list {
+ struct enum_list *next;
+ int value;
+ char *label;
+ };
+
+ /*
+ * A linked list of ranges
+ */
+ struct range_list {
+ struct range_list *next;
+ int low, high;
+ };
+
+ /*
+ * A linked list of indexes
+ */
+ struct index_list {
+ struct index_list *next;
+ char *ilabel;
+ char isimplied;
+ };
+
+ /*
+ * A linked list of varbinds
+ */
+ struct varbind_list {
+ struct varbind_list *next;
+ char *vblabel;
+ };
+
+ /*
+ * A tree in the format of the tree structure of the MIB.
+ */
+ struct tree {
+ struct tree *child_list; /* list of children of this node */
+ struct tree *next_peer; /* Next node in list of peers */
+ struct tree *next; /* Next node in hashed list of names */
+ struct tree *parent;
+ char *label; /* This node's textual name */
+ u_long subid; /* This node's integer subidentifier */
+ int modid; /* The module containing this node */
+ int number_modules;
+ int *module_list; /* To handle multiple modules */
+ int tc_index; /* index into tclist (-1 if NA) */
+ int type; /* This node's object type */
+ int access; /* This nodes access */
+ int status; /* This nodes status */
+ struct enum_list *enums; /* (optional) list of enumerated integers */
+ struct range_list *ranges;
+ struct index_list *indexes;
+ char *augments;
+ struct varbind_list *varbinds;
+ char *hint;
+ char *units;
+ int (*printomat) (u_char **, size_t *, size_t *, int,
+ const netsnmp_variable_list *,
+ const struct enum_list *, const char *,
+ const char *);
+ void (*printer) (char *, const netsnmp_variable_list *, const struct enum_list *, const char *, const char *); /* Value printing function */
+ char *description; /* description (a quoted string) */
+ char *reference; /* references (a quoted string) */
+ int reported; /* 1=report started in print_subtree... */
+ char *defaultValue;
+ char *parseErrorString; /* Contains the error string if there are errors in parsing MIBs */
+ };
+
+ /*
+ * Information held about each MIB module
+ */
+ struct module_import {
+ char *label; /* The descriptor being imported */
+ int modid; /* The module imported from */
+ };
+
+ struct module {
+ char *name; /* This module's name */
+ char *file; /* The file containing the module */
+ struct module_import *imports; /* List of descriptors being imported */
+ int no_imports; /* The number of such import descriptors */
+ /*
+ * -1 implies the module hasn't been read in yet
+ */
+ int modid; /* The index number of this module */
+ struct module *next; /* Linked list pointer */
+ };
+
+ struct module_compatability {
+ const char *old_module;
+ const char *new_module;
+ const char *tag; /* NULL implies unconditional replacement,
+ * otherwise node identifier or prefix */
+ size_t tag_len; /* 0 implies exact match (or unconditional) */
+ struct module_compatability *next; /* linked list */
+ };
+
+
+ /*
+ * non-aggregate types for tree end nodes
+ */
+#define TYPE_OTHER 0
+#define TYPE_OBJID 1
+#define TYPE_OCTETSTR 2
+#define TYPE_INTEGER 3
+#define TYPE_NETADDR 4
+#define TYPE_IPADDR 5
+#define TYPE_COUNTER 6
+#define TYPE_GAUGE 7
+#define TYPE_TIMETICKS 8
+#define TYPE_OPAQUE 9
+#define TYPE_NULL 10
+#define TYPE_COUNTER64 11
+#define TYPE_BITSTRING 12
+#define TYPE_NSAPADDRESS 13
+#define TYPE_UINTEGER 14
+#define TYPE_UNSIGNED32 15
+#define TYPE_INTEGER32 16
+
+#define TYPE_SIMPLE_LAST 16
+
+#define TYPE_TRAPTYPE 20
+#define TYPE_NOTIFTYPE 21
+#define TYPE_OBJGROUP 22
+#define TYPE_NOTIFGROUP 23
+#define TYPE_MODID 24
+#define TYPE_AGENTCAP 25
+#define TYPE_MODCOMP 26
+#define TYPE_OBJIDENTITY 27
+
+#define MIB_ACCESS_READONLY 18
+#define MIB_ACCESS_READWRITE 19
+#define MIB_ACCESS_WRITEONLY 20
+#define MIB_ACCESS_NOACCESS 21
+#define MIB_ACCESS_NOTIFY 67
+#define MIB_ACCESS_CREATE 48
+
+#define MIB_STATUS_MANDATORY 23
+#define MIB_STATUS_OPTIONAL 24
+#define MIB_STATUS_OBSOLETE 25
+#define MIB_STATUS_DEPRECATED 39
+#define MIB_STATUS_CURRENT 57
+
+#define ANON "anonymous#"
+#define ANON_LEN strlen(ANON)
+
+ int netsnmp_unload_module(const char *name);
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+ int unload_module(const char *name);
+#endif
+ void netsnmp_init_mib_internals(void);
+ void unload_all_mibs(void);
+ int add_mibfile(const char*, const char*, FILE *);
+ int which_module(const char *);
+ NETSNMP_IMPORT
+ char *module_name(int, char *);
+ NETSNMP_IMPORT
+ void print_subtree(FILE *, struct tree *, int);
+ NETSNMP_IMPORT
+ void print_ascii_dump_tree(FILE *, struct tree *, int);
+ NETSNMP_IMPORT
+ struct tree *find_tree_node(const char *, int);
+ NETSNMP_IMPORT
+ const char *get_tc_descriptor(int);
+ NETSNMP_IMPORT
+ const char *get_tc_description(int);
+ NETSNMP_IMPORT
+ struct tree *find_best_tree_node(const char *, struct tree *,
+ u_int *);
+ /*
+ * backwards compatability
+ */
+ NETSNMP_IMPORT
+ struct tree *find_node(const char *, struct tree *);
+ struct tree *find_node2(const char *, const char *);
+ NETSNMP_IMPORT
+ struct module *find_module(int);
+ void adopt_orphans(void);
+ NETSNMP_IMPORT
+ char *snmp_mib_toggle_options(char *options);
+ NETSNMP_IMPORT
+ void snmp_mib_toggle_options_usage(const char *lead,
+ FILE * outf);
+ NETSNMP_IMPORT
+ void print_mib(FILE *);
+ NETSNMP_IMPORT
+ void print_mib_tree(FILE *, struct tree *, int);
+ int get_mib_parse_error_count(void);
+ NETSNMP_IMPORT
+ int snmp_get_token(FILE * fp, char *token, int maxtlen);
+ NETSNMP_IMPORT
+ struct tree *find_best_tree_node(const char *name,
+ struct tree *tree_top,
+ u_int * match);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* PARSE_H */
diff --git a/include/net-snmp/library/read_config.h b/include/net-snmp/library/read_config.h
new file mode 100644
index 0000000..5b1f7d0
--- /dev/null
+++ b/include/net-snmp/library/read_config.h
@@ -0,0 +1,156 @@
+/*
+ * read_config.h: reads configuration files for extensible sections.
+ *
+ */
+#ifndef READ_CONFIG_H
+#define READ_CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define STRINGMAX 1024
+
+#define NORMAL_CONFIG 0
+#define PREMIB_CONFIG 1
+#define EITHER_CONFIG 2
+
+#include <net-snmp/config_api.h>
+
+ /*
+ * Defines a set of file types and the parse and free functions
+ * which process the syntax following a given token in a given file.
+ */
+ struct config_files {
+ char *fileHeader; /* Label for entire file. */
+ struct config_line *start;
+ struct config_files *next;
+ };
+
+ struct config_line {
+ char *config_token; /* Label for each line parser
+ * in the given file. */
+ void (*parse_line) (const char *, char *);
+ void (*free_func) (void);
+ struct config_line *next;
+ char config_time; /* {NORMAL,PREMIB,EITHER}_CONFIG */
+ char *help;
+ };
+
+ struct read_config_memory {
+ char *line;
+ struct read_config_memory *next;
+ };
+
+
+ NETSNMP_IMPORT
+ int netsnmp_config(char *); /* parse a simple line: token=values */
+ NETSNMP_IMPORT
+ void netsnmp_config_remember(char *); /* process later, during snmp_init() */
+ void netsnmp_config_process_memories(void); /* run all memories through parser */
+ int read_config(const char *, struct config_line *, int);
+ int read_config_files(int);
+ NETSNMP_IMPORT
+ void free_config(void);
+#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2&& __GNUC_MINOR__ < 8)
+ NETSNMP_IMPORT
+ void netsnmp_config_error(const char *, ...);
+ void netsnmp_config_warn(const char *, ...);
+#else
+ NETSNMP_IMPORT
+ void netsnmp_config_error(const char *, ...)
+ __attribute__((__format__(__printf__, 1, 2)));
+ void netsnmp_config_warn(const char *, ...)
+ __attribute__((__format__(__printf__, 1, 2)));
+#endif
+
+ NETSNMP_IMPORT
+ char *skip_white(char *);
+ const char *skip_white_const(const char *);
+ NETSNMP_IMPORT
+ char *skip_not_white(char *);
+ const char *skip_not_white_const(const char *);
+ NETSNMP_IMPORT
+ char *skip_token(char *);
+ NETSNMP_IMPORT
+ const char *skip_token_const(const char *);
+ NETSNMP_IMPORT
+ char *copy_nword(char *, char *, int);
+ NETSNMP_IMPORT
+ const char *copy_nword_const(const char *, char *, int);
+ NETSNMP_IMPORT
+ char *copy_word(char *, char *); /* do not use */
+ NETSNMP_IMPORT
+ int read_config_with_type(const char *, const char *);
+ NETSNMP_IMPORT
+ char *read_config_save_octet_string(char *saveto,
+ u_char * str,
+ size_t len);
+ NETSNMP_IMPORT
+ char *read_config_read_octet_string(const char *readfrom,
+ u_char ** str,
+ size_t * len);
+ const char *read_config_read_octet_string_const(const char *readfrom,
+ u_char ** str,
+ size_t * len);
+ NETSNMP_IMPORT
+ char *read_config_read_objid(char *readfrom, oid ** objid,
+ size_t * len);
+ const char *read_config_read_objid_const(const char *readfrom,
+ oid ** objid,
+ size_t * len);
+ NETSNMP_IMPORT
+ char *read_config_save_objid(char *saveto, oid * objid,
+ size_t len);
+ NETSNMP_IMPORT
+ char *read_config_read_data(int type, char *readfrom,
+ void *dataptr, size_t * len);
+ NETSNMP_IMPORT
+ char *read_config_read_memory(int type, char *readfrom,
+ char *dataptr, size_t * len);
+ NETSNMP_IMPORT
+ char *read_config_store_data(int type, char *storeto,
+ void *dataptr, size_t * len);
+ char *read_config_store_data_prefix(char prefix, int type,
+ char *storeto,
+ void *dataptr, size_t len);
+ int read_config_files_of_type(int when, struct config_files *ctmp);
+ NETSNMP_IMPORT
+ void read_config_store(const char *type, const char *line);
+ NETSNMP_IMPORT
+ void read_app_config_store(const char *line);
+ NETSNMP_IMPORT
+ void snmp_save_persistent(const char *type);
+ NETSNMP_IMPORT
+ void snmp_clean_persistent(const char *type);
+ struct config_line *read_config_get_handlers(const char *type);
+
+ /*
+ * external memory list handlers
+ */
+ void snmp_config_remember_in_list(char *line,
+ struct read_config_memory
+ **mem);
+ void snmp_config_process_memory_list(struct
+ read_config_memory
+ **mem, int, int);
+ void snmp_config_remember_free_list(struct
+ read_config_memory
+ **mem);
+
+ void set_configuration_directory(const char *dir);
+ NETSNMP_IMPORT
+ const char *get_configuration_directory(void);
+ void set_persistent_directory(const char *dir);
+ const char *get_persistent_directory(void);
+ void set_temp_file_pattern(const char *pattern);
+ NETSNMP_IMPORT
+ const char *get_temp_file_pattern(void);
+ NETSNMP_IMPORT
+ void handle_long_opt(const char *myoptarg);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* READ_CONFIG_H */
diff --git a/include/net-snmp/library/scapi.h b/include/net-snmp/library/scapi.h
new file mode 100644
index 0000000..f4b63f5
--- /dev/null
+++ b/include/net-snmp/library/scapi.h
@@ -0,0 +1,107 @@
+/*
+ * scapi.h
+ */
+
+#ifndef _SCAPI_H
+#define _SCAPI_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * Authentication/privacy transform bitlengths.
+ */
+#define SNMP_TRANS_AUTHLEN_HMACMD5 128
+#define SNMP_TRANS_AUTHLEN_HMACSHA1 160
+
+#define SNMP_TRANS_AUTHLEN_HMAC96 96
+
+#define SNMP_TRANS_PRIVLEN_1DES 64
+#define SNMP_TRANS_PRIVLEN_1DES_IV 64
+
+#define SNMP_TRANS_PRIVLEN_AES 128
+#define SNMP_TRANS_PRIVLEN_AES_IV 128
+#define SNMP_TRANS_AES_PADSIZE 128 /* backwards compat */
+#define SNMP_TRANS_PRIVLEN_AES128 128 /* backwards compat */
+#define SNMP_TRANS_PRIVLEN_AES128_IV 128 /* backwards compat */
+#define SNMP_TRANS_AES_AES128_PADSIZE 128 /* backwards compat */
+
+ /*
+ * Prototypes.
+ */
+ int sc_get_properlength(const oid * hashtype,
+ u_int hashtype_len);
+ int sc_get_proper_priv_length(const oid * privtype,
+ u_int privtype_len);
+
+ NETSNMP_IMPORT
+ int sc_init(void);
+ int sc_shutdown(int majorID, int minorID, void *serverarg,
+ void *clientarg);
+
+ int sc_random(u_char * buf, size_t * buflen);
+
+ int sc_generate_keyed_hash(const oid * authtype,
+ size_t authtypelen,
+ const u_char * key, u_int keylen,
+ const u_char * message, u_int msglen,
+ u_char * MAC, size_t * maclen);
+
+ int sc_check_keyed_hash(const oid * authtype,
+ size_t authtypelen, const u_char * key,
+ u_int keylen, const u_char * message,
+ u_int msglen, const u_char * MAC,
+ u_int maclen);
+
+ int sc_encrypt(const oid * privtype, size_t privtypelen,
+ u_char * key, u_int keylen,
+ u_char * iv, u_int ivlen,
+ const u_char * plaintext, u_int ptlen,
+ u_char * ciphertext, size_t * ctlen);
+
+ int sc_decrypt(const oid * privtype, size_t privtypelen,
+ u_char * key, u_int keylen,
+ u_char * iv, u_int ivlen,
+ u_char * ciphertext, u_int ctlen,
+ u_char * plaintext, size_t * ptlen);
+
+ int sc_hash(const oid * hashtype, size_t hashtypelen,
+ const u_char * buf, size_t buf_len,
+ u_char * MAC, size_t * MAC_len);
+
+ int sc_get_transform_type(oid * hashtype,
+ u_int hashtype_len,
+ int (**hash_fn) (const int mode,
+ void **context,
+ const u_char *
+ data,
+ const int
+ data_len,
+ u_char **
+ digest,
+ size_t *
+ digest_len));
+
+
+ /*
+ * All functions devolve to the following block if we can't do cryptography
+ */
+#define _SCAPI_NOT_CONFIGURED \
+{ \
+ snmp_log(LOG_ERR, "Encryption support not enabled.\n"); \
+ DEBUGMSGTL(("scapi", "SCAPI not configured")); \
+ return SNMPERR_SC_NOT_CONFIGURED; \
+}
+
+ /*
+ * define a transform type if we're using the internal md5 support
+ */
+#ifdef NETSNMP_USE_INTERNAL_MD5
+#define INTERNAL_MD5 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _SCAPI_H */
diff --git a/include/net-snmp/library/snmp-tc.h b/include/net-snmp/library/snmp-tc.h
new file mode 100644
index 0000000..a355dd0
--- /dev/null
+++ b/include/net-snmp/library/snmp-tc.h
@@ -0,0 +1,66 @@
+#ifndef SNMP_TC_H
+#define SNMP_TC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /*
+ * snmp-tc.h: Provide some standard #defines for Textual Convention
+ * related value information
+ */
+
+ int
+ netsnmp_dateandtime_set_buf_from_vars(u_char *buf, size_t *bufsize,
+ u_short y, u_char mon, u_char d,
+ u_char h, u_char min, u_char s,
+ u_char deci_seconds,
+ int utc_offset_direction,
+ u_char utc_offset_hours,
+ u_char utc_offset_minutes);
+
+ NETSNMP_IMPORT
+ u_char *date_n_time(const time_t *, size_t *);
+ time_t ctime_to_timet(const char *);
+
+ /*
+ * TrueValue
+ */
+#define TV_TRUE 1
+#define TV_FALSE 2
+
+ /*
+ * RowStatus
+ */
+#define RS_NONEXISTENT 0
+#define RS_ACTIVE 1
+#define RS_NOTINSERVICE 2
+#define RS_NOTREADY 3
+#define RS_CREATEANDGO 4
+#define RS_CREATEANDWAIT 5
+#define RS_DESTROY 6
+
+#define RS_IS_GOING_ACTIVE( x ) ( x == RS_CREATEANDGO || x == RS_ACTIVE )
+#define RS_IS_ACTIVE( x ) ( x == RS_ACTIVE )
+#define RS_IS_NOT_ACTIVE( x ) ( ! RS_IS_GOING_ACTIVE(x) )
+
+ /*
+ * StorageType
+ */
+#define ST_NONE 0
+#define ST_OTHER 1
+#define ST_VOLATILE 2
+#define ST_NONVOLATILE 3
+#define ST_PERMANENT 4
+#define ST_READONLY 5
+
+ NETSNMP_IMPORT
+ char check_rowstatus_transition(int old_val, int new_val);
+ NETSNMP_IMPORT
+ char check_rowstatus_with_storagetype_transition(int old_val, int new_val, int old_storage);
+ NETSNMP_IMPORT
+ char check_storage_transition(int old_val, int new_val);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_TC_H */
diff --git a/include/net-snmp/library/snmp.h b/include/net-snmp/library/snmp.h
new file mode 100644
index 0000000..f5978c6
--- /dev/null
+++ b/include/net-snmp/library/snmp.h
@@ -0,0 +1,360 @@
+#ifndef SNMP_H
+#define SNMP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /*
+ * Definitions for the Simple Network Management Protocol (RFC 1067).
+ *
+ *
+ */
+/***********************************************************
+ 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.
+******************************************************************/
+
+
+#define SNMP_PORT 161 /* standard UDP port for SNMP agents
+ * to receive requests messages */
+#define SNMP_TRAP_PORT 162 /* standard UDP port for SNMP
+ * managers to receive notificaion
+ * (trap and inform) messages */
+
+#define SNMP_MAX_LEN 1500 /* typical maximum message size */
+#define SNMP_MIN_MAX_LEN 484 /* minimum maximum message size */
+
+ /*
+ * SNMP versions
+ */
+ /*
+ * There currently exists the following SNMP versions.
+ * * (Note that only SNMPv1 is in widespread usage, and this code supports
+ * * only SNMPv1, SNMPv2c, and SNMPv3.
+ * *
+ * * SNMPv1 - (full) the original version, defined by RFC 1157
+ * * SNMPsec - (historic) the first attempt to add strong security
+ * * to SNMPv1, defined by RFCs 1351, 1352, and 1353.
+ * * SNMPv2p - (historic) party-based SNMP, which was another
+ * * attempt to add strong security to SNMP, defined
+ * * by RFCs 1441, 1445, 1446, 1448, and 1449.
+ * * SNMPv2c - (experimental) community string-based SNMPv2,
+ * * which was an attempt to combine the protocol
+ * * operations of SNMPv2 with the security of
+ * * SNMPv1, defined by RFCs 1901, 1905, and 1906.
+ * * SNMPv2u - (experimental) user-based SNMPv2, which provided
+ * * security based on user names and protocol
+ * * operations of SNMPv2, defined by RFCs 1905,
+ * * 1909, and 1910.
+ * * SNMPv2* (or SNMPv2star) - (experimental) an attempt to add the
+ * * best features of SNMPv2p and SNMPv2u, defined
+ * * by unpublished documents found at WEB site
+ * * owned by SNMP Research (a leading SNMP vendor)
+ * * SNMPv3 - the current attempt by the IETF working group to merge
+ * * the SNMPv2u and SNMPv2* proposals into a more widly
+ * * accepted SNMPv3. It is defined by not yet published
+ * * documents of the IETF SNMPv3 WG.
+ * *
+ * * SNMPv1, SNMPv2c, SNMPv2u, and SNMPv3 messages have a common
+ * * form, which is an ASN.1 sequence containing a message version
+ * * field, followed by version dependent fields.
+ * * SNMPsec, SNMPv2p, and SNMPv2* messages have a common form,
+ * * which is a tagged ASN.1 context specific sequence containing
+ * * message dependent fields.
+ * *
+ * * In the #defines for the message versions below, the value
+ * * for SNMPv1, SNMPv2c, SNMPv2u, and SNMPv3 messages is the
+ * * value of the message version field. Since SNMPsec, SNMPv2p,
+ * * and SNMPv2* messages do not have a message version field,
+ * * the value in the defines for them is choosen to be a large
+ * * arbitrary number.
+ * *
+ * * Note that many of the version ID's are defined below purely for
+ * * documentational purposes. At this point the only protocol planned
+ * * for future implementations is SNMP3, as the other v2 protocols will
+ * * not be supported by the IETF (ie, v2u, v2sec, v2star) or used by
+ * * the snmp community at large (at the time of this writing).
+ */
+
+ /*
+ * versions based on version field
+ */
+#ifndef NETSNMP_DISABLE_SNMPV1
+#define SNMP_VERSION_1 0
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+#define SNMP_VERSION_2c 1
+#endif
+#define SNMP_VERSION_2u 2 /* not (will never be) supported by this code */
+#define SNMP_VERSION_3 3
+
+ /*
+ * versions not based on a version field
+ */
+#define SNMP_VERSION_sec 128 /* not (will never be) supported by this code */
+#define SNMP_VERSION_2p 129 /* no longer supported by this code (> 4.0) */
+#define SNMP_VERSION_2star 130 /* not (will never be) supported by this code */
+
+ /*
+ * PDU types in SNMPv1, SNMPsec, SNMPv2p, SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3
+ */
+#define SNMP_MSG_GET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) /* a0=160 */
+#define SNMP_MSG_GETNEXT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) /* a1=161 */
+#define SNMP_MSG_RESPONSE (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) /* a2=162 */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#define SNMP_MSG_SET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3) /* a3=163 */
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * PDU types in SNMPv1 and SNMPsec
+ */
+#define SNMP_MSG_TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4) /* a4=164 */
+
+ /*
+ * PDU types in SNMPv2p, SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3
+ */
+#define SNMP_MSG_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5) /* a5=165 */
+#define SNMP_MSG_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6) /* a6=166 */
+#define SNMP_MSG_TRAP2 (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7) /* a7=167 */
+
+ /*
+ * PDU types in SNMPv2u, SNMPv2*, and SNMPv3
+ */
+#define SNMP_MSG_REPORT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8) /* a8=168 */
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ /*
+ * internal modes that should never be used by the protocol for the
+ * pdu type.
+ *
+ * All modes < 128 are reserved for SET requests.
+ */
+#define SNMP_MSG_INTERNAL_SET_BEGIN -1
+#define SNMP_MSG_INTERNAL_SET_RESERVE1 0 /* these should match snmp.h */
+#define SNMP_MSG_INTERNAL_SET_RESERVE2 1
+#define SNMP_MSG_INTERNAL_SET_ACTION 2
+#define SNMP_MSG_INTERNAL_SET_COMMIT 3
+#define SNMP_MSG_INTERNAL_SET_FREE 4
+#define SNMP_MSG_INTERNAL_SET_UNDO 5
+#define SNMP_MSG_INTERNAL_SET_MAX 6
+
+#define SNMP_MSG_INTERNAL_CHECK_VALUE 17
+#define SNMP_MSG_INTERNAL_ROW_CREATE 18
+#define SNMP_MSG_INTERNAL_UNDO_SETUP 19
+#define SNMP_MSG_INTERNAL_SET_VALUE 20
+#define SNMP_MSG_INTERNAL_CHECK_CONSISTENCY 21
+#define SNMP_MSG_INTERNAL_UNDO_SET 22
+#define SNMP_MSG_INTERNAL_COMMIT 23
+#define SNMP_MSG_INTERNAL_UNDO_COMMIT 24
+#define SNMP_MSG_INTERNAL_IRREVERSIBLE_COMMIT 25
+#define SNMP_MSG_INTERNAL_UNDO_CLEANUP 26
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * modes > 128 for non sets.
+ * Note that 160-168 overlap with SNMP ASN1 pdu types
+ */
+#define SNMP_MSG_INTERNAL_PRE_REQUEST 128
+#define SNMP_MSG_INTERNAL_OBJECT_LOOKUP 129
+#define SNMP_MSG_INTERNAL_POST_REQUEST 130
+#define SNMP_MSG_INTERNAL_GET_STASH 131
+
+ /*
+ * test for member of Confirmed Class i.e., reportable
+ */
+#ifdef NETSNMP_NO_WRITE_SUPPORT
+#define SNMP_CMD_CONFIRMED(c) (c == SNMP_MSG_INFORM || c == SNMP_MSG_GETBULK ||\
+ c == SNMP_MSG_GETNEXT || c == SNMP_MSG_GET )
+#else /* !NETSNMP_NO_WRITE_SUPPORT */
+#define SNMP_CMD_CONFIRMED(c) (c == SNMP_MSG_INFORM || c == SNMP_MSG_GETBULK ||\
+ c == SNMP_MSG_GETNEXT || c == SNMP_MSG_GET || \
+ c == SNMP_MSG_SET )
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+ /*
+ * Exception values for SNMPv2p, SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3
+ */
+#define SNMP_NOSUCHOBJECT (ASN_CONTEXT | ASN_PRIMITIVE | 0x0) /* 80=128 */
+#define SNMP_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x1) /* 81=129 */
+#define SNMP_ENDOFMIBVIEW (ASN_CONTEXT | ASN_PRIMITIVE | 0x2) /* 82=130 */
+
+ /*
+ * Error codes (the value of the field error-status in PDUs)
+ */
+
+ /*
+ * in SNMPv1, SNMPsec, SNMPv2p, SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3 PDUs
+ */
+#define SNMP_ERR_NOERROR (0) /* XXX Used only for PDUs? */
+#define SNMP_ERR_TOOBIG (1)
+#define SNMP_ERR_NOSUCHNAME (2)
+#define SNMP_ERR_BADVALUE (3)
+#define SNMP_ERR_READONLY (4)
+#define SNMP_ERR_GENERR (5)
+
+ /*
+ * in SNMPv2p, SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3 PDUs
+ */
+#define SNMP_ERR_NOACCESS (6)
+#define SNMP_ERR_WRONGTYPE (7)
+#define SNMP_ERR_WRONGLENGTH (8)
+#define SNMP_ERR_WRONGENCODING (9)
+#define SNMP_ERR_WRONGVALUE (10)
+#define SNMP_ERR_NOCREATION (11)
+#define SNMP_ERR_INCONSISTENTVALUE (12)
+#define SNMP_ERR_RESOURCEUNAVAILABLE (13)
+#define SNMP_ERR_COMMITFAILED (14)
+#define SNMP_ERR_UNDOFAILED (15)
+#define SNMP_ERR_AUTHORIZATIONERROR (16)
+#define SNMP_ERR_NOTWRITABLE (17)
+
+ /*
+ * in SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3 PDUs
+ */
+#define SNMP_ERR_INCONSISTENTNAME (18)
+
+#define MAX_SNMP_ERR 18
+
+#define SNMP_VALIDATE_ERR(x) ( (x > MAX_SNMP_ERR) ? \
+ SNMP_ERR_GENERR : \
+ (x < SNMP_ERR_NOERROR) ? \
+ SNMP_ERR_GENERR : \
+ x )
+
+ /*
+ * values of the generic-trap field in trap PDUs
+ */
+#define SNMP_TRAP_COLDSTART (0)
+#define SNMP_TRAP_WARMSTART (1)
+#define SNMP_TRAP_LINKDOWN (2)
+#define SNMP_TRAP_LINKUP (3)
+#define SNMP_TRAP_AUTHFAIL (4)
+#define SNMP_TRAP_EGPNEIGHBORLOSS (5)
+#define SNMP_TRAP_ENTERPRISESPECIFIC (6)
+
+ /*
+ * row status values
+ */
+#define SNMP_ROW_NONEXISTENT 0
+#define SNMP_ROW_ACTIVE 1
+#define SNMP_ROW_NOTINSERVICE 2
+#define SNMP_ROW_NOTREADY 3
+#define SNMP_ROW_CREATEANDGO 4
+#define SNMP_ROW_CREATEANDWAIT 5
+#define SNMP_ROW_DESTROY 6
+
+ /*
+ * row storage values
+ */
+#define SNMP_STORAGE_NONE 0
+#define SNMP_STORAGE_OTHER 1
+#define SNMP_STORAGE_VOLATILE 2
+#define SNMP_STORAGE_NONVOLATILE 3
+#define SNMP_STORAGE_PERMANENT 4
+#define SNMP_STORAGE_READONLY 5
+
+ /*
+ * message processing models
+ */
+#define SNMP_MP_MODEL_SNMPv1 0
+#define SNMP_MP_MODEL_SNMPv2c 1
+#define SNMP_MP_MODEL_SNMPv2u 2
+#define SNMP_MP_MODEL_SNMPv3 3
+#define SNMP_MP_MODEL_SNMPv2p 256
+
+ /*
+ * security values
+ */
+#define SNMP_SEC_MODEL_ANY 0
+#define SNMP_SEC_MODEL_SNMPv1 1
+#define SNMP_SEC_MODEL_SNMPv2c 2
+#define SNMP_SEC_MODEL_USM 3
+#define SNMP_SEC_MODEL_TSM 4
+#define SNMP_SEC_MODEL_SNMPv2p 256
+
+#define SNMP_SEC_LEVEL_NOAUTH 1
+#define SNMP_SEC_LEVEL_AUTHNOPRIV 2
+#define SNMP_SEC_LEVEL_AUTHPRIV 3
+
+#define SNMP_MSG_FLAG_AUTH_BIT 0x01
+#define SNMP_MSG_FLAG_PRIV_BIT 0x02
+#define SNMP_MSG_FLAG_RPRT_BIT 0x04
+
+ /*
+ * control PDU handling characteristics
+ */
+#define UCD_MSG_FLAG_RESPONSE_PDU 0x100
+#define UCD_MSG_FLAG_EXPECT_RESPONSE 0x200
+#define UCD_MSG_FLAG_FORCE_PDU_COPY 0x400
+#define UCD_MSG_FLAG_ALWAYS_IN_VIEW 0x800
+#define UCD_MSG_FLAG_PDU_TIMEOUT 0x1000
+#define UCD_MSG_FLAG_ONE_PASS_ONLY 0x2000
+#define UCD_MSG_FLAG_TUNNELED 0x4000
+
+ /*
+ * view status
+ */
+#define SNMP_VIEW_INCLUDED 1
+#define SNMP_VIEW_EXCLUDED 2
+
+ /*
+ * basic oid values
+ */
+#define SNMP_OID_INTERNET 1, 3, 6, 1
+#define SNMP_OID_ENTERPRISES SNMP_OID_INTERNET, 4, 1
+#define SNMP_OID_MIB2 SNMP_OID_INTERNET, 2, 1
+#define SNMP_OID_SNMPV2 SNMP_OID_INTERNET, 6
+#define SNMP_OID_SNMPMODULES SNMP_OID_SNMPV2, 3
+
+ /*
+ * lengths as defined by TCs
+ */
+#define SNMPADMINLENGTH 255
+
+
+ NETSNMP_IMPORT
+ char *uptime_string(u_long, char *);
+ char *uptime_string_n(u_long, char *, size_t);
+ NETSNMP_IMPORT
+ void xdump(const void *, size_t, const char *);
+ NETSNMP_IMPORT
+ u_char *snmp_parse_var_op(u_char *, oid *, size_t *, u_char *,
+ size_t *, u_char **, size_t *);
+ NETSNMP_IMPORT
+ u_char *snmp_build_var_op(u_char *, oid *, size_t *, u_char,
+ size_t, u_char *, size_t *);
+
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ int snmp_realloc_rbuild_var_op(u_char ** pkt,
+ size_t * pkt_len,
+ size_t * offset,
+ int allow_realloc,
+ const oid * name,
+ size_t * name_len,
+ u_char value_type,
+ u_char * value,
+ size_t value_length);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_H */
diff --git a/include/net-snmp/library/snmpAAL5PVCDomain.h b/include/net-snmp/library/snmpAAL5PVCDomain.h
new file mode 100644
index 0000000..325109a
--- /dev/null
+++ b/include/net-snmp/library/snmpAAL5PVCDomain.h
@@ -0,0 +1,39 @@
+#ifndef _SNMPAAL5PVCDOMAIN_H
+#define _SNMPAAL5PVCDOMAIN_H
+
+#ifdef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifndef linux
+ config_error(AAL5 PVC support unavailable for this platform -Linux only-);
+#endif
+
+#include <atm.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/asn1.h>
+
+extern oid netsnmp_AAL5PVCDomain[]; /* = { NETSNMP_ENTERPRISE_MIB, 3, 3, 3 }; */
+
+netsnmp_transport *netsnmp_aal5pvc_transport(struct sockaddr_atmpvc *addr,
+ int local);
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+void netsnmp_aal5pvc_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*NETSNMP_TRANSPORT_AAL5PVC_DOMAIN */
+
+#endif/*_SNMPAAL5PVCDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpAliasDomain.h b/include/net-snmp/library/snmpAliasDomain.h
new file mode 100644
index 0000000..ccafcb5
--- /dev/null
+++ b/include/net-snmp/library/snmpAliasDomain.h
@@ -0,0 +1,32 @@
+#ifndef _SNMPALIASDOMAIN_H
+#define _SNMPALIASDOMAIN_H
+
+#ifdef NETSNMP_TRANSPORT_ALIAS_DOMAIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/asn1.h>
+
+/*
+ * Simple aliases for complex transport strings that can be specified
+ * via the snmp.conf file and the 'alias' token.
+ */
+
+#define TRANSPORT_DOMAIN_ALIAS_IP 1,3,6,1,2,1,100,1,5
+NETSNMP_IMPORT oid netsnmp_snmpALIASDomain[];
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+void netsnmp_alias_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*NETSNMP_TRANSPORT_ALIAS_DOMAIN */
+
+#endif/*_SNMPALIASDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpCallbackDomain.h b/include/net-snmp/library/snmpCallbackDomain.h
new file mode 100644
index 0000000..e1be70b
--- /dev/null
+++ b/include/net-snmp/library/snmpCallbackDomain.h
@@ -0,0 +1,73 @@
+#ifndef _SNMPCALLBACKDOMAIN_H
+#define _SNMPCALLBACKDOMAIN_H
+
+#ifndef NET_SNMP_CONFIG_H
+#error "Please include <netsnmp/net-snmp-config.h> before this file"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_transport.h>
+
+typedef struct netsnmp_callback_pass_s {
+ int return_transport_num;
+ netsnmp_pdu *pdu;
+ struct netsnmp_callback_pass_s *next;
+} netsnmp_callback_pass;
+
+typedef struct netsnmp_callback_info_s {
+ int linkedto;
+ void *parent_data;
+ netsnmp_callback_pass *data;
+ int callback_num;
+ int pipefds[2];
+} netsnmp_callback_info;
+
+netsnmp_transport *netsnmp_callback_transport(int);
+int netsnmp_callback_hook_parse(netsnmp_session * sp,
+ netsnmp_pdu *pdu,
+ u_char * packetptr,
+ size_t len);
+int netsnmp_callback_hook_build(netsnmp_session * sp,
+ netsnmp_pdu *pdu,
+ u_char * ptk, size_t * len);
+int netsnmp_callback_check_packet(u_char * pkt, size_t len);
+netsnmp_pdu *netsnmp_callback_create_pdu(netsnmp_transport *transport,
+ void *opaque, size_t olength);
+NETSNMP_IMPORT
+netsnmp_session *netsnmp_callback_open(int attach_to,
+ int (*return_func) (int op,
+ netsnmp_session
+ * session,
+ int reqid,
+ netsnmp_pdu
+ *pdu,
+ void *magic),
+ int (*fpre_parse) (netsnmp_session
+ *,
+ struct
+ netsnmp_transport_s
+ *, void *, int),
+ int (*fpost_parse) (netsnmp_session
+ *,
+ netsnmp_pdu *,
+ int));
+NETSNMP_IMPORT
+void netsnmp_clear_callback_list(void);
+
+#else
+
+#define netsnmp_clear_callback_list()
+
+
+#endif /*NETSNMP_TRANSPORT_CALLBACK_DOMAIN*/
+
+#ifdef __cplusplus
+}
+#endif
+#endif/*_SNMPCALLBACKDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpDTLSUDPDomain.h b/include/net-snmp/library/snmpDTLSUDPDomain.h
new file mode 100644
index 0000000..2135da3
--- /dev/null
+++ b/include/net-snmp/library/snmpDTLSUDPDomain.h
@@ -0,0 +1,41 @@
+#ifndef _SNMPDTLSUDPDOMAIN_H
+#define _SNMPDTLSUDPDOMAIN_H
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+config_require(UDP)
+config_require(TLSBase)
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_transport.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TRANSPORT_DOMAIN_DTLS_UDP_IP 1,3,6,1,6,1,9
+NETSNMP_IMPORT oid netsnmpDTLSUDPDomain[7];
+NETSNMP_IMPORT size_t netsnmpDTLSUDPDomain_len;
+
+netsnmp_transport *netsnmp_dtlsudp_transport(struct sockaddr_in *addr,
+ int local);
+
+
+/*
+ * Register any configuration tokens specific to the agent.
+ */
+
+void netsnmp_dtlsudp_agent_config_tokens_register(void);
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+void netsnmp_dtlsudp_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif/*_SNMPDTLSUDPDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpIPXDomain.h b/include/net-snmp/library/snmpIPXDomain.h
new file mode 100644
index 0000000..11c2beb
--- /dev/null
+++ b/include/net-snmp/library/snmpIPXDomain.h
@@ -0,0 +1,38 @@
+#ifndef _SNMPIPXDOMAIN_H
+#define _SNMPIPXDOMAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/asn1.h>
+#if HAVE_NETIPX_IPX_H
+#include <netipx/ipx.h>
+#endif
+
+#ifndef linux
+ config_error(IPX support unavailable for this platform -Linux only-);
+#endif
+
+netsnmp_transport *netsnmp_ipx_transport(struct sockaddr_ipx *addr, int local);
+
+/*
+ * Convert an textually formatted IPX address into a sockaddr_ipx
+ * structure which is written to *addr. Returns 1 if the conversion
+ * was successful, or 0 if it failed.
+ */
+
+int netsnmp_sockaddr_ipx(struct sockaddr_ipx *addr,
+ const char *peername);
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+void netsnmp_ipx_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif/*_SNMPIPXDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpIPv4BaseDomain.h b/include/net-snmp/library/snmpIPv4BaseDomain.h
new file mode 100644
index 0000000..7871dc4
--- /dev/null
+++ b/include/net-snmp/library/snmpIPv4BaseDomain.h
@@ -0,0 +1,37 @@
+/* IPV4 base transport support functions
+ */
+#ifndef SNMPIPV4BASE_H
+#define SNMPIPV4BASE_H
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Prototypes
+ */
+
+ char *netsnmp_ipv4_fmtaddr(const char *prefix, netsnmp_transport *t,
+ void *data, int len);
+
+/*
+ * Convert a "traditional" peername into a sockaddr_in structure which is
+ * written to *addr_ Returns 1 if the conversion was successful, or 0 if it
+ * failed
+ */
+
+ int netsnmp_sockaddr_in(struct sockaddr_in *addr, const char *peername,
+ int remote_port);
+ int netsnmp_sockaddr_in2(struct sockaddr_in *addr, const char *inpeername,
+ const char *default_target);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPIPV4BASE_H */
diff --git a/include/net-snmp/library/snmpIPv6BaseDomain.h b/include/net-snmp/library/snmpIPv6BaseDomain.h
new file mode 100644
index 0000000..545c8f0
--- /dev/null
+++ b/include/net-snmp/library/snmpIPv6BaseDomain.h
@@ -0,0 +1,34 @@
+/* IPV6 base transport support functions
+ */
+#ifndef SNMPIPV6BASE_H
+#define SNMPIPV6BASE_H
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Prototypes
+ */
+
+ NETSNMP_IMPORT
+ char *netsnmp_ipv6_fmtaddr(const char *prefix, netsnmp_transport *t,
+ void *data, int len);
+ NETSNMP_IMPORT
+ int netsnmp_sockaddr_in6_2(struct sockaddr_in6 *addr,
+ const char *inpeername,
+ const char *default_target);
+ int netsnmp_sockaddr_in6(struct sockaddr_in6 *addr,
+ const char *inpeername, int remote_port);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPIPV6BASE_H */
+
diff --git a/include/net-snmp/library/snmpSSHDomain.h b/include/net-snmp/library/snmpSSHDomain.h
new file mode 100644
index 0000000..2bd44e9
--- /dev/null
+++ b/include/net-snmp/library/snmpSSHDomain.h
@@ -0,0 +1,41 @@
+#ifndef _SNMPSSHDOMAIN_H
+#define _SNMPSSHDOMAIN_H
+
+config_require(IPv4Base)
+config_require(SocketBase)
+
+#ifdef NETSNMP_TRANSPORT_SSH_DOMAIN
+
+#include <net-snmp/library/snmp_transport.h>
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The SNMP over SSH over IPv4 transport domain is identified by
+ * transportDomainSshIpv4 as defined in RFC 3419.
+ */
+
+#define TRANSPORT_DOMAIN_SSH_IP 1,3,6,1,2,1,100,1,100
+NETSNMP_IMPORT const oid netsnmp_snmpSSHDomain[];
+enum { netsnmp_snmpSSHDomain_len = 9 };
+
+netsnmp_transport *netsnmp_ssh_transport(struct sockaddr_in *addr, int local);
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+void netsnmp_ssh_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*NETSNMP_TRANSPORT_SSH_DOMAIN */
+
+#endif/*_SNMPSSHDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpSTDDomain.h b/include/net-snmp/library/snmpSTDDomain.h
new file mode 100644
index 0000000..3e9a59f
--- /dev/null
+++ b/include/net-snmp/library/snmpSTDDomain.h
@@ -0,0 +1,41 @@
+#ifndef _SNMPSTDDOMAIN_H
+#define _SNMPSTDDOMAIN_H
+
+#ifdef NETSNMP_TRANSPORT_STD_DOMAIN
+
+#include <net-snmp/library/snmp_transport.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The SNMP over STD over IPv4 transport domain is identified by
+ * transportDomainStdIpv4 as defined in RFC 3419.
+ */
+
+#define TRANSPORT_DOMAIN_STD_IP 1,3,6,1,2,1,100,1,101
+extern oid netsnmp_snmpSTDDomain[];
+
+ typedef struct netsnmp_std_data_s {
+ int outfd;
+ int childpid;
+ char *prog;
+ } netsnmp_std_data;
+
+ netsnmp_transport *netsnmp_std_transport(const char *instring,
+ size_t instring_len,
+ const char *default_target);
+
+ /*
+ * "Constructor" for transport domain object.
+ */
+
+ void netsnmp_std_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*NETSNMP_TRANSPORT_STD_DOMAIN */
+
+#endif/*_SNMPSTDDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpSocketBaseDomain.h b/include/net-snmp/library/snmpSocketBaseDomain.h
new file mode 100644
index 0000000..71d86c8
--- /dev/null
+++ b/include/net-snmp/library/snmpSocketBaseDomain.h
@@ -0,0 +1,25 @@
+#ifndef SNMPSOCKETBASEDOMAIN_H
+#define SNMPSOCKETBASEDOMAIN_H
+
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Prototypes
+ */
+ int netsnmp_socketbase_close(netsnmp_transport *t);
+ int netsnmp_sock_buffer_set(int s, int optname, int local, int size);
+ int netsnmp_set_non_blocking_mode(int sock, int non_blocking_mode);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SNMPSOCKETBASEDOMAIN_H */
diff --git a/include/net-snmp/library/snmpTCPBaseDomain.h b/include/net-snmp/library/snmpTCPBaseDomain.h
new file mode 100644
index 0000000..9c81a90
--- /dev/null
+++ b/include/net-snmp/library/snmpTCPBaseDomain.h
@@ -0,0 +1,22 @@
+#ifndef SNMPTCPBASEDOMAIN_H
+#define SNMPTCPBASEDOMAIN_H
+
+#include <net-snmp/library/snmp_transport.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Prototypes
+ */
+ int netsnmp_tcpbase_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength);
+ int netsnmp_tcpbase_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SNMPTCPBASEDOMAIN_H */
diff --git a/include/net-snmp/library/snmpTCPDomain.h b/include/net-snmp/library/snmpTCPDomain.h
new file mode 100644
index 0000000..c45856b
--- /dev/null
+++ b/include/net-snmp/library/snmpTCPDomain.h
@@ -0,0 +1,41 @@
+#ifndef _SNMPTCPDOMAIN_H
+#define _SNMPTCPDOMAIN_H
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+config_require(IPv4Base)
+config_require(SocketBase)
+config_require(TCPBase)
+
+#ifdef NETSNMP_TRANSPORT_TCP_DOMAIN
+
+#include <net-snmp/library/snmpIPv4BaseDomain.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The SNMP over TCP over IPv4 transport domain is identified by
+ * transportDomainTcpIpv4 as defined in RFC 3419.
+ */
+
+#define TRANSPORT_DOMAIN_TCP_IP 1,3,6,1,2,1,100,1,5
+NETSNMP_IMPORT oid netsnmp_snmpTCPDomain[];
+
+netsnmp_transport *netsnmp_tcp_transport(struct sockaddr_in *addr, int local);
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+void netsnmp_tcp_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*NETSNMP_TRANSPORT_TCP_DOMAIN */
+
+#endif/*_SNMPTCPDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpTCPIPv6Domain.h b/include/net-snmp/library/snmpTCPIPv6Domain.h
new file mode 100644
index 0000000..3bca22b
--- /dev/null
+++ b/include/net-snmp/library/snmpTCPIPv6Domain.h
@@ -0,0 +1,38 @@
+#ifndef _SNMPTCPIPV6DOMAIN_H
+#define _SNMPTCPIPV6DOMAIN_H
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+config_require(IPv6Base)
+config_require(SocketBase)
+config_require(TCPBase)
+
+#include <net-snmp/library/snmpIPv6BaseDomain.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The SNMP over TCP over IPv6 transport domain is identified by
+ * transportDomainTcpIpv4 as defined in RFC 3419.
+ */
+
+#define TRANSPORT_DOMAIN_TCP_IPV6 1,3,6,1,2,1,100,1,6
+NETSNMP_IMPORT oid netsnmp_TCPIPv6Domain[];
+
+netsnmp_transport *netsnmp_tcp6_transport(struct sockaddr_in6 *addr,
+ int local);
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+NETSNMP_IMPORT void netsnmp_tcpipv6_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif/*_SNMPTCPIPV6DOMAIN_H*/
diff --git a/include/net-snmp/library/snmpTLSBaseDomain.h b/include/net-snmp/library/snmpTLSBaseDomain.h
new file mode 100644
index 0000000..bc21cb6
--- /dev/null
+++ b/include/net-snmp/library/snmpTLSBaseDomain.h
@@ -0,0 +1,83 @@
+#ifndef _SNMPTLSBASEDOMAIN_H
+#define _SNMPTLSBASEDOMAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/container.h>
+
+/* OpenSSL Includes */
+#include "openssl/bio.h"
+#include "openssl/ssl.h"
+#include "openssl/err.h"
+
+/*
+ * Prototypes
+ */
+
+ void netsnmp_tlsbase_ctor(void);
+ void netsnmp_init_tlsbase(void);
+ const char * _x509_get_error(int x509failvalue, const char *location);
+ void _openssl_log_error(int rc, SSL *con, const char *location);
+
+ /* will likely go away */
+ SSL_CTX *get_client_ctx(void);
+ SSL_CTX *get_server_ctx(void);
+
+#define NETSNMP_TLSBASE_IS_CLIENT 0x01
+#define NETSNMP_TLSBASE_CERT_FP_VERIFIED 0x02
+
+ /*
+ * _Internal_ structures
+ */
+ typedef struct _netsnmpTLSBaseData_s {
+ int flags;
+ SSL_CTX *ssl_context;
+ SSL *ssl;
+ BIO *sslbio;
+ BIO *accept_bio;
+ BIO *accepted_bio;
+ char *securityName;
+ char *addr_string;
+ netsnmp_indexed_addr_pair *addr;
+ char *our_identity;
+ char *their_identity;
+ char *their_fingerprint;
+ char *their_hostname;
+ char *trust_cert;
+ } _netsnmpTLSBaseData;
+
+#define VRFY_PARENT_WAS_OK 1
+ typedef struct _netsnmp_verify_info_s {
+ int flags;
+ } _netsnmp_verify_info;
+
+ SSL_CTX *sslctx_client_setup(const SSL_METHOD *,
+ _netsnmpTLSBaseData *tlsbase);
+ SSL_CTX *sslctx_server_setup(const SSL_METHOD *);
+
+ int netsnmp_tlsbase_verify_server_cert(SSL *ssl,
+ _netsnmpTLSBaseData *tlsdata);
+ int netsnmp_tlsbase_verify_client_cert(SSL *ssl,
+ _netsnmpTLSBaseData *tlsdata);
+ int netsnmp_tlsbase_extract_security_name(SSL *ssl, _netsnmpTLSBaseData *tlsdata);
+ _netsnmpTLSBaseData *netsnmp_tlsbase_allocate_tlsdata(netsnmp_transport *t,
+ int isserver);
+ int netsnmp_tlsbase_wrapup_recv(netsnmp_tmStateReference *tmStateRef,
+ _netsnmpTLSBaseData *tlsdata,
+ void **opaque, int *olength);
+ int netsnmp_tlsbase_config(struct netsnmp_transport_s *t,
+ const char *token, const char *value);
+
+ int netsnmp_tlsbase_session_init(struct netsnmp_transport_s *,
+ struct snmp_session *sess);
+ int tls_get_verify_info_index(void);
+
+ void netsnmp_tlsbase_free_tlsdata(_netsnmpTLSBaseData *tlsbase);
+#ifdef __cplusplus
+}
+#endif
+#endif/*_SNMPTLSBASEDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpTLSTCPDomain.h b/include/net-snmp/library/snmpTLSTCPDomain.h
new file mode 100644
index 0000000..4f27662
--- /dev/null
+++ b/include/net-snmp/library/snmpTLSTCPDomain.h
@@ -0,0 +1,39 @@
+#ifndef _SNMPTLSTCPDOMAIN_H
+#define _SNMPTLSTCPDOMAIN_H
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+config_require(IPv4Base)
+config_require(SocketBase)
+config_require(TLSBase)
+
+#include <net-snmp/library/snmpIPv4BaseDomain.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TRANSPORT_DOMAIN_TLS_TCP_IP 1,3,6,1,6,1,8
+NETSNMP_IMPORT oid netsnmpTLSTCPDomain[7];
+NETSNMP_IMPORT size_t netsnmpTLSTCPDomain_len;
+
+netsnmp_transport *netsnmp_tlstcp_transport(const char *addr_string, int local);
+
+/*
+ * Register any configuration tokens specific to the agent.
+ */
+
+void netsnmp_tlstcp_agent_config_tokens_register(void);
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+void netsnmp_tlstcp_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif/*_SNMPTLSTCPDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpUDPBaseDomain.h b/include/net-snmp/library/snmpUDPBaseDomain.h
new file mode 100644
index 0000000..3ce7320
--- /dev/null
+++ b/include/net-snmp/library/snmpUDPBaseDomain.h
@@ -0,0 +1,50 @@
+#ifndef SNMPUDPBASEDOMAIN_H
+#define SNMPUDPBASEDOMAIN_H
+
+config_require(SocketBase)
+
+#include <net-snmp/library/snmp_transport.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Definitions
+ */
+#ifdef MSG_DONTWAIT
+#define NETSNMP_DONTWAIT MSG_DONTWAIT
+#else
+#define NETSNMP_DONTWAIT 0
+#endif
+
+#ifdef MSG_NOSIGNAL
+#define NETSNMP_NOSIGNAL MSG_NOSIGNAL
+#else
+#define NETSNMP_NOSIGNAL 0
+#endif
+
+/*
+ * Prototypes
+ */
+ void _netsnmp_udp_sockopt_set(int fd, int local);
+ int netsnmp_udpbase_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength);
+ int netsnmp_udpbase_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength);
+
+#if defined(linux) && defined(IP_PKTINFO) \
+ || defined(IP_RECVDSTADDR) && !defined(_MSC_VER)
+ int netsnmp_udpbase_recvfrom(int s, void *buf, int len,
+ struct sockaddr *from, socklen_t *fromlen,
+ struct sockaddr *dstip, socklen_t *dstlen,
+ int *if_index);
+ int netsnmp_udpbase_sendto(int fd, struct in_addr *srcip, int if_index,
+ struct sockaddr *remote, void *data, int len);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SNMPUDPBASEDOMAIN_H */
diff --git a/include/net-snmp/library/snmpUDPDomain.h b/include/net-snmp/library/snmpUDPDomain.h
new file mode 100644
index 0000000..f030360
--- /dev/null
+++ b/include/net-snmp/library/snmpUDPDomain.h
@@ -0,0 +1,63 @@
+#ifndef _SNMPUDPDOMAIN_H
+#define _SNMPUDPDOMAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/asn1.h>
+
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+config_require(UDPIPv4Base)
+#include <net-snmp/library/snmpUDPIPv4BaseDomain.h>
+
+netsnmp_transport *netsnmp_udp_transport(struct sockaddr_in *addr, int local);
+
+
+/*
+ * Register any configuration tokens specific to the agent.
+ */
+
+NETSNMP_IMPORT
+void netsnmp_udp_agent_config_tokens_register(void);
+
+NETSNMP_IMPORT
+void netsnmp_udp_parse_security(const char *token, char *param);
+
+NETSNMP_IMPORT
+int netsnmp_udp_getSecName(void *opaque, int olength,
+ const char *community,
+ size_t community_len,
+ const char **secname,
+ const char **contextName);
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+void netsnmp_udp_ctor(void);
+
+/*
+ * protected-ish functions used by other core-code
+ */
+char *netsnmp_udp_fmtaddr(netsnmp_transport *t, void *data, int len);
+#if defined(linux) && defined(IP_PKTINFO) || \
+ defined(IP_RECVDSTADDR) && !defined(_MSC_VER)
+int netsnmp_udp_recvfrom(int s, void *buf, int len, struct sockaddr *from,
+ socklen_t *fromlen, struct sockaddr *dstip,
+ socklen_t *dstlen, int *if_index);
+int netsnmp_udp_sendto(int fd, struct in_addr *srcip, int if_index,
+ struct sockaddr *remote, void *data, int len);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif/*_SNMPUDPDOMAIN_H*/
diff --git a/include/net-snmp/library/snmpUDPIPv4BaseDomain.h b/include/net-snmp/library/snmpUDPIPv4BaseDomain.h
new file mode 100644
index 0000000..54f8a49
--- /dev/null
+++ b/include/net-snmp/library/snmpUDPIPv4BaseDomain.h
@@ -0,0 +1,44 @@
+/* UDPIPV4 base transport support functions
+ */
+#ifndef SNMPUDPIPV4BASE_H
+#define SNMPUDPIPV4BASE_H
+
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+config_require(UDPBase)
+config_require(IPv4Base)
+
+#include <net-snmp/library/snmpIPv4BaseDomain.h>
+#include <net-snmp/library/snmpUDPBaseDomain.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Prototypes
+ */
+
+ netsnmp_transport *netsnmp_udpipv4base_transport(struct sockaddr_in *addr,
+ int local);
+
+#if defined(linux) && defined(IP_PKTINFO) \
+ || defined(IP_RECVDSTADDR) && !defined(_MSC_VER)
+ int netsnmp_udpipv4_recvfrom(int s, void *buf, int len,
+ struct sockaddr *from, socklen_t *fromlen,
+ struct sockaddr *dstip, socklen_t *dstlen,
+ int *if_index);
+ int netsnmp_udpipv4_sendto(int fd, struct in_addr *srcip, int if_index,
+ struct sockaddr *remote, void *data, int len);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPUDPIPV4BASE_H */
diff --git a/include/net-snmp/library/snmpUDPIPv6Domain.h b/include/net-snmp/library/snmpUDPIPv6Domain.h
new file mode 100644
index 0000000..83eba2c
--- /dev/null
+++ b/include/net-snmp/library/snmpUDPIPv6Domain.h
@@ -0,0 +1,61 @@
+#ifndef _SNMPUDPIPV6DOMAIN_H
+#define _SNMPUDPIPV6DOMAIN_H
+
+#include <net-snmp/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+
+config_require(IPv6Base)
+config_require(UDPBase)
+
+#include <net-snmp/library/snmpIPv6BaseDomain.h>
+
+/*
+ * The SNMP over UDP over IPv6 transport domain is identified by
+ * transportDomainUdpIpv6 as defined in RFC 3419.
+ */
+
+#define TRANSPORT_DOMAIN_UDP_IPV6 1,3,6,1,2,1,100,1,2
+NETSNMP_IMPORT oid netsnmp_UDPIPv6Domain[];
+
+netsnmp_transport *netsnmp_udp6_transport(struct sockaddr_in6 *addr,
+ int local);
+
+
+/*
+ * Convert a "traditional" peername into a sockaddr_in6 structure which is
+ * written to *addr. Returns 1 if the conversion was successful, or 0 if it
+ * failed.
+ */
+
+int netsnmp_sockaddr_in6(struct sockaddr_in6 *addr,
+ const char *peername,
+ int remote_port);
+
+NETSNMP_IMPORT
+void netsnmp_udp6_agent_config_tokens_register(void);
+NETSNMP_IMPORT
+void netsnmp_udp6_parse_security(const char *token,
+ char *param);
+
+NETSNMP_IMPORT
+int netsnmp_udp6_getSecName(void *opaque, int olength,
+ const char *community,
+ int community_len,
+ const char **secname,
+ const char **contextName);
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+NETSNMP_IMPORT void netsnmp_udpipv6_ctor(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif/*_SNMPUDPIPV6DOMAIN_H*/
diff --git a/include/net-snmp/library/snmpUnixDomain.h b/include/net-snmp/library/snmpUnixDomain.h
new file mode 100644
index 0000000..91e7f63
--- /dev/null
+++ b/include/net-snmp/library/snmpUnixDomain.h
@@ -0,0 +1,65 @@
+#ifndef _SNMPUNIXDOMAIN_H
+#define _SNMPUNIXDOMAIN_H
+
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+
+#if defined(cygwin) || defined(mingw32) || defined(mingw32msvc)
+ config_error(Unix domain protocol support unavailable for this platform)
+#endif
+
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+
+config_require(SocketBase)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The SNMP over local socket transport domain is identified by
+ * transportDomainLocal as defined in RFC 3419.
+ */
+
+#define TRANSPORT_DOMAIN_LOCAL 1,3,6,1,2,1,100,1,13
+NETSNMP_IMPORT oid netsnmp_UnixDomain[];
+
+netsnmp_transport *netsnmp_unix_transport(struct sockaddr_un *addr,
+ int local);
+void netsnmp_unix_agent_config_tokens_register(void);
+void netsnmp_unix_parse_security(const char *token, char *param);
+int netsnmp_unix_getSecName(void *opaque, int olength,
+ const char *community,
+ size_t community_len, const char **secName,
+ const char **contextName);
+
+
+/*
+ * "Constructor" for transport domain object.
+ */
+
+void netsnmp_unix_ctor(void);
+
+/*
+ * Support functions
+ */
+void netsnmp_unix_create_path_with_mode(int mode);
+void netsnmp_unix_dont_create_path(void);
+
+#ifdef __cplusplus
+}
+#endif
+#else
+
+#define netsnmp_unix_create_path_with_mode(x)
+#define netsnmp_unix_dont_create_path()
+
+#endif /*NETSNMP_TRANSPORT_UNIX_DOMAIN */
+
+#endif/*_SNMPUNIXDOMAIN_H*/
diff --git a/include/net-snmp/library/snmp_alarm.h b/include/net-snmp/library/snmp_alarm.h
new file mode 100644
index 0000000..d1bcbfa
--- /dev/null
+++ b/include/net-snmp/library/snmp_alarm.h
@@ -0,0 +1,71 @@
+#ifndef SNMP_ALARM_H
+#define SNMP_ALARM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ typedef void (SNMPAlarmCallback) (unsigned int clientreg,
+ void *clientarg);
+
+ /*
+ * alarm flags
+ */
+#define SA_REPEAT 0x01 /* keep repeating every X seconds */
+#define SA_FIRED 0x10 /* Being processed in run_alarms */
+
+ struct snmp_alarm {
+ /** Alarm interval. Zero if single-shot. */
+ struct timeval t;
+ unsigned int flags;
+ unsigned int clientreg;
+ /** Last time the alarm fired [monotonic clock]. */
+ struct timeval t_lastM;
+ /** Next time the alarm will fire [monotonic clock]. */
+ struct timeval t_nextM;
+ void *clientarg;
+ SNMPAlarmCallback *thecallback;
+ struct snmp_alarm *next;
+ };
+
+ /*
+ * the ones you should need
+ */
+ NETSNMP_IMPORT
+ void snmp_alarm_unregister(unsigned int clientreg);
+ void snmp_alarm_unregister_all(void);
+ NETSNMP_IMPORT
+ unsigned int snmp_alarm_register(unsigned int when,
+ unsigned int flags,
+ SNMPAlarmCallback * thecallback,
+ void *clientarg);
+
+ unsigned int snmp_alarm_register_hr(struct timeval t,
+ unsigned int flags,
+ SNMPAlarmCallback * cb,
+ void *cd);
+ NETSNMP_IMPORT
+ int snmp_alarm_reset(unsigned int clientreg);
+
+
+ /*
+ * the ones you shouldn't
+ */
+ NETSNMP_IMPORT void init_snmp_alarm(void);
+ int init_alarm_post_config(int majorid, int minorid,
+ void *serverarg,
+ void *clientarg);
+ void sa_update_entry(struct snmp_alarm *alrm);
+ struct snmp_alarm *sa_find_next(void);
+ NETSNMP_IMPORT void run_alarms(void);
+ RETSIGTYPE alarm_handler(int a);
+ void set_an_alarm(void);
+ int netsnmp_get_next_alarm_time(struct timeval *alarm_tm,
+ const struct timeval *now);
+ int get_next_alarm_delay_time(struct timeval *delta);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_ALARM_H */
diff --git a/include/net-snmp/library/snmp_api.h b/include/net-snmp/library/snmp_api.h
new file mode 100644
index 0000000..6f658d5
--- /dev/null
+++ b/include/net-snmp/library/snmp_api.h
@@ -0,0 +1,713 @@
+/* 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.
+ */
+#ifndef SNMP_API_H
+#define SNMP_API_H
+
+/*
+ * @file snmp_api.h - API for access to snmp.
+ *
+ * @addtogroup library
+ *
+ * Caution: when using this library in a multi-threaded application,
+ * the values of global variables "snmp_errno" and "snmp_detail"
+ * cannot be reliably determined. Suggest using snmp_error()
+ * to obtain the library error codes.
+ *
+ * @{
+ */
+
+#include <net-snmp/types.h>
+#include <net-snmp/varbind_api.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/pdu_api.h>
+#include <net-snmp/session_api.h>
+
+#include <net-snmp/net-snmp-features.h>
+
+#ifndef DONT_SHARE_ERROR_WITH_OTHER_THREADS
+#define SET_SNMP_ERROR(x) snmp_errno=(x)
+#else
+#define SET_SNMP_ERROR(x)
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/***********************************************************
+ Copyright 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.
+******************************************************************/
+
+struct timeval;
+/*
+ * A list of all the outstanding requests for a particular session.
+ */
+#ifdef SNMP_NEED_REQUEST_LIST
+typedef struct request_list {
+ struct request_list *next_request;
+ long request_id; /* request id */
+ long message_id; /* message id */
+ netsnmp_callback callback; /* user callback per request (NULL if unused) */
+ void *cb_data; /* user callback data per request (NULL if unused) */
+ int retries; /* Number of retries */
+ u_long timeout; /* length to wait for timeout */
+ struct timeval timeM; /* Time this request was made [monotonic clock] */
+ struct timeval expireM; /* Time this request is due to expire [monotonic clock]. */
+ struct snmp_session *session;
+ netsnmp_pdu *pdu; /* The pdu for this request
+ * (saved so it can be retransmitted */
+} netsnmp_request_list;
+#endif /* SNMP_NEED_REQUEST_LIST */
+
+ /*
+ * Set fields in session and pdu to the following to get a default or unconfigured value.
+ */
+#define SNMP_DEFAULT_COMMUNITY_LEN 0 /* to get a default community name */
+#define SNMP_DEFAULT_RETRIES -1
+#define SNMP_DEFAULT_TIMEOUT -1
+#define SNMP_DEFAULT_REMPORT 0
+#define SNMP_DEFAULT_REQID -1
+#define SNMP_DEFAULT_MSGID -1
+#define SNMP_DEFAULT_ERRSTAT -1
+#define SNMP_DEFAULT_ERRINDEX -1
+#define SNMP_DEFAULT_ADDRESS 0
+#define SNMP_DEFAULT_PEERNAME NULL
+#define SNMP_DEFAULT_ENTERPRISE_LENGTH 0
+#define SNMP_DEFAULT_TIME 0
+#define SNMP_DEFAULT_VERSION -1
+#define SNMP_DEFAULT_SECMODEL -1
+#define SNMP_DEFAULT_CONTEXT ""
+#ifndef NETSNMP_DISABLE_MD5
+#define SNMP_DEFAULT_AUTH_PROTO usmHMACMD5AuthProtocol
+#else
+#define SNMP_DEFAULT_AUTH_PROTO usmHMACSHA1AuthProtocol
+#endif
+#define SNMP_DEFAULT_AUTH_PROTOLEN USM_LENGTH_OID_TRANSFORM
+#ifndef NETSNMP_DISABLE_DES
+#define SNMP_DEFAULT_PRIV_PROTO usmDESPrivProtocol
+#else
+#define SNMP_DEFAULT_PRIV_PROTO usmAESPrivProtocol
+#endif
+#define SNMP_DEFAULT_PRIV_PROTOLEN USM_LENGTH_OID_TRANSFORM
+
+ NETSNMP_IMPORT void snmp_set_detail(const char *);
+
+#define SNMP_MAX_MSG_SIZE 1472 /* ethernet MTU minus IP/UDP header */
+#define SNMP_MAX_MSG_V3_HDRS (4+3+4+7+7+3+7+16) /* fudge factor=16 */
+#define SNMP_MAX_ENG_SIZE 32
+#define SNMP_MAX_SEC_NAME_SIZE 256
+#define SNMP_MAX_CONTEXT_SIZE 256
+#define SNMP_SEC_PARAM_BUF_SIZE 256
+
+ /*
+ * set to one to ignore unauthenticated Reports
+ */
+#define SNMPV3_IGNORE_UNAUTH_REPORTS 0
+
+ /*
+ * authoritative engine definitions
+ */
+#define SNMP_SESS_NONAUTHORITATIVE 0 /* should be 0 to default to this */
+#define SNMP_SESS_AUTHORITATIVE 1 /* don't learn engineIDs */
+#define SNMP_SESS_UNKNOWNAUTH 2 /* sometimes (like NRs) */
+
+ /*
+ * to determine type of Report from varbind_list
+ */
+#define REPORT_STATS_LEN 9 /* Length of prefix for MPD/USM report statistic objects */
+#define REPORT_STATS_LEN2 8 /* Length of prefix for Target report statistic objects */
+/* From SNMP-MPD-MIB */
+#define REPORT_snmpUnknownSecurityModels_NUM 1
+#define REPORT_snmpInvalidMsgs_NUM 2
+#define REPORT_snmpUnknownPDUHandlers_NUM 3
+/* From SNMP-USER-BASED-SM-MIB */
+#define REPORT_usmStatsUnsupportedSecLevels_NUM 1
+#define REPORT_usmStatsNotInTimeWindows_NUM 2
+#define REPORT_usmStatsUnknownUserNames_NUM 3
+#define REPORT_usmStatsUnknownEngineIDs_NUM 4
+#define REPORT_usmStatsWrongDigests_NUM 5
+#define REPORT_usmStatsDecryptionErrors_NUM 6
+/* From SNMP-TARGET-MIB */
+#define REPORT_snmpUnavailableContexts_NUM 4
+#define REPORT_snmpUnknownContexts_NUM 5
+
+#define SNMP_DETAIL_SIZE 512
+
+#define SNMP_FLAGS_UDP_BROADCAST 0x800
+#define SNMP_FLAGS_RESP_CALLBACK 0x400 /* Additional callback on response */
+#define SNMP_FLAGS_USER_CREATED 0x200 /* USM user has been created */
+#define SNMP_FLAGS_DONT_PROBE 0x100 /* don't probe for an engineID */
+#define SNMP_FLAGS_STREAM_SOCKET 0x80
+#define SNMP_FLAGS_LISTENING 0x40 /* Server stream sockets only */
+#define SNMP_FLAGS_SUBSESSION 0x20
+#define SNMP_FLAGS_STRIKE2 0x02
+#define SNMP_FLAGS_STRIKE1 0x01
+
+#define CLEAR_SNMP_STRIKE_FLAGS(x) \
+ x &= ~(SNMP_FLAGS_STRIKE2|SNMP_FLAGS_STRIKE1)
+
+ /*
+ * returns '1' if the session is to be regarded as dead,
+ * otherwise set the strike flags appropriately, and return 0
+ */
+#define SET_SNMP_STRIKE_FLAGS(x) \
+ (( x & SNMP_FLAGS_STRIKE2 ) ? 1 : \
+ ((( x & SNMP_FLAGS_STRIKE1 ) ? ( x |= SNMP_FLAGS_STRIKE2 ) : \
+ ( x |= SNMP_FLAGS_STRIKE1 )), \
+ 0))
+
+ /*
+ * Error return values.
+ *
+ * SNMPERR_SUCCESS is the non-PDU "success" code.
+ *
+ * XXX These should be merged with SNMP_ERR_* defines and confined
+ * to values < 0. ???
+ */
+#define SNMPERR_SUCCESS (0) /* XXX Non-PDU "success" code. */
+#define SNMPERR_GENERR (-1)
+#define SNMPERR_BAD_LOCPORT (-2)
+#define SNMPERR_BAD_ADDRESS (-3)
+#define SNMPERR_BAD_SESSION (-4)
+#define SNMPERR_TOO_LONG (-5)
+#define SNMPERR_NO_SOCKET (-6)
+#define SNMPERR_V2_IN_V1 (-7)
+#define SNMPERR_V1_IN_V2 (-8)
+#define SNMPERR_BAD_REPEATERS (-9)
+#define SNMPERR_BAD_REPETITIONS (-10)
+#define SNMPERR_BAD_ASN1_BUILD (-11)
+#define SNMPERR_BAD_SENDTO (-12)
+#define SNMPERR_BAD_PARSE (-13)
+#define SNMPERR_BAD_VERSION (-14)
+#define SNMPERR_BAD_SRC_PARTY (-15)
+#define SNMPERR_BAD_DST_PARTY (-16)
+#define SNMPERR_BAD_CONTEXT (-17)
+#define SNMPERR_BAD_COMMUNITY (-18)
+#define SNMPERR_NOAUTH_DESPRIV (-19)
+#define SNMPERR_BAD_ACL (-20)
+#define SNMPERR_BAD_PARTY (-21)
+#define SNMPERR_ABORT (-22)
+#define SNMPERR_UNKNOWN_PDU (-23)
+#define SNMPERR_TIMEOUT (-24)
+#define SNMPERR_BAD_RECVFROM (-25)
+#define SNMPERR_BAD_ENG_ID (-26)
+#define SNMPERR_BAD_SEC_NAME (-27)
+#define SNMPERR_BAD_SEC_LEVEL (-28)
+#define SNMPERR_ASN_PARSE_ERR (-29)
+#define SNMPERR_UNKNOWN_SEC_MODEL (-30)
+#define SNMPERR_INVALID_MSG (-31)
+#define SNMPERR_UNKNOWN_ENG_ID (-32)
+#define SNMPERR_UNKNOWN_USER_NAME (-33)
+#define SNMPERR_UNSUPPORTED_SEC_LEVEL (-34)
+#define SNMPERR_AUTHENTICATION_FAILURE (-35)
+#define SNMPERR_NOT_IN_TIME_WINDOW (-36)
+#define SNMPERR_DECRYPTION_ERR (-37)
+#define SNMPERR_SC_GENERAL_FAILURE (-38)
+#define SNMPERR_SC_NOT_CONFIGURED (-39)
+#define SNMPERR_KT_NOT_AVAILABLE (-40)
+#define SNMPERR_UNKNOWN_REPORT (-41)
+#define SNMPERR_USM_GENERICERROR (-42)
+#define SNMPERR_USM_UNKNOWNSECURITYNAME (-43)
+#define SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL (-44)
+#define SNMPERR_USM_ENCRYPTIONERROR (-45)
+#define SNMPERR_USM_AUTHENTICATIONFAILURE (-46)
+#define SNMPERR_USM_PARSEERROR (-47)
+#define SNMPERR_USM_UNKNOWNENGINEID (-48)
+#define SNMPERR_USM_NOTINTIMEWINDOW (-49)
+#define SNMPERR_USM_DECRYPTIONERROR (-50)
+#define SNMPERR_NOMIB (-51)
+#define SNMPERR_RANGE (-52)
+#define SNMPERR_MAX_SUBID (-53)
+#define SNMPERR_BAD_SUBID (-54)
+#define SNMPERR_LONG_OID (-55)
+#define SNMPERR_BAD_NAME (-56)
+#define SNMPERR_VALUE (-57)
+#define SNMPERR_UNKNOWN_OBJID (-58)
+#define SNMPERR_NULL_PDU (-59)
+#define SNMPERR_NO_VARS (-60)
+#define SNMPERR_VAR_TYPE (-61)
+#define SNMPERR_MALLOC (-62)
+#define SNMPERR_KRB5 (-63)
+#define SNMPERR_PROTOCOL (-64)
+#define SNMPERR_OID_NONINCREASING (-65)
+#define SNMPERR_JUST_A_CONTEXT_PROBE (-66)
+#define SNMPERR_TRANSPORT_NO_CONFIG (-67)
+#define SNMPERR_TRANSPORT_CONFIG_ERROR (-68)
+#define SNMPERR_TLS_NO_CERTIFICATE (-69)
+
+#define SNMPERR_MAX (-69)
+
+
+ /*
+ * General purpose memory allocation functions. Use these functions to
+ * allocate memory that may be reallocated or freed by the Net-SNMP
+ * library or to reallocate or free memory that has been allocated by the
+ * Net-SNMP library, and when working in a context where there is more than
+ * one heap. Examples are:
+ * - Perl XSUB's.
+ * - MSVC or MinGW with the Net-SNMP library compiled as a DLL instead of
+ * a static library.
+ */
+ NETSNMP_IMPORT void *netsnmp_malloc(size_t size);
+ NETSNMP_IMPORT void *netsnmp_calloc(size_t nelem, size_t elsize);
+ NETSNMP_IMPORT void *netsnmp_realloc(void *ptr, size_t size);
+ NETSNMP_IMPORT void netsnmp_free(void *ptr);
+ NETSNMP_IMPORT char *netsnmp_strdup(const char *s1);
+
+ /*
+ * void
+ * snmp_free_pdu(pdu)
+ * netsnmp_pdu *pdu;
+ *
+ * Frees the pdu and any malloc'd data associated with it.
+ */
+
+ NETSNMP_IMPORT void snmp_free_var_internals(netsnmp_variable_list *); /* frees contents only */
+
+
+ /*
+ * This routine must be supplied by the application:
+ *
+ * u_char *authenticator(pdu, length, community, community_len)
+ * u_char *pdu; The rest of the PDU to be authenticated
+ * int *length; The length of the PDU (updated by the authenticator)
+ * u_char *community; The community name to authenticate under.
+ * int community_len The length of the community name.
+ *
+ * Returns the authenticated pdu, or NULL if authentication failed.
+ * If null authentication is used, the authenticator in snmp_session can be
+ * set to NULL(0).
+ */
+
+
+
+ /*
+ * This routine must be supplied by the application:
+ *
+ * int callback(operation, session, reqid, pdu, magic)
+ * int operation;
+ * netsnmp_session *session; The session authenticated under.
+ * int reqid; The request id of this pdu (0 for TRAP)
+ * netsnmp_pdu *pdu; The pdu information.
+ * void *magic A link to the data for this routine.
+ *
+ * Returns 1 if request was successful, 0 if it should be kept pending.
+ * Any data in the pdu must be copied because it will be freed elsewhere.
+ * Operations are defined below:
+ */
+
+#define NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE 1
+#define NETSNMP_CALLBACK_OP_TIMED_OUT 2
+#define NETSNMP_CALLBACK_OP_SEND_FAILED 3
+#define NETSNMP_CALLBACK_OP_CONNECT 4
+#define NETSNMP_CALLBACK_OP_DISCONNECT 5
+
+ long snmp_get_next_msgid(void);
+ long snmp_get_next_reqid(void);
+ NETSNMP_IMPORT
+ long snmp_get_next_sessid(void);
+ NETSNMP_IMPORT
+ long snmp_get_next_transid(void);
+
+ NETSNMP_IMPORT
+ int snmp_oid_compare(const oid *, size_t, const oid *,
+ size_t);
+ int snmp_oid_ncompare(const oid *, size_t, const oid *,
+ size_t, size_t);
+ NETSNMP_IMPORT
+ int snmp_oidtree_compare(const oid *, size_t, const oid *,
+ size_t);
+ NETSNMP_IMPORT
+ int snmp_oidsubtree_compare(const oid *, size_t, const oid *,
+ size_t);
+ NETSNMP_IMPORT
+ int netsnmp_oid_compare_ll(const oid * in_name1,
+ size_t len1, const oid * in_name2,
+ size_t len2, size_t *offpt);
+ NETSNMP_IMPORT
+ int netsnmp_oid_equals(const oid *, size_t, const oid *,
+ size_t);
+ int netsnmp_oid_tree_equals(const oid *, size_t, const oid *,
+ size_t);
+ NETSNMP_IMPORT
+ int netsnmp_oid_is_subtree(const oid *, size_t, const oid *,
+ size_t);
+ NETSNMP_IMPORT
+ int netsnmp_oid_find_prefix(const oid * in_name1, size_t len1,
+ const oid * in_name2, size_t len2);
+ NETSNMP_IMPORT
+ void init_snmp(const char *);
+ u_char *snmp_pdu_build(netsnmp_pdu *, u_char *, size_t *);
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ u_char *snmp_pdu_rbuild(netsnmp_pdu *, u_char *, size_t *);
+#endif
+ int snmpv3_parse(netsnmp_pdu *, u_char *, size_t *,
+ u_char **, netsnmp_session *);
+ int snmpv3_packet_build(netsnmp_session *,
+ netsnmp_pdu *pdu, u_char * packet,
+ size_t * out_length,
+ u_char * pdu_data,
+ size_t pdu_data_len);
+ int snmpv3_packet_rbuild(netsnmp_session *,
+ netsnmp_pdu *pdu, u_char * packet,
+ size_t * out_length,
+ u_char * pdu_data,
+ size_t pdu_data_len);
+ int snmpv3_make_report(netsnmp_pdu *pdu, int error);
+ int snmpv3_get_report_type(netsnmp_pdu *pdu);
+ int snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data,
+ size_t * length);
+ u_char *snmpv3_scopedPDU_parse(netsnmp_pdu *pdu, u_char * cp,
+ size_t * length);
+ NETSNMP_IMPORT
+ void snmp_store_needed(const char *type);
+ NETSNMP_IMPORT
+ void snmp_store_if_needed(void);
+ NETSNMP_IMPORT
+ void snmp_store(const char *type);
+ NETSNMP_IMPORT
+ void snmp_shutdown(const char *type);
+ NETSNMP_IMPORT
+ int snmp_add_var(netsnmp_pdu *, const oid *, size_t, char,
+ const char *);
+ NETSNMP_IMPORT
+ oid *snmp_duplicate_objid(const oid * objToCopy, size_t);
+ NETSNMP_IMPORT
+
+#ifndef NETSNMP_FEATURE_REMOVE_STATISTICS
+ u_int snmp_increment_statistic(int which);
+ NETSNMP_IMPORT
+ u_int snmp_increment_statistic_by(int which, int count);
+ NETSNMP_IMPORT
+ u_int snmp_get_statistic(int which);
+ void snmp_init_statistics(void);
+#else /* NETSNMP_FEATURE_REMOVE_STATISTICS */
+
+/* allow code to continue referencing API even if statistics are removed */
+#define snmp_increment_statistic(X)
+#define snmp_increment_statistic_by(X,Y)
+#define snmp_init_statistics()
+
+#endif
+
+ int create_user_from_session(netsnmp_session * session);
+ int snmpv3_probe_contextEngineID_rfc5343(void *slp,
+ netsnmp_session *session);
+
+ /*
+ * New re-allocating reverse encoding functions.
+ */
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+
+ int snmpv3_packet_realloc_rbuild(u_char ** pkt, size_t * pkt_len,
+ size_t * offset,
+ netsnmp_session * session,
+ netsnmp_pdu *pdu, u_char * pdu_data,
+ size_t pdu_data_len);
+
+ int snmp_pdu_realloc_rbuild(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, netsnmp_pdu *pdu);
+#endif
+
+
+
+struct netsnmp_transport_s;
+
+ /*
+ * Extended open; fpre_parse has changed.
+ */
+
+ NETSNMP_IMPORT
+ netsnmp_session *snmp_open_ex(netsnmp_session *,
+ int (*fpre_parse) (netsnmp_session *,
+ struct
+ netsnmp_transport_s *,
+ void *, int),
+ int (*fparse) (netsnmp_session *,
+ netsnmp_pdu *, u_char *,
+ size_t),
+ int (*fpost_parse) (netsnmp_session *,
+ netsnmp_pdu *, int),
+ int (*fbuild) (netsnmp_session *,
+ netsnmp_pdu *, u_char *,
+ size_t *),
+ int (*frbuild) (netsnmp_session *,
+ netsnmp_pdu *, u_char **,
+ size_t *, size_t *),
+ int (*fcheck) (u_char *, size_t));
+
+ /*
+ * provided for backwards compatability. Don't use these functions.
+ * See snmp_debug.h and snmp_debug.c instead.
+ */
+
+ NETSNMP_IMPORT
+ void snmp_set_do_debugging(int);
+ NETSNMP_IMPORT
+ int snmp_get_do_debugging(void);
+
+
+ NETSNMP_IMPORT
+ void netsnmp_sess_log_error(int priority,
+ const char *prog_string,
+ netsnmp_session * ss);
+ const char * snmp_pdu_type(int type);
+
+ /*
+ * Return the netsnmp_transport structure associated with the given opaque
+ * pointer.
+ */
+
+ NETSNMP_IMPORT
+ struct netsnmp_transport_s *snmp_sess_transport(void *);
+ void snmp_sess_transport_set(void *,
+ struct netsnmp_transport_s *);
+
+ NETSNMP_IMPORT int
+ netsnmp_sess_config_transport(struct netsnmp_container_s *transport_configuration,
+ struct netsnmp_transport_s *transport);
+
+ NETSNMP_IMPORT int
+ netsnmp_sess_config_and_open_transport(netsnmp_session *in_session,
+ struct netsnmp_transport_s *transport);
+
+ /*
+ * EXTENDED SESSION API ------------------------------------------
+ *
+ * snmp_sess_add_ex, snmp_sess_add, snmp_add
+ *
+ * Analogous to snmp_open family of functions, but taking an
+ * netsnmp_transport pointer as an extra argument. Unlike snmp_open et
+ * al. it doesn't attempt to interpret the in_session->peername as a
+ * transport endpoint specifier, but instead uses the supplied transport.
+ * JBPN
+ *
+ */
+
+ void *snmp_sess_add_ex(netsnmp_session *,
+ struct netsnmp_transport_s *,
+ int (*fpre_parse) (netsnmp_session *,
+ struct
+ netsnmp_transport_s
+ *, void *, int),
+ int (*fparse) (netsnmp_session *,
+ struct snmp_pdu *,
+ u_char *, size_t),
+ int (*fpost_parse) (netsnmp_session *,
+ struct snmp_pdu *,
+ int),
+ int (*fbuild) (netsnmp_session *,
+ struct snmp_pdu *,
+ u_char *, size_t *),
+ int (*frbuild) (netsnmp_session *,
+ struct snmp_pdu *,
+ u_char **, size_t *,
+ size_t *),
+ int (*fcheck) (u_char *, size_t),
+ netsnmp_pdu *(*fcreate_pdu) (struct
+ netsnmp_transport_s
+ *,
+ void *,
+ size_t));
+
+ void *snmp_sess_add(netsnmp_session *,
+ struct netsnmp_transport_s *,
+ int (*fpre_parse) (netsnmp_session *,
+ struct
+ netsnmp_transport_s *,
+ void *, int),
+ int (*fpost_parse) (netsnmp_session *,
+ netsnmp_pdu *, int));
+
+ NETSNMP_IMPORT
+ netsnmp_session *snmp_add(netsnmp_session *,
+ struct netsnmp_transport_s *,
+ int (*fpre_parse) (netsnmp_session *,
+ struct netsnmp_transport_s
+ *, void *, int),
+ int (*fpost_parse) (netsnmp_session *,
+ netsnmp_pdu *, int));
+ NETSNMP_IMPORT
+ netsnmp_session *snmp_add_full(netsnmp_session * in_session,
+ struct netsnmp_transport_s *transport,
+ int (*fpre_parse) (netsnmp_session *,
+ struct
+ netsnmp_transport_s
+ *, void *, int),
+ int (*fparse) (netsnmp_session *,
+ netsnmp_pdu *, u_char *,
+ size_t),
+ int (*fpost_parse) (netsnmp_session *,
+ netsnmp_pdu *, int),
+ int (*fbuild) (netsnmp_session *,
+ netsnmp_pdu *, u_char *,
+ size_t *),
+ int (*frbuild) (netsnmp_session *,
+ netsnmp_pdu *,
+ u_char **, size_t *,
+ size_t *),
+ int (*fcheck) (u_char *, size_t),
+ netsnmp_pdu *(*fcreate_pdu) (struct
+ netsnmp_transport_s
+ *, void *,
+ size_t)
+ );
+ /*
+ * end single session API
+ */
+
+ /*
+ * generic statistic counters
+ */
+
+ /*
+ * snmpv3 statistics
+ */
+
+ /*
+ * mpd stats
+ */
+#define STAT_SNMPUNKNOWNSECURITYMODELS 0
+#define STAT_SNMPINVALIDMSGS 1
+#define STAT_SNMPUNKNOWNPDUHANDLERS 2
+#define STAT_MPD_STATS_START STAT_SNMPUNKNOWNSECURITYMODELS
+#define STAT_MPD_STATS_END STAT_SNMPUNKNOWNPDUHANDLERS
+
+ /*
+ * usm stats
+ */
+#define STAT_USMSTATSUNSUPPORTEDSECLEVELS 3
+#define STAT_USMSTATSNOTINTIMEWINDOWS 4
+#define STAT_USMSTATSUNKNOWNUSERNAMES 5
+#define STAT_USMSTATSUNKNOWNENGINEIDS 6
+#define STAT_USMSTATSWRONGDIGESTS 7
+#define STAT_USMSTATSDECRYPTIONERRORS 8
+#define STAT_USM_STATS_START STAT_USMSTATSUNSUPPORTEDSECLEVELS
+#define STAT_USM_STATS_END STAT_USMSTATSDECRYPTIONERRORS
+
+ /*
+ * snmp counters
+ */
+#define STAT_SNMPINPKTS 9
+#define STAT_SNMPOUTPKTS 10
+#define STAT_SNMPINBADVERSIONS 11
+#define STAT_SNMPINBADCOMMUNITYNAMES 12
+#define STAT_SNMPINBADCOMMUNITYUSES 13
+#define STAT_SNMPINASNPARSEERRS 14
+ /*
+ * #define STAT_SNMPINBADTYPES 15
+ */
+#define STAT_SNMPINTOOBIGS 16
+#define STAT_SNMPINNOSUCHNAMES 17
+#define STAT_SNMPINBADVALUES 18
+#define STAT_SNMPINREADONLYS 19
+#define STAT_SNMPINGENERRS 20
+#define STAT_SNMPINTOTALREQVARS 21
+#define STAT_SNMPINTOTALSETVARS 22
+#define STAT_SNMPINGETREQUESTS 23
+#define STAT_SNMPINGETNEXTS 24
+#define STAT_SNMPINSETREQUESTS 25
+#define STAT_SNMPINGETRESPONSES 26
+#define STAT_SNMPINTRAPS 27
+#define STAT_SNMPOUTTOOBIGS 28
+#define STAT_SNMPOUTNOSUCHNAMES 29
+#define STAT_SNMPOUTBADVALUES 30
+ /*
+ * #define STAT_SNMPOUTREADONLYS 31
+ */
+#define STAT_SNMPOUTGENERRS 32
+#define STAT_SNMPOUTGETREQUESTS 33
+#define STAT_SNMPOUTGETNEXTS 34
+#define STAT_SNMPOUTSETREQUESTS 35
+#define STAT_SNMPOUTGETRESPONSES 36
+#define STAT_SNMPOUTTRAPS 37
+ /*
+ * AUTHTRAPENABLE 38
+ */
+#define STAT_SNMPSILENTDROPS 39
+#define STAT_SNMPPROXYDROPS 40
+#define STAT_SNMP_STATS_START STAT_SNMPINPKTS
+#define STAT_SNMP_STATS_END STAT_SNMPPROXYDROPS
+
+ /*
+ * target mib counters
+ */
+#define STAT_SNMPUNAVAILABLECONTEXTS 41
+#define STAT_SNMPUNKNOWNCONTEXTS 42
+#define STAT_TARGET_STATS_START STAT_SNMPUNAVAILABLECONTEXTS
+#define STAT_TARGET_STATS_END STAT_SNMPUNKNOWNCONTEXTS
+
+ /*
+ * TSM counters
+ */
+#define STAT_TSM_SNMPTSMINVALIDCACHES 43
+#define STAT_TSM_SNMPTSMINADEQUATESECURITYLEVELS 44
+#define STAT_TSM_SNMPTSMUNKNOWNPREFIXES 45
+#define STAT_TSM_SNMPTSMINVALIDPREFIXES 46
+#define STAT_TSM_STATS_START STAT_TSM_SNMPTSMINVALIDCACHES
+#define STAT_TSM_STATS_END STAT_TSM_SNMPTSMINVALIDPREFIXES
+
+ /*
+ * TLSTM counters
+ */
+#define STAT_TLSTM_SNMPTLSTMSESSIONOPENS 47
+#define STAT_TLSTM_SNMPTLSTMSESSIONCLIENTCLOSES 48
+#define STAT_TLSTM_SNMPTLSTMSESSIONOPENERRORS 49
+#define STAT_TLSTM_SNMPTLSTMSESSIONACCEPTS 50
+#define STAT_TLSTM_SNMPTLSTMSESSIONSERVERCLOSES 51
+#define STAT_TLSTM_SNMPTLSTMSESSIONNOSESSIONS 52
+#define STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCLIENTCERTIFICATES 53
+#define STAT_TLSTM_SNMPTLSTMSESSIONUNKNOWNSERVERCERTIFICATE 54
+#define STAT_TLSTM_SNMPTLSTMSESSIONINVALIDSERVERCERTIFICATES 55
+#define STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCACHES 56
+
+#define STAT_TLSTM_STATS_START STAT_TLSTM_SNMPTLSTMSESSIONOPENS
+#define STAT_TLSTM_STATS_END STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCACHES
+
+ /* this previously was end+1; don't know why the +1 is needed;
+ XXX: check the code */
+#define NETSNMP_STAT_MAX_STATS (STAT_TLSTM_STATS_END+1)
+/** backwards compatability */
+#define MAX_STATS NETSNMP_STAT_MAX_STATS
+
+ /*
+ * Internal: The list of active/open sessions.
+ */
+ struct session_list {
+ struct session_list *next;
+ netsnmp_session *session;
+ netsnmp_transport *transport;
+ struct snmp_internal_session *internal;
+ };
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_API_H */
diff --git a/include/net-snmp/library/snmp_assert.h b/include/net-snmp/library/snmp_assert.h
new file mode 100644
index 0000000..8f52a69
--- /dev/null
+++ b/include/net-snmp/library/snmp_assert.h
@@ -0,0 +1,127 @@
+#ifndef SNMP_ASSERT_H
+#define SNMP_ASSERT_H
+
+#ifdef NETSNMP_USE_ASSERT
+# include <assert.h>
+#else
+# include <net-snmp/library/snmp_logging.h>
+#endif
+
+
+/*
+ * MACROs don't need extern "C"
+ */
+
+/*
+ * define __STRING for systems (*cough* sun *cough*) that don't have it
+ */
+#ifndef __STRING
+# if defined(__STDC__) || defined(_MSC_VER)
+# define __STRING(x) #x
+# else
+# define __STRING(x) "x"
+# endif /* __STDC__ */
+#endif /* __STRING */
+
+/*
+ * always use assert if requested
+ */
+#ifdef NETSNMP_USE_ASSERT
+/* void netsnmp_assert( int );*/
+# define netsnmp_assert(x) assert( x )
+# define netsnmp_assert_or_return(x, y) assert( x )
+# define netsnmp_assert_or_msgreturn(x, y, z) assert( x )
+#else
+/*
+ * if asserts weren't requested, just log, unless NETSNMP_NO_DEBUGGING specified
+ */
+# ifndef NETSNMP_NO_DEBUGGING
+# ifdef NETSNMP_FUNCTION
+# define NETSNMP_FUNC_FMT " %s()\n"
+# define NETSNMP_FUNC_PARAM NETSNMP_FUNCTION
+# else
+# define NETSNMP_FUNC_FMT "%c"
+# define NETSNMP_FUNC_PARAM '\n'
+# endif
+#
+# define netsnmp_assert(x) do { \
+ if ( x ) \
+ ; \
+ else \
+ snmp_log(LOG_ERR, \
+ "netsnmp_assert %s failed %s:%d" NETSNMP_FUNC_FMT, \
+ __STRING(x),__FILE__,__LINE__, \
+ NETSNMP_FUNC_PARAM); \
+ }while(0)
+# define netsnmp_assert_or_return(x, y) do { \
+ if ( x ) \
+ ; \
+ else { \
+ snmp_log(LOG_ERR, \
+ "netsnmp_assert %s failed %s:%d" NETSNMP_FUNC_FMT, \
+ __STRING(x),__FILE__,__LINE__, \
+ NETSNMP_FUNC_PARAM); \
+ return y; \
+ } \
+ }while(0)
+# define netsnmp_assert_or_msgreturn(x, y, z) do { \
+ if ( x ) \
+ ; \
+ else { \
+ snmp_log(LOG_ERR, \
+ "netsnmp_assert %s failed %s:%d" NETSNMP_FUNC_FMT, \
+ __STRING(x),__FILE__,__LINE__, \
+ NETSNMP_FUNC_PARAM); \
+ snmp_log(LOG_ERR, y); \
+ return z; \
+ } \
+ }while(0)
+# else /* NO DEBUGGING */
+# define netsnmp_assert(x)
+# define netsnmp_assert_or_return(x, y) do { \
+ if ( x ) \
+ ; \
+ else { \
+ return y; \
+ } \
+ }while(0)
+# define netsnmp_assert_or_msgreturn(x, y, z) do { \
+ if ( x ) \
+ ; \
+ else { \
+ return z; \
+ } \
+ }while(0)
+# endif /* NO DEBUGGING */
+#endif /* not NETSNMP_USE_ASSERT */
+
+
+#define netsnmp_static_assert(x) \
+ do { switch(0) { case (x): case 0: ; } } while(0)
+
+
+/*
+ * EXPERIMENTAL macros. May be removed without warning in future
+ * releases. Use at your own risk
+ *
+ * The series of uppercase letters at or near the end of these macros give
+ * an indication of what they do. The letters used are:
+ *
+ * L : log a message
+ * RN : return NULL
+ * RE : return a specific hardcoded error appropriate for the condition
+ * RV : return user specified value
+ *
+ */
+#define netsnmp_malloc_check_LRN(ptr) \
+ netsnmp_assert_or_return( (ptr) != NULL, NULL)
+#define netsnmp_malloc_check_LRE(ptr) \
+ netsnmp_assert_or_return( (ptr) != NULL, SNMPERR_MALLOC)
+#define netsnmp_malloc_check_LRV(ptr, val) \
+ netsnmp_assert_or_return( (ptr) != NULL, val)
+
+#define netsnmp_require_ptr_LRV( ptr, val ) \
+ netsnmp_assert_or_return( (ptr) != NULL, val)
+
+
+#endif /* SNMP_ASSERT_H */
diff --git a/include/net-snmp/library/snmp_client.h b/include/net-snmp/library/snmp_client.h
new file mode 100644
index 0000000..ea54e7d
--- /dev/null
+++ b/include/net-snmp/library/snmp_client.h
@@ -0,0 +1,167 @@
+/*
+ * snmp_client.h
+ */
+/***********************************************************
+ 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.
+******************************************************************/
+
+#ifndef SNMP_CLIENT_H
+#define SNMP_CLIENT_H
+
+#include <net-snmp/types.h>
+#include <net-snmp/varbind_api.h>
+#include <net-snmp/pdu_api.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/session_api.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ struct snmp_pdu;
+ struct snmp_session;
+ struct variable_list;
+
+ struct synch_state {
+ int waiting;
+ int status;
+ /*
+ * status codes
+ */
+#define STAT_SUCCESS 0
+#define STAT_ERROR 1
+#define STAT_TIMEOUT 2
+ int reqid;
+ netsnmp_pdu *pdu;
+ };
+
+ NETSNMP_IMPORT
+ void snmp_replace_var_types(netsnmp_variable_list * vbl,
+ u_char old_type,
+ u_char new_type);
+ NETSNMP_IMPORT
+ void snmp_reset_var_buffers(netsnmp_variable_list * var);
+ void snmp_reset_var_types(netsnmp_variable_list * vbl,
+ u_char new_type);
+ NETSNMP_IMPORT
+ int count_varbinds(netsnmp_variable_list * var_ptr);
+ NETSNMP_IMPORT
+ int count_varbinds_of_type(netsnmp_variable_list * var_ptr,
+ u_char type);
+ netsnmp_variable_list *find_varbind_of_type(netsnmp_variable_list *
+ var_ptr, u_char type);
+ NETSNMP_IMPORT
+ netsnmp_variable_list *find_varbind_in_list(netsnmp_variable_list *vblist,
+ const oid *name, size_t len);
+
+ netsnmp_pdu *snmp_split_pdu(netsnmp_pdu *, int skipCount,
+ int copyCount);
+
+ unsigned long snmp_varbind_len(netsnmp_pdu *pdu);
+ NETSNMP_IMPORT
+ int snmp_clone_var(netsnmp_variable_list *,
+ netsnmp_variable_list *);
+ NETSNMP_IMPORT
+ int snmp_synch_response_cb(netsnmp_session *,
+ netsnmp_pdu *, netsnmp_pdu **,
+ snmp_callback);
+ NETSNMP_IMPORT
+ int snmp_clone_mem(void **, const void *, unsigned);
+
+
+NETSNMP_IMPORT
+void netsnmp_query_set_default_session(netsnmp_session *);
+NETSNMP_IMPORT
+netsnmp_session * netsnmp_query_get_default_session_unchecked( void );
+NETSNMP_IMPORT
+netsnmp_session * netsnmp_query_get_default_session( void );
+NETSNMP_IMPORT
+int netsnmp_query_get( netsnmp_variable_list *, netsnmp_session *);
+NETSNMP_IMPORT
+int netsnmp_query_getnext( netsnmp_variable_list *, netsnmp_session *);
+NETSNMP_IMPORT
+int netsnmp_query_walk( netsnmp_variable_list *, netsnmp_session *);
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+NETSNMP_IMPORT
+int netsnmp_query_set( netsnmp_variable_list *, netsnmp_session *);
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/** **************************************************************************
+ *
+ * state machine
+ *
+ */
+ /** forward declare */
+ struct netsnmp_state_machine_step_s;
+ struct netsnmp_state_machine_input_s;
+
+ /** state machine process */
+ typedef int (netsnmp_state_machine_func)(struct netsnmp_state_machine_input_s *input,
+ struct netsnmp_state_machine_step_s *step);
+
+ typedef struct netsnmp_state_machine_step_s {
+
+ const char *name; /* primarily for logging/debugging */
+ u_int sm_flags;
+
+ netsnmp_state_machine_func *run;
+ int result; /* return code for this step */
+
+
+ struct netsnmp_state_machine_step_s *on_success;
+ struct netsnmp_state_machine_step_s *on_error;
+
+ /*
+ * user fields (not touched by state machine functions)
+ */
+ u_int flags;
+ void *step_context;
+
+ } netsnmp_state_machine_step;
+
+ typedef struct netsnmp_state_machine_input_s {
+ const char *name;
+ int steps_so_far;
+ netsnmp_state_machine_step *steps;
+ netsnmp_state_machine_step *cleanup;
+ netsnmp_state_machine_step *last_run;
+
+ /*
+ * user fields (not touched by state machine functions)
+ */
+ void *input_context;
+
+ } netsnmp_state_machine_input;
+
+
+ NETSNMP_IMPORT int
+ netsnmp_state_machine_run( netsnmp_state_machine_input *input );
+
+ NETSNMP_IMPORT int
+ netsnmp_row_create(netsnmp_session *sess, netsnmp_variable_list *vars,
+ int row_status_index);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_CLIENT_H */
diff --git a/include/net-snmp/library/snmp_debug.h b/include/net-snmp/library/snmp_debug.h
new file mode 100644
index 0000000..a3969f6
--- /dev/null
+++ b/include/net-snmp/library/snmp_debug.h
@@ -0,0 +1,243 @@
+#ifndef SNMP_DEBUG_H
+#define SNMP_DEBUG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * snmp_debug.h:
+ *
+ * - prototypes for snmp debugging routines.
+ * - easy to use macros to wrap around the functions. This also provides
+ * the ability to remove debugging code easily from the applications at
+ * compile time.
+ */
+
+
+#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#define NETSNMP_ATTRIBUTE_FORMAT(type, formatArg, firstArg)
+#else
+#define NETSNMP_ATTRIBUTE_FORMAT(type, formatArg, firstArg) \
+ __attribute__((__format__( __ ## type ## __, formatArg, firstArg )))
+#endif
+
+ /*
+ * These functions should not be used, if at all possible. Instead, use
+ * the macros below.
+ */
+ NETSNMP_IMPORT
+ void debugmsg(const char *token, const char *format, ...)
+ NETSNMP_ATTRIBUTE_FORMAT(printf, 2, 3);
+ NETSNMP_IMPORT
+ void debugmsgtoken(const char *token, const char *format,
+ ...)
+ NETSNMP_ATTRIBUTE_FORMAT(printf, 2, 3);
+ void debug_combo_nc(const char *token, const char *format,
+ ...)
+ NETSNMP_ATTRIBUTE_FORMAT(printf, 2, 3);
+
+#undef NETSNMP_ATTRIBUTE_FORMAT
+
+ NETSNMP_IMPORT
+ void debugmsg_oid(const char *token, const oid * theoid,
+ size_t len);
+ NETSNMP_IMPORT
+ void debugmsg_suboid(const char *token, const oid * theoid,
+ size_t len);
+ NETSNMP_IMPORT
+ void debugmsg_var(const char *token,
+ netsnmp_variable_list * var);
+ NETSNMP_IMPORT
+ void debugmsg_oidrange(const char *token,
+ const oid * theoid, size_t len,
+ size_t var_subid, oid range_ubound);
+ NETSNMP_IMPORT
+ void debugmsg_hex(const char *token, const u_char * thedata,
+ size_t len);
+ NETSNMP_IMPORT
+ void debugmsg_hextli(const char *token, const u_char * thedata,
+ size_t len);
+ NETSNMP_IMPORT
+ void debug_indent_add(int amount);
+ NETSNMP_IMPORT
+ int debug_indent_get(void);
+ /*
+ * What is said above is true for this function as well. Further this
+ * function is deprecated and only provided for backwards compatibility.
+ * Please use "%*s", debug_indent_get(), "" if you used this one before.
+ */
+ NETSNMP_IMPORT
+ const char *debug_indent(void);
+
+ /*
+ * Use these macros instead of the functions above to allow them to be
+ * re-defined at compile time to NOP for speed optimization.
+ *
+ * They need to be called enclosing all the arguments in a single set of ()s.
+ * Example:
+ * DEBUGMSGTL(("token", "debugging of something %s related\n", "snmp"));
+ *
+ * Usage:
+ * All of the functions take a "token" argument that helps determine when
+ * the output in question should be printed. See the snmpcmd.1 manual page
+ * on the -D flag to turn on/off output for a given token on the command line.
+ *
+ * DEBUGMSG((token, format, ...)): equivalent to printf(format, ...)
+ * (if "token" debugging output
+ * is requested by the user)
+ *
+ * DEBUGMSGT((token, format, ...)): equivalent to DEBUGMSG, but prints
+ * "token: " at the beginning of the
+ * line for you.
+ *
+ * DEBUGTRACE Insert this token anywhere you want
+ * tracing output displayed when the
+ * "trace" debugging token is selected.
+ *
+ * DEBUGMSGL((token, format, ...)): equivalent to DEBUGMSG, but includes
+ * DEBUGTRACE debugging line just before
+ * yours.
+ *
+ * DEBUGMSGTL((token, format, ...)): Same as DEBUGMSGL and DEBUGMSGT
+ * combined.
+ *
+ * Important:
+ * It is considered best if you use DEBUGMSGTL() everywhere possible, as it
+ * gives the nicest format output and provides tracing support just before
+ * every debugging statement output.
+ *
+ * To print multiple pieces to a single line in one call, use:
+ *
+ * DEBUGMSGTL(("token", "line part 1"));
+ * DEBUGMSG (("token", " and part 2\n"));
+ *
+ * to get:
+ *
+ * token: line part 1 and part 2
+ *
+ * as debugging output.
+ *
+ *
+ * Each of these macros also have a version with a suffix of '_NC'. The
+ * NC suffix stands for 'No Check', which means that no check will be
+ * performed to see if debug is enabled or if the token has been turned
+ * on. These NC versions are intended for use within a DEBUG_IF {} block,
+ * where the debug/token check has already been performed.
+ */
+
+#ifndef NETSNMP_NO_DEBUGGING /* make sure we're wanted */
+
+ /*
+ * define two macros : one macro with, one without,
+ * a test if debugging is enabled.
+ *
+ * Generally, use the macro with _DBG_IF_
+ */
+
+/******************* Start private macros ************************/
+#define _DBG_IF_ snmp_get_do_debugging()
+#define DEBUGIF(x) if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
+
+#define __DBGMSGT(x) debugmsgtoken x, debugmsg x
+#define __DBGMSG_NC(x) debugmsg x
+#define __DBGMSGT_NC(x) debug_combo_nc x
+#define __DBGMSGL_NC(x) __DBGTRACE; debugmsg x
+#define __DBGMSGTL_NC(x) __DBGTRACE; debug_combo_nc x
+
+#ifdef NETSNMP_FUNCTION
+#define __DBGTRACE __DBGMSGT(("trace","%s(): %s, %d:\n",\
+ NETSNMP_FUNCTION,__FILE__,__LINE__))
+#define __DBGTRACETOK(x) __DBGMSGT((x,"%s(): %s, %d:\n", \
+ NETSNMP_FUNCTION,__FILE__,__LINE__))
+#else
+#define __DBGTRACE __DBGMSGT(("trace"," %s, %d:\n", __FILE__,__LINE__))
+#define __DBGTRACETOK(x) __DBGMSGT((x," %s, %d:\n", __FILE__,__LINE__))
+#endif
+
+#define __DBGMSGL(x) __DBGTRACE, debugmsg x
+#define __DBGMSGTL(x) __DBGTRACE, debugmsgtoken x, debugmsg x
+#define __DBGMSGOID(x) debugmsg_oid x
+#define __DBGMSGSUBOID(x) debugmsg_suboid x
+#define __DBGMSGVAR(x) debugmsg_var x
+#define __DBGMSGOIDRANGE(x) debugmsg_oidrange x
+#define __DBGMSGHEX(x) debugmsg_hex x
+#define __DBGMSGHEXTLI(x) debugmsg_hextli x
+#define __DBGINDENT() debug_indent_get()
+#define __DBGINDENTADD(x) debug_indent_add(x)
+#define __DBGINDENTMORE() debug_indent_add(2)
+#define __DBGINDENTLESS() debug_indent_add(-2)
+#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
+
+#define __DBGDUMPHEADER(token,x) \
+ __DBGPRINTINDENT("dumph_" token); \
+ debugmsg("dumph_" token,x); \
+ if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS || \
+ debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
+ (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS && \
+ debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
+ debugmsg("dumph_" token,"\n"); \
+ } else { \
+ debugmsg("dumph_" token," "); \
+ } \
+ __DBGINDENTMORE()
+
+#define __DBGDUMPSECTION(token,x) \
+ __DBGPRINTINDENT("dumph_" token); \
+ debugmsg("dumph_" token,"%s\n",x);\
+ __DBGINDENTMORE()
+
+#define __DBGDUMPSETUP(token,buf,len) \
+ debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
+ __DBGMSGHEX(("dumpx_" token,buf,len)); \
+ if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
+ debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
+ debugmsg("dumpx_" token,"\n"); \
+ } else { \
+ debugmsg("dumpx_" token," "); \
+ } \
+ debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
+
+/******************* End private macros ************************/
+/*****************************************************************/
+#endif /* NETSNMP_NO_DEBUGGING */
+
+#ifdef __cplusplus
+}
+#endif
+
+ /* Public macros moved to top-level API header file */
+#include <net-snmp/output_api.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ void snmp_debug_init(void);
+
+#define MAX_DEBUG_TOKENS 256
+#define MAX_DEBUG_TOKEN_LEN 128
+#define DEBUG_TOKEN_DELIMITER ","
+#define DEBUG_ALWAYS_TOKEN "all"
+
+#ifndef NETSNMP_NO_DEBUGGING
+
+/*
+ * internal:
+ * You probably shouldn't be using this information unless the word
+ * "expert" applies to you. I know it looks tempting.
+ */
+typedef struct netsnmp_token_descr_s {
+ char *token_name;
+ char enabled;
+} netsnmp_token_descr;
+
+NETSNMP_IMPORT int debug_num_tokens;
+NETSNMP_IMPORT netsnmp_token_descr dbg_tokens[MAX_DEBUG_TOKENS];
+
+#endif /* NETSNMP_NO_DEBUGGING */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_DEBUG_H */
diff --git a/include/net-snmp/library/snmp_enum.h b/include/net-snmp/library/snmp_enum.h
new file mode 100644
index 0000000..237891d
--- /dev/null
+++ b/include/net-snmp/library/snmp_enum.h
@@ -0,0 +1,115 @@
+#ifndef SNMP_ENUM_H
+#define SNMP_ENUM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ struct snmp_enum_list {
+ struct snmp_enum_list *next;
+ int value;
+ char *label;
+ };
+
+#define SE_MAX_IDS 5
+#define SE_MAX_SUBIDS 32 /* needs to be a multiple of 8 */
+
+ /*
+ * begin storage definitions
+ */
+ /*
+ * These definitions correspond with the "storid" argument to the API
+ */
+#define SE_LIBRARY_ID 0
+#define SE_MIB_ID 1
+#define SE_APPLICATION_ID 2
+#define SE_ASSIGNED_ID 3
+
+ /*
+ * library specific enum locations
+ */
+
+ /*
+ * error codes
+ */
+#define SE_OK 0
+#define SE_NOMEM 1
+#define SE_ALREADY_THERE 2
+#define SE_DNE -2
+
+ int init_snmp_enum(const char *type);
+ struct snmp_enum_list *se_find_list(unsigned int major,
+ unsigned int minor);
+ struct snmp_enum_list *se_find_slist(const char *listname);
+ int se_store_in_list(struct snmp_enum_list *,
+ unsigned int major, unsigned int minor);
+ int se_find_value(unsigned int major, unsigned int minor,
+ const char *label);
+ int se_find_free_value(unsigned int major, unsigned int minor);
+ char *se_find_label(unsigned int major, unsigned int minor,
+ int value);
+ /**
+ * Add the pair (label, value) to the list (major, minor). Transfers
+ * ownership of the memory pointed to by label to the list:
+ * clear_snmp_enum() deallocates that memory.
+ */
+ int se_add_pair(unsigned int major, unsigned int minor,
+ char *label, int value);
+
+ /*
+ * finds a list of enums in a list of enum structs associated by a name.
+ */
+ /*
+ * find a list, and then operate on that list
+ * ( direct methods further below if you already have the list pointer)
+ */
+ NETSNMP_IMPORT
+ char *se_find_label_in_slist(const char *listname,
+ int value);
+ NETSNMP_IMPORT
+ int se_find_value_in_slist(const char *listname,
+ const char *label);
+ int se_find_free_value_in_slist(const char *listname);
+ /**
+ * Add the pair (label, value) to the slist with name listname. Transfers
+ * ownership of the memory pointed to by label to the list:
+ * clear_snmp_enum() deallocates that memory.
+ */
+ NETSNMP_IMPORT
+ int se_add_pair_to_slist(const char *listname, char *label,
+ int value);
+
+ /*
+ * operates directly on a possibly external list
+ */
+ char *se_find_label_in_list(struct snmp_enum_list *list,
+ int value);
+ int se_find_value_in_list(struct snmp_enum_list *list,
+ const char *label);
+ int se_find_free_value_in_list(struct snmp_enum_list *list);
+ int se_add_pair_to_list(struct snmp_enum_list **list,
+ char *label, int value);
+
+ /*
+ * Persistent enumeration lists
+ */
+ void se_store_enum_list(struct snmp_enum_list *new_list,
+ const char *token, const char *type);
+ void se_store_list(unsigned int major, unsigned int minor,
+ const char *type);
+ void se_clear_slist(const char *listname);
+ void se_store_slist(const char *listname, const char *type);
+ int se_store_slist_callback(int majorID, int minorID,
+ void *serverargs, void *clientargs);
+ void se_read_conf(const char *word, char *cptr);
+ /**
+ * Deallocate the memory allocated by init_snmp_enum(): remove all key/value
+ * pairs stored by se_add_*() calls.
+ */
+ NETSNMP_IMPORT
+ void clear_snmp_enum(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_ENUM_H */
diff --git a/include/net-snmp/library/snmp_impl.h b/include/net-snmp/library/snmp_impl.h
new file mode 100644
index 0000000..f79aebd
--- /dev/null
+++ b/include/net-snmp/library/snmp_impl.h
@@ -0,0 +1,146 @@
+#ifndef SNMP_IMPL_H
+#define SNMP_IMPL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /*
+ * * file: snmp_impl.h
+ */
+
+ /*
+ * Definitions for SNMP implementation.
+ *
+ *
+ */
+/***********************************************************
+ 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.
+******************************************************************/
+
+#include<stdio.h>
+#include<net-snmp/types.h> /* for 'u_char', etc */
+
+#define COMMUNITY_MAX_LEN 256
+
+ /*
+ * Space for character representation of an object identifier
+ */
+#define SPRINT_MAX_LEN 2560
+
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#define READ 1
+#define WRITE 0
+
+#define RESERVE1 0
+#define RESERVE2 1
+#define ACTION 2
+#define COMMIT 3
+#define FREE 4
+#define UNDO 5
+#define FINISHED_SUCCESS 9
+#define FINISHED_FAILURE 10
+
+ /*
+ * Access control statements for the agent
+ */
+#define NETSNMP_OLDAPI_RONLY 0x1 /* read access only */
+#define NETSNMP_OLDAPI_RWRITE 0x2 /* read and write access (must have 0x2 bit set) */
+#define NETSNMP_OLDAPI_NOACCESS 0x0000 /* no access for anybody */
+
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+#define RONLY NETSNMP_OLDAPI_RONLY
+#define RWRITE NETSNMP_OLDAPI_RWRITE
+#define NOACCESS NETSNMP_OLDAPI_NOACCESS
+#endif
+
+ /*
+ * defined types (from the SMI, RFC 1157)
+ */
+#define ASN_IPADDRESS (ASN_APPLICATION | 0)
+#define ASN_COUNTER (ASN_APPLICATION | 1)
+#define ASN_GAUGE (ASN_APPLICATION | 2)
+#define ASN_UNSIGNED (ASN_APPLICATION | 2) /* RFC 1902 - same as GAUGE */
+#define ASN_TIMETICKS (ASN_APPLICATION | 3)
+#define ASN_OPAQUE (ASN_APPLICATION | 4) /* changed so no conflict with other includes */
+
+ /*
+ * defined types (from the SMI, RFC 1442)
+ */
+#define ASN_NSAP (ASN_APPLICATION | 5) /* historic - don't use */
+#define ASN_COUNTER64 (ASN_APPLICATION | 6)
+#define ASN_UINTEGER (ASN_APPLICATION | 7) /* historic - don't use */
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ /*
+ * defined types from draft-perkins-opaque-01.txt
+ */
+#define ASN_FLOAT (ASN_APPLICATION | 8)
+#define ASN_DOUBLE (ASN_APPLICATION | 9)
+#define ASN_INTEGER64 (ASN_APPLICATION | 10)
+#define ASN_UNSIGNED64 (ASN_APPLICATION | 11)
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+
+ /*
+ * changed to ERROR_MSG to eliminate conflict with other includes
+ */
+#ifndef ERROR_MSG
+#define ERROR_MSG(string) snmp_set_detail(string)
+#endif
+
+ /*
+ * from snmp.c
+ */
+ extern u_char sid[]; /* size SID_MAX_LEN */
+ NETSNMP_IMPORT int snmp_errno;
+
+
+ /*
+ * For calling secauth_build, FIRST_PASS is an indication that a new nonce
+ * and lastTimeStamp should be recorded. LAST_PASS is an indication that
+ * the packet should be checksummed and encrypted if applicable, in
+ * preparation for transmission.
+ * 0 means do neither, FIRST_PASS | LAST_PASS means do both.
+ * For secauth_parse, FIRST_PASS means decrypt the packet, otherwise leave it
+ * alone. LAST_PASS is ignored.
+ */
+#define FIRST_PASS 1
+#define LAST_PASS 2
+ u_char *snmp_comstr_parse(u_char *, size_t *, u_char *,
+ size_t *, long *);
+ u_char *snmp_comstr_build(u_char *, size_t *, u_char *,
+ size_t *, long *, size_t);
+
+ int has_access(u_char, int, int, int);
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_IMPL_H */
diff --git a/include/net-snmp/library/snmp_logging.h b/include/net-snmp/library/snmp_logging.h
new file mode 100644
index 0000000..1d7921b
--- /dev/null
+++ b/include/net-snmp/library/snmp_logging.h
@@ -0,0 +1,126 @@
+#ifndef SNMP_LOGGING_H
+#define SNMP_LOGGING_H
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+
+#if HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+#include <stdio.h>
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef LOG_ERR
+#define LOG_EMERG 0 /* system is unusable */
+#define LOG_ALERT 1 /* action must be taken immediately */
+#define LOG_CRIT 2 /* critical conditions */
+#define LOG_ERR 3 /* error conditions */
+#define LOG_WARNING 4 /* warning conditions */
+#define LOG_NOTICE 5 /* normal but significant condition */
+#define LOG_INFO 6 /* informational */
+#define LOG_DEBUG 7 /* debug-level messages */
+#endif
+
+ struct snmp_log_message {
+ int priority;
+ const char *msg;
+ };
+
+#ifndef DEFAULT_LOG_ID
+#define DEFAULT_LOG_ID "net-snmp"
+#endif
+
+#define NETSNMP_LOGONCE(x) do { \
+ static char logged = 0; \
+ if (!logged) { \
+ logged = 1; \
+ snmp_log x ; \
+ } \
+ } while(0)
+
+ void init_snmp_logging(void);
+ NETSNMP_IMPORT
+ void snmp_disable_syslog(void);
+ void snmp_disable_filelog(void);
+ NETSNMP_IMPORT
+ void snmp_disable_stderrlog(void);
+ void snmp_disable_calllog(void);
+ NETSNMP_IMPORT
+ void snmp_enable_syslog(void);
+ NETSNMP_IMPORT
+ void snmp_enable_syslog_ident(const char *ident,
+ const int facility);
+ NETSNMP_IMPORT
+ void snmp_enable_filelog(const char *logfilename,
+ int dont_zero_log);
+ NETSNMP_IMPORT
+ void snmp_enable_stderrlog(void);
+ void snmp_enable_calllog(void);
+
+ NETSNMP_IMPORT
+ int snmp_stderrlog_status(void);
+
+
+#define NETSNMP_LOGHANDLER_STDOUT 1
+#define NETSNMP_LOGHANDLER_STDERR 2
+#define NETSNMP_LOGHANDLER_FILE 3
+#define NETSNMP_LOGHANDLER_SYSLOG 4
+#define NETSNMP_LOGHANDLER_CALLBACK 5
+#define NETSNMP_LOGHANDLER_NONE 6
+
+ NETSNMP_IMPORT
+ void netsnmp_set_line_buffering(FILE *stream);
+ NETSNMP_IMPORT
+ int snmp_log_options(char *optarg, int argc, char *const *argv);
+ NETSNMP_IMPORT
+ void snmp_log_options_usage(const char *lead, FILE *outf);
+ NETSNMP_IMPORT
+ char *snmp_log_syslogname(const char *syslogname);
+ typedef struct netsnmp_log_handler_s netsnmp_log_handler;
+ typedef int (NetsnmpLogHandler)(netsnmp_log_handler*, int, const char *);
+
+ NetsnmpLogHandler log_handler_stdouterr;
+ NetsnmpLogHandler log_handler_file;
+ NetsnmpLogHandler log_handler_syslog;
+ NetsnmpLogHandler log_handler_callback;
+ NetsnmpLogHandler log_handler_null;
+
+ struct netsnmp_log_handler_s {
+ int enabled;
+ int priority;
+ int pri_max;
+ int type;
+ const char *token; /* Also used for filename */
+
+ NetsnmpLogHandler *handler;
+
+ int imagic; /* E.g. file descriptor, syslog facility */
+ void *magic; /* E.g. Callback function */
+
+ netsnmp_log_handler *next, *prev;
+ };
+
+NETSNMP_IMPORT
+netsnmp_log_handler *get_logh_head( void );
+NETSNMP_IMPORT
+netsnmp_log_handler *netsnmp_register_loghandler( int type, int pri );
+netsnmp_log_handler *netsnmp_find_loghandler( const char *token );
+int netsnmp_add_loghandler( netsnmp_log_handler *logh );
+NETSNMP_IMPORT
+int netsnmp_remove_loghandler( netsnmp_log_handler *logh );
+int netsnmp_enable_loghandler( const char *token );
+int netsnmp_disable_loghandler( const char *token );
+NETSNMP_IMPORT
+void netsnmp_enable_this_loghandler( netsnmp_log_handler *logh );
+NETSNMP_IMPORT
+void netsnmp_disable_this_loghandler( netsnmp_log_handler *logh );
+NETSNMP_IMPORT
+void netsnmp_logging_restart(void);
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_LOGGING_H */
diff --git a/include/net-snmp/library/snmp_openssl.h b/include/net-snmp/library/snmp_openssl.h
new file mode 100644
index 0000000..b291736
--- /dev/null
+++ b/include/net-snmp/library/snmp_openssl.h
@@ -0,0 +1,46 @@
+/*
+ * Header file for the OpenSSL Wrapper
+ */
+
+#ifndef SNMP_OPENSSL_H
+#define SNMP_OPENSSL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ void netsnmp_init_openssl(void);
+
+ /*
+ * cert fields
+ */
+ void netsnmp_openssl_cert_dump_names(X509 *ocert);
+ void netsnmp_openssl_cert_dump_extensions(X509 *ocert);
+
+ char *netsnmp_openssl_cert_get_commonName(X509 *, char **buf, int *len);
+ char *netsnmp_openssl_cert_get_subjectName(X509 *, char **buf, int *len);
+ char *netsnmp_openssl_cert_get_fingerprint(X509 *ocert, int alg);
+ int netsnmp_openssl_cert_get_hash_type(X509 *ocert);
+
+ int netsnmp_openssl_cert_issued_by(X509 *issuer, X509 *cert);
+
+ char *netsnmp_openssl_extract_secname(netsnmp_cert_map *cert_map,
+ netsnmp_cert_map *peer_cert);
+
+ char *netsnmp_openssl_cert_get_subjectAltName(X509 *, char **buf, int *len);
+
+ /*
+ * ssl cert chains
+ */
+ netsnmp_container *netsnmp_openssl_get_cert_chain(SSL *ssl);
+
+ /*
+ * misc
+ */
+ void netsnmp_openssl_err_log(const char *prefix);
+ void netsnmp_openssl_null_checks(SSL *ssl, int *nullAuth, int *nullCipher);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_OPENSSL_H */
diff --git a/include/net-snmp/library/snmp_parse_args.h b/include/net-snmp/library/snmp_parse_args.h
new file mode 100644
index 0000000..1ad63e0
--- /dev/null
+++ b/include/net-snmp/library/snmp_parse_args.h
@@ -0,0 +1,93 @@
+#ifndef SNMP_PARSE_ARGS_H
+#define SNMP_PARSE_ARGS_H
+
+/**
+ * @file snmp_parse_args.h
+ *
+ * Support for initializing variables of type netsnmp_session from command
+ * line arguments
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Don't enable any logging even if there is no -L argument */
+#define NETSNMP_PARSE_ARGS_NOLOGGING 0x0001
+/** Don't zero out sensitive arguments as they are not on the command line
+ * anyway, typically used when the function is called from an internal
+ * config-line handler
+ */
+#define NETSNMP_PARSE_ARGS_NOZERO 0x0002
+
+/**
+ * Parsing of command line arguments succeeded and application is expected
+ * to continue with normal operation.
+ */
+#define NETSNMP_PARSE_ARGS_SUCCESS 0
+/**
+ * Parsing of command line arguments succeeded, but the application is expected
+ * to exit with zero exit code. For example, '-V' parameter has been found.
+ */
+#define NETSNMP_PARSE_ARGS_SUCCESS_EXIT -2
+/**
+ * Parsing of command line arguments failed and application is expected to show
+ * usage (i.e. list of parameters) and exit with nozero exit code.
+ */
+#define NETSNMP_PARSE_ARGS_ERROR_USAGE -1
+/**
+ * Parsing of command line arguments failed and application is expected to exit
+ * with nozero exit code. netsnmp_parse_args() has already printed what went
+ * wrong.
+ */
+#define NETSNMP_PARSE_ARGS_ERROR -3
+
+/**
+ * Parse an argument list and initialize \link netsnmp_session
+ * session\endlink
+ * from it.
+ * @param argc Number of elements in argv
+ * @param argv string array of at least argc elements
+ * @param session
+ * @param localOpts Additional option characters to accept
+ * @param proc function pointer used to process any unhandled arguments
+ * @param flags flags directing how to handle the string
+ *
+ * @retval 0 (= #NETSNMP_PARSE_ARGS_SUCCESS) on success
+ * @retval #NETSNMP_PARSE_ARGS_SUCCESS_EXIT when the application is expected
+ * to exit with zero exit code (e.g. '-V' option was found)
+ * @retval #NETSNMP_PARSE_ARGS_ERROR_USAGE when the function failed to parse
+ * the command line and the application is expected to show it's usage
+ * @retval #NETSNMP_PARSE_ARGS_ERROR when the function failed to parse
+ * the command line and it has already printed enough information for the user
+ * and no other output is needed
+ *
+ * The proc function is called with argc, argv and the currently processed
+ * option as arguments
+ */
+NETSNMP_IMPORT int
+netsnmp_parse_args(int argc, char **argv, netsnmp_session *session,
+ const char *localOpts, void (*proc)(int, char *const *, int),
+ int flags);
+
+/**
+ * Calls \link netsnmp_parse_args()
+ * netsnmp_parse_args(argc, argv, session, localOpts, proc, 0)\endlink
+ */
+NETSNMP_IMPORT
+int
+snmp_parse_args(int argc, char **argv, netsnmp_session *session,
+ const char *localOpts, void (*proc)(int, char *const *, int));
+
+NETSNMP_IMPORT
+void
+snmp_parse_args_descriptions(FILE *);
+
+NETSNMP_IMPORT
+void
+snmp_parse_args_usage(FILE *);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/library/snmp_secmod.h b/include/net-snmp/library/snmp_secmod.h
new file mode 100644
index 0000000..aabb7ed
--- /dev/null
+++ b/include/net-snmp/library/snmp_secmod.h
@@ -0,0 +1,180 @@
+#ifndef SNMPSECMOD_H
+#define SNMPSECMOD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <net-snmp/library/snmp_transport.h>
+
+/* Locally defined security models.
+ * (Net-SNMP enterprise number = 8072)*256 + local_num
+ */
+#define NETSNMP_SEC_MODEL_KSM 2066432
+#define NETSNMP_KSM_SECURITY_MODEL NETSNMP_SEC_MODEL_KSM
+#define NETSNMP_TSM_SECURITY_MODEL SNMP_SEC_MODEL_TSM
+
+struct snmp_secmod_def;
+
+/*
+ * parameter information passed to security model routines
+ */
+struct snmp_secmod_outgoing_params {
+ int msgProcModel;
+ u_char *globalData;
+ size_t globalDataLen;
+ int maxMsgSize;
+ int secModel;
+ u_char *secEngineID;
+ size_t secEngineIDLen;
+ char *secName;
+ size_t secNameLen;
+ int secLevel;
+ u_char *scopedPdu;
+ size_t scopedPduLen;
+ void *secStateRef;
+ u_char *secParams;
+ size_t *secParamsLen;
+ u_char **wholeMsg;
+ size_t *wholeMsgLen;
+ size_t *wholeMsgOffset;
+ netsnmp_pdu *pdu; /* IN - the pdu getting encoded */
+ netsnmp_session *session; /* IN - session sending the message */
+};
+
+struct snmp_secmod_incoming_params {
+ int msgProcModel; /* IN */
+ size_t maxMsgSize; /* IN - Used to calc maxSizeResponse. */
+
+ u_char *secParams; /* IN - BER encoded securityParameters. */
+ int secModel; /* IN */
+ int secLevel; /* IN - AuthNoPriv; authPriv etc. */
+
+ u_char *wholeMsg; /* IN - Original v3 message. */
+ size_t wholeMsgLen; /* IN - Msg length. */
+
+ u_char *secEngineID; /* OUT - Pointer snmpEngineID. */
+ size_t *secEngineIDLen; /* IN/OUT - Len available; len returned. */
+ /*
+ * NOTE: Memory provided by caller.
+ */
+
+ char *secName; /* OUT - Pointer to securityName. */
+ size_t *secNameLen; /* IN/OUT - Len available; len returned. */
+
+ u_char **scopedPdu; /* OUT - Pointer to plaintext scopedPdu. */
+ size_t *scopedPduLen; /* IN/OUT - Len available; len returned. */
+
+ size_t *maxSizeResponse; /* OUT - Max size of Response PDU. */
+ void **secStateRef; /* OUT - Ref to security state. */
+ netsnmp_session *sess; /* IN - session which got the message */
+ netsnmp_pdu *pdu; /* IN - the pdu getting parsed */
+ u_char msg_flags; /* IN - v3 Message flags. */
+};
+
+
+/*
+ * function pointers:
+ */
+
+/*
+ * free's a given security module's data; called at unregistration time
+ */
+typedef int (SecmodSessionCallback) (netsnmp_session *);
+typedef int (SecmodPduCallback) (netsnmp_pdu *);
+typedef int (Secmod2PduCallback) (netsnmp_pdu *, netsnmp_pdu *);
+typedef int (SecmodOutMsg) (struct snmp_secmod_outgoing_params *);
+typedef int (SecmodInMsg) (struct snmp_secmod_incoming_params *);
+typedef void (SecmodFreeState) (void *);
+typedef void (SecmodHandleReport) (void *sessp,
+ netsnmp_transport *transport,
+ netsnmp_session *,
+ int result,
+ netsnmp_pdu *origpdu);
+typedef int (SecmodDiscoveryMethod) (void *slp, netsnmp_session *session);
+typedef int (SecmodPostDiscovery) (void *slp, netsnmp_session *session);
+
+typedef int (SecmodSessionSetup) (netsnmp_session *in_session,
+ netsnmp_session *out_session);
+/*
+ * definition of a security module
+ */
+
+/*
+ * all of these callback functions except the encoding and decoding
+ * routines are optional. The rest of them are available if need.
+ */
+struct snmp_secmod_def {
+ /*
+ * session maniplation functions
+ */
+ SecmodSessionCallback *session_open; /* called in snmp_sess_open() */
+ SecmodSessionCallback *session_close; /* called in snmp_sess_close() */
+ SecmodSessionSetup *session_setup;
+
+ /*
+ * pdu manipulation routines
+ */
+ SecmodPduCallback *pdu_free; /* called in free_pdu() */
+ Secmod2PduCallback *pdu_clone; /* called in snmp_clone_pdu() */
+ SecmodPduCallback *pdu_timeout; /* called when request timesout */
+ SecmodFreeState *pdu_free_state_ref; /* frees pdu->securityStateRef */
+
+ /*
+ * de/encoding routines: mandatory
+ */
+ SecmodOutMsg *encode_reverse; /* encode packet back to front */
+ SecmodOutMsg *encode_forward; /* encode packet forward */
+ SecmodInMsg *decode; /* decode & validate incoming */
+
+ /*
+ * error and report handling
+ */
+ SecmodHandleReport *handle_report;
+
+ /*
+ * default engineID discovery mechanism
+ */
+ SecmodDiscoveryMethod *probe_engineid;
+ SecmodPostDiscovery *post_probe_engineid;
+};
+
+
+/*
+ * internal list
+ */
+struct snmp_secmod_list {
+ int securityModel;
+ struct snmp_secmod_def *secDef;
+ struct snmp_secmod_list *next;
+};
+
+
+/*
+ * register a security service
+ */
+int register_sec_mod(int, const char *,
+ struct snmp_secmod_def *);
+/*
+ * find a security service definition
+ */
+NETSNMP_IMPORT
+struct snmp_secmod_def *find_sec_mod(int);
+/*
+ * register a security service
+ */
+int unregister_sec_mod(int); /* register a security service */
+void init_secmod(void);
+NETSNMP_IMPORT
+void shutdown_secmod(void);
+
+/*
+ * clears the sec_mod list
+ */
+NETSNMP_IMPORT
+void clear_sec_mod(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPSECMOD_H */
diff --git a/include/net-snmp/library/snmp_service.h b/include/net-snmp/library/snmp_service.h
new file mode 100644
index 0000000..711f676
--- /dev/null
+++ b/include/net-snmp/library/snmp_service.h
@@ -0,0 +1,39 @@
+#ifndef _SNMP_SERVICE_H
+#define _SNMP_SERVICE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Default port handling */
+
+NETSNMP_IMPORT int
+netsnmp_register_default_domain(const char* application, const char* domain);
+
+extern const char*
+netsnmp_lookup_default_domain(const char* application);
+
+extern const char* const *
+netsnmp_lookup_default_domains(const char* application);
+
+extern void
+netsnmp_clear_default_domain(void);
+
+NETSNMP_IMPORT int
+netsnmp_register_default_target(const char* application, const char* domain,
+ const char* target);
+
+extern const char*
+netsnmp_lookup_default_target(const char* application, const char* domain);
+
+extern void
+netsnmp_clear_default_target(void);
+
+NETSNMP_IMPORT void
+netsnmp_register_service_handlers(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SNMP_SERVICE_H */
diff --git a/include/net-snmp/library/snmp_transport.h b/include/net-snmp/library/snmp_transport.h
new file mode 100644
index 0000000..4162897
--- /dev/null
+++ b/include/net-snmp/library/snmp_transport.h
@@ -0,0 +1,317 @@
+#ifndef _SNMP_TRANSPORT_H
+#define _SNMP_TRANSPORT_H
+
+#include <sys/types.h>
+
+#if HAVE_SYS_SOCKET_H
+#ifdef solaris2
+#define _XPG4_2
+#endif
+
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+#define _LINUX_SOURCE_COMPAT
+#endif
+
+#include <sys/socket.h>
+
+#ifdef solaris2
+# ifndef CMSG_SPACE
+# define CMSG_SPACE(l) \
+ ((unsigned int)_CMSG_HDR_ALIGN(sizeof (struct cmsghdr) + (l)))
+# define CMSG_LEN(l) (_CMSG_HDR_ALIGN(sizeof(struct cmsghdr)) + (l))
+# endif
+#endif
+#endif /* HAVE_SYS_SOCKET_H */
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/library/asn1.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Some transport-type constants. */
+
+#ifndef NETSNMP_STREAM_QUEUE_LEN
+#define NETSNMP_STREAM_QUEUE_LEN 5
+#endif
+
+/* Some transport-type flags. */
+
+#define NETSNMP_TRANSPORT_FLAG_STREAM 0x01
+#define NETSNMP_TRANSPORT_FLAG_LISTEN 0x02
+#define NETSNMP_TRANSPORT_FLAG_TUNNELED 0x04
+#define NETSNMP_TRANSPORT_FLAG_TMSTATE 0x08 /* indicates opaque is a
+ TSM tmStateReference */
+#define NETSNMP_TRANSPORT_FLAG_EMPTY_PKT 0x10
+#define NETSNMP_TRANSPORT_FLAG_OPENED 0x20 /* f_open called */
+#define NETSNMP_TRANSPORT_FLAG_HOSTNAME 0x80 /* for fmtaddr hook */
+
+/* The standard SNMP domains. */
+
+NETSNMP_IMPORT oid netsnmpUDPDomain[]; /* = { 1, 3, 6, 1, 6, 1, 1 }; */
+NETSNMP_IMPORT oid netsnmpCLNSDomain[]; /* = { 1, 3, 6, 1, 6, 1, 2 }; */
+NETSNMP_IMPORT oid netsnmpCONSDomain[]; /* = { 1, 3, 6, 1, 6, 1, 3 }; */
+NETSNMP_IMPORT oid netsnmpDDPDomain[]; /* = { 1, 3, 6, 1, 6, 1, 4 }; */
+NETSNMP_IMPORT oid netsnmpIPXDomain[]; /* = { 1, 3, 6, 1, 6, 1, 5 }; */
+NETSNMP_IMPORT size_t netsnmpUDPDomain_len;
+NETSNMP_IMPORT size_t netsnmpCLNSDomain_len;
+NETSNMP_IMPORT size_t netsnmpCONSDomain_len;
+NETSNMP_IMPORT size_t netsnmpDDPDomain_len;
+NETSNMP_IMPORT size_t netsnmpIPXDomain_len;
+
+/* Structure which stores transport security model specific parameters */
+/* isms-secshell-11 section 4.1 */
+
+/* contents documented in draft-ietf-isms-transport-security-model
+ Section 3.2 */
+/* note: VACM only allows <= 32 so this is overkill till another ACM comes */
+#define NETSNMP_TM_MAX_SECNAME 256
+
+typedef union netsnmp_sockaddr_storage_u {
+ struct sockaddr sa;
+ struct sockaddr_in sin;
+#ifdef NETSNMP_ENABLE_IPV6
+ struct sockaddr_in6 sin6;
+#endif
+} netsnmp_sockaddr_storage;
+
+typedef struct netsnmp_addr_pair_s {
+ netsnmp_sockaddr_storage remote_addr;
+ netsnmp_sockaddr_storage local_addr;
+} netsnmp_addr_pair;
+
+typedef struct netsnmp_indexed_addr_pair_s {
+ netsnmp_sockaddr_storage remote_addr;
+ netsnmp_sockaddr_storage local_addr;
+ int if_index;
+} netsnmp_indexed_addr_pair;
+
+typedef struct netsnmp_tmStateReference_s {
+ oid transportDomain[MAX_OID_LEN];
+ size_t transportDomainLen;
+ char securityName[NETSNMP_TM_MAX_SECNAME];
+ size_t securityNameLen;
+ int requestedSecurityLevel;
+ int transportSecurityLevel;
+ char sameSecurity;
+ char sessionID[8];
+
+ char have_addresses;
+ netsnmp_indexed_addr_pair addresses;
+
+ void *otherTransportOpaque; /* XXX: May have mem leak issues */
+} netsnmp_tmStateReference;
+
+/* Structure which defines the transport-independent API. */
+
+struct snmp_session;
+
+typedef struct netsnmp_transport_s {
+ /* The transport domain object identifier. */
+
+ const oid *domain;
+ int domain_length; /* In sub-IDs, not octets. */
+
+ /* Local transport address (in relevant SNMP-style encoding). */
+
+ unsigned char *local;
+ int local_length; /* In octets. */
+
+ /* Remote transport address (in relevant SNMP-style encoding). */
+
+ unsigned char *remote;
+ int remote_length; /* In octets. */
+
+ /* The actual socket. */
+
+ int sock;
+
+ /* Flags (see #definitions above). */
+
+ unsigned int flags;
+
+ /* Protocol-specific opaque data pointer. */
+
+ void *data;
+ int data_length;
+
+ /* Maximum size of PDU that can be sent/received by this transport. */
+
+ size_t msgMaxSize;
+
+#ifdef FOR_STANDARDS_COMPLIANCE_OR_FUTURE_USE
+ /* TM state reference per ISMS WG solution */
+ netsnmp_tmStateReference *tmStateRef;
+#endif
+
+ /* tunneled transports */
+ struct netsnmp_transport_s * base_transport;
+
+ /* Callbacks. Arguments are:
+ *
+ * "this" pointer, fd, buf, size, *opaque, *opaque_length
+ */
+
+ int (*f_recv) (struct netsnmp_transport_s *, void *,
+ int, void **, int *);
+ int (*f_send) (struct netsnmp_transport_s *, void *,
+ int, void **, int *);
+ int (*f_close) (struct netsnmp_transport_s *);
+
+ /* Optional: opening can occur during creation if more appropriate */
+ struct netsnmp_transport_s * (*f_open) (struct netsnmp_transport_s *);
+
+ /* This callback is only necessary for stream-oriented transports. */
+
+ int (*f_accept) (struct netsnmp_transport_s *);
+
+ /* Optional callback to format a transport address. */
+
+ char *(*f_fmtaddr)(struct netsnmp_transport_s *, void *, int);
+
+ /* Optional callback to support extra configuration token/value pairs */
+ /* return non-zero on error */
+ int (*f_config)(struct netsnmp_transport_s *, const char *,
+ const char *);
+
+ /* Optional callback that is called after the first transport is
+ cloned to the second */
+ int (*f_copy)(struct netsnmp_transport_s *,
+ struct netsnmp_transport_s *);
+
+ /* Setup initial session config if special things are needed */
+ int (*f_setup_session)(struct netsnmp_transport_s *,
+ struct snmp_session *);
+
+ /* allocated host name identifier; used by configuration system
+ to load localhost.conf for host-specific configuration */
+ u_char *identifier; /* udp:localhost:161 -> "localhost" */
+} netsnmp_transport;
+
+typedef struct netsnmp_transport_list_s {
+ netsnmp_transport *transport;
+ struct netsnmp_transport_list_s *next;
+} netsnmp_transport_list;
+
+typedef struct netsnmp_tdomain_s {
+ const oid *name;
+ size_t name_length;
+ const char **prefix;
+
+ /*
+ * The f_create_from_tstring field is deprecated, please do not use it
+ * for new code and try to migrate old code away from using it.
+ */
+ netsnmp_transport *(*f_create_from_tstring) (const char *, int);
+
+ netsnmp_transport *(*f_create_from_ostring) (const u_char *, size_t, int);
+
+ struct netsnmp_tdomain_s *next;
+
+ netsnmp_transport *(*f_create_from_tstring_new) (const char *, int,
+ const char*);
+
+} netsnmp_tdomain;
+
+void init_snmp_transport(void);
+
+/* Some utility functions. */
+
+char *netsnmp_transport_peer_string(netsnmp_transport *t, void *data, int len);
+
+int netsnmp_transport_send(netsnmp_transport *t, void *data, int len,
+ void **opaque, int *olength);
+int netsnmp_transport_recv(netsnmp_transport *t, void *data, int len,
+ void **opaque, int *olength);
+
+int netsnmp_transport_add_to_list(netsnmp_transport_list **transport_list,
+ netsnmp_transport *transport);
+int netsnmp_transport_remove_from_list(netsnmp_transport_list **transport_list,
+ netsnmp_transport *transport);
+int netsnmp_sockaddr_size(struct sockaddr *sa);
+
+
+/*
+ * Return an exact (deep) copy of t, or NULL if there is a memory allocation
+ * problem (for instance).
+ */
+
+netsnmp_transport *netsnmp_transport_copy(netsnmp_transport *t);
+
+
+/* Free an netsnmp_transport. */
+
+NETSNMP_IMPORT
+void netsnmp_transport_free(netsnmp_transport *t);
+
+
+/*
+ * If the passed oid (in_oid, in_len) corresponds to a supported transport
+ * domain, return 1; if not return 0. If out_oid is not NULL and out_len is
+ * not NULL, then the "internal" oid which should be used to identify this
+ * domain (e.g. in pdu->tDomain etc.) is written to *out_oid and its length to
+ * *out_len.
+ */
+
+NETSNMP_IMPORT
+int netsnmp_tdomain_support(const oid *in_oid, size_t in_len,
+ const oid **out_oid, size_t *out_len);
+
+int netsnmp_tdomain_register(netsnmp_tdomain *domain);
+
+int netsnmp_tdomain_unregister(netsnmp_tdomain *domain);
+
+NETSNMP_IMPORT
+void netsnmp_clear_tdomain_list(void);
+
+void netsnmp_tdomain_init(void);
+
+NETSNMP_IMPORT
+netsnmp_transport *netsnmp_tdomain_transport(const char *str,
+ int local,
+ const char *default_domain);
+
+NETSNMP_IMPORT
+netsnmp_transport *netsnmp_tdomain_transport_full(const char *application,
+ const char *str,
+ int local,
+ const char *default_domain,
+ const char *default_target);
+
+NETSNMP_IMPORT
+netsnmp_transport *netsnmp_tdomain_transport_oid(const oid * dom,
+ size_t dom_len,
+ const u_char * o,
+ size_t o_len,
+ int local);
+
+NETSNMP_IMPORT
+netsnmp_transport*
+netsnmp_transport_open_client(const char* application, const char* str);
+
+NETSNMP_IMPORT
+netsnmp_transport*
+netsnmp_transport_open_server(const char* application, const char* str);
+
+netsnmp_transport*
+netsnmp_transport_open(const char* application, const char* str, int local);
+
+typedef struct netsnmp_transport_config_s {
+ char *key;
+ char *value;
+} netsnmp_transport_config;
+
+NETSNMP_IMPORT
+int netsnmp_transport_config_compare(netsnmp_transport_config *left,
+ netsnmp_transport_config *right);
+NETSNMP_IMPORT
+netsnmp_transport_config *netsnmp_transport_create_config(char *key,
+ char *value);
+#ifdef __cplusplus
+}
+#endif
+#endif/*_SNMP_TRANSPORT_H*/
diff --git a/include/net-snmp/library/snmpksm.h b/include/net-snmp/library/snmpksm.h
new file mode 100644
index 0000000..1b563f0
--- /dev/null
+++ b/include/net-snmp/library/snmpksm.h
@@ -0,0 +1,35 @@
+/*
+ * Header file for Kerberos Security Model support
+ */
+
+#ifndef SNMPKSM_H
+#define SNMPKSM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ int ksm_rgenerate_out_msg(struct
+ snmp_secmod_outgoing_params *);
+ int ksm_process_in_msg(struct snmp_secmod_incoming_params
+ *);
+ void init_ksm(void);
+
+ void shutdown_ksm(void);
+
+ /*
+ * This is the "key usage" that is used by the new crypto API. It's used
+ * generally only if you are using derived keys. The specifical says that
+ * 1024-2047 are to be used by applications, and that even usage numbers are
+ * to be used for encryption and odd numbers are to be used for checksums.
+ */
+
+#define KSM_KEY_USAGE_ENCRYPTION 1030
+#define KSM_KEY_USAGE_CHECKSUM 1031
+
+#define KSM_SEC_MODEL_NUMBER SNMP_SEC_MODEL_KSM
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPKSM_H */
diff --git a/include/net-snmp/library/snmptsm.h b/include/net-snmp/library/snmptsm.h
new file mode 100644
index 0000000..264a928
--- /dev/null
+++ b/include/net-snmp/library/snmptsm.h
@@ -0,0 +1,33 @@
+/*
+ * Header file for Transport Security Model support
+ */
+
+#ifndef SNMPTSM_H
+#define SNMPTSM_H
+
+#define TSM_SEC_MODEL_NUMBER SNMP_SEC_MODEL_TSM
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ int tsm_rgenerate_out_msg(struct
+ snmp_secmod_outgoing_params *);
+ int tsm_process_in_msg(struct snmp_secmod_incoming_params
+ *);
+ void init_tsm(void);
+
+ void shutdown_tsm(void);
+
+ #define NETSNMP_TM_SAME_SECURITY_NOT_REQUIRED 0
+ #define NETSNMP_TM_USE_SAME_SECURITY 1
+
+ /* basically we store almost nothing else but a tm ref */
+ typedef struct netsnmp_tsmSecurityReference_s {
+ netsnmp_tmStateReference *tmStateRef;
+ } netsnmp_tsmSecurityReference;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPTSM_H */
diff --git a/include/net-snmp/library/snmpusm.h b/include/net-snmp/library/snmpusm.h
new file mode 100644
index 0000000..9d673cc
--- /dev/null
+++ b/include/net-snmp/library/snmpusm.h
@@ -0,0 +1,281 @@
+/*
+ * snmpusm.h
+ *
+ * Header file for USM support.
+ */
+
+#ifndef SNMPUSM_H
+#define SNMPUSM_H
+
+#include <net-snmp/library/callback.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define WILDCARDSTRING "*"
+
+ /*
+ * General.
+ */
+#define USM_MAX_ID_LENGTH 1024 /* In bytes. */
+#define USM_MAX_SALT_LENGTH 128 /* In BITS. */
+#define USM_DES_SALT_LENGTH 64 /* In BITS. */
+#define USM_AES_SALT_LENGTH 128 /* In BITS. */
+#define USM_MAX_KEYEDHASH_LENGTH 128 /* In BITS. */
+
+#define USM_TIME_WINDOW 150
+#define USM_MD5_AND_SHA_AUTH_LEN 12 /* bytes */
+#define USM_MAX_AUTHSIZE USM_MD5_AND_SHA_AUTH_LEN
+
+#define USM_SEC_MODEL_NUMBER SNMP_SEC_MODEL_USM
+
+ /*
+ * Structures.
+ */
+ struct usmStateReference {
+ char *usr_name;
+ size_t usr_name_length;
+ u_char *usr_engine_id;
+ size_t usr_engine_id_length;
+ oid *usr_auth_protocol;
+ size_t usr_auth_protocol_length;
+ u_char *usr_auth_key;
+ size_t usr_auth_key_length;
+ oid *usr_priv_protocol;
+ size_t usr_priv_protocol_length;
+ u_char *usr_priv_key;
+ size_t usr_priv_key_length;
+ u_int usr_sec_level;
+ };
+
+
+ /*
+ * struct usmUser: a structure to represent a given user in a list
+ */
+ /*
+ * Note: Any changes made to this structure need to be reflected in
+ * the following functions:
+ */
+
+ struct usmUser;
+ struct usmUser {
+ u_char *engineID;
+ size_t engineIDLen;
+ char *name;
+ char *secName;
+ oid *cloneFrom;
+ size_t cloneFromLen;
+ oid *authProtocol;
+ size_t authProtocolLen;
+ u_char *authKey;
+ size_t authKeyLen;
+ oid *privProtocol;
+ size_t privProtocolLen;
+ u_char *privKey;
+ size_t privKeyLen;
+ u_char *userPublicString;
+ size_t userPublicStringLen;
+ int userStatus;
+ int userStorageType;
+ /* these are actually DH * pointers but only if openssl is avail. */
+ void *usmDHUserAuthKeyChange;
+ void *usmDHUserPrivKeyChange;
+ struct usmUser *next;
+ struct usmUser *prev;
+ };
+
+
+
+ /*
+ * Prototypes.
+ */
+ struct usmStateReference *usm_malloc_usmStateReference(void);
+
+ void usm_free_usmStateReference(void *old);
+
+ int usm_set_usmStateReference_name(struct usmStateReference
+ *ref, char *name,
+ size_t name_len);
+
+ int usm_set_usmStateReference_engine_id(struct
+ usmStateReference
+ *ref,
+ u_char * engine_id,
+ size_t
+ engine_id_len);
+
+ int usm_set_usmStateReference_auth_protocol(struct
+ usmStateReference
+ *ref,
+ oid *
+ auth_protocol,
+ size_t
+ auth_protocol_len);
+
+ int usm_set_usmStateReference_auth_key(struct
+ usmStateReference
+ *ref,
+ u_char * auth_key,
+ size_t
+ auth_key_len);
+
+ int usm_set_usmStateReference_priv_protocol(struct
+ usmStateReference
+ *ref,
+ oid *
+ priv_protocol,
+ size_t
+ priv_protocol_len);
+
+ int usm_set_usmStateReference_priv_key(struct
+ usmStateReference
+ *ref,
+ u_char * priv_key,
+ size_t
+ priv_key_len);
+
+ int usm_set_usmStateReference_sec_level(struct
+ usmStateReference
+ *ref,
+ int sec_level);
+ int usm_clone_usmStateReference(struct usmStateReference *from,
+ struct usmStateReference **to);
+
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ void emergency_print(u_char * field, u_int length);
+#endif
+
+ int asn_predict_int_length(int type, long number,
+ size_t len);
+
+ int asn_predict_length(int type, u_char * ptr,
+ size_t u_char_len);
+
+ int usm_set_salt(u_char * iv,
+ size_t * iv_length,
+ u_char * priv_salt,
+ size_t priv_salt_length,
+ u_char * msgSalt);
+
+ int usm_parse_security_parameters(u_char * secParams,
+ size_t remaining,
+ u_char * secEngineID,
+ size_t * secEngineIDLen,
+ u_int * boots_uint,
+ u_int * time_uint,
+ char *secName,
+ size_t * secNameLen,
+ u_char * signature,
+ size_t *
+ signature_length,
+ u_char * salt,
+ size_t * salt_length,
+ u_char ** data_ptr);
+
+ int usm_check_and_update_timeliness(u_char * secEngineID,
+ size_t secEngineIDLen,
+ u_int boots_uint,
+ u_int time_uint,
+ int *error);
+
+ SecmodSessionCallback usm_open_session;
+ SecmodOutMsg usm_secmod_generate_out_msg;
+ SecmodOutMsg usm_secmod_generate_out_msg;
+ SecmodInMsg usm_secmod_process_in_msg;
+ int usm_generate_out_msg(int, u_char *, size_t, int, int,
+ u_char *, size_t, char *, size_t,
+ int, u_char *, size_t, void *,
+ u_char *, size_t *, u_char **,
+ size_t *);
+ int usm_rgenerate_out_msg(int, u_char *, size_t, int, int,
+ u_char *, size_t, char *, size_t,
+ int, u_char *, size_t, void *,
+ u_char **, size_t *, size_t *);
+
+ int usm_process_in_msg(int, size_t, u_char *, int, int,
+ u_char *, size_t, u_char *,
+ size_t *, char *, size_t *,
+ u_char **, size_t *, size_t *,
+ void **, netsnmp_session *, u_char);
+
+ int usm_check_secLevel(int level, struct usmUser *user);
+ NETSNMP_IMPORT
+ struct usmUser *usm_get_userList(void);
+ NETSNMP_IMPORT
+ struct usmUser *usm_get_user(u_char * engineID, size_t engineIDLen,
+ char *name);
+ struct usmUser *usm_get_user_from_list(u_char * engineID,
+ size_t engineIDLen, char *name,
+ struct usmUser *userList,
+ int use_default);
+ NETSNMP_IMPORT
+ struct usmUser *usm_add_user(struct usmUser *user);
+ struct usmUser *usm_add_user_to_list(struct usmUser *user,
+ struct usmUser *userList);
+ NETSNMP_IMPORT
+ struct usmUser *usm_free_user(struct usmUser *user);
+ NETSNMP_IMPORT
+ struct usmUser *usm_create_user(void);
+ NETSNMP_IMPORT
+ struct usmUser *usm_create_initial_user(const char *name,
+ const oid * authProtocol,
+ size_t authProtocolLen,
+ const oid * privProtocol,
+ size_t privProtocolLen);
+ NETSNMP_IMPORT
+ struct usmUser *usm_cloneFrom_user(struct usmUser *from,
+ struct usmUser *to);
+ NETSNMP_IMPORT
+ struct usmUser *usm_remove_user(struct usmUser *user);
+ struct usmUser *usm_remove_user_from_list(struct usmUser *user,
+ struct usmUser **userList);
+ char *get_objid(char *line, oid ** optr, size_t * len);
+ NETSNMP_IMPORT
+ void usm_save_users(const char *token, const char *type);
+ void usm_save_users_from_list(struct usmUser *user,
+ const char *token,
+ const char *type);
+ void usm_save_user(struct usmUser *user, const char *token,
+ const char *type);
+ NETSNMP_IMPORT
+ SNMPCallback usm_store_users;
+ struct usmUser *usm_read_user(const char *line);
+ NETSNMP_IMPORT
+ void usm_parse_config_usmUser(const char *token,
+ char *line);
+
+ void usm_set_password(const char *token, char *line);
+ NETSNMP_IMPORT
+ void usm_set_user_password(struct usmUser *user,
+ const char *token, char *line);
+ void init_usm(void);
+ NETSNMP_IMPORT
+ void init_usm_conf(const char *app);
+ int init_usm_post_config(int majorid, int minorid,
+ void *serverarg, void *clientarg);
+ int deinit_usm_post_config(int majorid, int minorid, void *serverarg,
+ void *clientarg);
+ NETSNMP_IMPORT
+ void clear_user_list(void);
+ NETSNMP_IMPORT
+ void shutdown_usm(void);
+
+ NETSNMP_IMPORT
+ int usm_create_user_from_session(netsnmp_session * session);
+ SecmodPostDiscovery usm_create_user_from_session_hook;
+ NETSNMP_IMPORT
+ void usm_parse_create_usmUser(const char *token,
+ char *line);
+ NETSNMP_IMPORT
+ const oid *get_default_authtype(size_t *);
+ NETSNMP_IMPORT
+ const oid *get_default_privtype(size_t *);
+ void snmpv3_authtype_conf(const char *word, char *cptr);
+ void snmpv3_privtype_conf(const char *word, char *cptr);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPUSM_H */
diff --git a/include/net-snmp/library/snmpv3.h b/include/net-snmp/library/snmpv3.h
new file mode 100644
index 0000000..a958809
--- /dev/null
+++ b/include/net-snmp/library/snmpv3.h
@@ -0,0 +1,61 @@
+/*
+ * snmpv3.h
+ */
+
+#ifndef SNMPV3_H
+#define SNMPV3_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MAX_ENGINEID_LENGTH 32 /* per SNMP-FRAMEWORK-MIB SnmpEngineID TC */
+
+#define ENGINEID_TYPE_IPV4 1
+#define ENGINEID_TYPE_IPV6 2
+#define ENGINEID_TYPE_MACADDR 3
+#define ENGINEID_TYPE_TEXT 4
+#define ENGINEID_TYPE_EXACT 5
+#define ENGINEID_TYPE_NETSNMP_RND 128
+
+#define DEFAULT_NIC "eth0"
+
+ NETSNMP_IMPORT
+ int setup_engineID(u_char ** eidp, const char *text);
+ void engineID_conf(const char *word, char *cptr);
+ void engineBoots_conf(const char *, char *);
+ void engineIDType_conf(const char *, char *);
+ void engineIDNic_conf(const char *, char *);
+ NETSNMP_IMPORT
+ void init_snmpv3(const char *);
+ int init_snmpv3_post_config(int majorid, int minorid,
+ void *serverarg,
+ void *clientarg);
+ int init_snmpv3_post_premib_config(int majorid,
+ int minorid,
+ void *serverarg,
+ void *clientarg);
+ void shutdown_snmpv3(const char *type);
+ int snmpv3_store(int majorID, int minorID, void *serverarg,
+ void *clientarg);
+ NETSNMP_IMPORT
+ u_long snmpv3_local_snmpEngineBoots(void);
+ int snmpv3_clone_engineID(u_char **, size_t *, u_char *,
+ size_t);
+ NETSNMP_IMPORT
+ size_t snmpv3_get_engineID(u_char * buf, size_t buflen);
+ NETSNMP_IMPORT
+ u_char *snmpv3_generate_engineID(size_t *);
+ NETSNMP_IMPORT
+ u_long snmpv3_local_snmpEngineTime(void);
+ int get_default_secLevel(void);
+ void snmpv3_set_engineBootsAndTime(int boots, int ttime);
+ int free_engineID(int majorid, int minorid, void *serverarg,
+ void *clientarg);
+ NETSNMP_IMPORT
+ int parse_secLevel_conf(const char* word, char *cptr);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPV3_H */
diff --git a/include/net-snmp/library/system.h b/include/net-snmp/library/system.h
new file mode 100644
index 0000000..5c58e4a
--- /dev/null
+++ b/include/net-snmp/library/system.h
@@ -0,0 +1,215 @@
+#ifndef SNMP_SYSTEM_H
+#define SNMP_SYSTEM_H
+
+#ifndef NET_SNMP_CONFIG_H
+#error "Please include <net-snmp/net-snmp-config.h> before this file"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* 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 1993 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 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.
+ */
+
+
+ /*
+ * function to create a daemon. Will fork and call setsid().
+ *
+ * Returns: -1 : fork failed
+ * 0 : No errors
+ */
+ NETSNMP_IMPORT
+ int netsnmp_daemonize(int quit_immediately, int stderr_log);
+
+ /*
+ * Definitions for the system dependent library file
+ *
+ * Do not define 'struct direct' when MSVC_PERL is defined because a
+ * structure with that name is also defined in the Perl header
+ * lib\CORE\dirent.h. Do not declare gettimeofday() either.
+ */
+#ifndef MSVC_PERL
+
+#ifndef HAVE_READDIR
+ /*
+ * structure of a directory entry
+ */
+ typedef struct direct {
+ long d_ino; /* inode number (not used by MS-DOS) */
+ int d_namlen; /* Name length */
+ char d_name[257]; /* file name */
+ } _DIRECT;
+
+ /*
+ * structure for dir operations
+ */
+ typedef struct _dir_struc {
+ char *start; /* Starting position */
+ char *curr; /* Current position */
+ long size; /* Size of string table */
+ long nfiles; /* number if filenames in table */
+ struct direct dirstr; /* Directory structure to return */
+ } DIR;
+
+ NETSNMP_IMPORT
+ DIR *opendir(const char *filename);
+ NETSNMP_IMPORT
+ struct direct *readdir(DIR * dirp);
+ NETSNMP_IMPORT
+ int closedir(DIR * dirp);
+#endif /* HAVE_READDIR */
+
+#ifndef HAVE_GETTIMEOFDAY
+ NETSNMP_IMPORT
+ int gettimeofday(struct timeval *, struct timezone *tz);
+#endif
+
+#endif /* MSVC_PERL */
+
+/*
+ * Note: when compiling Net-SNMP with dmalloc enabled on a system without
+ * strcasecmp() or strncasecmp(), the macro HAVE_STRNCASECMP is
+ * not defined but strcasecmp() and strncasecmp() are defined as macros in
+ * <dmalloc.h>. In order to prevent a compilation error, do not declare
+ * strcasecmp() or strncasecmp() when the <dmalloc.h> header has been included.
+ */
+#if !defined(HAVE_STRNCASECMP) && !defined(strcasecmp)
+ NETSNMP_IMPORT
+ int strcasecmp(const char *s1, const char *s2);
+#endif
+#if !defined(HAVE_STRNCASECMP) && !defined(strncasecmp)
+ NETSNMP_IMPORT
+ int strncasecmp(const char *s1, const char *s2, size_t n);
+#endif
+
+#ifdef WIN32
+ NETSNMP_IMPORT
+ char *winsock_startup(void);
+ NETSNMP_IMPORT
+ void winsock_cleanup(void);
+#define SOCK_STARTUP winsock_startup()
+#define SOCK_CLEANUP winsock_cleanup()
+#else /* !WIN32 */
+#define SOCK_STARTUP
+#define SOCK_CLEANUP
+#endif /* WIN32 */
+
+#include <net-snmp/types.h> /* For definition of in_addr_t */
+
+ /* Simply resolve a hostname and return first IPv4 address.
+ * Returns -1 on error */
+ NETSNMP_IMPORT
+ int netsnmp_gethostbyname_v4(const char* name,
+ in_addr_t *addr_out);
+
+ /** netsnmp versions of dns resoloution.. may include DNSSEC validation. */
+ struct addrinfo; /* forward declare */
+ NETSNMP_IMPORT
+ struct hostent *netsnmp_gethostbyname(const char *name);
+
+ NETSNMP_IMPORT
+ struct hostent *netsnmp_gethostbyaddr(const void *addr, socklen_t len,
+ int type);
+
+ NETSNMP_IMPORT
+ int netsnmp_getaddrinfo(const char *name, const char *service,
+ const struct addrinfo *hints,
+ struct addrinfo **res);
+
+ NETSNMP_IMPORT
+ in_addr_t get_myaddr(void);
+ NETSNMP_IMPORT
+ long get_uptime(void);
+
+#ifndef HAVE_STRDUP
+ char *strdup(const char *);
+#endif
+#ifndef HAVE_SETENV
+ NETSNMP_IMPORT
+ int setenv(const char *, const char *, int);
+#endif
+
+ NETSNMP_IMPORT
+ int calculate_time_diff(const struct timeval *,
+ const struct timeval *);
+ NETSNMP_IMPORT
+ u_int calculate_sectime_diff(const struct timeval *now,
+ const struct timeval *then);
+
+#ifndef HAVE_STRCASESTR
+ char *strcasestr(const char *, const char *);
+#endif
+#ifndef HAVE_STRTOL
+ long strtol(const char *, char **, int);
+#endif
+#ifndef HAVE_STRTOUL
+ unsigned long strtoul(const char *, char **, int);
+#endif
+#ifndef HAVE_STRTOULL
+ NETSNMP_IMPORT uint64_t strtoull(const char *, char **, int);
+#endif
+#ifndef HAVE_STRTOK_R
+ NETSNMP_IMPORT
+ char *strtok_r(char *, const char *, char **);
+#endif
+#ifndef HAVE_SNPRINTF
+ int snprintf(char *, size_t, const char *, ...);
+#endif
+
+ NETSNMP_IMPORT
+ int mkdirhier(const char *pathname, mode_t mode,
+ int skiplast);
+ NETSNMP_IMPORT
+ const char *netsnmp_mktemp(void);
+#ifndef HAVE_STRLCPY
+ NETSNMP_IMPORT
+ size_t strlcpy(char *, const char *, size_t);
+#endif
+#ifndef HAVE_STRLCAT
+ NETSNMP_IMPORT
+ size_t strlcat(char * __restrict, const char * __restrict,
+ size_t);
+#endif
+
+ int netsnmp_os_prematch(const char *ospmname,
+ const char *ospmrelprefix);
+ int netsnmp_os_kernel_width(void);
+
+ NETSNMP_IMPORT
+ int netsnmp_str_to_uid(const char *useroruid);
+ NETSNMP_IMPORT
+ int netsnmp_str_to_gid(const char *grouporgid);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMP_SYSTEM_H */
diff --git a/include/net-snmp/library/testing.h b/include/net-snmp/library/testing.h
new file mode 100644
index 0000000..ec6135a
--- /dev/null
+++ b/include/net-snmp/library/testing.h
@@ -0,0 +1,16 @@
+#ifndef NETSNMP_LIBRARY_TESTING_H
+#define NETSNMP_LIBRARY_TESTING_H
+
+/* These are macros used for the net-snmp testing infrastructure; see
+ the "testing" subdirectory of the source code for details. */
+
+static int __test_counter = 0;
+static int __did_plan = 0;
+
+#define OK(isok, description) do { printf("%s %d - %s\n", ((isok) ? "ok" : "not ok"), ++__test_counter, description); } while (0)
+
+#define OKF(isok, description) do { printf("%s %d - ", ((isok) ? "ok" : "not ok"), ++__test_counter); printf description; printf("\n"); } while (0)
+
+#define PLAN(number) do { printf("1..%d\n", number); __did_plan = 1; } while (0)
+
+#endif /* NETSNMP_LIBRARY_TESTING_H */
diff --git a/include/net-snmp/library/text_utils.h b/include/net-snmp/library/text_utils.h
new file mode 100644
index 0000000..864ca3f
--- /dev/null
+++ b/include/net-snmp/library/text_utils.h
@@ -0,0 +1,113 @@
+#ifndef NETSNMP_TEXT_UTILS_H
+#define NETSNMP_TEXT_UTILS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*------------------------------------------------------------------
+ *
+ * text file processing
+ *
+ */
+ netsnmp_container *
+ netsnmp_file_text_parse(netsnmp_file *f, netsnmp_container *cin,
+ int parse_mode, u_int flags, void *context);
+
+#define PM_SAVE_EVERYTHING 1
+#define PM_INDEX_STRING_STRING 2
+#define PM_USER_FUNCTION 3
+
+#define PM_FLAG_NO_CONTAINER 0x00000001
+#define PM_FLAG_SKIP_WHITESPACE 0x00000002
+
+
+ /*
+ * line processing user function
+ */
+ struct netsnmp_line_process_info_s; /* fwd decl */
+
+ typedef struct netsnmp_line_info_s {
+
+ size_t index;
+
+ char *line;
+ size_t line_len;
+ size_t line_max;
+
+ char *start;
+ size_t start_len;
+
+ } netsnmp_line_info;
+
+ typedef int (Netsnmp_Process_Text_Line)
+ (netsnmp_line_info *line_info, void *mem,
+ struct netsnmp_line_process_info_s* lpi);
+
+ typedef struct netsnmp_line_process_info_s {
+
+ size_t line_max; /* defaults to STRINGMAX if 0 */
+ size_t mem_size;
+
+ u_int flags;
+
+ Netsnmp_Process_Text_Line *process;
+
+ void *user_context;
+
+ } netsnmp_line_process_info;
+
+/*
+ * user function return codes
+ */
+#define PMLP_RC_STOP_PROCESSING -1
+#define PMLP_RC_MEMORY_USED 0
+#define PMLP_RC_MEMORY_UNUSED 1
+
+
+/** ALLOC_LINE: wasteful, but fast */
+#define PMLP_FLAG_ALLOC_LINE 0x00000001
+/** STRDUP_LINE: slower if you don't keep memory in most cases */
+#define PMLP_FLAG_STRDUP_LINE 0x00000002
+/** don't strip trailing newlines */
+#define PMLP_FLAG_LEAVE_NEWLINE 0x00000004
+/** don't skip blank or comment lines */
+#define PMLP_FLAG_PROCESS_WHITESPACE 0x00000008
+/** just process line, don't save it */
+#define PMLP_FLAG_NO_CONTAINER 0x00000010
+
+
+ /*
+ * a few useful pre-defined helpers
+ */
+
+ typedef struct netsnmp_token_value_index_s {
+
+ char *token;
+ netsnmp_cvalue value;
+ size_t index;
+
+ } netsnmp_token_value_index;
+
+ netsnmp_container *netsnmp_text_token_container_from_file(const char *file,
+ u_int flags,
+ netsnmp_container *c,
+ void *context);
+/*
+ * flags
+ */
+#define NSTTC_FLAG_TYPE_CONTEXT_DIRECT 0x00000001
+
+
+#define PMLP_TYPE_UNSIGNED 1
+#define PMLP_TYPE_INTEGER 2
+#define PMLP_TYPE_STRING 3
+#define PMLP_TYPE_BOOLEAN 4
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_TEXT_UTILS_H */
diff --git a/include/net-snmp/library/tools.h b/include/net-snmp/library/tools.h
new file mode 100644
index 0000000..b420c0f
--- /dev/null
+++ b/include/net-snmp/library/tools.h
@@ -0,0 +1,315 @@
+/**
+ * @file library/tools.h
+ * @defgroup util Memory Utility Routines
+ * @ingroup library
+ * @{
+ */
+
+#ifndef _TOOLS_H
+#define _TOOLS_H
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h> /* uintptr_t */
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+ /*
+ * General acros and constants.
+ */
+#ifdef WIN32
+# define SNMP_MAXPATH MAX_PATH
+#else
+# ifdef PATH_MAX
+# define SNMP_MAXPATH PATH_MAX
+# else
+# ifdef MAXPATHLEN
+# define SNMP_MAXPATH MAXPATHLEN
+# else
+# define SNMP_MAXPATH 1024 /* Should be safe enough */
+# endif
+# endif
+#endif
+
+#define SNMP_MAXBUF (1024 * 4)
+#define SNMP_MAXBUF_MEDIUM 1024
+#define SNMP_MAXBUF_SMALL 512
+
+#define SNMP_MAXBUF_MESSAGE 1500
+
+#define SNMP_MAXOID 64
+#define SNMP_MAX_CMDLINE_OIDS 128
+
+#define SNMP_FILEMODE_CLOSED 0600
+#define SNMP_FILEMODE_OPEN 0644
+
+#define BYTESIZE(bitsize) ((bitsize + 7) >> 3)
+#define ROUNDUP8(x) ( ( (x+7) >> 3 ) * 8 )
+
+#define SNMP_STRORNULL(x) ( x ? x : "(null)")
+
+/** @def SNMP_FREE(s)
+ Frees a pointer only if it is !NULL and sets its value to NULL */
+#define SNMP_FREE(s) do { if (s) { free((void *)s); s=NULL; } } while(0)
+
+/** @def SNMP_SWIPE_MEM(n, s)
+ Frees pointer n only if it is !NULL, sets n to s and sets s to NULL */
+#define SNMP_SWIPE_MEM(n,s) do { if (n) free((void *)n); n = s; s=NULL; } while(0)
+
+ /*
+ * XXX Not optimal everywhere.
+ */
+/** @def SNMP_MALLOC_STRUCT(s)
+ Mallocs memory of sizeof(struct s), zeros it and returns a pointer to it. */
+#define SNMP_MALLOC_STRUCT(s) (struct s *) calloc(1, sizeof(struct s))
+
+/** @def SNMP_MALLOC_TYPEDEF(t)
+ Mallocs memory of sizeof(t), zeros it and returns a pointer to it. */
+#define SNMP_MALLOC_TYPEDEF(td) (td *) calloc(1, sizeof(td))
+
+/** @def SNMP_ZERO(s,l)
+ Zeros l bytes of memory starting at s. */
+#define SNMP_ZERO(s,l) do { if (s) memset(s, 0, l); } while(0)
+
+
+/**
+ * @def NETSNMP_REMOVE_CONST(t, e)
+ *
+ * Cast away constness without that gcc -Wcast-qual prints a compiler warning,
+ * similar to const_cast<> in C++.
+ *
+ * @param[in] t A pointer type.
+ * @param[in] e An expression of a type that can be assigned to the type (const t).
+ */
+#if defined(__GNUC__)
+#define NETSNMP_REMOVE_CONST(t, e) \
+ (__extension__ ({ const t tmp = (e); (t)(uintptr_t)tmp; }))
+#else
+#define NETSNMP_REMOVE_CONST(t, e) ((t)(uintptr_t)(e))
+#endif
+
+
+#define TOUPPER(c) (c >= 'a' && c <= 'z' ? c - ('a' - 'A') : c)
+#define TOLOWER(c) (c >= 'A' && c <= 'Z' ? c + ('a' - 'A') : c)
+
+#define HEX2VAL(s) \
+ ((isalpha(s) ? (TOLOWER(s)-'a'+10) : (TOLOWER(s)-'0')) & 0xf)
+#define VAL2HEX(s) ( (s) + (((s) >= 10) ? ('a'-10) : '0') )
+
+
+/** @def SNMP_MAX(a, b)
+ Computers the maximum of a and b. */
+#define SNMP_MAX(a,b) ((a) > (b) ? (a) : (b))
+
+/** @def SNMP_MIN(a, b)
+ Computers the minimum of a and b. */
+#define SNMP_MIN(a,b) ((a) > (b) ? (b) : (a))
+
+/** @def SNMP_MACRO_VAL_TO_STR(s)
+ * Expands to string with value of the s.
+ * If s is macro, the resulting string is value of the macro.
+ * Example:
+ * \#define TEST 1234
+ * SNMP_MACRO_VAL_TO_STR(TEST) expands to "1234"
+ * SNMP_MACRO_VAL_TO_STR(TEST+1) expands to "1234+1"
+ */
+#define SNMP_MACRO_VAL_TO_STR(s) SNMP_MACRO_VAL_TO_STR_PRIV(s)
+#define SNMP_MACRO_VAL_TO_STR_PRIV(s) #s
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+ /*
+ * QUIT the FUNction:
+ * e Error code variable
+ * l Label to goto to cleanup and get out of the function.
+ *
+ * XXX It would be nice if the label could be constructed by the
+ * preprocessor in context. Limited to a single error return value.
+ * Temporary hack at best.
+ */
+#define QUITFUN(e, l) \
+ if ( (e) != SNMPERR_SUCCESS) { \
+ rval = SNMPERR_GENERR; \
+ goto l ; \
+ }
+
+ /*
+ * DIFFTIMEVAL
+ * Set <diff> to the difference between <now> (current) and <then> (past).
+ *
+ * ASSUMES that all inputs are (struct timeval)'s.
+ * Cf. system.c:calculate_time_diff().
+ */
+#define DIFFTIMEVAL(now, then, diff) \
+{ \
+ now.tv_sec--; \
+ now.tv_usec += 1000000L; \
+ diff.tv_sec = now.tv_sec - then.tv_sec; \
+ diff.tv_usec = now.tv_usec - then.tv_usec; \
+ if (diff.tv_usec > 1000000L){ \
+ diff.tv_usec -= 1000000L; \
+ diff.tv_sec++; \
+ } \
+}
+
+/**
+ * Compute res = a + b.
+ *
+ * @pre a and b must be normalized 'struct timeval' values.
+ *
+ * @note res may be the same variable as one of the operands. In other
+ * words, &a == &res || &b == &res may hold.
+ */
+#define NETSNMP_TIMERADD(a, b, res) \
+{ \
+ (res)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
+ (res)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
+ if ((res)->tv_usec >= 1000000L) { \
+ (res)->tv_usec -= 1000000L; \
+ (res)->tv_sec++; \
+ } \
+}
+
+/**
+ * Compute res = a - b.
+ *
+ * @pre a and b must be normalized 'struct timeval' values.
+ *
+ * @note res may be the same variable as one of the operands. In other
+ * words, &a == &res || &b == &res may hold.
+ */
+#define NETSNMP_TIMERSUB(a, b, res) \
+{ \
+ (res)->tv_sec = (a)->tv_sec - (b)->tv_sec - 1; \
+ (res)->tv_usec = (a)->tv_usec - (b)->tv_usec + 1000000L; \
+ if ((res)->tv_usec >= 1000000L) { \
+ (res)->tv_usec -= 1000000L; \
+ (res)->tv_sec++; \
+ } \
+}
+
+
+ /*
+ * ISTRANSFORM
+ * ASSUMES the minimum length for ttype and toid.
+ */
+#define USM_LENGTH_OID_TRANSFORM 10
+
+#define ISTRANSFORM(ttype, toid) \
+ !snmp_oid_compare(ttype, USM_LENGTH_OID_TRANSFORM, \
+ usm ## toid ## Protocol, USM_LENGTH_OID_TRANSFORM)
+
+#define ENGINETIME_MAX 2147483647 /* ((2^31)-1) */
+#define ENGINEBOOT_MAX 2147483647 /* ((2^31)-1) */
+
+
+
+
+ /*
+ * Prototypes.
+ */
+
+ NETSNMP_IMPORT
+ int snmp_realloc(u_char ** buf, size_t * buf_len);
+
+ void free_zero(void *buf, size_t size);
+
+ u_char *malloc_random(size_t * size);
+ u_char *malloc_zero(size_t size);
+ NETSNMP_IMPORT
+ int memdup(u_char ** to, const void * from, size_t size);
+
+ void netsnmp_check_definedness(const void *packet,
+ size_t length);
+
+ NETSNMP_IMPORT
+ u_int netsnmp_binary_to_hex(u_char ** dest, size_t *dest_len,
+ int allow_realloc,
+ const u_char * input, size_t len);
+
+ NETSNMP_IMPORT
+ u_int binary_to_hex(const u_char * input, size_t len,
+ char **output);
+ /* preferred */
+ int netsnmp_hex_to_binary(u_char ** buf, size_t * buf_len,
+ size_t * offset, int allow_realloc,
+ const char *hex, const char *delim);
+ /* calls netsnmp_hex_to_binary w/delim of " " */
+ NETSNMP_IMPORT
+ int snmp_hex_to_binary(u_char ** buf, size_t * buf_len,
+ size_t * offset, int allow_realloc,
+ const char *hex);
+ /* handles odd lengths */
+ NETSNMP_IMPORT
+ int hex_to_binary2(const u_char * input, size_t len,
+ char **output);
+
+ NETSNMP_IMPORT
+ int snmp_decimal_to_binary(u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ const char *decimal);
+#define snmp_cstrcat(b,l,o,a,s) snmp_strcat(b,l,o,a,(const u_char *)s)
+ NETSNMP_IMPORT
+ int snmp_strcat(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const u_char * s);
+ NETSNMP_IMPORT
+ char *netsnmp_strdup_and_null(const u_char * from,
+ size_t from_len);
+
+ NETSNMP_IMPORT
+ void dump_chunk(const char *debugtoken, const char *title,
+ const u_char * buf, int size);
+ char *dump_snmpEngineID(const u_char * buf, size_t * buflen);
+
+ /** A pointer to an opaque time marker value. */
+ typedef void *marker_t;
+ typedef const void* const_marker_t;
+
+ NETSNMP_IMPORT
+ marker_t atime_newMarker(void);
+ NETSNMP_IMPORT
+ void atime_setMarker(marker_t pm);
+ NETSNMP_IMPORT
+ void netsnmp_get_monotonic_clock(struct timeval* tv);
+ NETSNMP_IMPORT
+ void netsnmp_set_monotonic_marker(marker_t *pm);
+ NETSNMP_IMPORT
+ long atime_diff(const_marker_t first, const_marker_t second);
+ u_long uatime_diff(const_marker_t first, const_marker_t second); /* 1/1000th sec */
+ NETSNMP_IMPORT
+ u_long uatime_hdiff(const_marker_t first, const_marker_t second); /* 1/100th sec */
+ NETSNMP_IMPORT
+ int atime_ready(const_marker_t pm, int delta_ms);
+ NETSNMP_IMPORT
+ int netsnmp_ready_monotonic(const_marker_t pm, int delta_ms);
+ int uatime_ready(const_marker_t pm, unsigned int delta_ms);
+
+ int marker_tticks(const_marker_t pm);
+ int timeval_tticks(const struct timeval *tv);
+ NETSNMP_IMPORT
+ char *netsnmp_getenv(const char *name);
+ NETSNMP_IMPORT
+ int netsnmp_setenv(const char *envname, const char *envval,
+ int overwrite);
+
+ int netsnmp_addrstr_hton(char *ptr, size_t len);
+
+ NETSNMP_IMPORT
+ int netsnmp_string_time_to_secs(const char *time_string);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _TOOLS_H */
+/* @} */
diff --git a/include/net-snmp/library/transform_oids.h b/include/net-snmp/library/transform_oids.h
new file mode 100644
index 0000000..61bc338
--- /dev/null
+++ b/include/net-snmp/library/transform_oids.h
@@ -0,0 +1,39 @@
+#ifndef _net_snmp_transform_oids_h
+#define _net_snmp_transform_oids_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * transform_oids.h
+ *
+ * Numeric MIB names for auth and priv transforms.
+ */
+
+NETSNMP_IMPORT oid usmNoAuthProtocol[10]; /* == { 1,3,6,1,6,3,10,1,1,1 }; */
+#ifndef NETSNMP_DISABLE_MD5
+NETSNMP_IMPORT oid usmHMACMD5AuthProtocol[10]; /* == { 1,3,6,1,6,3,10,1,1,2 }; */
+#endif
+NETSNMP_IMPORT oid usmHMACSHA1AuthProtocol[10]; /* == { 1,3,6,1,6,3,10,1,1,3 }; */
+NETSNMP_IMPORT oid usmNoPrivProtocol[10]; /* == { 1,3,6,1,6,3,10,1,2,1 }; */
+#ifndef NETSNMP_DISABLE_DES
+NETSNMP_IMPORT oid usmDESPrivProtocol[10]; /* == { 1,3,6,1,6,3,10,1,2,2 }; */
+#endif
+
+/* XXX: OIDs not defined yet */
+NETSNMP_IMPORT oid usmAESPrivProtocol[10]; /* == { 1,3,6,1,6,3,10,1,2,4 }; */
+NETSNMP_IMPORT oid *usmAES128PrivProtocol; /* backwards compat */
+
+#define USM_AUTH_PROTO_NOAUTH_LEN 10
+#define USM_AUTH_PROTO_MD5_LEN 10
+#define USM_AUTH_PROTO_SHA_LEN 10
+#define USM_PRIV_PROTO_NOPRIV_LEN 10
+#define USM_PRIV_PROTO_DES_LEN 10
+
+#define USM_PRIV_PROTO_AES_LEN 10
+#define USM_PRIV_PROTO_AES128_LEN 10 /* backwards compat */
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/net-snmp/library/types.h b/include/net-snmp/library/types.h
new file mode 100644
index 0000000..0174291
--- /dev/null
+++ b/include/net-snmp/library/types.h
@@ -0,0 +1,70 @@
+#ifndef NET_SNMP_LIBRARY_TYPES_H
+#define NET_SNMP_LIBRARY_TYPES_H
+
+#ifndef NET_SNMP_CONFIG_H
+#error "Please include <net-snmp/net-snmp-config.h> before this file"
+#endif
+
+
+#include <net-snmp/types.h>
+
+
+typedef struct netsnmp_index_s {
+ size_t len;
+ oid *oids;
+} netsnmp_index;
+
+typedef struct netsnmp_void_array_s {
+ size_t size;
+ void **array;
+} netsnmp_void_array;
+
+/*
+ * references to various types
+ */
+typedef struct netsnmp_ref_void {
+ void *val;
+} netsnmp_ref_void;
+
+typedef union {
+ u_long ul;
+ u_int ui;
+ u_short us;
+ u_char uc;
+ long sl;
+ int si;
+ short ss;
+ char sc;
+ char *cp;
+ void *vp;
+} netsnmp_cvalue;
+
+typedef struct netsnmp_ref_size_t_s {
+ size_t val;
+} *netsnmp_ref_size_t;
+
+/*
+ * Structure for holding a set of file descriptors, similar to fd_set.
+ *
+ * This structure however can hold so-called large file descriptors
+ * (>= FD_SETSIZE or 1024) on Unix systems or more than FD_SETSIZE (64)
+ * sockets on Windows systems.
+ *
+ * It is safe to allocate this structure on the stack.
+ *
+ * This structure must be initialized by calling netsnmp_large_fd_set_init()
+ * and must be cleaned up via netsnmp_large_fd_set_cleanup(). If this last
+ * function is not called this may result in a memory leak.
+ *
+ * The members of this structure are:
+ * lfs_setsize: maximum set size.
+ * lsf_setptr: points to lfs_set if lfs_setsize <= FD_SETSIZE, and otherwise
+ * to dynamically allocated memory.
+ * lfs_set: file descriptor / socket set data if lfs_setsize <= FD_SETSIZE.
+ */
+typedef struct netsnmp_large_fd_set_s {
+ unsigned lfs_setsize;
+ fd_set *lfs_setptr;
+ fd_set lfs_set;
+} netsnmp_large_fd_set;
+#endif /* NET_SNMP_LIBRARY_TYPES_H */
diff --git a/include/net-snmp/library/ucd_compat.h b/include/net-snmp/library/ucd_compat.h
new file mode 100644
index 0000000..329d435
--- /dev/null
+++ b/include/net-snmp/library/ucd_compat.h
@@ -0,0 +1,51 @@
+/*
+ * UCD compatability definitions & declarations
+ *
+ */
+
+#ifndef NET_SNMP_UCD_COMPAT_H
+#define NET_SNMP_UCD_COMPAT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * from snmp_api.h
+ */
+NETSNMP_IMPORT
+void snmp_set_dump_packet(int);
+NETSNMP_IMPORT
+int snmp_get_dump_packet(void);
+NETSNMP_IMPORT
+void snmp_set_quick_print(int);
+NETSNMP_IMPORT
+int snmp_get_quick_print(void);
+NETSNMP_IMPORT
+void snmp_set_suffix_only(int);
+NETSNMP_IMPORT
+int snmp_get_suffix_only(void);
+NETSNMP_IMPORT
+void snmp_set_full_objid(int);
+int snmp_get_full_objid(void);
+NETSNMP_IMPORT
+void snmp_set_random_access(int);
+NETSNMP_IMPORT
+int snmp_get_random_access(void);
+
+ /*
+ * from parse.h
+ */
+NETSNMP_IMPORT
+void snmp_set_mib_warnings(int);
+NETSNMP_IMPORT
+void snmp_set_mib_errors(int);
+NETSNMP_IMPORT
+void snmp_set_save_descriptions(int);
+void snmp_set_mib_comment_term(int);
+void snmp_set_mib_parse_label(int);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* NET_SNMP_UCD_COMPAT_H */
diff --git a/include/net-snmp/library/vacm.h b/include/net-snmp/library/vacm.h
new file mode 100644
index 0000000..a5be6ac
--- /dev/null
+++ b/include/net-snmp/library/vacm.h
@@ -0,0 +1,266 @@
+/*
+ * vacm.h
+ *
+ * SNMPv3 View-based Access Control Model
+ */
+
+#ifndef VACM_H
+#define VACM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define VACM_SUCCESS 0
+#define VACM_NOSECNAME 1
+#define VACM_NOGROUP 2
+#define VACM_NOACCESS 3
+#define VACM_NOVIEW 4
+#define VACM_NOTINVIEW 5
+#define VACM_NOSUCHCONTEXT 6
+#define VACM_SUBTREE_UNKNOWN 7
+
+#define SECURITYMODEL 1
+#define SECURITYNAME 2
+#define SECURITYGROUP 3
+#define SECURITYSTORAGE 4
+#define SECURITYSTATUS 5
+
+#define ACCESSPREFIX 1
+#define ACCESSMODEL 2
+#define ACCESSLEVEL 3
+#define ACCESSMATCH 4
+#define ACCESSREAD 5
+#define ACCESSWRITE 6
+#define ACCESSNOTIFY 7
+#define ACCESSSTORAGE 8
+#define ACCESSSTATUS 9
+
+#define VACMVIEWSPINLOCK 1
+#define VIEWNAME 2
+#define VIEWSUBTREE 3
+#define VIEWMASK 4
+#define VIEWTYPE 5
+#define VIEWSTORAGE 6
+#define VIEWSTATUS 7
+
+#define VACM_MAX_STRING 32
+#define VACMSTRINGLEN 34 /* VACM_MAX_STRING + 2 */
+
+ struct vacm_groupEntry {
+ int securityModel;
+ char securityName[VACMSTRINGLEN];
+ char groupName[VACMSTRINGLEN];
+ int storageType;
+ int status;
+
+ u_long bitMask;
+ struct vacm_groupEntry *reserved;
+ struct vacm_groupEntry *next;
+ };
+
+#define CONTEXT_MATCH_EXACT 1
+#define CONTEXT_MATCH_PREFIX 2
+
+/* VIEW ENUMS ---------------------------------------- */
+
+/* SNMPD usage: get/set/send-notification views */
+#define VACM_VIEW_READ 0
+#define VACM_VIEW_WRITE 1
+#define VACM_VIEW_NOTIFY 2
+
+/* SNMPTRAPD usage: log execute and net-access (forward) usage */
+#define VACM_VIEW_LOG 3
+#define VACM_VIEW_EXECUTE 4
+#define VACM_VIEW_NET 5
+
+/* VIEW BIT MASK VALUES-------------------------------- */
+
+/* SNMPD usage: get/set/send-notification views */
+#define VACM_VIEW_READ_BIT (1 << VACM_VIEW_READ)
+#define VACM_VIEW_WRITE_BIT (1 << VACM_VIEW_WRITE)
+#define VACM_VIEW_NOTIFY_BIT (1 << VACM_VIEW_NOTIFY)
+
+/* SNMPTRAPD usage: log execute and net-access (forward) usage */
+#define VACM_VIEW_LOG_BIT (1 << VACM_VIEW_LOG)
+#define VACM_VIEW_EXECUTE_BIT (1 << VACM_VIEW_EXECUTE)
+#define VACM_VIEW_NET_BIT (1 << VACM_VIEW_NET)
+
+#define VACM_VIEW_NO_BITS 0
+
+/* Maximum number of views in the view array */
+#define VACM_MAX_VIEWS 8
+
+#define VACM_VIEW_ENUM_NAME "vacmviews"
+
+ void init_vacm(void);
+
+ struct vacm_accessEntry {
+ char groupName[VACMSTRINGLEN];
+ char contextPrefix[VACMSTRINGLEN];
+ int securityModel;
+ int securityLevel;
+ int contextMatch;
+ char views[VACM_MAX_VIEWS][VACMSTRINGLEN];
+ int storageType;
+ int status;
+
+ u_long bitMask;
+ struct vacm_accessEntry *reserved;
+ struct vacm_accessEntry *next;
+ };
+
+ struct vacm_viewEntry {
+ char viewName[VACMSTRINGLEN];
+ oid viewSubtree[MAX_OID_LEN];
+ size_t viewSubtreeLen;
+ u_char viewMask[VACMSTRINGLEN];
+ size_t viewMaskLen;
+ int viewType;
+ int viewStorageType;
+ int viewStatus;
+
+ u_long bitMask;
+
+ struct vacm_viewEntry *reserved;
+ struct vacm_viewEntry *next;
+ };
+
+ NETSNMP_IMPORT
+ void vacm_destroyViewEntry(const char *, oid *, size_t);
+ NETSNMP_IMPORT
+ void vacm_destroyAllViewEntries(void);
+
+#define VACM_MODE_FIND 0
+#define VACM_MODE_IGNORE_MASK 1
+#define VACM_MODE_CHECK_SUBTREE 2
+ NETSNMP_IMPORT
+ struct vacm_viewEntry *vacm_getViewEntry(const char *, oid *, size_t,
+ int);
+ /*
+ * Returns a pointer to the viewEntry with the
+ * same viewName and viewSubtree
+ * Returns NULL if that entry does not exist.
+ */
+
+ NETSNMP_IMPORT
+ int vacm_checkSubtree(const char *, oid *, size_t);
+
+ /*
+ * Check to see if everything within a subtree is in view, not in view,
+ * or possibly both.
+ *
+ * Returns:
+ * VACM_SUCCESS The OID is included in the view.
+ * VACM_NOTINVIEW If no entry in the view list includes the
+ * provided OID, or the OID is explicitly excluded
+ * from the view.
+ * VACM_SUBTREE_UNKNOWN The entire subtree has both allowed and
+ * disallowed portions.
+ */
+
+ NETSNMP_IMPORT
+ void
+ vacm_scanViewInit(void);
+ /*
+ * Initialized the scan routines so that they will begin at the
+ * beginning of the list of viewEntries.
+ *
+ */
+
+
+ NETSNMP_IMPORT
+ struct vacm_viewEntry *vacm_scanViewNext(void);
+ /*
+ * Returns a pointer to the next viewEntry.
+ * These entries are returned in no particular order,
+ * but if N entries exist, N calls to view_scanNext() will
+ * return all N entries once.
+ * Returns NULL if all entries have been returned.
+ * view_scanInit() starts the scan over.
+ */
+
+ NETSNMP_IMPORT
+ struct vacm_viewEntry *vacm_createViewEntry(const char *, oid *,
+ size_t);
+ /*
+ * Creates a viewEntry with the given index
+ * and returns a pointer to it.
+ * The status of this entry is created as invalid.
+ */
+
+ NETSNMP_IMPORT
+ void vacm_destroyGroupEntry(int, const char *);
+ NETSNMP_IMPORT
+ void vacm_destroyAllGroupEntries(void);
+ NETSNMP_IMPORT
+ struct vacm_groupEntry *vacm_createGroupEntry(int, const char *);
+ NETSNMP_IMPORT
+ struct vacm_groupEntry *vacm_getGroupEntry(int, const char *);
+ NETSNMP_IMPORT
+ void vacm_scanGroupInit(void);
+ NETSNMP_IMPORT
+ struct vacm_groupEntry *vacm_scanGroupNext(void);
+
+ NETSNMP_IMPORT
+ void vacm_destroyAccessEntry(const char *, const char *,
+ int, int);
+ NETSNMP_IMPORT
+ void vacm_destroyAllAccessEntries(void);
+ NETSNMP_IMPORT
+ struct vacm_accessEntry *vacm_createAccessEntry(const char *,
+ const char *, int,
+ int);
+ NETSNMP_IMPORT
+ struct vacm_accessEntry *vacm_getAccessEntry(const char *,
+ const char *, int, int);
+ NETSNMP_IMPORT
+ void vacm_scanAccessInit(void);
+ NETSNMP_IMPORT
+ struct vacm_accessEntry *vacm_scanAccessNext(void);
+
+ void vacm_destroySecurityEntry(const char *);
+ struct vacm_securityEntry *vacm_createSecurityEntry(const char *);
+ struct vacm_securityEntry *vacm_getSecurityEntry(const char *);
+ void vacm_scanSecurityInit(void);
+ struct vacm_securityEntry *vacm_scanSecurityEntry(void);
+ NETSNMP_IMPORT
+ int vacm_is_configured(void);
+
+ void vacm_save(const char *token, const char *type);
+ void vacm_save_view(struct vacm_viewEntry *view,
+ const char *token, const char *type);
+ void vacm_save_access(struct vacm_accessEntry *access_entry,
+ const char *token, const char *type);
+ void vacm_save_auth_access(struct vacm_accessEntry *access_entry,
+ const char *token, const char *type, int authtype);
+ void vacm_save_group(struct vacm_groupEntry *group_entry,
+ const char *token, const char *type);
+
+ NETSNMP_IMPORT
+ void vacm_parse_config_view(const char *token, const char *line);
+ NETSNMP_IMPORT
+ void vacm_parse_config_group(const char *token,
+ const char *line);
+ NETSNMP_IMPORT
+ void vacm_parse_config_access(const char *token,
+ const char *line);
+ NETSNMP_IMPORT
+ void vacm_parse_config_auth_access(const char *token,
+ const char *line);
+
+ NETSNMP_IMPORT
+ int store_vacm(int majorID, int minorID, void *serverarg,
+ void *clientarg);
+
+ NETSNMP_IMPORT
+ struct vacm_viewEntry *netsnmp_view_get(struct vacm_viewEntry *head,
+ const char *viewName,
+ oid * viewSubtree,
+ size_t viewSubtreeLen, int mode);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* VACM_H */
diff --git a/include/net-snmp/library/winpipe.h b/include/net-snmp/library/winpipe.h
new file mode 100644
index 0000000..90fd723
--- /dev/null
+++ b/include/net-snmp/library/winpipe.h
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) Fabasoft R&D Software GmbH & Co KG, 2003
+ oss@fabasoft.com
+ Author: Bernhard Penz <bernhard.penz@fabasoft.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * The name of Fabasoft R&D Software GmbH & Co KG or any of its subsidiaries,
+ brand or product names may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifdef WIN32
+
+#ifndef WINPIPE_H
+#define WINPIPE_H
+
+NETSNMP_IMPORT
+int create_winpipe_transport(int *pipefds);
+
+#endif
+
+#endif
+
diff --git a/include/net-snmp/library/winservice.h b/include/net-snmp/library/winservice.h
new file mode 100644
index 0000000..76080d6
--- /dev/null
+++ b/include/net-snmp/library/winservice.h
@@ -0,0 +1,159 @@
+#ifndef WINSERVICE_H
+#define WINSERVICE_H
+
+ /*
+ *
+ * Windows Service related functions declaration
+ * By Raju Krishanppa(raju_krishnappa@yahoo.com)
+ *
+ */
+
+#ifdef __cplusplus
+extern "C"
+{
+
+#endif /* */
+
+ /*
+ * Define Constants for Register, De-register , Run As service or Console mode
+ */
+#define REGISTER_SERVICE 0
+#define UN_REGISTER_SERVICE 1
+#define RUN_AS_SERVICE 2
+#define RUN_AS_CONSOLE 3
+
+
+ /*
+ * Error levels returned when registering or unregistering the service
+ */
+#define SERVICE_ERROR_NONE 0
+#define SERVICE_ERROR_SCM_OPEN 1 /* Can not open SCM */
+#define SERVICE_ERROR_CREATE_SERVICE 2 /* Can not create service */
+#define SERVICE_ERROR_CREATE_REGISTRY_ENTRIES 3 /* Can not create registry entries */
+#define SERVICE_ERROR_OPEN_SERVICE 4 /* Can not open service (service does not exist) */
+
+ /*
+ * Define Message catalog ID
+ * MessageId: DISPLAY_MSG
+ * MessageText: %1.
+ */
+#define DISPLAY_MSG 0x00000064L
+
+ /*
+ * Hint Value to SCM to wait before sending successive commands to service
+ */
+#define SCM_WAIT_INTERVAL 7000
+
+ /*
+ * Define Generic String Size, to hold Error or Information
+ */
+#define MAX_STR_SIZE 1024
+
+ /*
+ * Delcare Global variables, which are visible to other modules
+ */
+ extern BOOL g_fRunningAsService;
+
+ /*
+ * Input parameter structure to thread
+ */
+ typedef struct _InputParams
+ {
+ DWORD Argc;
+ LPTSTR *Argv;
+ } InputParams;
+
+ /*
+ * Define Service Related functions
+ */
+
+ /*
+ * To register application as windows service with SCM
+ */
+ int RegisterService (LPCTSTR lpszServiceName,
+ LPCTSTR lpszServiceDisplayName,
+ LPCTSTR lpszServiceDescription, InputParams * StartUpArg, int quiet);
+
+ /*
+ * To unregister service
+ */
+ int UnregisterService (LPCTSTR lpszServiceName, int quiet);
+
+ /*
+ * To parse command line for startup option
+ */
+ INT ParseCmdLineForServiceOption (INT argc, TCHAR * argv[], int *quiet);
+
+ /*
+ * To write to windows event log
+ */
+ VOID WriteToEventLog (WORD wType, LPCTSTR pszFormat, ...);
+
+ /*
+ * To display generic windows error
+ */
+ VOID DisplayError (LPCTSTR pszTitle, int quite);
+
+ /*
+ * Service Main function, Which will spawn a thread, and calls the
+ * Service run part
+ */
+ VOID WINAPI ServiceMain (DWORD argc, LPTSTR argv[]);
+
+ /*
+ * To start Service
+ */
+
+ BOOL RunAsService (INT (*ServiceFunction) (INT, LPTSTR *));
+
+ /*
+ * Call back function to process SCM Requests
+ */
+ VOID WINAPI ControlHandler (DWORD dwControl);
+
+ /*
+ * To Stop the service
+ */
+ VOID ProcessServiceStop (VOID);
+
+ /*
+ * To Pause service
+ */
+ VOID ProcessServicePause (VOID);
+
+ /*
+ * To Continue paused service
+ */
+ VOID ProcessServiceContinue (VOID);
+
+ /*
+ * To send Current Service status to SCM when INTERROGATE command is sent
+ */
+ VOID ProcessServiceInterrogate (VOID);
+
+ /*
+ * To allocate and Set security descriptor
+ */
+ BOOL SetSimpleSecurityAttributes (SECURITY_ATTRIBUTES * pSecurityAttr);
+
+ /*
+ * To free Security Descriptor
+ */
+ VOID FreeSecurityAttributes (SECURITY_ATTRIBUTES * pSecurityAttr);
+
+ /*
+ * TheadFunction - To spawan as thread - Invokes registered service function
+ */
+ unsigned WINAPI ThreadFunction (LPVOID lpParam);
+
+ /*
+ * Service STOP function registration with this framewrok
+ * * this function must be invoked before calling RunAsService
+ */
+ VOID RegisterStopFunction (VOID (*StopFunc) (VOID));
+
+#ifdef __cplusplus
+}
+#endif /* */
+#endif /* WINSERVICE_H */
+
diff --git a/include/net-snmp/machine/generic.h b/include/net-snmp/machine/generic.h
new file mode 100644
index 0000000..ddfbe3a
--- /dev/null
+++ b/include/net-snmp/machine/generic.h
@@ -0,0 +1,3 @@
+/*
+ * chip specific definitions go here
+ */
diff --git a/include/net-snmp/mib_api.h b/include/net-snmp/mib_api.h
new file mode 100644
index 0000000..3b54e83
--- /dev/null
+++ b/include/net-snmp/mib_api.h
@@ -0,0 +1,113 @@
+#ifndef NET_SNMP_MIB_API_H
+#define NET_SNMP_MIB_API_H
+
+ /**
+ * Library API routines concerned with MIB files and objects, and OIDs
+ */
+
+#include <net-snmp/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Initialisation and Shutdown */
+ NETSNMP_IMPORT
+ int add_mibdir(const char *);
+
+ NETSNMP_IMPORT
+ void netsnmp_init_mib(void);
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+ NETSNMP_IMPORT
+ void init_mib(void);
+ NETSNMP_IMPORT
+ void init_mib_internals(void);
+#endif
+ NETSNMP_IMPORT
+ void shutdown_mib(void);
+
+ /* Reading and Parsing MIBs */
+ NETSNMP_IMPORT
+ struct tree *netsnmp_read_module(const char *);
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+ NETSNMP_IMPORT
+ struct tree *read_module(const char *);
+#endif
+
+ NETSNMP_IMPORT
+ struct tree *read_mib(const char *);
+ NETSNMP_IMPORT
+ struct tree *read_all_mibs(void);
+
+ NETSNMP_IMPORT
+ void add_module_replacement(const char *, const char *,
+ const char *, int);
+
+ /* from ucd-compat.h */
+ NETSNMP_IMPORT
+ void snmp_set_mib_warnings(int);
+ NETSNMP_IMPORT
+ void snmp_set_mib_errors(int);
+ NETSNMP_IMPORT
+ void snmp_set_save_descriptions(int);
+
+
+ /* Searching the MIB Tree */
+ NETSNMP_IMPORT
+ int read_objid(const char *, oid *, size_t *);
+ NETSNMP_IMPORT
+ oid *snmp_parse_oid(const char *, oid *, size_t *);
+ NETSNMP_IMPORT
+ int get_module_node(const char *, const char *, oid *, size_t *);
+
+ /* Output */
+ NETSNMP_IMPORT
+ void print_mib(FILE * fp);
+
+ NETSNMP_IMPORT
+ void print_objid(const oid * objid, size_t objidlen);
+ NETSNMP_IMPORT
+ void fprint_objid(FILE * fp,
+ const oid * objid, size_t objidlen);
+ NETSNMP_IMPORT
+ int snprint_objid(char *buf, size_t buf_len,
+ const oid * objid, size_t objidlen);
+
+ NETSNMP_IMPORT
+ void print_description(oid * objid, size_t objidlen, int width);
+ NETSNMP_IMPORT
+ void fprint_description(FILE * fp,
+ oid * objid, size_t objidlen, int width);
+ NETSNMP_IMPORT
+ int snprint_description(char *buf, size_t buf_len,
+ oid * objid, size_t objidlen, int width);
+
+#ifdef __cplusplus
+}
+#endif
+
+ /*
+ * Having extracted the main ("public API") calls relevant
+ * to this area of the Net-SNMP project, the next step is to
+ * identify the related "public internal API" routines.
+ *
+ * In due course, these should probably be gathered
+ * together into a companion 'library/mib_api.h' header file.
+ * [Or some suitable name]
+ *
+ * But for the time being, the expectation is that the
+ * traditional headers that provided the above definitions
+ * will probably also cover the relevant internal API calls.
+ * Hence they are listed here:
+ */
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/mib.h>
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+#include <net-snmp/library/parse.h>
+#endif
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/oid_stash.h>
+#include <net-snmp/library/ucd_compat.h>
+
+#endif /* NET_SNMP_MIB_API_H */
diff --git a/include/net-snmp/net-snmp-config.h.in b/include/net-snmp/net-snmp-config.h.in
new file mode 100644
index 0000000..ff30b46
--- /dev/null
+++ b/include/net-snmp/net-snmp-config.h.in
@@ -0,0 +1,2442 @@
+/* include/net-snmp/net-snmp-config.h.in. Generated from configure.ac by autoheader. */
+/*
+ * net-snmp configuration header file
+ *
+ * NOTE: DO NOT EDIT include/net-snmp/net-snmp-config.h.in as your changes
+ * will be overwritten. This content is in acconfig.h and merged
+ * into include/net-snmp/net-snmp-config.h.in by autoheader.
+ */
+/* 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.
+ */
+
+#ifndef NET_SNMP_CONFIG_H
+#define NET_SNMP_CONFIG_H
+
+
+/* ********* NETSNMP_MARK_BEGIN_AUTOCONF_DEFINITIONS ********* */
+/*
+ * put all autoconf-specific definitions below here
+ *
+ */
+#ifndef NETSNMP_NO_AUTOCONF_DEFINITIONS
+
+
+#if defined (WIN32) || defined (mingw32) || defined (cygwin)
+#define ENV_SEPARATOR ";"
+#define ENV_SEPARATOR_CHAR ';'
+#else
+#define ENV_SEPARATOR ":"
+#define ENV_SEPARATOR_CHAR ':'
+#endif
+
+/* definitions added by configure on-the-fly */
+
+#define config_belongs_in(x)
+
+#define config_exclude(x)
+
+#define config_arch_require(x,y)
+
+#define config_version_require(x)
+
+#define config_require(x)
+
+#define config_add_mib(x)
+
+#define config_parse_dot_conf(w,x,y,z)
+
+#define config_error(x)
+
+#define config_warning(x)
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* location of swap device */
+#undef DMEM_LOC
+
+/* Define if you want local DNSSEC validation support */
+#undef DNSSEC_LOCAL_VALIDATION
+
+/* location of mount table list */
+#undef ETC_MNTTAB
+
+/* Define to 1 if you have the `AES_cfb128_encrypt' function. */
+#undef HAVE_AES_CFB128_ENCRYPT
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the <asm/page.h> header file. */
+#undef HAVE_ASM_PAGE_H
+
+/* Define to 1 if you have the <asm/types.h> header file. */
+#undef HAVE_ASM_TYPES_H
+
+/* Define if using MY_INIT() causes a linker error */
+#undef HAVE_BROKEN_LIBMYSQLCLIENT
+
+/* Define to 1 if you have the `cgetnext' function. */
+#undef HAVE_CGETNEXT
+
+/* Define to 1 if you have the `chown' function. */
+#undef HAVE_CHOWN
+
+/* Define to 1 if you have the `clock_gettime' library */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the `closedir' function. */
+#undef HAVE_CLOSEDIR
+
+/* Define to 1 if the system has the type `Counter64'. */
+#undef HAVE_COUNTER64
+
+/* Define to 1 if you have the declaration of `sensors_get_all_subfeatures',
+ and to 0 if you don't. */
+#undef HAVE_DECL_SENSORS_GET_ALL_SUBFEATURES
+
+/* define to 1 if you have IRE_CACHE defined in <inet/ip.h> header file. */
+#undef HAVE_DEFINED_IRE_CACHE
+
+/* define if you have devstat_getdevs() */
+#undef HAVE_DEVSTAT_GETDEVS
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `dlopen' function. */
+#undef HAVE_DLOPEN
+
+/* Define to 1 if you have the <dmalloc.h> header file. */
+#undef HAVE_DMALLOC_H
+
+/* Set if the dpkg-query command is available */
+#undef HAVE_DPKG_QUERY
+
+/* Define to 1 if you have the <err.h> header file. */
+#undef HAVE_ERR_H
+
+/* Define to 1 if you have the `eval_pv' function. */
+#undef HAVE_EVAL_PV
+
+/* Define to 1 if you have the `EVP_MD_CTX_create' function. */
+#undef HAVE_EVP_MD_CTX_CREATE
+
+/* Define to 1 if you have the `EVP_MD_CTX_destroy' function. */
+#undef HAVE_EVP_MD_CTX_DESTROY
+
+/* Define if you have EVP_sha224/256 in openssl */
+#undef HAVE_EVP_SHA224
+
+/* Define if you have EVP_sha384/256 in openssl */
+#undef HAVE_EVP_SHA384
+
+/* Define to 1 if you have the `execv' function. */
+#undef HAVE_EXECV
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `fgetc_unlocked' function. */
+#undef HAVE_FGETC_UNLOCKED
+
+/* Define to 1 if you have the `flockfile' function. */
+#undef HAVE_FLOCKFILE
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define to 1 if you have the <fstab.h> header file. */
+#undef HAVE_FSTAB_H
+
+/* Define to 1 if you have the `funlockfile' function. */
+#undef HAVE_FUNLOCKFILE
+
+/* Define to 1 if you have the `gai_strerror' function. */
+#undef HAVE_GAI_STRERROR
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#undef HAVE_GETADDRINFO
+
+/* define if you have getdevs() */
+#undef HAVE_GETDEVS
+
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAVE_GETDTABLESIZE
+
+/* Define to 1 if you have the `getfsstat' function. */
+#undef HAVE_GETFSSTAT
+
+/* Define to 1 if you have the `getgrnam' function. */
+#undef HAVE_GETGRNAM
+
+/* Define to 1 if you have the `gethostbyaddr' function. */
+#undef HAVE_GETHOSTBYADDR
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#undef HAVE_GETHOSTBYNAME
+
+/* Define to 1 if you have the `gethostbyname2' function. */
+#undef HAVE_GETHOSTBYNAME2
+
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
+/* Define to 1 if you have the `getipnodebyname' function. */
+#undef HAVE_GETIPNODEBYNAME
+
+/* Define to 1 if you have the `getloadavg' function. */
+#undef HAVE_GETLOADAVG
+
+/* Define to 1 if you have the `getmntent' function. */
+#undef HAVE_GETMNTENT
+
+/* Define to 1 if you have the `getopt' function. */
+#undef HAVE_GETOPT
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getpid' function. */
+#undef HAVE_GETPID
+
+/* Define to 1 if you have the `getpwnam' function. */
+#undef HAVE_GETPWNAM
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `getvfsstat' function. */
+#undef HAVE_GETVFSSTAT
+
+/* Define to 1 if you have the <grp.h> header file. */
+#undef HAVE_GRP_H
+
+/* Define to 1 if you have the `hasmntopt' function. */
+#undef HAVE_HASMNTOPT
+
+/* Define to 1 if you have the `if_freenameindex' function. */
+#undef HAVE_IF_FREENAMEINDEX
+
+/* Define to 1 if you have the `if_indextoname' function. */
+#undef HAVE_IF_INDEXTONAME
+
+/* Define to 1 if you have the `if_nameindex' function. */
+#undef HAVE_IF_NAMEINDEX
+
+/* Define to 1 if you have the `if_nametoindex' function. */
+#undef HAVE_IF_NAMETOINDEX
+
+/* Define to 1 if you have the <inet/common.h> header file. */
+#undef HAVE_INET_COMMON_H
+
+/* Define to 1 if you have the <inet/ip.h> header file. */
+#undef HAVE_INET_IP_H
+
+/* Define to 1 if you have the <inet/mib2.h> header file. */
+#undef HAVE_INET_MIB2_H
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#undef HAVE_INET_NTOP
+
+/* Define to 1 if you have the `inet_pton' function. */
+#undef HAVE_INET_PTON
+
+/* Define to 1 if you have the `initgroups' function. */
+#undef HAVE_INITGROUPS
+
+/* Define to 1 if the system has the type `intmax_t'. */
+#undef HAVE_INTMAX_T
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#undef HAVE_INTPTR_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if the system has the type `in_addr_t'. */
+#undef HAVE_IN_ADDR_T
+
+/* Define to 1 if you have the <ioctls.h> header file. */
+#undef HAVE_IOCTLS_H
+
+/* Define to 1 if you have the <io.h> header file. */
+#undef HAVE_IO_H
+
+/* Define to 1 if you have the <iphlpapi.h> header file. */
+#undef HAVE_IPHLPAPI_H
+
+/* Define to 1 if you have the `kinfo_get_cpus' function. */
+#undef HAVE_KINFO_GET_CPUS
+
+/* Define if you have /dev/kmem */
+#undef HAVE_KMEM
+
+/* Define to 1 if you have the `knlist' function. */
+#undef HAVE_KNLIST
+
+/* Define to 1 if you have the <kstat.h> header file. */
+#undef HAVE_KSTAT_H
+
+/* Define to 1 if you have the `kvm_getproc2' function. */
+#undef HAVE_KVM_GETPROC2
+
+/* Define to 1 if you have the `kvm_getprocs' function. */
+#undef HAVE_KVM_GETPROCS
+
+/* Define to 1 if you have the `kvm_getswapinfo' function. */
+#undef HAVE_KVM_GETSWAPINFO
+
+/* Define to 1 if you have the <kvm.h> header file. */
+#undef HAVE_KVM_H
+
+/* Define to 1 if you have the `kvm_openfiles' function. */
+#undef HAVE_KVM_OPENFILES
+
+/* Define to 1 if you have the OpenSSL library (-lcrypto or -leay32). */
+#undef HAVE_LIBCRYPTO
+
+/* Define to 1 if you have the `elf' library (-lelf). */
+#undef HAVE_LIBELF
+
+/* Define to 1 if you have the `kstat' library (-lkstat). */
+#undef HAVE_LIBKSTAT
+
+/* Define to 1 if you have the `mld' library (-lmld). */
+#undef HAVE_LIBMLD
+
+/* define if you have libnm */
+#undef HAVE_LIBNM
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define to 1 if you have the <libperfstat.h> header file. */
+#undef HAVE_LIBPERFSTAT_H
+
+/* Define to 1 if you have the `pkcs11' library (-lpkcs11). */
+#undef HAVE_LIBPKCS11
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
+/* Define to 1 if you have the `rpm' library (-lrpm). */
+#undef HAVE_LIBRPM
+
+/* Define to 1 if you have the `RSAglue' library (-lRSAglue). */
+#undef HAVE_LIBRSAGLUE
+
+/* Define to 1 if you have the `rsaref' library (-lrsaref). */
+#undef HAVE_LIBRSAREF
+
+/* Define to 1 if you have the `sres' library (-lsres). */
+#undef HAVE_LIBSRES
+
+/* Define to 1 if you have the `ssh2' library (-lssh2). */
+#undef HAVE_LIBSSH2
+
+/* Define to 1 if you have the `ssl' library (-lssl). */
+#undef HAVE_LIBSSL
+
+/* Define to 1 if your `ssl' library supports DTLS (-lssl). */
+#undef HAVE_LIBSSL_DTLS
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <linux/ethtool.h> header file. */
+#undef HAVE_LINUX_ETHTOOL_H
+
+/* Define to 1 if you have the <linux/hdreg.h> header file. */
+#undef HAVE_LINUX_HDREG_H
+
+/* Define to 1 if you have the <linux/netlink.h> header file. */
+#undef HAVE_LINUX_NETLINK_H
+
+/* Define to 1 if you have the <linux/rtnetlink.h> header file. */
+#undef HAVE_LINUX_RTNETLINK_H
+
+/* Define to 1 if you have the <linux/tasks.h> header file. */
+#undef HAVE_LINUX_TASKS_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
+/* Define to 1 if the system has the type `long long int'. */
+#undef HAVE_LONG_LONG_INT
+
+/* Set if the lpstat command is available */
+#undef HAVE_LPSTAT
+
+/* Define to 1 if you have the `lrand48' function. */
+#undef HAVE_LRAND48
+
+/* Define to 1 if you have the `lseek64' function. */
+#undef HAVE_LSEEK64
+
+/* Define to 1 if you have the <machine/param.h> header file. */
+#undef HAVE_MACHINE_PARAM_H
+
+/* Define to 1 if you have the <machine/pte.h> header file. */
+#undef HAVE_MACHINE_PTE_H
+
+/* Define to 1 if you have the <machine/types.h> header file. */
+#undef HAVE_MACHINE_TYPES_H
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if the system has the type `mib2_ipIfStatsEntry_t'. */
+#undef HAVE_MIB2_IPIFSTATSENTRY_T
+
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* Define to 1 if you have the `mktime' function. */
+#undef HAVE_MKTIME
+
+/* Define to 1 if you have the <mntent.h> header file. */
+#undef HAVE_MNTENT_H
+
+/* Define to 1 if you have the <mtab.h> header file. */
+#undef HAVE_MTAB_H
+
+/* Define to 1 if you have the <mysql/mysql.h> header file. */
+#undef HAVE_MYSQL_MYSQL_H
+
+/* Define to 1 if you have the <nbutil.h> header file. */
+#undef HAVE_NBUTIL_H
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet6/in6_pcb.h> header file. */
+#undef HAVE_NETINET6_IN6_PCB_H
+
+/* Define to 1 if you have the <netinet6/in6_var.h> header file. */
+#undef HAVE_NETINET6_IN6_VAR_H
+
+/* Define to 1 if you have the <netinet6/ip6_var.h> header file. */
+#undef HAVE_NETINET6_IP6_VAR_H
+
+/* Define to 1 if you have the <netinet6/nd6.h> header file. */
+#undef HAVE_NETINET6_ND6_H
+
+/* Define to 1 if you have the <netinet6/tcp6_fsm.h> header file. */
+#undef HAVE_NETINET6_TCP6_FSM_H
+
+/* Define to 1 if you have the <netinet6/tcp6.h> header file. */
+#undef HAVE_NETINET6_TCP6_H
+
+/* Define to 1 if you have the <netinet6/tcp6_timer.h> header file. */
+#undef HAVE_NETINET6_TCP6_TIMER_H
+
+/* Define to 1 if you have the <netinet6/tcp6_var.h> header file. */
+#undef HAVE_NETINET6_TCP6_VAR_H
+
+/* Define to 1 if you have the <netinet/icmp6.h> header file. */
+#undef HAVE_NETINET_ICMP6_H
+
+/* Define to 1 if you have the <netinet/icmp_var.h> header file. */
+#undef HAVE_NETINET_ICMP_VAR_H
+
+/* Define to 1 if you have the <netinet/if_ether.h> header file. */
+#undef HAVE_NETINET_IF_ETHER_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/in_pcb.h> header file. */
+#undef HAVE_NETINET_IN_PCB_H
+
+/* Define to 1 if you have the <netinet/in_systm.h> header file. */
+#undef HAVE_NETINET_IN_SYSTM_H
+
+/* Define to 1 if you have the <netinet/in_var.h> header file. */
+#undef HAVE_NETINET_IN_VAR_H
+
+/* Define to 1 if you have the <netinet/ip6.h> header file. */
+#undef HAVE_NETINET_IP6_H
+
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+#undef HAVE_NETINET_IP_H
+
+/* Define to 1 if you have the <netinet/ip_icmp.h> header file. */
+#undef HAVE_NETINET_IP_ICMP_H
+
+/* Define to 1 if you have the <netinet/ip_var.h> header file. */
+#undef HAVE_NETINET_IP_VAR_H
+
+/* Define to 1 if you have the <netinet/tcpip.h> header file. */
+#undef HAVE_NETINET_TCPIP_H
+
+/* Define to 1 if you have the <netinet/tcp_fsm.h> header file. */
+#undef HAVE_NETINET_TCP_FSM_H
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#undef HAVE_NETINET_TCP_H
+
+/* Define to 1 if you have the <netinet/tcp_timer.h> header file. */
+#undef HAVE_NETINET_TCP_TIMER_H
+
+/* Define to 1 if you have the <netinet/tcp_var.h> header file. */
+#undef HAVE_NETINET_TCP_VAR_H
+
+/* Define to 1 if you have the <netinet/udp.h> header file. */
+#undef HAVE_NETINET_UDP_H
+
+/* Define to 1 if you have the <netinet/udp_var.h> header file. */
+#undef HAVE_NETINET_UDP_VAR_H
+
+/* Define to 1 if you have the <netipx/ipx.h> header file. */
+#undef HAVE_NETIPX_IPX_H
+
+/* Define to 1 if you have the <netlink/netlink.h> header file. */
+#undef HAVE_NETLINK_NETLINK_H
+
+/* Define to 1 if you have the <net/if_arp.h> header file. */
+#undef HAVE_NET_IF_ARP_H
+
+/* Define to 1 if you have the <net/if_dl.h> header file. */
+#undef HAVE_NET_IF_DL_H
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
+
+/* Define to 1 if you have the <net/if_mib.h> header file. */
+#undef HAVE_NET_IF_MIB_H
+
+/* Define to 1 if you have the <net/if_types.h> header file. */
+#undef HAVE_NET_IF_TYPES_H
+
+/* Define to 1 if you have the <net/if_var.h> header file. */
+#undef HAVE_NET_IF_VAR_H
+
+/* Define to 1 if you have the <net/route.h> header file. */
+#undef HAVE_NET_ROUTE_H
+
+/* Define to 1 if the system has the type `nfds_t'. */
+#undef HAVE_NFDS_T
+
+/* Define to 1 if you have the `nlist' function. */
+#undef HAVE_NLIST
+
+/* Define to 1 if you have the `nlist64' function. */
+#undef HAVE_NLIST64
+
+/* Define to 1 if you have the <nlist.h> header file. */
+#undef HAVE_NLIST_H
+
+/* Define to 1 if the system has the type `off64_t'. */
+#undef HAVE_OFF64_T
+
+/* Define to 1 if you have the `opendir' function. */
+#undef HAVE_OPENDIR
+
+/* Define to 1 if you have the <openssl/aes.h> header file. */
+#undef HAVE_OPENSSL_AES_H
+
+/* Define to 1 if you have the <openssl/des.h> header file. */
+#undef HAVE_OPENSSL_DES_H
+
+/* Define to 1 if you have the <openssl/dh.h> header file. */
+#undef HAVE_OPENSSL_DH_H
+
+/* Define to 1 if you have the <openssl/evp.h> header file. */
+#undef HAVE_OPENSSL_EVP_H
+
+/* Define to 1 if you have the <openssl/hmac.h> header file. */
+#undef HAVE_OPENSSL_HMAC_H
+
+/* Define to 1 if you have the <osreldate.h> header file. */
+#undef HAVE_OSRELDATE_H
+
+/* define if you have pci_lookup_name() */
+#undef HAVE_PCI_LOOKUP_NAME
+
+/* Define to 1 if you have the <pci/pci.h> header file. */
+#undef HAVE_PCI_PCI_H
+
+/* on aix, if you have perfstat */
+#undef HAVE_PERFSTAT
+
+/* Define to 1 if you have `the perl_eval_pv' function. */
+#undef HAVE_PERL_EVAL_PV_LC
+
+/* Define to 1 if you have the `Perl_eval_pv' function. */
+#undef HAVE_PERL_EVAL_PV_UC
+
+/* Define to 1 if you have the <picl.h> header file. */
+#undef HAVE_PICL_H
+
+/* define if you have pkginfo */
+#undef HAVE_PKGINFO
+
+/* Define to 1 if you have the <pkginfo.h> header file. */
+#undef HAVE_PKGINFO_H
+
+/* Define to 1 if you have the <pkglocs.h> header file. */
+#undef HAVE_PKGLOCS_H
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the `pread64' function. */
+#undef HAVE_PREAD64
+
+/* Set if /etc/printcap exists */
+#undef HAVE_PRINTCAP
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* Define to 1 if you have the `rand' function. */
+#undef HAVE_RAND
+
+/* Define to 1 if you have the `random' function. */
+#undef HAVE_RANDOM
+
+/* Define to 1 if you have the `readdir' function. */
+#undef HAVE_READDIR
+
+/* Define to 1 if you have the `regcomp' function. */
+#undef HAVE_REGCOMP
+
+/* Define to 1 if you have the <regex.h> header file. */
+#undef HAVE_REGEX_H
+
+/* Define to 1 if you have the `rpmGetPath' function. */
+#undef HAVE_RPMGETPATH
+
+/* Define to 1 if you have the <rpm/header.h> header file. */
+#undef HAVE_RPM_HEADER_H
+
+/* Define to 1 if you have the <rpm/rpmfileutil.h> header file. */
+#undef HAVE_RPM_RPMFILEUTIL_H
+
+/* Define to 1 if you have the <rpm/rpmlib.h> header file. */
+#undef HAVE_RPM_RPMLIB_H
+
+/* Define to 1 if you have the <rpm/rpmts.h> header file. */
+#undef HAVE_RPM_RPMTS_H
+
+/* Define to 1 if you have the <search.h> header file. */
+#undef HAVE_SEARCH_H
+
+/* Define to 1 if you have the <security/cryptoki.h> header file. */
+#undef HAVE_SECURITY_CRYPTOKI_H
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the <sensors/sensors.h> header file. */
+#undef HAVE_SENSORS_SENSORS_H
+
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
+/* Define to 1 if you have the `setgid' function. */
+#undef HAVE_SETGID
+
+/* Define to 1 if you have the `setgroups' function. */
+#undef HAVE_SETGROUPS
+
+/* Define to 1 if you have the `setitimer' function. */
+#undef HAVE_SETITIMER
+
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
+/* Define to 1 if you have the `setmntent' function. */
+#undef HAVE_SETMNTENT
+
+/* Define to 1 if you have the `setsid' function. */
+#undef HAVE_SETSID
+
+/* Define to 1 if you have the `setuid' function. */
+#undef HAVE_SETUID
+
+/* Define to 1 if you have the <sgtty.h> header file. */
+#undef HAVE_SGTTY_H
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigalrm' function. */
+#undef HAVE_SIGALRM
+
+/* Define to 1 if you have the `sigblock' function. */
+#undef HAVE_SIGBLOCK
+
+/* Define to 1 if you have the `sighold' function. */
+#undef HAVE_SIGHOLD
+
+/* Define if SIGHUP is defined in <signal.h>. */
+#undef HAVE_SIGHUP
+
+/* Define to 1 if you have the `signal' function. */
+#undef HAVE_SIGNAL
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define to 1 if you have the `sigset' function. */
+#undef HAVE_SIGSET
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#undef HAVE_SOCKLEN_T
+
+/* Define to 1 if the system has the type `ssize_t'. */
+#undef HAVE_SSIZE_T
+
+/* Define to 1 if you have the `statfs' function. */
+#undef HAVE_STATFS
+
+/* Define to 1 if you have the `statvfs' function. */
+#undef HAVE_STATVFS
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `stime' function. */
+#undef HAVE_STIME
+
+/* Define to 1 if you have the `strcasestr' function. */
+#undef HAVE_STRCASESTR
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strtok_r' function. */
+#undef HAVE_STRTOK_R
+
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
+
+/* Define to 1 if `at_next' is a member of `struct arphd'. */
+#undef HAVE_STRUCT_ARPHD_AT_NEXT
+
+/* Define to 1 if `weak_key' is a member of `struct des_ks_struct'. */
+#undef HAVE_STRUCT_DES_KS_STRUCT_WEAK_KEY
+
+/* Define to 1 if `d_type' is a member of `struct dirent'. */
+#undef HAVE_STRUCT_DIRENT_D_TYPE
+
+/* Define to 1 if `speed_hi' is a member of `struct ethtool_cmd'. */
+#undef HAVE_STRUCT_ETHTOOL_CMD_SPEED_HI
+
+/* Define to 1 if `ifa_next' is a member of `struct ifaddr'. */
+#undef HAVE_STRUCT_IFADDR_IFA_NEXT
+
+/* Define to 1 if `if_addrhead.tqh_first' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_ADDRHEAD_TQH_FIRST
+
+/* Define to 1 if `if_addrlist' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_ADDRLIST
+
+/* Define to 1 if `if_baudrate' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_BAUDRATE
+
+/* Define to 1 if `if_baudrate.ifs_value' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_BAUDRATE_IFS_VALUE
+
+/* Define to 1 if `if_ibytes' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_IBYTES
+
+/* Define to 1 if `if_imcasts' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_IMCASTS
+
+/* Define to 1 if `if_iqdrops' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_IQDROPS
+
+/* Define to 1 if `if_lastchange.tv_nsec' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_NSEC
+
+/* Define to 1 if `if_lastchange.tv_sec' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_SEC
+
+/* Define to 1 if `if_mtu' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_MTU
+
+/* Define to 1 if `if_noproto' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_NOPROTO
+
+/* Define to 1 if `if_obytes' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_OBYTES
+
+/* Define to 1 if `if_omcasts' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_OMCASTS
+
+/* Define to 1 if `if_speed' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_SPEED
+
+/* Define to 1 if `if_type' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_TYPE
+
+/* Define to 1 if `if_xname' is a member of `struct ifnet'. */
+#undef HAVE_STRUCT_IFNET_IF_XNAME
+
+/* Define to 1 if `ips_cantforward' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_CANTFORWARD
+
+/* Define to 1 if `ips_cantfrag' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_CANTFRAG
+
+/* Define to 1 if `ips_delivered' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_DELIVERED
+
+/* Define to 1 if `ips_fragdropped' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_FRAGDROPPED
+
+/* Define to 1 if `ips_fragmented' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_FRAGMENTED
+
+/* Define to 1 if `ips_fragtimeout' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_FRAGTIMEOUT
+
+/* Define to 1 if `ips_localout' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_LOCALOUT
+
+/* Define to 1 if `ips_noproto' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_NOPROTO
+
+/* Define to 1 if `ips_noroute' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_NOROUTE
+
+/* Define to 1 if `ips_odropped' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_ODROPPED
+
+/* Define to 1 if `ips_ofragments' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_OFRAGMENTS
+
+/* Define to 1 if `ips_reassembled' is a member of `struct ipstat'. */
+#undef HAVE_STRUCT_IPSTAT_IPS_REASSEMBLED
+
+/* Define to 1 if `m_clfree' is a member of `struct mbstat'. */
+#undef HAVE_STRUCT_MBSTAT_M_CLFREE
+
+/* Define to 1 if `m_clusters' is a member of `struct mbstat'. */
+#undef HAVE_STRUCT_MBSTAT_M_CLUSTERS
+
+/* Define to 1 if `m_mbufs' is a member of `struct mbstat'. */
+#undef HAVE_STRUCT_MBSTAT_M_MBUFS
+
+/* Define to 1 if `msg_control' is a member of `struct msghdr'. */
+#undef HAVE_STRUCT_MSGHDR_MSG_CONTROL
+
+/* Define to 1 if `msg_flags' is a member of `struct msghdr'. */
+#undef HAVE_STRUCT_MSGHDR_MSG_FLAGS
+
+/* Define to 1 if `n_value' is a member of `struct nlist64'. */
+#undef HAVE_STRUCT_NLIST64_N_VALUE
+
+/* Define to 1 if `n_value' is a member of `struct nlist'. */
+#undef HAVE_STRUCT_NLIST_N_VALUE
+
+/* Define to 1 if `rt_dst' is a member of `struct rtentry'. */
+#undef HAVE_STRUCT_RTENTRY_RT_DST
+
+/* Define to 1 if `rt_hash' is a member of `struct rtentry'. */
+#undef HAVE_STRUCT_RTENTRY_RT_HASH
+
+/* Define to 1 if `rt_next' is a member of `struct rtentry'. */
+#undef HAVE_STRUCT_RTENTRY_RT_NEXT
+
+/* Define to 1 if `rt_refcnt' is a member of `struct rtentry'. */
+#undef HAVE_STRUCT_RTENTRY_RT_REFCNT
+
+/* Define to 1 if `rt_unit' is a member of `struct rtentry'. */
+#undef HAVE_STRUCT_RTENTRY_RT_UNIT
+
+/* Define to 1 if `rt_use' is a member of `struct rtentry'. */
+#undef HAVE_STRUCT_RTENTRY_RT_USE
+
+/* Define to 1 if `sa_sigaction' is a member of `struct sigaction'. */
+#undef HAVE_STRUCT_SIGACTION_SA_SIGACTION
+
+/* Define to 1 if `sin6_scope_id' is a member of `struct sockaddr_in6'. */
+#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
+
+/* Define to 1 if `sa_len' is a member of `struct sockaddr'. */
+#undef HAVE_STRUCT_SOCKADDR_SA_LEN
+
+/* Define to 1 if `sa_union.sa_generic.sa_family2' is a member of `struct
+ sockaddr'. */
+#undef HAVE_STRUCT_SOCKADDR_SA_UNION_SA_GENERIC_SA_FAMILY2
+
+/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+
+/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
+
+/* Define to 1 if `f_favail' is a member of `struct statfs'. */
+#undef HAVE_STRUCT_STATFS_F_FAVAIL
+
+/* Define to 1 if `f_ffree' is a member of `struct statfs'. */
+#undef HAVE_STRUCT_STATFS_F_FFREE
+
+/* Define to 1 if `f_files' is a member of `struct statfs'. */
+#undef HAVE_STRUCT_STATFS_F_FILES
+
+/* Define to 1 if `f_flags' is a member of `struct statfs'. */
+#undef HAVE_STRUCT_STATFS_F_FLAGS
+
+/* Define to 1 if `f_frsize' is a member of `struct statfs'. */
+#undef HAVE_STRUCT_STATFS_F_FRSIZE
+
+/* Define to 1 if `f_files' is a member of `struct statvfs'. */
+#undef HAVE_STRUCT_STATVFS_F_FILES
+
+/* Define to 1 if `f_frsize' is a member of `struct statvfs'. */
+#undef HAVE_STRUCT_STATVFS_F_FRSIZE
+
+/* Define to 1 if `mnt_dir' is a member of `struct statvfs'. */
+#undef HAVE_STRUCT_STATVFS_MNT_DIR
+
+/* Define to 1 if `sw_nblksenabled' is a member of `struct swdevt'. */
+#undef HAVE_STRUCT_SWDEVT_SW_NBLKSENABLED
+
+/* Define to 1 if `tcp_rcvmemdrop' is a member of `struct tcpstat'. */
+#undef HAVE_STRUCT_TCPSTAT_TCP_RCVMEMDROP
+
+/* Define to 1 if `tz_dsttime' is a member of `struct timezone'. */
+#undef HAVE_STRUCT_TIMEZONE_TZ_DSTTIME
+
+/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */
+#undef HAVE_STRUCT_TM_TM_GMTOFF
+
+/* Define to 1 if `udps_discard' is a member of `struct udpstat'. */
+#undef HAVE_STRUCT_UDPSTAT_UDPS_DISCARD
+
+/* Define to 1 if `udps_fullsock' is a member of `struct udpstat'. */
+#undef HAVE_STRUCT_UDPSTAT_UDPS_FULLSOCK
+
+/* Define to 1 if `udps_noport' is a member of `struct udpstat'. */
+#undef HAVE_STRUCT_UDPSTAT_UDPS_NOPORT
+
+/* Define to 1 if `udps_noportbcast' is a member of `struct udpstat'. */
+#undef HAVE_STRUCT_UDPSTAT_UDPS_NOPORTBCAST
+
+/* Define to 1 if `udps_opackets' is a member of `struct udpstat'. */
+#undef HAVE_STRUCT_UDPSTAT_UDPS_OPACKETS
+
+/* Define to 1 if you have the `sysconf' function. */
+#undef HAVE_SYSCONF
+
+/* Define to 1 if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
+
+/* Define to 1 if you have the `system' function. */
+#undef HAVE_SYSTEM
+
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+#undef HAVE_SYS_CDEFS_H
+
+/* Define to 1 if you have the <sys/conf.h> header file. */
+#undef HAVE_SYS_CONF_H
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/diskio.h> header file. */
+#undef HAVE_SYS_DISKIO_H
+
+/* Define to 1 if you have the <sys/disklabel.h> header file. */
+#undef HAVE_SYS_DISKLABEL_H
+
+/* Define to 1 if you have the <sys/dkio.h> header file. */
+#undef HAVE_SYS_DKIO_H
+
+/* Define to 1 if you have the <sys/dkstat.h> header file. */
+#undef HAVE_SYS_DKSTAT_H
+
+/* Define to 1 if you have the <sys/dmap.h> header file. */
+#undef HAVE_SYS_DMAP_H
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define to 1 if you have the <sys/fixpoint.h> header file. */
+#undef HAVE_SYS_FIXPOINT_H
+
+/* Define to 1 if you have the <sys/fs.h> header file. */
+#undef HAVE_SYS_FS_H
+
+/* Define to 1 if you have the <sys/hashing.h> header file. */
+#undef HAVE_SYS_HASHING_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/loadavg.h> header file. */
+#undef HAVE_SYS_LOADAVG_H
+
+/* Define to 1 if you have the <sys/mbuf.h> header file. */
+#undef HAVE_SYS_MBUF_H
+
+/* Define to 1 if you have the <sys/mntent.h> header file. */
+#undef HAVE_SYS_MNTENT_H
+
+/* Define to 1 if you have the <sys/mnttab.h> header file. */
+#undef HAVE_SYS_MNTTAB_H
+
+/* Define to 1 if you have the <sys/mount.h> header file. */
+#undef HAVE_SYS_MOUNT_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
+/* Define to 1 if you have the <sys/pool.h> header file. */
+#undef HAVE_SYS_POOL_H
+
+/* Define to 1 if you have the <sys/proc.h> header file. */
+#undef HAVE_SYS_PROC_H
+
+/* Define to 1 if you have the <sys/protosw.h> header file. */
+#undef HAVE_SYS_PROTOSW_H
+
+/* Define to 1 if you have the <sys/pstat.h> header file. */
+#undef HAVE_SYS_PSTAT_H
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#undef HAVE_SYS_QUEUE_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/sema.h> header file. */
+#undef HAVE_SYS_SEMA_H
+
+/* Define to 1 if you have the <sys/socketvar.h> header file. */
+#undef HAVE_SYS_SOCKETVAR_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H
+
+/* Define to 1 if you have the <sys/statfs.h> header file. */
+#undef HAVE_SYS_STATFS_H
+
+/* Define to 1 if you have the <sys/statvfs.h> header file. */
+#undef HAVE_SYS_STATVFS_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/stream.h> header file. */
+#undef HAVE_SYS_STREAM_H
+
+/* Define to 1 if you have the <sys/swap.h> header file. */
+#undef HAVE_SYS_SWAP_H
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
+/* Define to 1 if you have the <sys/sysget.h> header file. */
+#undef HAVE_SYS_SYSGET_H
+
+/* Define to 1 if you have the <sys/sysmp.h> header file. */
+#undef HAVE_SYS_SYSMP_H
+
+/* Define to 1 if you have the <sys/systemcfg.h> header file. */
+#undef HAVE_SYS_SYSTEMCFG_H
+
+/* Define to 1 if you have the <sys/systeminfo.h> header file. */
+#undef HAVE_SYS_SYSTEMINFO_H
+
+/* Define to 1 if you have the <sys/tcpipstats.h> header file. */
+#undef HAVE_SYS_TCPIPSTATS_H
+
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#undef HAVE_SYS_TIMEB_H
+
+/* Define to 1 if you have the <sys/timeout.h> header file. */
+#undef HAVE_SYS_TIMEOUT_H
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+#undef HAVE_SYS_TIMES_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/user.h> header file. */
+#undef HAVE_SYS_USER_H
+
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
+
+/* Define to 1 if you have the <sys/vfs.h> header file. */
+#undef HAVE_SYS_VFS_H
+
+/* Define to 1 if you have the <sys/vmmac.h> header file. */
+#undef HAVE_SYS_VMMAC_H
+
+/* Define to 1 if you have the <sys/vmmeter.h> header file. */
+#undef HAVE_SYS_VMMETER_H
+
+/* Define to 1 if you have the <sys/vmparam.h> header file. */
+#undef HAVE_SYS_VMPARAM_H
+
+/* Define to 1 if you have the <sys/vmsystm.h> header file. */
+#undef HAVE_SYS_VMSYSTM_H
+
+/* Define to 1 if you have the <sys/vm.h> header file. */
+#undef HAVE_SYS_VM_H
+
+/* Define to 1 if you have the <sys/vnode.h> header file. */
+#undef HAVE_SYS_VNODE_H
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the `tcgetattr' function. */
+#undef HAVE_TCGETATTR
+
+/* Define to 1 if you have the `times' function. */
+#undef HAVE_TIMES
+
+/* Define if a timezone variable is declared in <sys/time.h> */
+#undef HAVE_TIMEZONE_VARIABLE
+
+/* Define to 1 if you have the <ufs/ffs/fs.h> header file. */
+#undef HAVE_UFS_FFS_FS_H
+
+/* Define to 1 if you have the <ufs/fs.h> header file. */
+#undef HAVE_UFS_FS_H
+
+/* Define to 1 if you have the <ufs/ufs/dinode.h> header file. */
+#undef HAVE_UFS_UFS_DINODE_H
+
+/* Define to 1 if you have the <ufs/ufs/inode.h> header file. */
+#undef HAVE_UFS_UFS_INODE_H
+
+/* Define to 1 if you have the <ufs/ufs/quota.h> header file. */
+#undef HAVE_UFS_UFS_QUOTA_H
+
+/* Define to 1 if the system has the type `uintmax_t'. */
+#undef HAVE_UINTMAX_T
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#undef HAVE_UINTPTR_T
+
+/* Define to 1 if you have the `uname' function. */
+#undef HAVE_UNAME
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#undef HAVE_UNSIGNED_LONG_LONG_INT
+
+/* Define to 1 if you have the `usleep' function. */
+#undef HAVE_USLEEP
+
+/* Define to 1 if you have the <utmpx.h> header file. */
+#undef HAVE_UTMPX_H
+
+/* Define to 1 if you have the <utsname.h> header file. */
+#undef HAVE_UTSNAME_H
+
+/* Define to 1 if you have the <uvm/uvm_extern.h> header file. */
+#undef HAVE_UVM_UVM_EXTERN_H
+
+/* Define to 1 if you have the <uvm/uvm_param.h> header file. */
+#undef HAVE_UVM_UVM_PARAM_H
+
+/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
+#undef HAVE_VALGRIND_MEMCHECK_H
+
+/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
+#undef HAVE_VALGRIND_VALGRIND_H
+
+/* Define to 1 if you have the <validator/validator-config.h> header file. */
+#undef HAVE_VALIDATOR_VALIDATOR_CONFIG_H
+
+/* Define to 1 if you have the <vm/swap_pager.h> header file. */
+#undef HAVE_VM_SWAP_PAGER_H
+
+/* Define to 1 if you have the <vm/vm_extern.h> header file. */
+#undef HAVE_VM_VM_EXTERN_H
+
+/* Define to 1 if you have the <vm/vm.h> header file. */
+#undef HAVE_VM_VM_H
+
+/* Define to 1 if you have the <vm/vm_param.h> header file. */
+#undef HAVE_VM_VM_PARAM_H
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 if you have the <windows.h> header file. */
+#undef HAVE_WINDOWS_H
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#undef HAVE_WINSOCK2_H
+
+/* Define to 1 if you have the <winsock.h> header file. */
+#undef HAVE_WINSOCK_H
+
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#undef HAVE_WS2TCPIP_H
+
+/* Define to 1 if you have the <xti.h> header file. */
+#undef HAVE_XTI_H
+
+/* location of UNIX kernel */
+#undef KERNEL_LOC
+
+/* Path to the lpstat command */
+#undef LPSTAT_PATH
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* define if agentx transport is to use domain sockets only */
+#undef NETSNMP_AGENTX_DOM_SOCK_ONLY
+
+/* Unix domain socket for AgentX master-subagent communication */
+#undef NETSNMP_AGENTX_SOCKET
+
+/* Define if static inline functions are unsupported */
+#undef NETSNMP_BROKEN_INLINE
+
+/* "Define if crytography support is possible" */
+#undef NETSNMP_CAN_DO_CRYPTO
+
+/* sysctl works to get boottime, etc... */
+#undef NETSNMP_CAN_USE_SYSCTL
+
+/* configure options specified */
+#undef NETSNMP_CONFIGURE_OPTIONS
+
+/* default location to look for mibs to load using the above tokens and/or
+ those in the MIBS envrionment variable */
+#undef NETSNMP_DEFAULT_MIBDIRS
+
+/* default mib files to load, specified by path. */
+#undef NETSNMP_DEFAULT_MIBFILES
+
+/* Define if no agent is built */
+#undef NETSNMP_DISABLE_AGENT
+
+/* Define if no apps are built */
+#undef NETSNMP_DISABLE_APPS
+
+/* Define if DES encryption should not be supported */
+#undef NETSNMP_DISABLE_DES
+
+/* Define if MD5 authentication should not be supported */
+#undef NETSNMP_DISABLE_MD5
+
+/* Define if mib loading and parsing code should not be included */
+#undef NETSNMP_DISABLE_MIB_LOADING
+
+/* Define if SNMP SET support should be disabled */
+#undef NETSNMP_DISABLE_SET_SUPPORT
+
+/* Define if SNMPv1 code should not be included */
+#undef NETSNMP_DISABLE_SNMPV1
+
+/* Define if SNMPv2c code should not be included */
+#undef NETSNMP_DISABLE_SNMPV2C
+
+/* Define if you are embedding perl in the main agent. */
+#undef NETSNMP_EMBEDDED_PERL
+
+/* define if you want to enable IPv6 support */
+#undef NETSNMP_ENABLE_IPV6
+
+/* define if you want to restrict SMUX connections to localhost by default */
+#undef NETSNMP_ENABLE_LOCAL_SMUX
+
+/* Define if you want to build MFD module rewrites */
+#undef NETSNMP_ENABLE_MFD_REWRITES
+
+/* define if you want to compile support for both authentication and privacy
+ support. */
+#undef NETSNMP_ENABLE_SCAPI_AUTHPRIV
+
+/* testing code sections. */
+#undef NETSNMP_ENABLE_TESTING_CODE
+
+/* Should evaluate to the name of the current function if defined */
+#undef NETSNMP_FUNCTION
+
+/* ifnet needs to have _KERNEL defined */
+#undef NETSNMP_IFNET_NEEDS_KERNEL
+
+/* ifnet needs to have _KERNEL_STRUCTURES defined */
+#undef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
+
+/* Define if you want to remove all non-essential code features. */
+#undef NETSNMP_MINIMAL_CODE
+
+/* Define if you want to only support sending notifications */
+#undef NETSNMP_NOTIFY_ONLY
+
+/* Define to suppress inclusion of deprecated functions */
+#undef NETSNMP_NO_DEPRECATED_FUNCTIONS
+
+/* If you don't want the agent to report on variables it doesn't have data for
+ */
+#undef NETSNMP_NO_DUMMY_VALUES
+
+/* If we don't want to use kmem. */
+#undef NETSNMP_NO_KMEM_USAGE
+
+/* Define if you want to remove all listening support from the code */
+#undef NETSNMP_NO_LISTEN_SUPPORT
+
+/* If you don't have root access don't exit upon kmem errors */
+#undef NETSNMP_NO_ROOT_ACCESS
+
+/* Define if you want to remove all SET/write access from the code */
+#undef NETSNMP_NO_WRITE_SUPPORT
+
+/* umask permissions to set up persistent files with */
+#undef NETSNMP_PERSISTENT_MASK
+
+/* Size prefix to use to printf a uint32_t */
+#undef NETSNMP_PRI32
+
+/* Size prefix to use to printf a size_t or ssize_t */
+#undef NETSNMP_PRIz
+
+/* Define to 1 if you want to build with reentrant/threaded code (incomplete).
+ */
+#undef NETSNMP_REENTRANT
+
+/* define if you do not want snmptrapd to register as an AgentX subagent */
+#undef NETSNMP_SNMPTRAPD_DISABLE_AGENTX
+
+/* Pattern of temporary files */
+#undef NETSNMP_TEMP_FILE_PATTERN
+
+/* "Define if internal cryptography code should be used" */
+#undef NETSNMP_USE_INTERNAL_CRYPTO
+
+/* define if you are using the MD5 code ... */
+#undef NETSNMP_USE_INTERNAL_MD5
+
+/* Define this if you're using Heimdal Kerberos */
+#undef NETSNMP_USE_KERBEROS_HEIMDAL
+
+/* Define this if we're using the new MIT crypto API */
+#undef NETSNMP_USE_KERBEROS_MIT
+
+/* define if you are using the mysql code for snmptrapd ... */
+#undef NETSNMP_USE_MYSQL
+
+/* Define if you are using the codeS11 library ... */
+#undef NETSNMP_USE_PKCS11
+
+/* Define this if you have lm_sensors v3 or later */
+#undef NETSNMP_USE_SENSORS_V3
+
+/* Should we compile to use special opaque types: float, double, counter64,
+ i64, ui64, union? */
+#undef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+
+/* Define to the address where bug reports for this package should be sent. */
+#ifndef PACKAGE_BUGREPORT
+#undef PACKAGE_BUGREPORT
+#endif
+
+/* Define to the full name of this package. */
+#ifndef PACKAGE_NAME
+#undef PACKAGE_NAME
+#endif
+
+/* Define to the full name and version of this package. */
+#ifndef PACKAGE_STRING
+#undef PACKAGE_STRING
+#endif
+
+/* Define to the one symbol short name of this package. */
+#ifndef PACKAGE_TARNAME
+#undef PACKAGE_TARNAME
+#endif
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#ifndef PACKAGE_VERSION
+#undef PACKAGE_VERSION
+#endif
+
+/* Command to generate ps output, the final column must be the process name
+ withOUT arguments */
+#undef PSCMD
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* define rtentry to ortentry on SYSV machines (alphas) */
+#undef RTENTRY
+
+/* Use BSD 4.4 routing table entries? */
+#undef RTENTRY_4_4
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `intmax_t', as computed by sizeof. */
+#undef SIZEOF_INTMAX_T
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `sockaddr_un.sun_path', as computed by sizeof. */
+#undef SIZEOF_SOCKADDR_UN_SUN_PATH
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define if statfs takes 2 args and the second argument has type struct
+ fs_data. [Ultrix] */
+#undef STAT_STATFS_FS_DATA
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* define if SIOCGIFADDR exists in sys/ioctl.h */
+#undef SYS_IOCTL_H_HAS_SIOCGIFADDR
+
+/* Define if the TCP timer constants in <netinet/tcp_timer.h> depend on the
+ integer variable 'hz'. [FreeBSD 4.x] */
+#undef TCPTV_NEEDS_HZ
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Where is the uname command */
+#undef UNAMEPROG
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define if you have RPM 4.6 or newer to turn on legacy API */
+#undef _RPM_4_4_COMPAT
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT64_T
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT8_T
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int16_t
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int32_t
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int64_t
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+ a type exists and the standard includes do not define it. */
+#undef int8_t
+
+/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
+ not define. */
+#undef intmax_t
+
+/* Define to the type of a signed integer type wide enough to hold a pointer,
+ if such a type exists, and if the system does not define it. */
+#undef intptr_t
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint16_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint64_t
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint8_t
+
+/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
+ do not define. */
+#undef uintmax_t
+
+/* Define to the type of an unsigned integer type wide enough to hold a
+ pointer, if such a type exists, and if the system does not define it. */
+#undef uintptr_t
+
+/* end of definitions added by configure on-the-fly */
+
+/* If you have openssl 0.9.7 or above, you likely have AES support. */
+#undef NETSNMP_USE_OPENSSL
+#if (defined(NETSNMP_USE_OPENSSL) && defined(HAVE_OPENSSL_AES_H) && defined(HAVE_AES_CFB128_ENCRYPT)) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+#define HAVE_AES 1
+#endif
+
+/* define random functions */
+
+#ifndef HAVE_RANDOM
+#ifdef HAVE_LRAND48
+#define random lrand48
+#define srandom(s) srand48(s)
+#else
+#ifdef HAVE_RAND
+#define random rand
+#define srandom(s) srand(s)
+#endif
+#endif
+#endif
+
+/* define signal if DNE */
+
+#ifndef HAVE_SIGNAL
+#ifdef HAVE_SIGSET
+#define signal(a,b) sigset(a,b)
+#endif
+#endif
+
+#ifdef HAVE_DMALLOC_H
+#define DMALLOC_FUNC_CHECK
+#endif
+
+#endif /* NETSNMP_NO_AUTOCONF_DEFINITIONS */
+
+
+
+
+/* ********* NETSNMP_MARK_BEGIN_CLEAN_NAMESPACE ********* */
+/*
+ * put all new net-snmp-specific definitions here
+ *
+ * all definitions MUST have a NETSNMP_ prefix
+ *
+ */
+
+/* Default (SNMP) version number for the tools to use */
+#define NETSNMP_DEFAULT_SNMP_VERSION 3
+
+/* don't change these values! */
+#define NETSNMP_SNMPV1 0xAAAA /* readable by anyone */
+#define NETSNMP_SNMPV2ANY 0xA000 /* V2 Any type (includes NoAuth) */
+#define NETSNMP_SNMPV2AUTH 0x8000 /* V2 Authenticated requests only */
+
+/* default list of mibs to load */
+#define NETSNMP_DEFAULT_MIBS "IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB"
+
+/* debugging stuff */
+/* if defined, we optimize the code to exclude all debugging calls. */
+#undef NETSNMP_NO_DEBUGGING
+/* ignore the -D flag and always print debugging information */
+#define NETSNMP_ALWAYS_DEBUG 0
+
+/* reverse encoding BER packets is both faster and more efficient in space. */
+#define NETSNMP_USE_REVERSE_ASNENCODING 1
+#define NETSNMP_DEFAULT_ASNENCODING_DIRECTION 1 /* 1 = reverse, 0 = forwards */
+
+/* PERSISTENT_DIRECTORY: If defined, the library is capabile of saving
+ persisant information to this directory in the form of configuration
+ lines: PERSISTENT_DIRECTORY/NAME.persistent.conf */
+#define NETSNMP_PERSISTENT_DIRECTORY "/var/snmp"
+
+/* AGENT_DIRECTORY_MODE: the mode the agents should use to create
+ directories with. Since the data stored here is probably sensitive, it
+ probably should be read-only by root/administrator. */
+#define NETSNMP_AGENT_DIRECTORY_MODE 0700
+
+/* MAX_PERSISTENT_BACKUPS:
+ * The maximum number of persistent backups the library will try to
+ * read from the persistent cache directory. If an application fails to
+ * close down successfully more than this number of times, data will be lost.
+ */
+#define NETSNMP_MAX_PERSISTENT_BACKUPS 10
+
+/* define the system type include file here */
+#define NETSNMP_SYSTEM_INCLUDE_FILE <net-snmp/system/generic.h>
+
+/* define the machine (cpu) type include file here */
+#define NETSNMP_MACHINE_INCLUDE_FILE <net-snmp/machine/generic.h>
+
+/* define the UDP buffer defaults undefined means use the OS buffers
+ * by default */
+#undef NETSNMP_DEFAULT_SERVER_SEND_BUF
+#undef NETSNMP_DEFAULT_SERVER_RECV_BUF
+#undef NETSNMP_DEFAULT_CLIENT_SEND_BUF
+#undef NETSNMP_DEFAULT_CLIENT_RECV_BUF
+
+/* net-snmp's major path names */
+#undef SNMPLIBPATH
+#undef SNMPSHAREPATH
+#undef SNMPCONFPATH
+#undef SNMPDLMODPATH
+
+/* NETSNMP_LOGFILE: If defined it closes stdout/err/in and opens this in
+ out/err's place. (stdin is closed so that sh scripts won't wait for it) */
+#undef NETSNMP_LOGFILE
+
+/* default system contact */
+#undef NETSNMP_SYS_CONTACT
+
+/* system location */
+#undef NETSNMP_SYS_LOC
+
+/* Use libwrap to handle allow/deny hosts? */
+#undef NETSNMP_USE_LIBWRAP
+
+/* Mib-2 tree Info */
+/* These are the system information variables. */
+
+#define NETSNMP_VERS_DESC "unknown" /* overridden at run time */
+#define NETSNMP_SYS_NAME "unknown" /* overridden at run time */
+
+/* comment out the second define to turn off functionality for any of
+ these: (See README for details) */
+
+/* proc PROCESSNAME [MAX] [MIN] */
+#define NETSNMP_PROCMIBNUM 2
+
+/* exec/shell NAME COMMAND */
+#define NETSNMP_SHELLMIBNUM 8
+
+/* swap MIN */
+#define NETSNMP_MEMMIBNUM 4
+
+/* disk DISK MINSIZE */
+#define NETSNMP_DISKMIBNUM 9
+
+/* load 1 5 15 */
+#define NETSNMP_LOADAVEMIBNUM 10
+
+/* which version are you using? This mibloc will tell you */
+#define NETSNMP_VERSIONMIBNUM 100
+
+/* Reports errors the agent runs into */
+/* (typically its "can't fork, no mem" problems) */
+#define NETSNMP_ERRORMIBNUM 101
+
+/* The sub id of EXTENSIBLEMIB returned to queries of
+ .iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0 */
+#define NETSNMP_AGENTID 250
+
+/* This ID is returned after the AGENTID above. IE, the resulting
+ value returned by a query to sysObjectID is
+ EXTENSIBLEMIB.AGENTID.???, where ??? is defined below by OSTYPE */
+
+#define NETSNMP_HPUX9ID 1
+#define NETSNMP_SUNOS4ID 2
+#define NETSNMP_SOLARISID 3
+#define NETSNMP_OSFID 4
+#define NETSNMP_ULTRIXID 5
+#define NETSNMP_HPUX10ID 6
+#define NETSNMP_NETBSD1ID 7
+#define NETSNMP_FREEBSDID 8
+#define NETSNMP_IRIXID 9
+#define NETSNMP_LINUXID 10
+#define NETSNMP_BSDIID 11
+#define NETSNMP_OPENBSDID 12
+#define NETSNMP_WIN32ID 13
+#define NETSNMP_HPUX11ID 14
+#define NETSNMP_AIXID 15
+#define NETSNMP_MACOSXID 16
+#define NETSNMP_DRAGONFLYID 17
+#define NETSNMP_UNKNOWNID 255
+
+#ifdef hpux9
+#define NETSNMP_OSTYPE NETSNMP_HPUX9ID
+#endif
+#ifdef hpux10
+#define NETSNMP_OSTYPE NETSNMP_HPUX10ID
+#endif
+#ifdef hpux11
+#define NETSNMP_OSTYPE NETSNMP_HPUX11ID
+#endif
+#ifdef sunos4
+#define NETSNMP_OSTYPE NETSNMP_SUNOS4ID
+#endif
+#ifdef solaris2
+#define NETSNMP_OSTYPE NETSNMP_SOLARISID
+#endif
+#if defined(osf3) || defined(osf4) || defined(osf5)
+#define NETSNMP_OSTYPE NETSNMP_OSFID
+#endif
+#ifdef ultrix4
+#define NETSNMP_OSTYPE NETSNMP_ULTRIXID
+#endif
+#if defined(netbsd1) || defined(netbsd2)
+#define NETSNMP_OSTYPE NETSNMP_NETBSD1ID
+#endif
+#if defined(__FreeBSD__)
+#define NETSNMP_OSTYPE NETSNMP_FREEBSDID
+#endif
+#if defined(__DragonFly__)
+#define NETSNMP_OSTYPE NETSNMP_DRAGONFLYID
+#endif
+#if defined(irix6) || defined(irix5)
+#define NETSNMP_OSTYPE NETSNMP_IRIXID
+#endif
+#ifdef linux
+#define NETSNMP_OSTYPE NETSNMP_LINUXID
+#endif
+#if defined(bsdi2) || defined(bsdi3) || defined(bsdi4)
+#define NETSNMP_OSTYPE NETSNMP_BSDIID
+#endif
+#if defined(openbsd)
+#define NETSNMP_OSTYPE NETSNMP_OPENBSDID
+#endif
+#ifdef WIN32
+#define NETSNMP_OSTYPE NETSNMP_WIN32ID
+#endif
+#if defined(aix3) || defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+#define NETSNMP_OSTYPE NETSNMP_AIXID
+#endif
+#if defined(darwin) && (darwin >= 8)
+#define NETSNMP_OSTYPE NETSNMP_MACOSXID
+#endif
+/* unknown */
+#ifndef NETSNMP_OSTYPE
+#define NETSNMP_OSTYPE NETSNMP_UNKNOWNID
+#endif
+
+/* The enterprise number has been assigned by the IANA group. */
+/* Optionally, this may point to the location in the tree your */
+/* company/organization has been allocated. */
+/* The assigned enterprise number for the NET_SNMP MIB modules. */
+#define NETSNMP_ENTERPRISE_OID 8072
+#define NETSNMP_ENTERPRISE_MIB 1,3,6,1,4,1,8072
+#define NETSNMP_ENTERPRISE_DOT_MIB 1.3.6.1.4.1.8072
+#define NETSNMP_ENTERPRISE_DOT_MIB_LENGTH 7
+
+/* The assigned enterprise number for sysObjectID. */
+#define NETSNMP_SYSTEM_MIB 1,3,6,1,4,1,8072,3,2,NETSNMP_OSTYPE
+#define NETSNMP_SYSTEM_DOT_MIB 1.3.6.1.4.1.8072.3.2.NETSNMP_OSTYPE
+#define NETSNMP_SYSTEM_DOT_MIB_LENGTH 10
+
+/* The assigned enterprise number for notifications. */
+#define NETSNMP_NOTIFICATION_MIB 1,3,6,1,4,1,8072,4
+#define NETSNMP_NOTIFICATION_DOT_MIB 1.3.6.1.4.1.8072.4
+#define NETSNMP_NOTIFICATION_DOT_MIB_LENGTH 8
+
+/* this is the location of the ucdavis mib tree. It shouldn't be
+ changed, as the places it is used are expected to be constant
+ values or are directly tied to the UCD-SNMP-MIB. */
+#define NETSNMP_UCDAVIS_OID 2021
+#define NETSNMP_UCDAVIS_MIB 1,3,6,1,4,1,2021
+#define NETSNMP_UCDAVIS_DOT_MIB 1.3.6.1.4.1.2021
+#define NETSNMP_UCDAVIS_DOT_MIB_LENGTH 7
+
+/* how long to wait (seconds) for error querys before reseting the error trap.*/
+#define NETSNMP_ERRORTIMELENGTH 600
+
+/* Exec command to fix PROC problems */
+/* %s will be replaced by the process name in error */
+
+/* #define NETSNMP_PROCFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
+
+/* Exec command to fix EXEC problems */
+/* %s will be replaced by the exec/script name in error */
+
+/* #define NETSNMP_EXECFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
+
+/* Should exec output Cashing be used (speeds up things greatly), and
+ if so, After how many seconds should the cache re-newed? Note:
+ Don't define CASHETIME to disable cashing completely */
+
+#define NETSNMP_EXCACHETIME 30
+#define NETSNMP_CACHEFILE ".snmp-exec-cache"
+#define NETSNMP_MAXCACHESIZE (1500*80) /* roughly 1500 lines max */
+
+/* misc defaults */
+
+/* default of 100 meg minimum if the minimum size is not specified in
+ the config file */
+#define NETSNMP_DEFDISKMINIMUMSPACE 100000
+
+/* default maximum load average before error */
+#define NETSNMP_DEFMAXLOADAVE 12.0
+
+/* max times to loop reading output from execs. */
+/* Because of sleep(1)s, this will also be time to wait (in seconds) for exec
+ to finish */
+#define NETSNMP_MAXREADCOUNT 100
+
+/* Set if snmpgets should block and never timeout */
+/* The original CMU code had this hardcoded as = 1 */
+#define NETSNMP_SNMPBLOCK 1
+
+/* How long to wait before restarting the agent after a snmpset to
+ EXTENSIBLEMIB.VERSIONMIBNUM.VERRESTARTAGENT. This is
+ necessary to finish the snmpset reply before restarting. */
+#define NETSNMP_RESTARTSLEEP 5
+
+/* UNdefine to allow specifying zero-length community string */
+/* #define NETSNMP_NO_ZEROLENGTH_COMMUNITY 1 */
+
+/* Number of community strings to store */
+#define NETSNMP_NUM_COMMUNITIES 5
+
+/* internal define */
+#define NETSNMP_LASTFIELD -1
+
+/* Pluggable transports. */
+
+/* This is defined if support for the UDP/IP transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_UDP_DOMAIN
+
+/* This is defined if support for the "callback" transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+
+/* This is defined if support for the TCP/IP transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_TCP_DOMAIN
+
+/* This is defined if support for the Unix transport domain
+ (a.k.a. "local IPC") is available. */
+#undef NETSNMP_TRANSPORT_UNIX_DOMAIN
+
+/* This is defined if support for the AAL5 PVC transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
+
+/* This is defined if support for the IPX transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_IPX_DOMAIN
+
+/* This is defined if support for the UDP/IPv6 transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+
+/* This is defined if support for the TCP/IPv6 transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+
+/* This is defined if support for the TLS transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_TLSBASE_DOMAIN
+
+/* This is defined if support for the Alias transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_ALIAS_DOMAIN
+
+/* This is defined if support for the SSH transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_SSH_DOMAIN
+
+/* This is defined if support for the DTLS/UDP transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+/* This is defined if support for the TLS/TCP transport domain is
+ available. */
+#undef NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+/* This is defined if support for stdin/out transport domain is available. */
+#undef NETSNMP_TRANSPORT_STD_DOMAIN
+
+/* This is defined if support for the IPv4Base transport domain is available. */
+#undef NETSNMP_TRANSPORT_IPV4BASE_DOMAIN
+
+/* define this if the USM security module is available */
+#undef NETSNMP_SECMOD_USM
+
+/* define this if the KSM (kerberos based snmp) security module is available */
+#undef NETSNMP_SECMOD_KSM
+
+/* define this if the local security module is available */
+#undef NETSNMP_SECMOD_LOCALSM
+
+/* define if configured as a "mini-agent" */
+#undef NETSNMP_MINI_AGENT
+
+/* this is the location of the net-snmp mib tree. It shouldn't be
+ changed, as the places it is used are expected to be constant
+ values or are directly tied to the UCD-SNMP-MIB. */
+#define NETSNMP_OID 8072
+#define NETSNMP_MIB 1,3,6,1,4,1,8072
+#define NETSNMP_DOT_MIB 1.3.6.1.4.1.8072
+#define NETSNMP_DOT_MIB_LENGTH 7
+
+/* pattern for temporary file names */
+#define NETSNMP_TEMP_FILE_PATTERN "/tmp/snmpdXXXXXX"
+
+/*
+ * this must be before the system/machine includes, to allow them to
+ * override and turn off inlining. To do so, they should do the
+ * following:
+ *
+ * #undef NETSNMP_ENABLE_INLINE
+ * #define NETSNMP_ENABLE_INLINE 0
+ *
+ * A user having problems with their compiler can also turn off
+ * the use of inline by defining NETSNMP_NO_INLINE via their cflags:
+ *
+ * -DNETSNMP_NO_INLINE
+ *
+ * Header and source files should only test against NETSNMP_USE_INLINE:
+ *
+ * #ifdef NETSNMP_USE_INLINE
+ * NETSNMP_INLINE function(int parm) { return parm -1; }
+ * #endif
+ *
+ * Functions which should be static, regardless of whether or not inline
+ * is available or enabled should use the NETSNMP_STATIC_INLINE macro,
+ * like so:
+ *
+ * NETSNMP_STATIC_INLINE function(int parm) { return parm -1; }
+ *
+ * NOT like this:
+ *
+ * static NETSNMP_INLINE function(int parm) { return parm -1; }
+ *
+ */
+#ifdef NETSNMP_BROKEN_INLINE
+# define NETSNMP_ENABLE_INLINE 0
+#else
+# define NETSNMP_ENABLE_INLINE 1
+#endif
+
+#include NETSNMP_SYSTEM_INCLUDE_FILE
+#include NETSNMP_MACHINE_INCLUDE_FILE
+
+#if NETSNMP_ENABLE_INLINE && !defined(NETSNMP_NO_INLINE)
+# define NETSNMP_USE_INLINE 1
+# ifndef NETSNMP_INLINE
+# define NETSNMP_INLINE inline
+# endif
+# ifndef NETSNMP_STATIC_INLINE
+# define NETSNMP_STATIC_INLINE static inline
+# endif
+#else
+# define NETSNMP_INLINE
+# define NETSNMP_STATIC_INLINE static
+#endif
+
+#ifndef NETSNMP_IMPORT
+# define NETSNMP_IMPORT extern
+#endif
+
+/* comment the next line if you are compiling with libsnmp.h
+ and are not using the UC-Davis SNMP library. */
+#define UCD_SNMP_LIBRARY 1
+
+/* final conclusion on nlist usage */
+#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(NETSNMP_DONT_USE_NLIST) && defined(HAVE_KMEM) && !defined(NETSNMP_NO_KMEM_USAGE)
+#define NETSNMP_CAN_USE_NLIST
+#endif
+
+
+/* ********* NETSNMP_MARK_BEGIN_LEGACY_DEFINITIONS *********/
+/*
+ * existing definitions prior to Net-SNMP 5.4
+ *
+ * do not add anything new here
+ *
+ */
+
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+
+#ifdef NETSNMP_DEFAULT_SNMP_VERSION
+# define DEFAULT_SNMP_VERSION NETSNMP_DEFAULT_SNMP_VERSION
+#endif
+
+#ifdef NETSNMP_SNMPV1
+# define SNMPV1 NETSNMP_SNMPV1
+#endif
+
+#ifdef NETSNMP_SNMPV2ANY
+# define SNMPV2ANY NETSNMP_SNMPV2ANY
+#endif
+
+#ifdef NETSNMP_SNMPV2AUTH
+# define SNMPV2AUTH NETSNMP_SNMPV2AUTH
+#endif
+
+#ifdef NETSNMP_DEFAULT_MIBS
+# define DEFAULT_MIBS NETSNMP_DEFAULT_MIBS
+#endif
+
+#ifdef NETSNMP_DEFAULT_MIBDIRS
+# define DEFAULT_MIBDIRS NETSNMP_DEFAULT_MIBDIRS
+#endif
+
+#ifdef NETSNMP_DEFAULT_MIBFILES
+# define DEFAULT_MIBFILES NETSNMP_DEFAULT_MIBFILES
+#endif
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+# define OPAQUE_SPECIAL_TYPES NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+#endif
+
+#ifdef NETSNMP_ENABLE_SCAPI_AUTHPRIV
+# define SCAPI_AUTHPRIV NETSNMP_ENABLE_SCAPI_AUTHPRIV
+#endif
+
+#ifdef NETSNMP_USE_INTERNAL_MD5
+# define USE_INTERNAL_MD5 NETSNMP_USE_INTERNAL_MD5
+#endif
+
+#ifdef NETSNMP_USE_PKCS11
+# define USE_PKCS NETSNMP_USE_PKCS11
+#endif
+
+#ifdef NETSNMP_USE_OPENSSL
+# define USE_OPENSSL NETSNMP_USE_OPENSSL
+#endif
+
+#ifdef NETSNMP_NO_DEBUGGING
+# define SNMP_NO_DEBUGGING NETSNMP_NO_DEBUGGING
+#endif
+
+#ifdef NETSNMP_ALWAYS_DEBUG
+# define SNMP_ALWAYS_DEBUG NETSNMP_ALWAYS_DEBUG
+#endif
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+# define USE_REVERSE_ASNENCODING NETSNMP_USE_REVERSE_ASNENCODING
+#endif
+#ifdef NETSNMP_DEFAULT_ASNENCODING_DIRECTION
+# define DEFAULT_ASNENCODING_DIRECTION NETSNMP_DEFAULT_ASNENCODING_DIRECTION
+#endif
+
+#define PERSISTENT_DIRECTORY NETSNMP_PERSISTENT_DIRECTORY
+#define PERSISTENT_MASK NETSNMP_PERSISTENT_MASK
+#define AGENT_DIRECTORY_MODE NETSNMP_AGENT_DIRECTORY_MODE
+#define MAX_PERSISTENT_BACKUPS NETSNMP_MAX_PERSISTENT_BACKUPS
+#define SYSTEM_INCLUDE_FILE NETSNMP_SYSTEM_INCLUDE_FILE
+#define MACHINE_INCLUDE_FILE NETSNMP_MACHINE_INCLUDE_FILE
+
+#ifdef NETSNMP_DEFAULT_SERVER_SEND_BUF
+# define DEFAULT_SERVER_SEND_BUF NETSNMP_DEFAULT_SERVER_SEND_BUF
+#endif
+#ifdef NETSNMP_DEFAULT_SERVER_RECV_BUF
+# define DEFAULT_SERVER_RECV_BUF NETSNMP_DEFAULT_SERVER_RECV_BUF
+#endif
+#ifdef NETSNMP_DEFAULT_CLIENT_SEND_BUF
+# define DEFAULT_CLIENT_SEND_BUF NETSNMP_DEFAULT_CLIENT_SEND_BUF
+#endif
+#ifdef NETSNMP_DEFAULT_CLIENT_RECV_BUF
+# define DEFAULT_CLIENT_RECV_BUF NETSNMP_DEFAULT_CLIENT_RECV_BUF
+#endif
+
+#ifdef NETSNMP_LOGFILE
+# define LOGFILE NETSNMP_LOGFILE
+#endif
+
+#ifdef NETSNMP_SYS_CONTACT
+# define SYS_CONTACT NETSNMP_SYS_CONTACT
+#endif
+
+#ifdef NETSNMP_SYS_LOC
+# define SYS_LOC NETSNMP_SYS_LOC
+#endif
+
+#ifdef NETSNMP_USE_LIBWRAP
+# define USE_LIBWRAP NETSNMP_USE_LIBWRAP
+#endif
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+# define SNMP_TESTING_CODE NETSNMP_ENABLE_TESTING_CODE
+#endif
+
+#ifdef NETSNMP_NO_ROOT_ACCESS
+# define NO_ROOT_ACCESS NETSNMP_NO_ROOT_ACCESS
+#endif
+
+#ifdef NETSNMP_NO_KMEM_USAGE
+# define NO_KMEM_USAGE NETSNMP_NO_KMEM_USAGE
+#endif
+
+#ifdef NETSNMP_NO_DUMMY_VALUES
+# define NO_DUMMY_VALUES NETSNMP_NO_DUMMY_VALUES
+#endif
+
+#define VERS_DESC NETSNMP_VERS_DESC
+#define SYS_NAME NETSNMP_SYS_NAME
+
+#define PROCMIBNUM NETSNMP_PROCMIBNUM
+#define SHELLMIBNUM NETSNMP_SHELLMIBNUM
+#define MEMMIBNUM NETSNMP_MEMMIBNUM
+#define DISKMIBNUM NETSNMP_DISKMIBNUM
+
+#define LOADAVEMIBNUM NETSNMP_LOADAVEMIBNUM
+#define VERSIONMIBNUM NETSNMP_VERSIONMIBNUM
+#define ERRORMIBNUM NETSNMP_ERRORMIBNUM
+#define AGENTID NETSNMP_AGENTID
+
+#define HPUX9ID NETSNMP_HPUX9ID
+#define SUNOS4ID NETSNMP_SUNOS4ID
+#define SOLARISID NETSNMP_SOLARISID
+#define OSFID NETSNMP_OSFID
+#define ULTRIXID NETSNMP_ULTRIXID
+#define HPUX10ID NETSNMP_HPUX10ID
+#define NETBSD1ID NETSNMP_NETBSD1ID
+#define FREEBSDID NETSNMP_FREEBSDID
+#define IRIXID NETSNMP_IRIXID
+#define LINUXID NETSNMP_LINUXID
+#define BSDIID NETSNMP_BSDIID
+#define OPENBSDID NETSNMP_OPENBSDID
+#define WIN32ID NETSNMP_WIN32ID
+#define HPUX11ID NETSNMP_HPUX11ID
+#define AIXID NETSNMP_AIXID
+#define MACOSXID NETSNMP_MACOSXID
+#define UNKNOWNID NETSNMP_UNKNOWNID
+
+#define ENTERPRISE_OID NETSNMP_ENTERPRISE_OID
+#define ENTERPRISE_MIB NETSNMP_ENTERPRISE_MIB
+#define ENTERPRISE_DOT_MIB NETSNMP_ENTERPRISE_DOT_MIB
+#define ENTERPRISE_DOT_MIB_LENGTH NETSNMP_ENTERPRISE_DOT_MIB_LENGTH
+
+#define SYSTEM_MIB NETSNMP_SYSTEM_MIB
+#define SYSTEM_DOT_MIB NETSNMP_SYSTEM_DOT_MIB
+#define SYSTEM_DOT_MIB_LENGTH NETSNMP_SYSTEM_DOT_MIB_LENGTH
+
+#define NOTIFICATION_MIB NETSNMP_NOTIFICATION_MIB
+#define NOTIFICATION_DOT_MIB NETSNMP_NOTIFICATION_DOT_MIB
+#define NOTIFICATION_DOT_MIB_LENGTH NETSNMP_NOTIFICATION_DOT_MIB_LENGTH
+
+#define UCDAVIS_OID NETSNMP_UCDAVIS_OID
+#define UCDAVIS_MIB NETSNMP_UCDAVIS_MIB
+#define UCDAVIS_DOT_MIB NETSNMP_UCDAVIS_DOT_MIB
+#define UCDAVIS_DOT_MIB_LENGTH NETSNMP_UCDAVIS_DOT_MIB_LENGTH
+
+#define ERRORTIMELENGTH NETSNMP_ERRORTIMELENGTH
+
+#ifdef NETSNMP_PROCFIXCMD
+# define PROCFIXCMD NETSNMP_PROCFIXCMD
+#endif
+
+#ifdef NETSNMP_EXECFIXCMD
+# define EXECFIXCMD NETSNMP_EXECFIXCMD
+#endif
+
+#define EXCACHETIME NETSNMP_EXCACHETIME
+#define CACHEFILE NETSNMP_CACHEFILE
+#define MAXCACHESIZE NETSNMP_MAXCACHESIZE
+
+#define DEFDISKMINIMUMSPACE NETSNMP_DEFDISKMINIMUMSPACE
+#define DEFMAXLOADAVE NETSNMP_DEFMAXLOADAVE
+#define MAXREADCOUNT NETSNMP_MAXREADCOUNT
+
+#define SNMPBLOCK NETSNMP_SNMPBLOCK
+#define RESTARTSLEEP NETSNMP_RESTARTSLEEP
+
+#define NUM_COMMUNITIES NETSNMP_NUM_COMMUNITIES
+
+#ifdef NETSNMP_NO_ZEROLENGTH_COMMUNITY
+# define NO_ZEROLENGTH_COMMUNITY NETSNMP_NO_ZEROLENGTH_COMMUNITY
+#endif
+
+#define LASTFIELD NETSNMP_LASTFIELD
+
+#define CONFIGURE_OPTIONS NETSNMP_CONFIGURE_OPTIONS
+
+#ifdef NETSNMP_TRANSPORT_UDP_DOMAIN
+# define SNMP_TRANSPORT_UDP_DOMAIN NETSNMP_TRANSPORT_UDP_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+# define SNMP_TRANSPORT_CALLBACK_DOMAIN NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_TCP_DOMAIN
+# define SNMP_TRANSPORT_TCP_DOMAIN NETSNMP_TRANSPORT_TCP_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+# define SNMP_TRANSPORT_UNIX_DOMAIN NETSNMP_TRANSPORT_UNIX_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
+# define SNMP_TRANSPORT_AAL5PVC_DOMAIN NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_IPX_DOMAIN
+# define SNMP_TRANSPORT_IPX_DOMAIN NETSNMP_TRANSPORT_IPX_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+# define SNMP_TRANSPORT_UDPIPV6_DOMAIN NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+# define SNMP_TRANSPORT_TCPIPV6_DOMAIN NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_TLS_DOMAIN
+# define SNMP_TRANSPORT_TLS_DOMAIN NETSNMP_TRANSPORT_TLS_DOMAIN
+#endif
+
+#ifdef NETSNMP_TRANSPORT_STD_DOMAIN
+# define SNMP_TRANSPORT_STD_DOMAIN NETSNMP_TRANSPORT_STD_DOMAIN
+#endif
+
+#ifdef NETSNMP_SECMOD_USM
+# define SNMP_SECMOD_USM NETSNMP_SECMOD_USM
+#endif
+
+#ifdef NETSNMP_SECMOD_KSM
+# define SNMP_SECMOD_KSM NETSNMP_SECMOD_KSM
+#endif
+
+#ifdef NETSNMP_SECMOD_LOCALSM
+# define SNMP_SECMOD_LOCALSM NETSNMP_SECMOD_LOCALSM
+#endif
+
+#ifdef NETSNMP_REENTRANT
+# define NS_REENTRANT NETSNMP_REENTRANT
+#endif
+
+#ifdef NETSNMP_ENABLE_IPV6
+# define INET6 NETSNMP_ENABLE_IPV6
+#endif
+
+#ifdef NETSNMP_ENABLE_LOCAL_SMUX
+# define LOCAL_SMUX NETSNMP_ENABLE_LOCAL_SMUX
+#endif
+
+#ifdef NETSNMP_AGENTX_DOM_SOCK_ONLY
+# define AGENTX_DOM_SOCK_ONLY NETSNMP_AGENTX_DOM_SOCK_ONLY
+#endif
+
+#ifdef NETSNMP_SNMPTRAPD_DISABLE_AGENTX
+# define SNMPTRAPD_DISABLE_AGENTX
+#endif
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+# define MIT_NEW_CRYPTO NETSNMP_USE_KERBEROS_MIT
+#endif
+
+#ifdef NETSNMP_USE_KERBEROS_HEIMDAL
+# define HEIMDAL NETSNMP_USE_KERBEROS_HEIMDAL
+#endif
+
+#ifdef NETSNMP_AGENTX_SOCKET
+# define AGENTX_SOCKET NETSNMP_AGENTX_SOCKET
+#endif
+
+#ifdef NETSNMP_DISABLE_MIB_LOADING
+# define DISABLE_MIB_LOADING NETSNMP_DISABLE_MIB_LOADING
+#endif
+
+#ifdef NETSNMP_DISABLE_SNMPV1
+# define DISABLE_SNMPV1 NETSNMP_DISABLE_SNMPV1
+#endif
+
+#ifdef NETSNMP_DISABLE_SNMPV2C
+# define DISABLE_SNMPV2C NETSNMP_DISABLE_SNMPV2C
+#endif
+
+#ifdef NETSNMP_DISABLE_SET_SUPPORT
+# define DISABLE_SET_SUPPORT NETSNMP_DISABLE_SET_SUPPORT
+#endif
+
+#ifdef NETSNMP_DISABLE_DES
+# define DISABLE_DES NETSNMP_DISABLE_DES
+#endif
+
+#ifdef NETSNMP_DISABLE_MD5
+# define DISABLE_MD5 NETSNMP_DISABLE_MD5
+#endif
+
+#ifdef NETSNMP_DONT_USE_NLIST
+# define DONT_USE_NLIST NETSNMP_DONT_USE_NLIST
+#endif
+
+#ifdef NETSNMP_CAN_USE_NLIST
+# define CAN_USE_NLIST NETSNMP_CAN_USE_NLIST
+#endif
+
+#ifdef NETSNMP_CAN_USE_SYSCTL
+# define CAN_USE_SYSCTL NETSNMP_CAN_USE_SYSCTL
+#endif
+
+#endif /* NETSNMP_NO_LEGACY_DEFINITIONS */
+
+
+#endif /* NET_SNMP_CONFIG_H */
diff --git a/include/net-snmp/net-snmp-features.h b/include/net-snmp/net-snmp-features.h
new file mode 100644
index 0000000..f37e6c5
--- /dev/null
+++ b/include/net-snmp/net-snmp-features.h
@@ -0,0 +1,32 @@
+#ifndef NETSNMP_FEATURES_H
+#define NETSNMP_FEATURES_H
+
+/* include files that are only needed if --enable-minimalist is on */
+#ifdef NETSNMP_MINIMAL_CODE
+#ifdef NETSNMP_FEATURE_CHECKING
+#include <net-snmp/feature-details.h>
+#else /* ! NETSNMP_FEATURE_CHECKING */
+#include <net-snmp/library/features.h>
+#ifndef NETSNMP_DISABLE_AGENT
+#include <net-snmp/agent/features.h>
+#include <net-snmp/agent/features-mibgroups.h>
+#endif
+#ifndef NETSNMP_DISABLE_APPS
+#include <net-snmp/features-snmpnetstat.h>
+#include <net-snmp/features-apps.h>
+#endif
+#endif /* ! NETSNMP_FEATURE_CHECKING */
+#endif /* NETSNMP_MINIMAL_CODE */
+
+
+/* prototypes always needed */
+#ifndef NETSNMP_FEATURE_CHECKING
+#define netsnmp_feature_provide(X)
+#define netsnmp_feature_require(X)
+#define netsnmp_feature_want(X)
+#define netsnmp_feature_child_of(X, Y)
+#endif
+
+#define netsnmp_feature_unused(X) char netsnmp_feature_unused_ ## X
+
+#endif /* NETSNMP_FEATURES_H */
diff --git a/include/net-snmp/net-snmp-includes.h b/include/net-snmp/net-snmp-includes.h
new file mode 100644
index 0000000..3ee62ae
--- /dev/null
+++ b/include/net-snmp/net-snmp-includes.h
@@ -0,0 +1,80 @@
+#ifndef NET_SNMP_INCLUDES_H
+#define NET_SNMP_INCLUDES_H
+
+ /**
+ * Convenience header file to pull in the full
+ * Net-SNMP library API in one go, together with
+ * certain commonly-required system header files.
+ */
+
+
+ /*
+ * Common system header requirements
+ */
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#ifndef NET_SNMP_CONFIG_H
+#error "Please include <net-snmp/net-snmp-config.h> before this file"
+#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_NETINET_IN_H
+#include <netinet/in.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
+
+/*
+ * Must be right after system headers, but before library code for best usage
+ */
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+ /*
+ * The check for missing 'in_addr_t' is handled
+ * within the main net-snmp-config.h file
+ */
+
+
+ /*
+ * The full Net-SNMP API
+ */
+#include <net-snmp/definitions.h>
+#include <net-snmp/types.h>
+
+#include <net-snmp/library/getopt.h>
+#include <net-snmp/utilities.h>
+#include <net-snmp/session_api.h>
+#include <net-snmp/pdu_api.h>
+#include <net-snmp/mib_api.h>
+#include <net-snmp/varbind_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/snmpv3_api.h>
+
+#endif /* NET_SNMP_INCLUDES_H */
diff --git a/include/net-snmp/openssl_md5.h b/include/net-snmp/openssl_md5.h
new file mode 100644
index 0000000..1e85f31
--- /dev/null
+++ b/include/net-snmp/openssl_md5.h
@@ -0,0 +1,116 @@
+/* crypto/md5/md5.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_MD5_H
+#define HEADER_MD5_H
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef OPENSSL_NO_MD5
+#error MD5 is disabled.
+#endif
+
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! MD5_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+#if defined(__LP32__)
+#define MD5_LONG unsigned long
+#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+#define MD5_LONG unsigned long
+#define MD5_LONG_LOG2 3
+/*
+ * _CRAY note. I could declare short, but I have no idea what impact
+ * does it have on performance on none-T3E machines. I could declare
+ * int, but at least on C90 sizeof(int) can be chosen at compile time.
+ * So I've chosen long...
+ * <appro@fy.chalmers.se>
+ */
+#else
+#define MD5_LONG unsigned int
+#endif
+
+#define MD5_CBLOCK 64
+#define MD5_LBLOCK (MD5_CBLOCK/4)
+#define MD5_DIGEST_LENGTH 16
+
+typedef struct MD5state_st
+ {
+ MD5_LONG A,B,C,D;
+ MD5_LONG Nl,Nh;
+ MD5_LONG data[MD5_LBLOCK];
+ unsigned int num;
+ } MD5_CTX;
+
+int MD5_Init(MD5_CTX *c);
+int MD5_Update(MD5_CTX *c, const void *data, size_t len);
+int MD5_Final(unsigned char *md, MD5_CTX *c);
+unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
+void MD5_Transform(MD5_CTX *c, const unsigned char *b);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/net-snmp/output_api.h b/include/net-snmp/output_api.h
new file mode 100644
index 0000000..3bf3172
--- /dev/null
+++ b/include/net-snmp/output_api.h
@@ -0,0 +1,157 @@
+#ifndef NET_SNMP_OUTPUT_API_H
+#define NET_SNMP_OUTPUT_API_H
+
+ /**
+ * Library API routines concerned with logging and message output
+ * (including error handling and debugging).
+ */
+
+#include <net-snmp/types.h>
+#include <stdarg.h> /* for va_list */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Error reporting */
+ NETSNMP_IMPORT
+ void snmp_error(netsnmp_session *sess, int *clib_errorno,
+ int *snmp_errorno, char **errstring);
+ NETSNMP_IMPORT
+ void snmp_sess_error( void *sess, int *clib_errorno,
+ int *snmp_errorno, char **errstring);
+
+ NETSNMP_IMPORT
+ const char *snmp_api_errstring(int snmp_errorno); /* library errors */
+ NETSNMP_IMPORT
+ const char *snmp_errstring(int snmp_errorno); /* protocol errors */
+
+ NETSNMP_IMPORT
+ void snmp_perror(const char *msg); /* for parsing errors only */
+
+ NETSNMP_IMPORT
+ void snmp_sess_perror(const char *msg, netsnmp_session *sess);
+ /* for all other SNMP library errors */
+ NETSNMP_IMPORT
+ void snmp_log_perror(const char *msg);
+ /* for system library errors */
+
+ /* Logging messages */
+
+#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#define _LOG_ATTR
+#else
+#define _LOG_ATTR __attribute__ ((__format__ (__printf__, 2, 3)))
+#endif
+
+ NETSNMP_IMPORT
+ int snmp_log( int priority, const char *format, ...) _LOG_ATTR;
+ NETSNMP_IMPORT
+ int snmp_vlog(int priority, const char *format, va_list ap);
+ NETSNMP_IMPORT
+ int snmp_get_do_logging( void);
+ NETSNMP_IMPORT
+ void netsnmp_logging_restart(void);
+ NETSNMP_IMPORT
+ void snmp_disable_log( void);
+ NETSNMP_IMPORT
+ void shutdown_snmp_logging( void);
+
+#undef _LOG_ATTR
+
+ /* Debug messages */
+#ifndef NETSNMP_NO_DEBUGGING
+#include <net-snmp/library/snmp_debug.h> /* for internal macros */
+#define DEBUGMSG(x) do {if (_DBG_IF_) {debugmsg x;} }while(0)
+#define DEBUGMSGT(x) do {if (_DBG_IF_) {__DBGMSGT(x);} }while(0)
+#define DEBUGTRACE do {if (_DBG_IF_) {__DBGTRACE;} }while(0)
+#define DEBUGTRACETOK(x) do {if (_DBG_IF_) {__DBGTRACETOK(x);} }while(0)
+#define DEBUGMSGL(x) do {if (_DBG_IF_) {__DBGMSGL(x);} }while(0)
+#define DEBUGMSGTL(x) do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
+#define DEBUGMSGOID(x) do {if (_DBG_IF_) {__DBGMSGOID(x);} }while(0)
+#define DEBUGMSGSUBOID(x) do {if (_DBG_IF_) {__DBGMSGSUBOID(x);} }while(0)
+#define DEBUGMSGVAR(x) do {if (_DBG_IF_) {__DBGMSGVAR(x);} }while(0)
+#define DEBUGMSGOIDRANGE(x) do {if (_DBG_IF_) {__DBGMSGOIDRANGE(x);} }while(0)
+#define DEBUGMSGHEX(x) do {if (_DBG_IF_) {__DBGMSGHEX(x);} }while(0)
+#define DEBUGMSGHEXTLI(x) do {if (_DBG_IF_) {__DBGMSGHEXTLI(x);} }while(0)
+#define DEBUGINDENTADD(x) do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
+#define DEBUGINDENTMORE() do {if (_DBG_IF_) {__DBGINDENTMORE();} }while(0)
+#define DEBUGINDENTLESS() do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
+#define DEBUGPRINTINDENT(token) \
+ do {if (_DBG_IF_) {__DBGPRINTINDENT(token);} }while(0)
+#define DEBUGDUMPHEADER(token,x) \
+ do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
+#define DEBUGDUMPSECTION(token,x) \
+ do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
+#define DEBUGDUMPSETUP(token,buf,len) \
+ do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
+#define DEBUGMSG_NC(x) do { __DBGMSG_NC(x); }while(0)
+#define DEBUGMSGT_NC(x) do { __DBGMSGT_NC(x); }while(0)
+
+#else /* NETSNMP_NO_DEBUGGING := enable streamlining of the code */
+
+#define DEBUGMSG(x)
+#define DEBUGMSGT(x)
+#define DEBUGTRACE
+#define DEBUGTRACETOK(x)
+#define DEBUGMSGL(x)
+#define DEBUGMSGTL(x)
+#define DEBUGMSGOID(x)
+#define DEBUGMSGSUBOID(x)
+#define DEBUGMSGVAR(x)
+#define DEBUGMSGOIDRANGE(x)
+#define DEBUGMSGHEX(x)
+#define DEBUGIF(x) if(0)
+#define DEBUGDUMP(t,b,l,p)
+#define DEBUGINDENTMORE()
+#define DEBUGINDENTLESS()
+#define DEBUGINDENTADD(x)
+#define DEBUGMSGHEXTLI(x)
+#define DEBUGPRINTINDENT(token)
+#define DEBUGDUMPHEADER(token,x)
+#define DEBUGDUMPSECTION(token,x)
+#define DEBUGDUMPSETUP(token, buf, len)
+
+#define DEBUGMSG_NC(x)
+#define DEBUGMSGT_NC(x)
+
+#endif /* NETSNMP_NO_DEBUGGING */
+
+ NETSNMP_IMPORT
+ void debug_register_tokens(const char *tokens);
+ NETSNMP_IMPORT
+ int debug_is_token_registered(const char *token);
+ NETSNMP_IMPORT
+ void snmp_set_do_debugging(int);
+ NETSNMP_IMPORT
+ int snmp_get_do_debugging(void);
+
+ /*
+ * Having extracted the main ("public API") calls relevant
+ * to this area of the Net-SNMP project, the next step is to
+ * identify the related "public internal API" routines.
+ *
+ * In due course, these should probably be gathered
+ * together into a companion 'library/output_api.h' header file.
+ * [Or some suitable name]
+ *
+ * But for the time being, the expectation is that the
+ * traditional headers that provided the above definitions
+ * will probably also cover the relevant internal API calls.
+ * Hence they are listed here:
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_client.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/snmp_logging.h>
+
+#ifndef ERROR_MSG
+#define ERROR_MSG(string) snmp_set_detail(string)
+#endif
+
+#endif /* NET_SNMP_OUTPUT_API_H */
diff --git a/include/net-snmp/pdu_api.h b/include/net-snmp/pdu_api.h
new file mode 100644
index 0000000..125595d
--- /dev/null
+++ b/include/net-snmp/pdu_api.h
@@ -0,0 +1,46 @@
+#ifndef NET_SNMP_PDU_API_H
+#define NET_SNMP_PDU_API_H
+
+ /**
+ * Library API routines concerned with SNMP PDUs.
+ */
+
+#include <net-snmp/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+NETSNMP_IMPORT
+netsnmp_pdu *snmp_pdu_create(int type);
+NETSNMP_IMPORT
+netsnmp_pdu *snmp_clone_pdu(netsnmp_pdu *pdu);
+NETSNMP_IMPORT
+netsnmp_pdu *snmp_fix_pdu( netsnmp_pdu *pdu, int idx);
+NETSNMP_IMPORT
+void snmp_free_pdu( netsnmp_pdu *pdu);
+
+#ifdef __cplusplus
+}
+#endif
+
+ /*
+ * Having extracted the main ("public API") calls relevant
+ * to this area of the Net-SNMP project, the next step is to
+ * identify the related "public internal API" routines.
+ *
+ * In due course, these should probably be gathered
+ * together into a companion 'library/pdu_api.h' header file.
+ * [Or some suitable name]
+ *
+ * But for the time being, the expectation is that the
+ * traditional headers that provided the above definitions
+ * will probably also cover the relevant internal API calls.
+ * Hence they are listed here:
+ */
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_client.h>
+#include <net-snmp/library/asn1.h>
+
+#endif /* NET_SNMP_PDU_API_H */
diff --git a/include/net-snmp/session_api.h b/include/net-snmp/session_api.h
new file mode 100644
index 0000000..88dbc41
--- /dev/null
+++ b/include/net-snmp/session_api.h
@@ -0,0 +1,311 @@
+#ifndef NET_SNMP_SESSION_API_H
+#define NET_SNMP_SESSION_API_H
+
+ /**
+ * Library API routines concerned with specifying and using SNMP "sessions"
+ * including sending and receiving requests.
+ */
+
+#include <net-snmp/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ NETSNMP_IMPORT
+ void snmp_sess_init(netsnmp_session *);
+
+ /*
+ * netsnmp_session *snmp_open(session)
+ * netsnmp_session *session;
+ *
+ * Sets up the session with the snmp_session information provided
+ * by the user. Then opens and binds the necessary UDP port.
+ * A handle to the created session is returned (this is different than
+ * the pointer passed to snmp_open()). On any error, NULL is returned
+ * and snmp_errno is set to the appropriate error code.
+ */
+ NETSNMP_IMPORT
+ netsnmp_session *snmp_open(netsnmp_session *);
+
+ /*
+ * int snmp_close(session)
+ * netsnmp_session *session;
+ *
+ * Close the input session. Frees all data allocated for the session,
+ * dequeues any pending requests, and closes any sockets allocated for
+ * the session. Returns 0 on error, 1 otherwise.
+ *
+ * snmp_close_sessions() does the same thing for all open sessions
+ */
+ NETSNMP_IMPORT
+ int snmp_close(netsnmp_session *);
+ NETSNMP_IMPORT
+ int snmp_close_sessions(void);
+
+
+ /*
+ * int snmp_send(session, pdu)
+ * netsnmp_session *session;
+ * netsnmp_pdu *pdu;
+ *
+ * Sends the input pdu on the session after calling snmp_build to create
+ * a serialized packet. If necessary, set some of the pdu data from the
+ * session defaults. Add a request corresponding to this pdu to the list
+ * of outstanding requests on this session, then send the pdu.
+ * Returns the request id of the generated packet if applicable, otherwise 1.
+ * On any error, 0 is returned.
+ * The pdu is freed by snmp_send() unless a failure occured.
+ */
+ NETSNMP_IMPORT
+ int snmp_send(netsnmp_session *, netsnmp_pdu *);
+
+ /*
+ * int snmp_async_send(session, pdu, callback, cb_data)
+ * netsnmp_session *session;
+ * netsnmp_pdu *pdu;
+ * netsnmp_callback callback;
+ * void *cb_data;
+ *
+ * Sends the input pdu on the session after calling snmp_build to create
+ * a serialized packet. If necessary, set some of the pdu data from the
+ * session defaults. Add a request corresponding to this pdu to the list
+ * of outstanding requests on this session and store callback and data,
+ * then send the pdu.
+ * Returns the request id of the generated packet if applicable, otherwise 1.
+ * On any error, 0 is returned.
+ * The pdu is freed by snmp_send() unless a failure occured.
+ */
+ NETSNMP_IMPORT
+ int snmp_async_send(netsnmp_session *, netsnmp_pdu *,
+ netsnmp_callback, void *);
+
+
+ /*
+ * void snmp_read(fdset)
+ * fd_set *fdset;
+ *
+ * Checks to see if any of the fd's set in the fdset belong to
+ * snmp. Each socket with it's fd set has a packet read from it
+ * and snmp_parse is called on the packet received. The resulting pdu
+ * is passed to the callback routine for that session. If the callback
+ * routine returns successfully, the pdu and it's request are deleted.
+ */
+ NETSNMP_IMPORT
+ void snmp_read(fd_set *);
+
+ /*
+ * snmp_read2() is similar to snmp_read(), but accepts a pointer to a
+ * large file descriptor set instead of a pointer to a regular file
+ * descriptor set.
+ */
+ NETSNMP_IMPORT
+ void snmp_read2(netsnmp_large_fd_set *);
+
+
+ NETSNMP_IMPORT
+ int snmp_synch_response(netsnmp_session *, netsnmp_pdu *,
+ netsnmp_pdu **);
+
+ /*
+ * int snmp_select_info(numfds, fdset, timeout, block)
+ * int *numfds;
+ * fd_set *fdset;
+ * struct timeval *timeout;
+ * int *block;
+ *
+ * Returns info about what snmp requires from a select statement.
+ * numfds is the number of fds in the list that are significant.
+ * All file descriptors opened for SNMP are OR'd into the fdset.
+ * If activity occurs on any of these file descriptors, snmp_read
+ * should be called with that file descriptor set.
+ *
+ * The timeout is the latest time that SNMP can wait for a timeout. The
+ * select should be done with the minimum time between timeout and any other
+ * timeouts necessary. This should be checked upon each invocation of select.
+ * If a timeout is received, snmp_timeout should be called to check if the
+ * timeout was for SNMP. (snmp_timeout is idempotent)
+ *
+ * Block is 1 if the select is requested to block indefinitely, rather than
+ * time out. If block is input as 1, the timeout value will be treated as
+ * undefined, but it must be available for setting in snmp_select_info. On
+ * return, if block is true, the value of timeout will be undefined.
+ *
+ * snmp_select_info returns the number of open sockets. (i.e. The number
+ * of sessions open)
+ */
+ NETSNMP_IMPORT
+ int snmp_select_info(int *, fd_set *, struct timeval *,
+ int *);
+
+ /*
+ * snmp_select_info2() is similar to snmp_select_info(), but accepts a
+ * pointer to a large file descriptor set instead of a pointer to a
+ * regular file descriptor set.
+ */
+ NETSNMP_IMPORT
+ int snmp_select_info2(int *, netsnmp_large_fd_set *,
+ struct timeval *, int *);
+
+#define NETSNMP_SELECT_NOFLAGS 0x00
+#define NETSNMP_SELECT_NOALARMS 0x01
+ NETSNMP_IMPORT
+ int snmp_sess_select_info_flags(void *, int *, fd_set *,
+ struct timeval *, int *, int);
+ int snmp_sess_select_info2_flags(void *, int *,
+ netsnmp_large_fd_set *,
+ struct timeval *, int *, int);
+
+ /*
+ * void snmp_timeout();
+ *
+ * snmp_timeout should be called whenever the timeout from snmp_select_info
+ * expires, but it is idempotent, so snmp_timeout can be polled (probably a
+ * cpu expensive proposition). snmp_timeout checks to see if any of the
+ * sessions have an outstanding request that has timed out. If it finds one
+ * (or more), and that pdu has more retries available, a new packet is formed
+ * from the pdu and is resent. If there are no more retries available, the
+ * callback for the session is used to alert the user of the timeout.
+ */
+
+ NETSNMP_IMPORT
+ void snmp_timeout(void);
+
+ /*
+ * single session API.
+ *
+ * These functions perform similar actions as snmp_XX functions,
+ * but operate on a single session only.
+ *
+ * Synopsis:
+
+ void * sessp;
+ netsnmp_session session, *ss;
+ netsnmp_pdu *pdu, *response;
+
+ snmp_sess_init(&session);
+ session.retries = ...
+ session.remote_port = ...
+ sessp = snmp_sess_open(&session);
+ ss = snmp_sess_session(sessp);
+ if (ss == NULL)
+ exit(1);
+ ...
+ if (ss->community) free(ss->community);
+ ss->community = strdup(gateway);
+ ss->community_len = strlen(gateway);
+ ...
+ snmp_sess_synch_response(sessp, pdu, &response);
+ ...
+ snmp_sess_close(sessp);
+
+ * See also:
+ * snmp_sess_synch_response, in snmp_client.h.
+
+ * Notes:
+ * 1. Invoke snmp_sess_session after snmp_sess_open.
+ * 2. snmp_sess_session return value is an opaque pointer.
+ * 3. Do NOT free memory returned by snmp_sess_session.
+ * 4. Replace snmp_send(ss,pdu) with snmp_sess_send(sessp,pdu)
+ */
+
+ NETSNMP_IMPORT
+ void *snmp_sess_open(netsnmp_session *);
+ NETSNMP_IMPORT
+ void *snmp_sess_pointer(netsnmp_session *);
+ NETSNMP_IMPORT
+ netsnmp_session *snmp_sess_session(void *);
+ NETSNMP_IMPORT
+ netsnmp_session *snmp_sess_session_lookup(void *);
+
+
+ /*
+ * use return value from snmp_sess_open as void * parameter
+ */
+
+ NETSNMP_IMPORT
+ int snmp_sess_send(void *, netsnmp_pdu *);
+ NETSNMP_IMPORT
+ int snmp_sess_async_send(void *, netsnmp_pdu *,
+ netsnmp_callback, void *);
+ NETSNMP_IMPORT
+ int snmp_sess_select_info(void *, int *, fd_set *,
+ struct timeval *, int *);
+ NETSNMP_IMPORT
+ int snmp_sess_select_info2(void *, int *,
+ netsnmp_large_fd_set *,
+ struct timeval *, int *);
+ /*
+ * Returns 0 if success, -1 if fail.
+ */
+ NETSNMP_IMPORT
+ int snmp_sess_read(void *, fd_set *);
+ /*
+ * Similar to snmp_sess_read(), but accepts a pointer to a large file
+ * descriptor set instead of a pointer to a file descriptor set.
+ */
+ NETSNMP_IMPORT
+ int snmp_sess_read2(void *,
+ netsnmp_large_fd_set *);
+ NETSNMP_IMPORT
+ void snmp_sess_timeout(void *);
+ NETSNMP_IMPORT
+ int snmp_sess_close(void *);
+
+ NETSNMP_IMPORT
+ int snmp_sess_synch_response(void *, netsnmp_pdu *,
+ netsnmp_pdu **);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+ /*
+ * Having extracted the main ("public API") calls relevant
+ * to this area of the Net-SNMP project, the next step is to
+ * identify the related "public internal API" routines.
+ *
+ * In due course, these should probably be gathered
+ * together into a companion 'library/session_api.h' header file.
+ * [Or some suitable name]
+ *
+ * But for the time being, the expectation is that the
+ * traditional headers that provided the above definitions
+ * will probably also cover the relevant internal API calls.
+ * Hence they are listed here:
+ */
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_client.h>
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/callback.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/snmp_service.h>
+#include <net-snmp/library/snmpCallbackDomain.h>
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+#include <net-snmp/library/snmpUnixDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_UDP_DOMAIN
+#include <net-snmp/library/snmpUDPDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_TCP_DOMAIN
+#include <net-snmp/library/snmpTCPDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+#include <net-snmp/library/snmpUDPIPv6Domain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+#include <net-snmp/library/snmpTCPIPv6Domain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_IPX_DOMAIN
+#include <net-snmp/library/snmpIPXDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
+#include <net-snmp/library/snmpAAL5PVCDomain.h>
+#endif
+
+#include <net-snmp/library/ucd_compat.h>
+
+#endif /* NET_SNMP_SESSION_API_H */
diff --git a/include/net-snmp/snmpv3_api.h b/include/net-snmp/snmpv3_api.h
new file mode 100644
index 0000000..3968f19
--- /dev/null
+++ b/include/net-snmp/snmpv3_api.h
@@ -0,0 +1,38 @@
+#ifndef NET_SNMP_SNMPV3_H
+#define NET_SNMP_SNMPV3_H
+
+ /**
+ * Library API routines concerned with SNMPv3 handling.
+ *
+ * Most of these would typically not be used directly,
+ * but be invoked via version-independent API routines.
+ */
+
+#include <net-snmp/types.h>
+
+ /*
+ * For the initial release, this will just refer to the
+ * relevant UCD header files.
+ * In due course, the routines relevant to this area of the
+ * API will be identified, and listed here directly.
+ *
+ * But for the time being, this header file is a placeholder,
+ * to allow application writers to adopt the new header file names.
+ */
+
+#include <net-snmp/library/snmp_api.h>
+
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmpv3.h>
+#include <net-snmp/library/transform_oids.h>
+#include <net-snmp/library/keytools.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/lcd_time.h>
+#ifdef NETSNMP_USE_INTERNAL_MD5
+#include <net-snmp/library/md5.h>
+#endif
+
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/snmpv3-security-includes.h>
+
+#endif /* NET_SNMP_SNMPV3_H */
diff --git a/include/net-snmp/system/aix.h b/include/net-snmp/system/aix.h
new file mode 100644
index 0000000..02d4981
--- /dev/null
+++ b/include/net-snmp/system/aix.h
@@ -0,0 +1,27 @@
+#include <net-snmp/system/generic.h>
+#include <sys/select.h>
+#undef TOTAL_MEMORY_SYMBOL
+#undef NPROC_SYMBOL
+#undef RTHASHSIZE_SYMBOL
+#undef RTHOST_SYMBOL
+#undef RTNET_SYMBOL
+
+#undef RTTABLES_SYMBOL
+#define RTTABLES_SYMBOL "rt_tables"
+
+#undef ARPTAB_SIZE_SYMBOL
+#define ARPTAB_SIZE_SYMBOL "arptabsize"
+
+#undef ARPTAB_SYMBOL
+#define ARPTAB_SYMBOL "arptabnb"
+
+#ifndef __GNUC__
+# undef NETSNMP_ENABLE_INLINE
+# define NETSNMP_ENABLE_INLINE 0
+#endif
+
+/* define the extra mib modules that are supported */
+#define NETSNMP_INCLUDE_HOST_RESOURCES
+
+/* the legacy symbol NOACCESS clashes with the system headers. Remove it. */
+#define NETSNMP_NO_LEGACY_DEFINITIONS
diff --git a/include/net-snmp/system/bsd.h b/include/net-snmp/system/bsd.h
new file mode 100644
index 0000000..2739c3c
--- /dev/null
+++ b/include/net-snmp/system/bsd.h
@@ -0,0 +1,20 @@
+#include <net-snmp/system/generic.h>
+
+/*
+ * the bsd route symbol adds an 's' at the end to this symbol name
+ */
+#undef RTTABLES_SYMBOL
+#define RTTABLES_SYMBOL "rt_tables"
+
+/*
+ * BSD systems use a different method of looking up sockaddr_in values
+ */
+#define NEED_KLGETSA 1
+
+/*
+ * ARP_Scan_Next needs a 4th ifIndex argument
+ */
+#define ARP_SCAN_FOUR_ARGUMENTS 1
+
+#define UTMP_HAS_NO_TYPE 1
+#define UTMP_HAS_NO_PID 1
diff --git a/include/net-snmp/system/bsdi.h b/include/net-snmp/system/bsdi.h
new file mode 100644
index 0000000..b3387fc
--- /dev/null
+++ b/include/net-snmp/system/bsdi.h
@@ -0,0 +1,3 @@
+#include "bsd.h"
+
+#define CHECK_RT_FLAGS 1
diff --git a/include/net-snmp/system/bsdi3.h b/include/net-snmp/system/bsdi3.h
new file mode 100644
index 0000000..62c0e17
--- /dev/null
+++ b/include/net-snmp/system/bsdi3.h
@@ -0,0 +1,2 @@
+#include "bsdi.h"
+#define bsdi2 bsdi2 /* bsdi3 is a superset of bsdi2 */
diff --git a/include/net-snmp/system/bsdi4.h b/include/net-snmp/system/bsdi4.h
new file mode 100644
index 0000000..63bec19
--- /dev/null
+++ b/include/net-snmp/system/bsdi4.h
@@ -0,0 +1,11 @@
+#include "bsdi.h"
+#define bsdi2 bsdi2 /* bsdi4 is a superset of bsdi2 */
+#undef NPROC_SYMBOL
+#undef PROC_SYMBOL
+
+#define MNTTYPE_UFS "ufs"
+#define BerkelyFS 1
+#define MNTTYPE_MSDOS "msdos"
+#define MNTTYPE_ISO9660 "cd9660"
+#define MNTTYPE_NFS "nfs"
+#define MNTTYPE_MFS "mfs"
diff --git a/include/net-snmp/system/cygwin.h b/include/net-snmp/system/cygwin.h
new file mode 100644
index 0000000..a9b76fb
--- /dev/null
+++ b/include/net-snmp/system/cygwin.h
@@ -0,0 +1,12 @@
+#include <net-snmp/system/generic.h>
+
+/* got socklen_t? */
+#define HAVE_SOCKLEN_T 1
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h> /* uint32_t */
+#endif
+
+#undef bsdlike
+#undef MBSTAT_SYMBOL
+#undef TOTAL_MEMORY_SYMBOL
diff --git a/include/net-snmp/system/darwin.h b/include/net-snmp/system/darwin.h
new file mode 100644
index 0000000..5a065b7
--- /dev/null
+++ b/include/net-snmp/system/darwin.h
@@ -0,0 +1,8 @@
+#include "freebsd4.h"
+#define darwin darwin
+/*
+ * Although Darwin does have an fstab.h file, getfsfile etc. always return null.
+ * At least, as of 5.3.
+ */
+#undef HAVE_FSTAB_H
+
diff --git a/include/net-snmp/system/darwin10.h b/include/net-snmp/system/darwin10.h
new file mode 100644
index 0000000..8ed82d0
--- /dev/null
+++ b/include/net-snmp/system/darwin10.h
@@ -0,0 +1,148 @@
+/*
+ * While Darwin 10 (aka, Mac OS X 10.6 Snow Leopard) is "BSD-like", it differs
+ * substantially enough to not warrant pretending it is a BSD flavor.
+ * This first section are the vestigal BSD remnants.
+ */
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * BSD systems use a different method of looking up sockaddr_in values
+ */
+/* #define NEED_KLGETSA 1 */
+
+/*
+ * ARP_Scan_Next needs a 4th ifIndex argument
+ */
+#define ARP_SCAN_FOUR_ARGUMENTS 1
+
+#define CHECK_RT_FLAGS 1
+
+/*
+ * this is not good enough before freebsd3!
+ */
+/* #undef HAVE_NET_IF_MIB_H */
+
+/*
+ * This section adds the relevant definitions from generic.h
+ * (a file we don't include here)
+ */
+
+/*
+ * udp_inpcb list symbol, e.g. for mibII/udpTable.c
+ */
+#define INP_NEXT_SYMBOL inp_next
+
+/*
+ * This section defines Mac OS X 10.5 (and later) specific additions.
+ */
+#define darwin 10
+#ifndef darwin10
+# define darwin10 darwin
+#endif
+
+/*
+ * Mac OS X should only use the modern API and definitions.
+ */
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+#define NETSNMP_NO_LEGACY_DEFINITIONS 1
+#endif
+
+/*
+ * looks like the IFTable stuff works better than the mibII versions
+ */
+
+#define NETSNMP_INCLUDE_IFTABLE_REWRITES
+
+/*
+ * use new host resources files as well
+ */
+#define NETSNMP_INCLUDE_HRSWINST_REWRITES
+#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
+#undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
+#define NETSNMP_CAN_GET_DISK_LABEL 1
+
+/*
+ * Enabling this restricts the compiler to mostly public APIs.
+ */
+#ifndef __APPLE_API_STRICT_CONFORMANCE
+#define __APPLE_API_STRICT_CONFORMANCE 1
+#endif
+#ifndef __APPLE_API_UNSTABLE
+#define __APPLE_API_UNSTABLE 1
+#endif
+
+/*
+ * Darwin's tools are capable of building multiple architectures in one pass.
+ * As a result, platform definitions should be deferred until compile time.
+ */
+#ifdef BYTE_ORDER
+# undef WORDS_BIGENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+
+/*
+ * Darwin's tools are capable of building multiple architectures in one pass.
+ * As a result, platform definitions should be deferred until compile time.
+ */
+#ifdef BYTE_ORDER
+# undef WORDS_BIGENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+
+/*
+ * Although Darwin does have an fstab.h file, getfsfile etc. always return null.
+ * At least, as of 5.3.
+ */
+#undef HAVE_FSTAB_H
+
+#define SWAPFILE_DIR "/private/var/vm"
+#define SWAPFILE_PREFIX "swapfile"
+
+/*
+ * These apparently used to be in netinet/tcp_timers.h, but went away in
+ * 10.4.2. Define them here til we find out a way to get the real values.
+ */
+#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
+#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
+
+/*
+ * Because Mac OS X is built on Mach, it does not provide a BSD-compatible
+ * VM statistics API.
+ */
+#define USE_MACH_HOST_STATISTICS 1
+
+/*
+ * This tells code that manipulates IPv6 that the structures are unified,
+ * i.e., IPv4 and IPv6 use the same structs.
+ * This should eventually be replaced with a configure directive.
+ */
+/* #define USE_UNIFIED_IPV6_STRUCTS 1 */
+#undef STRUCT_in6pcb_HAS_inp_vflag
+
+/*
+ * utility macro used in several darwin specific files
+ */
+#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
+
+/*
+ * Mac OS X runs on both PPC and Intel hardware,
+ * which handle udpTable index values differently
+ */
+#include <TargetConditionals.h>
+#ifdef TARGET_RT_LITTLE_ENDIAN
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+#endif
+
diff --git a/include/net-snmp/system/darwin11.h b/include/net-snmp/system/darwin11.h
new file mode 100644
index 0000000..24fed93
--- /dev/null
+++ b/include/net-snmp/system/darwin11.h
@@ -0,0 +1,161 @@
+/*
+ * While Darwin 10 (aka, Mac OS X 10.6 Snow Leopard) is "BSD-like", it differs
+ * substantially enough to not warrant pretending it is a BSD flavor.
+ * This first section are the vestigal BSD remnants.
+ */
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * BSD systems use a different method of looking up sockaddr_in values
+ */
+/* #define NEED_KLGETSA 1 */
+
+/*
+ * ARP_Scan_Next needs a 4th ifIndex argument
+ */
+#define ARP_SCAN_FOUR_ARGUMENTS 1
+
+#define CHECK_RT_FLAGS 1
+
+/*
+ * this is not good enough before freebsd3!
+ */
+/* #undef HAVE_NET_IF_MIB_H */
+
+/*
+ * This section adds the relevant definitions from generic.h
+ * (a file we don't include here)
+ */
+
+/*
+ * udp_inpcb list symbol, e.g. for mibII/udpTable.c
+ */
+#define INP_NEXT_SYMBOL inp_next
+
+/*
+ * This section defines Mac OS X 10.5 (and later) specific additions.
+ */
+#define darwin 11
+#ifndef darwin11
+# define darwin11 darwin
+#endif
+
+/*
+ * Mac OS X should only use the modern API and definitions.
+ */
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+#define NETSNMP_NO_LEGACY_DEFINITIONS 1
+#endif
+
+/*
+ * looks like the IFTable stuff works better than the mibII versions
+ */
+
+#define NETSNMP_INCLUDE_IFTABLE_REWRITES
+
+/*
+ * use new host resources files as well
+ */
+#define NETSNMP_INCLUDE_HRSWINST_REWRITES
+#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
+#undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
+#define NETSNMP_CAN_GET_DISK_LABEL 1
+
+/*
+ * Enabling this restricts the compiler to mostly public APIs.
+ */
+#ifndef __APPLE_API_STRICT_CONFORMANCE
+#define __APPLE_API_STRICT_CONFORMANCE 1
+#endif
+#ifndef __APPLE_API_UNSTABLE
+#define __APPLE_API_UNSTABLE 1
+#endif
+
+/*
+ * Darwin's tools are capable of building multiple architectures in one pass.
+ * As a result, platform definitions should be deferred until compile time.
+ */
+#ifdef BYTE_ORDER
+# undef WORDS_BIGENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+
+/*
+ * Darwin's tools are capable of building multiple architectures in one pass.
+ * As a result, platform definitions should be deferred until compile time.
+ */
+#ifdef BYTE_ORDER
+# undef WORDS_BIGENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+
+/*
+ * Although Darwin does have a kvm.h file, kvm_openfiles etc. always
+ * return null because /dev/kmem was removed completely in OS X 10.5.
+ */
+#undef HAVE_KVM_H
+#undef HAVE_KVM_GETPROCS
+#undef HAVE_KVM_OPENFILES
+
+/*
+ * Although Darwin does have an fstab.h file, getfsfile etc. always return null.
+ * At least, as of 5.3.
+ */
+#undef HAVE_FSTAB_H
+
+#define SWAPFILE_DIR "/private/var/vm"
+#define SWAPFILE_PREFIX "swapfile"
+
+/*
+ * These apparently used to be in netinet/tcp_timers.h, but went away in
+ * 10.4.2. Define them here til we find out a way to get the real values.
+ */
+#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
+#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
+
+/*
+ * Because Mac OS X is built on Mach, it does not provide a BSD-compatible
+ * VM statistics API.
+ */
+#define USE_MACH_HOST_STATISTICS 1
+
+/*
+ * This tells code that manipulates IPv6 that the structures are unified,
+ * i.e., IPv4 and IPv6 use the same structs.
+ * This should eventually be replaced with a configure directive.
+ */
+/* #define USE_UNIFIED_IPV6_STRUCTS 1 */
+#undef STRUCT_in6pcb_HAS_inp_vflag
+
+/*
+ * utility macro used in several darwin specific files
+ */
+#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
+
+/*
+ * Mac OS X runs on both PPC and Intel hardware,
+ * which handle udpTable index values differently
+ */
+#include <TargetConditionals.h>
+#ifdef TARGET_RT_LITTLE_ENDIAN
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+#endif
+
+/*
+ * as of 7/2010, openssl on darwin does not have sha256
+ */
+#define OPENSSL_NO_SHA256 1
+#define OPENSSL_NO_SHA512 1
diff --git a/include/net-snmp/system/darwin12.h b/include/net-snmp/system/darwin12.h
new file mode 100644
index 0000000..fd66147
--- /dev/null
+++ b/include/net-snmp/system/darwin12.h
@@ -0,0 +1,161 @@
+/*
+ * While Darwin 10 (aka, Mac OS X 10.6 Snow Leopard) is "BSD-like", it differs
+ * substantially enough to not warrant pretending it is a BSD flavor.
+ * This first section are the vestigal BSD remnants.
+ */
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * BSD systems use a different method of looking up sockaddr_in values
+ */
+/* #define NEED_KLGETSA 1 */
+
+/*
+ * ARP_Scan_Next needs a 4th ifIndex argument
+ */
+#define ARP_SCAN_FOUR_ARGUMENTS 1
+
+#define CHECK_RT_FLAGS 1
+
+/*
+ * this is not good enough before freebsd3!
+ */
+/* #undef HAVE_NET_IF_MIB_H */
+
+/*
+ * This section adds the relevant definitions from generic.h
+ * (a file we don't include here)
+ */
+
+/*
+ * udp_inpcb list symbol, e.g. for mibII/udpTable.c
+ */
+#define INP_NEXT_SYMBOL inp_next
+
+/*
+ * This section defines Mac OS X 10.5 (and later) specific additions.
+ */
+#define darwin 12
+#ifndef darwin12
+# define darwin12 darwin
+#endif
+
+/*
+ * Mac OS X should only use the modern API and definitions.
+ */
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+#define NETSNMP_NO_LEGACY_DEFINITIONS 1
+#endif
+
+/*
+ * looks like the IFTable stuff works better than the mibII versions
+ */
+
+#define NETSNMP_INCLUDE_IFTABLE_REWRITES
+
+/*
+ * use new host resources files as well
+ */
+#define NETSNMP_INCLUDE_HRSWINST_REWRITES
+#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
+#undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
+#define NETSNMP_CAN_GET_DISK_LABEL 1
+
+/*
+ * Enabling this restricts the compiler to mostly public APIs.
+ */
+#ifndef __APPLE_API_STRICT_CONFORMANCE
+#define __APPLE_API_STRICT_CONFORMANCE 1
+#endif
+#ifndef __APPLE_API_UNSTABLE
+#define __APPLE_API_UNSTABLE 1
+#endif
+
+/*
+ * Darwin's tools are capable of building multiple architectures in one pass.
+ * As a result, platform definitions should be deferred until compile time.
+ */
+#ifdef BYTE_ORDER
+# undef WORDS_BIGENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+
+/*
+ * Darwin's tools are capable of building multiple architectures in one pass.
+ * As a result, platform definitions should be deferred until compile time.
+ */
+#ifdef BYTE_ORDER
+# undef WORDS_BIGENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+
+/*
+ * Although Darwin does have a kvm.h file, kvm_openfiles etc. always
+ * return null because /dev/kmem was removed completely in OS X 10.5.
+ */
+#undef HAVE_KVM_H
+#undef HAVE_KVM_GETPROCS
+#undef HAVE_KVM_OPENFILES
+
+/*
+ * Although Darwin does have an fstab.h file, getfsfile etc. always return null.
+ * At least, as of 5.3.
+ */
+#undef HAVE_FSTAB_H
+
+#define SWAPFILE_DIR "/private/var/vm"
+#define SWAPFILE_PREFIX "swapfile"
+
+/*
+ * These apparently used to be in netinet/tcp_timers.h, but went away in
+ * 10.4.2. Define them here til we find out a way to get the real values.
+ */
+#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
+#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
+
+/*
+ * Because Mac OS X is built on Mach, it does not provide a BSD-compatible
+ * VM statistics API.
+ */
+#define USE_MACH_HOST_STATISTICS 1
+
+/*
+ * This tells code that manipulates IPv6 that the structures are unified,
+ * i.e., IPv4 and IPv6 use the same structs.
+ * This should eventually be replaced with a configure directive.
+ */
+/* #define USE_UNIFIED_IPV6_STRUCTS 1 */
+#undef STRUCT_in6pcb_HAS_inp_vflag
+
+/*
+ * utility macro used in several darwin specific files
+ */
+#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
+
+/*
+ * Mac OS X runs on both PPC and Intel hardware,
+ * which handle udpTable index values differently
+ */
+#include <TargetConditionals.h>
+#ifdef TARGET_RT_LITTLE_ENDIAN
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+#endif
+
+/*
+ * as of 7/2010, openssl on darwin does not have sha256
+ */
+#define OPENSSL_NO_SHA256 1
+#define OPENSSL_NO_SHA512 1
diff --git a/include/net-snmp/system/darwin7.h b/include/net-snmp/system/darwin7.h
new file mode 100644
index 0000000..8d4554d
--- /dev/null
+++ b/include/net-snmp/system/darwin7.h
@@ -0,0 +1,15 @@
+#include <stdint.h>
+#include "freebsd4.h"
+#define darwin darwin
+/*
+ * Although Darwin does have an fstab.h file, getfsfile etc. always return null.
+ * At least, as of 5.3.
+ */
+#undef HAVE_FSTAB_H
+
+#define MBSTAT_SYMBOL "mbstat"
+#undef TOTAL_MEMORY_SYMBOL
+
+#define SWAPFILE_DIR "/private/var/vm"
+#define SWAPFILE_PREFIX "swapfile"
+
diff --git a/include/net-snmp/system/darwin8.h b/include/net-snmp/system/darwin8.h
new file mode 100644
index 0000000..1e6d7d3
--- /dev/null
+++ b/include/net-snmp/system/darwin8.h
@@ -0,0 +1,94 @@
+/*
+ * While Darwin 8 (aka, Mac OS X 10.4 Tiger) is "BSD-like", it differs
+ * substantially enough to not warrant pretending it is a BSD flavor.
+ * This first section are the vestigal BSD remnants.
+ */
+
+/*
+ * BSD systems use a different method of looking up sockaddr_in values
+ */
+/* #define NEED_KLGETSA 1 */
+
+/*
+ * ARP_Scan_Next needs a 4th ifIndex argument
+ */
+#define ARP_SCAN_FOUR_ARGUMENTS 1
+
+#define CHECK_RT_FLAGS 1
+
+/*
+ * this is not good enough before freebsd3!
+ */
+/* #undef HAVE_NET_IF_MIB_H */
+
+/*
+ * This section adds the relevant definitions from generic.h
+ * (a file we don't include here)
+ */
+
+/*
+ * udp_inpcb list symbol, e.g. for mibII/udpTable.c
+ */
+#define INP_NEXT_SYMBOL inp_next
+
+/*
+ * This section defines Mac OS X 10.4 (and later) specific additions.
+ */
+#define darwin 8
+
+/*
+ * Mac OS X should only use the modern API and definitions.
+ */
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+#define NETSNMP_NO_LEGACY_DEFINITIONS 1
+#endif
+
+/*
+ * (eventually) Enabling this forces the compiler to only use public APIs.
+ */
+/*#ifndef __APPLE_API_STRICT_CONFORMANCE
+ *#define __APPLE_API_STRICT_CONFORMANCE 1
+ *#endif
+ */
+
+/*
+ * Darwin's tools are capable of building multiple architectures in one pass.
+ * As a result, platform definitions should be deferred until compile time.
+ */
+#ifdef BYTE_ORDER
+# undef WORDS_BIGENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+
+/*
+ * Although Darwin does have an fstab.h file, getfsfile etc. always return null.
+ * At least, as of 5.3.
+ */
+#undef HAVE_FSTAB_H
+
+#define SWAPFILE_DIR "/private/var/vm"
+#define SWAPFILE_PREFIX "swapfile"
+
+/*
+ * These apparently used to be in netinet/tcp_timers.h, but went away in
+ * 10.4.2. Define them here til we find out a way to get the real values.
+ */
+#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
+#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
+
+/*
+ * Because Mac OS X is built on Mach, it does not provide a BSD-compatible
+ * VM statistics API.
+ */
+#define USE_MACH_HOST_STATISTICS 1
+
+/*
+ * This tells code that manipulates IPv6 that the structures are unified,
+ * i.e., IPv4 and IPv6 use the same structs.
+ * This should eventually be replaced with a configure directive.
+ */
+/* #define USE_UNIFIED_IPV6_STRUCTS 1 */
+#undef STRUCT_in6pcb_HAS_inp_vflag
+
diff --git a/include/net-snmp/system/darwin9.h b/include/net-snmp/system/darwin9.h
new file mode 100644
index 0000000..cf4e1d5
--- /dev/null
+++ b/include/net-snmp/system/darwin9.h
@@ -0,0 +1,148 @@
+/*
+ * While Darwin 9 (aka, Mac OS X 10.5 Leopard) is "BSD-like", it differs
+ * substantially enough to not warrant pretending it is a BSD flavor.
+ * This first section are the vestigal BSD remnants.
+ */
+/* 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 (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * BSD systems use a different method of looking up sockaddr_in values
+ */
+/* #define NEED_KLGETSA 1 */
+
+/*
+ * ARP_Scan_Next needs a 4th ifIndex argument
+ */
+#define ARP_SCAN_FOUR_ARGUMENTS 1
+
+#define CHECK_RT_FLAGS 1
+
+/*
+ * this is not good enough before freebsd3!
+ */
+/* #undef HAVE_NET_IF_MIB_H */
+
+/*
+ * This section adds the relevant definitions from generic.h
+ * (a file we don't include here)
+ */
+
+/*
+ * udp_inpcb list symbol, e.g. for mibII/udpTable.c
+ */
+#define INP_NEXT_SYMBOL inp_next
+
+/*
+ * This section defines Mac OS X 10.5 (and later) specific additions.
+ */
+#define darwin 9
+#ifndef darwin9
+# define darwin9 darwin
+#endif
+
+/*
+ * Mac OS X should only use the modern API and definitions.
+ */
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+#define NETSNMP_NO_LEGACY_DEFINITIONS 1
+#endif
+
+/*
+ * looks like the IFTable stuff works better than the mibII versions
+ */
+
+#define NETSNMP_INCLUDE_IFTABLE_REWRITES
+
+/*
+ * use new host resources files as well
+ */
+#define NETSNMP_INCLUDE_HRSWINST_REWRITES
+#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
+#undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
+#define NETSNMP_CAN_GET_DISK_LABEL 1
+
+/*
+ * Enabling this restricts the compiler to mostly public APIs.
+ */
+#ifndef __APPLE_API_STRICT_CONFORMANCE
+#define __APPLE_API_STRICT_CONFORMANCE 1
+#endif
+#ifndef __APPLE_API_UNSTABLE
+#define __APPLE_API_UNSTABLE 1
+#endif
+
+/*
+ * Darwin's tools are capable of building multiple architectures in one pass.
+ * As a result, platform definitions should be deferred until compile time.
+ */
+#ifdef BYTE_ORDER
+# undef WORDS_BIGENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+
+/*
+ * Darwin's tools are capable of building multiple architectures in one pass.
+ * As a result, platform definitions should be deferred until compile time.
+ */
+#ifdef BYTE_ORDER
+# undef WORDS_BIGENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+
+/*
+ * Although Darwin does have an fstab.h file, getfsfile etc. always return null.
+ * At least, as of 5.3.
+ */
+#undef HAVE_FSTAB_H
+
+#define SWAPFILE_DIR "/private/var/vm"
+#define SWAPFILE_PREFIX "swapfile"
+
+/*
+ * These apparently used to be in netinet/tcp_timers.h, but went away in
+ * 10.4.2. Define them here til we find out a way to get the real values.
+ */
+#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
+#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
+
+/*
+ * Because Mac OS X is built on Mach, it does not provide a BSD-compatible
+ * VM statistics API.
+ */
+#define USE_MACH_HOST_STATISTICS 1
+
+/*
+ * This tells code that manipulates IPv6 that the structures are unified,
+ * i.e., IPv4 and IPv6 use the same structs.
+ * This should eventually be replaced with a configure directive.
+ */
+/* #define USE_UNIFIED_IPV6_STRUCTS 1 */
+#undef STRUCT_in6pcb_HAS_inp_vflag
+
+/*
+ * utility macro used in several darwin specific files
+ */
+#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
+
+/*
+ * Mac OS X runs on both PPC and Intel hardware,
+ * which handle udpTable index values differently
+ */
+#include <TargetConditionals.h>
+#ifdef TARGET_RT_LITTLE_ENDIAN
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+#endif
+
diff --git a/include/net-snmp/system/dragonfly.h b/include/net-snmp/system/dragonfly.h
new file mode 100644
index 0000000..35d016b
--- /dev/null
+++ b/include/net-snmp/system/dragonfly.h
@@ -0,0 +1,25 @@
+#include "freebsd.h"
+
+/*
+ * dragonfly is a superset of freebsd4
+ */
+#define freebsd2 freebsd2
+#define freebsd3 freebsd3
+#define freebsd4 freebsd4
+#define dragonfly dragonfly
+
+#undef IFADDR_SYMBOL
+#define IFADDR_SYMBOL "in_ifaddrhead"
+
+#undef PROC_SYMBOL
+#define PROC_SYMBOL "allproc"
+
+#undef NPROC_SYMBOL
+#define NPROC_SYMBOL "nprocs"
+
+#undef TOTAL_MEMORY_SYMBOL
+
+#undef MBSTAT_SYMBOL
+
+#undef INP_NEXT_SYMBOL
+#define INP_NEXT_SYMBOL inp_next
diff --git a/include/net-snmp/system/dynix.h b/include/net-snmp/system/dynix.h
new file mode 100644
index 0000000..63e979b
--- /dev/null
+++ b/include/net-snmp/system/dynix.h
@@ -0,0 +1,106 @@
+/*
+ * dynix.h
+ *
+ * Date Created: Sat Jan 12 10:50:50 BST 2002
+ * Author: Patrick Hess <phess@hds.com>
+ */
+
+#include <net-snmp/system/generic.h>
+
+/*
+ * from s/sysv.h
+ */
+#define SYSV 1
+
+/*
+ * to make these changes work...
+ */
+/*
+ * maybe I should have used _SEQUENT_ in all this code.. dunno
+ */
+#define dynix dynix
+
+#undef TOTAL_MEMORY_SYMBOL
+#undef MBSTAT_SYMBOL
+
+/*
+ * Not enough alcohool in bloodstream [fmc]
+ */
+#ifdef NPROC_SYMBOL
+#undef NPROC_SYMBOL
+#endif
+/*
+ * there might be a way to get NPROC... this might work.. might not
+ */
+/*
+ * #define NPROC_SYMBOL "procNPROC"
+ */
+#ifdef PROC_SYMBOL
+#undef PROC_SYMBOL
+#endif
+
+/*
+ * These definitions date from early BSD-based headers,
+ * and are included in modern NetBSD and OpenBSD distributions.
+ * As such, the relevant copyright probably resides with UCB.
+ */
+#ifndef TCPTV_MIN
+#define TCPTV_MIN (1*PR_SLOWHZ) /* minimum allowable value */
+#endif
+#ifndef TCPTV_REXMTMAX
+#define TCPTV_REXMTMAX (64*PR_SLOWHZ) /* max allowable REXMT value */
+#endif
+
+/*
+ * some of the system headers wanna include asm code... let's not
+ */
+#define __NO_ASM_MACRO 1
+
+/*
+ * Dynix doesn't seem to set this. Guess I'll set it here
+ */
+#ifndef L_SET
+#define L_SET SEEK_SET
+#endif
+
+
+/*
+ * configure fails to detect these properly
+ */
+/*
+ * lives in libnsl.so
+ */
+#define HAVE_GETHOSTNAME 1
+
+/*
+ * outta place... lives in /usr/include/sys
+ */
+#define HAVE_NET_IF_DL_H 1
+
+/*
+ * got this library... dunno why configure didn't find it
+ */
+#define HAVE_LIBNSL 1
+
+/*
+ * My Dynix box has nearly 400 filesystems and well over 50 disks
+ */
+/*
+ * #define MAXDISKS 500
+ */
+
+/*
+ * lives in libsocket.so
+ */
+#define HAVE_GETHOSTBYNAME 1
+
+/*
+ * Might as well include this here, since a significant
+ * number of files seem to need it. DTS
+ */
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+/* define the extra mib modules that are supported */
+#define NETSNMP_INCLUDE_HOST_RESOURCES
diff --git a/include/net-snmp/system/freebsd.h b/include/net-snmp/system/freebsd.h
new file mode 100644
index 0000000..a30683f
--- /dev/null
+++ b/include/net-snmp/system/freebsd.h
@@ -0,0 +1,27 @@
+#include "bsd.h"
+
+#define CHECK_RT_FLAGS 1
+
+/*
+ * udp_inpcb list symbol
+ */
+#undef INP_NEXT_SYMBOL
+#define INP_NEXT_SYMBOL inp_list.le_next
+
+#undef INP_PREV_SYMBOL
+#define INP_PREV_SYMBOL inp_list.le_prev
+
+#undef TCP_TTL_SYMBOL
+#define TCP_TTL_SYMBOL "ip_defttl"
+
+#ifdef _PATH_UTMP
+#define UTMP_FILE _PATH_UTMP
+#else
+#define UTMP_FILE "/var/run/utmp"
+#endif
+
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+
+/* define the extra mib modules that are supported */
+#define NETSNMP_INCLUDE_HOST_RESOURCES
+#define NETSNMP_INCLUDE_IFTABLE_REWRITES
diff --git a/include/net-snmp/system/freebsd10.h b/include/net-snmp/system/freebsd10.h
new file mode 100644
index 0000000..871b9df
--- /dev/null
+++ b/include/net-snmp/system/freebsd10.h
@@ -0,0 +1,3 @@
+/* freebsd9 is a superset of freebsd10 */
+#include "freebsd9.h"
+#define freebsd10 freebsd10
diff --git a/include/net-snmp/system/freebsd2.h b/include/net-snmp/system/freebsd2.h
new file mode 100644
index 0000000..a2673ac
--- /dev/null
+++ b/include/net-snmp/system/freebsd2.h
@@ -0,0 +1,10 @@
+#include "freebsd.h"
+
+/*
+ * this is not good enough before freebsd3!
+ */
+#undef HAVE_NET_IF_MIB_H
+#undef PROC_SYMBOL
+#undef NPROC_SYMBOL
+#undef LOADAVE_SYMBOL
+#undef TOTAL_MEMORY_SYMBOL
diff --git a/include/net-snmp/system/freebsd3.h b/include/net-snmp/system/freebsd3.h
new file mode 100644
index 0000000..4d87b5c
--- /dev/null
+++ b/include/net-snmp/system/freebsd3.h
@@ -0,0 +1,11 @@
+#include "freebsd.h"
+
+#define freebsd2 freebsd2 /* freebsd3 is a superset of freebsd2 */
+
+#undef IFADDR_SYMBOL
+#define IFADDR_SYMBOL "in_ifaddrhead"
+
+#undef PROC_SYMBOL
+#undef NPROC_SYMBOL
+
+#undef TOTAL_MEMORY_SYMBOL
diff --git a/include/net-snmp/system/freebsd4.h b/include/net-snmp/system/freebsd4.h
new file mode 100644
index 0000000..2c41e82
--- /dev/null
+++ b/include/net-snmp/system/freebsd4.h
@@ -0,0 +1,23 @@
+#include "freebsd.h"
+
+/*
+ * freebsd4 is a superset of all since freebsd2
+ */
+#define freebsd2 freebsd2
+#define freebsd3 freebsd3
+
+#undef IFADDR_SYMBOL
+#define IFADDR_SYMBOL "in_ifaddrhead"
+
+#undef PROC_SYMBOL
+#define PROC_SYMBOL "allproc"
+
+#undef NPROC_SYMBOL
+#define NPROC_SYMBOL "nprocs"
+
+#undef TOTAL_MEMORY_SYMBOL
+
+#undef MBSTAT_SYMBOL
+
+#undef INP_NEXT_SYMBOL
+#define INP_NEXT_SYMBOL inp_next
diff --git a/include/net-snmp/system/freebsd5.h b/include/net-snmp/system/freebsd5.h
new file mode 100644
index 0000000..369c1a4
--- /dev/null
+++ b/include/net-snmp/system/freebsd5.h
@@ -0,0 +1,8 @@
+/* freebsd5 is a superset of freebsd4 */
+#include "freebsd4.h"
+#define freebsd4 freebsd4
+
+/* don't define _KERNEL on FreeBSD 5.3 even if configure thinks we need it */
+#ifdef freebsd5
+#undef NETSNMP_IFNET_NEEDS_KERNEL
+#endif
diff --git a/include/net-snmp/system/freebsd6.h b/include/net-snmp/system/freebsd6.h
new file mode 100644
index 0000000..b65fd2b
--- /dev/null
+++ b/include/net-snmp/system/freebsd6.h
@@ -0,0 +1,3 @@
+/* freebsd6 is a superset of freebsd5 */
+#include "freebsd5.h"
+#define freebsd5 freebsd5
diff --git a/include/net-snmp/system/freebsd7.h b/include/net-snmp/system/freebsd7.h
new file mode 100644
index 0000000..e0a30f4
--- /dev/null
+++ b/include/net-snmp/system/freebsd7.h
@@ -0,0 +1,3 @@
+/* freebsd7 is a superset of freebsd6 */
+#include "freebsd6.h"
+#define freebsd6 freebsd6
diff --git a/include/net-snmp/system/freebsd8.h b/include/net-snmp/system/freebsd8.h
new file mode 100644
index 0000000..0c814bd
--- /dev/null
+++ b/include/net-snmp/system/freebsd8.h
@@ -0,0 +1,3 @@
+/* freebsd8 is a superset of freebsd7 */
+#include "freebsd7.h"
+#define freebsd7 freebsd7
diff --git a/include/net-snmp/system/freebsd9.h b/include/net-snmp/system/freebsd9.h
new file mode 100644
index 0000000..1bd4750
--- /dev/null
+++ b/include/net-snmp/system/freebsd9.h
@@ -0,0 +1,3 @@
+/* freebsd9 is a superset of freebsd8 */
+#include "freebsd8.h"
+#define freebsd9 freebsd9
diff --git a/include/net-snmp/system/generic.h b/include/net-snmp/system/generic.h
new file mode 100644
index 0000000..0828a84
--- /dev/null
+++ b/include/net-snmp/system/generic.h
@@ -0,0 +1,78 @@
+#ifndef __NET_SNMP_SYSTEM_GENERIC_H__
+#define __NET_SNMP_SYSTEM_GENERIC_H__
+
+#define bsdlike bsdlike
+
+/*
+ * nlist symbols in ip.c
+ */
+#define IPSTAT_SYMBOL "ipstat"
+#define IP_FORWARDING_SYMBOL "ipforwarding"
+#define TCP_TTL_SYMBOL "tcpDefaultTTL"
+
+/*
+ * nlist symbols in interfaces.c
+ */
+#define IFNET_SYMBOL "ifnet"
+#define IFADDR_SYMBOL "in_ifaddr"
+
+/*
+ * nlist symbols in at.c
+ */
+#define ARPTAB_SYMBOL "arptab"
+#define ARPTAB_SIZE_SYMBOL "arptab_size"
+
+/*
+ * load average lookup symbol
+ */
+#define LOADAVE_SYMBOL "avenrun"
+
+/*
+ * nlist symbols in hr_proc.c and memory.c
+ */
+#define PHYSMEM_SYMBOL "physmem"
+#define TOTAL_MEMORY_SYMBOL "total"
+#define MBSTAT_SYMBOL "mbstat"
+#define SWDEVT_SYMBOL "swdevt"
+#define FSWDEVT_SYMBOL "fswdevt"
+#define NSWAPFS_SYMBOL "nswapfs"
+#define NSWAPDEV_SYMBOL "nswapdev"
+
+/*
+ * process nlist symbols.
+ */
+#define NPROC_SYMBOL "nproc"
+#define PROC_SYMBOL "proc"
+
+/*
+ * icmp.c nlist symbols
+ */
+#define ICMPSTAT_SYMBOL "icmpstat"
+
+/*
+ * tcp.c nlist symbols
+ */
+#define TCPSTAT_SYMBOL "tcpstat"
+#define TCP_SYMBOL "tcb"
+
+/*
+ * upd.c nlist symbols
+ */
+#define UDPSTAT_SYMBOL "udpstat"
+#define UDB_SYMBOL "udb"
+
+/*
+ * var_route.c nlist symbols
+ */
+#define RTTABLES_SYMBOL "rt_table"
+#define RTHASHSIZE_SYMBOL "rthashsize"
+#define RTHOST_SYMBOL "rthost"
+#define RTNET_SYMBOL "rtnet"
+
+/*
+ * udp_inpcb list symbol
+ */
+#define INP_NEXT_SYMBOL inp_next
+#define INP_PREV_SYMBOL inp_prev
+
+#endif /* !__NET_SNMP_SYSTEM_GENERIC_H__ */
diff --git a/include/net-snmp/system/hpux.h b/include/net-snmp/system/hpux.h
new file mode 100644
index 0000000..57cea42
--- /dev/null
+++ b/include/net-snmp/system/hpux.h
@@ -0,0 +1,94 @@
+#include "sysv.h"
+
+#undef hpux
+#define hpux hpux
+
+#ifdef hpux11
+#define NETSNMP_DONT_USE_NLIST 1
+#endif
+
+/*
+ * HP-UX needs _REENTRANT defined to pick up strtok_r.
+ * Otherwise, at least for 64-bit code, strtok_r will not work
+ * and will make net-snmp segfault.
+ */
+#define _REENTRANT 1
+
+#undef TCP_TTL_SYMBOL
+#ifndef hpux11
+#define TCP_TTL_SYMBOL "ipDefaultTTL"
+#endif
+
+#ifndef hpux11
+/*
+ * hpux specific
+ */
+#define MIB_IPCOUNTER_SYMBOL "MIB_ipcounter"
+#define MIB_TCPCOUNTER_SYMBOL "MIB_tcpcounter"
+#define MIB_UDPCOUNTER_SYMBOL "MIB_udpcounter"
+#endif
+
+#undef ARPTAB_SYMBOL
+#ifndef hpux11
+#define ARPTAB_SYMBOL "arphd"
+#endif
+#undef ARPTAB_SIZE_SYMBOL
+#ifndef hpux11
+#define ARPTAB_SIZE_SYMBOL "arptab_nb"
+#endif
+
+#if defined(hpux10) || defined(hpux11)
+#undef SWDEVT_SYMBOL
+#undef FSWDEVT_SYMBOL
+#undef NSWAPFS_SYMBOL
+#undef NSWAPDEV_SYMBOL
+#undef LOADAVE_SYMBOL
+#undef PROC_SYMBOL
+#undef NPROC_SYMBOL
+#undef TOTAL_MEMORY_SYMBOL
+#undef MBSTAT_SYMBOL
+#endif
+
+#ifdef hpux11
+#undef IPSTAT_SYMBOL
+#undef TCP_SYMBOL
+#undef TCPSTAT_SYMBOL
+#undef UDB_SYMBOL
+#undef UDPSTAT_SYMBOL
+#undef ICMPSTAT_SYMBOL
+#undef IP_FORWARDING_SYMBOL
+#undef RTTABLES_SYMBOL
+#undef RTHASHSIZE_SYMBOL
+#undef RTHOST_SYMBOL
+#undef RTNET_SYMBOL
+
+#undef PHYSMEM_SYMBOL
+#endif
+
+/*
+ * ARP_Scan_Next needs a 4th ifIndex argument
+ */
+#define ARP_SCAN_FOUR_ARGUMENTS
+
+#define rt_pad1 rt_refcnt
+
+/*
+ * disable inline for non-gcc compiler
+ */
+#ifndef __GNUC__
+# undef NETSNMP_ENABLE_INLINE
+# define NETSNMP_ENABLE_INLINE 0
+#endif
+
+/*
+ * prevent sigaction being redefined to cma_sigaction
+ * (causing build errors on HP-UX 10.20, at least)
+ */
+#ifdef hpux10
+#ifndef _CMA_NOWRAPPERS_
+# define _CMA_NOWRAPPERS_ 1
+#endif
+#endif
+
+/* define the extra mib modules that are supported */
+#define NETSNMP_INCLUDE_HOST_RESOURCES
diff --git a/include/net-snmp/system/irix.h b/include/net-snmp/system/irix.h
new file mode 100644
index 0000000..933fe63
--- /dev/null
+++ b/include/net-snmp/system/irix.h
@@ -0,0 +1,33 @@
+/*
+ * irix.h
+ *
+ * Date Created: Mon Feb 16 22:19:39 1998
+ * Initial Author: Simon Leinen <simon@switch.ch>
+ */
+
+#include <net-snmp/system/generic.h>
+
+#undef TCP_TTL_SYMBOL
+#define TCP_TTL_SYMBOL "tcp_ttl"
+
+#undef IPSTAT_SYMBOL
+#define NO_DOUBLE_ICMPSTAT
+#undef ICMPSTAT_SYMBOL
+#undef TCPSTAT_SYMBOL
+#undef UDPSTAT_SYMBOL
+
+#define ARP_SCAN_FOUR_ARGUMENTS 1
+
+#define _KMEMUSER 1
+
+/*
+ * don't define _KERNEL before including sys/unistd.h
+ */
+#define NETSNMP_IFNET_NEEDS_KERNEL_LATE 1
+
+#define STREAM_NEEDS_KERNEL_ISLANDS
+
+#ifndef __GNUC__
+# undef NETSNMP_ENABLE_INLINE
+# define NETSNMP_ENABLE_INLINE 0
+#endif
diff --git a/include/net-snmp/system/kfreebsd.h b/include/net-snmp/system/kfreebsd.h
new file mode 100644
index 0000000..dbf7024
--- /dev/null
+++ b/include/net-snmp/system/kfreebsd.h
@@ -0,0 +1,9 @@
+#include "freebsd6.h"
+#define freebsd6 freebsd6
+
+#include <osreldate.h>
+#define __FreeBSD_version __FreeBSD_kernel_version
+
+#include <sys/queue.h>
+#include <sys/_types.h>
+
diff --git a/include/net-snmp/system/linux.h b/include/net-snmp/system/linux.h
new file mode 100644
index 0000000..65b3be1
--- /dev/null
+++ b/include/net-snmp/system/linux.h
@@ -0,0 +1,23 @@
+#include "sysv.h"
+
+#define NETSNMP_DONT_USE_NLIST 1
+
+#undef NPROC_SYMBOL
+
+#undef bsdlike
+
+#define ARP_SCAN_FOUR_ARGUMENTS
+
+/* uncomment this to read process names from /proc/X/cmdline (like <= 5.0) */
+/* #define USE_PROC_CMDLINE */
+
+/*
+ * red hat >= 5.0 doesn't have this
+ */
+#ifndef MNTTYPE_PROC
+#define MNTTYPE_PROC "proc"
+#endif
+
+/* define the extra mib modules that are supported */
+#define NETSNMP_INCLUDE_HOST_RESOURCES
+#define NETSNMP_INCLUDE_IFTABLE_REWRITES
diff --git a/include/net-snmp/system/mingw32.h b/include/net-snmp/system/mingw32.h
new file mode 100644
index 0000000..68a3a76
--- /dev/null
+++ b/include/net-snmp/system/mingw32.h
@@ -0,0 +1,93 @@
+/*
+ * The Win32 API is maintained by the MinGW developers.
+ * The licensing for the Win32 API is defined in the
+ * MinGW file README.w32api, which states:
+
+ "Unless otherwise stated in individual source files,
+
+ THIS SOFTWARE IS NOT COPYRIGHTED
+
+ This source code is offered for use in the public domain. You may use,
+ modify or distribute it freely.
+
+ This source code is distributed in the hope that it will be useful but
+ WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ DISCLAIMED. This includes but is not limited to warranties of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+ */
+
+/*
+ * Make the getnameinfo() function available.
+ * Note: according to MSDN getnameinfo() is available in ws2_32 on Windows 2000
+ * and above. MinGW only makes getnameinfo() visible when setting _WIN32_WINNT
+ * to 0x0501 (Windows XP) or higher, which is a bug in the MinGW 5.1.6 headers.
+ */
+#define _WIN32_WINNT 0x0501
+
+#include <net-snmp/system/generic.h>
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h> /* uint32_t */
+#endif
+
+#undef bsdlike
+#undef MBSTAT_SYMBOL
+#undef TOTAL_MEMORY_SYMBOL
+#undef HAVE_GETOPT_H
+#undef HAVE_SOCKET
+#undef HAVE_SIGNAL
+
+/* Define if you have the gettimeofday function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define if you have the gethostbyname function. */
+#define HAVE_GETHOSTBYNAME 1
+
+/* Define if you have the gethostname function. */
+#define HAVE_GETHOSTNAME 1
+
+/* Define if you have raise() instead of alarm() */
+#define HAVE_RAISE 1
+
+/* Define if you have the socket function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if you have the `execv' function. */
+#undef HAVE_EXECV
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/*
+ * I'm sure there is a cleaner way to do this.
+ * Probably should be in net_snmp_config.h and
+ * set during config.
+ */
+#ifndef LOG_DAEMON
+#define LOG_DAEMON (3<<3) /* System daemons */
+#endif
+
+/* got socklen_t? */
+#define HAVE_SOCKLEN_T 1
+
+/* This was taken from the win32 config file - see licensing information above */
+#define EADDRINUSE WSAEADDRINUSE
+
+/*
+ * File io stuff. Odd that this is not defined by MinGW.
+ * Maybe there is an M$ish way to do it.
+ */
+#define F_SETFL 4
+#define O_NONBLOCK 0x4000 /* non blocking I/O (POSIX style) */
+
+#ifndef HAVE_STRUCT_TIMEZONE_TZ_DSTTIME
+/*
+ * Older MinGW versions do not have struct timezone, so define it here.
+ */
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+#endif
+
diff --git a/include/net-snmp/system/mingw32msvc.h b/include/net-snmp/system/mingw32msvc.h
new file mode 100644
index 0000000..66c0aed
--- /dev/null
+++ b/include/net-snmp/system/mingw32msvc.h
@@ -0,0 +1,10 @@
+/*
+ * This header is here to accomodate cross compiling for
+ * Microsoft Windows on a linux host using MinGW. All changes
+ * should be made to mingw32.h - Andy
+ */
+#ifndef mingw32
+#define mingw32 mingw32
+#endif
+
+#include "mingw32.h"
diff --git a/include/net-snmp/system/mips.h b/include/net-snmp/system/mips.h
new file mode 100644
index 0000000..e73d8ab
--- /dev/null
+++ b/include/net-snmp/system/mips.h
@@ -0,0 +1,4 @@
+
+#define NETSNMP_DONT_USE_NLIST 1
+
+#undef bsdlike
diff --git a/include/net-snmp/system/netbsd.h b/include/net-snmp/system/netbsd.h
new file mode 100644
index 0000000..1f22a44
--- /dev/null
+++ b/include/net-snmp/system/netbsd.h
@@ -0,0 +1,75 @@
+#include "bsd.h"
+
+#include <sys/param.h>
+
+#define PCB_TABLE 1
+#undef TCP_SYMBOL
+#define TCP_SYMBOL "tcbtable"
+#undef TCP_TTL_SYMBOL
+#define TCP_TTL_SYMBOL "ip_defttl"
+#undef UDB_SYMBOL
+#define UDB_SYMBOL "udbtable"
+#undef NPROC_SYMBOL
+#undef PROC_SYMBOL
+
+#define MBPOOL_SYMBOL "mbpool"
+#define MCLPOOL_SYMBOL "mclpool"
+
+/*
+ * inp_next symbol
+ */
+#undef INP_NEXT_SYMBOL
+#define INP_NEXT_SYMBOL inp_queue.cqe_next
+#undef INP_PREV_SYMBOL
+#define INP_PREV_SYMBOL inp_queue.cqe_prev
+#define HAVE_INPCBTABLE 1
+
+#if __NetBSD_Version__ >= 106300000 /* NetBSD 1.6ZD */
+#undef IFADDR_SYMBOL
+#define IFADDR_SYMBOL "in_ifaddrhead"
+#undef TOTAL_MEMORY_SYMBOL
+#endif
+
+#define UTMP_FILE _PATH_UTMP
+
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+
+#ifdef netbsdelf6
+#define netbsd6
+#define netbsdelf5
+#endif
+#ifdef netbsdelf5
+#define netbsd5
+#define netbsdelf4
+#endif
+#ifdef netbsdelf4
+#define netbsd4
+#define netbsdelf3
+#endif
+#ifdef netbsdelf3
+#define netbsd3
+#endif
+
+#if defined(netbsd6) && !defined(netbsd5)
+#define netbsd5 netbsd5
+#endif
+#if defined(netbsd5) && !defined(netbsd4)
+#define netbsd4 netbsd4
+#endif
+#if defined(netbsd4) && !defined(netbsd3)
+#define netbsd3 netbsd3
+#endif
+#if defined(netbsd3) && !defined(netbsd2)
+#define netbsd2 netbsd2
+#endif
+#ifndef netbsd1
+#define netbsd1 netbsd1
+#endif
+
+#if __NetBSD_Version__ >= 499005800
+#define NETBSD_STATS_VIA_SYSCTL
+#endif /* __NetBSD_Version__ >= 499005800 */
+
+/* define the extra mib modules that are supported */
+#define NETSNMP_INCLUDE_HOST_RESOURCES
+#define NETSNMP_INCLUDE_IFTABLE_REWRITES
diff --git a/include/net-snmp/system/nto-qnx6.h b/include/net-snmp/system/nto-qnx6.h
new file mode 100644
index 0000000..1965111
--- /dev/null
+++ b/include/net-snmp/system/nto-qnx6.h
@@ -0,0 +1,35 @@
+#include "bsd.h"
+
+#include <sys/param.h>
+
+#define PCB_TABLE 1
+#undef TCP_SYMBOL
+#define TCP_SYMBOL "tcbtable"
+#undef TCP_TTL_SYMBOL
+#define TCP_TTL_SYMBOL "ip_defttl"
+#undef UDB_SYMBOL
+#define UDB_SYMBOL "udbtable"
+#undef NPROC_SYMBOL
+#undef PROC_SYMBOL
+
+#define MBPOOL_SYMBOL "mbpool"
+#define MCLPOOL_SYMBOL "mclpool"
+
+/*
+ * inp_next symbol
+ */
+#undef INP_NEXT_SYMBOL
+#define INP_NEXT_SYMBOL inp_queue.cqe_next
+#undef INP_PREV_SYMBOL
+#define INP_PREV_SYMBOL inp_queue.cqe_prev
+#define HAVE_INPCBTABLE 1
+
+#undef IFADDR_SYMBOL
+#define IFADDR_SYMBOL "in_ifaddrhead"
+
+#define UTMP_FILE _PATH_UTMP
+
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+
+/* define the extra mib modules that are supported */
+/* #define NETSNMP_INCLUDE_HOST_RESOURCES */
diff --git a/include/net-snmp/system/openbsd.h b/include/net-snmp/system/openbsd.h
new file mode 100644
index 0000000..8db0eac
--- /dev/null
+++ b/include/net-snmp/system/openbsd.h
@@ -0,0 +1,18 @@
+#include "netbsd.h"
+
+#define netbsd1 netbsd1 /* we're really close to this */
+#define openbsd openbsd
+#define UVM
+
+#undef MBPOOL_SYMBOL
+#undef MCLPOOL_SYMBOL
+#undef TOTAL_MEMORY_SYMBOL
+
+/* at least OpenBSD/SPARC 3.7 doesn't define this */
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+/* define the extra mib modules that are supported */
+#define NETSNMP_INCLUDE_HOST_RESOURCES
+#define NETSNMP_INCLUDE_IFTABLE_REWRITES
diff --git a/include/net-snmp/system/openbsd4.h b/include/net-snmp/system/openbsd4.h
new file mode 100644
index 0000000..7077d06
--- /dev/null
+++ b/include/net-snmp/system/openbsd4.h
@@ -0,0 +1,3 @@
+/* openbsd4 is a superset of openbsd3 */
+#include "openbsd.h"
+#define openbsd3 openbsd3
diff --git a/include/net-snmp/system/openbsd5.h b/include/net-snmp/system/openbsd5.h
new file mode 100644
index 0000000..26b2415
--- /dev/null
+++ b/include/net-snmp/system/openbsd5.h
@@ -0,0 +1,3 @@
+/* openbsd5 is a superset of all since openbsd3 */
+#include "openbsd4.h"
+#define openbsd4 openbsd4
diff --git a/include/net-snmp/system/osf5.h b/include/net-snmp/system/osf5.h
new file mode 100644
index 0000000..32f45b8
--- /dev/null
+++ b/include/net-snmp/system/osf5.h
@@ -0,0 +1,28 @@
+#include <net-snmp/system/generic.h>
+
+#define osf4 osf4
+
+/* Needed by <sys/socket.h> to give us the correct sockaddr structures */
+#ifndef _SOCKADDR_LEN
+#define _SOCKADDR_LEN
+#endif
+
+#undef TCP_TTL_SYMBOL
+#define TCP_TTL_SYMBOL "tcp_ttl"
+
+/* var_route.c nlist symbols */
+#undef RTTABLES_SYMBOL
+#define RTTABLES_SYMBOL "rtable"
+#undef RTHASHSIZE_SYMBOL
+#define RTHASHSIZE_SYMBOL "rhash_size"
+
+#undef ARPTAB_SIZE_SYMBOL
+
+#ifndef __GNUC__
+# undef NETSNMP_ENABLE_INLINE
+# define NETSNMP_ENABLE_INLINE 0
+#endif
+
+#ifndef UINT32_MAX
+# define UINT32_MAX UINT_MAX
+#endif
diff --git a/include/net-snmp/system/solaris.h b/include/net-snmp/system/solaris.h
new file mode 100644
index 0000000..ec61c39
--- /dev/null
+++ b/include/net-snmp/system/solaris.h
@@ -0,0 +1,43 @@
+#include "sysv.h"
+
+#undef bsdlike
+#undef IP_FORWARDING_SYMBOL
+#undef ARPTAB_SYMBOL
+#define ARPTAB_SYMBOL "arptab_nb"
+#undef ARPTAB_SIZE_SYMBOL
+#define ARPTAB_SIZE_SYMBOL "arphd"
+#undef ICMPSTAT_SYMBOL
+#undef TCPSTAT_SYMBOL
+#undef TCP_SYMBOL
+#undef UDPSTAT_SYMBOL
+#undef UDB_SYMBOL
+#undef RTTABLES_SYMBOL
+#undef RTHASHSIZE_SYMBOL
+#undef RTHOST_SYMBOL
+#undef RTNET_SYMBOL
+#undef IPSTAT_SYMBOL
+#undef TCP_TTL_SYMBOL
+#undef PROC_SYMBOL
+#undef TOTAL_MEMORY_SYMBOL
+#undef MBSTAT_SYMBOL
+
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+#define UDP_PORTS_IN_HOST_ORDER 1
+#define TCP_PORTS_IN_HOST_ORDER 1
+
+/* define the extra mib modules that are supported */
+#define NETSNMP_INCLUDE_HOST_RESOURCES
+#define NETSNMP_INCLUDE_IFTABLE_REWRITES
+
+/* Solaris 2.6+ */
+#define _SLASH_PROC_METHOD_ 1
+
+/* Solaris 7+ */
+#define NETSNMP_DONT_USE_NLIST 1
+
+/*
+ * NEW_MIB_COMPLIANT is a define used in Solaris 10U4+ to enable additional
+ * MIB information (it affects the structs in <inet/mib2.h>)
+ */
+
+#define NEW_MIB_COMPLIANT
diff --git a/include/net-snmp/system/solaris2.3.h b/include/net-snmp/system/solaris2.3.h
new file mode 100644
index 0000000..7f4c5bf
--- /dev/null
+++ b/include/net-snmp/system/solaris2.3.h
@@ -0,0 +1 @@
+#include "solaris2.5.h"
diff --git a/include/net-snmp/system/solaris2.4.h b/include/net-snmp/system/solaris2.4.h
new file mode 100644
index 0000000..7f4c5bf
--- /dev/null
+++ b/include/net-snmp/system/solaris2.4.h
@@ -0,0 +1 @@
+#include "solaris2.5.h"
diff --git a/include/net-snmp/system/solaris2.5.h b/include/net-snmp/system/solaris2.5.h
new file mode 100644
index 0000000..341d21f
--- /dev/null
+++ b/include/net-snmp/system/solaris2.5.h
@@ -0,0 +1,4 @@
+#include "solaris.h"
+#undef _SLASH_PROC_METHOD_
+#undef NETSNMP_DONT_USE_NLIST
+
diff --git a/include/net-snmp/system/solaris2.6.h b/include/net-snmp/system/solaris2.6.h
new file mode 100644
index 0000000..370ed33
--- /dev/null
+++ b/include/net-snmp/system/solaris2.6.h
@@ -0,0 +1,2 @@
+#include "solaris.h"
+#undef NETSNMP_DONT_USE_NLIST
diff --git a/include/net-snmp/system/sunos.h b/include/net-snmp/system/sunos.h
new file mode 100644
index 0000000..48eef00
--- /dev/null
+++ b/include/net-snmp/system/sunos.h
@@ -0,0 +1,12 @@
+#include <net-snmp/system/generic.h>
+
+typedef int ssize_t;
+
+#undef IP_FORWARDING_SYMBOL
+#define IP_FORWARDING_SYMBOL "ip_forwarding"
+
+#undef TCP_TTL_SYMBOL
+#define TCP_TTL_SYMBOL "tcp_ttl"
+
+#define UTMP_HAS_NO_TYPE 1
+#define UTMP_FILE "/etc/utmp"
diff --git a/include/net-snmp/system/svr5.h b/include/net-snmp/system/svr5.h
new file mode 100644
index 0000000..017c7c1
--- /dev/null
+++ b/include/net-snmp/system/svr5.h
@@ -0,0 +1,20 @@
+/*
+ * used to minimally build SCO UnixWare 7.1.0 using CCS 3.2 compiler - YMMV
+ */
+
+#include <net-snmp/system/generic.h>
+
+/*
+ * using CCS "cc", "configure" does not find this item
+ */
+#define HAVE_GETHOSTBYNAME 1
+
+/*
+ * lie about this next define to avoid sa_len and sa_family MACROS !!
+ */
+#define HAVE_STRUCT_SOCKADDR_SA_UNION_SA_GENERIC_SA_FAMILY2 1
+
+/*
+ * this header requires queue_t, not easily done without kernel headers
+ */
+#undef HAVE_NETINET_IN_PCB_H
diff --git a/include/net-snmp/system/sysv.h b/include/net-snmp/system/sysv.h
new file mode 100644
index 0000000..45d6a39
--- /dev/null
+++ b/include/net-snmp/system/sysv.h
@@ -0,0 +1,2 @@
+#include <net-snmp/system/generic.h>
+#define SYSV 1
diff --git a/include/net-snmp/system/ultrix4.h b/include/net-snmp/system/ultrix4.h
new file mode 100644
index 0000000..4efc3db
--- /dev/null
+++ b/include/net-snmp/system/ultrix4.h
@@ -0,0 +1,9 @@
+#include <net-snmp/system/generic.h>
+#include <sys/types.h>
+
+typedef int ssize_t;
+
+#undef TCP_TTL_SYMBOL
+#define TCP_TTL_SYMBOL "tcp_ttl"
+
+#undef RTTABLES_SYMBOL
diff --git a/include/net-snmp/types.h b/include/net-snmp/types.h
new file mode 100644
index 0000000..95d2576
--- /dev/null
+++ b/include/net-snmp/types.h
@@ -0,0 +1,427 @@
+#ifndef NET_SNMP_TYPES_H
+#define NET_SNMP_TYPES_H
+
+ /**
+ * Definitions of data structures, used within the library API.
+ */
+
+#include <stdio.h>
+
+#ifndef NET_SNMP_CONFIG_H
+#error "Please include <net-snmp/net-snmp-config.h> before this file"
+#endif
+
+ /*
+ * For 'timeval'
+ */
+#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
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#include <sys/types.h>
+#if 1
+/*
+ * If neither the Microsoft winsock header file nor the MinGW winsock header
+ * file has already been included, do this now.
+ */
+# if defined(HAVE_WINSOCK2_H) && defined(HAVE_WS2TCPIP_H)
+# if !defined(HAVE_WIN32_PLATFORM_SDK) && _MSC_VER -0 <= 1200 \
+ && _WIN32_WINNT -0 >= 0x0400
+ /*
+ * When using the MSVC 6 header files, including <winsock2.h> when
+ * _WIN32_WINNT >= 0x0400 results in a compilation error. Hence include
+ * <windows.h> instead, because <winsock2.h> is included from inside
+ * <windows.h> when _WIN32_WINNT >= 0x0400. The SDK version of <windows.h>
+ * does not include <winsock2.h> however.
+ */
+# include <windows.h>
+# else
+# include <winsock2.h>
+# endif
+# include <ws2tcpip.h>
+# elif defined(HAVE_WINSOCK_H)
+# include <winsock.h>
+# endif
+#endif
+
+#if defined(WIN32) && !defined(cygwin)
+typedef HANDLE netsnmp_pid_t;
+#define NETSNMP_NO_SUCH_PROCESS INVALID_HANDLE_VALUE
+#else
+/*
+ * Note: on POSIX-compliant systems, pid_t is defined in <sys/types.h>.
+ * And if pid_t has not been defined in <sys/types.h>, AC_TYPE_PID_T ensures
+ * that a pid_t definition is present in net-snmp-config.h.
+ */
+typedef pid_t netsnmp_pid_t;
+#define NETSNMP_NO_SUCH_PROCESS -1
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h> /* For definition of in_addr_t */
+#endif
+
+#include <net-snmp/library/oid.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef HAVE_SOCKLEN_T
+typedef u_int socklen_t;
+#endif
+
+#ifndef HAVE_IN_ADDR_T
+ /*
+ * The type in_addr_t must match the type of sockaddr_in::sin_addr.
+ * For MSVC and MinGW32, this is u_long.
+ */
+typedef u_long in_addr_t;
+#endif
+
+#ifndef HAVE_SSIZE_T
+#if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
+typedef int ssize_t;
+#else
+typedef long ssize_t;
+#endif
+#endif
+
+#ifndef HAVE_NFDS_T
+typedef unsigned long int nfds_t;
+#endif
+
+ /*
+ * For the initial release, this will just refer to the
+ * relevant UCD header files.
+ * In due course, the types and structures relevant to the
+ * Net-SNMP API will be identified, and defined here directly.
+ *
+ * But for the time being, this header file is primarily a placeholder,
+ * to allow application writers to adopt the new header file names.
+ */
+
+typedef union {
+ long *integer;
+ u_char *string;
+ oid *objid;
+ u_char *bitstring;
+ struct counter64 *counter64;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ float *floatVal;
+ double *doubleVal;
+ /*
+ * t_union *unionVal;
+ */
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+} netsnmp_vardata;
+
+
+#define MAX_OID_LEN 128 /* max subid's in an oid */
+
+/** @typedef struct variable_list netsnmp_variable_list
+ * Typedefs the variable_list struct into netsnmp_variable_list */
+/** @struct variable_list
+ * The netsnmp variable list binding structure, it's typedef'd to
+ * netsnmp_variable_list.
+ */
+typedef struct variable_list {
+ /** NULL for last variable */
+ struct variable_list *next_variable;
+ /** Object identifier of variable */
+ oid *name;
+ /** number of subid's in name */
+ size_t name_length;
+ /** ASN type of variable */
+ u_char type;
+ /** value of variable */
+ netsnmp_vardata val;
+ /** the length of the value to be copied into buf */
+ size_t val_len;
+ /** buffer to hold the OID */
+ oid name_loc[MAX_OID_LEN];
+ /** 90 percentile < 40. */
+ u_char buf[40];
+ /** (Opaque) hook for additional data */
+ void *data;
+ /** callback to free above */
+ void (*dataFreeHook)(void *);
+ int index;
+} netsnmp_variable_list;
+
+
+/** @typedef struct snmp_pdu to netsnmp_pdu
+ * Typedefs the snmp_pdu struct into netsnmp_pdu */
+/** @struct snmp_pdu
+ * The snmp protocol data unit.
+ */
+typedef struct snmp_pdu {
+
+#define non_repeaters errstat
+#define max_repetitions errindex
+
+ /*
+ * Protocol-version independent fields
+ */
+ /** snmp version */
+ long version;
+ /** Type of this PDU */
+ int command;
+ /** Request id - note: not incremented on retries */
+ long reqid;
+ /** Message id for V3 messages note: incremented for each retry */
+ long msgid;
+ /** Unique ID for incoming transactions */
+ long transid;
+ /** Session id for AgentX messages */
+ long sessid;
+ /** Error status (non_repeaters in GetBulk) */
+ long errstat;
+ /** Error index (max_repetitions in GetBulk) */
+ long errindex;
+ /** Uptime */
+ u_long time;
+ u_long flags;
+
+ int securityModel;
+ /** noAuthNoPriv, authNoPriv, authPriv */
+ int securityLevel;
+ int msgParseModel;
+
+ /**
+ * Transport-specific opaque data. This replaces the IP-centric address
+ * field.
+ */
+
+ void *transport_data;
+ int transport_data_length;
+
+ /**
+ * The actual transport domain. This SHOULD NOT BE FREE()D.
+ */
+
+ const oid *tDomain;
+ size_t tDomainLen;
+
+ netsnmp_variable_list *variables;
+
+
+ /*
+ * SNMPv1 & SNMPv2c fields
+ */
+ /** community for outgoing requests. */
+ u_char *community;
+ /** length of community name. */
+ size_t community_len;
+
+ /*
+ * Trap information
+ */
+ /** System OID */
+ oid *enterprise;
+ size_t enterprise_length;
+ /** trap type */
+ long trap_type;
+ /** specific type */
+ long specific_type;
+ /** This is ONLY used for v1 TRAPs */
+ unsigned char agent_addr[4];
+
+ /*
+ * SNMPv3 fields
+ */
+ /** context snmpEngineID */
+ u_char *contextEngineID;
+ /** Length of contextEngineID */
+ size_t contextEngineIDLen;
+ /** authoritative contextName */
+ char *contextName;
+ /** Length of contextName */
+ size_t contextNameLen;
+ /** authoritative snmpEngineID for security */
+ u_char *securityEngineID;
+ /** Length of securityEngineID */
+ size_t securityEngineIDLen;
+ /** on behalf of this principal */
+ char *securityName;
+ /** Length of securityName. */
+ size_t securityNameLen;
+
+ /*
+ * AgentX fields
+ * (also uses SNMPv1 community field)
+ */
+ int priority;
+ int range_subid;
+
+ void *securityStateRef;
+} netsnmp_pdu;
+
+
+/** @typedef struct snmp_session netsnmp_session
+ * Typedefs the snmp_session struct intonetsnmp_session */
+ struct snmp_session;
+typedef struct snmp_session netsnmp_session;
+
+#define USM_AUTH_KU_LEN 32
+#define USM_PRIV_KU_LEN 32
+
+typedef int (*snmp_callback) (int, netsnmp_session *, int,
+ netsnmp_pdu *, void *);
+typedef int (*netsnmp_callback) (int, netsnmp_session *, int,
+ netsnmp_pdu *, void *);
+
+struct netsnmp_container_s;
+
+/** @struct snmp_session
+ * The snmp session structure.
+ */
+struct snmp_session {
+ /*
+ * Protocol-version independent fields
+ */
+ /** snmp version */
+ long version;
+ /** Number of retries before timeout. */
+ int retries;
+ /** Number of uS until first timeout, then exponential backoff */
+ long timeout;
+ u_long flags;
+ struct snmp_session *subsession;
+ struct snmp_session *next;
+
+ /** name or address of default peer (may include transport specifier and/or port number) */
+ char *peername;
+ /** UDP port number of peer. (NO LONGER USED - USE peername INSTEAD) */
+ u_short remote_port;
+ /** My Domain name or dotted IP address, 0 for default */
+ char *localname;
+ /** My UDP port number, 0 for default, picked randomly */
+ u_short local_port;
+ /**
+ * Authentication function or NULL if null authentication is used
+ */
+ u_char *(*authenticator) (u_char *, size_t *, u_char *, size_t);
+ /** Function to interpret incoming data */
+ netsnmp_callback callback;
+ /**
+ * Pointer to data that the callback function may consider important
+ */
+ void *callback_magic;
+ /** copy of system errno */
+ int s_errno;
+ /** copy of library errno */
+ int s_snmp_errno;
+ /** Session id - AgentX only */
+ long sessid;
+
+ /*
+ * SNMPv1 & SNMPv2c fields
+ */
+ /** community for outgoing requests. */
+ u_char *community;
+ /** Length of community name. */
+ size_t community_len;
+ /** Largest message to try to receive. */
+ size_t rcvMsgMaxSize;
+ /** Largest message to try to send. */
+ size_t sndMsgMaxSize;
+
+ /*
+ * SNMPv3 fields
+ */
+ /** are we the authoritative engine? */
+ u_char isAuthoritative;
+ /** authoritative snmpEngineID */
+ u_char *contextEngineID;
+ /** Length of contextEngineID */
+ size_t contextEngineIDLen;
+ /** initial engineBoots for remote engine */
+ u_int engineBoots;
+ /** initial engineTime for remote engine */
+ u_int engineTime;
+ /** authoritative contextName */
+ char *contextName;
+ /** Length of contextName */
+ size_t contextNameLen;
+ /** authoritative snmpEngineID */
+ u_char *securityEngineID;
+ /** Length of contextEngineID */
+ size_t securityEngineIDLen;
+ /** on behalf of this principal */
+ char *securityName;
+ /** Length of securityName. */
+ size_t securityNameLen;
+
+ /** auth protocol oid */
+ oid *securityAuthProto;
+ /** Length of auth protocol oid */
+ size_t securityAuthProtoLen;
+ /** Ku for auth protocol XXX */
+ u_char securityAuthKey[USM_AUTH_KU_LEN];
+ /** Length of Ku for auth protocol */
+ size_t securityAuthKeyLen;
+ /** Kul for auth protocol */
+ u_char *securityAuthLocalKey;
+ /** Length of Kul for auth protocol XXX */
+ size_t securityAuthLocalKeyLen;
+
+ /** priv protocol oid */
+ oid *securityPrivProto;
+ /** Length of priv protocol oid */
+ size_t securityPrivProtoLen;
+ /** Ku for privacy protocol XXX */
+ u_char securityPrivKey[USM_PRIV_KU_LEN];
+ /** Length of Ku for priv protocol */
+ size_t securityPrivKeyLen;
+ /** Kul for priv protocol */
+ u_char *securityPrivLocalKey;
+ /** Length of Kul for priv protocol XXX */
+ size_t securityPrivLocalKeyLen;
+
+ /** snmp security model, v1, v2c, usm */
+ int securityModel;
+ /** noAuthNoPriv, authNoPriv, authPriv */
+ int securityLevel;
+ /** target param name */
+ char *paramName;
+
+ /**
+ * security module specific
+ */
+ void *securityInfo;
+
+ /**
+ * transport specific configuration
+ */
+ struct netsnmp_container_s *transport_configuration;
+
+ /**
+ * use as you want data
+ *
+ * used by 'SNMP_FLAGS_RESP_CALLBACK' handling in the agent
+ * XXX: or should we add a new field into this structure?
+ */
+ void *myvoid;
+};
+
+
+#include <net-snmp/library/types.h>
+#include <net-snmp/definitions.h>
+#include <net-snmp/library/snmp_api.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NET_SNMP_TYPES_H */
diff --git a/include/net-snmp/utilities.h b/include/net-snmp/utilities.h
new file mode 100644
index 0000000..55aed5f
--- /dev/null
+++ b/include/net-snmp/utilities.h
@@ -0,0 +1,63 @@
+#ifndef NET_SNMP_UTILITIES_H
+#define NET_SNMP_UTILITIES_H
+
+ /**
+ * Library API routines not specifically concerned with SNMP directly,
+ * but used more generally within the library, agent and other applications.
+ *
+ * This also includes "standard" system routines, which are missing on
+ * particular O/S distributiones.
+ */
+
+#ifndef NET_SNMP_CONFIG_H
+#error "Please include <net-snmp/net-snmp-config.h> before this file"
+#endif
+
+#include <net-snmp/types.h>
+
+ /*
+ * For the initial release, this will just refer to the
+ * relevant UCD header files.
+ * In due course, the routines relevant to this area of the
+ * API will be identified, and listed here directly.
+ *
+ * But for the time being, this header file is a placeholder,
+ * to allow application writers to adopt the new header file names.
+ */
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_client.h>
+#if HAVE_GETOPT_H
+#include <getopt.h>
+#else
+#include <net-snmp/library/getopt.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h> /* for in_addr_t */
+#endif
+#include <net-snmp/library/system.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/asn1.h> /* for counter64 */
+#include <net-snmp/library/int64.h>
+
+#include <net-snmp/library/mt_support.h>
+/* #include <net-snmp/library/snmp_locking.h> */
+#include <net-snmp/library/snmp_alarm.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/data_list.h>
+#include <net-snmp/library/oid_stash.h>
+#include <net-snmp/library/snmp.h>
+#include <net-snmp/library/snmp_impl.h>
+#include <net-snmp/library/snmp-tc.h>
+#include <net-snmp/library/check_varbind.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/container_binary_array.h>
+#include <net-snmp/library/container_list_ssll.h>
+#include <net-snmp/library/container_iterator.h>
+
+#include <net-snmp/library/snmp_assert.h>
+
+#include <net-snmp/version.h>
+
+#endif /* NET_SNMP_UTILITIES_H */
diff --git a/include/net-snmp/varbind_api.h b/include/net-snmp/varbind_api.h
new file mode 100644
index 0000000..7f48503
--- /dev/null
+++ b/include/net-snmp/varbind_api.h
@@ -0,0 +1,105 @@
+#ifndef NET_SNMP_VARBIND_API_H
+#define NET_SNMP_VARBIND_API_H
+
+ /**
+ * Library API routines concerned with variable bindings and values.
+ */
+
+#include <net-snmp/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Creation */
+ NETSNMP_IMPORT
+ netsnmp_variable_list *
+ snmp_pdu_add_variable(netsnmp_pdu *pdu,
+ const oid * name, size_t name_length,
+ u_char type,
+ const void * value, size_t len);
+ NETSNMP_IMPORT
+ netsnmp_variable_list *
+ snmp_varlist_add_variable(netsnmp_variable_list ** varlist,
+ const oid * name, size_t name_length,
+ u_char type,
+ const void * value, size_t len);
+ NETSNMP_IMPORT
+ netsnmp_variable_list *
+ snmp_add_null_var(netsnmp_pdu *pdu,
+ const oid * name, size_t name_length);
+ NETSNMP_IMPORT
+ netsnmp_variable_list *
+ snmp_clone_varbind(netsnmp_variable_list * varlist);
+
+ /* Setting Values */
+ NETSNMP_IMPORT
+ int snmp_set_var_objid(netsnmp_variable_list * var,
+ const oid * name, size_t name_length);
+ NETSNMP_IMPORT
+ int snmp_set_var_value(netsnmp_variable_list * var,
+ const void * value, size_t len);
+ NETSNMP_IMPORT
+ int snmp_set_var_typed_value(netsnmp_variable_list * var,
+ u_char type,
+ const void * value, size_t len);
+ NETSNMP_IMPORT
+ int snmp_set_var_typed_integer(netsnmp_variable_list * var,
+ u_char type, long val);
+
+ /* Output */
+ NETSNMP_IMPORT
+ void print_variable(const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable);
+ NETSNMP_IMPORT
+ void fprint_variable(FILE * fp,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable);
+ NETSNMP_IMPORT
+ int snprint_variable(char *buf, size_t buf_len,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable);
+
+ NETSNMP_IMPORT
+ void print_value(const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable);
+ NETSNMP_IMPORT
+ void fprint_value(FILE * fp,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable);
+ NETSNMP_IMPORT
+ int snprint_value(char *buf, size_t buf_len,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable);
+
+ /* See mib_api.h for {,f,sn}print_objid */
+
+ /* Deletion */
+ NETSNMP_IMPORT
+ void snmp_free_var( netsnmp_variable_list *var); /* frees just this one */
+ NETSNMP_IMPORT
+ void snmp_free_varbind(netsnmp_variable_list *varlist); /* frees all in list */
+
+#ifdef __cplusplus
+}
+#endif
+
+ /*
+ * Having extracted the main ("public API") calls relevant
+ * to this area of the Net-SNMP project, the next step is to
+ * identify the related "public internal API" routines.
+ *
+ * In due course, these should probably be gathered
+ * together into a companion 'library/varbind_api.h' header file.
+ * [Or some suitable name]
+ *
+ * But for the time being, the expectation is that the
+ * traditional headers that provided the above definitions
+ * will probably also cover the relevant internal API calls.
+ * Hence they are listed here:
+ */
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_client.h>
+#include <net-snmp/library/mib.h>
+
+#endif /* NET_SNMP_VARBIND_API_H */
diff --git a/include/net-snmp/version.h b/include/net-snmp/version.h
new file mode 100644
index 0000000..1c36ffe
--- /dev/null
+++ b/include/net-snmp/version.h
@@ -0,0 +1,18 @@
+#ifndef NET_SNMP_VERSION_H
+#define NET_SNMP_VERSION_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef UCD_COMPATIBLE
+ extern const char *NetSnmpVersionInfo;
+#endif
+
+ NETSNMP_IMPORT
+ const char *netsnmp_get_version(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* NET_SNMP_VERSION_H */
diff --git a/include/ucd-snmp/README b/include/ucd-snmp/README
new file mode 100644
index 0000000..a390f60
--- /dev/null
+++ b/include/ucd-snmp/README
@@ -0,0 +1,3 @@
+This directory contains compatibility include files to make the newer
+work of the net-snmp code still work with code written for the
+ucd-snmp package.
diff --git a/include/ucd-snmp/agent_index.h b/include/ucd-snmp/agent_index.h
new file mode 100644
index 0000000..1285120
--- /dev/null
+++ b/include/ucd-snmp/agent_index.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/agent_index.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/agent_read_config.h b/include/ucd-snmp/agent_read_config.h
new file mode 100644
index 0000000..5e157b2
--- /dev/null
+++ b/include/ucd-snmp/agent_read_config.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/agent_read_config.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/agent_registry.h b/include/ucd-snmp/agent_registry.h
new file mode 100644
index 0000000..ca66cec
--- /dev/null
+++ b/include/ucd-snmp/agent_registry.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/agent_registry.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/agent_trap.h b/include/ucd-snmp/agent_trap.h
new file mode 100644
index 0000000..dfbfeec
--- /dev/null
+++ b/include/ucd-snmp/agent_trap.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/agent_trap.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/asn1.h b/include/ucd-snmp/asn1.h
new file mode 100644
index 0000000..078034b
--- /dev/null
+++ b/include/ucd-snmp/asn1.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/asn1.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/auto_nlist.h b/include/ucd-snmp/auto_nlist.h
new file mode 100644
index 0000000..2fcd668
--- /dev/null
+++ b/include/ucd-snmp/auto_nlist.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/auto_nlist.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/callback.h b/include/ucd-snmp/callback.h
new file mode 100644
index 0000000..8fe29cd
--- /dev/null
+++ b/include/ucd-snmp/callback.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/callback.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/default_store.h b/include/ucd-snmp/default_store.h
new file mode 100644
index 0000000..0274f25
--- /dev/null
+++ b/include/ucd-snmp/default_store.h
@@ -0,0 +1,88 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/default_store.h>
+
+/* Compatibility definitions -- see above header for meaningful comments. */
+
+#define DS_MAX_IDS NETSNMP_DS_MAX_IDS
+#define DS_MAX_SUBIDS NETSNMP_DS_MAX_SUBIDS
+
+#define DS_LIBRARY_ID NETSNMP_DS_LIBRARY_ID
+#define DS_APPLICATION_ID NETSNMP_DS_APPLICATION_ID
+#define DS_TOKEN_ID NETSNMP_DS_TOKEN_ID
+
+#define DS_LIB_MIB_ERRORS NETSNMP_DS_LIB_MIB_ERRORS
+#define DS_LIB_SAVE_MIB_DESCRS NETSNMP_DS_LIB_SAVE_MIB_DESCRS
+#define DS_LIB_MIB_COMMENT_TERM NETSNMP_DS_LIB_MIB_COMMENT_TERM
+#define DS_LIB_MIB_PARSE_LABEL NETSNMP_DS_LIB_MIB_PARSE_LABEL
+#define DS_LIB_DUMP_PACKET NETSNMP_DS_LIB_DUMP_PACKET
+#define DS_LIB_LOG_TIMESTAMP NETSNMP_DS_LIB_LOG_TIMESTAMP
+#define DS_LIB_DONT_READ_CONFIGS NETSNMP_DS_LIB_DONT_READ_CONFIGS
+#define DS_LIB_MIB_REPLACE NETSNMP_DS_LIB_MIB_REPLACE
+#define DS_LIB_PRINT_NUMERIC_ENUM NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM
+#define DS_LIB_PRINT_NUMERIC_OIDS NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS
+#define DS_LIB_DONT_BREAKDOWN_OIDS NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS
+#define DS_LIB_ALARM_DONT_USE_SIG NETSNMP_DS_LIB_ALARM_DONT_USE_SIG
+#define DS_LIB_PRINT_FULL_OID NETSNMP_DS_LIB_PRINT_FULL_OID
+#define DS_LIB_QUICK_PRINT NETSNMP_DS_LIB_QUICK_PRINT
+#define DS_LIB_RANDOM_ACCESS NETSNMP_DS_LIB_RANDOM_ACCESS
+#define DS_LIB_REGEX_ACCESS NETSNMP_DS_LIB_REGEX_ACCESS
+#define DS_LIB_DONT_CHECK_RANGE NETSNMP_DS_LIB_DONT_CHECK_RANGE
+#define DS_LIB_NO_TOKEN_WARNINGS NETSNMP_DS_LIB_NO_TOKEN_WARNINGS
+#define DS_LIB_NUMERIC_TIMETICKS NETSNMP_DS_LIB_NUMERIC_TIMETICKS
+#define DS_LIB_ESCAPE_QUOTES NETSNMP_DS_LIB_ESCAPE_QUOTES
+#define DS_LIB_REVERSE_ENCODE NETSNMP_DS_LIB_REVERSE_ENCODE
+#define DS_LIB_PRINT_BARE_VALUE NETSNMP_DS_LIB_PRINT_BARE_VALUE
+#define DS_LIB_EXTENDED_INDEX NETSNMP_DS_LIB_EXTENDED_INDEX
+#define DS_LIB_PRINT_HEX_TEXT NETSNMP_DS_LIB_PRINT_HEX_TEXT
+
+#define DS_LIB_MIB_WARNINGS NETSNMP_DS_LIB_MIB_WARNINGS
+#define DS_LIB_SECLEVEL NETSNMP_DS_LIB_SECLEVEL
+#define DS_LIB_SNMPVERSION NETSNMP_DS_LIB_SNMPVERSION
+#define DS_LIB_DEFAULT_PORT NETSNMP_DS_LIB_DEFAULT_PORT
+#define DS_LIB_PRINT_SUFFIX_ONLY NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY
+
+#define DS_LIB_SECNAME NETSNMP_DS_LIB_SECNAME
+#define DS_LIB_CONTEXT NETSNMP_DS_LIB_CONTEXT
+#define DS_LIB_PASSPHRASE NETSNMP_DS_LIB_PASSPHRASE
+#define DS_LIB_AUTHPASSPHRASE NETSNMP_DS_LIB_AUTHPASSPHRASE
+#define DS_LIB_PRIVPASSPHRASE NETSNMP_DS_LIB_PRIVPASSPHRASE
+#define DS_LIB_OPTIONALCONFIG NETSNMP_DS_LIB_OPTIONALCONFIG
+#define DS_LIB_APPTYPE NETSNMP_DS_LIB_APPTYPE
+#define DS_LIB_COMMUNITY NETSNMP_DS_LIB_COMMUNITY
+#define DS_LIB_PERSISTENT_DIR NETSNMP_DS_LIB_PERSISTENT_DIR
+#define DS_LIB_CONFIGURATION_DIR NETSNMP_DS_LIB_CONFIGURATION_DIR
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int ds_set_boolean (int storeid, int which, int value);
+int ds_get_boolean (int storeid, int which);
+int ds_toggle_boolean (int storeid, int which);
+
+int ds_set_int (int storeid, int which, int value);
+int ds_get_int (int storeid, int which);
+
+int ds_set_string (int storeid, int which, const char *value);
+char *ds_get_string (int storeid, int which);
+
+int ds_set_void (int storeid, int which, void *value);
+void *ds_get_void (int storeid, int which);
+
+int ds_register_config (u_char type, const char *ftype,
+ const char *token, int storeid, int which);
+int ds_register_premib (u_char type, const char *ftype,
+ const char *token, int storeid, int which);
+
+void ds_shutdown (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#else /* UCD_COMPATIBLE */
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/ds_agent.h b/include/ucd-snmp/ds_agent.h
new file mode 100644
index 0000000..f8abb2f
--- /dev/null
+++ b/include/ucd-snmp/ds_agent.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/ds_agent.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/header_complex.h b/include/ucd-snmp/header_complex.h
new file mode 100644
index 0000000..7c7a0d7
--- /dev/null
+++ b/include/ucd-snmp/header_complex.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/header_complex.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/int64.h b/include/ucd-snmp/int64.h
new file mode 100644
index 0000000..fe7e56c
--- /dev/null
+++ b/include/ucd-snmp/int64.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/int64.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/keytools.h b/include/ucd-snmp/keytools.h
new file mode 100644
index 0000000..3049f3f
--- /dev/null
+++ b/include/ucd-snmp/keytools.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/keytools.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/mib.h b/include/ucd-snmp/mib.h
new file mode 100644
index 0000000..08d509a
--- /dev/null
+++ b/include/ucd-snmp/mib.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/mib.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/mib_module_config.h b/include/ucd-snmp/mib_module_config.h
new file mode 100644
index 0000000..5def4f8
--- /dev/null
+++ b/include/ucd-snmp/mib_module_config.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/mib_module_config.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/mibincl.h b/include/ucd-snmp/mibincl.h
new file mode 100644
index 0000000..c15cfb8
--- /dev/null
+++ b/include/ucd-snmp/mibincl.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/mibincl.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/parse.h b/include/ucd-snmp/parse.h
new file mode 100644
index 0000000..ba3054a
--- /dev/null
+++ b/include/ucd-snmp/parse.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/parse.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/read_config.h b/include/ucd-snmp/read_config.h
new file mode 100644
index 0000000..460ff27
--- /dev/null
+++ b/include/ucd-snmp/read_config.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/read_config.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/scapi.h b/include/ucd-snmp/scapi.h
new file mode 100644
index 0000000..b668c93
--- /dev/null
+++ b/include/ucd-snmp/scapi.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/scapi.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp-tc.h b/include/ucd-snmp/snmp-tc.h
new file mode 100644
index 0000000..e15b8fd
--- /dev/null
+++ b/include/ucd-snmp/snmp-tc.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmp-tc.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp.h b/include/ucd-snmp/snmp.h
new file mode 100644
index 0000000..030b69d
--- /dev/null
+++ b/include/ucd-snmp/snmp.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmp.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp_agent.h b/include/ucd-snmp/snmp_agent.h
new file mode 100644
index 0000000..54a5910
--- /dev/null
+++ b/include/ucd-snmp/snmp_agent.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/snmp_agent.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp_alarm.h b/include/ucd-snmp/snmp_alarm.h
new file mode 100644
index 0000000..6680699
--- /dev/null
+++ b/include/ucd-snmp/snmp_alarm.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmp_alarm.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp_api.h b/include/ucd-snmp/snmp_api.h
new file mode 100644
index 0000000..a9c188a
--- /dev/null
+++ b/include/ucd-snmp/snmp_api.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmp_api.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp_client.h b/include/ucd-snmp/snmp_client.h
new file mode 100644
index 0000000..f229278
--- /dev/null
+++ b/include/ucd-snmp/snmp_client.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmp_client.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp_debug.h b/include/ucd-snmp/snmp_debug.h
new file mode 100644
index 0000000..83c170e
--- /dev/null
+++ b/include/ucd-snmp/snmp_debug.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmp_debug.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp_impl.h b/include/ucd-snmp/snmp_impl.h
new file mode 100644
index 0000000..2539c5e
--- /dev/null
+++ b/include/ucd-snmp/snmp_impl.h
@@ -0,0 +1,11 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_impl.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp_logging.h b/include/ucd-snmp/snmp_logging.h
new file mode 100644
index 0000000..a4e51d2
--- /dev/null
+++ b/include/ucd-snmp/snmp_logging.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmp_logging.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp_parse_args.h b/include/ucd-snmp/snmp_parse_args.h
new file mode 100644
index 0000000..621638d
--- /dev/null
+++ b/include/ucd-snmp/snmp_parse_args.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmp_parse_args.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmp_vars.h b/include/ucd-snmp/snmp_vars.h
new file mode 100644
index 0000000..6609587
--- /dev/null
+++ b/include/ucd-snmp/snmp_vars.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmp_vars.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmpusm.h b/include/ucd-snmp/snmpusm.h
new file mode 100644
index 0000000..98f1207
--- /dev/null
+++ b/include/ucd-snmp/snmpusm.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmpusm.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/snmpv3.h b/include/ucd-snmp/snmpv3.h
new file mode 100644
index 0000000..7a40e7c
--- /dev/null
+++ b/include/ucd-snmp/snmpv3.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/snmpv3.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/struct.h b/include/ucd-snmp/struct.h
new file mode 100644
index 0000000..9432815
--- /dev/null
+++ b/include/ucd-snmp/struct.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/struct.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/system.h b/include/ucd-snmp/system.h
new file mode 100644
index 0000000..ca2096e
--- /dev/null
+++ b/include/ucd-snmp/system.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/system.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/tools.h b/include/ucd-snmp/tools.h
new file mode 100644
index 0000000..51483ee
--- /dev/null
+++ b/include/ucd-snmp/tools.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/tools.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/transform_oids.h b/include/ucd-snmp/transform_oids.h
new file mode 100644
index 0000000..b960afd
--- /dev/null
+++ b/include/ucd-snmp/transform_oids.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/library/transform_oids.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/ucd-snmp-agent-includes.h b/include/ucd-snmp/ucd-snmp-agent-includes.h
new file mode 100644
index 0000000..501f7a8
--- /dev/null
+++ b/include/ucd-snmp/ucd-snmp-agent-includes.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/ucd-snmp-config.h b/include/ucd-snmp/ucd-snmp-config.h
new file mode 100644
index 0000000..667a4b7
--- /dev/null
+++ b/include/ucd-snmp/ucd-snmp-config.h
@@ -0,0 +1,2 @@
+#define UCD_COMPATIBLE
+#include <net-snmp/net-snmp-config.h>
diff --git a/include/ucd-snmp/ucd-snmp-includes.h b/include/ucd-snmp/ucd-snmp-includes.h
new file mode 100644
index 0000000..df7254b
--- /dev/null
+++ b/include/ucd-snmp/ucd-snmp-includes.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/net-snmp-includes.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/util_funcs.h b/include/ucd-snmp/util_funcs.h
new file mode 100644
index 0000000..96329a4
--- /dev/null
+++ b/include/ucd-snmp/util_funcs.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/util_funcs.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/var_struct.h b/include/ucd-snmp/var_struct.h
new file mode 100644
index 0000000..747c9cc
--- /dev/null
+++ b/include/ucd-snmp/var_struct.h
@@ -0,0 +1,9 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/agent/var_struct.h>
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/include/ucd-snmp/version.h b/include/ucd-snmp/version.h
new file mode 100644
index 0000000..342110b
--- /dev/null
+++ b/include/ucd-snmp/version.h
@@ -0,0 +1,11 @@
+#ifdef UCD_COMPATIBLE
+
+#include <net-snmp/version.h>
+
+#define VersionInfo NetSnmpVersionInfo
+
+#else
+
+#error "Please update your headers or configure using --enable-ucd-snmp-compatibility"
+
+#endif
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..3f83ce9
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,524 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2010-02-06.18; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/local/FAQ2HTML b/local/FAQ2HTML
new file mode 100755
index 0000000..d8b1721
--- /dev/null
+++ b/local/FAQ2HTML
@@ -0,0 +1,113 @@
+#!/usr/bin/perl -w
+
+$TOCHEADER=" TABLE OF CONTENTS";
+
+open(O, ">FAQ.html");
+
+
+# Load FAQ into memory
+while(<>) {
+ push (@faqfile, $_);
+}
+my $current_line = 0;
+my $version;
+
+# Skip header up to table of contents
+while($current_line <= $#faqfile) {
+ $_ = $faqfile[$current_line];
+ $current_line++;
+
+ if (/Net-SNMP Version: (.*)/) {
+ $version = $1;
+ }
+
+ last if (/$TOCHEADER/);
+}
+
+print O '<p class="SectionTitle">
+FAQ
+</p>
+FAQ Maintainer: Dave Shield<br/>
+Email: <a href="mailto:net-snmp-coders@lists.sourceforge.net">net-snmp-coders@list.sourceforge.net</a><br/>
+';
+print O "Version: $version<br/>\n";
+print O '<hr/>
+<h2>Table of Contents</h2>
+';
+
+# Create table of contents
+while($current_line <= $#faqfile) {
+ $_ = $faqfile[$current_line];
+
+ #Skip blank lines
+ if (/^\s*$/) {
+ $current_line++;
+ last;
+ }
+
+ chomp();
+
+ # Remove white space at start of line
+ $_ =~ s/^ *//;
+
+ $x = $_;
+
+ # Remove white space at start of line
+ $x =~ s/^ *//g;
+
+ # Replace all non alpha characters with _
+ $x =~ s/[^a-zA-Z]/_/g;
+
+ # Save cleaned up line
+ $xlate{$_} = $x;
+
+ if ( /&/ ) { $_ =~ s/&/&amp;/g; }
+ if ( /</ ) { $_ =~ s/</&lt;/g; }
+ if ( />/ ) { $_ =~ s/>/&gt;/g; }
+ if (/^[ A-Z]+$/) {
+ # Section header (eg: GENERAL)
+ print O "</ul><b>$_</b><ul>\n";
+ } else {
+ # Question / answer - create link to it
+ if ($faqfile[$current_line+1] =~ /^ */) {
+
+ # Continuation of the question.
+ $current_line++;
+ my $part2 = $faqfile[$current_line];
+
+ # Remove white space at start of line
+ $part2 =~ s/^ *//;
+
+ print O "<li> <a href=\"#$x\">$_ $part2</a></li>\n";
+ }
+ else {
+ print O "<li> <a href=\"#$x\">$_</a></li>\n";
+ }
+ }
+ $current_line++;
+}
+
+print O "</ul><hr/><pre>\n";
+
+# Print contents with targets defined
+while($current_line <= $#faqfile) {
+ $_ = $faqfile[$current_line];
+ $current_line++;
+
+ chomp();
+
+ $y = $_;
+
+ if (defined($xlate{$y})) {
+ print O "<a name=\"$xlate{$y}\"></a>\n";
+ }
+ if ( /&/ ) { $_ =~ s/&/&amp;/g; }
+ if ( /</ ) { $_ =~ s/</&lt;/g; }
+ if ( />/ ) { $_ =~ s/>/&gt;/g; }
+ print O "$_\n";
+}
+
+print O '
+</pre>
+';
+
diff --git a/local/Makefile.in b/local/Makefile.in
new file mode 100644
index 0000000..df81db0
--- /dev/null
+++ b/local/Makefile.in
@@ -0,0 +1,173 @@
+#
+# local (scripts) directory Makefile
+#
+top_builddir=..
+
+VPATH = @srcdir@
+
+#
+# stuff to install
+#
+OTHERINSTALL=localinstall
+OTHERUNINSTALL=localuninstall
+
+#
+# local info
+#
+SNMPCONFPATH=@SNMPCONFPATH@
+PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
+PERLSCRIPTS=snmpcheck tkmib mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert
+SHELLSCRIPTS=mib2c-update
+SCRIPTSMADEFORPERL=snmpcheck.made tkmib.made mib2c.made fixproc.made \
+ ipf-mod.pl.made snmpconf.made traptoemail.made snmp-bridge-mib.made \
+ net-snmp-cert.made
+DATASRCS=mib2c.conf mib2c.iterate.conf mib2c.iterate_access.conf \
+ mib2c.create-dataset.conf mib2c.mfd.conf \
+ mib2c.array-user.conf mib2c.column_enums.conf \
+ mib2c.column_defines.conf mib2c.column_storage.conf \
+ mib2c.old-api.conf mib2c.scalar.conf \
+ mib2c.check_values.conf mib2c.check_values_local.conf \
+ mib2c.access_functions.conf mib2c.notify.conf \
+ mib2c.int_watch.conf mib2c.genhtml.conf \
+ mib2c.raw-table.conf mib2c.table_data.conf \
+ mib2c.container.conf mib2c.perl.conf
+MIB2CINSTALLDIR=$(snmplibdir)/mib2c-data
+MIB2CDATASRC=mib2c-conf.d
+MIB2CFILES=default-mfd-top.m2c details-enums.m2i details-node.m2i \
+ details-table.m2i generic-ctx-copy.m2i generic-ctx-get.m2i \
+ generic-ctx-set.m2i generic-data-allocate.m2i generic-data-context.m2i \
+ generic-get-char.m2i generic-get-decl-bot.m2i generic-get-decl.m2i \
+ generic-get-long.m2i generic-get-oid.m2i generic-get-U64.m2i \
+ generic-header-bottom.m2i \
+ generic-header-top.m2i generic-source-includes.m2i \
+ generic-table-constants.m2c generic-table-enums.m2c \
+ generic-table-indexes-from-oid.m2i generic-table-indexes-set.m2i \
+ generic-table-indexes-to-oid.m2i \
+ generic-table-indexes-varbind-setup.m2i generic-table-indexes.m2i \
+ generic-table-oids.m2c generic-value-map-func.m2i \
+ generic-value-map-reverse.m2i generic-value-map.m2i \
+ m2c-internal-warning.m2i \
+ m2c_setup_enum.m2i m2c_setup_node.m2i m2c_setup_table.m2i \
+ m2c_table_save_defaults.m2i \
+ mfd-access-container-cached-defines.m2i \
+ mfd-access-unsorted-external-defines.m2i \
+ mfd-data-access.m2c mfd-data-get.m2c mfd-data-set.m2c \
+ mfd-doxygen.m2c mfd-interactive-setup.m2c mfd-interface.m2c \
+ mfd-makefile.m2m mfd-readme.m2c mfd-top.m2c \
+ mfd-persistence.m2i \
+ node-get.m2i node-set.m2i node-storage.m2i \
+ node-validate.m2i node-varbind-validate.m2i \
+ parent-dependencies.m2i parent-set.m2i \
+ subagent.m2c \
+ syntax-COUNTER64-get.m2i syntax-DateAndTime-get.m2d \
+ syntax-DateAndTime-get.m2i syntax-DateAndTime-readme.m2i \
+ syntax-InetAddress-get.m2i syntax-InetAddress-set.m2i \
+ syntax-InetAddressType-get.m2i syntax-InetAddressType-set.m2i \
+ syntax-RowStatus-dependencies.m2i syntax-RowStatus-get.m2i \
+ syntax-RowStatus-varbind-validate.m2i \
+ syntax-StorageType-dependencies.m2i \
+ syntax-TestAndIncr-get.m2i
+
+CONFINSTALLDIR=$(snmplibdir)/snmpconf-data
+CONFDATASRC=snmpconf.dir
+CONFDIRS=snmp-data snmpd-data snmptrapd-data
+CONFFILES=snmpd-data/system snmpd-data/acl snmpd-data/trapsinks \
+ snmpd-data/monitor snmpd-data/extending snmpd-data/operation \
+ snmpd-data/basic_setup snmpd-data/snmpconf-config \
+ snmp-data/authopts snmp-data/debugging snmp-data/output snmp-data/mibs \
+ snmp-data/snmpconf-config \
+ snmptrapd-data/formatting snmptrapd-data/traphandle \
+ snmptrapd-data/authentication snmptrapd-data/logging snmptrapd-data/runtime \
+ snmptrapd-data/snmpconf-config
+
+OTHERCLEANTARGETS=snmpcheck $(SCRIPTSMADEFORPERL)
+
+all: $(SCRIPTSMADEFORPERL) standardall
+
+snmpcheck: $(srcdir)/snmpcheck.def ../sedscript
+ $(SED) -f ../sedscript $(srcdir)/snmpcheck.def > snmpcheck
+
+snmpcheck.made: snmpcheck
+ if test "x$(PERL)" != "x" ; then \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%' snmpcheck > snmpcheck.made ; \
+ else \
+ touch snmpcheck.made ; \
+ fi
+
+tkmib.made: $(srcdir)/tkmib
+ if test "x$(PERL)" != "x" ; then \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%' ${srcdir}/tkmib > tkmib.made; \
+ else \
+ touch tkmib.made; \
+ fi
+
+mib2c.made: $(srcdir)/mib2c
+ if test "x$(PERL)" != "x" ; then \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;' ${srcdir}/mib2c > mib2c.made; \
+ else \
+ touch mib2c.made; \
+ fi
+
+net-snmp-cert.made: $(srcdir)/net-snmp-cert
+ if test "x$(PERL)" != "x" ; then \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;' ${srcdir}/net-snmp-cert > net-snmp-cert.made; \
+ else \
+ touch net-snmp-cert.made; \
+ fi
+
+
+ipf-mod.pl.made: $(srcdir)/ipf-mod.pl
+ if test "x$(PERL)" != "x" ; then \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%' ${srcdir}/ipf-mod.pl > ipf-mod.pl.made; \
+ else \
+ touch ipf-mod.pl.made; \
+ fi
+
+fixproc.made: $(srcdir)/fixproc
+ if test "x$(PERL)" != "x" ; then \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%' ${srcdir}/fixproc > fixproc.made; \
+ else \
+ touch fixproc.made; \
+ fi
+
+snmpconf.made: $(srcdir)/snmpconf
+ if test "x$(PERL)" != "x" ; then \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%; s#/usr/local/share#$(datadir)#g; s#/usr/local/etc/snmp#$(SNMPCONFPATH)#g; s#/var/net-snmp#$(PERSISTENT_DIRECTORY)#g' ${srcdir}/snmpconf > snmpconf.made; \
+ else \
+ touch snmpconf.made; \
+ fi
+
+traptoemail.made: $(srcdir)/traptoemail
+ if test "x$(PERL)" != "x" ; then \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%; s#/usr/local/share#$(datadir)#g; s#/usr/local/etc/snmp#$(TRAPTOEMAILPATH)#g' ${srcdir}/traptoemail > traptoemail.made; \
+ else \
+ touch traptoemail.made; \
+ fi
+
+snmp-bridge-mib.made: $(srcdir)/snmp-bridge-mib
+ if test "x$(PERL)" != "x" ; then \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%' ${srcdir}/snmp-bridge-mib > snmp-bridge-mib.made; \
+ else \
+ touch snmp-bridge-mib.made; \
+ fi
+
+localinstall: $(SCRIPTSMADEFORPERL)
+ @if test "x$(PERL)" != "x" ; then \
+ for i in $(PERLSCRIPTS) ; do $(INSTALL) $$i.made $(INSTALL_PREFIX)$(bindir)/$$i ; echo "install: installed $$i in $(INSTALL_PREFIX)$(bindir)" ; done ; \
+ for i in $(SHELLSCRIPTS) ; do $(INSTALL) $(srcdir)/$$i $(INSTALL_PREFIX)$(bindir)/$$i ; echo "install: installed $$i in $(INSTALL_PREFIX)$(bindir)" ; done ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(snmplibdir) ; \
+ for i in $(DATASRCS) ; do $(INSTALL_DATA) $(srcdir)/$$i $(INSTALL_PREFIX)$(snmplibdir)/$$i ; echo "install: installed $$i in $(INSTALL_PREFIX)$(snmplibdir)" ; done ; \
+ for i in $(CONFDIRS); do $(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(CONFINSTALLDIR)/$$i ; done ; \
+ for i in $(CONFFILES); do $(INSTALL_DATA) $(srcdir)/$(CONFDATASRC)/$$i $(INSTALL_PREFIX)$(CONFINSTALLDIR)/$$i; echo "install: installed $$i in $(INSTALL_PREFIX)$(CONFINSTALLDIR)"; done ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(MIB2CINSTALLDIR) ; \
+ for i in $(MIB2CFILES); do $(INSTALL_DATA) $(srcdir)/$(MIB2CDATASRC)/$$i $(INSTALL_PREFIX)$(MIB2CINSTALLDIR)/$$i; echo "install: installed $$i in $(INSTALL_PREFIX)$(MIB2CINSTALLDIR)"; done \
+ fi
+
+localuninstall:
+ @if test "x$(PERL)" != "x" ; then \
+ for i in $(PERLSCRIPTS) ; do rm -f $(INSTALL_PREFIX)$(bindir)/$$i ; echo "removed $$i from $(INSTALL_PREFIX)$(bindir)" ; done ; \
+ for i in $(SHELLSCRIPTS) ; do rm -f $(INSTALL_PREFIX)$(bindir)/$$i ; echo "removed $$i from $(INSTALL_PREFIX)$(bindir)" ; done ; \
+ for i in $(DATASRCS) ; do rm -f $(INSTALL_PREFIX)$(snmplibdir)/$$i ; echo "removed $$i from $(INSTALL_PREFIX)$(snmplibdir)" ; done ; \
+ for i in $(CONFFILES); do rm -f $(INSTALL_PREFIX)$(CONFINSTALLDIR)/$$i; echo "removed $$i from $(INSTALL_PREFIX)$(CONFINSTALLDIR)"; done ; \
+ for i in $(MIB2CFILES); do rm -f $(INSTALL_PREFIX)$(MIB2CINSTALLDIR)/$$i; echo "removed $$i from $(INSTALL_PREFIX)$(MIB2CINSTALLDIR)"; done \
+ fi
diff --git a/local/README.mib2c b/local/README.mib2c
new file mode 100644
index 0000000..6b28770
--- /dev/null
+++ b/local/README.mib2c
@@ -0,0 +1,224 @@
+This README describes the ./local/mib2c script.
+
+Author: Derek Simkowiak
+ dereks@kd-dev.com
+ http://www.kd-dev.com
+ (please mail questions to net-snmp-coders@lists.sourceforge.net,
+ not to the author directly. Thanks!)
+
+Date: Wed Jan 20 02:51:06 PST 1999
+-----------------------------------------------------------------------
+mib2c
+
+OVERVIEW
+
+ mib2c is a Perl script that takes a MIB (such as those files found
+in ./mibs/ ) and converts it into C code. That C code can then be used as a
+"template" to implement your MIB. Then, when you are done editing the C
+code and recompiling, the UCD-SNMP agent (snmpd) will support your MIB.
+mib2c takes the place of "MIB Compilers" that come with commercial SNMP
+agents.
+
+
+REQUIREMENTS/INSTALLATION
+
+ mib2c requires the SNMP.pm Perl module. As of this writing the
+latest version of the SNMP.pm module is 1.8.
+
+ The SNMP.pm module can be downloaded from CPAN at
+
+http://www.cpan.org/modules/by-module/SNMP/
+
+ ...the file that you want is probably SNMP-1.8b5.tar.gz .
+If you didn't know that already, most every Perl module can be downloaded
+from CPAN (www.cpan.org). Follow the installation instructions for the
+module.
+
+ NOTE: If you are running Redhat Linux 5.2 (and perhaps other
+versions), you might get the following errors during the "make test" phase
+of the installation of the SNMP.pm module:
+
+[root@olly SNMP-1.8b5]# make test # This is the command...
+PERL_DL_NONLAZY=1 /usr/bin/perl -I./blib/arch -I./blib/lib
+-I/usr/lib/perl5/i386-linux/5.00404 -I/usr/lib/perl5 -e 'use Test::Harness
+qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
+t/mib...............ok
+t/session...........FAILED tests 7-8
+ Failed 2/14 tests, 85.71% okay
+t/translate.........ok
+Failed Test Status Wstat Total Fail Failed List of failed
+-------------------------------------------------------------------------------
+t/session.t 14 2 14.29% 7-8
+Failed 1/3 test scripts, 66.67% okay. 2/24 subtests failed, 91.67% okay.
+make: *** [test_dynamic] Error 9
+
+
+ If the "make" went okay, then you can ignore these test failures.
+These indicate you don't have write access to the portions of the mib
+tree that the test script is trying to use. Please don't email the
+UCD-SNMP list with other errors regarding the SNMP.pm module.
+comp.lang.perl.modules is probably the most appropriate spot to
+discuss problems with the SNMP.pm perl module itself. Interelated
+problems between net-snmp and SNMP could be discussed on the net-snmp
+mailing lists though.
+
+
+USAGE
+
+ mib2c takes one argument: an OID. It then traces down that OID
+and generates the template C code. Here is the documentation, from the
+top of the script:
+
+# This program, given an OID reference as an argument, creates some
+# template mib module files to be used with the net-snmp agent. It is
+# far from perfect and will not generate working modules, but it
+# significantly shortens development time by outlining the basic
+# structure.
+#
+# Its up to you to verify what it does and change the default values
+# it returns.
+#
+# You *must* correct the beginning of the var_XXX() function to
+# correctly determine mib ownership of the incoming request.
+
+
+FINDING YOUR MIB
+
+ Before you can specify the OID for your enterprise/MIB on the
+command line, the script needs to be able to find your MIB so that it can
+read it in and generate template code. Joe Marzot (gmarzot@nortelnetworks.com)
+tells us:
+--------------------------------------
+you should read (man mib_api). The default behaviour for mib loading
+from within the perl interface uses the environment variables described
+there. You can also override these and explicitly define mibdirs and
+load modules through the perl/SNMP api.
+
+the easiest thing to do is toss the mibs in /usr/local/share/snmp/mibs
+and set the env. var., MIBS, to 'ALL'.
+--------------------------------------
+
+ I recommend following the last two lines of advice. I simply did
+
+# cp /home/dereks/MY-MIB-FILE.txt /usr/local/share/snmp/mibs/
+# export MIBS=ALL
+
+ ...on my Redhat system (with a BASH shell) and it was able to find
+my MIB just fine.
+
+
+EXAMPLES
+
+ Here are some examples from Wes Hardaker (wjhardaker@ucdavis.edu).
+He's using a C shell. Wes writes:
+--------------------------------------
+Ok, in order to run the thing, you actually need to do something like
+this:
+
+setenv MIBS MY-ITEM-MIB # assumes csh
+mib2c itemNode
+
+Where, "itemNode" should be a node in the mib tree that you want to
+generate C code for. Note, pick small pieces not large ones. Yes, it
+will generate code for the entire mibII tree if you ask it to, in one
+very large mib file.
+
+Examples:
+
+% mib2c interfaces
+outputing to interfaces.c and interfaces.h ...
+ depth: 3
+ Number of Lines Created:
+178 interfaces.c
+84 interfaces.h
+262 total
+Done.
+
+% mib2c mib-2 # Don't ever do this.
+outputing to mib-2.c and mib-2.h ...
+ depth: 5
+ Number of Lines Created:
+2783 mib-2.c
+617 mib-2.h
+3400 total
+Done.
+
+It may have some sorting problems with multiple level mib tree
+branches being generated into one piece of code (reorder the .h file
+structure to be in OID lexical order if needed).
+--------------------------------------
+
+WHAT TO DO WITH THE CODE THAT GETS GENERATED
+
+ You will need to edit your generated code to work with your
+hardware. For instance, if your MIB is for a refrigerator, you will need
+to write the code that talks to the refridgerator (through the serial
+port, maybe?) in Fridge Protocol.
+
+ See the files in ./agent/mibgroup/examples/ and
+./agent/mibgroup/dummy/ for heavily-commented example code. Don't ask me
+questions about this stuff--I'm just now figuring it out myself...
+
+ [NOTE: If anyone out there has tips about necessary options to
+./configure, or re-compiling snmpd with custom MIB support, please add
+them here...]
+
+WARNING
+
+ As of this writing, the mib2c compiler is a bit outdated and needs
+some work. Wes writes:
+--------------------------------------
+It already needs changing, because the architecture has changed in the
+3.6 line (though its backwards compatible, I'd prefer to generate
+code from newer models than older ones).
+--------------------------------------
+ When I asked him to elaborate on the new 3.6 archictecture, all I
+got was:
+--------------------------------------
+It hopefully will be in the new documentation about mib module api
+that Dave Shield is putting together (which is also currently wrong,
+for that matter)...
+--------------------------------------
+ ...so I don't know what the hell he's talking about.
+
+
+SOME ERRORS AND THEIR MEANING
+
+ If you get a large number of errors that look like:
+
+[...]
+unknown type: INTEGER for prIndex
+unknown type: OCTETSTR for prNames
+unknown type: INTEGER for prMin
+[...]
+
+ ...then you are trying to use an old version of the mib2c script
+that does not support the SNMP.pm module version 1.8. Get the latest
+version of the script.
+
+ If you get the error
+
+Couldn't find mib reference: myEnterpriseOID
+
+ ...when you know that it should be finding your MIB file(s), then
+you forgot to put the word "END" at the very end of your MIB. (Uh...I'm
+not speaking from experience here. Really.)
+
+ACKNOWLEGMENTS
+
+ Many thanks to the people on the UCD-SNMP mailing list
+(net-snmp-users@lists.sourceforge.net). In particular, many thanks to
+
+Wes Hardaker <wjhardaker@ucdavis.edu>
+Ken McNamara <conmara@tcon.net>
+Joe Marzot <gmarzot@nortelnetworks.com>
+
+ ...since about half this document is just cut'n'pasted from emails
+they sent me.
+
+ Good luck with your project.
+
+Derek Simkowiak
+dereks@kd-dev.com
+http://www.kd-dev.com
+
diff --git a/local/Version-Munge.pl b/local/Version-Munge.pl
new file mode 100755
index 0000000..7f6f29c
--- /dev/null
+++ b/local/Version-Munge.pl
@@ -0,0 +1,170 @@
+#!/usr/bin/perl
+
+use Getopt::Std;
+
+sub usage {
+ print "
+$0 [-v VERSION] -R -C -M -D -h
+
+ -M Modify the files with a new version (-v required)
+ -v VERSION Use VERSION as the version string
+ -T TAG Use TAG as SVN tag (must being with Ext-)
+ -C Commit changes to the files
+ -R Revert changes to the files
+ -D Compare files (svn diff)
+ -f FILE Just do a particular file
+ -t TYPE Just do a particular type of file
+ -P Print resulting modified lines
+ -V verbose
+";
+ exit 1;
+}
+
+getopts("Pv:T:RCMDhnf:t:V",\%opts) || usage();
+if ($opts{'h'}) { usage(); }
+
+if (!$opts{'v'} && $opts{'M'} && !$opts{'T'}) {
+ warn "no version (-v or -T) specified";
+ usage;
+}
+if (!$opts{'R'} && !$opts{'M'} && !$opts{'C'} && !$opts{'D'}) {
+ warn "nothing to do (need -R -C -D or -M)\n";
+ usage;
+}
+
+my @exprs = (
+ # documentation files
+ { type => 'docs',
+ expr => 'Version: [\.0-9a-zA-Z]+',
+ repl => 'Version: $VERSION',
+ files => [qw(README FAQ dist/net-snmp.spec)],
+ not_required => {'dist/net-snmp.spec' => 1}
+ },
+
+ # Makefiles
+ { type => 'Makefile',
+ expr => 'VERSION = [\.0-9a-zA-Z]+',
+ repl => 'VERSION = $VERSION',
+ files => [qw(dist/Makefile)],
+ not_required => {'dist/Makefile' => 1}
+ },
+
+ # perl files
+ { type => 'perl',
+ expr => 'VERSION = \'(.*)\'',
+ repl => 'VERSION = \'$VERSION_FLOAT\'',
+ files => [qw(perl/SNMP/SNMP.pm
+ perl/agent/agent.pm
+ perl/agent/Support/Support.pm
+ perl/agent/default_store/default_store.pm
+ perl/default_store/default_store.pm
+ perl/OID/OID.pm
+ perl/ASN/ASN.pm
+ perl/AnyData_SNMP/Storage.pm
+ perl/AnyData_SNMP/Format.pm
+ perl/TrapReceiver/TrapReceiver.pm
+ )],
+ not_required => {'perl/agent/Support/Support.pm' => 1}
+ },
+
+ # configure script files
+ { type => 'configure',
+ expr => 'AC_INIT\\(\\[Net-SNMP\\], \\[([^\\]]+)\\]',
+ repl => 'AC_INIT([Net-SNMP], [$VERSION]',
+ files => [qw(configure.ac)],
+ exec => 'autoconf',
+ exfiles => [qw(configure)],
+ },
+
+ );
+
+#
+# set up versioning information
+#
+if ($opts{'T'} && !$opts{'v'}) {
+ $opts{'v'} = $opts{'T'};
+ die "usage error: version tag must begin with Ext-" if ($opts{'T'} !~ /^Ext-/);
+ $opts{'v'} =~ s/^Ext-//;
+ $opts{'v'} =~ s/-/./g;
+}
+$VERSION = $opts{'v'};
+$VERSION_FLOAT = floatize_version($VERSION);
+
+
+#
+# loop through all the expression types
+#
+my @files;
+for ($i = 0; $i <= $#exprs; $i++) {
+
+ # drop other file types if only one was requested.
+ next if ($opts{'t'} && $exprs[$i]{'type'} ne $opts{'t'});
+
+ # loop through each file and process
+ foreach my $f (@{$exprs[$i]->{'files'}}) {
+
+ # skip files that weren't specifically in the todo list if need be
+ next if ($opts{'f'} && $f ne $opts{'f'});
+
+ # remove the changes and revert to SVN
+ if ($opts{'R'}) {
+ print "removing changes and updating $f\n" if ($opts{'V'});
+ system("svn revert $f");
+ }
+
+ # make sure it exists
+ if (! -f $f) {
+ if (!exists($exprs[$i]->{'not_required'}{$f})) {
+ print STDERR "FAILED to find file $f\n";
+ exit(1);
+ } else {
+ print STDERR "SKIPPING file $f\n";
+ next;
+ }
+ }
+
+ # modify the files with the version
+ if ($opts{'M'}) {
+ rename ($f,"$f.bak");
+ open(I,"$f.bak");
+ open(O,">$f");
+ while (<I>) {
+ my $res = eval "s/$exprs[$i]->{'expr'}/$exprs[$i]->{'repl'}/";
+ if ($res && $opts{'P'}) {
+ my $shortened = $_;
+ $shortened =~ s/^\s*//;
+ printf("%s:\n %s", $f, $shortened);
+ }
+ print O;
+ }
+ close(I);
+ close(O);
+ unlink("$f.bak");
+ push @files, $f;
+ print "modified $f using s/$exprs[$i]->{'expr'}/$exprs[$i]->{'repl'}/\n" if ($opts{'V'});
+ }
+
+ # run diff if requested.
+ if ($opts{'D'}) {
+ print "diffing $f\n" if ($opts{'V'});
+ system("svn diff $f");
+ }
+ }
+ system($exprs[$i]->{'exec'}) if ($exprs[$i]->{'exec'});
+ push @files, @{$exprs[$i]->{'exfiles'}} if ($exprs[$i]->{'exfiles'});
+}
+
+#
+# commit the modified files
+#
+if ($opts{'C'}) {
+ my $files = join(" ",@files);
+ print "committing $files\n" if ($opts{'V'});
+ $ret = system("svn commit -m \"- version tag ( $VERSION )\" $files");
+ exit($ret);
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/local/certgen-test.pl b/local/certgen-test.pl
new file mode 100644
index 0000000..b335428
--- /dev/null
+++ b/local/certgen-test.pl
@@ -0,0 +1,66 @@
+#!/usr/bin/perl
+
+system("rm -rf /tmp/.snmp1");
+system("rm -rf /tmp/.snmp2");
+
+system("cp net-snmp-cert ~/bin");
+
+$str = "\ngenca (in -C /tmp/.snmp1) : ca-snmp\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert genca -I -C /tmp/.snmp1 --cn ca-snmp --email ca\@ca.com --host host.a.b.com --san DNS:ca.a.b.com --san EMAIL:ca\@ca.com");
+
+print "\nusing -C /tmp/.snmp2 for all following tests\n";
+$str = "\ngenca: ca-snmp\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert genca -I -C /tmp/.snmp2 --cn ca-snmp --email ca\@ca.com --host host.a.b.com --san DNS:ca.a.b.com --san EMAIL:ca\@ca.com");
+
+$str = "\ngenca: ca-snmp-2 (signed w/ ca-snmp)\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert genca -I -C /tmp/.snmp2 --with-ca ca-snmp --cn ca-snmp-2 --email ca2\@ca.com --host host2.a.b.com --san DNS:ca2.a.b.com --san EMAIL:ca2\@ca.com");
+
+$str = "\ngencsr: snmpapp\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert gencsr -I -C /tmp/.snmp2 -t snmpapp --cn 'admin' --email admin@net-snmp.org --host admin-host.net-snmp.org --san EMAIL:a\@b.com --san IP:1.2.3.4 --san DNS:admin.a.b.org");
+
+$str = "\nsigncsr: snmpapp w/ca-snmp\n\n";
+print("$str");
+die("died: $str\n") if system("net-snmp-cert signcsr -I -C /tmp/.snmp2 --with-ca ca-snmp --csr snmpapp --install");
+
+$str = "\nsigncsr: snmpapp w/ca-snmp-2\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert signcsr -I -C /tmp/.snmp2 --with-ca ca-snmp-2 --csr snmpapp --san EMAIL:noinstall\@b.com --san IP:5.6.7.8");
+
+$str = "\ngencert: snmptrapd (self-signed)\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert gencert -I -C /tmp/.snmp2 -t snmptrapd --cn 'NOC' --email 'noc\@net-snmp.org' --host noc-host.net-snmp.org --san DNS:noc.a.b.org --san 'EMAIL:noc\@net-snmp.org'");
+
+$str = "\ngencert: snmpd (signed w/ ca-snmp-2)\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert gencert -I -C /tmp/.snmp2 -t snmpd --with-ca ca-snmp-2 --email snmpd\@net-snmp.org --host snmpd-host.net-snmp.org --san DNS:snmpd.a.b.org --san EMAIL:snmpd\@net-snmp.org");
+
+system("cp net-snmp-cert.conf /tmp/.snmp2");
+
+$str = "\ngenca (in -C /tmp/.snmp2 -i CA-identity)\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert genca -I -C /tmp/.snmp2 -i CA-identity");
+
+$str = "\ngencert (in -C /tmp/.snmp2 -i nocadm -t snmp-identity)\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert gencert -I -C /tmp/.snmp2 -t snmp-identity -i nocadm --with-ca CA-identity");
+
+
+$str = "\nshow CAs\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert -C /tmp/.snmp2 showca --issuer --subject");
+
+$str = "show Certs\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert -C /tmp/.snmp2 showcert --issuer --subject");
+
+$str = "show CAs fingerprint\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert -C /tmp/.snmp2 showca --fingerprint --brief");
+
+$str = "\nshow Certs fingerprint\n\n";
+print("$str");
+die("$str\n") if system("net-snmp-cert -C /tmp/.snmp2 showcert --fingerprint --brief");
diff --git a/local/convertcode b/local/convertcode
new file mode 100755
index 0000000..314ea06
--- /dev/null
+++ b/local/convertcode
@@ -0,0 +1,132 @@
+#!/usr/bin/perl -p -i.snmpbak
+
+# this script should convert header files included based on the
+# ucd-snmp header file names and convert them to their new net-snmp
+# names, assuming the code was originally intended to be compiled
+# within the ucd-snmp source tree.
+
+s/include "config.h"/include <net-snmp\/net-snmp-config.h>/;
+s/include "asn1.h"/include <net-snmp\/asn1.h>/;
+s/include "callback.h"/include <net-snmp\/callback.h>/;
+s/include "data_list.h"/include <net-snmp\/data_list.h>/;
+s/include "default_store.h"/include <net-snmp\/default_store.h>/;
+s/include "getopt.h"/include <net-snmp\/getopt.h>/;
+s/include "int64.h"/include <net-snmp\/int64.h>/;
+s/include "keytools.h"/include <net-snmp\/keytools.h>/;
+s/include "lcd_time.h"/include <net-snmp\/lcd_time.h>/;
+s/include "libsnmp.h"/include <net-snmp\/libsnmp.h>/;
+s/include "md5.h"/include <net-snmp\/md5.h>/;
+s/include "mib.h"/include <net-snmp\/mib.h>/;
+s/include "mt_support.h"/include <net-snmp\/mt_support.h>/;
+s/include "net-snmp-config.h"/include <net-snmp\/net-snmp-config.h>/;
+s/include "net-snmp-includes.h"/include <net-snmp\/net-snmp-includes.h>/;
+s/include "oid_array.h"/include <net-snmp\/oid_array.h>/;
+s/include "oid_stash.h"/include <net-snmp\/oid_stash.h>/;
+s/include "parse.h"/include <net-snmp\/parse.h>/;
+s/include "read_config.h"/include <net-snmp\/read_config.h>/;
+s/include "scapi.h"/include <net-snmp\/scapi.h>/;
+s/include "snmpAAL5PVCDomain.h"/include <net-snmp\/snmpAAL5PVCDomain.h>/;
+s/include "snmp_alarm.h"/include <net-snmp\/snmp_alarm.h>/;
+s/include "snmp_api.h"/include <net-snmp\/snmp_api.h>/;
+s/include "snmpCallbackDomain.h"/include <net-snmp\/snmpCallbackDomain.h>/;
+s/include "snmp_client.h"/include <net-snmp\/snmp_client.h>/;
+s/include "snmp_debug.h"/include <net-snmp\/snmp_debug.h>/;
+s/include "snmp_enum.h"/include <net-snmp\/snmp_enum.h>/;
+s/include "snmp.h"/include <net-snmp\/snmp.h>/;
+s/include "snmp_impl.h"/include <net-snmp\/snmp_impl.h>/;
+s/include "snmpIPXDomain.h"/include <net-snmp\/snmpIPXDomain.h>/;
+s/include "snmpksm.h"/include <net-snmp\/snmpksm.h>/;
+s/include "snmp_locking.h"/include <net-snmp\/snmp_locking.h>/;
+s/include "snmp_logging.h"/include <net-snmp\/snmp_logging.h>/;
+s/include "snmp_parse_args.h"/include <net-snmp\/snmp_parse_args.h>/;
+s/include "snmp_secmod.h"/include <net-snmp\/snmp_secmod.h>/;
+s/include "snmp-tc.h"/include <net-snmp\/snmp-tc.h>/;
+s/include "snmpTCPDomain.h"/include <net-snmp\/snmpTCPDomain.h>/;
+s/include "snmpTCPIPv6Domain.h"/include <net-snmp\/snmpTCPIPv6Domain.h>/;
+s/include "snmp_transport.h"/include <net-snmp\/snmp_transport.h>/;
+s/include "snmpUDPDomain.h"/include <net-snmp\/snmpUDPDomain.h>/;
+s/include "snmpUDPIPv6Domain.h"/include <net-snmp\/snmpUDPIPv6Domain.h>/;
+s/include "snmpUnixDomain.h"/include <net-snmp\/snmpUnixDomain.h>/;
+s/include "snmpusm.h"/include <net-snmp\/snmpusm.h>/;
+s/include "snmpusm_init.h"/include <net-snmp\/snmpusm_init.h>/;
+s/include "snmpv3.h"/include <net-snmp\/snmpv3.h>/;
+s/include "system.h"/include <net-snmp\/system.h>/;
+s/include "tools.h"/include <net-snmp\/tools.h>/;
+s/include "transform_oids.h"/include <net-snmp\/transform_oids.h>/;
+s/include "vacm.h"/include <net-snmp\/vacm.h>/;
+s/include <asn1.h>/include <net-snmp\/asn1.h>/;
+s/include <callback.h>/include <net-snmp\/callback.h>/;
+s/include <data_list.h>/include <net-snmp\/data_list.h>/;
+s/include <default_store.h>/include <net-snmp\/default_store.h>/;
+s/include <getopt.h>/include <net-snmp\/getopt.h>/;
+s/include <int64.h>/include <net-snmp\/int64.h>/;
+s/include <keytools.h>/include <net-snmp\/keytools.h>/;
+s/include <lcd_time.h>/include <net-snmp\/lcd_time.h>/;
+s/include <libsnmp.h>/include <net-snmp\/libsnmp.h>/;
+s/include <md5.h>/include <net-snmp\/md5.h>/;
+s/include <mib.h>/include <net-snmp\/mib.h>/;
+s/include <mt_support.h>/include <net-snmp\/mt_support.h>/;
+s/include <net-snmp-config.h>/include <net-snmp\/net-snmp-config.h>/;
+s/include <net-snmp-includes.h>/include <net-snmp\/net-snmp-includes.h>/;
+s/include <oid_array.h>/include <net-snmp\/oid_array.h>/;
+s/include <oid_stash.h>/include <net-snmp\/oid_stash.h>/;
+s/include <parse.h>/include <net-snmp\/parse.h>/;
+s/include <read_config.h>/include <net-snmp\/read_config.h>/;
+s/include <scapi.h>/include <net-snmp\/scapi.h>/;
+s/include <snmpAAL5PVCDomain.h>/include <net-snmp\/snmpAAL5PVCDomain.h>/;
+s/include <snmp_alarm.h>/include <net-snmp\/snmp_alarm.h>/;
+s/include <snmp_api.h>/include <net-snmp\/snmp_api.h>/;
+s/include <snmpCallbackDomain.h>/include <net-snmp\/snmpCallbackDomain.h>/;
+s/include <snmp_client.h>/include <net-snmp\/snmp_client.h>/;
+s/include <snmp_debug.h>/include <net-snmp\/snmp_debug.h>/;
+s/include <snmp_enum.h>/include <net-snmp\/snmp_enum.h>/;
+s/include <snmp.h>/include <net-snmp\/snmp.h>/;
+s/include <snmp_impl.h>/include <net-snmp\/snmp_impl.h>/;
+s/include <snmpIPXDomain.h>/include <net-snmp\/snmpIPXDomain.h>/;
+s/include <snmpksm.h>/include <net-snmp\/snmpksm.h>/;
+s/include <snmp_locking.h>/include <net-snmp\/snmp_locking.h>/;
+s/include <snmp_logging.h>/include <net-snmp\/snmp_logging.h>/;
+s/include <snmp_parse_args.h>/include <net-snmp\/snmp_parse_args.h>/;
+s/include <snmp_secmod.h>/include <net-snmp\/snmp_secmod.h>/;
+s/include <snmp-tc.h>/include <net-snmp\/snmp-tc.h>/;
+s/include <snmpTCPDomain.h>/include <net-snmp\/snmpTCPDomain.h>/;
+s/include <snmpTCPIPv6Domain.h>/include <net-snmp\/snmpTCPIPv6Domain.h>/;
+s/include <snmp_transport.h>/include <net-snmp\/snmp_transport.h>/;
+s/include <snmpUDPDomain.h>/include <net-snmp\/snmpUDPDomain.h>/;
+s/include <snmpUDPIPv6Domain.h>/include <net-snmp\/snmpUDPIPv6Domain.h>/;
+s/include <snmpUnixDomain.h>/include <net-snmp\/snmpUnixDomain.h>/;
+s/include <snmpusm.h>/include <net-snmp\/snmpusm.h>/;
+s/include <snmpusm_init.h>/include <net-snmp\/snmpusm_init.h>/;
+s/include <snmpv3.h>/include <net-snmp\/snmpv3.h>/;
+s/include <system.h>/include <net-snmp\/system.h>/;
+s/include <tools.h>/include <net-snmp\/tools.h>/;
+s/include <transform_oids.h>/include <net-snmp\/transform_oids.h>/;
+s/include <vacm.h>/include <net-snmp\/vacm.h>/;
+s/\"agent_read_config.h\"/<net-snmp\/agent\/agent_read_config.h>/;
+s/\"agent_registry.h\"/<net-snmp\/agent\/agent_registry.h>/;
+s/\"agent_index.h\"/<net-snmp\/agent\/agent_index.h>/;
+s/\"agent_trap.h\"/<net-snmp\/agent\/agent_trap.h>/;
+s/\"auto_nlist.h\"/<net-snmp\/agent\/auto_nlist.h>/;
+s/\"ds_agent.h\"/<net-snmp\/agent\/ds_agent.h>/;
+s/\"snmp_agent.h\"/<net-snmp\/agent\/snmp_agent.h>/;
+s/\"snmp_vars.h\"/<net-snmp\/agent\/snmp_vars.h>/;
+s/\"var_struct.h\"/<net-snmp\/agent\/var_struct.h>/;
+s/\"agent_handler.h\"/<net-snmp\/agent\/agent_handler.h>/;
+s/\"ucd-snmp-agent-includes.h\"/<net-snmp\/agent\/net-snmp-agent-includes.h>/;
+s/\"agent_handler.h\"/<net-snmp\/agent\/agent_handler.h>/;
+s/\"agent_callbacks.h\"/<net-snmp\/agent\/agent_callbacks.h>/;
+s/\"mib_modules.h\"/<net-snmp\/agent\/mib_modules.h>/;
+s/<agent_read_config.h>/<net-snmp\/agent\/agent_read_config.h>/;
+s/<agent_registry.h>/<net-snmp\/agent\/agent_registry.h>/;
+s/<agent_index.h>/<net-snmp\/agent\/agent_index.h>/;
+s/<agent_trap.h>/<net-snmp\/agent\/agent_trap.h>/;
+s/<auto_nlist.h>/<net-snmp\/agent\/auto_nlist.h>/;
+s/<ds_agent.h>/<net-snmp\/agent\/ds_agent.h>/;
+s/<snmp_agent.h>/<net-snmp\/agent\/snmp_agent.h>/;
+s/<snmp_vars.h>/<net-snmp\/agent\/snmp_vars.h>/;
+s/<var_struct.h>/<net-snmp\/agent\/var_struct.h>/;
+s/<agent_handler.h>/<net-snmp\/agent\/agent_handler.h>/;
+s/<ucd-snmp-agent-includes.h>/<net-snmp\/agent\/net-snmp-agent-includes.h>/;
+s/<agent_handler.h>/<net-snmp\/agent\/agent_handler.h>/;
+s/<agent_callbacks.h>/<net-snmp\/agent\/agent_callbacks.h>/;
+s/<mib_modules.h>/<net-snmp\/agent\/mib_modules.h>/;
diff --git a/local/fixproc b/local/fixproc
new file mode 100755
index 0000000..b79630b
--- /dev/null
+++ b/local/fixproc
@@ -0,0 +1,694 @@
+#!/usr/bin/perl
+#
+# fixproc [-min n] [-max n] [-check | -kill | -restart | -exist | -fix] proc ...
+#
+# fixproc exit code:
+# 0 ok
+# 1 check failed
+# 2 cannot restart
+# 3 cannot kill
+# 4 fix failed if fix is defined as kill or restart, then
+# cannot kill or cannot restart is return instead
+# 10 fixproc error
+#
+#
+# Fixes a process named "proc" by performing the specified action. The
+# actions can be check, kill, restart, exist, or fix. The action is specified
+# on the command line or is read from a default database, which describes
+# the default action to take for each process. The database format and
+# the meaning of each action are described below.
+#
+# database format
+# ---------------
+#
+# name foo required
+# cmd /a/b/name args required
+# min number optional, defaults to 1
+# max number optional, defaults to 1
+#
+# check {null, exist, shell} optional, defaults to exist if not defined
+# [shell command shell commands needed only if check=shell
+# ...
+# shell command
+# end_shell] keyword end_shell marks end of shell commands
+# fix {kill, restart, shell} required
+# [shell command shell commands needed only if fix=shell
+# ...
+# shell command
+# end_shell] keyword end_shell marks end of shell commands
+#
+# Blank lines and lines beginning with "#" are ignored.
+#
+#
+# Example:
+#
+# name test1
+# cmd nice /home/kong/z/test1 > /dev/null &
+# max 2
+# fix shell
+# xterm&
+# nice /home/kong/z/test1 > /dev/null &
+# end_shell
+#
+#
+# actions
+# -------
+# There are 5 possible actions: kill, restart, fix, exist, check. Fix is
+# defined to be the kill action, the restart action, or a series of shell
+# commands. Check is optionally defined in the database. If check is not
+# defined, it defaults to exist.
+#
+# If the action is specified on the cmd line, it is executed regardless of
+# check. The commands executed for each action type is as follow:
+#
+# switch action:
+# kill:
+# kill process, wait 5 seconds, kill -9 if still exist
+# if still exist
+# return "cannot kill"
+# else
+# return "ok"
+#
+# restart:
+# execute kill
+# if kill returned "cannot kill"
+# return "cannot kill"
+# restart by issuing cmd to shell
+# if check defined
+# execute check
+# if check succeeds
+# return "ok"
+# else
+# return "cannot restart"
+#
+# fix:
+# if fix=kill
+# execute kill
+# else if fix=restart
+# execute restart
+# else
+# execute shell commands
+# execute check
+#
+# check:
+# if check defined as null
+# return "fixproc error"
+# else
+# execute check
+# if check succeeds
+# return (execute exist)
+# return "check failed"
+#
+# exist:
+# if proc exists in ps && (min <= num. of processes <= max)
+# return "ok"
+# else
+# return "check failed"
+#
+#
+# If the action is not specified on the cmd line, the default action is the
+# fix action defined in the database. Fix is only executed if check fails:
+#
+# if fix defined
+# if check is not defined as null
+# execute check
+# if check succeeds
+# return "ok"
+# execute action defined for fix
+# else
+# return "fixproc error"
+#
+#
+# If proc is not specified on the command line, return "fixproc error."
+# Multiple proc's can be defined on the cmd line. When an error occurs
+# when multiple proc's are specified, the first error encountered halts the
+# script.
+#
+# For check shell scripts, any non-zero exit code means the check has failed.
+#
+#
+# Timothy Kong 3/1995
+
+use File::Temp qw(tempfile);
+
+$database_file = '/local/etc/fixproc.conf';
+
+$debug = 0; # specify debug level using -dN
+ # currently defined: -d1
+
+$no_error = 0;
+$check_failed_error = 1;
+$cannot_restart_error = 2;
+$cannot_kill_error = 3;
+$cannot_fix_error = 4;
+$fixproc_error = 10;
+
+$min = 1;
+$max = 1;
+$cmd_line_action = '';
+%min = ();
+%max = ();
+%cmd = ();
+%check = ();
+%fix = ();
+$shell_lines = ();
+@proc_list = ();
+
+$shell_header = "#!/bin/sh\n";
+$shell_end_marker = 'shell_end_marker';
+
+&read_args();
+&read_database();
+# &dump_database(); # debug only
+
+# change the default min. and max. number of processes allowed
+if ($min != 1)
+ {
+ for $name ( keys (%min) )
+ {
+ $min{$name} = $min;
+ }
+ }
+if ($max != 1)
+ {
+ for $name ( keys (%max) )
+ {
+ $max{$name} = $max;
+ }
+ }
+
+# work on one process at a time
+for $proc ( @proc_list )
+ {
+ $error_code = &work_on_proc ($proc);
+
+############# uncomment next line when fully working ############
+# exit $error_code if ($error_code);
+
+ die "error_code = $error_code\n" if ($error_code);
+ }
+
+
+# create an executable shell script file
+sub create_sh_script
+{
+ local ($file) = pop (@_);
+ local ($fh) = pop (@_);
+ local ($i) = pop (@_);
+
+ printf (STDERR "create_sh_script\n") if ($debug > 0);
+
+ $! = $fixproc_error;
+ while ( $shell_lines[$i] ne $shell_end_marker )
+ {
+ printf ($fh "%s", $shell_lines[$i]);
+ $i++;
+ }
+ close ($fh);
+ chmod 0755, $file;
+}
+
+
+sub do_fix
+{
+ local ($proc) = pop(@_);
+
+ printf (STDERR "do_fix\n") if ($debug > 0);
+
+ if ($fix{$proc} eq '')
+ {
+ $! = $fixproc_error;
+ die "$0: internal error 4\n";
+ }
+ if ($fix{$proc} eq 'kill')
+ {
+ return &do_kill ($proc);
+ }
+ elsif ($fix{$proc} eq 'restart')
+ {
+ return &do_restart ($proc);
+ }
+ else
+ {
+ # it must be "shell", so execute the shell script defined in database
+ local ($tmpfh, $tmpfile) = tempfile("fix_XXXXXXXX", DIR => "/tmp");
+
+ &create_sh_script ($fix{$proc}, $tmpfh, $tmpfile);
+
+ # return code is number divided by 256
+ $error_code = (system "$tmpfile") / 256;
+ unlink($tmpfile);
+ return ($fix_failed_error) if ($error_code != 0);
+ # sleep needed here?
+ return &do_exist ($proc);
+ }
+}
+
+
+sub do_check
+{
+ local ($proc) = pop(@_);
+
+ printf (STDERR "do_check\n") if ($debug > 0);
+
+ if ($check{$proc} eq '')
+ {
+ $! = $fixproc_error;
+ die "$0: internal error 2\n";
+ }
+
+ if ($check{$proc} ne 'exist')
+ {
+ # if not "exist", then it must be "shell", so execute the shell script
+ # defined in database
+
+ local ($tmpfh, $tmpfile) = tempfile("check_XXXXXXXX", DIR => "/tmp");
+
+ &create_sh_script ($fix{$proc}, $tmpfh, $tmpfile);
+
+ # return code is number divided by 256
+ $error_code = (system "$tmpfile") / 256;
+ unlink($tmpfile);
+ return ($check_failed_error) if ($error_code != 0);
+
+ # check passed, continue
+ }
+ return &do_exist ($proc);
+}
+
+
+sub do_exist
+{
+ local ($proc) = pop(@_);
+
+ printf (STDERR "do_exist\n") if ($debug > 0);
+
+ # do ps, check to see if min <= no. of processes <= max
+ $! = $fixproc_error;
+ open (COMMAND, "/bin/ps -e | /bin/grep $proc | /bin/wc -l |")
+ || die "$0: can't run ps-grep-wc command\n";
+ $proc_count = <COMMAND>;
+ if (($proc_count < $min{$proc}) || ($proc_count > $max{$proc}))
+ {
+ return $check_failed_error;
+ }
+ return $no_error;
+}
+
+
+sub do_kill
+{
+ local ($proc) = pop(@_);
+ local ($second_kill_needed);
+
+ printf (STDERR "do_kill\n") if ($debug > 0);
+
+ # first try kill
+ $! = $fixproc_error;
+ open (COMMAND, "/bin/ps -e | /bin/grep $proc |")
+ || die "$0: can't run ps-grep-awk command\n";
+ while (<COMMAND>)
+ {
+ # match the first field of ps -e
+ $! = $fixproc_error;
+ /^\s*(\d+)\s/ || die "$0: can't match ps -e output\n";
+ system "kill $1";
+ }
+
+ # if process still exist, try kill -9
+ sleep 2;
+ $! = $fixproc_error;
+ open (COMMAND, "/bin/ps -e | /bin/grep $proc |")
+ || die "$0: can't run ps-grep-awk command\n";
+ $second_kill_needed = 0;
+ while (<COMMAND>)
+ {
+ # match the first field of ps -e
+ $! = $fixproc_error;
+ /^\s*(\d+)\s/ || die "$0: can't match ps -e output\n";
+ system "kill -9 $1";
+ $second_kill_needed = 1;
+ }
+ return ($no_error) if ($second_kill_needed == 0);
+
+ # see if kill -9 worked
+ sleep 2;
+ $! = $fixproc_error;
+ open (COMMAND, "/bin/ps -e | /bin/grep $proc |")
+ || die "$0: can't run ps-grep-awk command\n";
+ while (<COMMAND>)
+ { # a process still exist, return error
+ return $cannot_kill_error;
+ }
+ return $no_error; # good, all dead
+}
+
+
+sub do_restart
+{
+ local ($proc) = pop(@_);
+ local ($error_code);
+
+ printf (STDERR "do_restart\n") if ($debug > 0);
+
+ $error_code = &do_kill ($proc);
+ return $error_code if ($error_code != $no_error);
+ die "$0: internal error 3\n" if ($cmd{$proc} eq '');
+ system "$cmd{$proc}";
+ # sleep needed here?
+ if ($check{$proc} ne 'null')
+ {
+ return $no_error if (&do_check($proc) == $no_error);
+ return $cannot_restart_error;
+ }
+}
+
+
+sub work_on_proc
+{
+ local ($proc) = pop(@_);
+ local ($error_code);
+
+ printf (STDERR "work_on_proc\n") if ($debug > 0);
+
+ if ($cmd_line_action eq '')
+ {
+ # perform action from database
+
+ if ($check{$proc} ne 'null')
+ {
+ $error_code = &do_check ($proc);
+ if ($error_code != $check_failed_error)
+ {
+ return $error_code;
+ }
+ }
+ return &do_fix ($proc);
+ }
+ else
+ {
+ # perform action from command line
+
+ $error_code = $no_error;
+ if ($cmd_line_action eq 'kill')
+ {
+ $error_code = &do_kill ($proc);
+ }
+ elsif ($cmd_line_action eq 'restart')
+ {
+ $error_code = &do_restart ($proc);
+ }
+ elsif ($cmd_line_action eq 'fix')
+ {
+ $error_code = &do_fix ($proc);
+ }
+ elsif ($cmd_line_action eq 'check')
+ {
+ if ( $check{$proc} eq 'null' )
+ {
+ exit $fixproc_error;
+ }
+ $error_code = &do_check ($proc);
+ }
+ elsif ($cmd_line_action eq 'exist')
+ {
+ $error_code = &do_exist ($proc);
+ }
+ else
+ {
+ $! = $fixproc_error;
+ die "$0: internal error 1\n";
+ }
+ }
+}
+
+
+sub dump_database
+{
+ local ($name);
+
+ for $name (keys(%cmd))
+ {
+ printf ("name\t%s\n", $name);
+ printf ("cmd\t%s\n", $cmd{$name});
+ printf ("min\t%s\n", $min{$name});
+ printf ("max\t%s\n", $max{$name});
+ if ( $check{$name} =~ /[0-9]+/ )
+ {
+ printf ("check\tshell\n");
+ $i = $check{$name};
+ while ( $shell_lines[$i] ne $shell_end_marker )
+ {
+ printf ("%s", $shell_lines[$i]);
+ $i++;
+ }
+ }
+ else
+ {
+ printf ("check\t%s\n", $check{$name});
+ }
+ if ( $fix{$name} =~ /[0-9]+/ )
+ {
+ printf ("fix\tshell\n");
+ $i = $fix{$name};
+ while ( $shell_lines[$i] ne $shell_end_marker )
+ {
+ printf ("%s", $shell_lines[$i]);
+ $i++;
+ }
+ }
+ else
+ {
+ printf ("fix\t%s\n", $fix{$name});
+ }
+ printf ("\n");
+ }
+}
+
+
+sub read_database
+{
+ local ($in_check_shell_lines) = 0;
+ local ($in_fix_shell_lines) = 0;
+ local ($name) = '';
+ local ($str1);
+ local ($str2);
+
+ $! = $fixproc_error;
+ open (DB, $database_file) || die 'cannot open database file $database_file\n';
+ while (<DB>)
+ {
+ if ((! /\S/) || (/^[ \t]*#.*$/))
+ {
+ # ignore blank lines or lines beginning with "#"
+ }
+ elsif ($in_check_shell_lines)
+ {
+ if ( /^\s*end_shell\s*$/ )
+ {
+ $in_check_shell_lines = 0;
+ push (@shell_lines, $shell_end_marker);
+ }
+ else
+ {
+ push (@shell_lines, $_);
+ }
+ }
+ elsif ($in_fix_shell_lines)
+ {
+ if ( /^\s*end_shell\s*$/ )
+ {
+ $in_fix_shell_lines = 0;
+ push (@shell_lines, $shell_end_marker);
+ }
+ else
+ {
+ push (@shell_lines, $_);
+ }
+ }
+ else
+ {
+ if ( ! /^\s*(\S+)\s+(\S.*)\s*$/ )
+ {
+ $! = $fixproc_error;
+ die "$0: syntax error in database\n$_";
+ }
+ $str1 = $1;
+ $str2 = $2;
+ if ($str1 eq 'name')
+ {
+ &finish_db_entry($name);
+ $name = $str2;
+ }
+ elsif ($str1 eq 'cmd')
+ {
+ $! = $fixproc_error;
+ die "$0: cmd specified before name in database\n$_\n"
+ if ($name eq '');
+ die "$0: cmd specified multiple times for $name in database\n"
+ if ($cmd{$name} ne '');
+ $cmd{$name} = $str2;
+ }
+ elsif ($str1 eq 'min')
+ {
+ $! = $fixproc_error;
+ die "$0: min specified before name in database\n$_\n"
+ if ($name eq '');
+ die "$0: min specified multiple times in database\n$_\n"
+ if ($min{$name} ne '');
+ die "$0: non-numeric min value in database\n$_\n"
+ if ( ! ($str2 =~ /[0-9]+/ ));
+ $min{$name} = $str2;
+ }
+ elsif ($str1 eq 'max')
+ {
+ $! = $fixproc_error;
+ die "$0: max specified before name in database\n$_\n"
+ if ($name eq '');
+ die "$0: max specified multiple times in database\n$_\n"
+ if ($max{$name} ne '');
+ die "$0: non-numeric max value in database\n$_\n"
+ if ( ! ($str2 =~ /[0-9]+/ ));
+ $max{$name} = $str2;
+ }
+ elsif ($str1 eq 'check')
+ {
+ $! = $fixproc_error;
+ die "$0: check specified before name in database\n$_\n"
+ if ($name eq '');
+ die "$0: check specified multiple times in database\n$_\n"
+ if ($check{$name} ne '');
+ if ( $str2 eq 'shell' )
+ {
+ # if $check{$name} is a number, it is a pointer into
+ # $shell_lines[] where the shell commands are kept
+ $shell_lines[$#shell_lines+1] = $shell_header;
+ $check{$name} = $#shell_lines;
+ $in_check_shell_lines = 1;
+ }
+ else
+ {
+ $check{$name} = $str2;
+ }
+ }
+ elsif ($str1 eq 'fix')
+ {
+ $! = $fixproc_error;
+ die "$0: fix specified before name in database\n$_\n"
+ if ($name eq '');
+ die "$0: fix specified multiple times in database\n$_\n"
+ if ($fix{$name} ne '');
+ if ( $str2 eq 'shell' )
+ {
+ # if $fix{$name} is a number, it is a pointer into
+ # $shell_lines[] where the shell commands are kept
+ $shell_lines[$#shell_lines+1] = $shell_header;
+ $fix{$name} = $#shell_lines;
+ $in_fix_shell_lines = 1;
+ }
+ else
+ {
+ $fix{$name} = $str2;
+ }
+ }
+ }
+ }
+ &finish_db_entry($name);
+}
+
+
+sub finish_db_entry
+{
+ local ($name) = pop(@_);
+
+ if ($name ne '')
+ {
+ $! = $fixproc_error;
+ die "$0: fix not defined for $name in database\n"
+ if ($fix{$name} eq '');
+ die "$0: cmd not defined for $name in database\n"
+ if ($cmd{$name} eq '');
+ $check{$name} = 'exist' if ($check{$name} eq '');
+ $max{$name} = 1 if ($max{$name} eq '');
+ $min{$name} = 1 if ($min{$name} eq '');
+ }
+}
+
+
+sub read_args
+{
+ local ($i) = 0;
+ local ($arg);
+ local ($action_arg_count) = 0;
+
+ while ( $i <= $#ARGV )
+ {
+ $arg = $ARGV[$i];
+ if (($arg eq '-min') || ($arg eq '-max'))
+ {
+ if (($i == $#ARGV - 1) || ($ARGV[$i+1] =~ /\D/)) # \D is non-numeric
+ {
+ $! = $fixproc_error;
+ die "$0: numeric arg missing after -min or -max\n";
+ }
+ if ($arg eq '-min')
+ {
+ $min = $ARGV[$i+1];
+ }
+ else
+ {
+ $max = $ARGV[$i+1];
+ }
+ $i += 2;
+ }
+ elsif ($arg eq '-kill')
+ {
+ $cmd_line_action = 'kill';
+ $action_arg_count++;
+ $i++;
+ }
+ elsif ($arg eq '-check')
+ {
+ $cmd_line_action = 'check';
+ $action_arg_count++;
+ $i++;
+ }
+ elsif ($arg eq '-restart')
+ {
+ $cmd_line_action = 'restart';
+ $action_arg_count++;
+ $i++;
+ }
+ elsif ($arg eq '-exist')
+ {
+ $cmd_line_action = 'exist';
+ $action_arg_count++;
+ $i++;
+ }
+ elsif ($arg eq '-fix')
+ {
+ $cmd_line_action = 'fix';
+ $action_arg_count++;
+ $i++;
+ }
+ elsif ($arg =~ /-d(\d)$/)
+ {
+ $debug = $1;
+ $i++;
+ }
+ elsif ($arg =~ /^-/)
+ {
+ $! = $fixproc_error;
+ die "$0: unknown switch $arg\n";
+ }
+ else
+ {
+ push (@proc_list, $arg);
+ $i++;
+ }
+ }
+ $! = $fixproc_error;
+ die "$0: no process specified\n" if ($#proc_list == -1);
+ die "$0: more than one action specified\n" if ($action_arg_count > 1);
+ }
+
diff --git a/local/gittools/shell-functions b/local/gittools/shell-functions
new file mode 100644
index 0000000..45e6507
--- /dev/null
+++ b/local/gittools/shell-functions
@@ -0,0 +1,443 @@
+# -*- shell-script -*-
+# These functions are useful functions when working with a bash shell
+# within a Net-SNMP git checkout.
+
+nsbuildroot=${nsbuildroot:=$HOME/ns-build-root}
+nsecho=${nsecho:=}
+nsbranches=${nsbranches:="V5-4-patches V5-5-patches V5-6-patches V5-7-patches master"}
+
+# set nsverbose to ':' if you don't want verbose output of what's going on
+nsverbose=${nsverbose:="echo ::: Net-SNMP: "}
+
+_ns_maybemkdir () {
+ dir=$1
+ if [ ! -d $dir ] ; then
+ $nsverbose making directory $dir
+ mkdir -p $dir
+ fi
+}
+
+_ns_switchtobuilddir () {
+ dir=$1
+ _ns_maybemkdir $dir
+ $nsverbose cd $dir
+ cd $dir
+}
+
+_ns_getbuilddir() {
+ nssuffix=${1:-$nssuffix}
+ nsbranch=`git branch | egrep '^\*' | sed 's/^..//'`
+ NSBUILDDIR="$nsbuildroot/$nsbranch"
+ NSSRCDIR="$PWD"
+
+ # add on the suffix if created
+ if [ "$nssuffix" != "" ]; then
+ NSBUILDDIR="$nsbuildroot/$nsbranch-$nssuffix"
+ fi
+}
+
+_ns_setbuilddir() {
+ _ns_getbuilddir "$1"
+ _ns_switchtobuilddir $NSBUILDDIR
+}
+
+_ns_cleanup() {
+ $nsverbose cd $NSSRCDIR
+ cd $NSSRCDIR
+}
+
+_ns_checkclean() {
+ if [ `git status --porcelain --untracked-files=no | wc -l` -gt 0 ] ; then
+ echo "Your directory has outstanding changes!"
+ echo " Please either commit the changes, discard them or stash them"
+ NSCLEAN=0
+ else
+ NSCLEAN=1
+ fi
+}
+
+#
+# nsmake [-s suffix]
+# runs 'make' in $nsbuildroot/branch[-suffix]
+nsmake () {
+ if [ "$1" = "-s" ]; then
+ shift
+ _ns_setbuilddir "$1"
+ shift
+ else
+ _ns_setbuilddir
+ fi
+
+ $nsverbose make "$@"
+ $nsecho make "$@"
+
+ _ns_cleanup
+}
+
+nsmakeall () {
+ _ns_checkclean
+ if [ $NSCLEAN != 1 ]; then
+ return
+ fi
+
+ for branch in $nsbranches ; do
+ git checkout $branch
+ nsmake "$@"
+ done
+}
+
+#
+# nsconfigure [-s suffix] [configure arguments]
+# runs 'configure' in $nsbuildroot/branch[-suffix] with passed arguments
+nsconfigure () {
+ if [ "$1" = "-s" ]; then
+ shift
+ _ns_setbuilddir "$1"
+ shift
+ else
+ _ns_setbuilddir
+ fi
+
+ $nsverbose running $NSSRCDIR/configure "$@"
+ $nsecho $NSSRCDIR/configure "$@"
+
+ _ns_cleanup
+}
+
+nspatchtry() {
+ _ns_checkclean
+ if [ $NSCLEAN != 1 ]; then
+ return
+ fi
+
+ # remember these branches
+ nsgoodbranches=""
+ nsbadbranches=""
+
+ # remember the patch args for later use
+ nspatchargs="$@"
+
+ # attempt to add any missing patch arguments
+
+ echo "x $nspatchargs x" | grep -- -p > /dev/null
+ if [ $? != "0" ] ; then
+ # they didn't specify a -p option. Try to guess at one...
+ nspatchfile=`echo $nspatchargs | sed 's/.* \([^ ]+\)$/\1/'`
+ # attempt to count the slashes before any agent/snmplib/apps/etc
+ patchcount=$((`grep diff $nspatchfile | head -1 | awk '{print $NF}' | sed 's/\(agent\|snmplib\|apps\|local\|perl\|python\).*//;s#[^/]##g' | wc -c` - 1))
+ nspatchargs="-p $patchcount $nspatchargs"
+ fi
+
+ echo "x $nspatchargs x" | grep -- "-i " > /dev/null
+ if [ $? != "0" ] ; then
+ # they didn't specify a -i option. Try to add one...
+ nspatchargs=`echo $nspatchargs | sed 's/\(.*\) \(..*\)$/\1 -i \2/'`
+ fi
+
+ echo "Using patch args: $nspatchargs"
+
+ for branch in $nsbranches ; do
+ $nsverbose checking out and applying patch in $branch
+ $nsecho git checkout $branch
+
+ $nsverbose Appling patch
+ $nsecho patch -N --batch $nspatchargs
+ if [ $? = 0 ] ; then
+ $nsverbose Patch succeeded on $branch
+ nsgoodbranches="$nsgoodbranches $branch"
+ else
+ $nsverbose Patch failed on $branch
+ nsbadbranches="$nsbadbranches $branch"
+ fi
+
+ $nsverbose cleaning source tree
+ git checkout .
+ done
+
+ echo ""
+ echo "Patch application results:"
+ echo " Success: $nsgoodbranches"
+ echo " Fail: $nsbadbranches"
+}
+
+_nspatchapplybase() {
+ _ns_checkclean
+ if [ $NSCLEAN != 1 ]; then
+ return
+ fi
+
+ patchbranch=`echo $nsgoodbranches | sed 's/ .*//'`
+
+ $nsverbose Checking out $patchbranch
+ $nsecho git checkout $patchbranch
+
+ $nsverbose applying the patch "$nspatchargs"
+ $nsecho patch $nspatchargs
+ $nsecho git diff | cat
+}
+
+nspatchapply() {
+ _nspatchapplybase
+
+ echo ""
+ echo -n "commit the results to $patchbranch? [y/n]"
+ read ans
+
+ if [ $ans = 'y' -o $ans = 'Y' ] ; then
+ $nsecho git commit -a "$@"
+ fi
+}
+
+nssfpatchapply() {
+ _nspatchapplybase
+ nssfpatchcommit "$@"
+}
+
+nssfpatchcommit() {
+ patch="$1"
+ area="$2"
+
+ if [ "$patch" = "" ] ; then
+ echo "Enter patch number: "
+ echo -n "> "
+ read patch
+ fi
+ if [ "$patch" = "" ] ; then
+ echo "Error: A patch number is required"
+ return
+ fi
+
+ if [ "$area" = "" ] ; then
+ echo "Which area does this patch affect? (agent, libnetsnmp, apps, ...)?"
+ echo -n "> "
+ read area
+ fi
+ if [ "$area" = "" ] ; then
+ area="unknown"
+ fi
+
+ #
+ # get the patch's html
+ #
+ tmpfile="/tmp/nspatch.$patch"
+ if [ ! -f "$tmpfile" ]; then
+ wget -O $tmpfile "https://sourceforge.net/tracker/?func=detail&aid="${patch}"&group_id=12694&atid=312694"
+ fi
+
+ echo "---------------------------------"
+
+ username=`grep /users/ $tmpfile | head -1 | sed 's/.*.users.//;s/.".*//;'`
+ echo "username: $username"
+
+ fullname=`grep /users/ $tmpfile | head -1 | sed 's/.*title=.//;s/".*//;'`
+ echo "fullname: $fullname"
+
+ title=`grep "Detail: $patch" $tmpfile | head -1 | sed "s/.*$patch - //;s/<.*//" | sed 's/"//g;' | sed "s/'//g;"`
+ echo commit msg: $title
+
+ commitmsg="CHANGES: $area: PATCH $patch: from $username: $title"
+
+ patchbranch=`echo $nsgoodbranches | sed 's/ .*//'`
+ echo "Branch: $patchbranch"
+ echo "Command: "
+ echo " git commit -a -s \\"
+ echo " --author='$fullname <$username@users.sourceforge.net>'\\"
+ echo " -m '$commitmsg'"
+ echo ""
+ echo -n "commit the results to $patchbranch? [y/n]"
+ read ans
+
+ if [ $ans = 'y' -o $ans = 'Y' ] ; then
+ $nsecho git commit -a -s --author="$fullname <$username@users.sourceforge.net>" -m "$commitmsg"
+ else
+ echo "if you don't wish to keep the changes, use 'git reset --hard'"
+ fi
+}
+
+
+nsrollup() {
+ fetch=1;
+
+ if [ "$1" = "--no-fetch" ] ; then
+ fetch=0
+ shift
+ fi
+
+ if [ "$1" = "--merge" ] ; then
+ mergeop="merge"
+ elif [ "$1" = "--rebase" ] ; then
+ mergeop="rebase"
+ else
+ mergeop="merge"
+ fi
+
+ _ns_checkclean
+ if [ $NSCLEAN != 1 ]; then
+ return
+ fi
+
+ if [ $fetch == 1 ]; then
+ $nsverbose Pulling all upstream branches
+ $nsecho git fetch --all
+ fi
+
+ nslastbranch=""
+
+ nsbranchesdone=""
+ nsbranchesnotdone=""
+
+ for branch in $nsbranches ; do
+ if [ "$nslastbranch" != "" ] ; then
+ $nsverbose checking out $branch
+ $nsecho git checkout $branch
+
+ if [ -f dist/release ] ; then
+ if [ "`egrep ^$branch dist/release`" = "$branch rc" ] ; then
+ $nsverbose Skipping: branch is in rc phase of release
+ nsbranchesnotdone="$nsbranchesnotdone $branch"
+
+ # comment this out if you want nsrollup to skip the
+ # branch and roll the changes in the lower branch up
+ # to the super-parent when the parent is in release status
+ nslastbranch=$branch
+
+ continue
+ fi
+ fi
+
+ $nsverbose rebasing our local changes on $branch
+ MERGE_AUTOEDIT=no git $mergeop origin/$branch
+
+ $nsverbose merging $nslastbranch into $branch
+ MERGE_AUTOEDIT=no $nsecho git merge --log $nslastbranch
+ if [ $? != 0 ] ; then
+ echo ""
+ echo "---------------------------------------------"
+ echo "Merge of $nslastbranch into $branch failed!!!"
+ echo ""
+ echo "Hints for fixing this:"
+ echo " You're on: $branch"
+ echo " Steps:"
+ echo " 1) fix all files marked as problematic"
+ echo " 2) run 'git add' on each file"
+ if [ $mergeop = "rebase" ] ; then
+ echo " 3) run 'git rebase --continue' to commit the changes"
+ else
+ echo " 3) run 'git commit' to commit the changes"
+ fi
+ echo " 4) once done, re-run nsrollup"
+ echo " Aborting:"
+ echo " If instead you want to give up, run"
+ echo " 1) git $mergeop --abort"
+ echo ""
+ echo "Updated the following branches:"
+ echo " $nsbranchesdone"
+ if [ "$nsbranchesnotdone" != "" ] ; then
+ echo "Did NOT update the following branches:"
+ echo " $nsbranchesnotdone"
+ fi
+ echo "Failed to update this branch:"
+ echo " $branch"
+ return
+ fi
+
+ _ns_checkclean
+ if [ $NSCLEAN != 1 ] ; then
+ # we really shouldn't git here. merge will either autocommit
+ # or it will fail
+ $nsverbose committing merge results
+ $nsecho git commit -m "nsrollup: merging $nslastbranch into $branch" -a
+ fi
+
+ nsbranchesdone="$nsbranchesdone $branch"
+ fi
+
+ nslastbranch=$branch
+ done
+
+ echo ""
+ echo "-------------------------------"
+ echo "Updated the following branches:"
+ echo " $nsbranchesdone"
+ if [ "$nsbranchesnotdone" != "" ] ; then
+ echo "Did NOT update the following branches:"
+ echo " $nsbranchesnotdone"
+ fi
+
+ echo ""
+ echo "Now would be a good time to run 'nssync'"
+}
+
+nspull() {
+ nscurrentbranch=`git branch | egrep '^\*' | sed 's/^..//'`
+ _ns_checkclean
+ if [ $NSCLEAN != 1 ]; then
+ return
+ fi
+
+ if [ "$1" = "--merge" ] ; then
+ mergeop="merge"
+ elif [ "$1" = "--rebase" ] ; then
+ mergeop="rebase"
+ else
+ mergeop="merge"
+ fi
+
+ git fetch --all
+ for branch in $nsbranches ; do
+ git checkout $branch
+ MERGE_AUTOEDIT=no git $mergeop origin/$branch
+ if [ $? != 0 ] ; then
+ echo "git $mergeop failed; please fix first"
+ return
+ fi
+ done
+ git checkout $nscurrentbranch
+}
+
+nspush() {
+ _ns_checkclean
+ if [ $NSCLEAN != 1 ]; then
+ return
+ fi
+
+ git push origin $nsbranches
+ if [ $? != 0 ] ; then
+ echo "git push failed; help?"
+ return
+ fi
+}
+
+#
+# pull/pushes all the known active branches
+#
+nssync() {
+ nspull "$@"
+ nspush "$@"
+}
+
+#
+# runs the right version of autoconf for a given branch
+#
+# configure autoconf versions using --prefix=/usr/local/autoconf-VERSION
+#
+nsautoconf() {
+ if [ "$1" == "autoheader" ] ; then
+ tool="autoheader"
+ else
+ tool="autoconf"
+ fi
+
+ COR=`cat dist/autoconf-version`
+ PATH=/usr/local/autoconf-${COR}/bin:$PATH autoconf --version > /tmp/autoconf.version
+ VER=`head -1 /tmp/autoconf.version | awk '{print $NF}'`
+ if [ "$VER" != "$COR" ] ; then
+ echo "failed to find the correct version of autoconf"
+ echo "please install autoconf version $COR in /usr/local/autoconf-$COR"
+ echo " (configure autoconf-$COR using -prefix=/usr/local/autoconf-$COR"
+ return
+ fi
+
+ echo "RUNNING AUTOCONF $COR"
+ PATH=/usr/local/autoconf-${autover}/bin:$PATH $tool
+}
diff --git a/local/html-add-header-footer.pl b/local/html-add-header-footer.pl
new file mode 100755
index 0000000..c3cb902
--- /dev/null
+++ b/local/html-add-header-footer.pl
@@ -0,0 +1,212 @@
+#!/usr/bin/perl -w
+##############################################################################
+#
+# Alex Burger - Oct 28th, 2004
+#
+# Purpose: Modify .html files to add a header and footer for use
+# on the Net-SNMP web site.
+#
+# Can also be used to change the 'section' variable
+# for use in the menu system.
+#
+# Notes: A backup of each file is made to *.old.
+#
+# Any DOS newlines are removed from the destination file.
+#
+# Permissions are maintained.
+#
+##############################################################################
+#
+use File::Copy;
+use File::stat;
+use Getopt::Long;
+
+my $tidy_options = '-f /dev/null -m -i -asxhtml -wrap 130 -quiet --quote-nbsp n';
+
+my $pattern = '';
+my $section = '';
+my $tidy = 0;
+my $body = 0;
+my $help = 0;
+my @files = ();
+
+GetOptions ('pattern=s' => \$pattern,
+ 'section=s' => \$section,
+ 'tidy' => \$tidy,
+ 'body' => \$body,
+ 'help' => \$help);
+
+if ($help == 1)
+{
+$USAGE = qq/
+Usage:
+ add-header-footer [<options>] file1 file2 file3 ...
+Options:
+ --section= Menu section
+ --tidy Run tidy on input file before processing (turns on --body)
+ --body Remove everything before <body> and after <\/body>
+ --help Display this message
+
+Examples:
+
+ add-header-footer.pl --section=tutorial --body cat.html dog.html mouse.html
+
+ find . -name '*.html' | add-header-footer.pl --section=tutorial --body
+
+/;
+ print $USAGE;
+ exit 0;
+}
+
+if ($ARGV[0]) {
+ # Files listed on command line
+ foreach my $arg (@ARGV) {
+ chomp $arg;
+ push @files, $arg;
+ #print "$arg\n";
+ }
+}
+else {
+ # No arguments, so accept STDIN
+ while (<STDIN>) {
+ chomp;
+ push @files, $_;
+ #print "$_\n";
+ }
+}
+
+if (! (@files) ) {
+ exit 0;
+}
+
+#print "@files";
+
+foreach my $file (@files) {
+ chomp $file;
+ print "Processing file: $file\n";
+
+ # Grab current permissions
+ my $sb = stat($file);
+ my $stat_permissions = sprintf ("%04o", $sb->mode & 07777);
+ my $stat_uid = $sb->uid;
+ my $stat_gid = $sb->gid;
+
+ my @old_file = ();
+ my @new_file = ();
+
+ my $body_count = 0;
+
+ # Backup old file
+ if (! (copy ("$file", "$file.old"))) {
+ print "Could not backup existing file $file to $file.new. Aborting.\n";
+ next;
+ }
+ # Set permissions on old file to match original file
+ chmod oct($stat_permissions), "$file.old";
+ chown $stat_uid, $stat_uid, "$file.old";
+
+
+ if ($tidy == 1) {
+ $body = 1; # Enable body, as tidy will add it in.
+ my $tidy_command = "tidy $tidy_options $file";
+ `$tidy_command`;
+ }
+
+ if (open (I, "<$file")) {
+ # Load entire file
+ while (<I>) {
+ s/\015//g; # Remove any DOS newlines
+ chomp;
+ push (@old_file, $_);
+ }
+ }
+ else {
+ print "Could not open file $file. Aborting\n";
+ next;
+ }
+
+ if (!@old_file) {
+ print "Empty file. Skipping\n";
+ next;
+ }
+
+ # Remove empty lines at start
+ while (1) {
+ if ($old_file[0] eq "") {
+ splice (@old_file, 0, 1);
+ }
+ else {
+ last;
+ }
+ }
+
+ # Remove empty lines at end
+ while (1) {
+ if ($old_file[$#old_file] eq "") {
+ splice (@old_file, -1, 1);
+ }
+ else {
+ last;
+ }
+ }
+
+ if ($body == 1) {
+ # Count the number of <body lines
+ for (my $i = 0; $i <= $#old_file; $i++) {
+ if ($old_file[$i] =~ /<body/) {
+ $body_count++;
+ next;
+ }
+ }
+
+ # Remove anything before and including <body
+ while ($body_count > 0) {
+ while (! ($old_file[0] =~ /<body/)) {
+ splice (@old_file, 0, 1);
+ }
+ splice (@old_file, 0, 1); # <body line
+ $body_count--;
+ }
+ }
+
+ # Start to build new file in memory with header
+ push (@new_file, "<!--#set var=\"section\" value=\"$section\" -->\n");
+ push (@new_file, '<!--#include virtual="/page-top.html" -->' . "\n");
+ push (@new_file, '<!-- CONTENT START -->' . "\n");
+
+ # Add in old file, skipping existing header and footer and stopping at <body/>
+ for (my $i = 0; $i <= $#old_file; $i++) {
+ if (!(defined($old_file[$i]))) { next; }
+ if ($body == 1 && ($old_file[$i] =~ /<\/body>/)) { last; }
+ elsif ($old_file[$i] =~ /<!--#set var="section" value=/) { next; }
+ elsif ($old_file[$i] =~ /<!--#include virtual="\/page-top.html" -->/) { next; }
+ elsif ($old_file[$i] =~ /<!-- CONTENT START -->/) { next; }
+ elsif ($old_file[$i] =~ /<!-- CONTENT END -->/) { next; }
+ elsif ($old_file[$i] =~ /<!--#include virtual="\/page-bottom.html" -->/) { next; }
+
+ push (@new_file, $old_file[$i] . "\n");
+ }
+
+ # Finish to building new file in memory with footer
+ push (@new_file, '<!-- CONTENT END -->' . "\n");
+ push (@new_file, '<!--#include virtual="/page-bottom.html" -->' . "\n");
+
+ # Save new file
+ if (open (O, ">$file")) {
+ for (my $i = 0; $i <= $#new_file; $i++) {
+ print O "$new_file[$i]";
+ }
+ print O "\n";
+ close O;
+
+ # Set permissions
+ chmod oct($stat_permissions), $file;
+ chown $stat_uid, $stat_uid, $file;
+ }
+ else {
+ print "Could not create new file: $file.new\n"
+ }
+ close I;
+}
+
+
diff --git a/local/html-textfile-fix.pl b/local/html-textfile-fix.pl
new file mode 100755
index 0000000..b72075b
--- /dev/null
+++ b/local/html-textfile-fix.pl
@@ -0,0 +1,62 @@
+#!/usr/bin/perl
+use File::Copy;
+#
+# This program adds some HTML entities to the text files. This will help prevent
+# missing characters when including text documents in HTML.
+#
+# Written by: Alex Burger
+# Date: December 29th, 2005
+#
+@files = qw"
+CHANGES
+ERRATA
+INSTALL
+NEWS
+PORTING
+README
+README.agent-mibs
+README.agentx
+README.aix
+README.hpux11
+README.irix
+README.krb5
+README.mib2c
+README.mibs
+README.osX
+README.Panasonic_AM3X.txt
+README.smux
+README.snmpv3
+README.solaris
+README.thread
+README.tru64
+README.win32
+TODO
+perl/AnyData_SNMP/README
+perl/default_store/README
+perl/OID/README
+perl/SNMP/README
+perl/TrapReceiver/README
+";
+
+
+foreach my $file (@files) {
+ open (FILEIN, $file) || die "Could not open file \'$file\' for reading. $!";
+ open (FILEOUT, ">$file.new") || die "Could not open file \'$file.new\' for writing. $!";
+
+ while ($line = <FILEIN>) {
+ $line =~ s/&(?!lt|gt|quot|amp)/\&amp;/g;
+ $line =~ s/</\&lt;/g;
+ $line =~ s/>/\&gt;/g;
+ $line =~ s/\"/\&quot;/g;
+ print FILEOUT "$line";
+ }
+ close FILE;
+
+ if (! (move ("$file", "$file.old"))) {
+ die "Could not move $file to $file.old\n";
+ }
+ if (! (move ("$file.new", "$file"))) {
+ die "Could not move $file.new to $file\n";
+ }
+}
+
diff --git a/local/ipf-mod.pl b/local/ipf-mod.pl
new file mode 100755
index 0000000..285e779
--- /dev/null
+++ b/local/ipf-mod.pl
@@ -0,0 +1,227 @@
+#!/usr/bin/perl -s
+##
+## IP Filter UCD-SNMP pass module
+##
+## Allows read IP Filter's tables (In, Out, AccIn, AccOut),
+## fetching rules, hits and bytes (for accounting tables only).
+##
+## Author: Yaroslav Terletsky <ts@polynet.lviv.ua>
+## Date: $ Tue Dec 1 10:24:08 EET 1998 $
+## Version: 1.1a
+
+# Put this file in /usr/local/bin/ipf-mod.pl and then add the following
+# line to your snmpd.conf file (without the # at the front):
+#
+# pass .1.3.6.1.4.1.2021.13.2 /usr/local/bin/ipf-mod.pl
+
+# enterprises.ucdavis.ucdExperimental.ipFilter = .1.3.6.1.4.1.2021.13.2
+# ipfInTable.ipfInEntry.ipfInIndex integer = 1.1.1
+# ipfInTable.ipfInEntry.ipfInRule string = 1.1.2
+# ipfInTable.ipfInEntry.ipfInHits counter = 1.1.3
+# ipfOutTable.ipfOutEntry.ipfOutIndex integer = 1.2.1
+# ipfOutTable.ipfOutEntry.ipfOutRule string = 1.2.2
+# ipfOutTable.ipfOutEntry.ipfOutHits counter = 1.2.3
+# ipfAccInTable.ipfAccInEntry.ipfAccInIndex integer = 1.3.1
+# ipfAccInTable.ipfAccInEntry.ipfAccInRule string = 1.3.2
+# ipfAccInTable.ipfAccInEntry.ipfAccInHits counter = 1.3.3
+# ipfAccInTable.ipfAccInEntry.ipfAccInBytes counter = 1.3.4
+# ipfAccOutTable.ipfAccOutEntry.ipfAccOutIndex integer = 1.4.1
+# ipfAccOutTable.ipfAccOutEntry.ipfAccOutRule string = 1.4.2
+# ipfAccOutTable.ipfAccOutEntry.ipfAccOutHits counter = 1.4.3
+# ipfAccOutTable.ipfAccOutEntry.ipfAccOutBytes counter = 1.4.4
+
+# variables types
+%type = ('1.1.1', 'integer', '1.1.2', 'string', '1.1.3', 'counter',
+ '2.1.1', 'integer', '2.1.2', 'string', '2.1.3', 'counter',
+ '3.1.1', 'integer', '3.1.2', 'string', '3.1.3', 'counter',
+ '3.1.4', 'counter',
+ '4.1.1', 'integer', '4.1.2', 'string', '4.1.3', 'counter',
+ '4.1.4', 'counter');
+
+# getnext sequence
+%next = ('1.1.1', '1.1.2', '1.1.2', '1.1.3', '1.1.3', '2.1.1',
+ '2.1.1', '2.1.2', '2.1.2', '2.1.3', '2.1.3', '3.1.1',
+ '3.1.1', '3.1.2', '3.1.2', '3.1.3', '3.1.3', '3.1.4',
+ '3.1.4', '4.1.1',
+ '4.1.1', '4.1.2', '4.1.2', '4.1.3', '4.1.3', '4.1.4');
+
+# ipfilter's commands to fetch needed information
+$ipfstat_comm="/sbin/ipfstat";
+$ipf_in="$ipfstat_comm -ih 2>/dev/null";
+$ipf_out="$ipfstat_comm -oh 2>/dev/null";
+$ipf_acc_in="$ipfstat_comm -aih 2>/dev/null";
+$ipf_acc_out="$ipfstat_comm -aoh 2>/dev/null";
+
+$OID=$ARGV[0];
+$IPF_OID='.1.3.6.1.4.1.2021.13.2';
+$IPF_OID_NO_DOTS='\.1\.3\.6\.1\.4\.1\.2021\.13\.2';
+
+# exit if OID is not one of IPF-MIB's
+exit if $OID !~ /^$IPF_OID_NO_DOTS(\D|$)/;
+
+# get table, entry, column and row numbers
+$tecr = $OID;
+$tecr =~ s/^$IPF_OID_NO_DOTS(\D|$)//;
+($table, $entry, $col, $row, $rest) = split(/\./, $tecr);
+
+# parse 'get' request
+if($g) {
+ # exit if OID is wrong specified
+ if(!defined $table or !defined $entry or !defined $col or !defined $row or defined $rest) {
+ print "[1] NO-SUCH NAME\n" if $d;
+ exit;
+ }
+
+ # get the OID's value
+ $value = &get_value($table, $entry, $col, $row);
+ print "value=$value\n" if $d;
+
+ # exit if OID does not exist
+ print "[2] NO-SUCH NAME\n" if $d and !defined $value;
+ exit if !defined $value;
+
+ # set ObjectID and reply with response
+ $tec = "$table.$entry.$col";
+ $ObjectID = "${IPF_OID}.${tec}.${row}";
+ &response;
+}
+
+# parse 'get-next' request
+if($n) {
+ # set values if 0 or unspecified
+ $table = 1, $a = 1 if !$table or !defined $table;
+ $entry = 1, $a = 1 if !$entry or !defined $entry;
+ $col = 1, $a = 1 if !$col or !defined $col;
+ $row = 1, $a = 1 if !$row or !defined $row;
+
+ if($a) {
+ # get the OID's value
+ $value = &get_value($table, $entry, $col, $row);
+ print "value=$value\n" if $d;
+
+ # set ObjectID and reply with response
+ $tec = "$table.$entry.$col";
+ $ObjectID = "${IPF_OID}.${tec}.${row}";
+ &response;
+ }
+
+ # get next OID's value
+ $row++;
+ $value = &get_value($table, $entry, $col, $row);
+
+ # choose new table/column if rows exceeded
+ if(!defined $value) {
+ $tec = "$table.$entry.$col";
+ $tec = $next{$tec} if !$a;
+ $table = $tec;
+ $entry = $tec;
+ $col = $tec;
+ $table =~ s/\.\d\.\d$//;
+ $entry =~ s/^\d\.(\d)\.\d$/$1/;
+ $col =~ s/^\d\.\d\.//;
+ $row = 1;
+
+ # get the OID's value
+ $value = &get_value($table, $entry, $col, $row);
+ print "value=$value\n" if $d;
+ }
+
+ # set ObjectID and reply with response
+ $tec = "$table.$entry.$col";
+ $ObjectID = "${IPF_OID}.${tec}.${row}";
+ &response;
+}
+
+##############################################################################
+
+# fetch values from 'ipfInTable' and 'ipfOutTable' tables
+sub fetch_hits_n_rules {
+ local($row, $col, $ipf_output) = @_;
+ local($asdf, $i, @ipf_lines, $length);
+
+ # create an entry if no rule exists
+ $ipf_output = "0 empty list for ipfilter" if !$ipf_output;
+
+ @ipf_lines = split("\n", $ipf_output);
+ $length = $#ipf_lines + 1;
+
+ for($i = 1; $i < $length + 1; $i++) {
+ $hits{$i} = $ipf_lines[$i-1];
+ $hits{$i} =~ s/^(\d+).*$/$1/;
+ $rule{$i} = $ipf_lines[$i-1];
+ $rule{$i} =~ s/^\d+ //;
+ if($i == $row) {
+ return $i if $col == 1;
+ return $rule{$i} if $col == 2;
+ return $hits{$i} if $col == 3;
+ }
+ }
+ # return undefined value
+ undef $asdf;
+ return $asdf;
+}
+
+# fetch values from 'ipfAccInTable' and 'ipfAccOutTable' tables
+sub fetch_hits_bytes_n_rules {
+ local($row, $col, $ipf_output) = @_;
+ local($asdf, $i, @ipf_lines, $length);
+
+ # create an entry if no rule exists
+ $ipf_output = "0 0 empty list for ipacct" if !$ipf_output;
+
+ @ipf_lines = split("\n", $ipf_output);
+ $length = $#ipf_lines + 1;
+
+ for($i = 1; $i < $length + 1; $i++) {
+ $hits{$i} = $ipf_lines[$i-1];
+ $hits{$i} =~ s/^(\d+) .*$/$1/;
+ $bytes{$i} = $ipf_lines[$i-1];
+ $bytes{$i} =~ s/^\d+ (\d+) .*/$1/;
+ $rule{$i} = $ipf_lines[$i-1];
+ $rule{$i} =~ s/^\d+ \d+ //;
+ if($i == $row) {
+ return $i if $col == 1;
+ return $rule{$i} if $col == 2;
+ return $hits{$i} if $col == 3;
+ return $bytes{$i} if $col == 4;
+ }
+ }
+ # return undefined value
+ undef $asdf;
+ return $asdf;
+}
+
+# get the values from ipfilter's tables
+sub get_value {
+ local($table, $entry, $col, $row) = @_;
+
+ if($table == 1) {
+ # fetch ipfInTable data
+ $ipf_output = `$ipf_in`;
+ $value = &fetch_hits_n_rules($row, $col, $ipf_output);
+ } elsif($table == 2) {
+ # fetch ipfOutTable data
+ $ipf_output = `$ipf_out`;
+ $value = &fetch_hits_n_rules($row, $col, $ipf_output);
+ } elsif($table == 3) {
+ # fetch ipfAccInTable data
+ $ipf_output = `$ipf_acc_in`;
+ $value = &fetch_hits_bytes_n_rules($row, $col, $ipf_output);
+ } elsif($table == 4) {
+ # fetch ipfAccOutTable data
+ $ipf_output = `$ipf_acc_out`;
+ $value = &fetch_hits_bytes_n_rules($row, $col, $ipf_output);
+ }
+ return $value;
+}
+
+# generate response to 'get' or 'get-next' request
+sub response {
+ # print ObjectID, its type and the value
+ if(defined $ObjectID and defined $type{$tec} and defined $value) {
+ print "$ObjectID\n";
+ print "$type{$tec}\n";
+ print "$value\n";
+ }
+ exit;
+}
diff --git a/local/mib2c b/local/mib2c
new file mode 100755
index 0000000..2016f06
--- /dev/null
+++ b/local/mib2c
@@ -0,0 +1,1275 @@
+#!/usr/bin/perl
+#!/usr/bin/perl -w
+
+#
+# $Id$
+#
+# Description:
+#
+# This program, given an OID reference as an argument, creates some
+# template mib module files to be used with the net-snmp agent. It is
+# far from perfect and will not generate working modules, but it
+# significantly shortens development time by outlining the basic
+# structure.
+#
+# Its up to you to verify what it does and change the default values
+# it returns.
+#
+
+# SNMP
+my $havesnmp = eval {require SNMP;};
+my $havenetsnmpoid = eval {require NetSNMP::OID;};
+
+if (!$havesnmp) {
+ print "
+ERROR: You don't have the SNMP perl module installed. Please obtain
+this by getting the latest source release of the net-snmp toolkit from
+http://www.net-snmp.org/download/ . Once you download the source and
+unpack it, the perl module is contained in the perl/SNMP directory.
+See the README file there for instructions.
+
+";
+ exit;
+}
+
+if ($havesnmp) {
+ eval { import SNMP; }
+}
+if ($havenetsnmp) {
+ eval { import NetSNMP::OID; }
+}
+use FileHandle;
+
+#use strict 'vars';
+$SNMP::save_descriptions=1;
+$SNMP::use_long_names=1;
+$SNMP::use_enums=1;
+SNMP::initMib();
+
+$configfile="mib2c.conf";
+$debug=0;
+$quiet=0;
+$strict_unk_token = 0;
+$noindent = 0;
+$nosed = 0;
+$currentline = 0;
+$currentlevel = -1;
+%assignments;
+%outputs;
+@def_search_dirs = (".");
+@search_dirs = ();
+if($ENV{MIB2C_DIR}) {
+ push @def_search_dirs, split(/:/, $ENV{MIB2C_DIR});
+}
+push @def_search_dirs, "/usr/local/share/snmp/";
+push @def_search_dirs, "/usr/local/share/snmp/mib2c-data";
+push @def_search_dirs, "./mib2c-conf.d";
+
+sub usage {
+ print "$0 [-h] [-c configfile] [-f prefix] mibNode\n\n";
+ print " -h\t\tThis message.\n\n";
+ print " -c configfile\tSpecifies the configuration file to use\n\t\tthat dictates what the output of mib2c will look like.\n\n";
+ print " -I PATH\tSpecifies a path to look for configuration files in\n\n";
+ print " -f prefix\tSpecifies the output prefix to use. All code\n\t\twill be put into prefix.c and prefix.h\n\n";
+ print " -d\t\tdebugging output (don't do it. trust me.)\n\n";
+ print " -S VAR=VAL\tSet \$VAR variable to \$VAL\n\n";
+ print " -i\t\tDon't run indent on the resulting code\n\n";
+ print " -s\t\tDon't look for mibNode.sed and run sed on the resulting code\n\n";
+ print " mibNode\tThe name of the top level mib node you want to\n\t\tgenerate code for. By default, the code will be stored in\n\t\tmibNode.c and mibNode.h (use the -f flag to change this)\n\n";
+ 1;
+}
+
+my @origargs = @ARGV;
+my $args_done = 0;
+while($#ARGV >= 0) {
+ $_ = shift;
+ if (/^-/) {
+ if ($args_done != 0) {
+ warn "all argument must be specified before the mibNode!\n";
+ usage;
+ exit 1;
+ } elsif (/^-c/) {
+ $configfile = shift;
+ } elsif (/^-d/) {
+ $debug = 1;
+ } elsif (/^-S/) {
+ my $expr = shift;
+ my ($var, $val) = ($expr =~ /([^=]*)=(.*)/);
+ die "no variable specified for -S flag." if (!$var);
+ $assignments{$var} = $val;
+ } elsif (/^-q/) {
+ $quiet = 1;
+ } elsif (/^-i/) {
+ $noindent = 1;
+ } elsif (/^-s/) {
+ $nosed = 1;
+ } elsif (/^-h/) {
+ usage && exit(1);
+ } elsif (/^-f/) {
+ $outputName = shift;
+ } elsif (/^-I/) {
+ my $dirs = shift;
+ push @search_dirs, split(/,/,$dirs);
+ } else {
+ warn "Unknown option '$_'\n";
+ usage;
+ exit 1;
+ }
+ } else {
+ $args_done = 1;
+ warn "Replacing previous mibNode $oid with $_\n" if ($oid);
+ $oid = $_ ;
+ }
+}
+
+#
+# internal conversion tables
+#
+
+%accessToIsWritable = qw(ReadOnly 0 ReadWrite 1
+ WriteOnly 1 Create 1);
+%perltoctypes = qw(OCTETSTR ASN_OCTET_STR
+ INTEGER ASN_INTEGER
+ INTEGER32 ASN_INTEGER
+ UNSIGNED32 ASN_UNSIGNED
+ OBJECTID ASN_OBJECT_ID
+ COUNTER64 ASN_COUNTER64
+ COUNTER ASN_COUNTER
+ NETADDR ASN_COUNTER
+ UINTEGER ASN_UINTEGER
+ IPADDR ASN_IPADDRESS
+ BITS ASN_OCTET_STR
+ TICKS ASN_TIMETICKS
+ GAUGE ASN_GAUGE
+ OPAQUE ASN_OPAQUE);
+%perltodecl = ("OCTETSTR", "char",
+ "INTEGER", "long",
+ "INTEGER32", "long",
+ "UNSIGNED32", "u_long",
+ "UINTEGER", "u_long",
+ "OBJECTID", "oid",
+ "COUNTER64", "U64",
+ "COUNTER", "u_long",
+ "IPADDR", "in_addr_t",
+ "BITS", "char",
+ "TICKS", "u_long",
+ "GAUGE", "u_long",
+ "OPAQUE", "u_char");
+%perltolen = ("OCTETSTR", "1",
+ "INTEGER", "0",
+ "INTEGER32", "0",
+ "UNSIGNED32", "0",
+ "UINTEGER", "0",
+ "OBJECTID", "1",
+ "COUNTER64", "0",
+ "COUNTER", "0",
+ "IPADDR", "0",
+ "BITS", "1",
+ "TICKS", "0",
+ "GAUGE", "0",
+ "OPAQUE", "1");
+
+my $mibnode = $SNMP::MIB{$oid};
+
+if (!$mibnode) {
+
+print STDERR "
+You didn't give mib2c a valid OID to start with. IE, I could not find
+any information about the mib node \"$oid\". This could be caused
+because you supplied an incorrectly node, or by the MIB that you're
+trying to generate code from isn't loaded. To make sure your mib is
+loaded, run mib2c using this as an example:
+
+ env MIBS=\"+MY-PERSONAL-MIB\" mib2c " . join(" ",@origargs) . "
+
+You might wish to start by reading the MIB loading tutorial at:
+
+ http://www.net-snmp.org/tutorial-5/commands/mib-options.html
+
+And making sure you can get snmptranslate to display information about
+your MIB node. Once snmptranslate works, then come back and try mib2c
+again.
+
+";
+exit 1;
+}
+
+# setup
+$outputName = $mibnode->{'label'} if (!defined($outputName));
+$outputName =~ s/-/_/g;
+$vars{'name'} = $outputName;
+$vars{'oid'} = $oid;
+$vars{'example_start'} = " /*\n" .
+" ***************************************************\n" .
+" *** START EXAMPLE CODE ***\n" .
+" ***---------------------------------------------***/";
+$vars{'example_end'} = " /*\n" .
+" ***---------------------------------------------***\n" .
+" *** END EXAMPLE CODE ***\n" .
+" ***************************************************/";
+
+# loop through mib nodes, remembering stuff.
+setup_data($mibnode);
+
+if(($ENV{HOME}) && (-f "$ENV{HOME}/.snmp/mib2c.conf")) {
+ $fh = open_conf("$ENV{HOME}/.snmp/mib2c.conf");
+ process("-balanced");
+ $fh->close;
+}
+
+my $defaults = find_conf("default-$configfile",1);
+if (-f "$defaults" ) {
+ $fh = open_conf($defaults);
+ process("-balanced");
+ $fh->close;
+}
+
+my @theassignments = keys(%assignments);
+if ($#theassignments != -1) {
+ foreach $var (@theassignments) {
+ $vars{$var} = $assignments{$var};
+ }
+}
+$configfile = find_conf($configfile,0);
+$fh = open_conf($configfile);
+process("-balanced");
+$fh->close;
+
+if (-f "$outputName.sed" && !$nosed) {
+ foreach $i (keys(%written)) {
+ next if ($i eq "-");
+ next if (!($i =~ /\.[ch]$/));
+ print STDERR "running sed --in-place=.orig --file=$outputName.sed $i\n" if (!$quiet);
+ system("sed --in-place=.orig --file=$outputName.sed $i");
+ }
+}
+
+if (!$noindent) {
+ foreach $i (keys(%written)) {
+ next if ($i eq "-");
+ next if (!($i =~ /\.[ch]$/));
+ print STDERR "running indent on $i\n" if (!$quiet);
+ system("indent -orig -nbc -bap -nut -nfca -T size_t -T netsnmp_mib_handler -T netsnmp_handler_registration -T netsnmp_delegated_cache -T netsnmp_mib_handler_methods -T netsnmp_old_api_info -T netsnmp_old_api_cache -T netsnmp_set_info -T netsnmp_request_info -T netsnmp_set_info -T netsnmp_tree_cache -T netsnmp_agent_request_info -T netsnmp_cachemap -T netsnmp_agent_session -T netsnmp_array_group_item -T netsnmp_array_group -T netsnmp_table_array_callbacks -T netsnmp_table_row -T netsnmp_table_data -T netsnmp_table_data_set_storage -T netsnmp_table_data_set -T netsnmp_column_info -T netsnmp_table_registration_info -T netsnmp_table_request_info -T netsnmp_iterator_info -T netsnmp_data_list -T netsnmp_oid_array_header -T netsnmp_oid_array_header_wrapper -T netsnmp_oid_stash_node -T netsnmp_pdu -T netsnmp_request_list -T netsnmp_callback_pass -T netsnmp_callback_info -T netsnmp_transport -T netsnmp_transport_list -T netsnmp_tdomain $i");
+ }
+}
+
+sub m2c_die {
+ warn "ERROR: ". $_[0] . "\n";
+ die " at $currentfile:$currentline\n";
+}
+
+sub tocommas {
+ my $oid = $_[0];
+ $oid =~ s/\./,/g;
+ $oid =~ s/^\s*,//;
+ return $oid;
+}
+
+sub oidlength {
+ return (scalar split(/\./, $_[0])) - 1;
+}
+
+# replaces $VAR type expressions and $VAR.subcomponent expressions
+# with data from the mib tree and loop variables.
+# possible uses:
+#
+# $var -- as defined by loops, etc.
+# ${var}otherstuff -- appending text to variable contents
+# $var.uc -- all upper case version of $var
+#
+# NOTE: THESE ARE AUTO-EXTRACTED/PROCESSED BY ../mib2c.extract.pl for man pages
+#
+# Mib components, $var must first expand to a mib node name:
+#
+# $var.uc -- all upper case version of $var
+#
+# $var.objectID -- dotted, fully-qualified, and numeric OID
+# $var.commaoid -- comma separated numeric OID for array initialization
+# $var.oidlength -- length of the oid
+# $var.subid -- last number component of oid
+# $var.module -- MIB name that the object comes from
+# $var.parent -- contains the label of the parent node of $var.
+#
+# $var.isscalar -- returns 1 if var contains the name of a scalar
+# $var.iscolumn -- returns 1 if var contains the name of a column
+# $var.children -- returns 1 if var has children
+#
+# $var.perltype -- node's perl SYNTAX ($SNMP::MIB{node}{'syntax'})
+# $var.type -- node's ASN_XXX type (Net-SNMP specific #define)
+# $var.decl -- C data type (char, u_long, ...)
+#
+# $var.readable -- 1 if an object is readable, 0 if not
+# $var.settable -- 1 if an object is writable, 0 if not
+# $var.creatable -- 1 if a column object can be created as part of a new row, 0 if not
+# $var.noaccess -- 1 if not-accessible, 0 if not
+# $var.accessible -- 1 if accessible, 0 if not
+# $var.storagetype -- 1 if an object is a StorageType object, 0 if not
+# $var.rowstatus -- 1 if an object is a RowStatus object, 0 if not
+# 'settable', 'creatable', 'lastchange', 'storagetype' and 'rowstatus' can
+# also be used with table variables to indicate whether it contains
+# writable, creatable, LastChange, StorageType or RowStatus column objects
+#
+# $var.hasdefval -- returns 1 if var has a DEFVAL clause
+# $var.defval -- node's DEFVAL
+# $var.hashint -- returns 1 if var has a HINT clause
+# $var.hint -- node's HINT
+# $var.ranges -- returns 1 if var has a value range defined
+# $var.enums -- returns 1 if var has enums defined for it.
+# $var.access -- node's access type
+# $var.status -- node's status
+# $var.syntax -- node's syntax
+# $var.reference -- node's reference
+# $var.description -- node's description
+
+sub process_vars {
+ my $it = shift;
+
+ # mib substitutions ($var.type -> $mibnode->{'type'})
+ if ( $it =~ /\$(\w+)\.(\w+)/ ) {
+ if ($SNMP::MIB{$vars{$1}} && defined($tables{$SNMP::MIB{$vars{$1}}{'label'}})) {
+ $it =~ s/\$(\w+)\.(settable)/(table_is_writable($SNMP::MIB{$vars{$1}}{label}))/eg;
+ $it =~ s/\$(\w+)\.(creatable)/(table_has_create($SNMP::MIB{$vars{$1}}{label}))/eg;
+ $it =~ s/\$(\w+)\.(rowstatus)/(table_has_rowstatus($SNMP::MIB{$vars{$1}}{label}))/eg;
+ $it =~ s/\$(\w+)\.(lastchange)/(table_has_lastchange($SNMP::MIB{$vars{$1}}{label}))/eg;
+ $it =~ s/\$(\w+)\.(storagetype)/(table_has_storagetype($SNMP::MIB{$vars{$1}}{label}))/eg;
+ }
+ $it =~ s/\$(\w+)\.(uc)/uc($vars{$1})/eg; # make something uppercase
+ $it =~ s/\$(\w+)\.(commaoid)/tocommas($SNMP::MIB{$vars{$1}}{objectID})/eg;
+ $it =~ s/\$(\w+)\.(oidlength)/oidlength($SNMP::MIB{$vars{$1}}{objectID})/eg;
+ $it =~ s/\$(\w+)\.(description)/$SNMP::MIB{$vars{$1}}{description}/g;
+ $it =~ s/\$(\w+)\.(perltype)/$SNMP::MIB{$vars{$1}}{type}/g;
+ $it =~ s/\$(\w+)\.(type)/$perltoctypes{$SNMP::MIB{$vars{$1}}{$2}}/g;
+ $it =~ s/\$(\w+)\.(subid)/$SNMP::MIB{$vars{$1}}{subID}/g;
+ $it =~ s/\$(\w+)\.(module)/$SNMP::MIB{$vars{$1}}{moduleID}/g;
+ $it =~ s/\$(\w+)\.(settable)/(($SNMP::MIB{$vars{$1}}{access} =~ \/(ReadWrite|Create|WriteOnly)\/)?1:0)/eg;
+ $it =~ s/\$(\w+)\.(creatable)/(($SNMP::MIB{$vars{$1}}{access} =~ \/(Create)\/)?1:0)/eg;
+ $it =~ s/\$(\w+)\.(readable)/(($SNMP::MIB{$vars{$1}}{access} =~ \/(Read|Create)\/)?1:0)/eg;
+ $it =~ s/\$(\w+)\.(noaccess)/(($SNMP::MIB{$vars{$1}}{access} =~ \/(NoAccess)\/)?1:0)/eg;
+ $it =~ s/\$(\w+)\.(accessible)/(($SNMP::MIB{$vars{$1}}{access} !~ \/(NoAccess)\/)?1:0)/eg;
+ $it =~ s/\$(\w+)\.(objectID|label|subID|access|status|syntax|reference)/$SNMP::MIB{$vars{$1}}{$2}/g;
+ $it =~ s/\$(\w+)\.(decl)/$perltodecl{$SNMP::MIB{$vars{$1}}{type}}/g;
+ $it =~ s/\$(\w+)\.(needlength)/$perltolen{$SNMP::MIB{$vars{$1}}{type}}/g;
+ $it =~ s/\$(\w+)\.(iscolumn)/($SNMP::MIB{$vars{$1}}{'parent'}{'label'} =~ \/Entry$\/) ? 1 : 0/eg;
+ $it =~ s/\$(\w+)\.(isscalar)/($SNMP::MIB{$vars{$1}}{'parent'}{'label'} !~ \/Entry$\/ && $SNMP::MIB{$vars{$1}}{access}) ? 1 : 0/eg;
+ $it =~ s/\$(\w+)\.(parent)/$SNMP::MIB{$vars{$1}}{'parent'}{'label'}/g;
+ $it =~ s/\$(\w+)\.(children)/($#{$SNMP::MIB{$vars{$1}}{'children'}} == 0) ? 0 : 1/eg;
+ $it =~ s/\$(\w+)\.(hasdefval)/(length($SNMP::MIB{$vars{$1}}{'defaultValue'}) == 0) ? 0 : 1/eg;
+ $it =~ s/\$(\w+)\.(defval)/$SNMP::MIB{$vars{$1}}{'defaultValue'}/g;
+ $it =~ s/\$(\w+)\.(hashint)/(length($SNMP::MIB{$vars{$1}}{'hint'}) == 0) ? 0 : 1/eg;
+ $it =~ s/\$(\w+)\.(hint)/$SNMP::MIB{$vars{$1}}{'hint'}/g;
+ $it =~ s/\$(\w+)\.(ranges)/($#{$SNMP::MIB{$vars{$1}}{'ranges'}} == -1) ? 0 : 1/eg;
+ # check for enums
+ $it =~ s/\$(\w+)\.(enums)/(%{$SNMP::MIB{$vars{$1}}{'enums'}} == 0) ? 0 : 1/eg;
+ $it =~ s/\$(\w+)\.(enumrange)/%{$SNMP::MIB{$vars{$1}}{'enums'}}/eg;
+ $it =~ s/\$(\w+)\.(rowstatus)/(($SNMP::MIB{$vars{$1}}{syntax} =~ \/(RowStatus)\/)?1:0)/eg;
+ $it =~ s/\$(\w+)\.(storagetype)/(($SNMP::MIB{$vars{$1}}{syntax} =~ \/(StorageType)\/)?1:0)/eg;
+ if ( $it =~ /\$(\w+)\.(\w+)/ ) {
+ warn "Possible unknown variable attribute \$$1.$2 at $currentfile:$currentline\n";
+ }
+ }
+ # normal variable substitions
+ $it =~ s/\$\{(\w+)\}/$vars{$1}/g;
+ $it =~ s/\$(\w+)/$vars{$1}/g;
+ # use $@var to put literal '$var'
+ $it =~ s/\$\@(\w+)/\$$1/g;
+ return $it;
+}
+
+# process various types of statements
+#
+# NOTE: THESE ARE AUTO-EXTRACTED/PROCESSED BY ../mib2c.extract.pl for man pages
+# which include:
+# @open FILE@
+# writes generated output to FILE
+# note that for file specifications, opening '-' will print to stdout.
+# @append FILE@
+# appends the given FILE
+# @close FILE@
+# closes the given FILE
+# @push@
+# save the current outputs, then clear outputs. Use with @open@
+# and @pop@ to write to a new file without interfering with current
+# outputs.
+# @pop@
+# pop up the process() stack one level. Use after a @push@ to return to
+# the previous set of open files.
+# @foreach $VAR scalar@
+# repeat iterate over code until @end@ setting $VAR to all known scalars
+# @foreach $VAR table@
+# repeat iterate over code until @end@ setting $VAR to all known tables
+# @foreach $VAR column@
+# repeat iterate over code until @end@ setting $VAR to all known
+# columns within a given table. Obviously this must be called
+# within a foreach-table clause.
+# @foreach $VAR nonindex@
+# repeat iterate over code until @end@ setting $VAR to all known
+# non-index columns within a given table. Obviously this must be called
+# within a foreach-table clause.
+# @foreach $VAR internalindex@
+# repeat iterate over code until @end@ setting $VAR to all known internal
+# index columns within a given table. Obviously this must be called
+# within a foreach-table clause.
+# @foreach $VAR externalindex@
+# repeat iterate over code until @end@ setting $VAR to all known external
+# index columns within a given table. Obviously this must be called
+# within a foreach-table clause.
+# @foreach $VAR index@
+# repeat iterate over code until @end@ setting $VAR to all known
+# indexes within a given table. Obviously this must be called
+# within a foreach-table clause.
+# @foreach $VAR notifications@
+# repeat iterate over code until @end@ setting $VAR to all known notifications
+# @foreach $VAR varbinds@
+# repeat iterate over code until @end@ setting $VAR to all known varbinds
+# Obviously this must be called within a foreach-notifications clause.
+# @foreach $LABEL, $VALUE enum@
+# repeat iterate over code until @end@ setting $LABEL and $VALUE
+# to the label and values from the enum list.
+# @foreach $RANGE_START, $RANGE_END range NODE@
+# repeat iterate over code until @end@ setting $RANGE_START and $RANGE_END
+# to the legal accepted range set for a given mib NODE.
+# @foreach $var stuff a b c d@
+# repeat iterate over values a, b, c, d as assigned generically
+# (ie, the values are taken straight from the list with no
+# mib-expansion, etc).
+# @while expression@
+# repeat iterate over code until the expression is false
+# @eval $VAR = expression@
+# evaluates expression and assigns the results to $VAR. This is
+# not a full perl eval, but sort of a "psuedo" eval useful for
+# simple expressions while keeping the same variable name space.
+# See below for a full-blown export to perl.
+# @perleval STUFF@
+# evaluates STUFF directly in perl. Note that all mib2c variables
+# interpereted within .conf files are in $vars{NAME} and that
+# a warning will be printed if STUFF does not return 0. (adding a
+# 'return 0;' at the end of STUFF is a workaround.
+# @startperl@
+# @endperl@
+# treats everything between these tags as perl code, and evaluates it.
+# @next@
+# restart foreach; should only be used inside a conditional.
+# skips out of current conditional, then continues to skip to
+# end for the current foreach clause.
+# @if expression@
+# evaluates expression, and if expression is true processes
+# contained part until appropriate @end@ is reached. If the
+# expression is false, the next @elsif expression@ expression
+# (if it exists) will be evaluated, until an expression is
+# true. If no such expression exists and an @else@
+# clause is found, it will be evaluated.
+# @ifconf file@
+# If the specified file can be found in the conf file search path,
+# and if found processes contained part until an appropriate @end@ is
+# found. As with a regular @if expression@, @elsif expression@ and
+# @else@ can be used.
+# @ifdir dir@
+# If the specified directory exists, process contained part until an
+# appropriate @end@ is found. As with a regular @if expression@,
+# @elsif expression@ and @else@ can be used.
+# @define NAME@
+# @enddefine@
+# Memorizes "stuff" between the define and enddefine tags for
+# later calling as NAME by @calldefine NAME@.
+# @calldefine NAME@
+# Executes stuff previously memorized as NAME.
+# @printf "expression" stuff1, stuff2, ...@
+# Like all the other printf's you know and love.
+# @run FILE@
+# Sources the contents of FILE as a mib2c file,
+# but does not affect current files opened.
+# @include FILE@
+# Sources the contents of FILE as a mib2c file and appends its
+# output to the current output.
+# @prompt $var QUESTION@
+# Presents the user with QUESTION, expects a response and puts it in $var
+# @print STUFF@
+# Prints stuff directly to the users screen (ie, not to where
+# normal mib2c output goes)
+# @quit@
+# Bail out (silently)
+# @exit@
+# Bail out!
+#
+sub skippart {
+ my $endcount = 1;
+ my $arg = shift;
+ my $rtnelse = 0;
+ while ($arg =~ s/-(\w+)\s*//) {
+ $rtnelse = 1 if ($1 eq "else");
+ }
+ while(get_next_line()) {
+ $currentline++;
+ $_ = process_vars($_) if ($debug);
+ print "$currentfile.$currentline:P$currentlevel:S$endcount.$rtnelse:$_" if ($debug);
+ next if ( /^\s*\#\#/ ); # noop, it's a comment
+ next if (! /^\s*\@/ ); # output
+ if (! /^\s*\@.*\@/ ) {
+ warn "$currentfile:$currentline contained a line that started with a @ but did not match any mib2c configuration tokens.\n";
+ warn "(maybe missing the trailing @?)\n";
+ warn "$currentfile:$currentline [$_]\n";
+ }
+ elsif (/\@\s*end\@/) {
+ return "end" if ($endcount == 1);
+ $endcount--;
+ }
+ elsif (/\@\s*elseif.*\@/) {
+ m2c_die "use 'elsif' instead of 'elseif'\n";
+ }
+ elsif (/\@\s*else\@/) {
+ return "else" if (($endcount == 1) && ($rtnelse == 1));
+ }
+ elsif (/\@\s*elsif\s+([^\@]+)\@/) {
+ return "else" if (($endcount == 1) && ($rtnelse == 1) && (eval(process_vars($1))));
+ }
+ elsif (/\@\s*(foreach|if|while)/) {
+ $endcount++;
+ }
+ }
+ print "skippart EOF\n";
+ m2c_die "unbalanced code detected in skippart: EOF when $endcount levels deep" if($endcount != 1);
+ return "eof";
+}
+
+sub close_file {
+ my $name = shift;
+ if (!$name) {
+ print "close_file w/out name!\n";
+ return;
+ }
+ if(!$outputs{$name}) {
+ print "no handle for $name\n";
+ return;
+ }
+ $outputs{$name}->close();
+ delete $outputs{$name};
+# print STDERR "closing $name\n" if (!$quiet);
+}
+
+sub close_files {
+ foreach $name (keys(%outputs)) {
+ close_file($name);
+ }
+}
+
+sub open_file {
+ my $multiple = shift;
+ my $spec = shift;
+ my $name = $spec;
+ $name =~ s/>//;
+ if ($multiple == 0) {
+ close_files();
+ }
+ return if ($outputs{$name});
+ $outputs{$name} = new IO::File;
+ $outputs{$name}->open(">$spec") || m2c_die "failed to open $name";
+ print STDERR "writing to $name\n" if (!$quiet && !$written{$name});
+ $written{$name} = '1';
+}
+
+sub process_file {
+ my ($file, $missingok, $keepvars) = (@_);
+ my $oldfh = $fh;
+ my $oldfile = $currentfile;
+ my $oldline = $currentline;
+ # keep old copy of @vars and just build on it.
+ my %oldvars;
+
+ %oldvars = %vars if ($keepvars != 1);
+
+ $file = find_conf($file,$missingok);
+ return if (! $file);
+
+ $fh = open_conf($file);
+ $currentline = 0;
+ process("-balanced");
+ $fh->close();
+
+ $fh = $oldfh;
+ $currentfile = $oldfile;
+ $currentline = $oldline;
+
+ # don't keep values in replaced vars. Revert to ours.
+ %vars = %oldvars if ($keepvars != 1);
+}
+
+sub get_next_line {
+ if ($#process_lines > -1) {
+ return $_ = shift @process_lines;
+ }
+ return $_ = <$fh>;
+}
+
+sub do_tell {
+ my $stash;
+ $stash->{'startpos'} = $fh->tell();
+ $stash->{'startline'} = $currentline;
+ @{$stash->{'lines'}} = @process_lines;
+ return $stash;
+}
+
+sub do_seek {
+ my $stash = shift;
+
+ # save current line number
+ $currentline = $stash->{'startline'};
+ $fh->seek($stash->{'startpos'}, 0); # go to top of section.
+
+ # save current process_lines state.
+ @process_lines = @{$stash->{'lines'}};
+
+ # save state of a number of variables (references), and new assignments
+ for (my $i = 0; $i <= $#_; $i += 2) {
+ push @{$stash->{'vars'}}, $_[$i], ${$_[$i]};
+ ${$_[$i]} = $_[$i+1];
+ }
+}
+
+sub do_unseek {
+ my $stash = shift;
+ for (my $i = 0; $i <= $#{$stash->{'vars'}}; $i += 2) {
+ ${$stash->{'vars'}[$i]} = $stash->{'vars'}[$i+1];
+ }
+}
+
+sub do_a_loop {
+ my $stash = shift;
+ do_seek($stash, @_);
+ my $return = process();
+ do_unseek($stash);
+ return $return;
+}
+
+sub process {
+ my $arg = shift;
+ my $elseok = 0;
+ my $balanced = 0;
+ my $startlevel;
+ my $return = "eof";
+ while ($arg =~ s/-(\w+)\s*//) {
+ $elseok = 1 if ($1 eq "elseok");
+ $balanced = 1 if ($1 eq "balanced");
+ }
+
+ $currentlevel++;
+ $startlevel = $currentlevel;
+ if($balanced) {
+ $balanced = $currentlevel;
+ }
+ while(get_next_line()) {
+ $currentline++;
+ if ($debug) {
+# my $line = process_vars($_);
+# chop $line;
+ print "$currentfile.$currentline:P$currentlevel.$elseok:$return:$_";
+ }
+
+ next if (/^\s*\#\#/); # noop, it's a comment
+ if (! /^\s*\@/ ) { # output
+ my $line = process_vars($_);
+ foreach $file (values(%outputs)) {
+ print $file "$line";
+ }
+ } ####################################################################
+ elsif (/\@\s*exit\@/) { # EXIT
+ close_files;
+ die "exiting at conf file ($currentfile:$currentline) request\n";
+ } elsif (/\@\s*quit\@/) { # QUIT
+ close_files;
+ exit;
+ } elsif (/\@\s*debug\s+([^\@]+)\@/) { # DEBUG
+ if ($1 eq "on") {
+ $debug = 1;
+ }
+ else {
+ $debug = 0;
+ }
+ } elsif (/\@\s*strict token\s+([^\@]+)\@/) { # STRICT
+ if ($1 eq "on") {
+ $strict_unk_token = 1;
+ }
+ else {
+ $strict_unk_token = 0;
+ }
+ } elsif (/\@\s*balanced\@/) { # BALANCED
+ $balanced = $currentlevel;
+ } elsif (/\@\s*open\s+([^\@]+)\@/) { # OPEN
+ my $arg = $1;
+ my ($multiple) = (0);
+ while ($arg =~ s/-(\w+)\s+//) {
+ $multiple = 1 if ($1 eq 'multiple');
+ }
+ my $spec = process_vars($arg);
+ open_file($multiple, $spec);
+ } elsif (/\@\s*close\s+([^\@]+)\@/) { # CLOSE
+ my $spec = process_vars($1);
+ close_file($spec);
+ } elsif (/\@\s*append\s+([^\@]+)\@/) { # APPEND
+ my $arg = $1;
+ my ($multiple) = (0);
+ while ($arg =~ s/-(\w+)\s+//) {
+ $multiple = 1 if ($1 eq 'multiple');
+ }
+ my $spec = process_vars($arg);
+ $spec=">$spec";
+ open_file($multiple,$spec);
+ } elsif (/\@\s*define\s*(.*)\@/) { # DEFINE
+ my $it = $1;
+ while (<$fh>) {
+ last if (/\@\s*enddefine\s*@/);
+ push @{$defines{$it}}, $_;
+ }
+ } elsif (/\@\s*calldefine\s+(\w+)@/) {
+ if ($#{$defines{$1}} == -1) {
+ warn "called a define of $1 which didn't exist\n";
+ warn "$currentfile:$currentline [$_]\n";
+ } else {
+ unshift @process_lines, @{$defines{$1}};
+ }
+ } elsif (/\@\s*run (.*)\@/) { # RUN
+ my $arg = $1;
+ my ($again) = (0);
+ while ($arg =~ s/-(\w+)\s+//) {
+ $again = 1 if ($1 eq 'again');
+# if ($1 eq 'file') {
+# my ($filearg) = ($arg =~ s/^(\w+)//);
+# }
+ }
+ my $spec = process_vars($arg);
+ next if (!$again && $ranalready{$spec});
+ $ranalready{$spec} = 1;
+ my %oldout = %outputs;
+ my %emptyarray;
+ %outputs = %emptyoutputs;
+ process_file($spec,0,0);
+ close_files;
+ %outputs = %oldout;
+ } elsif (/\@\s*push\@/) { # PUSH
+ my %oldout = %outputs;
+ my %emptyarray;
+ %outputs = %emptyoutputs;
+ process($arg);
+ close_files;
+ %outputs = %oldout;
+ } elsif (/\@\s*pop\s*\@/) { # POP
+ $return = "pop";
+ last;
+ } elsif (/\@\s*include (.*)\@/) { # INCLUDE
+ my $arg = $1;
+ my ($missingok) = (0);
+ while ($arg =~ s/-(\w+)\s+//) {
+ $missingok = 1 if ($1 eq 'ifexists');
+ }
+ my $spec = process_vars($arg);
+ process_file($spec,$missingok,1);
+ } elsif (/\@\s*if([a-z]*)\s+([^@]+)\@/) { # IF
+ my ($type,$arg,$ok) = ($1,$2,0);
+ # check condition based on type
+ if (! $type) {
+ $ok = eval(process_vars($arg));
+ } elsif ($type eq conf) {
+ my $file = find_conf(process_vars($arg),1); # missingok
+ $ok = (-f $file);
+ } elsif ($type eq dir) {
+ $ok = (-d $arg);
+ } else {
+ m2c_die "unknown if modifier ($type)\n";
+ }
+ # act on condition
+ if ($ok) {
+ $return = process("-elseok");
+ } else {
+ $return = skippart("-else");
+ $return = process("-elseok") if ($return eq "else");
+ }
+ if ($return eq "next") {
+ $return = skippart();
+ m2c_die("unbalanced code detected while exiting next/2 (returned $return)") if ($return ne "end");
+# $return = "next";
+ last;
+ }
+ if (($return ne "end") && ($return ne "else")) {
+ m2c_die "unbalanced if / return $return\n";
+ }
+ } elsif (/\@\s*elseif.*\@/) { # bogus elseif
+ m2c_die "error: use 'elsif' instead of 'elseif'\n";
+ } elsif (/\@\s*els(e|if).*\@/) { # ELSE/ELSIF
+ if ($elseok != 1) {
+ chop $_;
+ m2c_die "unexpected els$1\n";
+ }
+ $return = skippart();
+ if ($return ne "end") {
+ m2c_die "unbalanced els$1 / rtn $rtn\n";
+ }
+ $return = "else";
+ last;
+ } elsif (/\@\s*next\s*\@/) { # NEXT
+ $return = skippart();
+ m2c_die "unbalanced code detected while exiting next/1 (returned $return)" if ($return ne "end");
+ $return = "next";
+ last;
+ } elsif (/\@\s*end\@/) { # END
+ $return = "end";
+ last;
+ } elsif (/\@\s*eval\s+\$(\w+)\s*=\s*([^\@]*)/) { # EVAL
+ my ($v, $e) = ($1, $2);
+# print STDERR "eval: $e\n";
+ my $e = process_vars($e);
+ $vars{$v} = eval($e);
+ if (!defined($vars{$v})) {
+ warn "$@";
+ warn "$currentfile:$currentline [$_]\n";
+ }
+ } elsif (/\@\s*perleval\s*(.*)\@/) { # PERLEVAL
+# print STDERR "perleval: $1\n";
+ my $res = eval($1);
+ if ($res) {
+ warn "$@";
+ warn "$currentfile:$currentline [$_]\n";
+ }
+ } elsif (/\@\s*startperl\s*\@/) { # STARTPERL
+ my $text;
+ while (get_next_line()) {
+ last if (/\@\s*endperl\s*\@/);
+ $text .= $_;
+ }
+ my $res = eval($text);
+ if ($res) {
+ warn "$@";
+ warn "$currentfile:$currentline [$_]\n";
+ }
+# print STDERR "perleval: $1\n";
+ } elsif (/\@\s*printf\s+(\"[^\"]+\")\s*,?(.*)\@/) { # PRINTF
+ my ($f, $rest) = ($1, $2);
+ $rest = process_vars($rest);
+ my @args = split(/\s*,\s*/,$rest);
+ $f = eval $f;
+# print STDERR "printf: $f, ", join(", ",@args),"\n";
+ foreach $file (values(%outputs)) {
+ printf $file (eval {$f}, @args);
+ }
+ } elsif (/\@\s*foreach\s+\$([^\@]+)\s+scalars*\s*\@/) { # SCALARS
+ my $var = $1;
+ my $stash = do_tell();
+ my $scalar;
+ my @thekeys = keys(%scalars);
+ if ($#thekeys == -1) {
+ $return = skippart();
+ } else {
+ if ($havenetsnmpoid) {
+ @thekeys = sort {
+ new NetSNMP::OID($a) <=>
+ new NetSNMP::OID($b) } @thekeys;
+ }
+ foreach $scalar (@thekeys) {
+ $return = do_a_loop($stash, \$vars{$var}, $scalar,
+ \$currentscalar, $scalar,
+ \$currentvar, $scalar);
+ }
+ }
+ m2c_die("foreach did not end with \@end@") if($return ne "end");
+ } elsif (/\@\s*foreach\s+\$([^\@]+)\s+notifications*\s*\@/) {
+ my $var = $1;
+ my $stash = do_tell();
+ my $notify;
+ my @thekeys = keys(%notifications);
+ if ($#thekeys == -1) {
+ $return = skippart();
+ } else {
+ if ($havenetsnmpoid) {
+ @thekeys = sort {
+ new NetSNMP::OID($a) <=>
+ new NetSNMP::OID($b) } @thekeys;
+ }
+ foreach $notify (@thekeys) {
+ $return = do_a_loop($stash, \$vars{$var}, $notify,
+ \$currentnotify, $notify);
+ }
+ }
+ m2c_die("foreach did not end with \@end@") if($return ne "end");
+ } elsif (/\@\s*foreach\s+\$([^\@]+)\s+varbinds\s*\@/) {
+ my $var = $1;
+ my $stash = do_tell();
+ my $varbind;
+ if ($#{$notifyvars{$currentnotify}} == -1) {
+ $return = skippart();
+ } else {
+ foreach $varbind (@{$notifyvars{$currentnotify}}) {
+ # print "looping on $var for $varbind\n";
+ $return = do_a_loop($stash, \$vars{$var}, $varbind,
+ \$currentvarbind, $varbind,
+ \$currentvar, $varbind);
+ }
+ }
+ m2c_die("foreach did not end with \@end@") if($return ne "end");
+ } elsif (/\@\s*foreach\s+\$([^\@]+)\s+tables*\s*\@/) {
+ my $var = $1;
+ my $stash = do_tell();
+ my $table;
+ my @thekeys = keys(%tables);
+ if ($#thekeys == -1) {
+ $return = skippart();
+ } else {
+ if ($havenetsnmpoid) {
+ @thekeys = sort {
+ new NetSNMP::OID($a) <=>
+ new NetSNMP::OID($b) } @thekeys;
+ }
+ foreach $table (@thekeys) {
+ $return = do_a_loop($stash, \$vars{$var}, $table,
+ \$currenttable, $table);
+ }
+ }
+ m2c_die("foreach did not end with \@end@ ($return)") if($return ne "end");
+ } elsif (/\@\s*foreach\s+\$([^\@]+)\s+stuff\s*(.*)\@/) {
+ my $var = $1;
+ my $stuff = $2;
+ my @stuff = split(/[,\s]+/, $stuff);
+ my $stash = do_tell();
+ if ($#stuff == -1) {
+ $return = skippart();
+ } else {
+ foreach $st (@stuff) {
+ $return = do_a_loop($stash, \$vars{$var}, $st,
+ \$currentstuff, $st);
+ }
+ }
+ m2c_die("foreach did not end with \@end@ ($return)") if($return ne "end");
+ } elsif (/\@\s*foreach\s+\$([^\@]+)\s+(column|index|internalindex|externalindex|nonindex)\s*\@/) {
+ my ($var, $type) = ($1, $2);
+ my $stash = do_tell();
+ my $column;
+ if ($#{$tables{$currenttable}{$type}} == -1) {
+ $return = skippart();
+ } else {
+ foreach $column (@{$tables{$currenttable}{$type}}) {
+ # print "looping on $var for $type -> $column\n";
+ $return = do_a_loop($stash, \$vars{$var}, $column,
+ \$currentcolumn, $column,
+ \$currentvar, $column);
+ }
+ }
+ m2c_die("foreach did not end with \@end@") if($return ne "end");
+ } elsif (/\@\s*foreach\s+\$([^\@]+)\s+\$([^\@]+)\s+range\s+([^\@]+)\@/) {
+ my ($svar, $evar, $node) = ($1, $2, $3);
+ $svar =~ s/,$//;
+ my $stash = do_tell();
+ my $range;
+ $node = $currentcolumn if (!$node);
+ my $mibn = $SNMP::MIB{process_vars($node)};
+ die "no such mib node: $node" if (!$mibn);
+ my @ranges = @{$mibn->{'ranges'}};
+ if ($#ranges > -1) {
+ foreach $range (@ranges) {
+ $return = do_a_loop($stash, \$vars{$svar}, $range->{'low'},
+ \$vars{$evar}, $range->{'high'});
+ }
+ } else {
+ $return = skippart();
+ }
+ m2c_die("foreach did not end with \@end@") if($return ne "end");
+ } elsif (/\@\s*foreach\s+\$([^\@,]+)\s*,*\s+\$([^\@]+)\s+(enums*)\s*\@/) {
+ my ($varvar, $varval, $type) = ($1, $2, $3);
+ my $stash = do_tell();
+ my $enum, $enum2;
+
+ my @keys = sort { $SNMP::MIB{$currentvar}{'enums'}{$a} <=>
+ $SNMP::MIB{$currentvar}{'enums'}{$b} } (keys(%{$SNMP::MIB{$currentvar}{'enums'}}));
+ if ($#keys > -1) {
+ foreach $enum (@keys) {
+ ($enum2 = $enum) =~ s/-/_/g;
+ $return = do_a_loop($stash, \$vars{$varvar}, $enum2,
+ \$vars{$varval},
+ $SNMP::MIB{$currentvar}{'enums'}{$enum});
+ }
+ } else {
+ $return = skippart();
+ }
+ m2c_die("foreach did not end with \@end@") if($return ne "end");
+ } elsif (/\@\s*while([a-z]*)\s+([^@]+)\@/) { # WHILE
+ my ($type,$arg,$ok) = ($1,$2,0);
+ my $stash = do_tell();
+ my $loop = 1;
+ my $everlooped = 0;
+
+ while ($loop) {
+ # check condition based on type
+ if (! $type) {
+ $ok = eval(process_vars($arg));
+ } elsif ($type eq conf) {
+ my $file = find_conf(process_vars($arg),1); # missingok
+ $ok = (-f $file);
+ } elsif ($type eq dir) {
+ $ok = (-d $arg);
+ } else {
+ m2c_die "unknown while modifier ($type)\n";
+ }
+
+ # act on condition
+ if ($ok) {
+ $return = do_a_loop($stash, \$vars{$type}, $ok, \$vars{$args});
+ $everlooped = 1;
+ } else {
+ if (!$everlooped) {
+ $return = skippart();
+ }
+ $loop = 0;
+ }
+ }
+ } elsif (/\@\s*prompt\s+\$(\S+)\s*(.*)\@/) { # PROMPT
+ my ($var, $prompt) = ($1, $2);
+ if (!$term) {
+ my $haveit = eval { require Term::ReadLine };
+ if ($haveit) {
+ $term = new Term::ReadLine 'mib2c';
+ }
+ }
+ if ($term) {
+ $vars{$var} = $term->readline(process_vars($prompt));
+ }
+ } elsif (/\@\s*print\s+([^@]*)\@/) { # PRINT
+ my $line = process_vars($1);
+ print "$line\n";
+ } else {
+ my $line = process_vars($_);
+ mib2c_output($line);
+ chop $_;
+ warn "$currentfile:$currentline contained a line that started with a @ but did not match any mib2c configuration tokens.\n";
+ warn "(maybe missing the trailing @?)\n";
+ warn "$currentfile:$currentline [$_]\n";
+ m2c_die if ($strict_unk_token == 1);
+ }
+# $return = "eof";
+ }
+ print "< Balanced $balanced / level $currentlevel / rtn $return / $_\n" if($debug);
+ if((!$_) && ($return ne "eof")) {
+# warn "switching return of '$return' to EOF\n" if($debug);
+ $return = "eof";
+ }
+ if ($balanced) {
+ if(($balanced != $currentlevel) || ($return ne "eof")) {
+ m2c_die "\@balanced@ specified, but processing terminated with '$return' before EOF!";
+ }
+ }
+ $currentlevel--;
+ return $return;
+}
+
+sub mib2c_output {
+ my $line = shift;
+ foreach $file (values(%outputs)) {
+ print $file "$line";
+ }
+}
+
+
+sub setup_data {
+ my $mib = shift;
+ if ($mib->{label} =~ /Table$/ && $#{$mib->{children}} != -1) {
+ my $tablename = $mib->{label};
+ my $entry = $mib->{children};
+ my $columns = $entry->[0]{children};
+ my $augments = $entry->[0]{'augments'};
+ foreach my $col (sort { $a->{'subID'} <=> $b->{'subID'} } @$columns) {
+ # store by numeric key so we can sort them later
+ push @{$tables{$tablename}{'column'}}, $col->{'label'};
+ }
+ if ($augments) {
+ my $mib = $SNMP::MIB{$augments} ||
+ die "can't find info about augmented table $augments in table $tablename\n";
+ $mib = $mib->{parent} ||
+ die "can't find info about augmented table $augments in table $tablename\n";
+ my $entry = $mib->{children};
+ foreach my $index (@{$entry->[0]{'indexes'}}) {
+ my $node = $SNMP::MIB{$index} ||
+ die "can't find info about index $index in table $tablename\n";
+ push @{$tables{$tablename}{'index'}}, $index;
+ push @{$tables{$tablename}{'externalindex'}}, $index;
+ }
+ my $columns = $entry->[0]{children};
+ }
+ else {
+ foreach my $index (@{$entry->[0]{'indexes'}}) {
+ my $node = $SNMP::MIB{$index} ||
+ die "can't find info about index $index in table $tablename\n";
+ push @{$tables{$tablename}{'index'}}, $index;
+ if("@{$tables{$tablename}{'column'}}" =~ /$index\b/ ) {
+# print "idx INT $index\n";
+ push @{$tables{$tablename}{'internalindex'}}, $index;
+ } else {
+# print "idx EXT $index\n";
+ push @{$tables{$tablename}{'externalindex'}}, $index;
+ }
+ }
+ }
+ foreach my $col (sort { $a->{'subID'} <=> $b->{'subID'} } @$columns) {
+ next if ( "@{$tables{$tablename}{'index'}}" =~ /$col->{'label'}\b/ );
+ push @{$tables{$tablename}{'nonindex'}}, $col->{'label'};
+ }
+# print "indexes: @{$tables{$tablename}{'index'}}\n";
+# print "internal indexes: @{$tables{$tablename}{'internalindex'}}\n";
+# print "external indexes: @{$tables{$tablename}{'externalindex'}}\n";
+# print "non-indexes: @{$tables{$tablename}{'nonindex'}}\n";
+ } else {
+ my $children = $mib->{children};
+ if ($#children == -1 && $mib->{type}) {
+ # scalar
+ if ($mib->{type} eq "NOTIF" ||
+ $mib->{type} eq "TRAP") {
+ my $notifyname = $mib->{label};
+ my @varlist = ();
+ $notifications{$notifyname} = 1;
+ $notifyvars{$notifyname} = $mib->{varbinds};
+ } else {
+ $scalars{$mib->{label}} = 1 if ($mib->{'access'} ne 'Notify');
+ }
+ } else {
+ my $i;
+ for($i = 0; $i <= $#$children; $i++) {
+ setup_data($children->[$i]);
+ }
+ }
+ }
+}
+
+sub min {
+ return $_[0] if ($_[0] < $_[1]);
+ return $_[1];
+}
+
+sub max {
+ return $_[0] if ($_[0] > $_[1]);
+ return $_[1];
+}
+
+sub find_conf {
+ my ($configfile, $missingok) = (@_);
+
+ foreach my $d (@search_dirs, @def_search_dirs) {
+# print STDERR "using $d/$configfile" if (-f "$d/$configfile");
+ return "$d/$configfile" if (-f "$d/$configfile");
+ }
+ return $configfile if (-f "$configfile");
+ return if ($missingok);
+
+ print STDERR "Can't find a configuration file called $configfile\n";
+ print STDERR "(referenced at $currentfile:$currentline)\n" if ($currentfile);
+ print STDERR "I looked in:\n";
+ print " " . join("\n ", @search_dirs, @def_search_dirs), "\n";
+ exit 1;
+}
+
+sub open_conf {
+ my $configfile = shift;
+# process .conf file
+ if (! -f "$configfile") {
+ print STDERR "Can't find a configuration file called $configfile\n";
+ exit 1;
+ }
+ $currentfile = $configfile;
+ my $fh = new IO::File;
+ $fh->open("$configfile");
+ return $fh;
+}
+
+sub count_scalars {
+ my @k = keys(%scalars);
+ return $#k + 1;
+}
+
+sub count_tables {
+ my @k = keys(%tables);
+ return $#k + 1;
+}
+
+sub count_columns {
+ my $table = shift;
+ return $#{$tables{$table}{'column'}} + 1;
+}
+
+sub table_is_writable {
+ my $table = shift;
+ my $column;
+ my $result = 0;
+ foreach $column (@{$tables{$table}{'column'}}) {
+ if($SNMP::MIB{$column}{access} =~ /(ReadWrite|Create|WriteOnly)/) {
+ $result = 1;
+ last;
+ }
+ }
+ return $result;
+}
+
+sub table_has_create {
+ my $table = shift;
+ my $column;
+ my $result = 0;
+ foreach $column (@{$tables{$table}{'column'}}) {
+ if($SNMP::MIB{$column}{access} =~ /(Create)/) {
+ $result = 1;
+ last;
+ }
+ }
+ return $result;
+}
+
+sub table_has_rowstatus {
+ my $table = shift;
+ my $column;
+ my $result = 0;
+ foreach $column (@{$tables{$table}{'column'}}) {
+ if($SNMP::MIB{$column}{syntax} =~ /(RowStatus)/) {
+ $result = 1;
+ last;
+ }
+ }
+ return $result;
+}
+
+sub table_has_lastchange {
+ my $table = shift;
+ my $column;
+ my $result = 0;
+ foreach $column (@{$tables{$table}{'column'}}) {
+ if(($SNMP::MIB{$column}{syntax} =~ /(TimeStamp)/) &&
+ ($SNMP::MIB{$column}{label} =~ /(LastChange)/)) {
+ $result = 1;
+ last;
+ }
+ }
+ return $result;
+}
+
+sub table_has_storagetype {
+ my $table = shift;
+ my $column;
+ my $result = 0;
+ foreach $column (@{$tables{$table}{'column'}}) {
+ if($SNMP::MIB{$column}{syntax} =~ /(StorageType)/) {
+ $result = 1;
+ last;
+ }
+ }
+ return $result;
+}
+
+sub count_indexes {
+ my $table = shift;
+ return $#{$tables{$table}{'index'}} + 1;
+}
+
+sub count_external_indexes {
+ my $table = shift;
+ return $#{$tables{$table}{'externalindex'}} + 1;
+}
+
+sub count_notifications {
+ my @k = keys(%notifications);
+ return $#k + 1;
+}
+
+sub count_varbinds {
+ my $notify = shift;
+ return $#{$notifyvars{$notify}} + 1;
+}
diff --git a/local/mib2c-conf.d/default-mfd-top.m2c b/local/mib2c-conf.d/default-mfd-top.m2c
new file mode 100644
index 0000000..c2e2964
--- /dev/null
+++ b/local/mib2c-conf.d/default-mfd-top.m2c
@@ -0,0 +1,141 @@
+########################################################################
+##
+## DEFAULTS (no blank lines allowed)
+##
+########################################################################
+## mark boundarys
+@if "x$m2c_mark_boundary" eq "x"@
+@ eval $m2c_mark_boundary = 0@
+@end@
+##
+@if "x$mfd_readme_verbose" eq "x"@
+@ eval $mfd_readme_verbose = 1@
+@end@
+@if "x$m2c_create_fewer_files" eq "x"@
+@ eval $m2c_create_fewer_files = 0@
+@end@
+@if "x$mfd_processing_types" eq "x"@
+@ eval $mfd_processing_types = "#"@
+@end@
+@if "x$m2c_code_verbose" eq "x"@
+@ eval $m2c_code_verbose = 0@
+@end@
+@if "x$m2c_defaults_dir" eq "x"@
+@ eval $m2c_defaults_dir = "defaults/"@
+@end@
+########################################################################
+## enum constants upper or lower case? (NODE_NAME vs node_name)
+@if "x$m2c_const_lc" eq "x"@
+@ eval $m2c_const_lc = 0@
+@end@
+##
+########################################################################
+## prefix for all enums (NODE_NAME vs XYZ_NODE_NAME)
+@if "x$m2c_const_pfx" eq "x"@
+@ eval $m2c_const_pfx = ""@ # or "XYZ_"
+@end@
+##
+########################################################################
+## use temporary values in get routines, or direct pointers?
+@if "x$m2c_get_use_temp" eq "x"@
+@ eval $m2c_get_use_temp = 0@
+@end@
+##
+########################################################################
+########################################################################
+##
+## CODING STYLE
+##
+########################################################################
+########################################################################
+## allow for different style enums (#define vs const)
+@if "x$m2c_const_dcl" eq "x"@
+@ eval $m2c_const_dcl = "#define"@ # or "const int"
+@end@
+@if "m2c_const_del" eq "x"@
+@ eval $m2c_const_del = ""@ # or "="
+@end@
+@if "x$m2c_const_sfx" eq "x"@
+@ eval $m2c_const_sfx = ""@ # or ";"
+@end@
+##
+## set defaults for mfd
+##
+@if "x$user_mfd_default_table_access" eq "x" @
+@ eval $mfd_default_table_access = "container-cached"@
+@else@
+@ eval $mfd_default_table_access = "$user_mfd_default_table_access"@
+@end@
+##
+@if "x$user_mfd_default_table_skip_mapping" eq "x" @
+@ eval $mfd_default_table_skip_mapping = 1@
+@else@
+@ eval $mfd_default_table_skip_mapping = $user_mfd_default_table_skip_mapping@
+@end@
+##
+@if "x$user_mfd_default_data_context" eq "x" @
+@ eval $mfd_default_data_context = "generated"@
+@else@
+@ eval $mfd_default_data_context = "$user_mfd_default_data_context"@
+@end@
+##
+@if "x$user_mfd_default_context_reg" eq "x" @
+@ eval $mfd_default_context_reg = "netsnmp_data_list"@
+@else@
+@ eval $mfd_default_context_reg = "$user_mfd_default_context_reg"@
+@end@
+##
+@if "x$user_mfd_default_data_allocate" eq "x" @
+@ eval $mfd_default_data_allocate = 0@
+@else@
+@ eval $mfd_default_data_allocate = $user_mfd_default_data_allocate@
+@end@
+##
+@if "x$user_mfd_default_data_cache" eq "x" @
+@ eval $mfd_default_data_cache = 1@
+@else@
+@ eval $mfd_default_data_cache = $user_mfd_default_data_cache@
+@end@
+##
+@if "x$user_mfd_default_data_sparse" eq "x" @
+@ eval $mfd_default_data_sparse = 0@
+@else@
+@ eval $mfd_default_data_sparse = $user_mfd_default_data_sparse@
+@end@
+@if "x$user_mfd_default_undo_embed" eq "x" @
+@ eval $mfd_default_undo_embed = 0@
+@else@
+@ eval $mfd_default_undo_embed = $user_mfd_default_undo_embed@
+@end@
+##
+@if "x$user_mfd_default_data_init" eq "x" @
+@ eval $mfd_default_data_init = 1@
+@else@
+@ eval $mfd_default_data_init = $user_mfd_default_data_init@
+@end@
+##
+@if "x$user_mfd_default_data_transient" eq "x" @
+@ eval $mfd_default_data_transient = 2@ # TRANSIENT
+@else@
+@ eval $mfd_default_data_transient = $user_mfd_default_data_transient@
+@end@
+##
+@if "x$user_mfd_default_include_examples" eq "x" @
+@ eval $mfd_default_include_examples = 1@
+@else@
+@ eval $mfd_default_include_examples = $user_mfd_default_include_examples@
+@end@
+@if "x$m2c_data_cache" eq "x"@
+@ eval $m2c_data_cache = 0@
+@end@
+##
+@if "x$user_mfd_default_generate_makefile" eq "x" @
+@ eval $mfd_default_generate_makefile = 0@
+@else@
+@ eval $mfd_default_generate_makefile = $user_mfd_default_generate_makefile@
+@end@
+@if "x$user_mfd_default_generate_subagent" eq "x" @
+@ eval $mfd_default_generate_subagent = 0@
+@else@
+@ eval $mfd_default_generate_subagent = $user_mfd_default_generate_subagent@
+@end@
diff --git a/local/mib2c-conf.d/details-enums.m2i b/local/mib2c-conf.d/details-enums.m2i
new file mode 100644
index 0000000..3b0f152
--- /dev/null
+++ b/local/mib2c-conf.d/details-enums.m2i
@@ -0,0 +1,80 @@
+############################################################# -*- c -*-
+## generic include for enums. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+@ifconf $node.syntax.m2i@
+@ include $node.syntax.m2i@
+@else@
+##
+## Generating enums
+##
+## Examples:
+##
+## enums syntax perltype net-snmp type cdecl m2c_decl
+## ----- -------- -------- ------------- ----- -------
+## 1 SomeTC BITS ASN_OCTET_STR char u_long
+## 1 INTEGER INTEGER ASN_INTEGER long u_long
+## 1 RowStatus INTEGER ASN_INTEGER long u_long
+##
+/*************************************************************
+ * constants for enums for the MIB node
+ * $node ($node.syntax / $node.type)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+##
+#ifndef ${m2c_de_pfx}_ENUMS
+#define ${m2c_de_pfx}_ENUMS
+
+@ eval $m2c_mask=""@
+@ foreach $e $v enum@
+@ include m2c_setup_enum.m2i@
+@ if "$node.perltype" eq "BITS"@
+@ if $v > 31@
+@ print ** ACK! I cannot handle BITS longer than 4 bytes!@
+@ exit@
+@ end@
+@ if "x$m2c_mask" eq "x"@
+@ eval $m2c_mask="$m2c_ename"@
+@ else@
+@ eval $m2c_mask="$m2c_mask | $m2c_ename"@
+@ end@
+$m2c_const_dcl $m2c_ename $m2c_const_del (1 << (31-$v)) $m2c_const_sfx
+@ else@
+$m2c_const_dcl $m2c_ename $m2c_const_del $v $m2c_const_sfx
+@ end@
+@ end@ # for each
+
+#endif /* ${m2c_de_pfx}_ENUMS */
+
+@ if "$node.perltype" eq "BITS"@
+$m2c_const_dcl $m2c_enum_mask $m2c_const_del ($m2c_mask)
+
+@ end@
+@ if ($m2c_node_skip_mapping != 1) && ($node.enums == 1)@
+ /*
+ * TODO:140:o: Define your interal representation of $node enums.
+ * (used for value mapping; see notes at top of file)
+ */
+@ foreach $e $v enum@
+@ include m2c_setup_enum.m2i@
+@ if ("$node.perltype" ne "BITS")@
+$m2c_const_dcl INTERNAL_$context.uc_$m2c_iname $m2c_const_del $v $m2c_const_sfx
+@ else@
+$m2c_const_dcl INTERNAL_$context.uc_$m2c_iname $m2c_const_del (0x01 << $v) $m2c_const_sfx
+@ end@
+@ end@ // foreach
+
+@ end@ // skip mapping / enums
+
+@end@ # ! syntax include
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/details-node.m2i b/local/mib2c-conf.d/details-node.m2i
new file mode 100644
index 0000000..0f3e2a2
--- /dev/null
+++ b/local/mib2c-conf.d/details-node.m2i
@@ -0,0 +1,102 @@
+############################################################# -*- c -*-
+## Generic include for columns. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+/*---------------------------------------------------------------------
+ * $node.module::$node.parent.$node
+ * $node is subid $node.subid of $node.parent.
+ * Its status is $node.status, and its access level is $node.access.
+ * OID: $node.objectID
+ * Description:
+$node.description
+ *
+@if $m2c_node_detail == 1@
+ * node -- name $node
+ * node.parent -- label of the parent $node.parent
+ * node.objectID -- dotted full OID $node.objectID
+ * node.commaoid -- comma separated OID $node.commaoid
+ * node.subid -- last oid component $node.subid
+ * node.oidlength-- length of the oid $node.oidlength
+ * node.syntax -- node's syntax $node.syntax
+ * node.perltype -- node's perl type $node.perltype
+ * node.type -- node's ASN_XXX type $node.type
+ * node.decl -- C data type $m2c_decl ($node.decl)
+ * node.settable -- 1 if it's writable $node.settable
+ * node.noaccess -- 1 if not-accessible $node.noaccess
+ * node.access -- node's access type $node.access
+ * node.status -- node's status $node.status
+ * node.isscalar -- returns 1 if scalar $node.isscalar
+ * node.iscolumn -- returns 1 if column $node.iscolumn
+ * node.enums -- $node.enums
+ *
+@end@
+ * Attributes:
+ * accessible $node.accessible isscalar $node.isscalar enums $node.enums hasdefval $node.hasdefval
+ * readable $node.readable iscolumn $node.iscolumn ranges $node.ranges hashint $node.hashint
+ * settable $node.settable
+@if $node.hasdefval == 1@
+ * defval: $node.defval
+@end@
+@if $node.hashint == 1@
+ * hint: $node.hint
+@end@
+ *
+@if $node.enums == 1@
+@ eval $m2c_evals = ""@
+@ eval $m2c_first = 1@
+@ foreach $e $v enum@
+@ if $m2c_first == 1@
+@ eval $m2c_first = 0@
+@ else@
+@ eval $m2c_evals = "$m2c_evals,"@
+@ end@
+@ eval $m2c_evals = "$m2c_evals $e($v)"@
+@ end@
+ * Enum range: $node.enumrange. Values: $m2c_evals
+@elsif $node.ranges == 1@
+@ eval $m2c_range_max = 0@
+@ eval $m2c_evals = ""@
+@ eval $m2c_first = 1@
+@ foreach $a $b range $node@
+@ if $m2c_first == 1@
+@ eval $m2c_first = 0@
+@ else@
+@ eval $m2c_evals = "$m2c_evals,"@
+@ end@
+@ if $a == $b@
+@ eval $m2c_evals = "$m2c_evals $a"@
+@ else@
+@ eval $m2c_evals = "$m2c_evals $a - $b"@
+@ end@
+@ eval $m2c_range_max = max($m2c_range_max,$b)@
+@ end@
+ * Ranges: $m2c_evals;
+@end@ #ranges
+ *
+ * Its syntax is $node.syntax (based on perltype $node.perltype)
+ * The net-snmp type is $node.type. The C type decl is $node.decl ($m2c_decl)
+@if $node.needlength == 1@
+@ if $node.ranges == 1@
+ * This data type requires a length. (Max $m2c_range_max)
+@ else@
+ * This data type requires a length.
+@ end@
+@end@
+@if $node.noaccess@
+ *
+ *
+ *
+ * NOTE: NODE $node IS NOT ACCESSIBLE
+ *
+ *
+@end@
+ */
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/details-table.m2i b/local/mib2c-conf.d/details-table.m2i
new file mode 100644
index 0000000..06df7ef
--- /dev/null
+++ b/local/mib2c-conf.d/details-table.m2i
@@ -0,0 +1,25 @@
+############################################################# -*- c -*-
+## generic include for tables. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table $context
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * $context.module::$context is subid $context.subid of $context.parent.
+ * Its status is $context.status.
+ * OID: $context.objectID, length: $context.oidlength
+*/
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-ctx-copy.m2i b/local/mib2c-conf.d/generic-ctx-copy.m2i
new file mode 100644
index 0000000..c959637
--- /dev/null
+++ b/local/mib2c-conf.d/generic-ctx-copy.m2i
@@ -0,0 +1,33 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+ /*
+@if $m2c_node_needlength == 1@
+ * copy $node and ${node}_len data
+@else@
+ * copy $node data
+@end@
+ * set ${m2c_ctx_lh} from ${m2c_ctx_rh}
+ */
+@if ($m2c_include_examples != 0) || ("$m2c_data_context" eq "generated")@
+@ if $m2c_node_needlength == 0@
+ ${m2c_ctx_lh} = ${m2c_ctx_rh};
+@ else@
+ memcpy( ${m2c_ctx_lh}, ${m2c_ctx_rh},
+ (${m2c_ctx_rhs} * sizeof(${m2c_ctx_lh}[0])));
+ ${m2c_ctx_lhs} = ${m2c_ctx_rhs};
+@ end@ # need length
+@end@
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-ctx-get.m2i b/local/mib2c-conf.d/generic-ctx-get.m2i
new file mode 100644
index 0000000..ef795c3
--- /dev/null
+++ b/local/mib2c-conf.d/generic-ctx-get.m2i
@@ -0,0 +1,106 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##/*
+## This include will generate the code needed to assign data from
+## a generated data context to a parameter reference.
+##
+## EXAMPLE (prototype generated elsewhere)
+## int
+## ifName_get(ifXTable_ctx * ctx, char **ifName_ptr_ptr,
+## size_t * ifName_len_ptr) {
+##
+##
+## m2c_node_lh : temp_ifName / (*ifName_ptr_ptr)
+## m2c_node_lhs: temp_ifName_len / (*ifName_len_ptr);
+## m2c_ctx_rh : ctx->data.
+## node : ifName
+##
+## if (temp_ifName_len < ctx->data.ifName_len) {
+## temp_ifName = malloc(ctx->data.ifName_len);
+## }
+## temp_ifName_len = ctx->data.ifName_len;
+## memcpy(temp_ifName, ctx->data.ifName, temp_ifName_len);
+##*/
+@if "$m2c_data_context" ne "generated"@
+ /** WARNING: this code might not work for $m2c_data_context */
+@end@
+##/* set up for length/copy conversions for various cases.
+## length mod applies to left hand side. copy mod applies to right hand side
+##
+##*/
+@if ("$m2c_ctx_rhu" ne "elements") && ("$m2c_ctx_rhu" ne "bytes")@
+@ print Invalid rh units '$m2c_ctx_rhu'@
+@ exit@
+@end@
+@if ("$m2c_ctx_lhu" ne "elements") && ("$m2c_ctx_lhu" ne "bytes")@
+@ print Invalid lh units '$m2c_ctx_lhu'@
+@ exit@
+@end@
+@if "$m2c_ctx_rhu" ne "$m2c_ctx_lhu"@
+##/* elements = bytes, length mod="/sizeof", copy mult="" */
+@ if "$m2c_ctx_lhu" eq "elements"@
+@ eval $m2c_ctx_lm = "/ sizeof($m2c_ctx_rh[0])"@
+@ eval $m2c_ctx_cm = ""@
+@ else@
+##/* bytes = elements, length mod="*sizeof", copy mult="sizeof" */
+@ eval $m2c_ctx_lm = "* sizeof($m2c_ctx_rh[0])"@
+@ eval $m2c_ctx_cm = "* sizeof($m2c_ctx_rh[0])"@
+@ end@
+@else@
+##/* elements = elements, length mod="", copy mult="sizeof" */
+@ if "$m2c_ctx_lhu" eq "elements"@
+@ eval $m2c_ctx_lm = ""@
+@ eval $m2c_ctx_cm = "* sizeof($m2c_ctx_rh[0])"@
+@ else@
+##/* bytes = bytes, length mod="", copy mult="" */
+@ eval $m2c_ctx_lm = ""@
+@ eval $m2c_ctx_cm = ""@
+@ end@
+@end@
+@if $m2c_node_needlength == 1@
+ /*
+ * make sure there is enough space for $node data
+ */
+ if ((NULL == $m2c_ctx_lh) ||
+ ($m2c_ctx_lhs <
+ ($m2c_ctx_rhs$m2c_ctx_lm))) {
+@ if $m2c_node_realloc == 0@
+ snmp_log(LOG_ERR,"not enough space for value ($m2c_ctx_rh)\n");
+ return MFD_ERROR;
+@ else@
+ /*
+ * allocate space for $node data
+ */
+@ if $m2c_node_realloc == 1@
+ $m2c_ctx_lh = realloc($m2c_ctx_lh, $m2c_ctx_rhs$m2c_ctx_cm );
+@ else@
+ $m2c_ctx_lh = malloc($m2c_ctx_rhs$m2c_ctx_cm);
+@ end@
+ if(NULL == $m2c_ctx_lh) {
+ snmp_log(LOG_ERR,"could not allocate memory ($m2c_ctx_rh)\n");
+ return MFD_ERROR;
+ }
+@ end@
+ }
+ $m2c_ctx_lhs = $m2c_ctx_rhs$m2c_ctx_lm;
+ memcpy( $m2c_ctx_lh, $m2c_ctx_rh, $m2c_ctx_rhs$m2c_ctx_cm );
+@else@
+@ if $node.decl =~ /U64/i@ # ASN_COUNTER64
+ ${m2c_ctx_lh}.high = ${m2c_ctx_rh}.high;
+ ${m2c_ctx_lh}.low = ${m2c_ctx_rh}.low;
+@ else@
+ $m2c_ctx_lh = $m2c_ctx_rh;
+@ end@
+@end@ # length
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-ctx-set.m2i b/local/mib2c-conf.d/generic-ctx-set.m2i
new file mode 100644
index 0000000..86c99a0
--- /dev/null
+++ b/local/mib2c-conf.d/generic-ctx-set.m2i
@@ -0,0 +1,29 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+ /*
+ * TODO:461:M: |-> Set $node value.
+ * set $node value in $m2c_data_item_base
+ */
+@if ($m2c_include_examples != 0) || ("$m2c_data_context" eq "generated")@
+@ if $m2c_node_needlength == 0@
+ ${m2c_data_item}$node = $m2c_node_srh;
+@ else@
+ memcpy( ${m2c_data_item}$node, $m2c_node_srh, $m2c_node_srhs );
+ /** convert bytes to number of $m2c_decl */
+ ${m2c_data_item}${node}_len = $m2c_node_srhs / sizeof(${m2c_node_srh}[0]);
+@ end@ # need length
+@end@
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-data-allocate.m2i b/local/mib2c-conf.d/generic-data-allocate.m2i
new file mode 100644
index 0000000..556defe
--- /dev/null
+++ b/local/mib2c-conf.d/generic-data-allocate.m2i
@@ -0,0 +1,62 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+/*
+ * ${context}_allocate_data
+ *
+ * Purpose: create new ${context}_data.
+ */
+${context}_data *
+${context}_allocate_data(void)
+{
+@if $m2c_gda_todo_suppress != 1@
+ /*
+ * TODO:201:r: |-> allocate memory for the $context data context.
+ */
+@end@
+@if $m2c_data_context != "generated"@
+ /** this might not be right for $m2c_data_context */
+@end@
+ ${context}_data *rtn = SNMP_MALLOC_TYPEDEF(${context}_data);
+
+ DEBUGMSGTL(("verbose:${context}:${context}_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "${context}_data.\n");
+ }
+
+ return rtn;
+} /* ${context}_allocate_data */
+
+/*
+ * ${context}_release_data
+ *
+ * Purpose: release ${context} data.
+ */
+void
+${context}_release_data(${context}_data *data)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_release_data","called\n"));
+
+@if $m2c_gda_todo_suppress != 1@
+ /*
+ * TODO:202:r: |-> release memory for the $context data context.
+ */
+@end@
+ free(data);
+} /* ${context}_release_data */
+
+@eval $m2c_gda_todo_suppress = 0@ # reset
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-data-context.m2i b/local/mib2c-conf.d/generic-data-context.m2i
new file mode 100644
index 0000000..4152e91
--- /dev/null
+++ b/local/mib2c-conf.d/generic-data-context.m2i
@@ -0,0 +1,51 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review ${context} data context structure.
+ * This structure is used to represent the data for $context.
+ */
+##
+@if "$m2c_data_context" eq "generated"@
+/*
+ * This structure contains storage for all the columns defined in the
+ * $context.
+ */
+typedef struct ${context}_data_s {
+
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+ /*
+ * $m2c_node_summary
+ */
+@ if $m2c_node_needlength == 0@
+ $m2c_decl $node;
+@ else@
+ $m2c_decl $node[$m2c_node_maxlen];
+size_t ${node}_len; /* # of $m2c_decl elements, not bytes */
+@ end@
+
+@ end@ # foreach nonindex
+} ${context}_data;
+@elsif "$m2c_data_context" eq "unknown"@
+ /*
+ * update typedef to correct pointer type.
+ * (or add @eval $@m2c_data_context = "TYPE"@ and regenerate code) */
+typedef void ${context}_data;
+@else@
+typedef $m2c_data_context ${context}_data;
+@end@
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-get-U64.m2i b/local/mib2c-conf.d/generic-get-U64.m2i
new file mode 100644
index 0000000..791c79e
--- /dev/null
+++ b/local/mib2c-conf.d/generic-get-U64.m2i
@@ -0,0 +1,14 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-get-char.m2i b/local/mib2c-conf.d/generic-get-char.m2i
new file mode 100644
index 0000000..e63e686
--- /dev/null
+++ b/local/mib2c-conf.d/generic-get-char.m2i
@@ -0,0 +1,49 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+## enums first
+@if $m2c_node_skip_mapping == -1@
+@ eval $m2c_node_skip_mapping = 1@
+@end@
+@if ($node.enums == 1) && ("$node.perltype" eq "BITS")@
+ /*
+ * TODO:242:o: update or replace BITS tests (get).
+ * If $node data is stored in SNMP BIT order, individual
+ * bit tests are redundant, and you can do a straight copy. If not, then
+ * update each if condition to test the correct bit.
+ *
+ * NOTE WELL: setting bit '0' for:
+ * C 0x0000001
+ * SNMP 0x8000000
+ *
+@ if $m2c_node_skip_mapping != 1@
+ * define correct bit to test for all INTERNAL_* defines in the
+ * ${context} enum or contants header file.
+ */
+$example_start
+ $m2c_node_lh = 0;
+@ foreach $e $v enum@
+@ include m2c_setup_enum.m2i@
+ if ($m2c_ctx_rh & INTERNAL_$context.uc_$m2c_iname) {
+ $m2c_node_lh |= $m2c_ename;
+ }
+@ end@ # for each
+$example_end
+@ else@
+ * assuming generated code keeps $node BITS in SNMP order.
+ */
+ $m2c_node_lh = @m2c_ctx_rh;
+@ end@
+@end@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-get-decl-bot.m2i b/local/mib2c-conf.d/generic-get-decl-bot.m2i
new file mode 100644
index 0000000..32b4e68
--- /dev/null
+++ b/local/mib2c-conf.d/generic-get-decl-bot.m2i
@@ -0,0 +1,22 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@if $m2c_get_use_temp == 1@
+ /* copy temporary value to passed parameter */
+ (* $m2c_node_param_ref_name) = $m2c_node_lh;
+@ if $m2c_node_needlength == 1@
+ (* $m2c_node_param_ref_lname) = $m2c_node_lhs;
+@ end@
+@end@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-get-decl.m2i b/local/mib2c-conf.d/generic-get-decl.m2i
new file mode 100644
index 0000000..0568e1c
--- /dev/null
+++ b/local/mib2c-conf.d/generic-get-decl.m2i
@@ -0,0 +1,43 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@if $m2c_get_use_temp == 1@
+ /*
+ * Define temporary variable(s). If speed/efficency is an issue,
+ * remove this code and deal with the pointer directly.
+ * (set $@m2c_get_use_temp = 0 in your conf file to turn off)
+ */
+@ if $m2c_node_needlength == 1@
+ $m2c_decl * $m2c_node_lh;
+ size_t $m2c_node_lhs;
+@ else@
+ $m2c_decl $m2c_node_lh;
+@ end@
+
+@end@
+@if $m2c_node_needlength == 1@
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != $m2c_node_param_ref_name) && (NULL != *$m2c_node_param_ref_name));
+ netsnmp_assert( NULL != $m2c_node_param_ref_lname );
+@else@
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != $m2c_node_param_ref_name );
+@end@
+
+@if ($m2c_get_use_temp == 1) && ($m2c_node_needlength == 1)@
+ $m2c_node_lh = (* $m2c_node_param_ref_name);
+ $m2c_node_lhs = (* $m2c_node_param_ref_lname);
+
+@end@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-get-long.m2i b/local/mib2c-conf.d/generic-get-long.m2i
new file mode 100644
index 0000000..791c79e
--- /dev/null
+++ b/local/mib2c-conf.d/generic-get-long.m2i
@@ -0,0 +1,14 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-get-oid.m2i b/local/mib2c-conf.d/generic-get-oid.m2i
new file mode 100644
index 0000000..56dd485
--- /dev/null
+++ b/local/mib2c-conf.d/generic-get-oid.m2i
@@ -0,0 +1,18 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@if $m2c_node_skip_mapping == -1@
+@ eval $m2c_node_skip_mapping = 0@
+@end@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-header-bottom.m2i b/local/mib2c-conf.d/generic-header-bottom.m2i
new file mode 100644
index 0000000..e00e174
--- /dev/null
+++ b/local/mib2c-conf.d/generic-header-bottom.m2i
@@ -0,0 +1,21 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* $name.uc_H */
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-header-top.m2i b/local/mib2c-conf.d/generic-header-top.m2i
new file mode 100644
index 0000000..a4d3bd8
--- /dev/null
+++ b/local/mib2c-conf.d/generic-header-top.m2i
@@ -0,0 +1,22 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+#ifndef $name.uc_H
+#define $name.uc_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-source-includes.m2i b/local/mib2c-conf.d/generic-source-includes.m2i
new file mode 100644
index 0000000..9341cf9
--- /dev/null
+++ b/local/mib2c-conf.d/generic-source-includes.m2i
@@ -0,0 +1,24 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "${name}.h"
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-table-constants.m2c b/local/mib2c-conf.d/generic-table-constants.m2c
new file mode 100644
index 0000000..36e23d3
--- /dev/null
+++ b/local/mib2c-conf.d/generic-table-constants.m2c
@@ -0,0 +1,44 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_create_fewer_files != 1@
+@ foreach $table table@
+@ include m2c_setup_table.m2i@
+@ run generic-table-oids.m2c@
+@ run generic-table-enums.m2c@
+@ end@ # table
+########################################################################
+@else@
+@ eval $hack = "Id"@
+@ eval $m2c_save = "$name"@
+@ eval $name = "${m2c_save}_constants"@
+@ open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ *
+ * $$hack:$
+ */
+########################################################################
+@ if $m2c_mark_boundary == 1@
+/** START header generated by $RCSfile$ $Revision$ */
+@ end@
+########################################################################
+@ include generic-header-top.m2i@
+@ eval $name = "$m2c_save"@
+@ foreach $table table@
+@ include m2c_setup_table.m2i@
+@ include generic-table-oids.m2c@
+@ include generic-table-enums.m2c@
+@ end@ # table
+@ eval $m2c_save = "$name"@
+@ eval $name = "${m2c_save}_oids"@
+@ include generic-header-bottom.m2i@
+@ eval $name = "$m2c_save"@
+########################################################################
+@ if $m2c_mark_boundary == 1@
+/** END header generated by $RCSfile$ $Revision$ */
+@ end@
+@end@ // m2c_create_fewer_files
diff --git a/local/mib2c-conf.d/generic-table-enums.m2c b/local/mib2c-conf.d/generic-table-enums.m2c
new file mode 100644
index 0000000..92b2132
--- /dev/null
+++ b/local/mib2c-conf.d/generic-table-enums.m2c
@@ -0,0 +1,63 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_create_fewer_files != 1@
+@eval $hack = "Id"@
+@eval $m2c_save = "$name"@
+@eval $name = "${name}_enums"@
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ *
+ * $$hack:$
+ */
+@include generic-header-top.m2i@
+@eval $name = "$m2c_save"@
+@end@ // m2c_create_fewer_files
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START header generated by $RCSfile$ $Revision$ */
+@end@
+##
+ /*
+ * 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 $context
+ *
+ *************************************************************************
+ *************************************************************************/
+
+@ foreach $node column@
+@ include m2c_setup_node.m2i@
+@ if $node.enums == 1@
+@ include details-enums.m2i@
+@ end@
+@ end@ # column
+
+@if $m2c_create_fewer_files != 1@
+@eval $m2c_save = "$name"@
+@eval $name = "${name}_enums"@
+@include generic-header-bottom.m2i@
+@eval $name = "$m2c_save"@
+@end@
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END header generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-table-indexes-from-oid.m2i b/local/mib2c-conf.d/generic-table-indexes-from-oid.m2i
new file mode 100644
index 0000000..758bda2
--- /dev/null
+++ b/local/mib2c-conf.d/generic-table-indexes-from-oid.m2i
@@ -0,0 +1,70 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+/**
+ * extract ${context} indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+${context}_index_from_oid(netsnmp_index *oid_idx,
+ ${context}_mib_index *mib_idx)
+{
+@include generic-table-indexes-varbind-setup.m2i@
+
+ DEBUGMSGTL(("verbose:${context}:${context}_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_$m2c_dii_first );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+@ eval $m2c_node_name = ""@ # purge node name to re-eval $m2c_node_var_name
+@ foreach $node index@
+@ eval $m2c_node_var_name = "var_${node}."@
+@ include m2c_setup_node.m2i@
+@ if $m2c_node_needlength == 1@
+ /*
+ * NOTE: val_len is in bytes, ${node}_len might not be
+ */
+ if(var_${node}.val_len > sizeof(mib_idx->$node))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->${node}, var_${node}.val.string, var_${node}.val_len);
+ mib_idx->${node}_len = var_${node}.val_len / sizeof(mib_idx->${node}[0]);
+ }
+@ else@
+ mib_idx->$node = $m2c_node_var_val;
+@ end@
+@ end@ # foreach
+@ eval $m2c_node_var_name = ""@ #reset custom name
+@ eval $m2c_node_name = ""@ # purge node name to re-eval $m2c_node_var_name
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_$m2c_dii_first );
+
+ return err;
+} /* ${context}_index_from_oid */
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-table-indexes-set.m2i b/local/mib2c-conf.d/generic-table-indexes-set.m2i
new file mode 100644
index 0000000..34f9c7d
--- /dev/null
+++ b/local/mib2c-conf.d/generic-table-indexes-set.m2i
@@ -0,0 +1,123 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@eval $gtis_tmp=""@
+@foreach $node index@
+@ include m2c_setup_node.m2i@
+@ eval $gtis_tmp="$gtis_tmp, $m2c_node_param_val"@
+@end@ # for each index
+########################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'h'@
+
+int ${context}_indexes_set_tbl_idx(${context}_mib_index *tbl_idx$gtis_tmp);
+int ${context}_indexes_set(${context}_rowreq_ctx *rowreq_ctx$gtis_tmp);
+
+@end@ // m2c_processing_type eq 'h'
+########################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'c'@
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+@foreach $node index@
+@ if $node.needlength == 1@
+ * @param ${node}_ptr
+ * @param ${node}_ptr_len
+@else@
+ * @param ${node}_val
+@end@
+@end@
+ *
+ * @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
+${context}_indexes_set_tbl_idx(${context}_mib_index *tbl_idx$gtis_tmp)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_indexes_set_tbl_idx","called\n"));
+
+@foreach $node index@
+@ include m2c_setup_node.m2i@
+## table indexes are not allocated pointers, so do not allow realloc here
+@eval $m2c_node_realloc = 0@ // fail
+ /* $m2c_node_summary */
+@ eval $m2c_ctx_lh = "tbl_idx->$node"@
+@ eval $m2c_ctx_lhs = "tbl_idx->${node}_len"@
+@ eval $m2c_ctx_lhu="elements"@
+@ eval $m2c_ctx_rh = "$m2c_node_param_val_name"@
+@ eval $m2c_ctx_rhs = "$m2c_node_param_val_lname"@
+@ eval $m2c_ctx_rhu="elements"@
+@ if $m2c_node_needlength == 1@
+ $m2c_ctx_lhs = sizeof($m2c_ctx_lh)/sizeof($m2c_ctx_lh[0]); /* max length */
+@ end@
+## also, assume mapping already done
+@ include generic-ctx-get.m2i@
+##@ include generic-value-map.m2i@
+
+@end@ // for each column
+
+ return MFD_SUCCESS;
+} /* ${context}_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
+${context}_indexes_set(${context}_rowreq_ctx *rowreq_ctx$gtis_tmp)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != ${context}_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+@foreach $node index@
+@ include m2c_setup_node.m2i@
+ , $m2c_node_param_val_call
+@end@ # for each index
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != ${context}_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ${context}_indexes_set */
+
+@end@ // m2c_processing_type eq 'c'
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-table-indexes-to-oid.m2i b/local/mib2c-conf.d/generic-table-indexes-to-oid.m2i
new file mode 100644
index 0000000..c17de4c
--- /dev/null
+++ b/local/mib2c-conf.d/generic-table-indexes-to-oid.m2i
@@ -0,0 +1,52 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+${context}_index_to_oid(netsnmp_index *oid_idx,
+ ${context}_mib_index *mib_idx)
+{
+@include generic-table-indexes-varbind-setup.m2i@
+
+ DEBUGMSGTL(("verbose:${context}:${context}_index_to_oid","called\n"));
+
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+ /* $m2c_node_summary */
+@ if $m2c_node_needlength == 1@
+ snmp_set_var_value(&var_$node, &mib_idx->$node,
+ mib_idx->${node}_len * sizeof(mib_idx->${node}[0]));
+@ else@
+ snmp_set_var_value(&var_$node, &mib_idx->$node, sizeof(mib_idx->$node));
+@ end@
+
+@ end@ # for each column
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_$m2c_dii_first);
+ 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_$m2c_dii_first );
+
+ return err;
+} /* ${context}_index_to_oid */
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-table-indexes-varbind-setup.m2i b/local/mib2c-conf.d/generic-table-indexes-varbind-setup.m2i
new file mode 100644
index 0000000..8c0d48d
--- /dev/null
+++ b/local/mib2c-conf.d/generic-table-indexes-varbind-setup.m2i
@@ -0,0 +1,51 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+@ eval $m2c_dii_first = ""@
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+@ if "x$m2c_dii_first" eq "x"@
+@ eval $m2c_dii_first = $node@
+@ eval $m2c_dii_tmp = "var_${node}.next_variable = "@
+@ else@
+@ eval $m2c_dii_tmp = "$m2c_dii_tmp &var_${node}; var_${node}.next_variable = "@
+@ end@
+ /*
+ * $m2c_node_summary
+ */
+ netsnmp_variable_list var_$node;
+@ end@
+@ eval $m2c_dii_tmp = "$m2c_dii_tmp NULL;"@
+
+ /*
+ * set up varbinds
+ */
+@ eval $mfd_temp = "idx_vars"@
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+ memset( &var_$node, 0x00, sizeof(var_$node) );
+ var_${node}.type = $node.type;
+@ end@
+
+ /*
+ * chain temp index varbinds together
+ */
+ $m2c_dii_tmp
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-table-indexes.m2i b/local/mib2c-conf.d/generic-table-indexes.m2i
new file mode 100644
index 0000000..c226611
--- /dev/null
+++ b/local/mib2c-conf.d/generic-table-indexes.m2i
@@ -0,0 +1,67 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+/*
+ * TODO:120:r: |-> Review $context mib index.
+ * This structure is used to represent the index for $context.
+ */
+@eval $m2c_gi_others = (count_indexes($context) - 1)@
+@eval $m2c_gi_len = 0@
+@eval $m2c_gi_warn = 0@
+typedef struct ${context}_mib_index_s {
+
+@foreach $node index@
+@ include m2c_setup_node.m2i@
+##@ include details-node.m2i@
+ /*
+ * $m2c_node_summary
+ */
+@ if $m2c_node_needlength == 1@
+@ eval $m2c_gi_warn = 1@
+@ eval $m2c_gi_maxlen = (128 - $node.oidlength - $m2c_gi_others - 1)@
+@ if $m2c_node_maxlen > $m2c_gi_maxlen@
+@ eval $m2c_node_maxlen = $m2c_gi_maxlen@
+ /** 128 - $m2c_gi_others(other indexes) - oid length($node.oidlength) = $m2c_node_maxlen */
+@ end@
+@ eval $m2c_gi_len = $m2c_gi_len + $m2c_node_maxlen + 1@
+@ elsif "$node.type" eq "ASN_IPADDRESS"@
+@ eval $m2c_gi_len = $m2c_gi_len + 4@
+@ else@
+@ eval $m2c_gi_len = $m2c_gi_len + 1@
+@ end@ # needlength
+@ include node-storage.m2i@
+
+@end@ # foreach
+
+} ${context}_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review $context max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+@ if $m2c_gi_warn == 1@
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len($context.oidlength)
+@ if $m2c_gi_len > 126@
+@ eval $m2c_gi_len = 126 - $context.oidlength@
+@ end@
+##@ else@
+##@ eval $m2c_gi_len = count_indexes($context)@
+@ end@
+*/
+#define MAX_${context}_IDX_LEN $m2c_gi_len
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-table-oids.m2c b/local/mib2c-conf.d/generic-table-oids.m2c
new file mode 100644
index 0000000..6f8ab2a
--- /dev/null
+++ b/local/mib2c-conf.d/generic-table-oids.m2c
@@ -0,0 +1,113 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_create_fewer_files != 1@
+@eval $hack = "Id"@
+@eval $m2c_save = "$name"@
+@eval $name = "${m2c_save}_oids"@
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ *
+ * $$hack:$
+ */
+@include generic-header-top.m2i@
+@eval $name = "$m2c_save"@
+@end@ // m2c_create_fewer_files
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START header generated by $RCSfile$ $Revision$ */
+@end@
+##
+
+/* column number definitions for table $context */
+#define $context.uc_OID $context.commaoid
+
+ @eval $minv = 0xffffffff@
+ @eval $maxv = 0@
+ @eval $gto_flag_req = ""@
+ @eval $gto_flag_set = ""@
+ @eval $m2c_tmp_gto = 0@
+
+ @foreach $node column@
+#define COLUMN_$node.uc $node.subid
+ @if $node.accessible == 1@
+ @if ($node.settable == 1) || ($m2c_table_sparse == 1)@
+@ if "x$gto_flag_set" eq "x"@
+@ eval $gto_flag_set = "COLUMN_$node.uc_FLAG"@
+@ else@
+@ eval $gto_flag_set = "$gto_flag_set | COLUMN_$node.uc_FLAG"@
+@ end@
+ @if $m2c_tmp_gto > 31@
+#define COLUMN_$node.uc_FLAG (((uint64_t)0x1) << $m2c_tmp_gto)
+ @else@
+#define COLUMN_$node.uc_FLAG (0x1 << $m2c_tmp_gto)
+ @end@
+ @eval $m2c_tmp_gto = $m2c_tmp_gto + 1@
+ @end@
+ @if ($m2c_table_row_creation == 1) && ($node.settable == 1) && ("x$node.defval" eq "x")@
+ @if "x$gto_flag_req" eq "x"@
+ @eval $gto_flag_req = "COLUMN_$node.uc_FLAG"@
+ @else@
+ @eval $gto_flag_req = "$gto_flag_req | COLUMN_$node.uc_FLAG"@
+ @end@
+ @end@
+ @if $node.subid < $minv@
+ @eval $minv = $node.subid@
+ @eval $minn = "COLUMN_$node.uc"@
+ @end@
+ @if $node.subid > $maxv@
+ @eval $maxv = $node.subid@
+ @eval $maxn = "COLUMN_$node.uc"@
+ @end@
+ @end@
+
+ @end@ # column
+
+#define $context.uc_MIN_COL $minn
+#define $context.uc_MAX_COL $maxn
+##
+## column_set_flags and column_exist_flags are unsigned ints, to 32 is
+## the limit. Could try something with a 'long long' to see if that
+## can get us to 64, or do something like FD_SET, which would let us
+## be pretty unlimited.
+##
+ @if $maxn > 31@
+ @ print ERROR: more than 32 columns not supported yet.@
+ @ exit@
+ @end@
+
+
+@ if $m2c_table_settable@
+ @if "x$gto_flag_set" ne "x"@
+ /*
+ * TODO:405:r: Review $context.uc_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define $context.uc_SETTABLE_COLS ($gto_flag_set)
+ @end@
+ @if $m2c_table_row_creation@
+ @if "x$gto_flag_req" ne "x"@
+ /*
+ * TODO:405:r: Review $context.uc_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define $context.uc_REQUIRED_COLS ($gto_flag_req)
+
+ @end@
+ @end@
+@ end@ # settable
+@if $m2c_create_fewer_files != 1@
+@eval $m2c_save = "$name"@
+@eval $name = "${m2c_save}_oids"@
+@include generic-header-bottom.m2i@
+@eval $name = "$m2c_save"@
+@end@
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END header generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-value-map-func.m2i b/local/mib2c-conf.d/generic-value-map-func.m2i
new file mode 100644
index 0000000..b0df63b
--- /dev/null
+++ b/local/mib2c-conf.d/generic-value-map-func.m2i
@@ -0,0 +1,104 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+## }
+/**
+ * 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
+ * ${m2c_defaults_dir}node-${node}.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
+${node}_map($m2c_node_map_param)
+{
+@if $m2c_node_needlength == 1@
+ int converted_len;
+
+ netsnmp_assert(NULL != raw_$m2c_node_param_val_name);
+ netsnmp_assert((NULL != mib_$m2c_node_param_ref_name) && (NULL != mib_$m2c_node_param_ref_lname));
+@else@
+ netsnmp_assert(NULL != mib_$m2c_node_param_ref_name);
+@end@
+
+ DEBUGMSGTL(("verbose:${context}:${node}_map","called\n"));
+
+@if $m2c_node_needlength == 1@
+ /*
+ * TODO:241:r: |-> Implement $node non-integer mapping
+ * it is hard to autogenerate code for mapping types that are not simple
+ * integers, so here is an idea of what you might need to do. It will
+ * probably need some tweaking to get right.
+ */
+ /*
+ * if the length of the raw data doesn't directly correspond with
+ * the length of the mib data, set converted_len to the
+ * space required.
+ */
+ converted_len = raw_$m2c_node_param_val_lname; /* assume equal */
+ if((NULL == *mib_$m2c_node_param_ref_name) || (*mib_$m2c_node_param_ref_lname < converted_len)) {
+ if(! allow_realloc) {
+ snmp_log(LOG_ERR,"not enough space for value mapping\n");
+ return SNMP_ERR_GENERR;
+ }
+ *mib_$m2c_node_param_ref_name = realloc( *mib_$m2c_node_param_ref_name, converted_len * sizeof(**mib_$m2c_node_param_ref_name));
+ if(NULL == *mib_$m2c_node_param_ref_name) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+ *mib_$m2c_node_param_ref_lname = converted_len;
+ memcpy( *mib_$m2c_node_param_ref_name, raw_$m2c_node_param_val_name, converted_len );
+##
+@elsif ($node.enums == 1) && ("$node.perltype" eq "INTEGER")@
+ /*
+ * TODO:241:o: |-> Implement $node enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch(raw_$m2c_node_param_val_name) {
+@ foreach $e $v enum@
+@ include m2c_setup_enum.m2i@
+ case INTERNAL_$context.uc_$m2c_iname:
+ *mib_$m2c_node_param_ref_name = $m2c_ename;
+ break;
+
+@ end@ # foreach
+ default:
+ snmp_log(LOG_ERR, "couldn't map value %ld for $node\n", raw_$m2c_node_param_val_name );
+ return MFD_ERROR;
+ }
+##
+@else@
+ /*
+ * TODO:241:o: |-> Implement $node mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ (*mib_$m2c_node_param_ref_name) = raw_$m2c_node_param_val_name;
+@end@
+
+ return MFD_SUCCESS;
+} /* ${node}_map */
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-value-map-reverse.m2i b/local/mib2c-conf.d/generic-value-map-reverse.m2i
new file mode 100644
index 0000000..4b6eb38
--- /dev/null
+++ b/local/mib2c-conf.d/generic-value-map-reverse.m2i
@@ -0,0 +1,49 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+/*
+ * TODO:245:o: |-> Implement $node 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.
+ */
+@if ($node.enums == 1)@
+$example_start
+@ if ("$node.perltype" eq "BITS")@
+ $m2c_ctx_rh = 0;
+@ foreach $e $v enum@
+@ include m2c_setup_enum.m2i@
+ if ($m2c_node_srh & $m2c_ename) {
+ $m2c_ctx_rh |= INTERNAL_$context.uc_$m2c_iname;
+ }
+@ end@ # for each
+@ elsif ("$node.perltype" eq "INTEGER")@
+ switch($m2c_node_srh) {
+@ foreach $e $v enum@
+@ include m2c_setup_enum.m2i@
+ case $m2c_ename:
+ $m2c_ctx_rh = INTERNAL_$context.uc_$m2c_iname;
+ break;
+
+@ end@ # foreach
+ default:
+ snmp_log(LOG_ERR, "couldn't reverse map value %ld for $node\n", $m2c_node_srh );
+ return SNMP_ERR_GENERR;
+ }
+@ end@ # integers/bits
+$example_end
+@else@
+@ include generic-ctx-set.m2i@
+@end@ # enums
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/generic-value-map.m2i b/local/mib2c-conf.d/generic-value-map.m2i
new file mode 100644
index 0000000..0f7bd2e
--- /dev/null
+++ b/local/mib2c-conf.d/generic-value-map.m2i
@@ -0,0 +1,46 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+## }
+@if $m2c_node_skip_mapping == 1@
+ /** no mapping */
+@ include generic-ctx-get.m2i@
+@else@ // mapping
+ /*
+ * TODO:246:r: |-> Define $node mapping.
+ * Map values between raw/native values and MIB values
+ *
+@ if $m2c_node_needlength == 1@
+ * if(MFD_SUCCESS !=
+ * ${node}_map(&$m2c_ctx_lh, &$m2c_ctx_lhs,
+ * $m2c_ctx_rh, $m2c_ctx_rhs, $m2c_node_realloc)) {
+ * return MFD_ERROR;
+ * }
+ */
+@ include generic-ctx-get.m2i@
+##
+@ elsif ($node.enums == 1) && ("$node.perltype" eq "INTEGER")@
+##
+ * enums usually need mapping.
+ */
+ if(MFD_SUCCESS !=
+ ${node}_map(&${m2c_ctx_lh}, ${m2c_ctx_rh} )) {
+ return MFD_ERROR;
+ }
+@ else@ // enums
+ * Integer based value can usually just do a direct copy.
+ */
+@ include generic-ctx-get.m2i@
+@ end@
+@end@ // mapping
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/m2c-internal-warning.m2i b/local/mib2c-conf.d/m2c-internal-warning.m2i
new file mode 100644
index 0000000..8e685e6
--- /dev/null
+++ b/local/mib2c-conf.d/m2c-internal-warning.m2i
@@ -0,0 +1,21 @@
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** 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. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
diff --git a/local/mib2c-conf.d/m2c_setup_enum.m2i b/local/mib2c-conf.d/m2c_setup_enum.m2i
new file mode 100644
index 0000000..b5bb7ae
--- /dev/null
+++ b/local/mib2c-conf.d/m2c_setup_enum.m2i
@@ -0,0 +1,24 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+## the iname enum should be unique per column, so always use node name
+##
+@ if $m2c_const_lc == 1@
+@ eval $m2c_ename = "${m2c_de_pfx}_${e}${m2c_enum_sfx}"@
+@ eval $m2c_iname = "${m2c_const_pfx}${node}_${e}${m2c_enum_sfx}"@
+@ else@
+@ eval $m2c_ename = "${m2c_de_pfx}_$e.uc${m2c_enum_sfx}"@
+@ eval $m2c_iname = "${m2c_const_pfx}$node.uc_$e.uc${m2c_enum_sfx}"@
+@ end@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/m2c_setup_node.m2i b/local/mib2c-conf.d/m2c_setup_node.m2i
new file mode 100644
index 0000000..67fb89d
--- /dev/null
+++ b/local/mib2c-conf.d/m2c_setup_node.m2i
@@ -0,0 +1,260 @@
+############################################################# -*- c -*-
+## Defaults
+## $Id$
+########################################################################
+@if "$m2c_node_name" ne "$node"@
+## if $node.accessible != 1, might be inaccessible index node
+@ eval $m2c_node_name = $node@
+@ eval $m2c_node_skip_mapping = $m2c_table_skip_mapping@
+@ eval $m2c_node_needlength = $node.needlength@
+@ eval $m2c_node_get_comments = ""@
+@ eval $m2c_node_set_comments = ""@
+@ eval $m2c_node_skip_get = 0@
+##//how should a function handle a pointer to a buffer that is to small?
+@ eval $m2c_node_realloc = 0@ // 0=fail, 1=realloc, 2=malloc
+########################################################################
+## fix some declarations
+########################################################################
+@ if $node.enums == 1@
+##
+@ if $m2c_node_skip_mapping == -1@
+@ eval $m2c_node_skip_mapping = 0@
+@ end@
+##
+## validate some assumptions
+##
+@ if ("$node.perltype" ne "INTEGER") && ("$node.perltype" ne "BITS")@
+@ print "$node had enums, but isn't INTEGER or BITS! ($node.perltype)\n"@
+@ exit@
+@ end@
+@ if $node.ranges == 1@
+@ print "$node has enums and ranges!\n"@
+@ exit@
+@ end@
+##
+## for a TC, prefix definition w/syntax to reduce collisions
+##
+@ if $node.syntax ne $node.perltype@
+@ eval $m2c_de_pfx = "${m2c_const_pfx}$node.syntax"@
+@ else@
+@ eval $m2c_de_pfx = "${m2c_const_pfx}$node"@
+@ end@
+@ if $m2c_const_lc == 0@
+@ eval $m2c_de_pfx = uc($m2c_de_pfx)@
+@ end@
+@ if "$node.perltype" eq "BITS"@
+@ eval $m2c_enum_sfx="_flag"@
+@ eval $m2c_enum_mask="${m2c_de_pfx}_flag"@
+@ if $m2c_const_lc == 0@
+@ eval $m2c_enum_sfx = uc($m2c_enum_sfx)@
+@ eval $m2c_enum_mask = uc($m2c_enum_mask)@
+@ end@
+@ else@
+@ eval $m2c_enum_sfx=""@
+@ end@
+##
+## use longs for enums (w/out length)
+##
+@ eval $m2c_decl = "u_long"@
+@ eval $m2c_node_needlength = 0@
+@ if "$node.perltype" eq "BITS"@
+@ eval $m2c_node_skip_get = 1@
+@ end@
+@ else@
+@ eval $m2c_decl = $node.decl@
+ @ end@ // enums
+########################################################################
+## find max size
+########################################################################
+@ if $node.ranges == 1@
+##
+## I do not *think* you can have both...
+##
+@ if $node.enums == 1@
+@ print "$node has enums and ranges!\n"@
+@ exit@
+@ end@
+@ eval $m2c_node_maxlen = 0@
+@ foreach $a $b range $node@
+@ eval $m2c_node_maxlen = max($m2c_node_maxlen,$b)@
+@ end@
+@ elsif "$node.type" eq "ASN_OBJECT_ID"@
+@ eval $m2c_node_maxlen = 128@
+@ else@ #ranges
+@ eval $m2c_node_maxlen = 65535@
+@ end@ #ranges
+##/*####################################################################
+## set up extra params, based on if we need length
+########################################################################
+## VAR_VAL : variable value.
+## VAR_VAL_PTR : pointer to variable value.
+## VAR_REF : variable reference. (pointer to pointer to variable value)
+##*/
+@ if "x$m2c_node_var_name" eq "x"@
+@ eval $m2c_node_var_name="var->"@
+@ end@
+@ eval $m2c_node_var_val_ptr = "($m2c_decl *)${m2c_node_var_name}val.string"@
+@ if $m2c_node_needlength == 1@
+@ eval $m2c_XX = "($m2c_decl **)&${m2c_node_var_name}val.string,"@
+@ eval $m2c_node_var_ref = "$m2c_XX &${m2c_node_var_name}val_len"@
+@ eval $m2c_node_var_val = "$m2c_node_var_val_ptr, ${m2c_node_var_name}val_len"@
+@ else@
+@ eval $m2c_node_var_ref = "($m2c_decl *)${m2c_node_var_name}val.string"@
+@ eval $m2c_node_var_val = "*($m2c_node_var_val_ptr)"@
+@ end@
+##
+##
+@ eval $m2c_node_param_val_name = "${node}_val"@
+@ eval $m2c_node_param_val_lname = "${m2c_node_param_val_name}_len"@
+@ eval $m2c_node_param_ref_name = "${m2c_node_param_val_name}_ptr"@
+@ if $m2c_node_needlength == 1@
+@ eval $m2c_node_param_val_name = "${m2c_node_param_val_name}_ptr"@
+@ eval $m2c_node_param_val_lname = "${m2c_node_param_val_name}_len"@
+@ eval $m2c_node_param_val_call = "${m2c_node_param_val_name}, ${m2c_node_param_val_lname}"@
+@ eval $m2c_node_param_ref_name = "${m2c_node_param_ref_name}_ptr"@
+@ eval $m2c_node_param_ref_lname = "${m2c_node_param_val_lname}_ptr"@
+@ eval $m2c_XX = "$m2c_decl **$m2c_node_param_ref_name,"@
+@ eval $m2c_node_param_ref = "$m2c_XX size_t *$m2c_node_param_ref_lname"@
+@ eval $m2c_XX = "$m2c_decl *$m2c_node_param_val_name,"@
+@ eval $m2c_node_param_val = "$m2c_XX size_t $m2c_node_param_val_lname"@
+@ else@
+@ eval $m2c_node_param_ref = "$m2c_decl * $m2c_node_param_ref_name"@
+@ eval $m2c_node_param_val = "$m2c_decl $m2c_node_param_val_name"@
+@ eval $m2c_node_param_val_call = "$m2c_node_param_val_name"@
+##
+@ end@
+##
+########################################################################
+## include user overrides
+########################################################################
+@ include -ifexists ${m2c_defaults_dir}node-${node}.m2d@
+########################################################################
+##
+########################################################################
+@ if $m2c_get_use_temp == 1@
+@ eval $m2c_node_lh = "temp_$node"@
+@ eval $m2c_node_lhs = "temp_${node}_len"@
+@ else@
+@ eval $m2c_node_lh = "(* $m2c_node_param_ref_name )"@
+@ eval $m2c_node_lhs = "(* $m2c_node_param_ref_lname )"@
+@ end@
+@ eval $m2c_ctx_lh="$m2c_node_lh"@
+@ eval $m2c_ctx_lhs="$m2c_node_lhs"@
+@ eval $m2c_ctx_lhu="bytes"@
+@ eval $m2c_ctx_rh="${m2c_data_item}${node}"@
+@ eval $m2c_ctx_rhs="${m2c_data_item}${node}_len"@
+@ eval $m2c_ctx_rhu="elements"@
+########################################################################
+##
+########################################################################
+@ if $m2c_node_skip_mapping != 1@
+@ if $m2c_node_needlength == 1@
+@ eval $m2c_XX="$m2c_decl **mib_$m2c_node_param_ref_name,"@
+@ eval $m2c_XX="$m2c_XX size_t *mib_$m2c_node_param_ref_lname,"@
+@ eval $m2c_XX="$m2c_XX $m2c_decl *raw_$m2c_node_param_val_name,"@
+@ eval $m2c_XX="$m2c_XX size_t raw_$m2c_node_param_val_lname,"@
+@ eval $m2c_node_map_param="$m2c_XX int allow_realloc"@
+@ else@
+@ eval $m2c_XX="$m2c_decl *mib_$m2c_node_param_ref_name,"@
+@ eval $m2c_node_map_param="$m2c_XX $m2c_decl raw_$m2c_node_param_val_name"@
+@ end@
+@ end@
+########################################################################
+##
+########################################################################
+@ eval $m2c_node_srh = "$m2c_node_param_val_name"@
+@ eval $m2c_node_srhs = "$m2c_node_param_val_lname"@
+@end@
+########################################################################
+##
+@eval $m2c_node_summary="$node($node.subid)/$node.syntax/$node.type/$node.decl($m2c_decl)/"@
+@if $node.needlength == 0@
+@ eval $m2c_node_summary="$m2c_node_summary/l"@
+@else@
+@ eval $m2c_node_summary="$m2c_node_summary/L"@
+@end@
+@if $node.noaccess == 0@
+@ eval $m2c_node_summary="$m2c_node_summary/A"@
+@else@
+@ eval $m2c_node_summary="$m2c_node_summary/a"@
+@end@
+@if $node.settable == 0@
+@ eval $m2c_node_summary="$m2c_node_summary/w"@
+@else@
+@ eval $m2c_node_summary="$m2c_node_summary/W"@
+@end@
+@if $node.enums == 0@
+@ eval $m2c_node_summary="$m2c_node_summary/e"@
+@else@
+@ eval $m2c_node_summary="$m2c_node_summary/E"@
+@end@
+@if $node.ranges == 0@
+@ eval $m2c_node_summary="$m2c_node_summary/r"@
+@else@
+@ eval $m2c_node_summary="$m2c_node_summary/R"@
+@end@
+@if $node.hasdefval == 0@
+@ eval $m2c_node_summary="$m2c_node_summary/d"@
+@else@
+@ eval $m2c_node_summary="$m2c_node_summary/D"@
+@end@
+@if $node.hashint == 0@
+@ eval $m2c_node_summary="$m2c_node_summary/h"@
+@else@
+@ eval $m2c_node_summary="$m2c_node_summary/H"@
+@end@
+########################################################################
+@ ifconf ${m2c_defaults_dir}node-${node}.m2d@
+@ else@
+@ push@
+@ open ${m2c_defaults_dir}node-${node}.m2d@
+@ eval $m2c_conf_comment = "##"@
+@ eval $m2c_conf_comment_divider = "########################################################################"@
+$m2c_conf_comment_divider
+$m2c_conf_comment
+$m2c_conf_comment mib2c node setting for $node
+$m2c_conf_comment
+$m2c_conf_comment Remove the '##' comment delimeter to change settings
+$m2c_conf_comment
+$m2c_conf_comment_divider
+$m2c_conf_comment Node declaration type? This is the C type to be used when
+$m2c_conf_comment declaring a variable to hold a value for this column. It
+$m2c_conf_comment is strongly recommended that you do not change this value.
+$m2c_conf_comment If you do, it is likely to break lots of generated code that
+$m2c_conf_comment you will have to fix.
+$m2c_conf_comment
+$m2c_conf_comment @eval $@m2c_decl = $m2c_decl@
+$m2c_conf_comment
+$m2c_conf_comment_divider
+$m2c_conf_comment Generate/use mapping functions? Useful if the MIB defines
+$m2c_conf_comment a different format or enumerations than you data store uses.
+$m2c_conf_comment
+$m2c_conf_comment @eval $@m2c_node_skip_mapping = $m2c_node_skip_mapping@
+$m2c_conf_comment
+$m2c_conf_comment_divider
+$m2c_conf_comment Need a length for the value? Most OCTET-STRING based values will
+$m2c_conf_comment need a length, most other types will not. Do not change this one
+$m2c_conf_comment unless you know what you are doing! You will almost certainly need
+$m2c_conf_comment to fix lots of generated code if you do.
+$m2c_conf_comment
+$m2c_conf_comment @eval $@m2c_node_needlength = $m2c_node_needlength@
+$m2c_conf_comment
+$m2c_conf_comment_divider
+$m2c_conf_comment Skip get? Set this to 1 if you do not want to implement a value
+$m2c_conf_comment for this column.
+$m2c_conf_comment
+$m2c_conf_comment @eval $@m2c_node_skip_get = $m2c_node_skip_get@
+$m2c_conf_comment
+@ if $m2c_node_needlength == 1@
+$m2c_conf_comment_divider
+$m2c_conf_comment Allow realloc when data size exceeds length? If your data
+$m2c_conf_comment store for this node is a pointer allocated with one of the
+$m2c_conf_comment alloc family functions, you can set this to 1 to use realloc
+$m2c_conf_comment when a new value length exceeds the old lenght. If you are
+$m2c_conf_comment using a fixed size buffer, this value should be 0.
+$m2c_conf_comment
+$m2c_conf_comment @eval $@m2c_node_realloc = $m2c_node_realloc@
+@ end@
+@ close ${m2c_defaults_dir}node-${node}.m2d@
+@ pop@
+@ end@
diff --git a/local/mib2c-conf.d/m2c_setup_table.m2i b/local/mib2c-conf.d/m2c_setup_table.m2i
new file mode 100644
index 0000000..4481e39
--- /dev/null
+++ b/local/mib2c-conf.d/m2c_setup_table.m2i
@@ -0,0 +1,48 @@
+########################################################################
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@if "$m2c_context_name" ne "$table"@
+@ eval $m2c_context_name = $table@
+@ eval $context = $table@
+@ if $m2c_report_progress == 1@
+@ print | +-> Processing table $context@
+@ end@
+@ eval $m2c_context_item = "rowreq_ctx->"@
+@ eval $m2c_table_external_indexes = count_external_indexes($context)@
+##
+@ eval $m2c_undo_embed = $mfd_default_undo_embed@
+@ eval $m2c_gda_todo_suppress = 0@ # todo comments
+##
+## user override
+##
+@ include ${m2c_defaults_dir}table-${context}.m2d@
+##
+@ eval $m2c_data_item_base = "${m2c_context_item}data"@
+@ if $m2c_data_allocate == 1@
+@ eval $m2c_data_item = "${m2c_data_item_base}->"@
+@ else@
+@ eval $m2c_data_item = "${m2c_data_item_base}."@
+@ end@
+@ if $m2c_table_settable == 0@
+@ eval $m2c_undo_embed = 1@
+@ end@
+@ eval $m2c_undo_item_base = "${m2c_context_item}undo"@
+@ if $m2c_undo_embed == 1@
+@ eval $m2c_undo_item = "${m2c_undo_item_base}."@
+@ else@
+@ eval $m2c_undo_item = "${m2c_undo_item_base}->"@
+@ end@
+@end@
+@eval $m2c_node_name = ""@
+########################################################################
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/m2c_table_save_defaults.m2i b/local/mib2c-conf.d/m2c_table_save_defaults.m2i
new file mode 100644
index 0000000..e36c32e
--- /dev/null
+++ b/local/mib2c-conf.d/m2c_table_save_defaults.m2i
@@ -0,0 +1,117 @@
+#######################################################################
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+##
+##
+## Note: if you add a var here, add it in mfd-interactive-setup.m2c too
+##
+##
+@open ${m2c_defaults_dir}table-${context}.m2d@
+@eval $m2c_tmp_cc = "##"@
+@eval $tmp_cc = ""@ # hack to prevet mib2c eval
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc mib2c Table setting for $context
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc User context structure type
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_context_reg = "$m2c_context_reg"@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Allocate data structure in row structure? (vs embedd)
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_data_allocate = $m2c_data_allocate@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Generate code to cache data?
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_data_cache = $m2c_data_cache@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Data context structure type
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_data_context = "$m2c_data_context"@ [generated|NAME]
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Generate function to initialize row context when created?
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_data_init = $m2c_data_init@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Persistence of data context
+$m2c_tmp_cc // 0:persistent, 1:semi-transient, 2:transient
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_data_transient = $m2c_data_transient@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Include some example code?
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_include_examples = $m2c_include_examples@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Generate code for irreversible_commit mode?
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_irreversible_commit = $m2c_irreversible_commit@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Data access method
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_table_access = "$m2c_table_access"@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Generate row dependency function?
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_table_dependencies = $m2c_table_dependencies@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Generate data store/restore functions for persistent storage?
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_table_persistent = $m2c_table_persistent@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Generate code for dynamic row creation?
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_table_row_creation = $m2c_table_row_creation@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Generate code for settable objects?
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_table_settable = $m2c_table_settable@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Skip mapping between data context and MIB formats?
+$m2c_tmp_cc // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_table_skip_mapping = $m2c_table_skip_mapping@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Generate code for sparse tables?
+$m2c_tmp_cc
+$tmp_cc@eval $@m2c_table_sparse = $m2c_table_sparse@
+$m2c_tmp_cc
+$m2c_tmp_cc ########################################################################
+$m2c_tmp_cc
+$m2c_tmp_cc Generate Makefile/AgentX code?
+$m2c_tmp_cc
+$tmp_cc@eval $@mfd_generate_makefile = $mfd_generate_makefile@
+$tmp_cc@eval $@mfd_generate_subagent = $mfd_generate_subagent@
+$m2c_tmp_cc
+@close ${m2c_defaults_dir}table-${context}.m2d@
diff --git a/local/mib2c-conf.d/mfd-access-container-cached-defines.m2i b/local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
new file mode 100644
index 0000000..5f65b63
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-access-container-cached-defines.m2i
@@ -0,0 +1,576 @@
+#######################################################################
+###generic include for XXX. Do not use directly.
+###
+### $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'h'@
+
+@ if $m2c_data_cache != 1@
+void ${context}_container_init(netsnmp_container **container_ptr_ptr);
+@ else@
+ /*
+ * TODO:180:o: Review ${context} cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define $context.uc_CACHE_TIMEOUT 60
+
+void ${context}_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+@ end@ # data cache
+void ${context}_container_shutdown(netsnmp_container *container_ptr);
+
+int ${context}_container_load(netsnmp_container *container);
+void ${context}_container_free(netsnmp_container *container);
+
+@ if $m2c_data_cache == 1@
+int ${context}_cache_load(netsnmp_container *container);
+void ${context}_cache_free(netsnmp_container *container);
+
+@ end@
+@ if $m2c_include_examples == 1@
+$example_start
+/* *********************************************************************
+ * 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
+$example_end
+@ end@ // example
+@end@ // m2c_processing_type eq 'h'
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'c'@
+/**
+ * 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.
+@ if $m2c_data_cache == 1@
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+@ end@
+ *
+ * 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.
+ *
+@ if $m2c_data_cache == 1@
+ * 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.
+ *
+@ end@
+ * @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
+@ if $m2c_data_cache != 1@
+${context}_container_init(netsnmp_container **container_ptr_ptr)
+@ else@
+${context}_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+@ end@
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to ${context}_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 $m2c_data_cache == 1@
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to ${context}_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up $context 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 = $context.uc_CACHE_TIMEOUT; /* seconds */
+@end@
+} /* ${context}_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 ${context}_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
+${context}_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to ${context}_container_shutdown\n");
+ return;
+ }
+
+} /* ${context}_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement $context data load
+@ if $m2c_data_cache == 1@
+ * 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).
+@ end@
+ *
+ * @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
+ * ${context}_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
+${context}_container_load(netsnmp_container *container)
+{
+ ${context}_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+ /*
+ * $m2c_node_summary
+ */
+@ if $m2c_node_needlength == 1@
+@ eval $m2c_gi_maxlen = (126 - $node.oidlength - $m2c_gi_others)@
+@ if $m2c_node_maxlen > $m2c_gi_maxlen@
+@ eval $m2c_node_maxlen = $m2c_gi_maxlen@
+ /** 128 - 1(entry) - 1(col) - $m2c_gi_others(other indexes) = $m2c_node_maxlen */
+@ end@
+@ end@ # needlength
+@ include node-storage.m2i@
+@ end@ // foreach
+
+@if $m2c_include_examples == 1@
+
+ /*
+ * 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];
+@end@ // examples
+
+ DEBUGMSGTL(("verbose:${context}:${context}_container_load","called\n"));
+
+@if $m2c_include_examples == 1@
+$example_start
+ /*
+ * open our data file.
+ */
+ filep = fopen("/etc/dummy.conf", "r");
+ if(NULL == filep) {
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+$example_end
+@end@ // example
+ /*
+ * TODO:351:M: |-> Load/update data in the $context container.
+ * loop over your $context data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ while( 1 ) {
+@ if $m2c_include_examples == 0@
+ /*
+ * check for end of data; bail out if there is no more data
+ */
+ if( 1 )
+ break;
+@ else@
+$example_start
+ /*
+ * 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
+ */
+$example_end
+@ end@ # example
+
+ /*
+ * TODO:352:M: | |-> set indexes in new $context rowreq context.
+@ eval $m2c_tmp = ""@
+@ if ($m2c_data_allocate == 1) || ($m2c_data_init == 1)@
+@ eval $m2c_tmp = "NULL"@
+@ if ($m2c_data_allocate == 1) && ($m2c_data_init == 1)@
+@ eval $m2c_tmp = "$m2c_tmp, NULL"@
+ * 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
+ * ${context}rowreq_ctx_init.
+@ else@
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+@ @end@
+@ end@
+ */
+ rowreq_ctx = ${context}_allocate_rowreq_ctx($m2c_tmp);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if(MFD_SUCCESS != ${context}_indexes_set(rowreq_ctx
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+@ if $m2c_node_needlength == 1@
+ , $node, ${node}_len
+@ else@
+ , $node
+@ end@
+@ end@ # foreach index
+ )) {
+ snmp_log(LOG_ERR,"error setting index while loading "
+ "${context} data.\n");
+ ${context}_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate $context data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+@if $m2c_data_transient == 0@ # persistent
+ /* non-TRANSIENT data: no need to copy. set pointer to data */
+@else@
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+ /*
+ * setup/save data for $node
+ * $m2c_node_summary
+ */
+@ if "$m2c_data_context" eq "generated"@
+@ eval $m2c_ctx_lh = "$m2c_ctx_rh"@
+@ eval $m2c_ctx_lhs = "$m2c_ctx_rhs"@
+@ eval $m2c_ctx_rh = "$node"@
+@ eval $m2c_ctx_rhs = "${node}_len"@
+@ include generic-value-map.m2i@
+
+@ end@ # data_context ! generated
+@ end@ // for each
+@end@ # transient
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+@if $m2c_include_examples == 1@
+
+$example_start
+ if(NULL != filep)
+ fclose(filep);
+$example_end
+@end@ # example
+
+ DEBUGMSGT(("verbose:${context}:${context}_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* ${context}_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 ($m2c_data_allocate == 1) && ($m2c_data_transient == 0)@
+ * 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.
+@ end@
+ *
+ */
+void
+${context}_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free $context container data.
+ */
+} /* ${context}_container_free */
+
+@end@ // m2c_processing_type eq 'c'
+########################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'i'@
+@ if $m2c_data_cache == 1@
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:${context}:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for ${context}_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 ${context}_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:${context}:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in ${context}_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+@ end@ # cache
+/**
+ * @internal
+ */
+static void
+_container_item_free(${context}_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:${context}:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ ${context}_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:${context}:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in ${context}_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ${context}_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
+_${context}_container_init(${context}_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:${context}:_${context}_container_init","called\n"));
+
+@ if $m2c_data_cache == 1@
+ /*
+ * cache init
+ */
+@ if 0@
+ if_ctx->cache =
+ netsnmp_cache_find_by_oid(PARTNER_oid, OID_LENGTH(PARTNER_oid));
+@ else@
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ${context}_oid,
+ ${context}_oid_size);
+@ end@ // shared cache
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ${context}\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ${context}_container_init(&if_ctx->container, if_ctx->cache);
+@ else@
+ /*
+ * container init
+ */
+ ${context}_container_init(&if_ctx->container);
+@ end@ data cache
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("${context}:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "${context}_container_init\n");
+ return;
+ }
+
+@ if $m2c_data_cache == 1@
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+@ end@
+} /* _${context}_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_${context}_container_shutdown(${context}_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:${context}:_${context}_container_shutdown","called\n"));
+
+ ${context}_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _${context}_container_shutdown */
+
+@end@ // m2c_processing_type eq 'i'
+########################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'r'@
+##
+ 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...
+
+
+@ if $m2c_data_cache == 1@
+ 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...
+
+
+@ end@
+@end@ // m2c_processing_type eq 'r'
+########################################################################
+##//####################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i b/local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i
new file mode 100644
index 0000000..f4f3514
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-access-unsorted-external-defines.m2i
@@ -0,0 +1,1198 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+##
+@eval $mfd_aue_wrap_param = "wrap_ctx"@
+@eval $mfd_aue_wrap_param_type = "${context}_interface_ctx *"@
+@eval $mfd_aue_wrap_param_decl = "$mfd_aue_wrap_param_type $mfd_aue_wrap_param"@
+##
+@eval $mfd_aue_param = "${context}_reg"@
+@eval $mfd_aue_param_type = "${context}_registration *"@
+@eval $mfd_aue_param_decl = "$mfd_aue_param_type $mfd_aue_param"@
+@eval $mfd_aue_param_cmt = "$mfd_aue_param Pointer to a $mfd_aue_param_type"
+##
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'h'@
+##
+@if $m2c_include_examples == 1@
+$example_start
+/* *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ @ if $m2c_data_transient != 2@
+ @ print Example code is for fully transient data. Either turn off@
+ @ print m2c_include_examples or set m2c_data_transient to 2.@
+ @ exit@
+ @ end@
+ */
+#define MAX_LINE_SIZE 256
+$example_end
+
+@end@
+/**
+ * loop context
+ *
+ * ToDo:
+ * define loop context structure
+ *
+ * Since the actual loop is in the MFD handler, a loop contex parameter
+ * is provided to help you keep track of where you are in between calls
+ * to functions that you wrote and the master MFD handler calls. The
+ * structure of this context is user defineable, and is defined in the
+ * file ${table}_data_access.h.
+ *
+ * E.G., if your data is stored in a linked list, the obvious thing you
+ * want to know from one function call to the next is your current
+ * position in the linked list. Thus the easiest context to use is a
+ * pointer within the linked list. For an array, the current index to
+ * that array would be easiest.
+ *
+ * The funtion calls are actually passed a reference to the loop
+ * context, to allow the loop context to be allocated memory. Here are
+ * some simple examples definitions for various data formats. These
+ * definitions are used in examples later on.
+ *
+ */
+typedef struct ${context}_loop_context_s {
+ /*
+ * temporary context used during iteration
+ */
+ ${context}_rowreq_ctx *rowreq_ctx;
+@if $m2c_include_examples == 1@
+
+ /*
+ * 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];
+@end@
+} ${context}_loop_context;
+
+/*
+ * define a reference to the loop context
+ *
+ * NOTE: DO NOT ADD ITEMS TO THIS STRUCTURE!
+ */
+typedef struct ${context}_ref_loop_ctx_s {
+ ${context}_loop_context *loop_ctx;
+} ${context}_ref_loop_ctx;
+
+int ${context}_loop_get_first( $mfd_aue_param_decl, ${context}_ref_loop_ctx *loop_ctx_ref,
+ ${context}_ref_rowreq_ctx *rowreq_ctx_ref);
+int ${context}_loop_get_next( $mfd_aue_param_decl, ${context}_ref_loop_ctx *loop_ctx_ref,
+ ${context}_ref_rowreq_ctx *rowreq_ctx_ref);
+int ${context}_loop_get_data( $mfd_aue_param_decl, ${context}_ref_loop_ctx *loop_ctx_ref,
+ ${context}_ref_rowreq_ctx *rowreq_ctx_ref);
+int ${context}_loop_save_position($mfd_aue_param_decl,
+ ${context}_ref_loop_ctx *loop_ctx_ref,
+ ${context}_ref_loop_ctx *save_loop_ctx_ref, int reuse);
+int ${context}_loop_cleanup_context( $mfd_aue_param_decl, ${context}_ref_loop_ctx *ref);
+
+##
+@end@ // m2c_processing_type eq 'h'
+########################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'i'@
+/**
+ * @internal
+ * wrapper around clean up a loop reference
+ */
+static int
+_${context}_loop_cleanup_context( $mfd_aue_wrap_param_decl,
+ ${context}_ref_loop_ctx *ref)
+{
+ DEBUGMSGTL(("internal:${context}:_${context}_loop_cleanup_context","called\n"));
+
+ return ${context}_loop_cleanup_context($mfd_aue_wrap_param->user_ctx, ref);
+} /* _${context}_loop_cleanup_context */
+
+/**
+ * @internal
+ * wrapper around save position
+ */
+static int
+_${context}_loop_save_position( $mfd_aue_wrap_param_decl, ${context}_ref_loop_ctx *ref,
+ ${context}_ref_loop_ctx *ref_copy, int reuse)
+{
+ DEBUGMSGTL(("internal:${context}:_${context}_loop_save_position","called\n"));
+
+ return ${context}_loop_save_position($mfd_aue_wrap_param->user_ctx, ref,
+ ref_copy, reuse);
+} /* _${context}_loop_save_position */
+
+/**
+ * @internal
+ * wrapper around user get_first to setup the index oid
+ */
+static int
+_${context}_loop_get_first_wrapper($mfd_aue_wrap_param_decl,
+ ${context}_ref_loop_ctx * loop_ctx_ref,
+ ${context}_ref_rowreq_ctx * rowreq_ctx_ref)
+{
+ int rc;
+ DEBUGMSGTL(("internal:${context}:_${context}_loop_get_first_wrapper","called\n"));
+
+ rc = ${context}_loop_get_first($mfd_aue_wrap_param->user_ctx, loop_ctx_ref,
+ rowreq_ctx_ref);
+ /*
+ * convert index to OID
+ */
+ if(SNMPERR_SUCCESS == rc ) {
+ netsnmp_assert((NULL != rowreq_ctx_ref) &&
+ (rowreq_ctx_ref->rowreq_ctx->oid_idx.oids == rowreq_ctx_ref->rowreq_ctx->oid_tmp));
+ rowreq_ctx_ref->rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx_ref->rowreq_ctx->oid_tmp);
+ rc = ${context}_index_to_oid(&rowreq_ctx_ref->rowreq_ctx->oid_idx,
+ &rowreq_ctx_ref->rowreq_ctx->tbl_idx);
+ netsnmp_assert(rowreq_ctx_ref->rowreq_ctx->oid_idx.len !=
+ sizeof(rowreq_ctx_ref->rowreq_ctx->oid_tmp));
+ }
+
+ return rc;
+} /* _${context}_loop_get_first_wrapper */
+
+/**
+ * @internal
+ * wrapper around user get_next to setup the index oid
+ */
+static int
+_${context}_loop_get_next_wrapper($mfd_aue_wrap_param_decl,
+ ${context}_ref_loop_ctx * loop_ctx_ref,
+ ${context}_ref_rowreq_ctx * rowreq_ctx_ref)
+{
+ int rc;
+ DEBUGMSGTL(("internal:${context}:_${context}_loop_get_next_wrapper","called\n"));
+
+ rc = ${context}_loop_get_next($mfd_aue_wrap_param->user_ctx, loop_ctx_ref,
+ rowreq_ctx_ref);
+ /*
+ * convert index to OID
+ */
+ if(SNMPERR_SUCCESS == rc ) {
+ netsnmp_assert((NULL != rowreq_ctx_ref) &&
+ (rowreq_ctx_ref->rowreq_ctx->oid_idx.oids == rowreq_ctx_ref->rowreq_ctx->oid_tmp));
+ rowreq_ctx_ref->rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx_ref->rowreq_ctx->oid_tmp);
+ rc = ${context}_index_to_oid(&rowreq_ctx_ref->rowreq_ctx->oid_idx,
+ &rowreq_ctx_ref->rowreq_ctx->tbl_idx);
+ netsnmp_assert(rowreq_ctx_ref->rowreq_ctx->oid_idx.len !=
+ sizeof(rowreq_ctx_ref->rowreq_ctx->oid_tmp));
+ }
+
+ return rc;
+} /* _${context}_loop_get_next_wrapper */
+
+@if $m2c_data_transient != 0@ #
+/**
+ * @internal
+ * get data wrapper to allocate context for the user
+ */
+static int
+_${context}_loop_get_data_wrapper($mfd_aue_wrap_param_decl,
+ ${context}_ref_loop_ctx * loop_ctx_ref,
+ ${context}_ref_rowreq_ctx * rowreq_ctx_ref)
+{
+// ${context}_rowreq_ctx *orig_ctx = rowreq_ctx_ref->rowreq_ctx;
+
+ DEBUGMSGTL(("internal:${context}:_${context}_loop_get_data_wrapper","called\n"));
+
+ return ${context}_loop_get_data($mfd_aue_wrap_param->user_ctx, loop_ctx_ref, rowreq_ctx_ref);
+} /* _${context}_loop_get_data_wrapper */
+
+@end@ // transient != 0
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_${context}_container_init(${context}_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:${context}:_${context}_container_init","called\n"));
+
+ if_ctx->container = netsnmp_container_iterator_get(/** registration */
+ if_ctx,
+ /** compare */
+ NULL,
+ /** get_first */
+ (Netsnmp_Iterator_Loop_Key*)_${context}_loop_get_first_wrapper,
+ /** get_next */
+ (Netsnmp_Iterator_Loop_Key*)_${context}_loop_get_next_wrapper,
+ /** get_data */
+@if $m2c_data_transient != 0@ #
+ (Netsnmp_Iterator_Loop_Data*)_${context}_loop_get_data_wrapper,
+@else@
+ NULL,
+@end@
+ /** save_pos */
+ (Netsnmp_Iterator_Ctx_Dup*)_${context}_loop_save_position,
+ /** init_context */
+ (Netsnmp_Iterator_Ctx*)NULL,
+ /** cleanup_context */
+ (Netsnmp_Iterator_Ctx*)_${context}_loop_cleanup_context,
+ /** free_user_ctx */
+ NULL,
+ /** sorted */
+ 0);
+} /* _${context}_container_init */
+
+##
+@end@ // m2c_processing_type eq 'i'
+########################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'c'@
+/**
+ * unsorted-external overview
+ *
+ * The unsorted external data access code works by calling a few simple
+ * functions to get the index value for each row. Once the agent determines
+ * which row is needed to process an incoming request, another function
+ * is called to retrieve the data for that row.
+ *
+ * A simplified version of the pseudo-code looks like this:
+ *
+ * ${context}_loop_get_first(loop,data)
+ * while( no_error ) {
+ * if( best_match(data, key)
+ * ${context}_loop_save_position(loop,pos);
+ * ${context}_loop_get_next(loop,data)
+ * }
+ * ${context}_loop_get_data(pos,data)
+ * ${context}_loop_cleanup_context(loop)
+ */
+
+/***********************************************************************
+ *
+ * ITERATION
+ *
+ ***********************************************************************/
+
+/**
+ * get the first data index
+ *
+ * Summary
+ * -------
+ * This function is called to initialize the iterator loop context for a
+ * new iteration loop and return the index(es) for the first
+ * ${context}_data in the data set.
+ *
+ * Note that during the loop, 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 should limit yourself to setting the indexes. Extracting the
+ * can be put off until the desired row is found. See the notes on
+ * ${context}_loop_get_data().
+ *
+ * Note that this function does not correspond to a SNMP GET pdu, and
+ * you should return data items in whatever order they are already in.
+ * (In fact, if your data is already ordered in the same order as the
+ * SNMP indexes, you shouldn't be using the unsorted-access code).
+ *
+ * This function should update the table index (rowreq_ctx_ref->rowreq_ctx->tbl_idx)
+ * values for the raw data (rowreq_ctx_ref->rowreq_ctx->data).
+ *
+ * More Details
+ * ------------
+ * If there is currently no data available, return MFD_END_OF_DATA.
+ * Otherwise, you should set rowreq_ctx_ref->rowreq_ctx and its indexes.
+ *
+ * rowreq_ctx_ref->rowreq_ctx will be NULL. You should allocate a new context
+ * for this loop. [Alternatively, you could allocate one in
+ * ${context}_loop_init_context, save it in your
+ * ${context}_ref_loop_ctx, and use it here.]
+ *
+ * Once you have your context pointer, you should set the index (or indexes)
+ * in rowreq_ctx_ref->rowreq_ctx->tbl_idx to the appropriate value for this row. [If you
+ * use your loop_ctx_ref cleverly, you might be able to put this work in
+ * ${context}_loop_get_next, and simply call that function.]
+ *
+ * @param $mfd_aue_param_cmt
+ * @param loop_ctx_ref Pointer to your loop reference.
+ * @param rowreq_ctx_ref Pointer to a context reference.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_END_OF_DATA : no data available
+ * @retval MFD_ERROR : error.
+ */
+int
+${context}_loop_get_first( $mfd_aue_param_decl, ${context}_ref_loop_ctx *loop_ctx_ref,
+ ${context}_ref_rowreq_ctx *rowreq_ctx_ref)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_loop_get_first","called\n"));
+
+ netsnmp_assert(rowreq_ctx_ref);
+ netsnmp_assert(loop_ctx_ref);
+
+ /*
+ * allocate memory for new structure
+ */
+ loop_ctx_ref->loop_ctx = SNMP_MALLOC_TYPEDEF(${context}_loop_context);
+ if(NULL == loop_ctx_ref->loop_ctx)
+ return MFD_ERROR;
+
+ /*
+ * allocate a temporary context to use during iteration
+ */
+@ eval $m2c_tmp = ""@
+@ if ($m2c_data_allocate == 1) || ($m2c_data_init == 1)@
+@ eval $m2c_tmp = "NULL"@
+@ if ($m2c_data_allocate == 1) && ($m2c_data_init == 1)@
+@ eval $m2c_tmp = "$m2c_tmp, NULL"@
+@ @end@
+@ end@
+ loop_ctx_ref->loop_ctx->rowreq_ctx = ${context}_allocate_rowreq_ctx($m2c_tmp);
+ if(NULL == loop_ctx_ref->loop_ctx->rowreq_ctx) {
+ SNMP_FREE(loop_ctx_ref->loop_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * ToDo:
+ * set up loop context
+ */
+@if $m2c_include_examples == 1@
+$example_start
+ /*
+ * open our data file.
+ */
+ loop_ctx_ref->loop_ctx->filep = fopen("/etc/dummy.conf", "r");
+ if(NULL == loop_ctx_ref->loop_ctx->filep) {
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+$example_end
+@end@
+
+@ifconf ${table}_update_idx.m2i@
+@ include ${table}_update_idx.m2i@
+@else@
+@ if $m2c_include_examples == 1@
+$example_start
+ /*
+ * in this example, after opening the file, get next does the same thing
+ * as get first, we let's just call get next...
+ */
+ return ${context}_loop_get_next($mfd_aue_param, loop_ctx_ref, rowreq_ctx_ref);
+$example_end
+@ else@
+ /*
+ * we just need the index for now. Reuse the one in the loop context's
+ * temporary row request context. (rowreq_ctx_ref->rowreq_ctx->tbl_idx)
+ */
+ rowreq_ctx_ref->rowreq_ctx = loop_ctx_ref->loop_ctx->rowreq_ctx;
+
+ /*
+ * ToDo:
+ * set local vars for index from loop_ctx_ref->loop_ctx
+ * this can be done in one of two ways:
+ */
+
+ /*
+ * 1) individually
+ */
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+ /*
+ * ToDo:
+ * set rowreq_ctx_ref->rowreq_ctx->tbl_idx->$node
+@ if $m2c_node_needlength == 1@
+ * and rowreq_ctx_ref->tbl_idx->${node}_len
+@ end@
+ */
+@ end@ #foreach
+
+ /*
+ * OR
+ */
+
+ /*
+ * 2) by calling ${context}_indexes_set()
+ * ${context}_indexes_set(rowreq_ctx_ref->tbl_idx,
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+@ if $m2c_node_needlength == 1@
+ * ${node}_ptr, ${node}_len
+@ else@
+ * $node
+@ end@
+@ end@ # foreach index
+ * );
+ */
+@ end@ # example
+@end@ #ifconf
+
+ return MFD_SUCCESS;
+} /* ${context}_loop_get_first */
+
+/**
+ * get the next data index
+ *
+ * Summary
+ * -------
+ * This function returns the next data item in the data set. The same
+ * caveat applies here as did above. The indexes are the important parts
+ * during loop processing.
+ *
+ * Note that this function does not correspond to a SNMP GET-NEXT pdu, and
+ * you should return data items in whatever order they are already in.
+ * (In fact, if your data is already ordered in the same order as the
+ * SNMP indexes, you shouldn't be using the unsorted-access code).
+ *
+ * More Details
+ * ------------
+ * rowreq_ctx_ref->rowreq_ctx will have been set in ${context}_loop_get_first.
+ *
+ * If there is currently no data available, return MFD_END_OF_DATA.
+ * Otherwise, you should set the indexes in rowreq_ctx_ref->rowreq_ctx->tbl_idx.
+ *
+ * You should set the index (or indexes) in rowreq_ctx_ref->rowreq_ctx->tbl_idx to the
+ * appropriate value for this row.
+ *
+ * @param $mfd_aue_param_cmt
+ * @param loop_ctx_ref Pointer to your loop reference.
+ * @param rowreq_ctx_ref Pointer to a context reference.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_END_OF_DATA : no more data available
+ * @retval MFD_ERROR : error.
+ */
+int
+${context}_loop_get_next( $mfd_aue_param_decl, ${context}_ref_loop_ctx *loop_ctx_ref,
+ ${context}_ref_rowreq_ctx *rowreq_ctx_ref)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_loop_get_next","called\n"));
+
+ netsnmp_assert(loop_ctx_ref && loop_ctx_ref->loop_ctx);
+ netsnmp_assert(rowreq_ctx_ref);
+
+ /*
+ * we just need the index for now. Reuse the one in the loop context's
+ * temporary row request context. (rowreq_ctx_ref->rowreq_ctx->tbl_idx)
+ */
+ rowreq_ctx_ref->rowreq_ctx = loop_ctx_ref->loop_ctx->rowreq_ctx;
+
+@ if $m2c_include_examples == 1@
+$example_start
+ /*
+ * get a line (skip blank lines)
+ */
+ do {
+ if (!fgets(loop_ctx_ref->loop_ctx->line, sizeof(loop_ctx_ref->loop_ctx->line),
+ loop_ctx_ref->loop_ctx->filep)) {
+ /* we're done */
+ fclose(loop_ctx_ref->loop_ctx->filep);
+ loop_ctx_ref->loop_ctx->filep = NULL;
+ }
+ } while (loop_ctx_ref->loop_ctx->filep && (loop_ctx_ref->loop_ctx->line[0] == '\n'));
+
+ /*
+ * check for end of data
+ */
+ if(NULL == loop_ctx_ref->loop_ctx->filep)
+ return MFD_END_OF_DATA;
+
+ /*
+ * ToDo:
+ * set local vars for index from loop_ctx_ref->loop_ctx
+ * this can be done in one of two ways:
+ */
+
+ /*
+ * 1) individually
+ */
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+ /*
+ * ToDo:
+ * set rowreq_ctx_ref->rowreq_ctx->tbl_idx->$node
+@ if $m2c_node_needlength == 1@
+ * and rowreq_ctx_ref->tbl_idx->${node}_len
+@ end@
+ */
+@ end@ #foreach
+
+ /*
+ * OR
+ */
+
+ /*
+ * 2) by calling ${context}_indexes_set()
+ * ${context}_indexes_set(rowreq_ctx_ref->tbl_idx,
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+@ if $m2c_node_needlength == 1@
+ * ${node}_ptr, ${node}_len
+@ else@
+ * $node
+@ end@
+@ end@ # foreach index
+ * );
+ */
+$example_end
+@ end@ # example
+
+ return MFD_SUCCESS;
+} /* ${context}_loop_get_next */
+
+/**
+ * duplicate the current loop reference
+ *
+ * Summary
+ * -------
+ * During loop iteration, the iterator keeps track of the row that
+ * is the current best match. This function is called when the
+ * current row is a better match than any previous row.
+ *
+ * You should save any information you need to be able to locate this row
+ * again from the current loop context to a new loop context.
+ *
+ * At the end of the loop, when the best match has been found, the saved
+ * loop context will be used to get the data for the row by calling
+ * ${context}_loop_get_data().
+@if $m2c_data_transient != 0@ # persistent
+ *
+ * Since your data is transient, you need to make a copy of it before
+ * the iterator moves on to the next row.
+@end@
+ *
+@if $m2c_data_transient != 0@ # persistent
+ * More Details
+ * ------------
+@ if $m2c_data_transient == 1@ # short term
+ * Since your data is semi-TRANSIENT data, you could just keep a pointer
+ * to the data in the loop reference. The data should then be copied in
+ * ${context}_loop_get_data().
+@ else@ # $m2c_data_transient == 2@ # copy immediately
+ * One idea would be to copy it space allocated in the loop reference
+ * structure. Another would be to simply have a pointer in the loop
+ * reference structure, and allocate memory here.
+ *
+@ end@
+@end@
+ * @param $mfd_aue_param_cmt
+ * @param loop_ctx_ref Reference to current loop context.
+ * @param save_loop_ctx_ref Reference to a loop context for saving the current
+ * position. If reuse is not set or
+ * save_loop_ctx_ref->loop_ctx is NULL, allocate
+ * a new one. If reuse is set, you may reuse the existing
+ * loop_ctx.
+ * @param reuse Indicates if an existing save_loop_ctx_ref->loop_ctx
+ * may be reused.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : error.
+ */
+int
+${context}_loop_save_position($mfd_aue_param_decl,
+ ${context}_ref_loop_ctx *loop_ctx_ref,
+ ${context}_ref_loop_ctx *save_loop_ctx_ref,
+ int reuse)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_loop_save_position","called\n"));
+
+ netsnmp_assert(loop_ctx_ref && save_loop_ctx_ref);
+
+ /*
+ * ToDo:
+ * 1) allocate new loop context, unless you can reuse a previous pointer.
+ * 2) save information for the position of loop_ctx_ref in save_loop_ctx_ref.
+ */
+ if((0 == reuse) || (NULL == save_loop_ctx_ref->loop_ctx))
+ save_loop_ctx_ref->loop_ctx = SNMP_MALLOC_TYPEDEF(${context}_loop_context);
+ if(NULL == save_loop_ctx_ref->loop_ctx) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * if you can reuse a previously saved contex, just swap
+ * it out with the loop iterator
+ */
+ if(reuse && save_loop_ctx_ref->loop_ctx->rowreq_ctx) {
+ ${context}_rowreq_ctx * tmp_rowreq_ctx = save_loop_ctx_ref->loop_ctx->rowreq_ctx;
+ save_loop_ctx_ref->loop_ctx->rowreq_ctx = loop_ctx_ref->loop_ctx->rowreq_ctx;
+ loop_ctx_ref->loop_ctx->rowreq_ctx = tmp_rowreq_ctx;
+ }
+ else {
+ /*
+ * take the current pointer
+ */
+ save_loop_ctx_ref->loop_ctx->rowreq_ctx = loop_ctx_ref->loop_ctx->rowreq_ctx;
+
+ /*
+ * allocate a new context to replace the one you just took.
+ */
+@ eval $m2c_tmp = ""@
+@ if ($m2c_data_allocate == 1) || ($m2c_data_init == 1)@
+@ eval $m2c_tmp = "NULL"@
+@ if ($m2c_data_allocate == 1) && ($m2c_data_init == 1)@
+@ eval $m2c_tmp = "$m2c_tmp, NULL"@
+@ @end@
+@ end@
+ loop_ctx_ref->loop_ctx->rowreq_ctx = ${context}_allocate_rowreq_ctx($m2c_tmp);
+ if(NULL == loop_ctx_ref->loop_ctx->rowreq_ctx) {
+ SNMP_FREE(loop_ctx_ref->loop_ctx);
+ return MFD_ERROR;
+ }
+ }
+
+@if $m2c_data_transient == 0@ # persistent
+ /** non-TRANSIENT data: no need to copy */
+@elsif $m2c_data_transient == 1@ # short term
+ /** semi-TRANSIENT data: will copy data when index found */
+ /** only need to copy pertinent data from loop context */
+@elsif $m2c_data_transient == 2@ # copy immediately
+ /*
+ * TRANSIENT data: copy all the data.
+ */
+@end@
+@if $m2c_include_examples == 1@
+$example_start
+@ if $m2c_data_transient == 1@ # short term
+ /** save line to do that */
+ memcpy(save_loop_ctx_ref->loop_ctx->line, loop_ctx_ref->loop_ctx->line,
+ sizeof(loop_ctx_ref->loop_ctx->line));
+@ elsif $m2c_data_transient == 2@ # copy immediately
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+ /*
+ * ToDo:
+ * set rowreq_ctx_ref->${m2c_data_item}$node
+ * from the loop context
+ */
+@ end@
+@ end@
+$example_end
+@end@ # example
+
+ return MFD_SUCCESS;
+} /* ${context}_loop_save_position */
+
+@if $m2c_data_transient != 0@ # semi-transient
+/**
+ * set ${context}_data from a data context
+ *
+ * Summary
+ * -------
+ * At the end of the loop, when the best match has been found, the saved
+ * loop context will be used to get the data for the row by calling
+ * ${context}_loop_get_data().
+ *
+ * You should return a fully populated row request context in
+ * rowreq_ctx_ref->rowreq_ctx.
+ *
+ * More Details
+ * ------------
+ * @param $mfd_aue_param_cmt
+ * @param loop_ctx_ref pointer to your loop reference.
+ * @param rowreq_ctx_ref pointer to a context reference.
+ */
+int
+${context}_loop_get_data( $mfd_aue_param_decl, ${context}_ref_loop_ctx *loop_ctx_ref,
+ ${context}_ref_rowreq_ctx *rowreq_ctx_ref)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_loop_get_data","called\n"));
+
+ netsnmp_assert((NULL != loop_ctx_ref) && (NULL != loop_ctx_ref->loop_ctx));
+ netsnmp_assert(NULL != rowreq_ctx_ref);
+ netsnmp_assert(NULL != rowreq_ctx_ref->rowreq_ctx);
+
+ /*
+ * take temporary row request context from loop context
+ */
+ rowreq_ctx_ref->rowreq_ctx = loop_ctx_ref->loop_ctx->rowreq_ctx;
+ loop_ctx_ref->loop_ctx->rowreq_ctx = NULL;
+
+ /*
+ * copy data to the data context (rowreq_ctx_ref->${m2c_data_item})
+@ if $m2c_include_examples == 1@
+ * in loop_save_position, we saved line to do that
+@ end@
+ */
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+ /*
+ * $m2c_node_summary
+ */
+@ eval $m2c_ctx_lh = "rowreq_ctx_ref->$m2c_ctx_rh"@
+@ eval $m2c_ctx_lhs = "rowreq_ctx_ref->$m2c_ctx_rhs"@
+@ eval $m2c_ctx_rh = "loop_ctx_ref->loop_ctx->$node"@
+@ eval $m2c_ctx_rhs = "loop_ctx_ref->loop_ctx->${node}_len"@
+@ include generic-value-map.m2i@
+
+@ end@
+
+ return MFD_SUCCESS;
+} /* ${context}_loop_get_data */
+
+@end@ // if $m2c_data_transient != 0
+
+/**
+ * clean up a loop reference
+ *
+ * Summary
+ * -------
+ * This function will be called once the loop iteration has completed
+ * to release any memory or resources allocated for the loop context.
+ *
+ * More Details
+ * ------------
+ * @param $mfd_aue_param_cmt
+ * @param loop_ctx_ref Pointer to your loop reference.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : error.
+ */
+int
+${context}_loop_cleanup_context( $mfd_aue_param_decl, ${context}_ref_loop_ctx *loop_ctx_ref)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_loop_cleanup_context","called\n"));
+
+ netsnmp_assert(loop_ctx_ref);
+
+ if(!loop_ctx_ref->loop_ctx)
+ return MFD_ERROR;
+
+ /*
+ * release the row request context, if it wasn't taken
+ */
+ if(loop_ctx_ref->loop_ctx->rowreq_ctx)
+ ${context}_release_rowreq_ctx(loop_ctx_ref->loop_ctx->rowreq_ctx);
+
+ /*
+ * ToDo:
+ * release resources
+ */
+@if $m2c_include_examples == 1@
+$example_start
+ /*
+ * close file
+ */
+ if(loop_ctx_ref->loop_ctx->filep)
+ fclose(loop_ctx_ref->loop_ctx->filep);
+$example_end
+
+@end@
+ /*
+ * free loop context
+ */
+ free(loop_ctx_ref->loop_ctx);
+
+ return MFD_SUCCESS;
+} /* ${context}_loop_cleanup_context */
+
+@end@ // m2c_processing_type eq 'c'
+########################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'r'@
+##
+ unsorted-external summary
+ -------------------------
+ The unsorted-external data access code is for cases when you data is
+ kept UNSORTED and EXTERNAL to the agent/sub-agent.
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) The raw data for this table is UNSORTED.
+ @if $mfd_readme_verbose != 0@
+
+ UNSORTED data is data that is not kept in the same order as the way
+ SNMP expects the index(es) for the table to be kept. [It could very
+ well be sorted in some other order, but for the purpose of SNMP, the
+ order is incorrect.] If you're not sure if your data is sorted
+ in an SNMP compliant way, its likely not.
+
+ Because the raw data is unsorted, to satisfy a particular request, the
+ entire data set must be examined to find the apropriate index. This
+ is done via a simple loop. The MFD handler will call your get_first
+ function and the call the get_next function repeatedly, until it
+ returns SNMPERR_NO_VARS.
+ @end@
+
+ 2) The raw data for this table is EXTERNAL.
+ @if $mfd_readme_verbose != 0@
+
+ EXTERNAL data is data that is owned by some other process,
+ device, file or mechanism. The agent must use some interface to
+ read or modify the data. An external process may modify the data
+ without the agent's knowledge. For example, the Net-SNMP agent
+ implements the interface table (ifTable), which reports on
+ network interfaces. The host operating system owns this data, and
+ Net-SNMP must use system calls to report or manipulate the data.
+ Examples of external data include data stored in kernel space, in
+ files, in another non-memory shared process, and data stored in
+ devices.
+ @end@
+
+ 3) The raw data for this table is TRANSIENT.
+ @if $mfd_readme_verbose != 0@
+
+ TRANSIENT data is data that may be overwritten by another funtion
+ or process. For example, many OS functions return data in a
+ static buffer that will be reused the next time the function is
+ called. Because of this, we will assume that you will copy the
+ raw data retrieved from these other sources to a generated
+ structure for use within the Net-SNMP agent. (Don't worry, we'll
+ help you)
+ @end@
+
+
+##
+## this should be syncronized with master version of comments in
+## mfd-access-unsorted-external-body.m2i You should be able to copy
+## the comments here and replace " * " with " ".
+##
+ The unsorted external data access code works by calling a few simple
+ functions to get the index value for each row. Once the agent determines
+ which row is needed to process an incoming request, another function
+ is called to retrieve the data for that row.
+
+ A simplified version of the pseudo-code looks like this:
+
+ ${context}_loop_init_context(loop)
+ ${context}_loop_get_first(loop,data)
+ while( no_error ) {
+ if( best_match(data, key)
+ ${context}_loop_save_position(loop,pos);
+ ${context}_loop_get_next(loop,data)
+ }
+ ${context}_loop_get_data(pos,data)
+ ${context}_loop_cleanup_context(loop)
+##
+## end sync
+##
+
+ We will talk about each individual step below.
+
+
+########################################################################
+ Defining context for the loop
+ -----------------------------
+ ToDo : typedef ${context}_loop_context
+ WHERE: ${table}_data_access.h
+
+ @if $mfd_readme_verbose != 0@
+##
+## this should be syncronized with master version of comments in
+## mfd-access-unsorted-external-body.m2i You should be able to copy
+## the comments here and replace " * " with " ".
+##
+ Since the actual loop is in the MFD handler, a loop contex parameter
+ is provided to help you keep track of where you are in between calls
+ to functions that you wrote and the master MFD handler calls. The
+ structure of this context is user defineable, and is defined in the
+ file ${table}_data_access.h.
+
+ E.G., if your data is stored in a linked list, the obvious thing you
+ want to know from one function call to the next is your current
+ position in the linked list. Thus the easiest context to use is a
+ pointer within the linked list. For an array, the current index to
+ that array would be easiest.
+
+ The funtion calls are actually passed a reference to the loop
+ context, to allow the loop context to be allocated memory. Here are
+ some simple examples definitions for various data formats. These
+ definitions are used in examples later on.
+##
+## end sync
+##
+
+ Linked list
+ -----------
+ typedef list_node ${context}_loop_context;
+
+ Array
+ -----
+ typedef integer ${context}_loop_context;
+
+ File
+ ----
+ typedef struct ${context}_loop_context_s {
+ char * file_name;
+ FILE * f;
+ char line[128];
+ } ${context}_loop_context;
+
+ @end@
+
+########################################################################
+ Initialization
+ --------------
+ ToDo : Initialization
+ FUNC : ${context}_loop_init_data
+ WHERE: ${table}_data_access.c
+
+ @if $mfd_readme_verbose != 0@
+ The ${context}_loop_init_data function will be called during startup to
+ allow for any initialization needed for the data access routines.
+
+ @end@
+
+########################################################################
+ Preparing for the loop
+ ----------------------
+ ToDo : initialize loop context
+ FUNC : ${context}_loop_init_context
+ WHERE: ${table}_data_access.c
+
+ @if $mfd_readme_verbose != 0@
+##
+## this should be syncronized with master version of comments in
+## mfd-access-unsorted-external-body.m2i You should be able to copy
+## the comments here and replace " * " with " ".
+##
+ This function will be called before the start of a new itertion over
+ the data. The loop context that is initialized here will be passed to
+ ${context}_loop_get_first and ${context}_loop_get_next.
+
+ Set the loop context variable ref->loop_ctx so that the iteration
+ functions (get_first and get_next) can locate the apropriate data
+ context.
+##
+## end sync
+##
+
+ The primary purpose of the loop_init_context call is to initialize
+ the loop context data (ref). Here are some simple examples, based on the
+ earlier example loop contexts.
+
+ Linked list
+ -----------
+ ref->loop_ctx = my_table_head_ptr;
+
+ Array
+ -----
+ /* instead of actually allocating memory, just use the pointer */
+ /* as an integer */
+ (integer)(ref->loop_ctx) = 0;
+
+ File
+ ----
+ ref->loop_ctx = SNMP_MALLOC_TYPEDEF(${context}_loop_context);
+ /* error checking here */
+ ref->loop_ctx->file_name = (char*) reg->mfd_user_ctx;
+ ref->loop_ctx->f = fopen( ref->loop_ctx->file_name, "r+" );
+
+ @end@
+
+########################################################################
+ The Loop
+ --------
+ ToDo : return raw data
+ FUNC : ${context}_loop_get_first
+ WHERE: ${table}_data_access.c
+
+ @if $mfd_readme_verbose != 0@
+##
+## this should be syncronized with master version of comments in
+## mfd-access-unsorted-external-body.m2i You should be able to copy
+## the comments here and replace " * " with " ".
+##
+ This function is called to return set the index(es) for the first
+ ${context}_data in the data set.
+
+ Note that during the loop, 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 should limit yourslef to setting the indexes. Extracting the
+ can be put off until the desired row is found See the notes on
+ ${context}_loop_get_data().
+
+ Note that this function does not correspond to a SNMP GET pdu, and
+ you should return data items in whatever order they are already in.
+ (In fact, if your data is already ordered in the same order as the
+ SNMP indexes, you shouldn't be using the unsorted-access code).
+
+ This function should update the table index (rowreq_ctx_ref->rowreq_ctx->tbl_idx)
+ values for the raw data (rowreq_ctx_ref->rowreq_ctx->data).
+##
+## end sync
+##
+
+ Linked list
+ -----------
+ rowreq_ctx_ref->rowreq_ctx->data = loop_ctx_ref->loop_ctx;
+
+ Array
+ -----
+ /* assuming registration has array of pointers */
+ rowreq_ctx_ref->rowreq_ctx->data = reg->mfd_user_ctx[(integer)(ref->loop_ctx)];
+
+ File
+ ----
+ fgets(loop_ctx_ref->loop_ctx->line, sizeof(loop_ctx_ref->loop_ctx->line),
+ loop_ctx_ref->loop_ctx->f);
+ rowreq_ctx_ref->rowreq_ctx->data = loop_ctx_ref->loop_ctx->line;
+
+ @end@
+
+ ToDo : return raw data
+ FUNC : ${context}_loop_get_next
+ WHERE: ${table}_data_access.c
+
+ @if $mfd_readme_verbose != 0@
+##
+## this should be syncronized with master version of comments in
+## mfd-access-unsorted-external-body.m2i You should be able to copy
+## the comments here and replace " * " with " ".
+##
+ This function returns the next data item in the data set. The same
+ caveat applies here as did above. The indexes are the important parts
+ during loop processing.
+
+ Note that this function does not correspond to a SNMP GET-NEXT pdu, and
+ you should return data items in whatever order they are already in.
+ (In fact, if your data is already ordered in the same order as the
+ SNMP indexes, you shouldn't be using the unsorted-access code).
+##
+## end sync
+##
+
+ Linked list
+ -----------
+ loop_ctx_ref->loop_ctx = loop_ctx_ref->loop_ctx->next;
+ rowreq_ctx_ref->rowreq_ctx->data = loop_ctx_ref->loop_ctx;
+
+ Array
+ -----
+ ++((integer)(ref->loop_ctx));
+ /* assuming registration has array of pointers */
+ rowreq_ctx_ref->rowreq_ctx->data = reg->mfd_user_ctx[(integer)(ref->loop_ctx)];
+
+ File
+ ----
+ fgets(loop_ctx_ref->loop_ctx->line, sizeof(loop_ctx_ref->loop_ctx->line),
+ loop_ctx_ref->loop_ctx->f);
+ rowreq_ctx_ref->rowreq_ctx->data = loop_ctx_ref->loop_ctx->line;
+
+ @end@
+
+########################################################################
+ Updating the Index
+ ------------------
+ ToDo : update index for the raw data
+ FUNC : ${context}_indexes_set
+ WHERE: ${table}_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.
+
+ @if $mfd_readme_verbose == 1@
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+ @end@
+
+########################################################################
+ Saving a position in the loop
+ -----------------------------
+ ToDo : Saving a position in the loop
+ FUNC : ${context}_loop_save_position
+ WHERE: ${table}_data_access.c
+
+ @if $mfd_readme_verbose != 0@
+##
+## this should be syncronized with master version of comments in
+## mfd-access-unsorted-external-body.m2i You should be able to copy
+## the comments here and replace " * " with " ".
+##
+ During loop iteration, the iterator keeps track of the row that
+ is the current best match. This function is called when the
+ current row is a better match than any previous row.
+
+ You should save any information you need to be able to locate this row
+ again from the current loop context to a new loop context.
+
+ At the end of the loop, when the best match has been found, the saved
+ loop context will be used to get the data for the row by calling
+ ${context}_loop_get_data().
+@if $m2c_data_transient != 0@ # persistent
+
+ Since your data is transient, you need to make a copy of it before
+ the iterator moves on to the next row.
+@end@
+##
+## end sync
+##
+
+ @end@
+
+########################################################################
+ Returning Data For an Index
+ ---------------------------
+ ToDo : copy transient raw data to generated structure
+ FUNC : ${context}_loop_get_data
+ WHERE: ${table}_data_access.c
+
+ @if $mfd_readme_verbose != 0@
+##
+## this should be syncronized with master version of comments in
+## mfd-access-unsorted-external-body.m2i You should be able to copy
+## the comments here and replace " * " with " ".
+##
+ At the end of the loop, when the best match has been found, the saved
+ loop context will be used to get the data for the row by calling
+ ${context}_loop_get_data().
+##
+## end sync
+##
+
+ @end@
+
+########################################################################
+ Cleaning up after the loop
+ --------------------------
+ ToDo : release any allocated memory
+ FUNC : ${context}_loop_cleanup_context
+ WHERE: ${table}_data_access.c
+
+ @if $mfd_readme_verbose != 0@
+##
+## this should be syncronized with master version of comments in
+## mfd-access-unsorted-external-body.m2i You should be able to copy
+## the comments here and replace " * " with " ".
+##
+ This function will be called once the loop iteration has completed
+ to release any memory allocated for loop reference.
+##
+## end sync
+##
+ The purpose of the loop_cleanup_context call is to release any memory
+ allocated for the loop context data. Here are some simple examples, based
+ on the earlier example loop contexts.
+
+ Linked list
+ -----------
+ /* nothing to do */
+
+ Array
+ -----
+ /* nothing to do */
+
+ File
+ ----
+ free(ref->loop_ctx);
+
+ @end@
+
+##
+@end@ // m2c_processing_type eq 'r
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/mfd-data-access.m2c b/local/mib2c-conf.d/mfd-data-access.m2c
new file mode 100644
index 0000000..bcff9bb
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-data-access.m2c
@@ -0,0 +1,331 @@
+##//######################################################### -*- c -*-
+##//generic include for XXX. Do not use directly.
+##
+##//$Id$
+##//####################################################################
+##//####################################################################
+##
+## lower conf files get confused with multiple processing types, so
+## set single options
+@eval $mfd_data_access_processing_type = "$m2c_processing_type"@
+@eval $m2c_processing_type = 'h'@
+@open ${name}_data_access.h@
+@eval $hack = "Id"@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ */
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+@eval $m2c_save = "$name"@
+@eval $name = "${name}_DATA_ACCESS"@
+@include generic-header-top.m2i@
+@eval $name = "$m2c_save"@
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ include details-table.m2i@
+
+##@ eval $m2c_tmp=""@
+##@ foreach $node index@
+##@ include m2c_setup_node.m2i@
+##@ eval $m2c_tmp="$m2c_tmp, $m2c_node_param_val"@
+##@ end@ // for each index
+
+ int ${context}_init_data(${context}_registration * ${context}_reg);
+
+@ include mfd-access-${m2c_table_access}-defines.m2i@
+ int ${context}_row_prep( ${context}_rowreq_ctx *rowreq_ctx);
+
+@ if ($m2c_table_row_creation == 1) || ($m2c_table_persistent == 1)@
+int ${context}_validate_index( ${context}_registration * ${context}_reg,
+ ${context}_rowreq_ctx *rowreq_ctx);
+@ foreach $node externalindex@
+@ include m2c_setup_node.m2i@
+ int ${context}_${node}_check_index( ${context}_rowreq_ctx *rowreq_ctx ); /* external */
+@ end@ # foreach externalindex
+@ foreach $node internalindex@
+@ include m2c_setup_node.m2i@
+int ${node}_check_index( ${context}_rowreq_ctx *rowreq_ctx ); /* internal */
+@ end@ # foreach internalindex
+@ end@ # row creation/persistent
+@end@
+
+@eval $m2c_save = "$name"@
+@eval $name = "${name}_DATA_ACCESS"@
+@include generic-header-bottom.m2i@
+@eval $name = "$m2c_save"@
+##//##################################################################
+##//Do the .c file
+##//##################################################################
+@eval $m2c_processing_type = 'c'@
+@open ${name}_data_access.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ */
+@include generic-source-includes.m2i@
+
+#include "${name}_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.
+ *
+ * @{
+ */
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ include details-table.m2i@
+
+/**
+ * initialization for ${context} data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ${context}_reg
+ * Pointer to ${context}_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+${context}_init_data(${context}_registration * ${context}_reg)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize $context data.
+ */
+@ifconf ${table}_init_data.m2i@
+@ include ${table}_init_data.m2i@
+@else@
+@ if $m2c_include_examples == 1@
+$example_start
+ /*
+ * 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.
+ */
+$example_end
+@ end@
+
+ return MFD_SUCCESS;
+@end@ #ifconf
+} /* ${context}_init_data */
+
+@ include mfd-access-${m2c_table_access}-defines.m2i@
+/**
+ * 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
+${context}_row_prep( ${context}_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_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;
+} /* ${context}_row_prep */
+
+##//####################################################################
+@ if ($m2c_table_row_creation == 1) || ($m2c_table_persistent == 1)@
+/*
+ * TODO:420:r: Implement $context index validation.
+ */
+@ foreach $node externalindex@
+@ include m2c_setup_node.m2i@
+@ if $m2c_report_progress == 1@
+@ print | | +-> Processing index $node@
+@ end@
+@ include details-node.m2i@
+/**
+ * check validity of ${node} 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
+ * ${context}_validate_index() function.
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ */
+int
+${context}_${node}_check_index( ${context}_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_${node}_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:424:M: |-> Check $context external index $node.
+ * check that index value in the table context (rowreq_ctx)
+ * for the external index $node is legal.
+ */
+
+ return MFD_SUCCESS; /* external index $node ok */
+} /* ${context}_${node}_check_index */
+
+@ end@ # foreach externalindex
+@ foreach $node internalindex@
+@ include m2c_setup_node.m2i@
+@ if $m2c_report_progress == 1@
+@ print | | +-> Processing index $node@
+@ end@
+@ include details-node.m2i@
+/**
+ * check validity of ${node} 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
+ * ${context}_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 $node.enums == 1@
+ * The value is one of $m2c_evals
+@elsif $node.ranges == 1@
+@ if ("$node.decl" eq "long") || ("$node.decl" eq "u_long")@
+@ eval $m2c_tmp_ns = "value"@
+@ else@
+@ eval $m2c_tmp_ns = "length"@
+@ end@
+ * The $m2c_tmp_ns is in (one of) the range set(s): $m2c_evals
+@end@
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+${node}_check_index( ${context}_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:${context}:${node}_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check $context index $node.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.$node)
+ */
+
+ return MFD_SUCCESS; /* $node index ok */
+} /* ${node}_check_index */
+
+@ end@ # foreach internalindex
+/**
+ * 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 ${context}_reg
+ * Pointer to the user registration data
+ * @param ${context}_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
+${context}_validate_index( ${context}_registration * ${context}_reg,
+ ${context}_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:${context}:${context}_validate_index","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:430:M: |-> Validate potential $context index.
+ */
+ if(1) {
+ snmp_log(LOG_WARNING,"invalid index for a new row in the "
+ "${context} 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;
+} /* ${context}_validate_index */
+
+@ end@ # persistent/row creation
+@end@
+##
+/** @} */
+##//####################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
+@eval $m2c_processing_type = "$mfd_data_access_processing_type"@
diff --git a/local/mib2c-conf.d/mfd-data-get.m2c b/local/mib2c-conf.d/mfd-data-get.m2c
new file mode 100644
index 0000000..cf1c848
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-data-get.m2c
@@ -0,0 +1,168 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+########################################################################
+## lower conf files get confused with multiple processing types, so
+## set single options
+@eval $mfd_data_get_processing_type_save = "$m2c_processing_type"@
+@if "$mfd_processing_types" =~ /h/@
+@eval $m2c_processing_type = 'h'@
+@if $m2c_create_fewer_files != 1@
+@ open ${name}_data_get.h@
+@ eval $hack = "Id"@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ *
+ * @file ${name}_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+@ eval $m2c_tmp = "$name"@
+@ eval $name = "${name}_DATA_GET"@
+@ include generic-header-top.m2i@
+@ eval $name = "$m2c_tmp"@
+@end@ // m2c_create_fewer_files
+@if $m2c_mark_boundary == 1@
+/** START header generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ include details-table.m2i@
+ /*
+ * indexes
+ */
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+@ if $m2c_node_skip_mapping != 1@
+ int ${node}_map($m2c_node_map_param);
+@ end@ # // skip mapping
+@ end@ # index
+
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $m2c_node_skip_mapping != 1@
+ int ${node}_map($m2c_node_map_param);
+@ end@ # // skip mapping
+ int ${node}_get( ${context}_rowreq_ctx *rowreq_ctx, $m2c_node_param_ref );
+@ end@ // nonindex
+
+@ include generic-table-indexes-set.m2i@
+
+@end@ // table
+
+@if $m2c_mark_boundary == 1@
+/** END header generated by $RCSfile$ $Revision$ */
+@end@
+@if $m2c_create_fewer_files != 1@
+@ eval $m2c_tmp = "$name"@
+@ eval $name = "${name}_DATA_GET"@
+@ include generic-header-bottom.m2i@
+@ eval $name = "$m2c_tmp"@
+/** @} */
+@end@ // m2c_create_fewer_files
+######################################################################
+@end@ // $mfd_processing_types =~ /h/
+######################################################################
+######################################################################
+######################################################################
+@if "$mfd_processing_types" =~ /c/@
+@eval $m2c_processing_type = 'c'@
+@if $m2c_create_fewer_files != 1@
+@open ${name}_data_get.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ */
+@include generic-source-includes.m2i@
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement $context get routines.
+ * TODO:240:M: Implement $context 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.
+ *
+ * @{
+ */
+@end@ // m2c_create_fewer_files
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ include details-table.m2i@
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement $context data context functions.
+ */
+@ if (($m2c_data_allocate == 1) || ($m2c_undo_embed == 0)) && ("$m2c_data_context" ne "generated")@
+@ include generic-data-allocate.m2i@
+@ end@
+
+##
+## do nodes
+##
+##// internal only? how to know how to map external?
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+@ if $m2c_node_skip_mapping != 0@
+@ next@
+@ end@
+@ include details-node.m2i@
+@ if $m2c_report_progress == 1@
+@ print | | +-> Processing index $node@
+@ end@
+@ include generic-value-map-func.m2i@
+@ end@ # foreach column
+
+@ include generic-table-indexes-set.m2i@
+
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ include details-node.m2i@
+@ if $node.noaccess == 1@
+@ next@ # skip to next column
+@ end@
+@ if $m2c_report_progress == 1@
+@ print | | +-> Processing nonindex $node@
+@ end@
+@ if $m2c_node_skip_mapping == 0@
+@ include generic-value-map-func.m2i@
+@ end@
+@ include node-get.m2i@
+@ end@ # foreach column
+
+@end@ # foreach table
+
+##
+/** @} */
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+@end@ // $mfd_processing_types =~ /c/
+## restore original processing types
+@eval $m2c_processing_type = "$mfd_data_get_processing_type_save"@
diff --git a/local/mib2c-conf.d/mfd-data-set.m2c b/local/mib2c-conf.d/mfd-data-set.m2c
new file mode 100644
index 0000000..1150551
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-data-set.m2c
@@ -0,0 +1,142 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+## lower conf files get confused with multiple processing types, so
+## set single options
+@eval $mfd_data_set_processing_type_save = "$m2c_processing_type"@
+@if "$mfd_processing_types" =~ /h/@
+@eval $m2c_processing_type = 'h'@
+@if $m2c_create_fewer_files != 1@
+@ eval $hack = "Id"@
+@open ${name}_data_set.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ */
+@eval $m2c_save = "$name"@
+@eval $name = "${name}_DATA_SET"@
+@include generic-header-top.m2i@
+@eval $name = "$m2c_save"@
+@end@ // m2c_create_fewer_files
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START header generated by $RCSfile$ $Revision$ */
+@end@
+##
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ if $m2c_table_settable == 0@
+@ next@ # skip to next table
+@ end@
+@ include details-table.m2i@
+
+@ include parent-set.m2i@
+
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+int ${node}_check_value( ${context}_rowreq_ctx *rowreq_ctx, $m2c_node_param_val);
+int ${node}_undo_setup( ${context}_rowreq_ctx *rowreq_ctx );
+int ${node}_set( ${context}_rowreq_ctx *rowreq_ctx, $m2c_node_param_val );
+int ${node}_undo( ${context}_rowreq_ctx *rowreq_ctx );
+
+@ end@ # foreach nonindex
+
+int ${context}_check_dependencies(${context}_rowreq_ctx *ctx);
+@end@ # foreach table
+
+@if $m2c_mark_boundary == 1@
+/** END header generated by $RCSfile$ $Revision$ */
+@end@
+@if $m2c_create_fewer_files != 1@
+@eval $m2c_save = "$name"@
+@eval $name = "${name}_DATA_SET"@
+@include generic-header-bottom.m2i@
+@eval $name = "$m2c_save"@
+@end@ // m2c_create_fewer_files
+######################################################################
+@end@ // mfd_processing_types =~ /h/
+######################################################################
+######################################################################
+######################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if "$mfd_processing_types" =~ /c/@
+@eval $m2c_processing_type = 'c'@
+@if $m2c_create_fewer_files != 1@
+@open ${name}_data_set.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ *
+ */
+@include generic-source-includes.m2i@
+
+/** @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.
+ *
+ * @{
+ */
+@end@ // m2c_create_fewer_files
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ if $m2c_table_settable == 0@
+@ next@ # skip to next table
+@ end@
+@ include details-table.m2i@
+########################################################################
+@ include parent-set.m2i@
+########################################################################
+########################################################################
+/*
+ * TODO:440:M: Implement $context node value checks.
+ * TODO:450:M: Implement $context undo functions.
+ * TODO:460:M: Implement $context set functions.
+ * TODO:480:M: Implement $context commit functions.
+ */
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $node.settable == 0@
+@ next@ # skip to next column
+@ end@
+@ if $m2c_report_progress == 1@
+@ print | | +-> Processing nonindex $node@
+@ end@
+@ include details-node.m2i@
+@ include node-set.m2i@
+@ end@ # foreach column
+########################################################################
+@ if $m2c_table_dependencies == 1@
+@ include parent-dependencies.m2i@
+@ end@
+########################################################################
+@end@ # foreach table
+##
+########################################################################
+/** @} */
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+@end@ // mfd_processing_type =~ /c/
+## restore original processing types
+@eval $m2c_processing_type = "$mfd_data_set_processing_type_save"@
diff --git a/local/mib2c-conf.d/mfd-doxygen.m2c b/local/mib2c-conf.d/mfd-doxygen.m2c
new file mode 100644
index 0000000..25406a0
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-doxygen.m2c
@@ -0,0 +1,60 @@
+########################################################################
+@foreach $table table@
+@ ifconf ${context}_doxygen.conf
+@ print "${context}_doxygen.conf exists, skipping.@
+@ else@
+@ include m2c_setup_table.m2i@
+@ open ${context}_doxygen.conf@
+#---------------------------------------------------------------------------
+# 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 = ${context}
+
+# 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 =
+@ end@ # conf file exists
+@end@ # foreach table
diff --git a/local/mib2c-conf.d/mfd-interactive-setup.m2c b/local/mib2c-conf.d/mfd-interactive-setup.m2c
new file mode 100644
index 0000000..e3d3d55
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-interactive-setup.m2c
@@ -0,0 +1,335 @@
+#######################################################################
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+@eval $m2c_temp_writable = table_is_writable($context)@
+@eval $m2c_temp_create = table_has_create($context)@
+@eval $m2c_temp_dependencies = $m2c_temp_writable@
+@eval $m2c_temp_context_reg = "$mfd_default_context_reg"@
+@eval $m2c_temp_data_context = "$mfd_default_data_context"@
+@eval $m2c_temp_data_allocate = $mfd_default_data_allocate@
+@eval $m2c_temp_data_cache = $mfd_default_data_cache@
+@eval $m2c_temp_undo_embed = $mfd_default_undo_embed@
+@eval $m2c_temp_data_init = $mfd_default_data_init@
+@eval $m2c_temp_persistent = $m2c_temp_writable@
+@eval $m2c_temp_table_access = "$mfd_default_table_access"@
+@eval $m2c_temp_data_transient = $mfd_default_data_transient@
+@eval $m2c_temp_include_examples = $mfd_default_include_examples@
+@eval $m2c_temp_table_skip_mapping = $mfd_default_table_skip_mapping@
+@eval $m2c_temp_table_sparse = $mfd_default_data_sparse@
+@eval $m2c_temp_generate_makefile = $mfd_default_generate_makefile@
+@eval $m2c_temp_generate_subagent = $mfd_default_generate_subagent@
+##
+@if $mfd_interactive_setup != 0@
+@open -@
+@ if $mfd_interactive_setup != -1@
+There are no defaults for ${context}. Would you like to
+
+ 1) Accept hard-coded defaults
+ 2) Set defaults now [DEFAULT]
+
+@ eval $ans = 2@
+@ prompt $ans Select your choice : @
+@ else@
+@ eval $ans = 2@
+@ end@
+@ if $ans == 1@
+@ else@
+
+
+## ---------------------------------------------------
+@ if $m2c_temp_writable == 1@
+This table has writable columns. Do you want to generate
+code for writeable columns, or restrict the table to read-only?
+
+ 1) generate code with writeable columns [DEFAULT]
+ 2) generate code with read-only columns
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ eval $m2c_temp_writable = 0@
+@ eval $m2c_temp_create = 0@
+@ eval $m2c_temp_dependencies = 0@
+@ eval $m2c_temp_persistent = 0@
+@ end@
+
+
+@ end@ # writable
+## ---------------------------------------------------
+@ if $m2c_temp_persistent == 1@
+@ eval $m2c_temp_persistent = 0@
+Since your table is writable, do you want to generate code to save and
+restore rows in the Net-SNMP persistent store? You should only use this
+option if the agent 'owns' the data, and doesn't get the data from an
+external source.
+
+ 1) do not generate persistent store code [DEFAULT]
+ 2) generate persistent store code
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ eval $m2c_temp_persistent = 1@
+@ end@
+
+
+@ end@ # persistent
+## ---------------------------------------------------
+@ if $m2c_temp_dependencies == 1@
+@ eval $m2c_temp_dependencies = 0@
+Writable tables sometimes have dependencies beteen columns
+or with other tables. If there are no dependencies in this table, you
+probably do not want the extra code.
+
+ 1) do not generate dependency code [DEFAULT]
+ 2) generate dependency code
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ eval $m2c_temp_dependencies = 1@
+@ end@
+
+
+@ end@ # dependencies
+## ---------------------------------------------------
+@ if $m2c_temp_create == 1@
+This table has read-create columns. Do you want to generate
+code for dynamic row creation?
+
+ 1) generate code for row creation [DEFAULT]
+ 2) do not generate code for row creation
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ eval $m2c_temp_create = 0@
+@ end@
+
+
+@ end@ # create
+## ---------------------------------------------------
+Do you want to use an existing data structure for the USER context?
+This would be a structure used to track data for the entire table,
+(similar to a global variable) not individual rows. (Many
+implementations won't need this, in which case the default is fine).
+
+
+ 1) No, use $m2c_temp_context_reg [DEFAULT]
+ 2) Yes, use my own structure
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ prompt $m2c_temp_context_reg Enter your USER context : @
+@ end@
+
+
+## ---------------------------------------------------
+Do you want to use an existing data structure for the DATA context?
+The DATA context holds the data for each MIB column in a given row. By
+default, a new data structure will be created with an element for each
+column. If you already have a structure that holds your data, select 2.
+
+ 1) No, use $m2c_temp_data_context [DEFAULT]
+ 2) Yes, use my own structure
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+
+
+Note: Do not enter a pointer type. Use the base structure name. For
+example, use 'struct widget', not 'struct widget *'. If you will be
+using pointer to the structure, select dynamic allocation in the
+next question.
+
+@ prompt $m2c_temp_data_context Enter your DATA context : @
+@ end@
+
+
+## ---------------------------------------------------
+@ if "x$m2c_temp_data_context" ne "x$mfd_default_data_context"@
+Do you want to allocate your '$m2c_temp_data_context' DATA context, or
+embed it directly? If your data is INTERNAL (controlled by the agent), you
+probably want embedded. If your data is EXTERNAL (controlled by another
+process) and you have pointers to the data, you probably want allocated.
+
+ 1) directly embed structure [DEFAULT]
+ 2) dynamically allocate structure
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ eval $m2c_temp_data_allocate = 1@
+@ end@
+
+
+@ end@ # ! default (generated)
+## ---------------------------------------------------
+Do you need to initialize elements in the '$m2c_temp_data_context' DATA
+context when a new instance is created (eg default values, or other structures
+you are going to add that might need initialization to the row request context?
+(The most common reasons you might need to do this is are if you want to keep
+some non-MIB data for every row, or some columns have default values.)
+
+ 1) no, no initialization needed
+ 2) yes, initilization is needed [DEFAULT]
+
+@ prompt $ans Select your choice : @
+@ if $ans == 1@
+@ eval $m2c_temp_data_init = 0@
+@ end@
+
+
+## ---------------------------------------------------
+Do you plan on keeping all data in the format defined by the MIB? If so,
+no functions will be generated to map values. If some data will be
+stored in a different format, the mapping functions will be generated.
+If your MIB has integers with enumerations, mapping functions are more
+likely to be needed. (e.g. A TruthValue object will hold the value
+1 or 2, but a C boolean would be 1 or 0.)
+
+ 1) All values will be stored as defined by the MIB [DEFAULT]
+ 2) I need to map values to the format defined by the MIB.
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ eval $m2c_temp_table_skip_mapping = -1@
+@ end@
+
+
+## ---------------------------------------------------
+Which method would you like to use to gather data about available rows?
+
+ 1) container : [DEFAULT] This access method uses a netsnmp_container
+ to store all row data in memory. This method is best for:
+ - Internal data (maintained by the agent)
+ - Access speed is important
+ - Sufficient memory exists to contain all rows
+
+ 2) container-cached : This access method uses a netsnmp_container
+ to keep track of the indexes (and data, usually) for each
+ row. This method is best for:
+ - External data (maintained by another process/the kernel)
+ - Access speed is important
+ - Sufficient memory exists to contain all indexes
+
+ 3) unsorted-external : This access method iterates over all of your data
+ to find the row with the appropriate index. This method is good for
+ - External data (maintained by another process/the kernel)
+ - Using less memory is much more important than access speed
+
+@ prompt $ans Select your choice : @
+@ if $ans == 3@
+@ eval $m2c_temp_table_access = "unsorted-external"@
+@ elsif $ans == 2@
+@ eval $m2c_temp_table_access = "container-cached"@
+@ eval $m2c_temp_data_cache = 1@
+@ else@
+@ eval $m2c_temp_table_access = "container-cached"@
+@ eval $m2c_temp_data_cache = 0@
+@ end@
+
+
+## ---------------------------------------------------
+When accessing your data, is your data TRANSIENT?
+
+ 1) Yes. My data is TRANSIENT (e.g. a pointer to a static buffer that
+ my be overwritten during a request) and needs to be copied during
+ processing.
+
+ 2) Yes. My data is SEMI-TRANSIENT (e.g. an allocated pointer to a
+ copy of the data).
+
+ 3) No, my data is PERSISTENT (e.g. an allocated pointer to the actual
+ data, which is under the agent's control)
+## '
+
+@ prompt $ans Select your choice [DEFAULT=1] : @
+@ if $ans == 3@
+@ eval $m2c_temp_data_transient = 0@
+@ elsif $ans == 2@
+@ eval $m2c_temp_data_transient = 1@
+@ else@
+@ eval $m2c_temp_data_transient = 2@
+@ end@
+
+
+## ---------------------------------------------------
+Do you want example code to be generated? This will generate example code
+for reading data from a text file.
+
+ 1) generate example code [DEFAULT]
+ 2) do not generate example code
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ eval $m2c_temp_include_examples = 0@
+@ else@
+@ eval $m2c_temp_include_examples = 1@
+@ end@
+
+## ---------------------------------------------------
+Is your table sparse? A sparse table is a table where some
+columns might not exist for all rows. Note that if your table
+contains a RowStaus column and it supports createAndWait, you
+will need sparse table support.
+
+ 1) No, all columns always exist for every row [DEFAULT]
+ 2) Yes, my table is sparse
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ eval $m2c_temp_table_sparse = 1@
+@ end@
+
+## ---------------------------------------------------
+Do you want a makefile and AgentX subagent source file generated?
+This will let you test your table without having to link it into
+snmpd. (You can still link it in later.)
+
+ 1) do not generate makefile/AgentX code [DEFAULT]
+ 2) generate makefile/AgentX code
+
+@ prompt $ans Select your choice : @
+@ if $ans == 2@
+@ eval $m2c_temp_generate_makefile = 1@
+@ eval $m2c_temp_generate_subagent = 1@
+@ else@
+@ eval $m2c_temp_generate_makefile = 0@
+@ eval $m2c_temp_generate_subagent = 0@
+@ end@
+
+@ end@ # do not use hardcoded
+@end@ # $mfd_interactive_setup == 1
+##################################
+##
+## save values
+## Note: if you add a var here, add it in m2c_table_save_defaults.m2i too
+##
+@eval $m2c_context_reg = "$m2c_temp_context_reg"@
+@eval $m2c_data_allocate = $m2c_temp_data_allocate@
+@eval $m2c_data_cache = $m2c_temp_data_cache@
+@eval $m2c_data_context = "$m2c_temp_data_context"@
+@eval $m2c_data_init = $m2c_temp_data_init@
+@eval $m2c_data_transient = $m2c_temp_data_transient@
+@eval $m2c_include_examples = $m2c_temp_include_examples@
+@eval $m2c_irreversible_commit = $m2c_irreversible_commit@
+@eval $m2c_table_access = "$m2c_temp_table_access"@
+@eval $m2c_table_dependencies = $m2c_temp_dependencies@
+@eval $m2c_table_persistent = $m2c_temp_persistent@
+@eval $m2c_table_row_creation = $m2c_temp_create@
+@eval $m2c_table_settable = $m2c_temp_writable@
+@eval $m2c_table_skip_mapping = $m2c_temp_table_skip_mapping@
+@eval $m2c_table_sparse = $m2c_temp_table_sparse@
+@eval $mfd_generate_makefile = $m2c_temp_generate_makefile@
+@eval $mfd_generate_subagent = $m2c_temp_generate_subagent@
+##
+## write them back
+##
+@include m2c_table_save_defaults.m2i@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/mfd-interface.m2c b/local/mib2c-conf.d/mfd-interface.m2c
new file mode 100644
index 0000000..d666c9a
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-interface.m2c
@@ -0,0 +1,1718 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+########################################################################
+@eval $m2c_processing_type = 'h'@
+@open ${name}_interface.h@
+@eval $hack = "Id"@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ */
+/** @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.
+ *
+ * @{
+ */
+@include m2c-internal-warning.m2i@
+##
+@eval $m2c_save = "$name"@
+@eval $name = "${name}_INTERFACE"@
+@include generic-header-top.m2i@
+@eval $name = "$m2c_save"@
+
+#include "${name}.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+
+/* PUBLIC interface initialization routine */
+void _${context}_initialize_interface(${context}_registration * user_ctx,
+ u_long flags);
+void _${context}_shutdown_interface(${context}_registration * user_ctx);
+
+${context}_registration *
+${context}_registration_get( void );
+
+${context}_registration *
+${context}_registration_set( ${context}_registration * newreg );
+
+netsnmp_container *${context}_container_get( void );
+int ${context}_container_size( void );
+
+@ if $m2c_table_settable@
+u_int ${context}_dirty_get( void );
+void ${context}_dirty_set( u_int status );
+
+@ end@
+@ if $m2c_data_allocate == 1@
+@ eval $m2c_tmp = "${context}_data *"@
+@ if $m2c_data_init == 1@
+@ eval $m2c_tmp = "$m2c_tmp, void *"@
+@ @end@
+@ elsif $m2c_data_init == 1@
+@ eval $m2c_tmp = "void *"@
+@ else@
+@ eval $m2c_tmp = "void"@
+@ end@
+ ${context}_rowreq_ctx * ${context}_allocate_rowreq_ctx($m2c_tmp);
+void ${context}_release_rowreq_ctx(${context}_rowreq_ctx *rowreq_ctx);
+
+int ${context}_index_to_oid(netsnmp_index *oid_idx,
+ ${context}_mib_index *mib_idx);
+int ${context}_index_from_oid(netsnmp_index *oid_idx,
+ ${context}_mib_index *mib_idx);
+
+@ if $m2c_table_persistent == 1@
+@ include mfd-persistence.m2i@
+
+@ end@
+/*
+ * access to certain internals. use with caution!
+ */
+void ${context}_valid_columns_set(netsnmp_column_info *vc);
+
+@end@ # for each
+@eval $m2c_save = "$name"@
+@eval $name = "${name}_INTERFACE"@
+@include generic-header-bottom.m2i@
+/** @} */
+@eval $name = "$m2c_save"@
+########################################################################
+########################################################################
+########################################################################
+########################################################################
+########################################################################
+########################################################################
+########################################################################
+##
+@open ${name}_interface.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ */
+@include m2c-internal-warning.m2i@
+
+@include generic-source-includes.m2i@
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "${name}_interface.h"
+
+netsnmp_feature_require(baby_steps)
+netsnmp_feature_require(row_merge)
+netsnmp_feature_require(check_all_requests_error)
+
+#include <ctype.h>
+
+@eval $m2c_processing_type = 'i'@
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ include details-table.m2i@
+########################################################################
+typedef struct ${context}_interface_ctx_s {
+
+ netsnmp_container *container;
+@ if $m2c_data_cache == 1@
+ netsnmp_cache *cache;
+@ end@
+
+ ${context}_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+@ if $m2c_table_settable@
+ u_int table_dirty;
+
+@ end@
+} ${context}_interface_ctx;
+
+static ${context}_interface_ctx ${context}_if_ctx;
+
+static void _${context}_container_init(
+ ${context}_interface_ctx *if_ctx);
+static void _${context}_container_shutdown(
+ ${context}_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+${context}_container_get( void )
+{
+ return ${context}_if_ctx.container;
+}
+
+${context}_registration *
+${context}_registration_get( void )
+{
+ return ${context}_if_ctx.user_ctx;
+}
+
+${context}_registration *
+${context}_registration_set( ${context}_registration * newreg )
+{
+ ${context}_registration * old = ${context}_if_ctx.user_ctx;
+ ${context}_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+${context}_container_size( void )
+{
+ return CONTAINER_SIZE(${context}_if_ctx.container);
+}
+
+@ if $m2c_table_settable@
+u_int
+${context}_dirty_get( void )
+{
+ return ${context}_if_ctx.table_dirty;
+}
+
+void
+${context}_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("${context}:${context}_dirty_set",
+ "called. was %d, now %d\n",
+ ${context}_if_ctx.table_dirty, status));
+ ${context}_if_ctx.table_dirty = status;
+}
+
+@end@
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_${context}_pre_request;
+static Netsnmp_Node_Handler _mfd_${context}_post_request;
+static Netsnmp_Node_Handler _mfd_${context}_object_lookup;
+static Netsnmp_Node_Handler _mfd_${context}_get_values;
+@ if $m2c_table_settable@
+static Netsnmp_Node_Handler _mfd_${context}_check_objects;
+static Netsnmp_Node_Handler _mfd_${context}_undo_setup;
+static Netsnmp_Node_Handler _mfd_${context}_set_values;
+static Netsnmp_Node_Handler _mfd_${context}_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_${context}_undo_values;
+static Netsnmp_Node_Handler _mfd_${context}_commit;
+static Netsnmp_Node_Handler _mfd_${context}_undo_commit;
+static Netsnmp_Node_Handler _mfd_${context}_irreversible_commit;
+@ if $m2c_table_dependencies == 1@
+static Netsnmp_Node_Handler _mfd_${context}_check_dependencies;
+@ end@
+
+@ end@ # writable
+@ if ("$m2c_data_context" eq "generated") && (($m2c_undo_embed == 0) || ($m2c_data_allocate == 1))@
+${context}_data *${context}_allocate_data(void);
+
+@ end@
+/**
+ * @internal
+ * Initialize the table $context
+ * (Define its contents and how it's structured)
+ */
+void
+_${context}_initialize_interface(${context}_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &${context}_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &${context}_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:${context}:_${context}_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ${context}
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ @foreach $tabledx index@
+ $tabledx.type, /** index: $tabledx */
+ @end@
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrieval. */
+ tbl_info->min_column = $context.uc_MIN_COL;
+ tbl_info->max_column = $context.uc_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ${context}_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ${context}_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _${context}_container_init(&${context}_if_ctx);
+ if (NULL == ${context}_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for ${context}\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_${context}_object_lookup;
+ access_multiplexer->get_values = _mfd_${context}_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_${context}_pre_request;
+ access_multiplexer->post_request = _mfd_${context}_post_request;
+
+#ifndef NETSNMP_DISABLE_SET_SUPPORT
+##
+@ if $m2c_table_settable@
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_${context}_check_objects;
+ access_multiplexer->undo_setup = _mfd_${context}_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_${context}_undo_cleanup;
+ access_multiplexer->set_values = _mfd_${context}_set_values;
+ access_multiplexer->undo_sets = _mfd_${context}_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_${context}_commit;
+ access_multiplexer->undo_commit = _mfd_${context}_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_${context}_irreversible_commit;
+##
+@ if $m2c_table_dependencies == 1@
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks = _mfd_${context}_check_dependencies;
+@ end@
+@ end@ # writable
+#endif
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("$name:init_$context",
+ "Registering $context as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("${context}", handler,
+ ${context}_oid,
+ ${context}_oid_size,
+ HANDLER_CAN_BABY_STEP |
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ HANDLER_CAN_RONLY
+#else
+@if $m2c_table_settable == 1@
+ HANDLER_CAN_RWRITE
+@else@
+ HANDLER_CAN_RONLY
+@end@
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table ${context}\n");
+ return;
+ }
+ reginfo->my_reg_void = &${context}_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->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
+ 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->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;
+#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
+
+ 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,
+ ${context}_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+@ if $m2c_data_cache == 1@
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != ${context}_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(${context}_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+@ end@
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+@if $m2c_table_persistent == 1@
+ /*
+ * register config/persistence callbacks
+ */
+ ${context}_container_init_persistence(${context}_if_ctx.container);
+
+@end@
+} /* _${context}_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table $context
+ */
+void
+_${context}_shutdown_interface(${context}_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _${context}_container_shutdown(&${context}_if_ctx);
+}
+
+void
+${context}_valid_columns_set(netsnmp_column_info *vc)
+{
+ ${context}_if_ctx.tbl_info.valid_columns = vc;
+} /* ${context}_valid_columns_set */
+
+@include generic-table-indexes-to-oid.m2i@
+@include generic-table-indexes-from-oid.m2i@
+
+########################################################################
+##
+@ if (($m2c_data_allocate == 1) || ($m2c_undo_embed == 0)) && ("$m2c_data_context" eq "generated")@
+@ eval $m2c_gda_todo_suppress = 1@ # no todo comments
+@ include generic-data-allocate.m2i@ # resets suppress
+@ end@
+########################################################################
+/* *********************************************************************
+ * @internal
+ * allocate resources for a ${context}_rowreq_ctx
+ */
+${context}_rowreq_ctx *
+@if $m2c_data_allocate == 1@
+@ eval $m2c_tmp = "${context}_data *data"@
+@ if $m2c_data_init == 1@
+@ eval $m2c_tmp = "$m2c_tmp, void *user_init_ctx"@
+@ end@
+@elsif $m2c_data_init == 1@
+@ eval $m2c_tmp = "void *user_init_ctx"@
+@else@
+@ eval $m2c_tmp = "void"@
+@end@
+${context}_allocate_rowreq_ctx($m2c_tmp)
+{
+ ${context}_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(${context}_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:${context}:${context}_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "${context}_rowreq_ctx.\n");
+ return NULL;
+ }
+@if $m2c_data_allocate == 1@
+ 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 = ${context}_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+@end@
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->${context}_data_list = NULL;
+
+@if $m2c_data_init == 1@
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ ${context}_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ ${context}_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+@end@
+
+ return rowreq_ctx;
+} /* ${context}_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ${context}_rowreq_ctx
+ */
+void
+${context}_release_rowreq_ctx(${context}_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:${context}:${context}_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+@if $m2c_data_init == 1@
+ ${context}_rowreq_ctx_cleanup(rowreq_ctx);
+@end@
+
+@if $m2c_data_allocate == 1@
+ /*
+ * 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))
+ ${context}_release_data(rowreq_ctx->data);
+
+@end@
+@if $m2c_undo_embed == 0@
+ if(rowreq_ctx->undo)
+ ${context}_release_data(rowreq_ctx->undo);
+
+@end@
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* ${context}_release_rowreq_ctx */
+
+########################################################################
+##
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_${context}_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:${context}",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ${context}_pre_request(${context}_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("${context}","error %d from "
+ "${context}_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_${context}_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_${context}_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ${context}_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:${context}",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+@ if $m2c_table_settable@
+ if ((MFD_SUCCESS != packet_rc) && ${context}_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "${context} dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+@ end@
+ rc = ${context}_post_request(${context}_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("${context}","error %d from "
+ "${context}_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_${context}_post_request */
+
+########################################################################
+##
+@if ($m2c_table_row_creation == 1) || ($m2c_table_persistent == 1)@
+NETSNMP_STATIC_INLINE int
+_${context}_check_indexes(${context}_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:${context}:_${context}_check_indexes","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+##
+@if $m2c_table_external_indexes != 0@
+ /*
+ * check that the corresponding EXTERNAL row exists
+ */
+@ foreach $node externalindex@
+@ include m2c_setup_node.m2i@
+
+ /* (INDEX) $m2c_node_summary */
+ rc = ${context}_${node}_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+@ end@ # for each nonindex
+
+@end@ # external index
+@ foreach $node internalindex@
+@ include m2c_setup_node.m2i@
+
+ /* (INDEX) $m2c_node_summary */
+@ eval $m2c_nv_val = "rowreq_ctx->tbl_idx.$node"@
+@ eval $m2c_nv_len = "rowreq_ctx->tbl_idx.${node}_len"@
+@ eval $m2c_nv_str = "rowreq_ctx->tbl_idx.$node"@
+@ include node-validate.m2i@
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = ${node}_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+@ end@ # for each internalindex
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return ${context}_validate_index( ${context}_if_ctx.user_ctx, rowreq_ctx );
+} /* _${context}_check_indexes */
+##----------------------------------------------------------------------
+/**
+ * @internal
+ * wrapper
+ */
+static ${table}_rowreq_ctx *
+_mfd_${context}_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
+{
+ ${context}_rowreq_ctx * rowreq_ctx;
+ ${context}_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_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 = ${context}_index_from_oid(oid_idx, &mib_idx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("$context", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+@ eval $m2c_tmp = ""@
+@ if ($m2c_data_allocate == 1) || ($m2c_data_init == 1)@
+@ eval $m2c_tmp = "NULL"@
+@ if ($m2c_data_allocate == 1) && ($m2c_data_init == 1)@
+@ eval $m2c_tmp = "$m2c_tmp, NULL"@
+@ @end@
+@ end@
+ rowreq_ctx = ${context}_allocate_rowreq_ctx($m2c_tmp);
+ 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 = _${context}_check_indexes(rowreq_ctx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ ${context}_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_${context}_rowreq_from_index */
+
+
+@end@ # row creation
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_${context}_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;
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * ${context}_interface_ctx *if_ctx =
+ * (${context}_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+@ if $m2c_table_row_creation == 0@
+ 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_${context}_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);
+ }
+@ end@ // row creation
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ${context}_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_${context}_object_lookup */
+
+########################################################################
+##
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_${context}_get_column( ${context}_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+@ foreach $node internalindex@
+@ include m2c_setup_node.m2i@
+@ if $node.accessible == 1@
+
+ /* (INDEX) $m2c_node_summary */
+ case COLUMN_$node.uc:
+ var->type = $node.type;
+@ if $m2c_node_needlength == 1@
+ /*
+ * NOTE: val_len is in bytes, ${node}_len might not be (e.g. oids)
+ */
+ if (var->val_len < (rowreq_ctx->tbl_idx.${node}_len *
+ sizeof(rowreq_ctx->tbl_idx.${node}[0]))) {
+ var->val.string = malloc(rowreq_ctx->tbl_idx.${node}_len *
+ sizeof(rowreq_ctx->tbl_idx.${node}[0]));
+ }
+ var->val_len = rowreq_ctx->tbl_idx.${node}_len * sizeof(rowreq_ctx->tbl_idx.${node}[0]);
+ memcpy( var->val.string, rowreq_ctx->tbl_idx.$node, var->val_len );
+@ else@
+ var->val_len = sizeof($m2c_decl);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.$node;
+@ end@
+ break;
+@ end@ ## accessible
+@ end@ ## index
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $node.accessible == 1@
+
+ /* $m2c_node_summary */
+ case COLUMN_$node.uc:
+@ if $m2c_table_sparse == 1@
+ if (! (COLUMN_$node.uc_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_get_column",
+ "column %d ($node) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+@ end@
+## use sizeof except for BITS
+@ if $m2c_node_needlength == 0@
+@ if "$node.perltype" eq "BITS"@
+ {
+ $m2c_decl mask = 0xff << ((sizeof($m2c_decl) - 1) * 8);
+ int idx = 0;
+@ else@
+ var->val_len = sizeof($m2c_decl);
+@ end@
+@ end@
+ var->type = $node.type;
+rc = ${node}_get(rowreq_ctx, $m2c_node_var_ref );
+@ if ($m2c_node_needlength == 0) && ("$node.perltype" eq "BITS")@
+ /*
+ * check for length of bits string
+ */
+ var->val_len = 0;
+ while( 0 != mask ) {
+ ++idx;
+ if ( *(($m2c_decl *) var->val.string) & mask )
+ var->val_len = idx;
+ mask = mask >> 8;
+ }
+ }
+@ end@
+ break;
+ @ end@ # accessible
+@ end@ # for each column
+
+ default:
+ if ($context.uc_MIN_COL <= column && column <= $context.uc_MAX_COL) {
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _${context}_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _${context}_get_column */
+
+########################################################################
+##
+int
+_mfd_${context}_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+@if $m2c_table_sparse == 1@
+ DEBUGMSGTL(("9:${context}:_mfd_${context}_get_values",
+ "exists %p\n", (void*)rowreq_ctx->column_exists_flags));
+
+@end@
+ 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 = _${context}_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_${context}_get_values */
+
+########################################################################
+##
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+@if $m2c_table_settable == 0@
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+@else@
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_${context}_check_column( ${context}_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:${context}:_${context}_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+@ eval $m2c_nvv_item = "${m2c_context_item}tbl_idx."@
+@ foreach $node internalindex@
+@ include m2c_setup_node.m2i@
+ /* (INDEX) $m2c_node_summary */
+ case COLUMN_$node.uc:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+@ end@ ## index
+@ eval $m2c_nvv_item = "$m2c_data_item"@
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $node.settable == 0@
+
+ /* $m2c_node_summary */
+ case COLUMN_$node.uc:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+@ next@
+@ end@
+
+ /* $m2c_node_summary */
+ case COLUMN_$node.uc:
+@ include node-varbind-validate.m2i@
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("${context}:_${context}_check_column:$node",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = ${node}_check_value( rowreq_ctx, $m2c_node_var_val );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from ${node}_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+@ end@ # for each nonindex
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _${context}_check_column\n", column);
+ }
+
+ return rc;
+} /* _${context}_check_column */
+
+##----------------------------------------------------------------------
+int
+_mfd_${context}_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_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 = _${context}_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_${context}_check_objects */
+
+
+@ if $m2c_table_dependencies == 1@
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_${context}_check_dependencies(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_check_dependencies","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ${context}_check_dependencies(rowreq_ctx);
+ if(rc){
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_${context}_check_dependencies */
+
+@end@ // dependencies
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_${context}_undo_setup_column( ${context}_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:${context}:_${context}_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $node.settable == 1@
+
+ /* $m2c_node_summary */
+ case COLUMN_$node.uc:
+ rowreq_ctx->column_set_flags |= COLUMN_$node.uc_FLAG;
+ rc = ${node}_undo_setup(rowreq_ctx );
+ break;
+ @ end@ # settable
+@ end@ # for each column
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _${context}_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _${context}_undo_setup_column */
+
+
+##----------------------------------------------------------------------
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_${context}_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+@if $m2c_undo_embed == 0@
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = ${context}_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+@end@
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = ${context}_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_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 = _${context}_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_${context}_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_${context}_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_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 = ${context}_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_undo_cleanup\n", rc));
+ }
+
+@if $m2c_undo_embed == 0@
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ ${context}_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+@end@
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_${context}_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_${context}_set_column( ${context}_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:${context}:_${context}_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $node.settable == 1@
+
+ /* $m2c_node_summary */
+ case COLUMN_$node.uc:
+ rowreq_ctx->column_set_flags |= COLUMN_$node.uc_FLAG;
+ rc = ${node}_set(rowreq_ctx, $m2c_node_var_val );
+ break;
+ @ end@ # settable
+@ end@ # for each column
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _${context}_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _${context}_set_column */
+
+########################################################################
+##
+int
+_mfd_${context}_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_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 = _${context}_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_${context}_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_${context}_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ${context}_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_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...
+ */
+ ${context}_dirty_set( ${context}_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_${context}_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ${context}_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ ${context}_dirty_set( d - 1 );
+ }
+
+ rc = ${context}_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "${context} row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_${context}_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_${context}_undo_column( ${context}_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:${context}:_${context}_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $node.settable == 1@
+
+ /* $m2c_node_summary */
+ case COLUMN_$node.uc:
+ rc = ${node}_undo(rowreq_ctx);
+ break;
+ @ end@ # settable
+@ end@ # for each column
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _${context}_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _${context}_undo_column */
+
+########################################################################
+##
+int
+_mfd_${context}_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ${context}_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _${context}_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_${context}_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_${context}_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+@ if $m2c_irreversible_commit == 1@
+ int rc;
+@ end@
+ ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:${context}:_mfd_${context}_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+@ if $m2c_irreversible_commit == 1@
+ rc = ${context}_irreversible_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ netsnmp_request_set_error_all(requests, SNMP_ERR_COMMITFAILED);
+ DEBUGMSGTL(("${context}:mfd","error %d from "
+ "${context}_irreversible_commit\n", rc));
+ }
+
+@ end@
+ /*
+ * 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(${context}_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+@if $m2c_table_sparse == 1@
+ DEBUGMSGTL(("internal:${context}:_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;
+@end@ # sparse
+ rowreq_ctx->column_set_flags = 0;
+ }
+@if ($m2c_table_row_creation == 1)@
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(${context}_if_ctx.container, rowreq_ctx);
+ }
+@end@ # creation
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_${context}_irreversible_commit */
+
+@end@ # settable
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+@ include mfd-access-${m2c_table_access}-defines.m2i@
+@ if $m2c_table_persistent == 1@
+@ include mfd-persistence.m2i@
+@ end@
+
+${context}_rowreq_ctx *
+${context}_row_find_by_mib_index(${context}_mib_index *mib_idx)
+{
+ ${context}_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 = ${context}_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = (${context}_rowreq_ctx*)CONTAINER_FIND(${context}_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
+@ if $m2c_table_refcounts == 1@
+int
+${context}_row_ref_increment(${context}_rowreq_ctx *rowreq_ctx)
+{
+ if (NULL == rowreq_ctx)
+ return -1;
+
+ ++rowreq_ctx->ref_count;
+ DEBUGMSGTL(("${context}:${context}_row_ref_increment",
+ "row %p ref count is %d\n",rowreq_ctx,
+ rowreq_ctx->ref_count));
+
+ return MFD_SUCCESS;
+}
+
+int
+${context}_row_ref_decrement(${context}_rowreq_ctx *rowreq_ctx)
+{
+ if (NULL == rowreq_ctx)
+ return -1;
+
+ if (0 == rowreq_ctx->ref_count) {
+ snmp_log(LOG_WARNING,"attempt to decrement ref_count below 0\n");
+ return -2;
+ }
+ --rowreq_ctx->ref_count;
+ DEBUGMSGTL(("${context}:${context}_row_ref_decrement",
+ "row %p ref count is %d\n",rowreq_ctx,
+ rowreq_ctx->ref_count));
+
+ return MFD_SUCCESS;
+}
+
+@ end@ // refcounts
+@end@ # foreach table
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/mfd-makefile.m2m b/local/mib2c-conf.d/mfd-makefile.m2m
new file mode 100644
index 0000000..c41d5bb
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-makefile.m2m
@@ -0,0 +1,139 @@
+####################################################### -*- Makefile -*-
+## $Id$
+##
+########################################################################
+##
+@strict token off@
+@ifconf ${name}_Makefile@
+@ print ${name}_Makefile exists, skipping@
+@else@
+@ if "x$m2c_create_fewer_files" eq "x"@
+@ eval $m2c_create_fewer_files = 0@
+@ end@
+@ open ${name}_Makefile@
+@ ifconf ${name}_Makefile.m2m@
+@ include ${name}_Makefile.m2m@
+@ else@
+########################################################################
+@ if $m2c_mark_boundary == 1@
+# START code generated by $RCSfile$ $Revision$
+@ end@
+########################################################################
+
+CC=gcc
+TABLE_PREFIX=${name}
+
+@ if "$mfd_netsnmp_dir" ne ""@
+NETSNMPDIR=$mfd_netsnmp_dir
+NETSNMPCONFIG=$(NETSNMPDIR)/net-snmp-config
+@ else@
+NETSNMPCONFIG=net-snmp-config
+@ end@
+
+@ if "$mfd_netsnmp_dir" ne ""@
+
+# Assuming we're linking against a Net-SNMP build tree (which may or
+# may not be the same as the source tree) and not an installed package.
+
+# Note: to do this we REQUIRE gnu-make.
+
+NETSNMPBASECFLAGS := $(shell $(NETSNMPCONFIG) --base-cflags)
+NETSNMPINCLUDES := $(shell $(NETSNMPCONFIG) --build-includes $(NETSNMPDIR))
+# base flags after build/src include, in case it has /usr/local/include
+NETSNMPCFLAGS=$(NETSNMPINCLUDES) $(NETSNMPBASECFLAGS)
+
+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)
+
+@ else@
+
+# uncomment this if you have GNU make
+#NETSNMPCFLAGS := $(shell $(NETSNMPCONFIG) --base-cflags)
+#NETSNMPLIBS := $(shell $(NETSNMPCONFIG) --agent-libs)
+NETSNMPCFLAGS=`$(NETSNMPCONFIG) --base-cflags`
+NETSNMPLIBS=`$(NETSNMPCONFIG) --agent-libs`
+
+LIBS=$(NETSNMPLIBS)
+
+@ end@
+
+STRICT_FLAGS = -Wall -Wstrict-prototypes
+CFLAGS=-I. $(NETSNMPCFLAGS) $(STRICT_FLAGS)
+
+USER_SRCS = \
+@ if $m2c_create_fewer_files != 1@
+ $(TABLE_PREFIX)_data_get.c \
+ $(TABLE_PREFIX)_data_set.c \
+@ end@
+ $(TABLE_PREFIX)_data_access.c
+
+SRCS = $(USER_SRCS) \
+ $(TABLE_PREFIX).c \
+ $(TABLE_PREFIX)_subagent.c \
+ $(TABLE_PREFIX)_interface.c
+
+USER_OBJS = \
+@ if $m2c_create_fewer_files != 1@
+ $(TABLE_PREFIX)_data_get.o \
+ $(TABLE_PREFIX)_data_set.o \
+@ end@
+ $(TABLE_PREFIX)_data_access.o
+
+OBJS = $(USER_OBJS) \
+ $(TABLE_PREFIX).o \
+ $(TABLE_PREFIX)_subagent.o \
+ $(TABLE_PREFIX)_interface.o
+
+TARGETS=$(TABLE_PREFIX)
+
+.SUFFIXES:
+.SUFFIXES: .c .o .deps
+
+
+all: $(TARGETS)
+
+user: $(USER_OBJS)
+
+$(TARGETS): $(LIB_DEPS)
+
+$(TABLE_PREFIX): $(OBJS) $(TABLE_PREFIX)_Makefile
+ $(CC) -o $(TABLE_PREFIX) $(OBJS) $(LIBS)
+
+clean:
+ rm -f $(OBJS) $(TARGETS)
+
+@if "$mfd_netsnmp_dir" ne ""@
+
+$(TABLE_PREFIX).deps $(TABLE_PREFIX)_subagent.deps $(TABLE_PREFIX)_interface.deps: $(TABLE_PREFIX)_Makefile
+$(TABLE_PREFIX)_data_access.deps: $(TABLE_PREFIX)_Makefile
+@if $m2c_create_fewer_files != 1@
+$(TABLE_PREFIX)_data_get.deps: $(TABLE_PREFIX)_Makefile
+$(TABLE_PREFIX)_data_set.deps: $(TABLE_PREFIX)_Makefile
+@end@
+
+%.deps : %.c
+ \@echo "Generating makefile $\@ ..."
+ \@set -e; $(CC) -M $(COPTS) $(CFLAGS) $(CPPFLAGS) $< \
+ | sed 's/\($*\)\.o[ :]*/\1.o $\@ : /g' > $\@; \
+ [ -s $\@ ] || $(RM) $(RMFLAGS) $\@
+
+include $(TABLE_PREFIX).deps
+include $(TABLE_PREFIX)_subagent.deps
+include $(TABLE_PREFIX)_interface.deps
+include $(TABLE_PREFIX)_data_access.deps
+@ if $m2c_create_fewer_files != 1@
+include $(TABLE_PREFIX)_data_get.deps
+include $(TABLE_PREFIX)_data_set.deps
+@ end@
+@end@
+########################################################################
+@ if $m2c_mark_boundary == 1@
+# END code generated by $RCSfile$ $Revision$
+@ end@
+@ end@ # not including ${name}_Makefile.m2m
+@ close ${name}_Makefile@
+@end@ # no existing makefile
diff --git a/local/mib2c-conf.d/mfd-persistence.m2i b/local/mib2c-conf.d/mfd-persistence.m2i
new file mode 100644
index 0000000..7796cf2
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-persistence.m2i
@@ -0,0 +1,478 @@
+########################################################################
+## generic include for XXX. Do not use directly.
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+@if $m2c_processing_type eq 'h'@
+/* *********************************************************************
+ * Persistent declarations
+ */
+/*
+ * persistence
+ */
+#define LINE_TERM_CHAR '$'
+
+void ${context}_container_init_persistence( netsnmp_container * container );
+int ${context}_container_should_save(${context}_rowreq_ctx * rowreq_ctx);
+
+@end@ // m2c_processing_type eq 'h'
+######################################################################
+######################################################################
+######################################################################
+@if $m2c_processing_type eq 'c'@
+/************************************************************
+ * 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.
+ *
+ * return 1 if the row should be stored
+ * return 0 if the row should not be stored
+ */
+int
+${context}_container_should_save(${context}_rowreq_ctx * rowreq_ctx)
+{
+@ foreach $node column@
+@ if "$node.syntax" eq "StorageType"@
+@ include m2c_setup_node.m2i@
+ if (SNMP_STORAGE_VOLATILE == $m2c_ctx_rh )
+ return 0;
+@ end@
+@ end@
+
+ return 1; /* save the row */
+}
+
+@end@ // m2c_processing_type eq 'h'
+######################################################################
+######################################################################
+######################################################################
+@if $m2c_processing_type eq 'i'@
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+
+static int _${context}_container_save_rows(int majorID, int minorID, void *serverarg, void *clientarg);
+static void _${context}_container_row_restore(const char *token, char *buf);
+static int _${context}_container_row_save(
+ ${context}_rowreq_ctx *rowreq_ctx,
+ void *type);
+static char * _${context}_container_col_restore(
+ ${context}_rowreq_ctx *rowreq_ctx,
+ u_int col, char* buf);
+static char * _${context}_container_col_save(
+ ${context}_rowreq_ctx *rowreq_ctx,
+ u_int col, char* buf);
+
+static char row_token[] = "${context}";
+
+/************************************************************
+ * *_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
+${context}_container_init_persistence( netsnmp_container * container )
+{
+ int rc;
+
+ register_config_handler(NULL, row_token,
+ _${context}_container_row_restore, NULL, NULL);
+ rc = snmp_register_callback( SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_STORE_DATA,
+ _${context}_container_save_rows,
+ container);
+
+ if( rc != SNMP_ERR_NOERROR )
+ snmp_log(LOG_ERR, "error registering for STORE_DATA callback "
+ "in _${context}_container_init_persistence\n");
+}
+
+static int
+_${context}_container_save_rows(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ char sep[] =
+ "##############################################################";
+ char buf[] =
+ "#\n"
+ "# $context 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*)_${context}_container_row_save,
+ type);
+
+ read_config_store((char*)type, sep);
+ read_config_store((char*)type, "\n");
+
+ /*
+ * never fails
+ */
+ return SNMPERR_SUCCESS;
+}
+
+
+
+/************************************************************
+ * _${context}_container_row_save
+ */
+static int
+_${context}_container_row_save(
+ ${context}_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, remember to add space for the identifier and separator
+ * 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 + \
+@ if $ext_index != 0@
+ ( 12 * 128 ) + /* external interfaces - max 128 subids */ \
+@ end@
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if ($node.settable == 1)@
+@ if "$node.type" eq "ASN_OBJECT_ID"@
+ ( ( 12 * sizeof(${m2c_ctx_rh}) ) + 3 ) + /* $node.type */ \
+@ elsif "$node.type" eq "ASN_OCTET_STR"@
+ ( ( 2 * sizeof(${m2c_ctx_rh}) ) + 3 ) + /* $node.type */ \
+@ else@
+ ( 12 ) + /* $node.type $node */ \
+@ end@
+@ end@
+@ end@
+ ( $table.uc_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 (${context}_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 ${context} row "
+ "to persistent file\n");
+ return SNMP_ERR_GENERR;
+ }
+ *pos++ = ' ';
+ if(pos > max) {
+ snmp_log(LOG_ERR,"error saving ${context} row "
+ "to persistent file (too long)\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * add each column
+ */
+ for(i = $table.uc_MIN_COL; i <= $table.uc_MAX_COL; ++i ) {
+
+ if ((0x1 << (i-1)) & ~$context.uc_SETTABLE_COLS)
+ continue;
+
+ tmp = pos;
+ pos = _${context}_container_col_save(rowreq_ctx, i, pos);
+ if(NULL == pos)
+ pos = tmp;
+ else
+ *pos++ = ' ';
+ if(pos > max) {
+ snmp_log(LOG_ERR,"error saving ${context} 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 ${context} row "
+ "to persistent file (too long)\n");
+ return SNMP_ERR_GENERR;
+ }
+ read_config_store((char*)type, buf);
+
+ DEBUGMSGTL(("internal:${context}:_${context}_container_row_save",
+ "saving line '%s'\n", buf));
+
+ return SNMP_ERR_NOERROR;
+}
+
+static void
+_${context}_container_row_restore(const char *token, char *buf)
+{
+ ${context}_rowreq_ctx * rowreq_ctx;
+ netsnmp_index index;
+ oid tmp_oid[ MAX_${context}_IDX_LEN];
+ u_int col = 0, found = 0;
+
+
+ if (strncmp(token, row_token, sizeof(row_token)) != 0) {
+ snmp_log(LOG_ERR, "unknown token in _${context}_container_row_restore\n");
+ return;
+ }
+
+ DEBUGMSGTL(("internal:${context}:_${context}_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 "
+ "_${context}_container_row_restore\n");
+ return;
+ }
+ rowreq_ctx = _mfd_${context}_rowreq_from_index( &index, NULL );
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "error creating row index in "
+ "_${context}_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(("_${context}_container_row_restore",
+ "parsing column %d\n", col));
+ buf = _${context}_container_col_restore( rowreq_ctx, col, buf );
+ ++found;
+ }
+ if (0 == found) {
+ snmp_log(LOG_ERR, "error parsing ${context} row; no columns found\n");
+ ${context}_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 ${context} row around column %d\n",
+ col);
+ ${context}_release_rowreq_ctx( rowreq_ctx );
+ return;
+ }
+
+ DEBUGMSGTL(("internal:${context}:_${context}_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(${context}_if_ctx.container, rowreq_ctx);
+}
+
+/************************************************************
+ * _${context}_container_col_save
+ */
+static char *
+_${context}_container_col_save(
+ ${context}_rowreq_ctx *rowreq_ctx,
+ u_int col, char* buf)
+{
+ if( ( NULL == rowreq_ctx ) || ( NULL == buf )) {
+ snmp_log(LOG_ERR, "bad parameter in "
+ "_${context}_container_col_save\n");
+ return NULL;
+ }
+
+ DEBUGMSGTL(("internal:${context}:_${context}_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) {
+
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+ case COLUMN_$node.uc: /** $node.syntax = $node.type */
+@ if $m2c_node_needlength == 1@
+@ if "$node.type" eq "ASN_OBJECT_ID"@
+ buf = read_config_save_objid(buf, ${m2c_ctx_rh},
+ ${m2c_ctx_rhs} );
+@ else@ # "$node.type" eq "ASN_OCTET_STR"@
+ buf = read_config_save_octet_string(buf, ${m2c_ctx_rh},
+ ${m2c_ctx_rhs} );
+@ end@
+@ elsif "$node.type" eq "ASN_INTEGER"@
+ buf += sprintf(buf,"%ld",${m2c_ctx_rh});
+@ else@
+ buf += sprintf(buf,"%lu",${m2c_ctx_rh});
+@ end@
+ break;
+
+@ end@ # for each
+ default: /** We shouldn't get here */
+ snmp_log(LOG_ERR, "unknown column %d in "
+ "_${context}_container_col_save\n", col);
+ return NULL;
+ }
+
+ return buf;
+}
+
+/************************************************************
+ * _${context}_container_col_restore
+ */
+static char *
+_${context}_container_col_restore(
+ ${context}_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 "
+ "_${context}_container_col_restore\n");
+ return NULL;
+ }
+
+ DEBUGMSGTL(("verbose:${context}:_${context}_container_col_restore",
+ "processing column %d\n", col));
+
+ /*
+ * restore data for the column
+ */
+ switch(col) {
+
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+ case COLUMN_$node.uc: /** $node.syntax = $node.type */
+@ if $m2c_node_needlength == 1@
+ ${m2c_ctx_rhs} = sizeof(${m2c_ctx_rh});
+ buf = read_config_read_memory($node.type,buf,
+ (char*)&${m2c_ctx_rh},
+ (size_t*)&${m2c_ctx_rhs} );
+@ if "$node.type" eq "ASN_OBJECT_ID"@
+ ${m2c_ctx_rhs} /= sizeof(oid);
+@ end@
+@ else@
+ len = sizeof(${m2c_ctx_rh});
+@ if "$node.type" eq "ASN_OCTET_STR"@ # BITS
+@ eval $m2c_tmp = "ASN_INTEGER"@
+@ else@
+@ eval $m2c_tmp = $node.type@
+@ end@
+ buf = read_config_read_memory($m2c_tmp, buf,
+ (char*)&${m2c_ctx_rh},
+ &len);
+@ end@
+@ if $m2c_table_sparse == 1@
+ if (NULL != buf)
+ rowreq_ctx->column_exists_flags |= COLUMN_$node.uc_FLAG;
+@ end@ # table sparse
+ break;
+
+@ end@ # foreach col
+ default: /** We shouldn't get here */
+ snmp_log(LOG_ERR, "unknown column %d in "
+ "_${context}_container_col_restore\n", col);
+ return NULL;
+ }
+
+ return buf;
+}
+
+##
+@end@ // $m2c_processing_type eq 'i'
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/mfd-readme.m2c b/local/mib2c-conf.d/mfd-readme.m2c
new file mode 100644
index 0000000..5ed9d59
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-readme.m2c
@@ -0,0 +1,846 @@
+########################################################################
+## generic include for XXX. Don't use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@open ${name}-README-FIRST.txt@
+************************************************************************
+${name} 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 ${name} 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 : ${name}_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 ${name}_Makefile
+
+
+ File : ${name}_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:
+
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+ ${name}-README-${table}.txt
+@end@
+
+
+
+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.
+------------------------------------------------------------------------
+@if $m2c_create_fewer_files == 1@
+ File : ${name}.c
+ Purpose : Initilization for the entire module set, including the
+ SNMP tables.
+
+@end@
+ File : ${name}.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+@if $m2c_create_fewer_files != 1@
+ File : ${name}_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : ${name}_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+@else@
+ File : ${name}_constants.h
+ Purpose : C #define definitions of the tables, columns, OIDs, enumerated
+ type values for each column of each table that requires them.
+@end@
+
+ File : ${name}_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.
+
+########################################################################
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ open ${name}-README-${table}.txt@
+************************************************************************
+${context} 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:
+
+ ${context}
+
+ Your code will be called when the snmp agent receives requests for
+ the ${context} 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 ${m2c_defaults_dir}table-${context}.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '$m2c_table_settable')
+ --------------------------------------------------------
+ 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 '$m2c_table_dependencies')
+ --------------------------------------------------------
+ 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 '$m2c_table_row_creation')
+ --------------------------------------------------------
+ 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 '$m2c_context_reg')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ ${context}_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 ${table}.h header.
+
+ Syntax: @eval $@m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently '$m2c_data_context')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ ${context}_data.
+
+ This typedef is used in the row request context structure for the table,
+ ${context}_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 ${table}.h header.
+
+ Syntax: @eval $@m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '$m2c_data_allocate')
+ --------------------------------------------------------
+ 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:
+
+ ${context}_allocate_data
+ ${context}_release_data
+
+ Syntax: @eval $@m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '$m2c_data_init')
+ --------------------------------------------------------
+ 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:
+
+ ${context}_rowreq_ctx_init
+ ${context}_rowreq_ctx_cleanup
+
+ Syntax: @eval $m2c_data_init = 1@
+
+
+ m2c_table_access (currently '$m2c_table_access')
+ ------------------------------------------------------------------
+ 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 = '$m2c_table_access'@
+
+
+ m2c_include_examples (currently '$m2c_include_examples')
+ ------------------------------------------------------------------
+ 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 '$m2c_data_transient')
+ ------------------------------------------------------------------
+ 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 ${context} table
+ ------------------------------------------------------------
+ The index(es) for the ${context} table are:
+
+@foreach $node index@
+@ include m2c_setup_node.m2i@
+ $node:
+ Syntax: $node.syntax
+ DataType: $node.perltype
+ ASN type: $node.type
+ C-code type: $m2c_decl
+@end@ # foreach
+
+ You should know how to set all these values from your data context,
+ ${context}_data.
+
+
+************************************************************************
+${context} File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the ${context}
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: ${name}_data_access.[c|h]
+------------------------------------------------------------------------
+ The ${name}_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 : ${context}_indexes_set
+ WHERE: ${context}_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.
+
+@if $mfd_readme_verbose == 1@
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+@end@
+
+@ eval $m2c_processing_type = 'r'@
+@ include mfd-access-${m2c_table_access}-defines.m2i@
+
+
+@if $m2c_create_fewer_files != 1@
+File: ${name}_enums.h
+@else@
+File: ${name}_constants.h
+@end@
+------------------------------------------------------------------------
+ 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.
+
+
+@if $m2c_create_fewer_files != 1@
+File: ${name}_data_get.c
+@else@
+File: ${name}.c; GET support
+@end@
+------------------------------------------------------------------------
+@ if ("$m2c_data_allocate" eq "yes") && ("$m2c_data_context" ne "generated")@
+ Allocate data context
+ ---------------------
+ TODO : allocate memory for a data context
+ FUNC : ${context}_allocate_data
+
+ This function will be called to allocate memory for a data context
+ when a new row request context is being created, or to create an
+ undo context while processing a set request.
+
+ Release data context
+ -------
+ TODO : release memory allocated for a data context
+ FUNC : ${context}_release_data
+
+ This function will be called to release any resources held by a
+ data or undo context. It will be called when a row request context
+ is released, or during cleanup after a set request.
+
+
+@ end@
+@ foreach $node index@
+@ include m2c_setup_node.m2i@
+@ if ($m2c_skip_mapping != 1)@
+ Map native data to MIB format
+ -----------------------------
+ TODO : convert data from its native format to the format required by the MIB
+ FUNC : ${node}_map
+
+ This function should map between the native format of the node data to
+ the format or values required by the MIB. For example, a C boolean value
+ for a MIB node with the TruthValue syntax needs to map the value C
+ false(0) to TruthValue false(2).
+
+@ end@ #// skip mapping
+@ end@ // foreach index
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if ($m2c_skip_mapping != 1)@
+ Map native data to MIB format
+ -----------------------------
+ TODO : convert data from its native format to the format required by the MIB
+ FUNC : ${node}_map
+
+ This function should map between the native format of the node data to
+ the format or values required by the MIB. For example, a C boolean value
+ for a MIB node with the TruthValue syntax needs to map the value C
+ false(0) to TruthValue false(2).
+
+@ end@ #// skip mapping
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : ${node}_get
+
+@ ifconf syntax-$node.syntax-readme.m2i@
+@ include syntax-$node.syntax-readme.m2i@
+@ elsif ($node.enums == 1) && ("$node.perltype" eq "BITS")@
+ Since this column has enumerated BITS, you should update or replace the
+ IS_SET_* macros to properly determine whether or not a particular bit
+ should be set.
+
+@ end@
+@ end@
+
+
+@if $m2c_create_fewer_files != 1@
+File: ${name}_data_set.c
+@else@
+File: ${name}.c; SET support
+@end@
+------------------------------------------------------------------------
+
+@if $m2c_table_settable == 0@
+ This table does not support set requests.
+@else@
+ This code was generated based on the following assumptions or settings:
+
+@ if $m2c_table_dependencies == 1@
+ 1) None of the values for this table have DEPENDENCIES on other objects.
+@ else@
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+@ end@
+
+@ if $mfd_readme_verbose != 0@
+ 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 ${m2c_defaults_dir}table-${table}.m2d
+ and regenerate code if this assumption is incorrect.
+@ end@
+
+@if $m2c_table_row_creation == 1@
+ 2) This table supports ROW CREATION.
+@else@
+ 2) This table does not support ROW CREATION.
+@end@
+
+@if $mfd_readme_verbose != 0@
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+@end@
+@if $m2c_table_row_creation == 1@
+
+ 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.
+
+@ foreach $node externalindex@
+@ include m2c_setup_node.m2i@
+ Validate external index
+ -----------------------
+ TODO : validate the specified external index component
+ FUNC : ${context}_${node}_check_index
+
+@ end@ # foreach externalindex
+
+@ foreach $node internalindex@
+@ include m2c_setup_node.m2i@
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : ${node}_check_index
+
+@ end@
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : ${context}_validate_index
+@end@
+
+
+@ if $m2c_table_dependencies == 1@
+ Check dependencies
+ ------------------
+ TODO : check that all dependencies have been satisfied
+ FUNC : ${context}_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.
+
+@ end@
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : ${context}_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.
+
+
+
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $node.settable == 0@
+@ next@ # skip to next column
+@ end@
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : ${node}_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 : ${node}_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 : ${node}_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 : ${node}_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.
+
+@ end@ # nonindex
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : ${context}_commit
+
+ After all values have been set, the commit function will be called.
+
+
+@ if $m2c_irreversible_commit == 1@
+ Commit irreversible changes
+ ---------------------------
+ FUNC: ${context}_irreversible_commit
+
+ This special mode is reserved for committing changes which can not be undone.
+ (e.g. launching a rocket). It is called after all normal commits have
+ succeeded.
+@ end@
+
+@end@ # settable
+
+
+************************************************************************
+${context} 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
+ ${context} table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the ${context} table.
+
+To watch the flow of the ${context} table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ ${context}
+ verbose:${context}
+ internal:${context}
+
+e.g.
+ snmpd -f -Le -D${context},verbose:${context},internal:${context}
+
+
+@if $m2c_create_fewer_files == 1@
+@ eval $tmp_mfd_rm_set = "xxx.c"@
+@ eval $tmp_mfd_rm_get = "xxx.c"@
+@else@
+@ eval $tmp_mfd_rm_set = "xxx_data_set.c"@
+@ eval $tmp_mfd_rm_get = "xxx_data_get.c"@
+@end@
+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 $tmp_mfd_rm_get
+ xxxTable_rowreq_ctx_init $tmp_mfd_rm_get
+ xxxTable_indexes_set $tmp_mfd_rm_get
+ xxxTable_indexes_set_tbl_idx $tmp_mfd_rm_get
+
+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 $tmp_mfd_rm_get
+
+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 $tmp_mfd_rm_set
+
+_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 $tmp_mfd_rm_set
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set $tmp_mfd_rm_set
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies $tmp_mfd_rm_set
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit $tmp_mfd_rm_set
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup $tmp_mfd_rm_set
+ 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 $tmp_mfd_rm_set
+ xxxTable_validate_index $tmp_mfd_rm_set
+
+_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 $tmp_mfd_rm_set
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo $tmp_mfd_rm_set
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup $tmp_mfd_rm_get
+ xxxTable_release_data $tmp_mfd_rm_get
+
+
+
+Table / column details
+----------------------------------------------------
+@ include details-table.m2i@
+
+@ foreach $node column@
+@ include m2c_setup_node.m2i@
+@ include details-node.m2i@
+@ end@
+
+@end@ # foreach table
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/mfd-top.m2c b/local/mib2c-conf.d/mfd-top.m2c
new file mode 100644
index 0000000..db0f398
--- /dev/null
+++ b/local/mib2c-conf.d/mfd-top.m2c
@@ -0,0 +1,605 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+## $Id$
+########################################################################
+########################################################################
+##
+## mfd function params
+##
+@ifconf ${name}.m2d@
+@ include ${name}.m2d@
+@end@
+##
+## set up defaults
+##
+@foreach $table table@
+@ include default-mfd-top.m2c@ # get defaults
+@ eval $context = $table@
+##
+## set up defaults
+##
+@ print Defaults for $table...@
+@ eval $m2c_context_reg = "$mfd_default_context_reg"@
+@ eval $m2c_data_allocate = $mfd_default_data_allocate@
+@ eval $m2c_data_cache = $mfd_default_data_cache@
+@ eval $m2c_data_context = "$mfd_default_data_context"@
+@ eval $m2c_data_init = $mfd_default_data_init@
+@ eval $m2c_data_transient = $mfd_default_data_transient@
+@ eval $m2c_include_examples = $mfd_default_include_examples@
+@ eval $m2c_irreversible_commit = 0@
+@ eval $m2c_table_access = "$mfd_default_table_access"@
+@ eval $m2c_table_dependencies = table_is_writable($context)@
+@ eval $m2c_table_persistent = 0@
+@ eval $m2c_table_row_creation = table_has_create($context)@
+@ eval $m2c_table_settable = table_is_writable($context)@
+@ eval $m2c_table_skip_mapping = -1@ # -1 = no default; based on type
+@ eval $m2c_table_sparse = 0@
+@ eval $mfd_generate_makefile = $mfd_default_generate_makefile@
+@ eval $mfd_generate_subagent = $mfd_default_generate_subagent@
+##
+## allow for user override, or save defaults
+##
+@ ifconf default-table-${context}.m2d@
+@ print Warning: using defaults in current directory. Consider moving@
+@ print them to $m2c_defaults_dir.@
+@ eval $m2c_defaults_dir = "default-"@
+@ end@
+@ ifconf ${m2c_defaults_dir}table-${context}.m2d@
+@ if $mfd_interactive_setup == 1@
+@ print There are existing defaults for $context (${m2c_defaults_dir}table-${context}.m2d).@
+@ prompt $ans r)econfigure or u)se existing [default=u] : @
+@ if "x$ans" eq "xr"@
+@ eval $mfd_interactive_setup = -1@ # already asked to overwrite
+@ run -again mfd-interactive-setup.m2c@
+@ eval $mfd_interactive_setup = 1@
+@ else@
+## ## read in old, write them back (this should add any new vars
+@ include ${m2c_defaults_dir}table-${context}.m2d@
+@ include m2c_table_save_defaults.m2i@
+@ end@
+@ end@
+@ else@ # no existing defaults
+@ ifdir defaults@
+## NOP
+@ else@
+@ perleval my $rc = mkdir(defaults,0775); return $rc != 1 @
+@ end@
+@ run mfd-interactive-setup.m2c@
+@ end@ # no conf file
+@end@ # foreach table
+@if $m2c_gen_table_defaults == 1@
+@ exit@
+@end@
+@print Starting MFD code generation...@
+########################################################################
+@eval $m2c_processing_type = 'h'@
+@open ${name}.h@
+@eval $hack = "Id"@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ */
+@include generic-header-top.m2i@
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+@if $m2c_mark_boundary == 1@
+/** START header generated by $RCSfile$ $Revision$ */
+@end@
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+config_add_mib($name.module)
+config_require($name.module/${name}/${name}_interface)
+config_require($name.module/${name}/${name}_data_access)
+@if $m2c_create_fewer_files != 1@
+config_require($name.module/${name}/${name}_data_get)
+config_require($name.module/${name}/${name}_data_set)
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for $context */
+#include "${name}_oids.h"
+
+/* enum definions */
+#include "${name}_enums.h"
+@else@
+ /* *INDENT-ON* */
+
+/* OID, column number and enum definions for $context */
+#include "${name}_constants.h"
+@end@ // m2c_create_fewer_files
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_$name(void);
+void shutdown_$context(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ include details-table.m2i@
+/* *********************************************************************
+ * 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 $context registration context.
+ */
+@ if "x$m2c_context_reg" eq "x"@
+@ eval $m2c_context_reg = "netsnmp_data_list"@
+@ end@
+typedef $m2c_context_reg ${context}_registration;
+
+@ include generic-data-context.m2i@
+
+@ if $m2c_table_settable@
+/* *********************************************************************
+ * TODO:115:o: |-> Review $context 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 ${context}_data ${context}_undo_data;
+
+@ end@
+@ include generic-table-indexes.m2i@
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review $context Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ${context}_rowreq_ctx pointer.
+ */
+typedef struct ${context}_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+## /* xxx-rks: shrink index oid_tmp? */
+ oid oid_tmp[MAX_${context}_IDX_LEN];
+
+ ${context}_mib_index tbl_idx;
+
+@ if $m2c_data_allocate == 1@
+@ eval $mfd_tmp = "*"@
+@ else@
+@ eval $mfd_tmp = " "@
+@ end@
+ ${context}_data $mfd_tmp data;
+@ if $m2c_table_sparse == 1@
+ unsigned int column_exists_flags; /* flags for existence */
+@ end@
+@ if $m2c_table_settable@
+@ if $m2c_undo_embed == 1@
+@ eval $mfd_tmp = " "@
+@ else@
+@ eval $mfd_tmp = "*"@
+@ end@ # embed
+ ${context}_undo_data $mfd_tmp undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+@ end@ # settable
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+@ if $m2c_table_refcounts == 1@
+ u_int ref_count;
+@ end@
+
+ /*
+ * TODO:131:o: | |-> Add useful data to $context rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *${context}_data_list;
+
+} ${context}_rowreq_ctx;
+
+typedef struct ${context}_ref_rowreq_ctx_s {
+ ${context}_rowreq_ctx *rowreq_ctx;
+} ${context}_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+## {
+ int ${context}_pre_request(${context}_registration * user_context);
+ int ${context}_post_request(${context}_registration * user_context,
+ int rc);
+
+@ if $m2c_data_init == 1@
+ int ${context}_rowreq_ctx_init(${context}_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void ${context}_rowreq_ctx_cleanup(${context}_rowreq_ctx *rowreq_ctx);
+
+@ end@
+@ if "$m2c_data_context" ne "generated"@
+@ if ($m2c_data_allocate == 1) || ($m2c_undo_embed == 1)@
+ ${context}_data * ${context}_allocate_data(void);
+ void ${context}_release_data(${context}_data *data);
+
+@ end@
+@ end@
+@ if $m2c_table_settable@
+@ if $m2c_table_dependencies == 1@
+ int ${context}_check_dependencies(${context}_rowreq_ctx * rowreq_ctx);
+@ end@
+ int ${context}_commit(${context}_rowreq_ctx * rowreq_ctx);
+@ if $m2c_irreversible_commit == 1@
+ int ${context}_irreversible_commit(${context}_rowreq_ctx * rowreq_ctx);
+@ end@
+@ end@ # writable
+
+ ${context}_rowreq_ctx *
+ ${context}_row_find_by_mib_index(${context}_mib_index *mib_idx);
+
+@ if $m2c_table_refcounts == 1@
+int ${context}_row_ref_increment(${context}_rowreq_ctx *rowreq_ctx);
+int ${context}_row_ref_decrement(${context}_rowreq_ctx *rowreq_ctx);
+
+@ end@
+extern const oid ${context}_oid[];
+extern const int ${context}_oid_size;
+
+@end@ # for each
+
+#include "${name}_interface.h"
+#include "${name}_data_access.h"
+@if $m2c_create_fewer_files != 1@
+#include "${name}_data_get.h"
+#include "${name}_data_set.h"
+@else@
+@ eval $mfd_processing_types = "h"@
+@ include mfd-data-get.m2c@
+@ include mfd-data-set.m2c@
+@end@ // m2c_create_fewer_files
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+@if $m2c_mark_boundary == 1@
+/** END header generated by $RCSfile$ $Revision$ */
+@end@
+@include generic-header-bottom.m2i@
+/** @} */
+######################################################################
+## Do the .c file
+######################################################################
+@eval $m2c_processing_type = 'c'@
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ *
+ * $$hack:$
+ */
+/** \page MFD helper for ${name}
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+@include generic-source-includes.m2i@
+#include <net-snmp/agent/mib_modules.h>
+
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+#include "${name}_interface.h"
+
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+const oid ${context}_oid[] = { $context.uc_OID };
+const int ${context}_oid_size = OID_LENGTH(${context}_oid);
+
+@ if "x$m2c_context_reg" ne "x"@
+ ${context}_registration ${context}_user_context;
+@ end@
+
+void initialize_table_$context(void);
+void shutdown_table_$context(void);
+
+@end@
+
+/**
+ * Initializes the $name module
+ */
+void
+init_$name(void)
+{
+ DEBUGMSGTL(("verbose:$name:init_$name","called\n"));
+
+ /*
+ * TODO:300:o: Perform $name one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ @foreach $table table@
+ if (should_init("$context"))
+ initialize_table_$context();
+
+ @end@
+} /* init_$name */
+
+/**
+ * Shut-down the $name module (agent is exiting)
+ */
+void
+shutdown_$name(void)
+{
+ @foreach $table table@
+ if (should_init("$context"))
+ shutdown_table_$context();
+
+ @end@
+}
+
+########################################################################
+##
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+/**
+ * Initialize the table $context
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_$context(void)
+{
+ ${context}_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:$context:initialize_table_$context","called\n"));
+
+ /*
+ * TODO:301:o: Perform $context one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize $context user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+@ if "$m2c_context_reg" eq "netsnmp_data_list"@
+ /*
+ * 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("$context", NULL, NULL);
+@ else@
+ user_context = &${context}_user_context;
+@ end@
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _${context}_initialize_interface(user_context, flags);
+} /* initialize_table_$context */
+
+/**
+ * Shutdown the table $context
+ */
+void
+shutdown_table_$context(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _${context}_shutdown_interface(&${context}_user_context);
+}
+
+########################################################################
+@ if $m2c_data_init == 1@
+/**
+ * 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
+${context}_rowreq_ctx_init(${context}_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:$context:${context}_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra $context rowreq initialization. (eg DEFVALS)
+ */
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $node.hasdefval == 0@
+@ next@
+@ end@
+##------------------------------------------------------
+@ if $node.needlength == 1@
+ /*
+ * strings and oids are hard to handle automagically.
+ * so all we've got for you is a hint:
+ *
+ * memcpy($m2c_data_item$node, $node.defval,
+ * len($node.defval) * sizeof($m2c_data_itme$node[0]);
+ */
+@ elsif $node.enums == 1@
+@ if "$node.perltype" ne "BITS"@
+@ eval $m2c_tmp_mt = $node.defval@
+@ foreach $e $v enum@
+@ include m2c_setup_enum.m2i@
+@ if $e eq $node.defval@
+@ eval $m2c_tmp_mt = $m2c_ename@
+@ end@
+@ end@ # for each
+@ end@ # ! bits
+ $m2c_data_item$node = $m2c_tmp_mt;
+@ elsif ("$node.decl" eq "long") || ("$node.decl" eq "u_long")@
+ $m2c_data_item$node = $node.defval;
+@ else@
+ /** $m2c_data_item$node = $node.defval; */
+@ end@
+
+@ end@ foreach nonindex
+
+ return MFD_SUCCESS;
+} /* ${context}_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void ${context}_rowreq_ctx_cleanup(${context}_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:$context:${context}_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra $context rowreq cleanup.
+ */
+} /* ${context}_rowreq_ctx_cleanup */
+
+@ end@ // data_init
+########################################################################
+@if $m2c_table_persistent == 1@
+@ include mfd-persistence.m2i@
+@end@
+########################################################################
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+${context}_pre_request(${context}_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform $context pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ${context}_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
+${context}_post_request(${context}_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:${context}:${context}_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform $context post-request actions.
+ */
+
+@ if $m2c_table_settable@
+ /*
+ * check to set if any rows were changed.
+ */
+ if (${context}_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
+ */
+@ if $m2c_table_persistent@
+ snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE));
+@ end@
+ }
+
+ ${context}_dirty_set(0); /* clear table dirty flag */
+ }
+
+@ end@
+ return MFD_SUCCESS;
+} /* ${context}_post_request */
+
+@end@ // table
+
+########################################################################
+@if $m2c_create_fewer_files == 1@
+@ eval $mfd_processing_types = "c"@
+@ include mfd-data-get.m2c@
+@ include mfd-data-set.m2c@
+@else@
+@ eval $mfd_processing_types = "chi"@
+@ run mfd-data-get.m2c@
+@ run mfd-data-set.m2c@
+@end@
+########################################################################
+/** @{ */
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
+##
+########################################################################
+##
+## Do support files
+##
+########################################################################
+@run generic-table-constants.m2c@
+@run mfd-interface.m2c@
+@run mfd-data-access.m2c@
+##
+@run mfd-readme.m2c@
+##
+@if $mfd_generate_doxygen == 1@
+@ run mfd-doxygen.m2c@
+@end@
+##
+@if $mfd_generate_makefile == 1@
+@ run mfd-makefile.m2m@
+@end@
+##
+@if $mfd_generate_subagent == 1@
+@ run subagent.m2c@
+@end@
+##
diff --git a/local/mib2c-conf.d/node-get.m2i b/local/mib2c-conf.d/node-get.m2i
new file mode 100644
index 0000000..1d7255c
--- /dev/null
+++ b/local/mib2c-conf.d/node-get.m2i
@@ -0,0 +1,107 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@include m2c_setup_node.m2i@
+@eval $m2c_node_realloc = 2@ // malloc
+/**
+ * Extract the current value of the $node data.
+ *
+ * Set a value using the data context for the row.
+ *
+@if $m2c_node_get_comments ne ""@
+$m2c_node_get_comments
+*
+@end@
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param $m2c_node_param_ref_name
+ * Pointer to storage for a $node.decl variable
+@if $m2c_node_needlength == 1@
+ * @param $m2c_node_param_ref_lname
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by $node.
+ * On exit, this value should contain the data size (in bytes).
+@end@
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+@if $m2c_node_needlength == 1@
+*
+ * @note If you need more than (*$m2c_node_param_ref_lname) bytes of memory,
+ * allocate it using malloc() and update $m2c_node_param_ref_name.
+ * <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.)
+@end@
+ */
+int
+${node}_get( ${context}_rowreq_ctx *rowreq_ctx, $m2c_node_param_ref )
+{
+@ifconf syntax-$node.syntax-get.m2i@
+@ include syntax-$node.syntax-get.m2i@
+@else@
+@ include generic-get-decl.m2i@
+
+ DEBUGMSGTL(("verbose:${context}:${node}_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the $node data.
+@if $m2c_node_needlength == 0@
+ * copy $m2c_node_lh from $m2c_data_item_base
+@else@
+ * copy $m2c_node_lh data and $m2c_node_lhs from $m2c_data_item_base
+@end@
+ */
+@ if ("$m2c_data_context" eq "generated") && ($m2c_node_skip_get != 1)@
+@ include generic-ctx-get.m2i@
+@ else@
+@ if ($m2c_node_skip_get != 1)@
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set $node data
+ */
+ snmp_log(LOG_ERR,"${context} node $node not implemented: skipping\n");
+@ end@
+ return MFD_SKIP;
+@ end@
+## ------------------------------------------------------------------
+@ if $node.decl =~ /long/i@ # ASN_INTEGER ASN_COUNTER ASN_GAUGE
+@ include generic-get-long.m2i@
+@ elsif $node.decl =~ /char/i@ # ASN_OCTET_STR ASN_OPAQUE
+@ include generic-get-char.m2i@
+@ elsif $node.decl =~ /oid/i@ # ASN_OBJECT_ID
+@ include generic-get-oid.m2i@
+@ elsif $node.decl =~ /U64/i@ # ASN_COUNTER64
+@ include generic-get-U64.m2i@
+@ else@
+@ print ERROR: unknown node.decl: $node.decl@
+@ exit@
+@ end@
+## ------------------------------------------------------------------
+@ if ($m2c_node_skip_mapping != 1) && ("$m2c_data_context" ne "generated")@
+@ include generic-value-map.m2i@
+@ end@
+@ include generic-get-decl-bot.m2i@ // copy value out
+@end@ # no syntax include
+
+ return MFD_SUCCESS;
+} /* ${node}_get */
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/node-set.m2i b/local/mib2c-conf.d/node-set.m2i
new file mode 100644
index 0000000..2041b59
--- /dev/null
+++ b/local/mib2c-conf.d/node-set.m2i
@@ -0,0 +1,236 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+##----------------------------------------------------------------------
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param $m2c_node_param_val_name
+ * A $node.decl containing the new value.
+@ if $m2c_node_needlength == 1@
+ * @param $m2c_node_param_val_lname
+ * The size (in bytes) of the data pointed to by $m2c_node_param_val_name
+@ end@
+ *
+ * @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).
+ *
+@if ("$m2c_data_context" ne "generated") && ($m2c_node_needlength == 1)@
+ * 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.
+ *
+@end@
+ * 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
+ * ${context}_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is $node.type
+@if ("$m2c_data_context" eq "generated") && ($m2c_node_needlength == 1)@
+ * The length is < sizeof($m2c_data_item$node).
+@end@
+@if $node.enums == 1@
+ * The value is one of $m2c_evals
+@elsif $node.ranges == 1@
+@ if ("$node.decl" eq "long") || ("$node.decl" eq "u_long")@
+@ eval $m2c_tmp_ns = "value"@
+@ else@
+@ eval $m2c_tmp_ns = "length"@
+@ end@
+ * The $m2c_tmp_ns is in (one of) the range set(s): $m2c_evals
+@end@
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+@ if $mfd_code_verbose == 1@
+@ if ("$node.decl" eq "long") || ("$node.decl" eq "u_long")@
+ * For example, an object with the syntax INTEGER(0..500) will
+ * have already been checked for a value between 0 and 500. But
+ * if the description also specifies that the value must be an
+ * even number, you would enforce that requirement here. If and odd
+ * numer is set, return MFD_NOT_VALID_EVER. If the description also
+ * specified that changed must be made in single steps of 2, then a set
+ * to change the value 10 to an even value other than 8 or 12 should
+ * return MFD_NOT_VALID_NOW.
+@ else@
+ * For example, and object with the syntax DisplayString(0..40)
+ * will have already been checked for a length between 0 and 40.
+ * But if the description also specified that the value must
+ * be all uppercase letters, you would enforce that requirement here
+ * by returning MFD_NOT_VALID_EVER for a set containing lowercase
+ * letters. If the description also specified that the value can not
+ * change by more than one letter at a time, an attempt to change
+ * "ABBY" to "ANNIE" should return MFD_NOT_VALID_NOW.
+@ end@
+ *
+@ end@
+ */
+int
+${node}_check_value( ${context}_rowreq_ctx *rowreq_ctx, $m2c_node_param_val)
+{
+ DEBUGMSGTL(("verbose:${context}:${node}_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+@if $m2c_node_needlength == 1@
+ netsnmp_assert(NULL != $m2c_node_param_val_name);
+@end@
+
+ /*
+ * TODO:441:o: |-> Check for valid $node value.
+ */
+
+ return MFD_SUCCESS; /* $node value not illegal */
+} /* ${node}_check_value */
+
+##----------------------------------------------------------------------
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (${context}_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
+ * ${context}_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
+${node}_undo_setup( ${context}_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:${context}:${node}_undo_setup","called\n"));
+
+@ifconf syntax-$node.syntax-undo-setup.m2i@
+@ include syntax-$node.syntax-undo-setup.m2i@
+@else@
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup $node undo.
+ */
+@ eval $m2c_ctx_lh = "${m2c_undo_item}${node}"@
+@ eval $m2c_ctx_lhs = "${m2c_undo_item}${node}_len"@
+@ eval $m2c_ctx_rh = "${m2c_data_item}${node}"@
+@ eval $m2c_ctx_rhs = "${m2c_data_item}${node}_len"@
+@ include generic-ctx-copy.m2i@
+@end@
+
+ return MFD_SUCCESS;
+} /* ${node}_undo_setup */
+
+##----------------------------------------------------------------------
+/**
+ * Set the new value.
+ *
+@if $m2c_node_set_comments ne ""@
+$m2c_node_set_comments
+*
+@end@
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param $m2c_node_param_val_name
+ * A $node.decl containing the new value.
+@ if $m2c_node_needlength == 1@
+ * @param $m2c_node_param_val_lname
+ * The size (in bytes) of the data pointed to by $m2c_node_param_val_name
+@ end@
+ */
+int
+${node}_set( ${context}_rowreq_ctx *rowreq_ctx, $m2c_node_param_val )
+{
+@ifconf syntax-$node.syntax-set.m2i@
+@ include syntax-$node.syntax-set.m2i@
+@else@
+
+ DEBUGMSGTL(("verbose:${context}:${node}_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+@if $m2c_node_needlength == 1@
+ netsnmp_assert(NULL != $m2c_node_param_val_name);
+@end@
+
+@ if $m2c_node_skip_mapping != 1@
+@ include generic-value-map-reverse.m2i@
+@ else@
+@ include generic-ctx-set.m2i@
+@ end@
+@end@ # no syntax include
+ return MFD_SUCCESS;
+} /* ${node}_set */
+
+##----------------------------------------------------------------------
+/**
+ * undo the previous set.
+ *
+@if $m2c_node_undo_comments ne ""@
+$m2c_node_undo_comments
+*
+@end@
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+${node}_undo( ${context}_rowreq_ctx *rowreq_ctx)
+{
+@ifconf syntax-$node.syntax-undo.m2i@
+@ include syntax-$node.syntax-undo.m2i@
+@else@
+
+ DEBUGMSGTL(("verbose:${context}:${node}_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up $node undo.
+ */
+@ eval $m2c_ctx_rh = "${m2c_undo_item}${node}"@
+@ eval $m2c_ctx_rhs = "${m2c_undo_item}${node}_len"@
+@ eval $m2c_ctx_lh = "${m2c_data_item}${node}"@
+@ eval $m2c_ctx_lhs = "${m2c_data_item}${node}_len"@
+@ include generic-ctx-copy.m2i@
+@end@ # no syntax include
+
+ return MFD_SUCCESS;
+} /* ${node}_undo */
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/node-storage.m2i b/local/mib2c-conf.d/node-storage.m2i
new file mode 100644
index 0000000..7a941f0
--- /dev/null
+++ b/local/mib2c-conf.d/node-storage.m2i
@@ -0,0 +1,21 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@if $m2c_node_needlength == 0@
+ $m2c_decl $node;
+@else@
+ $m2c_decl $node[$m2c_node_maxlen];
+ size_t ${node}_len;
+@end@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/node-validate.m2i b/local/mib2c-conf.d/node-validate.m2i
new file mode 100644
index 0000000..a63f1d7
--- /dev/null
+++ b/local/mib2c-conf.d/node-validate.m2i
@@ -0,0 +1,71 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+##
+## assumes an integer rc is available and will be tested by caller
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##----------------------------------------------------------------------
+## setup
+##----------------------------------------------------------------------
+@if $node.enums == 1@
+##------------------------------------------------------
+@ if "$node.perltype" ne "BITS"@
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+@ foreach $e $v enum@
+@ include m2c_setup_enum.m2i@
+ && ( $m2c_nv_val != $m2c_ename )
+@ end@ # for each
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+##------------------------------------------------------
+@ else@ # BITS
+## {
+ if($m2c_nv_len > 4) {
+ snmp_log(LOG_ERR,"I can not handle BITS > 4 bytes\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ else if (SNMPERR_SUCCESS == rc){
+ u_long bits = 0;
+ /* check that value is within enum mask */
+ memcpy( &bits, $m2c_nv_str, $m2c_nv_len);
+ if( (bits | $m2c_enum_mask) != $m2c_enum_mask)
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+@ end@
+##----------------------------------------------------------------------
+## check RANGES
+##----------------------------------------------------------------------
+@elsif $node.ranges == 1@
+@ if ("$node.decl" eq "long") || ("$node.decl" eq "u_long")@
+@ eval $m2c_nv_rc = "SNMP_ERR_WRONGVALUE"@
+@ eval $m2c_nv_tmp = "$m2c_nv_val"@
+@ else@
+@ eval $m2c_nv_rc = "SNMP_ERR_WRONGLENGTH"@
+@ eval $m2c_nv_tmp = "$m2c_nv_len"@
+@ end@
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+@ foreach $a $b range $node@
+@ if $a == $b@
+ && ($m2c_nv_tmp != $a)
+@ else@
+ && (($m2c_nv_tmp < $a) || ($m2c_nv_tmp > $b))
+@ end@
+@ end@
+ ) {
+ rc = $m2c_nv_rc;
+ }
+@end@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/node-varbind-validate.m2i b/local/mib2c-conf.d/node-varbind-validate.m2i
new file mode 100644
index 0000000..1b3fb37
--- /dev/null
+++ b/local/mib2c-conf.d/node-varbind-validate.m2i
@@ -0,0 +1,54 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+##
+## Tests a netsnmp_variable_list pointer (var) against known
+## contstraints. If none are found, calls the user supplied funtion
+## ${node}_check_value.
+##
+## Sets the variable rc to a SNMP_ERR.
+##
+## Requirements
+## ------------
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##----------------------------------------------------------------------
+## setup
+##----------------------------------------------------------------------
+@if $m2c_paranoid == 1@
+netsnmp_assert(rc == SNMP_ERR_NOERROR); /* paranoia */
+@end@
+##----------------------------------------------------------------------
+## syntax specific
+##----------------------------------------------------------------------
+@ifconf syntax-$node.syntax-varbind-validate.m2i@
+@ include syntax-$node.syntax-varbind-validate.m2i@
+@else@
+##----------------------------------------------------------------------
+## Check type
+##----------------------------------------------------------------------
+## if not generated code, length checks are up to user
+@ if "$m2c_data_context" ne "generated"@
+ rc = netsnmp_check_vb_type( var, $node.type );
+@ elsif ($m2c_node_needlength == 1) || ("$node.perltype" eq "BITS")@
+ rc = netsnmp_check_vb_type_and_max_size( var, $node.type,
+ sizeof( $m2c_nvv_item$node ) );
+@ else@
+ rc = netsnmp_check_vb_type_and_size( var, $node.type,
+ sizeof( $m2c_nvv_item$node ) );
+@ end@
+@ eval $m2c_nv_val = "*var->val.integer"@
+@ eval $m2c_nv_len = "var->val_len"@
+@ eval $m2c_nv_str = "var->val.string"@
+@ include node-validate.m2i@
+@end@ # not syntax specific
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/parent-dependencies.m2i b/local/mib2c-conf.d/parent-dependencies.m2i
new file mode 100644
index 0000000..104f150
--- /dev/null
+++ b/local/mib2c-conf.d/parent-dependencies.m2i
@@ -0,0 +1,63 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@ # ;
+########################################################################
+##
+/**
+ * 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
+@if $m2c_create_fewer_files != 1@
+ * ${context}_oids.h.
+@else@
+ * ${context}.h.
+@end@
+ * 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-${table} if you don't have dependencies)
+ */
+int
+${context}_check_dependencies(${context}_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:${context}:${context}_check_dependencies","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check $context row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+## }
+@foreach $node nonindex@
+@ ifconf syntax-$node.syntax-dependencies.m2i@
+@ include syntax-$node.syntax-dependencies.m2i@
+ if ( MFD_SUCCESS != rc )
+ return rc;
+
+@ end@
+@end@ # for each
+## {
+ return rc;
+} /* ${context}_check_dependencies */
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/parent-set.m2i b/local/mib2c-conf.d/parent-set.m2i
new file mode 100644
index 0000000..02afe3d
--- /dev/null
+++ b/local/mib2c-conf.d/parent-set.m2i
@@ -0,0 +1,417 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'h'@
+
+int ${context}_undo_setup( ${context}_rowreq_ctx *rowreq_ctx);
+int ${context}_undo_cleanup( ${context}_rowreq_ctx *rowreq_ctx);
+int ${context}_undo( ${context}_rowreq_ctx *rowreq_ctx);
+int ${context}_commit( ${context}_rowreq_ctx *rowreq_ctx);
+int ${context}_undo_commit( ${context}_rowreq_ctx *rowreq_ctx);
+@ if $m2c_irreversible_commit == 1@
+int ${context}_irreversible_commit( ${context}_rowreq_ctx *rowreq_ctx);
+@ end@
+
+@end@ // m2c_processing_type eq 'h'
+########################################################################
+##//####################################################################
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+##//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@if $m2c_processing_type eq 'c'@
+##
+## MASTER COPY OF THIS FLOWCHART IS IN agent/helpers/baby_steps.c
+##
+ /*
+ * 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
+@if $m2c_table_row_creation == 1@
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+@else@
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+@end@ # row creation
+ * | +==============+
+ * | | 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
+@if $m2c_table_row_creation == 1@
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+@else@
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+@end@ # row creation
+ *
+ */
+
+##----------------------------------------------------------------------
+/**
+ * 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.
+ *
+@if $m2c_undo_embed == 0@
+@ if $m2c_data_init == 1@
+ * Note that the undo context has been allocated with
+ * ${context}_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ${context}_rowreq_ctx_init().
+@ end@
+@end@
+ * 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 (${context}_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+${context}_undo_setup( ${context}_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:${context}:${context}_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup $context undo.
+ * set up $context undo information, in preparation for a set.
+ * Undo storage is in ${m2c_ctx_lh}*
+ */
+
+ return rc;
+} /* ${context}_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 (${context}_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+${context}_undo( ${context}_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:${context}:${context}_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> $context undo.
+ * $context undo information, in response to a failed set.
+ * Undo storage is in ${m2c_ctx_lh}*
+ */
+
+ return rc;
+} /* ${context}_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 (${context}_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+${context}_undo_cleanup( ${context}_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:${context}:${context}_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup $context undo.
+ * Undo storage is in ${m2c_ctx_lh}*
+ */
+
+ return rc;
+} /* ${context}_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
+@if $m2c_create_fewer_files != 1@
+ * ${context}_oids.h.
+@else@
+ * ${context}.h.
+@end@
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param ${context}_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+${context}_commit( ${context}_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:${context}:${context}_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 $context 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.
+ */
+@ foreach $node nonindex@
+@ include m2c_setup_node.m2i@
+@ if $node.settable == 0@
+@ next@
+@ end@
+ if (save_flags & COLUMN_$node.uc_FLAG) {
+ save_flags &= ~COLUMN_$node.uc_FLAG; /* clear $node */
+ /*
+ * TODO:482:o: |-> commit column $node.
+ */
+ rc = -1;
+ if(-1 == rc) {
+ snmp_log(LOG_ERR,"$context column $node commit failed\n");
+ }
+ else {
+ /*
+ * set flag, in case we need to undo $node
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_$node.uc_FLAG;
+ }
+ }
+
+@ end@ # foreach $node
+ /*
+ * 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;
+} /* ${context}_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
+@if $m2c_create_fewer_files != 1@
+ * ${context}_oids.h.
+@else@
+ * ${context}.h.
+@end@
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param ${context}_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+${context}_undo_commit( ${context}_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:${context}:${context}_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo $context 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_$node.uc_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;
+} /* ${context}_undo_commit */
+
+@if $m2c_irreversible_commit == 1@
+##----------------------------------------------------------------------
+/**
+ * perform commit actions that are not reversible
+ *
+ * THERE IS NO ATTEMPT AT RECOVERY FOR ERRORS FROM THIS STATE!
+ *
+ * @param ${context}_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : other error
+ */
+int
+${context}_irreversible_commit( ${context}_rowreq_ctx *rowreq_ctx)
+{
+ int rc;
+
+ DEBUGMSGTL(("verbose:${context}:${context}_irreversible_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:495:o: Irreversible $context commit.
+ */
+##$example_start
+##$example_end
+
+ return MFD_SUCCESS;
+} /* ${context}_irreversible_commit */
+
+@end@ // irreversable commit
+##
+########################################################################
+@end@ // m2c_processing_type eq 'c'
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/subagent.m2c b/local/mib2c-conf.d/subagent.m2c
new file mode 100644
index 0000000..61fc26d
--- /dev/null
+++ b/local/mib2c-conf.d/subagent.m2c
@@ -0,0 +1,195 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@if 0@
+@open ${name}_subagent.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ */
+@include generic-header-top.m2i@
+@include generic-header-bottom.m2i@
+@end@
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}_subagent.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version $Revision$ of $RCSfile$
+ */
+@include generic-source-includes.m2i@
+#include <signal.h>
+
+/*
+ * If compiling within the net-snmp source code, this will trigger the feature
+ * detection mechansim to ensure the agent_check_and_process() function
+ * is left available even if --enable-minimialist is turned on. If you
+ * have configured net-snmp using --enable-minimialist and want to compile
+ * this code externally to the Net-SNMP code base, then please add
+ * --with-features="agent_check_and_process enable_stderrlog" to your
+ * configure line.
+ */
+netsnmp_feature_require(agent_check_and_process)
+netsnmp_feature_require(enable_stderrlog)
+
+static int keep_running;
+
+static RETSIGTYPE
+stop_server(int a) {
+ keep_running = 0;
+}
+
+static void usage(void) {
+ printf("usage: $name [-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 /var/agentx/master).\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("$name"); /* register our .conf handlers */
+ init_$name();
+ init_snmp("$name");
+ 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("$name");
+
+ /* init $name mib code */
+ init_$name();
+
+ /* read ${name}.conf files. */
+ init_snmp("$name");
+
+ /* 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("$name");
+ SOCK_CLEANUP;
+ exit(0);
+}
+
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-COUNTER64-get.m2i b/local/mib2c-conf.d/syntax-COUNTER64-get.m2i
new file mode 100644
index 0000000..7f36830
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-COUNTER64-get.m2i
@@ -0,0 +1,35 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+ ## }
+@end@
+########################################################################
+##
+@include generic-get-decl.m2i@
+/*
+ * TODO:231:o: |-> copy $node data.
+ * get ${m2c_node_lh}.low and ${m2c_node_lh}.high from $m2c_data_item_base
+ */
+@if ("$m2c_data_context" eq "generated")@
+ ${m2c_node_lh}.high = ${m2c_data_item}${node}.high;
+ ${m2c_node_lh}.low = ${m2c_data_item}${node}.low;
+@else@
+ return MFD_SKIP; /* TODO:235:M: |-> Remove SKIP once you've set $node data */
+@end@
+## spirit of @include generic-get-decl-bot.m2i@
+@if $m2c_get_use_temp == 1@
+
+ /* copy temporary value to passed parameter */
+ ${node}_ptr->high = ${m2c_node_lh}.high;
+ ${node}_ptr->low = ${m2c_node_lh}.low;
+@end@
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-DateAndTime-get.m2d b/local/mib2c-conf.d/syntax-DateAndTime-get.m2d
new file mode 100644
index 0000000..dfb2a21
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-DateAndTime-get.m2d
@@ -0,0 +1,9 @@
+##
+##
+@eval $m2c_node_needlength = 0@
+@eval $m2c_decl = "u_char *"@
+##
+@eval $m2c_node_proto_parms = "u_char * ${node}"@
+##
+@eval $m2c_node_proto_comments = "$m2c_node_proto_comments * Param: ${node}\n"@
+@eval $m2c_node_proto_comments = "$m2c_node_proto_comments * Pointer to storage for a DateAndTime value\n"@
diff --git a/local/mib2c-conf.d/syntax-DateAndTime-get.m2i b/local/mib2c-conf.d/syntax-DateAndTime-get.m2i
new file mode 100644
index 0000000..984d1e2
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-DateAndTime-get.m2i
@@ -0,0 +1,54 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+ /* temporary storage for date. If you have any of this data available
+ directly, use it instead. */
+ int year, month, day, hour, minutes, seconds, deci_seconds;
+ int rc, utc_offset_direction, utc_offset_hours, utc_offset_minutes;
+
+ /** we should have a pointer and enough storage */
+ netsnmp_assert( (NULL != $m2c_node_param_ref_name) && (NULL != *$m2c_node_param_ref_name));
+ netsnmp_assert( (NULL != $m2c_node_param_ref_lname) && ((* $m2c_node_param_ref_lname) >= 11));
+
+ /*
+ * TODO:231:o: |-> copy $node data.
+ * get the date from your context pointer.
+ */
+ return MFD_SKIP; /* TODO:234:M: |-> Remove SKIP once you've set $node data */
+
+ year = 0; /* 0..65536 */
+ month = 0; /* 1..12 */
+ day = 0; /* 1..31 */
+ hour = 0; /* 0..23 */
+ minutes = 0; /* 0..59 */
+ seconds = 0; /* 0..60 (60 indicates a leap-second) */
+ deci_seconds = 0; /* 0..9 */
+
+ /* setting utc offset is optional. Leave the values as is if you
+ want to exclude this information. */
+ utc_offset_direction = 0; /* -1, +1 */
+ utc_offset_hours = -1; /* 0..13 */
+ utc_offset_minutes = -1; /* 0..59 */
+
+ /* call convenience function to set data */
+ rc = netsnmp_dateandtime_set_buf_from_vars(*$m2c_node_param_ref_name,
+ $m2c_node_param_ref_lname,
+ year, month, day,
+ hour, minutes, seconds, deci_seconds,
+ utc_offset_direction, utc_offset_hours,
+ utc_offset_minutes );
+ if(rc != SNMP_ERR_NOERROR)
+ return rc;
+
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-DateAndTime-readme.m2i b/local/mib2c-conf.d/syntax-DateAndTime-readme.m2i
new file mode 100644
index 0000000..cc678ac
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-DateAndTime-readme.m2i
@@ -0,0 +1,4 @@
+ This column is a DataAndTime object. The local local variables year,
+ month, day, hour, minues, seconds, deci_seconds, utc_offset_direction,
+ utc_offset_hours and utc_offset_minutes should be set from the data
+ context before the netsnmp_dateandtime_set_buf_from_vars function call.
diff --git a/local/mib2c-conf.d/syntax-InetAddress-get.m2i b/local/mib2c-conf.d/syntax-InetAddress-get.m2i
new file mode 100644
index 0000000..253980c
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-InetAddress-get.m2i
@@ -0,0 +1,100 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+ /*
+ * TODO:231:M: |-> copy $node data.
+ * TODO:231:M: | |-> get address type from your context pointer.
+ */
+ int addressType = -1;
+ size_t actual_size = 0;
+
+ return MFD_SKIP; /* TODO:235:M: |-> Remove SKIP once you've set $node data */
+
+ switch (addressType) {
+ case INETADDRESSTYPE_UNKNOWN:
+ /*
+ * An unknown address type. This value MUST be used if the value
+ * of the InetAddress object is a zero-length string. It may also be
+ * used to indicate an IP address which is not in one of the formats
+ * defined below.
+ */
+ actual_size = ${m2c_ctx_rhs};
+ break;
+
+ case INETADDRESSTYPE_IPV4:
+ /*
+ * Represents an IPv4 network address:
+ * octets contents encoding
+ * 1-4 IPv4 address network-byte order
+ */
+ actual_size = 4;
+ break;
+
+ case INETADDRESSTYPE_IPV6:
+ /*
+ * Represents an IPv6 network address:
+ *
+ * octets contents encoding
+ * 1-16 IPv6 address network-byte order
+ */
+ actual_size = 16;
+ break;
+
+ case INETADDRESSTYPE_IPV4Z:
+ /*
+ * Represents a non-global IPv4 network address together
+ * with its zone index:
+ *
+ * octets contents encoding
+ * 1-4 IPv4 address network-byte order
+ * 5-8 zone index network-byte order
+ */
+ actual_size = 8;
+ break;
+
+ case INETADDRESSTYPE_IPV6Z:
+ /*
+ * Represents a non-global IPv6 network address together
+ * with its zone index:
+ *
+ * octets contents encoding
+ * 1-16 IPv6 address network-byte order
+ * 17-20 zone index network-byte order
+ */
+ actual_size = 20;
+ break;
+
+ case INETADDRESSTYPE_DNS:
+ /*
+ * Represents a DNS domain name. The name SHOULD be fully
+ * qualified whenever possible.
+ */
+ actual_size = ${m2c_ctx_rhs};
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown InetAddressType %d for $node\n",
+ addressType);
+ return SNMP_ERR_GENERR;
+ }
+
+ if ( actual_size > ${m2c_ctx_lhs} ) {
+ snmp_log(LOG_ERR, "actual size %d too big for $node\n",
+ addressType);
+ return SNMP_ERR_GENERR;
+ }
+
+ memcpy( ${m2c_ctx_lh}, ${m2c_ctx_rh}, actual_size);
+ ${m2c_ctx_lhs} = actual_size;
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-InetAddress-set.m2i b/local/mib2c-conf.d/syntax-InetAddress-set.m2i
new file mode 100644
index 0000000..be3cf10
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-InetAddress-set.m2i
@@ -0,0 +1,22 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+ /*
+ * Note: if there is a corresponding InetAddressType object, we don't
+ * know if they'll be set together, or which order they will be set.
+ * So we just accept the value here, and check that both values are
+ * consistent in ${context}_check_dependencies().
+ */
+@include generic-ctx-set.m2i@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-InetAddressType-get.m2i b/local/mib2c-conf.d/syntax-InetAddressType-get.m2i
new file mode 100644
index 0000000..0b89a5a
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-InetAddressType-get.m2i
@@ -0,0 +1,25 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@include generic-get-decl.m2i@
+@include generic-ctx-get.m2i@
+ /* the ${context}_rowreq_ctx->data pointer should be pointer to the data you
+ supplied during the data lookup, so you should know how to
+ determine the InetAddressType from this pointer. */
+
+ return MFD_SKIP; /* TODO:235:M: |-> Remove SKIP once you've set $node data */
+
+@include generic-value-map.m2i@
+@include generic-get-decl-bot.m2i@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-InetAddressType-set.m2i b/local/mib2c-conf.d/syntax-InetAddressType-set.m2i
new file mode 100644
index 0000000..fb81efe
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-InetAddressType-set.m2i
@@ -0,0 +1,25 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+ /*
+ * TODO:230:o: Set $node data
+ * set data context from $m2c_ctx_rh
+ *
+ * Note: if there is a corresponding InetAddress object, we don't
+ * know if they'll be set together, or which order they will be set.
+ * So we just accept the value here, and check that both values are
+ * consistent in ${context}_check_dependencies().
+ */
+@include generic-ctx-set.m2i@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i b/local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i
new file mode 100644
index 0000000..9f14baf
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-RowStatus-dependencies.m2i
@@ -0,0 +1,113 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+## {
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_$node.uc_FLAG) {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to $node_check_value
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition( ${m2c_undo_item}$node,
+ ${m2c_data_item}$node );
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+@if $m2c_table_row_creation == 1@
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ if (ROWSTATUS_DESTROY == ${m2c_data_item}$node) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ }
+ else if (ROWSTATUS_CREATEANDGO == ${m2c_data_item}$node) {
+ if ((rowreq_ctx->column_set_flags & $context.uc_REQUIRED_COLS)
+ != $context.uc_REQUIRED_COLS) {
+ DEBUGMSGTL(("${context}",
+ "required columns missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_set_flags, $context.uc_REQUIRED_COLS));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ ${m2c_data_item}$node = ROWSTATUS_ACTIVE;
+ }
+ } /* row creation */
+ else {
+@end@
+ /*
+ * 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 == ${m2c_data_item}$node) {
+@if $m2c_table_refcounts == 1@
+ if (0 != rowreq_ctx->ref_count) {
+ DEBUGMSGTL(("$context",
+ "can't delete row, %d references\n",
+ rowreq_ctx->ref_count));
+ return MFD_NOT_VALID_NOW;
+ }
+@end@
+ if (rowreq_ctx->column_set_flags & ~COLUMN_$node.uc_FLAG) {
+ DEBUGMSGTL(("$context",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+@if $m2c_table_refcounts == 1@
+ else if(ROWSTATUS_NOTINSERVICE == ${m2c_data_item}$node) {
+ if (0 != rowreq_ctx->ref_count) {
+ DEBUGMSGTL(("$context",
+ "can't deactivate row, %d references\n",
+ rowreq_ctx->ref_count));
+ return MFD_NOT_VALID_NOW;
+ }
+ } /* notInService */
+@end@
+@if $m2c_table_row_creation == 1@
+ } /* row change */
+@end@
+ }
+ else {
+@if $m2c_table_row_creation == 1@
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("$context",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+@else@
+ /*
+ * row creation not supported
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("$context",
+ "row creation not supported\n"));
+ return MFD_CANNOT_CREATE_EVER;
+ }
+@end@
+ } /* row status not set */
+
+## }
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-RowStatus-get.m2i b/local/mib2c-conf.d/syntax-RowStatus-get.m2i
new file mode 100644
index 0000000..f8e0996
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-RowStatus-get.m2i
@@ -0,0 +1,65 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@include generic-get-decl.m2i@
+@include generic-ctx-get.m2i@
+@if $m2c_node_skip_mapping != 1@
+ /*
+ * TODO:245:o: |-> Implement $context RowStatus mapping
+@if $mfd_code_verbose == 1@
+ *
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+@end@
+ */
+ /*
+ * update INTERNAL_* macros defined in the header, if neccessary
+ */
+ switch ($m2c_node_lh) {
+
+ /* `active', which indicates that the conceptual row is
+ available for use by the managed device */
+ case INTERNAL_$context.uc_$node.uc_ACTIVE:
+ $m2c_node_lh = ROWSTATUS_ACTIVE;
+ break;
+
+ /* `notInService', which indicates that the conceptual
+ row exists in the agent, but is unavailable for use by
+ the managed device (see NOTE below); 'notInService' has
+ no implication regarding the internal consistency of
+ the row, availability of resources, or consistency with
+ the current state of the managed device */
+ case INTERNAL_$context.uc_$node.uc_NOTINSERVICE:
+ $m2c_node_lh = ROWSTATUS_NOTINSERVICE;
+ break;
+
+ /* `notReady', which indicates that the conceptual row
+ exists in the agent, but is missing information
+ necessary in order to be available for use by the
+ managed device (i.e., one or more required columns in
+ the conceptual row have not been instanciated) */
+ case INTERNAL_$context.uc_$node.uc_NOTREADY:
+ $m2c_node_lh = ROWSTATUS_NOTREADY;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for $node RowStatus\n",
+ $m2c_node_lh);
+ return SNMP_ERR_GENERR;
+ }
+
+@end@
+@include generic-get-decl-bot.m2i@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-RowStatus-varbind-validate.m2i b/local/mib2c-conf.d/syntax-RowStatus-varbind-validate.m2i
new file mode 100644
index 0000000..dc91ac8
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-RowStatus-varbind-validate.m2i
@@ -0,0 +1,16 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+rc = netsnmp_check_vb_rowstatus_value(var);
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-StorageType-dependencies.m2i b/local/mib2c-conf.d/syntax-StorageType-dependencies.m2i
new file mode 100644
index 0000000..0419514
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-StorageType-dependencies.m2i
@@ -0,0 +1,19 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+## {
+ /*
+ * check for valid StorageType transition (old, new)
+ */
+ rc = check_storage_transition( ${m2c_undo_item}$node, ${m2c_data_item}$node );
+## }
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-conf.d/syntax-TestAndIncr-get.m2i b/local/mib2c-conf.d/syntax-TestAndIncr-get.m2i
new file mode 100644
index 0000000..7cd2f60
--- /dev/null
+++ b/local/mib2c-conf.d/syntax-TestAndIncr-get.m2i
@@ -0,0 +1,22 @@
+############################################################# -*- c -*-
+## generic include for XXX. Do not use directly.
+##
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@include generic-get-decl.m2i@
+
+ return MFD_SKIP; /* TODO:235:M: Remove SKIP once you've set $node data */
+
+@include generic-ctx-get.m2i@
+@include generic-get-long.m2i@
+@include generic-get-decl-bot.m2i@
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c-update b/local/mib2c-update
new file mode 100755
index 0000000..42017e5
--- /dev/null
+++ b/local/mib2c-update
@@ -0,0 +1,366 @@
+#!/bin/sh
+#
+# $Id$
+#
+# script to merge custom code into updated mib2c code
+#
+#----- example .mib2c-updaterc -----
+#UPDATE_OID=ipAddressTable
+#UPDATE_CONF=mib2c.mfd.conf
+#UPDATE_MIB2C_OPTS=
+#UPDATE_NOPROBE=1
+#----- example .mib2c-updaterc -----
+
+#----------------------------------------------------------------------
+#
+# defaults
+#
+UPDATE_CURR=$PWD
+UPDATE_ORIG=$PWD/.orig
+UPDATE_NEW=$PWD/.new
+UPDATE_MERGED=$PWD/.merged
+UPDATE_BACKUP=$PWD/.backup
+UPDATE_PATCH=$PWD/.patch
+
+#
+# number of diff context lines / patch fuzz factor
+#
+FUZZ=5
+FIRST_RUN=0
+
+#----------------------------------------------------------------------
+#
+debug()
+{
+ if [ $UPDATE_DEBUG -ge 1 ]; then
+ echo $1
+ fi
+}
+
+error()
+{
+ echo "ERROR: $@" >&2
+}
+
+die()
+{
+ error "$@"
+ exit 99
+}
+
+safecd()
+{
+ cd $1
+ if [ $? -ne 0 ]; then
+ die "changing to directory $1 from $PWD failed!"
+ fi
+}
+
+safecp()
+{
+ cp $@
+ if [ $? -ne 0 ]; then
+ die "'cp $@' failed!"
+ fi
+}
+
+#----------------------------------------------------------------------
+#
+check_setup()
+{
+ rc=1
+ for d in $UPDATE_CURR $UPDATE_ORIG $UPDATE_NEW $UPDATE_MERGED $UPDATE_PATCH $UPDATE_BACKUP $UPDATE_BACKUP/curr $UPDATE_BACKUP/orig
+ do
+ if [ ! -d $d ]; then
+ echo "Creating missing directory $d"
+ mkdir -p $d
+ if [ $? -ne 0 ]; then
+ error "Could not create directory $d"
+ rc=0
+ fi
+ fi
+ done
+
+ if [ -z "$UPDATE_OID" ]; then
+ error "Environment variable missing! Set UPDATE_OID in .mib2c-updaterc"
+ rc=0
+ fi
+
+ if [ -z "$UPDATE_CONF" ]; then
+ error "Environment variable missing! Set UPDATE_CONF in .mib2c-updaterc"
+ rc=0
+ fi
+
+# if [ -z "$UPDATE_" ]; then
+# error "Environment variable missing! Set UPDATE_ in .mib2c-updaterc"
+# rc=0
+# fi
+
+ if [ $rc -eq 0 ] && [ $UPDATE_NOPROBE -ne 1 ]; then
+ mib2c -c unknown > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ error "WARNING: mib2c returns 0 on error conditions!"
+ rc=0
+ fi
+ fi
+
+ return $rc
+}
+
+#----------------------------------------------------------------------
+#
+do_diff()
+{
+ DD_ORIG=$1
+ DD_CURR=$2
+ DD_OUTPUT=$3
+ # u | c unified | context
+ # r recursive
+ # b ignore blank lines
+ # w ignore white space
+ # p Show which C function each change is in.
+ # d smaller changes
+ # --exclude='*Makefile' --unidirectional-new-file
+ local rc=0
+ local rcs=0
+ safecd $DD_ORIG
+ echo " checking files in $1 ($PWD)"
+ files=`ls *$UPDATE_OID* 2>/dev/null`
+ if [ ! -z "$files" ]; then
+ for f in $files; do
+ diff -U $FUZZ -p -b -w --show-c-function \
+ -I "$""Id:" $f $DD_CURR/$f >> $DD_OUTPUT
+ rc=$?
+ rcs=`expr $rcs + $rc`
+ if [ $rc -eq 1 ]; then
+ echo " $f is different"
+ fi
+ done
+ fi
+ if [ $rcs -eq 0 ]; then
+ rm -f $DD_OUTPUT
+ fi
+ safecd -
+ return $rcs
+}
+
+#----------------------------------------------------------------------
+#
+do_cp()
+{
+ src=$1
+ dest=$2
+ if [ ! -d $dest ]; then
+ die "dest $dest is not a directory"
+ fi
+ if [ ! -d $src ]; then
+ die "src $src is not a directory"
+ fi
+ safecd $src
+ files=`ls *$UPDATE_OID* 2>/dev/null| egrep "(file|onf|m2d|txt|\.c|\.h)$"`
+ if [ -z "$files" ]; then
+ echo " no files to copy from $src"
+ else
+ safecp $files $dest
+ if [ $? -ne 0 ]; then
+ die "error while copying files from $src to $dest in $PWD"
+ fi
+ fi
+ safecd -
+}
+
+#----------------------------------------------------------------------
+#
+save_diff()
+{
+ echo "Creating patch for your custom code"
+ cnt=`ls $UPDATE_CURR/*$UPDATE_OID* 2>/dev/null | egrep "(file|onf|m2d|txt|\.c|\.h)$" | wc -l`
+ if [ $cnt -eq 0 ]; then
+ echo " no custom code!"
+ FIRST_RUN=1
+ return
+ fi
+
+ do_diff $UPDATE_ORIG/ $UPDATE_CURR/ $UPDATE_PATCH/custom.$UPDATE_DATE
+ if [ $? -eq 0 ]; then
+ echo " no custom code changes found."
+ fi
+}
+
+#----------------------------------------------------------------------
+#
+gen_code()
+{
+ copy_defaults . $UPDATE_NEW
+
+ safecd $UPDATE_NEW
+ files=`ls *$UPDATE_OID* 2>/dev/null | grep -v "^default"`
+ if [ ! -z "$files" ]; then
+ rm -f $files > /dev/null 2>&1
+ fi
+ echo "mib2c $@ -c $UPDATE_CONF $UPDATE_MIB2C_OPTS $UPDATE_OID"
+ mib2c $@ -c $UPDATE_CONF $UPDATE_MIB2C_OPTS $UPDATE_OID
+ if [ $? -ne 0 ]; then
+ die "bad rc $rc from mib2 while generation new code."
+ fi
+ safecd -
+}
+
+#----------------------------------------------------------------------
+#
+check_new()
+{
+ echo "Checking for updates to generated code"
+ do_diff $UPDATE_ORIG/ $UPDATE_NEW/ $UPDATE_PATCH/generated.$UPDATE_DATE
+ if [ $? -eq 0 ]; then
+ echo "Generated code has not changed."
+ safecd $UPDATE_PATCH
+ files=`ls *.$UPDATE_DATE 2>/dev/null `
+ if [ ! -z "$files" ]; then
+ rm $files
+ fi
+ exit 0
+ fi
+}
+
+#----------------------------------------------------------------------
+#
+merge_code()
+{
+ files=`ls $UPDATE_MERGED/* 2>/dev/null `
+ if [ ! -z "$files" ]; then
+ rm $UPDATE_MERGED/*
+ fi
+ do_cp $UPDATE_NEW $UPDATE_MERGED
+
+ if [ -f $UPDATE_PATCH/custom.$UPDATE_DATE ]; then
+ touch .M2C-UPDATE-MERGE-FAILED
+ echo "Patching new generated code in $UPDATE_MERGED ($PWD)"
+ # --forward = ignore already applied
+ patch --forward -F $FUZZ -N -d $UPDATE_MERGED -i $UPDATE_PATCH/custom.$UPDATE_DATE
+ if [ $? -ne 0 ]; then
+ error "Could not apply custom code patch to new generated code"
+ die "You must fix the problem in $UPDATE_MERGED, and then re-run mib2c-update."
+ fi
+ rm .M2C-UPDATE-MERGE-FAILED
+ fi
+}
+
+copy_defaults()
+{
+ SRC=$1
+ DST=$2
+ if [ -d $SRC/defaults ]; then
+ safecp -a $SRC/defaults $DST
+ else
+ files=`ls $SRC/default-*.m2d 2>/dev/null `
+ if [ ! -z "$files" ]; then
+ safecp $files $DST
+ fi
+ fi
+
+}
+
+copy_merged()
+{
+ echo "Backing up current code to $UPDATE_BACKUP/curr"
+ do_cp $UPDATE_CURR $UPDATE_BACKUP/curr/
+ copy_defaults . $UPDATE_BACKUP/curr/
+
+ echo "Copying merged code to $UPDATE_CURR"
+ do_cp $UPDATE_MERGED $UPDATE_CURR/
+
+
+ echo "Backing up original code to $UPDATE_BACKUP/orig"
+ do_cp $UPDATE_ORIG $UPDATE_BACKUP/orig/
+ echo "Saving new original code to $UPDATE_ORIG"
+ do_cp $UPDATE_NEW $UPDATE_ORIG/
+}
+
+copy_new()
+{
+ echo "Copying code to $UPDATE_CURR"
+ do_cp $UPDATE_NEW $UPDATE_CURR/
+ # copy defaults back to current dir (which may not be UPDATE_CURR)
+ copy_defaults $UPDATE_NEW .
+
+ echo "Saving original code to $UPDATE_ORIG"
+ do_cp $UPDATE_NEW $UPDATE_ORIG/
+}
+
+copy_code()
+{
+ if [ $FIRST_RUN -ne 1 ]; then
+ copy_merged
+ else
+ copy_new
+ fi
+
+ # always get defaults from UPDATE_NEW, since those are what were used.
+ copy_defaults $UPDATE_NEW .
+}
+
+
+#----------------------------------------------------------------------
+UPDATE_NOPROBE=0
+
+if [ -f $HOME/.mib2c-updaterc ]; then
+ . $HOME/.mib2c-updaterc
+fi
+
+if [ -f $PWD/.mib2c-updaterc ]; then
+ . $PWD/.mib2c-updaterc
+else
+ echo "creating example .mib2c-udpaterc. edit as needed and re-run "
+ echo "mib2c-update."
+
+ echo "UPDATE_OID=ipAddressTable" >> .mib2c-updaterc
+ echo "UPDATE_CONF=mib2c.mfd.conf" >> .mib2c-updaterc
+ echo "UPDATE_MIB2C_OPTS=" >> .mib2c-updaterc
+ echo "#UPDATE_NOPROBE=1" >> .mib2c-updaterc
+fi
+
+check_setup
+if [ $? -ne 1 ]; then
+ exit 1
+fi
+
+UPDATE_DATE=`date "+%F_%I.%M"`
+echo "Starting regneration of $UPDATE_OID using $UPDATE_CONF at $UPDATE_DATE"
+
+if [ -f .M2C-UPDATE-MERGE-FAILED ]; then
+ echo "It appears that the last run of mib2c-update was not able to merge"
+ echo "your changes automatically. Do you want to:"
+ echo
+ while : ; do
+ echo "[c)opy merged files to $UPDATE_CURR]"
+ echo "[r)e-run from scratch]"
+ echo "[q)uit]"
+ echo "(c|r|q) ?"
+ read ans
+ if [ "x$ans" = "xr" ]; then
+ rm .M2C-UPDATE-MERGE-FAILED
+ break
+ elif [ "x$ans" = "xc" ]; then
+ echo "Have you have manually merged all the"
+ echo "changes into the merged directory?"
+ echo "(y|n)"
+ read ans
+ if [ "x$ans" != "xy" ]; then
+ echo "Ok. Try again after you've done that."
+ exit 1
+ fi
+ rm .M2C-UPDATE-MERGE-FAILED
+ copy_code
+ exit 0
+ fi
+ done
+fi
+
+save_diff
+gen_code $@
+if [ $FIRST_RUN -ne 1 ]; then
+ check_new
+ merge_code
+fi
+copy_code
diff --git a/local/mib2c.access_functions.conf b/local/mib2c.access_functions.conf
new file mode 100644
index 0000000..9d54f14
--- /dev/null
+++ b/local/mib2c.access_functions.conf
@@ -0,0 +1,183 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}_access.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_ACCESS_H
+#define $name.uc_ACCESS_H
+
+@foreach $t table@
+/** User-defined data access functions for data in table $t */
+/** row level accessors */
+Netsnmp_First_Data_Point ${t}_get_first_data_point;
+Netsnmp_Next_Data_Point ${t}_get_next_data_point;
+int ${t}_commit_row(void **my_data_context, int new_or_del);
+void * ${t}_create_data_context(netsnmp_variable_list *index_data, int column);
+
+/** column accessors */
+ @foreach $c column@
+ @if $c.access =~ /(Read|Create)/@
+ $c.decl *get_$c(void *data_context, size_t *ret_len);
+ @end@
+ @if $c.access =~ /(Write|Create)/@
+ int set_$c(void *data_context, $c.decl *val, size_t val_len);
+ @end@
+ @end@
+@end@
+
+#endif /* $name.uc_ACCESS_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}_access.c@
+
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}_access.h"
+#include "${name}_enums.h"
+
+@foreach $t table@
+
+/** returns the first data point within the $t 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 *
+${t}_get_first_data_point(void **my_loop_context, void **my_data_context,
+ netsnmp_variable_list *put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+
+ netsnmp_variable_list *vptr;
+
+ *my_loop_context = /** XXX */;
+ *my_data_context = /** XXX */;
+
+ vptr = put_index_data;
+
+ @foreach $idx index@
+ snmp_set_var_value(vptr, /** XXX: $idx data */, /** XXX: length of $idx data */);
+ vptr = vptr->next_variable;
+ @end@
+
+ return put_index_data;
+}
+
+/** functionally the same as ${t}_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 *
+${t}_get_next_data_point(void **my_loop_context, void **my_data_context,
+ netsnmp_variable_list *put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+
+ netsnmp_variable_list *vptr;
+
+ *my_loop_context = /** XXX */;
+ *my_data_context = /** XXX */;
+
+ vptr = put_index_data;
+
+ @foreach $idx index@
+ snmp_set_var_value(vptr, /** XXX: $idx data */, /** XXX: length of $idx data */);
+ vptr = vptr->next_variable;
+ @end@
+
+ return put_index_data;
+}
+
+/** 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 retrieval and modification during
+ * this SET request.
+ *
+ * The indexes are encoded (in order) into the index_data pointer,
+ * and the column object which triggered the row creation is available
+ * via the column parameter, if it would be helpful to use that information.
+ */
+void *
+${t}_create_data_context(netsnmp_variable_list *index_data, int column) {
+ return NULL; /* XXX: you likely want to return a real pointer */
+}
+
+/** 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.
+
+ new_or_del will be set to 1 if new, or -1 if it should be deleted
+ or 0 if it is just a modification of an existing row.
+
+ If you free the data yourself, make sure to *my_data_context = NULL */
+int
+${t}_commit_row(void **my_data_context, int new_or_del)
+{
+ /** Add any necessary commit code here */
+ /* */
+
+ /* 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 $t */
+/*
+ * 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.
+ */
+ @foreach $c column@
+ @if $c.access =~ /(Read|Create)/@
+/** XXX: return a data pointer to the data for the $c column and set
+ ret_len to its proper size in bytes. */
+ $c.decl *get_$c(void *data_context, size_t *ret_len) {
+ return NULL; /** XXX: replace this with a pointer to a real value */
+ }
+ @end@
+ @if $c.access =~ /(Write|Create)/@
+/** XXX: Set the value of the $c column and return
+ SNMP_ERR_NOERROR on success
+ SNMP_ERR_XXX for SNMP deterministic error codes
+ SNMP_ERR_GENERR on generic failures (a last result response). */
+ int set_$c(void *data_context, $c.decl *val, size_t val_len) {
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+ }
+ @end@
+ @end@
+
+@end@
+
diff --git a/local/mib2c.array-user.conf b/local/mib2c.array-user.conf
new file mode 100644
index 0000000..31559ac
--- /dev/null
+++ b/local/mib2c.array-user.conf
@@ -0,0 +1,1305 @@
+## -*- c -*-
+##
+## For documentation on the code generated by this configuration file,
+## see the file agent/helpers/table_array.c.
+##
+######################################################################
+## Do the .h file
+## @perleval $vars{shortname} =~ s/([A-Z])[a-z]+/$1/g@
+######################################################################
+@foreach $i table@
+@open ${i}.h@
+@eval $hack = "Id"
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ *
+ * $$hack:$
+ *
+ * Yes, there is lots of code here that you might not use. But it is much
+ * easier to remove code than to add it!
+ */
+#ifndef $i.uc_H
+#define $i.uc_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/agent/table_array.h>
+
+ @eval $ext_index = 0@
+ @foreach $idx index@
+ @if "$idx" ne ""@
+ @eval $found = "external"@
+ @foreach $c column@
+ @if "$idx" eq "$c"@
+ @eval $found = "internal"@
+ @end@
+ @end@
+ /** Index $idx is $found */
+ @if "$found" eq "external"@
+ @eval $ext_index = 1@
+ @end@
+ @end@
+ @end@
+
+typedef struct ${i}_context_s {
+ netsnmp_index index; /** THIS MUST BE FIRST!!! */
+
+ /*************************************************************
+ * You can store data internally in this structure.
+ *
+ * TODO: You will probably have to fix a few types here...
+ */
+ @if $ext_index != 0@
+ /** TODO: add storage for external index(s)! */
+ @end@
+ @foreach $c column@
+ /** $c.syntax = $c.type */
+ @eval $have_type = 0@
+ @if "$c.type" eq "ASN_OCTET_STR"@
+ @eval $have_type = 1@
+ @eval $o_len = "65535"@
+ @if "$c.syntax" eq "DisplayString"@
+ @eval $o_len = "255"@
+ @end@
+ @if "$c.syntax" eq "SnmpAdminString"@
+ @eval $o_len = "255"@
+ @end@
+ unsigned char $c[$o_len];
+ long ${c}_len;
+ @end@
+ @if "$c.type" eq "ASN_OBJECT_ID"@
+ @eval $have_type = 1@
+ oid $c[MAX_OID_LEN];
+ long ${c}_len;
+ @end@
+ @if "$c.type" eq "ASN_UNSIGNED"@
+ @eval $have_type = 1@
+ unsigned long $c;
+ @end@
+ @if "$c.type" eq "ASN_TIMETICKS"@
+ @eval $have_type = 1@
+ unsigned long $c;
+ @end@
+ @if "$c.type" eq "ASN_IPADDRESS"@
+ @eval $have_type = 1@
+ unsigned long $c;
+ @end@
+ @if "$c.type" eq "ASN_UINTEGER"@
+ @eval $have_type = 1@
+ unsigned long $c;
+ @end@
+ @if "$c.type" eq "ASN_INTEGER"@
+ @eval $have_type = 1@
+ long $c;
+ @end@
+ @if "$c.type" eq "ASN_COUNTER"@
+ @eval $have_type = 1@
+ unsigned long $c;
+ @end@
+ @if $have_type == 0@
+ /** TODO: Is this type correct? */
+ long $c;
+ @end@
+
+ @end@
+
+ /*
+ * OR
+ *
+ * Keep a pointer to your data
+ */
+ void * data;
+
+ /*
+ *add anything else you want here
+ */
+
+} ${i}_context;
+
+/*************************************************************
+ * function declarations
+ */
+void init_$i(void);
+void initialize_table_$i(void);
+const ${i}_context * ${i}_get_by_idx(netsnmp_index *);
+const ${i}_context * ${i}_get_by_idx_rs(netsnmp_index *,
+ int row_status);
+int ${i}_get_value(netsnmp_request_info *, netsnmp_index *, netsnmp_table_request_info *);
+
+
+/*************************************************************
+ * oid declarations
+ */
+extern const oid ${i}_oid[];
+extern const size_t ${i}_oid_len;
+
+#define ${i}_TABLE_OID $i.commaoid
+
+/*************************************************************
+ * column number definitions for table $i
+ */
+@eval $minv = 0xffffffff@
+@eval $maxv = 0@
+@foreach $c column@
+#define COLUMN_$c.uc $c.subid
+@if ! $c.noaccess@
+@eval $minv = min($minv, $c.subid)@
+@eval $maxv = max($maxv, $c.subid)@
+@end@
+@if "$c.syntax" eq "RowStatus"@
+ @eval $rs_name = "$c"@
+@end@
+@if "$c.syntax" eq "StorageType"@
+ @eval $st_name = "$c"@
+@end@
+@end@
+#define ${i}_COL_MIN $minv
+#define ${i}_COL_MAX $maxv
+
+/* comment out the following line if you don't want a custom sort */
+#define ${i}_CUSTOM_SORT
+
+@if "$rs_name" ne ""@
+/* uncommend the following line if you allow modifications to an
+ * active row */
+/** define ${i}_CAN_MODIFY_ACTIVE_ROW */
+
+@end@
+@if $i.settable@
+int ${i}_extract_index( ${i}_context * ctx, netsnmp_index * hdr );
+
+void ${i}_set_reserve1( netsnmp_request_group * );
+void ${i}_set_reserve2( netsnmp_request_group * );
+void ${i}_set_action( netsnmp_request_group * );
+void ${i}_set_commit( netsnmp_request_group * );
+void ${i}_set_free( netsnmp_request_group * );
+void ${i}_set_undo( netsnmp_request_group * );
+
+${i}_context * ${i}_duplicate_row( ${i}_context* );
+netsnmp_index * ${i}_delete_row( ${i}_context* );
+
+@if "$rs_name" ne ""@
+int ${i}_can_activate(${i}_context *undo_ctx,
+ ${i}_context *row_ctx,
+ netsnmp_request_group * rg);
+int ${i}_can_deactivate(${i}_context *undo_ctx,
+ ${i}_context *row_ctx,
+ netsnmp_request_group * rg);
+@end@
+int ${i}_can_delete(${i}_context *undo_ctx,
+ ${i}_context *row_ctx,
+ netsnmp_request_group * rg);
+
+
+@if $i.creatable@
+${i}_context * ${i}_create_row( netsnmp_index* );
+@end@
+@end@
+
+#ifdef ${i}_CUSTOM_SORT
+${i}_context * ${i}_get( const char *name, int len );
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** $i.uc_H */
+@end@
+######################################################################
+## Do the .c file
+######################################################################
+@foreach $i table@
+@open ${i}.c@
+@eval $hack = "Id"@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ *
+ * $$hack:$
+ *
+ *
+ * For help understanding NET-SNMP in general, please check the
+ * documentation and FAQ at:
+ *
+ * http://www.net-snmp.org/
+ *
+ *
+ * For help understanding this code, the agent and how it processes
+ * requests, please check the following references.
+ *
+ * http://www.net-snmp.org/tutorial-5/
+ *
+ *
+ * You can also join the #net-snmp channel on irc.freenode.net
+ * and ask for help there.
+ *
+ *
+ * And if all else fails, send a detailed message to the developers
+ * describing the problem you are having to:
+ *
+ * net-snmp-coders@lists.sourceforge.net
+ *
+ *
+ * Yes, there is lots of code here that you might not use. But it is much
+ * easier to remove code than to add it!
+ */
+#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/snmp_assert.h>
+
+#include "${i}.h"
+
+static netsnmp_handler_registration *my_handler = NULL;
+static netsnmp_table_array_callbacks cb;
+
+const oid ${i}_oid[] = { ${i}_TABLE_OID };
+const size_t ${i}_oid_len = OID_LENGTH(${i}_oid);
+
+
+#ifdef ${i}_CUSTOM_SORT
+/************************************************************
+ * keep binary tree to find context by name
+ */
+static int ${i}_cmp( const void *lhs, const void *rhs );
+
+/************************************************************
+ * compare two context pointers here. Return -1 if lhs < rhs,
+ * 0 if lhs == rhs, and 1 if lhs > rhs.
+ */
+static int
+${i}_cmp( const void *lhs, const void *rhs )
+{
+ ${i}_context *context_l =
+ (${i}_context *)lhs;
+ ${i}_context *context_r =
+ (${i}_context *)rhs;
+
+ /*
+ * check primary key, then secondary. Add your own code if
+ * there are more than 2 keys
+ */
+ int rc;
+
+ /*
+ * TODO: implement compare. Remove this ifdef code and
+ * add your own code here.
+ */
+#ifdef TABLE_CONTAINER_TODO
+ snmp_log(LOG_ERR,
+ "${i}_compare not implemented! Container order undefined\n" );
+ return 0;
+#endif
+
+ /*
+ * EXAMPLE (assuming you want to sort on a name):
+ *
+ * rc = strcmp( context_l->xxName, context_r->xxName );
+ *
+ * if(rc)
+ * return rc;
+ *
+ * TODO: fix secondary keys (or delete if there are none)
+ *
+ * if(context_l->yy < context_r->yy)
+ * return -1;
+ *
+ * return (context_l->yy == context_r->yy) ? 0 : 1;
+ */
+}
+
+/************************************************************
+ * search tree
+ */
+/** TODO: set additional indexes as parameters */
+${i}_context *
+${i}_get( const char *name, int len )
+{
+ ${i}_context tmp;
+
+ /** we should have a custom container */
+ netsnmp_assert(cb.container->next != NULL);
+
+ /*
+ * TODO: implement compare. Remove this ifdef code and
+ * add your own code here.
+ */
+#ifdef TABLE_CONTAINER_TODO
+ snmp_log(LOG_ERR, "${i}_get not implemented!\n" );
+ return NULL;
+#endif
+
+ /*
+ * EXAMPLE:
+ *
+ * if(len > sizeof(tmp.xxName))
+ * return NULL;
+ *
+ * strncpy( tmp.xxName, name, sizeof(tmp.xxName) );
+ * tmp.xxName_len = len;
+ *
+ * return CONTAINER_FIND(cb.container->next, &tmp);
+ */
+}
+#endif
+
+
+/************************************************************
+ * Initializes the $i module
+ */
+void
+init_$i(void)
+{
+ initialize_table_$i();
+
+ /*
+ * TODO: perform any startup stuff here, such as
+ * populating the table with initial data.
+ *
+ * ${i}_context * new_row = create_row(index);
+ * CONTAINER_INSERT(cb.container,new_row);
+ */
+}
+
+@if $i.settable@
+/************************************************************
+ * the *_row_copy routine
+ */
+static int ${i}_row_copy(${i}_context * dst,
+ ${i}_context * src)
+{
+ if(!dst||!src)
+ return 1;
+
+ /*
+ * copy index, if provided
+ */
+ if(dst->index.oids)
+ free(dst->index.oids);
+ if(snmp_clone_mem( (void*)&dst->index.oids, src->index.oids,
+ src->index.len * sizeof(oid) )) {
+ dst->index.oids = NULL;
+ return 1;
+ }
+ dst->index.len = src->index.len;
+
+
+ /*
+ * copy components into the context structure
+ */
+ @if $ext_index != 0@
+ /** TODO: add code for external index(s)! */
+ @end@
+ @foreach $c column@
+ @eval $have_type = 0@
+ @if "$c.type" eq "ASN_OCTET_STR"@
+ @eval $have_type = 1@
+ memcpy( dst->$c, src->$c, src->${c}_len );
+ dst->${c}_len = src->${c}_len;
+ @end@
+ @if "$c.type" eq "ASN_OBJECT_ID"@
+ @eval $have_type = 1@
+ memcpy( dst->$c, src->$c, src->${c}_len );
+ dst->${c}_len = src->${c}_len;
+ @end@
+ @if $have_type == 0@
+ dst->$c = src->$c;
+ @end@
+
+ @end@
+ return 0;
+}
+
+/**
+ * the *_extract_index routine
+ *
+ * This routine is called when a set request is received for an index
+ * that was not found in the table container. Here, we parse the oid
+ * in the the individual index components and copy those indexes to the
+ * context. Then we make sure the indexes for the new row are valid.
+ */
+int
+${i}_extract_index( ${i}_context * ctx, netsnmp_index * hdr )
+{
+ /*
+ * temporary local storage for extracting oid index
+ *
+ * extract index uses varbinds (netsnmp_variable_list) to parse
+ * the index OID into the individual components for each index part.
+ */
+ @if $ext_index != 0@
+ /** TODO: add storage for external index(s)! */
+ @end@
+ @eval $first_idx = ""@
+ @foreach $idx index@
+ @if "$first_idx" eq ""@
+ @eval $first_idx = $idx@
+ @end@
+ netsnmp_variable_list var_$idx;
+ @end@
+ int err;
+
+ /*
+ * copy index, if provided
+ */
+ if(hdr) {
+ netsnmp_assert(ctx->index.oids == NULL);
+ if((hdr->len > MAX_OID_LEN) ||
+ snmp_clone_mem( (void*)&ctx->index.oids, hdr->oids,
+ hdr->len * sizeof(oid) )) {
+ return -1;
+ }
+ ctx->index.len = hdr->len;
+ }
+
+ /*
+ * initialize variable that will hold each component of the index.
+ * If there are multiple indexes for the table, the variable_lists
+ * need to be linked together, in order.
+ */
+ @if $ext_index != 0@
+ /** TODO: add code for external index(s)! */
+ @end@
+ @foreach $idx index@
+ memset( &var_$idx, 0x00, sizeof(var_$idx) );
+ var_${idx}.type = $idx.type; /* type hint for parse_oid_indexes */
+ /** TODO: link this index to the next, or NULL for the last one */
+#ifdef TABLE_CONTAINER_TODO
+ snmp_log(LOG_ERR, "${i}_extract_index index list not implemented!\n" );
+ return 0;
+#else
+ var_${idx}.next_variable = &var_XX;
+#endif
+
+ @end@
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( hdr->oids, hdr->len, &var_$first_idx );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy index components into the context structure
+ */
+ @foreach $idx index@
+ @eval $found = "external"@
+ @foreach $c column@
+ @if "$idx" eq "$c"@
+ @eval $found = "internal"@
+ @end@
+ @end@
+ @if "$found" eq "external"@
+ /** skipping external index $idx */
+ @end@
+ @if "$found" eq "internal"@
+ @eval $have_type = 0@
+ @if "$idx.type" eq "ASN_OCTET_STR"@
+ @eval $have_type = 1@
+ if(var_${idx}.val_len > sizeof(ctx->$idx))
+ err = -1;
+ else
+ memcpy( ctx->$idx, var_${idx}.val.string, var_${idx}.val_len );
+ ctx->${idx}_len = var_${idx}.val_len;
+ @end@
+ @if "$idx.type" eq "ASN_OBJECT_ID"@
+ @eval $have_type = 1@
+ memcpy( ctx->$idx, var_${idx}.val.string, var_${idx}.val_len );
+ ctx->${idx}_len = var_${idx}.val_len;
+ @end@
+ @if $have_type == 0@
+ ctx->$idx = *var_${idx}.val.integer;
+ @end@
+ @end@
+
+ @end@
+
+ @foreach $c index@
+ /*
+ * TODO: check index for valid values. For EXAMPLE:
+ *
+ @eval $have_check = 0@
+ @if "$c.type" eq "ASN_IPADDRESS"@
+ @eval $have_check = 1@
+ * if ( XXX_check_ip( *var_${c}.val.integer ) ) {
+ @end@
+ @if "$c.type" eq "ASN_OBJECT_ID"@
+ @eval $have_check = 1@
+ * if ( XXX_check_oid( var_${c}.val.objid, var_${c}.val_len /
+ sizeof(oid) ) ) {
+ @end@
+ @if "$c.type" eq "ASN_OCTET_STR"@
+ @eval $have_check = 1@
+ * if ( XXX_check_value( var_${c}.val.string, XXX ) ) {
+ @end@
+ @if $have_check != 1@
+ * if ( *var_${c}.val.integer != XXX ) {
+ @end@
+ * err = -1;
+ * }
+ */
+ @end@
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_$first_idx );
+
+ return err;
+}
+
+@if "$rs_name" ne ""@
+/************************************************************
+ * the *_can_activate routine is called
+ * when a row is changed to determine if all the values
+ * set are consistent with the row's rules for a row status
+ * of ACTIVE.
+ *
+ * return 1 if the row could be ACTIVE
+ * return 0 if the row is not ready for the ACTIVE state
+ */
+int ${i}_can_activate(${i}_context *undo_ctx,
+ ${i}_context *row_ctx,
+ netsnmp_request_group * rg)
+{
+ /*
+ * TODO: check for activation requirements here
+ */
+
+
+ /*
+ * be optimistic.
+ */
+ return 1;
+}
+
+/************************************************************
+ * the *_can_deactivate routine is called when a row that is
+ * currently ACTIVE is set to a state other than ACTIVE. If
+ * there are conditions in which a row should not be allowed
+ * to transition out of the ACTIVE state (such as the row being
+ * referred to by another row or table), check for them here.
+ *
+ * return 1 if the row can be set to a non-ACTIVE state
+ * return 0 if the row must remain in the ACTIVE state
+ */
+int ${i}_can_deactivate(${i}_context *undo_ctx,
+ ${i}_context *row_ctx,
+ netsnmp_request_group * rg)
+{
+ /*
+ * TODO: check for deactivation requirements here
+ */
+ return 1;
+}
+
+@end@
+/************************************************************
+ * the *_can_delete routine is called to determine if a row
+ * can be deleted.
+ *
+ * return 1 if the row can be deleted
+ * return 0 if the row cannot be deleted
+ */
+int ${i}_can_delete(${i}_context *undo_ctx,
+ ${i}_context *row_ctx,
+ netsnmp_request_group * rg)
+{
+@if "$rs_name" ne ""@
+ /*
+ * probably shouldn't delete a row that we can't
+ * deactivate.
+ */
+ if(${i}_can_deactivate(undo_ctx,row_ctx,rg) != 1)
+ return 0;
+@end@
+
+ /*
+ * TODO: check for other deletion requirements here
+ */
+ return 1;
+}
+
+@if $i.creatable@
+/************************************************************
+ * the *_create_row routine is called by the table handler
+ * to create a new row for a given index. If you need more
+ * information (such as column values) to make a decision
+ * on creating rows, you must create an initial row here
+ * (to hold the column values), and you can examine the
+ * situation in more detail in the *_set_reserve1 or later
+ * states of set processing. Simple check for a NULL undo_ctx
+ * in those states and do detailed creation checking there.
+ *
+ * returns a newly allocated ${i}_context
+ * structure if the specified indexes are not illegal
+ * returns NULL for errors or illegal index values.
+ */
+${i}_context *
+${i}_create_row( netsnmp_index* hdr)
+{
+ ${i}_context * ctx =
+ SNMP_MALLOC_TYPEDEF(${i}_context);
+ if(!ctx)
+ return NULL;
+
+ /*
+ * TODO: check indexes, if necessary.
+ */
+ if(${i}_extract_index( ctx, hdr )) {
+ if (NULL != ctx->index.oids)
+ free(ctx->index.oids);
+ free(ctx);
+ return NULL;
+ }
+
+ /* netsnmp_mutex_init(ctx->lock);
+ netsnmp_mutex_lock(ctx->lock); */
+
+ /*
+ * TODO: initialize any default values here. This is also
+ * first place you really should allocate any memory for
+ * yourself to use. If you allocated memory earlier,
+ * make sure you free it for earlier error cases!
+ */
+ /**
+ @foreach $c column@
+ @if $c.settable@
+ ctx->$c = 0;
+ @end@
+ @end@
+ */
+
+ return ctx;
+}
+@end@
+
+/************************************************************
+ * the *_duplicate row routine
+ */
+${i}_context *
+${i}_duplicate_row( ${i}_context * row_ctx)
+{
+ ${i}_context * dup;
+
+ if(!row_ctx)
+ return NULL;
+
+ dup = SNMP_MALLOC_TYPEDEF(${i}_context);
+ if(!dup)
+ return NULL;
+
+ if(${i}_row_copy(dup,row_ctx)) {
+ free(dup);
+ dup = NULL;
+ }
+
+ return dup;
+}
+
+/************************************************************
+ * the *_delete_row method is called to delete a row.
+ */
+netsnmp_index * ${i}_delete_row( ${i}_context * ctx )
+{
+ /* netsnmp_mutex_destroy(ctx->lock); */
+
+ if(ctx->index.oids)
+ free(ctx->index.oids);
+
+ /*
+ * TODO: release any memory you allocated here...
+ */
+
+ /*
+ * release header
+ */
+ free( ctx );
+
+ return NULL;
+}
+
+
+/************************************************************
+ * RESERVE is used to check the syntax of all the variables
+ * provided, that the values being set are sensible and consistent,
+ * and to allocate any resources required for performing the SET.
+ * After this stage, the expectation is that the set ought to
+ * succeed, though this is not guaranteed. (In fact, with the UCD
+ * agent, this is done in two passes - RESERVE1, and
+ * RESERVE2, to allow for dependancies between variables).
+ *
+ * BEFORE calling this routine, the agent will call duplicate_row
+ * to create a copy of the row (unless this is a new row; i.e.
+ * row_created == 1).
+ *
+ * next state -> SET_RESERVE2 || SET_FREE
+ */
+void ${i}_set_reserve1( netsnmp_request_group *rg )
+{
+ ${i}_context *row_ctx =
+ (${i}_context *)rg->existing_row;
+ ${i}_context *undo_ctx =
+ (${i}_context *)rg->undo_info;
+ netsnmp_variable_list *var;
+ netsnmp_request_group_item *current;
+ int rc;
+
+ @if "$st_name" ne ""@
+ /*
+ * Block all attempts to modify a readOnly row
+ */
+ if( row_ctx && (row_ctx->$st_name == SNMP_STORAGE_READONLY) ) {
+ netsnmp_set_mode_request_error(MODE_SET_BEGIN, rg->list->ri,
+ SNMP_ERR_NOTWRITABLE);
+ return;
+ }
+ @end@
+
+ /*
+ * TODO: loop through columns, check syntax and lengths. For
+ * columns which have no dependencies, you could also move
+ * the value/range checking here to attempt to catch error
+ * cases as early as possible.
+ */
+ for( current = rg->list; current; current = current->next ) {
+
+ var = current->ri->requestvb;
+ rc = SNMP_ERR_NOERROR;
+
+ switch(current->tri->colnum) {
+
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ /** $c.syntax = $c.type */
+ @if $c.needlength@
+ /* or possibly 'netsnmp_check_vb_type_and_size' */
+ rc = netsnmp_check_vb_type_and_max_size(var, $c.type,
+ sizeof(row_ctx->$c));
+ @else@
+ /* or possibly 'netsnmp_check_vb_int_range' */
+ rc = netsnmp_check_vb_int( var );
+ @end@
+ break;
+
+ @end@
+ @end@
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column in "
+ "${i}_set_reserve1\n");
+ }
+
+ if (rc)
+ netsnmp_set_mode_request_error(MODE_SET_BEGIN, current->ri, rc );
+ rg->status = SNMP_MAX( rg->status, current->ri->status );
+ }
+
+ /*
+ * done with all the columns. Could check row related
+ * requirements here.
+ */
+}
+
+void ${i}_set_reserve2( netsnmp_request_group *rg )
+{
+ ${i}_context *row_ctx = (${i}_context *)rg->existing_row;
+ ${i}_context *undo_ctx = (${i}_context *)rg->undo_info;
+ netsnmp_request_group_item *current;
+ netsnmp_variable_list *var;
+ int rc;
+
+ rg->rg_void = rg->list->ri;
+
+ /*
+ * TODO: loop through columns, check for valid
+ * values and any range constraints.
+ */
+ for( current = rg->list; current; current = current->next ) {
+
+ var = current->ri->requestvb;
+ rc = SNMP_ERR_NOERROR;
+
+ switch(current->tri->colnum) {
+
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ /** $c.syntax = $c.type */
+ @eval $have_check = 0@
+ @if "$c" eq "$st_name"@
+ @eval $have_check = 1@
+ rc = netsnmp_check_vb_storagetype(current->ri->requestvb,
+ undo_ctx ?
+ undo_ctx->$c:0);
+ @end@
+ @if "$c" eq "$rs_name"@
+ @eval $have_check = 1@
+ rc = netsnmp_check_vb_rowstatus(current->ri->requestvb,
+ undo_ctx ?
+ undo_ctx->$c:0);
+ rg->rg_void = current->ri;
+ @end@
+ @if "$c.syntax" eq "TruthValue"@
+ @eval $have_check = 1@
+ rc = netsnmp_check_vb_truthvalue(current->ri->requestvb);
+ @end@
+ @if $have_check == 0@
+ /*
+ * TODO: routine to check valid values
+ *
+ * EXAMPLE:
+ *
+ @if "$c.type" eq "ASN_IPADDRESS"@
+ @eval $have_check = 1@
+ * if ( XXX_check_ip( *var->val.integer ) ) {
+ @end@
+ @if "$c.type" eq "ASN_OBJECT_ID"@
+ @eval $have_check = 1@
+ * if ( XXX_check_oid( var ) ) {
+ @end@
+ @if "$c.type" eq "ASN_OCTET_STR"@
+ @eval $have_check = 1@
+ * if ( XXX_check_value( var->val.string, XXX ) ) {
+ @end@
+ @if $have_check != 1@
+ * if ( *var->val.integer != XXX ) {
+ @end@
+ * rc = SNMP_ERR_INCONSISTENTVALUE;
+ * rc = SNMP_ERR_BADVALUE;
+ * }
+ */
+ @end@
+ break;
+
+ @end@
+ @end@
+ default: /** We shouldn't get here */
+ netsnmp_assert(0); /** why wasn't this caught in reserve1? */
+ }
+
+ if (rc)
+ netsnmp_set_mode_request_error(MODE_SET_BEGIN, current->ri, rc);
+ }
+
+ /*
+ * done with all the columns. Could check row related
+ * requirements here.
+ */
+}
+
+/************************************************************
+ * Assuming that the RESERVE phases were successful, the next
+ * stage is indicated by the action value ACTION. This is used
+ * to actually implement the set operation. However, this must
+ * either be done into temporary (persistent) storage, or the
+ * previous value stored similarly, in case any of the subsequent
+ * ACTION calls fail.
+ *
+ * In your case, changes should be made to row_ctx. A copy of
+ * the original row is in undo_ctx.
+ */
+void ${i}_set_action( netsnmp_request_group *rg )
+{
+ netsnmp_variable_list *var;
+ ${i}_context *row_ctx = (${i}_context *)rg->existing_row;
+ ${i}_context *undo_ctx = (${i}_context *)rg->undo_info;
+ netsnmp_request_group_item *current;
+
+ @if "$rs_name" ne ""@
+ int row_err = 0;
+ @end@
+
+ /*
+ * TODO: loop through columns, copy varbind values
+ * to context structure for the row.
+ */
+ for( current = rg->list; current; current = current->next ) {
+
+ var = current->ri->requestvb;
+
+ switch(current->tri->colnum) {
+
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ /** $c.syntax = $c.type */
+ @eval $have_type = 0@
+ @if "$c.type" eq "ASN_OCTET_STR"@
+ @eval $have_type = 1@
+ memcpy(row_ctx->$c,var->val.string,var->val_len);
+ row_ctx->${c}_len = var->val_len;
+ @end@
+ @if "$c.type" eq "ASN_OBJECT_ID"@
+ @eval $have_type = 1@
+ memcpy(row_ctx->$c,var->val.objid,var->val_len);
+ row_ctx->${c}_len = var->val_len;
+ @end@
+ @if $have_type == 0@
+ row_ctx->$c = *var->val.integer;
+ @end@
+ break;
+
+ @end@
+ @end@
+ default: /** We shouldn't get here */
+ netsnmp_assert(0); /** why wasn't this caught in reserve1? */
+ }
+ }
+
+ /*
+ * done with all the columns. Could check row related
+ * requirements here.
+ */
+ @if "$rs_name" ne ""@
+#ifndef ${i}_CAN_MODIFY_ACTIVE_ROW
+ if( undo_ctx && RS_IS_ACTIVE(undo_ctx->$rs_name) &&
+ row_ctx && RS_IS_ACTIVE(row_ctx->$rs_name) ) {
+ row_err = 1;
+ }
+#endif
+
+ /*
+ * check activation/deactivation
+ */
+ row_err = netsnmp_table_array_check_row_status(&cb, rg,
+ row_ctx ? &row_ctx->$rs_name : NULL,
+ undo_ctx ? &undo_ctx->$rs_name : NULL);
+ if(row_err) {
+ netsnmp_set_mode_request_error(MODE_SET_BEGIN,
+ (netsnmp_request_info*)rg->rg_void,
+ row_err);
+ return;
+ }
+
+ @end@
+ /*
+ * TODO: if you have dependencies on other tables, this would be
+ * a good place to check those, too.
+ */
+}
+
+/************************************************************
+ * Only once the ACTION phase has completed successfully, can
+ * the final COMMIT phase be run. This is used to complete any
+ * writes that were done into temporary storage, and then release
+ * any allocated resources. Note that all the code in this phase
+ * should be "safe" code that cannot possibly fail (cue
+ * hysterical laughter). The whole intent of the ACTION/COMMIT
+ * division is that all of the fallible code should be done in
+ * the ACTION phase, so that it can be backed out if necessary.
+ *
+ * BEFORE calling this routine, the agent will update the
+ * container (inserting a row if row_created == 1, or removing
+ * the row if row_deleted == 1).
+ *
+ * AFTER calling this routine, the agent will delete the
+ * undo_info.
+ */
+void ${i}_set_commit( netsnmp_request_group *rg )
+{
+ netsnmp_variable_list *var;
+ ${i}_context *row_ctx = (${i}_context *)rg->existing_row;
+ ${i}_context *undo_ctx = (${i}_context *)rg->undo_info;
+ netsnmp_request_group_item *current;
+
+ /*
+ * loop through columns
+ */
+ for( current = rg->list; current; current = current->next ) {
+
+ var = current->ri->requestvb;
+
+ switch(current->tri->colnum) {
+
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ /** $c.syntax = $c.type */
+ break;
+
+ @end@
+ @end@
+ default: /** We shouldn't get here */
+ netsnmp_assert(0); /** why wasn't this caught in reserve1? */
+ }
+ }
+
+ /*
+ * done with all the columns. Could check row related
+ * requirements here.
+ */
+}
+
+/************************************************************
+ * If either of the RESERVE calls fail, the write routines
+ * are called again with the FREE action, to release any resources
+ * that have been allocated. The agent will then return a failure
+ * response to the requesting application.
+ *
+ * AFTER calling this routine, the agent will delete undo_info.
+ */
+void ${i}_set_free( netsnmp_request_group *rg )
+{
+ netsnmp_variable_list *var;
+ ${i}_context *row_ctx = (${i}_context *)rg->existing_row;
+ ${i}_context *undo_ctx = (${i}_context *)rg->undo_info;
+ netsnmp_request_group_item *current;
+
+ /*
+ * loop through columns
+ */
+ for( current = rg->list; current; current = current->next ) {
+
+ var = current->ri->requestvb;
+
+ switch(current->tri->colnum) {
+
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ /** $c.syntax = $c.type */
+ break;
+
+ @end@
+ @end@
+ default: /** We shouldn't get here */
+ /** should have been logged in reserve1 */
+ }
+ }
+
+ /*
+ * done with all the columns. Could check row related
+ * requirements here.
+ */
+}
+
+/************************************************************
+ * If the ACTION phase does fail (for example due to an apparently
+ * valid, but unacceptable value, or an unforeseen problem), then
+ * the list of write routines are called again, with the UNDO
+ * action. This requires the routine to reset the value that was
+ * changed to its previous value (assuming it was actually changed),
+ * and then to release any resources that had been allocated. As
+ * with the FREE phase, the agent will then return an indication
+ * of the error to the requesting application.
+ *
+ * BEFORE calling this routine, the agent will update the container
+ * (remove any newly inserted row, re-insert any removed row).
+ *
+ * AFTER calling this routing, the agent will call row_copy
+ * to restore the data in existing_row from the date in undo_info.
+ * Then undo_info will be deleted (or existing row, if row_created
+ * == 1).
+ */
+void ${i}_set_undo( netsnmp_request_group *rg )
+{
+ netsnmp_variable_list *var;
+ ${i}_context *row_ctx = (${i}_context *)rg->existing_row;
+ ${i}_context *undo_ctx = (${i}_context *)rg->undo_info;
+ netsnmp_request_group_item *current;
+
+ /*
+ * loop through columns
+ */
+ for( current = rg->list; current; current = current->next ) {
+
+ var = current->ri->requestvb;
+
+ switch(current->tri->colnum) {
+
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ /** $c.syntax = $c.type */
+ break;
+
+ @end@
+ @end@
+ default: /** We shouldn't get here */
+ netsnmp_assert(0); /** why wasn't this caught in reserve1? */
+ }
+ }
+
+ /*
+ * done with all the columns. Could check row related
+ * requirements here.
+ */
+}
+
+@end@
+
+
+/************************************************************
+ *
+ * Initialize the $i table by defining its contents and how it's structured
+ */
+void
+initialize_table_$i(void)
+{
+ netsnmp_table_registration_info *table_info;
+
+ if(my_handler) {
+ snmp_log(LOG_ERR, "initialize_table_${i}_handler called again\n");
+ return;
+ }
+
+ memset(&cb, 0x00, sizeof(cb));
+
+ /** create the table structure itself */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+
+ my_handler = netsnmp_create_handler_registration("$i",
+ netsnmp_table_array_helper_handler,
+ ${i}_oid,
+ ${i}_oid_len,
+@if $i.settable@
+ HANDLER_CAN_RWRITE
+@else@
+ HANDLER_CAN_RONLY
+@end@
+ );
+
+ if (!my_handler || !table_info) {
+ snmp_log(LOG_ERR, "malloc failed in "
+ "initialize_table_${i}_handler\n");
+ return; /** mallocs failed */
+ }
+
+ /***************************************************
+ * Setting up the table's definition
+ */
+ /*
+ * TODO: add any external indexes here.
+ */
+ @if $ext_index != 0@
+ /** TODO: add code for external index(s)! */
+ @end@
+
+ /*
+ * internal indexes
+ */
+ @foreach $idx index@
+ /** index: $idx */
+ netsnmp_table_helper_add_index(table_info, $idx.type);
+ @end@
+
+ table_info->min_column = ${i}_COL_MIN;
+ table_info->max_column = ${i}_COL_MAX;
+
+ /***************************************************
+ * registering the table with the master agent
+ */
+ cb.get_value = ${i}_get_value;
+ cb.container = netsnmp_container_find("${i}_primary:"
+ "${i}:"
+ "table_container");
+#ifdef ${i}_CUSTOM_SORT
+ netsnmp_container_add_index(cb.container,
+ netsnmp_container_find("${i}_custom:"
+ "${i}:"
+ "table_container"));
+ cb.container->next->compare = ${i}_cmp;
+#endif
+@if $i.settable@
+ cb.can_set = 1;
+@if $i.creatable@
+ cb.create_row = (UserRowMethod*)${i}_create_row;
+@end@
+ cb.duplicate_row = (UserRowMethod*)${i}_duplicate_row;
+ cb.delete_row = (UserRowMethod*)${i}_delete_row;
+ cb.row_copy = (Netsnmp_User_Row_Operation *)${i}_row_copy;
+
+@if "$rs_name" ne ""@
+ cb.can_activate = (Netsnmp_User_Row_Action *)${i}_can_activate;
+ cb.can_deactivate = (Netsnmp_User_Row_Action *)${i}_can_deactivate;
+@end@
+ cb.can_delete = (Netsnmp_User_Row_Action *)${i}_can_delete;
+
+ cb.set_reserve1 = ${i}_set_reserve1;
+ cb.set_reserve2 = ${i}_set_reserve2;
+ cb.set_action = ${i}_set_action;
+ cb.set_commit = ${i}_set_commit;
+ cb.set_free = ${i}_set_free;
+ cb.set_undo = ${i}_set_undo;
+@end@
+ DEBUGMSGTL(("initialize_table_$i",
+ "Registering table $i "
+ "as a table array\n"));
+ netsnmp_table_container_register(my_handler, table_info, &cb,
+ cb.container, 1);
+}
+
+/************************************************************
+ * ${i}_get_value
+ *
+ * This routine is called for get requests to copy the data
+ * from the context to the varbind for the request. If the
+ * context has been properly maintained, you don't need to
+ * change in code in this fuction.
+ */
+int ${i}_get_value(
+ netsnmp_request_info *request,
+ netsnmp_index *item,
+ netsnmp_table_request_info *table_info )
+{
+ netsnmp_variable_list *var = request->requestvb;
+ ${i}_context *context = (${i}_context *)item;
+
+ switch(table_info->colnum) {
+
+ @foreach $c column@
+ @if $c.readable@
+ @eval $have_type = 0@
+ case COLUMN_$c.uc:
+ /** $c.syntax = $c.type */
+ @if "$c.type" eq "ASN_OBJECT_ID"@
+ @eval $have_type = 1@
+ snmp_set_var_typed_value(var, $c.type,
+ (char*)&context->$c,
+ context->${c}_len );
+ @end@
+ @if "$c.type" eq "ASN_OCTET_STR"@
+ @eval $have_type = 1@
+ snmp_set_var_typed_value(var, $c.type,
+ (char*)&context->$c,
+ context->${c}_len );
+ @end@
+ @if $have_type == 0@
+ snmp_set_var_typed_value(var, $c.type,
+ (char*)&context->$c,
+ sizeof(context->$c) );
+ @end@
+ break;
+
+ @end@
+ @end@
+ default: /** We shouldn't get here */
+ snmp_log(LOG_ERR, "unknown column in "
+ "${i}_get_value\n");
+ return SNMP_ERR_GENERR;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/************************************************************
+ * ${i}_get_by_idx
+ */
+const ${i}_context *
+${i}_get_by_idx(netsnmp_index * hdr)
+{
+ return (const ${i}_context *)
+ CONTAINER_FIND(cb.container, hdr );
+}
+
+
+@end@
diff --git a/local/mib2c.check_values.conf b/local/mib2c.check_values.conf
new file mode 100644
index 0000000..259ac1f
--- /dev/null
+++ b/local/mib2c.check_values.conf
@@ -0,0 +1,154 @@
+@run mib2c.check_values_local.conf@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}_checkfns.h@
+/*
+ * 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 ${name}_checkfns_local.[ch] files insead.
+ * (so that you can regenerate this one as mib2c improvements are made)
+ ***********************************************************************/
+#ifndef $name.uc_CHECKFNS_H
+#define $name.uc_CHECKFNS_H
+
+/** make sure we load the functions that you can modify */
+config_require(${name}_checkfns_local)
+
+@foreach $t table@
+/* these functions are designed to check incoming values for
+columns in the $t table for legality with respect to
+datatype and value.
+ */
+
+ @foreach $i column@
+ @if $i.access =~ /(Write|Create)/@
+ int check_${i}(int type, $i.decl *val, size_t val_len, $i.decl *old_val, size_t old_val_len);
+ @end@
+ @end@
+@end@
+
+#endif /* $name.uc_CHECKFNS_H */
+
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}_checkfns.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+/********************************************************************
+ * NOTE NOTE NOTE
+ * This file is auto-generated and SHOULD NOT BE EDITED by hand.
+ * Modify the ${name}_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 "${name}_checkfns.h"
+#include "${name}_checkfns_local.h"
+#include "${name}_enums.h"
+@run mib2c.column_enums.conf@
+
+@foreach $t table@
+ @foreach $i column@
+ @if $i.access =~ /(Write|Create)/@
+/** Decides if an incoming value for the $i 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_${i}(int type, $i.decl *val, size_t val_len,
+ $i.decl *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 != $i.type)
+ return SNMP_ERR_WRONGTYPE;
+
+ @if $i.type =~ /int/i@
+ @eval $x = 0@
+ @foreach $l, $v enum@
+ @if $x == 0@
+ /** Check the enums. Legal values will continue, others return error. */
+ switch (*val) {
+ @eval $x = 1@
+ @end@
+ case $i.uc_$l.uc:
+ @end@
+ @if $x == 1@
+ break;
+
+ /** not a legal enum value. return an error */
+ default:
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ @end@
+ ret = SNMP_ERR_NOERROR;
+ @eval $x = 0@
+ @foreach $min $max range $i@
+ @if $x == 0@
+ /** Check the ranges of the passed value for legality */
+ @eval $x = 1@
+ if (
+ @else@
+ &&
+ @end@
+ !(*val >= $min && *val <= $max)
+ @end@
+ @if $x != 0@
+ ) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ @end@
+ @end@
+ @if $i.type =~ /str/i@
+ @eval $x = 0@
+ @foreach $min $max range $i@
+ @if $x == 0@
+ /** Check the ranges of the passed value for legality */
+ @eval $x = 1@
+ if (
+ @else@
+ &&
+ @end@
+ !(val_len >= $min && val_len <= $max)
+ @end@
+ @if $x == 1@
+ ) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ @end@
+ @end@
+
+ @if "$i.syntax" eq "RowStatus"@
+ if (ret = check_rowstatus_transition((old_val) ? *old_val : RS_NONEXISTENT, *val))
+ return ret;
+ @end@
+ @if "$i.syntax" eq "StorageType"@
+ if (ret = check_storage_transition((old_val) ? *old_val : SNMP_STORAGE_NONE, *val))
+ return ret;
+ @end@
+
+ /** looks ok, call the local version of the same function. */
+ return check_${i}_local(type, val, val_len, old_val, old_val_len);
+ }
+ @end@
+ @end@
+@end@
diff --git a/local/mib2c.check_values_local.conf b/local/mib2c.check_values_local.conf
new file mode 100644
index 0000000..13c1e60
--- /dev/null
+++ b/local/mib2c.check_values_local.conf
@@ -0,0 +1,72 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}_checkfns_local.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : $Id$
+ *
+ */
+#ifndef $name.uc_CHECKFNS_H
+#define $name.uc_CHECKFNS_H
+
+@foreach $t table@
+/* these functions are designed to check incoming values for
+columns in the $t 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.
+ */
+
+ @foreach $i column@
+ @if $i.access =~ /(Write|Create)/@
+ int check_${i}_local(int type, $i.decl *val, size_t val_len, $i.decl *old_val, size_t old_val_len);
+ @end@
+ @end@
+@end@
+
+#endif /* $name.uc_CHECKFNS_H */
+
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}_checkfns_local.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+/* standard headers */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "${name}_checkfns.h"
+#include "${name}_enums.h"
+@run mib2c.column_enums.conf@
+
+@foreach $t table@
+ @foreach $i column@
+ @if $i.access =~ /(Write|Create)/@
+/** Decides if an incoming value for the $i 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).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+ int
+ check_${i}_local(int type, $i.decl *val, size_t val_len, $i.decl *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;
+ }
+ @end@
+ @end@
+@end@
diff --git a/local/mib2c.column_defines.conf b/local/mib2c.column_defines.conf
new file mode 100644
index 0000000..5b8328f
--- /dev/null
+++ b/local/mib2c.column_defines.conf
@@ -0,0 +1,15 @@
+@open ${name}_columns.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_COLUMNS_H
+#define $name.uc_COLUMNS_H
+@foreach $i table@
+
+/* column number definitions for table $i */
+ @foreach $c column@
+ #define COLUMN_$c.uc $c.subid
+ @end@
+@end@
+#endif /* $name.uc_COLUMNS_H */
diff --git a/local/mib2c.column_enums.conf b/local/mib2c.column_enums.conf
new file mode 100644
index 0000000..4dba4fa
--- /dev/null
+++ b/local/mib2c.column_enums.conf
@@ -0,0 +1,34 @@
+@open ${name}_enums.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_ENUMS_H
+#define $name.uc_ENUMS_H
+@foreach $i table@
+ @foreach $c column@
+ @eval $x = 0@
+ @foreach $e $v enum@
+ @if $x == 0@
+
+/* enums for column $c */
+ @eval $x = 1@
+ @end@
+ #define $c.uc_$e.uc $v
+ @end@
+ @end@
+@end@
+
+@foreach $s scalar@
+ @eval $x = 0@
+ @foreach $e $v enum@
+ @if $x == 0@
+
+/* enums for scalar $s */
+ @eval $x = 1@
+ @end@
+#define $s.uc_$e.uc $v
+ @end@
+@end@
+
+#endif /* $name.uc_ENUMS_H */
diff --git a/local/mib2c.column_storage.conf b/local/mib2c.column_storage.conf
new file mode 100644
index 0000000..9f3ba1f
--- /dev/null
+++ b/local/mib2c.column_storage.conf
@@ -0,0 +1,23 @@
+############################################################# -*- c -*-
+## top level mfd conf file
+## $Id$
+########################################################################
+@ open ${name}_storage.h@
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+##
+##
+@foreach $table table@
+@ include m2c_setup_table.m2i@
+@ eval $m2c_data_context = "generated"@
+@ include generic-table-indexes.m2i@
+@ include generic-data-context.m2i@
+@end@ # table
+##
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c.conf b/local/mib2c.conf
new file mode 100644
index 0000000..c71968c
--- /dev/null
+++ b/local/mib2c.conf
@@ -0,0 +1,308 @@
+@open -@
+mib2c has multiple configuration files depending on the type of
+code you need to write. You must pick one depending on your need.
+
+You requested mib2c to be run on the following part of the MIB tree:
+ OID: $name
+ numeric translation: $name.objectID
+@eval $numS = count_scalars@
+ number of scalars within: $numS
+@eval $numT = count_tables@
+ number of tables within: $numT
+@eval $numN = count_notifications@
+ number of notifications within: $numN
+
+First, do you want to generate code that is compatible with the
+ucd-snmp 4.X line of code, or code for the newer Net-SNMP 5.X code
+base (which provides a much greater choice of APIs to pick from):
+
+ 1) ucd-snmp style code
+ 2) Net-SNMP style code
+
+@prompt $ans Select your choice : @
+@if $ans == 1@
+**********************************************************************
+ GENERATING CODE FOR THE 4.X LINE OF CODE (THE OLDER API)
+**********************************************************************
+
+ using the mib2c.old-api.conf configuration file to generate your code.
+ @run mib2c.old-api.conf@
+
+@elsif $ans != 2@
+Invalid answer.
+@else@
+ @if $numS > 0 && $numT > 0@
+**********************************************************************
+ MIXED MIB TEMPLATE
+**********************************************************************
+The portion of the MIB tree that you have selected contains both
+scalar objects and MIB tables. The automatically generated Net-SNMP
+style code cannot handle both of these simultaneously (though you
+could generate the two files separately, and then merge the two).
+
+Which code do you want to generate:
+
+ 1) Scalar objects
+ 2) MIB tables
+
+ @prompt $ans Select your choice : @
+ @if $ans == 1 @
+ @eval $numT = 0@
+ @elsif $ans == 2@
+ @eval $numS = 0@
+ @else@
+Invalid answer
+ @eval $numS = 0@
+ @eval $numT = 0@
+ @end@
+ @end@
+@if $numS > 0@
+
+**********************************************************************
+ GENERATING CODE FOR SCALAR OBJECTS:
+**********************************************************************
+
+ It looks like you have some scalars in the mib you requested, so I
+ will now generate code for them if you wish. You have two choices
+ for scalar API styles currently. Pick between them, or choose not
+ to generate any code for the scalars:
+
+ 1) If you're writing code for some generic scalars
+ (by hand use: "mib2c -c mib2c.scalar.conf $name")
+
+ 2) If you want to magically "tie" integer variables to integer
+ scalars
+ (by hand use: "mib2c -c mib2c.int_watch.conf $name")
+
+ 3) Don't generate any code for the scalars
+
+ @prompt $ans Select your choice: @
+ @if $ans == 1@
+ using the mib2c.scalar.conf configuration file to generate your code.
+ @run mib2c.scalar.conf@
+ @elsif $ans == 2@
+ using the mib2c.int_watch.conf configuration file to generate your code.
+ @run mib2c.int_watch.conf@
+ @elsif $ans != 3@
+ WARNING: Unknown response. Skipping code generation for scalars.
+ @end@
+@end@ # scalars
+
+@if $numT > 0@
+**********************************************************************
+ GENERATING CODE FOR TABLES:
+**********************************************************************
+
+ The Net-SNMP agent API is extremely extensive and, in fact, lets
+ each programmer write agent code according to the style that works
+ best for them based on their experience and their preference. We're
+ going to ask you a serious of questions that will help mib2c
+ generate code that best suits *your* needs, as the programmer that
+ will be responsible for taking the code and further refining it. If
+ you don't like how the results look, you are always welcome to
+ re-run mib2c and select a different set of options.
+
+ There are essentially two tasks involved in processing requests
+ for OIDs within a MIB table - firstly identifying the relevant row
+ of the table for a given request, and then returning (or updating)
+ the appropriate column value within that row. Many MIB tables model
+ the state of some external system (the kernel, a device, processes,
+ etc), and the MIB implementation module (the code we're about to
+ produce a template for) acts as an interface between this underlying
+ system and the SNMP side. Other tables hold data internally that is
+ only available within the agent itself, or at least the master copy
+ of the data is held within the agent.
+
+ There are a number of different code templates that can be used to
+ implement MIB tables, using various approaches to these two tasks.
+
+ There are three basic approaches to identifying the relevant row:
+
+ 1) Pass the request through to the table-specific code, and
+ identify the requested row there (for both GET and GETNEXT
+ requests). This is typically the most efficient way to get
+ up-to-date information, but relies on suitable
+ (programmer-provided) code within the MIB handler.
+ Most importantly, you should be an expert to use this choice.
+
+ This will produce code based on the table_dataset handler.
+
+ 2) Have table-specific code to provide information about which
+ rows exist in the table (by iterating through them in turn),
+ but utilise standard helper code to select the appropriate
+ row for a given request. This is particularly suitable for
+ tables where the data is naturally stored in a "random" order
+ (or differently to the MIB table index), or where rows are
+ frequently added to or removed from the table.
+
+ However searching for the requested row is not very efficient,
+ and performance can be slow - particularly for large tables with
+ many rows.
+
+ 3) Hold a locally cached copy of the contents of the table (or at
+ least a cache of which rows are valid), and utilise standard
+ helper code to select the appropriate row. This is
+ significantly faster than the iterator-based approach, but
+ cached data is inevitably slightly "stale" with respect to the
+ data from the underlying system being managed. This approach,
+ since it relies on caching of data, is also results in a larger
+ memory footprint. It is less appropriate for tables where rows
+ are frequently added or removed externally to the agent (i.e.,
+ not via SNMP requests).
+
+ This approach can also be used where _all_ use of the table is
+ via SNMP, and there is no external "underlying system". In
+ this case, the local cache is the canonical version of the
+ table.
+
+ 4) Do not generate code for the tables.
+
+ @prompt $ans1 Select the option that best fits your requirements: @
+
+ @if ($ans1 == 2) || ($ans1 == 3)@
+
+ Having identified the appropriate row for a given request, there are
+ three basic styles of code for returning (or updating) the requested
+ column value from within this row:
+
+ 1) A single handler routine, which contains all the code needed to
+ handle GET and SET requests for each of the column objects.
+
+@if $ans1 == 2@
+ The code typically looks like a single function with a large 'case'
+ statement covering each of the columns.
+
+ This will produce code based on the 'iterator' hepler.
+@end@
+
+ 2) A set of individual routines, each of which is concerned
+ with a particular aspect of processing the request.
+ @if $ans1 == 2 @
+ Each column object within the table has one routine for
+ retrieving the current value, and another for setting a new one.
+
+ This will produce code based on the 'iterate_access' hepler.
+ @else@
+ There is one routine for reporting values for GET requests,
+ and one routine for each stage of processing a SET request.
+ @end@
+
+ 3) A (different) set of individual routines, each of which is
+ smaller and more tightly focused than the code generated by
+ style 2. The aim here is to reduce the amount of SNMP specific
+ knowledge required to implement a module, and hide much of the
+ SNMP terminology and processing within standard generated code
+ (which can simply be used sight unseen).
+@if $name !~ /Table$/i@
+ However this style of code can only be generated when mib2c
+ is run on an individual MIB table. To use this approach, you
+ will need to re-invoke mib2c with the name of a single MIB table.
+@end@
+
+ This will produce code based on the 'mfd' hepler ('MIB for Dummies').
+
+ 4) Do not generate code for the tables.
+
+ (In all cases, GETNEXT requests are automatically converted
+ into the equivalent GET request, so the MIB specific code
+ need only be concerned with GET and SET requests.).
+
+ @prompt $ans2 Select the code style you wish to use: @
+ @end@
+
+ @eval $template = NONE@
+ @if $ans1 == 1@
+ @eval $template = "create-dataset"@
+
+ @elsif $ans1 == 2@
+ @if $ans2 == 1@
+ @eval $template = iterate@
+ @elsif $ans2 == 2@
+ @eval $template = iterate_access@
+ @elsif $ans2 == 3@
+ @eval $template = mfd@
+ @elsif $ans2 != 4@
+ WARNING: Unknown response. Skipping code generation for tables.
+ @end@
+
+ @elsif $ans1 == 3@
+ @if $ans2 == 1@
+ There are actually two alternative templates that use this
+ style of code - differing primarily in the data structure
+ used for representing a row of the table
+
+ 1) The first is well suited for situations where there is a
+ natural existing data structure, or where the contents of
+ the table may need to be interpreted for some additional
+ purpose, other than simply implementing the table in SNMP.
+
+ This will produce code based on the 'table_data' hepler.
+
+ 2) The second is slightly more efficient, but introduces some
+ minor constraints on the form of the per-row data structure.
+
+ This will produce code based on the 'container' hepler.
+
+ @prompt $ans3 Select the row representation you wish to use: @
+
+ @if $ans3 == 1@
+ @eval $template = table_data@
+ @elsif $ans3 == 2@
+ @eval $template = container@
+ @else@
+ WARNING: Unknown response. Skipping code generation for tables.
+ @end@
+ @elsif $ans2 == 2@
+ @eval $template = "array-user"@
+ @elsif $ans2 == 3@
+ @eval $template = mfd@
+ @else@
+ WARNING: Unknown response. Skipping code generation for tables.
+ @end@
+
+ @elsif $ans1 != 4@
+ WARNING: Unknown response. Skipping code generation for tables.
+ @end@
+
+ @if $template ne NONE@
+ The same template code can be generated using
+ mib2c -c mib2c.${template}.conf $name
+ @run mib2c.${template}.conf@
+ @end@
+@end@ # tables
+
+@if $numN > 0@
+**********************************************************************
+ GENERATING CODE FOR NOTIFICATIONS:
+**********************************************************************
+
+Would you like to generate code for sending notifications from within
+the agent?
+
+ @prompt $ans "y" or "n": @
+ @if ("$ans" eq "y") or ("$ans" eq "yes")@
+ using mib2c.notify.conf to generate code for sending notifications
+ @run mib2c.notify.conf@
+ @end@
+
+# GENERATING HEADER FILE DEFINITIONS
+#
+# To generate just a header with a define for each column number in
+# your table:
+#
+# mib2c -c mib2c.column_defines.conf ${name}
+#
+# To generate just a header with a define for each enum for any
+# column containing enums:
+#
+# mib2c -c mib2c.column_enums.conf ${name}
+
+@end@ # notifications
+@end@ # new style code
+
+**********************************************************************
+* NOTE WELL: The code generated by mib2c is only a template. *YOU* *
+* must fill in the code before it'll work most of the time. In many *
+* cases, spots that MUST be edited within the files are marked with *
+* /* XXX */ or /* TODO */ comments. *
+**********************************************************************
diff --git a/local/mib2c.container.conf b/local/mib2c.container.conf
new file mode 100644
index 0000000..e76621f
--- /dev/null
+++ b/local/mib2c.container.conf
@@ -0,0 +1,864 @@
+## -*- c -*-
+## Portions of this file ar Copyright (C) Apple, Inc.
+## Use is subject to license terms specified in the COPYING file
+## distributed with the Net-SNMP package.
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/* function declarations */
+void init_$name(void);
+@foreach $i table@
+void initialize_table_$i(void);
+Netsnmp_Node_Handler ${i}_handler;
+@end@
+@foreach $i table@
+
+/* column number definitions for table $i */
+ @foreach $c column@
+ #define COLUMN_$c.uc $c.subid
+ @end@
+@end@
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#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 "${name}.h"
+
+#ifdef ${i.uc}_USE_CACHE
+static void _cache_free(netsnmp_cache * cache, void *magic);
+static int _cache_load(netsnmp_cache * cache, void *vmagic);
+#endif
+
+/** Initializes the $name module */
+void
+init_$name(void)
+{
+ /* here we initialize all the tables we're planning on supporting */
+ @foreach $i table@
+ initialize_table_$i();
+ @end@
+}
+##
+@foreach $i table@
+## Determine the first/last column names
+ @eval $first_column = "-"@
+ @eval $last_column = "-"@
+ @foreach $c column@
+ @if $c.readable@
+ @if "$first_column" eq "-"@
+ @eval $first_column = $c@
+ @end@
+ @eval $last_column = $c@
+ @end@
+ @end@
+
+/** Initialize the $i table by defining its contents and how it's structured */
+void
+initialize_table_$i(void)
+{
+ const oid ${i}_oid[] = {$i.commaoid};
+ const size_t ${i}_oid_len = OID_LENGTH(${i}_oid);
+ netsnmp_handler_registration *reg = NULL;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_table_registration_info *table_info = NULL;
+#ifdef ${i.uc}_USE_CACHE
+ netsnmp_cache *cache = NULL;
+#endif
+
+ DEBUGMSGTL(("${name}:init", "initializing table $i\n"));
+
+ reg = netsnmp_create_handler_registration(
+ "$i", ${i}_handler,
+ ${i}_oid, ${i}_oid_len,
+@if $i.settable@
+ HANDLER_CAN_RWRITE
+@else@
+ HANDLER_CAN_RONLY
+@end@
+ );
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,"error creating handler registration for $i\n");
+ goto bail;
+ }
+@if $i.settable@
+ /** should a set on a non-existent row create a new one? */
+ /** reg->modes |= HANDLER_CAN_NOT_CREATE; */
+@end@
+
+ container = netsnmp_container_find( "$i:table_container" );
+ if (NULL == container) {
+ snmp_log(LOG_ERR,"error creating container for $i\n");
+ goto bail;
+ }
+
+ table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,"error allocating table registration for $i\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info,
+ @foreach $idx index@
+ $idx.type, /* index: $idx */
+ @end@
+ 0);
+ table_info->min_column = COLUMN_$first_column.uc;
+ table_info->max_column = COLUMN_$last_column.uc;
+
+ /*************************************************
+ *
+ * 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 $i\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,"error injecting container_table handler for $i\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+#ifdef ${i.uc}_USE_CACHE
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ${i}_oid, ${i}_oid_len);
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR, "error creating cache for $i\n");
+ goto bail;
+ }
+ cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+ cache->magic = container;
+
+ handler = netsnmp_cache_handler_get(cache);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR, "error creating cache handler for $i\n");
+ goto bail;
+ }
+
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,"error injecting cache handler for $i\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it*/
+#endif
+
+ /*
+ * register the table
+ */
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,"error registering table handler for $i\n");
+ reg = NULL; /* it was freed inside netsnmp_register_table */
+ 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);
+
+#ifdef ${i.uc}_USE_CACHE
+ if (cache)
+ netsnmp_cache_free(cache);
+#endif
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (container)
+ CONTAINER_FREE(container);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+/** Typical data structure for a row entry */
+typedef struct ${i}_entry_s {
+ netsnmp_index oid_index;
+
+ /* Index values */
+ @foreach $idx index@
+ @if $idx.needlength@
+ $idx.decl $idx[NNN];
+ size_t ${idx}_len;
+ @else@
+ $idx.decl $idx;
+ @end@
+ @end@
+
+ /* Column values */
+ @foreach $c column@
+ @if $c.readable@
+ @if $c.needlength@
+ $c.decl $c[NNN];
+ size_t ${c}_len;
+ @else@
+ $c.decl $c;
+ @end@
+ @if $c.settable@
+ @if !$c.rowstatus@
+ @if $c.needlength@
+ $c.decl old_$c[NNN];
+ size_t old_${c}_len;
+ @else@
+ $c.decl old_$c;
+ @end@
+ @end@
+ @end@
+ @end@
+ @end@
+
+ int valid;
+} ${i}_entry;
+
+/** create a new row in the table */
+${i}_entry *
+${i}_createEntry(netsnmp_container *container,
+ @foreach $idx index@
+ @if $idx.needlength@
+ , $idx.decl* $idx
+ , size_t ${idx}_len
+ @else@
+ , $idx.decl $idx
+ @end@
+ @end@
+ ) {
+ ${i}_entry *entry;
+
+ entry = SNMP_MALLOC_TYPEDEF(${i}_entry);
+ if (!entry)
+ return NULL;
+
+ @foreach $idx index@
+ @if $idx.needlength@
+ memcpy(entry->$idx, $idx, ${idx}_len);
+ entry->${idx}_len = ${idx}_len;
+ @else@
+ entry->$idx = $idx;
+ @end@
+ @end@
+ entry->oid_index.len = XXX;
+ entry->oid_index.oids = YYY;
+ CONTAINER_INSERT( container, entry );
+ return entry;
+}
+
+/** remove a row from the table */
+void
+${i}_removeEntry(netsnmp_container *container,
+ ${i}_entry *entry) {
+
+ if (!entry)
+ return; /* Nothing to remove */
+ CONTAINER_REMOVE( container, entry );
+ if (entry)
+ SNMP_FREE( entry ); /* XXX - release any other internal resources */
+}
+
+/** remove a row from the table */
+void
+${i}_freeEntry(${i}_entry *entry) {
+
+ if (!entry)
+ return; /* Nothing to remove */
+ SNMP_FREE( entry ); /* XXX - release any other internal resources */
+}
+
+/** handles requests for the $i table */
+int
+${i}_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_container *container;
+ ${i}_entry *table_entry;
+@if $i.settable@
+ int ret;
+@end@
+
+ DEBUGMSGTL(("${name}:handler", "Processing request (%d)\n", reqinfo->mode));
+
+ 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 = (${i}_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 $i\n");
+ snmp_set_var_typed_value(request->requestvb, SNMP_ERR_GENERR,
+ NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.readable@
+ case COLUMN_$c.uc:
+ if ( !table_entry ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ @if $c.needlength@
+ snmp_set_var_typed_value( request->requestvb, $c.type,
+ table_entry->$c,
+ table_entry->${c}_len);
+ @else@
+ snmp_set_var_typed_integer( request->requestvb, $c.type,
+ table_entry->$c);
+ @end@
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+@if $i.settable@
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (${i}_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 $i\n");
+ snmp_set_var_typed_value(request->requestvb, SNMP_ERR_GENERR,
+ NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ @if $c.rowstatus@
+ ret = netsnmp_check_vb_rowstatus(request->requestvb,
+ (table_entry ? RS_ACTIVE : RS_NONEXISTENT ));
+ @else@
+ @if $c.needlength@
+ /* or possibly 'netsnmp_check_vb_type_and_size' */
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, $c.type, sizeof(table_entry->$c));
+ @else@
+ /* or possibly 'netsnmp_check_vb_int_range' */
+ ret = netsnmp_check_vb_int( request->requestvb );
+ @end@
+ @end@
+ if ( ret != SNMP_ERR_NOERROR ) {
+ netsnmp_set_request_error( reqinfo, request, ret );
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_NOTWRITABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (${i}_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 $i\n");
+ snmp_set_var_typed_value(request->requestvb, SNMP_ERR_GENERR,
+ NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ container = netsnmp_container_table_extract(request);
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "could not extract table container for $i\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+ table_entry = ${i}_createEntry(container
+ @foreach $idx index@
+ @if $idx.needlength@
+ , table_info->indexes->val.string
+ , table_info->indexes->val_len
+ @else@
+ , *table_info->indexes->val.integer
+ @end@
+ @end@
+ );
+ if (table_entry) {
+ netsnmp_container_table_insert_row( request, table_entry );
+ } else {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( !table_entry ) {
+ container = netsnmp_container_table_extract(request);
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "could not extract table container for $i\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+ table_entry = ${i}_createEntry(container
+ @foreach $idx index@
+ @if $idx.needlength@
+ , table_info->indexes->val.string
+ , table_info->indexes->val_len
+ @else@
+ , *table_info->indexes->val.integer
+ @end@
+ @end@
+ );
+ if (table_entry) {
+ netsnmp_container_table_insert_row( request, table_entry );
+ } else {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+@end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_FREE:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+ container = netsnmp_container_table_extract(request);
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "could not extract table container for $i\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+ table_entry = (${i}_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 $i\n");
+ snmp_set_var_typed_value(request->requestvb, SNMP_ERR_GENERR,
+ NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (table_entry && !table_entry->valid) {
+ ${i}_removeEntry(container, table_entry );
+ }
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( table_entry && !table_entry->valid ) {
+ ${i}_removeEntry(container, table_entry );
+ }
+ break;
+@end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_ACTION:
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (${i}_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 $i\n");
+ snmp_set_var_typed_value(request->requestvb, SNMP_ERR_GENERR,
+ NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ @if !$c.rowstatus@
+ case COLUMN_$c.uc:
+ @if $c.needlength@
+ memcpy( table_entry->old_$c,
+ table_entry->$c,
+ sizeof(table_entry->$c));
+ table_entry->old_${c}_len =
+ table_entry->${c}_len;
+ memset( table_entry->$c, 0,
+ sizeof(table_entry->$c));
+ memcpy( table_entry->$c,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ table_entry->${c}_len =
+ request->requestvb->val_len;
+ @else@
+ table_entry->old_$c = table_entry->$c;
+ table_entry->$c = *request->requestvb->val.integer;
+ @end@
+ break;
+ @end@
+ @end@
+ @end@
+ }
+ }
+@if $i.rowstatus@
+ /* Check the internal consistency of an active row */
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (${i}_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 $i\n");
+ snmp_set_var_typed_value(request->requestvb, SNMP_ERR_GENERR,
+ NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ case RS_CREATEANDGO:
+ if (/* XXX */) {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ @end@
+ @end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_UNDO:
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+ container = netsnmp_container_table_extract(request);
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "could not extract table container for $i\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+ table_entry = (${i}_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 $i\n");
+ snmp_set_var_typed_value(request->requestvb, SNMP_ERR_GENERR,
+ NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+@if $i.rowstatus@
+ @if $c.rowstatus@
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (table_entry && !table_entry->valid) {
+ ${i}_removeEntry(container, table_entry );
+ }
+ }
+ @else@
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ @end@
+@else@
+ @if $c.creatable@
+ if ( table_entry && !table_entry->valid ) {
+ ${i}_removeEntry(container, table_row );
+ } else {
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ }
+ @else@
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ @end@
+@end@
+ break;
+ @end@
+ @end@
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (${i}_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 $i\n");
+ snmp_set_var_typed_value(request->requestvb, SNMP_ERR_GENERR,
+ NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ table_entry->valid = 1;
+ /* Fall-through */
+ case RS_ACTIVE:
+ table_entry->$c = RS_ACTIVE;
+ break;
+
+ case RS_CREATEANDWAIT:
+ table_entry->valid = 1;
+ /* Fall-through */
+ case RS_NOTINSERVICE:
+ table_entry->$c = RS_NOTINSERVICE;
+ break;
+
+ case RS_DESTROY:
+ container = netsnmp_container_table_extract(request);
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "could not extract table container for $i\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+ ${i}_removeEntry(container, table_entry );
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( table_entry && !table_entry->valid ) {
+ table_entry->valid = 1;
+ }
+@end@
+ }
+ }
+@end@
+ break;
+@end@
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+#ifdef ${i.uc}_USE_CACHE
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:${i}:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for ${i}_cache_load\n");
+ return -1;
+ }
+ container = (netsnmp_container *)cache->magic;
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * load cache here (or call function to do it)
+ */
+ /** CONTAINER_INSERT(container, record); */
+
+ return 0;
+} /* _cache_load */
+
+/**
+ * @Internal
+ */
+/** remove a row from the table */
+static void
+${i}_freeEntry_cb(${i}_entry *entry, void *magic) {
+
+ ${i}_freeEntry(entry);
+}
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:${i}:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in ${i}_cache_free\n");
+ return;
+ }
+ container = (netsnmp_container *) cache->magic;
+
+ /*
+ * empty (but don't free) cache here
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)${i}_freeEntry_cb,
+ NULL);
+} /* _cache_free */
+#endif /* ${i.uc}_USE_CACHE */
+@end@
diff --git a/local/mib2c.create-dataset.conf b/local/mib2c.create-dataset.conf
new file mode 100644
index 0000000..9cf75fd
--- /dev/null
+++ b/local/mib2c.create-dataset.conf
@@ -0,0 +1,111 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/* function declarations */
+void init_$name(void);
+@foreach $i table@
+void initialize_table_$i(void);
+Netsnmp_Node_Handler ${i}_handler;
+@end@
+@foreach $i table@
+
+/* column number definitions for table $i */
+ @foreach $c column@
+ #define COLUMN_$c.uc $c.subid
+ @end@
+@end@
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}.h"
+
+@foreach $i table@
+/** Initialize the $i table by defining its contents and how it's structured */
+void
+initialize_table_$i(void)
+{
+ const oid ${i}_oid[] = {$i.commaoid};
+ netsnmp_table_data_set *table_set;
+
+ /* create the table structure itself */
+ table_set = netsnmp_create_table_data_set("$i");
+
+ /* comment this out or delete if you don't support creation of new rows */
+ table_set->allow_creation = 1;
+
+ /***************************************************
+ * Adding indexes
+ */
+ DEBUGMSGTL(("initialize_table_$i",
+ "adding indexes to table $i\n"));
+ netsnmp_table_set_add_indexes(table_set,
+ @foreach $idx index@
+ $idx.type, /* index: $idx */
+ @end@
+ 0);
+
+ DEBUGMSGTL(("initialize_table_$i",
+ "adding column types to table $i\n"));
+ netsnmp_table_set_multi_add_default_row(table_set,
+ @foreach $c column@
+ COLUMN_$c.uc, $c.type, $c.settable,
+ NULL, 0,
+ @end@
+ 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 ${i}_handler to "NULL" */
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("$i", ${i}_handler,
+ ${i}_oid,
+ OID_LENGTH(${i}_oid),
+ HANDLER_CAN_RWRITE),
+ table_set, NULL);
+}
+@end@
+
+/** Initializes the $name module */
+void
+init_$name(void)
+{
+
+ /* here we initialize all the tables we're planning on supporting */
+ @foreach $i table@
+ initialize_table_$i();
+ @end@
+}
+@foreach $i table@
+
+/** handles requests for the $i table, if anything else needs to be done */
+int
+${i}_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;
+}
+@end@
diff --git a/local/mib2c.emulation.conf b/local/mib2c.emulation.conf
new file mode 100644
index 0000000..20d2e7b
--- /dev/null
+++ b/local/mib2c.emulation.conf
@@ -0,0 +1,246 @@
+############################################## -*- Mib2c -*-
+##
+## File : mib2c.emulation.conf
+## Author : Robert Story <rstory@freesnmp.com>
+## Purpose: A mib2c conf file to generate snmpd.conf configuration to
+## provide basic/simplistic emulation for a particular MIB.
+##
+##
+## $Id$
+######################################################################
+@open ${name}-emulation.conf@
+#
+# $name.module MIB emulation
+# Base OID: $name.objectID
+#
+# Requirements: Net-SNMP 5.2 or greater
+#
+# This file can be used as (part of) a Net-SNMP snmpd.conf
+# configuration file to emulate (in a minimal fashion) the objects defined
+# in the $name MIB.
+#
+# It is important to note that this file merely creates dummy values
+# and variables and does not implement any of the functionality which
+# the mib objects are actually supposed to implement!
+#
+# Also, it just defaults to 0, '' or 0.0 for initial values, so you'll need
+# to tweak all the vaules. For any tables, you'll have set any indexes.
+#
+# The configuration tokens used in this file are documented in the
+# snmpd.conf manual page, with the exception of the first line, which
+# is documented in the snmp.conf and snmp_config manual pages.
+#
+#
+# To use this file, you have several options:
+#
+# 1) add the contents to your existing snmpd.conf file
+# 2) copy it to a new snmpd.conf, somewhere in SNMPCONFPATH
+# 3) copy it to snmpd.conf.local, somewhere in SNMPCONFPATH
+#
+# The command 'net-snmp-config --snmpconfpath' will give your the
+# SNMPCONFPATH (5.3.x and later).
+
+
+# Here we tell the agent to load the MIB, so we can use names instead
+# of OIDs. You may need to add other MIBs that this MIB depends on.
+# Also, you might want to consider adding these to the global snmp.conf,
+# so all users can reference them.
+#
+# See the Net-SNMP FAQ for more information on MIB loading.
+#
+[snmp] mibs +$name.module
+
+#
+# $name Scalar variables
+#
+
+@foreach $node scalar@
+@ print Scalar: $node@
+# $node.module::$node.parent.$node($node.subid) [$node.syntax = $node.type]
+@ if "$node.status" eq "Deprecated"@
+# **** WARNING: deprecated object ****
+@ end@
+@if $node.enums == 1@
+@ eval $m2c_evals = ""@
+@ eval $m2c_first = 1@
+@ foreach $e $v enum@
+@ if $m2c_first == 1@
+@ eval $m2c_first = 0@
+@ else@
+@ eval $m2c_evals = "$m2c_evals,"@
+@ end@
+@ eval $m2c_evals = "$m2c_evals $e($v)"@
+@ if $node.hasdefval == 1@
+@ if (("$node.defval" eq "$e") || ("$node.defval" eq "$v"))@
+@ eval $m2c_evals = "${m2c_evals}*"@
+@ end@
+@ end@
+@ end@
+# Enum range: $node.enumrange. Values: $m2c_evals
+@elsif $node.ranges == 1@
+@ eval $m2c_range_max = 0@
+@ eval $m2c_evals = ""@
+@ eval $m2c_first = 1@
+@ foreach $a $b range $node@
+@ if $m2c_first == 1@
+@ eval $m2c_first = 0@
+@ else@
+@ eval $m2c_evals = "$m2c_evals,"@
+@ end@
+@ if $a == $b@
+@ eval $m2c_evals = "$m2c_evals $a"@
+@ else@
+@ eval $m2c_evals = "$m2c_evals $a - $b"@
+@ end@
+@ eval $m2c_range_max = max($m2c_range_max,$b)@
+@ end@
+# Ranges: $m2c_evals;
+@end@ #ranges
+@ if $node.hasdefval == 1@
+@ eval $m2c_emu_def = "$node.defval"@
+@ else@
+# (no default value)
+@ if "$node.type" eq "ASN_OCTET_STR"@
+@ eval $m2c_emu_def = "''" @
+@ elsif "$node.type" eq "ASN_OBJECT_ID"@
+@ eval $m2c_emu_def = "0.0" @
+@ else@
+@ eval $m2c_emu_def = "0" @
+@ end@
+@ end@
+## uggh.. try to convert type into something 5.3.x override understands
+@ eval $m2c_emu_type = lc($node.type)@
+@ perleval $vars{'m2c_emu_type'} =~ s/asn_//; 0;@
+@ if $node.settable@
+#override -rw ${node}.0 $m2c_emu_type $m2c_emu_def
+@ else@
+#override ${node}.0 $m2c_emu_type $m2c_emu_def
+@ end@
+
+@end@
+
+
+##======================================================================
+#
+# Note that in tables, all indices are shown first, then each
+# readable column. This results in indices being given twice.
+#
+@foreach $node table@
+@ print Table: $node@
+# $node.module::$node.parent.$node($node.subid)
+table $node
+##============================================================
+@ eval $m2c_idx_def = ""@
+@ eval $m2c_add_def = ""@
+@ foreach $col index@
+# [$col] ($node.accessible) $col.syntax / $col.type / $m2c_decl ($col.decl)
+@ if $col.enums == 1@
+@ eval $m2c_evals = ""@
+@ eval $m2c_first = 1@
+@ foreach $e $v enum@
+@ if $m2c_first == 1@
+@ eval $m2c_first = 0@
+@ else@
+@ eval $m2c_evals = "$m2c_evals,"@
+@ end@
+@ eval $m2c_evals = "$m2c_evals $e($v)"@
+@ if $col.hasdefval == 1@
+@ if (("$col.defval" eq "$e") || ("$col.defval" eq "$v"))@
+@ eval $m2c_evals = "${m2c_evals}*"@
+@ end@
+@ end@
+@ end@
+# enum range: $col.enumrange. Values: $m2c_evals
+@ elsif $col.ranges == 1@
+@ eval $m2c_range_max = 0@
+@ eval $m2c_evals = ""@
+@ eval $m2c_first = 1@
+@ foreach $a $b range $col@
+@ if $m2c_first == 1@
+@ eval $m2c_first = 0@
+@ else@
+@ eval $m2c_evals = "$m2c_evals,"@
+@ end@
+@ if $a == $b@
+@ eval $m2c_evals = "$m2c_evals $a"@
+@ else@
+@ eval $m2c_evals = "$m2c_evals $a - $b"@
+@ end@
+@ eval $m2c_range_max = max($m2c_range_max,$b)@
+@ end@
+# ranges: $m2c_evals;
+@ end@ #ranges
+@ if $col.hasdefval == 1@
+@ eval $m2c_col_def = '$col.defval'@
+@ else@
+@ if "$col.type" eq "ASN_OCTET_STR"@
+@ eval $m2c_col_def = "''" @
+@ elsif "$col.type" eq "ASN_OBJECT_ID"@
+@ eval $m2c_col_def = "0.0" @
+@ else@
+@ eval $m2c_col_def = "0" @
+@ end@
+@ end@
+@ eval $m2c_add_def = "$m2c_add_def $m2c_col_def"@
+##@ if $node.accessible == 1@
+@ eval $m2c_idx_def = "$m2c_idx_def $m2c_col_def"@
+##@ end@
+@ end@ ## col
+##===================================================
+@ foreach $col nonindex@
+# $col [$col.syntax = $col.type]
+@ if "$col.status" eq "Deprecated"@
+# **** WARNING: deprecated object ****
+@ end@
+@ if $col.enums == 1@
+@ eval $m2c_evals = ""@
+@ eval $m2c_first = 1@
+@ foreach $e $v enum@
+@ if $m2c_first == 1@
+@ eval $m2c_first = 0@
+@ else@
+@ eval $m2c_evals = "$m2c_evals,"@
+@ end@
+@ eval $m2c_evals = "$m2c_evals $e($v)"@
+@ if $col.hasdefval == 1@
+@ if (("$col.defval" eq "$e") || ("$col.defval" eq "$v"))@
+@ eval $m2c_evals = "${m2c_evals}*"@
+@ end@
+@ end@
+@ end@
+# enum range: $col.enumrange. Values: $m2c_evals
+@ elsif $col.ranges == 1@
+@ eval $m2c_range_max = 0@
+@ eval $m2c_evals = ""@
+@ eval $m2c_first = 1@
+@ foreach $a $b range $col@
+@ if $m2c_first == 1@
+@ eval $m2c_first = 0@
+@ else@
+@ eval $m2c_evals = "$m2c_evals,"@
+@ end@
+@ if $a == $b@
+@ eval $m2c_evals = "$m2c_evals $a"@
+@ else@
+@ eval $m2c_evals = "$m2c_evals $a - $b"@
+@ end@
+@ eval $m2c_range_max = max($m2c_range_max,$b)@
+@ end@
+# ranges: $m2c_evals;
+@ end@ #ranges
+@ if $col.hasdefval == 1@
+@ eval $m2c_col_def = '$col.defval'@
+@ else@
+@ if "$col.type" eq "ASN_OCTET_STR"@
+@ eval $m2c_col_def = "''" @
+@ elsif "$col.type" eq "ASN_OBJECT_ID"@
+@ eval $m2c_col_def = "0.0" @
+@ else@
+@ eval $m2c_col_def = "0" @
+@ end@
+@ end@
+@ eval $m2c_add_def = "$m2c_add_def $m2c_col_def"@
+@ end@ ## col
+#add_row $node $m2c_idx_def $m2c_add_def
+
+@end@ ## table
diff --git a/local/mib2c.genhtml.conf b/local/mib2c.genhtml.conf
new file mode 100644
index 0000000..b0f6284
--- /dev/null
+++ b/local/mib2c.genhtml.conf
@@ -0,0 +1,370 @@
+##
+## USAGE:
+## mib2c -c mib2c.genhtml.conf STARTINGNODE
+##
+## Optional extra arguments:
+##
+## -S cssfile=file.css (specifies an alternate CSS style
+## file to include in the output)
+##
+##
+## try to strip leading white space from text
+##
+@define DO_FORMATED_TEXT@
+@startperl@
+ my ($s) = ($vars{'x'} =~ /\n(\s+)/);
+ $vars{'x'} =~ s/^$s//gm;
+ 0;
+@endperl@
+<pre>
+$x
+</pre>
+@enddefine@
+##
+## print a description clause (include TC info and references
+##
+@define DO_DESCR@
+<td>
+@if "$i.perltype" ne "$i.syntax"@
+<p>
+@eval $tmpsyn = "$i.syntax"@
+@perleval if (!defined($TCS{$vars{'tmpsyn'}})) { $TCS{$vars{'tmpsyn'}} = $vars{'i'}; }; 0;@
+Note: this object is based on the <a href="#$i.syntax"> $i.syntax TEXTUAL-CONVENTION</a>.
+</p>
+@end@
+@eval $x = "$i.description"@
+@calldefine DO_FORMATED_TEXT@
+##@startperl@
+## my ($s) = ($vars{'x'} =~ /\n(\s+)/);
+## $vars{'x'} =~ s/^$s//gm;
+## 0;
+##@endperl@
+##<pre>
+##$x
+##</pre>
+@if "$i.reference" ne ""@
+@eval $x = "$i.reference"@
+<p><i>Also see Reference:
+@calldefine DO_FORMATED_TEXT@
+</i></p>
+@end@
+</td>
+@enddefine@
+##
+## print information (a row) about a given node
+##
+@define NODE_INFO@
+@if ("$i.status" eq "Current")@
+ <td>
+@else@
+ <td class="deprecated">
+@end@
+<a name="$i" />
+@eval $tmpi = "$i.parent"@
+@if "$doindexstuff" ne "" && "$tmpi.parent" ne "$t"@
+(external from $tmpi.parent)
+@else@
+$i.subid
+@end@
+<br /><b>$i</b>
+
+</td><td>
+##
+## print the data type
+##
+@if ("$i.status" ne "Current")@
+<font color="red">DEPRECATED</font><br />
+@end@
+ $i.perltype
+##
+## print range information
+##
+ @if "$i.ranges"@
+ @if "$i.perltype" eq 'OCTETSTR' || "$i.perltype" eq 'OBJECTID'@
+ <br />Legal Lengths:
+ @else@
+ <br />Legal values:
+ @end@
+ @eval $tmpdidit = 0@
+ @foreach $st $end range $i@
+ @if "$tmpdidit" == "1"@
+ ,
+ @end@
+ @if "$st" eq "$end"@
+ $st
+ @else@
+ $st .. $end
+ @end@
+ @eval $tmpdidit = 1@
+ @end@
+ @end@
+##
+## check for TC vs non-TC cases
+##
+ @if "$i.perltype" ne "$i.syntax"@
+ <br>
+ @eval $tmpsyn = "$i.syntax"@
+ @perleval if (!defined($TCS{$vars{'tmpsyn'}})) { $TCS{$vars{'tmpsyn'}} = $vars{'i'}; }; 0;@
+ <a href="#$i.syntax">$i.syntax</a>
+ @if $i.enums@
+ <br>(ENUM list below)
+ @end@
+ @else@
+ @if $i.enums@
+ <table class="enum">
+ <tr><th>Value</th><th>Label/Meaning</th></tr>
+ @foreach $e $v enum@
+ <tr><td>$v</td><td>$e</td></tr>
+ @end@
+ </table>
+ @end@
+ @end@
+
+ </td><td>$i.access</td>
+ @if !"$dont_do_oids"@
+ <td>$i.objectID</td>
+ @end@
+ @calldefine DO_DESCR@
+@enddefine@
+@open ${name}.html@
+<head>
+ <title>MIB information for $name</title>
+<style type="text/css">
+@if "$cssfile" ne ""@
+@startperl@
+open(CSS,$vars{'cssfile'});
+while(<CSS>) {
+ mib2c_output($_);
+}
+close(CSS);
+0;
+@endperl@
+@else@
+<!--
+h2{background:#bbeebb}
+h3{background:#ccccee}
+table {
+ border: 1px;
+ background: #dddddd;
+ style: outset;
+}
+th {
+ border: 1px;
+ border: solid;
+ border-style: outset;
+ background: #bbbbbb;
+}
+td {
+ border: 1px;
+ border: solid;
+ border-style: inset;
+}
+table.enums {
+ background: #cccccc;
+}
+table.deprecated {
+ background: #ffdddd;
+}
+td.deprecated {
+ background: #ffdddd;
+}
+.label {
+ border-style: outset;
+ background: #bbbbbb;
+}
+-->
+@end@
+</style>
+</head>
+<body bgcolor="#ffffff">
+<h2>INTRODUCTION</h2>
+<ul>
+<p>
+This is a summary of information regarding objects below the <b>$name</b>
+MIB object, which is defined within the <b>$name.module</b> MIB
+document as <b>$name.objectID</b>.
+</p>
+</ul>
+##
+## Table of contents
+##
+<h2>TABLE OF CONTENTS</h2>
+<ul>
+@foreach $Current stuff Current Deprecated@
+<h3><a href="#objects_$Current">$Current Objects</a></h3>
+<ul>
+@if "$Current" eq "Current"@
+<li><a href="#scalar_current">Scalars</a></li>
+@else@
+<li><a href="#scalar_notcurrent">Deprecated Scalars</a></li>
+@end@
+@foreach $t table@
+@if ("$Current" eq "Current" && "$t.status" eq "Current") || ("$Current" ne "Current" && "$t.status" ne "Current")@
+ <li><a href="#$t">$t</a></li>
+@end@
+@end@
+</ul>
+@end@
+<h3><a href="#notifications">Notifications</a></h3>
+<h3><a href="#textconventions">Textual Conventions</a></h3>
+<h3><a href="#treeview">Tree-based view</a></h3>
+</ul>
+##
+## Start of definitions
+##
+@foreach $Current stuff Current Deprecated@
+<a name="objects_$Current" />
+@if "$Current" ne "Current"@
+ @eval $namestring = "notcurrent"@
+ <hr />
+ <h1><font color="red">DEPRECATED OR OBSOLETE OR HISTORIC OBJECTS</font></h1>
+ <br>
+ <table class="deprecated"><tr><td>
+@else@
+ @eval $namestring = "current"@
+@end@
+<a name="scalar_$namestring" />
+<h2>SCALAR OBJECTS</h2>
+<ul>
+<table>
+<tr><th>Name</th><th>Type</th><th>Access</th><th>OID</th><th>Description</th></tr>
+@foreach $i scalar@
+ @if ("$Current" eq "Current" && "$i.status" eq "Current") || ("$Current" ne "Current" && "$i.status" ne "Current")@
+ <tr>
+ @calldefine NODE_INFO@
+ </tr>
+ @end@
+@end@
+</table>
+</ul>
+
+<h2>TABLE OBJECTS</h2>
+@eval $dont_do_oids = 1@
+@foreach $t table@
+@if ("$Current" eq "Current" && "$t.status" eq "Current") || ("$Current" ne "Current" && "$t.status" ne "Current")@
+<a name="$t" /><h3>Table $t</h3>
+<ul>
+ <table>
+ <tr><td class="label">Table Name</td><td>$t</td></tr>
+ <tr><td class="label">In MIB</td><td>$t.module</td></tr>
+ <tr><td class="label">Registered at OID</td><td>$t.objectID</td></tr>
+ <tr><td class="label">Table Description</td>
+@eval $i ="$t"@
+@calldefine DO_DESCR@
+</tr>
+ @eval $tmpx = $t@
+ @perleval $vars{'tmpx'} =~ s/Table/Entry/; 0;@
+@eval $i = "$tmpx"@
+<tr><td class="label"><a name="$tmpx" />Row Description</td>
+@calldefine DO_DESCR@
+</tr>
+ </table>
+
+ <h4>$t Indexes:</h4>
+
+<table>
+<tr class="label"><th>Name</th><th>Type</th><th>Access</th><th>Description</th></tr>
+@foreach $i index@
+ <tr>
+ @calldefine NODE_INFO@
+ </tr>
+@end@
+</table>
+
+ <h4>Other $t Columns:</h4>
+<table>
+<tr class="label"><th>Name</th><th>Type</th><th>Access</th><th>Description</th></tr>
+@foreach $i nonindex@
+ <tr>
+ @calldefine NODE_INFO@
+ </tr>
+@end@
+</table>
+</ul>
+@end@
+@end@
+@end@
+
+<br>
+ </table>
+<hr />
+<a name="notifications" />
+<h2>NOTIFICATIONS</h2>
+<ul>
+<p>
+@foreach $i notifications@
+<a name="$i" /><h3>Notification: $i</h3>
+
+ <table>
+ <tr><td class="label">Notification Name</td><td>$i</td></tr>
+ <tr><td class="label">In MIB</td><td>$i.module</td></tr>
+ <tr><td class="label">Registered at OID</td><td>$i.objectID</td></tr>
+ <tr><td class="label">Notification Description</td>
+@calldefine DO_DESCR@
+ </tr>
+ <tr> <td class="label">Mandatory<br />Objects</td><td>
+ <table>
+ @foreach $v varbinds@
+ <tr><td><a href="#$v">$v</a></td></tr>
+ @end@
+ </table></td></tr>
+ </table>
+@end@
+</ul>
+
+
+<br>
+<hr />
+<a name="textconventions" />
+<h2>TEXTUAL CONVENTIONS</h2>
+<ul>
+<p>
+These TEXTUAL-CONVENTIONS are used in other parts of the document
+above. They are SNMP's way of defining a datatype that is used
+repeatedly by other MIB objects. Any implementation implementing
+objects that use one of these definitions must follow its DESCRIPTION
+clause as well as the DESCRIPTION clause of the object itself.
+</p>
+@startperl@
+mib2c_output("<table>");
+mib2c_output("<tr class=\"label\"><th>Name</th><th>Type</th><th>Description</th></tr>\n");
+map {
+ my $desc = $SNMP::MIB{$TCS{$_}}{'TCDescription'};
+ my ($s) = ($desc =~ /\n(\s+)/);
+ $desc =~ s/^$s//gm;
+ mib2c_output("<tr><td><a name=\"$_\">$_</td><td>");
+ mib2c_output($SNMP::MIB{$TCS{$_}}{'type'});
+ my @enumkeys = keys(%{$SNMP::MIB{$TCS{$_}}{'enums'}});
+ if ($#enumkeys > -1) {
+ mib2c_output("<table class=\"enums\">");
+ mib2c_output("<tr><th>Value</th><th>Label/Meaning</th></tr>");
+ foreach $k (sort { $SNMP::MIB{$TCS{$_}}{'enums'}{$a} <=>
+ $SNMP::MIB{$TCS{$_}}{'enums'}{$b} } @enumkeys) {
+ mib2c_output("<tr><td>$SNMP::MIB{$TCS{$_}}{'enums'}{$k}</td><td>$k</td></tr>");
+ }
+ mib2c_output("</table>");
+ }
+ mib2c_output("</td><td><pre>$desc</pre></td></tr>\n");
+} keys(%TCS);
+mib2c_output("</table>");
+0;
+@endperl@
+</ul>
+
+<a name="treeview" />
+<h2>TREE VIEW</h2>
+@eval $mod = "$name.module"@
+<p>Tree view generated by running: <b>snmptranslate -Tp $mod::$name</b></p>
+<pre>
+@startperl@
+open(TREE,"snmptranslate -Tp $vars{mod}::$vars{name}|");
+while(<TREE>) {
+ s/(\+-- .*\s)(\w+)(\(\d+\))$/$1<a href="#$2">$2<\/a>$3/;
+ s/\+--(\w+)/+--<a href="#$1">$1<\/a>/;
+ s/Textual Convention: (\w+)/Textual Convention: <a href="#$1">$1<\/a>/;
+ mib2c_output($_);
+}
+close(TREE);
+return 0;
+@endperl@
+</pre>
diff --git a/local/mib2c.int_watch.conf b/local/mib2c.int_watch.conf
new file mode 100644
index 0000000..ecc5d10
--- /dev/null
+++ b/local/mib2c.int_watch.conf
@@ -0,0 +1,106 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open -@
+*** Warning: only generating code for nodes of MIB type INTEGER
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/* function declarations */
+void init_$name(void);
+
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}.h"
+
+/*
+ * The variables we want to tie the relevant OIDs to.
+ * The agent will handle all GET and (if applicable) SET requests
+ * to these variables automatically, changing the values as needed.
+ */
+
+@foreach $i scalar@
+ @if !$i.needlength@
+$i.decl $i = 0; /* XXX: set default value */
+ @end@
+@end@
+
+/*
+ * Our initialization routine, called automatically by the agent
+ * (Note that the function name must match init_FILENAME())
+ */
+void
+init_${name}(void)
+{
+ netsnmp_handler_registration *reg;
+
+ @foreach $i scalar@
+ @if !$i.needlength@
+ const oid ${i}_oid[] = { $i.commaoid };
+ @end@
+ static netsnmp_watcher_info ${i}_winfo;
+ @end@
+
+ /*
+ * a debugging statement. Run the agent with -D$name to see
+ * the output of this debugging statement.
+ */
+ DEBUGMSGTL(("$name", "Initializing the $name module\n"));
+
+
+ /*
+ * Register scalar watchers for each of the MIB objects.
+ * The ASN type and RO/RW status are taken from the MIB definition,
+ * but can be adjusted if needed.
+ *
+ * In most circumstances, the scalar watcher will handle all
+ * of the necessary processing. But the NULL parameter in the
+ * netsnmp_create_handler_registration() call can be used to
+ * supply a user-provided handler if necessary.
+ *
+ * This approach can also be used to handle Counter64, string-
+ * and OID-based watched scalars (although variable-sized writeable
+ * objects will need some more specialised initialisation).
+ */
+ @foreach $i scalar@
+ @if !$i.needlength@
+ DEBUGMSGTL(("$name",
+ "Initializing $i scalar integer. Default value = %d\n",
+ $i));
+ reg = netsnmp_create_handler_registration(
+ "$i", NULL,
+ ${i}_oid, OID_LENGTH(${i}_oid),
+ @if $i.settable@
+ HANDLER_CAN_RWRITE);
+ @else@
+ HANDLER_CAN_RONLY);
+ @end@
+ netsnmp_init_watcher_info(&${i}_winfo, &$i, sizeof($i.decl),
+ $i.type, WATCHER_FIXED_SIZE);
+if (netsnmp_register_watched_scalar( reg, &${i}_winfo ) < 0 ) {
+ snmp_log( LOG_ERR, "Failed to register watched $i" );
+ }
+
+ @end@
+ @end@
+
+ DEBUGMSGTL(("$name",
+ "Done initalizing $name module\n"));
+}
diff --git a/local/mib2c.iterate.conf b/local/mib2c.iterate.conf
new file mode 100644
index 0000000..3a2b5f7
--- /dev/null
+++ b/local/mib2c.iterate.conf
@@ -0,0 +1,716 @@
+## -*- c -*-
+#
+@if "$cache" eq "" @
+@open -@
+This framework can work in one of two ways:
+
+ 1) Hold a local cached copy of some external data
+ which is then used to service incoming requests.
+
+ 2) Query the external data directly for each request.
+
+The first is typically more efficient, but results in
+slightly "stale" data (depending on the expiration timeout
+for the cache) and greater memory usage. The second can
+provide more up-to-date information, but at the cost of
+higher processing overheads.
+
+Which is more appropriate for your needs?
+ @prompt $ans Select your choice : @
+ @if $ans == 1 @
+ @eval $cache = 1@
+ @elsif $ans == 2@
+ @eval $cache = 0@
+ @else@
+Invalid answer - generating caching code
+ @eval $cache = 1@
+ @end@
+@else@ # -S cache={something}
+ @if "$cache" ne "1" && "$cache" ne "0" @
+@open -@
+Invalid value for 'cache' ($cache) - generating caching code
+ @eval $cache = 1@
+ @end@
+@end@
+
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/* function declarations */
+void init_$name(void);
+@foreach $i table@
+void initialize_table_$i(void);
+Netsnmp_Node_Handler ${i}_handler;
+Netsnmp_First_Data_Point ${i}_get_first_data_point;
+Netsnmp_Next_Data_Point ${i}_get_next_data_point;
+@if "$cache" == 1 @
+NetsnmpCacheLoad ${i}_load;
+NetsnmpCacheFree ${i}_free;
+#define $i.uc_TIMEOUT 60
+@end@
+@end@
+@foreach $i table@
+
+/* column number definitions for table $i */
+ @foreach $c column@
+ #define COLUMN_$c.uc $c.subid
+ @end@
+@end@
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}.h"
+
+/** Initializes the $name module */
+void
+init_$name(void)
+{
+ /* here we initialize all the tables we're planning on supporting */
+ @foreach $i table@
+ initialize_table_$i();
+ @end@
+}
+
+@foreach $i table@
+ # Determine the first/last column names
+ @eval $first_column = "-"@
+ @eval $last_column = "-"@
+ @foreach $c column@
+ @if $c.readable@
+ @if "$first_column" eq "-"@
+ @eval $first_column = $c@
+ @end@
+ @eval $last_column = $c@
+ @end@
+ @end@
+
+/** Initialize the $i table by defining its contents and how it's structured */
+void
+initialize_table_$i(void)
+{
+ const oid ${i}_oid[] = {$i.commaoid};
+ const size_t ${i}_oid_len = OID_LENGTH(${i}_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_iterator_info *iinfo;
+ netsnmp_table_registration_info *table_info;
+
+ DEBUGMSGTL(("${name}:init", "initializing table $i\n"));
+
+ reg = netsnmp_create_handler_registration(
+ "$i", ${i}_handler,
+ ${i}_oid, ${i}_oid_len,
+@if $i.settable@
+ HANDLER_CAN_RWRITE
+@else@
+ HANDLER_CAN_RONLY
+@end@
+ );
+
+ table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ netsnmp_table_helper_add_indexes(table_info,
+ @foreach $idx index@
+ $idx.type, /* index: $idx */
+ @end@
+ 0);
+ table_info->min_column = COLUMN_$first_column.uc;
+ table_info->max_column = COLUMN_$last_column.uc;
+
+ iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info );
+ iinfo->get_first_data_point = ${i}_get_first_data_point;
+ iinfo->get_next_data_point = ${i}_get_next_data_point;
+ iinfo->table_reginfo = table_info;
+
+ netsnmp_register_table_iterator( reg, iinfo );
+@if "$cache" == 1 @
+ netsnmp_inject_handler_before( reg,
+ netsnmp_get_cache_handler($i.uc_TIMEOUT,
+ ${i}_load, ${i}_free,
+ ${i}_oid, ${i}_oid_len),
+ TABLE_ITERATOR_NAME);
+@end@
+
+ /* Initialise the contents of the table here */
+}
+
+ /* Typical data structure for a row entry */
+struct ${i}_entry {
+ /* Index values */
+ @foreach $idx index@
+ @if $idx.needlength@
+ $idx.decl $idx[NNN];
+ size_t ${idx}_len;
+ @else@
+ $idx.decl $idx;
+ @end@
+ @end@
+
+ /* Column values */
+ @foreach $c column@
+ @if $c.readable@
+ @if $c.needlength@
+ $c.decl $c[NNN];
+ size_t ${c}_len;
+ @else@
+ $c.decl $c;
+ @end@
+ @if $c.settable@
+ @if !$c.rowstatus@
+ @if $c.needlength@
+ $c.decl old_$c[NNN];
+ size_t old_${c}_len;
+ @else@
+ $c.decl old_$c;
+ @end@
+ @end@
+ @end@
+ @end@
+ @end@
+
+ /* Illustrate using a simple linked list */
+ int valid;
+ struct ${i}_entry *next;
+};
+
+struct ${i}_entry *${i}_head;
+
+/* create a new row in the (unsorted) table */
+struct ${i}_entry *
+${i}_createEntry(
+ @foreach $idx index@
+ @if $idx.needlength@
+ $idx.decl* $idx,
+ size_t ${idx}_len,
+ @else@
+ $idx.decl $idx,
+ @end@
+ @end@
+ ) {
+ struct ${i}_entry *entry;
+
+ entry = SNMP_MALLOC_TYPEDEF(struct ${i}_entry);
+ if (!entry)
+ return NULL;
+
+ @foreach $idx index@
+ @if $idx.needlength@
+ memcpy(entry->$idx, $idx, ${idx}_len);
+ entry->${idx}_len = ${idx}_len;
+ @else@
+ entry->$idx = $idx;
+ @end@
+ @end@
+ entry->next = ${i}_head;
+ ${i}_head = entry;
+ return entry;
+}
+
+/* remove a row from the table */
+void
+${i}_removeEntry( struct ${i}_entry *entry ) {
+ struct ${i}_entry *ptr, *prev;
+
+ if (!entry)
+ return; /* Nothing to remove */
+
+ for ( ptr = ${i}_head, prev = NULL;
+ ptr != NULL;
+ prev = ptr, ptr = ptr->next ) {
+ if ( ptr == entry )
+ break;
+ }
+ if ( !ptr )
+ return; /* Can't find it */
+
+ if ( prev == NULL )
+ ${i}_head = ptr->next;
+ else
+ prev->next = ptr->next;
+
+ SNMP_FREE( entry ); /* XXX - release any other internal resources */
+}
+
+@if "$cache" == 1 @
+/* Example cache handling - set up linked list from a suitable file */
+int
+${i}_load( netsnmp_cache *cache, void *vmagic ) {
+ FILE *fp;
+ struct ${i}_entry *this;
+ char buf[STRMAX];
+
+ /* The basic load routine template assumes that the data to
+ be reported is held in a file - with one row of the file
+ for each row of the table.
+ If your data is available via a different API, you
+ should amend this initial block (and the control of the
+ 'while' loop) accordingly.
+ 'XXX' marks where the template is incomplete and
+ code will definitely need to be added. */
+
+ fp = fopen( "/data/for/${i}", "r" );
+ if ( !fp ) {
+ return -1;
+ }
+ while ( fgets( buf, STRMAX, fp )) {
+ this = SNMP_MALLOC_TYPEDEF( struct ${i}_entry );
+ /* XXX - Unpick 'buf' to extract the individual field values
+ and then populate the 'this' data structure with them */
+
+ this->next = ${i}_head;
+ ${i}_head = this; /* Iterate helper is fine with unordered lists! */
+ }
+ fclose(fp);
+ return 0; /* OK */
+}
+
+void
+${i}_free( netsnmp_cache *cache, void *vmagic ) {
+ struct ${i}_entry *this, *that;
+
+ for ( this = ${i}_head; this; this=that ) {
+ that = this->next;
+ SNMP_FREE( this ); /* XXX - release any other internal resources */
+ }
+ ${i}_head = NULL;
+}
+@end@
+
+/* Example iterator hook routines - using 'get_next' to do most of the work */
+netsnmp_variable_list *
+${i}_get_first_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list *put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+ *my_loop_context = ${i}_head;
+ return ${i}_get_next_data_point(my_loop_context, my_data_context,
+ put_index_data, mydata );
+}
+
+netsnmp_variable_list *
+${i}_get_next_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list *put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+ struct ${i}_entry *entry = (struct ${i}_entry *)*my_loop_context;
+ netsnmp_variable_list *idx = put_index_data;
+
+ if ( entry ) {
+ @foreach $idx index@
+ @if $idx.needlength@
+ snmp_set_var_value( idx, entry->${idx}, sizeof(entry->${idx}) );
+ @else@
+ snmp_set_var_typed_integer( idx, $idx.type, entry->${idx} );
+ @end@
+ idx = idx->next_variable;
+ @end@
+ *my_data_context = (void *)entry;
+ *my_loop_context = (void *)entry->next;
+ return put_index_data;
+ } else {
+ return NULL;
+ }
+}
+
+
+/** handles requests for the $i table */
+int
+${i}_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;
+ struct ${i}_entry *table_entry;
+
+ DEBUGMSGTL(("${name}:handler", "Processing request (%d)\n", reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.readable@
+ case COLUMN_$c.uc:
+ if ( !table_entry ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ @if $c.needlength@
+ snmp_set_var_typed_value( request->requestvb, $c.type,
+ table_entry->$c,
+ table_entry->${c}_len);
+ @else@
+ snmp_set_var_typed_integer( request->requestvb, $c.type,
+ table_entry->$c);
+ @end@
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+@if $i.settable@
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ @if $c.rowstatus@
+ ret = netsnmp_check_vb_rowstatus(request->requestvb,
+ (table_entry ? RS_ACTIVE : RS_NONEXISTENT ));
+ @else@
+ @if $c.needlength@
+ /* or possibly 'netsnmp_check_vb_type_and_size' */
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, $c.type, sizeof(table_entry->$c));
+ @else@
+ /* or possibly 'netsnmp_check_vb_int_range' */
+ ret = netsnmp_check_vb_int( request->requestvb );
+ @end@
+ @end@
+ if ( ret != SNMP_ERR_NOERROR ) {
+ netsnmp_set_request_error( reqinfo, request, ret );
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_NOTWRITABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ table_row = ${i}_createEntry(
+ @foreach $idx index@
+ @if $idx.needlength@
+ , table_info->indexes->val.string
+ , table_info->indexes->val_len
+ @else@
+ , *table_info->indexes->val.integer
+ @end@
+ @end@
+ );
+ if (table_row) {
+ netsnmp_insert_iterator_context( request, table_row );
+ } else {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( !table_row ) {
+ table_row = ${i}_createEntry(
+ @foreach $idx index@
+ @if $idx.needlength@
+ , table_info->indexes->val.string
+ , table_info->indexes->val_len
+ @else@
+ , *table_info->indexes->val.integer
+ @end@
+ @end@
+ );
+ if (table_row) {
+ netsnmp_insert_iterator_context( request, table_row );
+ } else {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+@end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_FREE:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (table_entry && !table_entry->valid) {
+ ${i}_removeEntry(table_data, table_row );
+ }
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( table_entry && !table_entry->valid ) {
+ ${i}_removeEntry(table_data, table_row );
+ }
+ break;
+@end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_ACTION:
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ @if !$c.rowstatus@
+ case COLUMN_$c.uc:
+ @if $c.needlength@
+ memcpy( table_entry->old_$c,
+ table_entry->$c,
+ sizeof(table_entry->$c));
+ table_entry->old_${c}_len =
+ table_entry->${c}_len;
+ memset( table_entry->$c, 0,
+ sizeof(table_entry->$c));
+ memcpy( table_entry->$c,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ table_entry->${c}_len =
+ request->requestvb->val_len;
+ @else@
+ table_entry->old_$c = table_entry->$c;
+ table_entry->$c = *request->requestvb->val.integer;
+ @end@
+ break;
+ @end@
+ @end@
+ @end@
+ }
+ }
+@if $i.rowstatus@
+ /* Check the internal consistency of an active row */
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ case RS_CREATEANDGO:
+ if (/* XXX */) {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ @end@
+ @end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_UNDO:
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+@if $i.rowstatus@
+ @if $c.rowstatus@
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (table_entry && !table_entry->valid) {
+ ${i}_removeEntry(table_data, table_row );
+ }
+ }
+ @else@
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ @end@
+@else@
+ @if $c.creatable@
+ if ( table_entry && !table_entry->valid ) {
+ ${i}_removeEntry(table_data, table_row );
+ } else {
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ }
+ @else@
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ @end@
+@end@
+ break;
+ @end@
+ @end@
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ table_entry->valid = 1;
+ /* Fall-through */
+ case RS_ACTIVE:
+ table_entry->$c = RS_ACTIVE;
+ break;
+
+ case RS_CREATEANDWAIT:
+ table_entry->valid = 1;
+ /* Fall-through */
+ case RS_NOTINSERVICE:
+ table_entry->$c = RS_NOTINSERVICE;
+ break;
+
+ case RS_DESTROY:
+ ${i}_removeEntry(table_data, table_row );
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( table_entry && !table_entry->valid ) {
+ table_entry->valid = 1;
+ }
+@end@
+ }
+ }
+@end@
+ break;
+@end@
+ }
+ return SNMP_ERR_NOERROR;
+}
+@end@
diff --git a/local/mib2c.iterate_access.conf b/local/mib2c.iterate_access.conf
new file mode 100644
index 0000000..c211fd3
--- /dev/null
+++ b/local/mib2c.iterate_access.conf
@@ -0,0 +1,424 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/** other required module components */
+config_require(${name}_access)
+config_require(${name}_checkfns)
+
+/* function declarations */
+void init_$name(void);
+@foreach $i table@
+void initialize_table_$i(void);
+Netsnmp_Node_Handler ${i}_handler;
+
+@end@
+@foreach $i table@
+
+/* column number definitions for table $i */
+#include "${name}_columns.h"
+@run mib2c.column_defines.conf@
+
+/* enum definions */
+#include "${name}_enums.h"
+@run mib2c.column_enums.conf@
+
+@end@
+#endif /** $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}.h"
+#include "${name}_checkfns.h"
+#include "${name}_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
+${name}_free_undoInfo(void *vptr) {
+ struct undoInfo *ui = vptr;
+ if (!ui)
+ return;
+ SNMP_FREE(ui->ptr);
+ SNMP_FREE(ui);
+}
+
+@foreach $i table@
+/** Initialize the $i table by defining its contents and how it's structured */
+void
+initialize_table_$i(void)
+{
+ const oid ${i}_oid[] = {$i.commaoid};
+ netsnmp_table_registration_info *table_info;
+ netsnmp_handler_registration *my_handler;
+ netsnmp_iterator_info *iinfo;
+
+ DEBUGMSGTL(("${name}:init", "initializing table $i\n"));
+
+ /** create the table registration information structures */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+
+ my_handler = netsnmp_create_handler_registration("$i",
+ ${i}_handler,
+ ${i}_oid,
+ OID_LENGTH(${i}_oid),
+@if $i.settable@
+ HANDLER_CAN_RWRITE
+@else@
+ HANDLER_CAN_RONLY
+@end@
+ );
+
+ if (!my_handler || !table_info || !iinfo) {
+ snmp_log(LOG_ERR, "malloc failed in initialize_table_$i");
+ return; /** Serious error. */
+ }
+
+ /***************************************************
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(table_info,
+ @foreach $idx index@
+ $idx.type, /** index: $idx */
+ @end@
+ 0);
+
+ /** Define the minimum and maximum accessible columns. This
+ optimizes retrieval. */
+ @eval $minv = 0xffffffff@
+ @eval $maxv = 0@
+ @foreach $c column@
+ @if $c.access =~ /(Read|Create)/@
+ @eval $minv = min($minv, $c.subid)@
+ @eval $maxv = max($maxv, $c.subid)@
+ @end@
+ @end@
+ table_info->min_column = $minv;
+ table_info->max_column = $maxv;
+
+ /** iterator access routines */
+ iinfo->get_first_data_point = ${i}_get_first_data_point;
+ iinfo->get_next_data_point = ${i}_get_next_data_point;
+
+ /** you may wish to set these as well */
+#ifdef MAYBE_USE_THESE
+ iinfo->make_data_context = ${i}_context_convert_function;
+ iinfo->free_data_context = ${i}_data_free;
+
+ /** pick *only* one of these if you use them */
+ iinfo->free_loop_context = ${i}_loop_free;
+ iinfo->free_loop_context_at_end = ${i}_loop_free;
+#endif
+
+ /** tie the two structures together */
+ iinfo->table_reginfo = table_info;
+
+ /***************************************************
+ * registering the table with the master agent
+ */
+ DEBUGMSGTL(("initialize_table_$i",
+ "Registering table $i as a table iterator\n"));
+ netsnmp_register_table_iterator(my_handler, iinfo);
+}
+@end@
+
+/** Initializes the $name module */
+void
+init_$name(void)
+{
+
+ /** here we initialize all the tables we're planning on supporting */
+ @foreach $i table@
+ initialize_table_$i();
+ @end@
+}
+@foreach $i table@
+
+/** handles requests for the $i table, if anything else needs to be done */
+int
+${i}_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;
+
+ /** column and row index encoded portion */
+ const oid * const suffix =
+ requests->requestvb->name + reginfo->rootoid_len + 1;
+ const size_t suffix_len = requests->requestvb->name_length -
+ (reginfo->rootoid_len + 1);
+
+ DEBUGMSGTL(("${name}:handler", "Processing request (%d)\n", reqinfo->mode));
+
+ for(request = requests; request; request = request->next) {
+ var = request->requestvb;
+ if (request->processed != 0)
+ continue;
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ data_context = netsnmp_extract_iterator_context(request);
+ if (data_context == NULL) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ break;
+
+@if $i.settable@
+ case MODE_SET_RESERVE1:
+ data_context = netsnmp_extract_iterator_context(request);
+@if !$i.creatable@
+ if (data_context == NULL) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ continue;
+ }
+@end@
+ break;
+
+ default: /* == the other SET modes */
+ ci = netsnmp_oid_stash_get_data(commitStorage,
+ suffix+1, suffix_len-1);
+ break;
+@end@
+ }
+
+ /** 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) {
+ @foreach $c column@
+ @if $c.access =~ /(Read|Create)/@
+ case COLUMN_$c.uc:
+ {
+ $c.decl *retval;
+ size_t retval_len = 0;
+ retval = get_$c(data_context, &retval_len);
+ if (retval)
+ snmp_set_var_typed_value(var, $c.type,
+ retval,
+ retval_len);
+ }
+ break;
+
+ @end@
+ @end@
+ default:
+ /** We shouldn't get here */
+ snmp_log(LOG_ERR, "problem encountered in ${i}_handler: unknown column\n");
+ }
+ break;
+
+@if $i.settable@
+ 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 = ${i}_create_data_context(table_info->indexes, table_info->colnum);
+ 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) {
+ @foreach $c column@
+ @if $c.access =~ /(Write|Create)/@
+ case COLUMN_$c.uc:
+ {
+ $c.decl *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui = NULL;
+ int ret;
+
+ /** first, get the old value */
+ retval = get_$c(ci->data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) &ui->ptr,
+ retval, ui->len);
+ }
+
+ /** check the new value, possibly against the
+ older value for a valid state transition */
+ ret = check_$c(request->requestvb->type,
+ ($c.decl *) request->requestvb->val.string,
+ request->requestvb->val_len,
+ retval, retval_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, request,
+ ret);
+ ${name}_free_undoInfo(ui);
+ } else if (ui) {
+ /** remember information for undo purposes later */
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix,
+ suffix_len,
+ ui);
+ }
+
+ }
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ break;
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ /** save a variable copy */
+ switch(table_info->colnum) {
+ @foreach $c column@
+ @if $c.access =~ /(Write|Create)/@
+ case COLUMN_$c.uc:
+ {
+ int ret;
+ ret = set_$c(ci->data_context,
+ ($c.decl *) request->requestvb->val.string,
+ request->requestvb->val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, request,
+ ret);
+ }
+ @if $c.syntax eq "RowStatus"@
+ if (*request->requestvb->val.integer ==
+ RS_DESTROY) {
+ ci->new_row = -1;
+ }
+ @end@
+ }
+ break;
+ @end@
+ @end@
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ if (!ci->have_committed) {
+ /** do this once per row only */
+ ${i}_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) {
+ @foreach $c column@
+ @if $c.access =~ /(Write|Create)/@
+ case COLUMN_$c.uc:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix,
+ suffix_len);
+ retval = set_$c(ci->data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ @end@
+ @end@
+ }
+ break;
+
+ case MODE_SET_FREE:
+ break;
+@end@
+
+ default:
+ snmp_log(LOG_ERR, "problem encountered in ${i}_handler: unsupported mode\n");
+ }
+ }
+
+@if $i.settable@
+ /** 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, ${name}_free_undoInfo);
+ netsnmp_oid_stash_free(&commitStorage, netsnmp_oid_stash_no_free);
+ }
+@end@
+
+ return SNMP_ERR_NOERROR;
+}
+@end@
+@run mib2c.check_values.conf@
+@run mib2c.access_functions.conf@
+@open -@
+
+**********************************************************************
+NOTE: The only files you MUST modify should be the following:
+ ${name}_access.c
+ ${name}_access.h
+ ${name}_checkfns_local.h
+ ${name}_checkfns_local.c
+**********************************************************************
+
diff --git a/local/mib2c.mfd.conf b/local/mib2c.mfd.conf
new file mode 100644
index 0000000..d309ea5
--- /dev/null
+++ b/local/mib2c.mfd.conf
@@ -0,0 +1,32 @@
+############################################################# -*- c -*-
+## top level mfd conf file
+## $Id$
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** START code generated by $RCSfile$ $Revision$ */
+@end@
+########################################################################
+##
+@if "x$mfd_interactive_setup" == "x"@
+@ eval $mfd_interactive_setup = 1@
+@end@
+@if "x$m2c_report_progress" == "x"@
+@ eval $m2c_report_progress = 1@
+@end@
+##
+@ifconf default-mfd-top.m2c@
+@ include default-mfd-top.m2c@
+@end@
+##
+@if $name =~ /Table$/i@
+@else@
+@ print This module can only be used with tables, not branches or entire MIBs.@
+@ print Please specify and OID that is a table. (OID: $name)@
+@ quit@
+@end@
+##
+@run mfd-top.m2c@
+########################################################################
+@if $m2c_mark_boundary == 1@
+/** END code generated by $RCSfile$ $Revision$ */
+@end@
diff --git a/local/mib2c.notify.conf b/local/mib2c.notify.conf
new file mode 100644
index 0000000..77f3330
--- /dev/null
+++ b/local/mib2c.notify.conf
@@ -0,0 +1,85 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/* function declarations */
+@foreach $i notifications@
+int send_${i}_trap(void);
+@end@
+
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}.h"
+
+extern const oid snmptrap_oid[];
+extern const size_t snmptrap_oid_len;
+
+@foreach $i notifications@
+int
+send_${i}_trap( void )
+{
+ netsnmp_variable_list *var_list = NULL;
+ const oid ${i}_oid[] = { $i.commaoid };
+ @foreach $v varbinds@
+ @if $v.isscalar@
+ const oid ${v}_oid[] = { $v.commaoid, 0 };
+ @end@
+ @if !$v.isscalar@
+ const oid ${v}_oid[] = { $v.commaoid, /* insert index here */ };
+ @end@
+ @end@
+
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable(&var_list,
+ snmptrap_oid, snmptrap_oid_len,
+ ASN_OBJECT_ID,
+ ${i}_oid, sizeof(${i}_oid));
+
+ @if count_varbinds($i) > 0@
+ /*
+ * Add any objects from the trap definition
+ */
+ @end@
+ @foreach $v varbinds@
+ snmp_varlist_add_variable(&var_list,
+ ${v}_oid, OID_LENGTH(${v}_oid),
+ $v.type,
+ /* Set an appropriate value for $v */
+ NULL, 0);
+ @end@
+
+ /*
+ * 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;
+}
+@end@
diff --git a/local/mib2c.old-api.conf b/local/mib2c.old-api.conf
new file mode 100644
index 0000000..8fa270b
--- /dev/null
+++ b/local/mib2c.old-api.conf
@@ -0,0 +1,349 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/* function declarations */
+void init_$name(void);
+FindVarMethod var_$name;
+@foreach $i table@
+FindVarMethod var_${i};
+@end@
+@foreach $i scalar@
+ @if $i.settable@
+ WriteMethod write_${i};
+ @end@
+@end@
+@foreach $i table@
+ @foreach $c column@
+ @if $c.settable@
+ WriteMethod write_${c};
+ @end@
+ @end@
+@end@
+
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}.h"
+
+/*
+ * ${name}_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 ${name}_variables_oid[] = { $name.commaoid };
+
+/*
+ * variable4 ${name}_variables:
+ * this variable defines function callbacks and type return information
+ * for the $name mib section
+ */
+
+struct variable4 ${name}_variables[] = {
+/* magic number , variable type , ro/rw , callback fn , L, oidsuffix */
+@eval $magic = 0@
+@eval $namelen = length("$name.commaoid")@
+@foreach $i scalar@
+ @eval $magic = $magic + 1@
+ @eval $suffix = substr("$i.commaoid", $namelen + 1)@
+ @eval $suffixlen = $i.oidlength - $name.oidlength@
+#define $i.uc $magic
+ @if $i.settable@
+{$i.uc, $i.type, NETSNMP_OLDAPI_RWRITE,
+ var_${name}, $suffixlen, { $suffix }},
+ @end@
+ @if !$i.settable@
+{$i.uc, $i.type, NETSNMP_OLDAPI_RONLY,
+ var_${name}, $suffixlen, { $suffix }},
+ @end@
+@end@
+
+@foreach $i table@
+ @eval $magic = 0@
+ @eval $nlen2 = length("$i.commaoid")@
+ @if $nlen2 > $namelen@
+ @eval $suffix = substr("$i.commaoid", $namelen + 1)@
+ @eval $ctmp = ","@
+ @else@
+ @eval $suffix = ""@
+ @eval $ctmp = ""@
+ @end@
+ @eval $suffixlen = $i.oidlength - $name.oidlength + 2@
+ @foreach $c column@
+ @eval $magic = $magic + 1@
+#define $c.uc $magic
+ @if $c.settable@
+{$c.uc, $c.type, NETSNMP_OLDAPI_RWRITE,
+ var_${i}, $suffixlen, { $suffix $ctmp 1, $c.subid }},
+ @end@
+ @if !$c.settable@
+{$c.uc, $c.type, NETSNMP_OLDAPI_RONLY,
+ var_${i}, $suffixlen, { $suffix $ctmp 1, $c.subid }},
+ @end@
+ @end@
+@end@
+};
+/* (L = length of the oidsuffix) */
+
+
+/** Initializes the $name module */
+void
+init_$name(void)
+{
+
+ DEBUGMSGTL(("$name", "Initializing\n"));
+
+ /* register ourselves with the agent to handle our mib tree */
+ REGISTER_MIB("$name", ${name}_variables, variable4,
+ ${name}_variables_oid);
+
+ /* place any other initialization junk you need here */
+}
+
+/*
+ * var_$name():
+ * This function is called every time the agent gets a request for
+ * a scalar variable that might be found within your mib section
+ * registered above. It is up to you to do the right thing and
+ * return the correct value.
+ * You should also correct the value of "var_len" if necessary.
+ *
+ * Please see the documentation for more information about writing
+ * module extensions, and check out the examples in the examples
+ * and mibII directories.
+ */
+unsigned char *
+var_$name(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 u_long ulong_ret;
+ static unsigned char string[SPRINT_MAX_LEN];
+ static oid objid[MAX_OID_LEN];
+ static struct counter64 c64;
+
+ 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.
+ */
+ switch(vp->magic) {
+@foreach $i scalar@
+ case $i.uc:
+ @if $i.settable@
+ *write_method = write_${i};
+ @end@
+ VAR = VALUE; /* XXX */
+ return (u_char*) &VAR;
+@end@
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+@foreach $i table@
+/*
+ * var_$i():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_$name above.
+ */
+unsigned char *
+var_$i(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 u_long ulong_ret;
+ static unsigned char string[SPRINT_MAX_LEN];
+ static oid objid[MAX_OID_LEN];
+ static struct counter64 c64;
+
+ /*
+ * This assumes that the table is a 'simple' table.
+ * See the implementation documentation for the meaning of this.
+ * You will need to provide the correct value for the TABLE_SIZE parameter
+ *
+ * If this table does not meet the requirements for a simple table,
+ * you will need to provide the replacement code yourself.
+ * Mib2c is not smart enough to write this for you.
+ * Again, see the implementation documentation for what is required.
+ */
+ if (header_simple_table(vp,name,length,exact,var_len,write_method, TABLE_SIZE)
+ == MATCH_FAILED )
+ return NULL;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch(vp->magic) {
+@foreach $c column@
+ case $c.uc:
+ @if $c.settable@
+ *write_method = write_${c};
+ @end@
+ VAR = VALUE; /* XXX */
+ return (u_char*) &VAR;
+@end@
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+@end@
+
+@foreach $i scalar@
+@if $i.settable@
+
+
+int
+write_$i(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)
+{
+ $i.decl value;
+ int size;
+
+ switch ( action ) {
+ case RESERVE1:
+ if (var_val_type != $i.type) {
+ fprintf(stderr, "write to $name not $i.type\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof($i.decl)) {
+ fprintf(stderr,"write to $name: bad length\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ break;
+
+ case RESERVE2:
+ size = var_val_len;
+ value = * ($i.decl *) var_val;
+
+ break;
+
+ case FREE:
+ /* Release any resources that have been allocated */
+ break;
+
+ case ACTION:
+ /*
+ * The variable has been stored in '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
+ */
+ break;
+
+ case UNDO:
+ /* Back out any changes made in the ACTION case */
+ 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;
+}
+@end@
+@end@
+
+@foreach $i table@
+@foreach $c column@
+@if $c.settable@
+int
+write_$c(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)
+{
+ $c.decl value;
+ int size;
+
+ switch ( action ) {
+ case RESERVE1:
+ if (var_val_type != $c.type) {
+ fprintf(stderr, "write to $name not $c.type\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof($c.decl)) {
+ fprintf(stderr,"write to $name: bad length\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ break;
+
+ case RESERVE2:
+ size = var_val_len;
+ value = * ($c.decl *) var_val;
+
+ break;
+
+ case FREE:
+ /* Release any resources that have been allocated */
+ break;
+
+ case ACTION:
+ /*
+ * The variable has been stored in '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
+ */
+ break;
+
+ case UNDO:
+ /* Back out any changes made in the ACTION case */
+ 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;
+}
+@end@
+@end@
+@end@
diff --git a/local/mib2c.perl.conf b/local/mib2c.perl.conf
new file mode 100755
index 0000000..3c83a18
--- /dev/null
+++ b/local/mib2c.perl.conf
@@ -0,0 +1,314 @@
+## ########################################################################
+##
+## Config for generating modules for use in the embedded perl environmentg
+##
+## Copyright Tripleplay Services Limited 2005
+## All rights reserved.
+##
+## Use is subject to license terms specified in the COPYING file
+## distributed with the Net-SNMP package.
+##
+## ########################################################################
+##
+## Gotchas.
+## Any $ signs in the output will be snaffled and disappear. For this reason
+## lines that need to output perl variables use a printf line instead
+##
+## Comments that are for the use of documenting this config file
+## need to be double hashes
+##
+## Operation
+## 1. Creates a file called output.tmp which contains the main data structures
+## and a call to the agent startup function.
+## 2. Creates a file called skel.tmp with skeleton accessor functions.
+## This should be copied to functions.pl and edited to actually
+## do the work required for each leaf.
+## 3. Creates an output file with the OID name. This contains the bolierplate
+## and the data structures
+## This is the file to reference in the snmpd.conf file
+##
+## The user must fill in the functions.pl code as requried. This file is then
+## included at run time at the top of the generated perl code
+## (do 'functions.pl)
+##
+## The generated file needs the NetSNMP::agent::Support.pm module in the
+## system. This module contains the run-time support for the agent.
+##
+## The oidtable is a hash of hashes with the top level key an OID
+## There are two types of entry
+## 1. Scalars have the full OID plus the .0 index string
+## 2. Columnar data has the index fields set to 0. The NetSNMP::agent::Support
+## code will use zeros to locate the table specific handlers.
+##
+## #########################################################################
+
+
+## #########################################################################
+## Define the 'macros' used later in this config file
+## #########################################################################
+@define EMIT_INDEX_VARS@
+ ##
+ ## Calculate the number of index identifiers and then
+ ## for each identifier work out the offset in the oid
+ ##
+ @eval $numindex=0@
+ @eval $idxoffset = $c.oidlength@
+ # The values of the oid elements for the indexes
+ @foreach $i index@
+## my $$idx_$i = getOidElement($$idx, $idxoffset);
+ @printf " my %sidx_$vars{'i'} = getOidElement(%soid, $vars{'idxoffset'});\n",$,$@
+ @eval $idxoffset = $idxoffset + 1@
+ @end@
+@enddefine@
+
+@define EMIT_GETARGS@
+ ##
+ ## Output the code the get the args for a function
+ ##
+ # The OID is passed as a NetSNMP::OID object
+ @printf " my (%soid) = shift;\n",$@
+@enddefine@
+
+@define EMIT_LOAD_DATA@
+ ##
+ ## Emit the code to load a data table
+ ##
+ # Load the $t table data
+ load_$t();
+@enddefine@
+
+@define EMIT_INDEX_INFO@
+##
+## Emit a list of indexes for a table as perl comments
+## To be used when generating the comment fields for a handler
+##
+# In Table: $t
+@foreach $i index@
+# Index: $i
+@end@
+@enddefine@
+
+@define EMIT_INDEX_WALKER@
+##
+## Output a skeleton index walker and index checker
+## for the table if it has not been done already
+##
+@if $needwalker@
+## Output skeleton index validator for table
+# -------------------------------------------------------
+# Index validation for table $t
+# Checks the supplied OID is in range
+# Returns 1 if it is and 0 if out of range
+@calldefine EMIT_INDEX_INFO@
+# -------------------------------------------------------
+sub check_$t {
+ @calldefine EMIT_GETARGS@
+
+ @calldefine EMIT_INDEX_VARS@
+
+ @calldefine EMIT_LOAD_DATA@
+
+ # Check the index is in range and valid
+ return 1;
+}
+
+# -------------------------------------------------------
+# Index walker for table $t
+# Given an OID for a table, returns the next OID in range,
+# or if no more OIDs it returns 0.
+@calldefine EMIT_INDEX_INFO@
+# -------------------------------------------------------
+sub next_$t {
+ @calldefine EMIT_GETARGS@
+
+ @calldefine EMIT_INDEX_VARS@
+
+ @calldefine EMIT_LOAD_DATA@
+
+ # Return the next OID if there is one
+ # or return 0 if no more OIDs in this table
+ return 0;
+}
+@eval $needwalker = 0@ ## Dont need this again for the current table
+@end@
+@enddefine@
+
+@define EMIT_TABLE_LOAD@
+# -------------------------------------------------------
+# Loader for table $t
+# Edit this function to load the data needed for $t
+# This function gets called for every request to columnar
+# data in the $t table
+# -------------------------------------------------------
+sub load_$t {
+
+}
+@enddefine@
+
+@eval $date=scalar localtime; @
+
+## Open the output file and emit the perl startup bolierplate
+@open output.tmp@
+#!/usr/bin/perl -w
+#
+#
+# WARNING: DO NOT EDIT THIS FILE BY HAND.
+#
+# This file has been generated by mib2c using the mib2c.perl.conf file
+# This is intended to be used by the net-snmp agent with embedded perl
+# support. See perldoc NetSNMP::agent
+#
+# Created on $date
+#
+# To load this into a running agent with embedded perl support turned
+# on, simply put the following line (without the leading # mark) your
+# snmpd.conf file:
+#
+@printf "# perl do 'path/to/agent_%s.pl'\n",$oid@
+#
+# You will need a copy of NetSNMP installed. This has been developed using
+# NetSNMP version 5.2.2
+#
+
+
+
+##use strict;
+use NetSNMP::agent::Support;
+use NetSNMP::ASN (':all');
+
+# Include the functions to handle the nodes
+do 'functions.pl';
+
+## Create the skeleton file ready for the skeleton handlers later on
+@push@
+@open skel.tmp@
+# Skeleton accessor functions.
+# DO NOT EDIT
+# This file will be overwritten next time mib2c is run.
+# Copy this file to functions.pl and then edit it.
+@close skel.tmp@
+@pop@
+
+## Generate the hash of hashes with the oids and handlers for the tables
+# Hash for all OIDs
+@printf "my %soidtable={\n", $@
+# Table objects
+@foreach $t table@
+ @print Processing table $t@
+ @push@
+ @append skel.tmp@
+## Output skeleton loader for this table
+ @calldefine EMIT_TABLE_LOAD@
+ @close skel.tmp@
+ @pop@
+ ##
+ @eval $needwalker = 1@ ## Need the walker and checker once this table
+ @foreach $c nonindex@
+ @if $c.accessible @
+ ##
+ ## Generate the entry for the hash table
+ ## We first calculate the number of index items for this table
+ @eval $numindex = 0@
+ @eval $idxelem = ""@
+ @foreach $i index@
+ @perleval $vars{'idxelem'} .= '.0'; 0; @
+ @eval $numindex = $numindex+1@
+ @end@
+ "$c.objectID$idxelem"=>{func=>\&get_$c,type=>$c.type, check=>\&check_$t, nextoid=>\&next_$t, istable=>'1', next=>"", numindex=>$numindex},
+ ## Output skeleton handlers for this column object
+ @push@
+ @append skel.tmp@
+@calldefine EMIT_INDEX_WALKER@
+# -------------------------------------------------------
+# Handler for columnar object '$c'
+# OID: $c.objectID
+# Syntax: $c.type
+# From: $c.module
+@calldefine EMIT_INDEX_INFO@
+# -------------------------------------------------------
+sub get_$c {
+ @calldefine EMIT_GETARGS@
+
+ @calldefine EMIT_INDEX_VARS@
+
+ @calldefine EMIT_LOAD_DATA@
+
+ # Code here to read the required variable from the loaded table
+ # using whatever indexing you need.
+ # The index has already been checked and found to be valid
+
+ ## Add further types as required.
+ @if $c.type eq "ASN_INTEGER"@
+ return 32;
+ @end@
+ @if $c.type eq "ASN_OCTET_STR"@
+ return "STR";
+ @end@
+ @if $c.type eq "ASN_COUNTER64"@
+ return 64;
+ @end@
+}
+ @close skel.tmp@
+ @pop@
+ @end@
+ @end@
+@end@
+@print Processing scalars@
+## output the hash with the OIDs and handlers
+## Scalars have a single index element
+# Scalars
+@foreach $s scalar@
+ @if $s.accessible@
+ '$s.objectID.0'=>{func=>\&get_$s,type=>$s.type,next=>"", numindex=>1},
+ @end@
+@end@
+##End of the OID hash
+};
+
+## Emit code to register the top level oid with the agent
+## The $oid variable comes from mib2c as the last non option arg
+# Register the top oid with the agent
+@printf "registerAgent(%sagent, '$oid', %soidtable);",$,$@
+
+## Output skeleton handlers for the scalars
+@push@
+@append skel.tmp@
+@foreach $s scalar@
+ @if $s.accessible@
+# -------------------------------------------------------
+# Handler for scalar object $s
+# OID: $s.objectID
+# Syntax: $s.type
+# From: $s.module
+# -------------------------------------------------------
+sub get_$s {
+
+ # Add code here to read the value required and return it
+
+ ## Add further types as required.
+ @if $s.type eq "ASN_INTEGER"@
+ return 32;
+ @end@
+ @if $s.type eq "ASN_OCTET_STR"@
+ return "STR";
+ @end@
+ @if $s.type eq "ASN_COUNTER64"@
+ return 64;
+ @end@
+}
+ @end@
+@end@
+@close skel.tmp@
+@pop@
+
+@close output.tmp@
+##
+## Now create the code file from the outputfile
+##
+@startperl@
+my $oidname = $vars{'oid'};
+my $out = "agent_" . $oidname .".pl";
+system("cat output.tmp > $out");
+@endperl@
+@print Output code generated.@
+
diff --git a/local/mib2c.raw-table.conf b/local/mib2c.raw-table.conf
new file mode 100644
index 0000000..bd88fdb
--- /dev/null
+++ b/local/mib2c.raw-table.conf
@@ -0,0 +1,612 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id: mib2c.raw-table.conf 17436 2009-03-31 15:12:19Z dts12 $
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+void init_$name(void);
+
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id: mib2c.raw-table.conf 17436 2009-03-31 15:12: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 "${name}.h"
+
+@foreach $i table@
+ ## Determine the first/last column names
+ @eval $first_column = "-"@
+ @eval $last_column = "-"@
+ @foreach $c column@
+ @if $c.readable@
+ @if "$first_column" eq "-"@
+ @eval $first_column = $c@
+ @end@
+ @eval $last_column = $c@
+ @end@
+ @end@
+
+/* column number definitions for table $i */
+ @foreach $c column@
+#define COLUMN_$c.uc $c.subid
+ @end@
+
+ /* Typical data structure for a row entry */
+struct ${i}_entry {
+ /* Index values */
+ @foreach $idx index@
+ @if $idx.needlength@
+ $idx.decl $idx[NNN];
+ size_t ${idx}_len;
+ @else@
+ $idx.decl $idx;
+ @end@
+ @end@
+
+ /* Column values */
+ @foreach $c nonindex@
+ @if $c.readable@
+ @if $c.needlength@
+ $c.decl $c[NNN];
+ size_t ${c}_len;
+ @else@
+ $c.decl $c;
+ @end@
+ @if $c.settable@
+ @if !$c.rowstatus@
+ @if $c.needlength@
+ $c.decl old_$c[NNN];
+ size_t old_${c}_len;
+ @else@
+ $c.decl old_$c;
+ @end@
+ @end@
+ @end@
+ @end@
+ @end@
+
+ int valid;
+};
+
+/* create a new row in the table */
+static struct ${i}_entry *
+${i}_createEntry( int dummy
+ @foreach $idx index@
+ @if $idx.needlength@
+ , $idx.decl* $idx
+ , size_t ${idx}_len
+ @else@
+ , $idx.decl $idx
+ @end@
+ @end@
+ ) {
+ struct ${i}_entry *entry;
+
+ entry = SNMP_MALLOC_TYPEDEF(struct ${i}_entry);
+ if (!entry)
+ return NULL;
+
+ /* XXX - insert entry into local data structure */
+ return entry;
+}
+
+/* remove a row from the table */
+static void
+${i}_removeEntry(struct ${i}_entry *entry) {
+ if (!entry)
+ return; /* Nothing to remove */
+
+ /* XXX - remove entry from local data structure */
+
+ if (entry)
+ SNMP_FREE( entry ); /* XXX - release any other internal resources */
+}
+
+
+/** determine the appropriate row for an exact request */
+static struct ${i}_entry *
+${i}_get_entry( netsnmp_variable_list *indexes ) {
+ struct ${i}_entry *row = NULL;
+
+ /* XXX - Use the 'indexes' parameter to retrieve the data
+ structure for the requested row, and return this. */
+ return row;
+}
+
+/** determine the appropriate row for an fuzzy request */
+static struct ${i}_entry *
+${i}_get_next_entry( netsnmp_handler_registration *reginfo,
+ netsnmp_request_info *request,
+ int column,
+ netsnmp_variable_list *indexes ) {
+ struct ${i}_entry *row = NULL;
+ oid build_space[MAX_OID_LEN];
+ size_t build_space_len = 0;
+ size_t index_oid_len = 0;
+
+ /* XXX - Use the 'indexes' parameter to identify the
+ next row in the table.... */
+
+ /* XXX .... update the 'indexes' parameter with the
+ appropriate index values ... */
+
+ /* ... and update the requested OID to match this instance */
+ memcpy(build_space, reginfo->rootoid, /* registered oid */
+ reginfo->rootoid_len * sizeof(oid));
+ build_space_len = reginfo->rootoid_len;
+ build_space[build_space_len++] = 1; /* entry */
+ build_space[build_space_len++] = column; /* column */
+ build_oid_noalloc(build_space + build_space_len,
+ MAX_OID_LEN - build_space_len, &index_oid_len,
+ NULL, 0, indexes);
+ snmp_set_var_objid(request->requestvb, build_space,
+ build_space_len + index_oid_len);
+
+ /* Finally, return the data structure for this row */
+ return row;
+}
+
+
+/** handles requests for the $i table */
+static int
+${i}_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;
+ struct ${i}_entry *table_entry;
+ @if $i.settable@
+ int ret;
+ @end@
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support
+ */
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = ${i}_get_entry( table_info->indexes );
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.readable@
+ case COLUMN_$c.uc:
+ if ( !table_entry ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ @if $c.needlength@
+ snmp_set_var_typed_value( request->requestvb, $c.type,
+ table_entry->$c,
+ table_entry->${c}_len);
+ @else@
+ snmp_set_var_typed_integer( request->requestvb, $c.type,
+ table_entry->$c);
+ @end@
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ case MODE_GETNEXT:
+ for (request=requests; request; request=request->next) {
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = ${i}_get_next_entry( reginfo, request,
+ table_info->colnum, table_info->indexes );
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.readable@
+ case COLUMN_$c.uc:
+ if ( !table_entry ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ @if $c.needlength@
+ snmp_set_var_typed_value( request->requestvb, $c.type,
+ table_entry->$c,
+ table_entry->${c}_len);
+ @else@
+ snmp_set_var_typed_integer( request->requestvb, $c.type,
+ table_entry->$c);
+ @end@
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+@if $i.settable@
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request=requests; request; request=request->next) {
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = ${i}_get_entry( table_info->indexes );
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ @if $c.rowstatus@
+ ret = netsnmp_check_vb_rowstatus(request->requestvb,
+ (table_entry ? RS_ACTIVE : RS_NONEXISTENT ));
+ @else@
+ @if $c.needlength@
+ /* or possibly 'netsnmp_check_vb_type_and_size' */
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, $c.type, sizeof(table_entry->$c));
+ @else@
+ /* or possibly 'netsnmp_check_vb_int_range' */
+ ret = netsnmp_check_vb_int( request->requestvb );
+ @end@
+ @end@
+ if ( ret != SNMP_ERR_NOERROR ) {
+ netsnmp_set_request_error( reqinfo, request, ret );
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_NOTWRITABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = ${i}_get_entry( table_info->indexes );
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ table_entry = ${i}_createEntry( 0
+ @foreach $idx index@
+ @if $idx.needlength@
+ , table_info->indexes->val.string
+ , table_info->indexes->val_len
+ @else@
+ , *table_info->indexes->val.integer
+ @end@
+ @end@
+ );
+ if ( !table_entry ) {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( !table_entry ) {
+ table_entry = ${i}_createEntry( 0
+ @foreach $idx index@
+ @if $idx.needlength@
+ , table_info->indexes->val.string
+ , table_info->indexes->val_len
+ @else@
+ , *table_info->indexes->val.integer
+ @end@
+ @end@
+ );
+ if ( !table_entry ) {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+@end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_FREE:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = ${i}_get_entry( table_info->indexes );
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (table_entry && !table_entry->valid) {
+ ${i}_removeEntry(table_entry);
+ }
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( table_entry && !table_entry->valid ) {
+ ${i}_removeEntry(table_entry);
+ }
+ break;
+@end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_ACTION:
+ for (request=requests; request; request=request->next) {
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = ${i}_get_entry( table_info->indexes );
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ @if !$c.rowstatus@
+ case COLUMN_$c.uc:
+ @if $c.needlength@
+ memcpy( table_entry->old_$c,
+ table_entry->$c,
+ sizeof(table_entry->$c));
+ table_entry->old_${c}_len =
+ table_entry->${c}_len;
+ memset( table_entry->$c, 0,
+ sizeof(table_entry->$c));
+ memcpy( table_entry->$c,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ table_entry->${c}_len =
+ request->requestvb->val_len;
+ @else@
+ table_entry->old_$c = table_entry->$c;
+ table_entry->$c = *request->requestvb->val.integer;
+ @end@
+ break;
+ @end@
+ @end@
+ @end@
+ }
+ }
+@if $i.rowstatus@
+ /* Check the internal consistency of an active row */
+ for (request=requests; request; request=request->next) {
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = ${i}_get_entry( table_info->indexes );
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ case RS_CREATEANDGO:
+ if (/* XXX */) {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ @end@
+ @end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_UNDO:
+ for (request=requests; request; request=request->next) {
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = ${i}_get_entry( table_info->indexes );
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+@if $i.rowstatus@
+ @if $c.rowstatus@
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (table_entry && !table_entry->valid) {
+ ${i}_removeEntry(table_entry);
+ }
+ }
+ @else@
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ @end@
+@else@
+ @if $c.creatable@
+ if ( table_entry && !table_entry->valid ) {
+ ${i}_removeEntry(table_entry);
+ } else {
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ }
+ @else@
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ @end@
+@end@
+ break;
+ @end@
+ @end@
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ table_info = netsnmp_extract_table_info( request);
+ table_entry = ${i}_get_entry( table_info->indexes );
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ table_entry->valid = 1;
+ /* Fall-through */
+ case RS_ACTIVE:
+ table_entry->$c = RS_ACTIVE;
+ break;
+
+ case RS_CREATEANDWAIT:
+ table_entry->valid = 1;
+ /* Fall-through */
+ case RS_NOTINSERVICE:
+ table_entry->$c = RS_NOTINSERVICE;
+ break;
+
+ case RS_DESTROY:
+ ${i}_removeEntry(table_entry);
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( table_entry && !table_entry->valid ) {
+ table_entry->valid = 1;
+ }
+@end@
+ }
+ }
+@end@
+ break;
+@end@
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/** Initialize the $i table by defining its contents and how it's structured */
+static void
+initialize_table_$i(void)
+{
+ const oid ${i}_oid[] = {$i.commaoid};
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ reg = netsnmp_create_handler_registration(
+ "$i", ${i}_handler,
+ ${i}_oid, OID_LENGTH(${i}_oid),
+@if $i.settable@
+ HANDLER_CAN_RWRITE
+@else@
+ HANDLER_CAN_RONLY
+@end@
+ );
+
+ table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ netsnmp_table_helper_add_indexes(table_info,
+ @foreach $idx index@
+ $idx.type, /* index: $idx */
+ @end@
+ 0);
+
+ table_info->min_column = COLUMN_$first_column.uc;
+ table_info->max_column = COLUMN_$last_column.uc;
+
+ netsnmp_register_table( reg, table_info );
+
+ /* Initialise the contents of the table here */
+}
+
+@end@
+/** Initializes the $name module */
+void
+init_$name(void)
+{
+ /* here we initialize all the tables we're planning on supporting */
+ @foreach $i table@
+ initialize_table_$i();
+ @end@
+}
diff --git a/local/mib2c.row.conf b/local/mib2c.row.conf
new file mode 100755
index 0000000..f736baa
--- /dev/null
+++ b/local/mib2c.row.conf
@@ -0,0 +1,284 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/* function declarations */
+void init_$name(void);
+@foreach $i table@
+void initialize_table_$i(void);
+Netsnmp_Node_Handler ${i}_handler;
+netsnmp_variable_list *${i}_buildIndexList(struct ${i}_entry *row);
+struct ${i}_entry *
+${i}_createEntry(
+ @foreach $idx index@
+ @if $idx.needlength@
+ , $idx.decl* $idx
+ , size_t ${idx}_len
+ @else@
+ , $idx.decl $idx
+ @end@
+ @end@
+ );
+@end@
+@foreach $i table@
+
+/* column number definitions for table $i */
+ @foreach $c column@
+ #define COLUMN_$c.uc $c.subid
+ @end@
+
+
+/* Typical data structure for a row entry */
+struct ${i}_entry {
+ netsnmp_index oid_index;
+
+ /* Index values */
+ @foreach $idx index@
+ @if $idx.needlength@
+ $idx.decl $idx[NNN];
+ size_t ${idx}_len;
+ @else@
+ $idx.decl $idx;
+ @end@
+ @end@
+
+ /* Column values */
+ @foreach $c column@
+ @if $c.readable@
+ @if $c.needlength@
+ $c.decl $c[NNN];
+ size_t ${c}_len;
+ @else@
+ $c.decl $c;
+ @end@
+ @if $c.settable@
+ @if !$c.rowstatus@
+ @if $c.needlength@
+ $c.decl old_$c[NNN];
+ size_t old_${c}_len;
+ @else@
+ $c.decl old_$c;
+ @end@
+ @end@
+ @end@
+ @end@
+ @end@
+
+ int valid;
+};
+
+@end@
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}.h"
+
+/** Initializes the $name module */
+void
+init_$name(void)
+{
+ /* here we initialize all the table rows we're planning on supporting */
+ @foreach $i table@
+ initialize_table_$i();
+ @end@
+}
+
+@foreach $i table@
+ @eval $first_column = "-"@
+ @eval $last_column = "-"@
+ @foreach $c column@
+ @if $c.readable@
+ @if "$first_column" eq "-"@
+ @eval $first_column = $c@
+ @end@
+ @eval $last_column = $c@
+ @end@
+ @end@
+
+/** Initialize an entry in the $i table, including how the table is structured */
+void
+initialize_table_$i(void)
+{
+ const oid ${i}_oid[] = {$i.commaoid};
+ netsnmp_handler_registration *reg;
+ struct ${i}_entry *row;
+ netsnmp_variable_list *idxs;
+ netsnmp_table_registration_info *table_info;
+
+ DEBUGMSGTL(("${name}:init", "initializing table $i\n"));
+
+ reg = netsnmp_create_handler_registration(
+ "$i", ${i}_handler,
+ ${i}_oid, OID_LENGTH(${i}_oid),
+@if $i.settable@
+ HANDLER_CAN_RWRITE
+@else@
+ HANDLER_CAN_RONLY
+@end@
+ );
+
+ table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ netsnmp_table_helper_add_indexes(table_info,
+ @foreach $idx index@
+ $idx.type, /* index: $idx */
+ @end@
+ 0);
+ table_info->min_column = COLUMN_$first_column.uc;
+ table_info->max_column = COLUMN_$last_column.uc;
+
+ /*
+ * Create the row to be registered
+ */
+ row = ${i}_createEntry(
+ @foreach $idx index@
+ @if $idx.needlength@
+ ,/* $idx value */ , /* $idx length */
+ @else@
+ ,/* $idx value */
+ @end@
+ @end@
+ );
+ /*
+ * XXX: Set any other readable column values here
+ */
+ idxs = ${i}_buildIndexList(row);
+ netsnmp_table_row_register( reg, table_info, row, idxs );
+
+ /* Repeat for any other rows to be registered */
+}
+
+/* create a new row in the table */
+struct ${i}_entry *
+${i}_createEntry(
+ @foreach $idx index@
+ @if $idx.needlength@
+ , $idx.decl* $idx
+ , size_t ${idx}_len
+ @else@
+ , $idx.decl $idx
+ @end@
+ @end@
+ ) {
+ struct ${i}_entry *entry;
+
+ entry = SNMP_MALLOC_TYPEDEF(struct ${i}_entry);
+ if (!entry)
+ return NULL;
+
+ @foreach $idx index@
+ @if $idx.needlength@
+ memcpy(entry->$idx, $idx, ${idx}_len);
+ entry->${idx}_len = ${idx}_len;
+ @else@
+ entry->$idx = $idx;
+ @end@
+ @end@
+
+ return entry;
+}
+
+netsnmp_variable_list *
+${i}_buildIndexList(struct ${i}_entry *row)
+{
+ netsnmp_variable_list *v1 = NULL, *v2;
+
+ if (!row)
+ return NULL;
+
+ @eval $first=1@
+ @foreach $idx index@
+ @if $first==1@
+ v1 = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
+ v2 = v1;
+ @else@
+ v2->next_variable = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
+ v2 = v2->next_variable;
+ @end@
+ @if $idx.needlength@
+ snmp_set_var_typed_value( v2, $idx.type, row->$idx, row->${idx}_len);
+ @else@
+ snmp_set_var_typed_integer( v2, $idx.type, row->$idx);
+ @end@
+ @eval $first=0@
+ @end@
+
+ return v1;
+}
+
+/** handles requests for a row of the $i table */
+int
+${i}_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_table_data *table_data;
+ struct ${i}_entry *table_entry;
+ int ret;
+
+ DEBUGMSGTL(("${name}:handler", "Processing request (%d)\n", reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_table_row_extract(request);
+
+ switch (request->requestvb->name[$i.oidlength+1]) {
+ @foreach $c column@
+ @if $c.readable@
+ case COLUMN_$c.uc:
+ @if $c.needlength@
+ snmp_set_var_typed_value( request->requestvb, $c.type,
+ table_entry->$c,
+ table_entry->${c}_len);
+ @else@
+ snmp_set_var_typed_integer( request->requestvb, $c.type,
+ table_entry->$c);
+ @end@
+ break;
+ @end@
+ @end@
+ default:
+ /* An unsupported/unreadable column (if applicable) */
+ snmp_set_var_typed_value( request->requestvb, SNMP_NOSUCHOBJECT,
+ NULL, 0 );
+ }
+ }
+ break;
+
+@if $i.settable@
+ /*
+ * Write-support - TODO
+ */
+@end@
+ break;
+@end@
+ }
+ return SNMP_ERR_NOERROR;
+}
+@end@
diff --git a/local/mib2c.scalar.conf b/local/mib2c.scalar.conf
new file mode 100644
index 0000000..3024fa4
--- /dev/null
+++ b/local/mib2c.scalar.conf
@@ -0,0 +1,142 @@
+## -*- c -*-
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/* function declarations */
+void init_$name(void);
+@foreach $i scalar@
+Netsnmp_Node_Handler handle_${i};
+@end@
+
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}.h"
+
+/** Initializes the $name module */
+void
+init_$name(void)
+{
+ @foreach $i scalar@
+ const oid ${i}_oid[] = { $i.commaoid };
+ @end@
+
+ DEBUGMSGTL(("$name", "Initializing\n"));
+
+ @foreach $i scalar@
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("$i", handle_$i,
+ ${i}_oid, OID_LENGTH(${i}_oid),
+ @if !$i.settable@
+ HANDLER_CAN_RONLY
+ @end@
+ @if $i.settable@
+ HANDLER_CAN_RWRITE
+ @end@
+ ));
+ @end@
+}
+
+@foreach $i scalar@
+int
+handle_$i(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ @if $i.settable@
+ int ret;
+ @end@
+ /* 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, $i.type,
+ /* XXX: a pointer to the scalar's data */,
+ /* XXX: the length of the data in bytes */);
+ break;
+
+ @if $i.settable@
+ /*
+ * 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, $i.type);
+ if ( ret != SNMP_ERR_NOERROR ) {
+ netsnmp_set_request_error(reqinfo, requests, ret );
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* XXX malloc "undo" storage buffer */
+ if (/* XXX if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* XXX: free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* XXX: perform the value change here */
+ if (/* XXX: error? */) {
+ netsnmp_set_request_error(reqinfo, requests, /* some error */);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* XXX: delete temporary storage */
+ if (/* XXX: error? */) {
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ /* XXX: UNDO and return to previous value for the object */
+ if (/* XXX: error? */) {
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ @end@
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_${i}\n", reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+@end@
diff --git a/local/mib2c.table_data.conf b/local/mib2c.table_data.conf
new file mode 100644
index 0000000..2cc665c
--- /dev/null
+++ b/local/mib2c.table_data.conf
@@ -0,0 +1,742 @@
+## -*- c -*-
+#
+@if "$cache" eq "" @
+@open -@
+This framework can work in one of two ways:
+
+ 1) Hold a local cached copy of some external data
+ which is then used to service incoming requests.
+
+ 2) Hold the data for the table solely within the agent
+
+Which is more appropriate for your needs?
+ @prompt $ans Select your choice : @
+ @if $ans == 1 @
+ @eval $cache = 1@
+ @elsif $ans == 2@
+ @eval $cache = 0@
+ @else@
+Invalid answer - generating caching code
+ @eval $cache = 1@
+ @end@
+@else@ # -S cache={something}
+ @if "$cache" ne "1" && "$cache" ne "0" @
+@open -@
+Invalid value for 'cache' ($cache) - generating caching code
+ @eval $cache = 1@
+ @end@
+@end@
+
+######################################################################
+## Do the .h file
+######################################################################
+@open ${name}.h@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+#ifndef $name.uc_H
+#define $name.uc_H
+
+/* function declarations */
+void init_$name(void);
+@foreach $i table@
+void initialize_table_$i(void);
+Netsnmp_Node_Handler ${i}_handler;
+@if "$cache" == 1 @
+NetsnmpCacheLoad ${i}_load;
+NetsnmpCacheFree ${i}_free;
+#define $i.uc_TIMEOUT 60
+@end@
+@end@
+@foreach $i table@
+
+/* column number definitions for table $i */
+ @foreach $c column@
+ #define COLUMN_$c.uc $c.subid
+ @end@
+@end@
+#endif /* $name.uc_H */
+######################################################################
+## Do the .c file
+######################################################################
+@open ${name}.c@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $Id$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "${name}.h"
+
+/** Initializes the $name module */
+void
+init_$name(void)
+{
+ /* here we initialize all the tables we're planning on supporting */
+ @foreach $i table@
+ initialize_table_$i();
+ @end@
+}
+
+@foreach $i table@
+ ## Determine the first/last column names
+ @eval $first_column = "-"@
+ @eval $last_column = "-"@
+ @foreach $c column@
+ @if $c.readable@
+ @if "$first_column" eq "-"@
+ @eval $first_column = $c@
+ @end@
+ @eval $last_column = $c@
+ @end@
+ @end@
+
+/** Initialize the $i table by defining its contents and how it's structured */
+void
+initialize_table_$i(void)
+{
+ const oid ${i}_oid[] = {$i.commaoid};
+ const size_t ${i}_oid_len = OID_LENGTH(${i}_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_tdata *table_data;
+ netsnmp_table_registration_info *table_info;
+@if "$cache" == 1 @
+ netsnmp_cache *cache;
+@end@
+
+ DEBUGMSGTL(("${name}:init", "initializing table $i\n"));
+
+ reg = netsnmp_create_handler_registration(
+ "$i", ${i}_handler,
+ ${i}_oid, ${i}_oid_len,
+@if $i.settable@
+ HANDLER_CAN_RWRITE
+@else@
+ HANDLER_CAN_RONLY
+@end@
+ );
+
+ table_data = netsnmp_tdata_create_table( "$i", 0 );
+ if (NULL == table_data) {
+ snmp_log(LOG_ERR,"error creating tdata table for $i\n");
+ return;
+ }
+@if "$cache" == 1 @
+ cache = netsnmp_cache_create($i.uc_TIMEOUT,
+ ${i}_load, ${i}_free,
+ ${i}_oid, ${i}_oid_len);
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"error creating cache for $i\n");
+ }
+ else
+ cache->magic = (void *)table_data;
+@end@
+ table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,"error creating table info for $i\n");
+ return;
+ }
+ netsnmp_table_helper_add_indexes(table_info,
+ @foreach $idx index@
+ $idx.type, /* index: $idx */
+ @end@
+ 0);
+
+ table_info->min_column = COLUMN_$first_column.uc;
+ table_info->max_column = COLUMN_$last_column.uc;
+
+ netsnmp_tdata_register( reg, table_data, table_info );
+@if "$cache" == 1 @
+ if (cache)
+ netsnmp_inject_handler_before( reg, netsnmp_cache_handler_GET(cache),
+ TABLE_TDATA_NAME);
+@end@
+
+ /* Initialise the contents of the table here */
+}
+
+ /* Typical data structure for a row entry */
+struct ${i}_entry {
+ /* Index values */
+ @foreach $idx index@
+ @if $idx.needlength@
+ $idx.decl $idx[NNN];
+ size_t ${idx}_len;
+ @else@
+ $idx.decl $idx;
+ @end@
+ @end@
+
+ /* Column values */
+ @foreach $c column@
+ @if $c.readable@
+ @if $c.needlength@
+ $c.decl $c[NNN];
+ size_t ${c}_len;
+ @else@
+ $c.decl $c;
+ @end@
+ @if $c.settable@
+ @if !$c.rowstatus@
+ @if $c.needlength@
+ $c.decl old_$c[NNN];
+ size_t old_${c}_len;
+ @else@
+ $c.decl old_$c;
+ @end@
+ @end@
+ @end@
+ @end@
+ @end@
+
+ int valid;
+};
+
+/* create a new row in the table */
+netsnmp_tdata_row *
+${i}_createEntry(netsnmp_tdata *table_data
+ @foreach $idx index@
+ @if $idx.needlength@
+ , $idx.decl* $idx
+ , size_t ${idx}_len
+ @else@
+ , $idx.decl $idx
+ @end@
+ @end@
+ ) {
+ struct ${i}_entry *entry;
+ netsnmp_tdata_row *row;
+
+ entry = SNMP_MALLOC_TYPEDEF(struct ${i}_entry);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+
+ DEBUGMSGT(("${i}:entry:create", "row 0x%x\n", (uintptr_t)row));
+ @foreach $idx index@
+ @if $idx.needlength@
+ memcpy(entry->$idx, $idx, ${idx}_len);
+ entry->${idx}_len = ${idx}_len;
+ netsnmp_tdata_row_add_index( row, $idx.type,
+ entry->$idx, ${idx}_len);
+ @else@
+ entry->$idx = $idx;
+ netsnmp_tdata_row_add_index( row, $idx.type,
+ &(entry->$idx),
+ sizeof(entry->$idx));
+ @end@
+ @end@
+ if (table_data)
+ netsnmp_tdata_add_row( table_data, row );
+ return row;
+}
+
+/* remove a row from the table */
+void
+${i}_removeEntry(netsnmp_tdata *table_data,
+ netsnmp_tdata_row *row) {
+ struct ${i}_entry *entry;
+
+ if (!row)
+ return; /* Nothing to remove */
+
+ DEBUGMSGT(("${i}:entry:remove", "row 0x%x\n", (uintptr_t)row));
+
+ entry = (struct ${i}_entry *)row->data;
+ SNMP_FREE( entry ); /* XXX - release any other internal resources */
+
+ if (table_data)
+ netsnmp_tdata_remove_and_delete_row( table_data, row );
+ else
+ netsnmp_tdata_delete_row( row );
+}
+
+@if "$cache" == 1 @
+/* Example cache handling - set up table_data list from a suitable file */
+int
+${i}_load( netsnmp_cache *cache, void *vmagic ) {
+ netsnmp_tdata *table = (netsnmp_tdata *)vmagic;
+ netsnmp_tdata_row *row;
+ struct ${i}_entry *this;
+ FILE *fp;
+ char buf[STRMAX];
+ @foreach $idx index@
+ @if $idx.needlength@
+ $idx.decl* $idx;
+ size_t ${idx}_len;
+ @else@
+ $idx.decl $idx;
+ @end@
+ @end@
+
+ /* The basic load routine template assumes that the data to
+ be reported is held in a file - with one row of the file
+ for each row of the table.
+ If your data is available via a different API, you
+ should amend this initial block (and the control of the
+ 'while' loop) accordingly.
+ 'XXX' marks places where the template is incomplete and
+ code will definitely need to be added. */
+
+ fp = fopen( "/data/for/${i}", "r" );
+ if ( !fp ) {
+ return -1;
+ }
+ while ( fgets( buf, STRMAX, fp )) {
+ /* XXX - Unpick 'buf' to extract the individual field values
+ (or at least the index values for this row) ... */
+ row = ${i}_createEntry(table
+ @foreach $idx index@
+ @if $idx.needlength@
+ , $idx
+ , ${idx}_len
+ @else@
+ , $idx
+ @end@
+ @end@
+ );
+ if (row == NULL)
+ continue;
+ this = (struct ${i}_entry *)row->entry;
+ /* XXX - ... and then populate the 'this' data structure with
+ column values (typically) extracted from 'buf' above */
+ }
+ fclose(fp);
+ return 0; /* OK */
+}
+
+void
+${i}_free( netsnmp_cache *cache, void *vmagic ) {
+ netsnmp_tdata *table = (netsnmp_tdata *)vmagic;
+ netsnmp_tdata_row *this;
+
+ while ((this = netsnmp_tdata_get_first_row(table))) {
+ netsnmp_tdata_remove_and_delete_row(table, this);
+ }
+}
+@end@
+
+/** handles requests for the $i table */
+int
+${i}_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_tdata *table_data;
+ netsnmp_tdata_row *table_row;
+ struct ${i}_entry *table_entry;
+ int ret;
+
+ DEBUGMSGTL(("${name}:handler", "Processing request (%d)\n", reqinfo->mode));
+
+ 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 = (struct ${i}_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.readable@
+ case COLUMN_$c.uc:
+ if ( !table_entry ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ @if $c.needlength@
+ snmp_set_var_typed_value( request->requestvb, $c.type,
+ table_entry->$c,
+ table_entry->${c}_len);
+ @else@
+ snmp_set_var_typed_integer( request->requestvb, $c.type,
+ table_entry->$c);
+ @end@
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+@if $i.settable@
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+
+ table_entry = (struct ${i}_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+ @if $c.rowstatus@
+ ret = netsnmp_check_vb_rowstatus(request->requestvb,
+ (table_entry ? RS_ACTIVE : RS_NONEXISTENT ));
+ @else@
+ @if $c.needlength@
+ /* or possibly 'netsnmp_check_vb_type_and_size' */
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, $c.type, sizeof(table_entry->$c));
+ @else@
+ /* or possibly 'netsnmp_check_vb_int_range' */
+ ret = netsnmp_check_vb_int( request->requestvb );
+ @end@
+ @end@
+ if ( ret != SNMP_ERR_NOERROR ) {
+ netsnmp_set_request_error( reqinfo, request, ret );
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ @end@
+ @end@
+ default:
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_NOTWRITABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+
+ table_row = netsnmp_tdata_extract_row( request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ table_row = ${i}_createEntry(table_data
+ @foreach $idx index@
+ @if $idx.needlength@
+ , table_info->indexes->val.string
+ , table_info->indexes->val_len
+ @else@
+ , *table_info->indexes->val.integer
+ @end@
+ @end@
+ );
+ if (table_row) {
+ netsnmp_insert_tdata_row( request, table_row );
+ } else {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( !table_row ) {
+ table_row = ${i}_createEntry(table_data
+ @foreach $idx index@
+ @if $idx.needlength@
+ , table_info->indexes->val.string
+ , table_info->indexes->val_len
+ @else@
+ , *table_info->indexes->val.integer
+ @end@
+ @end@
+ );
+ if (table_row) {
+ netsnmp_insert_tdata_row( request, table_row );
+ } else {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+@end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_FREE:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+
+ table_entry = (struct ${i}_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_row = netsnmp_tdata_extract_row( request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (table_entry && !table_entry->valid) {
+ ${i}_removeEntry(table_data, table_row );
+ }
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( table_entry && !table_entry->valid ) {
+ ${i}_removeEntry(table_data, table_row );
+ }
+ break;
+@end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_ACTION:
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+
+ table_entry = (struct ${i}_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ @if !$c.rowstatus@
+ case COLUMN_$c.uc:
+ @if $c.needlength@
+ memcpy( table_entry->old_$c,
+ table_entry->$c,
+ sizeof(table_entry->$c));
+ table_entry->old_${c}_len =
+ table_entry->${c}_len;
+ memset( table_entry->$c, 0,
+ sizeof(table_entry->$c));
+ memcpy( table_entry->$c,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ table_entry->${c}_len =
+ request->requestvb->val_len;
+ @else@
+ table_entry->old_$c = table_entry->$c;
+ table_entry->$c = *request->requestvb->val.integer;
+ @end@
+ break;
+ @end@
+ @end@
+ @end@
+ }
+ }
+@if $i.rowstatus@
+ /* Check the internal consistency of an active row */
+ for (request=requests; request; request=request->next) {
+ table_entry = (struct ${i}_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ case RS_CREATEANDGO:
+ if (/* XXX */) {
+ netsnmp_set_request_error( reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE );
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ @end@
+ @end@
+ }
+ }
+@end@
+ break;
+
+ case MODE_SET_UNDO:
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+
+ table_entry = (struct ${i}_entry *)
+ netsnmp_tdata_extract_entry(request);
+ table_row = netsnmp_tdata_extract_row( request);
+ table_data = netsnmp_tdata_extract_table(request);
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+ @foreach $c column@
+ @if $c.settable@
+ case COLUMN_$c.uc:
+@if $i.rowstatus@
+ @if $c.rowstatus@
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (table_entry && !table_entry->valid) {
+ ${i}_removeEntry(table_data, table_row );
+ }
+ }
+ @else@
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ @end@
+@else@
+ @if $c.creatable@
+ if ( table_entry && !table_entry->valid ) {
+ ${i}_removeEntry(table_data, table_row );
+ } else {
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ }
+ @else@
+ @if $c.needlength@
+ memcpy( table_entry->$c,
+ table_entry->old_$c,
+ sizeof(table_entry->$c));
+ memset( table_entry->old_$c, 0,
+ sizeof(table_entry->$c));
+ table_entry->${c}_len =
+ table_entry->old_${c}_len;
+ @else@
+ table_entry->$c = table_entry->old_$c;
+ table_entry->old_$c = 0;
+ @end@
+ @end@
+@end@
+ break;
+ @end@
+ @end@
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+@if $i.creatable@
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+
+ table_entry = (struct ${i}_entry *)
+ netsnmp_tdata_extract_entry(request);
+@if $i.rowstatus@
+ table_row = netsnmp_tdata_extract_row( request);
+ table_data = netsnmp_tdata_extract_table(request);
+@end@
+ table_info = netsnmp_extract_table_info( request);
+
+ switch (table_info->colnum) {
+@if $i.rowstatus@
+ @foreach $c column@
+ @if $c.rowstatus@
+ case COLUMN_$c.uc:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ table_entry->valid = 1;
+ /* Fall-through */
+ case RS_ACTIVE:
+ table_entry->$c = RS_ACTIVE;
+ break;
+
+ case RS_CREATEANDWAIT:
+ table_entry->valid = 1;
+ /* Fall-through */
+ case RS_NOTINSERVICE:
+ table_entry->$c = RS_NOTINSERVICE;
+ break;
+
+ case RS_DESTROY:
+ ${i}_removeEntry(table_data, table_row );
+ }
+ @end@
+ @end@
+@else@
+ @foreach $c column@
+ @if $c.creatable@
+ case COLUMN_$c.uc:
+ @end@
+ @end@
+ if ( table_entry && !table_entry->valid ) {
+ table_entry->valid = 1;
+ }
+@end@
+ }
+ }
+@end@
+ break;
+@end@
+ }
+ return SNMP_ERR_NOERROR;
+}
+@end@
diff --git a/local/minimalist/feature-check b/local/minimalist/feature-check
new file mode 100755
index 0000000..aa4987e
--- /dev/null
+++ b/local/minimalist/feature-check
@@ -0,0 +1,126 @@
+#!/bin/sh
+
+#
+# feature-check: This script looks for feature statements in a file by
+# executing a compiler under CPP and extracting lines of the following
+# form:
+#
+# netsnmp_feature_provides(foo): used to indicate it provides feature "foo"
+# netsnmp_feature_require(bar): used to indicate it requires feature "bar"
+# netsnmp_feature_want(bar): used to indicate it wants feature "bar"
+# (but can live without it)
+#
+# Using these lines it then generates a list of feature requirement
+# defines in "include/net-snmp/net-snmp-features.h" which can then be
+# loaded in later passes at compile time.
+#
+# Defines produced when netsnmp_featre_require(bar) is present:
+# #define NETSNMP_FEATURE_REQUIRE_BAR 1
+#
+# Defines produced when netsnmp_feature_want(bar) is present:
+# #define NETSNMP_FEATURE_WANT_BAR 1
+#
+# And when all the features have been collected, they are also inverted via
+# the feature-post-check script:
+#
+# #define NETSNMP_FEATURE_REMOVE_BARX 1 /* never required */
+# #undef NETSNMP_FEATURE_REMOVE_BAR /* required */
+
+# Usage:
+
+# feature-check NORMAL-COMPILE-LINE
+
+SED=sed
+GREP=grep
+CC=gcc
+RM=rm
+
+if test "x$1" = "x--feature-global" ; then
+ # a global file should be included
+ shift
+ global=$1
+ shift
+fi
+
+sourcedir=$1
+shift
+
+source=$1
+shift
+
+destination=$1
+shift
+
+tmpf="$destination.1"
+
+compileline="$@"
+$compileline '-DNETSNMP_FEATURE_CHECKING=1' \
+ '-DNETSNMP_MINIMAL_CODE=1' \
+ '-Dnetsnmp_feature_require(X)=X NSF_RR' \
+ '-Dnetsnmp_feature_provide(X)=X NSF_PP' \
+ '-Dnetsnmp_feature_child_of(X,Y)=X,Y NSF_CO' \
+ '-Dnetsnmp_feature_want(X)=X NSF_WW' $source | \
+ $GREP NSF_ | $GREP -v '^#define' > $tmpf
+
+$RM -f $destination;
+touch $destination;
+
+# process requires
+firstrequire=1
+for i in `grep NSF_RR $tmpf | sed 's/ NSF_RR//'` ; do
+ if test $firstrequire = 1 ; then
+ echo "" >> $destination
+ echo "/* required by $sourcedir/$source */" >> $destination
+ firstrequire=0
+ fi
+ upper=`echo $i | tr a-z A-Z`
+ echo "#define NETSNMP_FEATURE_REQUIRE_$upper 1" >> $destination
+done
+
+# process provides
+firstfeature=1
+for i in `grep NSF_PP $tmpf | sed 's/ NSF_PP//'` ; do
+ if test $firstfeature = 1 ; then
+ echo "" >> $destination
+ echo "/* features provided by $sourcedir/$source */" >> $destination
+ firstfeature=0
+ fi
+ upper=`echo $i | tr a-z A-Z`
+ echo "#define NETSNMP_FEATURE_PROVIDE_$upper 1" >> $destination
+done
+
+# process children
+firstfeature=1
+for i in `grep NSF_CO $tmpf | sed 's/ NSF_CO//'` ; do
+ parent=`echo $i | sed 's/.*,//'`
+ child=`echo $i | sed 's/,.*//'`
+ if test $firstfeature = 1 ; then
+ echo "" >> $destination
+ echo "/* features provided by $sourcedir/$source */" >> $destination
+ firstfeature=0
+ fi
+ upperchild=`echo $child | tr a-z A-Z`
+ upperparent=`echo $parent | tr a-z A-Z`
+ echo "#define NETSNMP_FEATURE_${upperchild}_CHILD_OF_${upperparent} 1" >> $destination
+ echo "#define NETSNMP_FEATURE_PROVIDE_$upperchild 1" >> $destination
+done
+
+# process wants
+firstfeature=1
+for i in `grep NSF_WW $tmpf | sed 's/ NSF_WW//'` ; do
+ if test $firstfeature = 1 ; then
+ echo "" >> $destination
+ echo "/* features wanted by $sourcedir/$source */" >> $destination
+ firstfeature=0
+ fi
+ upper=`echo $i | tr a-z A-Z`
+ echo "#define NETSNMP_FEATURE_WANT_$upper 1" >> $destination
+done
+
+if test "x$global" != "x" ; then
+ cat $destination >> $global
+fi
+
+
+# clean up
+#$RM -f $tmpf
diff --git a/local/minimalist/feature-makedocs b/local/minimalist/feature-makedocs
new file mode 100644
index 0000000..f960191
--- /dev/null
+++ b/local/minimalist/feature-makedocs
@@ -0,0 +1,221 @@
+#!/usr/bin/perl
+
+use strict;
+use IO::File;
+use Getopt::Std;
+our %opts = (W => 2);
+
+getopts('ohwW:', \%opts) || usage();
+
+usage() if ($opts{'h'});
+
+usage() if ($#ARGV != 1);
+
+# should be the feature-details.h file
+my $inputfile = shift @ARGV;
+my $outputfile = shift @ARGV;
+
+my %features;
+my %top;
+my %files;
+my $reqfile;
+
+gather_data($inputfile);
+if ($opts{'w'}) {
+ print_wiki_mode($outputfile);
+} else {
+ print_org_mode($outputfile);
+}
+
+sub gather_data {
+ my ($inputfile) = @_;
+
+ open(I, $inputfile);
+ while(<I>) {
+ if (/(required|provided|wanted) by (.*) \*/) {
+ $reqfile = $2;
+ } elsif (/define NETSNMP_FEATURE_PROVIDE_(.*) 1/) {
+ my $lc = lc($1);
+ die "no reqfile currently set; bug!" if (!defined($reqfile));
+
+ add($lc);
+
+ push @{$files{$reqfile}{'provides'}}, $lc;
+ push @{$features{$lc}{'providedby'}}, $reqfile;
+
+ } elsif (/define NETSNMP_FEATURE_REQUIRE_(.*) 1/) {
+ my $lc = lc($1);
+ die "no reqfile currently set; bug!" if (!defined($reqfile));
+
+ add($lc);
+
+ push @{$files{$reqfile}{'requires'}}, $lc;
+ push @{$features{$lc}{'requiredby'}}, $reqfile;
+
+ } elsif (/define NETSNMP_FEATURE_WANT_(.*) 1/) {
+ my $lc = lc($1);
+ die "no reqfile currently set; bug!" if (!defined($reqfile));
+
+ add($lc);
+
+ push @{$files{$reqfile}{'wants'}}, $lc;
+ push @{$features{$lc}{'wantedby'}}, $reqfile;
+ } elsif (/define NETSNMP_FEATURE_(.*)_CHILD_OF_(.*) 1/) {
+ my $child = lc($1);
+ my $parent = lc($2);
+
+ add_child($child, $parent);
+ }
+ }
+}
+
+sub add {
+ my ($name) = @_;
+ if (!exists($features{$name})) {
+ # new feature entirely, mark it as a top node
+ $top{$name} = 1;
+ }
+}
+
+sub add_child {
+ my ($child, $parent) = @_;
+
+ add($parent);
+
+ if (exists($top{$child})) {
+ # it's no longer a top node if it's a child of something else
+ delete $top{$child};
+ }
+ $features{$parent}{'children'}{$child}++;
+
+ $features{$child}{'providedby'}, $reqfile;
+}
+
+######################################################################
+# org-mode output
+#
+sub print_org_mode {
+ my ($outputfile) = @_;
+
+ my $fh = new IO::File;
+
+ if (!$fh->open("> $outputfile")) {
+ die "error!\n";
+ }
+
+ foreach my $node (sort keys(%top)) {
+ print_org_node($fh, $node, "*");
+ }
+}
+
+sub print_org_node {
+ my ($fh, $node, $prefix) = @_;
+
+ my $spaces = $prefix;
+ $spaces =~ s/./ /g;
+
+ print $fh "$prefix $node\n";
+ if (exists($features{$node}{'providedby'})) {
+ print $fh "$spaces + provided in file: " .
+ join(", ", org_link_files(@{$features{$node}{'providedby'}})) . "\n";
+ }
+ if (exists($features{$node}{'requiredby'})) {
+ print $fh "$spaces + required in file: " .
+ join(", ", org_link_files(@{$features{$node}{'requiredby'}})) . "\n";
+ }
+ if (exists($features{$node}{'wantedby'})) {
+ print $fh "$spaces + wanted in file: " .
+ join(", ", org_link_files(@{$features{$node}{'wantedby'}})) . "\n";
+ }
+ if (exists($features{$node}{'children'})) {
+ foreach my $child (sort keys(%{$features{$node}{'children'}})) {
+ print_org_node($fh, $child, $prefix . "*");
+ }
+ }
+}
+
+sub org_link_files {
+ my @files = @_;
+ map { $_ = "[[file:$_][$_]]"; } @files;
+ return @files;
+}
+
+######################################################################
+# wiki output
+#
+sub print_wiki_mode {
+ my ($outputfile) = @_;
+
+ my $fh = new IO::File;
+ my $depth = 0;
+
+ if (!$fh->open("> $outputfile")) {
+ die "error!\n";
+ }
+
+ print $fh "'''The contents of this page is auto-generated from local/minimalist/feature-makedocs; do not edit by hand (changes will be lost)'''\n\n";
+ print $fh "Details of the feature marking system and how it is used can be found at [[Feature Marking and Selection]]\n\n";
+
+ foreach my $node (sort keys(%top)) {
+ print_wiki_node($fh, $node, $depth+1);
+ }
+}
+
+sub print_wiki_node {
+ my ($fh, $node, $depth) = @_;
+
+ my $dataheader;
+ my $depthincrease = 1;
+
+ if ($depth > $opts{'W'}) {
+ print $fh "*" x ($depth - $opts{'W'} + 1) . " $node\n";
+ $dataheader = "*" x ($depth - $opts{'W'} + 2);
+ $depthincrease++;
+ } else {
+ print $fh "=" x $depth . " $node " . "=" x $depth . "\n";
+ $dataheader = "*";
+ }
+
+ if (exists($features{$node}{'providedby'})) {
+ print $fh "$dataheader provided in file: " .
+ join(", ", wiki_link_files(@{$features{$node}{'providedby'}})) ."\n";
+ }
+ if (exists($features{$node}{'requiredby'})) {
+ print $fh "$dataheader required in file: " .
+ join(", ", wiki_link_files(@{$features{$node}{'requiredby'}})) ."\n";
+ }
+ if (exists($features{$node}{'wantedby'})) {
+ print $fh "$dataheader wanted in file: " .
+ join(", ", wiki_link_files(@{$features{$node}{'wantedby'}})) . "\n";
+ }
+ if (exists($features{$node}{'children'})) {
+ if ($depth >= $opts{'W'}) {
+ print $fh "$dataheader Children:\n";
+ }
+ foreach my $child (sort keys(%{$features{$node}{'children'}})) {
+ print_wiki_node($fh, $child, $depth + $depthincrease);
+ }
+ }
+}
+
+sub wiki_link_files {
+ my @files = @_;
+ map { $_ = "[http://net-snmp.svn.sourceforge.net/viewvc/net-snmp/trunk/net-snmp/$_?view=markup $_]"; } @files;
+ return @files;
+}
+
+######################################################################
+# help output
+#
+sub usage {
+ print "Usage: $0 [FLAGS] INPUTFILE OUTPUTFILE\n\n";
+ print "FLAGS:\n";
+ print "\t-h\thelp\n";
+ print "\t-o\tOutput style: Org-Mode [default]\n";
+ print "\t-w\tOutput style: wiki\n";
+ print "\t-W DEPTH\tWiki header to bullet list depth (default 2)\n";
+ print "\nINPUT/OUTPUT\n";
+ print "\tINPUTFILE:\tlocation of the include/net-snmp/feature-details.h file\n";
+ print "\tOUTPUTFILE:\tthe file to write the results to\n";
+ exit;
+}
diff --git a/local/minimalist/feature-remove b/local/minimalist/feature-remove
new file mode 100755
index 0000000..aae340d
--- /dev/null
+++ b/local/minimalist/feature-remove
@@ -0,0 +1,128 @@
+#!/bin/sh
+
+#
+# feature-remove: removes features by defining special variables
+# indicating particular code segments are unneeded. This is done by
+# examining the list of provided features and defining a REMOVE
+# equivalent if no other module required it.
+#
+# Arguments:
+# feature-remove mainheader.h globalheader.h THEREST
+#
+# Where THEREST are a list of features to remove (default) or add.
+#
+# --add switches to "adding" and --remove switches back.
+#
+# E.G.
+# feature-remove mainheader.h globalheader.h oid_stash --add container_null
+#
+CP=cp
+
+featureheader="$1"
+featureheaderin="$1.in"
+featureheaderglobal="$2"
+shift
+shift
+
+argumenttype="--remove"
+removethese=""
+addthese=""
+
+while test "x$1" != "x" ; do
+ uc=`echo $1 | tr a-z A-Z`
+ case $1 in
+ --*)
+ argumenttype="$1"
+ ;;
+
+ *)
+ if test "x$argumenttype" = "x--remove" ; then
+ removethese="$removethese $uc"
+ else
+ addthese="$addthese $uc"
+ fi
+ ;;
+ esac
+ shift
+done
+
+echo "" > $featureheader
+echo "/* The following defines features that Net-SNMP HAS or has REMOVEd */" >> $featureheader
+
+haslist=" "
+
+for i in `grep NETSNMP_FEATURE_PROVIDE_ $featureheaderin | sed 's/.*FEATURE_PROVIDE_//;s/ .*//'` ; do
+ #
+ # If we were specifically asked to include it, then do so
+ #
+ if echo " $addthese " | grep " ${i} " > /dev/null ; then
+ # The user required it ; report we're using it
+ echo "#define NETSNMP_FEATURE_HAS_$i 1" >> $featureheader
+ haslist="${haslist}${i} "
+
+ #
+ # check to see if something requried it
+ #
+ elif grep "NETSNMP_FEATURE_REQUIRE_${i} " $featureheaderglobal > /dev/null ; then
+ # if so, make sure we weren't asked to remove it
+ if echo " $removethese "| grep " $i " > /dev/null ; then
+ # Uh oh; they specifically wanted it removed but it was required
+ echo "Feature Error:"
+ echo " Feature '$i' was asked to be removed but something required it"
+ echo " See the $featureheaderglobal file for dependency details"
+ echo ""
+ rm -f $featureheader
+ exit 1
+ fi
+
+ # something required it ; report we're using it
+ echo "#define NETSNMP_FEATURE_HAS_$i 1" >> $featureheader
+ haslist="${haslist}${i} "
+
+ #
+ # check to see if something "wanted" it
+ #
+ elif grep "NETSNMP_FEATURE_WANT_${i} " $featureheaderglobal > /dev/null ; then
+ # nothing required it, but something "wanted" it
+
+ # check to make sure we weren't asked to exclude it
+ if echo " $removethese " | grep " $i " > /dev/null ; then
+ # we were specifically asked *not* to use this feature
+ echo "#define NETSNMP_FEATURE_REMOVE_$i 1" >> $featureheader
+ else
+ # something wanted it, so we'll include it
+ echo "#define NETSNMP_FEATURE_HAS_$i 1" >> $featureheader
+ haslist="${haslist}${i} "
+ fi
+
+
+ #
+ # check to see if something required a parent
+ #
+ elif egrep NETSNMP_FEATURE_${i}_CHILD_OF $featureheaderglobal > /dev/null ; then
+ parentnames=`egrep NETSNMP_FEATURE_${i}_CHILD_OF $featureheaderglobal | sed 's/.*CHILD_OF_//;s/ .*//;'`
+
+ foundone=0
+ for parentname in $parentnames ; do
+ # if the parent was desired, then we are too:
+
+ if test $foundone = 0 ; then
+ if egrep "NETSNMP_FEATURE_HAS_${parentname} " $featureheader > /dev/null ; then
+ echo "#define NETSNMP_FEATURE_HAS_$i 1" >> $featureheader
+ haslist="${haslist}${i} "
+ foundone=1
+ fi
+ fi
+ done
+ if test $foundone = 0 ; then
+ echo "#define NETSNMP_FEATURE_REMOVE_$i 1" >> $featureheader
+ fi
+
+ #
+ # no one required or wanted it -- it is safe to remove it
+ #
+ else
+ echo "#define NETSNMP_FEATURE_REMOVE_$i 1" >> $featureheader
+ fi
+done
+
diff --git a/local/minimalist/find-unused-code b/local/minimalist/find-unused-code
new file mode 100755
index 0000000..89e3c8c
--- /dev/null
+++ b/local/minimalist/find-unused-code
@@ -0,0 +1,117 @@
+#!/usr/bin/perl
+
+# searches for .o files in the current directory and examines each for
+# defined functions (T) and undefined references (U) and lists
+# anything that isn't required by something else or itself
+
+# useful calling sorted by file:
+# perl minimal/find-unused-code | sort
+
+use File::Find;
+use Data::Dumper;
+use strict;
+use Getopt::GUI::Long;
+
+my %opts;
+
+LocalGetOptions(\%opts,
+ ['g|grep', "run find/grep to look for string usages"],
+ );
+
+my (@files, %defined, %lookingfor);
+
+find(\&dot_os, ".");
+
+foreach my $file (@files) {
+ collect_from_file($file);
+}
+
+
+if ($#ARGV > -1) {
+ print "Dumping found symbol usages:\n\n";
+ foreach my $arg (@ARGV) {
+ print "$arg:\n";
+ print " ", join("\n ", @{$defined{$arg}{'usages'}}),"\n\n";
+ }
+ exit;
+}
+
+foreach my $function (sort { $defined{$a}{'source'} cmp $defined{$b}{'source'} } keys(%defined)) {
+ if (exists($defined{$function}{'source'}) &&
+ !exists($defined{$function}{'usages'})) {
+ if (check_for_once_only($defined{$function}{'source'}, $function)) {
+ printf("%-38s %-38s\n", $defined{$function}{'source'}, $function);
+ if ($opts{'g'}) {
+ open(P,"find . -regex '.*.\\(c\\|xs\\)' | xargs grep -n $function|");
+ while(<P>) {
+ print " $_";
+ }
+ close(P);
+ print "\n";
+ }
+ }
+ }
+}
+
+sub dot_os {
+ return if (!/\.o$/);
+ return if ($File::Find::name =~ /\/.libs\//);
+# return if ($File::Find::name =~ /\/(perl|python)\//);
+ push @files, $File::Find::name;
+}
+
+sub collect_from_file {
+ my $file = shift;
+# print "searching $file\n";
+ open(I,"nm $file|");
+ while(<I>) {
+ $defined{$1}{'source'} = $file if (/ T (.*)/);
+ push @{$defined{$1}{'usages'}}, $file if (/ U (.*)/);
+ }
+ close(I);
+}
+
+sub check_for_once_only {
+ my ($file, $function) = @_;
+ $file =~ s/\.o/.c/;
+ open(I, $file);
+ my $usages = 0;
+ while(<I>) {
+ if (/$function/) {
+ $usages++;
+ }
+ if ($usages > 1) {
+ close(I);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+
+sub LocalGetOptions {
+ if (eval {require Getopt::GUI::Long;}) {
+ import Getopt::GUI::Long;
+ # optional configure call
+ Getopt::GUI::Long::Configure(qw(display_help no_ignore_case capture_output no_gui allow_zero));
+ return GetOptions(@_);
+ }
+ require Getopt::Long;
+ import Getopt::Long;
+ # optional configure call
+ Getopt::Long::Configure(qw(display_help no_ignore_case capture_output));
+ GetOptions(LocalOptionsMap(@_));
+}
+
+sub LocalOptionsMap {
+ my ($st, $cb, @opts) = ((ref($_[0]) eq 'HASH')
+ ? (1, 1, $_[0]) : (0, 2));
+ for (my $i = $st; $i <= $#_; $i += $cb) {
+ if ($_[$i]) {
+ next if (ref($_[$i]) eq 'ARRAY' && $_[$i][0] =~ /^GUI:/);
+ push @opts, ((ref($_[$i]) eq 'ARRAY') ? $_[$i][0] : $_[$i]);
+ push @opts, $_[$i+1] if ($cb == 2);
+ }
+ }
+ return @opts;
+}
diff --git a/local/minimalist/ignore.regexp b/local/minimalist/ignore.regexp
new file mode 100644
index 0000000..e09b99c
--- /dev/null
+++ b/local/minimalist/ignore.regexp
@@ -0,0 +1,4 @@
+~$
+#$
+\/.#
+\/.svn\/
diff --git a/local/minimalist/remove-unneeded-modules b/local/minimalist/remove-unneeded-modules
new file mode 100755
index 0000000..ad45954
--- /dev/null
+++ b/local/minimalist/remove-unneeded-modules
@@ -0,0 +1,130 @@
+#!/bin/perl
+
+# steps:
+# 1) run configure
+# 2) perl local/minimalist/remove-unneeded-modules
+# 3) make depend
+# 4) make
+
+use File::Find;
+use Data::Dumper;
+use strict;
+
+my %exceptions = qw(
+ agent/mibgroup/mibdefs.h 1
+ agent/mibgroup/struct.h 1
+ agent/mibgroup/agentx/protocol.h 1
+ agent/mibgroup/agentx/agentx_config.h 1
+ agent/mibgroup/agentx/subagent.h 1
+ agent/mibgroup/mib_module_includes.h 1
+ agent/mibgroup/mib_module_inits.h 1
+ agent/mibgroup/mib_module_dot_conf.h 1
+ agent/mibgroup/mib_module_shutdown.h 1
+ agent/mibgroup/agent_module_includes.h 1
+ agent/mibgroup/agent_module_inits.h 1
+ agent/mibgroup/agent_module_dot_conf.h 1
+ agent/mibgroup/agent_module_shutdown.h 1
+ agent/mibgroup/mibII/vacm_conf.c 1
+ agent/mibgroup/snmpv3/usmConf.c 1
+ agent/mibgroup/utilities/iquery.c 1
+ agent/mibgroup/mibII/vacm_conf.h 1
+ agent/mibgroup/snmpv3/usmConf.h 1
+ agent/mibgroup/utilities/iquery.h 1
+ agent/mibgroup/util_funcs/MIB_STATS_CACHE_TIMEOUT.h 1
+ agent/mibgroup/host_res.h 1
+ agent/mibgroup/hr_filesys.h 1
+ agent/mibgroup/if-mib/ifTable/ifTable_defs.h 1
+ agent/mibgroup/ifTable_defs.h 1
+ agent/mibgroup/mibII/mibII_common.h 1
+ agent/mibgroup/mnttypes.h 1
+ agent/mibgroup/utilities/execute.h 1
+);
+
+my %opts;
+
+LocalGetOptions(\%opts,
+ ['n|dry-run', "Dry-run, just say what you would do"],
+ ['v|verbose', "Show what files are being left too"],
+ );
+
+my $inputMakefile = $ARGV[0] || "agent/mibgroup/Makefile";
+my $inputDir = $ARGV[1] || "agent/mibgroup";
+
+my $collecting = 0;
+my (%files, @files);
+
+open(I, $inputMakefile);
+while(<I>) {
+ if (/mib_module_list_c=/) {
+ $collecting = 1;
+ } elsif ($collecting) {
+ if (! /\\\s*$/) {
+ $collecting = 0;
+ }
+ chomp();
+ s/\\//;
+ s/\s*//g;
+ s/\.c//;
+ push @files, "agent/mibgroup/$_";
+ $files{"agent/mibgroup/$_.c"} = 1;
+ $files{"agent/mibgroup/$_.h"} = 1;
+ }
+}
+
+find(\&remove_files, $inputDir);
+
+sub remove_files {
+ return if (!/\.[ch]$/);
+ return if (/\.h$/); # XXX: we need to delete headers eventually too
+ return if (/_constants.h/);
+ return if (exists($exceptions{$File::Find::name}));
+
+ if (!exists($files{$File::Find::name})) {
+ Unlink($_, $File::Find::name);
+ } elsif ($opts{'v'}) {
+ print "Leaving $File::Find::name\n";
+ }
+}
+
+sub Unlink {
+ my ($file, $fullfile) = @_;
+ print "Removing $fullfile\n";
+ if (!$opts{'n'}) {
+ unlink($file);
+ if (-f "$file") {
+ print "*** FAILED to remove $file\n";
+ }
+ }
+}
+
+
+sub LocalGetOptions {
+ if (eval {require Getopt::GUI::Long;}) {
+ import Getopt::GUI::Long;
+ # optional configure call
+ my @gopts = qw(no_ignore_case no_gui allow_zero);
+ if ($Getopt::GUI::Long::VERSION > 0.2) {
+ push @gopts, qw(display_help capture_output);
+ }
+ Getopt::GUI::Long::Configure(@gopts);
+ return GetOptions(@_);
+ }
+ require Getopt::Long;
+ import Getopt::Long;
+ # optional configure call
+ Getopt::Long::Configure(qw(display_help no_ignore_case capture_output));
+ GetOptions(LocalOptionsMap(@_));
+}
+
+sub LocalOptionsMap {
+ my ($st, $cb, @opts) = ((ref($_[0]) eq 'HASH')
+ ? (1, 1, $_[0]) : (0, 2));
+ for (my $i = $st; $i <= $#_; $i += $cb) {
+ if ($_[$i]) {
+ next if (ref($_[$i]) eq 'ARRAY' && $_[$i][0] =~ /^GUI:/);
+ push @opts, ((ref($_[$i]) eq 'ARRAY') ? $_[$i][0] : $_[$i]);
+ push @opts, $_[$i+1] if ($cb == 2);
+ }
+ }
+ return @opts;
+}
diff --git a/local/minimalist/removeifdefcode.pl b/local/minimalist/removeifdefcode.pl
new file mode 100755
index 0000000..5a64c05
--- /dev/null
+++ b/local/minimalist/removeifdefcode.pl
@@ -0,0 +1,333 @@
+#! /usr/bin/perl
+
+use strict;
+use File::Copy;
+use File::Basename;
+use IO::File;
+use Getopt::Std;
+
+my $ID_NOREAD = "NETSNMP_NO_READ_SUPPORT";
+my $ID_NOWRITE = "NETSNMP_NO_WRITE_SUPPORT";
+# my $ID_MIN = "NETSNMP_MINIMAL_CODE";
+
+my($ST_OFF, $ST_IF, $ST_ELSE, $ST_IFN, $ST_ELSEN) =
+ ("off", "if", "else", "ifnot", "elsenot");
+
+my %opts = ();
+my %thash = ();
+my $canwrite = 1; # current write state
+
+my($appname,$apppath) = fileparse($0);
+
+my $minimal_include_path = "include/net-snmp/net-snmp-features.h";
+
+
+if ( (!getopts("rwmi:v",\%opts)) || (1 != $#ARGV) ) {
+ print "$appname [options] from-directory to-direpctory\n";
+ print "-r parse out code unneeded by $ID_NOREAD ifdef\n";
+ print "-w parse out code unneeded by $ID_NOWRITE ifdef (DEFAULT)\n";
+ print "-m parse out code unneeded according minimalist ifdefs\n";
+ print " requires from-directory to be the top of the net-snmp tree\n";
+ print " (This is multiple ifdefs auto selected depending\n";
+ print " on the net-snmp source configuration)\n\n";
+ print "-i 'ignore-file' file of files to ignore (not copy)\n";
+ print "-v print verbose info to standard out\n";
+ die "Error: two command line arguments required\n";
+}
+
+#default to everything
+if ( (!exists $opts{r}) && (!exists $opts{w}) && (!exists $opts{m}) ) {
+ $thash{"$ID_NOWRITE"} = "$ST_OFF";
+}
+else {
+ $thash{"$ID_NOREAD"} = "$ST_OFF" if ( exists $opts{r} );
+ $thash{"$ID_NOWRITE"} = "$ST_OFF" if ( exists $opts{w} );
+}
+
+my $fromdir = $ARGV[0];
+my $todir = $ARGV[1];
+
+if ( !(-e $fromdir) ) {
+ die "Error: $appname: from directory does not exist: '$fromdir'\n";
+}
+if ( !(-d $fromdir) ) {
+ die "Error: $appname: from directory, '$fromdir', must be a directory\n";
+}
+
+if ( exists $opts{m} ) {
+ load_minamal_ifdefs();
+}
+
+# create search string from tags
+# minimal must be done before this
+my $search = join "|", (keys %thash);
+
+
+# check for and load ignore file
+my $igstring = "";
+if ( exists $opts{i} ) {
+ open my($IH), "< $opts{i}" or
+ die "Could not open ignore-file '$opts{i}': $!";
+ my @iglist = <$IH>;
+ $IH->close();
+ chomp @iglist;
+ $igstring = join "|", @iglist;
+ $igstring = "(" . $igstring . ")";
+ print "ignore string: \'$igstring\'\n" if (exists $opts{v});
+}
+
+
+
+if ( -e $todir ) {
+ if ( ((-d $fromdir) && !(-d $todir)) ||
+ (!(-d $fromdir) && (-d $todir)) ) {
+ die "Error: $appname: from-directory and to-directory must both either be a file or both be a directory\n";
+ }
+}
+else {
+ if (-d $fromdir) {
+ print "Warning: $appname: '$todir' does not exist, creating\n";
+ mkdir "$todir" or
+ die "Error: $appname: Unable to create to-directory '$todir': $!\n";
+ }
+}
+
+if (-d $fromdir) {
+ parsedirectory($fromdir, $todir);
+}
+else {
+ parsefile($fromdir, $todir);
+}
+
+
+
+exit(0);
+
+
+# PROCEDURES PROCEDURES PROCEDURES PROCEDURES PROCEDURES
+
+
+sub parsedirectory {
+ my($fdir, $tdir) = @_;
+
+ my @ldirs = ();
+ my $DH;
+ opendir my($DH), $fdir or die "Could not open directory '$fdir': $!";
+ if ( !(-e $tdir) || !(-d $tdir) ) {
+ mkdir $tdir or die "Could not create directory '$tdir': $!";
+ }
+ my @flist = readdir $DH;
+ closedir $DH;
+ # remove . and ..
+ @flist = grep (! /(^\.$|^\.\.$)/ , @flist);
+
+ while (my $name = shift @flist) {
+ if (-d "$fdir/$name") {
+ push @ldirs, "$name";
+ }
+ else {
+ parsefile("$fdir/$name", "$tdir/$name");
+ }
+ }
+
+ while (my $name = shift @ldirs) {
+ parsedirectory("$fdir/$name", "$tdir/$name")
+ }
+
+} # parsedirectory
+
+
+# returns 1 if current state for tag is write, 0 otherwise
+sub iswritestate {
+ my $tag = "";
+
+ foreach $tag (keys %thash) {
+ if ( ($thash{$tag} eq "$ST_ELSE") ||
+ ($thash{$tag} eq "$ST_IFN") ) {
+ return(0);
+ }
+ }
+
+ return(1);
+} # iswritestate
+
+
+# Check $line for ifdef state changes for all of the tags and change
+# state.
+# If there is a state change error return 0, otherwise return 1;
+
+sub checkifdef {
+ my($TF, $line, $fromfilename) = @_;
+
+ if ( $line =~ /(#ifdef|#ifndef|#else|#endif).*($search)(\s|$|\*)/ ) {
+ my $copt = $1;
+ my $tag = $2;
+
+ if ( $copt eq "#ifdef" ) {
+ if ($thash{"$tag"} eq "$ST_OFF") {
+ $thash{"$tag"} = "$ST_IF";
+ print "state change $tag: $ST_OFF -> $ST_IF\n" if (exists $opts{v});
+ $canwrite = iswritestate();
+ }
+ else {
+ print "Error: $fromfilename: Found '#ifdef $tag' with state $thash{$tag}\n";
+ return 0;
+ }
+ }
+ elsif ( $copt eq "#ifndef" ) {
+ if ($thash{"$tag"} eq "$ST_OFF") {
+ # before changing to a non-write state (ifn) print #IFNDEF
+ # line, if current state is a write state.
+ print $TF "$line" if ( $canwrite );
+ $thash{"$tag"} = "$ST_IFN";
+ print "state change $tag: $ST_OFF -> $ST_IFN\n" if (exists $opts{v});
+ $canwrite = iswritestate();
+ }
+ else {
+ print "Error: $fromfilename: Found '#ifndef $tag' with state $thash{$tag}\n";
+ return 0;
+ }
+ }
+ elsif ( $copt eq "#else" ) {
+ if ($thash{"$tag"} eq "$ST_IF") {
+ # before changing to a non-write state (else) print #else
+ # line, if current state is a write state.
+ print $TF "$line" if ( $canwrite );
+ $thash{"$tag"} = "$ST_ELSE";
+ print "state change $tag: $ST_IF -> $ST_ELSE\n" if (exists $opts{v});
+ $canwrite = iswritestate();
+ }
+ elsif ($thash{"$tag"} eq "$ST_IFN") {
+ $thash{"$tag"} = "$ST_ELSEN";
+ print "state change $tag: $ST_IFN -> $ST_ELSEN\n" if (exists $opts{v});
+ $canwrite = iswritestate();
+ }
+ else {
+ print "Error: $fromfilename: Found '#else (...) $tag' with state $thash{$tag}\n";
+ return 0;
+ }
+ }
+ elsif ( $copt eq "#endif" ) {
+ if (($thash{"$tag"} eq "$ST_ELSE") || ($thash{"$tag"} eq "$ST_IF") ||
+ ($thash{"$tag"} eq "$ST_ELSEN") || ($thash{"$tag"} eq "$ST_IFN"))
+ {
+ print "state change $tag: $thash{$tag} -> $ST_OFF\n"
+ if (exists $opts{v});
+ $thash{"$tag"} = "$ST_OFF";
+ $canwrite = iswritestate();
+ }
+ else {
+ print "Error: Found '#endif (...) $tag' with state $thash{$tag}\n";
+ return 0;
+ }
+ }
+
+ } # foreach tag
+
+ return 1;
+} # checkifdef
+
+
+sub parsefile {
+ my($fname, $tname) = @_;
+ my $FF; my $TF;
+ my @fromfile = ();
+ $canwrite = 1;
+
+ # ignore file for file names
+ if ( (exists $opts{i}) && ("$fname" =~ /$igstring/) ) {
+ print "IGNORING $fname\n" if ( exists $opts{v} );
+ return 1;
+ }
+
+ print "Info: Opening '$fname'\n" if ( exists $opts{v} );
+ if ( !(open($FF, "< $fname")) ) {
+ print "Warning: unable to open input file, skipping: '$fname': $!\n";
+ return 0;
+ }
+
+ my @fromfile = <$FF>;
+ $FF->close();
+
+ if ( !(open($TF, "> $tname")) ) {
+ print "Warning: unable to open output file, skipping: '$tname': $!\n";
+ return 0;
+ }
+ my $mode = (stat("$fname"))[2];
+ if ($mode) { my $resp = chmod $mode, "$tname"; }
+
+ my $line = "";
+ my @tout = ();
+ my $retval = 1;
+
+ while ( $line = shift @fromfile ) {
+ # check for any ifdef state changes
+ if ( ! checkifdef($TF, $line, $fname) ) {
+ $FF->close();
+ $TF->close();
+ die "Error: tag error in file \'$fname\', exiting\n";
+ }
+
+ if ( $canwrite ) {
+ print $TF "$line";
+ }
+ else {
+ print "Info: not copying: $fname: $line" if ( exists $opts{v} );
+ }
+
+ }
+
+ if (! $canwrite) {
+ print "End of $fname reached and we're not reset into 'canwrite' state\n";
+ }
+ $TF->close();
+
+ return $retval;
+} # parsefile
+
+
+# note, fromdir should have already been checked to exist and be a
+# directory
+sub load_minamal_ifdefs {
+ my @filelist = ();
+ my $MF;
+
+ if ( !(open($MF, "< $fromdir/$minimal_include_path")) ) {
+ die "Unable to open main minimal feature file: '$fromdir/$minimal_include_path'\n";
+ }
+ my $line;
+ # skip preceding lines
+ while ( ($line = <$MF>) &&
+ ($line !~ /^#else.*NETSNMP_FEATURE_CHECKING/ ) ) {
+ }
+ # grab the fetaure .h files
+ while ( ($line = <$MF>) &&
+ ($line !~ /^#endif.*NET_SNMP_FEATURE_CHECKING/) ) {
+ if ($line =~ /include.*<(.*.h)>/) {
+ push @filelist, $1;
+ }
+ }
+
+ close($MF);
+
+ while (my $fname = shift @filelist) {
+ if ( !( -e "$fromdir/include/$fname" ) ) {
+ print "Warn: feature file does not exist, skipping: '$fromdir/include/$fname'";
+ next;
+ }
+ if ( !(open($MF, "< $fromdir/include/$fname")) ) {
+ die "Unable to open minimal feature file: '$fromdir/include/$fname'\n";
+ }
+ while ( ($line = <$MF>) ) {
+ if ( $line =~ /^#define.*(NETSNMP_FEATURE_REMOVE[^ ]+) / ) {
+ $thash{"$1"} = $ST_OFF;
+ }
+ }
+ close($MF);
+ }
+
+} # load_minamal_ifdefs
+
+
+
+
diff --git a/local/minimalist/sizetests b/local/minimalist/sizetests
new file mode 100644
index 0000000..4ecd654
--- /dev/null
+++ b/local/minimalist/sizetests
@@ -0,0 +1,359 @@
+#!/usr/bin/perl
+
+use strict;
+use Data::Dumper;
+use Getopt::Std;
+use IO::File;
+our %opts = (d => 'size-tests');
+
+# default arguments go here
+my @sets =
+ ({
+ "with-defaults" => '',
+ });
+
+my %base_args = %{$sets[0]};
+my ($basename, $basenum);
+
+getopts('t:hlcD:nj:o:eb:T', \%opts) || usage();
+
+$opts{'j'} = "-j$opts{j}" if (exists($opts{'j'}));
+
+usage() if ($opts{'h'});
+
+my @argumentsets =
+ (
+ {
+ title => 'security-types',
+ arguments =>
+ {
+ usm => {
+ 'with-security-modules' => 'usm',
+ },
+ dtlsandtls => {
+ 'with-security-modules' => 'tsm',
+ 'with-out-security-modules' => 'usm',
+ 'with-transports' => 'DTLSUDP TLSTCP',
+ 'with-mib-modules' => 'tlstm-mib tsm-mib'
+ },
+ usmanddtlsandtls => {
+ 'with-security-modules' => 'tsm usm',
+ 'with-transports' => 'DTLSUDP TLSTCP',
+ 'with-mib-modules' => 'tlstm-mib tsm-mib'
+ }
+ }
+ },
+ {
+ title => 'minimalist',
+ arguments =>
+ {
+ minimal => {
+ 'enable-minimalist' => '',
+ },
+ 'not-minimal' => {
+ }
+ }
+ },
+ {
+ title => 'mib-loading',
+ arguments =>
+ {
+ 'without-mib-loading' => {
+ 'disable-mib-loading' => '',
+ },
+ 'with-mib-loading' => {
+ }
+ }
+ },
+ {
+ title => 'debugging',
+ arguments =>
+ {
+ 'without-debugging' => {
+ 'disable-debugging' => '',
+ },
+ 'with-debugging' => {
+ }
+ }
+ },
+ {
+ title => 'logging',
+ arguments =>
+ {
+ 'without-logging' => {
+ 'with-out-features' => 'logging',
+ },
+ 'with-logging' => {
+ }
+ }
+ },
+ {
+ title => 'agent-mibs',
+ arguments =>
+ {
+ 'full-agent' => {
+ },
+ 'mini-agent' => {
+ 'enable-mini-agent' => '',
+ }
+ }
+ },
+ {
+ title => 'protocol-support',
+ arguments =>
+ {
+ 'everything' => {
+ },
+ 'read-only' => {
+ 'enable-read-only' => '',
+ },
+ 'notify-only' => {
+ 'enable-notify-only' => '',
+ }
+ }
+ },
+ {
+ title => 'perl',
+ arguments =>
+ {
+ 'without-perl-modules' => {
+ 'without-perl-modules' => '',
+ 'disable-embedded-perl' => '',
+ },
+ 'with-perl-no-embedding' => {
+ 'with-perl-modules' => '',
+ 'disable-embedded-perl' => '',
+ },
+ 'with-perl-and-embedding' => {
+ 'with-perl-modules' => '',
+ 'enable-embedded-perl' => '',
+ }
+ }
+ },
+ );
+
+# map these to a referencable lookup hash
+my %argumentsets;
+foreach my $set (@argumentsets) {
+ $argumentsets{$set->{'title'}} = $set;
+}
+
+if ($opts{'l'}) {
+ print "Types available:\n";
+ printf(" %-40.40s %s\n", "Test Title", "Number of subtests");
+ printf(" %-40.40s %s\n", "-" x 39, "-" x length("Number of subtests"));
+ foreach my $type (@argumentsets) {
+ my @keys = keys(%{$type->{'arguments'}});
+ printf(" %-40.40s %s\n", $type->{'title'}, $#keys+1);
+ }
+ exit;
+}
+
+my %types;
+if ($opts{'t'}) {
+ my @types = split(/,\s*/, $opts{'t'});
+ foreach my $type (@types) {
+ $types{$type} = 1;
+ }
+}
+
+if ($opts{'b'}) {
+ # use this set as the base default set of arguments
+ ($basename, $basenum) = ($opts{'b'} =~ /(.*):(\d+)/);
+ if (!exists($argumentsets{$basename})) {
+ printf STDERR "failed to find set for -b argument: %s\n", $basename;
+ exit(1);
+ }
+ @sets = add_in_flags($argumentsets{$basename}, \%base_args, ());
+ @sets = @sets[$basenum];
+ %base_args = %{$sets[0]};
+}
+
+foreach my $set (@argumentsets) {
+ if (!$opts{'t'} || exists($types{$set->{'title'}})) {
+ if ($basename && $set->{'title'} eq $basename) {
+ next;
+ }
+ @sets = add_in_flags($set, \%base_args, @sets);
+ }
+}
+
+if ($opts{'c'}) {
+ # print the configure flags
+ foreach my $set (@sets) {
+ print "$set->{'title'}:\n";
+ print " ", generate_configure_flags($set), "\n";
+ }
+ exit;
+}
+
+my $summaryfile;
+if ($opts{'o'} && !$opts{'n'}) {
+ $summaryfile = new IO::File;
+ $summaryfile->open(">$opts{o}");
+}
+
+my $count = 0;
+foreach my $set (@sets) {
+ $count++;
+ build_set($count, $set);
+}
+
+sub add_in_flags {
+ my ($argumentset, $base_flags, @current_flags) = @_;
+
+ my @new_flags;
+
+ # do a linear search of the options
+ if (! $opts{'e'}) {
+ @new_flags = @current_flags;
+ foreach my $newargs (keys(%{$argumentset->{'arguments'}})) {
+ my %flags = %$base_flags;
+
+ $flags{'title'} = "$flags{'title'}:$newargs";
+
+ foreach my $newflag (keys(%{$argumentset->{'arguments'}{$newargs}})) {
+
+ $flags{$newflag} .= " $argumentset->{'arguments'}{$newargs}{$newflag}";
+ }
+ push @new_flags, \%flags;
+ }
+ return @new_flags;
+ }
+
+ # or an exponential search
+ foreach my $flags (@current_flags) {
+ foreach my $newargs (keys(%{$argumentset->{'arguments'}})) {
+ my %flags = %{$flags}; # copy the existing hash-set of flags
+
+ if (exists($flags{'title'})) {
+ $flags{'title'} .= ", $newargs";
+ } else {
+ $flags{'title'} .= "$newargs";
+ }
+ foreach my $newflag (keys(%{$argumentset->{'arguments'}{$newargs}})) {
+
+ $flags{$newflag} .= " $argumentset->{'arguments'}{$newargs}{$newflag}";
+ }
+
+ push @new_flags, \%flags;
+ }
+ }
+
+ return @new_flags;
+}
+
+sub generate_configure_flags {
+ my ($arguments) = @_;
+ my $line = "";
+ foreach my $arg (keys(%$arguments)) {
+ next if ($arg eq 'title');
+ if ($arguments->{$arg} =~ /^\s*$/) {
+ $line .= " --$arg";
+ } else {
+ $line .= " --$arg=\"$arguments->{$arg}\"";
+ }
+ }
+ return $line;
+}
+
+sub build_set {
+ my ($num, $arguments) = @_;
+
+ $num = sprintf("%03d", $num);
+
+ my $file;
+
+ if (!$opts{'n'}) {
+ mkdir $opts{'d'} if (! -d $opts{'d'});
+ die "failed to create the $opts{'d'} directory" if (! -d $opts{'d'});
+
+ $file = new IO::File;
+ $file->open(">$opts{'d'}/$num-0-cmd-summary");
+ $file->print("Creating output for: $arguments->{'title'}\n");
+ }
+
+ print "==================== $arguments->{'title'}\n";
+
+
+ System ($file, $num, "1-distclean", "make distclean");
+ System ($file, $num, "2-configure",
+ "./configure " . generate_configure_flags($arguments));
+ System ($file, $num, "3-features", "make features");
+ System ($file, $num, "4-make", "make $opts{'j'}");
+ System ($file, $num, "5-unused-code", "perl local/minimalist/find-unused-code -g");
+ System ($file, $num, "6-testing", "make -C testing test") if ($opts{'T'});
+
+ if (!$opts{'n'}) {
+ analyze_size($arguments->{'title'}, "$opts{'d'}/$num-9-results");
+ }
+}
+
+sub analyze_size {
+ my ($title, $filename) = @_;
+
+ my $outfile = new IO::File;
+ $outfile->open(">$filename");
+
+ print "Results for: $title\n";
+ printf $outfile "Results for: $title\n";
+ printf ("%-50.50s %10s\n", "-" x 49, "-" x 10);
+ printf $outfile ("%-50.50s %10s\n", "-" x 49, "-" x 10);
+
+ my $totalsize = 0;
+ foreach my $buildfile (glob("snmplib/.libs/lib*.so.*.0.0"),
+ glob("agent/.libs/lib*.so.*.0.0"),
+ "agent/.libs/snmpd") {
+
+ my @info = stat($buildfile);
+ printf $outfile ("%-50.50s %10s\n", $buildfile, $info[7]);
+ printf("%-50.50s %10s\n", $buildfile, $info[7]);
+ $totalsize += $info[7];
+ }
+ printf $outfile ("%-50.50s %10s\n", "-" x 49, "-" x 10);
+ printf $outfile ("%-50.50s %10s bytes\n", "TOTAL", $totalsize);
+
+ printf("%-50.50s %10s\n", "-" x 49, "-" x 10);
+ printf("%-50.50s %10s bytes\n", "TOTAL", $totalsize);
+
+ if (defined($summaryfile)) {
+ my $restricted_title = $title;
+ $restricted_title =~ s/[^a-zA-Z]/_/g;
+ printf $summaryfile "%10s %s \n", $totalsize, $title;
+ }
+
+ return $totalsize;
+}
+
+sub usage {
+ print "Usage: $0 [FLAGS]\n\n";
+ print "FLAGS:\n";
+ print " -h\t\thelp\n";
+ print " -t TYPES\tSelect types to analyze (default = all)\n";
+ print " -l\t\tList available types\n";
+ print " -c\t\tPrint the configuration flags that would be used\n";
+ print " -D DIR\tSave data results to this directory\n";
+ print " -o FILE\tSave a complete summary chart to FILE\n";
+ print " -n\t\tDry run -- only show the commands to execute\n";
+ print " -j NUM\tExecute make with parallel building (-jNUM)\n";
+ print " -e\t\tUse exponential expansion (all combos) of the requested options\n";
+ print " -b NAME:NUM\tUse NAME and the NUM'th set as the base arguments to start from\n";
+ print " -T\t\tRun 'make test' at each step as well\n";
+ exit;
+}
+
+sub System {
+ my $file = shift;
+ my $num = shift;
+ my $title = shift;
+ my $pipe = " 2>&1 | tee $opts{'d'}/$num-$title.out\n";
+
+ print "### ", join(" ", @_), $pipe;
+ if (!$opts{'n'} && $file) {
+ print $file "### ", join(" ", @_), "\n";
+ }
+
+ if (!$opts{'n'}) {
+ system(join(" ", @_) . $pipe);
+ }
+}
diff --git a/local/net-snmp-cert b/local/net-snmp-cert
new file mode 100755
index 0000000..a45dc57
--- /dev/null
+++ b/local/net-snmp-cert
@@ -0,0 +1,2690 @@
+#!/usr/bin/perl
+
+use strict;
+use 5.8.0;
+
+use Getopt::Long qw(:config gnu_getopt no_ignore_case pass_through);
+use Cwd qw(getcwd realpath);
+use File::Basename;
+use File::Copy;
+use File::Path;
+use Sys::Hostname;
+use Carp;
+
+our @CC = (
+["AF","AFGHANISTAN"],
+["AX","Ã…LAND ISLANDS"],
+["AL","ALBANIA"],
+["DZ","ALGERIA"],
+["AS","AMERICAN SAMOA"],
+["AD","ANDORRA"],
+["AO","ANGOLA"],
+["AI","ANGUILLA"],
+["AQ","ANTARCTICA"],
+["AG","ANTIGUA AND BARBUDA"],
+["AR","ARGENTINA"],
+["AM","ARMENIA"],
+["AW","ARUBA"],
+["AU","AUSTRALIA"],
+["AT","AUSTRIA"],
+["AZ","AZERBAIJAN"],
+["BS","BAHAMAS"],
+["BH","BAHRAIN"],
+["BD","BANGLADESH"],
+["BB","BARBADOS"],
+["BY","BELARUS"],
+["BE","BELGIUM"],
+["BZ","BELIZE"],
+["BJ","BENIN"],
+["BM","BERMUDA"],
+["BT","BHUTAN"],
+["BO","BOLIVIA, PLURINATIONAL STATE OF"],
+["BA","BOSNIA AND HERZEGOVINA"],
+["BW","BOTSWANA"],
+["BV","BOUVET ISLAND"],
+["BR","BRAZIL"],
+["IO","BRITISH INDIAN OCEAN TERRITORY"],
+["BN","BRUNEI DARUSSALAM"],
+["BG","BULGARIA"],
+["BF","BURKINA FASO"],
+["BI","BURUNDI"],
+["KH","CAMBODIA"],
+["CM","CAMEROON"],
+["CA","CANADA"],
+["CV","CAPE VERDE"],
+["KY","CAYMAN ISLANDS"],
+["CF","CENTRAL AFRICAN REPUBLIC"],
+["TD","CHAD"],
+["CL","CHILE"],
+["CN","CHINA"],
+["CX","CHRISTMAS ISLAND"],
+["CC","COCOS (KEELING) ISLANDS"],
+["CO","COLOMBIA"],
+["KM","COMOROS"],
+["CG","CONGO"],
+["CD","CONGO, THE DEMOCRATIC REPUBLIC OF THE"],
+["CK","COOK ISLANDS"],
+["CR","COSTA RICA"],
+["CI","CÔTE D'IVOIRE"],
+["HR","CROATIA"],
+["CU","CUBA"],
+["CY","CYPRUS"],
+["CZ","CZECH REPUBLIC"],
+["DK","DENMARK"],
+["DJ","DJIBOUTI"],
+["DM","DOMINICA"],
+["DO","DOMINICAN REPUBLIC"],
+["EC","ECUADOR"],
+["EG","EGYPT"],
+["SV","EL SALVADOR"],
+["GQ","EQUATORIAL GUINEA"],
+["ER","ERITREA"],
+["EE","ESTONIA"],
+["ET","ETHIOPIA"],
+["FK","FALKLAND ISLANDS (MALVINAS)"],
+["FO","FAROE ISLANDS"],
+["FJ","FIJI"],
+["FI","FINLAND"],
+["FR","FRANCE"],
+["GF","FRENCH GUIANA"],
+["PF","FRENCH POLYNESIA"],
+["TF","FRENCH SOUTHERN TERRITORIES"],
+["GA","GABON"],
+["GM","GAMBIA"],
+["GE","GEORGIA"],
+["DE","GERMANY"],
+["GH","GHANA"],
+["GI","GIBRALTAR"],
+["GR","GREECE"],
+["GL","GREENLAND"],
+["GD","GRENADA"],
+["GP","GUADELOUPE"],
+["GU","GUAM"],
+["GT","GUATEMALA"],
+["GG","GUERNSEY"],
+["GN","GUINEA"],
+["GW","GUINEA-BISSAU"],
+["GY","GUYANA"],
+["HT","HAITI"],
+["HM","HEARD ISLAND AND MCDONALD ISLANDS"],
+["VA","HOLY SEE (VATICAN CITY STATE)"],
+["HN","HONDURAS"],
+["HK","HONG KONG"],
+["HU","HUNGARY"],
+["IS","ICELAND"],
+["IN","INDIA"],
+["ID","INDONESIA"],
+["IR","IRAN, ISLAMIC REPUBLIC OF"],
+["IQ","IRAQ"],
+["IE","IRELAND"],
+["IM","ISLE OF MAN"],
+["IL","ISRAEL"],
+["IT","ITALY"],
+["JM","JAMAICA"],
+["JP","JAPAN"],
+["JE","JERSEY"],
+["JO","JORDAN"],
+["KZ","KAZAKHSTAN"],
+["KE","KENYA"],
+["KI","KIRIBATI"],
+["KP","KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF"],
+["KR","KOREA, REPUBLIC OF"],
+["KW","KUWAIT"],
+["KG","KYRGYZSTAN"],
+["LA","LAO PEOPLE'S DEMOCRATIC REPUBLIC"],
+["LV","LATVIA"],
+["LB","LEBANON"],
+["LS","LESOTHO"],
+["LR","LIBERIA"],
+["LY","LIBYAN ARAB JAMAHIRIYA"],
+["LI","LIECHTENSTEIN"],
+["LT","LITHUANIA"],
+["LU","LUXEMBOURG"],
+["MO","MACAO"],
+["MK","MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF"],
+["MG","MADAGASCAR"],
+["MW","MALAWI"],
+["MY","MALAYSIA"],
+["MV","MALDIVES"],
+["ML","MALI"],
+["MT","MALTA"],
+["MH","MARSHALL ISLANDS"],
+["MQ","MARTINIQUE"],
+["MR","MAURITANIA"],
+["MU","MAURITIUS"],
+["YT","MAYOTTE"],
+["MX","MEXICO"],
+["FM","MICRONESIA, FEDERATED STATES OF"],
+["MD","MOLDOVA, REPUBLIC OF"],
+["MC","MONACO"],
+["MN","MONGOLIA"],
+["ME","MONTENEGRO"],
+["MS","MONTSERRAT"],
+["MA","MOROCCO"],
+["MZ","MOZAMBIQUE"],
+["MM","MYANMAR"],
+["NA","NAMIBIA"],
+["NR","NAURU"],
+["NP","NEPAL"],
+["NL","NETHERLANDS"],
+["AN","NETHERLANDS ANTILLES"],
+["NC","NEW CALEDONIA"],
+["NZ","NEW ZEALAND"],
+["NI","NICARAGUA"],
+["NE","NIGER"],
+["NG","NIGERIA"],
+["NU","NIUE"],
+["NF","NORFOLK ISLAND"],
+["MP","NORTHERN MARIANA ISLANDS"],
+["NO","NORWAY"],
+["OM","OMAN"],
+["PK","PAKISTAN"],
+["PW","PALAU"],
+["PS","PALESTINIAN TERRITORY, OCCUPIED"],
+["PA","PANAMA"],
+["PG","PAPUA NEW GUINEA"],
+["PY","PARAGUAY"],
+["PE","PERU"],
+["PH","PHILIPPINES"],
+["PN","PITCAIRN"],
+["PL","POLAND"],
+["PT","PORTUGAL"],
+["PR","PUERTO RICO"],
+["QA","QATAR"],
+["RE","RÉUNION"],
+["RO","ROMANIA"],
+["RU","RUSSIAN FEDERATION"],
+["RW","RWANDA"],
+["BL","SAINT BARTHÉLEMY"],
+["SH","SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA"],
+["KN","SAINT KITTS AND NEVIS"],
+["LC","SAINT LUCIA"],
+["MF","SAINT MARTIN"],
+["PM","SAINT PIERRE AND MIQUELON"],
+["VC","SAINT VINCENT AND THE GRENADINES"],
+["WS","SAMOA"],
+["SM","SAN MARINO"],
+["ST","SAO TOME AND PRINCIPE"],
+["SA","SAUDI ARABIA"],
+["SN","SENEGAL"],
+["RS","SERBIA"],
+["SC","SEYCHELLES"],
+["SL","SIERRA LEONE"],
+["SG","SINGAPORE"],
+["SK","SLOVAKIA"],
+["SI","SLOVENIA"],
+["SB","SOLOMON ISLANDS"],
+["SO","SOMALIA"],
+["ZA","SOUTH AFRICA"],
+["GS","SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS"],
+["ES","SPAIN"],
+["LK","SRI LANKA"],
+["SD","SUDAN"],
+["SR","SURINAME"],
+["SJ","SVALBARD AND JAN MAYEN"],
+["SZ","SWAZILAND"],
+["SE","SWEDEN"],
+["CH","SWITZERLAND"],
+["SY","SYRIAN ARAB REPUBLIC"],
+["TW","TAIWAN, PROVINCE OF CHINA"],
+["TJ","TAJIKISTAN"],
+["TZ","TANZANIA, UNITED REPUBLIC OF"],
+["TH","THAILAND"],
+["TL","TIMOR-LESTE"],
+["TG","TOGO"],
+["TK","TOKELAU"],
+["TO","TONGA"],
+["TT","TRINIDAD AND TOBAGO"],
+["TN","TUNISIA"],
+["TR","TURKEY"],
+["TM","TURKMENISTAN"],
+["TC","TURKS AND CAICOS ISLANDS"],
+["TV","TUVALU"],
+["UG","UGANDA"],
+["UA","UKRAINE"],
+["AE","UNITED ARAB EMIRATES"],
+["GB","UNITED KINGDOM"],
+["US","UNITED STATES"],
+["UM","UNITED STATES MINOR OUTLYING ISLANDS"],
+["UY","URUGUAY"],
+["UZ","UZBEKISTAN"],
+["VU","VANUATU"],
+["VE","VENEZUELA, BOLIVARIAN REPUBLIC OF"],
+["VN","VIET NAM"],
+["VG","VIRGIN ISLANDS, BRITISH"],
+["VI","VIRGIN ISLANDS, U.S."],
+["WF","WALLIS AND FUTUNA"],
+["EH","WESTERN SAHARA"],
+["YE","YEMEN"],
+["ZM","ZAMBIA"],
+["ZW","ZIMBABWE"],
+);
+
+package NetSNMP::Term;
+# gratefully taken from Wayne Thompson's Term::Complete
+# if newer CORE modules could be used this could be removed
+our($complete, $exit, $done, $kill, $erase1, $erase2, $tty_raw_noecho, $tty_restore, $stty, $tty_safe_restore);
+our($tty_saved_state) = '';
+CONFIG: {
+ $exit = "\003";
+ $done = "\004";
+ $kill = "\025";
+ $erase1 = "\177";
+ $erase2 = "\010";
+ foreach my $s (qw(/bin/stty /usr/bin/stty)) {
+ if (-x $s) {
+ $tty_raw_noecho = "$s raw -echo";
+ $tty_restore = "$s -raw echo";
+ $tty_safe_restore = $tty_restore;
+ $stty = $s;
+ last;
+ }
+ }
+}
+
+sub Complete {
+ my($prompt, $dflt, $help, $match, @cmp_lst);
+ my (%help, $cmp, $test, $l, @match);
+ my ($return, $r, $exitting) = ("", 0, 0);
+ my $tab;
+
+ $prompt = shift;
+ $dflt = shift;
+ $help = shift;
+ $match = shift;
+
+ if (ref $_[0] and ref($_[0][0])) {
+ @cmp_lst = @{$_[0]};
+ } else {
+ @cmp_lst = @_;
+ }
+ @cmp_lst = map {if (ref($_)) { $help{$_->[0]}=$_->[1]; $_->[0]} else {$_;}} @cmp_lst;
+
+ # Attempt to save the current stty state, to be restored later
+ if (defined $stty && defined $tty_saved_state && $tty_saved_state eq '') {
+ $tty_saved_state = qx($stty -g 2>/dev/null);
+ if ($?) {
+ # stty -g not supported
+ $tty_saved_state = undef;
+ } else {
+ $tty_saved_state =~ s/\s+$//g;
+ $tty_restore = qq($stty "$tty_saved_state" 2>/dev/null);
+ }
+ }
+ system $tty_raw_noecho if defined $tty_raw_noecho;
+ LOOP: {
+ local $_;
+ print($prompt, $return);
+ while (($_ = getc(STDIN)) ne "\r") {
+ CASE: {
+ # (TAB) attempt completion
+ $_ eq "\t" && do {
+ if ($tab) {
+ print(join("\r\n", '', map {exists $help{$_} ? sprintf("\t%-10.10s - %s", $_, $help{$_}) :
+ "\t$_"} grep(/^\Q$return/, @cmp_lst)), "\r\n");
+ $tab--;
+ redo LOOP;
+ }
+ @match = grep(/^\Q$return/, @cmp_lst);
+ unless ($#match < 0) {
+ $l = length($test = shift(@match));
+ foreach $cmp (@match) {
+ until (substr($cmp, 0, $l) eq substr($test, 0, $l)) {
+ $l--;
+ }
+ }
+ print("\a");
+ print($test = substr($test, $r, $l - $r));
+ $r = length($return .= $test);
+ }
+ $tab++;
+ last CASE;
+ };
+
+ # (^C) exit
+ $_ eq $exit && do {
+ print("\r\naborting application...\r\n");
+ $exitting++;
+ undef $return;
+ last LOOP;
+ };
+
+ # (^D) done
+ $_ eq $done && do {
+ undef $return;
+ last LOOP;
+ };
+
+ # (?) show help if available
+ $_ eq '?' && do {
+ print("\r\n$help\r\n");
+ if (exists $help{$return}) {
+ print("\t$return - $help{$return}\r\n");
+ } else {
+ print(join("\r\n", map {exists $help{$_} ? "\t$_ - $help{$_}" :
+ "\t$_"} grep(/^\Q$return/, @cmp_lst)), "\r\n");
+ }
+ redo LOOP;
+ };
+
+ # (^U) kill
+ $_ eq $kill && do {
+ if ($r) {
+ $r = 0;
+ $return = "";
+ print("\r\n");
+ redo LOOP;
+ }
+ last CASE;
+ };
+
+ # (DEL) || (BS) erase
+ ($_ eq $erase1 || $_ eq $erase2) && do {
+ if ($r) {
+ print("\b \b");
+ chop($return);
+ $r--;
+ }
+ last CASE;
+ };
+
+ # printable char
+ ord >= 32 && do {
+ $return .= $_;
+ $r++;
+ print;
+ last CASE;
+ };
+ }
+ }
+
+ if (defined $return) {
+ if (length($return) == 0 or $return eq $dflt) {
+ $return = $dflt;
+ } elsif ($match == $NetSNMP::Cert::MATCH and scalar(grep {/^$return$/} @cmp_lst) != 1 or
+ $match == $NetSNMP::Cert::PREMATCH and scalar(grep {$return=~/$_/} @cmp_lst) != 1) {
+ $r = 0;
+ $return = "";
+ print("\r\nChoose a valid option, or ^D to exit\r\n");
+ redo LOOP;
+ }
+ }
+ }
+ DONE:
+ # system $tty_restore if defined $tty_restore;
+ if (defined $tty_saved_state && defined $tty_restore && defined $tty_safe_restore) {
+ system $tty_restore;
+ if ($?) {
+ # tty_restore caused error
+ system $tty_safe_restore;
+ }
+ }
+
+ exit(1) if $exitting;
+ print("\n");
+ return $return;
+}
+
+package NetSNMP::Cert;
+
+our $VERSION = '0.2.9';
+
+our $PROG = ::basename($0);
+our $DEBUG = 0;
+our $OK = 0;
+our $ERR = -1;
+
+# user input param
+our $MATCH = 1;
+our $PREMATCH = 2;
+
+# Load LWP if possible to import cert from URL
+eval('use LWP::UserAgent;');
+our $haveUserAgent = ($@ ? 0 : 1);
+
+# required executables
+our $OPENSSL = $ENV{NET_SNMP_CRT_OPENSSL} || 'openssl';
+our $CFGTOOL = $ENV{NET_SNMP_CRT_CFGTOOL} || 'net-snmp-config';
+
+# default app config file
+our $CFGFILE = $ENV{NET_SNMP_CRT_CFGFILE} || 'net-snmp-cert.conf';
+
+# default OpenSSL config files
+our $SSLCFGIN = $ENV{NET_SNMP_CRT_SSLCFGIN} || 'openssl.in';
+our $SSLCFGOUT = $ENV{NET_SNMP_CRT_SSLCFGIN} || '.openssl.conf';
+our $SSLCFG = $ENV{NET_SNMP_CRT_SSLCFG};
+
+# default cmd logs
+our $OUTLOG = $ENV{NET_SNMP_CRT_OUTLOG} || '.cmd.out.log';
+our $ERRLOG = $ENV{NET_SNMP_CRT_ERRLOG} || '.cmd.err.log';
+
+# default cert dirs
+our $TLSDIR = $ENV{NET_SNMP_CRT_TLSDIR} || 'tls';
+our $CRTDIR = $ENV{NET_SNMP_CRT_CRTDIR} || 'certs';
+our $NEWCRTDIR = $ENV{NET_SNMP_CRT_NEWCRTDIR}|| 'newcerts';
+our $CADIR = $ENV{NET_SNMP_CRT_CADIR} || 'ca-certs';
+our $PRIVDIR = $ENV{NET_SNMP_CRT_PRIVDIR} || 'private';
+
+our $SERIAL = $ENV{NET_SNMP_CRT_SERIAL} || '.serial';
+our $INDEX = $ENV{NET_SNMP_CRT_INDEX} || '.index';
+
+our $DEFCADAYS = $ENV{NET_SNMP_CRT_DEFCADAYS} || 1825;
+our $DEFCRTDAYS = $ENV{NET_SNMP_CRT_DEFCRTDAYS}|| 365;
+
+our @TLSDIRS = ($CRTDIR, $NEWCRTDIR, $CADIR, $PRIVDIR);
+
+our @CRTSUFFIXES = qw(.pem .csr .der .crt);
+
+our @X509FMTS = qw(text modulus serial subject_hash issuer_hash hash subject
+ purpose issuer startdate enddate dates fingerprint C);
+
+sub dprint {
+ my $str = shift;
+ my $opts = shift;
+ my $dlevel = shift || 1;
+ my $flag = (defined $opts ? int($opts->{'debug'} >= $dlevel) : 1);
+ my ($pkg, $file, $line, $sub) = caller(1);
+ my ($pkg0, $file0, $line0) = caller(0);
+ print("${sub}():$line0: $str") if $flag;
+}
+
+sub dwarn {
+ my $str = shift;
+ my $opts = shift;
+ my $dlevel = shift || 1;
+ my $flag = (defined $opts ? $opts->{'debug'} >= $dlevel : 1);
+ my ($pkg, $file, $line, $sub) = caller(1);
+ my ($pkg0, $file0, $line0) = caller(0);
+ warn("${sub}():$line0: $str") if $flag;
+}
+
+sub vprint {
+ my $str = shift;
+ my $opts = shift;
+ my $flag = (defined $opts ? $opts->{'verbose'} : 1);
+ my $debug = (defined $opts ? $opts->{'debug'} : 1);
+ my ($pkg, $file, $line, $sub) = caller(1);
+ my ($pkg0, $file0, $line0) = caller(0);
+ $str = ($debug ? "${sub}():$line0: $str" : "$str");
+ print("$str") if $flag;
+}
+
+sub vwarn {
+ my $str = shift;
+ my $opts = shift;
+ my $flag = (defined $opts ? $opts->{'verbose'} : 1);
+ my ($pkg, $file, $line, $sub) = caller(1);
+ my ($pkg0, $file0, $line0) = caller(0);
+ warn("${sub}():$line0: $str") if $flag;
+}
+
+sub rsystem {
+ my $cmd = shift;
+ my $flag = shift;
+
+ # if not running as root try to use sudo
+ if ($>) {
+ $cmd = "sudo $flag $cmd";
+ } else {
+ if ($flag =~ /-b/) {
+ $cmd = "$cmd \&";
+ }
+ }
+ die("cmd failed($!): $cmd\n") if system("$cmd");
+}
+
+sub usystem {
+ my $cmd = shift;
+ my $opts = shift;
+ my $ret;
+
+ unlink $NetSNMP::Cert::OUTLOG if -e $NetSNMP::Cert::OUTLOG;
+ unlink $NetSNMP::Cert::ERRLOG if -e $NetSNMP::Cert::ERRLOG;
+
+ $ret = system("$cmd");
+
+ if ($ret) {
+ if ($opts->{'verbose'}) {
+ system("cat $NetSNMP::Cert::OUTLOG") if -r $NetSNMP::Cert::OUTLOG;
+ system("cat $NetSNMP::Cert::ERRLOG") if -r $NetSNMP::Cert::ERRLOG;
+ }
+ die("cmd failed($!): $cmd\n");
+ }
+}
+
+sub home_dir {
+ my $cdir = ::getcwd();
+
+ chdir("~");
+ my $dir = ::getcwd();
+ chdir($cdir);
+
+ return $dir;
+}
+
+sub find_bin_dir {
+ # This code finds the path to the currently invoked program and
+ my $dir;
+
+ $0 =~ m%^(([^/]*)(.*)/)([^/]+)$%;
+ if ($1) {
+ if ($2) {
+ # Invoked using a relative path. CD there and use pwd.
+ $dir = `cd $1 && pwd`;
+ chomp $dir;
+ } else {
+ # Invoked using an absolute path; that's it!
+ $dir = $3;
+ }
+ } else {
+ # No path. Look in PATH for the first instance.
+ foreach my $p (split /:/, $ENV{PATH}) {
+ $p ||= '.';
+ -x "$p/$4" or next;
+ $dir = $p;
+ }
+ }
+ $dir or die "Cannot locate program '$0'!";
+}
+
+sub fq_rel_path {
+ my $path = shift;
+ my $cwd = ::getcwd();
+ my $rdir = shift || $cwd;
+
+ chdir($rdir) or die("can't change directory: $rdir");
+ # get fully qualified path
+ if ($path !~ m|^/|) {
+ my $pwd = `pwd`; chomp $pwd;
+ $path = "$pwd/$path";
+ $path = ::realpath($path) if -e $path;
+ }
+ chdir($cwd) or die("can't change directory: $cwd");
+
+ return $path;
+}
+
+sub dir_empty
+ {
+ my $path = shift;
+ opendir(DIR, $path);
+ foreach (readdir(DIR)) {
+ next if /^\.\.?$/;
+ closedir(DIR);
+ return 0;
+ }
+ closedir(DIR);
+ return 1;
+ }
+
+sub make_dirs {
+ my $opts = shift;
+ my $dir = shift;
+ my $mode = shift;
+ my @dirs = @_;
+
+ my $wd = ::getcwd();
+
+ NetSNMP::Cert::dprint("make dirs [$dir:@dirs] from $wd\n", $opts);
+
+ ::mkpath($dir, $opts->{'debug'}, $mode) or die("error - can't make $dir")
+ if defined $dir and not -d $dir;
+
+ foreach my $subdir (@dirs) {
+ my $d = "$subdir";
+ $d = "$dir/$d" if defined $dir;
+ NetSNMP::Cert::dprint("making directory: $d\n", $opts) unless -d $d;
+ mkdir($d, $mode) or die("error - can't make $d") unless -d $d;
+ }
+}
+
+sub is_url {
+ my $url = shift;
+
+ return $url =~ /^(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[\d]{1,5})?(?#Directories)(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?$/;
+}
+
+sub in_set {
+ my $elem = shift;
+ my $set = shift;
+ for my $e (eval($set)) {
+ return 1 if $e == $elem;
+ }
+ return 0;
+}
+
+sub in_arr {
+ my $elem = shift;
+ my $arr = shift;
+ for my $e (@{$arr}) {
+ return 1 if $e eq $elem;
+ }
+ return 0;
+}
+
+sub map_bool {
+ my $val = shift;
+
+ return 1 if $val =~ /^true$/i;
+ return 0 if $val =~ /^false$/i;
+ return $val;
+}
+
+sub version {
+ my $ret = (@_ ? shift : 1);
+ print "$NetSNMP::Cert::PROG: $NetSNMP::Cert::VERSION\n";
+ exit($ret);
+}
+
+sub GetOptsFromArray {
+ my $args = shift;
+ local *ARGV;
+ @ARGV = @$args;
+ my $ret = ::GetOptions(@_);
+ @$args = @ARGV; # GetOptions strips out the ones it handles and leaves others
+ return $ret;
+}
+sub pull_cmd {
+ my $args = shift;
+ my $cmd;
+
+ foreach (@{$args}) {
+ if (/^(gence?rt|genca|gencsr|signcsr|showcas?|showce?rts?|import)$/) {
+ $cmd = $1;
+ }
+ }
+
+ @{$args} = grep {!/^$cmd$/} @{$args};
+
+ return $cmd;
+}
+
+
+sub usage {
+ my $ret = (@_ ? shift : 1);
+ my $arg = shift;
+
+ print "Command not implmeneted yet: $arg\n" if $ret == 2;
+ print "Unknown: $arg\n" if $ret == 3;
+ print "\n NAME:\n";
+ print " $NetSNMP::Cert::PROG: [$NetSNMP::Cert::VERSION] - ";
+ print "Net-SNMP Certificate Management Tool\n";
+ print "\n DESCRIPTION:\n";
+ print " net-snmp-cert creates, signs, installs and displays X.509\n";
+ print " certificates used in the operation of Net-SNMP/(D)TLS.\n";
+ print "\n SYNOPSIS:\n";
+ print " net-snmp-cert [--help|-?]\n";
+ print " net-snmp-cert [--version|-V]\n";
+ print " net-snmp-cert genca [<flags>] [<dn-opts>] [--with-ca <ca>]\n";
+ print " net-snmp-cert gencert [<flags>] [<dn-opts>] [--with-ca <ca>]\n";
+ print " net-snmp-cert gencsr [<flags>] [<dn-opts>] [--from-crt <crt>]\n";
+ print " net-snmp-cert signcsr [<flags>] [--install] --csr <csr> --with-ca <ca>\n";
+ print " net-snmp-cert showca [<flags>] [<format-opts>] [<file>|<search-tag>]\n";
+ print " net-snmp-cert showcert [<flags>] [<format-opts>] [<file>|<search-tag>]\n";
+ print " net-snmp-cert import [<flags>] <file|url> [<key>]\n";
+ print "\n COMMANDS:\n";
+ print " genca -- generate a signed CA certificate suitable for signing other\n";
+ print " certificates. default: self-signed unless --with-ca <ca> supplied\n\n";
+ print " gencert -- generate a signed certificate suitable for identification, or\n";
+ print " validation. default: self-signed unless --with-ca <ca> supplied\n\n";
+ print " gencsr -- generate a certificate signing request. will create a new\n";
+ print " key and certificate unless --from-crt <crt> supplied\n\n";
+ print " signcsr -- sign a certificate signing request specified by --csr <csr>\n";
+ print " with the CA certificate specified by --with-ca <ca>\n";
+ print " import -- import an identity or CA certificate, optionally import <key>\n";
+ print " if an URL is passed, will attempt to import certificate from site\n";
+ print " showca,\n";
+ print " showcert -- show CA or identity certificate(s). may pass fully qualified\n";
+ print " file or directory name, or a search-tag which prefix matches\n";
+ print " installed CA or identity certificate file name(s)\n";
+ print " see FORMAT OPTIONS to specify output format\n\n";
+ print "\n FLAGS:\n";
+ print " -?, --help -- show this text and exit\n";
+ print " -V, --version -- show version string and exit\n";
+ print " -D, --debug -- raise debug level (-D -D for higher level)\n";
+ print " -F, --force -- force overwrite of existing output files\n";
+ print " -I, --nointeractive -- non-interactive run (default interactive)\n";
+ print " -Q, --noverbose -- non-verbose output (default verbose)\n";
+ print " -C, --cfgdir <dir> -- configuration dir (see man(5) snmp_config)\n";
+ print " -T, --tlsdir <dir> -- root for cert storage (default <cfgdir>/tls)\n";
+ print " -f, --cfgfile <file> -- config (default <cfgdir>/net-snmp-cert.conf)\n";
+ print " -i, --identity <id> -- identity to use from config\n";
+ print " -t, --tag <tag> -- application tag (default 'snmp')\n";
+ print " --<cfg-param>[=<val>] -- additional config params\n";
+ print "\n CERTIFICATE OPTIONS (<cert-opts>):\n";
+ print " -a, --with-ca <ca> -- CA certificate used to sign request\n";
+ print " -A, --ca <ca> -- explicit output CA certificate\n";
+ print " -r, --csr <csr> -- certificate signing request\n";
+ print " -x, --from-crt <crt> -- input certificate for current operation\n";
+ print " -X, --crt <crt> -- explicit output certificate\n";
+ print " -y, --install -- install result in local repository\n";
+ print "\n DISTINGUISHED NAME OPTIONS (<dn-opts>):\n";
+ print " -e, --email <email> -- email name\n";
+ print " -h, --host <host> -- DNS host name, or IP address\n";
+ print " -d, --days <days> -- number of days certificate is valid\n";
+ print " -n, --cn <cn> -- common name (CN)\n";
+ print " -o, --org <org> -- organiztion name\n";
+ print " -u, --unit <unit> -- organiztion unit name\n";
+ print " -c, --country <country> -- country code (e.g., US)\n";
+ print " -p, --province <province> -- province name (synomynous w/ state)\n";
+ print " -p, --state <state> -- state name (synomynous w/ province)\n";
+ print " -l, --locality <locality> -- locality name (e.g, town)\n";
+ print " -s, --san <san> -- subjectAltName, repeat for each <san>\n";
+ print " -- <san> value format (<FMT>:<VAL>):\n";
+ print " -- dirName:/usr/share/snmp/tls\n";
+ print " -- DNS:net-snmp.org\n";
+ print " -- email:admin\@net-snmp.org\n";
+ print " -- IP:192.168.1.1\n";
+ print " -- RID:1.1.3.6\n";
+ print " -- URI:http://net-snmp.org\n";
+ print "\n FORMAT OPTIONS (<format-opts>): \n";
+ print " --brief -- minimized output (values only where applicable)\n";
+ print " --text -- full text description\n";
+ print " --subject -- subject description\n";
+ print " --subject_hash -- hash of subject for indexing\n";
+ print " --issuer -- issuer description\n";
+ print " --issuer_hash -- hash of issuer for indexing\n";
+ print " --fingerprint -- SHA1 digest of DER\n";
+ print " --serial -- serial number\n";
+ print " --modulus -- modulus of the public key\n";
+ print " --dates -- start and end dates\n";
+ print " --purpose -- displays allowed uses\n";
+ print " --C -- C code description\n";
+ print "\n EXAMPLES: \n";
+ print " net-snmp-cert genca --cn ca-net-snmp.org --days 1000\n";
+ print " net-snmp-cert genca -f .snmp/net-snmp-cert.conf -i nocadm -I\n";
+ print " net-snmp-cert gencert -t snmpd --cn host.net-snmp.org\n";
+ print " net-snmp-cert gencsr -t snmpapp\n";
+ print " net-snmp-cert signcsr --csr snmpapp --with-ca ca-net-snmp.org\n";
+ print " net-snmp-cert showcerts --subject --issuer --dates snmpapp\n";
+ print " net-snmp-cert showcas --fingerprint ca-net-snmp.org --brief\n";
+ print " net-snmp-cert import ca-third-party.crt\n";
+ print " net-snmp-cert import signed-request.crt signed-request.key\n\n";
+
+ exit $ret;
+}
+
+sub set_default {
+ my $opts = shift;
+ my $config = shift;
+ my $field = shift;
+ my $val = shift;
+
+ if (not defined $opts->{$field}) {
+ my $cval = $config->inherit($field);
+ $opts->{$field} = (defined $cval ? $cval : $val);
+ }
+}
+
+sub cfg_path {
+ my $path;
+
+ $path = `$NetSNMP::Cert::CFGTOOL --snmpconfpath`;
+ chomp $path;
+ return (wantarray ? split(':', $path) : $path);
+}
+
+sub find_cfgfile {
+ my $dir = shift;
+ my $file = shift;
+
+ if (defined $dir and -d $dir and
+ defined $file and $file !~ /^[\.\/]/) {
+ return fq_rel_path("$dir/$file") if -f "$dir/$file";
+ }
+
+ if (defined $file) {
+ if (-f $file) {
+ return fq_rel_path($file);
+ } else {
+ return $file; # file is not found, complain later
+ }
+ }
+
+ my @path = cfg_path();
+ unshift(@path, $dir) if defined $dir;
+ while (@path) {
+ my $p = pop(@path);
+ next if $p eq '/var/lib/snmp';
+ if (-r "$p/$NetSNMP::Cert::CFGFILE") {
+ return fq_rel_path("$p/$NetSNMP::Cert::CFGFILE");
+ }
+ }
+
+ return $file;
+}
+
+sub find_cfgdir {
+ my $dir = shift;
+ my $file = shift;
+
+ if (defined $dir) {
+ $dir = NetSNMP::Cert::fq_rel_path($dir);
+ return $dir;
+ }
+
+ if (defined $file and -f $file) {
+ $dir = ::dirname($file);
+ return NetSNMP::Cert::fq_rel_path($dir);
+ } else {
+ my @path = cfg_path();
+ # search first for writeable tls dir
+ # for root search top down, for user bottom up
+ while (@path) {
+ $dir = ($> ? pop(@path): shift(@path));
+ next if $dir eq '/var/lib/snmp';
+ return $dir if -d "$dir/$NetSNMP::Cert::TLSDIR" and -w "$dir/$NetSNMP::Cert::TLSDIR";
+ }
+ @path = cfg_path();
+ # if no tls dir found, pick first writable config dir
+ # for root search top down, for user bottom up
+ while (@path) {
+ $dir = ($> ? pop(@path): shift(@path));
+ next if $dir eq '/var/lib/snmp';
+ return $dir if -d $dir and -w $dir;
+ }
+ my $home = $ENV{HOME} || die "Unable to determine home directory: set \$HOME\n";
+ return ($> ? "$home/.snmp" : "/usr/share/snmp"); # XXX hack - no dirs existed or were writable
+ }
+ # this should never happen
+ return undef;
+}
+
+sub find_certs {
+ my $opts = shift;
+ my $dir = shift || 'certs';
+ my $targ = shift;
+ my $suffix_regex;
+ my $cwd = ::getcwd();
+
+ if ($dir eq 'csrs') {
+ $dir = $NetSNMP::Cert::NEWCRTDIR;
+ $suffix_regex = '\.csr|\.pem';
+ } else {
+ $suffix_regex = '\.crt|\.pem';
+ }
+
+ NetSNMP::Cert::dprint("find_certs(1:$cwd):$dir:$targ:$suffix_regex\n", $opts);
+
+ if ($targ =~ /\.?\//) {
+ # see if targ could be file - calc orig. rel. path
+ my $arg = NetSNMP::Cert::fq_rel_path($targ, $opts->{'rdir'});
+ NetSNMP::Cert::dprint("find_certs(2):$dir:$targ:$arg\n", $opts);
+ # targ is a file name - use it
+ return (wantarray ? ($arg) : $arg) if -f $arg;
+ # else mark as dir if it is
+ $targ = "$arg" if -d $arg;
+ }
+
+ $targ =~ s/\/*$/\// if -d $targ;
+
+ NetSNMP::Cert::dprint("find_certs(3):$dir:$targ\n", $opts);
+
+ # find certs in targ if a dir (in tlsdir, or relative)
+ $dir = $1 if $targ =~ s/^(\S+)\/([^\/\s]*)$/$2/ and -d $1;
+
+ NetSNMP::Cert::dprint("find_certs(4):${dir}:$targ:$cwd\n", $opts);
+
+ my @certs;
+ my $glob = "$dir/$targ";
+ foreach (<$dir/*>) {
+ NetSNMP::Cert::dprint("checking($dir:$targ): $_\n", $opts);
+ next unless /^$dir\/$targ(.*$suffix_regex)?$/;
+ # return exact match if not wantarray()
+ return $_ if (not wantarray()) and /^$dir\/$targ($suffix_regex)?$/;
+ NetSNMP::Cert::dprint("pushing: $_\n", $opts);
+ push(@certs, $_);
+ }
+
+ return (wantarray ? @certs : $certs[0]);
+}
+
+sub check_output_file {
+ my $opts = shift;
+ my $file = shift;
+ my $interactive = shift;
+ my $force = shift;
+ my $continue = 1;
+
+ if (-w $file) {
+ if ($interactive and not $force) {
+ print "Output file ($file) exists; will be overwritten\nContinue [y/N]: ";
+ $continue = <STDIN>; chomp $continue;
+ $continue = 0 if $continue =~ /^\s*$|^no?\s*$/i;
+ } else {
+ if ($force) {
+ NetSNMP::Cert::vprint("Output file ($file) exists; overwriting...\n", $opts);
+ } else {
+ NetSNMP::Cert::vprint("Output file ($file) exists; exiting...\n", $opts);
+ $continue = 0;
+ }
+ }
+ } elsif (-e $file) {
+ NetSNMP::Cert::vprint("Output file ($file) not writable; exiting...\n", $opts);
+ $continue = 0;
+ }
+ exit(1) unless $continue;
+}
+
+sub is_server {
+ my $tag = shift;
+ return 1 if $tag eq 'snmpd' or $tag eq 'snmptrapd';
+ return 0;
+}
+
+sub is_ca_cert {
+ my $crt = shift;
+ my $output = `openssl x509 -in '$crt' -text -noout`;
+ return ($output =~ /^\s*CA:TRUE\s*$/m ? 1 : 0);
+}
+
+sub x509_format {
+ my $opts = shift;
+ my $fmt;
+
+ foreach my $f (@NetSNMP::Cert::X509FMTS) {
+ $fmt .= " -$f" if defined $opts->{$f};
+ }
+
+ return $fmt;
+}
+
+sub make_openssl_conf {
+ my $file = shift;
+ return if -r $file;
+
+ open(F, ">$file") or die("could not open $file");
+
+ print F <<'END';
+#
+# Net-SNMP (D)TLS OpenSSL configuration file.
+#
+
+rdir = .
+dir = $ENV::DIR
+RANDFILE = $rdir/.rand
+MD = sha1
+KSIZE = 2048
+CN = net-snmp.org
+EMAIL = admin@net-snmp.org
+COUNTRY = US
+STATE = CA
+LOCALITY = Davis
+ORG = Net-SNMP
+ORG_UNIT = Development
+SAN = email:copy
+DAYS = 365
+CRLDAYS = 30
+
+default_days = $ENV::DAYS # how long to certify for
+default_crl_days= $ENV::CRLDAYS # how long before next CRL
+default_md = $ENV::MD # which md to use.
+
+database = $dir/.index # database index file.
+serial = $dir/.serial # The current serial number
+certs = $rdir/certs # identity certs
+new_certs_dir = $dir/newcerts # default place for new certs.
+ca_certs_dir = $rdir/ca-certs # default place for new certs.
+key_dir = $rdir/private
+
+crl_dir = $dir/crl # crl's
+crlnumber = $dir/.crlnumber # the current crl number
+ # must be commented out to leave V1 CRL
+crl = $crl_dir/crl.pem # The current CRL
+
+preserve = no # keep passed DN ordering
+unique_subject = yes # Set to 'no' to allow creation of
+ # certificates with same subject.
+# Extra OBJECT IDENTIFIER info:
+oid_section = new_oids
+
+[ new_oids ]
+
+# Add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+# certificate = $ca_certs_dir/$ENV::TAG.crt # CA certificate so sign with
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+policy = policy_match
+copy_extensions = copy # copy v3 extensions (subjectAltName)
+subjectAltName = copy
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = $ENV::KSIZE
+default_md = $ENV::MD
+distinguished_name = req_distinguished_name
+string_mask = MASK:0x2002
+req_extensions = v3_req
+x509_extensions = v3_user_create
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = $ENV::COUNTRY
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = $ENV::STATE
+
+localityName = Locality Name (eg, city)
+localityName_default = $ENV::LOCALITY
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = $ENV::ORG
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = $ENV::ORG_UNIT
+
+commonName = Common Name (eg, your name or your server\'s hostname)
+commonName_max = 64
+commonName_default = $ENV::CN
+
+emailAddress = Email Address
+emailAddress_max = 64
+emailAddress_default = $ENV::EMAIL
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+basicConstraints = CA:FALSE
+
+# Import the email address and/or specified SANs.
+%[subjectAltName = $ENV::SAN]
+
+[ v3_user_create ]
+
+# Extensions to add to a certificate request
+basicConstraints = CA:FALSE
+#keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# PKIX recommendation.
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid:always,issuer:always
+
+# Import the email address and/or specified SANs.
+%[subjectAltName = $ENV::SAN]
+
+[ v3_ca_create ]
+# Extensions to add to a CA certificate
+basicConstraints = CA:TRUE
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate (net-snmp)"
+
+# PKIX recommendation.
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid:always,issuer:always
+
+# Import the email address and/or specified SANs.
+%[subjectAltName = $ENV::SAN]
+
+[ v3_ca_sign ]
+# Extensions to add when 'ca' signs a request.
+basicConstraints = CA:FALSE
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate (net-snmp)"
+
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid:always,issuer:always
+
+[ v3_ca_sign_ca ]
+# Extensions to add when 'ca' signs a ca request.
+basicConstraints = CA:TRUE
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate (net-snmp)"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid:always,issuer:always
+
+END
+
+}
+
+
+package NetSNMP::Cert::Obj;
+
+sub new {
+ my $class = shift;
+ my $cfield = shift;
+ my $parent = shift;
+ my $ind = shift;
+ my $this = {};
+ bless($this, $class);
+
+ # initialize hash of keys which are dynamically created or internal
+ $this->{'AUTOKEYS'}{'AUTOKEYS'}++;
+
+ # store a reference to ourselves so our children can find us
+ $this->autoSet('CFIELD', $cfield);
+ $this->autoSet($cfield , $this);
+ $this->autoSet('CHILDREN', []);
+ $this->autoSet('INDEX', $ind) if defined $ind;
+
+ if (defined $parent) {
+ # cache 'APP' in all objs for easy reference
+ $this->autoSet('APP', $parent->inherit('APP'));
+ my $app = $this->{'APP'};
+
+ die("net-snmp-cert: error: no NetSNMP::Cert::App context provided")
+ if not defined $app or not ref $app eq 'NetSNMP::Cert::App';
+ # save children for list traversal
+ push(@{$parent->{'CHILDREN'}}, $this) unless $parent eq $this;
+ } else {
+ # we are the top of the list
+ $parent = $this;
+ }
+ $this->autoSet('PARENT' , $parent);
+
+ return $this;
+}
+
+sub autoSet {
+ my $this = shift;
+ my $key = shift;
+ if (@_) {
+ my $val = shift;
+ $this->{'AUTOKEYS'}{$key}++;
+ $this->{$key} = $val;
+ }
+ return exists $this->{'AUTOKEYS'}{$key};
+}
+
+sub inherit {
+ my $this = shift;
+ my $field = shift;
+ my $id;
+
+ # cmd opts override config settings
+ if (exists $this->{'APP'} and exists $this->{'APP'}{'OPTS'}) {
+ my $opts = $this->{'APP'}{'OPTS'};
+ $id = $opts->{'identity'};
+ return $opts->{$field} if defined $opts->{$field};
+ }
+
+ if (defined $id and exists $this->{'identity'} and
+ exists $this->{'identity'}{$id} and
+ exists $this->{'identity'}{$id}{$field}) {
+ return $this->{'identity'}{$id}{$field};
+ }
+
+ # return our field if we have it
+ return $this->{$field} if defined $this->{$field};
+
+ # terminate recursion at top and return undef if not found
+ return undef if not defined $this->{'PARENT'} or $this->{'PARENT'} eq $this;
+
+ # recurse to parent
+ $this->{'PARENT'}->inherit($field);
+}
+
+sub resolve {
+ my $this = shift;
+ my $opts = $this->inherit('OPTS');
+ my $val = shift;
+
+ NetSNMP::Cert::dprint("resolving: $val\n", $opts);
+
+ $val =~ s/(\$(\w+))/$this->inherit($2) or die("unresolved reference in config: $1")/ge;
+ $val =~ s/(\&\{(.*?)\})/$2/gee;
+
+ NetSNMP::Cert::dprint("resolved: $val\n", $opts);
+
+ return $val
+}
+
+sub delete {
+ my $this = shift;
+ my $opts = $this->inherit('OPTS');
+
+ NetSNMP::Cert::dprint("Obj::delete: ($this) [$this->{CFIELD}]\n", $opts);
+
+ my $parent = $this->{'PARENT'};
+ my @children = @{$this->{'CHILDREN'}};
+
+ foreach my $child (@children) {
+ $child->delete();
+ }
+
+ NetSNMP::Cert::dwarn("Obj: children not freed\n", $opts) if @{$this->{'CHILDREN'}};
+
+ # delete all our self-references
+ delete($this->{$this->{'CFIELD'}}) if exists $this->{'CFIELD'};
+ delete($this->{'PARENT'});
+ delete($this->{'CHILDREN'});
+
+ $parent->disown($this) if defined $parent and ref($parent) =~ /NetSNMP::Cert/;
+}
+
+sub disown {
+ my $this = shift;
+ my $thechild = shift;
+ my $opts = $this->inherit('OPTS');
+ my $ind = 0;
+
+ NetSNMP::Cert::dprint("Obj::disown: ($this) [$this->{CFIELD}] disowning ($thechild) [$thechild->{CFIELD}]\n", $opts);
+
+ foreach my $child (@{$this->{'CHILDREN'}}) {
+ last if $child eq $thechild;
+ $ind++;
+ }
+ if ($ind < @{$this->{'CHILDREN'}}) {
+ splice(@{$this->{'CHILDREN'}}, $ind, 1);
+ } else {
+ NetSNMP::Cert::dwarn("Child ($thechild) not found in object ($this)\n", $opts);
+ }
+}
+
+sub disabled {
+ my $this = shift;
+ return (exists $this->{'disable'} ? $this->{'disable'} : 0);
+}
+
+my %cfg = (
+ 'name' => 1,
+ 'type' => 2,
+ 'id' => 6,
+ );
+
+sub cfgsort {
+ my $self = shift;
+ my $a = shift;
+ my $b = shift;
+ return -1 if exists $cfg{$a} and not exists $cfg{$b};
+ return 1 if exists $cfg{$b} and not exists $cfg{$a};
+ return $cfg{$a} <=> $cfg{$b} if exists $cfg{$a} and exists $cfg{$b};
+ return -1 if !ref($self->{$a}) and ref($self->{$b});
+ return 1 if !ref($self->{$b}) and ref($self->{$a});
+ return -1 if ref($self->{$a}) =~ /NetSNMP::Cert/ and ref($self->{$b}) !~ /NetSNMP::Cert/;
+ return 1 if ref($self->{$b}) =~ /NetSNMP::Cert/ and ref($self->{$a}) !~ /NetSNMP::Cert/;
+ return 0;
+}
+
+sub dump {
+ my $self = shift;
+ my $indent = shift;
+ my $self_str = $self->{'CFIELD'};
+ my @data_keys = grep {!$self->autoSet($_)} keys %$self;
+ my @lines;
+
+ push(@lines, "\n" . ' ' x $indent . "$self_str = {\n") if defined $indent;
+
+ {
+ my $indent = (defined $indent ? $indent + 3 : 0);
+ foreach my $key (sort {cfgsort($self,$NetSNMP::Cert::Obj::a,
+ $NetSNMP::Cert::Obj::b)} (sort @data_keys)) {
+ if (ref($self->{$key}) =~ /NetSNMP::Cert/) {
+ push(@lines, $self->{$key}->dump($indent));
+ } elsif (ref($self->{$key}) =~ /ARRAY/) {
+ push(@lines, "\n") if ref(${$self->{$key}}[0]) !~ /NetSNMP::Cert/;
+ foreach my $elem (@{$self->{$key}}) {
+ if (ref($elem) =~ /NetSNMP::Cert/) {
+ push(@lines, $elem->dump($indent));
+ } else {
+ push(@lines, ' ' x $indent . "$key = $elem\n");
+ }
+ }
+ } else {
+ my $str = $key . (defined $self->{$key} ? " = $self->{$key}\n" : "\n");
+ push(@lines, ' ' x $indent . $str);
+ }
+ }
+ }
+
+ push(@lines, ' ' x $indent . "}; # end $self_str\n") if defined $indent;
+ return @lines;
+}
+
+sub DESTROY {
+ my $this = shift;
+
+ print("Obj::DESTROY $this [", ref $this, "]\n") if $NetSNMP::Cert::DEBUG >= 3;
+}
+
+package NetSNMP::Cert::App;
+use vars qw(@ISA);
+
+@ISA = qw(NetSNMP::Cert::Obj);
+
+sub new {
+ my $class = shift;
+
+ # the app is god, it is its own parent
+ my $this = $class->SUPER::new('APP');
+
+ bless($this, $class);
+
+ # verify required tools or die
+ $this->checkReqs();
+
+ # internal intitialization
+ $this->initOpts();
+
+ # make a new empty config and init (not parsed)
+ $this->{'config'} = new NetSNMP::Cert::Config($this);
+
+ return $this;
+}
+
+sub checkReqs {
+ my $app = shift;
+
+ die("$NetSNMP::Cert::OPENSSL does not exist or is not executable")
+ if system("$NetSNMP::Cert::OPENSSL version > /dev/null 2>&1");
+
+ my $ossl_ver = `$NetSNMP::Cert::OPENSSL version`; chomp $ossl_ver;
+ $ossl_ver =~ s/^OpenSSL\s+([\d\.]+).*$/$1/;
+ my $ossl_min_ver = $NetSNMP::Cert::OPENSSL_MIN_VER;
+
+ die("$NetSNMP::Cert::OPENSSL (v$ossl_ver): must be $ossl_min_ver or later")
+ if ($ossl_ver cmp $ossl_min_ver) < 0;
+
+ die("$NetSNMP::Cert::CFGTOOL not found: please install")
+ if system("$NetSNMP::Cert::CFGTOOL > /dev/null 2>&1");
+}
+
+sub initOpts {
+ my $app = shift;
+ my $opts = {};
+ $app->autoSet('OPTS', $opts);
+
+ # Define directories we need.
+ $opts->{'bindir'} = NetSNMP::Cert::find_bin_dir();
+
+ $opts->{'out'} = "> $NetSNMP::Cert::OUTLOG";
+ $opts->{'err'} = "2> $NetSNMP::Cert::ERRLOG";
+
+ # set up paths for app install and runtime env
+ $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
+ $ENV{PATH} = "$opts->{'bindir'}:$ENV{PATH}";
+
+ # default all privs to -rw-------
+ umask(077);
+}
+
+sub init {
+ my $app = shift;
+ my $opts = $app->{'OPTS'};
+ my $config = $app->{'config'};
+ my @args = @_; # pass external args (typically ARGV)
+
+ # parse command line
+ $app->parseArgs(@args);
+
+ # lazy config parsing postponed until here, will not reparse
+ $config->parse();
+
+ # set defaults here if not already set in cmdline or config
+ # guided interactive mode by default
+ NetSNMP::Cert::set_default($opts, $config, 'interactive', 1);
+ # verbose output
+ NetSNMP::Cert::set_default($opts, $config, 'verbose', 1);
+
+ # find tlsdir/subdirs or make it
+ $opts->{'tlsdir'} = $app->createTlsDir();
+}
+
+sub parseArgs {
+ my $app = shift;
+ my $opts = $app->{'OPTS'};
+ my @args = @_;
+
+ NetSNMP::Cert::GetOptsFromArray(\@args, $opts, 'help|?', 'version|V',
+ 'interactive!', 'I', 'verbose!', 'Q', 'force|F',
+ 'cfgfile|f=s', 'cfgdir|C=s', 'tlsdir|tlsDir|T=s',
+ 'tag|t=s', 'identity|i=s', 'debug|D+',);
+
+ NetSNMP::Cert::version(0) if $opts->{'version'};
+
+ NetSNMP::Cert::usage(0) if $opts->{'help'};
+
+ # pull out the cmd - getOpts should leave it untouched for us
+ $opts->{'cmd'} = NetSNMP::Cert::pull_cmd(\@args);
+
+ # save extra args for command specific processing
+ $opts->{'cmdargs'} = [@args];
+
+ # Check debug option first
+ $NetSNMP::Cert::DEBUG = $opts->{'debug'};
+ $opts->{'err'} = $opts->{'out'} = "" if $opts->{'debug'};
+ $opts->{'interactive'} = not $opts->{'I'} if defined $opts->{'I'};
+ $opts->{'verbose'} = not $opts->{'Q'} if defined $opts->{'Q'};
+
+ # search for cfgdir and cfgfile based on opts and confpath
+ $opts->{'cfgdir'} = NetSNMP::Cert::find_cfgdir($opts->{'cfgdir'},
+ $opts->{'cfgfile'});
+ $opts->{'cfgfile'} = NetSNMP::Cert::find_cfgfile($opts->{'cfgdir'},
+ $opts->{'cfgfile'});
+}
+
+sub createTlsDir {
+ my $app = shift;
+ my $opts = $app->{'OPTS'};
+ my $config = $app->{'config'};
+ my $dir;
+ my $file;
+ my $cmd;
+
+ $dir = $config->inherit('tlsDir');
+
+ if (not defined $dir) {
+ my $cfgdir = $opts->{'cfgdir'};
+ die("undefined cfgdir: unable to creat tlsdir: exiting...\n") unless defined $cfgdir;
+ $dir = "$cfgdir/$NetSNMP::Cert::TLSDIR";
+ }
+
+ NetSNMP::Cert::dprint("tlsDir is: $dir\n", $opts);
+ $dir = NetSNMP::Cert::fq_rel_path($dir);
+ NetSNMP::Cert::dprint("tlsDir is: $dir\n", $opts);
+
+ NetSNMP::Cert::dprint("tlsDir not found, creating\n", $opts) unless -d $dir;
+ NetSNMP::Cert::make_dirs($opts, $dir, 0700, @NetSNMP::Cert::TLSDIRS);
+
+ my $ssl_cfg_in = NetSNMP::Cert::fq_rel_path($NetSNMP::Cert::SSLCFGIN,$dir);
+
+ # Existing openssl.conf tmpl will be preserved
+ if (-f $ssl_cfg_in) {
+ NetSNMP::Cert::dwarn("OpenSSL template exists ($ssl_cfg_in): preserving...", $opts);
+ }
+
+ if (not -f $ssl_cfg_in) {
+ NetSNMP::Cert::dprint("make_openssl_conf($ssl_cfg_in)", $opts);
+ NetSNMP::Cert::make_openssl_conf($ssl_cfg_in);
+ chmod(0600, $ssl_cfg_in);
+ }
+
+ NetSNMP::Cert::dprint("createTlsDir: done\n", $opts);
+ return $dir;
+}
+
+my @interactive_ops = (['gencert', "Generate a signed certificate"],
+ ['genca', "Generate a CA certificate"],
+ ['gencsr', "Generate a Certificate Signing Request"],
+ ['signcsr', "Sign a Certificate Signing Request"],
+ );
+
+sub run {
+ my $app = shift;
+ my $opts = $app->{'OPTS'};
+ my $cmd = $opts->{'cmd'};
+
+ # must have a command in non-Interactive mode
+ NetSNMP::Cert::usage(3) if !$opts->{'interactive'} and !$opts->{'cmd'};
+
+ # change dir tls dir - the cwd for all commands - save cwd first
+ $opts->{'rdir'} = ::getcwd();
+ chdir($opts->{'tlsdir'}) or die("could'nt change directory: $opts->{tlsdir}");
+ # display context
+ NetSNMP::Cert::dprint("PATH: $ENV{PATH}\n\n", $opts);
+ NetSNMP::Cert::dprint("config file: $opts->{cfgfile}\n", $opts);
+ NetSNMP::Cert::dprint("config dir: $opts->{cfgdir}\n", $opts);
+ NetSNMP::Cert::dprint("tls dir: $opts->{tlsdir}\n", $opts);
+
+ my $cmdstr = join(' ', $cmd, @{$opts->{'cmdargs'}});
+ NetSNMP::Cert::dprint("command: $cmdstr\n", $opts);
+
+ NetSNMP::Cert::GetOptsFromArray(\@{$opts->{'cmdargs'}}, $opts,
+ 'with-ca|a=s', 'ca|A=s','csr|r=s',
+ 'from-crt|x=s', 'crt|X=s', 'days|d=s',
+ 'cn|n=s', 'email|e=s', 'host|h=s',
+ 'san|s=s@', 'org|o=s', 'unit|u=s',
+ 'country|c=s', 'state|province|p=s',
+ 'locality|l=s', 'brief|b',
+ @NetSNMP::Cert::X509FMTS);
+
+ # process extra args; --<cfg-name>[=<val>]
+ $app->processExtraArgs();
+
+ # If in interactive mode - fill missing info by interviewing user
+ if (not defined $cmd or grep {/$cmd/} map {$_->[0]} @interactive_ops) {
+ $app->userInput() if $opts->{interactive};
+ $cmd = $opts->{'cmd'}; # may have changed
+ }
+
+ # resolve input args to filenames
+ $app->resolveCrtArgs();
+
+ # use env. or merge template for OpenSSL config
+ $NetSNMP::Cert::SSLCFG ||= $app->opensslCfg();
+
+ if ($cmd =~ /^genca$/) {
+ NetSNMP::Cert::usage(1) if defined $opts->{'from-crt'} or defined $opts->{'csr'};
+ $app->genCa($opts->{'with-ca'});
+ } elsif ($cmd =~ /^gence?rt$/) {
+ NetSNMP::Cert::usage(1) if defined $opts->{'from-crt'} or defined $opts->{'csr'};
+ $app->genCert($opts->{'with-ca'});
+ } elsif ($cmd =~ /^gencsr$/) {
+ NetSNMP::Cert::usage(1) if defined $opts->{'with-ca'} or defined $opts->{'crt'};
+ $app->genCsr();
+ } elsif ($cmd =~ /^signcsr$/) {
+ NetSNMP::Cert::usage(1) unless defined $opts->{'with-ca'} and defined $opts->{'csr'};
+ $app->signCsr();
+ } elsif ($cmd =~ /^show(ce?rts?)?$/) {
+ $app->show('certs');
+ } elsif ($cmd =~ /^showcas?$/) {
+ $app->show('ca-certs');
+ } elsif ($cmd =~ /^import$/) {
+ $app->import();
+ } else {
+ NetSNMP::Cert::usage();
+ }
+}
+
+sub processExtraArgs {
+ my $app = shift;
+ my $opts = $app->{'OPTS'};
+ my @args;
+
+ NetSNMP::Cert::dprint("processing extra args...\n", $opts);
+
+ while (@{$opts->{'cmdargs'}}) {
+ my $arg = shift(@{$opts->{'cmdargs'}});
+ NetSNMP::Cert::dprint("found: arg --> $arg\n", $opts);
+ if ($arg =~ /^-+(\w+)(?:=(.*?))?\s*$/) {
+ NetSNMP::Cert::dprint("found: arg($1) val($2)\n", $opts);
+ if (exists $opts->{$1}) {
+ NetSNMP::Cert::vwarn("option ($1) already set: overwriting\n", $opts);
+ }
+ $opts->{$1} = (defined $2 ? $2 : 1);
+ } else {
+ push(@args, $arg);
+ }
+ }
+ @{$opts->{'cmdargs'}} = @args;
+}
+
+sub resolveCrtArgs {
+ my $app = shift;
+ my $opts = $app->{'OPTS'};
+
+ # find ca, crt, csr args if present and return fully qualified path
+ if (defined $opts->{'with-ca'}) {
+ my $ca;
+ $ca = NetSNMP::Cert::find_certs($opts, 'ca-certs', $opts->{'with-ca'});
+ die("unable to locate CA certificate ($opts->{'with-ca'})\n") unless -e $ca;
+ die("unable read CA certificate ($opts->{'with-ca'})\n") unless -r $ca;
+ $opts->{'with-ca'} = $ca;
+ }
+
+ if (defined $opts->{'from-crt'}) {
+ my $crt;
+ $crt = NetSNMP::Cert::find_certs($opts, 'certs', $opts->{'from-crt'});
+ die("unable to locate certificate ($opts->{'from-crt'})\n") unless -e $crt;
+ die("unable read certificate ($opts->{'from-crt'})\n") unless -r $crt;
+ $opts->{'from-crt'} = $crt;
+ }
+
+ if (defined $opts->{'csr'}) {
+ my $csr;
+ $csr = NetSNMP::Cert::find_certs($opts, 'csrs', $opts->{'csr'});
+ die("unable to locate CSR certificate ($opts->{csr})\n") unless -e $csr;
+ die("unable read CSR certificate ($opts->{csr})\n") unless -r $csr;
+ $opts->{'csr'} = $csr;
+ }
+}
+
+sub opensslCfg {
+ my $app = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $san = $config->inherit('san') || $config->inherit('subjectAltName');
+ my $ssl_cfg_in = NetSNMP::Cert::fq_rel_path($NetSNMP::Cert::SSLCFGIN);
+ my $ssl_cfg_out = NetSNMP::Cert::fq_rel_path($NetSNMP::Cert::SSLCFGOUT);
+
+ if (not -f $ssl_cfg_in) {
+ NetSNMP::Cert::vwarn("OpenSSL template not found: $ssl_cfg_in\n", $opts);
+ die("no OpenSSL template");
+ }
+
+ open(IN, $ssl_cfg_in) or die("unable to open OpenSSL template: $ssl_cfg_in\n");
+ open(OUT, ">$ssl_cfg_out") or die("unable to open OpenSSL config: $ssl_cfg_out\n");
+
+ print OUT "#######################################################\n";
+ print OUT "##### Warning: Do Not Edit - Generated File #####\n";
+ print OUT "#######################################################\n";
+ while (<IN>) {
+ if ($san) {
+ s/\%\[([^\]]*?)\]/$1/;
+ } else {
+ s/\%\[([^\]]*?)\]//;
+ }
+ print OUT $_;
+ }
+ close(IN);
+ close(OUT);
+
+ return $ssl_cfg_out;
+}
+
+sub opensslEnv {
+ my $app = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+
+ my $cn = shift;
+ my $days = shift;
+ my $dir = shift || ".";
+ # XXX - need to handle config'd identity here
+ my $name = $config->inherit("name");
+ my $host = $config->inherit("host");
+ my $email = $config->inherit("email");
+ my $country = $config->inherit("country");
+ my $state = $config->inherit("state");
+ my $locality = $config->inherit("locality");
+ my $org = $config->inherit("org");
+ my $org_unit = $config->inherit("unit") || $config->inherit("orgUnit");
+ my $san;
+ my $san_arr_ref;
+ my $md = $config->inherit("msgDigest");
+ my $ksize = $config->inherit("keySize");
+
+ my $env;
+
+ $env .= " KSIZE=$ksize" if defined $ksize;
+ $env .= " DAYS=$days" if defined $days;
+ $env .= " MD=$md" if defined $md;
+
+ $env .= " DIR='$dir'" if defined $dir;
+
+ $env .= " EMAIL=$email" if defined $email;
+ $env .= " CN='$cn'" if defined $cn;
+ $env .= " ORG='$org'" if defined $org;
+ $env .= " ORG_UNIT='$org_unit'" if defined $org_unit;
+ $env .= " COUNTRY=$country" if defined $country;
+ $env .= " STATE=$state" if defined $state;
+ $env .= " LOCALITY=$locality" if defined $locality;
+
+ $san_arr_ref = $config->inherit('subjectAltName');
+ $san = join('\,\ ', @{$san_arr_ref}) if ref $san_arr_ref;
+ $san_arr_ref = $config->inherit('san');
+ $san .= join('\,\ ', @{$san_arr_ref}) if ref $san_arr_ref;
+ $san =~ s/EMAIL:/email:/g;
+ $env .= " SAN=$san" if defined $san;
+
+ NetSNMP::Cert::dprint("opensslEnv: $env\n", $opts);
+
+ return $env;
+}
+our @san_prefix = (['dirName:', "e.g., dirName:/usr/share/snmp/tls"],
+ ['DNS:', "e.g., DNS:test.net-snmp.org)"],
+ ['email:', "e.g., email:admin\@net-snmp.org"],
+ ['IP:', "e.g., IP:192.168.1.1"],
+ ['RID:', "e.g., RID:1.1.3.6.20"],
+ ['URI:', "e.g., URI:http://www.net-snmp.org"]);
+
+sub userInputDN {
+ my $app = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $prompt;
+ my $ret;
+ my $host = $config->inherit("host") || ::hostname();
+ my $email = $config->inherit('email') || getlogin() . "\@$host";
+
+ # get EMAIL
+ $prompt = "Enter Email";
+ $ret = $email;
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret,
+ "\tEmail Address - (e.g., <name>@<domain>)");
+ $email = $opts->{'email'} = $ret if defined $ret;
+ # get CN
+ $prompt = "Enter Common Name";
+ $ret = ($opts->{'cmd'} eq 'genca' ? "ca-$host" : $email);
+ $ret = $config->inherit('cn') || $config->inherit('commonName') || $ret;
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret,
+ "\tCommon Name - (e.g., net-snmp.org)");
+ $opts->{'cn'} = $ret if defined $ret;
+ # get ORG
+ $prompt = "Enter Organization";
+ $ret = $config->inherit('org') || 'Net-SNMP';
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret,
+ "\tOrganization - (e.g., Net-SNMP)");
+ $opts->{'org'} = $ret if defined $ret;
+ # get ORG_UNIT
+ $prompt = "Enter Organizational Unit";
+ $ret = $config->inherit('unit') || 'Development';
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret,
+ "\tOrganizational Unit - (e.g., Development)");
+ $opts->{'unit'} = $ret if defined $ret;
+ # get COUNTRY
+ $prompt = "Enter Country Code";
+ $ret = $config->inherit('country') || 'US';
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret,
+ "Country Code, 2 letters (<tab> for options)",
+ $NetSNMP::Cert::MATCH, \@CC);
+ $opts->{'country'} = $ret if defined $ret;
+ # get STATE(Province)
+ $prompt = "Enter State or Province";
+ $ret = $config->inherit('state') || 'CA';
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret,
+ "\tState or Province - (e.g., CA)");
+ $opts->{'state'} = $ret if defined $ret;
+ # get LOCALITY
+ $prompt = "Enter Locality";
+ $ret = $config->inherit('locality') || 'Davis';
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret, "\tLocality - (e.g., Davis)");
+ $opts->{'locality'} = $ret if defined $ret;
+ # get SAN (loop)
+ if (!$config->{'brief'}) {
+ print "Enter Subject Alt Names. Examples:\n";
+ foreach my $pair (@san_prefix) {
+ printf("\t%-10.10s %s\n", $pair->[0], $pair->[1]);
+ }
+ }
+ do {
+ $ret = 'done';
+ $prompt = "Enter Subject Alt Name (enter 'done' when finished) [$ret]: ";
+ $ret = NetSNMP::Term::Complete ($prompt, $ret,
+ "\tSubject Alt Name - (<type>:<val>)",
+ $NetSNMP::Cert::PREMATCH, \@san_prefix);
+ push(@{$opts->{'san'}}, $ret) if defined $ret and $ret ne 'done';
+ } while (defined $ret and $ret ne 'done');
+}
+
+our @snmp_apps = (['snmp', 'Generic Certificate'],
+ ['snmpapp','Client Certificate'],
+ ['snmpd','Agent Certificate'],
+ ['snmptrapd','Trap-agent Certificate']);
+
+sub userInputTag {
+ my $app = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $ret;
+ my $prompt;
+
+ print "Application Tag:\n\tused to name the certificate and dictate its filename\n";
+ print "\tIt may also associate it with a particular application (eg \"snmpd\")\n";
+ print "\tif 'none', a name will be generated from other parameters\n";
+ print "\tenter <tab><tab> for typical options, or enter new name\n";
+ $prompt = "Enter Application Tag";
+ $ret = $config->inherit('tag') || 'none';
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret,
+ "Application Tag assocaiated with certificate",
+ (not $NetSNMP::Cert::MATCH), \@snmp_apps);
+ $opts->{'tag'} = $ret if defined $ret and $ret ne 'none';
+}
+
+sub userInput {
+ my $app = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $prompt;
+ my $ret;
+
+ print "Choose an operation:\n";
+ foreach my $op (@interactive_ops) {
+ print "\t$op->[0]\t- $op->[1]\n";
+ }
+
+ $prompt = "Operation";
+ $ret = $config->inherit('cmd') || $interactive_ops[0][0];
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret,
+ "Certifciate Operation to perform",
+ $NetSNMP::Cert::MATCH, \@interactive_ops);
+
+ $opts->{'cmd'} = $ret;
+
+ if ($ret =~ /^gencert$/) {
+ # get tag
+ $app->userInputTag();
+ # get DN
+ $app->userInputDN();
+ # self-signed/CA-signed(ca-cert)
+ } elsif ($ret =~ /^genca$/) {
+ # get DN
+ $app->userInputDN();
+ } elsif ($ret =~ /^gencsr$/) {
+ # get tag
+ $app->userInputTag();
+ # get DN
+ $app->userInputDN();
+ } elsif ($ret =~ /^signcsr$/) {
+ # get csr
+ $prompt = "Choose Certificate Signing Request";
+ $ret = $config->inherit('csr');
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret);
+ $opts->{'csr'} = $ret if defined $ret;
+ # get ca
+ $prompt = "Choose CA Certificate";
+ $ret = $config->inherit('with-ca');
+ $prompt .= (defined $ret ? " [$ret]: " : ": ");
+ $ret = NetSNMP::Term::Complete($prompt, $ret);
+ $opts->{'with-ca'} = $ret if defined $ret;
+ } else {
+ NetSNMP::Cert::vwarn("aborting operation: exiting...\n", $opts);
+ exit(1);
+ }
+}
+
+sub createCaDir {
+ my $app = shift;
+ my $dir = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $file;
+ my $cmd;
+
+ NetSNMP::Cert::make_dirs($opts, $dir, 0700,'newcerts','private');
+
+ $file = "$dir/$NetSNMP::Cert::SERIAL";
+ if (not -f $file) {
+ $cmd = "echo '01' > '$file'";
+ NetSNMP::Cert::dprint("$cmd\n", $opts);
+ NetSNMP::Cert::usystem($cmd, $opts);
+ chmod(0600, $file);
+ }
+
+ $file = "$dir/$NetSNMP::Cert::INDEX";
+ if (not -f $file) {
+ $cmd = "touch '$file'";
+ NetSNMP::Cert::dprint("$cmd\n", $opts);
+ NetSNMP::Cert::usystem($cmd, $opts);
+ chmod(0600, $file);
+ }
+}
+
+sub genCa {
+ my $app = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $host = $config->inherit('host') || ::hostname();
+ my $days = $config->inherit('days') || $config->inherit('caDays') ||
+ $NetSNMP::Cert::DEFCADAYS;
+ my $cn = $config->inherit('cn') || $config->inherit('commonName') ||
+ "ca-$host";
+ my $ca = $config->inherit('with-ca');
+ my $tag = $config->inherit('tag') || $cn;
+
+ # create CA dir
+ my $dir = ".ca/$tag";
+ $app->createCaDir($dir);
+
+ my $outCrt = "$NetSNMP::Cert::CADIR/$tag.crt";
+ my $outKey = "$NetSNMP::Cert::PRIVDIR/$tag.key";
+
+ # set command env
+ my $env = $app->opensslEnv($cn, $days);
+
+ NetSNMP::Cert::check_output_file($opts, $outCrt,
+ $config->inherit('interactive'),
+ $config->inherit('force'));
+ NetSNMP::Cert::check_output_file($opts, $outKey,
+ $config->inherit('interactive'),
+ $config->inherit('force'));
+
+ my $cmd = "$env openssl req -extensions v3_ca_create -new -days $days -batch -config $NetSNMP::Cert::SSLCFG -keyout '$outKey'";
+ $cmd .= " -nodes";
+
+ if (defined $ca) {
+ # we have to gen a csr and then sign it, must preserve CA:TRUE
+ my $outCsr = "$NetSNMP::Cert::NEWCRTDIR/$tag.csr";
+ NetSNMP::Cert::check_output_file($opts, $outCsr,
+ $config->inherit('interactive'),
+ $config->inherit('force'));
+ $cmd .= " -out '$outCsr'";
+
+ NetSNMP::Cert::dprint("genCa (gencsr): $cmd\n", $opts);
+ NetSNMP::Cert::usystem("$cmd $opts->{out} $opts->{err}", $opts);
+
+ my $ca_base = ::basename($ca, @NetSNMP::Cert::CRTSUFFIXES);
+ NetSNMP::Cert::dprint("ca_base: $ca_base\n", $opts);
+
+ # set command env
+ $env = $app->opensslEnv($cn, $days, ".ca/$ca_base");
+
+ $cmd = "$env openssl ca -extensions v3_ca_sign_ca -days $days -cert '$ca' -keyfile '$NetSNMP::Cert::PRIVDIR/$ca_base.key' -in '$outCsr' -batch -config $NetSNMP::Cert::SSLCFG -out '$outCrt'";
+
+ NetSNMP::Cert::dprint("genCa (signcsr): $cmd\n", $opts);
+ NetSNMP::Cert::usystem("$cmd $opts->{out} $opts->{err}", $opts);
+ } else {
+ $cmd .= " -x509 -out '$outCrt'";
+
+ NetSNMP::Cert::dprint("genCa: $cmd\n", $opts);
+ NetSNMP::Cert::usystem("$cmd $opts->{out} $opts->{err}", $opts);
+ }
+
+ NetSNMP::Cert::vprint("CA Generated:\n", $opts);
+ NetSNMP::Cert::vprint(" $outCrt\n", $opts);
+ NetSNMP::Cert::vprint(" $outKey\n", $opts);
+}
+
+sub genCert {
+ my $app = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $host = $config->inherit("host") || ::hostname();
+ my $email = $config->inherit("email") || getlogin() . "\@$host";
+ my $days = $config->inherit('days') || $config->inherit('crtDays') || $NetSNMP::Cert::DEFCRTDAYS;
+ my $cn = $config->inherit('cn') || $config->inherit('commonName');
+ my $ca = $config->inherit('with-ca');
+ my $cmd;
+
+ my $tag = $opts->{'tag'} || 'snmp';
+ $cn ||= (NetSNMP::Cert::is_server($tag) ? $host : $email);
+
+ my $env = $app->opensslEnv($cn, $days);
+
+ my $outCrt = "$NetSNMP::Cert::CRTDIR/$tag.crt";
+ my $outKey = "$NetSNMP::Cert::PRIVDIR/$tag.key";
+
+ NetSNMP::Cert::check_output_file($opts, $outCrt,
+ $config->inherit('interactive'),
+ $config->inherit('force'));
+ NetSNMP::Cert::check_output_file($opts, $outKey,
+ $config->inherit('interactive'),
+ $config->inherit('force'));
+
+ $cmd = "$env openssl req -extensions v3_user_create -new -days $days -keyout '$outKey' -batch -config $NetSNMP::Cert::SSLCFG";
+ $cmd .= " -nodes";
+
+ if (defined $ca) {
+ my $outCsr = "$NetSNMP::Cert::NEWCRTDIR/$tag.csr";
+ NetSNMP::Cert::check_output_file($opts, $outCsr,
+ $config->inherit('interactive'),
+ $config->inherit('force'));
+ $cmd .= " -out '$outCsr'";
+
+ NetSNMP::Cert::dprint("genCert (gencsr): $cmd\n", $opts);
+ NetSNMP::Cert::usystem("$cmd $opts->{out} $opts->{err}", $opts);
+
+ # XXX cleanup this temp CSR
+ my $ca_base = ::basename($ca, @NetSNMP::Cert::CRTSUFFIXES);
+ NetSNMP::Cert::dprint("ca_base: $ca_base\n", $opts);
+
+ # set command env
+ $env = $app->opensslEnv($cn, $days, ".ca/$ca_base");
+
+ $cmd = "$env openssl ca -extensions v3_ca_sign -days $days -cert '$ca' -keyfile '$NetSNMP::Cert::PRIVDIR/$ca_base.key' -in '$outCsr' -batch -config $NetSNMP::Cert::SSLCFG -out '$outCrt'";
+
+ NetSNMP::Cert::dprint("gencert (signcsr): $cmd\n", $opts);
+ NetSNMP::Cert::usystem("$cmd $opts->{out} $opts->{err}", $opts);
+ } else {
+ $cmd .= " -x509 -out '$outCrt'";
+
+ NetSNMP::Cert::dprint("genCert: $cmd\n", $opts);
+ NetSNMP::Cert::usystem("$cmd $opts->{out} $opts->{err}", $opts);
+ }
+
+ NetSNMP::Cert::vprint("Certificate Generated:\n", $opts);
+ NetSNMP::Cert::vprint(" $outCrt\n", $opts);
+ NetSNMP::Cert::vprint(" $outKey\n", $opts);
+}
+
+sub genCsr {
+ my $app = shift;
+ my $isCa = shift; # XXX - not implemented yet
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $host = $config->inherit("host") || ::hostname();
+ my $email = $config->inherit("email") || getlogin() . "\@$host";
+ my $days = $config->inherit('days') || $config->inherit('crtDays') || $NetSNMP::Cert::DEFCRTDAYS;
+ my $cn = $config->inherit('cn') || $config->inherit('commonName');
+ my $tag = $config->inherit('tag');
+ my $inCrt = $config->inherit('from-crt') || $config->inherit('fromCert');
+ my $outCsr;
+ my $csrKey;
+
+ if (defined $inCrt) {
+ $inCrt = NetSNMP::Cert::find_certs($opts, 'certs', $inCrt);
+ my $crt = ::basename($inCrt, @NetSNMP::Cert::CRTSUFFIXES);
+ $csrKey = "$NetSNMP::Cert::PRIVDIR/$crt.key";
+ $tag ||= $crt;
+ } else {
+ $tag ||= 'snmp';
+ $csrKey ||= "$NetSNMP::Cert::PRIVDIR/$tag.key";
+ }
+
+ $outCsr = "$NetSNMP::Cert::NEWCRTDIR/$tag.csr";
+
+ $cn ||= (NetSNMP::Cert::is_server($tag) ? $host : $email);
+
+ my $env = $app->opensslEnv($cn, $days);
+
+ NetSNMP::Cert::check_output_file($opts, $outCsr,
+ $config->inherit('interactive'),
+ $config->inherit('force'));
+ NetSNMP::Cert::check_output_file($opts, $csrKey,
+ $config->inherit('interactive'),
+ $config->inherit('force'));
+
+ my $cmd = (defined $inCrt ?
+ "$env openssl x509 -x509toreq -in $inCrt -out '$outCsr' -signkey '$csrKey' -nodes -days $days -batch -config $NetSNMP::Cert::SSLCFG" :
+ "$env openssl req -new -nodes -days $days -batch -keyout '$csrKey' -out '$outCsr' -config $NetSNMP::Cert::SSLCFG");
+
+ $cmd .= ($isCa ? " -extensions v3_ca_create" : " -extensions v3_user_create");
+
+ NetSNMP::Cert::dprint("genCsr: $cmd\n", $opts);
+
+ NetSNMP::Cert::usystem("$cmd $opts->{out} $opts->{err}", $opts);
+
+ NetSNMP::Cert::vprint("Certificate Signing Request Generated:\n", $opts);
+ NetSNMP::Cert::vprint(" $outCsr\n", $opts);
+ NetSNMP::Cert::vprint(" $csrKey\n", $opts);
+}
+
+sub signCsr {
+ my $app = shift;
+ my $isCa = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $host = $config->inherit("host") || ::hostname();
+ my $email = $config->inherit("email") || getlogin() . "\@$host";
+ my $days = $config->inherit('days') || $config->inherit('crtDays') || $NetSNMP::Cert::DEFCRTDAYS;
+ my $cn = $config->inherit('cn') || $config->inherit('commonName');
+ my $tag = $config->inherit('tag') || 'snmp';
+ my $install = $config->inherit('install');
+
+ $cn = (NetSNMP::Cert::is_server($tag) ? $host : $email);
+
+ my $ca = $opts->{'with-ca'};
+ NetSNMP::Cert::dprint("ca: $ca\n", $opts);
+ my $ca_base = ::basename($ca, @NetSNMP::Cert::CRTSUFFIXES);
+ NetSNMP::Cert::dprint("ca_base: $ca_base\n", $opts);
+ my $ca_key = "$NetSNMP::Cert::PRIVDIR/$ca_base.key";
+
+ my $csr = $opts->{'csr'};
+ NetSNMP::Cert::dprint("csr: $csr\n", $opts);
+ my $csr_base = ::basename($csr, @NetSNMP::Cert::CRTSUFFIXES);
+ NetSNMP::Cert::dprint("csr_base: $csr_base\n", $opts);
+ my $outdir = ($install ? $NetSNMP::Cert::CRTDIR : $NetSNMP::Cert::NEWCRTDIR);
+ my $outCrt = "$outdir/$csr_base.crt";
+
+ my $env = $app->opensslEnv($cn, $days, ".ca/$ca_base");
+
+ NetSNMP::Cert::check_output_file($opts, $outCrt,
+ $config->inherit('interactive'),
+ $config->inherit('force'));
+
+ # XXX - handle keyfile search??
+ my $cmd = "$env openssl ca -batch -days $days -extensions v3_ca_sign -cert '$ca' -keyfile '$ca_key' -in '$csr' -out '$outCrt' -config $NetSNMP::Cert::SSLCFG";
+
+ # $cmd .= ($isCa ? " -extensions v3_ca_sign_ca" : " -extensions v3_ca_sign");
+
+ NetSNMP::Cert::dprint("signCsr: $cmd\n", $opts);
+
+ NetSNMP::Cert::usystem("$cmd $opts->{out} $opts->{err}", $opts);
+
+ NetSNMP::Cert::vprint("Signed Certificate Signing Request:\n", $opts);
+ NetSNMP::Cert::vprint(" $csr\n", $opts);
+ NetSNMP::Cert::vprint("with CA:\n", $opts);
+ NetSNMP::Cert::vprint(" $ca\n", $opts);
+ NetSNMP::Cert::vprint(" $ca_key\n", $opts);
+ NetSNMP::Cert::vprint("Generated Certificate:\n", $opts);
+ NetSNMP::Cert::vprint(" $outCrt\n", $opts);
+}
+
+sub show {
+ my $app = shift;
+ my $type = shift || 'certs';
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $stag = shift(@{$opts->{'cmdargs'}});
+ my $fmt = NetSNMP::Cert::x509_format($opts) || '-subject';
+ my $brief = $config->inherit('brief');
+ my $output;
+ my $cmd;
+
+ my $cwd = ::getcwd();
+ NetSNMP::Cert::dprint("show ($cwd):$type:$stag:$fmt\n", $opts);
+ NetSNMP::Cert::vprint("$opts->{'tlsdir'}:\n", $opts) unless $brief;
+
+ foreach my $c (NetSNMP::Cert::find_certs($opts, $type, $stag)) {
+ print "\n$c:\n" unless $brief;
+ $cmd = "openssl x509 -in '$c' -noout $fmt";
+ NetSNMP::Cert::dprint("show: $cmd\n", $opts);
+
+ $output = `$cmd`; chomp $output;
+ NetSNMP::Cert::vwarn("show-$type failed ($?): $output\n", $opts) if $?;
+
+ $output =~ s/^[^\n=]+=// if $brief;
+
+ print "$output\n";
+ print "\n" unless $brief;
+ }
+}
+
+sub import_file {
+ my ($file, $suffix, $targ, $rdir, $tag) = @_;
+
+ if (NetSNMP::Cert::is_url($file)) {
+ if ($NetSNMP::Cert::haveUserAgent) {
+
+ require File::Temp;
+ import File::Temp qw(tempfile);
+
+ my ($fh, $newfilename) = tempfile(SUFFIX => $suffix);
+ return if (!$fh || !$newfilename);
+ my $ua = LWP::UserAgent->new;
+ my $response = $ua->get($file);
+ if ($response->is_success) {
+ print $fh $response->decoded_content();
+ } else {
+ NetSNMP::Cert::vwarn("failed to download a certificate from $file");
+ return;
+ }
+ $fh->close;
+ $file = $newfilename;
+ } else {
+ NetSNMP::Cert::vwarn("LWP::UserAgent not installed: unable to import certificate");
+ return;
+ }
+ }
+
+ $file = NetSNMP::Cert::fq_rel_path($file, $rdir);
+ die("file unreadable: $file\n") unless -r $file;
+
+
+ if (! $targ) {
+ $targ = (NetSNMP::Cert::is_ca_cert($file) ? $NetSNMP::Cert::CADIR : $NetSNMP::Cert::CRTDIR);
+ }
+
+ $targ .= "/" . $tag . $suffix if ($tag);
+ ::copy($file, $targ);
+}
+
+
+sub import {
+ my $app = shift;
+ my $config = $app->{'config'};
+ my $opts = $app->{'OPTS'};
+ my $carg = shift(@{$opts->{'cmdargs'}});
+ my $karg = shift(@{$opts->{'cmdargs'}});
+ my $targ;
+
+ if (not defined $carg) {
+ NetSNMP::Cert::vwarn("import: no certificate supplied\n", $opts);
+ NetSNMP::Cert::usage(1);
+ }
+
+ import_file($carg, '.crt', '',,
+ $opts->{'rdir'}, $opts->{'tag'});
+
+ return unless defined $karg;
+
+ import_file($karg, '.key', 'private',,
+ $opts->{'rdir'}, $opts->{'tag'});
+}
+
+
+package NetSNMP::Cert::Config;
+use vars qw(@ISA);
+@ISA = qw(NetSNMP::Cert::Obj);
+
+sub new {
+ my $class = shift;
+ my $parent = shift;
+ my $this = $class->SUPER::new('config', $parent);
+
+ bless($this, $class);
+}
+
+sub parse {
+ my $config = shift;
+ my $app = $config->{'APP'};
+ my $opts = $app->{'OPTS'};
+ my $cfgfile = shift;
+ $cfgfile ||= $opts->{'cfgfile'};
+
+ return '0 but true' if $config->{'PARSED'};
+ return '0 but true' unless defined $cfgfile;
+
+ open( CONFIG, "<$cfgfile" )
+ or die "error - could not open configuration file: $cfgfile";
+
+ while (<CONFIG>) {
+ next if /^\s*#/ or /^\s*$/;
+
+ if (/^\s*(\w+)(?:\(([\)\(\d\,\.]+)\))?\s*=\s*{/) {
+ my $obj = $1;
+
+ NetSNMP::Cert::dprint("object: $obj ($2) = {\n", $opts);
+ die "error - identity: indices not supported: $2" if defined $2;
+
+ # Found an object.
+ if ( $obj eq 'identity' ) {
+ my $identity = NetSNMP::Cert::Identity::parse(*CONFIG, $config);
+ my $id = $identity->{'id'};
+ die "error - identity: 'id' not defined" unless defined $id;
+ die "error - identity: duplicate '$id'" if exists $config->{$obj}{$id};
+ $config->{$obj}{$id} = $identity;
+ } else {
+ die "error - unrecognized object ($1) at scope (config)";
+ }
+ } elsif (/^\s*(\w+)\s*=?\s*(.*?)\s*$/) {
+ my $key = $1;
+ my $val = $2;
+
+ $val = $config->resolve($val) if $val =~ /\$\w+|\&\{.*?\}/;
+ # Found a symbol.
+ NetSNMP::Cert::dprint(" $key = $val\n", $opts);
+ if ($key eq 'subjectAltName' or $key eq 'san') {
+ push(@{$config->{$key}}, $val);
+ } elsif ( defined $config->{$key} ) {
+ die "error - duplicate symbol $key";
+ } else {
+ $config->{$key} = (defined $val ? NetSNMP::Cert::map_bool($val) : 1 );
+ }
+ } elsif (/^\s*env\s*(\w+=\S+)\s*$/) {
+ # Found an environment variable.
+ NetSNMP::Cert::dprint("$&\n", $opts);
+ push(@{$config->{'env'}}, $1);
+ } else {
+ die("error in config file [$cfgfile:line $.]");
+ }
+ }
+
+ NetSNMP::Cert::dprint("end parse config\n", $opts);
+ close(CONFIG);
+
+ # augment with any config directives supplied in opts
+ foreach my $cfg (@{$opts->{'config'}}) {
+ NetSNMP::Cert::dprint("augmenting config: $cfg\n", $opts);
+
+ $config->autoSet($1, (defined($2) ? $2 : 1 ))
+ if $cfg =~ /^\s*(\w+)\s*=?\s*(.*?)\s*$/;
+ }
+ $config->autoSet('PARSED', 1);
+ return $config->{'PARSED'};
+}
+
+package NetSNMP::Cert::Identity;
+use vars qw(@ISA);
+@ISA = qw(NetSNMP::Cert::Obj);
+
+sub new {
+ my $class = shift;
+ my $this = shift || $class->SUPER::new('identity', @_);
+ my $ind = $this->{'INDEX'} || 1;
+
+ $this->autoSet('name', "$this->{type}.$ind") unless exists $this->{'name'};
+
+ $this->autoSet('LOG','') unless exists $this->{'LOG'};
+ $this->autoSet('TTY_LOG','') unless exists $this->{TTY_LOG};
+
+ bless($this, $class);
+}
+
+
+sub parse {
+ my $FILE = shift;
+ my $parent = shift;
+ my $opts = $parent->inherit('OPTS');
+ my $identity = new NetSNMP::Cert::Obj('identity', $parent);
+
+ NetSNMP::Cert::dprint("parse identity\n", $opts);
+
+ while (<$FILE>) {
+ next if /^\s*#/ or /^\s*$/;
+
+ if (/^\s*(\w+)\s*=\s*{/) {
+ # Found an object.
+ die "error - can't have nested $1";
+ } elsif (/^\s*(\w+)\s*=?\s*(.*?)\s*$/) {
+ my $key = $1;
+ my $val = $2;
+
+ # Found a symbol.
+ NetSNMP::Cert::dprint(" $key = $val\n", $opts);
+
+ $val = $identity->resolve($val) if $val =~ /\$\w+|\&\{.*?\}/;
+
+ if ( $key eq 'subjectAltName' or $key eq 'san') {
+ push(@{$identity->{$key}}, $val);
+ } elsif ( defined $identity->{$key} ) {
+ die "error - duplicate symbol $key";
+ } else {
+ $identity->{$key} = (defined $val ? NetSNMP::Cert::map_bool($val) : 1 );
+ }
+ } elsif (/\s*\}\s*\;/) {
+ # End of definition.
+ NetSNMP::Cert::dprint("end parse identity\n", $opts);
+ return new NetSNMP::Cert::Identity($identity);
+ } else {
+ die("error in config file [$opts->{cfgfile}:line $.]");
+ }
+ }
+ die "error - unexpected end of conf file";
+}
+
+package main;
+
+my $app = new NetSNMP::Cert::App();
+$app->init(@ARGV);
+$app->run();
+
+__END__
+=pod
+
+=head1 NAME
+
+net-snmp-cert - Net-SNMP Certificate Management Tool
+
+=head1 SYNOPSIS
+
+=over
+
+=item $ net-snmp-cert genca -I --cn ca-Net-SNMP
+
+=item $ net-snmp-cert gencert -I -t snmpapp --with-ca ca-Net-SNMP
+
+=item $ net-snmp-cert gencert -I -t snmpd --cn net-snmp.org
+
+=item $ net-snmp-cert showcas
+
+=item $ net-snmp-cert showcerts
+
+=back
+
+=head1 DESCRIPTION
+
+net-snmp-cert creates, signs, installs and displays X.509
+certificates used in the operation of Net-SNMP/(D)TLS.
+
+=head1 SYNTAX
+
+=over
+
+=item net-snmp-cert [--help|-?]
+
+=item net-snmp-cert [--version|-V]
+
+=item net-snmp-cert genca [<flags>] [<dn-opts>] [--with-ca <ca>]
+
+=item net-snmp-cert gencert [<flags>] [<dn-opts>] [--with-ca <ca>]
+
+=item net-snmp-cert gencsr [<flags>] [<dn-opts>] [--from-crt <crt>]
+
+=item net-snmp-cert signcsr [<flags>] [--install] --csr <csr> --with-ca <ca>
+
+=item net-snmp-cert showca [<flags>] [<format-opts>] [<file>|<search-tag>]
+
+=item net-snmp-cert showcert [<flags>] [<format-opts>] [<file>|<search-tag>]
+
+=item net-snmp-cert import [<flags>] <file|url> [<key>]
+
+=back
+
+=head1 COMMANDS
+
+=over
+
+=item genca
+
+generate a signed CA certificate suitable for signing other
+certificates. default: self-signed unless --with-ca <ca> supplied
+
+=item gencert
+
+generate a signed certificate suitable for identification, or
+validation. default: self-signed unless --with-ca <ca> supplied
+
+=item gencsr
+
+generate a certificate signing request. will create a new
+key and certificate unless --from-crt <crt> supplied
+
+=item signcsr
+
+sign a certificate signing request specified by --csr <csr>
+with the CA certificate specified by --with-ca <ca>
+
+=item import
+
+import an identity or CA certificate, optionally import <key>
+if an URL is passed, will attempt to import certificate from site
+
+=item showca, showcert
+
+show CA or identity certificate(s). may pass fully qualified
+file or directory name, or a search-tag which prefix matches
+installed CA or identity certificate file name(s)
+see FORMAT OPTIONS to specify output format
+
+
+=back
+
+=head1 FLAGS
+
+=over
+
+=item -?, --help -- show this text and exit
+
+=item -V, --version -- show version string and exit
+
+=item -D, --debug -- raise debug level (-D -D for higher level)
+
+=item -F, --force -- force overwrite of existing output files
+
+=item -I, --nointeractive -- non-interactive run (default interactive)
+
+=item -Q, --noverbose -- non-verbose output (default verbose)
+
+=item -C, --cfgdir <dir> -- configuration dir (see man(5) snmp_config)
+
+=item -T, --tlsdir <dir> -- root for cert storage (default <cfgdir>/tls)
+
+=item -f, --cfgfile <file> -- config (default <cfgdir>/net-snmp-cert.conf)
+
+=item -i, --identity <id> -- identity to use from config
+
+=item -t, --tag <tag> -- application tag (default 'snmp')
+
+=item --<cfg-param>[=<val>] -- additional config params
+
+=back
+
+=head1 CERTIFICATE OPTIONS (<cert-opts>)
+
+=over
+
+=item -a, --with-ca <ca> -- CA certificate used to sign request
+
+=item -A, --ca <ca> -- explicit output CA certificate
+
+=item -r, --csr <csr> -- certificate signing request
+
+=item -x, --from-crt <crt> -- input certificate for current operation
+
+=item -X, --crt <crt> -- explicit output certificate
+
+=item -y, --install -- install result in local repository
+
+=back
+
+=head1 DISTINGUISHED NAME OPTIONS (<dn-opts>)
+
+=over
+
+=item -e, --email <email> -- email name
+
+=item -h, --host <host> -- DNS host name, or IP address
+
+=item -d, --days <days> -- number of days certificate is valid
+
+=item -n, --cn <cn> -- common name (CN)
+
+=item -o, --org <org> -- organiztion name
+
+=item -u, --unit <unit> -- organiztion unit name
+
+=item -c, --country <country> -- country code (e.g., US)
+
+=item -p, --province <province> -- province name (synomynous w/ state)
+
+=item -p, --state <state> -- state name (synomynous w/ province)
+
+=item -l, --locality <locality> -- locality name (e.g, town)
+
+=item -s, --san <san> -- subjectAltName, repeat for each <san>
+
+=over 2
+
+=item <san> value format (<FMT>:<VAL>):
+
+=over 3
+
+=item dirName:/usr/share/snmp/tls
+
+=item DNS:net-snmp.org
+
+=item email:admin@net-snmp.org
+
+=item IP:192.168.1.1
+
+=item RID:1.1.3.6
+
+=item URI:http://net-snmp.org
+
+=back
+
+=back
+
+=back
+
+=head1 FORMAT OPTIONS (<format-opts>)
+
+=over
+
+=item --brief -- minimized output (values only where applicable)
+
+=item --text -- full text description
+
+=item --subject -- subject description
+
+=item --subject_hash -- hash of subject for indexing
+
+=item --issuer -- issuer description
+
+=item --issuer_hash -- hash of issuer for indexing
+
+=item --fingerprint -- SHA1 digest of DER
+
+=item --serial -- serial number
+
+=item --modulus -- modulus of the public key
+
+=item --dates -- start and end dates
+
+=item --purpose -- displays allowed uses
+
+=item --C -- C code description
+
+=back
+
+=head1 OPERATIONAL NOTES
+
+
+=head2 Interactive Mode
+
+The application operates in interactive mode by default. In this mode
+basic operations of offered and required input is queried through the
+command line.
+
+Typical <tab> completion is provided when possible and field specific
+help may be obtained by entering '?'.
+
+To turn off interactive mode, supply '--nointeractive' or '-I' on the
+initial command line. Equivalantly, 'interactive = false' maybe placed
+in the configuration file (see below).
+
+=head2 Configuration
+
+A configuration file may be supplied on the command line or found in a
+default location (<snmpconfpath>/net-snmp-cert.conf). This file may
+contain configuration parameters equivalent to those supplied on the
+command line and effectively provides default values for these
+values. If a command line parameter is supplied it will override the
+value in the config file. If neither is present then an application
+value will be used.
+
+=head2 Certificate Naming
+
+Filenames of created certificates, as stored in the configuration
+directory, are chosen in the following manner. If and application tag
+is supplied, it will be used as the basename for the certificate and
+key generated. Otherwise, for CA certificates, the basename will be
+derived from the Common Name. For non-CA certificates the application
+tag defaults to 'snmp' which will then be used as the basename of the
+certificate and key.
+
+=head1 EXAMPLES
+
+=over
+
+=item net-snmp-cert genca --cn ca-net-snmp.org --days 1000
+
+=item net-snmp-cert genca -f .snmp/net-snmp-cert.conf -i nocadm
+
+=item net-snmp-cert gencert -t snmpd --cn host.net-snmp.org
+
+=item net-snmp-cert gencsr -t snmpapp
+
+=item net-snmp-cert signcsr --csr snmpapp --with-ca ca-net-snmp.org
+
+=item net-snmp-cert showcerts --subject --issuer --dates snmpapp
+
+=item net-snmp-cert showcas --fingerprint ca-net-snmp.org --brief
+
+=item net-snmp-cert import ca-third-party.crt
+
+=item net-snmp-cert import signed-request.crt signed-request.key
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (c) 2010 Cobham Analytic Solutions - All rights reserved.
+Copyright (c) 2010 G. S. Marzot - All rights reserved.
+
+=head1 AUTHOR
+
+G. S. Marzot (marz@users.sourceforge.net)
+
+=cut
+
diff --git a/local/net-snmp-cert.conf b/local/net-snmp-cert.conf
new file mode 100644
index 0000000..7def1cc
--- /dev/null
+++ b/local/net-snmp-cert.conf
@@ -0,0 +1,72 @@
+#
+# Net-SNMP Certificate Generation and Management Tool Configuration
+#
+
+# default mode to non-interactive
+# interactive = false
+
+# location of 'tls' directory relative to configuration dir
+# tlsDir = ./tls
+
+# encryptCA = false - XXX not-implemented
+# encryptCrt = false - XXX not-implemented
+
+# default valid lifetime duration for CA certificates
+# caDays = 1825
+
+# default valid lifetime duration for certificates
+# crtDays = 365
+
+# default key types generated
+# keyType = rsa
+
+# default key size generated
+# keySize = 2048
+
+# default type of message digest used
+# msgDigest = sha1
+
+# to set individual defaults, a specific identity may be indicated
+# on the net-snmp-cert command line: '--identity <id>' or '-i <id>'
+# values defined at the global/file level will be used unless
+# overriden by values supplied in the specified identity.
+
+identity = {
+ id = nocadm
+ host = net-snmp.org
+ cn = Client-identity
+ email = admin@net-snmp.org
+ org = Net-SNMP Developers
+ orgUnit = SNMP-DTLS
+ country = US
+ state = MA
+ locality = Boston
+
+ # 10 years
+ caDays = 3654
+ # 2 years
+ crtDays = 730
+
+ subjectAltName = email:client@net-snmp.org
+ subjectAltName = URI:http://net-snmp.org
+};
+
+identity = {
+ id = CA-identity
+ host = net-snmp.org
+ cn = CA-identity
+ email = ca-admin@net-snmp.org
+ org = Net-SNMP Developers
+ orgUnit = SNMP-DTLS
+ country = US
+ state = MA
+ locality = Boston
+
+ # 10 years
+ caDays = 1000
+ # 2 years
+ crtDays = 500
+
+ subjectAltName = DNS:test.net-snmp.org
+};
+
diff --git a/local/pass_persisttest b/local/pass_persisttest
new file mode 100755
index 0000000..f4045cc
--- /dev/null
+++ b/local/pass_persisttest
@@ -0,0 +1,98 @@
+#!/usr/bin/perl
+
+# Persistent perl script to respond to pass-through smnp requests
+
+# put the following in your snmpd.conf file to call this script:
+#
+# Unix systems and Cygwin:
+# pass_persist .1.3.6.1.4.1.8072.2.255 /path/to/pass_persisttest
+# Windows systems except Cygwin:
+# pass_persist .1.3.6.1.4.1.8072.2.255 perl /path/to/pass_persisttest
+
+# Forces a buffer flush after every print
+$|=1;
+
+# Save my PID, to help kill this instance.
+$PIDFILE=$ENV{'PASS_PERSIST_PIDFILE'} || "/tmp/pass_persist.pid";
+open(PIDFILE, ">$PIDFILE");
+print PIDFILE "$$\n";
+close(PIDFILE);
+
+use strict;
+
+my $counter = 0;
+my $place = ".1.3.6.1.4.1.8072.2.255";
+
+while (<>){
+ if (m!^PING!){
+ print "PONG\n";
+ next;
+ }
+
+ my $cmd = $_;
+ my $req = <>;
+ my $ret;
+ chomp($cmd);
+ chomp($req);
+
+ if ( $cmd eq "getnext" ) {
+ if (($req eq "$place") ||
+ ($req eq "$place.0") ||
+ ($req =~ m/$place\.0\..*/) ||
+ ($req eq "$place.1")) { $ret = "$place.1.0";} # netSnmpPassString.0
+ elsif (($req =~ m/$place\.1\..*/) ||
+ ($req eq "$place.2") ||
+ ($req eq "$place.2.0") ||
+ ($req =~ m/$place\.2\.0\..*/) ||
+ ($req eq "$place.2.1") ||
+ ($req eq "$place.2.1.0") ||
+ ($req =~ m/$place\.2\.1\.0\..*/) ||
+ ($req eq "$place.2.1.1") ||
+ ($req =~ m/$place\.2\.1\.1\..*/) ||
+ ($req eq "$place.2.1.2") ||
+ ($req eq "$place.2.1.2.0")) { $ret = "$place.2.1.2.1";} # netSnmpPassInteger.1
+ elsif (($req =~ m/$place\.2\.1\.2\..*/) ||
+ ($req eq "$place.2.1.3") ||
+ ($req eq "$place.2.1.3.0")) { $ret = "$place.2.1.3.1";} # netSnmpPassOID.1
+ elsif (($req =~ m/$place\.2\..*/) ||
+ ($req eq "$place.3")) { $ret = "$place.3.0";} # netSnmpPassTimeTicks.0
+ elsif (($req =~ m/$place\.3\..*/) ||
+ ($req eq "$place.4")) { $ret = "$place.4.0";} # netSnmpPassIpAddress.0
+ elsif (($req =~ m/$place\.4\..*/) ||
+ ($req eq "$place.5")) { $ret = "$place.5.0";} # netSnmpPassCounter.0
+ elsif (($req =~ m/$place\.5\..*/) ||
+ ($req eq "$place.6")) { $ret = "$place.6.0";} # netSnmpPassGauge.0
+ else {
+ print "NONE\n";
+ next;
+ }
+ } else {
+ if ($req eq $place) {
+ print "NONE\n";
+ next;
+ } else {
+ $ret = $req;
+ }
+ }
+
+ print "$ret\n";
+
+ if ($ret eq "$place.1.0") {
+ print "string\nLife, the Universe, and Everything\n";
+ } elsif ($ret eq "$place.2.1.2.1") {
+ print "integer\n42\n";
+ } elsif ($ret eq "$place.2.1.3.1") {
+ print "objectid\n$place.99\n";
+ } elsif ($ret eq "$place.3.0") {
+ print "timeticks\n363136200\n";
+ } elsif ($ret eq "$place.4.0") {
+ print "ipaddress\n127.0.0.1\n";
+ } elsif ($ret eq "$place.5.0") {
+ $counter++;
+ print "counter\n$counter\n";
+ } elsif ($ret eq "$place.6.0") {
+ print "gauge\n42\n";
+ } else {
+ print "string\nack... $ret $req\n";
+ }
+}
diff --git a/local/passtest b/local/passtest
new file mode 100755
index 0000000..40209c9
--- /dev/null
+++ b/local/passtest
@@ -0,0 +1,82 @@
+#!/bin/sh -f
+
+PLACE=".1.3.6.1.4.1.8072.2.255" # NET-SNMP-PASS-MIB::netSnmpPassExamples
+REQ="$2" # Requested OID
+
+#
+# Process SET requests by simply logging the assigned value
+# Note that such "assignments" are not persistent,
+# nor is the syntax or requested value validated
+#
+if [ "$1" = "-s" ]; then
+ echo $* >> /tmp/passtest.log
+ exit 0
+fi
+
+#
+# GETNEXT requests - determine next valid instance
+#
+if [ "$1" = "-n" ]; then
+ case "$REQ" in
+ $PLACE| \
+ $PLACE.0| \
+ $PLACE.0.*| \
+ $PLACE.1) RET=$PLACE.1.0 ;; # netSnmpPassString.0
+
+ $PLACE.1.*| \
+ $PLACE.2| \
+ $PLACE.2.0| \
+ $PLACE.2.0.*| \
+ $PLACE.2.1| \
+ $PLACE.2.1.0| \
+ $PLACE.2.1.0.*| \
+ $PLACE.2.1.1| \
+ $PLACE.2.1.1.*| \
+ $PLACE.2.1.2| \
+ $PLACE.2.1.2.0) RET=$PLACE.2.1.2.1 ;; # netSnmpPassInteger.1
+
+ $PLACE.2.1.2.*| \
+ $PLACE.2.1.3| \
+ $PLACE.2.1.3.0) RET=$PLACE.2.1.3.1 ;; # netSnmpPassOID.1
+
+ $PLACE.2.*| \
+ $PLACE.3) RET=$PLACE.3.0 ;; # netSnmpPassTimeTicks.0
+ $PLACE.3.*| \
+ $PLACE.4) RET=$PLACE.4.0 ;; # netSnmpPassIpAddress.0
+ $PLACE.4.*| \
+ $PLACE.5) RET=$PLACE.5.0 ;; # netSnmpPassCounter.0
+ $PLACE.5.*| \
+ $PLACE.6) RET=$PLACE.6.0 ;; # netSnmpPassGauge.0
+
+ *) exit 0 ;;
+ esac
+else
+#
+# GET requests - check for valid instance
+#
+ case "$REQ" in
+ $PLACE.1.0| \
+ $PLACE.2.1.2.1| \
+ $PLACE.2.1.3.1| \
+ $PLACE.3.0| \
+ $PLACE.4.0| \
+ $PLACE.5.0| \
+ $PLACE.6.0) RET=$REQ ;;
+ *) exit 0 ;;
+ esac
+fi
+
+#
+# "Process" GET* requests - return hard-coded value
+#
+echo "$RET"
+case "$RET" in
+ $PLACE.1.0) echo "string"; echo "Life, the Universe, and Everything"; exit 0 ;;
+ $PLACE.2.1.2.1) echo "integer"; echo "42"; exit 0 ;;
+ $PLACE.2.1.3.1) echo "objectid"; echo "$PLACE.99"; exit 0 ;;
+ $PLACE.3.0) echo "timeticks"; echo "363136200"; exit 0 ;;
+ $PLACE.4.0) echo "ipaddress"; echo "127.0.0.1"; exit 0 ;;
+ $PLACE.5.0) echo "counter"; echo "42"; exit 0 ;;
+ $PLACE.6.0) echo "gauge"; echo "42"; exit 0 ;;
+ *) echo "string"; echo "ack... $RET $REQ"; exit 0 ;; # Should not happen
+esac
diff --git a/local/passtest.pl b/local/passtest.pl
new file mode 100755
index 0000000..c87fe18
--- /dev/null
+++ b/local/passtest.pl
@@ -0,0 +1,74 @@
+#!/usr/bin/perl
+$place = ".1.3.6.1.4.1.8072.2.255"; # NET-SNMP-PASS-MIB::netSnmpPassExamples
+$req = $ARGV[1]; # Requested OID
+
+#
+# Process SET requests by simply logging the assigned value
+# Note that such "assignments" are not persistent,
+# nor is the syntax or requested value validated
+#
+if ($ARGV[0] eq "-s") {
+ open LOG,">>/tmp/passtest.log";
+ print LOG "@ARGV\n";
+ close LOG;
+ exit 0;
+}
+
+#
+# GETNEXT requests - determine next valid instance
+#
+if ($ARGV[0] eq "-n") {
+ if (($req eq "$place") ||
+ ($req eq "$place.0") ||
+ ($req =~ m/$place\.0\..*/) ||
+ ($req eq "$place.1")) { $ret = "$place.1.0";} # netSnmpPassString.0
+ elsif (($req =~ m/$place\.1\..*/) ||
+ ($req eq "$place.2") ||
+ ($req eq "$place.2.0") ||
+ ($req =~ m/$place\.2\.0\..*/) ||
+ ($req eq "$place.2.1") ||
+ ($req eq "$place.2.1.0") ||
+ ($req =~ m/$place\.2\.1\.0\..*/) ||
+ ($req eq "$place.2.1.1") ||
+ ($req =~ m/$place\.2\.1\.1\..*/) ||
+ ($req eq "$place.2.1.2") ||
+ ($req eq "$place.2.1.2.0")) { $ret = "$place.2.1.2.1";} # netSnmpPassInteger.1
+ elsif (($req =~ m/$place\.2\.1\.2\..*/) ||
+ ($req eq "$place.2.1.3") ||
+ ($req eq "$place.2.1.3.0")) { $ret = "$place.2.1.3.1";} # netSnmpPassOID.1
+ elsif (($req =~ m/$place\.2\..*/) ||
+ ($req eq "$place.3")) { $ret = "$place.3.0";} # netSnmpPassTimeTicks.0
+ elsif (($req =~ m/$place\.3\..*/) ||
+ ($req eq "$place.4")) { $ret = "$place.4.0";} # netSnmpPassIpAddress.0
+ elsif (($req =~ m/$place\.4\..*/) ||
+ ($req eq "$place.5")) { $ret = "$place.5.0";} # netSnmpPassCounter.0
+ elsif (($req =~ m/$place\.5\..*/) ||
+ ($req eq "$place.6")) { $ret = "$place.6.0";} # netSnmpPassGauge.0
+ else {exit 0;}
+}
+else {
+#
+# GET requests - check for valid instance
+#
+ if ( ($req eq "$place.1.0") ||
+ ($req eq "$place.2.1.2.1") ||
+ ($req eq "$place.2.1.3.1") ||
+ ($req eq "$place.3.0") ||
+ ($req eq "$place.3.0") ||
+ ($req eq "$place.3.0") ||
+ ($req eq "$place.3.0")) { $ret = $req; }
+ else { exit 0;}
+}
+
+#
+# "Process" GET* requests - return hard-coded value
+#
+print "$ret\n";
+ if ($ret eq "$place.1.0") { print "string\nLife, the Universe, and Everything\n"; exit 0;}
+elsif ($ret eq "$place.2.1.2.1") { print "integer\n42\n"; exit 0;}
+elsif ($ret eq "$place.2.1.3.1") { print "objectid\n$place.99\n"; exit 0;}
+elsif ($ret eq "$place.3.0") { print "timeticks\n363136200\n"; exit 0;}
+elsif ($ret eq "$place.4.0") { print "ipaddress\n127.0.0.1\n"; exit 0;}
+elsif ($ret eq "$place.5.0") { print "counter\n42\n"; exit 0;}
+elsif ($ret eq "$place.6.0") { print "gauge\n42\n"; exit 0;}
+else { print "string\nack... $ret $req\n"; exit 0;} # Should not happen
diff --git a/local/snmp-bridge-mib b/local/snmp-bridge-mib
new file mode 100644
index 0000000..880ea6b
--- /dev/null
+++ b/local/snmp-bridge-mib
@@ -0,0 +1,1170 @@
+#!/usr/bin/perl
+#
+# Copyright (c) IBM Corp. 2009, 2010, All Rights Reserved
+#
+# Author(s): Vasileios Pappas <vpappas@us.ibm.com>
+# Jens Osterkamp <jens@linux.vnet.ibm.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+use NetSNMP::OID (':all');
+use NetSNMP::ASN (':all');
+use NetSNMP::agent (':all');
+
+sub STP_PROP_VALUE() { 0x01}
+sub STP_PROP_FILE() { 0x02}
+sub STP_PROP_DEC() { 0x04}
+sub STP_PROP_HEX() { 0x08}
+
+sub FDB_STATUS_OTHER { 1 }
+sub FDB_STATUS_INVALID { 2 }
+sub FDB_STATUS_LEARNED { 3 }
+sub FDB_STATUS_SELF { 4 }
+sub FDB_STATUS_MGMT { 5 }
+
+my %oid_value;
+my %oid_type;
+my %oid_next;
+my (%indexes, %interfaces, %macs, %ages, %locals, %vlans, %tagged);
+my $oid;
+
+$subagent=0;
+my $netdir="/sys/class/net/";
+my $targetbridge;
+
+$cache_timout=60;
+$last_populated=0;
+
+my $regoid = ".1.3.6.1.2.1.17";
+# are we running embedded ? If not, register as subagent
+if (!$agent) {
+ $agent = new NetSNMP::agent('Name' => 'dot1qbridge',
+ 'AgentX' => 1);
+ $subagent = 1;
+ if ( $#ARGV != 0) {
+ usage($0);
+ exit();
+ }
+ $targetbridge = $ARGV[0];
+} else {
+ if (!defined($bridge)) {
+ usage($0);
+ exit();
+ }
+ $targetbridge = $bridge;
+}
+
+$agent->register("dot1qbridge", ".1.3.6.1.2.1.17", \&request_handler) or die "registration of handler failed !\n";
+
+if ($subagent) {
+ # register handler for graceful shutdown
+ $SIG{'INT'} = \&shutdown;
+ $SIG{'QUIT'} = \&shutdown;
+ $running = 1;
+
+ while($running) {
+ $agent->agent_check_and_process(1);
+ }
+
+ $agent->shutdown();
+}
+
+sub usage {
+ my $name = shift;
+ if ($subagent) {
+ print $name."\n\n";
+ print "usage: \t$name <bridge> start snmp bridge module".
+ " for bridge <bridge>\n\n";
+ print "arguments: bridge name of the Linux bridge".
+ " which you want to provide info via snmp for.\n\n";
+ } else {
+ print 'usage in snmpd.conf: perl $bridge="br0"; perl do <path to $name>\n';
+ }
+ print "number of arguments given $#ARGV\n\n";
+}
+
+sub request_handler {
+ my ($handler, $registration_info, $request_info, $requests)=@_;
+ my $request;
+
+ populate_mib($targetbridge);
+
+ for($request = $requests; $request; $request = $request->next()) {
+ if($request_info->getMode() == MODE_GET) {
+ mode_get($request);
+ } elsif($request_info->getMode() == MODE_GETNEXT) {
+ mode_get_next($request);
+ } else {
+ print STDERR "mode not implemented.\n";
+ }
+ }
+}
+
+sub mode_get{
+ my ($request)=@_;
+ my $oid=$request->getOID();
+
+ $SNMP::use_numeric = 1;
+ my $noid=SNMP::translateObj($oid);
+
+ reply($request, $noid) if (exists $oid_value{$noid});
+}
+
+sub find_next{
+ my ($noid) = @_;
+ my $nextoid = $oid_next{$noid};
+ if(!defined($nextoid) || !defined($oid_value{$nextoid})) {
+ # find the lowest OID whis is higher than $noid
+ $prev = ".1.3.6.1.2.1.18";
+ $prev_oid = new NetSNMP::OID($prev);
+ $noid_oid = new NetSNMP::OID($noid);
+ #print "looking for next of $noid\n";
+ for my $candidate (keys %oid_value) {
+ #print "evaluating $candidate\n";
+ $candidate_oid = new NetSNMP::OID($candidate);
+ if ($noid_oid < $candidate_oid && $prev_oid > $candidate_oid) {
+ #print "found candidate $candidate\n";
+ $prev = $candidate;
+ $prev_oid = $candidate_oid;
+ }
+ }
+ if ($prev eq ".1.3.6.1.2.1.18") {
+ return; # no OID higher than $noid found
+ }
+ $nextoid = $prev;
+ }
+ return $nextoid;
+}
+
+sub mode_get_next{
+ my ($request)=@_;
+ my $oid=$request->getOID();
+ $SNMP::use_numeric = 1;
+ my $noid=SNMP::translateObj($oid);
+ my $nextoid = find_next($noid);
+ #print "found $nextoid\n";
+ if(defined($nextoid)) {
+ my $type = $oid_type{$nextoid};
+ my $value = $oid_value{$nextoid};
+ if (defined($type) and defined($value)) {
+ reply($request, $nextoid);
+ }
+ }
+}
+
+sub reply{
+ my ($request, $oid)=@_;
+
+ my $type=$oid_type{$oid};
+ my $value=$oid_value{$oid};
+
+ $request->setOID(new NetSNMP::OID($oid));
+ $request->setValue($type, $value);
+}
+
+# Populated MIB OID
+#
+## dot1dBasePort: 1.3.6.1.2.1.17.1.4.1.1.<dot1dBasePort>
+# INTEGER32
+#
+# dot1dBasePortIfIndex: 1.3.6.1.2.1.17.1.4.1.2.<dot1dBasePort>
+# INTEGER32
+#
+# dot1dStp*: 1.3.6.1.2.1.17.2.<1-14>
+# INTEGER, OCTET STRING
+#
+# dot1dTpFdbAddress: 1.3.6.1.2.1.17.4.3.1.1.<dot1dTpFdbAddress>
+# OCTET STRING (SIZE (6))
+#
+# dot1dTpFdbPort: 1.3.6.1.2.1.17.4.3.1.2.<dot1dTpFdbAddress>
+# INTEGER32
+#
+# dot1dTpFdbStatus: 1.3.6.1.2.1.17.4.3.1.3.<dot1dTpFdbAddress>
+# INTEGER
+# 1 : other
+# 2 : invalid
+# 3 : learned
+# 4 : self
+# 5 : mgmt
+#
+
+sub populate_mib {
+ my $now;
+ my $bridge = shift;
+ my $seconds_passed;
+ $ports=0;
+ $oid="";
+
+ $now=time();
+ $seconds_passed=$now-$last_populated;
+ return if($seconds_passed <= $cache_timout);
+ $last_populated=$now;
+
+ %oid_value=();
+ %oid_type=();
+ %oid_next=();
+ %indexes=();
+ %interfaces=();
+ %macs=();
+ %ages=();
+ %locals=();
+ %vlans=();
+ %tagged=();
+
+ # first populated oid
+ $oid_next{".1.3.6.1.2.1.17"}=".1.3.6.1.2.1.17.1.1";
+
+ createbaseinfo($bridge);
+
+ readindexes($bridge);
+ readforwards($bridge);
+ readvlans($bridge);
+
+ createports($bridge);
+
+ stpproperties($bridge);
+
+ stpportproperties($bridge);
+
+ dot1dTpproperties();
+
+ my $prevoid = $oid;
+ my $curroid = createmacs($bridge);
+ $oid_next{$prevoid} = $curroid;
+
+ portproperties($bridge);
+
+
+ dot1qbase($bridge);
+
+ dot1qfdb($bridge);
+
+ dot1qcurrentvlans($bridge);
+
+ return 0;
+}
+
+sub findbridges()
+{
+ my @bridges;
+
+ opendir(DIR, $netdir) or die "unable to open $netdir !\n";
+
+ while(my $br=readdir(DIR)){
+ next if $br eq ".";
+ next if $br eq "..";
+ next unless -d $netdir.$br."/bridge";
+ push @bridges, $br;
+ }
+
+ close(DIR);
+
+ return @bridges;
+}
+
+sub createbaseinfo()
+{
+ my $bridge = shift;
+
+ $oid=".1.3.6.1.2.1.17.1.1";
+ $oid_value{$oid}=mac2hex(readfile($netdir.$bridge."/address", 0));
+ $oid_type{$oid}=ASN_OCTET_STR;
+ $oid_next{$oid}=".1.3.6.1.2.1.17.1.2";
+
+ opendir(DIR, $netdir.$bridge."/brif/") or die "Could not open ".$netdir.$bridge."brif !\n";
+
+ foreach $entry (readdir(DIR)) {
+ next if $entry eq ".";
+ next if $entry eq "..";
+ # only count non-vlan interfaces
+ next if $entry =~ /\.[0-9]*/;
+ $ports++;
+ }
+
+ closedir(DIR);
+
+ $oid=".1.3.6.1.2.1.17.1.2";
+ $oid_value{$oid}=$ports;
+ $oid_type{$oid}=ASN_INTEGER;
+ $oid_next{$oid}=".1.3.6.1.2.1.17.1.3";
+
+ $oid=".1.3.6.1.2.1.17.1.3";
+ $oid_value{$oid}="2"; # transparent only
+ $oid_type{$oid}=ASN_INTEGER;
+ $oid_next{$oid}=".1.3.6.1.2.1.17.1.4.1.1.1";
+
+}
+
+sub createmacs()
+{
+ my $bridge = shift;
+ my $start_oid = $oid = ".1.3.6.1.2.1.17.4.3.1";
+
+ foreach my $mac (sort {$a cmp $b} keys %macs) {
+ my $mac_oid=mac2oid($mac);
+ unless(defined($first_mac_oid)){
+ $first_mac_oid=$mac_oid;
+ $oid_next{$oid.".1"}=$oid.".1".$mac_oid;
+ $oid_next{$oid.".2"}=$oid.".2".$mac_oid;
+ $oid_next{$oid.".3"}=$oid.".3".$mac_oid;
+ }
+ my $port=$macs{$mac}{$bridge};
+ my $baseport=$baseports{$bridge}{$port};
+ my $status=$locals{$mac}{$bridge};
+ my $age=$ages{$mac}{$bridge};
+
+ $oid_value{$oid.".1".$mac_oid}=mac2hex($mac);
+ $oid_type{$oid.".1".$mac_oid}=ASN_OCTET_STR;
+ if(defined($prv_mac_oid)){
+ $oid_next{$oid.".1".$prv_mac_oid}=
+ $oid.".1".$mac_oid;
+ }
+
+ $oid_value{$oid.".2".$mac_oid}=$baseport;
+ $oid_type{$oid.".2".$mac_oid}=ASN_INTEGER;
+ if(defined($prv_mac_oid)){
+ $oid_next{$oid.".2".$prv_mac_oid}=
+ $oid.".2".$mac_oid;
+ }
+
+ $oid_value{$oid.".3".$mac_oid}=$status;
+ $oid_type{$oid.".3".$mac_oid}=ASN_INTEGER;
+ if(defined($prv_mac_oid)){
+ $oid_next{$oid.".3".$prv_mac_oid}=
+ $oid.".3".$mac_oid;
+ }
+
+ $prv_mac_oid=$mac_oid;
+ }
+
+ if ($prv_mac_oid and $first_mac_oid) {
+ $oid_next{$oid.".1".$prv_mac_oid}=$oid.".2".$first_mac_oid;
+ $oid_next{$oid.".2".$prv_mac_oid}=$oid.".3".$first_mac_oid;
+ $oid_next{$oid.".3".$prv_mac_oid}=".1.3.6.1.2.1.17.4.4.1.1.1";
+ }
+
+ undef $prv_mac_oid;
+ undef $first_mac_oid;
+
+ return $start_oid.".1".$first_mac_oid;
+}
+
+# TODO: is this sequence complete ?
+sub createports()
+{
+ my $bridge = shift;
+ my ($baseport, $prev_baseport, $first_baseport);
+ $baseport=1;
+ my $oid= '.1.3.6.1.2.1.17.1.4.1';
+
+ foreach my $port (keys %{$interfaces{$bridge}}) {
+ unless(defined($first_baseport)){
+ $first_baseport=$baseport;
+ $oid_next{$oid.".1"}=$oid.".1.".$baseport;
+ $oid_next{$oid.".2"}=$oid.".2.".$baseport;
+ }
+ my $index=$indexes{$bridge}{$port};
+ $baseports{$bridge}{$port}=$baseport;
+
+ $oid_value{$oid.".1.".$baseport}=$baseport;
+ $oid_type{$oid.".1.".$baseport}=ASN_INTEGER;
+ if(defined($prv_baseport)){
+ $oid_next{$oid.".1.".$prv_baseport}=
+ $oid.".1.".$baseport;
+ }
+
+ $oid_value{$oid.".2.".$baseport}=$index;
+ $oid_type{$oid.".2.".$baseport}=ASN_INTEGER;
+ if(defined($prv_baseport)){
+ $oid_next{$oid.".2.".$prv_baseport}=
+ $oid.".2.".$baseport;
+ }
+
+ $prv_baseport=$baseport;
+ $baseport++;
+ }
+
+ if ( $prv_baseport and $first_baseport ) {
+ $oid_next{$oid.".1.".$prv_baseport}=$oid.".2.".$first_baseport;
+ $oid_next{$oid.".2.".$prv_baseport}=".1.3.6.1.2.1.17.2.1";
+ }
+
+ undef $prv_baseport;
+ undef $first_baseport;
+
+}
+
+sub stpproperties()
+{
+ my $bridge = shift;
+ my $dir = $netdir.$bridge."/bridge/";
+
+ @stpprops = ( { oid => ".1.3.6.1.2.1.17.2.1",
+ flags => STP_PROP_VALUE,
+ value => "3",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.2" },
+ { oid => ".1.3.6.1.2.1.17.2.2",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."priority",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.3" },
+ { oid => ".1.3.6.1.2.1.17.2.3",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."topology_change_timer",
+ type => ASN_TIMETICKS,
+ nextoid => ".1.3.6.1.2.1.17.2.4" },
+ { oid => ".1.3.6.1.2.1.17.2.4",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."topology_change",
+ type => ASN_COUNTER,
+ nextoid => ".1.3.6.1.2.1.17.2.5" },
+ { oid => ".1.3.6.1.2.1.17.2.5",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."root_id",
+ type => ASN_OCTET_STR,
+ nextoid => ".1.3.6.1.2.1.17.2.6" },
+ { oid => ".1.3.6.1.2.1.17.2.6",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."root_path_cost",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.7" },
+ { oid => ".1.3.6.1.2.1.17.2.7",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."root_port",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.8" },
+ { oid => ".1.3.6.1.2.1.17.2.8",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."max_age",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.9" },
+ { oid => ".1.3.6.1.2.1.17.2.9",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."hello_time",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.11" },
+ # TODO ...17.2.10
+ { oid => ".1.3.6.1.2.1.17.2.11",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."forward_delay",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.12" },
+ { oid => ".1.3.6.1.2.1.17.2.12",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."max_age",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.13" },
+ { oid => ".1.3.6.1.2.1.17.2.13",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."hello_time",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.14" },
+ { oid => ".1.3.6.1.2.1.17.2.14",
+ flags => STP_PROP_FILE | STP_PROP_DEC,
+ value => $dir."forward_delay",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.2.15.1.1.1" },
+ );
+
+ for ($i=0; $i <= $#stpprops; $i++) {
+ my %props = %{$stpprops[$i]};
+ $oid = $props{'oid'};
+ if ( $props{'flags'} & STP_PROP_VALUE,) {
+ $oid_value{$oid} = $props{'value'};
+ }
+ if ( $props{'flags'} & STP_PROP_FILE,) {
+ $oid_value{$oid} =
+ readfile($props{'value'},
+ $props{'flags'});
+ }
+ $oid_type{$oid} = $props{'type'};
+ $oid_next{$oid} = $props{'nextoid'};
+ }
+}
+
+sub stpportproperties
+{
+ my $bridge = shift;
+ my $brifdir = $netdir.$bridge."/brif/";
+ my ($baseport, $first_baseport, $prev_baseport);
+
+ $oid='.1.3.6.1.2.1.17.2.15.1';
+
+ foreach my $port (keys %{$interfaces{$bridge}}) {
+ $baseport = $baseports{$bridge}{$port};
+
+ unless(defined($first_baseport)){
+ $first_baseport=$baseport;
+ $oid_next{$oid.".1"}=$oid.".1.".$baseport;
+ $oid_next{$oid.".2"}=$oid.".2.".$baseport;
+ }
+
+ my $interface = $interfaces{$bridge}{$port};
+ my $ifdir = $brifdir.$interface;
+
+ # dot1dStpPort
+ $oid_value{$oid.".1.".$baseport}=$baseport;
+ $oid_type{$oid.".1.".$baseport}=ASN_INTEGER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".1.".$prev_baseport}=
+ $oid.".1.".$baseport;
+ }
+
+ # dot1dStpPortPriority
+ $oid_value{$oid.".2.".$baseport}=readfile($ifdir."/priority", 0);
+ $oid_type{$oid.".2.".$baseport}=ASN_INTEGER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".2.".$prev_baseport}=
+ $oid.".2.".$baseport;
+ }
+
+ # dot1dStpPortState
+ my @translation = (1, 3, 4, 5, 2);
+ my $state = readfile($ifdir."/state", 0);
+ $oid_value{$oid.".3.".$baseport}=$translation[$state];
+ $oid_type{$oid.".3.".$baseport}=ASN_INTEGER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".3.".$prev_baseport}=
+ $oid.".3.".$baseport;
+ }
+
+ # dot1dStpPortEnable
+ @translation = (2, 1, 1, 1, 1);
+ $oid_value{$oid.".4.".$baseport}=$translation[$state];
+ $oid_type{$oid.".4.".$baseport}=ASN_INTEGER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".4.".$prev_baseport}=
+ $oid.".4.".$baseport;
+ }
+
+ # dot1dStpPortPathCost
+ $oid_value{$oid.".5.".$baseport}=readfile($ifdir."/path_cost", 0);
+ $oid_type{$oid.".5.".$baseport}=ASN_INTEGER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".5.".$prev_baseport}=
+ $oid.".5.".$baseport;
+ }
+
+ # dot1dStpPortDesignatedRoot
+ $oid_value{$oid.".6.".$baseport}=readfile($ifdir."/designated_root", 0);
+ $oid_type{$oid.".6.".$baseport}=ASN_OCTET_STR;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".6.".$prev_baseport}=
+ $oid.".6.".$baseport;
+ }
+
+ # dot1dStpPortDesignatedCost
+ $oid_value{$oid.".7.".$baseport}=readfile($ifdir."/designated_cost", 0);
+ $oid_type{$oid.".7.".$baseport}=ASN_INTEGER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".7.".$prev_baseport}=
+ $oid.".7.".$baseport;
+ }
+
+ # dot1dStpPortDesignatedBridge
+ $oid_value{$oid.".8.".$baseport}=readfile($ifdir."/designated_bridge", 0);
+ $oid_type{$oid.".8.".$baseport}=ASN_OCTET_STR;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".8.".$prev_baseport}=
+ $oid.".8.".$baseport;
+ }
+
+ # dot1dStpPortDesignatedPort
+ $oid_value{$oid.".9.".$baseport}=readfile($ifdir."/designated_port", 0);
+ $oid_type{$oid.".9.".$baseport}=ASN_OCTET_STR;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".9.".$prev_baseport}=
+ $oid.".9.".$baseport;
+ }
+
+ # dot1dStpPortForwardTransitions (no value in bridge module)
+
+ # dot1dStpPortPathCost32
+ $oid_value{$oid.".11.".$baseport}=readfile($ifdir."/path_cost", 0);
+ $oid_type{$oid.".11.".$baseport}=ASN_INTEGER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".11.".$prev_baseport}=
+ $oid.".11.".$baseport;
+ }
+
+
+ $prev_baseport=$baseport;
+ }
+
+ if ( $prev_baseport and $first_baseport ) {
+ $oid_next{$oid.".1.".$prev_baseport}=$oid.".2.".$first_baseport;
+ $oid_next{$oid.".2.".$prev_baseport}=$oid.".3.".$first_baseport;
+ $oid_next{$oid.".3.".$prev_baseport}=$oid.".4.".$first_baseport;
+ $oid_next{$oid.".4.".$prev_baseport}=$oid.".5.".$first_baseport;
+ $oid_next{$oid.".5.".$prev_baseport}=$oid.".6.".$first_baseport;
+ $oid_next{$oid.".6.".$prev_baseport}=$oid.".7.".$first_baseport;
+ $oid_next{$oid.".7.".$prev_baseport}=$oid.".8.".$first_baseport;
+ $oid_next{$oid.".8.".$prev_baseport}=$oid.".9.".$first_baseport;
+ $oid_next{$oid.".9.".$prev_baseport}=$oid.".11.".$first_baseport;
+ $oid_next{$oid.".11.".$prev_baseport}=".1.3.6.1.2.1.17.4.1";
+ }
+
+ $oid = $oid.".11.".$prev_baseport;
+
+ undef $prev_baseport;
+ undef $first_baseport;
+
+}
+
+sub dot1dTpproperties()
+{
+ @stpprops = ( { oid => ".1.3.6.1.2.1.17.4.1",
+ flags => STP_PROP_VALUE,
+ value => "0",
+ type => ASN_COUNTER,
+ nextoid => ".1.3.6.1.2.1.17.4.2" },
+ { oid => ".1.3.6.1.2.1.17.4.2",
+ flags => STP_PROP_VALUE,
+ value => "300",
+ type => ASN_INTEGER,
+ nextoid => ".1.3.6.1.2.1.17.4.3" },
+ );
+
+ for ($i=0; $i <= $#stpprops; $i++) {
+ my %props = %{$stpprops[$i]};
+ $oid = $props{'oid'};
+ if ( $props{'flags'} & STP_PROP_VALUE,) {
+ $oid_value{$oid} = $props{'value'};
+ }
+ if ( $props{'flags'} & STP_PROP_FILE,) {
+ $oid_value{$oid} =
+ readfile($props{'value'},
+ $props{'flags'});
+ }
+ $oid_type{$oid} = $props{'type'};
+ $oid_next{$oid} = $props{'nextoid'};
+ }
+}
+
+sub portproperties
+{
+ my $bridge = shift;
+ my ($baseport, $first_baseport, $prev_baseport);
+
+ $oid='.1.3.6.1.2.1.17.4.4.1';
+
+ foreach my $port (keys %{$interfaces{$bridge}}) {
+ $baseport = $baseports{$bridge}{$port};
+
+ unless(defined($first_baseport)){
+ $first_baseport=$baseport;
+ $oid_next{$oid.".1"}=$oid.".1.".$baseport;
+ $oid_next{$oid.".2"}=$oid.".2.".$baseport;
+ }
+
+ my $interface = $interfaces{$bridge}{$port};
+ my $ifdir = $netdir.$interface;
+
+ # dot1dTpPort
+ $oid_value{$oid.".1.".$baseport}=$baseport;
+ $oid_type{$oid.".1.".$baseport}=ASN_INTEGER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".1.".$prev_baseport}=
+ $oid.".1.".$baseport;
+ }
+
+ # dot1dTpPortMaxInfo
+ $oid_value{$oid.".2.".$baseport}=readfile($ifdir."/mtu", 0);
+ $oid_type{$oid.".2.".$baseport}=ASN_INTEGER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".2.".$prev_baseport}=
+ $oid.".2.".$baseport;
+ }
+
+ # dot1dTpPortInFrames
+ $oid_value{$oid.".3.".$baseport}=readfile($ifdir."/statistics/rx_packets", 0);
+ $oid_type{$oid.".3.".$baseport}=ASN_COUNTER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".3.".$prev_baseport}=
+ $oid.".3.".$baseport;
+ }
+
+ # dot1dTpPortOutFrames
+ $oid_value{$oid.".4.".$baseport}=readfile($ifdir."/statistics/tx_packets", 0);
+ $oid_type{$oid.".4.".$baseport}=ASN_COUNTER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".4.".$prev_baseport}=
+ $oid.".4.".$baseport;
+ }
+
+ # dot1dTpPortInDiscards
+ $oid_value{$oid.".5.".$baseport}=readfile($ifdir."/statistics/rx_dropped", 0);
+ $oid_type{$oid.".5.".$baseport}=ASN_COUNTER;
+ if(defined($prev_baseport)){
+ $oid_next{$oid.".5.".$prev_baseport}=
+ $oid.".5.".$baseport;
+ }
+
+ $prev_baseport=$baseport;
+ }
+
+ if ( $prev_baseport and $first_baseport ) {
+ $oid_next{$oid.".1.".$prev_baseport}=$oid.".2.".$first_baseport;
+ $oid_next{$oid.".2.".$prev_baseport}=$oid.".3.".$first_baseport;
+ $oid_next{$oid.".3.".$prev_baseport}=$oid.".4.".$first_baseport;
+ $oid_next{$oid.".4.".$prev_baseport}=$oid.".5.".$first_baseport;
+ $oid_next{$oid.".5.".$prev_baseport}=".1.3.6.1.2.1.17.5.1";
+ }
+
+ $oid = $oid.".5.".$prev_baseport;
+
+ undef $prev_baseport;
+ undef $first_baseport;
+}
+
+sub dot1qbase()
+{
+ my $bridge = shift;
+
+ my $oid=".1.3.6.1.2.1.17.7.1.1";
+ $oid_next{".1.3.6.1.2.1.17.7"}=$oid.".1";
+ $oid_next{".1.3.6.1.2.1.17.7.1"}=$oid.".1";
+
+ $oid_value{$oid.".1"}=1;
+ $oid_type{$oid.".1"}=ASN_INTEGER;
+ $oid_next{$oid.".1"}=$oid.".2";
+
+ $oid_value{$oid.".2"}=4094;
+ $oid_type{$oid.".2"}=ASN_UNSIGNED;
+ $oid_next{$oid.".2"}=$oid.".3";
+
+ $oid_value{$oid.".3"}=4094;
+ $oid_type{$oid.".3"}=ASN_UNSIGNED;
+ $oid_next{$oid.".3"}=$oid.".4";
+
+ $oid_value{$oid.".4"}=0; # filled in by currentvlans
+ $oid_type{$oid.".4"}=ASN_UNSIGNED;
+ $oid_next{$oid.".4"}=$oid.".5";
+
+ $oid_value{$oid.".5"}=2;
+ $oid_type{$oid.".5"}=ASN_INTEGER;
+ $oid_next{$oid.".5"}=0; # filled in by dot1qfdb
+
+}
+
+sub dot1qfdb()
+{
+ my $bridge = shift;
+
+ my $oid=".1.3.6.1.2.1.17.7.1.2";
+ foreach my $vlan (sort {$a<=>$b} keys %vlans){
+ unless(defined($first_vlan)){
+ $first_vlan=$vlan;
+ $oid_next{".1.3.6.1.2.1.17.7.1.1.5"}=$oid.".1.1.".$vlan;
+ $oid_next{$oid}=$oid.".1.1.".$vlan;
+ $oid_next{$oid.".1"}=$oid.".1.1.".$vlan;
+ $oid_next{$oid.".1.1"}=$oid.".1.1.".$vlan;
+ $oid_next{$oid.".1.2"}=$oid.".1.2.".$vlan;
+ }
+
+ $oid_value{$oid.".1.1.".$vlan}=$vlan;
+ $oid_type{$oid.".1.1.".$vlan}=ASN_UNSIGNED;
+ if(defined($prv_vlan)){
+ $oid_next{$oid.".1.1.".$prv_vlan}=$oid.".1.1.".$vlan;
+ }
+
+ $oid_value{$oid.".1.2.".$vlan}=0; # to be filled later
+ $oid_type{$oid.".1.2.".$vlan}=ASN_COUNTER;
+ if(defined($prv_vlan)){
+ $oid_next{$oid.".1.2.".$prv_vlan}=$oid.".1.2.".$vlan;
+ }
+
+ $prv_vlan=$vlan;
+ }
+ if($prv_vlan and $first_vlan){
+ $oid_next{$oid.".1.1.".$prv_vlan}=$oid.".1.2.".$first_vlan;
+ $oid_next{$oid.".1.2.".$prv_vlan}=0; # to be filled later
+ }
+
+ my %macvlan=();
+ my %vlanmac=();
+
+ foreach my $vlan (sort {$a<=>$b} keys %vlans){
+ my $count=0;
+ foreach my $mac (sort {$a cmp $b} keys %macs) {
+ my $vbridge=$bridge."_vlan".$vlan;
+ next unless(defined($macs{$mac}{$vbridge}));
+ $count++;
+ my $mac_oid=mac2oid($mac);
+ $macvlan{$vlan.$mac_oid}=$mac;
+ $vlanmac{$vlan.$mac_oid}=$vlan;
+ }
+ $oid_value{$oid.".1.2.".$vlan}=$count;
+ }
+
+ foreach my $vmac_oid (sort {$a cmp $b} keys %vlanmac){
+ my $mac=$macvlan{$vmac_oid};
+ my $vlan=$vlanmac{$vmac_oid};
+
+ #print "VMAC: $vmac_oid ($vlan:$mac)\n";
+ unless(defined($first_vmac_oid)){
+ $first_vmac_oid=$vmac_oid;
+ $oid_next{$oid.".1.2.".$prv_vlan}=$oid.".2.1.".$vmac_oid;
+ $oid_next{$oid.".2"}=$oid.".2.1.".$vmac_oid;
+ $oid_next{$oid.".2.1"}=$oid.".2.1.".$vmac_oid;
+ $oid_next{$oid.".2.2"}=$oid.".2.2.".$vmac_oid;
+ $oid_next{$oid.".2.3"}=$oid.".2.3.".$vmac_oid;
+ }
+
+ my $port=$macs{$mac}{$bridge};
+ my $baseport=$baseports{$bridge}{$port};
+ my $status=$locals{$mac}{$bridge};
+ my $age=$ages{$mac}{$bridge};
+
+ print "VLAN $vlan: $mac -> $port:$baseport ($status, $age)\n";
+
+ $oid_value{$oid.".2.1.".$vmac_oid}=mac2hex($mac);
+ $oid_type{$oid.".2.1.".$vmac_oid}=ASN_OCTET_STR;
+ if(defined($prv_vmac_oid)){
+ $oid_next{$oid.".2.1.".$prv_vmac_oid}=$oid.".2.1.".$vmac_oid;
+ }
+
+ $oid_value{$oid.".2.2.".$vmac_oid}=$baseport;
+ $oid_type{$oid.".2.2.".$vmac_oid}=ASN_INTEGER;
+ if(defined($prv_vmac_oid)){
+ $oid_next{$oid.".2.2.".$prv_vmac_oid}=$oid.".2.2.".$vmac_oid;
+ }
+
+ $oid_value{$oid.".2.3.".$vmac_oid}=$status;
+ $oid_type{$oid.".2.3.".$vmac_oid}=ASN_INTEGER;
+ if(defined($prv_vmac_oid)){
+ $oid_next{$oid.".2.3.".$prv_vmac_oid}=$oid.".2.3.".$vmac_oid;
+ }
+ $prv_vmac_oid=$vmac_oid;
+ }
+
+ if ($prv_vmac_oid and $first_vmac_oid) {
+ $oid_next{$oid.".2.1.".$prv_vmac_oid}=$oid.".2.2.".$first_vmac_oid;
+ $oid_next{$oid.".2.2.".$prv_vmac_oid}=$oid.".2.3.".$first_vmac_oid;
+ $oid_next{$oid.".2.3.".$prv_vmac_oid}=".1.3.6.1.2.1.17.7.1.4.1";
+ }
+
+ undef $first_vmac_oid;
+ undef $prv_vmac_oid;
+
+ undef $first_vlan;
+ undef $prv_vlan;
+}
+
+sub dot1qcurrentvlans()
+{
+ my $bridge = shift;
+
+
+ my $oid=".1.3.6.1.2.1.17.7.1.4.1";
+ $oid_next{".1.3.6.1.2.1.17.7.1.4"}=$oid;
+
+ $oid_value{$oid}=0; # can't keep track of this info
+ $oid_type{$oid}=ASN_COUNTER;
+
+ my $count=0;
+ $oid=".1.3.6.1.2.1.17.7.1.4.2";
+ foreach my $vlan (sort {$a<=>$b} keys %vlans){
+ $count++;
+ my @allports=();
+ my @untaggedports=();
+ foreach my $port (keys %{$vlans{$vlan}}){
+ $baseport=$baseports{$bridge}{$port};
+ push @allports, $baseport;
+ push @untaggedports, $baseport
+ unless($tagged{$vlan}{$port});
+ }
+ #print "ADDING: vlan $vlan (@allports, @untaggedports)\n";
+ unless(defined($first_vlan)){
+ $first_vlan=$vlan;
+ $oid_next{".1.3.6.1.2.1.17.7.1.4.1"}=$oid.".1.0.".$vlan;
+ $oid_next{$oid}=$oid.".1.0.".$vlan;
+ $oid_next{$oid.".1"}=$oid.".1.0.".$vlan;
+ $oid_next{$oid.".2"}=$oid.".2.0.".$vlan;
+ $oid_next{$oid.".3"}=$oid.".3.0.".$vlan;
+ $oid_next{$oid.".4"}=$oid.".4.0.".$vlan;
+ $oid_next{$oid.".5"}=$oid.".5.0.".$vlan;
+ $oid_next{$oid.".6"}=$oid.".6.0.".$vlan;
+ $oid_next{$oid.".7"}=$oid.".7.0.".$vlan;
+ }
+
+ $oid_value{$oid.".1.0.".$vlan}=0; # can't keep track of this
+ $oid_type{$oid.".1.0.".$vlan}=ASN_TIMETICKS;
+ if(defined($prv_vlan)){
+ $oid_next{$oid.".1.0.".$prv_vlan}=$oid.".1.0.".$vlan;
+ }
+
+ $oid_value{$oid.".2.0.".$vlan}=$vlan;
+ $oid_type{$oid.".2.0.".$vlan}=ASN_UNSIGNED;
+ if(defined($prv_vlan)){
+ $oid_next{$oid.".2.0.".$prv_vlan}=$oid.".2.0.".$vlan;
+ }
+
+ $oid_value{$oid.".3.0.".$vlan}=$vlan;
+ $oid_type{$oid.".3.0.".$vlan}=ASN_UNSIGNED;
+ if(defined($prv_vlan)){
+ $oid_next{$oid.".3.0.".$prv_vlan}=$oid.".3.0.".$vlan;
+ }
+
+ $oid_value{$oid.".4.0.".$vlan}=getportlist(@allports);
+ $oid_type{$oid.".4.0.".$vlan}=ASN_OCTET_STR;
+ if(defined($prv_vlan)){
+ $oid_next{$oid.".4.0.".$prv_vlan}=$oid.".4.0.".$vlan;
+ }
+
+ $oid_value{$oid.".5.0.".$vlan}=getportlist(@untaggedports);
+ $oid_type{$oid.".5.0.".$vlan}=ASN_OCTET_STR;
+ if(defined($prv_vlan)){
+ $oid_next{$oid.".5.0.".$prv_vlan}=$oid.".5.0.".$vlan;
+ }
+
+ $oid_value{$oid.".6.0.".$vlan}=1;
+ $oid_type{$oid.".6.0.".$vlan}=ASN_INTEGER;
+ if(defined($prv_vlan)){
+ $oid_next{$oid.".6.0.".$prv_vlan}=$oid.".6.0.".$vlan;
+ }
+
+ $oid_value{$oid.".7.0.".$vlan}=0;
+ $oid_type{$oid.".7.0.".$vlan}=ASN_TIMETICKS;
+ if(defined($prv_vlan)){
+ $oid_next{$oid.".7.0.".$prv_vlan}=$oid.".7.0.".$vlan;
+ }
+ $prv_vlan=$vlan;
+ }
+
+ $oid_value{".1.3.6.1.2.1.17.7.1.1.4"}=$count;
+ if($prv_vlan and $first_vlan){
+ $oid_next{$oid.".1.0.".$prv_vlan}=$oid.".2.0.".$first_vlan;
+ $oid_next{$oid.".2.0.".$prv_vlan}=$oid.".3.0.".$first_vlan;
+ $oid_next{$oid.".3.0.".$prv_vlan}=$oid.".4.0.".$first_vlan;
+ $oid_next{$oid.".4.0.".$prv_vlan}=$oid.".5.0.".$first_vlan;
+ $oid_next{$oid.".5.0.".$prv_vlan}=$oid.".6.0.".$first_vlan;
+ $oid_next{$oid.".6.0.".$prv_vlan}=$oid.".7.0.".$first_vlan;
+ $oid_next{$oid.".7.0.".$prv_vlan}=".1.3.6.1.2.1.17.7.1.4.3";
+ }
+
+ undef $prv_vlan;
+ undef $first_vlan;
+
+}
+
+sub readforwards()
+{
+ my $bridge = shift;
+ my $fdb=$netdir.$bridge."/brforward";
+
+ open(FWD, $fdb) or return -1;
+ while(sysread(FWD, $data, 20)){
+ my $mac;
+ my ($b1,$b2,$b3,$b4,$b5,$b6,$port,$local,$age,$hi)=
+ unpack("C6 C C L C x3", $data);
+ $mac=sprintf("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
+ $b1,$b2,$b3,$b4,$b5,$b6);
+ $age=$age/100;
+ $macs{$mac}{$bridge}=$port;
+ $ages{$mac}{$bridge}=$age;
+ $locals{$mac}{$bridge}=FDB_STATUS_LEARNED;
+ next if ($local);
+ $macs{$mac}{$bridge}=$bridge;
+ $locals{$mac}{$bridge}=FDB_STATUS_SELF;
+ }
+ close(FWD);
+}
+
+sub readindexes()
+{
+ my $bridge = shift;
+
+ my $brifdir=$netdir.$bridge."/brif/";
+
+ opendir(DIR, $brifdir) or return -1;
+ my @interfaces = readdir(DIR);
+ next if ($#interfaces lt 2);
+ foreach my $if (@interfaces) {
+ next if $if eq ".";
+ next if $if eq "..";
+
+ my $port=hex(readfile($brifdir.$if."/port_no", 0));
+ my $index=readfile($netdir.$if."/ifindex", 0);
+
+ $indexes{$bridge}{$port}=$index;
+ $interfaces{$bridge}{$port}=$if;
+ }
+
+ $indexes{$bridge}{$bridge}=readfile($netdir.$bridge."/ifindex", 0);
+
+ close(DIR);
+}
+
+sub readvlans()
+{
+ my $bridge = shift;
+ my $brifdir = $netdir.$bridge."/brif/";
+ my %ifs;
+
+ opendir(DIR, $brifdir) or return -1;
+ my @interfaces = readdir(DIR);
+ return if ($#interfaces < 2);
+ foreach my $if (@interfaces) {
+ next if $if eq ".";
+ next if $if eq "..";
+ $ifs{$if}=1;
+ }
+ close(DIR);
+
+ opendir(DIR, $netdir) or return -1;
+ @interfaces = readdir(DIR);
+ return 0 if ($#interfaces < 2);
+ foreach my $if (@interfaces) {
+ next if $if eq ".";
+ next if $if eq "..";
+ next unless($if=~/^(.*)\.(\d+)$/);
+ my $pif=$1;
+ my $vlan=$2;
+ next unless(defined($ifs{$pif}));
+ tracevlan($vlan, $if, $bridge);
+ }
+ close(DIR);
+}
+
+sub tracevlan{
+ my ($vlan, $interface, $bridge)=@_;
+
+ my $brifdir=$netdir.$interface."/brport/bridge/brif/";
+
+ opendir(DIR, $brifdir) or return -1;
+ my @interfaces = readdir(DIR);
+ return if ($#interfaces < 2);
+ foreach my $if (@interfaces) {
+ next if $if eq ".";
+ next if $if eq "..";
+ my $port;
+ my $index;
+ if($if=~/^(.*)\.(\d+)$/){
+ my $pif=$1;
+ $brifdir=$netdir.$pif."/brport/bridge/brif/";
+ $port=hex(readfile($brifdir.$pif."/port_no", 0));
+ $index=readfile($netdir.$pif."/ifindex", 0);
+ #$indexes{$bridge}{$port}=$index;
+ #$interfaces{$bridge}{$port}=$if;
+ $tagged{$vlan}{$port}=1;
+ }else{
+ my $brid=readfile($netdir.$if."/brport/bridge/ifindex", 0);
+ $brifdir=$netdir.$if."/brport/bridge/brif/";
+ $port=hex(readfile($brifdir.$if."/port_no", 0));
+ $port=$brid*1000+$port; #create a unique port number
+ $index=readfile($netdir.$if."/ifindex", 0);
+ $indexes{$bridge}{$port}=$index;
+ $interfaces{$bridge}{$port}=$if;
+ $tagged{$vlan}{$port}=0;
+ }
+ $vlans{$vlan}{$port}=1;
+ #print "VLAN: $vlan -> $if ($port <-> $index)\n";
+ }
+ close(DIR);
+
+ my $brid=readfile($netdir.$interface."/brport/bridge/ifindex", 0);
+ my $fdb=$netdir.$interface."/brport/bridge/brforward";
+
+ my $vbridge=$bridge."_vlan".$vlan;
+ open(FWD, $fdb) or return -1;
+ while(sysread(FWD, $data, 20)){
+ my $mac;
+ my ($b1,$b2,$b3,$b4,$b5,$b6,$port,$local,$age,$hi)=
+ unpack("C6 C C L C x3", $data);
+ $mac=sprintf("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
+ $b1,$b2,$b3,$b4,$b5,$b6);
+ $port=$brid*1000+$port unless(defined($indexes{$bridge}{$port})); #create a unique port number
+ $age=$age/100;
+ #$macs{$mac}{$bridge}=$port;
+ $macs{$mac}{$vbridge}=$port;
+ #$ages{$mac}{$bridge}=$age;
+ $ages{$mac}{$vbridge}=$age;
+ #$locals{$mac}{$bridge}=FDB_STATUS_LEARNED;
+ $locals{$mac}{$vbridge}=FDB_STATUS_LEARNED;
+ next if ($local);
+ #$macs{$mac}{$bridge}=$bridge;
+ $macs{$mac}{$vbridge}=$bridge;
+ #$locals{$mac}{$bridge}=FDB_STATUS_SELF;
+ $locals{$mac}{$vbridge}=FDB_STATUS_SELF;
+ }
+ close(FWD);
+}
+
+sub readfile()
+{
+ my $file = shift;
+ my $flags = shift;
+
+ open(FILE, $file) or print "Could not open file $file !\n";
+ my $value=<FILE>;
+ chomp $value;
+ close(FILE);
+
+ if ($flags & STP_PROP_HEX) {
+ return hex($value);
+ }
+
+ return $value;
+}
+
+sub getportlist{
+ my @ports=@_;
+ my $portlist="";
+
+ @ports=sort {$a <=> $b} @ports;
+ my $last=1;
+ foreach my $port (@ports){
+ for(my $i=$last; $i<$port; $i++){
+ $portlist=$portlist."0";
+ }
+ $portlist=$portlist."1";
+ $last=$port+1;
+ }
+ return pack('B*',$portlist);
+}
+
+sub mac2oid{
+ my ($mac)=@_;
+ my @octets=split(/:/,$mac);
+
+ $mac="";
+ foreach my $octet (@octets){
+ $mac=$mac.".".hex($octet);
+ }
+ return $mac;
+}
+
+sub mac2hex{
+ my ($mac)=@_;
+ my @decimals;
+ my @octets=split(/:/,$mac);
+
+ foreach my $octet (@octets){
+ push @decimals, hex($octet);
+ }
+ return pack("CCCCCC", @decimals);
+}
+
+sub shutdown {
+ $running = 0;
+}
diff --git a/local/snmp-ucd.sh b/local/snmp-ucd.sh
new file mode 100755
index 0000000..7d16b74
--- /dev/null
+++ b/local/snmp-ucd.sh
@@ -0,0 +1,187 @@
+#!/bin/sh
+#
+# snmpd-ucd.sh
+#
+# Start UCD SNMP daemon and trap catcher. Backup the log file *first*
+# since currently the daemon truncates and overwrites any pre-existing file.
+#
+# killproc() and pidofproc() lifted from Linux's /etc/init.d/functions.
+#
+# NOTE: Solaris users must uncomment the proper PSARGS definition below. XXX
+#
+
+USAGE="Usage: `basename $0` start|stop|restart"
+
+
+
+#------------------------------------ -o-
+# Globals.
+#
+DAEMONLOG=/var/log/snmpd.log
+ TRAPLOG=/var/log/snmptrapd.log
+ LOGDIR=/var/log/SNMPDLOGS
+
+D=".`date '+%h%d_%H%M' | sed 's/\([a-z]\)0/\1/' | tr 'A-Z' 'a-z'`"
+
+PSARGS=auwwx
+#PSARGS=-ef # Solaris.
+
+DEBUGFLAG= # -D # Toggles use of debugging
+
+
+
+
+#------------------------------------ -o-
+# Function definitions.
+#
+killproc() { # <program> [signal]
+ base=
+ killlevel="-9"
+ notset=1
+ pid=
+
+
+ #
+ # Parse.
+ #
+ [ $# = 0 ] && {
+ echo "`basename $0`: Wrong arguments to killproc()." 1>&2
+ return 1
+ }
+ base="`basename $1`"
+ [ -n "$2" ] && {
+ killlevel=$2
+ notset=0
+ }
+
+
+ #
+ # Kill process.
+ #
+ pid=`pidofproc $base 2>/dev/null`
+ [ -z "$pid" ] && {
+ pid=`ps $PSARGS | egrep $base | egrep -v egrep | egrep -v $0 | awk '{ print $2 }'`;
+ }
+ [ -z "$pid" ] && {
+ echo "`basename $0`: killproc: Could not find process ID."
+ }
+
+ [ -n "$pid" ] && {
+ echo -n "$base "
+
+ #
+ # Kill with -TERM then -KILL by default. Use given
+ # instead if one was passed in.
+ #
+ [ "$notset" = 1 ] && {
+ kill -TERM $pid
+ sleep 1
+
+ [ -n "`ps $PSARGS |
+ awk '{print $2}' | grep $pid`" ] && {
+ sleep 3
+ kill -KILL $pid
+ }
+
+ true
+ } || {
+ kill $killlevel $pid
+ }
+ }
+
+ rm -f /var/run/$base.pid
+
+} # end killproc()
+
+
+pidofproc() { # <program>
+ pid=
+
+ [ $# = 0 ] && {
+ echo "`basename $0`: Wrong argument to pidofproc()." 1>&2
+ return 1
+ }
+
+ #
+ # Try looking for a /var/run file.
+ #
+ [ -f /var/run/$1.pid ] && {
+ pid=`head -1 /var/run/$1.pid`
+
+ [ -n "$pid" ] && {
+ echo $pid
+ return 0
+ }
+ }
+
+ #
+ # Try pidof. (Linux offering.)
+ #
+ pid=`pidof $1`
+ [ -n "$pid" ] && {
+ echo $pid
+ return 0
+ }
+
+ #
+ # Try ps.
+ #
+ ps $PSARGS | awk ' BEGIN { prog=ARGV[1]; ARGC=1 }
+ { if ((prog == $11) ||
+ (("(" prog ")") == $11) ||
+ ((prog ":") == $11))
+ {
+ print $2
+ }
+ }' $1
+} # end pidofproc()
+
+
+
+#------------------------------------ -o-
+# Action.
+#
+case "$1" in
+ start)
+ echo "Starting SNMP. "
+
+ cp $DAEMONLOG ${DAEMONLOG}$D
+ cp $TRAPLOG ${TRAPLOG}$D
+ cat /dev/null >$TRAPLOG
+
+ [ ! -e $LOGDIR ] && mkdir $LOGDIR
+ mv ${DAEMONLOG}$D ${TRAPLOG}$D $LOGDIR
+ gzip -r $LOGDIR 2>/dev/null &
+
+ snmpd -a -d -V $DEBUGFLAG
+ snmptrapd -Lf "$TRAPLOG"
+
+ echo
+ ;;
+
+ stop)
+ echo -n "Shutting down SNMP: "
+
+ killproc snmpd
+ killproc snmptrapd
+
+ echo
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+
+ *)
+ echo $USAGE 1>&2
+ exit 1
+esac
+
+
+
+#------------------------------------ -o-
+#
+exit 0
+
+
diff --git a/local/snmpcheck.def b/local/snmpcheck.def
new file mode 100755
index 0000000..ad392ee
--- /dev/null
+++ b/local/snmpcheck.def
@@ -0,0 +1,1224 @@
+#!/usr/local/bin/perl -w
+
+use strict 'refs';
+require Net::Ping;
+require Term::ReadKey;
+
+#defaults
+$mibident=".ERRORNAME";
+$miberrflag=".ERRORFLAG";
+$miberrmsg=".ERRORMSG";
+$mibfix=".ERRORFIX";
+$mibheadall=".EXTENSIBLEDOTMIB";
+$mibclearcache="$mibheadall.VERSIONMIBNUM.VERCLEARCACHE";
+$mibrestartagent="$mibheadall.VERSIONMIBNUM.VERRESTARTAGENT";
+$mibupdateconfig="$mibheadall.VERSIONMIBNUM.VERUPDATECONFIG";
+%miblist=( '.PROCMIBNUM.1' => 'processes',
+ '.SHELLMIBNUM.1' => 'scripts',
+ '.MEMMIBNUM' => 'swap space',
+ '.DISKMIBNUM.1' => 'disks',
+ '.LOADAVEMIBNUM.1' => 'load-average',
+ '.ERRORMIBNUM' => 'snmp-agent-errors');
+@fixitlist=('.PROCMIBNUM.1','.SHELLMIBNUM.1');
+%mibchecklist = ('.PROCMIBNUM.1' => 1,
+ '.SHELLMIBNUM.1' => 1,
+ '.MEMMIBNUM' => 1,
+ '.DISKMIBNUM.1' => 1,
+ '.LOADAVEMIBNUM.1' => 1,
+ '.ERRORMIBNUM' => 1);
+$errlog="/net/tyfon/1/OV/log/ece-log";
+$default_get_args = "-v 1 %s private";
+$default_set_args = "-v 1 %s private";
+$andlog=0;
+$snmppath="BINDIR";
+$eraseline=" \r";
+$fixit=0; # this should be 0 not -1, but is necessary till getc(STDIN) works
+$rescanWhen = 300;
+$display = $ENV{'DISPLAY'};
+$hidden = 0;
+$pinghost = 0;
+$loglevel = 1;
+$logwindowatstart = 0;
+$numloglevels = 5;
+$dontstart = 0;
+$raiseonnew = 1;
+
+#
+# Mib Package: Each mib has a mib number attached and can check/fix itself;
+#
+
+package Mib;
+
+# @ISA = qw( Host );
+
+sub new {
+ my $tmp = shift;
+ my $self = {};
+ $self->{'HostId'} = shift;
+ $self->{'Host'} = $self->{'HostId'}->{'Name'};
+ $_ = shift;
+ $self->{'Mib'} = $_;
+ print "test: $_\n";
+ ($self->{'MibSuffix'}) = /(\.[0-9]+)$/;
+ if (!defined($mibchecklist{$self->{'MibSuffix'}})) {
+ ($self->{'MibSuffix'}) = /(\.[0-9]+\.1)$/;
+ }
+ print "suff: $self->{'MibSuffix'}\n";
+ $self->{'MibDesc'} = shift;
+ $self->{'Frame'} = shift;
+ bless $self;
+}
+
+sub getmibnum {
+ my $self = shift;
+ return ($self->{'Mib'});
+}
+
+sub snmp_walk {
+ my $self = shift;
+ $self->{'Frame'}->toplevel->Busy() if ($::display);
+ my $mib = shift;
+ my $cmd = "$::snmppath/snmpwalk " . sprintf($::default_get_args, $self->{'Host'}) . " $mib|";
+ ::addToLog("running: $cmd",5);
+ open(OUT,"$cmd");
+ my $outcount = 0;
+ my @result = [];
+ while (<OUT>) {
+ $result[$outcount] = $_;
+ chop;
+ ::addToLog("snmpwalk: $_",5);
+ if ($::display) {
+ $self->{'Frame'}->toplevel->update;
+ }
+ $outcount++;
+ }
+ close(OUT);
+ for($i=0; $i <= $#result; $i++) {
+ $result[$i] =~ s/ Hex:.*$//g;
+ $result[$i] =~ s/\"//g;
+ }
+ $self->{'Frame'}->toplevel->Unbusy() if ($::display);
+ if ($result[0] =~ /No Response/) {
+ $self->{'HostId'}->hostdown;
+ splice(@result,0);
+ }
+ return @result;
+}
+
+sub check {
+ my $self = shift;
+ my $tmp = [];
+ if ($::mibchecklist{$self->{'MibSuffix'}} != 1) {
+ return @{$tmp};
+ }
+ if (! $::display) {
+ printf "%sChecking %s: %s\r", $::eraseline,$self->{'Host'},
+ $self->{'MibDesc'};
+ }
+ my @walkout = $self->snmp_walk("$self->{'Mib'}$::miberrflag");
+ while ($#walkout > -1) {
+ $_ = shift @walkout;
+ ($result) = /= ([0-9]+)/;
+ if (defined($result) && $result > 0)
+ {
+ ($mibloc) = /\.([0-9]+) /;
+ push(@{$tmp},FixProblem::new("",$self->{'HostId'}, $self->{'Mib'},
+ $self->{'MibDesc'},
+ $mibloc,$self->{'Frame'}));
+ if (! $::display) {
+ printf("%s%-8.8s %-12.12s %2d -- %-37.37s",$::eraseline,
+ $self->{'Host'},$tmp->[0]->{'ErrName'},
+ $result,$tmp->[0]->{'ErrMsg'});
+ if ($tmp->[0]->canfix() && $::fixit == 0) {
+ printf(" / Fix? ");
+ $ans = Term::ReadKey::ReadKey(0);
+ if ("$ans" eq "y" || "$ans" eq "Y") {
+ printf("\b\b\b\b\b\b\b\b");
+ $tmp->[0]->fix($mibloc); # fix now if curses
+ } else {
+ print $ans;
+ printf("\nChecking %s: %s\r",$self->{'Host'},
+ $self->{'MibDesc'});
+ }
+ } elsif ($::fixit > 0) {
+ $tmp->[0]->fix($mibloc); # fix now if curses
+ }
+ shift @{$tmp};
+ }
+ }
+ }
+ return(@{$tmp});
+}
+
+#
+# Problem Package: A problem comes into existence when found. It may
+# or may not know how to fix itself (Problem/FixProblem).
+#
+
+package Problem;
+
+@ISA = qw( Mib );
+
+sub snmp_get {
+ my $self = shift;
+ $self->{'Frame'}->toplevel->Busy() if ($::display);
+ my $mib = shift;
+ my $args = sprintf($::default_get_args, $self->{'Host'});
+ $_ = `$::snmppath/snmpget $args $mib`;
+ my ($result) = /= (.*)$/;
+ if (!defined($result) || $result =~ /No Response/) {
+ $self->{'HostId'}->hostdown;
+ $result = "";
+ }
+ $result =~ s/\"//g;
+ $result =~ s/ Hex:.*$//g;
+ ::addToLog("snmpget: $_",5);
+ $self->{'Frame'}->toplevel->Unbusy() if ($::display);
+ return $result;
+}
+
+sub snmp_set {
+ my $self = shift;
+ $self->{'Frame'}->toplevel->Busy() if ($::display);
+ my $mib = shift;
+ my $args = sprint($::default_set_args, $self->{'Host'});
+ $_ = `$::snmppath/snmpset $args $mib`;
+ my ($result) = /= (.*)$/;
+ $result = "" if (!defined($result));
+ $result =~ s/\"//g;
+ ::addToLog("snmpset: $_",5);
+ $self->{'Frame'}->toplevel->Unbusy() if ($::display);
+ return $result;
+}
+
+sub new{
+ my $tmp = shift;
+ my $hostId = shift;
+ my $mib = shift;
+ my $mibname = shift;
+ my $self = new Mib ($hostId,$mib,$mibname);
+ $self->{'MibLocation'} = shift;
+ $tmp = shift;
+ if ($::display) {
+ $self->{'Frame'} = $tmp->Frame();
+ }
+ bless $self;
+ $self->{'ErrName'} =
+ $self->snmp_get("$self->{'Mib'}$::mibident.$self->{'MibLocation'}");
+ $self->{'ErrMsg'} =
+ $self->snmp_get("$self->{'Mib'}$::miberrmsg.$self->{'MibLocation'}");
+ if (exists $self->{'HostId'}->{'Down'}) {
+ return $self;
+ }
+ if ($::display) {
+ $self->{'Frame'}->pack();
+ $self->{'Desc'} =
+ $self->{'Frame'}->Button(-text => sprintf("%-12.12s %-42.42s",
+ $self->{'ErrName'},
+ $self->{'ErrMsg'}),
+ -font => "6x13",
+ -highlightcolor => "#ffffff",
+ -borderwidth => 0,
+ -relief => "flat",
+ -bd => 0, -padx => 0, -pady => 0,
+ -activeforeground => 'red',
+ -activebackground => '#C9C9C9',
+ -background => '#E0C9C9',
+ -command => [\&selectme,$self]);
+ $self->{'Desc'}->pack(-fill => "x",-expand => 1,-side=>"left"); #
+ if ($::raiseonnew) {
+ $tmp->toplevel->deiconify();
+ $tmp->toplevel->raise();
+ }
+ ::addToLog("problem found: $self->{'Host'}\t$self->{'ErrName'}\t$self->{'ErrMsg'}",2);
+ }
+ bless $self;
+ return $self;
+}
+
+sub haveseen {
+ my $self = shift;
+ $self->{'Desc'}->configure(-background => '#C9C9C9');
+}
+
+sub selectme {
+ my $self = shift;
+ if ($main::hidden) {
+ main::makeappear();
+ return;
+ }
+ if (exists $self->{'Selected'}) {
+ main::deselectitem($self);
+ delete $self->{'Selected'};
+ } else {
+ main::selectitem($self);
+ $self->{'Desc'}->configure(-foreground => "red");
+ $self->{'Selected'} = 1;
+ }
+ $self->haveseen();
+}
+
+sub deselectme {
+ my $self = shift;
+ $self->{'Desc'}->configure(-foreground => "black");
+ delete $self->{'Selected'};
+}
+
+sub check {
+ my $self = shift;
+ if ($::display) {
+ main::setstatus("Checking $self->{'Host'} -- $self->{'ErrName'}");
+ }
+ else {
+ printf("Checking \b\b\b\b\b\b\b\b\b");
+ }
+ $result = $self->snmp_get("$self->{'Mib'}$::miberrflag.$self->{'MibLocation'}");
+ if (exists $self->{'HostId'}->{'Down'}) {
+ return 0;
+ }
+ if ($result == 0) {
+ $self->deleteme();
+ }
+ main::setstatus("idle");
+ return $result;
+}
+
+sub fix {
+# Don't fix and/or unable to
+ my $self = shift;
+ main::setmsg("Don't know how to fix $self->{'ErrName'}");
+}
+
+sub rsh {
+ my $self = shift;
+ if ($::display) {
+ system "xterm -e rsh $self->{'HostId'}->{'Name'} -l root &";
+ }
+}
+
+sub deleteme {
+ my $self = shift;
+ my $host = $self->{'HostId'};
+ $host->deleteProb($self);
+}
+
+sub deleteself {
+ my $self = shift;
+ if ($::display) {
+ if ($self->{'Selected'}) {
+ main::deselectitem($self);
+ }
+ $self->{'Desc'}->destroy();
+ $self->{'Frame'}->destroy();
+ }
+}
+
+sub canfix {
+ return 0;
+}
+
+package FixProblem;
+
+@ISA = qw( Problem );
+
+sub new {
+ my $tmp = shift;
+ my $hostId = shift;
+ my $mib = shift;
+ my $mibdesc = shift;
+ my $mibloc = shift;
+ my $frame = shift;
+ my $self = new Problem ($hostId,$mib,$mibdesc,$mibloc,$frame);
+ $_ = $mib;
+ ($mymib) = /(\.[0-9]+)$/;
+ if (grep(/$mymib/,@::fixitlist) && ($::fixit >= 0)) {
+ bless $self; # Make it a FixProblem if fixable
+ }
+ return $self; # else just return a Problem
+}
+
+sub canfix {
+ return 1;
+}
+
+sub fix {
+ my $self = shift;
+ my $mibloc = shift;
+ if ($::display) {
+ main::setstatus(sprintf("Fixing %s: %s",
+ $self->{'Host'}, $self->{'ErrName'}));
+ }
+ else {
+ printf(" / Fixing...\b\b\b\b\b\b\b\b\b");
+ }
+ $self->snmp_set("$self->{'Mib'}$::mibfix.$self->{'MibLocation'} integer 1");
+ $self->snmp_set("$::mibclearcache integer 1");
+ if (exists $self->{'HostId'}->{'Down'}) {
+ return;
+ }
+ if ($::display) {
+ main::setstatus("Sleeping");
+ }
+ else {
+ printf("Sleeping \b\b\b\b\b\b\b\b\b");
+ }
+ sleep(2);
+ if ($::display) {
+ main::setstatus("Checking");
+ }
+ else {
+ printf("Checking\b\b\b\b\b\b\b\b");
+ }
+ if ($self->check() != 0) {
+ if (! $::display) {
+ printf("*failed* \n");
+ } else {
+ main::setmsg("Failed to fix $self->{'ErrName'} on $self->{'Host'}");
+ }
+ }
+ else {
+ if ($::display) {
+# $self->{'HostId'}->deleteProb($self);
+ main::setmsg("Fixed $self->{'ErrName'} on $self->{'Host'}");
+ }
+ else {
+ printf("Fixed \n");
+ }
+ }
+ main::setstatus("Idle");
+}
+
+#
+# Host Package: Each object is a host which can check itself and display
+# the results
+#
+package Host;
+
+sub mibsort {
+ $_ = $a;
+ ($av) = /\.([0-9]+)/;
+ $_ = $b;
+ ($bv) = /\.([0-9]+)/;
+ return $av <=> $bv;
+}
+
+sub new {
+ my $self = {};
+ my $tmp = shift;
+ $self->{'Name'} = shift;
+ $self->{'Host'} = $self->{'Name'};
+ $self->{'Mibs'} = [];
+ $self->{'Problems'} = [];
+ bless $self;
+ if ($::display) {
+ $self->{'MainFrame'} = $::HostFrame->Frame();
+ if (!$::hidden) {
+ $self->{'MainFrame'}->configure(-relief =>"sunken",-borderwidth=>2);
+ }
+ $self->{'ProbFrame'} = $self->{'MainFrame'}->Frame();
+ $self->{'hostlabel'} =
+ $self->{'MainFrame'}->Button(-text => sprintf("%-9.9s",
+ $self->{'Name'}),
+ -bd => 0, -padx => 0, -pady => 0,
+ -command =>[\&selectme,$self],
+ -activeforeground => 'red',
+ -activebackground => '#C9C9C9',
+ -width => 9,
+ -anchor => "w",
+ -relief => "flat");
+ $self->{'hostlabel'}->pack(-side=>"left",-ipadx=>1,
+ -padx=> 1,-pady =>1);
+ $self->{'ProbFrame'}->pack(-side=>"left",-ipadx=>1,
+ -padx=> 1,-pady =>1);
+ $self->{'MainFrame'}->pack( #-padx => 2,-pady =>2,
+ -fill => "x", -expand => 1);
+ }
+ foreach $mibx ( sort mibsort keys(%::miblist) ) {
+ push(@{$self->{'Mibs'}},
+ new Mib ($self,"$::mibheadall$mibx",$::miblist{$mibx},
+ $self->{'ProbFrame'}));
+ }
+ return $self;
+}
+
+sub rsh {
+ my $self = shift;
+ if ($::display) {
+ system "xterm -e rsh $self->{'Name'} -l root &";
+ }
+}
+
+sub selectme {
+ my $self = shift;
+ if ($main::hidden) {
+ main::makeappear();
+ return;
+ }
+ if (exists $self->{'Selected'}) {
+ main::deselectitem($self);
+ delete $self->{'Selected'};
+ } else {
+ main::selectitem($self);
+ $self->{'hostlabel'}->configure(-foreground => "red");
+ $self->{'Selected'} = 1;
+ }
+}
+
+sub deselectme {
+ my $self = shift;
+ $self->{'hostlabel'}->configure(-foreground => "black");
+ delete $self->{'Selected'};
+}
+
+sub fix {
+ my $self = shift;
+ if (! exists $self->{'Down'}) {
+ foreach $i (@{$self->{'Problems'}}) {
+ if ($i->canfix() && ref($i) ne Host) {
+ $i->fix();
+ }
+ }
+ }
+}
+
+sub seenall {
+ my $self = shift;
+ foreach $i (@{$self->{'Problems'}}) {
+ if (ref($i) ne Host) {
+ $i->haveseen();
+ }
+ }
+}
+
+sub canfix {
+ return 1;
+}
+
+sub hostdown {
+ my $self = shift;
+ $self->deleteProbs();
+ push(@{$self->{'Problems'}},$self);
+ $self->{'Down'} = 1;
+ if ($::display) {
+ if (!exists $self->{'hostlabel'}) {
+ $self->{'hostlabel'} =
+ $self->{'MainFrame'}->Button(-text => sprintf("%-9.9s",
+ $self->{'Name'}),
+ -bd => 0, -padx => 0, -pady => 0,
+ -command =>[\&selectme,$self],
+ -activeforeground => 'red',
+ -activebackground => '#C9C9C9',
+ -width => 9,
+ -anchor => "w",
+ -relief => "flat");
+ }
+ ::addToLog("$self->{'Name'} is down",2);
+ $self->{'hostlabel'}->configure(-text =>
+ sprintf("%-9.9s down",$self->{'Name'}),
+ -width => 14);
+ }
+}
+
+sub check {
+ my $self = shift;
+ $self->{'noDelete'} = 1;
+ $self->deleteProbs();
+ delete $self->{'noDelete'};
+ if ($::display) {
+ $self->{'hostlabel'}->configure(-text => $self->{'Name'},-width=>9);
+ }
+ delete $self->{'Down'};
+ main::setstatus("pinging $self->{'Name'}");
+ if (!($::pinghost) || Net::Ping::pingecho($self->{'Name'},2)) {
+ foreach $i (@{$self->{'Mibs'}}) {
+ if (ref($i) ne Mib) {
+ print "$i is a ref($i) not a Mib\n";
+ } else {
+ main::setstatus("Checking $self->{'Name'}: " . $i->{'MibDesc'});
+ push(@{$self->{'Problems'}},$i->check());
+ }
+ if (exists $self->{'Down'}) {
+ last;
+ }
+ }
+ } else {
+ $self->hostdown();
+ }
+ main::setstatus("Idle");
+ if ($#{$self->{'Problems'}} == -1) {
+ $self->deleteme();
+ }
+}
+
+sub deleteme {
+ my $self = shift;
+ if ($self->{'Selected'}) {
+ main::deselectitem($self);
+ }
+ $self->deleteProbs();
+ if ($::display) {
+ $self->{'hostlabel'}->destroy();
+ $self->{'ProbFrame'}->destroy();
+ my $top = $self->{'MainFrame'}->toplevel;
+ $self->{'MainFrame'}->destroy();
+ $top->update;
+ }
+ main::deletehost($self->{'Name'});
+}
+
+sub deleteProbs {
+ my $self = shift;
+ foreach $i (@{$self->{'Problems'}}) {
+ if (ref($i) eq Host) {
+ delete $self->{'Problems'};
+ return;
+ }
+ if (ref($i) ne Problem && ref($i) ne FixProblem) {
+ print "i: $i is a ", ref($i), "\n";
+ next;
+ }
+ $self->deleteProb($i);
+ }
+}
+
+sub deleteProb {
+ my $self = shift;
+ my $child = shift;
+ for ($k = 0; $k <= $#{$self->{'Problems'}}; $k++) {
+ if (ref($self->{'Problems'}->[$k]) eq Problem ||
+ ref($self->{'Problems'}->[$k]) eq FixProblem ) {
+ if ($self->{'Problems'}->[$k]->{'Mib'} eq $child->{'Mib'} &&
+ $self->{'Problems'}->[$k]->{'MibLocation'} eq
+ $child->{'MibLocation'}) {
+ splice(@{$self->{'Problems'}},$k,1);
+ $child->deleteself();
+ if ($#{$self->{'Problems'}} == -1 &&
+ !exists $self->{'noDelete'}) {
+ $self->deleteme();
+ }
+ last;
+ }
+ } else {
+ print " not: ",$self->{'Problems'}->[$k],"/",
+ ref($self->{'Problems'}->[$k]),"\n";
+ }
+ }
+}
+
+package main;
+
+#
+# Read arguments
+#
+
+if ($#ARGV != -1) {
+ while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) {
+ $_ = shift;
+ $andlog = 1 if (/^-a/);
+ $dontstart = 1 if (/^-d/);
+ $fixit = -1 if (/^-n/);
+ $fixit = 1 if (/^-y/);
+ $display = 0 if (/^-x/);
+ $pinghost = 1 if (/^-p/);
+ $hidden = 1 if (/^-H/);
+ $loglevel = shift if (/^-V/);
+ $logwindowatstart = 1 if (/^-L/);
+ &display_help() if (/^-h/);
+ &setmibchecklist(@fixitlist) if (/^-f/);
+ }
+}
+
+#
+# If necessary check the ece-log file for problems
+#
+
+if (($andlog || $#ARGV == -1) && !$dontstart) {
+ open(LOG,$errlog);
+ while (<LOG>) {
+ @fields = split;
+ @tmp = grep(/$fields[0]/,@ARGV);
+ if ($#tmp == -1) { # && $fields[1] ne "down") {
+ $ARGV[$#ARGV + 1] = $fields[0];
+ }
+ }
+ close(LOG);
+}
+
+#
+# Check all the found hosts
+#
+
+if ($display) {
+ use Tk;
+# $tk_strictMotif = 1;
+ $top = MainWindow->new();
+ $top->bind('all',"<Control-q>",[\&quit]);
+ $top->bind('all',"<Control-h>",[\&makehidden]);
+ $top->bind('all',"<Control-s>",[\&seenall]);
+ $top->bind('all',"<Control-f>",[\&fixall]);
+ $top->option('add','*highlightThickness','0'); #wish this worked
+# $top->option('add','*highlightbackground','#C9C9C9');
+ $top->option('add','*background','#C9C9C9');
+ $top->option('add','*font','6x13');
+ $HostFrame = $top->Frame();
+ $MenuFrame = $top->Frame(-relief => "raised",-borderwidth => 2);
+ $MenuFrame->pack(-fill => "x",-expand => 1);
+ $statusBar = $top->Frame(-relief => "raised",-borderwidth => 2);
+ $status = $statusBar->Label(-text => "initializing",-anchor =>"e");
+ $statusl = $statusBar->Label(-text => "Status: ", -anchor => "w");
+ $msgBar = $top->Frame(-relief => "raised",-borderwidth => 2);
+ $msg = $msgBar->Label(-text => "",-anchor =>"e");
+ $msgl = $msgBar->Label(-text => "Note: ", -anchor => "w");
+
+ $botFrame = $top->Frame();
+ $butFrame = $top->Frame();
+ $entryhost = "";
+ $NewHost = $botFrame->Entry(-textvariable => \$entryhost,-width=>20,
+ -relief => "sunken");
+ $NewHost->bind("<Return>",sub {newHost("$entryhost");
+ $NewHost->delete(0,length($entryhost));});
+ $BotLabel = $botFrame->Label(-text => "Check New Host: ",
+ -anchor => "w");
+ $CmdsMenuBut = $MenuFrame->Menubutton(-text => "Cmds");
+ $CmdsMenu = $CmdsMenuBut->Menu(-tearoff => 1);
+ $CmdsMenuBut->configure(-menu => $CmdsMenu);
+ $CmdsMenuBut->pack(-side => "left");
+ $CmdsMenuBut->command(-label => "Check Hosts", -command => [\&rescanhosts]);
+ $CmdsMenuBut->command(-label => "Check Log", -command => [\&scanlog]);
+ $CmdsMenuBut->command(-label => "Fix All", -command => [\&fixall],
+ -accelerator => "Ctrl-f");
+ $CmdsMenuBut->command(-label => "Seen All", -command => [\&seenall],
+ -accelerator => "Ctrl-s");
+ $CmdsMenuBut->separator();
+ $CmdsMenuBut->command(-label => "Hide", -command => [\&makehidden],
+ -accelerator => "Ctrl-h");
+ $CmdsMenuBut->command(-label => "Quit", -command => [\&quit],
+ -accelerator => "Ctrl-q");
+ $PrefsMenuBut = $MenuFrame->Menubutton(-text => "Prefs");
+ $PrefsMenu = $PrefsMenuBut->Menu(-tearoff => 1);
+ $PrefsMenuBut->configure(-menu => $PrefsMenu);
+ $PrefsMenuBut->pack(-side => "left");
+ $PrefsMenuBut->cascade(-label => "Rescan");
+ $RescanPrefsBut = $PrefsMenu->Menu();
+ $PrefsMenuBut->entryconfigure("Rescan",-menu => $RescanPrefsBut);
+ $AutoRescan = 1;
+ if ($AutoRescan) {
+ $afterId = Tk::after($rescanWhen*1000,[\&autorescan]);
+ }
+ $RescanPrefsBut->checkbutton(-label =>"Auto Rescan",
+ -variable =>\$AutoRescan,
+ -command => sub {if ($AutoRescan) {
+ $afterId =
+ Tk::after($rescanWhen*1000,[\&autorescan])
+ } else {
+ Tk::after("cancel",$afterId);
+ }});
+ $AutoCheckLog = 1;
+ $RescanPrefsBut->checkbutton(-label =>"Checks Log",
+ -variable =>\$AutoCheckLog);
+ $AutoCheckHosts = 0;
+ $RescanPrefsBut->checkbutton(-label =>"Checks Hosts",
+ -variable =>\$AutoCheckHosts);
+ $RescanWhenHidden = 1;
+ $RescanPrefsBut->checkbutton(-label =>"Only When Hidden",
+ -variable =>\$RescanWhenHidden);
+
+ $RescanPrefsBut->checkbutton(-label =>"Pop forward with new",
+ -variable =>\$raiseonnew);
+
+ $PrefsMenuBut->cascade(-label => "Log Verbosity");
+ $LogVerbBut = $PrefsMenu->Menu();
+ $PrefsMenuBut->entryconfigure("Log Verbosity",
+ -menu => $LogVerbBut);
+ for ($i=1; $i <= $numloglevels; $i++) {
+ $LogVerbBut->radiobutton(-label => "$i", -variable => \$loglevel,
+ -value => $i);
+ }
+
+ $PrefsMenuBut->cascade(-label => "Check For");
+ $CheckForBut = $PrefsMenu->Menu();
+ $PrefsMenuBut->entryconfigure("Check For",
+ -menu => $CheckForBut);
+ $CheckForBut->command(-label => "Fixable Problems",
+ -command => [\&setmibchecklist,@fixitlist]);
+ $CheckForBut->command(-label => "Everything",
+ -command => [\&setmibchecklist,keys(%miblist)]);
+ $CheckForBut->separator();
+ foreach $i ( sort mibsort keys(%::mibchecklist) ) {
+ $CheckForBut->checkbutton(-label => $miblist{$i},
+ -variable => \$mibchecklist{$i});
+ }
+
+ $PrefsMenuBut->checkbutton(-label => "Ping Host First",
+ -variable => \$pinghost);
+
+ # Agent control
+
+ $agentMenuBut = $MenuFrame->Menubutton(-text => "Agent-Control");
+ $agentMenu = $agentMenuBut->Menu(-tearoff => 1);
+ $agentMenuBut->configure(-menu => $agentMenu);
+ $agentMenuBut->pack(-side => "left");
+ $agentMenuBut->command(-label => "Re-read Configuration",
+ -command => [sub {if ($selected) { $top->Busy();
+ my $args = sprint($::default_get_args, $selected->{'Host'});
+$_ = `$::snmppath/snmpset $args $mibupdateconfig i 1`; $top->Unbusy();}}]);
+ $agentMenuBut->command(-label => "Clear Exec Cache",
+ -command => [sub {if ($selected) { $top->Busy();
+ my $args = sprint($::default_get_args, $selected->{'Host'});
+$_ = `$::snmppath/snmpset $args $mibclearcache i 1`; $top->Unbusy();}}]);
+ $agentMenuBut->separator();
+ $agentMenuBut->command(-label => "Re-start Agent",
+ -command => [sub {if ($selected) { $top->Busy();
+ my $args = sprint($::default_get_args, $selected->{'Host'});
+$_ = `$::snmppath/snmpset $args $mibrestartagent i 1`; $top->Unbusy();} }]);
+
+ # set up remote commands
+
+ $remoteMenuBut = $MenuFrame->Menubutton(-text => "Remote-Info");
+ $remoteMenu = $remoteMenuBut->Menu(-tearoff => 1);
+ $remoteMenuBut->configure(-menu => $remoteMenu);
+ $remoteMenuBut->pack(-side => "left");
+ $remoteMenuBut->command(-label => "Load-Av", -command => [\&remote_load]);
+ $remoteMenuBut->separator();
+ $remoteMenuBut->command(-label => "top", -command => [\&remote_cmd,"top"]);
+ $remoteMenuBut->command(-label => "mailq", -command => [\&remote_cmd,"mailq"]);
+ $remoteMenuBut->command(-label => "ps", -command => [\&remote_cmd,"ps"]);
+ $remoteMenuBut->command(-label => "conf", -command => [\&remote_cmd,"conf"]);
+
+ # set up log file menu
+ $logFileMenuBut = $MenuFrame->Menubutton(-text => "Log");
+ $logFileMenu = $logFileMenuBut->Menu(-tearoff => 1);
+ $logFileMenuBut->configure(-menu => $logFileMenu);
+ $logFileMenuBut->pack(-side => "left");
+ $logFileMenuBut->command(-label => "show log", -command => [\&displayLog]);
+ $logFileMenuBut->command(-label => "clear log", -command => [\&clearLog]);
+ $logFileMenuBut->separator();
+ $logFileMenuBut->command(-label => "show Tyfon's log", -command => [\&displayTyfon]);
+
+
+ # set up status bar
+
+ $statusl->pack(-fill => "x", -expand => 1, -side =>"left");
+ $status->pack(-fill => "x", -expand => 1, -side =>"left");
+ $msgl->pack(-fill => "x", -expand => 1, -side => "left");
+ $msg->pack(-fill => "x", -expand => 1, -side => "left");
+ $statusBar->pack(-fill => "x", -expand => 1);
+ $msgBar->pack(-fill => "x", -expand => 1);
+ $HostFrame->pack(-fill => "x",-expand => 1);
+ $butFrame->pack(-fill => "x",-expand => 1);
+ $botFrame->pack(-fill => "x",-expand => 1);
+ $FixBut = $butFrame->Button(-text => "Fix",-command=>[sub{print "hi\n"}],
+ -state => "disabled");
+ $FixBut->pack(-side => "left",-padx => 4,-pady => 2,-ipadx => 2,
+ -ipady => 2);
+ $RshBut = $butFrame->Button(-text => "Rsh",-command=>[sub{print "hi\n"}],
+ -state => "disabled");
+ $RshBut->pack(-side => "left",-padx => 4,-pady => 2,-ipadx => 2,
+ -ipady => 2);
+ $DelBut = $butFrame->Button(-text => "Del",
+ -state => "disabled");
+ $DelBut->pack(-side => "left",-padx => 4,-pady => 2,-ipadx => 2,
+ -ipady => 2);
+ $ChkBut = $butFrame->Button(-text => "Chk",
+ -state => "disabled");
+ $ChkBut->pack(-side => "left",-padx => 4,-pady => 2,-ipadx => 2,
+ -ipady => 2);
+ $BotLabel->pack(-fill => "x",-expand => 1,-side=>"left");
+ $NewHost->pack(-side=>"left");
+ &makehidden() if ($hidden);
+ $top->update();
+
+ # generate log window, but tell it not to create display
+ $logwindow = MainWindow->new;
+ $logwindow->option('add','*highlightThickness','0'); #wish this worked
+# $logwindow->option('add','*highlightbackground','#C9C9C9');
+ $logwindow->option('add','*background','#C9C9C9');
+ $logwindow->option('add','*font','6x13');
+
+ $logbuttons = $logwindow->Frame;
+ $logbuttons->pack(-side => 'bottom', -expand => 1, -fill => 'x');
+ $logclose = $logbuttons->Button(-text => 'Close',
+ -command => ['withdraw',$logwindow]);
+ $logclose->pack(-side => 'left', -expand => 1);
+
+ $logtext = $logwindow->Text(-height => 40, -setgrid => 1);
+ $logtext->pack(-side => 'left', -fill => 'both', -expand => 1);
+ $logscroll = $logwindow->Scrollbar(-command => ['yview',$logtext]);
+ $logscroll->pack(-side => 'right', -fill => 'y');
+ $logtext->configure(-yscrollcommand => ['set', $logscroll]);
+ $logwindow->title("snmpcheck Action Log file");
+ $logwindow->iconname("snmpcheck-log");
+ $logtext->delete('1.0','end');
+ $logclear = $logbuttons->Button(-text => 'Clear Log',
+ -command => [\&deleteLog]);
+ $logclear->pack(-side => 'right', -expand => 1);
+ if (! $logwindowatstart) {
+ $logwindow->withdraw;
+ }
+
+ $status->configure(-text => "Idle");
+ $selected = 0;
+ # fill table with hosts
+ if (!$dontstart) {
+ loadAllHosts(@ARGV);
+ }
+ MainLoop;
+}
+else {
+ select(STDOUT);
+ $| = 1;
+ if ($::fixit == 0) {
+ Term::ReadKey::ReadMode(3);
+ }
+ loadAllHosts(@ARGV);
+ printf("$eraseline");
+}
+
+sub loadAllHosts {
+ my @hostlist = @_;
+ foreach $host ( @hostlist ) {
+ newHost($host);
+ }
+}
+
+sub newHost {
+ my $name = shift;
+ if (!exists $chost{"$name"}) {
+ $chost{"$name"} = new Host ($name);
+ if ($::display) { $top->update(); }
+ $chost{"$name"}->check;
+ } else {
+ setmsg("$name all ready exists");
+ }
+}
+
+sub deletehost {
+ my $name = shift;
+ delete $chost{"$name"};
+}
+
+sub setstatus {
+ my $arg = shift;
+ if ($display) {
+ $status->configure(-text => $arg);
+ $top->update();
+ addToLog($arg,4);
+ }
+}
+
+sub setmsg {
+ my $arg = shift;
+ if ($display) {
+ $msg->configure(-text => $arg);
+ $top->update();
+ addToLog($arg);
+ }
+}
+
+sub addToLog {
+ if ($display) {
+ my $logmsg = shift;
+ my $logaddlevel = shift;
+ if (! defined($logaddlevel)) {
+ $logaddlevel = 1;
+ }
+ if ($logaddlevel <= $loglevel) {
+ $logtext->insert('end'," " x ($logaddlevel-1) . "$logmsg\n");
+ }
+ }
+}
+
+sub displayTyfon {
+ remote_cmd_generic("cat /net/tyfon/1/OV/log/ece-log","Tyfon -- ece-log");
+}
+
+sub displayLog {
+ $logwindow->deiconify;
+ $logwindow->raise;
+}
+
+sub deleteLog {
+ $logtext->delete('1.0','end');
+}
+
+sub deselectitem {
+ $obj = shift;
+ $obj->deselectme();
+ $FixBut->configure(-state => "disabled");
+ $RshBut->configure(-state => "disabled");
+ $DelBut->configure(-state => "disabled");
+ $ChkBut->configure(-state => "disabled");
+ $selected = 0;
+}
+
+sub selectitem {
+ if ($selected) {
+ $selected->deselectme();
+ }
+ $selected = shift;
+ if (ref($selected) ne Host || !(exists $selected->{'Down'})) {
+ $RshBut->configure(-state => "normal", -command => ['rsh',$selected]);
+ } else {
+ $RshBut->configure(-state => "disabled");
+ }
+ $DelBut->configure(-state => "normal", -command => ['deleteme',$selected]);
+ $ChkBut->configure(-state => "normal", -command => ['check',$selected]);
+ if ($selected->canfix() && !(exists $selected->{'Down'})) {
+ $FixBut->configure(-state => "normal",
+ -command => ['fix',$selected]);
+ } else {
+ $FixBut->configure(-state => "disabled");
+ }
+ if ($hidden == 1) {
+ makeappear();
+ }
+}
+
+sub makehidden {
+ $MenuFrame->pack("forget");
+ $statusBar->pack("forget");
+ $msgBar->pack("forget");
+ $butFrame->pack("forget");
+ $botFrame->pack("forget");
+ flatten();
+ $hidden=1;
+}
+
+sub makeappear {
+ $HostFrame->pack("forget");
+ $MenuFrame->pack(-expand => 1, -fill => "x");
+ $statusBar->pack(-expand => 1, -fill => "x");
+ $msgBar->pack(-expand => 1, -fill => "x");
+ $HostFrame->pack(-expand => 1, -fill => "x");
+ $butFrame->pack(-expand => 1, -fill => "x");
+ $botFrame->pack(-expand => 1, -fill => "x");
+ reliefen();
+ $hidden=0;
+}
+
+sub quit {
+ $top->destroy();
+ exit();
+}
+
+sub scanlog {
+ my (@fields, @tmp);
+ open(LOG,$::errlog);
+ while (<LOG>) {
+ @fields = split;
+ @tmp = grep(/$fields[0]/,@ARGV);
+ if ($#tmp == -1 && !exists $::chost->{$fields[0]}) {
+ newHost($fields[0]);
+ }
+ }
+ close(LOG);
+}
+
+sub rescanhosts {
+ foreach $i (keys(%chost)) {
+ $chost{$i}->check();
+ }
+}
+
+sub autorescan {
+ $afterId = Tk::after($rescanWhen*1000,[\&autorescan]);
+ if ($RescanWhenHidden && !$hidden) {return;}
+ if ($AutoCheckHosts) {
+ rescanhosts();
+ }
+ if ($AutoCheckLog) {
+ scanlog();
+ }
+}
+
+sub flatten {
+ foreach $i (keys(%chost)) {
+ $chost{$i}->{'MainFrame'}->configure(-relief => "flat",-borderwidth=>0);
+ }
+}
+
+sub reliefen {
+ foreach $i (keys(%chost)) {
+ $chost{$i}->{'MainFrame'}->configure(-relief =>"sunken",-borderwidth=>2);
+ }
+}
+
+sub fixall {
+ foreach $i (keys(%chost)) {
+ $chost{$i}->fix();
+ }
+}
+
+sub seenall {
+ foreach $i (keys(%chost)) {
+ $chost{$i}->seenall();
+ }
+}
+
+sub remote_cmd {
+ my $type = shift;
+ if ($selected) {
+ remote_cmd_generic("$::snmppath/rsnmp -p $type $selected->{'Host'}",
+ "$selected->{'Host'} -- $type",1);
+ } else {
+ setmsg("Error: Nothing selected");
+ }
+}
+
+sub remote_load {
+ if ($selected) {
+ remote_cmd_generic("$::snmppath/snmpwalk " . sprintf($::default_get_args,$selected->{'Host'}) . " .EXTENSIBLEDOTMIB.LOADAVEMIBNUM.LOADAVE",
+ "$selected->{'Host'} -- LoadAve");
+ } else {
+ setmsg("Error: Nothing selected");
+ }
+}
+
+sub remote_cmd_generic {
+ my $cmd = shift;
+ my $title = shift;
+ my $insert = shift;
+ addToLog("running: $cmd ... ");
+ my $newwin = MainWindow->new;
+ $newwin->Busy();
+
+ $newwin->option('add','*highlightThickness','0'); #wish this worked
+# $newwin->option('add','*highlightbackground','#C9C9C9');
+ $newwin->option('add','*background','#C9C9C9');
+ $newwin->option('add','*font','6x13');
+
+ my $buttons = $newwin->Frame;
+ $buttons->pack(-side => 'bottom', -expand => 1, -fill => 'x');
+ my $entries = $newwin->Frame;
+ $entries->pack(-side => 'bottom', -expand => 1, -fill => 'x');
+
+ my $text = $newwin->Text(-height => 40, -setgrid => 1);
+ $text->pack(-side => 'left', -fill => 'both', -expand => 1);
+ my $scroll = $newwin->Scrollbar(-command => ['yview',$text]);
+ $scroll->pack(-side => 'left', -fill => 'y');
+ $text->configure(-yscrollcommand => ['set', $scroll]);
+
+ my $close = $buttons->Button(-text => 'Close',
+ -command => ['destroy',$newwin]);
+ $close->pack(-side => 'left', -expand => 1);
+ my $rerun = $buttons->Button(-text => 'Re-Run',
+ -command=>[\&fill_text,'',$text,
+ \$cmd,$insert]);
+ $rerun->pack(-side => 'left', -expand => 1);
+
+ my $cmdlabel = $entries->Label(-text => "Command: ");
+ my $cmdtexte = $entries->Entry(-textvariable => \$cmd,
+ -relief => "sunken");
+ $cmdtexte->bind('<Return>' => [\&fill_text,$text, \$cmd,$insert]);
+ $cmdlabel->pack(-side => 'left');
+ $cmdtexte->pack(-side => 'left');
+
+ my $searchtext = '';
+ my $searchlabel = $entries->Label(-text => "Search for: ");
+ my $searchtexte = $entries->Entry(-textvariable => \$searchtext,
+ -relief => "sunken");
+
+ $searchtexte->pack(-side => 'right');
+ $searchlabel->pack(-side => 'right');
+ $searchtexte->bind('<Return>' => [sub { $text->tag('remove','search','0.0','end');
+ my($current, $length) = ('1.0', 0);
+ while (1) {
+ $current = $text->search(-count => \$length, $searchtext, $current, 'end');
+ last if not $current;
+ $text->tag('add', 'search', $current, "$current + $length char");
+ $current = $text->index("$current + $length char");
+ $text->tag('configure','search',
+ -background =>
+ 'lightBlue');}}]);
+
+ if (defined($title)) {
+ $newwin->title($title);
+ $newwin->iconname($title);
+ }
+ fill_text('',$text,\$cmd,$insert);
+}
+
+sub fill_text {
+ my $dump = shift;
+ my $textw = shift;
+ my $cmd = shift;
+ my $insert = shift;
+ $textw->delete('1.0','end');
+ if (defined($insert) && $insert) {
+ $textw->insert('end',"running: $$cmd\n\n");
+ }
+ $textw->toplevel->update();
+ $textw->toplevel->Busy();
+ open(OUT,"$$cmd|");
+ while (<OUT>) {
+ $textw->insert('end',$_);
+ $textw->toplevel->update();
+ $textw->toplevel->Busy();
+ }
+ close(OUT);
+ if (defined ($insert) && $insert) {
+ $textw->insert('end',"\ndone.\n");
+ }
+ $textw->toplevel->Unbusy();
+ $textw->Unbusy();
+ addToLog("done: $$cmd");
+}
+
+sub display_help {
+ print "
+Usage: snmpcheck [-x] [-n|y] [-h] [-H] [-V NUM] [-L] [-f] [[-a] HOSTS]
+
+ -h\tDisplay this message.
+ -a\tcheck error log file AND hosts specified on command line.
+ -p\tDon't try and ping-echo the host first
+ -f\tOnly check for things I can fix
+ HOSTS\tcheck these hosts for problems.
+
+X Options:
+ -x\tforces ascii base if \$DISPLAY set (instead of tk).
+ -H\tstart in hidden mode. (hides user interface)
+ -V NUM\tsets the initial verbosity level of the command log (def: 1)
+ -L\tShow the log window at startup
+ -d\tDon't start by checking anything. Just bring up the interface.
+
+Ascii Options:
+ -n\tDon't ever try and fix the problems found. Just list.
+ -y\tAlways fix problems found.
+
+";
+ exit(0);
+
+}
+
+sub option_get {
+ my $resource = shift;
+ return $top->option('get',$resource);
+}
+
+sub option_set {
+ my $resource = shift;
+ my $value = shift;
+ $top->option('add',"*$resource",$value);
+}
+
+sub option_save {
+
+}
+
+sub mibsort {
+ $_ = $a;
+ ($av) = /\.([0-9]+)/;
+ $_ = $b;
+ ($bv) = /\.([0-9]+)/;
+ return $av <=> $bv;
+}
+
+sub setmibchecklist {
+ my $i;
+ foreach $i (keys(%mibchecklist)) {
+ $mibchecklist{$i} = 0;
+ }
+ foreach $i (@_) {
+ $mibchecklist{$i} = 1;
+ }
+}
diff --git a/local/snmpconf b/local/snmpconf
new file mode 100755
index 0000000..37a5136
--- /dev/null
+++ b/local/snmpconf
@@ -0,0 +1,933 @@
+#!/usr/bin/perl -w
+
+#
+# A simple configuration file builder based on questions listed in
+# its own configuration file. It would certainly be easy to use this
+# for other (non-snmp) programs as well.
+#
+
+use Getopt::Std;
+use Term::ReadLine;
+use IO::File;
+use Data::Dumper;
+use File::Copy;
+if ($^O eq 'MSWin32') {
+ eval 'require Win32::Registry;';
+ if ($@) {
+ print "\nWarning: Perl module Win32::Registry is not installed. This module is\n";
+ print " required to read the SNMPSHAREPATH and SNMPCONFPATH values from \n";
+ print " the registry. To use snmpconf without the module you need to\n";
+ print " define SNMPSHAREPATH and SNMPCONFPATH as environment variables\n";
+ print " or use the -c and -I command line options.\n";
+ }
+}
+
+# globals
+%tokenitems=qw(line 1 info 1 comment 1);
+%arrayitems=qw(question 1 validanswer 1);
+
+# default folder for snmpconf-data
+if (defined(&my_getenv("SNMPSHAREPATH"))) {
+ $opts{'c'} = &my_getenv("SNMPSHAREPATH") . "/snmpconf-data";
+}
+else {
+ $opts{'c'} = "/usr/local/share/snmp/snmpconf-data";
+}
+
+# default config file path
+if (defined(&my_getenv("SNMPCONFPATH"))) {
+ $confpath = &my_getenv("SNMPCONFPATH");
+}
+else {
+ $confpath = "/usr/local/share/snmp";
+}
+
+# home environment variable
+if (defined(&my_getenv("HOME"))) {
+ $home = &my_getenv("HOME") . "/.snmp";
+}
+else {
+ $home = "(HOME dir - n/a)";
+}
+
+# read the argument string
+getopts("qadhfc:piI:r:R:g:G", \%opts);
+
+# display help
+if ($opts{'h'}) {
+ print "$0 [options] [FILETOCREATE...]\n";
+ print "options:\n";
+ print " -f overwrite existing files without prompting\n";
+ print " -i install created files into $confpath.\n";
+ print " -p install created files into $home.\n";
+ print " -I DIR install created files into DIR.\n";
+ print " -a Don't ask any questions, just read in current\n";
+ print " current .conf files and comment them\n";
+ print " -r all|none Read in all or none of the .conf files found.\n";
+ print " -R file,... Read in a particular list of .conf files.\n";
+ print " -g GROUP Ask a series of GROUPed questions.\n";
+ print " -G List known GROUPs.\n";
+ print " -c conf_dir use alternate configuration directory.\n";
+ print " -q run more quietly with less advice.\n";
+ print " -d turn on debugging output.\n";
+ print " -D turn on debugging dumper output.\n";
+ exit;
+}
+
+# setup terminal interface.
+$ENV{'PERL_RL'}='o=0' if (!exists($ENV{'PERL_RL'}));
+$term = new Term::ReadLine 'snmpconf';
+
+# read in configuration file set
+read_config_files($opts{'c'}, \%filetypes);
+debug(my_Dumper(\%filetypes));
+
+if ($opts{'G'}) {
+ Print("\nKnown GROUPs of tokens:\n\n");
+ foreach my $group (keys(%groups)) {
+ print " $group\n";
+ }
+ Print("\n");
+ exit;
+}
+
+#
+# Expand the search path in case it contains multiple directories
+# separated by : (Unix) or ; (Win32)
+#
+my $ENV_SEPARATOR = ':';
+if ($^O eq 'MSWin32') {
+ $ENV_SEPARATOR = ';';
+}
+my @searchpath = split(/$ENV_SEPARATOR/, $confpath);
+push @searchpath, "/usr/local/etc/snmp";
+push @searchpath, ".";
+push @searchpath, "$home";
+
+# Remove trailing /'s or \'s
+for (my $i=0; $i <= $#searchpath; $i++) {
+ $searchpath[$i] =~ /(.*?)([\/\\])*$/;
+ $searchpath[$i] = $1;
+}
+
+# Determine persistent directory. Order of preference:
+#
+# file in SNMP_PERSISTENT_FILE environment variable
+# directory defined by persistentDir snmp.conf variable
+# directory in SNMP_PERSISTENT_DIR environment variable
+# default PERSISTENT_DIRECTORY directory
+my $persistentDir = "";
+my $persistentFile = "";
+
+# SNMP_PERSISTENT_FILE environment variable
+if (defined(&my_getenv("SNMP_PERSISTENT_FILE"))) {
+ $persistentFile = &my_getenv("SNMP_PERSISTENT_FILE");
+ debug ("persistent file: SNMP_PERSISTENT_FILE environment variable set\n");
+}
+
+# snmp.conf persistentDir
+if (!($persistentDir) && !($persistentFile)) {
+ foreach my $i (@searchpath) {
+ debug ("Searching file $i/snmp.conf for persistentDir\n");
+ my $temp = get_persistentDir("$i/snmp.conf");
+ if ($temp) {
+ debug("persistent directory: set to $temp in $i/snmp.conf\n");
+ $persistentDir = $temp;
+ last;
+ }
+ }
+}
+
+# SNMP_PERSISTENT_DIR environment variable
+if (!($persistentDir) && !($persistentFile)) {
+ if (&my_getenv("SNMP_PERSISTENT_DIR")) {
+ $persistentDir = &my_getenv("SNMP_PERSISTENT_DIR");
+ debug ("persistent directory: SNMP_PERSISTENT_DIR environment variable set\n");
+ }
+}
+
+# PERSISTENT_DIRECTORY default variable
+if (!($persistentDir) && !($persistentFile)) {
+ $persistentDir = "/var/net-snmp";
+ debug ("persistent directory: Using default value\n");
+}
+
+# Rebuild search path without persistent folder
+# Note: persistent file handled in Find existing
+# files to possibly read in section
+if ($persistentDir) {
+ # Remove trailing /'s or \'s
+ $persistentDir =~ /(.*?)([\/\\])*$/;
+ $persistentDir = $1;
+ debug ("persistent directory: $persistentDir\n");
+
+ my @searchpath_old = @searchpath;
+ @searchpath = ();
+ foreach my $path_temp (@searchpath_old) {
+ if ($path_temp eq $persistentDir) {
+ debug("skipping persistent directory $path_temp\n");
+ next;
+ }
+ push @searchpath, $path_temp;
+ }
+}
+
+# Reset $confpath to the first path
+$confpath = $searchpath[0];
+
+#
+# Find existing files to possibly read in.
+#
+push @searchpath, $opts{I} if ($opts{I});
+foreach my $i (@searchpath) {
+ debug("searching $i\n");
+ foreach my $ft (keys(%filetypes)) {
+ if ("$i/$ft" eq $persistentFile) {
+ debug("skipping persistent file $i/$ft\n");
+ next;
+ }
+ debug("searching for $i/$ft\n");
+ $knownfiles{"$i/$ft"} = $ft if (-f "$i/$ft");
+ my $localft = $ft;
+ $localft =~ s/.conf/.local.conf/;
+ $knownfiles{"$i/$localft"} = $ft if (-f "$i/$localft");
+ }
+}
+
+#
+# Ask the user if they want them to be read in and read them
+#
+if (keys(%knownfiles)) {
+ my @files;
+ if (defined($opts{'r'})) {
+ if ($opts{'r'} eq "all" || $opts{'r'} eq "a") {
+ @files = keys(%knownfiles);
+ } elsif ($opts{'r'} ne "none" && $opts{'r'} ne "n") {
+ print "unknown argument to -r: $opts{'r'}\n";
+ exit(1);
+ }
+ } elsif(defined($opts{'R'})) {
+ @files = split(/\s*,\s*/,$opts{'R'});
+ foreach my $i (@files) {
+ my $x = $i;
+ $x =~ s/.*\/([^\/]+)$/$1/;
+ $knownfiles{$i} = $x;
+ }
+ Print("reading: ", join(",",@files),"\n");
+ } else {
+ @files = display_menu(-head => "The following installed configuration files were found:\n",
+ -tail => "Would you like me to read them in? Their content will be merged with the\noutput files created by this session.\n\nValid answer examples: \"all\", \"none\",\"3\",\"1,2,5\"\n",
+ -multiple => 1,
+ -question => 'Read in which',
+ -defaultvalue => 'all',
+ sort keys(%knownfiles));
+ }
+ foreach my $i (@files) {
+ debug("reading $i\n");
+ read_config($i, $knownfiles{$i});
+ }
+}
+
+if ($opts{'g'}) {
+ my @groups = split(/,:\s/,$opts{'g'});
+ foreach my $group (@groups) {
+ do_group($group);
+ }
+} elsif ($#ARGV >= 0) {
+ #
+ # loop through requested files.
+ #
+ foreach my $i (@ARGV) {
+ if (!defined($filetypes{$i})) {
+ warn "invalid file: $i\n";
+ } else {
+ if ($opts{'a'}) {
+ $didfile{$i} = 1;
+ } else {
+ build_file($term, $i, $filetypes{$i});
+ }
+ }
+ }
+} else {
+ #
+ # ask user to select file type to operate on.
+ #
+ while(1) {
+ my $line = display_menu(-head => "I can create the following types of configuration files for you.\nSelect the file type you wish to create:\n(you can create more than one as you run this program)\n",
+ -question => 'Select File',
+ -otheranswers => ['quit'],
+ -mapanswers => { 'q' => 'quit' },
+ keys(%filetypes));
+ last if ($line eq "quit");
+ debug("file selected: $line\n");
+ build_file($term, $line, $filetypes{$line});
+ }
+}
+
+#
+# Write out the results to the output files.
+#
+output_files(\%filetypes, $term);
+
+
+#
+# Display the files that have been created for the user.
+#
+Print("\n\nThe following files were created:\n\n");
+@didfiles = keys(%didfile);
+foreach my $i (@didfiles) {
+ if ($didfile{$i} ne "1") {
+ if ($opts{'i'} || $opts{'I'}) {
+ $opts{'I'} = "$confpath" if (!$opts{'I'});
+
+ if (! (-d "$opts{'I'}") && ! (mkdir ("$opts{'I'}", 0755))) {
+ print "\nCould not create $opts{'I'} directory: $!\n";
+ print ("File $didfile{$i} left in current directory\n");
+ }
+ else {
+ move ("$opts{'I'}/$i", "$opts{'I'}/$i.bak") if (-f "$opts{'I'}/$i");
+ if (move ("$didfile{$i}", "$opts{'I'}")) {
+ print(" $didfile{$i} installed in $opts{'I'}\n");
+ }
+ else {
+ print "\nCould not move file $didfile{$i} to $opts{'I'}/$i: $!\n";
+ print ("File $didfile{$i} left in current directory\n");
+ }
+ }
+ } elsif ($opts{'p'}) {
+ if (! (-d "$home") && ! (mkdir ("$home", 0755))) {
+ print "\nCould not create $home directory: $!\n";
+ print ("File $didfile{$i} left in current directory\n");
+ }
+ else {
+ move ("$home/$i", "$home/$i.bak") if (-f "$home/$i");
+ if (move ("$didfile{$i}", "$home")) {
+ print(" $didfile{$i} installed in $home\n");
+ }
+ else {
+ print "\nCould not move file $didfile{$i} to $home: $!\n";
+ print ("File $didfile{$i} left in current directory\n");
+ }
+ }
+ } else {
+ Print(" $didfile{$i} ",
+ ($i ne $didfile{$i})?"[ from $i specifications]":" ","\n");
+ if ($opts{'d'}) {
+ open(I,$didfile{$i});
+ debug(" " . join(" ",<I>) . "\n");
+ close(I);
+ }
+ }
+ }
+}
+
+if (!$opts{'p'} && !$opts{'i'} && !$opts{'I'}) {
+ Print("\nThese files should be moved to $confpath if you
+want them used by everyone on the system. In the future, if you add
+the -i option to the command line I'll copy them there automatically for you.
+
+Or, if you want them for your personal use only, copy them to
+$home . In the future, if you add the -p option to the
+command line I'll copy them there automatically for you.
+
+");
+}
+
+###########################################################################
+# Functions
+###########################################################################
+
+sub Print {
+ print @_ if (!$opts{'q'});
+}
+#
+# handle a group of questions
+#
+sub get_yn_maybe {
+ my $question = shift;
+ my $ans = "y";
+ if ($question ne "") {
+ $ans = get_answer($term, $question,
+ valid_answers(qw(yes y no n)), 'y');
+ }
+ return ($ans =~ /^y/)?1:0;
+}
+
+sub do_group {
+ my $group = shift;
+ die "no such group $group\n" if (!$groups{$group});
+ foreach my $token (@{$groups{$group}}) {
+ if ($token->[0] eq "message") {
+ Print ("$token->[1] $token->[2]\n");
+ } elsif ($token->[0] eq "subgroup") {
+ do_group($token->[1]) if (get_yn_maybe($token->[2]));
+ } elsif (defined($tokenmap{$token->[1]})) {
+ if (get_yn_maybe($token->[2])) {
+ do {
+ do_line($token->[1], $tokenmap{$token->[1]});
+ } until ($token->[0] ne "multiple" ||
+ get_answer($term, "Do another $token->[1] line?",
+ valid_answers(qw(yes y no n)), 'y')
+ =~ /n/);
+ }
+ } elsif (defined($filetypes{$token->[1]})) {
+ $didfile{$token->[1]} = 1;
+ } else {
+ die "invalid member $token->[1] of group $group\n";
+ }
+ }
+}
+
+#
+# build a particular type of file by operating on sections
+#
+sub build_file {
+ my ($term, $filename, $fileconf) = @_;
+ $didfile{$filename} = 1;
+ my (@lines);
+ while(1) {
+ my $line = display_menu(-head => "The configuration information which can be put into $filename is divided\ninto sections. Select a configuration section for $filename\nthat you wish to create:\n",
+ -otheranswers => ['finished'],
+ -mapanswers => { 'f' => 'finished' },
+ -question => "Select section",
+ -numeric => 1,
+ map { $_->{'title'}[0] } @$fileconf);
+
+ return @lines if ($line eq "finished");
+ do_section($fileconf->[$line-1]);
+ }
+}
+
+#
+# configure a particular section by operating on token types
+#
+sub do_section {
+ my $confsect = shift;
+ my @lines;
+ while(1) {
+ Print ("\nSection: $confsect->{'title'}[0]\n");
+ Print ("Description:\n");
+ Print (" ", join("\n ",@{$confsect->{'description'}}),"\n");
+ my $line =
+ display_menu(-head => "Select from:\n",
+ -otheranswers => ['finished','list'],
+ -mapanswers => { 'f' => 'finished',
+ 'l' => 'list' },
+ -question => 'Select section',
+ -descriptions => [map { $confsect->{$_}{info}[0] }
+ @{$confsect->{'thetokens'}}],
+ @{$confsect->{'thetokens'}});
+ return @lines if ($line eq "finished");
+ if ($line eq "list") {
+ print "Lines defined for section \"$confsect->{title}[0]\" so far:\n";
+ foreach my $i (@{$confsect->{'thetokens'}}) {
+ if ($#{$confsect->{$i}{'results'}} >= 0) {
+ print " ",join("\n ",@{$confsect->{$i}{'results'}}),"\n";
+ }
+ }
+ next;
+ }
+ do_line($line, $confsect->{$line});
+ }
+ return;
+}
+
+#
+# Ask all the questions related to a particular line type
+#
+sub do_line {
+ my $token = shift;
+ my $confline = shift;
+ my (@answers, $counter, $i);
+# debug(my_Dumper($confline));
+ Print ("\nConfiguring: $token\n");
+ Print ("Description:\n ",join("\n ",@{$confline->{'info'}}),"\n\n");
+ for($i=0; $i <= $#{$confline->{'question'}}; $i++) {
+ if (defined($confline->{'question'}[$i]) &&
+ $confline->{'question'}[$i] ne "") {
+ my $q = $confline->{'question'}[$i];
+ $q =~ s/\$(\d+)/$answers[$1]/g;
+ debug("after: $term, $q, ",$confline->{'validanswer'}[$i],"\n");
+ $answers[$i] = get_answer($term, $q,
+ $confline->{'validanswer'}[$i]);
+ $answers[$i] =~ s/\"/\\\"/g;
+ $answers[$i] = '"' . $answers[$i] . '"' if ($answers[$i] =~ /\s/);
+ }
+ }
+ if ($#{$confline->{'line'}} == -1) {
+ my ($i,$line);
+ for($i=0; $i <= $#{$confline->{'question'}}; $i++) {
+ next if (!defined($confline->{'question'}[$i]) ||
+ $confline->{'question'}[$i] eq "");
+ $line .= " \$" . $i;
+ }
+ push @{$confline->{'line'}}, $line;
+ }
+
+ foreach my $line (@{$confline->{'line'}}) {
+ my $finished = $line;
+ debug("preline: $finished\n");
+ debug("answers: ",my_Dumper(\@answers));
+ $finished =~ s/\$(\d+)/$answers[$1]/g;
+ if ($line =~ s/^eval\s+//) {
+ debug("eval: $finished\n");
+ $finished = eval $finished;
+ debug("eval results: $finished\n");
+ }
+ $finished = $token . " " . $finished;
+ Print ("\nFinished Output: $finished\n");
+ push @{$confline->{'results'}},$finished;
+ }
+}
+
+#
+# read all sets of config files in the various subdirectories.
+#
+sub read_config_files {
+ my $readdir = shift;
+ my $filetypes = shift;
+ opendir(DH, $readdir) || die "no such directory $readdir, did you run make install?\n";
+ my $dir;
+ my $configfilename="snmpconf-config";
+
+ while(defined($dir = readdir(DH))) {
+ next if ($dir =~ /^\./);
+ next if ($dir =~ /CVS/);
+ debug("dir entry: $dir\n");
+ if (-d "$readdir/$dir" && -f "$readdir/$dir/$configfilename") {
+
+ my $conffile;
+
+ # read the top level configuration inforamation about the direcotry.
+ open(I, "$readdir/$dir/$configfilename");
+ while(<I>) {
+ $conffile = $1 if (/forconffile: (.*)/);
+ }
+ close(I);
+
+ # no README informatino.
+ if ($conffile eq "") {
+ print STDERR "Warning: No 'forconffile' information in $readdir/$dir/$configfilename\n";
+ next;
+ }
+
+ # read all the daat in the directory
+ $filetypes->{$conffile} = read_config_items("$readdir/$dir", $conffile);
+ } else {
+ # no README informatino.
+ print STDERR "Warning: No $configfilename file found in $readdir/$dir\n";
+ }
+ }
+ closedir DH;
+}
+
+#
+# read each configuration file in a directory
+#
+sub read_config_items {
+ my $itemdir = shift;
+ my $type = shift;
+ opendir(ITEMS, $itemdir);
+ my $file;
+ my @results;
+ while(defined($file = readdir(ITEMS))) {
+ next if ($file =~ /~$/);
+ next if ($file =~ /^snmpconf-config$/);
+ if (-f "$itemdir/$file") {
+ my $res = read_config_item("$itemdir/$file", $type);
+ if (scalar(keys(%$res)) > 0) {
+ push @results, $res;
+ }
+ }
+ }
+ closedir(ITEMS);
+ return \@results;
+}
+
+#
+# mark a list of tokens as a special "group"
+#
+sub read_config_group {
+ my ($fh, $group, $type) = @_;
+ my $line;
+ debug("handling group $group\n");
+ push (@{$groups{$group}},['filetype', $type]);
+ while($line = <$fh>) {
+ chomp($line);
+ next if ($line =~ /^\s*$/);
+ next if ($line =~ /^\#/);
+ return $line if ($line !~ /^(single|multiple|message|filetype|subgroup)/);
+ my ($type, $token, $rest) = ($line =~ /^(\w+)\s+([^\s]+)\s*(.*)/);
+ debug ("reading group $group : $type -> $token -> $rest\n");
+ push (@{$groups{$group}}, [$type, $token, $rest]);
+ }
+ return;
+}
+
+
+#
+# Parse one file
+#
+sub read_config_item {
+ my $itemfile = shift;
+ my $itemcount;
+ my $type = shift;
+ my $fh = new IO::File($itemfile);
+ return if (!defined($fh));
+ my (%results, $curtoken);
+ debug("tokenitems: ", my_Dumper(\%tokenitems));
+ topwhile:
+ while($line = <$fh>) {
+ next if ($line =~ /^\s*\#/);
+ my ($token, $rest) = ($line =~ /^(\w+)\s+(.*)/);
+ next if (!defined($token) || !defined($rest));
+ while ($token eq 'group') {
+ # handle special group list
+ my $next = read_config_group($fh, $rest,$type);
+ if ($next) {
+ ($token, $rest) = ($next =~ /^(\w+)\s+(.*)/);
+ } else {
+ next topwhile;
+ }
+ }
+ debug("token: $token => $rest\n");
+ if ($token eq 'steal') {
+ foreach my $stealfrom (keys(%{$results{$rest}})) {
+ if (!defined($results{$curtoken}{$stealfrom})) {
+ @{$results{$curtoken}{$stealfrom}} =
+ @{$results{$rest}{$stealfrom}};
+ }
+ }
+ } elsif (defined($tokenitems{$token})) {
+ if (!defined($curtoken)) {
+ die "error in configuration file $itemfile, no token set\n";
+ }
+ $rest =~ s/^\#//;
+ push @{$results{$curtoken}{$token}},$rest;
+ } elsif (defined($arrayitems{$token})) {
+ if (!defined($curtoken)) {
+ die "error in configuration file $itemfile, no token set\n";
+ }
+ my ($num, $newrest) = ($rest =~ /^(\d+)\s+(.*)/);
+ if (!defined($num) || !defined($newrest)) {
+ warn "invalid config line: $line\n";
+ } else {
+ $results{$curtoken}{$token}[$num] = $newrest;
+ }
+ } elsif ($token =~ /^token\s*$/) {
+ $rest = lc($rest);
+ $curtoken = $rest;
+ if (! exists $results{$curtoken}{'defined'}) {
+ push @{$results{'thetokens'}}, $curtoken;
+ $results{$curtoken}{'defined'} = 1;
+ }
+ $tokenmap{$curtoken} = $results{$curtoken};
+ debug("current token set to $token\n");
+ } else {
+ push @{$results{$token}},$rest;
+ }
+ }
+ return \%results;
+}
+
+sub debug {
+ print @_ if ($opts{'d'});
+}
+
+sub output_files {
+ my $filetypes = shift;
+ my $term = shift;
+ foreach my $ft (keys(%$filetypes)) {
+ next if (!$didfile{$ft});
+ my $outputf = $ft;
+ if (-f $outputf && !$opts{'f'}) {
+ print "\nError: An $outputf file already exists in this directory.\n\n";
+ my $ans = get_answer($term,"'overwrite', 'skip', 'rename' or 'append'? ",valid_answers(qw(o overwrite r rename s skip a append)));
+ next if ($ans =~ /^(s|skip)$/i);
+ if ($ans =~ /^(a|append)/) {
+ $outputf = ">$outputf";
+ } elsif ($ans =~ /^(r|rename)$/i) {
+ # default to rename for error conditions
+ $outputf = $term->readline("Save to what new file name instead (or 'skip')? ");
+ }
+ }
+ $didfile{$ft} = $outputf;
+ open(O,">$outputf") || warn "couldn't write to $outputf\n";
+ print O "#" x 75,"\n";
+ print O "#\n# $ft\n";
+ print O "#\n# - created by the snmpconf configuration program\n#\n";
+ foreach my $sect (@{$filetypes->{$ft}}) {
+ my $secthelp = 0;
+ foreach my $token (@{$sect->{'thetokens'}}) {
+ if ($#{$sect->{$token}{'results'}} >= 0) {
+ if ($secthelp++ == 0) {
+ print O "#" x 75,"\n# SECTION: ",
+ join("\n# ", @{$sect->{title}}), "\n#\n";
+ print O "# ", join("\n# ",@{$sect->{description}}),
+ "\n";
+ }
+ print O "\n# $token: ",
+ join("\n# ",@{$sect->{$token}{info}}), "\n\n";
+ foreach my $result (@{$sect->{$token}{'results'}}) {
+ print O "$result\n";
+ }
+ }
+ }
+ print O "\n\n\n";
+ }
+ if ($#{$unknown{$ft}} > -1) {
+ print O "#\n# Unknown directives read in from other files by snmpconf\n#\n";
+ foreach my $unknown (@{$unknown{$ft}}) {
+ print O $unknown,"\n";
+ }
+ }
+ close(O);
+ }
+}
+
+sub get_answer {
+ my ($term, $question, $regexp, $defaultval) = @_;
+ $question .= " (default = $defaultval)" if (defined($defaultval) && $defaultval ne "");
+ $question .= ": ";
+ my $ans = $term->readline($question);
+ return $defaultval if ($ans eq "" && defined($defaultval) &&
+ $defaultval ne "");
+ while (!(!defined($regexp) ||
+ $regexp eq "" ||
+ $ans =~ /$regexp/)) {
+ print "invalid answer! It must match this regular expression: $regexp\n";
+ $ans = $term->readline($question);
+ }
+ return $defaultval if ($ans eq "" && defined($defaultval) &&
+ $defaultval ne "");
+ return $ans;
+}
+
+sub valid_answers {
+ my @list;
+ foreach $i (@_) {
+ push @list, $i if ($i);
+ }
+ return "^(" . join("|",@list) . ")\$";
+}
+
+sub read_config {
+ my $file = shift;
+ my $filetype = shift;
+ return if (!defined($filetypes{$filetype}));
+ if (! -f $file) {
+ warn "$file does not exist\n";
+ return;
+ }
+ open(I,$file);
+ while(<I>) {
+ next if (/^\s*\#/);
+ next if (/^\s*$/);
+ chomp;
+ my ($token, $rest) = /^\s*(\w+)\s+(.*)/;
+ $token = lc($token);
+ next if (defined($alllines{$_})); # drop duplicate lines
+ if (defined($tokenmap{$token})) {
+ push @{$tokenmap{$token}{'results'}},$_;
+ } else {
+ push @{$unknown{$filetype}},$_;
+ }
+ $alllines{$_}++;
+ }
+ close(I);
+}
+
+sub display_menu {
+ my %config;
+
+ while ($#_ > -1 && $_[0] =~ /^-/) {
+ my $key = shift;
+ $config{$key} = shift;
+ }
+
+ my $count=1;
+ print "\n" if (!defined($config{'-dense'}));
+ if ($config{'-head'}) {
+ print $config{'-head'};
+ print "\n" if (!defined($config{'-dense'}));
+ }
+ my @answers = @_;
+ my @list;
+ if (defined($config{'-descriptions'}) &&
+ ref($config{'-descriptions'}) eq "ARRAY") {
+ @list = @{$config{'-descriptions'}}
+ } else {
+ @list = @_;
+ }
+ foreach my $i (@list) {
+ printf " %2d: $i\n", $count++ if ($i);
+ }
+ print "\n" if (!defined($config{'-dense'}));
+ if (defined($config{'-otheranswers'})) {
+ if (ref($config{'-otheranswers'}) eq 'ARRAY') {
+ print "Other options: ", join(", ",
+ @{$config{'-otheranswers'}}), "\n";
+ push @answers, @{$config{'-otheranswers'}};
+ push @answers, keys(%{$config{'-mapanswers'}});
+ } else {
+ my $maxlen = 0;
+ push @answers,keys(%{$config{'-otheranswers'}});
+ foreach my $i (keys(%{$config{'-otheranswers'}})) {
+ $maxlen = length($i) if (length($i) > $maxlen);
+ }
+ foreach my $i (keys(%{$config{'-otheranswers'}})) {
+ printf(" %-" . $maxlen . "s: %s\n", $i,
+ $config{'-otheranswers'}{$i});
+ }
+ }
+ print "\n" if (!defined($config{'-dense'}));
+ }
+ if ($config{'-tail'}) {
+ print $config{'-tail'};
+ print "\n" if (!defined($config{'-dense'}));
+ }
+
+ if (defined($config{'-question'})) {
+ while(1) {
+ my $numexpr;
+ if ($config{'-multiple'}) {
+ $numexpr = '[\d\s,]+|all|a|none|n';
+ } else {
+ $numexpr = '\d+';
+ }
+ push @answers,"" if ($config{'-defaultvalue'});
+ $ans = get_answer($term, $config{'-question'},
+ valid_answers($numexpr,@answers),
+ $config{'-defaultvalue'});
+ if ($config{'-mapanswers'}{$ans}) {
+ $ans = $config{'-mapanswers'}{$ans};
+ }
+
+ if ($ans =~ /^$numexpr$/) {
+ if ($config{'-multiple'}) {
+ my @list = split(/\s*,\s*/,$ans);
+ my @ret;
+ $count = 0;
+ foreach my $i (@_) {
+ $count++;
+ if ($ans eq "all" || $ans eq "a"
+ || grep(/^$count$/,@list)) {
+ push @ret, $i;
+ }
+ }
+ return @ret;
+ } else {
+ if ($ans <= 0 || $ans > $#_+1) {
+ warn "invalid selection: $ans [must be 1-" .
+ ($#_+1) . "]\n";
+ } else {
+ return $ans if ($config{'-numeric'});
+ $count = 0;
+ foreach my $i (@_) {
+ $count++;
+ if ($ans eq $count) {
+ return $i;
+ }
+ }
+ }
+ }
+ } else {
+ return $ans;
+ }
+ }
+ }
+}
+
+sub my_Dumper {
+ if ($opts{'D'}) {
+ return Dumper(@_);
+ } else {
+ return "\n";
+ }
+}
+
+sub get_persistentDir {
+ my $file = shift;
+ my $result = 0;
+ if (! -f $file) {
+ return 0;
+ }
+ open(I,$file);
+ while(<I>) {
+ next if (/^\s*\#/);
+ next if (/^\s*$/);
+ chomp;
+ my ($token, $rest) = /^\s*(\w+)\s+(.*)/;
+ if (lc($token) eq "persistentdir") {
+ $result = $rest;
+ }
+ next;
+ }
+ close(I);
+ return $result;
+}
+
+# Usage: &win32_reg_read("key", "value")
+# Example: &win32_reg_read("SOFTWARE\\Net-SNMP","SNMPSHAREPATH");
+# Returns: Value if found in HKCU or HCLM. Otherwise an empty string.
+sub win32_reg_read {
+ my $sub_key = shift;
+ my $value = shift;
+
+ require Win32::Registry;
+
+ my ($hkey, %key_values, $temp, $no_warn);
+
+ # Try HKCU first
+ $no_warn = $HKEY_CURRENT_USER;
+ if ($HKEY_CURRENT_USER->Open($sub_key, $hkey))
+ {
+ $hkey->GetValues(\%key_values);
+ foreach $temp (sort keys %key_values) {
+ if ($temp eq $value) {
+ return $key_values{$temp}[2];
+ }
+ }
+ $hkey->Close();
+ }
+
+ # Try HKLM second
+ $no_warn = $HKEY_LOCAL_MACHINE;
+ if ($HKEY_LOCAL_MACHINE->Open($sub_key, $hkey))
+ {
+ $hkey->GetValues(\%key_values);
+ foreach $temp (sort keys %key_values) {
+ if ($temp eq $value) {
+ return $key_values{$temp}[2];
+ }
+ }
+ $hkey->Close();
+ }
+ return "";
+}
+
+# Usage: &my_getenv("key")
+# Example: &my_getenv("SNMPSHAREPATH");
+# Returns: Unix: Environment variable value (undef if not defined)
+# Win32: HKCU\Software\Net-SNMP\(key) or
+# Win32: HKLM\Software\Net-SNMP\(key) or
+# Win32: Environment variable value (undef if not defined)
+sub my_getenv {
+ my $key = shift;
+
+ # Unix
+ if ($^O ne 'MSWin32') {
+ return $ENV{$key};
+ }
+ # Windows
+ else {
+ my $temp = &win32_reg_read("SOFTWARE\\Net-SNMP","$key");
+ if ($temp ne "") {
+ return $temp;
+ }
+ else {
+ return $ENV{$key};
+ }
+ }
+}
+
diff --git a/local/snmpconf.dir/snmp-data/authopts b/local/snmpconf.dir/snmp-data/authopts
new file mode 100644
index 0000000..12cd8e5
--- /dev/null
+++ b/local/snmpconf.dir/snmp-data/authopts
@@ -0,0 +1,77 @@
+title Default Authentication Options
+description This section defines the default authentication
+description information. Setting these up properly in your
+description ~/.snmp/snmp.conf file will greatly reduce the amount of
+description command line arguments you need to type (especially for snmpv3).
+
+token defaultPort
+info The default port number to use
+info This token specifies the default port number you want packets to
+info be sent to and received from.
+info override: with -p on the command line.
+info arguments: portnum
+question 1 Enter the default port number to use
+
+token defVersion
+info The default snmp version number to use.
+info override: with -v on the command line.
+info arguments: 1|2c|3
+question 1 Enter the default snmp version number to use (1|2c|3)
+validanswer 1 ^(1|2c|3)$
+
+token defCommunity
+info The default snmpv1 and snmpv2c community name to use when needed.
+info If this is specified, you don't need to include the community
+info name as an argument to the snmp applications.
+info override: with -c on the command line.
+info arguments: communityname
+question 1 Enter the default community name to use
+
+token defSecurityName
+info The default snmpv3 security name to use when using snmpv3
+info override: with -u on the command line.
+info arguments: securityname
+question 1 Enter the default security name to use
+
+token defContext
+info The default snmpv3 context name to use
+info override: with -n on the command line.
+info arguments: contextname
+question 1 Enter the default context name to use
+
+token defSecurityLevel
+info The default snmpv3 security level to use
+info override: with -l on the command line.
+info arguments: noAuthNoPriv|authNoPriv|authPriv
+question 1 Enter the default privacy pass phrase to use
+validanswer 1 ^(noAuthNoPriv|authNoPriv|authPriv|nanp|anp|ap)$
+
+token defAuthType
+info The default snmpv3 authentication type name to use
+info override: with -a on the command line.
+info arguments: authtype
+question 1 Enter the default authentication type to use (MD5|SHA)
+validanswer 1 ^(MD5|SHA)$
+
+token defAuthPassphrase
+info The default snmpv3 authentication pass phrase to use
+info Note: It must be at least 8 characters long.
+info override: with -A on the command line.
+info arguments: passphrase
+question 1 Enter the default authentication pass phrase to use
+
+token defPrivType
+info The default snmpv3 privacy (encryption) type name to use
+info override: with -x on the command line.
+info arguments: privtype
+question 1 Enter the default privacy type to use (DES|AES)
+validanswer 1 ^(DES|AES)$
+
+token defPrivPassphrase
+info The default snmpv3 privacy pass phrase to use
+info Note: It must be at least 8 characters long.
+info override: with -X on the command line.
+info arguments: passphrase
+question 1 Enter the default privacy pass phrase to use
+
+
diff --git a/local/snmpconf.dir/snmp-data/debugging b/local/snmpconf.dir/snmp-data/debugging
new file mode 100644
index 0000000..90a271f
--- /dev/null
+++ b/local/snmpconf.dir/snmp-data/debugging
@@ -0,0 +1,39 @@
+title Debugging output options
+description This section allows debugging output of various kinds to
+description be turned on or off.
+
+token doDebugging
+info Turns debugging output on or off (0|1)
+info arguments: (0|1)
+question 1 Turn debugging on (0|1)
+validanswer 1 ^(0|1)$
+
+token debugTokens
+info Debugging tokens specify which lines of debugging
+info output you'd actually like to see. Each section of code is most
+info likely instrumented with a particular "tag". So, to see that tag you
+info would specify it here. Specifying a tag will match against all
+info tags that begin with that prefix, so the tag "test" will match
+info "test_function" and "test_something" and...
+info There are a few special tokens as well:
+info - ALL: turns on all the tokens (which generates lots of output)
+info - trace: prints 'trace' lines showing source code files and
+info - line numbers as they're traversed.
+info - dump: Nicely breaks down packets as they're parsed or sent out.
+info command line equivelent: -Dtoken[,token...]
+info arguments: token[,token...]
+question 1 Enter the tokens (comma seperated) you wish to see output for
+
+token dumpPacket
+info Print packets as they are received or sent
+info arguments: (1|yes|true|0|no|false)
+info command line equivelent: -d
+validanswer 1 ^(1|yes|true|0|no|false)$
+question 1 Print packets as they are received or sent
+
+
+token noTokenWarnings
+info Silence warnings about unknown tokens in configuration files
+question 1 Silence warnings about unknown tokens in configuration files
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
diff --git a/local/snmpconf.dir/snmp-data/mibs b/local/snmpconf.dir/snmp-data/mibs
new file mode 100644
index 0000000..c3cfd74
--- /dev/null
+++ b/local/snmpconf.dir/snmp-data/mibs
@@ -0,0 +1,56 @@
+title Textual mib parsing
+description This section controls the textual mib parser. Textual
+description mibs are parsed in order to convert OIDs, enumerated
+description lists, and ... to and from textual representations
+description and numerical representations.
+
+token mibdirs
+info Specifies directories to be searched for mibs.
+info Adding a '+' sign to the front of the argument appends the new
+info directory to the list of directories already being searched.
+info arguments: [+]directory[:directory...]
+question 1 Enter the list of directories to search through for mibs
+
+token mibs
+info Specifies a list of mibs to be searched for and loaded.
+info Adding a '+' sign to the front of the argument appends the new
+info mib name to the list of mibs already being searched for.
+info arguments: [+]mibname[:mibname...]
+question 1 Enter the list of mibs to read
+
+token mibfile
+info Loads a particular mib file from a particualar path
+info arguments: /path/to/mibfile
+question 1 Enter the mib file name to read
+
+token showMibErrors
+info Should errors in mibs be displayed when the mibs are loaded
+question 1 Should errors in mibs be displayed when the mibs are loaded
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
+
+token mibWarningLevel
+info Should warnings about mibs be displayed when the mibs are loaded
+question 1 Should warnings about mibs be displayed when the mibs are loaded
+info arguments: 1|2
+validanswer 1 ^(1|2)$
+
+token strictCommentTerm
+info Be strict about about mib comment termination.
+info Strictly follow comment rules about parsing mibs.
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
+question 1 Be strict about about mib comment termination
+
+token mibAllowUnderline
+info Should underlines be allowed in mib symbols (illegal)
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
+question 1 Should underlines be allowed in mib symbols
+
+token mibReplaceWithLatest
+info Force replacement of older mibs with known updated ones
+question 1 Force replacement of older mibs with known updated ones
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
+
diff --git a/local/snmpconf.dir/snmp-data/output b/local/snmpconf.dir/snmp-data/output
new file mode 100644
index 0000000..ae3c561
--- /dev/null
+++ b/local/snmpconf.dir/snmp-data/output
@@ -0,0 +1,79 @@
+title Output style options
+description This section allows you to control how the output of the
+description various commands will be formated
+
+token logTimestamp
+info Should timestamps be shown on the output
+info arguments: (1|yes|true|0|no|false)
+question 1 Should timestamps be shown on the output
+validanswer 1 ^(1|yes|true|0|no|false)$
+
+token printNumericEnums
+info Print enums numericly or textually
+info command line equivelent: -Oe
+question 1 Print enums numericly
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
+
+token printNumericOids
+info Print OIDs numericly or textually
+info command line equivelent: -On
+question 1 Print enums numericly
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
+
+token dontBreakdownOids
+info When OIDs contain a index to a table, they are broken
+info into the displayable pieces and shown to you.
+info For example the oid vacmSecurityModel.0.3.119.101.115
+info is nicely broken down by
+info default and the string hidden in the oid is shown
+info to you as vacmSecurityModel.0."wes". This token and the -Ob
+info option diables this feature and displays it as
+info vacmSecurityModel.0.3.119.101.115 again.
+info command line equivelent: -Ob
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
+question 1 Disable the breaking-down of OIDs?
+
+token escapeQuotes
+info Should the quotation marks in broken down oids be escaped
+info If you want to cut and paste oids that have been broken down
+info into indexes and strings, this will put a backslash in front of them
+info so your shell will pass them rather than interpret them.
+info arguments: (1|yes|true|0|no|false)
+question 1 Should the quotation marks in broken down oids be escaped
+validanswer 1 ^(1|yes|true|0|no|false)$
+
+token quickPrinting
+info Make the output simple for quick parsing
+info This option removes the equal sign and value identifies leaving
+info just the oid and the value on the output for easier parsing in scripts
+info command line equivelent: -Oq
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
+question 1 Make the output simple for quick parsing
+
+token numericTimeticks
+info Print timeticks as a number and not a time-string
+info command line equivelent:
+info arguments: (1|yes|true|0|no|false)
+question 1 Print timeticks as a number and not a time-string
+validanswer 1 ^(1|yes|true|0|no|false)$
+
+token suffixPrinting
+info Shorten OIDs printed to the screen
+info possible values:
+info - 0: UCD-style. OIDs are displayed like:
+info - system.sysUpTime.0
+info - 1: deletes all by the last symbolic part of the OID:
+info - system.sysUpTime.0 becomes sysUpTime.0
+info - 2: is a variant of this, adding the name of the MIB
+info - that defined this object:
+info - system.sysUpTime.0 becomes SNMPv2-MIB::sysUpTime.0
+info - (This is the default with net-snmp v5)
+info command line equivelent: 0 = -Ou, 1 = -Os, 2 = -OS
+info arguments: (1|2)
+question 1 Shorten OIDs (0|1|2)
+validanswer 1 ^(0|1|2)$
+
diff --git a/local/snmpconf.dir/snmp-data/snmpconf-config b/local/snmpconf.dir/snmp-data/snmpconf-config
new file mode 100644
index 0000000..9be7d10
--- /dev/null
+++ b/local/snmpconf.dir/snmp-data/snmpconf-config
@@ -0,0 +1 @@
+forconffile: snmp.conf
diff --git a/local/snmpconf.dir/snmpd-data/acl b/local/snmpconf.dir/snmpd-data/acl
new file mode 100644
index 0000000..14f44a8
--- /dev/null
+++ b/local/snmpconf.dir/snmpd-data/acl
@@ -0,0 +1,36 @@
+title Access Control Setup
+description This section defines who is allowed to talk to your running
+description snmp agent.
+
+token rwuser
+info a SNMPv3 read-write user
+info arguments: user [noauth|auth|priv] [restriction_oid]
+question 1 The SNMPv3 user that should have read-write access
+question 2 The minimum security level required for that user [noauth|auth|priv, default = auth]
+validanswer 2 (noauth|auth|priv|)
+question 3 The OID that this community should be restricted to [if appropriate]
+
+token rouser
+info a SNMPv3 read-only user
+info arguments: user [noauth|auth|priv] [restriction_oid]
+steal rwuser
+question 1 Enter the SNMPv3 user that should have read-only access to the system
+
+token rocommunity
+info a SNMPv1/SNMPv2c read-only access community name
+info arguments: community [default|hostname|network/bits] [oid]
+question 1 The community name to add read-only access for
+question 2 The hostname or network address to accept this community name from [RETURN for all]
+question 3 The OID that this community should be restricted to [RETURN for no-restriction]
+
+token rwcommunity
+info a SNMPv1/SNMPv2c read-write access community name
+info arguments: community [default|hostname|network/bits] [oid]
+steal rocommunity
+question 1 Enter the community name to add read-write access for
+
+group access_control
+multiple rwuser Do you want to allow SNMPv3 read-write user based access
+multiple rouser Do you want to allow SNMPv3 read-only user based access
+multiple rwcommunity Do you want to allow SNMPv1/v2c read-write community access
+multiple rocommunity Do you want to allow SNMPv1/v2c read-only community access
diff --git a/local/snmpconf.dir/snmpd-data/basic_setup b/local/snmpconf.dir/snmpd-data/basic_setup
new file mode 100644
index 0000000..28721e1
--- /dev/null
+++ b/local/snmpconf.dir/snmpd-data/basic_setup
@@ -0,0 +1,17 @@
+group basic_setup
+message ************************************************
+message *** Beginning basic system information setup ***
+message ************************************************
+subgroup system_setup Do you want to configure the information returned in the system MIB group (contact info, etc)?
+message **************************************
+message *** BEGINNING ACCESS CONTROL SETUP ***
+message **************************************
+subgroup access_control Do you want to configure the agent's access control?
+message ****************************************
+message *** Beginning trap destination setup ***
+message ****************************************
+subgroup trapsinks Do you want to configure where and if the agent will send traps?
+message ****************************************
+message *** Beginning monitoring setup ***
+message ****************************************
+subgroup monitoring_services Do you want to configure the agent's ability to monitor various aspects of your system?
diff --git a/local/snmpconf.dir/snmpd-data/extending b/local/snmpconf.dir/snmpd-data/extending
new file mode 100644
index 0000000..039b103
--- /dev/null
+++ b/local/snmpconf.dir/snmpd-data/extending
@@ -0,0 +1,68 @@
+title Extending the Agent
+description You can extend the snmp agent to have it return information
+description that you yourself define.
+
+token exec
+info run a simple command using exec()
+info arguments: [oid] name /path/to/executable arguments
+question 1 The OID where the results table should be display [default=extTable]
+question 2 The "name" to associate with this command when displaying the results.
+question 3 The path to the program to be run.
+question 4 The arguments to pass to $3
+
+token pass
+info Run a command that intepretes the request for an entire tree.
+info The pass program defined here will get called for all
+info requests below a certain point in the mib tree. It is then
+info responsible for returning the right data beyond that point.
+info #
+info arguments: miboid program
+info #
+info example: pass .1.3.6.1.4.1.2021.255 /path/to/local/passtest
+info #
+info See the snmpd.conf manual page for further information.
+info #
+info Consider using "pass_persist" for a performance increase.
+question 1 The OID where the script should take control of
+question 2 The path to the program that should be called
+
+token pass_persist
+info Run a persistant process that intepretes the request for an entire tree.
+info The pass program defined here will get called for all
+info requests below a certain point in the mib tree. It is then
+info responsible for returning the right data beyond that point.
+info The pass_persist scripts must be able to stay running and accept input
+info from stdin.
+info #
+info arguments: miboid program
+info #
+info example: pass_persist .1.3.6.1.4.1.2021.255 /path/to/local/pass_persisttest
+info #
+info See the snmpd.conf manual page for further information.
+steal pass
+
+token proxy
+info Proxy requests to an external agent running somewhere else
+info This passes all requests for a certain point of the mib tree to
+info an external agent using snmp requests and then returning the
+info results to the caller that spoke to our agent.
+info arguments: [snmpcmd args] host oid [remoteoid]
+question 1 Enter the "snmpcmd" arguments that specify how to talk to the remote host
+question 2 The host you want to pass the requests to
+qusetion 3 The oid that we should pass beyond
+question 4 The oid of the remote site that we should talk to if different from $3
+
+token sh
+info run a simple command using system()
+info arguments: [oid] name command arguments
+info similar to exec, but implemented using system() instead of exec()
+info #
+info For security reasons, exec should be preferred.
+steal exec
+
+token dlmod
+info dynamically extend the agent using a shared-object
+info arguments: module-name module-path
+question 1 Enter the name of the module
+question 2 Enter the path to the $1 module
+
diff --git a/local/snmpconf.dir/snmpd-data/monitor b/local/snmpconf.dir/snmpd-data/monitor
new file mode 100644
index 0000000..9458793
--- /dev/null
+++ b/local/snmpconf.dir/snmpd-data/monitor
@@ -0,0 +1,72 @@
+title Monitor Various Aspects of the Running Host
+description The following check up on various aspects of a host.
+
+token proc
+info Check for processes that should be running.
+info # proc NAME [MAX=0] [MIN=0]
+info #
+info # NAME: the name of the process to check for. It must match
+info # exactly (ie, http will not find httpd processes).
+info # MAX: the maximum number allowed to be running. Defaults to 0.
+info # MIN: the minimum number to be running. Defaults to 0.
+info #
+info The results are reported in the prTable section of the UCD-SNMP-MIB tree
+info Special Case: When the min and max numbers are both 0, it assumes
+info you want a max of infinity and a min of 1.
+question 1 Name of the process you want to check on
+question 2 Maximum number of processes named '$1' that should be running [default = 0]
+question 3 Minimum number of processes named '$1' that should be running [default = 0]
+
+token disk
+info Check for disk space usage of a partition.
+info The agent can check the amount of available disk space, and make
+info sure it is above a set limit.
+info
+info # disk PATH [MIN=100000]
+info #
+info # PATH: mount path to the disk in question.
+info # MIN: Disks with space below this value will have the Mib's errorFlag set.
+info # Can be a raw integer value (units of kB) or a percentage followed by the %
+info # symbol. Default value = 100000.
+info #
+info The results are reported in the dskTable section of the UCD-SNMP-MIB tree
+question 1 Enter the mount point for the disk partion to be checked on
+question 2 Enter the minimum amount of space that should be available on $1
+
+token load
+info Check for unreasonable load average values.
+info Watch the load average levels on the machine.
+info
+info # load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]
+info #
+info # 1MAX: If the 1 minute load average is above this limit at query
+info # time, the errorFlag will be set.
+info # 5MAX: Similar, but for 5 min average.
+info # 15MAX: Similar, but for 15 min average.
+info #
+info The results are reported in the laTable section of the UCD-SNMP-MIB tree
+question 1 Enter the maximum allowable value for the 1 minute load average
+question 2 Enter the maximum allowable value for the 5 minute load average
+question 3 Enter the maximum allowable value for the 15 minute load average
+validanswer 1 ^[\d\.]+$
+validanswer 2 ^([\d\.]+|)$
+validanswer 3 ^([\d\.]+|)$
+
+token file
+info Check on the size of a file.
+info Display a files size statistics.
+info If it grows to be too large, report an error about it.
+info
+info # file /path/to/file [maxsize_in_kilobytes]
+info #
+info # if maxsize is not specified, assume only size reporting is needed.
+info #
+info The results are reported in the fileTable section of the UCD-SNMP-MIB tree
+question 1 Enter the path to the file you wish to monitor
+question 2 Enter the maximum size (in kilobytes) allowable for $1
+
+group monitoring_services
+multiple proc Do you want to configure the agents ability to monitor processes?
+multiple disk Do you want to configure the agents ability to monitor disk space?
+multiple load Do you want to configure the agents ability to monitor load average?
+multiple file Do you want to configure the agents ability to monitor file sizes?
diff --git a/local/snmpconf.dir/snmpd-data/operation b/local/snmpconf.dir/snmpd-data/operation
new file mode 100644
index 0000000..8a286e5
--- /dev/null
+++ b/local/snmpconf.dir/snmpd-data/operation
@@ -0,0 +1,32 @@
+title Agent Operating Mode
+description This section defines how the agent will operate when it
+description is running.
+
+token master
+info Should the agent operate as a master agent or not.
+info Currently, the only supported master agent type for this token
+info is "agentx".
+info #
+info arguments: (on|yes|agentx|all|off|no)
+question 1 Should the agent run as a AgentX master agent?
+validanswer 1 ^(on|yes|agentx|all|off|no)$
+
+token agentuser
+info The system user that the agent runs as.
+info arguments: name|#uid
+question 1 Enter the name of the user that you want the agent to run as
+
+token agentgroup
+info The system group that the agent runs as.
+info arguments: group|#GID
+question 1 Enter the name of the group that you want the agent to run as
+
+token agentaddress
+info The IP address and port number that the agent will listen on.
+info By default the agent listens to any and all traffic from any
+info interface on the default SNMP port (161). This allows you to
+info specify which address, interface, transport type and port(s) that you
+info want the agent to listen on. Multiple definitions of this token
+info are concatenated together (using ':'s).
+info arguments: [transport:]port[@interface/address],...
+question 1 Enter the port numbers, etc that you want the agent to listen to
diff --git a/local/snmpconf.dir/snmpd-data/snmpconf-config b/local/snmpconf.dir/snmpd-data/snmpconf-config
new file mode 100644
index 0000000..49d06bb
--- /dev/null
+++ b/local/snmpconf.dir/snmpd-data/snmpconf-config
@@ -0,0 +1 @@
+forconffile: snmpd.conf
diff --git a/local/snmpconf.dir/snmpd-data/system b/local/snmpconf.dir/snmpd-data/system
new file mode 100644
index 0000000..4cd09b9
--- /dev/null
+++ b/local/snmpconf.dir/snmpd-data/system
@@ -0,0 +1,43 @@
+title System Information Setup
+description This section defines some of the information reported in
+description the "system" mib group in the mibII tree.
+
+token syslocation
+info The [typically physical] location of the system.
+info Note that setting this value here means that when trying to
+info perform an snmp SET operation to the sysLocation.0 variable will make
+info the agent return the "notWritable" error code. IE, including
+info this token in the snmpd.conf file will disable write access to
+info the variable.
+info arguments: location_string
+question 1 The location of the system
+
+token syscontact
+info The contact information for the administrator
+info Note that setting this value here means that when trying to
+info perform an snmp SET operation to the sysContact.0 variable will make
+info the agent return the "notWritable" error code. IE, including
+info this token in the snmpd.conf file will disable write access to
+info the variable.
+info arguments: contact_string
+question 1 The contact information
+
+token sysservices
+info The proper value for the sysServices object.
+info arguments: sysservices_number
+question 1 does this host offer physical services (eg, like a repeater) [answer 0 or 1]
+question 2 does this host offer datalink/subnetwork services (eg, like a bridge)
+question 3 does this host offer internet services (eg, supports IP)
+question 4 does this host offer end-to-end services (eg, supports TCP)
+question 7 does this host offer application services (eg, supports SMTP)
+validanswer 1 ^(0|1)$
+validanswer 2 ^(0|1)$
+validanswer 3 ^(0|1)$
+validanswer 4 ^(0|1)$
+validanswer 7 ^(0|1)$
+line eval $1*1 + $2*2 + $3*4 + $4*8 + $7*64
+
+group system_setup
+single syslocation
+single syscontact
+single sysservices Do you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)?
diff --git a/local/snmpconf.dir/snmpd-data/trapsinks b/local/snmpconf.dir/snmpd-data/trapsinks
new file mode 100644
index 0000000..cc29b66
--- /dev/null
+++ b/local/snmpconf.dir/snmpd-data/trapsinks
@@ -0,0 +1,46 @@
+title Trap Destinations
+description Here we define who the agent will send traps to.
+
+token trapsink
+info A SNMPv1 trap receiver
+info arguments: host [community] [portnum]
+question 1 A host name that should receive the trap
+question 2 The community to be used in the trap sent [optional]
+question 3 The port number the trap should be sent to [optional]
+validanswer 3 ^(\d+|)$
+
+token trap2sink
+info A SNMPv2c trap receiver
+info arguments: host [community] [portnum]
+steal trapsink
+
+token informsink
+info A SNMPv2c inform (acknowledged trap) receiver
+info arguments: host [community] [portnum]
+steal trapsink
+
+token trapsess
+info A generic trap receiver defined using snmpcmd style arguments.
+info Read the snmpcmd manual page for further information.
+info arguments: [snmpcmdargs] host
+question 1 Specify the command line snmpcmd style options for this host
+question 2 Specify the host name
+
+token trapcommunity
+info Default trap sink community to use
+info arguments: community-string
+question 1 The default community name to use when sending traps
+
+
+token authtrapenable
+info Should we send traps when authentication failures occur
+info arguments: 1 | 2 (1 = yes, 2 = no)
+question 1 Should traps be sent when authentication failures occur? (1=yes, 2=no)
+validanswer 1 ^(1|2)$
+
+group trapsinks
+single authtrapenable Do you want the agent to send snmp traps on snmp authentication failures?
+single trapcommunity
+multiple informsink Do you want the agent to send snmpv2c informs to a trap receiver
+multiple trap2sink Do you want the agent to send snmpv2c traps to a trap receiver
+multiple trapsink Do you want the agent to send snmpv1 traps to a trap receiver
diff --git a/local/snmpconf.dir/snmptrapd-data/authentication b/local/snmpconf.dir/snmptrapd-data/authentication
new file mode 100644
index 0000000..6591b2d
--- /dev/null
+++ b/local/snmpconf.dir/snmptrapd-data/authentication
@@ -0,0 +1,8 @@
+title Authentication options
+description Authentication options
+
+token ignoreAuthFailure
+info Ignore authentication failure traps
+info arguments: (1|yes|true|0|no|false)
+question 1 Ignore authentication failure traps
+validanswer 1 ^(1|yes|true|0|no|false)
diff --git a/local/snmpconf.dir/snmptrapd-data/formatting b/local/snmpconf.dir/snmptrapd-data/formatting
new file mode 100644
index 0000000..5b824b2
--- /dev/null
+++ b/local/snmpconf.dir/snmptrapd-data/formatting
@@ -0,0 +1,15 @@
+title Output formatting for traps received.
+description Output from snmptrapd is formatted according to the
+description rules defined by the formatting configuration directives.
+
+token format1
+info How SNMPv1 traps are formatted.
+info See the snmptrapd.conf manual page for format string details.
+info arguments: formatstring
+question 1 The format specification string for SNMPv1 traps
+
+token format2
+info How SNMPv2 and SNMPv3 traps are formatted.
+info See the snmptrapd.conf manual page for format string details.
+info arguments: formatstring
+question 1 The format specification string for SNMPv2 and SNMPv3 traps.
diff --git a/local/snmpconf.dir/snmptrapd-data/logging b/local/snmpconf.dir/snmptrapd-data/logging
new file mode 100644
index 0000000..81abe37
--- /dev/null
+++ b/local/snmpconf.dir/snmptrapd-data/logging
@@ -0,0 +1,26 @@
+title Logging options
+description Logging options
+
+token doNotLogTraps
+info Prevent traps from being logged
+info Useful when you only want to use traphandles
+info arguments: (1|yes|true|0|no|false)
+question 1 Should traps be logged
+validanswer 1 ^(1|yes|true|0|no|false)
+
+token logOption
+info Set options controlling where to log to
+info See -L options in the snmptrapd.conf man page
+question 1 Logging options
+
+token outputOption
+info Toggle options controlling output display
+info See -O options in the snmptrapd.conf man page
+question 1 Logging options
+
+token printEventNumbers
+info Print event numbers (rising/falling alarm, etc.)
+info arguments: (1|yes|true|0|no|false)
+question 1 Print event numbers
+validanswer 1 ^(1|yes|true|0|no|false)
+
diff --git a/local/snmpconf.dir/snmptrapd-data/runtime b/local/snmpconf.dir/snmptrapd-data/runtime
new file mode 100644
index 0000000..5a342c2
--- /dev/null
+++ b/local/snmpconf.dir/snmptrapd-data/runtime
@@ -0,0 +1,13 @@
+title Runtime options
+description Runtime options
+
+token doNotFork
+info Do not fork from the shell
+question 1 Do not fork from the shell
+info arguments: (1|yes|true|0|no|false)
+validanswer 1 ^(1|yes|true|0|no|false)$
+
+token pidFile
+info Store Process ID in file
+info arguments: PID file
+question 1 PID file
diff --git a/local/snmpconf.dir/snmptrapd-data/snmpconf-config b/local/snmpconf.dir/snmptrapd-data/snmpconf-config
new file mode 100644
index 0000000..6f1e4f7
--- /dev/null
+++ b/local/snmpconf.dir/snmptrapd-data/snmpconf-config
@@ -0,0 +1 @@
+forconffile: snmptrapd.conf
diff --git a/local/snmpconf.dir/snmptrapd-data/traphandle b/local/snmpconf.dir/snmptrapd-data/traphandle
new file mode 100644
index 0000000..384364e
--- /dev/null
+++ b/local/snmpconf.dir/snmptrapd-data/traphandle
@@ -0,0 +1,17 @@
+title Trap Handlers
+description Here we define what programs are run when a trap is
+description received by the trap receiver.
+
+token traphandle
+info When traps are received, a program can be run.
+info When traps are received, the list of configured trap
+info handles is consulted and any configured program is run.
+info If no handler is found, any handler with "default" as the
+info traphandle type is run instead. The information contained
+info in trap is passed to the program via standard input (see
+info the snmptrapd.conf manual page for details).
+info #
+info arguments: oid|"default" program args
+question 1 The oid of the trap you want to handle.
+question 2 The program you want to run If the program is a script, specify the script program first (ie /bin/sh /path/to/script).
+question 3 Arguments that you want passed to the program
diff --git a/local/snmpdump.pl b/local/snmpdump.pl
new file mode 100755
index 0000000..0220beb
--- /dev/null
+++ b/local/snmpdump.pl
@@ -0,0 +1,107 @@
+#!/usr/bin/perl
+#
+# Reformat 'snmpcmd -d' style raw dump output
+# into something a little easier to understand.
+#
+
+
+sub parse_dump {
+ #
+ # Basic formatting technique:
+ # Display the contents of each nested SEQUENCE
+ # indented from the enclosing level.
+ # Individual data fields are all on one line
+ #
+ my @data = @_;
+ my $indent = shift( @data );
+ my $datalen = shift( @data );
+
+ while ( $datalen > 0 ) {
+ my ($tag, $tlen, $tmp);
+ my ($tag1, $tag2 );
+ $tag = shift( @data );
+ $tmp = shift( @data );
+ $tlen = hex($tmp);
+ #
+ # Handle 2-octet lengths
+ if ( $tlen >= 128 ) {
+ $tlen -= 128;
+ $tmp = shift( @data );
+ $tlen += hex($tmp);
+ }
+ $datalen -= ($tlen + 2 );
+
+ $tag1 = substr($tag, 0, 1);
+ $tag2 = substr($tag, 1, 1);
+
+ #
+ # Sequence-based tags - display and indent
+ #
+ if ( $tag1 eq 3 ) {
+ print " "x$indent, "$tag $tmp\n";
+ parse_dump( $indent+3, $tlen, @data );
+ }
+ elsif ( $tag1 eq "A" ) {
+ print " "x$indent, "$tag $tmp\n";
+ parse_dump( $indent+3, $tlen, @data );
+ }
+
+ #
+ # Leaf-data tags - just display
+ #
+ else {
+ $val = "";
+ while ( $tlen > 0 ) {
+ $val .= " ";
+ $val .= shift( @data );
+ $tlen--;
+ }
+ if ( $tag1 eq "0" ) { # leaf data
+ print " "x$indent, "$tag $tmp$val\n";
+ }
+ elsif ( $tag1 eq "8" ) { # exceptions
+ print " "x$indent, "$tag $tmp$val\n";
+ }
+ else { # unknown
+ print " "x$indent, "$tag $tmp$val\n";
+ }
+ }
+ }
+}
+
+$inpacket=0;
+$rawdump="";
+
+while (<>) {
+ if ( $inpacket ) {
+ #
+ # Strip off the extraneous junk, and join
+ # the raw dump output into a single line
+ #
+ if ( /^[0-9]*: / ) {
+ chomp;
+ s/^[0-9]*: //;
+ s/ .*$//;
+ s/ / /g;
+ $rawdump = "$rawdump $_";
+ } else {
+ #
+ # Once this line is complete, display the
+ # dump in a vaguely sensible layout
+ #
+ @rawdata = split( " ", $rawdump );
+ parse_dump( 3, $#rawdata, @rawdata );
+ $inpacket=0;
+ $rawdump="";
+ }
+ } else {
+ #
+ # Pass everything else through untouched
+ #
+ print;
+ if ( /^Sending / || /^Received / ) {
+ $inpacket=1;
+ $rawdump="";
+ }
+ }
+}
diff --git a/local/tkmib b/local/tkmib
new file mode 100755
index 0000000..560c64f
--- /dev/null
+++ b/local/tkmib
@@ -0,0 +1,994 @@
+#!/usr/bin/perl
+#!/usr/bin/perl -w
+
+require 5;
+
+# attempt to determine if they have the proper modules installed.
+
+# SNMP
+my $havesnmp = eval {require SNMP;};
+
+# the Tk packages
+
+my $havetk = eval {require Tk;
+ require Tk::Table;
+ require Tk::HList;
+ require Tk::FileSelect;
+ require Tk::Dialog;};
+if (!$havesnmp) {
+ print "
+ERROR: You don't have the SNMP perl module installed. Please obtain this by
+getting the latest source release of the net-snmp toolkit from
+http://www.net-snmp.org/download/ . The perl module is contained in
+the perl/SNMP directory. See the INSTALL file there for
+instructions.
+";
+}
+
+if (!$havetk) {
+ print "
+ERROR: You don't have the Tk module installed. You should be able to
+install this by running (as root):
+
+ perl -MCPAN -e 'install Tk'
+";
+}
+
+if (!$havetk || !$havesnmp) {
+ print "\n";
+ exit;
+}
+
+if ($havetk) {
+ # Tk doesn't seem to like require so we force use here.
+ eval {import Tk;
+ import Tk::Table;
+ import Tk::HList;
+ import Tk::FileSelect;
+ import Tk::Dialog;
+ import SNMP;};
+}
+
+use Getopt::Std;
+use Data::Dumper;
+
+$host = 'localhost';
+$OID = '.1.3.6.1';
+$opts{'f'} = $ENV{'HOME'} . "/.snmp/tkmibrc";
+
+getopts("hp:v:a:A:x:X:n:u:l:r:t:o:c:Cf:", \%opts);
+
+# default session options
+print "setting opts\n";
+%session_opts = (
+ 'Community' => "public",
+ 'RemotePort' => 161,
+ 'Timeout' => 5000000,
+ 'Retries' => 5,
+ 'Version' => 1,
+ 'AuthProto' => 'MD5',
+ 'PrivProto' => 'DES',
+ 'AuthPass' => '',
+ 'PrivPass' => '',
+ 'Context' => '',
+ 'SecName' => 'initial',
+ 'SecLevel' => 'authNoPriv',
+ );
+
+sub usage {
+ print "
+tkmib [-C] [-o OID] [SNMPCMD arguments] [host]
+ -f CONFIG_FILE load CONFIG_FILE after starting up. (default: ~/.snmp/tkmibrc)
+ (use -f /dev/null to not read one).
+
+ See the snmpcmd manual page for related SNMPCMD arguments. (Not all
+ options are currently supported.)
+";
+ exit();
+}
+
+usage() if ($opts{'h'});
+
+# initialize defaults, may be overridden by config file below
+@displayInfo=qw(type access status units hint moduleID enums indexes);
+@saveoptions = ('displayoidas', 'writecolor', 'graphtime', 'graphdelta');
+$displayoidas='full';
+$writecolor = "blue";
+$graphtime=5;
+$graphdelta=1;
+foreach $i (@displayInfo) {
+ $displayInfoStates{$i} = 1;
+}
+
+
+# source config file
+do $opts{'f'} if ($opts{'f'} && -f $opts{'f'});
+
+$session_opts{'UseLongNames'} => 1;
+$session_opts{'RemotePort'} = $opts{'p'} if ($opts{'p'});
+$session_opts{'Community'} = $opts{'c'} if ($opts{'c'});
+$session_opts{'Version'} = $opts{'v'} if ($opts{'v'});
+$session_opts{'AuthProto'} = $opts{'a'} if ($opts{'a'});
+$session_opts{'AuthPass'} = $opts{'A'} if ($opts{'A'});
+$session_opts{'PrivProto'} = $opts{'x'} if ($opts{'x'});
+$session_opts{'PrivPass'} = $opts{'X'} if ($opts{'X'});
+$session_opts{'Context'} = $opts{'n'} if ($opts{'n'});
+$session_opts{'SecName'} = $opts{'u'} if ($opts{'u'});
+$session_opts{'SecLevel'} = $opts{'l'} if ($opts{'l'});
+$session_opts{'Retries'} = $opts{'r'} if ($opts{'r'});
+$session_opts{'Timeout'} = $opts{'t'} if ($opts{'t'});
+
+$host = shift if ($#ARGV > -1);
+$session_opts{'Community'} = shift if ($#ARGV > -1);
+
+@graphcolors=qw(blue red green yellow purple);
+
+# initialize SNMP module
+$SNMP::save_descriptions=1;
+$SNMP::use_long_names=1;
+$SNMP::use_enums=1;
+$SNMP::verbose = 1;
+my $tmpbd = 1;
+
+$top = MainWindow->new();
+$top->title("tkmib");
+
+#Menus
+$MenuFrame = $top->Frame(-relief => "raised",-borderwidth => 2);
+$MenuFrame->pack(-fill => "x",-expand => 1);
+$FileMenuBut = $MenuFrame->Menubutton(-pady => $tmpbd, -padx => $tmpbd, -text => "File",
+ -menuitems =>
+ [
+# [Button => "Save Output", -command => [\&saveOutput]],
+ [Button => "Quit", -command => [\&exit]]
+ ]);
+$FileMenuBut->pack(-side => 'left');
+
+$MibMenuBut = $MenuFrame->Menubutton(-pady => $tmpbd, -padx => $tmpbd, -text => "Mib",
+ -menuitems =>
+ [[Button => "Find a mib node",
+ -command => sub { my $var;
+ entryBox("Find a Mib Node",
+ "Enter a mib node name to search for:",
+ \$var, \&findANode );}],
+ [Button => "Load a New Mib File", -command => [\&loadNewMibFile]],
+ [Button => "Load a New Mib Module",
+ -command => sub { my $var;
+ entryBox("Load a Module",
+ "Enter a SNMP MIB module name to load:",
+ \$var, \&loadIt);}]
+ ]);
+$MibMenuBut->pack(-side => 'left');
+
+$OptMenuBut = $MenuFrame->Menubutton(-pady => $tmpbd, -padx => $tmpbd, -text => "Options",
+ -menuitems =>
+ [[Cascade => "~Display", -menuitems =>
+ [
+ [Cascade => "~MIB Information"],
+ [Cascade => "~OID Display", -menuitems =>
+ [
+ [Radiobutton => 'full', -variable => \$displayoidas],
+ [Radiobutton => 'numeric', -variable => \$displayoidas],
+ [Radiobutton => 'short', -variable => \$displayoidas],
+ [Radiobutton => 'module', -variable => \$displayoidas]
+ ]
+ ],
+ [Button => "Writable Color",
+ -command => [\&entryBox,"Writable Color",
+ "Color for writable objects:",
+ \$writecolor]]
+ ]],
+ [Cascade => "Use SNMP Version", -menuitems =>
+ [
+ [Radiobutton => '1', -variable => \$session_opts{'Version'}],
+ [Radiobutton => '2c', -variable => \$session_opts{'Version'}],
+ [Radiobutton => '3', -variable => \$session_opts{'Version'}]
+ ]
+ ], # ends version number specification
+ [Cascade => "SNMPv1/2c options", -menuitems =>
+ [
+ [Button => "Community Name",
+ -command => [\&entryBox,"Community Name", "Community name to use:",
+ \$session_opts{'Community'}]]
+ ]
+ ],
+ [Cascade => "SNMP3 options", -menuitems =>
+ [
+ [Button => "Security Name",
+ -command => [\&entryBox,"Security Name", "Security Name to use:",
+ \$session_opts{'SecName'}]],
+ [Cascade => "Security Level", -menuitems =>
+ [
+ [Radiobutton => 'noAuthNoPriv',
+ -variable => \$session_opts{'SecLevel'}],
+ [Radiobutton => 'authNoPriv',
+ -variable => \$session_opts{'SecLevel'}],
+ [Radiobutton => 'authPriv',
+ -variable => \$session_opts{'SecLevel'}]
+ ]
+ ],
+ [Button => "Authentication Passphrase",
+ -command => [\&entryBox,"Authentication Passphrase",
+ "Authentication Passphrase to use:",
+ \$session_opts{'AuthPass'}]],
+ [Cascade => "Authentication Type", -menuitems =>
+ [
+ [Radiobutton => 'MD5',
+ -variable => \$session_opts{'AuthProto'}],
+ [Radiobutton => 'SHA',
+ -variable => \$session_opts{'AuthProto'}],
+ ]
+ ],
+ [Button => "Privacy Passphrase",
+ -command => [\&entryBox,"Privacy Passphrase",
+ "Privacy Passphrase to use:",
+ \$session_opts{'PrivPass'}]],
+ [Cascade => "Privacy Type", -menuitems =>
+ [
+ [Radiobutton => 'DES',
+ -variable => \$session_opts{'PrivProto'}],
+ ]
+ ],
+ ]
+ ],
+ [Button => "Time between graph polls",
+ -command => sub { entryBox("graph polls", "Time between graph polls:",
+ \$graphtime);}],
+ [Button => "Port number",
+ -command => sub { entryBox("Port Number", "SNMP Port number to use:",
+ \$session_opts{'RemotePort'});}],
+ [Button => "TimeOut",
+ -command => sub { entryBox("Time Out", "Timeout for SNMP requests:",
+ \$session_opts{'Timeout'});}],
+ [Button => "Retries",
+ -command => sub { entryBox("Retries",
+ "Number of Times to Retransmit Requests:",
+ \$session_opts{'Retries'});}],
+ [Button => "Save Options",
+ -command => \&save_options]
+ ])->pack(-side => 'left');
+
+$tmp = $OptMenuBut->cget(-menu);
+$OptMenuWidgets = $tmp->entrycget("Display", -menu);
+$OptMenuWidgets = $OptMenuWidgets->entrycget("MIB Information", -menu);
+
+$hlist=$top->Scrolled(qw(HList -itemtype imagetext -browsecmd main::showInfo
+ -command main::showChildren -width 80 -height 15));
+$hlist->pack(-side => 'top', -expand => 1, -fill => 'both');
+my $sFrame = $top->Frame(-relief => 'raised', -borderwidth => $tmpbd);
+$sFrame->pack(-side => 'top', -fill => 'x');
+$sFrame->Label(-pady => $tmpbd, -padx => $tmpbd, -text => 'OID: ', -relief => 'raised', -borderwidth => $tmpbd)
+ ->pack(-side => 'left');
+$mibOID = $sFrame->Entry(-textvariable => \$OID, -relief => 'flat', -width => 40);
+$mibOID->pack(-side => 'left');
+$mibTextOID = $sFrame->Label(-pady => $tmpbd, -padx => $tmpbd, -text => '');
+$mibTextOID->pack(-side => 'right');
+
+$dispFrame=$top->Frame(-relief => 'raised', -borderwidth => $tmpbd);
+$dispFrame->pack(-side => 'top', -fill =>'x');
+for($i=0;$i<= $#displayInfo;$i++) {
+ createRow($i) if ($displayInfoStates{$displayInfo[$i]});
+ optionalWidget($i,$OptMenuWidgets, \$displayInfoStates{$displayInfo[$i]});
+}
+
+$descrFrame=$top->Frame(-relief => 'raised', -borderwidth => $tmpbd);
+$descrFrame->pack(-side => 'top', -fill =>'x');
+$descrFrame->Label(-pady => $tmpbd, -padx => $tmpbd, -text => 'Description:', -anchor => 'w')->pack(-side => 'top',
+ -fill => 'x');
+$descr = $descrFrame->Scrolled(qw(Text -width 80 -height 4));
+$descr->pack(-side => 'top', -fill => 'x');
+
+$bFrame = $top->Frame(-relief => 'raised', -borderwidth => $tmpbd);
+$bFrame->pack(-side => 'top', -fill => 'x');
+$hostEntry = $bFrame->Entry(-textvariable => \$host, -width => 12);
+$hostEntry->pack(-side => 'left');
+$bFrame->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'graph', -command => \&snmpgraph)->pack(-side => 'right');
+$tablebutton = $bFrame->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'table', -command => \&snmptable);
+$tablebutton->pack(-side => 'right');
+$bFrame->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'walk', -command => \&snmpwalk)->pack(-side => 'right');
+$bFrame->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'getnext', -command => \&snmpgetnext)->pack(-side => 'right');
+$bFrame->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'get', -command => \&snmpget)->pack(-side => 'right');
+$bFrame->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'set', -command => [\&snmpsetbegin, 'OID'])->pack(-side => 'right');
+$stopBut = $bFrame->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'stop', -command => sub { stop(1) },
+ -state => 'disabled');
+$stopBut->pack(-side => 'right');
+$oFrame = $top->Frame(-borderwidth => $tmpbd, -relief => 'raised');
+$oFrame->pack(-side => 'top', -fill => 'both');
+$output = $oFrame->Scrolled(qw(Text -width 80 -height 14));
+$output->pack(-side => 'top', -fill => 'both', -expand => 1);
+
+$tmpFrame = $top->Frame(-relief => 'raised', -borderwidth => $tmpbd);
+$tmpFrame->pack(-side => 'top', -fill => 'x');
+$tmpFrame->Label(-pady => $tmpbd, -padx => $tmpbd, -text => "Status: ", -anchor => 'w')
+# -relief => 'raised', -borderwidth => $tmpbd)
+ ->pack(-side => 'left');
+$status = $tmpFrame->Label(-pady => $tmpbd, -padx => $tmpbd, -anchor => 'w');
+$status->pack(-side => 'left', -fill => 'x');
+
+# initialize the browser
+foreach $i (qw(.1 .1.3 .1.3.6 .1.3.6.1)) {
+ addMibOID($i);
+}
+showChildren("$OID");
+if (defined($opts{'o'})) {
+ findANode($opts{'o'});
+}
+
+MainLoop();
+
+sub insertresult {
+ my $oid = shift;
+ my $val = shift;
+ $oid = $OID if ($oid eq "OID");
+ $output->insert('end', $oid, "oid:$oid");
+ $output->tagBind("oid:$oid", '<1>', [sub{shift;
+ my $oid = shift;
+ findANode($oid);
+ my $tag = SNMP::translateObj($oid);
+ showInfo($tag);},$oid]);
+ $output->insert('end', " = ");
+ my $mib = $SNMP::MIB{format_oid("$oid",'numeric')};
+ $output->insert('end', $val, "value:$oid");
+ if ($mib->{'access'} =~ /(Write|Create)/) {
+ $output->tagConfigure("value:$oid", -foreground => $writecolor);
+ $output->tagBind("value:$oid", '<1>', [sub{shift;
+ my $oid = shift;
+ my $value = shift;
+ snmpsetmaybebegin($oid, $value);
+ findANode($oid);
+ my $tag = SNMP::translateObj($oid);
+ showInfo($tag);},format_oid($oid,'full'), $val]);
+ }
+ $output->insert('end', "\n");
+}
+
+sub insertvar {
+ my $var = shift;
+ my $name = get_oid($var);
+
+ insertresult($name,SNMP::Varbind::val($var));
+}
+
+sub snmpsetup {
+ my $oid = $OID;
+ my $tag = SNMP::translateObj($oid);
+ my $sess = new SNMP::Session(DestHost => $host, %session_opts);
+ my $var = new SNMP::Varbind([$oid]);
+ if (!defined($var)) {
+ print "ack: $@ $SNMP::ErrorStr $!\n";
+ }
+ stop(0);
+ initText();
+ $oid = "." . $oid if ($oid !~ /^\./);
+ return ($oid, $sess, $var);
+}
+
+sub initText {
+ if (ref($output) eq "Tk::Frame" && defined($$output{'_#text'})) {
+ $output->delete('0.0','end');
+ } else {
+ $output->destroy();
+ $output = $oFrame->Scrolled(qw(Text -width 80 -height 14));
+ $output->pack(-side => 'top', -fill => 'both', -expand => 1);
+ }
+}
+
+sub initTable {
+ $output->destroy();
+ $oFrame->packPropagate(0);
+ $output = $oFrame->Table(-columns => shift, -width => 80, -height => 14,
+ -fixedrows => 2, -fixedcolumns => 1);
+ $output->pack(-side => 'top', -fill => 'both', -expand => 1);
+}
+
+sub initCanvas {
+ $output->destroy();
+ $oFrame->packPropagate(0);
+ $output = $oFrame->Scrolled(qw(Canvas -width 80c -height 14c));
+ $output->pack(-side => 'top', -fill => 'both', -expand => 1);
+}
+
+sub snmpget {
+ (my $oid, my $sess, my $var) = snmpsetup();
+ $status->configure(-text => "getting: $host $community $oid");
+ $top->update();
+ my $val = $sess->get($var);
+ if ($sess->{ErrorStr}) {
+ $status->configure(-text => $sess->{ErrorStr});
+ } else {
+ insertvar($var);
+ $status->configure(-text => "");
+ }
+}
+
+sub snmpsetbegin {
+ my $startoid = shift;
+ my $startval = shift;
+ my $setwin = MainWindow->new();
+ $setwin->title("SNMP set");
+ my $varswin = $setwin->Frame(-relief => "raised",-borderwidth => $tmpbd);
+ my $vars = new SNMP::VarList;
+ $varswin->pack(-side => 'top');
+ my $buttons = $setwin->Frame(-relief => "raised")->pack(-side => 'top', -fill => "x",-expand => 1);
+ $buttons->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'Add a varbind', -command => [\&snmpsetbegin_addvar, $vars, $varswin, 'OID'])->pack(-side => 'left', -fill => "x",-expand => 1);
+ $buttons->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'perform set', -command => [\&snmpsetbegin_ok, $vars, $setwin, $varswin])->pack(-side => 'left');
+ $buttons->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'Cancel', -command => [sub { my $widget = shift; $varswin = shift; if ($setmain == $varswin) { $setmain = undef; } $widget->destroy();}, $setwin, $varswin])->pack(-side => 'right');
+ if ($startoid ne "") {
+ snmpsetbegin_addvar($vars, $varswin, $startoid, $startval);
+ }
+ if (!$setmain) {
+ $setmain = $varswin;
+ $setvars = $vars;
+ }
+}
+
+sub make_enum_button {
+ my $win = shift;
+ my $var = shift;
+ my @objs;
+ foreach my $i (@_) {
+ push @objs,[Radiobutton => $i, -variable => $var];
+ }
+ return $win->Menubutton(-pady => $tmpbd, -padx => $tmpbd, -textvariable => $var,
+ -relief => raised,
+ -menuitems => \@objs);
+}
+
+sub snmpsetmaybebegin {
+ my ($oid, $val) = @_;
+ if ($setmain) {
+ snmpsetbegin_addvar($setvars, $setmain, $oid, $val);
+ } else {
+ snmpsetbegin($oid, $val);
+ }
+}
+
+
+sub snmpsetbegin_addvar {
+ my ($vars, $place, $oid, $val) = @_;
+ $oid = $OID if ($oid eq "OID");
+ my $mib = $SNMP::MIB{format_oid("$oid",'numeric')};
+ my $var = new SNMP::Varbind([$oid, '', $val, $mib->{'type'} || 'INTEGER']);
+ push @$vars,$var;
+ my $frame = $place->Frame();
+ $frame->Entry(-textvariable => \$var->[0], -width => 20)->pack(-side => 'left');
+ make_enum_button($frame, \$var->[3], qw(OBJECTID OCTETSTR INTEGER NETADDR IPADDR COUNTER COUNTER64 GAUGE UINTEGER TICKS OPAQUE NULL))->pack(-side => 'left');
+ if (ref($mib->{'enums'}) eq HASH && scalar(keys(%{$mib->{'enums'}})) > 0) {
+ make_enum_button($frame, \$var->[2], keys(%{$mib->{'enums'}}))->pack(-side => 'left');
+ } else {
+ $frame->Entry(-textvariable => \$var->[2])->pack(-side => 'left');
+ }
+ $frame->pack(-expand => 1, -fill => 'x');
+}
+
+sub snmpsetbegin_ok {
+ my ($vars, $win, $frame) = @_;
+ snmpset($vars);
+ $setmain = undef if ($setmain == $frame);
+ $win->destroy();
+}
+
+sub snmpset {
+ my $vars = shift;
+ (my $oid, my $sess, my $var) = snmpsetup();
+ $status->configure(-text => "setting: $host -> " . Dumper($vars) . "\n");
+ $top->update();
+ my $val = $sess->set($vars);
+ if ($sess->{ErrorStr}) {
+ $output->insert('end', "Set failed.\nReason: $sess->{ErrorStr}");
+ $status->configure(-text => $sess->{ErrorStr});
+ } else {
+ foreach my $i (@$vars) {
+ insertvar($i);
+ }
+ $status->configure(-text => "");
+ }
+}
+
+sub snmpgetnext {
+ (my $oid, my $sess, my $var) = snmpsetup();
+ $status->configure(-text => "get next: $host $community $oid");
+ $top->update();
+ my $val = $sess->getnext($var);
+ if ($sess->{ErrorStr}) {
+ $status->configure(-text => $sess->{ErrorStr});
+ } else {
+ insertvar($var);
+ $status->configure(-text => "");
+ }
+}
+
+sub snmpwalk {
+ (my $oid, my $sess, my $var) = snmpsetup();
+ $status->configure(-text => "walking: $host $community $oid");
+ $top->update();
+ while (!$sess->{ErrorStr} && !$stopit) {
+ my $val = $sess->getnext($var);
+ last if (!defined($var->tag) ||
+ $sess->{ErrorStr} ||
+ $val eq "ENDOFMIBVIEW" ||
+ !is_in_subtree($oid, $var->tag . "." . $var->iid));
+ insertvar($var);
+ $top->update();
+ }
+ if ($sess->{ErrorStr}) {
+ $status->configure(-text => $sess->{ErrorStr});
+ $output->insert('end',"$sess->{ErrorStr} ($sess->{ErrorNum})\n");
+ } else {
+ $status->configure(-text => "");
+ }
+ stop(1);
+}
+
+sub snmptable {
+ (my $oid, my $sess, my $var) = snmpsetup();
+ $status->configure(-text => "collecting data: $host $community $oid");
+ $top->update();
+ my (%tb, @tags, @index, %tboids);
+ while (!$sess->{ErrorStr} && !$stopit) {
+ my $val = $sess->getnext($var);
+ last if (!defined($var->tag) ||
+ $sess->{ErrorStr} ||
+ $val eq "ENDOFMIBVIEW" ||
+ !is_in_subtree($oid, $var->tag . "." . $var->iid));
+ $newoid = SNMP::Varbind::tag($var).".".SNMP::Varbind::iid($var);
+ insertvar($var);
+ $top->update();
+ $newoid =~ /([^\.]+)\.([0-9\.]+)$/;
+ if (!grep(/$1/,@tags)) {
+ push @tags,$1;
+ }
+ if (!grep(/$2/,@index)) {
+ push @index,$2;
+ }
+ $tb{$2}{$1} = $var->val;
+# $tboids{$2}{$1} = $var->tag;
+ $tboids{$2}{$1} = $newoid;
+ }
+ initTable($#tags+1);
+ for(my $k=0;$k <= $#tags;$k++) {
+ $output->put(1,$k+2,$tags[$k]);
+ }
+ $output->put(1,1,"Index");
+ for(my $i=0;$i <= $#index;$i++) {
+ $output->put($i+2,1,$index[$i]);
+ }
+ for(my $i=0;$i <= $#index; $i++) {
+ for(my $k=0;$k <= $#tags;$k++) {
+ my $mib = $SNMP::MIB{format_oid("$tboids{$index[$i]}{$tags[$k]}",'numeric')};
+ if ($mib->{'access'} =~ /(Write|Create)/) {
+ $output->put($i+2,$k+2,$output->Button(-fg => $writecolor, -pady => $tmpbd, -padx => $tmpbd, -text => $tb{$index[$i]}{$tags[$k]}, -command => [\&snmpsetmaybebegin, $tboids{$index[$i]}{$tags[$k]}, $tb{$index[$i]}{$tags[$k]}], -padx => 0, -pady => 0));
+ } else {
+ $output->put($i+2,$k+2,$tb{$index[$i]}{$tags[$k]});
+ }
+ }
+ }
+ $status->configure(-text => "");
+ stop(1);
+}
+
+sub snmpgraph {
+ ($graphoid, $graphsess, my $graphvar) = snmpsetup();
+ $top->update();
+ %graphtb = ();
+ @graphvars = ();
+ initCanvas();
+ $gcount=0;
+ $max=-1;
+ $min=2**32-1;
+ updateGraph();
+ $output->repeat($graphtime*1000, \&updateGraph);
+}
+
+sub updateGraph() {
+ $status->configure(-text => "collecting data: $host $community $graphoid");
+ my $oid = $graphoid;
+ my $tag = SNMP::translateObj($graphoid,0);
+ my $var = new SNMP::Varbind([$oid]);
+ $graphsess->{ErrorStr} = "";
+ while (!$graphsess->{ErrorStr} && !$stopit) {
+ my $val = $graphsess->getnext($var);
+ if ($#graphvars == -1 && SNMP::translateObj($var->tag) !~ /^$oid/) {
+ # if an exact oid, do a get instead.
+ $var = new SNMP::Varbind([$oid]);
+ $val = $graphsess->get($var);
+ }
+ if ($graphsess->{ErrorStr} ||
+ !defined($var->tag) ||
+ SNMP::translateObj($var->tag) !~ /^$oid/) {
+ last;
+ }
+ my $newoid = SNMP::translateObj(SNMP::Varbind::tag($var).".".SNMP::Varbind::iid($var));
+ $top->update();
+ $newoid =~ /$oid\.([0-9\.]+)$/;
+ if (defined($1)) {
+ if (!grep(/$1/,@graphvars)) {
+ push @graphvars,$1;
+ }
+ if ($graphdelta) {
+ if ($gcount > 0) {
+ $graphtb{$1}[$gcount-1] = $var->val - $prev{$1};
+ }
+ $prev{$1} = $var->val;
+ } else {
+ $graphtb{$1}[$gcount] = $var->val;
+ }
+ $max = $graphtb{$1}[$#{$graphtb{$1}}]
+ if ($#{$graphtb{$1}} >= 0 &&
+ $graphtb{$1}[$#{$graphtb{$1}}] > $max);
+ $min = $graphtb{$1}[$#{$graphtb{$1}}]
+ if ($#{$graphtb{$1}} >= 0 &&
+ $graphtb{$1}[$#{$graphtb{$1}}] < $min);
+ }
+ }
+ if ($gcount > 1) {
+ $output->delete('all');
+ my $canvas = $$output{'SubWidget'}{'canvas'};
+ my $h=$canvas->cget(-height);
+ foreach $i (@graphvars) {
+ my @a = ();
+ for(my $j=0; $j <= $#{$graphtb{$i}}; $j++) {
+ $a[$j*2] = $j;
+ $a[$j*2+1] = $h-(($h-3)*($graphtb{$i}[$j]-$min))/($max-$min)-3;
+ }
+ $output->createLine(@a, -fill => $graphcolors[$i%$#graphcolors]);
+ }
+ $output->create('text',5, $h-3, -text => "$max");
+ $output->create('text',5, 3, -text => "$min");
+ }
+ $gcount++;
+ $status->configure(-text => "sleeping for $graphtime seconds");
+}
+
+sub addMibOID {
+ my $i = shift;
+ $i = ".$i" if ($i !~ /^\./);
+ my $name = SNMP::translateObj($i,1);
+ if (defined($name)) {
+ $name =~ s/.*\.([^.]+)$/$1/;
+ } else {
+ return;
+ }
+ $i =~ s/^\.//;
+ $hlist->add($i, -text => $name);
+}
+
+sub showInfo {
+ my $full = shift;
+ $full = ".$full" if ($full !~ /^\./);
+ my $oid = $full;
+ my $tag = $oid;
+
+ if ($tag =~ /^[.0-9]+$/) {
+ # strip off index in case there is one
+ $tag = SNMP::translateObj("$oid");
+ $tag = ".iso.org.dod.internet.private.$tag" if $tag =~ /^enterprises/;
+ } else {
+ $full = SNMP::translateObj("$oid");
+ }
+
+ $tag =~ s/\.[.0-9]+$//;
+ $oid = SNMP::translateObj($tag);
+
+ if (!defined($last) || "$last" ne $oid) {
+ updateInfo($oid);
+ }
+ $OID = $full;
+ $mibOID->configure(-textvariable => \$OID);
+ $mibOID->update();
+ $last = $oid;
+}
+
+sub showAllChildren {
+ my $id = shift;
+ $id =~ s/^\.//;
+ my @pieces = split(/\./,$id);
+ my ($i, $lastvalid);
+ for($i = 0; $i <= $#pieces; $i++) {
+ my $a = join(".", @pieces[0..$i]);
+ if ($hlist->infoExists($a) && !($hlist->infoChildren($a))) {
+ showChildren(join(".", $a));
+ }
+ if ($hlist->infoExists($a)) {
+ $lastvalid = $a;
+ } else {
+ last;
+ }
+ }
+ $hlist->see($lastvalid);
+ $hlist->selectionClear($hlist->selectionGet);
+ $hlist->selectionSet($lastvalid);
+}
+
+sub showChildren {
+ $OID = shift;
+ $OID =~ s/^\.//;
+ my $oid = $OID;
+ $mibOID->configure(-textvariable => \$OID);
+ if ($hlist->infoChildren($oid)) {
+ my @a = $hlist->infoChildren($oid);
+ my $i;
+ foreach $i (@a) {
+ $hlist->deleteEntry($i);
+ }
+ } else {
+ $oid = ".$oid";
+ my $mib = $SNMP::MIB{format_oid($oid,'full')};
+ if (defined($mib)) {
+ my $children = $$mib{'children'};
+ if (ref($children) eq "ARRAY") {
+ foreach $i (sort {$$a{'subID'} <=> $$b{'subID'}} @{$children}) {
+ addMibOID($$i{'objectID'});
+ }
+ } else {
+ $status->configure(-text => SNMP::translateObj($oid,1) .
+ " has no children");
+ return;
+ }
+ }
+ }
+ $status->configure(-text => "");
+}
+
+sub updateInfo {
+ $OID = shift;
+ my $oid = $OID;
+ my $mib = $SNMP::MIB{format_oid("$oid",'numeric')};
+ if (!defined($mib->{'description'}) || $mib->{'description'} eq "") {
+ $oid =~ s/[.0-9]+$//;
+ $mib = $SNMP::MIB{format_oid("$oid",'numeric')};
+ }
+ if (defined($mib)) {
+ if ($mib->{'label'} =~ /Table$/) {
+ $tablebutton->configure(-state => 'normal');
+ } else {
+ $tablebutton->configure(-state => 'disabled');
+ }
+ $mibOID->configure(-text => $mib->{'objectID'});
+ $mibTextOID->configure(-text =>
+ SNMP::translateObj($mib->{'objectID'},1));
+ $descr->delete('0.0','end');
+ if (defined($mib->{'description'}) &&
+ $mib->{'description'} ne "") {
+ my $desc = $mib->{'description'};
+ $desc =~ s/\n[ \t]+/\n/g;
+ $desc =~ s/^\n//;
+ $descr->insert('end',$desc);
+ }
+ for($i=0; $i<= $#displayInfo;$i++) {
+ $dpyInfo[$i] = $mib->{$displayInfo[$i]};
+ if (ref($dpyInfo[$i]) eq HASH) {
+ my %hash = %{$dpyInfo[$i]};
+ $dpyInfo[$i] = "";
+ foreach $j (sort { $hash{$a} <=> $hash{$b} } keys(%hash)) {
+ $dpyInfo[$i] .= "$j = $hash{$j},";
+ }
+ } elsif (ref($dpyInfo[$i]) eq ARRAY) {
+ $dpyInfo[$i] = join(", ", @{$dpyInfo[$i]});
+ }
+ }
+ }
+}
+
+sub optionalWidget {
+ my $num = shift;
+ my $menu = shift;
+ my $var = shift;
+ $menu->checkbutton(-label => $displayInfo[$num],
+ -variable => $var,
+ -command => [\&toggleWidgetShown, $num, $var]);
+}
+
+sub createRow {
+ my $i = shift;
+ if (!$displayLabels[$i]) {
+ $displayLabels[$i] = $dispFrame->Label(-pady => $tmpbd, -padx => $tmpbd,
+ -text => $displayInfo[$i],
+ -anchor => 'w',
+ -borderwidth => $tmpbd);
+ }
+ if (!$displayEntries[$i]) {
+ $displayEntries[$i] = $dispFrame->Entry(-textvariable => \$dpyInfo[$i],
+ -width => 40, -relief => 'flat',
+ -borderwidth => $tmpbd);
+ }
+ $displayLabels[$i]->grid(-ipady => $tmpbd, -ipadx => $tmpbd,
+ -column => ($i%2)*2, -row => int($i/2),
+ -sticky => 'w');
+ $dpyInfo[$i] = "" if (!defined($dpyInfo[$i]));
+ $displayEntries[$i]->grid(-ipady => $tmpbd, -ipadx => $tmpbd, -column => ($i%2)*2 + 1, -row => int($i/2), -sticky => 'w');
+}
+
+sub toggleWidgetShown {
+ my ($num, $var) = @_;
+ if ($$var) {
+ createRow($num);
+ } else {
+ $displayLabels[$num]->gridForget();
+ $displayEntries[$num]->gridForget()
+ }
+# my @widgets = $dispFrame->gridSlaves(-row => $num);
+}
+
+sub loadNewMibFile {
+ my $sel = $top->FileSelect();
+ my $file = $sel->Show();
+ if (defined($file)) {
+ SNMP::addMibFiles($file);
+ showChildren("1.3.6.1");
+ showChildren("1.3.6.1");
+ }
+}
+
+sub loadNewMibModule {
+ my $tmptop = MainWindow->new();
+ my $var = "";
+ $tmptop->Label(-pady => $tmpbd, -padx => $tmpbd, -text => "Enter a SNMP MIB module name")
+ ->pack(-side => 'top');
+ my $e = $tmptop->Entry(-textvariable => \$var);
+ $e->pack(-side => 'top');
+ $e->bind('<Return>',[\&loadIt,\$var,$tmptop]);
+ my $f = $tmptop->Frame();
+ $f->pack(-side => 'top');
+ $f->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'Ok', -command => [\&loadIt,"",\$var,$tmptop])
+ ->pack(-side => 'left');
+ $f->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'Cancel', -command => [sub { my $wid = shift;
+ $wid->destroy(); },
+ $tmptop])
+ ->pack(-side => 'left');
+}
+
+sub loadIt {
+ my $var = shift;
+ if ($var ne "") {
+ my $ret = SNMP::loadModules($var);
+ if ($ret) {
+ showChildren("1.3.6.1");
+ showChildren("1.3.6.1");
+ return 1;
+ } else {
+ $status->configure(-text => "Failed reading module $var");
+ return 0;
+ }
+ }
+ return 0;
+}
+
+sub stop {
+ $stopit = shift;
+ if ($stopit) {
+ $stopBut->configure(-state => 'disabled');
+ } else {
+ $stopBut->configure(-state => 'normal');
+ }
+}
+
+sub entryBox {
+ my $title = shift;
+ my $text = shift;
+ my $var = shift;
+ my $callback = shift;
+ my $top = MainWindow->new();
+ my $newvar = $$var if defined($var);
+ $top->title($title);
+ my $f = $top->Frame();
+ $f->pack(-side => 'top');
+ $f->Label(-pady => $tmpbd, -padx => $tmpbd,
+ -text => $text)->pack(-side => 'left');
+ my $e = $f->Entry(-textvariable => \$newvar);
+ $e->pack(-side => 'left');
+ $f = $top->Frame();
+ $f->pack(-side => 'bottom');
+ my $b = $f->Button(-pady => $tmpbd, -padx => $tmpbd, -text => 'Ok',
+ -command => [sub { my $w = shift;
+ my $v1 = shift;
+ my $v2 = shift;
+ my $call = shift;
+ my $ret = 1;
+ $$v1 = $$v2 if defined($v1);
+ $ret = $call->($$v2)
+ if defined($call);
+ $w->destroy() if ($ret);}, $top, $var,
+ \$newvar, $callback]);
+ $b->pack(-side => 'left');
+ $e->bind('<Return>',[$b,'invoke']);
+ $b = $f->Button(-pady => $tmpbd, -padx => $tmpbd,
+ -text => 'Cancel', -command => [sub { my $w = shift;
+ $w->destroy();}, $top
+ ]);
+ $b->pack(-side => 'right');
+ $e->bind('<Escape>',[$b,'invoke']);
+
+}
+
+sub findANode {
+ my $val = shift;
+ my $tag = SNMP::translateObj($val);
+ if ($tag) {
+ showAllChildren($tag);
+ return 1;
+ } else {
+ $top->Dialog(-text => "$val not found")->Show();
+ return 0;
+ }
+}
+
+sub test_version {
+ my ($gt, $major, $minor, $sub) = @_;
+ $SNMP::VERSION =~ /(\d)\.(\d).(\d)/;
+ if ($gt) {
+ if ($1 > $major || ($1 == $major && $2 > $minor) ||
+ ($1 == $major && $2 == $minor && $3 >= $sub)) {
+ return 1;
+ }
+ } else {
+ if ($1 < $major || ($1 == $major && $2 < $minor) || ($1 == $major && $2 == $minor && $3 < $sub)) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+sub save_options {
+ my $umask = umask();
+ umask 0077; # make sure its not readable by the world by default.
+ if (!open(O,">$opts{'f'}")) {
+ warn "can't save to $opts{'f'}\n";
+ umask $umask;
+ return;
+ }
+ umask $umask;
+ print O Data::Dumper->Dump([\%session_opts], [qw(*session_opts)]);
+ print O Data::Dumper->Dump([\%displayInfoStates], [qw(*displayInfoStates)]);
+ foreach my $var (@saveoptions) {
+ print O Data::Dumper->Dump([$$var], [$var]);
+ }
+ close(O);
+ $status->configure(-text => "saved options to $opts{'f'}");
+}
+
+# returns 1 if $oid2 is below $oid1 in the hierarchy
+sub is_in_subtree {
+ my ($oid1, $oid2) = @_;
+ # get pure numeric
+ $oid1 = SNMP::translateObj($oid1) if ($oid1 !~ /^[\d\.]*$/);
+ $oid2 = SNMP::translateObj($oid2) if ($oid2 !~ /^[\d\.]*$/);
+
+ # has more on it or is exactly the same
+ return 1 if ($oid2 =~ /^$oid1\./ || $oid2 =~ /^$oid1$/);
+ return 0;
+}
+
+sub format_oid {
+ my ($oid, $type) = @_;
+ $oid =~ s/\.$//;
+ $type = $displayoidas if ($type eq "");
+
+ if ($type eq 'numeric') {
+ return SNMP::translateObj($oid) if ($oid !~ /^[\d\.]*$/);
+ return $oid;
+ } elsif ($type eq 'full') {
+ return SNMP::translateObj($oid, 1) if ($oid =~ /^[\d\.]*$/);
+ return SNMP::translateObj(SNMP::translateObj($oid), 1) if ($oid !~ /^\./);
+ return $oid;
+ } elsif ($type eq 'short' || $type eq 'module') {
+ $oid = SNMP::translateObj($oid) if ($oid =~ /^[\d\.]*$/);
+ $oid =~ s/.*\.([a-zA-Z]\w+)\.(.*)/$1.$2/;
+ if ($type eq 'module') {
+ $oid = $SNMP::MIB{format_oid($oid,'numeric')}->{'moduleID'} . "::" . $oid;
+ }
+ return $oid;
+ } elsif ($type eq 'module') {
+ $oid = SNMP::translateObj($oid) if ($oid =~ /^[\d\.]*$/);
+ $oid =~ s/.*\.([a-zA-Z]\w+)\.(.*)/$1.$2/;
+ return $oid;
+ } else {
+ warn 'unknown oid translation type: $type';
+ return $oid;
+ }
+}
+
+sub get_oid {
+ my ($var, $type) = @_;
+ return format_oid($var->tag . "." . $var->iid, $type);
+}
diff --git a/local/traptoemail b/local/traptoemail
new file mode 100755
index 0000000..e738ba7
--- /dev/null
+++ b/local/traptoemail
@@ -0,0 +1,74 @@
+#!/usr/bin/perl
+
+# This is a snmptrapd handler script to convert snmp traps into email
+# messages.
+
+# Usage:
+# Put a line like the following in your snmptrapd.conf file:
+# traphandle TRAPOID|default /usr/local/bin/traptoemail [-f FROM] [-s SMTPSERVER]b ADDRESSES
+# FROM defaults to "root"
+# SMTPSERVER defaults to "localhost"
+
+use Net::SMTP;
+use Getopt::Std;
+use POSIX qw(strftime);
+
+$opts{'s'} = "localhost";
+$opts{'f'} = 'root@' . `hostname`;
+chomp($opts{'f'});
+getopts("hs:f:", \%opts);
+
+if ($opts{'h'}) {
+ print "
+traptoemail [-s smtpserver] [-f fromaddress] toaddress [...]
+
+ traptoemail shouldn't be called interatively by a user. It is
+ designed to be called as an snmptrapd extension via a \"traphandle\"
+ directive in the snmptrapd.conf file. See the snmptrapd.conf file for
+ details.
+
+ Options:
+ -s smtpserver Sets the smtpserver for where to send the mail through.
+ -f fromaddress Sets the email address to be used on the From: line.
+ toaddress Where you want the email sent to.
+
+";
+ exit;
+}
+
+die "no recepients to send mail to" if ($#ARGV < 0);
+
+# process the trap:
+$hostname = <STDIN>;
+chomp($hostname);
+$ipaddress = <STDIN>;
+chomp($ipaddress);
+
+$maxlen = 0;
+while(<STDIN>) {
+ ($oid, $value) = /([^\s]+)\s+(.*)/;
+ push @oids, $oid;
+ push @values, $value;
+ $maxlen = (length($oid) > $maxlen) ? length($oid) : $maxlen;
+}
+$maxlen = 60 if ($maxlen > 60);
+$formatstr = "%" . $maxlen . "s %s\n";
+
+die "illegal trap" if ($#oids < 1);
+
+# send the message
+$message = Net::SMTP->new($opts{'s'}) || die "can't talk to server $opts{'s'}\n";
+$message->mail($opts{'f'});
+$message->to(@ARGV) || die "failed to send to the recepients ",join(",",@ARGV),": $!";
+$message->data();
+$message->datasend("To: " . join(", ",@ARGV) . "\n");
+$message->datasend("From: $opts{f}\n");
+$message->datasend("Date: ".strftime("%a, %e %b %Y %X %z", localtime())."\n");
+$message->datasend("Subject: trap received from $hostname: $values[1]\n");
+$message->datasend("\n");
+$message->datasend("Host: $hostname ($ipaddress)\n");
+for($i = 0; $i <= $#oids; $i++) {
+ $message->datasend(sprintf($formatstr, $oids[$i], $values[$i]));
+}
+$message->dataend();
+$message->quit;
diff --git a/ltmain.sh b/ltmain.sh
new file mode 100755
index 0000000..ed1814f
--- /dev/null
+++ b/ltmain.sh
@@ -0,0 +1,9637 @@
+
+# libtool (GNU libtool) 2.4
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4
+TIMESTAMP=""
+package_revision=1.3293
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${EGREP="grep -E"}
+: ${FGREP="grep -F"}
+: ${GREP="grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=:
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "$1" | $SED \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ echo
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ p
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $opt_debug
+
+ func_error "missing argument for $1."
+ exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
+ opt="$1"
+ shift
+ case $opt in
+ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+ $opt_debug
+ ;;
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+ shift
+ ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=:
+ ;;
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
+ opt_silent=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
+ # Separate optargs to long options:
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
+
+
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
+
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # -fstack-protector* stack protector flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_preserve_dup_deps ; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ echo
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ echo
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$opt_mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ ;;
+ esac
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ odir="$objdir"
+ else
+ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$opt_mode" = uninstall && odir="$dir"
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case "$opt_mode" in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/m4/ac_add_search_path.m4 b/m4/ac_add_search_path.m4
new file mode 100644
index 0000000..b1ffc5d
--- /dev/null
+++ b/m4/ac_add_search_path.m4
@@ -0,0 +1,13 @@
+dnl
+dnl Add a search path to the LIBS and CFLAGS variables
+dnl
+AC_DEFUN([AC_ADD_SEARCH_PATH],[
+ if test "x$1" != x -a -d $1; then
+ if test -d $1/lib; then
+ LDFLAGS="-L$1/lib $LDFLAGS"
+ fi
+ if test -d $1/include; then
+ CPPFLAGS="-I$1/include $CPPFLAGS"
+ fi
+ fi
+])
diff --git a/m4/ac_msg_cache.m4 b/m4/ac_msg_cache.m4
new file mode 100644
index 0000000..f7d7cda
--- /dev/null
+++ b/m4/ac_msg_cache.m4
@@ -0,0 +1,24 @@
+dnl
+dnl Store information for displaying later.
+dnl
+AC_DEFUN([AC_MSG_CACHE_INIT],[
+ rm -f configure-summary
+])
+
+AC_DEFUN([AC_MSG_CACHE_ADD],[
+ cat >> configure-summary << EOF
+ $1
+EOF
+])
+
+AC_DEFUN([AC_MSG_CACHE_DISPLAY],[
+ echo ""
+ echo "---------------------------------------------------------"
+ echo " Net-SNMP configuration summary:"
+ echo "---------------------------------------------------------"
+ echo ""
+ cat configure-summary
+ echo ""
+ echo "---------------------------------------------------------"
+ echo ""
+])
diff --git a/m4/ac_msg_module_dbg.m4 b/m4/ac_msg_module_dbg.m4
new file mode 100644
index 0000000..d2cb317
--- /dev/null
+++ b/m4/ac_msg_module_dbg.m4
@@ -0,0 +1,7 @@
+AC_DEFUN([AC_MSG_MODULE_DBG],
+[
+ if test $module_debug = 1; then
+ echo $1 $2 $3 $4
+ fi
+]
+)
diff --git a/m4/ac_prompt_user.m4 b/m4/ac_prompt_user.m4
new file mode 100644
index 0000000..6b2dd9a
--- /dev/null
+++ b/m4/ac_prompt_user.m4
@@ -0,0 +1,52 @@
+dnl @synopsis AC_PROMPT_USER_NO_DEFINE(VARIABLENAME,QUESTION,[DEFAULT])
+dnl
+dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
+dnl DEFAULT value if the user merely hits return.
+dnl
+dnl @version 1.15
+dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
+dnl
+AC_DEFUN([AC_PROMPT_USER_NO_DEFINE],
+[
+if test "x$defaults" = "xno"; then
+echo $ECHO_N "$2 ($3): $ECHO_C"
+read tmpinput <&AS_ORIGINAL_STDIN_FD
+if test "$tmpinput" = "" -a "$3" != ""; then
+ tmpinput="$3"
+fi
+eval $1=\"$tmpinput\"
+else
+tmpinput="$3"
+eval $1=\"$tmpinput\"
+fi
+]) dnl done AC_PROMPT_USER
+
+dnl @synopsis AC_PROMPT_USER(VARIABLENAME,QUESTION,[DEFAULT],QUOTED)
+dnl
+dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
+dnl DEFAULT value if the user merely hits return. Also calls
+dnl AC_DEFINE_UNQUOTED() on the VARIABLENAME for VARIABLENAMEs that should
+dnl be entered into the config.h file as well. If QUOTED is "quoted" then
+dnl the result will be defined within quotes.
+dnl
+dnl @version 1.15
+dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
+dnl
+AC_DEFUN([AC_PROMPT_USER],
+[
+MSG_CHECK="patsubst([$2], [.*
+], [])"
+AC_CACHE_CHECK($MSG_CHECK, ac_cv_user_prompt_$1,
+[echo "" >&AS_MESSAGE_FD
+AC_PROMPT_USER_NO_DEFINE($1,[$2],$3)
+eval ac_cv_user_prompt_$1=\$$1
+echo $ECHO_N "setting $MSG_CHECK to... $ECHO_C" >&AS_MESSAGE_FD
+])
+if test "$ac_cv_user_prompt_$1" != "none"; then
+ if test "x$4" = "xquoted" -o "x$4" = "xQUOTED"; then
+ AC_DEFINE_UNQUOTED($1,"$ac_cv_user_prompt_$1")
+ else
+ AC_DEFINE_UNQUOTED($1,$ac_cv_user_prompt_$1)
+ fi
+fi
+]) dnl
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644
index 0000000..d812584
--- /dev/null
+++ b/m4/libtool.m4
@@ -0,0 +1,7831 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*) ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
new file mode 100644
index 0000000..17cfd51
--- /dev/null
+++ b/m4/ltoptions.m4
@@ -0,0 +1,369 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
new file mode 100644
index 0000000..9c7b5d4
--- /dev/null
+++ b/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3293 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4])
+m4_define([LT_PACKAGE_REVISION], [1.3293])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4'
+macro_revision='1.3293'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/m4/netsnmp_arg.m4 b/m4/netsnmp_arg.m4
new file mode 100644
index 0000000..c32330b
--- /dev/null
+++ b/m4/netsnmp_arg.m4
@@ -0,0 +1,27 @@
+dnl Reports an invalid option and suggests --enable-<ARGUMENT 1> instead
+AC_DEFUN([NETSNMP_INVALID_ENABLE],
+ [AC_MSG_ERROR([Invalid option. Use --enable-$1/--disable-$1 instead])])
+
+dnl Reports an invalid option and suggests --with-<ARGUMENT 1> instead
+AC_DEFUN([NETSNMP_INVALID_WITH],
+ [AC_MSG_ERROR([Invalid option. Use --with-$1/--without-$1 instead])])
+
+dnl Similar to AC_ARG_ENABLE but also defines a matching WITH option that
+dnl suggests the use of the ENABLE option if called
+AC_DEFUN([NETSNMP_ARG_ENABLE],
+ [AC_ARG_ENABLE([$1],[$2]dnl
+ m4_if(m4_eval($# < 3),1,[],[,[$3]])dnl
+ m4_if(m4_eval($# < 4),1,[],[,[$4]]))
+ AC_ARG_WITH(
+ [$1],,
+ [NETSNMP_INVALID_ENABLE([$1])])])
+
+dnl Similar to AC_ARG_WITH but also defines a matching ENABLE option that
+dnl suggests the use of the WITH option if called
+AC_DEFUN([NETSNMP_ARG_WITH],
+ [AC_ARG_WITH([$1],[$2]dnl
+ m4_if(m4_eval($# < 3),1,[],[,[$3]])dnl
+ m4_if(m4_eval($# < 4),1,[],[,[$4]]))
+ AC_ARG_ENABLE(
+ [$1],,
+ [NETSNMP_INVALID_WITH([$1])])])
diff --git a/m4/netsnmp_search_libs.m4 b/m4/netsnmp_search_libs.m4
new file mode 100644
index 0000000..bdd8a12
--- /dev/null
+++ b/m4/netsnmp_search_libs.m4
@@ -0,0 +1,35 @@
+dnl @synopsis NETSNMP_SEARCH_LIBS(FUNCTION, SEARCH-LIBS, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES], [TARGET-VARIABLE])
+dnl Similar to AC_SEARCH_LIBS but changes TARGET-VARIABLE instead of LIBS
+dnl If TARGET-VARIABLE is unset then LIBS is used
+AC_DEFUN([NETSNMP_SEARCH_LIBS],
+[m4_pushdef([netsnmp_target],m4_ifval([$6],[$6],[LIBS]))
+ AC_CACHE_CHECK([for library containing $1],
+ [netsnmp_cv_func_$1_]netsnmp_target,
+ [netsnmp_func_search_save_LIBS="$LIBS"
+ m4_if(netsnmp_target, [LIBS],
+ [netsnmp_target_val="$LIBS"
+ netsnmp_temp_LIBS="$5 ${LIBS}"],
+ [netsnmp_target_val="$netsnmp_target"
+ netsnmp_temp_LIBS="${netsnmp_target_val} $5 ${LIBS}"])
+ netsnmp_result=no
+ LIBS="${netsnmp_temp_LIBS}"
+ AC_LINK_IFELSE([AC_LANG_CALL([],[$1])],
+ [netsnmp_result="none required"],
+ [for netsnmp_cur_lib in $2 ; do
+ LIBS="-l${netsnmp_cur_lib} ${netsnmp_temp_LIBS}"
+ AC_LINK_IFELSE([AC_LANG_CALL([],[$1])],
+ [netsnmp_result=-l${netsnmp_cur_lib}
+ break])
+ done])
+ LIBS="${netsnmp_func_search_save_LIBS}"
+ [netsnmp_cv_func_$1_]netsnmp_target="${netsnmp_result}"])
+ if test "${[netsnmp_cv_func_$1_]netsnmp_target}" != "no" ; then
+ if test "${[netsnmp_cv_func_$1_]netsnmp_target}" != "none required" ; then
+ netsnmp_target="${netsnmp_result} ${netsnmp_target_val}"
+ fi
+ $3
+ m4_ifval([$4], [else
+ $4])
+ fi
+ m4_popdef([netsnmp_target])])
diff --git a/maketarget b/maketarget
new file mode 100755
index 0000000..6e83a6f
--- /dev/null
+++ b/maketarget
@@ -0,0 +1,63 @@
+: maketarget
+
+DIRS=`find . -name targets -prune -o -type d ! -name . -print | grep -v CVS | sed s/..//`
+TARGET=${1-`./config.guess`}
+
+rebuild=0
+
+echo Target directory: $TARGET
+echo Sub directories: $DIRS
+
+[ -d targets ] || mkdir targets
+cd targets
+if [ -d $TARGET ]
+then
+ /bin/echo Target already exists. Do you want to rebuild it\? '[y]' \\c
+ read ans
+ case $ans in
+ "" | y* | Y* )
+ rebuild=1
+ ;;
+ n* | N* )
+ exit 0
+ ;;
+ *)
+ echo Bummer.....
+ exit 1
+ ;;
+ esac
+fi
+
+echo Creating target directory: $TARGET
+[ -d $TARGET ] || mkdir $TARGET
+
+cd $TARGET
+for f in . $DIRS
+do
+ echo building $f ...
+ [ -d $f ] || mkdir $f
+ case $f in
+ */*/*/*)
+ echo Too deep nesting...
+ exit 1
+ ;;
+ */*/*)
+ cd $f
+ for f in ../../../../../$f/* ; do [ -d $f ] || ln -sf $f . ; done
+ cd ../../..
+ ;;
+ */*)
+ cd $f
+ for f in ../../../../$f/* ; do [ -d $f ] || ln -sf $f . ; done
+ cd ../..
+ ;;
+ .)
+ for f in ../../$f/* ; do [ -d $f ] || ln -sf $f . ; done
+ ;;
+ *)
+ cd $f
+ for f in ../../../$f/* ; do [ -d $f ] || ln -sf $f . ; done
+ cd ..
+ ;;
+ esac
+done
diff --git a/man/Makefile.in b/man/Makefile.in
new file mode 100644
index 0000000..5627cc0
--- /dev/null
+++ b/man/Makefile.in
@@ -0,0 +1,278 @@
+#
+# Makefile for the man page directory
+#
+top_builddir=..
+VPATH = @srcdir@
+
+#
+# install stuff
+#
+
+OTHERINSTALL=maninstall
+OTHERUNINSTALL=manuninstall
+#
+# local stuff
+#
+
+MAN1 = snmpinform.1 snmp-bridge-mib.1
+
+@NETSNMP_HAVE_AGENTX_LIBS_TRUE@AGENTXTRAP = agentxtrap.1
+@NETSNMP_HAVE_AGENTX_LIBS_FALSE@AGENTXTRAP =
+
+MAN1G = $(AGENTXTRAP) snmpbulkget.1 snmpcmd.1 snmpget.1 snmpset.1 snmpwalk.1 \
+ snmpbulkwalk.1 snmpgetnext.1 snmptest.1 snmptranslate.1 snmptrap.1 \
+ snmpusm.1 snmpvacm.1 snmptable.1 snmpstatus.1 snmpconf.1 mib2c.1 \
+ snmpnetstat.1 snmpdelta.1 snmpdf.1 encode_keychange.1 fixproc.1 \
+ net-snmp-config.1 mib2c-update.1 tkmib.1 traptoemail.1 \
+ net-snmp-create-v3-user.1
+
+# If MAN3 is populated again, then remember to re-enable the corresponding
+# action line within the 'maninstall' target
+MAN3 =
+MAN3_API = netsnmp_mib_api.3 netsnmp_config_api.3 snmp_alarm.3 \
+ netsnmp_session_api.3 netsnmp_sess_api.3 netsnmp_trap_api.3 netsnmp_varbind_api.3 netsnmp_pdu_api.3
+MAN3G = default_store.3 netsnmp_agent_api.3 $(MAN3_API)
+MAN5G = snmpd.conf.5 snmptrapd.conf.5 snmp.conf.5 snmp_config.5 variables.5 \
+ mib2c.conf.5 snmpd.examples.5 snmpd.internal.5
+MAN8G = snmptrapd.8 snmpd.8
+
+MIB_ALIASES = add_mibdir.3 add_module_replacement.3 \
+ fprint_description.3 fprint_objid.3 get_module_node.3 \
+ netsnmp_init_mib.3 netsnmp_read_module.3 \
+ print_description.3 print_mib.3 print_objid.3 \
+ read_all_mibs.3 read_mib.3 read_objid.3 \
+ shutdown_mib.3 snmp_parse_oid.3 snmp_set_mib_errors.3 \
+ snmp_set_mib_warnings.3 snmp_set_save_descriptions.3 \
+ snprint_description.3 snprint_objid.3
+CONFIG_ALIASES = config_perror.3 config_pwarn.3 \
+ read_config_print_usage.3 read_configs.3 read_premib_configs.3 \
+ register_app_config_handler.3 register_app_prenetsnmp_mib_handler.3 \
+ register_config_handler.3 register_const_config_handler.3 \
+ register_mib_handlers.3 register_prenetsnmp_mib_handler.3 \
+ unregister_all_config_handlers.3 \
+ unregister_app_config_handler.3 unregister_config_handler.3
+ALARM_ALIASES = snmp_alarm_register.3 snmp_alarm_register_hr.3 snmp_alarm_unregister.3
+SESSION_ALIASES = snmp_api_errstring.3 snmp_close.3 snmp_error.3 \
+ snmp_open.3 snmp_perror.3 snmp_read.3 snmp_select_info.3 \
+ snmp_send.3 snmp_sess_perror.3 snmp_timeout.3
+SSESS_ALIASES = snmp_sess_async_send.3 snmp_sess_close.3 snmp_sess_error.3 \
+ snmp_sess_init.3 snmp_sess_open.3 snmp_sess_read.3 \
+ snmp_sess_select_info.3 snmp_sess_send.3 \
+ snmp_sess_session.3 snmp_sess_timeout.3
+TRAP_ALIASES = send_easy_trap.3 send_trap_vars.3 send_v2trap.3
+VARBIND_ALIASES = fprint_value.3 fprint_variable.3 \
+ print_value.3 print_variable.3 \
+ snmp_add_null_var.3 snmp_clone_varbind.3 \
+ snmp_free_var.3 snmp_free_varbind.3 \
+ snmp_pdu_add_variable.3 \
+ snmp_set_var_objid.3 snmp_set_var_typed_integer.3 \
+ snmp_set_var_typed_value.3 snmp_set_var_value.3 \
+ snmp_varlist_add_variable.3 snprint_value.3 snprint_variable.3
+PDU_ALIASES = snmp_clone_pdu.3 snmp_fix_pdu.3 snmp_free_pdu.3 snmp_pdu_create.3
+
+
+
+MANALIASES=$(MIB_ALIASES) $(CONFIG_ALIASES) $(ALARM_ALIASES) $(SESSION_ALIASES) \
+ $(SSESS_ALIASES) $(TRAP_ALIASES) $(VARBIND_ALIASES) $(PDU_ALIASES)
+MANALL = $(MAN1) $(MAN1G) $(MAN3) $(MAN3G) $(MAN5G) $(MAN8G) $(MANALIASES)
+
+TARGETS = $(MAN5G) $(MAN1G) $(MAN3G) $(MAN8G)
+OTHERCLEANTARGETS=$(TARGETS) default_store.3.h $(MANALIASES) manaliases
+
+all: $(TARGETS) standardall manaliases
+
+manaliases: Makefile
+ touch manaliases
+ @for i in $(MAN3_API) ; do \
+ for j in `sed -n '/^.SH NAME/,/^.SH SYNOPSIS/p' $$i | sed -e 's/.- .*//' | sed 's/,.*//' | @EGREP@ -v '^.SH ' `; do \
+ echo "making man page alias $$j -> $$i APIs" ; \
+ echo ".so man3/$$i" > $$j.3 ; \
+ done \
+ done
+
+agentxtrap.1: $(srcdir)/agentxtrap.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/agentxtrap.1.def > agentxtrap.1
+
+snmpbulkget.1: $(srcdir)/snmpbulkget.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpbulkget.1.def > snmpbulkget.1
+
+snmpbulkwalk.1: $(srcdir)/snmpbulkwalk.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpbulkwalk.1.def > snmpbulkwalk.1
+
+snmpcmd.1: $(srcdir)/snmpcmd.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpcmd.1.def > snmpcmd.1
+
+snmpconf.1: $(srcdir)/snmpconf.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpconf.1.def > snmpconf.1
+
+snmpd.8: $(srcdir)/snmpd.8.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpd.8.def > snmpd.8
+
+snmpdelta.1: $(srcdir)/snmpdelta.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpdelta.1.def > snmpdelta.1
+
+snmpdf.1: $(srcdir)/snmpdf.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpdf.1.def > snmpdf.1
+
+snmpget.1: $(srcdir)/snmpget.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpget.1.def > snmpget.1
+
+snmpgetnext.1: $(srcdir)/snmpgetnext.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpgetnext.1.def > snmpgetnext.1
+
+snmpnetstat.1: $(srcdir)/snmpnetstat.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpnetstat.1.def > snmpnetstat.1
+
+snmpset.1: $(srcdir)/snmpset.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpset.1.def > snmpset.1
+
+snmpstatus.1: $(srcdir)/snmpstatus.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpstatus.1.def > snmpstatus.1
+
+snmptable.1: $(srcdir)/snmptable.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmptable.1.def > snmptable.1
+
+snmptest.1: $(srcdir)/snmptest.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmptest.1.def > snmptest.1
+
+snmptranslate.1: $(srcdir)/snmptranslate.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmptranslate.1.def > snmptranslate.1
+
+snmptrap.1: $(srcdir)/snmptrap.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmptrap.1.def > snmptrap.1
+
+snmpusm.1: $(srcdir)/snmpusm.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpusm.1.def > snmpusm.1
+
+snmpvacm.1: $(srcdir)/snmpvacm.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpvacm.1.def > snmpvacm.1
+
+mib2c.1: $(srcdir)/mib2c.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/mib2c.1.def > mib2c.1
+
+mib2c-update.1: $(srcdir)/mib2c-update.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/mib2c-update.1.def > mib2c-update.1
+
+snmpwalk.1: $(srcdir)/snmpwalk.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpwalk.1.def > snmpwalk.1
+
+encode_keychange.1: $(srcdir)/encode_keychange.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/encode_keychange.1.def > encode_keychange.1
+
+fixproc.1: $(srcdir)/fixproc.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/fixproc.1.def > fixproc.1
+
+net-snmp-config.1: $(srcdir)/net-snmp-config.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/net-snmp-config.1.def > net-snmp-config.1
+
+net-snmp-create-v3-user.1: $(srcdir)/net-snmp-create-v3-user.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/net-snmp-create-v3-user.1.def > net-snmp-create-v3-user.1
+
+tkmib.1: $(srcdir)/tkmib.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/tkmib.1.def > $@
+
+traptoemail.1: $(srcdir)/traptoemail.1.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/traptoemail.1.def > $@
+
+netsnmp_varbind_api.3: $(srcdir)/netsnmp_varbind_api.3.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/netsnmp_varbind_api.3.def > $@
+
+netsnmp_pdu_api.3: $(srcdir)/netsnmp_pdu_api.3.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/netsnmp_pdu_api.3.def > $@
+
+netsnmp_session_api.3: $(srcdir)/netsnmp_session_api.3.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/netsnmp_session_api.3.def > $@
+
+netsnmp_mib_api.3: $(srcdir)/netsnmp_mib_api.3.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/netsnmp_mib_api.3.def > $@
+
+netsnmp_config_api.3: $(srcdir)/netsnmp_config_api.3.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/netsnmp_config_api.3.def > $@
+
+snmp_alarm.3: $(srcdir)/snmp_alarm.3.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmp_alarm.3.def > $@
+
+netsnmp_sess_api.3: $(srcdir)/netsnmp_sess_api.3.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/netsnmp_sess_api.3.def > $@
+
+netsnmp_agent_api.3: $(srcdir)/netsnmp_agent_api.3.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/netsnmp_agent_api.3.def > $@
+
+netsnmp_trap_api.3: $(srcdir)/netsnmp_trap_api.3.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/netsnmp_trap_api.3.def > $@
+
+snmp.conf.5: $(srcdir)/snmp.conf.5.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmp.conf.5.def > $@
+
+snmp_config.5: $(srcdir)/snmp_config.5.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmp_config.5.def > $@
+
+snmpd.conf.5: $(srcdir)/snmpd.conf.5.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpd.conf.5.def > $@
+
+snmpd.examples.5: $(srcdir)/snmpd.examples.5.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpd.examples.5.def > $@
+
+snmpd.internal.5: $(srcdir)/snmpd.internal.5.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmpd.internal.5.def > $@
+
+snmptrapd.conf.5: $(srcdir)/snmptrapd.conf.5.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmptrapd.conf.5.def > $@
+
+variables.5: $(srcdir)/variables.5.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/variables.5.def > $@
+
+snmptrapd.8: $(srcdir)/snmptrapd.8.def ../sedscript
+ $(SED) -f ../sedscript < $(srcdir)/snmptrapd.8.def > $@
+
+default_store.3.h: $(srcdir)/../include/net-snmp/library/default_store.h
+ awk '{ if ($$0 == " * begin storage definitions ") { p = 1 } else if ($$0 == " * end storage definitions ") { p = 0 } else if (p) { print $$0}}' < $(srcdir)/../include/net-snmp/library/default_store.h > default_store.3.h
+
+default_store.3: $(srcdir)/default_store.3.top default_store.3.h $(srcdir)/default_store.3.bot
+ $(SED) -f ../sedscript < $(srcdir)/default_store.3.top > default_store.3
+ cat default_store.3.h $(srcdir)/default_store.3.bot >> default_store.3
+
+mib2c.conf.5: $(top_srcdir)/local/mib2c mib2c.conf.5.in $(srcdir)/mib2c.extract.pl
+ @if test "x$(PERL)" != "x" ; then \
+ $(PERL) $(srcdir)/mib2c.extract.pl $(top_srcdir)/local/mib2c $(srcdir)/mib2c.conf.5.in > mib2c.conf.5; \
+ else \
+ touch mib2c.conf.5 ; \
+ fi
+
+maninstall: maninstalldirs $(MAN1) $(MAN1G) $(MAN3) $(MAN5G) $(MAN8) $(MANALIASES)
+ @for i in $(MAN1) ; do $(INSTALL_DATA) $(srcdir)/$$i $(INSTALL_PREFIX)$(man1dir) ; echo "install: installed $$i in $(INSTALL_PREFIX)$(man1dir)" ; done
+ @$(INSTALL_DATA) $(MAN1G) $(INSTALL_PREFIX)$(man1dir)
+ @for i in $(MAN1G) ; do echo "install: installed $$i in $(INSTALL_PREFIX)$(man1dir)" ; done
+ #EMPTY LIST#@for i in $(MAN3) ; do $(INSTALL_DATA) $(srcdir)/$$i $(INSTALL_PREFIX)$(man3dir) ; echo "install: installed $$i in $(INSTALL_PREFIX)$(man3dir)" ; done
+ @$(INSTALL_DATA) $(MAN3G) $(INSTALL_PREFIX)$(man3dir)
+ @for i in $(MAN3G) ; do echo "install: installed $$i in $(INSTALL_PREFIX)$(man3dir)" ; done
+ @$(INSTALL_DATA) $(MANALIASES) $(INSTALL_PREFIX)$(man3dir)
+ @for i in $(MANALIASES) ; do echo "install: installed $$i in $(INSTALL_PREFIX)$(man3dir)" ; done
+ -@$(INSTALL_DATA) $(MAN5G) $(INSTALL_PREFIX)$(man5dir)
+ @for i in $(MAN5G) ; do echo "install: installed $$i in $(INSTALL_PREFIX)$(man5dir)" ; done
+ @$(INSTALL_DATA) $(MAN8G) $(INSTALL_PREFIX)$(man8dir)
+ @for i in $(MAN8G) ; do echo "install: installed $$i in $(INSTALL_PREFIX)$(man8dir)" ; done
+
+manuninstall:
+ @for i in $(MAN1G) $(MAN1) ; do rm -f $(INSTALL_PREFIX)$(man1dir)/$$i ; echo "removed $$i from $(INSTALL_PREFIX)$(man1dir)" ; done
+ @for i in $(MAN3G) $(MAN3) $(MANALIASES); do rm -f $(INSTALL_PREFIX)$(man3dir)/$$i ; echo "removed $$i from $(INSTALL_PREFIX)$(man3dir)" ; done
+ @for i in $(MAN5G) ; do rm -f $(INSTALL_PREFIX)$(man5dir)/$$i ; echo "removed $$i from $(INSTALL_PREFIX)$(man5dir)" ; done
+ @for i in $(MAN8G) ; do rm -f $(INSTALL_PREFIX)$(man8dir)/$$i ; echo "removed $$i from $(INSTALL_PREFIX)$(man8dir)" ; done
+
+maninstalldirs:
+ @$(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(man1dir) $(INSTALL_PREFIX)$(man3dir) $(INSTALL_PREFIX)$(man5dir) $(INSTALL_PREFIX)$(man8dir)
+
+
+#
+# internal administrative
+#
+html: $(MANALL)
+ for i in $(MANALL); do \
+# if test `wc -l $$i | awk '{print $$1}'` != 1 ; then \
+ base=`echo $$i | sed 's/.[0-9]$$//;'` ; \
+ echo "<HTML><BODY bgcolor=\"#ffffff\" background=\"../ucd-snmp-bg3.gif\"><PRE>" > $$base.html; \
+ man2html -r ./$$i | $(PERL) -p -e 's/HREF=\"..\/man.\//HREF=\"/g;s/\.[1-9]\.html/.html/g;' | grep -v 'Content-type:' >> $$base.html; \
+ a="$$a $$i"; \
+# fi ; \
+ done ;\
+ $(PERL) make_index.pl man_sections.txt $$a > index.html
diff --git a/man/agentxtrap.1.def b/man/agentxtrap.1.def
new file mode 100644
index 0000000..331325f
--- /dev/null
+++ b/man/agentxtrap.1.def
@@ -0,0 +1,110 @@
+.TH AGENTXTRAP 1 "20 Dec 2009" VVERSIONINFO "Net-SNMP"
+.SH NAME
+agentxtrap - send an AgentX NotifyPDU to an AgentX master agent
+.SH SYNOPSIS
+.B agentxtrap
+.RI [ OPTIONS ] " trap-oid " [ "OID TYPE VALUE" ...]
+.SH DESCRIPTION
+.B agentxtrap
+issues an AgentX NotifyPDU to a master agent. One or more object
+identifiers (OIDs) can be given as arguments on the command line.
+A type and a value must accompany each object identifier.
+Each variable name is given in the format specified in
+.IR variables(5) .
+.PP
+.SH OPTIONS
+.PD 0
+.TP 6
+.BI \-c "\| contextName\^"
+if the
+.B \-c
+option is present then the notification is sent in the nondefault name context.
+.TP
+.BI \-U "\| uptime\^"
+if the
+.B \-U
+option is present then that value, parsed as centiseconds, is taken to be the
+sysUpTime field of the application.
+.TP
+.BI \-x "\| ADDRESS\^"
+if the
+.B \-x
+option is present then contact the AgentX master at ADDRESS and not the default
+one.
+.PD
+.PP
+Additionally all the options described in
+.IR snmpcmd(1)
+under the
+.BR "MIB PARSING OPTIONS" ", " "LOGGING OPTIONS" " and " "INPUT OPTIONS"
+headers as well as the
+.BR -d ", " -D ", " -m " and " -M
+options are supported.
+.PP
+In
+.I OID TYPE VALUE
+the parsing of the
+.I VALUE
+field is controlled by the
+.I TYPE
+field. The possible values for the
+.I TYPE
+field is one of the following characters:
+.RS
+.PD 0
+.TP 3
+.B =
+Let
+.I OID
+decide how
+.I VALUE
+should be interpreted
+.TP
+.B i
+INTEGER
+.TP
+.B u
+Unsigned
+.TP
+.B c
+Counter32
+.TP
+.B s
+OCTET STRING of chaacters
+.TP
+.B x
+OCTET STRING, entered as a sequence of optionally space separated hexadecimal
+digit pairs
+.TP
+.B d
+OCTET STRING, entered as a sequence of space separated decimal digits in the
+range 0 - 255
+.TP
+.B n
+NULL
+.TP
+.B o
+OBJECT IDENTIFIER
+.TP
+.B t
+TimeTicks
+.TP
+.B a
+IpAddress
+.TP
+.B b
+BITS
+.PD
+.RE
+which are handled in the same way as the
+.B snmpset
+command.
+.PP
+.SH EXAMPLES
+To send a generic linkUp trap to the manager for interface 1 the following
+command can be used:
+.PP
+agentxtrap netSnmp.0.3 ifindex.1 i 1
+.PP
+.SH SEE ALSO
+snmpcmd(1), snmpset(1), variables(5), RFC 2741
diff --git a/man/default_store.3.bot b/man/default_store.3.bot
new file mode 100644
index 0000000..ebd2bf6
--- /dev/null
+++ b/man/default_store.3.bot
@@ -0,0 +1,120 @@
+.fi
+.SH FUNCTIONS
+.TP
+.BI "int netsnmp_ds_set_boolean(int " store ", int " which ", int " val ");"
+Stores
+.I TRUE
+if
+.I val
+!= 0 or else
+.I FALSE
+into the bool_storage[store][which] slot. Returns
+.B SNMPERR_GENERR
+if the
+.IR store " and " which
+parameters do not correspond to a valid slot, or
+.B SNMPERR_SUCCESS
+otherwise.
+.TP
+.BI "int netsnmp_ds_get_boolean(int " store ", int " which ");"
+Returns 1 if bool_storage[store][which] is
+.IR TRUE
+or 0 if not. May also return
+.B SNMPERR_GENERR
+if the
+.IR store " and " which
+parameters do not correspond to a valid slot.
+.TP
+.BI "int netsnmp_ds_set_string(int " store ", int " which ", const char *" val ");"
+Stores
+.I val
+into the string_storage[store][which] slot. Returns
+.B SNMPERR_SUCCESS
+normally, or
+.B SNMPERR_GENERR
+if the
+.IR store " and " which
+parameters do not correspond to a valid slot.
+.TP
+.BI "char *netsnmp_ds_get_string(int " store ", int " which ");"
+Returns the string which has been stored in the
+string_storage[store][which] slot, or
+.B NULL
+if the
+.IR store " and " which
+parameters do not correspond to a valid slot.
+.TP
+.BI "netsnmp_ds_set_int(int " store ", int " which ", int " val ");"
+Stores
+.I val
+into the int_storage[store][which] slot. Returns
+.B SNMPERR_GENERR
+if the
+.IR store " and " which
+parameters do not correspond to a valid slot, or
+.B SNMPERR_SUCCESS
+otherwise.
+.TP
+.BI "int netsnmp_ds_get_int(int " store ", int " which ");"
+Returns the integer which has been stored in the
+int_storage[store][which] slot, or
+.B SNMPERR_GENERR
+if the
+.IR store " and " which
+parameters do not correspond to a valid slot.
+.TP
+.BI "void netsnmp_ds_shutdown(void);"
+Reclaims memory used to hold information gathered by
+.BR netsnmp_ds_register_config " and " netsnmp_ds_register_premib .
+.TP
+.BI "int netsnmp_ds_register_config(u_char " type ", const char *" ftype ", const char *" token ", int " store ", int " which ");"
+Registers a configuration file directive
+.I token
+and attaches it to
+a default storage type and slot. Specifically,
+.I store
+and
+.I which
+indicate the storage slot in the data type indicated by
+.I type,
+where
+.I type
+is one of the following constants:
+.BR ASN_BOOLEAN ", " ASN_INTEGER ", or " ASN_OCTET_STR .
+The
+.I ftype
+variable indicates the file name base string searched for the
+.I token
+keyword. For example, the following call:
+.RS
+.IP
+netsnmp_ds_register_config(ASN_INTEGER, "snmp", "testtoken", DS_APPLICATION_ID, 5)
+.RE
+.IP
+would indicate that when the snmp.conf file(s) were found and parsed,
+that any line beginning with the word "testtoken" should be read and
+the value after "testtoken" should be stored into the
+int_storage[DS_APPLICATION_ID][5] slot. For example the following
+line in the configuration file:
+.RS
+.IP
+testtoken 502
+.RE
+.IP
+would set int_storage[DS_APPLICATION_ID][5] = 502. This function returns
+.B SNMPERR_SUCCESS
+if the registration was made successfully, or
+.B SNMPERR_GENERR
+if the registration was not made (perhaps because the
+.IR store " and " which
+parameters do not correspond to a valid slot, or because of a memory
+allocation failure).
+.TP
+.BI "int netsnmp_ds_register_premib(u_char " type ", const char *" ftype ", const char *" token ", int " store ", int " which ");"
+Analogous to the preceding function, but the
+.I token
+is processed before MIBs are read (this is therefore useful for controlling
+MIB processing options).
+.SH "SEE ALSO"
+.BR snmp_config "(5), " netsnmp_config_api "(3)"
+
diff --git a/man/default_store.3.top b/man/default_store.3.top
new file mode 100644
index 0000000..cc04822
--- /dev/null
+++ b/man/default_store.3.top
@@ -0,0 +1,83 @@
+.TH DEFAULT_STORE 3 "25 Jun 2002" VVERSIONINFO "Net-SNMP"
+.SH NAME
+default_store \- generic storage of global data.
+.SH SYNOPSIS
+.B #include <net-snmp/net-snmp-config.h>
+.br
+.B #include <net-snmp/config_api.h>
+
+.BI "int netsnmp_ds_set_boolean(int " store ", int " which ", int " val ");"
+.br
+.BI "int netsnmp_ds_get_boolean(int " store ", int " which ");"
+.br
+.BI "int netsnmp_ds_set_int(int " store ", int " which ", int " val ");"
+.br
+.BI "int netsnmp_ds_get_int(int " store ", int " which ");"
+.br
+.BI "int netsnmp_ds_set_string(int " store ", int " which ", "
+.br
+.BI " const char *" val ");"
+.br
+.BI "char *netsnmp_ds_get_string(int " store ", int " which ");"
+.br
+.BI "int netsnmp_ds_register_config(u_char " type ", "
+.br
+.BI " const char *" ftype ","
+.br
+.BI " const char *" token ","
+.br
+.BI " int " store ", int " which ");"
+.br
+.BI "int netsnmp_ds_register_premib(u_char " type ", "
+.br
+.BI " const char *" ftype ","
+.br
+.BI " const char *" token ","
+.br
+.BI " int " store ", int " which ");"
+.br
+.BI "void netsnmp_ds_shutdown(void);"
+.fi
+.SH DESCRIPTION
+The purpose of the default storage is three-fold:
+.IP 1)
+To create a global storage space without creating a whole bunch of
+globally accessible variables or a whole bunch of access functions to
+work with more privately restricted variables.
+.IP 2)
+To provide a single location where the thread locking needs to be
+implemented. At the time of this writing, however, thread locking is not
+yet in place.
+.IP 3)
+To reduce the number of cross dependencies between code pieces that
+may or may not be linked together in the long run. This provides for a
+single location in which configuration data, for example, can be
+stored for a separate section of code that may not be linked in to
+the application in question.
+.PP
+The functions defined here implement these goals.
+.PP
+Currently, three data types are supported: booleans, integers, and
+strings. Each of these data types have separate storage
+spaces. In addition, the storage space for each data type is divided
+further by the application level. Currently, there are two storage
+spaces. The first is reserved for the SNMP library itself. The second
+is intended for use in applications and is not modified or checked by
+the library, and, therefore, this is the space usable by you.
+.PP
+You can think of these storage spaces as being 3 arrays, something
+like bool_storage[storeid][which], int_storage[storeid][which], and
+string_storage[storeid][which]. The data is then accessed through the
+functions defined below. For data you wish to store, you should use a
+.I store
+parameter of
+.BR NETSNMP_DS_APPLICATION_ID .
+.PP
+The storage space used by the library (for which the
+.I store
+parameter is
+.BR NETSNMP_DS_LIBRARY_ID )
+is defined in the default_store.h file, which currently contains the
+following defines:
+.PP
+.nf
diff --git a/man/encode_keychange.1.def b/man/encode_keychange.1.def
new file mode 100644
index 0000000..20f5cc3
--- /dev/null
+++ b/man/encode_keychange.1.def
@@ -0,0 +1,71 @@
+.TH encode_keychange 1 "16 Nov 2006" VVERSIONINFO "Net-SNMP"
+.SH NAME
+encode_keychange - produce the KeyChange string for SNMPv3
+.SH SYNOPSIS
+.B encode_keychange
+\-t md5|sha1
+[\fIOPTIONS\fR]
+.SH DESCRIPTION
+.B encode_keychange
+produces a KeyChange string using the old and new passphrases
+as described in Section 5 of RFC 2274 "User-based Security Model (USM) for
+version 3 of the Simple Network Management Protocol (SNMPv3)". \fB\-t\fR
+option is mandatory and specifies the hash transform type to use.
+
+The transform is used to convert passphrase to master key for a given
+user (Ku), convert master key to the localized key (Kul), and to hash the
+old Kul with the random bits.
+
+Passphrases are obtained by examining a number of sources until success
+(in order listed):
+.IP
+command line options (see
+.B \-N
+and
+.B \-O
+options below);
+.IP
+the file
+.B $HOME/.snmp/passphrase.ek
+which should only contain two lines with old and new passphrase;
+.IP
+standard input \fB\-or\-\fR user input from the terminal.
+.PP
+
+.SH OPTIONS
+.TP
+\fB\-E\fR [0x]<\fIengineID\fR> EngineID used for Kul generation.
+<\fIengineID\fR> is intepreted as a hex string when preceded by 0x,
+otherwise it is treated as a text string. If no <\fIengineID\fR> is
+specified, it is constructed from the first IP address for the local
+host.
+.TP
+\fB\-f\fR
+Force passphrases to be read from standard input.
+.TP
+\fB\-h\fR
+Display the help message.
+.TP
+\fB\-N\fR "<\fInew_passphrase\fR>"
+Passphrase used to generate the new Ku.
+.TP
+\fB\-O\fR "<\fIold_passphrase\fR>"
+Passphrase used to generate the old Ku.
+.TP
+\fB\-P\fR
+Turn off the prompt for passphrases when getting data from standard input.
+.TP
+\fB\-v\fR
+Be verbose.
+.TP
+\fB\-V\fR
+Echo passphrases to terminal.
+.PP
+
+.SH "SEE ALSO"
+The localized key method is defined in RFC 2274, Sections 2.6 and A.2, and
+originally documented in
+.IP
+U. Blumenthal, N. C. Hien, B. Wijnen,
+"Key Derivation for Network Management Applications",
+IEEE Network Magazine, April/May issue, 1997.
diff --git a/man/fixproc.1.def b/man/fixproc.1.def
new file mode 100644
index 0000000..ae88a3d
--- /dev/null
+++ b/man/fixproc.1.def
@@ -0,0 +1,40 @@
+.TH fixproc 1 "16 Nov 2006" VVERSIONINFO "Net-SNMP"
+.SH NAME
+fixproc - Fixes a process by performing the specified action.
+.SH SYNOPSIS
+.PP
+.B fixproc
+[\fI\-min n\fR]
+[\fI\-max n\fR]
+[\fI\-check | \-kill | \-restart | \-exist | \-fix\fR]
+proc \.\.\.
+.SH DESCRIPTION
+.PP
+Fixes a process named "proc" by performing the specified action. The
+actions can be check, kill, restart, exist, or fix. The action is specified
+on the command line or is read from a default database, which describes
+the default action to take for each process. The database format and
+the meaning of each action are described below.
+.SH OPTIONS
+.TP
+.B \-min n
+minimum number of processes that should be running, defaults to 1
+.TP
+.B \-max n
+maximum number of processes that should be running, defaults to 1
+.TP
+.B \-check
+check process against database /local/etc/fixproc.conf.
+.TP
+.B \-kill
+kill process, wait 5 seconds, kill \-9 if still exist
+.TP
+.B \-restart
+kill process, wait 5 seconds, kill \-9 if still exist, then start again
+.TP
+.B \-exist
+checks if proc exists in ps && (min <= num. of processes <= max)
+.TP
+.B \-fix
+check process against database /local/etc/fixproc.conf. Perform defined
+action, if check fails.
diff --git a/man/make_index.pl b/man/make_index.pl
new file mode 100644
index 0000000..37566ba
--- /dev/null
+++ b/man/make_index.pl
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+#
+# Creates a .xhtml compliant index.html file
+#
+my $infile = shift @ARGV;
+
+map { s/\.[0-9]$//; $pages{$_} = 1; } @ARGV;
+
+open(I,$infile);
+$first = 1;
+print '<p class="SectionTitle">
+Man pages
+</p>
+';
+
+while (<I>) {
+ if (/^#\s*(.*)/) {
+ print "</table>\n" if (!$first);
+ print "<h2>$1</h2>\n";
+ print "<table width=\"100%\">\n";
+ $first = 0;
+ } else {
+ my $name = $_;
+ my $title;
+ chomp($name);
+ if (!exists($pages{$name})) {
+ print STDERR "$name is in $infile, but not in the rest of the args.\n";
+ print STDERR "Make sure it's not listed twice in $infile!\n";
+ }
+ open(H,"$name.html");
+ while (<H>) {
+ if (/<h1>(.*?)<\/h1>/i) {
+ $title = $1;
+ }
+
+ if (/<h2>NAME<\/h2>(.*)/i) {
+ $_ = $1;
+
+ # Ignore blank lines
+ while (/^\s*$/) {
+ $_ = <H>;
+ }
+
+ $title = $_;
+ chomp($title);
+ $title =~ s/\s*$name\s*-\s*//;
+
+ # Remove any complete <> tags
+ $title =~ s/<.*>//i;
+ # Remove any half open tags
+ $title =~ s/<.*//i;
+ }
+ }
+ close(H);
+ print " <tr>\n";
+ print " <td width=\"30%\"><a href=\"$name.html\">$name</a></td>\n";
+ print " <td>$title</td>\n";
+ print " </tr>\n";
+ print "\n";
+ delete $pages{$name};
+ }
+}
+print '</table>
+<br/>';
+
+@left = keys(%pages);
+if ($#left > -1) {
+ print STDERR "missing a filing location for: ",
+ join(", ", @left), "\n";
+}
diff --git a/man/man_sections.txt b/man/man_sections.txt
new file mode 100644
index 0000000..fcce8f9
--- /dev/null
+++ b/man/man_sections.txt
@@ -0,0 +1,158 @@
+# SNMP basic applications
+encode_keychange
+snmpcmd
+snmptranslate
+snmpget
+snmpgetnext
+snmpbulkget
+snmpwalk
+snmpbulkwalk
+snmpset
+snmptest
+tkmib
+# SNMP "second-level" applications
+snmptable
+snmpdelta
+snmpusm
+snmpvacm
+snmpstatus
+snmpnetstat
+snmpdf
+# Notification manual pages
+snmpinform
+snmptrap
+snmptrapd
+snmptrapd.conf
+traptoemail
+# SNMP application configuration manual pages
+net-snmp-config
+snmpconf
+snmp_config
+snmp.conf
+# Agent manual pages
+fixproc
+snmpd
+snmpd.conf
+snmpd.examples
+snmpd.internal
+mib2c
+mib2c.conf
+mib2c-update
+# SNMP base library APIs
+netsnmp_library
+read_config
+snmp_api
+mib_api
+snmp_sess_api
+variables
+snmp_alarm
+default_store
+netsnmp_mib_utilities
+netsnmp_debug
+# Agent API manuals
+add_mibdir
+add_module_replacement
+config_perror
+config_pwarn
+fprint_description
+fprint_objid
+fprint_value
+fprint_variable
+get_module_node
+init_mib
+init_mib_internals
+netsnmp_agent
+netsnmp_baby_steps
+netsnmp_bulk_to_next
+netsnmp_cache_handler
+netsnmp_container
+netsnmp_Container_iterator
+netsnmp_ds_get_boolean
+netsnmp_ds_get_int
+netsnmp_ds_get_string
+netsnmp_ds_register_config
+netsnmp_ds_register_premib
+netsnmp_ds_set_boolean
+netsnmp_ds_set_int
+netsnmp_ds_set_string
+netsnmp_ds_shutdown
+netsnmp_example_scalar_int
+netsnmp_handler
+netsnmp_instance
+netsnmp_iterator_info_s
+netsnmp_leaf
+netsnmp_mib_handler_methods
+netsnmp_mode_end_call
+netsnmp_multiplexer
+netsnmp_old_api
+netsnmp_read_only
+netsnmp_row_merge
+netsnmp_scalar
+netsnmp_scalar_group_group
+netsnmp_serialize
+netsnmp_stash_cache
+netsnmp_table
+netsnmp_table_array
+netsnmp_table_data
+netsnmp_table_dataset
+netsnmp_table_iterator
+netsnmp_utilities
+netsnmp_watcher
+print_description
+print_mib
+print_objid
+print_value
+print_variable
+read_all_mibs
+read_config_print_usage
+read_configs
+read_mib
+read_module
+read_module_node
+read_objid
+read_premib_configs
+register_app_config_handler
+register_app_premib_handler
+register_config_handler
+register_mib_handlers
+register_premib_handler
+send_easy_trap
+send_trap_vars
+send_v2trap
+shutdown_mib
+snmp_agent_api
+snmp_alarm_register
+snmp_alarm_register_hr
+snmp_alarm_unregister
+snmp_api_errstring
+snmp_close
+snmp_error
+snmp_free_pdu
+snmp_open
+snmp_perror
+snmp_read
+snmp_select_info
+snmp_send
+snmp_sess_async_send
+snmp_sess_close
+snmp_sess_error
+snmp_sess_init
+snmp_sess_open
+snmp_sess_perror
+snmp_sess_read
+snmp_sess_select_info
+snmp_sess_send
+snmp_sess_session
+snmp_sess_timeout
+snmp_set_mib_warnings
+snmp_set_save_descriptions
+snmp_timeout
+snmp_trap_api
+snprint_objid
+snprint_value
+snprint_variable
+sprint_realloc_objid
+sprint_realloc_value
+sprint_realloc_variable
+unregister_app_config_handler
+unregister_config_handler \ No newline at end of file
diff --git a/man/mib2c-update.1.def b/man/mib2c-update.1.def
new file mode 100644
index 0000000..52ece8a
--- /dev/null
+++ b/man/mib2c-update.1.def
@@ -0,0 +1,28 @@
+.TH mib2c-update 1 "07 Apr 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+mib2c-update - script to merge custom code into updated mib2c code
+.SH SYNOPSIS
+.PP
+.B mib2c-update
+.SH DESCRIPTION
+.PP
+Use mib2c-update to generate your mib2c code templates, and it will track
+the original code and the changes you make to the code. If the mib2c
+template changes (bug fixes, enhances in later releases), re-running
+mib2c will update the template and then attempt to re-apply your
+changes.
+.PP
+This can be extremely useful when developing your own mib2c templates.
+.PP
+When you first run mib2c-update, it will create several hidden
+directories and a .mib2c-updaterc file. You must edit the .mib2c-udpaterc
+file to specify two values. The first, UPDATE_OID, is the table name
+to specify when running mib2c. The second, UPDATE_CONF, is the mib2c
+configuration file to specify when running mib2c.
+.PP
+Additional mib2c options can be specified in UPDATE_MIB2C_OPTS.
+.PP
+.SH BUGS
+.PP
+mib2c-update has only been tested on individual tables. Specifying
+a scalar or and entire MIB might not work.
diff --git a/man/mib2c.1.def b/man/mib2c.1.def
new file mode 100644
index 0000000..b9c1134
--- /dev/null
+++ b/man/mib2c.1.def
@@ -0,0 +1,227 @@
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP's COPYING file for more details and other copyrights
+.\" that may apply:
+.\" /***********************************************************
+.\" 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.
+.\" ******************************************************************/
+.TH MIB2C 1 "05 Apr 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+mib2c -- generate template code for extending the agent
+.SH SYNOPSIS
+.B mib2c
+[-h] -c CONFIGFILE [-I PATH] [-f OUTNAME] [-i][-s][-q][-S VAR=VAL] MIBNODE
+.SH DESCRIPTION
+The mib2c tool is designed to take a portion of the MIB tree (as defined
+by a MIB file) and generate the template C code necessary to implement
+the relevant management objects within it.
+.PP
+In order to implement a new MIB module, three files are necessary:
+.PP
+.br
+- MIB definition file
+.br
+- C header file
+.br
+- C implementation file.
+.PP
+The mib2c tool uses the MIB definition file to produce the two C
+code files. Thus, mib2c generates a template that you can edit
+to add logic necessary to obtain information from the
+operating system or application to complete the module.
+.PP
+MIBNODE is the top level mib node you want to generate code for.
+You must give mib2c a mib node (e.g. ifTable) on the command line,
+not a mib file. This is the single most common mistake.
+.PP
+The mib2c tool accepts both SMIv1 and SMIv2 MIBs.
+.PP
+mib2c needs to be able to find and load a MIB file in order to generate
+C code for the MIB. To enable mib2c to find the MIB file, set the
+MIBS environment variable to include the MIB file you are using.
+An example of setting this environment variable is:
+.PP
+ MIBS=+NET-SNMP-TUTORIAL-MIB
+.PP
+ or
+.PP
+ MIBS=ALL
+.PP
+The first example ensures that mib2c finds the NET-SNMP-TUTORIAL-MIB
+mib, in addition to the default MIB modules. The default list of MIB
+modules is set when the suite is first configured and built and
+basically corresponds to the list of modules that the agent supports.
+The second example ensures that mib2c finds all MIBs in the search
+location for MIB files. The default search location for MIB files is
+DATADIR/snmp/mibs. This search location can be modified
+by the MIBDIRS environment variable.
+.PP
+Both the MIB files to be loaded and the MIB file search location can
+also be configured in the snmp.conf file. Please see snmp.conf(5) for
+more information.
+.PP
+The generated *.c and *.h files will be created in the current working
+directory.
+.SH "OPTIONS"
+.TP
+.BI -h
+Display a help message.
+.TP
+.BI -c " CONFIGFILE"
+Use CONFIGFILE when generating code. These files will be searched for
+first in the current directory and then in the DATADIR directory
+(which is where the default mib2c configuration files can be found).
+Running mib2c without the -c CONFIGFILE option will display
+a description of the valid values for CONFIGFILE, that is,
+the available config files, including new ones that you might
+author.
+.IP
+For example,
+.IP
+% mib2c ifTable
+.IP
+will display a description of the currently available values
+for CONFIGFILE.
+.IP
+The following values are supported for CONFIGFILE:
+.IP
+mib2c.mfd.conf
+.br
+mib2c.scalar.conf
+.br
+mib2c.int_watch.conf
+.br
+mib2c.iterate.conf
+.br
+mib2c.create-dataset.conf
+.br
+mib2c.array-user.conf
+.br
+mib2c.column_defines.conf
+.br
+mib2c.column_enums.conf
+.IP
+GENERATING CODE FOR SCALAR OBJECTS:
+.IP
+If you're writing code for some scalars, run:
+
+ mib2c -c mib2c.scalar.conf MIBNODE
+.IP
+If you want to magically "tie" integer variables to integer
+scalars, use:
+
+ mib2c -c mib2c.int_watch.conf MIBNODE
+.IP
+GENERATING CODE FOR TABLES:
+
+The recommended configuration file for tables is the MIBs for
+Dummies, or MFD, configuration file. It hides as much of the SNMP
+details as possible, generating small, easy to understand functions.
+It is also the most flexible and well documented configuration file.
+See the agent/mibgroup/if-mib/ifTable/ifTable*.c files for an example:
+
+ mib2c -c mib2c.mfd.conf MIBNODE
+
+If your table data is kept somewhere else (e.g. it's in the
+kernel and not in the memory of the agent itself) and you need to
+"iterate" over it to find the right data for the SNMP row being
+accessed. See the agent/mibgroup/mibII/vacm_context.c file for an
+example:
+
+ mib2c -c mib2c.iterate.conf MIBNODE
+
+If your table data is kept in the agent (i.e. it's not located in
+an external source) and is purely data driven (i.e. you do not need
+to perform any work when a set occurs). See the
+agent/mibgroup/examples/data_set.c file for an example of such a
+table:
+
+ mib2c -c mib2c.create-dataset.conf MIBNODE
+
+If your table data is kept in the agent (i.e. it's not located in
+an external source), and you can keep your data sorted by the table
+index but you do need to perform work when a set occurs:
+
+ mib2c -c mib2c.array-user.conf MIBNODE
+
+GENERATING HEADER FILE DEFINITIONS
+
+To generate just a header with a define for each column number in
+your table:
+
+ mib2c -c mib2c.column_defines.conf MIBNODE
+
+To generate just a header with a define for each enum for any
+column containing enums:
+
+ mib2c -c mib2c.column_enums.conf MIBNODE
+
+ GENERATING CODE FOR THE 4.X LINE OF CODE (THE OLDER API)
+
+ mib2c -c mib2c.old-api.conf MIBNODE
+.TP
+.BI -I PATH
+Search for configuration files in PATH. Multiple paths can be
+specified using multiple -I switches or by using one with a comma
+separated list of paths in it.
+.TP
+.BI -f " OUTNAME"
+Places the output code into OUTNAME.c and OUTNAME.h. Normally, mib2c
+will place the output code into files which correspond to the table
+names it is generating code for, which is probably what you want anyway.
+.TP
+.BI -i
+Do not run indent on the resulting code.
+.TP
+.BI -s
+Do not look for MIBNODE.sed and run sed on the resulting code. This
+is useful to shorten long mib variable names in the code.
+.TP
+.BI -q
+Run in "quiet" mode, which minimizes the status messages
+mib2c generates.
+.TP
+.BI -S VAR=VAL
+Preset a variable VAR, in the mib2c.*.conf file, to the value
+VAL. None of the existing mib2c configuration files
+(mib2c.*.conf) currently makes use of this feature, however,
+so this option should be considered available only for future use.
+.SH EXAMPLES
+.PP
+The following generates C template code for the header and implementation
+files to implement UCD-DEMO-MIB::ucdDemoPublic.
+.IP
+% mib2c -c mib2c.scalar.conf ucdDemoPublic
+.br
+writing to ucdDemoPublic.h
+.br
+writing to ucdDemoPublic.c
+.br
+running indent on ucdDemoPublic.h
+.br
+running indent on ucdDemoPublic.c
+.PP
+The resulting ucdDemoPublic.c and ucdDemoPublic.h files are
+generated the current working directory.
+.PP
+The following generates C template code for the header and implementation
+files for the module to implement TCP-MIB::tcpConnTable.
+.IP
+% mib2c -c mib2c.iterate.conf tcpConnTable
+.br
+writing to tcpConnTable.h
+.br
+writing to tcpConnTable.c
+.br
+running indent on tcpConnTable.h
+.br
+running indent on tcpConnTable.c
+.PP
+The resulting tcpConnTable.c and tcpConnTable.h files are generated
+in the current working directory.
+.PP
+.SH SEE ALSO
+.PP
+snmpcmd(1), snmp.conf(5)
diff --git a/man/mib2c.conf.5.in b/man/mib2c.conf.5.in
new file mode 100644
index 0000000..3692a65
--- /dev/null
+++ b/man/mib2c.conf.5.in
@@ -0,0 +1,52 @@
+.TH MIB2C.CONF 5 "28 Apr 2004" VVERSIONINFO "Net-SNMP"
+.SH NAME
+mib2c.conf \[em] How to write mib2c.conf files to do ANYTHING based on MIB input.
+.SH SYNOPSIS
+% cat > mib2c.test.conf << EOF
+@foreach $t table@
+ Starting table $t
+ @foreach $c column@
+ echo $t has column $c which has a syntax of $c.syntax
+ @end@
+
+@end@
+EOF
+
+% mib2c \-c mib2c.test.conf internet
+.SH DESCRIPTION
+The mib2c.conf script language is a MIB-particular language designed
+to easily process MIB nodes in ways that you want. mib2c is a
+misnomer (for historical purposes), because you can produce anything
+(not just C code). Look in the Net-SNMP "local" directory for a bunch
+of example mib2c.*.conf files and behold the power before you.
+.SH COMMANDS
+.PP
+All commands within mib2c.conf files are embraced by @ signs.
+Anything with an @ sign at the front and back of the line is generally
+supposed to be a mib2c specific command. These are detailed here:
+COMMANDSHERE
+.SH VARIABLES
+.PP
+Variables in the mib2c language look very similar to perl variables,
+in that they start with a "$". They can be used for anything you
+want, but most typically they'll hold mib node names being processed
+by @foreach ...@ clauses.
+.PP
+They also have a special properties when they are a mib node, such that
+adding special suffixes to them will allow them to be interpreted in
+some fashion. The easiest way to understand this is through an
+example. If the variable 'x' contained the word 'ifType' then some
+magical things happen. In mib2c output, anytime $x is seen it is
+replaced with "ifType". Additional suffixes can be used to get other
+aspects of that mib node though. If $x.objectID is seen, it'll be
+replaced by the OID for ifType: ".1.3.6.1.2.1.2.2.1.3". Other
+suffixes that can appear after a dot are listed below.
+.PP
+One last thing: you can use things like $vartext immediately ending in
+some other text, you can use {}s to get proper expansion of only part
+of the mib2c input. IE, $xtext will produce "$xtext", but ${x}text
+will produce "ifTypetext" instead.
+VAREXPANSIONSHERE
+.SH SEE ALSO
+.PP
+mib2c(1)
diff --git a/man/mib2c.extract.pl b/man/mib2c.extract.pl
new file mode 100644
index 0000000..14b9dea
--- /dev/null
+++ b/man/mib2c.extract.pl
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+
+# read comments from mib2c and insert them in mib2c.conf.5
+my $mib2csrc = shift;
+
+while (<>) {
+ if (/COMMANDSHERE/) {
+ open(I,$mib2csrc);
+ while (<I>) {
+ last if (/^# which include:/);
+ }
+ while (<I>) {
+ last if (!/^#/);
+ s/^#\s+//;
+ # Avoid ' at the beginning of a line
+ s/^'/\\&'/;
+ # Quotes in a quoted argument must be doubled.
+ s/"/""/g;
+ s/^(\@.*\@)$/.IP "$1"/;
+ print;
+ }
+ close(I);
+ } elsif (/VAREXPANSIONSHERE/) {
+ open(I,$mib2csrc);
+ while (<I>) {
+ last if (/^# Mib components,/);
+ }
+ while (<I>) {
+ last if (!/^#/);
+ next if (/^#\s*$/);
+ s/^#\s+//;
+ # Avoid ' at the beginning of a line
+ s/^'/\\&'/;
+ # Quotes in a quoted argument must be doubled.
+ s/"/""/g;
+ s/^(\S+)\s+--\s+(.*)/.IP "$1"\n$2/;
+ print;
+ }
+ close(I);
+ } else {
+ print;
+ }
+}
diff --git a/man/net-snmp-config.1.def b/man/net-snmp-config.1.def
new file mode 100644
index 0000000..3a0fa2b
--- /dev/null
+++ b/man/net-snmp-config.1.def
@@ -0,0 +1,87 @@
+.TH net-snmp-config 1 "16 Nov 2006" VVERSIONINFO "Net-SNMP"
+.SH NAME
+net\-snmp\-config - returns information about installed net-snmp libraries and binaries
+.SH SYNOPSIS
+.PP
+.B net\-snmp\-config
+[OPTIONS]
+.SH DESCRIPTION
+.PP
+The \fInet\-snmp\-config\fP shell script is designed to retrieve the
+configuration information about the libraries and binaries dealing with
+the Simple Network Management Protocol (SNMP), built from the
+.B net-snmp
+source package. The information is particularly useful for
+applications that need to link against the SNMP libraries and hence
+must know about any other libraries that must be linked in as well.
+
+.SH OPTIONS
+.TP
+\fB\-\-version\fR
+displays the net-snmp version number
+.TP
+\fB\-\-indent\-options\fR
+displays the indent options from the Coding Style
+.TP
+\fB\-\-debug\-tokens\fR
+displays a example command line to search to source
+code for a list of available debug tokens
+.PP
+SNMP Setup commands:
+.TP
+\fB\-\-create\-snmpv3\-user\fR [\-ro] [\-a authpass] [\-x privpass]
+[\-X DES|AES] [\-A MD5|SHA] [username]
+.PP
+These options produce the various compilation flags needed when
+building external SNMP applications:
+.TP
+\fB\-\-base\-cflags\fR
+lists additional compilation flags needed
+for external applications (excludes \fB\-I\fR. and
+extra developer warning flags, if any)
+.TP
+\fB\-\-cflags\fR
+lists additional compilation flags needed
+.TP
+\fB\-\-libs\fR
+lists libraries needed for building applications
+.TP
+\fB\-\-agent\-libs\fR
+lists libraries needed for building subagents
+.TP
+\fB\-\-netsnmp\-libs\fR
+lists netsnmp specific libraries
+.TP
+\fB\-\-external\-libs\fR
+lists libraries needed by netsnmp libs
+.TP
+\fB\-\-netsnmp\-agent\-libs\fR
+lists netsnmp specific agent libraries
+.HP
+\fB\-\-external\-agent\-libs\fR lists libraries needed by netsnmp libs
+.PP
+Automated subagent building (produces an OUTPUTNAME binary file):
+[This feature has not been extensively tested, use at your own risk.]
+.TP
+\fB\-\-compile\-subagent\fR OUTPUTNAME [\-\-norm] [\-\-cflags flags]
+[\-\-ldflags flags] mibmodule1.c [...]]
+.TP
+\fB\-\-norm\fR
+leave the generated .c file around to read.
+.TP
+\fB\-\-cflags\fR flags
+extra cflags to use (e.g. \fB\-I\fR...).
+.TP
+\fB\-\-ldflags\fR flags
+extra ld flags to use (e.g. \fB\-L\fR... \fB\-l\fR...).
+.IP
+Details on how the net-nsmp package was compiled:
+.TP
+\fB\-\-configure\-options\fR
+Display original configure arguments
+.TP
+\fB\-\-snmpd\-module\-list\fR
+Display the modules compiled into the agent
+.TP
+\fB\-\-prefix\fR
+Display the installation prefix
diff --git a/man/net-snmp-create-v3-user.1.def b/man/net-snmp-create-v3-user.1.def
new file mode 100644
index 0000000..da6944c
--- /dev/null
+++ b/man/net-snmp-create-v3-user.1.def
@@ -0,0 +1,28 @@
+.TH net-snmp-create-v3-user 1 "17 Sep 2008" VVERSIONINFO "Net-SNMP"
+.SH NAME
+net-snmp-create-v3-user \- create a SNMPv3 user in net-snmp configuration file
+.SH SYNOPSIS
+.PP
+.B net-snmp-create-v3-user [-ro] [-a authpass] [-x privpass] [-X DES|AES]
+.B [username]
+.SH DESCRIPTION
+.PP
+The \fInet-snmp-create-v3-user\fP shell script is designed to create a
+new user in net-snmp configuration file (/var/net-snmp/snmpd.conf by default).
+
+.SH OPTIONS
+.TP
+\fB\-\-version\fR
+displays the net-snmp version number
+.TP
+\fB\-ro\fR
+create an user with read-only permissions
+.TP
+\fB\-a authpass\fR
+specify authentication password
+.TP
+\fB\-x privpass\fR
+specify encryption password
+.TP
+\fB\-X DES|AES\fR
+specify encryption algorithm
diff --git a/man/netsnmp_agent_api.3.def b/man/netsnmp_agent_api.3.def
new file mode 100644
index 0000000..19efd00
--- /dev/null
+++ b/man/netsnmp_agent_api.3.def
@@ -0,0 +1,132 @@
+.TH NETSNMP_AGENT_API 3 "13 Aug 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+netsnmp_agent_api - embedding an agent into a external application
+.SH SYNOPSIS
+.nf
+#include <net\-snmp/net\-snmp\-config.h>
+#include <net\-snmp/net\-snmp\-includes.h>
+#include <net\-snmp/agent/net\-snmp\-agent\-includes.h>
+
+int
+main (int argc, char *argv[])
+{
+ int agentx_subagent = 1; /* Change this if you're a master agent. */
+
+ snmp_enable_stderrlog();
+
+ /* If we're an AgentX subagent... */
+ if (agentx_subagent) {
+ /* ...make us an AgentX client. */
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE, 1);
+ }
+
+ init_agent("yourappname");
+
+ /* Initialize your MIB code here. */
+ init_my_mib_code();
+
+ /* `yourappname' will be used to read yourappname.conf files. */
+ init_snmp("yourappname");
+
+ /* If we're going to be a SNMP master agent... */
+ if (!agentx_subagent)
+ init_master_agent(); /* Listen on default port (161). */
+
+ /* Your main loop here... */
+ while (whatever) {
+ /* if you use select(), see snmp_api(3) */
+ /* --- OR --- */
+ agent_check_and_process(0); /* 0 == don't block */
+ }
+
+ /* At shutdown time: */
+ snmp_shutdown("yourappname");
+}
+
+Then:
+$(CC) ... `net\-snmp\-config \-\-agent\-libs`
+
+.fi
+.SH DESCRIPTION
+.PP
+Our goal is to create a easy to use interface to the Net-SNMP package
+such that you can take code that you have written that has been
+designed to be a Net-SNMP MIB module and embed it into an external
+application where you can either chose to be a SNMP master agent or an
+AgentX sub-agent using the same MIB module code. Our suggestion is
+that you use our (or another) SNMP agent as the AgentX master agent
+and chose to become an AgentX subagent which then attaches to the
+master.
+.PP
+The Net-SNMP package provides a pair of libraries that enables easy
+embedding of an SNMP or AgentX agent into an external software
+package. AgentX is an extensible protocol designed to allow multiple
+SNMP sub-agents all run on one machine under a single SNMP master
+agent. It is defined in RFC 2741.
+.PP
+You will need to perform a few tasks in order to accomplish
+this. First off, you will need to initialize both the SNMP library and
+the SNMP agent library. As indicated above, this is done slightly
+differently depending on whether or not you are going to perform as a
+master agent or an AgentX sub-agent.
+.SH CONFIGURATION
+.PP
+If you intend to operate as an AgentX sub-agent, you will have to
+configured the Net-SNMP package with agentx support (which is turned
+on by default, so just don't turn it off)
+.PP
+Additionally, you will need to link against the Net-SNMP libraries
+(use the output of "net\-snmp\-config \-\-agent\-libs" to get a library
+list) and call subagent_pre_init() as indicated above.
+.SH COMPILING
+.PP
+In order to make use of any of the above API, you will need to link
+against at least the four libraries listed above.
+.SH FUNCTIONS
+.PP This is a brief description of the functions called above and
+where to find out more information on them. It is certainly not a
+complete list of what is available within all the Net-SNMP libraries.
+.IP "snmp_enable_stderrlog()"
+Logs error output from the SNMP agent to the standard error stream.
+.IP "netsnmp_ds_set_boolean()"
+Please see the
+.IR default_store(3)
+manual page for more information
+about this API.
+.IP "init_agent(char *name)"
+Initializes the embedded agent. This should be called before the
+.BR "init_snmp()"
+call.
+.I name
+is used to dictate what .conf file to read when
+.BR "init_snmp()"
+is called later.
+.IP "init_snmp(char *name)"
+Initializes the SNMP library. Note that one of the things this will
+do will be to read configuration files in an effort to configure your
+application. It will attempt to read the configuration files named by
+the
+.I name
+string that you passed in. It can be used to configure access
+control, for instance. Please see the
+.IR netsnmp_config_api(3) ", " snmp_config(5) ", and " snmpd.conf(5)
+manual pages for further details on this subject.
+.IP "init_master_agent(void)"
+Initializes the master agent and causes it to listen for SNMP requests
+on its default UDP port of 161.
+.IP "agent_check_and_process(int block)"
+This checks for packets arriving on the SNMP port and processes them
+if some are found. If
+.I block
+is non-zero, the function call will block until a packet arrives or an
+alarm must be run (see
+.IR snmp_alarm(3) ).
+The return value from this function is a positive integer if packets
+were processed, zero if an alarm occurred and \-1 if an error occured.
+.IP "snmp_shutdown(char *name);"
+This shuts down the agent, saving any needed persistent storage, etc.
+.SH "SEE ALSO"
+http://www.net\-snmp.org/tutorial\-5/toolkit/ select(2), snmp_api(3),
+default_store(3), snmp_alarm(3), netsnmp_config_api(3), snmp_config(5),
+snmpd.conf(5)
diff --git a/man/netsnmp_config_api.3.def b/man/netsnmp_config_api.3.def
new file mode 100644
index 0000000..68049df
--- /dev/null
+++ b/man/netsnmp_config_api.3.def
@@ -0,0 +1,373 @@
+.TH NETSNMP_CONFIG_API 3 "13 Aug 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+register_config_handler,
+register_const_config_handler,
+register_prenetsnmp_mib_handler,
+unregister_config_handler,
+register_mib_handlers,
+unregister_all_config_handlers,
+register_app_config_handler,
+register_app_prenetsnmp_mib_handler,
+unregister_app_config_handler,
+read_configs,
+read_premib_configs,
+read_config_print_usage,
+config_perror,
+config_pwarn - netsnmp_config_api functions
+.SH SYNOPSIS
+.B #include <net-snmp/config_api.h>
+.br
+.SS Config Handlers
+.PP
+.B struct config_line *
+.br
+.BI " register_config_handler(const char *" filePrefix ",
+.br
+.BI " const char *" token ,
+.br
+.BI " void (*" parser ")(const char *, char *),"
+.br
+.BI " void (*" releaser ")(void),"
+.br
+.BI " const char *"usageLine ");"
+.PP
+.B struct config_line *
+.br
+.BI " register_const_config_handler(const char *" filePrefix ",
+.br
+.BI " const char *" token ,
+.br
+.BI " void (*" parser ")(const char *, const char *),"
+.br
+.BI " void (*" releaser ")(void),"
+.br
+.BI " const char *" usageLine ");"
+.PP
+.PP
+.B struct config_line *
+.br
+.BI " register_prenetsnmp_mib_handler(const char *" filePrefix ",
+.br
+.BI " const char *" token ,
+.br
+.BI " void (*" parser ")(const char *, char *),"
+.br
+.BI " void (*" releaser ")(void),"
+.br
+.BI " const char *" usageLine ");"
+.PP
+.BI "void unregister_config_handler(const char *" filePrefix ","
+.br
+.BI " const char *" token ");"
+.PP
+.\" Defined in mib.c, rather than read_config.c
+.B "void register_mib_handlers(void);"
+.br
+.B "void unregister_all_config_handlers(void);"
+.br
+.SS Application Handlers
+.PP
+.B struct config_line *
+.br
+.BI " register_app_config_handler(const char *" token ,
+.br
+.BI " void (*" parser ")(const char *, char *),"
+.br
+.BI " void (*" releaser ")(void),"
+.br
+.BI " const char *"usageLine ");"
+.PP
+.B struct config_line *
+.br
+.BI " register_app_prenetsnmp_mib_handler(const char *" token ,
+.br
+.BI " void (*" parser ")(const char *, char *),"
+.br
+.BI " void (*" releaser ")(void),"
+.br
+.BI " const char *" usageLine ");"
+.PP
+.BI "void unregister_app_config_handler(const char *" token ");"
+.br
+.SS Reading Configuration Files
+.PP
+.B "void read_premib_configs(void);"
+.br
+.B "void read_configs(void);"
+.br
+.SS Help Strings and Errors
+.PP
+.BI "void read_config_print_usage(char *" lead ");"
+.br
+.BI "void config_pwarn(const char *" string ");"
+.br
+.BI "void config_perror(const char *" string ");"
+
+.SH DESCRIPTION
+The functions are a fairly extensible system of parsing various
+configuration files at the run time of an application. The
+configuration file flow is broken into the following phases:
+.RS 4
+.TP 4
+1.
+Registration of handlers.
+.TP
+2.
+Reading of the configuration files for pre-MIB parsing requirements.
+.TP
+3.
+Reading and parsing of the textual MIB files.
+.TP
+4.
+Reading of the configuration files for configuration directives.
+.TP
+5.
+Optionally re-reading the configuration files at a future date.
+.RE
+.PP
+The idea is that the calling application is able to register
+.I handlers
+for certain
+.I tokens
+specified in certain named
+.I "configuration files."
+The
+.B read_configs()
+function can then be called to look for all relevant configuration files,
+match the first word on each line against the list of registered tokens
+and pass the remainder of the line to the appropriate registered handler.
+.SH REGISTERING A HANDLER
+.TP
+.B register_config_handler()
+Registers a configuration handler routine, which should be called
+to process configuration directives starting with the specified token.
+For example:
+.PP
+.RS
+.RS
+register_config_handler("snmp", "exampleToken", example_handler, NULL, "ARG1 [ARG2]");
+.RE
+.RE
+.IP
+would register the
+.B example_handler()
+function so that it will get called every time the first word of a
+line in the
+.I snmp.conf
+configuration file(s) matches "exampleToken".
+.br
+Calling the appropriate handlers to process the configuration file directives
+is the responsibility of
+.B read_configs()
+(see below).
+.TP
+.B register_const_config_handler()
+Similar to the
+.B register_config_handler()
+function, but the parser routine is explicitly constrained
+to not modify the string being parsed.
+.TP
+.B register_prenetsnmp_mib_handler()
+Similar to the
+.B register_config_handler()
+function, but the registered handler routine will be called
+\fIbefore\fP the textual MIBs are read in.
+This is typically used for tokens that will affect the configuration of
+the MIB parser, and will normally only be used within the SNMP library itself.
+.TP
+.B register_mib_handlers()
+Initialisation routine to register the internal SNMP library configuration handlers.
+.TP
+.B unregister_config_handler()
+Removes the registered configuration handler for the specified
+.I filePrefix
+and
+.IR token .
+.TP
+.B unregister_all_config_handlers()
+Removes all registered configuration handlers.
+
+.SS Token Handlers
+.PP
+Handler functions should have the following signature:
+.PP
+.RS
+.BI "void handler(const char *" token ", char *" line ");"
+.br
+or
+.br
+.BI "void handler(const char *" token ", const char *" line ");"
+br
+(if registered using \fIregister_const_config_handler\fP)
+.RE
+.PP
+The function will be called with two arguments, the first being the
+token that triggered the call to this function (i.e. the token used
+when registering the handler), and the second
+being the remainder of the configuration file line (i.e. everything
+following the white space following the matched token).
+
+.SS Freeing Handlers
+.PP
+If the token handler function dynamically allocates resources when
+processing a configuration entry, then these may need to be released
+before re-reading the configuration files.
+If the fourth parameter (
+.I releaser
+) passed to
+.B register_config_handler
+is non-NULL, then this specifies a function to be called before
+re-reading the configuration files. This function should free any
+resources allocated by the token handler function and reset its notion
+of the configuration to its default. The token handler function can
+then safely be called again.
+No arguments are passed to the resource freeing handler.
+.br
+Note that this function is not called when the handler is
+unregistered individually (but \fIis\fP called as part of
+.B unregister_all_config_handlers()
+).
+
+.SS Application Handlers
+.TP
+.B register_app_config_handler()
+.TP
+.B register_app_prenetsnmp_mib_handler()
+.TP
+.B unregister_app_config_handler()
+These functions are analagous to
+.BR register_config_handler() ", " register_prenetsnmp_mib_handler() " and "
+.B unregister_config_handler()
+but do not require the file type argument (which is filled in by the
+application). It is intended that MIB modules written for the agent
+use these functions to allow the agent to have more control over which
+configuration files are read (typically the
+.I snmpd.conf
+files).
+.SH READING CONFIGURATION FILES
+.TP
+.B read_premib_configs()
+.TP
+.B read_configs()
+These routines process the configuration files found in the
+configuration search path (see below). For each entry, the
+handler registered for that configuration token is called.
+.PP
+.B read_premib_configs()
+is run before the MIB files are read in, and processes those
+configuration tokens registered using
+.B register_prenetsnmp_mib_handler()
+(or
+.B register_app_prenetsnmp_mib_handler()
+).
+All other entries are ignored.
+.PP
+.B read_configs()
+is run after the MIB files have been read in, and processes those
+configuration tokens registered using
+.B register_config_handler()
+(or
+.B register_app_config_handler()
+).
+If it encounters a configuration token for which no handler has
+been registered (either pre- or post-mib), then it will display
+a warning message, and continue processing with the next line
+of the configuration file.
+.SS Configuration Search Path
+.PP
+The configuration files to be read are found by searching a list
+of configuration directories for appropriately named files.
+In each such directory, the library will look for files named
+\fC snmp.conf\fP,
+\fC snmp.local.conf\fP,
+\fI app\fP\fC.conf\fP,
+\fI app\fP\fC.local.conf\fP,
+.br
+(where \fIapp\fP is the appication-specific filePrefix used to
+register configuration handlers).
+It is not necessary for any or all of these files to be present
+in each directory. Missing files will be silently skipped.
+.br
+The idea behind the two different suffixes is that the first file can
+be shared (via rdist or an NFS mount) across a large number of
+machines and the second file can be used to configure local settings
+for one particular machine.
+.PP
+The default list of directories to search is \fC SYSCONFDIR/snmp\fP,
+followed by \fC DATADIR/snmp\fP,
+followed by \fC LIBDIR/snmp\fP,
+followed by \fC $HOME/.snmp\fP.
+This list can be changed by setting the environmental variable
+.I SNMPCONFPATH
+to be a (colon separated) list of directories to search.
+.br
+.SS init_snmp()
+.PP
+The normal mode of operation would be to register the application-specific
+configuration handlers, and then invoke
+.BR init_snmp() "."
+This would call the routines listed above to register the internal library
+configuration handlers, process any configuration tokens registered with
+.B register_prenetsnmp_mib_handler(),
+read in the textual MIB files using
+.B init_mib(),
+and finally parse the configuration file tokens registered with
+.BR register_config_handler() .
+.PP
+If the
+.B init_snmp()
+function is used, none of these functions need to be explicitly
+called by the application.
+.SH HELP STRINGS AND ERRORS
+.PP
+The
+.I usageLine
+parameter passed to
+.B register_config_handler()
+and similar calls, is used to display help information when the
+.B read_config_print_usage()
+function is called. This function is used by all of the applications
+when the
+.B -H
+flag is passed on the command line. It prints a summary of all of the
+configuration file lines, and the associated files, that the
+configuration system understands. The
+.I usageLine
+parameter should be a list of arguments expected after the token, and
+not a lengthy description (which should go into a manual page
+instead). The
+.I lead
+prefix will be prepended to each line that the function prints to
+stderr, where it displays its output.
+.PP
+The
+.B init_snmp()
+function should be called before the
+.B read_config_print_usage()
+function is called, so that the library can register its configuration
+file directives as well for the
+.B read_config_print_usage()
+function to display.
+.SS Error Handling Functions
+.PP
+The two functions
+.B config_pwarn()
+and
+.B config_perror()
+both take an error string as an argument and print it to stderr along
+with the file and line number that caused the error. A call to the
+second function will also force
+.B read_configs()
+to eventually return with an error code indicating to it's calling
+function that it should abort the operation of the application.
+.SH "ENVIRONMENT VARIABLES"
+.TP 10
+SNMPCONFPATH
+A colon separated list of directories to search for configuration
+files in.
+Default: SYSCONFDIR/snmp:DATADIR/snmp:LIBDIR/snmp:$HOME/.snmp
+.SH "SEE ALSO"
+.BR mib_api "(3), " snmp_api (3)
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/man/netsnmp_mib_api.3.def b/man/netsnmp_mib_api.3.def
new file mode 100644
index 0000000..c253047
--- /dev/null
+++ b/man/netsnmp_mib_api.3.def
@@ -0,0 +1,310 @@
+.TH NETSNMP_MIB_API 3 "13 Aug 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+add_mibdir,
+netsnmp_init_mib,
+shutdown_mib,
+netsnmp_read_module,
+read_mib,
+read_all_mibs,
+add_module_replacement,
+snmp_set_mib_errors,
+snmp_set_mib_warnings,
+snmp_set_save_descriptions,
+read_objid,
+snmp_parse_oid,
+get_module_node,
+print_mib,
+print_objid,
+fprint_objid,
+snprint_objid,
+print_description,
+fprint_description,
+snprint_description - netsnmp_mib_api functions
+.SH SYNOPSIS
+.B #include <net\-snmp/mib_api.h>
+.PP
+.SS Initialisation and Shutdown
+.BI "int add_mibdir(const char *" "dirname" );
+.PP
+.B "void netsnmp_init_mib(void);
+.\".br
+.\".BI "void init_mib(void);" " (deprecated)"
+.\".br
+.\".BI "void init_mib_internals(void);" " (deprecated)"
+.br
+.B "void shutdown_mib(void);
+.SS Reading and Parsing MIBs
+.BI "struct tree *netsnmp_read_module(const char *" "name" );
+.br
+.\".BI "struct tree *read_module(const char *" "name" ");" " (deprecated)"
+.\".PP
+.BI "struct tree *read_mib(const char *" "filename" );
+.br
+.B "struct tree *read_all_mibs(void);
+.PP
+.BI "int add_module_replacement(const char *" "old_module" ","
+.br
+.BI " const char *" "new_module" ","
+.br
+.BI " const char *" "tag" ", int " "len" );
+.PP
+.BI "void snmp_set_mib_warnings(int " level );
+.br
+.BI "void snmp_set_mib_errors(int " level );
+.br
+.BI "void snmp_set_save_descriptions(int " save ");"
+.SS Searching the MIB Tree
+.PP
+.BI "int read_objid(const char *" "input" ","
+.br
+.BI " oid *" "objid" ", size_t *" "objidlen" );
+.br
+.BI "oid *snmp_parse_oid(const char *" "input" ","
+.br
+.BI " oid *" "objid" ", size_t *" "objidlen" );
+.br
+.BI "int get_module_node(const char *" "name" ", const char *" "module" ","
+.br
+.BI " oid *" "objid" ", size_t *" "objidlen" );
+.SS Output
+.PP
+.BI "void print_mib(FILE *" "fp" );
+.PP
+.BI "void print_objid(const oid *" objid ", size_t " objidlen );
+.br
+.BI "void fprint_objid(FILE *" fp ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ");"
+.br
+.BI "int snprint_objid(char *" buf ", size_t " "len" ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ");"
+.PP
+.BI "void print_description(const oid *" objid ", size_t " objidlen ", int " width );
+.br
+.BI "void fprint_description(FILE *" fp ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ", int " width );
+.br
+.BI "int snprint_description(char *" buf ", size_t " "len" ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ", int " width );
+.br
+.PP
+.SH DESCRIPTION
+The functions dealing with MIB modules fall into four groups - those
+dealing with initialisation and shutdown, with reading in and parsing
+MIB files, with searching the MIB tree, and output routines.
+.SS Initialisation and Shutdown
+.PP
+.B add_mibdir
+is used to add the specified directory to the path of locations which are
+searched for files containing MIB modules.
+Note that this does not actually load the MIB modules located
+in that directory, but is simply an initialisation step to make
+them available to
+.BR netsnmp_read_module .
+This function returns a count of files found in the directory, or a \-1
+if there is an error.
+It should be called \fIbefore\fP invoking \fBnetsnmp_init_mib\fP.
+.PP
+.\".B init_mib_internals
+.\"sets up the internal structures, preparatory to reading in MIB
+.\"modules. It should be called \fIafter\fP all calls to
+.\".BR add_mibdir ,
+.\"and before any calls to
+.\".BR netsnmp_read_module .
+.\".PP
+.B netsnmp_init_mib
+configures the MIB directory search path (using
+.B add_mibdir
+), sets up the internal MIB framework,
+and then loads the appropriate MIB modules (using
+.BR netsnmp_read_module " and " read_mib ")."
+See the ENVIRONMENTAL VARIABLES section for details.
+.br
+It should be called before any other
+routine that manipulates or accesses the MIB tree
+(but after any additional
+.B add_mibdir
+calls).
+.PP
+.B shutdown_mib
+will clear the information that was gathered by
+.BR netsnmp_read_module ", " add_mibdir " and " add_module_replacement .
+It is strongly recommended that one does not invoke
+.BR shutdown_mib
+while there are SNMP sessions being actively managed.
+.SS Reading and Parsing MIBs
+.PP
+.B netsnmp_read_module
+takes the name of a MIB module (which need not be the same as the
+name of the file that contains the module), locates this within the
+configured list of MIB directories, and loads the definitions from
+the module into the active MIB tree.
+It also loads any MIB modules listed in the IMPORTS clause of this module.
+.PP
+.B read_mib
+is similar, but takes the name of the file containing the MIB module.
+Note that this file need not be located within the MIB directory
+search list (although any modules listed in the IMPORTS clause do).
+.PP
+.B read_all_mibs
+will read in all the MIB modules found on the MIB directory search list.
+.PP
+In general the parser is silent about what strangenesses it sees in
+the MIB files. To get warnings reported, call
+.B snmp_set_mib_warnings
+with a
+.I level
+of 1 (or 2 for even more warnings).
+.PP
+.B add_module_replacement
+can be used to allow new MIB modules to obsolete older ones, without
+needing to amend the IMPORTS clauses of other modules. It takes the
+names of the old and new modules, together with an indication of which
+portions of the old module are affected.
+.RS
+.TS
+tab(+);
+lb lb lb
+l l l.
+tag + len + load the new module when:
+NULL + 0 + always (the old module is a strict subset of
+ + + the new)
+name + 0 + for the given tag only
+name + non-0 + for any identifier with this prefix
+.TE
+.RE
+It can also be used to handle errors in the module identifiers used
+in MIB IMPORTS clauses (such as referring to
+.I RFC1213
+instead of
+.IR RFC1213\-MIB ).
+.SS Searching the MIB Tree
+.PP
+.B read_objid
+takes a string containing a textual version of an object identifier
+(in either numeric or descriptor form), and transforms this into the
+corresponding list of sub-identifiers. This is returned in the
+.I output
+parameter, with the number of sub-identifiers returned via
+.IR out_len .
+When called,
+.I out_len
+must hold the maximum length of the
+.I output
+array.
+If multiple object identifiers are being processed, then this
+length should be reset before each call.
+This function returns a value of 1 if it succeeds in parsing the string
+and 0 otherwise.
+.PP
+.B snmp_parse_oid
+is similar, but returns a pointer to the parsed OID buffer (or NULL).
+.PP
+.B get_module_node
+takes a descriptor and the name of a module, and returns the corresponding
+oid list, in the same way as
+.B read_objid
+above.
+.br
+If the module name is specified as "ANY", then this routine will
+assume that the descriptor given is unique within the tree, and will
+return the matching entry. If this assumption is invalid, then the
+behaviour as to which variable is returned is implementation
+dependent.
+.br
+.SS Output
+.B print_mib
+will print out a representation of the currently active MIB tree to
+the specified FILE pointer.
+.PP
+.B print_objid
+will take an object identifier (as returned by
+.BR read_objid ", " snmp_parse_oid " or " get_module_node "),"
+and prints the textual form of this OID to the standard output.
+.PP
+.B fprint_objid
+does the same, but prints to the FILE pointer specified by the initial
+parameter.
+.PP
+.B snprint_objid
+prints the same information into the buffer pointed to by
+.I buf
+which is of length
+.IR len .
+It returns the number of characters printed, or \-1 if the
+buffer was not large enough. In the latter case,
+.I buf
+will typically contain a truncated version of the information (but
+this behaviour is not guaranteed).
+.PP
+.BR print_description ,
+.BR fprint_description ,
+and
+.B snprint_description
+take a similar object identifier
+and print out a version of the MIB definition for that object,
+together with the full OID. The
+.I width
+argument controls how the OID is layed out.
+.PP
+By default the parser does not save descriptions since they may be
+huge. In order to be able to print them, it is necessary to invoke
+.BI snmp_set_save_descriptions(1) before
+calling
+.B init_mib
+(or similar).
+.SH "ENVIRONMENT VARIABLES"
+.PP
+The main use of environmental variables with respect to these API calls
+is to configure which MIB modules should be loaded, and where they are
+located.
+.TP 10
+MIBDIRS
+A colon separated list of directories to search for MIB modules.
+.br
+Default: DATADIR/snmp/mibs
+.br
+Used by
+.BR init_mib ", " netsnmp_read_module ", " read_all_mibs
+and (implicitly) by
+.BR read_mib .
+.TP 10
+MIBS
+A colon separated list of MIB modules to load.
+.br
+The default list of modules will depend on how the Net-SNMP software
+was originally compiled, but is typically:
+IP\-MIB:IF\-MIB:TCP\-MIB:UDP\-MIB:SNMPv2\-MIB:RFC1213\-MIB: UCD\-SNMP\-MIB:HOST\-RESOURCES\-MIB
+.IP
+If the value of the
+.B MIBS
+environmental variable starts with a '+' character,
+then these MIB modules will be added to the default list.
+Otherwise these modules (plus any that they IMPORT from) will be loaded
+.I instead
+of the default list.
+.IP
+If the
+.B MIBS
+environmental variable has the value
+.BR ALL " then " read_all_mibs
+will be called to load the full collection of all available MIB modules.
+.IP
+Used by
+.B init_mib
+only.
+.TP 10
+MIBFILES
+A colon separated list of files to load.
+.br
+Default: (none)
+.br
+Used by
+.B init_mib
+only.
+.SH "SEE ALSO"
+.BR snmp_api "(3),"
+.BR output_api "(3)"
diff --git a/man/netsnmp_pdu_api.3.def b/man/netsnmp_pdu_api.3.def
new file mode 100644
index 0000000..0b94e9e
--- /dev/null
+++ b/man/netsnmp_pdu_api.3.def
@@ -0,0 +1,30 @@
+.TH NETSNMP_PDU_API 3 "13 Aug 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmp_pdu_create,
+snmp_clone_pdu,
+snmp_fix_pdu,
+snmp_free_pdu - netsnmp_pdu_api functions
+.SH SYNOPSIS
+.B #include <net-snmp/pdu_api.h>
+.PP
+.BI "netsnmp_pdu *snmp_pdu_create( int" "type" ");"
+.PP
+.BI "netsnmp_pdu *snmp_clone_pdu( netsnmp_pdu*" "pdu" ");"
+.PP
+.BI "netsnmp_pdu *snmp_fix_pdu( netsnmp_pdu*" "pdu" ", int " "idx" ");"
+.PP
+.BI "netsnmp_pdu *snmp_free_pdu( netsnmp_pdu*" "pdu" ");"
+.PP
+.SH DESCRIPTION
+These functions deal with SNMP request structures.
+.PP
+.B snmp_pdu_create
+.PP
+.B snmp_clone_pdu
+.PP
+.B snmp_fix_pdu
+.PP
+.B snmp_free_pdu
+.SH "SEE ALSO"
+.BR varbind_api "(3)"
+.BR session_api "(3)"
diff --git a/man/netsnmp_sess_api.3.def b/man/netsnmp_sess_api.3.def
new file mode 100644
index 0000000..36b4159
--- /dev/null
+++ b/man/netsnmp_sess_api.3.def
@@ -0,0 +1,235 @@
+.TH NETSNMP_SESS_API 3 "19 May 2011" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmp_sess_init,
+snmp_sess_open,
+snmp_sess_session,
+snmp_sess_send,
+snmp_sess_async_send,
+snmp_sess_select_info,
+snmp_sess_read,
+snmp_sess_timeout,
+snmp_sess_synch_response,
+snmp_sess_close,
+snmp_sess_error - session functions
+.SH SYNOPSIS
+.B #include <net-snmp/session_api.h>
+.PP
+.BI "void snmp_sess_init(struct snmp_session *" session ");"
+.PP
+.BI "void *snmp_sess_open(struct snmp_session *" session ");"
+.PP
+.BI "struct snmp_session *snmp_sess_session(void *" handle ");"
+.PP
+.BI "int snmp_sess_send(void *" handle ", struct snmp_pdu *" pdu ");"
+.PP
+.BI "int snmp_sess_async_send(void *" handle ","
+.br
+.BI " struct snmp_pdu *" pdu ", "
+.br
+.BI " snmp_callback " callback ", "
+.br
+.BI " void *" callbackData ");"
+.PP
+.BI "int snmp_sess_select_info(void *" handle ","
+.br
+.BI " int *" numfds ", fd_set *" fdset ", "
+.br
+.BI " struct timeval *" timeout ", "
+.br
+.BI " int *" block ");"
+.PP
+.BI "int snmp_sess_read(void *" handle ", fd_set *" fdset ");"
+.PP
+.BI "void snmp_sess_timeout(void *" handle ");"
+.PP
+.BI "int snmp_sess_synch_response ( void *" "handle,"
+.RS
+.BI "netsnmp_pdu *" "pdu" ", "
+.br
+.BI "netsnmp_pdu **" "response" );
+.RE
+.PP
+.BI "int snmp_sess_close(void *" handle ");"
+.PP
+.BI "void snmp_sess_error(void *" handle ", int *" pcliberr ", "
+.br
+.BI " int *" psnmperr ", char **" pperrstring ");"
+.SH DESCRIPTION
+These functions define a subset of the API that can be used
+to manage single SNMP sessions in a multi-threaded application.
+Except for
+.BR snmp_sess_session() ,
+these functions are single session versions of the traditional
+SNMP library API.
+.PP
+Note that these functions use an opaque pointer
+.RI ( handle
+in the above prototypes) to identify a single session in lieu of a
+.I session
+pointer (as in the traditional API).
+.PP
+.B snmp_sess_init()
+prepares a struct snmp_session that sources transport characteristics
+and common information that will be used for a set of SNMP transactions.
+After this structure is passed to
+.B snmp_sess_open()
+to create an SNMP session, the structure is no longer used. Instead
+the opaque pointer returned by
+.B snmp_sess_open()
+is used to refer to that session henceforth.
+.PP
+SNMP sessions that are created with
+.B snmp_sess_open()
+are not affected by, and SHOULD NOT BE USED WITH,
+.BR snmp_select_info() ", " snmp_read() ", " snmp_timeout() " nor"
+.BR snmp_close() .
+Rather the equivalent single session functions described here should
+be used.
+.PP
+.B snmp_sess_init()
+and
+.B snmp_sess_open()
+each take as input a pointer to a struct snmp_session object.
+This structure contains information for a set of transactions that
+will share similar transport characteristics.
+.B snmp_sess_session()
+takes the opaque session handle and returns a pointer to
+its associated struct snmp_session.
+.PP
+.B snmp_sess_send()
+and
+.B snmp_sess_async_send()
+each take a
+.I pdu
+parameter, which points to a struct snmp_pdu object containing
+information that describes a transaction that will be performed over
+an open session.
+.PP
+Consult snmp_api.h for the definitions of these structures.
+.PP
+With the
+.I snmp_sess_async_send()
+call,
+.I snmp_sess_read
+will invoke the specified callback when the response is received.
+.PP
+.BR snmp_sess_select_info() ", " snmp_sess_read() " and " snmp_sess_timeout()
+provide an interface for the use of the
+.BR select (2)
+system call so that SNMP transactions for a single session can occur
+asynchronously.
+.PP
+.B snmp_sess_select_info()
+is passed the information that would have been passed to
+.BR select (2)
+in the absence of SNMP. For example, this might include file
+descriptors associated with the main loop of a graphical
+application. This information is modified so that SNMP will get the
+service it requires from the call to
+.BR select (2).
+In this case,
+.IR numfds ", " fdset " and " timeout
+correspond to the
+.IR nfds ", " readfds " and " timeout
+arguments to
+.BR select (2)
+respectively. The only exception is that timeout must ALWAYS point to
+an allocated (but perhaps uninitialized)
+.I struct timeval
+(it cannot be NULL as for
+.BR select (2)).
+If
+.I timeout
+would have been passed as NULL,
+.I block
+is instead set to true, and
+.I timeout
+is treated as undefined. This same rule applies upon return from
+.BR snmp_select_info() .
+.PP
+After calling
+.B snmp_sess_select_info() ,
+.BR select (2)
+should be called with the returned data. When it returns,
+.B snmp_sess_read()
+should then be called with the
+.I fd_set
+returned from
+.BR select (2).
+This will read any input from this session's SNMP socket. If
+.BR select (2)
+times out (that is, it returns zero),
+.B snmp_sess_timeout()
+should be called to see if a timeout has occurred on the SNMP
+session.
+.PP
+.I snmp_sess_synch_response
+is a convenience routine that will send the request,
+wait for the response and process it before returning.
+See the descriptions of
+.I "snmp_sess_send" ", " "snmp_sess_read"
+etc for details.
+.SH DIAGNOSTICS
+.PP
+Error return status from
+.B snmp_sess_open()
+is indicated by return of a NULL pointer.
+Error return status from
+.B snmp_sess_close()
+and
+.B snmp_sess_send()
+is indicated by a return value of 0. A successful status will return
+1.
+.PP
+Further information can be obtained by using
+.B snmp_sess_error()
+to see what type of error has occurred. This function returns the
+SNMP
+.I snmp_errno
+variable, the value of the system
+.I errno
+variable, and a string interpretation of both variables. The string
+must be freed after use by the caller.
+.PP
+For errors returned by
+.BR snmp_sess_open() ,
+use the corresponding function
+.B snmp_error()
+instead of
+.BR snmp_sess_error() .
+.PP
+Consult snmp_api.h for the complete set of SNMP library
+error values.
+The SNMP library error value
+.IR snmperr
+can be one of the following values:
+.RS 2n
+.IP SNMPERR_GENERR \w'SNMPERR_BAD_REPETITIONS'u+2n
+A generic error occurred.
+.IP SNMPERR_BAD_LOCPORT \w'SNMPERR_BAD_REPETITIONS'u+2n
+The local port was bad because it had already been
+allocated or permission was denied.
+.IP SNMPERR_BAD_ADDRESS \w'SNMPERR_BAD_REPETITIONS'u+2n
+The host name or address given was not useable.
+.IP SNMPERR_BAD_SESSION \w'SNMPERR_BAD_REPETITIONS'u+2n
+The specified session was not open.
+.IP SNMPERR_TOO_LONG \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_NO_SOCKET \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_V2_IN_V1 \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_V1_IN_V2 \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_REPEATERS \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_REPETITIONS \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_ASN1_BUILD \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_SENDTO \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_RCVFROM \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_PARSE \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_VERSION \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_COMMUNITY \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_NOAUTH_DESPRIV \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_ABORT \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_UNKNOWN_PDU \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_TIMEOUT \w'SNMPERR_BAD_REPETITIONS'u+2n
+.RE
+.PP
+.SH "SEE ALSO"
+.BR select "(2), " snmp_api "(3), " snmp_api.h
diff --git a/man/netsnmp_session_api.3.def b/man/netsnmp_session_api.3.def
new file mode 100644
index 0000000..7164d36
--- /dev/null
+++ b/man/netsnmp_session_api.3.def
@@ -0,0 +1,281 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP COPYING file for more details and other copyrights
+.\" that may apply:
+.\" /***********************************************************
+.\" Copyright 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.
+.\" ******************************************************************/
+.TH NETSNMP_SESSION_API 3 "19 May 2011" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmp_sess_init,
+snmp_open,
+snmp_send,
+snmp_async_send,
+snmp_select_info,
+snmp_read,
+snmp_timeout,
+snmp_synch_response,
+snmp_close,
+snmp_perror,
+snmp_sess_perror,
+snmp_error,
+snmp_api_errstring \- netsnmp_session_api functions
+.SH SYNOPSIS
+.B #include <net-snmp/session_api.h>
+.PP
+.BI "void snmp_sess_init ( netsnmp_session*" "sess" );
+.PP
+.BI "netsnmp_session* snmp_open ( netsnmp_session *" "sess");
+.RS
+.I /* Input parameter not used in active sessions */
+.RE
+.PP
+.BI "int snmp_send ( netsnmp_session *" "session,"
+.RS
+.BI "netsnmp_pdu *" "pdu" );
+.RE
+.PP
+.BI "int snmp_async_send ( netsnmp_session *" "session,"
+.RS
+.BI " netsnmp_pdu *" pdu ", "
+.br
+.BI " snmp_callback " callback ", "
+.br
+.BI " void *" callbackData ");"
+.RE
+.PP
+.BI "int snmp_select_info ( int * " numfds, "fd_set *" fdset,
+.RS
+.BI "struct timeval *" timeout, "int *" block );
+.RE
+.PP
+.BI "void snmp_read ( fd_set *" fdset );
+.PP
+.B void snmp_timeout ( void );
+.PP
+.BI "int snmp_synch_response ( netsnmp_session *" "session,"
+.RS
+.BI "netsnmp_pdu *" "pdu" ", "
+.br
+.BI "netsnmp_pdu **" "response" );
+.RE
+.PP
+.BI "int snmp_close ( netsnmp_session *" session );
+.br
+.B "int snmp_close_sessions ( void );
+.PP
+.SS Error Reporting
+.I (Move to output_api(3))
+.br
+.BI "void snmp_error ( netsnmp_session *session,
+.RS
+.BI "int *" pcliberr, "int *" psnmperr, "char **" pperrstring );
+.RE
+.PP
+.BI "char *snmp_api_errstring ( int" snmperr );
+.PP
+.BI "void snmp_perror ( char *" msg );
+.RS
+.I /* for parsing errors only */
+.RE
+.PP
+.BI "void snmp_sess_perror (char *" msg, "netsnmp_session *" sess );
+.RS
+.I /* all other SNMP library errors */
+.RE
+.PP
+.SH DESCRIPTION
+.I Snmp_sess_init
+prepares a netsnmp_session that sources transport characteristics
+and common information that will be used for a set of SNMP transactions.
+After this structure is passed to
+.I snmp_open
+to create an SNMP session, the structure is not used.
+.PP
+.I Snmp_open
+returns a pointer to a newly-formed
+.I netsnmp_session
+object, which the application must use to reference the
+active SNMP session.
+.PP
+.I snmp_send
+and
+.I snmp_async_send()
+each take as input a pointer to a
+.I netsnmp_pdu
+object.
+This structure contains information that describes a transaction
+that will be performed over an open session.
+.PP
+Consult snmp_api.h for the definitions of these structures.
+.PP
+With the
+.I snmp_async_send()
+call,
+.I snmp_read
+will invoke the specified callback when the response is received.
+.PP
+.I Snmp_read, snmp_select_info,
+and
+.I snmp_timeout
+provide an interface for the use of the
+.IR select(2)
+system call so that SNMP transactions can occur asynchronously.
+.PP
+.I Snmp_select_info
+is given the information that would have been passed to
+.I select
+in the absence of SNMP. For example, this might include window update information.
+This information is modified so that SNMP will get the service it requires from the
+call to
+.I select.
+In this case,
+.I numfds, fdset,
+and
+.I timeout
+correspond to the
+.I nfds, readfds,
+and
+.I timeout
+arguments to
+.I select,
+respectively. The only exception is that timeout must always point to an allocated (but perhaps uninitialized)
+.I struct timeval.
+If
+.I timeout
+would have been passed as NULL,
+.I block
+is set to true, and
+.I timeout
+is treated as undefined. This same rule applies upon return from
+.I snmp_select_info.
+.PP
+After calling
+.I snmp_select_info, select
+is called with the returned data. When select returns,
+.I snmp_read
+should be called with the
+.I fd_set
+returned from
+.I select
+to read each SNMP socket that has input.
+If
+.I select
+times out,
+.I snmp_timeout
+should be called to see if the timeout was intended for SNMP.
+.PP
+.I snmp_synch_response
+is a convenience routine that will send the request,
+wait for the response and process it before returning.
+See the descriptions of
+.I "snmp_send" ", " "snmp_read"
+etc for details.
+.SH DIAGNOSTICS
+.PP
+Previous versions of the library used
+.IR snmp_get_errno
+to read the global variable
+.I snmp_errno
+which may have held the error status within the SNMP library.
+The existing method
+.I snmp_perror
+should be used to log ASN.1 coding errors only.
+.PP
+The new method
+.I snmp_sess_perror
+is provided to capture errors that occur during the processing
+of a particular SNMP session.
+.I Snmp_sess_perror
+calls
+.IR snmp_error
+function to obtain the "C" library error
+.I errno
+, the SNMP library error
+.I snmperr
+, and the SNMP library detailed error message
+that is associated with an error that occurred during a given session.
+.PP
+Note that in all cases except one,
+.IR snmp_sess_perror
+should be handed the
+.I netsnmp_session *
+pointer returned from
+.IR snmp_open.
+If
+.IR snmp_open
+returns a null pointer, pass the INPUT
+.I netsnmp_session *
+pointer used to call
+.IR snmp_open.
+.PP
+Error return status from
+.I snmp_close
+and
+.I snmp_send
+is indicated by return of 0. A successful status will return a 1 for
+.I snmp_close
+and the request id of the packet for
+.I snmp_send.
+Upon successful return from
+.I snmp_send
+the pdu will be freed by the library.
+.PP
+Consult snmp_api.h for the complete set of SNMP library
+error values.
+The SNMP library error value
+.IR snmperr
+can be one of the following values:
+.RS 2n
+.IP SNMPERR_GENERR \w'SNMPERR_BAD_REPETITIONS'u+2n
+A generic error occurred.
+.IP SNMPERR_BAD_LOCPORT \w'SNMPERR_BAD_REPETITIONS'u+2n
+The local port was bad because it had already been
+allocated or permission was denied.
+.IP SNMPERR_BAD_ADDRESS \w'SNMPERR_BAD_REPETITIONS'u+2n
+The host name or address given was not useable.
+.IP SNMPERR_BAD_SESSION \w'SNMPERR_BAD_REPETITIONS'u+2n
+The specified session was not open.
+.IP SNMPERR_TOO_LONG \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_NO_SOCKET \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_V2_IN_V1 \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_V1_IN_V2 \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_REPEATERS \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_REPETITIONS \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_ASN1_BUILD \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_SENDTO \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_PARSE \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_BAD_VERSION \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_NOAUTH_DESPRIV \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_ABORT \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_UNKNOWN_PDU \w'SNMPERR_BAD_REPETITIONS'u+2n
+.IP SNMPERR_TIMEOUT \w'SNMPERR_BAD_REPETITIONS'u+2n
+.RE
+.PP
+A string representation of the error code can be obtained with
+.IR snmp_api_errstring ,
+and a standard error message may be printed using
+.I snmp_perror
+that functions like the
+.I perror
+standard routine.
+.SH "SEE ALSO"
+select(2), snmp_api.h
diff --git a/man/netsnmp_trap_api.3.def b/man/netsnmp_trap_api.3.def
new file mode 100644
index 0000000..424eb6d
--- /dev/null
+++ b/man/netsnmp_trap_api.3.def
@@ -0,0 +1,58 @@
+.TH NETSNMP_TRAP_API 3 "13 Aug 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+send_easy_trap,
+send_trap_vars,
+send_v2trap - send TRAPs or INFORMs from a Net-SNMP MIB module
+.SH SYNOPSIS
+.B #include <net-snmp/agent/agent_trap.h>
+.PP
+.BI "void send_easy_trap(int " trap ", int " specific ");"
+.PP
+.BI "void send_trap_vars(int " trap ", int " specific ", struct variable_list *" vars ");"
+.PP
+.BI "void send_v2trap(struct variable_list *" vars ");"
+.SH DESCRIPTION
+These three routines may be used to send traps from a MIB module
+within the Net-SNMP agent (including an AgentX subagent).
+.PP
+.B send_easy_trap()
+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.
+.PP
+.B send_trap_vars()
+is similar, but appends the supplied list of variable bindings to the
+traps that are sent.
+.PP
+.B send_v2trap()
+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 configuredq list of inform sinks.
+Sinks that can only handle SNMPv1 traps are skipped.
+.PP
+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.
+.nf
+I.e. it's
+ ___ trapsink
+ /
+ send_easy_trap \___ [ Trap ] ____ trap2sink
+ ___ [ Generator ]
+ send_v2trap / [ ] ----- informsink
+ \____
+ trapsess
+
+*Not*
+ send_easy_trap -------------------> trapsink
+ send_v2trap -------------------> trap2sink
+ ???? -------------------> informsink
+ ???? -------------------> trapsess
+.fi
+.SH WARNINGS
+These routines are used to send the traps immediately they are called.
+Invoking them at the appropriate time is left to the MIB module programmer.
+.SH "SEE ALSO"
+.BR snmpd.conf "(5), " snmptrapd "(8)"
diff --git a/man/netsnmp_varbind_api.3.def b/man/netsnmp_varbind_api.3.def
new file mode 100644
index 0000000..d950adb
--- /dev/null
+++ b/man/netsnmp_varbind_api.3.def
@@ -0,0 +1,216 @@
+.TH NETSNMP_VARBIND_API 3 "13 Aug 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmp_pdu_add_variable,
+snmp_varlist_add_variable,
+snmp_add_null_var,
+snmp_clone_varbind,
+snmp_set_var_objid,
+snmp_set_var_value,
+snmp_set_var_typed_value,
+snmp_set_var_typed_integer,
+print_variable,
+fprint_variable,
+snprint_variable,
+print_value,
+fprint_value,
+snprint_value,
+snmp_free_var,
+snmp_free_varbind - netsnmp_varbind_api functions
+.SH SYNOPSIS
+.B #include <net-snmp/varbind_api.h>
+.SS Creation
+.PP
+.B "netsnmp_variable_list *snmp_pdu_add_variable("
+.br
+.BI " netsnmp_pdu *" pdu ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ","
+.br
+.BI " u_char " type ", const void *" value ", size_t " len ");"
+.br
+.B "netsnmp_variable_list *snmp_varlist_add_variable("
+.br
+.BI " netsnmp_variable_list *" varlist ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ","
+.br
+.BI " u_char " type ", const void *" value ", size_t " len ");"
+.br
+.B "netsnmp_variable_list *snmp_add_null_var("
+.br
+.BI " netsnmp_pdu *" pdu ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ");"
+.PP
+.B "netsnmp_variable_list *snmp_clone_varbind("
+.br
+.BI " netsnmp_variable_list *" varlist ");"
+.SS Setting Values
+.PP
+.BI "int snmp_set_var_objid( netsnmp_variable_list* " variable ","
+.br
+.BI " const oid * " objid ", size_t " objidlen ");"
+.br
+.BI "int snmp_set_var_value( netsnmp_variable_list* " variable ","
+.br
+.BI " const void * " value ", size_t " vallen ");"
+.br
+.BI "int snmp_set_var_typed_value( netsnmp_variable_list* " variable ","
+.br
+.BI " u_char " type ","
+.br
+.BI " const void * " value ", size_t " vallen ");"
+.br
+.BI "int snmp_set_var_typed_integer( netsnmp_variable_list* " variable ","
+.br
+.BI " u_char " type ", long " value ");"
+.br
+.SS Output
+.PP
+.BI "void print_variable(const oid *" "objid" ", size_t " "objidlen" ","
+.br
+.BI " const netsnmp_variable_list *" variable ");"
+.br
+.BI "void fprint_variable(FILE *" fp ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ","
+.br
+.BI " const netsnmp_variable_list *" variable ");"
+.br
+.BI "int snprint_variable(char *" "buf" ", size_t " "len" ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ","
+.br
+.BI " const netsnmp_variable_list *" variable ");"
+.PP
+.BI "void print_value(const oid *" objid ", size_t " objidlen ","
+.br
+.BI " const netsnmp_variable_list *" variable ");"
+.br
+.BI "void fprint_value(FILE *" fp ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ","
+.br
+.BI " const netsnmp_variable_list *" variable ");"
+.br
+.BI "int snprint_value(char *" buf ", size_t " "len" ","
+.br
+.BI " const oid *" objid ", size_t " objidlen ","
+.br
+.BI " const netsnmp_variable_list *" variable ");"
+.br
+.br
+.SS Deletion
+.PP
+.BI "void snmp_free_var( netsnmp_variable_list *" variable ");"
+.br
+.BI "void snmp_free_varbind( netsnmp_variable_list *" variables ");"
+.br
+.PP
+.SH DESCRIPTION
+The functions dealing with variable bindings fall into four groups -
+dealing with the creation, setting of values, output and deletion of varbinds.
+.SS Creation
+.B snmp_pdu_add_variable
+will create a new varbind structure, initialised with the name (
+.IR objid ", " objidlen
+), syntax (
+.I type
+) and value (
+.I value ", " len
+) provided.
+This varbind is then added to the end of the varbind list in
+the given PDU.
+.PP
+.B snmp_varlist_add_variable
+is similar, but appends the new varbind to the end of the
+varbind list provided.
+When adding the first varbind to an empty list, simply
+pass the address of the head of the list:
+.IP
+ netsnmp_variable_list *vl = NULL;
+ snmp_varlist_add_variable(
+ &vl, name1, name1_len,
+ ASN_\fITYPE\fP, &val1, val1_len);
+ snmp_varlist_add_variable(
+ &vl, name2, name2_len,
+ ASN_\fITYPE\fP, &val2, val2_len);
+.PP
+In both cases, the routine will return a pointer to the new
+varbind structure (or NULL if the varbind creation fails).
+.PP
+.B snmp_add_null_var
+is a convenience function to add an empty varbind to the PDU.
+without needing to specify the NULL value explicitly.
+This is the normal mechanism for constructing a GET (or similar)
+information retrieval request.
+.br
+Again, this returns a pointer to the new varbind, or NULL.
+.PP
+.B snmp_clone_varbind
+creates a copy of each varbind in the specified list,
+returning a pointer to the head of the new list
+(or NULL if the cloning fails).
+.br
+.SS Setting of values
+.B snmp_set_var_objid
+sets the name of the varbind structure to the specified OID.
+.br
+.B snmp_set_var_typed_value
+sets the syntax type and value of the varbind structure.
+.br
+.B snmp_set_var_value
+sets the value of the varbind structure, leaving the syntax type unchanged.
+.br
+.B snmp_set_var_typed_integer
+is a convenience function to set the syntax type and value for
+a 32-bit integer-based varbind.
+.PP
+All four of these return 0 if the assignment is successful,
+or 1 if it is not.
+.SS Output
+.B print_variable
+will take an object identifier (as returned by
+.BR read_objid ", " snmp_parse_oid " or " get_module_node )
+and an instance of such a variable, and prints to the standard output
+the textual form of the object identifier together with the value
+of the variable.
+.PP
+.B fprint_variable
+does the same, but prints to the FILE pointer specified by the initial
+parameter.
+.PP
+.B snprint_variable
+prints the same information into the buffer pointed to by
+.I buf
+which is of length
+.IR len .
+It returns the number of characters printed, or -1 if the
+buffer was not large enough. In the latter case,
+.I buf
+will typically contained a truncated version of the information (but
+this behaviour is not guaranteed). This function replaces the
+obsolete function
+.BR sprint_variable .
+.PP
+.BR print_value ,
+.BR fprint_value ,
+and
+.B snprint_value
+do the same as the equivalent
+.B print_variable
+routines, but only displaying the value of the variable, without the
+corresponding object identifier.
+.PP
+For displaying the OID of a varbind, see \fBmin_api\fP(3).
+.br
+.SS Deletion
+.B snmp_free_var
+releases all memory used by the given varbind structure.
+.br
+.B snmp_free_varbind
+releases all memory used by each varbind structure in the varbind list provided.
+.br
+.SH "SEE ALSO"
+.BR pdu_api "(3)"
+.BR mib_api "(3)"
diff --git a/man/snmp-bridge-mib.1 b/man/snmp-bridge-mib.1
new file mode 100644
index 0000000..80f2b5e
--- /dev/null
+++ b/man/snmp-bridge-mib.1
@@ -0,0 +1,208 @@
+'\" t
+.\" Title: snmp-bridge-mib
+.\" Author: Jens Osterkamp <jens@linux.vnet.ibm.com>
+.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
+.\" Date: 03/26/2010
+.\" Manual: Net-SNMP
+.\" Source: http://www.ibm.com/ v6
+.\" Language: English
+.\"
+.TH "SNMP\-BRIDGE\-MIB" 1 "26 Mar 2010" "http://www\&.ibm\&.com/ v6" "Net\-SNMP"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+snmp-bridge-mib \- provide Linux bridge information via SNMP
+.SH "SYNOPSIS"
+.HP \w'\fBsnmp\-bridge\-mib\fR\ 'u
+\fBsnmp\-bridge\-mib\fR {bridge}
+.SH "ARGUMENTS"
+.PP
+The following arguments are required:
+.PP
+\fBbridge\fR
+.RS 4
+The name of the Linux bridge for which you want to provide information via SNMP, e\&.g\&. br0\&.
+.RE
+.SH "DESCRIPTION"
+.PP
+The snmp\-bridge\-mib is an extension to net\-snmp\&. It collects information about a bridge in a Linux system and exports them for query from other (remote) systems for management purposes\&.
+.SH "CONFIGURATION:"
+.PP
+The preferred method of snmp\-bridge\-mib to attach to net\-snmp is agentx\&. For this to work, you will have to add the following line to /etc/snmp/snmpd\&.conf,
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+ master agentx
+
+.fi
+.if n \{\
+.RE
+.\}
+.PP
+restart snmpd and start snmp\-bridge\-mib\&. snmp\-bridge\-mib will then connect to the running snmpd daemon\&.
+.PP
+Another way of attaching snmp\-bridge\-mib to is to run it as an embedded perl module\&. You have to add
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+ perl do "path to location of snmp\-bridge\-mib"
+
+.fi
+.if n \{\
+.RE
+.\}
+.PP
+and restart snmpd\&.
+.SH "EXAMPLE:"
+.PP
+Follow the instructions in this manpage and type
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+ perl /usr/bin/snmp\-bridge\-mib br0
+
+.fi
+.if n \{\
+.RE
+.\}
+.PP
+You\'ll get the following output:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+ registering at \&.1\&.3\&.6\&.1\&.2\&.1\&.17
+ running as a subagent\&.
+ dot1qbridge agent started\&.
+ NET\-SNMP version 5\&.4\&.2\&.1 AgentX subagent connected
+
+.fi
+.if n \{\
+.RE
+.\}
+.PP
+Now it\'s time for a first test:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+ $ export MIBS=+BRIDGE\-MIB
+ $ snmpwalk localhost \&.1\&.3\&.6\&.1\&.2\&.1\&.17
+
+.fi
+.if n \{\
+.RE
+.\}
+.PP
+The output produced should look like
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+ BRIDGE\-MIB::dot1dStpBridgeHelloTime = INTEGER: 199 centi\-seconds
+ BRIDGE\-MIB::dot1dStpBridgeForwardDelay = INTEGER: 1499 centi\-seconds
+ BRIDGE\-MIB::dot1dStpPort\&.1 = INTEGER: 1
+ BRIDGE\-MIB::dot1dStpPort\&.3 = INTEGER: 3
+ BRIDGE\-MIB::dot1dStpPortPriority\&.1 = INTEGER: 32
+ BRIDGE\-MIB::dot1dStpPortPriority\&.3 = INTEGER: 32
+ BRIDGE\-MIB::dot1dStpPortState\&.1 = INTEGER: disabled(1)
+ BRIDGE\-MIB::dot1dStpPortState\&.3 = INTEGER: disabled(1)
+ BRIDGE\-MIB::dot1dStpPortEnable\&.1 = INTEGER: disabled(2)
+ BRIDGE\-MIB::dot1dStpPortEnable\&.3 = INTEGER: disabled(2)
+ BRIDGE\-MIB::dot1dStpPortPathCost\&.1 = INTEGER: 2
+ BRIDGE\-MIB::dot1dStpPortPathCost\&.3 = INTEGER: 4
+ BRIDGE\-MIB::dot1dStpPortDesignatedRoot\&.1 = STRING: "8000\&.001018382c78"
+ BRIDGE\-MIB::dot1dStpPortDesignatedRoot\&.3 = STRING: "8000\&.001018382c78"
+ BRIDGE\-MIB::dot1dStpPortDesignatedCost\&.1 = INTEGER: 0
+ BRIDGE\-MIB::dot1dStpPortDesignatedCost\&.3 = INTEGER: 0
+ BRIDGE\-MIB::dot1dStpPortDesignatedBridge\&.1 = STRING: "8000\&.001018382c78"
+ BRIDGE\-MIB::dot1dStpPortDesignatedBridge\&.3 = STRING: "8000\&.001018382c78"
+ BRIDGE\-MIB::dot1dStpPortDesignatedPort\&.1 = STRING: "32769"
+ BRIDGE\-MIB::dot1dStpPortDesignatedPort\&.3 = STRING: "32770"
+ BRIDGE\-MIB::dot1dStpPortPathCost32\&.1 = INTEGER: 2
+ BRIDGE\-MIB::dot1dStpPortPathCost32\&.3 = INTEGER: 4
+ BRIDGE\-MIB::dot1dTpLearnedEntryDiscards = Counter32: 0
+ BRIDGE\-MIB::dot1dTpAgingTime = INTEGER: 300 seconds
+ BRIDGE\-MIB::dot1dTpFdbAddress\&.\'\&.\&.\&.8,x\' = STRING: 0:10:18:38:2c:78
+ BRIDGE\-MIB::dot1dTpFdbAddress\&.\'\&.!^/B|\' = STRING: 0:21:5e:2f:42:7c
+ BRIDGE\-MIB::dot1dTpFdbPort\&.\'\&.\&.\&.8,x\' = INTEGER: 1
+ BRIDGE\-MIB::dot1dTpFdbPort\&.\'\&.!^/B|\' = INTEGER: 3
+ BRIDGE\-MIB::dot1dTpFdbStatus\&.\'\&.\&.\&.8,x\' = INTEGER: learned(3)
+ BRIDGE\-MIB::dot1dTpFdbStatus\&.\'\&.!^/B|\' = INTEGER: learned(3)
+ BRIDGE\-MIB::dot1dTpPort\&.1 = INTEGER: 1
+ BRIDGE\-MIB::dot1dTpPort\&.3 = INTEGER: 3
+ BRIDGE\-MIB::dot1dTpPortMaxInfo\&.1 = INTEGER: 1500 bytes
+ BRIDGE\-MIB::dot1dTpPortMaxInfo\&.3 = INTEGER: 1500 bytes
+ BRIDGE\-MIB::dot1dTpPortInFrames\&.1 = Counter32: 18082 frames
+ BRIDGE\-MIB::dot1dTpPortInFrames\&.3 = Counter32: 1546072 frames
+ BRIDGE\-MIB::dot1dTpPortOutFrames\&.1 = Counter32: 11601 frames
+ BRIDGE\-MIB::dot1dTpPortOutFrames\&.3 = Counter32: 10988 frames
+ BRIDGE\-MIB::dot1dTpPortInDiscards\&.1 = Counter32: 0 frames
+ BRIDGE\-MIB::dot1dTpPortInDiscards\&.3 = Counter32: 0 frames
+
+.fi
+.if n \{\
+.RE
+.\}
+.SH "BUGS"
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 1.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP " 1." 4.2
+.\}
+snmp\-bridge\-mib currently only supports one bridge which has to be specified on the commandline\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 2.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP " 2." 4.2
+.\}
+Not all elements of RFC 4188 because they are either not available in sysfs or difficult to extract from the existing data\&.
+.RE
+.PP
+.SH "SEE ALSO"
+.PP
+\fBsnmpd.conf\fR(5),
+\fBNet::SNMP\fR(3)
+.SH "AUTHOR"
+.PP
+\fBJens Osterkamp\fR <\&jens@linux\&.vnet\&.ibm\&.com\&>
+.RS 4
+Developer
+.RE
+.SH "COPYRIGHT"
+.br
+Copyright \(co 2009, 2010 IBM Corp., All Rights Reserved
+.br
+.PP
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+.PP
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software\&.
+.PP
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\&. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE\&.
+.sp
diff --git a/man/snmp.conf.5.def b/man/snmp.conf.5.def
new file mode 100644
index 0000000..46203d0
--- /dev/null
+++ b/man/snmp.conf.5.def
@@ -0,0 +1,414 @@
+.TH SNMP.CONF 5 "21 Apr 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmp.conf - configuration files for the Net-SNMP applications
+.SH DESCRIPTION
+Applications built using the Net-SNMP libraries typically use one or
+more configuration files to control various aspects of their operation.
+These files (\fBsnmp.conf\fR and \fBsnmp.local.conf\fR) can be located
+in one of several locations, as described in the \fIsnmp_config(5)\fR
+manual page.
+.PP
+In particular, \fCSYSCONFDIR/snmp/snmp.conf\fR is a common file,
+containing the settings shared by all users of the system.
+\fC~/.snmp/snmp.conf\fR is a personal file, with the settings
+specific to a particular user.
+.SH HOST-SPECIFIC FILES
+Host-specific files may also be loaded and will be searched for if a
+transport name is specified that matches a \fIPATH/hosts/HOST.conf\fR
+file. For example, if you wanted a particular host to use SNMPv2c by
+default you could create a ~/.snmp/hosts/NAME.conf file and in it put:
+.RS
+.PP
+defVersion 2c
+.RE
+.PP
+Any connections set to connect to the hostname \fINAME\fR will use
+SNMPv2c. Also see the \fItransport\fR token below for additional
+host-specific examples.
+.PP
+Host-specific configuration files are loaded at the time the
+connection is opened. Thus they're generally loaded after all other
+configuration files and can be used to override settings from the
+generic files.
+.PP
+To avoid loading any host-specific config files set
+"dontLoadHostConfig true" in your snmp.conf file.
+.SH COMMAND-LINE OPTIONS
+All of the tokens described in this file can be used on the command
+line of Net-SNMP applications as well by prefixing them with "\-\-".
+EG, specifying \fI\-\-dontLoadHostConfig=true\fR on the command line will
+turn of loading of the host specific configuration files.
+.SH IMPORTANT NOTE
+Several of these directives may contain sensitive information
+(such as pass phrases). Configuration files that include such
+settings should only be readable by the user concerned.
+.PP
+As well as application-specific configuration tokens, there are
+several directives that relate to standard library behaviour,
+relevant to most Net-SNMP applications. Many of these correspond
+to standard command-line options, which are described in the
+\fIsnmpcmd(1)\fR manual page.
+.PP
+These directives can be divided into several distinct groups.
+.SH CLIENT BEHAVIOUR
+.IP "defDomain application domain"
+The transport domain that should be used for a certain application type unless
+something else is specified.
+.IP "defTarget application domain target"
+The target that should be used for connections to a certain application if the
+connection should be in a specific domain.
+.IP "defaultPort PORT"
+defines the default UDP port that client SNMP applications will
+attempt to connect to. This can be overridden by explicitly
+including a port number in the \fIAGENT\fR specification.
+See the \fIsnmpcmd(1)\fR manual page for more details.
+.IP
+If not specified, the default value for this token is 161.
+.IP "transport HOSTSPECIFIER"
+This special token should go into a hostname-specific configuration
+file in a \fIhosts\fR sub-directory. For example if the file
+\fIhosts/foo.conf\fR exists in the search path it will be loaded if a
+transport name of \fIfoo\fR was used. Within the foo.conf file you may
+put both general snmp.conf settings as well as a special
+\fItransport\fR string to specify the destination to connect to. For
+example, putting:
+.RS
+.IP
+transport tcp:foo.example.com:9876
+.RE
+.IP
+in the \fIhosts/foo.conf\fR file will make applications referencing
+the \fIfoo\fR hostname (e.g. \fIsnmpget\fR) to actually connect via
+TCP to \fIfoo.exmaple.com\fR on port 9876.
+.IP "defVersion (1|2c|3)"
+defines the default version of SNMP to use.
+This can be overridden using the \fB\-v\fR option.
+.IP "defCommunity STRING"
+defines the default community to use for SNMPv1 and SNMPv2c requests.
+This can be overridden using the \fB\-c\fR option.
+.\".IP "dumpPacket (1|yes|true|0|no|false)"
+.IP "alias NAME DEFINITION"
+Creates an aliased tied to NAME for a given transport definition. The
+alias can the be referred to using an alias: prefix. Eg, a line of
+"alias here udp:127.0.0.1:6161" would allow you to use a destination
+host of "alias:here" instead of "udp:127.0.0.1:6161". This becomes
+more useful with complex transport addresses involving IPv6 addresses,
+etc.
+.IP "dumpPacket yes"
+defines whether to display a hexadecimal dump of the raw SNMP requests
+sent and received by the application.
+This is equivalent to the \fB\-d\fR option.
+.IP "doDebugging (1|0)"
+turns on debugging for all applications run if set to 1.
+.\"
+.\" XXX - why not full boolean values?
+.\" what is the purpose of this directive ??
+.\"
+.IP "debugTokens TOKEN[,TOKEN...]"
+defines the debugging tokens that should be turned on when
+\fIdoDebugging\fR is set.
+This is equivalent to the \fB\-D\fR option.
+.\".IP "16bitIDs (1|yes|true|0|no|false)"
+.IP "16bitIDs yes"
+restricts requestIDs, etc to 16-bit values.
+.IP
+The SNMP specifications define these ID fields as 32-bit quantities,
+and the Net-SNMP library typically initialises them to random values
+for security.
+However certain (broken) agents cannot handle ID values greater than
+2^16 - this option allows interoperability with such agents.
+.IP "clientaddr [<transport-specifier>:]<transport-address>"
+specifies the source address to be used by command-line applications
+when sending SNMP requests. See \fIsnmpcmd(1)\fR for more information
+about the format of addresses.
+.IP
+This value is also used by \fBsnmpd\fR when generating notifications.
+.\"
+.\" But not responses to an incoming request?
+.\" What about snmptrapd?
+.\"
+.IP "clientRecvBuf INTEGER"
+specifies the desired size of the buffer to be used when receiving
+responses to SNMP requests.
+If the OS hard limit is lower than the \fIclientRecvBuf\fR value,
+then this will be used instead.
+Some platforms may decide to increase the size of the buffer
+actually used for internal housekeeping.
+.IP
+This directive will be ignored if the platforms does not support
+\fIsetsockopt()\fR.
+.IP "clientSendBuf INTEGER"
+is similar to \fIclientRecvBuf\fR, but applies to the size
+of the buffer used when sending SNMP requests.
+.IP "noRangeCheck yes"
+disables the validation of varbind values against the MIB definition
+for the relevant OID.
+This is equivalent to the \fB\-Ir\fR option.
+.IP
+This directive is primarily relevant to the \fBsnmpset\fR command,
+but will also apply to any application that calls \fIsnmp_add_var()\fR
+.\" what else ??
+with a non-NULL value.
+.\"
+.\" XXX - including snmpd ??
+.\"
+.IP "noTokenWarnings"
+disables warnings about unknown config file tokens.
+.IP "reverseEncodeBER (1|yes|true|0|no|false)"
+controls how the encoding of SNMP requests is handled.
+.IP
+The default behaviour is to encode packets starting from the end of
+the PDU and working backwards.
+This directive can be used to disable this behaviour, and build
+the encoded request in the (more obvious) forward direction.
+.IP
+It should not normally be necessary to change this setting, as
+the encoding is basically the same in either case - but working
+backwards typically produces a slightly more efficient encoding,
+and hence a smaller network datagram.
+.IP "dontLoadHostConfig (1|yes|true|0|no|false)"
+Specifies whether or not the host-specific configuration files are
+loaded. Set to "true" to turn off the loading of the host specific
+configuration files.
+.IP "retries INTEGER"
+Specifies the number of retries to be used in the requests.
+.IP "timeout INTEGER"
+Specifies the timeout in seconds between retries.
+.\"
+.\" XXX - It is probably about time to remove this choice!
+.\"
+.SH SNMPv3 SETTINGS
+.IP "defSecurityName STRING"
+defines the default security name to use for SNMPv3 requests.
+This can be overridden using the \fB\-u\fR option.
+.IP "defSecurityLevel noAuthNoPriv|authNoPriv|authPriv"
+defines the default security level to use for SNMPv3 requests.
+This can be overridden using the \fB\-l\fR option.
+.IP
+If not specified, the default value for this token is \fInoAuthNoPriv\fR.
+.\"
+.\" XXX - Is this correct ?
+.\"
+.RS
+.IP "Note:
+\fIauthPriv\fR is only available if the software has been compiled
+to use the OpenSSL libraries.
+.RE
+.IP "defPassphrase STRING"
+.IP "defAuthPassphrase STRING"
+.IP "defPrivPassphrase STRING"
+define the default authentication and privacy pass phrases to use
+for SNMPv3 requests.
+These can be overridden using the \fB\-A\fR and \fB\-X\fR options respectively.
+.IP
+The
+.B defPassphrase
+value will be used for the authentication and/or privacy pass phrases
+if either of the other directives are not specified.
+.IP "defAuthType MD5|SHA"
+.IP "defPrivType DES|AES"
+define the default authentication and privacy protocols to use for
+SNMPv3 requests.
+These can be overridden using the \fB\-a\fR and \fB\-x\fR options respectively.
+.IP
+If not specified, SNMPv3 requests will default to MD5 authentication
+and DES encryption.
+.RS
+.IP "Note:
+If the software has not been compiled to use the OpenSSL libraries,
+then only MD5 authentication is supported.
+Neither SHA authentication nor any form of encryption will be available.
+.RE
+.IP "defContext STRING"
+defines the default context to use for SNMPv3 requests.
+This can be overridden using the \fB\-n\fR option.
+.IP
+If not specified, the default value for this token is the default context
+(i.e. the empty string "").
+.IP "defSecurityModel STRING"
+defines the security model to use for SNMPv3 requests.
+The default value is "usm" which is the only widely
+used security model for SNMPv3.
+.IP "defAuthMasterKey 0xHEXSTRING"
+.IP "defPrivMasterKey 0xHEXSTRING"
+.IP "defAuthLocalizedKey 0xHEXSTRING"
+.IP "defPrivLocalizedKey 0xHEXSTRING"
+define the (hexadecimal) keys to be used for SNMPv3 secure communications.
+SNMPv3 keys are frequently derived from a passphrase, as discussed in
+the \fIdefPassphrase\fR section above. However for improved security a
+truely random key can be generated and used instead (which would
+normally has better entropy than a password unless it is
+amazingly long).
+The directives are equivalent to the short-form
+command line options \fB\-3m\fR, \fB\-3M\fR, \fB\-3k\fR, and \fB\-3K\fR.
+.IP
+Localized keys are
+master keys which have been converted to a unique key which is only
+suitable for on particular SNMP engine (agent). The length of the key
+needs to be appropriate for the authentication or encryption type
+being used (auth keys: MD5=16 bytes, SHA1=20 bytes;
+priv keys: DES=16 bytes (8
+bytes of which is used as an IV and not a key), and AES=16 bytes).
+.IP "sshtosnmpsocket PATH"
+Sets the path of the \fBsshtosnmp\fR socket created by an application
+(e.g. snmpd) listening for incoming ssh connections through the
+\fBsshtosnmp\fR unix socket.
+.IP "sshtosnmpsocketperms MODE [OWNER [GROUP]]"
+Sets the mode, owner and group of the \fBsshtosnmp\fR socket created by
+an application (e.g. \fBsnmpd\fR) listening for incoming ssh connections
+through the \fBsshtosnmp\fR unix socket. The socket needs to be read/write
+privileged for SSH users that are allowed to connect to the SNMP
+service (VACM access still needs to be granted as well, most likely
+through the TSM security model).
+.IP "sshusername NAME"
+Sets the SSH user name for logging into the remote system.
+.IP "sshpubkey FILE"
+Set the public key file to use when connecting to a remote system.
+.IP "sshprivkey FILE"
+Set the private key file to use when connecting to a remote system.
+.\"
+.\" XXX - are these lengths still correct ?
+.\"
+.SH SERVER BEHAVIOUR
+.IP "persistentDir DIRECTORY"
+defines the directory where \fBsnmpd\fR and \fBsnmptrapd\fR store
+persistent configuration settings.
+.IP
+If not specified, the persistent directory defaults to
+PERSISTENT_DIRECTORY
+.IP "noPersistentLoad yes"
+.IP "noPersistentSave yes"
+disable the loading and saving of persistent configuration information.
+.RS
+.IP "Note:"
+This will break SNMPv3 operations (and other behaviour that relies
+on changes persisting across application restart). Use With Care.
+.RE
+.IP "tempFilePattern PATTERN"
+defines a filename template for creating temporary files,
+for handling input to and output from external shell commands.
+Used by the \fImkstemp()\fR and \fImktemp()\fR functions.
+.IP
+If not specified, the default pattern is \fCNETSNMP_TEMP_FILE_PATTERN\fR.
+.IP "serverRecvBuf INTEGER"
+specifies the desired size of the buffer to be used when receiving
+incoming SNMP requests.
+If the OS hard limit is lower than the \fIserverRecvBuf\fR value,
+then this will be used instead.
+Some platforms may decide to increase the size of the buffer
+actually used for internal housekeeping.
+.IP
+This directive will be ignored if the platforms does not support
+\fIsetsockopt()\fR.
+.IP "serverSendBuf INTEGER"
+is similar to \fIserverRecvBuf\fR, but applies to the size
+of the buffer used when sending SNMP responses.
+.SH MIB HANDLING
+.IP "mibdirs DIRLIST"
+specifies a list of directories to search for MIB files.
+This operates in the same way as the \fB\-M\fR option -
+see \fIsnmpcmd(1)\fR for details.
+Note that this value can be overridden by the
+.B MIBDIRS
+environment variable, and the \fB\-M\fR option.
+.IP "mibs MIBLIST"
+specifies a list of MIB modules (not files) that should be loaded.
+This operates in the same way as the \fB\-m\fR option -
+see \fIsnmpcmd(1)\fR for details.
+Note that this list can be overridden by the
+.B MIBS
+environment variable, and the \fB\-m\fR option.
+.IP "mibfile FILE"
+specifies a (single) MIB file to load, in addition to the
+list read from the \fImibs\fR token (or equivalent configuration).
+Note that this value can be overridden by the
+.B MIBFILES
+environment variable.
+.IP "showMibErrors (1|yes|true|0|no|false)"
+whether to display MIB parsing errors.
+.IP "commentToEOL (1|yes|true|0|no|false)"
+whether MIB parsing should be strict about comment termination.
+Many MIB writers assume that ASN.1 comments extend to the end of
+the text line, rather than being terminated by the next "\-\-" token.
+This token can be used to accept such (strictly incorrect) MIBs.
+.br
+Note that this directive was previous (mis-)named \fIstrictCommentTerm\fR,
+but with the reverse behaviour from that implied by the name.
+This earlier token is still accepted for backwards compatibility.
+.IP "mibAllowUnderline (1|yes|true|0|no|false)"
+whether to allow underline characters in MIB object names and
+enumeration values.
+This token can be used to accept such (strictly incorrect) MIBs.
+.IP "mibWarningLevel INTEGER"
+the minimum warning level of the warnings printed by the MIB parser.
+.SH OUTPUT CONFIGURATION
+.IP "logTimestamp (1|yes|true|0|no|false)"
+Whether the commands should log timestamps with their error/message
+logging or not. Note that output will not look as pretty with
+timestamps if the source code that is doing the logging does
+incremental logging of messages that are not line buffered before
+being passed to the logging routines. This option is only used when file logging is active.
+.IP "printNumericEnums (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-Oe .
+.IP "printNumericOids (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-On .
+.IP "dontBreakdownOids (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-Ob .
+.IP "escapeQuotes (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-OE .
+.IP "quickPrinting (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-Oq .
+.IP "printValueOnly (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-Ov .
+.IP "dontPrintUnits (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-OU .
+.IP "numericTimeticks (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-Ot .
+.IP "printHexText (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-OT .
+.IP "hexOutputLength integer"
+Specifies where to break up the output of hexadecimal strings.
+Set to 0 to disable line breaks. Defaults to 16.
+.IP "suffixPrinting (0|1|2)"
+The value 1 is equivalent to
+.B \-Os
+and the value 2 is equivalent to
+.BR \-OS .
+.IP "oidOutputFormat (1|2|3|4|5|6)"
+Maps \-O options as follow: \-Os=1, \-OS=2, \-Of=3, \-On=4, \-Ou=5.
+The value 6 has no matching \-O option. It suppresses output.
+.IP "extendedIndex (1|yes|true|0|no|false)"
+Equivalent to
+.BR \-OX .
+.IP "noDisplayHint (1|yes|true|0|no|false)"
+Disables the use of DISPLAY-HINT information when parsing indices and
+values to set. Equivalent to
+.BR \-Ih .
+.SH FILES
+.IP "System-wide configuration files:"
+SYSCONFDIR/snmp/snmp.conf
+.br
+SYSCONFDIR/snmp/snmp.local.conf
+.IP "User-specific configuration settings:"
+$HOME/.snmp/snmp.conf
+.br
+$HOME/.snmp/snmp.local.conf
+.IP "Destination host specific files:
+SYSCONFDIR/snmp/hosts/HOSTNAME.conf
+.br
+$HOME/.snmp/hosts/HOSTNAME.conf
+
+.SH "SEE ALSO"
+snmp_config(5), netsnmp_config_api(3), snmpcmd(1).
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/man/snmp_alarm.3.def b/man/snmp_alarm.3.def
new file mode 100644
index 0000000..6c79a20
--- /dev/null
+++ b/man/snmp_alarm.3.def
@@ -0,0 +1,170 @@
+.TH SNMP_ALARM 3 "01 Aug 2002" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmp_alarm_register,
+snmp_alarm_register_hr,
+snmp_alarm_unregister - alarm functions
+.SH SYNOPSIS
+.B #include <net-snmp/utilities.h>
+.PP
+.B "unsigned int"
+.br
+.BI "snmp_alarm_register(unsigned int " seconds ","
+.br
+.BI " unsigned int " flags ","
+.br
+.BI " SNMPAlarmCallback *" f_callback ","
+.br
+.BI " void *" clientarg ");"
+.PP
+.B "unsigned int"
+.br
+.BI "snmp_alarm_register_hr(struct timeval " t ","
+.br
+.BI " unsigned int " flags ","
+.br
+.BI " SNMPAlarmCallback *" f_callback ","
+.br
+.BI " void *" clientarg ");"
+.PP
+.B "void
+.br
+.BI "snmp_alarm_unregister(unsigned int " reg ");"
+.SH DESCRIPTION
+.PP
+These functions implement support for a generic timer handling
+mechanism for multiple parts of an application to register function
+callbacks to happen at a particular time in the future.
+.SH USAGE
+.PP
+The usage is fairly simple and straight-forward: Simply create a
+function you want called back at some point in the future. The
+function definition should be similar to:
+.RS 4
+.PP
+.BI "void my_callback(unsigned int " reg ", void *" clientarg ");"
+.RE
+.PP
+Then, call
+.B snmp_alarm_register()
+to register your callback to be called
+.I seconds
+from now. The
+.I flags
+field should either be
+.I SA_REPEAT
+or
+.I NULL.
+If flags is set with
+.I SA_REPEAT,
+then the registered callback function will be called every
+.I seconds.
+If
+.I flags
+is
+.I NULL
+then the function will only be called once and then removed from the
+alarm system registration.
+.PP
+The
+.I clientarg
+parameter in the registration function is used only by
+the client function and is stored and passed back directly to them on
+every call to the system.
+.PP
+The
+.B snmp_alarm_register()
+function returns a unique
+.I "unsigned int"
+(which is also passed as the first argument of each callback), which
+can then be used to remove the callback from the queue at a later
+point in the future using the
+.B snmp_alarm_unregister()
+function. If the
+.B snmp_alarm_register()
+call fails it returns zero. In particular, note that it is entirely
+permissible for an alarm function to unregister itself.
+.PP
+The
+.B snmp_alarm_register_hr()
+function is identical in operation to the
+.B snmp_alarm_register()
+function, but takes a
+.I "struct timeval"
+as a first parameter, and schedules the callback after the period
+represented by
+.I t
+(the letters
+.B hr
+stand for "high resolution"). The operation of this function is
+dependent on the provision of the
+.BR setitimer (2)
+system call by the operating system. If this system call is not
+available, the alarm will be scheduled as if
+.B snmp_alarm_register()
+had been called with a first argument equal to the value of the
+.I tv_sec
+member of
+.IR "t".
+See, however, the notes below.
+.SH INITIALIZATION
+The
+.B init_snmp()
+function initialises the snmp_alarm subsystem by calling
+.B init_snmp_alarm()
+and then
+.B init_alarm_post_config()
+to set up the first timer to initialise the callback function. These
+two functions should not be used directly by applications.
+.SH "NOTES"
+The default behaviour of the snmp_alarm subsystem is to request
+.I SIGALRM
+signals from the operating system via the
+.BR alarm (2)
+or
+.BR setitimer (2)
+system calls. This has the disadvantage, however, that no other part
+of the application can use the
+.I SIGLARM
+functionality (or, if some other part of the application
+.I does
+use the
+.I SIGALRM
+functionality, the snmp_alarm subsystem will not work correctly).
+.PP
+If your application runs a
+.BR select (2)-based
+event loop, however, there is no need to use
+.I SIGALRM
+for the snmp_alarm subsystem, leaving it available for other parts of
+the application. This is done by making the following call:
+.PP
+.nf
+netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG, 1);
+.fi
+.PP
+before calling
+.BR "init_snmp()".
+Then,
+.BR snmp_select_info()
+takes alarms into account when calculating the timeout value to be
+used for
+.BR select (2).
+All you need to do is call
+.BR run_alarms()
+when
+.BR select (2)
+times out (return value of zero). This is the approach taken in the
+agent; see
+.IR "snmpd.c".
+Furthermore, when using this method, high resolution alarms do not
+depend on the presence of the
+.BR setitimer (2)
+system call, although overall precision is of course still determined
+by the underlying operating system. Recommended.
+.SH "SEE ALSO"
+.BR netsnmp_session_api "(3), " default_store "(3), "
+.BR alarm "(2), " setitimer "(2), " select "(2)"
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/man/snmp_config.5.def b/man/snmp_config.5.def
new file mode 100644
index 0000000..413a334
--- /dev/null
+++ b/man/snmp_config.5.def
@@ -0,0 +1,202 @@
+.TH SNMP_CONFIG 5 "08 Mar 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmp_config - handling of Net-SNMP configuration files
+.SH DESCRIPTION
+The Net-SNMP package uses various configuration files to configure its
+applications. This manual page merely describes the overall nature of
+them, so that the other manual pages don't have to.
+.SH "DIRECTORIES SEARCHED"
+First off, there are numerous places that configuration files can be
+found and read from. By default, the applications look for
+configuration files in the following 4 directories, in order:
+SYSCONFDIR/snmp,
+DATADIR/snmp, LIBDIR/snmp, and $HOME/.snmp. In each of these
+directories, it looks for files with the extension of both
+.IR conf " and " local.conf
+(reading the second ones last). In this manner, there are
+8 default places a configuration file can exist for any given
+configuration file type.
+.PP
+Additionally, the above default search path can be overridden by
+setting the environment variable SNMPCONFPATH to a colon-separated
+list of directories to search for. The path for the persistent
+data should be included when running applications that use
+persistent storage, such as snmpd.
+.PP
+Applications will read persistent configuration files
+in the following order of preference:
+.RS
+.PP
+file in
+.B SNMP_PERSISTENT_FILE
+environment variable
+.br
+directories in
+.B SNMPCONFPATH
+environment variable
+.br
+directory defined by
+.B
+persistentDir
+snmp.conf variable
+.br
+directory in
+.B
+SNMP_PERSISTENT_DIR
+environment variable
+.br
+default
+.B
+PERSISTENT_DIRECTORY
+directory
+.RE
+.PP
+Finally, applications will write persistent configuration files
+in the following order of preference:
+.RS
+.PP
+file in
+.B SNMP_PERSISTENT_FILE
+environment variable
+.br
+directory defined by
+.B
+persistentDir
+snmp.conf variable
+.br
+directory in
+.B
+SNMP_PERSISTENT_DIR
+environment variable
+.br
+default
+.B
+PERSISTENT_DIRECTORY
+directory
+.RE
+.PP
+Note: When using SNMP_PERSISTENT_FILE, the filename should match the
+application name. For example, /var/net-snmp/snmpd.conf.
+.SH "CONFIGURATION FILE TYPES"
+Each application may use multiple configuration files, which will
+configure various different aspects of the application. For instance,
+the SNMP agent
+.RB ( snmpd )
+knows how to understand configuration
+directives in both the snmpd.conf and the snmp.conf files. In fact,
+most applications understand how to read the contents of the snmp.conf
+files. Note, however, that configuration directives understood in one
+file may not be understood in another file. For further information,
+read the associated manual page with each configuration file type.
+Also, most of the applications support a
+.B -H
+switch on the command line that will list the configuration files it
+will look for and the directives in each one that it understands.
+.PP
+The snmp.conf configuration file is intended to be a application suite
+wide configuration file that supports directives that are useful for
+controlling the fundamental nature of all of the SNMP applications,
+such as how they all manipulate and parse the textual SNMP MIB files.
+.SH "SWITCHING CONFIGURATION TYPES IN MID-FILE"
+It's possible to switch in mid-file the configuration type that the
+parser is supposed to be reading. Since that sentence doesn't make
+much sense, lets give you an example: say that you wanted to turn on
+packet dumping output for the agent by default, but you didn't want to
+do that for the rest of the applications (ie, snmpget, snmpwalk, ...).
+Normally to enable packet dumping in the configuration file
+you'd need to put a line like:
+.PP
+.RS
+dumpPacket true
+.RE
+.PP
+into the snmp.conf file. But, this would turn it on for all of the
+applications. So, instead, you can put the same line in the
+snmpd.conf file so that it only applies to the snmpd daemon. However,
+you need to tell the parser to expect this line. You do this by
+putting a special type specification token inside a [] set. In other
+words, inside your snmpd.conf file you could put the above snmp.conf
+directive by adding a line like so:
+.PP
+.RS
+[snmp] dumpPacket true
+.RE
+.PP
+This tells the parser to parse the above line as if it were inside a
+snmp.conf file instead of an snmpd.conf file. If you want to parse a
+bunch of lines rather than just one then you can make the context
+switch apply to the remainder of the file or until the next context
+switch directive by putting the special token on a line by itself:
+.PP
+.RS
+.nf
+# make this file handle snmp.conf tokens:
+[snmp]
+dumpPacket true
+logTimestamp true
+# return to our original snmpd.conf tokens:
+[snmpd]
+rocommunity mypublic
+.fi
+.RE
+.PP
+The same approach can be used to set configuration directives for a
+particular client application (or group of applications). For example,
+any program that uses the 'snmp_parse_args()' call to handle command-line
+arguments (including the standard command-line tools shipped as part of the
+Net-SNMP distributions) will automatically read the config file 'snmpapp.conf'.
+To set library-level settings for these applications (but not other
+more-specific tools), use configuration such as the following:
+.PP
+.RS
+[snmp] defCommunity myCommunity
+.RE
+.PP
+for a single directive, or
+.PP
+.RS
+.nf
+# make this file handle snmp.conf tokens:
+[snmp]
+defCommunity myCommunity
+defVersion 2c
+# return to our original snmpapp.conf tokens:
+[snmpapp]
+.fi
+.RE
+.PP
+for multiple settings.
+Similarly for any other application token (as passed to init_snmp()).
+.SH COMMENTS
+.PP
+Any lines beginning with the character '#' in the configuration files
+are treated as a comment and are not parsed.
+.SH "INCLUDING OTHER CONFIGURATION FILES"
+It is possible to include other configuration files for processing
+during normal configuration file processing.:
+.PP
+.RS
+.nf
+# include site specific config
+include site.conf
+.RE
+.PP
+This will search every directory in the configuration path for files
+named site.conf, and will process those files before returning to the
+processing of the original file. Note that if '.conf' is omitted,
+it will be appended. That is, all configuration files must end
+in '.conf'.
+.SH "API INTERFACE"
+.PP
+Information about writing C code that makes use of this system in
+either the agent's MIB modules or in applications can be found in the
+.I netsnmp_config_api(3)
+manual page.
+.SH "SEE ALSO"
+snmpconf(1),
+netsnmp_config_api(3),
+snmp.conf(5),
+snmpd.conf(5)
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/man/snmpbulkget.1.def b/man/snmpbulkget.1.def
new file mode 100644
index 0000000..25210f3
--- /dev/null
+++ b/man/snmpbulkget.1.def
@@ -0,0 +1,64 @@
+.TH SNMPBULKGET 1 "01 May 2002" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpbulkget - communicates with a network entity using SNMP GETBULK requests.
+.SH SYNOPSIS
+.B snmpbulkget
+[COMMON OPTIONS] [-Cn <num>] [-Cr <NUM>] AGENT OID [OID]...
+.SH DESCRIPTION
+.B snmpbulkget
+is an SNMP application that uses the SNMP GETBULK request to query a
+network entity efficiently for information. One or more object
+identifiers (OIDs) may be given as arguments on the command line.
+Each variable name is given in the format specified in
+.IR variables(5) .
+.PP
+If the network entity has an error processing the request packet, an
+error packet will be returned and a message will be shown, helping to
+pinpoint why the request was malformed.
+.SH OPTIONS
+.TP 8
+.BI \-Cn <NUM>
+Set the
+.I non-repeaters
+field in the GETBULK PDU. This specifies the number of supplied
+variables that should not be iterated over. The default is 0.
+.TP
+.BI \-Cr <NUM>
+Set the
+.I max-repetitions
+field in the GETBULK PDU. This specifies the maximum number of
+iterations over the repeating variables. The default is 10.
+.PP
+In addition to these options,
+.B snmpbulkget
+takes the common options described in the
+.I snmpcmd(1)
+manual page.
+Note that
+.B snmpbulkget
+REQUIRES an argument specifying the agent to query
+and at least one OID argument, as described there.
+.SH EXAMPLE
+The command:
+.PP
+snmpbulkget \-v2c \-Cn1 \-Cr5 \-Os \-c public zeus system ifTable
+.PP
+will retrieve the variable system.sysDescr.0 (which is the
+lexicographically next object to system) and the first 5 objects in
+the ifTable:
+.PP
+sysDescr.0 = STRING: "SunOS zeus.net.cmu.edu 4.1.3_U1 1 sun4m"
+.br
+ifIndex.1 = INTEGER: 1
+.br
+ifIndex.2 = INTEGER: 2
+.br
+ifDescr.1 = STRING: "lo0"
+.br
+et cetera.
+.SH NOTE
+As the name implies,
+.B snmpbulkget
+utilizes the SNMP GETBULK message, which is not available in SNMPv1.
+.SH "SEE ALSO"
+snmpcmd(1), variables(5), RFC 1905.
diff --git a/man/snmpbulkwalk.1.def b/man/snmpbulkwalk.1.def
new file mode 100644
index 0000000..c5f4a06
--- /dev/null
+++ b/man/snmpbulkwalk.1.def
@@ -0,0 +1,134 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP 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.
+.\" ******************************************************************/
+.TH SNMPBULKWALK 1 "01 May 2002" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpbulkwalk - retrieve a subtree of management values using SNMP GETBULK requests
+.SH SYNOPSIS
+.B snmpbulkwalk
+[APPLICATION OPTIONS] [COMMON OPTIONS] AGENT [OID]
+.SH DESCRIPTION
+.B snmpbulkwalk
+is an SNMP application that uses SNMP GETBULK requests to query a
+network entity efficiently for a tree of information.
+.PP
+An object identifier (OID) may be given on the command line. This OID
+specifies which portion of the object identifier space will be
+searched using GETBULK requests. All variables in the subtree below
+the given OID are queried and their values presented to the user.
+Each variable name is given in the format specified in
+.IR variables(5) .
+If no OID argument is present,
+.B snmpbulkwalk
+will search MIB\-2.
+.PP
+If the network entity has an error processing the request packet, an
+error packet will be returned and a message will be shown, helping to
+pinpoint why the request was malformed.
+.PP
+If the tree search causes attempts to search beyond the end of the
+MIB, the message "End of MIB" will be displayed.
+.SH OPTIONS
+.TP 8
+.B \-Cc
+Do not check whether the returned OIDs are increasing. Some agents
+(LaserJets are an example) return OIDs out of order, but can
+complete the walk anyway. Other agents return OIDs that are out of
+order and can cause
+.B snmpbulkwalk
+to loop indefinitely. By default,
+.B snmpbulkwalk
+tries to detect this behavior and warns you when it hits an agent
+acting illegally. Use
+.B \-Cc
+to turn off this behaviour.
+.TP
+.B \-Ci
+Include the given OID in the search range. Normally
+.B snmpbulkwalk
+uses GETBULK requests starting with the OID you specified and returns
+all results in the MIB tree after that OID. Sometimes, you may wish
+to include the OID specified on the command line in the printed
+results if it is a valid OID in the tree itself. This option lets you
+do this.
+.TP
+.BI \-Cn <NUM>
+Set the
+.I non-repeaters
+field in the GETBULK PDUs. This specifies the number of supplied
+variables that should not be iterated over. The default is 0.
+.TP
+.B \-Cp
+Upon completion of the walk, print the number of variables found.
+.TP
+.BI \-Cr <NUM>
+Set the
+.I max-repetitions
+field in the GETBULK PDUs. This specifies the maximum number of
+iterations over the repeating variables. The default is 10.
+.PP
+In addition to these options,
+.B snmpbulkwalk
+takes the common options described in the
+.I snmpcmd(1)
+manual page.
+Note that
+.B snmpbulkget
+REQUIRES an argument specifying the agent to query
+and at most one OID argument, as described above.
+.SH EXAMPLE
+The command:
+.PP
+snmpbulkwalk \-v2c \-Os \-c public zeus system
+.PP
+will retrieve all of the variables under system:
+.PP
+sysDescr.0 = STRING: "SunOS zeus.net.cmu.edu 4.1.3_U1 1 sun4m"
+.br
+sysObjectID.0 = OID: enterprises.hp.nm.hpsystem.10.1.1
+.br
+sysUpTime.0 = Timeticks: (155274552) 17 days, 23:19:05
+.br
+sysContact.0 = STRING: ""
+.br
+sysName.0 = STRING: "zeus.net.cmu.edu"
+.br
+sysLocation.0 = STRING: ""
+.br
+sysServices.0 = INTEGER: 72
+.PP
+In contrast to
+.BR snmpwalk ,
+this information will typically be gathered in a single transaction
+with the agent, rather than one transaction per variable found.
+.B snmpbulkwalk
+is thus more efficient in terms of network utilisation, which may be
+especially important when retrieving large tables.
+.SH NOTE
+As the name implies,
+.B snmpbulkwalk
+utilizes the SNMP GETBULK message, which is not available in SNMP v1.
+.SH "SEE ALSO"
+snmpcmd(1), variables(5).
diff --git a/man/snmpcmd.1.def b/man/snmpcmd.1.def
new file mode 100644
index 0000000..bb4ed96
--- /dev/null
+++ b/man/snmpcmd.1.def
@@ -0,0 +1,916 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP 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 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.
+.\" ******************************************************************/
+.TH SNMPCMD 1 "20 Jul 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpcmd - options and behaviour common to most of the Net-SNMP command-line tools
+.SH SYNOPSIS
+.B snmpcmd
+[OPTIONS] AGENT [PARAMETERS]
+.SH DESCRIPTION
+This manual page describes the common options for the SNMP commands:
+.BR snmpbulkget ", " snmpbulkwalk ", " snmpdelta ", " snmpget ", "
+.BR snmpgetnext ", " snmpnetstat ", " snmpset ", " snmpstatus ", "
+.BR snmptable ", " snmptest ", " snmptrap ",
+.BR " snmpdf", " snmpusm ", " snmpwalk ". "
+The command line applications use the SNMP protocol to communicate
+with an SNMP capable network entity, an agent. Individual
+applications typically (but not necessarily) take additional
+parameters that are given after the agent specification. These
+parameters are documented in the manual pages for each application.
+.SH COMMAND-LINE CONFIG OPTIONS
+In addition to the options described in this manual page, all of the
+tokens described in the \fIsnmp.conf\fR and other .conf manual pages
+can be used on the command line of Net-SNMP applications as well by
+prefixing them with "\-\-". EG, specifying
+\fI\-\-dontLoadHostConfig=true\fR on the command line will turn of
+loading of the host specific configuration files.
+.PP
+The snmp.conf file settings and the double-dash arguments over-ride
+the single-dash arguments. So it's important to note that if
+single-dash arguments aren't working because you have settings in the
+\fIsnmp.conf\fR file that conflict with them then you'll need to use
+the longer-form double-dash arguments to successfully trump the
+\fIsnmp.conf\fR file settings.
+.SH Generic Options
+Thes options control how the Net-SNMP commands behave regardless of
+what version of SNMP you are using. See further below for options
+that control specific versions or sub-modules of the SNMP protocol.
+.TP
+.B \-d
+Dump (in hexadecimal) the raw SNMP packets sent and received.
+.TP
+.B \-D\fI[TOKEN[,...]]
+Turn on debugging output for the given
+.IR "TOKEN" "(s)."
+Try
+.IR ALL
+for extremely verbose output.
+.TP
+.TP
+.B \-h, \-\-help
+Display a brief usage message and then exit.
+.TP
+.B \-H
+Display a list of configuration file directives understood by the
+command and then exit.
+.TP
+.BI \-I " [brRhu]"
+Specifies input parsing options. See
+.B INPUT OPTIONS
+below.
+.TP
+.BI \-L " [eEfFoOsS]"
+Specifies output logging options. See
+.B LOGGING OPTIONS
+below.
+.TP
+.BI \-m " MIBLIST"
+Specifies a colon separated list of MIB modules (not files) to load for
+this application. This overrides (or augments) the environment variable
+MIBS, the \fIsnmp.conf\fR directive \fImibs\fR, and the list of MIBs
+hardcoded into the Net-SNMP library.
+.IP
+If
+.I MIBLIST
+has a leading '\-' or '+' character, then the MIB modules listed are
+loaded in addition to the default list, coming before or after
+this list respectively.
+Otherwise, the specified MIBs are loaded \fIinstead\fR of this
+default list.
+.IP
+The special keyword
+.I ALL
+is used to load all MIB modules in the MIB directory search list.
+Every file whose name does not begin with "." will be parsed as
+if it were a MIB file.
+.TP
+.BI \-M " DIRLIST"
+Specifies a colon separated list of directories to search for MIBs.
+This overrides (or augments) the environment variable MIBDIRS,
+the \fIsnmp.conf\fR directive \fImibdirs\fR, and the default
+directory hardcoded into the Net-SNMP library
+(DATADIR/snmp/mibs).
+.IP
+If
+.I DIRLIST
+has a leading '\-' or '+' character, then the given directories are
+added to the default list, being searched before or after the
+directories on this list respectively.
+Otherwise, the specified directories are searched \fIinstead\fR
+of this default list.
+
+Note that the directories appearing later in the list have
+have precedence over earlier ones.
+.\"
+.\" XXX - Say a bit more about what precedence means
+.\"
+To avoid searching any MIB directories, set the MIBDIRS
+environment variable to the empty string ("").
+.\"
+.\" XXX - or \-M "" ??
+.\"
+
+Note that MIBs specified using the \-m option or the \fImibs\fR
+configuration directive will be loaded from one of the directories
+listed by the \-M option (or equivalents).
+The \fImibfile\fR directive takes a full path to the specified MIB
+file, so this does not need to be in the MIB directory search list.
+.TP
+.B \-v \fI1\fR | \fI2c\fR | \fI3
+Specifies the protocol version to use: 1 (RFCs 1155-1157), 2c (RFCs 1901-1908),
+or 3 (RFCs 2571-2574). The default is typically version 3.
+Overrides the \fIdefVersion\fR token in the
+.I snmp.conf
+file.
+.BI \-O " [abeEfnqQsStTuUvxX]"
+Specifies output printing options. See
+.B OUTPUT OPTIONS
+below.
+.TP
+.BI \-P " [cdeRuwW]"
+Specifies MIB parsing options. See
+.B MIB PARSING OPTIONS
+below.
+.TP
+.BI \-r " retries"
+Specifies the number of retries to be used in the requests. The default
+is 5.
+.TP
+.BI \-t " timeout"
+Specifies the timeout in seconds between retries. The default is 1.
+Floating point numbers can be used to specify fractions of seconds.
+.TP
+.B \-V, \-\-version
+Display version information for the application and then exit.
+.TP
+.BI \-Y "name"="value"
+.TP
+.BI \-\- "name"="value"
+Allows one to specify any token ("name") supported in the
+.I snmp.conf
+file and sets its value to "value". Overrides the corresponding token in the
+.I snmp.conf
+file. See
+.I snmp.conf(5)
+for the full list of tokens.
+
+
+.SH SNMPv3 Options
+The following options are generic to all forms of SNMPv3, regardless
+of whether it's the original SNMPv3 with USM or the newer SNMPv3 over
+(D)TLS support.
+
+.TP
+.BI \-l " secLevel"
+Set the securityLevel used for SNMPv3 messages
+(noAuthNoPriv|authNoPriv|authPriv). Appropriate pass phrase(s) must
+provided when using any level higher than noAuthNoPriv.
+Overrides the \fIdefSecurityLevel\fR token in the
+.I snmp.conf
+file.
+.TP
+.BI \-n " contextName"
+Set the contextName used for SNMPv3 messages. The default
+contextName is the empty string "". Overrides the \fIdefContext\fR token
+in the
+.I snmp.conf
+file.
+
+.SH SNMPv3 over TLS Options
+These options pass transport-specific parameters to the TLS layer. If
+you're using SNMP over TLS or DTLS you'll need to pass a combination
+of these either through these command line options or through
+snmp.conf configuration tokens.
+.PP
+A note about
+.I "<certificate-specifier>s":
+Net-SNMP looks for X.509 certificates in each of the normal SNMP
+configuration directory search paths under a "tls" subdirectory. IE,
+it will look in ~/.snmp/tls and in /usr/local/share/snmp/tls for
+certificates. The certificate components (eg, the public and private
+halves) are stored in sub-directories underneath this root set of
+directories. See the net\-snmp\-cert tool for help in importing,
+creating and managing Net-SNMP certificates.
+.I "<certificate-specifier>s"
+can reference either a fingerprint of the certificate to use (the
+net\-snmp\-cert tool can help you figure out the certificates) or the
+filename's prefix can be used. For example, if you had a "snmpd.crt"
+certificate file then you could simply refer to the certificate via
+the "snmpd" specifier.
+.TP
+.BI "\-T localCert=<certificate-specifier>"
+Indicates to the transport which key should be used to initiate (D)TLS
+client connections. This would typically be a certificate found using
+the certificate fingerprint, the application name (eg snmpd, snmptrapd, perl, python) or
+genericized name "snmpapp" if using one of the generic applications
+(snmpget, snmpwalk, etc). This can also be set using the
+localCert specifier in a snmp.conf configuration file.
+.TP
+.BI "\-T peerCert=<certificate-specifier>"
+If you expect a particular certificate to be presented by the other
+side then you can use this specifier to indicate the certificate it
+should present. If it fails to present the expected certificate the
+client will refuse to open the connection (because doing otherwise
+could lead to man-in-the-middle attacks). This can also be set using
+the peerCert specifier in a snmp.conf configuration file.
+.TP
+.BI "\-T trust_cert=<certificate-specifier>"
+If you have a trusted CA certificate you wish to anchor trust with,
+you can use this flag to load a given certificate as a trust anchor.
+A copy of the certificate must exist within the Net-SNMP certificate
+storage system or this must point to a complete path name. Also see
+the "trustCert" snmp.conf configuration token.
+.TP
+.BI "\-T their_hostname=<name>"
+If the server's presented certificate can be validating using a trust
+anchor then their hostname will be checked to ensure their presented
+hostname matches one that is expected (you don't want to connect to
+goodhost.example.com and accept a certificate presented by
+badhost.example.com do you?). This token can specify the exact host
+name expected to be presented by the remote side, either in a
+subjectAltName field or in the CommonName field of the server's X.509
+certificate.
+.SH SNMPv3 with USM Options
+These options are specific to using SNMPv3 with the original
+User-based Security Model (USM).
+.TP
+.BI "\-3[MmKk] 0xHEXKEY"
+Sets the keys to be used for SNMPv3 transactions. These options allow
+you to set the master authentication and encryption keys (\-3m and \-3M
+respectively) or set the localized authentication and encryption keys
+(\-3k and \-3K respectively). SNMPv3 keys can be either passed in by
+hand using these flags, or by the use of keys generated from passwords
+using the \-A and \-X flags discussed below. For further details on
+SNMPv3 and its usage of keying information, see the Net-SNMP tutorial
+web site ( http://www.Net\-SNMP.org/tutorial\-5/commands/ ).
+Overrides the defAuthMasterKey (\-3m), defPrivMasterKey (\-3M),
+defAuthLocalizedKey (\-3k) or defPrivLocalizedKey (\-3K) tokens, respectively,
+in the
+.I snmp.conf
+file, see
+.I snmp.conf(5).
+.TP
+.BI \-a " authProtocol"
+Set the authentication protocol (MD5 or SHA) used for authenticated SNMPv3
+messages. Overrides the \fIdefAuthType\fR token in the
+.I snmp.conf
+file.
+.TP
+.BI \-A " authPassword"
+Set the authentication pass phrase used for authenticated SNMPv3
+messages. Overrides the \fIdefAuthPassphrase\fR token in the
+.I snmp.conf
+file. It is insecure to specify pass phrases on the command line,
+see
+.I snmp.conf(5).
+.TP
+.BI \-e " engineID"
+Set the authoritative (security) engineID used for SNMPv3 REQUEST
+messages, given as a hexadecimal string (optionally prefixed by "0x").
+It is typically not necessary to specify this engine ID, as it will
+usually be discovered automatically.
+.TP
+.BI \-E " engineID"
+Set the context engineID used for SNMPv3 REQUEST messages scopedPdu,
+given as a hexadecimal string.
+If not specified, this will default to the authoritative engineID.
+.TP
+.BI \-u " secName"
+Set the securityName used for authenticated SNMPv3 messages.
+Overrides the \fIdefSecurityName\fR token in the
+.I snmp.conf
+file.
+.TP
+.BI \-x " privProtocol"
+Set the privacy protocol (DES or AES) used for encrypted SNMPv3 messages.
+Overrides the \fIdefPrivType\fR token in the
+.I snmp.conf
+file. This option is only valid if the Net-SNMP software was build
+to use OpenSSL.
+.TP
+.BI \-X " privPassword"
+Set the privacy pass phrase used for encrypted SNMPv3 messages.
+Overrides the \fIdefPrivPassphrase\fR token in the
+.I snmp.conf
+file.
+It is insecure to specify pass phrases on the command line, see
+.I snmp.conf(5).
+.TP
+.BI \-Z " boots,time"
+Set the engineBoots and engineTime used for authenticated SNMPv3
+messages. This will initialize the local notion of the agents
+boots/time with an authenticated value stored in the LCD.
+It is typically not necessary to specify this option, as these values
+will usually be discovered automatically.
+
+
+.SH SNMPv1 and SNMPv2c Options
+.TP
+.BI \-c " community"
+Set the community string for SNMPv1/v2c transactions.
+Overrides the \fIdefCommunity\fR token in the
+.I snmp.conf
+file.
+
+.SH AGENT SPECIFICATION
+.PP
+The string
+.I AGENT
+in the
+.B SYNOPSIS
+above specifies the remote SNMP entity with which to communicate.
+This specification takes the form:
+.IP
+[<transport-specifier>:]<transport-address>
+.PP
+At its simplest, the
+.I AGENT
+specification may consist of a hostname, or an IPv4 address in the
+standard "dotted quad" notation. In this case, communication will be
+attempted using UDP/IPv4 to port 161 of the given host. Otherwise,
+the <transport-address> part of the specification is parsed according
+to the following table:
+.RS 4
+.TP 28
+.BR "<transport-specifier>"
+.BR "<transport-address> format"
+.IP "udp" 28
+hostname[:port]
+.I or
+IPv4-address[:port]
+.IP "tcp" 28
+hostname[:port]
+.I or
+IPv4-address[:port]
+.IP "unix" 28
+pathname
+.IP "ipx" 28
+[network]:node[/port]
+.TP 28
+.IR "" "aal5pvc " or " pvc"
+[interface.][VPI.]VCI
+.IP "udp6 or udpv6 or udpipv6" 28
+hostname[:port]
+.I or
+IPv6-address:port
+.I or
+ '['IPv6-address']'[:port]
+.IP "tcp6 or tcpv6 or tcpipv6"
+hostname[:port]
+.I or
+IPv6-address:port
+.I or
+ '['IPv6-address']'[:port]
+.RE
+.PP
+Note that <transport-specifier> strings are case-insensitive so that,
+for example, "tcp" and "TCP" are equivalent. Here are some examples,
+along with their interpretation:
+.TP 24
+.IR "hostname:161"
+perform query using UDP/IPv4 datagrams to
+.I hostname
+on port
+.IR 161 .
+The ":161" is redundant here since that is the default SNMP port in
+any case.
+.TP 24
+.IR "udp:hostname"
+identical to the previous specification. The "udp:" is redundant here
+since UDP/IPv4 is the default transport.
+.TP 24
+.IR "TCP:hostname:1161"
+connect to
+.I hostname
+on port
+.I 1161
+using TCP/IPv4 and perform query over that connection.
+.IR "udp6:hostname:10161"
+perform the query using UDP/IPv6 datagrams to port
+.I 10161
+on
+.I hostname
+(which will be looked up as an AAAA record).
+.TP 24
+.IR "UDP6:[fe80::2d0:b7ff:fe21:c6c0]"
+perform the query using UDP/IPv6 datagrams to port 161 at address
+.IR fe80::2d0:b7ff:fe21:c6c0 .
+.TP 24
+.IR "tcpipv6:[::1]:1611"
+connect to port 1611 on the local host
+.IR "" ( ::1
+in IPv6 parlance) using TCP/IPv6 and perform query over that connection.
+.TP 24
+.IR "tls:hostname:10161"
+.TP 24
+.IR "dtls:hostname:10161"
+Connects using SNMP over DTLS or TLS as documented by the ISMS working
+group (RFCs not yet published as of this date). This will require
+(and automatically ensures) that the TSM security model is in use.
+You'll also need to set up trust paths for the certificates presented
+by the server (see above for descriptions of this).
+.TP 24
+.IR "ssh:hostname:22"
+Connects using SNMP over SSH as documented by the ISMS working group
+(RFCs not yet published as of this date). This will require that the
+TSM security model is in use (\-\-defSecurityModel=tsm).
+.TP 24
+.IR "ipx::00D0B7AAE308"
+perform query using IPX datagrams to node number
+.I 00D0B7AAE308
+on the default network, and using the default IPX port of 36879 (900F
+hexadecimal), as suggested in RFC 1906.
+.TP 24
+.IR "ipx:0AE43409:00D0B721C6C0/1161"
+perform query using IPX datagrams to port
+.I 1161
+on node number
+.I 00D0B721C6C0
+on network number
+.IR 0AE43409 .
+.TP 24
+.IR "unix:/tmp/local\-agent"
+connect to the Unix domain socket
+.IR /tmp/local\-agent ,
+and perform the query over that connection.
+.TP 24
+.IR "/tmp/local\-agent"
+identical to the previous specification, since the Unix domain is the
+default transport iff the first character of the <transport-address>
+is a '/'.
+.TP 24
+.IR "alias:myname"
+perform a connection to the
+.I myname
+alias which needs to be defined in the snmp.conf file using a line
+like "
+.I "alias myname udp:127.0.0.1:9161"
+". Any type of transport definition can be used as the alias expansion
+parameter. Aliases are particularly useful for using repeated complex
+transport strings.
+.TP 24
+.IR "AAL5PVC:100"
+perform the query using AAL5 PDUs sent on the permanent virtual
+circuit with VPI=0 and VCI=100 (decimal) on the first ATM adapter in the
+machine.
+.TP 24
+.IR "PVC:1.10.32"
+perform the query using AAL5 PDUs sent on the permanent virtual
+circuit with VPI=10 (decimal) and VCI=32 (decimal) on the second ATM
+adapter in the machine. Note that "PVC" is a synonym for "AAL5PVC".
+.PP
+Note that not all the transport domains listed above will always be
+available; for instance, hosts with no IPv6 support will not be able
+to use udp6 transport addresses, and attempts to do so will result in
+the error "Unknown host". Likewise, since AAL5 PVC support is only
+currently available on Linux, it will fail with the same error on
+other platforms.
+.SH "MIB PARSING OPTIONS"
+The Net-SNMP MIB parser mostly adheres to the Structure of Management
+Information (SMI). As that specification has changed through time, and
+in recognition of the (ahem) diversity in compliance expressed in MIB
+files, additional options provide more flexibility in reading MIB files.
+.TP
+.B "\-Pc"
+Toggles whether ASN.1 comments should extend to the end of the MIB
+source line.
+Strictly speaking, a second appearance of "\-\-" should terminate the
+comment, but this breaks some MIB files.
+The default behaviour (to interpret comments correctly) can also
+be set with the configuration token \fIcommentToEOL\fR.
+.TP
+.B "\-Pd"
+Disables the loading of MIB object DESCRIPTIONs when parsing MIB files.
+This reduces the amount of memory used by the running application.
+.TP
+.B "\-Pe"
+Toggles whether to show errors encountered when parsing MIB files.
+These include
+references to IMPORTed modules and MIB objects that cannot be
+located in the MIB directory search list.
+The default behaviour can also be set with the configuration token \fIshowMibErrors\fR.
+.TP
+.B "\-PR"
+If the same MIB object (parent name and sub-identifier) appears multiple
+times in the list of MIB definitions loaded, use the last version to be
+read in. By default, the first version will be used, and any duplicates
+discarded.
+This behaviour can also be set with the configuration token \fImibReplaceWithLatest\fR.
+
+Such ordering is normally only relevant if there are two MIB files with
+conflicting object definitions for the same OID (or different revisions
+of the same basic MIB object).
+.\" .B WARNING:
+.\" Setting this option may result in an incorrect hierarchy.
+.\" XXX - Why?
+.TP
+.B "\-Pu"
+Toggles whether to allow the underline character in MIB object names
+and other symbols.
+Strictly speaking, this is not valid SMI syntax, but some vendor MIB
+files define such names.
+The default behaviour can also be set with the configuration token \fImibAllowUnderline\fR.
+.TP
+.B "\-Pw"
+Show various warning messages in parsing MIB files and building
+the overall OID tree.
+This can also be set with the configuration directive
+\fImibWarningLevel 1\fR
+.TP
+.B "\-PW"
+Show some additional warning messages, mostly relating to parsing
+individual MIB objects.
+This can also be set with the configuration directive
+\fImibWarningLevel 2\fR
+
+.SH "OUTPUT OPTIONS"
+The format of the output from SNMP commands can be controlled using
+various parameters of the \fB\-O\fR flag.
+The effects of these sub-options can be seen by comparison with
+the following default output (unless otherwise specified):
+.RS
+.nf
+\fC$ snmpget \-c public \-v 1 localhost sysUpTime.0
+SNMPv2\-MIB::sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63\fR
+.fi
+.RE
+
+.TP
+.B \-Oa
+Display string values as ASCII strings (unless there is a
+\fCDISPLAY\-HINT\fR defined for the corresponding MIB object).
+By default, the library attempts to determine whether the value is
+a printable or binary string, and displays it accordingly.
+
+This option does not affect objects that \fIdo\fR have a Display Hint.
+.TP
+.B \-Ob
+Display table indexes numerically, rather than trying to interpret
+the instance subidentifiers as string or OID values:
+.RS
+.nf
+\fC $ snmpgetnext \-c public \-v 1 localhost vacmSecurityModel
+ SNMP\-VIEW\-BASED\-ACM\-MIB::vacmSecurityModel.0."wes" = xxx
+ $ snmpgetnext \-c public \-v 1 \fB\-Ob\fP localhost vacmSecurityModel
+ SNMP\-VIEW\-BASED\-ACM\-MIB::vacmSecurityModel.0.3.119.101.115 = xxx\fR
+.fi
+.RE
+.TP
+.B \-Oe
+Removes the symbolic labels from enumeration values:
+.RS
+.nf
+\fC $ snmpget \-c public \-v 1 localhost ipForwarding.0
+ IP\-MIB::ipForwarding.0 = INTEGER: forwarding(1)
+\fC $ snmpget \-c public \-v 1 \fB\-Oe\fP localhost ipForwarding.0
+ IP\-MIB::ipForwarding.0 = INTEGER: 1\fR
+.fi
+.RE
+.TP
+.B \-OE
+Modifies index strings to escape the quote characters:
+.RS
+.nf
+\fC $ snmpgetnext \-c public \-v 1 localhost vacmSecurityModel
+ SNMP\-VIEW\-BASED\-ACM\-MIB::vacmSecurityModel.0."wes" = xxx
+ $ snmpgetnext \-c public \-v 1 \fB\-OE\fP localhost vacmSecurityModel
+ SNMP\-VIEW\-BASED\-ACM\-MIB::vacmSecurityModel.0.\\"wes\\" = xxx\fR
+.fi
+.RE
+.IP
+This allows the output to be reused in shell commands.
+.TP
+.B \-Of
+Include the full list of MIB objects when displaying an OID:
+.RS
+\fC .iso.org.dod.internet.mgmt.mib\-2.system.sysUpTime.0 =\fR
+.RS
+\fC Timeticks: (14096763) 1 day, 15:09:27.63\fR
+.RE
+.RE
+.TP
+.B \-On
+Displays the OID numerically:
+.br
+\fC .1.3.6.1.2.1.1.3.0 = Timeticks: (14096763) 1 day, 15:09:27.63\fR
+.TP
+.B \-Oq
+Removes the equal sign and type information when displaying varbind values:
+.br
+\fC SNMPv2\-MIB::sysUpTime.0 1:15:09:27.63\fR
+.TP
+.B \-OQ
+Removes the type information when displaying varbind values:
+.br
+\fC SNMPv2\-MIB::sysUpTime.0 = 1:15:09:27.63\fR
+.TP
+.B \-Os
+Display the MIB object name (plus any instance or other subidentifiers):
+.br
+\fC sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63\fR
+.TP
+.B \-OS
+Display the name of the MIB, as well as the object name:
+.br
+\fC SNMPv2\-MIB::sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63\fR
+.IP
+This is the default OID output format.
+.TP
+.B \-Ot
+Display \fCTimeTicks\fR values as raw numbers:
+.br
+\fC SNMPv2\-MIB::sysUpTime.0 = 14096763\fR
+.TP
+.B \-OT
+If values are printed as Hex strings,
+display a printable version as well.
+.TP
+.B \-Ou
+Display the OID in the traditional UCD-style (inherited from the original
+CMU code).
+That means removing a series of "standard" prefixes from the OID,
+and displaying the remaining list of MIB object names
+(plus any other subidentifiers):
+.br
+\fC system.sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63\fR
+.TP
+.B \-OU
+Do not print the UNITS suffix at the end of the value.
+.TP
+.B \-Ov
+Display the varbind value only, not the OID:
+.RS
+.nf
+\fC $ snmpget \-c public \-v 1 \fB\-Ov\fP localhost ipForwarding.0
+ INTEGER: forwarding(1)\fR
+.fi
+.RE
+.TP
+.B \-Ox
+Display string values as Hex strings (unless there is a
+\fCDISPLAY\-HINT\fR defined for the corresponding MIB object).
+By default, the library attempts to determine whether the value is
+a printable or binary string, and displays it accordingly.
+
+This option does not affect objects that \fIdo\fR have a Display Hint.
+.TP
+.B \-OX
+Display table indexes in a more "program like" output, imitating
+a traditional array-style index format:
+.RS
+.nf
+\fC $ snmpgetnext \-c public \-v 1 localhost ipv6RouteTable
+ IPv6\-MIB::ipv6RouteIfIndex.63.254.1.0.255.0.0.0.0.0.0.0.0.0.0.0.64.1 = INTEGER: 2
+ $ snmpgetnext \-c public \-v 1 \fB\-OX\fP localhost ipv6RouteTable
+ IPv6\-MIB::ipv6RouteIfIndex[3ffe:100:ff00:0:0:0:0:0][64][1] = INTEGER: 2
+.fi
+.RE
+.PP
+Most of these options can also be configured via configuration tokens.
+See the
+.I snmp.conf(5)
+manual page for details.
+
+.SH "LOGGING OPTIONS"
+The mechanism and destination to use for logging of warning and error
+messages can be controlled by passing various parameters to the
+.B \-L
+flag.
+.TP
+.B \-Le
+Log messages to the standard error stream.
+.TP
+.B \-Lf FILE
+Log messages to the specified file.
+.TP
+.B \-Lo
+Log messages to the standard output stream.
+.TP
+.B \-Ls FACILITY
+Log messages via syslog, using the specified facility
+('d' for LOG_DAEMON, 'u' for LOG_USER,
+or '0'-'7' for LOG_LOCAL0 through LOG_LOCAL7).
+.PP
+
+There are also "upper case" versions of each of these options, which
+allow the corresponding logging mechanism to be restricted to certain
+priorities of message. Using standard error logging as an example:
+.TP
+.B \-LE pri
+will log messages of priority 'pri' and above to standard error.
+.TP
+.B \-LE p1\-p2
+will log messages with priority between 'p1' and 'p2' (inclusive) to
+standard error.
+.PP
+For
+.B \-LF
+and
+.B \-LS
+the priority specification comes before the file or facility token.
+The priorities recognised are:
+.IP
+.B 0
+or
+.B !
+for LOG_EMERG,
+.br
+.B 1
+or
+.B a
+for LOG_ALERT,
+.br
+.B 2
+or
+.B c
+for LOG_CRIT,
+.br
+.B 3
+or
+.B e
+for LOG_ERR,
+.br
+.B 4
+or
+.B w
+for LOG_WARNING,
+.br
+.B 5
+or
+.B n
+for LOG_NOTICE,
+.br
+.B 6
+or
+.B i
+for LOG_INFO, and
+.br
+.B 7
+or
+.B d
+for LOG_DEBUG.
+.PP
+Normal output is (or will be!) logged at a priority level of
+.B LOG_NOTICE
+
+.SH "INPUT OPTIONS"
+The interpretation of input object names and the values to be assigned
+can be controlled using various parameters of the \fB\-I\fR flag.
+The default behaviour will be described at the end of this section.
+.TP
+.B \-Ib
+specifies that the given name should be regarded as a regular expression,
+to match (case-insensitively) against object names in the MIB tree.
+The "best" match will be used - calculated as the one that matches the
+closest to the beginning of the node name and the highest in the tree.
+.\"
+.\" XXX - This is not a particularly clear description.
+.\" Need to check the code and/or experiment to
+.\" discover exactly what Wes means by this!
+For example, the MIB object \fCvacmSecurityModel\fR could be matched by
+the expression \fCvacmsecuritymodel\fR (full name, but different case),
+or \fCvacm.*model\fR (regexp pattern).
+
+Note that '.' is a special character in regular expression patterns,
+so the expression cannot specify instance subidentifiers or more than
+one object name. A "best match" expression will only be applied
+against single MIB object names.
+For example, the expression \fIsys*ontact.0\fR would not match the
+instance \fCsysContact.0\fR (although \fIsys*ontact\fR would match
+\fCsysContact\fR).
+Similarly, specifying a MIB module name will not succeed
+(so \fISNMPv2\-MIB::sys.*ontact\fR would not match either).
+.TP
+.B \-Ih
+disables the use of DISPLAY\-HINT information when assigning values.
+This would then require providing the raw value:
+.br
+\fC snmpset ... HOST\-RESOURCES\-MIB::hrSystemDate.0
+.br
+ x "07 D2 0C 0A 02 04 06 08"\fR
+.br
+instead of a formatted version:
+.br
+\fC snmpset ... HOST\-RESOURCES\-MIB::hrSystemDate.0
+.br
+ = 2002\-12\-10,2:4:6.8\fR
+.TP
+.B \-Ir
+disables checking table indexes and the value to be assigned against the
+relevant MIB definitions. This will (hopefully) result in the remote
+agent reporting an invalid request, rather than checking (and rejecting)
+this before it is sent to the remote agent.
+
+Local checks are more efficient (and the diagnostics provided also
+tend to be more precise), but disabling this behaviour is particularly
+useful when testing the remote agent.
+.TP
+.B \-IR
+enables "random access" lookup of MIB names.
+Rather than providing a full OID path to the desired MIB object
+(or qualifying this object with an explicit MIB module name),
+the MIB tree will be searched for the matching object name.
+Thus \fC.iso.org.dod.internet.mib\-2.system.sysDescr.0\fR
+(or \fCSNMPv2\-MIB::sysDescr.0\fR) can be specified simply
+as \fCsysDescr.0\fR.
+.RS
+.IP "Warning:"
+Since MIB object names are not globally unique, this approach
+may return a different MIB object depending on which MIB files
+have been loaded.
+.RE
+.IP
+The \fIMIB\-MODULE::objectName\fR syntax has
+the advantage of uniquely identifying a particular MIB object,
+as well as being slightly more efficient (and automatically
+loading the necessary MIB file if necessary).
+.TP
+.B \-Is SUFFIX
+adds the specified suffix to each textual OID given on the command line.
+This can be used to retrieve multiple objects from the same row of
+a table, by specifying a common index value.
+.TP
+.B \-IS PREFIX
+adds the specified prefix to each textual OID given on the command line.
+This can be used to specify an explicit MIB module name for all objects
+being retrieved (or for incurably lazy typists).
+.TP
+.B \-Iu
+enables the traditional UCD-style approach to interpreting input OIDs.
+This assumes that OIDs are rooted at the 'mib\-2' point in the tree
+(unless they start with an explicit '.' or include a MIB module name).
+So the \fCsysDescr\fR instance above would be referenced as
+\fCsystem.sysDescr.0\fR.
+
+.PP
+Object names specified with a leading '.' are always interpreted as
+"fully qualified" OIDs, listing the sequence of MIB objects from the
+root of the MIB tree. Such objects and those qualified by an explicit
+MIB module name are unaffected by the \fB\-Ib\fR, \fB\-IR\fR and \fB\-Iu\fR flags.
+
+Otherwise, if none of the above input options are specified, the
+default behaviour for a "relative" OID is to try and interpret it
+as an (implicitly) fully qualified OID,
+then apply "random access" lookup (\fB\-IR\fR),
+followed by "best match" pattern matching (\fB\-Ib\fR).
+
+.SH "ENVIRONMENT VARIABLES"
+.IP PREFIX
+The standard prefix for object identifiers (when using UCD-style output).
+Defaults to .iso.org.dod.internet.mgmt.mib\-2
+.IP MIBS
+The list of MIBs to load. Defaults to
+SNMPv2\-TC:SNMPv2\-MIB:IF\-MIB:IP\-MIB:TCP\-MIB:UDP\-MIB:SNMP\-VACM\-MIB.
+Overridden by the
+.B \-m
+option.
+.IP MIBDIRS
+The list of directories to search for MIBs. Defaults to DATADIR/snmp/mibs.
+Overridden by the
+.B \-M
+option.
+
+.SH FILES
+.IP SYSCONFDIR/snmp/snmpd.conf
+Agent configuration file. See
+.IR snmpd.conf(5) .
+.IP SYSCONFDIR/snmp/snmp.conf
+.IP ~/.snmp/snmp.conf
+Application configuration files. See
+.IR snmp.conf(5) .
+
+.SH "SEE ALSO"
+snmpget(1), snmpgetnext(1), snmpset(1),
+snmpbulkget(1), snmpbulkwalk(1), snmpwalk(1),
+snmptable(1), snmpnetstat(1), snmpdelta(1), snmptrap(1), snmpinform(1),
+snmpusm(1), snmpstatus(1), snmptest(1),
+snmp.conf(5).
+
diff --git a/man/snmpconf.1.def b/man/snmpconf.1.def
new file mode 100644
index 0000000..cd0c104
--- /dev/null
+++ b/man/snmpconf.1.def
@@ -0,0 +1,130 @@
+.TH SNMPCONF 1 "25 Feb 2003" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpconf - creates and modifies SNMP configuration files
+.SH SYNOPSIS
+.B snmpconf
+[OPTIONS] [fileToCreate]
+.IP "Start with:"
+.B snmpconf
+\-g basic_setup
+.IP "Or even just:"
+.B snmpconf
+.SH DESCRIPTION
+.B snmpconf
+is a simple Perl script that walks you through setting up a
+configuration file step by step. It should be fairly straight forward
+to use. Merely run it and answer its questions.
+.PP
+In its default mode of operation, it prompts the user with menus
+showing sections of the various configuration files it knows about.
+When the user selects a section, a sub-menu is shown listing of the
+descriptions of the tokens that can be created in that section. When
+a description is selected, the user is prompted with questions that
+construct the configuration line in question.
+.PP
+Finally, when the user quits the program any configuration files that
+have been edited by the user are saved to the local directory, fully
+commented.
+.PP
+A particularly useful option is the
+.B \-g
+switch, which walks a user through a specific set of configuration
+questions. Run:
+.RS
+.PP
+snmpconf \-g basic_setup
+.RE
+.PP
+for an example.
+.SH "OPTIONS"
+.TP 8
+.B \-f
+Force overwriting existing files in the current directory without
+prompting the user if this is a desired thing to do.
+.TP
+.B \-i
+When finished, install the files into the location where the global
+system commands expect to find them.
+.TP
+.B \-p
+When finished, install the files into the users home directory's .snmp
+subdirectory (where the applications will also search for
+configuration files).
+.TP
+.BI \-I " DIRECTORY"
+When finished, install the files into the directory
+.IR DIRECTORY .
+.TP
+.B \-a
+Don't ask any questions. Simply read in the various known
+configuration files and write them back out again. This has the
+effect of "auto-commenting" the configuration files for you. See
+the
+.B NEAT TRICKS
+section below.
+.TP
+.BI \-r all|none
+Read in either all or none of the found configuration files. Normally
+.B snmpconf
+prompts you for which files you wish to read in. Reading in
+these configuration files will merge these files with the results of
+the questions that it asks of you.
+.TP
+.BI \-R " FILE,..."
+Read in a specific list of configuration files.
+.TP
+.BI \-g " GROUPNAME"
+Groups of configuration entries can be created that can be used to
+walk a user through a series of questions to create an initial
+configuration file. There are no menus to navigate, just a list of
+questions. Run:
+.RS
+.RS
+.PP
+snmpconf \-g basic_setup
+.RE
+.PP
+for a good example.
+.RE
+.TP
+.B \-G
+List all the known groups.
+.TP
+.BI \-c " CONFIGDIR"
+.B snmpconf
+uses a directory of configuration information to learn about
+the files and questions that it should be asking. This option tells
+.B snmpconf
+to use a different location for configuring itself.
+.TP
+.B \-q
+Run slightly more quietly. Since this is an interactive program, I
+don't recommend this option since it only removes information from the
+output that is designed to help you.
+.TP
+.B \-d
+Turn on
+.B lots
+of debugging output.
+.TP
+.B \-D
+Add
+.B even more
+debugging output in the form of Perl variable dumps.
+.IP
+.SH "NEAT TRICKS"
+.IP "snmpconf \-g basic_setup"
+Have I mentioned this command enough yet? It's designed to walk
+someone through an initial setup for the
+.I snmpd(8)
+daemon. Really, you should try it.
+.IP "snmpconf \-R /usr/local/snmp/snmpd.conf \-a \-f snmpd.conf"
+Automatically reads in an snmpd.conf file (for example) and adds
+comments to them describing what each token does. Try it. It's cool.
+.SH "NOTES"
+.B snmpconf
+is actually a very generic utility that could be easily
+configured to help construct just about any kind of configuration
+file. Its default configuration set of files are SNMP based.
+.SH SEE ALSO
+snmpd(8), snmp_config(5), snmp.conf(5), snmpd.conf(5)
diff --git a/man/snmpd.8.def b/man/snmpd.8.def
new file mode 100644
index 0000000..f173396
--- /dev/null
+++ b/man/snmpd.8.def
@@ -0,0 +1,355 @@
+.TH SNMPD 8 "30 Jun 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpd - daemon to respond to SNMP request packets.
+.SH SYNOPSIS
+.B snmpd
+[OPTIONS] [LISTENING ADDRESSES]
+.SH DESCRIPTION
+.B snmpd
+is an SNMP agent which binds to a port and awaits requests from
+SNMP management software. Upon receiving a request, it processes the
+request(s), collects the requested information and/or performs the
+requested operation(s) and returns the information to the sender.
+.SH OPTIONS
+.TP 8
+.B \-a
+Log the source addresses of incoming requests.
+.TP
+.B \-A
+Append to the log file rather than truncating it.
+.TP
+.B "\-c" \fIFILE
+Read
+.I FILE
+as a configuration file
+(or a comma-separated list of configuration files). Note that the loaded
+file will only understand snmpd.conf tokens, unless the configuration type
+is specified in the file as described in the snmp_config man page under
+SWITCHING CONFIGURATION TYPES IN MID-FILE.
+.TP
+.B \-C
+Do not read any configuration files except the ones optionally specified by the
+.B \-c
+option.
+Note that this behaviour also covers the persistent configuration files.
+This may result in dynamically-assigned values being reset following an
+agent restart, unless the relevant persistent config files are
+explicitly loaded using the
+.B \-c
+option.
+.TP
+.B \-d
+Dump (in hexadecimal) the sent and received SNMP packets.
+.TP
+.B \-D\fI[TOKEN[,...]]
+Turn on debugging output for the given
+.IR "TOKEN" "(s)."
+Without any tokens specified, it defaults to printing all the tokens
+(which is equivalent to the keyword "ALL").
+You might want to try
+.IR ALL
+for extremely verbose output. Note: You can not put a space between
+the \-D flag and the listed TOKENs.
+.TP
+.B \-f
+Do not fork() from the calling shell.
+.TP
+.B \-g \fIGID
+Change to the numerical group ID
+.I GID
+after opening listening sockets.
+.TP
+.B \-h, \-\-help
+Display a brief usage message and then exit.
+.TP
+.B \-H
+Display a list of configuration file directives understood by the
+agent and then exit.
+.TP
+.B \-I \fI[\-]INITLIST
+Specifies which modules should (or should not) be initialized
+when the agent starts up. If the comma-separated
+.I INITLIST
+is preceded
+with a '\-', it is the list of modules that should \fInot\fR be started.
+Otherwise this is the list of the \fIonly\fR modules that should be started.
+
+To get a list of compiled modules, run the agent with the arguments
+.I "\-Dmib_init \-H"
+(assuming debugging support has been compiled in).
+.TP
+.B \-L[efos]
+Specify where logging output should be directed (standard error or output,
+to a file or via syslog). See LOGGING OPTIONS in snmpcmd(5) for details.
+.TP
+.BR \-m " \fIMIBLIST"
+Specifies a colon separated list of MIB modules to load for this
+application. This overrides the environment variable MIBS.
+See \fIsnmpcmd(1)\fR for details.
+.TP
+.BR \-M " \fIDIRLIST"
+Specifies a colon separated list of directories to search for MIBs.
+This overrides the environment variable MIBDIRS.
+See \fIsnmpcmd(1)\fR for details.
+.TP
+.B \-n \fINAME
+Set an alternative application name (which will affect the
+configuration files loaded).
+By default this will be \fIsnmpd\fR, regardless of the name
+of the actual binary.
+.TP
+.B \-p \fIFILE
+Save the process ID of the daemon in
+.IR FILE "."
+.TP
+.B \-q
+Print simpler output for easier automated parsing.
+.TP
+.B \-r
+Do not require root access to run the daemon. Specifically, do not exit
+if files only accessible to root (such as /dev/kmem etc.) cannot be
+opened.
+.TP
+.B \-u \fIUID
+Change to the user ID
+.I UID
+(which can be given in numerical or textual form) after opening
+listening sockets.
+.TP
+.B \-U
+Instructs the agent to not remove its pid file (see the
+.B \-p
+option) on shutdown. Overrides the leave_pidfile token in the
+.I snmpd.conf
+file, see
+.I snmpd.conf(5).
+.TP
+.B \-v, \-\-version
+Print version information for the agent and then exit.
+.TP
+.B \-V
+Symbolically dump SNMP transactions.
+.TP
+.B \-x \fIADDRESS
+Listens for AgentX connections on the specified address
+rather than the default AGENTX_SOCKET.
+The address can either be a Unix domain socket path,
+or the address of a network interface. The format is the same as the
+format of listening addresses described below.
+.TP
+.B \-X
+Run as an AgentX subagent rather than as an SNMP master agent.
+.TP
+.BI \-\- "name"="value"
+Allows one to specify any token ("name") supported in the
+.I snmpd.conf
+file and sets its value to "value". Overrides the corresponding token in the
+.I snmpd.conf
+file. See
+.I snmpd.conf(5)
+for the full list of tokens.
+.SH LISTENING ADDRESSES
+By default,
+.B snmpd
+listens for incoming SNMP requests on UDP port 161 on all IPv4 interfaces.
+However, it is possible to modify this behaviour by specifying one or more
+listening addresses as arguments to \fBsnmpd\fR.
+A listening address takes the form:
+.IP
+[<transport-specifier>:]<transport-address>
+.PP
+At its simplest, a listening address may consist only of a port
+number, in which case
+.B snmpd
+listens on that UDP port on all IPv4 interfaces. Otherwise, the
+<transport-address> part of the specification is parsed according to
+the following table:
+.RS 4
+.TP 28
+.BR "<transport-specifier>"
+.BR "<transport-address> format"
+.IP "udp \fI(default)\fR" 28
+hostname[:port]
+.I or
+IPv4-address[:port]
+.IP "tcp" 28
+hostname[:port]
+.I or
+IPv4-address[:port]
+.IP "unix" 28
+pathname
+.IP "ipx" 28
+[network]:node[/port]
+.TP 28
+.IR "" "aal5pvc " or " pvc"
+[interface.][VPI.]VCI
+.TP 28
+.IR "" "udp6 " or " udpv6 " or " udpipv6"
+hostname[:port]
+.I or
+IPv6-address[:port]
+.TP 28
+.IR "" "tcp6 " or " tcpv6 " or " tcpipv6"
+hostname[:port]
+.I or
+IPv6-address[:port]
+.TP 28
+.IR "" "ssh"
+hostname:port
+.TP 28
+.IR "" "dtlsudp"
+hostname:port
+.RE
+.PP
+Note that <transport-specifier> strings are case-insensitive so that,
+for example, "tcp" and "TCP" are equivalent. Here are some examples,
+along with their interpretation:
+.TP 24
+.IR "127.0.0.1:161"
+listen on UDP port 161, but only on the loopback interface. This
+prevents
+.B snmpd
+being queried remotely. The port specification ":161" is
+not strictly necessary since that is the default SNMP port.
+.TP 24
+.IR "TCP:1161"
+listen on TCP port 1161 on all IPv4 interfaces.
+.TP 24
+.IR "ipx:/40000"
+listen on IPX port 40000 on all IPX interfaces.
+.TP 24
+.IR "unix:/tmp/local\-agent"
+listen on the Unix domain socket \fI/tmp/local\-agent\fR.
+.TP 24
+.IR "/tmp/local\-agent"
+is identical to the previous specification, since the Unix domain is
+assumed if the first character of the <transport-address> is '/'.
+.TP 24
+.IR "PVC:161"
+listen on the AAL5 permanent virtual circuit with VPI=0 and VCI=161
+(decimal) on the first ATM adapter in the machine.
+.TP 24
+.IR "udp6:10161"
+listen on port 10161 on all IPv6 interfaces.
+.TP 24
+.IR "ssh:127.0.0.1:22"
+Allows connections from the snmp subsystem on the ssh server on port
+22. The details of using SNMP over SSH are defined below.
+.TP 24
+.IR "dtlsudp:127.0.0.1:9161"
+Listen for connections over DTLS on UDP port 9161. The snmp.conf file
+must have the
+.IR serverCert,
+configuration tokens defined.
+.PP
+Note that not all the transport domains listed above will always be
+available; for instance, hosts with no IPv6 support will not be able
+to use udp6 transport addresses, and attempts to do so will result in
+the error "Error opening specified endpoint". Likewise, since AAL5
+PVC support is only currently available on Linux, it will fail with
+the same error on other platforms.
+.SH Transport Specific Notes
+.RS 0
+.TP 8
+ssh
+The SSH transport, on the server side, is actually just a unix
+named pipe that can be connected to via a ssh subsystem configured in
+the main ssh server. The pipe location (configurable with the
+sshtosnmpsocket token in snmp.conf) is
+.I /var/net\-snmp/sshtosnmp.
+Packets should be submitted to it via the sshtosnmp application, which
+also sends the user ID as well when starting the connection. The TSM
+security model should be used when packets should process it.
+.IP
+The
+.I sshtosnmp
+command knows how to connect to this pipe and talk to
+it. It should be configured in the
+.IR "OpenSSH sshd"
+configuration file (which is normally
+.IR "/etc/ssh/sshd_config"
+using the following configuration line:
+.TP 8
+.IP
+Subsystem snmp /usr/local/bin/sshtosnmp
+.IP
+The
+.I sshtosnmp
+command will need read/write access to the
+.I /var/net\-snmp/sshtosnmp
+pipe. Although it should be fairly safe to grant access to the
+average user since it still requires modifications to the ACM settings
+before the user can perform operations, paranoid administrators may
+want to make the /var/net\-snmp directory accessible only by users in a
+particular group. Use the
+.I sshtosnmpsocketperms
+snmp.conf configure option to set the permissions, owner and group of
+the created socket.
+.IP
+Access control can be granted to the user "foo" using the following
+style of simple snmpd.conf settings:
+.TP 8
+.IP
+rouser \-s tsm foo authpriv
+.IP
+Note that "authpriv" is acceptable assuming as SSH protects everything
+that way (assuming you have a non-insane setup).
+snmpd has no notion of how SSH has actually protected a packet and
+thus the snmp agent assumes all packets passed through the SSH
+transport have been protected at the authpriv level.
+.TP 8
+dtlsudp
+The DTLS protocol, which is based off of TLS, requires both client and
+server certificates to establish the connection and authenticate both
+sides. In order to do this, the client will need to configure the
+snmp.conf file
+with the
+.IR clientCert
+configuration tokens. The server will need to configure the snmp.conf
+file with the
+.IR serverCert
+configuration tokens defined.
+.IP
+Access control setup is similar to the ssh transport as the TSM
+security model should be used to protect the packet.
+.RE
+.SH CONFIGURATION FILES
+.PP
+.B snmpd
+checks for the existence of and parses the following files:
+.TP 6
+.B SYSCONFDIR/snmp/snmp.conf
+Common configuration for the agent and applications. See
+.I snmp.conf(5)
+for details.
+.TP
+.B SYSCONFDIR/snmp/snmpd.conf
+.TP
+.B SYSCONFDIR/snmp/snmpd.local.conf
+Agent-specific configuration. See
+.I snmpd.conf(5)
+for details. These files are optional and may be used to configure
+access control, trap generation, subagent protocols and much else
+besides.
+.IP
+In addition to these two configuration files in SYSCONFDIR/snmp, the
+agent will read any files with the names
+.I snmpd.conf
+and
+.I snmpd.local.conf
+in a colon separated path specified in the
+SNMPCONFPATH environment variable.
+.TP
+.B DATADIR/snmp/mibs/
+The agent will also load all files in this directory as MIBs. It will
+not, however, load any file that begins with a '.' or descend into
+subdirectories.
+.SH SEE ALSO
+(in recommended reading order)
+.PP
+snmp_config(5),
+snmp.conf(5),
+snmpd.conf(5)
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def
new file mode 100644
index 0000000..5f85f72
--- /dev/null
+++ b/man/snmpd.conf.5.def
@@ -0,0 +1,1769 @@
+.TH SNMPD.CONF 5 "30 Jun 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpd.conf - configuration file for the Net-SNMP SNMP agent
+.SH DESCRIPTION
+The Net-SNMP agent uses one or more configuration files
+to control its operation and the management information
+provided.
+These files (\fBsnmpd.conf\fR and \fBsnmpd.local.conf\fR)
+can be located in one of several locations, as described in the
+.I snmp_config(5)
+manual page.
+.PP
+The (perl) application
+.B snmpconf
+can be used to generate configuration files for the
+most common agent requirements. See the
+.I snmpconf(1)
+manual page for more information, or try running the
+command:
+.RS
+.IP "snmpconf \-g basic_setup"
+.RE
+.PP
+There are a large number of directives that can be specified,
+but these mostly fall into four distinct categories:
+.IP \(bu
+those controlling who can access the agent
+.IP \(bu
+those configuring the information that is supplied by the agent
+.IP \(bu
+those controlling active monitoring of the local system
+.IP \(bu
+those concerned with extending the functionality of the agent.
+.PP
+Some directives don't fall naturally into any of these four
+categories, but this covers the majority of the contents of
+a typical
+.B snmpd.conf
+file.
+A full list of recognised directives can be obtained by running
+the command:
+.RS
+.IP "snmpd \-H"
+.RE
+.SH AGENT BEHAVIOUR
+Although most configuration directives are concerned with the MIB
+information supplied by the agent, there are a handful of directives that
+control the behaviour of \fIsnmpd\fR considered simply as a daemon
+providing a network service.
+.IP "agentaddress [<transport-specifier>:]<transport-address>[,...]"
+defines a list of listening addresses, on which to receive incoming
+SNMP requests.
+See the section
+.B LISTENING ADDRESSES
+in the
+.I snmpd(8)
+manual page for more information about the format of listening
+addresses.
+.IP
+The default behaviour is to
+listen on UDP port 161 on all IPv4 interfaces.
+.IP "agentgroup {GROUP|#GID}"
+changes to the specified group after opening the listening port(s).
+This may refer to a group by name (GROUP), or a numeric group ID
+starting with '#' (#GID).
+.IP "agentuser {USER|#UID}"
+changes to the specified user after opening the listening port(s).
+This may refer to a user by name (USER), or a numeric user ID
+starting with '#' (#UID).
+.IP "leave_pidfile yes"
+instructs the agent to not remove its pid file on shutdown. Equivalent to
+specifying "\-U" on the command line.
+.IP "maxGetbulkRepeats NUM"
+Sets the maximum number of responses allowed for a single variable in
+a getbulk request. Set to 0 to enable the default and set it to \-1 to
+enable unlimited. Because memory is allocated ahead of time, sitting
+this to unlimited is not considered safe if your user population can
+not be trusted. A repeat number greater than this will be truncated
+to this value.
+.IP
+This is set by default to -1.
+.IP "maxGetbulkResponses NUM"
+Sets the maximum number of responses allowed for a getbulk request.
+This is set by default to 100. Set to 0 to enable the default and set
+it to \-1 to enable unlimited. Because memory is allocated ahead of
+time, sitting this to unlimited is not considered safe if your user
+population can not be trusted.
+.IP
+In general, the total number of responses will not be allowed to
+exceed the maxGetbulkResponses number and the total number returned
+will be an integer multiple of the number of variables requested times
+the calculated number of repeats allow to fit below this number.
+.IP
+Also not that processing of maxGetbulkRepeats is handled first.
+.SS SNMPv3 Configuration - Real Security
+SNMPv3 is added flexible security models to the SNMP packet structure
+so that multiple security solutions could be used. SNMPv3 was
+original defined with a "User-based Security Model" (USM) [RFC3414]
+that required maintaining a SNMP-specific user database. This was
+later determined to be troublesome to maintain and had some minor
+security issues. The IETF has since added additional security models
+to tunnel SNMP over SSH [RFC5592] and DTLS/TLS [RFC-to-be]. Net-SNMP
+contains robust support for SNMPv3/USM, SNMPv3/TLS, and SNMPv3/DTLS.
+It contains partial support for SNMPv3/SSH as well but has not been as
+extensively tested. It also contains code for support for an
+experimental Kerberos based SNMPv3 that never got standardized.
+.PP
+Hopefully more SNMP software and devices will eventually support SNMP
+over (D)TLS or SSH, but it is likely that devices with original
+support for SNMP will only contain support for USM users. If your
+network manager supports SNMP over (D)TLS or SNMP over SSH we suggest
+you use one of these mechanisms instead of using USM, but as always
+with Net-SNMP we give you the options to pick from so you can make the
+choice that is best for you.
+.SS SNMPv3 generic parameters
+These parameters are generic to all the forms of SNMPv3. The SNMPv3
+protocol defines "engineIDs" that uniquely identify an agent. The
+string must be consistent through time and should not change or
+conflict with another agent's engineID. Ever. Internally, Net-SNMP
+by default creates a unique engineID that is based off of the current system
+time and a random number. This should be sufficient for most users
+unless you're embedding our agent in a device where these numbers
+won't vary between boxes on the devices initial boot.
+.IP
+EngineIDs are used both as a "context" for selecting information from
+the device and SNMPv3 with USM uses it to create unique entries for
+users in its user table.
+.IP
+The Net-SNMP agent offers the following mechanisms for setting the
+engineID, but again you should only use them if you know what you're doing:
+.IP "engineID STRING"
+specifies that the engineID should be built from the given text STRING.
+.IP "engineIDType 1|2|3"
+specifies that the engineID should be built from the IPv4 address (1),
+IPv6 address (2) or MAC address (3). Note that changing the IP address
+(or switching the network interface card) may cause problems.
+.IP "engineIDNic INTERFACE"
+defines which interface to use when determining the MAC address.
+If \fIengineIDType 3\fR is not specified, then this directive
+has no effect.
+.IP
+The default is to use eth0.
+.\"
+.\" What if this doesn't exist ?
+.\"
+.SS SNMPv3 over TLS
+SNMPv3 may be tunneled over TLS and DTLS. TLS runs over TCP and DTLS
+is the UDP equivalent. Wes Hardaker (the founder of Net-SNMP)
+performed a study and presented it at an IETF meeting that showed that
+TCP based protocols are sufficient for stable networks but quickly
+becomes a problem in unstable networks with even moderate levels of
+packet loss (~ 20-30%). If you are going to use TLS or DTLS, you
+should use the one appropriate for your networking environment. You
+should potentially turn them both on so your management system can
+access either the UDP or the TCP port as needed.
+.PP
+Many of the configuration tokens described below are prefixed with
+a '[snmp]' tag. If you place these tokens in your snmpd.conf file,
+this take is required. See the snmp_config(5) manual page for the
+meaning of this context switch.
+.IP "[snmp] localCert <specifier>"
+This token defines the default X.509 public key to use as the server's
+identity. It should either be a fingerprint or a filename. To create
+a public key for use, please run the "net\-snmp\-cert" utility which
+will help you create the required certificate.
+.IP
+The default value for this is the certificate in the "snmpd" named
+certificate file.
+.IP "[snmp] tlsAlgorithms <algorithms>"
+This string will select the algorithms to use when negotiating
+security during (D)TLS session establishment. See the openssl manual
+page ciphers(1) for details on the format. Examples strings include:
+.RS
+.nf
+
+DEFAULT
+ALL
+HIGH
+HIGH:!AES128\-SHA
+.fi
+.RE
+.IP
+The default value is whatever openssl itself was configured with.
+.IP "[snmp] x059CRLFile"
+If you are using a Certificate Authority (CA) that publishes a
+Certificate Revocation List (CRL) then this token can be used to
+specify the location in the filesystem of a copy of the CRL file.
+Note that Net-SNMP will not pull a CRL over http and this must be a
+file, not a URL. Additionally, OpenSSL does not reload a CRL file
+when it has changed so modifications or updates to the file will only
+be noticed upon a restart of the snmpd agent.
+
+.IP "certSecName PRIORITY FINGERPRINT OPTIONS"
+OPTIONS can be one of <\-\-sn SECNAME | \-\-rfc822 | \-\-dns | \-\-ip | \-\-cn | \-\-any>.
+.IP
+The certSecName token will specify how to map a certificate field from
+the client's X.509 certificate to a SNMPv3 username. Use the \-\-sn
+SECNAME flag to directly specify a securityName for a given
+certificate. The other flags extract a particular component of the
+certificate for use as a snmpv3 securityName. These fields are one
+of: A SubjectAltName containing an rfc822 value (eg hardaker@net\-snmp.org),
+A SubjectAltName containing a dns name value (eg foo.net\-snmp.org),
+an IP address (eg 192.0.2.1) or a common name "Wes Hardaker". The
+\-\-any flag specifies that any of the subjecAltName fields may be
+used. Make sure once a securityName has been selected that it is
+given authorization via the VACM controls discussed later in this
+manual page.
+.IP
+See the http://www.net\-snmp.org/wiki/index.php/Using_DTLS web page for
+more detailed instructions for setting up (D)TLS.
+.IP "trustCert <specifier>"
+For X509 to properly verify a certificate, it should be verifiable up
+until a trust anchor for it. This trust anchor is typically a CA
+certificate but it could also be a self-signed certificate. The
+"trustCert" token should be used to load specific trust anchors into the
+verification engine.
+.PP
+SNMP over (D)TLS requires the use of the Transport Security Model
+(TSM), so read the section on the usage of the Transport Security
+Model as well. Make sure when you configure the VACM to accept
+connections from (D)TLS that you use the "tsm" security model. E.G.:
+.fi
+
+rwuser \-s tsm hardaker@net\-snmp.org
+.fi
+.SS SNMPv3 over SSH Support
+To use SSH, you'll need to configure sshd to invoke the sshtosnmp
+program as well as configure the access control settings to allow
+access through the tsm security model using the user name provided to
+snmpd by the ssh transport.
+.SS SNMPv3 with the Transport Security Model (TSM)
+The Transport Security Model [RFC5591] defines a SNMPv3 security
+system for use with "tunneled" security protocols like TLS, DTLS and
+SSH. It is a very simple security model that simply lets properly
+protected packets to pass through into the snmp application. The
+transport is required to pass a securityName to use to the TSM and the
+TSM may optionally prefix this with a transport string (see below).
+.IP "tsmUseTransportPrefix (1|yes|true|0|no|false)"
+If set to true, the TSM module will take every securityName passed to
+it from the transports underneath and prefix it with a string that
+specifically identities the transport it came from. This is useful to
+avoid securityName clashes with transports that generate identical
+security names. For example, if the ssh security transport delivered
+the security name of "hardaker" for a SSH connection and the TLS
+security transport also delivered the security name of "hardaker" for
+a TLS connection then it would be impossible to separate out these two
+users to provide separate access control rights. With the
+tsmUseTransportPrefix set to true, however, the securityNames would be
+prefixed appropriately with one of: "tls:", "dtls:" or "ssh:".
+.SS SNMPv3 with the User-based Security Model (USM)
+SNMPv3 was originally defined using the User-Based Security Model
+(USM), which contains a private list of users and keys specific to the
+SNMPv3 protocol. The operational community, however, declared it a
+pain to manipulate yet another database and would prefer to use
+existing infrastructure. To that end the IETF created the ISMS
+working group to battle that problem, and the ISMS working group
+decided to tunnel SNMP over SSH and DTLS to make use existing user and
+authentication infrastructures.
+.SS SNMPv3 USM Users
+To use the USM based SNMPv3-specific users, you'll need to create
+them. It is recommended you
+.B "use the net\-snmp\-config command"
+to do this, but you can also do it by directly specifying createUser
+directives yourself instead:
+.IP "createUser [\-e ENGINEID] username (MD5|SHA) authpassphrase [DES|AES] [privpassphrase]"
+.IP
+MD5 and SHA are the authentication types to use. DES and AES are the
+privacy protocols to use. If the privacy
+passphrase is not specified, it is assumed to be the same as the
+authentication passphrase. Note that the users created will be
+useless unless they are also added to the VACM access control tables
+described above.
+.IP
+SHA authentication and DES/AES privacy require OpenSSL to be installed and
+the agent to be built with OpenSSL support. MD5 authentication may be
+used without OpenSSL.
+.IP
+Warning: the minimum pass phrase length is 8 characters.
+.IP
+SNMPv3 users can be created at runtime using the
+.I snmpusm(1)
+command.
+.IP
+Instead of figuring out how to use this directive and where to put it
+(see below), just run "net\-snmp\-config \-\-create\-snmpv3\-user" instead,
+which will add one of these lines to the right place.
+.IP
+This directive should be placed into the
+PERSISTENT_DIRECTORY/snmpd.conf file instead of the other normal
+locations. The reason is that the information is read from the file
+and then the line is removed (eliminating the storage of the master
+password for that user) and replaced with the key that is derived from
+it. This key is a localized key, so that if it is stolen it can not
+be used to access other agents. If the password is stolen, however,
+it can be.
+.IP
+If you need to localize the user to a particular EngineID (this is
+useful mostly in the similar snmptrapd.conf file), you can use the \-e
+argument to specify an EngineID as a hex value (EG, "0x01020304").
+.IP
+If you want to generate either your master or localized keys directly,
+replace the given password with a hexstring (preceded by a "0x") and
+precede the hex string by a \-m or \-l token (respectively). EGs:
+.IP
+.RS
+.nf
+[these keys are *not* secure but are easy to visually parse for
+counting purposes. Please generate random keys instead of using
+these examples]
+
+createUser myuser SHA \-l 0x0001020304050607080900010203040506070809 AES \-l 0x00010203040506070809000102030405
+createUser myuser SHA \-m 0x0001020304050607080900010203040506070809 AES \-m 0x0001020304050607080900010203040506070809
+.fi
+.RE
+.IP
+Due to the way localization happens, localized privacy keys are
+expected to be the length needed by the algorithm (128 bits for all
+supported algorithms). Master encryption keys, though, need to be the
+length required by the authentication algorithm not the length
+required by the encrypting algorithm (MD5: 16 bytes, SHA: 20 bytes).
+.SH ACCESS CONTROL
+.B snmpd
+supports the View-Based Access Control Model (VACM) as defined in RFC
+2575, to control who can retrieve or update information. To this end,
+it recognizes various directives relating to access control.
+.SS Traditional Access Control
+Most simple access control requirements can be specified using the
+directives \fIrouser\fR/\fIrwuser\fR (for SNMPv3) or
+\fIrocommunity\fR/\fIrwcommunity\fR (for SNMPv1 or SNMPv2c).
+.IP "rouser [\-s SECMODEL] USER [noauth|auth|priv [OID | \-V VIEW [CONTEXT]]]"
+.IP "rwuser [\-s SECMODEL] USER [noauth|auth|priv [OID | \-V VIEW [CONTEXT]]]"
+specify an SNMPv3 user that will be allowed read-only (GET and GETNEXT)
+or read-write (GET, GETNEXT and SET) access respectively.
+By default, this will provide access to the full OID tree for authenticated
+(including encrypted) SNMPv3 requests, using the default context.
+An alternative minimum security level can be specified using \fInoauth\fR
+(to allow unauthenticated requests), or \fIpriv\fR (to enforce use of
+encryption). The OID field restricts access for that
+user to the subtree rooted at the given OID, or the named view.
+An optional context can also be specified, or "context*" to denote a context
+prefix. If no context field is specified (or the token "*" is used), the
+directive will match all possible contexts.
+.IP
+If SECMODEL is specified then it will be the security model required
+for that user (note that identical user names may come in over
+different security models and will be appropriately separated via the
+access control settings). The default security model is "usm" and the
+other common security models are likely "tsm" when using (D)TLS or SSH
+support and "ksm" if the Kerberos support has been compiled in.
+.IP "rocommunity COMMUNITY [SOURCE [OID | \-V VIEW [CONTEXT]]]"
+.IP "rwcommunity COMMUNITY [SOURCE [OID | \-V VIEW [CONTEXT]]]"
+specify an SNMPv1 or SNMPv2c community that will be allowed read-only
+(GET and GETNEXT) or read-write (GET, GETNEXT and SET) access respectively.
+By default, this will provide access to the full OID tree for such requests,
+regardless of where they were sent from. The SOURCE token can be used to
+restrict access to requests from the specified system(s) - see
+\fIcom2sec\fR for the full details. The OID field restricts access for
+that community to the subtree rooted at the given OID, or named view.
+Contexts are typically less relevant to community-based SNMP versions,
+but the same behaviour applies here.
+.IP "rocommunity6 COMMUNITY [SOURCE [OID | \-V VIEW [CONTEXT]]]"
+.IP "rwcommunity6 COMMUNITY [SOURCE [OID | \-V VIEW [CONTEXT]]]"
+are directives relating to requests received using IPv6
+(if the agent supports such transport domains).
+The interpretation of the SOURCE, OID, VIEW and CONTEXT tokens are exactly
+the same as for the IPv4 versions.
+.PP
+In each case, only one directive should be specified for a given SNMPv3 user,
+or community string.
+It is \fBnot\fR appropriate to specify both \fIrouser\fR
+and \fIrwuser\fR directives referring to the same SNMPv3 user (or equivalent
+community settings). The \fIrwuser\fR directive provides all the access
+of \fIrouser\fR (as well as allowing SET support).
+The same holds true for the community-based directives.
+.PP
+More complex access requirements (such as access to two
+or more distinct OID subtrees, or different views for GET and SET requests)
+should use one of the other access control mechanisms.
+Note that if several distinct communities or SNMPv3 users need to be granted
+the same level of access, it would also be more efficient to use the main VACM
+configuration directives.
+.SS VACM Configuration
+The full flexibility of the VACM is available using four configuration
+directives \- \fIcom2sec\fR, \fIgroup\fR, \fIview\fR and \fIaccess\fR.
+These provide direct configuration of the underlying VACM tables.
+.IP "com2sec [\-Cn CONTEXT] SECNAME SOURCE COMMUNITY"
+.IP "com2sec6 [\-Cn CONTEXT] SECNAME SOURCE COMMUNITY"
+map an SNMPv1 or SNMPv2c community string to a security name - either from
+a particular range of source addresses, or globally (\fI"default"\fR).
+A restricted source can either be a specific hostname (or address), or
+a subnet - represented as IP/MASK (e.g. 10.10.10.0/255.255.255.0), or
+IP/BITS (e.g. 10.10.10.0/24), or the IPv6 equivalents.
+.IP
+The same community string can be specified in several separate directives
+(presumably with different source tokens), and the first source/community
+combination that matches the incoming request will be selected.
+Various source/community combinations can also map to the same security name.
+.IP
+If a CONTEXT is specified (using \fI\-Cn\fR), the community string will be
+mapped to a security name in the named SNMPv3 context. Otherwise the
+default context ("") will be used.
+.IP "com2secunix [\-Cn CONTEXT] SECNAME SOCKPATH COMMUNITY"
+is the Unix domain sockets version of \fIcom2sec\fR.
+.IP "group GROUP {v1|v2c|usm|tsm|ksm} SECNAME"
+maps a security name (in the specified security model) into
+a named group. Several \fIgroup\fR directives can specify the
+same group name, allowing a single access setting to apply to several
+users and/or community strings.
+.IP
+Note that groups must be set up for the two community-based models separately -
+a single \fIcom2sec\fR (or equivalent) directive will typically be
+accompanied by \fBtwo\fR \fIgroup\fR directives.
+.IP "view VNAME TYPE OID [MASK]"
+defines a named "view" - a subset of the overall OID tree. This is most
+commonly a single subtree, but several \fIview\fR directives can be given
+with the same view name (VNAME), to build up a more complex collection of OIDs.
+TYPE is either \fIincluded\fR or \fIexcluded\fR, which can again define
+a more complex view (e.g by excluding certain sensitive objects
+from an otherwise accessible subtree).
+.IP
+MASK is a list of hex octets (optionally separated by '.' or ':') with
+the set bits indicating which subidentifiers in the view OID to match
+against. If not specified, this defaults to matching the OID exactly
+(all bits set), thus defining a simple OID subtree. So:
+.RS
+.RS
+view iso1 included .iso 0xf0
+.br
+view iso2 included .iso
+.br
+view iso3 included .iso.org.dod.mgmt 0xf0
+.RE
+.RE
+.IP
+would all define the same view, covering the whole of the 'iso(1)' subtree
+(with the third example ignoring the subidentifiers not covered by the mask).
+.IP
+More usefully, the mask can be used to define a view covering a particular
+row (or rows) in a table, by matching against the appropriate table index
+value, but skipping the column subidentifier:
+.RS
+.RS
+.IP "view ifRow4 included .1.3.6.1.2.1.2.2.1.0.4 0xff:a0"
+.RE
+.RE
+.IP
+Note that a mask longer than 8 bits must use ':' to separate the individual
+octets.
+.IP "access GROUP CONTEXT {any|v1|v2c|usm|tsm|ksm} LEVEL PREFX READ WRITE NOTIFY"
+maps from a group of users/communities (with a particular security model
+and minimum security level, and in a specific context) to one of three views,
+depending on the request being processed.
+.IP
+LEVEL is one of \fInoauth\fR, \fIauth\fR, or \fIpriv\fR.
+PREFX specifies how CONTEXT should be matched against the context of
+the incoming request, either \fIexact\fR or \fIprefix\fR.
+READ, WRITE and NOTIFY specifies the view to be used for GET*, SET
+and TRAP/INFORM requests (althought the NOTIFY view is not currently used).
+For v1 or v2c access, LEVEL will need to be \fInoauth\fR.
+.SS Typed-View Configuration
+The final group of directives extend the VACM approach into a more flexible
+mechanism, which can be applied to other access control requirements. Rather than
+the fixed three views of the standard VACM mechanism, this can be used to
+configure various different view types. As far as the main SNMP agent is
+concerned, the two main view types are \fIread\fR and \fIwrite\fR,
+corresponding to the READ and WRITE views of the main \fIaccess\fR directive.
+See the 'snmptrapd.conf(5)' man page for discussion of other view types.
+.IP "authcommunity TYPES COMMUNITY [SOURCE [OID | \-V VIEW [CONTEXT]]]"
+is an alternative to the \fIrocommunity\fR/\fIrwcommunity\fR directives.
+TYPES will usually be \fIread\fR or \fIread,write\fR respectively.
+The view specification can either be an OID subtree (as before),
+or a named view (defined using the
+\fIview\fR directive) for greater flexibility. If this is omitted,
+then access will be allowed to the full OID tree.
+If CONTEXT is specified, access is configured within this SNMPv3 context.
+Otherwise the default context ("") is used.
+.IP "authuser TYPES [\-s MODEL] USER [LEVEL [OID | \-V VIEW [CONTEXT]]]"
+is an alternative to the \fIrouser\fR/\fIrwuser\fR directives.
+The fields TYPES, OID, VIEW and CONTEXT have the same meaning as for
+\fIauthcommunity\fR.
+.IP "authgroup TYPES [\-s MODEL] GROUP [LEVEL [OID | \-V VIEW [CONTEXT]]]"
+is a companion to the \fIauthuser\fR directive, specifying access
+for a particular group (defined using the \fIgroup\fR directive as usual).
+Both \fIauthuser\fR and \fIauthgroup\fR default to authenticated requests -
+LEVEL can also be specified as \fInoauth\fR or \fIpriv\fR to allow
+unauthenticated requests, or require encryption respectively.
+Both \fIauthuser\fR and \fIauthgroup\fR directives also default to configuring
+access for SNMPv3/USM requests - use the '\-s' flag to specify an alternative
+security model (using the same values as for \fIaccess\fR above).
+.IP "authaccess TYPES [\-s MODEL] GROUP VIEW [LEVEL [CONTEXT]]"
+also configures the access for a particular group,
+specifying the name and type of view to apply. The MODEL and LEVEL fields
+are interpreted in the same way as for \fIauthgroup\fR.
+If CONTEXT is specified, access is configured within this SNMPv3 context
+(or contexts with this prefix if the CONTEXT field ends with '*').
+Otherwise the default context ("") is used.
+.IP "setaccess GROUP CONTEXT MODEL LEVEL PREFIX VIEW TYPES"
+is a direct equivalent to the original \fIaccess\fR directive, typically
+listing the view types as \fIread\fR or \fIread,write\fR as appropriate.
+(or see 'snmptrapd.conf(5)' for other possibilities).
+All other fields have the same interpretation as with \fIaccess\fR.
+.SH SYSTEM INFORMATION
+Most of the information reported by the Net-SNMP agent is retrieved
+from the underlying system, or dynamically configured via SNMP SET requests
+(and retained from one run of the agent to the next).
+However, certain MIB objects can be configured or controlled via
+the \fIsnmpd.conf(5)\fR file.
+.SS System Group
+Most of the scalar objects in the 'system' group can be configured
+in this way:
+.IP "sysLocation STRING"
+.IP "sysContact STRING"
+.IP "sysName STRING"
+set the system location, system contact or system name
+(\fCsysLocation.0\fR, \fCsysContact.0\fR and \fCsysName.0\fR) for the agent respectively.
+Ordinarily these objects are writable via suitably authorized SNMP SET
+requests. However, specifying one of these directives makes the
+corresponding object read-only, and attempts to SET it will result in
+a \fInotWritable\fR error response.
+.IP "sysServices NUMBER"
+sets the value of the \fCsysServices.0\fR object.
+For a host system, a good value is 72 (application + end-to-end layers).
+If this directive is not specified, then no value will be reported
+for the \fCsysServices.0\fR object.
+.IP "sysDescr STRING"
+.IP "sysObjectID OID"
+sets the system description or object ID for the agent.
+Although these MIB objects are not SNMP-writable, these directives can be
+used by a network administrator to configure suitable values for them.
+.SS Interfaces Group
+.IP "interface NAME TYPE SPEED"
+can be used to provide appropriate type and speed settings for
+interfaces where the agent fails to determine this information correctly.
+TYPE is a type value as given in the IANAifType\-MIB,
+and can be specified numerically or by name (assuming this MIB is loaded).
+.IP "interface_fadeout TIMEOUT"
+specifies, for how long the agent keeps entries in \fCifTable\fR after
+appropriate interfaces have been removed from system (typically various ppp,
+tap or tun interfaces). Timeout value is in seconds. Default value is 300
+(=5 minutes).
+.IP "interface_replace_old yes"
+can be used to remove already existing entries in \fCifTable\fR when an
+interface with the same name appears on the system. E.g. when ppp0 interface
+is removed, it is still listed in the table for \fIinterface_fadeout\fR
+seconds. This option ensures, that the old ppp0 interface is removed even
+before the \fIinterface_fadeout\fR timeour when new ppp0 (with different
+\fCifIndex\fR) shows up.
+.SS Host Resources Group
+This requires that the agent was built with support for the
+\fIhost\fR module (which is now included as part of the default build
+configuration on the major supported platforms).
+.\"
+.\" XXX - .IP "scandisk STRING"
+.\"
+.IP "ignoreDisk STRING"
+controls which disk devices are scanned as part of populating the
+\fChrDiskStorageTable\fR (and \fChrDeviceTable\fR).
+The HostRes implementation code includes a list of disk device patterns
+appropriate for the current operating system, some of which may cause
+the agent to block when trying to open the corresponding disk devices.
+This might lead to a timeout when walking these tables, possibly
+resulting in inconsistent behaviour. This directive can be used
+to specify particular devices (either individually or wildcarded)
+that should not be checked.
+.RS
+.IP "Note:"
+Please consult the source (\fIhost/hr_disk.c\fR) and check for the
+\fIAdd_HR_Disk_entry\fR calls relevant for a particular O/S
+to determine the list of devices that will be scanned.
+.RE
+.IP
+The pattern can include one or more wildcard expressions.
+See \fIsnmpd.examples(5)\fR for illustration of the wildcard syntax.
+.IP "skipNFSInHostResources true"
+controls whether NFS and NFS-like file systems should be omitted
+from the hrStorageTable (true or 1) or not (false or 0, which is the default).
+If the Net-SNMP agent gets hung on NFS-mounted filesystems, you
+can try setting this to '1'.
+.IP "storageUseNFS [1|2]"
+controls how NFS and NFS-like file systems should be reported
+in the hrStorageTable.
+as 'Network Disks' (1) or 'Fixed Disks' (2)
+Historically, the Net-SNMP agent has reported such file systems
+as 'Fixed Disks', and this is still the default behaviour.
+Setting this directive to '1' reports such file systems as
+\'Network Disks', as required by the Host Resources MIB.
+.IP "realStorageUnits"
+controlls how the agent reports hrStorageAllocationUnits, hrStorageSize and
+hrStorageUsed in hrStorageTable.
+For big storage drives with small allocation units the agent re-calculates
+these values so they all fit Integer32 and
+hrStorageAllocationUnits x hrStorageSize
+gives real size of the storage.
+.RS
+.IP "Example:"
+Linux xfs 16TB filesystem with 4096 bytes large blocks will be
+reported as hrStorageAllocationUnits = 8192 and hrStorageSize = 2147483647,
+so 8192 x 2147483647 gives real size of the filesystem (=16 TB).
+.RE
+.IP
+Setting this directive to '1' turns off
+this calculation and the agent reports real hrStorageAllocationUnits, but it
+might report wrong hrStorageSize for big drives because the value won't fit into
+Integer32. In this case, hrStorageAllocationUnits x hrStorageSize won't give
+real size of the storage.
+.SS Process Monitoring
+The \fChrSWRun\fR group of the Host Resources MIB provides
+information about individual processes running on the local system.
+The \fCprTable\fR of the UCD\-SNMP\-MIB complements this by reporting
+on selected services (which may involve multiple processes).
+This requires that the agent was built with support for the
+\fIucd\-snmp/proc\fR module (which is included as part of the
+default build configuration).
+.IP "proc NAME [MAX [MIN]]"
+monitors the number of processes called NAME (as reported by PSCMD)
+running on the local system.
+.IP
+If the number of NAMEd processes is less than MIN or greater than MAX,
+then the corresponding \fCprErrorFlag\fR instance will be
+set to 1, and a suitable description message reported via the
+\fCprErrMessage\fR instance.
+.RS
+.IP "Note:"
+This situation will \fBnot\fR automatically trigger a trap to report
+the problem - see the DisMan Event MIB section later.
+.RE
+.IP
+If neither MAX nor MIN are specified, they will
+default to \fBinfinity\fR and 1 respectively ("at least one").
+If only MAX is specified, MIN will default to 0 ("no more than MAX").
+If MAX is 0 (and MIN is not), this indicates infinity ("at least MIN").
+If both MAX and MIN are 0, this indicates a process that should \fBnot\fP
+be running.
+.IP "procfix NAME PROG ARGS"
+registers a command that can be run to fix errors with the given
+process NAME. This will be invoked when the corresponding
+\fCprErrFix\fR instance is set to 1.
+.RS
+.IP "Note:"
+This command will \fBnot\fR be invoked automatically.
+.\" XXX - but see the DisMan Event MIB section later ???
+.RE
+.IP
+The \fIprocfix\fR directive must be specified \fBafter\fR the matching
+\fIproc\fR directive, and cannot be used on its own.
+.PP
+If no \fIproc\fR directives are defined, then walking the
+\fCprTable\fR will fail (\fInoSuchObject\fI).
+.SS Disk Usage Monitoring
+This requires that the agent was built with support for the
+\fIucd\-snmp/disk\fR module (which is included as part of the
+default build configuration).
+.IP "disk PATH [ MINSPACE | MINPERCENT% ]"
+monitors the disk mounted at PATH for available disk space.
+.IP
+The minimum threshold can either be specified in kB (MINSPACE) or
+as a percentage of the total disk (MINPERCENT% with a '%' character),
+defaulting to 100kB if neither are specified.
+If the free disk space falls below this threshold,
+then the corresponding \fCdskErrorFlag\fR instance will be
+set to 1, and a suitable description message reported via the
+\fCdskErrorMsg\fR instance.
+.RS
+.IP "Note:"
+This situation will \fBnot\fR automatically trigger a trap to report
+the problem - see the DisMan Event MIB section later.
+.RE
+.IP "includeAllDisks MINPERCENT%"
+configures monitoring of all disks found on the system,
+using the specified (percentage) threshold.
+The threshold for individual disks can be adjusted using suitable
+\fIdisk\fR directives (which can come either before or after the
+\fIincludeAllDisks\fR directive).
+.RS
+.IP "Note:"
+Whether \fIdisk\fR directives appears before or after \fIincludeAllDisks\fR
+may affect the indexing of the \fCdskTable\fR.
+.RE
+.IP
+Only one \fIincludeAllDisks\fR directive should be specified - any
+subsequent copies will be ignored.
+.IP
+The list of mounted disks will be determined when the agent starts using the
+setmntent(3) and getmntent(3), or fopen(3) and getmntent(3), or
+setfsent(3) and getfsent(3) system calls. If none of the above
+system calls are available then the root partition "/"
+(which is assumed to exist on any UNIX based system) will be monitored.
+Disks mounted after the agent has started will not be monitored.
+.\"
+.\" XXX - unless the config is re-read ??
+.\"
+.PP
+If neither any \fIdisk\fR directives or \fIincludeAllDisks\fR are defined,
+then walking the \fCdskTable\fR will fail (\fInoSuchObject\fI).
+.SS Disk I/O Monitoring
+This requires that the agent was built with support for the
+\fIucd\-snmp/diskio\fR module (which is not included as part of the
+default build configuration).
+.PP
+By default, all block devices known to the operating system are
+included in the diskIOTable. On platforms other than Linux, this module
+has no configuration directives.
+.PP
+On Linux systems, it is possible to exclude several classes of block
+devices from the diskIOTable in order to avoid cluttering the table with
+useless zero statistics for pseudo-devices that often are not in use but
+are configured by default to exist in most recent Linux distributions.
+.IP "diskio_exclude_fd yes"
+Excludes all Linux floppy disk block devices, whose names start with "fd",
+e.g. "fd0"
+.IP "diskio_exclude_loop yes"
+Excludes all Linux loopback block devices, whose names start with "loop",
+e.g. "loop0"
+.IP "diskio_exclude_ram yes"
+Excludes all LInux ramdisk block devices, whose names start with "ram", e.g.
+"ram0"
+.SS System Load Monitoring
+This requires that the agent was built with support for either the
+\fIucd\-snmp/loadave\fR module or the \fIucd\-snmp/memory\fR module
+respectively (both of which are included as part of the
+default build configuration).
+.IP "load MAX1 [MAX5 [MAX15]]"
+monitors the load average of the local system, specifying
+thresholds for the 1-minute, 5-minute and 15-minute averages.
+If any of these loads exceed the associated maximum value,
+then the corresponding \fClaErrorFlag\fR instance will be
+set to 1, and a suitable description message reported via the
+\fClaErrMessage\fR instance.
+.RS
+.IP "Note:"
+This situation will \fBnot\fR automatically trigger a trap to report
+the problem - see the DisMan Event MIB section later.
+.RE
+.IP
+If the MAX15 threshold is omitted, it will default to the MAX5 value.
+If both MAX5 and MAX15 are omitted, they will default to the MAX1 value.
+If this directive is not specified, all three thresholds will
+default to a value of DEFMAXLOADAVE.
+.IP
+If a threshold value of 0 is given, the agent will not report errors
+via the relevant \fClaErrorFlag\fR or \fClaErrMessage\fR instances,
+regardless of the current load.
+.PP
+Unlike the \fIproc\fR and \fIdisk\fR directives, walking the
+walking the \fClaTable\fR will succeed (assuming the
+\fIucd\-snmp/loadave\fR module was configured into the agent),
+even if the \fIload\fR directive is not present.
+.IP "swap MIN "
+monitors the amount of swap space available on the local system.
+If this falls below the specified threshold (MIN kB),
+then the \fImemErrorSwap\fR object will be set to 1,
+and a suitable description message reported via \fImemSwapErrorMsg\fR.
+.RS
+.IP "Note:"
+This situation will \fBnot\fR automatically trigger a trap to report
+the problem - see the DisMan Event MIB section later.
+.RE
+If this directive is not specified, the default threshold is 16 MB.
+.SS Log File Monitoring
+This requires that the agent was built with support for either the
+\fIucd\-snmp/file\fR or \fIucd\-snmp/logmatch\fR modules respectively
+(both of which are included as part of the
+default build configuration).
+.IP "file FILE [MAXSIZE]"
+monitors the size of the specified file (in kB).
+If MAXSIZE is specified, and the size of the file exceeds
+this threshold, then the corresponding \fCfileErrorFlag\fR
+instance will be set to 1, and a suitable description message reported
+via the \fCfileErrorMsg\fR instance.
+.RS
+.IP "Note:"
+This situation will \fBnot\fR automatically trigger a trap to report
+the problem - see the DisMan Event MIB section later.
+.RE
+.IP
+Note: A maximum of 20 files can be monitored.
+.IP
+Note: If no \fIfile\fR directives are defined, then walking the
+\fCfileTable\fR will fail (\fInoSuchObject\fR).
+.IP "logmatch NAME FILE CYCLETIME REGEX"
+monitors the specified file for occurances of the specified
+pattern REGEX. The file position is stored internally so the entire file
+is only read initially, every subsequent pass will only read the new lines
+added to the file since the last read.
+.RS
+.IP NAME
+name of the logmatch instance (will appear as logMatchName under
+logMatch/logMatchTable/logMatchEntry/logMatchName in the ucd\-snmp MIB tree)
+.IP FILE
+absolute path to the logfile to be monitored. Note that this path
+can contain date/time directives (like in the UNIX 'date' command). See the
+manual page for 'strftime' for the various directives accepted.
+.IP CYCLETIME
+time interval for each logfile read and internal variable update in seconds.
+Note: an SNMPGET* operation will also trigger an immediate logfile read and
+variable update.
+.IP REGEX
+the regular expression to be used. Note: DO NOT enclose the regular expression
+in quotes even if there are spaces in the expression as the quotes will also
+become part of the pattern to be matched!
+.RE
+.IP
+Example:
+.RS
+.IP
+logmatch apache\-GETs /usr/local/apache/logs/access.log\-%Y\-%m\-%d 60 GET.*HTTP.*
+.IP
+This logmatch instance is named 'apache\-GETs', uses 'GET.*HTTP.*' as its
+regular expression and it will monitor the file named
+(assuming today is May 6th 2009): '/usr/local/apache/logs/access.log\-2009\-05\-06',
+tomorrow it will look for 'access.log\-2009\-05\-07'. The logfile is read every 60
+seconds.
+.RE
+.IP
+Note: A maximum of 250 logmatch directives can be specified.
+.IP
+Note: If no \fIlogmatch\fR directives are defined, then walking the
+\fClogMatchTable\fR will fail (\fInoSuchObject\fI).
+.SH "ACTIVE MONITORING"
+The usual behaviour of an SNMP agent is to wait for incoming SNMP requests
+and respond to them - if no requests are received, an agent will typically
+not initiate any actions. This section describes various directives that
+can configure \fIsnmpd\fR to take a more active role.
+.SS "Notification Handling"
+.IP "trapcommunity STRING"
+defines the default community string to be used when sending traps.
+Note that this directive must be used prior to any community-based
+trap destination directives that need to use it.
+.IP "trapsink HOST [COMMUNITY [PORT]]"
+.IP "trap2sink HOST [COMMUNITY [PORT]]"
+.IP "informsink HOST [COMMUNITY [PORT]]"
+define the address of a notification receiver that should be sent
+SNMPv1 TRAPs, SNMPv2c TRAP2s, or SNMPv2 INFORM notifications respectively.
+See the section
+.B LISTENING ADDRESSES
+in the
+.I snmpd(8)
+manual page for more information about the format of listening
+addresses.
+If COMMUNITY is not specified, the most recent \fItrapcommunity\fR
+string will be used.
+.IP
+If the transport address does not include an explicit
+port specification, then PORT will be used.
+If this is not specified, the well known SNMP trap
+port (162) will be used.
+.RS
+.IP Note:
+This mechanism is being deprecated, and the listening port
+should be specified via the transport specification HOST instead.
+.RE
+.IP
+If several sink directives are specified, multiple
+copies of each notification (in the appropriate formats)
+will be generated.
+.RS
+.IP Note:
+It is \fBnot\fR normally appropriate to list two (or all three)
+sink directives with the same destination.
+.RE
+.IP "trapsess [SNMPCMD_ARGS] HOST"
+provides a more generic mechanism for defining notification destinations.
+.I "SNMPCMD_ARGS"
+should be the command-line options required for an equivalent
+\fIsnmptrap\fR (or \fIsnmpinform\fR) command to send the desired notification.
+The option \fI\-Ci\fR can be used (with \fI\-v2c\fR or \fI\-v3\fR) to generate
+an INFORM notification rather than an unacknowledged TRAP.
+.IP
+This is the appropriate directive for defining SNMPv3 trap receivers.
+See
+http://www.net\-snmp.org/tutorial/tutorial\-5/commands/snmptrap\-v3.html
+for more information about SNMPv3 notification behaviour.
+.IP "authtrapenable {1|2}"
+determines whether to generate authentication failure traps
+(\fIenabled(1)\fR) or not (\fIdisabled(2)\fR - the default).
+Ordinarily the corresponding MIB
+object (\fCsnmpEnableAuthenTraps.0\fR) is read-write, but specifying
+this directive makes this object read-only, and attempts to set the
+value via SET requests will result in a \fInotWritable\fR error response.
+.RE
+.IP "v1trapaddress HOST"
+defines the agent address, which is inserted into SNMPv1 TRAPs. Arbitrary local
+IPv4 address is chosen if this option is ommited. This option is useful mainly
+when the agent is visible from outside world by specific address only (e.g.
+because of network address translation or firewall).
+.SS "DisMan Event MIB"
+The previous directives can be used to configure where traps should
+be sent, but are not concerned with \fIwhen\fR to send such traps
+(or what traps should be generated). This is the domain of the
+Event MIB - developed by the Distributed Management (DisMan)
+working group of the IETF.
+.PP
+This requires that the agent was built with support for the
+\fIdisman/event\fR module (which is now included as part of the
+default build configuration for the most recent distribution).
+.RS
+.IP "Note:"
+The behaviour of the latest implementation differs in some minor
+respects from the previous code - nothing too significant, but
+existing scripts may possibly need some minor adjustments.
+.RE
+.IP "iquerySecName NAME"
+.IP "agentSecName NAME"
+specifies the default SNMPv3 username, to be used when making internal
+queries to retrieve any necessary information (either for evaluating
+the monitored expression, or building a notification payload).
+These internal queries always use SNMPv3, even if normal querying
+of the agent is done using SNMPv1 or SNMPv2c.
+.IP
+Note that this user must also be explicitly created (\fIcreateUser\fR)
+and given appropriate access rights (e.g. \fIrouser\fR). This
+directive is purely concerned with defining \fIwhich\fR user should
+be used - not with actually setting this user up.
+.\"
+.\" XXX - Should it create the user as well?
+.\"
+.\" .IP "iqueryVersion "
+.\" .IP "iquerySecLevel "
+.\"
+.IP "monitor [OPTIONS] NAME EXPRESSION"
+defines a MIB object to monitor.
+If the EXPRESSION condition holds (see below), then this will trigger
+the corresponding event, and either send a notification or apply
+a SET assignment (or both).
+Note that the event will only be triggered once, when the expression
+first matches. This monitor entry will not fire again until the
+monitored condition first becomes false, and then matches again.
+NAME is an administrative name for this expression, and is used for
+indexing the \fCmteTriggerTable\fR (and related tables).
+Note also that such monitors use an internal SNMPv3 request to retrieve
+the values being monitored (even if normal agent queries typically use
+SNMPv1 or SNMPv2c). See the \fIiquerySecName\fP token described above.
+.IP "\fIEXPRESSION\fR"
+There are three types of monitor expression supported by the Event MIB -
+existence, boolean and threshold tests.
+.RS
+.IP "OID | ! OID | != OID"
+defines an \fIexistence(0)\fR monitor test.
+A bare OID specifies a \fIpresent(0)\fR test, which will fire when
+(an instance of) the monitored OID is created.
+An expression of the form \fI! OID\fR specifies an \fIabsent(1)\fR test,
+which will fire when the monitored OID is delected.
+An expression of the form \fI!= OID\fR specifies a \fIchanged(2)\fR test,
+which will fire whenever the monitored value(s) change.
+Note that there \fBmust\fP be whitespace before the OID token.
+.IP "OID OP VALUE"
+defines a \fIboolean(1)\fR monitor test.
+OP should be one of the defined
+comparison operators (!=, ==, <, <=, >, >=) and VALUE should be an
+integer value to compare against.
+Note that there \fBmust\fP be whitespace around the OP token.
+A comparison such as \fCOID !=0\fP will not be handled correctly.
+.IP "OID MIN MAX [DMIN DMAX]"
+defines a \fIthreshold(2)\fR monitor test.
+MIN and MAX are integer values, specifying lower and upper thresholds.
+If the value of the monitored OID falls below the lower threshold (MIN)
+or rises above the upper threshold (MAX), then the monitor entry will
+trigger the corresponding event.
+.IP
+Note that the rising threshold event will only be re-armed when
+the monitored value falls below the \fBlower\fR threshold (MIN).
+Similarly, the falling threshold event will be re-armed by
+the upper threshold (MAX).
+.IP
+The optional parameters DMIN and DMAX configure a pair of
+similar threshold tests, but working with the delta
+differences between successive sample values.
+.RE
+.IP "\fIOPTIONS\fR"
+There are various options to control the behaviour of the monitored
+expression. These include:
+.RS
+.IP "\-D"
+indicates that the expression should be evaluated using delta differences
+between sample values (rather than the values themselves).
+.IP "\-d OID"
+.IP "\-di OID"
+specifies a discontinuity marker for validating delta differences.
+A \fI\-di\fR object instance will be used exactly as given.
+A \fI\-d\fR object will have the instance subidentifiers from the
+corresponding (wildcarded) expression object appended.
+If the \fI\-I\fR flag is specified, then there is no difference
+between these two options.
+.IP
+This option also implies \fI\-D\fR.
+.IP "\-e EVENT"
+specifies the event to be invoked when this monitor entry is triggered.
+If this option is not given, the monitor entry will generate one
+of the standard notifications defined in the DISMAN\-EVENT\-MIB.
+.IP "\-I"
+indicates that the monitored expression should be applied to the
+specified OID as a single instance. By default, the OID will
+be treated as a wildcarded object, and the monitor expanded
+to cover all matching instances.
+.IP "\-i OID"
+.IP "\-o OID"
+define additional varbinds to be added to the notification payload
+when this monitor trigger fires.
+For a wildcarded expression, the suffix of the matched instance
+will be added to any OIDs specified using \fI\-o\fR, while OIDs
+specified using \fI\-i\fR will be treated as exact instances.
+If the \fI\-I\fR flag is specified, then there is no difference
+between these two options.
+.IP
+See \fIstrictDisman\fR for details of the ordering of notification payloads.
+.IP "\-r FREQUENCY"
+monitors the given expression every FREQUENCY, where FREQUENCY is in
+seconds or optionally suffixed by one of s (for seconds), m (for
+minutes), h (for hours), d (for days), or w (for weeks). By default,
+the expression will be evaluated every 600s (10 minutes).
+.IP "\-S"
+indicates that the monitor expression should \fInot\fR be evaluated
+when the agent first starts up. The first evaluation will be done
+once the first repeat interval has expired.
+.IP "\-s"
+indicates that the monitor expression \fIshould\fR be evaluated when the
+agent first starts up. This is the default behaviour.
+.RS
+.IP "Note:"
+Notifications triggered by this initial evaluation will be sent
+\fIbefore\fR the \fCcoldStart\fR trap.
+.RE
+.IP "\-u SECNAME"
+specifies a security name to use for scanning the local host,
+instead of the default \fIiquerySecName\fR.
+Once again, this user must be explicitly created and given
+suitable access rights.
+.RE
+.IP "notificationEvent ENAME NOTIFICATION [\-m] [\-i OID | \-o OID ]*"
+defines a notification event named ENAME.
+This can be triggered from a given \fImonitor\fR entry by specifying
+the option \fI\-e ENAME\fR (see above).
+NOTIFICATION should be the OID of the NOTIFICATION\-TYPE definition
+for the notification to be generated.
+.IP
+If the \fI\-m\fR option is given, the notification payload will
+include the standard varbinds as specified in the OBJECTS clause
+of the notification MIB definition.
+This option must come \fBafter\fR the NOTIFICATION OID
+(and the relevant MIB file must be available and loaded by the agent).
+Otherwise, these varbinds must
+be listed explicitly (either here or in the corresponding
+\fImonitor\fR directive).
+.IP
+The \fI\-i OID\fR and \fI\-o OID\fR options specify additional
+varbinds to be appended to the notification payload, after the
+standard list.
+If the monitor entry that triggered this event involved a
+wildcarded expression, the suffix of the matched instance
+will be added to any OIDs specified using \fI\-o\fR, while OIDs
+specified using \fI\-i\fR will be treated as exact instances.
+If the \fI\-I\fR flag was specified to the \fImonitor\fR directive,
+then there is no difference between these two options.
+.IP "setEvent ENAME [\-I] OID = VALUE "
+defines a set event named ENAME, assigning the (integer) VALUE
+to the specified OID.
+This can be triggered from a given \fImonitor\fR entry by specifying
+the option \fI\-e ENAME\fR (see above).
+.IP
+If the monitor entry that triggered this event involved a
+wildcarded expression, the suffix of the matched instance
+will normally be added to the OID.
+If the \fI\-I\fR flag was specified to either of the
+\fImonitor\fR or \fIsetEvent\fR directives, the
+specified OID will be regarded as an exact single instance.
+.IP "strictDisman yes"
+The definition of SNMP notifications states that the
+varbinds defined in the OBJECT clause should come first
+(in the order specified), followed by any "extra" varbinds
+that the notification generator feels might be useful.
+The most natural approach would be to associate these
+mandatory varbinds with the \fInotificationEvent\fR entry,
+and append any varbinds associated with the monitor entry
+that triggered the notification to the end of this list.
+This is the default behaviour of the Net-SNMP Event MIB implementation.
+.IP
+Unfortunately, the DisMan Event MIB specifications actually
+state that the trigger-related varbinds should come \fBfirst\fR,
+followed by the event-related ones. This directive can be used to
+restore this strictly-correct (but inappropriate) behaviour.
+.RS
+.IP "Note:"
+Strict DisMan ordering may result in generating invalid notifications
+payload lists if the \fInotificationEvent \-n\fR flag is used together
+with \fImonitor \-o\fR (or \fI\-i\fR) varbind options.
+.RE
+.IP
+If no \fImonitor\fR entries specify payload varbinds,
+then the setting of this directive is irrelevant.
+.IP "linkUpDownNotifications yes"
+will configure the Event MIB tables to monitor the \fCifTable\fR
+for network interfaces being taken up or down, and triggering
+a \fIlinkUp\fR or \fIlinkDown\fR notification as appropriate.
+.IP
+This is exactly equivalent to the configuration:
+.RS
+.IP
+.nf
+notificationEvent linkUpTrap linkUp ifIndex ifAdminStatus ifOperStatus
+notificationEvent linkDownTrap linkDown ifIndex ifAdminStatus ifOperStatus
+
+monitor \-r 60 \-e linkUpTrap "Generate linkUp" ifOperStatus != 2
+monitor \-r 60 \-e linkDownTrap "Generate linkDown" ifOperStatus == 2
+.fi
+.RE
+.IP "defaultMonitors yes"
+will configure the Event MIB tables to monitor the various
+\fCUCD\-SNMP\-MIB\fR tables for problems (as indicated by
+the appropriate \fCxxErrFlag\fR column objects).
+.IP
+This is exactly equivalent to the configuration:
+.RS
+.IP
+.nf
+monitor \-o prNames \-o prErrMessage "process table" prErrorFlag != 0
+monitor \-o memErrorName \-o memSwapErrorMsg "memory" memSwapError != 0
+monitor \-o extNames \-o extOutput "extTable" extResult != 0
+monitor \-o dskPath \-o dskErrorMsg "dskTable" dskErrorFlag != 0
+monitor \-o laNames \-o laErrMessage "laTable" laErrorFlag != 0
+monitor \-o fileName \-o fileErrorMsg "fileTable" fileErrorFlag != 0
+.fi
+.RE
+.PP
+In both these latter cases, the snmpd.conf must also contain a
+\fIiquerySecName\fR directive, together with a corresponding
+\fIcreateUser\fR entry and suitable access control configuration.
+.SS "DisMan Schedule MIB"
+The DisMan working group also produced a mechanism for scheduling
+particular actions (a specified SET assignment) at given times.
+This requires that the agent was built with support for the
+\fIdisman/schedule\fR module (which is included as part of the
+default build configuration for the most recent distribution).
+.PP
+There are three ways of specifying the scheduled action:
+.IP "repeat FREQUENCY OID = VALUE"
+configures a SET assignment of the (integer) VALUE to the MIB instance
+OID, to be run every FREQUENCY seconds, where FREQUENCY is in
+seconds or optionally suffixed by one of s (for seconds), m (for
+minutes), h (for hours), d (for days), or w (for weeks).
+.IP "cron MINUTE HOUR DAY MONTH WEEKDAY OID = VALUE"
+configures a SET assignment of the (integer) VALUE to the MIB instance
+OID, to be run at the times specified by the fields MINUTE to WEEKDAY.
+These follow the same pattern as the equivalent \fIcrontab(5)\fR fields.
+.RS
+.IP "Note:"
+These fields should be specified as a (comma-separated) list of numeric
+values. Named values for the MONTH and WEEKDAY fields are not supported,
+and neither are value ranges. A wildcard match can be specified as '*'.
+.RE
+.IP
+The DAY field can also accept negative values, to indicate days counting
+backwards from the end of the month.
+.IP "at MINUTE HOUR DAY MONTH WEEKDAY OID = VALUE"
+configures a one-shot SET assignment, to be run at the first matching
+time as specified by the fields MINUTE to WEEKDAY. The interpretation
+of these fields is exactly the same as for the \fIcron\fR directive.
+.SS "Data Delivery via Notfiications"
+Note: this functionality is only available if the
+\fIdeliver/deliverByNotify\fR mib module was complied in to the agent
+.PP
+In some situations it may be advantageous to deliver SNMP data over
+SNMP Notifications (TRAPs and INFORMs) rather than the typical process
+of having the manager issue requests for the data (via GETs and
+GETNEXTs). Reasons for doing this are numerous, but frequently corner
+cases. The most common reason for wanting this behaviour might be to
+monitor devices that reside behind NATs or Firewalls that prevent
+incoming SNMP traffic.
+.PP
+It should be noted that although most management software is capable
+of logging notifications, very little (if any) management software
+will updated their "knowledge database" based on the contents of SNMP
+notifications. IE, it won't (for example) update the interface
+traffic counter history that is used to produce graphs. Most larger
+network management packages have a separate database for storing data
+received via SNMP requests (GETs and GETNEXTs) vs those received from
+notifications. Researching the capabilities of your management
+station software is required before assuming this functionality will
+solve your data delivery requirements.
+.PP
+Notifications generated via this mechanism will be sent to the
+standard set of configured notification targets. See the
+"Notification Handling" section of this document for further
+information.
+.IP "deliverByNotify [\-p] [\-m] [\-s MAXSIZE] FREQUENCY OID"
+This directive tells the SNMP agent to self-walk the \fIOID\fR,
+collect all the data and send it out every \fIFREQUENCY\fR seconds,
+where FREQUENCY is in seconds or optionally suffixed by one of s (for
+seconds), m (for minutes), h (for hours), d (for days), or w (for
+weeks). By default scalars are included in the notification that
+specify the how often the notification will be sent (unless the
+\fI\-p\fR option is specified) and which message number of how many
+messages a particular notification is (unless \fI\-m\fR is specified).
+To break the notifications into manageable packet sizes, use the
+\fI\-s\fR flag to specify the approximate maximum number of bytes that
+a notification message should be limited to. If more than
+\fIMAXSIZE\fR of bytes is needed then multiple notifications will be
+sent to deliver the data. Note that the calculations for ensuring the
+maximum size is met are approximations and thus it can be absolutely
+guaranteed they'll be under that size, so leave a padding buffer if it
+is critical that you avoid fragmentation. A value of \-1 indicates
+force everything into a single message no matter how big it is.
+.IP
+Example usage: the following will deliver the contents of the ifTable
+once an hour and the contents of the system group once every 2 hours:
+.RS
+.nf
+
+deliverByNotify 3600 ifTable
+deliverByNotify 7200 system
+.fi
+.RE
+.IP "deliverByNotifyMaxPacketSize SIZEINBYTES"
+Sets the default notification size limit (see the \fI\-s\fR flag above).
+.IP "deliverByNotifyOid OID"
+.IP "deliverByNotifyFrequencyOid OID"
+.IP "deliverByNotifyMessageNumberOid OID"
+.IP "deliverByNotifyMaxMessageNumberOid OID"
+These set the data OID that the notification will be sent under, the
+scalar OID, the message number OID, and the maximum message number
+OID. These default to objects in the NET\-SNMP\-PERIODIC\-NOTIFY\-MIB.
+.SH "EXTENDING AGENT FUNCTIONALITY"
+One of the first distinguishing features of the original UCD suite was
+the ability to extend the functionality of the agent - not just by
+recompiling with code for new MIB modules, but also by configuring the running agent to
+report additional information. There are a number of techniques to
+support this, including:
+.IP \(bu
+running external commands (\fIexec\fR, \fIextend\fR, \fIpass\fR)
+.IP \(bu
+loading new code dynamically (embedded perl, \fIdlmod\fR)
+.IP \(bu
+communicating with other agents (\fIproxy\fR, SMUX, AgentX)
+.SS "Arbitrary Extension Commands"
+The earliest extension mechanism was the ability to run arbitrary
+commands or shell scripts. Such commands do not need to be aware of
+SNMP operations, or conform to any particular behaviour - the MIB
+structures are designed to accommodate any form of command output.
+Use of this mechanism requires that the agent was built with support for the
+\fIucd\-snmp/extensible\fR and/or \fIagent/extend\fR modules (which
+are both included as part of the default build configuration).
+.IP "exec [MIBOID] NAME PROG ARGS"
+.IP "sh [MIBOID] NAME PROG ARGS"
+invoke the named PROG with arguments of ARGS. By default the exit
+status and first line of output from the command will be reported via
+the \fCextTable\fR, discarding any additional output.
+.RS
+.IP Note:
+Entries in this table appear in the order they are read from the
+configuration file. This means that adding new \fIexec\fR (or \fIsh\fR)
+directives and restarting the agent, may affect the indexing of other
+entries.
+.RE
+.IP
+The PROG argument for \fIexec\fR directives must be a full path
+to a real binary, as it is executed via the exec() system call.
+To invoke a shell script, use the \fIsh\fR directive instead.
+.IP
+If MIBOID is specified, then the results will be rooted at this point
+in the OID tree, returning the exit statement as MIBOID.ERRORFLAG.0
+and the entire command output in a pseudo-table based at
+MIBNUM.ERRORMSG - with one 'row' for each line of output.
+.RS
+.IP Note:
+The layout of this "relocatable" form of \fIexec\fR (or \fIsh\fR) output
+does not strictly form a valid MIB structure. This mechanism is being
+deprecated - please see the \fIextend\fR directive (described below) instead.
+.RE
+.IP
+The agent does not cache the exit status or output of the executed program.
+.\"
+.\" XXX - Is this still true ??
+.\"
+.IP "execfix NAME PROG ARGS"
+registers a command that can be invoked on demand - typically to respond
+to or fix errors with the corresponding \fIexec\fR or \fIsh\fR entry.
+When the \fIextErrFix\fR instance for a given NAMEd entry is set to the
+integer value of 1, this command will be called.
+.RS
+.IP "Note:"
+This directive can only be used in combination with a corresponding
+\fIexec\fR or \fIsh\fR directive, which must be defined first.
+Attempting to define an unaccompanied \fIexecfix\fR directive will fail.
+.RE
+.PP
+\fIexec\fR and \fIsh\fR extensions can only be configured via the
+snmpd.conf file. They cannot be set up via SNMP SET requests.
+.IP "extend [MIBOID] NAME PROG ARGS"
+works in a similar manner to the \fIexec\fR directive, but with a number
+of improvements. The MIB tables (\fInsExtendConfigTable\fR
+etc) are indexed by the NAME token, so are unaffected by the order in
+which entries are read from the configuration files.
+There are \fItwo\fR result tables - one (\fInsExtendOutput1Table\fR)
+containing the exit status, the first line and full output (as a single string)
+for each \fIextend\fR entry, and the other (\fInsExtendOutput2Table\fR)
+containing the complete output as a series of separate lines.
+.IP
+If MIBOID is specified, then the configuration and result tables will be rooted
+at this point in the OID tree, but are otherwise structured in exactly
+the same way. This means that several separate \fIextend\fR
+directives can specify the same MIBOID root, without conflicting.
+.IP
+The exit status and output is cached for each entry individually, and
+can be cleared (and the caching behaviour configured)
+using the \fCnsCacheTable\fR.
+.IP "extendfix NAME PROG ARGS"
+registers a command that can be invoked on demand, by setting the
+appropriate \fInsExtendRunType\fR instance to the value
+\fIrun-command(3)\fR. Unlike the equivalent \fIexecfix\fR,
+this directive does not need to be paired with a corresponding
+\fIextend\fR entry, and can appear on its own.
+.PP
+Both \fIextend\fR and \fIextendfix\fR directives can be configured
+dynamically, using SNMP SET requests to the NET\-SNMP\-EXTEND\-MIB.
+.SS "MIB-Specific Extension Commands"
+The first group of extension directives invoke arbitrary commands,
+and rely on the MIB structure (and management applications) having
+the flexibility to accommodate and interpret the output. This is a
+convenient way to make information available quickly and simply, but
+is of no use when implementing specific MIB objects, where the extension
+must conform to the structure of the MIB (rather than vice versa).
+The remaining extension mechanisms are all concerned with such
+MIB-specific situations - starting with "pass-through" scripts.
+Use of this mechanism requires that the agent was built with support for the
+\fIucd\-snmp/pass\fR and \fIucd\-snmp/pass_persist\fR modules (which
+are both included as part of the default build configuration).
+.IP "pass [\-p priority] MIBOID PROG"
+will pass control of the subtree rooted at MIBOID to the specified
+PROG command. GET and GETNEXT requests for OIDs within this tree will
+trigger this command, called as:
+.RS
+.IP
+PROG \-g OID
+.IP
+PROG \-n OID
+.RE
+.IP
+respectively, where OID is the requested OID.
+The PROG command should return the response varbind as three separate
+lines printed to stdout - the first line should be the OID of the returned
+value, the second should be its TYPE (one of the text strings
+.B integer, gauge, counter, timeticks, ipaddress, objectid,
+or
+.B string
+), and the third should be the value itself.
+.IP
+If the command cannot return an appropriate varbind - e.g the specified
+OID did not correspond to a valid instance for a GET request, or there
+were no following instances for a GETNEXT - then it should exit without
+producing any output. This will result in an SNMP \fInoSuchName\fR
+error, or a \fInoSuchInstance\fR exception.
+.RS
+.RS
+.IP "Note:"
+The SMIv2 type \fBcounter64\fR
+and SNMPv2 \fInoSuchObject\fR exception are not supported.
+.RE
+.RE
+.IP
+A SET request will result in the command being called as:
+.RS
+.IP
+PROG \-s OID TYPE VALUE
+.RE
+.IP
+where TYPE is one of the tokens listed above, indicating the type of the
+value passed as the third parameter.
+.\".RS
+.\".RS
+.\".IP "Note:"
+.\".B counter
+.\"(and
+.\".B counter64
+.\") syntax objects are not valid for SETs
+.\".RE
+.\".RE
+.IP
+If the assignment is successful, the PROG command should exit without producing
+any output. Errors should be indicated by writing one of the strings
+.B not-writable,
+or
+.B wrong-type
+to stdout,
+and the agent will generate the appropriate error response.
+.RS
+.RS
+.IP "Note:"
+The other SNMPv2 errors are not supported.
+.RE
+.RE
+.IP
+In either case, the command should exit once it has finished processing.
+Each request (and each varbind within a single request) will trigger
+a separate invocation of the command.
+.IP
+The default registration priority is 127. This can be
+changed by supplying the optional \-p flag, with lower priority
+registrations being used in preference to higher priority values.
+.IP "pass_persist [\-p priority] MIBOID PROG"
+will also pass control of the subtree rooted at MIBOID to the specified
+PROG command. However this command will continue to run after the initial
+request has been answered, so subsequent requests can be processed without
+the startup overheads.
+.IP
+Upon initialization, PROG will be passed the string "PING\\n" on stdin,
+and should respond by printing "PONG\\n" to stdout.
+.IP
+For GET and GETNEXT requests, PROG will be passed two lines on stdin,
+the command (\fIget\fR or \fIgetnext\fR) and the requested OID.
+It should respond by printing three lines to stdout -
+the OID for the result varbind, the TYPE and the VALUE itself -
+exactly as for the \fIpass\fR directive above.
+If the command cannot return an appropriate varbind,
+it should print print "NONE\\n" to stdout (but continue running).
+.IP
+For SET requests, PROG will be passed three lines on stdin,
+the command (\fIset\fR) and the requested OID,
+followed by the type and value (both on the same line).
+If the assignment is successful, the command should print
+"DONE\\n" to stdout.
+Errors should be indicated by writing one of the strings
+.B not\-writable,
+.B wrong\-type,
+.B wrong\-length,
+.B wrong\-value
+or
+.B inconsistent\-value
+to stdout,
+and the agent will generate the appropriate error response.
+In either case, the command should continue running.
+.IP
+The registration priority can be changed using the optional
+\-p flag, just as for the \fIpass\fR directive.
+.PP
+\fIpass\fR and \fIpass_persist\fR extensions can only be configured via the
+snmpd.conf file. They cannot be set up via SNMP SET requests.
+.\"
+.\" XXX - caching ??
+.\"
+.SS "Embedded Perl Support"
+Programs using the previous extension mechanisms can be written in any convenient
+programming language - including perl, which is a common choice for
+pass-through extensions in particular. However the Net-SNMP agent
+also includes support for embedded perl technology (similar to
+\fImod_perl\fR for the Apache web server). This allows the agent
+to interpret perl scripts directly, thus avoiding the overhead of
+spawning processes and initializing the perl system when a request is received.
+.PP
+Use of this mechanism requires that the agent was built with support for the embedded
+perl mechanism, which is not part of the default build environment. It
+must be explicitly included by specifying the '\-\-enable\-embedded\-perl'
+option to the configure script when the package is first built.
+.PP
+If enabled, the following directives will be recognised:
+.IP "disablePerl true"
+will turn off embedded perl support entirely (e.g. if there are problems
+with the perl installation).
+.IP "perlInitFile FILE"
+loads the specified initialisation file (if present)
+immediately before the first \fIperl\fR directive is parsed.
+If not explicitly specified, the agent will look for the default
+initialisation file DATADIR/snmp/snmp_perl.pl.
+.IP
+The default initialisation file
+creates an instance of a \fCNetSNMP::agent\fR object - a variable
+\fC$agent\fR which can be used to register perl-based MIB handler routines.
+.IP "perl EXPRESSION"
+evaluates the given expression. This would typically register a
+handler routine to be called when a section of the OID tree was
+requested:
+.RS
+.RS
+.nf
+\fCperl use Data::Dumper;
+perl sub myroutine { print "got called: ",Dumper(@_),"\\n"; }
+perl $agent\->register('mylink', '.1.3.6.1.8765', \\&myroutine);\fR
+.fi
+.RE
+.RE
+.IP
+This expression could also source an external file:
+.RS
+.RS
+\fCperl 'do /path/to/file.pl';\fR
+.RE
+.RE
+.IP
+or perform any other perl-based processing that might be required.
+.\"
+.\" Link to more examples
+.\"
+.SS Dynamically Loadable Modules
+Most of the MIBs supported by the Net-SNMP agent are implemented as
+C code modules, which were compiled and linked into the agent libraries
+when the suite was first built. Such implementation modules can also be
+compiled independently and loaded into the running agent once it has
+started. Use of this mechanism requires that the agent was built with support for the
+\fIucd\-snmp/dlmod\fR module (which is included as part of the default
+build configuration).
+.IP "dlmod NAME PATH"
+will load the shared object module from the file PATH (an absolute
+filename), and call the initialisation routine \fIinit_NAME\fR.
+.RS
+.IP "Note:"
+If the specified PATH is not a fully qualified filename, it will
+be interpreted relative to LIBDIR/snmp/dlmod, and \fC.so\fR
+will be appended to the filename.
+.RE
+.PP
+This functionality can also be configured using SNMP SET requests
+to the UCD\-DLMOD\-MIB.
+.SS "Proxy Support"
+Another mechanism for extending the functionality of the agent
+is to pass selected requests (or selected varbinds) to another
+SNMP agent, which can be running on the same host (presumably
+listening on a different port), or on a remote system.
+This can be viewed either as the main agent delegating requests to
+the remote one, or acting as a proxy for it.
+Use of this mechanism requires that the agent was built with support for the
+\fIucd\-snmp/proxy\fR module (which is included as part of the
+default build configuration).
+.IP "proxy [\-Cn CONTEXTNAME] [SNMPCMD_ARGS] HOST OID [REMOTEOID]"
+will pass any incoming requests under OID to the agent listening
+on the port specified by the transport address HOST.
+See the section
+.B LISTENING ADDRESSES
+in the
+.I snmpd(8)
+manual page for more information about the format of listening
+addresses.
+.RS
+.IP "Note:"
+To proxy the entire MIB tree, use the OID .1.3
+(\fBnot\fR the top-level .1)
+.RE
+.PP
+The \fISNMPCMD_ARGS\fR should provide sufficient version and
+administrative information to generate a valid SNMP request
+(see \fIsnmpcmd(1)\fR).
+.IP "Note:"
+The proxied request will \fInot\fR use the administrative
+settings from the original request.
+.RE
+.PP
+If a CONTEXTNAME is specified, this will register the proxy
+delegation within the named context in the local agent.
+Defining multiple \fIproxy\fR directives for the same OID but
+different contexts can be used to query several remote agents
+through a single proxy, by specifying the appropriate SNMPv3
+context in the incoming request (or using suitable configured
+community strings - see the \fIcom2sec\fR directive).
+.PP
+Specifying the REMOID parameter will map the local MIB tree
+rooted at OID to an equivalent subtree rooted at REMOID
+on the remote agent.
+.SS SMUX Sub-Agents
+The Net-SNMP agent supports the SMUX protocol (RFC 1227) to communicate
+with SMUX-based subagents (such as \fIgated\fR, \fIzebra\fR or \fIquagga\fR).
+Use of this mechanism requires that the agent was built with support for the
+\fIsmux\fR module, which is not part of the default build environment, and
+must be explicitly included by specifying the '\-\-with\-mib\-modules=smux'
+option to the configure script when the package is first built.
+.RS
+.IP "Note:"
+This extension protocol has been officially deprecated in
+favour of AgentX (see below).
+.RE
+.IP "smuxpeer OID PASS"
+will register a subtree for SMUX-based processing, to be
+authenticated using the password PASS. If a subagent
+(or "peer") connects to the agent and registers this subtree
+.\"
+.\" Or a subtree of this subtree ??
+.\"
+then requests for OIDs within it will be passed to that
+SMUX subagent for processing.
+.IP
+A suitable entry for an OSPF routing daemon (such as \fIgated\fR,
+\fIzebra\fR or \fIquagga\fR) might be something like
+.RS
+.RS
+.I smuxpeer .1.3.6.1.2.1.14 ospf_pass
+.RE
+.RE
+.IP "smuxsocket <IPv4-address>"
+defines the IPv4 address for SMUX peers to communicate with the Net-SNMP agent.
+The default is to listen on all IPv4 interfaces ("0.0.0.0"), unless the
+package has been configured with "\-\-enable\-local\-smux" at build time, which
+causes it to only listen on 127.0.0.1 by default. SMUX uses the well-known
+TCP port 199.
+.PP
+Note the Net-SNMP agent will only operate as a SMUX \fImaster\fR
+agent. It does not support acting in a SMUX subagent role.
+.SS AgentX Sub-Agents
+The Net-SNMP agent supports the AgentX protocol (RFC 2741) in
+both master and subagent roles.
+Use of this mechanism requires that the agent was built with support for the
+\fIagentx\fR module (which is included as part of the
+default build configuration), and also that this support is
+explicitly enabled (e.g. via the \fIsnmpd.conf\fR file).
+.PP
+There are two directives specifically relevant to running as
+an AgentX master agent:
+.IP "master agentx"
+will enable the AgentX functionality and cause the agent to
+start listening for incoming AgentX registrations.
+This can also be activated by specifying the '\-x' command-line
+option (to specify an alternative listening socket).
+.IP "agentXPerms SOCKPERMS [DIRPERMS [USER|UID [GROUP|GID]]]"
+Defines the permissions and ownership of the AgentX Unix Domain socket,
+and the parent directories of this socket.
+SOCKPERMS and DIRPERMS must be octal digits (see
+.I chmod(1)
+). By default this socket will only be accessible to subagents which
+have the same userid as the agent.
+.PP
+There is one directive specifically relevant to running as
+an AgentX sub-agent:
+.IP "agentXPingInterval NUM"
+will make the subagent try and reconnect every NUM seconds to the
+master if it ever becomes (or starts) disconnected.
+.PP
+The remaining directives are relevant to both AgentX master
+and sub-agents:
+.IP "agentXSocket [<transport-specifier>:]<transport-address>[,...]"
+defines the address the master agent listens at, or the subagent
+should connect to.
+The default is the Unix Domain socket \fCAGENTX_SOCKET\fR.
+Another common alternative is \fCtcp:localhost:705\fR.
+See the section
+.B LISTENING ADDRESSES
+in the
+.I snmpd(8)
+manual page for more information about the format of addresses.
+.RS
+.IP "Note:"
+Specifying an AgentX socket does \fBnot\fR automatically enable
+AgentX functionality (unlike the '\-x' command-line option).
+.RE
+.IP "agentXTimeout NUM"
+defines the timeout period (NUM seconds) for an AgentX request.
+Default is 1 second. NUM also be specified with a suffix of one of s
+(for seconds), m (for minutes), h (for hours), d (for days), or w (for
+weeks).
+.IP "agentXRetries NUM"
+defines the number of retries for an AgentX request.
+Default is 5 retries.
+.PP
+net-snmp ships with both C and Perl APIs to develop your own AgentX
+subagent.
+.SH "OTHER CONFIGURATION"
+.IP "override [\-rw] OID TYPE VALUE"
+This directive allows you to override a particular OID with a
+different value (and possibly a different type of value). The \-rw
+flag will allow snmp SETs to modify it's value as well. (note that if
+you're overriding original functionality, that functionality will be
+entirely lost. Thus SETS will do nothing more than modify the
+internal overridden value and will not perform any of the original
+functionality intended to be provided by the MIB object. It's an
+emulation only.) An example:
+.RS
+.IP
+\fCoverride sysDescr.0 octet_str "my own sysDescr"\fR
+.RE
+.IP
+That line will set the sysDescr.0 value to "my own sysDescr" as well
+as make it modifiable with SNMP SETs as well (which is actually
+illegal according to the MIB specifications).
+.IP
+Note that care must be taken when using this. For example, if you try
+to override a property of the 3rd interface in the ifTable with a new
+value and later the numbering within the ifTable changes it's index
+ordering you'll end up with problems and your modified value won't
+appear in the right place in the table.
+.IP
+Valid TYPEs are: integer, uinteger, octet_str, object_id, counter,
+null (for gauges, use "uinteger"; for bit strings, use "octet_str").
+Note that setting an object to "null" effectively delete's it as being
+accessible. No VALUE needs to be given if the object type is null.
+.IP
+More types should be available in the future.
+.PP
+If you're trying to figure out aspects of the various mib modules
+(possibly some that you've added yourself), the following may help you
+spit out some useful debugging information. First off, please read
+the snmpd manual page on the \-D flag. Then the following
+configuration snmpd.conf token, combined with the \-D flag, can produce
+useful output:
+.IP "injectHandler HANDLER modulename [beforeThis]"
+This will insert new handlers into the section of the mib tree
+referenced by "modulename". If "beforeThis" is specified then the
+module will be injected before the named module. This is useful for
+getting a handler into the exact right position in the chain.
+.IP
+The types of handlers available for insertion are:
+.RS
+.IP stash_cache
+Caches information returned from the lower level. This
+greatly help the performance of the agent, at the cost
+of caching the data such that its no longer "live" for
+30 seconds (in this future, this will be configurable).
+Note that this means snmpd will use more memory as well
+while the information is cached. Currently this only
+works for handlers registered using the table_iterator
+support, which is only a few mib tables. To use it,
+you need to make sure to install it before the
+table_iterator point in the chain, so to do this:
+
+ \fCinjectHandler stash_cache NAME table_iterator\fR
+
+If you want a table to play with, try walking the
+\fCnsModuleTable\fR with and without this injected.
+
+.IP debug
+Prints out lots of debugging information when
+the \-Dhelper:debug flag is passed to the snmpd
+application.
+
+.IP read_only
+Forces turning off write support for the given module.
+
+.IP serialize
+If a module is failing to handle multiple requests
+properly (using the new 5.0 module API), this will force
+the module to only receive one request at a time.
+
+.IP bulk_to_next
+If a module registers to handle getbulk support, but
+for some reason is failing to implement it properly,
+this module will convert all getbulk requests to
+getnext requests before the final module receives it.
+.RE
+.IP "dontLogTCPWrappersConnects"
+If the \fBsnmpd\fR was compiled with TCP Wrapper support, it
+logs every connection made to the agent. This setting disables
+the log messages for accepted connections. Denied connections will
+still be logged.
+.IP "Figuring out module names"
+To figure out which modules you can inject things into,
+run \fBsnmpwalk\fR on the \fCnsModuleTable\fR which will give
+a list of all named modules registered within the agent.
+.SS Internal Data tables
+.IP "table NAME"
+.\" XXX: To Document
+.IP "add_row NAME INDEX(ES) VALUE(S)"
+.\" XXX: To Document
+.SH NOTES
+.IP o
+The Net-SNMP agent can be instructed to re-read the various configuration files,
+either via an \fBsnmpset\fR assignment of integer(1) to
+\fCUCD\-SNMP\-MIB::versionUpdateConfig.0\fR (.1.3.6.1.4.1.2021.100.11.0),
+or by sending a \fBkill \-HUP\fR signal to the agent process.
+.IP o
+All directives listed with a value of "yes" actually accept a range
+of boolean values. These will accept any of \fI1\fR, \fIyes\fR or
+\fItrue\fR to enable the corresponding behaviour,
+or any of \fI0\fR, \fIno\fR or \fIfalse\fR to disable it.
+The default in each case is for the feature to be turned off, so these
+directives are typically only used to enable the appropriate behaviour.
+.SH "EXAMPLE CONFIGURATION FILE"
+See the EXAMPLE.CONF file in the top level source directory for a more
+detailed example of how the above information is used in real
+examples.
+.SH "FILES"
+SYSCONFDIR/snmp/snmpd.conf
+.SH "SEE ALSO"
+snmpconf(1), snmpusm(1), snmp.conf(5), snmp_config(5), snmpd(8), EXAMPLE.conf, netsnmp_config_api(3).
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/man/snmpd.examples.5.def b/man/snmpd.examples.5.def
new file mode 100644
index 0000000..b4125d6
--- /dev/null
+++ b/man/snmpd.examples.5.def
@@ -0,0 +1,655 @@
+.TH SNMPD.EXAMPLES 5 "13 Oct 2006" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpd.examples - example configuration for the Net-SNMP agent
+.SH DESCRIPTION
+The
+.I snmpd.conf(5)
+man page defines the syntax and behaviour of the various
+configuration directives that can be used to control the
+operation of the Net-SNMP agent, and the management information
+it provides.
+.PP
+This companion man page illustrates these directives, showing
+some practical examples of how they might be used.
+.SH AGENT BEHAVIOUR
+.SS "Listening addresses"
+The default agent behaviour (listing on the standard SNMP UDP port on
+all interfaces) is equivalent to the directive:
+.RS
+agentaddress udp:161
+.RE
+or simply
+.RS
+agentaddress 161
+.RE
+The agent can be configured to \fIonly\fR accept requests sent to the
+local loopback interface (again listening on the SNMP UDP port), using:
+.RS
+agentaddress localhost:161 \fI# (udp implicit)\fR
+.RE
+or
+.RS
+agentaddress 127.0.0.1 \fI# (udp and standard port implicit)\fR
+.RE
+It can be configured to accept both UDP and TCP requests (over both IPv4
+and IPv6), using:
+.RS
+agentaddress udp:161,tcp:161,udp6:161,tcp6:161
+.RE
+.\"
+.\" Can the agent handle the same port for both IPv4 & IPv6
+.\"
+Other combinations are also valid.
+.SS "Run-time privileges"
+The agent can be configured to relinquish any privileged access once it
+has opened the initial listening ports. Given a suitable "snmp" group
+(defined in \fI/etc/group\fR), this could be done using the directives:
+.RS
+.nf
+agentuser nobody
+agentgroup snmp
+.fi
+.RE
+A similar effect could be achieved using numeric UID and/or GID values:
+.RS
+.nf
+agentuser #10
+agentgroup #10
+.fi
+.RE
+.\"
+.\" What effect will/may this have on the information returned.
+.\" ??? Mention this in the main man page.
+.\"
+.SS SNMPv3 Configuration
+Rather than being generated pseudo-randomly,
+the engine ID for the agent could be calculated based on the MAC address
+of the second network interface (\fIeth1\fR), using the directives:
+.RS
+engineIDType 3
+engineIDNic eth1
+.RE
+or it could be calculated from the (first) IP address, using:
+.RS
+engineIDType 1
+.RE
+or it could be specified explicitly, using:
+.RS
+engineID "XXX - WHAT FORMAT"
+.RE
+.\"
+.\" Does engineID override the other directives, or what?
+.\"
+.SH ACCESS CONTROL
+.SS SNMPv3 Users
+The following directives will create three users, all using exactly
+the same authentication and encryption settings:
+.RS
+.nf
+createUser me MD5 "single pass phrase"
+createUser myself MD5 "single pass phrase" DES
+createUser andI MD5 "single pass phrase" DES "single pass phrase"
+.fi
+.RE
+Note that this defines three \fIdistinct\fR users, who could be granted
+different levels of access. Changing the passphrase for any one of
+these would not affect the other two.
+.PP
+Separate pass phrases can be specified for authentication and
+encryption:
+.RS
+createUser onering SHA "to rule them all" AES "to bind them"
+.RE
+Remember that these \fIcreateUser\fR directives should be defined in the
+PERSISTENT_DIRECTORY/snmpd.conf file, rather than the usual location.
+.RE
+.\"
+.\" ??? Illustrate "\-e", "\-l" and "\-m" forms ??
+.\"
+.SS Traditional Access Control
+The SNMPv3 users defined above can be granted access to the full
+MIB tree using the directives:
+.RS
+.nf
+rouser me
+rwuser onering
+.fi
+.RE
+Or selective access to individual subtrees using:
+.RS
+.nf
+rouser myself .1.3.6.1.2
+rwuser andI system
+.fi
+.RE
+.PP
+Note that a combination repeating the same user, such as:
+.RS
+.nf
+rouser onering
+rwuser onering
+.fi
+.RE
+should \fBnot\fR be used. This would configure the user \fIonering\fR
+with read-only access (and ignore the \fIrwuser\fR entry altogether).
+The same holds for the community-based directives.
+.PP
+The directives:
+.RS
+.nf
+rocommunity public
+rwcommunity private
+.fi
+.RE
+would define the commonly-expected read and write community strings
+for SNMPv1 and SNMPv2c requests. This behaviour is \fBnot\fR
+configured by default, and would need to be set up explicitly.
+.RS
+.IP Note:
+It would also be a very good idea to change \fIprivate\fR to something
+a little less predictable!
+.RE
+.PP
+A slightly less vulnerable configuration might restrict what information
+could be retrieved:
+.RS
+rocommunity public default system
+.RE
+or the management systems that settings could be manipulated from:
+.RS
+rwcommunity private 10.10.10.0/24
+.RE
+or a combination of the two.
+.SS VACM Configuration
+This last pair of settings are equivalent to the full VACM definitions:
+.RS
+.nf
+\fI# sec.name source community\fR
+com2sec public default public
+com2sec mynet 10.10.10.0/24 private
+com2sec6 mynet fec0::/64 private
+
+\fI# sec.model sec.name\fR
+group worldGroup v1 public
+group worldGroup v2c public
+group myGroup v1 mynet
+group myGroup v2c mynet
+
+\fI# incl/excl subtree [mask]\fR
+view all included .1
+view sysView included system
+
+\fI# context model level prefix read write notify (unused)\fR
+access worldGroup "" any noauth exact system none none
+access myGroup "" any noauth exact all all none
+.fi
+.RE
+.PP
+There are several points to note in this example:
+.PP
+The \fIgroup\fR directives must be repeated for
+both SNMPv1 and SNMPv2c requests.
+.PP
+The \fIcom2sec\fR security name is distinct from the community
+string that is mapped to it. They can be the same ("public")
+or different ("mynet"/"private") - but what appears in the
+\fIgroup\fR directive is the security name, regardless of
+the original community string.
+.PP
+Both of the \fIview\fR directives are defining simple OID
+subtrees, so neither of these require an explicit mask.
+The same holds for the "combined subtree2 view defined below.
+In fact, a mask field is only needed when defining row slices
+across a table (or similar views), and can almost always be omitted.
+.PP
+In general, it is advisible not to mix traditional and VACM-based
+access configuration settings, as these can sometimes interfere
+with each other in unexpected ways. Choose a particular style
+of access configuration, and stick to it.
+.\"
+.\" Mention/use hardwired views '_all_' and '_none_'
+.\"
+.\" Illustrate other, more flexible configurations
+.\" including SNMPv3 access.
+.\"
+.SS Typed-View Configuration
+A similar configuration could also be configured as follows:
+.RS
+.nf
+view sys2View included system
+view sys2View included .1.3.6.1.2.1.25.1
+
+authcommunity read public default \-v sys2View
+authcommunity read,write private 10.10.10.0/8
+.fi
+.RE
+.PP
+This mechanism allows multi-subtree (or other non-simple) views to
+be used with the one-line \fIrocommunity\fR style of configuration.
+.PP
+It would also support configuring "write-only" access, should this
+be required.
+.\"
+.\" Expand this example
+.\"
+.SH SYSTEM INFORMATION
+.SS System Group
+The full contents of the 'system' group (with the exception of \fCsysUpTime\fR)
+can be explicitly configured using:
+.RS
+.nf
+\fI# Override 'uname \-a' and hardcoded system OID - inherently read-only values\fR
+sysDescr Universal Turing Machine mk I
+sysObjectID .1.3.6.1.4.1.8072.3.2.1066
+
+\fI# Override default values from 'configure' - makes these objects read-only\fR
+sysContact Alan.Turing@pre\-cs.man.ac.uk
+sysName tortoise.turing.com
+sysLocation An idea in the mind of AT
+
+\fI# Standard end-host behaviour\fR
+sysServices 72
+.fi
+.RE
+.SS Host Resources Group
+The list of devices probed for potential inclusion in the
+\fChrDiskStorageTable\fR (and \fChrDeviceTable\fR) can be amended using
+any of the following directives:
+.RS
+ignoredisk /dev/rdsk/c0t2d0
+.RE
+which prevents the device \fI/dev/rdsk/c0t2d0\fR from being scanned,
+.RS
+.nf
+ignoredisk /dev/rdsk/c0t[!6]d0
+ignoredisk /dev/rdsk/c0t[0\-57\-9a\-f]d0
+.fi
+.RE
+either of which prevents all devices \fI/dev/rdsk/c0t\fRX\fId0\fR
+(except .../\fIc0t6d0\fR) from being scanned,
+.RS
+ignoredisk /dev/rdsk/c1*
+.RE
+which prevents all devices whose device names start with \fI/dev/rdsk/c1\fR
+from being scanned, or
+.RS
+ignoredisk /dev/rdsk/c?t0d0
+.RE
+which prevents all devices \fI/dev/rdsk/c\fRX\fIt0d0\fR
+(where 'X' is any single character) from being scanned.
+.SS Process Monitoring
+The list of services running on a system can be monitored
+(and provision made for correcting any problems), using:
+.RS
+.nf
+\fI# At least one web server process must be running at all times\fR
+proc httpd
+procfix httpd /etc/rc.d/init.d/httpd restart
+
+\fI# There should never be more than 10 mail processes running
+# (more implies a probable mail storm, so shut down the mail system)\fR
+proc sendmail 10
+procfix sendmail /etc/rc.d/init.d/sendmail stop
+
+\fI# There should be a single network management agent running
+# ("There can be only one")\fR
+proc snmpd 1 1
+.fi
+.RE
+Also see the "DisMan Event MIB" section later on.
+.SS Disk Usage Monitoring
+The state of disk storage can be monitored using:
+.RS
+.nf
+includeAllDisks 10%
+disk /var 20%
+disk /usr 3%
+\fI# Keep 100 MB free for crash dumps\fR
+disk /mnt/crash 100000
+.fi
+.RE
+.SS System Load Monitoring
+A simple check for an overloaded system might be:
+.RS
+load 10
+.RE
+A more refined check (to allow brief periods of heavy use,
+but recognise sustained medium-heavy load) might be:
+.RS
+load 30 10 5
+.RE
+.SS Log File Monitoring
+.I TODO
+.RS
+file FILE [MAXSIZE]
+.RE
+.RS
+logmatch NAME PATH CYCLETIME REGEX
+.RE
+.SH "ACTIVE MONITORING"
+.SS "Notification Handling"
+Configuring the agent to report invalid access attempts might be done by:
+.RS
+.nf
+authtrapenable 1
+trapcommunity public
+trap2sink localhost
+.fi
+.RE
+Alternatively, the second and third directives could be combined
+(and an acknowledgement requested) using:
+.RS
+informsink localhost public
+.RE
+A configuration with repeated sink destinations, such as:
+.RS
+.nf
+trapsink localhost
+trap2sink localhost
+informsink localhost
+.fi
+.RE
+should \fBNOT\fR be used, as this will cause multiple copies
+of each trap to be sent to the same trap receiver.
+.PP
+.I "TODO - discuss SNMPv3 traps"
+.RS
+trapsess \fIsnmpv3 options\fR localhost:162
+.RE
+.PP
+.I "TODO - mention trapd access configuration"
+
+.SS "DisMan Event MIB"
+The simplest configuration for active self-monitoring of
+the agent, by the agent, for the agent, is probably:
+.RS
+.nf
+\fI# Set up the credentials to retrieve monitored values\fR
+createUser _internal MD5 "the first sign of madness"
+iquerySecName _internal
+rouser _internal
+
+\fI# Active the standard monitoring entries\fR
+defaultMonitors yes
+linkUpDownNotifications yes
+
+\fI# If there's a problem, then tell someone!\fR
+trap2sink localhost
+.fi
+.RE
+.PP
+The first block sets up a suitable user for retrieving the
+information to by monitored, while the following pair of
+directives activates various built-in monitoring entries.
+.PP
+Note that the DisMan directives are not themselves sufficient to
+actively report problems - there also needs to be a suitable
+destination configured to actually send the resulting notifications to.
+.PP
+A more detailed monitor example is given by:
+.RS
+monitor \-u me \-o hrSWRunName "high process memory" hrSWRunPerfMem > 10000
+.RE
+.PP
+This defines an explicit boolean monitor entry, looking for any process
+using more than 10MB of active memory. Such processes will be reported
+using the (standard) DisMan trap \fCmteTriggerFired\fR,
+but adding an extra (wildcarded) varbind \fChrSWRunName\fR.
+.PP
+This entry also specifies an explicit user (\fIme\fR, as defined
+earlier) for retrieving the monitored values, and building the trap.
+.PP
+Objects that could potentially fluctuate around the specified level
+are better monitored using a threshold monitor entry:
+.RS
+monitor \-D \-r 10 "network traffic" ifInOctets 1000000 5000000
+.RE
+.PP
+This will send a \fCmteTriggerRising\fR trap whenever the incoming
+traffic rises above (roughly) 500 kB/s on any network interface,
+and a corresponding \fCmteTriggerFalling\fR trap when it falls below
+100 kB/s again.
+.PP
+Note that this monitors the deltas between successive samples (\fI\-D\fR)
+rather than the actual sample values themselves. The same effect
+could be obtained using:
+.RS
+monitor \-r 10 "network traffic" ifInOctets \- \- 1000000 5000000
+.RE
+.PP
+The \fIlinkUpDownNotifications\fR directive above is broadly
+equivalent to:
+.RS
+.nf
+notificationEvent linkUpTrap linkUp ifIndex ifAdminStatus ifOperStatus
+notificationEvent linkDownTrap linkDown ifIndex ifAdminStatus ifOperStatus
+
+monitor \-r 60 \-e linkUpTrap "Generate linkUp" ifOperStatus != 2
+monitor \-r 60 \-e linkDownTrap "Generate linkDown" ifOperStatus == 2
+.fi
+.RE
+.PP
+This defines the traps to be sent (using \fInotificationEvent\fR),
+and explicitly references the relevant notification in the corresponding
+monitor entry (rather than using the default DisMan traps).
+.PP
+The \fIdefaultMonitors\fR directive above is equivalent to a series
+of (boolean) monitor entries:
+.RS
+.nf
+monitor \-o prNames \-o prErrMessage "procTable" prErrorFlag != 0
+monitor \-o memErrorName \-o memSwapErrorMsg "memory" memSwapError != 0
+monitor \-o extNames \-o extOutput "extTable" extResult != 0
+monitor \-o dskPath \-o dskErrorMsg "dskTable" dskErrorFlag != 0
+monitor \-o laNames \-o laErrMessage "laTable" laErrorFlag != 0
+monitor \-o fileName \-o fileErrorMsg "fileTable" fileErrorFlag != 0
+.fi
+.RE
+and will send a trap whenever any of these entries indicate a problem.
+.PP
+An alternative approach would be to automatically invoke the corresponding
+"fix" action:
+.RS
+.nf
+setEvent prFixIt prErrFix = 1
+monitor \-e prFixIt "procTable" prErrorFlag != 0
+.fi
+.RE
+(and similarly for any of the other \fIdefaultMonitor\fR entries).
+.SS "DisMan Schedule MIB"
+The agent could be configured to reload its configuration
+once an hour, using:
+.RS
+repeat 3600 versionUpdateConfig.0 = 1
+.RE
+.PP
+Alternatively this could be configured to be run at specific
+times of day (perhaps following rotation of the logs):
+.RS
+cron 10 0 * * * versionUpdateConfig.0 = 1
+.RE
+.PP
+The one-shot style of scheduling is rather less common, but the
+secret SNMP virus could be activated on the next occurance of Friday 13th using:
+.RS
+at 13 13 13 * 5 snmpVirus.0 = 1
+.RE
+.SH "EXTENDING AGENT FUNCTIONALITY"
+.SS "Arbitrary Extension Commands"
+.I "Old Style"
+.RS
+.nf
+exec [MIBOID] NAME PROG ARGS"
+sh [MIBOID] NAME PROG ARGS"
+execfix NAME PROG ARGS"
+.fi
+.RE
+.I "New Style"
+.RS
+.nf
+extend [MIBOID] NAME PROG ARGS"
+extendfix [MIBOID] NAME PROG ARGS"
+.fi
+.RE
+.SS "MIB-Specific Extension Commands"
+.I One-Shot
+.RS
+"pass [\-p priority] MIBOID PROG"
+.RE
+.IP
+.I Persistent
+.RS
+"pass_persist [\-p priority] MIBOID PROG"
+.RE
+.SS "Embedded Perl Support"
+If embedded perl support is enabled in the agent, the default
+initialisation is equivalent to the directives:
+.RS
+.nf
+disablePerl false
+perlInitFile DATADIR/snmp/snmp_perl.pl
+.fi
+.RE
+The main mechanism for defining embedded perl scripts is the
+\fIperl\fR directive. A very simple (if somewhat pointless)
+MIB handler could be registered using:
+.RS
+.nf
+perl use Data::Dumper;
+perl sub myroutine { print "got called: ",Dumper(@_),"\\n"; }
+perl $agent\->register('mylink', '.1.3.6.1.8765', \\&myroutine);
+.fi
+.RE
+.PP
+This relies on the \fI$agent\fR object, defined in the example
+\fCsnmp_perl.pl\fR file.
+.PP
+A more realistic MIB handler might be:
+.RS
+.nf
+\fIXXX - WHAT ???\fR
+.fi
+.RE
+Alternatively, this code could be stored in an external file,
+and loaded using:
+.RS
+perl 'do DATADIR/snmp/perl_example.pl';
+.RE
+.\"
+.\" XXX - does this last entry need the quotes ??
+.\"
+.SS Dynamically Loadable Modules
+.I TODO
+.RS
+dlmod NAME PATH"
+.RE
+.SS "Proxy Support"
+A configuration for acting as a simple proxy for two other
+SNMP agents (running on remote systems) might be:
+.RS
+.nf
+com2sec \-Cn rem1context rem1user default remotehost1
+com2sec \-Cn rem2context rem2user default remotehost2
+
+proxy \-Cn rem1context \-v 1 -c public remotehost1 .1.3
+proxy \-Cn rem2context \-v 1 -c public remotehost2 .1.3
+.fi
+.RE
+(plus suitable access control entries).
+.PP
+The same \fIproxy\fR directives would also work with
+(incoming) SNMPv3 requests, which can specify a context directly.
+It would probably be more sensible to use contexts of
+\fIremotehost1\fR and \fIremotehost2\fR - the names above were
+chosen to indicate how these directives work together.
+.PP
+Note that the administrative settings for the proxied request
+are specified explicitly, and are independent of the settings
+from the incoming request.
+.PP
+An alternative use for the \fiproxy\fR directive is to pass
+part of the OID tree to another agent (either on a remote host
+or listening on a different port on the same system),
+while handling the rest internally:
+.RS
+proxy \-v 1 \-c public localhost:6161 .1.3.6.1.4.1.99
+.RE
+This mechanism can be used to link together two separate SNMP agents.
+.PP
+A less usual approach is to map one subtree into a different area
+of the overall MIB tree (either locally or on a remote system):
+.RS
+.nf
+\fI# uses SNMPv3 to access the MIB tree .1.3.6.1.2.1.1 on 'remotehost'
+# and maps this to the local tree .1.3.6.1.3.10\fR
+proxy \-v 3 \-l noAuthNoPriv \-u user remotehost .1.3.6.1.3.10 .1.3.6.1.2.1.1
+.fi
+.RE
+.SS SMUX Sub-Agents
+.RS
+.nf
+smuxsocket 127.0.0.1
+smuxpeer .1.3.6.1.2.1.14 ospf_pass
+.fi
+.RE
+.SS AgentX Sub-Agents
+The Net-SNMP agent could be configured to operate as an AgentX master
+agent (listening on a non-standard named socket, and running using
+the access privileges defined earlier), using:
+.RS
+.nf
+master agentx
+agentXSocket /tmp/agentx/master
+agentXPerms 0660 0550 nobody snmp
+.fi
+.RE
+.\"
+.\" XXX - do numeric UID/GID take a leading '#' ??
+.\" why not??
+.\"
+A sub-agent wishing to connect to this master agent would need
+the same \fIagentXSocket\fR directive, or the equivalent code:
+.RS
+.nf
+netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET,
+ "/tmp/agentx/master");
+.fi
+.RE
+.PP
+A loopback networked AgentX configuration could be set up using:
+.RS
+.nf
+agentXSocket tcp:localhost:705
+agentXTimeout 5
+agentXRetries 2
+.fi
+.RE
+on the master side, and:
+.RS
+.nf
+agentXSocket tcp:localhost:705
+agentXTimeout 10
+agentXRetries 1
+agentXPingInterval 600
+.fi
+.RE
+on the client.
+.PP
+Note that the timeout and retry settings can be asymmetric
+for the two directions, and the sub-agent can poll the master agent
+at regular intervals (600s = every 10 minutes), to ensure the
+connection is still working.
+.SH "OTHER CONFIGURATION"
+.RS
+override sysDescr.0 octet_str "my own sysDescr"
+.RE
+.RS
+injectHandler stash_cache NAME table_iterator
+.RE
+.SH "FILES"
+SYSCONFDIR/snmp/snmpd.conf
+.SH "SEE ALSO"
+snmpconf(1), snmpd.conf(5), snmp.conf(5), snmp_config(5), snmpd(8), EXAMPLE.conf, netsnmp_config_api(3).
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/man/snmpd.internal.5.def b/man/snmpd.internal.5.def
new file mode 100644
index 0000000..81147c7
--- /dev/null
+++ b/man/snmpd.internal.5.def
@@ -0,0 +1,92 @@
+.TH SNMPD.INTERNAL 5 "06 Dec 2005" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpd.internal - internal configuration of the Net-SNMP agent
+.SH DESCRIPTION
+The
+.I snmpd.conf(5)
+man page defines the syntax and behaviour of the main
+configuration directives that can be used to control the
+operation of the Net-SNMP agent, and the management information
+it provides.
+.PP
+However there are several other configuration directives
+(many of which, though not all, start with a leading underscore)
+that are recognised by the agent. These are typically used
+to retain configuration across agent restarts, and are not
+intended for direct user access.
+This man page list these directives, giving a brief indication
+of where they are used. For full details - see the relevant source
+files. If you can't follow that source, you probably shouldn't
+be fiddling with these directives!
+.SH AGENT BEHAVIOUR
+.IP "quit"
+.\" .SS "Listening addresses"
+.\" .SS "Run-time privileges"
+.\" .SS SNMPv3 Configuration
+.SH ACCESS CONTROL
+.\" .SS SNMPv3 Users
+.\" .SS Traditional Access Control
+.SS VACM Configuration
+.IP "vacmView / vacmGroup / vacmAccess "
+These directives are used to retain dynamically configured
+access control settings.
+.\" .SS Typed-View Configuration
+.SH SYSTEM INFORMATION
+.SS System Group
+.IP "setSerialNo "
+This directive is used to implement the advisory lock object
+\fCsnmpSetSerialNo\fR.
+.IP "psyslocation / psyscontact / psysname "
+These directives are used to retain dynamically configured
+system settings.
+They will be overridden by the corresponding
+\fIsysLocation\fR, \fIsysContact\fR and \fIsysName\fR directives.
+.\" .SS Host Resources Group
+.\" .SS Process Monitoring
+.\" .SS Disk Usage Monitoring
+.\" .SS System Load Monitoring
+.\" .SS Log File Monitoring
+.SH "ACTIVE MONITORING"
+.SS "Notification Handling"
+.IP "pauthtrapenable"
+This directive is used to retain the dynamically configured
+setting of whether the agent should generate authenticationFailure
+traps.
+It will be overridden by the corresponding
+\fIauthtrapenable\fR directive.
+.IP "snmpNotify*Table "
+.IP "targetAddr / targetParams "
+These directives are used to retain dynamically configured
+notification destination settings.
+.SS "DisMan Event MIB"
+.IP "_mteE*Table, _mteOTable, _mteT*Table "
+These directives are used to retain dynamically configured
+event, object and monitor trigger settings.
+.IP "mteObjectsTable / mteTriggerTable "
+These directives are for compatibility with the previous
+\fIdisman/event-mib\fR implementation.
+.SS "DisMan Schedule MIB"
+.IP "_schedTable "
+This directive is used to retain dynamically configured
+scheduled events.
+.SH "EXTENDING AGENT FUNCTIONALITY"
+.SS "Arbitrary Extension Commands"
+.IP "extend-sh "
+.IP "exec2 / sh2 / execFix2 "
+These directives were defined by analogy with equivalent directives
+in the previous \fIucd-snmp/extensible\fR implementation.
+They are deprecated, and should not be used.
+.\" .SS "MIB-Specific Extension Commands"
+.\" .SS "Embedded Perl Support"
+.\" .SS Dynamically Loadable Modules
+.\" .SS "Proxy Support"
+.\" .SS SMUX Sub-Agents
+.\" .SS AgentX Sub-Agents
+.\" .SH "OTHER CONFIGURATION"
+.SH "FILES"
+SYSCONFDIR/snmp/snmpd.conf
+.SH "SEE ALSO"
+snmpconf(1), snmpd.conf(5), snmp.conf(5), snmp_config(5), snmpd(8), EXAMPLE.conf, netsnmp_config_api(3).
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/man/snmpdelta.1.def b/man/snmpdelta.1.def
new file mode 100644
index 0000000..fe80b57
--- /dev/null
+++ b/man/snmpdelta.1.def
@@ -0,0 +1,160 @@
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP's COPYING file for more details and other copyrights
+.\" that may apply:
+.\" /***********************************************************
+.\" 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.
+.\" ******************************************************************/
+.TH SNMPDELTA 1 "25 Jul 2003" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpdelta \- Monitor delta differences in SNMP Counter values
+.SH SYNOPSIS
+.B snmpdelta
+[ COMMON OPTIONS ] [\-Cf] [ \-Ct ] [ \-Cs ] [ \-CS ] [ \-Cm ] [ \-CF configfile ] [ \-Cl ] [ \-Cp period ] [ \-CP Peaks ] [ \-Ck ] [ \-CT ] AGENT OID [ OID ... ]
+.SH "DESCRIPTION"
+.B snmpdelta
+will monitor the specified integer valued OIDs, and report changes
+over time.
+.PP
+AGENT identifies a target SNMP agent, which is instrumented
+to monitor the given objects. At its simplest, the AGENT
+specification will consist of a hostname or an IPv4
+address. In this situation, the command will attempt
+communication with the agent, using UDP/IPv4 to port 161
+of the given target host. See snmpcmd(1) for a full list of
+the possible formats for AGENT.
+.PP
+OID is an object identifier which uniquely
+identifies the object type within a MIB. Multiple
+OIDs can be specified on a single snmpdelta command.
+.PP
+.SH OPTIONS
+.TP 8
+.B COMMON OPTIONS
+Please see
+.I snmpcmd(1)
+for a list of possible values for COMMON OPTIONS
+as well as their descriptions.
+.TP
+.B \-Cf
+Don't fix errors and retry the request.
+Without this option, if multiple oids have been specified for
+a single request and if the request for one or more of the
+oids fails, snmpdelta will retry the request so that data for
+oids apart from the ones that failed will still be returned.
+Specifying \-Cf tells
+.I snmpdelta
+not to retry a request, even
+if there are multiple oids specified.
+.TP
+.B \-Ct
+Flag will determine time interval from the monitored entity.
+.TP
+.B \-Cs
+Flag will display a timestamp.
+.TP
+.B \-CS
+Generates a "sum count" in addition to the individual instance
+counts. The "sum count" is the total of all the individual
+deltas for each time period.
+.TP
+.B \-Cm
+Prints the max value ever attained.
+.TP
+.B \-CF configfile
+Tells
+.B snmpdelta
+to read it's configuration from the specified file.
+This options allows the input to be set up in advance rather
+than having to be specified on the command line.
+.TP
+.B \-Cl
+Tells
+.B snmpdelta
+to write it's configuration to files whose names correspond to the MIB
+instances monitored. For example, snmpdelta \-Cl localhost ifInOctets.1
+will create a file "localhost\-ifInOctets.1".
+.TP
+.B \-Cp
+Specifies the number of seconds between polling periods.
+Polling constitutes sending a request to the agent. The
+default polling period is one second.
+.TP
+.B \-CP peaks
+Specifies the reporting period in number of polling periods.
+If this option is specified, snmpdelta polls the agent
+.I peaks
+number of times before reporting the results.
+The result reported includes the average value over
+the reporting period. In addition, the highest polled
+value within the reporting period is shown.
+.TP
+.B \-Ck
+When the polling period (\-Cp) is an increment of 60 seconds
+and the timestamp is displayed in the output (\-Cs), then
+the default display shows the timestamp in the format
+hh:mm mm/dd. This option causes the timestamp format
+to be hh:mm:ss mm/dd.
+.TP
+.B \-CT
+Makes
+.B snmpdelta
+print its output in tabular form.
+.TP
+.B \-Cv vars/pkt
+Specifies the maximum number of oids allowed to be packaged
+in a single PDU. Multiple PDUs can be created in a single
+request. The default value of variables per packet is 60.
+This option is useful if a request response results in an
+error becaues the packet is too big.
+.PP
+Note that
+.B snmpdelta
+REQUIRES an argument specifying the agent to query
+and at least one OID argument, as described in the
+.I snmpcmd(1)
+manual page.
+.SH EXAMPLES
+.nf
+$ snmpdelta \-c public \-v 1 \-Cs localhost IF\-MIB::ifInUcastPkts.3 IF\-MIB::ifOutUcastPkts.3
+[20:15:43 6/14] ifInUcastPkts.3 /1 sec: 158
+[20:15:43 6/14] ifOutUcastPkts.3 /1 sec: 158
+[20:15:44 6/14] ifInUcastPkts.3 /1 sec: 184
+[20:15:44 6/14] ifOutUcastPkts.3 /1 sec: 184
+[20:15:45 6/14] ifInUcastPkts.3 /1 sec: 184
+[20:15:45 6/14] ifOutUcastPkts.3 /1 sec: 184
+[20:15:46 6/14] ifInUcastPkts.3 /1 sec: 158
+[20:15:46 6/14] ifOutUcastPkts.3 /1 sec: 158
+[20:15:47 6/14] ifInUcastPkts.3 /1 sec: 184
+[20:15:47 6/14] ifOutUcastPkts.3 /1 sec: 184
+[20:15:48 6/14] ifInUcastPkts.3 /1 sec: 184
+[20:15:48 6/14] ifOutUcastPkts.3 /1 sec: 184
+[20:15:49 6/14] ifInUcastPkts.3 /1 sec: 158
+[20:15:49 6/14] ifOutUcastPkts.3 /1 sec: 158
+^C
+$ snmpdelta \-c public \-v 1 \-Cs \-CT localhost IF\-MIB:ifInUcastPkts.3 IF\-MIB:ifOutcastPkts.3
+localhost ifInUcastPkts.3 ifOutUcastPkts.3
+[20:15:59 6/14] 184.00 184.00
+[20:16:00 6/14] 158.00 158.00
+[20:16:01 6/14] 184.00 184.00
+[20:16:02 6/14] 184.00 184.00
+[20:16:03 6/14] 158.00 158.00
+[20:16:04 6/14] 184.00 184.00
+[20:16:05 6/14] 184.00 184.00
+[20:16:06 6/14] 158.00 158.00
+^C
+.fi
+.PP
+The following example uses a number of options. Since the
+.I Cl
+option is specified, the output is sent to a file and not to the
+screen.
+.PP
+.nf
+$ snmpdelta \-c public \-v 1 \-Ct \-Cs \-CS \-Cm \-Cl \-Cp 60 \-CP 60
+ interlink.sw.net.cmu.edu .1.3.6.1.2.1.2.2.1.16.3 .1.3.6.1.2.1.2.2.1.16.4
+.fi
+.SH "SEE ALSO"
+snmpcmd(1), variables(5).
diff --git a/man/snmpdf.1.def b/man/snmpdf.1.def
new file mode 100644
index 0000000..75ebaf8
--- /dev/null
+++ b/man/snmpdf.1.def
@@ -0,0 +1,71 @@
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP's COPYING file for more details and other copyrights
+.\" that may apply:
+.\" /***********************************************************
+.\" 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.
+.\" ******************************************************************/
+.TH SNMPDF 1 "25 Jul 2003" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpdf - display disk space usage on a network entity via SNMP
+.SH SYNOPSIS
+.B snmpdf
+[COMMON OPTIONS] [\-Cu] AGENT
+.SH DESCRIPTION
+.B snmpdf
+is simply a networked version of the typical df command. It
+checks the disk space on the remote machine by examining the
+HOST\-RESOURCES\-MIB's hrStorageTable or the UCD\-SNMP\-MIB's dskTable.
+By default, the hrStorageTable is preferred as it typically contains
+more information. However, the \-Cu argument can be passed to snmpdf
+to force the usage of the dskTable.
+.PP
+AGENT identifies a target SNMP agent, which is instrumented
+to monitor the gievn objects. At its simplest, the AGENT
+specification will consist of a hostname or an IPv4
+address. In this situation, the command will attempt
+communication with the agent, using UDP/IPv4 to port 161
+of the given target host. See the
+.I snmpcmd(1)
+manual page for a full list of the possible formats for AGENT.
+.PP
+See the
+.I snmpd.conf(5)
+manual page on setting up the dskTable using the
+.I disk
+directive in the snmpd.conf file.
+.SH "OPTIONS"
+.TP 8
+.B COMMON OPTIONS
+Please see
+.I snmpcmd(1)
+for a list of possible values for COMMON OPTIONS
+as well as their descriptions.
+.TP
+.B \-Cu
+Forces the command to use dskTable in mib
+UCD\-SNMP\-MIB instead of the default to determine
+the storage information. Generally, the default
+use of hrStorageTable in mib HOST\-RESOURCES\-MIB
+is preferred because it typically contains
+more information.
+.SH "EXAMPLES"
+.PP
+% snmpdf \-v 2c \-c public localhost
+.PP
+.nf
+Description size (kB) Used Available Used%
+/ 7524587 2186910 5337677 29%
+/proc 0 0 0 0%
+/etc/mnttab 0 0 0 0%
+/var/run 1223088 32 1223056 0%
+/tmp 1289904 66848 1223056 5%
+/cache 124330 2416 121914 1%
+/vol 0 0 0 0%
+Real Memory 524288 447456 76832 85%
+Swap Space 1420296 195192 1225104 13%
+.fi
+.SH "SEE ALSO"
+snmpd.conf(5), snmp.conf(5)
diff --git a/man/snmpget.1.def b/man/snmpget.1.def
new file mode 100644
index 0000000..0ecac19
--- /dev/null
+++ b/man/snmpget.1.def
@@ -0,0 +1,118 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP 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.
+.\" ******************************************************************/
+.TH SNMPGET 1 "18 Jun 2007" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpget - communicates with a network entity using SNMP GET requests
+.SH SYNOPSIS
+.B snmpget
+[COMMON OPTIONS] [\-Cf] AGENT OID [OID]...
+.SH DESCRIPTION
+.B snmpget
+is an SNMP application that uses the SNMP GET request to query for
+information on a network entity. One or more object identifiers
+(OIDs) may be given as arguments on the command line. Each variable
+name is given in the format specified in
+.IR variables(5) .
+.SH "OPTIONS"
+.TP 8
+.B \-Cf
+If
+.B \-Cf
+is
+.I not
+specified, some applications
+.RB ( snmpdelta ", " snmpget ", " snmpgetnext " and " snmpstatus )
+will try to fix errors returned by the agent that you were talking to
+and resend the request. The only time this is really useful is if you
+specified a OID that didn't exist in your request and you're using
+SNMPv1 which requires "all or nothing" kinds of requests.
+.PP
+In addition to this option,
+.B snmpget
+takes the common options described in the
+.I snmpcmd(1)
+manual page.
+Note that
+.B snmpget
+REQUIRES an argument specifying the agent to query
+and at least one OID argument, as described there.
+.SH "EXAMPLES"
+The command:
+.PP
+ snmpget \-c public zeus system.sysDescr.0
+.PP
+will retrieve the variable system.sysDescr.0 from the host
+.B zeus
+using the community string
+.B public
+:
+.PP
+ system.sysDescr.0 = "SunOS zeus.net.cmu.edu 4.1.3_U1 1 sun4m"
+.PP
+If the network entity has an error processing the request packet, an
+error packet will be returned and a message will be shown, helping to
+pinpoint in what way the request was malformed. If there were other
+variables in the request, the request will be resent without the bad
+variable.
+.PP
+Here is another example. The \-c and \-v options are defined in the
+.I snmpcmd(1)
+manual page. (Note that system.sysUpTime is an incomplete
+OID, as it needs the .0 index appended to it):
+.PP
+.nf
+ snmpget \-v1 \-Cf \-c public localhost system.sysUpTime system.sysContact.0
+.fi
+.PP
+This example will return the following:
+.PP
+.nf
+ Error in packet
+ Reason: (noSuchName) There is no such variable name in this MIB.
+ This name doesn't exist: system.sysUpTime
+.fi
+.PP
+Similarly, the command:
+.nf
+ snmpget \-v1 \-c public localhost system.sysUpTime system.sysContact.0
+.fi
+.PP
+Will return:
+.PP
+.nf
+ Error in packet
+ Reason: (noSuchName) There is no such variable name in this MIB.
+ This name doesn't exist: system.sysUpTime
+
+ system.sysContact.0 = STRING: root@localhost
+.fi
+.PP
+With the
+.B
+\-Cf
+flag specified the application will not try to fix the PDU for you.
+.SH "SEE ALSO"
+snmpcmd(1), snmpwalk(1), variables(5).
diff --git a/man/snmpgetnext.1.def b/man/snmpgetnext.1.def
new file mode 100644
index 0000000..5e99a18
--- /dev/null
+++ b/man/snmpgetnext.1.def
@@ -0,0 +1,77 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP 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.
+.\" ******************************************************************/
+.TH SNMPGETNEXT 1 "04 Mar 2002" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpgetnext - communicates with a network entity using SNMP GETNEXT requests
+.SH SYNOPSIS
+.B snmpgetnext
+[COMMON OPTIONS] [\-Cf] AGENT OID [OID]...
+.SH DESCRIPTION
+.B snmpget
+is an SNMP application that uses the SNMP GETNEXT request to query for
+information on a network entity. One or more object identifiers
+(OIDs) may be given as arguments on the command line. Each variable
+name is given in the format specified in
+.IR variables(5) .
+For each one, the variable that is lexicographically "next" in the
+remote entity's MIB will be returned.
+.PP
+For example:
+.PP
+snmpgetnext \-c public zeus interfaces.ifTable.ifEntry.ifType.1
+.PP
+will retrieve the variable interfaces.ifTable.ifEntry.ifType.2:
+.PP
+interfaces.ifTable.ifEntry.ifType.2 = softwareLoopback(24)
+.PP
+If the network entity has an error processing the request packet, an
+error message will be shown, helping to pinpoint in what way the
+request was malformed.
+.SH "OPTIONS"
+.TP 8
+.B \-Cf
+If
+.B \-Cf
+is
+.I not
+specified, some applications
+.RB ( snmpdelta ", " snmpget ", " snmpgetnext " and " snmpstatus )
+will try to fix errors returned by the agent that you were talking to
+and resend the request. The only time this is really useful is if you
+specified a OID that didn't exist in your request and you're using
+SNMPv1 which requires "all or nothing" kinds of requests.
+.PP
+In addition to this option,
+.B snmpgetnext
+takes the common options described in the
+.I snmpcmd(1)
+manual page.
+Note that
+.B snmpgetnext
+REQUIRES an argument specifying the agent to query
+and at least one OID argument, as described there.
+.SH "SEE ALSO"
+snmpcmd(1), snmpget(1), variables(5).
diff --git a/man/snmpinform.1 b/man/snmpinform.1
new file mode 100644
index 0000000..6734e85
--- /dev/null
+++ b/man/snmpinform.1
@@ -0,0 +1 @@
+.so man1/snmptrap.1
diff --git a/man/snmpnetstat.1.def b/man/snmpnetstat.1.def
new file mode 100644
index 0000000..e3aa634
--- /dev/null
+++ b/man/snmpnetstat.1.def
@@ -0,0 +1,314 @@
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP's COPYING file for more details and other copyrights
+.\" that may apply:
+.\" /***********************************************************
+.\" Copyright 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 (c) 1983, 1988, 1993
+.\" 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 the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)netstat.1 6.8 (Berkeley) 9/20/88
+.\"
+.\" /***********************************************************
+.\" 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.
+.\" ******************************************************************/
+.TH SNMPNETSTAT 1 "20 Jan 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpnetstat \- display networking status and configuration information from a network entity via SNMP
+.SH SYNOPSIS
+.B snmpnetstat
+[COMMON OPTIONS] [\-Ca] [\-Cn] AGENT
+.br
+.B snmpnetstat
+[COMMON OPTIONS] [\-Ci] [\-Co] [\-Cr] [\-Cn] [\-Cs] AGENT
+.br
+.B snmpnetstat
+[COMMON OPTIONS] [\-Ci] [\-Cn] [\-CI interface] AGENT [interval]
+.br
+.B snmpnetstat
+[COMMON OPTIONS] [\-Ca] [\-Cn] [\-Cs] [\-Cp protocol] AGENT
+.SH DESCRIPTION
+The
+.B snmpnetstat
+command symbolically displays the values of various network-related
+information retrieved from a remote system using the SNMP protocol.
+There are a number of output formats,
+depending on the options for the information presented.
+The first form of the command displays a list of active sockets.
+The second form presents the values of other network-related
+information according to the option selected.
+Using the third form, with an
+.I interval
+specified,
+.I snmpnetstat
+will continuously display the information regarding packet
+traffic on the configured network interfaces.
+The fourth form displays statistics about the named protocol.
+.PP
+.B snmpnetstat
+will issue GETBULK requests to query for information
+if at least protocol version
+.I v2
+is used.
+.PP
+AGENT identifies a target SNMP agent, which is
+instrumented to monitor the given objects.
+At its simplest, the AGENT specification will
+consist of a hostname or an IPv4 address. In this
+situation, the command will attempt communication
+with the agent, using UDP/IPv4 to port 161 of the
+given target host. See snmpcmd(1) for a full list of
+the possible formats for AGENT.
+.PP
+.SH OPTIONS
+The options have the following meaning:
+.PP
+.B COMMON OPTIONS
+ Please see
+.I snmpcmd(1)
+for a list of possible values for common options
+as well as their descriptions.
+.PP
+.B \-Ca
+With the default display,
+show the state of all sockets; normally sockets used by
+server processes are not shown.
+.PP
+.B \-Ci
+Show the state of all of the network interfaces.
+The interface display provides a table of cumulative
+statistics regarding packets transferred, errors, and collisions.
+The network addresses of the interface and the maximum transmission
+unit (``mtu'') are also displayed.
+.PP
+.B \-Co
+Show an abbreviated interface status, giving octets in place of packets.
+This is useful when enquiring virtual interfaces (such as Frame-Relay circuits)
+on a router.
+.PP
+.BI \-CI " interface"
+Show information only about this interface;
+used with an
+.I interval
+as described below.
+.PP
+.B \-Cn
+Show network addresses as numbers (normally
+.I snmpnetstat
+interprets addresses and attempts to display them
+symbolically).
+This option may be used with any of the display formats.
+.PP
+.BI \-Cp " protocol"
+Show statistics about
+.IR protocol,
+which is either a well-known name for a protocol or an alias for it. Some
+protocol names and aliases are listed in the file
+.IR /etc/protocols .
+A null response typically means that there are no interesting numbers to
+report.
+The program will complain if
+.I protocol
+is unknown or if there is no statistics routine for it.
+.PP
+.B \-Cs
+Show per-protocol statistics. When used with the
+.B \-Cr
+option, show routing statistics instead.
+.PP
+.B \-Cr
+Show the routing tables.
+When
+.B \-Cs
+is also present, show per-protocol routing statistics instead of
+the routing tables.
+.PP
+.BI \-CR " repeaters"
+For GETBULK requests,
+.I repeaters
+specifies the max-repeaters value to use.
+.PP
+When snmpnetstat is invoked with an interval argument, it
+displays a running count of statistics related to network
+interfaces.
+.I interval
+is the number of seconds between
+reporting of statistics.
+.PP
+.I The Active Sockets Display (default)
+.PP
+The default display, for active sockets, shows the local
+and remote addresses, protocol, and the internal state of
+the protocol. Address formats are of the form
+``host.port'' or ``network.port'' if a socket's address
+specifies a network but no specific host address. When
+known, the host and network addresses are displayed symbolically
+according to the data bases
+.I /etc/hosts and
+.IR /etc/networks,
+respectively. If a symbolic name for an
+address is unknown, or if the
+.B \-Cn
+option is specified, the
+address is printed numerically, according to the address
+family. For more information regarding the Internet ``dot
+format,'' refer to
+.IR inet(3N).
+Unspecified, or ``wildcard'', addresses and ports appear as ``*''.
+.PP
+.I The Interface Display
+.PP
+The interface display provides a table of cumulative
+statistics regarding packets transferred, errors, and col-
+lisions. The network addresses of the interface and the
+maximum transmission unit (``mtu'') are also displayed.
+.PP
+.I The Routing Table Display
+.PP
+The routing table display indicates the available routes
+and their status. Each route consists of a destination
+host or network and a gateway to use in forwarding pack-
+ets. The flags field shows the state of the route (``U''
+if ``up''), whether the route is to a gateway (``G''),
+whether the route was created dynamically by a redirect
+(``D''), and whether the route has been modified by a
+redirect (``M''). Direct routes are created for each
+interface attached to the local host; the gateway field
+for such entries shows the address of the outgoing inter-
+face. The interface entry indicates the network interface
+utilized for the route.
+.PP
+.I The Interface Display with an Interval
+.PP
+When
+.I snmpnetstat
+is invoked with an
+.I interval
+argument, it
+displays a running count of statistics related to network
+interfaces. This display consists of a column for the
+primary interface and a column summarizing information for
+all interfaces. The primary interface may be replaced
+with another interface with the
+.B \-CI
+option. The first line
+of each screen of information contains a summary since the
+system was last rebooted. Subsequent lines of output show
+values accumulated over the preceding interval.
+.PP
+.I The Active Sockets Display for a
+.I Single Protocol
+.PP
+When a protocol is specified with the
+.B \-Cp
+option, the
+information displayed is similar to that in the
+default display for active sockets, except the
+display is limited to the given protocol.
+.SH EXAMPLES
+Example of using snmpnetstat to display active sockets (default):
+.PP
+% snmpnetstat \-v 2c \-c public \-Ca testhost
+.PP
+.nf
+Active Internet (tcp) Connections (including servers)
+Proto Local Address Foreign Address (state)
+tcp *.echo *.* LISTEN
+tcp *.discard *.* LISTEN
+tcp *.daytime *.* LISTEN
+tcp *.chargen *.* LISTEN
+tcp *.ftp *.* LISTEN
+tcp *.telnet *.* LISTEN
+tcp *.smtp *.* LISTEN
+\&...
+
+Active Internet (udp) Connections
+Proto Local Address
+udp *.echo
+udp *.discard
+udp *.daytime
+udp *.chargen
+udp *.time
+\&...
+.fi
+.PP
+% snmpnetstat \-v 2c \-c public \-Ci testhost
+.PP
+.nf
+Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Queue
+eri0 1500 10.6.9/24 testhost 170548881 245601 687976 0 0
+lo0 8232 127 localhost 7530982 0 7530982 0 0
+.fi
+.PP
+Example of using snmpnetstat to show statistics about a specific protocol:
+.PP
+.nf
+% snmpnetstat \-v 2c \-c public \-Cp tcp testhost
+
+Active Internet (tcp) Connections
+Proto Local Address Foreign Address (state)
+tcp *.echo *.* LISTEN
+tcp *.discard *.* LISTEN
+tcp *.daytime *.* LISTEN
+tcp *.chargen *.* LISTEN
+tcp *.ftp *.* LISTEN
+tcp *.telnet *.* LISTEN
+tcp *.smtp *.* LISTEN
+\&...
+.fi
+.SH SEE ALSO
+snmpcmd(1),
+iostat(1),
+vmstat(1),
+hosts(5),
+networks(5),
+protocols(5),
+services(5).
+.SH BUGS
+The notion of errors is ill-defined.
diff --git a/man/snmpset.1.def b/man/snmpset.1.def
new file mode 100644
index 0000000..b0c4e07
--- /dev/null
+++ b/man/snmpset.1.def
@@ -0,0 +1,110 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP 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.
+.\" ******************************************************************/
+.TH SNMPSET 1 "19 Jun 2003" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpset - communicates with a network entity using SNMP SET requests
+.SH SYNOPSIS
+.B snmpset
+[COMMON OPTIONS] AGENT OID TYPE VALUE [OID TYPE VALUE]...
+.SH DESCRIPTION
+.B snmpset
+is an SNMP application that uses the SNMP SET request to set
+information on a network entity. One or more object identifiers
+(OIDs) must be given as arguments on the command line. A type and a
+value to be set must accompany each object identifier. Each variable
+name is given in the format specified in
+.IR variables(5) .
+.PP
+The
+.I TYPE
+is a single character, one of:
+.RS
+.PD 0
+.TP 3
+.B i
+INTEGER
+.TP 3
+.B u
+UNSIGNED
+.TP 3
+.B s
+STRING
+.TP 3
+.B x
+HEX STRING
+.TP 3
+.B d
+DECIMAL STRING
+.TP 3
+.B n
+NULLOBJ
+.TP 3
+.B o
+OBJID
+.TP 3
+.B t
+TIMETICKS
+.TP 3
+.B a
+IPADDRESS
+.TP 3
+.B b
+BITS
+.PD
+.RE
+Most of these will use the obvious corresponding ASN.1 type.
+\&'s', 'x', 'd' and 'b' are all different ways of specifying an OCTET STRING
+value, and the 'u' unsigned type is also used for handling Gauge32 values.
+.PP
+If you have the proper MIB file loaded, you can, in most cases, replace the
+type with an '=' sign. For an object of type OCTET STRING this will assume
+a string like the 's' type notation. For other types it will do "The
+Right Thing".
+.PP
+For example:
+.PP
+snmpset \-c private \-v 1 test\-hub system.sysContact.0 s dpz@noc.rutgers.edu ip.ipforwarding.0 = 2
+.PP
+will set the variables sysContact.0 and ipForwarding.0:
+.PP
+system.sysContact.0 = STRING: "dpz@noc.rutgers.edu"
+.br
+ip.ipForwarding.0 = INTEGER: not\-forwarding(2)
+.PP
+If the network entity has an error processing the request packet, an
+error packet will be returned and a message will be shown, helping to
+pinpoint in what way the request was malformed.
+.SH OPTIONS
+.B snmpset
+takes the common options described in the
+.I snmpcmd(1)
+manual page.
+Note that
+.B snmpset
+REQUIRES an argument specifying the agent to query
+and at least one set of OID/type/value arguments, as described in there.
+.SH "SEE ALSO"
+snmpcmd(1), variables(5).
diff --git a/man/snmpstatus.1.def b/man/snmpstatus.1.def
new file mode 100644
index 0000000..df7824f
--- /dev/null
+++ b/man/snmpstatus.1.def
@@ -0,0 +1,112 @@
+.\" Portions of this file are subject to the following copyright. 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 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.
+.\" ******************************************************************/
+.TH SNMPSTATUS 1 "25 Jul 2003" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpstatus - retrieves a fixed set of management information from a network entity
+.SH SYNOPSIS
+.B snmpstatus
+[COMMON OPTIONS] [\-Cf] AGENT
+.SH DESCRIPTION
+.B snmpstatus
+is an SNMP application that retrieves several important statistics
+from a network entity.
+.PP
+AGENT identifies a target SNMP agent, which is instrumented
+to monitor the given objects. At its simplest, the AGENT
+specification will consist of a hostname or an IPv4 address.
+n this situation, the command will attempt communication with
+the agent, using UDP/IPv4 to port 161 of the given target host.
+.PP
+See the
+.I snmpcmd(1)
+manual page for a full list of the possible formats for AGENT.
+.PP
+The information returned is:
+.IP
+The IP address of the entity.
+.br
+A textual description of the entity (sysDescr.0)
+.br
+The uptime of the entity's SNMP agent (sysUpTime.0)
+.br
+The sum of received packets on all interfaces
+(ifInUCastPkts.* + ifInNUCastPkts.*)
+.br
+The sum of transmitted packets on all interfaces
+(ifOutUCastPkts.* + ifOutNUCastPkts.*)
+.br
+The number of IP input packets (ipInReceives.0)
+.br
+The number of IP output packets (ipOutRequests.0)
+.PP
+For example:
+.PP
+snmpstatus \-c public \-v 1 netdev\-kbox.cc.cmu.edu
+.PP
+will produce output similar to the following:
+.PP
+[128.2.56.220]=>[Kinetics FastPath2] Up: 1 day, 4:43:31
+.br
+Interfaces: 1, Recv/Trans packets: 262874/39867 |
+IP: 31603/15805
+.PP
+.B snmpstatus
+also checks the operational status of all interfaces (ifOperStatus.*),
+and if it finds any that are not running, it will report in a manner
+similar to this:
+.PP
+2 interfaces are down!
+.PP
+If the network entity has an error processing the request packet, an
+error packet will be returned and a message will be shown, helping to
+pinpoint in what way the request was malformed.
+.B snmpstatus
+will attempt to reform its request to eliminate the malformed
+variable (unless the
+.B \-Cf
+option is given, see below), but this variable will then be missing
+from the displayed data.
+.PP
+.SH OPTIONS
+.TP
+.B COMMON OPTIONS
+Please see
+.I snmpcmd(1)
+for a list of possible values for COMMON OPTIONS
+as well as their descriptions.
+.TP
+.B \-Cf
+By default, snmpstatus will try to fix errors returned
+by the agent and retry a request. In this situation,
+the command will display the data that it can. If the \-Cf option
+is specified, then snmpstatus will not try to fix
+errors, and the error will cause the command to terminate.
+.SH "SEE ALSO"
+snmpcmd(1), snmpget(1)
diff --git a/man/snmptable.1.def b/man/snmptable.1.def
new file mode 100644
index 0000000..743da1b
--- /dev/null
+++ b/man/snmptable.1.def
@@ -0,0 +1,167 @@
+.\" /************************************************************
+.\" Copyright 1997 Niels Baggesen
+.\"
+.\" 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.
+.\"
+.\" I DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+.\" ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+.\" I 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 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.
+.\" ******************************************************************/
+.TH SNMPTABLE 1 "25 Jul 2003" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmptable - retrieve an SNMP table and display it in tabular form
+.SH SYNOPSIS
+.B snmptable
+[COMMON OPTIONS] [\-Cb] [\-CB] [\-Ch] [\-CH] [\-Ci] [\-Cf STRING] [\-Cw WIDTH]
+AGENT TABLE\-OID
+.SH DESCRIPTION
+.B snmptable
+is an SNMP application that repeatedly uses the SNMP GETNEXT or
+GETBULK requests to query for information on a network entity. The
+parameter
+.I TABLE\-OID
+must specify an SNMP table.
+.PP
+snmptable is an SNMP application that repeatedly uses the
+SNMP GETNEXT or GETBULK requests to query for information
+on a network entity. The parameter TABLE\-OID must specify
+an SNMP table.
+
+AGENT identifies a target SNMP agent, which is instrumented
+to monitor the gievn objects. At its simplest, the AGENT
+specification will consist of a hostname or an IPv4
+address. In this situation, the command will attempt
+communication with the agent, using UDP/IPv4 to port 161
+of the given target host. See
+.I snmpcmd(1)
+for a full list of
+the possible formats for AGENT.
+.SH OPTIONS
+.TP 8
+.B COMMON OPTIONS
+Please see
+.I snmpcmd(1)
+for a list of possible values for COMMON OPTIONS
+as well as their descriptions.
+.TP
+.B \-Cb
+Display only a brief heading. Any common prefix of the table field
+names will be deleted.
+.TP
+.B \-CB
+Do not use GETBULK requests to retrieve data, only GETNEXT.
+.TP
+.BI \-Cc " CHARS"
+Print table in columns of
+.I CHARS
+characters width.
+.TP
+.BI \-Cf " STRING"
+The string
+.I STRING
+is used to separate table columns. With this option, each table entry
+will be printed in compact form, just with the string given to
+separate the columns (useful if you want to import it into a
+database). Otherwise it is printed in nicely aligned columns.
+.TP
+.B \-Ch
+Display
+.I only
+the column headings.
+.TP
+.B \-CH
+Do not display the column headings.
+.TP
+.B \-Ci
+This option prepends the index of the entry to all printed lines.
+.TP
+.B \-Cl
+Left justify the data in each column.
+.TP
+.BI \-Cr " REPEATERS"
+For GETBULK requests,
+.I REPEATERS
+specifies the max-repeaters value to use. For GETNEXT requests,
+.I REPEATERS
+specifies the number of entries to retrieve at a time.
+.TP
+.BI \-Cw " WIDTH"
+Specifies the width of the lines when the table is printed.
+If the lines will be longer, the table will be printed in sections of
+at most
+.I WIDTH
+characters. If
+.I WIDTH
+is less than the length of the contents of
+a single column, then that single column will still be printed.
+.PP
+Note that
+.B snmptable
+REQUIRES an argument specifying the agent to query
+and exactly one OID argument, as described in the
+.I snmpcmd(1)
+manual page. This OID \fBmust\fP be that of a MIB table object.
+.SH EXAMPLES
+$ snmptable \-v 2c \-c public localhost at.atTable
+
+SNMP table: at.atTable RFC1213\-MIB::atTable
+
+atIfIndex atPhysAddress atNetAddress
+ 1 8:0:20:20:0:ab 130.225.243.33
+.PP
+$ snmptable \-v 2c \-c public \-Cf + localhost at.atTable
+
+SNMP table: at.atTable
+
+atIfIndex+atPhysAddress+atNetAddress
+1+8:0:20:20:0:ab+130.225.243.33
+.PP
+.nf
+$ snmptable localhost \-Cl \-CB \-Ci \-OX \-Cb \-Cc 16 \-Cw 64 ifTable
+
+SNMP table: ifTable
+
+Index Descr Type Mtu
+Speed PhysAddress AdminStatus OperStatus
+LastChange InOctets InUcastPkts InNUcastPkts
+InDiscards InErrors InUnknownProtos OutOctets
+OutUcastPkts OutNUcastPkts OutDiscards OutErrors
+OutQLen Specific
+
+index: [1]
+1 lo softwareLoopbac 16436
+10000000 up up
+? 2837283786 3052466 ?
+0 0 ? 2837283786
+3052466 ? 0 0
+0 zeroDotZero
+
+index: [2]
+2 eth0 ethernetCsmacd 1500
+10000000 0:5:5d:d1:f7:cf up up
+? 2052604234 44252973 ?
+0 0 ? 149778187
+65897282 ? 0 0
+0 zeroDotZero
+.PP
+.SH "BUGS"
+The test for
+.I TABLE\-OID
+actually specifying a table is rather heuristic. Note also that the
+test requires the defining MIB file to be loaded.
+.PP
+.SH "SEE ALSO"
+snmpcmd(1), variables(5).
diff --git a/man/snmptest.1.def b/man/snmptest.1.def
new file mode 100644
index 0000000..7874196
--- /dev/null
+++ b/man/snmptest.1.def
@@ -0,0 +1,278 @@
+.\" Portions of this file are subject to the following copyright. 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 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.
+.\" ******************************************************************/
+.TH SNMPTEST 1 "25 Jul 2003" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmptest - communicates with a network entity using SNMP requests
+.SH SYNOPSIS
+.B snmptest
+[COMMON OPTIONS] AGENT
+.SH DESCRIPTION
+.B snmptest
+is a flexible SNMP application that can monitor and manage information
+on a network entity.
+.PP
+After invoking the program, a command line interpreter proceeds to
+accept commands. This intepreter enables the user to send different
+types of SNMP requests to target agents.
+.PP
+AGENT identifies a target SNMP agent, which is instrumented
+to monitor the given objects. At its simplest, the AGENT
+specification will consist of a hostname or an IPv4
+address. In this situation, the command will attempt
+communication with the agent, using UDP/IPv4 to port 161
+of the given target host. See snmpcmd(1) for a full list of
+the possible formats for AGENT.
+.PP
+Once snmptest is invoked, the command line intepreter will prompt with:
+.PP
+.B Variable:
+.PP
+At this point you can enter one or more variable names, one per line.
+A blank line ends the parameter input and will send the request
+(variables entered) in a single packet, to the remote entity.
+Each variable name is given
+in the format specified in
+.IR variables(5) .
+For example:
+.PP
+snmptest \-c public \-v 1 zeus
+.br
+.BR Variable: " system.sysDescr.0"
+.br
+.BR Variable:
+.PP
+will return some information about the request and reply packets, as
+well as the information:
+.PP
+requestid 0x5992478A errstat 0x0 errindex 0x0
+.br
+system.sysDescr.0 = STRING: "Unix 4.3BSD"
+.PP
+The errstatus value shows the error status code for the call.
+The possible values for errstat are in the header file snmp.h.
+The errindex value identifies the variable that has the given error.
+Index values are assigned to all the variables entered at the "Variable":
+prompt. The first value is assigned an index of 1.
+.PP
+Upon startup, the program defaults to sending a GET request packet.
+The type of request can be changed by typing one of the following
+commands at the "Variable:" prompt:
+.PP
+.nf
+$G - send a GET request
+$N - send a GETNEXT request
+$S - send a SET request
+$B - send a GETBULK request
+ Note: GETBULK is not available in SNMPv1
+$I - send an Inform request
+$T - send an SNMPv2 Trap request
+.fi
+.PP
+Other values that can be entered at the "Variable:" prompt are:
+.PP
+.nf
+$D - toggle the dumping of each sent and received packet
+$QP - toggle a quicker, less verbose output form
+$Q - Quit the program
+.fi
+.PP
+Request Types:
+.PP
+GET Request:
+.PP
+When in "GET request" mode ($G or default), the user can enter
+an OID at the "Variable:" prompt. The user can enter multiple
+OIDs, one per prompt. The user enters a blank line to send
+the GET request.
+.PP
+GETNEXT Request:
+.PP
+The "GETNEXT request" mode ($N) is simlar to the "Get request"
+mode, described above.
+.PP
+SET Request:
+.PP
+When in the "SET request" mode ($S), more information is requested by the
+prompt for each variable. The prompt:
+.PP
+.nf
+Type [i|s|x|d|n|o|t|a]:
+.fi
+requests the type of the variable be entered. Depending on the type
+of value you want to set, you can type one of the following:
+.PP
+.nf
+i - integer
+u - unsigned integer
+s - octet string in ASCII
+x - octet string in hex bytes, separated by whitespace
+d - octet string as decimal bytes, separated by whitespace
+a - ip address in dotted IP notation
+o - object identifier
+n - null
+t - timeticks
+.fi
+At this point a value will be prompted for:
+.PP
+Value:
+.PP
+If this is an integer value, just type the integer (in decimal). If
+it is a decimal string, type in white-space separated decimal numbers,
+one per byte of the string. Again type a blank line at the prompt for
+the variable name to send the packet.
+.PP
+GETBULK Request:
+.PP
+The "GETBULK request" mode ($B) is similar to the "Set request" mode.
+GETBULK, however, is not available in SNMPv1.
+.PP
+Inform Request:
+.PP
+The "Inform request" mode ($I) is similar to the "Set request" mode.
+This type of request, however, is not available in SNMPv1. Also,
+the _agent_ specified on the snmptest command should correspond
+to the target snmptrapd agent.
+.PP
+SNMPv2 Trap Request:
+.PP
+The "SNMPv2 Trap Request" mode ($T) is similar to the "Set request" mode.
+This type of request, however, is not available in SNMPv1. Also,
+the _agent_ specified on the snmptest command should correspond
+to the target snmptrapd agent.
+.SH OPTIONS
+.B snmptest
+takes the common options described in the
+.I snmpcmd(1)
+manual page.
+.SH EXAMPLES
+.PP
+The following is an example of sending a GET request for two OIDs:
+.PP
+% snmptest \-v 2c \-c public testhost:9999
+.PP
+.nf
+Variable: system.sysDescr.0
+Variable: system.sysContact.0
+Variable:
+Received Get Response from 128.2.56.220
+requestid 0x7D9FCD63 errstat 0x0 errindex 0x0
+SNMPv2\-MIB::sysDescr.0 = STRING: SunOS testhost 5.9 Generic_112233\-02 sun4u
+SNMPv2\-MIB::sysContact.0 = STRING: x1111
+.fi
+.PP
+The following is an example of sending a GETNEXT request:
+.PP
+.nf
+Variable: SNMPv2\-MIB::sysORUpTime
+Variable:
+Received Get Response from 128.2.56.220
+requestid 0x7D9FCD64 errstat 0x0 errindex 0x0
+SNMPv2\-MIB::sysORUpTime.1 = Timeticks: (6) 0:00:00.06
+Variable:
+.fi
+.PP
+The following is an example of sending a SET request:
+.PP
+.nf
+Variable: $S
+Request type is Set Request
+Variable: system.sysLocation.0
+Type [i|u|s|x|d|n|o|t|a]: s
+Value: building 17
+Variable:
+Received Get Response from 128.2.56.220
+requestid 0x7D9FCD65 errstat 0x0 errindex 0x0
+SNMPv2\-MIB::sysLocation.0 = STRING: building A
+Variable:
+.fi
+.PP
+The following is an example of sending a GETBULK request:
+.PP
+.nf
+Variable: $B
+Request type is Bulk Request
+Enter a blank line to terminate the list of non-repeaters
+and to begin the repeating variables
+Variable:
+Now input the repeating variables
+Variable: system.sysContact.0
+Variable: system.sysLocation.0
+Variable:
+What repeat count? 2
+Received Get Response from 128.2.56.220
+requestid 0x2EA7942A errstat 0x0 errindex 0x0
+SNMPv2\-MIB::sysName.0 = STRING: testhost
+SNMPv2\-MIB::sysORLastChange.0 = Timeticks: (58) 0:00:00.58
+SNMPv2\-MIB::sysLocation.0 = STRING: bldg A
+SNMPv2\-MIB::sysORID.1 = OID: IF\-MIB::ifMIB
+Variable:
+.fi
+.PP
+The following is an example of sending an Inform request:
+.PP
+.nf
+snmptest \-v 2c \-c public snmptrapd_host
+Variable: $I
+Request type is Inform Request
+(Are you sending to the right port?)
+Variable: system.sysContact.0
+Type [i|u|sIx|d|n|o|t|a]: s
+Value: x12345
+Variable:
+Inform Acknowledged
+Variable:
+.fi
+.PP
+The snmptrapd_host will show:
+.PP
+snmptrapd_host [<ip address>]: Trap SNMPv2\-MIB::sysContact.0 = STRING:
+x12345
+.PP
+The following is an example of sending an SNMPv2 Trap request:
+.PP
+.nf
+snmptest \-v 2c \-c public snmptrapd_host
+Variable: $T
+Request type is SNMPv2 Trap Request
+(Are you sending to the right port?)
+Variable: system.sysLocation.0
+Type [i|u|s|x|d|n|o|t|a]: s
+Value: building a
+Variable:
+.fi
+.PP
+The snmptrapd_host will show:
+.PP
+.nf
+snmptrapd_host [<ip address>]: Trap SNMPv2\-MIB::sys.0 = STRING:
+building a
+.fi
+.SH "SEE ALSO"
+snmpcmd(1), snmpget(1), snmpset(1), variables(5)
diff --git a/man/snmptranslate.1.def b/man/snmptranslate.1.def
new file mode 100644
index 0000000..288218b
--- /dev/null
+++ b/man/snmptranslate.1.def
@@ -0,0 +1,288 @@
+.\" Portions of this file are subject to the following copyright. 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 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.
+.\" ******************************************************************/
+.TH SNMPTRANSLATE 1 "20 Jul 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmptranslate - translate MIB OID names between numeric and textual forms
+.SH SYNOPSIS
+.B snmptranslate
+[OPTIONS] OID [OID]...
+.SH DESCRIPTION
+.B snmptranslate
+is an application that translates one or more SNMP object identifier
+values from their symbolic (textual) forms into their numerical forms
+(or vice versa).
+.PP
+OID is either a numeric or textual object identifier.
+.SH OPTIONS
+.TP 8
+.B \-D\fI[TOKEN[,...]]
+Turn on debugging output for the given
+.IR "TOKEN" "(s)."
+Try
+.IR ALL
+for extremely verbose output.
+.TP
+.B \-h
+Display a brief usage message and then exit.
+.TP
+.BI \-m " MIBLIST"
+Specifies a colon separated list of MIB modules to load for this
+application. This overrides the environment variable MIBS.
+.IP
+The special keyword
+.I ALL
+is used to specify all modules in all directories when searching for MIB
+files. Every file whose name does not begin with "." will be parsed as
+if it were a MIB file.
+.TP
+.BI \-M " DIRLIST"
+Specifies a colon separated list of directories to search for MIBs.
+This overrides the environment variable MIBDIRS.
+.TP
+.BI \-T " TRANSOPTS"
+Provides control over the translation of the OID values. The
+following
+.I TRANSOPTS
+are available:
+.RS
+.TP 6
+.B \-Td
+Print full details of the specified OID.
+.TP
+.B \-Tp
+Print a graphical tree, rooted at the specified OID.
+.TP
+.B \-Ta
+Dump the loaded MIB in a trivial form.
+.TP
+.B \-Tl
+Dump a labeled form of all objects.
+.TP
+.B \-To
+Dump a numeric form of all objects.
+.TP
+.B \-Ts
+Dump a symbolic form of all objects.
+.TP
+.B \-Tt
+Dump a tree form of the loaded MIBs (mostly useful for debugging).
+.TP
+.B \-Tz
+Dump a numeric and labeled form of all objects (compatible with MIB2SCHEMA format).
+.RE
+.TP
+.B \-V
+Display version information for the application and then exit.
+.TP
+.BI \-w " WIDTH"
+Specifies the width of
+.B \-Tp
+and
+.B \-Td
+output. The default is very large.
+.PP
+In addition to the above options,
+.B snmptranslate
+takes the OID input
+.RB ( \-I ),
+MIB parsing
+.RB ( \-M )
+and OID output
+.RB ( \-O )
+options described in the
+.BR "INPUT OPTIONS" ", " "MIB PARSING OPTIONS" " and " "OUTPUT OPTIONS"
+sections of the
+.I snmpcmd(1)
+manual page.
+.SH EXAMPLES
+.IP \(bu 4
+snmptranslate \-On \-IR sysDescr
+.br
+will translate "sysDescr" to a more qualified form:
+.IP
+system.sysDescr
+.IP \(bu 4
+snmptranslate \-Onf \-IR sysDescr
+.br
+will translate "sysDecr" to:
+.IP
+.RI .iso.org.dod.internet.mgmt.mib\-2.system.sysDescr
+.IP \(bu 4
+snmptranslate \-Td \-OS system.sysDescr
+.br
+will translate "sysDecr" into:
+.IP
+.nf
+SNMPv2\-MIB::sysDescr
+sysDescr OBJECT\-TYPE
+ \-\- FROM SNMPv2\-MIB
+ \-\- TEXTUAL CONVENTION DisplayString
+ SYNTAX OCTET STRING (0..255)
+ DISPLAY\-HINT "255a"
+ MAX\-ACCESS read\-only
+ STATUS current
+ DESCRIPTION "A textual description of the entity. This
+ value should include the full name and
+ version identification of the system's
+ hardware type, software operating\-system,
+ and networking software."
+::= { iso(1) org(3) dod(6) internet(1) mgmt(2) mib\-2(1) system(1) 1 }
+.fi
+.IP \(bu 4
+snmptranslate \-Tp \-OS system
+.br
+will print the following tree:
+.IP
+.nf
++--system(1)
+ |
+ +-- -R-- String sysDescr(1)
+ | Textual Convention: DisplayString
+ | Size: 0..255
+ +-- -R-- ObjID sysObjectID(2)
+ +-- -R-- TimeTicks sysUpTime(3)
+ +-- -RW- String sysContact(4)
+ | Textual Convention: DisplayString
+ | Size: 0..255
+ +-- -RW- String sysName(5)
+ | Textual Convention: DisplayString
+ | Size: 0..255
+ +-- -RW- String sysLocation(6)
+ | Textual Convention: DisplayString
+ | Size: 0..255
+ +-- -R-- Integer sysServices(7)
+ +-- -R-- TimeTicks sysORLastChange(8)
+ | Textual Convention: TimeStamp
+ |
+ +--sysORTable(9)
+ |
+ +--sysOREntry(1)
+ |
+ +-- ---- Integer sysORIndex(1)
+ +-- -R-- ObjID sysORID(2)
+ +-- -R-- String sysORDescr(3)
+ | Textual Convention: DisplayString
+ | Size: 0..255
+ +-- -R-- TimeTicks sysORUpTime(4)
+ Textual Convention: TimeStamp
+
+.fi
+.PP
+.IP \(bu 4
+snmptranslate \-Ta | head
+.br
+will produce the following dump:
+.IP
+.nf
+dump DEFINITIONS ::= BEGIN
+org ::= { iso 3 }
+dod ::= { org 6 }
+internet ::= { dod 1 }
+directory ::= { internet 1 }
+mgmt ::= { internet 2 }
+experimental ::= { internet 3 }
+private ::= { internet 4 }
+security ::= { internet 5 }
+snmpV2 ::= { internet 6 }
+.fi
+.PP
+.IP \(bu 4
+snmptranslate \-Tl | head
+.br
+will produce the following dump:
+.IP
+.nf
+.RI .iso(1).org(3)
+.RI .iso(1).org(3).dod(6)
+.RI .iso(1).org(3).dod(6).internet(1)
+.RI .iso(1).org(3).dod(6).internet(1).directory(1)
+.RI .iso(1).org(3).dod(6).internet(1).mgmt(2)
+.RI .iso(1).org(3).dod(6).internet(1).mgmt(2).mib\-2(1)
+.RI .iso(1).org(3).dod(6).internet(1).mgmt(2).mib\-2(1).system(1)
+.RI .iso(1).org(3).dod(6).internet(1).mgmt(2).mib\-2(1).system(1).sysDescr(1)
+.RI .iso(1).org(3).dod(6).internet(1).mgmt(2).mib\-2(1).system(1).sysObjectID(2)
+.RI .iso(1).org(3).dod(6).internet(1).mgmt(2).mib\-2(1).system(1).sysUpTime(3)
+.fi
+.PP
+.IP \(bu 4
+snmptranslate \-To | head
+.br
+will produce the following dump
+.IP
+.nf
+.RI .1.3
+.RI .1.3.6
+.RI .1.3.6.1
+.RI .1.3.6.1.1
+.RI .1.3.6.1.2
+.RI .1.3.6.1.2.1
+.RI .1.3.6.1.2.1.1
+.RI .1.3.6.1.2.1.1.1
+.RI .1.3.6.1.2.1.1.2
+.RI .1.3.6.1.2.1.1.3
+.fi
+.PP
+.IP \(bu 4
+snmptranslate \-Ts | head
+.br
+will produce the following dump
+.IP
+.nf
+.RI .iso.org
+.RI .iso.org.dod
+.RI .iso.org.dod.internet
+.RI .iso.org.dod.internet.directory
+.RI .iso.org.dod.internet.mgmt
+.RI .iso.org.dod.internet.mgmt.mib\-2
+.RI .iso.org.dod.internet.mgmt.mib\-2.system
+.RI .iso.org.dod.internet.mgmt.mib\-2.system.sysDescr
+.RI .iso.org.dod.internet.mgmt.mib\-2.system.sysObjectID
+.RI .iso.org.dod.internet.mgmt.mib\-2.system.sysUpTime
+.fi
+.PP
+.IP \(bu 4
+snmptranslate \-Tt | head
+.br
+will produce the following dump
+.IP
+.nf
+ org(3) type=0
+ dod(6) type=0
+ internet(1) type=0
+ directory(1) type=0
+ mgmt(2) type=0
+ mib\-2(1) type=0
+ system(1) type=0
+ sysDescr(1) type=2 tc=4 hint=255a
+ sysObjectID(2) type=1
+ sysUpTime(3) type=8
+.fi
+.SH "SEE ALSO"
+snmpcmd(1), variables(5), RFC 2578-2580.
diff --git a/man/snmptrap.1.def b/man/snmptrap.1.def
new file mode 100644
index 0000000..55c19d1
--- /dev/null
+++ b/man/snmptrap.1.def
@@ -0,0 +1,130 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP 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.
+.\" ******************************************************************/
+.TH SNMPTRAP 1 "19 Jun 2003" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmptrap, snmpinform - sends an SNMP notification to a manager
+.SH SYNOPSIS
+.B snmptrap \-v 1
+[COMMON OPTIONS] AGENT enterprise-oid agent generic-trap specific-trap uptime [OID TYPE VALUE]...
+.PP
+.B snmptrap \-v [2c|3]
+[COMMON OPTIONS] [\-Ci] AGENT uptime trap-oid [OID TYPE VALUE]...
+.PP
+.B snmpinform \-v [2c|3]
+[COMMON OPTIONS] AGENT uptime trap-oid [OID TYPE VALUE]...
+.SH DESCRIPTION
+.B snmptrap
+is an SNMP application that uses the SNMP TRAP operation to send
+information to a network manager. One or more object identifiers
+(OIDs) can be given as arguments on the command line. A type and a
+value must accompany each object identifier. Each variable name is
+given in the format specified in
+.IR variables(5) .
+.PP
+When invoked as
+.B snmpinform,
+or when
+.B \-Ci
+is added to the command line flags of snmptrap, it sends an
+INFORM-PDU, expecting a response from the trap receiver,
+retransmitting if required. Otherwise it sends an TRAP-PDU or
+TRAP2-PDU.
+.PP
+If any of the required version 1 parameters,
+.IR enterprise-oid ,
+.IR agent ,
+and
+.I uptime
+are specified as empty, it defaults to
+.IR "1.3.6.1.4.1.3.1.1 (enterprises.cmu.1.1)" ,
+.IR hostname ,
+and
+.I host-uptime
+respectively.
+.PP
+The
+.I TYPE
+is a single character, one of:
+.RS
+.PD 0
+.TP 3
+.B i
+INTEGER
+.TP 3
+.B u
+UNSIGNED
+.TP 3
+.B c
+COUNTER32
+.TP 3
+.B s
+STRING
+.TP 3
+.B x
+HEX STRING
+.TP 3
+.B d
+DECIMAL STRING
+.TP 3
+.B n
+NULLOBJ
+.TP 3
+.B o
+OBJID
+.TP 3
+.B t
+TIMETICKS
+.TP 3
+.B a
+IPADDRESS
+.TP 3
+.B b
+BITS
+.PD
+.RE
+which are handled in the same way as the
+.B snmpset
+command.
+.PP
+For example:
+.PP
+snmptrap \-v 1 \-c public manager enterprises.spider test\-hub 3 0 '' interfaces.iftable.ifentry.ifindex.1 i 1
+.PP
+will send a generic linkUp trap to manager, for interface 1.
+.SH OPTIONS
+.B snmptrap
+takes the common options described in the
+.I snmpcmd(1)
+manual page in
+addition to the
+.B \-Ci
+option described above.
+Note that
+.B snmptrap
+REQUIRES an argument specifying the agent to query
+as described there.
+.SH SEE ALSO
+snmpcmd(1), snmpset(1), variables(5).
diff --git a/man/snmptrapd.8.def b/man/snmptrapd.8.def
new file mode 100644
index 0000000..12421a8
--- /dev/null
+++ b/man/snmptrapd.8.def
@@ -0,0 +1,320 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP COPYING file for more details and other copyrights
+.\" that may apply:
+.\" /***********************************************************
+.\" Copyright 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.
+.\" ******************************************************************/
+.TH SNMPTRAPD 8 "30 Mar 2011" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmptrapd - Receive and log SNMP trap messages.
+.SH SYNOPSIS
+.BR snmptrapd " [OPTIONS] [LISTENING ADDRESSES]"
+.SH DESCRIPTION
+.B snmptrapd
+is an SNMP application that receives and logs SNMP TRAP and INFORM
+messages.
+.PP
+Note: the default is to listen on UDP port 162 on all IPv4 interfaces.
+Since 162 is a privileged port,
+.B snmptrapd
+must typically be run as root.
+.SH OPTIONS
+.TP 8
+.B \-a
+Ignore authenticationFailure traps.
+.TP
+.B \-A
+Append to the log file rather than truncating it.
+
+Note that this needs to come \fIbefore\fP any \-Lf options
+that it should apply to.
+.TP
+.BI "\-c" " FILE"
+Read
+.I FILE
+as a configuration file
+(or a comma-separated list of configuration files).
+.TP
+.B \-C
+Do not read any configuration files except the one optionally specified by the
+.B \-c
+option.
+.TP
+.B \-d
+Dump (in hexadecimal) the sent and received SNMP packets.
+.TP
+.BI \-D[TOKEN[,...]]
+Turn on debugging output for the given
+.IR "TOKEN" "(s)."
+Try
+.IR ALL
+for extremely verbose output.
+.TP
+.B \-f
+Do not fork() from the calling shell.
+.TP
+.BI \-F " FORMAT"
+When logging to standard output, use the format in the string
+.IR FORMAT .
+See the section
+.B FORMAT SPECIFICATIONS
+below for more details.
+.TP
+.B \-h, \-\-help
+Display a brief usage message and then exit.
+.TP
+.B \-H
+Display a list of configuration file directives understood by the
+trap daemon and then exit.
+.TP
+.B \-I \fI[\-]INITLIST
+Specifies which modules should (or should not) be initialized
+when snmptrapd starts up. If the comma-separated
+.I INITLIST
+is preceded
+with a '\-', it is the list of modules that should \fInot\fR be started.
+Otherwise this is the list of the \fIonly\fR modules that should be started.
+
+To get a list of compiled modules, run snmptrapd with the arguments
+.I "\-Dmib_init \-H"
+(assuming debugging support has been compiled in).
+.TP
+.B \-L[efos]
+Specify where logging output should be directed (standard error or output,
+to a file or via syslog). See LOGGING OPTIONS in \fIsnmpcmd(1)\fR for details.
+.TP
+.BR \-m " \fIMIBLIST"
+Specifies a colon separated list of MIB modules to load for this
+application. This overrides the environment variable MIBS.
+See \fIsnmpcmd(1)\fR for details.
+.TP
+.BR \-M " \fIDIRLIST"
+Specifies a colon separated list of directories to search for MIBs.
+This overrides the environment variable MIBDIRS.
+See \fIsnmpcmd(1)\fR for details.
+.TP
+.BR \-n
+Do not attempt to translate source addresses of incoming packets into
+hostnames.
+.TP
+.BI \-p " FILE"
+Save the process ID of the trap daemon in
+.IR FILE "."
+.TP
+.BI \-O " [abeEfnqQsStTuUvxX]"
+Specifies how MIB objects and other output should be displayed.
+See the section
+.B OUTPUT OPTIONS
+in the
+.I snmpcmd(1)
+manual page for details.
+.TP
+.BI \-t
+Do not log traps to syslog. This disables logging to syslog. This is
+useful if you want the snmptrapd application to
+.B only
+run traphandle hooks and not to log any traps to any location.
+.TP
+.B \-v, \-\-version
+Print version information for the trap daemon and then exit.
+.TP
+.B \-x \fIADDRESS
+Connect to the AgentX master agent on the specified address,
+rather than the default AGENTX_SOCKET.
+See \fIsnmpd(8)\fR for details of the format of such addresses.
+.TP
+.BI \-\- "name"="value"
+Allows one to specify any token ("name") supported in the
+.I snmptrapd.conf
+file and sets its value to "value". Overrides the corresponding token in the
+.I snmptrapd.conf
+file. See
+.I snmptrapd.conf(5)
+for the full list of tokens.
+.SH FORMAT SPECIFICATIONS
+.PP
+.B snmptrapd
+interprets format strings similarly to
+.IR printf(3) .
+It understands the following formatting sequences:
+.RS 4
+.TP 4
+.B %%
+a literal %
+.TP
+.B %a
+the contents of the agent\-addr field of the PDU (v1 TRAPs only)
+.TP
+.B %A
+the hostname corresponding to the contents of the agent\-addr field of
+the PDU, if available, otherwise the contents of the agent\-addr field
+of the PDU (v1 TRAPs only).
+.TP
+.B %b
+PDU source address (Note: this is not necessarily an IPv4
+address)
+.TP
+.B %B
+PDU source hostname if available, otherwise PDU source address (see
+note above)
+.TP
+.B %h
+current hour on the local system
+.TP
+.B %H
+the hour field from the \fCsysUpTime.0\fR varbind
+.TP
+.B %j
+current minute on the local system
+.TP
+.B %J
+the minute field from the \fCsysUpTime.0\fR varbind
+.TP
+.B %k
+current second on the local system
+.TP
+.B %K
+the seconds field from the \fCsysUpTime.0\fR varbind
+.TP
+.B %l
+current day of month on the local system
+.TP
+.B %L
+the day of month field from the \fCsysUpTime.0\fR varbind
+.TP
+.B %m
+current (numeric) month on the local system
+.TP
+.B %M
+the numeric month field from the \fCsysUpTime.0\fR varbind
+.TP
+.B %N
+enterprise string
+.TP
+.B %q
+trap sub-type (numeric, in decimal)
+.TP
+.B %P
+security information from the PDU (community name for v1/v2c,
+user and context for v3)
+.TP
+.B %t
+decimal number of seconds since the operating system epoch (as
+returned by
+.IR time(2) )
+.TP
+.B %T
+the value of the \fCsysUpTime.0\fR varbind in seconds
+.TP
+.B %v
+list of variable-bindings from the notification payload.
+These will be separated by a tab,
+or by a comma and a blank if the alternate form is requested
+See also %V
+.TP
+.B %V
+specifies the variable-bindings separator. This takes a sequence of
+characters, up to the next % (to embed a % in the string, use \\%)
+.TP
+.B %w
+trap type (numeric, in decimal)
+.TP
+.B %W
+trap description
+.TP
+.B %y
+current year on the local system
+.TP
+.B %Y
+the year field from the \fCsysUpTime.0\fR varbind
+.RE
+.PP
+In addition to these values, an optional field
+width and precision may also be specified , just as in
+.IR printf(3) ,
+and a flag value. The following flags are supported:
+.RS 4
+.TP 4
+.B \-
+left justify
+.TP
+.B 0
+use leading zeros
+.TP
+.B #
+use alternate form
+.RE
+.PP
+The "use alternate form" flag changes the behavior of various format
+string sequences:
+.IP
+Time information will be displayed based on GMT (rather than the local timezone)
+.IP
+The variable-bindings will be a comma-separated list (rather than a tab-separated one)
+.IP
+The system uptime will be broken down into a human-meaningful format (rather than being a simple integer)
+.SS Examples:
+.PP
+To get a message like "14:03 TRAP3.1 from humpty.ucd.edu" you
+could use something like this:
+.PP
+.RS
+.nf
+snmptrapd \-P \-F "%02.2h:%02.2j TRAP%w.%q from %A\en"
+.fi
+.RE
+.PP
+If you want the same thing but in GMT rather than local time, use
+.PP
+.RS
+.nf
+snmptrapd \-P \-F "%#02.2h:%#02.2j TRAP%w.%q from %A\en"
+.fi
+.RE
+.SH LISTENING ADDRESSES
+By default,
+.B snmptrapd
+listens for incoming SNMP TRAP and INFORM packets on UDP port 162 on
+all IPv4 interfaces. However, it is possible to modify this behaviour
+by specifying one or more listening addresses as arguments to
+.BR snmptrapd .
+See the
+.I snmpd(8)
+manual page for more information about the format of listening
+addresses.
+.SH NOTIFICATION\-LOG\-MIB SUPPORT
+As of net-snmp 5.0, the snmptrapd application supports the
+NOTIFICATION\-LOG\-MIB. It does this by opening an AgentX subagent
+connection to the master snmpd agent and registering the notification
+log tables. As long as the snmpd application is started first, it
+will attach itself to it and thus you should be able to view the last
+recorded notifications via the nlmLogTable and nlmLogVariableTable.
+See the snmptrapd.conf file and the "doNotRetainNotificationLogs" token
+for turning
+off this support. See the NOTIFICATION\-LOG\-MIB for more details about
+the MIB itself.
+.SH EXTENSIBILITY AND CONFIGURATION
+See the
+.I snmptrapd.conf(5)
+manual page.
+.SH "SEE ALSO"
+snmpcmd(1), snmpd(8), printf(3), snmptrapd.conf(5), syslog(8), variables(5)
diff --git a/man/snmptrapd.conf.5.def b/man/snmptrapd.conf.5.def
new file mode 100644
index 0000000..9242b28
--- /dev/null
+++ b/man/snmptrapd.conf.5.def
@@ -0,0 +1,266 @@
+.TH SNMPTRAPD.CONF 5 "19 Feb 2009" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmptrapd.conf - configuration file for the Net-SNMP notification receiver
+.SH DESCRIPTION
+The Net-SNMP notification receiver (trap daemon) uses one or more
+configuration files to control its operation and how incoming traps
+(and INFORM requests) should be processed.
+This file (\fBsnmptrapd.conf\fR) can be located in
+one of several locations, as described in the
+.I snmp_config(5)
+manual page.
+.SH IMPORTANT
+Previously,
+.B snmptrapd
+would accept all incoming notifications, and log them automatically
+(even if no explicit configuration was provided).
+Starting with release 5.3, access control checks will be applied to
+incoming notifications. If
+.B snmptrapd
+is run without a suitable configuration file (or equivalent access
+control settings), then such traps \fBWILL NOT\fR
+be processed.
+See the section \fBACCESS CONTROL\fR for more details.
+.PP
+As with the agent configuration, the
+.I snmptrapd.conf
+directives can be divided into four distinct groups.
+.SH TRAPD BEHAVIOUR
+.IP "snmpTrapdAddr [<transport-specifier>:]<transport-address>[,...]"
+defines a list of listening addresses, on which to receive
+incoming SNMP notifications.
+See the section
+.B LISTENING ADDRESSES
+in the
+.I snmpd(8)
+manual page for more information about the format of listening
+addresses.
+.IP
+The default behaviour is to
+listen on UDP port 162 on all IPv4 interfaces.
+.IP "doNotRetainNotificationLogs yes"
+disables support for the NOTIFICATION\-LOG\-MIB.
+Normally the snmptrapd program keeps a record of the traps
+received, which can be retrieved by querying
+the \fCnlmLogTable\fR and \fCnlmLogvariableTable\fR tables.
+This directive can be used to suppress this behaviour.
+.IP
+See the
+.I snmptrapd(8)
+manual page and the NOTIFICATION\-LOG\-MIB for details.
+.IP "doNotLogTraps yes"
+disables the logging of notifications altogether.
+This is useful if the \fBsnmptrapd\fR application should
+only run traphandle hooks and should not log traps to any location.
+.IP "doNotFork yes"
+do not fork from the calling shell.
+.IP "pidFile PATH"
+defines a file in which to store the process ID of the
+notification receiver. By default, this ID is not saved.
+.SH ACCESS CONTROL
+Starting with release 5.3, it is necessary to explicitly specify
+who is authorised to send traps and informs to the notification
+receiver (and what types of processing these are allowed to trigger).
+This uses an extension of the VACM model, used in the main SNMP agent.
+.PP
+There are currently three types of processing that can be specified:
+.RS
+.IP "log"
+log the details of the notification - either in a specified file,
+to standard output (or stderr), or via \fIsyslog\fR (or similar).
+.IP "execute"
+pass the details of the trap to a specified handler program, including
+embedded perl.
+.IP "net"
+forward the trap to another notification receiver.
+.RE
+.PP
+In the following directives, \fITYPES\fR will be a (comma-separated)
+list of one or more of these tokens. Most commonly, this will
+typically be \fIlog,execute,net\fR to cover any style of processing
+for a particular category of notification. But it is perfectly
+possible (even desirable) to limit certain notification sources to
+selected processing only.
+.IP "authCommunity TYPES COMMUNITY [SOURCE [OID | \-v VIEW ]]"
+authorises traps (and SNMPv2c INFORM requests) with the specified
+community to trigger the types of processing listed.
+By default, this will allow any notification using this community
+to be processed. The SOURCE field can be used to specify that the
+configuration should only apply to notifications received from
+particular sources - see \fIsnmpd.conf(5)\fR for more details.
+.IP "authUser TYPES [\-s MODEL] USER [LEVEL [OID | \-v VIEW ]]"
+authorises SNMPv3 notifications with the specified
+user to trigger the types of processing listed.
+By default, this will accept authenticated requests.
+(\fIauthNoPriv\fR or \fIauthPriv\fR). The LEVEL field can
+be used to allow unauthenticated notifications (\fInoauth\fR),
+or to require encryption (\fIpriv\fR), just as for the SNMP agent.
+.IP
+With both of these directives, the OID (or \fI\-v VIEW\fR) field
+can be used to retrict this configuration to the processing of
+particular notifications.
+.RS
+.IP "Note:"
+Unlike the VACM processing described in RFC 3415, this view is
+\fBonly\fR matched against the \fCsnmpTrapOID\fR value of the
+incoming notification. It is not applied to the payload varbinds
+held within that notification.
+.RE
+.IP "authGroup TYPES [\-s MODEL] GROUP [LEVEL [OID | \-v VIEW ]]"
+.IP "authAccess TYPES [\-s MODEL] GROUP VIEW [LEVEL [CONTEXT]]"
+.IP "setAccess GROUP CONTEXT MODEL LEVEL PREFIX VIEW TYPES"
+authorise notifications in the specified GROUP
+(configured using the \fIgroup\fR directive)
+to trigger the types of processing listed.
+See \fIsnmpd.conf(5)\fR for more details.
+.IP "createUser [-e ENGINEID] username (MD5|SHA) authpassphrase [DES|AES]"
+See the
+.I snmpd.conf(5)
+manual page for a description of how to create SNMPv3 users. This
+is roughly the same, but the file name changes to snmptrapd.conf from
+snmpd.conf.
+.IP "disableAuthorization yes"
+will disable the above access control checks, and revert to the
+previous behaviour of accepting all incoming notifications.
+.IP
+.\" XXX - Explain why this is a Bad Idea
+.\"
+.SH LOGGING
+.IP "format1 FORMAT"
+.IP "format2 FORMAT"
+specify the format used to display SNMPv1 TRAPs and SNMPv2
+notifications respectively. Note that SNMPv2c and SNMPv3
+both use the same SNMPv2 PDU format.
+.IP
+See
+.IR snmptrapd(8)
+for the layout characters available.
+.IP "ignoreAuthFailure yes"
+instructs the receiver to ignore \fIauthenticationFailure\fR traps.
+.RS
+.IP Note:
+This currently only affects the logging of such notifications.
+\fIauthenticationFailure\fR traps will still be passed to trap
+handler scripts, and forwarded to other notification receivers.
+This behaviour should not be relied on, as it is likely
+to change in future versions.
+.RE
+.IP "logOption string"
+specifies where notifications should be logged - to standard
+output, standard error, a specified file or via \fIsyslog\fR.
+See the section LOGGING OPTIONS in the
+\fIsnmpcmd(1)\fR manual page for details.
+.IP "outputOption string"
+specifies various characteristics of how OIDs and other values
+should be displayed.
+See the section OUTPUT OPTIONS in the
+\fIsnmpcmd(1)\fR manual page for details.
+.SH MySQL Logging
+There are two configuration variables that work together to control
+when queued traps are logged to the MySQL database. A non-zero
+value must be specified for sqlSaveInterval to enable MySQL logging.
+.RE
+.IP "sqlMaxQueue max"
+specifies the maximum number of traps to queue before a forced flush
+to the MySQL database.
+.RE
+.IP "sqlSaveInterval seconds"
+specified the number of seconds between periodic queue flushes.
+A value of 0 for will disable MySQL logging.
+.SH NOTIFICATION PROCESSING
+As well as logging incoming notifications, they can also
+be forwarded on to another notification receiver, or passed
+to an external program for specialised processing.
+.IP "traphandle OID|default PROGRAM [ARGS ...]"
+invokes the specified program (with the given arguments) whenever a
+notification is received that matches the OID token. For SNMPv2c and
+SNMPv3 notifications, this token will be compared against the
+\fCsnmpTrapOID\fR value taken from the notification. For SNMPv1 traps,
+the generic and specific trap values and the enterprise OID will be
+converted into the equivalent OID (following RFC 2576).
+.IP
+Typically, the OID token will be the name (or numeric OID) of a
+NOTIFICATION-TYPE object, and the specified program will be invoked for
+notifications that match this OID exactly. However this token also
+supports a simple form of wildcard suffixing. By appending the character
+\'*' to the OID token, the corresponding program will be invoked for any
+notification based within subtree rooted at the specified OID.
+For example, an OID token of \fC.1.3.6.1.4.1*\fP would match any enterprise
+specific notification (including the specified OID itself).
+An OID token of \fC.1.3.6.1.4.1.*\fP would would work in much the same way,
+but would not match this exact OID - just notifications that lay strictly
+below this root.
+Note that this syntax does not support full regular expressions or
+wildcards - an OID token of the form \fCoid.*.subids\fR is \fBnot\fC valid.
+.IP
+If the OID field is the token \fIdefault\fR then the program will be
+invoked for any notification not matching another (OID specific)
+\fItraphandle\fR entry.
+.PP
+Details of the notification are fed to the program via its standard input.
+Note that this will always use the SNMPv2-style notification format, with
+SNMPv1 traps being converted as per RFC 2576, before being passed to the
+program.
+The input format is as follows, one entry per line:
+.RS
+.IP HOSTNAME
+The name of the host that sent the notification, as determined by
+.IR gethostbyaddr(3) .
+.br
+.IP IPADDRESS
+The IP address of the host that sent the notification.
+.\"
+.\" XXX - What about non-IPv4 transports?
+.\"
+.IP VARBINDS
+A list of variable bindings describing the contents of the notification,
+one per line. The first token on each line (up until a space) is the
+OID of the varind, and the remainder of the line is its value.
+The format of both of these are controlled by the \fIoutputOption\fR
+directive (or similar configuration).
+.IP
+The first OID should always be \fCSNMPv2\-MIB::sysUpTime.0\fR,
+and the second should be \fCSNMPv2\-MIB::snmpTrapOID.0\fR.
+The remaining lines will contain the payload varbind list.
+For SNMPv1 traps, the final OID will be \fCSNMPv2\-MIB::snmpTrapEnterprise.0\fR.
+.br
+.IP Example:
+A \fBtraptoemail\fR script has been included in the Net-SNMP package that
+can be used within a \fItraphandle\fR directive:
+.br
+.RS
+.P
+traphandle default /usr/bin/perl BINDIR/traptoemail \-s mysmtp.somewhere.com \-f admin@somewhere.com me@somewhere.com
+.RE
+.RE
+.IP "forward OID|default DESTINATION"
+forwards notifications that match the specified OID
+to another receiver listening on DESTINATION.
+The interpretation of OID (and \fIdefault\fR) is the same
+as for the \fItraphandle\fR directive).
+.IP
+See the section
+.B LISTENING ADDRESSES
+in the
+.I snmpd(8)
+manual page for more information about the format of listening
+addresses.
+.RE
+.SH NOTES
+.IP o
+The daemon blocks while executing the \fItraphandle\fR commands.
+(This should
+be fixed in the future with an appropriate signal catch and wait()
+combination).
+.IP o
+All directives listed with a value of "yes" actually accept a range
+of boolean values. These will accept any of \fI1\fR, \fIyes\fR or
+\fItrue\fR to enable the corresponding behaviour,
+or any of \fI0\fR, \fIno\fR or \fIfalse\fR to disable it.
+The default in each case is for the feature to be turned off, so these
+directives are typically only used to enable the appropriate behaviour.
+.SH FILES
+SYSCONFDIR/snmp/snmptrapd.conf
+.SH "SEE ALSO"
+snmp_config(5), snmptrapd(8), syslog(8), variables(5), snmpd.conf(5), netsnmp_config_api(3).
+
diff --git a/man/snmpusm.1.def b/man/snmpusm.1.def
new file mode 100644
index 0000000..9061213
--- /dev/null
+++ b/man/snmpusm.1.def
@@ -0,0 +1,267 @@
+.TH SNMPUSM 1 "11 Dec 2009" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpusm - creates and maintains SNMPv3 users on a network entity
+.SH SYNOPSIS
+.B snmpusm
+[COMMON OPTIONS] [\-Cw] AGENT
+.B create
+USER [CLONEFROM-USER]
+.br
+.B snmpusm
+[COMMON OPTIONS] AGENT
+.B delete
+USER
+.br
+.B snmpusm
+[COMMON OPTIONS] AGENT
+.B cloneFrom
+USER CLONEFROM-USER
+.br
+.B snmpusm
+[COMMON OPTIONS] [\-Ca] [\-Cx] AGENT
+.B passwd
+OLD-PASSPHRASE NEW-PASSPHRASE [USER]
+.br
+.B snmpusm
+[COMMON OPTIONS] <\-Ca | \-Cx> \-Ck AGENT
+.B passwd
+OLD-KEY-OR-PASSPHRASE NEW-KEY-OR-PASSPHRASE [USER]
+.br
+.B snmpusm
+[COMMON OPTIONS] [\-Ca] [\-Cx] AGENT
+.B changekey
+[USER]
+
+.SH DESCRIPTION
+.B snmpusm
+is an SNMP application that can be used to do simple maintenance on
+the users known to an SNMP agent, by manipulating the agent's
+User-based Security Module (USM) table. The user needs
+write access to the usmUserTable MIB table. This tool can be
+used to create, delete, clone, and change the passphrase of users
+configured on a running SNMP agent.
+
+.SH OPTIONS
+Common options for all
+.B snmpusm
+commands:
+.TP
+.BI \-CE " ENGINE-ID"
+Set usmUserEngineID to be used as part of the index of the usmUserTable.
+Default is to use the contextEngineID (set via \-E or probed) as the
+usmUserEngineID.
+.TP
+.BI \-Cp " STRING"
+Set the usmUserPublic value of the (new) user to the specified STRING.
+.PP
+Options for the
+.B passwd
+and
+.B changekey
+commands:
+.TP
+.BI \-Ca
+Change the authentication key.
+.TP
+.BI \-Cx
+Change the privacy key.
+.TP
+.BI \-Ck
+Allows one to use localized key (must start with 0x) instead of passphrase.
+When this option is used, either the \-Ca or \-Cx option (but not both) must also
+be used.
+
+.SH CREATING USERS
+.PP
+An unauthenticated SNMPv3 user can be created using the command
+.IP
+.B snmpusm
+[COMMON OPTIONS] AGENT create USER
+.PP
+This constructs an (inactive) entry in the usmUserTable,
+with no authentication or privacy settings.
+In principle, this user should be useable for 'noAuthNoPriv' requests,
+but in practise the Net-SNMP agent will not allow such an entry
+to be made active. The user can be created via the createAndWait
+operation instead by using the \-Ca flag. This will prevent the user
+from being marked as active in any agent until explicitly activated
+later via the activate command.
+
+.PP
+In order to activate this entry, it is necessary to "clone" an existing
+user, using the command
+.IP
+.B snmpusm
+[COMMON OPTIONS] AGENT cloneFrom USER CLONEFROM-USER
+.PP
+The USER entry then inherits the same authentication and privacy
+settings (including pass phrases) as the CLONEFROM user.
+
+.PP
+These two steps can be combined into one, by using the command
+.IP
+.B snmpusm
+[COMMON OPTIONS] AGENT create USER CLONEFROM-USER
+
+.PP
+The two forms of the
+.B create
+sub-command require that the user being created does not already exist.
+The
+.B cloneFrom
+sub-command requires that the user being cloned to
+.I does
+already exist.
+
+.PP
+Cloning is the only way to specify which authentication and privacy
+protocols to use for a given user, and it is only possible to do this
+once. Subsequent attempts to reclone onto the same user will appear
+to succeed, but will be silently ignored.
+This (somewhat unexpected) behaviour is mandated by the SNMPv3
+USM specifications (RFC 3414).
+To change the authentication and privacy settings for a given user,
+it is necessary to delete and recreate the user entry.
+This is
+.I not
+necessary for simply changing the pass phrases (see below).
+This means that the agent must be initialized with at least one
+user for each combination of authentication and privacy protocols.
+See the
+.I snmpd.conf(5)
+manual page for details of the
+.B createUser
+configuration directive.
+
+.SH DELETING USERS
+A user can be deleted from the usmUserTable using the command
+.IP
+.B snmpusm
+[COMMON OPTIONS] AGENT delete USER
+
+.SH CHANGING PASS PHRASES
+User profiles contain private keys that are never
+transmitted over the wire in clear text (regardless of whether the
+administration requests are encrypted or not).
+To change the secret key for a user, it is necessary to specify the
+user's old passphrase as well as the new one.
+This uses the command
+.IP
+.B snmpusm
+[COMMON OPTIONS] [\-Ca] [\-Cx] AGENT passwd OLD-PASSPHRASE NEW-PASSPHRASE [USER]
+
+.PP
+After cloning a new user entry from the appropriate template,
+you should immediately change the new user's passphrase.
+
+.PP
+If USER is not specified, this command will change the passphrase
+of the (SNMPv3) user issuing the command. If the \-Ca or \-Cx options
+are specified, then only the authentication or privacy keys are changed. If
+these options are not specified, then both the authentication and privacy keys
+are changed.
+
+.IP
+.B snmpusm
+[COMMON OPTIONS] [\-Ca] [\-Cx] AGENT changekey [USER]
+
+.PP
+This command changes the key in a perfect-forward-secrecy compliant
+way through a diffie-helman exchange. The remote agent must support
+the SNMP\-USM\-DH\-OBJECTS\-MIB for this command to work. The resulting
+keys are printed to the console and may be then set in future command
+invocations using the \-\-defAuthLocalizedKey and \-\-defPrivLocalizedKey
+options or in your snmp.conf file using the defAuthLocalizedKey and
+defPrivLocalizedKey keywords.
+
+.PP
+Note that since these keys are randomly generated based on a
+diffie helman exchange, they are no longer derived from a more easily
+typed password. They are, however, much more secure.
+
+.PP
+To change from a localized key back to a password, the following variant
+of the
+.B passwd
+sub-command is used:
+
+.IP
+.B snmpusm
+[COMMON OPTIONS] <\-Ca | \-Cx> \-Ck AGENT passwd OLD-KEY-OR-PASSPHRASE NEW-KEY-OR-PASSPHRASE [USER]
+
+.PP
+Either the \-Ca or the \-Cx option must be specified. The OLD-KEY-OR-PASSPHRASE
+and/or NEW-KEY-OR-PASSPHRASE arguments can either be a passphrase or a
+localized key starting with "0x", e.g. as printed out by the
+.B changekey
+sub-command.
+
+.PP
+Note that
+.B snmpusm
+REQUIRES an argument specifying the agent to query
+as described in the .I snmpcmd(1) manual page.
+.SH EXAMPLES
+.PP
+Let's assume for our examples that the following VACM and USM
+configurations lines were in the snmpd.conf file for a Net-SNMP agent.
+These lines set up a default user called "initial" with the
+authentication passphrase "setup_passphrase" so that we can perform
+the initial setup of an agent:
+.PP
+.RS
+.nf
+# VACM configuration entries
+rwuser initial
+# lets add the new user we'll create too:
+rwuser wes
+# USM configuration entries
+createUser initial MD5 setup_passphrase DES
+.fi
+.RE
+.PP
+Note: the "initial" user's setup should be removed after creating a
+real user that you grant administrative privileges to (like the user
+"wes" we'll be creating in this example.
+.PP
+Note: passphrases must be 8 characters
+.I minimum
+in length.
+.SS Create a new user
+.PP
+snmpusm \-v3 \-u initial \-n "" \-l authNoPriv \-a MD5 \-A setup_passphrase
+localhost create wes initial
+.IP
+Creates a new user, here named "wes" using the user "initial" to do
+it. "wes" is cloned from "initial" in the process, so he inherits
+that user's passphrase ("setup_passphrase").
+.SS Change the user's passphrase
+.PP
+snmpusm \-v 3 \-u wes \-n "" \-l authNoPriv \-a MD5 \-A setup_passphrase
+localhost passwd setup_passphrase new_passphrase
+.IP
+After creating the user "wes" with the same passphrase as the
+"initial" user, we need to change his passphrase for him. The above
+command changes it from "setup_passphrase", which was inherited from
+the initial user, to "new_passphrase".
+.SS Test the new user
+.PP
+snmpget \-v 3 \-u wes \-n "" \-l authNoPriv \-a MD5 \-A new_passphrase
+localhost sysUpTime.0
+.IP
+If the above commands were successful, this command should have
+properly performed an authenticated SNMPv3 GET request to the agent.
+.PP
+Now, go remove the vacm "group" snmpd.conf entry for the "initial"
+user and you have a valid user 'wes' that you can use for future
+transactions instead of initial.
+
+.SH WARNING
+Manipulating the usmUserTable using this command can
+.I only
+be done using SNMPv3.
+This command will not work with the community-based versions,
+even if they have write access to the table.
+
+.SH "SEE ALSO"
+snmpd.conf(5), snmp.conf(5), RFC 3414
diff --git a/man/snmpvacm.1.def b/man/snmpvacm.1.def
new file mode 100644
index 0000000..70b089e
--- /dev/null
+++ b/man/snmpvacm.1.def
@@ -0,0 +1,373 @@
+.TH SNMPVACM 1 "05 Sep 2006" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpvacm - creates and maintains SNMPv3 View-based Access Control entries on a network entity
+.SH SYNOPSIS
+.B snmpvacm
+[COMMON OPTIONS] AGENT
+.B createSec2Group
+MODEL SECURITYNAME GROUPNAME
+.br
+.B snmpvacm
+[COMMON OPTIONS] AGENT
+.B deleteSec2Group
+MODEL SECURITYNAME
+.br
+.B snmpvacm
+[COMMON OPTIONS] AGENT
+.B createView
+[\-Ce] NAME SUBTREE MASK
+.br
+.B snmpvacm
+[COMMON OPTIONS] AGENT
+.B deleteView
+NAME SUBTREE
+.br
+.B snmpvacm
+[COMMON OPTIONS] AGENT
+.B createAccess
+GROUPNAME [CONTEXTPREFIX] MODEL LEVEL CONTEXTMATCH READVIEW WRITEVIEW NOTIFYVIEW
+.br
+.B snmpvacm
+[COMMON OPTIONS] AGENT
+.B deleteAccess
+GROUPNAME [CONTEXTPREFIX] MODEL LEVEL
+.br
+.B snmpvacm
+[COMMON OPTIONS] AGENT
+.B createAuth
+GROUPNAME [CONTEXTPREFIX] MODEL LEVEL AUTHTYPE CONTEXTMATCH VIEW
+.br
+.B snmpvacm
+[COMMON OPTIONS] AGENT
+.B deleteAuth
+GROUPNAME [CONTEXTPREFIX] MODEL LEVEL AUTHTYPE
+
+.SH DESCRIPTION
+.B snmpvacm
+is an SNMP application that can be used to do simple maintenance on the
+View-based Control Module (VACM) tables of an SNMP agent.
+The SNMPv3 VACM specifications (see RFC2575) define assorted tables
+to specify groups of users, MIB views, and authorised access settings.
+These
+.BR snmpvacm
+commands effectively create or delete rows in the appropriate one of
+these tables, and match the equivalent configure directives
+which are documented in the
+.I snmpd.conf(5)
+man page.
+.PP
+A fuller explanation of how these operate can be found in the project FAQ.
+.SH SUB-COMMANDS
+
+.SS createSec2Group \fRMODEL SECURITYNAME GROUPNAME\fP
+.PP
+Create an entry in the SNMPv3 security name to group table. This table
+allows a single access control entry to be applied to a number of users
+(or 'principals'),
+and is indexed by the security model and security name values.
+.PP
+MODEL
+.IP
+An integer representing the security model, taking one of the following
+values:
+.br
+1 - reserved for SNMPv1
+.br
+2 - reserved for SNMPv2c
+.br
+3 - User-based Security Model (USM)
+
+.PP
+SECURITYNAME
+.IP
+A string representing the security name for a principal (represented in
+a security-model-independent format). For USM-based requests, the security
+name is the same as the username.
+
+.PP
+GROUPNAME
+.IP
+A string identifying the group that this entry (i.e. security name/model
+pair) should belong to. This group name will then be referenced in the
+access table (see
+.B createAccess
+below).
+.PP
+.SS deleteSec2Group \fRMODEL SECURITYNAME\fP
+.PP
+Delete an entry from the SNMPv3 security name to group table, thus removing
+access control settings for the given principal. The entry to be removed is
+indexed by the MODEL and SECURITYNAME values, which should match those used
+in the corresponding
+.B createSec2Group
+command (or equivalent).
+
+.SS createView \fR[\-Ce] NAME SUBTREE MASK\fP
+.PP
+Create an entry in the SNMPv3 MIB view table.
+A MIB view consists of a family of view subtrees which may be individually
+included in or (occasionally) excluded from the view. Each view subtree is
+defined by a combination of an OID subtree together with a bit string mask.
+The view table is indexed by the view name and subtree OID values.
+.PP
+[\-Ce]
+.IP
+An optional flag to indicate that this view subtree should be excluded
+from the named view.
+If not specified, the default is to include the subtree in the view.
+When constructing a view from a mixture of included and excluded subtrees,
+the excluded subtrees should be defined first - particularly if the named
+view is already referenced in one or more access entries.
+.PP
+NAME
+.IP
+A string identifying a particular MIB view, of which this OID subtree/mask
+forms part (possibly the only part).
+.PP
+SUBTREE
+.IP
+The OID defining the root of the subtree to add to (or exclude from) the
+named view.
+.PP
+MASK
+.IP
+A bit mask indicating which sub-identifiers of the associated subtree OID
+should be regarded as significant.
+
+.SS deleteView \fRNAME SUBTREE\fP
+Delete an entry from the SNMPv3 view table, thus removing the subtree from
+the given MIB view.
+Removing the final (or only) subtree will result in the deletion of the view.
+The entry to be removed is indexed by the NAME and SUBTREE values, which
+should match those used in the corresponding
+.B createView
+command (or equivalent).
+.PP
+When removing subtrees from a mixed view (i.e. containing both included and
+excluded subtrees), the included subtrees should be removed first.
+
+.SS createAccess \fRGROUPNAME [CONTEXTPREFIX] MODEL LEVEL CONTEXTMATCH READVIEW WRITEVIEW NOTIFYVIEW\fP
+Create an entry in the SNMPv3 access table, thus allowing a certain level
+of access to particular MIB views for the principals in the specified group
+(given suitable security model and levels in the request).
+The access table is indexed by the group name, context prefix, security model
+and security level values.
+.PP
+GROUPNAME
+.IP
+The name of the group that this access entry applies to
+(as set up by a
+.B createSec2Group
+command, or equivalent)
+.PP
+CONTEXTPREFIX
+.IP
+A string representing a context name (or collection of context names)
+which this access entry applies to.
+The interpretation of this string depends on the value of the
+CONTEXTMATCH field (see below).
+.IP
+If omitted, this will default to the null context "".
+.PP
+MODEL
+.IP
+An integer representing the security model, taking one of the following
+values:
+.br
+1 - reserved for SNMPv1
+.br
+2 - reserved for SNMPv2c
+.br
+3 - User-based Security Model (USM)
+.PP
+LEVEL
+.IP
+An integer representing the minimal security level, taking one of the following
+values:
+.br
+1 - noAuthNoPriv
+.br
+2 - authNoPriv
+.br
+3 - authPriv
+.IP
+This access entry will be applied to requests of this level or higher
+(where authPriv is higher than authNoPriv which is in turn higher than
+noAuthNoPriv).
+.PP
+CONTEXTMATCH
+.IP
+Indicates how to interpret the CONTEXTPREFIX value.
+If this field has the value '1' (representing 'exact') then the context
+name of a request must match the CONTEXTPREFIX value exactly for this
+access entry to be applicable to that request.
+.IP
+If this field has the value '2' (representing 'prefix') then the initial
+substring of the context name of a request must match the CONTEXTPREFIX
+value for this access entry to be applicable to that request.
+This provides a simple form of wildcarding.
+.PP
+READVIEW
+.IP
+The name of the MIB view
+(as set up by
+.B createView
+or equivalent)
+defining the MIB objects for which this request may request the current values.
+.IP
+If there is no view with this name, then read access is not granted.
+.PP
+WRITEVIEW
+.IP
+The name of the MIB view
+(as set up by
+.B createView
+or equivalent)
+defining the MIB objects for which this request may potentially SET new values.
+.IP
+If there is no view with this name, then read access is not granted.
+.PP
+NOTIFYVIEW
+.IP
+The name of the MIB view
+(as set up by
+.B createView
+or equivalent)
+defining the MIB objects which may be included in notification request.
+.IP
+Note that this aspect of access control is not currently supported.
+
+.SS deleteAccess \fRGROUPNAME [CONTEXTPREFIX] MODEL LEVEL\fP
+Delete an entry from the SNMPv3 access table, thus removing the specified
+access control settings.
+The entry to be removed is indexed by the group name, context prefix,
+security model and security level values,
+which should match those used in the corresponding
+.B createAccess
+command (or equivalent).
+
+.SS createAuth \fRGROUPNAME [CONTEXTPREFIX] MODEL LEVEL AUTHTYPE CONTEXTMATCH VIEW\fP
+Create an entry in the Net-SNMP extension to the standard access table,
+thus allowing a certain type of access to the MIB view for the principals
+in the specified group.
+The interpretation of GROUPNAME, CONTEXTPREFIX, MODEL, LEVEL and CONTEXTMATCH
+are the same as for the
+.B createAccess
+directive.
+The extension access table is indexed by the group name, context prefix,
+security model, security level and authtype values.
+.PP
+AUTHTYPE
+.IP
+The style of access that this entry should be applied to.
+See
+.I "snmpd.conf(5)"
+and
+.I "snmptrapd.conf(5)"
+for details of valid tokens.
+.PP
+VIEW
+.IP
+The name of the MIB view
+(as set up by
+.B createView
+or equivalent)
+defining the MIB objects for which this style of access is authorized.
+
+.SS deleteAuth \fRGROUPNAME [CONTEXTPREFIX] MODEL LEVEL AUTHTYPE\fP
+Delete an entry from the extension access table, thus removing the specified
+access control settings.
+The entry to be removed is indexed by the group name, context prefix,
+security model, security level and authtype values,
+which should match those used in the corresponding
+.B createAuth
+command (or equivalent).
+
+.PP
+Note that
+.B snmpget
+REQUIRES an argument specifying the agent to query
+as described in the .I snmpcmd(1) manual page.
+
+.SH EXAMPLES
+.PP
+Given a pre-existing user
+.I dave
+(which could be set up using the
+.I snmpusm(1)
+command),
+we could configure full read-write access to the whole OID tree
+using the commands:
+
+.IP
+snmpvacm localhost createSec2Group 3 dave RWGroup
+.IP
+snmpvacm localhost createView all .1 80
+.IP
+snmpvacm localhost createAccess RWGroup 3 1 1 all all none
+.PP
+This creates a new security group named "RWGroup" containing the SNMPv3 user "dave",
+a new view "all" containing the full OID tree based on
+.I .iso(1)
+, and then allows those users in the group "RWGroup" (i.e. "dave")
+both read- and write-access to the view "all" (i.e. the full OID tree)
+when using authenticated SNMPv3 requests.
+
+.PP
+As a second example,
+we could set up read-only access to a portion
+of the OID tree using the commands:
+
+.IP
+snmpvacm localhost createSec2Group 3 wes ROGroup
+.IP
+snmpvacm localhost createView sysView system fe
+.IP
+snmpvacm localhost createAccess ROGroup 3 0 1 sysView none none
+.PP
+This creates a new security group named "ROGroup" containing the (pre-existing)
+user "wes", a new view "sysView" containing just the OID tree based on
+.I .iso(1).org(3).dod(6).inet(1).mgmt(2).mib\-2(1).system(1)
+, and then allows those users in the group "ROGroup" (i.e. "wes")
+read-access, but not write-access to the view "sysView" (i.e. the system group).
+
+.SH "EXIT STATUS"
+
+.PP
+The following exit values are returned:
+.PP
+0 - Successful completion
+.PP
+1 - A usage syntax error (which displays a suitable usage message)
+or a request timeout.
+.PP
+2 - An error occurred while executing the command
+(which also displays a suitable error message).
+
+.SH "LIMITATIONS"
+
+This utility does not support the configuration of new community strings,
+so is only of use for setting up new access control for SNMPv3 requests.
+It can be used to amend the access settings for existing community strings,
+but not to set up new ones.
+
+.PP
+The use of numeric
+parameters for
+.B secLevel
+and
+.B contextMatch
+parameters is less than intuitive.
+These commands do not provide the full flexibility of the
+equivalent config file directives.
+
+.PP
+There is (currently) no equivalent to the one-shot
+configure directives
+.I rouser
+and
+.I rwuser.
+
+.SH "SEE ALSO"
+snmpcmd(1), snmpusm(1),
+snmpd.conf(5), snmp.conf(5), RFC 2575, Net-SNMP project FAQ
diff --git a/man/snmpwalk.1.def b/man/snmpwalk.1.def
new file mode 100644
index 0000000..ef78660
--- /dev/null
+++ b/man/snmpwalk.1.def
@@ -0,0 +1,142 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP 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.
+.\" ******************************************************************/
+.TH SNMPWALK 1 "28 May 2007" VVERSIONINFO "Net-SNMP"
+.SH NAME
+snmpwalk - retrieve a subtree of management values using SNMP GETNEXT requests
+.SH SYNOPSIS
+.B snmpwalk
+[APPLICATION OPTIONS] [COMMON OPTIONS] AGENT [OID]
+.SH DESCRIPTION
+.B snmpwalk
+is an SNMP application that uses SNMP GETNEXT requests to query a
+network entity for a tree of information.
+.PP
+An object identifier (OID) may be given on the command line. This OID
+specifies which portion of the object identifier space will be
+searched using GETNEXT requests. All variables in the subtree
+below the given OID are queried and their values presented to the user.
+Each variable name is given in the format specified in
+.IR variables(5) .
+.PP
+If no OID argument is present,
+.B snmpwalk
+will search the subtree rooted at SNMPv2\-SMI::mib\-2
+(including any MIB object values from other MIB modules,
+that are defined as lying within this subtree).
+If the network entity has an error processing the request packet, an
+error packet will be returned and a message will be shown, helping to
+pinpoint why the request was malformed.
+.PP
+If the tree search causes attempts to search beyond the end of the
+MIB, the message "End of MIB" will be displayed.
+.SH OPTIONS
+.TP 8
+.B \-Cc
+Do not check whether the returned OIDs are increasing. Some agents
+(LaserJets are an example) return OIDs out of order, but can
+complete the walk anyway. Other agents return OIDs that are out of
+order and can cause
+.B snmpwalk
+to loop indefinitely. By default,
+.B snmpwalk
+tries to detect this behavior and warns you when it hits an agent
+acting illegally. Use
+.B \-Cc
+to turn off this check.
+.TP
+.B \-CE {OID}
+End the walk at the specified OID, rather than a simple subtree.
+This can be used to walk a partial subtree, selected columns of
+a table, or even two or more tables within a single command.
+.TP
+.B \-Ci
+Include the given OID in the search range. Normally
+.B snmpwalk
+uses GETNEXT requests starting with the OID you specified and returns
+all results in the MIB subtree rooted at that OID. Sometimes, you may
+wish to include the OID specified on the command line in the printed
+results if it is a valid OID in the tree itself. This option lets you
+do this explicitly.
+.TP
+.B \-CI
+In fact, the given OID will be retrieved automatically if the main
+subtree walk returns no useable values. This allows a walk of a
+single instance to behave as generally expected, and return the
+specified instance value.
+This option turns off this final GET request, so a walk of a
+single instance will return nothing.
+.TP
+.B \-Cp
+Upon completion of the walk, print the number of variables found.
+.TP
+.B \-Ct
+Upon completion of the walk, print the total wall-clock time it took
+to collect the data (in seconds). Note that the timer is started just
+before the beginning of the data request series and stopped just after
+it finishes. Most importantly, this means that it does not include
+snmp library initialization, shutdown, argument processing, and any
+other overhead.
+.PP
+In addition to these options,
+.B snmpwalk
+takes the common options described in the
+.I snmpcmd(1)
+manual page.
+.SH EXAMPLES
+.br
+Note that
+.B snmpbulkget
+REQUIRES an argument specifying the agent to query
+and at most one OID argument, as described there.
+The command:
+.PP
+snmpwalk \-Os \-c public \-v 1 zeus system
+.PP
+will retrieve all of the variables under system:
+.PP
+sysDescr.0 = STRING: "SunOS zeus.net.cmu.edu 4.1.3_U1 1 sun4m"
+.br
+sysObjectID.0 = OID: enterprises.hp.nm.hpsystem.10.1.1
+.br
+sysUpTime.0 = Timeticks: (155274552) 17 days, 23:19:05
+.br
+sysContact.0 = STRING: ""
+.br
+sysName.0 = STRING: "zeus.net.cmu.edu"
+.br
+sysLocation.0 = STRING: ""
+.br
+sysServices.0 = INTEGER: 72
+.br
+(plus the contents of the sysORTable).
+
+The command:
+.PP
+snmpwalk \-Os \-c public \-v 1 \-CE sysORTable zeus system
+.PP
+will retrieve the scalar values, but omit the sysORTable.
+.SH "SEE ALSO"
+snmpcmd(1), snmpbulkwalk(1), variables(5).
diff --git a/man/tkmib.1.def b/man/tkmib.1.def
new file mode 100644
index 0000000..f0253b9
--- /dev/null
+++ b/man/tkmib.1.def
@@ -0,0 +1,15 @@
+.TH tkmib "1" "16 Nov 2006" VVERSIONINFO "Net-SNMP"
+.SH NAME
+tkmib - an interactive graphical MIB browser for SNMP
+.SH SYNOPSIS
+.PP
+.B tkmib
+.SH DESCRIPTION
+.PP
+Simple Network Management Protocol (SNMP) provides a framework for
+exchange of the management information between the agents (servers)
+and clients. The Management Information Bases (MIBs) contain a formal
+description of a set of network objects that can be managed using the
+SNMP for a particular agent. \fBtkmib\fR is a graphical user interface
+for browsing the MIBs. It is also capable of sending or retrieving the
+SNMP management information to/from the remote agents interactively.
diff --git a/man/traptoemail.1.def b/man/traptoemail.1.def
new file mode 100644
index 0000000..4080f36
--- /dev/null
+++ b/man/traptoemail.1.def
@@ -0,0 +1,22 @@
+.TH traptoemail "1" "16 Nov 2006" VVERSIONINFO "Net-SNMP"
+.SH NAME
+traptoemail - snmptrapd handler script to convert snmp traps into emails
+.SH SYNOPSIS
+.PP
+.B traptoemail
+[\fI\-f FROM\fR]
+[\fI\-s SMTPSERVER\fR]
+ADDRESSES
+.SH DESCRIPTION
+.PP
+converts snmp traps into email messages.
+.SH OPTIONS
+.TP
+.B \-f FROM
+sender address, defaults to "root"
+.TP
+.B \-s SMTPSERVER
+SMTP server, defaults to "localhost"
+.TP
+.B ADDRESSES
+recipient addresses
diff --git a/man/variables.5.def b/man/variables.5.def
new file mode 100644
index 0000000..14ee5e2
--- /dev/null
+++ b/man/variables.5.def
@@ -0,0 +1,178 @@
+.\" -*- nroff -*-
+.\" Portions of this file are subject to the following copyright. See
+.\" the Net-SNMP 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.
+.\" ******************************************************************/
+.TH VARIABLES 5 "01 Oct 2010" VVERSIONINFO "Net-SNMP"
+.SH NAME
+ variables - Format of specifying variable names to SNMP tools.
+.SH DESCRIPTION
+The syntax and semantics of management information in SNMP is
+given by the definitions of MIB objects, loaded from one or more
+MIB files (or "MIB modules"). These definitions are not strictly
+required for the SNMP protocol to operate correctly, but are typically
+needed by SNMP client applications to display information in a
+meaningful manner.
+
+The MIB file also serves as a design document when developing an SNMP
+agent (or sub-agent) that provides this information, and ensures that
+client and server share a common understanding about what management
+information represents.
+
+.SH OIDs
+MIB objects are specified using Object Identifiers (OIDs), which can
+take a number of forms. Note that all of the examples in this section
+refer to the same MIB object.
+.SS Numeric OIDs
+The fundamental format of an OID is a sequence of integer values
+(or "subidentifiers"), typically written using dots to separate
+the individual subidentifiers.
+.RS
+ .1.3.6.1.2.1.1.1
+.RE
+This is the format that is used within the SNMP protocol itself,
+in the packets that are sent over the network.
+.PP
+This form of representing an OID does not require MIB files or MIB
+object definitions to be available. However it does rely on the
+client application and/or network administrator knowing what a
+given numeric OID refers to. As such, it is not a particularly
+helpful representation to anyone just starting out with SNMP.
+.PP
+This format can be obtained by giving the command-line option
+-On
+to most Net-SNMP commands.
+
+.SS Full OID path
+A similar (but somewhat more informative) format uses the same
+dotted list representation, but with the numeric subidentifiers
+replaced by names, taken from the relevant MIB file(s).
+.RS
+ .iso.org.dod.internet.mgmt.mib-2.system.sysDescr
+.RE
+This uniquely identifies a particular MIB object (as with the numeric
+OID), but the list of names should hopefully give some indication as
+to what information this object represents. However it does rely on
+the relevant MIB files being available (as do all formats other than
+the purely numeric OID). Such OIDs also tend to be fairly long!
+.PP
+This format can be obtained by giving the command-line option
+-Of
+to most Net-SNMP commands.
+.PP
+A variant of this (typically used when writing OIDs in descriptive
+text, rather than running programs), is to combine the name and
+numeric subidentifier:
+.RS
+ .iso(1).org(3).dod(6).internet(1).mgmt(2).mib-2(1).system(1).sysDescr(1)
+.RE
+
+.SS Module-qualified OIDs
+An alternative way to (more-or-less) uniquely specify an OID,
+is to give the name of the MIB object, together with the MIB
+module where it is defined.
+.RS
+SNMPv2-MIB::sysDescr
+.RE
+MIB object names are unique within a given module, so as long
+as there are not two MIB modules with the same name (which is
+unusual, though not unheard of), this format specifies the
+desired object in a reasonably compact form. It also makes
+it relatively easy to find the definition of the MIB object.
+.PP
+This is the default format for displaying OIDs in Net-SNMP applications.
+It can also be specified explicitly by giving the command-line option
+-OS
+to most Net-SNMP commands.
+
+.SS Object name
+Possibly the most common form for specifying MIB objects is
+using the name of the object alone - without the full path or
+the name of the module that defines it.
+.RS
+sysDescr
+.RE
+This is by far the shortest and most convenient way to refer to
+a MIB object. However the danger is that if two MIB modules each
+define a MIB object with the same name (which is perfectly legal
+in some circumstances), then it's not necessarily clear which MIB
+object is actually meant.
+For day-to-day use, particularly when using standard MIB objects,
+this is \fIprobaby\fP safe.
+But it's important to be aware of the potential ambiguities.
+.PP
+This format can be obtained by giving the command-line option
+-Os
+to most Net-SNMP commands.
+
+.SS UCD-format
+Previous versions of the code (UCD v4.x and earlier) used a
+simple approach to shortening the way OIDs were specified.
+If the full path of the OID began with
+\fC.iso.org.dod.internet.mgmt.mib-2\fP
+then this prefix was removed from the OID before displaying it.
+All other OIDs were displayed in full.
+.PP
+Similarly, if an OID was passed to the UCD library that did
+not begin with a dot (and wasn't in the module::name format),
+then the same prefix was prepended. The example OID from the
+formats listed above would therefore be given or displayed as
+.RS
+system.sysDescr
+.RE
+The inconsistent handling of OIDs, depending on their location
+within the OID tree, proved to be more trouble than it was worth,
+and this format is no longer recommended.
+.PP
+The previous behaviour can be obtained by giving the command-line
+option
+-Ou
+(for displaying output), or
+-Iu
+(for interpreting input OIDs without a leading dot)
+to most Net-SNMP commands.
+.\"
+.\" ====================================
+.\"
+.\" ToDo:
+.\" Instances:
+.\" Scalars
+.\" Tables & indexing
+.\" string indexes - 'abc' vs "abc"
+'\" Internal objects
+.\"
+.\" ? Syntax types
+.\"
+.\" ====================================
+.\".PP
+.\"The description of the variables in the MIB is given in the set of MIB
+.\"files defined by the MIBS environment variable (or the default list
+.\"defined at compilation time) and the MIB files in the
+.\"DATADIR/snmp/mibs directory (or the MIBDIRS environment variable).
+.SH "SEE ALSO"
+snmpcmd(1)
+.SH BUGS
+The parser of the MIB files file is not expected to handle bizarre
+(although correct) interpretations of the ASN.1 notation.
+
+
diff --git a/mibs/LM-SENSORS-MIB.txt b/mibs/LM-SENSORS-MIB.txt
new file mode 100644
index 0000000..d0734b3
--- /dev/null
+++ b/mibs/LM-SENSORS-MIB.txt
@@ -0,0 +1,230 @@
+LM-SENSORS-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Derived from the original VEST-INTERNETT-MIB. Open issues:
+--
+-- (a) where to register this MIB?
+-- (b) use not-accessible for diskIOIndex?
+--
+
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, Integer32, Gauge32
+ FROM SNMPv2-SMI
+ DisplayString
+ FROM SNMPv2-TC
+ ucdExperimental
+ FROM UCD-SNMP-MIB;
+
+lmSensorsMIB MODULE-IDENTITY
+ LAST-UPDATED "200011050000Z"
+ ORGANIZATION "AdamsNames Ltd"
+ CONTACT-INFO
+ "Primary Contact: M J Oldfield
+ email: m@mail.tc"
+ DESCRIPTION
+ "This MIB module defines objects for lm_sensor derived data."
+ REVISION "200011050000Z"
+ DESCRIPTION
+ "Derived from DISKIO-MIB ex UCD."
+ ::= { lmSensors 1 }
+
+lmSensors OBJECT IDENTIFIER ::= { ucdExperimental 16 }
+
+--
+
+lmTempSensorsTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF LMTempSensorsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Table of temperature sensors and their values."
+ ::= { lmSensors 2 }
+
+lmTempSensorsEntry OBJECT-TYPE
+ SYNTAX LMTempSensorsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a device and its statistics."
+ INDEX { lmTempSensorsIndex }
+ ::= { lmTempSensorsTable 1 }
+
+LMTempSensorsEntry ::= SEQUENCE {
+ lmTempSensorsIndex Integer32,
+ lmTempSensorsDevice DisplayString,
+ lmTempSensorsValue Gauge32
+}
+
+lmTempSensorsIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each observed device."
+ ::= { lmTempSensorsEntry 1 }
+
+lmTempSensorsDevice OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The name of the temperature sensor we are reading."
+ ::= { lmTempSensorsEntry 2 }
+
+lmTempSensorsValue OBJECT-TYPE
+ SYNTAX Gauge32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The temperature of this sensor in mC."
+ ::= { lmTempSensorsEntry 3 }
+--
+
+lmFanSensorsTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF LMFanSensorsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Table of fan sensors and their values."
+ ::= { lmSensors 3 }
+
+lmFanSensorsEntry OBJECT-TYPE
+ SYNTAX LMFanSensorsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a device and its statistics."
+ INDEX { lmFanSensorsIndex }
+ ::= { lmFanSensorsTable 1 }
+
+LMFanSensorsEntry ::= SEQUENCE {
+ lmFanSensorsIndex Integer32,
+ lmFanSensorsDevice DisplayString,
+ lmFanSensorsValue Gauge32
+}
+
+lmFanSensorsIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each observed device."
+ ::= { lmFanSensorsEntry 1 }
+
+lmFanSensorsDevice OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The name of the fan sensor we are reading."
+ ::= { lmFanSensorsEntry 2 }
+
+lmFanSensorsValue OBJECT-TYPE
+ SYNTAX Gauge32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The rotation speed of the fan in RPM."
+ ::= { lmFanSensorsEntry 3 }
+
+--
+
+lmVoltSensorsTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF LMVoltSensorsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Table of voltage sensors and their values."
+ ::= { lmSensors 4 }
+
+lmVoltSensorsEntry OBJECT-TYPE
+ SYNTAX LMVoltSensorsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a device and its statistics."
+ INDEX { lmVoltSensorsIndex }
+ ::= { lmVoltSensorsTable 1 }
+
+LMVoltSensorsEntry ::= SEQUENCE {
+ lmVoltSensorsIndex Integer32,
+ lmVoltSensorsDevice DisplayString,
+ lmVoltSensorsValue Gauge32
+}
+
+lmVoltSensorsIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each observed device."
+ ::= { lmVoltSensorsEntry 1 }
+
+lmVoltSensorsDevice OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The name of the device we are reading."
+ ::= { lmVoltSensorsEntry 2 }
+
+lmVoltSensorsValue OBJECT-TYPE
+ SYNTAX Gauge32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The voltage in mV."
+ ::= { lmVoltSensorsEntry 3 }
+
+--
+
+lmMiscSensorsTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF LMMiscSensorsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Table of miscellaneous sensor devices and their values."
+ ::= { lmSensors 5 }
+
+lmMiscSensorsEntry OBJECT-TYPE
+ SYNTAX LMMiscSensorsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a device and its statistics."
+ INDEX { lmMiscSensorsIndex }
+ ::= { lmMiscSensorsTable 1 }
+
+LMMiscSensorsEntry ::= SEQUENCE {
+ lmMiscSensorsIndex Integer32,
+ lmMiscSensorsDevice DisplayString,
+ lmMiscSensorsValue Gauge32
+}
+
+lmMiscSensorsIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each observed device."
+ ::= { lmMiscSensorsEntry 1 }
+
+lmMiscSensorsDevice OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The name of the device we are reading."
+ ::= { lmMiscSensorsEntry 2 }
+
+lmMiscSensorsValue OBJECT-TYPE
+ SYNTAX Gauge32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of this sensor."
+ ::= { lmMiscSensorsEntry 3 }
+
+
+END
diff --git a/mibs/Makefile.in b/mibs/Makefile.in
new file mode 100644
index 0000000..0d8e71f
--- /dev/null
+++ b/mibs/Makefile.in
@@ -0,0 +1,80 @@
+#
+# Makefile to install mib files.
+#
+
+top_builddir=..
+
+VPATH = @srcdir@
+
+#
+# Stuff here
+#
+OTHERINSTALL=mibsinstall
+OTHERUNINSTALL=mibsuninstall
+
+
+V1MIBS = RFC1155-SMI.txt RFC1213-MIB.txt RFC-1215.txt
+
+V2MIBS = SNMPv2-CONF.txt SNMPv2-SMI.txt SNMPv2-TC.txt SNMPv2-TM.txt \
+ SNMPv2-MIB.txt
+
+V3MIBS = SNMP-FRAMEWORK-MIB.txt SNMP-MPD-MIB.txt SNMP-TARGET-MIB.txt \
+ SNMP-NOTIFICATION-MIB.txt SNMP-PROXY-MIB.txt \
+ SNMP-USER-BASED-SM-MIB.txt SNMP-VIEW-BASED-ACM-MIB.txt \
+ SNMP-COMMUNITY-MIB.txt TRANSPORT-ADDRESS-MIB.txt
+
+AGENTMIBS = AGENTX-MIB.txt SMUX-MIB.txt
+
+IANAMIBS = IANAifType-MIB.txt IANA-LANGUAGE-MIB.txt \
+ IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt
+
+RFCMIBS = IF-MIB.txt IF-INVERTED-STACK-MIB.txt \
+ EtherLike-MIB.txt \
+ IP-MIB.txt IP-FORWARD-MIB.txt IANA-RTPROTO-MIB.txt \
+ TCP-MIB.txt UDP-MIB.txt \
+ INET-ADDRESS-MIB.txt HCNUM-TC.txt \
+ HOST-RESOURCES-MIB.txt HOST-RESOURCES-TYPES.txt \
+ RMON-MIB.txt \
+ IPV6-TC.txt IPV6-MIB.txt IPV6-ICMP-MIB.txt IPV6-TCP-MIB.txt \
+ IPV6-UDP-MIB.txt IPV6-FLOW-LABEL-MIB.txt TUNNEL-MIB.txt \
+ DISMAN-EVENT-MIB.txt DISMAN-SCRIPT-MIB.txt DISMAN-SCHEDULE-MIB.txt \
+ NOTIFICATION-LOG-MIB.txt SNMP-USM-AES-MIB.txt \
+ SNMP-USM-DH-OBJECTS-MIB.txt \
+ SCTP-MIB.txt BRIDGE-MIB.txt
+
+NETSNMPMIBS = NET-SNMP-TC.txt NET-SNMP-MIB.txt NET-SNMP-AGENT-MIB.txt \
+ NET-SNMP-EXAMPLES-MIB.txt NET-SNMP-EXTEND-MIB.txt NET-SNMP-PASS-MIB.txt
+
+UCDMIBS = UCD-SNMP-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt \
+ UCD-DLMOD-MIB.txt UCD-DISKIO-MIB.txt
+
+DEFAULTMIBS = @default_mibs_install@
+
+MIBS = $(V1MIBS) $(V2MIBS) $(V3MIBS) $(RFCMIBS) \
+ $(AGENTMIBS) $(IANAMIBS) \
+ $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS)
+
+all: standardall
+
+mibsinstall: installdirs
+ @for i in $(MIBS) ; do \
+ $(INSTALL_DATA) $(srcdir)/$$i $(INSTALL_PREFIX)$(mibdir) ; \
+ echo "install: installed $$i in $(INSTALL_PREFIX)$(mibdir)" ; \
+ done
+
+mibsuninstall: installdirs
+ @for i in $(MIBS) ; do \
+ rm -f $(INSTALL_PREFIX)$(mibdir)/$$i ; \
+ echo "removed $$i from $(INSTALL_PREFIX)$(mibdir)" ; \
+ done
+
+installdirs:
+ @$(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(mibdir)
+
+htmldir:
+ @if test ! -d html ; then \
+ mkdir html ; \
+ fi
+ rm -f html/index.html ; \
+ $(PERL) makehtml.pl -W -M `pwd` -D html $(MIBS) > html/index.html
+
diff --git a/mibs/Makefile.mib b/mibs/Makefile.mib
new file mode 100644
index 0000000..6d31242
--- /dev/null
+++ b/mibs/Makefile.mib
@@ -0,0 +1,225 @@
+# RFCHOST = ftp://ftp.nordu.net
+RFCHOST = ftp://ftp.ietf.org
+RFCDIR = rfc
+
+IANAHOST = http://www.iana.org
+IANADIR = assignments
+
+PREFIX = /usr/local
+ALLDIR = $(PREFIX)/share/snmp/rfc.orig
+INSTDIR = $(PREFIX)/share/snmp/rfc
+
+MIBS = SNMPv2-TC.txt SNMPv2-TM.txt SNMPv2-SMI.txt SNMPv2-MIB.txt \
+ SNMPv2-CONF.txt HCNUM-TC.txt INET-ADDRESS-MIB.txt \
+ SNMP-FRAMEWORK-MIB.txt SNMP-MPD-MIB.txt SNMP-USER-BASED-SM-MIB.txt \
+ SNMP-VIEW-BASED-ACM-MIB.txt SNMP-COMMUNITY-MIB.txt \
+ SNMP-TARGET-MIB.txt SNMP-NOTIFICATION-MIB.txt SNMP-PROXY-MIB.txt \
+ SNMP-USM-DH-OBJECTS-MIB.txt SNMP-USM-AES-MIB.txt \
+ SNMP-TLS-TM-MIB.txt \
+ AGENTX-MIB.txt SMUX-MIB.txt \
+ DISMAN-SCRIPT-MIB.txt DISMAN-SCHEDULE-MIB.txt \
+ DISMAN-PING-MIB.txt DISMAN-TRACEROUTE-MIB.txt \
+ DISMAN-NSLOOKUP-MIB.txt DISMAN-EVENT-MIB.txt \
+ DISMAN-EXPRESSION-MIB.txt NOTIFICATION-LOG-MIB.txt \
+ IANA-LANGUAGE-MIB.txt IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt \
+ IF-MIB.txt IF-INVERTED-STACK-MIB.txt \
+ IP-MIB.txt IP-FORWARD-MIB.txt TCP-MIB.txt UDP-MIB.txt \
+ IANAifType-MIB.txt IANA-RTPROTO-MIB.txt EtherLike-MIB.txt \
+ IPV6-TC.txt IPV6-MIB.txt IPV6-ICMP-MIB.txt \
+ IPV6-TCP-MIB.txt IPV6-UDP-MIB.txt IPV6-FLOW-LABEL-MIB.txt \
+ HOST-RESOURCES-MIB.txt HOST-RESOURCES-TYPES.txt \
+ NETWORK-SERVICES-MIB.txt MTA-MIB.txt \
+ RMON-MIB.txt \
+ TUNNEL-MIB.txt \
+ TRANSPORT-ADDRESS-MIB.txt \
+ RFC1155-SMI.txt RFC1213-MIB.txt\
+ SCTP-MIB.txt BRIDGE-MIB.txt
+
+MIBDEPS = Makefile.mib mibfetch smistrip
+
+all: $(MIBS)
+
+allmibs: ianamibs rfcmibs
+
+rfc: allmibs
+ rm -fr $(INSTDIR)
+ mkdir $(INSTDIR)
+ cp $(ALLDIR)/* $(INSTDIR)
+ if test `uname` = SunOS ; \
+ then gpatch -d $(INSTDIR) < rfcmibs.diff; \
+ else patch -d $(INSTDIR) < rfcmibs.diff; \
+ fi
+ rm -f $(INSTDIR)/*orig
+
+clean:
+ rm $(MIBS)
+
+SNMP-FRAMEWORK-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3411
+
+SNMP-MPD-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3412 SNMP-MPD-MIB
+
+SNMP-TARGET-MIB.txt SNMP-NOTIFICATION-MIB.txt SNMP-PROXY-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3413
+
+SNMP-USER-BASED-SM-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3414 SNMP-USER-BASED-SM-MIB
+
+SNMP-VIEW-BASED-ACM-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3415
+
+SNMP-COMMUNITY-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2576
+
+SNMP-USM-AES-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3826
+
+SNMP-TLS-TM-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 6353
+
+SNMP-USM-DH-OBJECTS-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2786
+
+SNMPv2-SMI.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2578 SNMPv2-SMI
+
+SNMPv2-TC.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2579
+
+SNMPv2-CONF.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2580
+
+SNMPv2-TM.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3417
+
+SNMPv2-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3418
+
+AGENTX-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2742
+
+SMUX-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 1227 SMUX-MIB
+
+DISMAN-SCHEDULE-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3231
+
+DISMAN-SCRIPT-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3165
+
+DISMAN-EXPRESSION-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2982
+
+DISMAN-EVENT-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2981
+
+DISMAN-NSLOOKUP-MIB.txt DISMAN-TRACEROUTE-MIB.txt DISMAN-PING-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 4560
+
+NOTIFICATION-LOG-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3014
+
+IF-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2863
+
+IF-INVERTED-STACK-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2864
+
+HCNUM-TC.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2856
+
+INET-ADDRESS-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 4001
+
+EtherLike-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3635
+
+IANAifType-MIB.txt: $(MIBDEPS)
+ ./mibfetch -x $(IANAHOST) $(IANADIR) ianaiftype-mib
+
+IANA-RTPROTO-MIB.txt: $(MIBDEPS)
+ ./mibfetch -x $(IANAHOST) $(IANADIR) ianaiprouteprotocol-mib
+
+IANA-LANGUAGE-MIB.txt: $(MIBDEPS)
+ ./mibfetch -x $(IANAHOST) $(IANADIR) ianalanguage-mib
+
+IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt: $(MIBDEPS)
+ ./mibfetch -x $(IANAHOST) $(IANADIR) ianaaddressfamilynumbers-mib
+
+IP-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 4293
+
+IP-FORWARD-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 4292
+
+TCP-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 4022
+
+UDP-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 4113
+
+TUNNEL-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 4087
+
+TRANSPORT-ADDRESS-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3419
+
+IPV6-TC.txt IPV6-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2465
+
+IPV6-ICMP-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2466
+
+IPV6-TCP-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2452
+
+IPV6-UDP-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2454
+
+IPV6-FLOW-LABEL-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3595
+
+HOST-RESOURCES-MIB.txt HOST-RESOURCES-TYPES.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2790
+
+RMON-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2819
+
+NETWORK-SERVICES-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2788
+
+MTA-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 2789
+
+RFC1155-SMI.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 1155
+
+RFC1213-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 1213
+
+SCTP-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 3873
+
+BRIDGE-MIB.txt: $(MIBDEPS)
+ ./mibfetch $(RFCHOST) $(RFCDIR) 4188
+
+ianamibs: ianalist
+ [ -d $(ALLDIR) ] || mkdir $(ALLDIR)
+ cat ianalist | while read file mibs; \
+ do \
+ if [ "$$file" != "#" ]; \
+ then \
+ ./mibfetch -d $(ALLDIR) -x $(IANAHOST) $(IANADIR) $$file $$mibs; \
+ fi; \
+ done
+
+rfcmibs: rfclist
+ [ -d $(ALLDIR) ] || mkdir $(ALLDIR)
+ cat rfclist | while read rfc mibs; \
+ do \
+ if [ "$$rfc" != "#" ]; \
+ then \
+ ./mibfetch -d $(ALLDIR) $(RFCHOST) $(RFCDIR) $$rfc $$mibs; \
+ fi; \
+ done
diff --git a/mibs/NET-SNMP-AGENT-MIB.txt b/mibs/NET-SNMP-AGENT-MIB.txt
new file mode 100644
index 0000000..0659881
--- /dev/null
+++ b/mibs/NET-SNMP-AGENT-MIB.txt
@@ -0,0 +1,554 @@
+NET-SNMP-AGENT-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Defines control and monitoring structures for the Net-SNMP agent.
+--
+
+IMPORTS
+ SnmpAdminString
+ FROM SNMP-FRAMEWORK-MIB
+
+ netSnmpObjects, netSnmpModuleIDs, netSnmpNotifications, netSnmpGroups
+ FROM NET-SNMP-MIB
+
+ OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY, Integer32, Unsigned32
+ FROM SNMPv2-SMI
+
+ OBJECT-GROUP, NOTIFICATION-GROUP
+ FROM SNMPv2-CONF
+
+ TEXTUAL-CONVENTION, DisplayString, RowStatus, TruthValue
+ FROM SNMPv2-TC;
+
+
+netSnmpAgentMIB MODULE-IDENTITY
+ LAST-UPDATED "201003170000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Defines control and monitoring structures for the Net-SNMP agent."
+ REVISION "201003170000Z"
+ DESCRIPTION
+ "Made sure that this MIB can be compiled by MIB compilers that do not
+ recognize a double dash as end-of-comments."
+ REVISION "200502070000Z"
+ DESCRIPTION
+ "Fixing syntax errors"
+ REVISION "200202090000Z"
+ DESCRIPTION
+ "First revision."
+ ::= { netSnmpModuleIDs 2 }
+
+
+nsVersion OBJECT IDENTIFIER ::= {netSnmpObjects 1}
+nsMibRegistry OBJECT IDENTIFIER ::= {netSnmpObjects 2}
+nsExtensions OBJECT IDENTIFIER ::= {netSnmpObjects 3}
+nsDLMod OBJECT IDENTIFIER ::= {netSnmpObjects 4}
+nsCache OBJECT IDENTIFIER ::= {netSnmpObjects 5}
+nsErrorHistory OBJECT IDENTIFIER ::= {netSnmpObjects 6}
+nsConfiguration OBJECT IDENTIFIER ::= {netSnmpObjects 7}
+nsTransactions OBJECT IDENTIFIER ::= {netSnmpObjects 8}
+
+--
+-- MIB Module data caching management
+--
+
+NetsnmpCacheStatus ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION "an indication of the status of data caching entries"
+ SYNTAX INTEGER {
+ enabled(1),
+ disabled(2),
+ empty (3),
+ cached (4),
+ expired(5)
+ }
+
+nsCacheDefaultTimeout OBJECT-TYPE
+ SYNTAX INTEGER -- ???
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Default cache timeout value (unless overridden
+ for a particular cache entry)."
+ DEFVAL { 5 } --seconds--
+ ::= { nsCache 1 }
+
+nsCacheEnabled OBJECT-TYPE
+ SYNTAX TruthValue
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Whether data caching is active overall."
+ DEFVAL { true }
+ ::= { nsCache 2 }
+
+nsCacheTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NsCacheEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of individual MIB module data caches."
+ ::= { nsCache 3 }
+
+nsCacheEntry OBJECT-TYPE
+ SYNTAX NsCacheEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A conceptual row within the cache table."
+ INDEX { IMPLIED nsCachedOID }
+ ::= { nsCacheTable 1 }
+
+NsCacheEntry ::= SEQUENCE {
+ nsCachedOID OBJECT IDENTIFIER,
+ nsCacheTimeout INTEGER, -- ?? TimeTicks ??
+ nsCacheStatus NetsnmpCacheStatus -- ?? INTEGER ??
+}
+
+nsCachedOID OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The root OID of the data being cached."
+ ::= { nsCacheEntry 1 }
+
+nsCacheTimeout OBJECT-TYPE
+ SYNTAX INTEGER
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The length of time (?in seconds) for which the data in
+ this particular cache entry will remain valid."
+ ::= { nsCacheEntry 2 }
+
+nsCacheStatus OBJECT-TYPE
+ SYNTAX NetsnmpCacheStatus
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The current status of this particular cache entry.
+ Acceptable values for Set requests are 'enabled(1)',
+ 'disabled(2)' or 'empty(3)' (to clear all cached data).
+ Requests to read the value of such an object will
+ return 'disabled(2)' through to 'expired(5)'."
+ ::= { nsCacheEntry 3 }
+
+--
+-- Agent configuration
+-- Debug and logging output
+--
+
+nsConfigDebug OBJECT IDENTIFIER ::= {nsConfiguration 1}
+nsConfigLogging OBJECT IDENTIFIER ::= {nsConfiguration 2}
+
+nsDebugEnabled OBJECT-TYPE
+ SYNTAX TruthValue
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Whether the agent is configured to generate debugging output"
+ DEFVAL { false }
+ ::= { nsConfigDebug 1 }
+
+nsDebugOutputAll OBJECT-TYPE
+ SYNTAX TruthValue
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Whether the agent is configured to display all debugging output
+ rather than filtering on individual debug tokens. Nothing will
+ be generated unless nsDebugEnabled is also true(1)"
+ DEFVAL { false }
+ ::= { nsConfigDebug 2 }
+
+nsDebugDumpPdu OBJECT-TYPE
+ SYNTAX TruthValue
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Whether the agent is configured to display raw packet dumps.
+ This is unrelated to the nsDebugEnabled setting."
+ DEFVAL { false }
+ ::= { nsConfigDebug 3 }
+
+nsDebugTokenTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NsDebugTokenEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of individual debug tokens, used to control the selection
+ of what debugging output should be produced. This table is only
+ effective if nsDebugOutputAll is false(2), and nothing will
+ be generated unless nsDebugEnabled is also true(1)"
+ ::= { nsConfigDebug 4 }
+
+nsDebugTokenEntry OBJECT-TYPE
+ SYNTAX NsDebugTokenEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A conceptual row within the debug token table."
+ INDEX { IMPLIED nsDebugTokenPrefix }
+ ::= { nsDebugTokenTable 1 }
+
+NsDebugTokenEntry ::= SEQUENCE {
+ nsDebugTokenPrefix DisplayString,
+ nsDebugTokenStatus RowStatus
+}
+
+nsDebugTokenPrefix OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A token prefix for which to generate the corresponding
+ debugging output. Note that debug output will be generated
+ for all registered debug statements sharing this prefix
+ (rather than an exact match). Nothing will be generated
+ unless both nsDebuggingEnabled is set true(1) and the
+ corresponding nsDebugTokenStatus value is active(1)."
+ ::= { nsDebugTokenEntry 2 }
+
+nsDebugTokenStatus OBJECT-TYPE
+ SYNTAX RowStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "Whether to generate debug output for the corresponding debug
+ token prefix. Nothing will be generated unless both
+ nsDebuggingEnabled is true(1) and this instance is active(1).
+ Note that is valid for an instance to be left with the value
+ notInService(2) indefinitely - i.e. the meaning of 'abnormally
+ long' (see RFC 2579, RowStatus) for this table is infinite."
+ ::= { nsDebugTokenEntry 4 }
+
+--
+-- Logging configuration
+--
+
+nsLoggingTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NsLoggingEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of individual logging output destinations, used to control
+ where various levels of output from the agent should be directed."
+ ::= { nsConfigLogging 1 }
+
+nsLoggingEntry OBJECT-TYPE
+ SYNTAX NsLoggingEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A conceptual row within the logging table."
+ INDEX { nsLogLevel, IMPLIED nsLogToken }
+ ::= { nsLoggingTable 1 }
+
+NsLoggingEntry ::= SEQUENCE {
+ nsLogLevel INTEGER,
+ nsLogToken DisplayString,
+ nsLogType INTEGER,
+ nsLogMaxLevel INTEGER,
+ nsLogStatus RowStatus
+}
+
+nsLogLevel OBJECT-TYPE
+ SYNTAX INTEGER {
+ emergency(0),
+ alert (1),
+ critical (2),
+ error (3),
+ warning (4),
+ notice (5),
+ info (6),
+ debug (7)
+ }
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The (minimum) priority level for which this logging entry
+ should be applied."
+ ::= { nsLoggingEntry 1 }
+
+nsLogToken OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A token for which to generate logging entries.
+ Depending on the style of logging, this may either
+ be simply an arbitrary token, or may have some
+ particular meaning (such as the filename to log to)."
+ ::= { nsLoggingEntry 2 }
+
+nsLogType OBJECT-TYPE
+ SYNTAX INTEGER {
+ stdout (1),
+ stderr (2),
+ file (3),
+ syslog (4),
+ callback (5)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The type of logging for this entry."
+ ::= { nsLoggingEntry 3 }
+
+nsLogMaxLevel OBJECT-TYPE
+ SYNTAX INTEGER {
+ emergency(0),
+ alert (1),
+ critical (2),
+ error (3),
+ warning (4),
+ notice (5),
+ info (6),
+ debug (7)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The maximum priority level for which this logging entry
+ should be applied."
+ DEFVAL { emergency }
+ ::= { nsLoggingEntry 4 }
+
+nsLogStatus OBJECT-TYPE
+ SYNTAX RowStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "Whether to generate logging output for this entry.
+ Note that is valid for an instance to be left with the value
+ notInService(2) indefinitely - i.e. the meaning of 'abnormally
+ long' (see RFC 2579, RowStatus) for this table is infinite."
+ ::= { nsLoggingEntry 5 }
+
+--
+-- Monitoring outstanding "transactions"
+-- (i.e. requests sent to AgentX subagents, or proxied agents)
+--
+
+nsTransactionTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NsTransactionEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Lists currently outstanding transactions in the net-snmp agent.
+ This includes requests to AgentX subagents, or proxied SNMP agents."
+ ::= { nsTransactions 1 }
+
+nsTransactionEntry OBJECT-TYPE
+ SYNTAX NsTransactionEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A row describing a given transaction."
+ INDEX { nsTransactionID }
+ ::= {nsTransactionTable 1 }
+
+NsTransactionEntry ::= SEQUENCE {
+ nsTransactionID Unsigned32,
+ nsTransactionMode Integer32
+}
+
+nsTransactionID OBJECT-TYPE
+ SYNTAX Unsigned32 (0..4294967295)
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The internal identifier for a given transaction."
+ ::= { nsTransactionEntry 1 }
+
+nsTransactionMode OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The mode number for the current operation being performed."
+ ::= { nsTransactionEntry 2 }
+
+
+--
+-- Monitoring the MIB modules currently registered in the agent
+-- (an updated version of UCD-SNMP-MIB::mrTable)
+--
+
+nsModuleTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NsModuleEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table displaying all the oid's registered by mib modules in
+ the agent. Since the agent is modular in nature, this lists
+ each module's OID it is responsible for and the name of the module"
+ ::= { nsMibRegistry 1 }
+
+nsModuleEntry OBJECT-TYPE
+ SYNTAX NsModuleEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a registered mib oid."
+ INDEX { nsmContextName, nsmRegistrationPoint,
+ nsmRegistrationPriority }
+ ::= { nsModuleTable 1 }
+
+NsModuleEntry ::= SEQUENCE {
+ nsmContextName SnmpAdminString,
+ nsmRegistrationPoint OBJECT IDENTIFIER,
+ nsmRegistrationPriority INTEGER,
+ nsModuleName DisplayString,
+ nsModuleModes BITS,
+ nsModuleTimeout Integer32
+}
+
+nsmContextName OBJECT-TYPE
+ SYNTAX SnmpAdminString
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The context name the module is registered under."
+ ::= { nsModuleEntry 1 }
+
+nsmRegistrationPoint OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The registry OID of a mib module."
+ ::= { nsModuleEntry 2 }
+
+nsmRegistrationPriority OBJECT-TYPE
+ SYNTAX INTEGER (-2147483648..2147483647)
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The priority of the registered mib module."
+ ::= { nsModuleEntry 3 }
+
+nsModuleName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The module name that registered this OID."
+ ::= { nsModuleEntry 4 }
+
+nsModuleModes OBJECT-TYPE
+ SYNTAX BITS { getAndGetNext(0), set(1), getBulk(2) }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The modes that the particular lower level handler can cope
+ with directly."
+ ::= { nsModuleEntry 5 }
+
+nsModuleTimeout OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The registered timeout. This is only meaningful for handlers
+ that expect to return results at a later date (subagents,
+ etc)"
+ ::= { nsModuleEntry 6 }
+
+
+--
+-- Notifications relating to the basic operation of the agent
+--
+
+nsNotifyStart NOTIFICATION-TYPE
+ STATUS current
+ DESCRIPTION
+ "An indication that the agent has started running."
+ ::= { netSnmpNotifications 1 }
+
+nsNotifyShutdown NOTIFICATION-TYPE
+ STATUS current
+ DESCRIPTION
+ "An indication that the agent is in the process of being shut down."
+ ::= { netSnmpNotifications 2 }
+
+nsNotifyRestart NOTIFICATION-TYPE
+ STATUS current
+ DESCRIPTION
+ "An indication that the agent has been restarted.
+ This does not imply anything about whether the configuration has
+ changed or not (unlike the standard coldStart or warmStart traps)"
+ ::= { netSnmpNotifications 3 }
+
+
+--
+-- Conformance-related definitions
+--
+
+nsModuleGroup OBJECT-GROUP
+ OBJECTS {
+ nsModuleName, nsModuleModes, nsModuleTimeout
+ }
+ STATUS current
+ DESCRIPTION
+ "The objects relating to the list of MIB modules registered
+ with the Net-SNMP agent."
+ ::= { netSnmpGroups 2 }
+
+nsCacheGroup OBJECT-GROUP
+ OBJECTS {
+ nsCacheDefaultTimeout, nsCacheEnabled,
+ nsCacheTimeout, nsCacheStatus
+ }
+ STATUS current
+ DESCRIPTION
+ "The objects relating to data caching in the Net-SNMP agent."
+ ::= { netSnmpGroups 4 }
+
+nsConfigGroups OBJECT IDENTIFIER ::= {netSnmpGroups 7}
+
+nsDebugGroup OBJECT-GROUP
+ OBJECTS {
+ nsDebugEnabled, nsDebugOutputAll, nsDebugDumpPdu,
+ nsDebugTokenStatus
+ }
+ STATUS current
+ DESCRIPTION
+ "The objects relating to debug configuration in the Net-SNMP agent."
+ ::= { nsConfigGroups 1 }
+
+nsLoggingGroup OBJECT-GROUP
+ OBJECTS {
+ nsLogType, nsLogMaxLevel, nsLogStatus
+ }
+ STATUS current
+ DESCRIPTION
+ "The objects relating to logging configuration in the Net-SNMP agent."
+ ::= { nsConfigGroups 2 }
+
+nsTransactionGroup OBJECT-GROUP
+ OBJECTS {
+ nsTransactionMode
+ }
+ STATUS current
+ DESCRIPTION
+ "The objects relating to transaction monitoring in the Net-SNMP agent."
+ ::= { netSnmpGroups 8 }
+
+nsAgentNotifyGroup NOTIFICATION-GROUP
+ NOTIFICATIONS { nsNotifyStart, nsNotifyShutdown, nsNotifyRestart }
+ STATUS current
+ DESCRIPTION
+ "The notifications relating to the basic operation of the Net-SNMP agent."
+ ::= { netSnmpGroups 9 }
+
+
+
+END
diff --git a/mibs/NET-SNMP-EXAMPLES-MIB.txt b/mibs/NET-SNMP-EXAMPLES-MIB.txt
new file mode 100644
index 0000000..3d02c97
--- /dev/null
+++ b/mibs/NET-SNMP-EXAMPLES-MIB.txt
@@ -0,0 +1,285 @@
+NET-SNMP-EXAMPLES-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Example MIB objects for agent module example implementations
+--
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, Integer32,
+ NOTIFICATION-TYPE FROM SNMPv2-SMI
+ SnmpAdminString FROM SNMP-FRAMEWORK-MIB
+ netSnmp FROM NET-SNMP-MIB
+ RowStatus, StorageType FROM SNMPv2-TC
+ InetAddressType, InetAddress FROM INET-ADDRESS-MIB
+;
+
+netSnmpExamples MODULE-IDENTITY
+ LAST-UPDATED "200406150000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Example MIB objects for agent module example implementations"
+ REVISION "200406150000Z"
+ DESCRIPTION
+ "Corrected notification example definitions"
+ REVISION "200202060000Z"
+ DESCRIPTION
+ "First draft"
+ ::= { netSnmp 2 }
+
+--
+-- top level structure
+--
+netSnmpExampleScalars OBJECT IDENTIFIER ::= { netSnmpExamples 1 }
+netSnmpExampleTables OBJECT IDENTIFIER ::= { netSnmpExamples 2 }
+netSnmpExampleNotifications OBJECT IDENTIFIER ::= { netSnmpExamples 3 }
+netSnmpExampleNotificationPrefix OBJECT IDENTIFIER
+ ::= { netSnmpExampleNotifications 0 }
+netSnmpExampleNotificationObjects OBJECT IDENTIFIER
+ ::= { netSnmpExampleNotifications 2 }
+-- netSnmpTutorial OBJECT IDENTIFIER ::= { netSnmpExamples 4 }
+
+--
+-- Example scalars
+--
+
+netSnmpExampleInteger OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "This is a simple object which merely houses a writable
+ integer. It's only purposes is to hold the value of a single
+ integer. Writing to it will simply change the value for
+ subsequent GET/GETNEXT/GETBULK retrievals.
+
+ This example object is implemented in the
+ agent/mibgroup/examples/scalar_int.c file."
+ DEFVAL { 42 }
+ ::= { netSnmpExampleScalars 1 }
+
+netSnmpExampleSleeper OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "This is a simple object which is a basic integer. It's value
+ indicates the number of seconds that the agent will take in
+ responding to requests of this object. This is implemented
+ in a way which will allow the agent to keep responding to
+ other requests while access to this object is blocked. It is
+ writable, and changing it's value will change the amount of
+ time the agent will effectively wait for before returning a
+ response when this object is manipulated. Note that SET
+ requests through this object will take longer, since the
+ delay is applied to each internal transaction phase, which
+ could result in delays of up to 4 times the value of this
+ object.
+
+ This example object is implemented in the
+ agent/mibgroup/examples/delayed_instance.c file."
+ DEFVAL { 1 }
+ ::= { netSnmpExampleScalars 2 }
+
+netSnmpExampleString OBJECT-TYPE
+ SYNTAX SnmpAdminString
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "This is a simple object which merely houses a writable
+ string. It's only purposes is to hold the value of a single
+ string. Writing to it will simply change the value for
+ subsequent GET/GETNEXT/GETBULK retrievals.
+
+ This example object is implemented in the
+ agent/mibgroup/examples/watched.c file."
+ DEFVAL { "So long, and thanks for all the fish!" }
+ ::= { netSnmpExampleScalars 3 }
+
+
+--
+-- Example Tables
+--
+
+netSnmpIETFWGTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NetSnmpIETFWGEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "This table merely contains a set of data which is otherwise
+ useless for true network management. It is a table which
+ describes properies about a IETF Working Group, such as the
+ names of the two working group chairs.
+
+ This example table is implemented in the
+ agent/mibgroup/examples/data_set.c file."
+ ::= { netSnmpExampleTables 1 }
+
+netSnmpIETFWGEntry OBJECT-TYPE
+ SYNTAX NetSnmpIETFWGEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A row describing a given working group"
+ INDEX { nsIETFWGName }
+ ::= {netSnmpIETFWGTable 1 }
+
+NetSnmpIETFWGEntry ::= SEQUENCE {
+ nsIETFWGName OCTET STRING,
+ nsIETFWGChair1 OCTET STRING,
+ nsIETFWGChair2 OCTET STRING
+}
+
+nsIETFWGName OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE(1..32))
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The name of the IETF Working Group this table describes."
+ ::= { netSnmpIETFWGEntry 1 }
+
+nsIETFWGChair1 OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "One of the names of the chairs for the IETF working group."
+ ::= { netSnmpIETFWGEntry 2 }
+
+nsIETFWGChair2 OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The other name, if one exists, of the chairs for the IETF
+ working group."
+ ::= { netSnmpIETFWGEntry 3 }
+
+--
+-- A table used in a table_iterator example
+-- (agent/mibgroup/examples/netSnmpHostsTable*.[ch])
+--
+
+netSnmpHostsTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NetSnmpHostsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An example table that implements a wrapper around the
+ /etc/hosts file on a machine using the iterator helper API."
+ ::= { netSnmpExampleTables 2 }
+
+netSnmpHostsEntry OBJECT-TYPE
+ SYNTAX NetSnmpHostsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A host name mapped to an ip address"
+ INDEX { netSnmpHostName }
+ ::= { netSnmpHostsTable 1 }
+
+NetSnmpHostsEntry ::= SEQUENCE {
+ netSnmpHostName OCTET STRING,
+ netSnmpHostAddressType InetAddressType,
+ netSnmpHostAddress InetAddress,
+ netSnmpHostStorage StorageType,
+ netSnmpHostRowStatus RowStatus
+}
+
+netSnmpHostName OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE(0..64))
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A host name that exists in the /etc/hosts (unix) file."
+ ::= { netSnmpHostsEntry 1 }
+
+netSnmpHostAddressType OBJECT-TYPE
+ SYNTAX InetAddressType
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The address type of then given host."
+ ::= { netSnmpHostsEntry 2 }
+
+netSnmpHostAddress OBJECT-TYPE
+ SYNTAX InetAddress
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The address of then given host."
+ ::= { netSnmpHostsEntry 3 }
+
+netSnmpHostStorage OBJECT-TYPE
+ SYNTAX StorageType
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION "The storage type for this conceptual row."
+ DEFVAL { nonVolatile }
+ ::= { netSnmpHostsEntry 4 }
+
+netSnmpHostRowStatus OBJECT-TYPE
+ SYNTAX RowStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION "The status of this conceptual row."
+ ::= { netSnmpHostsEntry 5 }
+
+
+--
+-- Example Notifications
+--
+
+netSnmpExampleHeartbeatRate OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS accessible-for-notify
+ STATUS current
+ DESCRIPTION
+ "A simple integer object, to act as a payload for the
+ netSnmpExampleHeartbeatNotification. The value has
+ no real meaning, but is nominally the interval (in
+ seconds) between successive heartbeat notifications."
+::= { netSnmpExampleNotificationObjects 1 }
+
+netSnmpExampleHeartbeatName OBJECT-TYPE
+ SYNTAX SnmpAdminString
+ MAX-ACCESS accessible-for-notify
+ STATUS current
+ DESCRIPTION
+ "A simple string object, to act as an optional payload
+ for the netSnmpExampleHeartbeatNotification. This varbind
+ is not part of the notification definition, so is optional
+ and need not be included in the notification payload.
+ The value has no real meaning, but the romantically inclined
+ may take it to be the object of the sender's affection,
+ and hence the cause of the heart beating faster."
+::= { netSnmpExampleNotificationObjects 2 }
+
+netSnmpExampleHeartbeatNotification NOTIFICATION-TYPE
+ OBJECTS { netSnmpExampleHeartbeatRate }
+ STATUS current
+ DESCRIPTION
+ "An example notification, used to illustrate the
+ definition and generation of trap and inform PDUs
+ (including the use of both standard and additional
+ varbinds in the notification payload).
+ This notification will typically be sent every
+ 30 seconds, using the code found in the example module
+ agent/mibgroup/examples/notification.c"
+::= { netSnmpExampleNotificationPrefix 1 }
+
+netSnmpExampleNotification OBJECT-TYPE
+ SYNTAX SnmpAdminString
+ MAX-ACCESS accessible-for-notify
+ STATUS obsolete
+ DESCRIPTION
+ "This object was improperly defined for its original purpose,
+ and should no longer be used."
+::= { netSnmpExampleNotifications 1 }
+
+END
diff --git a/mibs/NET-SNMP-EXTEND-MIB.txt b/mibs/NET-SNMP-EXTEND-MIB.txt
new file mode 100644
index 0000000..2101035
--- /dev/null
+++ b/mibs/NET-SNMP-EXTEND-MIB.txt
@@ -0,0 +1,325 @@
+NET-SNMP-EXTEND-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Defines a framework for scripted extensions
+--
+
+IMPORTS
+ nsExtensions FROM NET-SNMP-AGENT-MIB
+
+ OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY, Integer32
+ FROM SNMPv2-SMI
+
+ OBJECT-GROUP, NOTIFICATION-GROUP
+ FROM SNMPv2-CONF
+
+ DisplayString, RowStatus, StorageType FROM SNMPv2-TC;
+
+
+netSnmpExtendMIB MODULE-IDENTITY
+ LAST-UPDATED "201003170000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Defines a framework for scripted extensions for the Net-SNMP agent."
+ REVISION "201003170000Z"
+ DESCRIPTION
+ "Fixed inconsistencies in the definition of nsExtendConfigTable."
+ REVISION "200405080000Z"
+ DESCRIPTION
+ "First revision."
+ ::= { nsExtensions 1 }
+
+nsExtendObjects OBJECT IDENTIFIER ::= { nsExtensions 2}
+nsExtendGroups OBJECT IDENTIFIER ::= { nsExtensions 3}
+
+nsExtendNumEntries OBJECT-TYPE
+ SYNTAX INTEGER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of rows in the nsExtendConfigTable"
+ ::= { nsExtendObjects 1 }
+
+nsExtendConfigTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NsExtendConfigEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of scripted extensions - configuration and (basic) output."
+ ::= { nsExtendObjects 2 }
+
+nsExtendConfigEntry OBJECT-TYPE
+ SYNTAX NsExtendConfigEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A conceptual row within the extension table."
+ INDEX { nsExtendToken }
+ ::= { nsExtendConfigTable 1 }
+
+NsExtendConfigEntry ::= SEQUENCE {
+ nsExtendToken DisplayString,
+ nsExtendCommand DisplayString,
+ nsExtendArgs DisplayString,
+ nsExtendInput DisplayString,
+ nsExtendCacheTime INTEGER,
+ nsExtendExecType INTEGER,
+ nsExtendRunType INTEGER,
+
+ nsExtendStorage StorageType,
+ nsExtendStatus RowStatus
+}
+
+ --
+ -- The configuration of an extension command
+ --
+
+nsExtendToken OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An arbitrary token to identify this extension entry"
+ ::= { nsExtendConfigEntry 1 }
+
+nsExtendCommand OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The full path of the command binary (or script) to run"
+ ::= { nsExtendConfigEntry 2 }
+
+nsExtendArgs OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "Any command-line arguments for the command"
+ DEFVAL { ''H } -- the empty string
+ ::= { nsExtendConfigEntry 3 }
+
+nsExtendInput OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The standard input for the command"
+ DEFVAL { ''H } -- the empty string
+ ::= { nsExtendConfigEntry 4 }
+
+nsExtendCacheTime OBJECT-TYPE
+ SYNTAX INTEGER
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The length of time for which the output of
+ this command will be cached. During this time,
+ retrieving the output-related values will not
+ reinvoke the command.
+ A value of -1 indicates that the output results
+ should not be cached at all, and retrieving each
+ individual output-related value will invoke the
+ command afresh."
+ DEFVAL { 5 }
+ ::= { nsExtendConfigEntry 5 }
+
+nsExtendExecType OBJECT-TYPE
+ SYNTAX INTEGER
+ { exec (1), -- 'fork-and-exec'
+ shell (2) -- run via a sub-shell
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The mechanism used to invoke the command."
+ DEFVAL { exec }
+ ::= { nsExtendConfigEntry 6 }
+
+nsExtendRunType OBJECT-TYPE
+ SYNTAX INTEGER
+ { run-on-read (1),
+ run-on-set (2),
+ run-command (3)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "Used to implement 'push-button' command invocation.
+ The command for a 'run-on-read' entry will be invoked
+ whenever one of the corresponding output-related
+ instances is requested (and assuming the cached value
+ is not still current).
+ The command for a 'run-on-set' entry will only be invoked
+ on receipt of a SET assignment for this object with the
+ value 'run-command'.
+ Reading an instance of this object will always return either
+ 'run-on-read' or 'run-on-set'.
+ "
+ DEFVAL { run-on-read }
+ ::= { nsExtendConfigEntry 7 }
+
+ --
+ -- Standard table-manipulation objects
+ --
+
+nsExtendStorage OBJECT-TYPE
+ SYNTAX StorageType
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The storage type for this conceptual row."
+ DEFVAL { volatile }
+ ::= { nsExtendConfigEntry 20 }
+
+nsExtendStatus OBJECT-TYPE
+ SYNTAX RowStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "Used to create new rows in the table, in the standard manner.
+ Note that is valid for an instance to be left with the value
+ notInService(2) indefinitely - i.e. the meaning of 'abnormally
+ long' (see RFC 2579, RowStatus) for this table is infinite."
+ ::= { nsExtendConfigEntry 21 }
+
+
+ --
+ -- The results of running the extension command
+ --
+
+nsExtendOutput1Table OBJECT-TYPE
+ SYNTAX SEQUENCE OF NsExtendOutput1Entry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of scripted extensions - configuration and (basic) output."
+ ::= { nsExtendObjects 3 }
+
+nsExtendOutput1Entry OBJECT-TYPE
+ SYNTAX NsExtendOutput1Entry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A conceptual row within the extension table."
+ AUGMENTS { nsExtendConfigEntry }
+ ::= { nsExtendOutput1Table 1 }
+
+NsExtendOutput1Entry ::= SEQUENCE {
+ nsExtendOutput1Line DisplayString,
+ nsExtendOutputFull DisplayString,
+ nsExtendOutNumLines Integer32,
+ nsExtendResult Integer32
+}
+
+nsExtendOutput1Line OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The first line of output from the command"
+ ::= { nsExtendOutput1Entry 1 }
+
+nsExtendOutputFull OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The full output from the command, as a single string"
+ ::= { nsExtendOutput1Entry 2 }
+
+nsExtendOutNumLines OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of lines of output (and hence
+ the number of rows in nsExtendOutputTable
+ relating to this particular entry)."
+ ::= { nsExtendOutput1Entry 3 }
+
+nsExtendResult OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The return value of the command."
+ ::= { nsExtendOutput1Entry 4 }
+
+
+ --
+ -- The line-based output table
+ --
+
+nsExtendOutput2Table OBJECT-TYPE
+ SYNTAX SEQUENCE OF NsExtendOutput2Entry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of (line-based) output from scripted extensions."
+ ::= { nsExtendObjects 4 }
+
+nsExtendOutput2Entry OBJECT-TYPE
+ SYNTAX NsExtendOutput2Entry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A conceptual row within the line-based output table."
+ INDEX { nsExtendToken, nsExtendLineIndex }
+ ::= { nsExtendOutput2Table 1 }
+
+NsExtendOutput2Entry ::= SEQUENCE {
+ nsExtendLineIndex INTEGER,
+ nsExtendOutLine DisplayString
+}
+
+nsExtendLineIndex OBJECT-TYPE
+ SYNTAX INTEGER(1..1024)
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The index of this line of output.
+ For a given nsExtendToken, this will run from
+ 1 to the corresponding value of nsExtendNumLines."
+ ::= { nsExtendOutput2Entry 1 }
+
+nsExtendOutLine OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A single line of output from the extension command."
+ ::= { nsExtendOutput2Entry 2 }
+
+--
+-- Conformance-related definitions
+--
+
+nsExtendConfigGroup OBJECT-GROUP
+ OBJECTS {
+ nsExtendCommand, nsExtendArgs, nsExtendInput,
+ nsExtendCacheTime, nsExtendExecType, nsExtendRunType,
+ nsExtendStorage, nsExtendStatus, nsExtendNumEntries
+ }
+ STATUS current
+ DESCRIPTION
+ "Objects relating to the configuration of extension commands."
+ ::= { nsExtendGroups 1 }
+
+nsExtendOutputGroup OBJECT-GROUP
+ OBJECTS {
+ nsExtendOutNumLines, nsExtendResult,
+ nsExtendOutLine, nsExtendOutput1Line, nsExtendOutputFull
+ }
+ STATUS current
+ DESCRIPTION
+ "Objects relating to the output of extension commands."
+ ::= { nsExtendGroups 2 }
+
+END
diff --git a/mibs/NET-SNMP-MIB.txt b/mibs/NET-SNMP-MIB.txt
new file mode 100644
index 0000000..f7b0fba
--- /dev/null
+++ b/mibs/NET-SNMP-MIB.txt
@@ -0,0 +1,67 @@
+NET-SNMP-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Top-level infrastructure of the Net-SNMP project enterprise MIB tree
+--
+
+IMPORTS
+ MODULE-IDENTITY, enterprises FROM SNMPv2-SMI;
+
+netSnmp MODULE-IDENTITY
+ LAST-UPDATED "200201300000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Top-level infrastructure of the Net-SNMP project enterprise MIB tree"
+ REVISION "200201300000Z"
+ DESCRIPTION
+ "First draft"
+ ::= { enterprises 8072}
+
+
+--
+-- Net-SNMP enterprise-specific management objects
+--
+
+netSnmpObjects OBJECT IDENTIFIER ::= {netSnmp 1}
+-- netSnmpExamples OBJECT IDENTIFIER ::= {netSnmp 2}
+netSnmpEnumerations OBJECT IDENTIFIER ::= {netSnmp 3}
+netSnmpModuleIDs OBJECT IDENTIFIER ::= {netSnmpEnumerations 1}
+netSnmpAgentOIDs OBJECT IDENTIFIER ::= {netSnmpEnumerations 2}
+netSnmpDomains OBJECT IDENTIFIER ::= {netSnmpEnumerations 3}
+netSnmpExperimental OBJECT IDENTIFIER ::= {netSnmp 9999}
+
+--
+-- A subtree specifically designed for private testing purposes.
+-- No "public" management objects should ever be defined within this tree.
+--
+-- It is provided for private experimentation, prior to transferring a MIB
+-- structure to another part of the overall OID tree
+--
+netSnmpPlaypen OBJECT IDENTIFIER ::= {netSnmpExperimental 9999}
+
+
+--
+-- Notifications
+--
+
+netSnmpNotificationPrefix OBJECT IDENTIFIER ::= {netSnmp 4}
+netSnmpNotifications OBJECT IDENTIFIER ::= {netSnmpNotificationPrefix 0}
+netSnmpNotificationObjects OBJECT IDENTIFIER ::= {netSnmpNotificationPrefix 1}
+
+
+--
+-- Conformance
+-- (No laughing at the back!)
+--
+
+netSnmpConformance OBJECT IDENTIFIER ::= {netSnmp 5}
+netSnmpCompliances OBJECT IDENTIFIER ::= {netSnmpConformance 1}
+netSnmpGroups OBJECT IDENTIFIER ::= {netSnmpConformance 2}
+
+END
diff --git a/mibs/NET-SNMP-MONITOR-MIB.txt b/mibs/NET-SNMP-MONITOR-MIB.txt
new file mode 100644
index 0000000..ae79221
--- /dev/null
+++ b/mibs/NET-SNMP-MONITOR-MIB.txt
@@ -0,0 +1,59 @@
+NET-SNMP-MONITOR-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Configured elements of the system to monitor (XXX - ugh! - need a better description!)
+--
+
+IMPORTS
+ netSnmpObjects, netSnmpModuleIDs FROM NET-SNMP-MIB
+
+ OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY, Integer32
+ FROM SNMPv2-SMI
+
+ DisplayString FROM SNMPv2-TC;
+
+
+netSnmpMonitorMIB MODULE-IDENTITY
+ LAST-UPDATED "200202090000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Configured elements of the system to monitor
+ (XXX - ugh! - need a better description!)"
+ REVISION "200202090000Z"
+ DESCRIPTION
+ "First revision."
+ ::= { netSnmpModuleIDs 3}
+
+
+nsProcess OBJECT IDENTIFIER ::= {netSnmpObjects 21}
+nsDisk OBJECT IDENTIFIER ::= {netSnmpObjects 22}
+nsFile OBJECT IDENTIFIER ::= {netSnmpObjects 23}
+nsLog OBJECT IDENTIFIER ::= {netSnmpObjects 24}
+
+--
+-- Process Monitoring
+--
+
+
+--
+-- Disk Monitoring
+--
+
+
+--
+-- File Monitoring
+--
+
+
+--
+-- Log Monitoring
+--
+
+
+END
diff --git a/mibs/NET-SNMP-PASS-MIB.txt b/mibs/NET-SNMP-PASS-MIB.txt
new file mode 100644
index 0000000..93c1a10
--- /dev/null
+++ b/mibs/NET-SNMP-PASS-MIB.txt
@@ -0,0 +1,124 @@
+NET-SNMP-PASS-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Example MIB objects for "pass" and "pass-persist" extension script
+--
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, TimeTicks, IpAddress,
+ Counter32, Gauge32, Integer32 FROM SNMPv2-SMI
+ SnmpAdminString FROM SNMP-FRAMEWORK-MIB
+ netSnmpExamples FROM NET-SNMP-EXAMPLES-MIB
+;
+
+netSnmpPassExamples MODULE-IDENTITY
+ LAST-UPDATED "200905280000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Example MIB objects for pass/pass-persist extension script"
+ ::= { netSnmpExamples 255 }
+
+--
+-- Example scalars
+--
+
+netSnmpPassString OBJECT-TYPE
+ SYNTAX SnmpAdminString
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION "Example string scalar object."
+ DEFVAL { "Life, the Universe, and Everything" }
+ ::= { netSnmpPassExamples 1 }
+
+netSnmpPassTimeTicks OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION "Example timetick object."
+ DEFVAL { 363136200 } -- 42 days, 0:42:42.00
+ ::= { netSnmpPassExamples 3 }
+
+netSnmpPassIpAddress OBJECT-TYPE
+ SYNTAX IpAddress
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION "Example IP Address object."
+ DEFVAL { '7f000001'H } -- 127.0.0.1
+ ::= { netSnmpPassExamples 4 }
+
+netSnmpPassCounter OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Example counter object.
+ Note that this object will always return the value '42'."
+ ::= { netSnmpPassExamples 5 }
+
+netSnmpPassGauge OBJECT-TYPE
+ SYNTAX Gauge32
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION "Example Gauge object."
+ DEFVAL { 42 }
+ ::= { netSnmpPassExamples 6 }
+
+
+netSnmpPassOIDValue OBJECT IDENTIFIER
+ ::= { netSnmpPassExamples 99 }
+
+--
+-- Example Table
+--
+
+netSnmpPassTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NetSnmpPassEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Example table"
+ ::= { netSnmpPassExamples 2 }
+
+netSnmpPassEntry OBJECT-TYPE
+ SYNTAX NetSnmpPassEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Conceptual row in the example table."
+ INDEX { netSnmpPassIndex }
+ ::= {netSnmpPassTable 1 }
+
+NetSnmpPassEntry ::= SEQUENCE {
+ netSnmpPassIndex Integer32,
+ netSnmpPassInteger Integer32,
+ netSnmpPassOID OBJECT IDENTIFIER
+}
+
+netSnmpPassIndex OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Arbitrary index into the netSnmpPassTable.
+ Note that there will always be one row, with index 1"
+ ::= { netSnmpPassEntry 1 }
+
+netSnmpPassInteger OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION "Example Integer (table) object."
+ DEFVAL { 42 }
+ ::= { netSnmpPassEntry 2 }
+
+netSnmpPassOID OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION "Example OID (table) object."
+ DEFVAL { netSnmpPassOIDValue }
+ ::= { netSnmpPassEntry 3 }
+
+END
diff --git a/mibs/NET-SNMP-PERIODIC-NOTIFY-MIB.txt b/mibs/NET-SNMP-PERIODIC-NOTIFY-MIB.txt
new file mode 100644
index 0000000..83eacad
--- /dev/null
+++ b/mibs/NET-SNMP-PERIODIC-NOTIFY-MIB.txt
@@ -0,0 +1,83 @@
+NET-SNMP-PERIODIC-NOTIFY-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Objects for periodic notifications containing data payloads
+--
+
+IMPORTS
+ netSnmpModuleIDs, netSnmpObjects, netSnmpNotifications FROM NET-SNMP-MIB
+
+ OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY, Integer32, Unsigned32
+ FROM SNMPv2-SMI
+
+ DisplayString FROM SNMPv2-TC;
+
+
+netSnmpPeriodicNotifyMib MODULE-IDENTITY
+ LAST-UPDATED "201104200000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Objects for periodic notifications containing data payloads"
+ REVISION "201104200000Z"
+ DESCRIPTION
+ "First revision."
+ ::= { netSnmpModuleIDs 5 }
+
+nsPNScalars OBJECT IDENTIFIER ::= {netSnmpPeriodicNotifyMib 1}
+nsPNTables OBJECT IDENTIFIER ::= {netSnmpPeriodicNotifyMib 2}
+nsPNotifyObjects OBJECT IDENTIFIER ::= {netSnmpPeriodicNotifyMib 3}
+nsPNotificationPrefix OBJECT IDENTIFIER ::= {netSnmpPeriodicNotifyMib 4}
+nsPNotifications OBJECT IDENTIFIER ::= {nsPNotificationPrefix 0}
+nsPNotificationObjects OBJECT IDENTIFIER ::= {nsPNotificationPrefix 1}
+
+--
+-- Notification Definitions
+--
+
+nsNotifyPeriodicNotification NOTIFICATION-TYPE
+ STATUS current
+ DESCRIPTION
+ "Data delivery notification from a configured list of periodic
+ data sets to deliver. See the snmpd.conf manual page for
+ details about configuring Net-SNMP agents for sending these
+ notifications out on a regular basis."
+ ::= { nsPNotifications 1 }
+
+--
+-- Objects that can be put into the notifications
+--
+
+nsPNPeriodicTime OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS accessible-for-notify
+ STATUS current
+ DESCRIPTION
+ "The number of seconds between notifications containing this data set."
+ ::= { nsPNotifyObjects 1 }
+
+nsPNotifyMessageNumber OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS accessible-for-notify
+ STATUS current
+ DESCRIPTION
+ "Indicates this is the Nth notification in a longer sequence
+ of notifications"
+ ::= { nsPNotifyObjects 2 }
+
+nsPNotifyMaxMessageNumber OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS accessible-for-notify
+ STATUS current
+ DESCRIPTION
+ "The maximum number of messages this notification sequence
+ will contain."
+ ::= { nsPNotifyObjects 3 }
+
+
+END
diff --git a/mibs/NET-SNMP-SYSTEM-MIB.txt b/mibs/NET-SNMP-SYSTEM-MIB.txt
new file mode 100644
index 0000000..c5cf6f3
--- /dev/null
+++ b/mibs/NET-SNMP-SYSTEM-MIB.txt
@@ -0,0 +1,63 @@
+NET-SNMP-SYSTEM-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Characteristics of the current running system
+--
+
+IMPORTS
+ netSnmpObjects, netSnmpModuleIDs FROM NET-SNMP-MIB
+
+ Float FROM NET-SNMP-TC
+
+ OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY, Integer32, Counter32
+ FROM SNMPv2-SMI
+
+ DisplayString FROM SNMPv2-TC;
+
+
+netSnmpSystemMIB MODULE-IDENTITY
+ LAST-UPDATED "200202090000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Characteristics of the current running system"
+ REVISION "200202090000Z"
+ DESCRIPTION
+ "First draft."
+ ::= { netSnmpModuleIDs 4}
+
+
+nsMemory OBJECT IDENTIFIER ::= {netSnmpObjects 31}
+nsSwap OBJECT IDENTIFIER ::= {netSnmpObjects 32}
+nsCPU OBJECT IDENTIFIER ::= {netSnmpObjects 33}
+nsLoad OBJECT IDENTIFIER ::= {netSnmpObjects 34}
+nsDiskIO OBJECT IDENTIFIER ::= {netSnmpObjects 35}
+
+
+--
+-- Memory
+--
+
+--
+-- Swap
+--
+
+--
+-- CPU Statistics
+--
+
+--
+-- Load Average
+--
+
+--
+-- Disk IO
+--
+
+
+END
diff --git a/mibs/NET-SNMP-TC.txt b/mibs/NET-SNMP-TC.txt
new file mode 100644
index 0000000..46f7302
--- /dev/null
+++ b/mibs/NET-SNMP-TC.txt
@@ -0,0 +1,128 @@
+NET-SNMP-TC DEFINITIONS ::= BEGIN
+
+--
+-- Textual conventions and enumerations for the Net-SNMP project
+--
+
+IMPORTS
+ netSnmpModuleIDs, netSnmpAgentOIDs, netSnmpDomains FROM NET-SNMP-MIB
+
+ MODULE-IDENTITY, Opaque FROM SNMPv2-SMI
+
+ TEXTUAL-CONVENTION FROM SNMPv2-TC;
+
+netSnmpTCs MODULE-IDENTITY
+ LAST-UPDATED "200510140000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Textual conventions and enumerations for the Net-SNMP project"
+ REVISION "200202120000Z"
+ DESCRIPTION
+ "First draft"
+ ::= { netSnmpModuleIDs 1}
+
+
+-- =====================
+--
+-- Textual Conventions
+--
+-- =====================
+
+--
+-- Define the Float Textual Convention
+-- This definition was written by David Perkins.
+--
+
+Float ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "A single precision floating-point number. The semantics
+ and encoding are identical for type 'single' defined in
+ IEEE Standard for Binary Floating-Point,
+ ANSI/IEEE Std 754-1985.
+ The value is restricted to the BER serialization of
+ the following ASN.1 type:
+ FLOATTYPE ::= [120] IMPLICIT FloatType
+ (note: the value 120 is the sum of '30'h and '48'h)
+ The BER serialization of the length for values of
+ this type must use the definite length, short
+ encoding form.
+
+ For example, the BER serialization of value 123
+ of type FLOATTYPE is '9f780442f60000'h. (The tag
+ is '9f78'h; the length is '04'h; and the value is
+ '42f60000'h.) The BER serialization of value
+ '9f780442f60000'h of data type Opaque is
+ '44079f780442f60000'h. (The tag is '44'h; the length
+ is '07'h; and the value is '9f780442f60000'h.)"
+ SYNTAX Opaque (SIZE (7))
+
+
+-- =====================
+--
+-- Enumerations
+--
+-- =====================
+
+--
+-- System Object ID values
+--
+-- XXX - do we want to distinguish between O/S versions ?
+-- (as is currently done with HP-UX)
+--
+
+hpux9 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 1 }
+sunos4 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 2 }
+solaris OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 3 }
+osf OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 4 }
+ultrix OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 5 }
+hpux10 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 6 }
+netbsd OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 7 }
+freebsd OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 8 }
+irix OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 9 }
+linux OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 10 }
+bsdi OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 11 }
+openbsd OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 12 }
+win32 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 13 } -- unlucky
+hpux11 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 14 }
+aix OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 15 }
+macosx OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 16 }
+dragonfly OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 17 }
+unknown OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 255 }
+
+
+
+--
+-- Transport Domains
+--
+-- Object identifiers for the non-standard transports that UCD/Net-SNMP
+-- supports. Note that snmpTCPDomain is the subject of Internet Draft
+-- draft-irtf-nmrg-snmp-tcp-06.txt, which defines the OID
+-- .iso.org.dod.internet.experimental.nmrg.nmrgSnmpDomains.snmpTCPDomain
+-- (.1.3.6.1.3.91.1.1) for the SNMP over TCP over IPv4 transport domain.
+-- This draft (or its successor) is available from the Network Management
+-- Research Group web page at http://www.ibr.cs.tu-bs.de/projects/nmrg/
+--
+-- The NMRG OID for snmpTCPDomain is currently used by the code, but in case
+-- this is thought to be a Bad Idea, we define a private transport domain here
+-- that we could use instead. The Unix domain, AAL5 PVC domain and
+-- the IPv6 domains are also defined privately here (for now).
+
+netSnmpTCPDomain OBJECT IDENTIFIER ::= { netSnmpDomains 1 } -- obsolete
+netSnmpUnixDomain OBJECT IDENTIFIER ::= { netSnmpDomains 2 } -- obsolete
+netSnmpAAL5PVCDomain OBJECT IDENTIFIER ::= { netSnmpDomains 3 }
+netSnmpUDPIPv6Domain OBJECT IDENTIFIER ::= { netSnmpDomains 4 } -- obsolete
+netSnmpTCPIPv6Domain OBJECT IDENTIFIER ::= { netSnmpDomains 5 } -- obsolete
+netSnmpCallbackDomain OBJECT IDENTIFIER ::= { netSnmpDomains 6 }
+netSnmpAliasDomain OBJECT IDENTIFIER ::= { netSnmpDomains 7 }
+netSnmpDTLSUDPDomain OBJECT IDENTIFIER ::= { netSnmpDomains 8 }
+netSnmpDTLSSCTPDomain OBJECT IDENTIFIER ::= { netSnmpDomains 9 }
+netSnmpTLSTCPDomain OBJECT IDENTIFIER ::= { netSnmpDomains 10 }
+
+END
diff --git a/mibs/NET-SNMP-VACM-MIB.txt b/mibs/NET-SNMP-VACM-MIB.txt
new file mode 100644
index 0000000..7bdb499
--- /dev/null
+++ b/mibs/NET-SNMP-VACM-MIB.txt
@@ -0,0 +1,154 @@
+NET-SNMP-VACM-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Defines Net-SNMP extensions to the standard VACM view table.
+--
+
+IMPORTS
+ SnmpAdminString
+ FROM SNMP-FRAMEWORK-MIB
+
+ netSnmpObjects, netSnmpGroups
+ FROM NET-SNMP-MIB
+
+ vacmGroupName, vacmAccessContextPrefix, vacmAccessSecurityModel,
+ vacmAccessSecurityLevel
+ FROM SNMP-VIEW-BASED-ACM-MIB
+
+ OBJECT-TYPE, MODULE-IDENTITY
+ FROM SNMPv2-SMI
+
+ OBJECT-GROUP, NOTIFICATION-GROUP
+ FROM SNMPv2-CONF
+
+ TEXTUAL-CONVENTION, DisplayString, RowStatus, StorageType
+ FROM SNMPv2-TC;
+
+
+netSnmpVacmMIB MODULE-IDENTITY
+ LAST-UPDATED "200608270000Z"
+ ORGANIZATION "www.net-snmp.org"
+ CONTACT-INFO
+ "postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net"
+ DESCRIPTION
+ "Defines Net-SNMP extensions to the standard VACM view table."
+ REVISION "200608270000Z"
+ DESCRIPTION
+ "First draft"
+ ::= { netSnmpObjects 9 }
+
+
+nsVacmAccessTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NsVacmAccessEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Net-SNMP extensions to vacmAccessTable."
+ ::= { netSnmpVacmMIB 1 }
+
+nsVacmAccessEntry OBJECT-TYPE
+ SYNTAX NsVacmAccessEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Net-SNMP extensions to vacmAccessTable."
+ INDEX { vacmGroupName,
+ vacmAccessContextPrefix,
+ vacmAccessSecurityModel,
+ vacmAccessSecurityLevel,
+ nsVacmAuthType
+ }
+ ::= { nsVacmAccessTable 1 }
+
+NsVacmAccessEntry ::= SEQUENCE
+ {
+ nsVacmAuthType SnmpAdminString,
+ nsVacmContextMatch INTEGER,
+ nsVacmViewName SnmpAdminString,
+ nsVacmStorageType StorageType,
+ nsVacmStatus RowStatus
+ }
+
+nsVacmAuthType OBJECT-TYPE
+ SYNTAX SnmpAdminString (SIZE(0..32))
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "The type of processing that the specified view
+ should be applied to. See 'snmpd.conf(5)' and
+ 'snmptrapd.conf(5)' for details."
+ ::= { nsVacmAccessEntry 1 }
+
+nsVacmContextMatch OBJECT-TYPE
+ SYNTAX INTEGER
+ { exact (1), -- exact match of prefix and contextName
+ prefix (2) -- Only match to the prefix
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION "If the value of this object is exact(1), then all
+ rows where the contextName exactly matches
+ vacmAccessContextPrefix are selected.
+
+ If the value of this object is prefix(2), then all
+ rows where the contextName whose starting octets
+ exactly match vacmAccessContextPrefix are selected.
+ This allows for a simple form of wildcarding.
+
+ The value of this object should be consistent across
+ all nsVacmAccessEntries corresponding to a single
+ row of the vacmAccessTable.
+ "
+ DEFVAL { exact }
+ ::= { nsVacmAccessEntry 2 }
+
+nsVacmViewName OBJECT-TYPE
+ SYNTAX SnmpAdminString (SIZE(0..32))
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION "The MIB view authorised for the appropriate style
+ of processing (as indicated by nsVacmToken).
+
+ The interpretation of this value is the same as for
+ the standard VACM ViewName objects."
+ DEFVAL { ''H } -- the empty string
+ ::= { nsVacmAccessEntry 3 }
+
+
+nsVacmStorageType OBJECT-TYPE
+ SYNTAX StorageType
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION "The storage type for this (group of) conceptual rows.
+
+ Conceptual rows having the value 'permanent' need not
+ allow write-access to any columnar objects in the row.
+
+ The value of this object should be consistent across
+ all nsVacmAccessEntries corresponding to a single
+ row of the vacmAccessTable.
+ "
+ DEFVAL { nonVolatile }
+ ::= { nsVacmAccessEntry 4 }
+
+nsVacmStatus OBJECT-TYPE
+ SYNTAX RowStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION "The status of this (group of) conceptual rows.
+
+ The RowStatus TC [RFC2579] 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.
+
+ The value of this object should be consistent across
+ all nsVacmAccessEntries corresponding to a single
+ row of the vacmAccessTable.
+ "
+ ::= { nsVacmAccessEntry 5 }
+
+END
diff --git a/mibs/README.mibs b/mibs/README.mibs
new file mode 100644
index 0000000..37fa54c
--- /dev/null
+++ b/mibs/README.mibs
@@ -0,0 +1,47 @@
+About the MIBS distributed with Net-SNMP.
+
+This directory contains a very basic set of MIB files, ready for use.
+In addition, there are some scripts and table files to help you get a
+fuller collection of MIB files.
+
+smistrip - a script that can extract a MIB file from an RFC (or I-D)
+mibfetch - a script that will fetch an RFC file from a mirror, and extract
+ the hosted MIB from it. It assumes that you have wget installed.
+rfclist - a list of RFC numbers and corresponding MIB name(s)
+ianalist - a list of files at the IANA server that holds IANA maintained
+ MIBs
+Makefile.mib - rules for extracting current MIB files from RFC and IANA
+ files.
+rfcmibs.diff - a set of required patches for MIB files extracted from RFCs
+
+The file Makefile.mib holds rules that fetch and extract MIB files from
+their hosting RFCs. Make will use wget to retrieve the RFC files, and,
+as I am located in Denmark, use the RFC mirror at NORDUnet. You may change
+that at the top of Makefile.mib.
+
+Makefile.mib also holds rules that will collect all the current IETF MIB
+definitions, using the lists in rfclist and ianalist. To get them all,
+use
+ make -f Makefile.mib allmibs
+
+Note, that there are a few fatal syntactic errors in some of the RFC
+definitions. To make them all parse successfully with the Net-SNMP parser,
+you should apply the patches in the file rfcmibs.diff. These patches are
+typical for the problems that are commonly seen with MIB files from various
+sources:
+
+- forgetting to import enterprises/mib-2/transmission from SNMPv2-SMI
+- thinking that a -- comment ends at end-of-line, not at the next --
+- using _ in identifiers. A - may be used in its place
+- various misspellings
+
+There is a short-cut rule
+ make -f Makefile.mib rfc
+that will also apply the patches. Note that Makefile.mib and smistrip has
+configurable versions of awk and patch. If you are running Solaris you
+must set these to nawk and gpatch respectively.
+
+DISCLAIMER: The patches provided here for the IETF standard MIB files
+are not endorsed by anyone, and I don't guarantee that they bring them
+accordance with what the authors intended. All I will promise, is that
+the MIB files can be parsed.
diff --git a/mibs/UCD-DEMO-MIB.inc b/mibs/UCD-DEMO-MIB.inc
new file mode 100644
index 0000000..0bb9566
--- /dev/null
+++ b/mibs/UCD-DEMO-MIB.inc
@@ -0,0 +1,11 @@
+-- input include file for smicng.
+
+#condInclude "SNMPv2-SMI.inc" -- SNMPv2-SMI (SNMPv2 SMI)
+#condInclude "SNMPv2-TC.inc" -- SNMPv2-TC (SNMPv2 TC macro and base TCs)
+#condInclude "UCD-SNMP-MIB.inc"
+
+#pushOpt
+#addOpt "CM"
+#condInclude "UCD-DEMO-MIB.txt"
+#popOpt
+
diff --git a/mibs/UCD-DEMO-MIB.txt b/mibs/UCD-DEMO-MIB.txt
new file mode 100644
index 0000000..c3b566d
--- /dev/null
+++ b/mibs/UCD-DEMO-MIB.txt
@@ -0,0 +1,74 @@
+UCD-DEMO-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, Integer32 FROM SNMPv2-SMI
+ ucdavis FROM UCD-SNMP-MIB;
+
+ucdDemoMIB MODULE-IDENTITY
+ LAST-UPDATED "9912090000Z"
+ ORGANIZATION "University of California, Davis"
+ CONTACT-INFO
+ "This mib is no longer being maintained by the University of
+ California and is now in life-support-mode and being
+ maintained by the net-snmp project. The best place to write
+ for public questions about the net-snmp-coders mailing list
+ at net-snmp-coders@lists.sourceforge.net.
+
+ postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net
+ "
+ DESCRIPTION
+ "The UCD-SNMP Demonstration MIB."
+ REVISION "9912090000Z"
+ DESCRIPTION
+ "SMIv2 version converted from older MIB definitions."
+ ::= { ucdavis 14 }
+
+ucdDemoMIBObjects OBJECT IDENTIFIER ::= { ucdDemoMIB 1 }
+
+ucdDemoPublic OBJECT IDENTIFIER ::= { ucdDemoMIBObjects 1 }
+
+ucdDemoResetKeys OBJECT-TYPE
+ SYNTAX Integer32 (0..2147483647)
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "A set of value 1 to this object resets the
+ demonstration user's auth and priv keys to the
+ keys based on the P->Ku->Kul transformation of the
+ value of the ucdDemoPasspharse object.
+
+ Values other than 1 are ignored."
+ ::= { ucdDemoPublic 1 }
+
+ucdDemoPublicString OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE(0..1024))
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "A publicly settable string that can be set for testing
+ snmpsets. This value has no real usage other than
+ testing purposes."
+ ::= { ucdDemoPublic 2 }
+
+ucdDemoUserList OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The list of users affected by the ucdDemoResetKeys object."
+ ::= { ucdDemoPublic 3 }
+
+ucdDemoPassphrase OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The demo passphrase that ucdDemoResetKeys changes each
+ users localized key to based on the P->Ku->Kul transformation."
+ ::= { ucdDemoPublic 4 }
+
+END
diff --git a/mibs/UCD-DISKIO-MIB.inc b/mibs/UCD-DISKIO-MIB.inc
new file mode 100644
index 0000000..8f96cca
--- /dev/null
+++ b/mibs/UCD-DISKIO-MIB.inc
@@ -0,0 +1,11 @@
+-- input include file for smicng.
+
+#condInclude "SNMPv2-SMI.inc" -- SNMPv2-SMI (SNMPv2 SMI)
+#condInclude "SNMPv2-TC.inc" -- SNMPv2-TC (SNMPv2 TC macro and base TCs)
+#condInclude "UCD-SNMP-MIB.inc"
+
+#pushOpt
+#addOpt "CM"
+#condInclude "UCD-DISKIO-MIB.txt"
+#popOpt
+
diff --git a/mibs/UCD-DISKIO-MIB.txt b/mibs/UCD-DISKIO-MIB.txt
new file mode 100644
index 0000000..ba9e4db
--- /dev/null
+++ b/mibs/UCD-DISKIO-MIB.txt
@@ -0,0 +1,171 @@
+UCD-DISKIO-MIB DEFINITIONS ::= BEGIN
+
+--
+-- Derived from the original VEST-INTERNETT-MIB. Open issues:
+--
+-- (a) where to register this MIB?
+-- (b) use not-accessible for diskIOIndex?
+--
+
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, Integer32, Counter32, Counter64
+ FROM SNMPv2-SMI
+ DisplayString
+ FROM SNMPv2-TC
+ ucdExperimental
+ FROM UCD-SNMP-MIB;
+
+ucdDiskIOMIB MODULE-IDENTITY
+ LAST-UPDATED "200504200000Z"
+ ORGANIZATION "University of California, Davis"
+ CONTACT-INFO
+ "This mib is no longer being maintained by the University of
+ California and is now in life-support-mode and being
+ maintained by the net-snmp project. The best place to write
+ for public questions about the net-snmp-coders mailing list
+ at net-snmp-coders@lists.sourceforge.net.
+
+ postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net
+ "
+ DESCRIPTION
+ "This MIB module defines objects for disk IO statistics."
+
+ REVISION "200504200000Z"
+ DESCRIPTION
+ "Add 64 bit counters. Patch from Dan Nelson."
+
+ REVISION "200202130000Z"
+ DESCRIPTION
+ "Add 1, 5 and 15-minute load average objects"
+
+ REVISION "200001260000Z"
+ DESCRIPTION
+ "SMIv2 version derived from older definitions contained
+ in the VEST-INTERNETT-MIB module."
+ ::= { ucdExperimental 15 }
+
+diskIOTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF DiskIOEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Table of IO devices and how much data they have read/written."
+ ::= { ucdDiskIOMIB 1 }
+
+diskIOEntry OBJECT-TYPE
+ SYNTAX DiskIOEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a device and its statistics."
+ INDEX { diskIOIndex }
+ ::= { diskIOTable 1 }
+
+DiskIOEntry ::= SEQUENCE {
+ diskIOIndex Integer32,
+ diskIODevice DisplayString,
+ diskIONRead Counter32,
+ diskIONWritten Counter32,
+ diskIOReads Counter32,
+ diskIOWrites Counter32,
+ diskIOLA1 Integer32,
+ diskIOLA5 Integer32,
+ diskIOLA15 Integer32,
+ diskIONReadX Counter64,
+ diskIONWrittenX Counter64
+}
+
+diskIOIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each observed device."
+ ::= { diskIOEntry 1 }
+
+diskIODevice OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The name of the device we are counting/checking."
+ ::= { diskIOEntry 2 }
+
+diskIONRead OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of bytes read from this device since boot."
+ ::= { diskIOEntry 3 }
+
+diskIONWritten OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of bytes written to this device since boot."
+ ::= { diskIOEntry 4 }
+
+diskIOReads OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of read accesses from this device since boot."
+ ::= { diskIOEntry 5 }
+
+diskIOWrites OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of write accesses to this device since boot."
+ ::= { diskIOEntry 6 }
+
+diskIOLA1 OBJECT-TYPE
+ SYNTAX Integer32 (0..100)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The 1 minute average load of disk (%)"
+ ::= { diskIOEntry 9 }
+
+diskIOLA5 OBJECT-TYPE
+ SYNTAX Integer32 (0..100)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The 5 minute average load of disk (%)"
+ ::= { diskIOEntry 10 }
+
+diskIOLA15 OBJECT-TYPE
+ SYNTAX Integer32 (0..100)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The 15 minute average load of disk (%)"
+ ::= { diskIOEntry 11 }
+
+diskIONReadX OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of bytes read from this device since boot."
+ ::= { diskIOEntry 12 }
+
+diskIONWrittenX OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of bytes written to this device since boot."
+ ::= { diskIOEntry 13 }
+
+END
diff --git a/mibs/UCD-DLMOD-MIB.inc b/mibs/UCD-DLMOD-MIB.inc
new file mode 100644
index 0000000..21517fa
--- /dev/null
+++ b/mibs/UCD-DLMOD-MIB.inc
@@ -0,0 +1,8 @@
+#condInclude "SNMPv2-SMI.inc" -- SNMPv2-SMI (SNMPv2 SMI)
+#condInclude "SNMPv2-TC.inc" -- SNMPv2-TC (SNMPv2 TC macro and base TCs)
+#condInclude "UCD-SNMP-MIB.inc"
+
+#pushOpt
+#addOpt "CM"
+#condInclude "UCD-DLMOD-MIB.txt"
+#popOpt
diff --git a/mibs/UCD-DLMOD-MIB.txt b/mibs/UCD-DLMOD-MIB.txt
new file mode 100644
index 0000000..50ef82b
--- /dev/null
+++ b/mibs/UCD-DLMOD-MIB.txt
@@ -0,0 +1,124 @@
+UCD-DLMOD-MIB DEFINITIONS ::= BEGIN
+
+-- Why do we have dlmodNextIndex if the dlmodTable is read-write?
+-- What exactly is the dlmodName and dlmodPath?
+-- Should there not be a timestamp associated with dlmodError?
+-- What exactly do the dlmodStatus enumerations mean?
+
+IMPORTS
+ OBJECT-TYPE, MODULE-IDENTITY, Integer32 FROM SNMPv2-SMI
+ DisplayString FROM SNMPv2-TC
+ ucdExperimental FROM UCD-SNMP-MIB;
+
+ucdDlmodMIB MODULE-IDENTITY
+ LAST-UPDATED "200001260000Z"
+ ORGANIZATION "University of California, Davis"
+ CONTACT-INFO
+ "This mib is no longer being maintained by the University of
+ California and is now in life-support-mode and being
+ maintained by the net-snmp project. The best place to write
+ for public questions about the net-snmp-coders mailing list
+ at net-snmp-coders@lists.sourceforge.net.
+
+ postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net
+ "
+ DESCRIPTION
+ "This file defines the MIB objects for dynamic
+ loadable MIB modules."
+
+ REVISION "200001260000Z"
+ DESCRIPTION
+ "Renamed MIB root object"
+
+ REVISION "9912100000Z"
+ DESCRIPTION
+ "SMIv2 version converted from older MIB definitions."
+ ::= { ucdExperimental 14 }
+
+dlmodNextIndex OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The index number of next appropiate unassigned entry
+ in the dlmodTable."
+ ::= { ucdDlmodMIB 1 }
+
+dlmodTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF DlmodEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of dlmodEntry."
+ ::= { ucdDlmodMIB 2 }
+
+dlmodEntry OBJECT-TYPE
+ SYNTAX DlmodEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The parameters of dynamically loaded MIB module."
+ INDEX { dlmodIndex }
+ ::= { dlmodTable 1 }
+
+DlmodEntry ::= SEQUENCE {
+ dlmodIndex Integer32,
+ dlmodName DisplayString,
+ dlmodPath DisplayString,
+ dlmodError DisplayString,
+ dlmodStatus INTEGER
+}
+
+dlmodIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An index that uniqely identifies an entry in the dlmodTable."
+ ::= { dlmodEntry 1 }
+
+dlmodName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The module name."
+ ::= { dlmodEntry 2 }
+
+dlmodPath OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The path of the module executable file."
+ ::= { dlmodEntry 3 }
+
+dlmodError OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The last error from dlmod_load_module."
+ ::= { dlmodEntry 4 }
+
+dlmodStatus OBJECT-TYPE
+ SYNTAX INTEGER {
+ loaded(1),
+ unloaded(2),
+ error(3),
+ load(4),
+ unload(5),
+ create(6),
+ delete(7)
+ }
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The current status of the loaded module."
+ ::= { dlmodEntry 5 }
+
+END
diff --git a/mibs/UCD-IPFILTER-MIB.inc b/mibs/UCD-IPFILTER-MIB.inc
new file mode 100644
index 0000000..6d47159
--- /dev/null
+++ b/mibs/UCD-IPFILTER-MIB.inc
@@ -0,0 +1,8 @@
+#condInclude "SNMPv2-SMI.inc" -- SNMPv2-SMI (SNMPv2 SMI)
+#condInclude "SNMPv2-TC.inc" -- SNMPv2-TC (SNMPv2 TC macro and base TCs)
+#condInclude "UCD-SNMP-MIB.inc"
+
+#pushOpt
+#addOpt "CM"
+#condInclude "UCD-IPFILTER-MIB.txt"
+#popOpt
diff --git a/mibs/UCD-IPFILTER-MIB.txt b/mibs/UCD-IPFILTER-MIB.txt
new file mode 100644
index 0000000..358bbfe
--- /dev/null
+++ b/mibs/UCD-IPFILTER-MIB.txt
@@ -0,0 +1,261 @@
+UCD-IPFILTER-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ OBJECT-TYPE, MODULE-IDENTITY, Counter32, Integer32
+ FROM SNMPv2-SMI
+ ucdExperimental
+ FROM UCD-SNMP-MIB;
+
+ucdIpFilter MODULE-IDENTITY
+ LAST-UPDATED "200001260000Z"
+ ORGANIZATION "University of California, Davis"
+ CONTACT-INFO
+ "This mib is no longer being maintained by the University of
+ California and is now in life-support-mode and being
+ maintained by the net-snmp project. The best place to write
+ for public questions about the net-snmp-coders mailing list
+ at net-snmp-coders@lists.sourceforge.net.
+
+ postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net
+ "
+ DESCRIPTION
+ "This module defines MIB components for reading information
+ from the IP Filter. This would let you only read its rules
+ and counters.
+
+ IP Filter by Darren Reed <darrenr@pobox.com>
+ IP Filter web page URL http://coombs.anu.edu.au/~avalon/
+ ipf-mod.pl module by Yaroslav Terletsky <ts@polynet.lviv.ua>
+ IP Filter UCD-SNMP module URL
+ ftp://ftp.polynet.lviv.ua/pub/UNIX/security/ipf/ucd-snmp-ipf-mod.tgz
+ Yaroslav Terletsky <ts@polynet.lviv.ua>"
+
+ REVISION "200001260000Z"
+ DESCRIPTION
+ "Renamed MIB root object"
+
+ REVISION "9912150000Z"
+ DESCRIPTION
+ "SMIv2 version converted from an older MIB definition."
+ ::= { ucdExperimental 2 }
+
+ipfInTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF IpfInEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table with IP Filter incoming rules and statistics."
+ ::= { ucdIpFilter 1 }
+
+ipfInEntry OBJECT-TYPE
+ SYNTAX IpfInEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "IP Filter incoming rules table entry."
+ INDEX { ipfInIndex }
+ ::= { ipfInTable 1 }
+
+IpfInEntry ::= SEQUENCE {
+ ipfInIndex Integer32,
+ ipfInRule OCTET STRING,
+ ipfInHits Counter32
+}
+
+ipfInIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each incoming IP Filter rule."
+ ::= { ipfInEntry 1 }
+
+ipfInRule OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Textual representation of the incoming IP Filter rule."
+ ::= { ipfInEntry 2 }
+
+ipfInHits OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Hits of the incoming IP Filter rule."
+ ::= { ipfInEntry 3 }
+
+ipfOutTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF IpfOutEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table with IP Filter outgoing rules and statistic."
+ ::= { ucdIpFilter 2 }
+
+ipfOutEntry OBJECT-TYPE
+ SYNTAX IpfOutEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "IP Filter outgoing rules table entry."
+ INDEX { ipfOutIndex }
+ ::= { ipfOutTable 1 }
+
+IpfOutEntry ::= SEQUENCE {
+ ipfOutIndex Integer32,
+ ipfOutRule OCTET STRING,
+ ipfOutHits Counter32
+}
+
+ipfOutIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each outgoing IP Filter rule."
+ ::= { ipfOutEntry 1 }
+
+ipfOutRule OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Textual representation of the outgoing IP Filter rule."
+ ::= { ipfOutEntry 2 }
+
+ipfOutHits OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Hits of the outgoing IP Filter rule."
+ ::= { ipfOutEntry 3 }
+
+ipfAccInTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF IpfAccInEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table with IP Filter incoming accounting rules
+ and statistics."
+ ::= { ucdIpFilter 3 }
+
+ipfAccInEntry OBJECT-TYPE
+ SYNTAX IpfAccInEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "IP FIlter incoming accounting rules table entry."
+ INDEX { ipfAccInIndex }
+ ::= { ipfAccInTable 1 }
+
+IpfAccInEntry ::= SEQUENCE {
+ ipfAccInIndex Integer32,
+ ipfAccInRule OCTET STRING,
+ ipfAccInHits Counter32,
+ ipfAccInBytes Counter32
+}
+
+ipfAccInIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each incoming accounting
+ IP Filter rule."
+ ::= { ipfAccInEntry 1 }
+
+ipfAccInRule OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Textual representation of the incoming accounting
+ IP Filter rule."
+ ::= { ipfAccInEntry 2 }
+
+ipfAccInHits OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Hits of the incoming accounting IP Filter rule."
+ ::= { ipfAccInEntry 3 }
+
+ipfAccInBytes OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Bytes passed thru the incoming accounting
+ IP Filter rule."
+ ::= { ipfAccInEntry 4 }
+
+ipfAccOutTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF IpfAccOutEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table with IP Filter outgoing accounting rules
+ and statistic."
+ ::= { ucdIpFilter 4 }
+
+ipfAccOutEntry OBJECT-TYPE
+ SYNTAX IpfAccOutEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "IP Filter outgoing accounting rules table entry."
+ INDEX { ipfAccOutIndex }
+ ::= { ipfAccOutTable 1 }
+
+IpfAccOutEntry ::= SEQUENCE {
+ ipfAccOutIndex Integer32,
+ ipfAccOutRule OCTET STRING,
+ ipfAccOutHits Counter32,
+ ipfAccOutBytes Counter32
+}
+
+ipfAccOutIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each outgoing accounting
+ IP Filter rule."
+ ::= { ipfAccOutEntry 1 }
+
+ipfAccOutRule OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Textual representation of the outgoing accounting
+ IP Filter rule."
+ ::= { ipfAccOutEntry 2 }
+
+ipfAccOutHits OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Hits of the outgoing accounting IP Filter rule."
+ ::= { ipfAccOutEntry 3 }
+
+ipfAccOutBytes OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Bytes passed thru the outgoing accounting
+ IP Filter rule."
+ ::= { ipfAccOutEntry 4 }
+
+END
+
diff --git a/mibs/UCD-IPFWACC-MIB.inc b/mibs/UCD-IPFWACC-MIB.inc
new file mode 100644
index 0000000..e57106a
--- /dev/null
+++ b/mibs/UCD-IPFWACC-MIB.inc
@@ -0,0 +1,11 @@
+-- input include file for smicng.
+
+#condInclude "SNMPv2-SMI.inc" -- SNMPv2-SMI (SNMPv2 SMI)
+#condInclude "SNMPv2-TC.inc" -- SNMPv2-TC (SNMPv2 TC macro and base TCs)
+#condInclude "UCD-SNMP-MIB.inc"
+
+#pushOpt
+#addOpt "CM"
+#condInclude "UCD-IPFWACC-MIB.txt"
+#popOpt
+
diff --git a/mibs/UCD-IPFWACC-MIB.txt b/mibs/UCD-IPFWACC-MIB.txt
new file mode 100644
index 0000000..e46d437
--- /dev/null
+++ b/mibs/UCD-IPFWACC-MIB.txt
@@ -0,0 +1,327 @@
+UCD-IPFWACC-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ OBJECT-TYPE, MODULE-IDENTITY, IpAddress, Integer32, Counter32
+ FROM SNMPv2-SMI
+ DisplayString
+ FROM SNMPv2-TC
+ ucdExperimental
+ FROM UCD-SNMP-MIB;
+
+ucdIpFwAccMIB MODULE-IDENTITY
+ LAST-UPDATED "9912160000Z"
+ ORGANIZATION "University of California, Davis"
+ CONTACT-INFO
+ "This mib is no longer being maintained by the University of
+ California and is now in life-support-mode and being
+ maintained by the net-snmp project. The best place to write
+ for public questions about the net-snmp-coders mailing list
+ at net-snmp-coders@lists.sourceforge.net.
+
+ postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net
+ "
+ DESCRIPTION
+ "This module defines MIB components for reading information
+ from the accounting rules IP Firewall. This would typically
+ let you read the rules and the counters. I did not include
+ some flags and fields that I considered irrelevant for the
+ accounting rules. Resetting the counters of the rules by SNMP
+ would be simple, but I don't consider it so useful. I gave no
+ consideration to implementing write access for allowing
+ modification of the accounting rules.
+
+ Cristian.Estan@net.utcluj.ro "
+ REVISION "9912160000Z"
+ DESCRIPTION
+ "SMIv2 version converted from an older MIB definition."
+ ::= { ucdExperimental 1 }
+
+ipFwAccTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF IpFwAccEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table with the accounting rules of the IP firewall"
+ ::= { ucdIpFwAccMIB 1 }
+
+ipFwAccEntry OBJECT-TYPE
+ SYNTAX IpFwAccEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An accounting rule of the IP firewall"
+ INDEX { ipFwAccIndex }
+ ::= { ipFwAccTable 1 }
+
+IpFwAccEntry ::= SEQUENCE {
+ ipFwAccIndex Integer32,
+ ipFwAccSrcAddr IpAddress,
+ ipFwAccSrcNetMask IpAddress,
+ ipFwAccDstAddr IpAddress,
+ ipFwAccDstNetMask IpAddress,
+ ipFwAccViaName DisplayString,
+ ipFwAccViaAddr IpAddress,
+ ipFwAccProto INTEGER,
+ ipFwAccBidir INTEGER,
+ ipFwAccDir INTEGER,
+ ipFwAccBytes Counter32,
+ ipFwAccPackets Counter32,
+ ipFwAccNrSrcPorts Integer32,
+ ipFwAccNrDstPorts Integer32,
+ ipFwAccSrcIsRange INTEGER,
+ ipFwAccDstIsRange INTEGER,
+ ipFwAccPort1 Integer32,
+ ipFwAccPort2 Integer32,
+ ipFwAccPort3 Integer32,
+ ipFwAccPort4 Integer32,
+ ipFwAccPort5 Integer32,
+ ipFwAccPort6 Integer32,
+ ipFwAccPort7 Integer32,
+ ipFwAccPort8 Integer32,
+ ipFwAccPort9 Integer32,
+ ipFwAccPort10 Integer32
+}
+
+ipFwAccIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference index for each firewall rule."
+ ::= { ipFwAccEntry 1 }
+
+ipFwAccSrcAddr OBJECT-TYPE
+ SYNTAX IpAddress
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The source address in the firewall rule."
+ ::= { ipFwAccEntry 2 }
+
+ipFwAccSrcNetMask OBJECT-TYPE
+ SYNTAX IpAddress
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The netmask of the source address in the firewall rule."
+ ::= { ipFwAccEntry 3 }
+
+ipFwAccDstAddr OBJECT-TYPE
+ SYNTAX IpAddress
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The destination address in the firewall rule."
+ ::= { ipFwAccEntry 4 }
+
+ipFwAccDstNetMask OBJECT-TYPE
+ SYNTAX IpAddress
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The netmask of the destination address in the firewall rule."
+ ::= { ipFwAccEntry 5 }
+
+ipFwAccViaName OBJECT-TYPE
+ SYNTAX DisplayString (SIZE(1..64))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The name of the interface to which the rule applies. If no
+ interface is associated with the present rule, this should
+ contain a dash (-)."
+ ::= { ipFwAccEntry 6 }
+
+ipFwAccViaAddr OBJECT-TYPE
+ SYNTAX IpAddress
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The address of the interface to which the rule applies.
+ Using this parameter makes sense when multiple addresses are
+ associated to the same physical interface. If not defined
+ for the current rule this should be set to 0."
+ ::= { ipFwAccEntry 7 }
+
+ipFwAccProto OBJECT-TYPE
+ SYNTAX INTEGER {
+ other(1),
+ all(2),
+ tcp(3),
+ udp(4),
+ icmp(5)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The protocol(s) to which the rule applies."
+ ::= { ipFwAccEntry 8 }
+
+ipFwAccBidir OBJECT-TYPE
+ SYNTAX INTEGER {
+ unidirectional(1),
+ bidirectional(2)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Whether the rule works in both directions (i.e. with the
+ source and destination parts swapped) or not."
+ ::= { ipFwAccEntry 9 }
+
+ipFwAccDir OBJECT-TYPE
+ SYNTAX INTEGER {
+ both(1),
+ in(2),
+ out(3)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Whether the rule applies to packets entering or exiting the
+ kernel."
+ ::= { ipFwAccEntry 10 }
+
+ipFwAccBytes OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of bytes that matched this rule since the last
+ reset of the counters."
+ ::= { ipFwAccEntry 11 }
+
+ipFwAccPackets OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets that matched this rule since the last
+ reset of the counters."
+ ::= { ipFwAccEntry 12 }
+
+ipFwAccNrSrcPorts OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of ports that refer to the source address."
+ ::= { ipFwAccEntry 13 }
+
+ipFwAccNrDstPorts OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of ports that refer to the destination address."
+ ::= { ipFwAccEntry 14 }
+
+ipFwAccSrcIsRange OBJECT-TYPE
+ SYNTAX INTEGER {
+ srchasrange(1),
+ srchasnorange(2)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Interpret the first two ports of the source part as
+ the upper and lower limit of an interval or not."
+ ::= { ipFwAccEntry 15 }
+
+ipFwAccDstIsRange OBJECT-TYPE
+ SYNTAX INTEGER {
+ dsthasrange(1),
+ dsthasnorange(2)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Interpret the first two ports of the destination part as
+ the upper and lower limit of an interval or not."
+ ::= { ipFwAccEntry 16 }
+
+ipFwAccPort1 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 1."
+ ::= { ipFwAccEntry 17 }
+
+ipFwAccPort2 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 2."
+ ::= { ipFwAccEntry 18 }
+
+ipFwAccPort3 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 3."
+ ::= { ipFwAccEntry 19 }
+
+ipFwAccPort4 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 4."
+ ::= { ipFwAccEntry 20 }
+
+ipFwAccPort5 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 5."
+ ::= { ipFwAccEntry 21 }
+
+ipFwAccPort6 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 6."
+ ::= { ipFwAccEntry 22 }
+
+ipFwAccPort7 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 7."
+ ::= { ipFwAccEntry 23 }
+
+ipFwAccPort8 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 8."
+ ::= { ipFwAccEntry 24 }
+
+ipFwAccPort9 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 9."
+ ::= { ipFwAccEntry 25 }
+
+ipFwAccPort10 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Port number 10."
+ ::= { ipFwAccEntry 26 }
+
+END
diff --git a/mibs/UCD-SNMP-MIB-OLD.txt b/mibs/UCD-SNMP-MIB-OLD.txt
new file mode 100644
index 0000000..b432ee3
--- /dev/null
+++ b/mibs/UCD-SNMP-MIB-OLD.txt
@@ -0,0 +1,744 @@
+UCD-SNMP-MIB-OLD DEFINITIONS ::= BEGIN
+
+--
+-- This mib is a badly created mib which has been replaced by a more
+-- properly created UCD-SNMP-MIB. Use that mib instead. This file
+-- exists for historical purposes only and for use by people that
+-- need to support both agent versions.
+--
+
+IMPORTS
+ ucdavis
+ FROM UCD-SNMP-MIB
+ OBJECT-TYPE
+ FROM SNMPv2-SMI
+ DisplayString
+ FROM SNMPv2-TC
+ Integer32
+ FROM SNMPv2-SMI;
+
+-- private OBJECT IDENTIFIER ::= { internet 4 }
+-- enterprises OBJECT IDENTIFIER ::= { private 1 }
+-- ucdavis OBJECT IDENTIFIER ::= { enterprises 2021 }
+-- processes OBJECT IDENTIFIER ::= { ucdavis 1 }
+-- exec OBJECT IDENTIFIER ::= { ucdavis 3 }
+-- memory OBJECT IDENTIFIER ::= { ucdavis 4 }
+-- lockd OBJECT IDENTIFIER ::= { ucdavis 5 }
+-- disk OBJECT IDENTIFIER ::= { ucdavis 6 }
+-- load OBJECT IDENTIFIER ::= { ucdavis 7 }
+-- version OBJECT IDENTIFIER ::= { ucdavis 100 }
+-- snmperrs OBJECT IDENTIFIER ::= { ucdavis 101 }
+-- mibRegistryTable OBJECT IDENTIFIER ::= { ucdavis 102 }
+
+-- These are the returned values of the agent type.
+-- returned to: .iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0
+
+-- The following section is commented out since it is defined in the
+-- current UCD-SNMP-MIB
+
+-- ucdSnmpAgent OBJECT IDENTIFIER ::= { ucdavis 250 }
+-- hpux9 OBJECT IDENTIFIER ::= { ucdSnmpAgent 1 }
+-- hpux10 OBJECT IDENTIFIER ::= { ucdSnmpAgent 6 }
+-- sunos4 OBJECT IDENTIFIER ::= { ucdSnmpAgent 2 }
+-- solaris OBJECT IDENTIFIER ::= { ucdSnmpAgent 3 }
+-- osf OBJECT IDENTIFIER ::= { ucdSnmpAgent 4 }
+-- ultrix OBJECT IDENTIFIER ::= { ucdSnmpAgent 5 }
+-- netbsd1 OBJECT IDENTIFIER ::= { ucdSnmpAgent 7 }
+-- freebsd OBJECT IDENTIFIER ::= { ucdSnmpAgent 8 }
+-- irix OBJECT IDENTIFIER ::= { ucdSnmpAgent 9 }
+-- linux OBJECT IDENTIFIER ::= { ucdSnmpAgent 10 }
+-- bsdi OBJECT IDENTIFIER ::= { ucdSnmpAgent 11 }
+-- unknown OBJECT IDENTIFIER ::= { ucdSnmpAgent 255 }
+
+
+
+Processes ::= SEQUENCE {
+ processIndex INTEGER,
+ processNames DisplayString,
+ processMin INTEGER,
+ processMax INTEGER,
+ processCount INTEGER,
+ processErrorFlag INTEGER,
+ processErrMessage DisplayString,
+ processErrFix INTEGER
+}
+
+processes OBJECT-TYPE
+ SYNTAX SEQUENCE OF Processes
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "A set of information on running programs/daemons."
+ INDEX { processIndex }
+ ::= { ucdavis 1 }
+
+processIndex OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Reference Index for each observed process."
+ ::= { processes 1 }
+
+processNames OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The table of process names we're Counting."
+ ::= { processes 2 }
+
+processMin OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The minimum number of processes that should be
+ running. An error flag is generated if the number of
+ running processes is < the minimum."
+ ::= { processes 3 }
+
+processMax OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The maximum number of processes that should be
+ running. An error flag is generated if the number of
+ running processes is > the maximum."
+ ::= { processes 4 }
+
+processCount OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of current processes running with the name
+ in question."
+ ::= { processes 5 }
+
+processErrorFlag OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A Error flag to indicate trouble with a process. It
+ goes to 1 if there is an error, 0 if no error."
+ ::= { processes 100 }
+
+processErrMessage OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "An error message describing the problem (if one exists)."
+ ::= { processes 101 }
+
+processErrFix OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "Setting this to one will try to fix the problem if possible."
+ ::= { processes 102 }
+
+extensible OBJECT-TYPE
+ SYNTAX SEQUENCE OF Extensible
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Extensible commands returning output and result codes."
+ INDEX { extensibleIndex }
+ ::= { ucdavis 3 }
+
+Extensible ::= SEQUENCE {
+ extensibleIndex INTEGER,
+ extensibleNames DisplayString,
+ extensibleCommand DisplayString,
+ extensibleResult INTEGER,
+ extensibleOutput DisplayString,
+ extensibleErrFix INTEGER
+}
+
+extensibleIndex OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Reference Index for extensible calls."
+ ::= { extensible 1 }
+
+extensibleNames OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Short, one name descriptions of the extensible commands."
+ ::= { extensible 2 }
+
+extensibleCommand OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The command line to be executed."
+ ::= { extensible 3 }
+
+extensibleResult OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The result code from the executed command."
+ ::= { extensible 100 }
+
+extensibleOutput OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The output of the extensible command (top line only)."
+ ::= { extensible 101 }
+
+extensibleErrFix OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "Set to 1 to fix the problem, if possible."
+ ::= { extensible 102 }
+
+-- the following section is commented out because it is already
+-- defined in the current UCD-SNMP-MIB
+
+-- memory OBJECT-TYPE
+-- SYNTAX Memory
+-- ACCESS not-accessible
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Miscellanous stuff - memory related."
+-- ::= { ucdavis 4 }
+--
+-- Memory ::= SEQUENCE {
+-- memIndex INTEGER,
+-- memErrorName DisplayString,
+-- memTotalSwap INTEGER,
+-- memAvailSwap INTEGER,
+-- memTotalReal INTEGER,
+-- memAvailReal INTEGER,
+-- memTotalSwapTXT INTEGER,
+-- memAvailSwapTXT INTEGER,
+-- memTotalRealTXT INTEGER,
+-- memAvailRealTXT INTEGER,
+-- memTotalFree INTEGER,
+-- memMinimumSwap INTEGER,
+-- memSwapError DisplayString,
+-- memShared INTEGER,
+-- memBuffer INTEGER,
+-- memCached INTEGER
+-- }
+-- memIndex OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Generic Index."
+-- ::= { memory 1 }
+--
+-- memErrorName OBJECT-TYPE
+-- SYNTAX DisplayString
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Bogus Name (swap) for consistancy with the rest of the mibs."
+-- ::= { memory 2 }
+--
+-- memTotalSwap OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Total Swap Size."
+-- ::= { memory 3 }
+--
+-- memAvailSwap OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Available Swap Space."
+-- ::= { memory 4 }
+--
+-- memTotalReal OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Total Real/Physical Memory Size."
+-- ::= { memory 5 }
+--
+-- memAvailReal OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Available Real/Physical Memory Space."
+-- ::= { memory 6 }
+--
+-- memTotalSwapTXT OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Total VM used by text."
+-- ::= { memory 7 }
+--
+-- memAvailSwapTXT OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Active VM used by text."
+-- ::= { memory 8 }
+--
+-- memTotalRealTXT OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Total Real/Physical Memory Size used by txt."
+-- ::= { memory 9 }
+--
+-- memAvailRealTXT OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Active Real/Physical Memory Space used by txt."
+-- ::= { memory 10 }
+--
+-- memTotalFree OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Total Available Memory"
+-- ::= { memory 11 }
+--
+-- memMinimumSwap OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Minimum amount of free swap. Otherwise memErrorSwap
+-- is set to 1 "
+-- ::= { memory 12 }
+--
+-- memShared OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Total Shared Memory"
+-- ::= { memory 13 }
+--
+-- memBuffer OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Total Buffered Memory"
+-- ::= { memory 14 }
+--
+-- memCached OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Total Cached Memory"
+-- ::= { memory 15 }
+--
+-- memSwapError OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Error flag. 1 indicates very little swap space left"
+-- ::= { memory 100 }
+--
+-- memSwapErrorMsg OBJECT-TYPE
+-- SYNTAX DisplayString
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Error message describing the errorflag condition"
+-- ::= { memory 101 }
+--
+-- lockd OBJECT-TYPE
+-- SYNTAX Lockd
+-- ACCESS not-accessible
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Tests the functionality of the rpc.lockd/rpc.statd pair."
+-- INDEX { lockdIndex }
+-- ::= { ucdavis 5 }
+
+-- Lockd ::= SEQUENCE {
+-- lockdIndex INTEGER,
+-- lockdError INTEGER,
+-- lockdErrorMsg DisplayString
+-- }
+--
+-- lockdIndex OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Reference Index for lockd calls."
+-- ::= { lockd 1 }
+--
+-- lockdError OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Error Flag. > 0 indicates error"
+-- ::= { lockd 100 }
+--
+-- lockdErrorMsg OBJECT-TYPE
+-- SYNTAX DisplayString (SIZE (0..255))
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Error message if something is wrong"
+-- ::= { lockd 101 }
+
+disk OBJECT-TYPE
+ SYNTAX SEQUENCE OF Disk
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Disk watching information."
+ INDEX { diskIndex }
+ ::= { ucdavis 6 }
+
+Disk ::= SEQUENCE {
+ diskIndex INTEGER,
+ diskPath DisplayString,
+ diskDevice DisplayString,
+ diskMinimum INTEGER,
+ diskMinPercent INTEGER,
+ diskTotal INTEGER,
+ diskAvail INTEGER,
+ diskUsed INTEGER,
+ diskPercent INTEGER,
+ diskErrorFlag INTEGER,
+ diskErrorMsg DisplayString
+}
+
+diskIndex OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Reference number for the Disk Mib."
+ ::= { disk 1 }
+
+diskPath OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Path where disk is mounted."
+ ::= { disk 2 }
+
+diskDevice OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Device path"
+ ::= { disk 3 }
+
+diskMinimum OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Minimum space required on the disk."
+ ::= { disk 4 }
+
+diskMinPercent OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Minimum percentage of space required on the disk."
+ ::= { disk 5 }
+
+diskTotal OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Total Disk Size (kbytes)"
+ ::= { disk 6 }
+
+diskAvail OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Available disk Space"
+ ::= { disk 7 }
+
+diskUsed OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Used Space on Disk"
+ ::= { disk 8 }
+
+diskPercent OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Percentage of space used on disk"
+ ::= { disk 9 }
+
+diskErrorFlag OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Error flag signaling disk is over minimum required space"
+ ::= { disk 100 }
+
+diskErrorMsg OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A text description of what caused the error flag to be set."
+ ::= { disk 101 }
+
+loadaves OBJECT-TYPE
+ SYNTAX SEQUENCE OF Loadaves
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Load average information."
+ INDEX { loadaveIndex }
+ ::= { ucdavis 7 }
+
+
+Loadaves ::= SEQUENCE {
+ loadaveIndex INTEGER,
+ loadaveNames DisplayString,
+ loadaveLoad DisplayString,
+ loadaveConfig DisplayString,
+ loadaveErrorFlag INTEGER,
+ loadaveErrMessage DisplayString
+}
+
+loadaveIndex OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Reference Index for each observed loadave."
+ ::= { loadaves 1 }
+
+loadaveNames OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The list of loadave names we're Counting."
+ ::= { loadaves 2 }
+
+loadaveLoad OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The 1,5 and 10 minute load averages."
+ ::= { loadaves 3 }
+
+loadaveConfig OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The watch point for loadaverages to signal an error."
+ ::= { loadaves 4 }
+
+loadaveErrorFlag OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A Error flag to indicate trouble with a loadave. It
+ goes to 1 if there is an error, 0 if no error."
+ ::= { loadaves 100 }
+
+loadaveErrMessage OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "An error message describing the problem (if one exists)."
+ ::= { loadaves 101 }
+
+-- the following section is commented out because it is already
+-- defined in the current UCD-SNMP-MIB
+
+-- version OBJECT-TYPE
+-- SYNTAX Version
+-- ACCESS not-accessible
+-- STATUS mandatory
+-- DESCRIPTION
+-- "ece-snmpd version info."
+-- INDEX { versionIndex }
+-- ::= { ucdavis 100 }
+--
+-- Version ::= SEQUENCE {
+-- versionIndex INTEGER,
+-- versionTag DisplayString,
+-- versionDate DisplayString,
+-- versionCDate DisplayString,
+-- versionIdent DisplayString,
+-- versionClearCache INTEGER,
+-- versionUpdateConfig INTEGER,
+-- versionDoDebugging INTEGER
+-- }
+--
+-- versionIndex OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Index to mib (always 1)"
+-- ::= { version 1 }
+--
+-- versionTag OBJECT-TYPE
+-- SYNTAX DisplayString
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "CVS tag keyword"
+-- ::= { version 2 }
+--
+-- versionDate OBJECT-TYPE
+-- SYNTAX DisplayString
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Date string from RCS keyword"
+-- ::= { version 3 }
+--
+-- versionCDate OBJECT-TYPE
+-- SYNTAX DisplayString
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Date string from ctime() "
+-- ::= { version 4 }
+--
+-- versionIdent OBJECT-TYPE
+-- SYNTAX DisplayString
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Id string from RCS keyword"
+-- ::= { version 5 }
+--
+-- versionClearCache OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-write
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Set to 1 to clear the exec cache, if enabled"
+-- ::= { version 10 }
+--
+-- versionUpdateConfig OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-write
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Set to 1 to read-read the config file(s)."
+-- ::= { version 11 }
+--
+-- versionRestartAgent OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-write
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Set to 1 to restart the agent."
+-- ::= { version 12 }
+--
+-- versionDoDebugging OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-write
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Set to 1 to turn debugging statements on in the agent."
+-- ::= { version 20 }
+--
+
+-- the following section is commented out because it is already
+-- defined in the current UCD-SNMP-MIB
+
+-- snmperrs OBJECT-TYPE
+-- SYNTAX Snmperrs
+-- ACCESS not-accessible
+-- STATUS mandatory
+-- DESCRIPTION
+-- "A place for the agent to report problems."
+-- INDEX { snmperrIndex }
+-- ::= { ucdavis 101 }
+--
+--
+-- Snmperrs ::= SEQUENCE {
+-- snmperrIndex INTEGER,
+-- snmperrNames DisplayString,
+-- snmperrErrorFlag INTEGER,
+-- snmperrErrMessage DisplayString
+-- }
+--
+-- snmperrIndex OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "Reference Index for each observed snmperr."
+-- ::= { snmperrs 1 }
+--
+-- snmperrNames OBJECT-TYPE
+-- SYNTAX DisplayString (SIZE (0..255))
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "snmp"
+-- ::= { snmperrs 2 }
+--
+-- snmperrErrorFlag OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "A Error flag to indicate trouble with the agent. It
+-- goes to 1 if there is an error, 0 if no error."
+-- ::= { snmperrs 100 }
+--
+-- snmperrErrMessage OBJECT-TYPE
+-- SYNTAX DisplayString (SIZE (0..255))
+-- ACCESS read-only
+-- STATUS mandatory
+-- DESCRIPTION
+-- "An error message describing the problem (if one exists)."
+-- ::= { snmperrs 101 }
+--
+END
diff --git a/mibs/UCD-SNMP-MIB.inc b/mibs/UCD-SNMP-MIB.inc
new file mode 100644
index 0000000..3323aa1
--- /dev/null
+++ b/mibs/UCD-SNMP-MIB.inc
@@ -0,0 +1,9 @@
+-- input include file for smicng.
+
+#condInclude "SNMPv2-SMI.inc" -- SNMPv2-SMI (SNMPv2 SMI)
+#condInclude "SNMPv2-TC.inc" -- SNMPv2-TC (SNMPv2 TC macro and base TCs)
+
+#pushOpt
+#addOpt "CM"
+#condInclude "UCD-SNMP-MIB.txt"
+#popOpt
diff --git a/mibs/UCD-SNMP-MIB.txt b/mibs/UCD-SNMP-MIB.txt
new file mode 100644
index 0000000..3bf4913
--- /dev/null
+++ b/mibs/UCD-SNMP-MIB.txt
@@ -0,0 +1,1768 @@
+UCD-SNMP-MIB DEFINITIONS ::= BEGIN
+
+-- Design notes:
+--
+-- The design of this mib may seem unusual in parts, as it was
+-- designed for ease of numerical management routines.
+--
+-- In that light, most sub-sections of this mib have four common
+-- numerical oid consistencies:
+--
+-- 2021.ID.1 : an integer index value. In scalers, this is always
+-- of value 1. In tables it is a row index.
+-- 2021.ID.2 : a name of the script, process, etc. that this row represents.
+-- 2021.ID.100 : An error flag indicating if an error is present on
+-- that row (a threshold value was crossed, etc).
+-- 2021.ID.101 : An error string describing why the error flag is non-0.
+--
+-- These conventions enable managers to easy examine portions of the
+-- mib by setting the ID to the sub-section they are interested in
+-- monitoring, and then scanning the .100 value to check for an
+-- error(s), and get a more specific error message from .101 for the
+-- named check found in .2.
+--
+-- Row numbers between 2 and 100 are sub-section specific.
+--
+-- Mib sections utilizing the above conventions:
+-- Tables: procTable, execTable, diskTable, loadTable
+-- Scalers: memory, snmperrs
+
+
+IMPORTS
+ OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY,
+ Integer32, Opaque, enterprises, Counter32, Unsigned32
+ FROM SNMPv2-SMI
+
+ TEXTUAL-CONVENTION, DisplayString, TruthValue
+ FROM SNMPv2-TC;
+
+ucdavis MODULE-IDENTITY
+ LAST-UPDATED "200901190000Z"
+ ORGANIZATION "University of California, Davis"
+ CONTACT-INFO
+ "This mib is no longer being maintained by the University of
+ California and is now in life-support-mode and being
+ maintained by the net-snmp project. The best place to write
+ for public questions about the net-snmp-coders mailing list
+ at net-snmp-coders@lists.sourceforge.net.
+
+ postal: Wes Hardaker
+ P.O. Box 382
+ Davis CA 95617
+
+ email: net-snmp-coders@lists.sourceforge.net
+ "
+ DESCRIPTION
+ "This file defines the private UCD SNMP MIB extensions."
+
+ REVISION "201105140000Z"
+ DESCRIPTION
+ "New objects for monitoring CPU Steal, Guest and Nice values"
+
+ REVISION "200901190000Z"
+ DESCRIPTION
+ "New 64-bit objects for monitoring large disk usage"
+
+ REVISION "200611220000Z"
+ DESCRIPTION
+ "Clarify behaviour of objects in the memory & systemStats groups
+ (including updated versions of malnamed mem*Text objects).
+ Define suitable TCs to describe error reporting/fix behaviour."
+
+ REVISION "200404070000Z"
+ DESCRIPTION
+ "Added ssCpuRawSoftIRQ for Linux (2.6) and forgotten raw swap counters."
+
+ REVISION "200209050000Z"
+ DESCRIPTION
+ "Deprecate the non-raw objects."
+
+ REVISION "200109200000Z"
+ DESCRIPTION
+ "Group to monitor log files"
+
+ REVISION "200101170000Z"
+ DESCRIPTION
+ "Added raw CPU and IO counters."
+
+ REVISION "9912090000Z"
+ DESCRIPTION
+ "SMIv2 version converted from older MIB definitions."
+ ::= { enterprises 2021 }
+
+-- Current UCD core mib table entries:
+-- prTable OBJECT IDENTIFIER ::= { ucdavis 2 }
+-- memory OBJECT IDENTIFIER ::= { ucdavis 4 }
+-- extTable OBJECT IDENTIFIER ::= { ucdavis 8 }
+-- diskTable OBJECT IDENTIFIER ::= { ucdavis 9 }
+-- loadTable OBJECT IDENTIFIER ::= { ucdavis 10 }
+-- systemStats OBJECT IDENTIFIER ::= { ucdavis 11 }
+-- ucdDemoMIB OBJECT IDENTIFIER ::= { ucdavis 14 } - UCD-DEMO-MIB
+-- fileTable OBJECT IDENTIFIER ::= { ucdavis 15 }
+-- logMatch OBJECT IDENTIFIER ::= { ucdavis 16 }
+-- version OBJECT IDENTIFIER ::= { ucdavis 100 }
+-- snmperrs OBJECT IDENTIFIER ::= { ucdavis 101 }
+-- mibRegistryTable OBJECT IDENTIFIER ::= { ucdavis 102 }
+
+-- Older mib table entries that were changed to new locations above:
+-- processes OBJECT IDENTIFIER ::= { ucdavis 1 }
+-- exec OBJECT IDENTIFIER ::= { ucdavis 3 }
+-- disk OBJECT IDENTIFIER ::= { ucdavis 6 }
+-- load OBJECT IDENTIFIER ::= { ucdavis 7 }
+
+-- Never implemented and removed from the mib:
+-- lockd OBJECT IDENTIFIER ::= { ucdavis 5 }
+
+-- Branches for registering other UCD MIB modules:
+ucdInternal OBJECT IDENTIFIER ::= { ucdavis 12 }
+ucdExperimental OBJECT IDENTIFIER ::= { ucdavis 13 }
+
+-- OID values assigned in the ucdExperimental branch:
+-- ucdIpFwAccMIB OBJECT IDENTIFIER ::= { ucdExperimental 1 } - UCD-IPFWACC-MIB
+-- ucdIpFilter OBJECT IDENTIFIER ::= { ucdExperimental 2 } - UCD-IPFILTER-MIB
+-- wavelan OBJECT IDENTIFIER ::= { ucdExperimental 3 } - WL-MIB
+-- ucdDlmodMIB OBJECT IDENTIFIER ::= { ucdExperimental 14 } - UCD-DLMOD-MIB
+-- ucdDiskIOMIB OBJECT IDENTIFIER ::= { ucdExperimental 15 } - UCD-DISKIO-MIB
+-- lmSensors OBJECT IDENTIFIER ::= { ucdExperimental 16 } - LM-SENSORS-MIB
+
+
+-- These are the old returned values of the agent type.
+-- originally returned to: .iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0
+-- Current versions of the agent return an equivalent OID from the netSnmpAgentOIDs
+-- tree (defined in NET-SNMP-TC), which includes values for some additional O/Ss
+
+ucdSnmpAgent OBJECT IDENTIFIER ::= { ucdavis 250 }
+hpux9 OBJECT IDENTIFIER ::= { ucdSnmpAgent 1 }
+sunos4 OBJECT IDENTIFIER ::= { ucdSnmpAgent 2 }
+solaris OBJECT IDENTIFIER ::= { ucdSnmpAgent 3 }
+osf OBJECT IDENTIFIER ::= { ucdSnmpAgent 4 }
+ultrix OBJECT IDENTIFIER ::= { ucdSnmpAgent 5 }
+hpux10 OBJECT IDENTIFIER ::= { ucdSnmpAgent 6 }
+netbsd1 OBJECT IDENTIFIER ::= { ucdSnmpAgent 7 }
+freebsd OBJECT IDENTIFIER ::= { ucdSnmpAgent 8 }
+irix OBJECT IDENTIFIER ::= { ucdSnmpAgent 9 }
+linux OBJECT IDENTIFIER ::= { ucdSnmpAgent 10 }
+bsdi OBJECT IDENTIFIER ::= { ucdSnmpAgent 11 }
+openbsd OBJECT IDENTIFIER ::= { ucdSnmpAgent 12 }
+win32 OBJECT IDENTIFIER ::= { ucdSnmpAgent 13 } -- unlucky
+hpux11 OBJECT IDENTIFIER ::= { ucdSnmpAgent 14 }
+aix OBJECT IDENTIFIER ::= { ucdSnmpAgent 15 }
+macosx OBJECT IDENTIFIER ::= { ucdSnmpAgent 16 }
+dragonfly OBJECT IDENTIFIER ::= { ucdSnmpAgent 17 }
+unknown OBJECT IDENTIFIER ::= { ucdSnmpAgent 255 }
+
+
+--
+-- Define the Float Textual Convention
+-- This definition was written by David Perkins.
+--
+
+Float ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "A single precision floating-point number. The semantics
+ and encoding are identical for type 'single' defined in
+ IEEE Standard for Binary Floating-Point,
+ ANSI/IEEE Std 754-1985.
+ The value is restricted to the BER serialization of
+ the following ASN.1 type:
+ FLOATTYPE ::= [120] IMPLICIT FloatType
+ (note: the value 120 is the sum of '30'h and '48'h)
+ The BER serialization of the length for values of
+ this type must use the definite length, short
+ encoding form.
+
+ For example, the BER serialization of value 123
+ of type FLOATTYPE is '9f780442f60000'h. (The tag
+ is '9f78'h; the length is '04'h; and the value is
+ '42f60000'h.) The BER serialization of value
+ '9f780442f60000'h of data type Opaque is
+ '44079f780442f60000'h. (The tag is '44'h; the length
+ is '07'h; and the value is '9f780442f60000'h."
+ SYNTAX Opaque (SIZE (7))
+
+UCDErrorFlag ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "Represents a possible error condition"
+ SYNTAX INTEGER { noError(0), error(1) }
+
+UCDErrorFix ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "Represents a 'push-button' object, to invoke a suitable
+ configured action. Will always return 0 when read."
+ SYNTAX INTEGER { noError(0), runFix(1) }
+
+--
+-- Process table checks
+--
+
+prTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF PrEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table containing information on running
+ programs/daemons configured for monitoring in the
+ snmpd.conf file of the agent. Processes violating the
+ number of running processes required by the agent's
+ configuration file are flagged with numerical and
+ textual errors."
+ ::= { ucdavis 2 }
+
+prEntry OBJECT-TYPE
+ SYNTAX PrEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a process and its statistics."
+ INDEX { prIndex }
+ ::= { prTable 1 }
+
+PrEntry ::= SEQUENCE {
+ prIndex Integer32,
+ prNames DisplayString,
+ prMin Integer32,
+ prMax Integer32,
+ prCount Integer32,
+ prErrorFlag UCDErrorFlag,
+ prErrMessage DisplayString,
+ prErrFix UCDErrorFix,
+ prErrFixCmd DisplayString
+}
+
+prIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference Index for each observed process."
+ ::= { prEntry 1 }
+
+prNames OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The process name we're counting/checking on."
+ ::= { prEntry 2 }
+
+prMin OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The minimum number of processes that should be
+ running. An error flag is generated if the number of
+ running processes is < the minimum."
+ ::= { prEntry 3 }
+
+prMax OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The maximum number of processes that should be
+ running. An error flag is generated if the number of
+ running processes is > the maximum."
+ ::= { prEntry 4 }
+
+prCount OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of current processes running with the name
+ in question."
+ ::= { prEntry 5 }
+
+prErrorFlag OBJECT-TYPE
+ SYNTAX UCDErrorFlag
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A Error flag to indicate trouble with a process. It
+ goes to 1 if there is an error, 0 if no error."
+ ::= { prEntry 100 }
+
+prErrMessage OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An error message describing the problem (if one exists)."
+ ::= { prEntry 101 }
+
+prErrFix OBJECT-TYPE
+ SYNTAX UCDErrorFix
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Setting this to one will try to fix the problem if
+ the agent has been configured with a script to call
+ to attempt to fix problems automatically using remote
+ snmp operations."
+ ::= { prEntry 102 }
+
+prErrFixCmd OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The command that gets run when the prErrFix column is
+ set to 1."
+ ::= { prEntry 103 }
+
+
+
+extTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF ExtEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of extensible commands returning output and
+ result codes. These commands are configured via the
+ agent's snmpd.conf file."
+ ::= { ucdavis 8 }
+
+extEntry OBJECT-TYPE
+ SYNTAX ExtEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing an extensible script/program and its output."
+ INDEX { extIndex }
+ ::= { extTable 1 }
+
+ExtEntry ::= SEQUENCE {
+ extIndex Integer32,
+ extNames DisplayString,
+ extCommand DisplayString,
+ extResult Integer32,
+ extOutput DisplayString,
+ extErrFix UCDErrorFix,
+ extErrFixCmd DisplayString
+}
+
+extIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reference Index for extensible scripts. Simply an
+ integer row number."
+ ::= { extEntry 1 }
+
+extNames OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A Short, one name description of the extensible command."
+ ::= { extEntry 2 }
+
+extCommand OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The command line to be executed."
+ ::= { extEntry 3 }
+
+extResult OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The result code (exit status) from the executed command."
+ ::= { extEntry 100 }
+
+extOutput OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The first line of output of the executed command."
+ ::= { extEntry 101 }
+
+extErrFix OBJECT-TYPE
+ SYNTAX UCDErrorFix
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Setting this to one will try to fix the problem if
+ the agent has been configured with a script to call
+ to attempt to fix problems automatically using remote
+ snmp operations."
+ ::= { extEntry 102 }
+
+extErrFixCmd OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The command that gets run when the extErrFix column is
+ set to 1."
+ ::= { extEntry 103 }
+
+--
+-- Memory usage/watch reporting.
+-- Not supported on all systems!
+-- See agent/mibgroup/ucd_snmp.h to see if its loaded for your architecture.
+--
+memory OBJECT IDENTIFIER ::= { ucdavis 4 }
+
+memIndex OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Bogus Index. This should always return the integer 0."
+ ::= { memory 1 }
+
+memErrorName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Bogus Name. This should always return the string 'swap'."
+ ::= { memory 2 }
+
+memTotalSwap OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total amount of swap space configured for this host."
+ ::= { memory 3 }
+
+memAvailSwap OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The amount of swap space currently unused or available."
+ ::= { memory 4 }
+
+memTotalReal OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total amount of real/physical memory installed
+ on this host."
+ ::= { memory 5 }
+
+memAvailReal OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The amount of real/physical memory currently unused
+ or available."
+ ::= { memory 6 }
+
+memTotalSwapTXT OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total amount of swap space or virtual memory allocated
+ for text pages on this host.
+
+ This object will not be implemented on hosts where the
+ underlying operating system does not distinguish text
+ pages from other uses of swap space or virtual memory."
+ ::= { memory 7 }
+
+memAvailSwapTXT OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS deprecated
+ DESCRIPTION
+ "The amount of swap space or virtual memory currently
+ being used by text pages on this host.
+
+ This object will not be implemented on hosts where the
+ underlying operating system does not distinguish text
+ pages from other uses of swap space or virtual memory.
+
+ Note that (despite the name), this value reports the
+ amount used, rather than the amount free or available
+ for use. For clarity, this object is being deprecated
+ in favour of 'memUsedSwapTXT(16)."
+ ::= { memory 8 }
+
+memTotalRealTXT OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total amount of real/physical memory allocated
+ for text pages on this host.
+
+ This object will not be implemented on hosts where the
+ underlying operating system does not distinguish text
+ pages from other uses of physical memory."
+ ::= { memory 9 }
+
+memAvailRealTXT OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS deprecated
+ DESCRIPTION
+ "The amount of real/physical memory currently being
+ used by text pages on this host.
+
+ This object will not be implemented on hosts where the
+ underlying operating system does not distinguish text
+ pages from other uses of physical memory.
+
+ Note that (despite the name), this value reports the
+ amount used, rather than the amount free or available
+ for use. For clarity, this object is being deprecated
+ in favour of 'memUsedRealTXT(17)."
+ ::= { memory 10 }
+
+memTotalFree OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total amount of memory free or available for use on
+ this host. This value typically covers both real memory
+ and swap space or virtual memory."
+ ::= { memory 11 }
+
+memMinimumSwap OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The minimum amount of swap space expected to be kept
+ free or available during normal operation of this host.
+
+ If this value (as reported by 'memAvailSwap(4)') falls
+ below the specified level, then 'memSwapError(100)' will
+ be set to 1 and an error message made available via
+ 'memSwapErrorMsg(101)'."
+ ::= { memory 12 }
+
+memShared OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total amount of real or virtual memory currently
+ allocated for use as shared memory.
+
+ This object will not be implemented on hosts where the
+ underlying operating system does not explicitly identify
+ memory as specifically reserved for this purpose."
+ ::= { memory 13 }
+
+memBuffer OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total amount of real or virtual memory currently
+ allocated for use as memory buffers.
+
+ This object will not be implemented on hosts where the
+ underlying operating system does not explicitly identify
+ memory as specifically reserved for this purpose."
+ ::= { memory 14 }
+
+memCached OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total amount of real or virtual memory currently
+ allocated for use as cached memory.
+
+ This object will not be implemented on hosts where the
+ underlying operating system does not explicitly identify
+ memory as specifically reserved for this purpose."
+ ::= { memory 15 }
+
+memUsedSwapTXT OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The amount of swap space or virtual memory currently
+ being used by text pages on this host.
+
+ This object will not be implemented on hosts where the
+ underlying operating system does not distinguish text
+ pages from other uses of swap space or virtual memory."
+ ::= { memory 16 }
+
+memUsedRealTXT OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The amount of real/physical memory currently being
+ used by text pages on this host.
+
+ This object will not be implemented on hosts where the
+ underlying operating system does not distinguish text
+ pages from other uses of physical memory."
+ ::= { memory 17 }
+
+memSwapError OBJECT-TYPE
+ SYNTAX UCDErrorFlag
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Indicates whether the amount of available swap space
+ (as reported by 'memAvailSwap(4)'), is less than the
+ desired minimum (specified by 'memMinimumSwap(12)')."
+ ::= { memory 100 }
+
+memSwapErrorMsg OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Describes whether the amount of available swap space
+ (as reported by 'memAvailSwap(4)'), is less than the
+ desired minimum (specified by 'memMinimumSwap(12)')."
+ ::= { memory 101 }
+
+
+dskTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF DskEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Disk watching information. Partions to be watched
+ are configured by the snmpd.conf file of the agent."
+ ::= { ucdavis 9 }
+
+dskEntry OBJECT-TYPE
+ SYNTAX DskEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a disk and its statistics."
+ INDEX { dskIndex }
+ ::= { dskTable 1 }
+
+DskEntry ::= SEQUENCE {
+ dskIndex Integer32,
+ dskPath DisplayString,
+ dskDevice DisplayString,
+ dskMinimum Integer32,
+ dskMinPercent Integer32,
+ dskTotal Integer32,
+ dskAvail Integer32,
+ dskUsed Integer32,
+ dskPercent Integer32,
+ dskPercentNode Integer32,
+ dskErrorFlag UCDErrorFlag,
+ dskErrorMsg DisplayString,
+ dskTotalLow Unsigned32,
+ dskTotalHigh Unsigned32,
+ dskAvailLow Unsigned32,
+ dskAvailHigh Unsigned32,
+ dskUsedLow Unsigned32,
+ dskUsedHigh Unsigned32
+}
+
+dskIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Integer reference number (row number) for the disk mib."
+ ::= { dskEntry 1 }
+
+dskPath OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Path where the disk is mounted."
+ ::= { dskEntry 2 }
+
+dskDevice OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Path of the device for the partition"
+ ::= { dskEntry 3 }
+
+dskMinimum OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Minimum space required on the disk (in kBytes) before the
+ errors are triggered. Either this or dskMinPercent is
+ configured via the agent's snmpd.conf file."
+ ::= { dskEntry 4 }
+
+dskMinPercent OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Percentage of minimum space required on the disk before the
+ errors are triggered. Either this or dskMinimum is
+ configured via the agent's snmpd.conf file."
+ ::= { dskEntry 5 }
+
+dskTotal OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Total size of the disk/partion (kBytes).
+ For large disks (>2Tb), this value will
+ latch at INT32_MAX (2147483647)."
+ ::= { dskEntry 6 }
+
+dskAvail OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Available space on the disk.
+ For large lightly-used disks (>2Tb), this
+ value will latch at INT32_MAX (2147483647)."
+ ::= { dskEntry 7 }
+
+dskUsed OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Used space on the disk.
+ For large heavily-used disks (>2Tb), this
+ value will latch at INT32_MAX (2147483647)."
+ ::= { dskEntry 8 }
+
+dskPercent OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Percentage of space used on disk"
+ ::= { dskEntry 9 }
+
+dskPercentNode OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Percentage of inodes used on disk"
+ ::= { dskEntry 10 }
+
+dskTotalLow OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Total size of the disk/partion (kBytes).
+ Together with dskTotalHigh composes 64-bit number."
+ ::= { dskEntry 11 }
+
+dskTotalHigh OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Total size of the disk/partion (kBytes).
+ Together with dskTotalLow composes 64-bit number."
+ ::= { dskEntry 12 }
+
+dskAvailLow OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Available space on the disk (kBytes).
+ Together with dskAvailHigh composes 64-bit number."
+ ::= { dskEntry 13 }
+
+dskAvailHigh OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Available space on the disk (kBytes).
+ Together with dskAvailLow composes 64-bit number."
+ ::= { dskEntry 14 }
+
+dskUsedLow OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Used space on the disk (kBytes).
+ Together with dskUsedHigh composes 64-bit number."
+ ::= { dskEntry 15 }
+
+dskUsedHigh OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Used space on the disk (kBytes).
+ Together with dskUsedLow composes 64-bit number."
+ ::= { dskEntry 16 }
+
+dskErrorFlag OBJECT-TYPE
+ SYNTAX UCDErrorFlag
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Error flag signaling that the disk or partition is under
+ the minimum required space configured for it."
+ ::= { dskEntry 100 }
+
+dskErrorMsg OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A text description providing a warning and the space left
+ on the disk."
+ ::= { dskEntry 101 }
+
+laTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF LaEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Load average information."
+ ::= { ucdavis 10 }
+
+laEntry OBJECT-TYPE
+ SYNTAX LaEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a load average and its values."
+ INDEX { laIndex }
+ ::= { laTable 1 }
+
+LaEntry ::= SEQUENCE {
+ laIndex Integer32,
+ laNames DisplayString,
+ laLoad DisplayString,
+ laConfig DisplayString,
+ laLoadInt Integer32,
+ laLoadFloat Float,
+ laErrorFlag UCDErrorFlag,
+ laErrMessage DisplayString
+}
+
+laIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..3)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "reference index/row number for each observed loadave."
+ ::= { laEntry 1 }
+
+laNames OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The list of loadave names we're watching."
+ ::= { laEntry 2 }
+
+laLoad OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The 1,5 and 15 minute load averages (one per row)."
+ ::= { laEntry 3 }
+
+laConfig OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The watch point for load-averages to signal an
+ error. If the load averages rises above this value,
+ the laErrorFlag below is set."
+ ::= { laEntry 4 }
+
+laLoadInt OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The 1,5 and 15 minute load averages as an integer.
+ This is computed by taking the floating point
+ loadaverage value and multiplying by 100, then
+ converting the value to an integer."
+ ::= { laEntry 5 }
+
+laLoadFloat OBJECT-TYPE
+ SYNTAX Float
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The 1,5 and 15 minute load averages as an opaquely
+ wrapped floating point number."
+ ::= { laEntry 6 }
+
+laErrorFlag OBJECT-TYPE
+ SYNTAX UCDErrorFlag
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A Error flag to indicate the load-average has crossed
+ its threshold value defined in the snmpd.conf file.
+ It is set to 1 if the threshold is crossed, 0 otherwise."
+ ::= { laEntry 100 }
+
+laErrMessage OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An error message describing the load-average and its
+ surpased watch-point value."
+ ::= { laEntry 101 }
+
+
+version OBJECT IDENTIFIER ::= { ucdavis 100 }
+
+versionIndex OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Index to mib (always 0)"
+ ::= { version 1 }
+
+versionTag OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "CVS tag keyword"
+ ::= { version 2 }
+
+versionDate OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Date string from RCS keyword"
+ ::= { version 3 }
+
+versionCDate OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Date string from ctime() "
+ ::= { version 4 }
+
+versionIdent OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Id string from RCS keyword"
+ ::= { version 5 }
+
+versionConfigureOptions OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Options passed to the configure script when this agent was built."
+ ::= { version 6 }
+
+versionClearCache OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Set to 1 to clear the exec cache, if enabled"
+ ::= { version 10 }
+
+versionUpdateConfig OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Set to 1 to read-read the config file(s)."
+ ::= { version 11 }
+
+versionRestartAgent OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Set to 1 to restart the agent."
+ ::= { version 12 }
+
+versionSavePersistentData OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Set to 1 to force the agent to save it's persistent data immediately."
+ ::= { version 13 }
+
+versionDoDebugging OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Set to 1 to turn debugging statements on in the agent or 0
+ to turn it off."
+ ::= { version 20 }
+
+
+snmperrs OBJECT IDENTIFIER ::= { ucdavis 101 }
+
+snmperrIndex OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Bogus Index for snmperrs (always 0)."
+ ::= { snmperrs 1 }
+
+snmperrNames OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "snmp"
+ ::= { snmperrs 2 }
+
+snmperrErrorFlag OBJECT-TYPE
+ SYNTAX UCDErrorFlag
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A Error flag to indicate trouble with the agent. It
+ goes to 1 if there is an error, 0 if no error."
+ ::= { snmperrs 100 }
+
+snmperrErrMessage OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An error message describing the problem (if one exists)."
+ ::= { snmperrs 101 }
+
+
+mrTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF MrEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table displaying all the oid's registered by mib modules in
+ the agent. Since the agent is modular in nature, this lists
+ each module's OID it is responsible for and the name of the module"
+ ::= { ucdavis 102 }
+
+mrEntry OBJECT-TYPE
+ SYNTAX MrEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry containing a registered mib oid."
+ INDEX { IMPLIED mrIndex }
+ ::= { mrTable 1 }
+
+MrEntry ::= SEQUENCE {
+ mrIndex OBJECT IDENTIFIER,
+ mrModuleName DisplayString
+}
+
+mrIndex OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The registry slot of a mibmodule."
+ ::= { mrEntry 1 }
+
+mrModuleName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The module name that registered this OID."
+ ::= { mrEntry 2 }
+
+systemStats OBJECT IDENTIFIER ::= { ucdavis 11 }
+
+ssIndex OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Bogus Index. This should always return the integer 1."
+ ::= { systemStats 1 }
+
+ssErrorName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Bogus Name. This should always return the string 'systemStats'."
+ ::= { systemStats 2 }
+
+ssSwapIn OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The average amount of memory swapped in from disk,
+ calculated over the last minute."
+ ::= { systemStats 3 }
+
+ssSwapOut OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The average amount of memory swapped out to disk,
+ calculated over the last minute."
+ ::= { systemStats 4 }
+
+ssIOSent OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "blocks/s"
+ MAX-ACCESS read-only
+ STATUS deprecated
+ DESCRIPTION
+ "The average amount of data written to disk or other
+ block device, calculated over the last minute.
+
+ This object has been deprecated in favour of
+ 'ssIORawSent(57)', which can be used to calculate
+ the same metric, but over any desired time period."
+ ::= { systemStats 5 }
+
+ssIOReceive OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "blocks/s"
+ MAX-ACCESS read-only
+ STATUS deprecated
+ DESCRIPTION
+ "The average amount of data read from disk or other
+ block device, calculated over the last minute.
+
+ This object has been deprecated in favour of
+ 'ssIORawReceived(58)', which can be used to calculate
+ the same metric, but over any desired time period."
+ ::= { systemStats 6 }
+
+ssSysInterrupts OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "interrupts/s"
+ MAX-ACCESS read-only
+ STATUS deprecated
+ DESCRIPTION
+ "The average rate of interrupts processed (including
+ the clock) calculated over the last minute.
+
+ This object has been deprecated in favour of
+ 'ssRawInterrupts(59)', which can be used to calculate
+ the same metric, but over any desired time period."
+ ::= { systemStats 7 }
+
+ssSysContext OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "switches/s"
+ MAX-ACCESS read-only
+ STATUS deprecated
+ DESCRIPTION
+ "The average rate of context switches,
+ calculated over the last minute.
+
+ This object has been deprecated in favour of
+ 'ssRawContext(60)', which can be used to calculate
+ the same metric, but over any desired time period."
+ ::= { systemStats 8 }
+
+ssCpuUser OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS deprecated
+ DESCRIPTION
+ "The percentage of CPU time spent processing
+ user-level code, calculated over the last minute.
+
+ This object has been deprecated in favour of
+ 'ssCpuRawUser(50)', which can be used to calculate
+ the same metric, but over any desired time period."
+ ::= { systemStats 9 }
+
+ssCpuSystem OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS deprecated
+ DESCRIPTION
+ "The percentage of CPU time spent processing
+ system-level code, calculated over the last minute.
+
+ This object has been deprecated in favour of
+ 'ssCpuRawSystem(52)', which can be used to calculate
+ the same metric, but over any desired time period."
+ ::= { systemStats 10 }
+
+ssCpuIdle OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS deprecated
+ DESCRIPTION
+ "The percentage of processor time spent idle,
+ calculated over the last minute.
+
+ This object has been deprecated in favour of
+ 'ssCpuRawIdle(53)', which can be used to calculate
+ the same metric, but over any desired time period."
+ ::= { systemStats 11 }
+
+-- The agent only implements those of the following counters that the
+-- kernel supports! Don't expect all to be present.
+
+ssCpuRawUser OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ processing user-level code.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 50 }
+
+ssCpuRawNice OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ processing reduced-priority code.
+
+ This object will not be implemented on hosts where
+ the underlying operating system does not measure
+ this particular CPU metric.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 51 }
+
+ssCpuRawSystem OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ processing system-level code.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors).
+
+ This object may sometimes be implemented as the
+ combination of the 'ssCpuRawWait(54)' and
+ 'ssCpuRawKernel(55)' counters, so care must be
+ taken when summing the overall raw counters."
+ ::= { systemStats 52 }
+
+ssCpuRawIdle OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ idle.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 53 }
+
+ssCpuRawWait OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ waiting for IO.
+
+ This object will not be implemented on hosts where
+ the underlying operating system does not measure
+ this particular CPU metric. This time may also be
+ included within the 'ssCpuRawSystem(52)' counter.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 54 }
+
+ssCpuRawKernel OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ processing kernel-level code.
+
+ This object will not be implemented on hosts where
+ the underlying operating system does not measure
+ this particular CPU metric. This time may also be
+ included within the 'ssCpuRawSystem(52)' counter.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 55 }
+
+ssCpuRawInterrupt OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ processing hardware interrupts.
+
+ This object will not be implemented on hosts where
+ the underlying operating system does not measure
+ this particular CPU metric.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 56 }
+
+ssIORawSent OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of blocks sent to a block device"
+ ::= { systemStats 57 }
+
+ssIORawReceived OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of blocks received from a block device"
+ ::= { systemStats 58 }
+
+ssRawInterrupts OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of interrupts processed"
+ ::= { systemStats 59 }
+
+ssRawContexts OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of context switches"
+ ::= { systemStats 60 }
+
+ssCpuRawSoftIRQ OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ processing software interrupts.
+
+ This object will not be implemented on hosts where
+ the underlying operating system does not measure
+ this particular CPU metric.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 61 }
+
+ssRawSwapIn OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of blocks swapped in"
+ ::= { systemStats 62 }
+
+ssRawSwapOut OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of blocks swapped out"
+ ::= { systemStats 63 }
+
+ssCpuRawSteal OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ by the hypervisor code to run other VMs even
+ though the CPU in the current VM had something runnable.
+
+ This object will not be implemented on hosts where
+ the underlying operating system does not measure
+ this particular CPU metric.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 64 }
+
+ssCpuRawGuest OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ by the CPU to run a virtual CPU (guest).
+
+ This object will not be implemented on hosts where
+ the underlying operating system does not measure
+ this particular CPU metric.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 65 }
+
+ssCpuRawGuestNice OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of 'ticks' (typically 1/100s) spent
+ by the CPU to run a niced virtual CPU (guest).
+
+ This object will not be implemented on hosts where
+ the underlying operating system does not measure
+ this particular CPU metric.
+
+ On a multi-processor system, the 'ssCpuRaw*'
+ counters are cumulative over all CPUs, so their
+ sum will typically be N*100 (for N processors)."
+ ::= { systemStats 66 }
+
+-- possibly used in the future:
+--
+-- ssErrorFlag OBJECT-TYPE
+-- SYNTAX UCDErrorFlag
+-- MAX-ACCESS read-only
+-- STATUS current
+-- DESCRIPTION
+-- "Error flag."
+-- ::= { systemStats 100 }
+--
+-- ssErrMessage OBJECT-TYPE
+-- SYNTAX DisplayString
+-- MAX-ACCESS read-only
+-- STATUS current
+-- DESCRIPTION
+-- "Error message describing the errorflag condition."
+-- ::= { systemStats 101 }
+
+
+ucdTraps OBJECT IDENTIFIER ::= { ucdavis 251 }
+
+ucdStart NOTIFICATION-TYPE
+ STATUS current
+ DESCRIPTION
+ "This trap could in principle be sent when the agent start"
+ ::= { ucdTraps 1 }
+
+ucdShutdown NOTIFICATION-TYPE
+ STATUS current
+ DESCRIPTION
+ "This trap is sent when the agent terminates"
+ ::= { ucdTraps 2 }
+
+--
+-- File Table: monitor a list of files to check for a maximum size.
+--
+
+fileTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF FileEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Table of monitored files."
+ ::= { ucdavis 15 }
+
+fileEntry OBJECT-TYPE
+ SYNTAX FileEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Entry of file"
+ INDEX { fileIndex }
+ ::= { fileTable 1 }
+
+FileEntry ::= SEQUENCE {
+ fileIndex Integer32,
+ fileName DisplayString,
+ fileSize Integer32,
+ fileMax Integer32,
+ fileErrorFlag UCDErrorFlag,
+ fileErrorMsg DisplayString
+}
+
+fileIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Index of file"
+ ::= { fileEntry 1 }
+
+fileName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Filename"
+ ::= { fileEntry 2 }
+
+fileSize OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Size of file (kB)"
+ ::= { fileEntry 3 }
+
+fileMax OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "kB"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Limit of filesize (kB)"
+ ::= { fileEntry 4 }
+
+fileErrorFlag OBJECT-TYPE
+ SYNTAX UCDErrorFlag
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Limit exceeded flag"
+ ::= { fileEntry 100 }
+
+fileErrorMsg OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Filesize error message"
+ ::= { fileEntry 101 }
+
+logMatch OBJECT IDENTIFIER ::= { ucdavis 16 }
+
+logMatchMaxEntries OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The maximum number of logmatch entries
+ this snmpd daemon can support."
+ ::= { logMatch 1 }
+
+logMatchTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF LogMatchEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Table of monitored files."
+ ::= { logMatch 2 }
+
+logMatchEntry OBJECT-TYPE
+ SYNTAX LogMatchEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Entry of file"
+ INDEX { logMatchIndex }
+ ::= { logMatchTable 1 }
+
+LogMatchEntry ::=
+ SEQUENCE {
+ logMatchIndex
+ Integer32,
+ logMatchName
+ DisplayString,
+ logMatchFilename
+ DisplayString,
+ logMatchRegEx
+ DisplayString,
+ logMatchGlobalCounter
+ Counter32,
+ logMatchGlobalCount
+ Integer32,
+ logMatchCurrentCounter
+ Counter32,
+ logMatchCurrentCount
+ Integer32,
+ logMatchCounter
+ Counter32,
+ logMatchCount
+ Integer32,
+ logMatchCycle
+ Integer32,
+ logMatchErrorFlag
+ UCDErrorFlag,
+ logMatchRegExCompilation
+ DisplayString
+ }
+
+logMatchIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Index of logmatch"
+ ::= { logMatchEntry 1 }
+
+logMatchName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "logmatch instance name"
+ ::= { logMatchEntry 2 }
+
+logMatchFilename OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "filename to be logmatched"
+ ::= { logMatchEntry 3 }
+
+logMatchRegEx OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "regular expression"
+ ::= { logMatchEntry 4 }
+
+logMatchGlobalCounter OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "global count of matches"
+ ::= { logMatchEntry 5 }
+
+logMatchGlobalCount OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Description."
+ ::= { logMatchEntry 6 }
+
+logMatchCurrentCounter OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Regex match counter. This counter will
+ be reset with each logfile rotation."
+ ::= { logMatchEntry 7 }
+
+logMatchCurrentCount OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Description."
+ ::= { logMatchEntry 8 }
+
+logMatchCounter OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Regex match counter. This counter will
+ be reset with each read"
+ ::= { logMatchEntry 9 }
+
+logMatchCount OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Description."
+ ::= { logMatchEntry 10 }
+
+logMatchCycle OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "time between updates (if not queried) in seconds"
+ ::= { logMatchEntry 11 }
+
+logMatchErrorFlag OBJECT-TYPE
+ SYNTAX UCDErrorFlag
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "errorflag: is this line configured correctly?"
+ ::= { logMatchEntry 100 }
+
+logMatchRegExCompilation OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "message of regex precompilation"
+ ::= { logMatchEntry 101 }
+
+END
diff --git a/mibs/ianalist b/mibs/ianalist
new file mode 100644
index 0000000..0edb3a0
--- /dev/null
+++ b/mibs/ianalist
@@ -0,0 +1,15 @@
+# updated 2010-04-21
+ianaaddressfamilynumbers-mib IANA-ADDRESS-FAMILY-NUMBERS-MIB
+ianacharset-mib IANA-CHARSET-MIB
+ianafinisher-mib IANA-FINISHER-MIB
+ianagmplstc-mib IANA-GMPLS-TC-MIB
+ianaiftype-mib IANAifType-MIB
+ianaiprouteprotocol-mib IANA-RTPROTO-MIB
+# ianaipfixselector-mib IPFIX-SELECTOR-MIB
+ianaippmmetricsregistry-mib IANA-IPPM-METRICS-REGISTRY-MIB
+ianaitualarmtc-mib IANA-ITU-ALARM-TC-MIB
+ianalanguage-mib IANA-LANGUAGE-MIB
+ianamalloc-mib IANA-MALLOC-MIB
+ianamau-mib IANA-MAU-MIB
+ianaprinter-mib IANA-PRINTER-MIB
+ianatn3270etc-mib IANATn3270eTC-MIB
diff --git a/mibs/makehtml.pl b/mibs/makehtml.pl
new file mode 100644
index 0000000..5a34a35
--- /dev/null
+++ b/mibs/makehtml.pl
@@ -0,0 +1,112 @@
+#!/usr/bin/perl
+
+use SNMP;
+
+use Getopt::Std;
+
+%opts = ( M => ".",
+ D => "html");
+
+getopts("M:D:WH:", \%opts) || die "usage: makehtml.pl -W [-M MIBDIR] [-D OUTDIR] files > index.html";
+
+$SNMP::save_descriptions = 1;
+
+$ENV{'MIBDIRS'} = $opts{'M'};
+$ENV{'SNMPCONFPATH'} = 'bogus';
+
+if (-f "rfclist") {
+ open(I,"rfclist");
+ while (<I>) {
+ if (/^(\d+)\s+([-:\w]+)\s*$/) {
+ my $mib = $2;
+ my $rfc = $1;
+ my @mibs = split(/:/,$mib);
+ foreach my $i (@mibs) {
+ $mibs{$i} = $rfc;
+ }
+ }
+ }
+ close(I);
+}
+
+if (-f "nodemap") {
+ open(I,"nodemap");
+ while (<I>) {
+ if (/^([-\w]+)\s+(\w+)\s*$/) {
+ $nodemap{$1} = $2;
+ }
+ }
+ close(I);
+}
+
+if ($opts{'W'}) {
+ print '<p class="SectionTitle">
+Net-SNMP Distributed MIBs
+</p>
+
+<p>The following are the MIB files distributed with Net-SNMP. Note that because they are distributed with Net-SNMP does not mean the agent implements them all. Another good place for finding other MIB definitions can be found <a href="http://www.mibdepot.com/">at the MIB depot</a>.</p>
+
+<table border="2" bgcolor="#dddddd">
+ <tr><th>MIB</th><th>RFC</th><th>Description</th></tr>
+';
+}
+
+my %didit;
+
+foreach my $mibf (@ARGV) {
+ my $node;
+ my $mib = $mibf;
+ $mib =~ s/.txt//;
+
+ next if ($didit{$mib});
+ $didit{$mib} = 1;
+
+ open(I, "$opts{M}/$mibf");
+ while (<I>) {
+ if (/(\w+)\s+MODULE-IDENTITY/) {
+ $node = $1;
+ }
+ }
+ close(I);
+
+ if (!$node) {
+ print STDERR "Couldn't find starting node for $mib $node $_\n";
+ next;
+ }
+
+ SNMP::loadModules($mib);
+
+ $desc = $SNMP::MIB{$node}{'description'};
+
+ # get a different tree than the module identity though.
+ if (exists($nodemap{$mib})) {
+ $node = $nodemap{$mib};
+ }
+
+ # Change tabs to spaces
+ $desc =~ s/\t/ /g;
+
+ # Clean up formatting
+ my ($s) = ($desc =~ /\n(\s+)/);
+ $desc =~ s/^$s//gm;
+
+ $desc =~ s/&/&amp;/g;
+ $desc =~ s/</&lt;/g;
+ $desc =~ s/>/&gt;/g;
+
+ print " <tr>\n";
+ print " <td><a href=\"$node.html\">$mib</a><br />\n";
+ print " <a href=\"$mib.txt\">[mib file]</a></td>\n";
+ print " <br><a href=\"$mib-conf.html\">[conformance summary]</a></td>\n";
+ print " <td><a href=\"http://www.ietf.org/rfc/rfc$mibs{$mib}.txt\">rfc$mibs{$mib}</a></td>\n" if ($mibs{$mib});
+ print " <td>&nbsp;</td>\n" if (!$mibs{$mib});
+ print " <td><pre>$desc</pre></td>\n";
+ print " </tr>\n";
+
+ system("MIBS=$mib mib2c -c mib2c.genhtml.conf $node");
+ system("mv $node.html $opts{D}");
+}
+
+print "</table>\n";
+
+
diff --git a/mibs/mibfetch b/mibs/mibfetch
new file mode 100755
index 0000000..d3aa4c6
--- /dev/null
+++ b/mibs/mibfetch
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# Usage: mibfetch [ -d outdir ] host directory rfc [mibs]
+#
+# If "rfc" contains a "." it is expected to be a complete file name,
+# otherwise it is assumed to be just the rfc number.
+# If "mibs" is specified, it is a ":" separated list of mibs to extract,
+# otherwise all mibs are extracted.
+#
+# The script fetches the file from the givn directory on the given
+# host, and then runs the file through smistrip to extract the mibs.
+
+exact=0
+verbose=
+
+while getopts xvd: c
+do
+ case $c in
+ d) mdir="-d $OPTARG"
+ ;;
+ x) exact=1
+ ;;
+ v) verbose=-v
+ ;;
+ \?) exit 2
+ ;;
+ esac
+done
+
+shift `expr $OPTIND - 1`
+
+set -e
+
+host=$1
+dir=$2
+rfc=$3
+
+if [ $exact = 0 -a `echo $rfc | sed 's/\.//'` = $rfc ]; then
+ file=rfc$rfc.txt
+else
+ file=$rfc
+fi
+
+if [ -n "$4" ]; then
+ mibs="-m $4"
+fi
+
+# ncftpget -FV ftp://$host/$dir/$file
+wget -O - -q -nv $host/$dir/$file | \
+ tr -d \\r | \
+ ./smistrip $verbose -x .txt $mdir $mibs -
diff --git a/mibs/nodemap b/mibs/nodemap
new file mode 100644
index 0000000..bce284f
--- /dev/null
+++ b/mibs/nodemap
@@ -0,0 +1,6 @@
+EtherLike-MIB dot3
+HOST-RESOURCES-MIB host
+IP-MIB ip
+IF-MIB interfaces
+UDP-MIB udp
+TCP-MIB tcp
diff --git a/mibs/rfclist b/mibs/rfclist
new file mode 100644
index 0000000..df93d8d
--- /dev/null
+++ b/mibs/rfclist
@@ -0,0 +1,265 @@
+# updated 2012-06-13
+1155 RFC1155-SMI
+1213 RFC1213-MIB
+1227 SMUX-MIB
+1238 CLNS-MIB
+1381 RFC1381-MIB
+1382 RFC1382-MIB
+1414 RFC1414-MIB
+1461 MIOX25-MIB
+1471 PPP-LCP-MIB
+1472 PPP-SEC-MIB
+1473 PPP-IP-NCP-MIB
+1474 PPP-BRIDGE-NCP-MIB
+1512 FDDI-SMT73-MIB
+1513 TOKEN-RING-RMON-MIB
+1525 SOURCE-ROUTING-MIB
+1559 DECNET-PHIV-MIB
+1567 DSA-MIB
+1611 DNS-SERVER-MIB
+1612 DNS-RESOLVER-MIB
+1628 UPS-MIB
+1658 CHARACTER-MIB
+1659 RS-232-MIB
+1660 PARALLEL-MIB
+1666 SNA-NAU-MIB
+1694 SIP-MIB
+1696 Modem-MIB
+1697 RDBMS-MIB
+1724 RIPv2-MIB
+1742 APPLETALK-MIB
+1747 SNA-SDLC-MIB
+1748 TOKENRING-MIB
+1749 TOKENRING-STATION-SR-MIB
+1792 TCPIPX-MIB
+1850 OSPF-MIB:OSPF-TRAP-MIB
+2006 MIP-MIB
+2020 DOT12-IF-MIB
+2024 DLSW-MIB
+2051 APPC-MIB
+2108 SNMP-REPEATER-MIB
+2115 FRAME-RELAY-DTE-MIB
+2127 ISDN-MIB
+2128 DIAL-CONTROL-MIB
+2206 RSVP-MIB
+2213 INTEGRATED-SERVICES-MIB
+2214 INTEGRATED-SERVICES-GUARANTEED-MIB
+2232 APPN-DLUR-MIB
+2238 HPR-MIB
+2266 DOT12-RPTR-MIB
+2287 SYSAPPL-MIB
+2320 IPOA-MIB
+2366 IPATM-IPMC-MIB
+2452 IPV6-TCP-MIB
+2454 IPV6-UDP-MIB
+2455 APPN-MIB
+2456 APPN-TRAP-MIB
+2457 EBN-MIB
+2465 IPV6-TC:IPV6-MIB
+2466 IPV6-ICMP-MIB
+2494 DS0-MIB:DS0BUNDLE-MIB
+2495 DS1-MIB
+2496 DS3-MIB
+2512 ATM-ACCOUNTING-INFORMATION-MIB
+2513 ACCOUNTING-CONTROL-MIB
+2514 ATM-TC-MIB
+2515 ATM-MIB
+2561 TN3270E-MIB
+2562 TN3270E-RT-MIB
+2564 APPLICATION-MIB
+2576 SNMP-COMMUNITY-MIB
+2578 SNMPv2-SMI
+2579 SNMPv2-TC
+2580 SNMPv2-CONF
+2584 HPR-IP-MIB
+2594 WWW-MIB
+2605 DIRECTORY-SERVER-MIB
+2613 SMON-MIB
+2662 ADSL-TC-MIB:ADSL-LINE-MIB
+2666 ETHER-CHIPSET-MIB
+2670 DOCS-IF-MIB
+2677 NHRP-MIB
+2707 Job-Monitoring-MIB
+2720 FLOW-METER-MIB
+2742 AGENTX-MIB
+2758 SLAPM-MIB
+2786 SNMP-USM-DH-OBJECTS-MIB
+2787 VRRP-MIB
+2788 NETWORK-SERVICES-MIB
+2789 MTA-MIB
+2790 HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES
+2819 RMON-MIB
+2837 FIBRE-CHANNEL-FE-MIB
+2856 HCNUM-TC
+2863 IF-MIB
+2864 IF-INVERTED-STACK-MIB
+2922 PTOPO-MIB
+2932 IPMROUTE-STD-MIB
+2933 IGMP-STD-MIB
+2934 PIM-MIB
+2940 COPS-CLIENT-MIB
+2954 FRNETSERV-MIB
+2955 FR-ATM-PVC-SERVICE-IWF-MIB
+2959 RTP-MIB
+2981 DISMAN-EVENT-MIB
+2982 DISMAN-EXPRESSION-MIB
+3014 NOTIFICATION-LOG-MIB
+3019 IPV6-MLD-MIB
+3020 FR-MFR-MIB
+3055 PINT-MIB
+3083 DOCS-BPI-MIB
+3144 INTERFACETOPN-MIB
+3165 DISMAN-SCRIPT-MIB
+3201 CIRCUIT-IF-MIB
+3202 FRSLD-MIB
+3231 DISMAN-SCHEDULE-MIB
+3273 HC-RMON-MIB
+3276 HDSL2-SHDSL-LINE-MIB
+3289 DIFFSERV-DSCP-TC:DIFFSERV-MIB
+3295 GSMP-MIB
+3371 L2TP-MIB
+3411 SNMP-FRAMEWORK-MIB
+3412 SNMP-MPD-MIB
+3413 SNMP-TARGET-MIB:SNMP-NOTIFICATION-MIB:SNMP-PROXY-MIB
+3414 SNMP-USER-BASED-SM-MIB
+3415 SNMP-VIEW-BASED-ACM-MIB
+3417 SNMPv2-TM
+3418 SNMPv2-MIB
+3419 TRANSPORT-ADDRESS-MIB
+3433 ENTITY-SENSOR-MIB
+3434 HC-ALARM-MIB
+3440 ADSL-LINE-EXT-MIB
+3498 APS-MIB
+3559 MALLOC-MIB
+3591 OPT-IF-MIB
+3592 SONET-MIB
+3593 PerfHist-TC-MIB
+3595 IPV6-FLOW-LABEL-MIB
+3606 ATM2-MIB
+3621 POWER-ETHERNET-MIB
+3635 EtherLike-MIB
+3637 ETHER-WIS
+3705 HC-PerfHist-TC-MIB
+3728 VDSL-LINE-MIB
+3729 APM-MIB
+3747 DIFFSERV-CONFIG-MIB
+3805 Printer-MIB
+3806 Finisher-MIB
+# 3808 IANA-CHARSET-MIB
+3811 MPLS-TC-STD-MIB
+3812 MPLS-TE-STD-MIB
+3813 MPLS-LSR-STD-MIB
+3814 MPLS-FTN-STD-MIB
+3815 MPLS-LDP-STD-MIB:MPLS-LDP-ATM-STD-MIB:MPLS-LDP-FRAME-RELAY-STD-MIB:MPLS-LDP-GENERIC-STD-MIB
+3816 ROHC-MIB:ROHC-UNCOMPRESSED-MIB:ROHC-RTP-MIB
+3826 SNMP-USM-AES-MIB
+3873 SCTP-MIB
+3877 ALARM-MIB:ITU-ALARM-TC-MIB:ITU-ALARM-MIB
+3878 ARC-MIB
+3970 TE-MIB
+4001 INET-ADDRESS-MIB
+4008 NAT-MIB
+4011 POLICY-BASED-MANAGEMENT-MIB
+4022 TCP-MIB
+4036 DOCS-IETF-SUBMGT-MIB
+4044 FC-MGMT-MIB
+4069 VDSL-LINE-EXT-SCM-MIB
+4070 VDSL-LINE-EXT-MCM-MIB
+4087 TUNNEL-MIB
+4113 UDP-MIB
+4131 DOCS-IETF-BPI2-MIB
+4133 ENTITY-MIB
+4149 SSPM-MIB
+4188 BRIDGE-MIB
+4220 TE-LINK-STD-MIB
+4265 VPN-TC-STD-MIB
+4268 ENTITY-STATE-TC-MIB:ENTITY-STATE-MIB
+4273 BGP4-MIB
+4292 IP-FORWARD-MIB
+4293 IP-MIB
+4295 MOBILEIPV6-MIB
+4318 RSTP-MIB
+4319 HDSL2-SHDSL-LINE-MIB
+4323 DOCS-IETF-QOS-MIB
+4363 P-BRIDGE-MIB:Q-BRIDGE-MIB
+4368 MPLS-LC-ATM-STD-MIB:MPLS-LC-FR-STD-MIB
+4382 MPLS-L3VPN-STD-MIB
+4404 FCIP-MGMT-MIB
+4438 T11-FC-NAME-SERVER-MIB
+4439 T11-TC-MIB:T11-FC-FABRIC-ADDR-MGR-MIB
+4444 ISIS-MIB
+4455 SCSI-MIB
+4498 AGGREGATE-MIB:TIME-AGGREGATE-MIB
+4502 RMON2-MIB
+4544 ISCSI-MIB
+4545 IPS-AUTH-MIB
+4560 DISMAN-PING-MIB:DISMAN-TRACEROUTE-MIB:DISMAN-NSLOOKUP-MIB
+4624 MSDP-MIB
+4625 T11-FC-ROUTE-MIB
+4626 T11-FC-FSPF-MIB
+4631 LMP-MIB
+4639 DOCS-CABLE-DEVICE-MIB
+4668 RADIUS-AUTH-CLIENT-MIB
+4669 RADIUS-AUTH-SERVER-MIB
+4670 RADIUS-ACC-CLIENT-MIB
+4671 RADIUS-ACC-SERVER-MIB
+4672 RADIUS-DYNAUTH-CLIENT-MIB
+4673 RADIUS-DYNAUTH-SERVER-MIB
+4682 PKTC-IETF-MTA-MIB
+4706 ADSL2-LINE-TC-MIB:ADSL2-LINE-MIB
+4711 RAQMON-MIB
+4747 T11-FC-VIRTUAL-FABRIC-MIB
+4780 SIP-TC-MIB:SIP-COMMON-MIB:SIP-UA-MIB:SIP-SERVER-MIB
+4789 SNMP-IEEE802-TM-MIB
+4801 GMPLS-TC-STD-MIB
+4802 GMPLS-TE-STD-MIB
+4803 GMPLS-LSR-STD-MIB:GMPLS-LABEL-STD-MIB
+4807 IPSEC-SPD-MIB
+4836 MAU-MIB
+4837 DOT3-EPON-MIB
+4878 DOT3-OAM-MIB
+4898 TCP-ESTATS-MIB
+4935 T11-FC-FABRIC-CONFIG-SERVER-MIB
+4936 T11-FC-FABRIC-LOCK-MIB:T11-FC-ZONE-SERVER-MIB
+4939 ISNS-MIB
+4983 T11-FC-RSCN-MIB
+5017 URI-TC-MIB
+5060 PIM-STD-MIB
+5066 IF-CAP-STACK-MIB:EFM-CU-MIB
+5097 UDPLITE-MIB
+5098 PKTC-IETF-SIG-MIB
+5131 LANGTAG-TC-MIB
+5132 IPMCAST-MIB
+5190 MIDCOM-MIB
+5240 PIM-BSR-MIB
+5324 T11-FC-SP-TC-MIB:T11-FC-SP-AUTHENTICATION-MIB:T11-FC-SP-ZONING-MIB:T11-FC-SP-POLICY-MIB:T11-FC-SP-SA-MIB
+5427 SYSLOG-TC-MIB
+5428 PKTC-IETF-EVENT-MIB
+5488 NEMO-MIB
+5519 MGMD-STD-MIB
+5525 RSERPOOL-MIB
+5542 PW-TC-STD-MIB
+5591 SNMP-TSM-MIB
+5601 PW-STD-MIB:IANA-PWE3-MIB
+5602 PW-MPLS-STD-MIB
+5603 PW-ENET-STD-MIB
+5604 PW-TDM-MIB
+5605 PW-ATM-MIB
+5643 OSPFV3-MIB
+5650 VDSL2-LINE-TC-MIB:VDSL2-LINE-MIB
+5676 SYSLOG-MSG-MIB
+5728 DVB-RCS-MIB
+5813 FORCES-MIB
+5815 IPFIX-MIB:IPFIX-SELECTOR-MIB
+5833 CAPWAP-BASE-MIB
+5834 CAPWAP-DOT11-MIB
+5907 NTPv4-MIB
+6065 SNMP-VACM-AAA-MIB
+6173 IFCP-MGMT-MIB
+6240 PW-CEP-STD-MIB
+6340 FLOAT-TC-MIB
+6353 SNMP-TLS-TM-MIB
+6445 MPLS-FRR-GENERAL-STD-MIB:MPLS-FRR-ONE2ONE-STD-MIB:MPLS-FRR-FACILITY-STD-MIB
+6475 PMIPV6-TC-MIB:PMIPV6-MIB
+6527 VRRPV3-MIB
+6615 IPFIX-MIB:IPFIX-SELECTOR-MIB
diff --git a/mibs/rfcmibs.diff b/mibs/rfcmibs.diff
new file mode 100644
index 0000000..0618c17
--- /dev/null
+++ b/mibs/rfcmibs.diff
@@ -0,0 +1,499 @@
+Only in /usr/local/share/snmp/rfc: .index
+diff -ru /usr/local/share/snmp/rfc.orig/ADSL-LINE-MIB.txt /usr/local/share/snmp/rfc/ADSL-LINE-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/ADSL-LINE-MIB.txt Sat Mar 3 17:27:00 2001
++++ /usr/local/share/snmp/rfc/ADSL-LINE-MIB.txt Tue Jan 23 00:42:41 2001
+@@ -3379,7 +3379,6 @@
+ static profiles are implemented."
+
+ OBJECT adslAtucConfMinSnrMgn
+- MIN-ACCESS read-wr
+ MIN-ACCESS read-write
+ DESCRIPTION
+ "Read-write access is applicable when
+diff -ru /usr/local/share/snmp/rfc.orig/DLSW-MIB.txt /usr/local/share/snmp/rfc/DLSW-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/DLSW-MIB.txt Sat Mar 3 17:18:28 2001
++++ /usr/local/share/snmp/rfc/DLSW-MIB.txt Tue Jan 23 00:13:40 2001
+@@ -7,7 +7,7 @@
+
+ Counter32, Gauge32, TimeTicks,
+ OBJECT-TYPE, MODULE-IDENTITY,
+- NOTIFICATION-TYPE FROM SNMPv2-SMI
++ NOTIFICATION-TYPE, mib-2 FROM SNMPv2-SMI
+ MODULE-COMPLIANCE, OBJECT-GROUP,
+ NOTIFICATION-GROUP FROM SNMPv2-CONF
+ ifIndex FROM IF-MIB
+@@ -150,12 +150,12 @@
+
+ -- The DLSw MIB module contains an object part and a conformance part.
+ -- Object part is organized in the following groups:
+--- (1) dlswNode -- information about this DLSw
+--- (2) dlswTConn -- about adjacent DLSw partners
+--- (3) dlswInterface -- about which interfaces DLSw is active on
+--- (4) dlswDirectory -- about any directory of local/remote resources
+--- (5) dlswCircuit -- about established circuits.
+--- (6) dlswSdlc -- about SDLC data link switched devices
++-- (1) dlswNode - information about this DLSw
++-- (2) dlswTConn - about adjacent DLSw partners
++-- (3) dlswInterface - about which interfaces DLSw is active on
++-- (4) dlswDirectory - about any directory of local/remote resources
++-- (5) dlswCircuit - about established circuits.
++-- (6) dlswSdlc - about SDLC data link switched devices
+
+ dlswNode OBJECT IDENTIFIER ::= { dlswMIB 1 }
+ dlswTConn OBJECT IDENTIFIER ::= { dlswMIB 2 }
+@@ -168,9 +168,9 @@
+ -- THE NODE GROUP
+ -- *******************************************************************
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- DLSw Node Identity
+--- -------------------------------------------------------------------
++-- ===================================================================
+ dlswNodeVersion OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE (2))
+ MAX-ACCESS read-only
+@@ -211,9 +211,9 @@
+ "DLSW: Switch-to-Switch Protocol RFC 1795"
+ ::= { dlswNode 3 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- DLSw Code Capability
+--- -------------------------------------------------------------------
++-- ===================================================================
+ dlswNodeStdPacingSupport OBJECT-TYPE
+ SYNTAX INTEGER {
+ none (1), -- does not support DLSw
+@@ -238,9 +238,9 @@
+ scheme but never varies its receive window size."
+ ::= { dlswNode 4 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- DLSw Node Operational Objects
+--- -------------------------------------------------------------------
++--====================================================================
+ dlswNodeStatus OBJECT-TYPE
+ SYNTAX INTEGER {
+ active (1),
+@@ -339,10 +339,10 @@
+ -- TRANSPORT CONNECTION (aka: PARTNER DLSW)
+ -- *******************************************************************
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+
+ -- Transport Connection Statistics Objects
+--- -------------------------------------------------------------------
++-- ===================================================================
+ dlswTConnStat OBJECT IDENTIFIER ::= { dlswTConn 1 }
+
+ dlswTConnStatActiveConnections OBJECT-TYPE
+@@ -375,9 +375,9 @@
+ this means the transport connection failed unexpectedly."
+ ::= { dlswTConnStat 3 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- Transport Connection Configuration Table
+--- -------------------------------------------------------------------
++-- ===================================================================
+ dlswTConnConfigTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF DlswTConnConfigEntry
+ MAX-ACCESS not-accessible
+@@ -651,15 +651,15 @@
+ row definition out of use."
+ ::= { dlswTConnConfigEntry 13 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- Transport Connection Operation Table
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- (1) At most one transport connection can be connected between
+ -- this DLSw and one of its DLSw partners at a given time.
+ -- (2) Multiple transport types are supported.
+ -- (3) Since the entries may be reused, dlswTConnOperEntryTime
+ -- needs to be consulted for the possibility of counter reset.
+--- -------------------------------------------------------------------
++-- ===================================================================
+
+ dlswTConnOperTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF DlswTConnOperEntry
+@@ -1254,14 +1254,14 @@
+ connection, where `active' means not in `disconnected' state."
+ ::= { dlswTConnOperEntry 36 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- Transport Connection Specific
+--- -------------------------------------------------------------------
++-- ===================================================================
+ dlswTConnSpecific OBJECT IDENTIFIER ::= { dlswTConn 4 }
+ dlswTConnTcp OBJECT IDENTIFIER ::= { dlswTConnSpecific 1 }
+
+ -- ...................................................................
+--- TCP Transport Connection Specific -- Configuration
++-- TCP Transport Connection Specific - Configuration
+ -- ...................................................................
+ dlswTConnTcpConfigTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF DlswTConnTcpConfigEntry
+@@ -1328,7 +1328,7 @@
+ ::= { dlswTConnTcpConfigEntry 3 }
+
+ -- ...................................................................
+--- TCP Transport Connection Specific -- Operation
++-- TCP Transport Connection Specific - Operation
+ -- ...................................................................
+ dlswTConnTcpOperTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF DlswTConnTcpOperEntry
+@@ -1472,9 +1472,9 @@
+ -- transport address of the DLSw partner is cached.
+ -- *******************************************************************
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- Directory Related Statistical Objects
+--- -------------------------------------------------------------------
++-- ===================================================================
+ dlswDirStat OBJECT IDENTIFIER ::= { dlswDirectory 1 }
+
+ dlswDirMacEntries OBJECT-TYPE
+@@ -1556,9 +1556,9 @@
+ create new rows."
+ ::= { dlswDirStat 8 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- Directory Cache
+--- -------------------------------------------------------------------
++-- ===================================================================
+ dlswDirCache OBJECT IDENTIFIER ::= { dlswDirectory 2 }
+
+ -- ...................................................................
+@@ -1566,7 +1566,7 @@
+ -- All Possible combinations of values of these objects.
+ --
+ -- EntryType LocationType Location Status
+--- -------------- ------------ ------------------ --------------
++-- ============== ============ ================== ==============
+ -- userConfigured local ifEntry or 0.0 reachable, or
+ -- notReachable, or
+ -- unknown
+@@ -1743,7 +1743,7 @@
+ -- All Possible combinations of values of these objects.
+ --
+ -- EntryType LocationType Location Status
+--- -------------- ------------ ------------------ --------------
++-- ============== ============ ================== ==============
+ -- userConfigured local ifEntry or 0.0 reachable, or
+ -- notReachable, or
+ -- unknown
+@@ -1918,9 +1918,9 @@
+ following the RowStatus textual convention."
+ ::= { dlswDirNBEntry 9 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- Resource Locations
+--- -------------------------------------------------------------------
++-- ===================================================================
+
+ dlswDirLocate OBJECT IDENTIFIER ::= { dlswDirectory 3 }
+
+@@ -2056,9 +2056,9 @@
+ -- station that receives the initiation.
+ -- *******************************************************************
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- Statistics Related to Circuits
+--- -------------------------------------------------------------------
++-- ===================================================================
+ dlswCircuitStat OBJECT IDENTIFIER ::= { dlswCircuit 1 }
+
+ dlswCircuitStatActives OBJECT-TYPE
+@@ -2079,7 +2079,7 @@
+ or reactivated upon exiting `disconnected' state."
+ ::= { dlswCircuitStat 2 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- Circuit Table
+ --
+ -- This table is the DLSw entity's view of circuits. There will be
+@@ -2090,9 +2090,9 @@
+ -- this Circuit Table:
+ --
+ -- number of | Origin End Station Location
+--- entries in the |--------------------------------------
++-- entries in the |======================================
+ -- Circuit Table | internal local remote
+--- -----------------------|--------------------------------------
++-- =======================|======================================
+ -- Target | internal | NA 2 1
+ -- End | local | 2 2 1
+ -- Station | remote | 1 1 NA
+@@ -2106,7 +2106,7 @@
+ --
+ -- Most of statistics related to circuits can be collected
+ -- from LLC-2 Link Station Table.
+--- -------------------------------------------------------------------
++-- ===================================================================
+ dlswCircuitTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF DlswCircuitEntry
+ MAX-ACCESS not-accessible
+@@ -2814,7 +2814,7 @@
+ -- *******************************************************************
+ dlswTraps OBJECT IDENTIFIER ::= { dlswMIB 0 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- This section defines the well-known notifications sent by
+ -- DLSW agents.
+ -- Care must be taken to insure that no particular notification
+@@ -2827,7 +2827,7 @@
+ -- (3) Transport connection up/down
+
+ -- (4) Circuit up/down
+--- -------------------------------------------------------------------
++-- ===================================================================
+ --
+
+ dlswTrapTConnPartnerReject NOTIFICATION-TYPE
+@@ -2902,9 +2902,9 @@
+ dlswCompliances OBJECT IDENTIFIER ::= { dlswConformance 1 }
+ dlswGroups OBJECT IDENTIFIER ::= { dlswConformance 2 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- COMPLIANCE STATEMENTS
+--- -------------------------------------------------------------------
++-- ===================================================================
+
+ -- ...................................................................
+ -- Core compliance for all DLSw entities
+@@ -3245,9 +3245,9 @@
+ "Write access is not required."
+ ::= { dlswCompliances 5 }
+
+--- -------------------------------------------------------------------
++-- ===================================================================
+ -- CONFORMANCE GROUPS
+--- -------------------------------------------------------------------
++-- ===================================================================
+
+ -- ...................................................................
+ -- Node Conformance Group
+diff -ru /usr/local/share/snmp/rfc.orig/DSA-MIB.txt /usr/local/share/snmp/rfc/DSA-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/DSA-MIB.txt Sat Mar 3 17:15:36 2001
++++ /usr/local/share/snmp/rfc/DSA-MIB.txt Thu Feb 22 00:33:45 2001
+@@ -10,7 +10,7 @@
+ mib-2
+ FROM RFC1213-MIB
+ applIndex, DistinguishedName
+- FROM APPLICATION-MIB;
++ FROM NETWORK-SERVICES-MIB;
+
+ dsaMIB MODULE-IDENTITY
+ LAST-UPDATED "9311250000Z"
+diff -ru /usr/local/share/snmp/rfc.orig/FDDI-SMT73-MIB.txt /usr/local/share/snmp/rfc/FDDI-SMT73-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/FDDI-SMT73-MIB.txt Sat Mar 3 17:15:09 2001
++++ /usr/local/share/snmp/rfc/FDDI-SMT73-MIB.txt Tue Jan 23 00:11:46 2001
+@@ -3,6 +3,8 @@
+ IMPORTS
+ Counter
+ FROM RFC1155-SMI
++ transmission
++ FROM RFC1213-MIB
+ OBJECT-TYPE
+ FROM RFC-1212;
+
+diff -ru /usr/local/share/snmp/rfc.orig/HPR-MIB.txt /usr/local/share/snmp/rfc/HPR-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/HPR-MIB.txt Sat Mar 3 17:19:54 2001
++++ /usr/local/share/snmp/rfc/HPR-MIB.txt Tue Jan 23 00:25:54 2001
+@@ -18,7 +18,7 @@
+ FROM APPN-MIB;
+
+ hprMIB MODULE-IDENTITY
+- LAST-UPDATED "970514000000Z"
++ LAST-UPDATED "9705140000Z"
+ ORGANIZATION "AIW APPN / HPR MIB SIG"
+ CONTACT-INFO
+ "
+diff -ru /usr/local/share/snmp/rfc.orig/MIP-MIB.txt /usr/local/share/snmp/rfc/MIP-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/MIP-MIB.txt Sat Mar 3 17:17:42 2001
++++ /usr/local/share/snmp/rfc/MIP-MIB.txt Tue Jan 23 00:25:27 2001
+@@ -1,7 +1,7 @@
+ MIP-MIB DEFINITIONS ::= BEGIN
+
+ IMPORTS
+- Counter32, Gauge32, Integer32, IpAddress, experimental,
++ Counter32, Gauge32, Integer32, IpAddress, mib-2,
+ MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE
+ FROM SNMPv2-SMI
+ RowStatus, TruthValue, TimeStamp,
+@@ -2117,7 +2117,7 @@
+ function within a home agent."
+ ::= { mipGroups 12 }
+
+- mipSecNotifcationsGroup NOTIFICATION-GROUP
++ mipSecNotificationsGroup NOTIFICATION-GROUP
+ NOTIFICATIONS { mipAuthFailure }
+ STATUS current
+ DESCRIPTION
+diff -ru /usr/local/share/snmp/rfc.orig/Modem-MIB.txt /usr/local/share/snmp/rfc/Modem-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/Modem-MIB.txt Sat Mar 3 17:16:35 2001
++++ /usr/local/share/snmp/rfc/Modem-MIB.txt Mon Jan 22 23:53:08 2001
+@@ -23,7 +23,7 @@
+ E-mail: waldbusser@cmu.edu"
+ DESCRIPTION
+ "The MIB module for management of dial-up modems."
+- ::= { mdmMIB 1 }
++ ::= { mdmMib 1 }
+
+ mdmMib OBJECT IDENTIFIER ::= { mib-2 38 }
+
+diff -ru /usr/local/share/snmp/rfc.orig/PPP-LCP-MIB.txt /usr/local/share/snmp/rfc/PPP-LCP-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/PPP-LCP-MIB.txt Sat Mar 3 17:14:46 2001
++++ /usr/local/share/snmp/rfc/PPP-LCP-MIB.txt Sat Mar 3 23:13:27 2001
+@@ -182,7 +182,7 @@
+ ::= { pppLinkStatusEntry 5 }
+
+ pppLinkStatusLocalMRU OBJECT-TYPE
+- SYNTAX INTEGER(1..2147483648)
++ SYNTAX INTEGER(1..2147483647)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+@@ -195,7 +195,7 @@
+ ::= { pppLinkStatusEntry 6 }
+
+ pppLinkStatusRemoteMRU OBJECT-TYPE
+- SYNTAX INTEGER(1..2147483648)
++ SYNTAX INTEGER(1..2147483647)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+@@ -535,7 +535,7 @@
+ ::= { pppLqrEntry 2 }
+
+ pppLqrLocalPeriod OBJECT-TYPE
+- SYNTAX INTEGER(1..2147483648)
++ SYNTAX INTEGER(1..2147483647)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+@@ -548,7 +548,7 @@
+ ::= { pppLqrEntry 3 }
+
+ pppLqrRemotePeriod OBJECT-TYPE
+- SYNTAX INTEGER(1..2147483648)
++ SYNTAX INTEGER(1..2147483647)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+diff -ru /usr/local/share/snmp/rfc.orig/RDBMS-MIB.txt /usr/local/share/snmp/rfc/RDBMS-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/RDBMS-MIB.txt Sat Mar 3 17:16:41 2001
++++ /usr/local/share/snmp/rfc/RDBMS-MIB.txt Tue Jan 23 00:24:04 2001
+@@ -6,8 +6,8 @@
+ FROM SNMPv2-SMI
+ DisplayString, DateAndTime, AutonomousType
+ FROM SNMPv2-TC
+- applIndex, applGroup
+- FROM APPLICATION-MIB
++ applIndex, applGroups
++ FROM NETWORK-SERVICES-MIB
+ mib-2
+ FROM RFC1213-MIB;
+
+@@ -1263,8 +1263,8 @@
+ implement the RDBMS MIB"
+ MODULE HOST-RESOURCES-MIB
+ MANDATORY-GROUPS { hrSystem }
+- MODULE APPLICATION-MIB
+- MANDATORY-GROUPS { applGroup }
++ MODULE NETWORK-SERVICES-MIB
++ MANDATORY-GROUPS { applGroups }
+ MODULE RDBMS-MIB
+ MANDATORY-GROUPS { rdbmsGroup }
+
+Only in /usr/local/share/snmp/rfc: RFC-1215.txt
+diff -ru /usr/local/share/snmp/rfc.orig/RFC1414-MIB.txt /usr/local/share/snmp/rfc/RFC1414-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/RFC1414-MIB.txt Sat Mar 3 17:14:37 2001
++++ /usr/local/share/snmp/rfc/RFC1414-MIB.txt Tue Feb 20 00:25:21 2001
+@@ -3,6 +3,7 @@
+ IMPORTS
+ OBJECT-TYPE
+ FROM RFC-1212
++ mib-2,
+ tcpConnLocalAddress, tcpConnLocalPort,
+ tcpConnRemAddress, tcpConnRemPort
+ FROM RFC1213-MIB;
+diff -ru /usr/local/share/snmp/rfc.orig/SNA-NAU-MIB.txt /usr/local/share/snmp/rfc/SNA-NAU-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/SNA-NAU-MIB.txt Sat Mar 3 17:16:24 2001
++++ /usr/local/share/snmp/rfc/SNA-NAU-MIB.txt Mon Jan 22 23:57:44 2001
+@@ -17,7 +17,7 @@
+ DisplayString, RowStatus, TimeStamp, InstancePointer
+ FROM SNMPv2-TC
+
+- Counter32, Gauge32, Integer32,
++ Counter32, Gauge32, Integer32, mib-2,
+ OBJECT-TYPE, MODULE-IDENTITY, NOTIFICATION-TYPE
+ FROM SNMPv2-SMI
+
+diff -ru /usr/local/share/snmp/rfc.orig/TCPIPX-MIB.txt /usr/local/share/snmp/rfc/TCPIPX-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/TCPIPX-MIB.txt Sat Mar 3 17:17:17 2001
++++ /usr/local/share/snmp/rfc/TCPIPX-MIB.txt Sat Mar 3 16:51:11 2001
+@@ -1,6 +1,8 @@
+ TCPIPX-MIB DEFINITIONS ::= BEGIN
+
+ IMPORTS
++ enterprises
++ FROM RFC1155-SMI
+ OBJECT-TYPE
+ FROM RFC-1212;
+
+@@ -10,7 +12,7 @@
+
+ -- as hex digits, as in: nnnnnnnn:mmmmmmmmmmmm
+
+-IpxAddress ::= OCTET STRING (size (10))
++IpxAddress ::= OCTET STRING (SIZE (10))
+
+ -- TCP/IPX MIB object idenfifiers
+
+diff -ru /usr/local/share/snmp/rfc.orig/UPS-MIB.txt /usr/local/share/snmp/rfc/UPS-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/UPS-MIB.txt Sat Mar 3 17:16:01 2001
++++ /usr/local/share/snmp/rfc/UPS-MIB.txt Mon Jan 22 23:55:45 2001
+@@ -2,7 +2,7 @@
+
+ IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
+- OBJECT-IDENTITY, Counter32, Gauge32, Integer32
++ OBJECT-IDENTITY, Counter32, Gauge32, Integer32, mib-2
+ FROM SNMPv2-SMI
+ DisplayString, TimeStamp, TimeInterval, TestAndIncr,
+ AutonomousType
+diff -ru /usr/local/share/snmp/rfc.orig/SMUX-MIB.txt /usr/local/share/snmp/rfc/SMUX-MIB.txt
+--- /usr/local/share/snmp/rfc.orig/SMUX-MIB.txt 2002-06-15 15:31:22.000000000 +0200
++++ /usr/local/share/snmp/rfc/SMUX-MIB.txt 2002-06-15 15:31:22.000000000 +0200
+@@ -3,6 +3,8 @@
+ IMPORTS
+ enterprises
+ FROM RFC1155-SMI
++ DisplayString
++ FROM RFC1213-MIB
+ OBJECT-TYPE
+ FROM RFC1212;
+
+@@ -120,7 +122,7 @@
+ ::= { smuxTreeEntry 1 }
+
+ smuxTpriority OBJECT-TYPE
+- SYNTAX INTEGER (0..'07fffffff'h)
++ SYNTAX INTEGER (0..'7fffffff'h)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
diff --git a/mibs/smistrip b/mibs/smistrip
new file mode 100755
index 0000000..b5fc8f2
--- /dev/null
+++ b/mibs/smistrip
@@ -0,0 +1,179 @@
+#!/bin/sh
+#
+# smistrip --
+#
+# Extract MIB modules from text files, like RFCs or I-Ds.
+#
+# This is variant of smistrip from libsmi-0.2, modified to be somewhat
+# more aggressive in suppressing blank lines, and support the -x option.
+#
+# Copyright (c) 1999 Frank Strauss, Technical University of Braunschweig.
+# Modified by Niels Baggesen
+#
+# See the file "COPYING" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+# $Id$
+#
+# NOTE, that this script relies on awk (tested with GNU awk) and getopts
+# (shell builtin like in bash or standalone).
+#
+
+AWK=awk
+[ `uname` != SunOS ] || AWK=/usr/bin/nawk
+GETOPTS=getopts
+VERSION=0.3-cvs
+
+
+do_version () {
+ echo "smistrip $VERSION"
+}
+
+
+
+do_usage () {
+ echo "Usage: smistrip [-Vhn] [-d dir] [-s suffix] [-m modules] file ..."
+ echo "-V show version and license information"
+ echo "-v verbose"
+ echo "-h show usage information"
+ echo "-n do not write module files"
+ echo "-d dir write module to directory dir"
+ echo "-x suffix append suffix to the module file name"
+ echo "-m modules strip only the specified modules. For a list of modules"
+ echo " use : as a separator"
+ echo "file ... input files to parse (RFCs, I-Ds, ...)"
+}
+
+
+
+do_strip () {
+ cat $1 | $AWK -v test="$test" -v dir="$dir" -v single="$single" -v suffix="$suffix" -v verbose="$verbose" '
+
+ BEGIN {
+ if (length(single) != 0) {
+ single = ":"single":"
+ }
+ else {
+ single = ""
+ }
+ }
+
+ END {
+ if (single != "" && single != ":") {
+ gsub(":", " ", single)
+ print "WARNING: Module(s) not found:" single
+ }
+ }
+
+ # start of module
+ /^[ \t]*[A-Za-z0-9-]* *DEFINITIONS( +IMPLICIT +TAGS)? *::= *BEGIN/ {
+ module = $1
+ collect = 1
+ macro = 0
+ n = 0
+ }
+
+ # page footer - start skipping
+ /\[Page [iv0-9]*\] */ {
+ collect = 0
+ next
+ }
+
+ /^[ \t]*(::=|DESCRIPTION|SYNTAX|MAX-ACCESS|MIN-ACCESS|ACCESS|STATUS|REFERENCE|INDEX|AUGMENTS|DEFVAL|UNITS|DISPLAY|")/ {
+ if (collect)
+ if (line[n-1] == "") n--
+ }
+
+ # a blank line - suppress multiple
+ /^[ \t\r]*$/ {
+ if (collect)
+ if (line[n-1] != "" && line[n-1] !~ /,[ \t\r]*$/) line[n++] = ""
+ next
+ }
+
+ # collect non-blank line when inside mib module
+ /[^ \f\t]/ {
+ if (length(module) > 0) {
+ if (!collect)
+ collect = 1 # page header, stop skipping
+ else
+ line[n++] = $0
+ }
+ }
+
+ # remember when we enter a macro definition
+ / *MACRO *::=/ {
+ macro = 1
+ }
+
+ # end of module
+ /^[ \t]*END[ \t\r]*$/ {
+ if (macro)
+ macro = 0
+ else if (single == "" || match(single, ":"module":")) {
+ sub(":"module, "", single)
+ strip = 99
+ for (i = 0 ; i < n ; i++) {
+ # find the minimum column that contains non-blank characters
+ # in order to cut a blank prefix off.
+ p = match(line[i], "[^ ]")
+ if (p < strip && length(line[i]) > p) strip = p
+ }
+
+ if (test != "1") {
+ if (dir)
+ f = dir "/" module suffix
+ else
+ f = module suffix
+ for (i = 0 ; i < n ; i++)
+ print substr(line[i], strip) >f
+ }
+
+ if (verbose) {
+ print module ": " n " lines."
+ }
+ module = ""
+ collect = 0
+ }
+ else
+ print "NOTE: " module ": ignored."
+ }
+ '
+}
+
+
+while $GETOPTS Vvhnm:d:x: c ; do
+ case $c in
+ v) verbose=1
+ ;;
+ n) test=1
+ ;;
+ m) single=$OPTARG
+ ;;
+ d) dir=$OPTARG
+ ;;
+ x) suffix=$OPTARG
+ ;;
+ h) do_usage
+ exit 0
+ ;;
+ V) do_version
+ exit 0
+ ;;
+ *) do_usage
+ exit 1
+ ;;
+ esac
+done
+
+shift `expr $OPTIND - 1`
+
+if [ $# -eq 0 ] ; then
+ do_strip -
+else
+ for f in $@ ; do
+ do_strip $f
+ done
+fi
+
+exit 0
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..6b3b5fc
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id$
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/net-snmp-config.in b/net-snmp-config.in
new file mode 100644
index 0000000..2300fe1
--- /dev/null
+++ b/net-snmp-config.in
@@ -0,0 +1,700 @@
+#!/bin/sh
+#
+# $Id$
+#
+# this shell script is designed to merely dump the configuration
+# information about how the net-snmp package was compiled. The
+# information is particularly useful for applications that need to
+# link against the net-snmp libraries and hence must know about any
+# other libraries that must be linked in as well.
+
+check_build_dir()
+{
+ build_dir=$1
+
+ if test "x$build_dir" = "x" ; then
+ echo "You must specify a build directory."
+ exit 1
+ fi
+ # is it the src dir?
+ if test -f $build_dir/net-snmp-config.in ; then
+ return
+ fi
+ # make sure we can find build dir
+ if test ! -d $build_dir/snmplib/.libs ; then
+ echo "$build_dir does not appear to be a build directory."
+ exit 1
+ fi
+}
+
+# usage: index n arguments
+# effect: returns the (n+1)th argument
+index()
+{
+ eval echo \$`expr $1 + 1`
+}
+
+# usage: count arguments
+# effect: returns the number of arguments
+count()
+{
+ echo $#
+}
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+datarootdir=@datarootdir@
+NSC_LDFLAGS="@LDFLAGS@"
+
+NSC_LIBS="@LIBS@"
+NSC_LNETSNMPLIBS="@LNETSNMPLIBS@"
+NSC_LAGENTLIBS="@LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@"
+NSC_LMIBLIBS="@LMIBLIBS@"
+
+NSC_INCLUDEDIR=${includedir}
+NSC_LIBDIR=-L${libdir}
+
+NSC_SNMPLIBS="-lnetsnmp ${NSC_LNETSNMPLIBS}"
+NSC_SUBAGENTLIBS="-lnetsnmpagent ${NSC_LAGENTLIBS} ${NSC_SNMPLIBS}"
+NSC_AGENTLIBS="-lnetsnmpmibs ${NSC_LMIBLIBS} ${NSC_SUBAGENTLIBS}"
+
+NSC_PREFIX=$prefix
+NSC_EXEC_PREFIX=$exec_prefix
+NSC_SRCDIR=@srcdir@
+NSC_INCDIR=${NSC_PREFIX}/include
+
+NSC_BASE_SNMP_LIBS="-lnetsnmp"
+NSC_BASE_SUBAGENT_LIBS="-lnetsnmpagent ${NSC_BASE_SNMP_LIBS}"
+NSC_BASE_AGENT_LIBS="-lnetsnmpmibs ${NSC_BASE_SUBAGENT_LIBS}"
+
+NSC_SRC_LIBDIRS="agent/.libs snmplib/.libs"
+NSC_SRC_LIBDEPS="agent/.libs/libnetsnmpmibs.a agent/.libs/libnetsnmpagent.a snmplib/.libs/libnetsnmp.a"
+
+if test "x$NSC_SRCDIR" = "x." ; then
+ NSC_SRCDIR="NET-SNMP-SOURCE-DIR"
+fi
+
+if test "x$1" = "x"; then
+ usage="yes"
+else
+ while test "x$done" = "x" -a "x$1" != "x" -a "x$usage" != "xyes"; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ unset shifted
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ NSC_PREFIX=${prefix}
+ NSC_INCLUDEDIR=${prefix}/include
+ NSC_LIBDIR=-L${prefix}/lib
+ ;;
+
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ NSC_EXEC_PREFIX=${exec_prefix}
+ NSC_LIBDIR=-L${exec_prefix}/lib
+ ;;
+
+ --debug-tokens|--deb*|--dbg*)
+ echo "find $NSC_SRCDIR -name \"*.c\" -print | xargs grep DEBUGMSGT | grep \\\" | cut -f 2 -d\\\" | sort -u"
+ if test "x$NSC_SRCDIR" != "xNET-SNMP-SOURCE-DIR" ; then
+ /usr/bin/find $NSC_SRCDIR -name "*.c" -print | xargs grep DEBUGMSGT | grep \" | cut -f 2 -d\" | sort -u
+ fi
+ ;;
+ --indent-options|--in*)
+ echo "indent -orig -nbc -bap -nut -nfca `(cd $NSC_INCDIR/net-snmp; perl -n -e 'print "-T $1 " if (/}\s*(netsnmp_\w+)\s*;/);' */*.h)`"
+ ;;
+ --configure-options|--con*)
+ echo @CONFIGURE_OPTIONS@
+ ;;
+ --snmpd-module-list|--mod*)
+ @MODULE_LIST@
+ ;;
+ --default-mibs|--mibs|--MIBS)
+ echo @NETSNMP_DEFAULT_MIBS@
+ ;;
+ --default-mibdirs|--mibdirs|--MIBDIRS)
+ echo @NETSNMP_DEFAULT_MIBDIRS@
+ ;;
+ --env-separator)
+ echo "@ENV_SEPARATOR@"
+ ;;
+ --exeext)
+ echo "@EXEEXT@"
+ ;;
+ --snmpconfpath|--SNMPCONFPATH)
+ echo "@SNMPCONFPATH@@ENV_SEPARATOR@@SNMPSHAREPATH@@ENV_SEPARATOR@@SNMPLIBPATH@@ENV_SEPARATOR@$HOME/.snmp@ENV_SEPARATOR@@PERSISTENT_DIRECTORY@"
+ ;;
+ --persistent-directory|--persistent-dir)
+ echo @PERSISTENT_DIRECTORY@
+ ;;
+ --perlprog|--perl)
+ echo @PERLPROG@
+ ;;
+ #################################################### compile
+ --base-cflags)
+ echo @CFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR}
+ ;;
+ --cflags|--cf*)
+ echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR}
+ ;;
+ --srcdir)
+ echo $NSC_SRCDIR
+ ;;
+ #################################################### linking
+ --libdir|--lib-dir)
+ echo $NSC_LIBDIR
+ ;;
+ --ldflags|--ld*)
+ echo $NSC_LDFLAGS
+ ;;
+ --build-lib-dirs)
+ shift
+ build_dir=$1
+ check_build_dir $build_dir
+ for dir in $NSC_SRC_LIBDIRS; do
+ result="$result -L$build_dir/$dir"
+ done
+ echo $result
+ ;;
+ --build-lib-deps)
+ shift
+ build_dir=$1
+ check_build_dir $build_dir
+ for dir in $NSC_SRC_LIBDEPS; do
+ result="$result $build_dir/$dir"
+ done
+ echo $result
+ ;;
+ --build-includes)
+ shift
+ build_dir=$1
+ check_build_dir $build_dir
+ result="-I$build_dir/include"
+ if test "$build_dir" != "$NSC_SRCDIR" -a "$NSC_SRCDIR" != "NET-SNMP-SOURCE-DIR"
+ then
+ result="$result -I$NSC_SRCDIR/include"
+ fi
+ echo $result
+ ;;
+ --build-command)
+ echo "@CC@ @CFLAGS@ @DEVFLAGS@"
+ ;;
+ #################################################### client lib
+ --libs)
+ # use this one == --netsnmp-libs + --external-libs
+ echo $NSC_LDFLAGS $NSC_LIBDIR $NSC_SNMPLIBS $NSC_LIBS
+ ;;
+ --netsnmp-libs)
+ echo $NSC_LIBDIR $NSC_BASE_SNMP_LIBS
+ ;;
+ --external-libs)
+ echo $NSC_LDFLAGS $NSC_LNETSNMPLIBS $NSC_LIBS @PERLLDOPTS_FOR_APPS@
+ ;;
+ #################################################### agent lib
+ --base-agent-libs)
+ echo $NSC_BASE_AGENT_LIBS
+ ;;
+ --base-subagent-libs)
+ echo $NSC_BASE_SUBAGENT_LIBS
+ ;;
+ --agent-libs)
+ # use this one == --netsnmp-agent-libs + --external-libs
+ echo $NSC_LDFLAGS $NSC_LIBDIR $NSC_AGENTLIBS $NSC_LIBS
+ ;;
+ --netsnmp-agent-libs)
+ echo $NSC_LIBDIR $NSC_BASE_AGENT_LIBS
+ ;;
+ --external-agent-libs)
+ echo $NSC_LDFLAGS $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS
+ ;;
+ ####################################################
+ --version|--ver*)
+ echo @VERSION@
+ ;;
+ --help)
+ usage="yes"
+ ;;
+ --prefix|--pre*)
+ echo $NSC_PREFIX
+ ;;
+ --exec-prefix)
+ echo $NSC_EXEC_PREFIX
+ ;;
+ ####################################################
+ --create-snmpv3-user)
+ done=1
+ shift
+ net-snmp-create-v3-user $*
+ exit $?
+ ;;
+
+ ####################################################
+ --compile-subagent)
+ shift
+ shifted=1
+ while test "x$done" = "x" -a "x$1" != "x" ; do
+ case $1 in
+ --norm)
+ norm=1
+ shift
+ ;;
+ --cflags)
+ shift
+ if test "x$1" = "x" ; then
+ echo "You must specify the extra cflags"
+ exit 1
+ fi
+ cflags=$1
+ echo "setting extra cflags: $cflags"
+ shift
+ ;;
+ --ldflags)
+ shift
+ if test "x$1" = "x" ; then
+ echo "You must specify the extra ldflags"
+ exit 1
+ fi
+ ldflags=$1
+ echo "setting extra ldflags: $ldflags"
+ shift
+ ;;
+ --*)
+ echo "unknown suboption to --compile-subagent: $1"
+ exit 1
+ ;;
+ *)
+ if test "x$outname" = "x"; then
+ outname=$1
+ shift
+ else
+ done=1
+ fi
+ ;;
+ esac
+ done
+ tmpfile=netsnmptmp.$$.c
+ if test -f $tmpfile; then
+ echo "Ack. Can't create $tmpfile: already exists"
+ exit 1
+ fi
+ echo "generating the temporary code file: $tmpfile"
+ rm -f $tmpfile
+ cat > $tmpfile <<EOF
+/* generated from net-snmp-config */
+#include <net-snmp/net-snmp-config.h>
+#ifdef HAVE_SIGNAL
+#include <signal.h>
+#endif /* HAVE_SIGNAL */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+EOF
+
+ # If we were only given a single filename
+ # (and no explicit output name)
+ # then use that as the base of the output name
+ #
+ # If we weren't even given that, then bomb out
+ if test "x$1" = "x"; then
+ if test "x$outname" = "x"; then
+ echo "No MIB module codefile specified"
+ rm -f $tmpfile
+ exit 1
+ else
+ cfiles=$outname
+ outname=`basename $cfiles | sed 's/\.[co]$//'`
+ if test -f $outname.h; then
+ if grep "init_$outname" $outname.h; then
+ echo " #include \"$outname.h\"" >> $tmpfile
+ fi
+ fi
+ fi
+ fi
+
+ # add include files
+ while test "$1" != ""; do
+ cfiles="$cfiles $1"
+ name=`basename $1 | sed 's/\.[co]$//'`
+ if test -f $name.h; then
+ if grep "init_$name" $name.h; then
+ echo " #include \"$name.h\"" >> $tmpfile
+ fi
+ fi
+ shift
+ done
+
+ cat >> $tmpfile <<EOF
+const char *app_name = "$outname";
+static int reconfig = 0;
+
+extern int netsnmp_running;
+
+#ifdef __GNUC__
+#define UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#endif
+
+RETSIGTYPE
+stop_server(UNUSED int a) {
+ netsnmp_running = 0;
+}
+
+#ifdef SIGHUP
+RETSIGTYPE
+hup_handler(int sig)
+{
+ reconfig = 1;
+ signal(SIGHUP, hup_handler);
+}
+#endif
+
+static void
+usage(const char *prog)
+{
+ fprintf(stderr,
+ "USAGE: %s [OPTIONS]\n"
+ "\n"
+ "OPTIONS:\n", prog);
+
+ fprintf(stderr,
+ " -d\t\t\tdump all traffic\n"
+ " -D TOKEN[,...]\tturn on debugging output for the specified "
+ "TOKENs\n"
+ "\t\t\t (ALL gives extremely verbose debugging output)\n"
+ " -f\t\t\tDo not fork() from the calling shell.\n"
+ " -h\t\t\tdisplay this help message\n"
+ " -H\t\t\tdisplay a list of configuration file directives\n"
+ " -L LOGOPTS\t\tToggle various defaults controlling logging:\n");
+ snmp_log_options_usage("\t\t\t ", stderr);
+#ifndef DISABLE_MIB_LOADING
+ fprintf(stderr,
+ " -m MIB[:...]\t\tload given list of MIBs (ALL loads "
+ "everything)\n"
+ " -M DIR[:...]\t\tlook in given list of directories for MIBs\n");
+#endif /* DISABLE_MIB_LOADING */
+#ifndef DISABLE_MIB_LOADING
+ fprintf(stderr,
+ " -P MIBOPTS\t\tToggle various defaults controlling mib "
+ "parsing:\n");
+ snmp_mib_toggle_options_usage("\t\t\t ", stderr);
+#endif /* DISABLE_MIB_LOADING */
+ fprintf(stderr,
+ " -v\t\t\tdisplay package version number\n"
+ " -x TRANSPORT\tconnect to master agent using TRANSPORT\n");
+ exit(1);
+}
+
+static void
+version(void)
+{
+ fprintf(stderr, "NET-SNMP version: %s\n", netsnmp_get_version());
+ exit(0);
+}
+
+int
+main (int argc, char **argv)
+{
+ int arg;
+ char* cp = NULL;
+ int dont_fork = 0, do_help = 0;
+
+ while ((arg = getopt(argc, argv, "dD:fhHL:"
+#ifndef DISABLE_MIB_LOADING
+ "m:M:"
+#endif /* DISABLE_MIB_LOADING */
+ "n:"
+#ifndef DISABLE_MIB_LOADING
+ "P:"
+#endif /* DISABLE_MIB_LOADING */
+ "vx:")) != EOF) {
+ switch (arg) {
+ case 'd':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET, 1);
+ break;
+
+ case 'D':
+ debug_register_tokens(optarg);
+ snmp_set_do_debugging(1);
+ break;
+
+ case 'f':
+ dont_fork = 1;
+ break;
+
+ case 'h':
+ usage(argv[0]);
+ break;
+
+ case 'H':
+ do_help = 1;
+ break;
+
+ case 'L':
+ if (snmp_log_options(optarg, argc, argv) < 0) {
+ exit(1);
+ }
+ break;
+
+#ifndef DISABLE_MIB_LOADING
+ 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;
+#endif /* DISABLE_MIB_LOADING */
+
+ 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;
+
+#ifndef DISABLE_MIB_LOADING
+ case 'P':
+ cp = snmp_mib_toggle_options(optarg);
+ if (cp != NULL) {
+ fprintf(stderr, "Unknown parser option to -P: %c.\n", *cp);
+ usage(argv[0]);
+ }
+ break;
+#endif /* DISABLE_MIB_LOADING */
+
+ case 'v':
+ version();
+ break;
+
+ case 'x':
+ if (optarg != NULL) {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET, optarg);
+ } else {
+ usage(argv[0]);
+ }
+ break;
+
+ default:
+ fprintf(stderr, "invalid option: -%c\n", arg);
+ usage(argv[0]);
+ break;
+ }
+ }
+
+ if (do_help) {
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1);
+ } else {
+ /* we are a subagent */
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE, 1);
+
+ if (!dont_fork) {
+ if (netsnmp_daemonize(1, snmp_stderrlog_status()) != 0)
+ exit(1);
+ }
+
+ /* initialize tcpip, if necessary */
+ SOCK_STARTUP;
+ }
+
+ /* initialize the agent library */
+ init_agent(app_name);
+
+ /* initialize your mib code here */
+EOF
+
+ # add init routines
+ for i in $cfiles ; do
+ name=`basename $i | sed 's/\.[co]$//'`
+ echo checking for init_$name in $i
+ if grep "init_$name" $i ; then
+ echo " init_${name}();" >> $tmpfile
+ fi
+ done
+
+ # handle the main loop
+ cat >> $tmpfile <<EOF
+
+ /* $outname will be used to read $outname.conf files. */
+ init_snmp("$outname");
+
+ if (do_help) {
+ fprintf(stderr, "Configuration directives understood:\n");
+ read_config_print_usage(" ");
+ exit(0);
+ }
+
+ /* In case we received a request to stop (kill -TERM or kill -INT) */
+ netsnmp_running = 1;
+#ifdef SIGTERM
+ signal(SIGTERM, stop_server);
+#endif
+#ifdef SIGINT
+ signal(SIGINT, stop_server);
+#endif
+#ifdef SIGHUP
+ signal(SIGHUP, hup_handler);
+#endif
+
+ /* main loop here... */
+ while(netsnmp_running) {
+ if (reconfig) {
+ free_config();
+ read_configs();
+ reconfig = 0;
+ }
+ agent_check_and_process(1);
+ }
+
+ /* at shutdown time */
+ snmp_shutdown(app_name);
+
+ /* deinitialize your mib code here */
+EOF
+
+ # add shutdown routines
+
+ i=`count $cfiles`
+ while [ $i -gt 0 ] ; do
+ fullname=`index $i $cfiles`
+ name=`basename $fullname | sed 's/\.[co]$//'`
+ echo checking for shutdown_$name in $fullname
+ if grep "shutdown_$name" $fullname ; then
+ echo " shutdown_${name}();" >> $tmpfile
+ fi
+ i=`expr $i - 1`
+ done
+
+ # finish file
+ cat >> $tmpfile <<EOF
+
+ /* shutdown the agent library */
+ shutdown_agent();
+ SOCK_CLEANUP;
+ exit(0);
+}
+EOF
+ if test "$?" != 0 -o ! -f "$tmpfile" ; then
+ echo "Ack. Can't create $tmpfile."
+ exit 1
+ fi
+ cmd="@CC@ $cflags @CFLAGS@ @DEVFLAGS@ -I. -I${NSC_INCLUDEDIR} -o $outname $tmpfile $cfiles $NSC_LDFLAGS $NSC_LIBDIR $NSC_BASE_AGENT_LIBS $NSC_AGENTLIBS $ldflags"
+ echo "running: $cmd"
+ `$cmd`
+ if test "x$norm" != "x1" ; then
+ echo "removing the temporary code file: $tmpfile"
+ rm -f $tmpfile
+ else
+ echo "leaving the temporary code file: $tmpfile"
+ fi
+ if test -f $outname ; then
+ echo "subagent program $outname created"
+ fi
+ ;;
+
+ *)
+ echo "unknown option $1"
+ usage="yes"
+ ;;
+ esac
+ if [ "x$shifted" = "x" ] ; then
+ shift
+ fi
+ done
+fi
+
+if test "x$usage" = "xyes"; then
+ echo ""
+ echo "Usage:"
+ echo " net-snmp-config [--cflags] [--agent-libs] [--libs] [--version]"
+ echo " ... [see below for complete flag list]"
+ echo ""
+ echo " --version displays the net-snmp version number"
+ echo " --indent-options displays the indent options from the Coding Style"
+ echo " --debug-tokens displays a example command line to search to source"
+ echo " code for a list of available debug tokens"
+ echo ""
+ echo " SNMP Setup commands:"
+ echo ""
+ echo " --create-snmpv3-user creates a SNMPv3 user in Net-SNMP config file."
+ echo " See net-snmp-create-v3-user --help for list of"
+ echo " accepted options."
+ echo ""
+ echo " These options produce the various compilation flags needed when"
+ echo " building external SNMP applications:"
+ echo ""
+ echo " --base-cflags lists additional compilation flags needed"
+ echo " --cflags lists additional compilation flags needed"
+ echo " (includes -I. and extra developer warning flags)"
+ echo ""
+ echo " These options produce the various link flags needed when"
+ echo " building external SNMP applications:"
+ echo ""
+ echo " --libs lists libraries needed for building applications"
+ echo " --agent-libs lists libraries needed for building subagents"
+ echo ""
+ echo " These options produce various link flags broken down into parts."
+ echo " (Most of the time the simple options above should be used.)"
+ echo ""
+ echo " --libdir path to netsnmp libraries"
+ echo ""
+ echo " --base-agent-libs netsnmp specific agent libraries"
+ echo ""
+ echo " --netsnmp-libs netsnmp specific libraries (with path)"
+ echo " --netsnmp-agent-libs netsnmp specific agent libraries (with path)"
+ echo ""
+ echo " --ldflags link flags for external libraries"
+ echo " --external-libs external libraries needed by netsnmp libs"
+ echo " --external-agent-libs external libraries needed by netsnmp agent libs"
+ echo ""
+ echo " These options produce various link flags used when linking an"
+ echo " external application against an uninstalled build directory."
+ echo ""
+ echo " --build-includes include path to build/source includes"
+ echo " --build-lib-dirs link path to libraries"
+ echo " --build-lib-deps path to libraries for dependency target"
+ echo " --build-command command to compile \$3... to \$2"
+ echo ""
+ echo " Automated subagent building (produces an OUTPUTNAME binary file):"
+ echo " [this feature has not been tested very well yet. use at your risk.]"
+ echo ""
+ echo " --compile-subagent OUTPUTNAME [--norm] [--cflags flags]"
+ echo " [--ldflags flags] mibmodule1.c [...]]"
+ echo ""
+ echo " --norm leave the generated .c file around to read."
+ echo " --cflags flags extra cflags to use (e.g. -I...)."
+ echo " --ldflags flags extra ld flags to use (e.g. -L... -l...)."
+ echo ""
+ echo " Details on how the net-snmp package was compiled:"
+ echo ""
+ echo " --configure-options display original configure arguments"
+ echo " --prefix display the installation prefix"
+ echo " --snmpd-module-list display the modules compiled into the agent"
+ echo " --default-mibs display default list of MIBs"
+ echo " --default-mibdirs display default list of MIB directories"
+ echo " --snmpconfpath display default SNMPCONFPATH"
+ echo " --persistent-directory display default persistent directory"
+ echo " --perlprog display path to perl for the perl modules"
+ echo ""
+ exit
+fi
diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in
new file mode 100644
index 0000000..5288f3b
--- /dev/null
+++ b/net-snmp-create-v3-user.in
@@ -0,0 +1,168 @@
+#!/bin/sh
+#
+# $Id$
+#
+# this shell script is designed to add new SNMPv3 users
+# to Net-SNMP config file.
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+datarootdir=@datarootdir@
+NSC_LDFLAGS="@LDFLAGS@"
+NSC_INCLUDEDIR=${includedir}
+NSC_LIBDIR=-L${libdir}
+NSC_LIBS="@LIBS@"
+NSC_AGENTLIBS="@AGENTLIBS@ @PERLLDOPTS_FOR_APPS@"
+NSC_PREFIX=$prefix
+NSC_EXEC_PREFIX=$exec_prefix
+NSC_SRCDIR=@srcdir@
+NSC_INCDIR=${NSC_PREFIX}/include
+NSC_BASE_SUBAGENT_LIBS="-lnetsnmpagent -lnetsnmp"
+NSC_BASE_AGENT_LIBS="-lnetsnmpagent -lnetsnmpmibs -lnetsnmp"
+NSC_SRC_LIBDIRS="agent/.libs snmplib/.libs"
+NSC_SRC_LIBDEPS="agent/.libs/libnetsnmpmibs.a agent/.libs/libnetsnmpagent.a snmplib/.libs/libnetsnmp.a"
+
+if test "x$NSC_SRCDIR" = "x." ; then
+ NSC_SRCDIR="NET-SNMP-SOURCE-DIR"
+fi
+
+if @PSCMD@ | egrep ' snmpd *$' > /dev/null 2>&1 ; then
+ echo "Apparently at least one snmpd demon is already running."
+ echo "You must stop them in order to use this command."
+ exit 1
+fi
+
+Aalgorithm="MD5"
+Xalgorithm="DES"
+token=rwuser
+
+while test "x$done" = "x" -a "x$1" != "x" -a "x$usage" != "xyes"; do
+case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+esac
+
+unset shifted
+case $1 in
+ --version|--ver*)
+ echo @VERSION@
+ ;;
+ --help)
+ usage="yes"
+ ;;
+
+ -A|-a)
+ shift
+ if test "x$1" = "x" ; then
+ echo "You must specify an authentication algorithm or pass phrase"
+ exit 1
+ fi
+ case $1 in
+ MD5|SHA)
+ Aalgorithm=$1
+ shift
+ ;;
+ md5|sha)
+ Aalgorithm=`echo $1 | tr a-z A-Z`
+ shift
+ ;;
+ *)
+ apassphrase=$1
+ shift
+ ;;
+ esac
+ ;;
+ -X|-x)
+ shift
+ if test "x$1" = "x" ; then
+ echo "You must specify an encryption algorithm or pass phrase"
+ exit 1
+ fi
+ case $1 in
+ DES|AES|AES128)
+ Xalgorithm=$1
+ shift
+ ;;
+ des|aes|aes128)
+ Xalgorithm=`echo $1 | tr a-z A-Z`
+ shift
+ ;;
+ *)
+ xpassphrase=$1
+ shift
+ ;;
+ esac
+ ;;
+ -ro)
+ token="rouser"
+ shift
+ ;;
+ -*)
+ echo "unknown suboption to $0: $1"
+ usage=yes
+ done=1
+ ;;
+ *)
+ done=1
+ ;;
+ esac
+done
+
+if test "x$usage" = "xyes"; then
+ echo ""
+ echo "Usage:"
+ echo " net-snmp-create-v3-user [-ro] [-A authpass] [-X privpass]"
+ echo " [-a MD5|SHA] [-x DES|AES] [username]"
+ echo ""
+ exit
+fi
+
+if test "x$1" = "x" ; then
+ prompt=yes
+ echo "Enter a SNMPv3 user name to create: "
+ read user
+else
+ user=$1
+ shift
+fi
+if test "x$user" = "x" ; then
+ echo "You must specify a user name"
+ exit 1
+fi
+if test "x$apassphrase" = "x" ; then
+ prompt=yes
+ echo "Enter authentication pass-phrase: "
+ read apassphrase
+fi
+if test "x$apassphrase" = "x" ; then
+ echo "You must specify an authentication pass-phrase"
+ exit 1
+fi
+ if test "x$prompt" = "xyes" -a "x$xpassphrase" = "x" ; then
+ echo "Enter encryption pass-phrase: "
+ echo " [press return to reuse the authentication pass-phrase]"
+ read xpassphrase
+fi
+outdir="@PERSISTENT_DIRECTORY@"
+outfile="$outdir/snmpd.conf"
+line="createUser $user $Aalgorithm \"$apassphrase\" $Xalgorithm $xpassphrase"
+echo "adding the following line to $outfile:"
+echo " " $line
+# in case it hasn't ever been started yet, start it.
+if test ! -d $outdir ; then
+ mkdir $outdir
+fi
+if test ! -d $outfile ; then
+ touch $outfile
+fi
+echo $line >> $outfile
+outfile="@datadir@/snmp/snmpd.conf"
+line="$token $user"
+echo "adding the following line to $outfile:"
+echo " " $line
+if test ! -d $outfile ; then
+ touch $outfile
+fi
+echo $line >> $outfile
diff --git a/ov/Makefile.in b/ov/Makefile.in
new file mode 100644
index 0000000..ee8c37e
--- /dev/null
+++ b/ov/Makefile.in
@@ -0,0 +1,15 @@
+TARG = oid_to_type oid_to_sym
+
+all: $(TARG)
+
+oid_to_type: oid_to_type.in ../sedscript
+ $(SED) -f ../sedscript $(srcdir)/oid_to_type.in > oid_to_type
+
+oid_to_sym: oid_to_sym.in ../sedscript
+ $(SED) -f ../sedscript $(srcdir)/oid_to_sym.in > oid_to_sym
+
+clean:
+ rm -f $(TARG)
+
+install:
+
diff --git a/ov/README b/ov/README
new file mode 100644
index 0000000..5963d15
--- /dev/null
+++ b/ov/README
@@ -0,0 +1,31 @@
+This directory contains support files for HP-OpenView. Some of the
+files need to be built and depend on the config.h and sedscript files
+in the top level source directory. You should, therefore, run 'make'
+before installing these files. Installation is by hand, since I don't
+want to be responsible for messing up your OpenView configuration.
+
+If you install all these files properly, then do a 'ovstop', an
+'ovstart', an 'ovw -fields', and an 'ovw -verify' you should start
+seeing new icons appear for all ucd-snmp controlled packages. If they
+don't appear immediately, its probably because OV's netmon process
+hasn't changed the symbol ID for it yet. You can test a specific host
+by selecting it and then doing a
+'Diagnose/Network Connectivity/Demand Poll' on it from ovw.
+
+oid_to_sym: Translates sysObjectID results to OV icon types.
+ - Append this to /etc/opt/OV/share/conf/C/oid_to_sym
+ - Optionally replace Computer:UCD with Computer:Workstation if you
+ don't want to install the bitmaps.
+
+oid_to_type: Translates sysObjectID results to OV description strings
+ - Append this to /etc/opt/OV/share/conf/oid_to_type
+
+UCD-fields: Adds the UCD agent types to the "SNMPAgent" OpenView field.
+ - Copy to /etc/opt/OV/share/fields/C/
+
+UCD-Computer: OV Computer Class additions
+ - Copy to /etc/opt/OV/share/symbols/C/
+
+bitmaps/*: Bitmaps/Icons for ovw
+ - Copy the contents of the directory to /etc/opt/OV/share/bitmaps/C/computer/
+
diff --git a/ov/UCD-Computer b/ov/UCD-Computer
new file mode 100644
index 0000000..3d12cdf
--- /dev/null
+++ b/ov/UCD-Computer
@@ -0,0 +1,9 @@
+SymbolType "Computer" : "UCD"
+{
+ Filebase "UCD";
+ CursorSize 38;
+
+ Capabilities {
+ isWorkstation = 1;
+ }
+}
diff --git a/ov/UCD-fields b/ov/UCD-fields
new file mode 100644
index 0000000..5e0be0c
--- /dev/null
+++ b/ov/UCD-fields
@@ -0,0 +1,32 @@
+Field "SNMPAgent" {
+ Type Enumeration;
+ Flags capability, general, locate;
+ Enumeration
+ "Unset",
+ "UCD HP-UX 9",
+ "UCD HP-UX 10",
+ "UCD SunOS4",
+ "UCD Solaris",
+ "UCD OSF",
+ "UCD Ultrix",
+ "UCD NetBSD",
+ "UCD FreeBSD",
+ "UCD IRIX",
+ "UCD Linux",
+ "UCD BSD/OS",
+ "UCD OpenBSD",
+ "UCD Win32",
+ "UCD HP-UX 11",
+ "UCD AIX",
+ "UCD Mac OS X",
+ "UCD Dragonfly",
+ "UCD Unknown",
+ "UCDavis Agent";
+}
+
+Field "vendor" {
+ Type Enumeration;
+ Flags capability, general, locate;
+ Enumeration "Unset",
+ "UCDavis";
+}
diff --git a/ov/bitmaps/UCD.20.m b/ov/bitmaps/UCD.20.m
new file mode 100644
index 0000000..01727b5
--- /dev/null
+++ b/ov/bitmaps/UCD.20.m
@@ -0,0 +1,8 @@
+#define UCD_width 20
+#define UCD_height 20
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0xf0, 0xff, 0x01, 0xf0, 0xff, 0x01,
+ 0xf0, 0xff, 0x01, 0xf0, 0xff, 0x01, 0xf0, 0xff, 0x01, 0xf0, 0xff, 0x01,
+ 0xf0, 0xff, 0x01, 0xf0, 0xff, 0x01, 0xf0, 0xff, 0x01, 0xf0, 0xff, 0x01,
+ 0xe0, 0xff, 0x01, 0xe0, 0xff, 0x00, 0xf0, 0xff, 0x01, 0xf8, 0xff, 0x03,
+ 0xf8, 0xff, 0x03, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.20.p b/ov/bitmaps/UCD.20.p
new file mode 100644
index 0000000..f9b1f43
--- /dev/null
+++ b/ov/bitmaps/UCD.20.p
@@ -0,0 +1,8 @@
+#define UCD_width 20
+#define UCD_height 20
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xe0, 0xbf, 0x01, 0x60, 0xb0, 0x01,
+ 0x20, 0xa0, 0x01, 0xa0, 0xb5, 0x01, 0xa0, 0xb5, 0x01, 0x20, 0xa0, 0x01,
+ 0x20, 0xa0, 0x01, 0xe0, 0xbf, 0x01, 0x00, 0x80, 0x01, 0xf0, 0xff, 0x01,
+ 0xe0, 0xff, 0x01, 0xa0, 0xda, 0x00, 0x50, 0xa5, 0x01, 0xa0, 0x4a, 0x03,
+ 0xf8, 0xff, 0x03, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.26.m b/ov/bitmaps/UCD.26.m
new file mode 100644
index 0000000..818ed9f
--- /dev/null
+++ b/ov/bitmaps/UCD.26.m
@@ -0,0 +1,12 @@
+#define UCD_width 26
+#define UCD_height 26
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00,
+ 0xe0, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0x3f, 0x00,
+ 0xe0, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0x3f, 0x00,
+ 0xe0, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0x3f, 0x00,
+ 0xe0, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0x3f, 0x00,
+ 0xe0, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0x0f, 0x00,
+ 0xe0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x7f, 0x00,
+ 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.26.p b/ov/bitmaps/UCD.26.p
new file mode 100644
index 0000000..04c3636
--- /dev/null
+++ b/ov/bitmaps/UCD.26.p
@@ -0,0 +1,12 @@
+#define UCD_width 26
+#define UCD_height 26
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
+ 0xc0, 0xff, 0x17, 0x00, 0xc0, 0x57, 0x37, 0x00, 0xc0, 0x00, 0x36, 0x00,
+ 0xc0, 0x00, 0x34, 0x00, 0x40, 0xb5, 0x35, 0x00, 0x40, 0x95, 0x36, 0x00,
+ 0x40, 0x95, 0x36, 0x00, 0x40, 0xb7, 0x35, 0x00, 0x40, 0x00, 0x34, 0x00,
+ 0xc0, 0x00, 0x36, 0x00, 0xc0, 0xff, 0x37, 0x00, 0x00, 0x00, 0x30, 0x00,
+ 0xe0, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x55, 0x1a, 0x00, 0x80, 0xaa, 0x34, 0x00, 0x40, 0x55, 0x6a, 0x00,
+ 0xa0, 0xa8, 0xd4, 0x00, 0xf8, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.32.m b/ov/bitmaps/UCD.32.m
new file mode 100644
index 0000000..86da4bd
--- /dev/null
+++ b/ov/bitmaps/UCD.32.m
@@ -0,0 +1,14 @@
+#define UCD_width 32
+#define UCD_height 32
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03,
+ 0xe0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
+ 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
+ 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
+ 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
+ 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
+ 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0x07,
+ 0x00, 0xff, 0x7f, 0x00, 0x80, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0x01,
+ 0xc0, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07,
+ 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x1f, 0xe0, 0xff, 0xff, 0x1f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.32.p b/ov/bitmaps/UCD.32.p
new file mode 100644
index 0000000..5062c98
--- /dev/null
+++ b/ov/bitmaps/UCD.32.p
@@ -0,0 +1,14 @@
+#define UCD_width 32
+#define UCD_height 32
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0xc0, 0xff, 0xff, 0x02, 0xc0, 0xaf, 0xf4, 0x06, 0xc0, 0x01, 0xc0, 0x06,
+ 0xc0, 0x00, 0xc0, 0x06, 0xc0, 0x00, 0x80, 0x06, 0xc0, 0xd2, 0x9d, 0x06,
+ 0x40, 0x52, 0xa4, 0x06, 0x40, 0x52, 0xa4, 0x06, 0xc0, 0x52, 0xa4, 0x06,
+ 0x40, 0x52, 0xa4, 0x06, 0xc0, 0xde, 0x9d, 0x06, 0x40, 0x00, 0x80, 0x06,
+ 0xc0, 0x00, 0xc0, 0x06, 0xc0, 0x01, 0xe0, 0x06, 0xc0, 0xff, 0xff, 0x06,
+ 0x00, 0x00, 0x00, 0x06, 0xe0, 0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0x07,
+ 0x00, 0x00, 0x40, 0x00, 0x80, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x80, 0xaa, 0xaa, 0x01, 0x00, 0x55, 0x51, 0x02, 0x80, 0x8a, 0xaa, 0x06,
+ 0x00, 0x00, 0x00, 0x0c, 0xf0, 0xff, 0xff, 0x1f, 0xe0, 0xff, 0xff, 0x1f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.38.m b/ov/bitmaps/UCD.38.m
new file mode 100644
index 0000000..bb54189
--- /dev/null
+++ b/ov/bitmaps/UCD.38.m
@@ -0,0 +1,19 @@
+#define UCD_width 38
+#define UCD_height 38
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xff,
+ 0xff, 0x7f, 0xc0, 0xc0, 0xff, 0xff, 0x7f, 0xc0, 0xc0, 0xff, 0xff, 0xff,
+ 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0,
+ 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff,
+ 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0,
+ 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff,
+ 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff,
+ 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0,
+ 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff,
+ 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0,
+ 0xc0, 0xff, 0xff, 0xff, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xc0, 0x00, 0xfe,
+ 0xff, 0x0f, 0xc0, 0x00, 0xff, 0xff, 0x1f, 0xc0, 0x00, 0xff, 0xff, 0x1f,
+ 0xc0, 0x80, 0xff, 0xff, 0x3f, 0xc0, 0x80, 0xff, 0xff, 0x3f, 0xc0, 0xc0,
+ 0xff, 0xff, 0x7f, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xc0, 0xe0, 0xff, 0xff,
+ 0xff, 0xc1, 0xe0, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0xff, 0xff, 0xff, 0xc3,
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xc0};
diff --git a/ov/bitmaps/UCD.38.p b/ov/bitmaps/UCD.38.p
new file mode 100644
index 0000000..dddc15a
--- /dev/null
+++ b/ov/bitmaps/UCD.38.p
@@ -0,0 +1,19 @@
+#define UCD_width 38
+#define UCD_height 38
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
+ 0x00, 0x40, 0xc0, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x00, 0xff, 0xff, 0xcf,
+ 0xc0, 0x00, 0xbf, 0x4b, 0xcf, 0xc0, 0x00, 0x07, 0x00, 0xcc, 0xc0, 0x00,
+ 0x03, 0x00, 0xcc, 0xc0, 0x00, 0x03, 0x00, 0xcc, 0xc0, 0x00, 0x03, 0x00,
+ 0xc8, 0xc0, 0x00, 0x01, 0x00, 0xc8, 0xc0, 0x00, 0x93, 0xde, 0xc9, 0xc0,
+ 0x00, 0x91, 0x42, 0xca, 0xc0, 0x00, 0x91, 0x42, 0xca, 0xc0, 0x00, 0x93,
+ 0x42, 0xca, 0xc0, 0x00, 0xf1, 0xde, 0xc9, 0xc0, 0x00, 0x01, 0x00, 0xc8,
+ 0xc0, 0x00, 0x01, 0x00, 0xc8, 0xc0, 0x00, 0x01, 0x00, 0xc8, 0xc0, 0x00,
+ 0x03, 0x00, 0xcc, 0xc0, 0x00, 0x0f, 0x00, 0xcf, 0xc0, 0x00, 0xff, 0xff,
+ 0xcf, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0xc0,
+ 0xc0, 0xff, 0xff, 0xff, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00,
+ 0x00, 0x08, 0xc0, 0x00, 0x54, 0x95, 0x12, 0xc0, 0x00, 0xaa, 0x2a, 0x15,
+ 0xc0, 0x00, 0x00, 0x00, 0x20, 0xc0, 0x80, 0xaa, 0x2a, 0x35, 0xc0, 0x00,
+ 0x55, 0x55, 0x4a, 0xc0, 0x80, 0xaa, 0xaa, 0xd4, 0xc0, 0x00, 0x00, 0x00,
+ 0x80, 0xc1, 0xe0, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0xff, 0xff, 0xff, 0xc3,
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xc0};
diff --git a/ov/bitmaps/UCD.44.m b/ov/bitmaps/UCD.44.m
new file mode 100644
index 0000000..008861e
--- /dev/null
+++ b/ov/bitmaps/UCD.44.m
@@ -0,0 +1,25 @@
+#define UCD_width 44
+#define UCD_height 44
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xfe, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x07, 0x00,
+ 0x00, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x03, 0x00,
+ 0x00, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00,
+ 0x80, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x00,
+ 0xe0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00,
+ 0xf0, 0xff, 0xff, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x01,
+ 0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.44.p b/ov/bitmaps/UCD.44.p
new file mode 100644
index 0000000..7a76f37
--- /dev/null
+++ b/ov/bitmaps/UCD.44.p
@@ -0,0 +1,25 @@
+#define UCD_width 44
+#define UCD_height 44
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0xfc, 0xff, 0xff, 0x19, 0x00, 0x00, 0xfc, 0xdf, 0xf5, 0x19, 0x00,
+ 0x00, 0x3c, 0x00, 0xc0, 0x19, 0x00, 0x00, 0x1c, 0x00, 0x80, 0x19, 0x00,
+ 0x00, 0x0c, 0x00, 0x00, 0x19, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x19, 0x00,
+ 0x00, 0x0c, 0x00, 0x00, 0x19, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x19, 0x00,
+ 0x00, 0x04, 0x00, 0x00, 0x19, 0x00, 0x00, 0x44, 0xf2, 0x1c, 0x19, 0x00,
+ 0x00, 0x4c, 0x12, 0x24, 0x19, 0x00, 0x00, 0x44, 0x12, 0x24, 0x19, 0x00,
+ 0x00, 0x44, 0x12, 0x24, 0x19, 0x00, 0x00, 0xcc, 0xf3, 0x1c, 0x19, 0x00,
+ 0x00, 0x04, 0x00, 0x00, 0x19, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x19, 0x00,
+ 0x00, 0x04, 0x00, 0x80, 0x19, 0x00, 0x00, 0x0c, 0x00, 0x80, 0x19, 0x00,
+ 0x00, 0x0c, 0x00, 0x80, 0x19, 0x00, 0x00, 0x3c, 0x00, 0xf0, 0x19, 0x00,
+ 0x00, 0xfc, 0xff, 0xff, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xfe, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x0e, 0x00, 0x80, 0x07, 0x00,
+ 0x00, 0xa6, 0xaa, 0x4a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0xa8, 0xaa, 0x4a, 0x05, 0x00, 0x00, 0x54, 0x55, 0x85, 0x0a, 0x00,
+ 0x00, 0xaa, 0xaa, 0x4a, 0x15, 0x00, 0x00, 0x55, 0x55, 0x85, 0x2a, 0x00,
+ 0x80, 0x1a, 0xc0, 0x4a, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x01,
+ 0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.50.m b/ov/bitmaps/UCD.50.m
new file mode 100644
index 0000000..b70ca2a
--- /dev/null
+++ b/ov/bitmaps/UCD.50.m
@@ -0,0 +1,33 @@
+#define UCD_width 50
+#define UCD_height 50
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01,
+ 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff,
+ 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe,
+ 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00,
+ 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff,
+ 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff,
+ 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00,
+ 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01,
+ 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff,
+ 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe,
+ 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00,
+ 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff,
+ 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff,
+ 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00,
+ 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01,
+ 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff,
+ 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8,
+ 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x00,
+ 0x00, 0xf0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x3f,
+ 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xfe, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x80,
+ 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x07,
+ 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xe0, 0xff, 0xff, 0xff,
+ 0xff, 0x1f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff,
+ 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.50.p b/ov/bitmaps/UCD.50.p
new file mode 100644
index 0000000..0185bd7
--- /dev/null
+++ b/ov/bitmaps/UCD.50.p
@@ -0,0 +1,33 @@
+#define UCD_width 50
+#define UCD_height 50
+static char UCD_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
+ 0xf8, 0xff, 0xff, 0x9f, 0x01, 0x00, 0x00, 0xf8, 0xff, 0x9c, 0x9f, 0x01,
+ 0x00, 0x00, 0x78, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00,
+ 0x98, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x98, 0x01, 0x00, 0x00, 0x18,
+ 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x90, 0x01, 0x00,
+ 0x00, 0x18, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x90,
+ 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x18, 0xc9,
+ 0x73, 0x90, 0x01, 0x00, 0x00, 0x08, 0x49, 0x90, 0x90, 0x01, 0x00, 0x00,
+ 0x08, 0x49, 0x90, 0x90, 0x01, 0x00, 0x00, 0x08, 0x49, 0x90, 0x90, 0x01,
+ 0x00, 0x00, 0x08, 0x49, 0x90, 0x90, 0x01, 0x00, 0x00, 0x18, 0xcf, 0x73,
+ 0x90, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0x90, 0x01, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x98,
+ 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x98, 0x01, 0x00, 0x00, 0x38, 0x00,
+ 0x00, 0x9c, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x80, 0x9f, 0x01, 0x00, 0x00,
+ 0xf8, 0xff, 0xff, 0x9f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff,
+ 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x38,
+ 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x98, 0xaa, 0xaa, 0x3a, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x2a, 0x2a,
+ 0x00, 0x00, 0x00, 0x50, 0x55, 0x55, 0x55, 0x00, 0x00, 0x00, 0xa8, 0xaa,
+ 0x2a, 0xaa, 0x00, 0x00, 0x00, 0x54, 0x55, 0x55, 0x54, 0x01, 0x00, 0x00,
+ 0xaa, 0xaa, 0x2a, 0xaa, 0x02, 0x00, 0x00, 0x55, 0x00, 0x55, 0x54, 0x05,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff,
+ 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00};
diff --git a/ov/bitmaps/UCD.fields b/ov/bitmaps/UCD.fields
new file mode 100644
index 0000000..2f0c4ee
--- /dev/null
+++ b/ov/bitmaps/UCD.fields
@@ -0,0 +1,21 @@
+Field "SNMPAgent" {
+ Type Enumeration;
+ Flags capability, general, locate;
+ Enumeration
+ "Unset",
+ "UCD HP-UX 9",
+ "UCD HP-UX 10",
+ "UCD SunOS4",
+ "UCD Solaris",
+ "UCD OSF/3",
+ "UCD Ultrix",
+ "UCD Unknown",
+ "UCDavis Agent";
+}
+
+Field "vendor" {
+ Type Enumeration;
+ Flags capability, general, locate;
+ Enumeration "Unset",
+ "UCDavis";
+}
diff --git a/ov/oid_to_sym.in b/ov/oid_to_sym.in
new file mode 100644
index 0000000..3fcc073
--- /dev/null
+++ b/ov/oid_to_sym.in
@@ -0,0 +1,18 @@
+EXTENSIBLEDOTMIB.AGENTID.HPUX9ID:Computer:UCD # UCD HP-UX 9
+EXTENSIBLEDOTMIB.AGENTID.HPUX10ID:Computer:UCD # UCD HP-UX 10
+EXTENSIBLEDOTMIB.AGENTID.SUNOS4ID:Computer:UCD # UCD SunOS4
+EXTENSIBLEDOTMIB.AGENTID.SOLARISID:Computer:UCD # UCD Solaris
+EXTENSIBLEDOTMIB.AGENTID.OSFID:Computer:UCD # UCD OSF
+EXTENSIBLEDOTMIB.AGENTID.ULTRIXID:Computer:UCD # UCD Ultrix
+EXTENSIBLEDOTMIB.AGENTID.NETBSD1ID:Computer:UCD # UCD NetBSD
+EXTENSIBLEDOTMIB.AGENTID.FREEBSDID:Computer:UCD # UCD FreeBSD
+EXTENSIBLEDOTMIB.AGENTID.IRIXID:Computer:UCD # UCD IRIX
+EXTENSIBLEDOTMIB.AGENTID.LINUXID:Computer:UCD # UCD LINUX
+EXTENSIBLEDOTMIB.AGENTID.BSDIID:Computer:UCD # UCD BSD/OS
+EXTENSIBLEDOTMIB.AGENTID.OPENBSDID:Computer:UCD # UCD OpenBSD
+EXTENSIBLEDOTMIB.AGENTID.WIN32ID:Computer:UCD # UCD Win32
+EXTENSIBLEDOTMIB.AGENTID.HPUX11ID:Computer:UCD # UCD HP-UX 11
+EXTENSIBLEDOTMIB.AGENTID.AIXID:Computer:UCD # UCD AIX
+EXTENSIBLEDOTMIB.AGENTID.MACOSXID:Computer:UCD # UCD Mac OS X
+EXTENSIBLEDOTMIB.AGENTID.DRAGONFLYID:Computer:UCD # UCD DragonFly
+EXTENSIBLEDOTMIB.AGENTID.UNKNOWNID:Computer:UCD # UCD Unknown
diff --git a/ov/oid_to_type.in b/ov/oid_to_type.in
new file mode 100644
index 0000000..84743a6
--- /dev/null
+++ b/ov/oid_to_type.in
@@ -0,0 +1,18 @@
+EXTENSIBLEDOTMIB.AGENTID.HPUX9ID:Hewlett-Packard:UCD HP-UX 9
+EXTENSIBLEDOTMIB.AGENTID.HPUX10ID:Hewlett-Packard:UCD HP-UX 10
+EXTENSIBLEDOTMIB.AGENTID.SUNOS4ID:Sun:UCD SunOS4
+EXTENSIBLEDOTMIB.AGENTID.SOLARISID:Sun:UCD Solaris
+EXTENSIBLEDOTMIB.AGENTID.OSFID:DEC:UCD OSF
+EXTENSIBLEDOTMIB.AGENTID.ULTRIXID:DEC:UCD Ultrix
+EXTENSIBLEDOTMIB.AGENTID.NETBSD1ID:NetBSD:UCD NetBSD
+EXTENSIBLEDOTMIB.AGENTID.FREEBSDID:FreeBSD:UCD FreeBSD
+EXTENSIBLEDOTMIB.AGENTID.IRIXID:SGI:UCD IRIX
+EXTENSIBLEDOTMIB.AGENTID.LINUXID:Linux:UCD Linux
+EXTENSIBLEDOTMIB.AGENTID.BSDIID:BSDI:UCD BSD/OS
+EXTENSIBLEDOTMIB.AGENTID.OPENBSDID:OpenBSD:UCD OpenBSD
+EXTENSIBLEDOTMIB.AGENTID.WIN32ID:Microsoft:UCD Win32
+EXTENSIBLEDOTMIB.AGENTID.HPUX11ID:Hewlett-Packard:UCD HP-UX 11
+EXTENSIBLEDOTMIB.AGENTID.AIXID:IBM:UCD AIX
+EXTENSIBLEDOTMIB.AGENTID.MACOSXID:Apple:UCD Mac OS X
+EXTENSIBLEDOTMIB.AGENTID.DRAGONFLYID:Computer:UCD # UCD DragonFly
+EXTENSIBLEDOTMIB.AGENTID.UNKNOWNID:Unset:UCD Unknown
diff --git a/perl/ASN/ASN.pm b/perl/ASN/ASN.pm
new file mode 100644
index 0000000..272048c
--- /dev/null
+++ b/perl/ASN/ASN.pm
@@ -0,0 +1,163 @@
+package NetSNMP::ASN;
+
+use strict;
+use warnings;
+use Carp;
+
+require Exporter;
+require DynaLoader;
+use AutoLoader;
+
+use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION $AUTOLOAD);
+
+@ISA = qw(Exporter DynaLoader);
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration use NetSNMP::ASN ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+%EXPORT_TAGS = ( 'all' => [ qw(
+ ASN_APPLICATION
+ ASN_BIT_STR
+ ASN_BOOLEAN
+ ASN_COUNTER
+ ASN_COUNTER64
+ ASN_DOUBLE
+ ASN_FLOAT
+ ASN_GAUGE
+ ASN_INTEGER
+ ASN_INTEGER64
+ ASN_IPADDRESS
+ ASN_NULL
+ ASN_OBJECT_ID
+ ASN_OCTET_STR
+ ASN_OPAQUE
+ ASN_SEQUENCE
+ ASN_SET
+ ASN_TIMETICKS
+ ASN_UNSIGNED
+ ASN_UNSIGNED64
+) ] );
+
+@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+@EXPORT = qw(
+ ASN_APPLICATION
+ ASN_BIT_STR
+ ASN_BOOLEAN
+ ASN_COUNTER
+ ASN_COUNTER64
+ ASN_DOUBLE
+ ASN_FLOAT
+ ASN_GAUGE
+ ASN_INTEGER
+ ASN_INTEGER64
+ ASN_IPADDRESS
+ ASN_NULL
+ ASN_OBJECT_ID
+ ASN_OCTET_STR
+ ASN_OPAQUE
+ ASN_SEQUENCE
+ ASN_SET
+ ASN_TIMETICKS
+ ASN_UNSIGNED
+ ASN_UNSIGNED64
+);
+$VERSION = '5.0702';
+
+sub AUTOLOAD {
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function. If a constant is not found then control is passed
+ # to the AUTOLOAD in AutoLoader.
+
+ my $constname;
+ ($constname = $AUTOLOAD) =~ s/.*:://;
+ croak "& not defined" if $constname eq 'constant';
+ my $val;
+ ($!, $val) = constant($constname);
+ if ($! != 0) {
+ if ($! =~ /Invalid/ || $!{EINVAL}) {
+ $AutoLoader::AUTOLOAD = $AUTOLOAD;
+ goto &AutoLoader::AUTOLOAD;
+ }
+ else {
+ croak "Your vendor has not defined NetSNMP::ASN macro $constname";
+ }
+ }
+ {
+ no strict 'refs';
+ # Fixed between 5.005_53 and 5.005_61
+# if ($] >= 5.00561) {
+# *$AUTOLOAD = sub () { $val };
+# }
+# else {
+ *$AUTOLOAD = sub { $val };
+# }
+ }
+ goto &$AUTOLOAD;
+}
+
+bootstrap NetSNMP::ASN $VERSION;
+
+# Preloaded methods go here.
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+
+=head1 NAME
+
+NetSNMP::ASN - Perl extension for SNMP ASN.1 types
+
+=head1 SYNOPSIS
+
+ use NetSNMP::ASN qw(:all);
+ my $asn_int = ASN_INTEGER;
+
+=head1 DESCRIPTION
+
+The NetSNMP::ASN module provides the ASN.1 types for SNMP.
+
+=head2 EXPORT
+
+None by default.
+
+=head2 Exportable constants
+
+ ASN_APPLICATION
+ ASN_BIT_STR
+ ASN_BOOLEAN
+ ASN_COUNTER
+ ASN_COUNTER64
+ ASN_DOUBLE
+ ASN_FLOAT
+ ASN_GAUGE
+ ASN_INTEGER
+ ASN_INTEGER64
+ ASN_IPADDRESS
+ ASN_NULL
+ ASN_OBJECT_ID
+ ASN_OCTET_STR
+ ASN_OPAQUE
+ ASN_SEQUENCE
+ ASN_SET
+ ASN_TIMETICKS
+ ASN_UNSIGNED
+ ASN_UNSIGNED64
+
+
+=head1 AUTHOR
+
+Wes Hardaker, E<lt>hardaker@users.sourceforge.netE<gt>
+
+=head1 SEE ALSO
+
+SNMP(3pm), NetSNMP::OID(3pm)
+
+perl(1).
+
+=cut
diff --git a/perl/ASN/ASN.xs b/perl/ASN/ASN.xs
new file mode 100644
index 0000000..e3f6181
--- /dev/null
+++ b/perl/ASN/ASN.xs
@@ -0,0 +1,177 @@
+/* -*- C -*- */
+#if defined(_WIN32) && !defined(_WIN32_WINNT)
+#define _WIN32_WINNT 0x501
+#endif
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_impl.h>
+
+#define TEST_CONSTANT(value, name, C) \
+ if (strEQ(name, #C)) { \
+ *value = C; \
+ return 0; \
+ }
+
+static int constant_ASN_O(double *value, const char *name, const int len)
+{
+ switch (len >= 5 ? name[5] : -1) {
+ case 'B':
+ TEST_CONSTANT(value, name, ASN_OBJECT_ID);
+ break;
+ case 'C':
+ TEST_CONSTANT(value, name, ASN_OCTET_STR);
+ break;
+ case 'P':
+ TEST_CONSTANT(value, name, ASN_OPAQUE);
+ break;
+ }
+ return EINVAL;
+}
+
+static int constant_ASN_B(double *value, const char *name, const int len)
+{
+ switch (len >= 5 ? name[5] : -1) {
+ case 'I':
+ TEST_CONSTANT(value, name, ASN_BIT_STR);
+ break;
+ case 'O':
+ TEST_CONSTANT(value, name, ASN_BOOLEAN);
+ break;
+ }
+ return EINVAL;
+}
+
+static int constant_ASN_S(double *value, const char *name, const int len)
+{
+ switch (len >= 6 ? name[6] : -1) {
+ case 'Q':
+ TEST_CONSTANT(value, name, ASN_SEQUENCE);
+ break;
+ case 'T':
+ TEST_CONSTANT(value, name, ASN_SET);
+ break;
+ }
+ return EINVAL;
+}
+
+static int constant_ASN_C(double *value, const char *name, const int len)
+{
+ switch (len >= 11 ? name[11] : -1) {
+ case '\0':
+ TEST_CONSTANT(value, name, ASN_COUNTER);
+ break;
+ case '6':
+ TEST_CONSTANT(value, name, ASN_COUNTER64);
+ break;
+ }
+ return EINVAL;
+}
+
+static int constant_ASN_U(double *value, const char *name, const int len)
+{
+ switch (len >= 12 ? name[12] : -1) {
+ case '\0':
+ TEST_CONSTANT(value, name, ASN_UNSIGNED);
+ break;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case '6':
+ TEST_CONSTANT(value, name, ASN_UNSIGNED64);
+ break;
+#endif
+ }
+ return EINVAL;
+}
+
+static int constant_ASN_IN(double *value, const char *name, const int len)
+{
+ switch (len >= 11 ? name[11] : -1) {
+ case '\0':
+ TEST_CONSTANT(value, name, ASN_INTEGER);
+ break;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case '6':
+ TEST_CONSTANT(value, name, ASN_INTEGER64);
+ break;
+#endif
+ }
+ return EINVAL;
+}
+
+static int constant_ASN_I(double* value, const char *name, const int len)
+{
+ switch (len >= 5 ? name[5] : -1) {
+ case 'N':
+ return constant_ASN_IN(value, name, len);
+ case 'P':
+ TEST_CONSTANT(value, name, ASN_IPADDRESS);
+ break;
+ }
+ return EINVAL;
+}
+
+static int constant(double *value, const char *const name, const int len)
+{
+ if (!strnEQ(name, "ASN_", 4))
+ return EINVAL;
+
+ switch (name[4]) {
+ case 'A':
+ TEST_CONSTANT(value, name, ASN_APPLICATION);
+ break;
+ case 'B':
+ return constant_ASN_B(value, name, len);
+ case 'C':
+ return constant_ASN_C(value, name, len);
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case 'D':
+ TEST_CONSTANT(value, name, ASN_DOUBLE);
+ break;
+ case 'F':
+ TEST_CONSTANT(value, name, ASN_FLOAT);
+ break;
+#endif
+ case 'G':
+ TEST_CONSTANT(value, name, ASN_GAUGE);
+ break;
+ case 'I':
+ return constant_ASN_I(value, name, len);
+ case 'N':
+ TEST_CONSTANT(value, name, ASN_NULL);
+ break;
+ case 'O':
+ return constant_ASN_O(value, name, len);
+ case 'S':
+ return constant_ASN_S(value, name, len);
+ case 'T':
+ TEST_CONSTANT(value, name, ASN_TIMETICKS);
+ break;
+ case 'U':
+ return constant_ASN_U(value, name, len);
+ }
+ return EINVAL;
+}
+
+
+MODULE = NetSNMP::ASN PACKAGE = NetSNMP::ASN
+
+
+void
+constant(sv)
+ PREINIT:
+ STRLEN len;
+ INPUT:
+ SV * sv
+ char * s = SvPV(sv, len);
+ INIT:
+ int status;
+ double value;
+ PPCODE:
+ value = 0;
+ status = constant(&value, s, len);
+ XPUSHs(sv_2mortal(newSVuv(status)));
+ XPUSHs(sv_2mortal(newSVnv(value)));
diff --git a/perl/ASN/Changes b/perl/ASN/Changes
new file mode 100644
index 0000000..9b117f5
--- /dev/null
+++ b/perl/ASN/Changes
@@ -0,0 +1,6 @@
+Revision history for Perl extension NetSNMP::ASN.
+
+0.01 Fri Jan 18 10:33:43 2002
+ - original version; created by h2xs 1.20 with options
+ -n NetSNMP::ASN myconst.h
+
diff --git a/perl/ASN/MANIFEST b/perl/ASN/MANIFEST
new file mode 100644
index 0000000..02c1199
--- /dev/null
+++ b/perl/ASN/MANIFEST
@@ -0,0 +1,6 @@
+ASN.pm
+ASN.xs
+Changes
+MANIFEST
+Makefile.PL
+test.pl
diff --git a/perl/ASN/Makefile.PL b/perl/ASN/Makefile.PL
new file mode 100644
index 0000000..4576781
--- /dev/null
+++ b/perl/ASN/Makefile.PL
@@ -0,0 +1,233 @@
+use ExtUtils::MakeMaker;
+require 5;
+use Config;
+use Getopt::Long;
+my $lib_version;
+
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+
+%MakeParams = InitMakeParams();
+
+WriteMakefile(%MakeParams);
+
+Check_Version();
+
+sub InitMakeParams {
+ my $opts;
+ my %Params = (
+ 'NAME' => 'NetSNMP::ASN',
+ 'VERSION_FROM' => 'ASN.pm', # finds $VERSION
+ 'XSPROTOARG' => '-prototypes',
+ 'PREREQ_PM' => {},
+ );
+
+ if ($ENV{'OSTYPE'} eq 'msys') {
+ $Params{'DEFINE'} = "-DMINGW_PERL";
+ }
+
+ my ($snmp_lib, $snmp_llib, $sep);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+ $opts = NetSNMPGetOpts();
+ $Params{'DEFINE'} = "-DMSVC_PERL -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS";
+ $sep = '\\';
+ $snmp_lib_file = 'netsnmp.lib';
+ $snmp_link_lib = 'netsnmp';
+
+ if (lc($opts->{'debug'}) eq "true") {
+ $lib_dir = 'lib\\debug';
+ }
+ else {
+ $lib_dir = 'lib\\release';
+ }
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L$basedir\\win32\\$lib_dir\\ -l$snmp_link_lib";
+ }
+ else {
+ my @LibDirs = split (';',$ENV{LIB});
+ my $LibDir;
+ if ($opts->{'prefix'}) {
+ push (@LibDirs,"$ENV{'NET-SNMP-PATH'}${sep}lib");
+ }
+ $noLibDir = 1;
+ while ($noLibDir) {
+ $LibDir = find_files(["$snmp_lib_file"],\@LibDirs);
+ if ($LibDir ne '') {
+ $noLibDir = 0;
+ # Put quotes around LibDir to allow spaces in paths
+ $LibDir = '"' . $LibDir . '"';
+ }
+ else
+ {
+ @LibDirs = ();
+ $LibDirs[0] = prompt("The Net-SNMP library ($snmp_lib_file) could not be found.\nPlease enter the directory where it is located:");
+ $LibDirs[0] =~ s/\\$//;
+ }
+ }
+ $Params{LIBS} = "-L$LibDir -l$snmp_link_lib";
+ }
+
+ $Params{'INC'} = "-I$basedir\\include\\ -I$basedir\\include\\net-snmp\\ -I$basedir\\win32\\ ";
+ }
+ else
+ {
+ $opts = NetSNMPGetOpts();
+ $Params{'LDDLFLAGS'} = "$Config{lddlflags} " . `$opts->{'nsconfig'} --ldflags`;
+ $Params{'LIBS'} = `$opts->{'nsconfig'} --libs`;
+ chomp($Params{'LIBS'});
+ $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
+ chomp($Params{'CCFLAGS'});
+ $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
+ $lib_version = `$opts->{'nsconfig'} --version`;
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
+ $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
+ }
+ $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
+ die "You need to install net-snmp first (I can't find net-snmp-config)";
+ }
+ }
+ return (%Params);
+}
+# common subroutines -- DO NOT EDIT.
+# They are imported from the Makefile.subs.pl file
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ # we allow for perl/CPAN-only revisions beyond the default
+ # version formatting of net-snmp itself.
+ $perlver =~ s/(\.\d{5}).*/\1/;
+ $perlver =~ s/0*$//;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/ASN/netsnmp-feature-definitions.h b/perl/ASN/netsnmp-feature-definitions.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/perl/ASN/netsnmp-feature-definitions.h
diff --git a/perl/ASN/test.pl b/perl/ASN/test.pl
new file mode 100644
index 0000000..0429b6e
--- /dev/null
+++ b/perl/ASN/test.pl
@@ -0,0 +1,28 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..9\n"; }
+END {print "not ok 1\n" unless $loaded;}
+use NetSNMP::ASN (':all');
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
+print ((ASN_INTEGER == 2) ? "ok 2\n" : "not ok 2\n");
+print ((ASN_OCTET_STR == 4) ? "ok 3\n" : "not ok 3\bn");
+print ((ASN_COUNTER == 0x41) ? "ok 4\n" : "not ok 4\n");
+print ((ASN_UNSIGNED == 0x42) ? "ok 5\n" : "not ok 5\n");
+print ((ASN_COUNTER64 == 0x46) ? "ok 6\n" : "not ok 6\n");
+print ((ASN_IPADDRESS == 0x40) ? "ok 7\n" : "not ok 7\n");
+print ((ASN_NULL == 5) ? "ok 8\n" : "not ok 8\n");
+print ((ASN_TIMETICKS == 0x43) ? "ok 9\n" : "not ok 9\n");
diff --git a/perl/AnyData_SNMP/Changes b/perl/AnyData_SNMP/Changes
new file mode 100644
index 0000000..39d8a86
--- /dev/null
+++ b/perl/AnyData_SNMP/Changes
@@ -0,0 +1 @@
+none.
diff --git a/perl/AnyData_SNMP/DBD_AnyData.patch b/perl/AnyData_SNMP/DBD_AnyData.patch
new file mode 100644
index 0000000..56ed3bb
--- /dev/null
+++ b/perl/AnyData_SNMP/DBD_AnyData.patch
@@ -0,0 +1,48 @@
+--- ../AnyData-0.05/DBD/AnyData.pm Tue Jul 17 12:31:44 2001
++++ DBD/AnyData.pm Wed Oct 31 13:08:37 2001
+@@ -63,7 +63,7 @@
+ # PARSE EXTRA STRINGS IN DSN HERE
+ # Process attributes from the DSN; we assume ODBC syntax
+ # here, that is, the DSN looks like var1=val1;...;varN=valN
+- my $var;
++ my ($var, $defaultselector, %defaultflags);
+ $dbh->STORE('f_dir','./');
+ foreach $var (split(/;/, $dbname)) {
+ #######################################################
+@@ -80,9 +80,13 @@
+ #######################################################
+ # Patch from Wes Hardaker
+ #######################################################
+- } elsif( $var =~ m/^\s*?default=(\S+)/i ){
+- # Default catalog selector to use
+- $dbh->func('__default',$1, 'ad_catalog');
++ } elsif( $var =~ m/^\s*?ad_default=(\S+)/i ){
++ # Default catalog selector to use
++ $defaultselector = $1;
++ } elsif( $defaultselector &&
++ $var =~ m/^\s*?ad_${defaultselector}_(\S+)=(\S+)/i ) {
++ # Add to selector flags.
++ $defaultflags{$1} = $2;
+ #######################################################
+ } elsif ($var =~ /(.*?)=(.*)/) {
+ my $key = $1;
+@@ -90,6 +94,10 @@
+ $dbh->STORE($key, $val);
+ }
+ }
++ if ($defaultselector) {
++ $dbh->func('__default', $defaultselector, '', \%defaultflags,
++ 'ad_catalog');
++ }
+ ### $dbh->func('read_catalog_from_disk');
+ $dbh;
+ }
+@@ -520,7 +528,7 @@
+ my($self, $data, $fields) = @_;
+ my $requested_cols=[];
+ my @rc = $data->{f_stmt}->columns();
+- push @$requested_cols, $_->{column} for @rc;
++ push @$requested_cols, $_->{name} for @rc;
+ unshift @$fields, $requested_cols;
+ $self->{ad}->push_row(@$fields);
+ 1;
diff --git a/perl/AnyData_SNMP/Format.pm b/perl/AnyData_SNMP/Format.pm
new file mode 100644
index 0000000..4f3860d
--- /dev/null
+++ b/perl/AnyData_SNMP/Format.pm
@@ -0,0 +1,109 @@
+package AnyData::Format::SNMP;
+#
+# AnyData interface to SNMP queries
+#
+
+use strict;
+use warnings;
+use AnyData::Format::Base;
+use vars qw( @ISA );
+@AnyData::Format::SNMP::ISA = qw( AnyData::Format::Base );
+use Data::Dumper;
+
+sub storage_type {
+# print "calling storage type\n"; 'SNMP';
+}
+
+sub new {
+# print "new format: ", Dumper(@_), "\n";
+ my $class = shift;
+ my $self = shift || {};
+ bless $self, $class;
+ $self->{'storage'} = 'SNMP';
+ $self->{'has_update_function'} = 'SNMP';
+# print Dumper($self), "\n";
+ return $self;
+ 2;
+}
+
+sub get_col_names {
+# print "get_col_names\n";
+ # XXX: get mib column names
+ 2;
+}
+
+sub seek_first_record {
+# print "seek_first\n";
+ my $self = shift;
+ my $var = [$self->{'mibnode'}];
+ $self->{'session'}->getnext($var);
+ 2;
+}
+
+sub get_pos {
+# print "get_pos\n";
+ 2;
+}
+
+sub go_pos {
+# print "go_pos\n";
+ 2;
+}
+
+sub delete_record {
+# print "del_rec\n";
+ 2;
+}
+
+sub get_record {
+# print "get_record\n";
+ 2;
+}
+
+sub push_row {
+# print "push_row\n";
+ 2;
+}
+
+sub truncate {
+# print "truncate\n";
+ 2;
+}
+
+sub close_table {
+# print "close_table\n";
+ 2;
+}
+
+sub drop {
+# print "drop\n";
+ 2;
+}
+
+sub seek {
+# print "seek\n";
+ 2;
+}
+
+sub write_fields {
+# print STDERR "write_fields: ",Dumper(\@_), "\n";
+ my $self = shift;
+ my @ary = @_;
+ return \@ary;
+}
+sub read_fields {
+# print STDERR "read_fields: ",Dumper(\@_), "\n";
+ my $self = shift;
+ my $aryref = shift;
+ return @$aryref;
+}
+
+sub get_data {
+# print "get_data\n";
+ 2;
+}
+
+sub init_parser {
+# print "init_parser\n";
+ 2;
+}
diff --git a/perl/AnyData_SNMP/INSTALL b/perl/AnyData_SNMP/INSTALL
new file mode 100644
index 0000000..1337846
--- /dev/null
+++ b/perl/AnyData_SNMP/INSTALL
@@ -0,0 +1,44 @@
+NOTE NOTE NOTE: this module depends on a modified version of the
+DBD::AnyData module. Do not get the original version from Jeff
+Zucker. He and I are working together to resolve the extra features I
+need, but we haven't quite merged yet.
+
+*** This is currently alpha level code!!! ***
+
+Install steps:
+ 0) install the DBI perl module (run: perl -MCPAN -e "install DBI")
+ and the DBD::File perl module (run: perl -MCPAN -e "install DBD::File")
+
+ 1) download, and install the modified AnyData perl modules from:
+ http://www.net-snmp.org/AnyData-wes/AnyData-0.05.tar.gz
+ http://www.net-snmp.org/AnyData-wes/DBD-AnyData-0.05.wes.tar.gz
+ http://www.net-snmp.org/AnyData-wes/SQL-Statement-1.004.tar.gz
+
+ Extract each of the above tar balls and in the resulting
+ directories run:
+
+ perl Makefile.PL
+ make
+ make install (as root)
+
+ 2) Then in this directory, run:
+ perl Makefile.PL
+ make
+ make install (as root)
+
+To use it:
+ SQL like Shell script:
+ netsh [snmpcmd arguments] HOST [SQL COMMAND]
+
+ Example commands to type at the prompt:
+ select * from ifTable
+ select * from ifTable where ifDescr = 'eth0'
+ alias ifconfig select ifDescr, ifAdminStatus where ifDescr = '\1'
+ ifconfig eth0
+
+
+[Jeff Zucker's original (unpatched) AnyData perl modules can be found
+ at http://www.vpservices.com/jeff/programs/AnyData/ . However, do not
+ use the modules from this site as they won't work with the software in
+ this directory. (Use the download sites in step 1 below instead.) It
+ is a good source for documentation about the AnyData modules.]
diff --git a/perl/AnyData_SNMP/MANIFEST b/perl/AnyData_SNMP/MANIFEST
new file mode 100644
index 0000000..5192993
--- /dev/null
+++ b/perl/AnyData_SNMP/MANIFEST
@@ -0,0 +1,7 @@
+INSTALL
+README
+MANIFEST
+Makefile.PL
+Format.pm
+Storage.pm
+DBD_AnyData.patch
diff --git a/perl/AnyData_SNMP/Makefile.PL b/perl/AnyData_SNMP/Makefile.PL
new file mode 100644
index 0000000..8106650
--- /dev/null
+++ b/perl/AnyData_SNMP/Makefile.PL
@@ -0,0 +1,14 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'AnyData::SNMP',
+ 'VERSION_FROM' => 'Storage.pm', # finds $VERSION
+ 'PREREQ_PM' => {# SNMP => 5.0,
+ AnyData => 0}, # e.g., Module::Name => 1.1
+ 'PM' => {
+ 'Format.pm' => '$(INST_LIBDIR)/Format/SNMP.pm',
+ 'Storage.pm' => '$(INST_LIBDIR)/Storage/SNMP.pm',
+ },
+ 'EXE_FILES' => [qw(netsh)]
+);
diff --git a/perl/AnyData_SNMP/README b/perl/AnyData_SNMP/README
new file mode 100644
index 0000000..7b0fb08
--- /dev/null
+++ b/perl/AnyData_SNMP/README
@@ -0,0 +1,21 @@
+The AnyData::SNMP module is really an augmentation to Jeff Zucker's
+excellent perl AnyData and DBD::AnyData modules. It is designed to
+allow the infamous perl DBI module to translate SQL commands directly
+into network SNMP requests and to manipulate the data in perl
+afterward. See the perl DBI documentation for further details, as
+well as the AnyData documentation.
+
+The netsh command then implements a standard shell around the sql to
+SNMP mapping, such that commands like the following are possible:
+
+ netsh -c public localhost 'select ifIndex, ifDescr, ifType from ifTable'
+ netsh -c public localhost 'update ifTable set ifAdminStatus = 2 where ifType = 6'
+
+Without a command to run, netsh puts you into an interactive shell
+where the commands can be typed at a command prompt.
+
+See the INSTALL file for the necessary prerequisites. Note that this
+currently makes use of a patched copy of the DBD::AnyData module.
+This will be fixed in future versions of both this module and the
+DBD::AnyData module as the authors worth toward a common
+infrastructure.
diff --git a/perl/AnyData_SNMP/Storage.pm b/perl/AnyData_SNMP/Storage.pm
new file mode 100644
index 0000000..489aad9
--- /dev/null
+++ b/perl/AnyData_SNMP/Storage.pm
@@ -0,0 +1,428 @@
+#########################################################################
+package AnyData::Storage::SNMP;
+#########################################################################
+
+## XXX: TODO:
+## scalar sets?
+## multi-hosts
+
+$AnyData::Storage::VERSION = '5.0702';
+use strict;
+use warnings;
+
+use vars qw(@basecols);
+
+@AnyData::Storage::SNMP::basecols = qw(hostname iid);
+$AnyData::Storage::SNMP::iidptr = 1; # must match array column of above
+@AnyData::Storage::SNMP::basetypes = qw(OCTETSTR OBJECTID);
+$AnyData::Storage::SNMP::debug = 0;
+$AnyData::Storage::SNMP::debugre = undef;
+
+use Data::Dumper;
+use AnyData::Storage::File;
+use SNMP;
+SNMP::init_snmp("AnyData::SNMP");
+
+sub new {
+# DEBUG("calling AnyData::Storage::SNMP new\n");
+# DEBUG("new storage: ",Dumper(\@_),"\n");
+ my $class = shift;
+ my $self = shift || {};
+ $self->{open_mode} = 'c';
+ return bless $self, $class;
+}
+
+sub open_table {
+ DEBUG("calling AnyData::Storage::SNMP open_table\n");
+ my ($self, $parser, $table, $mode, $tname) = @_;
+ $self->{'process_table'} = $tname;
+ DEBUG("open_table: ",Dumper(\@_),"\n");
+}
+
+sub get_col_names {
+ DEBUG("calling AnyData::Storage::SNMP get_col_names\n");
+ my ($self, $parser, $tname) = @_;
+ DEBUG("get_col_names\n",Dumper(\@_),"\n");
+ $tname = $self->{'process_table'} if (!$tname);
+
+ # get cached previous results
+ return $self->{col_names}{$tname} if (defined($self->{col_names}{$tname}));
+
+ # table name
+ $tname = $self->{'process_table'} if (!$tname);
+
+ # mib node setup
+ my $mib = $SNMP::MIB{$tname} || return warn "no such table $tname";
+ my $entry = $mib->{'children'}[0];
+
+ # base columns and types
+ my @cols = @AnyData::Storage::SNMP::basecols;
+ my @types = @AnyData::Storage::SNMP::basetypes;
+ my %donecol;
+ my $count = $#cols;
+
+ foreach my $index (@{$entry->{'indexes'}}) {
+ push @cols, $index;
+ push @types, $SNMP::MIB{$index}{type};
+ $donecol{$index} = 1;
+ $count++;
+ if ($SNMP::MIB{$index}{parent}{label} eq $entry->{label}) {
+ # this index is a member of this table
+ $self->{columnmap}[$count] = $index;
+ $self->{coloffset} += 1;
+ }
+ }
+
+ # search children list
+ foreach my $child ( sort { $a->{'subID'} <=> $b->{'subID'} } @{$entry->{'children'}}) {
+ push @{$self->{real_cols}}, $child->{'label'};
+ next if ($donecol{$child->{label}});
+ push @cols, $child->{'label'};
+ push @types, $child->{'type'};
+ $count++;
+ $self->{columnmap}[$count] = $child->{'label'};
+ }
+
+ # save for later.
+ $parser->{col_names} = \@cols;
+ $self->{col_types} = \@types;
+ $self->{col_names} = \@cols;
+ map { $self->{col_uc_map}{uc($_)} = $_ } @cols;
+ return \@cols;
+}
+
+sub set_col_nums {
+ DEBUG("calling AnyData::Storage::SNMP set_col_nums\n");
+ DEBUG("set_col_nums\n",Dumper(\@_),"\n");
+ my ($self, $tname) = @_;
+ return $self->{col_nums} if (defined($self->{col_nums}));
+ my $mib = $SNMP::MIB{$tname};
+ my $entry = $mib->{'children'}[0];
+ my (%cols, %mibnodes);
+ my $cnt = -1;
+
+ foreach my $i (@{$self->{col_names}}) {
+ $cols{$i} = ++$cnt;
+ }
+
+ $self->{col_nums} = \%cols;
+ return \%cols;
+}
+
+# not needed?
+sub get_file_handle {
+ DEBUG("calling AnyData::Storage::SNMP get_file_handle\n");
+ DEBUG("get_file_handle\n",Dumper(\@_),"\n");
+ return shift;
+}
+
+# not needed?
+sub get_file_name {
+ DEBUG("calling AnyData::Storage::SNMP get_file_name\n");
+ DEBUG("get_file_name\n",Dumper(\@_),"\n");
+ my $self = shift;
+ return $self->{process_table} || $self->{table_name};
+}
+
+sub truncate {
+ DEBUG("calling AnyData::Storage::SNMP truncate\n");
+ my ($self) = @_;
+ DEBUG("trunacte, ", Dumper(@_));
+
+ # We must know how to delete rows or else this is all pointless.
+# return $self->{col_nums}{$tname} if (defined($self->{col_nums}{$tname}));
+ my $tablemib = $SNMP::MIB{$self->{process_table}};
+ my $entrymib = $tablemib->{'children'}[0];
+ my ($delcolumn, $delcolumnname, $delcolumnvalue);
+
+ foreach my $child (@{$entrymib->{'children'}}) {
+ if ($child->{'textualConvention'} eq 'RowStatus') {
+ $delcolumn = $child->{subID};
+ $delcolumnname = $child->{label};
+ $delcolumnvalue = 6; # destroy
+ last;
+ }
+ }
+ if (!$delcolumn) {
+ return warn "Can't (or don't know how to) delete from table $self->{process_table}. Failing.\n";
+ }
+
+ # we should have a session, or else something is really wierd but...
+ $self->{'sess'} = $self->make_session() if (!$self->{'sess'});
+
+ # for each key left in our cache, delete it
+ foreach my $key (keys(%{$self->{'existtest'}})) {
+ # xxx: fullyqualified oid better
+ my $vblist = new SNMP::VarList([$delcolumnname, $key,
+ $delcolumnvalue]);
+ DEBUG("truncate $key: \n", Dumper($vblist));
+ $self->{'sess'}->set($vblist) || warn $self->{'sess'}->{ErrorStr};
+ }
+ return;
+}
+
+sub make_session {
+ DEBUG("calling AnyData::Storage::SNMP make_session\n");
+ my $self = shift;
+ my @args = @_;
+ my @sessions;
+ foreach my $key (qw(SecName Version SecLevel AuthPass Community RemotePort Timeout Retries RetryNoSuch SecEngineId ContextEngineId Context AuthProto PrivProto PrivPass)) {
+ push @args, $key, $self->{$key} if ($self->{$key});
+ }
+ foreach my $host (split(/,\s*/,$self->{DestHost})) {
+ push @sessions, new SNMP::Session(@args, 'DestHost' => $host);
+ }
+ return \@sessions;
+}
+
+sub file2str {
+ DEBUG("calling AnyData::Storage::SNMP file2str\n");
+ my ($self, $parser, $uccols) = @_;
+ my ($cols, @retcols);
+ DEBUG("file2str\n",Dumper(\@_),"\n");
+ restart:
+ if (!$self->{lastnode}) {
+# my @vbstuff = @{$parser->{'col_names'}};
+# splice (@vbstuff,0,1+$#AnyData::Storage::SNMP::basecols);
+# map { $_ = [ $_ ] } @vbstuff;
+# $self->{lastnode} = new SNMP::VarList(@vbstuff);
+# splice (@$cols,0,1+$#AnyData::Storage::SNMP::basecols);
+ map { push @$cols,$self->{col_uc_map}{$_} } @$uccols;
+ if ($#$cols == -1) {
+ $cols = $self->{'col_names'};
+ # remove base columns
+ splice (@$cols,0,1+$#AnyData::Storage::SNMP::basecols);
+ # remove not accessible columns
+ foreach my $col (@$cols) {
+ my $mib = $SNMP::MIB{$col};
+ push @retcols, $col if ($mib->{'access'} =~ /Read|Create/);
+ }
+ } else {
+ @retcols = @$cols;
+ # remove base columns
+ foreach my $c (@AnyData::Storage::SNMP::basecols) {
+ @retcols = grep(!/^$c$/, @retcols);
+ }
+ # remove non-accessible columns
+ @retcols = grep {$SNMP::MIB{$_}{'access'} =~ /Read|Create/} @retcols;
+ }
+ map { $_ = [ $_ ] } @retcols;
+ $self->{lastnode} = new SNMP::VarList(@retcols);
+ }
+
+ if (!$self->{'sess'}) {
+ $self->{'sess'} = $self->make_session();
+ if ($#{$self->{'sess'}} == 0 && $self->{'silence_single_host'}) {
+ $self->{'hostname'} = '';
+ } else {
+ $self->{'hostname'} = $self->{'sess'}[0]{'DestHost'};
+ }
+ }
+
+ # perform SNMP operation
+ my $lastnode = $self->{'lastnode'}[0][0];
+ my $result;
+ $result = $self->{'sess'}[0]->getnext($self->{lastnode});
+ if (!defined($result)) {
+ warn " getnext of $self->{lastnode}[0][0] returned undef\n";
+ }
+ DEBUG(" result: ",Dumper($self->{lastnode}),"\n");
+
+ # XXX: check for holes!
+
+ # need proper oid compare here for all nodes
+ if ($self->{'lastnode'}[0][0] ne $lastnode) {
+ if ($#{$self->{'sess'}} > 0) {
+ shift @{$self->{'sess'}};
+ delete($self->{'lastnode'});
+ @$cols = ();
+ $self->{'hostname'} = $self->{'sess'}[0]{'DestHost'} if($self->{'hostname'});
+ goto restart;
+ }
+ return undef;
+ }
+
+ # add in basecols information:
+ my @ret = ($self->{'hostname'}, $self->{'lastnode'}[0][1]);
+ DEBUG("Dump row results: ",Dumper($self->{'lastnode'}),"\n");
+
+ # build result array from result varbind contents
+ map { $ret[$self->{'col_nums'}{$_->[0]}] = map_data($_); } @{$self->{'lastnode'}};
+
+ # store instance ID for later use if deletion is needed later.
+ $self->{'existtest'}{$self->{'lastnode'}[0][1]} = 1;
+
+ DEBUG("Dump row results2: ",Dumper(\@ret),"\n");
+ return \@ret;
+}
+
+sub map_data {
+ if ($_->[3] eq "OBJECTID") {
+ $_->[2] = pretty_print_oid(@_);
+ }
+ return $_->[2];
+}
+
+sub pretty_print_oid {
+ use NetSNMP::default_store qw(:all);
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS,0);
+ my $new = SNMP::translateObj($_->[2], 0);
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS,1);
+ my $new2 = SNMP::translateObj($_->[2], 0);
+ if ($new) {
+ $_->[2] = $new2 . "$new";
+ } else {
+ $_->[2] = $_->[0] . $_->[1];
+ }
+ return $_->[2];
+}
+
+sub push_row {
+ DEBUG("calling AnyData::Storage::SNMP push_row\n");
+ DEBUG("push_row: ",Dumper(\@_),"\n");
+ DEBUG("push_row\n");
+ my ($self, $values, $parser, $cols) = @_;
+ my @callers = caller(3);
+ my $mode = $callers[3];
+ if ($mode =~ /DELETE/) {
+ DEBUG("not deleting $values->[$AnyData::Storage::SNMP::iidptr]\n");
+ delete $self->{'existtest'}{$values->[$AnyData::Storage::SNMP::iidptr]};
+ return;
+ }
+
+ my @origvars;
+ if ($#$cols == -1) {
+ # no column info passed in. Update everything (mode probably INSERTS).
+# @origvars = @{$self->{'col_names'}}};
+# splice (@origvars,0,1+$#AnyData::Storage::SNMP::basecols);
+
+ map { push @origvars, $_ if $SNMP::MIB{$_}{'access'} =~ /Write|Create/; } @{$self->{'real_cols'}} ;
+
+ DEBUG("set cols: ", Dumper(\@origvars));
+ } else {
+ # only update the columns in question. (mode probably UPDATE)
+ map { push @origvars, $self->{col_uc_map}{$_} } @$cols;
+ }
+
+ my @vars;
+ foreach my $var (@origvars) {
+ my $access = $SNMP::MIB{$var}{'access'};
+ # not in this table, probably (hopefully) an index from another:
+ next if ($SNMP::MIB{$var}{'parent'}{'parent'}{'label'} ne
+ $self->{process_table});
+ DEBUG("$var -> $access\n");
+ if ($access =~ /(Write|Create)/) {
+ push @vars, $var;
+ } elsif ($mode eq 'insert') {
+ DEBUG("XXX: error if not index\n");
+ } elsif ($mode eq 'update') {
+ DEBUG("update to non-writable column attempted (SNMP error coming)\n");
+ }
+ }
+
+ # generate index OID component if we don't have it.
+ if ($values->[$AnyData::Storage::SNMP::iidptr] eq '') {
+ $values->[$AnyData::Storage::SNMP::iidptr] =
+ $self->make_iid($self->{process_table}, $values);
+ }
+
+ # add in values to varbind columns passed in from incoming parameters
+ my @newvars;
+ foreach my $v (@vars) {
+ my $num = $self->{'col_nums'}{$v};
+ DEBUG("types: $v -> $num -> ", $self->{'col_types'}[$num],
+ " -> val=", $values->[$num], "\n");
+ next if (!defined($values->[$num]));
+ # build varbind: column-oid, instance-id, value type, value
+ push @newvars, [$v, $values->[1], $values->[$num],
+ $self->{'col_types'}[$num]];
+ };
+
+ # create the varbindlist
+# print STDERR Dumper(\@newvars);
+ my $vblist = new SNMP::VarList(@newvars);
+
+# print STDERR Dumper($vblist);
+ DEBUG("set: ", Dumper($vblist));
+ $self->{'sess'} = $self->make_session() if (!$self->{'sess'});
+ if (!$self->{'sess'}[0]) {
+ warn "couldn't create SNMP session";
+ } elsif (!$self->{'sess'}[0]->set($vblist)) {
+ my $err = "$self->{process_table}: " . $self->{'sess'}[0]->{ErrorStr};
+ if ($self->{'sess'}[0]->{ErrorInd}) {
+ $err = $err . " (at varbind #"
+ . $self->{'sess'}[0]->{ErrorInd} . " = " ;
+ my $dump = Data::Dumper->new([$vblist->[$self->{'sess'}[0]->{ErrorInd} -1]]);
+ $err .= $dump->Indent(0)->Terse(1)->Dump;
+ }
+ warn $err;
+ }
+}
+
+sub seek {
+ DEBUG("calling AnyData::Storage::SNMP seek\n");
+ my ($self, $parser) = @_;
+ DEBUG("seek\n",Dumper(\@_),"\n");
+}
+
+sub make_iid {
+ DEBUG("calling AnyData::Storage::SNMP make_iid\n");
+ my ($self, $tname, $vals) = @_;
+
+ # Get indexes
+ my $mib = $SNMP::MIB{$tname};
+ my $entry = $mib->{'children'}[0];
+ my $indexes = $entry->{'indexes'};
+ my $iid;
+
+ # XXX: implied
+
+# print STDERR "INDEXES: ", Dumper($vals),"\n";
+ foreach my $index (@$indexes) {
+ warn "A null index value was found, which I doubt is correct." if (!defined($vals->[$self->{col_nums}{$index}]));
+ my $val = $vals->[$self->{col_nums}{$index}];
+ my $type = $SNMP::MIB{$index}->{'type'};
+ DEBUG("index type: $index -> $type -> $val -> " . length($val) . "\n");
+ if ($type eq "OCTETSTR") {
+ $iid .= "." . length($val) . "." . join(".", unpack("c*", $val));
+ } elsif ($type eq "OBJID") {
+ $iid .= "." . (scalar grep(/\./,$val) + 1) . "." . $val;
+ } else {
+ # should be only an INTEGER?
+ $iid .= "." . $val;
+ }
+ }
+ DEBUG("made iid: $iid\n");
+ return $iid;
+}
+
+sub DEBUG {
+ my @info = caller(1);
+ if ($AnyData::Storage::SNMP::debug
+ || ($AnyData::Storage::SNMP::debugre &&
+ $_[0] =~ /$AnyData::Storage::SNMP::debugre/)) {
+ DEBUGIT(\@info, @_);
+ }
+}
+
+sub DEBUGIT {
+ my $info;
+ if (ref($_[0]) eq 'ARRAY') {
+ $info = shift @_;
+ } else {
+ my @y;
+ my $c=0;
+ print STDERR "debug chain: ";
+ for(@y = caller($c); $#y > -1; $c++, @y = caller($c)) {
+ print STDERR " $c: $y[3]\n";
+ }
+ my @x = caller(1);
+ $info = \@x;
+ }
+ print STDERR "$info->[3]: ";
+ print STDERR @_;
+}
+
+1;
diff --git a/perl/AnyData_SNMP/configs/scli b/perl/AnyData_SNMP/configs/scli
new file mode 100644
index 0000000..b2e243e
--- /dev/null
+++ b/perl/AnyData_SNMP/configs/scli
@@ -0,0 +1,27 @@
+# scli equivelents
+alias scli_system_info {
+ printf "Name: %s\n" sysName.0
+ #XXX fix:
+ printf "Address: localhost:161\n";
+ printf "Contact: %s\n" sysContact.0
+ printf "Location: %s\n" sysLocation.0
+ printf "Vendor: %s\n" sysObjectID.0
+ #printf "Current Time: %s\n" hrSystemDate.0
+ #printf "Agent Boot Time: %s\n" sysUpTime.0
+ #printf "System Boot Time: %s\n" 2002-06-03 21:33:49 -08:00
+ printf "Users: %s\n" hrSystemNumUsers.0
+ printf "Processes: %s\n" hrSystemProcesses.0
+ printf "Memory: %s\n" select hrStorageSize, hrStorageType from hrStorageTable where hrStorageType = '.1.3.6.1.2.1.25.2.1.2'
+ printf "Interfaces: %s\n" ifNumber.0
+}
+
+alias scli_system_devices {
+ printf "%5d: %s\n" select hrDeviceIndex, hrDeviceDescr from hrDeviceTable;
+}
+
+alias scli_system_storage {
+ printf "Storage Area Size [K] Used [K] Free [K] Use%\n"
+ # fix size, use%
+ printf "%-22s %8d %8d %8d %3d (%s)\n" select hrStorageDescr, hrStorageSize, hrStorageUsed, hrStorageSize, hrStorageIndex, hrStorageType from hrStorageTable
+}
+
diff --git a/perl/AnyData_SNMP/configs/unix b/perl/AnyData_SNMP/configs/unix
new file mode 100644
index 0000000..4bf3fea
--- /dev/null
+++ b/perl/AnyData_SNMP/configs/unix
@@ -0,0 +1,34 @@
+# example ifconfig command
+alias ifconfig {
+ printf "%-10sinet addr: %-15s Mask: %-10s\n %s %s RUNNING:%s MTU:%d\n RX packets: %d errors: %d dropped: %d\n TX packets: %d errors: %d dropped: %d\n RX bytes:%d TX bytes: %d\n\n" select ifDescr, ipAdEntAddr, ipAdEntNetMask, ifAdminStatus, ifType, ifOperStatus, ifMtu, ifInUcastPkts, ifInErrors, ifInDiscards, ifOutUcastPkts, ifOutErrors, ifOutDiscards, ifInOctets, ifOutOctets, ifIndex, ipAdEntIfIndex from ifTable, ipAddrTable where ifIndex = ipAdEntIfIndex
+# select ipAdEntAddr, ifDescr, ifIndex, ipAdEntIfIndex from ifTable, ipAddrTable where ifIndex = ipAdEntIfIndex
+}
+
+# equivelant to netstat -an
+alias netstatan {
+ printf "Active Intenet connections (servers and established)\n"
+ printf "Proto LocalAddress Foreign Address State\n"
+ printf "tcp %-15s:%-5s %-15s:%-5s%-10s\n" select tcpConnLocalAddress, tcpConnLocalPort, tcpConnRemAddress, tcpConnRemPort, tcpConnState from tcpConnTable;
+ printf "udp %-15s:%-5s 0.0.0.0:0 %-10s\n" select udpLocalAddress, udpLocalPort from udpTable;
+}
+
+# equivelent to netstat -rn
+alias netstatrn {
+ printf "Kernel IP Routing Table\n"
+ printf "Destination Gateway Genmask Type Iface\n"
+ printf "%-15s %-15s %-15s %-8s %s\n" select ipRouteDest, ipRouteNextHop, ipRouteMask, ipRouteType, ifDescr, ifIndex, ipRouteIfIndex from ifTable, ipRouteTable where ifIndex = ipRouteIfIndex
+}
+
+alias ps {
+ printf "%6d %1d %s %40.40s\n" select hrSWRunIndex, hrSWRunType, hrSWRunName, hrSWRunParameters from hrSWRunTable
+# printf "%6d %1d %6d %s %40.40s\n" select hrSWRunIndex, hrSWRunType, hrSWRunPerfMem, hrSWRunName, hrSWRunParameters from hrSWRunTable
+}
+
+alias ps_grep {
+ printf "%6d %1d %s %40.40s\n" select hrSWRunIndex, hrSWRunType, hrSWRunName, hrSWRunParameters from hrSWRunTable where hrSWRunName like '%\1%'
+}
+
+alias df {
+ printf "Filesystem Size Used\n"
+ printf "%-20s %8d %8d\n" select hrStorageDescr, hrStorageSize, hrStorageUsed from hrStorageTable
+}
diff --git a/perl/AnyData_SNMP/netsh b/perl/AnyData_SNMP/netsh
new file mode 100755
index 0000000..c743f9c
--- /dev/null
+++ b/perl/AnyData_SNMP/netsh
@@ -0,0 +1,838 @@
+#!/usr/bin/perl
+
+use Getopt::Std;
+
+use DBI;
+use Term::ReadLine;
+use SNMP;
+use AutoLoader;
+use IO::File;
+
+BEGIN {
+ $opts{'t'} = ! eval { require Text::FormatTable; };
+ $ansicolor = eval { require Term::ANSIColor; };
+}
+
+# override some of the functions to force our colorized semantics.
+# This is really ugly, but if you pass colorized strings directly to
+# Text::FormatTable then it calculates the string lengths incorrectly.
+# Children: don't try this at home. We're trained professionals.
+if ($colorize) {
+ eval {
+ #
+ # colorized strings.
+ #
+ package color_string;
+
+ require Term::ANSIColor;
+
+ use overload
+ '""' => \&string_it
+ ;
+
+ sub string_it {
+ if ($_[0][3]) {
+ if ($_[0][3] == 1) {
+ return color_it();
+ } else {
+ $_[0][3] -= 1;
+ return $_[0][1];
+ }
+ }
+ return $_[0][1];
+ }
+
+ sub colorize_next {
+ $_[0][3] = 2;
+ }
+
+ sub color_it {
+ my $str = $_[1] || $_[0][1];
+ return $_[0][0] . $str . $_[0][2];
+ }
+
+ sub new {
+ my $this = [Term::ANSIColor::color($_[2]), $_[1],
+ Term::ANSIColor::color('reset')];
+ return bless($this, $_[0]);
+ }
+ }
+}
+
+if ($opts{'t'} == 0 && $colorize) {
+ eval {
+ package Text::FormatTable;
+
+ sub _l_box($$)
+ {
+ my ($width, $text) = @_;
+ my $lines = _wrap($width, $text);
+ map {
+ if (ref($text) eq "color_string") {
+ $_ .= $text->color_it($_) . ' 'x($width-length($_));
+ } else {
+ $_ .= ' 'x($width-length($_));
+ }
+ } @$lines;
+ return $lines;
+ }
+
+ sub _r_box($$)
+ {
+ my ($width, $text) = @_;
+ my $lines = _wrap($width, $text);
+ map {
+ if (ref($text) eq "color_string") {
+ $_ = ' 'x($width-length($_)) . $text->color_it($_);
+ } else {
+ $_ = ' 'x($width-length($_)) . $_;
+ }
+ } @$lines;
+ return $lines;
+ }
+
+ }
+}
+
+if (!$ansicolor) {
+ $begin = $end = "*";
+}
+
+$SNMP::use_enums=1;
+
+
+#defaults
+$opts{'d'} = "\t";
+$opts{'v'} = 1;
+$opts{'l'} = 'authNoPriv';
+$params = "";
+
+getopts('hd:tR:u:l:v:a:A:x:X:p:c:t:r:',\%opts);
+
+usage() if ($#ARGV == -1 || $opts{'h'});
+
+my %parammap = {
+ 'v' => 'Version',
+ 'u' => 'SecName',
+ 'a' => 'AuthProto',
+ 'A' => 'AuthPass',
+ 'x' => 'PrivProto',
+ 'X' => 'PrivPass',
+ 'p' => 'RemotePort',
+ 't' => 'Timeout',
+ 'r' => 'Retries',
+ 'c' => 'Community',
+ 'l' => 'SecLevel'
+ };
+
+foreach my $x (keys(%opts)) {
+ if ($parammap{$x}) {
+ $params .= ";ad_SNMP_$parammap{$x}=$x";
+ }
+ push @sessparams,$parammap{$x},$x;
+}
+
+my $host = shift @ARGV;
+$params .= ";ad_SNMP_DestHost=" . $host;
+push @sessparms,'DestHost', $host;
+
+# connect to the DBI interface
+$AnyData::Storage::SNMP::debugre = $opts{'R'} if ($opts{'R'});
+($dbh = DBI->connect("dbi:AnyData:ad_default=SNMP$params"))
+ || die "\tConnection problem: $DBI::errstr\n";
+$AnyData::Storage::SNMP::debugre = $opts{'R'} if ($opts{'R'});
+
+$prompt = "netsh> ";
+
+load_rcs();
+
+# setup terminal prompter
+$ENV{'PERL_RL'}='o=0' if (!exists($ENV{'PERL_RL'}));
+# the ornaments are too ugly
+$term = new Term::ReadLine 'netsh';
+
+if ($#ARGV >= 0) {
+ # command line command
+ netsh(join(" ",@ARGV));
+} else {
+ # interactive shell
+ while($cmd = $term->readline($prompt)) {
+ last if ($cmd eq "exit" || $cmd eq "quit" || $cmd eq "q");
+ netsh($cmd, \%conf);
+ }
+}
+
+# load all configuration files we can find.
+sub load_rcs {
+ if (-f "$ENV{'HOME'}/.snmp/netshrc") {
+ source_file("$ENV{'HOME'}/.snmp/netshrc");
+ }
+ if (-d "$ENV{'HOME'}/.snmp/netsh") {
+ foreach my $i (glob("$ENV{'HOME'}/.snmp/netsh/*")) {
+ if (-f "$i" && "$i" !~ /.*(~|.bak)$/) {
+ source_file("$i");
+ }
+ }
+ }
+}
+
+# command definition for sourcing a particular file
+sub source_file {
+ my $fh = new IO::File;
+ if ($fh->open("<$_[0]")) {
+ while(<$fh>) {
+ if (s/<<\s*(\w+)$//) {
+ my $stopat = $1;
+ my $lines = $_;
+ while(<$fh>) {
+ last if (/$stopat/);
+ $lines .= $_;
+ }
+ $_ = $lines;
+ }
+ netsh($_);
+ }
+ } else {
+ print STDERR "no such file: $_[0]\n";
+ }
+}
+
+# export data into an external file
+sub my_export {
+ shift;
+ if (!$insh) {
+ my $cmd = "create table exporttable (" . join (" varchar(255), ",@{$sth->{NAME}}) . " varchar(255))";
+ $exporth->do($cmd);
+ $cmd = "insert into exporttable values(" . ('?, ' x ($#_)) . "?)";
+ $insh = $exporth->prepare($cmd);
+ }
+ $insh->execute(@_);
+}
+
+# the main processing function.
+sub netsh {
+ my $stmt = shift;
+ chomp($stmt); # remove trailing white space
+ $stmt =~ s/^\s+//; # remove leading white space
+ $stmt =~ s/;*$//; # get rid of trailing semicolons
+ return if ($stmt =~ /^\s*$/);
+ return if ($stmt =~ /^\s*\#/);
+ my ($name, $args) = ($stmt =~ /^(\w+)\s*(.*)$/);
+
+ #define alias
+# print "doing [$multi_alias]: $stmt\n";
+ if ($name eq "alias" || $multi_alias) {
+ if ($multi_alias) {
+ if ($stmt =~ /^prompt\s+(\d+)\s+[\"\'](.+)[\"\']/) {
+ $aliases{$current_alias}{'prompts'}[$1] = $2;
+ return;
+ } elsif ($stmt =~ /^prompt\s+(\d+)\s+(.+)/) {
+ my $x = $2;
+ my $spot = $1;
+ $x =~ s/\s+$//;
+ $aliases{$current_alias}{'prompts'}[$spot] = "$x ";
+ return;
+ } elsif ($stmt =~ /^\s*\}\s*$/) {
+ $prompt = $oprompt;
+ $multi_alias = 0;
+ return;
+ }
+ push @{$aliases{$current_alias}{'definition'}},$stmt;
+ return;
+ }
+ $stmt =~ s/^alias\s+//;
+ if ($args eq "") {
+ foreach $i (sort keys(%aliases)) {
+ display_alias($i);
+ }
+ return;
+ }
+ ($name, $args) = ($stmt =~ /^(\w+)\s*(.*)$/);
+ if ($args eq "") {
+ display_alias($name);
+ return;
+ }
+# print "alias: $name $args\n";
+ if ($args eq "{") {
+ $oprompt = $prompt;
+ $prompt = "define $name> ";
+ $current_alias = $name;
+ $multi_alias = 1;
+ $aliases{$name}{'definition'} = [];
+ return;
+ }
+ $aliases{$name}{'definition'} = $args;
+ return;
+ }
+
+ #eval
+ if ($name eq "eval") {
+ eval $args;
+ return;
+ }
+
+ #eval just vars
+ if ($name eq "evalvars") {
+# print "args1:",$args,"\n";
+ $args =~ s/\$(\w+)/$$1/eg;
+# print "args2:",$args,"\n";
+ netsh($args);
+ return;
+ }
+
+ #eval aliases
+ while (exists $aliases{$name}) {
+# print "modified: $stmt -> ";
+ my @ARGS = split(/\s+/,$args);
+ my $statements;
+ if (ref($aliases{$name}{'definition'}) eq "ARRAY") {
+ $statements = $aliases{$name}{'definition'};
+
+ # maybe prompt for values
+ if ($#{$aliases{$name}{'prompts'}} > -1) {
+ my $i;
+ for($i = 1; $i <= $#{$aliases{$name}{'prompts'}}; $i++) {
+ if (!$ARGS[$i-1] && $term) {
+ $ARGS[$i-1] =
+ $term->readline($aliases{$name}{'prompts'}[$i]);
+ }
+ }
+ }
+ } else {
+ $statements = [$aliases{$name}{'definition'}];
+ }
+ foreach my $stmt (@$statements) {
+ #print "$stmt -> ";
+ $stmt =~ s/\\(\d+)/$ARGS[$1-1]/g;
+# print "running $stmt\n";
+ ($name, $args) = ($stmt =~ /^(\w+)\s*(.*)$/);
+ netsh($stmt);
+ }
+ return;
+ }
+
+ if ($stmt =~ /^rehash$/) {
+ load_rcs();
+ return;
+ }
+
+ my $subfn;
+
+ if ($stmt =~ /^eval (.*)/) {
+ eval $1;
+ }
+
+ if ($stmt =~ s/^printf\s+(\".*\")\s*(.*)/$2/) {
+ if ($2 eq "") {
+ print eval $1;
+ return;
+ }
+ $subfn = \&my_printf;
+ $stmt = $2;
+ $printfmt = $1;
+ }
+
+ # special show columns statement
+ if ($stmt =~ /^show columns from (\w+)$/) {
+ my $mibnode = $SNMP::MIB{$1};
+ my $entrynode = $mibnode->{children}[0];
+ if (!defined($mibnode) || !defined($entrynode)) {
+ print STDERR "no such table: $1\n";
+ return;
+ }
+ if ($opts{'t'}) {
+ map { print $_->{label},"\n"; } sort { $a->{subID} <=> $b->{subID}} @{$entrynode->{children}};
+ } else {
+ $table = Text::FormatTable->new('|r|');
+ $table->rule('-');
+ $table->head('Column');
+ $table->rule('-');
+ map { $table->row($_->{label}); } sort { $a->{subID} <=> $b->{subID}} @{$entrynode->{children}};
+ $table->rule('-');
+ print $table->render();
+ }
+ return;
+ }
+
+ if ($stmt =~ /^source\s+(.*)/) {
+ source_file($1);
+ return;
+ }
+
+ if ($stmt =~ s/^export\s+(\S+)\s+(.*)/$2/) {
+ $insh = undef;
+ unlink($1);
+ $exporth = DBI->connect('dbi:AnyData:');
+ $exporth->func('exporttable','CSV',$1,'ad_catalog');
+ $subfn = \&my_export;
+ }
+
+ if ($stmt =~ /^import\s+(\S+)/) {
+ my $exporth = DBI->connect('dbi:AnyData:');
+ $exporth->func('exporttable','CSV',$1,'ad_catalog');
+ my $selh = $exporth->prepare("select * from exporttable");
+ $selh->execute();
+ $old_data = [];
+ while(my $row = $selh->fetchrow_arrayref) {
+ push @$old_data, @$row;
+ }
+ $selh->finish();
+ $exporth->disconnect();
+ return;
+ }
+
+ if ($stmt =~ /^diff\s+(.*)/) {
+ $running_watch = 2;
+ netsh($1);
+ $running_watch = 0;
+ return;
+ }
+
+ if ($stmt =~ /^watch\s+(.*)/) {
+ $running_watch = 1;
+ my $cmd = $1;
+ my $delay = 1;
+ my $clear = `clear`;
+ if ($cmd =~ s/^(\d+)\s+(.*)/$2/) {
+ $delay = $1;
+ $cmd = $2;
+ }
+ $SIG{'TERM'} = sub { $running_watch = 0; };
+ $SIG{'INT'} = sub { $running_watch = 0; };
+ while($running_watch) {
+ print $clear;
+ netsh($cmd);
+ sleep($delay);
+ }
+ $SIG{'TERM'} = \&exit;
+ $SIG{'INT'} = \&exit;
+ return;
+ }
+
+ # we have an SQL statement. process it.
+ if ($stmt =~ /^(select|insert|update|delete)/) {
+ $sth = $dbh->prepare($stmt);
+ $sth->execute();
+ if ($stmt =~ /^select/) {
+ my $table;
+ my $older_data = $old_data;
+ if ($running_watch == 1) {
+ $old_data = [];
+ }
+ my $oldcount = 0;
+ while($row = $sth->fetchrow_arrayref) {
+
+ if ($running_watch) {
+ $newrow=[];
+ my $count;
+ for($count = 0; $count <= $#$row; $count++) {
+ if ($older_data &&
+ $row->[$count] ne
+ $older_data->[$oldcount][$count]) {
+ if ($ansicolor) {
+ push @$newrow, new color_string($row->[$count],'red');
+ } else {
+ push @$newrow,"$begin$row->[$count]$end";
+ }
+ } else {
+ push @$newrow,$row->[$count];
+ }
+ if ($running_watch == 1) {
+ $old_data->[$oldcount][$count] = $row->[$count];
+ }
+ }
+ $oldcount++;
+ $row = $newrow;
+ }
+
+ # self printing;
+ if (ref($subfn) eq "CODE") {
+ &$subfn($printfmt,@$row);
+ next;
+ }
+
+ if ($opts{'t'}) {
+ if ($opts{'d'} eq 'xml') {
+ print " <row>\n";
+ for(my $xx = 0; $xx < $#{$sth->{NAME}}; $xx++) {
+ print " <$sth->{NAME}[$xx]>$row->[$xx]</$sth->{NAME}[$xx]>\n";
+ }
+ print " </row>\n";
+ } elsif ($opts{'d'} eq 'xmlshort') {
+ print " <row ";
+ for(my $xx = 0; $xx < $#{$sth->{NAME}}; $xx++) {
+ print " $sth->{NAME}[$xx]=\"$row->[$xx]\"";
+ }
+ print "/>\n";
+ } else {
+ print join($opts{'d'},@$row),"\n";
+ }
+ } elsif (!$table) {
+ $table = Text::FormatTable->new('|r' x ($#$row+1) . "|");
+ $table->rule('-');
+ $table->head(@{$sth->{NAME}});
+ $table->rule('-');
+ $table->row(@$row);
+ } else {
+ $table->row(@$row);
+ }
+ }
+ if ($table) {
+ $table->rule('-');
+ print $table->render();
+ }
+ }
+ $sth->finish();
+ return;
+ }
+
+ # retrieve just one variable and display it
+ if ($stmt =~ /^(get|)\s*([^\s]+)\s*[^=]/) {
+ my $sess = make_session();
+ if ($sess) {
+ my @results = split(/[,\s]+/,$stmt);
+ my $resultsv = new SNMP::VarList();
+ # expression stolen from the main perl SNMP module
+ map { my ($tag, $iid) =
+ (/^((?:\.\d+)+|(?:\w+(?:\-*\w+)+))\.?(.*)$/);
+ push @$resultsv, [$tag, $iid] } @results;
+ $sess->get($resultsv) ||
+ print STDERR "Error: $sess->{ErrorNum} $sess->{ErrString}\n";
+ @results = ();
+ map { push @results, $_->[2] } @$resultsv;
+ if (ref($subfn) eq "CODE") {
+ &$subfn($printfmt,@results);
+ } else {
+ print join(" ", @results),"\n";
+ }
+ } else {
+ print STDERR "could not establish a SNMP session to $host\n";
+ }
+ return;
+ }
+
+ # set something
+ if ($stmt =~ /^(set|)\s*([^\s]+)\s=\s(.*)$/) {
+ my $sess = make_session();
+ if ($sess) {
+ $sess->set([$2,undef,$1]) ||
+ print STDERR "opps: $sess->{ErrorNum} $sess->{ErrString}\n";
+ } else {
+ print STDERR "could not establish a SNMP session to $host\n";
+ }
+ return;
+ }
+}
+
+sub auto_snmp {
+ my $node = $SNMP::MIB{$_[0]};
+# print STDERR "netsh::fetch_snmp $_[0] $node->{label}\n";
+ my $indexes = $node->{parent}{indexes};
+ if ($#$indexes > -1) {
+# print STDERR "column\n";
+ # table
+ } else {
+ # scalar
+ if (exists($_[1])) {
+ my $sess = make_session();
+ my $val = $sess->set([$_[0],0,$_[1]]) || return;
+# print STDERR "scalar set: $val\n";
+ return $val;
+ } else {
+ my $sess = make_session();
+ my $val = $sess->get([$_[0],0]);
+# print STDERR "scalar get: $val\n";
+ return $val;
+ }
+ }
+}
+
+sub AUTOLOAD {
+ my $nodename = $AUTOLOAD;
+ $nodename =~ s/.*:://;
+ print STDERR "netsh::AUTOLOAD $AUTOLOAD $nodename\n";
+ if ($SNMP::MIB{$nodename}) {
+ eval << "END";
+ sub $AUTOLOAD {
+ auto_snmp($nodename, \@_);
+ }
+END
+ goto &$AUTOLOAD;
+ }
+ print STDERR join(",",@_),"\n";
+}
+
+sub my_printf {
+ # drop quotes
+ my $fmt = shift;
+ $fmt = eval $fmt;
+ map { if (ref($_) eq "color_string") { $_->colorize_next(); } } @_;
+ printf($fmt, @_);
+}
+
+sub display_alias {
+ my $name = shift;
+ if (exists $aliases{$name}{'definition'}) {
+ if (ref($aliases{$name}{'definition'}) eq "ARRAY") {
+ print "alias $name {\n";
+ map { print " $_\n"; } @{$aliases{$name}{'definition'}};
+ print "}\n";
+ } else {
+ print "alias $name $aliases{$name}{'definition'}\n";
+ }
+ } else {
+ print "no alias defined for \"$name\"\n";
+ }
+}
+
+sub make_session {
+ if (!$sess) {
+ $sess = new SNMP::Session(@sessparms);
+ }
+ return $sess;
+}
+
+
+sub usage {
+ print STDERR "
+$0 [ARGUMENTS] HOSTNAME [SQL_COMMAND]
+
+ $0 implements a simple SQL shell which maps onto SNMP. All
+ statements issued within the shell are converted to SNMP requests and
+ sent to HOSTNAME and the results displayed in a nice table output
+ format if the Text::FormatTable module is available. If SQL_COMMAND
+ is given on the command line, then it's interpreted and control is
+ returned to the caller. If not, an interactive prompt is given where
+ multiple commands can be issued.
+
+ARGUMENTS may include:
+
+ -t delimiter separated output, don't print pretty tables.
+ -d DELIM use DELIM as the delimiter. A tab is the default delimiter.
+ 'xml' is a special delimiter to produce xml output.
+
+ARGUMENTS also may include the following. See the net-snmp snmpcmd
+manual page for details on what they mean:
+
+ -v VERSION (default: 1)
+ -t TIMEOUT
+ -r RETRIES
+ -p PORT
+ -c COMMUNITY
+ -a AUTHPROTOCOL (default: MD5)
+ -x PRIVPROTOCOL (default: DES)
+ -A AUTHPASS
+ -X PRIVPASS
+ -l SECURITY_LEVEL (default: authNoPriv)
+
+";
+ exit;
+}
+
+__END__
+
+=head1 NAME
+
+netsh - A shell environment for interacting with networking devices
+
+=head1 SYNOPSIS
+
+netsh [(subset of) snmpcmd arguments] hostname[,hostname...] [command]
+
+=head1 OPTIONAL PERL MODULES
+
+There are some optional perl modules which make using the shell nicer
+in general. These modules are:
+
+ Text::FormatTable
+ Term::ReadLine::Gnu or Term::ReadLine::Perl
+ Term::ANSIColor
+
+You can install these by running [as root]:
+
+ perl -MCPAN -e shell
+ cpan> install Text::FormatTable
+ ...
+
+It is B<strongly> recommend you at least install the Text::FormatTable
+module, and if you like command line editing one of the two extra
+Term::ReadLine modules (Gnu being the better of the two).
+
+=head1 DESCRIPTION
+
+The netsh script provides an interactive, console-like environment
+suitable for monitoring and manipulating data within networking
+devices. The environment is highly extensible through command
+aliases and easy-to-use SQL-like queries.
+
+It is implemented on top of the SNMP protocol using the net-snmp
+package and perl. See the snmpcmd and snmp.conf manual pages for
+details on configuring net-snmp for authentication information for
+the networking devices you wish to access.
+
+=head1 ABOUT THE EXAMLPES IN THIS DOCUMENT
+
+All the examples in this document are exact cut-n-pastes from the
+inside of the netsh shell. This includes the "netsh> " prompt and
+possibly other prompts as well.
+
+=head1 COMMANDS
+
+The following is a list of the basic core commands supported by
+netsh. Many default aliases are also supplied, some of which are
+listed in the next section. At the command prompt type "alias" for
+a full list of all the aliases and their definitions.
+
+=over
+
+=item show columns from TABLE
+
+=item select ...
+
+=item update ...
+
+=item insert ...
+
+=item delete ...
+
+netsh supports the standard sql-like language queries of snmp tables.
+These are implemented via the SQL::Statement parser, so any form of
+expression it accepts netsh will accept as well.
+
+Examples:
+
+ netsh> show columns from ifTable
+ +-----------------+
+ | Column|
+ +-----------------+
+ | ifIndex|
+ ...
+ netsh> select * from ifTable
+ ... [output not shown]
+ netsh> select tcpConnState, tcpConnRemotelAddress from tcpConnTable where tcpConnState = established
+ ... [output not shown]
+ netsh> update ifTable set ifAdminStatus = up where ifOperStatus = down
+ ... [output not shown]
+
+=item SNMPOBJECT
+
+Simple lists of objects may be given which will directly request or
+operate on those objects. See printf below for controlling the
+formatting of results
+
+Examples:
+
+ netsh> sysContact.0, sysLocation.0
+ hardaker@somewhere.net my location
+ netsh> sysContact.0 = my new contact information
+
+=item alias my_command some other command
+
+or
+
+=back
+
+alias my_many_commands {
+ command1
+ command2
+ prompt NUMBER question
+
+}
+
+=over
+
+=item
+
+You can create aliases of your frequently used commands by aliasing
+them to an easy to remember name. \N parameters in the defined
+command will be replaced by the positional argument of options passed
+to the alias name.
+
+For multi-line defined aliases, optional prompts may be given to
+request information from the user when the NUMBERth argument is not
+given to the alias. If it is not given, the prompt will be printed
+and the user will be asked to input a value for it. This allows the
+easy definition of interactive commands. The value will be inserted
+in alias parts containing \N substitution requests.
+
+ netsh> alias interfaces select ifDescr from ifTable
+ netsh> interfaces
+ +-------+
+ |ifDescr|
+ +-------+
+ | lo|
+ | eth0|
+ +-------+
+ netsh> alias interface select ifDescr, ifSpeed from ifTable where ifDescr = '\1'
+ netsh> interface eth0
+ +-------+--------+
+ |ifDescr| ifSpeed|
+ +-------+--------+
+ | eth0|10000000|
+ +-------+--------+
+
+=item printf FORMATSTRING COMMAND
+
+Allows B<careful> formatting of results returned by the commands.
+
+Example:
+
+ netsh> alias interface {
+ define interface> printf "interface %s is running at %d Mb/s\n" select ifDescr, ifSpeed from ifTable where ifDescr = '\1'
+ define interface> prompt 1 Enter the interface to describe:
+ define interface> }
+ netsh> interface
+ Enter the interface to describe: eth0
+ interface eth0 is running at 10000000 Mb/s
+
+To list the definition of an already defined command, simply exclude
+the definition and netsh will report the definition to you:
+
+ netsh> alias interface
+ alias interface {
+ printf "interface %s is running at %d Mb/s\n" select ifDescr, ifSpeed from ifTable where ifDescr = '\1'
+ prompt 1 Enter the interface to describe:
+ }
+
+To list all the aliases defined in the system, just type "alias" by itself.
+
+=item watch [TIME] COMMAND
+
+Continually watches the results of the COMMAND being run, which is run
+every TIME seconds. For select statements, it will attempt to mark
+the changing values from one screen to the next by surrounding them
+with "*"s or color (assuming you have the Term::ANSIColor perl module
+installed) for easy picking out on the screen.
+
+=item rehash
+
+Re-load the alias definitions files in the common directory, as
+well as those files found in $HOME/.snmp/netsh.
+
+=item source FILE
+
+loads definitons and commands from FILE into the running environment.
+
+=back
+
+=head1 FILES
+
+By default, netsh will source all the definition files it can find.
+It does this by first reading everything in
+/usr/local/share/snmp/netsh/* and then reading everything in
+$HOME/.snmp/netsh/*. Everything contained in these files are
+commands, but most frequently they entirely consist of aliases
+definitions.
+
+=head1 AUTHOR
+
+bugs, comments, questions to net-snmp-users@lists.sourceforge.net
+
+=head1 Copyright
+
+ Copyright (c) 2002 Networks Associates Technology, Inc. All
+ rights reserved. This program is free software; you can
+ redistribute it and/or modify it under the same terms as Perl
+ itself.
+
+=cut
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
new file mode 100644
index 0000000..31fdc40
--- /dev/null
+++ b/perl/Makefile.PL
@@ -0,0 +1,160 @@
+use ExtUtils::MakeMaker;
+use Config;
+use Getopt::Long;
+require 5;
+
+%MakeParams = InitMakeParams();
+
+WriteMakefile(%MakeParams);
+
+sub InitMakeParams {
+ $nsconfig="net-snmp-config"; # in path by default
+ my %Params = (
+ 'NAME' => 'Bundle::NetSNMP',
+ 'DIR' => [qw(default_store ASN OID agent SNMP TrapReceiver)],
+ );
+
+ # bogus, but these options need to be passed to the lower levels
+ $opts = NetSNMPGetOpts("./");
+
+ return(%Params);
+}
+
+# common subroutines -- DO NOT EDIT.
+# They are imported from the Makefile.subs.pl file
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ # we allow for perl/CPAN-only revisions beyond the default
+ # version formatting of net-snmp itself.
+ $perlver =~ s/(\.\d{5}).*/\1/;
+ $perlver =~ s/0*$//;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/Makefile.makefiles b/perl/Makefile.makefiles
new file mode 100644
index 0000000..073815b
--- /dev/null
+++ b/perl/Makefile.makefiles
@@ -0,0 +1,12 @@
+GENERATE_LIST=./Makefile.PL \
+ ./default_store/Makefile.PL \
+ ./ASN/Makefile.PL \
+ ./OID/Makefile.PL \
+ ./agent/Makefile.PL \
+ ./agent/default_store/Makefile.PL \
+ ./agent/Support/Makefile.PL \
+ ./SNMP/Makefile.PL \
+ ./TrapReceiver/Makefile.PL
+
+all:
+ perl make-perl-makefiles $(GENERATE_LIST)
diff --git a/perl/Makefile.subs.pl b/perl/Makefile.subs.pl
new file mode 100644
index 0000000..e3c25ef
--- /dev/null
+++ b/perl/Makefile.subs.pl
@@ -0,0 +1,136 @@
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ # we allow for perl/CPAN-only revisions beyond the default
+ # version formatting of net-snmp itself.
+ $perlver =~ s/(\.\d{5}).*/\1/;
+ $perlver =~ s/0*$//;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/OID/Changes b/perl/OID/Changes
new file mode 100644
index 0000000..96fe31d
--- /dev/null
+++ b/perl/OID/Changes
@@ -0,0 +1,6 @@
+Revision history for Perl extension OID.
+
+0.01 Mon Apr 29 16:58:40 2002
+ - original version; created by h2xs 1.21 with options
+ OID.h
+
diff --git a/perl/OID/MANIFEST b/perl/OID/MANIFEST
new file mode 100644
index 0000000..b9008af
--- /dev/null
+++ b/perl/OID/MANIFEST
@@ -0,0 +1,7 @@
+Changes
+Makefile.PL
+MANIFEST
+OID.pm
+OID.xs
+README
+test.pl
diff --git a/perl/OID/Makefile.PL b/perl/OID/Makefile.PL
new file mode 100644
index 0000000..6bb1616
--- /dev/null
+++ b/perl/OID/Makefile.PL
@@ -0,0 +1,234 @@
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+
+use ExtUtils::MakeMaker;
+require 5;
+use Config;
+use Getopt::Long;
+my $lib_version;
+my %MakeParams = ();
+
+%MakeParams = InitMakeParams();
+
+WriteMakefile(%MakeParams);
+
+Check_Version();
+
+sub InitMakeParams {
+ my $opts;
+ my %Params = (
+ 'NAME' => 'NetSNMP::OID',
+ 'VERSION_FROM' => 'OID.pm', # finds $VERSION
+ 'XSPROTOARG' => '-prototypes',
+ 'PREREQ_PM' => {},
+ );
+
+ if ($ENV{'OSTYPE'} eq 'msys') {
+ $Params{'DEFINE'} = "-DMINGW_PERL";
+ }
+
+ my ($snmp_lib, $snmp_llib, $sep);
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+ $opts = NetSNMPGetOpts();
+ $Params{'DEFINE'} = "-DMSVC_PERL -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS";
+ $sep = '\\';
+ $snmp_lib_file = 'netsnmp.lib';
+ $snmp_link_lib = 'netsnmp';
+
+ if (lc($opts->{'debug'}) eq "true") {
+ $lib_dir = 'lib\\debug';
+ }
+ else {
+ $lib_dir = 'lib\\release';
+ }
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L$basedir\\win32\\$lib_dir\\ -l$snmp_link_lib";
+ }
+ else {
+ my @LibDirs = split (';',$ENV{LIB});
+ my $LibDir;
+ if ($opts->{'prefix'}) {
+ push (@LibDirs,"$ENV{'NET-SNMP-PATH'}${sep}lib");
+ }
+ $noLibDir = 1;
+ while ($noLibDir) {
+ $LibDir = find_files(["$snmp_lib_file"],\@LibDirs);
+ if ($LibDir ne '') {
+ $noLibDir = 0;
+ # Put quotes around LibDir to allow spaces in paths
+ $LibDir = '"' . $LibDir . '"';
+ }
+ else
+ {
+ @LibDirs = ();
+ $LibDirs[0] = prompt("The Net-SNMP library ($snmp_lib_file) could not be found.\nPlease enter the directory where it is located:");
+ $LibDirs[0] =~ s/\\$//;
+ }
+ }
+ $Params{LIBS} = "-L$LibDir -l$snmp_link_lib";
+ }
+
+ $Params{'INC'} = "-I$basedir\\include\\ -I$basedir\\include\\net-snmp\\ -I$basedir\\win32\\ ";
+ }
+ else {
+ $opts = NetSNMPGetOpts();
+ $Params{'LDDLFLAGS'} = "$Config{lddlflags} " . `$opts->{'nsconfig'} --ldflags`;
+ $Params{'LIBS'} = `$opts->{'nsconfig'} --libs`;
+ chomp($Params{'LIBS'});
+ $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
+ chomp($Params{'CCFLAGS'});
+ $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
+ $lib_version = `$opts->{'nsconfig'} --version`;
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
+ $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
+# } else {
+# $Params{'PREREQ_PM'} = {'SNMP' => '5.0'};
+ }
+ $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
+ die "You need to install net-snmp first (I can't find net-snmp-config)";
+ }
+ }
+
+ return(%Params);
+}
+# common subroutines -- DO NOT EDIT.
+# They are imported from the Makefile.subs.pl file
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ # we allow for perl/CPAN-only revisions beyond the default
+ # version formatting of net-snmp itself.
+ $perlver =~ s/(\.\d{5}).*/\1/;
+ $perlver =~ s/0*$//;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/OID/OID.pm b/perl/OID/OID.pm
new file mode 100644
index 0000000..fa6b162
--- /dev/null
+++ b/perl/OID/OID.pm
@@ -0,0 +1,256 @@
+package NetSNMP::OID;
+
+use strict;
+use warnings;
+use Carp;
+
+require Exporter;
+require DynaLoader;
+use AutoLoader;
+
+sub compare($$);
+
+use overload
+ '<=>' => \&compare,
+ 'cmp' => \&oidstrcmp,
+ '""' => \&quote_oid,
+ '+' => \&add,
+;
+
+use SNMP;
+
+sub quote_oid {
+ return $_[0]->{'oidptr'}->to_string();
+}
+
+sub length {
+ return $_[0]->{'oidptr'}->length();
+}
+
+sub get_indexes {
+ return $_[0]->{'oidptr'}->get_indexes();
+}
+
+sub append {
+ my $this = shift;
+ my $str = shift;
+
+ if (ref($str) eq 'NetSNMP::OID') {
+ return $this->{'oidptr'}->append_oid($str->{'oidptr'});
+ }
+ $str = "." . $str if ($str =~ /^\d+/);
+ if ($str =~ /^[.\d]+/) {
+ # oid segment
+ return $this->{'oidptr'}->append($str);
+ }
+ if ($str =~ /^\"(.*)\"$/) {
+ # string index
+ my $newstr = "." . CORE::length($1);
+ map { $newstr .= ".$_" } unpack("c*",$1);
+ return $this->{'oidptr'}->append($newstr);
+ }
+ if ($str =~ /^\'(.*)\'$/) {
+ # string index, implied
+ my $newstr;
+ map { $newstr .= ".$_" } unpack("c*",$1);
+ return $this->{'oidptr'}->append($newstr);
+ }
+ # Just Parse it...
+ return $this->{'oidptr'}->append($str);
+}
+
+sub add {
+ my $this = shift;
+ my $str = shift;
+ my ($newoid, %newhash);
+ $newoid = \%newhash;
+ $newoid->{'oidptr'} = $this->{'oidptr'}->clone();
+ bless($newoid, ref($this));
+ $newoid->append($str);
+ return $newoid;
+}
+
+use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION $AUTOLOAD);
+
+@ISA = qw(Exporter DynaLoader);
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration use NetSNMP::OID ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+%EXPORT_TAGS = ( 'all' => [ qw(
+ snmp_oid_compare
+ compare
+) ] );
+
+@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+@EXPORT = qw(
+ snmp_oid_compare
+ compare
+);
+$VERSION = '5.0702';
+
+sub new {
+ my $type = shift;
+ my $arg = shift;
+ if (!$arg) {
+ $arg = $type;
+ $type = "NetSNMP::OID";
+ }
+ SNMP::init_snmp("perl");
+ my $ptr = NetSNMP::OID::newptr($arg);
+ if ($ptr) {
+ return newwithptr($type, $ptr);
+ }
+}
+
+sub newwithptr {
+ my $type = shift;
+ my $ptr = shift;
+ my $self = {};
+ if (!$ptr) {
+ $ptr = $type;
+ $type = "NetSNMP::OID";
+ }
+ SNMP::init_snmp("perl");
+ $self->{'oidptr'} = $ptr;
+ bless($self, $type);
+ return $self;
+}
+
+sub snmp_oid_compare($$) {
+ my ($oid1, $oid2) = @_;
+ return _snmp_oid_compare($oid1->{oidptr}, $oid2->{oidptr});
+}
+
+sub compare($$) {
+ my ($v1, $v2) = @_;
+ snmp_oid_compare($v1, $v2);
+}
+
+sub oidstrcmp {
+ my ($v1, $v2) = @_;
+ $v1->{'oidptr'}->to_string cmp $v2->{'oidptr'}->to_string;
+}
+
+sub to_array($) {
+ my $self = shift;
+ return $self->{oidptr}->to_array();
+}
+
+sub DESTROY {}
+
+sub AUTOLOAD {
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function. If a constant is not found then control is passed
+ # to the AUTOLOAD in AutoLoader.
+
+ my $constname;
+ ($constname = $AUTOLOAD) =~ s/.*:://;
+ croak "& not defined" if $constname eq 'constant';
+ my $val;
+ ($!, $val) = constant($constname);
+ if ($! != 0) {
+ if ($! =~ /Invalid/ || $!{EINVAL}) {
+ $AutoLoader::AUTOLOAD = $AUTOLOAD;
+ goto &AutoLoader::AUTOLOAD;
+ }
+ else {
+ croak "Your vendor has not defined NetSNMP::OID macro $constname";
+ }
+ }
+ {
+ no strict 'refs';
+ # Fixed between 5.005_53 and 5.005_61
+ if ($] >= 5.00561) {
+ *$AUTOLOAD = sub () { $val };
+ }
+ else {
+ *$AUTOLOAD = sub { $val };
+ }
+ }
+ goto &$AUTOLOAD;
+}
+
+bootstrap NetSNMP::OID $VERSION;
+
+# Preloaded methods go here.
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+
+=head1 NAME
+
+NetSNMP::OID - Perl extension for manipulating OIDs
+
+=head1 SYNOPSIS
+
+ use NetSNMP::OID;
+
+ my $oid = new NetSNMP::OID('sysContact.0');
+
+ if ($oid < new NetSNMP::OID('ifTable')) {
+ do_something();
+ }
+
+ my @numarray = $oid->to_array();
+
+ # appending oids
+ $oid = new NetSNMP::OID('.1.3');
+ $oid += ".6.1";
+ # -> .1.3.6.1
+
+ # appending index strings
+
+ $oid2 = $oid + "\"wes\"";
+ # -> .1.3.6.1.3.119.101.115
+
+ $oid3 = $oid + "\'wes\'";
+ # -> .1.3.6.1.119.101.115
+
+ $len = $oid3->length();
+ # -> 7
+
+ # retrieving indexes from an oid:
+ $arrayref = $tableoid->get_indexes()
+
+=head1 DESCRIPTION
+
+The NetSNMP::OID module is a simple wrapper around a C-based net-snmp
+oid (which is an array of unsigned integers). The OID is internally
+stored as a C array of integers for speed purposes when doing
+comparisons, etc.
+
+The standard logical expression operators (<, >, ==, ...) are
+overloaded such that lexographical comparisons may be done with them.
+
+The + operator is overloaded to allow you to append stuff on to the
+end of a OID, like index segments of a table, for example.
+
+=head2 EXPORT
+
+int snmp_oid_compare(oid1, oid2)
+int compare(oid1, oid2)
+
+=head1 AUTHOR
+
+Wes Hardaker, E<lt>hardaker@users.sourceforge.netE<gt>
+
+=head1 SEE ALSO
+
+L<SNMP>, L<perl>.
+
+=head1 Copyright
+
+Copyright (c) 2002 Networks Associates Technology, Inc. All
+Rights Reserved. This program is free software; you can
+redistribute it and/or modify it under the same terms as Perl
+itself.
+
+=cut
diff --git a/perl/OID/OID.xs b/perl/OID/OID.xs
new file mode 100644
index 0000000..10485f9
--- /dev/null
+++ b/perl/OID/OID.xs
@@ -0,0 +1,442 @@
+/* -*- C -*- */
+#if defined(_WIN32) && !defined(_WIN32_WINNT)
+#define _WIN32_WINNT 0x501
+#endif
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+/* pulled from Dave's, yet-to-be-used, net-snmp library rewrite.
+ autocompatibility for the future? */
+
+typedef struct netsnmp_oid_s {
+ oid *name;
+ size_t len;
+ oid namebuf[ MAX_OID_LEN ];
+} netsnmp_oid;
+
+static int constant(double *value, const char *name, const int len)
+{
+ return EINVAL;
+}
+
+netsnmp_oid *
+nso_newarrayptr(oid *name, size_t name_len)
+{
+ netsnmp_oid *RETVAL;
+ RETVAL = malloc(sizeof(netsnmp_oid));
+ RETVAL->name = RETVAL->namebuf;
+ RETVAL->len = name_len;
+ memcpy(RETVAL->name, name, name_len * sizeof(oid));
+ return RETVAL;
+}
+
+static int __sprint_num_objid _((char *, oid *, int));
+
+/* stolen from SNMP.xs. Ug, this needs merging to snmplib */
+/* XXX: this is only here because snmplib forces quotes around the
+ data and won't return real binary data or a numeric string. Every
+ app must do its own switch() to get around it. Ug. */
+#define USE_BASIC 0
+#define USE_ENUMS 1
+#define USE_SPRINT_VALUE 2
+static int
+__snprint_value (buf, buf_len, var, tp, type, flag)
+char * buf;
+size_t buf_len;
+netsnmp_variable_list * var;
+struct tree * tp;
+int type;
+int flag;
+{
+ int len = 0;
+ u_char* ip;
+ struct enum_list *ep;
+
+
+ buf[0] = '\0';
+ if (flag == USE_SPRINT_VALUE) {
+ snprint_value(buf, buf_len, var->name, var->name_length, var);
+ len = strlen(buf);
+ } else {
+ switch (var->type) {
+ case ASN_INTEGER:
+ if (flag == USE_ENUMS) {
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (ep->value == *var->val.integer) {
+ strcpy(buf, ep->label);
+ len = strlen(buf);
+ break;
+ }
+ }
+ }
+ if (!len) {
+ sprintf(buf,"%ld", *var->val.integer);
+ len = strlen(buf);
+ }
+ break;
+
+ case ASN_GAUGE:
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ sprintf(buf,"%lu", (unsigned long) *var->val.integer);
+ len = strlen(buf);
+ break;
+
+ case ASN_OCTET_STR:
+ case ASN_OPAQUE:
+ memcpy(buf, (char*)var->val.string, var->val_len);
+ len = var->val_len;
+ break;
+
+ case ASN_IPADDRESS:
+ ip = (u_char*)var->val.string;
+ sprintf(buf, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
+ len = strlen(buf);
+ break;
+
+ case ASN_NULL:
+ break;
+
+ case ASN_OBJECT_ID:
+ __sprint_num_objid(buf, (oid *)(var->val.objid),
+ var->val_len/sizeof(oid));
+ len = strlen(buf);
+ break;
+
+ case SNMP_ENDOFMIBVIEW:
+ sprintf(buf,"%s", "ENDOFMIBVIEW");
+ break;
+ case SNMP_NOSUCHOBJECT:
+ sprintf(buf,"%s", "NOSUCHOBJECT");
+ break;
+ case SNMP_NOSUCHINSTANCE:
+ sprintf(buf,"%s", "NOSUCHINSTANCE");
+ break;
+
+ case ASN_COUNTER64:
+ printU64(buf,(struct counter64 *)var->val.counter64);
+ len = strlen(buf);
+ break;
+
+ case ASN_BIT_STR:
+ snprint_bitstring(buf, buf_len, var, NULL, NULL, NULL);
+ len = strlen(buf);
+ break;
+
+ case ASN_NSAP:
+ default:
+ warn("snprint_value: asn type not handled %d\n",var->type);
+ }
+ }
+ return(len);
+}
+
+static int
+__sprint_num_objid (buf, objid, len)
+char *buf;
+oid *objid;
+int len;
+{
+ int i;
+ buf[0] = '\0';
+ for (i=0; i < len; i++) {
+ sprintf(buf,".%" NETSNMP_PRIo "u",*objid++);
+ buf += strlen(buf);
+ }
+ return SNMPERR_SUCCESS;
+}
+
+MODULE = NetSNMP::OID PACKAGE = NetSNMP::OID PREFIX=nso_
+
+netsnmp_oid *
+nso_newptr(initstring)
+ char *initstring
+ CODE:
+ if (get_tree_head() == NULL)
+ netsnmp_init_mib();
+ RETVAL = malloc(sizeof(netsnmp_oid));
+ RETVAL->name = RETVAL->namebuf;
+ RETVAL->len = sizeof(RETVAL->namebuf)/sizeof(RETVAL->namebuf[0]);
+ if (!snmp_parse_oid(initstring, (oid *) RETVAL->name, &RETVAL->len)) {
+ snmp_log(LOG_ERR, "Can't parse: %s\n", initstring);
+ RETVAL->len = 0;
+ free(RETVAL);
+ RETVAL = NULL;
+ }
+ OUTPUT:
+ RETVAL
+
+void
+constant(sv)
+ PREINIT:
+ STRLEN len;
+ INPUT:
+ SV * sv
+ char * s = SvPV(sv, len);
+ INIT:
+ int status;
+ double value;
+ PPCODE:
+ value = 0;
+ status = constant(&value, s, len);
+ XPUSHs(sv_2mortal(newSVuv(status)));
+ XPUSHs(sv_2mortal(newSVnv(value)));
+
+int
+_snmp_oid_compare(oid1, oid2)
+ netsnmp_oid *oid1;
+ netsnmp_oid *oid2;
+ CODE:
+ RETVAL = snmp_oid_compare((oid *) oid1->name, oid1->len,
+ (oid *) oid2->name, oid2->len);
+ OUTPUT:
+ RETVAL
+
+MODULE = NetSNMP::OID PACKAGE = netsnmp_oidPtr PREFIX = nsop_
+
+void
+nsop_DESTROY(oid1)
+ netsnmp_oid *oid1
+ CODE:
+{
+ if (oid1->name != oid1->namebuf) {
+ free(oid1->name);
+ }
+ free(oid1);
+}
+
+char *
+nsop_to_string(oid1)
+ netsnmp_oid *oid1
+ PREINIT:
+ static char mystr[SNMP_MAXBUF];
+ CODE:
+ {
+ if (oid1->len == 0)
+ snprintf(mystr, sizeof(mystr), "Illegal OID");
+ else
+ snprint_objid(mystr, sizeof(mystr),
+ (oid *) oid1->name, oid1->len);
+ RETVAL = mystr;
+ }
+
+ OUTPUT:
+ RETVAL
+
+void
+nsop_to_array(oid1)
+ netsnmp_oid *oid1;
+ PREINIT:
+ int i;
+
+ PPCODE:
+ EXTEND(SP, oid1->len);
+ for(i=0; i < (int)oid1->len; i++) {
+ PUSHs(sv_2mortal(newSVnv(oid1->name[i])));
+ }
+
+SV *
+nsop_get_indexes(oid1)
+ netsnmp_oid *oid1;
+ PREINIT:
+ int i, nodecount;
+ struct tree *tp, *tpe, *tpnode, *indexnode;
+ struct index_list *index;
+ netsnmp_variable_list vbdata;
+ u_char *buf = NULL;
+ size_t buf_len = 256, out_len = 0;
+ oid name[MAX_OID_LEN];
+ size_t name_len = MAX_OID_LEN;
+ oid *oidp;
+ size_t oidp_len;
+ AV *myret;
+ int is_private;
+
+ CODE:
+ {
+ memset(&vbdata, 0, sizeof(vbdata));
+ if (NULL == (tp = get_tree(oid1->name, oid1->len,
+ get_tree_head()))) {
+ RETVAL = NULL;
+ return;
+ }
+
+ if ((buf = netsnmp_malloc(buf_len)) == NULL) {
+ RETVAL = NULL;
+ return;
+ }
+
+ tpe = NULL;
+ nodecount = 0;
+ for(tpnode = tp; tpnode; tpnode = tpnode->parent) {
+ nodecount++;
+ if (nodecount == 2)
+ tpe = tpnode;
+ if (nodecount == 3 &&
+ (strlen(tpnode->label) < 6 ||
+ strcmp(tpnode->label + strlen(tpnode->label) - 5,
+ "Table"))) {
+ /* we're not within a table. bad logic, little choice */
+ netsnmp_free(buf);
+ RETVAL = NULL;
+ return;
+ }
+ }
+
+ if (!tpe) {
+ netsnmp_free(buf);
+ RETVAL = NULL;
+ return;
+ }
+
+ if (tpe->augments && strlen(tpe->augments) > 0) {
+ /* we're augmenting another table, so use that entry instead */
+ if (!snmp_parse_oid(tpe->augments, name, &name_len) ||
+ (NULL ==
+ (tpe = get_tree(name, name_len,
+ get_tree_head())))) {
+ netsnmp_free(buf);
+ RETVAL = NULL;
+ return; /* XXX: better error recovery needed? */
+ }
+ }
+
+ i = 0;
+ for(index = tpe->indexes; index; index = index->next) {
+ i++;
+ }
+
+ myret = (AV *) sv_2mortal((SV *) newAV());
+
+ oidp = oid1->name + nodecount;
+ oidp_len = oid1->len - nodecount;
+
+ for(index = tpe->indexes; index; index = index->next) {
+ /* XXX: NOT efficient! */
+ name_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(index->ilabel, name, &name_len) ||
+ (NULL ==
+ (indexnode = get_tree(name, name_len,
+ get_tree_head())))) {
+ netsnmp_free(buf);
+ RETVAL = NULL;
+ return; /* xxx mem leak */
+ }
+ vbdata.type = mib_to_asn_type(indexnode->type);
+
+ if (vbdata.type == (u_char) -1) {
+ netsnmp_free(buf);
+ RETVAL = NULL;
+ return; /* XXX: not good. half populated stack? */
+ }
+
+ /* check for fixed length strings */
+ if (vbdata.type == ASN_OCTET_STR &&
+ indexnode->ranges && !indexnode->ranges->next
+ && indexnode->ranges->low == indexnode->ranges->high) {
+ vbdata.val_len = indexnode->ranges->high;
+ vbdata.type |= ASN_PRIVATE;
+ is_private = 1;
+ } else {
+ vbdata.val_len = 0;
+ if (index->isimplied) {
+ vbdata.type |= ASN_PRIVATE;
+ is_private = 1;
+ } else {
+ is_private = 0;
+ }
+ }
+
+ if (parse_one_oid_index(&oidp, &oidp_len, &vbdata, 0)
+ != SNMPERR_SUCCESS) {
+ netsnmp_free(buf);
+ RETVAL = NULL;
+ return;
+ }
+ out_len = 0;
+ if (is_private)
+ vbdata.type ^= ASN_PRIVATE;
+ out_len =
+ __snprint_value (buf, buf_len, &vbdata, indexnode,
+ vbdata.type, 0);
+/*
+ sprint_realloc_value(&buf, &buf_len, &out_len,
+ 1, name, name_len, &vbdata);
+*/
+ snmp_free_var_internals(&vbdata);
+ av_push(myret, newSVpv((char *)buf, out_len));
+ }
+ netsnmp_free(buf);
+ RETVAL = newRV((SV *)myret);
+ }
+ OUTPUT:
+ RETVAL
+
+void
+nsop_append(oid1, string)
+ netsnmp_oid *oid1;
+ char *string;
+ PREINIT:
+ oid name[MAX_OID_LEN];
+ size_t name_len = MAX_OID_LEN;
+ int i;
+ CODE:
+ {
+ if (!snmp_parse_oid(string, (oid *) name, &name_len)) {
+ /* XXX */
+ }
+ if (oid1->len + name_len > MAX_OID_LEN) {
+ /* XXX: illegal */
+ }
+ for(i = 0; i < (int)name_len; i++) {
+ oid1->name[i+oid1->len] = name[i];
+ }
+ oid1->len += name_len;
+ }
+
+void
+nsop_append_oid(oid1, oid2)
+ netsnmp_oid *oid1;
+ netsnmp_oid *oid2;
+ PREINIT:
+ int i;
+ CODE:
+ {
+ if (oid1->len + oid2->len > MAX_OID_LEN) {
+ /* XXX: illegal */
+ }
+ for(i = 0; i < (int)oid2->len; i++) {
+ oid1->name[i+oid1->len] = oid2->name[i];
+ }
+ oid1->len += oid2->len;
+ }
+
+int
+nsop_length(oid1)
+ netsnmp_oid *oid1;
+ CODE:
+ {
+ RETVAL = oid1->len;
+ }
+ OUTPUT:
+ RETVAL
+
+netsnmp_oid *
+nsop_clone(oid1)
+ netsnmp_oid *oid1;
+ PREINIT:
+ netsnmp_oid *oid2;
+ CODE:
+ {
+ oid2 = nso_newarrayptr(oid1->name, oid1->len);
+ RETVAL = oid2;
+ }
+OUTPUT:
+ RETVAL
+
diff --git a/perl/OID/README b/perl/OID/README
new file mode 100644
index 0000000..0355446
--- /dev/null
+++ b/perl/OID/README
@@ -0,0 +1,31 @@
+OID version 0.01
+================
+
+The NetSNMP::OID class is a simple wrapper around a C-based net-snmp
+oid. The OID is internally stored as a C array of integers for speed
+purposes when doing comparisons, etc. The standard logical expression
+operators (<, >, ==, ...) are overloaded such that lexographical
+comparisons may be done with them.
+
+INSTALLATION
+
+To install this module type the following:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+DEPENDENCIES
+
+This module requires these other modules and libraries:
+
+ The net-snmp 5.0 or greater release
+ The SNMP 5.0.1 or greater perl module.
+
+COPYRIGHT AND LICENCE
+
+Copyright (c) 2002 Networks Associates Technology, Inc. All
+Rights Reserved. This program is free software; you can
+redistribute it and/or modify it under the same terms as Perl
+itself.
diff --git a/perl/OID/netsnmp-feature-definitions.h b/perl/OID/netsnmp-feature-definitions.h
new file mode 100644
index 0000000..fb4ccdb
--- /dev/null
+++ b/perl/OID/netsnmp-feature-definitions.h
@@ -0,0 +1,6 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_require(snprint_objid)
+netsnmp_feature_require(snprint_value)
+
diff --git a/perl/OID/test.pl b/perl/OID/test.pl
new file mode 100644
index 0000000..aee410c
--- /dev/null
+++ b/perl/OID/test.pl
@@ -0,0 +1,137 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+#########################
+
+# change 'tests => 1' to 'tests => last_test_to_print';
+
+use Test;
+BEGIN { eval "use Cwd qw(abs_path)"; plan tests => 38 ; $ENV{'SNMPCONFPATH'} = 'nopath' ; $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs"); };
+use NetSNMP::OID;
+
+ok(1); # If we made it this far, we're ok.
+
+#########################
+
+# Insert your test code below, the Test module is use()ed here so read
+# its man page ( perldoc Test ) for help writing this test script.
+
+my $oid = new NetSNMP::OID(".1.3.6.1");
+ok(ref($oid) eq "NetSNMP::OID");
+ok(ref($oid->{oidptr}) eq "netsnmp_oidPtr");
+#print STDERR ref($oid),"\n";
+
+my $tostring = "$oid";
+#print STDERR "$tostring\n";
+ok($tostring eq "internet");
+
+my $oid2 = new NetSNMP::OID(".1.3.6.1.2");
+$tostring = "$oid2";
+#print STDERR "$tostring\n";
+ok($tostring eq "mgmt");
+
+my $oid3 = new NetSNMP::OID(".1.3.6.1");
+
+my $val = NetSNMP::OID::snmp_oid_compare($oid, $oid2);
+#print STDERR "compare result: $val\n";
+ok($val == -1);
+
+$val = $oid2->snmp_oid_compare($oid);
+#print STDERR "compare result: $val\n";
+ok($val == 1);
+
+$val = NetSNMP::OID::compare($oid, $oid);
+#print STDERR "compare result: $val\n";
+ok($val == 0);
+
+$val = $oid->compare($oid3);
+#print STDERR "compare result: $val\n";
+ok($val == 0);
+
+ok(($oid <=> $oid2) == -1);
+ok(($oid2 <=> $oid) == 1);
+ok(($oid <=> $oid3) == 0);
+
+ok($oid < $oid2);
+ok($oid <= $oid2);
+ok($oid2 > $oid);
+ok($oid2 >= $oid);
+ok($oid == $oid3);
+ok($oid <= $oid3);
+ok($oid >= $oid3);
+
+ok(new NetSNMP::OID('system') < new NetSNMP::OID('interfaces'));
+ok(new NetSNMP::OID('interfaces') > new NetSNMP::OID('system'));
+ok(new NetSNMP::OID('sysORTable') > new NetSNMP::OID('system'));
+
+my @a = $oid->to_array();
+ok($a[0] == 1 && $a[1] == 3 && $a[2] == 6 && $a[3] == 1 && $#a == 3);
+
+$oid->append(".1.2.3");
+ok("$oid" eq "directory.2.3");
+
+$oidmore = $oid + ".8.9.10";
+ok($oidmore == new NetSNMP::OID("directory.2.3.8.9.10"));
+ok("$oid" eq "directory.2.3");
+ok(ref($oidmore) eq "NetSNMP::OID");
+
+# += should work
+$oidmore += ".11";
+ok($oidmore == new NetSNMP::OID("directory.2.3.8.9.10.11"));
+
+$oidstr = $oidmore + "\"wes\"";
+ok($oidstr == new NetSNMP::OID("directory.2.3.8.9.10.11.3.119.101.115"));
+
+$oidstr = $oidmore + "\'wes\'";
+ok($oidstr == new NetSNMP::OID("directory.2.3.8.9.10.11.119.101.115"));
+
+# just make sure you can do it twice (ie, not modify the original)
+$oidstr = $oidmore + "\'wes\'";
+ok($oidstr == new NetSNMP::OID("directory.2.3.8.9.10.11.119.101.115"));
+
+$oidstr = $oidmore + "internet";
+ok($oidstr == new NetSNMP::OID("directory.2.3.8.9.10.11.1.3.6.1"));
+
+$oidstr = $oidmore + "999";
+ok($oidstr == new NetSNMP::OID("directory.2.3.8.9.10.11.999"));
+
+$oidstr = $oidmore + (new NetSNMP::OID(".1.3.6.1"));
+ok($oidstr == new NetSNMP::OID("directory.2.3.8.9.10.11.1.3.6.1"));
+
+$oid = new NetSNMP::OID("nosuchoidexists");
+ok(ref($oid) ne "NetSNMP::OID");
+
+ok($oidstr->length() == 15);
+
+# multiple encoded values
+my $newtest = new NetSNMP::OID ("nsModuleName.5.109.121.99.116.120.2.1.3.14");
+
+if ($newtest) {
+ my $arrayback = $newtest->get_indexes();
+
+ ok($#$arrayback == 2 &&
+ $arrayback->[0] eq 'myctx' &&
+ $arrayback->[1] eq '.1.3' &&
+ $arrayback->[2] eq '14'
+ );
+}
+else {
+ ok(0);
+}
+
+# implied string
+$newtest = new NetSNMP::OID ("snmpNotifyRowStatus.105.110.116.101.114.110.97.108.48");
+
+if ($newtest) {
+ $arrayback = $newtest->get_indexes();
+
+ ok($#$arrayback == 0 &&
+ $arrayback->[0] eq 'internal0'
+ );
+}
+else {
+ ok(0);
+}
+
+
+
diff --git a/perl/OID/typemap b/perl/OID/typemap
new file mode 100644
index 0000000..21efbce
--- /dev/null
+++ b/perl/OID/typemap
@@ -0,0 +1,2 @@
+TYPEMAP
+netsnmp_oid * T_PTROBJ
diff --git a/perl/SNMP/BUG b/perl/SNMP/BUG
new file mode 100644
index 0000000..380e98b
--- /dev/null
+++ b/perl/SNMP/BUG
@@ -0,0 +1,40 @@
+
+1) Memory leak (have not seen this lately)
+
+The following snippet used to grow in memory (and may still) - please
+notify me if anyone still observes this and even better has a fix.
+
+perl -le '
+use SNMP;
+$obj = new SNMP::Session DestHost, "dubravka";
+while (){
+print $obj->get(["ifNumber",0]);
+}
+'
+
+***Note: need to verify this with the async API as well***
+
+2) not sure if this is a bug but I can cause a crash with a 'goto
+LABEL;' from within an async callback function.
+
+3) the following varbind format is not encoded correctly ... I have seen this crash the agent as well
+
+$sess->get(["sysDescr.0"]);
+
+use the following instead:
+
+$sess->get(["sysDescr",0]);
+or
+$sess->get("sysDescr.0");
+
+4) this is not handled yet
+$sess->get(['MODULE-NAME::mibName',0]);
+but strangely
+$sess->get(['MODULE-NAME::mibName.0']);
+works
+
+5) if you are on a system that does not have vsnprintf in libc but you
+do have BerkleyDB installed ucd configure will assume you will get it
+from there - you will need to change hints/solaris.pl to
+
+$self->{LIBS} .= ' -lkstat -ldb';
diff --git a/perl/SNMP/MANIFEST b/perl/SNMP/MANIFEST
new file mode 100644
index 0000000..cb32c37
--- /dev/null
+++ b/perl/SNMP/MANIFEST
@@ -0,0 +1,37 @@
+BUG
+examples/async1.pl
+examples/async2.pl
+examples/bulkwalk.pl
+examples/ipforward.pl
+examples/mibtree.pl
+examples/mibwalk.pl
+examples/pingmib.pl
+examples/tablewalk.pl
+examples/testleak.pl
+examples/trap-example.pl
+hints/irix.pl
+hints/solaris.pl
+Makefile.PL
+MANIFEST
+MANIFEST.SKIP
+perlsnmp.h
+README
+SNMP.pm
+SNMP.xs
+t/async.t
+t/bulkwalk.t
+t/conf.t
+t/get.t
+t/getnext.t
+t/mib.t
+t/mib.txt
+t/mibload.t
+t/notify.t
+t/README
+t/session.t
+t/set.t
+t/startagent.pl
+t/conftest.conf
+t/snmptest.conf
+TODO
+typemap
diff --git a/perl/SNMP/MANIFEST.SKIP b/perl/SNMP/MANIFEST.SKIP
new file mode 100644
index 0000000..d3183e1
--- /dev/null
+++ b/perl/SNMP/MANIFEST.SKIP
@@ -0,0 +1,11 @@
+\.bak$
+\.o$
+~$
+^Makefile$
+^Makefile.old$
+\.bs$
+\.bso$
+\.c
+\.em
+^include
+^host$
diff --git a/perl/SNMP/Makefile.PL b/perl/SNMP/Makefile.PL
new file mode 100644
index 0000000..e617cb7
--- /dev/null
+++ b/perl/SNMP/Makefile.PL
@@ -0,0 +1,363 @@
+use ExtUtils::MakeMaker;
+require 5;
+use Config;
+use Getopt::Long;
+my $lib_version;
+my %MakeParams = ();
+my $opts;
+
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+
+%MakeParams = InitMakeParams();
+
+WriteMakefile(%MakeParams);
+
+Check_Version();
+
+GetTestInfo();
+
+sub InitMakeParams {
+ my %Params = (
+ NAME => 'SNMP',
+ dist => { SUFFIX => "gz", COMPRESS => "gzip -9f"},
+ MAN3PODS => { 'SNMP.pm' => '$(INST_MAN3DIR)/SNMP.3' },
+ XSPROTOARG => '-noprototypes', # XXX remove later?
+ VERSION_FROM => 'SNMP.pm',
+ realclean => { FILES => 'host' },
+ );
+
+ if ($ENV{'OSTYPE'} eq 'msys') {
+ $Params{'DEFINE'} = "-DMINGW_PERL";
+ }
+
+ my ($snmp_lib, $snmp_llib, $sep);
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+ $opts = NetSNMPGetOpts();
+ $Params{'DEFINE'} = "-DMSVC_PERL -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS";
+ $sep = '\\';
+ $snmp_lib_file = 'netsnmp.lib';
+ $snmp_link_lib = 'netsnmp';
+
+ if (lc($opts->{'debug'}) eq "true") {
+ $lib_dir = 'lib\\debug';
+ }
+ else {
+ $lib_dir = 'lib\\release';
+ }
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L$basedir\\win32\\$lib_dir\\ -l$snmp_link_lib";
+ }
+ else {
+ my @LibDirs = split (';',$ENV{LIB});
+ my $LibDir;
+ if ($opts->{'prefix'}) {
+ push (@LibDirs,"$ENV{'NET-SNMP-PATH'}${sep}lib");
+ }
+ $noLibDir = 1;
+ while ($noLibDir) {
+ $LibDir = find_files(["$snmp_lib_file"],\@LibDirs);
+ if ($LibDir ne '') {
+ $noLibDir = 0;
+ # Put quotes around LibDir to allow spaces in paths
+ $LibDir = '"' . $LibDir . '"';
+ }
+ else
+ {
+ @LibDirs = ();
+ $LibDirs[0] = prompt("The Net-SNMP library ($snmp_lib_file) could not be found.\nPlease enter the directory where it is located:");
+ $LibDirs[0] =~ s/\\$//;
+ }
+ }
+ $Params{LIBS} = "-L$LibDir -l$snmp_link_lib";
+ }
+
+ $Params{'INC'} = "-I$basedir\\include\\ -I$basedir\\include\\net-snmp\\ -I$basedir\\win32\\ ";
+ }
+ else {
+ $opts = NetSNMPGetOpts();
+ $Params{'LDDLFLAGS'} = "$Config{lddlflags} " . `$opts->{'nsconfig'} --ldflags`;
+ if (!$ENV{'NETSNMP_LIBS'}) {
+ $Params{'LIBS'} = `$opts->{'nsconfig'} --libs`;
+ chomp($Params{'LIBS'});
+ } else {
+ $Params{'LIBS'} = $ENV{'NETSNMP_LIBS'};
+ }
+ if (!$ENV{'NETSNMP_CCFLAGS'}) {
+ $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
+ chomp($Params{'CCFLAGS'});
+ $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
+ } else {
+ $Params{'CCFLAGS'} = $ENV{'NETSNMP_CCFLAGS'};
+ }
+ $lib_version = `$opts->{'nsconfig'} --version`;
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
+ $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
+# } else {
+# $Params{'PREREQ_PM'} = { 'NetSNMP::default_store' => 0.01 };
+ }
+ $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ if (!$ENV{'NETSNMP_PREFIX'}) {
+ $prefix = `$opts->{'nsconfig'} --prefix`;
+ chomp($prefix);
+ $sep = '/';
+ } else {
+ $prefix = $ENV{'NETSNMP_PREFIX'};
+ }
+ if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
+ die "You need to install net-snmp first (I can't find net-snmp-config)";
+ }
+ }
+
+ return(%Params);
+
+}
+
+sub GetTestInfo {
+ my $sep = ($^O =~ /win32/i ? '\\' : '/');
+ my $info_file = "t${sep}snmptest.cmd";
+ my $snmpd_path1 = "${prefix}${sep}sbin";
+ my $snmpd_path2 = "${sep}usr${sep}sbin";
+ my $snmpd_path3 = "${sep}usr${sep}bin";
+ my $win32_snmpd_path = $ENV{'NET-SNMP-PATH'} . $sep . "bin";
+
+ open(H, ">$info_file") || die "Error: could not open file '$info_file'($!)";
+
+ my ($mibdir, $snmpd, $snmptrapd);
+
+ # Windows
+ if ($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '') {
+ if (lc ($opts->{'insource'}) eq "true") {
+ $mibdir = "../../mibs";
+ if (lc($opts->{'debug'}) eq "true") {
+ $snmpd = "../../win32/bin/debug";
+ $snmptrapd = "../../win32/bin/debug";
+ }
+ else {
+ $snmpd = "../../win32/bin/release";
+ $snmptrapd = "../../win32/bin/release";
+ }
+ } else {
+ $mibdir = $ENV{'NET-SNMP-PATH'} . "${sep}share${sep}snmp${sep}mibs";
+ $snmpd = find_files(["snmpd.exe"], [$win32_snmpd_path]);
+ $snmptrapd = find_files(["snmptrapd.exe"], [$win32_snmpd_path]);
+ }
+ }
+
+ # Unix
+ else {
+ if (lc($opts->{'insource'}) eq "true") {
+ $mibdir = "../../mibs";
+ $snmpd = "../../agent/snmpd";
+ $snmptrapd = "../../apps/snmptrapd";
+ } else {
+ $mibdir = "${prefix}${sep}share${sep}snmp${sep}mibs";
+ $snmpd = find_files(["snmpd"], [$snmpd_path1, $snmpd_path2]);
+ $snmptrapd = find_files(["snmptrapd"], [$snmpd_path1, $snmpd_path2]);
+ }
+ }
+
+ $mibdir = find_files(["NET-SNMP-MIB.txt"],[$mibdir]);
+
+ $mibdir ||= prompt("Unable to locate the MIBs, Please enter the path: ",
+ $mibdir);
+ $snmpd ||= prompt("Unable to locate \"snmpd\". Please enter the path: ",
+ $snmpd_path1);
+ $snmptrapd ||=
+ prompt("Unable to locate \"snmptrapd\". Please enter the path: ",
+ $snmpd_path1);
+
+ if ($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '') {
+ $snmpd = $snmpd . $sep . "snmpd.exe";
+ $snmptrapd = $snmptrapd . $sep . "snmptrapd.exe";
+ }
+ else {
+ if ($ENV{'OSTYPE'} eq 'msys') {
+ $snmpd =~ s/snmpd$/snmpd.exe/;
+ $snmptrapd =~ s/snmptrapd$/snmptrapd.exe/;
+ }
+ else
+ {
+ $snmpd =~ s/($sep)?(snmpd)?$/${sep}snmpd/;
+ $snmptrapd =~ s/($sep)?(snmptrapd)?$/${sep}snmptrapd/;
+ }
+ }
+
+ print H "SNMPD => $snmpd\n";
+ print H "SNMPTRAPD => $snmptrapd\n";
+ print H "MIBDIR => $mibdir\n";
+
+ if (!(lc($opts->{'insource'}) eq "true")) {
+ if (-e $snmpd and -r $snmpd) {
+ if (not -x $snmpd) {
+ warn("Error: $snmpd not executable. 'make test' will not work.\n");
+ }
+ } else {
+ warn("Error: $snmpd does not exist or is unreadable. 'make test' will not work.\n");
+ }
+
+ if (-e $snmptrapd and -r $snmptrapd) {
+ if (not -x $snmptrapd) {
+ warn("Error: $snmptrapd not executable. 'make test' will not work.\n");
+ }
+ } else {
+ warn("Error: $snmptrapd does not exist or is unreadable. 'make test' will not work.\n");
+ }
+ }
+# end of else
+ close H;
+}
+
+sub HasSSL {
+ my $config_header = shift;
+ my $has_ssl;
+ unless (open(C,"<$config_header")) {
+ warn("Unable to open $config_header, assuming no SSL\n");
+ return undef;
+ }
+ while (<C>) {
+ $has_ssl++, last if /^\s*#define\s+NETSNMP_USE_OPENSSL/;
+ }
+ close C;
+ return $has_ssl;
+}
+# common subroutines -- DO NOT EDIT.
+# They are imported from the Makefile.subs.pl file
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ # we allow for perl/CPAN-only revisions beyond the default
+ # version formatting of net-snmp itself.
+ $perlver =~ s/(\.\d{5}).*/\1/;
+ $perlver =~ s/0*$//;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/SNMP/README b/perl/SNMP/README
new file mode 100644
index 0000000..5d85aca
--- /dev/null
+++ b/perl/SNMP/README
@@ -0,0 +1,896 @@
+ The Perl5 'SNMP' Extension Module
+ for the Net-SNMP Library
+
+Contents:
+ Introduction:
+ Availability:
+ Contact:
+ Supported Platforms:
+ Release Notes:
+ Installation:
+ Operational Description:
+ Trouble Shooting:
+ Acknowledgments:
+ History:
+ Copyright:
+
+Introduction:
+
+ ******************************NOTE NOTE NOTE**************************
+ This module now relies on many other modules. Ideally, do not try
+ to build it independently, as it won't work as well. Instead of
+ running "perl Makefile.PL" in this directory, run it in the
+ net-snmp/perl directory instead which has a global makefile used to
+ build all the sub-modules in their proper order.
+ ******************************NOTE NOTE NOTE**************************
+
+ Note: The perl SNMP 5.x module which comes with net-snmp 5.0 and
+ higher is different than previous versions in a number of ways. Most
+ importantly, it behaves like a proper net-snmp application and calls
+ init_snmp properly, which means it will read configuration files and
+ use those defaults where appropriate automatically parse MIB files,
+ etc. This will likely affect your perl applications if you have, for
+ instance, default values set up in your snmp.conf file (as the perl
+ module will now make use of those defaults). The docmuentation,
+ however, has sadly not been updated yet (aside from this note).
+
+ This is the Perl5 'SNMP' extension module. The SNMP module provides a
+ full featured, tri-lingual SNMP (SNMPv3, SNMPv2c, SNMPv1) API. The
+ SNMP module also provides an interface to the SMI MIB parse-tree for
+ run-time access to parsed MIB data. The SNMP module internals rely on
+ the Net-SNMP toolkit library (previously known as ucd-snmp). For
+ information on the Net-SNMP library see the documentation provided
+ with the Net-SNMP distribution or the project web page available on
+ 'Source Forge':
+
+ http://www.net-snmp.org/
+
+Availability:
+
+ The most recent release of the Perl5 SNMP module can be found bundled
+ with the latest Net-SNMP distibution available from:
+
+ http://www.net-snmp.org/download.html
+
+ (Note: The perl SNMP distribution obtained this way has the highest
+ chance of being up to date and compatible with the Net-SNMP version
+ with which it is bundled.)
+
+ A seperately bundled package of the SNMP module can be obtained from CPAN.
+
+ (Note: In previous releases this module was compatible with the CMU
+ SNMP library. Starting with Perl5/SNMP-1.7 this module will *only*
+ work with the Net-SNMP (aka ucd-snmp) library due to dependence on new
+ features)
+
+Contact:
+
+ The following mailing list should be consider the primary support
+ mechanism for this module:
+
+ net-snmp-users ATATAT lists.sourceforge.net mail list
+
+ (see http://www.net-snmp.org/lists/users/ to subscribe)
+
+Supported Platforms:
+
+ Linux 1.2.x, 2.x
+ Solaris 2.x (see the net-snmp README.solaris file!)
+ MS Windows
+ Many other UNIX variants
+ Let us know what it *doesn't* work on, as it should on most systems
+
+Release Notes:
+
+ SNMP module version 5.x is being developed against NET-SNMP-5.0
+ see http://www.net-snmp.org/ for details.
+
+ Compatibility with earlier or later versions of Net-SNMP or
+ UCD-SNMP is not guaranteed due to the dynamic nature of open
+ software development :). The perl module will check the version of
+ net-snmp you have installed for a match and warn you if they don't
+ match exactly.
+
+KNOWN BUGS:
+
+ The make test suite likely won't work perfectly. It relies on
+ running an existing Net-SNMP SNMP agent and various configuration
+ which makes it very hard to ensure exact compatibility. If "make
+ test" fails on you we suggest you install the module anyway.
+
+ (none?) (HA!)
+
+**********************************************************************
+* the rest of this file is likely out of date ************************
+* the rest of this file is likely out of date ************************
+* the rest of this file is likely out of date ************************
+**********************************************************************
+
+Installation:
+
+ Build and install the Net-SNMP package - see Net-SNMP README and
+ INSTALL docs.
+
+ (Note: To ensure that any previous Net-SNMP, ucd-snmp or cmu snmp
+ installation's library or headers are not used by mistake, use the
+ -NET-SNMP-CONFIG directive to explicitly set the path to the
+ net-snmp-config command that knows about the net-snmp installation you
+ want to use.)
+
+ NOTE: build all the perl modules at once using the Makefile.PL in the
+ net-snmp/perl directory rather than the one in this directory.
+
+ Unix:
+
+ cd net-snmp/perl
+ perl Makefile.PL [-NET-SNMP-CONFIG="sh ../../net-snmp-config"] [-NET-SNMP-IN-SOURCE=true]
+ make
+ make test
+ make install
+
+ FreeBSD:
+
+ cd net-snmp/perl
+ perl Makefile.PL -NET-SNMP-CONFIG="sh ../../net-snmp-config" -NET-SNMP-IN-SOURCE=true
+ make
+ make test
+ make install
+
+ Win32 (MSVC++)
+
+ This section covers installation of the Perl modules for Microsoft Visual
+ C++ 6.0 and Microsoft Microsoft Development Environment 2003/2003
+ (MSVC 7.0/7.1). See the following sections for Cygwin and MinGW.
+
+ ActiveState Perl is required.
+
+ Note: With ActiveState Perl (currently at 5.8.2 build 808) and possibly other
+ versions of Perl on Windows, if a Perl script modifies a
+ system environment variable and then calls a C function, the
+ C function will not see the new environment variable. This
+ problem can be seen with the failure of test #3 in the SNMP
+ conf test (perl/SNMP/t/conf.t). The change to the
+ SNMPCONFPATH env variable is not seen by the calls to the C
+ SNMP module.
+
+ Note: The source code should *not* be in a folder that contains a space. For
+ example, compiling in your 'My Documents' or your Desktop (usually
+ c:\Documents and Settings\xxxx\Desktop) is not supported.
+
+ Automatic building / testing with nmakeperl.bat:
+
+ 1. Ensure a static version of Net-SNMP has been compiled and
+ installed. Also ensure the DLL version of snmplib has been
+ compiled and installed. The Perl modules will not function
+ correctly without a shared snmplib library or DLL.
+
+ 2. Install the regex win32 package (gnu_regex.exe). It is available from
+
+ http://people.delphiforums.com/gjc/gnu_regex.html
+
+ a. Copy regex.h to the include folder of MSVC++
+
+ Example: "C:\Program Files\Microsoft Visual Studio .NET 2003\
+ Vc7\include\regex.h"
+
+ b. Copy gnu_regex.lib to the lib folder of MSVC++
+
+ Example: "C:\Program Files\Microsoft Visual Studio .NET 2003\
+ Vc7\lib\gnu_regex.lib"
+
+ c. Copy gnu_regex.dll to your %windir%\system32 folder
+
+ Example: "C:\winnt\system32\gnu_regex.dll"
+
+ 3. Set the environment PATH to locate "nmake", "cl", and "link".
+ Visual Studio installs a VCVARS32.BAT batch file for this purpose.
+
+ 4. Using a command prompt window, cd to the source base directory.
+
+ 5. Invoke win32\nmakeperl.bat to build the Perl SNMP modules. If you see
+ errors, review the "nmake.out" file first. If no errors there,
+ then the modules built correctly, but the tests did not rigourously
+ prove the mettle of the modules. Review "nmaketest.out". If the
+ first three sections mostly pass, the modules are well formed.
+
+ NOTE: If the tests fail, there may be a perl application left hanging.
+ Use the Task Manager to remove any stale perl or snmp*.exe process.
+
+ 6. The final step is to invoke "nmake install". If no errors occurred,
+ then the SNMP modules are available for use by your Perl programs.
+
+
+ Manual building / testing:
+
+ 1. Ensure a static version of Net-SNMP has been compiled and
+ installed. Also ensure the DLL version of snmplib has been
+ compiled and installed. The Perl modules will not function
+ correctly without a shared snmplib library or DLL.
+
+ 2. Install the regex win32 package (gnu_regex.exe). It is available from
+
+ http://people.delphiforums.com/gjc/gnu_regex.html
+
+ a. Copy regex.h to the include folder of MSVC++
+
+ Example: "C:\Program Files\Microsoft Visual Studio .NET 2003\
+ Vc7\include\regex.h"
+
+ b. Copy gnu_regex.lib to the lib folder of MSVC++
+
+ Example: "C:\Program Files\Microsoft Visual Studio .NET 2003\
+ Vc7\lib\gnu_regex.lib"
+
+ c. Copy gnu_regex.dll to your %windir%\system32 folder
+
+ Example: "C:\winnt\system32\gnu_regex.dll"
+
+ 3. Set the environment PATH to locate "nmake", "cl", and "link".
+ Visual Studio installs a VCVARS32.BAT for this purpose.
+
+ 4. Using a command prompt window, cd to the perl directory.
+
+ 5. Type:
+
+ perl Makefile.PL CAPI=TRUE -NET-SNMP-IN-SOURCE=TRUE
+
+ to compile against the RELEASE version of Net-SNMP, or:
+
+ perl Makefile.PL CAPI=TRUE -NET-SNMP-IN-SOURCE=TRUE -NET-SNMP-DEBUG=TRUE
+
+ to compile against the DEBUG version of Net-SNMP.
+
+ nmake
+ nmake test
+ nmake install
+
+ Note: The --NET-SNMP-IN-SOURCE=TRUE causes the Makefile to use the
+ library files from the installed Net-SNMP directory.
+ To specify the installed Net-SNMP directory, use:
+
+ perl Makefile.PL CAPI=TRUE -NET-SNMP-PATH="c:\usr"
+
+ Note: -NET-SNMP-DEBUG has no effect while compiling against an
+ installed copy of Net-SNMP.
+
+ Note: To include OpenSSL, see the net-snmp/README.win32 to compile
+ libsnmp with libeay32 and see that libeay.lib is in the
+ lib folder, or in the lib folder of the installed
+ Net-SNMP if using -NET-SNMP-PATH. For example,
+ c:\usr\lib
+
+ Note: 'nmake test' will automatically start and stop the
+ agent(snmpd) and trap receiver (snmptrapd) while testing the
+ SNMP module.
+
+
+ Win32 (Cygwin):
+
+ cd net-snmp\perl
+ perl Makefile.PL -NET-SNMP-IN-SOURCE=true
+ make
+ make test
+ make install
+
+ If you get an error saying your system can't compile, you are
+ probably missing the regex library. Install regex from
+ http://mirrors.sunsite.dk/cygwin/release/regex/regex-4.4-2-src.tar.bz2
+
+ Note: The source code should *not* be in a folder that contains a space. For
+ example, compiling in your 'My Documents' or your Desktop (usually
+ c:\Documents and Settings\xxxx\Desktop) is not supported.
+
+
+ Win32 (MinGW):
+
+ Note: As of February 25th, 2004, the MinGW build of Net-SNMP does not
+ compile the DLL version of libsnmp. Some modules will not function
+ correctly without a shared library / DLL. The OID module does not
+ appear to work at all without the DLL, and some parts of other
+ modules may not work. For example, sharing configurations between
+ modules which is why the SNMP conf test fails.
+
+ Note: The source code should *not* be in a folder that contains a space. For
+ example, compiling in your 'My Documents' or your Desktop (usually
+ c:\Documents and Settings\xxxx\Desktop) is not supported.
+
+ These directions are for MinGW 3.1.0 with MSYS 1.0.9 and ActiveState Perl.
+ Compiling the Perl modules using a MinGW built Perl environment has not
+ been tested.
+
+ Note: With ActiveState Perl (currently at 5.8.2 build 808) and
+ possibly other versions of Perl on Windows, if a Perl script
+ modifies a system environment variable and then calls a C
+ function, the C function will not see the new environment
+ variable. This problem can be seen with the failure of test
+ #3 in the SNMP conf test (perl/SNMP/t/conf.t). The change to
+ the SNMPCONFPATH env variable is not seen by the calls to the
+ C SNMP module.
+
+ The main Net-SNMP package must be compiled with the regex library.
+ See Net-SNMP README.win32 for compiling with MinGW.
+
+ The following additional software is required:
+
+ dmake:
+ http://www.cpan.org/authors/id/GSAR/dmake-4.1pl1-win32.zip
+
+ ExtUtils-FakeConfig:
+ http://search.cpan.org/~mbarbon/ExtUtils-FakeConfig-0.05/
+
+ Note: A PPM package is available from ActiveState for
+ ExtUtils-FakeConfig, but it does not include the
+ make_implib.pl script. Downloading from CPAN is
+ recommended.
+
+ Installing DMAKE and ExtUtils-FakeConfig:
+ -----------------------------------------
+
+ 1. Install DMAKE as described in the README.NOW contained in the DMAKE .ZIP
+ file ensuring the DMAKE program can be found in the system path.
+
+ 2. Extract ExtUtils-FakeConfig-0.05.zip to a temporary folder.
+
+ 3. Add the MinGW bin folder to your system path.
+
+ 4. Open a Windows command prompt (cmd) and cd into
+ ExtUtils-FakeConfig-0.05 and typet he following to build and
+ install the ExtUtils-FakeConfig module:
+
+ perl Makefile.PL
+ dmake
+ dmake install
+
+ 5. A Perl import library needs to be created using the ExtUtils-FakeConfig
+ make_implib.pl script.
+
+ For ActiveState Perl 5.6.x installed to c:\Perl, type the
+ following on one line:
+
+ perl script/make_implib.pl --output-dir=C:/Perl/lib/CORE
+ --output-lib=libperl56.a --target=mingw c:/Perl/bin/Perl56.dll
+
+ For ActiveState Perl 5.8.x installed to c:\Perl, type the
+ following on one line:
+
+ perl script/make_implib.pl --output-dir=C:/Perl/lib/CORE
+ --output-lib=libperl58.a --target=mingw c:/Perl/bin/Perl58.dll
+
+
+Building the Perl module:
+-------------------------
+
+ 1. Complete the section titled 'Installing DMAKE and ExtUtils-FakeConfig'
+
+ 2. Open an MSYS shell and cd into the net-snmp/Perl folder and type the
+ following on one line:
+
+ perl -MConfig_m Makefile.PL -NET-SNMP-IN-SOURCE=true DEFINE=-DMINGW_PERL
+
+ 3. Open a Windows command prompt (cmd) and cd into the net-snmp/perl folder
+ and type:
+
+ dmake
+ dmake test
+ dmake install
+
+ Note: 'dmake test' will automatically start and stop the agent(snmpd) and
+ trap receiver (snmptrapd) while testing the SNMP module.
+
+ 4. Remove the MinGW bin folder to your system path if it was not already in
+ your path for step 3 of 'Installing DMAKE and ExtUtils-FakeConfig'.
+
+
+ Operational Description:
+
+ The basic operations of the SNMP protocol are provided by this module
+ through an object oriented interface for modularity and ease of use.
+ The primary class is SNMP::Session which encapsulates the persistent
+ aspects of a connection between the management application and the
+ managed agent. Internally the class is implemented as a blessed hash
+ reference. This class supplies 'get', 'getnext', 'set', 'fget', and
+ 'fgetnext' and other method calls. The methods take a variety of input
+ argument formats and support both synchronous and asynchronous
+ operation through a polymorphic API (i.e., method behaviour varies
+ dependent on args passed - see below).
+
+ A description of the fields which can be specified when an
+ SNMP::Session object is created follows:
+
+ SNMP::Session
+ public:
+ DestHost - default 'localhost', hostname or ip addr of SNMP agent
+ Community - default 'public', SNMP community string (used for both R/W)
+ Version - default '1', [2 (same as 2c), 2c, 3]
+ RemotePort - default '161', allow remote UDP port to be overridden
+ Timeout - default '1000000', micro-seconds before retry
+ Retries - default '5', retries before failure
+ RetryNoSuch - default '0', if enabled NOSUCH errors in 'get' pdus will
+ be repaired, removing the varbind in error, and resent -
+ undef will be returned for all NOSUCH varbinds, when set
+ to '0' this feature is disabled and the entire get request
+ will fail on any NOSUCH error (applies to v1 only)
+ SecName - default 'initial', security name (v3)
+ SecLevel - default 'noAuthNoPriv', security level [noAuthNoPriv,
+ authNoPriv, authPriv] (v3)
+ SecEngineId - default <none>, security engineID, will be probed if not
+ supplied (v3)
+ ContextEngineId - default <SecEngineId>, context engineID, will be
+ probed if not supplied (v3)
+ Context - default '', context name (v3)
+ AuthProto - default 'MD5', authentication protocol [MD5, SHA] (v3)
+ AuthPass - default <none>, authentication passphrase
+ PrivProto - default 'DES', privacy protocol [DES] (v3)
+ PrivPass - default <none>, privacy passphrase (v3)
+ VarFormats - default 'undef', used by 'fget[next]', holds an hash
+ reference of output value formatters, (e.g., {<obj> =>
+ <sub-ref>, ... }, <obj> must match the <obj> and format
+ used in the get operation. A special <obj>, '*', may be
+ used to apply all <obj>s, the supplied sub is called to
+ translate the value to a new format. The sub is called
+ passing the Varbind as the arg
+ TypeFormats - default 'undef', used by 'fget[next]', holds an hash
+ reference of output value formatters, (e.g., {<type> =>
+ <sub-ref>, ... }, the supplied sub is called to translate
+ the value to a new format, unless a VarFormat mathces first
+ (e.g., $session->{TypeFormats}{INTEGER} = \&mapEnum();
+ although this can be done more efficiently by enabling
+ $SNMP::use_enums or session creation param 'UseEnums')
+ UseLongNames - defaults to the value of SNMP::use_long_names at time
+ of session creation. set to non-zero to have <tags>
+ for 'getnext' methods generated preferring longer Mib name
+ convention (e.g., system.sysDescr vs just sysDescr)
+ UseSprintValue - defaults to the value of SNMP::use_sprint_value at time
+ of session creation. set to non-zero to have return values
+ for 'get' and 'getnext' methods formatted with the libraries
+ sprint_value function. This will result in certain data types
+ being returned in non-canonical format Note: values returned
+ with this option set may not be appropriate for 'set' operations
+ (see discussion of value formats in <vars> description section)
+ UseEnums - defaults to the value of SNMP::use_enums at time of session
+ creation. set to non-zero to have integer return values
+ converted to enumeration identifiers if possible, these values
+ will also be acceptable when supplied to 'set' operations
+ UseNumeric - defaults to the value of SNMP::use_numeric at time of session
+ creation. set to non-zero to have <tags> returned by the 'get'
+ methods untranslated (i.e. dotted-decimal). Setting the
+ UseLongNames value for the session is highly recommended.
+ BestGuess - defaults to the value of SNMP::best_guess at time of session
+ creation. this setting controls how <tags> are parsed. setting
+ to 0 causes a regular lookup. setting to 1 causes a regular
+ expression match (defined as -Ib in snmpcmd) and setting to 2
+ causes a random access lookup (defined as -IR in snmpcmd).
+ ErrorStr - read-only, holds the error message assoc. w/ last request
+ ErrorNum - read-only, holds the snmp_err or status of last request
+ ErrorInd - read-only, holds the snmp_err_index when appropriate
+
+ private:
+ DestAddr - internal field used to hold the translated DestHost field
+ SessPtr - internal field used to cache a created session structure
+
+ methods:
+ new(<fields>) - Constructs a new SNMP::Session object. The fields are
+ passed to the constructor as a hash list
+ (e.g., $session = new SNMP::Session(DestHost => 'foo',
+ Community => 'private');), returns an object reference
+ or undef in case of error.
+ update(<fields>)- Updates the SNMP::Session object with the values fields
+ passed in as a hash list (similar to new(<fields>))
+ (WARNING! not fully implemented)
+ get(<vars>[,<callback>])
+ - do SNMP GET, multiple <vars> formats accepted.
+ for synchronous operation <vars> will be updated
+ with value(s) and type(s) and will also return
+ retrieved value(s). If <callback> supplied method
+ will operate asynchronously
+ fget(<vars>[,<callback>])
+ - do SNMP GET like 'get' and format the values according
+ the handlers specified in $sess->{VarFormats} and
+ $sess->{TypeFormats}. Async *not supported*
+ getnext(<vars>[,<callback>])
+ - do SNMP GETNEXT, multiple <vars> formats accepted,
+ returns retrieved value(s), <vars> passed as arguments are
+ updated to indicate next lexicographical <obj>,<iid>,<val>,
+ and <type> Note: simple string <vars>,(e.g., 'sysDescr.0')
+ form is not updated. If <callback> supplied method
+ will operate asynchronously
+ fgetnext(<vars>[,<callback>])
+ - do SNMP GETNEXT like getnext and format the values according
+ the handlers specified in $sess->{VarFormats} and
+ $sess->{TypeFormats}. Async *not supported*
+ set(<vars>[,<callback>])
+ - do SNMP SET, multiple <vars> formats accepted.
+ the value field in all <vars> formats must be in a canonical
+ format (i.e., well known format) to ensure unambiguous
+ translation to SNMP MIB data value (see discussion of
+ canonical value format <vars> description section),
+ returns true on success or undef on error. If <callback>
+ supplied method will operate asynchronously
+ getbulk(<non-repeaters>, <max-repeaters>, <vars> [, <callback>])
+ - do an SNMP GETBULK, from the list of Varbinds, the single
+ next lexico instance is fetched for the first n Varbinds
+ as defined by <non-repeaters>. For remaining Varbinds,
+ the m lexico instances are retrieved each of the remaining
+ Varbinds, where m is <max-repeaters>.
+ bulkwalk(<non-repeaters>, <max-repeaters>, <vars> [, <callback>])
+ - do an "SNMP bulkwalk" on the given variables. Bulkwalk is
+ implemented by sending an SNMP GETBULK request to fetch the
+ variables. Objects are copied to the return list until the
+ sub-tree is exited. If the request is not completed at the
+ end of a packet, a new request is created, starting where
+ the previous packet left off. This implementation is able
+ to handle multiple repeated vars, as well as non-repeaters.
+ Returns a list (or, in scalar context, a reference to a
+ list) of arrays of VarBinds. The VarBinds consist of the
+ responses for each requested variable. bulkwalk() leaves
+ the original Varbinds list intact to facilitate querying
+ of multiple devices.
+
+ SNMP::TrapSession - supports all applicable fields from SNMP::Session
+ (see above)
+ methods:
+ new(<fields>) - Constructs a new SNMP::TrapSession object. The fields are
+ passed to the constructor as a hash list
+ (e.g., $trapsess = new SNMP::Session(DestHost => 'foo',
+ Community => 'private');), returns an object reference
+ or undef in case of error.
+ trap(enterprise, agent, generic, specific, uptime, <vars>)
+ $sess->trap(enterprise=>'.1.3.6.1.4.1.2021', # or 'ucdavis' [default]
+ agent => '127.0.0.1', # or 'localhost',[dflt 1st intf on host]
+ generic => specific, # can be omitted if 'specific' supplied
+ specific => 5, # can be omitted if 'generic' supplied
+ uptime => 1234, # dflt to localhost uptime (0 on win32)
+ [[ifIndex, 1, 1],[sysLocation, 0, "here"]]); # optional vars
+ # always last
+ or v2 format
+ trap(oid, uptime, <vars>)
+ $sess->trap(oid => 'snmpRisingAlarm',
+ uptime => 1234,
+ [[ifIndex, 1, 1],[sysLocation, 0, "here"]]); # optional vars
+ # always last
+
+
+ Acceptable variable formats:
+ <vars> may be one of the following forms:
+
+ SNMP::VarList: - represents an array of MIB objects to get or set,
+ implemented as a blessed reference to an array of
+ SNMP::Varbinds, (e.g., [<varbind1>, <varbind2>, ...])
+
+ SNMP::Varbind: - represents a single MIB object to get or set, implemented as
+ a blessed reference to a 4 element array;
+ [<obj>, <iid>, <val>, <type>].
+ <obj> - one of the following forms:
+ 1) leaf identifier (e.g., 'sysDescr') assumed to be
+ unique for practical purposes
+ 2) fully qualified identifier (e.g.,
+ '.iso.org.dod.internet.mgmt.mib-2.system.sysDescr')
+ 3) fully qualified, dotted-decimal, numeric OID (e.g.,
+ '.1.3.6.1.2.1.1.1')
+ <iid> - the dotted-decimal, instance identifier. for
+ scalar MIB objects use '0'
+ <val> - the SNMP data value retrieved from or being set
+ to the agents MIB. for (f)get(next) operations
+ <val> may have a variety of formats as determined by
+ session and package settings. However for set
+ operations the <val> format must be canonical to
+ ensure unambiguous translation. The canonical forms
+ are as follows:
+ OBJECTID => dotted-decimal (e.g., .1.3.6.1.2.1.1.1)
+ OCTETSTR => perl scalar containing octets,
+ INTEGER => decimal signed integer (or enum),
+ NETADDR => dotted-decimal,
+ IPADDR => dotted-decimal,
+ COUNTER => decimal unsigned integer,
+ COUNTER64 => decimal unsigned integer,
+ GAUGE, => decimal unsigned integer,
+ UINTEGER, => decimal unsigned integer,
+ TICKS, => decimal unsigned integer,
+ OPAQUE => perl scalar containing octets,
+ NULL, => perl scalar containing nothing,
+
+
+ <type> - SNMP data type (see list above), this field is
+ populated by 'get' and 'getnext' operations. In
+ some cases the programmer needs to populate this
+ field when passing to a 'set' operation. this
+ field need not be supplied when the attribute
+ indicated by <tag> is already described by loaded
+ Mib modules. for 'set's, if a numeric OID is used
+ and the object is not currently in the loaded Mib,
+ the <type> field must be supplied
+
+ simple string - light weight form of <var> used to 'set' or 'get' a
+ single attribute without constructing an SNMP::Varbind.
+ stored in a perl scalar, has the form '<tag>.<iid>',
+ (e.g., 'sysDescr.0'). for 'set' operations the value
+ is passed as a second arg. Note: This argument form is
+ not updated in get[next] operations as are the other forms.
+
+ Acceptable callback formats:
+ <callback> may be one of the following forms:
+
+ without arguments:
+ \&subname
+ sub { ... }
+ or with arguments:
+ [ \&subname, $arg1, ... ]
+ [ sub { ... }, $arg1, ... ]
+ [ "method", $obj, $arg1, ... ]
+
+ callback will be called when response is received or timeout
+ occurs. the last argument passed to callback will be a
+ SNMP::VarList reference. In case of timeout the last argument
+ will be undef.
+
+ SNMP package variables and functions:
+
+ $SNMP::VERSION - the current version specifier (e.g., 3.1.0)
+
+ $SNMP::auto_init_mib - default '1', set to 0 to disable automatic reading
+ of the MIB upon session creation. set to non-zero
+ to call initMib at session creation which will result
+ in MIB loading according to Net-SNMP env. variables
+ (see man mib_api)
+
+ $SNMP::verbose - default '0', controls warning/info output of
+ SNMP module, 0 => no output, 1 => enables warning/info
+ output from SNMP module itself (is also controlled
+ by SNMP::debugging - see below)
+
+ $SNMP::use_long_names - default '0', set to non-zero to enable the use of
+ longer Mib identifiers. see translateObj. will also
+ influence the formatting of <tag> in varbinds returned
+ from 'getnext' operations. Can be set on a per session
+ basis (UseLongNames)
+
+ $SNMP::use_sprint_value - default '0', set to non-zero to enable formatting of
+ response values using the snmp libraries sprint_value
+ function. can also be set on a per session basis (see
+ UseSprintValue) Note: returned values may not be
+ suitable for 'set' operations
+
+ $SNMP::use_enums - default '0',set non-zero to return values as enums and
+ allow sets using enums where appropriate. integer data
+ will still be accepted for set operations. can also be
+ set on a per session basis (see UseEnums)
+
+ $SNMP::use_numeric - default '0', set to non-zero to return tags as numeric
+ OID's, instead of translating them. Also setting
+ $SNMP::use_long_names to non-zero is highly recommended.
+
+ $SNMP::best_guess - default '0'. this setting controls how <tags> are
+ parsed. setting to 0 causes a regular lookup. setting
+ to 1 causes a regular expression match (defined as -Ib
+ in snmpcmd) and setting to 2 causes a random access
+ lookup (defined as -IR in snmpcmd). can also be set
+ on a per session basis (see BestGuess)
+
+ $SNMP::save_descriptions - default '0',set non-zero to have mib parser save
+ attribute descriptions. must be set prior to mib
+ initialization
+
+ $SNMP::debugging - default '0', controls debugging output level
+ within SNMP module and libsnmp
+ 1 => enables 'SNMP::verbose' (see above)
+ 2 => level 1 plus snmp_set_do_debugging(1),
+ 3 => level 2 plus snmp_set_dump_packet(1)
+
+ $SNMP::dump_packet - default '0', set [non-]zero to independently set
+ snmp_set_dump_packet()
+
+ %SNMP::MIB - a tied hash to access parsed MIB information. After
+ the MIB has been loaded this hash allows access to
+ to the parsed in MIB meta-data(the structure of the
+ MIB (i.e., schema)). The hash returns blessed
+ references to SNMP::MIB::NODE objects which represent
+ a single MIB attribute. The nodes can be fetched with
+ multiple 'key' formats - the leaf name (e.g.,sysDescr)
+ or fully/partially qualified name (e.g.,
+ system.sysDescr) or fully qualified numeric OID. The
+ returned node object supports the following fields:
+
+ objectID - dotted decimal fully qualified OID
+ label - leaf textual identifier (e.g., 'sysDescr')
+ subID - leaf numeric OID component of objectID (e.g., '1')
+ moduleID - textual identifier for module (e.g., 'RFC1213-MIB')
+ parent - parent node
+ children - array reference of children nodes
+ nextNode - next lexico node (BUG!does not return in lexico order)
+ type - returns application type (see getType for values)
+ access - returns ACCESS (ReadOnly, ReadWrite, WriteOnly,
+ NoAccess, Notify, Create)
+ status - returns STATUS (Mandatory, Optional, Obsolete,
+ Deprecated, Current)
+ syntax - returns 'textualConvention' if defined else 'type'
+ textualConvention - returns TEXTUAL-CONVENTION
+ units - returns UNITS
+ hint - returns HINT
+ enums - returns hash ref {tag => num, ...}
+ ranges - returns array ref of hash ref [{low=>num, high=>num}]
+ defaultValue - returns default value
+ description - returns DESCRIPTION ($SNMP::save_descriptions must
+ be set prior to MIB initialization/parsing)
+
+
+ &SNMP::setMib(<file>) - allows dynamic parsing of the mib and explicit
+ specification of mib file independent of environment
+ variables. called with no args acts like initMib,
+ loading MIBs indicated by environment variables (see
+ Net-SNMP mib_api docs). passing non-zero second arg
+ forces previous mib to be freed and replaced
+ (Note: second arg not working since freeing previous
+ Mib is more involved than before).
+
+ &SNMP::initMib() - calls library netsnmp_init_mib function if MIB not
+ already loaded - does nothing if MIB already loaded.
+ Will parse directories and load modules according to
+ environment variables described in Net-SNMP
+ documentations.
+ (see man mib_api, MIBDIRS, MIBS, MIBFILE(S), etc.)
+
+ &SNMP::addMibDirs(<dir>,...) - calls library add_mibdir for each directory
+ supplied. will cause directory(s) to be added to
+ internal list and made available for searching in
+ subsequent loadModules calls
+
+ &SNMP::addMibFiles(<file>,...) - calls library read_mib function. The file(s)
+ supplied will be read and all Mib module definitions
+ contained therein will be added to internal mib tree
+ structure
+
+ &SNMP::loadModules(<mod>,...) - calls library read_module function. The
+ module(s) supplied will be searched for in the
+ current mibdirs and and added to internal mib tree
+ structure. Passing special <mod>, 'ALL', will cause
+ all known modules to be loaded.
+
+ &SNMP::unloadModules(<mod>,...) - *Not Implemented*
+
+ &SNMP::translateObj(<var>[,arg,[arg]]) - will convert a text obj tag to an
+ OID and vice-versa. Any iid suffix is retained
+ numerically. Default behaviour when converting a
+ numeric OID to text form is to return leaf identifier
+ only (e.g.,'sysDescr') but when $SNMP::use_long_names
+ is non-zero or a non-zero second arg is supplied it
+ will return a longer textual identifier. An optional
+ third argument of non-zero will cause the module name
+ to be prepended to the text name (e.g.
+ 'SNMPv2-MIB::sysDescr'). When converting a text obj,
+ the $SNMP::best_guess option is used. If no Mib is
+ loaded when called and $SNMP::auto_init_mib is enabled
+ then the Mib will be loaded. Will return 'undef' upon
+ failure.
+
+ &SNMP::getType(<var>) - return SNMP data type for given textual identifier
+ OBJECTID, OCTETSTR, INTEGER, NETADDR, IPADDR, COUNTER
+ GAUGE, TIMETICKS, OPAQUE, or undef
+
+ &SNMP::mapEnum(<var>) - converts integer value to enumeration tag defined
+ in Mib or converts tag to integer depending on
+ input. the function will return the corresponding
+ integer value *or* tag for a given MIB attribute
+ and value. The function will sense which direction
+ to perform the conversion. Various arg formats are
+ supported
+ $val = SNMP::mapEnum($varbind);
+ # where $varbind is SNMP::Varbind or equiv
+ # note: $varbind will be updated
+ $val = SNMP::mapEnum('ipForwarding', 'forwarding');
+ $val = SNMP::mapEnum('ipForwarding', 1);
+
+ &SNMP::MainLoop([<timeout>, [<callback>]])
+ - to be used with async SNMP::Session
+ calls. MainLoop must be called after initial async calls
+ so return packets from the agent will not be processed.
+ If no args supplied this function enters an infinite loop
+ so program must be exited in a callback or externally
+ interrupted. If <timeout
+
+ &SNMP::finish()
+ - This function, when called from an SNMP::MainLoop()
+ callback function, will cause the current SNMP::MainLoop
+ to return after the callback is completed. finish() can
+ be used to terminate an otherwise-infinite MainLoop. A
+ new MainLoop() instance can then be started to handle
+ further requests.
+
+ Exported SNMP utility functions
+ &snmp_get() - takes args of SNMP::Session::new followed by those of
+ SNMP::Session::get
+
+ &snmp_getnext() - takes args of SNMP::Session::new followed by those of
+ SNMP::Session::getnext
+
+ &snmp_set() - takes args of SNMP::Session::new followed by those of
+ SNMP::Session::set
+
+ &snmp_trap() - takes args of SNMP::TrapSession::new followed by those of
+ SNMP::TrapSession::trap
+
+ Note: utility functions do not support async operation yet.
+
+Trouble Shooting:
+
+ If problems occur there are number areas to look at to narrow down the
+ possibilities.
+
+ The first step should be to test the Net-SNMP installation
+ independently from the Perl5 SNMP interface.
+
+ Try running the apps from the Net-SNMP distribution.
+
+ Make sure your agent (snmpd) is running and properly configured with
+ read-write access for the community you are using.
+
+ Ensure that your MIBs are installed and environment variables are set
+ appropriately (see man mib_api)
+
+ Be sure to ensure headers and libraries from old CMU installations are
+ not being used by mistake (see -NET-SNMP-PATH).
+
+ If the problem occurs during compilation/linking check that the snmp
+ library being linked is actually the Net-SNMP library (there have been
+ name conflicts with existing snmp libs).
+
+ Also check that the header files are correct and up to date.
+
+ Sometimes compiling the Net-SNMP library with
+ 'position-independent-code' enabled is required (HPUX specifically).
+
+ If you cannot resolve the problem you can post to
+ comp.lang.perl.modules or email net-snmp-users@lists.sourceforge.net.
+
+ please give sufficient information to analyze the problem (OS type,
+ versions for OS/Perl/net-SNMP/compiler, complete error output, etc.)
+
+Acknowledgments:
+
+ Many thanks to all those who supplied patches, suggestions and
+ feedback.
+
+ Joe Marzot (the original author)
+ Wes Hardaker and the net-snmp-coders
+ Dave Perkins
+ Marcel Wiget
+ David Blackburn
+ John Stofell
+ Gary Hayward
+ Claire Harrison
+ Achim Bohnet
+ Doug Kingston
+ Jacques Vidrine
+ Carl Jacobsen
+ Wayne Marquette
+ Scott Schumate
+ Michael Slifcak
+ Srivathsan Srinivasagopalan
+ Bill Fenner
+ Jef Peeraer
+ Daniel Hagerty
+ Karl "Rat" Schilke and Electric Lightwave, Inc.
+ Perl5 Porters
+ Alex Burger
+
+ Apologies to any/all who's patch/feature/request was not mentioned or
+ included - most likely it was lost when paying work intruded on my
+ fun. Please try again if you do not see a desired feature. This may
+ actually turn out to be a decent package with such excellent help and
+ the fact that I have more time to work on it than in the past.
+
+Copyright:
+
+ [See the COPYING file for the copyright license of Net-SNMP]
+
+ Copyright (c) 1995-2000 G. S. Marzot. All rights reserved.
+ This program is free software; you can redistribute it and/or
+ modify it under the same terms as Perl itself.
+
+ Copyright (c) 2001-2002 Networks Associates Technology, Inc. All
+ Rights Reserved. This program is free software; you can
+ redistribute it and/or modify it under the same terms as Perl
+ itself.
+
+ Copyright (c) 2003-2006 SPARTA, Inc. All Rights Reserved. This
+ program is free software; you can redistribute it and/or modify
+ it under the same terms as Perl itself.
diff --git a/perl/SNMP/SNMP.pm b/perl/SNMP/SNMP.pm
new file mode 100644
index 0000000..ffc5a2f
--- /dev/null
+++ b/perl/SNMP/SNMP.pm
@@ -0,0 +1,2680 @@
+# SNMP.pm -- Perl 5 interface to the Net-SNMP toolkit
+#
+# written by G. S. Marzot (marz@users.sourceforge.net)
+#
+# Copyright (c) 1995-2006 G. S. Marzot. All rights reserved.
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+
+package SNMP;
+$VERSION = '5.0702'; # current release version number
+
+use strict;
+use warnings;
+
+require Exporter;
+require DynaLoader;
+require AutoLoader;
+
+use NetSNMP::default_store (':all');
+
+@SNMP::ISA = qw(Exporter AutoLoader DynaLoader);
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+@SNMP::EXPORT = qw(
+ RECEIVED_MESSAGE
+ SNMPERR_BAD_ADDRESS
+ SNMPERR_BAD_LOCPORT
+ SNMPERR_BAD_SESSION
+ SNMPERR_GENERR
+ SNMPERR_TOO_LONG
+ SNMP_DEFAULT_ADDRESS
+ SNMP_DEFAULT_COMMUNITY_LEN
+ SNMP_DEFAULT_ENTERPRISE_LENGTH
+ SNMP_DEFAULT_ERRINDEX
+ SNMP_DEFAULT_ERRSTAT
+ SNMP_DEFAULT_PEERNAME
+ SNMP_DEFAULT_REMPORT
+ SNMP_DEFAULT_REQID
+ SNMP_DEFAULT_RETRIES
+ SNMP_DEFAULT_TIME
+ SNMP_DEFAULT_TIMEOUT
+ SNMP_DEFAULT_VERSION
+ TIMED_OUT
+ snmp_get
+ snmp_getnext
+ snmp_set
+ snmp_trap
+ SNMP_API_TRADITIONAL
+ SNMP_API_SINGLE
+);
+
+sub AUTOLOAD {
+ no strict;
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function. If a constant is not found then control is passed
+ # to the AUTOLOAD in AutoLoader.
+ my($val,$pack,$file,$line);
+ my $constname;
+ ($constname = $AUTOLOAD) =~ s/.*:://;
+ # croak "&$module::constant not defined" if $constname eq 'constant';
+ ($!, $val) = constant($constname, @_ ? $_[0] : 0);
+ if ($! != 0) {
+ if ($! =~ /Invalid/) {
+ $AutoLoader::AUTOLOAD = $AUTOLOAD;
+ goto &AutoLoader::AUTOLOAD;
+ }
+ else {
+ ($pack,$file,$line) = caller;
+ die "Your vendor has not defined SNMP macro $constname, used at $file line $line.
+";
+ }
+ }
+ eval "sub $AUTOLOAD { $val }";
+ goto &$AUTOLOAD;
+}
+
+bootstrap SNMP;
+
+# Preloaded methods go here.
+
+# Package variables
+tie $SNMP::debugging, 'SNMP::DEBUGGING';
+tie $SNMP::debug_internals, 'SNMP::DEBUG_INTERNALS';
+tie $SNMP::dump_packet, 'SNMP::DUMP_PACKET';
+tie %SNMP::MIB, 'SNMP::MIB';
+tie $SNMP::save_descriptions, 'SNMP::MIB::SAVE_DESCR';
+tie $SNMP::replace_newer, 'SNMP::MIB::REPLACE_NEWER';
+tie $SNMP::mib_options, 'SNMP::MIB::MIB_OPTIONS';
+
+%SNMP::V3_SEC_LEVEL_MAP = (noAuthNoPriv => 1, authNoPriv => 2, authPriv =>3);
+
+use vars qw(
+ $auto_init_mib $use_long_names $use_sprint_value $use_enums
+ $use_numeric %MIB $verbose $debugging $dump_packet $save_descriptions
+ $best_guess $non_increasing $replace_newer %session_params
+ $debug_internals $mib_options
+);
+
+$auto_init_mib = 1; # enable automatic MIB loading at session creation time
+$use_long_names = 0; # non-zero to prefer longer mib textual identifiers rather
+ # than just leaf indentifiers (see translateObj)
+ # may also be set on a per session basis(see UseLongNames)
+$use_sprint_value = 0; # non-zero to enable formatting of response values
+ # using the snmp libraries "snprint_value"
+ # may also be set on a per session basis(see UseSprintValue)
+ # note: returned values not suitable for 'set' operations
+$use_enums = 0; # non-zero to return integers as enums and allow sets
+ # using enums where appropriate - integer data will
+ # still be accepted for set operations
+ # may also be set on a per session basis (see UseEnums)
+$use_numeric = 0; # non-zero to return object tags as numeric OID's instead
+ # of converting to textual representations. use_long_names,
+ # if non-zero, returns the entire OID, otherwise, return just
+ # the label portion. use_long_names is also set if the
+ # use_numeric variable is set.
+%MIB = (); # tied hash to access libraries internal mib tree structure
+ # parsed in from mib files
+$verbose = 0; # controls warning/info output of SNMP module,
+ # 0 => no output, 1 => enables warning and info
+ # output from SNMP module itself (is also controlled
+ # by SNMP::debugging)
+$debugging = 0; # non-zero to globally enable libsnmp do_debugging output
+ # set to >= 2 to enabling packet dumping (see below)
+$dump_packet = 0; # non-zero to globally enable libsnmp dump_packet output.
+ # is also enabled when $debugging >= 2
+$save_descriptions = 0; #tied scalar to control saving descriptions during
+ # mib parsing - must be set prior to mib loading
+$best_guess = 0; # determine whether or not to enable best-guess regular
+ # expression object name translation. 1 = Regex (-Ib),
+ # 2 = random (-IR)
+$non_increasing = 0; # stop polling with an "OID not increasing"-error
+ # when an OID does not increases in bulkwalk.
+$replace_newer = 0; # determine whether or not to tell the parser to replace
+ # older MIB modules with newer ones when loading MIBs.
+ # WARNING: This can cause an incorrect hierarchy.
+
+sub register_debug_tokens {
+ my $tokens = shift;
+
+ SNMP::_register_debug_tokens($tokens);
+}
+
+sub getenv {
+ my $name = shift;
+
+ return SNMP::_getenv($name);
+}
+
+sub setenv {
+ my $envname = shift;
+ my $envval = shift;
+ my $overwrite = shift;
+
+ return SNMP::_setenv($envname, $envval, $overwrite);
+}
+
+sub setMib {
+# loads mib from file name provided
+# setting second arg to true causes currently loaded mib to be replaced
+# otherwise mib file will be added to existing loaded mib database
+# NOTE: now deprecated in favor of addMibFiles and new module based funcs
+ my $file = shift;
+ my $force = shift || '0';
+ return 0 if $file and not (-r $file);
+ SNMP::_read_mib($file,$force);
+}
+
+sub initMib {
+# equivalent to calling the snmp library init_mib if Mib is NULL
+# if Mib is already loaded this function does nothing
+# Pass a zero valued argument to get minimal mib tree initialization
+# If non zero argument or no argument then full mib initialization
+
+ SNMP::init_snmp("perl");
+ return;
+
+
+ if (defined $_[0] and $_[0] == 0) {
+ SNMP::_init_mib_internals();
+ } else {
+ SNMP::_read_mib("");
+ }
+}
+
+sub addMibDirs {
+# adds directories to search path when a module is requested to be loaded
+ SNMP::init_snmp("perl");
+ foreach (@_) {
+ SNMP::_add_mib_dir($_) or return undef;
+ }
+ return 1;
+}
+
+sub addMibFiles {
+# adds mib definitions to currently loaded mib database from
+# file(s) supplied
+ SNMP::init_snmp("perl");
+ foreach (@_) {
+ SNMP::_read_mib($_) or return undef;
+ }
+ return 1;
+}
+
+sub loadModules {
+# adds mib module definitions to currently loaded mib database.
+# Modules will be searched from previously defined mib search dirs
+# Passing and arg of 'ALL' will cause all known modules to be loaded
+ SNMP::init_snmp("perl");
+ foreach (@_) {
+ SNMP::_read_module($_) or return undef;
+ }
+ return 1;
+}
+
+sub unloadModules {
+# causes modules to be unloaded from mib database
+# Passing and arg of 'ALL' will cause all known modules to be unloaded
+ warn("SNMP::unloadModules not implemented! (yet)");
+}
+
+sub translateObj {
+# Translate object identifier(tag or numeric) into alternate representation
+# (i.e., sysDescr => '.1.3.6.1.2.1.1.1' and '.1.3.6.1.2.1.1.1' => sysDescr)
+# when $SNMP::use_long_names or second arg is non-zero the translation will
+# return longer textual identifiers (e.g., system.sysDescr). An optional
+# third argument of non-zero will cause the module name to be prepended
+# to the text name (e.g. 'SNMPv2-MIB::sysDescr'). If no Mib is loaded
+# when called and $SNMP::auto_init_mib is enabled then the Mib will be
+# loaded. Will return 'undef' upon failure.
+ SNMP::init_snmp("perl");
+ my $obj = shift;
+ my $temp = shift;
+ my $include_module_name = shift || "0";
+ my $long_names = $temp || $SNMP::use_long_names;
+
+ return undef if not defined $obj;
+ my $res;
+ if ($obj =~ /^\.?(\d+\.)*\d+$/) {
+ $res = SNMP::_translate_obj($obj,1,$long_names,$SNMP::auto_init_mib,0,$include_module_name);
+ } elsif ($obj =~ /(\.\d+)*$/ && $SNMP::best_guess == 0) {
+ $res = SNMP::_translate_obj($`,0,$long_names,$SNMP::auto_init_mib,0,$include_module_name);
+ $res .= $& if defined $res and defined $&;
+ } elsif ($SNMP::best_guess) {
+ $res = SNMP::_translate_obj($obj,0,$long_names,$SNMP::auto_init_mib,$SNMP::best_guess,$include_module_name);
+ }
+
+ return($res);
+}
+
+sub getType {
+# return SNMP data type for given textual identifier
+# OBJECTID, OCTETSTR, INTEGER, NETADDR, IPADDR, COUNTER
+# GAUGE, TIMETICKS, OPAQUE, or undef
+ my $tag = shift;
+ SNMP::_get_type($tag, $SNMP::best_guess);
+}
+
+sub mapEnum {
+# return the corresponding integer value *or* tag for a given MIB attribute
+# and value. The function will sense which direction to perform the conversion
+# various arg formats are supported
+# $val = SNMP::mapEnum($varbind); # note: will update $varbind
+# $val = SNMP::mapEnum('ipForwarding', 'forwarding');
+# $val = SNMP::mapEnum('ipForwarding', 1);
+#
+ my $var = shift;
+ my ($tag, $val, $update);
+ if (ref($var) =~ /ARRAY/ or ref($var) =~ /Varbind/) {
+ $tag = SNMP::Varbind::tag($var);
+ $val = SNMP::Varbind::val($var);
+ $update = 1;
+ } else {
+ $tag = $var;
+ $val = shift;
+ }
+ my $iflag = $val =~ /^\d+$/;
+ my $res = SNMP::_map_enum($tag, $val, $iflag, $SNMP::best_guess);
+ if ($update and defined $res) { SNMP::Varbind::val($var) = $res; }
+ return($res);
+}
+
+%session_params = (DestHost => 1,
+ Community => 1,
+ Version => 1,
+ Timeout => 1,
+ Retries => 1,
+ RemotePort => 1,
+ LocalPort => 1);
+
+sub strip_session_params {
+ my @params;
+ my @args;
+ my $param;
+ while ($param = shift) {
+ push(@params,$param, shift), next
+ if $session_params{$param};
+ push(@args,$param);
+ }
+ @_ = @args;
+ @params;
+}
+
+
+sub snmp_get {
+# procedural form of 'get' method. sometimes quicker to code
+# but is less efficient since the Session is created and destroyed
+# with each call. Takes all the parameters of both SNMP::Session::new and
+# SNMP::Session::get (*NOTE*: this api does not support async callbacks)
+
+ my @sess_params = &strip_session_params;
+ my $sess = new SNMP::Session(@sess_params);
+
+ $sess->get(@_);
+}
+
+sub snmp_getnext {
+# procedural form of 'getnext' method. sometimes quicker to code
+# but is less efficient since the Session is created and destroyed
+# with each call. Takes all the parameters of both SNMP::Session::new and
+# SNMP::Session::getnext (*NOTE*: this api does not support async callbacks)
+
+ my @sess_params = &strip_session_params;
+ my $sess = new SNMP::Session(@sess_params);
+
+ $sess->getnext(@_);
+}
+
+sub snmp_set {
+# procedural form of 'set' method. sometimes quicker to code
+# but is less efficient since the Session is created and destroyed
+# with each call. Takes all the parameters of both SNMP::Session::new and
+# SNMP::Session::set (*NOTE*: this api does not support async callbacks)
+
+ my @sess_params = &strip_session_params;
+ my $sess = new SNMP::Session(@sess_params);
+
+ $sess->set(@_);
+}
+
+sub snmp_trap {
+# procedural form of 'trap' method. sometimes quicker to code
+# but is less efficient since the Session is created and destroyed
+# with each call. Takes all the parameters of both SNMP::TrapSession::new and
+# SNMP::TrapSession::trap
+
+ my @sess_params = &strip_session_params;
+ my $sess = new SNMP::TrapSession(@sess_params);
+
+ $sess->trap(@_);
+}
+
+#---------------------------------------------------------------------
+# Preserves the ability to call MainLoop() with no args so we don't
+# break old code
+#
+# Alternately, MainLoop() could be called as an object method,
+# ( $sess->MainLoop() ) , so that $self winds up in @_. Then it would
+# be more like :
+# my $self = shift;
+# ....
+# SNMP::_main_loop(......, $self->{SessPtr});
+#---------------------------------------------------------------------
+sub MainLoop {
+ my $ss = shift if(&SNMP::_api_mode() == SNMP::SNMP_API_SINGLE());
+ my $time = shift;
+ my $callback = shift;
+ my $time_sec = ($time ? int $time : 0);
+ my $time_usec = ($time ? int(($time-$time_sec)*1000000) : 0);
+ SNMP::_main_loop($time_sec,$time_usec,$callback,(defined($ss) ? $ss->{SessPtr} : ()));
+}
+
+sub finish {
+ SNMP::_mainloop_finish();
+}
+
+sub reply_cb {
+ # callback function for async snmp calls
+ # when triggered, will do a SNMP read on the
+ # given fd
+ my $fd = shift;
+ SNMP::_read_on_fd($fd);
+}
+
+sub select_info {
+ # retrieves SNMP used fd's and timeout info
+ # calculates timeout in fractional seconds
+ # ( easy to use with select statement )
+ my($block, $to_sec, $to_usec, @fd_set)=SNMP::_get_select_info();
+ my $time_sec_dec = ($block? 0 : $to_sec + $to_usec * 1e-6);
+ #print "fd's for snmp -> ", @fd_set, "\n";
+ #print "block -> ", $block, "\n";
+ #print "timeout_sec -> ", $to_sec, "\n";
+ #print "timeout_usec -> ", $to_usec, "\n";
+ #print "timeout dec -> ", $time_sec_dec, "\n";
+ return ($time_sec_dec,@fd_set);
+}
+
+sub check_timeout {
+ # check to see if a snmp session
+ # timed out, and if so triggers
+ # the callback function
+ SNMP::_check_timeout();
+ # check to see when have to check again
+ my($block, $to_sec, $to_usec, @fd_set)=SNMP::_get_select_info();
+ my $time_sec_dec = ($block? 0 : $to_sec + $to_usec * 1e-6);
+ #print "fd's for snmp -> ", @fd_set, "\n";
+ #print "block -> ", $block, "\n";
+ #print "timeout_sec -> ", $to_sec, "\n";
+ #print "timeout_usec -> ", $to_usec, "\n";
+ #print "timeout dec -> ", $time_sec_dec, "\n";
+ return ($time_sec_dec);
+}
+
+sub _tie {
+# this is a little implementation hack so ActiveState can access pp_tie
+# thru perl code. All other environments allow the calling of pp_tie from
+# XS code but AS was not exporting it when PERL_OBJECT was used.
+#
+# short term solution was call this perl func which calls 'tie'
+#
+# longterm fix is to supply a patch which allows AS to export pp_tie in
+# such a way that it can be called from XS code. gsarathy says:
+# a patch to util.c is needed to provide access to PL_paddr
+# so it is possible to call PL_paddr[OP_TIE] as the compiler does
+ tie($_[0],$_[1],$_[2],$_[3]);
+}
+
+sub split_vars {
+ # This sub holds the regex that is used throughout this module
+ # to parse the base part of an OID from the IID.
+ # eg: portName.9.30 -> ['portName','9.30']
+ my $vars = shift;
+
+ # The regex was changed to this simple form by patch 722075 for some reason.
+ # Testing shows now (2/05) that it is not needed, and that the long expression
+ # works fine. AB
+ # my ($tag, $iid) = ($vars =~ /^(.*?)\.?(\d+)+$/);
+
+ # These following two are the same. Broken down for easier maintenance
+ # my ($tag, $iid) = ($vars =~ /^((?:\.\d+)+|(?:\w+(?:\-*\w+)+))\.?(.*)$/);
+ my ($tag, $iid) =
+ ($vars =~ /^( # Capture $1
+ # 1. either this 5.5.5.5
+ (?:\.\d+)+ # for grouping, won't increment $1
+ |
+ # 2. or asdf-asdf-asdf-asdf
+ (?: # grouping again
+ \w+ # needs some letters followed by
+ (?:\-*\w+)+ # zero or more dashes, one or more letters
+ )
+ )
+ \.? # optionally match a dot
+ (.*) # whatever is left in the string is our iid ($2)
+ $/x
+ );
+ return [$tag,$iid];
+}
+
+package SNMP::Session;
+
+sub new {
+ my $type = shift;
+ my $this = {};
+ my ($name, $aliases, $host_type, $len, $thisaddr);
+
+ SNMP::init_snmp("perl");
+
+ %$this = @_;
+
+ $this->{ErrorStr} = ''; # if methods return undef check for expln.
+ $this->{ErrorNum} = 0; # contains SNMP error return
+
+ $this->{Version} ||=
+ NetSNMP::default_store::netsnmp_ds_get_int(NetSNMP::default_store::NETSNMP_DS_LIBRARY_ID,
+ NetSNMP::default_store::NETSNMP_DS_LIB_SNMPVERSION) ||
+ SNMP::SNMP_DEFAULT_VERSION();
+
+ if ($this->{Version} eq 128) {
+ # special handling of the bogus v1 definition.
+ $this->{Version} = 1;
+ }
+
+ # allow override of local SNMP port
+ $this->{LocalPort} ||= 0;
+
+ # destination host defaults to localhost
+ $this->{DestHost} ||= 'localhost';
+
+ # community defaults to public
+ $this->{Community} ||= NetSNMP::default_store::netsnmp_ds_get_string(NetSNMP::default_store::NETSNMP_DS_LIBRARY_ID(),
+ NetSNMP::default_store::NETSNMP_DS_LIB_COMMUNITY()) || 'public';
+
+ # number of retries before giving up, defaults to SNMP_DEFAULT_RETRIES
+ $this->{Retries} = SNMP::SNMP_DEFAULT_RETRIES() unless defined($this->{Retries});
+
+ # timeout before retry, defaults to SNMP_DEFAULT_TIMEOUT
+ $this->{Timeout} = SNMP::SNMP_DEFAULT_TIMEOUT() unless defined($this->{Timeout});
+ # flag to enable fixing pdu and retrying with a NoSuch error
+ $this->{RetryNoSuch} ||= 0;
+
+ # backwards compatibility. Make host = host:port
+ if ($this->{RemotePort} && $this->{DestHost} !~ /:/) {
+ $this->{DestHost} = $this->{DestHost} . ":" . $this->{RemotePort};
+ }
+
+ if ($this->{DestHost} =~ /^(dtls|tls|ssh)/) {
+ # only works with version 3
+ $this->{Version} = 3;
+ }
+
+ if ($this->{Version} eq '1' or $this->{Version} eq '2'
+ or $this->{Version} eq '2c') {
+ $this->{SessPtr} = SNMP::_new_session($this->{Version},
+ $this->{Community},
+ $this->{DestHost},
+ $this->{LocalPort},
+ $this->{Retries},
+ $this->{Timeout},
+ );
+ } elsif ($this->{Version} eq '3' ) {
+ $this->{SecName} ||=
+ NetSNMP::default_store::netsnmp_ds_get_string(NetSNMP::default_store::NETSNMP_DS_LIBRARY_ID(),
+ NetSNMP::default_store::NETSNMP_DS_LIB_SECNAME()) ||
+ 'initial';
+ if (!$this->{SecLevel}) {
+ $this->{SecLevel} =
+ NetSNMP::default_store::netsnmp_ds_get_int(NetSNMP::default_store::NETSNMP_DS_LIBRARY_ID(),
+ NetSNMP::default_store::NETSNMP_DS_LIB_SECLEVEL()) ||
+ $SNMP::V3_SEC_LEVEL_MAP{'noAuthNoPriv'};
+ } elsif ($this->{SecLevel} !~ /^\d+$/) {
+ $this->{SecLevel} = $SNMP::V3_SEC_LEVEL_MAP{$this->{SecLevel}};
+ }
+ $this->{SecEngineId} ||= '';
+ $this->{ContextEngineId} ||= $this->{SecEngineId};
+ $this->{Context} ||=
+ NetSNMP::default_store::netsnmp_ds_get_string(NetSNMP::default_store::NETSNMP_DS_LIBRARY_ID(),
+ NetSNMP::default_store::NETSNMP_DS_LIB_CONTEXT()) || '';
+
+ if ($this->{DestHost} =~ /^(dtls|tls|ssh)/) {
+ # this is a tunneled protocol
+
+ $this->{'OurIdentity'} ||= '';
+ $this->{'TheirIdentity'} ||= '';
+ $this->{'TheirHostname'} ||= '';
+ $this->{'TrustCert'} ||= '';
+
+ $this->{'SecLevel'} = $SNMP::V3_SEC_LEVEL_MAP{'authPriv'};
+
+ $this->{SessPtr} =
+ SNMP::_new_tunneled_session($this->{Version},
+ $this->{DestHost},
+ $this->{Retries},
+ $this->{Timeout},
+ $this->{SecName},
+ $this->{SecLevel},
+ $this->{ContextEngineId},
+ $this->{Context},
+ $this->{'OurIdentity'},
+ $this->{'TheirIdentity'},
+ $this->{'TheirHostname'},
+ $this->{'TrustCert'},
+ );
+
+
+ } else {
+ # USM or some other internal security protocol
+
+ # USM specific parameters:
+ $this->{AuthProto} ||= 'DEFAULT'; # use the library's default
+ $this->{AuthPass} ||=
+ NetSNMP::default_store::netsnmp_ds_get_string(NetSNMP::default_store::NETSNMP_DS_LIBRARY_ID(),
+ NetSNMP::default_store::NETSNMP_DS_LIB_AUTHPASSPHRASE()) ||
+ NetSNMP::default_store::netsnmp_ds_get_string(NetSNMP::default_store::NETSNMP_DS_LIBRARY_ID(),
+ NetSNMP::default_store::NETSNMP_DS_LIB_PASSPHRASE()) || '';
+
+ $this->{AuthMasterKey} ||= '';
+ $this->{PrivMasterKey} ||= '';
+ $this->{AuthLocalizedKey} ||= '';
+ $this->{PrivLocalizedKey} ||= '';
+
+ $this->{PrivProto} ||= 'DEFAULT'; # use the library's default
+ $this->{PrivPass} ||=
+ NetSNMP::default_store::netsnmp_ds_get_string(NetSNMP::default_store::NETSNMP_DS_LIBRARY_ID(),
+ NetSNMP::default_store::NETSNMP_DS_LIB_PRIVPASSPHRASE()) ||
+ NetSNMP::default_store::netsnmp_ds_get_string(NetSNMP::default_store::NETSNMP_DS_LIBRARY_ID(),
+ NetSNMP::default_store::NETSNMP_DS_LIB_PASSPHRASE()) || '';
+ $this->{EngineBoots} = 0 if not defined $this->{EngineBoots};
+ $this->{EngineTime} = 0 if not defined $this->{EngineTime};
+
+ $this->{SessPtr} =
+ SNMP::_new_v3_session($this->{Version},
+ $this->{DestHost},
+ $this->{Retries},
+ $this->{Timeout},
+ $this->{SecName},
+ $this->{SecLevel},
+ $this->{SecEngineId},
+ $this->{ContextEngineId},
+ $this->{Context},
+ $this->{AuthProto},
+ $this->{AuthPass},
+ $this->{PrivProto},
+ $this->{PrivPass},
+ $this->{EngineBoots},
+ $this->{EngineTime},
+ $this->{AuthMasterKey},
+ length($this->{AuthMasterKey}),
+ $this->{PrivMasterKey},
+ length($this->{PrivMasterKey}),
+ $this->{AuthLocalizedKey},
+ length($this->{AuthLocalizedKey}),
+ $this->{PrivLocalizedKey},
+ length($this->{PrivLocalizedKey}),
+ );
+ }
+ }
+ unless ($this->{SessPtr}) {
+ warn("unable to create session") if $SNMP::verbose;
+ return undef;
+ }
+
+ SNMP::initMib($SNMP::auto_init_mib); # ensures that *some* mib is loaded
+
+ $this->{UseLongNames} = $SNMP::use_long_names
+ unless exists $this->{UseLongNames};
+ $this->{UseSprintValue} = $SNMP::use_sprint_value
+ unless exists $this->{UseSprintValue};
+ $this->{BestGuess} = $SNMP::best_guess unless exists $this->{BestGuess};
+ $this->{NonIncreasing} ||= $SNMP::non_increasing;
+ $this->{UseEnums} = $SNMP::use_enums unless exists $this->{UseEnums};
+ $this->{UseNumeric} = $SNMP::use_numeric unless exists $this->{UseNumeric};
+
+ # Force UseLongNames if UseNumeric is in use.
+ $this->{UseLongNames}++ if $this->{UseNumeric};
+
+ bless $this, $type;
+}
+
+sub update {
+# *Not Implemented*
+# designed to update the fields of session to allow retargetting to different
+# host, community name change, timeout, retry changes etc. Unfortunately not
+# working yet because some updates (the address in particular) need to be
+# done on the internal session pointer which cannot be fetched w/o touching
+# globals at this point which breaks win32. A patch to the net-snmp toolkit
+# is needed
+ my $this = shift;
+ my ($name, $aliases, $host_type, $len, $thisaddr);
+ my %new_fields = @_;
+
+ @$this{keys %new_fields} = values %new_fields;
+
+ $this->{UseLongNames} = $SNMP::use_long_names
+ unless exists $this->{UseLongNames};
+ $this->{UseSprintValue} = $SNMP::use_sprint_value
+ unless exists $this->{UseSprintValue};
+ $this->{BestGuess} = $SNMP::best_guess unless exists $this->{BestGuess};
+ $this->{NonIncreasing} ||= $SNMP::non_increasing;
+ $this->{UseEnums} = $SNMP::use_enums unless exists $this->{UseEnums};
+ $this->{UseNumeric} = $SNMP::use_numeric unless exists $this->{UseNumeric};
+
+ # Force UseLongNames if UseNumeric is in use.
+ $this->{UseLongNames}++ if $this->{UseNumeric};
+
+ SNMP::_update_session($this->{Version},
+ $this->{Community},
+ $this->{DestHost},
+ $this->{RemotePort},
+ $this->{LocalPort},
+ $this->{Retries},
+ $this->{Timeout},
+ );
+
+
+}
+
+sub set {
+ my $this = shift;
+ my $vars = shift;
+ my $varbind_list_ref;
+ my $res = 0;
+
+ if (ref($vars) =~ /SNMP::VarList/) {
+ $varbind_list_ref = $vars;
+ } elsif (ref($vars) =~ /SNMP::Varbind/) {
+ $varbind_list_ref = [$vars];
+ } elsif (ref($vars) =~ /ARRAY/) {
+ $varbind_list_ref = [$vars];
+ $varbind_list_ref = $vars if ref($$vars[0]) =~ /ARRAY/;
+ } else {
+ #$varbind_list_ref = [[$tag, $iid, $val]];
+ my $split_vars = SNMP::split_vars($vars);
+ my $val = shift;
+ push @$split_vars,$val;
+ $varbind_list_ref = [$split_vars];
+ }
+ my $cb = shift;
+
+ $res = SNMP::_set($this, $varbind_list_ref, $cb);
+}
+
+sub get {
+ my $this = shift;
+ my $vars = shift;
+ my ($varbind_list_ref, @res);
+
+ if (ref($vars) =~ /SNMP::VarList/) {
+ $varbind_list_ref = $vars;
+ } elsif (ref($vars) =~ /SNMP::Varbind/) {
+ $varbind_list_ref = [$vars];
+ } elsif (ref($vars) =~ /ARRAY/) {
+ $varbind_list_ref = [$vars];
+ $varbind_list_ref = $vars if ref($$vars[0]) =~ /ARRAY/;
+ } else {
+ $varbind_list_ref = [SNMP::split_vars($vars)];
+ }
+
+ my $cb = shift;
+
+ @res = SNMP::_get($this, $this->{RetryNoSuch}, $varbind_list_ref, $cb);
+
+ return(wantarray() ? @res : $res[0]);
+}
+
+
+my $have_netsnmp_oid = eval { require NetSNMP::OID; };
+sub gettable {
+
+ #
+ # getTable
+ # --------
+ #
+ # Get OIDs starting at $table_oid, and continue down the tree
+ # until we get to an OID which does not start with $table_oid,
+ # i.e. we have reached the end of this table.
+ #
+
+ my $state;
+
+ my ($this, $root_oid, @options) = @_;
+ $state->{'options'} = {@options};
+ my ($textnode, $varbinds, $vbl, $res, $repeat);
+
+ # translate the OID into numeric form if its not
+ if ($root_oid !~ /^[\.0-9]+$/) {
+ $textnode = $root_oid;
+ $root_oid = SNMP::translateObj($root_oid);
+ } else {
+ $textnode = SNMP::translateObj($root_oid);
+ }
+
+ # bail if we don't have a valid oid.
+ return if (!$root_oid);
+
+ # deficed if we're going to parse indexes
+ my $parse_indexes = (defined($state->{'options'}{'noindexes'})) ?
+ 0 : $have_netsnmp_oid;
+
+ # get the list of columns we should look at.
+ my @columns;
+ if (!$state->{'options'}{'columns'}) {
+ if ($textnode) {
+ my %indexes;
+
+ if ($parse_indexes) {
+ # get indexes
+ my @indexes =
+ @{$SNMP::MIB{$textnode}{'children'}[0]{'indexes'} || []};
+ # quick translate into a hash
+ map { $indexes{$_} = 1; } @indexes;
+ }
+
+ # calculate the list of accessible columns that aren't indexes
+ my $children = $SNMP::MIB{$textnode}{'children'}[0]{'children'};
+ foreach my $c (@$children) {
+ push @{$state->{'columns'}},
+ $root_oid . ".1." . $c->{'subID'}
+ if (!$indexes{$c->{'label'}});
+ }
+ if ($#{$state->{'columns'}} == -1) {
+ # some tables are only indexes, and we need to walk at
+ # least one column. We pick the last.
+ push @{$state->{'columns'}}, $root_oid . ".1." .
+ $children->[$#$children]{'subID'}
+ if ref($state) eq 'HASH' and ref($children) eq 'ARRAY';
+ }
+ }
+ } else {
+ # XXX: requires specification in numeric OID... ack.!
+ @{$state->{'columns'}} = @{$state->{'options'}{'columns'}};
+
+ # if the columns aren't numeric, we need to turn them into
+ # numeric columns...
+ map {
+ if ($_ !~ /\.1\.3/) {
+ $_ = $SNMP::MIB{$_}{'objectID'};
+ }
+ } @{$state->{'columns'}};
+ }
+
+ # create the initial walking info.
+ foreach my $c (@{$state->{'columns'}}) {
+ push @{$state->{'varbinds'}}, [$c];
+ push @{$state->{'stopconds'}}, $c;
+ }
+
+ if ($#{$state->{'varbinds'}} == -1) {
+ print STDERR "ack: gettable failed to find any columns to look for.\n";
+ return;
+ }
+
+ $vbl = $state->{'varbinds'};
+
+ my $repeatcount;
+ if ($this->{Version} eq '1' || $state->{'options'}{nogetbulk}) {
+ $state->{'repeatcount'} = 1;
+ } elsif ($state->{'options'}{'repeat'}) {
+ $state->{'repeatcount'} = $state->{'options'}{'repeat'};
+ } elsif ($#{$state->{'varbinds'}} == -1) {
+ $state->{'repeatcount'} = 1;
+ } else {
+ # experimentally determined maybe guess at a best repeat value
+ # 1000 bytes max (safe), 30 bytes average for encoding of the
+ # varbind (experimentally determined to be closer to
+ # 26. Again, being safe. Then devide by the number of
+ # varbinds.
+ $state->{'repeatcount'} = int(1000 / 36 / ($#{$state->{'varbinds'}} + 1));
+ }
+ # Make sure we run at least once
+ if ($state->{'repeatcount'} < 1) {
+ $state->{'repeatcount'} = 1;
+ }
+
+ #
+ # if we've been configured with a callback, then call the
+ # sub-functions with a callback to our own "next" processing
+ # function (_gettable_do_it). or else call the blocking method and
+ # call the next processing function ourself.
+ #
+ if ($state->{'options'}{'callback'}) {
+ if ($this->{Version} ne '1' && !$state->{'options'}{'nogetbulk'}) {
+ $res = $this->getbulk(0, $state->{'repeatcount'}, $vbl,
+ [\&_gettable_do_it, $this, $vbl,
+ $parse_indexes, $textnode, $state]);
+ } else {
+ $res = $this->getnext($vbl,
+ [\&_gettable_do_it, $this, $vbl,
+ $parse_indexes, $textnode, $state]);
+ }
+ } else {
+ if ($this->{Version} ne '1' && !$state->{'options'}{'nogetbulk'}) {
+ $res = $this->getbulk(0, $state->{'repeatcount'}, $vbl);
+ } else {
+ $res = $this->getnext($vbl);
+ }
+ return $this->_gettable_do_it($vbl, $parse_indexes, $textnode, $state);
+ }
+ return 0;
+}
+
+sub _gettable_do_it() {
+ my ($this, $vbl, $parse_indexes, $textnode, $state) = @_;
+
+ my ($res);
+
+ $vbl = $_[$#_] if ($state->{'options'}{'callback'});
+
+ while ($#$vbl > -1 && !$this->{ErrorNum}) {
+ if (($#$vbl + 1) % ($#{$state->{'stopconds'}} + 1) != 0) {
+ if ($vbl->[$#$vbl][2] ne 'ENDOFMIBVIEW') {
+ # unless it's an end of mib view we didn't get the
+ # proper number of results back.
+ print STDERR "ack: gettable results not appropriate\n";
+ }
+ my @k = keys(%{$state->{'result_hash'}});
+ last if ($#k > -1); # bail with what we have
+ return;
+ }
+
+ $state->{'varbinds'} = [];
+ my $newstopconds;
+
+ my $lastsetstart = ($state->{'repeatcount'}-1) * ($#{$state->{'stopconds'}}+1);
+
+ for (my $i = 0; $i <= $#$vbl; $i++) {
+ my $row_oid = SNMP::translateObj($vbl->[$i][0]);
+ my $row_text = $vbl->[$i][0];
+ my $row_index = $vbl->[$i][1];
+ my $row_value = $vbl->[$i][2];
+ my $row_type = $vbl->[$i][3];
+
+ if ($row_oid =~
+ /^$state->{'stopconds'}[$i % ($#{$state->{'stopconds'}}+1)]/ &&
+ $row_value ne 'ENDOFMIBVIEW' ){
+
+ if ($row_type eq "OBJECTID") {
+
+ # If the value returned is an OID, translate this
+ # back in to a textual OID
+
+ $row_value = SNMP::translateObj($row_value);
+
+ }
+
+ # Place the results in a hash
+
+ $state->{'result_hash'}{$row_index}{$row_text} = $row_value;
+
+ # continue past this next time
+ if ($i >= $lastsetstart) {
+ push @$newstopconds,
+ $state->{'stopconds'}->[$i%($#{$state->{'stopconds'}}+1)];
+ push @{$state->{'varbinds'}},[$vbl->[$i][0],$vbl->[$i][1]];
+ }
+ }
+ }
+ if ($#$newstopconds == -1) {
+ last;
+ }
+ if ($#{$state->{'varbinds'}} == -1) {
+ print "gettable ack. shouldn't get here\n";
+ }
+ $vbl = $state->{'varbinds'};
+ $state->{'stopconds'} = $newstopconds;
+
+ #
+ # if we've been configured with a callback, then call the
+ # sub-functions with a callback to our own "next" processing
+ # function (_gettable_do_it). or else call the blocking method and
+ # call the next processing function ourself.
+ #
+ if ($state->{'options'}{'callback'}) {
+ if ($this->{Version} ne '1' && !$state->{'options'}{'nogetbulk'}) {
+ $res = $this->getbulk(0, $state->{'repeatcount'}, $vbl,
+ [\&_gettable_do_it, $this, $vbl,
+ $parse_indexes, $textnode, $state]);
+ } else {
+ $res = $this->getnext($vbl,
+ [\&_gettable_do_it, $this, $vbl,
+ $parse_indexes, $textnode, $state]);
+ }
+ return;
+ } else {
+ if ($this->{Version} ne '1' && !$state->{'options'}{'nogetbulk'}) {
+ $res = $this->getbulk(0, $state->{'repeatcount'}, $vbl);
+ } else {
+ $res = $this->getnext($vbl);
+ }
+ }
+ }
+
+ # finish up
+ _gettable_end_routine($state, $parse_indexes, $textnode);
+
+ # return the hash if no callback was specified
+ if (!$state->{'options'}{'callback'}) {
+ return($state->{'result_hash'});
+ }
+
+ #
+ # if they provided a callback, call it
+ # (if an array pass the args as well)
+ #
+ if (ref($state->{'options'}{'callback'}) eq 'ARRAY') {
+ my $code = shift @{$state->{'options'}{'callback'}};
+ $code->(@{$state->{'options'}{'callback'}}, $state->{'result_hash'});
+ } else {
+ $state->{'options'}{'callback'}->($state->{'result_hash'});
+ }
+}
+
+sub _gettable_end_routine {
+ my ($state, $parse_indexes, $textnode) = @_;
+ if ($parse_indexes) {
+ my @indexes = @{$SNMP::MIB{$textnode}{'children'}[0]{'indexes'}};
+ my $i;
+ foreach my $trow (keys(%{$state->{'result_hash'}})) {
+ my $noid = new NetSNMP::OID($state->{'columns'}[0] . "." . $trow);
+ if (!$noid) {
+ print STDERR "***** ERROR parsing $state->{'columns'}[0].$trow MIB OID\n";
+ next;
+ }
+ my $nindexes = $noid->get_indexes();
+ if (!$nindexes || ref($nindexes) ne 'ARRAY' ||
+ $#indexes != $#$nindexes) {
+ print STDERR "***** ERROR parsing $state->{'columns'}[0].$trow MIB indexes:\n $noid => " . ref($nindexes) . "\n [should be an ARRAY]\n expended # indexes = $#indexes\n";
+ if (ref($nindexes) eq 'ARRAY') {
+ print STDERR "***** ERROR parsing $state->{'columns'}[0].$trow MIB indexes: " . ref($nindexes) . " $#indexes $#$nindexes\n";
+ }
+ next;
+ }
+
+ for ($i = 0; $i <= $#indexes; $i++) {
+ $state->{'result_hash'}{$trow}{$indexes[$i]} = $nindexes->[$i];
+ }
+ }
+ }
+}
+
+
+sub fget {
+ my $this = shift;
+ my $vars = shift;
+ my ($varbind_list_ref, @res);
+
+ if (ref($vars) =~ /SNMP::VarList/) {
+ $varbind_list_ref = $vars;
+ } elsif (ref($vars) =~ /SNMP::Varbind/) {
+ $varbind_list_ref = [$vars];
+ } elsif (ref($vars) =~ /ARRAY/) {
+ $varbind_list_ref = [$vars];
+ $varbind_list_ref = $vars if ref($$vars[0]) =~ /ARRAY/;
+ } else {
+ $varbind_list_ref = [SNMP::split_vars($vars)];
+ }
+
+ my $cb = shift;
+
+ SNMP::_get($this, $this->{RetryNoSuch}, $varbind_list_ref, $cb);
+
+ foreach my $varbind (@$varbind_list_ref) {
+ my $sub = $this->{VarFormats}{SNMP::Varbind::tag($varbind)} ||
+ $this->{TypeFormats}{SNMP::Varbind::type($varbind)};
+ &$sub($varbind) if defined $sub;
+ push(@res, SNMP::Varbind::val($varbind));
+ }
+
+ return(wantarray() ? @res : $res[0]);
+}
+
+sub getnext {
+ my $this = shift;
+ my $vars = shift;
+ my ($varbind_list_ref, @res);
+
+ if (ref($vars) =~ /SNMP::VarList/) {
+ $varbind_list_ref = $vars;
+ } elsif (ref($vars) =~ /SNMP::Varbind/) {
+ $varbind_list_ref = [$vars];
+ } elsif (ref($vars) =~ /ARRAY/) {
+ $varbind_list_ref = [$vars];
+ $varbind_list_ref = $vars if ref($$vars[0]) =~ /ARRAY/;
+ } else {
+ $varbind_list_ref = [SNMP::split_vars($vars)];
+ }
+
+ my $cb = shift;
+
+ @res = SNMP::_getnext($this, $varbind_list_ref, $cb);
+
+ return(wantarray() ? @res : $res[0]);
+}
+
+sub fgetnext {
+ my $this = shift;
+ my $vars = shift;
+ my ($varbind_list_ref, @res);
+
+ if (ref($vars) =~ /SNMP::VarList/) {
+ $varbind_list_ref = $vars;
+ } elsif (ref($vars) =~ /SNMP::Varbind/) {
+ $varbind_list_ref = [$vars];
+ } elsif (ref($vars) =~ /ARRAY/) {
+ $varbind_list_ref = [$vars];
+ $varbind_list_ref = $vars if ref($$vars[0]) =~ /ARRAY/;
+ } else {
+ $varbind_list_ref = [SNMP::split_vars($vars)];
+ }
+
+ my $cb = shift;
+
+ SNMP::_getnext($this, $varbind_list_ref, $cb);
+
+ foreach my $varbind (@$varbind_list_ref) {
+ my $sub = $this->{VarFormats}{SNMP::Varbind::tag($varbind)} ||
+ $this->{TypeFormats}{SNMP::Varbind::type($varbind)};
+ &$sub($varbind) if defined $sub;
+ push(@res, SNMP::Varbind::val($varbind));
+ }
+
+ return(wantarray() ? @res : $res[0]);
+}
+
+sub getbulk {
+ my $this = shift;
+ my $nonrepeaters = shift;
+ my $maxrepetitions = shift;
+ my $vars = shift;
+ my ($varbind_list_ref, @res);
+
+ if (ref($vars) =~ /SNMP::VarList/) {
+ $varbind_list_ref = $vars;
+ } elsif (ref($vars) =~ /SNMP::Varbind/) {
+ $varbind_list_ref = [$vars];
+ } elsif (ref($vars) =~ /ARRAY/) {
+ $varbind_list_ref = [$vars];
+ $varbind_list_ref = $vars if ref($$vars[0]) =~ /ARRAY/;
+ } else {
+ $varbind_list_ref = [SNMP::split_vars($vars)];
+ }
+
+ my $cb = shift;
+
+ @res = SNMP::_getbulk($this, $nonrepeaters, $maxrepetitions, $varbind_list_ref, $cb);
+
+ return(wantarray() ? @res : $res[0]);
+}
+
+sub bulkwalk {
+ my $this = shift;
+ my $nonrepeaters = shift;
+ my $maxrepetitions = shift;
+ my $vars = shift;
+ my ($varbind_list_ref, @res);
+
+ if (ref($vars) =~ /SNMP::VarList/) {
+ $varbind_list_ref = $vars;
+ } elsif (ref($vars) =~ /SNMP::Varbind/) {
+ $varbind_list_ref = [$vars];
+ } elsif (ref($vars) =~ /ARRAY/) {
+ $varbind_list_ref = [$vars];
+ $varbind_list_ref = $vars if ref($$vars[0]) =~ /ARRAY/;
+ } else {
+ # my ($tag, $iid) = ($vars =~ /^((?:\.\d+)+|\w+)\.?(.*)$/);
+ my ($tag, $iid) = ($vars =~ /^(.*?)\.?(\d+)+$/);
+ $varbind_list_ref = [[$tag, $iid]];
+ }
+
+ if (scalar @$varbind_list_ref == 0) {
+ $this->{ErrorNum} = SNMP::constant("SNMPERR_GENERR", 0);
+ $this->{ErrorStr} = "cannot bulkwalk() empty variable list";
+ return undef;
+ }
+ if (scalar @$varbind_list_ref < $nonrepeaters) {
+ $this->{ErrorNum} = SNMP::constant("SNMPERR_GENERR", 0);
+ $this->{ErrorStr} = "bulkwalk() needs at least $nonrepeaters varbinds";
+ return undef;
+ }
+
+ my $cb = shift;
+ @res = SNMP::_bulkwalk($this, $nonrepeaters, $maxrepetitions,
+ $varbind_list_ref, $cb);
+
+ # Return, in list context, a copy of the array of arrays of Varbind refs.
+ # In scalar context, return either a reference to the array of arrays of
+ # Varbind refs, or the request ID for an asynchronous bulkwalk. This is
+ # a compromise between the getbulk()-ish return, and the more useful array
+ # of arrays of Varbinds return from the synchronous bulkwalk().
+ #
+ return @res if (wantarray());
+ return defined($cb) ? $res[0] : \@res;
+}
+
+my %trap_type = (coldStart => 0, warmStart => 1, linkDown => 2, linkUp => 3,
+ authFailure => 4, egpNeighborLoss => 5, specific => 6 );
+sub trap {
+# (v1) enterprise, agent, generic, specific, uptime, <vars>
+# $sess->trap(enterprise=>'.1.3.6.1.4.1.2021', # or 'ucdavis' [default]
+# agent => '127.0.0.1', # or 'localhost',[default 1st intf on host]
+# generic => specific, # can be omitted if 'specific' supplied
+# specific => 5, # can be omitted if 'generic' supplied
+# uptime => 1234, # default to localhost uptime (0 on win32)
+# [[ifIndex, 1, 1],[sysLocation, 0, "here"]]); # optional vars
+# # always last
+# (v2) oid, uptime, <vars>
+# $sess->trap(uptime => 1234,
+# oid => 'snmpRisingAlarm',
+# [[ifIndex, 1, 1],[sysLocation, 0, "here"]]); # optional vars
+# # always last
+# # always last
+
+
+ my $this = shift;
+ my $vars = pop if ref($_[$#_]); # last arg may be varbind or varlist
+ my %param = @_;
+ my ($varbind_list_ref, @res);
+
+ if (ref($vars) =~ /SNMP::VarList/) {
+ $varbind_list_ref = $vars;
+ } elsif (ref($vars) =~ /SNMP::Varbind/) {
+ $varbind_list_ref = [$vars];
+ } elsif (ref($vars) =~ /ARRAY/) {
+ $varbind_list_ref = [$vars];
+ $varbind_list_ref = $vars if ref($$vars[0]) =~ /ARRAY/;
+ }
+
+ if ($this->{Version} eq '1') {
+ my $enterprise = $param{enterprise} || 'ucdavis';
+ $enterprise = SNMP::translateObj($enterprise)
+ unless $enterprise =~ /^[\.\d]+$/;
+ my $agent = $param{agent} || '';
+ my $generic = $param{generic} || 'specific';
+ $generic = $trap_type{$generic} || $generic;
+ my $uptime = $param{uptime} || SNMP::_sys_uptime();
+ my $specific = $param{specific} || 0;
+ @res = SNMP::_trapV1($this, $enterprise, $agent, $generic, $specific,
+ $uptime, $varbind_list_ref);
+ } elsif (($this->{Version} eq '2')|| ($this->{Version} eq '2c')) {
+ my $trap_oid = $param{oid} || $param{trapoid} || '.0.0';
+ my $uptime = $param{uptime} || SNMP::_sys_uptime();
+ @res = SNMP::_trapV2($this, $uptime, $trap_oid, $varbind_list_ref);
+ }
+
+ return(wantarray() ? @res : $res[0]);
+}
+
+sub inform {
+# (v3) oid, uptime, <vars>
+# $sess->inform(uptime => 1234,
+# oid => 'coldStart',
+# [[ifIndex, 1, 1],[sysLocation, 0, "here"]]); # optional vars
+# # then callback
+ # always last
+
+
+ my $this = shift;
+ my $vars;
+ my $cb;
+ $cb = pop if ref($_[$#_]) eq 'CODE'; # last arg may be code
+ $vars = pop if ref($_[$#_]); # varbind or varlist
+ my %param = @_;
+ my ($varbind_list_ref, @res);
+
+ if (ref($vars) =~ /SNMP::VarList/) {
+ $varbind_list_ref = $vars;
+ } elsif (ref($vars) =~ /SNMP::Varbind/) {
+ $varbind_list_ref = [$vars];
+ } elsif (ref($vars) =~ /ARRAY/) {
+ $varbind_list_ref = [$vars];
+ $varbind_list_ref = $vars if ref($$vars[0]) =~ /ARRAY/;
+ }
+
+ my $trap_oid = $param{oid} || $param{trapoid};
+ my $uptime = $param{uptime} || SNMP::_sys_uptime();
+
+ if($this->{Version} eq '3') {
+ @res = SNMP::_inform($this, $uptime, $trap_oid, $varbind_list_ref, $cb);
+ } else {
+ warn("error:inform: This version doesn't support the command\n");
+ }
+
+ return(wantarray() ? @res : $res[0]);
+}
+
+package SNMP::TrapSession;
+@SNMP::TrapSession::ISA = ('SNMP::Session');
+
+sub new {
+ my $type = shift;
+
+ # allow override of remote SNMP trap port
+ unless (grep(/RemotePort/, @_)) {
+ push(@_, 'RemotePort', 162); # push on new default for trap session
+ }
+
+ SNMP::Session::new($type, @_);
+}
+
+package SNMP::Varbind;
+
+$SNMP::Varbind::tag_f = 0;
+$SNMP::Varbind::iid_f = 1;
+$SNMP::Varbind::val_f = 2;
+$SNMP::Varbind::type_f = 3;
+$SNMP::Varbind::time_f = 4;
+
+sub new {
+ my $type = shift;
+ my $this = shift;
+ $this ||= [];
+ bless $this;
+}
+
+sub tag {
+ $_[0]->[$SNMP::Varbind::tag_f];
+}
+
+sub iid {
+ $_[0]->[$SNMP::Varbind::iid_f];
+}
+
+sub val {
+ $_[0]->[$SNMP::Varbind::val_f];
+}
+
+sub type {
+ $_[0]->[$SNMP::Varbind::type_f];
+}
+
+sub name {
+ if (defined($_[0]->[$SNMP::Varbind::iid_f]) && ($_[0]->[$SNMP::Varbind::iid_f] =~ m/^[0-9]+$/)) {
+ return $_[0]->[$SNMP::Varbind::tag_f] . "." . $_[0]->[$SNMP::Varbind::iid_f];
+ }
+
+ return $_[0]->[$SNMP::Varbind::tag_f];
+}
+
+sub fmt {
+ my $self = shift;
+ return $self->name . " = \"" . $self->val . "\" (" . $self->type . ")";
+}
+
+
+#sub DESTROY {
+# print "SNMP::Varbind::DESTROY($_[0])\n";
+#}
+
+package SNMP::VarList;
+
+sub new {
+ my $type = shift;
+ my $this = [];
+ my $varb;
+ foreach $varb (@_) {
+ $varb = new SNMP::Varbind($varb) unless ref($varb) =~ /SNMP::Varbind/;
+ push(@{$this}, $varb);
+ }
+
+ bless $this;
+}
+
+#sub DESTROY {
+# print "SNMP::VarList::DESTROY($_[0])\n";
+#}
+
+package SNMP::DEBUGGING;
+# controls info/debugging output from SNMP module and libsnmp
+# $SNMP::debugging == 1 => enables general info and warning output
+# (eqiv. to setting $SNMP::verbose)
+# $SNMP::debugging == 2 => enables do_debugging from libsnmp as well
+# $SNMP::debugging == 3 => enables packet_dump from libsnmp as well
+sub TIESCALAR { my $class = shift; my $val; bless \$val, $class; }
+
+sub FETCH { ${$_[0]}; }
+
+sub STORE {
+ $SNMP::verbose = $_[1];
+ SNMP::_set_debugging($_[1]>1);
+ $SNMP::dump_packet = ($_[1]>2);
+ ${$_[0]} = $_[1];
+}
+
+sub DELETE {
+ $SNMP::verbose = 0;
+ SNMP::_set_debugging(0);
+ $SNMP::dump_packet = 0;
+ ${$_[0]} = undef;
+}
+
+package SNMP::DEBUG_INTERNALS; # Controls SNMP.xs debugging.
+sub TIESCALAR { my $class = shift; my $val; bless \$val, $class; }
+
+sub FETCH { ${$_[0]}; }
+
+sub STORE {
+ SNMP::_debug_internals($_[1]);
+ ${$_[0]} = $_[1];
+}
+
+sub DELETE {
+ SNMP::_debug_internals(0);
+ ${$_[0]} = undef;
+}
+
+package SNMP::DUMP_PACKET;
+# controls packet dump output from libsnmp
+
+sub TIESCALAR { my $class = shift; my $val; bless \$val, $class; }
+
+sub FETCH { ${$_[0]}; }
+
+sub STORE { SNMP::_dump_packet($_[1]); ${$_[0]} = $_[1]; }
+
+sub DELETE { SNMP::_dump_packet(0); ${$_[0]} = 0; }
+
+package SNMP::MIB;
+
+sub TIEHASH {
+ bless {};
+}
+
+sub FETCH {
+ my $this = shift;
+ my $key = shift;
+
+ if (!defined $this->{$key}) {
+ tie(%{$this->{$key}}, 'SNMP::MIB::NODE', $key) or return undef;
+ }
+ $this->{$key};
+}
+
+sub STORE {
+ warn "STORE(@_) : write access to the MIB not implemented\n";
+}
+
+sub DELETE {
+ delete $_[0]->{$_[1]}; # just delete cache entry
+}
+
+sub FIRSTKEY { return '.1'; } # this should actually start at .0 but
+ # because nodes are not stored in lexico
+ # order in ucd-snmp node tree walk will
+ # miss most of the tree
+sub NEXTKEY { # this could be sped up by using an XS __get_next_oid maybe
+ my $node = $_[0]->FETCH($_[1])->{nextNode};
+ $node->{objectID};
+}
+sub EXISTS { exists $_[0]->{$_[1]} || $_[0]->FETCH($_[1]); }
+sub CLEAR { undef %{$_[0]}; } # clear the cache
+
+package SNMP::MIB::NODE;
+my %node_elements =
+ (
+ objectID => 0, # dotted decimal fully qualified OID
+ label => 0, # leaf textual identifier (e.g., 'sysDescr')
+ subID => 0, # leaf numeric OID component of objectID (e.g., '1')
+ moduleID => 0, # textual identifier for module (e.g., 'RFC1213-MIB')
+ parent => 0, # parent node
+ children => 0, # array reference of children nodes
+ indexes => 0, # returns array of column labels
+ implied => 0, # boolean: is the last index IMPLIED
+ varbinds => 0, # returns array of trap/notification varbinds
+ nextNode => 0, # next lexico node (BUG! does not return in lexico order)
+ type => 0, # returns simple type (see getType for values)
+ access => 0, # returns ACCESS (ReadOnly, ReadWrite, WriteOnly,
+ # NoAccess, Notify, Create)
+ status => 0, # returns STATUS (Mandatory, Optional, Obsolete,
+ # Deprecated)
+ syntax => 0, # returns 'textualConvention' if defined else 'type'
+ textualConvention => 0, # returns TEXTUAL-CONVENTION
+ units => 0, # returns UNITS
+ hint => 0, # returns HINT
+ enums => 0, # returns hash ref {tag => num, ...}
+ ranges => 0, # returns array ref of hash ref [{low => num, high => num}]
+ defaultValue => 0, # returns default value
+ description => 0, # returns DESCRIPTION ($SNMP::save_descriptions must
+ # be set prior to MIB initialization/parsing
+ augments => 0, # textual identifier of augmented object
+ );
+
+# sub TIEHASH - implemented in SNMP.xs
+
+# sub FETCH - implemented in SNMP.xs
+
+sub STORE {
+ warn "STORE(@_): write access to MIB node not implemented\n";
+}
+
+sub DELETE {
+ warn "DELETE(@_): write access to MIB node not implemented\n";
+}
+
+sub FIRSTKEY { my $k = keys %node_elements; (each(%node_elements))[0]; }
+sub NEXTKEY { (each(%node_elements))[0]; }
+sub EXISTS { exists($node_elements{$_[1]}); }
+sub CLEAR {
+ warn "CLEAR(@_): write access to MIB node not implemented\n";
+}
+
+#sub DESTROY {
+# warn "DESTROY(@_): write access to MIB node not implemented\n";
+# # print "SNMP::MIB::NODE::DESTROY : $_[0]->{label} ($_[0])\n";
+#}
+package SNMP::MIB::SAVE_DESCR;
+
+sub TIESCALAR { my $class = shift; my $val; bless \$val, $class; }
+
+sub FETCH { ${$_[0]}; }
+
+sub STORE { SNMP::_set_save_descriptions($_[1]); ${$_[0]} = $_[1]; }
+
+sub DELETE { SNMP::_set_save_descriptions(0); ${$_[0]} = 0; }
+
+package SNMP::MIB::REPLACE_NEWER; # Controls MIB parsing
+
+sub TIESCALAR { my $class = shift; my $val; bless \$val, $class; }
+
+sub FETCH { ${$_[0]}; }
+
+sub STORE {
+ SNMP::_set_replace_newer($_[1]);
+ ${$_[0]} = $_[1];
+}
+
+sub DELETE {
+ SNMP::_set_replace_newer(0);
+ ${$_[0]} = 0;
+}
+
+package SNMP::MIB::MIB_OPTIONS;
+
+sub TIESCALAR { my $class = shift; my $val; bless \$val, $class; }
+
+sub FETCH { ${$_[0]}; }
+
+sub STORE { SNMP::_mib_toggle_options($_[1]); ${$_[0]} = $_[1]; }
+
+sub DELETE { SNMP::_mib_toggle_options(0); ${$_[0]} = ''; }
+
+package SNMP;
+END{SNMP::_sock_cleanup() if defined &SNMP::_sock_cleanup;}
+# Autoload methods go after __END__, and are processed by the autosplit prog.
+
+1;
+__END__
+
+=head1 NAME
+
+SNMP - The Perl5 'SNMP' Extension Module for the Net-SNMP SNMP package.
+
+=head1 SYNOPSIS
+
+ use SNMP;
+ ...
+ $sess = new SNMP::Session(DestHost => localhost, Community => public);
+ $val = $sess->get('sysDescr.0');
+ ...
+ $vars = new SNMP::VarList([sysDescr,0], [sysContact,0], [sysLocation,0]);
+ @vals = $sess->get($vars);
+ ...
+ $vb = new SNMP::Varbind();
+ do {
+ $val = $sess->getnext($vb);
+ print "@{$vb}\n";
+ } until ($sess->{ErrorNum});
+ ...
+ $SNMP::save_descriptions = 1;
+ SNMP::initMib(); # assuming mib is not already loaded
+ print "$SNMP::MIB{sysDescr}{description}\n";
+
+=head1 DESCRIPTION
+
+
+Note: The perl SNMP 5.0 module which comes with net-snmp 5.0 and
+higher is different than previous versions in a number of ways. Most
+importantly, it behaves like a proper net-snmp application and calls
+init_snmp properly, which means it will read configuration files and
+use those defaults where appropriate automatically parse MIB files,
+etc. This will likely affect your perl applications if you have, for
+instance, default values set up in your snmp.conf file (as the perl
+module will now make use of those defaults). The documentation,
+however, has sadly not been updated yet (aside from this note), nor is
+the read_config default usage implementation fully complete.
+
+The basic operations of the SNMP protocol are provided by this module
+through an object oriented interface for modularity and ease of use.
+The primary class is SNMP::Session which encapsulates the persistent
+aspects of a connection between the management application and the
+managed agent. Internally the class is implemented as a blessed hash
+reference. This class supplies 'get', 'getnext', 'set', 'fget', and
+'fgetnext' method calls. The methods take a variety of input argument
+formats and support both synchronous and asynchronous operation through
+a polymorphic API (i.e., method behaviour varies dependent on args
+passed - see below).
+
+=head1 SNMP::Session
+
+$sess = new SNMP::Session(DestHost => 'host', ...)
+
+The following arguments may be passed to new as a hash.
+
+=head2 Basic Options
+
+=over 4
+
+=item DestHost
+
+Hostname or IP address of the SNMP agent you want to talk to.
+Specified in Net-SNMP formatted agent addresses. These addresses
+typically look like one of the following:
+
+ localhost
+ tcp:localhost
+ tls:localhost
+ tls:localhost:9876
+ udp6:[::1]:9876
+ unix:/some/path/to/file/socket
+
+Defaults to 'localhost'.
+
+=item Version
+
+SNMP version to use.
+
+The default is taken from library configuration - probably 3 [1, 2
+(same as 2c), 2c, 3].
+
+=item Timeout
+
+The number of micro-seconds to wait before resending a request.
+
+The default is '1000000'
+
+=item Retries
+
+The number of times to retry a request.
+
+The default is '5'
+
+=item RetryNoSuch
+
+If enabled NOSUCH errors in 'get' pdus will
+be repaired, removing the varbind in error, and resent -
+undef will be returned for all NOSUCH varbinds, when set
+to '0' this feature is disabled and the entire get request
+will fail on any NOSUCH error (applies to v1 only)
+
+The default is '0'.
+
+=back
+
+=head2 SNMPv3/TLS Options
+
+=over
+
+=item OurIdentity
+
+Our X.509 identity to use, which should either be a fingerprint or the
+filename that holds the certificate.
+
+=item TheirIdentity
+
+The remote server's identity to connect to, specified as eihter a
+fingerprint or a file name. Either this must be specified, or the
+hostname below along with a trust anchor.
+
+=item TheirHostname
+
+The remote server's hostname that is expected. If their certificate
+was signed by a CA then their hostname presented in the certificate
+must match this value or the connection fails to be established (to
+avoid man-in-the-middle attacks).
+
+=item TrustCert
+
+A trusted certificate to use a trust anchor (like a CA certificate)
+for verifying a remote server's certificate. If a CA certificate is
+used to validate a certificate then the TheirHostname parameter must
+also be specified to ensure their presente hostname in the certificate
+matches.
+
+=back
+
+=head2 SNMPv3/USM Options
+
+=over
+
+=item SecName
+
+The SNMPv3 security name to use (most for SNMPv3 with USM).
+
+The default is 'initial'.
+
+=item SecLevel
+
+The SNMPv3 security level to use [noAuthNoPriv, authNoPriv, authPriv] (v3)
+
+The default is 'noAuthNoPriv'.
+
+=item SecEngineId
+
+The SNMPv3 security engineID to use (if the snmpv3 security model
+needs it; for example USM).
+
+The default is <none>, security engineID and it will be probed if not
+supplied (v3)
+
+=item ContextEngineId
+
+The SNMPv3 context engineID to use.
+
+The default is the <none> and will be set either to the SecEngineId
+value if set or discovered or will be discovered in other ways if
+using TLS (RFC5343 based discovery).
+
+=item Context
+
+The SNMPv3 context name to use.
+
+The default is '' (an empty string)
+
+=item AuthProto
+
+The SNMPv3/USM authentication protocol to use [MD5, SHA].
+
+The default is 'MD5'.
+
+=item AuthPass
+
+The SNMPv3/USM authentication passphrase to use.
+
+default <none>, authentication passphrase
+
+=item PrivProto
+
+The SNMPv3/USM privacy protocol to use [DES, AES].
+
+The default is 'DES'.
+
+=item PrivPass
+
+The SNMPv3/USM privacy passphrase to use.
+
+default <none>, privacy passphrase (v3)
+
+=item AuthMasterKey
+
+=item PrivMasterKey
+
+=item AuthLocalizedKey
+
+=item PrivLocalizedKey
+
+Directly specified SNMPv3 USM user keys (used if you want to specify
+the keys instead of deriving them from a password as above).
+
+=back
+
+=head2 SNMPv1 and SNMPv2c Options
+
+=item Community
+
+For SNMPv1 and SNMPv2c, the clear-text community name to use.
+
+The default is 'public'.
+
+=head2 Other Configuration Options
+
+=over
+
+=item VarFormats
+
+default 'undef', used by 'fget[next]', holds an hash
+reference of output value formatters, (e.g., {<obj> =>
+<sub-ref>, ... }, <obj> must match the <obj> and format
+used in the get operation. A special <obj>, '*', may be
+used to apply all <obj>s, the supplied sub is called to
+translate the value to a new format. The sub is called
+passing the Varbind as the arg
+
+=item TypeFormats
+
+default 'undef', used by 'fget[next]', holds an hash
+reference of output value formatters, (e.g., {<type> =>
+<sub-ref>, ... }, the supplied sub is called to translate
+the value to a new format, unless a VarFormat mathces first
+(e.g., $sess->{TypeFormats}{INTEGER} = \&mapEnum();
+although this can be done more efficiently by enabling
+$SNMP::use_enums or session creation param 'UseEnums')
+
+=item UseLongNames
+
+defaults to the value of SNMP::use_long_names at time
+of session creation. set to non-zero to have <tags>
+for 'getnext' methods generated preferring longer Mib name
+convention (e.g., system.sysDescr vs just sysDescr)
+
+=item UseSprintValue
+
+defaults to the value of SNMP::use_sprint_value at time
+of session creation. set to non-zero to have return values
+for 'get' and 'getnext' methods formatted with the libraries
+snprint_value function. This will result in certain data types
+being returned in non-canonical format Note: values returned
+with this option set may not be appropriate for 'set' operations
+(see discussion of value formats in <vars> description section)
+
+=item UseEnums
+
+defaults to the value of SNMP::use_enums at time of session
+creation. set to non-zero to have integer return values
+converted to enumeration identifiers if possible, these values
+will also be acceptable when supplied to 'set' operations
+
+=item UseNumeric
+
+defaults to the value of SNMP::use_numeric at time of session
+creation. set to non-zero to have <tags> for get methods returned
+as numeric OID's rather than descriptions. UseLongNames will be
+set so that the full OID is returned to the caller.
+
+=item BestGuess
+
+defaults to the value of SNMP::best_guess at time of session
+creation. this setting controls how <tags> are parsed. setting to
+0 causes a regular lookup. setting to 1 causes a regular expression
+match (defined as -Ib in snmpcmd) and setting to 2 causes a random
+access lookup (defined as -IR in snmpcmd).
+
+=item NonIncreasing
+
+defaults to the value of SNMP::non_increasing at time of session
+creation. this setting controls if a non-increasing OID during
+bulkwalk will causes an error. setting to 0 causes the default
+behaviour (which may, in very badly performing agents, result in a never-ending loop).
+setting to 1 causes an error (OID not increasing) when this error occur.
+
+=item ErrorStr
+
+read-only, holds the error message assoc. w/ last request
+
+=item ErrorNum
+
+read-only, holds the snmp_err or staus of last request
+
+=item ErrorInd
+
+read-only, holds the snmp_err_index when appropriate
+
+=back
+
+Private variables:
+
+=over
+
+=item DestAddr
+
+internal field used to hold the translated DestHost field
+
+=item SessPtr
+
+internal field used to cache a created session structure
+
+=item RemotePort
+
+Obsolete. Please use the DestHost specifier to indicate the hostname
+and port combination instead of this paramet.
+
+=back
+
+=head2 SNMP::Session methods
+
+=over
+
+=item $sess->update(E<lt>fieldsE<gt>)
+
+Updates the SNMP::Session object with the values fields
+passed in as a hash list (similar to new(E<lt>fieldsE<gt>))
+B<(WARNING! not fully implemented)>
+
+=item $sess->get(E<lt>varsE<gt> [,E<lt>callbackE<gt>])
+
+do SNMP GET, multiple <vars> formats accepted.
+for syncronous operation <vars> will be updated
+with value(s) and type(s) and will also return
+retrieved value(s). If <callback> supplied method
+will operate asynchronously
+
+=item $sess->fget(E<lt>varsE<gt> [,E<lt>callbackE<gt>])
+
+do SNMP GET like 'get' and format the values according
+the handlers specified in $sess->{VarFormats} and
+$sess->{TypeFormats}
+
+=item $sess->getnext(E<lt>varsE<gt> [,E<lt>callbackE<gt>])
+
+do SNMP GETNEXT, multiple <vars> formats accepted,
+returns retrieved value(s), <vars> passed as arguments are
+updated to indicate next lexicographical <obj>,<iid>,<val>,
+and <type>
+
+Note: simple string <vars>,(e.g., 'sysDescr.0')
+form is not updated. If <callback> supplied method
+will operate asynchronously
+
+=item $sess->fgetnext(E<lt>varsE<gt> [,E<lt>callbackE<gt>])
+
+do SNMP GETNEXT like getnext and format the values according
+the handlers specified in $sess->{VarFormats} and
+$sess->{TypeFormats}
+
+=item $sess->set(E<lt>varsE<gt> [,E<lt>callbackE<gt>])
+
+do SNMP SET, multiple <vars> formats accepted.
+the value field in all <vars> formats must be in a canonical
+format (i.e., well known format) to ensure unambiguous
+translation to SNMP MIB data value (see discussion of
+canonical value format <vars> description section),
+returns snmp_errno. If <callback> supplied method
+will operate asynchronously
+
+=item $sess->getbulk(E<lt>non-repeatersE<gt>, E<lt>max-repeatersE<gt>, E<lt>varsE<gt>)
+
+do an SNMP GETBULK, from the list of Varbinds, the single
+next lexico instance is fetched for the first n Varbinds
+as defined by <non-repeaters>. For remaining Varbinds,
+the m lexico instances are retrieved each of the remaining
+Varbinds, where m is <max-repeaters>.
+
+=item $sess->bulkwalk(E<lt>non-repeatersE<gt>, E<lt>max-repeatersE<gt>, E<lt>varsE<gt> [,E<lt>callbackE<gt>])
+
+Do a "bulkwalk" of the list of Varbinds. This is done by
+sending a GETBULK request (see getbulk() above) for the
+Varbinds. For each requested variable, the response is
+examined to see if the next lexico instance has left the
+requested sub-tree. Any further instances returned for
+this variable are ignored, and the walk for that sub-tree
+is considered complete.
+
+If any sub-trees were not completed when the end of the
+responses is reached, another request is composed, consisting
+of the remaining variables. This process is repeated until
+all sub-trees have been completed, or too many packets have
+been exchanged (to avoid loops).
+
+The bulkwalk() method returns an array containing an array of
+Varbinds, one for each requested variable, in the order of the
+variable requests. Upon error, bulkwalk() returns undef and
+sets $sess->ErrorStr and $sess->ErrorNum. If a callback is
+supplied, bulkwalk() returns the SNMP request id, and returns
+immediately. The callback will be called with the supplied
+argument list and the returned variables list.
+
+Note: Because the client must "discover" that the tree is
+complete by comparing the returned variables with those that
+were requested, there is a potential "gotcha" when using the
+max-repeaters value. Consider the following code to print a
+list of interfaces and byte counts:
+
+ $numInts = $sess->get('ifNumber.0');
+ ($desc, $in, $out) = $sess->bulkwalk(0, $numInts,
+ [['ifDescr'], ['ifInOctets'], ['ifOutOctets']]);
+
+ for $i (0..($numInts - 1)) {
+ printf "Interface %4s: %s inOctets, %s outOctets\n",
+ $$desc[$i]->val, $$in[$i]->val, $$out[$i]->val;
+ }
+
+This code will produce *two* requests to the agent -- the first
+to get the interface values, and the second to discover that all
+the information was in the first packet. To get around this,
+use '$numInts + 1' for the max_repeaters value. This asks the
+agent to include one additional (unrelated) variable that signals
+the end of the sub-tree, allowing bulkwalk() to determine that
+the request is complete.
+
+=item $results = $sess->gettable(E<lt>TABLE OIDE<gt>, E<lt>OPTIONS<gt>)
+
+This will retrieve an entire table of data and return a hash reference
+to that data. The returned hash reference will have indexes of the
+OID suffixes for the index data as the key. The value for each entry
+will be another hash containing the data for a given row. The keys to
+that hash will be the column names, and the values will be the data.
+
+Example:
+
+ #!/usr/bin/perl
+
+ use SNMP;
+ use Data::Dumper;
+
+ my $s = new SNMP::Session(DestHost => 'localhost');
+
+ print Dumper($s->gettable('ifTable'));
+
+On my machine produces:
+
+ $VAR1 = {
+ '6' => {
+ 'ifMtu' => '1500',
+ 'ifPhysAddress' => 'PV',
+ # ...
+ 'ifInUnknownProtos' => '0'
+ },
+ '4' => {
+ 'ifMtu' => '1480',
+ 'ifPhysAddress' => '',
+ # ...
+ 'ifInUnknownProtos' => '0'
+ },
+ # ...
+ };
+
+By default, it will try to do as optimized retrieval as possible.
+It'll request multiple columns at once, and use GETBULK if possible.
+A few options may be specified by passing in an I<OPTIONS> hash
+containing various parameters:
+
+=over
+
+=item noindexes => 1
+
+Instructs the code not to parse the indexes and place the results in
+the second hash. If you don't need the index data, this will be
+faster.
+
+=item columns => [ colname1, ... ]
+
+This specifies which columns to collect. By default, it will try to
+collect all the columns defined in the MIB table.
+
+=item repeat => I<COUNT>
+
+Specifies a GETBULK repeat I<COUNT>. IE, it will request this many
+varbinds back per column when using the GETBULK operation. Shortening
+this will mean smaller packets which may help going through some
+systems. By default, this value is calculated and attempts to guess
+at what will fit all the results into 1000 bytes. This calculation is
+fairly safe, hopefully, but you can either raise or lower the number
+using this option if desired. In lossy networks, you want to make
+sure that the packets don't get fragmented and lowering this value is
+one way to help that.
+
+=item nogetbulk => 1
+
+Force the use of GETNEXT rather than GETBULK. (always true for
+SNMPv1, as it doesn't have GETBULK anyway). Some agents are great
+implementers of GETBULK and this allows you to force the use of
+GETNEXT operations instead.
+
+=item callback => \&subroutine
+
+=item callback => [\&subroutine, optarg1, optarg2, ...]
+
+If a callback is specified, gettable will return quickly without
+returning results. When the results are finally retrieved the
+callback subroutine will be called (see the other sections defining
+callback behaviour and how to make use of SNMP::MainLoop which is
+required fro this to work). An additional argument of the normal hash
+result will be added to the callback subroutine arguments.
+
+Note 1: internally, the gettable function uses it's own callbacks
+which are passed to getnext/getbulk as appropriate.
+
+Note 2: callback support is only available in the SNMP module version
+5.04 and above. To test for this in code intending to support both
+versions prior to 5.04 and 5.04 and up, the following should work:
+
+ if ($response = $sess->gettable('ifTable', callback => \&my_sub)) {
+ # got a response, gettable doesn't support callback
+ my_sub($response);
+ $no_mainloop = 1;
+ }
+
+Deciding on whether to use SNMP::MainLoop is left as an exercise to
+the reader since it depends on whether your code uses other callbacks
+as well.
+
+=back
+
+=back
+
+=head1 SNMP::TrapSession
+
+$sess = new SNMP::Session(DestHost => 'host', ...)
+
+supports all applicable fields from SNMP::Session
+(see above)
+
+=head2 SNMP::TrapSession methods
+
+=over
+
+=item $sess->trap(enterprise, agent, generic, specific, uptime, <vars>)
+
+ $sess->trap(enterprise=>'.1.3.6.1.4.1.2021', # or 'ucdavis' [default]
+ agent => '127.0.0.1', # or 'localhost',[dflt 1st intf on host]
+ generic => specific, # can be omitted if 'specific' supplied
+ specific => 5, # can be omitted if 'generic' supplied
+ uptime => 1234, # dflt to localhost uptime (0 on win32)
+ [[ifIndex, 1, 1],[sysLocation, 0, "here"]]); # optional vars
+ # always last
+
+=item trap(oid, uptime, <vars>) - v2 format
+
+ $sess->trap(oid => 'snmpRisingAlarm',
+ uptime => 1234,
+ [[ifIndex, 1, 1],[sysLocation, 0, "here"]]); # optional vars
+ # always last
+
+=back
+
+=head1 Acceptable variable formats:
+
+<vars> may be one of the following forms:
+
+=over
+
+=item SNMP::VarList
+
+represents an array of MIB objects to get or set,
+implemented as a blessed reference to an array of
+SNMP::Varbinds, (e.g., [<varbind1>, <varbind2>, ...])
+
+=item SNMP::Varbind
+
+represents a single MIB object to get or set, implemented as
+a blessed reference to a 4 element array;
+[<obj>, <iid>, <val>, <type>].
+
+=over
+
+=item <obj>
+
+one of the following forms:
+
+=over
+
+=item 1)
+
+leaf identifier (e.g., 'sysDescr') assumed to be
+unique for practical purposes
+
+=item 2)
+
+fully qualified identifier (e.g.,
+'.iso.org.dod.internet.mgmt.mib-2.system.sysDescr')
+
+=item 3)
+
+fully qualified, dotted-decimal, numeric OID (e.g.,
+'.1.3.6.1.2.1.1.1')
+
+=back
+
+=item <iid>
+
+the dotted-decimal, instance identifier. for
+scalar MIB objects use '0'
+
+=item <val>
+
+the SNMP data value retrieved from or being set
+to the agents MIB. for (f)get(next) operations
+<val> may have a variety of formats as determined by
+session and package settings. However for set
+operations the <val> format must be canonical to
+ensure unambiguous translation. The canonical forms
+are as follows:
+
+=over
+
+=item OBJECTID
+
+dotted-decimal (e.g., .1.3.6.1.2.1.1.1)
+
+=item OCTETSTR
+
+perl scalar containing octets
+
+=item INTEGER
+
+decimal signed integer (or enum)
+
+=item NETADDR
+
+dotted-decimal
+
+=item IPADDR
+
+dotted-decimal
+
+=item COUNTER
+
+decimal unsigned integer
+
+=item COUNTER64
+
+decimal unsigned integer
+
+=item GAUGE
+
+decimal unsigned integer
+
+=item UINTEGER
+
+decimal unsigned integer
+
+=item TICKS
+
+decimal unsigned integer
+
+=item OPAQUE
+
+perl scalar containing octets
+
+=item NULL
+
+perl scalar containing nothing
+
+=back
+
+=item <type>
+
+SNMP data type (see list above), this field is
+populated by 'get' and 'getnext' operations. In
+some cases the programmer needs to populate this
+field when passing to a 'set' operation. this
+field need not be supplied when the attribute
+indicated by <tag> is already described by loaded
+Mib modules. for 'set's, if a numeric OID is used
+and the object is not currently in the loaded Mib,
+the <type> field must be supplied
+
+=back
+
+=item simple string
+
+light weight form of <var> used to 'set' or 'get' a
+single attribute without constructing an SNMP::Varbind.
+stored in a perl scalar, has the form '<tag>.<iid>',
+(e.g., 'sysDescr.0'). for 'set' operations the value
+is passed as a second arg. Note: This argument form is
+not updated in get[next] operations as are the other forms.
+
+=back
+
+=head1 Acceptable callback formats
+
+<callback> may be one of the following forms:
+
+=over
+
+=item without arguments
+
+=over
+
+=item \&subname
+
+=item sub { ... }
+
+=back
+
+=item or with arguments
+
+=over
+
+=item [ \&subname, $arg1, ... ]
+
+=item [ sub { ... }, $arg1, ... ]
+
+=item [ "method", $obj, $arg1, ... ]
+
+=back
+
+=back
+
+callback will be called when response is received or timeout
+occurs. the last argument passed to callback will be a
+SNMP::VarList reference. In case of timeout the last argument
+will be undef.
+
+=over
+
+=item &SNMP::MainLoop([<timeout>, [<callback>]])
+
+to be used with async SNMP::Session
+calls. MainLoop must be called after initial async calls
+so return packets from the agent will not be processed.
+If no args supplied this function enters an infinite loop
+so program must be exited in a callback or externally
+interrupted. If <timeout(sic)
+
+=item &SNMP::finish()
+
+This function, when called from an SNMP::MainLoop() callback
+function, will cause the current SNMP::MainLoop() to return
+after the callback is completed. finish() can be used to
+terminate an otherwise-infinite MainLoop. A new MainLoop()
+instance can then be started to handle further requests.
+
+=back
+
+=head1 SNMP package variables and functions
+
+=over
+
+=item $SNMP::VERSION
+
+the current version specifier (e.g., 3.1.0)
+
+=item $SNMP::auto_init_mib
+
+default '1', set to 0 to disable automatic reading
+of the MIB upon session creation. set to non-zero
+to call initMib at session creation which will result
+in MIB loading according to Net-SNMP env. variables (see
+man mib_api)
+
+=item $SNMP::verbose
+
+default '0', controls warning/info output of
+SNMP module, 0 => no output, 1 => enables warning/info
+output from SNMP module itself (is also controlled
+by SNMP::debugging - see below)
+
+=item $SNMP::use_long_names
+
+default '0', set to non-zero to enable the use of
+longer Mib identifiers. see translateObj. will also
+influence the formatting of <tag> in varbinds returned
+from 'getnext' operations. Can be set on a per session
+basis (UseLongNames)
+
+=item $SNMP::use_sprint_value
+
+default '0', set to non-zero to enable formatting of
+response values using the snmp libraries snprint_value
+function. can also be set on a per session basis (see
+UseSprintValue) Note: returned values may not be
+suitable for 'set' operations
+
+=item $SNMP::use_enums
+
+default '0',set non-zero to return values as enums and
+allow sets using enums where appropriate. integer data
+will still be accepted for set operations. can also be
+set on a per session basis (see UseEnums)
+
+=item $SNMP::use_numeric
+
+default to '0',set to non-zero to have <tags> for 'get'
+methods returned as numeric OID's rather than descriptions.
+UseLongNames will be set so that the entire OID will be
+returned. Set on a per-session basis (see UseNumeric).
+
+=item $SNMP::best_guess
+
+default '0'. This setting controls how <tags> are
+parsed. Setting to 0 causes a regular lookup. Setting
+to 1 causes a regular expression match (defined as -Ib
+in snmpcmd) and setting to 2 causes a random access
+lookup (defined as -IR in snmpcmd). Can also be set
+on a per session basis (see BestGuess)
+
+=item $SNMP::save_descriptions
+
+default '0',set non-zero to have mib parser save
+attribute descriptions. must be set prior to mib
+initialization
+
+=item $SNMP::debugging
+
+default '0', controls debugging output level
+within SNMP module and libsnmp
+
+=over
+
+=item 1
+
+enables 'SNMP::verbose' (see above)
+
+=item 2
+
+level 1 plus snmp_set_do_debugging(1)
+
+=item 3
+
+level 2 plus snmp_set_dump_packet(1)
+
+=back
+
+=item $SNMP::dump_packet
+
+default '0', set [non-]zero to independently set
+snmp_set_dump_packet()
+
+=item SNMP::register_debug_tokens()
+
+Allows to register one or more debug tokens, just like the -D option of snmpd.
+Each debug token enables a group of debug statements. An example:
+SNMP::register_debug_tokens("tdomain,netsnmp_unix");
+
+=back
+
+=head1 %SNMP::MIB
+
+a tied hash to access parsed MIB information. After
+the MIB has been loaded this hash allows access to
+to the parsed in MIB meta-data(the structure of the
+MIB (i.e., schema)). The hash returns blessed
+references to SNMP::MIB::NODE objects which represent
+a single MIB attribute. The nodes can be fetched with
+multiple 'key' formats - the leaf name (e.g.,sysDescr)
+or fully/partially qualified name (e.g.,
+system.sysDescr) or fully qualified numeric OID. The
+returned node object supports the following fields:
+
+=over
+
+=item objectID
+
+dotted decimal fully qualified OID
+
+=item label
+
+leaf textual identifier (e.g., 'sysDescr')
+
+=item subID
+
+leaf numeric OID component of objectID (e.g., '1')
+
+=item moduleID
+
+textual identifier for module (e.g., 'RFC1213-MIB')
+
+=item parent
+
+parent node
+
+=item children
+
+array reference of children nodes
+
+=item nextNode
+
+next lexico node B<(BUG!does not return in lexico order)>
+
+=item type
+
+returns application type (see getType for values)
+
+=item access
+
+returns ACCESS (ReadOnly, ReadWrite, WriteOnly,
+NoAccess, Notify, Create)
+
+=item status
+
+returns STATUS (Mandatory, Optional, Obsolete,
+Deprecated)
+
+=item syntax
+
+returns 'textualConvention' if defined else 'type'
+
+=item textualConvention
+
+returns TEXTUAL-CONVENTION
+
+=item TCDescription
+
+returns the TEXTUAL-CONVENTION's DESCRIPTION field.
+
+=item units
+
+returns UNITS
+
+=item hint
+
+returns HINT
+
+=item enums
+
+returns hash ref {tag => num, ...}
+
+=item ranges
+
+returns array ref of hash ref [{low => num, high => num}, ...]
+
+=item description
+
+returns DESCRIPTION ($SNMP::save_descriptions must
+be set prior to MIB initialization/parsing)
+
+=item reference
+
+returns the REFERENCE clause
+
+=item indexes
+
+returns the objects in the INDEX clause
+
+=item implied
+
+returns true if the last object in the INDEX is IMPLIED
+
+=back
+
+=head1 MIB Functions
+
+=over
+
+=item &SNMP::setMib(<file>)
+
+allows dynamic parsing of the mib and explicit
+specification of mib file independent of environment
+variables. called with no args acts like initMib,
+loading MIBs indicated by environment variables (see
+Net-SNMP mib_api docs). passing non-zero second arg
+forces previous mib to be freed and replaced
+B<(Note: second arg not working since freeing previous
+Mib is more involved than before)>.
+
+=item &SNMP::initMib()
+
+calls library init_mib function if Mib not already
+loaded - does nothing if Mib already loaded. will
+parse directories and load modules according to
+environment variables described in Net-SNMP documentations.
+(see man mib_api, MIBDIRS, MIBS, MIBFILE(S), etc.)
+
+=item &SNMP::addMibDirs(<dir>,...)
+
+calls library add_mibdir for each directory
+supplied. will cause directory(s) to be added to
+internal list and made available for searching in
+subsequent loadModules calls
+
+=item &SNMP::addMibFiles(<file>,...)
+
+calls library read_mib function. The file(s)
+supplied will be read and all Mib module definitions
+contained therein will be added to internal mib tree
+structure
+
+=item &SNMP::loadModules(<mod>,...)
+
+calls library read_module function. The
+module(s) supplied will be searched for in the
+current mibdirs and and added to internal mib tree
+structure. Passing special <mod>, 'ALL', will cause
+all known modules to be loaded.
+
+=item &SNMP::unloadModules(<mod>,...)
+
+B<*Not Implemented*>
+
+=item &SNMP::translateObj(<var>[,arg,[arg]])
+
+will convert a text obj tag to an OID and vice-versa.
+Any iid suffix is retained numerically. Default
+behaviour when converting a numeric OID to text
+form is to return leaf identifier only
+(e.g.,'sysDescr') but when $SNMP::use_long_names
+is non-zero or a non-zero second arg is supplied it
+will return a longer textual identifier. An optional
+third argument of non-zero will cause the module name
+to be prepended to the text name (e.g.
+'SNMPv2-MIB::sysDescr'). When converting a text obj,
+the $SNMP::best_guess option is used. If no Mib is
+loaded when called and $SNMP::auto_init_mib is enabled
+then the Mib will be loaded. Will return 'undef' upon
+failure.
+
+=item &SNMP::getType(<var>)
+
+return SNMP data type for given textual identifier
+OBJECTID, OCTETSTR, INTEGER, NETADDR, IPADDR, COUNTER
+GAUGE, TIMETICKS, OPAQUE, or undef
+
+=item &SNMP::mapEnum(<var>)
+
+converts integer value to enumertion tag defined
+in Mib or converts tag to integer depending on
+input. the function will return the corresponding
+integer value *or* tag for a given MIB attribute
+and value. The function will sense which direction
+to perform the conversion. Various arg formats are
+supported
+
+=over
+
+=item $val = SNMP::mapEnum($varbind);
+
+where $varbind is SNMP::Varbind or equiv.
+note: $varbind will be updated
+
+=item $val = SNMP::mapEnum('ipForwarding', 'forwarding');
+
+=item $val = SNMP::mapEnum('ipForwarding', 1);
+
+=back
+
+=back
+
+=head1 Exported SNMP utility functions
+
+Note: utility functions do not support async operation yet.
+
+=over
+
+=item &snmp_get()
+
+takes args of SNMP::Session::new followed by those of
+SNMP::Session::get
+
+=item &snmp_getnext()
+
+takes args of SNMP::Session::new followed by those of
+SNMP::Session::getnext
+
+=item &snmp_set()
+
+takes args of SNMP::Session::new followed by those of
+SNMP::Session::set
+
+=item &snmp_trap()
+
+takes args of SNMP::TrapSession::new followed by those of
+SNMP::TrapSession::trap
+
+=back
+
+=head1 Trouble Shooting
+
+If problems occur there are number areas to look at to narrow down the
+possibilities.
+
+The first step should be to test the Net-SNMP installation
+independently from the Perl5 SNMP interface.
+
+Try running the apps from the Net-SNMP distribution.
+
+Make sure your agent (snmpd) is running and properly configured with
+read-write access for the community you are using.
+
+Ensure that your MIBs are installed and enviroment variables are set
+appropriately (see man mib_api)
+
+Be sure to remove old net-snmp installations and ensure headers and
+libraries from old CMU installations are not being used by mistake.
+
+If the problem occurs during compilation/linking check that the snmp
+library being linked is actually the Net-SNMP library (there have been
+name conflicts with existing snmp libs).
+
+Also check that the header files are correct and up to date.
+
+Sometimes compiling the Net-SNMP library with
+'position-independent-code' enabled is required (HPUX specifically).
+
+If you cannot resolve the problem you can post to
+comp.lang.perl.modules or
+net-snmp-users@net-snmp-users@lists.sourceforge.net
+
+please give sufficient information to analyze the problem (OS type,
+versions for OS/Perl/Net-SNMP/compiler, complete error output, etc.)
+
+=head1 Acknowledgements
+
+Many thanks to all those who supplied patches, suggestions and
+feedback.
+
+ Joe Marzot (the original author)
+ Wes Hardaker and the net-snmp-coders
+ Dave Perkins
+ Marcel Wiget
+ David Blackburn
+ John Stofell
+ Gary Hayward
+ Claire Harrison
+ Achim Bohnet
+ Doug Kingston
+ Jacques Vidrine
+ Carl Jacobsen
+ Wayne Marquette
+ Scott Schumate
+ Michael Slifcak
+ Srivathsan Srinivasagopalan
+ Bill Fenner
+ Jef Peeraer
+ Daniel Hagerty
+ Karl "Rat" Schilke and Electric Lightwave, Inc.
+ Perl5 Porters
+ Alex Burger
+
+Apologies to any/all who's patch/feature/request was not mentioned or
+included - most likely it was lost when paying work intruded on my
+fun. Please try again if you do not see a desired feature. This may
+actually turn out to be a decent package with such excellent help and
+the fact that I have more time to work on it than in the past.
+
+=head1 AUTHOR
+
+bugs, comments, questions to net-snmp-users@lists.sourceforge.net
+
+=head1 Copyright
+
+ Copyright (c) 1995-2000 G. S. Marzot. All rights reserved.
+ This program is free software; you can redistribute it and/or
+ modify it under the same terms as Perl itself.
+
+ Copyright (c) 2001-2002 Networks Associates Technology, Inc. All
+ Rights Reserved. This program is free software; you can
+ redistribute it and/or modify it under the same terms as Perl
+ itself.
+
+=cut
diff --git a/perl/SNMP/SNMP.xs b/perl/SNMP/SNMP.xs
new file mode 100644
index 0000000..b4f35c8
--- /dev/null
+++ b/perl/SNMP/SNMP.xs
@@ -0,0 +1,5473 @@
+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*-
+ SNMP.xs -- Perl 5 interface to the Net-SNMP toolkit
+
+ written by G. S. Marzot (marz@users.sourceforge.net)
+
+ Copyright (c) 1995-2006 G. S. Marzot. All rights reserved.
+ This program is free software; you can redistribute it and/or
+ modify it under the same terms as Perl itself.
+*/
+#define WIN32SCK_IS_STDSCK
+#if defined(_WIN32) && !defined(_WIN32_WINNT)
+#define _WIN32_WINNT 0x501
+#endif
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <sys/types.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#ifndef MSVC_PERL
+ #include <signal.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#ifdef I_SYS_TIME
+#include <sys/time.h>
+#endif
+#include <netdb.h>
+#include <stdlib.h>
+#ifndef MSVC_PERL
+ #include <unistd.h>
+#endif
+
+#ifdef HAVE_REGEX_H
+#include <regex.h>
+#endif
+
+#ifndef __P
+#define __P(x) x
+#endif
+
+#ifndef na
+#define na PL_na
+#endif
+
+#ifndef sv_undef
+#define sv_undef PL_sv_undef
+#endif
+
+#ifndef stack_base
+#define stack_base PL_stack_base
+#endif
+
+#ifndef G_VOID
+#define G_VOID G_DISCARD
+#endif
+
+#include "perlsnmp.h"
+
+#define SUCCESS 1
+#define FAILURE 0
+
+#define ZERO_BUT_TRUE "0 but true"
+
+#define SNMP_API_TRADITIONAL 0
+#define SNMP_API_SINGLE 1
+
+#define VARBIND_TAG_F 0
+#define VARBIND_IID_F 1
+#define VARBIND_VAL_F 2
+#define VARBIND_TYPE_F 3
+
+#define TYPE_UNKNOWN 0
+#define MAX_TYPE_NAME_LEN 32
+#define STR_BUF_SIZE (MAX_TYPE_NAME_LEN * MAX_OID_LEN)
+#define ENG_ID_BUF_SIZE 32
+
+#define SYS_UPTIME_OID_LEN 9
+#define SNMP_TRAP_OID_LEN 11
+#define NO_RETRY_NOSUCH 0
+static oid sysUpTime[SYS_UPTIME_OID_LEN] = {1, 3, 6, 1, 2, 1, 1, 3, 0};
+static oid snmpTrapOID[SNMP_TRAP_OID_LEN] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};
+
+/* Internal flag to determine snmp_main_loop() should return after callback */
+static int mainloop_finish = 0;
+
+/* Internal flag to determine which API we're using */
+static int api_mode = SNMP_API_TRADITIONAL;
+
+/* these should be part of transform_oids.h ? */
+#define USM_AUTH_PROTO_MD5_LEN 10
+#define USM_AUTH_PROTO_SHA_LEN 10
+#define USM_PRIV_PROTO_DES_LEN 10
+
+/* why does ucd-snmp redefine sockaddr_in ??? */
+#define SIN_ADDR(snmp_addr) (((struct sockaddr_in *) &(snmp_addr))->sin_addr)
+
+typedef netsnmp_session SnmpSession;
+typedef struct tree SnmpMibNode;
+typedef struct snmp_xs_cb_data {
+ SV* perl_cb;
+ SV* sess_ref;
+} snmp_xs_cb_data;
+
+static void __recalc_timeout _((struct timeval*,struct timeval*,
+ struct timeval*,struct timeval*, int* ));
+static int __is_numeric_oid _((char*));
+static int __is_leaf _((struct tree*));
+static int __translate_appl_type _((char*));
+static int __translate_asn_type _((int));
+static int __snprint_value _((char *, size_t,
+ netsnmp_variable_list*, struct tree *,
+ int, int));
+static int __sprint_num_objid _((char *, oid *, int));
+static int __scan_num_objid _((char *, oid *, size_t *));
+static int __get_type_str _((int, char *));
+static int __get_label_iid _((char *, char **, char **, int));
+static int __oid_cmp _((oid *, size_t, oid *, size_t));
+static int __tp_sprint_num_objid _((char*,SnmpMibNode *));
+static SnmpMibNode * __get_next_mib_node _((SnmpMibNode *));
+static struct tree * __tag2oid _((char *, char *, oid *, size_t *, int *, int));
+static int __concat_oid_str _((oid *, size_t *, char *));
+static int __add_var_val_str _((netsnmp_pdu *, oid *, size_t, char *,
+ int, int));
+static int __send_sync_pdu _((netsnmp_session *, netsnmp_pdu *,
+ netsnmp_pdu **, int , SV *, SV *, SV *));
+static int __snmp_xs_cb __P((int, netsnmp_session *, int,
+ netsnmp_pdu *, void *));
+static SV* __push_cb_args2 _((SV * sv, SV * esv, SV * tsv));
+#define __push_cb_args(a,b) __push_cb_args2(a,b,NULL)
+static int __call_callback _((SV * sv, int flags));
+static char* __av_elem_pv _((AV * av, I32 key, char *dflt));
+
+#define USE_NUMERIC_OIDS 0x08
+#define NON_LEAF_NAME 0x04
+#define USE_LONG_NAMES 0x02
+#define FAIL_ON_NULL_IID 0x01
+#define NO_FLAGS 0x00
+
+/* Structures used by snmp_bulkwalk method to track requested OID's/subtrees. */
+typedef struct bulktbl {
+ oid req_oid[MAX_OID_LEN]; /* The OID originally requested. */
+ oid last_oid[MAX_OID_LEN]; /* Last-seen OID under this branch. */
+ AV *vars; /* Array of Varbinds for this OID. */
+ size_t req_len; /* Length of requested OID. */
+ size_t last_len; /* Length of last-seen OID. */
+ char norepeat; /* Is this a non-repeater OID? */
+ char complete; /* Non-zero if this tree complete. */
+ char ignore; /* Ignore this OID, not requested. */
+} bulktbl;
+
+/* Context for bulkwalk() sessions. Used to store state across callbacks. */
+typedef struct walk_context {
+ SV *sess_ref; /* Reference to Perl SNMP session object. */
+ SV *perl_cb; /* Pointer to Perl callback func or array. */
+ bulktbl *req_oids; /* Pointer to bulktbl[] for requested OIDs. */
+ bulktbl *repbase; /* Pointer to first repeater in req_oids[]. */
+ bulktbl *reqbase; /* Pointer to start of requests req_oids[]. */
+ int nreq_oids; /* Number of valid bulktbls in req_oids[]. */
+ int req_remain; /* Number of outstanding requests remaining */
+ int non_reps; /* Number of nonrepeater vars in req_oids[] */
+ int repeaters; /* Number of repeater vars in req_oids[]. */
+ int max_reps; /* Maximum repetitions of variable per PDU. */
+ int exp_reqid; /* Expect a response to this request only. */
+ int getlabel_f; /* Flag long/numeric names for get_label(). */
+ int sprintval_f; /* Flag enum/sprint values for sprintval(). */
+ int pkts_exch; /* Number of packet exchanges with agent. */
+ int oid_total; /* Total number of OIDs received this walk. */
+ int oid_saved; /* Total number of OIDs saved as results. */
+} walk_context;
+
+/* Prototypes for bulkwalk support functions. */
+static netsnmp_pdu *_bulkwalk_send_pdu _((walk_context *context));
+static int _bulkwalk_done _((walk_context *context));
+static int _bulkwalk_recv_pdu _((walk_context *context, netsnmp_pdu *pdu));
+static int _bulkwalk_finish _((walk_context *context, int okay));
+static int _bulkwalk_async_cb _((int op, SnmpSession *ss, int reqid,
+ netsnmp_pdu *pdu, void *context_ptr));
+
+/* Prototype for error handler */
+void snmp_return_err( struct snmp_session *ss, SV *err_str, SV *err_num, SV *err_ind );
+
+/* Structure to hold valid context sessions. */
+struct valid_contexts {
+ walk_context **valid; /* Array of valid walk_context pointers. */
+ int sz_valid; /* Maximum size of valid contexts array. */
+ int num_valid; /* Count of valid contexts in the array. */
+};
+static struct valid_contexts *_valid_contexts = NULL;
+static int _context_add _((walk_context *context));
+static int _context_del _((walk_context *context));
+static int _context_okay _((walk_context *context));
+
+/* Wrapper around fprintf(stderr, ...) for clean and easy debug output. */
+#ifdef DEBUGGING
+static int _debug_level = 0;
+#define DBOUT PerlIO_stderr(),
+#define DBPRT(severity, otherargs) \
+ do { \
+ if (_debug_level && severity <= _debug_level) { \
+ (void)PerlIO_printf otherargs; \
+ } \
+ } while (/*CONSTCOND*/0)
+
+char _debugx[1024]; /* Space to sprintf() into - used by sprint_objid(). */
+
+/* wrapper around snprint_objid to snprint_objid to return the pointer
+ instead of length */
+
+static char *
+__snprint_oid(const oid *objid, size_t objidlen) {
+ snprint_objid(_debugx, sizeof(_debugx), objid, objidlen);
+ return _debugx;
+}
+
+#define DBDCL(x) x
+#else /* DEBUGGING */
+#define DBDCL(x)
+#define DBOUT
+/* Do nothing but in such a way that the compiler sees "otherargs". */
+#define DBPRT(severity, otherargs) \
+ do { if (0) printf otherargs; } while(0)
+
+static char *
+__snprint_oid(const oid *objid, size_t objidlen)
+{
+ return "(debugging is disabled)";
+}
+
+#endif /* DEBUGGING */
+
+void
+__libraries_init(char *appname)
+ {
+ static int have_inited = 0;
+
+ if (have_inited)
+ return;
+ have_inited = 1;
+
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT, 1);
+ init_snmp(appname);
+
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS, 1);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY, 1);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_SUFFIX);
+ SOCK_STARTUP;
+
+ }
+
+static void
+__recalc_timeout (tvp, ctvp, ltvp, itvp, block)
+struct timeval* tvp;
+struct timeval* ctvp;
+struct timeval* ltvp;
+struct timeval* itvp;
+int *block;
+{
+ struct timeval now;
+
+ if (!timerisset(itvp)) return; /* interval zero means loop forever */
+ *block = 0;
+ gettimeofday(&now,(struct timezone *)0);
+
+ if (ctvp->tv_sec < 0) { /* first time or callback just fired */
+ timersub(&now,ltvp,ctvp);
+ timersub(ctvp,itvp,ctvp);
+ timersub(itvp,ctvp,ctvp);
+ timeradd(ltvp,itvp,ltvp);
+ } else {
+ timersub(&now,ltvp,ctvp);
+ timersub(itvp,ctvp,ctvp);
+ }
+
+ /* flag is set for callback but still hasnt fired so set to something
+ * small and we will service packets first if there are any ready
+ * (also guard against negative timeout - should never happen?)
+ */
+ if (!timerisset(ctvp) || ctvp->tv_sec < 0 || ctvp->tv_usec < 0) {
+ ctvp->tv_sec = 0;
+ ctvp->tv_usec = 10;
+ }
+
+ /* if snmp timeout > callback timeout or no more requests to process */
+ if (timercmp(tvp, ctvp, >) || !timerisset(tvp)) {
+ *tvp = *ctvp; /* use the smaller non-zero timeout */
+ timerclear(ctvp); /* used as a flag to let callback fire on timeout */
+ }
+}
+
+static int
+__is_numeric_oid (oidstr)
+char* oidstr;
+{
+ if (!oidstr) return 0;
+ for (; *oidstr; oidstr++) {
+ if (isalpha((int)*oidstr)) return 0;
+ }
+ return(1);
+}
+
+static int
+__is_leaf (tp)
+struct tree* tp;
+{
+ char buf[MAX_TYPE_NAME_LEN];
+ return (tp && __get_type_str(tp->type,buf));
+}
+
+static SnmpMibNode*
+__get_next_mib_node (tp)
+SnmpMibNode* tp;
+{
+ /* printf("tp = %lX, parent = %lX, peer = %lX, child = %lX\n",
+ tp, tp->parent, tp->next_peer, tp->child_list); */
+ if (tp->child_list) return(tp->child_list);
+ if (tp->next_peer) return(tp->next_peer);
+ if (!tp->parent) return(NULL);
+ for (tp = tp->parent; !tp->next_peer; tp = tp->parent) {
+ if (!tp->parent) return(NULL);
+ }
+ return(tp->next_peer);
+}
+
+static int
+__translate_appl_type(typestr)
+char* typestr;
+{
+ if (typestr == NULL || *typestr == '\0') return TYPE_UNKNOWN;
+
+ if (!strncasecmp(typestr,"INTEGER32",8))
+ return(TYPE_INTEGER32);
+ if (!strncasecmp(typestr,"INTEGER",3))
+ return(TYPE_INTEGER);
+ if (!strncasecmp(typestr,"UNSIGNED32",3))
+ return(TYPE_UNSIGNED32);
+ if (!strcasecmp(typestr,"COUNTER")) /* check all in case counter64 */
+ return(TYPE_COUNTER);
+ if (!strncasecmp(typestr,"GAUGE",3))
+ return(TYPE_GAUGE);
+ if (!strncasecmp(typestr,"IPADDR",3))
+ return(TYPE_IPADDR);
+ if (!strncasecmp(typestr,"OCTETSTR",3))
+ return(TYPE_OCTETSTR);
+ if (!strncasecmp(typestr,"TICKS",3))
+ return(TYPE_TIMETICKS);
+ if (!strncasecmp(typestr,"OPAQUE",3))
+ return(TYPE_OPAQUE);
+ if (!strncasecmp(typestr,"OBJECTID",3))
+ return(TYPE_OBJID);
+ if (!strncasecmp(typestr,"NETADDR",3))
+ return(TYPE_NETADDR);
+ if (!strncasecmp(typestr,"COUNTER64",3))
+ return(TYPE_COUNTER64);
+ if (!strncasecmp(typestr,"NULL",3))
+ return(TYPE_NULL);
+ if (!strncasecmp(typestr,"BITS",3))
+ return(TYPE_BITSTRING);
+ if (!strncasecmp(typestr,"ENDOFMIBVIEW",3))
+ return(SNMP_ENDOFMIBVIEW);
+ if (!strncasecmp(typestr,"NOSUCHOBJECT",7))
+ return(SNMP_NOSUCHOBJECT);
+ if (!strncasecmp(typestr,"NOSUCHINSTANCE",7))
+ return(SNMP_NOSUCHINSTANCE);
+ if (!strncasecmp(typestr,"UINTEGER",3))
+ return(TYPE_UINTEGER); /* historic - should not show up */
+ /* but it does? */
+ if (!strncasecmp(typestr, "NOTIF", 3))
+ return(TYPE_NOTIFTYPE);
+ if (!strncasecmp(typestr, "TRAP", 4))
+ return(TYPE_TRAPTYPE);
+ return(TYPE_UNKNOWN);
+}
+
+static int
+__translate_asn_type(type)
+int type;
+{
+ switch (type) {
+ case ASN_INTEGER:
+ return(TYPE_INTEGER);
+ break;
+ case ASN_OCTET_STR:
+ return(TYPE_OCTETSTR);
+ break;
+ case ASN_OPAQUE:
+ return(TYPE_OPAQUE);
+ break;
+ case ASN_OBJECT_ID:
+ return(TYPE_OBJID);
+ break;
+ case ASN_TIMETICKS:
+ return(TYPE_TIMETICKS);
+ break;
+ case ASN_GAUGE:
+ return(TYPE_GAUGE);
+ break;
+ case ASN_COUNTER:
+ return(TYPE_COUNTER);
+ break;
+ case ASN_IPADDRESS:
+ return(TYPE_IPADDR);
+ break;
+ case ASN_BIT_STR:
+ return(TYPE_BITSTRING);
+ break;
+ case ASN_NULL:
+ return(TYPE_NULL);
+ break;
+ /* no translation for these exception type values */
+ case SNMP_ENDOFMIBVIEW:
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ return(type);
+ break;
+ case ASN_UINTEGER:
+ return(TYPE_UINTEGER);
+ break;
+ case ASN_COUNTER64:
+ return(TYPE_COUNTER64);
+ break;
+ default:
+ warn("translate_asn_type: unhandled asn type (%d)\n",type);
+ return(TYPE_OTHER);
+ break;
+ }
+}
+
+#define USE_BASIC 0
+#define USE_ENUMS 1
+#define USE_SPRINT_VALUE 2
+static int
+__snprint_value (buf, buf_len, var, tp, type, flag)
+char * buf;
+size_t buf_len;
+netsnmp_variable_list * var;
+struct tree * tp;
+int type;
+int flag;
+{
+ int len = 0;
+ u_char* ip;
+ struct enum_list *ep;
+
+
+ buf[0] = '\0';
+ if (flag == USE_SPRINT_VALUE) {
+ snprint_value(buf, buf_len, var->name, var->name_length, var);
+ len = strlen(buf);
+ } else {
+ switch (var->type) {
+ case ASN_INTEGER:
+ if (flag == USE_ENUMS) {
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (ep->value == *var->val.integer) {
+ strlcpy(buf, ep->label, buf_len);
+ len = strlen(buf);
+ break;
+ }
+ }
+ }
+ if (!len) {
+ snprintf(buf, buf_len, "%ld", *var->val.integer);
+ buf[buf_len-1] = '\0';
+ len = strlen(buf);
+ }
+ break;
+
+ case ASN_GAUGE:
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ snprintf(buf, buf_len, "%lu", (unsigned long) *var->val.integer);
+ buf[buf_len-1] = '\0';
+ len = strlen(buf);
+ break;
+
+ case ASN_OCTET_STR:
+ case ASN_OPAQUE:
+ len = var->val_len;
+ if ( len > buf_len )
+ len = buf_len;
+ memcpy(buf, (char*)var->val.string, len);
+ break;
+
+ case ASN_IPADDRESS:
+ ip = (u_char*)var->val.string;
+ snprintf(buf, buf_len, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
+ buf[buf_len-1] = '\0';
+ len = strlen(buf);
+ break;
+
+ case ASN_NULL:
+ break;
+
+ case ASN_OBJECT_ID:
+ __sprint_num_objid(buf, (oid *)(var->val.objid),
+ var->val_len/sizeof(oid));
+ len = strlen(buf);
+ break;
+
+ case SNMP_ENDOFMIBVIEW:
+ snprintf(buf, buf_len, "%s", "ENDOFMIBVIEW");
+ break;
+ case SNMP_NOSUCHOBJECT:
+ snprintf(buf, buf_len, "%s", "NOSUCHOBJECT");
+ break;
+ case SNMP_NOSUCHINSTANCE:
+ snprintf(buf, buf_len, "%s", "NOSUCHINSTANCE");
+ break;
+
+ case ASN_COUNTER64:
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_COUNTER64:
+ case ASN_OPAQUE_U64:
+#endif
+ printU64(buf,(struct counter64 *)var->val.counter64);
+ len = strlen(buf);
+ break;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_I64:
+ printI64(buf,(struct counter64 *)var->val.counter64);
+ len = strlen(buf);
+ break;
+#endif
+
+ case ASN_BIT_STR:
+ snprint_bitstring(buf, buf_len, var, NULL, NULL, NULL);
+ len = strlen(buf);
+ break;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_FLOAT:
+ if (var->val.floatVal)
+ snprintf(buf, buf_len, "%f", *var->val.floatVal);
+ break;
+
+ case ASN_OPAQUE_DOUBLE:
+ if (var->val.doubleVal)
+ snprintf(buf, buf_len, "%f", *var->val.doubleVal);
+ break;
+#endif
+
+ case ASN_NSAP:
+ default:
+ warn("snprint_value: asn type not handled %d\n",var->type);
+ }
+ }
+ return(len);
+}
+
+static int
+__sprint_num_objid (buf, objid, len)
+char *buf;
+oid *objid;
+int len;
+{
+ int i;
+ buf[0] = '\0';
+ for (i=0; i < len; i++) {
+ sprintf(buf,".%" NETSNMP_PRIo "u",*objid++);
+ buf += strlen(buf);
+ }
+ return SUCCESS;
+}
+
+static int
+__tp_sprint_num_objid (buf, tp)
+char *buf;
+SnmpMibNode *tp;
+{
+ oid newname[MAX_OID_LEN], *op;
+ /* code taken from get_node in snmp_client.c */
+ for (op = newname + MAX_OID_LEN - 1; op >= newname; op--) {
+ *op = tp->subid;
+ tp = tp->parent;
+ if (tp == NULL) break;
+ }
+ return __sprint_num_objid(buf, op, newname + MAX_OID_LEN - op);
+}
+
+static int
+__scan_num_objid (buf, objid, len)
+char *buf;
+oid *objid;
+size_t *len;
+{
+ char *cp;
+ *len = 0;
+ if (*buf == '.') buf++;
+ cp = buf;
+ while (*buf) {
+ if (*buf++ == '.') {
+ sscanf(cp, "%" NETSNMP_PRIo "u", objid++);
+ /* *objid++ = atoi(cp); */
+ (*len)++;
+ cp = buf;
+ } else {
+ if (isalpha((int)*buf)) {
+ return FAILURE;
+ }
+ }
+ }
+ sscanf(cp, "%" NETSNMP_PRIo "u", objid++);
+ /* *objid++ = atoi(cp); */
+ (*len)++;
+ return SUCCESS;
+}
+
+static int
+__get_type_str (type, str)
+int type;
+char * str;
+{
+ switch (type) {
+ case TYPE_OBJID:
+ strcpy(str, "OBJECTID");
+ break;
+ case TYPE_OCTETSTR:
+ strcpy(str, "OCTETSTR");
+ break;
+ case TYPE_INTEGER:
+ strcpy(str, "INTEGER");
+ break;
+ case TYPE_INTEGER32:
+ strcpy(str, "INTEGER32");
+ break;
+ case TYPE_UNSIGNED32:
+ strcpy(str, "UNSIGNED32");
+ break;
+ case TYPE_NETADDR:
+ strcpy(str, "NETADDR");
+ break;
+ case TYPE_IPADDR:
+ strcpy(str, "IPADDR");
+ break;
+ case TYPE_COUNTER:
+ strcpy(str, "COUNTER");
+ break;
+ case TYPE_GAUGE:
+ strcpy(str, "GAUGE");
+ break;
+ case TYPE_TIMETICKS:
+ strcpy(str, "TICKS");
+ break;
+ case TYPE_OPAQUE:
+ strcpy(str, "OPAQUE");
+ break;
+ case TYPE_COUNTER64:
+ strcpy(str, "COUNTER64");
+ break;
+ case TYPE_NULL:
+ strcpy(str, "NULL");
+ break;
+ case SNMP_ENDOFMIBVIEW:
+ strcpy(str, "ENDOFMIBVIEW");
+ break;
+ case SNMP_NOSUCHOBJECT:
+ strcpy(str, "NOSUCHOBJECT");
+ break;
+ case SNMP_NOSUCHINSTANCE:
+ strcpy(str, "NOSUCHINSTANCE");
+ break;
+ case TYPE_UINTEGER:
+ strcpy(str, "UINTEGER"); /* historic - should not show up */
+ /* but it does? */
+ break;
+ case TYPE_NOTIFTYPE:
+ strcpy(str, "NOTIF");
+ break;
+ case TYPE_BITSTRING:
+ strcpy(str, "BITS");
+ break;
+ case TYPE_TRAPTYPE:
+ strcpy(str, "TRAP");
+ break;
+ case TYPE_OTHER: /* not sure if this is a valid leaf type?? */
+ case TYPE_NSAPADDRESS:
+ default: /* unsupported types for now */
+ strcpy(str, "");
+ return(FAILURE);
+ }
+ return SUCCESS;
+}
+
+/* does a destructive disection of <label1>...<labeln>.<iid> returning
+ <labeln> and <iid> in seperate strings (note: will destructively
+ alter input string, 'name') */
+static int
+__get_label_iid (name, last_label, iid, flag)
+char * name;
+char ** last_label;
+char ** iid;
+int flag;
+{
+ char *lcp;
+ char *icp;
+ int len = strlen(name);
+ int found_label = 0;
+
+ *last_label = *iid = NULL;
+
+ if (len == 0) return(FAILURE);
+
+ /* Handle case where numeric oid's have been requested. The input 'name'
+ ** in this case should be a numeric OID -- return failure if not.
+ */
+ if ((flag & USE_NUMERIC_OIDS)) {
+ if (!__is_numeric_oid(name))
+ return(FAILURE);
+
+ /* Walk backward through the string, looking for first two '.' chars */
+ lcp = &(name[len]);
+ icp = NULL;
+ while (lcp > name) {
+ if (*lcp == '.') {
+
+ /* If this is the first occurence of '.', note it in icp.
+ ** Otherwise, this must be the second occurrence, so break
+ ** out of the loop.
+ */
+ if (icp == NULL)
+ icp = lcp;
+ else
+ break;
+ }
+ lcp --;
+ }
+
+ /* Make sure we found at least a label and index. */
+ if (!icp)
+ return(FAILURE);
+
+ /* Push forward past leading '.' chars and separate the strings. */
+ lcp ++;
+ *icp ++ = '\0';
+
+ *last_label = (flag & USE_LONG_NAMES) ? name : lcp;
+ *iid = icp;
+
+ return(SUCCESS);
+ }
+
+ lcp = icp = &(name[len]);
+
+ while (lcp > name) {
+ if (*lcp == '.') {
+ if (found_label) {
+ lcp++;
+ break;
+ } else {
+ icp = lcp;
+ }
+ }
+ if (!found_label && isalpha((unsigned char)*lcp)) found_label = 1;
+ lcp--;
+ }
+
+ if (!found_label
+ || ((icp + 1 >= name + len || !isdigit((unsigned char)*(icp+1)))
+ && (flag & FAIL_ON_NULL_IID)))
+ return(FAILURE);
+
+ if (flag & NON_LEAF_NAME) { /* dont know where to start instance id */
+ /* put the whole thing in label */
+ icp = &(name[len]);
+ flag |= USE_LONG_NAMES;
+ /* special hack in case no mib loaded - object identifiers will
+ * start with .iso.<num>.<num>...., in which case it is preferable
+ * to make the label entirely numeric (i.e., convert "iso" => "1")
+ */
+ if (*lcp == '.' && lcp == name) {
+ if (!strncmp(".ccitt.",lcp,7)) {
+ name += 2;
+ *name = '.';
+ *(name+1) = '0';
+ } else if (!strncmp(".iso.",lcp,5)) {
+ name += 2;
+ *name = '.';
+ *(name+1) = '1';
+ } else if (!strncmp(".joint-iso-ccitt.",lcp,17)) {
+ name += 2;
+ *name = '.';
+ *(name+1) = '2';
+ }
+ }
+ } else if (*icp) {
+ *(icp++) = '\0';
+ }
+ *last_label = (flag & USE_LONG_NAMES ? name : lcp);
+
+ *iid = icp;
+
+ return(SUCCESS);
+}
+
+
+static int
+__oid_cmp(oida_arr, oida_arr_len, oidb_arr, oidb_arr_len)
+oid *oida_arr;
+size_t oida_arr_len;
+oid *oidb_arr;
+size_t oidb_arr_len;
+{
+ for (;oida_arr_len && oidb_arr_len;
+ oida_arr++, oida_arr_len--, oidb_arr++, oidb_arr_len--) {
+ if (*oida_arr == *oidb_arr) continue;
+ return(*oida_arr > *oidb_arr ? 1 : -1);
+ }
+ if (oida_arr_len == oidb_arr_len) return(0);
+ return(oida_arr_len > oidb_arr_len ? 1 : -1);
+}
+
+/* Convert a tag (string) to an OID array */
+/* Tag can be either a symbolic name, or an OID string */
+static struct tree *
+__tag2oid(tag, iid, oid_arr, oid_arr_len, type, best_guess)
+char * tag;
+char * iid;
+oid * oid_arr;
+size_t * oid_arr_len;
+int * type;
+int best_guess;
+{
+ struct tree *tp = NULL;
+ struct tree *rtp = NULL;
+ oid newname[MAX_OID_LEN], *op;
+ size_t newname_len = 0;
+
+ if (type) *type = TYPE_UNKNOWN;
+ if (oid_arr_len) *oid_arr_len = 0;
+ if (!tag) goto done;
+
+ /*********************************************************/
+ /* best_guess = 0 - same as no switches (read_objid) */
+ /* if multiple parts, or uses find_node */
+ /* if a single leaf */
+ /* best_guess = 1 - same as -Ib (get_wild_node) */
+ /* best_guess = 2 - same as -IR (get_node) */
+ /*********************************************************/
+
+ /* numeric scalar (1,2) */
+ /* single symbolic (1,2) */
+ /* single regex (1) */
+ /* partial full symbolic (2) */
+ /* full symbolic (2) */
+ /* module::single symbolic (2) */
+ /* module::partial full symbolic (2) */
+ if (best_guess == 1 || best_guess == 2) {
+ if (!__scan_num_objid(tag, newname, &newname_len)) { /* make sure it's not a numeric tag */
+ newname_len = MAX_OID_LEN;
+ if (best_guess == 2) { /* Random search -IR */
+ if (get_node(tag, newname, &newname_len)) {
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ }
+ else if (best_guess == 1) { /* Regex search -Ib */
+ clear_tree_flags(get_tree_head());
+ if (get_wild_node(tag, newname, &newname_len)) {
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ }
+ }
+ else {
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ if (type) *type = (tp ? tp->type : TYPE_UNKNOWN);
+ if ((oid_arr == NULL) || (oid_arr_len == NULL)) return rtp;
+ memcpy(oid_arr,(char*)newname,newname_len*sizeof(oid));
+ *oid_arr_len = newname_len;
+ }
+
+ /* if best_guess is off and multi part tag or module::tag */
+ /* numeric scalar */
+ /* module::single symbolic */
+ /* module::partial full symbolic */
+ /* FULL symbolic OID */
+ else if (strchr(tag,'.') || strchr(tag,':')) {
+ if (!__scan_num_objid(tag, newname, &newname_len)) { /* make sure it's not a numeric tag */
+ newname_len = MAX_OID_LEN;
+ if (read_objid(tag, newname, &newname_len)) { /* long name */
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ }
+ else {
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ if (type) *type = (tp ? tp->type : TYPE_UNKNOWN);
+ if ((oid_arr == NULL) || (oid_arr_len == NULL)) return rtp;
+ memcpy(oid_arr,(char*)newname,newname_len*sizeof(oid));
+ *oid_arr_len = newname_len;
+ }
+
+ /* else best_guess is off and it is a single leaf */
+ /* single symbolic */
+ else {
+ rtp = tp = find_node(tag, get_tree_head());
+ if (tp) {
+ if (type) *type = tp->type;
+ if ((oid_arr == NULL) || (oid_arr_len == NULL)) return rtp;
+ /* code taken from get_node in snmp_client.c */
+ for(op = newname + MAX_OID_LEN - 1; op >= newname; op--){
+ *op = tp->subid;
+ tp = tp->parent;
+ if (tp == NULL)
+ break;
+ }
+ *oid_arr_len = newname + MAX_OID_LEN - op;
+ memcpy(oid_arr, op, *oid_arr_len * sizeof(oid));
+ } else {
+ return(rtp); /* HACK: otherwise, concat_oid_str confuses things */
+ }
+ }
+ done:
+ if (iid && *iid && oid_arr_len) __concat_oid_str(oid_arr, oid_arr_len, iid);
+ return(rtp);
+}
+
+/* function: __concat_oid_str
+ *
+ * This function converts a dotted-decimal string, soid_str, to an array
+ * of oid types and concatenates them on doid_arr begining at the index
+ * specified by doid_arr_len.
+ *
+ * returns : SUCCESS, FAILURE
+ */
+static int
+__concat_oid_str(doid_arr, doid_arr_len, soid_str)
+oid *doid_arr;
+size_t *doid_arr_len;
+char * soid_str;
+{
+ char *soid_buf;
+ char *cp;
+ char *st;
+
+ if (!soid_str || !*soid_str) return SUCCESS;/* successfully added nothing */
+ if (*soid_str == '.') soid_str++;
+ soid_buf = strdup(soid_str);
+ if (!soid_buf)
+ return FAILURE;
+ cp = strtok_r(soid_buf,".",&st);
+ while (cp) {
+ sscanf(cp, "%" NETSNMP_PRIo "u", &(doid_arr[(*doid_arr_len)++]));
+ /* doid_arr[(*doid_arr_len)++] = atoi(cp); */
+ cp = strtok_r(NULL,".",&st);
+ }
+ free(soid_buf);
+ return(SUCCESS);
+}
+
+/*
+ * add a varbind to PDU
+ */
+static int
+__add_var_val_str(pdu, name, name_length, val, len, type)
+ netsnmp_pdu *pdu;
+ oid *name;
+ size_t name_length;
+ char * val;
+ int len;
+ int type;
+{
+ netsnmp_variable_list *vars;
+ oid oidbuf[MAX_OID_LEN];
+ int ret = SUCCESS;
+
+ if (pdu->variables == NULL){
+ pdu->variables = vars
+ = netsnmp_calloc(1, sizeof(netsnmp_variable_list));
+ } else {
+ for(vars = pdu->variables;
+ vars->next_variable;
+ vars = vars->next_variable)
+ /*EXIT*/;
+ vars->next_variable = netsnmp_calloc(1, sizeof(netsnmp_variable_list));
+ vars = vars->next_variable;
+ }
+
+ vars->next_variable = NULL;
+ vars->name = netsnmp_malloc(name_length * sizeof(oid));
+ memcpy((char *)vars->name, (char *)name, name_length * sizeof(oid));
+ vars->name_length = name_length;
+ switch (type) {
+ case TYPE_INTEGER:
+ case TYPE_INTEGER32:
+ vars->type = ASN_INTEGER;
+ vars->val.integer = netsnmp_malloc(sizeof(long));
+ if (val)
+ *(vars->val.integer) = strtol(val,NULL,0);
+ else {
+ ret = FAILURE;
+ *(vars->val.integer) = 0;
+ }
+ vars->val_len = sizeof(long);
+ break;
+
+ case TYPE_GAUGE:
+ case TYPE_UNSIGNED32:
+ vars->type = ASN_GAUGE;
+ goto UINT;
+ case TYPE_COUNTER:
+ vars->type = ASN_COUNTER;
+ goto UINT;
+ case TYPE_TIMETICKS:
+ vars->type = ASN_TIMETICKS;
+ goto UINT;
+ case TYPE_UINTEGER:
+ vars->type = ASN_UINTEGER;
+UINT:
+ vars->val.integer = netsnmp_malloc(sizeof(long));
+ if (val)
+ sscanf(val,"%lu",vars->val.integer);
+ else {
+ ret = FAILURE;
+ *(vars->val.integer) = 0;
+ }
+ vars->val_len = sizeof(long);
+ break;
+
+ case TYPE_OCTETSTR:
+ vars->type = ASN_OCTET_STR;
+ goto OCT;
+
+ case TYPE_BITSTRING:
+ vars->type = ASN_OCTET_STR;
+ goto OCT;
+
+ case TYPE_OPAQUE:
+ vars->type = ASN_OCTET_STR;
+OCT:
+ vars->val.string = netsnmp_malloc(len);
+ vars->val_len = len;
+ if (val && len)
+ memcpy((char *)vars->val.string, val, len);
+ else {
+ ret = FAILURE;
+ vars->val.string = (u_char *) netsnmp_strdup("");
+ vars->val_len = 0;
+ }
+ break;
+
+ case TYPE_IPADDR:
+ vars->type = ASN_IPADDRESS;
+ vars->val.integer = netsnmp_malloc(sizeof(in_addr_t));
+ if (val)
+ *((in_addr_t *)vars->val.integer) = inet_addr(val);
+ else {
+ ret = FAILURE;
+ *(vars->val.integer) = 0;
+ }
+ vars->val_len = sizeof(in_addr_t);
+ break;
+
+ case TYPE_OBJID:
+ vars->type = ASN_OBJECT_ID;
+ vars->val_len = MAX_OID_LEN;
+ /* if (read_objid(val, oidbuf, &(vars->val_len))) { */
+ /* tp = __tag2oid(val,NULL,oidbuf,&(vars->val_len),NULL,0); */
+ if (!val || !snmp_parse_oid(val, oidbuf, &vars->val_len)) {
+ vars->val.objid = NULL;
+ ret = FAILURE;
+ } else {
+ vars->val_len *= sizeof(oid);
+ vars->val.objid = netsnmp_malloc(vars->val_len);
+ memcpy((char *)vars->val.objid, (char *)oidbuf, vars->val_len);
+ }
+ break;
+
+ default:
+ vars->type = ASN_NULL;
+ vars->val_len = 0;
+ vars->val.string = NULL;
+ ret = FAILURE;
+ }
+
+ return ret;
+}
+
+/* takes ss and pdu as input and updates the 'response' argument */
+/* the input 'pdu' argument will be freed */
+static int
+__send_sync_pdu(ss, pdu, response, retry_nosuch,
+ err_str_sv, err_num_sv, err_ind_sv)
+netsnmp_session *ss;
+netsnmp_pdu *pdu;
+netsnmp_pdu **response;
+int retry_nosuch;
+SV * err_str_sv;
+SV * err_num_sv;
+SV * err_ind_sv;
+{
+ int status;
+ long command = pdu->command;
+ *response = NULL;
+retry:
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ status = snmp_sess_synch_response(ss, pdu, response);
+ } else {
+ status = snmp_synch_response(ss, pdu, response);
+ };
+
+ if ((*response == NULL) && (status == STAT_SUCCESS)) status = STAT_ERROR;
+
+ switch (status) {
+ case STAT_SUCCESS:
+ switch ((*response)->errstat) {
+ case SNMP_ERR_NOERROR:
+ break;
+
+ case SNMP_ERR_NOSUCHNAME:
+ if (retry_nosuch && (pdu = snmp_fix_pdu(*response, command))) {
+ if (*response) snmp_free_pdu(*response);
+ goto retry;
+ }
+
+ /* Pv1, SNMPsec, Pv2p, v2c, v2u, v2*, and SNMPv3 PDUs */
+ case SNMP_ERR_TOOBIG:
+ case SNMP_ERR_BADVALUE:
+ case SNMP_ERR_READONLY:
+ case SNMP_ERR_GENERR:
+ /* in SNMPv2p, SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3 PDUs */
+ case SNMP_ERR_NOACCESS:
+ case SNMP_ERR_WRONGTYPE:
+ case SNMP_ERR_WRONGLENGTH:
+ case SNMP_ERR_WRONGENCODING:
+ case SNMP_ERR_WRONGVALUE:
+ case SNMP_ERR_NOCREATION:
+ case SNMP_ERR_INCONSISTENTVALUE:
+ case SNMP_ERR_RESOURCEUNAVAILABLE:
+ case SNMP_ERR_COMMITFAILED:
+ case SNMP_ERR_UNDOFAILED:
+ case SNMP_ERR_AUTHORIZATIONERROR:
+ case SNMP_ERR_NOTWRITABLE:
+ /* in SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3 PDUs */
+ case SNMP_ERR_INCONSISTENTNAME:
+ default:
+ sv_catpv(err_str_sv,
+ (char*)snmp_errstring((*response)->errstat));
+ sv_setiv(err_num_sv, (*response)->errstat);
+ sv_setiv(err_ind_sv, (*response)->errindex);
+ status = (*response)->errstat;
+ break;
+ }
+ break;
+
+ case STAT_TIMEOUT:
+ case STAT_ERROR:
+ snmp_return_err(ss, err_str_sv, err_num_sv, err_ind_sv);
+ break;
+
+ default:
+ snmp_return_err(ss, err_str_sv, err_num_sv, err_ind_sv);
+ sv_catpv(err_str_sv, "send_sync_pdu: unknown status");
+ break;
+ }
+
+ return(status);
+}
+
+static int
+__snmp_xs_cb (op, ss, reqid, pdu, cb_data)
+int op;
+netsnmp_session *ss;
+int reqid;
+netsnmp_pdu *pdu;
+void *cb_data;
+{
+ SV *varlist_ref;
+ AV *varlist;
+ SV *varbind_ref;
+ AV *varbind;
+ SV *traplist_ref = NULL;
+ AV *traplist = NULL;
+ netsnmp_variable_list *vars;
+ struct tree *tp;
+ int len;
+ SV *tmp_sv;
+ int type;
+ char tmp_type_str[MAX_TYPE_NAME_LEN];
+ char str_buf[STR_BUF_SIZE], *str_bufp = str_buf;
+ size_t str_buf_len = sizeof(str_buf);
+ size_t out_len = 0;
+ int buf_over = 0;
+ char *label;
+ char *iid;
+ char *cp;
+ int getlabel_flag = NO_FLAGS;
+ int sprintval_flag = USE_BASIC;
+ netsnmp_pdu *reply_pdu;
+ int old_numeric, old_printfull, old_format;
+ netsnmp_transport *transport = NULL;
+
+ SV* cb = ((struct snmp_xs_cb_data*)cb_data)->perl_cb;
+ SV* sess_ref = ((struct snmp_xs_cb_data*)cb_data)->sess_ref;
+ SV **err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ SV **err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ SV **err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+
+ ENTER;
+ SAVETMPS;
+
+ if (cb_data != ss->callback_magic)
+ free(cb_data);
+
+ sv_setpv(*err_str_svp, (char*)snmp_errstring(pdu->errstat));
+ sv_setiv(*err_num_svp, pdu->errstat);
+ sv_setiv(*err_ind_svp, pdu->errindex);
+
+ varlist_ref = &sv_undef; /* Prevent unintialized use below. */
+
+ switch (op) {
+ case NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE:
+ traplist_ref = NULL;
+ switch (pdu->command) {
+ case SNMP_MSG_INFORM:
+ /*
+ * Ideally, we would use the return value from the callback to
+ * decide what response, if any, we send, and what the error status
+ * and error index should be.
+ */
+ reply_pdu = snmp_clone_pdu(pdu);
+ if (reply_pdu) {
+ reply_pdu->command = SNMP_MSG_RESPONSE;
+ reply_pdu->reqid = pdu->reqid;
+ reply_pdu->errstat = reply_pdu->errindex = 0;
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ snmp_sess_send(ss, reply_pdu);
+ } else {
+ snmp_send(ss, reply_pdu);
+ }
+ } else {
+ warn("Couldn't clone PDU for inform response");
+ }
+ /* FALLTHRU */
+ case SNMP_MSG_TRAP:
+ case SNMP_MSG_TRAP2:
+ traplist = newAV();
+ traplist_ref = newRV_noinc((SV*)traplist);
+#if 0
+ /* of dubious utility... */
+ av_push(traplist, newSViv(pdu->command));
+#endif
+ av_push(traplist, newSViv(pdu->reqid));
+ if ((transport = snmp_sess_transport(snmp_sess_pointer(ss))) != NULL) {
+ cp = transport->f_fmtaddr(transport, pdu->transport_data,
+ pdu->transport_data_length);
+ av_push(traplist, newSVpv(cp, strlen(cp)));
+ netsnmp_free(cp);
+ } else {
+ /* This shouldn't ever happen; every session has a transport. */
+ av_push(traplist, newSVpv("", 0));
+ }
+ av_push(traplist, newSVpv((char*) pdu->community, pdu->community_len));
+ if (pdu->command == SNMP_MSG_TRAP) {
+ /* SNMP v1 only trap fields */
+ snprint_objid(str_buf, sizeof(str_buf), pdu->enterprise, pdu->enterprise_length);
+ av_push(traplist, newSVpv(str_buf,strlen(str_buf)));
+ cp = inet_ntoa(*((struct in_addr *) pdu->agent_addr));
+ av_push(traplist, newSVpv(cp,strlen(cp)));
+ av_push(traplist, newSViv(pdu->trap_type));
+ av_push(traplist, newSViv(pdu->specific_type));
+ /* perl didn't have perlSVuv until 5.6.0 */
+ tmp_sv=newSViv(0);
+ sv_setuv(tmp_sv, pdu->time);
+ av_push(traplist, tmp_sv);
+ }
+ /* FALLTHRU */
+ case SNMP_MSG_RESPONSE:
+ {
+ varlist = newAV();
+ varlist_ref = newRV_noinc((SV*)varlist);
+
+ /*
+ ** Set up for numeric OID's, if necessary. Save the old values
+ ** so that they can be restored when we finish -- these are
+ ** library-wide globals, and have to be set/restored for each
+ ** session.
+ */
+ old_numeric = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS);
+ old_printfull = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_FULL_OID);
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseLongNames", 12, 1))) {
+ getlabel_flag |= USE_LONG_NAMES;
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_FULL_OID, 1);
+ }
+ /* Setting UseNumeric forces UseLongNames on so check for UseNumeric
+ after UseLongNames (above) to make sure the final outcome of
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT is NETSNMP_OID_OUTPUT_NUMERIC */
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseNumeric", 10, 1))) {
+ getlabel_flag |= USE_NUMERIC_OIDS;
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS, 1);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+
+ sv_bless(varlist_ref, gv_stashpv("SNMP::VarList",0));
+ for(vars = (pdu?pdu->variables:NULL); vars; vars = vars->next_variable) {
+ int local_getlabel_flag = getlabel_flag;
+ varbind = newAV();
+ varbind_ref = newRV_noinc((SV*)varbind);
+ sv_bless(varbind_ref, gv_stashpv("SNMP::Varbind",0));
+ av_push(varlist, varbind_ref);
+ *str_buf = '.';
+ *(str_buf+1) = '\0';
+ out_len = 0;
+ tp = netsnmp_sprint_realloc_objid_tree((u_char**)&str_bufp,
+ &str_buf_len,
+ &out_len, 0, &buf_over,
+ vars->name,vars->name_length);
+ str_buf[sizeof(str_buf)-1] = '\0';
+ if (__is_leaf(tp)) {
+ type = tp->type;
+ } else {
+ local_getlabel_flag |= NON_LEAF_NAME;
+ type = __translate_asn_type(vars->type);
+ }
+ __get_label_iid(str_buf,&label,&iid,local_getlabel_flag);
+ if (label) {
+ av_store(varbind, VARBIND_TAG_F,
+ newSVpv(label, strlen(label)));
+ } else {
+ av_store(varbind, VARBIND_TAG_F,
+ newSVpv("", 0));
+ }
+ if (iid) {
+ av_store(varbind, VARBIND_IID_F,
+ newSVpv(iid, strlen(iid)));
+ } else {
+ av_store(varbind, VARBIND_IID_F,
+ newSVpv("", 0));
+ }
+ __get_type_str(type, tmp_type_str);
+ tmp_sv = newSVpv(tmp_type_str, strlen(tmp_type_str));
+ av_store(varbind, VARBIND_TYPE_F, tmp_sv);
+ len = __snprint_value(str_buf, sizeof(str_buf),
+ vars, tp, type, sprintval_flag);
+ tmp_sv = newSVpv((char*)str_buf, len);
+ av_store(varbind, VARBIND_VAL_F, tmp_sv);
+ } /* for */
+
+ /* Reset the library's behavior for numeric/symbolic OID's. */
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS, old_numeric );
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_FULL_OID, old_printfull);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, old_format);
+
+ } /* case SNMP_MSG_RESPONSE */
+ break;
+ default:;
+ } /* switch pdu->command */
+ break;
+
+ case NETSNMP_CALLBACK_OP_TIMED_OUT:
+ varlist_ref = &sv_undef;
+ sv_setpv(*err_str_svp, (char*)snmp_api_errstring(SNMPERR_TIMEOUT));
+ sv_setiv(*err_num_svp, SNMPERR_TIMEOUT);
+ break;
+ default:;
+ } /* switch op */
+ if (cb_data != ss->callback_magic)
+ sv_2mortal(cb);
+ cb = __push_cb_args2(cb,
+ (SvTRUE(varlist_ref) ? sv_2mortal(varlist_ref):varlist_ref),
+ (SvTRUE(traplist_ref) ? sv_2mortal(traplist_ref):traplist_ref));
+ __call_callback(cb, G_DISCARD);
+
+ FREETMPS;
+ LEAVE;
+ if (cb_data != ss->callback_magic)
+ sv_2mortal(sess_ref);
+ return 1;
+}
+
+static SV *
+__push_cb_args2(sv,esv,tsv)
+SV *sv;
+SV *esv;
+SV *tsv;
+{
+ dSP;
+ if (SvTYPE(SvRV(sv)) != SVt_PVCV) sv = SvRV(sv);
+
+ PUSHMARK(sp);
+ if (SvTYPE(sv) == SVt_PVAV) {
+ AV *av = (AV *) sv;
+ int n = av_len(av) + 1;
+ SV **x = av_fetch(av, 0, 0);
+ if (x) {
+ int i = 1;
+ sv = *x;
+
+ for (i = 1; i < n; i++) {
+ x = av_fetch(av, i, 0);
+ if (x) {
+ SV *arg = *x;
+ XPUSHs(sv_mortalcopy(arg));
+ } else {
+ XPUSHs(&sv_undef);
+ }
+ }
+ } else {
+ sv = &sv_undef;
+ }
+ }
+ if (esv) XPUSHs(sv_mortalcopy(esv));
+ if (tsv) XPUSHs(sv_mortalcopy(tsv));
+ PUTBACK;
+ return sv;
+}
+
+static int
+__call_callback(sv, flags)
+SV *sv;
+int flags;
+{
+ I32 myframe = TOPMARK;
+ I32 count;
+ ENTER;
+ if (SvTYPE(sv) == SVt_PVCV)
+ {
+ count = perl_call_sv(sv, flags);
+ }
+ else if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVCV)
+ {
+ count = perl_call_sv(SvRV(sv), flags);
+ }
+ else
+ {
+
+ SV **top = stack_base + myframe + 1;
+ SV *obj = *top;
+ if (SvPOK(sv) && SvROK(obj) && SvOBJECT(SvRV(obj)))
+ {
+ count = perl_call_method(SvPV(sv, na), flags);
+ }
+ else if (SvPOK(obj) && SvROK(sv) && SvOBJECT(SvRV(sv)))
+ {
+ /* We have obj method ...
+ Used to be used instead of LangMethodCall()
+ */
+ *top = sv;
+ count = perl_call_method(SvPV(obj, na), flags);
+ }
+ else
+ {
+ count = perl_call_sv(sv, flags);
+ }
+ }
+ LEAVE;
+ return count;
+}
+
+/* Bulkwalk support routines */
+
+/* Add a context pointer to the list of valid pointers. Place it in the first
+** NULL slot in the array.
+*/
+static int
+_context_add(walk_context *context)
+{
+ int i, j, new_sz;
+
+ if ((i = _context_okay(context)) != 0) /* Already exists? Okay. */
+ return i;
+
+ /* Initialize the array if necessary. */
+ if (_valid_contexts == NULL) {
+
+ /* Create the _valid_contexts structure. */
+ Newz(0, _valid_contexts, 1, struct valid_contexts);
+ assert(_valid_contexts != NULL);
+
+ /* Populate the original valid contexts array. */
+ Newz(0, _valid_contexts->valid, 4, walk_context *);
+ assert(_valid_contexts->valid != NULL);
+
+ /* Computer number of slots in the array. */
+ _valid_contexts->sz_valid = sizeof(*_valid_contexts->valid) /
+ sizeof(walk_context *);
+
+ for (i = 0; i < _valid_contexts->sz_valid; i++)
+ _valid_contexts->valid[i] = NULL;
+
+ DBPRT(3, (DBOUT "Created valid_context array 0x%p (%d slots)\n",
+ _valid_contexts->valid, _valid_contexts->sz_valid));
+ }
+
+ /* Search through the list, looking for NULL's -- unused slots. */
+ for (i = 0; i < _valid_contexts->sz_valid; i++)
+ if (_valid_contexts->valid[i] == NULL)
+ break;
+
+ /* Did we walk off the end of the list? Need to grow the list. Double
+ ** it for now.
+ */
+ if (i == _valid_contexts->sz_valid) {
+ new_sz = _valid_contexts->sz_valid * 2;
+
+ Renew(_valid_contexts->valid, new_sz, walk_context *);
+ assert(_valid_contexts->valid != NULL);
+
+ DBPRT(3, (DBOUT "Resized valid_context array 0x%p from %d to %d slots\n",
+ _valid_contexts->valid, _valid_contexts->sz_valid, new_sz));
+
+ _valid_contexts->sz_valid = new_sz;
+
+ /* Initialize the new half of the resized array. */
+ for (j = i; j < new_sz; j++)
+ _valid_contexts->valid[j] = NULL;
+ }
+
+ /* Store the context pointer in the array and return 0 (success). */
+ _valid_contexts->valid[i] = context;
+ DBPRT(3,(DBOUT "Add context 0x%p to valid context list\n", context));
+ return 0;
+}
+
+/* Remove a context pointer from the valid list. Replace the pointer with
+** NULL in the valid pointer list.
+*/
+static int
+_context_del(walk_context *context)
+{
+ int i;
+
+ if (_valid_contexts == NULL) /* Make sure it was initialized. */
+ return 1;
+
+ for (i = 0; i < _valid_contexts->sz_valid; i++) {
+ if (_valid_contexts->valid[i] == context) {
+ DBPRT(3,(DBOUT "Remove context 0x%p from valid context list\n", context));
+ _valid_contexts->valid[i] = NULL; /* Remove it from the list. */
+ return 0; /* Return successful status. */
+ }
+ }
+ return 1;
+}
+
+/* Check if a specific context pointer is in the valid list. Return true (1)
+** if the context is still in the valid list, or 0 if not (or context is NULL).
+*/
+static int
+_context_okay(walk_context *context)
+{
+ int i;
+
+ if (_valid_contexts == NULL) /* Make sure it was initialized. */
+ return 0;
+
+ if (context == NULL) /* Asked about a NULL context? Fail. */
+ return 0;
+
+ for (i = 0; i < _valid_contexts->sz_valid; i++)
+ if (_valid_contexts->valid[i] == context)
+ return 1; /* Found it! */
+
+ return 0; /* No match -- return failure. */
+}
+
+/* Check if the walk is completed, based upon the context. Also set the
+** ignore flag on any completed variables -- this prevents them from being
+** being sent in later packets.
+*/
+static int
+_bulkwalk_done(walk_context *context)
+{
+ int is_done = 1;
+ int i;
+ bulktbl *bt_entry; /* bulktbl requested OID entry */
+
+ /* Don't consider walk done until at least one packet has been exchanged. */
+ if (context->pkts_exch == 0)
+ return 0;
+
+ /* Fix up any requests that have completed. If the complete flag is set,
+ ** or it is a non-repeater OID, set the ignore flag so that it will not
+ ** be considered further. Assume we are done with the walk, and note
+ ** otherwise if we aren't. Return 1 if all requests are complete, or 0
+ ** if there's more to do.
+ */
+ for (i = 0; i < context->nreq_oids; i ++) {
+ bt_entry = &context->req_oids[i];
+
+ if (bt_entry->complete || bt_entry->norepeat) {
+
+ /* This request is complete. Remove it from list of
+ ** walks still in progress.
+ */
+ DBPRT(1, (DBOUT "Ignoring %s request oid %s\n",
+ bt_entry->norepeat ? "nonrepeater" : "completed",
+ __snprint_oid(bt_entry->req_oid, bt_entry->req_len)));
+
+ /* Ignore this OID in any further packets. */
+ bt_entry->ignore = 1;
+ }
+
+ /* If any OID is not being ignored, the walk is not done. Must loop
+ ** through all requests to do the fixup -- no early return possible.
+ */
+ if (!bt_entry->ignore)
+ is_done = 0;
+ }
+
+ return is_done; /* Did the walk complete? */
+}
+
+/* Callback registered with SNMP. Return 1 from this callback to cause the
+** current request to be deleted from the retransmit queue.
+*/
+static int
+_bulkwalk_async_cb(int op,
+ SnmpSession *ss,
+ int reqid,
+ netsnmp_pdu *pdu,
+ void *context_ptr)
+{
+ walk_context *context;
+ int done = 0;
+ SV **err_str_svp;
+ SV **err_num_svp;
+
+ /* Handle callback request for asynchronous bulkwalk. If the bulkwalk has
+ ** not completed, and has not timed out, send the next request packet in
+ ** the walk.
+ **
+ ** Return 0 to indicate success (caller ignores return value).
+ */
+
+ DBPRT(2, (DBOUT "bulkwalk_async_cb(op %d, reqid 0x%08X, context 0x%p)\n",
+ op, reqid, context_ptr));
+
+ context = (walk_context *)context_ptr;
+
+ /* Make certain this is a valid context pointer. This pdu may
+ ** have been retransmitted after the bulkwalk was completed
+ ** (and the context was destroyed). If so, just return.
+ */
+ if (!_context_okay(context)) {
+ DBPRT(2,(DBOUT "Ignoring PDU for dead context 0x%p...\n", context));
+ return 1;
+ }
+
+ /* Is this a retransmission of a request we've already seen or some
+ ** unexpected request id? If so, just ignore it.
+ */
+ if (reqid != context->exp_reqid) {
+ DBPRT(2,
+ (DBOUT "Got reqid 0x%08X, expected reqid 0x%08X. Ignoring...\n", reqid,
+ context->exp_reqid));
+ return 1;
+ }
+ /* Ignore any future packets for this reqid. */
+ context->exp_reqid = -1;
+
+ err_str_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorNum", 8, 1);
+
+ switch (op) {
+ case NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE:
+ {
+ DBPRT(1,(DBOUT "Received message for reqid 0x%08X ...\n", reqid));
+
+ switch (pdu->command)
+ {
+ case SNMP_MSG_RESPONSE:
+ {
+ DBPRT(2, (DBOUT "Calling bulkwalk_recv_pdu(context 0x%p, pdu 0x%p)\n",
+ context_ptr, pdu));
+
+ /* Handle the response PDU. If an error occurs or there were
+ ** no variables in the response, consider the walk done. If
+ ** the response was okay, check if we have any more to do after
+ ** this response.
+ */
+ if (_bulkwalk_recv_pdu(context, pdu) <= 0)
+ done = 1;
+ else
+ done = _bulkwalk_done(context); /* Also set req ignore flags */
+ break;
+ }
+ default:
+ {
+ DBPRT(1,(DBOUT "unexpected pdu->command %d\n", pdu->command));
+ done = 1; /* "This can't happen!", so bail out when it does. */
+ break;
+ }
+ }
+
+ break;
+ }
+
+ case NETSNMP_CALLBACK_OP_TIMED_OUT:
+ {
+ DBPRT(1,(DBOUT "\n*** Timeout for reqid 0x%08X\n\n", reqid));
+
+ sv_setpv(*err_str_svp, (char*)snmp_api_errstring(SNMPERR_TIMEOUT));
+ sv_setiv(*err_num_svp, SNMPERR_TIMEOUT);
+
+ /* Timeout means something bad has happened. Return a not-okay
+ ** result to the async callback.
+ */
+ _bulkwalk_finish(context, 0 /* NOT OKAY */);
+ return 1;
+ }
+
+ default:
+ {
+ DBPRT(1,(DBOUT "unexpected callback op %d\n", op));
+ sv_setpv(*err_str_svp, (char*)snmp_api_errstring(SNMPERR_GENERR));
+ sv_setiv(*err_num_svp, SNMPERR_GENERR);
+ _bulkwalk_finish(context, 0 /* NOT OKAY */);
+ return 1;
+ }
+ }
+
+ /* We have either timed out, or received and parsed in a response. Now,
+ ** if we have more variables to test, call bulkwalk_send_pdu() to enqueue
+ ** another async packet, and return.
+ **
+ ** If, however, the bulkwalk has completed (or an error has occurred that
+ ** cuts the walk short), call bulkwalk_finish() to push the results onto
+ ** the Perl call stack. Then explicitly call the Perl callback that was
+ ** passed in by the user oh-so-long-ago.
+ */
+ if (!done) {
+ DBPRT(1,(DBOUT "bulkwalk not complete -- send next pdu from callback\n"));
+
+ if (_bulkwalk_send_pdu(context) != NULL)
+ return 1;
+
+ DBPRT(1,(DBOUT "send_pdu() failed!\n"));
+ /* Fall through and return what we have so far. */
+ }
+
+ /* Call the perl callback with the return values and we're done. */
+ _bulkwalk_finish(context, 1 /* OKAY */);
+
+ return 1;
+}
+
+static netsnmp_pdu *
+_bulkwalk_send_pdu(walk_context *context)
+{
+ netsnmp_pdu *pdu = NULL;
+ netsnmp_pdu *response = NULL;
+ struct bulktbl *bt_entry;
+ int nvars = 0;
+ int reqid;
+ int status;
+ int i;
+
+ /* Send a pdu requesting any remaining variables in the context.
+ **
+ ** In synchronous mode, returns a pointer to the response packet.
+ **
+ ** In asynchronous mode, it returns the request ID, cast to a struct snmp *,
+ ** not a valid SNMP response packet. The async code should not be trying
+ ** to get variables out of this "response".
+ **
+ ** In either case, return a NULL pointer on error or failure.
+ */
+
+ SV **sess_ptr_sv = hv_fetch((HV*)SvRV(context->sess_ref), "SessPtr", 7, 1);
+ netsnmp_session *ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ SV **err_str_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorStr", 8, 1);
+ SV **err_num_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorNum", 8, 1);
+ SV **err_ind_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorInd", 8, 1);
+
+ /* Create a new PDU and send the remaining set of requests to the agent. */
+ pdu = snmp_pdu_create(SNMP_MSG_GETBULK);
+ if (pdu == NULL) {
+ sv_setpv(*err_str_svp, "snmp_pdu_create(GETBULK) failed: ");
+ sv_catpv(*err_str_svp, strerror(errno));
+ sv_setiv(*err_num_svp, SNMPERR_MALLOC);
+ goto err;
+ }
+
+ /* Request non-repeater variables only in the first packet exchange. */
+ pdu->errstat = (context->pkts_exch == 0) ? context->non_reps : 0;
+ pdu->errindex = context->max_reps;
+
+ for (i = 0; i < context->nreq_oids; i++) {
+ bt_entry = &context->req_oids[i];
+ if (bt_entry->ignore)
+ continue;
+
+ assert(bt_entry->complete == 0);
+
+ if (!snmp_add_null_var(pdu, bt_entry->last_oid, bt_entry->last_len)) {
+ sv_setpv(*err_str_svp, "snmp_add_null_var() failed");
+ sv_setiv(*err_num_svp, SNMPERR_GENERR);
+ sv_setiv(*err_ind_svp, i);
+ goto err;
+ }
+
+ nvars ++;
+
+ DBPRT(1, (DBOUT " Add %srepeater %s\n", bt_entry->norepeat ? "non" : "",
+ __snprint_oid(bt_entry->last_oid, bt_entry->last_len)));
+ }
+
+ /* Make sure variables are actually being requested in the packet. */
+ assert (nvars != 0);
+
+ context->pkts_exch ++;
+
+ DBPRT(1, (DBOUT "Sending %ssynchronous request %d...\n",
+ SvTRUE(context->perl_cb) ? "a" : "", context->pkts_exch));
+
+ /* We handle the asynchronous and synchronous requests differently here.
+ ** For async, we simply enqueue the packet with a callback to handle the
+ ** returned response, then return. Note that this we call the bulkwalk
+ ** callback, and hand it the walk_context, not the Perl callback. The
+ ** snmp_async_send() function returns the reqid on success, 0 on failure.
+ */
+ if (SvTRUE(context->perl_cb)) {
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ reqid = snmp_sess_async_send(ss, pdu, _bulkwalk_async_cb, (void *)context);
+ } else {
+ reqid = snmp_async_send(ss, pdu, _bulkwalk_async_cb, (void *)context);
+ }
+
+ DBPRT(2,(DBOUT "bulkwalk_send_pdu(): snmp_async_send => 0x%08X\n", reqid));
+
+ if (reqid == 0) {
+ snmp_return_err(ss, *err_num_svp, *err_ind_svp, *err_str_svp);
+ goto err;
+ }
+
+ /* Make a note of the request we expect to be answered. */
+ context->exp_reqid = reqid;
+
+ /* Callbacks take care of the rest. Let the caller know how many vars
+ ** we sent in this request. Note that this is not a valid SNMP PDU,
+ ** but that's because a response has not yet been received.
+ */
+ return (netsnmp_pdu *)(intptr_t)reqid;
+ }
+
+ /* This code is for synchronous mode support.
+ **
+ ** Send the PDU and block awaiting the response. Return the response
+ ** packet back to the caller. Note that snmp_sess_read() frees the pdu.
+ */
+ status = __send_sync_pdu(ss, pdu, &response, NO_RETRY_NOSUCH,
+ *err_str_svp, *err_num_svp, *err_ind_svp);
+
+ pdu = NULL;
+
+ /* Check for a failed request. __send_sync_pdu() will set the appropriate
+ ** values in the error string and number SV's.
+ */
+ if (status != STAT_SUCCESS) {
+ DBPRT(1,(DBOUT "__send_sync_pdu() -> %d\n",(int)status));
+ goto err;
+ }
+
+ DBPRT(1, (DBOUT "%d packets exchanged, response 0x%p\n", context->pkts_exch,
+ response));
+ return response;
+
+
+ err:
+ if (pdu)
+ snmp_free_pdu(pdu);
+ return NULL;
+}
+
+/* Handle an incoming GETBULK response PDU. This function just pulls the
+** variables off of the PDU and builds up the arrays of returned values
+** that are stored in the context.
+**
+** Returns the number of variables found in this packet, or -1 on error.
+** Note that the caller is expected to free the pdu.
+*/
+static int
+_bulkwalk_recv_pdu(walk_context *context, netsnmp_pdu *pdu)
+{
+ netsnmp_variable_list *vars;
+ struct tree *tp;
+ char type_str[MAX_TYPE_NAME_LEN];
+ char str_buf[STR_BUF_SIZE], *str_bufp = str_buf;
+ size_t str_buf_len = sizeof(str_buf);
+ size_t out_len = 0;
+ int buf_over = 0;
+ char *label;
+ char *iid;
+ bulktbl *expect = NULL;
+ int old_numeric;
+ int old_printfull;
+ int old_format;
+ int getlabel_flag;
+ int type;
+ int pix;
+ int len;
+ int i;
+ AV *varbind;
+ SV *rv;
+ SV **sess_ptr_sv = hv_fetch((HV*)SvRV(context->sess_ref), "SessPtr", 7, 1);
+ SV **err_str_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorStr", 8, 1);
+ SV **err_num_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorNum", 8, 1);
+ SV **err_ind_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorInd", 8, 1);
+ int check = SvIV(*hv_fetch((HV*)SvRV(context->sess_ref), "NonIncreasing",13,1));
+
+ DBPRT(3, (DBOUT "bulkwalk: sess_ref = 0x%p, sess_ptr_sv = 0x%p\n",
+ context->sess_ref, sess_ptr_sv));
+
+ /* Set up for numeric OID's, if necessary. Save the old values
+ ** so that they can be restored when we finish -- these are
+ ** library-wide globals, and have to be set/restored for each
+ ** session.
+ */
+ old_numeric = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS);
+ old_printfull = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_FULL_OID);
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ if (context->getlabel_f & USE_NUMERIC_OIDS) {
+ DBPRT(2,(DBOUT "Using numeric oid's\n"));
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS, 1);
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_FULL_OID, 1);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+
+ /* Parse through the list of variables returned, adding each return to
+ ** the appropriate array (as a VarBind). Also keep track of which
+ ** repeated OID we're expecting to see, and check if that tree walk has
+ ** been completed (i.e. we've walked past the root of our request). If
+ ** so, mark the request complete so that we don't send it again in any
+ ** subsequent request packets.
+ */
+ if (context->pkts_exch == 1)
+ context->reqbase = context->req_oids; /* Request with non-repeaters */
+ else
+ context->reqbase = context->repbase; /* Request only repeater vars */
+
+ /* Note the first variable we expect to see. Should be reqbase. */
+ expect = context->reqbase;
+
+ for (vars = pdu->variables, pix = 0;
+ vars != NULL;
+ vars = vars->next_variable, pix ++)
+ {
+
+ /* If no outstanding requests remain, we're done. This works, but it
+ ** causes the reported total variable count to be wrong (since the
+ ** remaining vars on the last packet are not counted). In practice
+ ** this is probably worth the win, but for debugging it's not.
+ */
+ if (context->req_remain == 0) {
+ DBPRT(2,(DBOUT "No outstanding requests remain. Terminating processing.\n"));
+ while (vars) {
+ pix ++;
+ vars = vars->next_variable;
+ }
+ break;
+ }
+
+ /* Determine which OID we expect to see next. We assert that the OID's
+ ** must be returned in the expected order. The first nreq_oids returns
+ ** should match the req_oids array, after that, we must cycle through
+ ** the repeaters in order. Non-repeaters are not included in later
+ ** packets, so cannot have the "ignore" flag set.
+ */
+
+ if (context->oid_saved < context->non_reps) {
+ assert(context->pkts_exch == 1);
+
+ expect = context->reqbase ++;
+ assert(expect->norepeat);
+
+ } else {
+ /* Must be a repeater. Look for the first one that is not being
+ ** ignored. Make sure we don't loop around to where we started.
+ ** If we get here but everything is being ignored, there's a problem.
+ **
+ ** Note that we *do* accept completed but not ignored OID's -- these
+ ** are OID's for trees that have been completed sometime in this
+ ** response, but must be looked at to maintain ordering.
+ */
+ /* In previous version we started from 1st repeater any time when
+ ** pix == 0. But if 1st repeater is ignored we can get wrong results,
+ ** because it was not included in 2nd and later request. So we set
+ ** expect to repbase-1 and then search for 1st non-ignored repeater.
+ ** repbase-1 is nessessary because we're starting search in loop below
+ ** from ++expect and it will be exactly repbase on 1st search pass.
+ */
+ if (pix == 0)
+ expect = context->repbase - 1;
+
+ /* Find the repeater OID we expect to see. Ignore any
+ ** OID's marked 'ignore' -- these have been completed
+ ** and were not requested in this iteration.
+ */
+ for (i = 0; i < context->repeaters; i++) {
+
+ /* Loop around to first repeater if we hit the end. */
+ if (++ expect == &context->req_oids[context->nreq_oids])
+ expect = context->reqbase = context->repbase;
+
+ /* Stop if this OID is not being ignored. */
+ if (!expect->ignore)
+ break;
+ }
+ }
+
+ DBPRT(2, (DBOUT "Var %03d request %s\n", pix,
+ __snprint_oid(expect->req_oid, expect->req_len)));
+
+ /* Did we receive an error condition for this variable?
+ ** If it's a repeated variable, mark it as complete and
+ ** fall through to the block below.
+ */
+ if ((vars->type == SNMP_ENDOFMIBVIEW) ||
+ (vars->type == SNMP_NOSUCHOBJECT) ||
+ (vars->type == SNMP_NOSUCHINSTANCE))
+ {
+ DBPRT(2,(DBOUT "error type %d\n", (int)vars->type));
+
+ /* ENDOFMIBVIEW should be okay for a repeater - just walked off the
+ ** end of the tree. Mark the request as complete, and go on to the
+ ** next one.
+ */
+ if ((context->oid_saved >= context->non_reps) &&
+ (vars->type == SNMP_ENDOFMIBVIEW))
+ {
+ expect->complete = 1;
+ DBPRT(2, (DBOUT "Ran out of tree for oid %s\n",
+ __snprint_oid(vars->name,vars->name_length)));
+
+ context->req_remain --;
+
+ /* Go on to the next variable. */
+ continue;
+
+ }
+ sv_setpv(*err_str_svp,
+ (char*)snmp_api_errstring(SNMPERR_UNKNOWN_OBJID));
+ sv_setiv(*err_num_svp, SNMPERR_UNKNOWN_OBJID);
+ sv_setiv(*err_ind_svp, pix);
+ goto err;
+ }
+
+ /* If this is not the first packet, skip any duplicated OID values, if
+ ** present. These should be the seed values copied from the last OID's
+ ** of the previous packet. In practice we don't see this, but it is
+ ** easy enough to do, and will avoid confusion for the caller from mis-
+ ** behaving agents (badly misbehaving... ;^).
+ */
+ if (context->pkts_exch > 1) {
+ if (__oid_cmp(vars->name, vars->name_length,
+ expect->last_oid, expect->last_len) <= 0)
+ {
+ if (check)
+ {
+ DBPRT(2, (DBOUT "Error: OID not increasing: %s\n",
+ __snprint_oid(vars->name,vars->name_length)));
+ sv_setpv(*err_str_svp, (char*)snmp_api_errstring(SNMPERR_OID_NONINCREASING));
+ sv_setiv(*err_num_svp, SNMPERR_OID_NONINCREASING);
+ sv_setiv(*err_ind_svp, pix);
+ goto err;
+ }
+
+ DBPRT(2, (DBOUT "Ignoring repeat oid: %s\n",
+ __snprint_oid(vars->name,vars->name_length)));
+
+ continue;
+ }
+ }
+
+ context->oid_total ++; /* Count each variable received. */
+
+ /* If this is a non-repeater, handle it. Otherwise, if it is a
+ ** repeater, has the walk wandered off of the requested tree? If so,
+ ** this request is complete, so mark it as such. Ignore any other
+ ** variables in a completed request. In order to maintain the correct
+ ** ordering of which variables we expect to see in this packet, we must
+ ** not set the ignore flags immediately. It is done in bulkwalk_done().
+ */
+ if (context->oid_saved < context->non_reps) {
+ DBPRT(2, (DBOUT " expected var %s (nonrepeater %d/%d)\n",
+ __snprint_oid(expect->req_oid, expect->req_len),
+ pix, context->non_reps));
+ DBPRT(2, (DBOUT " received var %s\n",
+ __snprint_oid(vars->name, vars->name_length)));
+
+ /* This non-repeater has now been seen, so mark the sub-tree as
+ ** completed. Note that this may not be the same oid as requested,
+ ** since non-repeaters act like GETNEXT requests, not GET's. <sigh>
+ */
+ context->req_oids[pix].complete = 1;
+ context->req_remain --;
+
+ } else { /* Must be a repeater variable. */
+
+ DBPRT(2, (DBOUT " received oid %s\n",
+ __snprint_oid(vars->name, vars->name_length)));
+
+ /* Are we already done with this tree? If so, just ignore this
+ ** variable and move on to the next expected variable.
+ */
+ if (expect->complete) {
+ DBPRT(2,(DBOUT " this branch is complete - ignoring.\n"));
+ continue;
+ }
+
+ /* If the base oid of this variable doesn't match the expected oid,
+ ** assume that we've walked past the end of the subtree. Set this
+ ** subtree to be completed, and go on to the next variable.
+ */
+ if ((vars->name_length < expect->req_len) ||
+ (memcmp(vars->name, expect->req_oid, expect->req_len*sizeof(oid))))
+ {
+ DBPRT(2,(DBOUT " walked off branch - marking subtree as complete.\n"));
+ expect->complete = 1;
+ context->req_remain --;
+ continue;
+ }
+
+ /* Still interested in the tree -- we need to keep track of the
+ ** last-seen value in case we need to send an additional request
+ ** packet.
+ */
+ (void)memcpy(expect->last_oid, vars->name,
+ vars->name_length * sizeof(oid));
+ expect->last_len = vars->name_length;
+
+ }
+
+ /* Create a new Varbind and populate it with the parsed information
+ ** returned by the agent. This Varbind is then pushed onto the arrays
+ ** maintained for each request OID in the context. These varbinds are
+ ** collected into a return array by bulkwalk_finish().
+ */
+ varbind = (AV*) newAV();
+ if (varbind == NULL) {
+ sv_setpv(*err_str_svp, "newAV() failed: ");
+ sv_catpv(*err_str_svp, (char*)strerror(errno));
+ sv_setiv(*err_num_svp, SNMPERR_MALLOC);
+ goto err;
+ }
+
+ *str_buf = '.';
+ *(str_buf+1) = '\0';
+ out_len = 0;
+ tp = netsnmp_sprint_realloc_objid_tree((u_char**)&str_bufp, &str_buf_len,
+ &out_len, 0, &buf_over,
+ vars->name,vars->name_length);
+ str_buf[sizeof(str_buf)-1] = '\0';
+
+ getlabel_flag = context->getlabel_f;
+
+ if (__is_leaf(tp)) {
+ type = tp->type;
+ } else {
+ getlabel_flag |= NON_LEAF_NAME;
+ type = __translate_asn_type(vars->type);
+ }
+ if (__get_label_iid(str_buf, &label, &iid, getlabel_flag) == FAILURE) {
+ label = str_buf;
+ iid = label + strlen(label);
+ }
+
+ DBPRT(2,(DBOUT " save var %s.%s = ", label, iid));
+
+ av_store(varbind, VARBIND_TAG_F, newSVpv(label, strlen(label)));
+ av_store(varbind, VARBIND_IID_F, newSVpv(iid, strlen(iid)));
+
+ __get_type_str(type, type_str);
+ av_store(varbind, VARBIND_TYPE_F, newSVpv(type_str, strlen(type_str)));
+
+ len=__snprint_value(str_buf, sizeof(str_buf),
+ vars, tp, type, context->sprintval_f);
+ av_store(varbind, VARBIND_VAL_F, newSVpv(str_buf, len));
+
+ str_buf[len] = '\0';
+ DBPRT(3,(DBOUT "'%s' (%s)\n", str_buf, type_str));
+
+#if 0
+ /* huh? */
+ /* If necessary, store a timestamp as the semi-documented 5th element. */
+ if (sv_timestamp)
+ av_store(varbind, VARBIND_TIME_F, SvREFCNT_inc(sv_timestamp));
+#endif
+
+ /* Push ref to the varbind onto the list of vars for OID. */
+ rv = newRV_noinc((SV *)varbind);
+ sv_bless(rv, gv_stashpv("SNMP::Varbind", 0));
+ av_push(expect->vars, rv);
+
+ context->oid_saved ++; /* Count this as a saved variable. */
+
+ } /* next variable in response packet */
+
+ DBPRT(1, (DBOUT "-- pkt %d saw %d vars, total %d (%d saved)\n", context->pkts_exch,
+ pix, context->oid_total, context->oid_saved));
+
+ /* We assert that all non-repeaters must be returned in
+ ** the initial response (they are not repeated in additional
+ ** packets, so would be dropped). If nonrepeaters still
+ ** exist, consider it a fatal error.
+ */
+ if ((context->pkts_exch == 1) && (context->oid_saved < context->non_reps)) {
+ /* Re-use space from the value string for error message. */
+ sprintf(str_buf, "%d non-repeaters went unanswered", context->non_reps);
+ sv_setpv(*err_str_svp, str_buf);
+ sv_setiv(*err_num_svp, SNMPERR_GENERR);
+ sv_setiv(*err_num_svp, context->oid_saved);
+ goto err;
+ }
+
+ /* Reset the library's behavior for numeric/symbolic OID's. */
+ if (context->getlabel_f & USE_NUMERIC_OIDS) {
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS, old_numeric);
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_FULL_OID, old_printfull);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, old_format);
+ }
+
+ return pix;
+
+ err:
+ return -1;
+
+}
+
+/* Once the bulkwalk has completed, extend the stack and push references to
+** each of the arrays of SNMP::Varbind's onto the stack. Return the number
+** of arrays pushed on the stack. The caller should return to Perl, or call
+** the Perl callback function.
+**
+** Note that this function free()'s the walk_context and request bulktbl's.
+*/
+static int
+_bulkwalk_finish(walk_context *context, int okay)
+{
+ dSP;
+ int npushed = 0;
+ int i;
+ int async = 0;
+ bulktbl *bt_entry;
+ AV *ary = NULL;
+ SV *rv;
+ SV *perl_cb;
+
+ SV **err_str_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorStr", 8, 1);
+ SV **err_num_svp = hv_fetch((HV*)SvRV(context->sess_ref), "ErrorNum", 8, 1);
+
+ async = SvTRUE(context->perl_cb);
+
+ /* XXX
+ _bulkwalk_finish() was originally intended to be called from XS code, and
+ would extend the caller's stack with result. Later it was changed into
+ an asynchronous version that calls perl code instead. These two branches
+ differ significantly in how they treat perl stack. Due to these differences,
+ often implicit (f.ex. dMARK calls POPMARK ), it would be a good idea
+ to write two different procedures, _bulkwalk_finish_sync and _bulkwalk_finish_async
+ for cleaner separation. */
+
+ if (async) PUSHMARK(sp);
+
+ {
+
+#ifdef dITEMS
+ dMARK;
+ dITEMS;
+#else
+ /* unfortunately this may pop a mark, which is not what we want */
+ /* older perl versions don't declare dITEMS though and the
+ following declars it but also uses dAXMARK instead of dMARK
+ which is the bad popping version */
+ dMARK;
+
+ /* err... This is essentially what the newer dITEMS does */
+ I32 items = sp - mark;
+#endif
+
+
+ /* Successfully completed the bulkwalk. For synchronous calls, push each
+ ** of the request value arrays onto the stack, and return the number of
+ ** items pushed onto the stack. For async, create a new array and push
+ ** the references onto it. The array is then passed to the Perl callback.
+ */
+ if(!async)
+ SP -= items;
+
+ DBPRT(1, (DBOUT "Bulwalk %s (saved %d/%d), ", okay ? "completed" : "had error",
+ context->oid_saved, context->oid_total));
+
+ if (okay) {
+ DBPRT(1, (DBOUT "%s %d varbind refs %s\n",
+ async ? "pass ref to array of" : "return",
+ context->nreq_oids,
+ async ? "to callback" : "on stack to caller"));
+
+ /* Create the array to hold the responses for the asynchronous callback,
+ ** or pre-extend the stack enough to hold responses for synch return.
+ */
+ if (async) {
+ ary = (AV *)newAV();
+ if (ary == NULL) {
+ sv_setpv(*err_str_svp, "newAV(): ");
+ sv_catpv(*err_str_svp, (char *)strerror(errno));
+ sv_setiv(*err_num_svp, errno);
+ }
+
+ /* NULL ary pointer is okay -- we'll handle it below... */
+
+ } else {
+ EXTEND(sp, context->nreq_oids);
+
+ }
+
+ /* Push a reference to each array of varbinds onto the stack, in
+ ** the order requested. Note that these arrays may be empty.
+ */
+ for (i = 0; i < context->nreq_oids; i++) {
+ bt_entry = &context->req_oids[i];
+
+ DBPRT(2, (DBOUT " %sreq #%d (%s) => %d var%s\n",
+ bt_entry->complete ? "" : "incomplete ", i,
+ __snprint_oid(bt_entry->req_oid, bt_entry->req_len),
+ (int)av_len(bt_entry->vars) + 1,
+ (int)av_len(bt_entry->vars) > 0 ? "s" : ""));
+
+ if (async && ary == NULL) {
+ DBPRT(2,(DBOUT " [dropped due to newAV() failure]\n"));
+ continue;
+ }
+
+ /* Get a reference to the varlist, and push it onto array or stack */
+ rv = newRV_noinc((SV *)bt_entry->vars);
+ sv_bless(rv, gv_stashpv("SNMP::VarList",0));
+
+ if (async)
+ av_push(ary, rv);
+ else
+ PUSHs(sv_2mortal((SV *)rv));
+
+ npushed ++;
+ }
+
+ } else { /* Not okay -- push a single undef on the stack if not async */
+
+ if (!async) {
+ XPUSHs(&sv_undef);
+ npushed = 1;
+ } else {
+ for (i = 0; i < context->nreq_oids; i++) {
+ sv_2mortal((SV *) (context->req_oids[i].vars));
+ }
+ }
+ }
+
+ /* XXX Future enhancement -- make statistics (pkts exchanged, vars
+ ** saved vs. received, total time, etc) available to caller so they
+ ** can adjust their request parameters and/or re-order requests.
+ */
+ if(!async)
+ SP -= items;
+
+ PUTBACK;
+
+ if (async) {
+ /* Asynchronous callback. Push the caller's arglist onto the stack,
+ ** and follow it with the contents of the array (or undef if newAV()
+ ** failed or the session had an error). Then mortalize the Perl
+ ** callback pointer, and call the callback.
+ */
+ if (!okay || ary == NULL)
+ rv = &sv_undef;
+ else
+ rv = newRV_noinc((SV *)ary);
+
+ sv_2mortal(perl_cb = context->perl_cb);
+ perl_cb = __push_cb_args(perl_cb, (SvTRUE(rv) ? sv_2mortal(rv) : rv));
+
+ __call_callback(perl_cb, G_DISCARD);
+ }
+ sv_2mortal(context->sess_ref);
+
+ /* Free the allocated space for the request states and return number of
+ ** variables found. Remove the context from the valid context list.
+ */
+ _context_del(context);
+ DBPRT(2,(DBOUT "Free() context->req_oids\n"));
+ Safefree(context->req_oids);
+ DBPRT(2,(DBOUT "Free() context 0x%p\n", context));
+ Safefree(context);
+ return npushed;
+}}
+
+/* End of bulkwalk support routines */
+
+static char *
+__av_elem_pv(AV *av, I32 key, char *dflt)
+{
+ SV **elem = av_fetch(av, key, 0);
+
+ return (elem && SvOK(*elem)) ? SvPV(*elem, na) : dflt;
+}
+
+static int
+not_here(const char *s)
+{
+ warn("%s not implemented on this architecture", s);
+ return -1;
+}
+
+#define TEST_CONSTANT(value, name, C) \
+ if (strEQ(name, #C)) { \
+ *value = C; \
+ return 0; \
+ }
+#define TEST_CONSTANT2(value, name, C, V) \
+ if (strEQ(name, #C)) { \
+ *value = V; \
+ return 0; \
+ }
+
+static int constant(double *value, const char * const name, const int arg)
+{
+ switch (*name) {
+ case 'N':
+ TEST_CONSTANT(value, name, NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE);
+ TEST_CONSTANT(value, name, NETSNMP_CALLBACK_OP_TIMED_OUT);
+ break;
+ case 'S':
+ TEST_CONSTANT(value, name, SNMPERR_BAD_ADDRESS);
+ TEST_CONSTANT(value, name, SNMPERR_BAD_LOCPORT);
+ TEST_CONSTANT(value, name, SNMPERR_BAD_SESSION);
+ TEST_CONSTANT(value, name, SNMPERR_GENERR);
+ TEST_CONSTANT(value, name, SNMPERR_TOO_LONG);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_ADDRESS);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_COMMUNITY_LEN);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_ENTERPRISE_LENGTH);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_ERRINDEX);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_ERRSTAT);
+ TEST_CONSTANT2(value, name, SNMP_DEFAULT_PEERNAME, 0);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_REMPORT);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_REQID);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_RETRIES);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_TIME);
+ TEST_CONSTANT(value, name, SNMP_DEFAULT_TIMEOUT);
+ TEST_CONSTANT2(value, name, SNMP_DEFAULT_VERSION,
+ NETSNMP_DEFAULT_SNMP_VERSION);
+ TEST_CONSTANT(value, name, SNMP_API_SINGLE);
+ TEST_CONSTANT(value, name, SNMP_API_TRADITIONAL);
+ break;
+ case 'X':
+ goto not_there;
+ break;
+ default:
+ break;
+ }
+ return EINVAL;
+
+not_there:
+ not_here(name);
+ return ENOENT;
+}
+
+/*
+ Since s_snmp_errno can't be trusted with Single Session, this calls either
+ snmp_error or snmp_sess_error to populate ErrorStr,ErrorNum, and ErrorInd
+ in SNMP::Session objects
+*/
+void snmp_return_err( struct snmp_session *ss, SV *err_str, SV *err_num, SV *err_ind )
+{
+ int err;
+ int liberr;
+ char *errstr;
+ if(ss == NULL)
+ return;
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ snmp_sess_error(ss, &err, &liberr, &errstr);
+ } else {
+ snmp_error(ss, &err, &liberr, &errstr);
+ }
+ sv_catpv(err_str, errstr);
+ sv_setiv(err_num, liberr);
+ sv_setiv(err_ind, err);
+ netsnmp_free(errstr);
+}
+
+
+/*
+ int snmp_api_mode( int mode )
+ Returns or sets static int api_mode for reference by functions to determine
+ whether to use Traditional (non-threadsafe) or Single-Session (threadsafe)
+ SNMP API calls.
+
+ Call with (int)NULL to return the current mode, or with SNMP_API_TRADITIONAL
+ or SNMP_API_SINGLE to set the current mode. (defined above)
+
+ pm side call defaults to (int)NULL
+*/
+int snmp_api_mode( int mode )
+{
+ if (mode == 0)
+ return api_mode;
+ api_mode = mode;
+ return api_mode;
+}
+
+MODULE = SNMP PACKAGE = SNMP PREFIX = snmp
+
+void
+constant(name,arg)
+ char * name
+ int arg
+ INIT:
+ int status;
+ double value;
+ PPCODE:
+ value = 0;
+ status = constant(&value, name, arg);
+ XPUSHs(sv_2mortal(newSVuv(status)));
+ XPUSHs(sv_2mortal(newSVnv(value)));
+
+long
+snmp_sys_uptime()
+ CODE:
+ RETVAL = get_uptime();
+ OUTPUT:
+ RETVAL
+
+void
+init_snmp(appname)
+ char *appname
+ CODE:
+ __libraries_init(appname);
+
+#----------------------------------------------------------------------
+# Perl call defaults to (int)NULL when given no args, so it will return
+# the current api_mode values
+#----------------------------------------------------------------------
+int
+snmp_api_mode(mode=0)
+ int mode
+
+SnmpSession *
+snmp_new_session(version, community, peer, lport, retries, timeout)
+ char * version
+ char * community
+ char * peer
+ int lport
+ int retries
+ int timeout
+ CODE:
+ {
+ SnmpSession session = {0};
+ SnmpSession *ss = NULL;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+
+ __libraries_init("perl");
+
+ session.version = -1;
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (!strcmp(version, "1")) {
+ session.version = SNMP_VERSION_1;
+ }
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ if ((!strcmp(version, "2")) || (!strcmp(version, "2c"))) {
+ session.version = SNMP_VERSION_2c;
+ }
+#endif
+ if (!strcmp(version, "3")) {
+ session.version = SNMP_VERSION_3;
+ }
+ if (session.version == -1) {
+ if (verbose)
+ warn("error:snmp_new_session:Unsupported SNMP version (%s)\n", version);
+ goto end;
+ }
+
+ session.community_len = strlen((char *)community);
+ session.community = (u_char *)community;
+ session.peername = peer;
+ session.local_port = lport;
+ session.retries = retries; /* 5 */
+ session.timeout = timeout; /* 1000000L */
+ session.authenticator = NULL;
+
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ ss = snmp_sess_open(&session);
+ } else {
+ ss = snmp_open(&session);
+ }
+
+ if (ss == NULL) {
+ if (verbose) warn("error:snmp_new_session: Couldn't open SNMP session");
+ }
+ end:
+ RETVAL = ss;
+ }
+ OUTPUT:
+ RETVAL
+
+SnmpSession *
+snmp_new_v3_session(version, peer, retries, timeout, sec_name, sec_level, sec_eng_id, context_eng_id, context, auth_proto, auth_pass, priv_proto, priv_pass, eng_boots, eng_time, auth_master_key, auth_master_key_len, priv_master_key, priv_master_key_len, auth_localized_key, auth_localized_key_len, priv_localized_key, priv_localized_key_len)
+ int version
+ char * peer
+ int retries
+ int timeout
+ char * sec_name
+ int sec_level
+ char * sec_eng_id
+ char * context_eng_id
+ char * context
+ char * auth_proto
+ char * auth_pass
+ char * priv_proto
+ char * priv_pass
+ int eng_boots
+ int eng_time
+ char * auth_master_key
+ size_t auth_master_key_len
+ char * priv_master_key
+ size_t priv_master_key_len
+ char * auth_localized_key
+ size_t auth_localized_key_len
+ char * priv_localized_key
+ size_t priv_localized_key_len
+ CODE:
+ {
+ SnmpSession session = {0};
+ SnmpSession *ss = NULL;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+
+ __libraries_init("perl");
+
+ if (version == 3) {
+ session.version = SNMP_VERSION_3;
+ } else {
+ if (verbose)
+ warn("error:snmp_new_v3_session:Unsupported SNMP version (%d)\n", version);
+ goto end;
+ }
+
+ session.peername = peer;
+ session.retries = retries; /* 5 */
+ session.timeout = timeout; /* 1000000L */
+ session.authenticator = NULL;
+ session.contextNameLen = strlen(context);
+ session.contextName = context;
+ session.securityNameLen = strlen(sec_name);
+ session.securityName = sec_name;
+ session.securityLevel = sec_level;
+ session.securityModel = USM_SEC_MODEL_NUMBER;
+ session.securityEngineIDLen =
+ hex_to_binary2((u_char*)sec_eng_id, strlen(sec_eng_id),
+ (char **) &session.securityEngineID);
+ session.contextEngineIDLen =
+ hex_to_binary2((u_char*)context_eng_id, strlen(context_eng_id),
+ (char **) &session.contextEngineID);
+ session.engineBoots = eng_boots;
+ session.engineTime = eng_time;
+#ifndef NETSNMP_DISABLE_MD5
+ if (!strcmp(auth_proto, "MD5")) {
+ session.securityAuthProto =
+ snmp_duplicate_objid(usmHMACMD5AuthProtocol,
+ USM_AUTH_PROTO_MD5_LEN);
+ session.securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
+ } else
+#endif
+ if (!strcmp(auth_proto, "SHA")) {
+ session.securityAuthProto =
+ snmp_duplicate_objid(usmHMACSHA1AuthProtocol,
+ USM_AUTH_PROTO_SHA_LEN);
+ session.securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
+ } else if (!strcmp(auth_proto, "DEFAULT")) {
+ const oid *theoid =
+ get_default_authtype(&session.securityAuthProtoLen);
+ session.securityAuthProto =
+ snmp_duplicate_objid(theoid, session.securityAuthProtoLen);
+ } else {
+ if (verbose)
+ warn("error:snmp_new_v3_session:Unsupported authentication protocol(%s)\n", auth_proto);
+ goto end;
+ }
+ if (session.securityLevel >= SNMP_SEC_LEVEL_AUTHNOPRIV) {
+ if (auth_localized_key_len) {
+ memdup(&session.securityAuthLocalKey,
+ (u_char*)auth_localized_key,
+ auth_localized_key_len);
+ session.securityAuthLocalKeyLen = auth_localized_key_len;
+ } else if (auth_master_key_len) {
+ session.securityAuthKeyLen =
+ SNMP_MIN(auth_master_key_len,
+ sizeof(session.securityAuthKey));
+ memcpy(session.securityAuthKey, auth_master_key,
+ session.securityAuthKeyLen);
+ } else {
+ if (strlen(auth_pass) > 0) {
+ session.securityAuthKeyLen = USM_AUTH_KU_LEN;
+ if (generate_Ku(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ (u_char *)auth_pass, strlen(auth_pass),
+ session.securityAuthKey,
+ &session.securityAuthKeyLen) != SNMPERR_SUCCESS) {
+ if (verbose)
+ warn("error:snmp_new_v3_session:Error generating Ku from authentication password.\n");
+ goto end;
+ }
+ }
+ }
+ }
+#ifndef NETSNMP_DISABLE_DES
+ if (!strcmp(priv_proto, "DES")) {
+ session.securityPrivProto =
+ snmp_duplicate_objid(usmDESPrivProtocol,
+ USM_PRIV_PROTO_DES_LEN);
+ session.securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN;
+ } else
+#endif
+ if (!strncmp(priv_proto, "AES", 3)) {
+ session.securityPrivProto =
+ snmp_duplicate_objid(usmAESPrivProtocol,
+ USM_PRIV_PROTO_AES_LEN);
+ session.securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
+ } else if (!strcmp(priv_proto, "DEFAULT")) {
+ const oid *theoid =
+ get_default_privtype(&session.securityPrivProtoLen);
+ session.securityPrivProto =
+ snmp_duplicate_objid(theoid, session.securityPrivProtoLen);
+ } else {
+ if (verbose)
+ warn("error:snmp_new_v3_session:Unsupported privacy protocol(%s)\n", priv_proto);
+ goto end;
+ }
+ if (session.securityLevel >= SNMP_SEC_LEVEL_AUTHPRIV) {
+ if (priv_localized_key_len) {
+ memdup(&session.securityPrivLocalKey,
+ (u_char*)priv_localized_key,
+ priv_localized_key_len);
+ session.securityPrivLocalKeyLen = priv_localized_key_len;
+ } else if (priv_master_key_len) {
+ session.securityPrivKeyLen =
+ SNMP_MIN(auth_master_key_len,
+ sizeof(session.securityPrivKey));
+ memcpy(session.securityPrivKey, priv_master_key,
+ session.securityPrivKeyLen);
+ } else {
+ session.securityPrivKeyLen = USM_PRIV_KU_LEN;
+ if (generate_Ku(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ (u_char *)priv_pass, strlen(priv_pass),
+ session.securityPrivKey,
+ &session.securityPrivKeyLen) != SNMPERR_SUCCESS) {
+ if (verbose)
+ warn("error:snmp_new_v3_session:Error generating Ku from privacy pass phrase.\n");
+ goto end;
+ }
+ }
+ }
+
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ ss = snmp_sess_open(&session);
+ } else {
+ ss = snmp_open(&session);
+ }
+
+ if (ss == NULL) {
+ if (verbose) warn("error:snmp_new_v3_session:Couldn't open SNMP session");
+ }
+ end:
+ RETVAL = ss;
+ netsnmp_free(session.securityPrivLocalKey);
+ netsnmp_free(session.securityPrivProto);
+ netsnmp_free(session.securityAuthLocalKey);
+ netsnmp_free(session.securityAuthProto);
+ netsnmp_free(session.contextEngineID);
+ netsnmp_free(session.securityEngineID);
+ }
+ OUTPUT:
+ RETVAL
+
+SnmpSession *
+snmp_new_tunneled_session(version, peer, retries, timeout, sec_name, sec_level, context_eng_id, context, our_identity, their_identity, their_hostname, trust_cert)
+ int version
+ char * peer
+ int retries
+ int timeout
+ char * sec_name
+ int sec_level
+ char * context_eng_id
+ char * context
+ char * our_identity
+ char * their_identity
+ char * their_hostname
+ char * trust_cert
+ CODE:
+ {
+ SnmpSession session = {0};
+ SnmpSession *ss = NULL;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+
+ __libraries_init("perl");
+
+ session.version = version;
+
+ session.peername = peer;
+ session.retries = retries; /* 5 */
+ session.timeout = timeout; /* 1000000L */
+ session.contextNameLen = strlen(context);
+ session.contextName = context;
+ session.securityNameLen = strlen(sec_name);
+ session.securityName = sec_name;
+ session.securityLevel = sec_level;
+ session.securityModel = NETSNMP_TSM_SECURITY_MODEL;
+ session.contextEngineIDLen =
+ hex_to_binary2((u_char*)context_eng_id, strlen(context_eng_id),
+ (char **) &session.contextEngineID);
+
+ /* create the transport configuration store */
+ if (!session.transport_configuration) {
+ netsnmp_container_init_list();
+ session.transport_configuration =
+ netsnmp_container_find("transport_configuration:fifo");
+ if (!session.transport_configuration) {
+ fprintf(stderr, "failed to initialize the transport configuration container\n");
+ RETVAL = NULL;
+ return;
+ }
+
+ session.transport_configuration->compare =
+ (netsnmp_container_compare*)
+ netsnmp_transport_config_compare;
+ }
+
+ if (our_identity && our_identity[0] != '\0')
+ CONTAINER_INSERT(session.transport_configuration,
+ netsnmp_transport_create_config("our_identity",
+ our_identity));
+
+ if (their_identity && their_identity[0] != '\0')
+ CONTAINER_INSERT(session.transport_configuration,
+ netsnmp_transport_create_config("their_identity",
+ their_identity));
+
+ if (their_hostname && their_hostname[0] != '\0')
+ CONTAINER_INSERT(session.transport_configuration,
+ netsnmp_transport_create_config("their_hostname",
+ their_hostname));
+
+ if (trust_cert && trust_cert[0] != '\0')
+ CONTAINER_INSERT(session.transport_configuration,
+ netsnmp_transport_create_config("trust_cert",
+ trust_cert));
+
+
+ ss = snmp_open(&session);
+
+ if (ss == NULL) {
+ if (verbose) warn("error:snmp_new_v3_session:Couldn't open SNMP session");
+ }
+
+ RETVAL = ss;
+ netsnmp_free(session.securityPrivLocalKey);
+ netsnmp_free(session.securityPrivProto);
+ netsnmp_free(session.securityAuthLocalKey);
+ netsnmp_free(session.securityAuthProto);
+ netsnmp_free(session.contextEngineID);
+ netsnmp_free(session.securityEngineID);
+ }
+ OUTPUT:
+ RETVAL
+
+SnmpSession *
+snmp_update_session(sess_ref, version, community, peer, lport, retries, timeout)
+ SV * sess_ref
+ char * version
+ char * community
+ char * peer
+ int lport
+ int retries
+ int timeout
+ CODE:
+ {
+ SV **sess_ptr_sv;
+ SnmpSession *ss;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+
+ if (!ss) goto update_end;
+
+ ss->version = -1;
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (!strcmp(version, "1")) {
+ ss->version = SNMP_VERSION_1;
+ }
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ if (!strcmp(version, "2") || !strcmp(version, "2c")) {
+ ss->version = SNMP_VERSION_2c;
+ }
+#endif
+ if (!strcmp(version, "3")) {
+ ss->version = SNMP_VERSION_3;
+ }
+ if (ss->version == -1) {
+ if (verbose)
+ warn("snmp_update_session: Unsupported SNMP version (%s)\n", version);
+ goto update_end;
+ }
+ /* WARNING LEAKAGE but I cant free lib memory under win32 */
+ ss->community_len = strlen((char *)community);
+ ss->community = (u_char *)netsnmp_strdup(community);
+ ss->peername = netsnmp_strdup(peer);
+ ss->local_port = lport;
+ ss->retries = retries; /* 5 */
+ ss->timeout = timeout; /* 1000000L */
+ ss->authenticator = NULL;
+
+ update_end:
+ RETVAL = ss;
+ }
+ OUTPUT:
+ RETVAL
+
+int
+snmp_add_mib_dir(mib_dir,force=0)
+ char * mib_dir
+ int force
+ CODE:
+ {
+ int result = 0; /* Avoid use of uninitialized variable below. */
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+
+ DBPRT(999, (DBOUT "force=%d\n", force));
+
+ if (mib_dir && *mib_dir) {
+ result = add_mibdir(mib_dir);
+ }
+ if (result) {
+ if (verbose) warn("snmp_add_mib_dir: Added mib dir %s\n", mib_dir);
+ } else {
+ if (verbose) warn("snmp_add_mib_dir: Failed to add %s\n", mib_dir);
+ }
+ RETVAL = (I32)result;
+ }
+ OUTPUT:
+ RETVAL
+
+void
+snmp_init_mib_internals()
+ CODE:
+ {
+ int notused = 1; notused++;
+ /* this function does nothing */
+ /* it is kept only for backwards compatibility */
+ }
+
+
+char *
+snmp_getenv(name)
+ char *name;
+CODE:
+ RETVAL = netsnmp_getenv(name);
+OUTPUT:
+ RETVAL
+
+int
+snmp_setenv(envname, envval, overwrite)
+ char *envname;
+ char *envval;
+ int overwrite;
+CODE:
+ RETVAL = netsnmp_setenv(envname, envval, overwrite);
+OUTPUT:
+ RETVAL
+
+int
+snmp_read_mib(mib_file, force=0)
+ char * mib_file
+ int force
+ CODE:
+ {
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+
+ DBPRT(999, (DBOUT "force=%d\n", force));
+
+ if ((mib_file == NULL) || (*mib_file == '\0')) {
+ if (get_tree_head() == NULL) {
+ if (verbose) warn("snmp_read_mib: initializing MIB\n");
+ netsnmp_init_mib();
+ if (get_tree_head()) {
+ if (verbose) warn("done\n");
+ } else {
+ if (verbose) warn("failed\n");
+ }
+ }
+ } else {
+ if (verbose) warn("snmp_read_mib: reading MIB: %s\n", mib_file);
+ if (strcmp("ALL",mib_file))
+ read_mib(mib_file);
+ else
+ read_all_mibs();
+ if (get_tree_head()) {
+ if (verbose) warn("done\n");
+ } else {
+ if (verbose) warn("failed\n");
+ }
+ }
+ RETVAL = (IV)get_tree_head();
+ }
+ OUTPUT:
+ RETVAL
+
+
+int
+snmp_read_module(module)
+ char * module
+ CODE:
+ {
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+
+ if (!strcmp(module,"ALL")) {
+ read_all_mibs();
+ } else {
+ netsnmp_read_module(module);
+ }
+ if (get_tree_head()) {
+ if (verbose) warn("Read %s\n", module);
+ } else {
+ if (verbose) warn("Failed reading %s\n", module);
+ }
+ RETVAL = (IV)get_tree_head();
+ }
+ OUTPUT:
+ RETVAL
+
+
+void
+snmp_set(sess_ref, varlist_ref, perl_callback)
+ SV * sess_ref
+ SV * varlist_ref
+ SV * perl_callback
+ PPCODE:
+ {
+ AV *varlist;
+ SV **varbind_ref;
+ SV **varbind_val_f;
+ AV *varbind;
+ I32 varlist_len;
+ I32 varlist_ind;
+ SnmpSession *ss;
+ netsnmp_pdu *pdu, *response;
+ struct tree *tp;
+ oid *oid_arr;
+ size_t oid_arr_len = MAX_OID_LEN;
+ char *tag_pv;
+ snmp_xs_cb_data *xs_cb_data;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+ SV **err_ind_svp;
+ int status = 0;
+ int type;
+ int res;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+ int use_enums;
+ struct enum_list *ep;
+ int best_guess;
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+
+ New (0, oid_arr, MAX_OID_LEN, oid);
+
+ if (oid_arr && SvROK(sess_ref) && SvROK(varlist_ref)) {
+
+ use_enums = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseEnums",8,1));
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+ sv_setpv(*err_str_svp, "");
+ sv_setiv(*err_num_svp, 0);
+ sv_setiv(*err_ind_svp, 0);
+ best_guess = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"BestGuess",9,1));
+
+ pdu = snmp_pdu_create(SNMP_MSG_SET);
+
+ varlist = (AV*) SvRV(varlist_ref);
+ varlist_len = av_len(varlist);
+ for(varlist_ind = 0; varlist_ind <= varlist_len; varlist_ind++) {
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (SvROK(*varbind_ref)) {
+ varbind = (AV*) SvRV(*varbind_ref);
+ tag_pv = __av_elem_pv(varbind, VARBIND_TAG_F,NULL);
+ tp=__tag2oid(tag_pv,
+ __av_elem_pv(varbind, VARBIND_IID_F,NULL),
+ oid_arr, &oid_arr_len, &type, best_guess);
+
+ if (oid_arr_len==0) {
+ if (verbose)
+ warn("error: set: unknown object ID (%s)",
+ (tag_pv?tag_pv:"<null>"));
+ sv_catpv(*err_str_svp,
+ (char*)snmp_api_errstring(SNMPERR_UNKNOWN_OBJID));
+ sv_setiv(*err_num_svp, SNMPERR_UNKNOWN_OBJID);
+ XPUSHs(&sv_undef); /* unknown OID */
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+
+ if (type == TYPE_UNKNOWN) {
+ type = __translate_appl_type(
+ __av_elem_pv(varbind, VARBIND_TYPE_F, NULL));
+ if (type == TYPE_UNKNOWN) {
+ if (verbose)
+ warn("error: set: no type found for object");
+ sv_catpv(*err_str_svp,
+ (char*)snmp_api_errstring(SNMPERR_VAR_TYPE));
+ sv_setiv(*err_num_svp, SNMPERR_VAR_TYPE);
+ XPUSHs(&sv_undef); /* unknown OID */
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ }
+
+ varbind_val_f = av_fetch(varbind, VARBIND_VAL_F, 0);
+
+ if (type==TYPE_INTEGER && use_enums && tp && tp->enums) {
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (varbind_val_f && SvOK(*varbind_val_f) &&
+ !strcmp(ep->label, SvPV(*varbind_val_f,na))) {
+ sv_setiv(*varbind_val_f, ep->value);
+ break;
+ }
+ }
+ }
+
+ res = __add_var_val_str(pdu, oid_arr, oid_arr_len,
+ (varbind_val_f && SvOK(*varbind_val_f) ?
+ SvPV(*varbind_val_f,na):NULL),
+ (varbind_val_f && SvPOK(*varbind_val_f) ?
+ SvCUR(*varbind_val_f):0), type);
+
+ if (verbose && res == FAILURE)
+ warn("error: set: adding variable/value to PDU");
+ } /* if var_ref is ok */
+ } /* for all the vars */
+
+ if (SvTRUE(perl_callback)) {
+ xs_cb_data =
+ (snmp_xs_cb_data*)malloc(sizeof(snmp_xs_cb_data));
+ xs_cb_data->perl_cb = newSVsv(perl_callback);
+ xs_cb_data->sess_ref = newRV_inc(SvRV(sess_ref));
+
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ status = snmp_sess_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ } else {
+ status = snmp_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ }
+ if (status != 0) {
+ XPUSHs(sv_2mortal(newSViv(status))); /* push the reqid?? */
+ } else {
+ snmp_free_pdu(pdu);
+ snmp_return_err(ss, *err_str_svp, *err_num_svp, *err_ind_svp);
+ XPUSHs(&sv_undef);
+ }
+ goto done;
+ }
+
+ status = __send_sync_pdu(ss, pdu, &response,
+ NO_RETRY_NOSUCH,
+ *err_str_svp, *err_num_svp,
+ *err_ind_svp);
+
+ if (response) snmp_free_pdu(response);
+
+ if (status) {
+ XPUSHs(&sv_undef);
+ } else {
+ XPUSHs(sv_2mortal(newSVpv(ZERO_BUT_TRUE,0)));
+ }
+ } else {
+
+ /* BUG!!! need to return an error value */
+ XPUSHs(&sv_undef); /* no mem or bad args */
+ }
+#else /* NETSNMP_NO_WRITE_SUPPORT */
+ warn("error: Net-SNMP was compiled using --enable-read-only, set() can not be used.");
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+done:
+ Safefree(oid_arr);
+ }
+
+void
+snmp_catch(sess_ref, perl_callback)
+ SV * sess_ref
+ SV * perl_callback
+ PPCODE:
+ {
+ netsnmp_session *ss;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+ SV **err_ind_svp;
+
+ if (SvROK(sess_ref)) {
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+ sv_setpv(*err_str_svp, "");
+ sv_setiv(*err_num_svp, 0);
+ sv_setiv(*err_ind_svp, 0);
+
+ ss->callback = NULL;
+ ss->callback_magic = NULL;
+
+ if (SvTRUE(perl_callback)) {
+ snmp_xs_cb_data *xs_cb_data;
+ xs_cb_data =
+ (snmp_xs_cb_data*)malloc(sizeof(snmp_xs_cb_data));
+ xs_cb_data->perl_cb = newSVsv(perl_callback);
+ xs_cb_data->sess_ref = newRV_inc(SvRV(sess_ref));
+
+ # it might be more efficient to pass the varbind_ref to
+ # __snmp_xs_cb as part of perl_callback so it is not freed
+ # and reconstructed for each call
+ ss->callback = __snmp_xs_cb;
+ ss->callback_magic = xs_cb_data;
+ sv_2mortal(newSViv(1));
+ goto done;
+ }
+ }
+ sv_2mortal(newSViv(0));
+ done:
+ ;
+ }
+
+void
+snmp_get(sess_ref, retry_nosuch, varlist_ref, perl_callback)
+ SV * sess_ref
+ int retry_nosuch
+ SV * varlist_ref
+ SV * perl_callback
+ PPCODE:
+ {
+ AV *varlist;
+ SV **varbind_ref;
+ AV *varbind;
+ I32 varlist_len;
+ I32 varlist_ind;
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ struct tree *tp;
+ int len;
+ oid *oid_arr;
+ size_t oid_arr_len = MAX_OID_LEN;
+ SV *tmp_sv;
+ int type;
+ char tmp_type_str[MAX_TYPE_NAME_LEN];
+ snmp_xs_cb_data *xs_cb_data;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+ SV **err_ind_svp;
+ int status;
+ char str_buf[STR_BUF_SIZE], *str_bufp = str_buf;
+ size_t str_buf_len = sizeof(str_buf);
+ size_t out_len = 0;
+ int buf_over = 0;
+ char *label;
+ char *iid;
+ int getlabel_flag = NO_FLAGS;
+ int sprintval_flag = USE_BASIC;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+ int old_format;
+ SV *sv_timestamp = NULL;
+ int best_guess;
+
+ New (0, oid_arr, MAX_OID_LEN, oid);
+
+ if (oid_arr && SvROK(sess_ref) && SvROK(varlist_ref)) {
+
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+ sv_setpv(*err_str_svp, "");
+ sv_setiv(*err_num_svp, 0);
+ sv_setiv(*err_ind_svp, 0);
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseLongNames", 12, 1)))
+ getlabel_flag |= USE_LONG_NAMES;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseNumeric", 10, 1)))
+ getlabel_flag |= USE_NUMERIC_OIDS;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseEnums", 8, 1)))
+ sprintval_flag = USE_ENUMS;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseSprintValue", 14, 1)))
+ sprintval_flag = USE_SPRINT_VALUE;
+ best_guess = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"BestGuess",9,1));
+
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+
+ varlist = (AV*) SvRV(varlist_ref);
+ varlist_len = av_len(varlist);
+ for(varlist_ind = 0; varlist_ind <= varlist_len; varlist_ind++) {
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (SvROK(*varbind_ref)) {
+ char *tag_pv;
+ varbind = (AV*) SvRV(*varbind_ref);
+
+ tag_pv = __av_elem_pv(varbind, VARBIND_TAG_F, ".0");
+ tp = __tag2oid(tag_pv,
+ __av_elem_pv(varbind, VARBIND_IID_F, NULL),
+ oid_arr, &oid_arr_len, NULL, best_guess);
+
+ if (oid_arr_len) {
+ snmp_add_null_var(pdu, oid_arr, oid_arr_len);
+ } else {
+ if (verbose)
+ warn("error: get: unknown object ID (%s)",
+ (tag_pv?tag_pv:"<null>"));
+ sv_catpv(*err_str_svp,
+ (char*)snmp_api_errstring(SNMPERR_UNKNOWN_OBJID));
+ sv_setiv(*err_num_svp, SNMPERR_UNKNOWN_OBJID);
+ XPUSHs(&sv_undef); /* unknown OID */
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+ } /* if var_ref is ok */
+ } /* for all the vars */
+
+ if (perl_callback && SvTRUE(perl_callback)) {
+ xs_cb_data =
+ (snmp_xs_cb_data*)malloc(sizeof(snmp_xs_cb_data));
+ xs_cb_data->perl_cb = newSVsv(perl_callback);
+ xs_cb_data->sess_ref = newSVsv(sess_ref);
+
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ status = snmp_sess_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ } else {
+ status = snmp_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ }
+ if (status != 0) {
+ XPUSHs(sv_2mortal(newSViv(status))); /* push the reqid?? */
+ } else {
+ snmp_free_pdu(pdu);
+ snmp_return_err(ss, *err_num_svp, *err_ind_svp, *err_str_svp);
+ XPUSHs(&sv_undef);
+ }
+ goto done;
+ }
+
+ status = __send_sync_pdu(ss, pdu, &response,
+ retry_nosuch,
+ *err_str_svp, *err_num_svp,
+ *err_ind_svp);
+
+ /*
+ ** Set up for numeric or full OID's, if necessary. Save the old
+ ** output format so that it can be restored when we finish -- this
+ ** is a library-wide global, and has to be set/restored for each
+ ** session.
+ */
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseLongNames", 12, 1))) {
+ getlabel_flag |= USE_LONG_NAMES;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_FULL);
+ }
+ /* Setting UseNumeric forces UseLongNames on so check for UseNumeric
+ after UseLongNames (above) to make sure the final outcome of
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT is NETSNMP_OID_OUTPUT_NUMERIC */
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseNumeric", 10, 1))) {
+ getlabel_flag |= USE_LONG_NAMES;
+ getlabel_flag |= USE_NUMERIC_OIDS;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+
+ if (SvIOK(*hv_fetch((HV*)SvRV(sess_ref),"TimeStamp", 9, 1)) &&
+ SvIV(*hv_fetch((HV*)SvRV(sess_ref),"TimeStamp", 9, 1)))
+ sv_timestamp = newSViv((IV)time(NULL));
+
+ for(vars = (response?response->variables:NULL), varlist_ind = 0;
+ vars && (varlist_ind <= varlist_len);
+ vars = vars->next_variable, varlist_ind++) {
+ int local_getlabel_flag = getlabel_flag;
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (SvROK(*varbind_ref)) {
+ varbind = (AV*) SvRV(*varbind_ref);
+
+ *str_buf = '.';
+ *(str_buf+1) = '\0';
+ out_len = 0;
+ tp = netsnmp_sprint_realloc_objid_tree((u_char**)&str_bufp,
+ &str_buf_len,
+ &out_len, 0,
+ &buf_over,
+ vars->name,
+ vars->name_length);
+ str_buf[sizeof(str_buf)-1] = '\0';
+
+ if (__is_leaf(tp)) {
+ type = tp->type;
+ } else {
+ local_getlabel_flag |= NON_LEAF_NAME;
+ type = __translate_asn_type(vars->type);
+ }
+ __get_label_iid(str_buf,&label,&iid,local_getlabel_flag);
+ if (label) {
+ av_store(varbind, VARBIND_TAG_F,
+ newSVpv(label, strlen(label)));
+ } else {
+ av_store(varbind, VARBIND_TAG_F,
+ newSVpv("", 0));
+ }
+ if (iid) {
+ av_store(varbind, VARBIND_IID_F,
+ newSVpv(iid, strlen(iid)));
+ } else {
+ av_store(varbind, VARBIND_IID_F,
+ newSVpv("", 0));
+ }
+ __get_type_str(type, tmp_type_str);
+ tmp_sv = newSVpv(tmp_type_str, strlen(tmp_type_str));
+ av_store(varbind, VARBIND_TYPE_F, tmp_sv);
+ len=__snprint_value(str_buf,sizeof(str_buf),
+ vars,tp,type,sprintval_flag);
+ tmp_sv = newSVpv(str_buf, len);
+ av_store(varbind, VARBIND_VAL_F, tmp_sv);
+ if (sv_timestamp)
+ av_store(varbind, VARBIND_TYPE_F, sv_timestamp);
+ XPUSHs(sv_mortalcopy(tmp_sv));
+ } else {
+ /* Return undef for this variable. */
+ XPUSHs(&sv_undef);
+ }
+ }
+
+ /* Reset the library's behavior for numeric/symbolic OID's. */
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ old_format);
+
+ if (response) snmp_free_pdu(response);
+
+ } else {
+ XPUSHs(&sv_undef); /* no mem or bad args */
+ }
+done:
+ Safefree(oid_arr);
+ }
+
+void
+snmp_getnext(sess_ref, varlist_ref, perl_callback)
+ SV * sess_ref
+ SV * varlist_ref
+ SV * perl_callback
+ PPCODE:
+ {
+ AV *varlist;
+ SV **varbind_ref;
+ AV *varbind;
+ I32 varlist_len;
+ I32 varlist_ind;
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ struct tree *tp;
+ int len;
+ oid *oid_arr;
+ size_t oid_arr_len = MAX_OID_LEN;
+ SV *tmp_sv;
+ int type;
+ char tmp_type_str[MAX_TYPE_NAME_LEN];
+ snmp_xs_cb_data *xs_cb_data;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+ SV **err_ind_svp;
+ int status;
+ char str_buf[STR_BUF_SIZE], *str_bufp = str_buf;
+ size_t str_buf_len = sizeof(str_buf);
+ char tmp_buf_prefix[STR_BUF_SIZE];
+ char str_buf_prefix[STR_BUF_SIZE];
+ size_t out_len = 0;
+ int buf_over = 0;
+ char *label;
+ char *iid;
+ int getlabel_flag = NO_FLAGS;
+ int sprintval_flag = USE_BASIC;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+ int old_format;
+ SV *sv_timestamp = NULL;
+ int best_guess;
+ char *tmp_prefix_ptr;
+ char *st;
+
+ New (0, oid_arr, MAX_OID_LEN, oid);
+
+ if (oid_arr && SvROK(sess_ref) && SvROK(varlist_ref)) {
+
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+ sv_setpv(*err_str_svp, "");
+ sv_setiv(*err_num_svp, 0);
+ sv_setiv(*err_ind_svp, 0);
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseLongNames", 12, 1)))
+ getlabel_flag |= USE_LONG_NAMES;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseNumeric", 10, 1)))
+ getlabel_flag |= USE_NUMERIC_OIDS;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseEnums", 8, 1)))
+ sprintval_flag = USE_ENUMS;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseSprintValue", 14, 1)))
+ sprintval_flag = USE_SPRINT_VALUE;
+ best_guess = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"BestGuess",9,1));
+
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+
+ varlist = (AV*) SvRV(varlist_ref);
+ varlist_len = av_len(varlist);
+ for(varlist_ind = 0; varlist_ind <= varlist_len; varlist_ind++) {
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (SvROK(*varbind_ref)) {
+ char *tag_pv;
+ varbind = (AV*) SvRV(*varbind_ref);
+
+ /* If the varbind includes the module prefix, capture it for use later */
+ strlcpy(tmp_buf_prefix, __av_elem_pv(varbind, VARBIND_TAG_F, ".0"), STR_BUF_SIZE);
+ tmp_prefix_ptr = strstr(tmp_buf_prefix,"::");
+ if (tmp_prefix_ptr) {
+ tmp_prefix_ptr = strtok_r(tmp_buf_prefix, "::", &st);
+ strlcpy(str_buf_prefix, tmp_prefix_ptr, STR_BUF_SIZE);
+ }
+ else {
+ *str_buf_prefix = '\0';
+ }
+
+ tag_pv = __av_elem_pv(varbind, VARBIND_TAG_F, ".0");
+ tp = __tag2oid(tag_pv,
+ __av_elem_pv(varbind, VARBIND_IID_F, NULL),
+ oid_arr, &oid_arr_len, NULL, best_guess);
+
+ if (oid_arr_len) {
+ snmp_add_null_var(pdu, oid_arr, oid_arr_len);
+ } else {
+ if (verbose)
+ warn("error: getnext: unknown object ID (%s)",
+ (tag_pv?tag_pv:"<null>"));
+ sv_catpv(*err_str_svp,
+ (char*)snmp_api_errstring(SNMPERR_UNKNOWN_OBJID));
+ sv_setiv(*err_num_svp, SNMPERR_UNKNOWN_OBJID);
+ XPUSHs(&sv_undef); /* unknown OID */
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+ } /* if var_ref is ok */
+ } /* for all the vars */
+
+ if (SvTRUE(perl_callback)) {
+ xs_cb_data =
+ (snmp_xs_cb_data*)malloc(sizeof(snmp_xs_cb_data));
+ xs_cb_data->perl_cb = newSVsv(perl_callback);
+ xs_cb_data->sess_ref = newSVsv(sess_ref);
+
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ status = snmp_sess_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ } else {
+ status = snmp_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ }
+ if (status != 0) {
+ XPUSHs(sv_2mortal(newSViv(status))); /* push the reqid?? */
+ } else {
+ snmp_free_pdu(pdu);
+ snmp_return_err(ss, *err_num_svp, *err_ind_svp, *err_str_svp);
+ XPUSHs(&sv_undef);
+ }
+ goto done;
+ }
+
+ status = __send_sync_pdu(ss, pdu, &response,
+ NO_RETRY_NOSUCH,
+ *err_str_svp, *err_num_svp,
+ *err_ind_svp);
+
+ /*
+ ** Set up for numeric or full OID's, if necessary. Save the old
+ ** output format so that it can be restored when we finish -- this
+ ** is a library-wide global, and has to be set/restored for each
+ ** session.
+ */
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseLongNames", 12, 1))) {
+ getlabel_flag |= USE_LONG_NAMES;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_FULL);
+ }
+ /* Setting UseNumeric forces UseLongNames on so check
+ for UseNumeric after UseLongNames (above) to make
+ sure the final outcome of
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT is
+ NETSNMP_OID_OUTPUT_NUMERIC */
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseNumeric", 10, 1))) {
+ getlabel_flag |= USE_LONG_NAMES;
+ getlabel_flag |= USE_NUMERIC_OIDS;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+
+ if (SvIOK(*hv_fetch((HV*)SvRV(sess_ref),"TimeStamp", 9, 1)) &&
+ SvIV(*hv_fetch((HV*)SvRV(sess_ref),"TimeStamp", 9, 1)))
+ sv_timestamp = newSViv((IV)time(NULL));
+
+ for(vars = (response?response->variables:NULL), varlist_ind = 0;
+ vars && (varlist_ind <= varlist_len);
+ vars = vars->next_variable, varlist_ind++) {
+ int local_getlabel_flag = getlabel_flag;
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (SvROK(*varbind_ref)) {
+ varbind = (AV*) SvRV(*varbind_ref);
+
+ *str_buf = '.';
+ *(str_buf+1) = '\0';
+ out_len = 0;
+ tp = netsnmp_sprint_realloc_objid_tree((u_char**)&str_bufp,
+ &str_buf_len,
+ &out_len, 0,
+ &buf_over,
+ vars->name,
+ vars->name_length);
+ str_buf[sizeof(str_buf)-1] = '\0';
+
+ /* Prepend the module prefix to the next OID if needed */
+ if (*str_buf_prefix) {
+ strlcat(str_buf_prefix, "::", STR_BUF_SIZE);
+ strlcat(str_buf_prefix, str_buf, STR_BUF_SIZE);
+ strlcpy(str_buf, str_buf_prefix, STR_BUF_SIZE);
+ }
+
+ if (__is_leaf(tp)) {
+ type = tp->type;
+ } else {
+ local_getlabel_flag |= NON_LEAF_NAME;
+ type = __translate_asn_type(vars->type);
+ }
+ __get_label_iid(str_buf,&label,&iid,local_getlabel_flag);
+ if (label) {
+ av_store(varbind, VARBIND_TAG_F,
+ newSVpv(label, strlen(label)));
+ } else {
+ av_store(varbind, VARBIND_TAG_F,
+ newSVpv("", 0));
+ }
+ if (iid) {
+ av_store(varbind, VARBIND_IID_F,
+ newSVpv(iid, strlen(iid)));
+ } else {
+ av_store(varbind, VARBIND_IID_F,
+ newSVpv("", 0));
+ }
+ __get_type_str(type, tmp_type_str);
+ tmp_sv = newSVpv(tmp_type_str, strlen(tmp_type_str));
+ av_store(varbind, VARBIND_TYPE_F, tmp_sv);
+ len=__snprint_value(str_buf,sizeof(str_buf),
+ vars,tp,type,sprintval_flag);
+ tmp_sv = newSVpv(str_buf, len);
+ av_store(varbind, VARBIND_VAL_F, tmp_sv);
+ if (sv_timestamp)
+ av_store(varbind, VARBIND_TYPE_F, sv_timestamp);
+ XPUSHs(sv_mortalcopy(tmp_sv));
+ } else {
+ /* Return undef for this variable. */
+ XPUSHs(&sv_undef);
+ }
+ }
+
+ /* Reset the library's behavior for numeric/symbolic OID's. */
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ old_format);
+
+ if (response) snmp_free_pdu(response);
+
+ } else {
+ XPUSHs(&sv_undef); /* no mem or bad args */
+ }
+done:
+ Safefree(oid_arr);
+ }
+
+void
+snmp_getbulk(sess_ref, nonrepeaters, maxrepetitions, varlist_ref, perl_callback)
+ SV * sess_ref
+ int nonrepeaters
+ int maxrepetitions
+ SV * varlist_ref
+ SV * perl_callback
+ PPCODE:
+ {
+ AV *varlist;
+ SV **varbind_ref;
+ AV *varbind;
+ I32 varlist_len;
+ I32 varlist_ind;
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ struct tree *tp;
+ int len;
+ oid *oid_arr;
+ size_t oid_arr_len = MAX_OID_LEN;
+ SV *tmp_sv;
+ int type;
+ char tmp_type_str[MAX_TYPE_NAME_LEN];
+ snmp_xs_cb_data *xs_cb_data;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+ SV **err_ind_svp;
+ int status;
+ char str_buf[STR_BUF_SIZE], *str_bufp = str_buf;
+ size_t str_buf_len = sizeof(str_buf);
+ size_t out_len = 0;
+ int buf_over = 0;
+ char *label;
+ char *iid;
+ int getlabel_flag = NO_FLAGS;
+ int sprintval_flag = USE_BASIC;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+ int old_format;
+ SV *rv;
+ SV *sv_timestamp = NULL;
+ int best_guess;
+
+ New (0, oid_arr, MAX_OID_LEN, oid);
+
+ if (oid_arr && SvROK(sess_ref) && SvROK(varlist_ref)) {
+
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+ sv_setpv(*err_str_svp, "");
+ sv_setiv(*err_num_svp, 0);
+ sv_setiv(*err_ind_svp, 0);
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseLongNames", 12, 1)))
+ getlabel_flag |= USE_LONG_NAMES;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseNumeric", 10, 1)))
+ getlabel_flag |= USE_NUMERIC_OIDS;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseEnums", 8, 1)))
+ sprintval_flag = USE_ENUMS;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseSprintValue", 14, 1)))
+ sprintval_flag = USE_SPRINT_VALUE;
+ best_guess = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"BestGuess",9,1));
+
+ pdu = snmp_pdu_create(SNMP_MSG_GETBULK);
+
+ pdu->errstat = nonrepeaters;
+ pdu->errindex = maxrepetitions;
+
+ varlist = (AV*) SvRV(varlist_ref);
+ varlist_len = av_len(varlist);
+ for(varlist_ind = 0; varlist_ind <= varlist_len; varlist_ind++) {
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (SvROK(*varbind_ref)) {
+ char *tag_pv;
+ varbind = (AV*) SvRV(*varbind_ref);
+ tag_pv = __av_elem_pv(varbind, VARBIND_TAG_F, "0");
+ __tag2oid(tag_pv,
+ __av_elem_pv(varbind, VARBIND_IID_F, NULL),
+ oid_arr, &oid_arr_len, NULL, best_guess);
+
+
+ if (oid_arr_len) {
+ snmp_add_null_var(pdu, oid_arr, oid_arr_len);
+ } else {
+ if (verbose)
+ warn("error: getbulk: unknown object ID (%s)",
+ (tag_pv?tag_pv:"<null>"));
+ sv_catpv(*err_str_svp,
+ (char*)snmp_api_errstring(SNMPERR_UNKNOWN_OBJID));
+ sv_setiv(*err_num_svp, SNMPERR_UNKNOWN_OBJID);
+ XPUSHs(&sv_undef); /* unknown OID */
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+
+ } /* if var_ref is ok */
+ } /* for all the vars */
+
+ if (SvTRUE(perl_callback)) {
+ xs_cb_data =
+ (snmp_xs_cb_data*)malloc(sizeof(snmp_xs_cb_data));
+ xs_cb_data->perl_cb = newSVsv(perl_callback);
+ xs_cb_data->sess_ref = newSVsv(sess_ref);
+
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ status = snmp_sess_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ } else {
+ status = snmp_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ }
+ if (status != 0) {
+ XPUSHs(sv_2mortal(newSViv(status))); /* push the reqid?? */
+ } else {
+ snmp_free_pdu(pdu);
+ snmp_return_err(ss, *err_num_svp, *err_ind_svp, *err_str_svp);
+ XPUSHs(&sv_undef);
+ }
+ goto done;
+ }
+
+ status = __send_sync_pdu(ss, pdu, &response,
+ NO_RETRY_NOSUCH,
+ *err_str_svp, *err_num_svp,
+ *err_ind_svp);
+
+ if (SvIOK(*hv_fetch((HV*)SvRV(sess_ref),"TimeStamp", 9, 1)) &&
+ SvIV(*hv_fetch((HV*)SvRV(sess_ref),"TimeStamp", 9, 1)))
+ sv_timestamp = newSViv((IV)time(NULL));
+
+ av_clear(varlist);
+
+ /*
+ ** Set up for numeric or full OID's, if necessary. Save the old
+ ** output format so that it can be restored when we finish -- this
+ ** is a library-wide global, and has to be set/restored for each
+ ** session.
+ */
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseLongNames", 12, 1))) {
+ getlabel_flag |= USE_LONG_NAMES;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_FULL);
+ }
+ /* Setting UseNumeric forces UseLongNames on so check for UseNumeric
+ after UseLongNames (above) to make sure the final outcome of
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT is NETSNMP_OID_OUTPUT_NUMERIC */
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseNumeric", 10, 1))) {
+ getlabel_flag |= USE_LONG_NAMES;
+ getlabel_flag |= USE_NUMERIC_OIDS;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+
+ if(response && response->variables) {
+ for(vars = response->variables;
+ vars;
+ vars = vars->next_variable) {
+
+ int local_getlabel_flag = getlabel_flag;
+ varbind = (AV*) newAV();
+ *str_buf = '.';
+ *(str_buf+1) = '\0';
+ out_len = 0;
+ buf_over = 0;
+ str_bufp = str_buf;
+ tp = netsnmp_sprint_realloc_objid_tree((u_char**)&str_bufp,
+ &str_buf_len,
+ &out_len, 0,
+ &buf_over,
+ vars->name,
+ vars->name_length);
+ str_buf[sizeof(str_buf)-1] = '\0';
+ if (__is_leaf(tp)) {
+ type = tp->type;
+ } else {
+ local_getlabel_flag |= NON_LEAF_NAME;
+ type = __translate_asn_type(vars->type);
+ }
+ __get_label_iid(str_buf,&label,&iid,local_getlabel_flag);
+ if (label) {
+ av_store(varbind, VARBIND_TAG_F,
+ newSVpv(label, strlen(label)));
+ } else {
+ av_store(varbind, VARBIND_TAG_F,
+ newSVpv("", 0));
+ }
+ if (iid) {
+ av_store(varbind, VARBIND_IID_F,
+ newSVpv(iid, strlen(iid)));
+ } else {
+ av_store(varbind, VARBIND_IID_F,
+ newSVpv("", 0));
+ }
+ __get_type_str(type, tmp_type_str);
+ av_store(varbind, VARBIND_TYPE_F, newSVpv(tmp_type_str,
+ strlen(tmp_type_str)));
+
+ len=__snprint_value(str_buf,sizeof(str_buf),
+ vars,tp,type,sprintval_flag);
+ tmp_sv = newSVpv(str_buf, len);
+ av_store(varbind, VARBIND_VAL_F, tmp_sv);
+ if (sv_timestamp)
+ av_store(varbind, VARBIND_TYPE_F, SvREFCNT_inc(sv_timestamp));
+
+ rv = newRV_noinc((SV *)varbind);
+ sv_bless(rv, gv_stashpv("SNMP::Varbind",0));
+ av_push(varlist, rv);
+
+ XPUSHs(sv_mortalcopy(tmp_sv));
+ }
+ } else {
+ XPUSHs(&sv_undef);
+ }
+
+ /* Reset the library's behavior for numeric/symbolic OID's. */
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ old_format);
+
+ if (response) snmp_free_pdu(response);
+
+ } else {
+ XPUSHs(&sv_undef); /* no mem or bad args */
+ }
+done:
+ Safefree(oid_arr);
+ }
+
+void
+snmp_bulkwalk(sess_ref, nonrepeaters, maxrepetitions, varlist_ref,perl_callback)
+ SV * sess_ref
+ int nonrepeaters
+ int maxrepetitions
+ SV * varlist_ref
+ SV * perl_callback
+ PPCODE:
+ {
+ AV *varlist;
+ SV **varbind_ref;
+ AV *varbind;
+ I32 varlist_len;
+ I32 varlist_ind;
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu = NULL;
+ oid oid_arr[MAX_OID_LEN];
+ size_t oid_arr_len;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+ SV **err_ind_svp;
+ char str_buf[STR_BUF_SIZE];
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+ walk_context *context = NULL; /* Context for this bulkwalk */
+ bulktbl *bt_entry; /* Current bulktbl/OID entry */
+ int i; /* General purpose iterator */
+ int npushed; /* Number of return arrays */
+ int okay; /* Did bulkwalk complete okay */
+ int best_guess;
+
+ if (!SvROK(sess_ref) || !SvROK(varlist_ref)) {
+ if (verbose)
+ warn("bulkwalk: Bad session or varlist reference!\n");
+
+ XSRETURN_UNDEF;
+ }
+
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+ sv_setpv(*err_str_svp, "");
+ sv_setiv(*err_num_svp, 0);
+ sv_setiv(*err_ind_svp, 0);
+ best_guess = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"BestGuess",9,1));
+
+ /* Create and initialize a new session context for this bulkwalk.
+ ** This will be used to carry state between callbacks.
+ */
+ Newz(0x57616b6c /* "Walk" */, context, 1, walk_context);
+ if (context == NULL) {
+ sprintf(str_buf, "malloc(context) failed (%s)", strerror(errno));
+ sv_setpv(*err_str_svp, str_buf);
+ sv_setiv(*err_num_svp, SNMPERR_MALLOC);
+ goto err;
+ }
+
+ /* Store the Perl callback and session reference in the context. */
+ context->perl_cb = newSVsv(perl_callback);
+ context->sess_ref = newSVsv(sess_ref);
+
+ DBPRT(3,(DBOUT "bulkwalk: sess_ref = 0x%p, sess_ptr_sv = 0x%p, ss = 0x%p\n",
+ sess_ref, sess_ptr_sv, ss));
+
+ context->getlabel_f = NO_FLAGS; /* long/numeric name flags */
+ context->sprintval_f = USE_BASIC; /* Don't do fancy printing */
+ context->req_oids = NULL; /* List of oid's requested */
+ context->repbase = NULL; /* Repeaters in req_oids[] */
+ context->reqbase = NULL; /* Ptr to start of requests */
+ context->nreq_oids = 0; /* Number of oid's in list */
+ context->repeaters = 0; /* Repeater count (see below) */
+ context->non_reps = nonrepeaters; /* Non-repeater var count */
+ context->max_reps = maxrepetitions; /* Max repetition/var count */
+ context->pkts_exch = 0; /* Packets exchanged in walk */
+ context->oid_total = 0; /* OID's received during walk */
+ context->oid_saved = 0; /* OID's saved as results */
+
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseLongNames", 12, 1)))
+ context->getlabel_f |= USE_LONG_NAMES;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseNumeric", 10, 1)))
+ context->getlabel_f |= USE_NUMERIC_OIDS;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseEnums", 8, 1)))
+ context->sprintval_f = USE_ENUMS;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseSprintValue", 14, 1)))
+ context->sprintval_f = USE_SPRINT_VALUE;
+
+ /* Set up an array of bulktbl's to hold the original list of
+ ** requested OID's. This is used to populate the PDU's with
+ ** oid values, to contain/sort the return values, and (through
+ ** last_oid/last_len) to determine when the bulkwalk for each
+ ** variable has completed.
+ */
+ varlist = (AV*) SvRV(varlist_ref);
+ varlist_len = av_len(varlist) + 1; /* XXX av_len returns index of
+ ** last element not #elements */
+
+ Newz(0, context->req_oids, varlist_len, bulktbl);
+
+ if (context->req_oids == NULL) {
+ sprintf(str_buf, "Newz(req_oids) failed (%s)", strerror(errno));
+ if (verbose)
+ warn("%s", str_buf);
+ sv_setpv(*err_str_svp, str_buf);
+ sv_setiv(*err_num_svp, SNMPERR_MALLOC);
+ goto err;
+ }
+
+ /* Walk through the varbind_list, parsing and copying each OID
+ ** into a bulktbl slot in the req_oids array. Bail if there's
+ ** some error. Create the initial packet to send out, which
+ ** includes the non-repeaters.
+ */
+ DBPRT(1,(DBOUT "Building request table:\n"));
+ for (varlist_ind = 0; varlist_ind < varlist_len; varlist_ind++) {
+ /* Get a handle on this entry in the request table. */
+ bt_entry = &context->req_oids[context->nreq_oids];
+
+ DBPRT(1,(DBOUT " request %d: ", (int) varlist_ind));
+
+ /* Get the request varbind from the varlist, parse it out to
+ ** tag and index, and copy it to the req_oid[] array slots.
+ */
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (!SvROK(*varbind_ref)) {
+ sv_setpv(*err_str_svp, \
+ (char*)snmp_api_errstring(SNMPERR_BAD_NAME));
+ sv_setiv(*err_num_svp, SNMPERR_BAD_NAME);
+ goto err;
+ }
+
+ varbind = (AV*) SvRV(*varbind_ref);
+ __tag2oid(__av_elem_pv(varbind, VARBIND_TAG_F, "0"),
+ __av_elem_pv(varbind, VARBIND_IID_F, NULL),
+ oid_arr, &oid_arr_len, NULL, best_guess);
+
+ if ((oid_arr_len == 0) || (oid_arr_len > MAX_OID_LEN)) {
+ if (verbose)
+ warn("error: bulkwalk(): unknown object ID");
+ sv_setpv(*err_str_svp, \
+ (char*)snmp_api_errstring(SNMPERR_UNKNOWN_OBJID));
+ sv_setiv(*err_num_svp, SNMPERR_UNKNOWN_OBJID);
+ goto err;
+ }
+
+ /* Copy the now-parsed OID into the first available slot
+ ** in the req_oids[] array. Set both the req_oid (original
+ ** request) and the last_oid (last requested/seen oid) to
+ ** the initial value. We build packets using last_oid (see
+ ** below), so initialize last_oid to the initial request.
+ */
+ Copy((void *)oid_arr, (void *)bt_entry->req_oid,
+ oid_arr_len, oid);
+ Copy((void *)oid_arr, (void *)bt_entry->last_oid,
+ oid_arr_len, oid);
+
+ bt_entry->req_len = oid_arr_len;
+ bt_entry->last_len = oid_arr_len;
+
+ /* Adjust offset to and count of repeaters. Note non-repeater
+ ** OID's in the list, if appropriate.
+ */
+ if (varlist_ind >= context->non_reps) {
+
+ /* Store a pointer to the first repeater value. */
+ if (context->repbase == NULL)
+ context->repbase = bt_entry;
+
+ context->repeaters ++;
+
+ } else {
+ bt_entry->norepeat = 1;
+ DBPRT(1,(DBOUT "HERE 1\n"));
+ DBPRT(1,(DBOUT "(nonrepeater) "));
+ }
+
+ /* Initialize the array in which to hold the Varbinds to be
+ ** returned for the OID or subtree.
+ */
+ if ((bt_entry->vars = (AV*) newAV()) == NULL) {
+ sv_setpv(*err_str_svp, "newAV() failed: ");
+ sv_catpv(*err_str_svp, strerror(errno));
+ sv_setiv(*err_num_svp, SNMPERR_MALLOC);
+ goto err;
+ }
+ DBPRT(1,(DBOUT "%s\n", __snprint_oid(oid_arr, oid_arr_len)));
+ context->nreq_oids ++;
+ }
+
+ /* Keep track of the number of outstanding requests. This lets us
+ ** finish processing early if we're done with all requests.
+ */
+ context->req_remain = context->nreq_oids;
+ DBPRT(1,(DBOUT "Total %d variable requests added\n", context->nreq_oids));
+
+ /* If no good variable requests were found, return an error. */
+ if (context->nreq_oids == 0) {
+ sv_setpv(*err_str_svp, "No variables found in varlist");
+ sv_setiv(*err_num_svp, SNMPERR_NO_VARS);
+ goto err;
+ }
+
+ /* Note that this is a good context. This allows later callbacks
+ ** to ignore re-sent PDU's that correspond to completed (and hence
+ ** destroyed) bulkwalk contexts.
+ */
+ _context_add(context);
+
+ /* For asynchronous bulkwalk requests, all we have to do at this
+ ** point is enqueue the asynchronous GETBULK request with our
+ ** bulkwalk-specific callback and return. Remember that the
+ ** bulkwalk_send_pdu() function returns the reqid cast to an
+ ** snmp_pdu pointer, or NULL on failure. Return undef if the
+ ** initial send fails; bulkwalk_send_pdu() takes care of setting
+ ** the various error values.
+ **
+ ** From here, the callbacks do all the work, including sending
+ ** requests for variables and handling responses. The caller's
+ ** callback will be invoked as soon as the walk completes.
+ */
+ if (SvTRUE(perl_callback)) {
+ DBPRT(1,(DBOUT "Starting asynchronous bulkwalk...\n"));
+
+ pdu = _bulkwalk_send_pdu(context);
+
+ if (pdu == NULL) {
+ DBPRT(1,(DBOUT "Initial asynchronous send failed...\n"));
+ XSRETURN_UNDEF;
+ }
+
+ /* Sent okay... Return the request ID in 'pdu' as an SvIV. */
+ DBPRT(1,(DBOUT "Okay, request id is %ld\n", (long)(intptr_t)pdu));
+/* XSRETURN_IV((intptr_t)pdu); */
+ XPUSHs(sv_2mortal(newSViv((IV)pdu)));
+ XSRETURN(1);
+ }
+
+ /* For synchronous bulkwalk, we perform the basic send/receive
+ ** iteration right here. Once the walk has been completed, the
+ ** bulkwalk_finish() function will push the return values onto
+ ** the Perl call stack, and we return.
+ */
+ DBPRT(1,(DBOUT "Starting synchronous bulkwalk...\n"));
+
+ while (!(okay = _bulkwalk_done(context))) {
+
+ /* Send a request for the next batch of variables. */
+ DBPRT(1, (DBOUT "Building %s GETBULK bulkwalk PDU (%d)...\n",
+ context->pkts_exch ? "next" : "first",
+ context->pkts_exch));
+ pdu = _bulkwalk_send_pdu(context);
+
+ /* If the request failed, consider the walk done. */
+ if (pdu == NULL) {
+ DBPRT(1,(DBOUT "bulkwalk_send_pdu() failed!\n"));
+ break;
+ }
+
+ /* Handle the variables in this response packet. Break out
+ ** of the loop if an error occurs or no variables are found
+ ** in the response.
+ */
+ if ((i = _bulkwalk_recv_pdu(context, pdu)) <= 0) {
+ DBPRT(2,(DBOUT "bulkwalk_recv_pdu() returned %d (error/empty)\n", i));
+ goto err;
+ }
+
+ /* Free the returned pdu. Don't bother to do this for the async
+ ** case, since the SNMP callback mechanism itself does the free
+ ** for us.
+ */
+ snmp_free_pdu(pdu);
+
+ /* And loop. The call to bulkwalk_done() sets the ignore flags
+ ** for any completed request subtrees. Next time around, they
+ ** won't be added to the request sent to the agent.
+ */
+ continue;
+ }
+
+ DBPRT(1, (DBOUT "Bulkwalk done... calling bulkwalk_finish(%s)...\n",
+ okay ? "okay" : "error"));
+ npushed = _bulkwalk_finish(context, okay);
+
+ DBPRT(2,(DBOUT "Returning %d values on the stack.\n", npushed));
+ XSRETURN(npushed);
+
+ /* Handle error cases and clean up after ourselves. */
+ err:
+ if (context) {
+ if (context->req_oids && context->nreq_oids) {
+ bt_entry = context->req_oids;
+ for (i = 0; i < context->nreq_oids; i++, bt_entry++)
+ av_clear(bt_entry->vars);
+ }
+ if (context->req_oids)
+ Safefree(context->req_oids);
+ Safefree(context);
+ }
+ if (pdu)
+ snmp_free_pdu(pdu);
+
+ XSRETURN_UNDEF;
+ }
+
+
+void
+snmp_trapV1(sess_ref,enterprise,agent,generic,specific,uptime,varlist_ref)
+ SV * sess_ref
+ char * enterprise
+ char * agent
+ int generic
+ int specific
+ long uptime
+ SV * varlist_ref
+ PPCODE:
+ {
+ AV *varlist;
+ SV **varbind_ref;
+ SV **varbind_val_f;
+ AV *varbind;
+ I32 varlist_len;
+ I32 varlist_ind;
+ SnmpSession *ss;
+ netsnmp_pdu *pdu = NULL;
+ struct tree *tp;
+ oid *oid_arr;
+ size_t oid_arr_len = MAX_OID_LEN;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+ SV **err_ind_svp;
+ int type;
+ int res;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+ int use_enums = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseEnums",8,1));
+ struct enum_list *ep;
+ int best_guess;
+
+ New (0, oid_arr, MAX_OID_LEN, oid);
+
+ if (oid_arr && SvROK(sess_ref)) {
+
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+ sv_setpv(*err_str_svp, "");
+ sv_setiv(*err_num_svp, 0);
+ sv_setiv(*err_ind_svp, 0);
+ best_guess = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"BestGuess",9,1));
+
+ pdu = snmp_pdu_create(SNMP_MSG_TRAP);
+
+ if (SvROK(varlist_ref)) {
+ varlist = (AV*) SvRV(varlist_ref);
+ varlist_len = av_len(varlist);
+ for(varlist_ind = 0; varlist_ind <= varlist_len; varlist_ind++) {
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (SvROK(*varbind_ref)) {
+ varbind = (AV*) SvRV(*varbind_ref);
+
+ tp=__tag2oid(__av_elem_pv(varbind, VARBIND_TAG_F, NULL),
+ __av_elem_pv(varbind, VARBIND_IID_F, NULL),
+ oid_arr, &oid_arr_len, &type, best_guess);
+
+ if (oid_arr_len == 0) {
+ if (verbose)
+ warn("error:trap: unable to determine oid for object");
+ goto err;
+ }
+
+ if (type == TYPE_UNKNOWN) {
+ type = __translate_appl_type(
+ __av_elem_pv(varbind, VARBIND_TYPE_F, NULL));
+ if (type == TYPE_UNKNOWN) {
+ if (verbose)
+ warn("error:trap: no type found for object");
+ goto err;
+ }
+ }
+
+ varbind_val_f = av_fetch(varbind, VARBIND_VAL_F, 0);
+
+ if (type==TYPE_INTEGER && use_enums && tp && tp->enums) {
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (varbind_val_f && SvOK(*varbind_val_f) &&
+ !strcmp(ep->label, SvPV(*varbind_val_f,na))) {
+ sv_setiv(*varbind_val_f, ep->value);
+ break;
+ }
+ }
+ }
+
+ res = __add_var_val_str(pdu, oid_arr, oid_arr_len,
+ (varbind_val_f && SvOK(*varbind_val_f) ?
+ SvPV(*varbind_val_f,na):NULL),
+ (varbind_val_f && SvPOK(*varbind_val_f) ?
+ SvCUR(*varbind_val_f):0),
+ type);
+
+ if(res == FAILURE) {
+ if(verbose) warn("error:trap: adding varbind");
+ goto err;
+ }
+
+ } /* if var_ref is ok */
+ } /* for all the vars */
+ }
+
+ pdu->enterprise = (oid *)netsnmp_malloc(MAX_OID_LEN * sizeof(oid));
+ tp = __tag2oid(enterprise,NULL, pdu->enterprise,
+ &pdu->enterprise_length, NULL, best_guess);
+ if (pdu->enterprise_length == 0) {
+ if (verbose) warn("error:trap:invalid enterprise id: %s", enterprise);
+ goto err;
+ }
+ /* If agent is given then set the v1-TRAP specific
+ agent-address field to that. Otherwise set it to
+ our address. */
+ if (agent && strlen(agent)) {
+ if (0 > netsnmp_gethostbyname_v4(agent,
+ (in_addr_t *)pdu->agent_addr)){
+ if (verbose)
+ warn("error:trap:invalid agent address: %s", agent);
+ goto err;
+ }
+ } else {
+ *((in_addr_t *)pdu->agent_addr) = get_myaddr();
+ }
+ pdu->trap_type = generic;
+ pdu->specific_type = specific;
+ pdu->time = uptime;
+
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ if(snmp_sess_send(ss,pdu) == 0)
+ snmp_free_pdu(pdu);
+ } else {
+ if (snmp_send(ss, pdu) == 0)
+ snmp_free_pdu(pdu);
+ }
+ XPUSHs(sv_2mortal(newSVpv(ZERO_BUT_TRUE,0)));
+ } else {
+err:
+ XPUSHs(&sv_undef); /* no mem or bad args */
+ if (pdu) snmp_free_pdu(pdu);
+ }
+ Safefree(oid_arr);
+ }
+
+
+void
+snmp_trapV2(sess_ref,uptime,trap_oid,varlist_ref)
+ SV * sess_ref
+ char * uptime
+ char * trap_oid
+ SV * varlist_ref
+ PPCODE:
+ {
+ AV *varlist;
+ SV **varbind_ref;
+ SV **varbind_val_f;
+ AV *varbind;
+ I32 varlist_len;
+ I32 varlist_ind;
+ SnmpSession *ss;
+ netsnmp_pdu *pdu = NULL;
+ struct tree *tp;
+ oid *oid_arr;
+ size_t oid_arr_len = MAX_OID_LEN;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+ SV **err_ind_svp;
+ int type;
+ int res;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+ int use_enums = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseEnums",8,1));
+ struct enum_list *ep;
+ int best_guess;
+
+ New (0, oid_arr, MAX_OID_LEN, oid);
+
+ if (oid_arr && SvROK(sess_ref)) {
+
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+ sv_setpv(*err_str_svp, "");
+ sv_setiv(*err_num_svp, 0);
+ sv_setiv(*err_ind_svp, 0);
+ best_guess = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"BestGuess",9,1));
+
+ pdu = snmp_pdu_create(SNMP_MSG_TRAP2);
+
+ if (SvROK(varlist_ref)) {
+ varlist = (AV*) SvRV(varlist_ref);
+ varlist_len = av_len(varlist);
+ } else {
+ varlist = NULL;
+ varlist_len = -1;
+ }
+ /************************************************/
+ res = __add_var_val_str(pdu, sysUpTime, SYS_UPTIME_OID_LEN,
+ uptime, strlen(uptime), TYPE_TIMETICKS);
+
+ if(res == FAILURE) {
+ if(verbose) warn("error:trap v2: adding sysUpTime varbind");
+ goto err;
+ }
+
+ res = __add_var_val_str(pdu, snmpTrapOID, SNMP_TRAP_OID_LEN,
+ trap_oid ,strlen(trap_oid) ,TYPE_OBJID);
+
+ if(res == FAILURE) {
+ if(verbose) warn("error:trap v2: adding snmpTrapOID varbind");
+ goto err;
+ }
+
+
+ /******************************************************/
+
+ for(varlist_ind = 0; varlist_ind <= varlist_len; varlist_ind++) {
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (SvROK(*varbind_ref)) {
+ varbind = (AV*) SvRV(*varbind_ref);
+
+ tp=__tag2oid(__av_elem_pv(varbind, VARBIND_TAG_F,NULL),
+ __av_elem_pv(varbind, VARBIND_IID_F,NULL),
+ oid_arr, &oid_arr_len, &type, best_guess);
+
+ if (oid_arr_len == 0) {
+ if (verbose)
+ warn("error:trap v2: unable to determine oid for object");
+ goto err;
+ }
+
+ if (type == TYPE_UNKNOWN) {
+ type = __translate_appl_type(
+ __av_elem_pv(varbind, VARBIND_TYPE_F, NULL));
+ if (type == TYPE_UNKNOWN) {
+ if (verbose)
+ warn("error:trap v2: no type found for object");
+ goto err;
+ }
+ }
+
+ varbind_val_f = av_fetch(varbind, VARBIND_VAL_F, 0);
+
+ if (type==TYPE_INTEGER && use_enums && tp && tp->enums) {
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (varbind_val_f && SvOK(*varbind_val_f) &&
+ !strcmp(ep->label, SvPV(*varbind_val_f,na))) {
+ sv_setiv(*varbind_val_f, ep->value);
+ break;
+ }
+ }
+ }
+
+ res = __add_var_val_str(pdu, oid_arr, oid_arr_len,
+ (varbind_val_f && SvOK(*varbind_val_f) ?
+ SvPV(*varbind_val_f,na):NULL),
+ (varbind_val_f && SvPOK(*varbind_val_f) ?
+ SvCUR(*varbind_val_f):0),
+ type);
+
+ if(res == FAILURE) {
+ if(verbose) warn("error:trap v2: adding varbind");
+ goto err;
+ }
+
+ } /* if var_ref is ok */
+ } /* for all the vars */
+
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ if (snmp_sess_send(ss, pdu) == 0)
+ snmp_free_pdu(pdu);
+ } else {
+ if (snmp_send(ss, pdu) == 0)
+ snmp_free_pdu(pdu);
+ }
+
+ XPUSHs(sv_2mortal(newSVpv(ZERO_BUT_TRUE,0)));
+ } else {
+err:
+ XPUSHs(&sv_undef); /* no mem or bad args */
+ if (pdu) snmp_free_pdu(pdu);
+ }
+ Safefree(oid_arr);
+ }
+
+
+
+void
+snmp_inform(sess_ref,uptime,trap_oid,varlist_ref,perl_callback)
+ SV * sess_ref
+ char * uptime
+ char * trap_oid
+ SV * varlist_ref
+ SV * perl_callback
+ PPCODE:
+ {
+ AV *varlist;
+ SV **varbind_ref;
+ SV **varbind_val_f;
+ AV *varbind;
+ I32 varlist_len;
+ I32 varlist_ind;
+ SnmpSession *ss;
+ netsnmp_pdu *pdu = NULL;
+ netsnmp_pdu *response;
+ struct tree *tp;
+ oid *oid_arr;
+ size_t oid_arr_len = MAX_OID_LEN;
+ snmp_xs_cb_data *xs_cb_data;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+ SV **err_ind_svp;
+ int status = 0;
+ int type;
+ int res;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+ int use_enums = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseEnums",8,1));
+ struct enum_list *ep;
+ int best_guess;
+
+ New (0, oid_arr, MAX_OID_LEN, oid);
+
+ if (oid_arr && SvROK(sess_ref) && SvROK(varlist_ref)) {
+
+ sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ err_str_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorStr", 8, 1);
+ err_num_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorNum", 8, 1);
+ err_ind_svp = hv_fetch((HV*)SvRV(sess_ref), "ErrorInd", 8, 1);
+ sv_setpv(*err_str_svp, "");
+ sv_setiv(*err_num_svp, 0);
+ sv_setiv(*err_ind_svp, 0);
+ best_guess = SvIV(*hv_fetch((HV*)SvRV(sess_ref),"BestGuess",9,1));
+
+ pdu = snmp_pdu_create(SNMP_MSG_INFORM);
+
+ varlist = (AV*) SvRV(varlist_ref);
+ varlist_len = av_len(varlist);
+ /************************************************/
+ res = __add_var_val_str(pdu, sysUpTime, SYS_UPTIME_OID_LEN,
+ uptime, strlen(uptime), TYPE_TIMETICKS);
+
+ if(res == FAILURE) {
+ if(verbose) warn("error:inform: adding sysUpTime varbind");
+ goto err;
+ }
+
+ res = __add_var_val_str(pdu, snmpTrapOID, SNMP_TRAP_OID_LEN,
+ trap_oid ,strlen(trap_oid) ,TYPE_OBJID);
+
+ if(res == FAILURE) {
+ if(verbose) warn("error:inform: adding snmpTrapOID varbind");
+ goto err;
+ }
+
+
+ /******************************************************/
+
+ for(varlist_ind = 0; varlist_ind <= varlist_len; varlist_ind++) {
+ varbind_ref = av_fetch(varlist, varlist_ind, 0);
+ if (SvROK(*varbind_ref)) {
+ varbind = (AV*) SvRV(*varbind_ref);
+
+ tp=__tag2oid(__av_elem_pv(varbind, VARBIND_TAG_F,NULL),
+ __av_elem_pv(varbind, VARBIND_IID_F,NULL),
+ oid_arr, &oid_arr_len, &type, best_guess);
+
+ if (oid_arr_len == 0) {
+ if (verbose)
+ warn("error:inform: unable to determine oid for object");
+ goto err;
+ }
+
+ if (type == TYPE_UNKNOWN) {
+ type = __translate_appl_type(
+ __av_elem_pv(varbind, VARBIND_TYPE_F, NULL));
+ if (type == TYPE_UNKNOWN) {
+ if (verbose)
+ warn("error:inform: no type found for object");
+ goto err;
+ }
+ }
+
+ varbind_val_f = av_fetch(varbind, VARBIND_VAL_F, 0);
+
+ if (type==TYPE_INTEGER && use_enums && tp && tp->enums) {
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (varbind_val_f && SvOK(*varbind_val_f) &&
+ !strcmp(ep->label, SvPV(*varbind_val_f,na))) {
+ sv_setiv(*varbind_val_f, ep->value);
+ break;
+ }
+ }
+ }
+
+ res = __add_var_val_str(pdu, oid_arr, oid_arr_len,
+ (varbind_val_f && SvOK(*varbind_val_f) ?
+ SvPV(*varbind_val_f,na):NULL),
+ (varbind_val_f && SvPOK(*varbind_val_f) ?
+ SvCUR(*varbind_val_f):0),
+ type);
+
+ if(res == FAILURE) {
+ if(verbose) warn("error:inform: adding varbind");
+ goto err;
+ }
+
+ } /* if var_ref is ok */
+ } /* for all the vars */
+
+
+ if (SvTRUE(perl_callback)) {
+ xs_cb_data =
+ (snmp_xs_cb_data*)malloc(sizeof(snmp_xs_cb_data));
+ xs_cb_data->perl_cb = newSVsv(perl_callback);
+ xs_cb_data->sess_ref = newRV_inc(SvRV(sess_ref));
+
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ status = snmp_sess_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ } else {
+ status = snmp_async_send(ss, pdu, __snmp_xs_cb,
+ (void*)xs_cb_data);
+ }
+ if (status != 0) {
+ XPUSHs(sv_2mortal(newSViv(status))); /* push the reqid?? */
+ } else {
+ snmp_free_pdu(pdu);
+ snmp_return_err(ss, *err_num_svp, *err_ind_svp, *err_str_svp);
+ XPUSHs(&sv_undef);
+ }
+ goto done;
+ }
+
+ status = __send_sync_pdu(ss, pdu, &response,
+ NO_RETRY_NOSUCH,
+ *err_str_svp, *err_num_svp,
+ *err_ind_svp);
+
+ if (response) snmp_free_pdu(response);
+
+ if (status) {
+ XPUSHs(&sv_undef);
+ } else {
+ XPUSHs(sv_2mortal(newSVpv(ZERO_BUT_TRUE,0)));
+ }
+ } else {
+err:
+ XPUSHs(&sv_undef); /* no mem or bad args */
+ if (pdu) snmp_free_pdu(pdu);
+ }
+done:
+ Safefree(oid_arr);
+ }
+
+
+
+char *
+snmp_get_type(tag, best_guess)
+ char * tag
+ int best_guess
+ CODE:
+ {
+ struct tree *tp = NULL;
+ static char type_str[MAX_TYPE_NAME_LEN];
+ char *ret = NULL;
+
+ if (tag && *tag) tp = __tag2oid(tag, NULL, NULL, NULL, NULL, best_guess);
+ if (tp) __get_type_str(tp->type, ret = type_str);
+ RETVAL = ret;
+ }
+ OUTPUT:
+ RETVAL
+
+
+void
+snmp_dump_packet(flag)
+ int flag
+ CODE:
+ {
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET, flag);
+ }
+
+
+char *
+snmp_map_enum(tag, val, iflag, best_guess)
+ char * tag
+ char * val
+ int iflag
+ int best_guess
+ CODE:
+ {
+ struct tree *tp = NULL;
+ struct enum_list *ep;
+ char str_buf[STR_BUF_SIZE];
+ int ival;
+
+ RETVAL = NULL;
+
+ if (tag && *tag) tp = __tag2oid(tag, NULL, NULL, NULL, NULL, best_guess);
+
+ if (tp) {
+ if (iflag) {
+ ival = atoi(val);
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (ep->value == ival) {
+ RETVAL = ep->label;
+ break;
+ }
+ }
+ } else {
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (strEQ(ep->label, val)) {
+ sprintf(str_buf,"%d", ep->value);
+ RETVAL = str_buf;
+ break;
+ }
+ }
+ }
+ }
+ }
+ OUTPUT:
+ RETVAL
+
+#define SNMP_XLATE_MODE_OID2TAG 1
+#define SNMP_XLATE_MODE_TAG2OID 0
+
+char *
+snmp_translate_obj(var,mode,use_long,auto_init,best_guess,include_module_name)
+ char * var
+ int mode
+ int use_long
+ int auto_init
+ int best_guess
+ int include_module_name
+ CODE:
+ {
+ char str_buf[STR_BUF_SIZE];
+ char str_buf_temp[STR_BUF_SIZE];
+ oid oid_arr[MAX_OID_LEN];
+ size_t oid_arr_len = MAX_OID_LEN;
+ char * label;
+ char * iid;
+ int status = FAILURE;
+ int verbose = SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04));
+ struct tree *module_tree = NULL;
+ char modbuf[256];
+ int old_format; /* Current NETSNMP_DS_LIB_OID_OUTPUT_FORMAT */
+
+ str_buf[0] = '\0';
+ str_buf_temp[0] = '\0';
+
+ if (auto_init)
+ netsnmp_init_mib(); /* vestigial */
+
+ /* Save old output format and set to FULL so long_names works */
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, NETSNMP_OID_OUTPUT_FULL);
+
+ switch (mode) {
+ case SNMP_XLATE_MODE_TAG2OID:
+ if (!__tag2oid(var, NULL, oid_arr, &oid_arr_len, NULL, best_guess)) {
+ if (verbose) warn("error:snmp_translate_obj:Unknown OID %s\n",var);
+ } else {
+ status = __sprint_num_objid(str_buf, oid_arr, oid_arr_len);
+ }
+ break;
+ case SNMP_XLATE_MODE_OID2TAG:
+ oid_arr_len = 0;
+ __concat_oid_str(oid_arr, &oid_arr_len, var);
+ snprint_objid(str_buf_temp, sizeof(str_buf_temp), oid_arr, oid_arr_len);
+
+ if (!use_long) {
+ label = NULL; iid = NULL;
+ if (((status=__get_label_iid(str_buf_temp,
+ &label, &iid, NO_FLAGS)) == SUCCESS)
+ && label) {
+ strlcpy(str_buf_temp, label, sizeof(str_buf_temp));
+ if (iid && *iid) {
+ strlcat(str_buf_temp, ".", sizeof(str_buf_temp));
+ strlcat(str_buf_temp, iid, sizeof(str_buf_temp));
+ }
+ }
+ }
+
+ /* Prepend modulename:: if enabled */
+ if (include_module_name) {
+ module_tree = get_tree (oid_arr, oid_arr_len, get_tree_head());
+ if (module_tree) {
+ if (strcmp(module_name(module_tree->modid, modbuf), "#-1") ) {
+ strcat(str_buf, modbuf);
+ strcat(str_buf, "::");
+ }
+ else {
+ strcat(str_buf, "UNKNOWN::");
+ }
+ }
+ }
+ strcat(str_buf, str_buf_temp);
+
+ break;
+ default:
+ if (verbose) warn("snmp_translate_obj:unknown translation mode: %d\n", mode);
+ }
+ if (*str_buf) {
+ RETVAL = (char*)str_buf;
+ } else {
+ RETVAL = (char*)NULL;
+ }
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, old_format);
+ }
+ OUTPUT:
+ RETVAL
+
+void
+snmp_set_replace_newer(val)
+ int val
+ CODE:
+ {
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_REPLACE, val);
+ }
+
+void
+snmp_set_save_descriptions(val)
+ int val
+ CODE:
+ {
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS, val);
+ }
+
+void
+snmp_set_debugging(val)
+ int val
+ CODE:
+ {
+ snmp_set_do_debugging(val);
+ }
+
+void
+snmp_register_debug_tokens(tokens)
+ char *tokens
+ CODE:
+ {
+ debug_register_tokens(tokens);
+ snmp_set_do_debugging(1);
+ }
+
+void
+snmp_debug_internals(val)
+ int val
+ CODE:
+ {
+#ifdef DEBUGGING
+ _debug_level = val;
+#else
+ val++;
+#endif /* DEBUGGING */
+ }
+
+
+void
+snmp_mib_toggle_options(options)
+ char *options
+ CODE:
+ {
+ snmp_mib_toggle_options(options);
+ }
+
+void
+snmp_sock_cleanup()
+ CODE:
+ {
+ SOCK_CLEANUP;
+ }
+
+void
+snmp_mainloop_finish()
+ CODE:
+ {
+ mainloop_finish = 1;
+ }
+
+
+#-----------------------------------------------------------------------------
+# Note: ss=(SnmpSession*)NULL is so &SNMP::MainLoop() can still be called
+# without a sess handler argument, this way I'm not breaking anyone's old code
+#
+# see MainLoop() in SNMP.pm for more details
+#-----------------------------------------------------------------------------
+void
+snmp_main_loop(timeout_sec,timeout_usec,perl_callback,ss=(SnmpSession*)NULL)
+ int timeout_sec
+ int timeout_usec
+ SV * perl_callback
+ SnmpSession *ss
+ CODE:
+ {
+ int numfds, fd_count;
+ fd_set fdset;
+ struct timeval time_val, *tvp;
+ struct timeval last_time, *ltvp;
+ struct timeval ctimeout, *ctvp;
+ struct timeval interval, *itvp;
+ int block;
+ SV *cb;
+
+ mainloop_finish = 0;
+
+ itvp = &interval;
+ itvp->tv_sec = timeout_sec;
+ itvp->tv_usec = timeout_usec;
+ ctvp = &ctimeout;
+ ctvp->tv_sec = -1;
+ ctvp->tv_usec = 0;
+ ltvp = &last_time;
+ gettimeofday(ltvp,(struct timezone*)0);
+ timersub(ltvp,itvp,ltvp);
+ while (1) {
+ numfds = 0;
+ FD_ZERO(&fdset);
+ block = 1;
+ tvp = &time_val;
+ timerclear(tvp);
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ snmp_sess_select_info(ss,&numfds, &fdset, tvp, &block);
+ } else {
+ snmp_select_info(&numfds, &fdset, tvp, &block);
+ }
+ __recalc_timeout(tvp,ctvp,ltvp,itvp,&block);
+ # printf("pre-select: numfds = %ld, block = %ld\n", numfds, block);
+ if (block == 1) tvp = NULL; /* block without timeout */
+ fd_count = select(numfds, &fdset, 0, 0, tvp);
+ #printf("post-select: fd_count = %ld,block = %ld\n",fd_count,block);
+ if (fd_count > 0) {
+ ENTER;
+ SAVETMPS;
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ snmp_sess_read(ss, &fdset);
+ } else {
+ snmp_read(&fdset);
+ }
+ FREETMPS;
+ LEAVE;
+
+ } else switch(fd_count) {
+ case 0:
+ SPAGAIN;
+ ENTER;
+ SAVETMPS;
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ snmp_sess_timeout( ss );
+ } else {
+ snmp_timeout();
+ }
+ if (!timerisset(ctvp)) {
+ if (SvTRUE(perl_callback)) {
+ /* sv_2mortal(perl_callback); */
+ cb = __push_cb_args(perl_callback, NULL);
+ __call_callback(cb, G_DISCARD);
+ ctvp->tv_sec = -1;
+
+ } else {
+ FREETMPS;
+ LEAVE;
+ goto done;
+ }
+ }
+ FREETMPS;
+ LEAVE;
+ break;
+ case -1:
+ if (errno == EINTR) {
+ continue;
+ } else {
+ /* snmp_set_detail(strerror(errno)); */
+ /* snmp_errno = SNMPERR_GENERR; */
+ }
+ default:;
+ }
+
+ /* A call to snmp_mainloop_finish() in the callback sets the
+ ** mainloop_finish flag. Exit the loop after the callback returns.
+ */
+ if (mainloop_finish)
+ goto done;
+
+ }
+ done:
+ return;
+ }
+
+
+void
+snmp_get_select_info()
+ PPCODE:
+ {
+ int numfds;
+ fd_set fdset;
+ struct timeval time_val, *tvp;
+ int block;
+ int i;
+
+ numfds = 0;
+ block = 1;
+ tvp = &time_val;
+ FD_ZERO(&fdset);
+ snmp_select_info(&numfds, &fdset, tvp, &block);
+ XPUSHs(sv_2mortal(newSViv(block)));
+ if(block){
+ XPUSHs(sv_2mortal(newSViv(0)));
+ XPUSHs(sv_2mortal(newSViv(0)));
+ } else {
+ XPUSHs(sv_2mortal(newSViv(tvp->tv_sec)));
+ XPUSHs(sv_2mortal(newSViv(tvp->tv_usec)));
+ }
+ if ( numfds ) {
+ for(i=0; i<numfds ; i++) {
+ if(FD_ISSET(i, &fdset)){
+ XPUSHs(sv_2mortal(newSViv(i)));
+ }
+ }
+ } else {
+ XPUSHs(&sv_undef); /* no mem or bad args */
+ }
+ }
+
+void
+snmp_read_on_fd(fd)
+ int fd
+ CODE:
+ {
+ fd_set fdset;
+
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+
+ snmp_read(&fdset);
+ }
+
+void
+snmp_check_timeout()
+ CODE:
+ {
+ snmp_timeout();
+ }
+
+MODULE = SNMP PACKAGE = SNMP::MIB::NODE PREFIX = snmp_mib_node_
+
+SV *
+snmp_mib_node_TIEHASH(cl,key,tp=0)
+ char * cl
+ char * key
+ IV tp
+ CODE:
+ {
+ __libraries_init("perl");
+ if (!tp) tp = (IV)__tag2oid(key, NULL, NULL, NULL, NULL,0);
+ if (tp) {
+ RETVAL = sv_setref_iv(newSV(0), cl, tp);
+ } else {
+ RETVAL = &sv_undef;
+ }
+ }
+ OUTPUT:
+ RETVAL
+
+
+SV *
+snmp_mib_node_FETCH(tp_ref, key)
+ SV * tp_ref
+ char * key
+ CODE:
+ {
+ char c = *key;
+ char str_buf[STR_BUF_SIZE];
+ SnmpMibNode *tp = NULL, *tptmp = NULL;
+ struct index_list *ip;
+ struct enum_list *ep;
+ struct range_list *rp;
+ struct varbind_list *vp;
+ struct module *mp;
+ SV *child_list_aref, *next_node_href, *mib_tied_href = NULL;
+ SV **nn_hrefp;
+ HV *mib_hv, *enum_hv, *range_hv;
+ AV *index_av, *varbind_av, *ranges_av;
+ MAGIC *mg = NULL;
+ SV *ret = NULL;
+
+ if (SvROK(tp_ref)) tp = (SnmpMibNode*)SvIV((SV*)SvRV(tp_ref));
+
+ ret = newSV(0);
+ if (tp)
+ switch (c) {
+ case 'a': /* access */
+ if (strncmp("access", key, strlen(key)) == 0) {
+ switch (tp->access) {
+ case MIB_ACCESS_READONLY:
+ sv_setpv(ret,"ReadOnly");
+ break;
+ case MIB_ACCESS_READWRITE:
+ sv_setpv(ret,"ReadWrite");
+ break;
+ case MIB_ACCESS_WRITEONLY:
+ sv_setpv(ret,"WriteOnly");
+ break;
+ case MIB_ACCESS_NOACCESS:
+ sv_setpv(ret,"NoAccess");
+ break;
+ case MIB_ACCESS_NOTIFY:
+ sv_setpv(ret,"Notify");
+ break;
+ case MIB_ACCESS_CREATE:
+ sv_setpv(ret,"Create");
+ break;
+ default:
+ break;
+ }
+ } else if (strncmp("augments", key, strlen(key)) == 0) {
+ sv_setpv(ret,tp->augments);
+ }
+ break;
+ case 'c': /* children */
+ if (strncmp("children", key, strlen(key))) break;
+ child_list_aref = newRV((SV*)newAV());
+ for (tp = tp->child_list; tp; tp = tp->next_peer) {
+ mib_hv = perl_get_hv("SNMP::MIB", FALSE);
+ if (SvMAGICAL(mib_hv)) mg = mg_find((SV*)mib_hv, 'P');
+ if (mg) mib_tied_href = (SV*)mg->mg_obj;
+ next_node_href = newRV((SV*)newHV());
+ __tp_sprint_num_objid(str_buf, tp);
+ nn_hrefp = hv_fetch((HV*)SvRV(mib_tied_href),
+ str_buf, strlen(str_buf), 1);
+ if (!SvROK(*nn_hrefp)) {
+ sv_setsv(*nn_hrefp, next_node_href);
+ ENTER ;
+ SAVETMPS ;
+ PUSHMARK(sp) ;
+ XPUSHs(SvRV(*nn_hrefp));
+ XPUSHs(sv_2mortal(newSVpv("SNMP::MIB::NODE",0)));
+ XPUSHs(sv_2mortal(newSVpv(str_buf,0)));
+ XPUSHs(sv_2mortal(newSViv((IV)tp)));
+ PUTBACK ;
+ perl_call_pv("SNMP::_tie",G_VOID);
+ /* pp_tie(ARGS); */
+ SPAGAIN ;
+ FREETMPS ;
+ LEAVE ;
+ } /* if SvROK */
+ av_push((AV*)SvRV(child_list_aref), *nn_hrefp);
+ } /* for child_list */
+ sv_setsv(ret, child_list_aref);
+ break;
+ case 'v':
+ if (strncmp("varbinds", key, strlen(key))) break;
+ varbind_av = newAV();
+ for (vp = tp->varbinds; vp; vp = vp->next) {
+ av_push(varbind_av, newSVpv((vp->vblabel),strlen(vp->vblabel)));
+ }
+ sv_setsv(ret, newRV((SV*)varbind_av));
+ break;
+ case 'd': /* description */
+ if (strncmp("description", key, strlen(key))) {
+ if(!(strncmp("defaultValue",key,strlen(key)))) {
+ /* We're looking at defaultValue */
+ sv_setpv(ret, tp->defaultValue);
+ break;
+ } /* end if */
+ } /* end if */
+ /* we must be looking at description */
+ sv_setpv(ret,tp->description);
+ break;
+ case 'i': /* indexes, implied */
+ if (tp->augments) {
+ clear_tree_flags(get_tree_head());
+ tptmp = find_best_tree_node(tp->augments, get_tree_head(), NULL);
+ if (tptmp == NULL) {
+ tptmp = tp;
+ }
+ } else {
+ tptmp = tp;
+ }
+ if (strcmp("implied", key) == 0) {
+ /* only the last index can be implied */
+ int isimplied = 0;
+ if (tptmp && tptmp->indexes) {
+ for(ip=tptmp->indexes; ip->next; ip = ip->next) {
+ }
+ isimplied = ip->isimplied;
+ }
+ sv_setiv(ret, isimplied);
+ break;
+ }
+ if (strncmp("indexes", key, strlen(key))) break;
+ index_av = newAV();
+ if (tptmp)
+ for(ip=tptmp->indexes; ip != NULL; ip = ip->next) {
+ av_push(index_av,newSVpv((ip->ilabel),strlen(ip->ilabel)));
+ }
+ sv_setsv(ret, newRV((SV*)index_av));
+ break;
+ case 'l': /* label */
+ if (strncmp("label", key, strlen(key))) break;
+ sv_setpv(ret,tp->label);
+ break;
+ case 'm': /* moduleID */
+ if (strncmp("moduleID", key, strlen(key))) break;
+ mp = find_module(tp->modid);
+ if (mp) sv_setpv(ret, mp->name);
+ break;
+ case 'n': /* nextNode */
+ if (strncmp("nextNode", key, strlen(key))) break;
+ tp = __get_next_mib_node(tp);
+ if (tp == NULL) {
+ sv_setsv(ret, &sv_undef);
+ break;
+ }
+ mib_hv = perl_get_hv("SNMP::MIB", FALSE);
+ if (SvMAGICAL(mib_hv)) mg = mg_find((SV*)mib_hv, 'P');
+ if (mg) mib_tied_href = (SV*)mg->mg_obj;
+ __tp_sprint_num_objid(str_buf, tp);
+
+ nn_hrefp = hv_fetch((HV*)SvRV(mib_tied_href),
+ str_buf, strlen(str_buf), 1);
+ /* if (!SvROK(*nn_hrefp)) { */ /* bug in ucd - 2 .0.0 nodes */
+ next_node_href = newRV((SV*)newHV());
+ sv_setsv(*nn_hrefp, next_node_href);
+ ENTER ;
+ SAVETMPS ;
+ PUSHMARK(sp) ;
+ XPUSHs(SvRV(*nn_hrefp));
+ XPUSHs(sv_2mortal(newSVpv("SNMP::MIB::NODE",0)));
+ XPUSHs(sv_2mortal(newSVpv(str_buf,0)));
+ XPUSHs(sv_2mortal(newSViv((IV)tp)));
+ PUTBACK ;
+ perl_call_pv("SNMP::_tie",G_VOID);
+ /* pp_tie(ARGS); */
+ SPAGAIN ;
+ FREETMPS ;
+ LEAVE ;
+ /* } */
+ sv_setsv(ret, *nn_hrefp);
+ break;
+ case 'o': /* objectID */
+ if (strncmp("objectID", key, strlen(key))) break;
+ __tp_sprint_num_objid(str_buf, tp);
+ sv_setpv(ret,str_buf);
+ break;
+ case 'p': /* parent */
+ if (strncmp("parent", key, strlen(key))) break;
+ tp = tp->parent;
+ if (tp == NULL) {
+ sv_setsv(ret, &sv_undef);
+ break;
+ }
+ mib_hv = perl_get_hv("SNMP::MIB", FALSE);
+ if (SvMAGICAL(mib_hv)) mg = mg_find((SV*)mib_hv, 'P');
+ if (mg) mib_tied_href = (SV*)mg->mg_obj;
+ next_node_href = newRV((SV*)newHV());
+ __tp_sprint_num_objid(str_buf, tp);
+ nn_hrefp = hv_fetch((HV*)SvRV(mib_tied_href),
+ str_buf, strlen(str_buf), 1);
+ if (!SvROK(*nn_hrefp)) {
+ sv_setsv(*nn_hrefp, next_node_href);
+ ENTER ;
+ SAVETMPS ;
+ PUSHMARK(sp) ;
+ XPUSHs(SvRV(*nn_hrefp));
+ XPUSHs(sv_2mortal(newSVpv("SNMP::MIB::NODE",0)));
+ XPUSHs(sv_2mortal(newSVpv(str_buf,0)));
+ XPUSHs(sv_2mortal(newSViv((IV)tp)));
+ PUTBACK ;
+ perl_call_pv("SNMP::_tie",G_VOID);
+ /* pp_tie(ARGS); */
+ SPAGAIN ;
+ FREETMPS ;
+ LEAVE ;
+ }
+ sv_setsv(ret, *nn_hrefp);
+ break;
+ case 'r': /* ranges */
+ if (strncmp("reference", key, strlen(key)) == 0) {
+ sv_setpv(ret,tp->reference);
+ break;
+ }
+ if (strncmp("ranges", key, strlen(key))) break;
+ ranges_av = newAV();
+ for(rp=tp->ranges; rp ; rp = rp->next) {
+ range_hv = newHV();
+ (void)hv_store(range_hv, "low", strlen("low"), newSViv(rp->low), 0);
+ (void)hv_store(range_hv, "high", strlen("high"), newSViv(rp->high), 0);
+ av_push(ranges_av, newRV((SV*)range_hv));
+ }
+ sv_setsv(ret, newRV((SV*)ranges_av));
+ break;
+ case 's': /* subID */
+ if (strncmp("subID", key, strlen(key))) {
+ if (strncmp("status", key, strlen(key))) {
+ if (strncmp("syntax", key, strlen(key))) break;
+ if (tp->tc_index >= 0) {
+ sv_setpv(ret, get_tc_descriptor(tp->tc_index));
+ } else {
+ __get_type_str(tp->type, str_buf);
+ sv_setpv(ret, str_buf);
+ }
+ break;
+ }
+
+ switch(tp->status) {
+ case MIB_STATUS_MANDATORY:
+ sv_setpv(ret,"Mandatory");
+ break;
+ case MIB_STATUS_OPTIONAL:
+ sv_setpv(ret,"Optional");
+ break;
+ case MIB_STATUS_OBSOLETE:
+ sv_setpv(ret,"Obsolete");
+ break;
+ case MIB_STATUS_DEPRECATED:
+ sv_setpv(ret,"Deprecated");
+ break;
+ case MIB_STATUS_CURRENT:
+ sv_setpv(ret,"Current");
+ break;
+ default:
+ break;
+ }
+ } else {
+ sv_setiv(ret,(I32)tp->subid);
+ }
+ break;
+ case 't': /* type */
+ if (strncmp("type", key, strlen(key))) {
+ if (strncmp("textualConvention", key, strlen(key))) break;
+ sv_setpv(ret, get_tc_descriptor(tp->tc_index));
+ break;
+ }
+ __get_type_str(tp->type, str_buf);
+ sv_setpv(ret, str_buf);
+ break;
+ case 'T': /* textual convention description */
+ if (strncmp("TCDescription", key, strlen(key))) break;
+ sv_setpv(ret, get_tc_description(tp->tc_index));
+ break;
+ case 'u': /* units */
+ if (strncmp("units", key, strlen(key))) break;
+ sv_setpv(ret,tp->units);
+ break;
+ case 'h': /* hint */
+ if (strncmp("hint", key, strlen(key))) break;
+ sv_setpv(ret,tp->hint);
+ break;
+ case 'e': /* enums */
+ if (strncmp("enums", key, strlen(key))) break;
+ enum_hv = newHV();
+ for(ep=tp->enums; ep != NULL; ep = ep->next) {
+ (void)hv_store(enum_hv, ep->label, strlen(ep->label),
+ newSViv(ep->value), 0);
+ }
+ sv_setsv(ret, newRV((SV*)enum_hv));
+ break;
+ default:
+ break;
+ }
+ RETVAL = ret;
+ }
+ OUTPUT:
+ RETVAL
+
+MODULE = SNMP PACKAGE = SnmpSessionPtr PREFIX = snmp_session_
+
+void
+snmp_session_DESTROY(sess_ptr)
+ SnmpSession *sess_ptr
+ CODE:
+ {
+ if(sess_ptr != NULL)
+ {
+ if(api_mode == SNMP_API_SINGLE)
+ {
+ snmp_sess_close( sess_ptr );
+ } else {
+ snmp_close( sess_ptr );
+ }
+ }
+ }
+
diff --git a/perl/SNMP/TODO b/perl/SNMP/TODO
new file mode 100644
index 0000000..edd7c7c
--- /dev/null
+++ b/perl/SNMP/TODO
@@ -0,0 +1,40 @@
+enhance make test
+
+implement v2 traps and v3 inform requests.
+
+solidify/enhance the V3 api
+
+handle TCP sessions
+
+See that informative strings are returned and the the error number is
+useful in all cases. (need to set $! for errors where a session is not
+returned (failed engineId discovery, memory alloc error, failed key
+computation?))
+
+PC and other unix builds - any platform issues
+
+building with shared libs
+
+ensure module does not complain with -w.
+
+enhance async api so that a boolean false return from a callback exits
+the MainLoop
+
+enhance async api to store a reference to the perl SNMP::Sesion object
+for 2 reasons: 1) if the initial calling session goes out of scope we
+won't destroy the C-struct session until the callback is called. 2) it
+allows us to set error codes in the perl SNMP::Session object
+
+see if new async hooks play with Event.pm
+
+handle dynamic changes to Session parameters, perhaps tie Error* to
+snmp_session struct rather than current duplicate representation.
+
+make the parsed mib interface $SNMP::MIB writable
+
+allow unloading and reinitialization of parsed MIB
+
+attach to libucdagent - provide agent functionality
+
+look for *Not Implemeted* and implement :)
+
diff --git a/perl/SNMP/examples/async1.pl b/perl/SNMP/examples/async1.pl
new file mode 100644
index 0000000..ffd6065
--- /dev/null
+++ b/perl/SNMP/examples/async1.pl
@@ -0,0 +1,17 @@
+use SNMP;
+
+$SNMP::auto_init_mib = 0;
+
+$sess = new SNMP::Session();
+
+sub poller {
+ # VarList is undefined if TIMEOUT occured
+ if (!defined($_[1])) { die "request timed out[$_[0]->{ErrorStr}]\n"; }
+ if ($i++>100000) { die "completed 500 polls\n"; }
+ #print $_[1][0]->tag, " = ", $_[1][0]->val, "\n";
+ $_[0]->get($_[1], [\&poller, $_[0]]);
+}
+
+$sess->get([[".1.3.6.1.2.1.1.3.0"]], [\&poller, $sess]);
+
+SNMP::MainLoop();
diff --git a/perl/SNMP/examples/async2.pl b/perl/SNMP/examples/async2.pl
new file mode 100644
index 0000000..f0e41b3
--- /dev/null
+++ b/perl/SNMP/examples/async2.pl
@@ -0,0 +1,19 @@
+use SNMP;
+
+$SNMP::auto_init_mib = 0;
+
+$sess = new SNMP::Session();
+
+sub poller_handler {
+ if (++$i>500) { die "completed 500 polls\n"; };
+ # VarList is undefined if TIMEOUT occured
+ if (!defined($_[1])) {
+ warn "request timed out[$_[0]->{ErrorStr}]\n";
+ return;
+ }
+# print "$i) ",$_[1][0]->tag, " = ", $_[1][0]->val, "\n";
+}
+
+# $sess->get([[".1.3.6.1.2.1.1.3.0"]], [\&poller_handler, $sess]);
+
+SNMP::MainLoop(.1,sub {for (1..50) {$sess->get([['.1.3.6.1.2.1.1.3.0']], [\&poller_handler, $sess]);} });
diff --git a/perl/SNMP/examples/bulkwalk.pl b/perl/SNMP/examples/bulkwalk.pl
new file mode 100644
index 0000000..3ee2412
--- /dev/null
+++ b/perl/SNMP/examples/bulkwalk.pl
@@ -0,0 +1,121 @@
+use SNMP;
+
+# Hard-coded hostname and community. This is icky, but I didn't want to
+# muddle the example with parsing command line arguments. Deal with it. -r
+#
+my $hostname='localhost';
+my $port='161';
+my $community='public';
+
+$SNMP::debugging = 0;
+$SNMP::dump_packet = 0;
+
+$sess = new SNMP::Session( 'DestHost' => $hostname,
+ 'Community' => $community,
+ 'RemotePort' => $port,
+ 'Timeout' => 300000,
+ 'Retries' => 3,
+ 'Version' => '2c',
+ 'UseLongNames' => 1, # Return full OID tags
+ 'UseNumeric' => 1, # Return dotted decimal OID
+ 'UseEnums' => 0, # Don't use enumerated vals
+ 'UseSprintValue' => 0); # Don't pretty-print values
+
+die "Cannot create session: ${SNMP::ErrorStr}\n" unless defined $sess;
+
+# Set up a list of two non-repeaters and some repeated variables.
+#
+# IMPORTANT NOTE:
+#
+# The 'get' performed for non-repeaters is a "GETNEXT" (the non-repeater
+# requests are not fulfilled with SNMP GET's). This means that you must
+# ask for the lexicographically preceeding variable for non-repeaters.
+#
+# For most branches (i.e. 'sysUpTime'), this "just works" -- be sure you
+# don't ask for an instance, and the response will be as expected. However,
+# if you want a specific variable instance (i.e. 'ifSpeed.5'), you must
+# ask for the _preceeding_ variable ('ifSpeed.4' in this example).
+#
+# See section 4.2.3 of RFC 1905 for more details on GETBULK PDU handling.
+#
+
+my $vars = new SNMP::VarList( ['sysUpTime'], # Nonrepeater variable
+ ['ifNumber'], # Nonrepeater variable
+ ['ifSpeed'], # Repeated variable
+ ['ifDescr'] ); # Repeated variable.
+
+# Do the bulkwalk of the two non-repeaters, and the repeaters. Ask for no
+# more than 8 values per response packet. If the caller already knows how
+# many instances will be returned for the repeaters, it can ask only for
+# that many repeaters.
+#
+@resp = $sess->bulkwalk(2, 8, $vars);
+die "Cannot do bulkwalk: $sess->{ErrorStr} ($sess->{ErrorNum})\n"
+ if $sess->{ErrorNum};
+
+# Print out the returned response for each variable.
+for $vbarr ( @resp ) {
+ # Determine which OID this request queried. This is kept in the VarList
+ # reference passed to bulkwalk().
+ $oid = $$vars[$i++]->tag();
+
+ # Count the number of responses to this query. The count will be 1 for
+ # non-repeaters, 1 or more for repeaters.
+ $num = scalar @$vbarr;
+ print "$num responses for oid $oid: \n";
+
+ # Display the returned list of varbinds using the SNMP::Varbind methods.
+ for $v (@$vbarr) {
+ printf("\t%s = %s (%s)\n", $v->name, $v->val, $v->type);
+ }
+ print "\n";
+}
+
+#
+# Now do the same bulkwalk again, but in asynchronous mode. Set up a Perl
+# callback to receive the reference to the array of arrays of Varbind's for
+# the return value, and pass along the $vars VarList to it. This allows us
+# to print the oid tags (the callback code is almost the same as above).
+#
+# First, define the Perl callback to be called when the bulkwalk completes.
+# The call to SNMP::finish() will cause the SNMP::MainLoop() to return once
+# the callback has completed, so that processing can continue.
+#
+sub callback {
+ my ($vars, $values) = @_;
+
+ for $vbarr ( @$values ) {
+ # Determine which OID this request queried. This is kept in the
+ # '$vars' VarList reference passed to the Perl callback by the
+ # asynchronous callback.
+ $oid = (shift @$vars)->tag();
+
+ # Count the number of responses to this query. The count will be 1 for
+ # non-repeaters, 1 or more for repeaters.
+ $num = scalar @$vbarr;
+ print "$num responses for oid $oid: \n";
+
+ # Display the returned list of varbinds using the SNMP::Varbind methods.
+ for $v (@$vbarr) {
+ printf("\t%s = %s (%s)\n", $v->name, $v->val, $v->type);
+ }
+ print "\n";
+ }
+
+ SNMP::finish();
+}
+
+# The actual bulkwalk request is done here. Note that the $vars VarList
+# reference will be passed to the Perl callback when the bulkwalk completes.
+#
+my $reqid = $sess->bulkwalk(2, 8, $vars, [ \&callback, $vars ]);
+die "Cannot do async bulkwalk: $sess->{ErrorStr} ($sess->{ErrorNum})\n"
+ if $sess->{ErrorNum};
+
+# Now drop into the SNMP event loop and await completion of the bulkwalk.
+# The call to SNMP::finish() in &callback will make the SNMP::MainLoop()
+# return to the caller.
+#
+SNMP::MainLoop();
+
+exit 0;
diff --git a/perl/SNMP/examples/ipforward.pl b/perl/SNMP/examples/ipforward.pl
new file mode 100644
index 0000000..de61e40
--- /dev/null
+++ b/perl/SNMP/examples/ipforward.pl
@@ -0,0 +1,30 @@
+use SNMP;
+$SNMP::use_enums = 1;
+
+my $host = shift;
+my $comm = shift;
+$sess = new SNMP::Session(DestHost => $host, Community => $comm);
+
+$vars = new SNMP::VarList( ['ipRouteIfIndex'], ['ipRouteType'],
+ ['ipRouteProto'], ['ipRouteMask'],
+ ['ipRouteNextHop'], ['ipRouteAge'],
+ ['ipRouteMetric1']);
+
+format STDOUT_TOP =
+ Destination Next Hop Mask Proto Age Metric
+--------------- --------------- -------------- ------- -------- ------
+.
+
+format STDOUT =
+@<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<< @|||||| @||||||| @|||||
+$dest, $nhop, $mask, $proto, $age, $metric
+.
+
+for (($index,$type,$proto,$mask,$nhop,$age,$metric) = $sess->getnext($vars);
+ $$vars[0]->tag eq 'ipRouteIfIndex' and not $sess->{ErrorStr};
+ ($index,$type,$proto,$mask,$nhop,$age,$metric) = $sess->getnext($vars)) {
+ $dest = $$vars[0]->iid;
+ write;
+}
+
+print "$sess->{ErrorStr}\n";
diff --git a/perl/SNMP/examples/mibtree.pl b/perl/SNMP/examples/mibtree.pl
new file mode 100644
index 0000000..0616126
--- /dev/null
+++ b/perl/SNMP/examples/mibtree.pl
@@ -0,0 +1,20 @@
+use SNMP;
+$SNMP::save_descriptions = 1; # must be set prior to mib initialization
+SNMP::initMib(); # parses default list of Mib modules from default dirs
+
+# read dotted decimal oid or symbolic name to look up
+# partial name will be searched and all matches returned
+$val = shift || die "supply partial or complete object name or identifier\n";
+
+if ($node = $SNMP::MIB{$val}) {
+ print "$node:$node->{label} [$node->{objectID}]\n";
+ while (($k,$v) = each %$node) {
+ print "\t$k => $v\n";
+ }
+} else {
+ while (($k,$v) = each %SNMP::MIB) {
+ print "$v->{label} [$v->{obj}]\n" #accepts unique partial key(objectID)
+ if $k =~ /$val/ or $v->{label} =~ /$val/;
+ }
+}
+
diff --git a/perl/SNMP/examples/mibwalk.pl b/perl/SNMP/examples/mibwalk.pl
new file mode 100644
index 0000000..d62dc68
--- /dev/null
+++ b/perl/SNMP/examples/mibwalk.pl
@@ -0,0 +1,17 @@
+# snmpwalk of entire MIB
+# stop on error at end of MIB
+
+use SNMP 1.8;
+$SNMP::use_sprint_value = 1;
+my $host = shift || localhost;
+my $comm = shift || public;
+
+$sess = new SNMP::Session(DestHost => $host, Community => $comm);
+
+$var = new SNMP::Varbind([]);
+
+do {
+ $val = $sess->getnext($var);
+ print SNMP::Varbind::tag($var).".".SNMP::Varbind::iid($var)." = ".
+ SNMP::Varbind::val($var)."\n";
+} until ($sess->{ErrorStr});
diff --git a/perl/SNMP/examples/pingmib.pl b/perl/SNMP/examples/pingmib.pl
new file mode 100755
index 0000000..e6aa792
--- /dev/null
+++ b/perl/SNMP/examples/pingmib.pl
@@ -0,0 +1,46 @@
+#!/usr/bin/env perl
+
+# Ping a host via the CISCO-PING-MIB. For more information about the
+# CISCO-PING-MIB, see also
+# http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&mibName=CISCO-PING-MIB.
+
+use strict;
+use SNMP;
+
+my $target = shift || die "no ping target supplied\n"; # numeric ip address
+my $host = shift || 'localhost';
+my $community = shift || 'private';
+
+{
+ my $sess = new SNMP::Session (DestHost => $host,
+ Community => $community,
+ Retries => 1);
+
+ my $dec = pack("C*",split /\./, $target);
+ my $oid = ".1.3.6.1.4.1.9.9.16.1.1.1";
+ my $row = "300";
+ my $res;
+
+ $res = $sess->set([
+ ["$oid.16", $row, 6, "INTEGER"],
+ ["$oid.16", $row, 5, "INTEGER"],
+ ["$oid.15", $row, "MoNDS", "OCTETSTR"],
+ ["$oid.2", $row, 1, "INTEGER"],
+ ["$oid.4", $row, 20, "INTEGER"],
+ ["$oid.5", $row, 150, "INTEGER"],
+ ["$oid.3", $row, $dec, "OCTETSTR"]]);
+ defined($res) || die "row creation failed";
+
+ $res = $sess->set([["$oid.16", $row, 1, "INTEGER"]]);
+ defined($res) || die "row activation failed";
+
+ sleep 30;
+ my ($sent, $received, $low, $avg, $high, $completed) = $sess->get([
+ ["$oid.9", $row], ["$oid.10", $row], ["$oid.11", $row],
+ ["$oid.12", $row], ["$oid.13", $row], ["$oid.14", $row]]);
+
+ printf "Packet loss: %d% (%d/%d)\n", (100 * ($sent-$received)) / $sent,
+ $received, $sent;
+ print "Average delay $avg (low: $low high: $high)\n";
+ $sess->set(["$oid.16", $row, 6, "INTEGER"]);
+}
diff --git a/perl/SNMP/examples/tablewalk.pl b/perl/SNMP/examples/tablewalk.pl
new file mode 100644
index 0000000..6fe344c
--- /dev/null
+++ b/perl/SNMP/examples/tablewalk.pl
@@ -0,0 +1,19 @@
+# snmpwalk of a single table
+# getnext of 3 columns from ipAddrEntry table
+# stop after last row in table
+
+use SNMP 1.8;
+
+my $host = shift || localhost;
+my $comm = shift || public;
+
+my $sess = new SNMP::Session ( DestHost => $host, Community => $comm );
+
+my $vars = new SNMP::VarList([ipAdEntAddr],[ipAdEntIfIndex],[ipAdEntNetMask]);
+
+for (@vals = $sess->getnext($vars);
+ $vars->[0]->tag =~ /ipAdEntAddr/ # still in table
+ and not $sess->{ErrorStr}; # and not end of mib or other error
+ @vals = $sess->getnext($vars)) {
+ print " ($vals[1]) $vals[0]/$vals[2]\n";
+}
diff --git a/perl/SNMP/examples/testleak.pl b/perl/SNMP/examples/testleak.pl
new file mode 100644
index 0000000..495f33b
--- /dev/null
+++ b/perl/SNMP/examples/testleak.pl
@@ -0,0 +1,19 @@
+use SNMP 1.6;
+
+$host = shift;
+unless ($host) {
+ $| = 1; print "enter SNMP host address: "; $| = 0;
+ chomp($host = <STDIN>);
+}
+
+$obj = new SNMP::Session DestHost, $host;
+
+while (){
+print $obj->get(["ifNumber",0]);
+ open(COM,"ps -u$$|") || die;
+ @bar = <COM>;
+ $siz = (split(' ',$bar[1]))[4];
+ $rss = (split(' ',$bar[1]))[5];
+ close(COM);
+ print "siz = $siz, rss = $rss\n";
+}
diff --git a/perl/SNMP/examples/trap-example.pl b/perl/SNMP/examples/trap-example.pl
new file mode 100644
index 0000000..8b8913f
--- /dev/null
+++ b/perl/SNMP/examples/trap-example.pl
@@ -0,0 +1,94 @@
+use strict;
+use vars qw();
+use SNMP qw();
+
+&SNMP::initMib();
+
+&SNMP::loadModules(
+ 'RFC2127-MIB',
+ );
+
+sub trap_call_setup;
+sub trap_dummy;
+
+#
+# should eventually get these out of the MIB...
+#
+my %dispatch_table = (
+ 'isdnMibCallInformation', \&trap_call_setup,
+ '.', \&trap_dummy,
+);
+
+sub trap_dispatcher
+{
+ my $session = shift;
+ my $ref = shift;
+ my $trapType;
+ my ($reqid, $addr, $community);
+
+ # if this is a timeout, then there will be no args...
+ if (defined($ref)) {
+ $ref->[1]->[2] = SNMP::translateObj($ref->[1]->val);
+ $trapType = $ref->[1]->val;
+ my $args = shift;
+ ($reqid, $addr, $community) = @{$args};
+ } else {
+ $trapType = 'timeout';
+ }
+
+ if (defined($dispatch_table{$trapType})) {
+ &{$dispatch_table{$trapType}}($session, $ref);
+ } elsif (defined($dispatch_table{'.'})) {
+ &{$dispatch_table{'.'}}($session, $ref);
+ } else {
+ # don't do anything... silently discard.
+ }
+}
+
+sub trap_dummy
+{
+ my $session = shift;
+ my $ref = shift;
+
+ my $trapType = $ref->[1]->val;
+
+ warn "unexpected trap " . $trapType;
+}
+
+
+sub trap_call_setup
+{
+ my $session = shift;
+ my $varlist = shift;
+ my $args = shift;
+
+ my $ifIndex = $varlist->[2]->val;
+ my $isdnBearerOperStatus = $varlist->[3]->val;
+ my $isdnBearerPeerAddress = $varlist->[4]->val;
+ my $isdnBearerPeerSubAddress = $varlist->[5]->val;
+ my $isdnBearerInfoType = $varlist->[6]->val;
+ my $isdnBearerCallOrigin = $varlist->[5]->val;
+
+ my ($reqid, $ipaddr, $community) = @{$args};
+
+ printf "Call from %s", $isdnBearerPeerAddress;
+ printf "*%s", $isdnBearerPeerSubAddress if ($isdnBearerPeerSubAddress ne '');
+ printf "\n";
+}
+
+my $session = new SNMP::Session(
+ DestHost => 'udp:162',
+ LocalPort => 1,
+ Version => '2c',
+ UseEnums => 0,
+ );
+
+if (!defined($session)) {
+ die "can't create listener session";
+}
+
+# otherwise assume that ErrorNum is zero...
+
+$session->SNMP::_catch([\&trap_dispatcher, $session]);
+
+&SNMP::MainLoop();
diff --git a/perl/SNMP/hints/irix.pl b/perl/SNMP/hints/irix.pl
new file mode 100644
index 0000000..3e38826
--- /dev/null
+++ b/perl/SNMP/hints/irix.pl
@@ -0,0 +1,2 @@
+# uses libelf for nlist on irix (>= 5.3?)
+$self->{LIBS} .= ' -lelf';
diff --git a/perl/SNMP/hints/solaris.pl b/perl/SNMP/hints/solaris.pl
new file mode 100644
index 0000000..87dccd1
--- /dev/null
+++ b/perl/SNMP/hints/solaris.pl
@@ -0,0 +1,4 @@
+# uses kstat on solaris for get_uptime
+$self->{LIBS} .= ' -lkstat';
+# add -ldb if you are getting the vsnprintf not found error
+# $self->{LIBS} .= ' -lkstat -ldb';
diff --git a/perl/SNMP/netsnmp-feature-definitions.h b/perl/SNMP/netsnmp-feature-definitions.h
new file mode 100644
index 0000000..adc642c
--- /dev/null
+++ b/perl/SNMP/netsnmp-feature-definitions.h
@@ -0,0 +1,8 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_require(snprint_objid)
+netsnmp_feature_require(snprint_value)
+netsnmp_feature_require(find_module)
+netsnmp_feature_require(get_tc_description)
+
diff --git a/perl/SNMP/perlsnmp.h b/perl/SNMP/perlsnmp.h
new file mode 100644
index 0000000..57bb064
--- /dev/null
+++ b/perl/SNMP/perlsnmp.h
@@ -0,0 +1,24 @@
+#ifndef timeradd
+#define timeradd(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
+ if ((result)->tv_usec >= 1000000) \
+ { \
+ ++(result)->tv_sec; \
+ (result)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+#endif
+
+#ifndef timersub
+#define timersub(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif
diff --git a/perl/SNMP/t/README b/perl/SNMP/t/README
new file mode 100644
index 0000000..7921732
--- /dev/null
+++ b/perl/SNMP/t/README
@@ -0,0 +1,81 @@
+
+mibload
+(save_descriptions, use_long_names)
+ setmib
+ initMib
+ addMibDirs
+ addMibFiles
+ loadModules
+ unloadModules (todo)
+
+mib
+ translateObj
+ getType
+ mapEnum
+ SNMP::MIB::NODE
+
+session
+ connectivity
+ error handling
+ mib loading
+ parameters
+
+get
+(use_enums, sprint_val, long_names)
+ var formats
+ fget
+ multi varbinds
+ error reporting
+
+getnext
+
+set
+
+trap??
+
+async
+
+snmpv3
+
+
+This is the first stab at setting up comprehensive tests for
+SNMP-1.7 which look and act like regular perl5 test results.
+
+Use teststub.t attached below as a template for creating additional
+test modules.
+
+Add more tests and feed them back into the distribution! The more the
+better!
+
+Written by John Stoffel (jfs@fluent.com =or= john@nesc.org) 10/14/1997
+
+------------<teststub.t>--------------------------------
+#!./perl
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+}
+use Test;
+use SNMP 3.0;
+
+$SNMP::verbose = 0;
+$num = 0; # Number of tests to run
+
+print "1..$num\n";
+$n = 1;
+
+my $junk_oid = ".1.3.6.1.2.1.1.1.1.1.1";
+my $oid = '.1.3.6.1.2.1.1.1';
+my $name = 'sysDescr';
+my $junk_name = 'fooDescr';
+
+######################################################################
+# Garbage names return Undef.
+# test 1
+$type = SNMP::getType($junk_name);
+printf "%s %d\n", (!defined($type)) ? "ok" :"not ok", $n++;
+
+
diff --git a/perl/SNMP/t/async.t b/perl/SNMP/t/async.t
new file mode 100644
index 0000000..f3fb38d
--- /dev/null
+++ b/perl/SNMP/t/async.t
@@ -0,0 +1,169 @@
+#!./perl
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ eval "use Cwd qw(abs_path)";
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs");
+
+ $skipped_tests = ($^O =~ /win32/i) ? 20 : 0;
+}
+
+use Test;
+BEGIN {plan tests => 20 - $skipped_tests}
+use SNMP;
+use vars qw($agent_port $comm $agent_host);
+
+if ($^O =~ /win32/i) {
+ warn "Win32/Win64 detected - skipping async calls\n";
+ exit;
+}
+
+require "t/startagent.pl";
+
+
+sub cb1; # forward reference
+sub cb2;
+sub cb3;
+sub cb4;
+sub cb5;
+sub cb6;
+sub cb7;
+sub cbDummy;
+
+$SNMP::verbose = 0;
+$SNMP::dump_packet = 0;
+
+my $sess = new SNMP::Session(DestHost => $agent_host,
+ Version => 1,
+ Community => $comm,
+ RemotePort => $agent_port);
+
+# try getting unregistered OID.
+my $result = $sess->get([["HooHaaHooHaa","0"]], [\&cbDummy, $sess]);
+ok(!defined($result));
+
+# this get should work
+$result = $sess->get([["sysDescr","0"]], [\&cb1, $sess]);
+ok($result);
+
+SNMP::MainLoop();
+
+snmptest_cleanup();
+
+exit 0;
+
+sub cb1{
+ my $sess = shift;
+ my $vlist = shift;
+
+ ok(defined($vlist));
+ my $tag = $vlist->[0]->tag;
+ ok($tag eq 'sysDescr');
+ my $val = $vlist->[0]->val;
+ ok(defined $val);
+ my $iid = $vlist->[0]->iid;
+ my $type = $vlist->[0]->type;
+ ok($type eq 'OCTETSTR');
+ my $res = $sess->getnext([["sysDescr",0]], [\&cb2, $sess]);
+ ok ($res);
+} # end of cb1
+
+sub cb2{
+ my $sess = shift;
+ my $vlist = shift;
+
+ ok(defined($vlist));
+ ok(ref($vlist->[0]) =~ /Varbind/);
+ ok($vlist->[0][0] eq 'sysObjectID');
+ my $res = $sess->get([[".1.3.6.1.2.1.1.1.0"]], [\&cb3, $sess]);
+ ok($res);
+} # end of cb2
+
+sub cb3{
+ my $sess = shift;
+ my $vlist = shift;
+
+ ok(defined($vlist));
+
+ ok($vlist->[0][0] eq 'sysDescr');
+
+ my $res = $sess->getnext([["sysDescr",0]], [\&cb4, $sess]);
+ ok($res);
+} # end of cb3
+
+sub cb4{
+ my $sess = shift;
+ my $vlist = shift;
+
+ ok(defined $vlist);
+ my $res = $sess->set("sysDescr.0", "hahaha", [\&cb5, $sess]);
+} # end of cb4
+
+sub cb5{
+ my $sess = shift;
+ my $vlist = shift;
+
+ ok(defined($vlist));
+
+ my $res = $sess->set("sysORID.1", ".1.3.6.1.2.1.1.1", [\&cb6, $sess]);
+ ok(defined $res);
+} # end of cb5
+
+sub cb6{
+ my $sess = shift;
+ my $vlist = shift;
+ my $tag = $vlist->[0]->tag;
+ my $val = $vlist->[0]->val;
+
+ ok($tag =~ /^sysORID/);
+# create list of varbinds for GETS, val field can be null or omitted
+ my $vars =
+ new SNMP::VarList (
+ ['sysDescr', '0', ''],
+ ['sysObjectID', '0'],
+ ['sysUpTime', '0'],
+ ['sysContact', '0'],
+ ['sysName', '0'],
+ ['sysLocation', '0'],
+ ['sysServices', '0'],
+ ['ifNumber', '0'],
+ ['ifDescr', '1'],
+ ['ifSpeed', '1'],
+ ['snmpInPkts', '0'],
+ ['snmpInBadVersions', '0'],
+ ['snmpInBadCommunityNames', '0'],
+ ['snmpInBadCommunityUses', '0'],
+ ['snmpInASNParseErrs', '0'],
+ ['snmpEnableAuthenTraps', '0'],
+ ['sysORID', '1'],
+ ['sysORDescr', '1'],
+ ['sysORUpTime', '1'],
+ ['sysORLastChange', '0'],
+ ['ipInHdrErrors', '0'],
+ ['ipDefaultTTL', '0'],
+ ['ipInHdrErrors', '0'],
+ );
+ my $res = $sess->get($vars, [\&cb7, $sess]);
+ ok(defined $res);
+} # end of cb6
+
+sub cb7{
+ my $sess = shift;
+ my $vlist = shift;
+
+
+ my $tag = $vlist->[0]->tag;
+ my $val = $vlist->[0]->val;
+
+ ok(@{$vlist} == 23);
+
+ SNMP::finish();
+} # end of cb7
+
+sub cbDummy {
+ warn("error: this should not get called");
+}
+
diff --git a/perl/SNMP/t/bulkwalk.t b/perl/SNMP/t/bulkwalk.t
new file mode 100644
index 0000000..2d13e7b
--- /dev/null
+++ b/perl/SNMP/t/bulkwalk.t
@@ -0,0 +1,339 @@
+#!./perl
+#
+# $Id$
+#
+# Test bulkwalk functionality.
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ eval "use Cwd qw(abs_path)";
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs");
+ $skipped_tests = ($^O =~ /win32/i) ? 21 : 0;
+}
+use Test;
+BEGIN { $num = 62 - $skipped_tests; plan test => $num; }
+
+use SNMP;
+
+require "t/startagent.pl";
+
+use vars qw($agent_port $comm2 $agent_host);
+
+$SNMP::debugging = 0;
+$SNMP::verbose = 0;
+
+#print "1..$num\n";
+
+######################################################################
+# Fire up a session.
+$s1 = new SNMP::Session(
+ 'DestHost' => $agent_host,
+ 'Community' => $comm2,
+ 'RemotePort' => $agent_port,
+ 'Version' => '2c',
+ 'UseNumeric' => 1,
+ 'UseEnum' => 0,
+ 'UseLongNames' => 1
+);
+ok(defined($s1));
+
+######################################################################
+#
+# Attempt to use the bulkwalk method to get a few variables from the
+# SNMP agent.
+# test 1
+$vars = new SNMP::VarList ( ['sysUpTime'], ['ifNumber'], # NON-repeaters
+ ['ifSpeed'], ['ifDescr']); # Repeated variables.
+
+$expect = scalar @$vars;
+@list = $s1->bulkwalk(2, 16, $vars);
+
+ok($s1->{ErrorNum} == 0);
+
+# Did we get back the list of references to returned values?
+#
+ok(scalar @list == $expect);
+if (defined($list[0][0])) {
+ # Sanity check the returned values. list[0] is sysUptime nonrepeater.
+ ok($list[0][0]->tag eq ".1.3.6.1.2.1.1.3"); # check system.sysUptime OID
+ ok($list[0][0]->iid eq "0"); # check system.sysUptime.0 IID
+ ok($list[0][0]->val =~ m/^\d+$/); # Uptime is numeric
+ ok($list[0][0]->type eq "TICKS"); # Uptime should be in ticks.
+}
+else {
+ ok(0);
+ ok(0);
+ ok(0);
+ ok(0);
+}
+if (defined($list[1][0])) {
+ # Find out how many interfaces to expect. list[1] is ifNumber nonrepeater.
+ ok($list[1][0]->tag eq ".1.3.6.1.2.1.2.1"); # Should be system.ifNumber OID.
+ ok($list[1][0]->iid eq "0"); # system.ifNumber.0 IID.
+ ok($list[1][0]->val =~ m/^\d+$/); # Number is all numeric
+ #XXX: test fails due SMIv1 codes being returned intstead of SMIv2...
+ #ok($list[1][0]->type eq "INTEGER32"); # Number should be integer.
+
+ $ifaces = $list[1][0]->val;
+}
+else {
+ ok(0);
+ ok(0);
+ ok(0);
+}
+
+# Make sure we got an ifSpeed for each interface. list[2] is ifSpeed repeater.
+ok(scalar @{$list[2]} == $ifaces);
+# Make sure we got an ifDescr for each interface. list[3] is ifDescr repeater.
+ok(scalar @{$list[3]} == $ifaces);
+
+if (defined($list[2][0])) {
+ # Test for reasonable values from the agent.
+ ok($list[2][0]->tag eq ".1.3.6.1.2.1.2.2.1.5"); # Should be system.ifSpeed OID.
+ ok($list[2][0]->iid eq "1"); # Instance should be 1.
+ ok($list[2][0]->val =~ m/^\d+$/); # Number is all numeric
+ ok($list[2][0]->type eq "GAUGE"); # Number should be a gauge.
+}
+else {
+ ok(0);
+ ok(0);
+ ok(0);
+ ok(0);
+}
+
+if (defined($list[3][0])) {
+ ok($list[3][0]->tag eq ".1.3.6.1.2.1.2.2.1.2"); # Should be system.ifDescr OID.
+ ok($list[3][0]->iid eq "1"); # Instance should be 1.
+
+ # The first interface is probably loopback. Check this.
+ ok($list[3][0]->type eq "OCTETSTR"); # Description is a string.
+
+ # This might fail on systems that don't have lo0/loopback as their first
+ # interface. Please adjust accordingly.
+ $loopback = $list[3][0]->val;
+ if ($^O =~ /win32/i) {
+ ok(($loopback =~ /loopback/i));
+ } elsif ($^O =~ /(irix|hpux)/i) {
+ # IRIX/HP-UX may have lo0 at the *end* of the interface list,
+ # so just check for a non-empty string
+ ok(($loopback ne ''));
+ } elsif ($^O eq 'freebsd') {
+ $loopback = $list[3][-1]->val;
+ ok(($loopback =~ /^lo/));
+ } else {
+ ok(($loopback =~ /^lo/));
+ }
+}
+else {
+ ok(0);
+ ok(0);
+ ok(0);
+ ok(0);
+}
+
+###############################################################################
+# Attempt to use the bulkwalk method to get only non-repeaters
+# test 2
+$vars = new SNMP::VarList ( ['sysUpTime'], ['ifNumber'] ); # NON-repeaters
+
+$expect = scalar @$vars;
+@list = $s1->bulkwalk(2, 0, $vars);
+#@list = $s1->bulkwalk(2, 16, $vars);
+ok($s1->{ErrorNum} == 0);
+
+# Did we get back the list of references to returned values?
+#
+ok(scalar @list == $expect);
+
+if (defined($list[0][0])) {
+ # Sanity check the returned values. list[0] is sysUptime nonrepeater.
+ ok($list[0][0]->tag eq ".1.3.6.1.2.1.1.3"); # check system.sysUptime OID
+ ok($list[0][0]->iid eq "0"); # check system.sysUptime.0 IID
+ ok($list[0][0]->val =~ m/^\d+$/); # Uptime is numeric
+ ok($list[0][0]->type eq "TICKS"); # Uptime should be in ticks.
+}
+else {
+ ok(0);
+ ok(0);
+ ok(0);
+ ok(0);
+}
+
+if (defined($list[1][0])) {
+ # Find out how many interfaces to expect. list[1] is ifNumber nonrepeater.
+ ok($list[1][0]->tag eq ".1.3.6.1.2.1.2.1"); # Should be system.ifNumber OID.
+ ok($list[1][0]->iid eq "0"); # system.ifNumber.0 IID.
+ ok($list[1][0]->val =~ m/^\d+$/); # Number is all numeric
+ #XXX: test fails due SMIv1 codes being returned intstead of SMIv2...
+ #ok($list[1][0]->type eq "INTEGER32"); # Number should be integer.
+ $ifaces = $list[1][0]->val;
+}
+else {
+ ok(0);
+ ok(0);
+ ok(0);
+}
+
+###############################################################################
+# Attempt to use the bulkwalk method to get only repeated variables
+# test 3
+$vars = new SNMP::VarList ( ['ifIndex'], ['ifSpeed'] ); # repeaters
+
+$expect = scalar @$vars;
+@list = $s1->bulkwalk(0, 16, $vars);
+ok($s1->{ErrorNum} == 0);
+
+# Did we get back the list of references to returned values?
+#
+ok(scalar @list == $expect);
+
+# Make sure we got an ifIndex for each interface. list[0] is ifIndex repeater.
+ok(scalar @{$list[0]} == $ifaces);
+
+# Make sure we got an ifSpeed for each interface. list[0] is ifSpeed repeater.
+ok(scalar @{$list[1]} == $ifaces);
+
+if (defined($list[0][0])) {
+ # Test for reasonable values from the agent.
+ ok($list[0][0]->tag eq ".1.3.6.1.2.1.2.2.1.1"); # Should be system.ifIndex OID.
+ ok($list[0][0]->iid eq "1"); # Instance should be 1.
+ ok($list[0][0]->val =~ m/^\d+$/); # Number is all numeric
+ #XXX: test fails due SMIv1 codes being returned intstead of SMIv2...
+ #ok($list[0][0]->type eq "INTEGER32"); # Number should be an integer.
+}
+else {
+ ok(0);
+ ok(0);
+ ok(0);
+}
+
+if (defined($list[1][0])) {
+ ok($list[1][0]->tag eq ".1.3.6.1.2.1.2.2.1.5"); # Should be system.ifSpeed OID.
+ ok($list[1][0]->iid eq "1"); # Instance should be 1.
+ ok($list[1][0]->val =~ m/^\d+$/); # Number is all numeric
+ ok($list[1][0]->type eq "GAUGE"); # Number should be a gauge.
+}
+else {
+ ok(0);
+ ok(0);
+ ok(0);
+ ok(0);
+}
+
+######################################################################
+# Asynchronous Bulkwalk Methods
+######################################################################
+#
+# Attempt to use the bulkwalk method to get a few variables from the
+# SNMP agent.
+# test 4
+sub async_cb1 {
+ my ($vars, $list) = @_;
+ ok(defined $list && ref($list) =~ m/ARRAY/);
+ ok(defined $vars && ref($vars) =~ m/SNMP::VarList/);
+
+ ok(scalar @$list == scalar @$vars);
+
+ my $vbr;
+
+ if (defined($list->[0][0])) {
+ # Sanity check the returned values. First is sysUptime nonrepeater.
+ $vbr = $list->[0][0];
+ ok($vbr->tag eq ".1.3.6.1.2.1.1.3"); # check system.sysUptime OID
+ ok($vbr->iid eq "0"); # check system.sysUptime.0 IID
+ ok($vbr->val =~ m/^\d+$/); # Uptime is numeric
+ ok($vbr->type eq "TICKS"); # Uptime should be in ticks.
+ }
+ else {
+ ok(0);
+ ok(0);
+ ok(0);
+ ok(0);
+ }
+
+ if (defined($list->[1][0])) {
+ # Find out how many interfaces to expect. Next is ifNumber nonrepeater.
+ $vbr = $list->[1][0];
+ ok($vbr->tag eq ".1.3.6.1.2.1.2.1"); # Should be system.ifNumber OID.
+ ok($vbr->iid eq "0"); # system.ifNumber.0 IID.
+ ok($vbr->val =~ m/^\d+$/); # Number is all numeric
+ #XXX: test fails due SMIv1 codes being returned intstead of SMIv2...
+ # ok($vbr->type eq "INTEGER32"); # Number should be integer.
+ $ifaces = $vbr->[2];
+ }
+ else {
+ ok(0);
+ ok(0);
+ ok(0);
+ }
+
+ # Test for reasonable values from the agent.
+ ok(scalar @{$list->[2]} == $ifaces);
+
+ if (defined($list->[2][0])) {
+ $vbr = $list->[2][0];
+ ok($vbr->tag eq ".1.3.6.1.2.1.2.2.1.5"); # Should be ifSpeed OID
+ ok($vbr->iid eq "1"); # Instance should be 1.
+ ok($vbr->val =~ m/^\d+$/); # Number is all numeric
+ ok($vbr->type eq "GAUGE"); # Should be a gauge.
+
+ ok(scalar @{$list->[3]} == $ifaces);
+ }
+ else {
+ ok(0);
+ ok(0);
+ ok(0);
+ ok(0);
+ ok(0);
+ }
+
+ if (defined($list->[3][0])) {
+ $vbr = $list->[3][0];
+ ok($vbr->tag eq ".1.3.6.1.2.1.2.2.1.2"); # Should be ifDescr OID
+ ok($vbr->iid eq "1"); # Instance should be 1.
+
+ # The first interface is probably loopback. Check this.
+ ok($vbr->type eq "OCTETSTR");
+
+ # This might fail on systems that don't have lo0/loopback as their first
+ # interface. Please adjust accordingly.
+ if ($^O =~ /(irix|hpux)/i) {
+ # IRIX/HP-UX may have lo0 at the *end* of the interface list,
+ # so just check for a non-empty string
+ ok(($vbr->val ne ''));
+ } elsif ($^O eq 'freebsd') {
+ $vbr = $list->[3][-1];
+ ok(($vbr->val =~ /^lo/));
+ } else {
+ ok(($vbr->val =~ /^lo/));
+ }
+ }
+ else {
+ ok(0);
+ ok(0);
+ ok(0);
+ ok(0);
+ }
+
+ SNMP::finish();
+}
+
+$vars = new SNMP::VarList ( ['sysUpTime'], ['ifNumber'], # NON-repeaters
+ ['ifSpeed'], ['ifDescr']); # Repeated variables.
+
+if ($^O =~ /win32/i) {
+ warn "Win32/Win64 detected - skipping async calls\n";
+}
+else {
+ @list = $s1->bulkwalk(2, 16, $vars, [ \&async_cb1, $vars ] );
+ ok($s1->{ErrorNum} == 0);
+ SNMP::MainLoop();
+}
+ok(1);
+
+snmptest_cleanup();
+
diff --git a/perl/SNMP/t/conf.t b/perl/SNMP/t/conf.t
new file mode 100644
index 0000000..9a37048
--- /dev/null
+++ b/perl/SNMP/t/conf.t
@@ -0,0 +1,53 @@
+#!./perl
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ $ENV{'MIBS'} = '';
+}
+
+# This merely checks to see if the default_store routines work from
+# read configuration files. Functionally, if this fails then it's a
+# serious problem because they linked with static libraries instead of
+# shared ones as the memory space is different.
+
+use Test;
+BEGIN {plan tests => 3}
+
+my $envsep = ($^O =~ /win32/i) ? ';' : ':';
+
+SNMP::setenv('SNMPCONFPATH', '.' . $envsep . 't', 1);
+
+ok(1); # just start up
+
+use SNMP;
+use NetSNMP::default_store(':all');
+
+# should be 0, as it's un-initialized
+$myint = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_NUMERIC_TIMETICKS);
+
+ok($myint == 0);
+
+SNMP::init_snmp("conftest");
+
+$myint = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_NUMERIC_TIMETICKS);
+
+# ok, should be 1 as it's initalized by the snmp.conf config file.
+ok($myint == 1);
+
+# this is a pretty major error, so if it's not true we really really
+# print a big big warning. Technically, I suspect this is a bad thing
+# to do in perl tests but...
+if ($myint != 1) {
+ die "\n\n\n" . "*" x 75 . "\nBIG PROBLEM($myint): I wasn't able to read
+ data from a configuration file. This likely means that you've
+ compiled the net-snmp package with static libraries, which can
+ cause real problems with the perl module. Please reconfigure your
+ net-snmp package for use with shared libraries (run configure with
+ --enable-shared)\n" . "*" x 75 . "\n\n\n\n";
+}
+
diff --git a/perl/SNMP/t/conftest.conf b/perl/SNMP/t/conftest.conf
new file mode 100644
index 0000000..9cf5219
--- /dev/null
+++ b/perl/SNMP/t/conftest.conf
@@ -0,0 +1,2 @@
+[snmp]
+numericTimeticks 1
diff --git a/perl/SNMP/t/get.t b/perl/SNMP/t/get.t
new file mode 100644
index 0000000..f88de65
--- /dev/null
+++ b/perl/SNMP/t/get.t
@@ -0,0 +1,216 @@
+#!./perl
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ eval "use Cwd qw(abs_path)";
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs");
+}
+use Test;
+BEGIN { $n = 17; plan tests => $n }
+use SNMP;
+use vars qw($agent_port $comm $agent_host);
+require "t/startagent.pl";
+$SNMP::debugging = 0;
+$SNMP::verbose = 0;
+$SNMP::dump_packet = 0;
+
+my $junk_oid = ".1.3.6.1.2.1.1.1.1.1.1";
+my $oid = '.1.3.6.1.2.1.1.1';
+my $junk_name = 'fooDescr';
+my $junk_host = 'no.host.here';
+my $name = "gmarzot\@nortelnetworks.com";
+my $s1;
+
+# create list of varbinds for GETS, val field can be null or omitted
+$vars = new SNMP::VarList (
+ ['sysDescr', '0', ''],
+ ['sysObjectID', '0'],
+ ['sysUpTime', '0'],
+ ['sysContact', '0'],
+ ['sysName', '0'],
+ ['sysLocation', '0'],
+ ['sysServices', '0'],
+
+ ['snmpInPkts', '0'],
+ ['snmpInBadVersions', '0'],
+ ['snmpInBadCommunityNames', '0'],
+ ['snmpInBadCommunityUses', '0'],
+ ['snmpInASNParseErrs', '0'],
+ ['snmpEnableAuthenTraps', '0'],
+
+ ['sysORID', '1'],
+ ['sysORDescr', '1'],
+ ['sysORUpTime', '1'],
+ ['sysORLastChange', '0'],
+ ['snmpSilentDrops', '0'],
+ ['snmpProxyDrops', '0'],
+
+## not all agents we know will support these objects
+# ['hrStorageType', '2'],
+# ['hrSystemDate', '0'],
+# ['sysORIndex', '1'],
+# ['ifName', '1'],
+# ['ifNumber', '0'],
+# ['ifDescr', '1'],
+# ['ifSpeed', '1'],
+# ['snmpTrapEnterprise', '2'],
+# ['ipInHdrErrors', '0'],
+# ['ipDefaultTTL', '0'],
+# ['ipInHdrErrors', '0'],
+
+ );
+################################################################
+# Yet to do:
+# test for the max limit the 'get' can provide.
+# Figure out why the IP and Physical address are not getting printed.
+# why ifname is not getting printed?
+################################################################
+# ['ipNetToMediaPhysAddress', '0'],
+# ['ipAdEntAddr', '0'],
+# ['snmpTrapOID', '0'],
+# ['hrSystemNumUsers', '0'],
+# ['hrFSLastFullBackupDate', '0'],
+# ['ifPromiscuousMode', '0'],
+
+
+
+######################################################################
+# Fire up a session.
+ $s1 =
+ new SNMP::Session (DestHost=>$agent_host,Version=>1,Community=>$comm,RemotePort=>$agent_port);
+ ok(defined($s1));
+
+######################################################################
+# Get the standard Vars and check that we got some defined vars back
+@ret = $s1->get($vars);
+ok(!$s1->{ErrorStr} and defined($ret[0]));
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+######################################################################
+# Check that we got back the number we asked for.
+ok($#ret == $#{$vars});
+#print("dude : $#ret\n");
+################################################
+
+# Test for a string
+$contact = $s1->get('sysContact.0');
+#print("contact is : $contact\n");
+ok( defined($contact));
+
+
+$name = $s1->get('sysName.0');
+#print("Name is : $name\n");
+ok( defined($name));
+
+
+$location = $s1->get('sysLocation.0');
+#print("Location is : $location\n");
+ok( defined($location));
+#########################################
+
+
+# Test for an integer
+$ttl = $s1->get('ipDefaultTTL.0');
+#print("TTL is : $ttl\n");
+ok( defined($ttl));
+########################################
+
+
+# Test for a TimeTicks
+$time = $s1->get('sysUpTime.0');
+#print("up time is : $time hundredths of a second\n");
+ok( defined($time));
+#########################################
+
+
+#Test for a Counter32 type.
+$totalDatagramsReceived = $s1->get('ipInHdrErrors.0');
+#print("totalDatagramsReceived is : $totalDatagramsReceived\n");
+ok( defined($totalDatagramsReceived));
+################################################
+
+
+#Test for a PhysicalAddr type
+$physaddr = $s1->get('ipNetToMediaPhysAddress.0');
+#print("physical addr is : $physaddr \n");
+ok( defined($physaddr));
+##############################################
+
+
+#Test for a IpAddr type
+$ipaddr = $s1->get('ipAdEntAddr.0');
+#print("Ip address is : $ipaddr \n");
+ok( defined($ipaddr));
+##############################################
+
+
+#Test for a OID type
+$trapOID = $s1->get('snmpTrapOID.0');
+#print("trap OID is : $trapOID $s1->{ErrorStr}\n");
+ok( defined($trapOID));
+##############################################
+
+
+#Test for a Gauge type
+#$numusers = $s1->get('hrSystemNumUsers.0');
+#print("Number of users is : $numusers \n");
+#ok( defined($numusers));
+##############################################
+
+#nosuchname
+#Test for a date & time type
+#$datetime = $s1->get('hrFSLastFullBackupDate.0');
+#print("Number of users is : $datetime \n");
+#ok( defined($datetime));
+##############################################
+
+#nosuchname
+#Test for a Truth value type
+#$mode = $s1->get('ifPromiscuousMode.16');
+#print("Truth value(1 true, 2 false) is : $mode \n");
+#ok( defined($mode));
+##############################################
+
+# Time stamp test
+$time = $s1->get('sysORLastChange.0');
+#print("time stamp is : $time \n");
+ok(defined($time));
+#############################################
+
+# Integer test
+#$index = $s1->get('sysORIndex.0');
+#print("index is : $index\n");
+#ok(defined($index));
+#############################################
+
+# OID test
+$oid = $s1->get('sysORID.1');
+#print("index is : $oid\n");
+ok(defined($oid));
+#############################################
+
+# String test
+$descr = $s1->get('sysORDescr.1');
+#print("Sys Descr is : $descr\n");
+ok(defined($descr));
+#############################################
+
+# string String test
+$ifname = $s1->get('ifDescr.1');
+#print("ifname is : $ifname $s1->{ErrorStr}\n");
+ok(defined($ifname));
+#############################################
+
+
+# Try getting some unknown(wrong ?) data
+$unknown = $s1->get('ifmyData.0');
+ok(!defined($unknown));
+##############################################
+
+
+snmptest_cleanup();
+
+
diff --git a/perl/SNMP/t/getnext.t b/perl/SNMP/t/getnext.t
new file mode 100644
index 0000000..417ae91
--- /dev/null
+++ b/perl/SNMP/t/getnext.t
@@ -0,0 +1,102 @@
+#!./perl
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ eval "use Cwd qw(abs_path)";
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs");
+}
+
+use Test;
+BEGIN { plan tests => 9 }
+use SNMP;
+use vars qw($agent_port $comm $agent_host);
+require "t/startagent.pl";
+
+
+my $junk_oid = ".1.3.6.1.2.1.1.1.1.1.1";
+my $oid = '.1.3.6.1.2.1.1.1';
+my $junk_name = 'fooDescr';
+my $junk_host = 'no.host.here';
+my $name = "gmarzot\@nortelnetworks.com";
+
+$SNMP::debugging = 0;
+my $n = 9; # Number of tests to run
+
+#print "1..$n\n";
+#if ($n == 0) { exit 0; }
+
+# create list of varbinds for GETS, val field can be null or omitted
+my $vars = new SNMP::VarList (
+ ['sysDescr', '0', ''],
+ ['sysContact', '0'],
+ ['sysName', '0'],
+ ['sysLocation', '0'],
+ ['sysServices', '0'],
+ ['ifNumber', '0'],
+ ['ifDescr', '1'],
+ ['ifSpeed', '1'],
+ );
+
+
+############################## 1 #####################################
+# Fire up a session.
+ my $s1 =
+ new SNMP::Session (DestHost=>$agent_host,Version=>1,Community=>$comm,RemotePort=>$agent_port);
+ ok(defined($s1));
+
+############################# 2 #######################################
+# Try getnext on sysDescr.0
+
+my $next = $s1->getnext('sysDescr.0');
+#print ("The next OID is : $next\n");
+ok($s1->{ErrorStr} eq '');
+#print STDERR "Error string1 = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("\n");
+
+########################### 3 ########################################
+#$v1 = $s1->getnext('sysLocation.0');
+#print ("The next OID is : $v1\n");
+my $v2 = $s1->getnext('sysServices.0');
+#print ("The next OID is : $v2\n");
+ok($s1->{ErrorStr} eq '');
+#print STDERR "Error string2 = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("\n");
+
+
+############################ 4 #######################################
+# try it on an unknown OID
+my $v3 = $s1->getnext('Srivathsan.0');
+#print ("The unknown OID is : $v3\n");
+ok($s1->{ErrorStr} =~ /^Unknown/);
+#print STDERR "Error string5 = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("\n");
+############################# 5 #######################################
+# On a non-accessible value
+#my $kkk = $s1->getnext('vacmSecurityName.1');
+#print("kkk is $kkk\n");
+#ok($s1->{ErrorInd} != 0);
+#print STDERR "Error string5 = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("\n");
+
+############################# 6 ####################################
+# We should get back sysDescr.0 here.
+my $var = new SNMP::Varbind(['sysDescr']);
+my $res2 = $s1->getnext($var);
+#print("res2 is : $res2\n");
+ok((not $s1->{ErrorStr} and not $s1->{ErrorInd}));
+ok((defined $var->iid and $var->iid eq 0));
+ok((defined $var->val and $var->val eq $res2));
+
+############################# 7 ######################################
+# get the next one after that as well for a second check
+my $res3 = $s1->getnext($var);
+#print("res3 is : $res3\n");
+ok((defined $var->tag and $var->tag eq 'sysObjectID'));
+ok((defined $var->val and $var->val eq $res3));
+
+
+ snmptest_cleanup();
diff --git a/perl/SNMP/t/mib.t b/perl/SNMP/t/mib.t
new file mode 100644
index 0000000..f4ba91a
--- /dev/null
+++ b/perl/SNMP/t/mib.t
@@ -0,0 +1,226 @@
+#!./perl
+
+# Written by John Stoffel (jfs@fluent.com) - 10/13/1997
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ eval "use Cwd qw(abs_path)";
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs");
+ $ENV{'MIBS'} = 'ALL';
+}
+
+# to print the description...
+$SNMP::save_descriptions = 1;
+
+use Test;
+BEGIN {plan tests => 35}
+use SNMP;
+
+$SNMP::verbose = 0;
+$SNMP::best_guess = 2;
+
+use vars qw($bad_oid);
+require "t/startagent.pl";
+
+############################# 1 ######################################
+#check if
+my $res = $SNMP::MIB{sysDescr}{label};
+#print("Label is:$res\n");
+ok("sysDescr" eq $res);
+#print("\n");
+############################# 2 ######################################
+$res = $SNMP::MIB{sysDescr}{objectID};
+#print("OID is: $res\n");
+ok(defined($res));
+#print("\n");
+############################# 3 ######################################
+$res = $SNMP::MIB{sysDescr}{access};
+#print("access is: $res\n");
+ok($res eq 'ReadOnly');
+#print("\n");
+############################## 4 ###################################
+$res = $SNMP::MIB{sysLocation}{access};
+#$res = $SNMP::MIB{sysORIndex}{access};
+ok($res eq 'ReadWrite');
+############################## 5 ###################################
+$res = $SNMP::MIB{sysLocation}{type};
+ok($res eq 'OCTETSTR');
+############################# 6 ####################################
+$res = $SNMP::MIB{sysLocation}{status};
+#print STDERR ("status is: $res\n");
+ok($res eq 'Current');
+#print STDERR ("\n");
+############################# 7 #################################
+$res = $SNMP::MIB{sysORTable}{access};
+#print("access is: $res\n");
+ok($res eq 'NoAccess');
+#print("\n");
+############################# 8 ###############################
+$res = $SNMP::MIB{sysLocation}{subID};
+#print("subID is: $res\n");
+ok(defined($res));
+#print("\n");
+############################ 9 ##############################
+$res = $SNMP::MIB{sysLocation}{syntax};
+#print("syntax is: $res\n");
+ok($res eq 'DisplayString');
+#print("\n");
+############################ 10 ###########################
+$res = $SNMP::MIB{ipAdEntAddr}{syntax};
+ok($res eq 'IPADDR');
+#print("\n");
+########################## 11 ##########################
+$res = $SNMP::MIB{atNetAddress}{syntax};
+#print ("syntax is: $res\n");
+ok($res eq 'NETADDR');
+#print("\n");
+######################## 12 ###############################
+$res = $SNMP::MIB{ipReasmOKs}{syntax};
+#print("syntax is: $res\n");
+ok($res eq 'COUNTER');
+#print("\n");
+###################### 13 ##############################
+$res = $SNMP::MIB{sysDescr}{moduleID};
+#print("Module ID is: $res\n");
+ok(defined($res));
+#print("\n");
+###################### 14 #########################
+$des = $SNMP::MIB{atNetAddress}{description};
+#print("des is --> $des\n");
+ok(defined($des));
+#print("\n");
+
+###################### 15 #########################
+$res = $SNMP::MIB{atNetAddress}{nextNode};
+#print("res is --> $res\n");
+ok(ref($res) eq "HASH");
+#print("\n");
+
+######################## 16 #########################
+$res = $SNMP::MIB{sysDescr}{children};
+#print("res is --> $res\n");
+ok(ref($res) eq "ARRAY");
+#print("\n");
+#################### 17 #########################
+
+$res = $SNMP::MIB{sysDescr}{badField};
+ok(!defined($res));
+
+
+###################### 18 #########################
+$res = $SNMP::MIB{sysDescr}{hint};
+#print("res is --> $res\n");
+#XXX: test fails due SMIv1 codes being returned intstead of SMIv2...
+#ok(defined($res) && $res =~ /^255a/);
+#print("\n");
+###################### 19 #########################
+
+$res = $SNMP::MIB{ifPhysAddress}{hint};
+#print("res is --> $res\n");
+#XXX: test fails due SMIv1 codes being returned intstead of SMIv2...
+#ok(defined($res) && $res =~ /^1x:/);
+#print("\n");
+
+
+###################### some translate tests #######
+
+##################### 20 #########################
+# Garbage names return Undef.
+
+my $type1 = SNMP::getType($bad_name);
+ok(!defined($type1));
+#printf "%s %d\n", (!defined($type1)) ? "ok" :"not ok", $n++;
+
+######################################################################
+# getType() supports numeric OIDs now
+
+my $type2 = SNMP::getType($oid);
+#XXX: test fails due SMIv1 codes being returned intstead of SMIv2...
+#ok(defined($type2) && $type2 =~ /OCTETSTR/);
+
+######################################################################
+# This tests that sysDescr returns a valid type.
+
+my $type3 = SNMP::getType($name);
+ok(defined($type3));
+
+######################################################################
+# Translation tests from Name -> OID
+# sysDescr to .1.3.6.1.2.1.1.1
+$oid_tag = SNMP::translateObj($name);
+ok($oid eq $oid_tag);
+
+######################################################################
+# Translation tests from Name -> OID
+# RFC1213-MIB::sysDescr to .1.3.6.1.2.1.1.1
+$oid_tag = SNMP::translateObj($name_module);
+ok($oid eq $oid_tag);
+
+######################################################################
+# Translation tests from Name -> OID
+# .iso.org.dod.internet.mgmt.mib-2.system.sysDescr to .1.3.6.1.2.1.1.1
+$oid_tag = SNMP::translateObj($name_long);
+ok($oid eq $oid_tag);
+
+######################################################################
+# bad name returns 'undef'
+$oid_tag = '';
+$oid_tag = SNMP::translateObj($bad_name);
+ok(!defined($oid_tag));
+
+
+######################################################################
+# OID -> name
+# .1.3.6.1.2.1.1.1 to sysDescr
+$name_tag = SNMP::translateObj($oid);
+ok($name eq $name_tag);
+
+######################################################################
+# OID -> name
+# .1.3.6.1.2.1.1.1 to RFC1213-MIB::sysDescr or
+# .1.3.6.1.2.1.1.1 to SNMPv2-MIB::sysDescr
+$name_tag = SNMP::translateObj($oid,0,1);
+$name_module2 = $name_module2; # To eliminate 'only use once' variable warning
+ok(($name_module eq $name_tag) || ($name_module2 eq $name_tag));
+
+######################################################################
+# OID -> name
+# .1.3.6.1.2.1.1.1 to .iso.org.dod.internet.mgmt.mib-2.system.sysDescr
+$name_tag = SNMP::translateObj($oid,1);
+ok($name_long eq $name_tag);
+
+######################################################################
+# OID -> name
+# .1.3.6.1.2.1.1.1 to RFC1213-MIB::.iso.org.dod.internet.mgmt.mib-2.system.sysDescr or
+# .1.3.6.1.2.1.1.1 to SNMPv2-MIB::.iso.org.dod.internet.mgmt.mib-2.system.sysDescr
+$name_module_long = $name_module_long; # To eliminate 'only use once' variable warning
+$name_module_long2 = $name_module_long2; # To eliminate 'only use once' variable warning
+$name_tag = SNMP::translateObj($oid,1,1);
+ok(($name_module_long eq $name_tag) || ($name_module_long2 eq $name_tag));
+
+######################################################################
+# bad OID -> Name
+
+$name_tag = SNMP::translateObj($bad_oid);
+ok($name ne $name_tag);
+#printf "%s %d\n", ($name ne $name_tag) ? "ok" :"not ok", $n++;
+
+
+######################################################################
+# ranges
+
+$node = $SNMP::MIB{snmpTargetAddrMMS};
+ok($node);
+$ranges = $node->{ranges};
+ok($ranges and ref $ranges eq 'ARRAY');
+ok(@$ranges == 2);
+ok($$ranges[0]{low} == 0);
+ok($$ranges[0]{high} == 0);
+ok($$ranges[1]{low} == 484);
+ok($$ranges[1]{high} == 2147483647);
+
+snmptest_cleanup();
diff --git a/perl/SNMP/t/mib.txt b/perl/SNMP/t/mib.txt
new file mode 100644
index 0000000..347a2af
--- /dev/null
+++ b/perl/SNMP/t/mib.txt
@@ -0,0 +1,4208 @@
+RFC1155-SMI DEFINITIONS ::= BEGIN
+ nullOID OBJECT IDENTIFIER ::= { ccitt 0 }
+ internet OBJECT IDENTIFIER ::= { iso org(3) dod(6) 1 }
+ directory OBJECT IDENTIFIER ::= { internet 1 }
+ mgmt OBJECT IDENTIFIER ::= { internet 2 }
+ experimental OBJECT IDENTIFIER ::= { internet 3 }
+ private OBJECT IDENTIFIER ::= { internet 4 }
+ enterprises OBJECT IDENTIFIER ::= { private 1 }
+END
+
+-- @(#)WSCCS o/mibs-rfc1213.mib 1.1 8/30/95
+-- Changes to rfc1213 (MIB-II):
+-- No changes needed.
+
+
+ RFC1213-MIB DEFINITIONS ::= BEGIN
+
+ IMPORTS
+ mgmt, NetworkAddress, IpAddress, Counter, Gauge,
+ TimeTicks
+ FROM RFC1155-SMI
+ OBJECT-TYPE
+ FROM RFC-1212;
+
+ -- This MIB module uses the extended OBJECT-TYPE macro as
+ -- defined in [14];
+
+
+ -- MIB-II (same prefix as MIB-I)
+
+ mib-2 OBJECT IDENTIFIER ::= { mgmt 1 }
+
+ -- textual conventions
+
+ DisplayString ::=
+ OCTET STRING
+ -- This data type is used to model textual information taken
+ -- from the NVT ASCII character set. By convention, objects
+ -- with this syntax are declared as having
+ --
+ -- SIZE (0..255)
+
+ PhysAddress ::=
+ OCTET STRING
+ -- This data type is used to model media addresses. For many
+ -- types of media, this will be in a binary representation.
+ -- For example, an ethernet address would be represented as
+ -- a string of 6 octets.
+
+
+ -- groups in MIB-II
+
+ system OBJECT IDENTIFIER ::= { mib-2 1 }
+
+ interfaces OBJECT IDENTIFIER ::= { mib-2 2 }
+
+ at OBJECT IDENTIFIER ::= { mib-2 3 }
+
+ ip OBJECT IDENTIFIER ::= { mib-2 4 }
+
+ icmp OBJECT IDENTIFIER ::= { mib-2 5 }
+
+ tcp OBJECT IDENTIFIER ::= { mib-2 6 }
+
+ udp OBJECT IDENTIFIER ::= { mib-2 7 }
+
+ egp OBJECT IDENTIFIER ::= { mib-2 8 }
+
+ -- historical (some say hysterical)
+ -- cmot OBJECT IDENTIFIER ::= { mib-2 9 }
+
+ transmission OBJECT IDENTIFIER ::= { mib-2 10 }
+
+ snmp OBJECT IDENTIFIER ::= { mib-2 11 }
+
+
+ -- the System group
+
+ -- Implementation of the System group is mandatory for all
+ -- systems. If an agent is not configured to have a value
+ -- for any of these variables, a string of length 0 is
+ -- returned.
+
+ sysDescr OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A textual description of the entity. This value
+ should include the full name and version
+ identification of the system's hardware type,
+ software operating-system, and networking
+ software. It is mandatory that this only contain
+ printable ASCII characters."
+ ::= { system 1 }
+
+ sysObjectID OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The vendor's authoritative identification of the
+ network management subsystem contained in the
+ entity. This value is allocated within the SMI
+ enterprises subtree (1.3.6.1.4.1) and provides an
+ easy and unambiguous means for determining `what
+ kind of box' is being managed. For example, if
+ vendor `Flintstones, Inc.' was assigned the
+ subtree 1.3.6.1.4.1.4242, it could assign the
+ identifier 1.3.6.1.4.1.4242.1.1 to its `Fred
+ Router'."
+ ::= { system 2 }
+
+ sysUpTime OBJECT-TYPE
+ SYNTAX TimeTicks
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The time (in hundredths of a second) since the
+ network management portion of the system was last
+ re-initialized."
+ ::= { system 3 }
+
+ sysContact OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The textual identification of the contact person
+ for this managed node, together with information
+ on how to contact this person."
+ ::= { system 4 }
+
+ sysName OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "An administratively-assigned name for this
+ managed node. By convention, this is the node's
+ fully-qualified domain name."
+ ::= { system 5 }
+
+ sysLocation OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The physical location of this node (e.g.,
+ `telephone closet, 3rd floor')."
+ ::= { system 6 }
+
+ sysServices OBJECT-TYPE
+ SYNTAX INTEGER (0..127)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A value which indicates the set of services that
+ this entity primarily offers.
+
+ The value is a sum. This sum initially takes the
+ value zero, Then, for each layer, L, in the range
+ 1 through 7, that this node performs transactions
+ for, 2 raised to (L - 1) is added to the sum. For
+ example, a node which performs primarily routing
+ functions would have a value of 4 (2^(3-1)). In
+ contrast, a node which is a host offering
+ application services would have a value of 72
+ (2^(4-1) + 2^(7-1)). Note that in the context of
+ the Internet suite of protocols, values should be
+ calculated accordingly:
+
+ layer functionality
+ 1 physical (e.g., repeaters)
+ 2 datalink/subnetwork (e.g., bridges)
+ 3 internet (e.g., IP gateways)
+ 4 end-to-end (e.g., IP hosts)
+ 7 applications (e.g., mail relays)
+
+ For systems including OSI protocols, layers 5 and
+ 6 may also be counted."
+ ::= { system 7 }
+
+
+ -- the Interfaces group
+
+ -- Implementation of the Interfaces group is mandatory for
+ -- all systems.
+
+ ifNumber OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of network interfaces (regardless of
+ their current state) present on this system."
+ ::= { interfaces 1 }
+
+
+ -- the Interfaces table
+
+ -- The Interfaces table contains information on the entity's
+ -- interfaces. Each interface is thought of as being
+ -- attached to a `subnetwork'. Note that this term should
+ -- not be confused with `subnet' which refers to an
+ -- addressing partitioning scheme used in the Internet suite
+ -- of protocols.
+
+ ifTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF IfEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "A list of interface entries. The number of
+ entries is given by the value of ifNumber."
+ ::= { interfaces 2 }
+
+ ifEntry OBJECT-TYPE
+ SYNTAX IfEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "An interface entry containing objects at the
+ subnetwork layer and below for a particular
+ interface."
+ INDEX { ifIndex }
+ ::= { ifTable 1 }
+
+ IfEntry ::=
+ SEQUENCE {
+ ifIndex
+ INTEGER,
+ ifDescr
+ DisplayString,
+ ifType
+ INTEGER,
+ ifMtu
+ INTEGER,
+ ifSpeed
+ Gauge,
+ ifPhysAddress
+ PhysAddress,
+ ifAdminStatus
+ INTEGER,
+ ifOperStatus
+ INTEGER,
+ ifLastChange
+ TimeTicks,
+ ifInOctets
+ Counter,
+ ifInUcastPkts
+ Counter,
+ ifInNUcastPkts
+ Counter,
+ ifInDiscards
+ Counter,
+ ifInErrors
+ Counter,
+ ifInUnknownProtos
+ Counter,
+ ifOutOctets
+ Counter,
+ ifOutUcastPkts
+ Counter,
+ ifOutNUcastPkts
+ Counter,
+ ifOutDiscards
+ Counter,
+ ifOutErrors
+ Counter,
+ ifOutQLen
+ Gauge,
+ ifSpecific
+ OBJECT IDENTIFIER
+ }
+
+ ifIndex OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A unique value for each interface. Its value
+ ranges between 1 and the value of ifNumber. The
+ value for each interface must remain constant at
+ least from one re-initialization of the entity's
+ network management system to the next re-
+ initialization."
+ ::= { ifEntry 1 }
+
+ ifDescr OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ 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 hardware interface."
+ ::= { ifEntry 2 }
+
+ ifType OBJECT-TYPE
+ SYNTAX INTEGER {
+ other(1), -- none of the following
+ regular1822(2),
+ hdh1822(3),
+ ddn-x25(4),
+ rfc877-x25(5),
+ ethernet-csmacd(6),
+ iso88023-csmacd(7),
+ iso88024-tokenBus(8),
+ iso88025-tokenRing(9),
+ iso88026-man(10),
+ starLan(11),
+ proteon-10Mbit(12),
+ proteon-80Mbit(13),
+ hyperchannel(14),
+ fddi(15),
+ lapb(16),
+ sdlc(17),
+ ds1(18), -- T-1
+ e1(19), -- european equiv. of T-1
+ basicISDN(20),
+ primaryISDN(21), -- proprietary serial
+ propPointToPointSerial(22),
+ ppp(23),
+ softwareLoopback(24),
+ eon(25), -- CLNP over IP [11]
+ ethernet-3Mbit(26),
+ nsip(27), -- XNS over IP
+ slip(28), -- generic SLIP
+ ultra(29), -- ULTRA technologies
+ ds3(30), -- T-3
+ sip(31), -- SMDS
+ frame-relay(32)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The type of interface, distinguished according to
+ the physical/link protocol(s) immediately `below'
+ the network layer in the protocol stack."
+ ::= { ifEntry 3 }
+
+ ifMtu OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The size of the largest datagram 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."
+ ::= { ifEntry 4 }
+
+ ifSpeed OBJECT-TYPE
+ SYNTAX Gauge
+ ACCESS read-only
+ STATUS mandatory
+ 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."
+ ::= { ifEntry 5 }
+
+ ifPhysAddress OBJECT-TYPE
+ SYNTAX PhysAddress
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The interface's address at the protocol layer
+ immediately `below' the network layer in the
+ protocol stack. For interfaces which do not have
+ such an address (e.g., a serial line), this object
+ should contain an octet string of zero length."
+ ::= { ifEntry 6 }
+
+ ifAdminStatus OBJECT-TYPE
+ SYNTAX INTEGER {
+ up(1), -- ready to pass packets
+ down(2),
+ testing(3) -- in some test mode
+ }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The desired state of the interface. The
+ testing(3) state indicates that no operational
+ packets can be passed."
+ ::= { ifEntry 7 }
+
+ ifOperStatus OBJECT-TYPE
+ SYNTAX INTEGER {
+ up(1), -- ready to pass packets
+ down(2),
+ testing(3) -- in some test mode
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The current operational state of the interface.
+ The testing(3) state indicates that no operational
+ packets can be passed."
+ ::= { ifEntry 8 }
+
+ ifLastChange OBJECT-TYPE
+ SYNTAX TimeTicks
+ ACCESS read-only
+ STATUS mandatory
+ 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."
+ ::= { ifEntry 9 }
+
+ ifInOctets OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of octets received on the
+ interface, including framing characters."
+ ::= { ifEntry 10 }
+
+ ifInUcastPkts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of subnetwork-unicast packets
+ delivered to a higher-layer protocol."
+ ::= { ifEntry 11 }
+
+ ifInNUcastPkts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of non-unicast (i.e., subnetwork-
+ broadcast or subnetwork-multicast) packets
+ delivered to a higher-layer protocol."
+ ::= { ifEntry 12 }
+
+ ifInDiscards OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ 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."
+ ::= { ifEntry 13 }
+
+ ifInErrors OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of inbound packets that contained
+ errors preventing them from being deliverable to a
+ higher-layer protocol."
+ ::= { ifEntry 14 }
+ ifInUnknownProtos OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of packets received via the interface
+ which were discarded because of an unknown or
+ unsupported protocol."
+ ::= { ifEntry 15 }
+
+ ifOutOctets OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of octets transmitted out of the
+ interface, including framing characters."
+ ::= { ifEntry 16 }
+
+ ifOutUcastPkts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of packets that higher-level
+ protocols requested be transmitted to a
+ subnetwork-unicast address, including those that
+ were discarded or not sent."
+ ::= { ifEntry 17 }
+
+ ifOutNUcastPkts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of packets that higher-level
+ protocols requested be transmitted to a non-
+ unicast (i.e., a subnetwork-broadcast or
+ subnetwork-multicast) address, including those
+ that were discarded or not sent."
+ ::= { ifEntry 18 }
+
+ ifOutDiscards OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ 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."
+ ::= { ifEntry 19 }
+
+ ifOutErrors OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of outbound packets that could not be
+ transmitted because of errors."
+ ::= { ifEntry 20 }
+
+ ifOutQLen OBJECT-TYPE
+ SYNTAX Gauge
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The length of the output packet queue (in
+ packets)."
+ ::= { ifEntry 21 }
+
+ ifSpecific OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A reference to MIB definitions specific to the
+ particular media being used to realize the
+ interface. For example, if the interface is
+ realized by an ethernet, then the value of this
+ object refers to a document defining objects
+ specific to ethernet. If this information is not
+ present, its value should be set to the OBJECT
+ IDENTIFIER { 0 0 }, which is a syntatically valid
+ object identifier, and any conformant
+ implementation of ASN.1 and BER must be able to
+ generate and recognize this value."
+ ::= { ifEntry 22 }
+
+
+ -- the Address Translation group
+
+ -- Implementation of the Address Translation group is
+ -- mandatory for all systems. Note however that this group
+ -- is deprecated by MIB-II. That is, it is being included
+ -- solely for compatibility with MIB-I nodes, and will most
+ -- likely be excluded from MIB-III nodes. From MIB-II and
+ -- onwards, each network protocol group contains its own
+ -- address translation tables.
+
+ -- The Address Translation group contains one table which is
+ -- the union across all interfaces of the translation tables
+ -- for converting a NetworkAddress (e.g., an IP address) into
+ -- a subnetwork-specific address. For lack of a better term,
+ -- this document refers to such a subnetwork-specific address
+ -- as a `physical' address.
+
+ -- Examples of such translation tables are: for broadcast
+ -- media where ARP is in use, the translation table is
+ -- equivalent to the ARP cache; or, on an X.25 network where
+ -- non-algorithmic translation to X.121 addresses is
+ -- required, the translation table contains the
+ -- NetworkAddress to X.121 address equivalences.
+
+ atTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF AtEntry
+ ACCESS not-accessible
+ STATUS deprecated
+ DESCRIPTION
+ "The Address Translation tables contain the
+ NetworkAddress to `physical' address equivalences.
+ Some interfaces do not use translation tables for
+ determining address equivalences (e.g., DDN-X.25
+ has an algorithmic method); if all interfaces are
+ of this type, then the Address Translation table
+ is empty, i.e., has zero entries."
+ ::= { at 1 }
+
+ atEntry OBJECT-TYPE
+ SYNTAX AtEntry
+ ACCESS not-accessible
+ STATUS deprecated
+ DESCRIPTION
+ "Each entry contains one NetworkAddress to
+ `physical' address equivalence."
+ INDEX { atIfIndex,
+ atNetAddress }
+ ::= { atTable 1 }
+
+ AtEntry ::=
+ SEQUENCE {
+ atIfIndex
+ INTEGER,
+ atPhysAddress
+ PhysAddress,
+ atNetAddress
+ NetworkAddress
+ }
+
+ atIfIndex OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS deprecated
+ DESCRIPTION
+ "The interface on which this entry's equivalence
+ is effective. The interface identified by a
+ particular value of this index is the same
+ interface as identified by the same value of
+ ifIndex."
+ ::= { atEntry 1 }
+
+ atPhysAddress OBJECT-TYPE
+ SYNTAX PhysAddress
+ ACCESS read-write
+ STATUS deprecated
+ DESCRIPTION
+ "The media-dependent `physical' address.
+
+ Setting this object to a null string (one of zero
+ length) has the effect of invaliding the
+ corresponding entry in the atTable object. That
+ is, it effectively dissasociates 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 atPhysAddress object."
+ ::= { atEntry 2 }
+
+ atNetAddress OBJECT-TYPE
+ SYNTAX NetworkAddress
+ ACCESS read-write
+ STATUS deprecated
+ DESCRIPTION
+ "The NetworkAddress (e.g., the IP address)
+ corresponding to the media-dependent `physical'
+ address."
+ ::= { atEntry 3 }
+
+
+ -- the IP group
+
+ -- Implementation of the IP group is mandatory for all
+ -- systems.
+
+ ipForwarding OBJECT-TYPE
+ SYNTAX INTEGER {
+ forwarding(1), -- acting as a gateway
+ not-forwarding(2) -- NOT acting as a gateway
+ }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The indication of whether this entity is acting
+ as an IP gateway in respect to the forwarding of
+ datagrams received by, but not addressed to, this
+ entity. IP gateways forward datagrams. IP hosts
+ do not (except those source-routed via the host).
+
+ Note that for some managed nodes, this object may
+ take on only a subset of the values possible.
+ Accordingly, it is appropriate for an agent to
+ return a `badValue' response if a management
+ station attempts to change this object to an
+ inappropriate value."
+ ::= { ip 1 }
+
+ ipDefaultTTL OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The default value inserted into the Time-To-Live
+ field of the IP header of datagrams originated at
+ this entity, whenever a TTL value is not supplied
+ by the transport layer protocol."
+ ::= { ip 2 }
+
+ ipInReceives OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of input datagrams received from
+ interfaces, including those received in error."
+ ::= { ip 3 }
+
+ ipInHdrErrors OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of input datagrams discarded due to
+ errors in their IP headers, including bad
+ checksums, version number mismatch, other format
+ errors, time-to-live exceeded, errors discovered
+ in processing their IP options, etc."
+ ::= { ip 4 }
+
+ ipInAddrErrors OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of input 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.0.0.0) and addresses of
+ unsupported Classes (e.g., Class E). For entities
+ which are not IP Gateways and therefore do not
+ forward datagrams, this counter includes datagrams
+ discarded because the destination address was not
+ a local address."
+ ::= { ip 5 }
+
+ ipForwDatagrams OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of input datagrams for which this
+ entity was not their final IP destination, as a
+ result of which an attempt was made to find a
+ route to forward them to that final destination.
+ In entities which do not act as IP Gateways, this
+ counter will include only those packets which were
+ Source-Routed via this entity, and the Source-
+ Route option processing was successful."
+ ::= { ip 6 }
+
+ ipInUnknownProtos OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of locally-addressed datagrams
+ received successfully but discarded because of an
+ unknown or unsupported protocol."
+ ::= { ip 7 }
+
+ ipInDiscards OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ 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."
+ ::= { ip 8 }
+
+ ipInDelivers OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of input datagrams successfully
+ delivered to IP user-protocols (including ICMP)."
+ ::= { ip 9 }
+
+ ipOutRequests OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ 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
+ ipForwDatagrams."
+ ::= { ip 10 }
+
+ ipOutDiscards OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ 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 ipForwDatagrams if any such packets met this
+ (discretionary) discard criterion."
+ ::= { ip 11 }
+
+ ipOutNoRoutes OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of IP datagrams discarded because no
+ route could be found to transmit them to their
+ destination. Note that this counter includes any
+ packets counted in ipForwDatagrams which meet this
+ `no-route' criterion. Note that this includes any
+ datagarms which a host cannot route because all of
+ its default gateways are down."
+ ::= { ip 12 }
+
+ ipReasmTimeout OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The maximum number of seconds which received
+ fragments are held while they are awaiting
+ reassembly at this entity."
+ ::= { ip 13 }
+
+ ipReasmReqds OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of IP fragments received which needed
+ to be reassembled at this entity."
+ ::= { ip 14 }
+
+ ipReasmOKs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of IP datagrams successfully re-
+ assembled."
+ ::= { ip 15 }
+
+ ipReasmFails OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ 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."
+ ::= { ip 16 }
+
+ ipFragOKs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of IP datagrams that have been
+ successfully fragmented at this entity."
+ ::= { ip 17 }
+
+ ipFragFails OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of IP datagrams that have been
+ discarded because they needed to be fragmented at
+ this entity but could not be, e.g., because their
+ Don't Fragment flag was set."
+ ::= { ip 18 }
+
+ ipFragCreates OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of IP datagram fragments that have
+ been generated as a result of fragmentation at
+ this entity."
+ ::= { ip 19 }
+
+ -- the IP address table
+
+ -- The IP address table contains this entity's IP addressing
+ -- information.
+
+ ipAddrTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF IpAddrEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "The table of addressing information relevant to
+ this entity's IP addresses."
+ ::= { ip 20 }
+
+ ipAddrEntry OBJECT-TYPE
+ SYNTAX IpAddrEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "The addressing information for one of this
+ entity's IP addresses."
+ INDEX { ipAdEntAddr }
+ ::= { ipAddrTable 1 }
+
+ IpAddrEntry ::=
+ SEQUENCE {
+ ipAdEntAddr
+ IpAddress,
+ ipAdEntIfIndex
+ INTEGER,
+ ipAdEntNetMask
+ IpAddress,
+ ipAdEntBcastAddr
+ INTEGER,
+ ipAdEntReasmMaxSize
+ INTEGER (0..65535)
+ }
+
+ ipAdEntAddr OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The IP address to which this entry's addressing
+ information pertains."
+ ::= { ipAddrEntry 1 }
+
+ ipAdEntIfIndex OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ 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 ifIndex."
+ ::= { ipAddrEntry 2 }
+
+ ipAdEntNetMask OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The subnet mask associated with the IP address of
+ this entry. The value of the mask is an IP
+ address with all the network bits set to 1 and all
+ the hosts bits set to 0."
+ ::= { ipAddrEntry 3 }
+
+ ipAdEntBcastAddr OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The value of the least-significant bit in the IP
+ broadcast address used for sending datagrams on
+ the (logical) interface associated with the IP
+ address of this entry. For example, when the
+ Internet standard all-ones broadcast address is
+ used, the value will be 1. This value applies to
+ both the subnet and network broadcasts addresses
+ used by the entity on this (logical) interface."
+ ::= { ipAddrEntry 4 }
+
+ ipAdEntReasmMaxSize OBJECT-TYPE
+ SYNTAX INTEGER (0..65535)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The size of the largest IP datagram which this
+ entity can re-assemble from incoming IP fragmented
+ datagrams received on this interface."
+ ::= { ipAddrEntry 5 }
+
+ -- the IP routing table
+
+ -- The IP routing table contains an entry for each route
+ -- presently known to this entity.
+
+ ipRouteTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF IpRouteEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "This entity's IP Routing table."
+ ::= { ip 21 }
+
+ ipRouteEntry OBJECT-TYPE
+ SYNTAX IpRouteEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "A route to a particular destination."
+ INDEX { ipRouteDest }
+ ::= { ipRouteTable 1 }
+
+ IpRouteEntry ::=
+ SEQUENCE {
+ ipRouteDest
+ IpAddress,
+ ipRouteIfIndex
+ INTEGER,
+ ipRouteMetric1
+ INTEGER,
+ ipRouteMetric2
+ INTEGER,
+ ipRouteMetric3
+ INTEGER,
+ ipRouteMetric4
+ INTEGER,
+ ipRouteNextHop
+ IpAddress,
+ ipRouteType
+ INTEGER,
+ ipRouteProto
+ INTEGER,
+ ipRouteAge
+ INTEGER,
+ ipRouteMask
+ IpAddress,
+ ipRouteMetric5
+ INTEGER,
+ ipRouteInfo
+ OBJECT IDENTIFIER
+ }
+
+ ipRouteDest OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The destination IP address of this route. An
+ entry with a value of 0.0.0.0 is considered a
+ default route. Multiple routes to a single
+ destination can appear in the table, but access to
+ such multiple entries is dependent on the table-
+ access mechanisms defined by the network
+ management protocol in use."
+ ::= { ipRouteEntry 1 }
+
+ ipRouteIfIndex OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The index value which uniquely identifies the
+ local interface through which the next hop of this
+ route should be reached. The interface identified
+ by a particular value of this index is the same
+ interface as identified by the same value of
+ ifIndex."
+ ::= { ipRouteEntry 2 }
+
+ ipRouteMetric1 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The primary routing metric for this route. The
+ semantics of this metric are determined by the
+ routing-protocol specified in the route's
+ ipRouteProto value. If this metric is not used,
+ its value should be set to -1."
+ ::= { ipRouteEntry 3 }
+
+ ipRouteMetric2 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "An alternate routing metric for this route. The
+ semantics of this metric are determined by the
+ routing-protocol specified in the route's
+ ipRouteProto value. If this metric is not used,
+ its value should be set to -1."
+ ::= { ipRouteEntry 4 }
+
+ ipRouteMetric3 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "An alternate routing metric for this route. The
+ semantics of this metric are determined by the
+ routing-protocol specified in the route's
+ ipRouteProto value. If this metric is not used,
+ its value should be set to -1."
+ ::= { ipRouteEntry 5 }
+
+ ipRouteMetric4 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "An alternate routing metric for this route. The
+ semantics of this metric are determined by the
+ routing-protocol specified in the route's
+ ipRouteProto value. If this metric is not used,
+ its value should be set to -1."
+ ::= { ipRouteEntry 6 }
+
+ ipRouteNextHop OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The IP address of the next hop of this route.
+ (In the case of a route bound to an interface
+ which is realized via a broadcast media, the value
+ of this field is the agent's IP address on that
+ interface.)"
+ ::= { ipRouteEntry 7 }
+
+ ipRouteType OBJECT-TYPE
+ SYNTAX INTEGER {
+ other(1), -- none of the following
+
+ invalid(2), -- an invalidated route
+ -- route to directly
+
+ direct(3), -- connected (sub-)network
+
+ -- route to a non-local
+ indirect(4) -- host/network/sub-network
+ }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The type of route. Note that the values
+ direct(3) and indirect(4) refer to the notion of
+ direct and indirect routing in the IP
+ architecture.
+
+ Setting this object to the value invalid(2) has
+ the effect of invalidating the corresponding entry
+ in the ipRouteTable object. That is, it
+ effectively dissasociates the destination
+ identified with said entry from the route
+ 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 ipRouteType object."
+ ::= { ipRouteEntry 8 }
+
+ ipRouteProto OBJECT-TYPE
+ SYNTAX INTEGER {
+ other(1), -- none of the following
+
+ -- non-protocol information,
+ -- e.g., manually configured
+ local(2), -- entries
+
+ -- set via a network
+ netmgmt(3), -- management protocol
+
+ -- obtained via ICMP,
+ icmp(4), -- e.g., Redirect
+
+ -- the remaining values are
+ -- all gateway routing
+ -- protocols
+ egp(5),
+ ggp(6),
+ hello(7),
+ rip(8),
+ is-is(9),
+ es-is(10),
+ ciscoIgrp(11),
+ bbnSpfIgp(12),
+ ospf(13),
+ bgp(14)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ 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."
+ ::= { ipRouteEntry 9 }
+
+ ipRouteAge OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ 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."
+ ::= { ipRouteEntry 10 }
+
+ ipRouteMask OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "Indicate the mask to be logical-ANDed with the
+ destination address before being compared to the
+ value in the ipRouteDest field. For those systems
+ that do not support arbitrary subnet masks, an
+ agent constructs the value of the ipRouteMask by
+ determining whether the value of the correspondent
+ ipRouteDest field belong to a class-A, B, or C
+ network, and then using one of:
+
+ mask network
+ 255.0.0.0 class-A
+ 255.255.0.0 class-B
+ 255.255.255.0 class-C
+
+ If the value of the ipRouteDest is 0.0.0.0 (a
+ default route), then the mask value is also
+ 0.0.0.0. It should be noted that all IP routing
+ subsystems implicitly use this mechanism."
+ ::= { ipRouteEntry 11 }
+
+ ipRouteMetric5 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "An alternate routing metric for this route. The
+ semantics of this metric are determined by the
+ routing-protocol specified in the route's
+ ipRouteProto value. If this metric is not used,
+ its value should be set to -1."
+ ::= { ipRouteEntry 12 }
+
+ ipRouteInfo OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ ACCESS read-only
+ STATUS mandatory
+ 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 ipRouteProto value. If
+ this information is not present, its value should
+ be set to the OBJECT IDENTIFIER { 0 0 }, which is
+ a syntatically valid object identifier, and any
+ conformant implementation of ASN.1 and BER must be
+ able to generate and recognize this value."
+ ::= { ipRouteEntry 13 }
+
+
+ -- the IP Address Translation table
+
+ -- The IP address translation table contain the IpAddress to
+ -- `physical' address equivalences. Some interfaces do not
+ -- use translation tables for determining address
+ -- equivalences (e.g., DDN-X.25 has an algorithmic method);
+ -- if all interfaces are of this type, then the Address
+ -- Translation table is empty, i.e., has zero entries.
+
+ ipNetToMediaTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF IpNetToMediaEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "The IP Address Translation table used for mapping
+ from IP addresses to physical addresses."
+ ::= { ip 22 }
+
+ ipNetToMediaEntry OBJECT-TYPE
+ SYNTAX IpNetToMediaEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Each entry contains one IpAddress to `physical'
+ address equivalence."
+ INDEX { ipNetToMediaIfIndex,
+ ipNetToMediaNetAddress }
+ ::= { ipNetToMediaTable 1 }
+
+ IpNetToMediaEntry ::=
+ SEQUENCE {
+ ipNetToMediaIfIndex
+ INTEGER,
+ ipNetToMediaPhysAddress
+ PhysAddress,
+ ipNetToMediaNetAddress
+ IpAddress,
+ ipNetToMediaType
+ INTEGER
+ }
+
+ ipNetToMediaIfIndex OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The interface on which this entry's equivalence
+ is effective. The interface identified by a
+ particular value of this index is the same
+ interface as identified by the same value of
+ ifIndex."
+ ::= { ipNetToMediaEntry 1 }
+
+ ipNetToMediaPhysAddress OBJECT-TYPE
+ SYNTAX PhysAddress
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The media-dependent `physical' address."
+ ::= { ipNetToMediaEntry 2 }
+
+ ipNetToMediaNetAddress OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The IpAddress corresponding to the media-
+ dependent `physical' address."
+ ::= { ipNetToMediaEntry 3 }
+
+ ipNetToMediaType OBJECT-TYPE
+ SYNTAX INTEGER {
+ other(1), -- none of the following
+ invalid(2), -- an invalidated mapping
+ dynamic(3),
+ static(4)
+ }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The type of mapping.
+
+ Setting this object to the value invalid(2) has
+ the effect of invalidating the corresponding entry
+ in the ipNetToMediaTable. That is, it effectively
+ dissasociates 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
+ ipNetToMediaType object."
+ ::= { ipNetToMediaEntry 4 }
+
+
+ -- additional IP objects
+
+ ipRoutingDiscards OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of routing entries which were chosen
+ to be discarded even though they are valid. One
+ possible reason for discarding such an entry could
+ be to free-up buffer space for other routing
+ entries."
+ ::= { ip 23 }
+
+
+ -- the ICMP group
+
+ -- Implementation of the ICMP group is mandatory for all
+ -- systems.
+
+ icmpInMsgs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of ICMP messages which the
+ entity received. Note that this counter includes
+ all those counted by icmpInErrors."
+ ::= { icmp 1 }
+
+ icmpInErrors OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP messages which the entity
+ received but determined as having ICMP-specific
+ errors (bad ICMP checksums, bad length, etc.)."
+ ::= { icmp 2 }
+
+ icmpInDestUnreachs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Destination Unreachable
+ messages received."
+ ::= { icmp 3 }
+
+ icmpInTimeExcds OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Time Exceeded messages
+ received."
+ ::= { icmp 4 }
+
+ icmpInParmProbs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Parameter Problem messages
+ received."
+ ::= { icmp 5 }
+
+ icmpInSrcQuenchs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Source Quench messages
+ received."
+ ::= { icmp 6 }
+
+ icmpInRedirects OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Redirect messages received."
+ ::= { icmp 7 }
+
+ icmpInEchos OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Echo (request) messages
+ received."
+ ::= { icmp 8 }
+
+ icmpInEchoReps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Echo Reply messages received."
+ ::= { icmp 9 }
+
+ icmpInTimestamps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Timestamp (request) messages
+ received."
+ ::= { icmp 10 }
+
+ icmpInTimestampReps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Timestamp Reply messages
+ received."
+ ::= { icmp 11 }
+
+ icmpInAddrMasks OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Address Mask Request messages
+ received."
+ ::= { icmp 12 }
+
+ icmpInAddrMaskReps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Address Mask Reply messages
+ received."
+ ::= { icmp 13 }
+
+ icmpOutMsgs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of ICMP messages which this
+ entity attempted to send. Note that this counter
+ includes all those counted by icmpOutErrors."
+ ::= { icmp 14 }
+
+ icmpOutErrors OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP messages which this entity did
+ not send due to problems discovered within ICMP
+ such as a lack of buffers. This value should not
+ include errors discovered outside the ICMP layer
+ such as the inability of IP to route the resultant
+ datagram. In some implementations there may be no
+ types of error which contribute to this counter's
+ value."
+ ::= { icmp 15 }
+
+ icmpOutDestUnreachs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Destination Unreachable
+ messages sent."
+ ::= { icmp 16 }
+
+ icmpOutTimeExcds OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Time Exceeded messages sent."
+ ::= { icmp 17 }
+
+ icmpOutParmProbs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Parameter Problem messages
+ sent."
+ ::= { icmp 18 }
+
+ icmpOutSrcQuenchs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Source Quench messages sent."
+ ::= { icmp 19 }
+
+ icmpOutRedirects OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Redirect messages sent. For a
+ host, this object will always be zero, since hosts
+ do not send redirects."
+ ::= { icmp 20 }
+
+ icmpOutEchos OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Echo (request) messages sent."
+ ::= { icmp 21 }
+
+ icmpOutEchoReps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Echo Reply messages sent."
+ ::= { icmp 22 }
+
+ icmpOutTimestamps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Timestamp (request) messages
+ sent."
+ ::= { icmp 23 }
+
+ icmpOutTimestampReps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Timestamp Reply messages
+ sent."
+ ::= { icmp 24 }
+
+ icmpOutAddrMasks OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Address Mask Request messages
+ sent."
+ ::= { icmp 25 }
+
+ icmpOutAddrMaskReps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of ICMP Address Mask Reply messages
+ sent."
+ ::= { icmp 26 }
+
+
+ -- the TCP group
+
+ -- Implementation of the TCP group is mandatory for all
+ -- systems that implement the TCP.
+
+ -- Note that instances of object types that represent
+ -- information about a particular TCP connection are
+ -- transient; they persist only as long as the connection
+ -- in question.
+
+ tcpRtoAlgorithm OBJECT-TYPE
+ SYNTAX INTEGER {
+ other(1), -- none of the following
+
+ constant(2), -- a constant rto
+ rsre(3), -- MIL-STD-1778, Appendix B
+ vanj(4) -- Van Jacobson's algorithm [10]
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The algorithm used to determine the timeout value
+ used for retransmitting unacknowledged octets."
+ ::= { tcp 1 }
+
+ tcpRtoMin OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The minimum value permitted by a TCP
+ implementation for the retransmission timeout,
+ measured in milliseconds. More refined semantics
+ for objects of this type depend upon the algorithm
+ used to determine the retransmission timeout. In
+ particular, when the timeout algorithm is rsre(3),
+ an object of this type has the semantics of the
+ LBOUND quantity described in RFC 793."
+ ::= { tcp 2 }
+
+
+ tcpRtoMax OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The maximum value permitted by a TCP
+ implementation for the retransmission timeout,
+ measured in milliseconds. More refined semantics
+ for objects of this type depend upon the algorithm
+ used to determine the retransmission timeout. In
+ particular, when the timeout algorithm is rsre(3),
+ an object of this type has the semantics of the
+ UBOUND quantity described in RFC 793."
+ ::= { tcp 3 }
+
+ tcpMaxConn OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The limit on the total number of TCP connections
+ the entity can support. In entities where the
+ maximum number of connections is dynamic, this
+ object should contain the value -1."
+ ::= { tcp 4 }
+
+ tcpActiveOpens OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of times TCP connections have made a
+ direct transition to the SYN-SENT state from the
+ CLOSED state."
+ ::= { tcp 5 }
+
+ tcpPassiveOpens OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of times TCP connections have made a
+ direct transition to the SYN-RCVD state from the
+ LISTEN state."
+ ::= { tcp 6 }
+
+ tcpAttemptFails OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of times TCP connections have made a
+ direct transition to the CLOSED state from either
+ the SYN-SENT state or the SYN-RCVD state, plus the
+ number of times TCP connections have made a direct
+ transition to the LISTEN state from the SYN-RCVD
+ state."
+ ::= { tcp 7 }
+
+ tcpEstabResets OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of times TCP connections have made a
+ direct transition to the CLOSED state from either
+ the ESTABLISHED state or the CLOSE-WAIT state."
+ ::= { tcp 8 }
+
+ tcpCurrEstab OBJECT-TYPE
+ SYNTAX Gauge
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of TCP connections for which the
+ current state is either ESTABLISHED or CLOSE-
+ WAIT."
+ ::= { tcp 9 }
+
+ tcpInSegs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of segments received, including
+ those received in error. This count includes
+ segments received on currently established
+ connections."
+ ::= { tcp 10 }
+
+ tcpOutSegs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of segments sent, including
+ those on current connections but excluding those
+ containing only retransmitted octets."
+ ::= { tcp 11 }
+
+ tcpRetransSegs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of segments retransmitted - that
+ is, the number of TCP segments transmitted
+ containing one or more previously transmitted
+ octets."
+ ::= { tcp 12 }
+
+
+ -- the TCP Connection table
+
+ -- The TCP connection table contains information about this
+ -- entity's existing TCP connections.
+
+ tcpConnTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF TcpConnEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "A table containing TCP connection-specific
+ information."
+ ::= { tcp 13 }
+
+ tcpConnEntry OBJECT-TYPE
+ SYNTAX TcpConnEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Information about a particular current TCP
+ connection. An object of this type is transient,
+ in that it ceases to exist when (or soon after)
+ the connection makes the transition to the CLOSED
+ state."
+ INDEX { tcpConnLocalAddress,
+ tcpConnLocalPort,
+ tcpConnRemAddress,
+ tcpConnRemPort }
+ ::= { tcpConnTable 1 }
+
+ TcpConnEntry ::=
+ SEQUENCE {
+ tcpConnState
+ INTEGER,
+ tcpConnLocalAddress
+ IpAddress,
+ tcpConnLocalPort
+ INTEGER (0..65535),
+ tcpConnRemAddress
+ IpAddress,
+ tcpConnRemPort
+ INTEGER (0..65535)
+ }
+
+ tcpConnState OBJECT-TYPE
+ SYNTAX INTEGER {
+ closed(1),
+ listen(2),
+ synSent(3),
+ synReceived(4),
+ established(5),
+ finWait1(6),
+ finWait2(7),
+ closeWait(8),
+ lastAck(9),
+ closing(10),
+ timeWait(11),
+ deleteTCB(12)
+ }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The state of this TCP connection.
+
+ 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)."
+ ::= { tcpConnEntry 1 }
+
+ tcpConnLocalAddress OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The local IP address for this TCP connection. In
+ the case of a connection in the listen state which
+ is willing to accept connections for any IP
+ interface associated with the node, the value
+ 0.0.0.0 is used."
+ ::= { tcpConnEntry 2 }
+
+ tcpConnLocalPort OBJECT-TYPE
+ SYNTAX INTEGER (0..65535)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The local port number for this TCP connection."
+ ::= { tcpConnEntry 3 }
+
+ tcpConnRemAddress OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The remote IP address for this TCP connection."
+ ::= { tcpConnEntry 4 }
+
+ tcpConnRemPort OBJECT-TYPE
+ SYNTAX INTEGER (0..65535)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The remote port number for this TCP connection."
+ ::= { tcpConnEntry 5 }
+
+
+ -- additional TCP objects
+
+ tcpInErrs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of segments received in error
+ (e.g., bad TCP checksums)."
+ ::= { tcp 14 }
+
+ tcpOutRsts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of TCP segments sent containing the
+ RST flag."
+ ::= { tcp 15 }
+
+
+ -- the UDP group
+
+ -- Implementation of the UDP group is mandatory for all
+ -- systems which implement the UDP.
+
+ udpInDatagrams OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of UDP datagrams delivered to
+ UDP users."
+ ::= { udp 1 }
+
+ udpNoPorts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of received UDP datagrams for
+ which there was no application at the destination
+ port."
+ ::= { udp 2 }
+
+ udpInErrors OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of received UDP datagrams that could
+ not be delivered for reasons other than the lack
+ of an application at the destination port."
+ ::= { udp 3 }
+
+ udpOutDatagrams OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of UDP datagrams sent from this
+ entity."
+ ::= { udp 4 }
+
+
+ -- the UDP Listener table
+
+ -- The UDP listener table contains information about this
+ -- entity's UDP end-points on which a local application is
+ -- currently accepting datagrams.
+
+ udpTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF UdpEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "A table containing UDP listener information."
+ ::= { udp 5 }
+
+ udpEntry OBJECT-TYPE
+ SYNTAX UdpEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Information about a particular current UDP
+ listener."
+ INDEX { udpLocalAddress, udpLocalPort }
+ ::= { udpTable 1 }
+
+ UdpEntry ::=
+ SEQUENCE {
+ udpLocalAddress
+ IpAddress,
+ udpLocalPort
+ INTEGER (0..65535)
+ }
+
+ udpLocalAddress OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The local IP address for this UDP listener. In
+ the case of a UDP listener which is willing to
+ accept datagrams for any IP interface associated
+ with the node, the value 0.0.0.0 is used."
+ ::= { udpEntry 1 }
+
+ udpLocalPort OBJECT-TYPE
+ SYNTAX INTEGER (0..65535)
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The local port number for this UDP listener."
+ ::= { udpEntry 2 }
+
+
+ -- the EGP group
+
+ -- Implementation of the EGP group is mandatory for all
+ -- systems which implement the EGP.
+
+ egpInMsgs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of EGP messages received without
+ error."
+ ::= { egp 1 }
+
+ egpInErrors OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of EGP messages received that proved
+ to be in error."
+ ::= { egp 2 }
+
+ egpOutMsgs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of locally generated EGP
+ messages."
+ ::= { egp 3 }
+
+ egpOutErrors OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of locally generated EGP messages not
+ sent due to resource limitations within an EGP
+ entity."
+ ::= { egp 4 }
+
+
+ -- the EGP Neighbor table
+
+ -- The EGP neighbor table contains information about this
+ -- entity's EGP neighbors.
+
+ egpNeighTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF EgpNeighEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "The EGP neighbor table."
+ ::= { egp 5 }
+
+ egpNeighEntry OBJECT-TYPE
+ SYNTAX EgpNeighEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Information about this entity's relationship with
+ a particular EGP neighbor."
+ INDEX { egpNeighAddr }
+ ::= { egpNeighTable 1 }
+
+ EgpNeighEntry ::=
+ SEQUENCE {
+ egpNeighState
+ INTEGER,
+ egpNeighAddr
+ IpAddress,
+ egpNeighAs
+ INTEGER,
+ egpNeighInMsgs
+ Counter,
+ egpNeighInErrs
+ Counter,
+ egpNeighOutMsgs
+ Counter,
+ egpNeighOutErrs
+ Counter,
+ egpNeighInErrMsgs
+ Counter,
+ egpNeighOutErrMsgs
+ Counter,
+ egpNeighStateUps
+ Counter,
+ egpNeighStateDowns
+ Counter,
+ egpNeighIntervalHello
+ INTEGER,
+ egpNeighIntervalPoll
+ INTEGER,
+ egpNeighMode
+ INTEGER,
+ egpNeighEventTrigger
+ INTEGER
+ }
+
+ egpNeighState OBJECT-TYPE
+ SYNTAX INTEGER {
+ idle(1),
+ acquisition(2),
+ down(3),
+ up(4),
+ cease(5)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The EGP state of the local system with respect to
+ this entry's EGP neighbor. Each EGP state is
+ represented by a value that is one greater than
+ the numerical value associated with said state in
+ RFC 904."
+ ::= { egpNeighEntry 1 }
+
+ egpNeighAddr OBJECT-TYPE
+ SYNTAX IpAddress
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The IP address of this entry's EGP neighbor."
+ ::= { egpNeighEntry 2 }
+
+ egpNeighAs OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The autonomous system of this EGP peer. Zero
+ should be specified if the autonomous system
+ number of the neighbor is not yet known."
+ ::= { egpNeighEntry 3 }
+
+ egpNeighInMsgs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of EGP messages received without error
+ from this EGP peer."
+ ::= { egpNeighEntry 4 }
+
+ egpNeighInErrs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of EGP messages received from this EGP
+ peer that proved to be in error (e.g., bad EGP
+ checksum)."
+ ::= { egpNeighEntry 5 }
+
+ egpNeighOutMsgs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of locally generated EGP messages to
+ this EGP peer."
+ ::= { egpNeighEntry 6 }
+
+ egpNeighOutErrs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of locally generated EGP messages not
+ sent to this EGP peer due to resource limitations
+ within an EGP entity."
+ ::= { egpNeighEntry 7 }
+
+ egpNeighInErrMsgs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of EGP-defined error messages received
+ from this EGP peer."
+ ::= { egpNeighEntry 8 }
+
+ egpNeighOutErrMsgs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of EGP-defined error messages sent to
+ this EGP peer."
+ ::= { egpNeighEntry 9 }
+
+ egpNeighStateUps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of EGP state transitions to the UP
+ state with this EGP peer."
+ ::= { egpNeighEntry 10 }
+
+ egpNeighStateDowns OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The number of EGP state transitions from the UP
+ state to any other state with this EGP peer."
+ ::= { egpNeighEntry 11 }
+
+ egpNeighIntervalHello OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The interval between EGP Hello command
+ retransmissions (in hundredths of a second). This
+ represents the t1 timer as defined in RFC 904."
+ ::= { egpNeighEntry 12 }
+
+ egpNeighIntervalPoll OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The interval between EGP poll command
+ retransmissions (in hundredths of a second). This
+ represents the t3 timer as defined in RFC 904."
+ ::= { egpNeighEntry 13 }
+
+ egpNeighMode OBJECT-TYPE
+ SYNTAX INTEGER { active(1), passive(2) }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The polling mode of this EGP entity, either
+ passive or active."
+ ::= { egpNeighEntry 14 }
+
+ egpNeighEventTrigger OBJECT-TYPE
+ SYNTAX INTEGER { start(1), stop(2) }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "A control variable used to trigger operator-
+ initiated Start and Stop events. When read, this
+ variable always returns the most recent value that
+ egpNeighEventTrigger was set to. If it has not
+ been set since the last initialization of the
+ network management subsystem on the node, it
+ returns a value of `stop'.
+
+ When set, this variable causes a Start or Stop
+ event on the specified neighbor, as specified on
+ pages 8-10 of RFC 904. Briefly, a Start event
+ causes an Idle peer to begin neighbor acquisition
+ and a non-Idle peer to reinitiate neighbor
+ acquisition. A stop event causes a non-Idle peer
+ to return to the Idle state until a Start event
+ occurs, either via egpNeighEventTrigger or
+ otherwise."
+ ::= { egpNeighEntry 15 }
+
+
+ -- additional EGP objects
+
+ egpAs OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The autonomous system number of this EGP entity."
+ ::= { egp 6 }
+
+
+ -- the Transmission group
+
+ -- Based on the transmission media underlying each interface
+ -- on a system, the corresponding portion of the Transmission
+ -- group is mandatory for that system.
+
+ -- When Internet-standard definitions for managing
+ -- transmission media are defined, the transmission group is
+ -- used to provide a prefix for the names of those objects.
+
+ -- Typically, such definitions reside in the experimental
+ -- portion of the MIB until they are "proven", then as a
+ -- part of the Internet standardization process, the
+ -- definitions are accordingly elevated and a new object
+ -- identifier, under the transmission group is defined. By
+ -- convention, the name assigned is:
+ --
+ -- type OBJECT IDENTIFIER ::= { transmission number }
+ --
+ -- where "type" is the symbolic value used for the media in
+ -- the ifType column of the ifTable object, and "number" is
+ -- the actual integer value corresponding to the symbol.
+
+
+ -- the SNMP group
+
+ -- Implementation of the SNMP group is mandatory for all
+ -- systems which support an SNMP protocol entity. Some of
+ -- the objects defined below will be zero-valued in those
+ -- SNMP implementations that are optimized to support only
+ -- those functions specific to either a management agent or
+ -- a management station. In particular, it should be
+ -- observed that the objects below refer to an SNMP entity,
+ -- and there may be several SNMP entities residing on a
+ -- managed node (e.g., if the node is hosting acting as
+ -- a management station).
+
+ snmpInPkts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of Messages delivered to the
+ SNMP entity from the transport service."
+ ::= { snmp 1 }
+
+ snmpOutPkts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Messages which were
+ passed from the SNMP protocol entity to the
+ transport service."
+ ::= { snmp 2 }
+
+ snmpInBadVersions OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Messages which were
+ delivered to the SNMP protocol entity and were for
+ an unsupported SNMP version."
+ ::= { snmp 3 }
+
+ snmpInBadCommunityNames OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Messages delivered to
+ the SNMP protocol entity which used a SNMP
+ community name not known to said entity."
+ ::= { snmp 4 }
+
+ snmpInBadCommunityUses OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Messages delivered to
+ the SNMP protocol entity which represented an SNMP
+ operation which was not allowed by the SNMP
+ community named in the Message."
+ ::= { snmp 5 }
+
+ snmpInASNParseErrs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of ASN.1 or BER errors
+ encountered by the SNMP protocol entity when
+ decoding received SNMP Messages."
+ ::= { snmp 6 }
+
+ -- { snmp 7 } is not used in rfc1213, but MIBII.mdl had one :(
+ snmpInBadTypes OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Total number of PDUs having an unknown PDU type"
+ ::= { snmp 7 }
+
+ snmpInTooBigs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP PDUs which were
+ delivered to the SNMP protocol entity and for
+ which the value of the error-status field is
+ `tooBig'."
+ ::= { snmp 8 }
+
+ snmpInNoSuchNames OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP PDUs which were
+ delivered to the SNMP protocol entity and for
+ which the value of the error-status field is
+ `noSuchName'."
+ ::= { snmp 9 }
+
+ snmpInBadValues OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP PDUs which were
+ delivered to the SNMP protocol entity and for
+ which the value of the error-status field is
+ `badValue'."
+ ::= { snmp 10 }
+
+ snmpInReadOnlys OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number valid SNMP PDUs which were
+ delivered to the SNMP protocol entity and for
+ which the value of the error-status field is
+ `readOnly'. It should be noted that it is a
+ protocol error to generate an SNMP PDU which
+ contains the value `readOnly' in the error-status
+ field, as such this object is provided as a means
+ of detecting incorrect implementations of the
+ SNMP."
+ ::= { snmp 11 }
+
+ snmpInGenErrs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP PDUs which were
+ delivered to the SNMP protocol entity and for
+ which the value of the error-status field is
+ `genErr'."
+ ::= { snmp 12 }
+
+ snmpInTotalReqVars OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of MIB objects which have been
+ retrieved successfully by the SNMP protocol entity
+ as the result of receiving valid SNMP Get-Request
+ and Get-Next PDUs."
+ ::= { snmp 13 }
+
+ snmpInTotalSetVars OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of MIB objects which have been
+ altered successfully by the SNMP protocol entity
+ as the result of receiving valid SNMP Set-Request
+ PDUs."
+ ::= { snmp 14 }
+
+ snmpInGetRequests OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Get-Request PDUs which
+ have been accepted and processed by the SNMP
+ protocol entity."
+ ::= { snmp 15 }
+
+ snmpInGetNexts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Get-Next PDUs which have
+ been accepted and processed by the SNMP protocol
+ entity."
+ ::= { snmp 16 }
+
+ snmpInSetRequests OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Set-Request PDUs which
+ have been accepted and processed by the SNMP
+ protocol entity."
+ ::= { snmp 17 }
+
+ snmpInGetResponses OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Get-Response PDUs which
+ have been accepted and processed by the SNMP
+ protocol entity."
+ ::= { snmp 18 }
+
+ snmpInTraps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Trap PDUs which have
+ been accepted and processed by the SNMP protocol
+ entity."
+ ::= { snmp 19 }
+
+ snmpOutTooBigs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP PDUs which were
+ generated by the SNMP protocol entity and for
+ which the value of the error-status field is
+ `tooBig.'"
+ ::= { snmp 20 }
+
+ snmpOutNoSuchNames OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP PDUs which were
+ generated by the SNMP protocol entity and for
+ which the value of the error-status is
+ `noSuchName'."
+ ::= { snmp 21 }
+
+ snmpOutBadValues OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP PDUs which were
+ generated by the SNMP protocol entity and for
+ which the value of the error-status field is
+ `badValue'."
+ ::= { snmp 22 }
+
+ -- { snmp 23 } is not used in rfc1213, but MIBII.mdl had one :(
+ snmpOutReadOnlys OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP PDUs which were
+ generated by the SNMP protocol entity and for
+ which the value of the error-status field is
+ `readOnly'."
+ ::= { snmp 23 }
+
+ snmpOutGenErrs OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP PDUs which were
+ generated by the SNMP protocol entity and for
+ which the value of the error-status field is
+ `genErr'."
+ ::= { snmp 24 }
+
+ snmpOutGetRequests OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Get-Request PDUs which
+ have been generated by the SNMP protocol entity."
+ ::= { snmp 25 }
+
+ snmpOutGetNexts OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Get-Next PDUs which have
+ been generated by the SNMP protocol entity."
+ ::= { snmp 26 }
+
+ snmpOutSetRequests OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Set-Request PDUs which
+ have been generated by the SNMP protocol entity."
+ ::= { snmp 27 }
+
+ snmpOutGetResponses OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Get-Response PDUs which
+ have been generated by the SNMP protocol entity."
+ ::= { snmp 28 }
+
+ snmpOutTraps OBJECT-TYPE
+ SYNTAX Counter
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total number of SNMP Trap PDUs which have
+ been generated by the SNMP protocol entity."
+ ::= { snmp 29 }
+
+ snmpEnableAuthenTraps OBJECT-TYPE
+ SYNTAX INTEGER { enabled(1), disabled(2) }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "Indicates whether the SNMP agent process is
+ permitted to generate authentication-failure
+ traps. The value of this object overrides any
+ configuration information; as such, it provides a
+ means whereby all authentication-failure traps may
+ be disabled.
+
+ Note that it is strongly recommended that this
+ object be stored in non-volatile memory so that it
+ remains constant between re-initializations of the
+ network management system."
+ ::= { snmp 30 }
+
+ END
+-- @(#)WSCCS g/mibs-wfcommon.mib 1.4 10/26/95
+Wellfleet-COMMON-MIB
+
+DEFINITIONS ::= BEGIN
+
+IMPORTS
+
+ enterprises
+ FROM RFC1155-SMI;
+
+wellfleet OBJECT IDENTIFIER ::= { enterprises 18 }
+
+wfSwSeries7 OBJECT IDENTIFIER ::= { wellfleet 3 }
+
+wfHardwareConfig OBJECT IDENTIFIER ::= { wfSwSeries7 1 }
+
+wfHwModuleGroup OBJECT IDENTIFIER ::= { wfHardwareConfig 4 }
+
+wfSystem OBJECT IDENTIFIER ::= { wfSwSeries7 3 }
+
+END -- Wellfleet-COMMON-MIB
+-- @(#)WSCCS i/mibs-hardware.mib 1.2 10/9/95
+Wellfleet-HARDWARE-MIB DEFINITIONS ::= BEGIN
+
+-- Created by mdl2asn version 3.1
+-- Creation date: Wed Aug 30 16:42:01 EDT 1995
+
+
+ IMPORTS
+
+ IpAddress, Counter, Gauge, TimeTicks, Opaque, enterprises, mgmt
+ FROM RFC1155-SMI
+ OBJECT-TYPE
+ FROM RFC-1212
+ TRAP-TYPE
+ FROM RFC-1215
+ DisplayString, mib-2
+ FROM RFC1213-MIB
+ wfHardwareConfig
+ FROM Wellfleet-COMMON-MIB;
+
+
+ wfHwBase OBJECT IDENTIFIER ::= { wfHardwareConfig 1 }
+
+ wfHwBpIdOpt OBJECT-TYPE
+ SYNTAX INTEGER {
+ acefn(1),
+ aceln(2),
+ acecn(3),
+ afn(4),
+ in(5),
+ an(16),
+ sys5000(5000),
+ freln(16640),
+ frecn(16896),
+ frerbln(17152),
+ asn(20480),
+ asnzcable(20736),
+ asnbcable(20992)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The BackPlane identification number."
+ ::= { wfHwBase 1 }
+
+ wfHwBpRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the BackPlane. High byte is in upper 2 bytes."
+ ::= { wfHwBase 2 }
+
+ wfHwBpSerialNumber OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The serial number of the BackPlane."
+ ::= { wfHwBase 3 }
+
+ wfBCNPwrSupply1 OBJECT-TYPE
+ SYNTAX INTEGER {
+ ok(1),
+ fail(2),
+ notpresent(3)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Status of BCN Hot-Swappable Power Supply 1"
+ DEFVAL { notpresent }
+ ::= { wfHwBase 4 }
+
+ wfBCNPwrSupply2 OBJECT-TYPE
+ SYNTAX INTEGER {
+ ok(1),
+ fail(2),
+ notpresent(3)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Status of BCN Hot-Swappable Power Supply 2"
+ DEFVAL { notpresent }
+ ::= { wfHwBase 5 }
+
+ wfBCNPwrSupply3 OBJECT-TYPE
+ SYNTAX INTEGER {
+ ok(1),
+ fail(2),
+ notpresent(3)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Status of BCN Hot-Swappable Power Supply 3"
+ DEFVAL { notpresent }
+ ::= { wfHwBase 6 }
+
+ wfBCNPwrSupply4 OBJECT-TYPE
+ SYNTAX INTEGER {
+ ok(1),
+ fail(2),
+ notpresent(3)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Status of BCN Hot-Swappable Power Supply 4"
+ DEFVAL { notpresent }
+ ::= { wfHwBase 7 }
+
+ wfBCNFanStatus OBJECT-TYPE
+ SYNTAX INTEGER {
+ ok(1),
+ fail(2),
+ notpresent(3)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Status of BCN Fan Tray"
+ DEFVAL { notpresent }
+ ::= { wfHwBase 8 }
+
+ wfBCNTemperature OBJECT-TYPE
+ SYNTAX INTEGER {
+ ok(1),
+ caution(2),
+ notpresent(3)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Status of BCN Temperature sensor"
+ DEFVAL { notpresent }
+ ::= { wfHwBase 9 }
+
+ wfHwTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF WfHwEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Hardware Table - indexed by slot number"
+ ::= { wfHardwareConfig 2 }
+
+ wfHwEntry OBJECT-TYPE
+ SYNTAX WfHwEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Hardware specific information about a slot."
+ INDEX { wfHwSlot }
+ ::= { wfHwTable 1 }
+
+ WfHwEntry ::= SEQUENCE {
+ wfHwSlot
+ INTEGER,
+ wfHwModIdOpt
+ INTEGER,
+ wfHwModRev
+ OCTET STRING,
+ wfHwModSerialNumber
+ OCTET STRING,
+ wfHwMotherBdIdOpt
+ INTEGER,
+ wfHwMotherBdRev
+ OCTET STRING,
+ wfHwMotherBdSerialNumber
+ OCTET STRING,
+ wfHwDaughterBdIdOpt
+ INTEGER,
+ wfHwDaughterBdRev
+ OCTET STRING,
+ wfHwDaughterBdSerialNumber
+ OCTET STRING,
+ wfHwBabyBdIdOpt
+ INTEGER,
+ wfHwBabyBdRev
+ OCTET STRING,
+ wfHwBabyBdSerialNumber
+ OCTET STRING,
+ wfHwDiagPromRev
+ OCTET STRING,
+ wfHwDiagPromDate
+ DisplayString,
+ wfHwDiagPromSource
+ DisplayString,
+ wfHwBootPromRev
+ OCTET STRING,
+ wfHwBootPromDate
+ DisplayString,
+ wfHwBootPromSource
+ DisplayString,
+ wfHwSparePromRev
+ OCTET STRING,
+ wfHwSparePromDate
+ DisplayString,
+ wfHwSparePromSource
+ DisplayString,
+ wfHwFileSysPresent
+ INTEGER,
+ wfHwFileSysPresent2
+ INTEGER,
+ wfHwConfigServer
+ INTEGER,
+ wfHwConfigFile
+ DisplayString,
+ wfHwConfigDateAndTime
+ OCTET STRING,
+ wfHwActiveImageName
+ DisplayString,
+ wfHwActiveImageSource
+ DisplayString,
+ wfHwActiveImageDate
+ DisplayString,
+ wfHwMotherBdMemorySize
+ INTEGER,
+ wfHwFastPacketCacheSize
+ INTEGER,
+ wfHwModDaughterBd1IdOpt
+ INTEGER,
+ wfHwModDaughterBd1AwRev
+ OCTET STRING,
+ wfHwModDaughterBd1Rev
+ OCTET STRING,
+ wfHwModDaughterBd1SerialNumber
+ OCTET STRING,
+ wfHwModDaughterBd2IdOpt
+ INTEGER,
+ wfHwModDaughterBd2AwRev
+ OCTET STRING,
+ wfHwModDaughterBd2Rev
+ OCTET STRING,
+ wfHwModDaughterBd2SerialNumber
+ OCTET STRING
+ }
+
+ wfHwSlot OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A unique value for each slot.
+ Its value ranges between 1 and 14.
+ There are products in this family that contain 1, 5, and 14 slots."
+ ::= { wfHwEntry 1 }
+
+ wfHwModIdOpt OBJECT-TYPE
+ SYNTAX INTEGER {
+ enet1(1),
+ enet2(8),
+ sync1(16),
+ sync1a(17),
+ t11(24),
+ dse1(32),
+ dse1a(33),
+ dst416(40),
+ sst416a(41),
+ dst4(42),
+ sst4a(43),
+ sst416(44),
+ stok416(45),
+ sst4(46),
+ stok4(47),
+ floppy(48),
+ necfloppy(49),
+ t12(56),
+ t12a(57),
+ st1(58),
+ t156k(60),
+ e1(61),
+ st156k(62),
+ se1(63),
+ t12n(64),
+ st1n(65),
+ t156kn(66),
+ st156kn(67),
+ e1n(68),
+ se1n(69),
+ sync(80),
+ sync2a(81),
+ cmcfddi(88),
+ iphfddi(89),
+ dt(104),
+ dsde1(112),
+ dsde1a(113),
+ enet(114),
+ dse2(116),
+ dse2a(117),
+ sse(118),
+ ssea(119),
+ dsde10bt(120),
+ enet3(132),
+ dsde2(156),
+ oldqenf(160),
+ denf(161),
+ qenf(162),
+ qef(164),
+ def(165),
+ mct1(168),
+ smct1(169),
+ dtok(176),
+ mce1(184),
+ smce1(185),
+ mce1ii75(188),
+ smce1ii75(189),
+ mce1ii120(190),
+ smce1ii120(191),
+ wffddi2m(192),
+ wffddi1m(193),
+ wffddi2s(194),
+ wffddi1s(195),
+ wffddi2mf(196),
+ wffddi1mf(197),
+ wffddi2sf(198),
+ wffddi1sf(199),
+ fmdset(200),
+ fmdst(201),
+ fmdse(202),
+ fmsst(203),
+ fmsse(204),
+ fnsdse(208),
+ fnsdsdt(216),
+ fnsdst(217),
+ dhssi(224),
+ shssi(225),
+ esafnf(232),
+ esafdsenf(233),
+ esafssenf(234),
+ esafdenf(235),
+ esaf(236),
+ esafdse(237),
+ esafsse(238),
+ esafde(239),
+ qtok(256),
+ asn(511),
+ anseds(1024),
+ ansedst(1025),
+ ansedsh(1026),
+ ansedsi(1027),
+ ansedsti(1028),
+ ansedshi(1029),
+ ansets(1030),
+ ansetst(1031),
+ ansetsh(1032),
+ andeds(1033),
+ andedst(1034),
+ andedsh(1035),
+ andstx(1036),
+ andst(1037),
+ andsti(1038),
+ antst(1039),
+ antstx(1040),
+ ansdsedst(1041),
+ ansdsedstx(1042),
+ ansedsi2(1043),
+ ansedsti2(1044),
+ ansedshi2(1045),
+ andsti2(1046),
+ ansedsg(1047),
+ ansedsgx(1048),
+ ansetsg(1049),
+ andedsg(1050),
+ ansedsgi(1051),
+ ansetsgx(1052),
+ andedsgx(1053),
+ ansedsgix(1054),
+ ansedsx(1055),
+ ansetsx(1056),
+ andedsx(1057),
+ ansedstx(1058),
+ ansetstx(1059),
+ andedstx(1060),
+ andsti2x(1061),
+ ansedsi2x(1062),
+ ansedsti2x(1063),
+ atmalc(4096),
+ atmalctaxi100(4097),
+ atmalcsonetmm(4098),
+ atmalcsonetsm(4099),
+ osync(4352),
+ comp(4353),
+ comp128(4354),
+ atmcoc3mm(4608),
+ atmcoc3sm(4609),
+ atmcoc3utp5(4610),
+ de100(4864),
+ atmcds3(5120),
+ atmce3(5121),
+ qmct1rj45(5376),
+ qmct1db15(5377),
+ srml(8448),
+ atm5000ah(524288),
+ qe(1048799),
+ qehwf(1048798),
+ qefddi2m(1048831),
+ qefddi2mhwf(1048830),
+ qefddi2s(1048823),
+ qefddi2shwf(1048822),
+ qefddi1m(1048815),
+ qefddi1mhwf(1048814),
+ qefddi1s(1048807),
+ qefddi1shwf(1048806),
+ qecddi2stp(1048827),
+ qecddi2stphwf(1048826),
+ qecddi1stp(1048811),
+ qecddi1stphwf(1048810),
+ qecddi2utp(1048763),
+ qecddi2utphwf(1048762),
+ qecddi1utp(1048747),
+ qecddi1utphwf(1048746),
+ enet3atm(1048832),
+ enet3enet(1048833),
+ enet3fddi(1048834),
+ enet3tok(1048835),
+ enet3tokf(1048836),
+ enet3sync(1048837),
+ enet3only(1048863),
+ fddiatm(1048864),
+ fddienet(1048865),
+ fddifddi(1048866),
+ fdditok(1048867),
+ fdditokf(1048868),
+ fddisync(1048869),
+ fddionly(1048895),
+ tok3atm(1048896),
+ tok3enet(1048897),
+ tok3fddi(1048898),
+ tok3tok(1048899),
+ tok3tokf(1048900),
+ tok3sync(1048901),
+ tok3only(1048927),
+ tokf3atm(1048928),
+ tokf3enet(1048929),
+ tokf3fddi(1048930),
+ tokf3tok(1048931),
+ tokf3tokf(1048932),
+ tokf3sync(1048933),
+ tokf3only(1048959),
+ enet3datm(1048960),
+ enet3denet(1048961),
+ enet3dfddi(1048962),
+ enet3dtok(1048963),
+ enet3dtokf(1048964),
+ enet3dsync(1048965),
+ enet3donly(1048991),
+ chipcomfenet(1049089),
+ chipcomffddi(1049090),
+ chipcomftok(1049091),
+ chipcomftokf(1049092),
+ chipcomfdsync(1049093),
+ chipcomfisdn(1049094),
+ chipcomffddis(1049095),
+ chipcomfonly(1049119),
+ chipcomenet(1049217),
+ chipcomfddi(1049218),
+ chipcomtok(1049219),
+ chipcomtokf(1049220),
+ chipcomdsync(1049221),
+ chipcomisdn(1049222),
+ chipcomfddis(1049223),
+ chipcomonly(1049247)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The module identification number.
+
+ Port Configurations
+ HWStat Name Enet Sync Async Token Framer Fiber
+ ------ ------------ ------ ---- ----- ----- ------ -----
+ 1 ENET-1 2 0 0 0 0 0
+ 8 ENET-2 2 0 0 0 0 0
+
+ 16 SYNC-1 0 4 1 0 0 0
+ 17 SYNC-1 [1] 0 4 1 0 0 0
+
+ 24 T1-1 0 2 1 0 2 0
+
+ 32 DSE-1 1 2 1 0 0 0
+ 33 DSE-1 [1] 1 2 1 0 0 0
+
+ 40 DST-4/16 0 2 1 1 0 0
+ 41 SST-4/16 [1] 0 1 1 1 0 0
+ 42 DST-4 0 2 1 1 0 0
+ 43 SST-4 [1] 0 1 1 1 0 0
+ 44 SST-4/16 0 1 1 1 0 0
+ 45 STOK-4/16 [3] 0 0 0 1 0 0
+ 46 SST-4 0 1 1 1 0 0
+ 47 STOK-4 [3] 0 0 0 1 0 0
+
+ 48 FLOPPY 0 0 0 0 0 0
+
+ 56 T1-2 0 2 1 0 2 0
+ 57 T1-2 0 2 1 0 2 0
+ 58 ST1 0 1 1 0 1 0
+ 60 T1-56K 0 1 1 0 1 0
+ 61 E1 [3] 0 2 0 0 2 0
+ 62 ST1-56K 0 1 1 0 1 0
+ 63 SE1 [3] 0 1 0 0 1 0
+
+ 64 T1-2n 0 2 1 0 2 0
+ 65 ST1n 0 1 1 0 1 0
+ 66 T1-56Kn 0 1 1 0 1 0
+ 67 ST1-56Kn 0 1 1 0 1 0
+ 68 E1n [3] 0 2 0 0 2 0
+ 69 SE1n [3] 0 1 0 0 1 0
+
+ 80 SYNC-2 0 4 1 0 0 0
+ 81 SYNC-2 [1] 0 4 1 0 0 0
+
+ 88 CMC-FDDI [6] 0 0 0 0 0 1
+ 89 IPHASE-FDDI [6] 0 0 0 0 0 1
+
+ 112 DSDE-1 2 2 1 0 0 0
+ 113 DSDE-1 [1] 2 2 1 0 0 0
+ 114 ENET 2 0 0 0 0 0
+ 116 DSE-2 1 2 1 0 0 0
+ 117 DSE-2 [1] 1 2 1 0 0 0
+ 118 SSE 1 1 1 0 0 0
+ 119 SSE [1] 1 1 1 0 0 0
+
+ 132 ENET-3 [2] 2 0 0 0 0 0
+
+ 156 DSDE-2 [2] 2 2 1 0 0 0
+
+ 160 QE/NF 4 0 0 0 0 0
+ 161 DE/NF [5] 2 0 0 0 0 0
+ 162 QE/NF 4 0 0 0 0 0
+ 164 QE/F [4] 4 0 0 0 0 0
+ 165 DE/F [4,5] 2 0 0 0 0 0
+
+ 168 MCT1 0 2 Munich 0 0 2 0
+ 169 SMCT1 0 1 Munich 0 0 1 0
+
+ 176 DTOK 0 0 0 2 0 0
+
+ 184 MCE1 0 2 Munich 0 0 2 0
+ 185 SMCE1 0 1 Munich 0 0 1 0
+ 188 MCE1II75 0 2 Munich 0 0 2 0
+ 189 SMCE1II75 0 1 Munich 0 0 1 0
+ 190 MCE1II120 0 2 Munich 0 0 2 0
+ 191 SMCE1II120 0 1 Munich 0 0 1 0
+
+ 192 WF_FDDI_2M 0 0 0 0 0 1
+ 193 WF_FDDI_1M 0 0 0 0 0 1
+ 194 WF_FDDI_2S 0 0 0 0 0 1
+ 195 WF_FDDI_1S 0 0 0 0 0 1
+ 196 WF_FDDI_2MF 0 0 0 0 0 1
+ 197 WF_FDDI_1MF 0 0 0 0 0 1
+ 198 WF_FDDI_2SF 0 0 0 0 0 1
+ 199 WF_FDDI_1SF 0 0 0 0 0 1
+
+ 200 HW_MODULE_FMDSET [7] 1 2 0 1 0 0
+ 201 HW_MODULE_FMDST [7] 0 2 0 1 0 0
+ 202 HW_MODULE_FMDSE [7] 1 2 0 0 0 0
+ 203 HW_MODULE_FMSST [7] 0 1 0 1 0 0
+ 204 HW_MODULE_FMSSE [7] 1 1 0 0 0 0
+
+ 208 FNSDSE [7] 1 2 0 0 0 0
+ 216 FNSDSDT [7] 0 2 0 2 0 0
+ 217 FNSDST [7] 0 2 0 1 0 0
+
+ 224 DHSSI 0 2 hssi 0 0 0 0
+ 225 SHSSI 0 1 hssi 0 0 0 0
+
+ 232 ESAF_NF 2 2 0 0 0 0
+ 233 ESAF_DSE_NF 1 2 0 0 0 0
+ 234 ESAF_SSE_NF 1 1 0 0 0 0
+ 235 ESAF_DE_NF 2 0 0 0 0 0
+ 236 ESAF [2] 2 2 0 0 0 0
+ 237 ESAF_DSE [2] 1 2 0 0 0 0
+ 238 ESAF_SSE [2] 1 1 0 0 0 0
+ 239 ESAF_DE [2] 2 0 0 0 0 0
+
+ 256 QTOK 0 0 0 4 0 0
+
+ ASN (Barracuda)
+
+ 511 ASN[8]
+
+
+ AN Module IDs (Piranha, Guppy...)
+
+ ID Mnemonic ENET SYNC ISDN TR HUB DCM
+ -- -------- ---- ---- ---- -- --- ---
+ 1024 ANSEDS 1 2 0 0 0 N
+
+ 1025 ANSEDST 1 2 0 1 0 N
+
+ 1026 ANSEDSH 1 2 0 0 12 N
+
+ 1027 ANSEDSI 1 2 1 0 0 N
+
+ 1028 ANSEDSTI 1 2 1 1 0 N
+
+ 1029 ANSEDSHI 1 2 1 0 12 N
+
+ 1030 ANSETS 1 3 0 0 0 N
+
+ 1031 ANSETST 1 3 0 1 0 N
+
+ 1032 ANSETSH 1 3 0 0 12 N
+
+ 1033 ANDEDS 2 2 0 0 0 N
+
+ 1034 ANDEDST 2 2 0 1 0 N
+
+ 1035 ANDEDSH 2 2 0 0 12 N
+
+ 1036 ANDSTX 0 2 0 1 0 Y
+ (formerly ANDS)
+
+ 1037 ANDST 0 2 0 1 0 N
+
+ 1038 ANDSTI 0 2 1 1 0 N
+
+ 1039 ANTST 0 3 0 1 0 N
+
+ 1040 ANTSTX 0 3 0 1 0 Y
+ (formerly ANSDSEDS)
+
+ 1041 ANSDSEDST 1 2 0 1 0 N
+
+ 1042 ANSDSEDSTX 1 2 0 1 0 Y
+ (formerly ANSDSEDSH)
+
+ 1043 ANSEDSI2 1 2 1 0 0 N
+
+ 1044 ANSEDSTI2 1 2 1 1 0 N
+
+ 1045 ANSEDSHI2 1 2 1 0 12 N
+
+ 1046 ANDSTI2 0 2 1 1 0 N
+
+ 1047 ANSEDSG 1 2 0 0 8 N
+
+ 1048 ANSEDSGX 1 2 0 0 8 Y
+
+ 1049 ANSETSG 1 3 0 0 8 N
+
+ 1050 ANDEDSG 2 2 0 0 8 N
+
+ 1051 ANSEDSGI 1 2 1 0 8 N
+
+ 1052 ANSETSGX 1 3 0 0 8 Y
+
+ 1053 ANDEDSGX 2 2 0 0 8 Y
+
+ 1054 ANSEDSGIX 1 2 1 0 8 Y
+
+ 1055 ANSEDSX 1 2 0 0 0 Y
+
+ 1056 ANSETSX 1 3 0 0 0 Y
+
+ 1057 ANDEDSX 2 2 0 0 0 Y
+
+ 1058 ANSEDSTX 1 2 0 1 0 Y
+
+ 1059 ANSETSTX 1 3 0 1 0 Y
+
+ 1060 ANDEDSTX 2 2 0 1 0 Y
+
+ 1061 ANDSTI2X 0 2 1 0 0 Y
+
+ 1062 ANSEDSI2X 1 2 1 0 0 Y
+
+ 1063 ANSEDSTI2X 1 2 1 1 0 Y
+
+
+ 4096 ATMALC 0 0 0 0 0 0
+ 4097 ATMALCTAXI100 0 0 0 0 0 1
+ 4098 ATMALCSONETMM 0 0 0 0 1 1 [9]
+ 4099 ATMALCSONETSM 0 0 0 0 1 1 [9]
+ 4352 OSYNC 0 8 0 0 0 0
+ 4353 OSYNC_COMP (32) 0 8 0 0 0 0
+ 4354 OSYNC_COMP128 0 8 0 0 0 0
+
+ 4608 ATMCOC3MM 0 0 0 0 1 1 [10]
+ 4609 ATMCOC3SM 0 0 0 0 1 1 [10]
+ 4610 ATMCOC3UTP5 0 0 0 0 1 0 [10]
+
+ 4864 DE100 2 0 0 0 0 0
+
+ 5120 ATMCDS3 0 0 0 0 1 0 [10]
+ 5121 ATMCE3 0 0 0 0 1 0 [10]
+
+ 8448 SRML 0 0 0 0 0 0
+
+
+ NOTES:
+ [1] Indicates Module has COM Port 1 configured for ASYNC.
+ The AM8530's port B is configured for COM1.
+
+ [2] This Module contains the DEFA - Hardware Filtering. CAMS
+ must be programmed (can contain 2 - 6 CAMS onboard).
+
+ [3] The AM8530 has been removed (depopulated) from this module.
+ Programming this device should not be performed.
+
+ [4] Contains Dual Defa hardware. (Can be depopulated)
+
+ [5] Depop'd two ports of hardware to make Dual Ethernet module.
+
+ [6] These are FDDI modules. The ID cannot be read from the Link
+ module I/O space.
+
+ [7] These are AFN Platform Integrated 'Modules' - Cannot be detached
+ or be used by any other platform.
+
+ [8] Module IDs from 1280(0x500) to 2559(0x9ff) are used
+ for the ASN Net Modules. Module ID 512(0x200) is
+ used for the ASN SPEX. These IDs are documented in
+ MODULE.mdl. A module ID of 511(0x1ff) in
+ 'wfHwEntry.wfHwModIdOpt' indicates that it is an
+ ASN platform and the user should refer to
+ 'wfHwModuleEntry.wfHwModuleModIdOpt' for Module ID details
+
+ [9] ATMALC link modules. The physical option for SONET includes a
+ framer and the medium is fiber optics. Only one port per physical
+ daughtercard per link module.
+
+ [10] ARE UTOPIA link modules. "
+ ::= { wfHwEntry 2 }
+
+ wfHwModRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the module. High byte is in upper 2 bytes."
+ ::= { wfHwEntry 3 }
+
+ wfHwModSerialNumber OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The serial number of the module."
+ ::= { wfHwEntry 4 }
+
+ wfHwMotherBdIdOpt OBJECT-TYPE
+ SYNTAX INTEGER {
+ sysctrl(1),
+ ace12(2),
+ ace25(3),
+ ace32(4),
+ afn(5),
+ in(6),
+ sysctrl2(7),
+ an(16),
+ fre(256),
+ fre2(768),
+ o60(769),
+ asn(1024),
+ are(1280),
+ srmf(8704)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The mother board identification number."
+ ::= { wfHwEntry 5 }
+
+ wfHwMotherBdRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the mother board. High byte is in upper 2 bytes."
+ ::= { wfHwEntry 6 }
+
+ wfHwMotherBdSerialNumber OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The serial number of the mother board."
+ ::= { wfHwEntry 7 }
+
+ wfHwDaughterBdIdOpt OBJECT-TYPE
+ SYNTAX INTEGER {
+ sysctrl(1),
+ ace68020mhz12(2),
+ ace68020mhz25(3),
+ ace68030mhz32(4),
+ fre68040mhz25(4352),
+ fre68040mhz33(4608)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The daughter board identification number."
+ ::= { wfHwEntry 8 }
+
+ wfHwDaughterBdRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the daughter board. High byte is in upper 2 bytes."
+ ::= { wfHwEntry 9 }
+
+ wfHwDaughterBdSerialNumber OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The serial number of the daughter board."
+ ::= { wfHwEntry 10 }
+
+ wfHwBabyBdIdOpt OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The baby board identification number."
+ ::= { wfHwEntry 11 }
+
+ wfHwBabyBdRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the baby board. High byte is in upper 2 bytes."
+ ::= { wfHwEntry 12 }
+
+ wfHwBabyBdSerialNumber OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The serial number of the baby board."
+ ::= { wfHwEntry 13 }
+
+ wfHwDiagPromRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the Diagnostic PROM. Major revision level
+ is in the upper 2 bytes, minor revision level in the lower 2 bytes."
+ ::= { wfHwEntry 14 }
+
+ wfHwDiagPromDate OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The creation date of the Diagnostic PROM"
+ ::= { wfHwEntry 15 }
+
+ wfHwDiagPromSource OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The origin of the Diagnostic PROM contents"
+ ::= { wfHwEntry 16 }
+
+ wfHwBootPromRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the BOOT PROM. Major revision level
+ is in the upper 2 bytes, minor revision level in the lower 2 bytes."
+ ::= { wfHwEntry 17 }
+
+ wfHwBootPromDate OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The creation date of the Boot PROM"
+ ::= { wfHwEntry 18 }
+
+ wfHwBootPromSource OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The origin of the Boot PROM contents"
+ ::= { wfHwEntry 19 }
+
+ wfHwSparePromRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the BOOT PROM. Major revision level
+ is in the upper 2 bytes, minor revision level in the lower 2 bytes."
+ ::= { wfHwEntry 20 }
+
+ wfHwSparePromDate OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The creation date of the Spare PROM"
+ ::= { wfHwEntry 21 }
+
+ wfHwSparePromSource OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The origin of the Spare PROM contents"
+ ::= { wfHwEntry 22 }
+
+ wfHwFileSysPresent OBJECT-TYPE
+ SYNTAX INTEGER {
+ filesys(1),
+ nofilesys(2)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Flag indicating presence of File System on this slot."
+ DEFVAL { nofilesys }
+ ::= { wfHwEntry 23 }
+
+ wfHwFileSysPresent2 OBJECT-TYPE
+ SYNTAX INTEGER {
+ filesys(1),
+ nofilesys(2)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Flag indicating presence of File System (Syscon2 volume#2) on this slot."
+ DEFVAL { nofilesys }
+ ::= { wfHwEntry 24 }
+
+ wfHwConfigServer OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The slot number from which this slot was served its
+ configuration. If the value for this attribute is 0, this
+ slot obtained its configuration from a file system resource
+ (not necessarily local); If the value for this attribute is
+ -1, this slot does not participate in the boot process (e.g.
+ SRM). A positive value indicates that the configuration was
+ obtained from memory from the slot indicated by the value of
+ this attribute."
+ ::= { wfHwEntry 25 }
+
+ wfHwConfigFile OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The name of the config file the active configuration was
+ derived from. This does NOT necessarily reflect the
+ current configuration!"
+ ::= { wfHwEntry 26 }
+
+ wfHwConfigDateAndTime OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The 11 octet date and time that a configuration was
+ loaded on/served to this slot. Octet map: 1-2 Year,
+ 3 Month, 4 Day, 5 Hour, 6 Minutes, 7 Seconds,
+ 8 Deci-seconds, 9 Direction from GMT ('+'|`-'), 10 GMT Hour
+ Offset, 11 GMT Minute Offset."
+ ::= { wfHwEntry 27 }
+
+ wfHwActiveImageName OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "If slot was booted from a local source: this is the name of the active
+ image, which is in the form of <volume>:<image name>.
+ If slot was booted from a network source: this is the full pathname
+ where the active image was found on the remote server."
+ ::= { wfHwEntry 28 }
+
+ wfHwActiveImageSource OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The origin of the active image"
+ ::= { wfHwEntry 29 }
+
+ wfHwActiveImageDate OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The date which the active image was created"
+ ::= { wfHwEntry 30 }
+
+ wfHwMotherBdMemorySize OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The total installed dram size in kilobytes."
+ ::= { wfHwEntry 31 }
+
+ wfHwFastPacketCacheSize OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The size of the installed fast packet cache in kilobytes."
+ ::= { wfHwEntry 32 }
+
+ wfHwModDaughterBd1IdOpt OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Link module daughter board #1 identification number"
+ ::= { wfHwEntry 33 }
+
+ wfHwModDaughterBd1AwRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Link module daughter board #1 artwork revision level"
+ ::= { wfHwEntry 34 }
+
+ wfHwModDaughterBd1Rev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Link module daughter board #1 board revision level"
+ ::= { wfHwEntry 35 }
+
+ wfHwModDaughterBd1SerialNumber OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Link module daughter board #1 serial number"
+ ::= { wfHwEntry 36 }
+
+ wfHwModDaughterBd2IdOpt OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Link module daughter board #2 identification number"
+ ::= { wfHwEntry 37 }
+
+ wfHwModDaughterBd2AwRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Link module daughter board #2 artwork revision level"
+ ::= { wfHwEntry 38 }
+
+ wfHwModDaughterBd2Rev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Link module daughter board #2 board revision level"
+ ::= { wfHwEntry 39 }
+
+ wfHwModDaughterBd2SerialNumber OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Link module daughter board #2 serial number"
+ ::= { wfHwEntry 40 }
+
+ END -- Wellfleet-HARDWARE-MIB
+-- @(#)WSCCS q/mibs-module.mib 1.1 8/30/95
+Wellfleet-MODULE-MIB DEFINITIONS ::= BEGIN
+
+-- Created by mdl2asn version 3.1
+-- Creation date: Wed Aug 30 16:45:27 EDT 1995
+
+
+ IMPORTS
+
+ IpAddress, Counter, Gauge, TimeTicks, Opaque, enterprises, mgmt
+ FROM RFC1155-SMI
+ OBJECT-TYPE
+ FROM RFC-1212
+ TRAP-TYPE
+ FROM RFC-1215
+ DisplayString, mib-2
+ FROM RFC1213-MIB
+ wfHwModuleGroup
+ FROM Wellfleet-COMMON-MIB;
+
+
+ wfHwModuleTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF WfHwModuleEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Hardware Module Table
+ Filled in by the Module Driver. Read by SNMP to
+ build the driver load records "
+ ::= { wfHwModuleGroup 1 }
+
+ wfHwModuleEntry OBJECT-TYPE
+ SYNTAX WfHwModuleEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Hardware specific information about a slot."
+ INDEX { wfHwModuleSlot,
+ wfHwModuleModule }
+ ::= { wfHwModuleTable 1 }
+
+ WfHwModuleEntry ::= SEQUENCE {
+ wfHwModuleSlot
+ INTEGER,
+ wfHwModuleModule
+ INTEGER,
+ wfHwModuleModIdOpt
+ INTEGER,
+ wfHwModuleModRev
+ OCTET STRING,
+ wfHwModuleModSerialNumber
+ OCTET STRING,
+ wfHwModuleArtworkRev
+ DisplayString
+ }
+
+ wfHwModuleSlot OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A unique value for each slot.
+ Its value ranges between 1 and 4."
+ ::= { wfHwModuleEntry 1 }
+
+ wfHwModuleModule OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "This value ranges between 1 and 4"
+ ::= { wfHwModuleEntry 2 }
+
+ wfHwModuleModIdOpt OBJECT-TYPE
+ SYNTAX INTEGER {
+ spex(512),
+ hss(768),
+ hsd(769),
+ denm(1280),
+ denmhwf(1281),
+ dsnmnn(1536),
+ dsnmn1(1537),
+ dsnmn2(1538),
+ dsnm1n(1540),
+ dsnm11(1541),
+ dsnm12(1542),
+ dsnm2n(1544),
+ dsnm21(1545),
+ dsnm22(1546),
+ dsnmnnisdn(1584),
+ dsnmn1isdn(1585),
+ dsnmn2isdn(1586),
+ dsnm1nisdn(1588),
+ dsnm11isdn(1589),
+ dsnm12isdn(1590),
+ dsnm2nisdn(1592),
+ dsnm21isdn(1593),
+ dsnm22isdn(1594),
+ mmfsdsas(1792),
+ mmfsddas(1793),
+ smfsdsas(1800),
+ smfsddas(1801),
+ mmscsas(1808),
+ mmscdas(1809),
+ smammbdas(1825),
+ mmasmbdas(1833),
+ mmfsdsashwf(1856),
+ mmfsddashwf(1857),
+ smfsdsashwf(1864),
+ smfsddashwf(1865),
+ mmscsashwf(1872),
+ mmscdashwf(1873),
+ smammbdashwf(1889),
+ mmasmbdashwf(1897),
+ dtnm(2048),
+ cam(2049),
+ se100nm(2304),
+ asnqbri(2560)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Module IDs for the net modules modules"
+ ::= { wfHwModuleEntry 3 }
+
+ wfHwModuleModRev OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the module. High byte is in upper 2 bytes."
+ ::= { wfHwModuleEntry 4 }
+
+ wfHwModuleModSerialNumber OBJECT-TYPE
+ SYNTAX OCTET STRING
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The serial number of the module."
+ ::= { wfHwModuleEntry 5 }
+
+ wfHwModuleArtworkRev OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The Artwork Revision number of the module"
+ ::= { wfHwModuleEntry 6 }
+
+ wfModuleTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF WfModuleEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "This table is used by the module driver for Barracuda"
+ ::= { wfHwModuleGroup 2 }
+
+ wfModuleEntry OBJECT-TYPE
+ SYNTAX WfModuleEntry
+ ACCESS not-accessible
+ STATUS mandatory
+ DESCRIPTION
+ "Hardware specific information about a slot."
+ INDEX { wfModuleSlot }
+ ::= { wfModuleTable 1 }
+
+ WfModuleEntry ::= SEQUENCE {
+ wfModuleDelete
+ INTEGER,
+ wfModuleSlot
+ INTEGER,
+ wfModuleTimerFrequency
+ INTEGER,
+ wfModuleBufferBalance
+ INTEGER,
+ wfModuleFddiWeight
+ INTEGER,
+ wfModuleTokenRingWeight
+ INTEGER,
+ wfModuleCsmacdWeight
+ INTEGER,
+ wfModuleSyncWeight
+ INTEGER,
+ wfModuleFreeBufferCredits
+ INTEGER,
+ wfModuleTotalBufferCredits
+ INTEGER,
+ wfModuleRestart
+ INTEGER,
+ wfModuleCsmacd100Weight
+ INTEGER
+ }
+
+ wfModuleDelete OBJECT-TYPE
+ SYNTAX INTEGER {
+ created(1),
+ deleted(2)
+ }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "create/delete parameter"
+ DEFVAL { created }
+ ::= { wfModuleEntry 1 }
+
+ wfModuleSlot OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A unique value for each slot.
+ Its value ranges between 1 and 14.
+ There are products in this family that contain 1, 5, and 14 slots."
+ ::= { wfModuleEntry 2 }
+
+ wfModuleTimerFrequency OBJECT-TYPE
+ SYNTAX INTEGER {
+ timerdefault(1)
+ }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "This value determines the frequency for the buffer balance
+ algorithm to run"
+ DEFVAL { timerdefault }
+ ::= { wfModuleEntry 3 }
+
+ wfModuleBufferBalance OBJECT-TYPE
+ SYNTAX INTEGER {
+ txrx(1),
+ none(2),
+ rx(3),
+ tx(4)
+ }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "Enable/Disable buffer balancing algorithm selectively"
+ DEFVAL { txrx }
+ ::= { wfModuleEntry 4 }
+
+ wfModuleFddiWeight OBJECT-TYPE
+ SYNTAX INTEGER(1..10)
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "This value determines the weight of the fddi line
+ for the buffer balancing algorithm"
+ DEFVAL { 6 }
+ ::= { wfModuleEntry 5 }
+
+ wfModuleTokenRingWeight OBJECT-TYPE
+ SYNTAX INTEGER(1..10)
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "This value determines the weight of the token-ring
+ for the buffer balancing algorithm"
+ DEFVAL { 4 }
+ ::= { wfModuleEntry 6 }
+
+ wfModuleCsmacdWeight OBJECT-TYPE
+ SYNTAX INTEGER(1..10)
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "This value determines the weight of the csmacd line
+ for the buffer balancing algorithm"
+ DEFVAL { 3 }
+ ::= { wfModuleEntry 7 }
+
+ wfModuleSyncWeight OBJECT-TYPE
+ SYNTAX INTEGER(1..10)
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "This value determines the weight of the sync line
+ for the buffer balancing algorithm"
+ DEFVAL { 2 }
+ ::= { wfModuleEntry 8 }
+
+ wfModuleFreeBufferCredits OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "This attribute indicates the number of buffers
+ available to line drivers but not used by them"
+ ::= { wfModuleEntry 9 }
+
+ wfModuleTotalBufferCredits OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "This attribute indicates the total number of buffers
+ available to line drivers"
+ ::= { wfModuleEntry 10 }
+
+ wfModuleRestart OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "This attribute should be touched after the queue
+ lengths are configured in the line-records"
+ ::= { wfModuleEntry 11 }
+
+ wfModuleCsmacd100Weight OBJECT-TYPE
+ SYNTAX INTEGER(1..10)
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "This value determines the weight of the csmacd 100MB line
+ for the buffer balancing algorithm"
+ DEFVAL { 6 }
+ ::= { wfModuleEntry 12 }
+
+ END -- Wellfleet-MODULE-MIB
+-- @(#)WSCCS h/mibs-sys.mib 1.1 8/30/95
+Wellfleet-SYS-MIB DEFINITIONS ::= BEGIN
+
+-- Created by mdl2asn version 3.1
+-- Creation date: Wed Aug 30 16:48:50 EDT 1995
+
+
+ IMPORTS
+
+ IpAddress, Counter, Gauge, TimeTicks, Opaque, enterprises, mgmt
+ FROM RFC1155-SMI
+ OBJECT-TYPE
+ FROM RFC-1212
+ TRAP-TYPE
+ FROM RFC-1215
+ DisplayString, mib-2
+ FROM RFC1213-MIB
+ wfSystem
+ FROM Wellfleet-COMMON-MIB;
+
+
+ wfSys OBJECT IDENTIFIER ::= { wfSystem 1 }
+
+ wfSysDescr OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A textual description of the entity including full name and version of
+ the system's hardware type, OS, and networking SW "
+ ::= { wfSys 1 }
+
+ wfSysObjectID OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Provides an unambiguous means for determining the MIB type (old product vs.
+ harpoon MIB)."
+ ::= { wfSys 2 }
+
+ wfSysUpTime OBJECT-TYPE
+ SYNTAX TimeTicks
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "Time in seconds/100 since the last cold start"
+ ::= { wfSys 3 }
+
+ wfSysContact OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "Contact person for this node and where/how to contact them"
+ ::= { wfSys 4 }
+
+ wfSysName OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "Node's fully qualified domain name or administratively assigned name"
+ ::= { wfSys 5 }
+
+ wfSysLocation OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "Physical Location of this Node"
+ ::= { wfSys 6 }
+
+ wfSysServices OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "A sum of numbers indicating the set of services the entity offers. For each
+ layer L, add 2**(L - 1). Example: 78 = Layers 2,3,4, and 7."
+ DEFVAL { 78 }
+ ::= { wfSys 7 }
+
+ wfSysGmtOffset OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The positive or negative offset from Greenwich Mean Time (GMT). This
+ effectively describes the time zone."
+ ::= { wfSys 8 }
+
+ wfSysMibVersion OBJECT-TYPE
+ SYNTAX DisplayString
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The version of the private management information base currently being
+ used by the system software. Format is: xV.RR"
+ ::= { wfSys 9 }
+
+ wfSysMibRevision OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "The revision level of the private management information base currently
+ being used by the system software."
+ ::= { wfSys 10 }
+
+ wfSysAgentType OBJECT-TYPE
+ SYNTAX INTEGER {
+ anrptragenttype(29),
+ anhubagenttype(30)
+ }
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "The network management agent's module type"
+ ::= { wfSys 11 }
+
+ wfSysMibCounterEnable OBJECT-TYPE
+ SYNTAX INTEGER {
+ enabled(1),
+ disabled(2)
+ }
+ ACCESS read-write
+ STATUS mandatory
+ DESCRIPTION
+ "Mib II counter Switch"
+ DEFVAL { enabled }
+ ::= { wfSys 12 }
+
+ END -- Wellfleet-SYS-MIB
diff --git a/perl/SNMP/t/mibload.t b/perl/SNMP/t/mibload.t
new file mode 100644
index 0000000..e44748a
--- /dev/null
+++ b/perl/SNMP/t/mibload.t
@@ -0,0 +1,95 @@
+#!./perl
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ eval "use Cwd qw(abs_path)";
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs");
+}
+
+use Test;
+BEGIN {plan tests => 7}
+use SNMP;
+
+require "t/startagent.pl";
+
+use vars qw($mibdir);
+
+$SNMP::verbose = 0;
+
+my $mib_file = 't/mib.txt';
+my $junk_mib_file = 'mib.txt';
+
+my $mibfile1;
+my @mibdir;
+my $mibfile2;
+
+if ($^O =~ /win32/i) {
+ $mibdir =~ s"/"\\"g;
+ $mibfile1 = "$mibdir\\TCP-MIB.txt";
+ @mibdir = ("$mibdir");
+ $mibfile2 = "$mibdir\\IPV6-TCP-MIB.txt";
+}
+else {
+ $mibfile1 = "$mibdir/TCP-MIB.txt";
+ @mibdir = ("$mibdir");
+ $mibfile2 = "$mibdir/IPV6-TCP-MIB.txt";
+}
+
+if ($^O =~ /win32/i) {
+ $mibdir =~ s"/"\\"g;
+}
+
+
+######################################################################
+# See if we can find a mib to use, return of 0 means the file wasn't
+# found or isn't readable.
+
+$res = SNMP::setMib($junk_mib_file,1);
+ok(defined(!$res));
+######################################################################
+# Now we give the right name
+
+$res = SNMP::setMib($mib_file,1);
+ok(defined($res));
+######################################################################
+# See if we can find a mib to use
+
+$res = SNMP::setMib($mib_file,0);
+ok(defined($res));
+######################## 4 ################################
+# add a mib dir
+
+$res = SNMP::addMibDirs($mibdir[0]);
+
+SNMP::loadModules("IP-MIB", "IF-MIB", "IANAifType-MIB", "RFC1213-MIB");
+#SNMP::unloadModules(RMON-MIB);
+#etherStatsDataSource shouldn't be found.
+#present only in 1271 & RMON-MIB.
+#
+# XXX: because we can't count on user .conf files, we should turn off
+# support for them (maybe set SNMPCONFPATH at the top of this
+# script?). But for the mean time just search for a bogus node that
+# will never exist.
+$res = $SNMP::MIB{bogusetherStatsDataSource};
+
+ok(!defined($res));
+
+######################## 5 ############################
+# add mib file
+
+$res1 = SNMP::addMibFiles($mibfile1);
+ok(defined($res1));
+$res2 = SNMP::addMibFiles($mibfile2);
+ok(defined($res2));
+
+$res = $SNMP::MIB{ipv6TcpConnState}{moduleID};
+
+ok($res =~ /^IPV6-TCP-MIB/);
+#################################################
+
+snmptest_cleanup();
+
diff --git a/perl/SNMP/t/notify.t b/perl/SNMP/t/notify.t
new file mode 100644
index 0000000..72600fa
--- /dev/null
+++ b/perl/SNMP/t/notify.t
@@ -0,0 +1,106 @@
+#!./perl
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ eval "use Cwd qw(abs_path)";
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs");
+}
+use Test;
+BEGIN { $n = 11; plan tests => $n }
+use SNMP;
+use vars qw($agent_port $comm $comm2 $trap_port $agent_host $sec_name $priv_pass $auth_pass $bad_name);
+require 't/startagent.pl';
+$SNMP::debugging = 0;
+
+my $res;
+my $enterprise = '.1.3.6.1.2.1.1.1.0';
+my $generic = 'specific';
+
+# V1 trap testing
+######################## 1 ############################
+# Fire up a trap session.
+my $s1 =
+ new SNMP::Session (DestHost=>$agent_host,Version=>1,Community=>$comm,RemotePort=>$trap_port);
+ok(defined($s1));
+
+######################## 2 ############################
+# test v1 trap
+if (defined($s1)) {
+ $res = $s1->trap(enterprise => $enterprise, agent=>$agent_host, generic=>$generic,[[sysContact, 0, 'root@localhost'], [sysLocation, 0, 'here']] );
+}
+ok($res =~ /^0 but true/);
+
+######################## 3 ############################
+# test with wrong varbind
+undef $res;
+if (defined($s1)) {
+ $res = $s1->trap([[$bad_name, 0, 'root@localhost'], [sysLocation, 0, 'here']] );
+ #print("res is $res\n");
+}
+ok(!defined($res));
+#########################################################
+
+# V2 testing
+######################## 4 ############################
+# Fire up a v2 trap session.
+my $s2 =
+ new SNMP::Session (Version=>2, DestHost=>$agent_host,Community=>$comm2,RemotePort=>$trap_port);
+ok(defined($s2));
+######################## 5 ############################
+# test v2 trap
+undef $res;
+if (defined($s2)) {
+ $res = $s2->trap(uptime=>200, trapoid=>'coldStart',[[sysContact, 0, 'root@localhost'], [sysLocation, 0, 'here']] );
+ #print("res is $res\n");
+}
+ok($res =~ /^0 but true/);
+######################## 6 ############################
+# no trapoid and uptime given. Should take defaults...
+my $ret;
+if (defined($s2)) {
+ $ret = $s2->trap([[sysContact, 0, 'root@localhost'], [sysLocation, 0, 'here']] );
+ #print("res is $ret\n");
+}
+ok(defined($ret));
+######################## 7 ############################
+# no varbind list given.
+undef $res;
+if (defined($s2)) {
+ $res = $s2->trap(trapoid=>'coldStart');
+ #print("res is $res\n");
+}
+ok(defined($res) && $res =~ /^0 but true/);
+
+#########################################################
+
+# v3 testing
+######################## 8 ############################
+# Fire up a v3 trap session.
+my $s3 = new SNMP::Session(Version=>3, DestHost=> $agent_host, RemotePort=>$trap_port, SecName => $sec_name);
+ok(defined($s3));
+
+######################## 9 ############################
+if (defined($s3)) {
+ $res = $s3->inform(uptime=>111, trapoid=>'coldStart', [[sysContact, 0, 'root@localhost'], [sysLocation, 0, 'here']] );
+}
+ok($res =~ /^0 but true/);
+
+######################## 10 ############################
+# Fire up a v3 trap session.
+$s3 = new SNMP::Session(Version=>3, DestHost=> $agent_host, RemotePort=>$trap_port, SecName => $sec_name, SecLevel => authPriv, AuthPass => $auth_pass, PrivPass => $priv_pass);
+ok(defined($s3));
+
+######################## 11 ############################
+undef $res;
+if (defined($s3)) {
+ $res = $s3->inform(uptime=>111, trapoid=>'coldStart', [[sysContact, 0, 'root@localhost'], [sysLocation, 0, 'here']] );
+ print "res = $res\n";
+}
+
+ok(defined($res) && ($res =~ /^0 but true/));
+
+snmptest_cleanup();
diff --git a/perl/SNMP/t/session.t b/perl/SNMP/t/session.t
new file mode 100644
index 0000000..3f51386
--- /dev/null
+++ b/perl/SNMP/t/session.t
@@ -0,0 +1,76 @@
+#!./perl
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ eval "use Cwd qw(abs_path)";
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs");
+}
+use Test;
+BEGIN { plan tests => 5}
+use SNMP;
+use vars qw($agent_port $comm $agent_host $bad_auth_pass $auth_pass $sec_name $bad_sec_name $bad_version $bad_priv_pass $priv_pass);
+require "t/startagent.pl";
+
+$SNMP::debugging = 0;
+
+# create list of varbinds for GETS, val field can be null or omitted
+my $vars = new SNMP::VarList (
+ ['sysDescr', '0', ''],
+ ['sysContact', '0'],
+ ['sysName', '0'],
+ ['sysLocation', '0'],
+ ['sysServices', '0'],
+ ['ifNumber', '0'],
+ ['ifDescr', '1'],
+ ['ifSpeed', '1'],
+ );
+
+#########################== 1 ===#########################################
+# Create a bogus session, undef means the host can't be found.
+# removed! this test can hang for a long time if DNS is not functioning
+# my $s1 = new SNMP::Session (DestHost => $bad_host );
+# ok(!defined($s1));
+#print("\n");
+#####################== 2 ====############################################
+# Fire up a session.
+ my $s2 =
+ new SNMP::Session (DestHost=>$agent_host, Community=>$comm,
+ RemotePort=>$agent_port);
+ ok(defined($s2));
+######################== 3 ==== ##########################################
+
+# Fire up a V3 session
+my $s3 = new SNMP::Session (Version => 3 , RemotePort => $agent_port,
+ SecName => $sec_name );
+ok(defined($s3));
+#print STDERR "Error string1 = $s3->{ErrorStr}:$s3->{ErrorInd}\n";
+#print("\n");
+#####################=== 4 ====###########################################
+#create a V3 session by setting an IP address/port not running an agent
+my $s4 = new SNMP::Session (Version => 3, RemotePort => 1002, Retries => 0);
+# engineId discovery should fail resulting in session creation failure (undef)
+ok(!defined($s4));
+#print STDERR "Error string1 = $s4->{ErrorStr}:$s4->{ErrorInd}\n";
+#print("\n");
+###################### 5 ###########################################
+#create a session with bad version
+my $s5 = new SNMP::Session (Version=>$bad_version);
+ok(!defined($s5));
+#print("\n");
+######################## 6 ########################################
+#Test for v3 session creation success
+my $s6 = new SNMP::Session (Version => 3, RemotePort => $agent_port,
+ SecLevel => 'authPriv',
+ SecName => $sec_name,
+ PrivPass => $priv_pass,
+ AuthPass => $auth_pass);
+ok(defined($s6));
+#print STDERR "Error string2 = $s6->{ErrorStr}:$s6->{ErrorInd}\n";
+#print("\n");
+##################### 7 ############################################
+
+snmptest_cleanup();
diff --git a/perl/SNMP/t/set.t b/perl/SNMP/t/set.t
new file mode 100644
index 0000000..9925654
--- /dev/null
+++ b/perl/SNMP/t/set.t
@@ -0,0 +1,224 @@
+#!./perl
+
+BEGIN {
+ unless(grep /blib/, @INC) {
+ chdir 't' if -d 't';
+ @INC = '../lib' if -d '../lib';
+ }
+ eval "use Cwd qw(abs_path)";
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBDIRS'} = '+' . abs_path("../../mibs");
+}
+use Test;
+BEGIN { plan tests => 7 }
+use SNMP;
+use vars qw($agent_port $comm $agent_host);
+require "t/startagent.pl";
+
+
+my $junk_oid = ".1.3.6.1.2.1.1.1.1.1.1";
+my $oid = ".1.3.6.1.2.1.1.1";
+my $junk_name = 'fooDescr';
+my $junk_host = 'no.host.here';
+my $name = "gmarzot\@nortelnetworks.com";
+
+$SNMP::debugging = 0;
+$n = 15; # Number of tests to run
+
+#print "1..$n\n";
+if ($n == 0) { exit 0; }
+
+# create list of varbinds for GETS, val field can be null or omitted
+my $vars = new SNMP::VarList (
+ ['sysDescr', '0', ''],
+ ['sysObjectID', '0'],
+ ['sysUpTime', '0'],
+ ['sysContact', '0'],
+ ['sysName', '0'],
+ ['sysLocation', '0'],
+ ['sysServices', '0'],
+ ['ifNumber', '0'],
+ ['ifDescr', '1'],
+ ['ifSpeed', '1'],
+
+ ['snmpInPkts', '0'],
+ ['snmpInBadVersions', '0'],
+ ['snmpInBadCommunityNames', '0'],
+ ['snmpInBadCommunityUses', '0'],
+ ['snmpInASNParseErrs', '0'],
+ ['snmpEnableAuthenTraps', '0'],
+# ['snmpSilentDrops', '0'],
+# ['snmpProxyDrops', '0'],
+# ['snmpTrapEnterprise', '2'],
+
+# ['hrStorageType', '2'],
+# ['hrSystemDate', '0'],
+ ['sysORIndex', '1'],
+ ['sysORID', '2'],
+ ['sysORDescr', '3'],
+ ['sysORUpTime', '4'],
+# ['ifName', '1'],
+ ['sysORLastChange', '0'],
+ ['ipInHdrErrors', '0'],
+ ['ipDefaultTTL', '0'],
+ ['ipInHdrErrors', '0'],
+ );
+################################################################
+# ['ipNetToMediaPhysAddress', '0'],
+# ['ipAdEntAddr', '0'],
+# ['snmpTrapOID', '0'],
+# ['hrSystemNumUsers', '0'],
+# ['hrFSLastFullBackupDate', '0'],
+# ['ifPromiscuousMode', '0'],
+
+
+
+######################### 1 #######################################
+# Fire up a session.
+ my $s1 =
+ new SNMP::Session (DestHost=>$agent_host,Version=>1,Community=>$comm,RemotePort=>$agent_port);
+ ok(defined($s1));
+
+####################### 2 ##########################################
+# Set some value and see if the value is set properly.
+
+$originalLocation = $s1->get('sysLocation.0');
+$value = 'Router Management Labs';
+$s1->set('sysLocation.0', $value);
+$finalvalue = $s1->get('sysLocation.0');
+ok($originalLocation ne $finalvalue);
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("set value is: $finalvalue\n\n");
+$s1->set('sysLocation.0', $originalLocation);
+
+######################## 3 #######################################
+
+# Now, reset that string with a non-string value.
+# This will FAIL. :)
+
+#$nonstrvalue = '.9.23.56.7';
+#$s1->set('sysLocation.0', $nonstrvalue);
+#$finalvalue = $s1->get('sysLocation.0');
+#ok(!defined($finalvalue));
+
+#if (($initialvalue cmp $finalvalue) != 0 ) {
+# ok(1);
+#}
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("set value is: $finalvalue\n\n");
+#$s1->set('sysLocation.0', $originalLocation);
+
+####################### 4 #####################################
+
+# Test for an integer (READ-ONLY)
+$originalservice = $s1->get('sysServices.0');
+#print("services is: $originalservice\n");
+$junk_service = "Nortel Networks";
+$s1->set('sysServices.0', $junk_service);
+
+$finalvalue = $s1->get('sysServices.0');
+#print("services is: $finalvalue\n");
+#print("Services is: $originalservice\n");
+ok($originalservice eq $finalvalue);
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+$s1->set('sysServices.0',$originalservice);
+#print("\n");
+
+################## 5 ######################
+# Test for an integer (READ-WRITE)
+# The snmpEnableAuthenTraps takes only two values - 1 and 2.
+# If any other value is tried to be set, it doesn't set and
+# retains the old value.
+
+$originalTrap = $s1->get('snmpEnableAuthenTraps.0');
+#print("trap is -- $originalTrap\n");
+$junk_trap = "Nortel Networks";
+$s1->set('snmpEnableAuthenTraps.0', $junk_trap);
+$finalvalue = $s1->get('snmpEnableAuthenTraps.0');
+#print("final trap is: $finalvalue\n");
+ok($finalvalue ne $junk_trap);
+# Should the error be 'Value out of range: SNMPERR_RANGE ?
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+$s1->set('snmpEnableAuthenTraps.0',$originalTrap);
+#print("\n");
+################### 6 #######################
+# Test for a TimeTicks (is this advisable? )
+# Trying to set uptime which cannot be done (READ-ONLY).
+#$time = $s1->get('sysUpTime.0');
+#print("up time is : $time hundredths of a second\n");
+#$junk_time = 12345;
+#$s1->set('sysUpTime.0', $junk_time);
+#$finalvalue = $s1->get('sysUpTime.0');
+#print("final time is: $finalvalue hundredths of a second \n");
+# Will the final value always be equal to the initial value?
+# depends on how fast this piece of code executes?
+#ok($finalvalue == $time);
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("\n");
+
+################### 7 ######################
+
+
+#Test for a Counter32 type.
+# READ-ONLY.
+
+#$Pkts = $s1->get('snmpInPkts.0');
+#print(" pkts is : $Pkts\n");
+#$junk_pkts = -1234;
+#$s1->set('snmpInPkts.0', $junk_pkts);
+#$finalPkts = $s1->get('snmpInPkts.0');
+#print("now pkts is : $finalPkts\n");
+#ok($finalPkts > $Pkts);
+# Expecting genErr
+#ok($s1->{ErrorStr} =~ /^\(gen/);
+#print STDERR "pkts is = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("\n");
+################## 8 ##############################
+
+# Set a non-accessible attribute
+$s1->set('ipAddrEntry.1', 'MyEID');
+# What should I expect - genErr or Bad variable type ?
+# What gets checked first - type or accessibility?
+# if type, then this is right..else, genErr is expected.
+ok($s1->{ErrorStr} =~ /^Bad/ );
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("\n");
+
+################# 12 ##########################
+# Time stamp test - READ-ONLY
+#$origtime = $s1->get('sysORLastChange.0');
+#print("Time is: $origtime\n");
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#$time = $s1->set('sysORLastChange.0', 12345);
+#print("time stamp is : $time \n");
+# Should get genErr.
+#ok($time =~ /^genErr/);
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("\n");
+
+############## 13 ############################
+
+# OID test
+my $oldoid = $s1->get("sysORID.1");
+#print("OID is : $oldoid\n");
+$junk_OID = ".6.6.6.6.6.6";
+$s1->set('sysORID.1', $junk_OID);
+$newOID = $s1->get("sysORID.1");
+#print("new oid is $newOID\n");
+ok($oldoid eq $newOID);
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+#print("\n");
+################ 14 ##########################
+
+# Try setting an unregistered OID.
+$junk_data = 'hehehe';
+$s1->set('ifmyData.0', $junk_data);
+
+#print STDERR "Error string = $s1->{ErrorStr}:$s1->{ErrorInd}\n";
+ok( $s1->{ErrorStr} =~ /^Unknown/ );
+
+##############################################
+
+snmptest_cleanup();
+
+
diff --git a/perl/SNMP/t/snmptest.conf b/perl/SNMP/t/snmptest.conf
new file mode 100644
index 0000000..355e310
--- /dev/null
+++ b/perl/SNMP/t/snmptest.conf
@@ -0,0 +1,21 @@
+sysservices 72
+
+createUser v3_user MD5 test_pass_auth DES test_pass_priv
+
+# sec.name source community
+com2sec v2c_user default v2c_private
+com2sec v1_user default v1_private
+com2sec v3_user default v3_private
+
+# sec.model sec.name
+group v2c_group v2c v2c_user
+group v1_group v1 v1_user
+group v3_group usm v3_user
+
+# incl/excl subtree mask
+view all included .1 80
+
+# context sec.model sec.level match read write notif
+access v2c_group "" any noauth exact all all all
+access v1_group "" any noauth exact all all all
+access v3_group "" any noauth exact all all all
diff --git a/perl/SNMP/t/startagent.pl b/perl/SNMP/t/startagent.pl
new file mode 100644
index 0000000..3e92c12
--- /dev/null
+++ b/perl/SNMP/t/startagent.pl
@@ -0,0 +1,125 @@
+# common parameters used in SNMP::Session creation and tests
+$agent_host = 'localhost';
+$agent_port = 8765;
+$trap_port = 8764;
+$mibdir = '/usr/local/share/snmp/mibs';
+$comm = 'v1_private';
+$comm2 = 'v2c_private';
+$comm3 = 'v3_private';
+$sec_name = 'v3_user';
+$oid = '.1.3.6.1.2.1.1.1';
+$name = 'sysDescr';
+$name_module = 'RFC1213-MIB::sysDescr';
+$name_module2 = 'SNMPv2-MIB::sysDescr';
+$name_long = '.iso.org.dod.internet.mgmt.mib-2.system.sysDescr';
+$name_module_long = 'RFC1213-MIB::.iso.org.dod.internet.mgmt.mib-2.system.sysDescr';
+$name_module_long2 = 'SNMPv2-MIB::.iso.org.dod.internet.mgmt.mib-2.system.sysDescr';
+$auth_pass = 'test_pass_auth';
+$priv_pass = 'test_pass_priv';
+
+# don't use any .conf files other than those specified.
+$ENV{'SNMPCONFPATH'} |= "bogus";
+
+# erroneous input to test failure cases
+$bad_comm = 'BAD_COMMUNITY';
+$bad_name = "badName";
+$bad_oid = ".1.3.6.1.2.1.1.1.1.1.1";
+$bad_host = 'bad.host.here';
+$bad_port = '9999999';
+$bad_auth_pass = 'bad_auth_pass';
+$bad_priv_pass = 'bad_priv_pass';
+$bad_sec_name = 'bad_sec_name';
+$bad_version = 7;
+
+local $snmpd_cmd;
+local $snmptrapd_cmd;
+my $line;
+
+if ($^O =~ /win32/i) {
+ require Win32::Process;
+}
+
+sub run_async {
+ my ($pidfile, $cmd, @args) = @_;
+ if (-r "$cmd" and -x "$cmd") {
+ if ($^O =~ /win32/i) {
+ $cmd =~ s/\//\\/g;
+ system "start \"$cmd\" /min cmd /c \"$cmd @args 2>&1\"";
+ } else {
+ system "$cmd @args 2>&1";
+ }
+ # Wait at most three seconds for the pid file to appear.
+ for ($i = 0; ($i < 3) && ! (-r "$pidfile"); ++$i) {
+ sleep 1;
+ }
+ } else {
+ warn "Couldn't run $cmd\n";
+ }
+}
+
+sub snmptest_cleanup {
+ kill_by_pid_file("t/snmpd.pid");
+ unlink("t/snmpd.pid");
+ kill_by_pid_file("t/snmptrapd.pid");
+ unlink("t/snmptrapd.pid");
+}
+
+sub kill_by_pid_file {
+ if ((-e "$_[0]") && (-r "$_[0]")) {
+ if ($^O !~ /win32/i) {
+ # Unix or Windows + Cygwin.
+ system "kill `cat $_[0]` > /dev/null 2>&1";
+ } else {
+ # Windows + MSVC or Windows + MinGW.
+ open(H, "<$_[0]");
+ my $pid = (<H>);
+ close (H);
+ if ($pid > 0) {
+ Win32::Process::KillProcess($pid, 0)
+ }
+ }
+ }
+}
+
+
+# Stop any processes started during a previous test.
+snmptest_cleanup();
+
+#Open the snmptest.cmd file and get the info
+if (open(CMD, "<t/snmptest.cmd")) {
+ while ($line = <CMD>) {
+ if ($line =~ /HOST\s*=>\s*(.*?)\s+$/) {
+ $agent_host = $1;
+ } elsif ($line =~ /MIBDIR\s*=>\s*(.*?)\s+$/) {
+ $mibdir = $1;
+ } elsif ($line =~ /AGENT_PORT\s*=>\s*(.*?)\s+$/) {
+ $agent_port = $1;
+ } elsif ($line =~ /SNMPD\s*=>\s*(.*?)\s+$/) {
+ $snmpd_cmd = $1;
+ } elsif ($line =~ /SNMPTRAPD\s*=>\s*(.*?)\s+$/) {
+ $snmptrapd_cmd = $1;
+ }
+ } # end of while
+ close CMD;
+} else {
+ die ("Could not start agent. Couldn't find snmptest.cmd file\n");
+}
+
+# Start snmpd and snmptrapd.
+
+#warn "\nStarting agents for test script $0\n";
+
+my $scriptname = "snmptest";
+if ($0 =~ /^t[\/\\](.*)\.t$/) {
+ $scriptname = $1;
+}
+
+if ($snmpd_cmd) {
+ run_async("t/snmpd.pid", "$snmpd_cmd", "-r -d -Lf t/snmpd-$scriptname.log -M+$mibdir -C -c t/snmptest.conf -p t/snmpd.pid ${agent_host}:${agent_port} >t/snmpd-$scriptname.stderr");
+}
+if ($snmptrapd_cmd) {
+ run_async("t/snmptrapd.pid", "$snmptrapd_cmd", "-d -Lf t/snmptrapd-$scriptname.log -p t/snmptrapd.pid -M+$mibdir -C -c t/snmptest.conf -C ${agent_host}:${trap_port} >t/snmptrapd-$scriptname.stderr");
+}
+
+1;
+
diff --git a/perl/SNMP/typemap b/perl/SNMP/typemap
new file mode 100644
index 0000000..f5e9826
--- /dev/null
+++ b/perl/SNMP/typemap
@@ -0,0 +1,2 @@
+SnmpSession * T_PTROBJ
+SnmpMibNode * T_PTROBJ
diff --git a/perl/TrapReceiver/Changes b/perl/TrapReceiver/Changes
new file mode 100644
index 0000000..cbdcdcd
--- /dev/null
+++ b/perl/TrapReceiver/Changes
@@ -0,0 +1,8 @@
+Revision history for Perl extension NetSNMP::TrapReceiver.
+
+(Please see the Net-SNMP ChangeLog file for complete details)
+
+5.2 Fri Feb 6 15:58:25 2004
+ - original version; created by h2xs 1.22 with options
+ -a -b 5.0.6 -O -n NetSNMP::TrapReceiver -x perl_snmptrapd.h
+
diff --git a/perl/TrapReceiver/MANIFEST b/perl/TrapReceiver/MANIFEST
new file mode 100644
index 0000000..469bb23
--- /dev/null
+++ b/perl/TrapReceiver/MANIFEST
@@ -0,0 +1,12 @@
+Changes
+Makefile.PL
+MANIFEST
+perl_snmptrapd.h
+ppport.h
+README
+TrapReceiver.pm
+TrapReceiver.xs
+typemap
+t/1.t
+fallback/const-c.inc
+fallback/const-xs.inc
diff --git a/perl/TrapReceiver/Makefile.PL b/perl/TrapReceiver/Makefile.PL
new file mode 100644
index 0000000..874ee21
--- /dev/null
+++ b/perl/TrapReceiver/Makefile.PL
@@ -0,0 +1,273 @@
+use ExtUtils::MakeMaker;
+require 5;
+use Config;
+use Getopt::Long;
+my $lib_version;
+my %MakeParams = ();
+
+%MakeParams = InitMakeParams();
+
+WriteMakefile(%MakeParams);
+
+Check_Version();
+
+if (eval {require ExtUtils::Constant; 1}) {
+ # If you edit these definitions to change the constants used by this module,
+ # you will need to use the generated const-c.inc and const-xs.inc
+ # files to replace their "fallback" counterparts before distributing your
+ # changes.
+ my @names = (qw(NETSNMPTRAPD_AUTH_HANDLER NETSNMPTRAPD_HANDLER_BREAK
+ NETSNMPTRAPD_HANDLER_FAIL NETSNMPTRAPD_HANDLER_FINISH
+ NETSNMPTRAPD_HANDLER_OK NETSNMPTRAPD_POST_HANDLER
+ NETSNMPTRAPD_PRE_HANDLER));
+ ExtUtils::Constant::WriteConstants(
+ NAME => 'NetSNMP::TrapReceiver',
+ NAMES => \@names,
+ DEFAULT_TYPE => 'IV',
+ C_FILE => 'const-c.inc',
+ XS_FILE => 'const-xs.inc',
+ );
+
+} else {
+ use File::Copy;
+ use File::Spec;
+ foreach my $file ('const-c.inc', 'const-xs.inc') {
+ my $fallback = File::Spec->catfile('fallback', $file);
+ copy ($fallback, $file) or die "Can't copy $fallback to $file: $!";
+ }
+}
+
+sub InitMakeParams {
+ my $opts;
+ my %Params = (
+ 'NAME' => 'NetSNMP::TrapReceiver',
+ 'VERSION_FROM' => 'TrapReceiver.pm', # finds $VERSION
+ 'XSPROTOARG' => '-prototypes',
+ 'PREREQ_PM' => { NetSNMP::OID => 5.02 },
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT_FROM => 'TrapReceiver.pm',
+ AUTHOR =>
+ 'W. Hardaker <hardaker@users.sourceforge.net>') : ()),
+ 'INC' => '-I.', # e.g., '-I. -I/usr/include/other'
+ );
+
+
+ if ($ENV{'OSTYPE'} eq 'msys') {
+ $Params{'DEFINE'} = "-DMINGW_PERL";
+ }
+
+ my ($snmp_lib, $snmp_llib, $sep);
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+ $opts = NetSNMPGetOpts();
+ $Params{'DEFINE'} = "-DMSVC_PERL -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS";
+ $sep = '\\';
+ $snmp_lib_file = 'netsnmp.lib';
+ $snmp_link_lib = 'netsnmp';
+ $agent_link_lib = 'netsnmpagent';
+ $mibs_link_lib = 'netsnmpmibs';
+ $trapd_link_lib = 'netsnmptrapd';
+
+ if (lc($opts->{'debug'}) eq "true") {
+ $lib_dir = 'lib\\debug';
+ }
+ else {
+ $lib_dir = 'lib\\release';
+ }
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L$basedir\\win32\\$lib_dir\\ -l$snmp_link_lib -l$agent_link_lib " .
+ "-l$mibs_link_lib -l$trapd_link_lib ";
+ }
+ else {
+ my @LibDirs = split (';',$ENV{LIB});
+ my $LibDir;
+ if ($opts->{'prefix'}) {
+ push (@LibDirs,"$ENV{'NET-SNMP-PATH'}${sep}lib");
+ }
+ $noLibDir = 1;
+ while ($noLibDir) {
+ $LibDir = find_files(["$snmp_lib_file"],\@LibDirs);
+ if ($LibDir ne '') {
+ $noLibDir = 0;
+ # Put quotes around LibDir to allow spaces in paths
+ $LibDir = '"' . $LibDir . '"';
+ }
+ else
+ {
+ @LibDirs = ();
+ $LibDirs[0] = prompt("The Net-SNMP library ($snmp_lib_file) could not be found.\nPlease enter the directory where it is located:");
+ $LibDirs[0] =~ s/\\$//;
+ }
+ }
+ $Params{LIBS} = "-L$LibDir -l$snmp_link_lib -l$agent_link_lib -l$mibs_link_lib -l$trapd_link_lib ";
+ }
+
+ $Params{'INC'} = "-I$basedir\\include\\ -I$basedir\\include\\net-snmp\\ -I$basedir\\win32\\ ";
+ }
+ else {
+ $opts = NetSNMPGetOpts();
+ $Params{'LDDLFLAGS'} = "$Config{lddlflags} " . `$opts->{'nsconfig'} --ldflags`;
+ $Params{'LIBS'} = '-lnetsnmptrapd ' . `$opts->{'nsconfig'} --base-agent-libs`;
+ chomp($Params{'LIBS'});
+ if (!$ENV{'NETSNMP_CCFLAGS'}) {
+ $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
+ chomp($Params{'CCFLAGS'});
+ $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
+ } else {
+ $Params{'CCFLAGS'} = $ENV{'NETSNMP_CCFLAGS'};
+ }
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L../../apps/.libs -L../../apps -L../../agent/.libs -L../../agent -L../../snmplib/.libs -L../../snmplib " . $Params{'LIBS'};
+ $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
+ } else {
+ $Params{'LIBS'} = `$opts->{'nsconfig'} --libdir` . " $Params{'LIBS'}";
+ }
+
+ $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ if ($Params{'CCFLAGS'} eq "") {
+ die "You need to install net-snmp first (I can't find net-snmp-config)";
+ }
+ $lib_version = `$opts->{'nsconfig'} --version`;
+ }
+
+ return(%Params);
+}
+# common subroutines -- DO NOT EDIT.
+# They are imported from the Makefile.subs.pl file
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ # we allow for perl/CPAN-only revisions beyond the default
+ # version formatting of net-snmp itself.
+ $perlver =~ s/(\.\d{5}).*/\1/;
+ $perlver =~ s/0*$//;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/TrapReceiver/README b/perl/TrapReceiver/README
new file mode 100644
index 0000000..f1ce9fc
--- /dev/null
+++ b/perl/TrapReceiver/README
@@ -0,0 +1,30 @@
+NetSNMP/TrapReceiver version 5.2
+=================================
+
+This module will only work if Net-SNMP was compiled with
+--enable-embedded-perl and you follow the instructions in the perldoc
+manual page.
+
+INSTALLATION
+
+To install this module type the following in the Net-SNMP source directory:
+
+ ./configure --enable-embedded-perl
+ make
+ make install
+
+DEPENDENCIES
+
+This module requires these other modules and libraries:
+
+ Net-SNMP, NetSNMP::OID
+
+COPYRIGHT AND LICENCE
+
+Put the correct copyright and licence information here.
+
+Copyright (C) 2004 W. Hardaker
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
diff --git a/perl/TrapReceiver/TrapReceiver.pm b/perl/TrapReceiver/TrapReceiver.pm
new file mode 100644
index 0000000..e7e2921
--- /dev/null
+++ b/perl/TrapReceiver/TrapReceiver.pm
@@ -0,0 +1,286 @@
+package NetSNMP::TrapReceiver;
+
+use 5.00006;
+use strict;
+use Carp;
+
+require Exporter;
+require DynaLoader;
+
+use AutoLoader;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
+@ISA = qw(Exporter
+ DynaLoader);
+
+require NetSNMP::OID;
+
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration use NetSNMP::TrapReceiver ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+%EXPORT_TAGS = ( 'all' => [ qw(
+ NETSNMPTRAPD_AUTH_HANDLER
+ NETSNMPTRAPD_HANDLER_BREAK
+ NETSNMPTRAPD_HANDLER_FAIL
+ NETSNMPTRAPD_HANDLER_FINISH
+ NETSNMPTRAPD_HANDLER_OK
+ NETSNMPTRAPD_POST_HANDLER
+ NETSNMPTRAPD_PRE_HANDLER
+ netsnmp_add_default_traphandler
+ netsnmp_add_global_traphandler
+ netsnmp_add_traphandler
+) ] );
+
+@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+@EXPORT = qw(
+ NETSNMPTRAPD_AUTH_HANDLER
+ NETSNMPTRAPD_HANDLER_BREAK
+ NETSNMPTRAPD_HANDLER_FAIL
+ NETSNMPTRAPD_HANDLER_FINISH
+ NETSNMPTRAPD_HANDLER_OK
+ NETSNMPTRAPD_POST_HANDLER
+ NETSNMPTRAPD_PRE_HANDLER
+);
+
+$VERSION = '5.0702';
+
+# sub new {
+# my $type = shift;
+# my ($self);
+# %$self = @_;
+# bless($self, $type);
+# return $self;
+# }
+
+# sub register($$$$) {
+# my ($self, $oid, $sub) = @_;
+# my $reg = NetSNMP::TrapReceiver::registration::new($oid, $sub);
+# if ($reg) {
+# $reg->register();
+# $self->{'regobjs'}{$name} = $reg;
+# }
+# return $reg;
+# }
+
+sub AUTOLOAD {
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function.
+
+ my $constname;
+ ($constname = $AUTOLOAD) =~ s/.*:://;
+ croak "&NetSNMP::TrapReceiver::constant not defined" if $constname eq 'constant';
+ my ($error, $val) = constant($constname);
+ if ($error) { croak $error; }
+ {
+ no strict 'refs';
+ # Fixed between 5.005_53 and 5.005_61
+#XXX if ($] >= 5.00561) {
+#XXX *$AUTOLOAD = sub () { $val };
+#XXX }
+#XXX else {
+ *$AUTOLOAD = sub { $val };
+#XXX }
+ }
+ goto &$AUTOLOAD;
+}
+
+bootstrap NetSNMP::TrapReceiver $VERSION;
+
+# Preloaded methods go here.
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+
+=head1 NAME
+
+NetSNMP::TrapReceiver - Embedded perl trap handling for Net-SNMP's snmptrapd
+
+=head1 SYNOPSIS
+
+Put the following lines in your snmptrapd.conf file:
+
+ perl NetSNMP::TrapReceiver::register("trapOID", \&myfunc);
+
+=head1 ABSTRACT
+
+The NetSNMP::TrapReceiver module is used to register perl
+subroutines into the Net-SNMP snmptrapd process. Net-SNMP MUST have
+been configured using --enable-embedded-perl. Registration of
+functions is then done through the snmptrapd.conf configuration
+file. This module can NOT be used in a normal perl script to
+receive traps. It is intended solely for embedded use within the
+snmptrapd demon.
+
+=head1 DESCRIPTION
+
+Within the snmptrapd.conf file, the keyword "perl" may be used to call
+any perl expression and using this ability, you can use the
+NetSNMP::TrapReceiver module to register functions which will be
+called every time a given notification (a trap or an inform) is
+received. Registered functions are called with 2 arguments. The
+first is a reference to a hash containing information about how the
+trap was received (what version of the SNMP protocol was used, where
+it came from, what SNMP user name or community name it was sent under,
+etc). The second argument is a reference to an array containing the
+variable bindings (OID and value information) that define the
+noification itself. Each variable is itself a reference to an array
+containing three values: a NetSNMP::OID object, the value that came
+associated with it, and the value's numeric type (see NetSNMP::ASN for
+further details on SNMP typing information).
+
+Registered functions should return one of the following values:
+
+=over 2
+
+=item NETSNMPTRAPD_HANDLER_OK
+
+Handling the trap succeeded, but lets the snmptrapd demon check for
+further appropriate handlers.
+
+=item NETSNMPTRAPD_HANDLER_FAIL
+
+Handling the trap failed, but lets the snmptrapd demon check for
+further appropriate handlers.
+
+=item NETSNMPTRAPD_HANDLER_BREAK
+
+Stops evaluating the list of handlers for this specific trap, but lets
+the snmptrapd demon apply global handlers.
+
+=item NETSNMPTRAPD_HANDLER_FINISH
+
+Stops searching for further appropriate handlers.
+
+=back
+
+If a handler function does not return anything appropriate or even
+nothing at all, a return value of NETSNMPTRAPD_HANDLER_OK is assumed.
+
+Subroutines are registered using the NetSNMP::TrapReceiver::register
+function, which takes two arguments. The first is a string describing
+the notification you want to register for (such as "linkUp" or
+"MyMIB::MyTrap" or ".1.3.6.1.4.1.2021...."). Two special keywords can
+be used in place of an OID: "default" and "all". The "default"
+keyword indicates you want your handler to be called in the case where
+no other handlers are called. The "all" keyword indicates that the
+handler should ALWAYS be called for every notification.
+
+
+=head1 EXAMPLE
+
+As an example, put the following code into a file (say
+"/usr/local/share/snmp/mytrapd.pl"):
+
+ #!/usr/bin/perl
+
+ sub my_receiver {
+ print "********** PERL RECEIVED A NOTIFICATION:\n";
+
+ # print the PDU info (a hash reference)
+ print "PDU INFO:\n";
+ foreach my $k(keys(%{$_[0]})) {
+ if ($k eq "securityEngineID" || $k eq "contextEngineID") {
+ printf " %-30s 0x%s\n", $k, unpack('h*', $_[0]{$k});
+ }
+ else {
+ printf " %-30s %s\n", $k, $_[0]{$k};
+ }
+ }
+
+ # print the variable bindings:
+ print "VARBINDS:\n";
+ foreach my $x (@{$_[1]}) {
+ printf " %-30s type=%-2d value=%s\n", $x->[0], $x->[2], $x->[1];
+ }
+ }
+
+ NetSNMP::TrapReceiver::register("all", \&my_receiver) ||
+ warn "failed to register our perl trap handler\n";
+
+ print STDERR "Loaded the example perl snmptrapd handler\n";
+
+Then, put the following line in your snmprapd.conf file:
+
+ perl do "/usr/local/share/snmp/mytrapd.pl";
+
+Start snmptrapd (as root, and the following other opions make it stay
+in the foreground and log to stderr):
+
+ snmptrapd -f -Le
+
+You should see it start up and display the final message from the end
+of the above perl script:
+
+ Loaded the perl snmptrapd handler
+ 2004-02-11 10:08:45 NET-SNMP version 5.2 Started.
+
+Then, if you send yourself a fake trap using the following example command:
+
+ snmptrap -v 2c -c mycommunity localhost 0 linkUp ifIndex.1 i 1 \
+ ifAdminStatus.1 i up ifOperStatus.1 i up ifDescr s eth0
+
+You should see the following output appear from snmptrapd as your perl
+code gets executed:
+
+ ********** PERL RECEIVED A NOTIFICATION:
+ PDU INFO:
+ notificationtype TRAP
+ receivedfrom 127.0.0.1
+ version 1
+ errorstatus 0
+ messageid 0
+ community mycommunity
+ transactionid 2
+ errorindex 0
+ requestid 765160220
+ VARBINDS:
+ sysUpTimeInstance type=67 value=0:0:00:00.00
+ snmpTrapOID.0 type=6 value=linkUp
+ ifIndex.1 type=2 value=1
+ ifAdminStatus.1 type=2 value=1
+ ifOperStatus.1 type=2 value=1
+ ifDescr type=4 value="eth0"
+
+=head1 EXPORT
+
+None by default.
+
+# =head2 Exportable constants
+
+# NETSNMPTRAPD_AUTH_HANDLER
+# NETSNMPTRAPD_HANDLER_BREAK
+# NETSNMPTRAPD_HANDLER_FAIL
+# NETSNMPTRAPD_HANDLER_FINISH
+# NETSNMPTRAPD_HANDLER_OK
+# NETSNMPTRAPD_POST_HANDLER
+# NETSNMPTRAPD_PRE_HANDLER
+
+=head1 SEE ALSO
+
+NetSNMP::OID, NetSNMP::ASN
+
+snmptrapd.conf(5) for configuring the Net-SNMP trap receiver.
+
+snmpd.conf(5) for configuring the Net-SNMP snmp agent for sending traps.
+
+http://www.Net-SNMP.org/
+
+=head1 AUTHOR
+
+W. Hardaker, E<lt>hardaker@users.sourceforge.netE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2004 by W. Hardaker
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
diff --git a/perl/TrapReceiver/TrapReceiver.xs b/perl/TrapReceiver/TrapReceiver.xs
new file mode 100644
index 0000000..531bfa4
--- /dev/null
+++ b/perl/TrapReceiver/TrapReceiver.xs
@@ -0,0 +1,313 @@
+/* -*- c -*- */
+#if defined(_WIN32) && !defined(_WIN32_WINNT)
+#define _WIN32_WINNT 0x501
+#endif
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include "ppport.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 "perl_snmptrapd.h"
+
+#include "const-c.inc"
+
+typedef struct trapd_cb_data_s {
+ SV *perl_cb;
+} trapd_cb_data;
+
+typedef struct netsnmp_oid_s {
+ oid *name;
+ size_t len;
+ oid namebuf[ MAX_OID_LEN ];
+} netsnmp_oid;
+
+int perl_trapd_handler( netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler)
+{
+ trapd_cb_data *cb_data;
+ SV *pcallback;
+ netsnmp_variable_list *vb;
+ netsnmp_oid *o;
+ SV **tmparray;
+ int i, c = 0;
+ u_char *outbuf;
+ size_t ob_len = 0, oo_len = 0;
+ AV *varbinds;
+ HV *pduinfo;
+ int noValuesReturned;
+ int callingCFfailed = 0;
+ int result = NETSNMPTRAPD_HANDLER_OK;
+ netsnmp_pdu * v2pdu = NULL;
+
+ dSP;
+ ENTER;
+ SAVETMPS;
+
+ if (!pdu || !handler)
+ return 0;
+
+ /* nuke v1 PDUs */
+ if (pdu->command == SNMP_MSG_TRAP) {
+ v2pdu = convert_v1pdu_to_v2(pdu);
+ pdu = v2pdu;
+ }
+
+ cb_data = handler->handler_data;
+ if (!cb_data || !cb_data->perl_cb)
+ return 0;
+
+ pcallback = cb_data->perl_cb;
+
+ /* get PDU related info */
+ pduinfo = newHV();
+#define STOREPDU(n, v) (void)hv_store(pduinfo, n, strlen(n), v, 0)
+#define STOREPDUi(n, v) STOREPDU(n, newSViv(v))
+#define STOREPDUs(n, v) STOREPDU(n, newSVpv(v, 0))
+ STOREPDUi("version", pdu->version);
+ STOREPDUs("notificationtype", ((pdu->command == SNMP_MSG_INFORM) ? "INFORM":"TRAP"));
+ STOREPDUi("requestid", pdu->reqid);
+ STOREPDUi("messageid", pdu->msgid);
+ STOREPDUi("transactionid", pdu->transid);
+ STOREPDUi("errorstatus", pdu->errstat);
+ STOREPDUi("errorindex", pdu->errindex);
+ if (pdu->version == 3) {
+ STOREPDUi("securitymodel", pdu->securityModel);
+ STOREPDUi("securitylevel", pdu->securityLevel);
+ STOREPDU("contextName",
+ newSVpv(pdu->contextName, pdu->contextNameLen));
+ STOREPDU("contextEngineID",
+ newSVpv((char *) pdu->contextEngineID,
+ pdu->contextEngineIDLen));
+ STOREPDU("securityEngineID",
+ newSVpv((char *) pdu->securityEngineID,
+ pdu->securityEngineIDLen));
+ STOREPDU("securityName",
+ newSVpv((char *) pdu->securityName, pdu->securityNameLen));
+ } else {
+ STOREPDU("community",
+ newSVpv((char *) pdu->community, pdu->community_len));
+ }
+
+ if (transport && transport->f_fmtaddr) {
+ char *tstr = transport->f_fmtaddr(transport, pdu->transport_data,
+ pdu->transport_data_length);
+ STOREPDUs("receivedfrom", tstr);
+ netsnmp_free(tstr);
+ }
+
+
+ /*
+ * collect OID objects in a temp array first
+ */
+ /* get VARBIND related info */
+ i = count_varbinds(pdu->variables);
+ tmparray = malloc(sizeof(*tmparray) * i);
+
+ for(vb = pdu->variables; vb; vb = vb->next_variable) {
+
+ /* get the oid */
+ o = malloc(sizeof(netsnmp_oid));
+ o->name = o->namebuf;
+ o->len = vb->name_length;
+ memcpy(o->name, vb->name, vb->name_length * sizeof(oid));
+
+#undef CALL_EXTERNAL_OID_NEW
+
+#ifdef CALL_EXTERNAL_OID_NEW
+ {
+ SV *arg;
+ SV *rarg;
+
+ PUSHMARK(sp);
+
+ rarg = sv_2mortal(newSViv((IV) 0));
+ arg = sv_2mortal(newSVrv(rarg, "netsnmp_oidPtr"));
+ sv_setiv(arg, (IV) o);
+ XPUSHs(rarg);
+
+ PUTBACK;
+ i = perl_call_pv("NetSNMP::OID::newwithptr", G_SCALAR);
+ SPAGAIN;
+
+ if (i != 1) {
+ snmp_log(LOG_ERR, "unhandled OID error.\n");
+ /* ack XXX */
+ }
+ /* get the value */
+ tmparray[c++] = POPs;
+ SvREFCNT_inc(tmparray[c-1]);
+ PUTBACK;
+ }
+#else /* build it and bless ourselves */
+ {
+ HV *hv = newHV();
+ SV *rv = newRV_noinc((SV *) hv);
+ SV *rvsub = newRV_noinc((SV *) newSViv((UV) o));
+ rvsub = sv_bless(rvsub, gv_stashpv("netsnmp_oidPtr", 1));
+ (void)hv_store(hv, "oidptr", 6, rvsub, 0);
+ rv = sv_bless(rv, gv_stashpv("NetSNMP::OID", 1));
+ tmparray[c++] = rv;
+ }
+
+#endif /* build oid ourselves */
+ }
+
+ /*
+ * build the varbind lists
+ */
+ varbinds = newAV();
+ for(vb = pdu->variables, i = 0; vb; vb = vb->next_variable, i++) {
+ /* push the oid */
+ AV *vba;
+ vba = newAV();
+
+
+ /* get the value */
+ outbuf = NULL;
+ ob_len = 0;
+ oo_len = 0;
+ sprint_realloc_by_type(&outbuf, &ob_len, &oo_len, 1,
+ vb, 0, 0, 0);
+
+ av_push(vba,tmparray[i]);
+ av_push(vba,newSVpvn((char *) outbuf, oo_len));
+ netsnmp_free(outbuf);
+ av_push(vba,newSViv(vb->type));
+ av_push(varbinds, (SV *) newRV_noinc((SV *) vba));
+ }
+
+ PUSHMARK(sp);
+
+ /* store the collected information on the stack */
+ XPUSHs(sv_2mortal(newRV_noinc((SV*) pduinfo)));
+ XPUSHs(sv_2mortal(newRV_noinc((SV*) varbinds)));
+
+ /* put the stack back in order */
+ PUTBACK;
+
+ /* actually call the callback function */
+ if (SvTYPE(pcallback) == SVt_PVCV) {
+ noValuesReturned = perl_call_sv(pcallback, G_SCALAR);
+ /* XXX: it discards the results, which isn't right */
+ } else if (SvROK(pcallback) && SvTYPE(SvRV(pcallback)) == SVt_PVCV) {
+ /* reference to code */
+ noValuesReturned = perl_call_sv(SvRV(pcallback), G_SCALAR);
+ } else {
+ snmp_log(LOG_ERR, " tried to call a perl function but failed to understand its type: (ref = %p, svrok: %lu, SVTYPE: %lu)\n", pcallback, (unsigned long)SvROK(pcallback), (unsigned long)SvTYPE(pcallback));
+ callingCFfailed = 1;
+ }
+
+ if (!callingCFfailed) {
+ SPAGAIN;
+
+ if ( noValuesReturned == 0 ) {
+ snmp_log(LOG_WARNING, " perl callback function %p did not return a scalar, assuming %d (NETSNMPTRAPD_HANDLER_OK)\n", pcallback, NETSNMPTRAPD_HANDLER_OK);
+ }
+ else {
+ SV *rv = POPs;
+
+ if (SvTYPE(rv) != SVt_IV) {
+ snmp_log(LOG_WARNING, " perl callback function %p returned a scalar of type %lu instead of an integer, assuming %d (NETSNMPTRAPD_HANDLER_OK)\n", pcallback, (unsigned long)SvTYPE(rv), NETSNMPTRAPD_HANDLER_OK);
+ }
+ else {
+ int rvi = (IV)SvIVx(rv);
+
+ if ((NETSNMPTRAPD_HANDLER_OK <= rvi) && (rvi <= NETSNMPTRAPD_HANDLER_FINISH)) {
+ snmp_log(LOG_DEBUG, " perl callback function %p returns %d\n", pcallback, rvi);
+ result = rvi;
+ }
+ else {
+ snmp_log(LOG_WARNING, " perl callback function %p returned an invalid scalar integer value (%d), assuming %d (NETSNMPTRAPD_HANDLER_OK)\n", pcallback, rvi, NETSNMPTRAPD_HANDLER_OK);
+ }
+ }
+ }
+
+ PUTBACK;
+ }
+
+#ifdef DUMPIT
+ fprintf(stderr, "DUMPDUMPDUMPDUMPDUMPDUMP\n");
+ sv_dump(pduinfo);
+ fprintf(stderr, "--------------------\n");
+ sv_dump(varbinds);
+#endif
+
+ /* svREFCNT_dec((SV *) pduinfo); */
+#ifdef NOT_THIS
+ {
+ SV *vba;
+ while(vba = av_pop(varbinds)) {
+ av_undef((AV *) vba);
+ }
+ }
+ av_undef(varbinds);
+#endif
+ free(tmparray);
+
+ if (v2pdu) {
+ snmp_free_pdu(v2pdu);
+ }
+
+ FREETMPS;
+ LEAVE;
+ return result;
+}
+
+MODULE = NetSNMP::TrapReceiver PACKAGE = NetSNMP::TrapReceiver
+
+INCLUDE: const-xs.inc
+
+MODULE = NetSNMP::TrapReceiver PACKAGE = NetSNMP::TrapReceiver PREFIX=trapd_
+int
+trapd_register(regoid, perlcallback)
+ char *regoid;
+ SV *perlcallback;
+ PREINIT:
+ oid myoid[MAX_OID_LEN];
+ size_t myoid_len = MAX_OID_LEN;
+ trapd_cb_data *cb_data;
+ netsnmp_trapd_handler *handler = NULL;
+ CODE:
+ {
+ if (!regoid || !perlcallback) {
+ RETVAL = 0;
+ return;
+ }
+ if (strcmp(regoid,"all") == 0) {
+ handler =
+ netsnmp_add_global_traphandler(NETSNMPTRAPD_POST_HANDLER,
+ perl_trapd_handler);
+ } else if (strcmp(regoid,"default") == 0) {
+ handler =
+ netsnmp_add_default_traphandler(perl_trapd_handler);
+ } else if (!snmp_parse_oid(regoid, myoid, &myoid_len)) {
+ snmp_log(LOG_ERR,
+ "Failed to parse oid for perl registration: %s\n",
+ regoid);
+ RETVAL = 0;
+ return;
+ } else {
+ handler =
+ netsnmp_add_traphandler(perl_trapd_handler,
+ myoid, myoid_len);
+ }
+
+ if (handler) {
+ cb_data = malloc(sizeof(trapd_cb_data));
+ cb_data->perl_cb = newSVsv(perlcallback);
+ handler->handler_data = cb_data;
+ handler->authtypes = (1 << VACM_VIEW_EXECUTE);
+ RETVAL = 1;
+ } else {
+ RETVAL = 0;
+ }
+ }
+ OUTPUT:
+ RETVAL
diff --git a/perl/TrapReceiver/fallback/const-c.inc b/perl/TrapReceiver/fallback/const-c.inc
new file mode 100644
index 0000000..fb31362
--- /dev/null
+++ b/perl/TrapReceiver/fallback/const-c.inc
@@ -0,0 +1,146 @@
+#define PERL_constant_NOTFOUND 1
+#define PERL_constant_NOTDEF 2
+#define PERL_constant_ISIV 3
+#define PERL_constant_ISNO 4
+#define PERL_constant_ISNV 5
+#define PERL_constant_ISPV 6
+#define PERL_constant_ISPVN 7
+#define PERL_constant_ISSV 8
+#define PERL_constant_ISUNDEF 9
+#define PERL_constant_ISUV 10
+#define PERL_constant_ISYES 11
+
+#ifndef NVTYPE
+typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
+#endif
+#ifndef aTHX_
+#define aTHX_ /* 5.6 or later define this for threading support. */
+#endif
+#ifndef pTHX_
+#define pTHX_ /* 5.6 or later define this for threading support. */
+#endif
+
+static int
+constant_25 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMPTRAPD_AUTH_HANDLER NETSNMPTRAPD_HANDLER_FAIL
+ NETSNMPTRAPD_POST_HANDLER */
+ /* Offset 15 gives the best switch position. */
+ switch (name[15]) {
+ case 'N':
+ if (memEQ(name, "NETSNMPTRAPD_HANDLER_FAIL", 25)) {
+ /* ^ */
+#ifdef NETSNMPTRAPD_HANDLER_FAIL
+ *iv_return = NETSNMPTRAPD_HANDLER_FAIL;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "NETSNMPTRAPD_POST_HANDLER", 25)) {
+ /* ^ */
+#ifdef NETSNMPTRAPD_POST_HANDLER
+ *iv_return = NETSNMPTRAPD_POST_HANDLER;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "NETSNMPTRAPD_AUTH_HANDLER", 25)) {
+ /* ^ */
+#ifdef NETSNMPTRAPD_AUTH_HANDLER
+ *iv_return = NETSNMPTRAPD_AUTH_HANDLER;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
+ /* Initially switch on the length of the name. */
+ /* When generated this function returned values for the list of names given
+ in this section of perl code. Rather than manually editing these functions
+ to add or remove constants, which would result in this comment and section
+ of code becoming inaccurate, we recommend that you edit this section of
+ code, and use it to regenerate a new set of constant functions which you
+ then use to replace the originals.
+
+ Regenerate these constant functions by feeding this entire source file to
+ perl -x
+
+#!/usr/bin/perl -w
+use ExtUtils::Constant qw (constant_types C_constant XS_constant);
+
+my $types = {map {($_, 1)} qw(IV)};
+my @names = (qw(NETSNMPTRAPD_AUTH_HANDLER NETSNMPTRAPD_HANDLER_BREAK
+ NETSNMPTRAPD_HANDLER_FAIL NETSNMPTRAPD_HANDLER_FINISH
+ NETSNMPTRAPD_HANDLER_OK NETSNMPTRAPD_POST_HANDLER
+ NETSNMPTRAPD_PRE_HANDLER));
+
+print constant_types(); # macro defs
+foreach (C_constant ("NetSNMP::TrapReceiver", 'constant', 'IV', $types, undef, 3, @names) ) {
+ print $_, "\n"; # C constant subs
+}
+print "#### XS Section:\n";
+print XS_constant ("NetSNMP::TrapReceiver", $types);
+__END__
+ */
+
+ switch (len) {
+ case 23:
+ if (memEQ(name, "NETSNMPTRAPD_HANDLER_OK", 23)) {
+#ifdef NETSNMPTRAPD_HANDLER_OK
+ *iv_return = NETSNMPTRAPD_HANDLER_OK;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 24:
+ if (memEQ(name, "NETSNMPTRAPD_PRE_HANDLER", 24)) {
+#ifdef NETSNMPTRAPD_PRE_HANDLER
+ *iv_return = NETSNMPTRAPD_PRE_HANDLER;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 25:
+ return constant_25 (aTHX_ name, iv_return);
+ break;
+ case 26:
+ if (memEQ(name, "NETSNMPTRAPD_HANDLER_BREAK", 26)) {
+#ifdef NETSNMPTRAPD_HANDLER_BREAK
+ *iv_return = NETSNMPTRAPD_HANDLER_BREAK;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 27:
+ if (memEQ(name, "NETSNMPTRAPD_HANDLER_FINISH", 27)) {
+#ifdef NETSNMPTRAPD_HANDLER_FINISH
+ *iv_return = NETSNMPTRAPD_HANDLER_FINISH;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
diff --git a/perl/TrapReceiver/fallback/const-xs.inc b/perl/TrapReceiver/fallback/const-xs.inc
new file mode 100644
index 0000000..faa384b
--- /dev/null
+++ b/perl/TrapReceiver/fallback/const-xs.inc
@@ -0,0 +1,88 @@
+void
+constant(sv)
+ PREINIT:
+#ifdef dXSTARG
+ dXSTARG; /* Faster if we have it. */
+#else
+ dTARGET;
+#endif
+ STRLEN len;
+ int type;
+ IV iv;
+ /* NV nv; Uncomment this if you need to return NVs */
+ /* const char *pv; Uncomment this if you need to return PVs */
+ INPUT:
+ SV * sv;
+ const char * s = SvPV(sv, len);
+ PPCODE:
+ /* Change this to constant(aTHX_ s, len, &iv, &nv);
+ if you need to return both NVs and IVs */
+ type = constant(aTHX_ s, len, &iv);
+ /* Return 1 or 2 items. First is error message, or undef if no error.
+ Second, if present, is found value */
+ switch (type) {
+ case PERL_constant_NOTFOUND:
+ sv = sv_2mortal(newSVpvf("%s is not a valid NetSNMP::TrapReceiver macro", s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_NOTDEF:
+ sv = sv_2mortal(newSVpvf(
+ "Your vendor has not defined NetSNMP::TrapReceiver macro %s, used", s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_ISIV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHi(iv);
+ break;
+ /* Uncomment this if you need to return NOs
+ case PERL_constant_ISNO:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_no);
+ break; */
+ /* Uncomment this if you need to return NVs
+ case PERL_constant_ISNV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHn(nv);
+ break; */
+ /* Uncomment this if you need to return PVs
+ case PERL_constant_ISPV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, strlen(pv));
+ break; */
+ /* Uncomment this if you need to return PVNs
+ case PERL_constant_ISPVN:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, iv);
+ break; */
+ /* Uncomment this if you need to return SVs
+ case PERL_constant_ISSV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(sv);
+ break; */
+ /* Uncomment this if you need to return UNDEFs
+ case PERL_constant_ISUNDEF:
+ break; */
+ /* Uncomment this if you need to return UVs
+ case PERL_constant_ISUV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHu((UV)iv);
+ break; */
+ /* Uncomment this if you need to return YESs
+ case PERL_constant_ISYES:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_yes);
+ break; */
+ default:
+ sv = sv_2mortal(newSVpvf(
+ "Unexpected return type %d while processing NetSNMP::TrapReceiver macro %s, used",
+ type, s));
+ PUSHs(sv);
+ }
diff --git a/perl/TrapReceiver/netsnmp-feature-definitions.h b/perl/TrapReceiver/netsnmp-feature-definitions.h
new file mode 100644
index 0000000..bd331e3
--- /dev/null
+++ b/perl/TrapReceiver/netsnmp-feature-definitions.h
@@ -0,0 +1,6 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_require(netsnmp_add_default_traphandler)
+netsnmp_feature_require(memory_free)
+
diff --git a/perl/TrapReceiver/perl_snmptrapd.h b/perl/TrapReceiver/perl_snmptrapd.h
new file mode 100644
index 0000000..cce1d6a
--- /dev/null
+++ b/perl/TrapReceiver/perl_snmptrapd.h
@@ -0,0 +1,44 @@
+/* h2xs -b 5.0.6 -O -n NetSNMP::TrapReceiver -x perl_snmptrapd.h */
+
+/* this file was crafted by hand from the contents of the Net-SNMP
+ file: apps/snmaptrapd_handlers.h and other headers. */
+
+typedef struct netsnmp_trapd_handler_s netsnmp_trapd_handler;
+
+typedef int (Netsnmp_Trap_Handler)(netsnmp_pdu *pdu,
+ netsnmp_transport *transport,
+ netsnmp_trapd_handler *handler);
+
+struct netsnmp_trapd_handler_s {
+ int *trapoid;
+ int trapoid_len;
+ char *token; /* Or an array of tokens? */
+ char *format; /* Formatting string */
+ int version; /* ??? */
+ int authtypes;
+ int flags;
+ Netsnmp_Trap_Handler *handler;
+ void *handler_data;
+
+ netsnmp_trapd_handler *nexth; /* Next handler for this trap */
+ /* Doubly-linked list of traps with registered handlers */
+ netsnmp_trapd_handler *prevt;
+ netsnmp_trapd_handler *nextt;
+};
+
+#define NETSNMPTRAPD_AUTH_HANDLER 1
+#define NETSNMPTRAPD_PRE_HANDLER 2
+#define NETSNMPTRAPD_POST_HANDLER 3
+
+#define NETSNMPTRAPD_HANDLER_OK 1 /* Succeed, & keep going */
+#define NETSNMPTRAPD_HANDLER_FAIL 2 /* Failed but keep going */
+#define NETSNMPTRAPD_HANDLER_BREAK 3 /* Move to the next list */
+#define NETSNMPTRAPD_HANDLER_FINISH 4 /* No further processing */
+
+netsnmp_trapd_handler *netsnmp_add_global_traphandler(int list, Netsnmp_Trap_Handler handler);
+netsnmp_trapd_handler *netsnmp_add_default_traphandler(Netsnmp_Trap_Handler handler);
+netsnmp_trapd_handler *netsnmp_add_traphandler(Netsnmp_Trap_Handler handler,
+ oid *trapOid, int trapOidLen);
+/*
+netsnmp_trapd_handler *netsnmp_get_traphandler(oid *trapOid, int trapOidLen);
+*/
diff --git a/perl/TrapReceiver/ppport.h b/perl/TrapReceiver/ppport.h
new file mode 100644
index 0000000..b2dbb6a
--- /dev/null
+++ b/perl/TrapReceiver/ppport.h
@@ -0,0 +1,562 @@
+
+/* ppport.h -- Perl/Pollution/Portability Version 2.0002
+ *
+ * Automatically Created by Devel::PPPort on Fri Feb 6 15:58:25 2004
+ *
+ * Do NOT edit this file directly! -- Edit PPPort.pm instead.
+ *
+ * Version 2.x, Copyright (C) 2001, Paul Marquess.
+ * Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
+ * This code may be used and distributed under the same license as any
+ * version of Perl.
+ *
+ * This version of ppport.h is designed to support operation with Perl
+ * installations back to 5.004, and has been tested up to 5.8.0.
+ *
+ * If this version of ppport.h is failing during the compilation of this
+ * module, please check if a newer version of Devel::PPPort is available
+ * on CPAN before sending a bug report.
+ *
+ * If you are using the latest version of Devel::PPPort and it is failing
+ * during compilation of this module, please send a report to perlbug@perl.com
+ *
+ * Include all following information:
+ *
+ * 1. The complete output from running "perl -V"
+ *
+ * 2. This file.
+ *
+ * 3. The name & version of the module you were trying to build.
+ *
+ * 4. A full log of the build that failed.
+ *
+ * 5. Any other information that you think could be relevant.
+ *
+ *
+ * For the latest version of this code, please retreive the Devel::PPPort
+ * module from CPAN.
+ *
+ */
+
+/*
+ * In order for a Perl extension module to be as portable as possible
+ * across differing versions of Perl itself, certain steps need to be taken.
+ * Including this header is the first major one, then using dTHR is all the
+ * appropriate places and using a PL_ prefix to refer to global Perl
+ * variables is the second.
+ *
+ */
+
+
+/* If you use one of a few functions that were not present in earlier
+ * versions of Perl, please add a define before the inclusion of ppport.h
+ * for a static include, or use the GLOBAL request in a single module to
+ * produce a global definition that can be referenced from the other
+ * modules.
+ *
+ * Function: Static define: Extern define:
+ * newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL
+ *
+ */
+
+
+/* To verify whether ppport.h is needed for your module, and whether any
+ * special defines should be used, ppport.h can be run through Perl to check
+ * your source code. Simply say:
+ *
+ * perl -x ppport.h *.c *.h *.xs foo/bar*.c [etc]
+ *
+ * The result will be a list of patches suggesting changes that should at
+ * least be acceptable, if not necessarily the most efficient solution, or a
+ * fix for all possible problems. It won't catch where dTHR is needed, and
+ * doesn't attempt to account for global macro or function definitions,
+ * nested includes, typemaps, etc.
+ *
+ * In order to test for the need of dTHR, please try your module under a
+ * recent version of Perl that has threading compiled-in.
+ *
+ */
+
+
+/*
+#!/usr/bin/perl
+@ARGV = ("*.xs") if !@ARGV;
+%badmacros = %funcs = %macros = (); $replace = 0;
+foreach (<DATA>) {
+ $funcs{$1} = 1 if /Provide:\s+(\S+)/;
+ $macros{$1} = 1 if /^#\s*define\s+([a-zA-Z0-9_]+)/;
+ $replace = $1 if /Replace:\s+(\d+)/;
+ $badmacros{$2}=$1 if $replace and /^#\s*define\s+([a-zA-Z0-9_]+).*?\s+([a-zA-Z0-9_]+)/;
+ $badmacros{$1}=$2 if /Replace (\S+) with (\S+)/;
+}
+foreach $filename (map(glob($_),@ARGV)) {
+ unless (open(IN, "<$filename")) {
+ warn "Unable to read from $file: $!\n";
+ next;
+ }
+ print "Scanning $filename...\n";
+ $c = ""; while (<IN>) { $c .= $_; } close(IN);
+ $need_include = 0; %add_func = (); $changes = 0;
+ $has_include = ($c =~ /#.*include.*ppport/m);
+
+ foreach $func (keys %funcs) {
+ if ($c =~ /#.*define.*\bNEED_$func(_GLOBAL)?\b/m) {
+ if ($c !~ /\b$func\b/m) {
+ print "If $func isn't needed, you don't need to request it.\n" if
+ $changes += ($c =~ s/^.*#.*define.*\bNEED_$func\b.*\n//m);
+ } else {
+ print "Uses $func\n";
+ $need_include = 1;
+ }
+ } else {
+ if ($c =~ /\b$func\b/m) {
+ $add_func{$func} =1 ;
+ print "Uses $func\n";
+ $need_include = 1;
+ }
+ }
+ }
+
+ if (not $need_include) {
+ foreach $macro (keys %macros) {
+ if ($c =~ /\b$macro\b/m) {
+ print "Uses $macro\n";
+ $need_include = 1;
+ }
+ }
+ }
+
+ foreach $badmacro (keys %badmacros) {
+ if ($c =~ /\b$badmacro\b/m) {
+ $changes += ($c =~ s/\b$badmacro\b/$badmacros{$badmacro}/gm);
+ print "Uses $badmacros{$badmacro} (instead of $badmacro)\n";
+ $need_include = 1;
+ }
+ }
+
+ if (scalar(keys %add_func) or $need_include != $has_include) {
+ if (!$has_include) {
+ $inc = join('',map("#define NEED_$_\n", sort keys %add_func)).
+ "#include \"ppport.h\"\n";
+ $c = "$inc$c" unless $c =~ s/#.*include.*XSUB.*\n/$&$inc/m;
+ } elsif (keys %add_func) {
+ $inc = join('',map("#define NEED_$_\n", sort keys %add_func));
+ $c = "$inc$c" unless $c =~ s/^.*#.*include.*ppport.*$/$inc$&/m;
+ }
+ if (!$need_include) {
+ print "Doesn't seem to need ppport.h.\n";
+ $c =~ s/^.*#.*include.*ppport.*\n//m;
+ }
+ $changes++;
+ }
+
+ if ($changes) {
+ open(OUT,">/tmp/ppport.h.$$");
+ print OUT $c;
+ close(OUT);
+ open(DIFF, "diff -u $filename /tmp/ppport.h.$$|");
+ while (<DIFF>) { s!/tmp/ppport\.h\.$$!$filename.patched!; print STDOUT; }
+ close(DIFF);
+ unlink("/tmp/ppport.h.$$");
+ } else {
+ print "Looks OK\n";
+ }
+}
+__DATA__
+*/
+
+#ifndef _P_P_PORTABILITY_H_
+#define _P_P_PORTABILITY_H_
+
+#ifndef PERL_REVISION
+# ifndef __PATCHLEVEL_H_INCLUDED__
+# include "patchlevel.h"
+# endif
+# ifndef PERL_REVISION
+# define PERL_REVISION (5)
+ /* Replace: 1 */
+# define PERL_VERSION PATCHLEVEL
+# define PERL_SUBVERSION SUBVERSION
+ /* Replace PERL_PATCHLEVEL with PERL_VERSION */
+ /* Replace: 0 */
+# endif
+#endif
+
+#define PERL_BCDVERSION ((PERL_REVISION * 0x1000000L) + (PERL_VERSION * 0x1000L) + PERL_SUBVERSION)
+
+/* It is very unlikely that anyone will try to use this with Perl 6
+ (or greater), but who knows.
+ */
+#if PERL_REVISION != 5
+# error ppport.h only works with Perl version 5
+#endif /* PERL_REVISION != 5 */
+
+#ifndef ERRSV
+# define ERRSV perl_get_sv("@",FALSE)
+#endif
+
+#if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))
+/* Replace: 1 */
+# define PL_Sv Sv
+# define PL_compiling compiling
+# define PL_copline copline
+# define PL_curcop curcop
+# define PL_curstash curstash
+# define PL_defgv defgv
+# define PL_dirty dirty
+# define PL_dowarn dowarn
+# define PL_hints hints
+# define PL_na na
+# define PL_perldb perldb
+# define PL_rsfp_filters rsfp_filters
+# define PL_rsfpv rsfp
+# define PL_stdingv stdingv
+# define PL_sv_no sv_no
+# define PL_sv_undef sv_undef
+# define PL_sv_yes sv_yes
+/* Replace: 0 */
+#endif
+
+#ifndef PERL_UNUSED_DECL
+#ifdef HASATTRIBUTE
+# if defined(__GNUC__) && defined(__cplusplus)
+# define PERL_UNUSED_DECL
+# else
+# define PERL_UNUSED_DECL __attribute__((unused))
+# endif
+#else
+# define PERL_UNUSED_DECL
+#endif
+#endif
+
+#ifndef dNOOP
+# define NOOP (void)0
+# define dNOOP extern int Perl___notused PERL_UNUSED_DECL
+#endif
+
+#ifndef dTHR
+# define dTHR dNOOP
+#endif
+
+#ifndef dTHX
+# define dTHX dNOOP
+# define dTHXa(x) dNOOP
+# define dTHXoa(x) dNOOP
+#endif
+
+#ifndef pTHX
+# define pTHX void
+# define pTHX_
+# define aTHX
+# define aTHX_
+#endif
+
+/* IV could also be a quad (say, a long long), but Perls
+ * capable of those should have IVSIZE already. */
+#if !defined(IVSIZE) && defined(LONGSIZE)
+# define IVSIZE LONGSIZE
+#endif
+#ifndef IVSIZE
+# define IVSIZE 4 /* A bold guess, but the best we can make. */
+#endif
+
+#ifndef UVSIZE
+# define UVSIZE IVSIZE
+#endif
+
+#ifndef NVTYPE
+# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
+# define NVTYPE long double
+# else
+# define NVTYPE double
+# endif
+typedef NVTYPE NV;
+#endif
+
+#ifndef INT2PTR
+
+#if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+# define PTRV UV
+# define INT2PTR(any,d) (any)(d)
+#else
+# if PTRSIZE == LONGSIZE
+# define PTRV unsigned long
+# else
+# define PTRV unsigned
+# endif
+# define INT2PTR(any,d) (any)(PTRV)(d)
+#endif
+#define NUM2PTR(any,d) (any)(PTRV)(d)
+#define PTR2IV(p) INT2PTR(IV,p)
+#define PTR2UV(p) INT2PTR(UV,p)
+#define PTR2NV(p) NUM2PTR(NV,p)
+#if PTRSIZE == LONGSIZE
+# define PTR2ul(p) (unsigned long)(p)
+#else
+# define PTR2ul(p) INT2PTR(unsigned long,p)
+#endif
+
+#endif /* !INT2PTR */
+
+#ifndef boolSV
+# define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
+#endif
+
+#ifndef gv_stashpvn
+# define gv_stashpvn(str,len,flags) gv_stashpv(str,flags)
+#endif
+
+#ifndef newSVpvn
+# define newSVpvn(data,len) ((len) ? newSVpv ((data), (len)) : newSVpv ("", 0))
+#endif
+
+#ifndef newRV_inc
+/* Replace: 1 */
+# define newRV_inc(sv) newRV(sv)
+/* Replace: 0 */
+#endif
+
+/* DEFSV appears first in 5.004_56 */
+#ifndef DEFSV
+# define DEFSV GvSV(PL_defgv)
+#endif
+
+#ifndef SAVE_DEFSV
+# define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
+#endif
+
+#ifndef newRV_noinc
+# ifdef __GNUC__
+# define newRV_noinc(sv) \
+ ({ \
+ SV *nsv = (SV*)newRV(sv); \
+ SvREFCNT_dec(sv); \
+ nsv; \
+ })
+# else
+# if defined(USE_THREADS)
+static SV * newRV_noinc (SV * sv)
+{
+ SV *nsv = (SV*)newRV(sv);
+ SvREFCNT_dec(sv);
+ return nsv;
+}
+# else
+# define newRV_noinc(sv) \
+ (PL_Sv=(SV*)newRV(sv), SvREFCNT_dec(sv), (SV*)PL_Sv)
+# endif
+# endif
+#endif
+
+/* Provide: newCONSTSUB */
+
+/* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
+#if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 63))
+
+#if defined(NEED_newCONSTSUB)
+static
+#else
+extern void newCONSTSUB(HV * stash, char * name, SV *sv);
+#endif
+
+#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
+void
+newCONSTSUB(stash,name,sv)
+HV *stash;
+char *name;
+SV *sv;
+{
+ U32 oldhints = PL_hints;
+ HV *old_cop_stash = PL_curcop->cop_stash;
+ HV *old_curstash = PL_curstash;
+ line_t oldline = PL_curcop->cop_line;
+ PL_curcop->cop_line = PL_copline;
+
+ PL_hints &= ~HINT_BLOCK_SCOPE;
+ if (stash)
+ PL_curstash = PL_curcop->cop_stash = stash;
+
+ newSUB(
+
+#if (PERL_VERSION < 3) || ((PERL_VERSION == 3) && (PERL_SUBVERSION < 22))
+ /* before 5.003_22 */
+ start_subparse(),
+#else
+# if (PERL_VERSION == 3) && (PERL_SUBVERSION == 22)
+ /* 5.003_22 */
+ start_subparse(0),
+# else
+ /* 5.003_23 onwards */
+ start_subparse(FALSE, 0),
+# endif
+#endif
+
+ newSVOP(OP_CONST, 0, newSVpv(name,0)),
+ newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
+ newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
+ );
+
+ PL_hints = oldhints;
+ PL_curcop->cop_stash = old_cop_stash;
+ PL_curstash = old_curstash;
+ PL_curcop->cop_line = oldline;
+}
+#endif
+
+#endif /* newCONSTSUB */
+
+#ifndef START_MY_CXT
+
+/*
+ * Boilerplate macros for initializing and accessing interpreter-local
+ * data from C. All statics in extensions should be reworked to use
+ * this, if you want to make the extension thread-safe. See ext/re/re.xs
+ * for an example of the use of these macros.
+ *
+ * Code that uses these macros is responsible for the following:
+ * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
+ * 2. Declare a typedef named my_cxt_t that is a structure that contains
+ * all the data that needs to be interpreter-local.
+ * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
+ * 4. Use the MY_CXT_INIT macro such that it is called exactly once
+ * (typically put in the BOOT: section).
+ * 5. Use the members of the my_cxt_t structure everywhere as
+ * MY_CXT.member.
+ * 6. Use the dMY_CXT macro (a declaration) in all the functions that
+ * access MY_CXT.
+ */
+
+#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
+ defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
+
+/* This must appear in all extensions that define a my_cxt_t structure,
+ * right after the definition (i.e. at file scope). The non-threads
+ * case below uses it to declare the data as static. */
+#define START_MY_CXT
+
+#if (PERL_VERSION < 4 || (PERL_VERSION == 4 && PERL_SUBVERSION < 68 ))
+/* Fetches the SV that keeps the per-interpreter data. */
+#define dMY_CXT_SV \
+ SV *my_cxt_sv = perl_get_sv(MY_CXT_KEY, FALSE)
+#else /* >= perl5.004_68 */
+#define dMY_CXT_SV \
+ SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
+ sizeof(MY_CXT_KEY)-1, TRUE)
+#endif /* < perl5.004_68 */
+
+/* This declaration should be used within all functions that use the
+ * interpreter-local data. */
+#define dMY_CXT \
+ dMY_CXT_SV; \
+ my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
+
+/* Creates and zeroes the per-interpreter data.
+ * (We allocate my_cxtp in a Perl SV so that it will be released when
+ * the interpreter goes away.) */
+#define MY_CXT_INIT \
+ dMY_CXT_SV; \
+ /* newSV() allocates one more than needed */ \
+ my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
+ Zero(my_cxtp, 1, my_cxt_t); \
+ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
+
+/* This macro must be used to access members of the my_cxt_t structure.
+ * e.g. MYCXT.some_data */
+#define MY_CXT (*my_cxtp)
+
+/* Judicious use of these macros can reduce the number of times dMY_CXT
+ * is used. Use is similar to pTHX, aTHX etc. */
+#define pMY_CXT my_cxt_t *my_cxtp
+#define pMY_CXT_ pMY_CXT,
+#define _pMY_CXT ,pMY_CXT
+#define aMY_CXT my_cxtp
+#define aMY_CXT_ aMY_CXT,
+#define _aMY_CXT ,aMY_CXT
+
+#else /* single interpreter */
+
+#define START_MY_CXT static my_cxt_t my_cxt;
+#define dMY_CXT_SV dNOOP
+#define dMY_CXT dNOOP
+#define MY_CXT_INIT NOOP
+#define MY_CXT my_cxt
+
+#define pMY_CXT void
+#define pMY_CXT_
+#define _pMY_CXT
+#define aMY_CXT
+#define aMY_CXT_
+#define _aMY_CXT
+
+#endif
+
+#endif /* START_MY_CXT */
+
+#ifndef IVdf
+# if IVSIZE == LONGSIZE
+# define IVdf "ld"
+# define UVuf "lu"
+# define UVof "lo"
+# define UVxf "lx"
+# define UVXf "lX"
+# else
+# if IVSIZE == INTSIZE
+# define IVdf "d"
+# define UVuf "u"
+# define UVof "o"
+# define UVxf "x"
+# define UVXf "X"
+# endif
+# endif
+#endif
+
+#ifndef NVef
+# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
+ defined(PERL_PRIfldbl) /* Not very likely, but let's try anyway. */
+# define NVef PERL_PRIeldbl
+# define NVff PERL_PRIfldbl
+# define NVgf PERL_PRIgldbl
+# else
+# define NVef "e"
+# define NVff "f"
+# define NVgf "g"
+# endif
+#endif
+
+#ifndef AvFILLp /* Older perls (<=5.003) lack AvFILLp */
+# define AvFILLp AvFILL
+#endif
+
+#ifdef SvPVbyte
+# if PERL_REVISION == 5 && PERL_VERSION < 7
+ /* SvPVbyte does not work in perl-5.6.1, borrowed version for 5.7.3 */
+# undef SvPVbyte
+# define SvPVbyte(sv, lp) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : my_sv_2pvbyte(aTHX_ sv, &lp))
+ static char *
+ my_sv_2pvbyte(pTHX_ register SV *sv, STRLEN *lp)
+ {
+ sv_utf8_downgrade(sv,0);
+ return SvPV(sv,*lp);
+ }
+# endif
+#else
+# define SvPVbyte SvPV
+#endif
+
+#ifndef SvPV_nolen
+# define SvPV_nolen(sv) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX(sv) : sv_2pv_nolen(sv))
+ static char *
+ sv_2pv_nolen(pTHX_ register SV *sv)
+ {
+ STRLEN n_a;
+ return sv_2pv(sv, &n_a);
+ }
+#endif
+
+#endif /* _P_P_PORTABILITY_H_ */
+
+/* End of File ppport.h */
diff --git a/perl/TrapReceiver/t/1.t b/perl/TrapReceiver/t/1.t
new file mode 100644
index 0000000..2ece8f2
--- /dev/null
+++ b/perl/TrapReceiver/t/1.t
@@ -0,0 +1,38 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl 1.t'
+
+#########################
+
+# change 'tests => 2' to 'tests => last_test_to_print';
+
+use Test;
+BEGIN { plan tests => 2 };
+# use NetSNMP::TrapReceiver; # we can't include this directly in a module.
+ok(1); # If we made it this far, we're ok. Bogus test!
+
+
+my $fail;
+foreach my $constname (qw(
+ NETSNMPTRAPD_AUTH_HANDLER NETSNMPTRAPD_HANDLER_BREAK
+ NETSNMPTRAPD_HANDLER_FAIL NETSNMPTRAPD_HANDLER_FINISH
+ NETSNMPTRAPD_HANDLER_OK NETSNMPTRAPD_POST_HANDLER
+ NETSNMPTRAPD_PRE_HANDLER)) {
+ next if (eval "my \$a = $constname; 1");
+ if ($@ =~ /^Your vendor has not defined NetSNMP::TrapReceiver macro $constname/) {
+ print "# pass: $@";
+ } else {
+ print "# fail: $@";
+ $fail = 1;
+ }
+}
+if ($fail) {
+ print "not ok 2\n";
+} else {
+ print "ok 2\n";
+}
+
+#########################
+
+# Insert your test code below, the Test::More module is use()ed here so read
+# its man page ( perldoc Test::More ) for help writing this test script.
+
diff --git a/perl/TrapReceiver/typemap b/perl/TrapReceiver/typemap
new file mode 100644
index 0000000..6dea727
--- /dev/null
+++ b/perl/TrapReceiver/typemap
@@ -0,0 +1,5 @@
+TYPEMAP
+netsnmp_trapd_registration * T_PTROBJ
+Netsnmp_Trap_Handler T_PTROBJ
+netsnmp_trapd_handler * T_PTROBJ
+oid * T_PTROBJ
diff --git a/perl/agent/Changes b/perl/agent/Changes
new file mode 100644
index 0000000..fce59c2
--- /dev/null
+++ b/perl/agent/Changes
@@ -0,0 +1,6 @@
+Revision history for Perl extension NetSNMP::agent.
+
+0.01 Thu Dec 27 22:24:58 2001
+ - original version; created by h2xs 1.20 with options
+ -x -O -n NetSNMP::agent ./stuff/perl_agent.h
+
diff --git a/perl/agent/MANIFEST b/perl/agent/MANIFEST
new file mode 100644
index 0000000..156494a
--- /dev/null
+++ b/perl/agent/MANIFEST
@@ -0,0 +1,15 @@
+Changes
+MANIFEST
+Makefile.PL
+agent.pm
+netsnmp_request_infoPtr.pm
+agent.xs
+test.pl
+typemap
+default_store/Makefile.PL
+default_store/default_store.pm
+default_store/default_store.xs
+default_store/test.pl
+Support/Makefile.PL
+Support/Support.pm
+
diff --git a/perl/agent/Makefile.PL b/perl/agent/Makefile.PL
new file mode 100644
index 0000000..4f7bee3
--- /dev/null
+++ b/perl/agent/Makefile.PL
@@ -0,0 +1,240 @@
+use ExtUtils::MakeMaker;
+require 5;
+use Config;
+use Getopt::Long;
+my $lib_version;
+my %MakeParams = ();
+
+%MakeParams = InitMakeParams();
+
+WriteMakefile(%MakeParams);
+
+Check_Version();
+
+sub InitMakeParams {
+ my $opts;
+ my %Params = (
+ 'NAME' => 'NetSNMP::agent',
+ 'VERSION_FROM' => 'agent.pm', # finds $VERSION
+ 'XSPROTOARG' => '-prototypes',
+ 'PM' => {
+ 'agent.pm' => '$(INST_LIBDIR)/agent.pm',
+ 'netsnmp_request_infoPtr.pm' =>
+ '$(INST_LIBDIR)/agent/netsnmp_request_infoPtr.pm'
+ },
+ 'PREREQ_PM' => {},
+ );
+
+ if ($ENV{'OSTYPE'} eq 'msys') {
+ $Params{'DEFINE'} = "-DMINGW_PERL";
+ }
+
+ my ($snmp_lib, $snmp_llib, $sep);
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+ $opts = NetSNMPGetOpts();
+ $Params{'DEFINE'} = "-DMSVC_PERL -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS";
+ $sep = '\\';
+ $snmp_lib_file = 'netsnmp.lib';
+ $snmp_link_lib = 'netsnmp';
+ $agent_link_lib = 'netsnmpagent';
+ $mibs_link_lib = 'netsnmpmibs';
+
+ if (lc($opts->{'debug'}) eq "true") {
+ $lib_dir = 'lib\\debug';
+ }
+ else {
+ $lib_dir = 'lib\\release';
+ }
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L$basedir\\win32\\$lib_dir\\ -l$snmp_link_lib -l$agent_link_lib " .
+ "-l$mibs_link_lib";
+ }
+ else {
+ my @LibDirs = split (';',$ENV{LIB});
+ my $LibDir;
+ if ($opts->{'prefix'}) {
+ push (@LibDirs,"$ENV{'NET-SNMP-PATH'}${sep}lib");
+ }
+ $noLibDir = 1;
+ while ($noLibDir) {
+ $LibDir = find_files(["$snmp_lib_file"],\@LibDirs);
+ if ($LibDir ne '') {
+ $noLibDir = 0;
+ # Put quotes around LibDir to allow spaces in paths
+ $LibDir = '"' . $LibDir . '"';
+ }
+ else
+ {
+ @LibDirs = ();
+ $LibDirs[0] = prompt("The Net-SNMP library ($snmp_lib_file) could not be found.\nPlease enter the directory where it is located:");
+ $LibDirs[0] =~ s/\\$//;
+ }
+ }
+ $Params{LIBS} = "-L$LibDir -l$snmp_link_lib -l$agent_link_lib -l$mibs_link_lib";
+ }
+
+ $Params{'INC'} = "-I$basedir\\include\\ -I$basedir\\include\\net-snmp\\ -I$basedir\\win32\\ ";
+ }
+ else {
+ $opts = NetSNMPGetOpts();
+ $Params{'LDDLFLAGS'} = "$Config{lddlflags} " . `$opts->{'nsconfig'} --ldflags`;
+ $Params{'LIBS'} = `$opts->{'nsconfig'} --base-agent-libs`;
+ chomp($Params{'LIBS'});
+ $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
+ chomp($Params{'CCFLAGS'});
+ $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
+ $lib_version = `$opts->{'nsconfig'} --version`;
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ -L../../agent/.libs -L../../agent/ " . $Params{'LIBS'};
+ $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
+# } else {
+ $Params{'LIBS'} = `$opts->{'nsconfig'} --libdir` . $Params{'LIBS'};
+# $Params{'PREREQ_PM'} = {'NetSNMP::OID' => '0.1'};
+ }
+ $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
+ die "You need to install net-snmp first (I can't find net-snmp-config)";
+ }
+ }
+
+ return(%Params);
+}
+# common subroutines -- DO NOT EDIT.
+# They are imported from the Makefile.subs.pl file
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ # we allow for perl/CPAN-only revisions beyond the default
+ # version formatting of net-snmp itself.
+ $perlver =~ s/(\.\d{5}).*/\1/;
+ $perlver =~ s/0*$//;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/agent/Support/Makefile.PL b/perl/agent/Support/Makefile.PL
new file mode 100644
index 0000000..48815b6
--- /dev/null
+++ b/perl/agent/Support/Makefile.PL
@@ -0,0 +1,229 @@
+use ExtUtils::MakeMaker;
+require 5;
+use Config;
+use Getopt::Long;
+my $lib_version;
+my %MakeParams = ();
+
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+
+%MakeParams = InitMakeParams();
+
+WriteMakefile(%MakeParams);
+
+Check_Version();
+
+sub InitMakeParams {
+ my $opts;
+ my %Params = (
+ 'NAME' => 'NetSNMP::agent::Support',
+ 'VERSION_FROM' => 'Support.pm', # finds $VERSION
+ 'XSPROTOARG' => '-prototypes',
+ 'PREREQ_PM' => {},
+ );
+
+ if ($ENV{'OSTYPE'} eq 'msys') {
+ $Params{'DEFINE'} = "-DMINGW_PERL";
+ }
+
+ my ($snmp_lib, $snmp_llib, $sep);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+ $opts = NetSNMPGetOpts();
+ $Params{'DEFINE'} = "-DMSVC_PERL -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS";
+ $sep = '\\';
+ $snmp_lib_file = 'netsnmp.lib';
+ $snmp_link_lib = 'netsnmp';
+
+ if (lc($opts->{'debug'}) eq "true") {
+ $lib_dir = 'lib\\debug';
+ }
+ else {
+ $lib_dir = 'lib\\release';
+ }
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L$basedir\\win32\\$lib_dir\\ -l$snmp_link_lib";
+ }
+ else {
+ my @LibDirs = split (';',$ENV{LIB});
+ my $LibDir;
+ if ($opts->{'prefix'}) {
+ push (@LibDirs,"$ENV{'NET-SNMP-PATH'}${sep}lib");
+ }
+ $noLibDir = 1;
+ while ($noLibDir) {
+ $LibDir = find_files(["$snmp_lib_file"],\@LibDirs);
+ if ($LibDir ne '') {
+ $noLibDir = 0;
+ # Put quotes around LibDir to allow spaces in paths
+ $LibDir = '"' . $LibDir . '"';
+ }
+ else
+ {
+ @LibDirs = ();
+ @LibDirs[0] = prompt("The Net-SNMP library ($snmp_lib_file) could not be found.\nPlease enter the directory where it is located:");
+ @LibDirs[0] =~ s/\\$//;
+ }
+ }
+ $Params{LIBS} = "-L$LibDir -l$snmp_link_lib";
+ }
+
+ $Params{'INC'} = "-I$basedir\\include\\ -I$basedir\\include\\net-snmp\\ -I$basedir\\win32\\ ";
+ }
+ else
+ {
+ $opts = NetSNMPGetOpts("../../");
+ $Params{'LIBS'} = `$opts->{'nsconfig'} --libs`;
+ chomp($Params{'LIBS'});
+ $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
+ chomp($Params{'CCFLAGS'});
+ $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
+ $lib_version = `$opts->{'nsconfig'} --version`;
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
+ $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
+ }
+ $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
+ die "You need to install net-snmp first (I can't find net-snmp-config)";
+ }
+ }
+ return (%Params);
+}
+# common subroutines -- DO NOT EDIT.
+# They are imported from the Makefile.subs.pl file
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/agent/Support/Support.pm b/perl/agent/Support/Support.pm
new file mode 100644
index 0000000..41cf694
--- /dev/null
+++ b/perl/agent/Support/Support.pm
@@ -0,0 +1,461 @@
+####################################################################
+#
+# SnmpAgent module for use with the code generated by mib2c with the
+# embedded perl configuration file mib2c.perl.conf
+#
+# Copyright Tripleplay Services Limited 2005
+# All rights reserved.
+#
+# Use is subject to license terms specified in the COPYING file
+# distributed with the Net-SNMP package.
+#
+####################################################################
+
+package NetSNMP::agent::Support;
+require Exporter;
+
+use NetSNMP::OID (':all');
+use NetSNMP::agent (':all');
+use NetSNMP::ASN (':all');
+use NetSNMP::default_store (':all');
+use Data::Dumper;
+
+
+use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
+
+@ISA = qw(Exporter getLeaf);
+@EXPORT = qw(registerAgent getOidElement setOidElement);
+@EXPORT_OK = qw();
+$VERSION = '5.0702';
+
+use strict;
+use warnings;
+
+BEGIN {
+ print STDERR "Module SnmpAgent.pm loaded ok\n";
+}
+
+# set to 1 to get extra debugging information
+my $debugging = 0;
+
+# if we're not embedded, this will get auto-set below to 1
+my $subagent = 0;
+
+################################################################
+# The oidtable is used for rapid random access to elements with known
+# oids, such as when doing gets/sets. It is not so good for
+# ordered access. For that we build a tree (see below) and setup
+# next links in the oidtable to aid in evaluating where to go next
+# for GETNEXT requests.
+################################################################
+my $oidtable;
+my $oidtree;
+
+# oidroot holds the top most oid record in the table.
+my $oidroot = "";
+
+################################################################
+# Build a tree for handling getnext requests
+# Some parts borrowed from the perl cookbook
+################################################################
+sub buildTree {
+ my ($new_oidtable) = @_;
+ foreach my $key (keys %$new_oidtable) {
+ insert($oidtree, $key);
+ }
+}
+
+sub printTree {
+ my ($tree) = @_;
+ return unless $tree;
+ printTree($tree->{LEFT});
+ print $tree->{VALUE}. "\n";
+ printTree($tree->{RIGHT});
+}
+
+my $prev="";
+##############################################################
+# Walk the sorted oid tree and set the 'next' links in the
+# oidtable.
+##############################################################
+sub doLinks {
+ my ($tree) = @_;
+ return unless $tree;
+ doLinks($tree->{LEFT});
+ if($oidroot eq "") {
+ $oidroot = $tree->{VALUE};
+# print "Setting oidroot to $oidroot\n";
+ }
+ if($prev ne "") {
+ $oidtable->{$prev}->{next} = $tree->{VALUE};
+ }
+ $prev = $tree->{VALUE};
+ my $node = $oidtable->{$tree->{VALUE}};
+ doLinks($tree->{RIGHT});
+}
+
+################################################################
+# Insert a node into the tree
+################################################################
+sub insert {
+ my ($tree, $value) = @_;
+ unless ($tree) {
+ $tree = {}; # Allocate memory
+ $tree->{VALUE} = $value;
+ $tree->{LEFT} = undef;
+ $tree->{RIGHT} = undef;
+ $_[0] = $tree;
+ return ;
+ }
+ my $tv = new NetSNMP::OID($tree->{VALUE});
+ my $mv = new NetSNMP::OID($value);
+ if ($tv > $mv) {
+ insert($tree->{LEFT}, $value);
+ } elsif ($tv < $mv) {
+ insert($tree->{RIGHT}, $value);
+ } else {
+ print "ERR: Duplicate insert of $value\n";
+ }
+}
+
+#################################################################
+## Main interface.
+## registerAgent(oid);
+#################################################################
+sub registerAgent {
+ my $agent = shift;
+ my $regat = shift;
+ my $new_oidtable = shift;
+
+ foreach (keys %$new_oidtable) { $oidtable->{$_} = $new_oidtable->{$_}; }
+
+ # This is necessary to avoid problems traversing trees where the
+ # IID index is range-limited to not include .0, which is used as a
+ # placeholder in the oidtable.
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_CHECK_RANGE, 1);
+
+ print STDERR "Building OID tree\n";
+ buildTree($new_oidtable);
+ doLinks($oidtree);
+
+# print Dumper($oidtable);
+
+ # Debug. Print the list of oids in their next ordering
+ my $node = $oidroot;
+ while($node) {
+# print $node . "\n";
+ $node = $oidtable->{$node}->{next};
+ }
+
+# where we are going to hook onto
+ my $regoid = new NetSNMP::OID($regat);
+ print "registering at ",$regoid,"\n" if ($debugging);
+
+# If we're not running embedded within the agent, then try to start
+# our own subagent instead.
+ if (! $agent) {
+ $agent = new NetSNMP::agent('Name' => 'test', # reads test.conf
+ 'AgentX' => 1); # make us a subagent
+ $subagent = 1;
+ print STDERR "started us as a subagent ($agent)\n"
+ }
+
+# we register ourselves with the master agent we're embedded in. The
+# global $agent variable is how we do this:
+ print Dumper($agent) if ($debugging);
+ $agent->register('myname',$regoid, \&my_snmp_handler);
+}
+
+
+######################################################################
+# The subroutine to handle the incoming requests to our
+# part of the OID tree. This subroutine will get called for all
+# requests within the OID space under the registration oid made above.
+######################################################################
+sub my_snmp_handler {
+ my ($handler, $registration_info, $request_info, $requests) = @_;
+
+ my $request;
+ my $reqnum=1;
+
+# print STDERR "refs: ",join(", ", ref($handler), ref($registration_info),
+ # ref($request_info), ref($requests)),"\n";
+
+ print "==============================================\n" if ($debugging);
+
+ print STDERR "processing a request of type " .
+ $request_info->getMode() . "\n" if ($debugging) ;
+ #
+ # Process each varbind in teh list of requests
+ #
+ for($request = $requests; $request; $request = $request->next()) {
+ my $oid = $request->getOID();
+ print STDERR "-- processing request of $oid (request $reqnum) \n" if ($debugging);
+
+ #
+ # Handle the different request types
+ #
+ my $mode = $request_info->getMode();
+ if ($mode == MODE_GET) {
+ getLeaf($oid, $request, $request_info);
+ } elsif ($mode == MODE_GETNEXT) {
+ getNextOid($oid, $request, $request_info);
+ } else {
+ print STDERR "Request type $mode not supported\n";
+ }
+
+ $reqnum++;
+ }
+
+ print STDERR " finished processing\n"
+ if ($debugging);
+}
+
+##########################################################
+# Given an oid see if there is an entry in the oidtable
+# and get the record if there is.
+#
+# Passed the oid as a NetSNMP oid
+#
+# Returns the record if found
+#
+##########################################################
+sub findOid {
+ my $oid = shift;
+
+ # Convert the OID to a string
+ # The index items are temporarily set to zero to cater for tables
+ my @indexes = $oid->to_array();
+
+ my $idxoffset = $oid->length() - 1;
+
+ # Locate the record in the table if it exists
+ # If no match then try setting index values to zero until
+ # we have a match of we exhaust the oid
+ while($idxoffset) {
+ my $oidstr="." . join ".", @indexes;
+ my $rec = $oidtable->{$oidstr};
+
+ # Return the record if found and the repaired index array
+ if($rec) {
+ print "Found OID $oid ($oidstr) in the table\n" if ($debugging);
+ return ($rec);
+ } else {
+ # Not found. Set the next potential index to zero and
+ # try again
+ $indexes[$idxoffset] = 0;
+ $idxoffset--;
+ }
+ }
+ return (0);
+}
+
+
+##########################################################
+# Sub to return an element of an OID
+# This is commonly used to get an index item from
+# an OID for table accesses.
+##########################################################
+sub getOidElement {
+ my ($oid, $idx) = @_;
+
+ my @idx = $oid->to_array();
+ my $len = $oid->length();
+ my $val = $idx[$idx];
+ return $val;
+}
+##########################################################
+# Sub to set an element of an OID
+# Returns a new NetSNMP::OID object
+##########################################################
+sub setOidElement {
+ my ($oid, $offset, $val) = @_;
+
+ my @idx = $oid->to_array();
+ $idx[$offset] = $val;
+ my $str = "." . join ".", @idx;
+ return new NetSNMP::OID($str);;
+}
+
+
+##########################################################
+# Given scalar record in the oidtable get the value.
+# Passed the record and the request.
+##########################################################
+sub getScalar {
+ my ($rec, $request) = @_;
+
+ # Got a scalar node from the table
+ my $type = $rec->{type};
+
+ # Call the GET function
+ my $val = $rec->{func}();
+
+ $request->setValue($type, $val);
+}
+
+############################################################
+# Given a record in the OID table that is a columnar object
+# locate any objects that have the required index.
+#
+# Passed the record, the oid object and the request
+############################################################
+sub getColumnar {
+ my ($rec, $oid, $request) = @_;
+
+ print "Get Columnar $oid\n" if ($debugging);
+
+ my $type = $rec->{type};
+ my $args = $rec->{args};
+
+ # Check the index is in range and exists
+ if($rec->{check}($oid)) {
+
+ # Call the handler function with the oid
+ my $val = $rec->{func}($oid);
+
+ # Set the value found in the request
+ $request->setValue($type, $val);
+ }
+}
+
+######################################################################
+#
+# If the oid is in range then set the data in the supplied request
+# object.
+#
+# Tries to get a scalar first then checks the coumnar second
+#
+# Return 1 if successful or 0 if not
+#
+#######################################################################
+sub getLeaf {
+ my $oid = shift;
+ my $request = shift;
+ my $request_info = shift;
+
+ print "getLeaf: $oid\n" if ($debugging);
+
+ # Find an oid entry in the table
+ my ($rec) = findOid($oid);
+ if($rec) {
+
+ # Record found. Use the istable flag to pass control to the
+ # scalar or coulmnar handler
+ if($rec->{istable} == 1) {
+ return getColumnar($rec, $oid, $request);
+ } else {
+ return getScalar($rec, $request);
+ }
+ }
+}
+
+#####################################################
+#
+# getNextOid
+#
+# The workhorse for GETNEXT.
+# Given an OID, locates the next oid and if valid does
+# a getLeaf on that OID. It does this by walking the list of
+# OIDs. We try to otimise the walk by first looking for an oid
+# in the list as follows:
+#
+# 1. Try to locate an oid match in the table.
+# If that succeeds then look for the next object in the table
+# using the next attribute and get that object.
+#
+# 2. If the OID found is a table element then use the table
+# specific index handler to see if there is an item with the
+# next index.This will retutn either an oid which we get, or 0.
+# If there is not then we continue our walk along the tree
+#
+# 3.If the supplied oid is not found, but is in the range of our oids
+# then we start at the root oid and walk the list until we either
+# drop of the end, or we fnd an OID that is greater than the OID supplied.
+# In all cases if we sucessfully find an OID to retrieve,
+# then we set the next OID in the resposnse.
+#
+######################################################
+sub getNextOid {
+ my $oid = shift;
+ my $request = shift;
+ my $request_info = shift;
+
+ my $curoid = new NetSNMP::OID($oidroot); # Current OID in the walk
+
+ # Find the starting position if we can
+ my $current = findOid($oid);
+# print Dumper($current);
+ if($current) {
+ # Found the start in the table
+ $curoid = new NetSNMP::OID($oid);
+
+ # If the node we found is not a table then start at the
+ # next oid in the table
+ unless($current->{istable}) {
+
+ my $nextoid = $current->{next};
+ $curoid = new NetSNMP::OID($nextoid);
+# print "Not a table so using the next $nextoid\n";
+ $current = $oidtable->{$nextoid};
+ }
+ }
+
+ # If we cannot find the starting point in the table, then start
+ # at the top and
+ # walk along the list until we drop off the end
+ # or we get to an oid that is >= to the one we want.
+ else {
+
+# print "Not found so using the top ($oidroot)\n";
+ $current = $oidtable->{$oidroot};
+
+ while($current && $curoid <= $oid) {
+ my $nextoid = $current->{next};
+ print "Trying $nextoid\n" if ($debugging);
+ $current = $oidtable->{$nextoid};
+ $curoid = $current ? new NetSNMP::OID($nextoid) : undef;
+ }
+ }
+
+ ##
+ ## Got a starting point
+ ## $current points to the node in the table
+ ## $curoid is a NetSNMP::OID object with the oid we are trying
+ ##
+ print "Got a startng point of " . Dumper($current) if ($debugging);
+ while($current) {
+ if($current->{istable}) {
+
+ # Got a table oid. See if the next is valid for the table
+# print "Trying table\n";
+
+ my $nextoid = $current->{nextoid}($curoid);
+
+# print Dumper($nextoid);
+ if($nextoid) {
+ getColumnar($current, $nextoid, $request);
+ $request->setOID($nextoid);
+ return;
+ }
+
+ # No not this one so try the next
+ $nextoid = $current->{next};
+ $current = $oidtable->{$nextoid};
+ $curoid = $current ? new NetSNMP::OID($nextoid) : undef;
+ print "Trying next $curoid $nextoid\n" if ($debugging);
+ } else {
+
+ # Must be the current node
+ if(getScalar($current, $request)) {
+ $request->setOID($curoid);
+ return 1;
+ }
+ }
+ }
+}
+
+
+# Return true from this module
+1;
diff --git a/perl/agent/agent.pm b/perl/agent/agent.pm
new file mode 100644
index 0000000..310e9e5
--- /dev/null
+++ b/perl/agent/agent.pm
@@ -0,0 +1,563 @@
+package NetSNMP::agent;
+
+use strict;
+use warnings;
+use Carp;
+
+require Exporter;
+require DynaLoader;
+use AutoLoader;
+
+use NetSNMP::default_store (':all');
+use NetSNMP::agent::default_store (':all');
+use NetSNMP::OID (':all');
+use NetSNMP::agent::netsnmp_request_infoPtr;
+
+use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION $AUTOLOAD);
+
+@ISA = qw(Exporter AutoLoader DynaLoader);
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration use NetSNMP::agent ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+%EXPORT_TAGS = ( 'all' => [ qw(
+ MODE_GET
+ MODE_GETBULK
+ MODE_GETNEXT
+ MODE_SET_ACTION
+ MODE_SET_BEGIN
+ MODE_SET_COMMIT
+ MODE_SET_FREE
+ MODE_SET_RESERVE1
+ MODE_SET_RESERVE2
+ MODE_SET_UNDO
+ 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
+) ] );
+
+@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+@EXPORT = qw(
+ MODE_GET
+ MODE_GETBULK
+ MODE_GETNEXT
+ MODE_SET_ACTION
+ MODE_SET_BEGIN
+ MODE_SET_COMMIT
+ MODE_SET_FREE
+ MODE_SET_RESERVE1
+ MODE_SET_RESERVE2
+ MODE_SET_UNDO
+ 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
+);
+$VERSION = '5.0702';
+
+sub AUTOLOAD {
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function. If a constant is not found then control is passed
+ # to the AUTOLOAD in AutoLoader.
+
+ my $constname;
+ ($constname = $AUTOLOAD) =~ s/.*:://;
+ croak "& not defined" if $constname eq 'constant';
+ my $val;
+ ($!, $val) = constant($constname);
+ if ($! != 0) {
+ if ($! =~ /Invalid/ || $!{EINVAL}) {
+ $AutoLoader::AUTOLOAD = $AUTOLOAD;
+ goto &AutoLoader::AUTOLOAD;
+ }
+ else {
+ croak "Your vendor has not defined NetSNMP::agent macro $constname";
+ }
+ }
+ {
+ no strict 'refs';
+ # Fixed between 5.005_53 and 5.005_61
+# if ($] >= 5.00561) {
+# *$AUTOLOAD = sub () { $val };
+# }
+# else {
+ *$AUTOLOAD = sub { $val };
+# }
+ }
+ goto &$AUTOLOAD;
+}
+
+{
+ my $haveinit = 0;
+
+ sub mark_init_agent_done {
+ $haveinit = 1;
+ }
+
+ sub maybe_init_agent {
+ return if ($haveinit);
+ $haveinit = 1;
+
+ my $flags = $_[0];
+ if ($flags->{'AgentX'}) {
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1);
+ }
+ init_agent($flags->{'Name'} || "perl");
+ if ($flags->{'Ports'}) {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_PORTS, $flags->{'Ports'});
+ }
+ init_mib();
+ }
+}
+
+{
+ my $haveinit = 0;
+
+ sub mark_init_lib_done {
+ $haveinit = 1;
+ }
+
+ sub maybe_init_lib {
+ return if ($haveinit);
+ $haveinit = 1;
+
+ my $flags = $_[0];
+ init_snmp($flags->{'Name'} || "perl");
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE) != 1) {
+ init_master_agent();
+ }
+ }
+}
+
+sub new {
+ my $type = shift;
+ my ($self);
+ %$self = @_;
+ bless($self, $type);
+ if ($self->{'dont_init_agent'}) {
+ $self->mark_init_agent_done();
+ } else {
+ $self->maybe_init_agent();
+ }
+ if ($self->{'dont_init_lib'}) {
+ $self->mark_init_lib_done();
+ }
+ return $self;
+}
+
+sub register($$$$) {
+ my ($self, $name, $oid, $sub) = @_;
+ my $reg = NetSNMP::agent::netsnmp_handler_registration::new($name, $oid, $sub);
+ $reg->register() if ($reg);
+ return $reg;
+}
+
+sub main_loop {
+ my $self = shift;
+ while(1) {
+ $self->agent_check_and_process(1);
+ }
+}
+
+sub agent_check_and_process {
+ my ($self, $blocking) = @_;
+ $self->maybe_init_lib();
+ __agent_check_and_process($blocking || 0);
+}
+
+sub uptime {
+ my $self = shift;
+ $self->maybe_init_lib();
+ return _uptime();
+}
+
+bootstrap NetSNMP::agent $VERSION;
+
+# Preloaded methods go here.
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+
+=head1 NAME
+
+NetSNMP::agent - Perl extension for the net-snmp agent.
+
+=head1 SYNOPSIS
+
+ use NetSNMP::agent;
+
+ my $agent = new NetSNMP::agent('Name' => 'my_agent_name');
+
+
+=head1 DESCRIPTION
+
+This module implements an API set to make a SNMP agent act as a snmp
+agent, a snmp subagent (using the AgentX subagent protocol) and/or
+embedded perl-APIs directly within the traditional net-snmp agent demon.
+
+Also see the tutorial about the genaral Net-SNMP C API, which this
+module implements in a perl-way, and a perl specific tutorial at:
+
+ http://www.net-snmp.org/tutorial-5/toolkit/
+
+=head1 EXAMPLES
+
+=head2 Sub-agent example
+
+ use NetSNMP::agent (':all');
+ use NetSNMP::ASN qw(ASN_OCTET_STR);
+
+ my $value = "hello world";
+ sub myhandler {
+ my ($handler, $registration_info, $request_info, $requests) = @_;
+ my $request;
+
+ for($request = $requests; $request; $request = $request->next()) {
+ my $oid = $request->getOID();
+ if ($request_info->getMode() == MODE_GET) {
+ # ... generally, you would calculate value from oid
+ if ($oid == new NetSNMP::OID(".1.3.6.1.4.1.8072.9999.9999.7375.1.0")) {
+ $request->setValue(ASN_OCTET_STR, $value);
+ }
+ } elsif ($request_info->getMode() == MODE_GETNEXT) {
+ # ... generally, you would calculate value from oid
+ if ($oid < new NetSNMP::OID(".1.3.6.1.4.1.8072.9999.9999.7375.1.0")) {
+ $request->setOID(".1.3.6.1.4.1.8072.9999.9999.7375.1.0");
+ $request->setValue(ASN_OCTET_STR, $value);
+ }
+ } elsif ($request_info->getMode() == MODE_SET_RESERVE1) {
+ if ($oid != new NetSNMP::OID(".1.3.6.1.4.1.8072.9999.9999.7375.1.0")) { # do error checking here
+ $request->setError($request_info, SNMP_ERR_NOSUCHNAME);
+ }
+ } elsif ($request_info->getMode() == MODE_SET_ACTION) {
+ # ... (or use the value)
+ $value = $request->getValue();
+ }
+ }
+
+ }
+
+ my $agent = new NetSNMP::agent(
+ # makes the agent read a my_agent_name.conf file
+ 'Name' => "my_agent_name",
+ 'AgentX' => 1
+ );
+ $agent->register("my_agent_name", ".1.3.6.1.4.1.8072.9999.9999.7375",
+ \&myhandler);
+
+ my $running = 1;
+ while($running) {
+ $agent->agent_check_and_process(1);
+ }
+
+ $agent->shutdown();
+
+
+=head2 Embedded agent example
+
+ # place this in a .pl file, and then in your snmpd.conf file put:
+ # perl do '/path/to/file.pl';
+
+ use NetSNMP::agent;
+ my $agent;
+
+ sub myhandler {
+ my ($handler, $registration_info, $request_info, $requests) = @_;
+ # ...
+ }
+
+ $agent = new NetSNMP::agent(
+ 'Name' => 'my_agent_name'
+ );
+
+ $agent->register("my_agent_name", ".1.3.6.1.4.1.8072.9999.9999.7375",
+ \&myhandler);
+
+ $agent->main_loop();
+
+
+=head1 CONSTRUCTOR
+
+ new ( OPTIONS )
+ This is the constructor for a new NetSNMP::agent object.
+
+ Possible options are:
+
+ Name - Name of the agent (optional, defaults to "perl")
+ (The snmp library will read a NAME.conf snmp
+ configuration file based on this argument.)
+ AgentX - Make us a sub-agent (0 = false, 1 = true)
+ (The Net-SNMP master agent must be running first)
+ Ports - Ports this agent will listen on (EG: "udp:161,tcp:161")
+
+ Example:
+
+ $agent = new NetSNMP::agent(
+ 'Name' => 'my_agent_name',
+ 'AgentX' => 1
+ );
+
+
+=head1 METHODS
+
+ register (NAME, OID, \&handler_routine )
+ Registers the callback handler with given OID.
+
+ $agent->register();
+
+ A return code of 0 indicates no error.
+
+ agent_check_and_process ( BLOCKING )
+ Run one iteration of the main loop.
+
+ BLOCKING - Blocking or non-blocking call. 1 = true, 0 = false.
+
+ $agent->agent_check_and_process(1);
+
+ main_loop ()
+ Runs the agent in a loop. Does not return.
+
+ shutdown ()
+ Nicely shuts down the agent or sub-agent.
+
+ $agent->shutdown();
+
+=head1 HANDLER CALLBACKS
+
+ handler ( HANDLER, REGISTRATION_INFO, REQUEST_INFO, REQUESTS )
+
+ The handler is called with the following parameters:
+
+ HANDLER - FIXME
+ REGISTRATION_INFO - what are the correct meanings of these?
+ REQUEST_INFO -
+ REQUESTS -
+
+ Example handler:
+
+ sub myhandler {
+ my ($handler, $reg_info, $request_info, $requests) = @_;
+ # ...
+ }
+
+The handler subroutine will be called when a SNMP request received by
+the agent for anything below the registered OID. The handler is
+passed 4 arguments: $handler, $registration_info, $request_info,
+$requests. These match the arguments passed to the C version of the
+same API. Note that they are not entirely complete objects but are
+functional "enough" at this point in time.
+
+=head2 $request_info object functions
+
+ getMode ()
+ Returns the mode of the request. See the MODES section for
+ list of valid modes.
+
+ $mode = $request->getMode();
+
+=head2 $registration_info object functions
+
+ getRootOID ()
+ Returns a NetSNMP::OID object that describes the registration
+ point that the handler is getting called for (in case you
+ register one handler function with multiple OIDs, which should
+ be rare anyway)
+
+ $root_oid = $request->getRootOID();
+
+=head2 $request object functions
+
+ next ()
+ Returns the next request in the list or undef if there is no
+ next request.
+
+ $request = $request->next();
+
+ getOID ()
+ Returns the oid of the request (a NetSNMP::OID class).
+
+ $oid = $request->getOID();
+
+ setOID (new NetSNMP::OID("someoid"))
+ Sets the OID of the request to a passed oid value. This
+ should generally only be done during handling of GETNEXT
+ requests.
+
+ $request->setOID(new NetSNMP::OID("someoid"));
+
+ getValue ()
+ Returns the value of the request. Used for example when
+ setting values.
+
+ $value = $request->getValue();
+
+ FIXME: how to get the type of the value? Is it even available?
+ [Wes: no, not yet.]
+
+ setValue ( TYPE, DATA )
+ Sets the data to be returned to the daemon.
+
+ Returns 1 on success, 0 on error.
+
+ TYPE - Type of the data. See NetSNMP::ASN for valid types.
+ DATA - The data to return.
+
+ $ret = $request->setValue(ASN_OCTET_STR, "test");
+
+ setError ( REQUEST_INFO, ERROR_CODE )
+ Sets the given error code for the request. See the ERROR CODES
+ section for list of valid codes.
+
+ $request->setError($request_info, SNMP_ERR_NOTWRITABLE);
+
+ getProcessed ()
+ The processed flag indicates that a request does not need to
+ be dealt with because someone else (a higher handler) has
+ dealt with it already.
+
+ $processed = $request->getProcessed();
+
+ setProcessed ( PROCESSED )
+ Sets the processed flag flag in the request. You generally
+ should not have to set this yourself.
+
+ PROCESSED - 0 = false, 1 = true
+
+ $request->setProcessed(1);
+
+ getDelegated ()
+ If you can handle a request in the background or at a future
+ time (EG, you're waiting on a file handle, or network traffic,
+ or ...), the delegated flag can be set in the request. When
+ the request is processed in the future the flag should be set
+ back to 0 so the agent will know that it can wrap up the
+ original request and send it back to the manager. This has
+ not been tested within perl, but it hopefully should work.
+
+ $delegated = $request->getDelegated();
+
+ setDelegated ( DELEGATED )
+ Sets the delegated flag.
+
+ DELEGATED - 0 = false, 1 = true
+
+ $request->setDelegated(1);
+
+ getRepeat ()
+ The repeat flag indicates that a getbulk operation is being
+ handled and this indicates how many answers need to be
+ returned. Generally, if you didn't register to directly
+ handle getbulk support yourself, you won't need to deal with
+ this value.
+
+ $repeat = $request->getRepeat();
+
+ setRepeat ( REPEAT )
+ Sets the repeat count (decrement after answering requests if
+ you handle getbulk requests yourself)
+
+ REPEAT - repeat count FIXME
+
+ $request->setRepeat(5);
+
+ getSourceIp ()
+
+ Gets the IPv4 address of the device making the request to the handler.
+
+ use Socket;
+ print "Source: ", inet_ntoa($request->getSourceIp()), "\n";
+
+ getDestIp ()
+
+ Gets the IPv4 address of the destination that the request was sent to.
+
+ use Socket;
+ print "Destination: ", inet_ntoa($request->getDestIp()), "\n";
+
+=head1 MODES
+
+ MODE_GET
+ MODE_GETBULK
+ MODE_GETNEXT
+ MODE_SET_ACTION
+ MODE_SET_BEGIN
+ MODE_SET_COMMIT
+ MODE_SET_FREE
+ MODE_SET_RESERVE1
+ MODE_SET_RESERVE2
+ MODE_SET_UNDO
+
+=head1 ERROR CODES
+
+ 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
+
+=head1 AUTHOR
+
+Please mail the net-snmp-users@lists.sourceforge.net mailing list for
+help, questions or comments about this module.
+
+Module written by:
+ Wes Hardaker <hardaker@users.sourceforge.net>
+
+Documentation written by:
+ Toni Willberg <toniw@iki.fi>
+ Wes Hardaker <hardaker@users.sourceforge.net>
+
+=head1 SEE ALSO
+
+NetSNMP::OID(3), NetSNMP::ASN(3), perl(1).
+
+=cut
diff --git a/perl/agent/agent.xs b/perl/agent/agent.xs
new file mode 100644
index 0000000..c7b5d9a
--- /dev/null
+++ b/perl/agent/agent.xs
@@ -0,0 +1,941 @@
+/* -*- C -*- */
+#if defined(_WIN32) && !defined(_WIN32_WINNT)
+#define _WIN32_WINNT 0x501
+#endif
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#include <netdb.h>
+#include <sys/socket.h>
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#ifndef sv_undef
+#define sv_undef PL_sv_undef
+#endif
+
+typedef netsnmp_handler_registration *NetSNMP__agent__netsnmp_handler_registration;
+
+/*
+ * needs to be in sync with the definitions in snmplib/snmpUDPDomain.c
+ * and snmplib/snmpTCPDomain.c
+ */
+typedef netsnmp_indexed_addr_pair netsnmp_udp_addr_pair;
+
+typedef struct handler_cb_data_s {
+ SV *perl_cb;
+} handler_cb_data;
+
+typedef struct netsnmp_oid_s {
+ oid *name;
+ size_t len;
+ oid namebuf[ MAX_OID_LEN ];
+} netsnmp_oid;
+
+#define TEST_CONSTANT(value, name, C) \
+ if (strEQ(name, #C)) { \
+ *value = C; \
+ return 0; \
+ }
+
+static int constant_MODE_G(double *value, const char *name, const int len)
+{
+ switch (len >= 8 ? name[8] : -1) {
+ case '\0':
+ TEST_CONSTANT(value, name, MODE_GET);
+ break;
+ case 'B':
+ TEST_CONSTANT(value, name, MODE_GETBULK);
+ break;
+ case 'N':
+ TEST_CONSTANT(value, name, MODE_GETNEXT);
+ break;
+ }
+ return EINVAL;
+}
+
+static int constant_MODE_SET_R(double *value, const char *name, const int len)
+{
+ switch (len >= 16 ? name[16] : -1) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case '1':
+ TEST_CONSTANT(value, name, MODE_SET_RESERVE1);
+ break;
+ case '2':
+ TEST_CONSTANT(value, name, MODE_SET_RESERVE2);
+ break;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ }
+ return EINVAL;
+}
+
+static int constant_SNMP_ERR(double *value, char *name, int len)
+{
+ switch (len >= 9 ? name[9] : -1) {
+ case 'A':
+ TEST_CONSTANT(value, name, SNMP_ERR_AUTHORIZATIONERROR);
+ break;
+ case 'B':
+ TEST_CONSTANT(value, name, SNMP_ERR_BADVALUE);
+ break;
+ case 'C':
+ TEST_CONSTANT(value, name, SNMP_ERR_COMMITFAILED);
+ break;
+ case 'G':
+ TEST_CONSTANT(value, name, SNMP_ERR_GENERR);
+ break;
+ case 'I':
+ TEST_CONSTANT(value, name, SNMP_ERR_INCONSISTENTVALUE);
+ break;
+ case 'N':
+ TEST_CONSTANT(value, name, SNMP_ERR_NOACCESS);
+ TEST_CONSTANT(value, name, SNMP_ERR_NOCREATION);
+ TEST_CONSTANT(value, name, SNMP_ERR_NOERROR);
+ TEST_CONSTANT(value, name, SNMP_ERR_NOSUCHNAME);
+ TEST_CONSTANT(value, name, SNMP_ERR_NOTWRITABLE);
+ break;
+ case 'R':
+ TEST_CONSTANT(value, name, SNMP_ERR_READONLY);
+ TEST_CONSTANT(value, name, SNMP_ERR_RESOURCEUNAVAILABLE);
+ break;
+ case 'T':
+ TEST_CONSTANT(value, name, SNMP_ERR_TOOBIG);
+ break;
+ case 'U':
+ TEST_CONSTANT(value, name, SNMP_ERR_UNDOFAILED);
+ break;
+ case 'W':
+ TEST_CONSTANT(value, name, SNMP_ERR_WRONGENCODING);
+ TEST_CONSTANT(value, name, SNMP_ERR_WRONGLENGTH);
+ TEST_CONSTANT(value, name, SNMP_ERR_WRONGTYPE);
+ TEST_CONSTANT(value, name, SNMP_ERR_WRONGVALUE);
+ break;
+ }
+ return EINVAL;
+}
+
+static int constant_MODE_S(double *value, char *name, int len)
+{
+ if (!strnEQ(name + 6, "ET_", 3))
+ return EINVAL;
+
+ switch (len >= 9 ? name[9] : -1) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case 'A':
+ TEST_CONSTANT(value, name, MODE_SET_ACTION);
+ break;
+ case 'B':
+ TEST_CONSTANT(value, name, MODE_SET_BEGIN);
+ break;
+ case 'C':
+ TEST_CONSTANT(value, name, MODE_SET_COMMIT);
+ break;
+ case 'F':
+ TEST_CONSTANT(value, name, MODE_SET_FREE);
+ break;
+ case 'U':
+ TEST_CONSTANT(value, name, MODE_SET_UNDO);
+ break;
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+ case 'R':
+ return constant_MODE_SET_R(value, name, len);
+ }
+ return EINVAL;
+}
+
+static int constant(double *value, char *name, int len)
+{
+ switch (len >= 5 ? name[5] : -1) {
+ case 'G':
+ if (strnEQ(name + 0,"MODE_", 5))
+ return constant_MODE_G(value, name, len);
+ break;
+ case 'S':
+ if (strnEQ(name + 0,"MODE_", 5))
+ return constant_MODE_S(value, name, len);
+ break;
+ case 'E':
+ if (strnEQ(name + 0,"SNMP_ERR_", 9))
+ return constant_SNMP_ERR(value, name, len);
+ break;
+ }
+ return EINVAL;
+}
+
+int
+handler_wrapper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ handler_cb_data *cb_data = (handler_cb_data *) handler->myvoid;
+ SV *cb;
+
+ if (cb_data && (cb = cb_data->perl_cb)) {
+ SV *arg;
+ SV *rarg;
+ dSP;
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(sp);
+ rarg = newSViv(0);
+ arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_mib_handler");
+ sv_setiv(arg, (IV) handler);
+ XPUSHs(sv_2mortal(rarg));
+ rarg = newSViv(0);
+ arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_handler_registrationPtr");
+ sv_setiv(arg, (IV) reginfo);
+ XPUSHs(sv_2mortal(rarg));
+ rarg = newSViv(0);
+ arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_agent_request_info");
+ sv_setiv(arg, (IV) reqinfo);
+ XPUSHs(sv_2mortal(rarg));
+ rarg = newSViv(0);
+ arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_request_infoPtr");
+ sv_setiv(arg, (IV) requests);
+ XPUSHs(sv_2mortal(rarg));
+ PUTBACK;
+ if (SvTYPE(cb) == SVt_PVCV) {
+ perl_call_sv(cb, G_DISCARD);
+
+ } else if (SvROK(cb) && SvTYPE(SvRV(cb)) == SVt_PVCV) {
+ perl_call_sv(SvRV(cb), G_DISCARD);
+ }
+ SPAGAIN;
+ PUTBACK;
+ FREETMPS;
+ LEAVE;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+MODULE = NetSNMP::agent PACKAGE = NetSNMP::agent
+
+void
+constant(sv)
+ PREINIT:
+ STRLEN len;
+ INPUT:
+ SV * sv
+ char * s = SvPV(sv, len);
+ INIT:
+ int status;
+ double value;
+ PPCODE:
+ value = 0;
+ status = constant(&value, s, len);
+ XPUSHs(sv_2mortal(newSVuv(status)));
+ XPUSHs(sv_2mortal(newSVnv(value)));
+
+int
+__agent_check_and_process(block = 1)
+ int block;
+ CODE:
+ RETVAL = agent_check_and_process(block);
+ OUTPUT:
+ RETVAL
+
+int
+_uptime()
+ CODE:
+ RETVAL = netsnmp_get_agent_uptime();
+ OUTPUT:
+ RETVAL
+
+void
+init_mib()
+ CODE:
+ {
+ netsnmp_init_mib();
+ }
+
+int
+init_agent(name)
+ const char *name;
+ CODE:
+ SOCK_STARTUP;
+ RETVAL = init_agent(name);
+ OUTPUT:
+ RETVAL
+
+void
+init_snmp(name)
+ const char *name;
+
+int
+init_master_agent()
+
+void
+snmp_enable_stderrlog()
+
+MODULE = NetSNMP::agent PACKAGE = NetSNMP::agent PREFIX = na_
+
+void
+na_shutdown(me)
+ SV *me;
+ CODE:
+ {
+ if (0)
+ printf("me = %p\n", me);
+ snmp_shutdown("perl");
+ }
+
+void
+na_errlog(me,value)
+ SV *me;
+ SV *value;
+ PREINIT:
+ STRLEN stringlen;
+ char * stringptr;
+ CODE:
+ {
+ if (0)
+ printf("me = %p\n", me);
+ stringptr = SvPV(value, stringlen);
+ snmp_log(LOG_ERR, "%s", stringptr );
+ }
+
+
+
+MODULE = NetSNMP::agent PACKAGE = NetSNMP::agent::netsnmp_handler_registration PREFIX = nsahr_
+
+NetSNMP::agent::netsnmp_handler_registration
+nsahr_new(name, regoid, perlcallback)
+ char *name;
+ char *regoid;
+ SV *perlcallback;
+ PREINIT:
+ oid myoid[MAX_OID_LEN];
+ size_t myoid_len = MAX_OID_LEN;
+ handler_cb_data *cb_data;
+ int gotit=1;
+ CODE:
+ if (!snmp_parse_oid(regoid, myoid, &myoid_len)) {
+ if (!read_objid(regoid, myoid, &myoid_len)) {
+ snmp_log(LOG_ERR, "couldn't parse %s (reg name: %s)\n",
+ regoid, name);
+ RETVAL = NULL;
+ gotit = 0;
+ }
+ }
+ if (gotit) {
+ cb_data = (handler_cb_data *) malloc(sizeof(handler_cb_data));
+ RETVAL = netsnmp_create_handler_registration(name, handler_wrapper,
+ myoid, myoid_len,
+ HANDLER_CAN_RWRITE);
+ cb_data->perl_cb = newSVsv(perlcallback);
+ RETVAL->handler->myvoid = cb_data;
+ }
+ OUTPUT:
+ RETVAL
+
+void
+nsahr_DESTROY(reginfo)
+ netsnmp_handler_registration *reginfo
+ PREINIT:
+ handler_cb_data *cb_data;
+ CODE:
+ if (reginfo && reginfo->handler && reginfo->handler->myvoid) {
+ cb_data = (handler_cb_data *) (reginfo->handler->myvoid);
+ SvREFCNT_dec(cb_data->perl_cb);
+ free(cb_data);
+ }
+ netsnmp_handler_registration_free(reginfo);
+
+int
+nsahr_register(me)
+ SV *me;
+ PREINIT:
+ netsnmp_handler_registration *reginfo;
+ handler_cb_data *cb_data = NULL;
+ CODE:
+ {
+ reginfo = (netsnmp_handler_registration *) SvIV(SvRV(me));
+ if (reginfo && reginfo->handler && reginfo->handler->myvoid)
+ cb_data = (handler_cb_data *) (reginfo->handler->myvoid);
+ RETVAL = netsnmp_register_handler(reginfo);
+ if (!RETVAL) {
+ /* the agent now has a "reference" to this reg pointer */
+ SvREFCNT_inc(me);
+ } else {
+ /*
+ * The reginfo was freed by netsnmp_register_handler,
+ * don't touch it in nsahr_DESTROY!
+ */
+ sv_setiv(SvRV(me), 0);
+ if (cb_data) {
+ /* And just free the callback. */
+ SvREFCNT_dec(cb_data->perl_cb);
+ free(cb_data);
+ }
+ }
+ }
+ OUTPUT:
+ RETVAL
+
+
+MODULE = NetSNMP::agent PACKAGE = NetSNMP::agent::netsnmp_handler_registrationPtr PREFIX = nsahr_
+
+void
+nsahr_getRootOID(me)
+ SV *me;
+ PREINIT:
+ int i;
+ netsnmp_oid *o;
+ netsnmp_handler_registration *reginfo;
+ SV *arg, *rarg;
+ PPCODE:
+ {
+ dSP;
+ PUSHMARK(SP);
+ reginfo = (netsnmp_handler_registration *) SvIV(SvRV(me));
+
+ o = malloc(sizeof(netsnmp_oid));
+ o->name = o->namebuf;
+ o->len = reginfo->rootoid_len;
+ memcpy(o->name, reginfo->rootoid,
+ reginfo->rootoid_len * sizeof(oid));
+
+ rarg = newSViv((int) 0);
+ arg = newSVrv(rarg, "netsnmp_oidPtr");
+ sv_setiv(arg, (IV) o);
+
+ XPUSHs(sv_2mortal(rarg));
+
+ PUTBACK;
+ i = perl_call_pv("NetSNMP::OID::newwithptr", G_SCALAR);
+ SPAGAIN;
+ if (i != 1) {
+ snmp_log(LOG_ERR, "unhandled OID error.\n");
+ /* ack XXX */
+ }
+ ST(0) = POPs;
+ XSRETURN(1);
+ }
+
+MODULE = NetSNMP::agent PACKAGE = NetSNMP::agent::netsnmp_request_infoPtr PREFIX = nari_
+
+void
+getOID(me)
+ SV *me;
+ PREINIT:
+ int i;
+ netsnmp_oid *o;
+ netsnmp_request_info *request;
+ SV *arg, *rarg;
+ PPCODE:
+ {
+ dSP;
+ PUSHMARK(SP);
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+
+ o = malloc(sizeof(netsnmp_oid));
+ o->name = o->namebuf;
+ o->len = request->requestvb->name_length;
+ memcpy(o->name, request->requestvb->name,
+ request->requestvb->name_length * sizeof(oid));
+
+ rarg = newSViv((int) 0);
+ arg = newSVrv(rarg, "netsnmp_oidPtr");
+ sv_setiv(arg, (IV) o);
+
+ XPUSHs(sv_2mortal(rarg));
+
+ PUTBACK;
+ i = perl_call_pv("NetSNMP::OID::newwithptr", G_SCALAR);
+ SPAGAIN;
+ if (i != 1) {
+ snmp_log(LOG_ERR, "unhandled OID error.\n");
+ /* ack XXX */
+ }
+ ST(0) = POPs;
+ XSRETURN(1);
+ }
+
+netsnmp_oid *
+nari_getOIDptr(me)
+ SV *me;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ RETVAL = malloc(sizeof(netsnmp_oid));
+ RETVAL->name = RETVAL->namebuf;
+ RETVAL->len = request->requestvb->name_length;
+ memcpy(RETVAL->name, request->requestvb->name,
+ request->requestvb->name_length * sizeof(oid));
+ OUTPUT:
+ RETVAL
+
+int
+nari_getType(me)
+ SV *me;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+
+ RETVAL = request->requestvb->type ;
+ OUTPUT:
+ RETVAL
+
+void
+nari_setType(me, newvalue)
+ SV *me;
+ int newvalue;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ request->requestvb->type=newvalue;
+
+SV *
+nari_getValue(me)
+ SV *me;
+ PREINIT:
+ char *outbuf = NULL;
+ size_t ob_len = 0, oo_len = 0;
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ sprint_realloc_by_type((u_char **) &outbuf, &ob_len, &oo_len, 1,
+ request->requestvb, 0, 0, 0);
+ RETVAL = newSVpv(outbuf, 0);
+ netsnmp_free(outbuf);
+ OUTPUT:
+ RETVAL
+
+int
+nari_getDelegated(me)
+ SV *me;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ RETVAL = request->delegated;
+ OUTPUT:
+ RETVAL
+
+void
+nari_setDelegated(me, newdelegated)
+ SV *me;
+ int newdelegated;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ request->delegated = newdelegated;
+
+int
+nari_getProcessed(me)
+ SV *me;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ RETVAL = request->processed;
+ OUTPUT:
+ RETVAL
+
+void
+nari_setProcessed(me, newprocessed)
+ SV *me;
+ int newprocessed;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ request->processed = newprocessed;
+
+int
+nari_getStatus(me)
+ SV *me;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ RETVAL = request->status;
+ OUTPUT:
+ RETVAL
+
+void
+nari_setStatus(me, newstatus)
+ SV *me;
+ int newstatus;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ request->status = newstatus;
+
+int
+nari_getRepeat(me)
+ SV *me;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ RETVAL = request->repeat;
+ OUTPUT:
+ RETVAL
+
+void
+nari_setRepeat(me, newrepeat)
+ SV *me;
+ int newrepeat;
+ PREINIT:
+ netsnmp_request_info *request;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ request->repeat = newrepeat;
+
+int
+nari_setValue(me, type, value)
+ SV *me;
+ int type;
+ SV *value;
+ PREINIT:
+ netsnmp_request_info *request;
+ u_long utmp;
+ long ltmp;
+ uint64_t ulltmp;
+ struct counter64 c64;
+ oid myoid[MAX_OID_LEN];
+ size_t myoid_len;
+ STRLEN stringlen;
+ char * stringptr;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ switch(type) {
+ case SNMP_NOSUCHINSTANCE :
+ snmp_set_var_typed_value(request->requestvb,SNMP_NOSUCHINSTANCE,0,0) ;
+ RETVAL = 1;
+ break ;
+ case SNMP_NOSUCHOBJECT :
+ snmp_set_var_typed_value(request->requestvb,SNMP_NOSUCHOBJECT,0,0) ;
+ RETVAL = 1;
+ break ;
+ case SNMP_ENDOFMIBVIEW :
+ snmp_set_var_typed_value(request->requestvb,SNMP_ENDOFMIBVIEW,0,0) ;
+ RETVAL = 1;
+ break ;
+ case ASN_INTEGER:
+ /* We want an integer here */
+ if ((SvTYPE(value) == SVt_IV) || (SvTYPE(value) == SVt_PVMG) ||
+ SvIOK(value)) {
+ /* Good - got a real one (or a blessed object that we hope will turn out OK) */
+ ltmp = SvIV(value);
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *) &ltmp, sizeof(ltmp));
+ RETVAL = 1;
+ break;
+ }
+ else if (SvPOKp(value)) {
+ /* Might be OK - got a string, so try to convert it, allowing base 10, octal, and hex forms */
+ stringptr = SvPV(value, stringlen);
+ ltmp = strtol( stringptr, NULL, 0 );
+ if (errno == EINVAL) {
+ snmp_log(LOG_ERR, "Could not convert string to number in setValue: '%s'", stringptr);
+ RETVAL = 0;
+ break;
+ }
+
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *) &ltmp, sizeof(ltmp));
+ RETVAL = 1;
+ break;
+ }
+ else {
+ snmp_log(LOG_ERR, "Non-integer value passed to setValue with ASN_INTEGER: type was %lu\n",
+ (unsigned long)SvTYPE(value));
+ RETVAL = 0;
+ break;
+ }
+
+
+ case ASN_UNSIGNED:
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ /* We want an integer here */
+ if ((SvTYPE(value) == SVt_IV) || (SvTYPE(value) == SVt_PVMG) ||
+ SvIOK(value)) {
+ /* Good - got a real one (or a blessed scalar which we have to hope will turn out OK) */
+ utmp = SvIV(value);
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *) &utmp, sizeof(utmp));
+ RETVAL = 1;
+ break;
+ }
+ else if (SvPOKp(value)) {
+ /* Might be OK - got a string, so try to convert it, allowing base 10, octal, and hex forms */
+ stringptr = SvPV(value, stringlen);
+ utmp = strtoul( stringptr, NULL, 0 );
+ if (errno == EINVAL) {
+ snmp_log(LOG_ERR, "Could not convert string to number in setValue: '%s'", stringptr);
+ RETVAL = 0;
+ break;
+ }
+
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *) &utmp, sizeof(utmp));
+ RETVAL = 1;
+ break;
+ }
+ else {
+ snmp_log(LOG_ERR, "Non-unsigned-integer value passed to setValue with ASN_UNSIGNED/ASN_COUNTER/ASN_TIMETICKS: type was %lu\n",
+ (unsigned long)SvTYPE(value));
+ RETVAL = 0;
+ break;
+ }
+
+ case ASN_COUNTER64:
+ /* We want an integer here */
+ if ((SvTYPE(value) == SVt_IV) || (SvTYPE(value) == SVt_PVMG)) {
+ /* Good - got a real one (or a blessed scalar which we have to hope will turn out OK) */
+ ulltmp = SvIV(value);
+ RETVAL = 1;
+ }
+ else if (SvPOKp(value)) {
+ /* Might be OK - got a string, so try to convert it, allowing base 10, octal, and hex forms */
+ stringptr = SvPV(value, stringlen);
+ errno = 0;
+ ulltmp = strtoull( stringptr, NULL, 0 );
+ if (errno != 0) {
+ snmp_log(LOG_ERR, "Could not convert string to number in setValue: '%s'", stringptr);
+ RETVAL = 0;
+ } else
+
+ RETVAL = 1;
+ }
+ else {
+ snmp_log(LOG_ERR, "Non-unsigned-integer value passed to setValue with ASN_COUNTER64: type was %lu\n",
+ (unsigned long)SvTYPE(value));
+ RETVAL = 0;
+ }
+ if (RETVAL) {
+ c64.high = (uint32_t)(ulltmp >> 32);
+ c64.low = (uint32_t)(ulltmp >> 0);
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *) &c64, sizeof(struct counter64));
+ }
+ break;
+
+ case ASN_OCTET_STR:
+ case ASN_BIT_STR:
+ case ASN_OPAQUE:
+ /* Check that we have been passed something with a string value (or a blessed scalar) */
+ if (!SvPOKp(value) && (SvTYPE(value) != SVt_PVMG)) {
+ snmp_log(LOG_ERR, "Non-string value passed to setValue with ASN_OCTET_STR/ASN_BIT_STR: type was %lu\n",
+ (unsigned long)SvTYPE(value));
+ RETVAL = 0;
+ break;
+ }
+
+ /* Find length of string (strlen will *not* do, as these are binary strings) */
+ stringptr = SvPV(value, stringlen);
+
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *) stringptr,
+ stringlen);
+ RETVAL = 1;
+ break;
+
+ case ASN_IPADDRESS:
+ /* IP addresses are passed as *binary* strings.
+ * In the case of IPv4 addresses, these are 4 bytes long.
+ * NOTE: the use of binary strings rather than dotted-quad or FQDNs was
+ * introduced here by Andrew Findlay's patch of March 17th 2003,
+ * and is effectively a change to the previous implied API which assumed
+ * the value was a (valid) hostname.
+ * Responsibility for decoding and resolving has been passed up to the Perl script.
+ */
+
+ /* Check that we have been passed something with a string value (or a blessed scalar) */
+ if (!SvPOKp(value) && (SvTYPE(value) != SVt_PVMG)) {
+ snmp_log(LOG_ERR, "Non-string value passed to setValue with ASN_IPADDRESS: type was %lu\n",
+ (unsigned long)SvTYPE(value));
+ RETVAL = 0;
+ break;
+ }
+
+ /* Find length of string (strlen will *not* do, as these are binary strings) */
+ stringptr = SvPV(value, stringlen);
+
+ # snmp_log(LOG_ERR, "IP address returned with length %d: %u.%u.%u.%u\n", stringlen, stringptr[0],
+ # stringptr[1], stringptr[2], stringptr[3] );
+
+ # Sanity check on address length
+ if ((stringlen != 4) && (stringlen != 16)) {
+ snmp_log(LOG_ERR, "IP address of %" NETSNMP_PRIz "d bytes passed to setValue with ASN_IPADDRESS\n", stringlen);
+ RETVAL = 0;
+ break;
+ }
+
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ stringptr, stringlen);
+ RETVAL = 1;
+ break;
+
+ case ASN_OBJECT_ID:
+ /* Check that we have been passed something with a string value (or a blessed scalar) */
+ if (!SvPOKp(value) && (SvTYPE(value) != SVt_PVMG)) {
+ snmp_log(LOG_ERR, "Non-string value passed to setValue with ASN_OBJECT_ID: type was %lu\n",
+ (unsigned long)SvTYPE(value));
+ RETVAL = 0;
+ break;
+ }
+
+ /* Extract the string */
+ stringptr = SvPV(value, stringlen);
+
+ /* snmp_log(LOG_ERR, "setValue returning OID '%s'\n", stringptr); */
+
+ myoid_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(stringptr, myoid, &myoid_len)) {
+ snmp_log(LOG_ERR, "couldn't parse %s in setValue\n", stringptr);
+ RETVAL = 0;
+ break;
+ } else {
+ /* snmp_log(LOG_ERR, "setValue returning OID length %d\n", myoid_len); */
+
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *) myoid, (myoid_len * sizeof(myoid[0])) );
+ }
+
+ RETVAL = 1;
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown var value type: %d\n",
+ type);
+ RETVAL = 0;
+ break;
+ }
+
+ OUTPUT:
+ RETVAL
+
+void
+nari_setOID(me, value)
+ SV *me;
+ char *value;
+ PREINIT:
+ oid myoid[MAX_OID_LEN];
+ size_t myoid_len = MAX_OID_LEN;
+ netsnmp_request_info *request;
+ CODE:
+ myoid_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(value, myoid, &myoid_len)) {
+ snmp_log(LOG_ERR, "couldn't parse %s in setOID\n", value);
+ } else {
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ snmp_set_var_objid(request->requestvb, myoid, myoid_len);
+ }
+
+void
+nari_setError(me, rinfo, ecode)
+ SV *me;
+ SV *rinfo;
+ int ecode;
+ PREINIT:
+ netsnmp_request_info *request;
+ netsnmp_agent_request_info *reqinfo;
+ CODE:
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ reqinfo = (netsnmp_agent_request_info *) SvIV(SvRV(rinfo));
+ netsnmp_set_request_error(reqinfo, request, ecode);
+
+SV *
+nari_next(me)
+ SV *me;
+ PREINIT:
+ netsnmp_request_info *request;
+ SV *arg, *rarg;
+ CODE:
+ {
+ request = (netsnmp_request_info *) SvIV(SvRV(me));
+ if (request && request->next) {
+ request = request->next;
+ rarg = newSViv(0);
+ arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_request_infoPtr");
+ sv_setiv(arg, (IV) request);
+ RETVAL = rarg;
+ } else {
+ RETVAL = &sv_undef;
+ }
+ }
+ OUTPUT:
+ RETVAL
+
+MODULE = NetSNMP::agent PACKAGE = NetSNMP::agent::netsnmp_agent_request_info PREFIX = narqi_
+
+
+SV *
+narqi_getSourceIp(me)
+ SV *me;
+ PREINIT:
+ netsnmp_agent_request_info *reqinfo;
+ netsnmp_udp_addr_pair *addr_pair;
+ struct sockaddr_in *from;
+ SV *rarg;
+
+ CODE:
+ reqinfo = (netsnmp_agent_request_info *) SvIV(SvRV(me));
+
+ /* XXX: transport-specific: UDP/IPv4 only! */
+ addr_pair = (netsnmp_udp_addr_pair *) (reqinfo->asp->pdu->transport_data);
+ from = (struct sockaddr_in *) &(addr_pair->remote_addr);
+ rarg = newSVpv((const char *)(&from->sin_addr.s_addr), sizeof(from->sin_addr.s_addr));
+ RETVAL = rarg;
+ OUTPUT:
+ RETVAL
+
+
+SV *
+narqi_getDestIp(me)
+ SV *me;
+ PREINIT:
+ netsnmp_agent_request_info *reqinfo;
+ netsnmp_udp_addr_pair *addr_pair;
+ struct in_addr *to;
+ SV *rarg;
+
+ CODE:
+ reqinfo = (netsnmp_agent_request_info *) SvIV(SvRV(me));
+
+ /* XXX: transport-specific: UDP/IPv4 only! */
+ addr_pair = (netsnmp_udp_addr_pair *) (reqinfo->asp->pdu->transport_data);
+ to = (struct in_addr *) &(addr_pair->local_addr);
+ rarg = newSVpv((const char *)(&to->s_addr), sizeof(to->s_addr));
+ RETVAL = rarg;
+ OUTPUT:
+ RETVAL
+
+int
+narqi_getMode(me)
+ SV *me;
+ PREINIT:
+ netsnmp_agent_request_info *reqinfo;
+ CODE:
+ reqinfo = (netsnmp_agent_request_info *) SvIV(SvRV(me));
+ RETVAL = reqinfo->mode;
+ OUTPUT:
+ RETVAL
+
+void
+narqi_setMode(me, newvalue)
+ SV *me;
+ int newvalue;
+ PREINIT:
+ netsnmp_agent_request_info *reqinfo;
+ CODE:
+ reqinfo = (netsnmp_agent_request_info *) SvIV(SvRV(me));
+ reqinfo->mode = newvalue;
+
+
+MODULE = NetSNMP::agent PACKAGE = NetSNMP::agent
+
diff --git a/perl/agent/default_store/Makefile.PL b/perl/agent/default_store/Makefile.PL
new file mode 100644
index 0000000..ed6483a
--- /dev/null
+++ b/perl/agent/default_store/Makefile.PL
@@ -0,0 +1,228 @@
+use ExtUtils::MakeMaker;
+require 5;
+use Config;
+use Getopt::Long;
+my $lib_version;
+my %MakeParams = ();
+
+%MakeParams = InitMakeParams();
+
+WriteMakefile(%MakeParams);
+
+Check_Version();
+
+sub InitMakeParams {
+ my $opts;
+ my %Params = (
+ 'NAME' => 'NetSNMP::agent::default_store',
+ 'VERSION_FROM' => 'default_store.pm', # finds $VERSION
+ 'XSPROTOARG' => '-prototypes',
+ );
+
+ if ($ENV{'OSTYPE'} eq 'msys') {
+ $Params{'DEFINE'} = "-DMINGW_PERL";
+ }
+
+ my ($snmp_lib, $snmp_llib, $sep);
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+ $opts = NetSNMPGetOpts();
+ $Params{'DEFINE'} = "-DMSVC_PERL -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS";
+ $sep = '\\';
+ $snmp_lib_file = 'netsnmp.lib';
+ $snmp_link_lib = 'netsnmp';
+
+ if (lc($opts->{'debug'}) eq "true") {
+ $lib_dir = 'lib\\debug';
+ }
+ else {
+ $lib_dir = 'lib\\release';
+ }
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L$basedir\\win32\\$lib_dir\\ -l$snmp_link_lib";
+ }
+ else {
+ my @LibDirs = split (';',$ENV{LIB});
+ my $LibDir;
+ if ($opts->{'prefix'}) {
+ push (@LibDirs,"$ENV{'NET-SNMP-PATH'}${sep}lib");
+ }
+ $noLibDir = 1;
+ while ($noLibDir) {
+ $LibDir = find_files(["$snmp_lib_file"],\@LibDirs);
+ if ($LibDir ne '') {
+ $noLibDir = 0;
+ # Put quotes around LibDir to allow spaces in paths
+ $LibDir = '"' . $LibDir . '"';
+ }
+ else
+ {
+ @LibDirs = ();
+ $LibDirs[0] = prompt("The Net-SNMP library ($snmp_lib_file) could not be found.\nPlease enter the directory where it is located:");
+ $LibDirs[0] =~ s/\\$//;
+ }
+ }
+ $Params{LIBS} = "-L$LibDir -l$snmp_link_lib";
+ }
+
+ $Params{'INC'} = "-I$basedir\\include\\ -I$basedir\\include\\net-snmp\\ -I$basedir\\win32\\ ";
+ }
+ else {
+ $opts = NetSNMPGetOpts("../../");
+ $Params{'LIBS'} = `$opts->{'nsconfig'} --libs`;
+ chomp($Params{'LIBS'});
+ $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
+ chomp($Params{'CCFLAGS'});
+ $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
+ $lib_version = `$opts->{'nsconfig'} --version`;
+ if ($opts->{'insource'} eq "true") {
+ $Params{'LIBS'} = "-L../../../snmplib/.libs -L../../../snmplib/ " . $Params{'LIBS'};
+ $Params{'CCFLAGS'} = "-I../../../include " . $Params{'CCFLAGS'};
+ }
+ $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
+ die "You need to install net-snmp first (I can't find net-snmp-config)";
+ }
+ }
+
+ return(%Params);
+}
+
+# common subroutines -- DO NOT EDIT.
+# They are imported from the Makefile.subs.pl file
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ # we allow for perl/CPAN-only revisions beyond the default
+ # version formatting of net-snmp itself.
+ $perlver =~ s/(\.\d{5}).*/\1/;
+ $perlver =~ s/0*$//;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/agent/default_store/default_store.pm b/perl/agent/default_store/default_store.pm
new file mode 100644
index 0000000..ebac1ec
--- /dev/null
+++ b/perl/agent/default_store/default_store.pm
@@ -0,0 +1,370 @@
+package NetSNMP::agent::default_store;
+
+use strict;
+use warnings;
+use Carp;
+
+require Exporter;
+require DynaLoader;
+use AutoLoader;
+
+use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION $AUTOLOAD);
+
+@ISA = qw(Exporter DynaLoader);
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration use NetSNMP::agent::default_store ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+%EXPORT_TAGS = ( 'all' => [ qw(
+ NETSNMP_DS_AGENT_VERBOSE
+ NETSNMP_DS_AGENT_ROLE
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS
+ NETSNMP_DS_AGENT_AGENTX_MASTER
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
+ NETSNMP_DS_AGENT_DISABLE_PERL
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE
+ NETSNMP_DS_AGENT_NO_CACHING
+ NETSNMP_DS_AGENT_STRICT_DISMAN
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES
+ NETSNMP_DS_AGENT_PROGNAME
+ NETSNMP_DS_AGENT_X_SOCKET
+ NETSNMP_DS_AGENT_PORTS
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ NETSNMP_DS_AGENT_PERL_INIT_FILE
+ NETSNMP_DS_SMUX_SOCKET
+ NETSNMP_DS_NOTIF_LOG_CTX
+ NETSNMP_DS_AGENT_FLAGS
+ NETSNMP_DS_AGENT_USERID
+ NETSNMP_DS_AGENT_GROUPID
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ NETSNMP_DS_AGENT_AGENTX_RETRIES
+ NETSNMP_DS_AGENT_X_SOCK_PERM
+ NETSNMP_DS_AGENT_X_DIR_PERM
+ NETSNMP_DS_AGENT_X_SOCK_USER
+ NETSNMP_DS_AGENT_X_SOCK_GROUP
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT
+ NETSNMP_DS_AGENT_INTERNAL_VERSION
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL
+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS
+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES
+) ] );
+
+@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+@EXPORT = qw(
+ NETSNMP_DS_AGENT_VERBOSE
+ NETSNMP_DS_AGENT_ROLE
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS
+ NETSNMP_DS_AGENT_AGENTX_MASTER
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
+ NETSNMP_DS_AGENT_DISABLE_PERL
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE
+ NETSNMP_DS_AGENT_NO_CACHING
+ NETSNMP_DS_AGENT_STRICT_DISMAN
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES
+ NETSNMP_DS_AGENT_PROGNAME
+ NETSNMP_DS_AGENT_X_SOCKET
+ NETSNMP_DS_AGENT_PORTS
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ NETSNMP_DS_AGENT_PERL_INIT_FILE
+ NETSNMP_DS_SMUX_SOCKET
+ NETSNMP_DS_NOTIF_LOG_CTX
+ NETSNMP_DS_AGENT_FLAGS
+ NETSNMP_DS_AGENT_USERID
+ NETSNMP_DS_AGENT_GROUPID
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ NETSNMP_DS_AGENT_AGENTX_RETRIES
+ NETSNMP_DS_AGENT_X_SOCK_PERM
+ NETSNMP_DS_AGENT_X_DIR_PERM
+ NETSNMP_DS_AGENT_X_SOCK_USER
+ NETSNMP_DS_AGENT_X_SOCK_GROUP
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT
+ NETSNMP_DS_AGENT_INTERNAL_VERSION
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL
+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS
+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES
+);
+$VERSION = '5.0702';
+
+sub AUTOLOAD {
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function.
+
+ my $constname;
+ ($constname = $AUTOLOAD) =~ s/.*:://;
+ croak "&NetSNMP::agent::default_store::constant not defined" if $constname eq 'cons
+tant';
+ my ($error, $val) = constant($constname);
+ if ($error) { croak $error; }
+ {
+ no strict 'refs';
+ # Fixed between 5.005_53 and 5.005_61
+#XXX if ($] >= 5.00561) {
+#XXX *$AUTOLOAD = sub () { $val };
+#XXX }
+#XXX else {
+ *$AUTOLOAD = sub { $val };
+#XXX }
+ }
+ goto &$AUTOLOAD;
+}
+
+bootstrap NetSNMP::agent::default_store $VERSION;
+
+# Preloaded methods go here.
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+
+=head1 NAME
+
+NetSNMP::agent::default_store - Perl extension for Net-SNMP agent default storage
+
+=head1 SYNOPSIS
+
+ use NetSNMP::agent::default_store qw(:all);
+
+=head1 DESCRIPTION
+
+The NetSNMP::agent::default_store module defines the agent-specific Net-SNMP
+default storage variables.
+
+=head2 EXPORT
+
+None by default.
+
+=head2 Exportable constants
+
+ NETSNMP_DS_AGENT_VERBOSE
+ NETSNMP_DS_AGENT_ROLE
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS
+ NETSNMP_DS_AGENT_AGENTX_MASTER
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
+ NETSNMP_DS_AGENT_DISABLE_PERL
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE
+ NETSNMP_DS_AGENT_NO_CACHING
+ NETSNMP_DS_AGENT_STRICT_DISMAN
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES
+ NETSNMP_DS_AGENT_PROGNAME
+ NETSNMP_DS_AGENT_X_SOCKET
+ NETSNMP_DS_AGENT_PORTS
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ NETSNMP_DS_AGENT_PERL_INIT_FILE
+ NETSNMP_DS_SMUX_SOCKET
+ NETSNMP_DS_NOTIF_LOG_CTX
+ NETSNMP_DS_AGENT_FLAGS
+ NETSNMP_DS_AGENT_USERID
+ NETSNMP_DS_AGENT_GROUPID
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ NETSNMP_DS_AGENT_AGENTX_RETRIES
+ NETSNMP_DS_AGENT_X_SOCK_PERM
+ NETSNMP_DS_AGENT_X_DIR_PERM
+ NETSNMP_DS_AGENT_X_SOCK_USER
+ NETSNMP_DS_AGENT_X_SOCK_GROUP
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT
+ NETSNMP_DS_AGENT_INTERNAL_VERSION
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL
+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS
+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES
+
+
+ NETSNMP_DS_AGENT_VERBOSE
+ NETSNMP_DS_AGENT_ROLE
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS
+ NETSNMP_DS_AGENT_AGENTX_MASTER
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
+ NETSNMP_DS_AGENT_DISABLE_PERL
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE
+ NETSNMP_DS_AGENT_NO_CACHING
+ NETSNMP_DS_AGENT_STRICT_DISMAN
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES
+ NETSNMP_DS_AGENT_PROGNAME
+ NETSNMP_DS_AGENT_X_SOCKET
+ NETSNMP_DS_AGENT_PORTS
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ NETSNMP_DS_AGENT_PERL_INIT_FILE
+ NETSNMP_DS_SMUX_SOCKET
+ NETSNMP_DS_NOTIF_LOG_CTX
+ NETSNMP_DS_AGENT_FLAGS
+ NETSNMP_DS_AGENT_USERID
+ NETSNMP_DS_AGENT_GROUPID
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ NETSNMP_DS_AGENT_AGENTX_RETRIES
+ NETSNMP_DS_AGENT_X_SOCK_PERM
+ NETSNMP_DS_AGENT_X_DIR_PERM
+ NETSNMP_DS_AGENT_X_SOCK_USER
+ NETSNMP_DS_AGENT_X_SOCK_GROUP
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT
+ NETSNMP_DS_AGENT_INTERNAL_VERSION
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL
+
+
+ NETSNMP_DS_AGENT_VERBOSE
+ NETSNMP_DS_AGENT_ROLE
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS
+ NETSNMP_DS_AGENT_AGENTX_MASTER
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
+ NETSNMP_DS_AGENT_DISABLE_PERL
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE
+ NETSNMP_DS_AGENT_NO_CACHING
+ NETSNMP_DS_AGENT_STRICT_DISMAN
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES
+ NETSNMP_DS_AGENT_PROGNAME
+ NETSNMP_DS_AGENT_X_SOCKET
+ NETSNMP_DS_AGENT_PORTS
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ NETSNMP_DS_AGENT_PERL_INIT_FILE
+ NETSNMP_DS_SMUX_SOCKET
+ NETSNMP_DS_NOTIF_LOG_CTX
+ NETSNMP_DS_AGENT_FLAGS
+ NETSNMP_DS_AGENT_USERID
+ NETSNMP_DS_AGENT_GROUPID
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ NETSNMP_DS_AGENT_AGENTX_RETRIES
+ NETSNMP_DS_AGENT_X_SOCK_PERM
+ NETSNMP_DS_AGENT_X_DIR_PERM
+ NETSNMP_DS_AGENT_X_SOCK_USER
+ NETSNMP_DS_AGENT_X_SOCK_GROUP
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT
+ NETSNMP_DS_AGENT_INTERNAL_VERSION
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL
+
+
+ NETSNMP_DS_AGENT_VERBOSE
+ NETSNMP_DS_AGENT_ROLE
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS
+ NETSNMP_DS_AGENT_AGENTX_MASTER
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
+ NETSNMP_DS_AGENT_DISABLE_PERL
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE
+ NETSNMP_DS_AGENT_NO_CACHING
+ NETSNMP_DS_AGENT_STRICT_DISMAN
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES
+ NETSNMP_DS_AGENT_PROGNAME
+ NETSNMP_DS_AGENT_X_SOCKET
+ NETSNMP_DS_AGENT_PORTS
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ NETSNMP_DS_AGENT_PERL_INIT_FILE
+ NETSNMP_DS_SMUX_SOCKET
+ NETSNMP_DS_NOTIF_LOG_CTX
+ NETSNMP_DS_AGENT_FLAGS
+ NETSNMP_DS_AGENT_USERID
+ NETSNMP_DS_AGENT_GROUPID
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ NETSNMP_DS_AGENT_AGENTX_RETRIES
+ NETSNMP_DS_AGENT_X_SOCK_PERM
+ NETSNMP_DS_AGENT_X_DIR_PERM
+ NETSNMP_DS_AGENT_X_SOCK_USER
+ NETSNMP_DS_AGENT_X_SOCK_GROUP
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT
+ NETSNMP_DS_AGENT_INTERNAL_VERSION
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL
+
+
+ NETSNMP_DS_AGENT_VERBOSE
+ NETSNMP_DS_AGENT_ROLE
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS
+ NETSNMP_DS_AGENT_AGENTX_MASTER
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
+ NETSNMP_DS_AGENT_DISABLE_PERL
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE
+ NETSNMP_DS_AGENT_NO_CACHING
+ NETSNMP_DS_AGENT_STRICT_DISMAN
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES
+ NETSNMP_DS_AGENT_PROGNAME
+ NETSNMP_DS_AGENT_X_SOCKET
+ NETSNMP_DS_AGENT_PORTS
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ NETSNMP_DS_AGENT_PERL_INIT_FILE
+ NETSNMP_DS_SMUX_SOCKET
+ NETSNMP_DS_NOTIF_LOG_CTX
+ NETSNMP_DS_AGENT_FLAGS
+ NETSNMP_DS_AGENT_USERID
+ NETSNMP_DS_AGENT_GROUPID
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ NETSNMP_DS_AGENT_AGENTX_RETRIES
+ NETSNMP_DS_AGENT_X_SOCK_PERM
+ NETSNMP_DS_AGENT_X_DIR_PERM
+ NETSNMP_DS_AGENT_X_SOCK_USER
+ NETSNMP_DS_AGENT_X_SOCK_GROUP
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT
+ NETSNMP_DS_AGENT_INTERNAL_VERSION
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL
+
+
+
+
+ NETSNMP_DS_AGENT_VERBOSE
+ NETSNMP_DS_AGENT_ROLE
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS
+ NETSNMP_DS_AGENT_AGENTX_MASTER
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
+ NETSNMP_DS_AGENT_DISABLE_PERL
+ NETSNMP_DS_AGENT_PROGNAME
+ NETSNMP_DS_AGENT_X_SOCKET
+ NETSNMP_DS_AGENT_PORTS
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ NETSNMP_DS_AGENT_PERL_INIT_FILE
+ NETSNMP_DS_AGENT_FLAGS
+ NETSNMP_DS_AGENT_USERID
+ NETSNMP_DS_AGENT_GROUPID
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+
+
+ DS_AGENT_AGENTX_MASTER
+ DS_AGENT_AGENTX_PING_INTERVAL
+ DS_AGENT_FLAGS
+ DS_AGENT_GROUPID
+ DS_AGENT_INTERNAL_SECNAME
+ DS_AGENT_NO_ROOT_ACCESS
+ DS_AGENT_PORTS
+ DS_AGENT_PROGNAME
+ DS_AGENT_ROLE
+ DS_AGENT_USERID
+ DS_AGENT_VERBOSE
+ DS_AGENT_X_SOCKET
+
+
+=head1 AUTHOR
+
+Wes Hardaker, E<lt>hardaker@users.sourceforge.netE<gt>
+
+=head1 SEE ALSO
+
+NetSNMP::default_store(3pm), NetSNMP::agent(3pm), perl(1).
+
+=cut
diff --git a/perl/agent/default_store/default_store.xs b/perl/agent/default_store/default_store.xs
new file mode 100644
index 0000000..bff1485
--- /dev/null
+++ b/perl/agent/default_store/default_store.xs
@@ -0,0 +1,705 @@
+#if defined(_WIN32) && !defined(_WIN32_WINNT)
+#define _WIN32_WINNT 0x501
+#endif
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/agent/ds_agent.h>
+
+
+/* autogenerated by "gen" from const-c.inc */
+
+#define PERL_constant_NOTFOUND 1
+#define PERL_constant_NOTDEF 2
+#define PERL_constant_ISIV 3
+#define PERL_constant_ISNO 4
+#define PERL_constant_ISNV 5
+#define PERL_constant_ISPV 6
+#define PERL_constant_ISPVN 7
+#define PERL_constant_ISSV 8
+#define PERL_constant_ISUNDEF 9
+#define PERL_constant_ISUV 10
+#define PERL_constant_ISYES 11
+
+#ifndef NVTYPE
+typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
+#endif
+#ifndef aTHX_
+#define aTHX_ /* 5.6 or later define this for threading support. */
+#endif
+#ifndef pTHX_
+#define pTHX_ /* 5.6 or later define this for threading support. */
+#endif
+
+static int
+constant_22 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_AGENT_FLAGS NETSNMP_DS_AGENT_PORTS NETSNMP_DS_SMUX_SOCKET */
+ /* Offset 17 gives the best switch position. */
+ switch (name[17]) {
+ case 'F':
+ if (memEQ(name, "NETSNMP_DS_AGENT_FLAGS", 22)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_FLAGS
+ *iv_return = NETSNMP_DS_AGENT_FLAGS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "NETSNMP_DS_SMUX_SOCKET", 22)) {
+ /* ^ */
+#ifdef NETSNMP_DS_SMUX_SOCKET
+ *iv_return = NETSNMP_DS_SMUX_SOCKET;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "NETSNMP_DS_AGENT_PORTS", 22)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_PORTS
+ *iv_return = NETSNMP_DS_AGENT_PORTS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_24 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_AGENT_GROUPID NETSNMP_DS_AGENT_VERBOSE NETSNMP_DS_NOTIF_LOG_CTX
+ */
+ /* Offset 19 gives the best switch position. */
+ switch (name[19]) {
+ case 'G':
+ if (memEQ(name, "NETSNMP_DS_NOTIF_LOG_CTX", 24)) {
+ /* ^ */
+#ifdef NETSNMP_DS_NOTIF_LOG_CTX
+ *iv_return = NETSNMP_DS_NOTIF_LOG_CTX;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "NETSNMP_DS_AGENT_GROUPID", 24)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_GROUPID
+ *iv_return = NETSNMP_DS_AGENT_GROUPID;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "NETSNMP_DS_AGENT_VERBOSE", 24)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_VERBOSE
+ *iv_return = NETSNMP_DS_AGENT_VERBOSE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_30 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_AGENT_AGENTX_MASTER NETSNMP_DS_AGENT_CACHE_TIMEOUT
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE NETSNMP_DS_AGENT_STRICT_DISMAN */
+ /* Offset 27 gives the best switch position. */
+ switch (name[27]) {
+ case 'I':
+ if (memEQ(name, "NETSNMP_DS_AGENT_LEAVE_PIDFILE", 30)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_LEAVE_PIDFILE
+ *iv_return = NETSNMP_DS_AGENT_LEAVE_PIDFILE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "NETSNMP_DS_AGENT_STRICT_DISMAN", 30)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_STRICT_DISMAN
+ *iv_return = NETSNMP_DS_AGENT_STRICT_DISMAN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "NETSNMP_DS_AGENT_CACHE_TIMEOUT", 30)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_CACHE_TIMEOUT
+ *iv_return = NETSNMP_DS_AGENT_CACHE_TIMEOUT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "NETSNMP_DS_AGENT_AGENTX_MASTER", 30)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_AGENTX_MASTER
+ *iv_return = NETSNMP_DS_AGENT_AGENTX_MASTER;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_31 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_AGENT_AGENTX_RETRIES NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS NETSNMP_DS_AGENT_PERL_INIT_FILE */
+ /* Offset 27 gives the best switch position. */
+ switch (name[27]) {
+ case 'C':
+ if (memEQ(name, "NETSNMP_DS_AGENT_NO_ROOT_ACCESS", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_NO_ROOT_ACCESS
+ *iv_return = NETSNMP_DS_AGENT_NO_ROOT_ACCESS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_AGENT_AGENTX_TIMEOUT", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ *iv_return = NETSNMP_DS_AGENT_AGENTX_TIMEOUT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'F':
+ if (memEQ(name, "NETSNMP_DS_AGENT_PERL_INIT_FILE", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_PERL_INIT_FILE
+ *iv_return = NETSNMP_DS_AGENT_PERL_INIT_FILE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "NETSNMP_DS_AGENT_AGENTX_RETRIES", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_AGENTX_RETRIES
+ *iv_return = NETSNMP_DS_AGENT_AGENTX_RETRIES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_33 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME NETSNMP_DS_AGENT_INTERNAL_VERSION
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY */
+ /* Offset 31 gives the best switch position. */
+ switch (name[31]) {
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_AGENT_QUIT_IMMEDIATELY", 33)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
+ *iv_return = NETSNMP_DS_AGENT_QUIT_IMMEDIATELY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "NETSNMP_DS_AGENT_INTERNAL_SECNAME", 33)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ *iv_return = NETSNMP_DS_AGENT_INTERNAL_SECNAME;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "NETSNMP_DS_AGENT_INTERNAL_VERSION", 33)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_INTERNAL_VERSION
+ *iv_return = NETSNMP_DS_AGENT_INTERNAL_VERSION;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
+ /* Initially switch on the length of the name. */
+ /* When generated this function returned values for the list of names given
+ in this section of perl code. Rather than manually editing these functions
+ to add or remove constants, which would result in this comment and section
+ of code becoming inaccurate, we recommend that you edit this section of
+ code, and use it to regenerate a new set of constant functions which you
+ then use to replace the originals.
+
+ Regenerate these constant functions by feeding this entire source file to
+ perl -x
+
+#!/usr/bin/perl -w
+use ExtUtils::Constant qw (constant_types C_constant XS_constant);
+
+my $types = {map {($_, 1)} qw(IV)};
+my @names = (qw(NETSNMP_DS_AGENT_AGENTX_MASTER
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ NETSNMP_DS_AGENT_AGENTX_RETRIES NETSNMP_DS_AGENT_AGENTX_TIMEOUT
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT NETSNMP_DS_AGENT_DISABLE_PERL
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS
+ NETSNMP_DS_AGENT_FLAGS NETSNMP_DS_AGENT_GROUPID
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME
+ NETSNMP_DS_AGENT_INTERNAL_VERSION NETSNMP_DS_AGENT_LEAVE_PIDFILE
+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS
+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES
+ NETSNMP_DS_AGENT_NO_CACHING
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS NETSNMP_DS_AGENT_PERL_INIT_FILE
+ NETSNMP_DS_AGENT_PORTS NETSNMP_DS_AGENT_PROGNAME
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY NETSNMP_DS_AGENT_ROLE
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES
+ NETSNMP_DS_AGENT_STRICT_DISMAN NETSNMP_DS_AGENT_USERID
+ NETSNMP_DS_AGENT_VERBOSE NETSNMP_DS_AGENT_X_DIR_PERM
+ NETSNMP_DS_AGENT_X_SOCKET NETSNMP_DS_AGENT_X_SOCK_GROUP
+ NETSNMP_DS_AGENT_X_SOCK_PERM NETSNMP_DS_AGENT_X_SOCK_USER
+ NETSNMP_DS_APP_DONT_LOG NETSNMP_DS_NOTIF_LOG_CTX
+ NETSNMP_DS_SMUX_SOCKET));
+
+print constant_types(); # macro defs
+foreach (C_constant ("NetSNMP::agent::default_store", 'constant', 'IV', $types, undef, 3, @names) ) {
+ print $_, "\n"; # C constant subs
+}
+print "#### XS Section:\n";
+print XS_constant ("NetSNMP::agent::default_store", $types);
+__END__
+ */
+
+ switch (len) {
+ case 21:
+ if (memEQ(name, "NETSNMP_DS_AGENT_ROLE", 21)) {
+#ifdef NETSNMP_DS_AGENT_ROLE
+ *iv_return = NETSNMP_DS_AGENT_ROLE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 22:
+ return constant_22 (aTHX_ name, iv_return);
+ break;
+ case 23:
+ /* Names all of length 23. */
+ /* NETSNMP_DS_AGENT_USERID NETSNMP_DS_APP_DONT_LOG */
+ /* Offset 18 gives the best switch position. */
+ switch (name[18]) {
+ case 'S':
+ if (memEQ(name, "NETSNMP_DS_AGENT_USERID", 23)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_USERID
+ *iv_return = NETSNMP_DS_AGENT_USERID;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "NETSNMP_DS_APP_DONT_LOG", 23)) {
+ /* ^ */
+#ifdef NETSNMP_DS_APP_DONT_LOG
+ *iv_return = NETSNMP_DS_APP_DONT_LOG;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ break;
+ case 24:
+ return constant_24 (aTHX_ name, iv_return);
+ break;
+ case 25:
+ /* Names all of length 25. */
+ /* NETSNMP_DS_AGENT_PROGNAME NETSNMP_DS_AGENT_X_SOCKET */
+ /* Offset 19 gives the best switch position. */
+ switch (name[19]) {
+ case 'O':
+ if (memEQ(name, "NETSNMP_DS_AGENT_PROGNAME", 25)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_PROGNAME
+ *iv_return = NETSNMP_DS_AGENT_PROGNAME;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "NETSNMP_DS_AGENT_X_SOCKET", 25)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_X_SOCKET
+ *iv_return = NETSNMP_DS_AGENT_X_SOCKET;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ break;
+ case 27:
+ /* Names all of length 27. */
+ /* NETSNMP_DS_AGENT_NO_CACHING NETSNMP_DS_AGENT_X_DIR_PERM */
+ /* Offset 24 gives the best switch position. */
+ switch (name[24]) {
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_AGENT_X_DIR_PERM", 27)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_X_DIR_PERM
+ *iv_return = NETSNMP_DS_AGENT_X_DIR_PERM;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "NETSNMP_DS_AGENT_NO_CACHING", 27)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_NO_CACHING
+ *iv_return = NETSNMP_DS_AGENT_NO_CACHING;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ break;
+ case 28:
+ /* Names all of length 28. */
+ /* NETSNMP_DS_AGENT_X_SOCK_PERM NETSNMP_DS_AGENT_X_SOCK_USER */
+ /* Offset 27 gives the best switch position. */
+ switch (name[27]) {
+ case 'M':
+ if (memEQ(name, "NETSNMP_DS_AGENT_X_SOCK_PER", 27)) {
+ /* M */
+#ifdef NETSNMP_DS_AGENT_X_SOCK_PERM
+ *iv_return = NETSNMP_DS_AGENT_X_SOCK_PERM;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "NETSNMP_DS_AGENT_X_SOCK_USE", 27)) {
+ /* R */
+#ifdef NETSNMP_DS_AGENT_X_SOCK_USER
+ *iv_return = NETSNMP_DS_AGENT_X_SOCK_USER;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ break;
+ case 29:
+ /* Names all of length 29. */
+ /* NETSNMP_DS_AGENT_DISABLE_PERL NETSNMP_DS_AGENT_X_SOCK_GROUP */
+ /* Offset 21 gives the best switch position. */
+ switch (name[21]) {
+ case 'B':
+ if (memEQ(name, "NETSNMP_DS_AGENT_DISABLE_PERL", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_DISABLE_PERL
+ *iv_return = NETSNMP_DS_AGENT_DISABLE_PERL;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "NETSNMP_DS_AGENT_X_SOCK_GROUP", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_X_SOCK_GROUP
+ *iv_return = NETSNMP_DS_AGENT_X_SOCK_GROUP;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ break;
+ case 30:
+ return constant_30 (aTHX_ name, iv_return);
+ break;
+ case 31:
+ return constant_31 (aTHX_ name, iv_return);
+ break;
+ case 33:
+ return constant_33 (aTHX_ name, iv_return);
+ break;
+ case 34:
+ if (memEQ(name, "NETSNMP_DS_AGENT_INTERNAL_SECLEVEL", 34)) {
+#ifdef NETSNMP_DS_AGENT_INTERNAL_SECLEVEL
+ *iv_return = NETSNMP_DS_AGENT_INTERNAL_SECLEVEL;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 35:
+ if (memEQ(name, "NETSNMP_DS_AGENT_MAX_GETBULKREPEATS", 35)) {
+#ifdef NETSNMP_DS_AGENT_MAX_GETBULKREPEATS
+ *iv_return = NETSNMP_DS_AGENT_MAX_GETBULKREPEATS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 37:
+ /* Names all of length 37. */
+ /* NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES */
+ /* Offset 26 gives the best switch position. */
+ switch (name[26]) {
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES", 37)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES
+ *iv_return = NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL", 37)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
+ *iv_return = NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ break;
+ case 39:
+ /* Names all of length 39. */
+ /* NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES */
+ /* Offset 21 gives the best switch position. */
+ switch (name[21]) {
+ case 'N':
+ if (memEQ(name, "NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES", 39)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES
+ *iv_return = NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS", 39)) {
+ /* ^ */
+#ifdef NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS
+ *iv_return = NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ break;
+ case 42:
+ if (memEQ(name, "NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS", 42)) {
+#ifdef NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS
+ *iv_return = NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 46:
+ if (memEQ(name, "NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS", 46)) {
+#ifdef NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS
+ *iv_return = NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+
+
+/* autogenerated by "gen" from const-xs.inc */
+
+MODULE = NetSNMP::agent::default_store PACKAGE = NetSNMP::agent::default_store
+
+void
+constant(sv)
+ PREINIT:
+#ifdef dXSTARG
+ dXSTARG; /* Faster if we have it. */
+#else
+ dTARGET;
+#endif
+ STRLEN len;
+ int type;
+ IV iv = 0;
+ /* NV nv; Uncomment this if you need to return NVs */
+ /* const char *pv; Uncomment this if you need to return PVs */
+ INPUT:
+ SV * sv;
+ const char * s = SvPV(sv, len);
+ PPCODE:
+ /* Change this to constant(aTHX_ s, len, &iv, &nv);
+ if you need to return both NVs and IVs */
+ type = constant(aTHX_ s, len, &iv);
+ /* Return 1 or 2 items. First is error message, or undef if no error.
+ Second, if present, is found value */
+ switch (type) {
+ case PERL_constant_NOTFOUND:
+ sv = sv_2mortal(newSVpvf("%s is not a valid NetSNMP::agent::default_store macro", s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_NOTDEF:
+ sv = sv_2mortal(newSVpvf(
+ "Your vendor has not defined NetSNMP::agent::default_store macro %s, used", s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_ISIV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHi(iv);
+ break;
+ /* Uncomment this if you need to return NOs
+ case PERL_constant_ISNO:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_no);
+ break; */
+ /* Uncomment this if you need to return NVs
+ case PERL_constant_ISNV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHn(nv);
+ break; */
+ /* Uncomment this if you need to return PVs
+ case PERL_constant_ISPV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, strlen(pv));
+ break; */
+ /* Uncomment this if you need to return PVNs
+ case PERL_constant_ISPVN:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, iv);
+ break; */
+ /* Uncomment this if you need to return SVs
+ case PERL_constant_ISSV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(sv);
+ break; */
+ /* Uncomment this if you need to return UNDEFs
+ case PERL_constant_ISUNDEF:
+ break; */
+ /* Uncomment this if you need to return UVs
+ case PERL_constant_ISUV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHu((UV)iv);
+ break; */
+ /* Uncomment this if you need to return YESs
+ case PERL_constant_ISYES:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_yes);
+ break; */
+ default:
+ sv = sv_2mortal(newSVpvf(
+ "Unexpected return type %d while processing NetSNMP::agent::default_store macro %s, used",
+ type, s));
+ PUSHs(sv);
+ }
+
+
+
diff --git a/perl/agent/default_store/gen b/perl/agent/default_store/gen
new file mode 100755
index 0000000..55823d6
--- /dev/null
+++ b/perl/agent/default_store/gen
@@ -0,0 +1,118 @@
+#!/usr/bin/perl
+
+system("grep 'define NETSNMP_DS_' ../../../include/net-snmp/agent/ds_agent.h > default_store.h");
+#gcc -E ../../include/net-snmp/library/default_store.h | grep -v default_store.h >> default_store.h
+system("h2xs -b 5.5.0 -n NetSNMP::agent::default_store -O default_store.h");
+
+open(ORIG,"default_store.xs");
+open(NEW1,"NetSNMP-agent-default_store/fallback/const-c.inc") || die "can't open inc file 1";
+open(NEW2,"NetSNMP-agent-default_store/fallback/const-xs.inc") || die "can't open inc file 2";
+open(OUT,">default_store_new.xs");
+
+# get up to the include from the original file
+while(<ORIG>) {
+ print OUT;
+ last if (/include <net-snmp\/agent\/ds_agent.h/);
+}
+
+# include the entire new file
+print OUT "\n\n/* autogenerated by \"gen\" from const-c.inc */\n\n";
+print OUT <NEW1>;
+print OUT "\n\n/* autogenerated by \"gen\" from const-xs.inc */\n\n";
+print OUT "MODULE = NetSNMP::agent::default_store PACKAGE = NetSNMP::agent::default_store\n\n";
+
+print OUT <NEW2>;
+
+#print OUT "\n\n/* autogenerated by \"gen\" from tail of old .xs file */\n\n";
+print OUT "\n\n\n";
+
+close(OUT);
+
+#
+# generate test
+#
+open(H,"default_store.h");
+open(ORIG,"test.pl");
+open(OUT,">test.pl.new");
+
+while(<ORIG>) {
+ print OUT;
+ last if (/\%tests =/);
+}
+
+while(<H>) {
+ if (/define\s+(\w+)\s+(\d+)/) {
+ printf OUT (" %-40s => %d,\n", "\"$1\"", $2);
+ $tokenlist .= " $1\n";
+ }
+}
+
+while(<ORIG>) {
+ last if (/\);/);
+}
+print OUT;
+print OUT <ORIG>;
+close(OUT);
+
+#
+# modify the perl module itself
+#
+open(H,"default_store.h");
+open(ORIG,"default_store.pm");
+open(OUT,">default_store_new.pm");
+
+# first list
+while(<ORIG>) {
+ print OUT;
+ last if (/\%EXPORT_TAGS =/);
+}
+print OUT $tokenlist;
+while(<ORIG>) {
+ last if (/\) \] \);/);
+}
+print OUT;
+
+# second list
+while(<ORIG>) {
+ print OUT;
+ last if (/\@EXPORT =/);
+}
+print OUT $tokenlist;
+while(<ORIG>) {
+ last if (/\);/);
+}
+print OUT;
+
+# last section
+while(<ORIG>) {
+ print OUT;
+ last if (/head2 Exportable constants/);
+}
+print OUT "\n";
+print OUT $tokenlist;
+while(<ORIG>) {
+ last if (/^\s*$/);
+}
+print OUT "\n";
+print OUT;
+
+# tail end
+print OUT <ORIG>;
+close(OUT);
+
+#
+# install new files
+#
+print "updated test.pl\n";
+rename("test.pl.new","test.pl");
+rename("default_store_new.pm", "default_store.pm");
+print "updated default_store.pm\n";
+rename("default_store_new.xs", "default_store.xs");
+print "updated default_store.xs\n";
+
+#
+# remove the temp files.
+#
+system("rm -rf NetSNMP-agent-default_store");
+unlink("default_store.h");
+
diff --git a/perl/agent/default_store/test.pl b/perl/agent/default_store/test.pl
new file mode 100644
index 0000000..23b5611
--- /dev/null
+++ b/perl/agent/default_store/test.pl
@@ -0,0 +1,69 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1;
+
+ %tests = (
+ "NETSNMP_DS_AGENT_VERBOSE" => 0,
+ "NETSNMP_DS_AGENT_ROLE" => 1,
+ "NETSNMP_DS_AGENT_NO_ROOT_ACCESS" => 2,
+ "NETSNMP_DS_AGENT_AGENTX_MASTER" => 3,
+ "NETSNMP_DS_AGENT_QUIT_IMMEDIATELY" => 4,
+ "NETSNMP_DS_AGENT_DISABLE_PERL" => 5,
+ "NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS" => 6,
+ "NETSNMP_DS_AGENT_LEAVE_PIDFILE" => 7,
+ "NETSNMP_DS_AGENT_NO_CACHING" => 8,
+ "NETSNMP_DS_AGENT_STRICT_DISMAN" => 9,
+ "NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS" => 10,
+ "NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS" => 12,
+ "NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES" => 13,
+ "NETSNMP_DS_AGENT_PROGNAME" => 0,
+ "NETSNMP_DS_AGENT_X_SOCKET" => 1,
+ "NETSNMP_DS_AGENT_PORTS" => 2,
+ "NETSNMP_DS_AGENT_INTERNAL_SECNAME" => 3,
+ "NETSNMP_DS_AGENT_PERL_INIT_FILE" => 4,
+ "NETSNMP_DS_SMUX_SOCKET" => 5,
+ "NETSNMP_DS_NOTIF_LOG_CTX" => 6,
+ "NETSNMP_DS_AGENT_FLAGS" => 0,
+ "NETSNMP_DS_AGENT_USERID" => 1,
+ "NETSNMP_DS_AGENT_GROUPID" => 2,
+ "NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL" => 3,
+ "NETSNMP_DS_AGENT_AGENTX_TIMEOUT" => 4,
+ "NETSNMP_DS_AGENT_AGENTX_RETRIES" => 5,
+ "NETSNMP_DS_AGENT_X_SOCK_PERM" => 6,
+ "NETSNMP_DS_AGENT_X_DIR_PERM" => 7,
+ "NETSNMP_DS_AGENT_X_SOCK_USER" => 8,
+ "NETSNMP_DS_AGENT_X_SOCK_GROUP" => 9,
+ "NETSNMP_DS_AGENT_CACHE_TIMEOUT" => 10,
+ "NETSNMP_DS_AGENT_INTERNAL_VERSION" => 11,
+ "NETSNMP_DS_AGENT_INTERNAL_SECLEVEL" => 12,
+ "NETSNMP_DS_AGENT_MAX_GETBULKREPEATS" => 13,
+ "NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES" => 14,
+ );
+
+ print "1.." . (scalar(keys(%tests)) + 2) . "\n";
+ }
+END {print "not ok 1\n" unless $loaded;}
+use NetSNMP::agent::default_store (':all');
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
+$c = 2;
+foreach my $i (keys(%tests)) {
+ my $str = "NetSNMP::agent::default_store::$i";
+ my $val = eval $str;
+# print "$i -> $val -> $tests{$i}\n";
+ $c++;
+ print (($val eq $tests{$i})?"ok $c\n" : "not ok $c\n# error: name=$i value_expected=$tests{$i} value_got=$val \n");
+}
diff --git a/perl/agent/netsnmp-feature-definitions.h b/perl/agent/netsnmp-feature-definitions.h
new file mode 100644
index 0000000..4f2630e
--- /dev/null
+++ b/perl/agent/netsnmp-feature-definitions.h
@@ -0,0 +1,6 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_require(agent_check_and_process)
+netsnmp_feature_require(snmp_enable_stderrlog)
+
diff --git a/perl/agent/netsnmp_request_infoPtr.pm b/perl/agent/netsnmp_request_infoPtr.pm
new file mode 100644
index 0000000..6678e9e
--- /dev/null
+++ b/perl/agent/netsnmp_request_infoPtr.pm
@@ -0,0 +1,23 @@
+package NetSNMP::agent::netsnmp_request_infoPtr;
+
+# bogus file
+
+1;
+__END__
+
+=head1 NAME
+
+NetSNMP::agent::netsnmp_request_infoPtr - Perl extension for request information
+
+=head1 SYNOPSIS
+
+ see NetSNMP::agent documentation
+
+=head1 AUTHOR
+
+Please mail the net-snmp-users@lists.sourceforge.net mailing list for
+help, questions or comments about this module.
+
+Wes Hardaker, hardaker@users.sourceforge.net
+
+=cut
diff --git a/perl/agent/test.pl b/perl/agent/test.pl
new file mode 100644
index 0000000..88cba56
--- /dev/null
+++ b/perl/agent/test.pl
@@ -0,0 +1,122 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1;
+ $ENV{'SNMPCONFPATH'} = 'nopath';
+ $ENV{'MIBS'} = '';
+ print "1..6\n";
+ }
+END {print "not ok 1\n" unless $loaded;}
+use NetSNMP::agent (':all');
+use NetSNMP::default_store (':all');
+use NetSNMP::agent::default_store (':all');
+use NetSNMP::ASN (':all');
+use NetSNMP::OID;
+#use NetSNMP::agent (':all');
+use SNMP;
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+sub it {
+ if ($_[0]) {
+ return "ok " . $_[1] . "\n";
+ } else {
+ return "not ok ". $_[1] ."\n";
+ }
+}
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
+print it((MODE_GET == 0xa0 &&
+ MODE_GETNEXT == 0xa1 &&
+ MODE_GETBULK == 0xa5 &&
+ MODE_SET_BEGIN == -1 &&
+ MODE_SET_RESERVE1 == 0 &&
+ MODE_SET_RESERVE2 == 1 &&
+ MODE_SET_ACTION == 2 &&
+ MODE_SET_COMMIT == 3 &&
+ MODE_SET_FREE == 4 &&
+ MODE_SET_UNDO == 5 &&
+ SNMP_ERR_NOERROR == 0 &&
+ SNMP_ERR_TOOBIG == 1 &&
+ SNMP_ERR_NOSUCHNAME == 2 &&
+ SNMP_ERR_BADVALUE == 3 &&
+ SNMP_ERR_READONLY == 4 &&
+ SNMP_ERR_GENERR == 5 &&
+ SNMP_ERR_NOACCESS == 6 &&
+ SNMP_ERR_WRONGTYPE == 7 &&
+ SNMP_ERR_WRONGLENGTH == 8 &&
+ SNMP_ERR_WRONGENCODING == 9 &&
+ SNMP_ERR_WRONGVALUE == 10 &&
+ SNMP_ERR_NOCREATION == 11 &&
+ SNMP_ERR_INCONSISTENTVALUE == 12 &&
+ SNMP_ERR_RESOURCEUNAVAILABLE == 13 &&
+ SNMP_ERR_COMMITFAILED == 14 &&
+ SNMP_ERR_UNDOFAILED == 15 &&
+ SNMP_ERR_AUTHORIZATIONERROR == 16 &&
+ SNMP_ERR_NOTWRITABLE == 17
+ ), 2);
+
+netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1);
+my $agent = new NetSNMP::agent('Name' => 'test',
+ 'Ports' => '9161');
+print it($agent, 3);
+
+$regitem = $agent->register("test_reg", ".1.3.6.1.8888", \&testsub);
+print it($regitem, 4);
+#print STDERR $regitem,":",ref($regitem),"\n";
+print it(ref($regitem) eq "NetSNMP::agent::netsnmp_handler_registration", 5);
+
+my $uptime1 = $agent->uptime();
+my $uptime2 = $agent->uptime(666);
+my $uptime3 = $agent->uptime(555, 444);
+print it($uptime1 <= $uptime2 && $uptime2 <= $uptime3, 6);
+
+exit;
+
+while(1) {
+ print netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS), "\n";
+ $agent->agent_check_and_process(1);
+ print netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS), "\n";
+ print "got something\n";
+}
+exit;
+
+$x = NetSNMP::agent::handler_registration::new("hi",\&testsub,".1.3.6.1.999");
+print ((ref($x) eq "handler_registrationPtr") ? "ok 2\n" : "not ok 2\n");
+
+print (($x->register() == 0) ? "ok 3\n" : "not ok 3\n");
+
+my $y = NetSNMP::agent::register_mib("me",\&testsub,".1.3.6.1.8888");
+while(1) {
+ NetSNMP::agent::agent_check_and_process();
+ print "got something\n";
+}
+
+#use Data::Dumper;
+sub testsub {
+ print STDERR "in perl handler sub\n";
+ print STDERR " args: ", join(", ", @_), "\n";
+ #print STDERR " dumped args: ", Dumper(@_);
+ $oid= $_[3]->getOID();
+ print STDERR " request oid: ", ref($oid), " -> ", $oid, "\n";
+ print STDERR " mode: ", $_[2]->getMode(),"\n";
+ $_[3]->setOID(".1.3.6.1.8888.1");
+ $_[3]->setValue(2, 42);
+ $_[3]->setValue(ASN_INTEGER, 42);
+ print STDERR " oid: ", $_[3]->getOID(),"\n";
+ print STDERR " ref: ", ref($_[3]),"\n";
+ print STDERR " val: ", $_[3]->getValue(),"\n";
+}
diff --git a/perl/agent/typemap b/perl/agent/typemap
new file mode 100644
index 0000000..ff2b844
--- /dev/null
+++ b/perl/agent/typemap
@@ -0,0 +1,6 @@
+TYPEMAP
+netsnmp_handler_registration * T_PTROBJ
+NetSNMP::agent::netsnmp_handler_registration T_PTROBJ
+netsnmp_request_info * T_PTROBJ
+const char * T_PV
+netsnmp_oid * T_PTROBJ
diff --git a/perl/default_store/Changes b/perl/default_store/Changes
new file mode 100644
index 0000000..87e1133
--- /dev/null
+++ b/perl/default_store/Changes
@@ -0,0 +1,6 @@
+Revision history for Perl extension NetSNMP::default_store.
+
+0.01 Thu Jan 3 22:35:38 2002
+ - original version; created by h2xs 1.20 with options
+ -F '-Du_char="unsigned char"' -x -O -n NetSNMP::default_store ucd-snmp/default_store.h
+
diff --git a/perl/default_store/MANIFEST b/perl/default_store/MANIFEST
new file mode 100644
index 0000000..ea73c2e
--- /dev/null
+++ b/perl/default_store/MANIFEST
@@ -0,0 +1,8 @@
+Changes
+MANIFEST
+Makefile.PL
+default_store.pm
+default_store.xs
+test.pl
+typemap
+README
diff --git a/perl/default_store/Makefile.PL b/perl/default_store/Makefile.PL
new file mode 100644
index 0000000..7c671b8
--- /dev/null
+++ b/perl/default_store/Makefile.PL
@@ -0,0 +1,227 @@
+use ExtUtils::MakeMaker;
+require 5;
+use Config;
+use Getopt::Long;
+my $lib_version;
+my %MakeParams = ();
+
+%MakeParams = InitMakeParams();
+
+WriteMakefile(%MakeParams);
+
+
+sub InitMakeParams {
+ my $opts;
+ my %Params = (
+ 'NAME' => 'NetSNMP::default_store',
+ 'VERSION_FROM' => 'default_store.pm', # finds $VERSION
+ 'XSPROTOARG' => '-prototypes',
+ );
+
+ if ($ENV{'OSTYPE'} eq 'msys') {
+ $Params{'DEFINE'} = "-DMINGW_PERL";
+ }
+
+ my ($snmp_lib, $snmp_llib, $sep);
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+ $opts = NetSNMPGetOpts();
+ $Params{'DEFINE'} = "-DMSVC_PERL -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS";
+ $sep = '\\';
+ $snmp_lib_file = 'netsnmp.lib';
+ $snmp_link_lib = 'netsnmp';
+
+ if (lc($opts->{'debug'}) eq "true") {
+ $lib_dir = 'lib\\debug';
+ }
+ else {
+ $lib_dir = 'lib\\release';
+ }
+
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L$basedir\\win32\\$lib_dir\\ -l$snmp_link_lib";
+ }
+ else {
+ my @LibDirs = split (';',$ENV{LIB});
+ my $LibDir;
+ if ($opts->{'prefix'}) {
+ push (@LibDirs,"$ENV{'NET-SNMP-PATH'}${sep}lib");
+ }
+ $noLibDir = 1;
+ while ($noLibDir) {
+ $LibDir = find_files(["$snmp_lib_file"],\@LibDirs);
+ if ($LibDir ne '') {
+ $noLibDir = 0;
+ # Put quotes around LibDir to allow spaces in paths
+ $LibDir = '"' . $LibDir . '"';
+ }
+ else
+ {
+ @LibDirs = ();
+ $LibDirs[0] = prompt("The Net-SNMP library ($snmp_lib_file) could not be found.\nPlease enter the directory where it is located:");
+ $LibDirs[0] =~ s/\\$//;
+ }
+ }
+ $Params{LIBS} = "-L$LibDir -l$snmp_link_lib";
+ }
+
+ $Params{'INC'} = "-I$basedir\\include\\ -I$basedir\\include\\net-snmp\\ -I$basedir\\win32\\ ";
+ }
+ else {
+ $opts = NetSNMPGetOpts();
+ $Params{'LDDLFLAGS'} = "$Config{lddlflags} " . `$opts->{'nsconfig'} --ldflags`;
+ $Params{'LIBS'} = `$opts->{'nsconfig'} --libs`;
+ chomp($Params{'LIBS'});
+ $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
+ chomp($Params{'CCFLAGS'});
+ $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
+ $lib_version = `$opts->{'nsconfig'} --version`;
+ if (lc($opts->{'insource'}) eq "true") {
+ $Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
+ $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
+ }
+ $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
+ die "You need to install net-snmp first (I can't find net-snmp-config)";
+ }
+ }
+
+ return(%Params);
+}
+# common subroutines -- DO NOT EDIT.
+# They are imported from the Makefile.subs.pl file
+sub NetSNMPGetOpts {
+ my %ret;
+ my $rootpath = shift;
+ $rootpath = "../" if (!$rootpath);
+ $rootpath .= '/' if ($rootpath !~ /\/$/);
+
+ if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
+
+ # Grab command line options first. Only used if environment variables are not set
+ GetOptions("NET-SNMP-IN-SOURCE=s" => \$ret{'insource'},
+ "NET-SNMP-PATH=s" => \$ret{'prefix'},
+ "NET-SNMP-DEBUG=s" => \$ret{'debug'});
+
+ if ($ENV{'NET-SNMP-IN-SOURCE'})
+ {
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ undef ($ret{'prefix'});
+ }
+ elsif ($ENV{'NET-SNMP-PATH'})
+ {
+ $ret{'prefix'} = $ENV{'NET-SNMP-PATH'};
+ }
+
+ if ($ENV{'NET-SNMP-DEBUG'})
+ {
+ $ret{'debug'} = $ENV{'NET-SNMP-DEBUG'};
+ }
+
+ # Update environment variables in case they are needed
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ $ENV{'NET-SNMP-PATH'} = $ret{'prefix'};
+ $ENV{'NET-SNMP-DEBUG'} = $ret{'debug'};
+
+ $basedir = `%COMSPEC% /c cd`;
+ chomp $basedir;
+ $basedir =~ /(.*?)\\perl.*/;
+ $basedir = $1;
+ print "Net-SNMP base directory: $basedir\n";
+ if ($basedir =~ / /) {
+ die "\nA space has been detected in the base directory. This is not " .
+ "supported\nPlease rename the folder and try again.\n\n";
+ }
+ }
+ else
+ {
+ if ($ENV{'NET-SNMP-CONFIG'} &&
+ $ENV{'NET-SNMP-IN-SOURCE'}) {
+ # have env vars, pull from there
+ $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
+ $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
+ } else {
+ # don't have env vars, pull from command line and put there
+ GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
+ "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
+
+ if (lc($ret{'insource'}) eq "true" && $ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
+ } elsif ($ret{'nsconfig'} eq "") {
+ $ret{'nsconfig'}="net-snmp-config";
+ }
+
+ $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
+ $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
+ }
+ }
+
+ $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
+
+ $ret{'rootpath'} = $rootpath;
+
+ \%ret;
+}
+
+sub find_files {
+ my($f,$d) = @_;
+ my ($dir,$found,$file);
+ for $dir (@$d){
+ $found = 0;
+ for $file (@$f) {
+ $found++ if -f "$dir/$file";
+ }
+ if ($found == @$f) {
+ return $dir;
+ }
+ }
+}
+
+
+sub Check_Version {
+ if (($Config{'osname'} ne 'MSWin32' || $ENV{'OSTYPE'} ne '')) {
+ my $foundversion = 0;
+ return if ($ENV{'NETSNMP_DONT_CHECK_VERSION'});
+ open(I,"<Makefile");
+ while (<I>) {
+ if (/^VERSION = (.*)/) {
+ my $perlver = $1;
+ my $srcver = $lib_version;
+ chomp($srcver);
+ my $srcfloat = floatize_version($srcver);
+ $perlver =~ s/pre/0./;
+ # we allow for perl/CPAN-only revisions beyond the default
+ # version formatting of net-snmp itself.
+ $perlver =~ s/(\.\d{5}).*/\1/;
+ $perlver =~ s/0*$//;
+ if ($srcfloat ne $perlver) {
+ if (!$foundversion) {
+ print STDERR "ERROR:
+Net-SNMP installed version: $srcver => $srcfloat
+Perl Module Version: $perlver
+
+These versions must match for perfect support of the module. It is possible
+that different versions may work together, but it is strongly recommended
+that you make these two versions identical. You can get the Net-SNMP
+source code and the associated perl modules directly from
+
+ http://www.net-snmp.org/
+
+If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
+environmental variable to 1 and re-run the Makefile.PL script.\n";
+ exit(1);
+ }
+ }
+ $foundversion = 1;
+ last;
+ }
+ }
+ close(I);
+ die "ERROR: Couldn't find version number of this module\n"
+ if (!$foundversion);
+ }
+}
+
+sub floatize_version {
+ my ($major, $minor, $patch, $opps) = ($_[0] =~ /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/);
+ return $major + $minor/100 + $patch/10000 + $opps/100000;
+}
diff --git a/perl/default_store/README b/perl/default_store/README
new file mode 100644
index 0000000..680446a
--- /dev/null
+++ b/perl/default_store/README
@@ -0,0 +1,14 @@
+This module is a wrapper around the net-snmp default store routines.
+See the net-snmp default_store manual page for details.
+
+To install:
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+To compile in the source tree before the net-snmp itself has been installed:
+ perl Makefile.PL -NET-SNMP-CONFIG="sh ../../net-snmp-config" -NET-SNMP-IN-SOURCE=true
+ make
+ make test
+ make install
diff --git a/perl/default_store/default_store.pm b/perl/default_store/default_store.pm
new file mode 100644
index 0000000..3d18ffc
--- /dev/null
+++ b/perl/default_store/default_store.pm
@@ -0,0 +1,366 @@
+package NetSNMP::default_store;
+
+use strict;
+use warnings;
+use Carp;
+
+require Exporter;
+require DynaLoader;
+use AutoLoader;
+
+use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION $AUTOLOAD);
+
+@ISA = qw(Exporter DynaLoader);
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration use NetSNMP::default_store ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+%EXPORT_TAGS = ( 'all' => [ qw(
+ NETSNMP_DS_MAX_IDS
+ NETSNMP_DS_MAX_SUBIDS
+ NETSNMP_DS_LIBRARY_ID
+ NETSNMP_DS_APPLICATION_ID
+ NETSNMP_DS_TOKEN_ID
+ NETSNMP_DS_LIB_MIB_ERRORS
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS
+ NETSNMP_DS_LIB_MIB_COMMENT_TERM
+ NETSNMP_DS_LIB_MIB_PARSE_LABEL
+ NETSNMP_DS_LIB_DUMP_PACKET
+ NETSNMP_DS_LIB_LOG_TIMESTAMP
+ NETSNMP_DS_LIB_DONT_READ_CONFIGS
+ NETSNMP_DS_LIB_MIB_REPLACE
+ NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM
+ NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS
+ NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG
+ NETSNMP_DS_LIB_PRINT_FULL_OID
+ NETSNMP_DS_LIB_QUICK_PRINT
+ NETSNMP_DS_LIB_RANDOM_ACCESS
+ NETSNMP_DS_LIB_REGEX_ACCESS
+ NETSNMP_DS_LIB_DONT_CHECK_RANGE
+ NETSNMP_DS_LIB_NO_TOKEN_WARNINGS
+ NETSNMP_DS_LIB_NUMERIC_TIMETICKS
+ NETSNMP_DS_LIB_ESCAPE_QUOTES
+ NETSNMP_DS_LIB_REVERSE_ENCODE
+ NETSNMP_DS_LIB_PRINT_BARE_VALUE
+ NETSNMP_DS_LIB_EXTENDED_INDEX
+ NETSNMP_DS_LIB_PRINT_HEX_TEXT
+ NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID
+ NETSNMP_DS_LIB_READ_UCD_STYLE_OID
+ NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG
+ NETSNMP_DS_LIB_HAVE_READ_CONFIG
+ NETSNMP_DS_LIB_QUICKE_PRINT
+ NETSNMP_DS_LIB_DONT_PRINT_UNITS
+ NETSNMP_DS_LIB_NO_DISPLAY_HINT
+ NETSNMP_DS_LIB_16BIT_IDS
+ NETSNMP_DS_LIB_DONT_PERSIST_STATE
+ NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT
+ NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE
+ NETSNMP_DS_LIB_APPEND_LOGFILES
+ NETSNMP_DS_LIB_MIB_WARNINGS
+ NETSNMP_DS_LIB_SECLEVEL
+ NETSNMP_DS_LIB_SNMPVERSION
+ NETSNMP_DS_LIB_DEFAULT_PORT
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT
+ NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT
+ NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH
+ NETSNMP_DS_LIB_SERVERSENDBUF
+ NETSNMP_DS_LIB_SERVERRECVBUF
+ NETSNMP_DS_LIB_CLIENTSENDBUF
+ NETSNMP_DS_LIB_CLIENTRECVBUF
+ NETSNMP_DS_SNMP_VERSION_1
+ NETSNMP_DS_SNMP_VERSION_2c
+ NETSNMP_DS_SNMP_VERSION_3
+ NETSNMP_DS_LIB_SECNAME
+ NETSNMP_DS_LIB_CONTEXT
+ NETSNMP_DS_LIB_PASSPHRASE
+ NETSNMP_DS_LIB_AUTHPASSPHRASE
+ NETSNMP_DS_LIB_PRIVPASSPHRASE
+ NETSNMP_DS_LIB_OPTIONALCONFIG
+ NETSNMP_DS_LIB_APPTYPE
+ NETSNMP_DS_LIB_COMMUNITY
+ NETSNMP_DS_LIB_PERSISTENT_DIR
+ NETSNMP_DS_LIB_CONFIGURATION_DIR
+ NETSNMP_DS_LIB_SECMODEL
+ NETSNMP_DS_LIB_MIBDIRS
+ NETSNMP_DS_LIB_OIDSUFFIX
+ NETSNMP_DS_LIB_OIDPREFIX
+ NETSNMP_DS_LIB_CLIENT_ADDR
+ NETSNMP_DS_LIB_TEMP_FILE_PATTERN
+ NETSNMP_DS_LIB_AUTHMASTERKEY
+ NETSNMP_DS_LIB_PRIVMASTERKEY
+ NETSNMP_DS_LIB_AUTHLOCALIZEDKEY
+ NETSNMP_DS_LIB_PRIVLOCALIZEDKEY
+ NETSNMP_DS_LIB_APPTYPES
+ NETSNMP_DS_LIB_KSM_KEYTAB
+ NETSNMP_DS_LIB_KSM_SERVICE_NAME
+ NETSNMP_DS_LIB_SBSM_LOCAL_PWD
+ netsnmp_ds_get_boolean
+ netsnmp_ds_get_int
+ netsnmp_ds_get_string
+ netsnmp_ds_get_void
+ netsnmp_ds_register_config
+ netsnmp_ds_register_premib
+ netsnmp_ds_set_boolean
+ netsnmp_ds_set_int
+ netsnmp_ds_set_string
+ netsnmp_ds_set_void
+ netsnmp_ds_shutdown
+ netsnmp_ds_toggle_boolean
+) ] );
+
+@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+@EXPORT = qw(
+ NETSNMP_DS_MAX_IDS
+ NETSNMP_DS_MAX_SUBIDS
+ NETSNMP_DS_LIBRARY_ID
+ NETSNMP_DS_APPLICATION_ID
+ NETSNMP_DS_TOKEN_ID
+ NETSNMP_DS_LIB_MIB_ERRORS
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS
+ NETSNMP_DS_LIB_MIB_COMMENT_TERM
+ NETSNMP_DS_LIB_MIB_PARSE_LABEL
+ NETSNMP_DS_LIB_DUMP_PACKET
+ NETSNMP_DS_LIB_LOG_TIMESTAMP
+ NETSNMP_DS_LIB_DONT_READ_CONFIGS
+ NETSNMP_DS_LIB_MIB_REPLACE
+ NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM
+ NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS
+ NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG
+ NETSNMP_DS_LIB_PRINT_FULL_OID
+ NETSNMP_DS_LIB_QUICK_PRINT
+ NETSNMP_DS_LIB_RANDOM_ACCESS
+ NETSNMP_DS_LIB_REGEX_ACCESS
+ NETSNMP_DS_LIB_DONT_CHECK_RANGE
+ NETSNMP_DS_LIB_NO_TOKEN_WARNINGS
+ NETSNMP_DS_LIB_NUMERIC_TIMETICKS
+ NETSNMP_DS_LIB_ESCAPE_QUOTES
+ NETSNMP_DS_LIB_REVERSE_ENCODE
+ NETSNMP_DS_LIB_PRINT_BARE_VALUE
+ NETSNMP_DS_LIB_EXTENDED_INDEX
+ NETSNMP_DS_LIB_PRINT_HEX_TEXT
+ NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID
+ NETSNMP_DS_LIB_READ_UCD_STYLE_OID
+ NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG
+ NETSNMP_DS_LIB_HAVE_READ_CONFIG
+ NETSNMP_DS_LIB_QUICKE_PRINT
+ NETSNMP_DS_LIB_DONT_PRINT_UNITS
+ NETSNMP_DS_LIB_NO_DISPLAY_HINT
+ NETSNMP_DS_LIB_16BIT_IDS
+ NETSNMP_DS_LIB_DONT_PERSIST_STATE
+ NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT
+ NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE
+ NETSNMP_DS_LIB_APPEND_LOGFILES
+ NETSNMP_DS_LIB_MIB_WARNINGS
+ NETSNMP_DS_LIB_SECLEVEL
+ NETSNMP_DS_LIB_SNMPVERSION
+ NETSNMP_DS_LIB_DEFAULT_PORT
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT
+ NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT
+ NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH
+ NETSNMP_DS_LIB_SERVERSENDBUF
+ NETSNMP_DS_LIB_SERVERRECVBUF
+ NETSNMP_DS_LIB_CLIENTSENDBUF
+ NETSNMP_DS_LIB_CLIENTRECVBUF
+ NETSNMP_DS_SNMP_VERSION_1
+ NETSNMP_DS_SNMP_VERSION_2c
+ NETSNMP_DS_SNMP_VERSION_3
+ NETSNMP_DS_LIB_SECNAME
+ NETSNMP_DS_LIB_CONTEXT
+ NETSNMP_DS_LIB_PASSPHRASE
+ NETSNMP_DS_LIB_AUTHPASSPHRASE
+ NETSNMP_DS_LIB_PRIVPASSPHRASE
+ NETSNMP_DS_LIB_OPTIONALCONFIG
+ NETSNMP_DS_LIB_APPTYPE
+ NETSNMP_DS_LIB_COMMUNITY
+ NETSNMP_DS_LIB_PERSISTENT_DIR
+ NETSNMP_DS_LIB_CONFIGURATION_DIR
+ NETSNMP_DS_LIB_SECMODEL
+ NETSNMP_DS_LIB_MIBDIRS
+ NETSNMP_DS_LIB_OIDSUFFIX
+ NETSNMP_DS_LIB_OIDPREFIX
+ NETSNMP_DS_LIB_CLIENT_ADDR
+ NETSNMP_DS_LIB_TEMP_FILE_PATTERN
+ NETSNMP_DS_LIB_AUTHMASTERKEY
+ NETSNMP_DS_LIB_PRIVMASTERKEY
+ NETSNMP_DS_LIB_AUTHLOCALIZEDKEY
+ NETSNMP_DS_LIB_PRIVLOCALIZEDKEY
+ NETSNMP_DS_LIB_APPTYPES
+ NETSNMP_DS_LIB_KSM_KEYTAB
+ NETSNMP_DS_LIB_KSM_SERVICE_NAME
+ NETSNMP_DS_LIB_SBSM_LOCAL_PWD
+);
+$VERSION = '5.0702';
+
+sub AUTOLOAD {
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function.
+
+ my $constname;
+ ($constname = $AUTOLOAD) =~ s/.*:://;
+ croak "&NetSNMP::default_store::constant not defined" if $constname eq 'cons
+tant';
+ my ($error, $val) = constant($constname);
+ if ($error) { croak $error; }
+ {
+ no strict 'refs';
+ # Fixed between 5.005_53 and 5.005_61
+#XXX if ($] >= 5.00561) {
+#XXX *$AUTOLOAD = sub () { $val };
+#XXX }
+#XXX else {
+ *$AUTOLOAD = sub { $val };
+#XXX }
+ }
+ goto &$AUTOLOAD;
+}
+
+bootstrap NetSNMP::default_store $VERSION;
+
+# Preloaded methods go here.
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+
+=head1 NAME
+
+NetSNMP::default_store - Perl extension for Net-SNMP generic storage of global data
+
+=head1 SYNOPSIS
+
+ use NetSNMP::default_store qw(:all);
+ $port = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, DS_LIB_DEFAULT_PORT);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, DS_LIB_DEFAULT_PORT, 161);
+
+=head1 DESCRIPTION
+
+This module is a wrapper around the net-snmp default store routines.
+See the net-snmp default_store manual page for details on what the
+various functions do and the values that can be set/retrieved.
+
+=head2 EXPORT
+
+None by default.
+
+=head2 Exportable constants
+
+ NETSNMP_DS_MAX_IDS
+ NETSNMP_DS_MAX_SUBIDS
+ NETSNMP_DS_LIBRARY_ID
+ NETSNMP_DS_APPLICATION_ID
+ NETSNMP_DS_TOKEN_ID
+ NETSNMP_DS_LIB_MIB_ERRORS
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS
+ NETSNMP_DS_LIB_MIB_COMMENT_TERM
+ NETSNMP_DS_LIB_MIB_PARSE_LABEL
+ NETSNMP_DS_LIB_DUMP_PACKET
+ NETSNMP_DS_LIB_LOG_TIMESTAMP
+ NETSNMP_DS_LIB_DONT_READ_CONFIGS
+ NETSNMP_DS_LIB_MIB_REPLACE
+ NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM
+ NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS
+ NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG
+ NETSNMP_DS_LIB_PRINT_FULL_OID
+ NETSNMP_DS_LIB_QUICK_PRINT
+ NETSNMP_DS_LIB_RANDOM_ACCESS
+ NETSNMP_DS_LIB_REGEX_ACCESS
+ NETSNMP_DS_LIB_DONT_CHECK_RANGE
+ NETSNMP_DS_LIB_NO_TOKEN_WARNINGS
+ NETSNMP_DS_LIB_NUMERIC_TIMETICKS
+ NETSNMP_DS_LIB_ESCAPE_QUOTES
+ NETSNMP_DS_LIB_REVERSE_ENCODE
+ NETSNMP_DS_LIB_PRINT_BARE_VALUE
+ NETSNMP_DS_LIB_EXTENDED_INDEX
+ NETSNMP_DS_LIB_PRINT_HEX_TEXT
+ NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID
+ NETSNMP_DS_LIB_READ_UCD_STYLE_OID
+ NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG
+ NETSNMP_DS_LIB_HAVE_READ_CONFIG
+ NETSNMP_DS_LIB_QUICKE_PRINT
+ NETSNMP_DS_LIB_DONT_PRINT_UNITS
+ NETSNMP_DS_LIB_NO_DISPLAY_HINT
+ NETSNMP_DS_LIB_16BIT_IDS
+ NETSNMP_DS_LIB_DONT_PERSIST_STATE
+ NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT
+ NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE
+ NETSNMP_DS_LIB_APPEND_LOGFILES
+ NETSNMP_DS_LIB_MIB_WARNINGS
+ NETSNMP_DS_LIB_SECLEVEL
+ NETSNMP_DS_LIB_SNMPVERSION
+ NETSNMP_DS_LIB_DEFAULT_PORT
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT
+ NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT
+ NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH
+ NETSNMP_DS_LIB_SERVERSENDBUF
+ NETSNMP_DS_LIB_SERVERRECVBUF
+ NETSNMP_DS_LIB_CLIENTSENDBUF
+ NETSNMP_DS_LIB_CLIENTRECVBUF
+ NETSNMP_DS_SNMP_VERSION_1
+ NETSNMP_DS_SNMP_VERSION_2c
+ NETSNMP_DS_SNMP_VERSION_3
+ NETSNMP_DS_LIB_SECNAME
+ NETSNMP_DS_LIB_CONTEXT
+ NETSNMP_DS_LIB_PASSPHRASE
+ NETSNMP_DS_LIB_AUTHPASSPHRASE
+ NETSNMP_DS_LIB_PRIVPASSPHRASE
+ NETSNMP_DS_LIB_OPTIONALCONFIG
+ NETSNMP_DS_LIB_APPTYPE
+ NETSNMP_DS_LIB_COMMUNITY
+ NETSNMP_DS_LIB_PERSISTENT_DIR
+ NETSNMP_DS_LIB_CONFIGURATION_DIR
+ NETSNMP_DS_LIB_SECMODEL
+ NETSNMP_DS_LIB_MIBDIRS
+ NETSNMP_DS_LIB_OIDSUFFIX
+ NETSNMP_DS_LIB_OIDPREFIX
+ NETSNMP_DS_LIB_CLIENT_ADDR
+ NETSNMP_DS_LIB_TEMP_FILE_PATTERN
+ NETSNMP_DS_LIB_AUTHMASTERKEY
+ NETSNMP_DS_LIB_PRIVMASTERKEY
+ NETSNMP_DS_LIB_AUTHLOCALIZEDKEY
+ NETSNMP_DS_LIB_PRIVLOCALIZEDKEY
+ NETSNMP_DS_LIB_APPTYPES
+ NETSNMP_DS_LIB_KSM_KEYTAB
+ NETSNMP_DS_LIB_KSM_SERVICE_NAME
+ NETSNMP_DS_LIB_SBSM_LOCAL_PWD
+
+=head2 Exportable functions
+
+ int netsnmp_ds_get_boolean(int storeid, int which)
+ int netsnmp_ds_get_int(int storeid, int which)
+ char *netsnmp_ds_get_string(int storeid, int which)
+ void *netsnmp_ds_get_void(int storeid, int which)
+ int netsnmp_ds_register_config(unsigned char type, const char *ftype, const char *token,
+ int storeid, int which)
+ int netsnmp_ds_register_premib(unsigned char type, const char *ftype, const char *token,
+ int storeid, int which)
+ int netsnmp_ds_set_boolean(int storeid, int which, int value)
+ int netsnmp_ds_set_int(int storeid, int which, int value)
+ int netsnmp_ds_set_string(int storeid, int which, const char *value)
+ int netsnmp_ds_set_void(int storeid, int which, void *value)
+ void netsnmp_ds_shutdown(void)
+ int netsnmp_ds_toggle_boolean(int storeid, int which)
+
+=head1 AUTHOR
+
+Wes Hardaker, hardaker@users.sourceforge.net
+
+=head1 SEE ALSO
+
+perl(1), default_store(3).
+
+=cut
diff --git a/perl/default_store/default_store.xs b/perl/default_store/default_store.xs
new file mode 100644
index 0000000..ca252fb
--- /dev/null
+++ b/perl/default_store/default_store.xs
@@ -0,0 +1,1411 @@
+#if defined(_WIN32) && !defined(_WIN32_WINNT)
+#define _WIN32_WINNT 0x501
+#endif
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/library/default_store.h>
+
+
+/* autogenerated by "gen" from const-c.inc */
+
+#define PERL_constant_NOTFOUND 1
+#define PERL_constant_NOTDEF 2
+#define PERL_constant_ISIV 3
+#define PERL_constant_ISNO 4
+#define PERL_constant_ISNV 5
+#define PERL_constant_ISPV 6
+#define PERL_constant_ISPVN 7
+#define PERL_constant_ISSV 8
+#define PERL_constant_ISUNDEF 9
+#define PERL_constant_ISUV 10
+#define PERL_constant_ISYES 11
+
+#ifndef NVTYPE
+typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
+#endif
+#ifndef aTHX_
+#define aTHX_ /* 5.6 or later define this for threading support. */
+#endif
+#ifndef pTHX_
+#define pTHX_ /* 5.6 or later define this for threading support. */
+#endif
+
+static int
+constant_22 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_APPTYPE NETSNMP_DS_LIB_CONTEXT NETSNMP_DS_LIB_MIBDIRS
+ NETSNMP_DS_LIB_SECNAME */
+ /* Offset 16 gives the best switch position. */
+ switch (name[16]) {
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_LIB_SECNAME", 22)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_SECNAME
+ *iv_return = NETSNMP_DS_LIB_SECNAME;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "NETSNMP_DS_LIB_MIBDIRS", 22)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_MIBDIRS
+ *iv_return = NETSNMP_DS_LIB_MIBDIRS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "NETSNMP_DS_LIB_CONTEXT", 22)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_CONTEXT
+ *iv_return = NETSNMP_DS_LIB_CONTEXT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "NETSNMP_DS_LIB_APPTYPE", 22)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_APPTYPE
+ *iv_return = NETSNMP_DS_LIB_APPTYPE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_23 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_APPTYPES NETSNMP_DS_LIB_SECLEVEL NETSNMP_DS_LIB_SECMODEL */
+ /* Offset 18 gives the best switch position. */
+ switch (name[18]) {
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_LIB_SECLEVEL", 23)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_SECLEVEL
+ *iv_return = NETSNMP_DS_LIB_SECLEVEL;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "NETSNMP_DS_LIB_SECMODEL", 23)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_SECMODEL
+ *iv_return = NETSNMP_DS_LIB_SECMODEL;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "NETSNMP_DS_LIB_APPTYPES", 23)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_APPTYPES
+ *iv_return = NETSNMP_DS_LIB_APPTYPES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_24 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_16BIT_IDS NETSNMP_DS_LIB_COMMUNITY NETSNMP_DS_LIB_OIDPREFIX
+ NETSNMP_DS_LIB_OIDSUFFIX */
+ /* Offset 18 gives the best switch position. */
+ switch (name[18]) {
+ case 'I':
+ if (memEQ(name, "NETSNMP_DS_LIB_16BIT_IDS", 24)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_16BIT_IDS
+ *iv_return = NETSNMP_DS_LIB_16BIT_IDS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "NETSNMP_DS_LIB_COMMUNITY", 24)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_COMMUNITY
+ *iv_return = NETSNMP_DS_LIB_COMMUNITY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "NETSNMP_DS_LIB_OIDPREFIX", 24)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_OIDPREFIX
+ *iv_return = NETSNMP_DS_LIB_OIDPREFIX;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "NETSNMP_DS_LIB_OIDSUFFIX", 24)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_OIDSUFFIX
+ *iv_return = NETSNMP_DS_LIB_OIDSUFFIX;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_25 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_APPLICATION_ID NETSNMP_DS_LIB_KSM_KEYTAB
+ NETSNMP_DS_LIB_MIB_ERRORS NETSNMP_DS_LIB_PASSPHRASE
+ NETSNMP_DS_SNMP_VERSION_1 NETSNMP_DS_SNMP_VERSION_3 */
+ /* Offset 24 gives the best switch position. */
+ switch (name[24]) {
+ case '1':
+ if (memEQ(name, "NETSNMP_DS_SNMP_VERSION_", 24)) {
+ /* 1 */
+#ifdef NETSNMP_DS_SNMP_VERSION_1
+ *iv_return = NETSNMP_DS_SNMP_VERSION_1;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case '3':
+ if (memEQ(name, "NETSNMP_DS_SNMP_VERSION_", 24)) {
+ /* 3 */
+#ifdef NETSNMP_DS_SNMP_VERSION_3
+ *iv_return = NETSNMP_DS_SNMP_VERSION_3;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'B':
+ if (memEQ(name, "NETSNMP_DS_LIB_KSM_KEYTA", 24)) {
+ /* B */
+#ifdef NETSNMP_DS_LIB_KSM_KEYTAB
+ *iv_return = NETSNMP_DS_LIB_KSM_KEYTAB;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "NETSNMP_DS_APPLICATION_I", 24)) {
+ /* D */
+#ifdef NETSNMP_DS_APPLICATION_ID
+ *iv_return = NETSNMP_DS_APPLICATION_ID;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_LIB_PASSPHRAS", 24)) {
+ /* E */
+#ifdef NETSNMP_DS_LIB_PASSPHRASE
+ *iv_return = NETSNMP_DS_LIB_PASSPHRASE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "NETSNMP_DS_LIB_MIB_ERROR", 24)) {
+ /* S */
+#ifdef NETSNMP_DS_LIB_MIB_ERRORS
+ *iv_return = NETSNMP_DS_LIB_MIB_ERRORS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_26 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_CLIENT_ADDR NETSNMP_DS_LIB_DUMP_PACKET
+ NETSNMP_DS_LIB_MIB_REPLACE NETSNMP_DS_LIB_QUICK_PRINT
+ NETSNMP_DS_LIB_SNMPVERSION NETSNMP_DS_SNMP_VERSION_2c */
+ /* Offset 22 gives the best switch position. */
+ switch (name[22]) {
+ case 'A':
+ if (memEQ(name, "NETSNMP_DS_LIB_CLIENT_ADDR", 26)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_CLIENT_ADDR
+ *iv_return = NETSNMP_DS_LIB_CLIENT_ADDR;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "NETSNMP_DS_LIB_DUMP_PACKET", 26)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_DUMP_PACKET
+ *iv_return = NETSNMP_DS_LIB_DUMP_PACKET;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_LIB_MIB_REPLACE", 26)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_MIB_REPLACE
+ *iv_return = NETSNMP_DS_LIB_MIB_REPLACE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "NETSNMP_DS_SNMP_VERSION_2c", 26)) {
+ /* ^ */
+#ifdef NETSNMP_DS_SNMP_VERSION_2c
+ *iv_return = NETSNMP_DS_SNMP_VERSION_2c;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "NETSNMP_DS_LIB_QUICK_PRINT", 26)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_QUICK_PRINT
+ *iv_return = NETSNMP_DS_LIB_QUICK_PRINT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "NETSNMP_DS_LIB_SNMPVERSION", 26)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_SNMPVERSION
+ *iv_return = NETSNMP_DS_LIB_SNMPVERSION;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_27 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_DEFAULT_PORT NETSNMP_DS_LIB_MIB_WARNINGS
+ NETSNMP_DS_LIB_QUICKE_PRINT NETSNMP_DS_LIB_REGEX_ACCESS */
+ /* Offset 17 gives the best switch position. */
+ switch (name[17]) {
+ case 'B':
+ if (memEQ(name, "NETSNMP_DS_LIB_MIB_WARNINGS", 27)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_MIB_WARNINGS
+ *iv_return = NETSNMP_DS_LIB_MIB_WARNINGS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'F':
+ if (memEQ(name, "NETSNMP_DS_LIB_DEFAULT_PORT", 27)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_DEFAULT_PORT
+ *iv_return = NETSNMP_DS_LIB_DEFAULT_PORT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "NETSNMP_DS_LIB_REGEX_ACCESS", 27)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_REGEX_ACCESS
+ *iv_return = NETSNMP_DS_LIB_REGEX_ACCESS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "NETSNMP_DS_LIB_QUICKE_PRINT", 27)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_QUICKE_PRINT
+ *iv_return = NETSNMP_DS_LIB_QUICKE_PRINT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_28 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_AUTHMASTERKEY NETSNMP_DS_LIB_CLIENTRECVBUF
+ NETSNMP_DS_LIB_CLIENTSENDBUF NETSNMP_DS_LIB_ESCAPE_QUOTES
+ NETSNMP_DS_LIB_LOG_TIMESTAMP NETSNMP_DS_LIB_PRIVMASTERKEY
+ NETSNMP_DS_LIB_RANDOM_ACCESS NETSNMP_DS_LIB_SERVERRECVBUF
+ NETSNMP_DS_LIB_SERVERSENDBUF */
+ /* Offset 15 gives the best switch position. */
+ switch (name[15]) {
+ case 'A':
+ if (memEQ(name, "NETSNMP_DS_LIB_AUTHMASTERKEY", 28)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_AUTHMASTERKEY
+ *iv_return = NETSNMP_DS_LIB_AUTHMASTERKEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "NETSNMP_DS_LIB_CLIENTRECVBUF", 28)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_CLIENTRECVBUF
+ *iv_return = NETSNMP_DS_LIB_CLIENTRECVBUF;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "NETSNMP_DS_LIB_CLIENTSENDBUF", 28)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_CLIENTSENDBUF
+ *iv_return = NETSNMP_DS_LIB_CLIENTSENDBUF;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_LIB_ESCAPE_QUOTES", 28)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_ESCAPE_QUOTES
+ *iv_return = NETSNMP_DS_LIB_ESCAPE_QUOTES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_LIB_LOG_TIMESTAMP", 28)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_LOG_TIMESTAMP
+ *iv_return = NETSNMP_DS_LIB_LOG_TIMESTAMP;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "NETSNMP_DS_LIB_PRIVMASTERKEY", 28)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_PRIVMASTERKEY
+ *iv_return = NETSNMP_DS_LIB_PRIVMASTERKEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "NETSNMP_DS_LIB_RANDOM_ACCESS", 28)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_RANDOM_ACCESS
+ *iv_return = NETSNMP_DS_LIB_RANDOM_ACCESS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "NETSNMP_DS_LIB_SERVERRECVBUF", 28)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_SERVERRECVBUF
+ *iv_return = NETSNMP_DS_LIB_SERVERRECVBUF;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "NETSNMP_DS_LIB_SERVERSENDBUF", 28)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_SERVERSENDBUF
+ *iv_return = NETSNMP_DS_LIB_SERVERSENDBUF;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_29 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_AUTHPASSPHRASE NETSNMP_DS_LIB_EXTENDED_INDEX
+ NETSNMP_DS_LIB_OPTIONALCONFIG NETSNMP_DS_LIB_PERSISTENT_DIR
+ NETSNMP_DS_LIB_PRINT_FULL_OID NETSNMP_DS_LIB_PRINT_HEX_TEXT
+ NETSNMP_DS_LIB_PRIVPASSPHRASE NETSNMP_DS_LIB_REVERSE_ENCODE
+ NETSNMP_DS_LIB_SBSM_LOCAL_PWD */
+ /* Offset 23 gives the best switch position. */
+ switch (name[23]) {
+ case 'A':
+ if (memEQ(name, "NETSNMP_DS_LIB_SBSM_LOCAL_PWD", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_SBSM_LOCAL_PWD
+ *iv_return = NETSNMP_DS_LIB_SBSM_LOCAL_PWD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "NETSNMP_DS_LIB_OPTIONALCONFIG", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_OPTIONALCONFIG
+ *iv_return = NETSNMP_DS_LIB_OPTIONALCONFIG;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_LIB_REVERSE_ENCODE", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_REVERSE_ENCODE
+ *iv_return = NETSNMP_DS_LIB_REVERSE_ENCODE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_LIB_PRINT_FULL_OID", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_PRINT_FULL_OID
+ *iv_return = NETSNMP_DS_LIB_PRINT_FULL_OID;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "NETSNMP_DS_LIB_PERSISTENT_DIR", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_PERSISTENT_DIR
+ *iv_return = NETSNMP_DS_LIB_PERSISTENT_DIR;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "NETSNMP_DS_LIB_AUTHPASSPHRASE", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_AUTHPASSPHRASE
+ *iv_return = NETSNMP_DS_LIB_AUTHPASSPHRASE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "NETSNMP_DS_LIB_PRIVPASSPHRASE", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_PRIVPASSPHRASE
+ *iv_return = NETSNMP_DS_LIB_PRIVPASSPHRASE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "NETSNMP_DS_LIB_PRINT_HEX_TEXT", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_PRINT_HEX_TEXT
+ *iv_return = NETSNMP_DS_LIB_PRINT_HEX_TEXT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case '_':
+ if (memEQ(name, "NETSNMP_DS_LIB_EXTENDED_INDEX", 29)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_EXTENDED_INDEX
+ *iv_return = NETSNMP_DS_LIB_EXTENDED_INDEX;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_30 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_APPEND_LOGFILES NETSNMP_DS_LIB_MIB_PARSE_LABEL
+ NETSNMP_DS_LIB_NO_DISPLAY_HINT NETSNMP_DS_LIB_SAVE_MIB_DESCRS */
+ /* Offset 27 gives the best switch position. */
+ switch (name[27]) {
+ case 'B':
+ if (memEQ(name, "NETSNMP_DS_LIB_MIB_PARSE_LABEL", 30)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_MIB_PARSE_LABEL
+ *iv_return = NETSNMP_DS_LIB_MIB_PARSE_LABEL;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "NETSNMP_DS_LIB_SAVE_MIB_DESCRS", 30)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_SAVE_MIB_DESCRS
+ *iv_return = NETSNMP_DS_LIB_SAVE_MIB_DESCRS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "NETSNMP_DS_LIB_NO_DISPLAY_HINT", 30)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_NO_DISPLAY_HINT
+ *iv_return = NETSNMP_DS_LIB_NO_DISPLAY_HINT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_LIB_APPEND_LOGFILES", 30)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_APPEND_LOGFILES
+ *iv_return = NETSNMP_DS_LIB_APPEND_LOGFILES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_31 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_AUTHLOCALIZEDKEY NETSNMP_DS_LIB_DONT_CHECK_RANGE
+ NETSNMP_DS_LIB_DONT_PRINT_UNITS NETSNMP_DS_LIB_HAVE_READ_CONFIG
+ NETSNMP_DS_LIB_KSM_SERVICE_NAME NETSNMP_DS_LIB_MIB_COMMENT_TERM
+ NETSNMP_DS_LIB_PRINT_BARE_VALUE NETSNMP_DS_LIB_PRIVLOCALIZEDKEY */
+ /* Offset 28 gives the best switch position. */
+ switch (name[28]) {
+ case 'A':
+ if (memEQ(name, "NETSNMP_DS_LIB_KSM_SERVICE_NAME", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_KSM_SERVICE_NAME
+ *iv_return = NETSNMP_DS_LIB_KSM_SERVICE_NAME;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_LIB_MIB_COMMENT_TERM", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_MIB_COMMENT_TERM
+ *iv_return = NETSNMP_DS_LIB_MIB_COMMENT_TERM;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'F':
+ if (memEQ(name, "NETSNMP_DS_LIB_HAVE_READ_CONFIG", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_HAVE_READ_CONFIG
+ *iv_return = NETSNMP_DS_LIB_HAVE_READ_CONFIG;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "NETSNMP_DS_LIB_DONT_PRINT_UNITS", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_DONT_PRINT_UNITS
+ *iv_return = NETSNMP_DS_LIB_DONT_PRINT_UNITS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "NETSNMP_DS_LIB_AUTHLOCALIZEDKEY", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_AUTHLOCALIZEDKEY
+ *iv_return = NETSNMP_DS_LIB_AUTHLOCALIZEDKEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "NETSNMP_DS_LIB_PRIVLOCALIZEDKEY", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_PRIVLOCALIZEDKEY
+ *iv_return = NETSNMP_DS_LIB_PRIVLOCALIZEDKEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_LIB_PRINT_BARE_VALUE", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_PRINT_BARE_VALUE
+ *iv_return = NETSNMP_DS_LIB_PRINT_BARE_VALUE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "NETSNMP_DS_LIB_DONT_CHECK_RANGE", 31)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_DONT_CHECK_RANGE
+ *iv_return = NETSNMP_DS_LIB_DONT_CHECK_RANGE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_32 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT NETSNMP_DS_LIB_CONFIGURATION_DIR
+ NETSNMP_DS_LIB_DONT_READ_CONFIGS NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH
+ NETSNMP_DS_LIB_NO_TOKEN_WARNINGS NETSNMP_DS_LIB_NUMERIC_TIMETICKS
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY
+ NETSNMP_DS_LIB_TEMP_FILE_PATTERN */
+ /* Offset 29 gives the best switch position. */
+ switch (name[29]) {
+ case 'C':
+ if (memEQ(name, "NETSNMP_DS_LIB_NUMERIC_TIMETICKS", 32)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_NUMERIC_TIMETICKS
+ *iv_return = NETSNMP_DS_LIB_NUMERIC_TIMETICKS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "NETSNMP_DS_LIB_CONFIGURATION_DIR", 32)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_CONFIGURATION_DIR
+ *iv_return = NETSNMP_DS_LIB_CONFIGURATION_DIR;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_LIB_TEMP_FILE_PATTERN", 32)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_TEMP_FILE_PATTERN
+ *iv_return = NETSNMP_DS_LIB_TEMP_FILE_PATTERN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH", 32)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH
+ *iv_return = NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "NETSNMP_DS_LIB_DONT_READ_CONFIGS", 32)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_DONT_READ_CONFIGS
+ *iv_return = NETSNMP_DS_LIB_DONT_READ_CONFIGS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "NETSNMP_DS_LIB_OID_OUTPUT_FORMAT", 32)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_OID_OUTPUT_FORMAT
+ *iv_return = NETSNMP_DS_LIB_OID_OUTPUT_FORMAT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "NETSNMP_DS_LIB_NO_TOKEN_WARNINGS", 32)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_NO_TOKEN_WARNINGS
+ *iv_return = NETSNMP_DS_LIB_NO_TOKEN_WARNINGS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY", 32)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY
+ *iv_return = NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT", 32)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT
+ *iv_return = NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_33 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG NETSNMP_DS_LIB_DONT_PERSIST_STATE
+ NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS
+ NETSNMP_DS_LIB_READ_UCD_STYLE_OID */
+ /* Offset 32 gives the best switch position. */
+ switch (name[32]) {
+ case 'D':
+ if (memEQ(name, "NETSNMP_DS_LIB_READ_UCD_STYLE_OI", 32)) {
+ /* D */
+#ifdef NETSNMP_DS_LIB_READ_UCD_STYLE_OID
+ *iv_return = NETSNMP_DS_LIB_READ_UCD_STYLE_OID;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_LIB_DONT_PERSIST_STAT", 32)) {
+ /* E */
+#ifdef NETSNMP_DS_LIB_DONT_PERSIST_STATE
+ *iv_return = NETSNMP_DS_LIB_DONT_PERSIST_STATE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "NETSNMP_DS_LIB_ALARM_DONT_USE_SI", 32)) {
+ /* G */
+#ifdef NETSNMP_DS_LIB_ALARM_DONT_USE_SIG
+ *iv_return = NETSNMP_DS_LIB_ALARM_DONT_USE_SIG;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "NETSNMP_DS_LIB_PRINT_NUMERIC_ENU", 32)) {
+ /* M */
+#ifdef NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM
+ *iv_return = NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "NETSNMP_DS_LIB_PRINT_NUMERIC_OID", 32)) {
+ /* S */
+#ifdef NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS
+ *iv_return = NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_34 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_DISABLE_CONFIG_LOAD NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS
+ NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID */
+ /* Offset 28 gives the best switch position. */
+ switch (name[28]) {
+ case 'G':
+ if (memEQ(name, "NETSNMP_DS_LIB_DISABLE_CONFIG_LOAD", 34)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_DISABLE_CONFIG_LOAD
+ *iv_return = NETSNMP_DS_LIB_DISABLE_CONFIG_LOAD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID", 34)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID
+ *iv_return = NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY", 34)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY
+ *iv_return = NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS", 34)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS
+ *iv_return = NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_38 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE
+ NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG */
+ /* Offset 37 gives the best switch position. */
+ switch (name[37]) {
+ case 'D':
+ if (memEQ(name, "NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOA", 37)) {
+ /* D */
+#ifdef NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD
+ *iv_return = NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAV", 37)) {
+ /* E */
+#ifdef NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE
+ *iv_return = NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFI", 37)) {
+ /* G */
+#ifdef NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG
+ *iv_return = NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
+ /* Initially switch on the length of the name. */
+ /* When generated this function returned values for the list of names given
+ in this section of perl code. Rather than manually editing these functions
+ to add or remove constants, which would result in this comment and section
+ of code becoming inaccurate, we recommend that you edit this section of
+ code, and use it to regenerate a new set of constant functions which you
+ then use to replace the originals.
+
+ Regenerate these constant functions by feeding this entire source file to
+ perl -x
+
+#!/usr/bin/perl -w
+use ExtUtils::Constant qw (constant_types C_constant XS_constant);
+
+my $types = {map {($_, 1)} qw(IV)};
+my @names = (qw(NETSNMP_DS_APPLICATION_ID NETSNMP_DS_LIBRARY_ID
+ NETSNMP_DS_LIB_16BIT_IDS NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG NETSNMP_DS_LIB_APPEND_LOGFILES
+ NETSNMP_DS_LIB_APPTYPE NETSNMP_DS_LIB_APPTYPES
+ NETSNMP_DS_LIB_AUTHLOCALIZEDKEY NETSNMP_DS_LIB_AUTHMASTERKEY
+ NETSNMP_DS_LIB_AUTHPASSPHRASE NETSNMP_DS_LIB_CLIENTRECVBUF
+ NETSNMP_DS_LIB_CLIENTSENDBUF NETSNMP_DS_LIB_CLIENT_ADDR
+ NETSNMP_DS_LIB_COMMUNITY NETSNMP_DS_LIB_CONFIGURATION_DIR
+ NETSNMP_DS_LIB_CONTEXT NETSNMP_DS_LIB_DEFAULT_PORT
+ NETSNMP_DS_LIB_DISABLE_CONFIG_LOAD
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE
+ NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS
+ NETSNMP_DS_LIB_DONT_CHECK_RANGE
+ NETSNMP_DS_LIB_DONT_PERSIST_STATE
+ NETSNMP_DS_LIB_DONT_PRINT_UNITS NETSNMP_DS_LIB_DONT_READ_CONFIGS
+ NETSNMP_DS_LIB_DUMP_PACKET NETSNMP_DS_LIB_ESCAPE_QUOTES
+ NETSNMP_DS_LIB_EXTENDED_INDEX NETSNMP_DS_LIB_HAVE_READ_CONFIG
+ NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG
+ NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH
+ NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY NETSNMP_DS_LIB_KSM_KEYTAB
+ NETSNMP_DS_LIB_KSM_SERVICE_NAME NETSNMP_DS_LIB_LOG_TIMESTAMP
+ NETSNMP_DS_LIB_MIBDIRS NETSNMP_DS_LIB_MIB_COMMENT_TERM
+ NETSNMP_DS_LIB_MIB_ERRORS NETSNMP_DS_LIB_MIB_PARSE_LABEL
+ NETSNMP_DS_LIB_MIB_REPLACE NETSNMP_DS_LIB_MIB_WARNINGS
+ NETSNMP_DS_LIB_NO_DISPLAY_HINT NETSNMP_DS_LIB_NO_TOKEN_WARNINGS
+ NETSNMP_DS_LIB_NUMERIC_TIMETICKS NETSNMP_DS_LIB_OIDPREFIX
+ NETSNMP_DS_LIB_OIDSUFFIX NETSNMP_DS_LIB_OID_OUTPUT_FORMAT
+ NETSNMP_DS_LIB_OPTIONALCONFIG NETSNMP_DS_LIB_PASSPHRASE
+ NETSNMP_DS_LIB_PERSISTENT_DIR NETSNMP_DS_LIB_PRINT_BARE_VALUE
+ NETSNMP_DS_LIB_PRINT_FULL_OID NETSNMP_DS_LIB_PRINT_HEX_TEXT
+ NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM
+ NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS
+ NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY
+ NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID
+ NETSNMP_DS_LIB_PRIVLOCALIZEDKEY NETSNMP_DS_LIB_PRIVMASTERKEY
+ NETSNMP_DS_LIB_PRIVPASSPHRASE NETSNMP_DS_LIB_QUICKE_PRINT
+ NETSNMP_DS_LIB_QUICK_PRINT NETSNMP_DS_LIB_RANDOM_ACCESS
+ NETSNMP_DS_LIB_READ_UCD_STYLE_OID NETSNMP_DS_LIB_REGEX_ACCESS
+ NETSNMP_DS_LIB_REVERSE_ENCODE NETSNMP_DS_LIB_SAVE_MIB_DESCRS
+ NETSNMP_DS_LIB_SBSM_LOCAL_PWD NETSNMP_DS_LIB_SECLEVEL
+ NETSNMP_DS_LIB_SECMODEL NETSNMP_DS_LIB_SECNAME
+ NETSNMP_DS_LIB_SERVERRECVBUF NETSNMP_DS_LIB_SERVERSENDBUF
+ NETSNMP_DS_LIB_SNMPVERSION NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT
+ NETSNMP_DS_LIB_TEMP_FILE_PATTERN NETSNMP_DS_MAX_IDS
+ NETSNMP_DS_MAX_SUBIDS NETSNMP_DS_SNMP_VERSION_1
+ NETSNMP_DS_SNMP_VERSION_2c NETSNMP_DS_SNMP_VERSION_3
+ NETSNMP_DS_TOKEN_ID));
+
+print constant_types(); # macro defs
+foreach (C_constant ("NetSNMP::default_store", 'constant', 'IV', $types, undef, 3, @names) ) {
+ print $_, "\n"; # C constant subs
+}
+print "#### XS Section:\n";
+print XS_constant ("NetSNMP::default_store", $types);
+__END__
+ */
+
+ switch (len) {
+ case 18:
+ if (memEQ(name, "NETSNMP_DS_MAX_IDS", 18)) {
+#ifdef NETSNMP_DS_MAX_IDS
+ *iv_return = NETSNMP_DS_MAX_IDS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 19:
+ if (memEQ(name, "NETSNMP_DS_TOKEN_ID", 19)) {
+#ifdef NETSNMP_DS_TOKEN_ID
+ *iv_return = NETSNMP_DS_TOKEN_ID;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 21:
+ /* Names all of length 21. */
+ /* NETSNMP_DS_LIBRARY_ID NETSNMP_DS_MAX_SUBIDS */
+ /* Offset 11 gives the best switch position. */
+ switch (name[11]) {
+ case 'L':
+ if (memEQ(name, "NETSNMP_DS_LIBRARY_ID", 21)) {
+ /* ^ */
+#ifdef NETSNMP_DS_LIBRARY_ID
+ *iv_return = NETSNMP_DS_LIBRARY_ID;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "NETSNMP_DS_MAX_SUBIDS", 21)) {
+ /* ^ */
+#ifdef NETSNMP_DS_MAX_SUBIDS
+ *iv_return = NETSNMP_DS_MAX_SUBIDS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ break;
+ case 22:
+ return constant_22 (aTHX_ name, iv_return);
+ break;
+ case 23:
+ return constant_23 (aTHX_ name, iv_return);
+ break;
+ case 24:
+ return constant_24 (aTHX_ name, iv_return);
+ break;
+ case 25:
+ return constant_25 (aTHX_ name, iv_return);
+ break;
+ case 26:
+ return constant_26 (aTHX_ name, iv_return);
+ break;
+ case 27:
+ return constant_27 (aTHX_ name, iv_return);
+ break;
+ case 28:
+ return constant_28 (aTHX_ name, iv_return);
+ break;
+ case 29:
+ return constant_29 (aTHX_ name, iv_return);
+ break;
+ case 30:
+ return constant_30 (aTHX_ name, iv_return);
+ break;
+ case 31:
+ return constant_31 (aTHX_ name, iv_return);
+ break;
+ case 32:
+ return constant_32 (aTHX_ name, iv_return);
+ break;
+ case 33:
+ return constant_33 (aTHX_ name, iv_return);
+ break;
+ case 34:
+ return constant_34 (aTHX_ name, iv_return);
+ break;
+ case 35:
+ if (memEQ(name, "NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT", 35)) {
+#ifdef NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT
+ *iv_return = NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 38:
+ return constant_38 (aTHX_ name, iv_return);
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+
+
+/* autogenerated by "gen" from const-xs.inc */
+
+MODULE = NetSNMP::default_store PACKAGE = NetSNMP::default_store
+
+void
+constant(sv)
+ PREINIT:
+#ifdef dXSTARG
+ dXSTARG; /* Faster if we have it. */
+#else
+ dTARGET;
+#endif
+ STRLEN len;
+ int type;
+ IV iv = 0;
+ /* NV nv; Uncomment this if you need to return NVs */
+ /* const char *pv; Uncomment this if you need to return PVs */
+ INPUT:
+ SV * sv;
+ const char * s = SvPV(sv, len);
+ PPCODE:
+ /* Change this to constant(aTHX_ s, len, &iv, &nv);
+ if you need to return both NVs and IVs */
+ type = constant(aTHX_ s, len, &iv);
+ /* Return 1 or 2 items. First is error message, or undef if no error.
+ Second, if present, is found value */
+ switch (type) {
+ case PERL_constant_NOTFOUND:
+ sv = sv_2mortal(newSVpvf("%s is not a valid NetSNMP::default_store macro", s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_NOTDEF:
+ sv = sv_2mortal(newSVpvf(
+ "Your vendor has not defined NetSNMP::default_store macro %s, used", s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_ISIV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHi(iv);
+ break;
+ /* Uncomment this if you need to return NOs
+ case PERL_constant_ISNO:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_no);
+ break; */
+ /* Uncomment this if you need to return NVs
+ case PERL_constant_ISNV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHn(nv);
+ break; */
+ /* Uncomment this if you need to return PVs
+ case PERL_constant_ISPV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, strlen(pv));
+ break; */
+ /* Uncomment this if you need to return PVNs
+ case PERL_constant_ISPVN:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, iv);
+ break; */
+ /* Uncomment this if you need to return SVs
+ case PERL_constant_ISSV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(sv);
+ break; */
+ /* Uncomment this if you need to return UNDEFs
+ case PERL_constant_ISUNDEF:
+ break; */
+ /* Uncomment this if you need to return UVs
+ case PERL_constant_ISUV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHu((UV)iv);
+ break; */
+ /* Uncomment this if you need to return YESs
+ case PERL_constant_ISYES:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_yes);
+ break; */
+ default:
+ sv = sv_2mortal(newSVpvf(
+ "Unexpected return type %d while processing NetSNMP::default_store macro %s, used",
+ type, s));
+ PUSHs(sv);
+ }
+
+
+
+int
+netsnmp_ds_get_boolean(storeid, which)
+ int storeid
+ int which
+
+int
+netsnmp_ds_get_int(storeid, which)
+ int storeid
+ int which
+
+char *
+netsnmp_ds_get_string(storeid, which)
+ int storeid
+ int which
+
+void *
+netsnmp_ds_get_void(storeid, which)
+ int storeid
+ int which
+
+int
+netsnmp_ds_register_config(type, ftype, token, storeid, which)
+ unsigned char type
+ const char * ftype
+ const char * token
+ int storeid
+ int which
+
+int
+netsnmp_ds_register_premib(type, ftype, token, storeid, which)
+ unsigned char type
+ const char * ftype
+ const char * token
+ int storeid
+ int which
+
+int
+netsnmp_ds_set_boolean(storeid, which, value)
+ int storeid
+ int which
+ int value
+
+int
+netsnmp_ds_set_int(storeid, which, value)
+ int storeid
+ int which
+ int value
+
+int
+netsnmp_ds_set_string(storeid, which, value)
+ int storeid
+ int which
+ const char * value
+
+int
+netsnmp_ds_set_void(storeid, which, value)
+ int storeid
+ int which
+ void * value
+
+void
+netsnmp_ds_shutdown()
+
+int
+netsnmp_ds_toggle_boolean(storeid, which)
+ int storeid
+ int which
diff --git a/perl/default_store/gen b/perl/default_store/gen
new file mode 100755
index 0000000..7691296
--- /dev/null
+++ b/perl/default_store/gen
@@ -0,0 +1,131 @@
+#!/usr/bin/perl
+
+system("grep 'define NETSNMP_DS_' ../../include/net-snmp/library/default_store.h > default_store.h");
+#gcc -E ../../include/net-snmp/library/default_store.h | grep -v default_store.h >> default_store.h
+system("h2xs -b 5.5.0 -n NetSNMP::default_store -O default_store.h");
+
+open(ORIG,"default_store.xs");
+open(NEW1,"NetSNMP-default_store/fallback/const-c.inc");
+open(NEW2,"NetSNMP-default_store/fallback/const-xs.inc");
+open(OUT,">default_store_new.xs");
+
+# get up to the include from the original file
+while(<ORIG>) {
+ print OUT;
+ last if (/include <net-snmp\/library\/default_store.h/);
+}
+
+# include the entire new file
+print OUT "\n\n/* autogenerated by \"gen\" from const-c.inc */\n\n";
+print OUT <NEW1>;
+print OUT "\n\n/* autogenerated by \"gen\" from const-xs.inc */\n\n";
+print OUT "MODULE = NetSNMP::default_store PACKAGE = NetSNMP::default_store\n\n";
+
+print OUT <NEW2>;
+
+#print OUT "\n\n/* autogenerated by \"gen\" from tail of old .xs file */\n\n";
+print OUT "\n\n\n";
+
+# skip past the constant portion of the old file
+while (<ORIG>) {
+ last if (/netsnmp_ds_get_bool/);
+ $last = $_;
+}
+
+# We need the last two lines
+print OUT $last;
+print OUT $_;
+
+# and the rest
+print OUT <ORIG>;
+
+close(OUT);
+
+#
+# generate test
+#
+open(H,"default_store.h");
+open(ORIG,"test.pl");
+open(OUT,">test.pl.new");
+
+while(<ORIG>) {
+ print OUT;
+ last if (/\%tests =/);
+}
+
+while(<H>) {
+ if (/define\s+(\w+)\s+(\d+)/) {
+ printf OUT (" %-40s => %d,\n", "\"$1\"", $2);
+ $tokenlist .= " $1\n";
+ }
+}
+
+while(<ORIG>) {
+ last if (/\);/);
+}
+print OUT;
+print OUT <ORIG>;
+close(OUT);
+
+#
+# modify the perl module itself
+#
+open(H,"default_store.h");
+open(ORIG,"default_store.pm");
+open(OUT,">default_store_new.pm");
+
+# first list
+while(<ORIG>) {
+ print OUT;
+ last if (/\%EXPORT_TAGS =/);
+}
+print OUT $tokenlist;
+while(<ORIG>) {
+ last if (/netsnmp_ds_get_boolean/);
+}
+print OUT;
+
+# second list
+while(<ORIG>) {
+ print OUT;
+ last if (/\@EXPORT =/);
+}
+print OUT $tokenlist;
+while(<ORIG>) {
+ last if (/\);/);
+}
+print OUT;
+
+# last section
+while(<ORIG>) {
+ print OUT;
+ last if (/head2 Exportable constants/);
+}
+print OUT "\n";
+print OUT $tokenlist;
+while(<ORIG>) {
+ last if (/head2 Exportable functions/);
+}
+print OUT "\n";
+print OUT;
+
+# tail end
+print OUT <ORIG>;
+close(OUT);
+
+#
+# install new files
+#
+print "updated test.pl\n";
+rename("test.pl.new","test.pl");
+rename("default_store_new.pm", "default_store.pm");
+print "updated default_store.pm\n";
+rename("default_store_new.xs", "default_store.xs");
+print "updated default_store.xs\n";
+
+#
+# remove the temp files.
+#
+system("rm -rf NetSNMP-default_store");
+unlink("default_store.h");
+
diff --git a/perl/default_store/netsnmp-feature-definitions.h b/perl/default_store/netsnmp-feature-definitions.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/perl/default_store/netsnmp-feature-definitions.h
diff --git a/perl/default_store/test.pl b/perl/default_store/test.pl
new file mode 100644
index 0000000..b429c6b
--- /dev/null
+++ b/perl/default_store/test.pl
@@ -0,0 +1,124 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1;
+
+ %tests = (
+ "NETSNMP_DS_MAX_IDS" => 3,
+ "NETSNMP_DS_MAX_SUBIDS" => 48,
+ "NETSNMP_DS_LIBRARY_ID" => 0,
+ "NETSNMP_DS_APPLICATION_ID" => 1,
+ "NETSNMP_DS_TOKEN_ID" => 2,
+ "NETSNMP_DS_LIB_MIB_ERRORS" => 0,
+ "NETSNMP_DS_LIB_SAVE_MIB_DESCRS" => 1,
+ "NETSNMP_DS_LIB_MIB_COMMENT_TERM" => 2,
+ "NETSNMP_DS_LIB_MIB_PARSE_LABEL" => 3,
+ "NETSNMP_DS_LIB_DUMP_PACKET" => 4,
+ "NETSNMP_DS_LIB_LOG_TIMESTAMP" => 5,
+ "NETSNMP_DS_LIB_DONT_READ_CONFIGS" => 6,
+ "NETSNMP_DS_LIB_MIB_REPLACE" => 7,
+ "NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM" => 8,
+ "NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS" => 9,
+ "NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS" => 10,
+ "NETSNMP_DS_LIB_ALARM_DONT_USE_SIG" => 11,
+ "NETSNMP_DS_LIB_PRINT_FULL_OID" => 12,
+ "NETSNMP_DS_LIB_QUICK_PRINT" => 13,
+ "NETSNMP_DS_LIB_RANDOM_ACCESS" => 14,
+ "NETSNMP_DS_LIB_REGEX_ACCESS" => 15,
+ "NETSNMP_DS_LIB_DONT_CHECK_RANGE" => 16,
+ "NETSNMP_DS_LIB_NO_TOKEN_WARNINGS" => 17,
+ "NETSNMP_DS_LIB_NUMERIC_TIMETICKS" => 18,
+ "NETSNMP_DS_LIB_ESCAPE_QUOTES" => 19,
+ "NETSNMP_DS_LIB_REVERSE_ENCODE" => 20,
+ "NETSNMP_DS_LIB_PRINT_BARE_VALUE" => 21,
+ "NETSNMP_DS_LIB_EXTENDED_INDEX" => 22,
+ "NETSNMP_DS_LIB_PRINT_HEX_TEXT" => 23,
+ "NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID" => 24,
+ "NETSNMP_DS_LIB_READ_UCD_STYLE_OID" => 25,
+ "NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG" => 26,
+ "NETSNMP_DS_LIB_HAVE_READ_CONFIG" => 27,
+ "NETSNMP_DS_LIB_QUICKE_PRINT" => 28,
+ "NETSNMP_DS_LIB_DONT_PRINT_UNITS" => 29,
+ "NETSNMP_DS_LIB_NO_DISPLAY_HINT" => 30,
+ "NETSNMP_DS_LIB_16BIT_IDS" => 31,
+ "NETSNMP_DS_LIB_DONT_PERSIST_STATE" => 32,
+ "NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT" => 33,
+ "NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY" => 34,
+ "NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD" => 35,
+ "NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE" => 36,
+ "NETSNMP_DS_LIB_APPEND_LOGFILES" => 37,
+ "NETSNMP_DS_LIB_MIB_WARNINGS" => 0,
+ "NETSNMP_DS_LIB_SECLEVEL" => 1,
+ "NETSNMP_DS_LIB_SNMPVERSION" => 2,
+ "NETSNMP_DS_LIB_DEFAULT_PORT" => 3,
+ "NETSNMP_DS_LIB_OID_OUTPUT_FORMAT" => 4,
+ "NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT" => 5,
+ "NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH" => 6,
+ "NETSNMP_DS_LIB_SERVERSENDBUF" => 7,
+ "NETSNMP_DS_LIB_SERVERRECVBUF" => 8,
+ "NETSNMP_DS_LIB_CLIENTSENDBUF" => 9,
+ "NETSNMP_DS_LIB_CLIENTRECVBUF" => 10,
+ "NETSNMP_DS_SNMP_VERSION_1" => 128,
+ "NETSNMP_DS_SNMP_VERSION_2c" => 1,
+ "NETSNMP_DS_SNMP_VERSION_3" => 3,
+ "NETSNMP_DS_LIB_SECNAME" => 0,
+ "NETSNMP_DS_LIB_CONTEXT" => 1,
+ "NETSNMP_DS_LIB_PASSPHRASE" => 2,
+ "NETSNMP_DS_LIB_AUTHPASSPHRASE" => 3,
+ "NETSNMP_DS_LIB_PRIVPASSPHRASE" => 4,
+ "NETSNMP_DS_LIB_OPTIONALCONFIG" => 5,
+ "NETSNMP_DS_LIB_APPTYPE" => 6,
+ "NETSNMP_DS_LIB_COMMUNITY" => 7,
+ "NETSNMP_DS_LIB_PERSISTENT_DIR" => 8,
+ "NETSNMP_DS_LIB_CONFIGURATION_DIR" => 9,
+ "NETSNMP_DS_LIB_SECMODEL" => 10,
+ "NETSNMP_DS_LIB_MIBDIRS" => 11,
+ "NETSNMP_DS_LIB_OIDSUFFIX" => 12,
+ "NETSNMP_DS_LIB_OIDPREFIX" => 13,
+ "NETSNMP_DS_LIB_CLIENT_ADDR" => 14,
+ "NETSNMP_DS_LIB_TEMP_FILE_PATTERN" => 15,
+ "NETSNMP_DS_LIB_AUTHMASTERKEY" => 16,
+ "NETSNMP_DS_LIB_PRIVMASTERKEY" => 17,
+ "NETSNMP_DS_LIB_AUTHLOCALIZEDKEY" => 18,
+ "NETSNMP_DS_LIB_PRIVLOCALIZEDKEY" => 19,
+ "NETSNMP_DS_LIB_APPTYPES" => 20,
+ "NETSNMP_DS_LIB_KSM_KEYTAB" => 21,
+ "NETSNMP_DS_LIB_KSM_SERVICE_NAME" => 22,
+ );
+
+ print "1.." . (scalar(keys(%tests)) + 10) . "\n";
+ }
+END {print "not ok 1\n" unless $loaded;}
+use NetSNMP::default_store (':all');
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
+print ((netsnmp_ds_set_string(1, 1, "hi there") == 0) ? "ok 2\n" : "not ok 2\n");
+print ((netsnmp_ds_get_string(1, 1) eq "hi there") ? "ok 3\n" : "not ok 3\n");
+print ((netsnmp_ds_set_int(1, 1, 42) == 0) ? "ok 4\n" : "not ok 4\n");
+print ((netsnmp_ds_get_int(1, 1) == 42) ? "ok 5\n" : "not ok 5\n");
+print ((netsnmp_ds_get_int(1, 2) == 0) ? "ok 6\n" : "not ok 6\n");
+print ((NETSNMP_DS_LIB_REGEX_ACCESS == 15) ? "ok 7\n" : "not ok 7\n");
+print ((netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID, 1) == 42) ? "ok 8\n" : "not ok 8\n");
+print ((netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, DS_LIB_DEFAULT_PORT, 9161) == 0) ? "ok 9\n" : "not ok 9\n");
+print ((netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, DS_LIB_DEFAULT_PORT) == 9161) ? "ok 10\n" : "not ok 10\n");
+
+$c = 10;
+foreach my $i (keys(%tests)) {
+ my $str = "NetSNMP::default_store::$i";
+ my $val = eval $str;
+# print "$i -> $val -> $tests{$i}\n";
+ $c++;
+ print (($val eq $tests{$i})?"ok $c\n" : "not ok $c\n# error: name=$i value_expected=$tests{$i} value_got=$val \n");
+}
diff --git a/perl/default_store/typemap b/perl/default_store/typemap
new file mode 100644
index 0000000..0422417
--- /dev/null
+++ b/perl/default_store/typemap
@@ -0,0 +1 @@
+const char * T_PV
diff --git a/perl/make-perl-makefiles b/perl/make-perl-makefiles
new file mode 100644
index 0000000..8a96487
--- /dev/null
+++ b/perl/make-perl-makefiles
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+
+open(I, "Makefile.subs.pl");
+@stuff = <I>;
+
+foreach my $i (@ARGV) {
+ print "updating $i\n";
+ open(I, $i);
+ open(O,">$i.new");
+ while(<I>) {
+ # start replacement here
+ last if /common subroutines -- DO NOT EDIT/;
+ print O;
+ }
+ print O "# common subroutines -- DO NOT EDIT.\n";
+ print O "# They are imported from the Makefile.subs.pl file\n";
+ print O @stuff;
+ close(I);
+ close(O);
+ rename($i,"$i.bak");
+ rename("$i.new", "$i");
+}
diff --git a/perl/manager/INSTALL b/perl/manager/INSTALL
new file mode 100644
index 0000000..27d7436
--- /dev/null
+++ b/perl/manager/INSTALL
@@ -0,0 +1,198 @@
+REQUIREMENTS
+
+ A knowledgeable user. This system is *not* entirely user friendly
+ yet. You have been warned. Use at your own risk. yada yada yada.
+
+ Get and install:
+
+ the mysql (http://www.mysql.com) database
+ it may work with other databases, but I haven't tried.
+
+ Apache (http://www.apache.org)
+
+ The following perl modules (http://www.cpan.org):
+ mod_perl
+ SNMP (from the net-snmp source tree: SRCTREE/perl/SNMP)
+ CGI
+ DBI
+ DBD::mSQL
+ GD::Graph
+
+ You may need more modules depending on your perl version, so sorry
+ in advance if I missed some.
+
+ Building and setting up mysql (a summary of what is needed. See the
+ mysql documentation for further details):
+ ./configure
+ make
+ make install
+ scripts/mysql_install_db
+
+ start it by running 'safe_mysqld'.
+ To run the sql commands listed in the following text, run
+ 'mysql'.
+
+SQL REQUIREMENTS
+
+ The scripts used by this project automatically create, edit, delete,
+ insert, update, etc everything necessary. Because of this, you'll
+ need to set up a SQL user with the ability to modify the heck out of
+ a database called "snmp" on your mysql server. We'll call this user
+ SQLUSER below, and its password SQLPASSWORD. Replace these with
+ your appropriate information anytime you see them listed below.
+
+INSTALLING THE PERL MODULES
+
+ perl Makefile.PL
+ make
+ make install
+
+ Copy the red.gif, and green.gif graphics files to your apache
+ HTML-ROOT/graphics/.
+
+SETTING UP APACHE
+
+ (assumes you have mod_perl installed properly from above)
+
+ Idealy, it should be put behind a user/password database in your web
+ server (something that sets the REMOTE_USER environmental for CGI
+ scripts). This will greatly enhance its operation so that different
+ users can be users of different groups of hosts, etc... If this is
+ not done, everyone will use the user name "guest".
+
+ At the bottom of your httpd.conf file or in an apporpriate
+ VirtualHost directive put the following lines, appropriately
+ configuring the sql username, etc. I strongly recommend turning on
+ SSL support for this as well.:
+
+ PerlModule netsnmp::manager
+ <Location /manage>
+ # put apache protection stuff here, like a password database etc!!!
+ SetHandler perl-script
+ PerlHandler ucdsnmp::manager
+ PerlSetVar hostname SQLHOST
+ PerlSetVar dbname snmp
+ PerlSetVar user SQLUSER
+ PerlSetVar pass SQLPASSWORD
+
+ # turn on password protection. see apache htpasswd documentation.
+ # comment these out for unauthenticated access (generally a bad idea)
+ AuthType Basic
+ AuthName "SNMP manager access"
+ AuthUserFile /etc/httpd/conf/manager-passwd
+ require valid-user
+
+ </Location>
+
+ Restart apache after you've done the above.
+
+SETTING UP THE MYSQL UCD-SNMP DATABASES
+
+ Use the following perl script to set up the mysql database tables
+ required:
+
+ ./setupdb -u SQLUSER -p SQLPASSWORD -h SQLHOST
+
+ To display what this will do before you run it:
+
+ ./setupdb -v -n
+
+SETTING UP USERS OF THE SYSTEM
+
+ Now you need to add yourself as a user. You'll want to use a
+ username that you configured for your apache password file (or
+ whatever), or the user "guest" if you didn't configure apache for
+ authenticated access. The -a in this case grants "administrative"
+ rights to the group of hosts, and thus allows the user to add new
+ hosts to the group, delete hosts, etc. Non-administrative users are
+ mostly "read-only" type users.
+
+ The interface groups hosts together in "groups", and you put users
+ in these groups to assign responsiblity for them. Groups are
+ created when a user gets assigned to one, so just pick a groupname
+ for now and use it below. Maybe later you can add yourself to a new
+ group using a similar command, and the web interface will change to
+ reflect that you are now in more than one group. Use the same group
+ name for multiple users that all belong to a single "group".
+
+ If you add an email address to the argument list the system will
+ mail that user every time it finds a problem or finds a problem that
+ has been fixed.
+
+ *** DO NOT PICK A GROUP WITH THE NAME "default" ***
+
+ ./setupuser -u SQLUSER -p SQLPASSWORD -h SQLHOST -a GROUPNAME USERNAME [EMAILADDRESS]
+
+SETTING UP SNMP AUTHORIZATION INFORMATION
+
+ Now, you need to add in your default authorization information for
+ how to make SNMP requests to your host. The parameter names you can
+ pick come straight from the SNMP perl module, so see "perldoc SNMP"
+ for all the parameter names you can pick from.
+
+ Examples:
+
+ ./setupauth -u SQLUSER -p SQLPASSWORD -h SQLHOST Version 1 Community public
+ ./setupauth -u SQLUSER -p SQLPASSWORD -h SQLHOST Version 3 SecName 'v3user' AuthPass 'myv3passphrase' SecLevel authNoPriv
+
+ I also recommend adding a large default timeout (30 secs):
+
+ ./setupauth -u SQLUSER -p SQLPASSWORD -h SQLHOST Timeout 30000000
+
+ If you want different parameters for a group, it'll inherit
+ everything from the default parameters specified above plus any more
+ that you set or override:
+
+ ./setupauth -u SQLUSER -p SQLPASSWORD -h SQLHOST -g agroup Community private
+
+ Further, hosts can be given specific parameters as well if they're
+ really special:
+
+ ./setupauth -u SQLUSER -p SQLPASSWORD -h SQLHOST -m host Timeout 60000000
+
+COLLECTING THE DATA
+
+ The command you need to run to collect data is snmptosql, which will
+ use the information defined above to fill your data base with all
+ sorts of useful information that you've asked it to collect.
+ Something like:
+
+ snmptosql -H SQLHOST -u SQLUSER -p SQLPASSWORD
+
+ should be put in cron to update a regular intervals. I run mine
+ every 10 minutes. Note that it will *not* scale to a large number
+ of hosts easily at the moment. Start with no more than 20 or so to
+ begin with.
+
+USING THE SYSTEM
+
+ Most of the things you'll need to do can be done from the web
+ interface that you've just set up as /manager on some system in the
+ step above. Go to this web page to see what you can do.
+
+MONITORING HOSTS WITH IT (finally)
+
+ It's *not* entirely intuitive yet. So, lets give you an example. In
+ your snmpd.conf file, put a line that says "proc sendmail". This will
+ check to see if sendmail is running on your system. Also put "disk /
+ 10%" which will require the disk has at least 10% of free space.
+ Restart the snmpd (or kill -HUP). See the snmpd.conf manual page
+ for some details.
+
+ Then, go to the above URL and click on the group name you want to
+ add a host to and enter the host name in the dialog box near the
+ bottom of the page (assuming you're logged in as an administrator
+ user setup using the -a flag to setupuser above). Click on the
+ "setup group XXX" link at the bottom of the group's page and click
+ on all the check buttons (you can turn them all on even if you're
+ not really using them all) and hit the submit button.
+
+ Come back 10 minutes later, reload the group and click on the host
+ name. You should see pretty red/green lights if there is or isn't a
+ problem. It'll show you a few tables with the various bits of data
+ it collected (including how many sendmail processes are running, an
+ how much disk space is actually being used), etc.
+
+GRAPHING
+
+ To be written.
diff --git a/perl/manager/Makefile.PL b/perl/manager/Makefile.PL
new file mode 100644
index 0000000..633243d
--- /dev/null
+++ b/perl/manager/Makefile.PL
@@ -0,0 +1,16 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'NetSNMP::manager',
+ 'VERSION' => '', # finds $VERSION
+ 'PREREQ_PM' => {# SNMP => 4.0,
+ DBI => 0,
+ CGI => 0}, # e.g., Module::Name => 1.1
+ 'PM' => {
+ 'displaytable.pm' => '$(INST_LIBDIR)/../displaytable.pm',
+ 'getValues.pm' => '$(INST_LIBDIR)/../getValues.pm',
+ 'manager.pm' => '$(INST_LIBDIR)/manager.pm'
+ },
+ 'EXE_FILES' => [qw(snmptosql setupdb setupuser setupauth)]
+);
diff --git a/perl/manager/displaytable.pm b/perl/manager/displaytable.pm
new file mode 100644
index 0000000..1eceacd
--- /dev/null
+++ b/perl/manager/displaytable.pm
@@ -0,0 +1,628 @@
+# displaytable(TABLENAME, CONFIG...):
+#
+# stolen from sqltohtml in the ucd-snmp package
+#
+
+package NetSNMP::manager::displaytable;
+use POSIX (isprint);
+
+BEGIN {
+ use Exporter ();
+ use vars qw(@ISA @EXPORT_OK $tableparms $headerparms);
+ @ISA = qw(Exporter);
+ @EXPORT=qw(&displaytable &displaygraph);
+
+ require DBI;
+ require CGI;
+
+ use GD::Graph();
+ use GD::Graph::lines();
+ use GD::Graph::bars();
+ use GD::Graph::points();
+ use GD::Graph::linespoints();
+ use GD::Graph::area();
+ use GD::Graph::pie();
+};
+
+$tableparms="border=1 bgcolor=\"#c0c0e0\"";
+$headerparms="border=1 bgcolor=\"#b0e0b0\"";
+
+sub displaygraph {
+ my $dbh = shift;
+ my $tablename = shift;
+ my %config = @_;
+ my $type = $config{'-type'} || "lines";
+ my $x = $config{'-x'} || "640";
+ my $y = $config{'-y'} || "480";
+ my $bgcolor = $config{'-bgcolor'} || "white";
+ my $datecol = $config{'-xcol'} || "updated";
+ my $xtickevery = $config{'-xtickevery'} || 50;
+ my ($thetable);
+
+# print STDERR join(",",@_),"\n";
+
+ return -1 if (!defined($dbh) || !defined($tablename) ||
+ !defined ($config{'-columns'}) ||
+ ref($config{'-columns'}) ne "ARRAY" ||
+ !defined ($config{'-indexes'}) ||
+ ref($config{'-indexes'}) ne "ARRAY");
+
+
+ my $cmd = "SELECT " .
+ join(",",@{$config{'-columns'}},
+ @{$config{'-indexes'}}, $datecol) .
+ " FROM $tablename $config{'-clauses'}";
+ ( $thetable = $dbh->prepare($cmd))
+ or return -1;
+ ( $thetable->execute )
+ or return -1;
+
+ my %data;
+ my $count = 0;
+
+ while( $row = $thetable->fetchrow_hashref() ) {
+ # XXX: multiple indexe columns -> unique name
+ # save all the row's data based on the index column(s)
+ foreach my $j (@{$config{'-columns'}}) {
+ if ($config{'-difference'} || $config{'-rate'}) {
+ if (defined($lastval{$row->{$config{'-indexes'}[0]}}{$j}{'value'})) {
+ $data{$row->{$config{'-indexes'}[0]}}{$row->{$datecol}}{$j}=
+ $row->{$j} -
+ $lastval{$row->{$config{'-indexes'}[0]}}{$j}{'value'};
+ #
+ # convert to a rate if desired.
+ #
+ if ($config{'-rate'}) {
+ if (($row->{$datecol} - $lastval{$row->{$config{'-indexes'}[0]}}{$j}{'index'})) {
+ $data{$row->{$config{'-indexes'}[0]}}{$row->{$datecol}}{$j} = $data{$row->{$config{'-indexes'}[0]}}{$row->{$datecol}}{$j}*$config{'-rate'}/($row->{$datecol} - $lastval{$row->{$config{'-indexes'}[0]}}{$j}{'index'});
+ } else {
+ $data{$row->{$config{'-indexes'}[0]}}{$row->{$datecol}}{$j} = -1;
+ }
+ }
+
+ }
+ $lastval{$row->{$config{'-indexes'}[0]}}{$j}{'value'} = $row->{$j};
+ $lastval{$row->{$config{'-indexes'}[0]}}{$j}{'index'} = $row->{$datecol};
+ } else {
+ $data{$row->{$config{'-indexes'}[0]}}{$row->{$datecol}}{$j} = $row->{$j};
+ }
+
+ #
+ # limit the data to a vertical range.
+ #
+ if (defined($config{'-max'}) &&
+ $data{$row->{$config{'-indexes'}[0]}}{$row->{$datecol}}{$j} >
+ $config{'-max'}) {
+ # set to max value
+ $data{$row->{$config{'-indexes'}[0]}}{$row->{$datecol}}{$j} =
+ $config{'-max'};
+ }
+
+ if (defined($config{'-min'}) &&
+ $data{$row->{$config{'-indexes'}[0]}}{$row->{$datecol}}{$j} <
+ $config{'-min'}) {
+ # set to min value
+ $data{$row->{$config{'-indexes'}[0]}}{$row->{$datecol}}{$j} =
+ $config{'-min'};
+ }
+ }
+ push @xdata,$row->{$datecol};
+ }
+
+ my @pngdata;
+
+ if (defined($config{'-createdata'})) {
+ &{$config{'-createdata'}}(\@pngdata, \@xdata, \%data);
+ } else {
+ push @pngdata, \@xdata;
+
+ my @datakeys = keys(%data);
+
+# open(O,">/tmp/data");
+ foreach my $i (@datakeys) {
+ foreach my $j (@{$config{'-columns'}}) {
+ my @newrow;
+ foreach my $k (@xdata) {
+# print O "i=$i k=$k j=$j :: $data{$i}{$k}{$j}\n";
+ push @newrow, ($data{$i}{$k}{$j} || 0);
+ }
+ push @pngdata,\@newrow;
+ }
+ }
+ }
+# close O;
+
+ if ($#pngdata > 0) {
+ # create the graph itself
+ my $graph = new GD::Graph::lines($x, $y);
+ $graph->set('bgclr' => $bgcolor);
+# print STDERR "columns: ", join(",",@{$config{'-columns'}}), "\n";
+ if (defined($config{'-legend'})) {
+# print STDERR "legend: ", join(",",@{$config{'-legend'}}), "\n";
+ $graph->set_legend(@{$config{'-legend'}});
+ } else {
+ my @legend;
+ foreach my $xxx (@{$config{'-columns'}}) {
+ push @legend, "$xxx = $config{'-indexes'}[0]";
+ }
+ $graph->set_legend(@legend);
+ }
+ foreach my $i (qw(title x_label_skip x_labels_vertical x_tick_number x_number_format y_number_format x_min_value x_max_value y_min_value y_max_value)) {
+# print STDERR "setting $i from -$i = " . $config{"-$i"} . "\n";
+ $graph->set("$i" => $config{"-$i"}) if ($config{"-$i"});
+ }
+ if ($config{'-pngparms'}) {
+ $graph->set(@{$config{'-pngparms'}});
+ }
+ print $graph->plot(\@pngdata);
+ return $#{$pngdata[0]};
+ }
+ return -1;
+}
+
+sub displaytable {
+ my $dbh = shift;
+ my $tablename = shift;
+ my %config = @_;
+ my $clauses = $config{'-clauses'};
+ my $dolink = $config{'-dolink'};
+ my $datalink = $config{'-datalink'};
+ my $beginhook = $config{'-beginhook'};
+ my $modifiedhook = $config{'-modifiedhook'};
+ my $endhook = $config{'-endhook'};
+ my $selectwhat = $config{'-select'};
+# my $printonly = $config{'-printonly'};
+ $selectwhat = "*" if (!defined($selectwhat));
+ my $tableparms = $config{'-tableparms'} || $displaytable::tableparms;
+ my $headerparms = $config{'-headerparms'} || $displaytable::headerparms;
+ my ($thetable, $data, $ref, $prefs, $xlattable);
+
+ if ($config{'-dontdisplaycol'}) {
+ ($prefs = $dbh->prepare($config{'-dontdisplaycol'}) )
+ or die "\nnot ok: $DBI::errstr\n";
+ }
+
+ # get a list of data from the table we want to display
+ ( $thetable = $dbh->prepare("SELECT $selectwhat FROM $tablename $clauses"))
+ or return -1;
+ ( $thetable->execute )
+ or return -1;
+
+ # get a list of data from the table we want to display
+ if ($config{'-xlat'}) {
+ ( $xlattable =
+ $dbh->prepare("SELECT newname FROM $config{'-xlat'} where oldname = ?"))
+ or die "\nnot ok: $DBI::errstr\n";
+ }
+
+ # editable/markable setup
+ my $edited = 0;
+ my $editable = 0;
+ my $markable = 0;
+ my (@indexkeys, @valuekeys, $uph, %indexhash, $q);
+ if (defined($config{'-editable'})) {
+ $editable = 1;
+ }
+
+ if (defined($config{'-mark'}) || defined($config{'-onmarked'})) {
+ $markable = 1;
+ }
+
+ if (defined($config{'-CGI'}) && ref($config{'-CGI'}) eq "CGI") {
+ $q = $config{'-CGI'};
+ }
+
+ if (($editable || $markable)) {
+ if (ref($config{'-indexes'}) eq ARRAY && defined($q)) {
+ @indexkeys = @{$config{'-indexes'}};
+ foreach my $kk (@indexkeys) {
+ $indexhash{$kk} = 1;
+ }
+ } else {
+ $editable = $markable = 0;
+ print STDERR "displaytable error: no -indexes option specified or -CGI not specified\n";
+ }
+ }
+
+ if (($editable || $markable) &&
+ $q->param('edited_' . toalpha($tablename))) {
+ $edited = 1;
+ }
+
+ # table header
+ my $doheader = 1;
+ my @keys;
+ my $rowcount = 0;
+ $thetable->execute();
+ if ($editable || $markable) {
+ print "<input type=hidden name=\"edited_" . toalpha($tablename) . "\" value=1>\n";
+ }
+
+ while( $data = $thetable->fetchrow_hashref() ) {
+ $rowcount++;
+ if ($edited && $editable && !defined($uph)) {
+ foreach my $kk (keys(%$data)) {
+ push (@valuekeys, maybe_from_hex($kk)) if (!defined($indexhash{$kk}));
+ }
+ my $cmd = "update $tablename set " .
+ join(" = ?, ",@valuekeys) .
+ " = ? where " .
+ join(" = ? and ",@indexkeys) .
+ " = ?";
+ $uph = $dbh->prepare($cmd);
+# print STDERR "setting up: $cmd<br>\n";
+ }
+ if ($doheader) {
+ if ($config{'-selectorder'} &&
+ ref($config{'-selectorder'}) eq "ARRAY") {
+ @keys = @{$config{'-selectorder'}};
+ } elsif ($config{'-selectorder'}) {
+ $_ = $selectwhat;
+ @keys = split(/, */);
+ } else {
+ @keys = (sort keys(%$data));
+ }
+ if (defined($config{'-title'})) {
+ print "<br><b>$config{'-title'}</b>\n";
+ } elsif (!defined($config{'-notitle'})) {
+ print "<br><b>";
+ print "<a href=\"$ref\">" if (defined($dolink) &&
+ defined($ref = &$dolink($tablename)));
+ if ($config{'-xlat'}) {
+ my $toval = $xlattable->execute($tablename);
+ if ($toval > 0) {
+ print $xlattable->fetchrow_array;
+ } else {
+ print "$tablename";
+ }
+ } else {
+ print "$tablename";
+ }
+ print "</a>" if (defined($ref));
+ print "</b>\n";
+ }
+ print "<br>\n";
+ print "<table $tableparms>\n";
+ if (!$config{'-noheaders'}) {
+ print "<tr $headerparms>";
+ }
+ if (defined($beginhook)) {
+ &$beginhook($dbh, $tablename);
+ }
+ if (!$config{'-noheaders'}) {
+ if ($markable) {
+ my $ukey = to_unique_key($key, $data, @indexkeys);
+ print "<td>Mark</td>\n";
+ }
+ foreach $l (@keys) {
+ if (!defined($prefs) ||
+ $prefs->execute($tablename, $l) eq "0E0") {
+ print "<th>";
+ print "<a href=\"$ref\">" if (defined($dolink) &&
+ defined($ref = &$dolink($l)));
+ if ($config{'-xlat'}) {
+ my $toval = $xlattable->execute($l);
+ if ($toval > 0) {
+ print $xlattable->fetchrow_array;
+ } else {
+ print "$l";
+ }
+ } else {
+ print "$l";
+ }
+ print "</a>" if (defined($ref));
+ print "</th>";
+ }
+ }
+ }
+ if (defined($endhook)) {
+ &$endhook($dbh, $tablename);
+ }
+ if (!$config{'-noheaders'}) {
+ print "</tr>\n";
+ }
+ $doheader = 0;
+ }
+
+ print "<tr>";
+ if (defined($beginhook)) {
+ &$beginhook($dbh, $tablename, $data);
+ }
+ if ($edited && $editable) {
+ my @indexvalues = getvalues($data, @indexkeys);
+ if ($modifiedhook) {
+ foreach my $valkey (@valuekeys) {
+ my ($value) = getquery($q, $data, \@indexkeys, $valkey);
+ if ($value ne $data->{$valkey}) {
+ &$modifiedhook($dbh, $tablename, $valkey,
+ $data, @indexvalues);
+ }
+ }
+ }
+
+ my $ret = $uph->execute(getquery($q, $data, \@indexkeys, @valuekeys),
+ @indexvalues);
+ foreach my $x (@indexkeys) {
+ next if (defined($indexhash{$x}));
+ $data->{$x} = $q->param(to_unique_key($x, $data, @indexkeys));
+ }
+# print "ret: $ret, $DBI::errstr<br>\n";
+ }
+ if ($markable) {
+ my $ukey = to_unique_key("mark", $data, @indexkeys);
+ print "<td><input type=checkbox value=Y name=\"$ukey\"" .
+ (($q->param($ukey) eq "Y") ? " checked" : "") . "></td>\n";
+ if ($q->param($ukey) eq "Y" && $config{'-onmarked'}) {
+ &{$config{'-onmarked'}}($dbh, $tablename, $data);
+ }
+ }
+
+ foreach $key (@keys) {
+ if (!defined($prefs) ||
+ $prefs->execute($tablename, $key) eq "0E0") {
+ print "<td>";
+ print "<a href=\"$ref\">" if (defined($datalink) &&
+ defined($ref = &$datalink($key, $data->{$key})));
+ if ($editable && !defined($indexhash{$key})) {
+ my $ukey = to_unique_key($key, $data, @indexkeys);
+ my $sz;
+ if ($config{'-sizehash'}) {
+ $sz = "size=" . $config{'-sizehash'}{$key};
+ }
+ if (!$sz && $config{'-inputsize'}) {
+ $sz = "size=" . $config{'-inputsize'};
+ }
+ print STDERR "size $key: $sz from $config{'-sizehash'}{$key} / $config{'-inputsize'}\n";
+ print "<input type=text name=\"$ukey\" value=\"" .
+ maybe_to_hex($data->{$key}) . "\" $sz>";
+ } else {
+ if ($config{'-printer'}) {
+ &{$config{'-printer'}}($key, $data->{$key}, $data);
+ } elsif ($data->{$key} ne "") {
+ print $data->{$key};
+ } else {
+ print "&nbsp";
+ }
+ }
+ print "</a>" if (defined($ref));
+ print "</td>";
+ }
+ }
+
+ if (defined($endhook)) {
+ &$endhook($dbh, $tablename, $data);
+ }
+ print "</tr>\n";
+ last if (defined($config{'-maxrows'}) &&
+ $rowcount >= $config{'-maxrows'});
+ }
+ if ($rowcount > 0) {
+ print "</table>\n";
+ }
+ return $rowcount;
+}
+
+sub to_unique_key {
+ my $ret = shift;
+ $ret .= "_";
+ my $data = shift;
+ if (!defined($data)) {
+ $ret .= join("_",@_);
+ } else {
+ foreach my $i (@_) {
+ $ret .= "_" . $data->{$i};
+ }
+ }
+ return toalpha($ret);
+}
+
+sub toalpha {
+ my $ret = join("",@_);
+ $ret =~ s/([^A-Za-z0-9_])/ord($1)/eg;
+ return $ret;
+}
+
+sub getvalues {
+ my $hash = shift;
+ my @ret;
+ foreach my $i (@_) {
+ push @ret, maybe_from_hex($hash->{$i});
+ }
+ return @ret;
+}
+
+sub getquery {
+ my $q = shift;
+ my $data = shift;
+ my $keys = shift;
+ my @ret;
+ foreach my $i (@_) {
+ push @ret, maybe_from_hex($q->param(to_unique_key($i, $data, @$keys)));
+ }
+ return @ret;
+}
+
+sub maybe_to_hex {
+ my $str = shift;
+ if (!isprint($str)) {
+ $str = "0x" . (unpack("H*", $str))[0];
+ }
+ $str =~ s/\"/&quot;/g;
+ return $str;
+}
+
+sub maybe_from_hex {
+ my $str = shift;
+ if (substr($str,0,2) eq "0x") {
+ ($str) = pack("H*", substr($str,2));
+ }
+ return $str;
+}
+
+1;
+__END__
+
+=head1 NAME
+
+SNMP - The Perl5 'SNMP' Extension Module v3.1.0 for the UCD SNMPv3 Library
+
+=head1 SYNOPSIS
+
+ use DBI;
+ use displaytable;
+
+ $dbh = DBI->connect(...);
+ $numshown = displaytable($dbh, 'tablename', [options]);
+
+=head1 DESCRIPTION
+
+The displaytable and displaygraph functions format the output of a DBI
+database query into an html or graph output.
+
+=head1 DISPLAYTABLE OPTIONS
+
+=over 4
+
+=item -select => VALUE
+
+Selects a set of columns, or functions to be displayed in the resulting table.
+
+Example: -select => 'column1, column2'
+
+Default: *
+
+=item -title => VALUE
+
+Use VALUE as the title of the table.
+
+=item -notitle => 1
+
+Don't print a title for the table.
+
+=item -noheaders => 1
+
+Don't print a header row at the top of the table.
+
+=item -selectorder => 1
+
+=item -selectorder => [qw(column1 column2)]
+
+Defines the order of the columns. A value of 1 will use the order of
+the -select statement by textually parsing it's comma seperated list.
+If an array is passed containing the column names, that order will be
+used.
+
+Example:
+
+ -select => distinct(column1) as foo, -selectorder => [qw(foo)]
+
+=item -maxrows => NUM
+
+Limits the number of display lines to NUM.
+
+=item -tableparms => PARAMS
+
+=item -headerparms => PARAMS
+
+The parameters to be used for formating the table contents and the
+header contents.
+
+Defaults:
+
+ -tableparms => "border=1 bgcolor='#c0c0e0'"
+
+ -headerparms => "border=1 bgcolor='#b0e0b0'"
+
+=item -dolink => \&FUNC
+
+If passed, FUNC(name) will be called on the tablename or header. The
+function should return a web url that the header/table name should be
+linked to.
+
+=item -datalink => \&FUNC
+
+Identical to -dolink, but called for the data portion of the table.
+Arguments are the column name and the data element for that column.
+
+=item -printer => \&FUNC
+
+Calls FUNC(COLUMNNAME, COLUMNDATA, DATA) to print the data from each
+column. COLUMNDATA is the data itself, and DATA is a reference to the
+hash for the entire row (IE, COLUMNDATA = $DATA->{$COLUMNNAME}).
+
+=item -beginhook => \&FUNC
+
+=item -endhook => \&FUNC
+
+displaytable will call these functions at the beginning and end of the
+printing of a row. Useful for inserting new columns at the beginning
+or end of the table. When the headers to the table are being printed,
+they will be called like FUNC($dbh, TABLENAME). When the data is
+being printed, they will be called like FUNC($dbh, TABLENAME, DATA),
+which DATA is a reference to the hash containing the row data.
+
+Example:
+
+ -endhook => sub {
+ my ($d, $t, $data) = @_;
+ if (defined($data)) {
+ print "<td>",(100 * $data->{'column1'} / $data->{'column2'}),"</td>";
+ } else {
+ print "<td>Percentage</td>";
+ }
+ }
+
+=item -clauses => sql_clauses
+
+Adds clauses to the sql expression.
+
+Example: -clauses => "where column1 = 'value' limit 10 order by column2"
+
+=item -xlat => xlattable
+
+Translates column headers and the table name by looking in a table for
+the appropriate translation. Essentially uses:
+
+ SELECT newname FROM xlattable where oldname = ?
+
+to translate everything.
+
+=item -editable => 1
+
+=item -indexes => [qw(INDEX_COLUMNS)]
+
+=item -CGI => CGI_REFERENCE
+
+If both of these are passed as arguments, the table is printed in
+editable format. The INDEX_COLUMNS should be a list of columns that
+can be used to uniquely identify a row. They will be the non-editable
+columns shown in the table. Everything else will be editable. The
+form and the submit button written by the rest of the script must loop
+back to the same displaytable clause for the edits to be committed to
+the database. CGI_REFERENCE should be a reference to the CGI object
+used to query web parameters from ($CGI_REFERENCE = new CGI);
+
+=item -mark => 1
+
+=item -indexes => [qw(INDEX_COLUMNS)]
+
+=item -CGI => CGI_REFERENCE
+
+=item -onmarked => \&FUNC
+
+When the first three of these are specified, the left hand most column
+will be a check box that allows users to mark the row for future work.
+
+FUNC($dbh, TABLENAME, DATA) will be called for each marked entry when
+a submission data has been processed. $DATA is a hash reference to
+the rows dataset. See -editable above for more information.
+
+-onmarked => \&FUNC implies -mark => 1.
+
+=back
+
+=head1 Author
+
+wjhardaker@ucdavis.edu
+
+=cut
diff --git a/perl/manager/getValues.pm b/perl/manager/getValues.pm
new file mode 100644
index 0000000..bd0b9a6
--- /dev/null
+++ b/perl/manager/getValues.pm
@@ -0,0 +1,49 @@
+#
+# getValues($dbh,
+# [-varcol => varname,]
+# [-valcol => varval,]
+# [-key => keyname,]
+# tablename => indexname,
+# ...)
+
+package NetSNMP::manager::getValues;
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT_OK=(getValues);
+
+my $varcol = "varcol";
+my $valcol = "valcol";
+my $key = "lookup";
+
+sub getValues {
+ my $dbh = shift;
+ my (@vars2, $tmp, $cursor, $row, %results, $i, $cursor);
+ my ($varcol, $valcol, $key) = ($varcol, $valcol, $key);
+ my @vars = @_;
+ while($#vars >= 0) {
+ $i = shift @vars;
+ $tmp = shift @vars;
+ if ($i =~ /^-/) {
+ $varcol = $tmp if ($i =~ /-varcol/);
+ $valcol = $tmp if ($i =~ /-valcol/);
+ $key = $tmp if ($i =~ /-key/);
+ } else {
+ push(@vars2,$i,$tmp);
+ }
+ }
+ while($#vars2 >= 0) {
+ $i = shift @vars2;
+ $tmp = shift @vars2;
+# print "select $varcol,$valcol from $i where $key = '$tmp'\n";
+ ($cursor =
+ $dbh->prepare("select $varcol,$valcol from $i where $key = '$tmp'"))
+ or die "\nnot ok: $DBI::errstr\n";
+ ($cursor->execute)
+ or die "\nnot ok: $DBI::errstr\n";
+ while ( $row = $cursor->fetchrow_hashref ) {
+ $results{$row->{$varcol}} = $row->{$valcol};
+ }
+ }
+ return %results;
+}
+1;
diff --git a/perl/manager/green.gif b/perl/manager/green.gif
new file mode 100644
index 0000000..b63716d
--- /dev/null
+++ b/perl/manager/green.gif
Binary files differ
diff --git a/perl/manager/manager.pm b/perl/manager/manager.pm
new file mode 100644
index 0000000..0450625
--- /dev/null
+++ b/perl/manager/manager.pm
@@ -0,0 +1,1051 @@
+package NetSNMP::manager;
+
+use strict ();
+use warnings;
+use Apache::Constants qw(:common);
+use CGI qw(:standard delete_all);
+use SNMP ();
+use DBI ();
+use NetSNMP::manager::displaytable qw(displaytable displaygraph);
+
+# globals
+$NetSNMP::manager::hostname = 'localhost'; # Host that serves the mSQL Database
+$NetSNMP::manager::dbname = 'snmp'; # mySQL Database name
+$NetSNMP::manager::user = 'root';
+# $NetSNMP::manager::pass = "password";
+$NetSNMP::manager::imagebase = "/home/hardaker/src/snmp/manager"; # <=== CHANGE ME ====
+$NetSNMP::manager::redimage = "/graphics/red.gif";
+$NetSNMP::manager::greenimage = "/graphics/green.gif";
+#$NetSNMP::manager::verbose = 1;
+$NetSNMP::manager::tableparms = "border=1 bgcolor=\"#c0c0e0\"";
+$NetSNMP::manager::headerparms = "border=1 bgcolor=\"#b0e0b0\"";
+
+# init the snmp library
+$SNMP::save_descriptions=1;
+#SNMP::init_mib();
+
+%NetSNMP::manager::myorder = qw(id 0 oidindex 1 host 2 updated 3);
+
+sub handler {
+ my $r = shift;
+ Apache->request($r);
+
+ # get info from handler
+ my $hostname = $r->dir_config('hostname') || $NetSNMP::manager::hostname;
+ my $dbname = $r->dir_config('dbname') || $NetSNMP::manager::dbname;
+ my $sqluser = $r->dir_config('user') || $NetSNMP::manager::user;
+ my $pass = $r->dir_config('pass') || $NetSNMP::manager::pass;
+ my $verbose = $r->dir_config('verbose') || $NetSNMP::manager::verbose;
+
+#===========================================================================
+# Global defines
+#===========================================================================
+
+my ($dbh, $query, $remuser);
+
+$remuser = $ENV{'REMOTE_USER'};
+$remuser = "guest" if (!defined($remuser) || $remuser eq "");
+
+#===========================================================================
+# Connect to the mSQL database with the appropriate driver
+#===========================================================================
+($dbh = DBI->connect("DBI:mysql:database=$dbname;host=$hostname", $sqluser, $pass))
+ or die "\tConnect not ok: $DBI::errstr\n";
+
+#===========================================================================
+# stats Images, for inclusion on another page. (ie, slashdot user box)
+#===========================================================================
+if (my $group = param('groupstat')) {
+ $r->content_type("image/gif");
+ $r->send_http_header();
+ my $cur = getcursor($dbh, "select host from usergroups as ug, hostgroups as hg where ug.groupname = '$group' and hg.groupname = '$group' and user = '$remuser'");
+ while (my $row = $cur->fetchrow_hashref ) {
+ if (checkhost($dbh, $group, $row->{'host'})) {
+ open(I, "$NetSNMP::manager::imagebase$NetSNMP::manager::redimage");
+ while(read(I, $_, 4096)) { print; }
+ close(I);
+ }
+ }
+ open(I, "$NetSNMP::manager::imagebase$NetSNMP::manager::greenimage");
+ while(read(I, $_, 4096)) { print; }
+ close(I);
+ return OK();
+}
+
+
+sub date_format {
+ my $time = shift;
+ my @out = localtime($time);
+ my $ret = $out[4] . "-" . $out[3] . "-" . $out[5] . " " . $out[2] . " " . $out[1];
+# print STDERR "$time: $ret\n";
+ return $ret;
+}
+
+
+#
+# Graphing of historical data
+#
+if ((param('displaygraph') || param('dograph')) && param('table')) {
+ my $host = param('host');
+ my $group = param('group');
+ if (!isuser($dbh, $remuser, $group)) {
+ $r->content_type("image/png");
+ $r->send_http_header();
+ print "Unauthorized access to that group ($group)\n";
+ return Exit($dbh, $group);
+ }
+ my $table = param('table');
+ my @columns;
+
+ if (!param('dograph')) {
+ $r->content_type("text/html");
+ $r->send_http_header();
+ print "<body bgcolor=\"#ffffff\">\n";
+ print "<form>\n";
+ print "<table border=1><tr><td>\n";
+
+ print "<table>\n";
+ print "<tr align=top><th></th><th>Select indexes<br>to graph</th></tr>\n";
+
+ my $handle = getcursor($dbh, "SELECT sql_small_result distinct(oidindex) FROM $table where host = '$host'");
+ my @cols;
+ while ( $row = $handle->fetchrow_hashref ) {
+ print "<tr><td>$row->{oidindex}</td><td><input type=checkbox value=1 name=" . 'graph_' . displaytable::to_unique_key($row->{'oidindex'}) . "></td></tr>\n";
+ }
+ print "</table>\n";
+
+ print "</td><td>\n";
+
+ print "<table>\n";
+ print "<tr align=top><th></th><th>Select Columns<br>to graph</th></tr>\n";
+ my $handle = getcursor($dbh, "SELECT * FROM $table limit 1");
+ my $row = $handle->fetchrow_hashref;
+ map { print "<tr><td>$_</td><td><input type=checkbox value=1 name=column_" . displaytable::to_unique_key($_) . "></td></tr>\n"; } keys(%$row);
+ print "</table>\n";
+
+ print "</td></tr></table>\n";
+
+ print "<br>Graph as a Rate: <input type=checkbox value=1 name=graph_as_rate><br>\n";
+ print "<br>Maximum Y Value: <input type=text value=inf name=max_y><br>\n";
+ print "<br>Minimum Y Value: <input type=text value=-inf name=min_y><br>\n";
+
+ print "<input type=hidden name=table value=\"$table\">\n";
+ print "<input type=hidden name=host value=\"$host\">\n";
+ print "<input type=hidden name=dograph value=1>\n";
+ print "<input type=hidden name=group value=\"$group\">\n";
+ print "<input type=submit name=\"Make Graph\">\n";
+
+ print "</form>\n";
+
+ my $handle = getcursor($dbh, "SELECT distinct(oidindex) FROM $table where host = '$host' order by oidindex");
+ return Exit($dbh, $group);
+ }
+ if (param('graph_all_data')) {
+ $clause = "host = '$host'";
+ } else {
+ my $handle = getcursor($dbh, "SELECT distinct(oidindex) FROM $table where host = '$host'");
+ $clause = "where (";
+ while ( $row = $handle->fetchrow_hashref ) {
+# print STDERR "graph test: " . $row->{'oidindex'} . "=" . "graph_" . displaytable::to_unique_key($row->{'oidindex'}) . "=" . param("graph_" . displaytable::to_unique_key($row->{'oidindex'})) . "\n";
+ if (param("graph_" . displaytable::to_unique_key($row->{'oidindex'}))) {
+ $clause .= " or oidindex = " . $row->{'oidindex'} . "";
+ }
+ }
+
+ my $handle = getcursor($dbh, "SELECT * FROM $table limit 1");
+ my $row = $handle->fetchrow_hashref;
+ map { push @columns, $_ if (param('column_' . displaytable::to_unique_key($_))) } keys(%$row);
+
+ $clause .= ")";
+ $clause =~ s/\( or /\(/;
+ if ($clause =~ /\(\)/ || $#columns == -1) {
+ $r->content_type("text/html");
+ $r->send_http_header();
+ print "<body bgcolor=\"#ffffff\">\n";
+ print "<h1>No Data to Graph</h1>\n";
+ print STDERR "No data to graph: $clause, $#columns\n";
+ return Exit($dbh, "$group");
+ }
+ $clause .= " and host = '$host'";
+ }
+
+# print STDERR "graphing clause: $clause\n";
+
+ # all is ok, display the graph
+
+ $r->content_type("image/png");
+ $r->send_http_header();
+
+ print STDERR "graphing clause: $clause, columns: ", join(", ",@columns), "\n";
+ my @args;
+ push (@args, '-rate', '60') if (param('graph_as_rate'));
+ push (@args, '-max', param('max_y')) if (param('max_y') && param('max_y') =~ /^[-.\d]+$/);
+ push (@args, '-min', param('min_y')) if (param('min_y') && param('min_y') =~ /^[-.\d]+$/);
+
+ my $ret =
+ displaygraph($dbh, $table,
+# '-xcol', "date_format(updated,'%m-%d-%y %h:%i')",
+ '-xcol', "unix_timestamp(updated)",
+ '-pngparms', [
+ 'x_labels_vertical', '1',
+ 'x_tick_number', 6,
+ 'x_number_format', \&date_format,
+ 'y_label', 'Count/Min',
+ 'title', $table,
+# 'y_min_value', 0,
+ ],
+ '-clauses', "$clause order by updated",
+ @args,
+ '-columns', \@columns,
+ '-indexes', ['oidindex']);
+ print STDERR "$ret rows graphed\n";
+ return OK();
+}
+
+#===========================================================================
+# Start HTML.
+#===========================================================================
+$r->content_type("text/html");
+$r->send_http_header();
+print "<body bgcolor=\"#ffffff\">\n";
+print "<h1>UCD-SNMP Management Console</h1>\n";
+print "<hr>\n";
+
+#===========================================================================
+# Display mib related data information
+#===========================================================================
+if (param('displayinfo')) {
+ makemibtable(param('displayinfo'));
+ return Exit($dbh, "");
+}
+
+#===========================================================================
+# Display a generic sql table of any kind (debugging).
+#===========================================================================
+# if (my $disptable = param('displaytable')) {
+# if (param('editable') == 1) {
+# print "<form submit=dont>\n";
+# displaytable($disptable, -editable, 1);
+# print "</form>\n";
+# } else {
+# displaytable($disptable);
+# }
+# return Exit($dbh, "");
+# }
+
+#===========================================================================
+# Get host and group from CGI query.
+#===========================================================================
+my $host = param('host');
+my $group = param('group');
+
+#===========================================================================
+# Editable user information
+#===========================================================================
+
+if (param('setuponcall')) {
+ print "<title>oncall schedule for user: $remuser</title>\n";
+ print "<h2>oncall schedule for user: $remuser</h2>\n";
+ print "<p>Please select your oncall schedule and mailing addresses for your groups below:";
+ if (!isexpert($remuser)) {
+ print "<ul>\n";
+ print "<li>Values for the days/hours fields can be comma seperated lists of hours/days/ranges. EG: hours: 7-18,0-4.\n";
+ print "</ul>\n";
+ }
+ print "<form method=post><input type=hidden name=setuponcall value=1>\n";
+ displaytable($dbh, 'oncall',
+ '-clauses',"where user = '$remuser' order by groupname",
+ '-select','id, user, groupname, email, pager, days, hours',
+ '-selectorder', 1,
+ '-notitle', 1,
+ '-editable', 1,
+ '-indexes', ['id','user','groupname'],
+ '-CGI', $CGI::Q
+ );
+ print "<input type=submit value=\"submit changes\">\n";
+ print "</form>\n";
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# show the list of groups a user belongs to.
+#===========================================================================
+if (!defined($group)) {
+ my @groups = getgroupsforuser($dbh, $remuser);
+ print "<title>Net-SNMP Group List</title>\n";
+ print "<h2>Host groupings you may access:</h2>\n";
+ if (!isexpert($remuser)) {
+ print "<ul>\n";
+ print "<li>Click on a group to operate or view the hosts in that group.\n";
+ print "<li>Click on a red status light below to list the problems found.\n";
+ print "</ul>\n";
+ }
+
+ if ($#groups > 0) {
+ displaytable($dbh, 'usergroups',
+ '-clauses', "where (user = '$remuser')",
+ '-select', 'distinct groupname',
+ '-notitle', 1,
+ '-printonly', ['groupname'],
+ '-datalink', sub { my $q = self_url();
+ my $key = shift;
+ my $h = shift;
+ return if ($key ne "groupname");
+ return addtoken($q,"group=$h");
+ },
+ '-beginhook',
+ sub {
+ my $q = self_url();
+ my($dbh, $junk, $data) = @_;
+ if (!defined($data)) {
+ print "<th>Status</th>";
+ return;
+ }
+ my ($cur, $row);
+ $cur = getcursor($dbh, "select host from hostgroups where groupname = '$data->{groupname}'");
+ while ( $row = $cur->fetchrow_hashref ) {
+ if (checkhost($dbh, $data->{'groupname'},
+ $row->{'host'})) {
+ print "<td><a href=\"" . addtoken($q,"group=$data->{groupname}&summarizegroup=1") . "\"><img border=0 src=$NetSNMP::manager::redimage></a></td>\n";
+ return;
+ }
+ }
+ print "<td><img src=$NetSNMP::manager::greenimage></td>\n";
+ }
+ );
+ $dbh->disconnect();
+ return Exit($dbh, $group);
+ } else {
+ if ($#groups == -1) {
+ print "You are not configured to use the Net-SNMP-manager, please contact your system administrator.";
+ return Exit($dbh, $group);
+ }
+ $group = $groups[0];
+ }
+}
+
+#===========================================================================
+# reject un-authorized people accessing a certain group
+#===========================================================================
+if (!isuser($dbh, $remuser, $group)) {
+ print "Unauthorized access to that group ($group)\n";
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# add a new host to a group
+#===========================================================================
+if (defined(my $newhost = param('newhost'))) {
+ if (isadmin($dbh, $remuser, $group)) {
+ if ($dbh->do("select * from hostgroups where host = '$newhost' and groupname = '$group'") eq "0E0") {
+ $dbh->do("insert into hostgroups(host,groupname) values('$newhost','$group')") ;
+ } else {
+ print "<b>ERROR: host $newhost already in $group</b>\n";
+ }
+ CGI::delete('newhost');
+ }
+}
+
+#===========================================================================
+# display setup configuration for a group
+#===========================================================================
+if (defined(param('setupgroup'))) {
+ if (isadmin($dbh, $remuser, $group)) {
+ setupgroup($dbh, $group);
+ } else {
+ print "<h2>You're not able to perform setup operations for group $group\n";
+ }
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# save configuration information submitted about a group
+#===========================================================================
+if (defined(param('setupgroupsubmit')) &&
+ isadmin($dbh, $remuser, $group)) {
+ setupgroupsubmit($dbh, $group);
+ delete_all();
+ param(-name => 'group', -value => $group);
+ print "<a href=\"" . self_url() . "\">Entries submitted</a>";
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# user preferences
+#===========================================================================
+if (defined(param('userprefs'))) {
+ setupuserpreferences($dbh, $remuser, $group);
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# save submitted user preferences
+#===========================================================================
+if (defined(param('setupuserprefssubmit')) &&
+ isadmin($dbh, $remuser, $group)) {
+ setupusersubmit($dbh, $remuser, $group);
+ delete_all();
+ param(-name => 'group', -value => $group);
+ print "<a href=\"" . self_url() . "\">Entries submitted</a>";
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# summarize problems in a group
+#===========================================================================
+if (defined(param('summarizegroup'))) {
+ print "<title>group problem summary: $group</title>\n";
+ print "<h2>The following is a list of problems in the group \"$group\":</h2>\n";
+ summarizeerrors($dbh, "where groupname = '$group'");
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# summarize problems on a host
+#===========================================================================
+if (defined($host) && defined(param('summarizehost'))) {
+ print "<title>host summary: $host</title>\n";
+ print "<h2>The following is a list of problems for the host \"$host\":</h2>\n";
+ summarizeerrors($dbh, "where groupname = '$group' and host = '$host'");
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# display a list of hosts in a group
+#===========================================================================
+if (!defined($host)) {
+ print "<title>Net-SNMP Host $host</title>\n";
+ print "<h2>Hosts in the group \"$group\":</h2>\n";
+ if (!isexpert($remuser)) {
+ print "<ul>\n";
+ if (isadmin($dbh, $remuser, $group)) {
+ my $q = self_url();
+ $q =~ s/\?.*//;
+ print "<li>Make sure you <a href=\"" . addtoken($q,"group=$group&setupgroup=1") . "\">set up the host</a> for the SNMP tables you want to monitor.\n";
+ }
+ print "<li>Click on a hostname to operate on or view the information tables associated with that group.\n";
+ print "<li>Click on a red status light below to list the problems found in with a particular host.\n";
+ print "</ul>\n";
+ }
+ displaytable($dbh, 'hostgroups',
+ '-notitle',0,
+ '-clauses', "where (groupname = '$group')",
+ '-select', 'distinct host, sysObjectId, sysDescr, sysUpTime, versionTag',
+ '-datalink', sub { my $q = self_url();
+ my $key = shift;
+ my $h = shift;
+ return if ($key ne "host");
+ return addtoken($q,"host=$h");
+ },
+ '-beginhook',
+ sub {
+ my $q = self_url();
+ my($dbh, $junk, $data) = @_;
+ if (!defined($data)) {
+ print "<th>Status</th>";
+ return;
+ }
+ if (checkhost($dbh, $group, $data->{'host'})) {
+ print "<td><a href=\"" . addtoken($q,"group=$group&summarizehost=1&host=$data->{host}") . "\"><img border=0 src=$NetSNMP::manager::redimage></a></td>\n";
+ } else {
+ print "<td><img src=$NetSNMP::manager::greenimage></td>\n";
+ }
+ }
+ );
+ if (isadmin($dbh, $remuser, $group)) {
+ addhostentryform($group);
+ my $q = self_url();
+ $q =~ s/\?.*//;
+ print "<a href=\"" . addtoken($q,"group=$group&setupgroup=1") . "\">setup group $group</a>\n";
+ }
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# setup the host's history records
+#===========================================================================
+if (param('setuphost')) {
+ print "<title>Net-SNMP history setup for host: $host</title>\n";
+ print "<h2>Net-SNMP history setup for the host: \"$host\"</h2>\n";
+ print "<p>Enter the number of days to keep the data for a given table for the host \"$host\":\n";
+ if (!isexpert($remuser)) {
+ print "<ul>\n";
+ print "<li>Numbers must be greater than or equal to 1 to enable history logging.\n";
+ print "</ul>\n";
+ }
+ print "<form method=post><input type=hidden name=setuphost value=1><input type=hidden name=host value=\"$host\"><input type=hidden name=group value=\"$group\">\n";
+ displaytable($dbh, 'hosttables',
+ '-clauses',"where host = '$host' and groupname = '$group'",
+ '-select','groupname, host, tablename, keephistory',
+ '-selectorder', 1,
+ '-notitle', 1,
+ '-editable', 1,
+ '-indexes', ['groupname','host','tablename'],
+ '-CGI', $CGI::Q
+ );
+ print "<input type=submit value=\"submit changes\">\n";
+ print "</form>\n";
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# display a huge table of history about something
+#===========================================================================
+if (param('displayhistory')) {
+ if (!isuser($dbh, $remuser, $group)) {
+ print "Unauthorized access to that group ($group)\n";
+ return Exit($dbh, $group);
+ }
+ displaytable($dbh, param('table'),
+ '-clauses', "where (host = '$host')",
+ '-dolink', \&linktodisplayinfo,
+ '-dontdisplaycol', "select * from userprefs where user = '$remuser' and groupname = '$group' and tablename = ? and columnname = ? and displayit = 'N'"
+ );
+ return Exit($dbh, $group);
+}
+
+#===========================================================================
+# display inforamation about a host
+# optionally add new collection tables
+#===========================================================================
+showhost($dbh, $host, $group, $remuser);
+if (isadmin($dbh, $remuser, $group)) {
+ if (param('newtables')) {
+ my $x = param('newtables');
+ $x =~ s/,/ /g;
+ if (/[^\w\s]/) {
+ print "<br>Illegal table names in addition list: $x<br>\n"
+ } else {
+ my @x = split(/\s+/,$x);
+ foreach my $i (@x) {
+ $dbh->do("insert into hosttables(host, groupname, tablename, keephistory) values('$host','$group','$i','0')");
+ }
+ print "<br>adding: ",join(", ",@x),"<br>\n";
+ }
+ } else {
+ print "<br>Add new MIB Tables or Groups that you want to collect for this host: <form><input type=hidden name=host value=\"$host\"><input type=hidden name=group value=\"$group\"><input name=\"newtables\" type=text><br><input type=submit value=\"add tables\"></form>\n";
+ }
+ my $q = self_url();
+ $q =~ s/\?.*//;
+ print "<a href=\"" . addtoken($q, "setuphost=1&host=$host&group=$group") . "\">setup host $host</a>\n";
+}
+return Exit($dbh, $group);
+
+#===========================================================================
+# END of handler
+#===========================================================================
+
+}
+
+# add a token to a url string. Use either a ? or an & depending on
+# existence of ?.
+sub addtoken {
+ my $url = shift;
+ my $token = shift;
+ return "$url&$token" if ($url =~ /\?/);
+ return "$url?$token";
+}
+
+#
+# summarizeerrors(DB-HANDLE, CLAUSE):
+# summarize the list of errors in a given CLAUSE
+#
+sub summarizeerrors {
+ my $dbh = shift;
+ my $clause = shift;
+ $clause = "where" if ($clause eq "");
+ my $clause2 = $clause;
+ $clause2 =~ s/ host / hosterrors.host /;
+
+ # Major errors
+ displaytable($dbh, 'hosterrors, hostgroups', # , hostgroups
+ '-select', "hosterrors.host as host, errormsg",
+ '-notitle', 1,
+ '-title', "Fatal Errors",
+ '-clauses', "$clause2 and hosterrors.host = hostgroups.host",
+ '-beginhook', sub {
+ if ($#_ < 2) {
+ #doing header;
+ print "<td></td>";
+ } else {
+ print "<td><img src=\"$NetSNMP::manager::redimage\"></td>\n";
+ }});
+
+ my $tabletop = "<br><table $NetSNMP::manager::tableparms><tr $NetSNMP::manager::headerparms><th><b>Host</b></th><th><b>Table</b></th><th><b>Description</b></th></tr>\n";
+ my $donetop = 0;
+ my $cursor =
+ getcursor($dbh, "SELECT * FROM hosttables $clause");
+
+ while (my $row = $cursor->fetchrow_hashref ) {
+
+ my $exprs = getcursor($dbh, "SELECT * FROM errorexpressions where (tablename = '$row->{tablename}')");
+
+ while (my $expr = $exprs->fetchrow_hashref ) {
+ my $errors = getcursor($dbh, "select * from $row->{tablename} where $expr->{expression} and host = '$row->{host}'");
+ while (my $error = $errors->fetchrow_hashref ) {
+ print $tabletop if ($donetop++ == 0);
+ print "<tr><td>$row->{host}</td><td>$row->{tablename}</td><td>$expr->{returnfield}: $error->{$expr->{returnfield}}</td></tr>";
+ }
+ }
+ }
+ print "</table>";
+}
+
+#
+# getcursor(CMD):
+# genericlly get a cursor for a given sql command, displaying and
+# printing errors where necessary.
+#
+sub getcursor {
+ my $dbh = shift;
+ my $cmd = shift;
+ my $cursor;
+ ( $cursor = $dbh->prepare( $cmd ))
+ or print "\nnot ok: $DBI::errstr\n";
+ ( $cursor->execute )
+ or print( "\tnot ok: $DBI::errstr\n" );
+ return $cursor;
+}
+
+#
+# mykeysort($a, $b)
+# sorts $a and $b against the order in the mib or against the hard
+# coded special list.
+#
+sub mykeysort {
+ my $a = $displaytable::a;
+ my $b = $displaytable::b;
+ my $mb = $SNMP::MIB{SNMP::translateObj($b)};
+ my $ma = $SNMP::MIB{SNMP::translateObj($a)};
+
+ return $NetSNMP::manager::myorder{$a} <=> $NetSNMP::manager::myorder{$b} if ((defined($NetSNMP::manager::myorder{$a}) || !defined($ma->{'subID'})) && (defined($NetSNMP::manager::myorder{$b}) || !defined($mb->{'subID'})));
+ return 1 if (defined($NetSNMP::manager::myorder{$b}) || !defined($mb->{'subID'}));
+ return -1 if (defined($NetSNMP::manager::myorder{$a}) || !defined($ma->{'subID'}));
+
+ $ma->{'subID'} <=> $mb->{'subID'};
+}
+
+#
+# checkhost(GROUP, HOST):
+# if anything in a host is an error, as defined by the
+# errorexpressions table, return 1, else 0
+#
+sub checkhost {
+ my $dbh = shift;
+ my $group = shift;
+ my $host = shift;
+ my ($tblh);
+
+ return 2 if ($dbh->do("select * from hosterrors where host = '$host'") ne "0E0");
+
+ # get a list of tables we want to display
+ $tblh = getcursor($dbh, "SELECT * FROM hosttables where (host = '$host' and groupname = '$group')");
+
+ # table data
+ my($exprs, $tablelist);
+ while ( $tablelist = $tblh->fetchrow_hashref ) {
+ $exprs = getcursor($dbh, "SELECT * FROM errorexpressions where (tablename = '$tablelist->{tablename}')");
+ while(my $expr = $exprs->fetchrow_hashref) {
+ if ($dbh->do("select * from $tablelist->{tablename} where $expr->{expression} and host = '$host'") ne "0E0") {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+#
+# showhost(HOST):
+#
+# display all the tables monitored for a given host (in a group).
+#
+sub showhost {
+ my $dbh = shift;
+ my $host = shift;
+ my $group = shift;
+ my $remuser = shift;
+ my $q = self_url();
+ $q =~ s/\?.*//;
+ # host header
+ print "<title>Net-SNMP manager report for host: $host</title>\n";
+ print "<h2>Monitored information for the host $host</h2>\n";
+ if (!isexpert($remuser)) {
+ print "<ul>\n";
+ print "<li>Click on a column name for information about the data in that column.\n";
+ print "<li>Click on a column name or table name for information about the data in the table.\n";
+ print "<li>If you are <a href=\"" . addtoken($q, "setuphost=1&host=$host&group=$group") . "\">collecting past history</a> for a data set, links will appear below the table that allow you to view and/or graph the historic data.\n";
+ print "</ul>\n";
+ }
+
+ # does the host have a serious error?
+
+ my $errlist = getcursor($dbh, "SELECT * FROM hosterrors where (host = '$host')");
+ if ( $dbh->do("SELECT * FROM hosterrors where (host = '$host')") ne "0E0") {
+ displaytable($dbh, 'hosterrors',
+ '-clauses', "where (host = '$host')",
+ '-dontdisplaycol', "select * from userprefs where user = '$remuser' and groupname = '$group' and tablename = ? and columnname = ? and displayit = 'N'",
+ '-beginhook', sub {
+ if ($#_ < 2) {
+ #doing header;
+ print "<td></td>";
+ } else {
+ print "<td><img src=\"$NetSNMP::manager::redimage\"></td>\n";
+ }});
+ }
+
+ # get a list of tables we want to display
+ my $tblh = getcursor($dbh, "SELECT * FROM hosttables where (host = '$host' and groupname = '$group')");
+
+ # table data
+ my($tablelist);
+ while ( $tablelist = $tblh->fetchrow_hashref ) {
+
+ displaytable($dbh, $tablelist->{'tablename'},
+ '-clauses', "where (host = '$host') order by oidindex",
+ '-dontdisplaycol', "select * from userprefs where user = '$remuser' and groupname = '$group' and tablename = ? and columnname = ? and displayit = 'N'",
+ '-sort', \&mykeysort,
+ '-dolink', \&linktodisplayinfo,
+ '-beginhook', \&printredgreen);
+ if ($tablelist->{'keephistory'}) {
+ my $q = self_url();
+ $q =~ s/\?.*//;
+ print "history: ";
+ print "<a href=\"" . addtoken($q, "displayhistory=1&host=$host&group=$group&table=$tablelist->{'tablename'}hist") . "\">[table]</a>\n";
+ print "<a href=\"" . addtoken($q, "displaygraph=1&host=$host&group=$group&table=$tablelist->{'tablename'}hist") . "\">[graph]</a>\n";
+ print "<br>\n";
+ }
+ }
+}
+
+#
+# linktodisplayinfo(STRING):
+#
+# returns a url to the appropriate displayinfo link if STRING is a
+# mib node.
+#
+sub linktodisplayinfo {
+ return if (exists($NetSNMP::manager::myorder{shift}));
+ return self_url() . "&displayinfo=" . shift;
+}
+
+# printredgreen(TABLENAME, DATA):
+#
+# display a red or a green dot in a table dependent on the table's
+# values and associated expression
+#
+# DATA is NULL when in a header row (displaying header names).
+#
+sub printredgreen {
+ my $dbh = shift;
+ my $tablename = shift;
+ my $data = shift;
+ my ($exprs, $expr, $img);
+
+ if (!defined($data)) {
+ #doing header;
+ print "<td></td>";
+ return;
+ }
+
+ my $cmd = "SELECT * FROM errorexpressions where (tablename = '$tablename')";
+ print " $cmd\n" if ($NetSNMP::manager::verbose);
+ ( $exprs = $dbh->prepare( $cmd ) )
+ or die "\nnot ok: $DBI::errstr\n";
+ ( $exprs->execute )
+ or print( "\tnot ok: $DBI::errstr\n" );
+
+ $img = $NetSNMP::manager::greenimage;
+ while($expr = $exprs->fetchrow_hashref) {
+ if ($dbh->do("select oidindex from $tablename where host = '$data->{host}' and oidindex = '$data->{oidindex}' and $expr->{expression}") ne "0E0") {
+ $img = $NetSNMP::manager::redimage;
+ }
+ }
+ print "<td><img src=$img></td>";
+}
+
+#
+# display information about a given mib node as a table.
+#
+sub makemibtable {
+ my $dispinfo = shift;
+ # display information about a data type in a table
+ my $mib = $SNMP::MIB{SNMP::translateObj($dispinfo)};
+ print "<table $NetSNMP::manager::tableparms><tr><td>\n";
+ foreach my $i (qw(label type access status units hint moduleID description enums)) {
+# foreach my $i (keys(%$mib)) {
+ next if (!defined($$mib{$i}) || $$mib{$i} eq "");
+ next if (ref($$mib{$i}) eq "HASH" && $#{keys(%{$$mib{$i}})} == -1);
+ print "<tr><td>$i</td><td>";
+ if (ref($$mib{$i}) eq "HASH") {
+ print "<table $NetSNMP::manager::tableparms><tr><td>\n";
+ foreach my $j (sort { $$mib{$i}{$a} <=> $$mib{$i}{$b} } keys(%{$$mib{$i}})) {
+ print "<tr><td>$$mib{$i}{$j}</td><td>$j</td></tr>";
+ }
+ print "</table>\n";
+ } else {
+ print "$$mib{$i}";
+ }
+ print "</td></tr>\n";
+ }
+ print "</table>\n";
+}
+
+# given a user, get all the groups he belongs to.
+sub getgroupsforuser {
+ my (@ret, $cursor, $row);
+ my ($dbh, $remuser) = @_;
+ ( $cursor = $dbh->prepare( "SELECT * FROM usergroups where (user = '$remuser')"))
+ or die "\nnot ok: $DBI::errstr\n";
+ ( $cursor->execute )
+ or print( "\tnot ok: $DBI::errstr\n" );
+
+ while ( $row = $cursor->fetchrow_hashref ) {
+ push(@ret, $row->{'groupname'});
+ }
+ @ret;
+}
+
+# given a host, get all the groups it belongs to.
+sub gethostsforgroup {
+ my (@ret, $cursor, $row);
+ my ($dbh, $group) = @_;
+ ( $cursor = $dbh->prepare( "SELECT * FROM hostgroups where (groupname = '$group')"))
+ or die "\nnot ok: $DBI::errstr\n";
+ ( $cursor->execute )
+ or print( "\tnot ok: $DBI::errstr\n" );
+
+ while ( $row = $cursor->fetchrow_hashref ) {
+ push(@ret, $row->{'host'});
+ }
+ @ret;
+}
+
+# display the host add entry box
+sub addhostentryform {
+ my $group = shift;
+ print "<form method=\"get\" action=\"" . self_url() . "\">\n";
+ print "Add a new host to the group \"$group\": <input type=\"text\" name=\"newhost\"><br>";
+ print "<input type=\"hidden\" name=\"group\" value=\"$group\">";
+ print "<input type=submit value=\"Add Hosts\">\n";
+ print "</form>";
+}
+
+#is an expert user?
+sub isexpert {
+ return 0;
+}
+
+#is remuser a admin?
+sub isadmin {
+ my ($dbh, $remuser, $group) = @_;
+ return 0 if (!defined($remuser) || !defined($group));
+ return 1 if ($dbh->do("select * from usergroups where user = '$remuser' and groupname = '$group' and isadmin = 'Y'") ne "0E0");
+ return 0;
+}
+
+#is user a member of this group?
+sub isuser {
+ my ($dbh, $remuser, $group) = @_;
+ return 0 if (!defined($remuser) || !defined($group));
+ return 1 if ($dbh->do("select * from usergroups where user = '$remuser' and groupname = '$group'") ne "0E0");
+ return 0;
+}
+
+# displayconfigarray(HOSTS, NAMES, CONFIG):
+#
+# displays an array of generic check buttons to turn on/off certain
+# variables.
+sub displayconfigarray {
+ my $dbh = shift;
+ my $hosts = shift;
+ my $names = shift;
+ my %config = @_;
+
+ my $cmd;
+ if ($config{'-check'}) {
+ ( $cmd = $dbh->prepare( $config{'-check'} ) )
+ or die "\nnot ok: $DBI::errstr\n";
+ }
+
+ print "<table $NetSNMP::manager::tableparms>\n";
+ print "<tr><td></td>";
+ my ($i, $j);
+ foreach $j (@$names) {
+ my $nj = $j;
+ $nj = $j->[0] if ($config{'-arrayrefs'} || $config{'-arrayref2'});
+ print "<td>$nj</td>";
+ }
+ foreach my $i (@$hosts) {
+ my $ni = $i;
+ $ni = $i->[0] if ($config{'-arrayrefs'} || $config{'-arrayref1'});
+ print "<tr><td>$ni</td>";
+ foreach $j (@$names) {
+ my $nj = $j;
+ $nj = $j->[0] if ($config{'-arrayrefs'} || $config{'-arrayref2'});
+ my $checked = "checked" if (defined($cmd) && $cmd->execute($ni,$nj) ne "0E0");
+ print "<td><input type=checkbox $checked value=y name=" . $config{prefix} . $ni . $nj . "></td>\n";
+ }
+ print "</tr>\n";
+ }
+ print "</tr>";
+ print "</table>";
+}
+
+sub adddefaulttables {
+ my ($dbh, $names) = @_;
+ my $row;
+ # add in known expression tables.
+ my $handle = getcursor($dbh, "SELECT * FROM errorexpressions");
+
+ expr:
+ while($row = $handle->fetchrow_hashref) {
+ foreach $i (@$names) {
+ if ($i->[0] eq $row->{tablename}) {
+ next expr;
+ }
+ }
+ push @$names, [$row->{tablename}];
+ }
+}
+
+#
+# display the setup information page for a given group.
+#
+sub setupgroup {
+ my $dbh = shift;
+ my $group = shift;
+
+ my ($hosts, $names) = gethostandgroups($dbh, $group);
+ adddefaulttables($dbh, $names);
+
+ print "<form method=\"post\" action=\"" . self_url() . "\">\n";
+ print "<input type=hidden text=\"setupgroupsubmit\" value=\"y\">";
+ displayconfigarray($dbh, $hosts, $names,
+ -arrayrefs, 1,
+ -check, "select * from hosttables where (host = ? and tablename = ? and groupname = '$group')");
+ print "<input type=hidden name=group value=\"$group\">\n";
+ print "<input type=submit value=submit name=\"setupgroupsubmit\">\n";
+ print "</form>";
+}
+
+# a wrapper around fetching arrays of everything in a table.
+sub getarrays {
+ my $dbh = shift;
+ my $table = shift;
+ my %config = @_;
+ my $selectwhat = $config{'-select'} || "*";
+ my $handle;
+
+ $handle = getcursor($dbh, "SELECT $selectwhat FROM $table $config{-clauses}");
+ return $handle->fetchall_arrayref;
+}
+
+#
+# get a list of all tablenames and hostnames for a given group.
+#
+sub gethostandgroups {
+ my $dbh = shift;
+ my $group = shift;
+ my ($tbnms);
+
+ my $names = getarrays($dbh, 'hosttables',
+ "-select", 'distinct tablename',
+ "-clauses", "where groupname = '$group'");
+
+ my $hosts = getarrays($dbh, 'hostgroups',
+ "-select", 'distinct host',
+ "-clauses", "where groupname = '$group'");
+
+ return ($hosts, $names);
+}
+
+sub setupgroupsubmit {
+ my $dbh = shift;
+ my $group = shift;
+
+ my ($hosts, $names) = gethostandgroups($dbh, $group);
+ adddefaulttables($dbh, $names);
+
+ foreach my $i (@$hosts) {
+ $dbh->do("delete from hosttables where host = '${$i}[0]' and groupname = '$group'");
+ }
+ my $rep = $dbh->prepare("insert into hosttables(host,tablename,groupname) values(?,?,'$group')");
+
+ foreach my $i (@$hosts) {
+ foreach my $j (@$names) {
+ if (param("${$i}[0]" . "${$j}[0]")) {
+ print "test: ","${$i}[0] : ${$j}[0]<br>\n";
+ $rep->execute("${$i}[0]", "${$j}[0]") || print "$! $DBI::errstr<br>\n";
+ }
+ }
+ }
+
+}
+
+#
+# save user pref data submitted by the user
+#
+sub setupusersubmit {
+ my ($dbh, $remuser, $group) = @_;
+ my $tables = getarrays($dbh, 'hosttables',
+ "-select", 'distinct tablename',
+ "-clauses", "where groupname = '$group'");
+
+ $dbh->do("delete from userprefs where user = '$remuser' and groupname = '$group'");
+ my $rep = $dbh->prepare("insert into userprefs(user, groupname, tablename, columnname, displayit) values('$remuser', '$group', ?, ?, 'N')");
+
+ my ($i, $j);
+ foreach my $i (@$tables) {
+ my $sth = $dbh->prepare("select * from ${$i}[0] where 1 = 0");
+ $sth->execute();
+
+ foreach $j (@{$sth->{NAME}}) {
+ if (param("${$i}[0]" . "$j")) {
+ $rep->execute("${$i}[0]", "$j");
+ }
+ }
+ }
+}
+
+sub Exit {
+ my ($dbh, $group) = @_;
+ my $tq = self_url();
+ $tq =~ s/\?.*//;
+ print "<hr>\n";
+ print "<a href=\"$tq\">[TOP]</a>\n";
+ print "<a href=\"$tq?userprefs=1&group=$group\">[display options]</a>\n";
+ print "<a href=\"$tq?setuponcall=1\">[setup oncall schedule]</a>\n";
+ if (defined($group)) {
+ print "<a href=\"$tq?group=$group\">[group: $group]</a>\n";
+ print "<a href=\"$tq?group=$group&summarizegroup=1\">[summarize errors]</a>\n";
+ }
+ $dbh->disconnect() if (defined($dbh));
+ return OK();
+# exit shift;
+}
+
+#
+# setup user preferences by displaying a configuration array of
+# checkbuttons for each table.
+#
+sub setupuserpreferences {
+ my ($dbh, $remuser, $group) = @_;
+ my $tables = getarrays($dbh, 'hosttables',
+ "-select", 'distinct tablename',
+ "-clauses", "where groupname = '$group'");
+
+ print "<h3>Select the columns from the tables that you want to <b>hide</b> below and click on submit:</h3>\n";
+ print "<form method=\"post\" action=\"" . self_url() . "\">\n";
+
+ my ($i, $j);
+ foreach my $i (@$tables) {
+ my $sth = $dbh->prepare("select * from ${$i}[0] where 1 = 0");
+ $sth->execute();
+ displayconfigarray($dbh, [${$i}[0]], $sth->{NAME},
+ -check, "select * from userprefs where (tablename = ? and columnname = ? and user = '$remuser' and groupname = '$group' and displayit = 'N')");
+ print "<br>\n";
+ }
+ print "<input type=hidden name=group value=\"$group\">\n";
+ print "<input type=submit value=submit name=\"setupuserprefssubmit\">\n";
+ print "</form>";
+}
diff --git a/perl/manager/red.gif b/perl/manager/red.gif
new file mode 100644
index 0000000..d2eb107
--- /dev/null
+++ b/perl/manager/red.gif
Binary files differ
diff --git a/perl/manager/setupauth b/perl/manager/setupauth
new file mode 100755
index 0000000..d10a62e
--- /dev/null
+++ b/perl/manager/setupauth
@@ -0,0 +1,59 @@
+#!/usr/bin/perl
+
+use DBI;
+$hostname = 'localhost'; # Host that serves the mSQL Database
+$dbname = 'snmp'; # mySQL Database name
+$doit = 1;
+
+sub usage {
+ print "$0 [-H host] [-u user] [-p password] [-v] [-h] [-n] [-g groupname] [-m machinename] TOKEN VALUE\n";
+ exit 0;
+}
+
+while ($#ARGV > -1 && $ARGV[0] =~ /^-/) {
+ $_ = shift @ARGV;
+ usage if (/-h/);
+ $hostname = shift if (/-H/);
+ $user = shift if (/-u/);
+ $pass = shift if (/-p/);
+ $group = shift if (/-g/);
+ $machine = shift if (/-m/);
+ $verbose = 1 if (/-v/);
+ $doit = 0 if (/-n/);
+}
+
+( $dbh = DBI->connect("DBI:mysql:database=$dbname;host=$hostname", $user, $pass))
+ or die "\tConnect not ok: $DBI::errstr\n";
+
+if (defined($machine)) {
+ $table = "authhost";
+ $group = $machine;
+} else {
+ $table = "authgroup";
+ $group = "default" if (!defined($group));
+}
+
+$token = shift;
+$value = shift;
+while(defined($value)) {
+ if (DO("select * from $table where lookup = '$group' and varcol = '$token'") eq "0E0") {
+ DO("insert into $table(lookup, varcol, valcol) values('$group', '$token', '$value')");
+ } else {
+ DO("update $table set valcol = '$value' where lookup = '$group' and varcol = '$token'");
+ }
+ $token = shift;
+ $value = shift;
+}
+
+$dbh->disconnect();
+
+sub DO {
+ my $cmd = shift;
+ print $cmd,"\n" if ($verbose);
+ my $ret = $dbh->do($cmd) if ($doit);
+ print " returned: $ret\n" if ($verbose);
+ if ($DBI::errstr) {
+ print "db error ($ret): $DBI::errstr\n";
+ }
+ return $ret;
+}
diff --git a/perl/manager/setupdb b/perl/manager/setupdb
new file mode 100755
index 0000000..03066fd
--- /dev/null
+++ b/perl/manager/setupdb
@@ -0,0 +1,149 @@
+#!/usr/bin/perl
+
+use DBI;
+$hostname = 'localhost'; # Host that serves the mSQL Database
+$dbname = 'snmp'; # mySQL Database name
+$doit = 1;
+
+sub usage {
+ print "$0 [-H sqlhost] [-u user] [-p password] [-d] [-n]\n";
+ exit 0;
+}
+
+while ($#ARGV > -1 && $ARGV[0] =~ /^-/) {
+ $_ = shift @ARGV;
+ usage if (/-h/);
+ $hostname = shift if (/-H/);
+ $user = shift if (/-u/);
+ $pass = shift if (/-p/);
+ $delete = 1 if (/-d/);
+ $verbose = 1 if (/-v/);
+ $doit = 0 if (/-n/);
+}
+
+( $dbh = DBI->connect("DBI:mysql:database=$dbname;host=$hostname", $user, $pass))
+ or die "\tConnect not ok: $DBI::errstr\n";
+
+# run a whole ton of setup stuff
+
+if ($delete) {
+ DO("drop database if exists $dbname");
+}
+
+# here we go
+
+DO("create database $dbname");
+DO("use $dbname");
+
+# tables dumped with
+#
+# mysqldump -d ... snmp TABLE | perl -n -e 'while(<>) { last if (/CREATE/);} print "DO(\"$_"; while (<>) { last if (/\);/); print; } print ")\");\n";'
+
+DO("CREATE TABLE hosterrors (
+ id int(11) DEFAULT '0' NOT NULL auto_increment,
+ host varchar(64),
+ errormsg varchar(128),
+ PRIMARY KEY (id)
+)");
+
+DO("CREATE TABLE hosttables (
+ id int(11) DEFAULT '0' NOT NULL auto_increment,
+ host varchar(64),
+ tablename varchar(64),
+ groupname varchar(32),
+ keephistory int(2),
+ PRIMARY KEY (id)
+)");
+
+DO("CREATE TABLE usergroups (
+ id int(11) DEFAULT '0' NOT NULL auto_increment,
+ user varchar(16),
+ groupname varchar(32),
+ isadmin enum('N','Y') DEFAULT 'N',
+ PRIMARY KEY (id)
+)");
+
+DO("CREATE TABLE userprefs (
+ id int(11) DEFAULT '0' NOT NULL auto_increment,
+ user varchar(16),
+ groupname varchar(32),
+ tablename varchar(64),
+ columnname varchar(64),
+ displayit enum('N','Y') DEFAULT 'Y',
+ PRIMARY KEY (id)
+)");
+
+DO("CREATE TABLE hostgroups (
+ id int(11) DEFAULT '0' NOT NULL auto_increment,
+ host varchar(64),
+ groupname varchar(32),
+ sysObjectId varchar(255),
+ sysDescr varchar(255),
+ versionTag varchar(32),
+ sysUpTime varchar(64),
+ PRIMARY KEY (id)
+)");
+
+DO("CREATE TABLE oncall (
+ id int(11) DEFAULT '0' NOT NULL auto_increment,
+ user varchar(16),
+ groupname varchar(32),
+ email varchar(64),
+ days varchar(64),
+ hours varchar(64),
+ PRIMARY KEY (id)
+)");
+
+DO("CREATE TABLE errorexpressions (
+ id int(11) DEFAULT '0' NOT NULL auto_increment,
+ tablename varchar(64),
+ expression varchar(255),
+ returnfield varchar(64),
+ PRIMARY KEY (id)
+)");
+
+DO("CREATE TABLE setup (
+ lookup varchar(64),
+ varcol varchar(128),
+ valcol varchar(128)
+)");
+
+DO("CREATE TABLE authgroup (
+ id int(11) DEFAULT '0' NOT NULL auto_increment,
+ lookup varchar(64),
+ varcol varchar(128),
+ valcol varchar(128),
+ PRIMARY KEY (id)
+)");
+
+DO("CREATE TABLE authhost (
+ id int(11) DEFAULT '0' NOT NULL auto_increment,
+ lookup varchar(64),
+ varcol varchar(128),
+ valcol varchar(128),
+ PRIMARY KEY (id)
+)");
+
+# insert the standard ucd-snmp expressions
+DO("insert into errorexpressions(tablename, expression, returnfield)
+ values('prTable', 'prErrorFlag > 0', 'prErrMessage')");
+DO("insert into errorexpressions(tablename, expression, returnfield)
+ values('extTable', 'extResult > 0', 'extOutput')");
+DO("insert into errorexpressions(tablename, expression, returnfield)
+ values('dskTable', 'dskErrorFlag > 0', 'dskErrMessage')");
+DO("insert into errorexpressions(tablename, expression, returnfield)
+ values('laTable', 'laErrorFlag > 0', 'laErrMessage')");
+DO("insert into errorexpressions(tablename, expression, returnfield)
+ values('fileTable', 'fileErrorFlag > 0', 'fileErrMessage')");
+DO("insert into errorexpressions(tablename, expression, returnfield)
+ values('snmperrs', 'snmperrErrorFlag > 0', 'snmperrErrMessage')");
+DO("insert into errorexpressions(tablename, expression, returnfield)
+ values('memory', 'memSwapError > 0', 'memSwapErrMessage')");
+
+$dbh->disconnect();
+
+sub DO {
+ my $cmd = shift;
+ print $cmd,"\n" if ($verbose);
+ $dbh->do($cmd) if ($doit);
+}
diff --git a/perl/manager/setupuser b/perl/manager/setupuser
new file mode 100755
index 0000000..84fbcac
--- /dev/null
+++ b/perl/manager/setupuser
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+
+use DBI;
+$hostname = 'localhost'; # Host that serves the mSQL Database
+$dbname = 'snmp'; # mySQL Database name
+$doit = 1;
+
+sub usage {
+ print "$0 [-H host] [-u user] [-p password] [-v] [-h] [-n] [-d] [-a] GROUP USER EMAILADDRESS\n";
+ exit 0;
+}
+
+while ($#ARGV > -1 && $ARGV[0] =~ /^-/) {
+ $_ = shift @ARGV;
+ usage if (/-h/);
+ $hostname = shift if (/-H/);
+ $sqluser = shift if (/-u/);
+ $pass = shift if (/-p/);
+ $admin = 1 if (/-a/);
+ $verbose = 1 if (/-v/);
+ $delete = 1 if (/-d/);
+ $doit = 0 if (/-n/);
+}
+
+($group, $user, $email) = @ARGV;
+
+die "group $group is a reserved group name, you can't use it. Sorry." if ($group eq "default");
+
+die "no group specified" if (!defined($group));
+
+( $dbh = DBI->connect("DBI:mysql:database=$dbname;host=$hostname", $sqluser, $pass))
+ or die "\tConnect not ok: $DBI::errstr\n";
+
+DO("insert into usergroups(user, groupname, isadmin) values('$user', '$group', " . (($admin) ? "'Y'" : "'N'") . ")");
+if (defined($email)) {
+ DO("insert into oncall(user, groupname, email, days, hours) values('$user', '$group', '$email', '*', '*')");
+}
+
+$dbh->disconnect();
+
+sub DO {
+ my $cmd = shift;
+ print $cmd,"\n" if ($verbose);
+ $dbh->do($cmd) if ($doit);
+}
diff --git a/perl/manager/snmptosql b/perl/manager/snmptosql
new file mode 100755
index 0000000..ae51733
--- /dev/null
+++ b/perl/manager/snmptosql
@@ -0,0 +1,523 @@
+#!/usr/bin/perl
+
+use NetSNMP::manager::getValues qw(getValues);
+use SNMP;
+use DBI;
+use Net::SMTP;
+
+#===========================================================================
+# Global defines
+#===========================================================================
+
+$hostname = 'localhost'; # Host that serves the mSQL Database
+$dbname = 'snmp'; # mySQL Database name
+$smtpserver = 'localhost';
+$smtpfrom = 'Net-SNMP Manager <wjhardaker@ucdavis.edu>'; # <=== CHANGE ME ========
+$doit = 1;
+$somehosts = 0;
+
+sub usage {
+ print "$0 [-H host] [-u user] [-p password] [-l hostlist,...] [-v] [-h] [-n] [-d] [-m mib-to-load] <-m mibnode>\n";
+ exit 0;
+}
+
+while ($#ARGV > -1) {
+ $_ = shift @ARGV;
+ usage if (/-h/);
+ $hostname = shift if (/-H/);
+ if (/-l/) {
+ my $arg = shift;
+ my @a = split(/,/,$arg);
+ my $i;
+ $somehosts = 1;
+ foreach $i (@a) {
+ $dohost{$i} = 1;
+ }
+ }
+ $user = shift if (/-u/);
+ $pass = shift if (/-p/);
+ $verbose = 1 if (/-v/);
+ $delete = 1 if (/-d/);
+ $doit = 0 if (/-n/);
+ $tableexpr = shift if (/-t/);
+ if (/-m/) {
+ # load some mibs
+ # SNMP::loadModules(shift);
+ $ENV{'MIBS'} = shift;
+ }
+ if (/-M/) {
+ # add a mib directory to look in
+ $ENV{'MIBDIRS'} = shift;
+ # SNMP::addMibDirs(shift);
+ }
+}
+
+init_mib;
+
+#===========================================================================
+# Connect to the mSQL database with the appropriate driver
+( $dbh = DBI->connect("DBI:mysql:database=$dbname;host=$hostname", $user, $pass))
+ or die "\tConnect not ok: $DBI::errstr\n";
+
+#
+# delete history rows every so often.
+#
+my %count = getValues($dbh, 'setup', 'deletecount');
+
+if (!defined($count{'max'})) {
+ # default is to delete history rows once an hour.
+ $dbh->do("insert into setup values('deletecount','max','6')");
+ $count{'max'} = 6;
+}
+
+if (!defined($count{'current'})) {
+ $dbh->do("insert into setup values('deletecount','current','0')");
+} else {
+ $count{'current'}++;
+ if ($count{'max'} <= $count{'current'}) {
+ $count{'current'} = 0;
+ $deletehist = 1;
+ }
+ $dbh->do("update setup set valcol = $count{'current'} where lookup = 'deletecount' and varcol = 'current'");
+}
+
+#===========================================================================
+# Get host records from database and process
+
+$cursor = getcursor("SELECT distinct host FROM hosttables");
+nexthost: while ( $hostrow = $cursor->fetchrow_hashref ) {
+
+ my $host = $hostrow->{'host'};
+
+ next if ($somehosts && !defined($dohost{$host}));
+
+ #set up the session
+ print STDERR " starting $host\n" if ($verbose);
+ my $x = $dbh->prepare("select groupname from hostgroups where host = '$host'");
+ my $y = $x->execute();
+ my $group = ${$x->fetchrow_hashref}{'groupname'};
+ my @args = ('authgroup','default');
+ print STDERR "$host...$y\n" if ($verbose);
+ if (defined($y) && "$y" ne "0E0") {
+ push @args,'authgroup',$group;
+ }
+ push @args,'authhost',$host;
+ print STDERR "$host: $group\n" if ($verbose);
+
+ print STDERR "authvals: ", join(", ", @args), "\n" if ($verbose);
+ my %authvals = getValues($dbh, @args);
+ if ($verbose) {
+ print STDERR "parms for $host:";
+ foreach my $i (keys(%authvals)) {
+ print STDERR "$i => $authvals{$i}, ";
+ }
+ print STDERR "\n";
+ }
+
+ my $sess = new SNMP::Session ( DestHost => $host,
+ UseSprintValue => 1,
+ %authvals );
+ print STDERR "Sess ($host): $sess, ref=" . ref($sess). "\n" if ($verbose);
+ if (ref ($sess) ne "SNMP::Session") {
+# print STDERR "ack: \$sess not a SNMP::Session for $host ($!)\n";
+ hosterror("$host");
+ next nexthost;
+ }
+
+ # get various bits of system information.
+ my $sysDescr = $sess->get('sysDescr.0');
+ my $sysId = SNMP::translateObj($sess->get('sysObjectID.0'));
+ my $versiontag = $sess->get('versionTag.0');
+ my $sysuptime = $sess->get('sysUpTime.0');
+
+ if ($sysDescr eq "" || $sysId eq "" || $versiontag eq "" ||
+ $sysuptime eq "") {
+ hosterror("$host","Problem collecting basic info");
+ next;
+ }
+
+ $dbh->do("update hostgroups set sysObjectId = '$sysId', sysDescr = '$sysDescr', versionTag = '$versiontag', sysUpTime = '$sysuptime' where host = '$host'");
+
+ # translate the sysUpTime to a real number for future use:
+ {
+ my ($d,$h,$m,$s,$fs) = ($sysuptime =~ /^(\d+):(\d+):(\d+):(\d+)\.(\d+)$/);
+ $sysuptime = $fs + $s*100 + $m*100*60 + $h*100*60*60 + $d*100*60*60*24;
+ }
+
+ # get a list of tables we want to store
+ $cmd = "SELECT * FROM hosttables where (host = '$host')";
+ print STDERR " $cmd\n" if ($verbose);
+ ( $tblh = $dbh->prepare( $cmd ) )
+ or warn "\nnot ok: $DBI::errstr\n";
+ ( $tblh->execute )
+ or print( "\tnot ok: $DBI::errstr\n" );
+
+ while ( $tablelist = $tblh->fetchrow_hashref ) {
+ next if (defined($tableexpr) && $tablelist->{'tablename'} !~ /$tableexpr/);
+ print STDERR "starting table $tablelist->{'tablename'}\n" if ($verbose);
+ my $mib = $SNMP::MIB{SNMP::translateObj($tablelist->{'tablename'})};
+ if (!$mib) {
+ warn "mib node $tablelist->{'tablename'} doesn't exist";
+ next;
+ }
+ my $children = get_children($mib);
+
+ # create the table in our database if it doesn't exist.
+ setuptable($dbh, $tablelist->{tablename}, $delete);
+ if ($tablelist->{'keephistory'} > 0) {
+ setuptable($dbh, $tablelist->{tablename}, $delete, "hist");
+ }
+
+ $var =
+ new SNMP::Varbind([SNMP::translateObj($tablelist->{'tablename'})]);
+ my $void = SNMP::translateObj($tablelist->{'tablename'});
+ my $val = $sess->getnext($var);
+ print STDERR "init err: $sess->{'ErrorStr'}\n" if ($verbose);
+ if ($sess->{'ErrorStr'} =~ /Timeout/) {
+ print STDERR "$host timed out\n" if ($verbose);
+ hosterror($host);
+ next nexthost;
+ }
+ $initlabel = "";
+ print STDERR " starting $tablelist->{tablename}\n" if ($verbose);
+ my %tbl_ids;
+ while (1) {
+ my $varlabel = SNMP::Varbind::tag($var);
+ print STDERR "last $host " . SNMP::translateObj($varlabel) . ": $void\n" if ($verbose && SNMP::translateObj($varlabel) !~ /^$void/);
+
+ last if (SNMP::translateObj($varlabel) !~ /^$void/);
+ $varlabel = SNMP::translateObj(SNMP::Varbind::tag($var)) if ($varlabel =~ /^[\.0-9]+$/);
+ $initlabel = $varlabel if ($initlabel eq "");
+
+ my $val = $sess->getnext($var);
+ if ($sess->{'ErrorStr'} =~ /Timeout/) {
+ print STDERR "$host timed out\n" if ($verbose);
+ hosterror($host);
+ next nexthost;
+ }
+ last if ($sess->{'ErrorStr'});
+ my $id = SNMP::Varbind::iid($var);
+ print STDERR "$initlabel = $varlabel\n" if ($verbose);
+ last if ($varlabel ne $initlabel);
+ my %vals;
+ $tbl_ids{$id} = 1;
+ foreach $c (@$children) {
+ my $oid = $$c{'objectID'} . "." . $id;
+ my $newvar = new SNMP::Varbind([$oid]);
+ my $val = $sess->get($newvar);
+ my $label = SNMP::translateObj($$c{'objectID'});
+ $vals{$label} = $val;
+ }
+ my $cmd;
+
+ # check to see if the error previously existed and then
+ # delete the old entry.
+ my $olderr =
+ checkrowforerrors($tablelist->{'tablename'}, $host, $id);
+ $dbh->do("delete from $tablelist->{tablename} where ( host = '$host' and oidindex = '$id')");
+ $res = $dbh->do("select * from $tablelist->{'tablename'} where ( host = '$host' and oidindex = '$id')");
+ print STDERR " result: $res\n" if ($verbose);
+ if ($res ne "0E0") {
+ $cmd = "update $tablelist->{'tablename'} set ";
+ foreach $h (keys(%vals)) {
+ $cmd .= "$h = '$vals{$h}', ";
+ }
+ $cmd .= " updated = NULL where (host = '$host' and oidindex = '$id')";
+
+ } else {
+ $cmd = "insert into $tablelist->{'tablename'}(host, oidindex, " . join(", ",keys(%vals)) .
+ ") values('$host', '$id', '" .
+ join("', '",values(%vals)). "')";
+ }
+
+ print STDERR " $cmd\n" if ($verbose);
+ $dbh->do("$cmd")
+ or warn "\nnot ok: $cmd => $DBI::errstr\n" if ($doit);
+
+ if ($tablelist->{'keephistory'} > 0) {
+ $cmd = "insert into $tablelist->{'tablename'}hist (host, oidindex, sysUpTime, "
+ . join(", ",keys(%vals))
+ . ") values('$host', '$id', $sysuptime, '"
+ . join("', '",values(%vals)). "')";
+ print STDERR " $cmd\n" if ($verbose);
+ $dbh->do("$cmd")
+ or warn "\nnot ok: $cmd -> $DBI::errstr\n" if ($doit);
+
+ }
+
+ my $newerr =
+ checkrowforerrors($tablelist->{'tablename'}, $host, $id);
+ if ($newerr->{retval} != $olderr->{retval}) {
+ logerror($host, $newerr->{retval}, $newerr->{errfield},
+ $newerr->{errvalue});
+ }
+ } # snmp loop
+
+ # delete the data beyond the number of days requested.
+ if ($deletehist && $tablelist->{'keephistory'} > 0) {
+ $dbh->do("delete from $tablelist->{'tablename'}hist where (unix_timestamp() - unix_timestamp(updated)) > $tablelist->{'keephistory'}*24*60*60 and host = '$host'") or warn "\nnot ok: $DBI::errstr\n" if ($doit);
+ }
+
+ my $curs = getcursor("select oidindex from $tablelist->{tablename} where host = '$host'");
+ my $row;
+ while ($row = $curs->fetchrow_hashref) {
+ print STDERR " $row->{oidindex}\n" if ($verbose);
+ if (!defined($tbl_ids{$row->{oidindex}})) {
+ $dbh->do("delete from $tablelist->{tablename} where oidindex = '$row->{oidindex}'");
+ print STDERR "deleting: $host $tablelist->{tablename} $row->{oidindex}\n" if ($verbose);
+ }
+ }
+ print STDERR " done with $tablelist->{tablename}\n" if ($verbose);
+ } # table loop
+
+ if (isbadhost($host)) {
+ # let them out, they're no longer being bad.
+ print STDERR "deleting: delete from hosterrors where host = '$host'\n" if ($verbose);
+ $dbh->do("delete from hosterrors where host = '$host'");
+ mailusers("$host responding again", "$host responding again",
+ getoncallforhost($host));
+ }
+ print STDERR " done with $host\n" if ($verbose);
+} # host loop
+
+# disconnect
+$cursor->finish();
+$dbh->disconnect();
+
+#
+# Subroutines
+#
+
+# setup a table in the database based on a MIB table.
+sub setuptable {
+
+ my %conversions = qw(INTEGER integer INTEGER32 integer OCTETSTR varchar(254) COUNTER integer UINTEGER integer IPADDR varchar(254) OBJECTID varchar(254) GAGUE integer OPAQUE varchar(254) TICKS integer GAUGE integer);
+
+ # set up mib info
+ my ($dbh, $mibnode, $delete, $suffix) = @_;
+
+ my $mib = $SNMP::MIB{SNMP::translateObj($mibnode)};
+ my $children = get_children($mib);
+ my ($cmd, $j);
+
+ if ($delete) {
+ $cmd = "drop table if exists $mib->{label}";
+ print STDERR "cmd: $cmd\n" if ($verbose);
+ $dbh->do($cmd)
+ or warn "\nnot ok: $cmd -> $DBI::errstr\n" if ($doit);
+ } elsif (($ret = $dbh->do("show tables like '$mib->{label}$suffix'")) ne "0E0") {
+ # the table already exists
+ return;
+ }
+
+ print STDERR "show tables like $mib->{label}$suffix: $ret\n" if($verbose);
+ print STDERR " creating table for $mibnode ($mib->{label}$suffix)\n" if ($verbose);
+
+ $cmd = "create table $mib->{label}$suffix (id integer auto_increment primary key, host varchar(32) not null, oidindex varchar(32) not null";
+ foreach $j (sort { $a->{'subID'} <=> $b->{'subID'} } @$children) {
+ if (!defined($conversions{$j->{type}})) {
+ print STDERR "no conversion for $j->{label} = ". $j->{type} . "!\n";
+ return;
+ }
+ $cmd .= ", $j->{label} $conversions{$j->{type}}";
+ }
+ $cmd .= ", updated timestamp";
+ $cmd .= ", sysUpTime integer" if (defined($suffix));
+ $cmd .= ",key oidindex (oidindex), key host (host))";
+
+ print STDERR "cmd: $cmd\n" if ($verbose);
+ $dbh->do("$cmd")
+ or warn "\nnot ok: $cmd -> $DBI::errstr\n" if ($doit);
+
+}
+
+sub getoncall {
+ my @groups = @_;
+ my $cur;
+ my $row;
+ my ($emails, @days, @hours, @two, $i);
+ my %dayscon = qw(Sun 0 Mon 1 Tue 2 Wed 3 Thu 4 Fri 5 Sat 6);
+ my @now = localtime(time());
+ my %people;
+ my $group;
+
+ foreach $group (@groups) {
+ $cur = getcursor("select * from oncall where groupname = '$group'");
+ row: while ( $row = $cur->fetchrow_hashref ) {
+ @days = split(/,/,$row->{'days'});
+ foreach $i (@days) {
+ @two = split(/-/,$i);
+ if ($row->{'days'} eq "*" ||
+ (defined($dayscon{$i}) && $dayscon{$i} == $now[6]) ||
+ (defined($dayscon{$two[0]}) && defined($dayscon{$two[1]}) &&
+ (($dayscon{$two[0]} <= $now[6] &&
+ $dayscon{$two[1]} >= $now[6]) ||
+ (($dayscon{$two[0]} > $dayscon{$two[1]}) &&
+ ($dayscon{$two[0]} <= $now[6] ||
+ $dayscon{$two[1]} >= $now[6]))))) {
+ # we hit a valid day range
+ print STDERR " hit it $row->{'email'} $now[6]\t($i)\t$row->{'days'}\n"
+ if ($verbose);
+ $people{$row->{'email'}} = $row->{'email'};
+ } else {
+ print STDERR "not hit it $row->{'email'} $now[6]\t($i)\t$row->{'days'}\n"
+ if ($verbose);
+ }
+ }
+ }
+ }
+ return keys(%people);
+}
+
+sub getoncallforhost {
+ my $host = shift;
+ return getoncall(getgroupsforhost($host));
+}
+
+sub getcursor {
+ my $cmd = shift;
+ my $cursor;
+ print STDERR "cmd: $cmd\n" if ($verbose);
+ ( $cursor = $dbh->prepare( $cmd ))
+ or die "\nnot ok: $DBI::errstr\n";
+ ( $cursor->execute )
+ or print( "\tnot ok: $DBI::errstr\n" );
+ return $cursor;
+}
+
+my %expressions;
+sub getexpr {
+ my $table = shift;
+ print "ref: ",ref($expressions{$table}),"\n" if ($verbose);
+ if (!defined($expressions{$table})) {
+ my $exprs = getcursor("SELECT * FROM errorexpressions where (tablename = '$table')");
+ while ( $expr = $exprs->fetchrow_hashref ) {
+ push @{$expressions{$table}{'expr'}},$expr->{expression};
+ push @{$expressions{$table}{'returnfield'}},$expr->{returnfield};
+ }
+ }
+ if (ref($expressions{$table}) ne "HASH") {
+ # no expressions for this table.
+ $expressions{$table}{'expr'} = [];
+ $expressions{$table}{'returnfield'} = [];
+ }
+ return $expressions{$table};
+}
+
+sub checkrowforerrors {
+ my ($table, $host, $id) = @_;
+ my $error;
+
+ my $lastres = 0, $lastfield = '';
+ my $expressions = getexpr($table);
+ my $i;
+ for($i=0; $i <= $#{$expressions->{'expr'}}; $i++) {
+ if (!defined($expressions->{'prepared'}[$i])) {
+ $expressions->{'prepared'}[$i] = $dbh->prepare("select * from $table where $expressions->{'expr'}[$i] and host = ? and oidindex = ?")
+ or warn "\nnot ok: $DBI::errstr\n";
+ print STDERR "preparing select * from $table where $expressions->{'expr'}[$i] and host = ? and oidindex = ? ==> ",ref($expressions->{'prepared'}[$i]),"\n" if($verbose);
+ }
+ my $prepared = $expressions->{'prepared'}[$i];
+ print STDERR "x: ",ref($prepared),"\n" if($verbose);
+ $prepared->execute($host, $id) or warn "\nnot ok: $DBI::errstr\n";
+ while ( $error = $prepared->fetchrow_hashref ) {
+ print STDERR "$host: $expressions->{returnfield}[$i] = $error->{$expressions->{returnfield}[$i]}\n" if ($verbose);
+ return {'retval', 1,
+ 'errfield', $expressions->{returnfield}[$i],
+ 'errvalue', $error->{$expressions->{returnfield}[$i]}};
+ }
+ $lastres = $error->{$expressions->{returnfield}[$i]};
+ $lastfield = $expressions->{returnfield}[$i];
+ }
+ return {'retval', 0,
+ 'errfield', $lastfield,
+ 'errvalue', $lastres};
+}
+
+sub logerror {
+ my ($host, $err, $field, $result) = @_;
+ my $groups = getcursor("SELECT distinct groupname FROM hosttables where host = '$host'");
+ my ($group, $person);
+ my $msg = (($err) ? "error" : "normal");
+
+ my @people = getoncallforhost($host);
+ $msg = "$msg: $host";
+ $msg .= " $field = $result" if ($field || $result);
+ mailusers("SNMP: $msg: $host $field", "$msg\n", @people);
+}
+
+sub mailusers {
+ my $subject = shift;
+ my $msg = shift;
+ my @people = @_;
+ my $person;
+ my $smtpsock = Net::SMTP->new($smtpserver);
+
+ $smtpsock->mail($smtpfrom);
+ my $error = $smtpsock->recipient(@people);
+ if (!$error) {
+ print STDERR "failed to send mail to ",join(",",@people),"\n";
+ }
+ $smtpsock->data();
+ $subject =~ s/\n//;
+ $smtpsock->datasend("To: " . join(", ",@people) . "\n");
+ $smtpsock->datasend("From: $smtpfrom\n");
+ $smtpsock->datasend("Subject: $subject\n");
+ $smtpsock->datasend("\n");
+ $smtpsock->datasend("$msg\n");
+ $smtpsock->dataend();
+ $smtpsock->quit;
+ print STDERR "mailed ",join(",",@people)," with $msg, $subject ($!)\n" if ($verbose);
+}
+
+sub hosterror {
+ my $host = shift;
+ my $error = shift || "No response";
+ my $groups = getcursor("SELECT distinct groupname FROM hosttables where host = '$host'");
+ my ($group, $person);
+ my %mailed;
+
+ return if (isbadhost($host)); # only send out a message once.
+
+ $dbh->do("insert into hosterrors(host, errormsg) values('$host','$error');");
+ my @people = getoncallforhost($host);
+ mailusers("No Response from $host", "$host: $error", @people);
+}
+
+sub isbadhost {
+ my $host = shift;
+ my $hosterr = getcursor("SELECT distinct host FROM hosterrors where host = '$host'");
+ if ($hosterr->fetchrow_hashref) {
+ return 1;
+ }
+ return 0;
+}
+
+sub getgroupsforhost {
+ my $host = shift;
+ my @retgroups;
+ my $groups = getcursor("SELECT distinct groupname FROM hosttables where host = '$host'");
+ while( $group = $groups->fetchrow_hashref ) {
+ push @retgroups,$group->{'groupname'};
+ }
+ @retgroups;
+}
+
+sub get_children {
+ my $mib = shift;
+ my $children = $$mib{'children'};
+ if (ref($children) ne "ARRAY") {
+ warn "$mib has no chlidren";
+ return;
+ }
+
+ if ($#{$children} == 0 && $mib->{'label'} =~ /Table$/) {
+ # is a table, use entry?
+ $children = $children->[0]{'children'};
+ if (ref($children) ne "ARRAY") {
+ warn "$mib has no chlidren";
+ return;
+ }
+ }
+ return $children;
+}
diff --git a/python/LICENSE b/python/LICENSE
new file mode 100644
index 0000000..4c7638f
--- /dev/null
+++ b/python/LICENSE
@@ -0,0 +1,66 @@
+Various copyrights apply to this package, listed in various separate
+parts below. Please make sure that you read all the parts.
+
+---- Part 1: Sparta, Inc (BSD) -----
+
+Copyright (c) 2003-2010, Sparta, Inc
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* Neither the name of Sparta, Inc 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---- Part 2: ScienceLogic, LLC (BSD) ----
+
+Copyright (c) 2006, ScienceLogic, LLC
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* Neither the name of ScienceLogic, LLC 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
diff --git a/python/README b/python/README
new file mode 100644
index 0000000..f998f8b
--- /dev/null
+++ b/python/README
@@ -0,0 +1,365 @@
+ The Python 'netsnmp' Extension Module
+ for the Net-SNMP Library
+
+Contents:
+ Introduction:
+ Availability:
+ Contact:
+ Supported Platforms:
+ Release Notes:
+ Installation:
+ Operational Description:
+ Trouble Shooting:
+ Acknowledgments:
+ License/Copyright:
+
+Introduction:
+
+ This is the Python 'netsnmp' extension module. The 'netsnmp' module
+ provides a full featured, tri-lingual SNMP (SNMPv3, SNMPv2c,
+ SNMPv1) client API. The 'netsnmp' module internals rely on the
+ Net-SNMP toolkit library. For information on the Net-SNMP library
+ see the documentation provided with the Net-SNMP distribution or
+ the project web page available on 'Source Forge':
+
+ http://www.net-snmp.org/
+
+Availability:
+
+ The most recent release of the Python 'netsnmp' module can be found
+ bundled with the latest Net-SNMP distribution available from:
+
+ http://www.net-snmp.org/download.html
+
+Contact:
+
+ The following mailing list should be consider the primary support
+ mechanism for this module:
+
+ net-snmp-users@lists.sourceforge.net mail list
+
+ (see http://www.net-snmp.org/lists/users/ to subscribe)
+
+Supported Platforms:
+
+ Linux 2.x
+ Other UNIX/POSIX variants (untested)
+ MS Windows (untested)
+
+ Let us know where it *doesn't* work, as it should on most systems
+
+Release Notes:
+
+ This initial alpha release of the Python 'netsnmp' extension module
+ has been developed against net-snmp 5.4.pre1.
+
+ Only syncronous, client-side functionality is implemented.
+
+ Access to the parsed MIB database is not yet implemented.
+
+KNOWN BUGS:
+
+ Too many to mention at this point
+
+Installation:
+
+ Build and install the Net-SNMP package - see Net-SNMP README and
+ INSTALL docs.
+
+ Unix:
+
+ cd net-snmp/python
+ python setup.py build
+ python setup.py test (requires a locally running agent w/ config provided)
+ python setup.py install
+
+
+Operational Description:
+
+ The basic operations of the SNMP protocol are provided by this
+ module through an object oriented interface for modularity and ease
+ of use. The primary class is netsnmp.Session which encapsulates
+ the persistent aspects of a connection between the management
+ application and the managed agent. This class supplies 'get',
+ 'getnext', 'getbulk', 'set' and other method calls.
+
+ A description of the fields which can be specified when instantiating an
+ netsnmp.Session follows:
+
+ netsnmp.Session(<tag>=<value>, ... )
+
+ DestHost - default 'localhost', hostname or ip addr of SNMP agent
+ Version - default '3', [1, 2 (equiv to 2c), 3]
+ RemotePort - default '161', allow remote UDP port to be overridden
+ Timeout - default '500000', micro-seconds before retry
+ Retries - default '3', retries before failure
+ RetryNoSuch - default '0', if enabled NOSUCH errors in 'get' pdus will
+ be repaired, removing the varbind in error, and resent -
+ undef will be returned for all NOSUCH varbinds, when set
+ to '0' this feature is disabled and the entire get request
+ will fail on any NOSUCH error (applies to v1 only)
+ UseLongNames - set to non-zero to have <tags> for 'getnext' methods
+ generated preferring longer Mib name convention (e.g.,
+ system.sysDescr vs just sysDescr)
+ UseSprintValue - set to non-zero to have return values
+ for 'get' and 'getnext' methods formatted with the libraries
+ sprint_value function. This will result in certain data types
+ being returned in non-canonical format Note: values returned
+ with this option set may not be appropriate for 'set'
+ operations (see discussion of value formats in <vars>
+ description section)
+ UseEnums - set to non-zero to have integer return values
+ converted to enumeration identifiers if possible,
+ these values will also be acceptable when supplied to
+ 'set' operations
+ UseNumeric - set to non-zero to have <tags> returned by the 'get'
+ methods untranslated (i.e. dotted-decimal). Setting the
+ UseLongNames value for the session is highly recommended.
+ BestGuess - this setting controls how <tags> are parsed. setting
+ to 0 causes a regular lookup. setting to 1 causes a regular
+ expression match (defined as -Ib in snmpcmd). setting to 2
+ causes a random access lookup (defined as -IR in snmpcmd).
+ ErrorStr - read-only, holds the error message assoc. w/ last request
+ ErrorNum - read-only, holds the snmp_err or status of last request
+ ErrorInd - read-only, holds the snmp_err_index when appropriate
+
+ SNMPv1/SNMPv2c options:
+ Community - default 'public', SNMP community string (used for both R/W)
+
+ SNMPv3 Options:
+ SecName - default 'initial', security name (v3)
+ SecLevel - default 'noAuthNoPriv', security level [noAuthNoPriv,
+ authNoPriv, authPriv] (v3)
+ ContextEngineId - default <SecEngineId>, context engineID, will be
+ probed if not supplied (v3)
+ Context - default '', context name (v3)
+
+ SNMPv3 over TLS or DTLS options:
+ OurIdentity - The fingerprint or file name for the local X.509
+ certificate to use for our identity. Run
+ net-snmp-cert to create and manage certificates.
+ TheirIdentity - The fingerprint or file name for the local X.509
+ certificate to use for their identity.
+ TrustCert - A trusted certificate to use for validating
+ certificates. Typically this would be a CA
+ certificate.
+ TheirHostname - Their hostname to expect. Either "TheirIdentity"
+ or a trusted certificate plus a hostname is needed
+ to validate the server is the proper server.
+
+ SNMPv3 with USM security Options:
+ SecEngineId - default <none>, security engineID, will be probed if not
+ supplied (v3)
+ AuthProto - default 'MD5', authentication protocol [MD5, SHA] (v3)
+ AuthPass - default <none>, authentication passphrase
+ PrivProto - default 'DES', privacy protocol [DES] (v3)
+ PrivPass - default <none>, privacy passphrase (v3)
+
+ private:
+ sess_ptr - internal field used to cache a created session structure
+
+ methods:
+
+ get(<netsnmp.VarList object>)
+ - SNMP GET a netsnmp.VarList object must be supplied,
+ returns a tuple of values for each varbind in list
+
+ getnext(<netsnmp.VarList object>)
+ - SNMP GETNEXT, a netsnmp.VarList object must be supplied
+ returns retrieved value(s), VarList passed as arguments
+ are updated to return a list of next lexicographical
+ Varbind objects. returns a tuple of values for each
+ varbind in list
+
+ set(<netsnmp.VarList object>)
+ - SNMP SET, a netsnmp.VarList object must be supplied
+ the value field in all Varbinds must be in a canonical
+ format (i.e., well known format) to ensure unambiguous
+ translation to SNMP MIB data value (see discussion of
+ canonical value format <vars> description section),
+ returns true on success or None on error.
+
+ getbulk(<non-repeaters>, <max-repeaters>, <netsnmp.VarList object>)
+ - SNMP GETBULK, a netsnmp.VarList object must be supplied
+ the single next lexico instance is fetched for the first
+ n Varbinds in the list as defined by <non-repeaters>.
+ For the remaining Varbinds, the next m lexico instances
+ are retrieved each of the remaining Varbinds,
+ where m is <max-repeaters>. Returns a tuple of values
+ retrieved.
+
+ walk(<netsnmp.VarList object>)
+ - Performs multiple GETNEXT requests in order to
+ return a tuple of values retrieved from the MIB
+ below the Varbind passed in. The VarList passed
+ in will be updated to contain a complete set of
+ Varbinds created for the results of the walk.
+
+ Note that only one varbind should be contained in the
+ VarList passed in. The code is structured to maybe
+ handle this is the the future, but right now walking
+ multiple trees at once is not yet supported and will
+ produce insufficient results.
+
+
+ Acceptable variable formats:
+
+ netsnmp.VarList: - represents an list of Varbind objects to get or set.
+ takes are arguments and unspecified number of Varbinds,
+ or tuples which will be converted to Varbinds.
+
+
+ netsnmp.Varbind: - represents a single MIB object to get or set
+ implemented as Python[<tag>, <iid>, <val>, <type>].
+ <tag> - one of the following forms:
+ 1) leaf identifier (e.g., 'sysDescr') assumed to be
+ unique for practical purposes
+ 2) fully qualified identifier (e.g.,
+ '.iso.org.dod.internet.mgmt.mib-2.system.sysDescr')
+ 3) fully qualified, dotted-decimal, numeric OID
+ (e.g., '.1.3.6.1.2.1.1.1')
+ <iid> - the dotted-decimal, instance identifier. for
+ scalar MIB objects use '0'
+ <val> - the SNMP data value retrieved from or being set
+ to the agents MIB. for set operations the <val>
+ format must be canonical to ensure unambiguous
+ translation. The canonical forms are as follows:
+ OBJECTID => dotted-decimal (e.g., .1.3.6.1.2.1.1.1)
+ OCTETSTR => perl scalar containing octets,
+ INTEGER => decimal signed integer (or enum),
+ NETADDR => dotted-decimal,
+ IPADDR => dotted-decimal,
+ COUNTER => decimal unsigned integer,
+ COUNTER64 => decimal unsigned integer,
+ GAUGE, => decimal unsigned integer,
+ UINTEGER, => decimal unsigned integer,
+ TICKS, => decimal unsigned integer,
+ OPAQUE => perl scalar containing octets,
+ NULL, => perl scalar containing nothing,
+
+ <type> - SNMP data type (see list above), this field is
+ populated by 'get' and 'getnext' operations. In
+ some cases the programmer needs to populate this
+ field when passing to a 'set' operation. this
+ field need not be supplied when the attribute
+ indicated by <tag> is already described in the
+ parsed MIB. for 'set's, if a numeric OID is used
+ and the object is not in the parsed MIB,
+ the <type> field must be supplied
+
+
+ Python 'netsnmp' package variables and functions:
+
+
+ netsnmp.verbose - default '0',
+ controls warning/info output of themodule
+ 0 => no output,
+ 1 => enables warning/info
+
+(needs implementation)
+ $SNMP::debugging - default '0', controls debugging output level
+ within SNMP module and libsnmp
+ 1 => enables 'SNMP::verbose' (see above)
+ 2 => level 1 plus snmp_set_do_debugging(1),
+ 3 => level 2 plus snmp_set_dump_packet(1)
+
+ $SNMP::dump_packet - default '0', set [non-]zero to independently set
+ snmp_set_dump_packet()
+
+ Exported 'netsnmp' package utility functions:
+
+ snmpget(<Varbind/VarList>, <Session args>)
+ - takes args of netsnmp.Session preceded by those of the
+ corresponding netsnmp.Session method. Returns a tuple with
+ Varbind values fetched, and input is updated to contain
+ complete Varbinds fetched.
+
+ snmpgetnext(<Varbind/VarList>, <Session args>)
+ - takes args of netsnmp.Session preceded by those of the
+ corresponding netsnmp.Session method. Returns a tuple with
+ Varbind values fetched, and input is updated to contain
+ complete Varbinds fetched.
+
+ snmpgetbulk(nonrepeaters, maxrepetitions,<VarList>, <Session args>)
+ - takes args of netsnmp.Session preceded by those of the
+ corresponding netsnmp.Session method. Returns a tuple with
+ Varbind values fetched, and VarList is updated to contain
+ complete Varbinds fetched.
+
+ snmpset(<Varbind/VarList>, <Session args>)
+ - takes args of netsnmp.Session preceded by those of the
+ corresponding netsnmp.Session method. returns True on success,
+ otherwise False.
+
+ snmpwalk(<Varbind/VarList>, <Session args>))
+ - takes args of netsnmp.Session preceded by a Varbind or
+ VarList from which the 'walk' operation will start.
+ Returns a tuple of values retrieved from the MIB below
+ the Varbind passed in. If a VarList is passed in it
+ will be updated to contain a complete set of VarBinds
+ created for the results of the walk. It is not
+ recommended to pass in just a Varbind since you loose
+ the ability to examine the returned OIDs. But, if only
+ a Varbind is passed in it will be returned unaltered.
+
+ Note that only one varbind should be contained in the
+ VarList passed in. The code is structured to maybe
+ handle this is the the future, but right now walking
+ multiple trees at once is not yet supported and will
+ produce insufficient results.
+
+Trouble Shooting:
+
+ If problems occur there are number areas to look at to narrow down the
+ possibilities.
+
+ The first step should be to test the Net-SNMP installation
+ independently from the Python 'netsnmp' Extension.
+
+ Try running the apps from the Net-SNMP distribution.
+
+ Make sure your agent (snmpd) is running and properly configured with
+ read-write access for the community you are using.
+
+ Ensure that your MIBs are installed and environment variables are set
+ appropriately (see man mib_api)
+
+ Be sure to ensure headers and libraries from old CMU installations are
+ not being used by mistake (see -NET-SNMP-PATH).
+
+ If the problem occurs during compilation/linking check that the snmp
+ library being linked is actually the Net-SNMP library (there have been
+ name conflicts with existing snmp libs).
+
+ Also check that the header files are correct and up to date.
+
+ Sometimes compiling the Net-SNMP library with
+ 'position-independent-code' enabled is required (HPUX specifically).
+
+ If you cannot resolve the problem you can email
+ net-snmp-users@lists.sourceforge.net.
+
+ Please give sufficient information to analyze the problem (OS type,
+ versions for OS/python/net-SNMP/compiler, complete error output, etc.)
+
+Acknowledgments:
+
+ Giovanni Marzot (the original author)
+ ScienceLogic, LLC sponsored the initial development of this module.
+ Wes Hardaker and the net-snmp-coders
+
+ Thanks in advance to any who supply patches, suggestions and feedback.
+
+License:
+
+ Please see the LICENSE file contained with this package
+
+Copyright:
+
+ Copyright (c) 2006 G. S. Marzot. All rights reserved.
+ This program is free software; you can redistribute it and/or
+ modify it under the same terms as Net-SNMP itself.
+
+ Copyright (c) 2006 SPARTA, Inc. All Rights Reserved. This
+ program is free software; you can redistribute it and/or modify
+ it under the same terms as Net-SNMP itself.
diff --git a/python/netsnmp/__init__.py b/python/netsnmp/__init__.py
new file mode 100644
index 0000000..1d20dac
--- /dev/null
+++ b/python/netsnmp/__init__.py
@@ -0,0 +1 @@
+from client import *
diff --git a/python/netsnmp/client.py b/python/netsnmp/client.py
new file mode 100644
index 0000000..6fc4b2e
--- /dev/null
+++ b/python/netsnmp/client.py
@@ -0,0 +1,266 @@
+import client_intf
+import string
+import re
+import types
+from sys import stderr
+
+# control verbosity of error output
+verbose = 1
+
+secLevelMap = { 'noAuthNoPriv':1, 'authNoPriv':2, 'authPriv':3 }
+
+def _parse_session_args(kargs):
+ sessArgs = {
+ 'Version':3,
+ 'DestHost':'localhost',
+ 'Community':'public',
+ 'Timeout':1000000,
+ 'Retries':3,
+ 'RemotePort':161,
+ 'LocalPort':0,
+ 'SecLevel':'noAuthNoPriv',
+ 'SecName':'initial',
+ 'PrivProto':'DEFAULT',
+ 'PrivPass':'',
+ 'AuthProto':'DEFAULT',
+ 'AuthPass':'',
+ 'ContextEngineId':'',
+ 'SecEngineId':'',
+ 'Context':'',
+ 'Engineboots':0,
+ 'Enginetime':0,
+ 'UseNumeric':0,
+ 'OurIdentity':'',
+ 'TheirIdentity':'',
+ 'TheirHostname':'',
+ 'TrustCert':''
+ }
+ keys = kargs.keys()
+ for key in keys:
+ if sessArgs.has_key(key):
+ sessArgs[key] = kargs[key]
+ else:
+ print >>stderr, "ERROR: unknown key", key
+ return sessArgs
+
+def STR(obj):
+ if obj != None:
+ obj = str(obj)
+ return obj
+
+
+class Varbind(object):
+ def __init__(self, tag=None, iid=None, val=None, type=None):
+ self.tag = STR(tag)
+ self.iid = STR(iid)
+ self.val = STR(val)
+ self.type = STR(type)
+ # parse iid out of tag if needed
+ if iid == None and tag != None:
+ regex = re.compile(r'^((?:\.\d+)+|(?:\w+(?:[-:]*\w+)+))\.?(.*)$')
+ match = regex.match(tag)
+ if match:
+ (self.tag, self.iid) = match.group(1,2)
+
+ def __setattr__(self, name, val):
+ self.__dict__[name] = STR(val)
+
+ def print_str(self):
+ return self.tag, self.iid, self.val, self.type
+
+
+class VarList(object):
+ def __init__(self, *vs):
+ self.varbinds = []
+
+ for var in vs:
+ if isinstance(var, netsnmp.client.Varbind):
+ self.varbinds.append(var)
+ else:
+ self.varbinds.append(Varbind(var))
+
+ def __len__(self):
+ return len(self.varbinds)
+
+ def __getitem__(self, index):
+ return self.varbinds[index]
+
+ def __setitem__(self, index, val):
+ if isinstance(val, netsnmp.client.Varbind):
+ self.varbinds[index] = val
+ else:
+ raise TypeError
+
+ def __iter__(self):
+ return iter(self.varbinds)
+
+ def __delitem__(self, index):
+ del self.varbinds[index]
+
+ def __repr__(self):
+ return repr(self.varbinds)
+
+ def __getslice__(self, i, j):
+ return self.varbinds[i:j]
+
+ def append(self, *vars):
+ for var in vars:
+ if isinstance(var, netsnmp.client.Varbind):
+ self.varbinds.append(var)
+ else:
+ raise TypeError
+
+
+
+class Session(object):
+ def __init__(self, **args):
+ self.sess_ptr = None
+ self.UseLongNames = 0
+ self.UseNumeric = 0
+ self.UseSprintValue = 0
+ self.UseEnums = 0
+ self.BestGuess = 0
+ self.RetryNoSuch = 0
+ self.ErrorStr = ''
+ self.ErrorNum = 0
+ self.ErrorInd = 0
+
+ sess_args = _parse_session_args(args)
+
+ for k,v in sess_args.items():
+ self.__dict__[k] = v
+
+
+ # check for transports that may be tunneled
+ transportCheck = re.compile('^(tls|dtls|ssh)');
+ match = transportCheck.match(sess_args['DestHost'])
+
+ if match:
+ self.sess_ptr = client_intf.session_tunneled(
+ sess_args['Version'],
+ sess_args['DestHost'],
+ sess_args['LocalPort'],
+ sess_args['Retries'],
+ sess_args['Timeout'],
+ sess_args['SecName'],
+ secLevelMap[sess_args['SecLevel']],
+ sess_args['ContextEngineId'],
+ sess_args['Context'],
+ sess_args['OurIdentity'],
+ sess_args['TheirIdentity'],
+ sess_args['TheirHostname'],
+ sess_args['TrustCert'],
+ );
+ elif sess_args['Version'] == 3:
+ self.sess_ptr = client_intf.session_v3(
+ sess_args['Version'],
+ sess_args['DestHost'],
+ sess_args['LocalPort'],
+ sess_args['Retries'],
+ sess_args['Timeout'],
+ sess_args['SecName'],
+ secLevelMap[sess_args['SecLevel']],
+ sess_args['SecEngineId'],
+ sess_args['ContextEngineId'],
+ sess_args['Context'],
+ sess_args['AuthProto'],
+ sess_args['AuthPass'],
+ sess_args['PrivProto'],
+ sess_args['PrivPass'],
+ sess_args['Engineboots'],
+ sess_args['Enginetime'])
+ else:
+ self.sess_ptr = client_intf.session(
+ sess_args['Version'],
+ sess_args['Community'],
+ sess_args['DestHost'],
+ sess_args['LocalPort'],
+ sess_args['Retries'],
+ sess_args['Timeout'])
+
+ def get(self, varlist):
+ res = client_intf.get(self, varlist)
+ return res
+
+ def set(self, varlist):
+ res = client_intf.set(self, varlist)
+ return res
+
+ def getnext(self, varlist):
+ res = client_intf.getnext(self, varlist)
+ return res
+
+ def getbulk(self, nonrepeaters, maxrepetitions, varlist):
+ if self.Version == 1:
+ return None
+ res = client_intf.getbulk(self, nonrepeaters, maxrepetitions, varlist)
+ return res
+
+ def walk(self, varlist):
+ res = client_intf.walk(self, varlist)
+ return res
+
+ def __del__(self):
+ res = client_intf.delete_session(self)
+ return res
+
+import netsnmp
+
+def snmpget(*args, **kargs):
+ sess = Session(**kargs)
+ var_list = VarList()
+ for arg in args:
+ if isinstance(arg, netsnmp.client.Varbind):
+ var_list.append(arg)
+ else:
+ var_list.append(Varbind(arg))
+ res = sess.get(var_list)
+ return res
+
+def snmpset(*args, **kargs):
+ sess = Session(**kargs)
+ var_list = VarList()
+ for arg in args:
+ if isinstance(arg, netsnmp.client.Varbind):
+ var_list.append(arg)
+ else:
+ var_list.append(Varbind(arg))
+ res = sess.set(var_list)
+ return res
+
+def snmpgetnext(*args, **kargs):
+ sess = Session(**kargs)
+ var_list = VarList()
+ for arg in args:
+ if isinstance(arg, netsnmp.client.Varbind):
+ var_list.append(arg)
+ else:
+ var_list.append(Varbind(arg))
+ res = sess.getnext(var_list)
+ return res
+
+def snmpgetbulk(nonrepeaters, maxrepetitions,*args, **kargs):
+ sess = Session(**kargs)
+ var_list = VarList()
+ for arg in args:
+ if isinstance(arg, netsnmp.client.Varbind):
+ var_list.append(arg)
+ else:
+ var_list.append(Varbind(arg))
+ res = sess.getbulk(nonrepeaters, maxrepetitions, var_list)
+ return res
+
+def snmpwalk(*args, **kargs):
+ sess = Session(**kargs)
+ if isinstance(args[0], netsnmp.client.VarList):
+ var_list = args[0]
+ else:
+ var_list = VarList()
+ for arg in args:
+ if isinstance(arg, netsnmp.client.Varbind):
+ var_list.append(arg)
+ else:
+ var_list.append(Varbind(arg))
+ res = sess.walk(var_list)
+ return res
+
diff --git a/python/netsnmp/client_intf.c b/python/netsnmp/client_intf.c
new file mode 100644
index 0000000..0b74e0e
--- /dev/null
+++ b/python/netsnmp/client_intf.c
@@ -0,0 +1,2601 @@
+#include <Python.h>
+
+#if PY_VERSION_HEX < 0x02050000
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <sys/types.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#include <stdio.h>
+#include <ctype.h>
+#ifdef I_SYS_TIME
+#include <sys/time.h>
+#endif
+#include <netdb.h>
+#include <stdlib.h>
+
+#ifdef HAVE_REGEX_H
+#include <regex.h>
+#endif
+
+#define SUCCESS 1
+#define FAILURE 0
+
+#define VARBIND_TAG_F 0
+#define VARBIND_IID_F 1
+#define VARBIND_VAL_F 2
+#define VARBIND_TYPE_F 3
+
+#define TYPE_UNKNOWN 0
+#define MAX_TYPE_NAME_LEN 32
+#define STR_BUF_SIZE (MAX_TYPE_NAME_LEN * MAX_OID_LEN)
+#define ENG_ID_BUF_SIZE 32
+
+#define NO_RETRY_NOSUCH 0
+
+/* these should be part of transform_oids.h ? */
+#define USM_AUTH_PROTO_MD5_LEN 10
+#define USM_AUTH_PROTO_SHA_LEN 10
+#define USM_PRIV_PROTO_DES_LEN 10
+
+#define STRLEN(x) (x ? strlen(x) : 0)
+
+/* from perl/SNMP/perlsnmp.h: */
+#ifndef timeradd
+#define timeradd(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
+ if ((result)->tv_usec >= 1000000) \
+ { \
+ ++(result)->tv_sec; \
+ (result)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+#endif
+
+#ifndef timersub
+#define timersub(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif
+
+typedef netsnmp_session SnmpSession;
+typedef struct tree SnmpMibNode;
+static int __is_numeric_oid (char*);
+static int __is_leaf (struct tree*);
+static int __translate_appl_type (char*);
+static int __translate_asn_type (int);
+static int __snprint_value (char *, size_t,
+ netsnmp_variable_list*, struct tree *,
+ int, int);
+static int __sprint_num_objid (char *, oid *, int);
+static int __scan_num_objid (char *, oid *, size_t *);
+static int __get_type_str (int, char *);
+static int __get_label_iid (char *, char **, char **, int);
+static struct tree * __tag2oid (char *, char *, oid *, int *, int *, int);
+static int __concat_oid_str (oid *, int *, char *);
+static int __add_var_val_str (netsnmp_pdu *, oid *, int, char *,
+ int, int);
+#define USE_NUMERIC_OIDS 0x08
+#define NON_LEAF_NAME 0x04
+#define USE_LONG_NAMES 0x02
+#define FAIL_ON_NULL_IID 0x01
+#define NO_FLAGS 0x00
+
+
+/* Wrapper around fprintf(stderr, ...) for clean and easy debug output. */
+static int _debug_level = 0;
+#ifdef DEBUGGING
+#define DBPRT(severity, otherargs) \
+ do { \
+ if (_debug_level && severity <= _debug_level) { \
+ (void)printf(otherargs); \
+ } \
+ } while (/*CONSTCOND*/0)
+#else /* DEBUGGING */
+#define DBPRT(severity, otherargs) /* Ignore */
+#endif /* DEBUGGING */
+
+#define SAFE_FREE(x) do {if (x != NULL) free(x);} while(/*CONSTCOND*/0)
+
+void
+__libraries_init(char *appname)
+{
+ static int have_inited = 0;
+
+ if (have_inited)
+ return;
+ have_inited = 1;
+
+ snmp_set_quick_print(1);
+ snmp_enable_stderrlog();
+ init_snmp(appname);
+
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS, 1);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY, 1);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_SUFFIX);
+}
+
+static int
+__is_numeric_oid (oidstr)
+char* oidstr;
+{
+ if (!oidstr) return 0;
+ for (; *oidstr; oidstr++) {
+ if (isalpha((int)*oidstr)) return 0;
+ }
+ return(1);
+}
+
+static int
+__is_leaf (tp)
+struct tree* tp;
+{
+ char buf[MAX_TYPE_NAME_LEN];
+ return (tp && (__get_type_str(tp->type,buf) ||
+ (tp->parent && __get_type_str(tp->parent->type,buf) )));
+}
+
+static int
+__translate_appl_type(typestr)
+char* typestr;
+{
+ if (typestr == NULL || *typestr == '\0') return TYPE_UNKNOWN;
+
+ if (!strncasecmp(typestr,"INTEGER32",8))
+ return(TYPE_INTEGER32);
+ if (!strncasecmp(typestr,"INTEGER",3))
+ return(TYPE_INTEGER);
+ if (!strncasecmp(typestr,"UNSIGNED32",3))
+ return(TYPE_UNSIGNED32);
+ if (!strcasecmp(typestr,"COUNTER")) /* check all in case counter64 */
+ return(TYPE_COUNTER);
+ if (!strncasecmp(typestr,"GAUGE",3))
+ return(TYPE_GAUGE);
+ if (!strncasecmp(typestr,"IPADDR",3))
+ return(TYPE_IPADDR);
+ if (!strncasecmp(typestr,"OCTETSTR",3))
+ return(TYPE_OCTETSTR);
+ if (!strncasecmp(typestr,"TICKS",3))
+ return(TYPE_TIMETICKS);
+ if (!strncasecmp(typestr,"OPAQUE",3))
+ return(TYPE_OPAQUE);
+ if (!strncasecmp(typestr,"OBJECTID",3))
+ return(TYPE_OBJID);
+ if (!strncasecmp(typestr,"NETADDR",3))
+ return(TYPE_NETADDR);
+ if (!strncasecmp(typestr,"COUNTER64",3))
+ return(TYPE_COUNTER64);
+ if (!strncasecmp(typestr,"NULL",3))
+ return(TYPE_NULL);
+ if (!strncasecmp(typestr,"BITS",3))
+ return(TYPE_BITSTRING);
+ if (!strncasecmp(typestr,"ENDOFMIBVIEW",3))
+ return(SNMP_ENDOFMIBVIEW);
+ if (!strncasecmp(typestr,"NOSUCHOBJECT",7))
+ return(SNMP_NOSUCHOBJECT);
+ if (!strncasecmp(typestr,"NOSUCHINSTANCE",7))
+ return(SNMP_NOSUCHINSTANCE);
+ if (!strncasecmp(typestr,"UINTEGER",3))
+ return(TYPE_UINTEGER); /* historic - should not show up */
+ /* but it does? */
+ if (!strncasecmp(typestr, "NOTIF", 3))
+ return(TYPE_NOTIFTYPE);
+ if (!strncasecmp(typestr, "TRAP", 4))
+ return(TYPE_TRAPTYPE);
+ return(TYPE_UNKNOWN);
+}
+
+static int
+__translate_asn_type(type)
+int type;
+{
+ switch (type) {
+ case ASN_INTEGER:
+ return(TYPE_INTEGER);
+ case ASN_OCTET_STR:
+ return(TYPE_OCTETSTR);
+ case ASN_OPAQUE:
+ return(TYPE_OPAQUE);
+ case ASN_OBJECT_ID:
+ return(TYPE_OBJID);
+ case ASN_TIMETICKS:
+ return(TYPE_TIMETICKS);
+ case ASN_GAUGE:
+ return(TYPE_GAUGE);
+ case ASN_COUNTER:
+ return(TYPE_COUNTER);
+ case ASN_IPADDRESS:
+ return(TYPE_IPADDR);
+ case ASN_BIT_STR:
+ return(TYPE_BITSTRING);
+ case ASN_NULL:
+ return(TYPE_NULL);
+ /* no translation for these exception type values */
+ case SNMP_ENDOFMIBVIEW:
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ return(type);
+ case ASN_UINTEGER:
+ return(TYPE_UINTEGER);
+ case ASN_COUNTER64:
+ return(TYPE_COUNTER64);
+ default:
+ fprintf(stderr, "translate_asn_type: unhandled asn type (%d)\n",type);
+ return(TYPE_OTHER);
+ }
+}
+
+#define USE_BASIC 0
+#define USE_ENUMS 1
+#define USE_SPRINT_VALUE 2
+static int
+__snprint_value (buf, buf_len, var, tp, type, flag)
+char * buf;
+size_t buf_len;
+netsnmp_variable_list * var;
+struct tree * tp;
+int type;
+int flag;
+{
+ int len = 0;
+ u_char* ip;
+ struct enum_list *ep;
+
+
+ buf[0] = '\0';
+ if (flag == USE_SPRINT_VALUE) {
+ snprint_value(buf, buf_len, var->name, var->name_length, var);
+ len = STRLEN(buf);
+ } else {
+ switch (var->type) {
+ case ASN_INTEGER:
+ if (flag == USE_ENUMS) {
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (ep->value == *var->val.integer) {
+ strlcpy(buf, ep->label, buf_len);
+ len = STRLEN(buf);
+ break;
+ }
+ }
+ }
+ if (!len) {
+ snprintf(buf, buf_len, "%ld", *var->val.integer);
+ len = STRLEN(buf);
+ }
+ break;
+
+ case ASN_GAUGE:
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ snprintf(buf, buf_len, "%lu", (unsigned long) *var->val.integer);
+ len = STRLEN(buf);
+ break;
+
+ case ASN_OCTET_STR:
+ case ASN_OPAQUE:
+ len = var->val_len;
+ if (len > buf_len)
+ len = buf_len;
+ memcpy(buf, (char*)var->val.string, len);
+ break;
+
+ case ASN_IPADDRESS:
+ ip = (u_char*)var->val.string;
+ snprintf(buf, buf_len, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
+ len = STRLEN(buf);
+ break;
+
+ case ASN_NULL:
+ break;
+
+ case ASN_OBJECT_ID:
+ __sprint_num_objid(buf, (oid *)(var->val.objid),
+ var->val_len/sizeof(oid));
+ len = STRLEN(buf);
+ break;
+
+ case SNMP_ENDOFMIBVIEW:
+ snprintf(buf, buf_len, "%s", "ENDOFMIBVIEW");
+ break;
+ case SNMP_NOSUCHOBJECT:
+ snprintf(buf, buf_len, "%s", "NOSUCHOBJECT");
+ break;
+ case SNMP_NOSUCHINSTANCE:
+ snprintf(buf, buf_len, "%s", "NOSUCHINSTANCE");
+ break;
+
+ case ASN_COUNTER64:
+#ifdef OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_COUNTER64:
+ case ASN_OPAQUE_U64:
+#endif
+ printU64(buf,(struct counter64 *)var->val.counter64);
+ len = STRLEN(buf);
+ break;
+
+#ifdef OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_I64:
+ printI64(buf,(struct counter64 *)var->val.counter64);
+ len = STRLEN(buf);
+ break;
+#endif
+
+ case ASN_BIT_STR:
+ snprint_bitstring(buf, buf_len, var, NULL, NULL, NULL);
+ len = STRLEN(buf);
+ break;
+#ifdef OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_FLOAT:
+ if (var->val.floatVal)
+ snprintf(buf, buf_len, "%f", *var->val.floatVal);
+ break;
+
+ case ASN_OPAQUE_DOUBLE:
+ if (var->val.doubleVal)
+ snprintf(buf, buf_len, "%f", *var->val.doubleVal);
+ break;
+#endif
+
+ case ASN_NSAP:
+ default:
+ fprintf(stderr,"snprint_value: asn type not handled %d\n",var->type);
+ }
+ }
+ return(len);
+}
+
+static int
+__sprint_num_objid (buf, objid, len)
+char *buf;
+oid *objid;
+int len;
+{
+ int i;
+ buf[0] = '\0';
+ for (i=0; i < len; i++) {
+ sprintf(buf,".%lu",*objid++);
+ buf += STRLEN(buf);
+ }
+ return SUCCESS;
+}
+
+static int
+__scan_num_objid (buf, objid, len)
+char *buf;
+oid *objid;
+size_t *len;
+{
+ char *cp;
+ *len = 0;
+ if (*buf == '.') buf++;
+ cp = buf;
+ while (*buf) {
+ if (*buf++ == '.') {
+ sscanf(cp, "%lu", objid++);
+ /* *objid++ = atoi(cp); */
+ (*len)++;
+ cp = buf;
+ } else {
+ if (isalpha((int)*buf)) {
+ return FAILURE;
+ }
+ }
+ }
+ sscanf(cp, "%lu", objid++);
+ /* *objid++ = atoi(cp); */
+ (*len)++;
+ return SUCCESS;
+}
+
+static int
+__get_type_str (type, str)
+int type;
+char * str;
+{
+ switch (type) {
+ case TYPE_OBJID:
+ strcpy(str, "OBJECTID");
+ break;
+ case TYPE_OCTETSTR:
+ strcpy(str, "OCTETSTR");
+ break;
+ case TYPE_INTEGER:
+ strcpy(str, "INTEGER");
+ break;
+ case TYPE_INTEGER32:
+ strcpy(str, "INTEGER32");
+ break;
+ case TYPE_UNSIGNED32:
+ strcpy(str, "UNSIGNED32");
+ break;
+ case TYPE_NETADDR:
+ strcpy(str, "NETADDR");
+ break;
+ case TYPE_IPADDR:
+ strcpy(str, "IPADDR");
+ break;
+ case TYPE_COUNTER:
+ strcpy(str, "COUNTER");
+ break;
+ case TYPE_GAUGE:
+ strcpy(str, "GAUGE");
+ break;
+ case TYPE_TIMETICKS:
+ strcpy(str, "TICKS");
+ break;
+ case TYPE_OPAQUE:
+ strcpy(str, "OPAQUE");
+ break;
+ case TYPE_COUNTER64:
+ strcpy(str, "COUNTER64");
+ break;
+ case TYPE_NULL:
+ strcpy(str, "NULL");
+ break;
+ case SNMP_ENDOFMIBVIEW:
+ strcpy(str, "ENDOFMIBVIEW");
+ break;
+ case SNMP_NOSUCHOBJECT:
+ strcpy(str, "NOSUCHOBJECT");
+ break;
+ case SNMP_NOSUCHINSTANCE:
+ strcpy(str, "NOSUCHINSTANCE");
+ break;
+ case TYPE_UINTEGER:
+ strcpy(str, "UINTEGER"); /* historic - should not show up */
+ /* but it does? */
+ break;
+ case TYPE_NOTIFTYPE:
+ strcpy(str, "NOTIF");
+ break;
+ case TYPE_BITSTRING:
+ strcpy(str, "BITS");
+ break;
+ case TYPE_TRAPTYPE:
+ strcpy(str, "TRAP");
+ break;
+ case TYPE_OTHER: /* not sure if this is a valid leaf type?? */
+ case TYPE_NSAPADDRESS:
+ default: /* unsupported types for now */
+ strcpy(str, "");
+ if (_debug_level) printf("__get_type_str:FAILURE(%d)\n", type);
+
+ return(FAILURE);
+ }
+ return SUCCESS;
+}
+
+/* does a destructive disection of <label1>...<labeln>.<iid> returning
+ <labeln> and <iid> in seperate strings (note: will destructively
+ alter input string, 'name') */
+static int
+__get_label_iid (name, last_label, iid, flag)
+char * name;
+char ** last_label;
+char ** iid;
+int flag;
+{
+ char *lcp;
+ char *icp;
+ int len = STRLEN(name);
+ int found_label = 0;
+
+ *last_label = *iid = NULL;
+
+ if (len == 0) return(FAILURE);
+
+ /* Handle case where numeric oid's have been requested. The input 'name'
+ ** in this case should be a numeric OID -- return failure if not.
+ */
+ if ((flag & USE_NUMERIC_OIDS)) {
+ if (!__is_numeric_oid(name))
+ return(FAILURE);
+
+ /* Walk backward through the string, looking for first two '.' chars */
+ lcp = &(name[len]);
+ icp = NULL;
+ while (lcp > name) {
+ if (*lcp == '.') {
+
+ /* If this is the first occurence of '.', note it in icp.
+ ** Otherwise, this must be the second occurrence, so break
+ ** out of the loop.
+ */
+ if (icp == NULL)
+ icp = lcp;
+ else
+ break;
+ }
+ lcp --;
+ }
+
+ /* Make sure we found at least a label and index. */
+ if (!icp)
+ return(FAILURE);
+
+ /* Push forward past leading '.' chars and separate the strings. */
+ lcp ++;
+ *icp ++ = '\0';
+
+ *last_label = (flag & USE_LONG_NAMES) ? name : lcp;
+ *iid = icp;
+
+ return(SUCCESS);
+ }
+
+ lcp = icp = &(name[len]);
+
+ while (lcp > name) {
+ if (*lcp == '.') {
+ if (found_label) {
+ lcp++;
+ break;
+ } else {
+ icp = lcp;
+ }
+ }
+ if (!found_label && isalpha((int)*lcp)) found_label = 1;
+ lcp--;
+ }
+
+ if (!found_label || (!isdigit((int)*(icp+1)) && (flag & FAIL_ON_NULL_IID)))
+ return(FAILURE);
+
+ if (flag & NON_LEAF_NAME) { /* dont know where to start instance id */
+ /* put the whole thing in label */
+ icp = &(name[len]);
+ flag |= USE_LONG_NAMES;
+ /* special hack in case no mib loaded - object identifiers will
+ * start with .iso.<num>.<num>...., in which case it is preferable
+ * to make the label entirely numeric (i.e., convert "iso" => "1")
+ */
+ if (*lcp == '.' && lcp == name) {
+ if (!strncmp(".ccitt.",lcp,7)) {
+ name += 2;
+ *name = '.';
+ *(name+1) = '0';
+ } else if (!strncmp(".iso.",lcp,5)) {
+ name += 2;
+ *name = '.';
+ *(name+1) = '1';
+ } else if (!strncmp(".joint-iso-ccitt.",lcp,17)) {
+ name += 2;
+ *name = '.';
+ *(name+1) = '2';
+ }
+ }
+ } else if (*icp) {
+ *(icp++) = '\0';
+ }
+ *last_label = (flag & USE_LONG_NAMES ? name : lcp);
+
+ *iid = icp;
+
+ return(SUCCESS);
+}
+
+/* Convert a tag (string) to an OID array */
+/* Tag can be either a symbolic name, or an OID string */
+static struct tree *
+__tag2oid(tag, iid, oid_arr, oid_arr_len, type, best_guess)
+char * tag;
+char * iid;
+oid * oid_arr;
+int * oid_arr_len;
+int * type;
+int best_guess;
+{
+ struct tree *tp = NULL;
+ struct tree *rtp = NULL;
+ oid newname[MAX_OID_LEN], *op;
+ size_t newname_len = 0;
+
+ if (type) *type = TYPE_UNKNOWN;
+ if (oid_arr_len) *oid_arr_len = 0;
+ if (!tag) goto done;
+
+ /*********************************************************/
+ /* best_guess = 0 - same as no switches (read_objid) */
+ /* if multiple parts, or uses find_node */
+ /* if a single leaf */
+ /* best_guess = 1 - same as -Ib (get_wild_node) */
+ /* best_guess = 2 - same as -IR (get_node) */
+ /*********************************************************/
+
+ /* numeric scalar (1,2) */
+ /* single symbolic (1,2) */
+ /* single regex (1) */
+ /* partial full symbolic (2) */
+ /* full symbolic (2) */
+ /* module::single symbolic (2) */
+ /* module::partial full symbolic (2) */
+ if (best_guess == 1 || best_guess == 2) {
+ if (!__scan_num_objid(tag, newname, &newname_len)) { /* make sure it's not a numeric tag */
+ newname_len = MAX_OID_LEN;
+ if (best_guess == 2) { /* Random search -IR */
+ if (get_node(tag, newname, &newname_len)) {
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ }
+ else if (best_guess == 1) { /* Regex search -Ib */
+ clear_tree_flags(get_tree_head());
+ if (get_wild_node(tag, newname, &newname_len)) {
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ }
+ }
+ else {
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ if (type) *type = (tp ? tp->type : TYPE_UNKNOWN);
+ if ((oid_arr == NULL) || (oid_arr_len == NULL)) return rtp;
+ memcpy(oid_arr,(char*)newname,newname_len*sizeof(oid));
+ *oid_arr_len = newname_len;
+ }
+
+ /* if best_guess is off and multi part tag or module::tag */
+ /* numeric scalar */
+ /* module::single symbolic */
+ /* module::partial full symbolic */
+ /* FULL symbolic OID */
+ else if (strchr(tag,'.') || strchr(tag,':')) {
+ if (!__scan_num_objid(tag, newname, &newname_len)) { /* make sure it's not a numeric tag */
+ newname_len = MAX_OID_LEN;
+ if (read_objid(tag, newname, &newname_len)) { /* long name */
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ }
+ else {
+ rtp = tp = get_tree(newname, newname_len, get_tree_head());
+ }
+ if (type) *type = (tp ? tp->type : TYPE_UNKNOWN);
+ if ((oid_arr == NULL) || (oid_arr_len == NULL)) return rtp;
+ memcpy(oid_arr,(char*)newname,newname_len*sizeof(oid));
+ *oid_arr_len = newname_len;
+ }
+
+ /* else best_guess is off and it is a single leaf */
+ /* single symbolic */
+ else {
+ rtp = tp = find_node(tag, get_tree_head());
+ if (tp) {
+ if (type) *type = tp->type;
+ if ((oid_arr == NULL) || (oid_arr_len == NULL)) return rtp;
+ /* code taken from get_node in snmp_client.c */
+ for(op = newname + MAX_OID_LEN - 1; op >= newname; op--){
+ *op = tp->subid;
+ tp = tp->parent;
+ if (tp == NULL)
+ break;
+ }
+ *oid_arr_len = newname + MAX_OID_LEN - op;
+ memcpy(oid_arr, op, *oid_arr_len * sizeof(oid));
+ } else {
+ return(rtp); /* HACK: otherwise, concat_oid_str confuses things */
+ }
+ }
+ done:
+ if (iid && *iid && oid_arr_len)
+ __concat_oid_str(oid_arr, oid_arr_len, iid);
+ return(rtp);
+}
+
+/* function: __concat_oid_str
+ *
+ * This function converts a dotted-decimal string, soid_str, to an array
+ * of oid types and concatenates them on doid_arr begining at the index
+ * specified by doid_arr_len.
+ *
+ * returns : SUCCESS, FAILURE
+ */
+static int
+__concat_oid_str(doid_arr, doid_arr_len, soid_str)
+oid *doid_arr;
+int *doid_arr_len;
+char * soid_str;
+{
+ char *soid_buf;
+ char *cp;
+ char *st;
+
+ if (!soid_str || !*soid_str) return SUCCESS;/* successfully added nothing */
+ if (*soid_str == '.') soid_str++;
+ soid_buf = strdup(soid_str);
+ if (!soid_buf)
+ return FAILURE;
+ cp = strtok_r(soid_buf,".",&st);
+ while (cp) {
+ sscanf(cp, "%lu", &(doid_arr[(*doid_arr_len)++]));
+ /* doid_arr[(*doid_arr_len)++] = atoi(cp); */
+ cp = strtok_r(NULL,".",&st);
+ }
+ free(soid_buf);
+ return(SUCCESS);
+}
+
+/*
+ * add a varbind to PDU
+ */
+static int
+__add_var_val_str(pdu, name, name_length, val, len, type)
+ netsnmp_pdu *pdu;
+ oid *name;
+ int name_length;
+ char * val;
+ int len;
+ int type;
+{
+ netsnmp_variable_list *vars;
+ oid oidbuf[MAX_OID_LEN];
+ int ret = SUCCESS;
+
+ if (pdu->variables == NULL){
+ pdu->variables = vars =
+ (netsnmp_variable_list *)calloc(1,sizeof(netsnmp_variable_list));
+ } else {
+ for(vars = pdu->variables;
+ vars->next_variable;
+ vars = vars->next_variable)
+ /*EXIT*/;
+ vars->next_variable =
+ (netsnmp_variable_list *)calloc(1,sizeof(netsnmp_variable_list));
+ vars = vars->next_variable;
+ }
+
+ vars->next_variable = NULL;
+ vars->name = snmp_duplicate_objid(name, name_length);
+ vars->name_length = name_length;
+ switch (type) {
+ case TYPE_INTEGER:
+ case TYPE_INTEGER32:
+ vars->type = ASN_INTEGER;
+ vars->val.integer = (long *)malloc(sizeof(long));
+ if (val)
+ *(vars->val.integer) = strtol(val,NULL,0);
+ else {
+ ret = FAILURE;
+ *(vars->val.integer) = 0;
+ }
+ vars->val_len = sizeof(long);
+ break;
+
+ case TYPE_GAUGE:
+ case TYPE_UNSIGNED32:
+ vars->type = ASN_GAUGE;
+ goto UINT;
+ case TYPE_COUNTER:
+ vars->type = ASN_COUNTER;
+ goto UINT;
+ case TYPE_TIMETICKS:
+ vars->type = ASN_TIMETICKS;
+ goto UINT;
+ case TYPE_UINTEGER:
+ vars->type = ASN_UINTEGER;
+UINT:
+ vars->val.integer = (long *)malloc(sizeof(long));
+ if (val)
+ sscanf(val,"%lu",vars->val.integer);
+ else {
+ ret = FAILURE;
+ *(vars->val.integer) = 0;
+ }
+ vars->val_len = sizeof(long);
+ break;
+
+ case TYPE_OCTETSTR:
+ vars->type = ASN_OCTET_STR;
+ goto OCT;
+
+ case TYPE_BITSTRING:
+ vars->type = ASN_OCTET_STR;
+ goto OCT;
+
+ case TYPE_OPAQUE:
+ vars->type = ASN_OCTET_STR;
+OCT:
+ vars->val.string = (u_char *)malloc(len);
+ vars->val_len = len;
+ if (val && len)
+ memcpy((char *)vars->val.string, val, len);
+ else {
+ ret = FAILURE;
+ vars->val.string = (u_char*)strdup("");
+ vars->val_len = 0;
+ }
+ break;
+
+ case TYPE_IPADDR:
+ vars->type = ASN_IPADDRESS;
+ vars->val.integer = (long *)malloc(sizeof(long));
+ if (val)
+ *(vars->val.integer) = inet_addr(val);
+ else {
+ ret = FAILURE;
+ *(vars->val.integer) = 0;
+ }
+ vars->val_len = sizeof(long);
+ break;
+
+ case TYPE_OBJID:
+ vars->type = ASN_OBJECT_ID;
+ vars->val_len = MAX_OID_LEN;
+ /* if (read_objid(val, oidbuf, &(vars->val_len))) { */
+ /* tp = __tag2oid(val,NULL,oidbuf,&(vars->val_len),NULL,0); */
+ if (!val || !snmp_parse_oid(val, oidbuf, &vars->val_len)) {
+ vars->val.objid = NULL;
+ ret = FAILURE;
+ } else {
+ vars->val.objid = snmp_duplicate_objid(oidbuf, vars->val_len);
+ vars->val_len *= sizeof(oid);
+ }
+ break;
+
+ default:
+ vars->type = ASN_NULL;
+ vars->val_len = 0;
+ vars->val.string = NULL;
+ ret = FAILURE;
+ }
+
+ return ret;
+}
+
+/* takes ss and pdu as input and updates the 'response' argument */
+/* the input 'pdu' argument will be freed */
+static int
+__send_sync_pdu(ss, pdu, response, retry_nosuch,
+ err_str, err_num, err_ind)
+netsnmp_session *ss;
+netsnmp_pdu *pdu;
+netsnmp_pdu **response;
+int retry_nosuch;
+char *err_str;
+int *err_num;
+int *err_ind;
+{
+ int status = 0;
+ long command = pdu->command;
+ char *tmp_err_str;
+
+ *err_num = 0;
+ *err_ind = 0;
+ *response = NULL;
+ tmp_err_str = NULL;
+ memset(err_str, '\0', STR_BUF_SIZE);
+
+ if (ss == NULL) {
+ *err_num = 0;
+ *err_ind = SNMPERR_BAD_SESSION;
+ strlcpy(err_str, snmp_api_errstring(*err_ind), STR_BUF_SIZE);
+ goto done;
+ }
+
+retry:
+
+ Py_BEGIN_ALLOW_THREADS
+ status = snmp_sess_synch_response(ss, pdu, response);
+ Py_END_ALLOW_THREADS
+
+ if ((*response == NULL) && (status == STAT_SUCCESS)) status = STAT_ERROR;
+
+ switch (status) {
+ case STAT_SUCCESS:
+ switch ((*response)->errstat) {
+ case SNMP_ERR_NOERROR:
+ break;
+
+ case SNMP_ERR_NOSUCHNAME:
+ if (retry_nosuch && (pdu = snmp_fix_pdu(*response, command))) {
+ if (*response) snmp_free_pdu(*response);
+ goto retry;
+ }
+
+ /* Pv1, SNMPsec, Pv2p, v2c, v2u, v2*, and SNMPv3 PDUs */
+ case SNMP_ERR_TOOBIG:
+ case SNMP_ERR_BADVALUE:
+ case SNMP_ERR_READONLY:
+ case SNMP_ERR_GENERR:
+ /* in SNMPv2p, SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3 PDUs */
+ case SNMP_ERR_NOACCESS:
+ case SNMP_ERR_WRONGTYPE:
+ case SNMP_ERR_WRONGLENGTH:
+ case SNMP_ERR_WRONGENCODING:
+ case SNMP_ERR_WRONGVALUE:
+ case SNMP_ERR_NOCREATION:
+ case SNMP_ERR_INCONSISTENTVALUE:
+ case SNMP_ERR_RESOURCEUNAVAILABLE:
+ case SNMP_ERR_COMMITFAILED:
+ case SNMP_ERR_UNDOFAILED:
+ case SNMP_ERR_AUTHORIZATIONERROR:
+ case SNMP_ERR_NOTWRITABLE:
+ /* in SNMPv2c, SNMPv2u, SNMPv2*, and SNMPv3 PDUs */
+ case SNMP_ERR_INCONSISTENTNAME:
+ default:
+ strlcpy(err_str, (char*)snmp_errstring((*response)->errstat),
+ STR_BUF_SIZE);
+ *err_num = (int)(*response)->errstat;
+ *err_ind = (*response)->errindex;
+ status = (*response)->errstat;
+ break;
+ }
+ break;
+
+ case STAT_TIMEOUT:
+ case STAT_ERROR:
+ snmp_sess_error(ss, err_num, err_ind, &tmp_err_str);
+ strlcpy(err_str, tmp_err_str, STR_BUF_SIZE);
+ break;
+
+ default:
+ strcat(err_str, "send_sync_pdu: unknown status");
+ *err_num = ss->s_snmp_errno;
+ break;
+ }
+done:
+ if (tmp_err_str) {
+ free(tmp_err_str);
+ }
+ if (_debug_level && *err_num) printf("XXX sync PDU: %s\n", err_str);
+ return(status);
+}
+
+static PyObject *
+py_netsnmp_construct_varbind(void)
+{
+ PyObject *module;
+ PyObject *dict;
+ PyObject *callable;
+
+ module = PyImport_ImportModule("netsnmp");
+ dict = PyModule_GetDict(module);
+
+ callable = PyDict_GetItemString(dict, "Varbind");
+
+ return PyObject_CallFunction(callable, "");
+}
+
+static int
+py_netsnmp_attr_string(PyObject *obj, char * attr_name, char **val,
+ Py_ssize_t *len)
+{
+ *val = NULL;
+ if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) {
+ PyObject *attr = PyObject_GetAttrString(obj, attr_name);
+ if (attr) {
+ int retval;
+ retval = PyString_AsStringAndSize(attr, val, len);
+ Py_DECREF(attr);
+ return retval;
+ }
+ }
+
+ return -1;
+}
+
+static long long
+py_netsnmp_attr_long(PyObject *obj, char * attr_name)
+{
+ long long val = -1;
+
+ if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) {
+ PyObject *attr = PyObject_GetAttrString(obj, attr_name);
+ if (attr) {
+ val = PyInt_AsLong(attr);
+ Py_DECREF(attr);
+ }
+ }
+
+ return val;
+}
+
+static void *
+py_netsnmp_attr_void_ptr(PyObject *obj, char * attr_name)
+{
+ void *val = NULL;
+
+ if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) {
+ PyObject *attr = PyObject_GetAttrString(obj, attr_name);
+ if (attr) {
+ val = PyLong_AsVoidPtr(attr);
+ Py_DECREF(attr);
+ }
+ }
+
+ return val;
+}
+
+static int
+py_netsnmp_verbose(void)
+{
+ int verbose = 0;
+ PyObject *pkg = PyImport_ImportModule("netsnmp");
+ if (pkg) {
+ verbose = py_netsnmp_attr_long(pkg, "verbose");
+ Py_DECREF(pkg);
+ }
+
+ return verbose;
+}
+
+static int
+py_netsnmp_attr_set_string(PyObject *obj, char *attr_name,
+ char *val, size_t len)
+{
+ int ret = -1;
+ if (obj && attr_name) {
+ PyObject* val_obj = (val ?
+ Py_BuildValue("s#", val, len) :
+ Py_BuildValue(""));
+ ret = PyObject_SetAttrString(obj, attr_name, val_obj);
+ Py_DECREF(val_obj);
+ }
+ return ret;
+}
+
+/**
+ * Update python session object error attributes.
+ *
+ * Copy the error info which may have been returned from __send_sync_pdu(...)
+ * into the python object. This will allow the python code to determine if
+ * an error occured during an snmp operation.
+ *
+ * Currently there are 3 attributes we care about
+ *
+ * ErrorNum - Copy of the value of netsnmp_session.s_errno. This is the system
+ * errno that was generated during our last call into the net-snmp library.
+ *
+ * ErrorInd - Copy of the value of netsmp_session.s_snmp_errno. These error
+ * numbers are separate from the system errno's and describe SNMP errors.
+ *
+ * ErrorStr - A string describing the ErrorInd that was returned during our last
+ * operation.
+ *
+ * @param[in] session The python object that represents our current Session
+ * @param[in|out] err_str A string describing err_ind
+ * @param[in|out] err_num The system errno currently stored by our session
+ * @param[in|out] err_ind The snmp errno currently stored by our session
+ */
+static void
+__py_netsnmp_update_session_errors(PyObject *session, char *err_str,
+ int err_num, int err_ind)
+{
+ PyObject *tmp_for_conversion;
+
+ py_netsnmp_attr_set_string(session, "ErrorStr", err_str, STRLEN(err_str));
+
+ tmp_for_conversion = PyInt_FromLong(err_num);
+ PyObject_SetAttrString(session, "ErrorNum", tmp_for_conversion);
+ Py_DECREF(tmp_for_conversion);
+
+ tmp_for_conversion = PyInt_FromLong(err_ind);
+ PyObject_SetAttrString(session, "ErrorInd", tmp_for_conversion);
+ Py_DECREF(tmp_for_conversion);
+}
+
+static PyObject *
+netsnmp_create_session(PyObject *self, PyObject *args)
+{
+ int version;
+ char *community;
+ char *peer;
+ int lport;
+ int retries;
+ int timeout;
+ SnmpSession session = {0};
+ SnmpSession *ss = NULL;
+ int verbose = py_netsnmp_verbose();
+
+ if (!PyArg_ParseTuple(args, "issiii", &version,
+ &community, &peer, &lport,
+ &retries, &timeout))
+ return NULL;
+
+ __libraries_init("python");
+
+ snmp_sess_init(&session);
+
+ session.version = -1;
+#ifndef DISABLE_SNMPV1
+ if (version == 1) {
+ session.version = SNMP_VERSION_1;
+ }
+#endif
+#ifndef DISABLE_SNMPV2C
+ if (version == 2) {
+ session.version = SNMP_VERSION_2c;
+ }
+#endif
+ if (version == 3) {
+ session.version = SNMP_VERSION_3;
+ }
+ if (session.version == -1) {
+ if (verbose)
+ printf("error:snmp_new_session:Unsupported SNMP version (%d)\n", version);
+ goto end;
+ }
+
+ session.community_len = STRLEN((char *)community);
+ session.community = (u_char *)community;
+ session.peername = peer;
+ session.local_port = lport;
+ session.retries = retries; /* 5 */
+ session.timeout = timeout; /* 1000000L */
+ session.authenticator = NULL;
+
+ ss = snmp_sess_open(&session);
+
+ if (ss == NULL) {
+ if (verbose)
+ printf("error:snmp_new_session: Couldn't open SNMP session");
+ }
+ end:
+ return PyLong_FromVoidPtr((void *)ss);
+}
+
+static PyObject *
+netsnmp_create_session_v3(PyObject *self, PyObject *args)
+{
+ int version;
+ char *peer;
+ int lport;
+ int retries;
+ int timeout;
+ char * sec_name;
+ int sec_level;
+ char * sec_eng_id;
+ char * context_eng_id;
+ char * context;
+ char * auth_proto;
+ char * auth_pass;
+ char * priv_proto;
+ char * priv_pass;
+ int eng_boots;
+ int eng_time;
+ SnmpSession session = {0};
+ SnmpSession *ss = NULL;
+ int verbose = py_netsnmp_verbose();
+
+ if (!PyArg_ParseTuple(args, "isiiisisssssssii", &version,
+ &peer, &lport, &retries, &timeout,
+ &sec_name, &sec_level, &sec_eng_id,
+ &context_eng_id, &context,
+ &auth_proto, &auth_pass,
+ &priv_proto, &priv_pass,
+ &eng_boots, &eng_time))
+ return NULL;
+
+ __libraries_init("python");
+ snmp_sess_init(&session);
+
+ if (version == 3) {
+ session.version = SNMP_VERSION_3;
+ } else {
+ if (verbose)
+ printf("error:snmp_new_v3_session:Unsupported SNMP version (%d)\n", version);
+ goto end;
+ }
+
+ session.peername = peer;
+ session.retries = retries; /* 5 */
+ session.timeout = timeout; /* 1000000L */
+ session.authenticator = NULL;
+ session.contextNameLen = STRLEN(context);
+ session.contextName = context;
+ session.securityNameLen = STRLEN(sec_name);
+ session.securityName = sec_name;
+ session.securityLevel = sec_level;
+ session.securityModel = USM_SEC_MODEL_NUMBER;
+ session.securityEngineIDLen =
+ hex_to_binary2((unsigned char*)sec_eng_id, STRLEN(sec_eng_id),
+ (char **) &session.securityEngineID);
+ session.contextEngineIDLen =
+ hex_to_binary2((unsigned char*)sec_eng_id, STRLEN(sec_eng_id),
+ (char **) &session.contextEngineID);
+ session.engineBoots = eng_boots;
+ session.engineTime = eng_time;
+
+#ifndef DISABLE_MD5
+ if (!strcmp(auth_proto, "MD5")) {
+ session.securityAuthProto =
+ snmp_duplicate_objid(usmHMACMD5AuthProtocol,
+ USM_AUTH_PROTO_MD5_LEN);
+ session.securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
+ } else
+#endif
+ if (!strcmp(auth_proto, "SHA")) {
+ session.securityAuthProto =
+ snmp_duplicate_objid(usmHMACSHA1AuthProtocol,
+ USM_AUTH_PROTO_SHA_LEN);
+ session.securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
+ } else if (!strcmp(auth_proto, "DEFAULT")) {
+ const oid* a = get_default_authtype(&session.securityAuthProtoLen);
+ session.securityAuthProto
+ = snmp_duplicate_objid(a, session.securityAuthProtoLen);
+ } else {
+ if (verbose)
+ printf("error:snmp_new_v3_session:Unsupported authentication protocol(%s)\n", auth_proto);
+ goto end;
+ }
+ if (session.securityLevel >= SNMP_SEC_LEVEL_AUTHNOPRIV) {
+ if (STRLEN(auth_pass) > 0) {
+ session.securityAuthKeyLen = USM_AUTH_KU_LEN;
+ if (generate_Ku(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ (u_char *)auth_pass, STRLEN(auth_pass),
+ session.securityAuthKey,
+ &session.securityAuthKeyLen) != SNMPERR_SUCCESS) {
+ if (verbose)
+ printf("error:snmp_new_v3_session:Error generating Ku from authentication password.\n");
+ goto end;
+ }
+ }
+ }
+#ifndef DISABLE_DES
+ if (!strcmp(priv_proto, "DES")) {
+ session.securityPrivProto =
+ snmp_duplicate_objid(usmDESPrivProtocol,
+ USM_PRIV_PROTO_DES_LEN);
+ session.securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN;
+ } else
+#endif
+ if (!strncmp(priv_proto, "AES", 3)) {
+ session.securityPrivProto =
+ snmp_duplicate_objid(usmAESPrivProtocol,
+ USM_PRIV_PROTO_AES_LEN);
+ session.securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
+ } else if (!strcmp(priv_proto, "DEFAULT")) {
+ const oid *p = get_default_privtype(&session.securityPrivProtoLen);
+ session.securityPrivProto
+ = snmp_duplicate_objid(p, session.securityPrivProtoLen);
+ } else {
+ if (verbose)
+ printf("error:snmp_new_v3_session:Unsupported privacy protocol(%s)\n", priv_proto);
+ goto end;
+ }
+
+ if (session.securityLevel >= SNMP_SEC_LEVEL_AUTHPRIV) {
+ session.securityPrivKeyLen = USM_PRIV_KU_LEN;
+ if (generate_Ku(session.securityAuthProto,
+ session.securityAuthProtoLen,
+ (u_char *)priv_pass, STRLEN(priv_pass),
+ session.securityPrivKey,
+ &session.securityPrivKeyLen) != SNMPERR_SUCCESS) {
+ if (verbose)
+ printf("error:v3_session: couldn't gen Ku from priv pass phrase.\n");
+ goto end;
+ }
+ }
+
+ ss = snmp_sess_open(&session);
+
+ end:
+ if (ss == NULL) {
+ if (verbose)
+ printf("error:v3_session: couldn't open SNMP session(%s).\n",
+ snmp_api_errstring(snmp_errno));
+ }
+ free (session.securityEngineID);
+ free (session.contextEngineID);
+
+ return PyLong_FromVoidPtr((void *)ss);
+}
+
+static PyObject *
+netsnmp_create_session_tunneled(PyObject *self, PyObject *args)
+{
+ int version;
+ char *peer;
+ int lport;
+ int retries;
+ int timeout;
+ char * sec_name;
+ int sec_level;
+ char * context_eng_id;
+ char * context;
+ char * our_identity;
+ char * their_identity;
+ char * their_hostname;
+ char * trust_cert;
+ SnmpSession session = {0};
+ SnmpSession *ss = NULL;
+ int verbose = py_netsnmp_verbose();
+
+ if (!PyArg_ParseTuple(args, "isiiisissssss", &version,
+ &peer, &lport, &retries, &timeout,
+ &sec_name, &sec_level,
+ &context_eng_id, &context,
+ &our_identity, &their_identity,
+ &their_hostname, &trust_cert))
+ return NULL;
+
+ __libraries_init("python");
+ snmp_sess_init(&session);
+
+ if (version != 3) {
+ session.version = SNMP_VERSION_3;
+ if (verbose)
+ printf("Using version 3 as it's the only version that supports tunneling\n");
+ }
+
+ session.peername = peer;
+ session.retries = retries; /* 5 */
+ session.timeout = timeout; /* 1000000L */
+ session.contextNameLen = STRLEN(context);
+ session.contextName = context;
+ session.securityNameLen = STRLEN(sec_name);
+ session.securityName = sec_name;
+ session.securityLevel = sec_level;
+ session.securityModel = NETSNMP_TSM_SECURITY_MODEL;
+
+ /* create the transport configuration store */
+ if (!session.transport_configuration) {
+ netsnmp_container_init_list();
+ session.transport_configuration =
+ netsnmp_container_find("transport_configuration:fifo");
+ if (!session.transport_configuration) {
+ fprintf(stderr, "failed to initialize the transport configuration container\n");
+ return NULL;
+ }
+
+ session.transport_configuration->compare =
+ (netsnmp_container_compare*)
+ netsnmp_transport_config_compare;
+ }
+
+ if (our_identity && our_identity[0] != '\0')
+ CONTAINER_INSERT(session.transport_configuration,
+ netsnmp_transport_create_config("localCert",
+ our_identity));
+
+ if (their_identity && their_identity[0] != '\0')
+ CONTAINER_INSERT(session.transport_configuration,
+ netsnmp_transport_create_config("peerCert",
+ their_identity));
+
+ if (their_hostname && their_hostname[0] != '\0')
+ CONTAINER_INSERT(session.transport_configuration,
+ netsnmp_transport_create_config("their_hostname",
+ their_hostname));
+
+ if (trust_cert && trust_cert[0] != '\0')
+ CONTAINER_INSERT(session.transport_configuration,
+ netsnmp_transport_create_config("trust_cert",
+ trust_cert));
+
+ ss = snmp_sess_open(&session);
+
+ if (!ss)
+ return NULL;
+ /*
+ * Note: on a 64-bit system the statement below discards the upper 32 bits of
+ * "ss", which is most likely a bug.
+ */
+ return Py_BuildValue("i", (int)(uintptr_t)ss);
+}
+
+static PyObject *
+netsnmp_delete_session(PyObject *self, PyObject *args)
+{
+ PyObject *session;
+ SnmpSession *ss = NULL;
+
+ if (!PyArg_ParseTuple(args, "O", &session)) {
+ return NULL;
+ }
+
+ ss = (SnmpSession *)py_netsnmp_attr_void_ptr(session, "sess_ptr");
+
+ snmp_sess_close(ss);
+ return (Py_BuildValue(""));
+}
+
+
+static PyObject *
+netsnmp_get(PyObject *self, PyObject *args)
+{
+ PyObject *session;
+ PyObject *varlist;
+ PyObject *varbind;
+ PyObject *val_tuple = NULL;
+ int varlist_len = 0;
+ int varlist_ind;
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ struct tree *tp;
+ int len;
+ oid *oid_arr;
+ int oid_arr_len = MAX_OID_LEN;
+ int type;
+ char type_str[MAX_TYPE_NAME_LEN];
+ u_char str_buf[STR_BUF_SIZE], *str_bufp = str_buf;
+ size_t str_buf_len = sizeof(str_buf);
+ size_t out_len = 0;
+ int buf_over = 0;
+ char *tag;
+ char *iid;
+ int getlabel_flag = NO_FLAGS;
+ int sprintval_flag = USE_BASIC;
+ int verbose = py_netsnmp_verbose();
+ int old_format;
+ int best_guess;
+ int retry_nosuch;
+ int err_ind;
+ int err_num;
+ char err_str[STR_BUF_SIZE];
+ char *tmpstr;
+ Py_ssize_t tmplen;
+
+ oid_arr = calloc(MAX_OID_LEN, sizeof(oid));
+
+ if (oid_arr && args) {
+
+ if (!PyArg_ParseTuple(args, "OO", &session, &varlist)) {
+ goto done;
+ }
+
+ ss = (SnmpSession *)py_netsnmp_attr_void_ptr(session, "sess_ptr");
+
+ if (py_netsnmp_attr_string(session, "ErrorStr", &tmpstr, &tmplen) < 0) {
+ goto done;
+ }
+
+ if (py_netsnmp_attr_long(session, "UseLongNames"))
+ getlabel_flag |= USE_LONG_NAMES;
+ if (py_netsnmp_attr_long(session, "UseNumeric"))
+ getlabel_flag |= USE_NUMERIC_OIDS;
+ if (py_netsnmp_attr_long(session, "UseEnums"))
+ sprintval_flag = USE_ENUMS;
+ if (py_netsnmp_attr_long(session, "UseSprintValue"))
+ sprintval_flag = USE_SPRINT_VALUE;
+ best_guess = py_netsnmp_attr_long(session, "BestGuess");
+ retry_nosuch = py_netsnmp_attr_long(session, "RetryNoSuch");
+
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+
+ if (varlist) {
+ PyObject *varlist_iter = PyObject_GetIter(varlist);
+
+ while (varlist_iter && (varbind = PyIter_Next(varlist_iter))) {
+ if (py_netsnmp_attr_string(varbind, "tag", &tag, NULL) < 0 ||
+ py_netsnmp_attr_string(varbind, "iid", &iid, NULL) < 0)
+ {
+ oid_arr_len = 0;
+ } else {
+ tp = __tag2oid(tag, iid, oid_arr, &oid_arr_len, NULL, best_guess);
+ }
+
+ if (oid_arr_len) {
+ snmp_add_null_var(pdu, oid_arr, oid_arr_len);
+ varlist_len++;
+ } else {
+ if (verbose)
+ printf("error: get: unknown object ID (%s)",
+ (tag ? tag : "<null>"));
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ /* release reference when done */
+ Py_DECREF(varbind);
+ }
+
+ Py_DECREF(varlist_iter);
+
+ if (PyErr_Occurred()) {
+ /* propagate error */
+ if (verbose)
+ printf("error: get: unknown python error");
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ }
+
+ __send_sync_pdu(ss, pdu, &response, retry_nosuch, err_str, &err_num,
+ &err_ind);
+ __py_netsnmp_update_session_errors(session, err_str, err_num, err_ind);
+
+ /*
+ ** Set up for numeric or full OID's, if necessary. Save the old
+ ** output format so that it can be restored when we finish -- this
+ ** is a library-wide global, and has to be set/restored for each
+ ** session.
+ */
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+
+ if (py_netsnmp_attr_long(session, "UseLongNames")) {
+ getlabel_flag |= USE_LONG_NAMES;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_FULL);
+ }
+ /* Setting UseNumeric forces UseLongNames on so check for UseNumeric
+ after UseLongNames (above) to make sure the final outcome of
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT is NETSNMP_OID_OUTPUT_NUMERIC */
+ if (py_netsnmp_attr_long(session, "UseNumeric")) {
+ getlabel_flag |= USE_LONG_NAMES;
+ getlabel_flag |= USE_NUMERIC_OIDS;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+
+ val_tuple = PyTuple_New(varlist_len);
+ /* initialize return tuple */
+ for (varlist_ind = 0; varlist_ind < varlist_len; varlist_ind++) {
+ PyTuple_SetItem(val_tuple, varlist_ind, Py_BuildValue(""));
+ }
+
+ for(vars = (response ? response->variables : NULL), varlist_ind = 0;
+ vars && (varlist_ind < varlist_len);
+ vars = vars->next_variable, varlist_ind++) {
+
+ varbind = PySequence_GetItem(varlist, varlist_ind);
+
+ if (PyObject_HasAttrString(varbind, "tag")) {
+ *str_buf = '.';
+ *(str_buf+1) = '\0';
+ out_len = 0;
+ tp = netsnmp_sprint_realloc_objid_tree(&str_bufp, &str_buf_len,
+ &out_len, 0, &buf_over,
+ vars->name,vars->name_length);
+ if (_debug_level)
+ printf("netsnmp_get:str_bufp:%s:%d:%d\n", str_bufp,
+ (int)str_buf_len, (int)out_len);
+
+ str_buf[sizeof(str_buf)-1] = '\0';
+
+ if (__is_leaf(tp)) {
+ type = (tp->type ? tp->type : tp->parent->type);
+ getlabel_flag &= ~NON_LEAF_NAME;
+ if (_debug_level) printf("netsnmp_get:is_leaf:%d\n",type);
+ } else {
+ getlabel_flag |= NON_LEAF_NAME;
+ type = __translate_asn_type(vars->type);
+ if (_debug_level) printf("netsnmp_get:!is_leaf:%d\n",tp->type);
+ }
+
+ if (_debug_level) printf("netsnmp_get:str_buf:%s\n",str_buf);
+
+ __get_label_iid((char *) str_buf, &tag, &iid, getlabel_flag);
+
+ py_netsnmp_attr_set_string(varbind, "tag", tag, STRLEN(tag));
+ py_netsnmp_attr_set_string(varbind, "iid", iid, STRLEN(iid));
+
+ __get_type_str(type, type_str);
+
+ py_netsnmp_attr_set_string(varbind, "type", type_str, strlen(type_str));
+
+ len = __snprint_value((char *) str_buf, sizeof(str_buf),
+ vars, tp, type, sprintval_flag);
+ str_buf[len] = '\0';
+ py_netsnmp_attr_set_string(varbind, "val", (char *) str_buf, len);
+
+ /* save in return tuple as well */
+ PyTuple_SetItem(val_tuple, varlist_ind,
+ (len ? Py_BuildValue("s#", str_buf, len) :
+ Py_BuildValue("")));
+
+ Py_DECREF(varbind);
+ } else {
+ printf("netsnmp_get: bad varbind (%d)\n", varlist_ind);
+ }
+ }
+
+ /* Reset the library's behavior for numeric/symbolic OID's. */
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ old_format);
+
+ if (response) snmp_free_pdu(response);
+ }
+
+ done:
+ SAFE_FREE(oid_arr);
+ return (val_tuple ? val_tuple : Py_BuildValue(""));
+}
+
+static PyObject *
+netsnmp_getnext(PyObject *self, PyObject *args)
+{
+ PyObject *session;
+ PyObject *varlist;
+ PyObject *varbind;
+ PyObject *val_tuple = NULL;
+ int varlist_len = 0;
+ int varlist_ind;
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ struct tree *tp;
+ int len;
+ oid *oid_arr;
+ int oid_arr_len = MAX_OID_LEN;
+ int type;
+ char type_str[MAX_TYPE_NAME_LEN];
+ u_char str_buf[STR_BUF_SIZE], *str_bufp = str_buf;
+ size_t str_buf_len = sizeof(str_buf);
+ size_t out_len = 0;
+ int buf_over = 0;
+ char *tag;
+ char *iid = NULL;
+ int getlabel_flag = NO_FLAGS;
+ int sprintval_flag = USE_BASIC;
+ int verbose = py_netsnmp_verbose();
+ int old_format;
+ int best_guess;
+ int retry_nosuch;
+ int err_ind;
+ int err_num;
+ char err_str[STR_BUF_SIZE];
+ char *tmpstr;
+ Py_ssize_t tmplen;
+
+ oid_arr = calloc(MAX_OID_LEN, sizeof(oid));
+
+ if (oid_arr && args) {
+
+ if (!PyArg_ParseTuple(args, "OO", &session, &varlist)) {
+ goto done;
+ }
+
+ ss = (SnmpSession *)py_netsnmp_attr_void_ptr(session, "sess_ptr");
+
+ if (py_netsnmp_attr_string(session, "ErrorStr", &tmpstr, &tmplen) < 0) {
+ goto done;
+ }
+ memcpy(&err_str, tmpstr, tmplen);
+ err_num = py_netsnmp_attr_long(session, "ErrorNum");
+ err_ind = py_netsnmp_attr_long(session, "ErrorInd");
+
+ if (py_netsnmp_attr_long(session, "UseLongNames"))
+ getlabel_flag |= USE_LONG_NAMES;
+ if (py_netsnmp_attr_long(session, "UseNumeric"))
+ getlabel_flag |= USE_NUMERIC_OIDS;
+ if (py_netsnmp_attr_long(session, "UseEnums"))
+ sprintval_flag = USE_ENUMS;
+ if (py_netsnmp_attr_long(session, "UseSprintValue"))
+ sprintval_flag = USE_SPRINT_VALUE;
+ best_guess = py_netsnmp_attr_long(session, "BestGuess");
+ retry_nosuch = py_netsnmp_attr_long(session, "RetryNoSuch");
+
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+
+ if (varlist) {
+ PyObject *varlist_iter = PyObject_GetIter(varlist);
+
+ while (varlist_iter && (varbind = PyIter_Next(varlist_iter))) {
+ if (py_netsnmp_attr_string(varbind, "tag", &tag, NULL) < 0 ||
+ py_netsnmp_attr_string(varbind, "iid", &iid, NULL) < 0)
+ {
+ oid_arr_len = 0;
+ } else {
+ tp = __tag2oid(tag, iid, oid_arr, &oid_arr_len, NULL, best_guess);
+ }
+
+ if (_debug_level)
+ printf("netsnmp_getnext: filling request: %s:%s:%d:%d\n",
+ tag, iid, oid_arr_len,best_guess);
+
+ if (oid_arr_len) {
+ snmp_add_null_var(pdu, oid_arr, oid_arr_len);
+ varlist_len++;
+ } else {
+ if (verbose)
+ printf("error: get: unknown object ID (%s)",
+ (tag ? tag : "<null>"));
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ /* release reference when done */
+ Py_DECREF(varbind);
+ }
+
+ Py_DECREF(varlist_iter);
+
+ if (PyErr_Occurred()) {
+ /* propagate error */
+ if (verbose)
+ printf("error: get: unknown python error");
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ }
+
+ __send_sync_pdu(ss, pdu, &response, retry_nosuch, err_str, &err_num,
+ &err_ind);
+ __py_netsnmp_update_session_errors(session, err_str, err_num, err_ind);
+
+ /*
+ ** Set up for numeric or full OID's, if necessary. Save the old
+ ** output format so that it can be restored when we finish -- this
+ ** is a library-wide global, and has to be set/restored for each
+ ** session.
+ */
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+
+ if (py_netsnmp_attr_long(session, "UseLongNames")) {
+ getlabel_flag |= USE_LONG_NAMES;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_FULL);
+ }
+ /* Setting UseNumeric forces UseLongNames on so check for UseNumeric
+ after UseLongNames (above) to make sure the final outcome of
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT is NETSNMP_OID_OUTPUT_NUMERIC */
+ if (py_netsnmp_attr_long(session, "UseNumeric")) {
+ getlabel_flag |= USE_LONG_NAMES;
+ getlabel_flag |= USE_NUMERIC_OIDS;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+
+ val_tuple = PyTuple_New(varlist_len);
+ /* initialize return tuple */
+ val_tuple = PyTuple_New(varlist_len);
+ for (varlist_ind = 0; varlist_ind < varlist_len; varlist_ind++) {
+ PyTuple_SetItem(val_tuple, varlist_ind, Py_BuildValue(""));
+ }
+
+ for(vars = (response ? response->variables : NULL), varlist_ind = 0;
+ vars && (varlist_ind < varlist_len);
+ vars = vars->next_variable, varlist_ind++) {
+
+ varbind = PySequence_GetItem(varlist, varlist_ind);
+
+ if (PyObject_HasAttrString(varbind, "tag")) {
+ *str_buf = '.';
+ *(str_buf+1) = '\0';
+ out_len = 0;
+ tp = netsnmp_sprint_realloc_objid_tree(&str_bufp, &str_buf_len,
+ &out_len, 0, &buf_over,
+ vars->name,vars->name_length);
+ str_buf[sizeof(str_buf)-1] = '\0';
+
+ if (__is_leaf(tp)) {
+ type = (tp->type ? tp->type : tp->parent->type);
+ getlabel_flag &= ~NON_LEAF_NAME;
+ } else {
+ getlabel_flag |= NON_LEAF_NAME;
+ type = __translate_asn_type(vars->type);
+ }
+
+ __get_label_iid((char *) str_buf, &tag, &iid, getlabel_flag);
+
+ if (_debug_level)
+ printf("netsnmp_getnext: filling response: %s:%s\n", tag, iid);
+
+ py_netsnmp_attr_set_string(varbind, "tag", tag, STRLEN(tag));
+ py_netsnmp_attr_set_string(varbind, "iid", iid, STRLEN(iid));
+
+ __get_type_str(type, type_str);
+
+ py_netsnmp_attr_set_string(varbind, "type", type_str,
+ strlen(type_str));
+
+ len = __snprint_value((char *) str_buf, sizeof(str_buf),
+ vars, tp, type, sprintval_flag);
+ str_buf[len] = '\0';
+
+ py_netsnmp_attr_set_string(varbind, "val", (char *) str_buf, len);
+
+ /* save in return tuple as well */
+ PyTuple_SetItem(val_tuple, varlist_ind,
+ (len ? Py_BuildValue("s#", str_buf, len) :
+ Py_BuildValue("")));
+
+ Py_DECREF(varbind);
+ } else {
+ printf("netsnmp_getnext: bad varbind (%d)\n", varlist_ind);
+ }
+ }
+
+ /* Reset the library's behavior for numeric/symbolic OID's. */
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ old_format);
+
+ if (response) snmp_free_pdu(response);
+ }
+
+ done:
+ SAFE_FREE(oid_arr);
+ return (val_tuple ? val_tuple : Py_BuildValue(""));
+}
+
+static PyObject *
+netsnmp_walk(PyObject *self, PyObject *args)
+{
+ PyObject *session;
+ PyObject *varlist;
+ PyObject *varlist_iter;
+ PyObject *varbind;
+ PyObject *val_tuple = NULL;
+ PyObject *varbinds = NULL;
+ int varlist_len = 0;
+ int varlist_ind;
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_pdu *newpdu;
+ netsnmp_variable_list *vars, *oldvars;
+ struct tree *tp;
+ int len;
+ oid **oid_arr = NULL;
+ int *oid_arr_len = NULL;
+ oid **oid_arr_broken_check = NULL;
+ int *oid_arr_broken_check_len = NULL;
+ int type;
+ char type_str[MAX_TYPE_NAME_LEN];
+ int status;
+ u_char str_buf[STR_BUF_SIZE], *str_bufp = str_buf;
+ size_t str_buf_len = sizeof(str_buf);
+ size_t out_len = 0;
+ int buf_over = 0;
+ char *tag;
+ char *iid = NULL;
+ int getlabel_flag = NO_FLAGS;
+ int sprintval_flag = USE_BASIC;
+ int verbose = py_netsnmp_verbose();
+ int old_format;
+ int best_guess;
+ int retry_nosuch;
+ int err_ind;
+ int err_num;
+ char err_str[STR_BUF_SIZE];
+ int notdone = 1;
+ int result_count = 0;
+ char *tmpstr;
+ Py_ssize_t tmplen;
+
+ if (args) {
+
+ if (!PyArg_ParseTuple(args, "OO", &session, &varlist)) {
+ goto done;
+ }
+
+ if (!varlist) {
+ goto done;
+ }
+
+ if ((varbinds = PyObject_GetAttrString(varlist, "varbinds")) == NULL) {
+ goto done;
+ }
+ ss = (SnmpSession *)py_netsnmp_attr_void_ptr(session, "sess_ptr");
+
+ if (py_netsnmp_attr_string(session, "ErrorStr", &tmpstr, &tmplen) < 0) {
+ goto done;
+ }
+ memcpy(&err_str, tmpstr, tmplen);
+ err_num = py_netsnmp_attr_long(session, "ErrorNum");
+ err_ind = py_netsnmp_attr_long(session, "ErrorInd");
+
+ if (py_netsnmp_attr_long(session, "UseLongNames"))
+ getlabel_flag |= USE_LONG_NAMES;
+ if (py_netsnmp_attr_long(session, "UseNumeric"))
+ getlabel_flag |= USE_NUMERIC_OIDS;
+ if (py_netsnmp_attr_long(session, "UseEnums"))
+ sprintval_flag = USE_ENUMS;
+ if (py_netsnmp_attr_long(session, "UseSprintValue"))
+ sprintval_flag = USE_SPRINT_VALUE;
+ best_guess = py_netsnmp_attr_long(session, "BestGuess");
+ retry_nosuch = py_netsnmp_attr_long(session, "RetryNoSuch");
+
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+
+ /* we need an initial count for memory allocation */
+ varlist_iter = PyObject_GetIter(varlist);
+ varlist_len = 0;
+ while (varlist_iter && (varbind = PyIter_Next(varlist_iter))) {
+ varlist_len++;
+ }
+ Py_DECREF(varlist_iter);
+
+ oid_arr_len = calloc(varlist_len, sizeof(int));
+ oid_arr_broken_check_len = calloc(varlist_len, sizeof(int));
+
+ oid_arr = calloc(varlist_len, sizeof(oid *));
+ oid_arr_broken_check = calloc(varlist_len, sizeof(oid *));
+
+ for(varlist_ind = 0; varlist_ind < varlist_len; varlist_ind++) {
+
+ oid_arr[varlist_ind] = calloc(MAX_OID_LEN, sizeof(oid));
+ oid_arr_broken_check[varlist_ind] = calloc(MAX_OID_LEN, sizeof(oid));
+
+ oid_arr_len[varlist_ind] = MAX_OID_LEN;
+ oid_arr_broken_check_len[varlist_ind] = MAX_OID_LEN;
+ }
+
+ /* get the initial starting oids*/
+ varlist_iter = PyObject_GetIter(varlist);
+ varlist_ind = 0;
+ while (varlist_iter && (varbind = PyIter_Next(varlist_iter))) {
+
+ if (py_netsnmp_attr_string(varbind, "tag", &tag, NULL) < 0 ||
+ py_netsnmp_attr_string(varbind, "iid", &iid, NULL) < 0)
+ {
+ oid_arr_len[varlist_ind] = 0;
+ } else {
+ tp = __tag2oid(tag, iid,
+ oid_arr[varlist_ind], &oid_arr_len[varlist_ind],
+ NULL, best_guess);
+ }
+
+ if (_debug_level)
+ printf("netsnmp_walk: filling request: %s:%s:%d:%d\n",
+ tag, iid, oid_arr_len[varlist_ind],best_guess);
+
+ if (oid_arr_len[varlist_ind]) {
+ snmp_add_null_var(pdu, oid_arr[varlist_ind], oid_arr_len[varlist_ind]);
+ } else {
+ if (verbose)
+ printf("error: walk: unknown object ID (%s)",
+ (tag ? tag : "<null>"));
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ /* release reference when done */
+ Py_DECREF(varbind);
+ varlist_ind++;
+ }
+
+ if (varlist_iter)
+ Py_DECREF(varlist_iter);
+
+ if (PyErr_Occurred()) {
+ /* propagate error */
+ if (verbose)
+ printf("error: walk: unknown python error (varlist)");
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+ /* pre-allocate the return tuples */
+ val_tuple = PyTuple_New(0);
+
+ if (!val_tuple) {
+ /* propagate error */
+ if (verbose)
+ printf("error: walk: couldn't allocate a new value tuple");
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+ /*
+ ** Set up for numeric or full OID's, if necessary. Save the old
+ ** output format so that it can be restored when we finish -- this
+ ** is a library-wide global, and has to be set/restored for each
+ ** session.
+ */
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+
+ if (py_netsnmp_attr_long(session, "UseLongNames")) {
+ getlabel_flag |= USE_LONG_NAMES;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_FULL);
+ }
+
+ /* Setting UseNumeric forces UseLongNames on so check for UseNumeric
+ after UseLongNames (above) to make sure the final outcome of
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT is NETSNMP_OID_OUTPUT_NUMERIC */
+ if (py_netsnmp_attr_long(session, "UseNumeric")) {
+ getlabel_flag |= USE_LONG_NAMES;
+ getlabel_flag |= USE_NUMERIC_OIDS;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+
+ /* delete the existing varbinds that we'll replace */
+ PySequence_DelSlice(varbinds, 0, PySequence_Length(varbinds));
+
+ if (PyErr_Occurred()) {
+ /* propagate error */
+ if (verbose)
+ printf("error: walk: deleting old varbinds failed\n");
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+ /* save the starting OID */
+
+ for(vars = pdu->variables, varlist_ind = 0;
+ vars != NULL;
+ vars = vars->next_variable, varlist_ind++) {
+
+ oid_arr_broken_check[varlist_ind] = calloc(MAX_OID_LEN, sizeof(oid));
+
+ oid_arr_broken_check_len[varlist_ind] = vars->name_length;
+ memcpy(oid_arr_broken_check[varlist_ind],
+ vars->name, vars->name_length * sizeof(oid));
+ }
+
+ while(notdone) {
+
+ status = __send_sync_pdu(ss, pdu, &response, retry_nosuch,
+ err_str, &err_num, &err_ind);
+ __py_netsnmp_update_session_errors(session, err_str, err_num, err_ind);
+
+ if (!response || !response->variables ||
+ status != STAT_SUCCESS ||
+ response->errstat != SNMP_ERR_NOERROR) {
+ notdone = 0;
+ } else {
+ newpdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+
+ for(vars = (response ? response->variables : NULL),
+ varlist_ind = 0,
+ oldvars = (pdu ? pdu->variables : NULL);
+ vars && (varlist_ind < varlist_len);
+ vars = vars->next_variable, varlist_ind++,
+ oldvars = (oldvars ? oldvars->next_variable : NULL)) {
+
+ if ((vars->name_length < oid_arr_len[varlist_ind]) ||
+ (memcmp(oid_arr[varlist_ind], vars->name,
+ oid_arr_len[varlist_ind] * sizeof(oid)) != 0)) {
+ notdone = 0;
+ break;
+ }
+
+ if ((vars->type == SNMP_ENDOFMIBVIEW) ||
+ (vars->type == SNMP_NOSUCHOBJECT) ||
+ (vars->type == SNMP_NOSUCHINSTANCE)) {
+ notdone = 0;
+ break;
+ }
+
+ if (snmp_oid_compare(vars->name, vars->name_length,
+ oid_arr_broken_check[varlist_ind],
+ oid_arr_broken_check_len[varlist_ind]) <= 0) {
+ /* The agent responded with an illegal response
+ as the returning OID was lexogragically less
+ then or equal to the requested OID...
+ We need to give up here because an infite
+ loop will result otherwise.
+
+ XXX: this really should be an option to
+ continue like the -Cc option to the snmpwalk
+ application.
+ */
+ notdone = 0;
+ break;
+ }
+
+ varbind = py_netsnmp_construct_varbind();
+
+ if (PyObject_HasAttrString(varbind, "tag")) {
+ str_buf[0] = '.';
+ str_buf[1] = '\0';
+ out_len = 0;
+ tp = netsnmp_sprint_realloc_objid_tree(&str_bufp, &str_buf_len,
+ &out_len, 0, &buf_over,
+ vars->name,vars->name_length);
+ str_buf[sizeof(str_buf)-1] = '\0';
+
+ if (__is_leaf(tp)) {
+ type = (tp->type ? tp->type : tp->parent->type);
+ getlabel_flag &= ~NON_LEAF_NAME;
+ } else {
+ getlabel_flag |= NON_LEAF_NAME;
+ type = __translate_asn_type(vars->type);
+ }
+
+ __get_label_iid((char *) str_buf, &tag, &iid, getlabel_flag);
+
+ if (_debug_level) printf("netsnmp_walk: filling response: %s:%s\n", tag, iid);
+
+ py_netsnmp_attr_set_string(varbind, "tag", tag, STRLEN(tag));
+ py_netsnmp_attr_set_string(varbind, "iid", iid, STRLEN(iid));
+
+ __get_type_str(type, type_str);
+
+ py_netsnmp_attr_set_string(varbind, "type", type_str,
+ strlen(type_str));
+
+ len = __snprint_value((char *) str_buf,sizeof(str_buf),
+ vars,tp,type,sprintval_flag);
+ str_buf[len] = '\0';
+
+ py_netsnmp_attr_set_string(varbind, "val", (char *) str_buf,
+ len);
+
+ /* push the varbind onto the return varbinds */
+ PyList_Append(varbinds, varbind);
+
+ /* save in return tuple as well */
+ /* save in return tuple as well - steals ref */
+ _PyTuple_Resize(&val_tuple, result_count+1);
+ PyTuple_SetItem(val_tuple, result_count++,
+ (len ? Py_BuildValue("s#", str_buf, len) :
+ Py_BuildValue("")));
+
+
+ } else {
+ /* Return None for this variable. */
+ _PyTuple_Resize(&val_tuple, result_count+1);
+ PyTuple_SetItem(val_tuple, result_count++, Py_BuildValue(""));
+ printf("netsnmp_walk: bad varbind (%d)\n", varlist_ind);
+ }
+ Py_XDECREF(varbind);
+
+ memcpy(oid_arr_broken_check[varlist_ind], vars->name,
+ sizeof(oid) * vars->name_length);
+ oid_arr_broken_check_len[varlist_ind] = vars->name_length;
+
+ snmp_add_null_var(newpdu, vars->name,
+ vars->name_length);
+ }
+ pdu = newpdu;
+ }
+ if (response)
+ snmp_free_pdu(response);
+ }
+
+ /* Reset the library's behavior for numeric/symbolic OID's. */
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ old_format);
+
+
+ if (PyErr_Occurred()) {
+ /* propagate error */
+ if (verbose)
+ printf("error: walk response processing: unknown python error");
+ Py_DECREF(val_tuple);
+ }
+ }
+
+ done:
+ Py_XDECREF(varbinds);
+ SAFE_FREE(oid_arr_len);
+ SAFE_FREE(oid_arr_broken_check_len);
+ for(varlist_ind = 0; varlist_ind < varlist_len; varlist_ind ++) {
+ SAFE_FREE(oid_arr[varlist_ind]);
+ SAFE_FREE(oid_arr_broken_check[varlist_ind]);
+ }
+ SAFE_FREE(oid_arr);
+ SAFE_FREE(oid_arr_broken_check);
+ return (val_tuple ? val_tuple : Py_BuildValue(""));
+}
+
+
+static PyObject *
+netsnmp_getbulk(PyObject *self, PyObject *args)
+{
+ int nonrepeaters;
+ int maxrepetitions;
+ PyObject *session;
+ PyObject *varlist;
+ PyObject *varbinds;
+ PyObject *varbind;
+ PyObject *varbinds_iter;
+ PyObject *val_tuple = NULL;
+ int varbind_ind;
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *vars;
+ struct tree *tp;
+ int len;
+ oid *oid_arr;
+ int oid_arr_len = MAX_OID_LEN;
+ int type;
+ char type_str[MAX_TYPE_NAME_LEN];
+ u_char str_buf[STR_BUF_SIZE], *str_bufp = str_buf;
+ size_t str_buf_len = sizeof(str_buf);
+ size_t out_len = 0;
+ int buf_over = 0;
+ char *tag;
+ char *iid;
+ int getlabel_flag = NO_FLAGS;
+ int sprintval_flag = USE_BASIC;
+ int verbose = py_netsnmp_verbose();
+ int old_format;
+ int best_guess;
+ int retry_nosuch;
+ int err_ind;
+ int err_num;
+ char err_str[STR_BUF_SIZE];
+ char *tmpstr;
+ Py_ssize_t tmplen;
+
+ oid_arr = calloc(MAX_OID_LEN, sizeof(oid));
+
+ if (oid_arr && args) {
+
+ if (!PyArg_ParseTuple(args, "OiiO", &session, &nonrepeaters,
+ &maxrepetitions, &varlist)) {
+ goto done;
+ }
+
+ if (varlist && (varbinds = PyObject_GetAttrString(varlist, "varbinds"))) {
+
+ ss = (SnmpSession *)py_netsnmp_attr_void_ptr(session, "sess_ptr");
+
+ if (py_netsnmp_attr_string(session, "ErrorStr", &tmpstr, &tmplen) < 0) {
+ goto done;
+ }
+ memcpy(&err_str, tmpstr, tmplen);
+ err_num = py_netsnmp_attr_long(session, "ErrorNum");
+ err_ind = py_netsnmp_attr_long(session, "ErrorInd");
+
+ if (py_netsnmp_attr_long(session, "UseLongNames"))
+ getlabel_flag |= USE_LONG_NAMES;
+ if (py_netsnmp_attr_long(session, "UseNumeric"))
+ getlabel_flag |= USE_NUMERIC_OIDS;
+ if (py_netsnmp_attr_long(session, "UseEnums"))
+ sprintval_flag = USE_ENUMS;
+ if (py_netsnmp_attr_long(session, "UseSprintValue"))
+ sprintval_flag = USE_SPRINT_VALUE;
+ best_guess = py_netsnmp_attr_long(session, "BestGuess");
+ retry_nosuch = py_netsnmp_attr_long(session, "RetryNoSuch");
+
+ pdu = snmp_pdu_create(SNMP_MSG_GETBULK);
+
+ pdu->errstat = nonrepeaters;
+ pdu->errindex = maxrepetitions;
+
+ varbinds_iter = PyObject_GetIter(varbinds);
+
+ while (varbinds_iter && (varbind = PyIter_Next(varbinds_iter))) {
+ if (py_netsnmp_attr_string(varbind, "tag", &tag, NULL) < 0 ||
+ py_netsnmp_attr_string(varbind, "iid", &iid, NULL) < 0)
+ {
+ oid_arr_len = 0;
+ } else {
+ tp = __tag2oid(tag, iid, oid_arr, &oid_arr_len, NULL, best_guess);
+ }
+
+ if (oid_arr_len) {
+ snmp_add_null_var(pdu, oid_arr, oid_arr_len);
+ } else {
+ if (verbose)
+ printf("error: get: unknown object ID (%s)",
+ (tag ? tag : "<null>"));
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ /* release reference when done */
+ Py_DECREF(varbind);
+ }
+
+ Py_DECREF(varbinds_iter);
+
+ if (PyErr_Occurred()) {
+ /* propagate error */
+ if (verbose)
+ printf("error: get: unknown python error");
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+ __send_sync_pdu(ss, pdu, &response, retry_nosuch, err_str, &err_num,
+ &err_ind);
+ __py_netsnmp_update_session_errors(session, err_str, err_num, err_ind);
+
+ /*
+ ** Set up for numeric or full OID's, if necessary. Save the old
+ ** output format so that it can be restored when we finish -- this
+ ** is a library-wide global, and has to be set/restored for each
+ ** session.
+ */
+ old_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+
+ if (py_netsnmp_attr_long(session, "UseLongNames")) {
+ getlabel_flag |= USE_LONG_NAMES;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_FULL);
+ }
+ /* Setting UseNumeric forces UseLongNames on so check for UseNumeric
+ after UseLongNames (above) to make sure the final outcome of
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT is NETSNMP_OID_OUTPUT_NUMERIC */
+ if (py_netsnmp_attr_long(session, "UseNumeric")) {
+ getlabel_flag |= USE_LONG_NAMES;
+ getlabel_flag |= USE_NUMERIC_OIDS;
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+
+ /* create tuple in which to return results */
+ val_tuple = PyTuple_New(0);
+
+ if(response && response->variables) {
+ /* clear varlist to receive response varbinds*/
+ PySequence_DelSlice(varbinds, 0, PySequence_Length(varbinds));
+
+ if (PyErr_Occurred()) {
+ /* propagate error */
+ if (verbose)
+ printf("error: bulk: deleting old varbinds failed\n");
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+ for(vars = response->variables, varbind_ind=0;
+ vars;
+ vars = vars->next_variable, varbind_ind++) {
+
+ varbind = py_netsnmp_construct_varbind();
+
+ if (PyObject_HasAttrString(varbind, "tag")) {
+ *str_buf = '.';
+ *(str_buf+1) = '\0';
+ out_len = 0;
+ buf_over = 0;
+ str_bufp = str_buf;
+ tp = netsnmp_sprint_realloc_objid_tree(&str_bufp, &str_buf_len,
+ &out_len, 0, &buf_over,
+ vars->name,vars->name_length);
+ str_buf[sizeof(str_buf)-1] = '\0';
+ if (__is_leaf(tp)) {
+ type = (tp->type ? tp->type : tp->parent->type);
+ getlabel_flag &= ~NON_LEAF_NAME;
+ } else {
+ getlabel_flag |= NON_LEAF_NAME;
+ type = __translate_asn_type(vars->type);
+ }
+
+ __get_label_iid((char *) str_buf, &tag, &iid, getlabel_flag);
+
+ py_netsnmp_attr_set_string(varbind, "tag", tag, STRLEN(tag));
+ py_netsnmp_attr_set_string(varbind, "iid", iid, STRLEN(iid));
+
+ __get_type_str(type, type_str);
+
+ py_netsnmp_attr_set_string(varbind, "type", type_str,
+ strlen(type_str));
+
+ len = __snprint_value((char *) str_buf, sizeof(str_buf),
+ vars, tp, type, sprintval_flag);
+ str_buf[len] = '\0';
+
+ py_netsnmp_attr_set_string(varbind, "val", (char *) str_buf, len);
+
+ /* push varbind onto varbinds */
+ PyList_Append(varbinds, varbind);
+
+ /* save in return tuple as well - steals ref */
+ _PyTuple_Resize(&val_tuple, varbind_ind+1);
+ PyTuple_SetItem(val_tuple, varbind_ind,
+ Py_BuildValue("s#", str_buf, len));
+
+ Py_DECREF(varbind);
+
+ } else {
+ PyObject *none = Py_BuildValue(""); /* new ref */
+ /* not sure why making vabind failed - should not happen*/
+ PyList_Append(varbinds, none); /* increments ref */
+ /* Return None for this variable. */
+ PyTuple_SetItem(val_tuple, varbind_ind, none); /* steals ref */
+ }
+ }
+ }
+
+ /* Reset the library's behavior for numeric/symbolic OID's. */
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ old_format);
+
+ if (response) snmp_free_pdu(response);
+
+ Py_DECREF(varbinds);
+
+ }
+
+ if (PyErr_Occurred()) {
+ /* propagate error */
+ if (verbose)
+ printf("error: getbulk response processing: unknown python error");
+ if (val_tuple)
+ Py_DECREF(val_tuple);
+ val_tuple = NULL;
+ }
+ }
+
+ done:
+ SAFE_FREE(oid_arr);
+ return (val_tuple ? val_tuple : Py_BuildValue(""));
+}
+
+static PyObject *
+netsnmp_set(PyObject *self, PyObject *args)
+{
+ PyObject *session;
+ PyObject *varlist;
+ PyObject *varbind;
+ PyObject *ret = NULL;
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu, *response;
+ struct tree *tp;
+ char *tag;
+ char *iid;
+ char *val;
+ char *type_str;
+ int len;
+ oid *oid_arr;
+ int oid_arr_len = MAX_OID_LEN;
+ int type;
+ u_char tmp_val_str[STR_BUF_SIZE];
+ int use_enums;
+ struct enum_list *ep;
+ int verbose = py_netsnmp_verbose();
+ int best_guess;
+ int status;
+ int err_ind;
+ int err_num;
+ char err_str[STR_BUF_SIZE];
+ char *tmpstr;
+ Py_ssize_t tmplen;
+
+ oid_arr = calloc(MAX_OID_LEN, sizeof(oid));
+
+ if (oid_arr && args) {
+
+ if (!PyArg_ParseTuple(args, "OO", &session, &varlist)) {
+ goto done;
+ }
+
+ ss = (SnmpSession *)py_netsnmp_attr_void_ptr(session, "sess_ptr");
+
+ /* PyObject_SetAttrString(); */
+ if (py_netsnmp_attr_string(session, "ErrorStr", &tmpstr, &tmplen) < 0) {
+ goto done;
+ }
+
+ use_enums = py_netsnmp_attr_long(session, "UseEnums");
+
+ best_guess = py_netsnmp_attr_long(session, "BestGuess");
+
+ pdu = snmp_pdu_create(SNMP_MSG_SET);
+
+ if (varlist) {
+ PyObject *varlist_iter = PyObject_GetIter(varlist);
+
+ while (varlist_iter && (varbind = PyIter_Next(varlist_iter))) {
+ if (py_netsnmp_attr_string(varbind, "tag", &tag, NULL) < 0 ||
+ py_netsnmp_attr_string(varbind, "iid", &iid, NULL) < 0)
+ {
+ oid_arr_len = 0;
+ } else {
+ tp = __tag2oid(tag, iid, oid_arr, &oid_arr_len, &type, best_guess);
+ }
+
+ if (oid_arr_len==0) {
+ if (verbose)
+ printf("error: set: unknown object ID (%s)",
+ (tag?tag:"<null>"));
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+
+ if (type == TYPE_UNKNOWN) {
+ if (py_netsnmp_attr_string(varbind, "type", &type_str, NULL) < 0) {
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ type = __translate_appl_type(type_str);
+ if (type == TYPE_UNKNOWN) {
+ if (verbose)
+ printf("error: set: no type found for object");
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ }
+
+ if (py_netsnmp_attr_string(varbind, "val", &val, &tmplen) < 0) {
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ memset(tmp_val_str, 0, sizeof(tmp_val_str));
+ if ( tmplen >= sizeof(tmp_val_str)) {
+ tmplen = sizeof(tmp_val_str)-1;
+ }
+ memcpy(tmp_val_str, val, tmplen);
+ if (type==TYPE_INTEGER && use_enums && tp && tp->enums) {
+ for(ep = tp->enums; ep; ep = ep->next) {
+ if (val && !strcmp(ep->label, val)) {
+ snprintf((char *) tmp_val_str, sizeof(tmp_val_str), "%d",
+ ep->value);
+ break;
+ }
+ }
+ }
+ len = (int)tmplen;
+ status = __add_var_val_str(pdu, oid_arr, oid_arr_len,
+ (char *) tmp_val_str, len, type);
+
+ if (verbose && status == FAILURE)
+ printf("error: set: adding variable/value to PDU");
+
+ /* release reference when done */
+ Py_DECREF(varbind);
+ }
+
+ Py_DECREF(varlist_iter);
+
+ if (PyErr_Occurred()) {
+ /* propagate error */
+ if (verbose)
+ printf("error: set: unknown python error");
+ snmp_free_pdu(pdu);
+ goto done;
+ }
+ }
+
+ status = __send_sync_pdu(ss, pdu, &response, NO_RETRY_NOSUCH,
+ err_str, &err_num, &err_ind);
+ __py_netsnmp_update_session_errors(session, err_str, err_num, err_ind);
+
+ if (response) snmp_free_pdu(response);
+
+ if (status == STAT_SUCCESS)
+ ret = Py_BuildValue("i",1); /* success, return True */
+ else
+ ret = Py_BuildValue("i",0); /* fail, return False */
+ }
+ done:
+ SAFE_FREE(oid_arr);
+ return (ret ? ret : Py_BuildValue(""));
+}
+
+
+static PyMethodDef ClientMethods[] = {
+ {"session", netsnmp_create_session, METH_VARARGS,
+ "create a netsnmp session."},
+ {"session_v3", netsnmp_create_session_v3, METH_VARARGS,
+ "create a netsnmp session."},
+ {"session_tunneled", netsnmp_create_session_tunneled, METH_VARARGS,
+ "create a tunneled netsnmp session over tls, dtls or ssh."},
+ {"delete_session", netsnmp_delete_session, METH_VARARGS,
+ "create a netsnmp session."},
+ {"get", netsnmp_get, METH_VARARGS,
+ "perform an SNMP GET operation."},
+ {"getnext", netsnmp_getnext, METH_VARARGS,
+ "perform an SNMP GETNEXT operation."},
+ {"getbulk", netsnmp_getbulk, METH_VARARGS,
+ "perform an SNMP GETBULK operation."},
+ {"set", netsnmp_set, METH_VARARGS,
+ "perform an SNMP SET operation."},
+ {"walk", netsnmp_walk, METH_VARARGS,
+ "perform an SNMP WALK operation."},
+ {NULL, NULL, 0, NULL} /* Sentinel */
+};
+
+PyMODINIT_FUNC
+initclient_intf(void)
+{
+ (void) Py_InitModule("client_intf", ClientMethods);
+}
+
+
+
+
+
diff --git a/python/netsnmp/netsnmp-feature-definitions.h b/python/netsnmp/netsnmp-feature-definitions.h
new file mode 100644
index 0000000..389416a
--- /dev/null
+++ b/python/netsnmp/netsnmp-feature-definitions.h
@@ -0,0 +1,6 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_require(snprint_value)
+netsnmp_feature_require(enable_stderrlog)
+
diff --git a/python/netsnmp/tests/__init__.py b/python/netsnmp/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/python/netsnmp/tests/__init__.py
diff --git a/python/netsnmp/tests/snmpd.conf b/python/netsnmp/tests/snmpd.conf
new file mode 100644
index 0000000..b62e4c7
--- /dev/null
+++ b/python/netsnmp/tests/snmpd.conf
@@ -0,0 +1,425 @@
+###############################################################################
+#
+# EXAMPLE.conf:
+# An example configuration file for configuring the ucd-snmp snmpd agent.
+#
+###############################################################################
+#
+# This file is intended to only be an example. If, however, you want
+# to use it, it should be placed in /usr/local/etc/snmp/snmpd.conf.
+# When the snmpd agent starts up, this is where it will look for it.
+#
+# You might be interested in generating your own snmpd.conf file using
+# the "snmpconf" program (perl script) instead. It's a nice menu
+# based interface to writing well commented configuration files. Try it!
+#
+# Note: This file is automatically generated from EXAMPLE.conf.def.
+# Do NOT read the EXAMPLE.conf.def file! Instead, after you have run
+# configure & make, and then make sure you read the EXAMPLE.conf file
+# instead, as it will tailor itself to your configuration.
+
+# All lines beginning with a '#' are comments and are intended for you
+# to read. All other lines are configuration commands for the agent.
+
+#
+# PLEASE: read the snmpd.conf(5) manual page as well!
+#
+
+
+###############################################################################
+# Access Control
+###############################################################################
+
+# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
+# KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
+# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.
+
+# By far, the most common question I get about the agent is "why won't
+# it work?", when really it should be "how do I configure the agent to
+# allow me to access it?"
+#
+# By default, the agent responds to the "public" community for read
+# only access, if run out of the box without any configuration file in
+# place. The following examples show you other ways of configuring
+# the agent so that you can change the community names, and give
+# yourself write access as well.
+#
+# The following lines change the access permissions of the agent so
+# that the COMMUNITY string provides read-only access to your entire
+# NETWORK (EG: 10.10.10.0/24), and read/write access to only the
+# localhost (127.0.0.1, not its real ipaddress).
+#
+# For more information, read the FAQ as well as the snmpd.conf(5)
+# manual page.
+
+####
+# First, map the community name (COMMUNITY) into a security name
+# (local and mynetwork, depending on where the request is coming
+# from):
+
+# sec.name source community
+com2sec local localhost public
+com2sec mynetwork 192.168.1.0/24 public
+
+####
+# Second, map the security names into group names:
+
+# sec.model sec.name
+group MyRWGroup v1 local
+group MyRWGroup v2c local
+group MyRWGroup usm local
+group MyRWGroup usm initial
+group MyROGroup v1 mynetwork
+group MyROGroup v2c mynetwork
+group MyROGroup usm mynetwork
+
+####
+# Third, create a view for us to let the groups have rights to:
+
+# incl/excl subtree mask
+view all included .1 80
+
+####
+# Finally, grant the 2 groups access to the 1 view with different
+# write permissions:
+
+# context sec.model sec.level match read write notif
+access MyROGroup "" any noauth exact all none none
+access MyRWGroup "" any noauth exact all all none
+
+# -----------------------------------------------------------------------------
+
+rwuser initial priv
+createUser initial MD5 auth_pass DES priv_pass
+
+###############################################################################
+# System contact information
+#
+
+# It is also possible to set the sysContact and sysLocation system
+# variables through the snmpd.conf file. **PLEASE NOTE** that setting
+# the value of these objects here makes these objects READ-ONLY
+# (regardless of any access control settings). Any attempt to set the
+# value of an object whose value is given here will fail with an error
+# status of notWritable.
+
+# syslocation Right here, right now.
+syscontact G. S. Marzot <gmarzot@marzot.net>
+
+# Example output of snmpwalk:
+# % snmpwalk -v 1 -c public localhost system
+# system.sysDescr.0 = "SunOS name sun4c"
+# system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4
+# system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
+# system.sysContact.0 = "Me <me@somewhere.org>"
+# system.sysName.0 = "name"
+# system.sysLocation.0 = "Right here, right now."
+# system.sysServices.0 = 72
+
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# Process checks.
+#
+# The following are examples of how to use the agent to check for
+# processes running on the host. The syntax looks something like:
+#
+# proc NAME [MAX=0] [MIN=0]
+#
+# NAME: the name of the process to check for. It must match
+# exactly (ie, http will not find httpd processes).
+# MAX: the maximum number allowed to be running. Defaults to 0.
+# MIN: the minimum number to be running. Defaults to 0.
+
+#
+# Examples:
+#
+
+# Make sure mountd is running
+proc mountd
+
+# Make sure there are no more than 4 ntalkds running, but 0 is ok too.
+proc ntalkd 4
+
+# Make sure at least one sendmail, but less than or equal to 10 are running.
+proc sendmail 10 1
+
+# A snmpwalk of the prTable would look something like this:
+#
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.2
+# enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1
+# enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2
+# enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3
+# enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd"
+# enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd"
+# enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail"
+# enterprises.ucdavis.procTable.prEntry.prMin.1 = 0
+# enterprises.ucdavis.procTable.prEntry.prMin.2 = 0
+# enterprises.ucdavis.procTable.prEntry.prMin.3 = 1
+# enterprises.ucdavis.procTable.prEntry.prMax.1 = 0
+# enterprises.ucdavis.procTable.prEntry.prMax.2 = 4
+# enterprises.ucdavis.procTable.prEntry.prMax.3 = 10
+# enterprises.ucdavis.procTable.prEntry.prCount.1 = 0
+# enterprises.ucdavis.procTable.prEntry.prCount.2 = 0
+# enterprises.ucdavis.procTable.prEntry.prCount.3 = 1
+# enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1
+# enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0
+# enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0
+# enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process running."
+# enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = ""
+# enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = ""
+# enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0
+# enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0
+# enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0
+#
+# Note that the errorFlag for mountd is set to 1 because one is not
+# running (in this case an rpc.mountd is, but thats not good enough),
+# and the ErrMessage tells you what's wrong. The configuration
+# imposed in the snmpd.conf file is also shown.
+#
+# Special Case: When the min and max numbers are both 0, it assumes
+# you want a max of infinity and a min of 1.
+#
+
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# Executables/scripts
+#
+
+#
+# You can also have programs run by the agent that return a single
+# line of output and an exit code. Here are two examples.
+#
+# exec NAME PROGRAM [ARGS ...]
+#
+# NAME: A generic name.
+# PROGRAM: The program to run. Include the path!
+# ARGS: optional arguments to be passed to the program
+
+# a simple hello world
+exec echotest /bin/echo hello world
+
+# Run a shell script containing:
+#
+# #!/bin/sh
+# echo hello world
+# echo hi there
+# exit 35
+#
+# Note: this has been specifically commented out to prevent
+# accidental security holes due to someone else on your system writing
+# a /tmp/shtest before you do. Uncomment to use it.
+#
+#exec shelltest /bin/sh /tmp/shtest
+
+# Then,
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8
+# enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1
+# enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2
+# enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest"
+# enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest"
+# enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world"
+# enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest"
+# enterprises.ucdavis.extTable.extEntry.extResult.1 = 0
+# enterprises.ucdavis.extTable.extEntry.extResult.2 = 35
+# enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world."
+# enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world."
+# enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0
+# enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0
+
+# Note that the second line of the /tmp/shtest shell script is cut
+# off. Also note that the exit status of 35 was returned.
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# disk checks
+#
+
+# The agent can check the amount of available disk space, and make
+# sure it is above a set limit.
+
+# disk PATH [MIN=DEFDISKMINIMUMSPACE]
+#
+# PATH: mount path to the disk in question.
+# MIN: Disks with space below this value will have the Mib's errorFlag set.
+# Default value = DEFDISKMINIMUMSPACE.
+
+# Check the / partition and make sure it contains at least 10 megs.
+
+disk / 10000
+
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9
+# enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0
+# enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F
+# enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0"
+# enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000
+# enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130
+# enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325
+# enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092
+# enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58
+# enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0
+# enterprises.ucdavis.diskTable.dskEntry.diskErrorMsg.1 = ""
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# load average checks
+#
+
+# load [1MAX=DEFMAXLOADAVE] [5MAX=DEFMAXLOADAVE] [15MAX=DEFMAXLOADAVE]
+#
+# 1MAX: If the 1 minute load average is above this limit at query
+# time, the errorFlag will be set.
+# 5MAX: Similar, but for 5 min average.
+# 15MAX: Similar, but for 15 min average.
+
+# Check for loads:
+load 12 14 14
+
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.10
+# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1
+# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2
+# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3
+# enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1"
+# enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5"
+# enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15"
+# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39
+# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31
+# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36
+# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00"
+# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00"
+# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00"
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = ""
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = ""
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = ""
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# Extensible sections.
+#
+
+# This alleviates the multiple line output problem found in the
+# previous executable mib by placing each mib in its own mib table:
+
+# Run a shell script containing:
+#
+# #!/bin/sh
+# echo hello world
+# echo hi there
+# exit 35
+#
+# Note: this has been specifically commented out to prevent
+# accidental security holes due to someone else on your system writing
+# a /tmp/shtest before you do. Uncomment to use it.
+#
+# exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest
+
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
+# enterprises.ucdavis.50.1.1 = 1
+# enterprises.ucdavis.50.2.1 = "shelltest"
+# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
+# enterprises.ucdavis.50.100.1 = 35
+# enterprises.ucdavis.50.101.1 = "hello world."
+# enterprises.ucdavis.50.101.2 = "hi there."
+# enterprises.ucdavis.50.102.1 = 0
+
+# Now the Output has grown to two lines, and we can see the 'hi
+# there.' output as the second line from our shell script.
+#
+# Note that you must alter the mib.txt file to be correct if you want
+# the .50.* outputs above to change to reasonable text descriptions.
+
+# Other ideas:
+#
+# exec .1.3.6.1.4.1.2021.51 ps /bin/ps
+# exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top
+# exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# Pass through control.
+#
+
+# Usage:
+# pass MIBOID EXEC-COMMAND
+#
+# This will pass total control of the mib underneath the MIBOID
+# portion of the mib to the EXEC-COMMAND.
+#
+# Note: You'll have to change the path of the passtest script to your
+# source directory or install it in the given location.
+#
+# Example: (see the script for details)
+# (commented out here since it requires that you place the
+# script in the right location. (its not installed by default))
+
+# pass .1.3.6.1.4.1.2021.255 /bin/sh PREFIX/local/passtest
+
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255
+# enterprises.ucdavis.255.1 = "life the universe and everything"
+# enterprises.ucdavis.255.2.1 = 42
+# enterprises.ucdavis.255.2.2 = OID: 42.42.42
+# enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42
+# enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1
+# enterprises.ucdavis.255.5 = 42
+# enterprises.ucdavis.255.6 = Gauge: 42
+#
+# % snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.255.5
+# enterprises.ucdavis.255.5 = 42
+#
+# % snmpset -v 1 -c public localhost .1.3.6.1.4.1.2021.255.1 s "New string"
+# enterprises.ucdavis.255.1 = "New string"
+#
+
+# For specific usage information, see the man/snmpd.conf.5 manual page
+# as well as the local/passtest script used in the above example.
+
+###############################################################################
+# Subagent control
+#
+
+# The agent can support subagents using a number of extension mechanisms.
+# From the 4.2.1 release, AgentX support is being compiled in by default.
+# However, this is still experimental code, so should not be used on
+# critical production systems.
+# Please see the file README.agentx for more details.
+#
+# If having read, marked, learnt and inwardly digested this information,
+# you decide that you do wish to make use of this mechanism, simply
+# uncomment the following directive.
+#
+# master agentx
+#
+# I repeat - this is *NOT* regarded as suitable for front-line production
+# systems, though it is probably stable enough for day-to-day use.
+# Probably.
+#
+# No refunds will be given.
+
+
+###############################################################################
+# Further Information
+#
+# See the snmpd.conf manual page, and the output of "snmpd -H".
+# MUCH more can be done with the snmpd.conf than is shown as an
+# example here.
+
+certSecName 10 D020A78EAF99FCE276AA9F43063A69698E4F75D1 --rfc822
+rwuser -s tsm hardaker@wjh.hardakers.net
+
+trustCert D020A78EAF99FCE276AA9F43063A69698E4F75D1
diff --git a/python/netsnmp/tests/test.py b/python/netsnmp/tests/test.py
new file mode 100644
index 0000000..e3982f4
--- /dev/null
+++ b/python/netsnmp/tests/test.py
@@ -0,0 +1,321 @@
+""" Runs all unit tests for the netsnmp package. """
+# Copyright (c) 2006 Andy Gross. See LICENSE.txt for details.
+
+import sys
+import unittest
+import netsnmp
+import time
+
+class BasicTests(unittest.TestCase):
+ def testFuncs(self):
+ print ""
+ var = netsnmp.Varbind('sysDescr.0')
+ var = netsnmp.Varbind('sysDescr','0')
+ var = netsnmp.Varbind(
+ '.iso.org.dod.internet.mgmt.mib-2.system.sysDescr','0')
+ var = netsnmp.Varbind(
+ '.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0')
+ var = netsnmp.Varbind('.1.3.6.1.2.1.1.1.0')
+
+ var = netsnmp.Varbind('.1.3.6.1.2.1.1.1','0')
+
+ print "---v1 GET tests -------------------------------------\n"
+ res = netsnmp.snmpget(var,
+ Version = 1,
+ DestHost='localhost',
+ Community='public')
+
+ print "v1 snmpget result: ", res, "\n"
+
+ print "v1 get var: ", var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ print "---v1 GETNEXT tests-------------------------------------\n"
+ res = netsnmp.snmpgetnext(var,
+ Version = 1,
+ DestHost='localhost',
+ Community='public')
+
+ print "v1 snmpgetnext result: ", res, "\n"
+
+ print "v1 getnext var: ", var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ print "---v1 SET tests-------------------------------------\n"
+ var = netsnmp.Varbind('sysLocation','0', 'my new location')
+ res = netsnmp.snmpset(var,
+ Version = 1,
+ DestHost='localhost',
+ Community='public')
+
+ print "v1 snmpset result: ", res, "\n"
+
+ print "v1 set var: ", var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ print "---v1 walk tests-------------------------------------\n"
+ vars = netsnmp.VarList(netsnmp.Varbind('system'))
+
+ print "v1 varlist walk in: "
+ for var in vars:
+ print " ",var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ res = netsnmp.snmpwalk(vars,
+ Version = 1,
+ DestHost='localhost',
+ Community='public')
+ print "v1 snmpwalk result: ", res, "\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+
+ print "---v1 walk 2-------------------------------------\n"
+
+ print "v1 varbind walk in: "
+ var = netsnmp.Varbind('system')
+ res = netsnmp.snmpwalk(var,
+ Version = 1,
+ DestHost='localhost',
+ Community='public')
+ print "v1 snmpwalk result (should be = orig): ", res, "\n"
+
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ print "---v1 multi-varbind test-------------------------------------\n"
+ sess = netsnmp.Session(Version=1,
+ DestHost='localhost',
+ Community='public')
+
+ vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0),
+ netsnmp.Varbind('sysContact', 0),
+ netsnmp.Varbind('sysLocation', 0))
+ vals = sess.get(vars)
+ print "v1 sess.get result: ", vals, "\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ vals = sess.getnext(vars)
+ print "v1 sess.getnext result: ", vals, "\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'),
+ netsnmp.Varbind('sysORLastChange'),
+ netsnmp.Varbind('sysORID'),
+ netsnmp.Varbind('sysORDescr'),
+ netsnmp.Varbind('sysORUpTime'))
+
+ vals = sess.getbulk(2, 8, vars)
+ print "v1 sess.getbulk result: ", vals, "\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ print "---v1 set2-------------------------------------\n"
+
+ vars = netsnmp.VarList(
+ netsnmp.Varbind('sysLocation', '0', 'my newer location'))
+ res = sess.set(vars)
+ print "v1 sess.set result: ", res, "\n"
+
+ print "---v1 walk3-------------------------------------\n"
+ vars = netsnmp.VarList(netsnmp.Varbind('system'))
+
+ vals = sess.walk(vars)
+ print "v1 sess.walk result: ", vals, "\n"
+
+ for var in vars:
+ print " ",var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ print "---v2c get-------------------------------------\n"
+
+ sess = netsnmp.Session(Version=2,
+ DestHost='localhost',
+ Community='public')
+
+ sess.UseEnums = 1
+ sess.UseLongNames = 1
+
+ vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0),
+ netsnmp.Varbind('sysContact', 0),
+ netsnmp.Varbind('sysLocation', 0))
+ vals = sess.get(vars)
+ print "v2 sess.get result: ", vals, "\n"
+
+ print "---v2c getnext-------------------------------------\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+ print "\n"
+
+ vals = sess.getnext(vars)
+ print "v2 sess.getnext result: ", vals, "\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+ print "\n"
+
+ print "---v2c getbulk-------------------------------------\n"
+
+ vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'),
+ netsnmp.Varbind('sysORLastChange'),
+ netsnmp.Varbind('sysORID'),
+ netsnmp.Varbind('sysORDescr'),
+ netsnmp.Varbind('sysORUpTime'))
+
+ vals = sess.getbulk(2, 8, vars)
+ print "v2 sess.getbulk result: ", vals, "\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+ print "\n"
+
+ print "---v2c set-------------------------------------\n"
+
+ vars = netsnmp.VarList(
+ netsnmp.Varbind('sysLocation','0','my even newer location'))
+
+ res = sess.set(vars)
+ print "v2 sess.set result: ", res, "\n"
+
+ print "---v2c walk-------------------------------------\n"
+ vars = netsnmp.VarList(netsnmp.Varbind('system'))
+
+ vals = sess.walk(vars)
+ print "v2 sess.walk result: ", vals, "\n"
+
+ for var in vars:
+ print " ",var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ print "---v3 setup-------------------------------------\n"
+ sess = netsnmp.Session(Version=3,
+ DestHost='localhost',
+ SecLevel='authPriv',
+ SecName='initial',
+ PrivPass='priv_pass',
+ AuthPass='auth_pass')
+
+ sess.UseSprintValue = 1
+
+ vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0),
+ netsnmp.Varbind('sysContact', 0),
+ netsnmp.Varbind('sysLocation', 0))
+ print "---v3 get-------------------------------------\n"
+ vals = sess.get(vars)
+ print "v3 sess.get result: ", vals, "\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+ print "\n"
+
+ print "---v3 getnext-------------------------------------\n"
+
+ vals = sess.getnext(vars)
+ print "v3 sess.getnext result: ", vals, "\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+ print "\n"
+
+ vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'),
+ netsnmp.Varbind('sysORLastChange'),
+ netsnmp.Varbind('sysORID'),
+ netsnmp.Varbind('sysORDescr'),
+ netsnmp.Varbind('sysORUpTime'))
+
+ vals = sess.getbulk(2, 8, vars)
+ print "v3 sess.getbulk result: ", vals, "\n"
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+ print "\n"
+
+ print "---v3 set-------------------------------------\n"
+
+ vars = netsnmp.VarList(
+ netsnmp.Varbind('sysLocation','0', 'my final destination'))
+ res = sess.set(vars)
+ print "v3 sess.set result: ", res, "\n"
+
+ print "---v3 walk-------------------------------------\n"
+ vars = netsnmp.VarList(netsnmp.Varbind('system'))
+
+ vals = sess.walk(vars)
+ print "v3 sess.walk result: ", vals, "\n"
+
+ for var in vars:
+ print " ",var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+
+class SetTests(unittest.TestCase):
+ def testFuncs(self):
+ print "\n-------------- SET Test Start ----------------------------\n"
+
+ var = netsnmp.Varbind('sysUpTime','0')
+ res = netsnmp.snmpget(var, Version = 1, DestHost='localhost',
+ Community='public')
+ print "uptime = ", res[0]
+
+
+ var = netsnmp.Varbind('versionRestartAgent','0', 1)
+ res = netsnmp.snmpset(var, Version = 1, DestHost='localhost',
+ Community='public')
+
+ var = netsnmp.Varbind('sysUpTime','0')
+ res = netsnmp.snmpget(var, Version = 1, DestHost='localhost',
+ Community='public')
+ print "uptime = ", res[0]
+
+ var = netsnmp.Varbind('nsCacheEntry')
+ res = netsnmp.snmpgetnext(var, Version = 1, DestHost='localhost',
+ Community='public')
+ print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ var.val = 65
+ res = netsnmp.snmpset(var, Version = 1, DestHost='localhost',
+ Community='public')
+ res = netsnmp.snmpget(var, Version = 1, DestHost='localhost',
+ Community='public')
+ print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')'
+
+ sess = netsnmp.Session(Version = 1, DestHost='localhost',
+ Community='public')
+
+ vars = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.2.116.101.115.116','','.1.3.6.1.6.1.1'),
+ netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.3.116.101.115.116','','1234'),
+ netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 4))
+ res = sess.set(vars)
+
+ print "res = ", res
+
+ vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'),
+ netsnmp.Varbind('snmpTargetAddrTAddress'),
+ netsnmp.Varbind('snmpTargetAddrRowStatus'))
+
+ res = sess.getnext(vars)
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+ print "\n"
+
+ vars = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 6))
+
+ res = sess.set(vars)
+
+ print "res = ", res
+
+ vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'),
+ netsnmp.Varbind('snmpTargetAddrTAddress'),
+ netsnmp.Varbind('snmpTargetAddrRowStatus'))
+
+ res = sess.getnext(vars)
+
+ for var in vars:
+ print var.tag, var.iid, "=", var.val, '(',var.type,')'
+ print "\n"
+
+ print "\n-------------- SET Test End ----------------------------\n"
+
+
+if __name__=='__main__':
+ unittest.main()
diff --git a/python/setup.py b/python/setup.py
new file mode 100644
index 0000000..c520df9
--- /dev/null
+++ b/python/setup.py
@@ -0,0 +1,46 @@
+from distutils.core import setup, Extension
+from setuptools import setup, Extension, find_packages
+import os
+import re
+import string
+import sys
+
+intree=0
+
+args = sys.argv[:]
+for arg in args:
+ if string.find(arg,'--basedir=') == 0:
+ basedir = string.split(arg,'=')[1]
+ sys.argv.remove(arg)
+ intree=1
+
+if intree:
+ netsnmp_libs = os.popen(basedir+'/net-snmp-config --libs').read()
+ libdir = os.popen(basedir+'/net-snmp-config --build-lib-dirs '+basedir).read()
+ incdir = os.popen(basedir+'/net-snmp-config --build-includes '+basedir).read()
+ libs = re.findall(r"-l(\S+)", netsnmp_libs)
+ libdirs = re.findall(r"-L(\S+)", libdir)
+ incdirs = re.findall(r"-I(\S+)", incdir)
+else:
+ netsnmp_libs = os.popen('net-snmp-config --libs').read()
+ libdirs = re.findall(r"-L(\S+)", netsnmp_libs)
+ incdirs = []
+ libs = re.findall(r"-l(\S+)", netsnmp_libs)
+
+setup(
+ name="netsnmp-python", version="1.0a1",
+ description = 'The Net-SNMP Python Interface',
+ author = 'G. S. Marzot',
+ author_email = 'giovanni.marzot@sparta.com',
+ url = 'http://www.net-snmp.org',
+ license="BSD",
+ packages=find_packages(),
+ test_suite = "netsnmp.tests.test",
+
+ ext_modules = [
+ Extension("netsnmp.client_intf", ["netsnmp/client_intf.c"],
+ library_dirs=libdirs,
+ include_dirs=incdirs,
+ libraries=libs )
+ ]
+ )
diff --git a/sedscript.in b/sedscript.in
new file mode 100644
index 0000000..7814ce9
--- /dev/null
+++ b/sedscript.in
@@ -0,0 +1,109 @@
+#include <net-snmp/net-snmp-config.h>
+#include <agent/mibgroup/mibdefs.h>
+
+s/EREMOVEMEXTENSIBLEDOTMIB/NETSNMP_UCDAVIS_DOT_MIB/g
+
+s/PREMOVEMEROCMIBNUM/NETSNMP_PROCMIBNUM/g
+s/NETSNMP_PREMOVEMEROCMIBNUM/NETSNMP_PROCMIBNUM/g
+s/SREMOVEMEHELLMIBNUM/NETSNMP_SHELLMIBNUM/g
+s/NETSNMP_SREMOVEMEHELLMIBNUM/NETSNMP_SHELLMIBNUM/g
+s/MREMOVEMEEMMIBNUM/NETSNMP_MEMMIBNUM/g
+s/NETSNMP_MREMOVEMEEMMIBNUM/NETSNMP_MEMMIBNUM/g
+s/DREMOVEMEISKMIBNUM/NETSNMP_DISKMIBNUM/g
+s/NETSNMP_DREMOVEMEISKMIBNUM/NETSNMP_DISKMIBNUM/g
+s/LREMOVEMEOADAVEMIBNUM/NETSNMP_LOADAVEMIBNUM/g
+s/NETSNMP_LREMOVEMEOADAVEMIBNUM/NETSNMP_LOADAVEMIBNUM/g
+s/VREMOVEMEERSIONMIBNUM/NETSNMP_VERSIONMIBNUM/g
+s/NETSNMP_VREMOVEMEERSIONMIBNUM/NETSNMP_VERSIONMIBNUM/g
+s/EREMOVEMERRORMIBNUM/NETSNMP_ERRORMIBNUM/g
+s/NETSNMP_EREMOVEMERRORMIBNUM/NETSNMP_ERRORMIBNUM/g
+
+s/MREMOVEMEIBINDEX/MIBINDEX/g
+s/EREMOVEMERRORFLAG/ERRORFLAG/g
+s/EREMOVEMERRORMSG/ERRORMSG/g
+s/EREMOVEMERRORFIX/ERRORFIX/g
+s/EREMOVEMERRORNAME/ERRORNAME/g
+
+#ifdef USING_UCD_SNMP_PROC_MODULE
+#include <agent/mibgroup/ucd-snmp/proc.h>
+s/PREMOVEMEROCMIN/3/g
+s/PREMOVEMEROCMAX/4/g
+s/PREMOVEMEROCCOUNT/5/g
+#endif
+
+#ifdef USING_UCD_SNMP_EXTENSIBLE_MODULE
+#include <agent/mibgroup/ucd-snmp/extensible.h>
+s/SREMOVEMEHELLCOMMAND/SHELLCOMMAND/g
+#endif
+
+
+#ifdef USING_UCD_SNMP_MEMORY_MODULE
+#include <agent/mibgroup/ucd-snmp/memory.h>
+s/MREMOVEMEEMTOTALSWAPTXT/MEMTOTALSWAPTXT/g
+s/MREMOVEMEEMUSEDSWAPTXT/MEMUSEDSWAPTXT/g
+s/MREMOVEMEEMTOTALREALTXT/MEMTOTALREALTXT/g
+s/MREMOVEMEEMUSEDREALTXT/MEMUSEDREALTXT/g
+s/MREMOVEMEEMTOTALSWAP/MEMTOTALSWAP/g
+s/MREMOVEMEEMUSEDSWAP/MEMUSEDSWAP/g
+s/MREMOVEMEEMTOTALREAL/MEMTOTALREAL/g
+s/MREMOVEMEEMUSEDREAL/MEMUSEDREAL/g
+s/MREMOVEMEEMTOTALFREE/MEMTOTALFREE/g
+s/MREMOVEMEEMSWAPMINIMUM/MEMSWAPMINIMUM/g
+#endif
+
+#ifdef USING_UCD_SNMP_DISK_MODULE
+#include <agent/mibgroup/ucd-snmp/disk.h>
+s/DREMOVEMEEFDISKMINIMUMSPACE/DEFDISKMINIMUMSPACE/g
+s/DREMOVEMEEFDISKMINPERCENT/DEFDISKMAXIMUMPERCENT/g
+s/DREMOVEMEISKDEVICE/DISKDEVICE/g
+s/DREMOVEMEISKMINIMUM/DISKMINIMUM/g
+s/DREMOVEMEISKTOTAL/DISKTOTAL/g
+s/DREMOVEMEISKAVAIL/DISKAVAIL/g
+s/DREMOVEMEISKUSED/DISKUSED/g
+s/DREMOVEMEISKPERCENT/DISKPERCENT/g
+s/DREMOVEMEISKPERCENTNODE/DISKPERCENTNODE/g
+#endif
+
+#ifdef USING_UCD_SNMP_LOADAVE_MODULE
+#include <agent/mibgroup/ucd-snmp/loadave.h>
+s/DREMOVEMEEFMAXLOADAVE/NETSNMP_DEFMAXLOADAVE/g
+s/NETSNMP_DREMOVEMEEFMAXLOADAVE/NETSNMP_DEFMAXLOADAVE/g
+s/LREMOVEMEOADAVE/LOADAVE/g
+s/LREMOVEMEOADMAXVAL/LOADMAXVAL/g
+#endif
+
+#ifdef USING_UCD_SNMP_VERSIONINFO_MODULE
+#include <agent/mibgroup/ucd-snmp/versioninfo.h>
+s/VREMOVEMEERDATE/VERDATE/g
+s/VREMOVEMEERCDATE/VERCDATE/g
+s/VREMOVEMEERIDENT/VERIDENT/g
+s/VREMOVEMEERCLEARCACHE/VERCLEARCACHE/g
+s/VREMOVEMEERUPDATECONFIG/VERUPDATECONFIG/g
+s/VREMOVEMEERRESTARTAGENT/VERRESTARTAGENT/g
+#endif
+
+s/EREMOVEMERRORTIMELENGTH/ERRORTIMELENGTH/g
+
+s/AREMOVEMEGENTID/AGENTID/g
+s/HREMOVEMEPUX9ID/HPUX9ID/g
+s/HREMOVEMEPUX10ID/HPUX10ID/g
+s/HREMOVEMEPUX11ID/HPUX11ID/g
+s/SREMOVEMEUNOS4ID/SUNOS4ID/g
+s/SREMOVEMEOLARISID/SOLARISID/g
+s/OREMOVEMESFID/OSFID/g
+s/UREMOVEMELTRIXID/ULTRIXID/g
+s/NREMOVEMEETBSD1ID/NETBSD1ID/g
+s/FREMOVEMEREEBSDID/FREEBSDID/g
+s/IREMOVEMERIXID/IRIXID/g
+s/LREMOVEMEINUXID/LINUXID/g
+s/BREMOVEMESDIID/BSDIID/g
+s/OREMOVEMEPENBSDID/OPENBSDID/g
+s/WREMOVEMEIN32ID/WIN32ID/g
+s/AREMOVEMEIXID/AIXID/g
+s/MREMOVEMEACOSXID/MACOSXID/g
+s/DREMOVEMERAGONFLYID/DRAGONFLYID/g
+s/UREMOVEMENKNOWNID/UNKNOWNID/g
+
+s#PREMOVEMESCMD#PSCMD#g
+s#AREMOVEMEGENTX_SOCKET#AGENTX_SOCKET#g
+s#NREMOVEMEETSNMP_TEMP_FILE_PATTERN#NETSNMP_TEMP_FILE_PATTERN#g
diff --git a/snmplib/MSG00001.bin b/snmplib/MSG00001.bin
new file mode 100644
index 0000000..25cf424
--- /dev/null
+++ b/snmplib/MSG00001.bin
Binary files differ
diff --git a/snmplib/Makefile.depend b/snmplib/Makefile.depend
new file mode 100644
index 0000000..d7341cf
--- /dev/null
+++ b/snmplib/Makefile.depend
@@ -0,0 +1,3927 @@
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+./asn1.lo: ../include/net-snmp/net-snmp-config.h
+./asn1.lo: ../include/net-snmp/system/linux.h
+./asn1.lo: ../include/net-snmp/system/sysv.h
+./asn1.lo: ../include/net-snmp/system/generic.h
+./asn1.lo: ../include/net-snmp/output_api.h
+./asn1.lo: ../include/net-snmp/types.h
+./asn1.lo: ../include/net-snmp/library/oid.h
+./asn1.lo: ../include/net-snmp/library/types.h
+./asn1.lo: ../include/net-snmp/definitions.h
+./asn1.lo: ../include/net-snmp/library/snmp_api.h
+./asn1.lo: ../include/net-snmp/varbind_api.h
+./asn1.lo: ../include/net-snmp/library/snmp_client.h
+./asn1.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./asn1.lo: ../include/net-snmp/session_api.h
+./asn1.lo: ../include/net-snmp/library/callback.h
+./asn1.lo: ../include/net-snmp/library/snmp_transport.h
+./asn1.lo: ../include/net-snmp/library/snmp_service.h
+./asn1.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./asn1.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./asn1.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./asn1.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./asn1.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./asn1.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./asn1.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./asn1.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./asn1.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./asn1.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./asn1.lo: ../include/net-snmp/library/ucd_compat.h
+./asn1.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./asn1.lo: ../include/net-snmp/library/parse.h
+./asn1.lo: ../include/net-snmp/library/oid_stash.h
+./asn1.lo: ../include/net-snmp/net-snmp-features.h
+./asn1.lo: ../include/net-snmp/library/snmp_impl.h
+./asn1.lo: ../include/net-snmp/library/snmp.h
+./asn1.lo: ../include/net-snmp/library/snmp-tc.h
+./asn1.lo: ../include/net-snmp/library/snmp_debug.h
+./asn1.lo: ../include/net-snmp/library/snmp_logging.h
+./asn1.lo: ../include/net-snmp/utilities.h
+./asn1.lo: ../include/net-snmp/library/system.h
+./asn1.lo: ../include/net-snmp/library/tools.h
+./asn1.lo: ../include/net-snmp/library/int64.h
+./asn1.lo: ../include/net-snmp/library/mt_support.h
+./asn1.lo: ../include/net-snmp/library/snmp_alarm.h
+./asn1.lo: ../include/net-snmp/library/data_list.h
+./asn1.lo: ../include/net-snmp/library/check_varbind.h
+./asn1.lo: ../include/net-snmp/library/container.h
+./asn1.lo: ../include/net-snmp/library/factory.h
+./asn1.lo: ../include/net-snmp/library/container_binary_array.h
+./asn1.lo: ../include/net-snmp/library/container_list_ssll.h
+./asn1.lo: ../include/net-snmp/library/container_iterator.h
+./asn1.lo: ../include/net-snmp/library/container.h
+./asn1.lo: ../include/net-snmp/library/snmp_assert.h
+./asn1.lo: ../include/net-snmp/version.h
+./callback.lo: ../include/net-snmp/net-snmp-config.h
+./callback.lo: ../include/net-snmp/system/linux.h
+./callback.lo: ../include/net-snmp/system/sysv.h
+./callback.lo: ../include/net-snmp/system/generic.h
+./callback.lo: ../include/net-snmp/net-snmp-features.h
+./callback.lo: ../include/net-snmp/types.h
+./callback.lo: ../include/net-snmp/library/oid.h
+./callback.lo: ../include/net-snmp/library/types.h
+./callback.lo: ../include/net-snmp/definitions.h
+./callback.lo: ../include/net-snmp/library/snmp_api.h
+./callback.lo: ../include/net-snmp/varbind_api.h
+./callback.lo: ../include/net-snmp/library/snmp_client.h
+./callback.lo: ../include/net-snmp/pdu_api.h
+./callback.lo: ../include/net-snmp/library/asn1.h
+./callback.lo: ../include/net-snmp/output_api.h
+./callback.lo: ../include/net-snmp/library/snmp_debug.h
+./callback.lo: ../include/net-snmp/library/snmp_logging.h
+./callback.lo: ../include/net-snmp/session_api.h
+./callback.lo: ../include/net-snmp/library/callback.h
+./callback.lo: ../include/net-snmp/library/snmp_transport.h
+./callback.lo: ../include/net-snmp/library/snmp_service.h
+./callback.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./callback.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./callback.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./callback.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./callback.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./callback.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./callback.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./callback.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./callback.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./callback.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./callback.lo: ../include/net-snmp/library/ucd_compat.h
+./callback.lo: ../include/net-snmp/library/mib.h
+./callback.lo: ../include/net-snmp/mib_api.h
+./callback.lo: ../include/net-snmp/library/parse.h
+./callback.lo: ../include/net-snmp/library/oid_stash.h
+./callback.lo: ../include/net-snmp/library/snmp_impl.h
+./callback.lo: ../include/net-snmp/library/snmp.h
+./callback.lo: ../include/net-snmp/library/snmp-tc.h
+./callback.lo: ../include/net-snmp/utilities.h
+./callback.lo: ../include/net-snmp/library/system.h
+./callback.lo: ../include/net-snmp/library/tools.h
+./callback.lo: ../include/net-snmp/library/int64.h
+./callback.lo: ../include/net-snmp/library/mt_support.h
+./callback.lo: ../include/net-snmp/library/snmp_alarm.h
+./callback.lo: ../include/net-snmp/library/data_list.h
+./callback.lo: ../include/net-snmp/library/check_varbind.h
+./callback.lo: ../include/net-snmp/library/container.h
+./callback.lo: ../include/net-snmp/library/factory.h
+./callback.lo: ../include/net-snmp/library/container_binary_array.h
+./callback.lo: ../include/net-snmp/library/container_list_ssll.h
+./callback.lo: ../include/net-snmp/library/container_iterator.h
+./callback.lo: ../include/net-snmp/library/container.h
+./callback.lo: ../include/net-snmp/library/snmp_assert.h
+./callback.lo: ../include/net-snmp/version.h
+./cert_util.lo: ../include/net-snmp/net-snmp-config.h
+./cert_util.lo: ../include/net-snmp/system/linux.h
+./cert_util.lo: ../include/net-snmp/system/sysv.h
+./cert_util.lo: ../include/net-snmp/system/generic.h
+./cert_util.lo: ../include/net-snmp/net-snmp-features.h
+./check_varbind.lo: ../include/net-snmp/net-snmp-config.h
+./check_varbind.lo: ../include/net-snmp/system/linux.h
+./check_varbind.lo: ../include/net-snmp/system/sysv.h
+./check_varbind.lo: ../include/net-snmp/system/generic.h
+./check_varbind.lo: ../include/net-snmp/net-snmp-includes.h
+./check_varbind.lo: ../include/net-snmp/definitions.h
+./check_varbind.lo: ../include/net-snmp/types.h
+./check_varbind.lo: ../include/net-snmp/library/oid.h
+./check_varbind.lo: ../include/net-snmp/library/types.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_api.h
+./check_varbind.lo: ../include/net-snmp/varbind_api.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_client.h
+./check_varbind.lo: ../include/net-snmp/pdu_api.h
+./check_varbind.lo: ../include/net-snmp/library/asn1.h
+./check_varbind.lo: ../include/net-snmp/output_api.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_debug.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_logging.h
+./check_varbind.lo: ../include/net-snmp/session_api.h
+./check_varbind.lo: ../include/net-snmp/library/callback.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_transport.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_service.h
+./check_varbind.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./check_varbind.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./check_varbind.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./check_varbind.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./check_varbind.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./check_varbind.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./check_varbind.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./check_varbind.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./check_varbind.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./check_varbind.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./check_varbind.lo: ../include/net-snmp/library/ucd_compat.h
+./check_varbind.lo: ../include/net-snmp/library/mib.h
+./check_varbind.lo: ../include/net-snmp/mib_api.h
+./check_varbind.lo: ../include/net-snmp/library/parse.h
+./check_varbind.lo: ../include/net-snmp/library/oid_stash.h
+./check_varbind.lo: ../include/net-snmp/net-snmp-features.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_impl.h
+./check_varbind.lo: ../include/net-snmp/library/snmp.h
+./check_varbind.lo: ../include/net-snmp/library/snmp-tc.h
+./check_varbind.lo: ../include/net-snmp/library/getopt.h
+./check_varbind.lo: ../include/net-snmp/utilities.h
+./check_varbind.lo: ../include/net-snmp/library/system.h
+./check_varbind.lo: ../include/net-snmp/library/tools.h
+./check_varbind.lo: ../include/net-snmp/library/int64.h
+./check_varbind.lo: ../include/net-snmp/library/mt_support.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_alarm.h
+./check_varbind.lo: ../include/net-snmp/library/data_list.h
+./check_varbind.lo: ../include/net-snmp/library/check_varbind.h
+./check_varbind.lo: ../include/net-snmp/library/container.h
+./check_varbind.lo: ../include/net-snmp/library/factory.h
+./check_varbind.lo: ../include/net-snmp/library/container_binary_array.h
+./check_varbind.lo: ../include/net-snmp/library/container_list_ssll.h
+./check_varbind.lo: ../include/net-snmp/library/container_iterator.h
+./check_varbind.lo: ../include/net-snmp/library/container.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_assert.h
+./check_varbind.lo: ../include/net-snmp/version.h
+./check_varbind.lo: ../include/net-snmp/config_api.h
+./check_varbind.lo: ../include/net-snmp/library/read_config.h
+./check_varbind.lo: ../include/net-snmp/library/default_store.h
+./check_varbind.lo: ../include/net-snmp/net-snmp-config.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_parse_args.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_enum.h
+./check_varbind.lo: ../include/net-snmp/library/vacm.h
+./check_varbind.lo: ../include/net-snmp/snmpv3_api.h
+./check_varbind.lo: ../include/net-snmp/library/snmpv3.h
+./check_varbind.lo: ../include/net-snmp/library/transform_oids.h
+./check_varbind.lo: ../include/net-snmp/library/keytools.h
+./check_varbind.lo: ../include/net-snmp/library/scapi.h
+./check_varbind.lo: ../include/net-snmp/library/lcd_time.h
+./check_varbind.lo: ../include/net-snmp/library/snmp_secmod.h
+./check_varbind.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./check_varbind.lo: ../include/net-snmp/library/snmptsm.h
+./check_varbind.lo: ../include/net-snmp/library/snmpusm.h
+./closedir.lo: ../include/net-snmp/net-snmp-config.h
+./closedir.lo: ../include/net-snmp/types.h
+./closedir.lo: ../include/net-snmp/library/oid.h
+./closedir.lo: ../include/net-snmp/library/types.h
+./closedir.lo: ../include/net-snmp/definitions.h
+./closedir.lo: ../include/net-snmp/library/snmp_api.h
+./closedir.lo: ../include/net-snmp/varbind_api.h
+./closedir.lo: ../include/net-snmp/library/snmp_client.h
+./closedir.lo: ../include/net-snmp/pdu_api.h
+./closedir.lo: ../include/net-snmp/library/asn1.h
+./closedir.lo: ../include/net-snmp/output_api.h
+./closedir.lo: ../include/net-snmp/library/snmp_debug.h
+./closedir.lo: ../include/net-snmp/library/snmp_logging.h
+./closedir.lo: ../include/net-snmp/session_api.h
+./closedir.lo: ../include/net-snmp/library/callback.h
+./closedir.lo: ../include/net-snmp/library/snmp_transport.h
+./closedir.lo: ../include/net-snmp/library/snmp_service.h
+./closedir.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./closedir.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./closedir.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./closedir.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./closedir.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./closedir.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./closedir.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./closedir.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./closedir.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./closedir.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./closedir.lo: ../include/net-snmp/library/ucd_compat.h
+./closedir.lo: ../include/net-snmp/library/mib.h
+./closedir.lo: ../include/net-snmp/mib_api.h
+./closedir.lo: ../include/net-snmp/library/parse.h
+./closedir.lo: ../include/net-snmp/library/oid_stash.h
+./closedir.lo: ../include/net-snmp/net-snmp-features.h
+./closedir.lo: ../include/net-snmp/library/snmp_impl.h
+./closedir.lo: ../include/net-snmp/library/snmp.h
+./closedir.lo: ../include/net-snmp/library/snmp-tc.h
+./closedir.lo: ../include/net-snmp/library/system.h
+./container_binary_array.lo: ../include/net-snmp/net-snmp-config.h
+./container_binary_array.lo: ../include/net-snmp/net-snmp-includes.h
+./container_binary_array.lo: ../include/net-snmp/definitions.h
+./container_binary_array.lo: ../include/net-snmp/types.h
+./container_binary_array.lo: ../include/net-snmp/library/oid.h
+./container_binary_array.lo: ../include/net-snmp/library/types.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_api.h
+./container_binary_array.lo: ../include/net-snmp/varbind_api.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_client.h
+./container_binary_array.lo: ../include/net-snmp/pdu_api.h
+./container_binary_array.lo: ../include/net-snmp/library/asn1.h
+./container_binary_array.lo: ../include/net-snmp/output_api.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_debug.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_logging.h
+./container_binary_array.lo: ../include/net-snmp/session_api.h
+./container_binary_array.lo: ../include/net-snmp/library/callback.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_transport.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_service.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./container_binary_array.lo: ../include/net-snmp/library/ucd_compat.h
+./container_binary_array.lo: ../include/net-snmp/library/mib.h
+./container_binary_array.lo: ../include/net-snmp/mib_api.h
+./container_binary_array.lo: ../include/net-snmp/library/parse.h
+./container_binary_array.lo: ../include/net-snmp/library/oid_stash.h
+./container_binary_array.lo: ../include/net-snmp/net-snmp-features.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_impl.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp-tc.h
+./container_binary_array.lo: ../include/net-snmp/library/getopt.h
+./container_binary_array.lo: ../include/net-snmp/utilities.h
+./container_binary_array.lo: ../include/net-snmp/library/system.h
+./container_binary_array.lo: ../include/net-snmp/library/tools.h
+./container_binary_array.lo: ../include/net-snmp/library/int64.h
+./container_binary_array.lo: ../include/net-snmp/library/mt_support.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_alarm.h
+./container_binary_array.lo: ../include/net-snmp/library/data_list.h
+./container_binary_array.lo: ../include/net-snmp/library/check_varbind.h
+./container_binary_array.lo: ../include/net-snmp/library/container.h
+./container_binary_array.lo: ../include/net-snmp/library/factory.h
+./container_binary_array.lo: ../include/net-snmp/library/container_binary_array.h
+./container_binary_array.lo: ../include/net-snmp/library/container_list_ssll.h
+./container_binary_array.lo: ../include/net-snmp/library/container_iterator.h
+./container_binary_array.lo: ../include/net-snmp/library/container.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_assert.h
+./container_binary_array.lo: ../include/net-snmp/version.h
+./container_binary_array.lo: ../include/net-snmp/config_api.h
+./container_binary_array.lo: ../include/net-snmp/library/read_config.h
+./container_binary_array.lo: ../include/net-snmp/library/default_store.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_parse_args.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_enum.h
+./container_binary_array.lo: ../include/net-snmp/library/vacm.h
+./container_binary_array.lo: ../include/net-snmp/snmpv3_api.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpv3.h
+./container_binary_array.lo: ../include/net-snmp/library/transform_oids.h
+./container_binary_array.lo: ../include/net-snmp/library/keytools.h
+./container_binary_array.lo: ../include/net-snmp/library/scapi.h
+./container_binary_array.lo: ../include/net-snmp/library/lcd_time.h
+./container_binary_array.lo: ../include/net-snmp/library/snmp_secmod.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./container_binary_array.lo: ../include/net-snmp/library/snmptsm.h
+./container_binary_array.lo: ../include/net-snmp/library/snmpusm.h
+./container.lo: ../include/net-snmp/net-snmp-config.h
+./container.lo: ../include/net-snmp/net-snmp-features.h
+./container.lo: ../include/net-snmp/net-snmp-includes.h
+./container.lo: ../include/net-snmp/definitions.h
+./container.lo: ../include/net-snmp/types.h
+./container.lo: ../include/net-snmp/library/oid.h
+./container.lo: ../include/net-snmp/library/types.h
+./container.lo: ../include/net-snmp/library/snmp_api.h
+./container.lo: ../include/net-snmp/varbind_api.h
+./container.lo: ../include/net-snmp/library/snmp_client.h
+./container.lo: ../include/net-snmp/pdu_api.h
+./container.lo: ../include/net-snmp/library/asn1.h
+./container.lo: ../include/net-snmp/output_api.h
+./container.lo: ../include/net-snmp/library/snmp_debug.h
+./container.lo: ../include/net-snmp/library/snmp_logging.h
+./container.lo: ../include/net-snmp/session_api.h
+./container.lo: ../include/net-snmp/library/callback.h
+./container.lo: ../include/net-snmp/library/snmp_transport.h
+./container.lo: ../include/net-snmp/library/snmp_service.h
+./container.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./container.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./container.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./container.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./container.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./container.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./container.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./container.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./container.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./container.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./container.lo: ../include/net-snmp/library/ucd_compat.h
+./container.lo: ../include/net-snmp/library/mib.h
+./container.lo: ../include/net-snmp/mib_api.h
+./container.lo: ../include/net-snmp/library/parse.h
+./container.lo: ../include/net-snmp/library/oid_stash.h
+./container.lo: ../include/net-snmp/library/snmp_impl.h
+./container.lo: ../include/net-snmp/library/snmp.h
+./container.lo: ../include/net-snmp/library/snmp-tc.h
+./container.lo: ../include/net-snmp/library/getopt.h
+./container.lo: ../include/net-snmp/utilities.h
+./container.lo: ../include/net-snmp/library/system.h
+./container.lo: ../include/net-snmp/library/tools.h
+./container.lo: ../include/net-snmp/library/int64.h
+./container.lo: ../include/net-snmp/library/mt_support.h
+./container.lo: ../include/net-snmp/library/snmp_alarm.h
+./container.lo: ../include/net-snmp/library/data_list.h
+./container.lo: ../include/net-snmp/library/check_varbind.h
+./container.lo: ../include/net-snmp/library/container.h
+./container.lo: ../include/net-snmp/library/factory.h
+./container.lo: ../include/net-snmp/library/container_binary_array.h
+./container.lo: ../include/net-snmp/library/container_list_ssll.h
+./container.lo: ../include/net-snmp/library/container_iterator.h
+./container.lo: ../include/net-snmp/library/container.h
+./container.lo: ../include/net-snmp/library/snmp_assert.h
+./container.lo: ../include/net-snmp/version.h
+./container.lo: ../include/net-snmp/config_api.h
+./container.lo: ../include/net-snmp/library/read_config.h
+./container.lo: ../include/net-snmp/library/default_store.h
+./container.lo: ../include/net-snmp/library/snmp_parse_args.h
+./container.lo: ../include/net-snmp/library/snmp_enum.h
+./container.lo: ../include/net-snmp/library/vacm.h
+./container.lo: ../include/net-snmp/snmpv3_api.h
+./container.lo: ../include/net-snmp/library/snmpv3.h
+./container.lo: ../include/net-snmp/library/transform_oids.h
+./container.lo: ../include/net-snmp/library/keytools.h
+./container.lo: ../include/net-snmp/library/scapi.h
+./container.lo: ../include/net-snmp/library/lcd_time.h
+./container.lo: ../include/net-snmp/library/snmp_secmod.h
+./container.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./container.lo: ../include/net-snmp/library/snmptsm.h
+./container.lo: ../include/net-snmp/library/snmpusm.h
+./container.lo: ../include/net-snmp/library/container_null.h
+./container_iterator.lo: ../include/net-snmp/net-snmp-config.h
+./container_iterator.lo: ../include/net-snmp/net-snmp-features.h
+./container_iterator.lo: ../include/net-snmp/net-snmp-includes.h
+./container_iterator.lo: ../include/net-snmp/definitions.h
+./container_iterator.lo: ../include/net-snmp/types.h
+./container_iterator.lo: ../include/net-snmp/library/oid.h
+./container_iterator.lo: ../include/net-snmp/library/types.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_api.h
+./container_iterator.lo: ../include/net-snmp/varbind_api.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_client.h
+./container_iterator.lo: ../include/net-snmp/pdu_api.h
+./container_iterator.lo: ../include/net-snmp/library/asn1.h
+./container_iterator.lo: ../include/net-snmp/output_api.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_debug.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_logging.h
+./container_iterator.lo: ../include/net-snmp/session_api.h
+./container_iterator.lo: ../include/net-snmp/library/callback.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_transport.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_service.h
+./container_iterator.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./container_iterator.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./container_iterator.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./container_iterator.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./container_iterator.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./container_iterator.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./container_iterator.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./container_iterator.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./container_iterator.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./container_iterator.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./container_iterator.lo: ../include/net-snmp/library/ucd_compat.h
+./container_iterator.lo: ../include/net-snmp/library/mib.h
+./container_iterator.lo: ../include/net-snmp/mib_api.h
+./container_iterator.lo: ../include/net-snmp/library/parse.h
+./container_iterator.lo: ../include/net-snmp/library/oid_stash.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_impl.h
+./container_iterator.lo: ../include/net-snmp/library/snmp.h
+./container_iterator.lo: ../include/net-snmp/library/snmp-tc.h
+./container_iterator.lo: ../include/net-snmp/library/getopt.h
+./container_iterator.lo: ../include/net-snmp/utilities.h
+./container_iterator.lo: ../include/net-snmp/library/system.h
+./container_iterator.lo: ../include/net-snmp/library/tools.h
+./container_iterator.lo: ../include/net-snmp/library/int64.h
+./container_iterator.lo: ../include/net-snmp/library/mt_support.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_alarm.h
+./container_iterator.lo: ../include/net-snmp/library/data_list.h
+./container_iterator.lo: ../include/net-snmp/library/check_varbind.h
+./container_iterator.lo: ../include/net-snmp/library/container.h
+./container_iterator.lo: ../include/net-snmp/library/factory.h
+./container_iterator.lo: ../include/net-snmp/library/container_binary_array.h
+./container_iterator.lo: ../include/net-snmp/library/container_list_ssll.h
+./container_iterator.lo: ../include/net-snmp/library/container_iterator.h
+./container_iterator.lo: ../include/net-snmp/library/container.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_assert.h
+./container_iterator.lo: ../include/net-snmp/version.h
+./container_iterator.lo: ../include/net-snmp/config_api.h
+./container_iterator.lo: ../include/net-snmp/library/read_config.h
+./container_iterator.lo: ../include/net-snmp/library/default_store.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_parse_args.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_enum.h
+./container_iterator.lo: ../include/net-snmp/library/vacm.h
+./container_iterator.lo: ../include/net-snmp/snmpv3_api.h
+./container_iterator.lo: ../include/net-snmp/library/snmpv3.h
+./container_iterator.lo: ../include/net-snmp/library/transform_oids.h
+./container_iterator.lo: ../include/net-snmp/library/keytools.h
+./container_iterator.lo: ../include/net-snmp/library/scapi.h
+./container_iterator.lo: ../include/net-snmp/library/lcd_time.h
+./container_iterator.lo: ../include/net-snmp/library/snmp_secmod.h
+./container_iterator.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./container_iterator.lo: ../include/net-snmp/library/snmptsm.h
+./container_iterator.lo: ../include/net-snmp/library/snmpusm.h
+./container_list_ssll.lo: ../include/net-snmp/net-snmp-config.h
+./container_list_ssll.lo: ../include/net-snmp/net-snmp-features.h
+./container_list_ssll.lo: ../include/net-snmp/net-snmp-includes.h
+./container_list_ssll.lo: ../include/net-snmp/definitions.h
+./container_list_ssll.lo: ../include/net-snmp/types.h
+./container_list_ssll.lo: ../include/net-snmp/library/oid.h
+./container_list_ssll.lo: ../include/net-snmp/library/types.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_api.h
+./container_list_ssll.lo: ../include/net-snmp/varbind_api.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_client.h
+./container_list_ssll.lo: ../include/net-snmp/pdu_api.h
+./container_list_ssll.lo: ../include/net-snmp/library/asn1.h
+./container_list_ssll.lo: ../include/net-snmp/output_api.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_debug.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_logging.h
+./container_list_ssll.lo: ../include/net-snmp/session_api.h
+./container_list_ssll.lo: ../include/net-snmp/library/callback.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_transport.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_service.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./container_list_ssll.lo: ../include/net-snmp/library/ucd_compat.h
+./container_list_ssll.lo: ../include/net-snmp/library/mib.h
+./container_list_ssll.lo: ../include/net-snmp/mib_api.h
+./container_list_ssll.lo: ../include/net-snmp/library/parse.h
+./container_list_ssll.lo: ../include/net-snmp/library/oid_stash.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_impl.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp-tc.h
+./container_list_ssll.lo: ../include/net-snmp/library/getopt.h
+./container_list_ssll.lo: ../include/net-snmp/utilities.h
+./container_list_ssll.lo: ../include/net-snmp/library/system.h
+./container_list_ssll.lo: ../include/net-snmp/library/tools.h
+./container_list_ssll.lo: ../include/net-snmp/library/int64.h
+./container_list_ssll.lo: ../include/net-snmp/library/mt_support.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_alarm.h
+./container_list_ssll.lo: ../include/net-snmp/library/data_list.h
+./container_list_ssll.lo: ../include/net-snmp/library/check_varbind.h
+./container_list_ssll.lo: ../include/net-snmp/library/container.h
+./container_list_ssll.lo: ../include/net-snmp/library/factory.h
+./container_list_ssll.lo: ../include/net-snmp/library/container_binary_array.h
+./container_list_ssll.lo: ../include/net-snmp/library/container_list_ssll.h
+./container_list_ssll.lo: ../include/net-snmp/library/container_iterator.h
+./container_list_ssll.lo: ../include/net-snmp/library/container.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_assert.h
+./container_list_ssll.lo: ../include/net-snmp/version.h
+./container_list_ssll.lo: ../include/net-snmp/config_api.h
+./container_list_ssll.lo: ../include/net-snmp/library/read_config.h
+./container_list_ssll.lo: ../include/net-snmp/library/default_store.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_parse_args.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_enum.h
+./container_list_ssll.lo: ../include/net-snmp/library/vacm.h
+./container_list_ssll.lo: ../include/net-snmp/snmpv3_api.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpv3.h
+./container_list_ssll.lo: ../include/net-snmp/library/transform_oids.h
+./container_list_ssll.lo: ../include/net-snmp/library/keytools.h
+./container_list_ssll.lo: ../include/net-snmp/library/scapi.h
+./container_list_ssll.lo: ../include/net-snmp/library/lcd_time.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmp_secmod.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmptsm.h
+./container_list_ssll.lo: ../include/net-snmp/library/snmpusm.h
+./container_null.lo: ../include/net-snmp/net-snmp-config.h
+./container_null.lo: ../include/net-snmp/net-snmp-features.h
+./container_null.lo: ../include/net-snmp/net-snmp-includes.h
+./container_null.lo: ../include/net-snmp/definitions.h
+./container_null.lo: ../include/net-snmp/types.h
+./container_null.lo: ../include/net-snmp/library/oid.h
+./container_null.lo: ../include/net-snmp/library/types.h
+./container_null.lo: ../include/net-snmp/library/snmp_api.h
+./container_null.lo: ../include/net-snmp/varbind_api.h
+./container_null.lo: ../include/net-snmp/library/snmp_client.h
+./container_null.lo: ../include/net-snmp/pdu_api.h
+./container_null.lo: ../include/net-snmp/library/asn1.h
+./container_null.lo: ../include/net-snmp/output_api.h
+./container_null.lo: ../include/net-snmp/library/snmp_debug.h
+./container_null.lo: ../include/net-snmp/library/snmp_logging.h
+./container_null.lo: ../include/net-snmp/session_api.h
+./container_null.lo: ../include/net-snmp/library/callback.h
+./container_null.lo: ../include/net-snmp/library/snmp_transport.h
+./container_null.lo: ../include/net-snmp/library/snmp_service.h
+./container_null.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./container_null.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./container_null.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./container_null.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./container_null.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./container_null.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./container_null.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./container_null.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./container_null.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./container_null.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./container_null.lo: ../include/net-snmp/library/ucd_compat.h
+./container_null.lo: ../include/net-snmp/library/mib.h
+./container_null.lo: ../include/net-snmp/mib_api.h
+./container_null.lo: ../include/net-snmp/library/parse.h
+./container_null.lo: ../include/net-snmp/library/oid_stash.h
+./container_null.lo: ../include/net-snmp/library/snmp_impl.h
+./container_null.lo: ../include/net-snmp/library/snmp.h
+./container_null.lo: ../include/net-snmp/library/snmp-tc.h
+./container_null.lo: ../include/net-snmp/library/getopt.h
+./container_null.lo: ../include/net-snmp/utilities.h
+./container_null.lo: ../include/net-snmp/library/system.h
+./container_null.lo: ../include/net-snmp/library/tools.h
+./container_null.lo: ../include/net-snmp/library/int64.h
+./container_null.lo: ../include/net-snmp/library/mt_support.h
+./container_null.lo: ../include/net-snmp/library/snmp_alarm.h
+./container_null.lo: ../include/net-snmp/library/data_list.h
+./container_null.lo: ../include/net-snmp/library/check_varbind.h
+./container_null.lo: ../include/net-snmp/library/container.h
+./container_null.lo: ../include/net-snmp/library/factory.h
+./container_null.lo: ../include/net-snmp/library/container_binary_array.h
+./container_null.lo: ../include/net-snmp/library/container_list_ssll.h
+./container_null.lo: ../include/net-snmp/library/container_iterator.h
+./container_null.lo: ../include/net-snmp/library/container.h
+./container_null.lo: ../include/net-snmp/library/snmp_assert.h
+./container_null.lo: ../include/net-snmp/version.h
+./container_null.lo: ../include/net-snmp/config_api.h
+./container_null.lo: ../include/net-snmp/library/read_config.h
+./container_null.lo: ../include/net-snmp/library/default_store.h
+./container_null.lo: ../include/net-snmp/library/snmp_parse_args.h
+./container_null.lo: ../include/net-snmp/library/snmp_enum.h
+./container_null.lo: ../include/net-snmp/library/vacm.h
+./container_null.lo: ../include/net-snmp/snmpv3_api.h
+./container_null.lo: ../include/net-snmp/library/snmpv3.h
+./container_null.lo: ../include/net-snmp/library/transform_oids.h
+./container_null.lo: ../include/net-snmp/library/keytools.h
+./container_null.lo: ../include/net-snmp/library/scapi.h
+./container_null.lo: ../include/net-snmp/library/lcd_time.h
+./container_null.lo: ../include/net-snmp/library/snmp_secmod.h
+./container_null.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./container_null.lo: ../include/net-snmp/library/snmptsm.h
+./container_null.lo: ../include/net-snmp/library/snmpusm.h
+./container_null.lo: ../include/net-snmp/library/container_null.h
+./data_list.lo: ../include/net-snmp/net-snmp-config.h
+./data_list.lo: ../include/net-snmp/net-snmp-features.h
+./data_list.lo: ../include/net-snmp/net-snmp-includes.h
+./data_list.lo: ../include/net-snmp/definitions.h
+./data_list.lo: ../include/net-snmp/types.h
+./data_list.lo: ../include/net-snmp/library/oid.h
+./data_list.lo: ../include/net-snmp/library/types.h
+./data_list.lo: ../include/net-snmp/library/snmp_api.h
+./data_list.lo: ../include/net-snmp/varbind_api.h
+./data_list.lo: ../include/net-snmp/library/snmp_client.h
+./data_list.lo: ../include/net-snmp/pdu_api.h
+./data_list.lo: ../include/net-snmp/library/asn1.h
+./data_list.lo: ../include/net-snmp/output_api.h
+./data_list.lo: ../include/net-snmp/library/snmp_debug.h
+./data_list.lo: ../include/net-snmp/library/snmp_logging.h
+./data_list.lo: ../include/net-snmp/session_api.h
+./data_list.lo: ../include/net-snmp/library/callback.h
+./data_list.lo: ../include/net-snmp/library/snmp_transport.h
+./data_list.lo: ../include/net-snmp/library/snmp_service.h
+./data_list.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./data_list.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./data_list.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./data_list.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./data_list.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./data_list.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./data_list.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./data_list.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./data_list.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./data_list.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./data_list.lo: ../include/net-snmp/library/ucd_compat.h
+./data_list.lo: ../include/net-snmp/library/mib.h
+./data_list.lo: ../include/net-snmp/mib_api.h
+./data_list.lo: ../include/net-snmp/library/parse.h
+./data_list.lo: ../include/net-snmp/library/oid_stash.h
+./data_list.lo: ../include/net-snmp/library/snmp_impl.h
+./data_list.lo: ../include/net-snmp/library/snmp.h
+./data_list.lo: ../include/net-snmp/library/snmp-tc.h
+./data_list.lo: ../include/net-snmp/library/getopt.h
+./data_list.lo: ../include/net-snmp/utilities.h
+./data_list.lo: ../include/net-snmp/library/system.h
+./data_list.lo: ../include/net-snmp/library/tools.h
+./data_list.lo: ../include/net-snmp/library/int64.h
+./data_list.lo: ../include/net-snmp/library/mt_support.h
+./data_list.lo: ../include/net-snmp/library/snmp_alarm.h
+./data_list.lo: ../include/net-snmp/library/data_list.h
+./data_list.lo: ../include/net-snmp/library/check_varbind.h
+./data_list.lo: ../include/net-snmp/library/container.h
+./data_list.lo: ../include/net-snmp/library/factory.h
+./data_list.lo: ../include/net-snmp/library/container_binary_array.h
+./data_list.lo: ../include/net-snmp/library/container_list_ssll.h
+./data_list.lo: ../include/net-snmp/library/container_iterator.h
+./data_list.lo: ../include/net-snmp/library/container.h
+./data_list.lo: ../include/net-snmp/library/snmp_assert.h
+./data_list.lo: ../include/net-snmp/version.h
+./data_list.lo: ../include/net-snmp/config_api.h
+./data_list.lo: ../include/net-snmp/library/read_config.h
+./data_list.lo: ../include/net-snmp/library/default_store.h
+./data_list.lo: ../include/net-snmp/library/snmp_parse_args.h
+./data_list.lo: ../include/net-snmp/library/snmp_enum.h
+./data_list.lo: ../include/net-snmp/library/vacm.h
+./data_list.lo: ../include/net-snmp/snmpv3_api.h
+./data_list.lo: ../include/net-snmp/library/snmpv3.h
+./data_list.lo: ../include/net-snmp/library/transform_oids.h
+./data_list.lo: ../include/net-snmp/library/keytools.h
+./data_list.lo: ../include/net-snmp/library/scapi.h
+./data_list.lo: ../include/net-snmp/library/lcd_time.h
+./data_list.lo: ../include/net-snmp/library/snmp_secmod.h
+./data_list.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./data_list.lo: ../include/net-snmp/library/snmptsm.h
+./data_list.lo: ../include/net-snmp/library/snmpusm.h
+./default_store.lo: ../include/net-snmp/net-snmp-config.h
+./default_store.lo: ../include/net-snmp/net-snmp-features.h
+./default_store.lo: ../include/net-snmp/types.h
+./default_store.lo: ../include/net-snmp/library/oid.h
+./default_store.lo: ../include/net-snmp/library/types.h
+./default_store.lo: ../include/net-snmp/definitions.h
+./default_store.lo: ../include/net-snmp/library/snmp_api.h
+./default_store.lo: ../include/net-snmp/varbind_api.h
+./default_store.lo: ../include/net-snmp/library/snmp_client.h
+./default_store.lo: ../include/net-snmp/pdu_api.h
+./default_store.lo: ../include/net-snmp/library/asn1.h
+./default_store.lo: ../include/net-snmp/output_api.h
+./default_store.lo: ../include/net-snmp/library/snmp_debug.h
+./default_store.lo: ../include/net-snmp/library/snmp_logging.h
+./default_store.lo: ../include/net-snmp/session_api.h
+./default_store.lo: ../include/net-snmp/library/callback.h
+./default_store.lo: ../include/net-snmp/library/snmp_transport.h
+./default_store.lo: ../include/net-snmp/library/snmp_service.h
+./default_store.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./default_store.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./default_store.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./default_store.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./default_store.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./default_store.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./default_store.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./default_store.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./default_store.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./default_store.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./default_store.lo: ../include/net-snmp/library/ucd_compat.h
+./default_store.lo: ../include/net-snmp/library/mib.h
+./default_store.lo: ../include/net-snmp/mib_api.h
+./default_store.lo: ../include/net-snmp/library/parse.h
+./default_store.lo: ../include/net-snmp/library/oid_stash.h
+./default_store.lo: ../include/net-snmp/library/snmp_impl.h
+./default_store.lo: ../include/net-snmp/library/snmp.h
+./default_store.lo: ../include/net-snmp/library/snmp-tc.h
+./default_store.lo: ../include/net-snmp/config_api.h
+./default_store.lo: ../include/net-snmp/library/read_config.h
+./default_store.lo: ../include/net-snmp/library/default_store.h
+./default_store.lo: ../include/net-snmp/library/snmp_parse_args.h
+./default_store.lo: ../include/net-snmp/library/snmp_enum.h
+./default_store.lo: ../include/net-snmp/library/vacm.h
+./default_store.lo: ../include/net-snmp/utilities.h
+./default_store.lo: ../include/net-snmp/library/system.h
+./default_store.lo: ../include/net-snmp/library/tools.h
+./default_store.lo: ../include/net-snmp/library/int64.h
+./default_store.lo: ../include/net-snmp/library/mt_support.h
+./default_store.lo: ../include/net-snmp/library/snmp_alarm.h
+./default_store.lo: ../include/net-snmp/library/data_list.h
+./default_store.lo: ../include/net-snmp/library/check_varbind.h
+./default_store.lo: ../include/net-snmp/library/container.h
+./default_store.lo: ../include/net-snmp/library/factory.h
+./default_store.lo: ../include/net-snmp/library/container_binary_array.h
+./default_store.lo: ../include/net-snmp/library/container_list_ssll.h
+./default_store.lo: ../include/net-snmp/library/container_iterator.h
+./default_store.lo: ../include/net-snmp/library/container.h
+./default_store.lo: ../include/net-snmp/library/snmp_assert.h
+./default_store.lo: ../include/net-snmp/version.h
+./dir_utils.lo: ../include/net-snmp/net-snmp-config.h
+./dir_utils.lo: ../include/net-snmp/net-snmp-features.h
+./dir_utils.lo: ../include/net-snmp/net-snmp-includes.h
+./dir_utils.lo: ../include/net-snmp/definitions.h
+./dir_utils.lo: ../include/net-snmp/types.h
+./dir_utils.lo: ../include/net-snmp/library/oid.h
+./dir_utils.lo: ../include/net-snmp/library/types.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_api.h
+./dir_utils.lo: ../include/net-snmp/varbind_api.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_client.h
+./dir_utils.lo: ../include/net-snmp/pdu_api.h
+./dir_utils.lo: ../include/net-snmp/library/asn1.h
+./dir_utils.lo: ../include/net-snmp/output_api.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_debug.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_logging.h
+./dir_utils.lo: ../include/net-snmp/session_api.h
+./dir_utils.lo: ../include/net-snmp/library/callback.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_transport.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_service.h
+./dir_utils.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./dir_utils.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./dir_utils.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./dir_utils.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./dir_utils.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./dir_utils.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./dir_utils.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./dir_utils.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./dir_utils.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./dir_utils.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./dir_utils.lo: ../include/net-snmp/library/ucd_compat.h
+./dir_utils.lo: ../include/net-snmp/library/mib.h
+./dir_utils.lo: ../include/net-snmp/mib_api.h
+./dir_utils.lo: ../include/net-snmp/library/parse.h
+./dir_utils.lo: ../include/net-snmp/library/oid_stash.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_impl.h
+./dir_utils.lo: ../include/net-snmp/library/snmp.h
+./dir_utils.lo: ../include/net-snmp/library/snmp-tc.h
+./dir_utils.lo: ../include/net-snmp/library/getopt.h
+./dir_utils.lo: ../include/net-snmp/utilities.h
+./dir_utils.lo: ../include/net-snmp/library/system.h
+./dir_utils.lo: ../include/net-snmp/library/tools.h
+./dir_utils.lo: ../include/net-snmp/library/int64.h
+./dir_utils.lo: ../include/net-snmp/library/mt_support.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_alarm.h
+./dir_utils.lo: ../include/net-snmp/library/data_list.h
+./dir_utils.lo: ../include/net-snmp/library/check_varbind.h
+./dir_utils.lo: ../include/net-snmp/library/container.h
+./dir_utils.lo: ../include/net-snmp/library/factory.h
+./dir_utils.lo: ../include/net-snmp/library/container_binary_array.h
+./dir_utils.lo: ../include/net-snmp/library/container_list_ssll.h
+./dir_utils.lo: ../include/net-snmp/library/container_iterator.h
+./dir_utils.lo: ../include/net-snmp/library/container.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_assert.h
+./dir_utils.lo: ../include/net-snmp/version.h
+./dir_utils.lo: ../include/net-snmp/config_api.h
+./dir_utils.lo: ../include/net-snmp/library/read_config.h
+./dir_utils.lo: ../include/net-snmp/library/default_store.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_parse_args.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_enum.h
+./dir_utils.lo: ../include/net-snmp/library/vacm.h
+./dir_utils.lo: ../include/net-snmp/snmpv3_api.h
+./dir_utils.lo: ../include/net-snmp/library/snmpv3.h
+./dir_utils.lo: ../include/net-snmp/library/transform_oids.h
+./dir_utils.lo: ../include/net-snmp/library/keytools.h
+./dir_utils.lo: ../include/net-snmp/library/scapi.h
+./dir_utils.lo: ../include/net-snmp/library/lcd_time.h
+./dir_utils.lo: ../include/net-snmp/library/snmp_secmod.h
+./dir_utils.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./dir_utils.lo: ../include/net-snmp/library/snmptsm.h
+./dir_utils.lo: ../include/net-snmp/library/snmpusm.h
+./dir_utils.lo: ../include/net-snmp/library/file_utils.h
+./dir_utils.lo: ../include/net-snmp/library/dir_utils.h
+./fd_event_manager.lo: ../include/net-snmp/net-snmp-config.h
+./fd_event_manager.lo: ../include/net-snmp/net-snmp-includes.h
+./fd_event_manager.lo: ../include/net-snmp/definitions.h
+./fd_event_manager.lo: ../include/net-snmp/types.h
+./fd_event_manager.lo: ../include/net-snmp/library/oid.h
+./fd_event_manager.lo: ../include/net-snmp/library/types.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_api.h
+./fd_event_manager.lo: ../include/net-snmp/varbind_api.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_client.h
+./fd_event_manager.lo: ../include/net-snmp/pdu_api.h
+./fd_event_manager.lo: ../include/net-snmp/library/asn1.h
+./fd_event_manager.lo: ../include/net-snmp/output_api.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_debug.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_logging.h
+./fd_event_manager.lo: ../include/net-snmp/session_api.h
+./fd_event_manager.lo: ../include/net-snmp/library/callback.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_transport.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_service.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./fd_event_manager.lo: ../include/net-snmp/library/ucd_compat.h
+./fd_event_manager.lo: ../include/net-snmp/library/mib.h
+./fd_event_manager.lo: ../include/net-snmp/mib_api.h
+./fd_event_manager.lo: ../include/net-snmp/library/parse.h
+./fd_event_manager.lo: ../include/net-snmp/library/oid_stash.h
+./fd_event_manager.lo: ../include/net-snmp/net-snmp-features.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_impl.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp-tc.h
+./fd_event_manager.lo: ../include/net-snmp/library/getopt.h
+./fd_event_manager.lo: ../include/net-snmp/utilities.h
+./fd_event_manager.lo: ../include/net-snmp/library/system.h
+./fd_event_manager.lo: ../include/net-snmp/library/tools.h
+./fd_event_manager.lo: ../include/net-snmp/library/int64.h
+./fd_event_manager.lo: ../include/net-snmp/library/mt_support.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_alarm.h
+./fd_event_manager.lo: ../include/net-snmp/library/data_list.h
+./fd_event_manager.lo: ../include/net-snmp/library/check_varbind.h
+./fd_event_manager.lo: ../include/net-snmp/library/container.h
+./fd_event_manager.lo: ../include/net-snmp/library/factory.h
+./fd_event_manager.lo: ../include/net-snmp/library/container_binary_array.h
+./fd_event_manager.lo: ../include/net-snmp/library/container_list_ssll.h
+./fd_event_manager.lo: ../include/net-snmp/library/container_iterator.h
+./fd_event_manager.lo: ../include/net-snmp/library/container.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_assert.h
+./fd_event_manager.lo: ../include/net-snmp/version.h
+./fd_event_manager.lo: ../include/net-snmp/config_api.h
+./fd_event_manager.lo: ../include/net-snmp/library/read_config.h
+./fd_event_manager.lo: ../include/net-snmp/library/default_store.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_parse_args.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_enum.h
+./fd_event_manager.lo: ../include/net-snmp/library/vacm.h
+./fd_event_manager.lo: ../include/net-snmp/snmpv3_api.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpv3.h
+./fd_event_manager.lo: ../include/net-snmp/library/transform_oids.h
+./fd_event_manager.lo: ../include/net-snmp/library/keytools.h
+./fd_event_manager.lo: ../include/net-snmp/library/scapi.h
+./fd_event_manager.lo: ../include/net-snmp/library/lcd_time.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmp_secmod.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmptsm.h
+./fd_event_manager.lo: ../include/net-snmp/library/snmpusm.h
+./fd_event_manager.lo: ../include/net-snmp/library/fd_event_manager.h
+./fd_event_manager.lo: ../include/net-snmp/library/large_fd_set.h
+./file_utils.lo: ../include/net-snmp/net-snmp-config.h
+./file_utils.lo: ../include/net-snmp/net-snmp-features.h
+./file_utils.lo: ../include/net-snmp/net-snmp-includes.h
+./file_utils.lo: ../include/net-snmp/definitions.h
+./file_utils.lo: ../include/net-snmp/types.h
+./file_utils.lo: ../include/net-snmp/library/oid.h
+./file_utils.lo: ../include/net-snmp/library/types.h
+./file_utils.lo: ../include/net-snmp/library/snmp_api.h
+./file_utils.lo: ../include/net-snmp/varbind_api.h
+./file_utils.lo: ../include/net-snmp/library/snmp_client.h
+./file_utils.lo: ../include/net-snmp/pdu_api.h
+./file_utils.lo: ../include/net-snmp/library/asn1.h
+./file_utils.lo: ../include/net-snmp/output_api.h
+./file_utils.lo: ../include/net-snmp/library/snmp_debug.h
+./file_utils.lo: ../include/net-snmp/library/snmp_logging.h
+./file_utils.lo: ../include/net-snmp/session_api.h
+./file_utils.lo: ../include/net-snmp/library/callback.h
+./file_utils.lo: ../include/net-snmp/library/snmp_transport.h
+./file_utils.lo: ../include/net-snmp/library/snmp_service.h
+./file_utils.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./file_utils.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./file_utils.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./file_utils.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./file_utils.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./file_utils.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./file_utils.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./file_utils.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./file_utils.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./file_utils.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./file_utils.lo: ../include/net-snmp/library/ucd_compat.h
+./file_utils.lo: ../include/net-snmp/library/mib.h
+./file_utils.lo: ../include/net-snmp/mib_api.h
+./file_utils.lo: ../include/net-snmp/library/parse.h
+./file_utils.lo: ../include/net-snmp/library/oid_stash.h
+./file_utils.lo: ../include/net-snmp/library/snmp_impl.h
+./file_utils.lo: ../include/net-snmp/library/snmp.h
+./file_utils.lo: ../include/net-snmp/library/snmp-tc.h
+./file_utils.lo: ../include/net-snmp/library/getopt.h
+./file_utils.lo: ../include/net-snmp/utilities.h
+./file_utils.lo: ../include/net-snmp/library/system.h
+./file_utils.lo: ../include/net-snmp/library/tools.h
+./file_utils.lo: ../include/net-snmp/library/int64.h
+./file_utils.lo: ../include/net-snmp/library/mt_support.h
+./file_utils.lo: ../include/net-snmp/library/snmp_alarm.h
+./file_utils.lo: ../include/net-snmp/library/data_list.h
+./file_utils.lo: ../include/net-snmp/library/check_varbind.h
+./file_utils.lo: ../include/net-snmp/library/container.h
+./file_utils.lo: ../include/net-snmp/library/factory.h
+./file_utils.lo: ../include/net-snmp/library/container_binary_array.h
+./file_utils.lo: ../include/net-snmp/library/container_list_ssll.h
+./file_utils.lo: ../include/net-snmp/library/container_iterator.h
+./file_utils.lo: ../include/net-snmp/library/container.h
+./file_utils.lo: ../include/net-snmp/library/snmp_assert.h
+./file_utils.lo: ../include/net-snmp/version.h
+./file_utils.lo: ../include/net-snmp/config_api.h
+./file_utils.lo: ../include/net-snmp/library/read_config.h
+./file_utils.lo: ../include/net-snmp/library/default_store.h
+./file_utils.lo: ../include/net-snmp/library/snmp_parse_args.h
+./file_utils.lo: ../include/net-snmp/library/snmp_enum.h
+./file_utils.lo: ../include/net-snmp/library/vacm.h
+./file_utils.lo: ../include/net-snmp/snmpv3_api.h
+./file_utils.lo: ../include/net-snmp/library/snmpv3.h
+./file_utils.lo: ../include/net-snmp/library/transform_oids.h
+./file_utils.lo: ../include/net-snmp/library/keytools.h
+./file_utils.lo: ../include/net-snmp/library/scapi.h
+./file_utils.lo: ../include/net-snmp/library/lcd_time.h
+./file_utils.lo: ../include/net-snmp/library/snmp_secmod.h
+./file_utils.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./file_utils.lo: ../include/net-snmp/library/snmptsm.h
+./file_utils.lo: ../include/net-snmp/library/snmpusm.h
+./file_utils.lo: ../include/net-snmp/library/file_utils.h
+./getopt.lo: ../include/net-snmp/net-snmp-config.h
+./getopt.lo: ../include/net-snmp/library/getopt.h
+./gettimeofday.lo: ../include/net-snmp/net-snmp-config.h
+./gettimeofday.lo: ../include/net-snmp/types.h
+./gettimeofday.lo: ../include/net-snmp/library/oid.h
+./gettimeofday.lo: ../include/net-snmp/library/types.h
+./gettimeofday.lo: ../include/net-snmp/definitions.h
+./gettimeofday.lo: ../include/net-snmp/library/snmp_api.h
+./gettimeofday.lo: ../include/net-snmp/varbind_api.h
+./gettimeofday.lo: ../include/net-snmp/library/snmp_client.h
+./gettimeofday.lo: ../include/net-snmp/pdu_api.h
+./gettimeofday.lo: ../include/net-snmp/library/asn1.h
+./gettimeofday.lo: ../include/net-snmp/output_api.h
+./gettimeofday.lo: ../include/net-snmp/library/snmp_debug.h
+./gettimeofday.lo: ../include/net-snmp/library/snmp_logging.h
+./gettimeofday.lo: ../include/net-snmp/session_api.h
+./gettimeofday.lo: ../include/net-snmp/library/callback.h
+./gettimeofday.lo: ../include/net-snmp/library/snmp_transport.h
+./gettimeofday.lo: ../include/net-snmp/library/snmp_service.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./gettimeofday.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./gettimeofday.lo: ../include/net-snmp/library/ucd_compat.h
+./gettimeofday.lo: ../include/net-snmp/library/mib.h
+./gettimeofday.lo: ../include/net-snmp/mib_api.h
+./gettimeofday.lo: ../include/net-snmp/library/parse.h
+./gettimeofday.lo: ../include/net-snmp/library/oid_stash.h
+./gettimeofday.lo: ../include/net-snmp/net-snmp-features.h
+./gettimeofday.lo: ../include/net-snmp/library/snmp_impl.h
+./gettimeofday.lo: ../include/net-snmp/library/snmp.h
+./gettimeofday.lo: ../include/net-snmp/library/snmp-tc.h
+./gettimeofday.lo: ../include/net-snmp/library/system.h
+./inet_ntop.lo: ../include/net-snmp/net-snmp-config.h
+./inet_ntop.lo: ../include/net-snmp/types.h
+./inet_ntop.lo: ../include/net-snmp/library/oid.h
+./inet_ntop.lo: ../include/net-snmp/library/types.h
+./inet_ntop.lo: ../include/net-snmp/definitions.h
+./inet_ntop.lo: ../include/net-snmp/library/snmp_api.h
+./inet_ntop.lo: ../include/net-snmp/varbind_api.h
+./inet_ntop.lo: ../include/net-snmp/library/snmp_client.h
+./inet_ntop.lo: ../include/net-snmp/pdu_api.h
+./inet_ntop.lo: ../include/net-snmp/library/asn1.h
+./inet_ntop.lo: ../include/net-snmp/output_api.h
+./inet_ntop.lo: ../include/net-snmp/library/snmp_debug.h
+./inet_ntop.lo: ../include/net-snmp/library/snmp_logging.h
+./inet_ntop.lo: ../include/net-snmp/session_api.h
+./inet_ntop.lo: ../include/net-snmp/library/callback.h
+./inet_ntop.lo: ../include/net-snmp/library/snmp_transport.h
+./inet_ntop.lo: ../include/net-snmp/library/snmp_service.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./inet_ntop.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./inet_ntop.lo: ../include/net-snmp/library/ucd_compat.h
+./inet_ntop.lo: ../include/net-snmp/library/mib.h
+./inet_ntop.lo: ../include/net-snmp/mib_api.h
+./inet_ntop.lo: ../include/net-snmp/library/parse.h
+./inet_ntop.lo: ../include/net-snmp/library/oid_stash.h
+./inet_ntop.lo: ../include/net-snmp/net-snmp-features.h
+./inet_ntop.lo: ../include/net-snmp/library/snmp_impl.h
+./inet_ntop.lo: ../include/net-snmp/library/snmp.h
+./inet_ntop.lo: ../include/net-snmp/library/snmp-tc.h inet_ntop.h
+./inet_pton.lo: ../include/net-snmp/net-snmp-config.h
+./inet_pton.lo: ../include/net-snmp/types.h
+./inet_pton.lo: ../include/net-snmp/library/oid.h
+./inet_pton.lo: ../include/net-snmp/library/types.h
+./inet_pton.lo: ../include/net-snmp/definitions.h
+./inet_pton.lo: ../include/net-snmp/library/snmp_api.h
+./inet_pton.lo: ../include/net-snmp/varbind_api.h
+./inet_pton.lo: ../include/net-snmp/library/snmp_client.h
+./inet_pton.lo: ../include/net-snmp/pdu_api.h
+./inet_pton.lo: ../include/net-snmp/library/asn1.h
+./inet_pton.lo: ../include/net-snmp/output_api.h
+./inet_pton.lo: ../include/net-snmp/library/snmp_debug.h
+./inet_pton.lo: ../include/net-snmp/library/snmp_logging.h
+./inet_pton.lo: ../include/net-snmp/session_api.h
+./inet_pton.lo: ../include/net-snmp/library/callback.h
+./inet_pton.lo: ../include/net-snmp/library/snmp_transport.h
+./inet_pton.lo: ../include/net-snmp/library/snmp_service.h
+./inet_pton.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./inet_pton.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./inet_pton.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./inet_pton.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./inet_pton.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./inet_pton.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./inet_pton.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./inet_pton.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./inet_pton.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./inet_pton.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./inet_pton.lo: ../include/net-snmp/library/ucd_compat.h
+./inet_pton.lo: ../include/net-snmp/library/mib.h
+./inet_pton.lo: ../include/net-snmp/mib_api.h
+./inet_pton.lo: ../include/net-snmp/library/parse.h
+./inet_pton.lo: ../include/net-snmp/library/oid_stash.h
+./inet_pton.lo: ../include/net-snmp/net-snmp-features.h
+./inet_pton.lo: ../include/net-snmp/library/snmp_impl.h
+./inet_pton.lo: ../include/net-snmp/library/snmp.h
+./inet_pton.lo: ../include/net-snmp/library/snmp-tc.h inet_pton.h
+./int64.lo: ../include/net-snmp/net-snmp-config.h
+./int64.lo: ../include/net-snmp/types.h
+./int64.lo: ../include/net-snmp/library/oid.h
+./int64.lo: ../include/net-snmp/library/types.h
+./int64.lo: ../include/net-snmp/definitions.h
+./int64.lo: ../include/net-snmp/library/snmp_api.h
+./int64.lo: ../include/net-snmp/varbind_api.h
+./int64.lo: ../include/net-snmp/library/snmp_client.h
+./int64.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./int64.lo: ../include/net-snmp/output_api.h
+./int64.lo: ../include/net-snmp/library/snmp_debug.h
+./int64.lo: ../include/net-snmp/library/snmp_logging.h
+./int64.lo: ../include/net-snmp/session_api.h
+./int64.lo: ../include/net-snmp/library/callback.h
+./int64.lo: ../include/net-snmp/library/snmp_transport.h
+./int64.lo: ../include/net-snmp/library/snmp_service.h
+./int64.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./int64.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./int64.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./int64.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./int64.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./int64.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./int64.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./int64.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./int64.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./int64.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./int64.lo: ../include/net-snmp/library/ucd_compat.h
+./int64.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./int64.lo: ../include/net-snmp/library/parse.h
+./int64.lo: ../include/net-snmp/library/oid_stash.h
+./int64.lo: ../include/net-snmp/net-snmp-features.h
+./int64.lo: ../include/net-snmp/library/snmp_impl.h
+./int64.lo: ../include/net-snmp/library/snmp.h
+./int64.lo: ../include/net-snmp/library/snmp-tc.h
+./int64.lo: ../include/net-snmp/library/int64.h
+./int64.lo: ../include/net-snmp/library/snmp_assert.h
+./keytools.lo: ../include/net-snmp/net-snmp-config.h
+./keytools.lo: ../include/net-snmp/net-snmp-features.h
+./keytools.lo: ../include/net-snmp/types.h
+./keytools.lo: ../include/net-snmp/library/oid.h
+./keytools.lo: ../include/net-snmp/library/types.h
+./keytools.lo: ../include/net-snmp/definitions.h
+./keytools.lo: ../include/net-snmp/library/snmp_api.h
+./keytools.lo: ../include/net-snmp/varbind_api.h
+./keytools.lo: ../include/net-snmp/library/snmp_client.h
+./keytools.lo: ../include/net-snmp/pdu_api.h
+./keytools.lo: ../include/net-snmp/library/asn1.h
+./keytools.lo: ../include/net-snmp/output_api.h
+./keytools.lo: ../include/net-snmp/library/snmp_debug.h
+./keytools.lo: ../include/net-snmp/library/snmp_logging.h
+./keytools.lo: ../include/net-snmp/session_api.h
+./keytools.lo: ../include/net-snmp/library/callback.h
+./keytools.lo: ../include/net-snmp/library/snmp_transport.h
+./keytools.lo: ../include/net-snmp/library/snmp_service.h
+./keytools.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./keytools.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./keytools.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./keytools.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./keytools.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./keytools.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./keytools.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./keytools.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./keytools.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./keytools.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./keytools.lo: ../include/net-snmp/library/ucd_compat.h
+./keytools.lo: ../include/net-snmp/library/mib.h
+./keytools.lo: ../include/net-snmp/mib_api.h
+./keytools.lo: ../include/net-snmp/library/parse.h
+./keytools.lo: ../include/net-snmp/library/oid_stash.h
+./keytools.lo: ../include/net-snmp/library/snmp_impl.h
+./keytools.lo: ../include/net-snmp/library/snmp.h
+./keytools.lo: ../include/net-snmp/library/snmp-tc.h
+./keytools.lo: ../include/net-snmp/utilities.h
+./keytools.lo: ../include/net-snmp/library/system.h
+./keytools.lo: ../include/net-snmp/library/tools.h
+./keytools.lo: ../include/net-snmp/library/int64.h
+./keytools.lo: ../include/net-snmp/library/mt_support.h
+./keytools.lo: ../include/net-snmp/library/snmp_alarm.h
+./keytools.lo: ../include/net-snmp/library/data_list.h
+./keytools.lo: ../include/net-snmp/library/check_varbind.h
+./keytools.lo: ../include/net-snmp/library/container.h
+./keytools.lo: ../include/net-snmp/library/factory.h
+./keytools.lo: ../include/net-snmp/library/container_binary_array.h
+./keytools.lo: ../include/net-snmp/library/container_list_ssll.h
+./keytools.lo: ../include/net-snmp/library/container_iterator.h
+./keytools.lo: ../include/net-snmp/library/container.h
+./keytools.lo: ../include/net-snmp/library/snmp_assert.h
+./keytools.lo: ../include/net-snmp/version.h
+./keytools.lo: ../include/net-snmp/library/scapi.h
+./keytools.lo: ../include/net-snmp/library/keytools.h
+./keytools.lo: ../include/net-snmp/library/transform_oids.h
+./large_fd_set.lo: ../include/net-snmp/net-snmp-config.h
+./large_fd_set.lo: ../include/net-snmp/net-snmp-includes.h
+./large_fd_set.lo: ../include/net-snmp/definitions.h
+./large_fd_set.lo: ../include/net-snmp/types.h
+./large_fd_set.lo: ../include/net-snmp/library/oid.h
+./large_fd_set.lo: ../include/net-snmp/library/types.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_api.h
+./large_fd_set.lo: ../include/net-snmp/varbind_api.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_client.h
+./large_fd_set.lo: ../include/net-snmp/pdu_api.h
+./large_fd_set.lo: ../include/net-snmp/library/asn1.h
+./large_fd_set.lo: ../include/net-snmp/output_api.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_debug.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_logging.h
+./large_fd_set.lo: ../include/net-snmp/session_api.h
+./large_fd_set.lo: ../include/net-snmp/library/callback.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_transport.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_service.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./large_fd_set.lo: ../include/net-snmp/library/ucd_compat.h
+./large_fd_set.lo: ../include/net-snmp/library/mib.h
+./large_fd_set.lo: ../include/net-snmp/mib_api.h
+./large_fd_set.lo: ../include/net-snmp/library/parse.h
+./large_fd_set.lo: ../include/net-snmp/library/oid_stash.h
+./large_fd_set.lo: ../include/net-snmp/net-snmp-features.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_impl.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp-tc.h
+./large_fd_set.lo: ../include/net-snmp/library/getopt.h
+./large_fd_set.lo: ../include/net-snmp/utilities.h
+./large_fd_set.lo: ../include/net-snmp/library/system.h
+./large_fd_set.lo: ../include/net-snmp/library/tools.h
+./large_fd_set.lo: ../include/net-snmp/library/int64.h
+./large_fd_set.lo: ../include/net-snmp/library/mt_support.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_alarm.h
+./large_fd_set.lo: ../include/net-snmp/library/data_list.h
+./large_fd_set.lo: ../include/net-snmp/library/check_varbind.h
+./large_fd_set.lo: ../include/net-snmp/library/container.h
+./large_fd_set.lo: ../include/net-snmp/library/factory.h
+./large_fd_set.lo: ../include/net-snmp/library/container_binary_array.h
+./large_fd_set.lo: ../include/net-snmp/library/container_list_ssll.h
+./large_fd_set.lo: ../include/net-snmp/library/container_iterator.h
+./large_fd_set.lo: ../include/net-snmp/library/container.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_assert.h
+./large_fd_set.lo: ../include/net-snmp/version.h
+./large_fd_set.lo: ../include/net-snmp/config_api.h
+./large_fd_set.lo: ../include/net-snmp/library/read_config.h
+./large_fd_set.lo: ../include/net-snmp/library/default_store.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_parse_args.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_enum.h
+./large_fd_set.lo: ../include/net-snmp/library/vacm.h
+./large_fd_set.lo: ../include/net-snmp/snmpv3_api.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpv3.h
+./large_fd_set.lo: ../include/net-snmp/library/transform_oids.h
+./large_fd_set.lo: ../include/net-snmp/library/keytools.h
+./large_fd_set.lo: ../include/net-snmp/library/scapi.h
+./large_fd_set.lo: ../include/net-snmp/library/lcd_time.h
+./large_fd_set.lo: ../include/net-snmp/library/snmp_secmod.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./large_fd_set.lo: ../include/net-snmp/library/snmptsm.h
+./large_fd_set.lo: ../include/net-snmp/library/snmpusm.h
+./large_fd_set.lo: ../include/net-snmp/library/large_fd_set.h
+./lcd_time.lo: ../include/net-snmp/net-snmp-config.h
+./lcd_time.lo: ../include/net-snmp/net-snmp-features.h
+./lcd_time.lo: ../include/net-snmp/types.h
+./lcd_time.lo: ../include/net-snmp/library/oid.h
+./lcd_time.lo: ../include/net-snmp/library/types.h
+./lcd_time.lo: ../include/net-snmp/definitions.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_api.h
+./lcd_time.lo: ../include/net-snmp/varbind_api.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_client.h
+./lcd_time.lo: ../include/net-snmp/pdu_api.h
+./lcd_time.lo: ../include/net-snmp/library/asn1.h
+./lcd_time.lo: ../include/net-snmp/output_api.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_debug.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_logging.h
+./lcd_time.lo: ../include/net-snmp/session_api.h
+./lcd_time.lo: ../include/net-snmp/library/callback.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_transport.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_service.h
+./lcd_time.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./lcd_time.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./lcd_time.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./lcd_time.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./lcd_time.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./lcd_time.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./lcd_time.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./lcd_time.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./lcd_time.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./lcd_time.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./lcd_time.lo: ../include/net-snmp/library/ucd_compat.h
+./lcd_time.lo: ../include/net-snmp/library/mib.h
+./lcd_time.lo: ../include/net-snmp/mib_api.h
+./lcd_time.lo: ../include/net-snmp/library/parse.h
+./lcd_time.lo: ../include/net-snmp/library/oid_stash.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_impl.h
+./lcd_time.lo: ../include/net-snmp/library/snmp.h
+./lcd_time.lo: ../include/net-snmp/library/snmp-tc.h
+./lcd_time.lo: ../include/net-snmp/utilities.h
+./lcd_time.lo: ../include/net-snmp/library/system.h
+./lcd_time.lo: ../include/net-snmp/library/tools.h
+./lcd_time.lo: ../include/net-snmp/library/int64.h
+./lcd_time.lo: ../include/net-snmp/library/mt_support.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_alarm.h
+./lcd_time.lo: ../include/net-snmp/library/data_list.h
+./lcd_time.lo: ../include/net-snmp/library/check_varbind.h
+./lcd_time.lo: ../include/net-snmp/library/container.h
+./lcd_time.lo: ../include/net-snmp/library/factory.h
+./lcd_time.lo: ../include/net-snmp/library/container_binary_array.h
+./lcd_time.lo: ../include/net-snmp/library/container_list_ssll.h
+./lcd_time.lo: ../include/net-snmp/library/container_iterator.h
+./lcd_time.lo: ../include/net-snmp/library/container.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_assert.h
+./lcd_time.lo: ../include/net-snmp/version.h
+./lcd_time.lo: ../include/net-snmp/library/snmp_secmod.h
+./lcd_time.lo: ../include/net-snmp/library/snmpusm.h
+./lcd_time.lo: ../include/net-snmp/library/lcd_time.h
+./lcd_time.lo: ../include/net-snmp/library/scapi.h
+./lcd_time.lo: ../include/net-snmp/library/snmpv3.h
+./lcd_time.lo: ../include/net-snmp/library/transform_oids.h
+./md5.lo: ../include/net-snmp/net-snmp-config.h
+./md5.lo: ../include/net-snmp/net-snmp-includes.h
+./md5.lo: ../include/net-snmp/definitions.h
+./md5.lo: ../include/net-snmp/types.h
+./md5.lo: ../include/net-snmp/library/oid.h
+./md5.lo: ../include/net-snmp/library/types.h
+./md5.lo: ../include/net-snmp/library/snmp_api.h
+./md5.lo: ../include/net-snmp/varbind_api.h
+./md5.lo: ../include/net-snmp/library/snmp_client.h
+./md5.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./md5.lo: ../include/net-snmp/output_api.h
+./md5.lo: ../include/net-snmp/library/snmp_debug.h
+./md5.lo: ../include/net-snmp/library/snmp_logging.h
+./md5.lo: ../include/net-snmp/session_api.h
+./md5.lo: ../include/net-snmp/library/callback.h
+./md5.lo: ../include/net-snmp/library/snmp_transport.h
+./md5.lo: ../include/net-snmp/library/snmp_service.h
+./md5.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./md5.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./md5.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./md5.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./md5.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./md5.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./md5.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./md5.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./md5.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./md5.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./md5.lo: ../include/net-snmp/library/ucd_compat.h
+./md5.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./md5.lo: ../include/net-snmp/library/parse.h
+./md5.lo: ../include/net-snmp/library/oid_stash.h
+./md5.lo: ../include/net-snmp/net-snmp-features.h
+./md5.lo: ../include/net-snmp/library/snmp_impl.h
+./md5.lo: ../include/net-snmp/library/snmp.h
+./md5.lo: ../include/net-snmp/library/snmp-tc.h
+./md5.lo: ../include/net-snmp/library/getopt.h
+./md5.lo: ../include/net-snmp/utilities.h
+./md5.lo: ../include/net-snmp/library/system.h
+./md5.lo: ../include/net-snmp/library/tools.h
+./md5.lo: ../include/net-snmp/library/int64.h
+./md5.lo: ../include/net-snmp/library/mt_support.h
+./md5.lo: ../include/net-snmp/library/snmp_alarm.h
+./md5.lo: ../include/net-snmp/library/data_list.h
+./md5.lo: ../include/net-snmp/library/check_varbind.h
+./md5.lo: ../include/net-snmp/library/container.h
+./md5.lo: ../include/net-snmp/library/factory.h
+./md5.lo: ../include/net-snmp/library/container_binary_array.h
+./md5.lo: ../include/net-snmp/library/container_list_ssll.h
+./md5.lo: ../include/net-snmp/library/container_iterator.h
+./md5.lo: ../include/net-snmp/library/container.h
+./md5.lo: ../include/net-snmp/library/snmp_assert.h
+./md5.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./md5.lo: ../include/net-snmp/library/read_config.h
+./md5.lo: ../include/net-snmp/library/default_store.h
+./md5.lo: ../include/net-snmp/library/snmp_parse_args.h
+./md5.lo: ../include/net-snmp/library/snmp_enum.h
+./md5.lo: ../include/net-snmp/library/vacm.h ../include/net-snmp/snmpv3_api.h
+./md5.lo: ../include/net-snmp/library/snmpv3.h
+./md5.lo: ../include/net-snmp/library/transform_oids.h
+./md5.lo: ../include/net-snmp/library/keytools.h
+./md5.lo: ../include/net-snmp/library/scapi.h
+./md5.lo: ../include/net-snmp/library/lcd_time.h
+./md5.lo: ../include/net-snmp/library/snmp_secmod.h
+./md5.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./md5.lo: ../include/net-snmp/library/snmptsm.h
+./md5.lo: ../include/net-snmp/library/snmpusm.h
+./md5.lo: ../include/net-snmp/library/md5.h
+./mib.lo: ../include/net-snmp/net-snmp-config.h
+./mib.lo: ../include/net-snmp/net-snmp-features.h
+./mib.lo: ../include/net-snmp/types.h
+./mib.lo: ../include/net-snmp/library/oid.h
+./mib.lo: ../include/net-snmp/library/types.h
+./mib.lo: ../include/net-snmp/definitions.h
+./mib.lo: ../include/net-snmp/library/snmp_api.h
+./mib.lo: ../include/net-snmp/varbind_api.h
+./mib.lo: ../include/net-snmp/library/snmp_client.h
+./mib.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./mib.lo: ../include/net-snmp/output_api.h
+./mib.lo: ../include/net-snmp/library/snmp_debug.h
+./mib.lo: ../include/net-snmp/library/snmp_logging.h
+./mib.lo: ../include/net-snmp/session_api.h
+./mib.lo: ../include/net-snmp/library/callback.h
+./mib.lo: ../include/net-snmp/library/snmp_transport.h
+./mib.lo: ../include/net-snmp/library/snmp_service.h
+./mib.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./mib.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./mib.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./mib.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./mib.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./mib.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./mib.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./mib.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mib.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./mib.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./mib.lo: ../include/net-snmp/library/ucd_compat.h
+./mib.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./mib.lo: ../include/net-snmp/library/parse.h
+./mib.lo: ../include/net-snmp/library/oid_stash.h
+./mib.lo: ../include/net-snmp/library/snmp_impl.h
+./mib.lo: ../include/net-snmp/library/snmp.h
+./mib.lo: ../include/net-snmp/library/snmp-tc.h
+./mib.lo: ../include/net-snmp/config_api.h
+./mib.lo: ../include/net-snmp/library/read_config.h
+./mib.lo: ../include/net-snmp/library/default_store.h
+./mib.lo: ../include/net-snmp/library/snmp_parse_args.h
+./mib.lo: ../include/net-snmp/library/snmp_enum.h
+./mib.lo: ../include/net-snmp/library/vacm.h ../include/net-snmp/utilities.h
+./mib.lo: ../include/net-snmp/library/system.h
+./mib.lo: ../include/net-snmp/library/tools.h
+./mib.lo: ../include/net-snmp/library/int64.h
+./mib.lo: ../include/net-snmp/library/mt_support.h
+./mib.lo: ../include/net-snmp/library/snmp_alarm.h
+./mib.lo: ../include/net-snmp/library/data_list.h
+./mib.lo: ../include/net-snmp/library/check_varbind.h
+./mib.lo: ../include/net-snmp/library/container.h
+./mib.lo: ../include/net-snmp/library/factory.h
+./mib.lo: ../include/net-snmp/library/container_binary_array.h
+./mib.lo: ../include/net-snmp/library/container_list_ssll.h
+./mib.lo: ../include/net-snmp/library/container_iterator.h
+./mib.lo: ../include/net-snmp/library/container.h
+./mib.lo: ../include/net-snmp/library/snmp_assert.h
+./mib.lo: ../include/net-snmp/version.h
+./mt_support.lo: ../include/net-snmp/net-snmp-config.h
+./mt_support.lo: ../include/net-snmp/library/mt_support.h
+./oid_stash.lo: ../include/net-snmp/net-snmp-config.h
+./oid_stash.lo: ../include/net-snmp/net-snmp-features.h
+./oid_stash.lo: ../include/net-snmp/net-snmp-includes.h
+./oid_stash.lo: ../include/net-snmp/definitions.h
+./oid_stash.lo: ../include/net-snmp/types.h
+./oid_stash.lo: ../include/net-snmp/library/oid.h
+./oid_stash.lo: ../include/net-snmp/library/types.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_api.h
+./oid_stash.lo: ../include/net-snmp/varbind_api.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_client.h
+./oid_stash.lo: ../include/net-snmp/pdu_api.h
+./oid_stash.lo: ../include/net-snmp/library/asn1.h
+./oid_stash.lo: ../include/net-snmp/output_api.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_debug.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_logging.h
+./oid_stash.lo: ../include/net-snmp/session_api.h
+./oid_stash.lo: ../include/net-snmp/library/callback.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_transport.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_service.h
+./oid_stash.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./oid_stash.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./oid_stash.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./oid_stash.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./oid_stash.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./oid_stash.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./oid_stash.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./oid_stash.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./oid_stash.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./oid_stash.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./oid_stash.lo: ../include/net-snmp/library/ucd_compat.h
+./oid_stash.lo: ../include/net-snmp/library/mib.h
+./oid_stash.lo: ../include/net-snmp/mib_api.h
+./oid_stash.lo: ../include/net-snmp/library/parse.h
+./oid_stash.lo: ../include/net-snmp/library/oid_stash.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_impl.h
+./oid_stash.lo: ../include/net-snmp/library/snmp.h
+./oid_stash.lo: ../include/net-snmp/library/snmp-tc.h
+./oid_stash.lo: ../include/net-snmp/library/getopt.h
+./oid_stash.lo: ../include/net-snmp/utilities.h
+./oid_stash.lo: ../include/net-snmp/library/system.h
+./oid_stash.lo: ../include/net-snmp/library/tools.h
+./oid_stash.lo: ../include/net-snmp/library/int64.h
+./oid_stash.lo: ../include/net-snmp/library/mt_support.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_alarm.h
+./oid_stash.lo: ../include/net-snmp/library/data_list.h
+./oid_stash.lo: ../include/net-snmp/library/check_varbind.h
+./oid_stash.lo: ../include/net-snmp/library/container.h
+./oid_stash.lo: ../include/net-snmp/library/factory.h
+./oid_stash.lo: ../include/net-snmp/library/container_binary_array.h
+./oid_stash.lo: ../include/net-snmp/library/container_list_ssll.h
+./oid_stash.lo: ../include/net-snmp/library/container_iterator.h
+./oid_stash.lo: ../include/net-snmp/library/container.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_assert.h
+./oid_stash.lo: ../include/net-snmp/version.h
+./oid_stash.lo: ../include/net-snmp/config_api.h
+./oid_stash.lo: ../include/net-snmp/library/read_config.h
+./oid_stash.lo: ../include/net-snmp/library/default_store.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_parse_args.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_enum.h
+./oid_stash.lo: ../include/net-snmp/library/vacm.h
+./oid_stash.lo: ../include/net-snmp/snmpv3_api.h
+./oid_stash.lo: ../include/net-snmp/library/snmpv3.h
+./oid_stash.lo: ../include/net-snmp/library/transform_oids.h
+./oid_stash.lo: ../include/net-snmp/library/keytools.h
+./oid_stash.lo: ../include/net-snmp/library/scapi.h
+./oid_stash.lo: ../include/net-snmp/library/lcd_time.h
+./oid_stash.lo: ../include/net-snmp/library/snmp_secmod.h
+./oid_stash.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./oid_stash.lo: ../include/net-snmp/library/snmptsm.h
+./oid_stash.lo: ../include/net-snmp/library/snmpusm.h
+./opendir.lo: ../include/net-snmp/net-snmp-config.h
+./opendir.lo: ../include/net-snmp/types.h
+./opendir.lo: ../include/net-snmp/library/oid.h
+./opendir.lo: ../include/net-snmp/library/types.h
+./opendir.lo: ../include/net-snmp/definitions.h
+./opendir.lo: ../include/net-snmp/library/snmp_api.h
+./opendir.lo: ../include/net-snmp/varbind_api.h
+./opendir.lo: ../include/net-snmp/library/snmp_client.h
+./opendir.lo: ../include/net-snmp/pdu_api.h
+./opendir.lo: ../include/net-snmp/library/asn1.h
+./opendir.lo: ../include/net-snmp/output_api.h
+./opendir.lo: ../include/net-snmp/library/snmp_debug.h
+./opendir.lo: ../include/net-snmp/library/snmp_logging.h
+./opendir.lo: ../include/net-snmp/session_api.h
+./opendir.lo: ../include/net-snmp/library/callback.h
+./opendir.lo: ../include/net-snmp/library/snmp_transport.h
+./opendir.lo: ../include/net-snmp/library/snmp_service.h
+./opendir.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./opendir.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./opendir.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./opendir.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./opendir.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./opendir.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./opendir.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./opendir.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./opendir.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./opendir.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./opendir.lo: ../include/net-snmp/library/ucd_compat.h
+./opendir.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./opendir.lo: ../include/net-snmp/library/parse.h
+./opendir.lo: ../include/net-snmp/library/oid_stash.h
+./opendir.lo: ../include/net-snmp/net-snmp-features.h
+./opendir.lo: ../include/net-snmp/library/snmp_impl.h
+./opendir.lo: ../include/net-snmp/library/snmp.h
+./opendir.lo: ../include/net-snmp/library/snmp-tc.h
+./opendir.lo: ../include/net-snmp/library/system.h
+./parse.lo: ../include/net-snmp/net-snmp-config.h
+./parse.lo: ../include/net-snmp/net-snmp-features.h
+./parse.lo: ../include/net-snmp/types.h
+./parse.lo: ../include/net-snmp/library/oid.h
+./parse.lo: ../include/net-snmp/library/types.h
+./parse.lo: ../include/net-snmp/definitions.h
+./parse.lo: ../include/net-snmp/library/snmp_api.h
+./parse.lo: ../include/net-snmp/varbind_api.h
+./parse.lo: ../include/net-snmp/library/snmp_client.h
+./parse.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./parse.lo: ../include/net-snmp/output_api.h
+./parse.lo: ../include/net-snmp/library/snmp_debug.h
+./parse.lo: ../include/net-snmp/library/snmp_logging.h
+./parse.lo: ../include/net-snmp/session_api.h
+./parse.lo: ../include/net-snmp/library/callback.h
+./parse.lo: ../include/net-snmp/library/snmp_transport.h
+./parse.lo: ../include/net-snmp/library/snmp_service.h
+./parse.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./parse.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./parse.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./parse.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./parse.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./parse.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./parse.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./parse.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./parse.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./parse.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./parse.lo: ../include/net-snmp/library/ucd_compat.h
+./parse.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./parse.lo: ../include/net-snmp/library/parse.h
+./parse.lo: ../include/net-snmp/library/oid_stash.h
+./parse.lo: ../include/net-snmp/library/snmp_impl.h
+./parse.lo: ../include/net-snmp/library/snmp.h
+./parse.lo: ../include/net-snmp/library/snmp-tc.h
+./parse.lo: ../include/net-snmp/config_api.h
+./parse.lo: ../include/net-snmp/library/read_config.h
+./parse.lo: ../include/net-snmp/library/default_store.h
+./parse.lo: ../include/net-snmp/library/snmp_parse_args.h
+./parse.lo: ../include/net-snmp/library/snmp_enum.h
+./parse.lo: ../include/net-snmp/library/vacm.h
+./parse.lo: ../include/net-snmp/utilities.h
+./parse.lo: ../include/net-snmp/library/system.h
+./parse.lo: ../include/net-snmp/library/tools.h
+./parse.lo: ../include/net-snmp/library/int64.h
+./parse.lo: ../include/net-snmp/library/mt_support.h
+./parse.lo: ../include/net-snmp/library/snmp_alarm.h
+./parse.lo: ../include/net-snmp/library/data_list.h
+./parse.lo: ../include/net-snmp/library/check_varbind.h
+./parse.lo: ../include/net-snmp/library/container.h
+./parse.lo: ../include/net-snmp/library/factory.h
+./parse.lo: ../include/net-snmp/library/container_binary_array.h
+./parse.lo: ../include/net-snmp/library/container_list_ssll.h
+./parse.lo: ../include/net-snmp/library/container_iterator.h
+./parse.lo: ../include/net-snmp/library/container.h
+./parse.lo: ../include/net-snmp/library/snmp_assert.h
+./parse.lo: ../include/net-snmp/version.h
+./pkcs.lo: ../include/net-snmp/net-snmp-config.h
+./read_config.lo: ../include/net-snmp/net-snmp-config.h
+./read_config.lo: ../include/net-snmp/net-snmp-features.h
+./read_config.lo: ../include/net-snmp/types.h
+./read_config.lo: ../include/net-snmp/library/oid.h
+./read_config.lo: ../include/net-snmp/library/types.h
+./read_config.lo: ../include/net-snmp/definitions.h
+./read_config.lo: ../include/net-snmp/library/snmp_api.h
+./read_config.lo: ../include/net-snmp/varbind_api.h
+./read_config.lo: ../include/net-snmp/library/snmp_client.h
+./read_config.lo: ../include/net-snmp/pdu_api.h
+./read_config.lo: ../include/net-snmp/library/asn1.h
+./read_config.lo: ../include/net-snmp/output_api.h
+./read_config.lo: ../include/net-snmp/library/snmp_debug.h
+./read_config.lo: ../include/net-snmp/library/snmp_logging.h
+./read_config.lo: ../include/net-snmp/session_api.h
+./read_config.lo: ../include/net-snmp/library/callback.h
+./read_config.lo: ../include/net-snmp/library/snmp_transport.h
+./read_config.lo: ../include/net-snmp/library/snmp_service.h
+./read_config.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./read_config.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./read_config.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./read_config.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./read_config.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./read_config.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./read_config.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./read_config.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./read_config.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./read_config.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./read_config.lo: ../include/net-snmp/library/ucd_compat.h
+./read_config.lo: ../include/net-snmp/library/mib.h
+./read_config.lo: ../include/net-snmp/mib_api.h
+./read_config.lo: ../include/net-snmp/library/parse.h
+./read_config.lo: ../include/net-snmp/library/oid_stash.h
+./read_config.lo: ../include/net-snmp/library/snmp_impl.h
+./read_config.lo: ../include/net-snmp/library/snmp.h
+./read_config.lo: ../include/net-snmp/library/snmp-tc.h
+./read_config.lo: ../include/net-snmp/config_api.h
+./read_config.lo: ../include/net-snmp/library/read_config.h
+./read_config.lo: ../include/net-snmp/library/default_store.h
+./read_config.lo: ../include/net-snmp/library/snmp_parse_args.h
+./read_config.lo: ../include/net-snmp/library/snmp_enum.h
+./read_config.lo: ../include/net-snmp/library/vacm.h
+./read_config.lo: ../include/net-snmp/utilities.h
+./read_config.lo: ../include/net-snmp/library/system.h
+./read_config.lo: ../include/net-snmp/library/tools.h
+./read_config.lo: ../include/net-snmp/library/int64.h
+./read_config.lo: ../include/net-snmp/library/mt_support.h
+./read_config.lo: ../include/net-snmp/library/snmp_alarm.h
+./read_config.lo: ../include/net-snmp/library/data_list.h
+./read_config.lo: ../include/net-snmp/library/check_varbind.h
+./read_config.lo: ../include/net-snmp/library/container.h
+./read_config.lo: ../include/net-snmp/library/factory.h
+./read_config.lo: ../include/net-snmp/library/container_binary_array.h
+./read_config.lo: ../include/net-snmp/library/container_list_ssll.h
+./read_config.lo: ../include/net-snmp/library/container_iterator.h
+./read_config.lo: ../include/net-snmp/library/container.h
+./read_config.lo: ../include/net-snmp/library/snmp_assert.h
+./read_config.lo: ../include/net-snmp/version.h
+./readdir.lo: ../include/net-snmp/net-snmp-config.h
+./readdir.lo: ../include/net-snmp/types.h
+./readdir.lo: ../include/net-snmp/library/oid.h
+./readdir.lo: ../include/net-snmp/library/types.h
+./readdir.lo: ../include/net-snmp/definitions.h
+./readdir.lo: ../include/net-snmp/library/snmp_api.h
+./readdir.lo: ../include/net-snmp/varbind_api.h
+./readdir.lo: ../include/net-snmp/library/snmp_client.h
+./readdir.lo: ../include/net-snmp/pdu_api.h
+./readdir.lo: ../include/net-snmp/library/asn1.h
+./readdir.lo: ../include/net-snmp/output_api.h
+./readdir.lo: ../include/net-snmp/library/snmp_debug.h
+./readdir.lo: ../include/net-snmp/library/snmp_logging.h
+./readdir.lo: ../include/net-snmp/session_api.h
+./readdir.lo: ../include/net-snmp/library/callback.h
+./readdir.lo: ../include/net-snmp/library/snmp_transport.h
+./readdir.lo: ../include/net-snmp/library/snmp_service.h
+./readdir.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./readdir.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./readdir.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./readdir.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./readdir.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./readdir.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./readdir.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./readdir.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./readdir.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./readdir.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./readdir.lo: ../include/net-snmp/library/ucd_compat.h
+./readdir.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./readdir.lo: ../include/net-snmp/library/parse.h
+./readdir.lo: ../include/net-snmp/library/oid_stash.h
+./readdir.lo: ../include/net-snmp/net-snmp-features.h
+./readdir.lo: ../include/net-snmp/library/snmp_impl.h
+./readdir.lo: ../include/net-snmp/library/snmp.h
+./readdir.lo: ../include/net-snmp/library/snmp-tc.h
+./readdir.lo: ../include/net-snmp/library/system.h
+./scapi.lo: ../include/net-snmp/net-snmp-config.h
+./scapi.lo: ../include/net-snmp/net-snmp-features.h
+./scapi.lo: ../include/net-snmp/types.h
+./scapi.lo: ../include/net-snmp/library/oid.h
+./scapi.lo: ../include/net-snmp/library/types.h
+./scapi.lo: ../include/net-snmp/definitions.h
+./scapi.lo: ../include/net-snmp/library/snmp_api.h
+./scapi.lo: ../include/net-snmp/varbind_api.h
+./scapi.lo: ../include/net-snmp/library/snmp_client.h
+./scapi.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./scapi.lo: ../include/net-snmp/output_api.h
+./scapi.lo: ../include/net-snmp/library/snmp_debug.h
+./scapi.lo: ../include/net-snmp/library/snmp_logging.h
+./scapi.lo: ../include/net-snmp/session_api.h
+./scapi.lo: ../include/net-snmp/library/callback.h
+./scapi.lo: ../include/net-snmp/library/snmp_transport.h
+./scapi.lo: ../include/net-snmp/library/snmp_service.h
+./scapi.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./scapi.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./scapi.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./scapi.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./scapi.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./scapi.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./scapi.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./scapi.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./scapi.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./scapi.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./scapi.lo: ../include/net-snmp/library/ucd_compat.h
+./scapi.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./scapi.lo: ../include/net-snmp/library/parse.h
+./scapi.lo: ../include/net-snmp/library/oid_stash.h
+./scapi.lo: ../include/net-snmp/library/snmp_impl.h
+./scapi.lo: ../include/net-snmp/library/snmp.h
+./scapi.lo: ../include/net-snmp/library/snmp-tc.h
+./scapi.lo: ../include/net-snmp/utilities.h
+./scapi.lo: ../include/net-snmp/library/system.h
+./scapi.lo: ../include/net-snmp/library/tools.h
+./scapi.lo: ../include/net-snmp/library/int64.h
+./scapi.lo: ../include/net-snmp/library/mt_support.h
+./scapi.lo: ../include/net-snmp/library/snmp_alarm.h
+./scapi.lo: ../include/net-snmp/library/data_list.h
+./scapi.lo: ../include/net-snmp/library/check_varbind.h
+./scapi.lo: ../include/net-snmp/library/container.h
+./scapi.lo: ../include/net-snmp/library/factory.h
+./scapi.lo: ../include/net-snmp/library/container_binary_array.h
+./scapi.lo: ../include/net-snmp/library/container_list_ssll.h
+./scapi.lo: ../include/net-snmp/library/container_iterator.h
+./scapi.lo: ../include/net-snmp/library/container.h
+./scapi.lo: ../include/net-snmp/library/snmp_assert.h
+./scapi.lo: ../include/net-snmp/version.h
+./scapi.lo: ../include/net-snmp/library/snmp_secmod.h
+./scapi.lo: ../include/net-snmp/library/snmpusm.h
+./scapi.lo: ../include/net-snmp/library/keytools.h
+./scapi.lo: ../include/net-snmp/library/scapi.h
+./scapi.lo: ../include/net-snmp/library/transform_oids.h
+./snmp_alarm.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_alarm.lo: ../include/net-snmp/types.h
+./snmp_alarm.lo: ../include/net-snmp/library/oid.h
+./snmp_alarm.lo: ../include/net-snmp/library/types.h
+./snmp_alarm.lo: ../include/net-snmp/definitions.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_alarm.lo: ../include/net-snmp/varbind_api.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_alarm.lo: ../include/net-snmp/pdu_api.h
+./snmp_alarm.lo: ../include/net-snmp/library/asn1.h
+./snmp_alarm.lo: ../include/net-snmp/output_api.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_alarm.lo: ../include/net-snmp/session_api.h
+./snmp_alarm.lo: ../include/net-snmp/library/callback.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_alarm.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_alarm.lo: ../include/net-snmp/library/mib.h
+./snmp_alarm.lo: ../include/net-snmp/mib_api.h
+./snmp_alarm.lo: ../include/net-snmp/library/parse.h
+./snmp_alarm.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_alarm.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_alarm.lo: ../include/net-snmp/config_api.h
+./snmp_alarm.lo: ../include/net-snmp/library/read_config.h
+./snmp_alarm.lo: ../include/net-snmp/library/default_store.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_alarm.lo: ../include/net-snmp/library/vacm.h
+./snmp_alarm.lo: ../include/net-snmp/utilities.h
+./snmp_alarm.lo: ../include/net-snmp/library/system.h
+./snmp_alarm.lo: ../include/net-snmp/library/tools.h
+./snmp_alarm.lo: ../include/net-snmp/library/int64.h
+./snmp_alarm.lo: ../include/net-snmp/library/mt_support.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_alarm.lo: ../include/net-snmp/library/data_list.h
+./snmp_alarm.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_alarm.lo: ../include/net-snmp/library/container.h
+./snmp_alarm.lo: ../include/net-snmp/library/factory.h
+./snmp_alarm.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_alarm.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_alarm.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_alarm.lo: ../include/net-snmp/library/container.h
+./snmp_alarm.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_alarm.lo: ../include/net-snmp/version.h
+./snmp_api.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_api.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_api.lo: ../include/net-snmp/types.h
+./snmp_api.lo: ../include/net-snmp/library/oid.h
+./snmp_api.lo: ../include/net-snmp/library/types.h
+./snmp_api.lo: ../include/net-snmp/definitions.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_api.lo: ../include/net-snmp/varbind_api.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_api.lo: ../include/net-snmp/pdu_api.h
+./snmp_api.lo: ../include/net-snmp/library/asn1.h
+./snmp_api.lo: ../include/net-snmp/output_api.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_api.lo: ../include/net-snmp/session_api.h
+./snmp_api.lo: ../include/net-snmp/library/callback.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_api.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_api.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_api.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_api.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_api.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_api.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_api.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_api.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_api.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_api.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_api.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_api.lo: ../include/net-snmp/library/mib.h
+./snmp_api.lo: ../include/net-snmp/mib_api.h
+./snmp_api.lo: ../include/net-snmp/library/parse.h
+./snmp_api.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_api.lo: ../include/net-snmp/library/snmp.h
+./snmp_api.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_api.lo: ../include/net-snmp/config_api.h
+./snmp_api.lo: ../include/net-snmp/library/read_config.h
+./snmp_api.lo: ../include/net-snmp/library/default_store.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_api.lo: ../include/net-snmp/library/vacm.h
+./snmp_api.lo: ../include/net-snmp/utilities.h
+./snmp_api.lo: ../include/net-snmp/library/system.h
+./snmp_api.lo: ../include/net-snmp/library/tools.h
+./snmp_api.lo: ../include/net-snmp/library/int64.h
+./snmp_api.lo: ../include/net-snmp/library/mt_support.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_api.lo: ../include/net-snmp/library/data_list.h
+./snmp_api.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_api.lo: ../include/net-snmp/library/container.h
+./snmp_api.lo: ../include/net-snmp/library/factory.h
+./snmp_api.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_api.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_api.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_api.lo: ../include/net-snmp/library/container.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_api.lo: ../include/net-snmp/version.h
+./snmp_api.lo: ../include/net-snmp/library/snmpv3.h
+./snmp_api.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmp_api.lo: ../include/net-snmp/library/large_fd_set.h
+./snmp_api.lo: ../include/net-snmp/library/keytools.h
+./snmp_api.lo: ../include/net-snmp/library/lcd_time.h
+./snmp_api.lo: ../agent/mibgroup/agentx/protocol.h
+./snmp_api.lo: ../include/net-snmp/library/transform_oids.h
+./snmp_auth.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_auth.lo: ../include/net-snmp/types.h
+./snmp_auth.lo: ../include/net-snmp/library/oid.h
+./snmp_auth.lo: ../include/net-snmp/library/types.h
+./snmp_auth.lo: ../include/net-snmp/definitions.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_auth.lo: ../include/net-snmp/varbind_api.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_auth.lo: ../include/net-snmp/pdu_api.h
+./snmp_auth.lo: ../include/net-snmp/library/asn1.h
+./snmp_auth.lo: ../include/net-snmp/output_api.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_auth.lo: ../include/net-snmp/session_api.h
+./snmp_auth.lo: ../include/net-snmp/library/callback.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_auth.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_auth.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_auth.lo: ../include/net-snmp/library/mib.h
+./snmp_auth.lo: ../include/net-snmp/mib_api.h
+./snmp_auth.lo: ../include/net-snmp/library/parse.h
+./snmp_auth.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_auth.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_auth.lo: ../include/net-snmp/utilities.h
+./snmp_auth.lo: ../include/net-snmp/library/system.h
+./snmp_auth.lo: ../include/net-snmp/library/tools.h
+./snmp_auth.lo: ../include/net-snmp/library/int64.h
+./snmp_auth.lo: ../include/net-snmp/library/mt_support.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_auth.lo: ../include/net-snmp/library/data_list.h
+./snmp_auth.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_auth.lo: ../include/net-snmp/library/container.h
+./snmp_auth.lo: ../include/net-snmp/library/factory.h
+./snmp_auth.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_auth.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_auth.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_auth.lo: ../include/net-snmp/library/container.h
+./snmp_auth.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_auth.lo: ../include/net-snmp/version.h
+./snmp_auth.lo: ../include/net-snmp/library/md5.h
+./snmp_auth.lo: ../include/net-snmp/library/scapi.h
+./snmp.lo: ../include/net-snmp/net-snmp-config.h
+./snmp.lo: ../include/net-snmp/types.h
+./snmp.lo: ../include/net-snmp/library/oid.h
+./snmp.lo: ../include/net-snmp/library/types.h
+./snmp.lo: ../include/net-snmp/definitions.h
+./snmp.lo: ../include/net-snmp/library/snmp_api.h
+./snmp.lo: ../include/net-snmp/varbind_api.h
+./snmp.lo: ../include/net-snmp/library/snmp_client.h
+./snmp.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./snmp.lo: ../include/net-snmp/output_api.h
+./snmp.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp.lo: ../include/net-snmp/session_api.h
+./snmp.lo: ../include/net-snmp/library/callback.h
+./snmp.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp.lo: ../include/net-snmp/library/snmp_service.h
+./snmp.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmp.lo: ../include/net-snmp/library/parse.h
+./snmp.lo: ../include/net-snmp/library/oid_stash.h
+./snmp.lo: ../include/net-snmp/net-snmp-features.h
+./snmp.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp.lo: ../include/net-snmp/library/snmp.h
+./snmp.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_client.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_client.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_client.lo: ../include/net-snmp/types.h
+./snmp_client.lo: ../include/net-snmp/library/oid.h
+./snmp_client.lo: ../include/net-snmp/library/types.h
+./snmp_client.lo: ../include/net-snmp/definitions.h
+./snmp_client.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_client.lo: ../include/net-snmp/varbind_api.h
+./snmp_client.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_client.lo: ../include/net-snmp/pdu_api.h
+./snmp_client.lo: ../include/net-snmp/library/asn1.h
+./snmp_client.lo: ../include/net-snmp/output_api.h
+./snmp_client.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_client.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_client.lo: ../include/net-snmp/session_api.h
+./snmp_client.lo: ../include/net-snmp/library/callback.h
+./snmp_client.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_client.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_client.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_client.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_client.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_client.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_client.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_client.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_client.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_client.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_client.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_client.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_client.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_client.lo: ../include/net-snmp/library/mib.h
+./snmp_client.lo: ../include/net-snmp/mib_api.h
+./snmp_client.lo: ../include/net-snmp/library/parse.h
+./snmp_client.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_client.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_client.lo: ../include/net-snmp/library/snmp.h
+./snmp_client.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_client.lo: ../include/net-snmp/agent/ds_agent.h
+./snmp_client.lo: ../include/net-snmp/library/default_store.h
+./snmp_client.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmp_client.lo: ../include/net-snmp/library/snmpusm.h
+./snmp_client.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_debug.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_debug.lo: ../include/net-snmp/types.h
+./snmp_debug.lo: ../include/net-snmp/library/oid.h
+./snmp_debug.lo: ../include/net-snmp/library/types.h
+./snmp_debug.lo: ../include/net-snmp/definitions.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_debug.lo: ../include/net-snmp/varbind_api.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_debug.lo: ../include/net-snmp/pdu_api.h
+./snmp_debug.lo: ../include/net-snmp/library/asn1.h
+./snmp_debug.lo: ../include/net-snmp/output_api.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_debug.lo: ../include/net-snmp/session_api.h
+./snmp_debug.lo: ../include/net-snmp/library/callback.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_debug.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_debug.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_debug.lo: ../include/net-snmp/library/mib.h
+./snmp_debug.lo: ../include/net-snmp/mib_api.h
+./snmp_debug.lo: ../include/net-snmp/library/parse.h
+./snmp_debug.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_debug.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_debug.lo: ../include/net-snmp/config_api.h
+./snmp_debug.lo: ../include/net-snmp/library/read_config.h
+./snmp_debug.lo: ../include/net-snmp/library/default_store.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_debug.lo: ../include/net-snmp/library/vacm.h
+./snmp_debug.lo: ../include/net-snmp/utilities.h
+./snmp_debug.lo: ../include/net-snmp/library/system.h
+./snmp_debug.lo: ../include/net-snmp/library/tools.h
+./snmp_debug.lo: ../include/net-snmp/library/int64.h
+./snmp_debug.lo: ../include/net-snmp/library/mt_support.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_debug.lo: ../include/net-snmp/library/data_list.h
+./snmp_debug.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_debug.lo: ../include/net-snmp/library/container.h
+./snmp_debug.lo: ../include/net-snmp/library/factory.h
+./snmp_debug.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_debug.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_debug.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_debug.lo: ../include/net-snmp/library/container.h
+./snmp_debug.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_debug.lo: ../include/net-snmp/version.h
+./snmp_enum.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_enum.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_enum.lo: ../include/net-snmp/types.h
+./snmp_enum.lo: ../include/net-snmp/library/oid.h
+./snmp_enum.lo: ../include/net-snmp/library/types.h
+./snmp_enum.lo: ../include/net-snmp/definitions.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_enum.lo: ../include/net-snmp/varbind_api.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_enum.lo: ../include/net-snmp/pdu_api.h
+./snmp_enum.lo: ../include/net-snmp/library/asn1.h
+./snmp_enum.lo: ../include/net-snmp/output_api.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_enum.lo: ../include/net-snmp/session_api.h
+./snmp_enum.lo: ../include/net-snmp/library/callback.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_enum.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_enum.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_enum.lo: ../include/net-snmp/library/mib.h
+./snmp_enum.lo: ../include/net-snmp/mib_api.h
+./snmp_enum.lo: ../include/net-snmp/library/parse.h
+./snmp_enum.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_enum.lo: ../include/net-snmp/config_api.h
+./snmp_enum.lo: ../include/net-snmp/library/read_config.h
+./snmp_enum.lo: ../include/net-snmp/library/default_store.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_enum.lo: ../include/net-snmp/library/vacm.h
+./snmp_enum.lo: ../include/net-snmp/library/tools.h
+./snmp_enum.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpksm.lo: ../include/net-snmp/net-snmp-config.h
+./snmpksm.lo: ../include/net-snmp/output_api.h
+./snmpksm.lo: ../include/net-snmp/types.h
+./snmpksm.lo: ../include/net-snmp/library/oid.h
+./snmpksm.lo: ../include/net-snmp/library/types.h
+./snmpksm.lo: ../include/net-snmp/definitions.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_api.h
+./snmpksm.lo: ../include/net-snmp/varbind_api.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_client.h
+./snmpksm.lo: ../include/net-snmp/pdu_api.h
+./snmpksm.lo: ../include/net-snmp/library/asn1.h
+./snmpksm.lo: ../include/net-snmp/session_api.h
+./snmpksm.lo: ../include/net-snmp/library/callback.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_service.h
+./snmpksm.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpksm.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpksm.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpksm.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpksm.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpksm.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpksm.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpksm.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpksm.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpksm.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpksm.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpksm.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmpksm.lo: ../include/net-snmp/library/parse.h
+./snmpksm.lo: ../include/net-snmp/library/oid_stash.h
+./snmpksm.lo: ../include/net-snmp/net-snmp-features.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpksm.lo: ../include/net-snmp/library/snmp.h
+./snmpksm.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpksm.lo: ../include/net-snmp/config_api.h
+./snmpksm.lo: ../include/net-snmp/library/read_config.h
+./snmpksm.lo: ../include/net-snmp/library/default_store.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpksm.lo: ../include/net-snmp/library/vacm.h
+./snmpksm.lo: ../include/net-snmp/utilities.h
+./snmpksm.lo: ../include/net-snmp/library/system.h
+./snmpksm.lo: ../include/net-snmp/library/tools.h
+./snmpksm.lo: ../include/net-snmp/library/int64.h
+./snmpksm.lo: ../include/net-snmp/library/mt_support.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpksm.lo: ../include/net-snmp/library/data_list.h
+./snmpksm.lo: ../include/net-snmp/library/check_varbind.h
+./snmpksm.lo: ../include/net-snmp/library/container.h
+./snmpksm.lo: ../include/net-snmp/library/factory.h
+./snmpksm.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpksm.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpksm.lo: ../include/net-snmp/library/container_iterator.h
+./snmpksm.lo: ../include/net-snmp/library/container.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpksm.lo: ../include/net-snmp/version.h
+./snmpksm.lo: ../include/net-snmp/library/keytools.h
+./snmpksm.lo: ../include/net-snmp/library/snmpv3.h
+./snmpksm.lo: ../include/net-snmp/library/lcd_time.h
+./snmpksm.lo: ../include/net-snmp/library/scapi.h
+./snmpksm.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpksm.lo: ../include/net-snmp/library/snmpksm.h
+./snmp_logging.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_logging.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_logging.lo: ../include/net-snmp/types.h
+./snmp_logging.lo: ../include/net-snmp/library/oid.h
+./snmp_logging.lo: ../include/net-snmp/library/types.h
+./snmp_logging.lo: ../include/net-snmp/definitions.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_logging.lo: ../include/net-snmp/varbind_api.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_logging.lo: ../include/net-snmp/pdu_api.h
+./snmp_logging.lo: ../include/net-snmp/library/asn1.h
+./snmp_logging.lo: ../include/net-snmp/output_api.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_logging.lo: ../include/net-snmp/session_api.h
+./snmp_logging.lo: ../include/net-snmp/library/callback.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_logging.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_logging.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_logging.lo: ../include/net-snmp/library/mib.h
+./snmp_logging.lo: ../include/net-snmp/mib_api.h
+./snmp_logging.lo: ../include/net-snmp/library/parse.h
+./snmp_logging.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_logging.lo: ../include/net-snmp/config_api.h
+./snmp_logging.lo: ../include/net-snmp/library/read_config.h
+./snmp_logging.lo: ../include/net-snmp/library/default_store.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_logging.lo: ../include/net-snmp/library/vacm.h
+./snmp_logging.lo: ../include/net-snmp/utilities.h
+./snmp_logging.lo: ../include/net-snmp/library/system.h
+./snmp_logging.lo: ../include/net-snmp/library/tools.h
+./snmp_logging.lo: ../include/net-snmp/library/int64.h
+./snmp_logging.lo: ../include/net-snmp/library/mt_support.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_logging.lo: ../include/net-snmp/library/data_list.h
+./snmp_logging.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_logging.lo: ../include/net-snmp/library/container.h
+./snmp_logging.lo: ../include/net-snmp/library/factory.h
+./snmp_logging.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_logging.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_logging.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_logging.lo: ../include/net-snmp/library/container.h
+./snmp_logging.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_logging.lo: ../include/net-snmp/version.h
+./snmp_openssl.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_openssl.lo: ../include/net-snmp/net-snmp-includes.h
+./snmp_openssl.lo: ../include/net-snmp/definitions.h
+./snmp_openssl.lo: ../include/net-snmp/types.h
+./snmp_openssl.lo: ../include/net-snmp/library/oid.h
+./snmp_openssl.lo: ../include/net-snmp/library/types.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_openssl.lo: ../include/net-snmp/varbind_api.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_openssl.lo: ../include/net-snmp/pdu_api.h
+./snmp_openssl.lo: ../include/net-snmp/library/asn1.h
+./snmp_openssl.lo: ../include/net-snmp/output_api.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_openssl.lo: ../include/net-snmp/session_api.h
+./snmp_openssl.lo: ../include/net-snmp/library/callback.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_openssl.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_openssl.lo: ../include/net-snmp/library/mib.h
+./snmp_openssl.lo: ../include/net-snmp/mib_api.h
+./snmp_openssl.lo: ../include/net-snmp/library/parse.h
+./snmp_openssl.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_openssl.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_openssl.lo: ../include/net-snmp/library/getopt.h
+./snmp_openssl.lo: ../include/net-snmp/utilities.h
+./snmp_openssl.lo: ../include/net-snmp/library/system.h
+./snmp_openssl.lo: ../include/net-snmp/library/tools.h
+./snmp_openssl.lo: ../include/net-snmp/library/int64.h
+./snmp_openssl.lo: ../include/net-snmp/library/mt_support.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_openssl.lo: ../include/net-snmp/library/data_list.h
+./snmp_openssl.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_openssl.lo: ../include/net-snmp/library/container.h
+./snmp_openssl.lo: ../include/net-snmp/library/factory.h
+./snmp_openssl.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_openssl.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_openssl.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_openssl.lo: ../include/net-snmp/library/container.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_openssl.lo: ../include/net-snmp/version.h
+./snmp_openssl.lo: ../include/net-snmp/config_api.h
+./snmp_openssl.lo: ../include/net-snmp/library/read_config.h
+./snmp_openssl.lo: ../include/net-snmp/library/default_store.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_openssl.lo: ../include/net-snmp/library/vacm.h
+./snmp_openssl.lo: ../include/net-snmp/snmpv3_api.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpv3.h
+./snmp_openssl.lo: ../include/net-snmp/library/transform_oids.h
+./snmp_openssl.lo: ../include/net-snmp/library/keytools.h
+./snmp_openssl.lo: ../include/net-snmp/library/scapi.h
+./snmp_openssl.lo: ../include/net-snmp/library/lcd_time.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmptsm.h
+./snmp_openssl.lo: ../include/net-snmp/library/snmpusm.h
+./snmp_parse_args.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_parse_args.lo: ../include/net-snmp/net-snmp-includes.h
+./snmp_parse_args.lo: ../include/net-snmp/definitions.h
+./snmp_parse_args.lo: ../include/net-snmp/types.h
+./snmp_parse_args.lo: ../include/net-snmp/library/oid.h
+./snmp_parse_args.lo: ../include/net-snmp/library/types.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_parse_args.lo: ../include/net-snmp/varbind_api.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_parse_args.lo: ../include/net-snmp/pdu_api.h
+./snmp_parse_args.lo: ../include/net-snmp/library/asn1.h
+./snmp_parse_args.lo: ../include/net-snmp/output_api.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_parse_args.lo: ../include/net-snmp/session_api.h
+./snmp_parse_args.lo: ../include/net-snmp/library/callback.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_parse_args.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_parse_args.lo: ../include/net-snmp/library/mib.h
+./snmp_parse_args.lo: ../include/net-snmp/mib_api.h
+./snmp_parse_args.lo: ../include/net-snmp/library/parse.h
+./snmp_parse_args.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_parse_args.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_parse_args.lo: ../include/net-snmp/library/getopt.h
+./snmp_parse_args.lo: ../include/net-snmp/utilities.h
+./snmp_parse_args.lo: ../include/net-snmp/library/system.h
+./snmp_parse_args.lo: ../include/net-snmp/library/tools.h
+./snmp_parse_args.lo: ../include/net-snmp/library/int64.h
+./snmp_parse_args.lo: ../include/net-snmp/library/mt_support.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_parse_args.lo: ../include/net-snmp/library/data_list.h
+./snmp_parse_args.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_parse_args.lo: ../include/net-snmp/library/container.h
+./snmp_parse_args.lo: ../include/net-snmp/library/factory.h
+./snmp_parse_args.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_parse_args.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_parse_args.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_parse_args.lo: ../include/net-snmp/library/container.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_parse_args.lo: ../include/net-snmp/version.h
+./snmp_parse_args.lo: ../include/net-snmp/config_api.h
+./snmp_parse_args.lo: ../include/net-snmp/library/read_config.h
+./snmp_parse_args.lo: ../include/net-snmp/library/default_store.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_parse_args.lo: ../include/net-snmp/library/vacm.h
+./snmp_parse_args.lo: ../include/net-snmp/snmpv3_api.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpv3.h
+./snmp_parse_args.lo: ../include/net-snmp/library/transform_oids.h
+./snmp_parse_args.lo: ../include/net-snmp/library/keytools.h
+./snmp_parse_args.lo: ../include/net-snmp/library/scapi.h
+./snmp_parse_args.lo: ../include/net-snmp/library/lcd_time.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmptsm.h
+./snmp_parse_args.lo: ../include/net-snmp/library/snmpusm.h
+./snmp_secmod.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_secmod.lo: ../include/net-snmp/types.h
+./snmp_secmod.lo: ../include/net-snmp/library/oid.h
+./snmp_secmod.lo: ../include/net-snmp/library/types.h
+./snmp_secmod.lo: ../include/net-snmp/definitions.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_secmod.lo: ../include/net-snmp/varbind_api.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_secmod.lo: ../include/net-snmp/pdu_api.h
+./snmp_secmod.lo: ../include/net-snmp/library/asn1.h
+./snmp_secmod.lo: ../include/net-snmp/output_api.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_secmod.lo: ../include/net-snmp/session_api.h
+./snmp_secmod.lo: ../include/net-snmp/library/callback.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_secmod.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_secmod.lo: ../include/net-snmp/library/mib.h
+./snmp_secmod.lo: ../include/net-snmp/mib_api.h
+./snmp_secmod.lo: ../include/net-snmp/library/parse.h
+./snmp_secmod.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_secmod.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_secmod.lo: ../include/net-snmp/config_api.h
+./snmp_secmod.lo: ../include/net-snmp/library/read_config.h
+./snmp_secmod.lo: ../include/net-snmp/library/default_store.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_secmod.lo: ../include/net-snmp/library/vacm.h
+./snmp_secmod.lo: ../include/net-snmp/utilities.h
+./snmp_secmod.lo: ../include/net-snmp/library/system.h
+./snmp_secmod.lo: ../include/net-snmp/library/tools.h
+./snmp_secmod.lo: ../include/net-snmp/library/int64.h
+./snmp_secmod.lo: ../include/net-snmp/library/mt_support.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_secmod.lo: ../include/net-snmp/library/data_list.h
+./snmp_secmod.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_secmod.lo: ../include/net-snmp/library/container.h
+./snmp_secmod.lo: ../include/net-snmp/library/factory.h
+./snmp_secmod.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_secmod.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_secmod.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_secmod.lo: ../include/net-snmp/library/container.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_secmod.lo: ../include/net-snmp/version.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmptsm.h
+./snmp_secmod.lo: ../include/net-snmp/library/snmpusm.h snmpsm_init.h
+./snmp_secmod.lo: snmpsm_shutdown.h
+./snmp_service.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_service.lo: ../include/net-snmp/net-snmp-includes.h
+./snmp_service.lo: ../include/net-snmp/definitions.h
+./snmp_service.lo: ../include/net-snmp/types.h
+./snmp_service.lo: ../include/net-snmp/library/oid.h
+./snmp_service.lo: ../include/net-snmp/library/types.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_service.lo: ../include/net-snmp/varbind_api.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_service.lo: ../include/net-snmp/pdu_api.h
+./snmp_service.lo: ../include/net-snmp/library/asn1.h
+./snmp_service.lo: ../include/net-snmp/output_api.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_service.lo: ../include/net-snmp/session_api.h
+./snmp_service.lo: ../include/net-snmp/library/callback.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_service.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_service.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_service.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_service.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_service.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_service.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_service.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_service.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_service.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_service.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_service.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_service.lo: ../include/net-snmp/library/mib.h
+./snmp_service.lo: ../include/net-snmp/mib_api.h
+./snmp_service.lo: ../include/net-snmp/library/parse.h
+./snmp_service.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_service.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_service.lo: ../include/net-snmp/library/snmp.h
+./snmp_service.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_service.lo: ../include/net-snmp/library/getopt.h
+./snmp_service.lo: ../include/net-snmp/utilities.h
+./snmp_service.lo: ../include/net-snmp/library/system.h
+./snmp_service.lo: ../include/net-snmp/library/tools.h
+./snmp_service.lo: ../include/net-snmp/library/int64.h
+./snmp_service.lo: ../include/net-snmp/library/mt_support.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_service.lo: ../include/net-snmp/library/data_list.h
+./snmp_service.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_service.lo: ../include/net-snmp/library/container.h
+./snmp_service.lo: ../include/net-snmp/library/factory.h
+./snmp_service.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_service.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_service.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_service.lo: ../include/net-snmp/library/container.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_service.lo: ../include/net-snmp/version.h
+./snmp_service.lo: ../include/net-snmp/config_api.h
+./snmp_service.lo: ../include/net-snmp/library/read_config.h
+./snmp_service.lo: ../include/net-snmp/library/default_store.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_service.lo: ../include/net-snmp/library/vacm.h
+./snmp_service.lo: ../include/net-snmp/snmpv3_api.h
+./snmp_service.lo: ../include/net-snmp/library/snmpv3.h
+./snmp_service.lo: ../include/net-snmp/library/transform_oids.h
+./snmp_service.lo: ../include/net-snmp/library/keytools.h
+./snmp_service.lo: ../include/net-snmp/library/scapi.h
+./snmp_service.lo: ../include/net-snmp/library/lcd_time.h
+./snmp_service.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmp_service.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmp_service.lo: ../include/net-snmp/library/snmptsm.h
+./snmp_service.lo: ../include/net-snmp/library/snmpusm.h
+./snmp-tc.lo: ../include/net-snmp/net-snmp-config.h
+./snmp-tc.lo: ../include/net-snmp/net-snmp-features.h
+./snmp-tc.lo: ../include/net-snmp/types.h
+./snmp-tc.lo: ../include/net-snmp/library/oid.h
+./snmp-tc.lo: ../include/net-snmp/library/types.h
+./snmp-tc.lo: ../include/net-snmp/definitions.h
+./snmp-tc.lo: ../include/net-snmp/library/snmp_api.h
+./snmp-tc.lo: ../include/net-snmp/varbind_api.h
+./snmp-tc.lo: ../include/net-snmp/library/snmp_client.h
+./snmp-tc.lo: ../include/net-snmp/pdu_api.h
+./snmp-tc.lo: ../include/net-snmp/library/asn1.h
+./snmp-tc.lo: ../include/net-snmp/output_api.h
+./snmp-tc.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp-tc.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp-tc.lo: ../include/net-snmp/session_api.h
+./snmp-tc.lo: ../include/net-snmp/library/callback.h
+./snmp-tc.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp-tc.lo: ../include/net-snmp/library/snmp_service.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp-tc.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp-tc.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp-tc.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmp-tc.lo: ../include/net-snmp/library/parse.h
+./snmp-tc.lo: ../include/net-snmp/library/oid_stash.h
+./snmp-tc.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp-tc.lo: ../include/net-snmp/library/snmp.h
+./snmp-tc.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_transport.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_transport.lo: ../include/net-snmp/net-snmp-features.h
+./snmp_transport.lo: ../include/net-snmp/types.h
+./snmp_transport.lo: ../include/net-snmp/library/oid.h
+./snmp_transport.lo: ../include/net-snmp/library/types.h
+./snmp_transport.lo: ../include/net-snmp/definitions.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_transport.lo: ../include/net-snmp/varbind_api.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_transport.lo: ../include/net-snmp/pdu_api.h
+./snmp_transport.lo: ../include/net-snmp/library/asn1.h
+./snmp_transport.lo: ../include/net-snmp/output_api.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_transport.lo: ../include/net-snmp/session_api.h
+./snmp_transport.lo: ../include/net-snmp/library/callback.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmp_transport.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_transport.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_transport.lo: ../include/net-snmp/library/mib.h
+./snmp_transport.lo: ../include/net-snmp/mib_api.h
+./snmp_transport.lo: ../include/net-snmp/library/parse.h
+./snmp_transport.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_transport.lo: ../include/net-snmp/utilities.h
+./snmp_transport.lo: ../include/net-snmp/library/system.h
+./snmp_transport.lo: ../include/net-snmp/library/tools.h
+./snmp_transport.lo: ../include/net-snmp/library/int64.h
+./snmp_transport.lo: ../include/net-snmp/library/mt_support.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_transport.lo: ../include/net-snmp/library/data_list.h
+./snmp_transport.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_transport.lo: ../include/net-snmp/library/container.h
+./snmp_transport.lo: ../include/net-snmp/library/factory.h
+./snmp_transport.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_transport.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_transport.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_transport.lo: ../include/net-snmp/library/container.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_transport.lo: ../include/net-snmp/version.h
+./snmp_transport.lo: ../include/net-snmp/library/default_store.h
+./snmp_transport.lo: ../include/net-snmp/library/read_config.h
+./snmp_transport.lo: ../include/net-snmp/config_api.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_transport.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_transport.lo: ../include/net-snmp/library/vacm.h
+./snmp_transport.lo: transports/snmp_transport_inits.h
+./snmptsm.lo: ../include/net-snmp/net-snmp-config.h
+./snmptsm.lo: ../include/net-snmp/net-snmp-features.h
+./snmptsm.lo: ../include/net-snmp/net-snmp-includes.h
+./snmptsm.lo: ../include/net-snmp/definitions.h ../include/net-snmp/types.h
+./snmptsm.lo: ../include/net-snmp/library/oid.h
+./snmptsm.lo: ../include/net-snmp/library/types.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_api.h
+./snmptsm.lo: ../include/net-snmp/varbind_api.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_client.h
+./snmptsm.lo: ../include/net-snmp/pdu_api.h
+./snmptsm.lo: ../include/net-snmp/library/asn1.h
+./snmptsm.lo: ../include/net-snmp/output_api.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_debug.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_logging.h
+./snmptsm.lo: ../include/net-snmp/session_api.h
+./snmptsm.lo: ../include/net-snmp/library/callback.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_transport.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_service.h
+./snmptsm.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmptsm.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmptsm.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmptsm.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmptsm.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmptsm.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmptsm.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmptsm.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmptsm.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmptsm.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmptsm.lo: ../include/net-snmp/library/ucd_compat.h
+./snmptsm.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmptsm.lo: ../include/net-snmp/library/parse.h
+./snmptsm.lo: ../include/net-snmp/library/oid_stash.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_impl.h
+./snmptsm.lo: ../include/net-snmp/library/snmp.h
+./snmptsm.lo: ../include/net-snmp/library/snmp-tc.h
+./snmptsm.lo: ../include/net-snmp/library/getopt.h
+./snmptsm.lo: ../include/net-snmp/utilities.h
+./snmptsm.lo: ../include/net-snmp/library/system.h
+./snmptsm.lo: ../include/net-snmp/library/tools.h
+./snmptsm.lo: ../include/net-snmp/library/int64.h
+./snmptsm.lo: ../include/net-snmp/library/mt_support.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmptsm.lo: ../include/net-snmp/library/data_list.h
+./snmptsm.lo: ../include/net-snmp/library/check_varbind.h
+./snmptsm.lo: ../include/net-snmp/library/container.h
+./snmptsm.lo: ../include/net-snmp/library/factory.h
+./snmptsm.lo: ../include/net-snmp/library/container_binary_array.h
+./snmptsm.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmptsm.lo: ../include/net-snmp/library/container_iterator.h
+./snmptsm.lo: ../include/net-snmp/library/container.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_assert.h
+./snmptsm.lo: ../include/net-snmp/version.h ../include/net-snmp/config_api.h
+./snmptsm.lo: ../include/net-snmp/library/read_config.h
+./snmptsm.lo: ../include/net-snmp/library/default_store.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_enum.h
+./snmptsm.lo: ../include/net-snmp/library/vacm.h
+./snmptsm.lo: ../include/net-snmp/snmpv3_api.h
+./snmptsm.lo: ../include/net-snmp/library/snmpv3.h
+./snmptsm.lo: ../include/net-snmp/library/transform_oids.h
+./snmptsm.lo: ../include/net-snmp/library/keytools.h
+./snmptsm.lo: ../include/net-snmp/library/scapi.h
+./snmptsm.lo: ../include/net-snmp/library/lcd_time.h
+./snmptsm.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmptsm.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmptsm.lo: ../include/net-snmp/library/snmptsm.h
+./snmptsm.lo: ../include/net-snmp/library/snmpusm.h
+./snmpusm.lo: ../include/net-snmp/net-snmp-config.h
+./snmpusm.lo: ../include/net-snmp/net-snmp-features.h
+./snmpusm.lo: ../include/net-snmp/types.h
+./snmpusm.lo: ../include/net-snmp/library/oid.h
+./snmpusm.lo: ../include/net-snmp/library/types.h
+./snmpusm.lo: ../include/net-snmp/definitions.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_api.h
+./snmpusm.lo: ../include/net-snmp/varbind_api.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_client.h
+./snmpusm.lo: ../include/net-snmp/pdu_api.h
+./snmpusm.lo: ../include/net-snmp/library/asn1.h
+./snmpusm.lo: ../include/net-snmp/output_api.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpusm.lo: ../include/net-snmp/session_api.h
+./snmpusm.lo: ../include/net-snmp/library/callback.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_service.h
+./snmpusm.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpusm.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpusm.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpusm.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmpusm.lo: ../include/net-snmp/library/parse.h
+./snmpusm.lo: ../include/net-snmp/library/oid_stash.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpusm.lo: ../include/net-snmp/library/snmp.h
+./snmpusm.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpusm.lo: ../include/net-snmp/config_api.h
+./snmpusm.lo: ../include/net-snmp/library/read_config.h
+./snmpusm.lo: ../include/net-snmp/library/default_store.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpusm.lo: ../include/net-snmp/library/vacm.h
+./snmpusm.lo: ../include/net-snmp/utilities.h
+./snmpusm.lo: ../include/net-snmp/library/system.h
+./snmpusm.lo: ../include/net-snmp/library/tools.h
+./snmpusm.lo: ../include/net-snmp/library/int64.h
+./snmpusm.lo: ../include/net-snmp/library/mt_support.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpusm.lo: ../include/net-snmp/library/data_list.h
+./snmpusm.lo: ../include/net-snmp/library/check_varbind.h
+./snmpusm.lo: ../include/net-snmp/library/container.h
+./snmpusm.lo: ../include/net-snmp/library/factory.h
+./snmpusm.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpusm.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpusm.lo: ../include/net-snmp/library/container_iterator.h
+./snmpusm.lo: ../include/net-snmp/library/container.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpusm.lo: ../include/net-snmp/version.h
+./snmpusm.lo: ../include/net-snmp/library/keytools.h
+./snmpusm.lo: ../include/net-snmp/library/snmpv3.h
+./snmpusm.lo: ../include/net-snmp/library/lcd_time.h
+./snmpusm.lo: ../include/net-snmp/library/scapi.h
+./snmpusm.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpusm.lo: ../include/net-snmp/library/snmpusm.h
+./snmpv3.lo: ../include/net-snmp/net-snmp-config.h
+./snmpv3.lo: ../include/net-snmp/types.h
+./snmpv3.lo: ../include/net-snmp/library/oid.h
+./snmpv3.lo: ../include/net-snmp/library/types.h
+./snmpv3.lo: ../include/net-snmp/definitions.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_api.h
+./snmpv3.lo: ../include/net-snmp/varbind_api.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_client.h
+./snmpv3.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./snmpv3.lo: ../include/net-snmp/output_api.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpv3.lo: ../include/net-snmp/session_api.h
+./snmpv3.lo: ../include/net-snmp/library/callback.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_service.h
+./snmpv3.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpv3.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpv3.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpv3.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./snmpv3.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./snmpv3.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./snmpv3.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpv3.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpv3.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./snmpv3.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpv3.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpv3.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./snmpv3.lo: ../include/net-snmp/library/parse.h
+./snmpv3.lo: ../include/net-snmp/library/oid_stash.h
+./snmpv3.lo: ../include/net-snmp/net-snmp-features.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpv3.lo: ../include/net-snmp/library/snmp.h
+./snmpv3.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpv3.lo: ../include/net-snmp/config_api.h
+./snmpv3.lo: ../include/net-snmp/library/read_config.h
+./snmpv3.lo: ../include/net-snmp/library/default_store.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpv3.lo: ../include/net-snmp/library/vacm.h
+./snmpv3.lo: ../include/net-snmp/utilities.h
+./snmpv3.lo: ../include/net-snmp/library/system.h
+./snmpv3.lo: ../include/net-snmp/library/tools.h
+./snmpv3.lo: ../include/net-snmp/library/int64.h
+./snmpv3.lo: ../include/net-snmp/library/mt_support.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpv3.lo: ../include/net-snmp/library/data_list.h
+./snmpv3.lo: ../include/net-snmp/library/check_varbind.h
+./snmpv3.lo: ../include/net-snmp/library/container.h
+./snmpv3.lo: ../include/net-snmp/library/factory.h
+./snmpv3.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpv3.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpv3.lo: ../include/net-snmp/library/container_iterator.h
+./snmpv3.lo: ../include/net-snmp/library/container.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpv3.lo: ../include/net-snmp/version.h
+./snmpv3.lo: ../include/net-snmp/library/snmpv3.h
+./snmpv3.lo: ../include/net-snmp/library/lcd_time.h
+./snmpv3.lo: ../include/net-snmp/library/scapi.h
+./snmpv3.lo: ../include/net-snmp/library/keytools.h
+./snmpv3.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpv3.lo: ../include/net-snmp/library/snmpusm.h
+./snmpv3.lo: ../include/net-snmp/library/transform_oids.h
+./snmp_version.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_version.lo: ../include/net-snmp/version.h
+./snprintf.lo: ../include/net-snmp/net-snmp-config.h
+./strlcat.lo: ../include/net-snmp/net-snmp-config.h
+./strlcat.lo: ../include/net-snmp/library/system.h
+./strlcat.lo: ../include/net-snmp/types.h
+./strlcat.lo: ../include/net-snmp/library/oid.h
+./strlcat.lo: ../include/net-snmp/library/types.h
+./strlcat.lo: ../include/net-snmp/definitions.h
+./strlcat.lo: ../include/net-snmp/library/snmp_api.h
+./strlcat.lo: ../include/net-snmp/varbind_api.h
+./strlcat.lo: ../include/net-snmp/library/snmp_client.h
+./strlcat.lo: ../include/net-snmp/pdu_api.h
+./strlcat.lo: ../include/net-snmp/library/asn1.h
+./strlcat.lo: ../include/net-snmp/output_api.h
+./strlcat.lo: ../include/net-snmp/library/snmp_debug.h
+./strlcat.lo: ../include/net-snmp/library/snmp_logging.h
+./strlcat.lo: ../include/net-snmp/session_api.h
+./strlcat.lo: ../include/net-snmp/library/callback.h
+./strlcat.lo: ../include/net-snmp/library/snmp_transport.h
+./strlcat.lo: ../include/net-snmp/library/snmp_service.h
+./strlcat.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./strlcat.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./strlcat.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./strlcat.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./strlcat.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./strlcat.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./strlcat.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./strlcat.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./strlcat.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./strlcat.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./strlcat.lo: ../include/net-snmp/library/ucd_compat.h
+./strlcat.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./strlcat.lo: ../include/net-snmp/library/parse.h
+./strlcat.lo: ../include/net-snmp/library/oid_stash.h
+./strlcat.lo: ../include/net-snmp/net-snmp-features.h
+./strlcat.lo: ../include/net-snmp/library/snmp_impl.h
+./strlcat.lo: ../include/net-snmp/library/snmp.h
+./strlcat.lo: ../include/net-snmp/library/snmp-tc.h
+./strlcpy.lo: ../include/net-snmp/net-snmp-config.h
+./strlcpy.lo: ../include/net-snmp/library/system.h
+./strlcpy.lo: ../include/net-snmp/types.h
+./strlcpy.lo: ../include/net-snmp/library/oid.h
+./strlcpy.lo: ../include/net-snmp/library/types.h
+./strlcpy.lo: ../include/net-snmp/definitions.h
+./strlcpy.lo: ../include/net-snmp/library/snmp_api.h
+./strlcpy.lo: ../include/net-snmp/varbind_api.h
+./strlcpy.lo: ../include/net-snmp/library/snmp_client.h
+./strlcpy.lo: ../include/net-snmp/pdu_api.h
+./strlcpy.lo: ../include/net-snmp/library/asn1.h
+./strlcpy.lo: ../include/net-snmp/output_api.h
+./strlcpy.lo: ../include/net-snmp/library/snmp_debug.h
+./strlcpy.lo: ../include/net-snmp/library/snmp_logging.h
+./strlcpy.lo: ../include/net-snmp/session_api.h
+./strlcpy.lo: ../include/net-snmp/library/callback.h
+./strlcpy.lo: ../include/net-snmp/library/snmp_transport.h
+./strlcpy.lo: ../include/net-snmp/library/snmp_service.h
+./strlcpy.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./strlcpy.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./strlcpy.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./strlcpy.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./strlcpy.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./strlcpy.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./strlcpy.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./strlcpy.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./strlcpy.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./strlcpy.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./strlcpy.lo: ../include/net-snmp/library/ucd_compat.h
+./strlcpy.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./strlcpy.lo: ../include/net-snmp/library/parse.h
+./strlcpy.lo: ../include/net-snmp/library/oid_stash.h
+./strlcpy.lo: ../include/net-snmp/net-snmp-features.h
+./strlcpy.lo: ../include/net-snmp/library/snmp_impl.h
+./strlcpy.lo: ../include/net-snmp/library/snmp.h
+./strlcpy.lo: ../include/net-snmp/library/snmp-tc.h
+./strtok_r.lo: ../include/net-snmp/net-snmp-config.h
+./strtok_r.lo: ../include/net-snmp/library/system.h
+./strtok_r.lo: ../include/net-snmp/types.h
+./strtok_r.lo: ../include/net-snmp/library/oid.h
+./strtok_r.lo: ../include/net-snmp/library/types.h
+./strtok_r.lo: ../include/net-snmp/definitions.h
+./strtok_r.lo: ../include/net-snmp/library/snmp_api.h
+./strtok_r.lo: ../include/net-snmp/varbind_api.h
+./strtok_r.lo: ../include/net-snmp/library/snmp_client.h
+./strtok_r.lo: ../include/net-snmp/pdu_api.h
+./strtok_r.lo: ../include/net-snmp/library/asn1.h
+./strtok_r.lo: ../include/net-snmp/output_api.h
+./strtok_r.lo: ../include/net-snmp/library/snmp_debug.h
+./strtok_r.lo: ../include/net-snmp/library/snmp_logging.h
+./strtok_r.lo: ../include/net-snmp/session_api.h
+./strtok_r.lo: ../include/net-snmp/library/callback.h
+./strtok_r.lo: ../include/net-snmp/library/snmp_transport.h
+./strtok_r.lo: ../include/net-snmp/library/snmp_service.h
+./strtok_r.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./strtok_r.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./strtok_r.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./strtok_r.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./strtok_r.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./strtok_r.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./strtok_r.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./strtok_r.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./strtok_r.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./strtok_r.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./strtok_r.lo: ../include/net-snmp/library/ucd_compat.h
+./strtok_r.lo: ../include/net-snmp/library/mib.h
+./strtok_r.lo: ../include/net-snmp/mib_api.h
+./strtok_r.lo: ../include/net-snmp/library/parse.h
+./strtok_r.lo: ../include/net-snmp/library/oid_stash.h
+./strtok_r.lo: ../include/net-snmp/net-snmp-features.h
+./strtok_r.lo: ../include/net-snmp/library/snmp_impl.h
+./strtok_r.lo: ../include/net-snmp/library/snmp.h
+./strtok_r.lo: ../include/net-snmp/library/snmp-tc.h
+./strtol.lo: ../include/net-snmp/net-snmp-config.h
+./strtoul.lo: ../include/net-snmp/net-snmp-config.h
+./strtoull.lo: ../include/net-snmp/net-snmp-config.h
+./strtoull.lo: ../include/net-snmp/types.h
+./strtoull.lo: ../include/net-snmp/library/oid.h
+./strtoull.lo: ../include/net-snmp/library/types.h
+./strtoull.lo: ../include/net-snmp/definitions.h
+./strtoull.lo: ../include/net-snmp/library/snmp_api.h
+./strtoull.lo: ../include/net-snmp/varbind_api.h
+./strtoull.lo: ../include/net-snmp/library/snmp_client.h
+./strtoull.lo: ../include/net-snmp/pdu_api.h
+./strtoull.lo: ../include/net-snmp/library/asn1.h
+./strtoull.lo: ../include/net-snmp/output_api.h
+./strtoull.lo: ../include/net-snmp/library/snmp_debug.h
+./strtoull.lo: ../include/net-snmp/library/snmp_logging.h
+./strtoull.lo: ../include/net-snmp/session_api.h
+./strtoull.lo: ../include/net-snmp/library/callback.h
+./strtoull.lo: ../include/net-snmp/library/snmp_transport.h
+./strtoull.lo: ../include/net-snmp/library/snmp_service.h
+./strtoull.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./strtoull.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./strtoull.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./strtoull.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./strtoull.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./strtoull.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./strtoull.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./strtoull.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./strtoull.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./strtoull.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./strtoull.lo: ../include/net-snmp/library/ucd_compat.h
+./strtoull.lo: ../include/net-snmp/library/mib.h
+./strtoull.lo: ../include/net-snmp/mib_api.h
+./strtoull.lo: ../include/net-snmp/library/parse.h
+./strtoull.lo: ../include/net-snmp/library/oid_stash.h
+./strtoull.lo: ../include/net-snmp/net-snmp-features.h
+./strtoull.lo: ../include/net-snmp/library/snmp_impl.h
+./strtoull.lo: ../include/net-snmp/library/snmp.h
+./strtoull.lo: ../include/net-snmp/library/snmp-tc.h
+./strtoull.lo: ../include/net-snmp/library/system.h
+./system.lo: ../include/net-snmp/net-snmp-config.h
+./system.lo: ../include/net-snmp/net-snmp-features.h
+./system.lo: ../include/net-snmp/types.h
+./system.lo: ../include/net-snmp/library/oid.h
+./system.lo: ../include/net-snmp/library/types.h
+./system.lo: ../include/net-snmp/definitions.h
+./system.lo: ../include/net-snmp/library/snmp_api.h
+./system.lo: ../include/net-snmp/varbind_api.h
+./system.lo: ../include/net-snmp/library/snmp_client.h
+./system.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./system.lo: ../include/net-snmp/output_api.h
+./system.lo: ../include/net-snmp/library/snmp_debug.h
+./system.lo: ../include/net-snmp/library/snmp_logging.h
+./system.lo: ../include/net-snmp/session_api.h
+./system.lo: ../include/net-snmp/library/callback.h
+./system.lo: ../include/net-snmp/library/snmp_transport.h
+./system.lo: ../include/net-snmp/library/snmp_service.h
+./system.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./system.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./system.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./system.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./system.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./system.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./system.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./system.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./system.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./system.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./system.lo: ../include/net-snmp/library/ucd_compat.h
+./system.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./system.lo: ../include/net-snmp/library/parse.h
+./system.lo: ../include/net-snmp/library/oid_stash.h
+./system.lo: ../include/net-snmp/library/snmp_impl.h
+./system.lo: ../include/net-snmp/library/snmp.h
+./system.lo: ../include/net-snmp/library/snmp-tc.h
+./system.lo: ../include/net-snmp/utilities.h
+./system.lo: ../include/net-snmp/library/system.h
+./system.lo: ../include/net-snmp/library/tools.h
+./system.lo: ../include/net-snmp/library/int64.h
+./system.lo: ../include/net-snmp/library/mt_support.h
+./system.lo: ../include/net-snmp/library/snmp_alarm.h
+./system.lo: ../include/net-snmp/library/data_list.h
+./system.lo: ../include/net-snmp/library/check_varbind.h
+./system.lo: ../include/net-snmp/library/container.h
+./system.lo: ../include/net-snmp/library/factory.h
+./system.lo: ../include/net-snmp/library/container_binary_array.h
+./system.lo: ../include/net-snmp/library/container_list_ssll.h
+./system.lo: ../include/net-snmp/library/container_iterator.h
+./system.lo: ../include/net-snmp/library/container.h
+./system.lo: ../include/net-snmp/library/snmp_assert.h
+./system.lo: ../include/net-snmp/version.h
+./system.lo: ../include/net-snmp/library/read_config.h
+./system.lo: ../include/net-snmp/config_api.h
+./system.lo: ../include/net-snmp/library/default_store.h
+./system.lo: ../include/net-snmp/library/snmp_parse_args.h
+./system.lo: ../include/net-snmp/library/snmp_enum.h
+./system.lo: ../include/net-snmp/library/vacm.h inet_ntop.h
+./text_utils.lo: ../include/net-snmp/net-snmp-config.h
+./text_utils.lo: ../include/net-snmp/net-snmp-features.h
+./text_utils.lo: ../include/net-snmp/net-snmp-includes.h
+./text_utils.lo: ../include/net-snmp/definitions.h
+./text_utils.lo: ../include/net-snmp/types.h
+./text_utils.lo: ../include/net-snmp/library/oid.h
+./text_utils.lo: ../include/net-snmp/library/types.h
+./text_utils.lo: ../include/net-snmp/library/snmp_api.h
+./text_utils.lo: ../include/net-snmp/varbind_api.h
+./text_utils.lo: ../include/net-snmp/library/snmp_client.h
+./text_utils.lo: ../include/net-snmp/pdu_api.h
+./text_utils.lo: ../include/net-snmp/library/asn1.h
+./text_utils.lo: ../include/net-snmp/output_api.h
+./text_utils.lo: ../include/net-snmp/library/snmp_debug.h
+./text_utils.lo: ../include/net-snmp/library/snmp_logging.h
+./text_utils.lo: ../include/net-snmp/session_api.h
+./text_utils.lo: ../include/net-snmp/library/callback.h
+./text_utils.lo: ../include/net-snmp/library/snmp_transport.h
+./text_utils.lo: ../include/net-snmp/library/snmp_service.h
+./text_utils.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./text_utils.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./text_utils.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./text_utils.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./text_utils.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./text_utils.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./text_utils.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./text_utils.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./text_utils.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./text_utils.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./text_utils.lo: ../include/net-snmp/library/ucd_compat.h
+./text_utils.lo: ../include/net-snmp/library/mib.h
+./text_utils.lo: ../include/net-snmp/mib_api.h
+./text_utils.lo: ../include/net-snmp/library/parse.h
+./text_utils.lo: ../include/net-snmp/library/oid_stash.h
+./text_utils.lo: ../include/net-snmp/library/snmp_impl.h
+./text_utils.lo: ../include/net-snmp/library/snmp.h
+./text_utils.lo: ../include/net-snmp/library/snmp-tc.h
+./text_utils.lo: ../include/net-snmp/library/getopt.h
+./text_utils.lo: ../include/net-snmp/utilities.h
+./text_utils.lo: ../include/net-snmp/library/system.h
+./text_utils.lo: ../include/net-snmp/library/tools.h
+./text_utils.lo: ../include/net-snmp/library/int64.h
+./text_utils.lo: ../include/net-snmp/library/mt_support.h
+./text_utils.lo: ../include/net-snmp/library/snmp_alarm.h
+./text_utils.lo: ../include/net-snmp/library/data_list.h
+./text_utils.lo: ../include/net-snmp/library/check_varbind.h
+./text_utils.lo: ../include/net-snmp/library/container.h
+./text_utils.lo: ../include/net-snmp/library/factory.h
+./text_utils.lo: ../include/net-snmp/library/container_binary_array.h
+./text_utils.lo: ../include/net-snmp/library/container_list_ssll.h
+./text_utils.lo: ../include/net-snmp/library/container_iterator.h
+./text_utils.lo: ../include/net-snmp/library/container.h
+./text_utils.lo: ../include/net-snmp/library/snmp_assert.h
+./text_utils.lo: ../include/net-snmp/version.h
+./text_utils.lo: ../include/net-snmp/config_api.h
+./text_utils.lo: ../include/net-snmp/library/read_config.h
+./text_utils.lo: ../include/net-snmp/library/default_store.h
+./text_utils.lo: ../include/net-snmp/library/snmp_parse_args.h
+./text_utils.lo: ../include/net-snmp/library/snmp_enum.h
+./text_utils.lo: ../include/net-snmp/library/vacm.h
+./text_utils.lo: ../include/net-snmp/snmpv3_api.h
+./text_utils.lo: ../include/net-snmp/library/snmpv3.h
+./text_utils.lo: ../include/net-snmp/library/transform_oids.h
+./text_utils.lo: ../include/net-snmp/library/keytools.h
+./text_utils.lo: ../include/net-snmp/library/scapi.h
+./text_utils.lo: ../include/net-snmp/library/lcd_time.h
+./text_utils.lo: ../include/net-snmp/library/snmp_secmod.h
+./text_utils.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./text_utils.lo: ../include/net-snmp/library/snmptsm.h
+./text_utils.lo: ../include/net-snmp/library/snmpusm.h
+./text_utils.lo: ../include/net-snmp/library/file_utils.h
+./text_utils.lo: ../include/net-snmp/library/text_utils.h
+./tools.lo: ../include/net-snmp/net-snmp-config.h
+./tools.lo: ../include/net-snmp/net-snmp-features.h
+./tools.lo: ../include/net-snmp/types.h
+./tools.lo: ../include/net-snmp/library/oid.h
+./tools.lo: ../include/net-snmp/library/types.h
+./tools.lo: ../include/net-snmp/definitions.h
+./tools.lo: ../include/net-snmp/library/snmp_api.h
+./tools.lo: ../include/net-snmp/varbind_api.h
+./tools.lo: ../include/net-snmp/library/snmp_client.h
+./tools.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./tools.lo: ../include/net-snmp/output_api.h
+./tools.lo: ../include/net-snmp/library/snmp_debug.h
+./tools.lo: ../include/net-snmp/library/snmp_logging.h
+./tools.lo: ../include/net-snmp/session_api.h
+./tools.lo: ../include/net-snmp/library/callback.h
+./tools.lo: ../include/net-snmp/library/snmp_transport.h
+./tools.lo: ../include/net-snmp/library/snmp_service.h
+./tools.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./tools.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./tools.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./tools.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./tools.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./tools.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./tools.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./tools.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./tools.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./tools.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./tools.lo: ../include/net-snmp/library/ucd_compat.h
+./tools.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./tools.lo: ../include/net-snmp/library/parse.h
+./tools.lo: ../include/net-snmp/library/oid_stash.h
+./tools.lo: ../include/net-snmp/library/snmp_impl.h
+./tools.lo: ../include/net-snmp/library/snmp.h
+./tools.lo: ../include/net-snmp/library/snmp-tc.h
+./tools.lo: ../include/net-snmp/utilities.h
+./tools.lo: ../include/net-snmp/library/system.h
+./tools.lo: ../include/net-snmp/library/tools.h
+./tools.lo: ../include/net-snmp/library/int64.h
+./tools.lo: ../include/net-snmp/library/mt_support.h
+./tools.lo: ../include/net-snmp/library/snmp_alarm.h
+./tools.lo: ../include/net-snmp/library/data_list.h
+./tools.lo: ../include/net-snmp/library/check_varbind.h
+./tools.lo: ../include/net-snmp/library/container.h
+./tools.lo: ../include/net-snmp/library/factory.h
+./tools.lo: ../include/net-snmp/library/container_binary_array.h
+./tools.lo: ../include/net-snmp/library/container_list_ssll.h
+./tools.lo: ../include/net-snmp/library/container_iterator.h
+./tools.lo: ../include/net-snmp/library/container.h
+./tools.lo: ../include/net-snmp/library/snmp_assert.h
+./tools.lo: ../include/net-snmp/version.h ../include/net-snmp/library/scapi.h
+./ucd_compat.lo: ../include/net-snmp/net-snmp-config.h
+./ucd_compat.lo: ../include/net-snmp/net-snmp-features.h
+./ucd_compat.lo: ../include/net-snmp/types.h
+./ucd_compat.lo: ../include/net-snmp/library/oid.h
+./ucd_compat.lo: ../include/net-snmp/library/types.h
+./ucd_compat.lo: ../include/net-snmp/definitions.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp_api.h
+./ucd_compat.lo: ../include/net-snmp/varbind_api.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp_client.h
+./ucd_compat.lo: ../include/net-snmp/pdu_api.h
+./ucd_compat.lo: ../include/net-snmp/library/asn1.h
+./ucd_compat.lo: ../include/net-snmp/output_api.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp_debug.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp_logging.h
+./ucd_compat.lo: ../include/net-snmp/session_api.h
+./ucd_compat.lo: ../include/net-snmp/library/callback.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp_transport.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp_service.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./ucd_compat.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./ucd_compat.lo: ../include/net-snmp/library/ucd_compat.h
+./ucd_compat.lo: ../include/net-snmp/library/mib.h
+./ucd_compat.lo: ../include/net-snmp/mib_api.h
+./ucd_compat.lo: ../include/net-snmp/library/parse.h
+./ucd_compat.lo: ../include/net-snmp/library/oid_stash.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp_impl.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp-tc.h
+./ucd_compat.lo: ../include/net-snmp/config_api.h
+./ucd_compat.lo: ../include/net-snmp/library/read_config.h
+./ucd_compat.lo: ../include/net-snmp/library/default_store.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp_parse_args.h
+./ucd_compat.lo: ../include/net-snmp/library/snmp_enum.h
+./ucd_compat.lo: ../include/net-snmp/library/vacm.h
+./vacm.lo: ../include/net-snmp/net-snmp-config.h
+./vacm.lo: ../include/net-snmp/types.h
+./vacm.lo: ../include/net-snmp/library/oid.h
+./vacm.lo: ../include/net-snmp/library/types.h
+./vacm.lo: ../include/net-snmp/definitions.h
+./vacm.lo: ../include/net-snmp/library/snmp_api.h
+./vacm.lo: ../include/net-snmp/varbind_api.h
+./vacm.lo: ../include/net-snmp/library/snmp_client.h
+./vacm.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/library/asn1.h
+./vacm.lo: ../include/net-snmp/output_api.h
+./vacm.lo: ../include/net-snmp/library/snmp_debug.h
+./vacm.lo: ../include/net-snmp/library/snmp_logging.h
+./vacm.lo: ../include/net-snmp/session_api.h
+./vacm.lo: ../include/net-snmp/library/callback.h
+./vacm.lo: ../include/net-snmp/library/snmp_transport.h
+./vacm.lo: ../include/net-snmp/library/snmp_service.h
+./vacm.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./vacm.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./vacm.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./vacm.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./vacm.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./vacm.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./vacm.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./vacm.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./vacm.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./vacm.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./vacm.lo: ../include/net-snmp/library/ucd_compat.h
+./vacm.lo: ../include/net-snmp/library/mib.h ../include/net-snmp/mib_api.h
+./vacm.lo: ../include/net-snmp/library/parse.h
+./vacm.lo: ../include/net-snmp/library/oid_stash.h
+./vacm.lo: ../include/net-snmp/net-snmp-features.h
+./vacm.lo: ../include/net-snmp/library/snmp_impl.h
+./vacm.lo: ../include/net-snmp/library/snmp.h
+./vacm.lo: ../include/net-snmp/library/snmp-tc.h
+./vacm.lo: ../include/net-snmp/config_api.h
+./vacm.lo: ../include/net-snmp/library/read_config.h
+./vacm.lo: ../include/net-snmp/library/default_store.h
+./vacm.lo: ../include/net-snmp/library/snmp_parse_args.h
+./vacm.lo: ../include/net-snmp/library/snmp_enum.h
+./vacm.lo: ../include/net-snmp/library/vacm.h
+./vacm.lo: ../include/net-snmp/library/tools.h
+./openssl/openssl_aes_cfb.lo: ../include/net-snmp/library/openssl_aes.h
+./openssl/openssl_aes_cfb.lo: openssl/openssl_modes.h
+./openssl/openssl_aes_core.lo: ../include/net-snmp/library/openssl_aes.h
+./openssl/openssl_aes_core.lo: ./openssl/openssl_aes_local.h
+./openssl/openssl_cbc_enc.lo: ./openssl/openssl_ncbc_enc.c
+./openssl/openssl_cbc_enc.lo: ./openssl/openssl_des_local.h
+./openssl/openssl_cbc_enc.lo: ../include/net-snmp/library/openssl_des.h
+./openssl/openssl_cfb128.lo: ./openssl/openssl_modes.h
+./openssl/openssl_des_enc.lo: ./openssl/openssl_des_local.h
+./openssl/openssl_des_enc.lo: ../include/net-snmp/library/openssl_des.h
+./openssl/openssl_des_enc.lo: ./openssl/openssl_spr.h
+./openssl/openssl_des_enc.lo: ./openssl/openssl_ncbc_enc.c
+./openssl/openssl_md5.lo: ./openssl/openssl_md5_local.h
+./openssl/openssl_md5.lo: ../include/net-snmp/openssl_md5.h
+./openssl/openssl_md5.lo: ./openssl/openssl_md32_common.h
+./openssl/openssl_ncbc_enc.lo: ./openssl/openssl_des_local.h
+./openssl/openssl_ncbc_enc.lo: ../include/net-snmp/library/openssl_des.h
+./openssl/openssl_set_key.lo: ./openssl/openssl_des_local.h
+./openssl/openssl_set_key.lo: ../include/net-snmp/library/openssl_des.h
+./openssl/openssl_sha1.lo: openssl/openssl_sha_local.h
+./openssl/openssl_sha1.lo: openssl/openssl_sha.h
+./openssl/openssl_sha1.lo: ./openssl/openssl_md32_common.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpAAL5PVCDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/types.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/config_api.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/read_config.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp_parse_args.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/snmp_enum.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/vacm.h
+./transports/snmpAAL5PVCDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/types.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpAliasDomain.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/net-snmp-includes.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/getopt.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/utilities.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/int64.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/mt_support.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_alarm.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/data_list.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/check_varbind.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/container.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/factory.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/container_binary_array.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/container_list_ssll.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/container_iterator.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/container.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_assert.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/version.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/config_api.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/read_config.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_parse_args.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_enum.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/vacm.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/snmpv3_api.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpv3.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/transform_oids.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/keytools.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/scapi.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/lcd_time.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmp_secmod.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmptsm.h
+./transports/snmpAliasDomain.lo: ../include/net-snmp/library/snmpusm.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/types.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/config_api.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/read_config.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_parse_args.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_enum.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/vacm.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/utilities.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/int64.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/mt_support.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_alarm.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/data_list.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/check_varbind.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/container.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/factory.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/container_binary_array.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/container_list_ssll.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/container_iterator.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/container.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/library/snmp_assert.h
+./transports/snmpCallbackDomain.lo: ../include/net-snmp/version.h
+./transports/snmpDTLSUDPDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/types.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpIPv4BaseDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpIPv6BaseDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/types.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/config_api.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/read_config.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp_parse_args.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/snmp_enum.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/vacm.h
+./transports/snmpIPXDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/types.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmpSocketBaseDomain.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpSocketBaseDomain.lo: ../include/net-snmp/library/snmp_assert.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpSSHDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/types.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmpSocketBaseDomain.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/read_config.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/config_api.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp_parse_args.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/snmp_enum.h
+./transports/snmpSSHDomain.lo: ../include/net-snmp/library/vacm.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpSTDDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/types.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpSTDDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/types.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpTCPBaseDomain.lo: ../include/net-snmp/library/snmpTCPBaseDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/types.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpSocketBaseDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/snmpTCPBaseDomain.h
+./transports/snmpTCPDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpTCPIPv6Domain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpTLSBaseDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/container.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/types.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/factory.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/config_api.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/read_config.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_parse_args.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_enum.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/vacm.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/cert_util.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_openssl.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_assert.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/snmp_secmod.h
+./transports/snmpTLSBaseDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpTLSTCPDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/types.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/config_api.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/read_config.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_parse_args.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_enum.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/vacm.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_assert.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpSocketBaseDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmpTLSBaseDomain.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/container.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/factory.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/cert_util.h
+./transports/snmpTLSTCPDomain.lo: ../include/net-snmp/library/snmp_openssl.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/types.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmpSocketBaseDomain.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpUDPBaseDomain.lo: ../include/net-snmp/library/snmp_assert.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/types.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/config_api.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/read_config.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp_parse_args.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmp_enum.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/vacm.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/snmpSocketBaseDomain.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpUDPDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpUDPDomain.lo: inet_ntop.h inet_pton.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/types.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/tools.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmp_assert.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpUDPIPv4BaseDomain.lo: ../include/net-snmp/library/snmpSocketBaseDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/types.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/types.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/definitions.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/output_api.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/session_api.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpUDPIPv6Domain.lo: ../include/net-snmp/library/system.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/net-snmp-config.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/net-snmp-features.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp_transport.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/asn1.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/oid.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/types.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/types.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/definitions.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp_api.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/varbind_api.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp_client.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/pdu_api.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/output_api.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp_debug.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp_logging.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/session_api.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/callback.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp_service.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpUDPIPv4BaseDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpIPv4BaseDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpUDPBaseDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpIPv6BaseDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/ucd_compat.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/mib.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/mib_api.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/parse.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/oid_stash.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp_impl.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp-tc.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/config_api.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/read_config.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/default_store.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp_parse_args.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmp_enum.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/vacm.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/snmpSocketBaseDomain.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/system.h
+./transports/snmpUnixDomain.lo: ../include/net-snmp/library/tools.h
diff --git a/snmplib/Makefile.in b/snmplib/Makefile.in
new file mode 100644
index 0000000..506b8d4
--- /dev/null
+++ b/snmplib/Makefile.in
@@ -0,0 +1,245 @@
+# Portions of this file are subject to the following copyright. 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.
+#
+
+#
+# Makefile for snmplib
+#
+
+top_builddir=..
+mysubdir=snmplib
+
+# 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)
+@GNU_vpath@ %.rc $(srcdir)
+# fallback to regular VPATH for non-gnu...
+@NON_GNU_VPATH@ $(srcdir)
+
+
+#
+# Things to install
+#
+
+# headers
+INSTALLHEADERS=\
+ net-snmp-includes.h \
+ config_api.h \
+ mib_api.h \
+ output_api.h \
+ pdu_api.h \
+ session_api.h \
+ snmpv3_api.h \
+ varbind_api.h \
+ types.h \
+ utilities.h \
+ version.h \
+ definitions.h
+
+INCLUDESUBDIR=library
+INCLUDESUBDIRHEADERS=README \
+ asn1.h \
+ callback.h \
+ cert_util.h \
+ container.h \
+ container_binary_array.h \
+ container_list_ssll.h \
+ container_iterator.h \
+ container_null.h \
+ factory.h \
+ data_list.h \
+ default_store.h \
+ dir_utils.h \
+ fd_event_manager.h \
+ file_utils.h \
+ int64.h \
+ keytools.h \
+ mib.h \
+ md5.h \
+ parse.h \
+ read_config.h \
+ scapi.h \
+ snmp.h \
+ snmp_alarm.h \
+ snmp_api.h \
+ large_fd_set.h \
+ snmp_assert.h \
+ snmp_client.h \
+ snmp_debug.h \
+ snmp_impl.h \
+ snmp_logging.h \
+ snmp_parse_args.h \
+ snmp_service.h \
+ snmp-tc.h \
+ snmpv3.h \
+ system.h \
+ text_utils.h \
+ tools.h \
+ transform_oids.h \
+ types.h \
+ getopt.h \
+ lcd_time.h \
+ mt_support.h \
+ oid.h \
+ oid_stash.h \
+ snmp_enum.h \
+ snmp_secmod.h \
+ ucd_compat.h \
+ vacm.h \
+ check_varbind.h \
+ snmp_transport.h \
+ winpipe.h \
+ winservice.h \
+ @transport_hdr_list@ \
+ @security_hdr_list@
+
+INSTALLBUILTSUBDIRHEADERS=../include/net-snmp/library/snmpv3-security-includes.h
+INSTALLBUILTSUBDIR=library
+
+
+INSTALLUCDHEADERS= asn1.h \
+ callback.h \
+ default_store.h \
+ int64.h \
+ keytools.h \
+ mib.h \
+ parse.h \
+ read_config.h \
+ scapi.h \
+ snmp_alarm.h \
+ snmp_api.h \
+ large_fd_set.h \
+ snmp_client.h \
+ snmp_debug.h \
+ snmp.h \
+ snmp_impl.h \
+ snmp_logging.h \
+ snmp_parse_args.h \
+ snmp-tc.h \
+ snmpusm.h \
+ snmpv3.h \
+ snmp_vars.h \
+ struct.h \
+ system.h \
+ tools.h \
+ transform_oids.h
+
+# libraries
+INSTALLLIBS=libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION)
+INSTALLUCDLIBS=libsnmp.$(LIB_EXTENSION)$(LIB_VERSION)
+
+#
+# Things to build
+# - for the feature checking / removal / minimialist support these
+# must be listed such that code requiring a feature must be listed
+# *before* the code implementing the feature.
+#
+CSRCS= snmp_client.c mib.c parse.c snmp_api.c snmp.c \
+ snmp_auth.c asn1.c md5.c snmp_parse_args.c \
+ system.c vacm.c int64.c read_config.c pkcs.c \
+ snmp_debug.c tools.c snmp_logging.c text_utils.c \
+ large_fd_set.c cert_util.c snmp_openssl.c \
+ snmpv3.c lcd_time.c keytools.c \
+ scapi.c callback.c default_store.c snmp_alarm.c \
+ data_list.c oid_stash.c fd_event_manager.c \
+ check_varbind.c \
+ mt_support.c snmp_enum.c snmp-tc.c snmp_service.c \
+ snprintf.c \
+ snmp_transport.c @transport_src_list@ \
+ snmp_secmod.c @security_src_list@ snmp_version.c \
+ container_null.c container_list_ssll.c container_iterator.c \
+ ucd_compat.c \
+ @other_src_list@ @crypto_files_c@ \
+ dir_utils.c file_utils.c \
+ container.c container_binary_array.c
+
+OBJS= snmp_client.o mib.o parse.o snmp_api.o snmp.o \
+ snmp_auth.o asn1.o md5.o snmp_parse_args.o \
+ system.o vacm.o int64.o read_config.o pkcs.o \
+ snmp_debug.o tools.o snmp_logging.o text_utils.o \
+ large_fd_set.o cert_util.o snmp_openssl.o \
+ snmpv3.o lcd_time.o keytools.o \
+ scapi.o callback.o default_store.o snmp_alarm.o \
+ data_list.o oid_stash.o fd_event_manager.o \
+ check_varbind.o \
+ mt_support.o snmp_enum.o snmp-tc.o snmp_service.o \
+ snprintf.o \
+ snmp_transport.o @transport_obj_list@ \
+ snmp_secmod.o @security_obj_list@ snmp_version.o \
+ container_null.o container_list_ssll.o container_iterator.o \
+ ucd_compat.o \
+ @crypto_files_o@ @other_objs_list@ @LIBOBJS@ \
+ dir_utils.o file_utils.o \
+ container.o container_binary_array.o
+
+LOBJS= snmp_client.lo mib.lo parse.lo snmp_api.lo snmp.lo \
+ snmp_auth.lo asn1.lo md5.lo snmp_parse_args.lo \
+ system.lo vacm.lo int64.lo read_config.lo pkcs.lo \
+ snmp_debug.lo tools.lo snmp_logging.lo text_utils.lo \
+ large_fd_set.lo cert_util.lo snmp_openssl.lo \
+ snmpv3.lo lcd_time.lo keytools.lo \
+ scapi.lo callback.lo default_store.lo snmp_alarm.lo \
+ data_list.lo oid_stash.lo fd_event_manager.lo \
+ check_varbind.lo \
+ mt_support.lo snmp_enum.lo snmp-tc.lo snmp_service.lo \
+ snprintf.lo \
+ snmp_transport.lo @transport_lobj_list@ \
+ snmp_secmod.lo @security_lobj_list@ snmp_version.lo \
+ container.lo container_binary_array.lo \
+ ucd_compat.lo \
+ @crypto_files_lo@ @other_lobjs_list@ @LTLIBOBJS@ \
+ dir_utils.lo file_utils.lo \
+ container_null.lo container_list_ssll.lo container_iterator.lo
+
+FTOBJS= snmp_client.ft mib.ft parse.ft snmp_api.ft snmp.ft \
+ snmp_auth.ft asn1.ft md5.ft snmp_parse_args.ft \
+ system.ft vacm.ft int64.ft read_config.ft pkcs.ft \
+ snmp_debug.ft tools.ft snmp_logging.ft text_utils.ft \
+ snmpv3.ft lcd_time.ft keytools.ft \
+ scapi.ft callback.ft default_store.ft snmp_alarm.ft \
+ data_list.ft oid_stash.ft fd_event_manager.ft \
+ check_varbind.ft \
+ mt_support.ft snmp_enum.ft snmp-tc.ft snmp_service.ft \
+ snprintf.ft \
+ snmp_transport.ft @transport_ftobj_list@ \
+ snmp_secmod.ft @security_ftobj_list@ snmp_version.ft \
+ container.ft container_binary_array.ft \
+ ucd_compat.ft \
+ @other_ftobjs_list@ \
+ large_fd_set.ft cert_util.ft snmp_openssl.ft \
+ dir_utils.ft file_utils.ft \
+ container_null.ft container_list_ssll.ft container_iterator.ft
+
+# just in case someone wants to remove libtool, change this to OBJS.
+TOBJS=$(LOBJS)
+
+FEATUREFILE = $(top_builddir)/include/net-snmp/library/features.h
+
+#
+CPPFLAGS = $(TOP_INCLUDES) -I. $(SNMPLIB_INCLUDES) @CPPFLAGS@
+
+all: standardall
+
+# how to build the libraries.
+libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION): $(TOBJS)
+ $(LIB_LD_CMD) $@ $(TOBJS) @LD_NO_UNDEFINED@ $(LDFLAGS) @LNETSNMPLIBS@
+ $(RANLIB) $@
+
+libsnmp.$(LIB_EXTENSION)$(LIB_VERSION): $(TOBJS)
+ $(LIB_LD_CMD) $@ $(TOBJS) @LD_NO_UNDEFINED@ $(LDFLAGS) @LNETSNMPLIBS@
+ $(RANLIB) $@
+
+#
+# internal test objects
+#
+parse: mib.o parse.c
+ $(CC) $(CFLAGS) -DTEST parse.c -o $@ \
+ `$(top_srcdir)/net-snmp-config --libs`
diff --git a/snmplib/asn1.c b/snmplib/asn1.c
new file mode 100644
index 0000000..e4da6be
--- /dev/null
+++ b/snmplib/asn1.c
@@ -0,0 +1,3737 @@
+/*
+ * Abstract Syntax Notation One, ASN.1
+ * As defined in ISO/IS 8824 and ISO/IS 8825
+ * This implements a subset of the above International Standards that
+ * is sufficient to implement SNMP.
+ *
+ * Encodes abstract data types into a machine independent stream of bytes.
+ *
+ */
+/**********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+/**
+ * @defgroup asn1_packet_parse asn1 parsing and datatype manipulation routines.
+ * @ingroup library
+ *
+ * @{
+ *
+ * Note on
+ *
+ * Re-allocating reverse ASN.1 encoder functions. Synopsis:
+ *
+ * \code
+ *
+ * u_char *buf = (u_char*)malloc(100);
+ * u_char type = (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER);
+ * size_t buf_len = 100, offset = 0;
+ * long data = 12345;
+ * int allow_realloc = 1;
+ *
+ * if (asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data, sizeof(long)) == 0) {
+ * error;
+ * }
+ *
+ * \endcode
+ *
+ * NOTE WELL: after calling one of these functions with allow_realloc
+ * non-zero, buf might have moved, buf_len might have grown and
+ * offset will have increased by the size of the encoded data.
+ * You should **NEVER** do something like this:
+ *
+ * \code
+ *
+ * u_char *buf = (u_char *)malloc(100), *ptr;
+ * u_char type = (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER);
+ * size_t buf_len = 100, offset = 0;
+ * long data1 = 1234, data2 = 5678;
+ * int rc = 0, allow_realloc = 1;
+ *
+ * rc = asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data1, sizeof(long));
+ * ptr = buf[buf_len - offset]; / * points at encoding of data1 * /
+ * if (rc == 0) {
+ * error;
+ * }
+ * rc = asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data2, sizeof(long));
+ * make use of ptr here;
+ *
+ * \endcode
+ *
+ * ptr is **INVALID** at this point. In general, you should store the
+ * offset value and compute pointers when you need them:
+ *
+ *
+ * \code
+ *
+ * u_char *buf = (u_char *)malloc(100), *ptr;
+ * u_char type = (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER);
+ * size_t buf_len = 100, offset = 0, ptr_offset;
+ * long data1 = 1234, data2 = 5678;
+ * int rc = 0, allow_realloc = 1;
+ *
+ * rc = asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data1, sizeof(long));
+ * ptr_offset = offset;
+ * if (rc == 0) {
+ * error;
+ * }
+ * rc = asn_realloc_rbuild_int(&buf, &buf_len, &offset, allow_realloc,
+ * type, &data2, sizeof(long));
+ * ptr = buf + buf_len - ptr_offset
+ * make use of ptr here;
+ *
+ * \endcode
+ *
+ *
+ * Here, you can see that ptr will be a valid pointer even if the block of
+ * memory has been moved, as it may well have been. Plenty of examples of
+ * usage all over asn1.c, snmp_api.c, snmpusm.c.
+ *
+ * The other thing you should **NEVER** do is to pass a pointer to a buffer
+ * on the stack as the first argument when allow_realloc is non-zero, unless
+ * you really know what you are doing and your machine/compiler allows you to
+ * free non-heap memory. There are rumours that such things exist, but many
+ * consider them no more than the wild tales of a fool.
+ *
+ * Of course, you can pass allow_realloc as zero, to indicate that you do not
+ * wish the packet buffer to be reallocated for some reason; perhaps because
+ * it is on the stack. This may be useful to emulate the functionality of
+ * the old API:
+ *
+ * \code
+ *
+ * u_char my_static_buffer[100], *cp = NULL;
+ * size_t my_static_buffer_len = 100;
+ * float my_pi = (float)22/(float)7;
+ *
+ * cp = asn_rbuild_float(my_static_buffer, &my_static_buffer_len,
+ * ASN_OPAQUE_FLOAT, &my_pi, sizeof(float));
+ * if (cp == NULL) {
+ * error;
+ * }
+ *
+ * \endcode
+ *
+ * IS EQUIVALENT TO:
+ *
+ * \code
+ *
+ * u_char my_static_buffer[100];
+ * size_t my_static_buffer_len = 100, my_offset = 0;
+ * float my_pi = (float)22/(float)7;
+ * int rc = 0;
+ *
+ * rc = asn_realloc_rbuild_float(&my_static_buffer, &my_static_buffer_len,
+ * &my_offset, 0,
+ * ASN_OPAQUE_FLOAT, &my_pi, sizeof(float));
+ * if (rc == 0) {
+ * error;
+ * }
+ * \endcode
+ *
+ */
+
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef KINETICS
+#include "gw.h"
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <sys/types.h>
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef vms
+#include <in.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/int64.h>
+#include <net-snmp/library/mib.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#include <net-snmp/library/snmp_api.h>
+
+#ifndef INT32_MAX
+# define INT32_MAX 2147483647
+#endif
+
+#ifndef INT32_MIN
+# define INT32_MIN (0 - INT32_MAX - 1)
+#endif
+
+
+#if SIZEOF_LONG == 4
+# define CHECK_OVERFLOW_S(x,y)
+# define CHECK_OVERFLOW_U(x,y)
+#else
+# define CHECK_OVERFLOW_S(x,y) do { \
+ if (x > INT32_MAX) { \
+ DEBUGMSG(("asn","truncating signed value %ld to 32 bits (%d)\n",(long)(x),y)); \
+ x &= 0xffffffff; \
+ } else if (x < INT32_MIN) { \
+ DEBUGMSG(("asn","truncating signed value %ld to 32 bits (%d)\n",(long)(x),y)); \
+ x = 0 - (x & 0xffffffff); \
+ } \
+ } while(0)
+
+# define CHECK_OVERFLOW_U(x,y) do { \
+ if (x > UINT32_MAX) { \
+ x &= 0xffffffff; \
+ DEBUGMSG(("asn","truncating unsigned value to 32 bits (%d)\n",y)); \
+ } \
+ } while(0)
+#endif
+
+/**
+ * @internal
+ * output an error for a wrong size
+ *
+ * @param str error string
+ * @param wrongsize wrong size
+ * @param rightsize expected size
+ */
+static
+ void
+_asn_size_err(const char *str, size_t wrongsize, size_t rightsize)
+{
+ char ebuf[128];
+
+ snprintf(ebuf, sizeof(ebuf),
+ "%s size %lu: s/b %lu", str,
+ (unsigned long)wrongsize, (unsigned long)rightsize);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+}
+
+/**
+ * @internal
+ * output an error for a wrong type
+ *
+ * @param str error string
+ * @param wrongtype wrong type
+ */
+static
+ void
+_asn_type_err(const char *str, int wrongtype)
+{
+ char ebuf[128];
+
+ snprintf(ebuf, sizeof(ebuf), "%s type %d", str, wrongtype);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+}
+
+/**
+ * @internal
+ * output an error for a wrong length
+ *
+ * @param str error string
+ * @param wrongsize wrong length
+ * @param rightsize expected length
+ */
+static
+ void
+_asn_length_err(const char *str, size_t wrongsize, size_t rightsize)
+{
+ char ebuf[128];
+
+ snprintf(ebuf, sizeof(ebuf),
+ "%s length %lu too large: exceeds %lu", str,
+ (unsigned long)wrongsize, (unsigned long)rightsize);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+}
+
+/**
+ * @internal
+ * call after asn_parse_length to verify result.
+ *
+ * @param str error string
+ * @param bufp start of buffer
+ * @param data start of data
+ * @param plen ?
+ * @param dlen ?
+ *
+ * @return 1 on error 0 on success
+ */
+static
+ int
+_asn_parse_length_check(const char *str,
+ const u_char * bufp, const u_char * data,
+ u_long plen, size_t dlen)
+{
+ char ebuf[128];
+ size_t header_len;
+
+ if (bufp == NULL) {
+ /*
+ * error message is set
+ */
+ return 1;
+ }
+ header_len = bufp - data;
+ if (plen > 0x7fffffff || header_len > 0x7fffffff ||
+ ((size_t) plen + header_len) > dlen) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: message overflow: %d len + %d delta > %d len",
+ str, (int) plen, (int) header_len, (int) dlen);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return 1;
+ }
+ return 0;
+}
+
+
+/**
+ * @internal
+ * call after asn_build_header to verify result.
+ *
+ * @param str error string to output
+ * @param data data pointer to verify (NULL => error )
+ * @param datalen data len to check
+ * @param typedlen type length
+ *
+ * @return 0 on success, 1 on error
+ */
+static
+ int
+_asn_build_header_check(const char *str, const u_char * data,
+ size_t datalen, size_t typedlen)
+{
+ char ebuf[128];
+
+ if (data == NULL) {
+ /*
+ * error message is set
+ */
+ return 1;
+ }
+ if (datalen < typedlen) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: bad header, length too short: %lu < %lu", str,
+ (unsigned long)datalen, (unsigned long)typedlen);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return 1;
+ }
+ return 0;
+}
+
+/**
+ * @internal
+ * call after asn_build_header to verify result.
+ *
+ * @param str error string
+ * @param pkt packet to check
+ * @param pkt_len length of the packet
+ * @param typedlen length of the type
+ *
+ * @return 0 on success 1 on error
+ */
+static
+ int
+_asn_realloc_build_header_check(const char *str,
+ u_char ** pkt,
+ const size_t * pkt_len, size_t typedlen)
+{
+ char ebuf[128];
+
+ if (pkt == NULL || *pkt == NULL) {
+ /*
+ * Error message is set.
+ */
+ return 1;
+ }
+
+ if (*pkt_len < typedlen) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: bad header, length too short: %lu < %lu", str,
+ (unsigned long)*pkt_len, (unsigned long)typedlen);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return 1;
+ }
+ return 0;
+}
+
+/**
+ * @internal
+ * checks the incoming packet for validity and returns its size or 0
+ *
+ * @param pkt The packet
+ * @param len The length to check
+ *
+ * @return The size of the packet if valid; 0 otherwise
+ */
+int
+asn_check_packet(u_char * pkt, size_t len)
+{
+ u_long asn_length;
+
+ if (len < 2)
+ return 0; /* always too short */
+
+ if (*pkt != (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR))
+ return -1; /* wrong type */
+
+ if (*(pkt + 1) & 0x80) {
+ /*
+ * long length
+ */
+ if ((int) len < (int) (*(pkt + 1) & ~0x80) + 2)
+ return 0; /* still to short, incomplete length */
+ asn_parse_length(pkt + 1, &asn_length);
+ return (asn_length + 2 + (*(pkt + 1) & ~0x80));
+ } else {
+ /*
+ * short length
+ */
+ return (*(pkt + 1) + 2);
+ }
+}
+
+static
+ int
+_asn_bitstring_check(const char *str, size_t asn_length, u_char datum)
+{
+ char ebuf[128];
+
+ if (asn_length < 1) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: length %d too small", str, (int) asn_length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return 1;
+ }
+ /*
+ * if (datum > 7){
+ * sprintf(ebuf,"%s: datum %d >7: too large", str, (int)(datum));
+ * ERROR_MSG(ebuf);
+ * return 1;
+ * }
+ */
+ return 0;
+}
+
+/**
+ * @internal
+ * asn_parse_int - pulls a long out of an int type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param intp IN/OUT - pointer to start of output buffer
+ * @param intsize IN - size of output buffer
+ *
+ * @return pointer to the first byte past the end
+ * of this object (i.e. the start of the next object) Returns NULL on any error
+ */
+u_char *
+asn_parse_int(u_char * data,
+ size_t * datalength,
+ u_char * type, long *intp, size_t intsize)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+ static const char *errpre = "parse int";
+ register u_char *bufp = data;
+ u_long asn_length;
+ register long value = 0;
+
+ if (intsize != sizeof(long)) {
+ _asn_size_err(errpre, intsize, sizeof(long));
+ return NULL;
+ }
+ *type = *bufp++;
+ if (*type != ASN_INTEGER) {
+ _asn_type_err(errpre, *type);
+ return NULL;
+ }
+
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (_asn_parse_length_check
+ (errpre, bufp, data, asn_length, *datalength))
+ return NULL;
+
+ if ((size_t) asn_length > intsize) {
+ _asn_length_err(errpre, (size_t) asn_length, intsize);
+ return NULL;
+ }
+
+ *datalength -= (int) asn_length + (bufp - data);
+ if (*bufp & 0x80)
+ value = -1; /* integer is negative */
+
+ DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
+
+ while (asn_length--)
+ value = (value << 8) | *bufp++;
+
+ CHECK_OVERFLOW_S(value,1);
+
+ DEBUGMSG(("dumpv_recv", " Integer:\t%ld (0x%.2lX)\n", value, value));
+
+ *intp = value;
+ return bufp;
+}
+
+
+/**
+ * @internal
+ * asn_parse_unsigned_int - pulls an unsigned long out of an ASN int type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param intp IN/OUT - pointer to start of output buffer
+ * @param intsize IN - size of output buffer
+ *
+ * @return pointer to the first byte past the end
+ * of this object (i.e. the start of the next object) Returns NULL on any error
+ */
+u_char *
+asn_parse_unsigned_int(u_char * data,
+ size_t * datalength,
+ u_char * type, u_long * intp, size_t intsize)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+ static const char *errpre = "parse uint";
+ register u_char *bufp = data;
+ u_long asn_length;
+ register u_long value = 0;
+
+ if (intsize != sizeof(long)) {
+ _asn_size_err(errpre, intsize, sizeof(long));
+ return NULL;
+ }
+ *type = *bufp++;
+ if (*type != ASN_COUNTER && *type != ASN_GAUGE && *type != ASN_TIMETICKS
+ && *type != ASN_UINTEGER) {
+ _asn_type_err(errpre, *type);
+ return NULL;
+ }
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (_asn_parse_length_check
+ (errpre, bufp, data, asn_length, *datalength))
+ return NULL;
+
+ if ((asn_length > (intsize + 1)) ||
+ ((asn_length == intsize + 1) && *bufp != 0x00)) {
+ _asn_length_err(errpre, (size_t) asn_length, intsize);
+ return NULL;
+ }
+ *datalength -= (int) asn_length + (bufp - data);
+ if (*bufp & 0x80)
+ value = ~value; /* integer is negative */
+
+ DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
+
+ while (asn_length--)
+ value = (value << 8) | *bufp++;
+
+ CHECK_OVERFLOW_U(value,2);
+
+ DEBUGMSG(("dumpv_recv", " UInteger:\t%ld (0x%.2lX)\n", value, value));
+
+ *intp = value;
+ return bufp;
+}
+
+
+/**
+ * @internal
+ * asn_build_int - builds an ASN object containing an integer.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ *
+ * @param data IN - pointer to start of output buffer
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of objec
+ * @param intp IN - pointer to start of long integer
+ * @param intsize IN - size of input buffer
+ *
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_int(u_char * data,
+ size_t * datalength, u_char type, const long *intp, size_t intsize)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+ static const char *errpre = "build int";
+ register long integer;
+ register u_long mask;
+#ifndef NETSNMP_NO_DEBUGGING
+ u_char *initdatap = data;
+#endif
+
+ if (intsize != sizeof(long)) {
+ _asn_size_err(errpre, intsize, sizeof(long));
+ return NULL;
+ }
+ integer = *intp;
+ CHECK_OVERFLOW_S(integer,3);
+ /*
+ * Truncate "unnecessary" bytes off of the most significant end of this
+ * 2's complement integer. There should be no sequence of 9
+ * consecutive 1's or 0's at the most significant end of the
+ * integer.
+ */
+ mask = ((u_long) 0x1FF) << ((8 * (sizeof(long) - 1)) - 1);
+ /*
+ * mask is 0xFF800000 on a big-endian machine
+ */
+ while ((((integer & mask) == 0) || ((integer & mask) == mask))
+ && intsize > 1) {
+ intsize--;
+ integer <<= 8;
+ }
+ data = asn_build_header(data, datalength, type, intsize);
+ if (_asn_build_header_check(errpre, data, *datalength, intsize))
+ return NULL;
+
+ *datalength -= intsize;
+ mask = ((u_long) 0xFF) << (8 * (sizeof(long) - 1));
+ /*
+ * mask is 0xFF000000 on a big-endian machine
+ */
+ while (intsize--) {
+ *data++ = (u_char) ((integer & mask) >> (8 * (sizeof(long) - 1)));
+ integer <<= 8;
+ }
+ DEBUGDUMPSETUP("send", initdatap, data - initdatap);
+ DEBUGMSG(("dumpv_send", " Integer:\t%ld (0x%.2lX)\n", *intp, *intp));
+ return data;
+}
+
+
+
+/**
+ * @internal
+ * asn_build_unsigned_int - builds an ASN object containing an integer.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ *
+ * @param data IN - pointer to start of output buffer
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of objec
+ * @param intp IN - pointer to start of long integer
+ * @param intsize IN - size of input buffer
+ *
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_unsigned_int(u_char * data,
+ size_t * datalength,
+ u_char type, const u_long * intp, size_t intsize)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+ static const char *errpre = "build uint";
+ register u_long integer;
+ register u_long mask;
+ int add_null_byte = 0;
+#ifndef NETSNMP_NO_DEBUGGING
+ u_char *initdatap = data;
+#endif
+
+ if (intsize != sizeof(long)) {
+ _asn_size_err(errpre, intsize, sizeof(long));
+ return NULL;
+ }
+ integer = *intp;
+ CHECK_OVERFLOW_U(integer,4);
+
+ mask = ((u_long) 0xFF) << (8 * (sizeof(long) - 1));
+ /*
+ * mask is 0xFF000000 on a big-endian machine
+ */
+ if ((u_char) ((integer & mask) >> (8 * (sizeof(long) - 1))) & 0x80) {
+ /*
+ * if MSB is set
+ */
+ add_null_byte = 1;
+ intsize++;
+ } else {
+ /*
+ * Truncate "unnecessary" bytes off of the most significant end of this 2's complement integer.
+ * There should be no sequence of 9 consecutive 1's or 0's at the most significant end of the
+ * integer.
+ */
+ mask = ((u_long) 0x1FF) << ((8 * (sizeof(long) - 1)) - 1);
+ /*
+ * mask is 0xFF800000 on a big-endian machine
+ */
+ while ((((integer & mask) == 0) || ((integer & mask) == mask))
+ && intsize > 1) {
+ intsize--;
+ integer <<= 8;
+ }
+ }
+ data = asn_build_header(data, datalength, type, intsize);
+ if (_asn_build_header_check(errpre, data, *datalength, intsize))
+ return NULL;
+
+ *datalength -= intsize;
+ if (add_null_byte == 1) {
+ *data++ = '\0';
+ intsize--;
+ }
+ mask = ((u_long) 0xFF) << (8 * (sizeof(long) - 1));
+ /*
+ * mask is 0xFF000000 on a big-endian machine
+ */
+ while (intsize--) {
+ *data++ = (u_char) ((integer & mask) >> (8 * (sizeof(long) - 1)));
+ integer <<= 8;
+ }
+ DEBUGDUMPSETUP("send", initdatap, data - initdatap);
+ DEBUGMSG(("dumpv_send", " UInteger:\t%ld (0x%.2lX)\n", *intp, *intp));
+ return data;
+}
+
+
+/**
+ * @internal
+ * asn_parse_string - pulls an octet string out of an ASN octet string type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the beginning of the next object.
+ *
+ * "string" is filled with the octet string.
+ * ASN.1 octet string ::= primstring | cmpdstring
+ * primstring ::= 0x04 asnlength byte {byte}*
+ * cmpdstring ::= 0x24 asnlength string {string}*
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param string IN/OUT - pointer to start of output buffer
+ * @param strlength IN/OUT - size of output buffer
+ *
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+
+u_char *
+asn_parse_string(u_char * data,
+ size_t * datalength,
+ u_char * type, u_char * str, size_t * strlength)
+{
+ static const char *errpre = "parse string";
+ u_char *bufp = data;
+ u_long asn_length;
+
+ *type = *bufp++;
+ if (*type != ASN_OCTET_STR && *type != ASN_IPADDRESS && *type != ASN_OPAQUE
+ && *type != ASN_NSAP) {
+ _asn_type_err(errpre, *type);
+ return NULL;
+ }
+
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (_asn_parse_length_check
+ (errpre, bufp, data, asn_length, *datalength)) {
+ return NULL;
+ }
+
+ if (asn_length > *strlength) {
+ _asn_length_err(errpre, (size_t) asn_length, *strlength);
+ return NULL;
+ }
+
+ DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
+
+ memmove(str, bufp, asn_length);
+ if (*strlength > asn_length)
+ str[asn_length] = 0;
+ *strlength = asn_length;
+ *datalength -= asn_length + (bufp - data);
+
+ DEBUGIF("dumpv_recv") {
+ u_char *buf = (u_char *) malloc(1 + asn_length);
+ size_t l = (buf != NULL) ? (1 + asn_length) : 0, ol = 0;
+
+ if (sprint_realloc_asciistring
+ (&buf, &l, &ol, 1, str, asn_length)) {
+ DEBUGMSG(("dumpv_recv", " String:\t%s\n", buf));
+ } else {
+ if (buf == NULL) {
+ DEBUGMSG(("dumpv_recv", " String:\t[TRUNCATED]\n"));
+ } else {
+ DEBUGMSG(("dumpv_recv", " String:\t%s [TRUNCATED]\n",
+ buf));
+ }
+ }
+ if (buf != NULL) {
+ free(buf);
+ }
+ }
+
+ return bufp + asn_length;
+}
+
+
+/**
+ * @internal
+ * asn_build_string - Builds an ASN octet string object containing the input string.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the beginning of the next object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @param string IN - pointer to start of input buffer
+ * @param strlength IN - size of input buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+
+u_char *
+asn_build_string(u_char * data,
+ size_t * datalength,
+ u_char type, const u_char * str, size_t strlength)
+{
+ /*
+ * ASN.1 octet string ::= primstring | cmpdstring
+ * primstring ::= 0x04 asnlength byte {byte}*
+ * cmpdstring ::= 0x24 asnlength string {string}*
+ * This code will never send a compound string.
+ */
+#ifndef NETSNMP_NO_DEBUGGING
+ u_char *initdatap = data;
+#endif
+ data = asn_build_header(data, datalength, type, strlength);
+ if (_asn_build_header_check
+ ("build string", data, *datalength, strlength))
+ return NULL;
+
+ if (strlength) {
+ if (str == NULL) {
+ memset(data, 0, strlength);
+ } else {
+ memmove(data, str, strlength);
+ }
+ }
+ *datalength -= strlength;
+ DEBUGDUMPSETUP("send", initdatap, data - initdatap + strlength);
+ DEBUGIF("dumpv_send") {
+ u_char *buf = (u_char *) malloc(1 + strlength);
+ size_t l = (buf != NULL) ? (1 + strlength) : 0, ol = 0;
+
+ if (sprint_realloc_asciistring
+ (&buf, &l, &ol, 1, str, strlength)) {
+ DEBUGMSG(("dumpv_send", " String:\t%s\n", buf));
+ } else {
+ if (buf == NULL) {
+ DEBUGMSG(("dumpv_send", " String:\t[TRUNCATED]\n"));
+ } else {
+ DEBUGMSG(("dumpv_send", " String:\t%s [TRUNCATED]\n",
+ buf));
+ }
+ }
+ if (buf != NULL) {
+ free(buf);
+ }
+ }
+ return data + strlength;
+}
+
+
+
+/**
+ * @internal
+ * asn_parse_header - interprets the ID and length of the current object.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * in this object following the id and length.
+ *
+ * Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ *
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @return Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ *
+ */
+u_char *
+asn_parse_header(u_char * data, size_t * datalength, u_char * type)
+{
+ register u_char *bufp;
+ u_long asn_length;
+
+ if (!data || !datalength || !type) {
+ ERROR_MSG("parse header: NULL pointer");
+ return NULL;
+ }
+ bufp = data;
+ /*
+ * this only works on data types < 30, i.e. no extension octets
+ */
+ if (IS_EXTENSION_ID(*bufp)) {
+ ERROR_MSG("can't process ID >= 30");
+ return NULL;
+ }
+ *type = *bufp;
+ bufp = asn_parse_length(bufp + 1, &asn_length);
+
+ if (_asn_parse_length_check
+ ("parse header", bufp, data, asn_length, *datalength))
+ return NULL;
+
+#ifdef DUMP_PRINT_HEADERS
+ DEBUGDUMPSETUP("recv", data, (bufp - data));
+ DEBUGMSG(("dumpv_recv", " Header: 0x%.2X, len = %d (0x%X)\n", *data,
+ asn_length, asn_length));
+#else
+ /*
+ * DEBUGMSGHEXTLI(("recv",data,(bufp-data)));
+ * DEBUGMSG(("dumpH_recv","\n"));
+ */
+#endif
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+
+ if ((*type == ASN_OPAQUE) && (*bufp == ASN_OPAQUE_TAG1)) {
+
+ /*
+ * check if 64-but counter
+ */
+ switch (*(bufp + 1)) {
+ case ASN_OPAQUE_COUNTER64:
+ case ASN_OPAQUE_U64:
+ case ASN_OPAQUE_FLOAT:
+ case ASN_OPAQUE_DOUBLE:
+ case ASN_OPAQUE_I64:
+ *type = *(bufp + 1);
+ break;
+
+ default:
+ /*
+ * just an Opaque
+ */
+ *datalength = (int) asn_length;
+ return bufp;
+ }
+ /*
+ * value is encoded as special format
+ */
+ bufp = asn_parse_length(bufp + 2, &asn_length);
+ if (_asn_parse_length_check("parse opaque header", bufp, data,
+ asn_length, *datalength))
+ return NULL;
+ }
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+
+ *datalength = (int) asn_length;
+
+ return bufp;
+}
+
+/**
+ * @internal
+ * same as asn_parse_header with test for expected type
+ *
+ * @see asn_parse_header
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param expected_type IN expected type
+ * @return Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ *
+ */
+u_char *
+asn_parse_sequence(u_char * data, size_t * datalength, u_char * type, u_char expected_type, /* must be this type */
+ const char *estr)
+{ /* error message prefix */
+ data = asn_parse_header(data, datalength, type);
+ if (data && (*type != expected_type)) {
+ char ebuf[128];
+ snprintf(ebuf, sizeof(ebuf),
+ "%s header type %02X: s/b %02X", estr,
+ (u_char) * type, (u_char) expected_type);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ return data;
+}
+
+
+
+/**
+ * @internal
+ * asn_build_header - builds an ASN header for an object with the ID and
+ * length specified.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * in this object following the id and length.
+ *
+ * This only works on data types < 30, i.e. no extension octets.
+ * The maximum length is 0xFFFF;
+ *
+ * Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @param length IN - length of object
+ * @return Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_header(u_char * data,
+ size_t * datalength, u_char type, size_t length)
+{
+ char ebuf[128];
+
+ if (*datalength < 1) {
+ snprintf(ebuf, sizeof(ebuf),
+ "bad header length < 1 :%lu, %lu",
+ (unsigned long)*datalength, (unsigned long)length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ *data++ = type;
+ (*datalength)--;
+ return asn_build_length(data, datalength, length);
+}
+
+/**
+ * @internal
+ * asn_build_sequence - builds an ASN header for a sequence with the ID and
+ *
+ * length specified.
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * in this object following the id and length.
+ *
+ * This only works on data types < 30, i.e. no extension octets.
+ * The maximum length is 0xFFFF;
+ *
+ * Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @param length IN - length of object
+ *
+ * @return Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_sequence(u_char * data,
+ size_t * datalength, u_char type, size_t length)
+{
+ static const char *errpre = "build seq";
+ char ebuf[128];
+
+ if (*datalength < 4) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: length %d < 4: PUNT", errpre,
+ (int) *datalength);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ *datalength -= 4;
+ *data++ = type;
+ *data++ = (u_char) (0x02 | ASN_LONG_LEN);
+ *data++ = (u_char) ((length >> 8) & 0xFF);
+ *data++ = (u_char) (length & 0xFF);
+ return data;
+}
+
+/**
+ * @internal
+ * asn_parse_length - interprets the length of the current object.
+ *
+ * On exit, length contains the value of this length field.
+ *
+ * Returns a pointer to the first byte after this length
+ * field (aka: the start of the data field).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of length field
+ * @param length OUT - value of length field
+ *
+ * @return Returns a pointer to the first byte after this length
+ * field (aka: the start of the data field).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_parse_length(u_char * data, u_long * length)
+{
+ static const char *errpre = "parse length";
+ char ebuf[128];
+ register u_char lengthbyte;
+
+ if (!data || !length) {
+ ERROR_MSG("parse length: NULL pointer");
+ return NULL;
+ }
+ lengthbyte = *data;
+
+ if (lengthbyte & ASN_LONG_LEN) {
+ lengthbyte &= ~ASN_LONG_LEN; /* turn MSb off */
+ if (lengthbyte == 0) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: indefinite length not supported", errpre);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ if (lengthbyte > sizeof(long)) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: data length %d > %lu not supported", errpre,
+ lengthbyte, (unsigned long)sizeof(long));
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ data++;
+ *length = 0; /* protect against short lengths */
+ while (lengthbyte--) {
+ *length <<= 8;
+ *length |= *data++;
+ }
+ if ((long) *length < 0) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: negative data length %ld\n", errpre,
+ (long) *length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ return data;
+ } else { /* short asnlength */
+ *length = (long) lengthbyte;
+ return data + 1;
+ }
+}
+
+/**
+ * @internal
+ * asn_build_length - builds an ASN header for a length with
+ * length specified.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * in this object following the length.
+ *
+ *
+ * Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param length IN - length of object
+ *
+ * @return Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_length(u_char * data, size_t * datalength, size_t length)
+{
+ static const char *errpre = "build length";
+ char ebuf[128];
+
+ u_char *start_data = data;
+
+ /*
+ * no indefinite lengths sent
+ */
+ if (length < 0x80) {
+ if (*datalength < 1) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: bad length < 1 :%lu, %lu", errpre,
+ (unsigned long)*datalength, (unsigned long)length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ *data++ = (u_char) length;
+ } else if (length <= 0xFF) {
+ if (*datalength < 2) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: bad length < 2 :%lu, %lu", errpre,
+ (unsigned long)*datalength, (unsigned long)length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ *data++ = (u_char) (0x01 | ASN_LONG_LEN);
+ *data++ = (u_char) length;
+ } else { /* 0xFF < length <= 0xFFFF */
+ if (*datalength < 3) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: bad length < 3 :%lu, %lu", errpre,
+ (unsigned long)*datalength, (unsigned long)length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ *data++ = (u_char) (0x02 | ASN_LONG_LEN);
+ *data++ = (u_char) ((length >> 8) & 0xFF);
+ *data++ = (u_char) (length & 0xFF);
+ }
+ *datalength -= (data - start_data);
+ return data;
+
+}
+
+/**
+ * @internal
+ * asn_parse_objid - pulls an object indentifier out of an ASN object identifier type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the beginning of the next object.
+ *
+ * "objid" is filled with the object identifier.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param objid IN/OUT - pointer to start of output buffer
+ * @param objidlength IN/OUT - number of sub-id's in objid
+ *
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ */
+u_char *
+asn_parse_objid(u_char * data,
+ size_t * datalength,
+ u_char * type, oid * objid, size_t * objidlength)
+{
+ static const char *errpre = "parse objid";
+ /*
+ * ASN.1 objid ::= 0x06 asnlength subidentifier {subidentifier}*
+ * subidentifier ::= {leadingbyte}* lastbyte
+ * leadingbyte ::= 1 7bitvalue
+ * lastbyte ::= 0 7bitvalue
+ */
+ register u_char *bufp = data;
+ register oid *oidp = objid + 1;
+ register u_long subidentifier;
+ register long length;
+ u_long asn_length;
+ size_t original_length = *objidlength;
+
+ *type = *bufp++;
+ if (*type != ASN_OBJECT_ID) {
+ _asn_type_err(errpre, *type);
+ return NULL;
+ }
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (_asn_parse_length_check("parse objid", bufp, data,
+ asn_length, *datalength))
+ return NULL;
+
+ *datalength -= (int) asn_length + (bufp - data);
+
+ DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
+
+ /*
+ * Handle invalid object identifier encodings of the form 06 00 robustly
+ */
+ if (asn_length == 0)
+ objid[0] = objid[1] = 0;
+
+ length = asn_length;
+ (*objidlength)--; /* account for expansion of first byte */
+
+ while (length > 0 && (*objidlength)-- > 0) {
+ subidentifier = 0;
+ do { /* shift and add in low order 7 bits */
+ subidentifier =
+ (subidentifier << 7) + (*(u_char *) bufp & ~ASN_BIT8);
+ length--;
+ } while ((*(u_char *) bufp++ & ASN_BIT8) && (length > 0)); /* last byte has high bit clear */
+
+ if (length == 0) {
+ u_char *last_byte = bufp - 1;
+ if (*last_byte & ASN_BIT8) {
+ /* last byte has high bit set -> wrong BER encoded OID */
+ ERROR_MSG("subidentifier syntax error");
+ return NULL;
+ }
+ }
+#if defined(EIGHTBIT_SUBIDS) || (SIZEOF_LONG != 4)
+ if (subidentifier > MAX_SUBID) {
+ ERROR_MSG("subidentifier too large");
+ return NULL;
+ }
+#endif
+ *oidp++ = (oid) subidentifier;
+ }
+
+ if (0 != length) {
+ ERROR_MSG("OID length exceeds buffer size");
+ *objidlength = original_length;
+ return NULL;
+ }
+
+ /*
+ * The first two subidentifiers are encoded into the first component
+ * with the value (X * 40) + Y, where:
+ * X is the value of the first subidentifier.
+ * Y is the value of the second subidentifier.
+ */
+ subidentifier = (u_long) objid[1];
+ if (subidentifier == 0x2B) {
+ objid[0] = 1;
+ objid[1] = 3;
+ } else {
+ if (subidentifier < 40) {
+ objid[0] = 0;
+ objid[1] = subidentifier;
+ } else if (subidentifier < 80) {
+ objid[0] = 1;
+ objid[1] = subidentifier - 40;
+ } else {
+ objid[0] = 2;
+ objid[1] = subidentifier - 80;
+ }
+ }
+
+ *objidlength = (int) (oidp - objid);
+
+ DEBUGMSG(("dumpv_recv", " ObjID: "));
+ DEBUGMSGOID(("dumpv_recv", objid, *objidlength));
+ DEBUGMSG(("dumpv_recv", "\n"));
+ return bufp;
+}
+
+/**
+ * @internal
+ * asn_build_objid - Builds an ASN object identifier object containing the
+ * input string.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the beginning of the next object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @param objid IN - pointer to start of input buffer
+ * @param objidlength IN - number of sub-id's in objid
+ *
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_objid(u_char * data,
+ size_t * datalength,
+ u_char type, oid * objid, size_t objidlength)
+{
+ /*
+ * ASN.1 objid ::= 0x06 asnlength subidentifier {subidentifier}*
+ * subidentifier ::= {leadingbyte}* lastbyte
+ * leadingbyte ::= 1 7bitvalue
+ * lastbyte ::= 0 7bitvalue
+ */
+ size_t asnlength;
+ register oid *op = objid;
+ u_char objid_size[MAX_OID_LEN];
+ register u_long objid_val;
+ u_long first_objid_val;
+ register int i;
+#ifndef NETSNMP_NO_DEBUGGING
+ u_char *initdatap = data;
+#endif
+
+ /*
+ * check if there are at least 2 sub-identifiers
+ */
+ if (objidlength == 0) {
+ /*
+ * there are not, so make OID have two with value of zero
+ */
+ objid_val = 0;
+ objidlength = 2;
+ } else if (objid[0] > 2) {
+ ERROR_MSG("build objid: bad first subidentifier");
+ return NULL;
+ } else if (objidlength == 1) {
+ /*
+ * encode the first value
+ */
+ objid_val = (op[0] * 40);
+ objidlength = 2;
+ op++;
+ } else {
+ /*
+ * combine the first two values
+ */
+ if ((op[1] > 40) &&
+ (op[0] < 2)) {
+ ERROR_MSG("build objid: bad second subidentifier");
+ return NULL;
+ }
+ objid_val = (op[0] * 40) + op[1];
+ op += 2;
+ }
+ first_objid_val = objid_val;
+
+ /*
+ * ditch illegal calls now
+ */
+ if (objidlength > MAX_OID_LEN)
+ return NULL;
+
+ /*
+ * calculate the number of bytes needed to store the encoded value
+ */
+ for (i = 1, asnlength = 0;;) {
+
+ CHECK_OVERFLOW_U(objid_val,5);
+ if (objid_val < (unsigned) 0x80) {
+ objid_size[i] = 1;
+ asnlength += 1;
+ } else if (objid_val < (unsigned) 0x4000) {
+ objid_size[i] = 2;
+ asnlength += 2;
+ } else if (objid_val < (unsigned) 0x200000) {
+ objid_size[i] = 3;
+ asnlength += 3;
+ } else if (objid_val < (unsigned) 0x10000000) {
+ objid_size[i] = 4;
+ asnlength += 4;
+ } else {
+ objid_size[i] = 5;
+ asnlength += 5;
+ }
+ i++;
+ if (i >= (int) objidlength)
+ break;
+ objid_val = *op++; /* XXX - doesn't handle 2.X (X > 40) */
+ }
+
+ /*
+ * store the ASN.1 tag and length
+ */
+ data = asn_build_header(data, datalength, type, asnlength);
+ if (_asn_build_header_check
+ ("build objid", data, *datalength, asnlength))
+ return NULL;
+
+ /*
+ * store the encoded OID value
+ */
+ for (i = 1, objid_val = first_objid_val, op = objid + 2;
+ i < (int) objidlength; i++) {
+ if (i != 1)
+ objid_val = (uint32_t)(*op++); /* already logged warning above */
+ switch (objid_size[i]) {
+ case 1:
+ *data++ = (u_char) objid_val;
+ break;
+
+ case 2:
+ *data++ = (u_char) ((objid_val >> 7) | 0x80);
+ *data++ = (u_char) (objid_val & 0x07f);
+ break;
+
+ case 3:
+ *data++ = (u_char) ((objid_val >> 14) | 0x80);
+ *data++ = (u_char) ((objid_val >> 7 & 0x7f) | 0x80);
+ *data++ = (u_char) (objid_val & 0x07f);
+ break;
+
+ case 4:
+ *data++ = (u_char) ((objid_val >> 21) | 0x80);
+ *data++ = (u_char) ((objid_val >> 14 & 0x7f) | 0x80);
+ *data++ = (u_char) ((objid_val >> 7 & 0x7f) | 0x80);
+ *data++ = (u_char) (objid_val & 0x07f);
+ break;
+
+ case 5:
+ *data++ = (u_char) ((objid_val >> 28) | 0x80);
+ *data++ = (u_char) ((objid_val >> 21 & 0x7f) | 0x80);
+ *data++ = (u_char) ((objid_val >> 14 & 0x7f) | 0x80);
+ *data++ = (u_char) ((objid_val >> 7 & 0x7f) | 0x80);
+ *data++ = (u_char) (objid_val & 0x07f);
+ break;
+ }
+ }
+
+ /*
+ * return the length and data ptr
+ */
+ *datalength -= asnlength;
+ DEBUGDUMPSETUP("send", initdatap, data - initdatap);
+ DEBUGMSG(("dumpv_send", " ObjID: "));
+ DEBUGMSGOID(("dumpv_send", objid, objidlength));
+ DEBUGMSG(("dumpv_send", "\n"));
+ return data;
+}
+
+/**
+ * @internal
+ * asn_parse_null - Interprets an ASN null type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the beginning of the next object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_parse_null(u_char * data, size_t * datalength, u_char * type)
+{
+ /*
+ * ASN.1 null ::= 0x05 0x00
+ */
+ register u_char *bufp = data;
+ u_long asn_length;
+
+ *type = *bufp++;
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (bufp == NULL) {
+ ERROR_MSG("parse null: bad length");
+ return NULL;
+ }
+ if (asn_length != 0) {
+ ERROR_MSG("parse null: malformed ASN.1 null");
+ return NULL;
+ }
+
+ *datalength -= (bufp - data);
+
+ DEBUGDUMPSETUP("recv", data, bufp - data);
+ DEBUGMSG(("dumpv_recv", " NULL\n"));
+
+ return bufp + asn_length;
+}
+
+
+/**
+ * @internal
+ * asn_build_null - Builds an ASN null object.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the beginning of the next object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @retun Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ */
+u_char *
+asn_build_null(u_char * data, size_t * datalength, u_char type)
+{
+ /*
+ * ASN.1 null ::= 0x05 0x00
+ */
+#ifndef NETSNMP_NO_DEBUGGING
+ u_char *initdatap = data;
+#endif
+ data = asn_build_header(data, datalength, type, 0);
+ DEBUGDUMPSETUP("send", initdatap, data - initdatap);
+ DEBUGMSG(("dumpv_send", " NULL\n"));
+ return data;
+}
+
+/**
+ * @internal
+ * asn_parse_bitstring - pulls a bitstring out of an ASN bitstring type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the beginning of the next object.
+ *
+ * "string" is filled with the bit string.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param string IN/OUT - pointer to start of output buffer
+ * @param strlength IN/OUT - size of output buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_parse_bitstring(u_char * data,
+ size_t * datalength,
+ u_char * type, u_char * str, size_t * strlength)
+{
+ /*
+ * bitstring ::= 0x03 asnlength unused {byte}*
+ */
+ static const char *errpre = "parse bitstring";
+ register u_char *bufp = data;
+ u_long asn_length;
+
+ *type = *bufp++;
+ if (*type != ASN_BIT_STR) {
+ _asn_type_err(errpre, *type);
+ return NULL;
+ }
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (_asn_parse_length_check(errpre, bufp, data,
+ asn_length, *datalength))
+ return NULL;
+
+ if ((size_t) asn_length > *strlength) {
+ _asn_length_err(errpre, (size_t) asn_length, *strlength);
+ return NULL;
+ }
+ if (_asn_bitstring_check(errpre, asn_length, *bufp))
+ return NULL;
+
+ DEBUGDUMPSETUP("recv", data, bufp - data);
+ DEBUGMSG(("dumpv_recv", " Bitstring: "));
+ DEBUGMSGHEX(("dumpv_recv", data, asn_length));
+ DEBUGMSG(("dumpv_recv", "\n"));
+
+ memmove(str, bufp, asn_length);
+ *strlength = (int) asn_length;
+ *datalength -= (int) asn_length + (bufp - data);
+ return bufp + asn_length;
+}
+
+
+/**
+ * @internal
+ * asn_build_bitstring - Builds an ASN bit string object containing the
+ * input string.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the beginning of the next object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @param string IN - pointer to start of input buffer
+ * @param strlength IN - size of input buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_bitstring(u_char * data,
+ size_t * datalength,
+ u_char type, const u_char * str, size_t strlength)
+{
+ /*
+ * ASN.1 bit string ::= 0x03 asnlength unused {byte}*
+ */
+ static const char *errpre = "build bitstring";
+ if (_asn_bitstring_check
+ (errpre, strlength, (u_char)((str) ? *str : 0)))
+ return NULL;
+
+ data = asn_build_header(data, datalength, type, strlength);
+ if (_asn_build_header_check(errpre, data, *datalength, strlength))
+ return NULL;
+
+ if (strlength > 0 && str)
+ memmove(data, str, strlength);
+ else if (strlength > 0 && !str) {
+ ERROR_MSG("no string passed into asn_build_bitstring\n");
+ return NULL;
+ }
+
+ *datalength -= strlength;
+ DEBUGDUMPSETUP("send", data, strlength);
+ DEBUGMSG(("dumpv_send", " Bitstring: "));
+ DEBUGMSGHEX(("dumpv_send", data, strlength));
+ DEBUGMSG(("dumpv_send", "\n"));
+ return data + strlength;
+}
+
+/**
+ * @internal
+ * asn_parse_unsigned_int64 - pulls a 64 bit unsigned long out of an ASN int
+ * type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param cp IN/OUT - pointer to counter struct
+ * @param countersize IN - size of output buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_parse_unsigned_int64(u_char * data,
+ size_t * datalength,
+ u_char * type,
+ struct counter64 * cp, size_t countersize)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+ static const char *errpre = "parse uint64";
+ const int uint64sizelimit = (4 * 2) + 1;
+ register u_char *bufp = data;
+ u_long asn_length;
+ register u_long low = 0, high = 0;
+
+ if (countersize != sizeof(struct counter64)) {
+ _asn_size_err(errpre, countersize, sizeof(struct counter64));
+ return NULL;
+ }
+ *type = *bufp++;
+ if (*type != ASN_COUNTER64
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ && *type != ASN_OPAQUE_COUNTER64 && *type != ASN_OPAQUE_U64
+#endif
+ ) {
+ _asn_type_err(errpre, *type);
+ return NULL;
+ }
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (_asn_parse_length_check
+ (errpre, bufp, data, asn_length, *datalength))
+ return NULL;
+
+ DEBUGDUMPSETUP("recv", data, bufp - data);
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ /*
+ * 64 bit counters as opaque
+ */
+ if ((*type == ASN_OPAQUE) &&
+ (asn_length <= ASN_OPAQUE_COUNTER64_MX_BER_LEN) &&
+ (*bufp == ASN_OPAQUE_TAG1) &&
+ ((*(bufp + 1) == ASN_OPAQUE_COUNTER64) ||
+ (*(bufp + 1) == ASN_OPAQUE_U64))) {
+ /*
+ * change type to Counter64 or U64
+ */
+ *type = *(bufp + 1);
+ /*
+ * value is encoded as special format
+ */
+ bufp = asn_parse_length(bufp + 2, &asn_length);
+ if (_asn_parse_length_check("parse opaque uint64", bufp, data,
+ asn_length, *datalength))
+ return NULL;
+ }
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ if (((int) asn_length > uint64sizelimit) ||
+ (((int) asn_length == uint64sizelimit) && *bufp != 0x00)) {
+ _asn_length_err(errpre, (size_t) asn_length, uint64sizelimit);
+ return NULL;
+ }
+ *datalength -= (int) asn_length + (bufp - data);
+ while (asn_length--) {
+ high = ((0x00FFFFFF & high) << 8) | ((low & 0xFF000000U) >> 24);
+ low = ((low & 0x00FFFFFF) << 8) | *bufp++;
+ }
+
+ CHECK_OVERFLOW_U(high,6);
+ CHECK_OVERFLOW_U(low,6);
+
+ cp->low = low;
+ cp->high = high;
+
+ DEBUGIF("dumpv_recv") {
+ char i64buf[I64CHARSZ + 1];
+ printU64(i64buf, cp);
+ DEBUGMSG(("dumpv_recv", "Counter64: %s\n", i64buf));
+ }
+
+ return bufp;
+}
+
+
+/**
+ * @internal
+ * asn_build_unsigned_int64 - builds an ASN object containing a 64 bit integer.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of output buffer
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @param cp IN - pointer to counter struct
+ * @param countersize IN - size of input buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_unsigned_int64(u_char * data,
+ size_t * datalength,
+ u_char type,
+ const struct counter64 * cp, size_t countersize)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+
+ register u_long low, high;
+ register u_long mask, mask2;
+ int add_null_byte = 0;
+ size_t intsize;
+#ifndef NETSNMP_NO_DEBUGGING
+ u_char *initdatap = data;
+#endif
+
+ if (countersize != sizeof(struct counter64)) {
+ _asn_size_err("build uint64", countersize,
+ sizeof(struct counter64));
+ return NULL;
+ }
+ intsize = 8;
+ low = cp->low;
+ high = cp->high;
+
+ CHECK_OVERFLOW_U(high,7);
+ CHECK_OVERFLOW_U(low,7);
+
+ mask = 0xff000000U;
+ if (high & 0x80000000U) {
+ /*
+ * if MSB is set
+ */
+ add_null_byte = 1;
+ intsize++;
+ } else {
+ /*
+ * Truncate "unnecessary" bytes off of the most significant end of this 2's
+ * complement integer.
+ * There should be no sequence of 9 consecutive 1's or 0's at the most
+ * significant end of the integer.
+ */
+ mask2 = 0xff800000U;
+ while ((((high & mask2) == 0) || ((high & mask2) == mask2))
+ && intsize > 1) {
+ intsize--;
+ high = ((high & 0x00ffffffu) << 8) | ((low & mask) >> 24);
+ low = (low & 0x00ffffffu) << 8;
+ }
+ }
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ /*
+ * encode a Counter64 as an opaque (it also works in SNMPv1)
+ */
+ /*
+ * turn into Opaque holding special tagged value
+ */
+ if (type == ASN_OPAQUE_COUNTER64) {
+ /*
+ * put the tag and length for the Opaque wrapper
+ */
+ data = asn_build_header(data, datalength, ASN_OPAQUE, intsize + 3);
+ if (_asn_build_header_check
+ ("build counter u64", data, *datalength, intsize + 3))
+ return NULL;
+
+ /*
+ * put the special tag and length
+ */
+ *data++ = ASN_OPAQUE_TAG1;
+ *data++ = ASN_OPAQUE_COUNTER64;
+ *data++ = (u_char) intsize;
+ *datalength = *datalength - 3;
+ } else
+ /*
+ * Encode the Unsigned int64 in an opaque
+ */
+ /*
+ * turn into Opaque holding special tagged value
+ */
+ if (type == ASN_OPAQUE_U64) {
+ /*
+ * put the tag and length for the Opaque wrapper
+ */
+ data = asn_build_header(data, datalength, ASN_OPAQUE, intsize + 3);
+ if (_asn_build_header_check
+ ("build opaque u64", data, *datalength, intsize + 3))
+ return NULL;
+
+ /*
+ * put the special tag and length
+ */
+ *data++ = ASN_OPAQUE_TAG1;
+ *data++ = ASN_OPAQUE_U64;
+ *data++ = (u_char) intsize;
+ *datalength = *datalength - 3;
+ } else {
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ data = asn_build_header(data, datalength, type, intsize);
+ if (_asn_build_header_check
+ ("build uint64", data, *datalength, intsize))
+ return NULL;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ }
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ *datalength -= intsize;
+ if (add_null_byte == 1) {
+ *data++ = '\0';
+ intsize--;
+ }
+ while (intsize--) {
+ *data++ = (u_char) (high >> 24);
+ high = ((high & 0x00ffffff) << 8) | ((low & mask) >> 24);
+ low = (low & 0x00ffffff) << 8;
+
+ }
+ DEBUGDUMPSETUP("send", initdatap, data - initdatap);
+ DEBUGIF("dumpv_send") {
+ char i64buf[I64CHARSZ + 1];
+ printU64(i64buf, cp);
+ DEBUGMSG(("dumpv_send", "%s", i64buf));
+ }
+ return data;
+}
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+
+
+/**
+ * @internal
+ * asn_parse_signed_int64 - pulls a 64 bit signed long out of an ASN int
+ * type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param cp IN/OUT - pointer to counter struct
+ * @param countersize IN - size of output buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+
+u_char *
+asn_parse_signed_int64(u_char * data,
+ size_t * datalength,
+ u_char * type,
+ struct counter64 * cp, size_t countersize)
+{
+ static const char *errpre = "parse int64";
+ const int int64sizelimit = (4 * 2) + 1;
+ char ebuf[128];
+ register u_char *bufp = data;
+ u_long asn_length;
+ register u_int low = 0, high = 0;
+
+ if (countersize != sizeof(struct counter64)) {
+ _asn_size_err(errpre, countersize, sizeof(struct counter64));
+ return NULL;
+ }
+ *type = *bufp++;
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (_asn_parse_length_check
+ (errpre, bufp, data, asn_length, *datalength))
+ return NULL;
+
+ DEBUGDUMPSETUP("recv", data, bufp - data);
+ if ((*type == ASN_OPAQUE) &&
+ (asn_length <= ASN_OPAQUE_COUNTER64_MX_BER_LEN) &&
+ (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_I64)) {
+ /*
+ * change type to Int64
+ */
+ *type = *(bufp + 1);
+ /*
+ * value is encoded as special format
+ */
+ bufp = asn_parse_length(bufp + 2, &asn_length);
+ if (_asn_parse_length_check("parse opaque int64", bufp, data,
+ asn_length, *datalength))
+ return NULL;
+ }
+ /*
+ * this should always have been true until snmp gets int64 PDU types
+ */
+ else {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: wrong type: %d, len %d, buf bytes (%02X,%02X)",
+ errpre, *type, (int) asn_length, *bufp, *(bufp + 1));
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return NULL;
+ }
+ if (((int) asn_length > int64sizelimit) ||
+ (((int) asn_length == int64sizelimit) && *bufp != 0x00)) {
+ _asn_length_err(errpre, (size_t) asn_length, int64sizelimit);
+ return NULL;
+ }
+ *datalength -= (int) asn_length + (bufp - data);
+ if (*bufp & 0x80) {
+ low = 0xFFFFFFFFU; /* first byte bit 1 means start the data with 1s */
+ high = 0xFFFFFF;
+ }
+
+ while (asn_length--) {
+ high = ((0x00FFFFFF & high) << 8) | ((low & 0xFF000000U) >> 24);
+ low = ((low & 0x00FFFFFF) << 8) | *bufp++;
+ }
+
+ CHECK_OVERFLOW_U(high,8);
+ CHECK_OVERFLOW_U(low,8);
+
+ cp->low = low;
+ cp->high = high;
+
+ DEBUGIF("dumpv_recv") {
+ char i64buf[I64CHARSZ + 1];
+ printI64(i64buf, cp);
+ DEBUGMSG(("dumpv_recv", "Integer64: %s\n", i64buf));
+ }
+
+ return bufp;
+}
+
+
+
+/**
+ * @internal
+ * asn_build_signed_int64 - builds an ASN object containing a 64 bit integer.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of output buffer
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @param cp IN - pointer to counter struct
+ * @param countersize IN - size of input buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_signed_int64(u_char * data,
+ size_t * datalength,
+ u_char type,
+ const struct counter64 * cp, size_t countersize)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+
+ register u_int mask, mask2;
+ u_long low;
+ long high; /* MUST be signed because of CHECK_OVERFLOW_S(). */
+ size_t intsize;
+#ifndef NETSNMP_NO_DEBUGGING
+ u_char *initdatap = data;
+#endif
+
+ if (countersize != sizeof(struct counter64)) {
+ _asn_size_err("build int64", countersize,
+ sizeof(struct counter64));
+ return NULL;
+ }
+ intsize = 8;
+ low = cp->low;
+ high = cp->high; /* unsigned to signed conversion */
+
+ CHECK_OVERFLOW_S(high,9);
+ CHECK_OVERFLOW_U(low,9);
+
+ /*
+ * Truncate "unnecessary" bytes off of the most significant end of this
+ * 2's complement integer. There should be no sequence of 9
+ * consecutive 1's or 0's at the most significant end of the
+ * integer.
+ */
+ mask = 0xFF000000U;
+ mask2 = 0xFF800000U;
+ while ((((high & mask2) == 0) || ((high & mask2) == mask2))
+ && intsize > 1) {
+ intsize--;
+ high = ((high & 0x00ffffff) << 8) | ((low & mask) >> 24);
+ low = (low & 0x00ffffff) << 8;
+ }
+ /*
+ * until a real int64 gets incorperated into SNMP, we are going to
+ * encode it as an opaque instead. First, we build the opaque
+ * header and then the int64 tag type we use to mark it as an
+ * int64 in the opaque string.
+ */
+ data = asn_build_header(data, datalength, ASN_OPAQUE, intsize + 3);
+ if (_asn_build_header_check
+ ("build int64", data, *datalength, intsize + 3))
+ return NULL;
+
+ *data++ = ASN_OPAQUE_TAG1;
+ *data++ = ASN_OPAQUE_I64;
+ *data++ = (u_char) intsize;
+ *datalength -= (3 + intsize);
+
+ while (intsize--) {
+ *data++ = (u_char) (high >> 24);
+ high = ((high & 0x00ffffff) << 8) | ((low & mask) >> 24);
+ low = (low & 0x00ffffff) << 8;
+ }
+ DEBUGDUMPSETUP("send", initdatap, data - initdatap);
+ DEBUGIF("dumpv_send") {
+ char i64buf[I64CHARSZ + 1];
+ printU64(i64buf, cp);
+ DEBUGMSG(("dumpv_send", "%s\n", i64buf));
+ }
+ return data;
+}
+
+
+/**
+ * @internal
+ * asn_parse_float - pulls a single precision floating-point out of an opaque type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param floatp IN/OUT - pointer to float
+ * @param floatsize IN - size of output buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_parse_float(u_char * data,
+ size_t * datalength,
+ u_char * type, float *floatp, size_t floatsize)
+{
+ static const char *errpre = "parse float";
+ register u_char *bufp = data;
+ u_long asn_length;
+ union {
+ float floatVal;
+ long longVal;
+ u_char c[sizeof(float)];
+ } fu;
+
+ if (floatsize != sizeof(float)) {
+ _asn_size_err("parse float", floatsize, sizeof(float));
+ return NULL;
+ }
+ *type = *bufp++;
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (_asn_parse_length_check("parse float", bufp, data,
+ asn_length, *datalength))
+ return NULL;
+
+ DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
+ /*
+ * the float is encoded as an opaque
+ */
+ if ((*type == ASN_OPAQUE) &&
+ (asn_length == ASN_OPAQUE_FLOAT_BER_LEN) &&
+ (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_FLOAT)) {
+
+ /*
+ * value is encoded as special format
+ */
+ bufp = asn_parse_length(bufp + 2, &asn_length);
+ if (_asn_parse_length_check("parse opaque float", bufp, data,
+ asn_length, *datalength))
+ return NULL;
+
+ /*
+ * change type to Float
+ */
+ *type = ASN_OPAQUE_FLOAT;
+ }
+
+ if (*type != ASN_OPAQUE_FLOAT) {
+ _asn_type_err(errpre, *type);
+ return NULL;
+ }
+
+ if (asn_length != sizeof(float)) {
+ _asn_size_err("parse seq float", asn_length, sizeof(float));
+ return NULL;
+ }
+
+ *datalength -= (int) asn_length + (bufp - data);
+ memcpy(&fu.c[0], bufp, asn_length);
+
+ /*
+ * correct for endian differences
+ */
+ fu.longVal = ntohl(fu.longVal);
+
+ *floatp = fu.floatVal;
+
+ DEBUGMSG(("dumpv_recv", "Opaque float: %f\n", *floatp));
+ return bufp;
+}
+
+/**
+ * @internal
+ * asn_build_float - builds an ASN object containing a single precision floating-point
+ * number in an Opaque value.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @param floatp IN - pointer to float
+ * @param floatsize IN - size of input buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+
+ */
+u_char *
+asn_build_float(u_char * data,
+ size_t * datalength,
+ u_char type, const float *floatp, size_t floatsize)
+{
+ union {
+ float floatVal;
+ int intVal;
+ u_char c[sizeof(float)];
+ } fu;
+#ifndef NETSNMP_NO_DEBUGGING
+ u_char *initdatap = data;
+#endif
+
+ if (floatsize != sizeof(float)) {
+ _asn_size_err("build float", floatsize, sizeof(float));
+ return NULL;
+ }
+ /*
+ * encode the float as an opaque
+ */
+ /*
+ * turn into Opaque holding special tagged value
+ */
+
+ /*
+ * put the tag and length for the Opaque wrapper
+ */
+ data = asn_build_header(data, datalength, ASN_OPAQUE, floatsize + 3);
+ if (_asn_build_header_check
+ ("build float", data, *datalength, (floatsize + 3)))
+ return NULL;
+
+ /*
+ * put the special tag and length
+ */
+ *data++ = ASN_OPAQUE_TAG1;
+ *data++ = ASN_OPAQUE_FLOAT;
+ *data++ = (u_char) floatsize;
+ *datalength = *datalength - 3;
+
+ fu.floatVal = *floatp;
+ /*
+ * correct for endian differences
+ */
+ fu.intVal = htonl(fu.intVal);
+
+ *datalength -= floatsize;
+ memcpy(data, &fu.c[0], floatsize);
+
+ DEBUGDUMPSETUP("send", initdatap, data - initdatap);
+ DEBUGMSG(("dumpv_send", "Opaque float: %f\n", *floatp));
+ data += floatsize;
+ return data;
+}
+
+
+/**
+ * @internal
+ * asn_parse_double - pulls a double out of an opaque type.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type OUT - asn type of object
+ * @param doublep IN/OUT - pointer to double
+ * @param doublesize IN - size of output buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_parse_double(u_char * data,
+ size_t * datalength,
+ u_char * type, double *doublep, size_t doublesize)
+{
+ static const char *errpre = "parse double";
+ register u_char *bufp = data;
+ u_long asn_length;
+ long tmp;
+ union {
+ double doubleVal;
+ int intVal[2];
+ u_char c[sizeof(double)];
+ } fu;
+
+
+ if (doublesize != sizeof(double)) {
+ _asn_size_err("parse double", doublesize, sizeof(double));
+ return NULL;
+ }
+ *type = *bufp++;
+ bufp = asn_parse_length(bufp, &asn_length);
+ if (_asn_parse_length_check("parse double", bufp, data,
+ asn_length, *datalength))
+ return NULL;
+
+ DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
+ /*
+ * the double is encoded as an opaque
+ */
+ if ((*type == ASN_OPAQUE) &&
+ (asn_length == ASN_OPAQUE_DOUBLE_BER_LEN) &&
+ (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_DOUBLE)) {
+
+ /*
+ * value is encoded as special format
+ */
+ bufp = asn_parse_length(bufp + 2, &asn_length);
+ if (_asn_parse_length_check("parse opaque double", bufp, data,
+ asn_length, *datalength))
+ return NULL;
+
+ /*
+ * change type to Double
+ */
+ *type = ASN_OPAQUE_DOUBLE;
+ }
+
+ if (*type != ASN_OPAQUE_DOUBLE) {
+ _asn_type_err(errpre, *type);
+ return NULL;
+ }
+
+ if (asn_length != sizeof(double)) {
+ _asn_size_err("parse seq double", asn_length, sizeof(double));
+ return NULL;
+ }
+ *datalength -= (int) asn_length + (bufp - data);
+ memcpy(&fu.c[0], bufp, asn_length);
+
+ /*
+ * correct for endian differences
+ */
+
+ tmp = ntohl(fu.intVal[0]);
+ fu.intVal[0] = ntohl(fu.intVal[1]);
+ fu.intVal[1] = tmp;
+
+ *doublep = fu.doubleVal;
+ DEBUGMSG(("dumpv_recv", " Opaque Double:\t%f\n", *doublep));
+
+ return bufp;
+}
+
+
+/**
+ * @internal
+ * asn_build_double - builds an ASN object containing a double
+ * number in an Opaque value.
+ *
+ * On entry, datalength is input as the number of valid bytes following
+ * "data". On exit, it is returned as the number of valid bytes
+ * following the end of this object.
+ *
+ * Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ *
+ * @param data IN - pointer to start of object
+ * @param datalength IN/OUT - number of valid bytes left in buffer
+ * @param type IN - asn type of object
+ * @param doublep IN - pointer to double
+ * @param doublesize IN - size of input buffer
+ * @return Returns a pointer to the first byte past the end
+ * of this object (i.e. the start of the next object).
+ * Returns NULL on any error.
+ */
+u_char *
+asn_build_double(u_char * data,
+ size_t * datalength,
+ u_char type, const double *doublep, size_t doublesize)
+{
+ long tmp;
+ union {
+ double doubleVal;
+ int intVal[2];
+ u_char c[sizeof(double)];
+ } fu;
+#ifndef NETSNMP_NO_DEBUGGING
+ u_char *initdatap = data;
+#endif
+
+ if (doublesize != sizeof(double)) {
+ _asn_size_err("build double", doublesize, sizeof(double));
+ return NULL;
+ }
+
+ /*
+ * encode the double as an opaque
+ */
+ /*
+ * turn into Opaque holding special tagged value
+ */
+
+ /*
+ * put the tag and length for the Opaque wrapper
+ */
+ data = asn_build_header(data, datalength, ASN_OPAQUE, doublesize + 3);
+ if (_asn_build_header_check
+ ("build double", data, *datalength, doublesize + 3))
+ return NULL;
+
+ /*
+ * put the special tag and length
+ */
+ *data++ = ASN_OPAQUE_TAG1;
+ *data++ = ASN_OPAQUE_DOUBLE;
+ *data++ = (u_char) doublesize;
+ *datalength = *datalength - 3;
+
+ fu.doubleVal = *doublep;
+ /*
+ * correct for endian differences
+ */
+ tmp = htonl(fu.intVal[0]);
+ fu.intVal[0] = htonl(fu.intVal[1]);
+ fu.intVal[1] = tmp;
+ *datalength -= doublesize;
+ memcpy(data, &fu.c[0], doublesize);
+
+ data += doublesize;
+ DEBUGDUMPSETUP("send", initdatap, data - initdatap);
+ DEBUGMSG(("dumpv_send", " Opaque double: %f\n", *doublep));
+ return data;
+}
+
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+
+
+/**
+ * @internal
+ * This function increases the size of the buffer pointed to by *pkt, which
+ * is initially of size *pkt_len. Contents are preserved **AT THE TOP END OF
+ * THE BUFFER** (hence making this function useful for reverse encoding).
+ * You can change the reallocation scheme, but you **MUST** guarantee to
+ * allocate **AT LEAST** one extra byte. If memory cannot be reallocated,
+ * then return 0; otherwise return 1.
+ *
+ * @param pkt buffer to increase
+ * @param pkt_len initial buffer size
+ *
+ * @return 1 on success 0 on error (memory cannot be reallocated)
+ */
+int
+asn_realloc(u_char ** pkt, size_t * pkt_len)
+{
+ if (pkt != NULL && pkt_len != NULL) {
+ size_t old_pkt_len = *pkt_len;
+
+ DEBUGMSGTL(("asn_realloc", " old_pkt %8p, old_pkt_len %lu\n",
+ *pkt, (unsigned long)old_pkt_len));
+
+ if (snmp_realloc(pkt, pkt_len)) {
+ DEBUGMSGTL(("asn_realloc", " new_pkt %8p, new_pkt_len %lu\n",
+ *pkt, (unsigned long)*pkt_len));
+ DEBUGMSGTL(("asn_realloc",
+ " memmove(%8p + %08x, %8p, %08x)\n",
+ *pkt, (unsigned)(*pkt_len - old_pkt_len),
+ *pkt, (unsigned)old_pkt_len));
+ memmove(*pkt + (*pkt_len - old_pkt_len), *pkt, old_pkt_len);
+ memset(*pkt, (int) ' ', *pkt_len - old_pkt_len);
+ return 1;
+ } else {
+ DEBUGMSG(("asn_realloc", " CANNOT REALLOC()\n"));
+ }
+ }
+ return 0;
+}
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+
+/**
+ * @internal
+ * reverse builds an ASN header for a length with
+ * length specified.
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param length IN - length of object
+ *
+ * @return 1 on success, 0 on error
+ */
+int
+asn_realloc_rbuild_length(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r, size_t length)
+{
+ static const char *errpre = "build length";
+ char ebuf[128];
+ int tmp_int;
+ size_t start_offset = *offset;
+
+ if (length <= 0x7f) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: bad length < 1 :%ld, %lu", errpre,
+ (long)(*pkt_len - *offset), (unsigned long)length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = length;
+ } else {
+ while (length > 0xff) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: bad length < 1 :%ld, %lu", errpre,
+ (long)(*pkt_len - *offset), (unsigned long)length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = length & 0xff;
+ length >>= 8;
+ }
+
+ while ((*pkt_len - *offset) < 2) {
+ if (!(r && asn_realloc(pkt, pkt_len))) {
+ snprintf(ebuf, sizeof(ebuf),
+ "%s: bad length < 1 :%ld, %lu", errpre,
+ (long)(*pkt_len - *offset), (unsigned long)length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return 0;
+ }
+ }
+
+ *(*pkt + *pkt_len - (++*offset)) = length & 0xff;
+ tmp_int = *offset - start_offset;
+ *(*pkt + *pkt_len - (++*offset)) = tmp_int | 0x80;
+ }
+
+ return 1;
+}
+
+/**
+ * @internal
+ * builds an ASN header for an object with the ID and
+ * length specified.
+ *
+ * @see asn_build_header
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param length IN - length of object
+ *
+ * @return 1 on success, 0 on error
+ */
+int
+asn_realloc_rbuild_header(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type, size_t length)
+{
+ char ebuf[128];
+
+ if (asn_realloc_rbuild_length(pkt, pkt_len, offset, r, length)) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ snprintf(ebuf, sizeof(ebuf),
+ "bad header length < 1 :%ld, %lu",
+ (long)(*pkt_len - *offset), (unsigned long)length);
+ ebuf[ sizeof(ebuf)-1 ] = 0;
+ ERROR_MSG(ebuf);
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = type;
+ return 1;
+ }
+ return 0;
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an int.
+ *
+ * @see asn_build_int
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param intp IN - pointer to start of long integer
+ * @param intsize IN - size of input buffer
+ *
+ * @return 1 on success, 0 on error
+ */
+int
+asn_realloc_rbuild_int(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type, const long *intp, size_t intsize)
+{
+ static const char *errpre = "build int";
+ register long integer = *intp;
+ int testvalue;
+ size_t start_offset = *offset;
+
+ if (intsize != sizeof(long)) {
+ _asn_size_err(errpre, intsize, sizeof(long));
+ return 0;
+ }
+
+ CHECK_OVERFLOW_S(integer,10);
+ testvalue = (integer < 0) ? -1 : 0;
+
+ if (((*pkt_len - *offset) < 1) && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) integer;
+ integer >>= 8;
+
+ while (integer != testvalue) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) integer;
+ integer >>= 8;
+ }
+
+ if ((*(*pkt + *pkt_len - *offset) & 0x80) != (testvalue & 0x80)) {
+ /*
+ * Make sure left most bit is representational of the rest of the bits
+ * that aren't encoded.
+ */
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = testvalue & 0xff;
+ }
+
+ if (asn_realloc_rbuild_header(pkt, pkt_len, offset, r, type,
+ (*offset - start_offset))) {
+ if (_asn_realloc_build_header_check(errpre, pkt, pkt_len,
+ (*offset - start_offset))) {
+ return 0;
+ } else {
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset),
+ (*offset - start_offset));
+ DEBUGMSG(("dumpv_send", " Integer:\t%ld (0x%.2lX)\n", *intp,
+ *intp));
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an string.
+ *
+ * @see asn_build_string
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param string IN - pointer to start of the string
+ * @param strlength IN - size of input buffer
+ *
+ * @return 1 on success, 0 on error
+ */
+
+int
+asn_realloc_rbuild_string(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type,
+ const u_char * str, size_t strlength)
+{
+ static const char *errpre = "build string";
+ size_t start_offset = *offset;
+
+ while ((*pkt_len - *offset) < strlength) {
+ if (!(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ }
+
+ *offset += strlength;
+ memcpy(*pkt + *pkt_len - *offset, str, strlength);
+
+ if (asn_realloc_rbuild_header
+ (pkt, pkt_len, offset, r, type, strlength)) {
+ if (_asn_realloc_build_header_check
+ (errpre, pkt, pkt_len, strlength)) {
+ return 0;
+ } else {
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset),
+ *offset - start_offset);
+ DEBUGIF("dumpv_send") {
+ if (strlength == 0) {
+ DEBUGMSG(("dumpv_send", " String: [NULL]\n"));
+ } else {
+ u_char *buf = (u_char *) malloc(2 * strlength);
+ size_t l =
+ (buf != NULL) ? (2 * strlength) : 0, ol = 0;
+
+ if (sprint_realloc_asciistring
+ (&buf, &l, &ol, 1, str, strlength)) {
+ DEBUGMSG(("dumpv_send", " String:\t%s\n", buf));
+ } else {
+ if (buf == NULL) {
+ DEBUGMSG(("dumpv_send",
+ " String:\t[TRUNCATED]\n"));
+ } else {
+ DEBUGMSG(("dumpv_send",
+ " String:\t%s [TRUNCATED]\n", buf));
+ }
+ }
+ if (buf != NULL) {
+ free(buf);
+ }
+ }
+ }
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an unsigned int.
+ *
+ * @see asn_build_unsigned_int
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param intp IN - pointer to start of unsigned int
+ * @param intsize IN - size of input buffer
+ *
+ * @return 1 on success, 0 on error
+ */
+int
+asn_realloc_rbuild_unsigned_int(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type, const u_long * intp, size_t intsize)
+{
+ static const char *errpre = "build uint";
+ register u_long integer = *intp;
+ size_t start_offset = *offset;
+
+ if (intsize != sizeof(unsigned long)) {
+ _asn_size_err(errpre, intsize, sizeof(unsigned long));
+ return 0;
+ }
+
+ CHECK_OVERFLOW_U(integer,11);
+
+ if (((*pkt_len - *offset) < 1) && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) integer;
+ integer >>= 8;
+
+ while (integer != 0) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) integer;
+ integer >>= 8;
+ }
+
+ if ((*(*pkt + *pkt_len - *offset) & 0x80) != (0 & 0x80)) {
+ /*
+ * Make sure left most bit is representational of the rest of the bits
+ * that aren't encoded.
+ */
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = 0;
+ }
+
+ if (asn_realloc_rbuild_header(pkt, pkt_len, offset, r, type,
+ (*offset - start_offset))) {
+ if (_asn_realloc_build_header_check(errpre, pkt, pkt_len,
+ (*offset - start_offset))) {
+ return 0;
+ } else {
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset),
+ (*offset - start_offset));
+ DEBUGMSG(("dumpv_send", " UInteger:\t%lu (0x%.2lX)\n", *intp,
+ *intp));
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an sequence.
+ *
+ * @see asn_build_sequence
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param length IN - length of object
+ *
+ * @return 1 on success, 0 on error
+ */
+
+int
+asn_realloc_rbuild_sequence(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type, size_t length)
+{
+ return asn_realloc_rbuild_header(pkt, pkt_len, offset, r, type,
+ length);
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an objid.
+ *
+ * @see asn_build_objid
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param objid IN - pointer to the object id
+ * @param objidlength IN - length of the input
+ *
+ * @return 1 on success, 0 on error
+ */
+
+int
+asn_realloc_rbuild_objid(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type,
+ const oid * objid, size_t objidlength)
+{
+ /*
+ * ASN.1 objid ::= 0x06 asnlength subidentifier {subidentifier}*
+ * subidentifier ::= {leadingbyte}* lastbyte
+ * leadingbyte ::= 1 7bitvalue
+ * lastbyte ::= 0 7bitvalue
+ */
+ register size_t i;
+ register oid tmpint;
+ size_t start_offset = *offset;
+ const char *errpre = "build objid";
+
+ /*
+ * Check if there are at least 2 sub-identifiers.
+ */
+ if (objidlength == 0) {
+ /*
+ * There are not, so make OID have two with value of zero.
+ */
+ while ((*pkt_len - *offset) < 2) {
+ if (!(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ }
+
+ *(*pkt + *pkt_len - (++*offset)) = 0;
+ *(*pkt + *pkt_len - (++*offset)) = 0;
+ } else if (objid[0] > 2) {
+ ERROR_MSG("build objid: bad first subidentifier");
+ return 0;
+ } else if (objidlength == 1) {
+ /*
+ * Encode the first value.
+ */
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) objid[0];
+ } else {
+ for (i = objidlength; i > 2; i--) {
+ tmpint = objid[i - 1];
+ CHECK_OVERFLOW_U(tmpint,12);
+
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) tmpint & 0x7f;
+ tmpint >>= 7;
+
+ while (tmpint > 0) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) =
+ (u_char) ((tmpint & 0x7f) | 0x80);
+ tmpint >>= 7;
+ }
+ }
+
+ /*
+ * Combine the first two values.
+ */
+ if ((objid[1] > 40) &&
+ (objid[0] < 2)) {
+ ERROR_MSG("build objid: bad second subidentifier");
+ return 0;
+ }
+ tmpint = ((objid[0] * 40) + objid[1]);
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) tmpint & 0x7f;
+ tmpint >>= 7;
+
+ while (tmpint > 0) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) =
+ (u_char) ((tmpint & 0x7f) | 0x80);
+ tmpint >>= 7;
+ }
+ }
+
+ tmpint = *offset - start_offset;
+ if (asn_realloc_rbuild_header(pkt, pkt_len, offset, r, type,
+ (*offset - start_offset))) {
+ if (_asn_realloc_build_header_check(errpre, pkt, pkt_len,
+ (*offset - start_offset))) {
+ return 0;
+ } else {
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset),
+ (*offset - start_offset));
+ DEBUGMSG(("dumpv_send", " ObjID: "));
+ DEBUGMSGOID(("dumpv_send", objid, objidlength));
+ DEBUGMSG(("dumpv_send", "\n"));
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an null object.
+ *
+ * @see asn_build_null
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ *
+ * @return 1 on success, 0 on error
+ */
+
+int
+asn_realloc_rbuild_null(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r, u_char type)
+{
+ /*
+ * ASN.1 null ::= 0x05 0x00
+ */
+ size_t start_offset = *offset;
+
+ if (asn_realloc_rbuild_header(pkt, pkt_len, offset, r, type, 0)) {
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset),
+ (*offset - start_offset));
+ DEBUGMSG(("dumpv_send", " NULL\n"));
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an bitstring.
+ *
+ * @see asn_build_bitstring
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param string IN - pointer to the string
+ * @param strlength IN - length of the input
+ *
+ * @return 1 on success, 0 on error
+ */
+
+int
+asn_realloc_rbuild_bitstring(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type,
+ const u_char * str, size_t strlength)
+{
+ /*
+ * ASN.1 bit string ::= 0x03 asnlength unused {byte}*
+ */
+ static const char *errpre = "build bitstring";
+ size_t start_offset = *offset;
+
+ while ((*pkt_len - *offset) < strlength) {
+ if (!(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ }
+
+ *offset += strlength;
+ memcpy(*pkt + *pkt_len - *offset, str, strlength);
+
+ if (asn_realloc_rbuild_header
+ (pkt, pkt_len, offset, r, type, strlength)) {
+ if (_asn_realloc_build_header_check
+ (errpre, pkt, pkt_len, strlength)) {
+ return 0;
+ } else {
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset),
+ *offset - start_offset);
+ DEBUGIF("dumpv_send") {
+ if (strlength == 0) {
+ DEBUGMSG(("dumpv_send", " Bitstring: [NULL]\n"));
+ } else {
+ u_char *buf = (u_char *) malloc(2 * strlength);
+ size_t l =
+ (buf != NULL) ? (2 * strlength) : 0, ol = 0;
+
+ if (sprint_realloc_asciistring
+ (&buf, &l, &ol, 1, str, strlength)) {
+ DEBUGMSG(("dumpv_send", " Bitstring:\t%s\n",
+ buf));
+ } else {
+ if (buf == NULL) {
+ DEBUGMSG(("dumpv_send",
+ " Bitstring:\t[TRUNCATED]\n"));
+ } else {
+ DEBUGMSG(("dumpv_send",
+ " Bitstring:\t%s [TRUNCATED]\n",
+ buf));
+ }
+ }
+ if (buf != NULL) {
+ free(buf);
+ }
+ }
+ }
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an unsigned int64.
+ *
+ * @see asn_build_unsigned_int64
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param cp IN - pointer to counter struct
+ * @param countersize IN - size of input buffer
+ *
+ * @return 1 on success, 0 on error
+ */
+int
+asn_realloc_rbuild_unsigned_int64(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type,
+ const struct counter64 *cp, size_t countersize)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+ register u_long low = cp->low, high = cp->high;
+ size_t intsize, start_offset = *offset;
+ int count;
+
+ if (countersize != sizeof(struct counter64)) {
+ _asn_size_err("build uint64", countersize,
+ sizeof(struct counter64));
+ return 0;
+ }
+
+ CHECK_OVERFLOW_U(high,13);
+ CHECK_OVERFLOW_U(low,13);
+
+ /*
+ * Encode the low 4 bytes first.
+ */
+ if (((*pkt_len - *offset) < 1) && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) low;
+ low >>= 8;
+ count = 1;
+
+ while (low != 0) {
+ count++;
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) low;
+ low >>= 8;
+ }
+
+ /*
+ * Then the high byte if present.
+ */
+ if (high) {
+ /*
+ * Do the rest of the low byte.
+ */
+ for (; count < 4; count++) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = 0;
+ }
+
+ /*
+ * Do high byte.
+ */
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) high;
+ high >>= 8;
+
+ while (high != 0) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) high;
+ high >>= 8;
+ }
+ }
+
+ if ((*(*pkt + *pkt_len - *offset) & 0x80) != (0 & 0x80)) {
+ /*
+ * Make sure left most bit is representational of the rest of the bits
+ * that aren't encoded.
+ */
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = 0;
+ }
+
+ intsize = *offset - start_offset;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ /*
+ * Encode a Counter64 as an opaque (it also works in SNMPv1).
+ */
+ if (type == ASN_OPAQUE_COUNTER64) {
+ while ((*pkt_len - *offset) < 5) {
+ if (!(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ }
+
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) intsize;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_COUNTER64;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_TAG1;
+
+ /*
+ * Put the tag and length for the Opaque wrapper.
+ */
+ if (asn_realloc_rbuild_header(pkt, pkt_len, offset, r,
+ ASN_OPAQUE, intsize + 3)) {
+ if (_asn_realloc_build_header_check
+ ("build counter u64", pkt, pkt_len, intsize + 3)) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+ } else if (type == ASN_OPAQUE_U64) {
+ /*
+ * Encode the Unsigned int64 in an opaque.
+ */
+ while ((*pkt_len - *offset) < 5) {
+ if (!(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ }
+
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) intsize;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_U64;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_TAG1;
+
+ /*
+ * Put the tag and length for the Opaque wrapper.
+ */
+ if (asn_realloc_rbuild_header(pkt, pkt_len, offset, r,
+ ASN_OPAQUE, intsize + 3)) {
+ if (_asn_realloc_build_header_check
+ ("build counter u64", pkt, pkt_len, intsize + 3)) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+ } else {
+
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ if (asn_realloc_rbuild_header
+ (pkt, pkt_len, offset, r, type, intsize)) {
+ if (_asn_realloc_build_header_check
+ ("build uint64", pkt, pkt_len, intsize)) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ }
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset), intsize);
+ DEBUGMSG(("dumpv_send", " U64:\t%lu %lu\n", cp->high, cp->low));
+ return 1;
+}
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+
+
+/**
+ * @internal
+ * builds an ASN object containing an signed int64.
+ *
+ * @see asn_build_signed_int64
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param cp IN - pointer to counter struct
+ * @param countersize IN - size of input buffer
+ *
+ * @return 1 on success, 0 on error
+ */
+int
+asn_realloc_rbuild_signed_int64(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type,
+ const struct counter64 *cp, size_t countersize)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+ register long low = cp->low, high = cp->high;
+ size_t intsize, start_offset = *offset;
+ int count, testvalue = (high & 0x80000000) ? -1 : 0;
+
+ if (countersize != sizeof(struct counter64)) {
+ _asn_size_err("build uint64", countersize,
+ sizeof(struct counter64));
+ return 0;
+ }
+
+ CHECK_OVERFLOW_S(high,14);
+ CHECK_OVERFLOW_U(low,14);
+
+ /*
+ * Encode the low 4 bytes first.
+ */
+ if (((*pkt_len - *offset) < 1) && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) low;
+ low >>= 8;
+ count = 1;
+
+ while ((int) low != testvalue && count < 4) {
+ count++;
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) low;
+ low >>= 8;
+ }
+
+ /*
+ * Then the high byte if present.
+ */
+ if (high != testvalue) {
+ /*
+ * Do the rest of the low byte.
+ */
+ for (; count < 4; count++) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (testvalue == 0) ? 0 : 0xff;
+ }
+
+ /*
+ * Do high byte.
+ */
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) high;
+ high >>= 8;
+
+ while ((int) high != testvalue) {
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) high;
+ high >>= 8;
+ }
+ }
+
+ if ((*(*pkt + *pkt_len - *offset) & 0x80) != (testvalue & 0x80)) {
+ /*
+ * Make sure left most bit is representational of the rest of the bits
+ * that aren't encoded.
+ */
+ if (((*pkt_len - *offset) < 1)
+ && !(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ *(*pkt + *pkt_len - (++*offset)) = (testvalue == 0) ? 0 : 0xff;
+ }
+
+ intsize = *offset - start_offset;
+
+ while ((*pkt_len - *offset) < 5) {
+ if (!(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ }
+
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) intsize;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_I64;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_TAG1;
+
+ /*
+ * Put the tag and length for the Opaque wrapper.
+ */
+ if (asn_realloc_rbuild_header(pkt, pkt_len, offset, r,
+ ASN_OPAQUE, intsize + 3)) {
+ if (_asn_realloc_build_header_check
+ ("build counter u64", pkt, pkt_len, intsize + 3)) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset), intsize);
+ DEBUGMSG(("dumpv_send", " UInt64:\t%lu %lu\n", cp->high, cp->low));
+ return 1;
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an float.
+ *
+ * @see asn_build_float
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param floatp IN - pointer to the float
+ * @param floatsize IN - size of input buffer
+ *
+ * @return 1 on success, 0 on error
+ */
+
+int
+asn_realloc_rbuild_float(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type, const float *floatp, size_t floatsize)
+{
+ size_t start_offset = *offset;
+ union {
+ float floatVal;
+ int intVal;
+ u_char c[sizeof(float)];
+ } fu;
+
+ /*
+ * Floatsize better not be larger than realistic.
+ */
+ if (floatsize != sizeof(float) || floatsize > 122) {
+ return 0;
+ }
+
+ while ((*pkt_len - *offset) < floatsize + 3) {
+ if (!(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ }
+
+ /*
+ * Correct for endian differences and copy value.
+ */
+ fu.floatVal = *floatp;
+ fu.intVal = htonl(fu.intVal);
+ *offset += floatsize;
+ memcpy(*pkt + *pkt_len - *offset, &(fu.c[0]), floatsize);
+
+ /*
+ * Put the special tag and length (3 bytes).
+ */
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) floatsize;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_FLOAT;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_TAG1;
+
+ /*
+ * Put the tag and length for the Opaque wrapper.
+ */
+ if (asn_realloc_rbuild_header(pkt, pkt_len, offset, r,
+ ASN_OPAQUE, floatsize + 3)) {
+ if (_asn_realloc_build_header_check("build float", pkt, pkt_len,
+ floatsize + 3)) {
+ return 0;
+ } else {
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset),
+ *offset - start_offset);
+ DEBUGMSG(("dumpv_send", "Opaque Float:\t%f\n", *floatp));
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * @internal
+ * builds an ASN object containing an double.
+ *
+ * @see asn_build_double
+ *
+ * @param pkt IN/OUT address of the begining of the buffer.
+ * @param pkt_len IN/OUT address to an integer containing the size of pkt.
+ * @param offset IN/OUT offset to the start of the buffer where to write
+ * @param r IN if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param type IN - type of object
+ * @param doublep IN - pointer to double
+ * @param doublesize IN - size of input buffer
+ *
+ * @return 1 on success, 0 on error
+ */
+
+int
+asn_realloc_rbuild_double(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int r,
+ u_char type, const double *doublep, size_t doublesize)
+{
+ size_t start_offset = *offset;
+ long tmp;
+ union {
+ double doubleVal;
+ int intVal[2];
+ u_char c[sizeof(double)];
+ } fu;
+
+ /*
+ * Doublesize better not be larger than realistic.
+ */
+ if (doublesize != sizeof(double) || doublesize > 122) {
+ return 0;
+ }
+
+ while ((*pkt_len - *offset) < doublesize + 3) {
+ if (!(r && asn_realloc(pkt, pkt_len))) {
+ return 0;
+ }
+ }
+
+ /*
+ * Correct for endian differences and copy value.
+ */
+ fu.doubleVal = *doublep;
+ tmp = htonl(fu.intVal[0]);
+ fu.intVal[0] = htonl(fu.intVal[1]);
+ fu.intVal[1] = tmp;
+ *offset += doublesize;
+ memcpy(*pkt + *pkt_len - *offset, &(fu.c[0]), doublesize);
+
+ /*
+ * Put the special tag and length (3 bytes).
+ */
+ *(*pkt + *pkt_len - (++*offset)) = (u_char) doublesize;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_DOUBLE;
+ *(*pkt + *pkt_len - (++*offset)) = ASN_OPAQUE_TAG1;
+
+ /*
+ * Put the tag and length for the Opaque wrapper.
+ */
+ if (asn_realloc_rbuild_header(pkt, pkt_len, offset, r,
+ ASN_OPAQUE, doublesize + 3)) {
+ if (_asn_realloc_build_header_check("build float", pkt, pkt_len,
+ doublesize + 3)) {
+ return 0;
+ } else {
+ DEBUGDUMPSETUP("send", (*pkt + *pkt_len - *offset),
+ *offset - start_offset);
+ DEBUGMSG(("dumpv_send", " Opaque Double:\t%f\n", *doublep));
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+#endif /* NETSNMP_USE_REVERSE_ASNENCODING */
+/**
+ * @}
+ */
diff --git a/snmplib/callback.c b/snmplib/callback.c
new file mode 100644
index 0000000..dfe537a
--- /dev/null
+++ b/snmplib/callback.c
@@ -0,0 +1,585 @@
+/*
+ * callback.c: A generic callback mechanism
+ */
+/* 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 callback A generic callback mechanism
+ * @ingroup library
+ *
+ * @{
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <sys/types.h>
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if !defined(mingw32) && defined(HAVE_SYS_TIME_H)
+#include <sys/time.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmp_api.h>
+
+netsnmp_feature_child_of(callbacks_all, libnetsnmp)
+
+netsnmp_feature_child_of(callback_count, callbacks_all)
+netsnmp_feature_child_of(callback_list, callbacks_all)
+
+/*
+ * the inline callback methods use major/minor to index into arrays.
+ * all users in this function do range checking before calling these
+ * functions, so it is redundant for them to check again. But if you
+ * want to be paranoid, define this var, and additional range checks
+ * will be performed.
+ * #define NETSNMP_PARANOID_LEVEL_HIGH 1
+ */
+
+static int _callback_need_init = 1;
+static struct snmp_gen_callback
+ *thecallbacks[MAX_CALLBACK_IDS][MAX_CALLBACK_SUBIDS];
+
+#define CALLBACK_NAME_LOGGING 1
+#ifdef CALLBACK_NAME_LOGGING
+static const char *types[MAX_CALLBACK_IDS] = { "LIB", "APP" };
+static const char *lib[MAX_CALLBACK_SUBIDS] = {
+ "POST_READ_CONFIG", /* 0 */
+ "STORE_DATA", /* 1 */
+ "SHUTDOWN", /* 2 */
+ "POST_PREMIB_READ_CONFIG", /* 3 */
+ "LOGGING", /* 4 */
+ "SESSION_INIT", /* 5 */
+ NULL, /* 6 */
+ NULL, /* 7 */
+ NULL, /* 8 */
+ NULL, /* 9 */
+ NULL, /* 10 */
+ NULL, /* 11 */
+ NULL, /* 12 */
+ NULL, /* 13 */
+ NULL, /* 14 */
+ NULL /* 15 */
+};
+#endif
+
+/*
+ * extremely simplistic locking, just to find problems were the
+ * callback list is modified while being traversed. Not intended
+ * to do any real protection, or in any way imply that this code
+ * has been evaluated for use in a multi-threaded environment.
+ * In 5.2, it was a single lock. For 5.3, it has been updated to
+ * a lock per callback, since a particular callback may trigger
+ * registration/unregistration of other callbacks (eg AgentX
+ * subagents do this).
+ */
+#define LOCK_PER_CALLBACK_SUBID 1
+#ifdef LOCK_PER_CALLBACK_SUBID
+static int _locks[MAX_CALLBACK_IDS][MAX_CALLBACK_SUBIDS];
+#define CALLBACK_LOCK(maj,min) ++_locks[maj][min]
+#define CALLBACK_UNLOCK(maj,min) --_locks[maj][min]
+#define CALLBACK_LOCK_COUNT(maj,min) _locks[maj][min]
+#else
+static int _lock;
+#define CALLBACK_LOCK(maj,min) ++_lock
+#define CALLBACK_UNLOCK(maj,min) --_lock
+#define CALLBACK_LOCK_COUNT(maj,min) _lock
+#endif
+
+NETSNMP_STATIC_INLINE int
+_callback_lock(int major, int minor, const char* warn, int do_assert)
+{
+ int lock_holded=0;
+ struct timeval lock_time = { 0, 1000 };
+
+#ifdef NETSNMP_PARANOID_LEVEL_HIGH
+ if (major >= MAX_CALLBACK_IDS || minor >= MAX_CALLBACK_SUBIDS) {
+ netsnmp_assert("bad callback id");
+ return 1;
+ }
+#endif
+
+#ifdef CALLBACK_NAME_LOGGING
+ DEBUGMSGTL(("9:callback:lock", "locked (%s,%s)\n",
+ types[major], (SNMP_CALLBACK_LIBRARY == major) ?
+ SNMP_STRORNULL(lib[minor]) : "null"));
+#endif
+ while (CALLBACK_LOCK_COUNT(major,minor) >= 1 && ++lock_holded < 100)
+ select(0, NULL, NULL, NULL, &lock_time);
+
+ if(lock_holded >= 100) {
+ if (NULL != warn)
+ snmp_log(LOG_WARNING,
+ "lock in _callback_lock sleeps more than 100 milliseconds in %s\n", warn);
+ if (do_assert)
+ netsnmp_assert(lock_holded < 100);
+
+ return 1;
+ }
+
+ CALLBACK_LOCK(major,minor);
+ return 0;
+}
+
+NETSNMP_STATIC_INLINE void
+_callback_unlock(int major, int minor)
+{
+#ifdef NETSNMP_PARANOID_LEVEL_HIGH
+ if (major >= MAX_CALLBACK_IDS || minor >= MAX_CALLBACK_SUBIDS) {
+ netsnmp_assert("bad callback id");
+ return;
+ }
+#endif
+
+ CALLBACK_UNLOCK(major,minor);
+
+#ifdef CALLBACK_NAME_LOGGING
+ DEBUGMSGTL(("9:callback:lock", "unlocked (%s,%s)\n",
+ types[major], (SNMP_CALLBACK_LIBRARY == major) ?
+ SNMP_STRORNULL(lib[minor]) : "null"));
+#endif
+}
+
+
+/*
+ * the chicken. or the egg. You pick.
+ */
+void
+init_callbacks(void)
+{
+ /*
+ * (poses a problem if you put init_callbacks() inside of
+ * init_snmp() and then want the app to register a callback before
+ * init_snmp() is called in the first place. -- Wes
+ */
+ if (0 == _callback_need_init)
+ return;
+
+ _callback_need_init = 0;
+
+ memset(thecallbacks, 0, sizeof(thecallbacks));
+#ifdef LOCK_PER_CALLBACK_SUBID
+ memset(_locks, 0, sizeof(_locks));
+#else
+ _lock = 0;
+#endif
+
+ DEBUGMSGTL(("callback", "initialized\n"));
+}
+
+/**
+ * This function registers a generic callback function. The major and
+ * minor values are used to set the new_callback function into a global
+ * static multi-dimensional array of type struct snmp_gen_callback.
+ * The function makes sure to append this callback function at the end
+ * of the link list, snmp_gen_callback->next.
+ *
+ * @param major is the SNMP callback major type used
+ * - SNMP_CALLBACK_LIBRARY
+ * - SNMP_CALLBACK_APPLICATION
+ *
+ * @param minor is the SNMP callback minor type used
+ * - SNMP_CALLBACK_POST_READ_CONFIG
+ * - SNMP_CALLBACK_STORE_DATA
+ * - SNMP_CALLBACK_SHUTDOWN
+ * - SNMP_CALLBACK_POST_PREMIB_READ_CONFIG
+ * - SNMP_CALLBACK_LOGGING
+ * - SNMP_CALLBACK_SESSION_INIT
+ *
+ * @param new_callback is the callback function that is registered.
+ *
+ * @param arg when not NULL is a void pointer used whenever new_callback
+ * function is exercised. Ownership is transferred to the twodimensional
+ * thecallbacks[][] array. The function clear_callback() will deallocate
+ * the memory pointed at by calling free().
+ *
+ * @return
+ * Returns SNMPERR_GENERR if major is >= MAX_CALLBACK_IDS or minor is >=
+ * MAX_CALLBACK_SUBIDS or a snmp_gen_callback pointer could not be
+ * allocated, otherwise SNMPERR_SUCCESS is returned.
+ * - \#define MAX_CALLBACK_IDS 2
+ * - \#define MAX_CALLBACK_SUBIDS 16
+ *
+ * @see snmp_call_callbacks
+ * @see snmp_unregister_callback
+ */
+int
+snmp_register_callback(int major, int minor, SNMPCallback * new_callback,
+ void *arg)
+{
+ return netsnmp_register_callback( major, minor, new_callback, arg,
+ NETSNMP_CALLBACK_DEFAULT_PRIORITY);
+}
+
+/**
+ * Register a callback function.
+ *
+ * @param major Major callback event type.
+ * @param minor Minor callback event type.
+ * @param new_callback Callback function being registered.
+ * @param arg Argument that will be passed to the callback function.
+ * @param priority Handler invocation priority. When multiple handlers have
+ * been registered for the same (major, minor) callback event type, handlers
+ * with the numerically lowest priority will be invoked first. Handlers with
+ * identical priority are invoked in the order they have been registered.
+ *
+ * @see snmp_register_callback
+ */
+int
+netsnmp_register_callback(int major, int minor, SNMPCallback * new_callback,
+ void *arg, int priority)
+{
+ struct snmp_gen_callback *newscp = NULL, *scp = NULL;
+ struct snmp_gen_callback **prevNext = &(thecallbacks[major][minor]);
+
+ if (major >= MAX_CALLBACK_IDS || minor >= MAX_CALLBACK_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ if (_callback_need_init)
+ init_callbacks();
+
+ _callback_lock(major,minor, "netsnmp_register_callback", 1);
+
+ if ((newscp = SNMP_MALLOC_STRUCT(snmp_gen_callback)) == NULL) {
+ _callback_unlock(major,minor);
+ return SNMPERR_GENERR;
+ } else {
+ newscp->priority = priority;
+ newscp->sc_client_arg = arg;
+ newscp->sc_callback = new_callback;
+ newscp->next = NULL;
+
+ for (scp = thecallbacks[major][minor]; scp != NULL;
+ scp = scp->next) {
+ if (newscp->priority < scp->priority) {
+ newscp->next = scp;
+ break;
+ }
+ prevNext = &(scp->next);
+ }
+
+ *prevNext = newscp;
+
+ DEBUGMSGTL(("callback", "registered (%d,%d) at %p with priority %d\n",
+ major, minor, newscp, priority));
+ _callback_unlock(major,minor);
+ return SNMPERR_SUCCESS;
+ }
+}
+
+/**
+ * This function calls the callback function for each registered callback of
+ * type major and minor.
+ *
+ * @param major is the SNMP callback major type used
+ *
+ * @param minor is the SNMP callback minor type used
+ *
+ * @param caller_arg is a void pointer which is sent in as the callback's
+ * serverarg parameter, if needed.
+ *
+ * @return Returns SNMPERR_GENERR if major is >= MAX_CALLBACK_IDS or
+ * minor is >= MAX_CALLBACK_SUBIDS, otherwise SNMPERR_SUCCESS is returned.
+ *
+ * @see snmp_register_callback
+ * @see snmp_unregister_callback
+ */
+int
+snmp_call_callbacks(int major, int minor, void *caller_arg)
+{
+ struct snmp_gen_callback *scp;
+ unsigned int count = 0;
+
+ if (major >= MAX_CALLBACK_IDS || minor >= MAX_CALLBACK_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ if (_callback_need_init)
+ init_callbacks();
+
+#ifdef LOCK_PER_CALLBACK_SUBID
+ _callback_lock(major,minor,"snmp_call_callbacks", 1);
+#else
+ /*
+ * Notes:
+ * - this gets hit the first time a trap is sent after a new trap
+ * destination has been added (session init cb during send trap cb)
+ */
+ _callback_lock(major,minor, NULL, 0);
+#endif
+
+ DEBUGMSGTL(("callback", "START calling callbacks for maj=%d min=%d\n",
+ major, minor));
+
+ /*
+ * for each registered callback of type major and minor
+ */
+ for (scp = thecallbacks[major][minor]; scp != NULL; scp = scp->next) {
+
+ /*
+ * skip unregistered callbacks
+ */
+ if(NULL == scp->sc_callback)
+ continue;
+
+ DEBUGMSGTL(("callback", "calling a callback for maj=%d min=%d\n",
+ major, minor));
+
+ /*
+ * call them
+ */
+ (*(scp->sc_callback)) (major, minor, caller_arg,
+ scp->sc_client_arg);
+ count++;
+ }
+
+ DEBUGMSGTL(("callback",
+ "END calling callbacks for maj=%d min=%d (%d called)\n",
+ major, minor, count));
+
+ _callback_unlock(major,minor);
+ return SNMPERR_SUCCESS;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CALLBACK_COUNT
+int
+snmp_count_callbacks(int major, int minor)
+{
+ int count = 0;
+ struct snmp_gen_callback *scp;
+
+ if (major >= MAX_CALLBACK_IDS || minor >= MAX_CALLBACK_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ if (_callback_need_init)
+ init_callbacks();
+
+ for (scp = thecallbacks[major][minor]; scp != NULL; scp = scp->next) {
+ count++;
+ }
+
+ return count;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CALLBACK_COUNT */
+
+int
+snmp_callback_available(int major, int minor)
+{
+ if (major >= MAX_CALLBACK_IDS || minor >= MAX_CALLBACK_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ if (_callback_need_init)
+ init_callbacks();
+
+ if (thecallbacks[major][minor] != NULL) {
+ return SNMPERR_SUCCESS;
+ }
+
+ return SNMPERR_GENERR;
+}
+
+/**
+ * This function unregisters a specified callback function given a major
+ * and minor type.
+ *
+ * Note: no bound checking on major and minor.
+ *
+ * @param major is the SNMP callback major type used
+ *
+ * @param minor is the SNMP callback minor type used
+ *
+ * @param target is the callback function that will be unregistered.
+ *
+ * @param arg is a void pointer used for comparison against the registered
+ * callback's sc_client_arg variable.
+ *
+ * @param matchargs is an integer used to bypass the comparison of arg and the
+ * callback's sc_client_arg variable only when matchargs is set to 0.
+ *
+ *
+ * @return
+ * Returns the number of callbacks that were unregistered.
+ *
+ * @see snmp_register_callback
+ * @see snmp_call_callbacks
+ */
+
+int
+snmp_unregister_callback(int major, int minor, SNMPCallback * target,
+ void *arg, int matchargs)
+{
+ struct snmp_gen_callback *scp = thecallbacks[major][minor];
+ struct snmp_gen_callback **prevNext = &(thecallbacks[major][minor]);
+ int count = 0;
+
+ if (major >= MAX_CALLBACK_IDS || minor >= MAX_CALLBACK_SUBIDS)
+ return SNMPERR_GENERR;
+
+ if (_callback_need_init)
+ init_callbacks();
+
+#ifdef LOCK_PER_CALLBACK_SUBID
+ _callback_lock(major,minor,"snmp_unregister_callback", 1);
+#else
+ /*
+ * Notes;
+ * - this gets hit at shutdown, during cleanup. No easy fix.
+ */
+ _callback_lock(major,minor,"snmp_unregister_callback", 0);
+#endif
+
+ while (scp != NULL) {
+ if ((scp->sc_callback == target) &&
+ (!matchargs || (scp->sc_client_arg == arg))) {
+ DEBUGMSGTL(("callback", "unregistering (%d,%d) at %p\n", major,
+ minor, scp));
+ if(1 == CALLBACK_LOCK_COUNT(major,minor)) {
+ *prevNext = scp->next;
+ SNMP_FREE(scp);
+ scp = *prevNext;
+ }
+ else {
+ scp->sc_callback = NULL;
+ /** set cleanup flag? */
+ }
+ count++;
+ } else {
+ prevNext = &(scp->next);
+ scp = scp->next;
+ }
+ }
+
+ _callback_unlock(major,minor);
+ return count;
+}
+
+/**
+ * find and clear client args that match ptr
+ *
+ * @param ptr pointer to search for
+ * @param i callback id to start at
+ * @param j callback subid to start at
+ */
+int
+netsnmp_callback_clear_client_arg(void *ptr, int i, int j)
+{
+ struct snmp_gen_callback *scp = NULL;
+ int rc = 0;
+
+ /*
+ * don't init i and j before loop, since the caller specified
+ * the starting point explicitly. But *after* the i loop has
+ * finished executing once, init j to 0 for the next pass
+ * through the subids.
+ */
+ for (; i < MAX_CALLBACK_IDS; i++,j=0) {
+ for (; j < MAX_CALLBACK_SUBIDS; j++) {
+ scp = thecallbacks[i][j];
+ while (scp != NULL) {
+ if ((NULL != scp->sc_callback) &&
+ (scp->sc_client_arg != NULL) &&
+ (scp->sc_client_arg == ptr)) {
+ DEBUGMSGTL(("9:callback", " clearing %p at [%d,%d]\n", ptr, i, j));
+ scp->sc_client_arg = NULL;
+ ++rc;
+ }
+ scp = scp->next;
+ }
+ }
+ }
+
+ if (0 != rc) {
+ DEBUGMSGTL(("callback", "removed %d client args\n", rc));
+ }
+
+ return rc;
+}
+
+void
+clear_callback(void)
+{
+ unsigned int i = 0, j = 0;
+ struct snmp_gen_callback *scp = NULL;
+
+ if (_callback_need_init)
+ init_callbacks();
+
+ DEBUGMSGTL(("callback", "clear callback\n"));
+ for (i = 0; i < MAX_CALLBACK_IDS; i++) {
+ for (j = 0; j < MAX_CALLBACK_SUBIDS; j++) {
+ _callback_lock(i,j, "clear_callback", 1);
+ scp = thecallbacks[i][j];
+ while (scp != NULL) {
+ thecallbacks[i][j] = scp->next;
+ /*
+ * if there is a client arg, check for duplicates
+ * and then free it.
+ */
+ if ((NULL != scp->sc_callback) &&
+ (scp->sc_client_arg != NULL)) {
+ void *tmp_arg;
+ /*
+ * save the client arg, then set it to null so that it
+ * won't look like a duplicate, then check for duplicates
+ * starting at the current i,j (earlier dups should have
+ * already been found) and free the pointer.
+ */
+ tmp_arg = scp->sc_client_arg;
+ scp->sc_client_arg = NULL;
+ DEBUGMSGTL(("9:callback", " freeing %p at [%d,%d]\n", tmp_arg, i, j));
+ (void)netsnmp_callback_clear_client_arg(tmp_arg, i, j);
+ free(tmp_arg);
+ }
+ SNMP_FREE(scp);
+ scp = thecallbacks[i][j];
+ }
+ _callback_unlock(i,j);
+ }
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CALLBACK_LIST
+struct snmp_gen_callback *
+snmp_callback_list(int major, int minor)
+{
+ if (_callback_need_init)
+ init_callbacks();
+
+ return (thecallbacks[major][minor]);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CALLBACK_LIST */
+/** @} */
diff --git a/snmplib/cert_util.c b/snmplib/cert_util.c
new file mode 100644
index 0000000..246a6c9
--- /dev/null
+++ b/snmplib/cert_util.c
@@ -0,0 +1,3367 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#if defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL)
+netsnmp_feature_child_of(cert_util_all, libnetsnmp)
+netsnmp_feature_child_of(cert_util, cert_util_all)
+#ifdef NETSNMP_FEATURE_REQUIRE_CERT_UTIL
+netsnmp_feature_require(container_directory)
+netsnmp_feature_require(container_fifo)
+netsnmp_feature_require(container_dup)
+netsnmp_feature_require(container_free_all)
+netsnmp_feature_require(subcontainer_find)
+
+netsnmp_feature_child_of(cert_map_remove, netsnmp_unused)
+netsnmp_feature_child_of(cert_map_find, netsnmp_unused)
+netsnmp_feature_child_of(tlstmparams_external, cert_util_all)
+netsnmp_feature_child_of(tlstmparams_container, tlstmparams_external)
+netsnmp_feature_child_of(tlstmparams_remove, tlstmparams_external)
+netsnmp_feature_child_of(tlstmparams_find, tlstmparams_external)
+netsnmp_feature_child_of(tlstmAddr_remove, netsnmp_unused)
+netsnmp_feature_child_of(tlstmaddr_external, cert_util_all)
+netsnmp_feature_child_of(tlstmaddr_container, tlstmaddr_external)
+netsnmp_feature_child_of(tlstmAddr_get_serverId, tlstmaddr_external)
+
+netsnmp_feature_child_of(cert_fingerprints, cert_util_all)
+netsnmp_feature_child_of(tls_fingerprint_build, cert_util_all)
+
+#endif /* NETSNMP_FEATURE_REQUIRE_CERT_UTIL */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CERT_UTIL
+
+#include <ctype.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# 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_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_assert.h>
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/system.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/data_list.h>
+#include <net-snmp/library/file_utils.h>
+#include <net-snmp/library/dir_utils.h>
+#include <net-snmp/library/read_config.h>
+
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/x509v3.h>
+#include <net-snmp/library/cert_util.h>
+#include <net-snmp/library/snmp_openssl.h>
+
+#ifndef NAME_MAX
+#define NAME_MAX 255
+#endif
+
+/*
+ * bump this value whenever cert index format changes, so indexes
+ * will be regenerated with new format.
+ */
+#define CERT_INDEX_FORMAT 1
+
+static netsnmp_container *_certs = NULL;
+static netsnmp_container *_keys = NULL;
+static netsnmp_container *_maps = NULL;
+static netsnmp_container *_tlstmParams = NULL;
+static netsnmp_container *_tlstmAddr = NULL;
+static struct snmp_enum_list *_certindexes = NULL;
+
+static netsnmp_container *_trusted_certs = NULL;
+
+static void _setup_containers(void);
+
+static void _cert_indexes_load(void);
+static void _cert_free(netsnmp_cert *cert, void *context);
+static void _key_free(netsnmp_key *key, void *context);
+static int _cert_compare(netsnmp_cert *lhs, netsnmp_cert *rhs);
+static int _cert_sn_compare(netsnmp_cert *lhs, netsnmp_cert *rhs);
+static int _cert_sn_ncompare(netsnmp_cert *lhs, netsnmp_cert *rhs);
+static int _cert_cn_compare(netsnmp_cert *lhs, netsnmp_cert *rhs);
+static int _cert_fn_compare(netsnmp_cert_common *lhs,
+ netsnmp_cert_common *rhs);
+static int _cert_fn_ncompare(netsnmp_cert_common *lhs,
+ netsnmp_cert_common *rhs);
+static void _find_partner(netsnmp_cert *cert, netsnmp_key *key);
+static netsnmp_cert *_find_issuer(netsnmp_cert *cert);
+static netsnmp_void_array *_cert_find_subset_fn(const char *filename,
+ const char *directory);
+static netsnmp_void_array *_cert_find_subset_sn(const char *subject);
+static netsnmp_void_array *_key_find_subset(const char *filename);
+static netsnmp_cert *_cert_find_fp(const char *fingerprint);
+static char *_find_tlstmParams_fingerprint(const char *param);
+static char *_find_tlstmAddr_fingerprint(const char *name);
+static const char *_mode_str(u_char mode);
+static const char *_where_str(u_int what);
+void netsnmp_cert_dump_all(void);
+
+int netsnmp_cert_load_x509(netsnmp_cert *cert);
+
+void netsnmp_cert_free(netsnmp_cert *cert);
+void netsnmp_key_free(netsnmp_key *key);
+
+static int _certindex_add( const char *dirname, int i );
+
+static int _time_filter(netsnmp_file *f, struct stat *idx);
+
+static void _init_tlstmCertToTSN(void);
+#define TRUSTCERT_CONFIG_TOKEN "trustCert"
+static void _parse_trustcert(const char *token, char *line);
+
+static void _init_tlstmParams(void);
+static void _init_tlstmAddr(void);
+
+/** mode descriptions should match up with header */
+static const char _modes[][256] =
+ {
+ "none",
+ "identity",
+ "remote_peer",
+ "identity+remote_peer",
+ "reserved1",
+ "reserved1+identity",
+ "reserved1+remote_peer",
+ "reserved1+identity+remote_peer",
+ "CA",
+ "CA+identity",
+ "CA+remote_peer",
+ "CA+identity+remote_peer",
+ "CA+reserved1",
+ "CA+reserved1+identity",
+ "CA+reserved1+remote_peer",
+ "CA+reserved1+identity+remote_peer",
+ };
+
+/* #####################################################################
+ *
+ * init and shutdown functions
+ *
+ */
+
+void
+_netsnmp_release_trustcerts(void)
+{
+ if (NULL != _trusted_certs) {
+ CONTAINER_FREE_ALL(_trusted_certs, NULL);
+ CONTAINER_FREE(_trusted_certs);
+ _trusted_certs = NULL;
+ }
+}
+
+void
+_setup_trusted_certs(void)
+{
+ _trusted_certs = netsnmp_container_find("trusted_certs:fifo");
+ if (NULL == _trusted_certs) {
+ snmp_log(LOG_ERR, "could not create container for trusted certs\n");
+ netsnmp_certs_shutdown();
+ return;
+ }
+ _trusted_certs->container_name = strdup("trusted certificates");
+ _trusted_certs->free_item = (netsnmp_container_obj_func*) free;
+ _trusted_certs->compare = (netsnmp_container_compare*) strcmp;
+}
+
+/*
+ * secname mapping for servers.
+ */
+void
+netsnmp_certs_agent_init(void)
+{
+ _init_tlstmCertToTSN();
+ _init_tlstmParams();
+ _init_tlstmAddr();
+}
+
+void
+netsnmp_certs_init(void)
+{
+ const char *trustCert_help = TRUSTCERT_CONFIG_TOKEN
+ " FINGERPRINT|FILENAME";
+
+ register_config_handler("snmp", TRUSTCERT_CONFIG_TOKEN,
+ _parse_trustcert, _netsnmp_release_trustcerts,
+ trustCert_help);
+ _setup_containers();
+
+ /** add certificate type mapping */
+ se_add_pair_to_slist("cert_types", strdup("pem"), NS_CERT_TYPE_PEM);
+ se_add_pair_to_slist("cert_types", strdup("crt"), NS_CERT_TYPE_DER);
+ se_add_pair_to_slist("cert_types", strdup("cer"), NS_CERT_TYPE_DER);
+ se_add_pair_to_slist("cert_types", strdup("cert"), NS_CERT_TYPE_DER);
+ se_add_pair_to_slist("cert_types", strdup("der"), NS_CERT_TYPE_DER);
+ se_add_pair_to_slist("cert_types", strdup("key"), NS_CERT_TYPE_KEY);
+ se_add_pair_to_slist("cert_types", strdup("private"), NS_CERT_TYPE_KEY);
+
+ /** hash algs */
+ se_add_pair_to_slist("cert_hash_alg", strdup("sha1"), NS_HASH_SHA1);
+ se_add_pair_to_slist("cert_hash_alg", strdup("md5"), NS_HASH_MD5);
+ se_add_pair_to_slist("cert_hash_alg", strdup("sha224"), NS_HASH_SHA224);
+ se_add_pair_to_slist("cert_hash_alg", strdup("sha256"), NS_HASH_SHA256);
+ se_add_pair_to_slist("cert_hash_alg", strdup("sha384"), NS_HASH_SHA384);
+ se_add_pair_to_slist("cert_hash_alg", strdup("sha512"), NS_HASH_SHA512);
+
+ /** map types */
+ se_add_pair_to_slist("cert_map_type", strdup("cn"),
+ TSNM_tlstmCertCommonName);
+ se_add_pair_to_slist("cert_map_type", strdup("ip"),
+ TSNM_tlstmCertSANIpAddress);
+ se_add_pair_to_slist("cert_map_type", strdup("rfc822"),
+ TSNM_tlstmCertSANRFC822Name);
+ se_add_pair_to_slist("cert_map_type", strdup("dns"),
+ TSNM_tlstmCertSANDNSName);
+ se_add_pair_to_slist("cert_map_type", strdup("any"), TSNM_tlstmCertSANAny);
+ se_add_pair_to_slist("cert_map_type", strdup("sn"),
+ TSNM_tlstmCertSpecified);
+
+}
+
+void
+netsnmp_certs_shutdown(void)
+{
+ DEBUGMSGT(("cert:util:shutdown","shutdown\n"));
+ if (_maps) {
+ CONTAINER_FREE_ALL(_maps, NULL);
+ CONTAINER_FREE(_maps);
+ _maps = NULL;
+ }
+ if (NULL != _certs) {
+ CONTAINER_FREE_ALL(_certs, NULL);
+ CONTAINER_FREE(_certs);
+ _certs = NULL;
+ }
+ if (NULL != _keys) {
+ CONTAINER_FREE_ALL(_keys, NULL);
+ CONTAINER_FREE(_keys);
+ _keys = NULL;
+ }
+ _netsnmp_release_trustcerts();
+}
+
+void
+netsnmp_certs_load(void)
+{
+ netsnmp_iterator *itr;
+ netsnmp_key *key;
+ netsnmp_cert *cert;
+
+ DEBUGMSGT(("cert:util:init","init\n"));
+
+ if (NULL == _certs) {
+ snmp_log(LOG_ERR, "cant load certs without container\n");
+ return;
+ }
+
+ if (CONTAINER_SIZE(_certs) != 0) {
+ DEBUGMSGT(("cert:util:init", "ignoring duplicate init\n"));
+ return;
+ }
+
+ netsnmp_init_openssl();
+
+ /** scan config dirs for certs */
+ _cert_indexes_load();
+
+ /** match up keys w/certs */
+ itr = CONTAINER_ITERATOR(_keys);
+ if (NULL == itr) {
+ snmp_log(LOG_ERR, "could not get iterator for keys\n");
+ netsnmp_certs_shutdown();
+ return;
+ }
+ key = ITERATOR_FIRST(itr);
+ for( ; key; key = ITERATOR_NEXT(itr))
+ _find_partner(NULL, key);
+ ITERATOR_RELEASE(itr);
+
+ DEBUGIF("cert:dump") {
+ itr = CONTAINER_ITERATOR(_certs);
+ if (NULL == itr) {
+ snmp_log(LOG_ERR, "could not get iterator for certs\n");
+ netsnmp_certs_shutdown();
+ return;
+ }
+ cert = ITERATOR_FIRST(itr);
+ for( ; cert; cert = ITERATOR_NEXT(itr)) {
+ netsnmp_cert_load_x509(cert);
+ }
+ ITERATOR_RELEASE(itr);
+ DEBUGMSGT(("cert:dump",
+ "-------------------- Certificates -----------------\n"));
+ netsnmp_cert_dump_all();
+ DEBUGMSGT(("cert:dump",
+ "------------------------ End ----------------------\n"));
+ }
+}
+
+/* #####################################################################
+ *
+ * cert container functions
+ */
+
+static netsnmp_container *
+_get_cert_container(const char *use)
+{
+ netsnmp_container *c;
+
+ c = netsnmp_container_find("certs:binary_array");
+ if (NULL == c) {
+ snmp_log(LOG_ERR, "could not create container for %s\n", use);
+ return NULL;
+ }
+ c->container_name = strdup(use);
+ c->free_item = (netsnmp_container_obj_func*)_cert_free;
+ c->compare = (netsnmp_container_compare*)_cert_compare;
+
+ return c;
+}
+
+static void
+_setup_containers(void)
+{
+ netsnmp_container *additional_keys;
+
+ _certs = _get_cert_container("netsnmp certificates");
+ if (NULL == _certs)
+ return;
+
+ /** additional keys: common name */
+ additional_keys = netsnmp_container_find("certs_cn:binary_array");
+ if (NULL == additional_keys) {
+ snmp_log(LOG_ERR, "could not create CN container for certificates\n");
+ netsnmp_certs_shutdown();
+ return;
+ }
+ additional_keys->container_name = strdup("certs_cn");
+ additional_keys->free_item = NULL;
+ additional_keys->compare = (netsnmp_container_compare*)_cert_cn_compare;
+ netsnmp_container_add_index(_certs, additional_keys);
+
+ /** additional keys: subject name */
+ additional_keys = netsnmp_container_find("certs_sn:binary_array");
+ if (NULL == additional_keys) {
+ snmp_log(LOG_ERR, "could not create SN container for certificates\n");
+ netsnmp_certs_shutdown();
+ return;
+ }
+ additional_keys->container_name = strdup("certs_sn");
+ additional_keys->free_item = NULL;
+ additional_keys->compare = (netsnmp_container_compare*)_cert_sn_compare;
+ additional_keys->ncompare = (netsnmp_container_compare*)_cert_sn_ncompare;
+ netsnmp_container_add_index(_certs, additional_keys);
+
+ /** additional keys: file name */
+ additional_keys = netsnmp_container_find("certs_fn:binary_array");
+ if (NULL == additional_keys) {
+ snmp_log(LOG_ERR, "could not create FN container for certificates\n");
+ netsnmp_certs_shutdown();
+ return;
+ }
+ additional_keys->container_name = strdup("certs_fn");
+ additional_keys->free_item = NULL;
+ additional_keys->compare = (netsnmp_container_compare*)_cert_fn_compare;
+ additional_keys->ncompare = (netsnmp_container_compare*)_cert_fn_ncompare;
+ netsnmp_container_add_index(_certs, additional_keys);
+
+ _keys = netsnmp_container_find("cert_keys:binary_array");
+ if (NULL == _keys) {
+ snmp_log(LOG_ERR, "could not create container for certificate keys\n");
+ netsnmp_certs_shutdown();
+ return;
+ }
+ _keys->container_name = strdup("netsnmp certificate keys");
+ _keys->free_item = (netsnmp_container_obj_func*)_key_free;
+ _keys->compare = (netsnmp_container_compare*)_cert_fn_compare;
+
+ _setup_trusted_certs();
+}
+
+netsnmp_container *
+netsnmp_cert_map_container(void)
+{
+ return _maps;
+}
+
+static netsnmp_cert *
+_new_cert(const char *dirname, const char *filename, int certType,
+ int hashType, const char *fingerprint, const char *common_name,
+ const char *subject)
+{
+ netsnmp_cert *cert;
+
+ if ((NULL == dirname) || (NULL == filename)) {
+ snmp_log(LOG_ERR, "bad parameters to _new_cert\n");
+ return NULL;
+ }
+
+ cert = SNMP_MALLOC_TYPEDEF(netsnmp_cert);
+ if (NULL == cert) {
+ snmp_log(LOG_ERR,"could not allocate memory for certificate at %s/%s\n",
+ dirname, filename);
+ return NULL;
+ }
+
+ DEBUGMSGT(("9:cert:struct:new","new cert 0x%#lx for %s\n", (u_long)cert,
+ filename));
+
+ cert->info.dir = strdup(dirname);
+ cert->info.filename = strdup(filename);
+ cert->info.allowed_uses = NS_CERT_REMOTE_PEER;
+ cert->info.type = certType;
+ if (fingerprint) {
+ cert->hash_type = hashType;
+ cert->fingerprint = strdup(fingerprint);
+ }
+ if (common_name)
+ cert->common_name = strdup(common_name);
+ if (subject)
+ cert->subject = strdup(subject);
+
+ return cert;
+}
+
+static netsnmp_key *
+_new_key(const char *dirname, const char *filename)
+{
+ netsnmp_key *key;
+ struct stat fstat;
+ char fn[SNMP_MAXPATH];
+
+ if ((NULL == dirname) || (NULL == filename)) {
+ snmp_log(LOG_ERR, "bad parameters to _new_key\n");
+ return NULL;
+ }
+
+ /** check file permissions */
+ snprintf(fn, sizeof(fn), "%s/%s", dirname, filename);
+ if (stat(fn, &fstat) != 0) {
+ snmp_log(LOG_ERR, "could not stat %s\n", fn);
+ return NULL;
+ }
+
+ if ((fstat.st_mode & S_IROTH) || (fstat.st_mode & S_IROTH)) {
+ snmp_log(LOG_ERR,
+ "refusing to read world readable or writable key %s\n", fn);
+ return NULL;
+ }
+
+ key = SNMP_MALLOC_TYPEDEF(netsnmp_key);
+ if (NULL == key) {
+ snmp_log(LOG_ERR, "could not allocate memory for key at %s/%s\n",
+ dirname, filename);
+ return NULL;
+ }
+
+ DEBUGMSGT(("cert:key:struct:new","new key 0x%#lx for %s\n", (u_long)key,
+ filename));
+
+ key->info.type = NS_CERT_TYPE_KEY;
+ key->info.dir = strdup(dirname);
+ key->info.filename = strdup(filename);
+ key->info.allowed_uses = NS_CERT_IDENTITY;
+
+ return key;
+}
+
+void
+netsnmp_cert_free(netsnmp_cert *cert)
+{
+ if (NULL == cert)
+ return;
+
+ DEBUGMSGT(("9:cert:struct:free","freeing cert 0x%#lx, %s (fp %s; CN %s)\n",
+ (u_long)cert, cert->info.filename ? cert->info.filename : "UNK",
+ cert->fingerprint ? cert->fingerprint : "UNK",
+ cert->common_name ? cert->common_name : "UNK"));
+
+ SNMP_FREE(cert->info.dir);
+ SNMP_FREE(cert->info.filename);
+ SNMP_FREE(cert->subject);
+ SNMP_FREE(cert->issuer);
+ SNMP_FREE(cert->fingerprint);
+ SNMP_FREE(cert->common_name);
+ if (cert->ocert)
+ X509_free(cert->ocert);
+ if (cert->key && cert->key->cert == cert)
+ cert->key->cert = NULL;
+
+ free(cert); /* SNMP_FREE not needed on parameters */
+}
+
+void
+netsnmp_key_free(netsnmp_key *key)
+{
+ if (NULL == key)
+ return;
+
+ DEBUGMSGT(("cert:key:struct:free","freeing key 0x%#lx, %s\n",
+ (u_long)key, key->info.filename ? key->info.filename : "UNK"));
+
+ SNMP_FREE(key->info.dir);
+ SNMP_FREE(key->info.filename);
+ EVP_PKEY_free(key->okey);
+ if (key->cert && key->cert->key == key)
+ key->cert->key = NULL;
+
+ free(key); /* SNMP_FREE not needed on parameters */
+}
+
+static void
+_cert_free(netsnmp_cert *cert, void *context)
+{
+ netsnmp_cert_free(cert);
+}
+
+static void
+_key_free(netsnmp_key *key, void *context)
+{
+ netsnmp_key_free(key);
+}
+
+static int
+_cert_compare(netsnmp_cert *lhs, netsnmp_cert *rhs)
+{
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+ netsnmp_assert((lhs->fingerprint != NULL) &&
+ (rhs->fingerprint != NULL));
+
+ /** ignore hash type? */
+ return strcmp(lhs->fingerprint, rhs->fingerprint);
+}
+
+static int
+_cert_path_compare(netsnmp_cert_common *lhs, netsnmp_cert_common *rhs)
+{
+ int rc;
+
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+
+ /** dir name first */
+ rc = strcmp(lhs->dir, rhs->dir);
+ if (rc)
+ return rc;
+
+ /** filename */
+ return strcmp(lhs->filename, rhs->filename);
+}
+
+static int
+_cert_cn_compare(netsnmp_cert *lhs, netsnmp_cert *rhs)
+{
+ int rc;
+ const char *lhcn, *rhcn;
+
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+
+ if (NULL == lhs->common_name)
+ lhcn = "";
+ else
+ lhcn = lhs->common_name;
+ if (NULL == rhs->common_name)
+ rhcn = "";
+ else
+ rhcn = rhs->common_name;
+
+ rc = strcmp(lhcn, rhcn);
+ if (rc)
+ return rc;
+
+ /** in case of equal common names, sub-sort by path */
+ return _cert_path_compare((netsnmp_cert_common*)lhs,
+ (netsnmp_cert_common*)rhs);
+}
+
+static int
+_cert_sn_compare(netsnmp_cert *lhs, netsnmp_cert *rhs)
+{
+ int rc;
+ const char *lhsn, *rhsn;
+
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+
+ if (NULL == lhs->subject)
+ lhsn = "";
+ else
+ lhsn = lhs->subject;
+ if (NULL == rhs->subject)
+ rhsn = "";
+ else
+ rhsn = rhs->subject;
+
+ rc = strcmp(lhsn, rhsn);
+ if (rc)
+ return rc;
+
+ /** in case of equal common names, sub-sort by path */
+ return _cert_path_compare((netsnmp_cert_common*)lhs,
+ (netsnmp_cert_common*)rhs);
+}
+
+static int
+_cert_fn_compare(netsnmp_cert_common *lhs, netsnmp_cert_common *rhs)
+{
+ int rc;
+
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+
+ rc = strcmp(lhs->filename, rhs->filename);
+ if (rc)
+ return rc;
+
+ /** in case of equal common names, sub-sort by dir */
+ return strcmp(lhs->dir, rhs->dir);
+}
+
+static int
+_cert_fn_ncompare(netsnmp_cert_common *lhs, netsnmp_cert_common *rhs)
+{
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+ netsnmp_assert((lhs->filename != NULL) && (rhs->filename != NULL));
+
+ return strncmp(lhs->filename, rhs->filename, strlen(rhs->filename));
+}
+
+static int
+_cert_sn_ncompare(netsnmp_cert *lhs, netsnmp_cert *rhs)
+{
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+ netsnmp_assert((lhs->subject != NULL) && (rhs->subject != NULL));
+
+ return strncmp(lhs->subject, rhs->subject, strlen(rhs->subject));
+}
+
+static int
+_cert_ext_type(const char *ext)
+{
+ int rc = se_find_value_in_slist("cert_types", ext);
+ if (SE_DNE == rc)
+ return NS_CERT_TYPE_UNKNOWN;
+ return rc;
+}
+
+static int
+_type_from_filename(const char *filename)
+{
+ char *pos;
+ int type;
+
+ if (NULL == filename)
+ return NS_CERT_TYPE_UNKNOWN;
+
+ pos = strrchr(filename, '.');
+ if (NULL == pos)
+ return NS_CERT_TYPE_UNKNOWN;
+
+ type = _cert_ext_type(++pos);
+ return type;
+}
+
+/*
+ * filter functions; return 1 to include file, 0 to exclude
+ */
+static int
+_cert_cert_filter(const char *filename)
+{
+ int len = strlen(filename);
+ const char *pos;
+
+ if (len < 5) /* shortest name: x.YYY */
+ return 0;
+
+ pos = strrchr(filename, '.');
+ if (NULL == pos)
+ return 0;
+
+ if (_cert_ext_type(++pos) != NS_CERT_TYPE_UNKNOWN)
+ return 1;
+
+ return 0;
+}
+
+/* #####################################################################
+ *
+ * cert index functions
+ *
+ * This code mimics what the mib index code does. The persistent
+ * directory will have a subdirectory named 'cert_indexes'. Inside
+ * this directory will be some number of files with ascii numeric
+ * names (0, 1, 2, etc). Each of these files will start with a line
+ * with the text "DIR ", followed by a directory name. The rest of the
+ * file will be certificate fields and the certificate file name, one
+ * certificate per line. The numeric file name is the integer 'directory
+ * index'.
+ */
+
+/**
+ * _certindex_add
+ *
+ * add a directory name to the indexes
+ */
+static int
+_certindex_add( const char *dirname, int i )
+{
+ int rc;
+ char *dirname_copy = strdup(dirname);
+
+ if ( i == -1 ) {
+ int max = se_find_free_value_in_list(_certindexes);
+ if (SE_DNE == max)
+ i = 0;
+ else
+ i = max;
+ }
+
+ DEBUGMSGT(("cert:index:add","dir %s at index %d\n", dirname, i ));
+ rc = se_add_pair_to_list(&_certindexes, dirname_copy, i);
+ if (SE_OK != rc) {
+ snmp_log(LOG_ERR, "adding certindex dirname failed; "
+ "%d (%s) not added\n", i, dirname);
+ return -1;
+ }
+
+ return i;
+}
+
+/**
+ * _certindex_load
+ *
+ * read in the existing indexes
+ */
+static void
+_certindexes_load( void )
+{
+ DIR *dir;
+ struct dirent *file;
+ FILE *fp;
+ char filename[SNMP_MAXPATH], line[300];
+ int i;
+ char *cp, *pos;
+
+ /*
+ * Open the CERT index directory, or create it (empty)
+ */
+ snprintf( filename, sizeof(filename), "%s/cert_indexes",
+ get_persistent_directory());
+ filename[sizeof(filename)-1] = 0;
+ dir = opendir( filename );
+ if ( dir == NULL ) {
+ DEBUGMSGT(("cert:index:load",
+ "creating new cert_indexes directory\n"));
+ mkdirhier( filename, NETSNMP_AGENT_DIRECTORY_MODE, 0);
+ return;
+ }
+
+ /*
+ * Create a list of which directory each file refers to
+ */
+ while ((file = readdir( dir ))) {
+ if ( !isdigit(0xFF & file->d_name[0]))
+ continue;
+ i = atoi( file->d_name );
+
+ snprintf( filename, sizeof(filename), "%s/cert_indexes/%d",
+ get_persistent_directory(), i );
+ filename[sizeof(filename)-1] = 0;
+ fp = fopen( filename, "r" );
+ if ( !fp ) {
+ DEBUGMSGT(("cert:index:load", "error opening index (%d)\n", i));
+ continue;
+ }
+ cp = fgets( line, sizeof(line), fp );
+ if ( cp ) {
+ line[strlen(line)-1] = 0;
+ pos = strrchr(line, ' ');
+ if (pos)
+ *pos = '\0';
+ DEBUGMSGT(("9:cert:index:load","adding (%d) %s\n", i, line));
+ (void)_certindex_add( line+4, i ); /* Skip 'DIR ' */
+ } else {
+ DEBUGMSGT(("cert:index:load", "Empty index (%d)\n", i));
+ }
+ fclose( fp );
+ }
+ closedir( dir );
+}
+
+/**
+ * _certindex_lookup
+ *
+ * find index for a directory
+ */
+static char *
+_certindex_lookup( const char *dirname )
+{
+ int i;
+ char filename[SNMP_MAXPATH];
+
+
+ i = se_find_value_in_list(_certindexes, dirname);
+ if (SE_DNE == i) {
+ DEBUGMSGT(("9:cert:index:lookup","%s : (none)\n", dirname));
+ return NULL;
+ }
+
+ snprintf(filename, sizeof(filename), "%s/cert_indexes/%d",
+ get_persistent_directory(), i);
+ filename[sizeof(filename)-1] = 0;
+ DEBUGMSGT(("cert:index:lookup", "%s (%d) %s\n", dirname, i, filename ));
+ return strdup(filename);
+}
+
+static FILE *
+_certindex_new( const char *dirname )
+{
+ FILE *fp;
+ char filename[SNMP_MAXPATH], *cp;
+ int i;
+
+ cp = _certindex_lookup( dirname );
+ if (!cp) {
+ i = _certindex_add( dirname, -1 );
+ if (-1 == i)
+ return NULL; /* msg already logged */
+ snprintf( filename, sizeof(filename), "%s/cert_indexes/%d",
+ get_persistent_directory(), i );
+ filename[sizeof(filename)-1] = 0;
+ cp = filename;
+ }
+ DEBUGMSGT(("9:cert:index:new", "%s (%s)\n", dirname, cp ));
+ fp = fopen( cp, "w" );
+ if (fp)
+ fprintf( fp, "DIR %s %d\n", dirname, CERT_INDEX_FORMAT );
+ else
+ DEBUGMSGTL(("cert:index", "error opening new index file %s\n", dirname));
+
+ if (cp != filename)
+ free(cp);
+
+ return fp;
+}
+
+/* #####################################################################
+ *
+ * certificate utility functions
+ *
+ */
+static X509 *
+netsnmp_ocert_get(netsnmp_cert *cert)
+{
+ BIO *certbio;
+ X509 *ocert = NULL;
+ EVP_PKEY *okey = NULL;
+ char file[SNMP_MAXPATH];
+ int is_ca;
+
+ if (NULL == cert)
+ return NULL;
+
+ if (cert->ocert)
+ return cert->ocert;
+
+ if (NS_CERT_TYPE_UNKNOWN == cert->info.type) {
+ cert->info.type = _type_from_filename(cert->info.filename);
+ if (NS_CERT_TYPE_UNKNOWN == cert->info.type) {
+ snmp_log(LOG_ERR, "unknown certificate type %d for %s\n",
+ cert->info.type, cert->info.filename);
+ return NULL;
+ }
+ }
+
+ DEBUGMSGT(("9:cert:read", "Checking file %s\n", cert->info.filename));
+
+ certbio = BIO_new(BIO_s_file());
+ if (NULL == certbio) {
+ snmp_log(LOG_ERR, "error creating BIO\n");
+ return NULL;
+ }
+
+ snprintf(file, sizeof(file),"%s/%s", cert->info.dir, cert->info.filename);
+ if (BIO_read_filename(certbio, file) <=0) {
+ snmp_log(LOG_ERR, "error reading certificate %s into BIO\n", file);
+ BIO_vfree(certbio);
+ return NULL;
+ }
+
+ if (NS_CERT_TYPE_UNKNOWN == cert->info.type) {
+ char *pos = strrchr(cert->info.filename, '.');
+ if (NULL == pos)
+ return NULL;
+ cert->info.type = _cert_ext_type(++pos);
+ netsnmp_assert(cert->info.type != NS_CERT_TYPE_UNKNOWN);
+ }
+
+ switch (cert->info.type) {
+
+ case NS_CERT_TYPE_DER:
+ ocert = d2i_X509_bio(certbio,NULL); /* DER/ASN1 */
+ if (NULL != ocert)
+ break;
+ (void)BIO_reset(certbio);
+ /** FALLTHROUGH: check for PEM if DER didn't work */
+
+ case NS_CERT_TYPE_PEM:
+ ocert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL);
+ if (NULL == ocert)
+ break;
+ if (NS_CERT_TYPE_DER == cert->info.type) {
+ DEBUGMSGT(("9:cert:read", "Changing type from DER to PEM\n"));
+ cert->info.type = NS_CERT_TYPE_PEM;
+ }
+ /** check for private key too */
+ if (NULL == cert->key) {
+ (void)BIO_reset(certbio);
+ okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL);
+ if (NULL != okey) {
+ netsnmp_key *key;
+ DEBUGMSGT(("cert:read:key", "found key with cert in %s\n",
+ cert->info.filename));
+ key = _new_key(cert->info.dir, cert->info.filename);
+ if (NULL != key) {
+ key->okey = okey;
+ if (-1 == CONTAINER_INSERT(_keys, key)) {
+ DEBUGMSGT(("cert:read:key:add",
+ "error inserting key into container\n"));
+ netsnmp_key_free(key);
+ key = NULL;
+ }
+ else {
+ DEBUGMSGT(("cert:read:partner", "%s match found!\n",
+ cert->info.filename));
+ key->cert = cert;
+ cert->key = key;
+ cert->info.allowed_uses |= NS_CERT_IDENTITY;
+ }
+ }
+ } /* null return from read */
+ } /* null key */
+ break;
+#ifdef CERT_PKCS12_SUPPORT_MAYBE_LATER
+ case NS_CERT_TYPE_PKCS12:
+ (void)BIO_reset(certbio);
+ PKCS12 *p12 = d2i_PKCS12_bio(certbio, NULL);
+ if ( (NULL != p12) && (PKCS12_verify_mac(p12, "", 0) ||
+ PKCS12_verify_mac(p12, NULL, 0)))
+ PKCS12_parse(p12, "", NULL, &cert, NULL);
+ break;
+#endif
+ default:
+ snmp_log(LOG_ERR, "unknown certificate type %d for %s\n",
+ cert->info.type, cert->info.filename);
+ }
+
+ BIO_vfree(certbio);
+
+ if (NULL == ocert) {
+ snmp_log(LOG_ERR, "error parsing certificate file %s\n",
+ cert->info.filename);
+ return NULL;
+ }
+
+ cert->ocert = ocert;
+ /*
+ * X509_check_ca return codes:
+ * 0 not a CA
+ * 1 is a CA
+ * 2 basicConstraints absent so "maybe" a CA
+ * 3 basicConstraints absent but self signed V1.
+ * 4 basicConstraints absent but keyUsage present and keyCertSign asserted.
+ * 5 outdated Netscape Certificate Type CA extension.
+ */
+ is_ca = X509_check_ca(ocert);
+ if (1 == is_ca)
+ cert->info.allowed_uses |= NS_CERT_CA;
+
+ if (NULL == cert->subject) {
+ cert->subject = X509_NAME_oneline(X509_get_subject_name(ocert), NULL,
+ 0);
+ DEBUGMSGT(("9:cert:add:subject", "subject name: %s\n", cert->subject));
+ }
+
+ if (NULL == cert->issuer) {
+ cert->issuer = X509_NAME_oneline(X509_get_issuer_name(ocert), NULL, 0);
+ if (strcmp(cert->subject, cert->issuer) == 0) {
+ free(cert->issuer);
+ cert->issuer = strdup("self-signed");
+ }
+ DEBUGMSGT(("9:cert:add:issuer", "CA issuer: %s\n", cert->issuer));
+ }
+
+ if (NULL == cert->fingerprint) {
+ cert->hash_type = netsnmp_openssl_cert_get_hash_type(ocert);
+ cert->fingerprint =
+ netsnmp_openssl_cert_get_fingerprint(ocert, cert->hash_type);
+ }
+
+ if (NULL == cert->common_name) {
+ cert->common_name =netsnmp_openssl_cert_get_commonName(ocert, NULL,
+ NULL);
+ DEBUGMSGT(("9:cert:add:name","%s\n", cert->common_name));
+ }
+
+ return ocert;
+}
+
+EVP_PKEY *
+netsnmp_okey_get(netsnmp_key *key)
+{
+ BIO *keybio;
+ EVP_PKEY *okey;
+ char file[SNMP_MAXPATH];
+
+ if (NULL == key)
+ return NULL;
+
+ if (key->okey)
+ return key->okey;
+
+ snprintf(file, sizeof(file),"%s/%s", key->info.dir, key->info.filename);
+ DEBUGMSGT(("cert:key:read", "Checking file %s\n", key->info.filename));
+
+ keybio = BIO_new(BIO_s_file());
+ if (NULL == keybio) {
+ snmp_log(LOG_ERR, "error creating BIO\n");
+ return NULL;
+ }
+
+ if (BIO_read_filename(keybio, file) <=0) {
+ snmp_log(LOG_ERR, "error reading certificate %s into BIO\n",
+ key->info.filename);
+ BIO_vfree(keybio);
+ return NULL;
+ }
+
+ okey = PEM_read_bio_PrivateKey(keybio, NULL, NULL, NULL);
+ if (NULL == okey)
+ snmp_log(LOG_ERR, "error parsing certificate file %s\n",
+ key->info.filename);
+ else
+ key->okey = okey;
+
+ BIO_vfree(keybio);
+
+ return okey;
+}
+
+static netsnmp_cert *
+_find_issuer(netsnmp_cert *cert)
+{
+ netsnmp_void_array *matching;
+ netsnmp_cert *candidate, *issuer = NULL;
+ int i;
+
+ if ((NULL == cert) || (NULL == cert->issuer))
+ return NULL;
+
+ /** find matching subject names */
+
+ matching = _cert_find_subset_sn(cert->issuer);
+ if (NULL == matching)
+ return NULL;
+
+ /** check each to see if it's the issuer */
+ for ( i=0; (NULL == issuer) && (i < matching->size); ++i) {
+ /** make sure we have ocert */
+ candidate = (netsnmp_cert*)matching->array[i];
+ if ((NULL == candidate->ocert) &&
+ (netsnmp_ocert_get(candidate) == NULL))
+ continue;
+
+ /** compare **/
+ if (netsnmp_openssl_cert_issued_by(candidate->ocert, cert->ocert))
+ issuer = candidate;
+ } /** candidate loop */
+
+ free(matching->array);
+ free(matching);
+
+ return issuer;
+}
+
+#define CERT_LOAD_OK 0
+#define CERT_LOAD_ERR -1
+#define CERT_LOAD_PARTIAL -2
+int
+netsnmp_cert_load_x509(netsnmp_cert *cert)
+{
+ int rc = CERT_LOAD_OK;
+
+ /** load ocert */
+ if ((NULL == cert->ocert) && (netsnmp_ocert_get(cert) == NULL)) {
+ DEBUGMSGT(("cert:load:err", "couldn't load cert for %s\n",
+ cert->info.filename));
+ rc = CERT_LOAD_ERR;
+ }
+
+ /** load key */
+ if ((NULL != cert->key) && (NULL == cert->key->okey) &&
+ (netsnmp_okey_get(cert->key) == NULL)) {
+ DEBUGMSGT(("cert:load:err", "couldn't load key for cert %s\n",
+ cert->info.filename));
+ rc = CERT_LOAD_ERR;
+ }
+
+ /** make sure we have cert chain */
+ for (; cert && cert->issuer; cert = cert->issuer_cert) {
+ /** skip self signed */
+ if (strcmp(cert->issuer, "self-signed") == 0) {
+ netsnmp_assert(cert->issuer_cert == NULL);
+ break;
+ }
+ /** get issuer cert */
+ if (NULL == cert->issuer_cert) {
+ cert->issuer_cert = _find_issuer(cert);
+ if (NULL == cert->issuer_cert) {
+ DEBUGMSGT(("cert:load:warn",
+ "couldn't load CA chain for cert %s\n",
+ cert->info.filename));
+ rc = CERT_LOAD_PARTIAL;
+ break;
+ }
+ }
+ /** get issuer ocert */
+ if ((NULL == cert->issuer_cert->ocert) &&
+ (netsnmp_ocert_get(cert->issuer_cert) == NULL)) {
+ DEBUGMSGT(("cert:load:warn", "couldn't load cert chain for %s\n",
+ cert->info.filename));
+ rc = CERT_LOAD_PARTIAL;
+ break;
+ }
+ } /* cert CA for loop */
+
+ return rc;
+}
+
+static void
+_find_partner(netsnmp_cert *cert, netsnmp_key *key)
+{
+ netsnmp_void_array *matching = NULL;
+ char filename[NAME_MAX], *pos;
+
+ if ((cert && key) || (!cert && ! key)) {
+ DEBUGMSGT(("cert:partner", "bad parameters searching for partner\n"));
+ return;
+ }
+
+ if(key) {
+ if (key->cert) {
+ DEBUGMSGT(("cert:partner", "key already has partner\n"));
+ return;
+ }
+ DEBUGMSGT(("9:cert:partner", "%s looking for partner near %s\n",
+ key->info.filename, key->info.dir));
+ snprintf(filename, sizeof(filename), "%s", key->info.filename);
+ pos = strrchr(filename, '.');
+ if (NULL == pos)
+ return;
+ *pos = 0;
+
+ matching = _cert_find_subset_fn( filename, key->info.dir );
+ if (!matching)
+ return;
+ if (1 == matching->size) {
+ cert = (netsnmp_cert*)matching->array[0];
+ if (NULL == cert->key) {
+ DEBUGMSGT(("cert:partner", "%s match found!\n",
+ cert->info.filename));
+ key->cert = cert;
+ cert->key = key;
+ cert->info.allowed_uses |= NS_CERT_IDENTITY;
+ }
+ else if (cert->key != key)
+ snmp_log(LOG_ERR, "%s matching cert already has partner\n",
+ cert->info.filename);
+ }
+ else
+ DEBUGMSGT(("cert:partner", "%s matches multiple certs\n",
+ key->info.filename));
+ }
+ else if(cert) {
+ if (cert->key) {
+ DEBUGMSGT(("cert:partner", "cert already has partner\n"));
+ return;
+ }
+ DEBUGMSGT(("9:cert:partner", "%s looking for partner\n",
+ cert->info.filename));
+ snprintf(filename, sizeof(filename), "%s", cert->info.filename);
+ pos = strrchr(filename, '.');
+ if (NULL == pos)
+ return;
+ *pos = 0;
+
+ matching = _key_find_subset(filename);
+ if (!matching)
+ return;
+ if (1 == matching->size) {
+ key = (netsnmp_key*)matching->array[0];
+ if (NULL == key->cert) {
+ DEBUGMSGT(("cert:partner", "%s found!\n", cert->info.filename));
+ key->cert = cert;
+ cert->key = key;
+ }
+ else if (key->cert != cert)
+ snmp_log(LOG_ERR, "%s matching key already has partner\n",
+ cert->info.filename);
+ }
+ else
+ DEBUGMSGT(("cert:partner", "%s matches multiple keys\n",
+ cert->info.filename));
+ }
+
+ if (matching) {
+ free(matching->array);
+ free(matching);
+ }
+}
+
+static int
+_add_certfile(const char* dirname, const char* filename, FILE *index)
+{
+ X509 *ocert;
+ EVP_PKEY *okey;
+ netsnmp_cert *cert = NULL;
+ netsnmp_key *key = NULL;
+ char certfile[SNMP_MAXPATH];
+ int type;
+
+ if (((const void*)NULL == dirname) || (NULL == filename))
+ return -1;
+
+ type = _type_from_filename(filename);
+ netsnmp_assert(type != NS_CERT_TYPE_UNKNOWN);
+
+ snprintf(certfile, sizeof(certfile),"%s/%s", dirname, filename);
+
+ DEBUGMSGT(("9:cert:file:add", "Checking file: %s (type %d)\n", filename,
+ type));
+
+ if (NS_CERT_TYPE_KEY == type) {
+ key = _new_key(dirname, filename);
+ if (NULL == key)
+ return -1;
+ okey = netsnmp_okey_get(key);
+ if (NULL == okey) {
+ netsnmp_key_free(key);
+ return -1;
+ }
+ key->okey = okey;
+ if (-1 == CONTAINER_INSERT(_keys, key)) {
+ DEBUGMSGT(("cert:key:file:add:err",
+ "error inserting key into container\n"));
+ netsnmp_key_free(key);
+ key = NULL;
+ }
+ }
+ else {
+ cert = _new_cert(dirname, filename, type, -1, NULL, NULL, NULL);
+ if (NULL == cert)
+ return -1;
+ ocert = netsnmp_ocert_get(cert);
+ if (NULL == ocert) {
+ netsnmp_cert_free(cert);
+ return -1;
+ }
+ cert->ocert = ocert;
+ if (-1 == CONTAINER_INSERT(_certs, cert)) {
+ DEBUGMSGT(("cert:file:add:err",
+ "error inserting cert into container\n"));
+ netsnmp_cert_free(cert);
+ cert = NULL;
+ }
+ }
+ if ((NULL == cert) && (NULL == key)) {
+ DEBUGMSGT(("cert:file:add:failure", "for %s\n", certfile));
+ return -1;
+ }
+
+ if (index) {
+ /** filename = NAME_MAX = 255 */
+ /** fingerprint = 60 */
+ /** common name / CN = 64 */
+ if (cert)
+ fprintf(index, "c:%s %d %d %s '%s' '%s'\n", filename,
+ cert->info.type, cert->hash_type, cert->fingerprint,
+ cert->common_name, cert->subject);
+ else if (key)
+ fprintf(index, "k:%s\n", filename);
+ }
+
+ return 0;
+}
+
+static int
+_cert_read_index(const char *dirname, struct stat *dirstat)
+{
+ FILE *index;
+ char *idxname, *pos;
+ struct stat idx_stat;
+ char tmpstr[SNMP_MAXPATH + 5], filename[NAME_MAX];
+ char fingerprint[60+1], common_name[64+1], type_str[15];
+ char subject[SNMP_MAXBUF_SMALL], hash_str[15];
+ int count = 0, type, hash, version;
+ netsnmp_cert *cert;
+ netsnmp_key *key;
+ netsnmp_container *newer, *found;
+
+ netsnmp_assert(NULL != dirname);
+
+ idxname = _certindex_lookup( dirname );
+ if (NULL == idxname) {
+ DEBUGMSGT(("cert:index:parse", "no index for cert directory\n"));
+ return -1;
+ }
+
+ /*
+ * see if directory has been modified more recently than the index
+ */
+ if (stat(idxname, &idx_stat) != 0) {
+ DEBUGMSGT(("cert:index:parse", "error getting index file stats\n"));
+ SNMP_FREE(idxname);
+ return -1;
+ }
+
+#if (defined(WIN32) || defined(cygwin))
+ /* For Win32 platforms, the directory does not maintain a last modification
+ * date that we can compare with the modification date of the .index file.
+ */
+#else
+ if (dirstat->st_mtime >= idx_stat.st_mtime) {
+ DEBUGMSGT(("cert:index:parse", "Index outdated; dir modified\n"));
+ SNMP_FREE(idxname);
+ return -1;
+ }
+#endif
+
+ /*
+ * dir mtime doesn't change when files are touched, so we need to check
+ * each file against the index in case a file has been modified.
+ */
+ newer =
+ netsnmp_directory_container_read_some(NULL, dirname,
+ (netsnmp_directory_filter*)
+ _time_filter,(void*)&idx_stat,
+ NETSNMP_DIR_NSFILE |
+ NETSNMP_DIR_NSFILE_STATS);
+ if (newer) {
+ DEBUGMSGT(("cert:index:parse", "Index outdated; files modified\n"));
+ CONTAINER_FREE_ALL(newer, NULL);
+ CONTAINER_FREE(newer);
+ SNMP_FREE(idxname);
+ return -1;
+ }
+
+ DEBUGMSGT(("cert:index:parse", "The index for %s looks good\n", dirname));
+
+ index = fopen(idxname, "r");
+ if (NULL == index) {
+ snmp_log(LOG_ERR, "cert:index:parse can't open index for %s\n",
+ dirname);
+ SNMP_FREE(idxname);
+ return -1;
+ }
+
+ found = _get_cert_container(idxname);
+
+ /*
+ * check index format version
+ */
+ fgets(tmpstr, sizeof(tmpstr), index);
+ pos = strrchr(tmpstr, ' ');
+ if (pos) {
+ ++pos;
+ version = atoi(pos);
+ }
+ if ((NULL == pos) || (version != CERT_INDEX_FORMAT)) {
+ DEBUGMSGT(("cert:index:add", "missing or wrong index format!\n"));
+ fclose(index);
+ SNMP_FREE(idxname);
+ return -1;
+ }
+ while (1) {
+ if (NULL == fgets(tmpstr, sizeof(tmpstr), index))
+ break;
+
+ if ('c' == tmpstr[0]) {
+ pos = &tmpstr[2];
+ if ((NULL == (pos=copy_nword(pos, filename, sizeof(filename)))) ||
+ (NULL == (pos=copy_nword(pos, type_str, sizeof(type_str)))) ||
+ (NULL == (pos=copy_nword(pos, hash_str, sizeof(hash_str)))) ||
+ (NULL == (pos=copy_nword(pos, fingerprint,
+ sizeof(fingerprint)))) ||
+ (NULL == (pos=copy_nword(pos, common_name,
+ sizeof(common_name)))) ||
+ (NULL != copy_nword(pos, subject, sizeof(subject)))) {
+ snmp_log(LOG_ERR, "_cert_read_index: error parsing line: %s\n",
+ tmpstr);
+ count = -1;
+ break;
+ }
+ type = atoi(type_str);
+ hash = atoi(hash_str);
+ cert = (void*)_new_cert(dirname, filename, type, hash, fingerprint,
+ common_name, subject);
+ if (cert && 0 == CONTAINER_INSERT(found, cert))
+ ++count;
+ else {
+ DEBUGMSGT(("cert:index:add",
+ "error inserting cert into container\n"));
+ netsnmp_cert_free(cert);
+ cert = NULL;
+ }
+ }
+ else if ('k' == tmpstr[0]) {
+ if (NULL != copy_nword(&tmpstr[2], filename, sizeof(filename))) {
+ snmp_log(LOG_ERR, "_cert_read_index: error parsing line %s\n",
+ tmpstr);
+ continue;
+ }
+ key = _new_key(dirname, filename);
+ if (key && 0 == CONTAINER_INSERT(_keys, key))
+ ++count;
+ else {
+ DEBUGMSGT(("cert:index:add:key",
+ "error inserting key into container\n"));
+ netsnmp_key_free(key);
+ }
+ }
+ else {
+ snmp_log(LOG_ERR, "unknown line in cert index for %s\n", dirname);
+ continue;
+ }
+ } /* while */
+ fclose(index);
+ SNMP_FREE(idxname);
+
+ if (count > 0) {
+ netsnmp_iterator *itr = CONTAINER_ITERATOR(found);
+ if (NULL == itr) {
+ snmp_log(LOG_ERR, "could not get iterator for found certs\n");
+ count = -1;
+ }
+ else {
+ cert = ITERATOR_FIRST(itr);
+ for( ; cert; cert = ITERATOR_NEXT(itr))
+ CONTAINER_INSERT(_certs, cert);
+ ITERATOR_RELEASE(itr);
+ DEBUGMSGT(("cert:index:parse","added %d certs from index\n",
+ count));
+ }
+ }
+ if (count < 0)
+ CONTAINER_FREE_ALL(found, NULL);
+ CONTAINER_FREE(found);
+
+ return count;
+}
+
+static int
+_add_certdir(const char *dirname)
+{
+ FILE *index;
+ char *file;
+ int count = 0;
+ netsnmp_container *cert_container;
+ netsnmp_iterator *it;
+ struct stat statbuf;
+
+ netsnmp_assert(NULL != dirname);
+
+ DEBUGMSGT(("9:cert:dir:add", " config dir: %s\n", dirname ));
+
+ if (stat(dirname, &statbuf) != 0) {
+ DEBUGMSGT(("9:cert:dir:add", " dir not present: %s\n",
+ dirname ));
+ return -1;
+ }
+#ifdef S_ISDIR
+ if (!S_ISDIR(statbuf.st_mode)) {
+ DEBUGMSGT(("9:cert:dir:add", " not a dir: %s\n", dirname ));
+ return -1;
+ }
+#endif
+
+ DEBUGMSGT(("cert:index:dir", "Scanning directory %s\n", dirname));
+
+ /*
+ * look for existing index
+ */
+ count = _cert_read_index(dirname, &statbuf);
+ if (count >= 0)
+ return count;
+
+ index = _certindex_new( dirname );
+ if (NULL == index) {
+ DEBUGMSGT(("9:cert:index:dir",
+ "error opening index for cert directory\n"));
+ DEBUGMSGTL(("cert:index", "could not open certificate index file\n"));
+ }
+
+ /*
+ * index was missing, out of date or bad. rescan directory.
+ */
+ cert_container =
+ netsnmp_directory_container_read_some(NULL, dirname,
+ (netsnmp_directory_filter*)
+ &_cert_cert_filter, NULL,
+ NETSNMP_DIR_RELATIVE_PATH |
+ NETSNMP_DIR_EMPTY_OK );
+ if (NULL == cert_container) {
+ DEBUGMSGT(("cert:index:dir",
+ "error creating container for cert files\n"));
+ goto err_index;
+ }
+
+ /*
+ * iterate through the found files and add them to index
+ */
+ it = CONTAINER_ITERATOR(cert_container);
+ if (NULL == it) {
+ DEBUGMSGT(("cert:index:dir",
+ "error creating iterator for cert files\n"));
+ goto err_container;
+ }
+
+ for (file = ITERATOR_FIRST(it); file; file = ITERATOR_NEXT(it)) {
+ DEBUGMSGT(("cert:index:dir", "adding %s to index\n", file));
+ if ( 0 == _add_certfile( dirname, file, index ))
+ count++;
+ else
+ DEBUGMSGT(("cert:index:dir", "error adding %s to index\n",
+ file));
+ }
+
+ /*
+ * clean up and return
+ */
+ ITERATOR_RELEASE(it);
+
+ err_container:
+ netsnmp_directory_container_free(cert_container);
+
+ err_index:
+ if (index)
+ fclose(index);
+
+ return count;
+}
+
+static void
+_cert_indexes_load(void)
+{
+ const char *confpath;
+ char *confpath_copy, *dir, *st = NULL;
+ char certdir[SNMP_MAXPATH];
+ const char *subdirs[] = { NULL, "ca-certs", "certs", "private", NULL };
+ int i = 0;
+
+ /*
+ * load indexes from persistent dir
+ */
+ _certindexes_load();
+
+ /*
+ * duplicate path building from read_config_files_of_type() in
+ * read_config.c. That is, use SNMPCONFPATH environment variable if
+ * it is defined, otherwise use configuration directory.
+ */
+ confpath = netsnmp_getenv("SNMPCONFPATH");
+ if (NULL == confpath)
+ confpath = get_configuration_directory();
+
+ subdirs[0] = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CERT_EXTRA_SUBDIR);
+ confpath_copy = strdup(confpath);
+ for ( dir = strtok_r(confpath_copy, ENV_SEPARATOR, &st);
+ dir; dir = strtok_r(NULL, ENV_SEPARATOR, &st)) {
+
+ i = (NULL == subdirs[0]) ? 1 : 0;
+ for ( ; subdirs[i] ; ++i ) {
+ /** check tls subdir */
+ snprintf(certdir, sizeof(certdir), "%s/tls/%s", dir, subdirs[i]);
+ _add_certdir(certdir);
+ } /* for subdirs */
+ } /* for conf path dirs */
+ SNMP_FREE(confpath_copy);
+}
+
+static void
+_cert_print(netsnmp_cert *c, void *context)
+{
+ if (NULL == c)
+ return;
+
+ DEBUGMSGT(("cert:dump", "cert %s in %s\n", c->info.filename, c->info.dir));
+ DEBUGMSGT(("cert:dump", " type %d flags 0x%x (%s)\n",
+ c->info.type, c->info.allowed_uses,
+ _mode_str(c->info.allowed_uses)));
+ DEBUGIF("9:cert:dump") {
+ if (NS_CERT_TYPE_KEY != c->info.type) {
+ if(c->subject) {
+ if (c->info.allowed_uses & NS_CERT_CA)
+ DEBUGMSGT(("9:cert:dump", " CA: %s\n", c->subject));
+ else
+ DEBUGMSGT(("9:cert:dump", " subject: %s\n", c->subject));
+ }
+ if(c->issuer)
+ DEBUGMSGT(("9:cert:dump", " issuer: %s\n", c->issuer));
+ if(c->fingerprint)
+ DEBUGMSGT(("9:cert:dump", " fingerprint: %s(%d):%s\n",
+ se_find_label_in_slist("cert_hash_alg", c->hash_type),
+ c->hash_type, c->fingerprint));
+ }
+ /* netsnmp_feature_require(cert_utils_dump_names) */
+ /* netsnmp_openssl_cert_dump_names(c->ocert); */
+ netsnmp_openssl_cert_dump_extensions(c->ocert);
+ }
+
+}
+
+static void
+_key_print(netsnmp_key *k, void *context)
+{
+ if (NULL == k)
+ return;
+
+ DEBUGMSGT(("cert:dump", "key %s in %s\n", k->info.filename, k->info.dir));
+ DEBUGMSGT(("cert:dump", " type %d flags 0x%x (%s)\n", k->info.type,
+ k->info.allowed_uses, _mode_str(k->info.allowed_uses)));
+}
+
+void
+netsnmp_cert_dump_all(void)
+{
+ CONTAINER_FOR_EACH(_certs, (netsnmp_container_obj_func*)_cert_print, NULL);
+ CONTAINER_FOR_EACH(_keys, (netsnmp_container_obj_func*)_key_print, NULL);
+}
+
+#ifdef CERT_MAIN
+/*
+ * export BLD=~/net-snmp/build/ SRC=~/net-snmp/src
+ * cc -DCERT_MAIN `$BLD/net-snmp-config --cflags` `$BLD/net-snmp-config --build-includes $BLD/` $SRC/snmplib/cert_util.c -o cert_util `$BLD/net-snmp-config --build-lib-dirs $BLD` `$BLD/net-snmp-config --libs` -lcrypto -lssl
+ *
+ */
+int
+main(int argc, char** argv)
+{
+ int ch;
+ extern char *optarg;
+
+ while ((ch = getopt(argc, argv, "D:fHLMx:")) != EOF)
+ switch(ch) {
+ case 'D':
+ debug_register_tokens(optarg);
+ snmp_set_do_debugging(1);
+ break;
+ default:
+ fprintf(stderr,"unknown option %c\n", ch);
+ }
+
+ init_snmp("dtlsapp");
+
+ netsnmp_cert_dump_all();
+
+ return 0;
+}
+
+#endif /* CERT_MAIN */
+
+static netsnmp_cert *_cert_find_fp(const char *fingerprint);
+
+void
+netsnmp_fp_lowercase_and_strip_colon(char *fp)
+{
+ char *pos, *dest=NULL;
+
+ if(!fp)
+ return;
+
+ /** skip to first : */
+ for (pos = fp; *pos; ++pos ) {
+ if (':' == *pos) {
+ dest = pos;
+ break;
+ }
+ else
+ *pos = isalpha(0xFF & *pos) ? tolower(0xFF & *pos) : *pos;
+ }
+ if (!*pos)
+ return;
+
+ /** copy, skipping any ':' */
+ for (++pos; *pos; ++pos) {
+ if (':' == *pos)
+ continue;
+ *dest++ = isalpha(0xFF & *pos) ? tolower(0xFF & *pos) : *pos;
+ }
+ *dest = *pos; /* nul termination */
+}
+
+netsnmp_cert *
+netsnmp_cert_find(int what, int where, void *hint)
+{
+ netsnmp_cert *result = NULL;
+ char *fp, *hint_str;
+
+ DEBUGMSGT(("cert:find:params", "looking for %s(%d) in %s(0x%x), hint %lu\n",
+ _mode_str(what), what, _where_str(where), where, (u_long)hint));
+
+ if (NS_CERTKEY_DEFAULT == where) {
+
+ switch (what) {
+ case NS_CERT_IDENTITY: /* want my ID */
+ fp =
+ netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TLS_LOCAL_CERT);
+ /** temp backwards compability; remove in 5.7 */
+ if (!fp) {
+ int tmp;
+ tmp = (ptrdiff_t)hint;
+ DEBUGMSGT(("cert:find:params", " hint = %s\n",
+ tmp ? "server" : "client"));
+ fp =
+ netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, tmp ?
+ NETSNMP_DS_LIB_X509_SERVER_PUB :
+ NETSNMP_DS_LIB_X509_CLIENT_PUB );
+ }
+ if (!fp) {
+ /* As a special case, use the application type to
+ determine a file name to pull the default identity
+ from. */
+ return netsnmp_cert_find(what, NS_CERTKEY_FILE, netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_APPTYPE));
+ }
+ break;
+ case NS_CERT_REMOTE_PEER:
+ fp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TLS_PEER_CERT);
+ /** temp backwards compability; remove in 5.7 */
+ if (!fp)
+ fp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_X509_SERVER_PUB);
+ break;
+ default:
+ DEBUGMSGT(("cert:find:err", "unhandled type %d for %s(%d)\n",
+ what, _where_str(where), where));
+ return NULL;
+ }
+ if (fp)
+ return netsnmp_cert_find(what, NS_CERTKEY_MULTIPLE, fp);
+ return NULL;
+ } /* where = ds store */
+ else if (NS_CERTKEY_MULTIPLE == where) {
+ /* tries multiple sources of certificates based on ascii lookup keys */
+
+ /* Try a fingerprint match first, which should always be done first */
+ /* (to avoid people naming filenames with conflicting FPs) */
+ result = netsnmp_cert_find(what, NS_CERTKEY_FINGERPRINT, hint);
+ if (!result) {
+ /* Then try a file name lookup */
+ result = netsnmp_cert_find(what, NS_CERTKEY_FILE, hint);
+ }
+ }
+ else if (NS_CERTKEY_FINGERPRINT == where) {
+ DEBUGMSGT(("cert:find:params", " hint = %s\n", (char *)hint));
+ result = _cert_find_fp((char *)hint);
+ }
+ else if (NS_CERTKEY_TARGET_PARAM == where) {
+ if (what != NS_CERT_IDENTITY) {
+ snmp_log(LOG_ERR, "only identity is valid for target params\n");
+ return NULL;
+ }
+ /** hint == target mib data */
+ hint_str = (char *)hint;
+ fp = _find_tlstmParams_fingerprint(hint_str);
+ if (NULL != fp)
+ result = _cert_find_fp(fp);
+
+ }
+ else if (NS_CERTKEY_TARGET_ADDR == where) {
+
+ /** hint == target mib data */
+ if (what != NS_CERT_REMOTE_PEER) {
+ snmp_log(LOG_ERR, "only peer is valid for target addr\n");
+ return NULL;
+ }
+ /** hint == target mib data */
+ hint_str = (char *)hint;
+ fp = _find_tlstmAddr_fingerprint(hint_str);
+ if (NULL != fp)
+ result = _cert_find_fp(fp);
+
+ }
+ else if (NS_CERTKEY_FILE == where) {
+ /** hint == filename */
+ char *filename = (char*)hint;
+ netsnmp_void_array *matching;
+
+ DEBUGMSGT(("cert:find:params", " hint = %s\n", (char *)hint));
+ matching = _cert_find_subset_fn( filename, NULL );
+ if (!matching)
+ return NULL;
+ if (1 == matching->size)
+ result = (netsnmp_cert*)matching->array[0];
+ else {
+ DEBUGMSGT(("cert:find:err", "%s matches multiple certs\n",
+ filename));
+ result = NULL;
+ }
+ free(matching->array);
+ free(matching);
+ } /* where = NS_CERTKEY_FILE */
+ else { /* unknown location */
+
+ DEBUGMSGT(("cert:find:err", "unhandled location %d for %d\n", where,
+ what));
+ return NULL;
+ }
+
+ if (NULL == result)
+ return NULL;
+
+ /** make sure result found can be used for specified type */
+ if (!(result->info.allowed_uses & what)) {
+ DEBUGMSGT(("cert:find:err",
+ "cert %s / %s not allowed for %s(%d) (uses=%s (%d))\n",
+ result->info.filename, result->fingerprint, _mode_str(what),
+ what , _mode_str(result->info.allowed_uses),
+ result->info.allowed_uses));
+ return NULL;
+ }
+
+ /** make sure we have the cert data */
+ if (netsnmp_cert_load_x509(result) == CERT_LOAD_ERR)
+ return NULL;
+
+ DEBUGMSGT(("cert:find:found",
+ "using cert %s / %s for %s(%d) (uses=%s (%d))\n",
+ result->info.filename, result->fingerprint, _mode_str(what),
+ what , _mode_str(result->info.allowed_uses),
+ result->info.allowed_uses));
+
+ return result;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CERT_FINGERPRINTS
+int
+netsnmp_cert_check_vb_fingerprint(const netsnmp_variable_list *var)
+{
+ if (!var)
+ return SNMP_ERR_GENERR;
+
+ if (0 == var->val_len) /* empty allowed in some cases */
+ return SNMP_ERR_NOERROR;
+
+ if (! (0x01 & var->val_len)) { /* odd len */
+ DEBUGMSGT(("cert:varbind:fingerprint",
+ "expecting odd length for fingerprint\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ if (var->val.string[0] > NS_HASH_MAX) {
+ DEBUGMSGT(("cert:varbind:fingerprint", "hashtype %d > max %d\n",
+ var->val.string[0], NS_HASH_MAX));
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+/**
+ * break a SnmpTLSFingerprint into an integer hash type + hex string
+ *
+ * @return SNMPERR_SUCCESS : on success
+ * @return SNMPERR_GENERR : on failure
+ */
+int
+netsnmp_tls_fingerprint_parse(const u_char *binary_fp, int fp_len,
+ char **fp_str_ptr, u_int *fp_str_len, int realloc,
+ u_char *hash_type_ptr)
+{
+ int needed;
+ size_t fp_str_size;
+
+ netsnmp_require_ptr_LRV( hash_type_ptr, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( fp_str_ptr, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( fp_str_len, SNMPERR_GENERR );
+
+ /*
+ * output string is binary fp length (minus 1 for initial hash type
+ * char) * 2 for bin to hex conversion, + 1 for null termination.
+ */
+ needed = ((fp_len - 1) * 2) + 1;
+ if (*fp_str_len < needed) {
+ DEBUGMSGT(("tls:fp:parse", "need %d bytes for output\n", needed ));
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * make sure hash type is in valid range
+ */
+ if ((0 == binary_fp[0]) || (binary_fp[0] > NS_HASH_MAX)) {
+ DEBUGMSGT(("tls:fp:parse", "invalid hash type %d\n",
+ binary_fp[0]));
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * netsnmp_binary_to_hex allocate space for string, if needed
+ */
+ fp_str_size = *fp_str_len;
+ *hash_type_ptr = binary_fp[0];
+ netsnmp_binary_to_hex((u_char**)fp_str_ptr, &fp_str_size,
+ realloc, &binary_fp[1], fp_len - 1);
+ *fp_str_len = fp_str_size;
+ if (0 == *fp_str_len)
+ return SNMPERR_GENERR;
+
+ return SNMPERR_SUCCESS;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CERT_FINGERPRINTS */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TLS_FINGERPRINT_BUILD
+/**
+ * combine a hash type and hex fingerprint into a SnmpTLSFingerprint
+ *
+ * On entry, tls_fp_len should point to the size of the tls_fp buffer.
+ * On a successful exit, tls_fp_len will contain the length of the
+ * fingerprint buffer.
+ */
+int
+netsnmp_tls_fingerprint_build(int hash_type, const char *hex_fp,
+ u_char **tls_fp, size_t *tls_fp_len,
+ int realloc)
+{
+ int hex_fp_len, rc;
+ size_t tls_fp_size;
+ size_t offset;
+
+ netsnmp_require_ptr_LRV( hex_fp, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( tls_fp, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( tls_fp_len, SNMPERR_GENERR );
+
+ hex_fp_len = strlen(hex_fp);
+ if (0 == hex_fp_len) {
+ *tls_fp_len = 0;
+ return SNMPERR_SUCCESS;
+ }
+
+ if ((hash_type <= NS_HASH_NONE) || (hash_type > NS_HASH_MAX)) {
+ DEBUGMSGT(("tls:fp:build", "invalid hash type %d\n", hash_type ));
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * convert to binary
+ */
+ offset = 1;
+ rc = netsnmp_hex_to_binary(tls_fp, &tls_fp_size, &offset, realloc, hex_fp,
+ ":");
+ *tls_fp_len = tls_fp_size;
+ if (rc != 1)
+ return SNMPERR_GENERR;
+ *tls_fp_len = offset;
+ (*tls_fp)[0] = hash_type;
+
+ return SNMPERR_SUCCESS;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TLS_FINGERPRINT_BUILD */
+
+/**
+ * Trusts a given certificate for use in TLS translations.
+ *
+ * @param ctx The SSL context to trust the certificate in
+ * @param thiscert The netsnmp_cert certificate to trust
+ *
+ * @return SNMPERR_SUCCESS : on success
+ * @return SNMPERR_GENERR : on failure
+ */
+int
+netsnmp_cert_trust(SSL_CTX *ctx, netsnmp_cert *thiscert)
+{
+ X509_STORE *certstore;
+ X509 *cert;
+ char *fingerprint;
+
+ /* ensure all needed pieces are present */
+ netsnmp_assert_or_msgreturn(NULL != thiscert, "NULL certificate passed in",
+ SNMPERR_GENERR);
+ netsnmp_assert_or_msgreturn(NULL != thiscert->info.dir,
+ "NULL certificate directory name passed in",
+ SNMPERR_GENERR);
+ netsnmp_assert_or_msgreturn(NULL != thiscert->info.filename,
+ "NULL certificate filename name passed in",
+ SNMPERR_GENERR);
+
+ /* get the trusted certificate store and the certificate to load into it */
+ certstore = SSL_CTX_get_cert_store(ctx);
+ netsnmp_assert_or_msgreturn(NULL != certstore,
+ "failed to get certificate trust store",
+ SNMPERR_GENERR);
+ cert = netsnmp_ocert_get(thiscert);
+ netsnmp_assert_or_msgreturn(NULL != cert,
+ "failed to get certificate from netsnmp_cert",
+ SNMPERR_GENERR);
+
+ /* Put the certificate into the store */
+ fingerprint = netsnmp_openssl_cert_get_fingerprint(cert, -1);
+ DEBUGMSGTL(("cert:trust",
+ "putting trusted cert %p = %s in certstore %p\n", cert,
+ fingerprint, certstore));
+ SNMP_FREE(fingerprint);
+ X509_STORE_add_cert(certstore, cert);
+
+ return SNMPERR_SUCCESS;
+}
+
+/**
+ * Trusts a given certificate's root CA for use in TLS translations.
+ * If no issuer is found the existing certificate will be trusted instead.
+ *
+ * @param ctx The SSL context to trust the certificate in
+ * @param thiscert The netsnmp_cert certificate
+ *
+ * @return SNMPERR_SUCCESS : on success
+ * @return SNMPERR_GENERR : on failure
+ */
+int
+netsnmp_cert_trust_ca(SSL_CTX *ctx, netsnmp_cert *thiscert)
+{
+ netsnmp_assert_or_msgreturn(NULL != thiscert, "NULL certificate passed in",
+ SNMPERR_GENERR);
+
+ /* find the root CA certificate in the chain */
+ DEBUGMSGTL(("cert:trust_ca", "checking roots for %p \n", thiscert));
+ while (thiscert->issuer_cert) {
+ thiscert = thiscert->issuer_cert;
+ DEBUGMSGTL(("cert:trust_ca", " up one to %p\n", thiscert));
+ }
+
+ /* Add the found top lever certificate to the store */
+ return netsnmp_cert_trust(ctx, thiscert);
+}
+
+netsnmp_container *
+netsnmp_cert_get_trustlist(void)
+{
+ if (!_trusted_certs)
+ _setup_trusted_certs();
+ return _trusted_certs;
+}
+
+static void
+_parse_trustcert(const char *token, char *line)
+{
+ if (!_trusted_certs)
+ _setup_trusted_certs();
+
+ if (!_trusted_certs)
+ return;
+
+ CONTAINER_INSERT(_trusted_certs, strdup(line));
+}
+
+/* ***************************************************************************
+ *
+ * mode text functions
+ *
+ */
+static const char *_mode_str(u_char mode)
+{
+ return _modes[mode];
+}
+
+static const char *_where_str(u_int what)
+{
+ switch (what) {
+ case NS_CERTKEY_DEFAULT: return "DEFAULT";
+ case NS_CERTKEY_FILE: return "FILE";
+ case NS_CERTKEY_FINGERPRINT: return "FINGERPRINT";
+ case NS_CERTKEY_MULTIPLE: return "MULTIPLE";
+ case NS_CERTKEY_CA: return "CA";
+ case NS_CERTKEY_SAN_RFC822: return "SAN_RFC822";
+ case NS_CERTKEY_SAN_DNS: return "SAN_DNS";
+ case NS_CERTKEY_SAN_IPADDR: return "SAN_IPADDR";
+ case NS_CERTKEY_COMMON_NAME: return "COMMON_NAME";
+ case NS_CERTKEY_TARGET_PARAM: return "TARGET_PARAM";
+ case NS_CERTKEY_TARGET_ADDR: return "TARGET_ADDR";
+ }
+
+ return "UNKNOWN";
+}
+
+/* ***************************************************************************
+ *
+ * find functions
+ *
+ */
+static netsnmp_cert *
+_cert_find_fp(const char *fingerprint)
+{
+ netsnmp_cert cert, *result = NULL;
+ char fp[EVP_MAX_MD_SIZE];
+
+ if (NULL == fingerprint)
+ return NULL;
+
+ strlcpy(fp, fingerprint, sizeof(fp));
+ netsnmp_fp_lowercase_and_strip_colon(fp);
+
+ /** clear search key */
+ memset(&cert, 0x00, sizeof(cert));
+
+ cert.fingerprint = fp;
+
+ result = CONTAINER_FIND(_certs,&cert);
+ return result;
+}
+
+/*
+ * reduce subset by eliminating any filenames that are longer than
+ * the specified file name. e.g. 'snmp' would match 'snmp.key' and
+ * 'snmpd.key'. We only want 'snmp.X', where X is a valid extension.
+ */
+static void
+_reduce_subset(netsnmp_void_array *matching, const char *filename)
+{
+ netsnmp_cert_common *cc;
+ int i = 0, j, newsize, pos;
+
+ if ((NULL == matching) || (NULL == filename))
+ return;
+
+ pos = strlen(filename);
+ newsize = matching->size;
+
+ for( ; i < matching->size; ) {
+ /*
+ * if we've shifted matches down we'll hit a NULL entry before
+ * we hit the end of the array.
+ */
+ if (NULL == matching->array[i])
+ break;
+ /*
+ * skip over valid matches. Note that we do not want to use
+ * _type_from_filename.
+ */
+ cc = (netsnmp_cert_common*)matching->array[i];
+ if (('.' == cc->filename[pos]) &&
+ (NS_CERT_TYPE_UNKNOWN != _cert_ext_type(&cc->filename[pos+1]))) {
+ ++i;
+ continue;
+ }
+ /*
+ * shrink array by shifting everything down a spot. Might not be
+ * the most efficient soloution, but this is just happening at
+ * startup and hopefully most certs won't have common prefixes.
+ */
+ --newsize;
+ for ( j=i; j < newsize; ++j )
+ matching->array[j] = matching->array[j+1];
+ matching->array[j] = NULL;
+ /** no ++i; just shifted down, need to look at same position again */
+ }
+ /*
+ * if we shifted, set the new size
+ */
+ if (newsize != matching->size) {
+ DEBUGMSGT(("9:cert:subset:reduce", "shrank from %" NETSNMP_PRIz "d to %d\n",
+ matching->size, newsize));
+ matching->size = newsize;
+ }
+}
+
+/*
+ * reduce subset by eliminating any filenames that are not under the
+ * specified directory path.
+ */
+static void
+_reduce_subset_dir(netsnmp_void_array *matching, const char *directory)
+{
+ netsnmp_cert_common *cc;
+ int i = 0, j, newsize, dir_len;
+ char dir[SNMP_MAXPATH], *pos;
+
+ if ((NULL == matching) || (NULL == directory))
+ return;
+
+ newsize = matching->size;
+
+ /*
+ * dir struct should be something like
+ * /usr/share/snmp/tls/certs
+ * /usr/share/snmp/tls/private
+ *
+ * so we want to backup up on directory for compares..
+ */
+ strlcpy(dir, directory, sizeof(dir));
+ pos = strrchr(dir, '/');
+ if (NULL == pos) {
+ DEBUGMSGTL(("cert:subset:dir", "no '/' in directory %s\n", directory));
+ return;
+ }
+ *pos = '\0';
+ dir_len = strlen(dir);
+
+ for( ; i < matching->size; ) {
+ /*
+ * if we've shifted matches down we'll hit a NULL entry before
+ * we hit the end of the array.
+ */
+ if (NULL == matching->array[i])
+ break;
+ /*
+ * skip over valid matches.
+ */
+ cc = (netsnmp_cert_common*)matching->array[i];
+ if (strncmp(dir, cc->dir, dir_len) == 0) {
+ ++i;
+ continue;
+ }
+ /*
+ * shrink array by shifting everything down a spot. Might not be
+ * the most efficient soloution, but this is just happening at
+ * startup and hopefully most certs won't have common prefixes.
+ */
+ --newsize;
+ for ( j=i; j < newsize; ++j )
+ matching->array[j] = matching->array[j+1];
+ matching->array[j] = NULL;
+ /** no ++i; just shifted down, need to look at same position again */
+ }
+ /*
+ * if we shifted, set the new size
+ */
+ if (newsize != matching->size) {
+ DEBUGMSGT(("9:cert:subset:dir", "shrank from %" NETSNMP_PRIz "d to %d\n",
+ matching->size, newsize));
+ matching->size = newsize;
+ }
+}
+
+static netsnmp_void_array *
+_cert_find_subset_common(const char *filename, netsnmp_container *container)
+{
+ netsnmp_cert_common search;
+ netsnmp_void_array *matching;
+
+ netsnmp_assert(filename && container);
+
+ memset(&search, 0x00, sizeof(search)); /* clear search key */
+
+ search.filename = NETSNMP_REMOVE_CONST(char*,filename);
+
+ matching = CONTAINER_GET_SUBSET(container, &search);
+ DEBUGMSGT(("9:cert:subset:found", "%" NETSNMP_PRIz "d matches\n", matching ?
+ matching->size : 0));
+ if (matching && matching->size > 1) {
+ _reduce_subset(matching, filename);
+ if (0 == matching->size) {
+ free(matching->array);
+ SNMP_FREE(matching);
+ }
+ }
+ return matching;
+}
+
+static netsnmp_void_array *
+_cert_find_subset_fn(const char *filename, const char *directory)
+{
+ netsnmp_container *fn_container;
+ netsnmp_void_array *matching;
+
+ /** find subcontainer with filename as key */
+ fn_container = SUBCONTAINER_FIND(_certs, "certs_fn");
+ netsnmp_assert(fn_container);
+
+ matching = _cert_find_subset_common(filename, fn_container);
+ if (matching && (matching->size > 1) && directory) {
+ _reduce_subset_dir(matching, directory);
+ if (0 == matching->size) {
+ free(matching->array);
+ SNMP_FREE(matching);
+ }
+ }
+ return matching;
+}
+
+static netsnmp_void_array *
+_cert_find_subset_sn(const char *subject)
+{
+ netsnmp_cert search;
+ netsnmp_void_array *matching;
+ netsnmp_container *sn_container;
+
+ /** find subcontainer with subject as key */
+ sn_container = SUBCONTAINER_FIND(_certs, "certs_sn");
+ netsnmp_assert(sn_container);
+
+ memset(&search, 0x00, sizeof(search)); /* clear search key */
+
+ search.subject = NETSNMP_REMOVE_CONST(char*,subject);
+
+ matching = CONTAINER_GET_SUBSET(sn_container, &search);
+ DEBUGMSGT(("9:cert:subset:found", "%" NETSNMP_PRIz "d matches\n", matching ?
+ matching->size : 0));
+ return matching;
+}
+
+static netsnmp_void_array *
+_key_find_subset(const char *filename)
+{
+ return _cert_find_subset_common(filename, _keys);
+}
+
+/** find all entries matching given fingerprint */
+static netsnmp_void_array *
+_find_subset_fp(netsnmp_container *certs, const char *fp)
+{
+ netsnmp_cert_map entry;
+ netsnmp_container *fp_container;
+ netsnmp_void_array *va;
+
+ if ((NULL == certs) || (NULL == fp))
+ return NULL;
+
+ fp_container = SUBCONTAINER_FIND(certs, "cert2sn_fp");
+ netsnmp_assert_or_msgreturn(fp_container, "cert2sn_fp container missing",
+ NULL);
+
+ memset(&entry, 0x0, sizeof(entry));
+
+ entry.fingerprint = NETSNMP_REMOVE_CONST(char*,fp);
+
+ va = CONTAINER_GET_SUBSET(fp_container, &entry);
+ return va;
+}
+
+#if 0 /* not used yet */
+static netsnmp_key *
+_key_find_fn(const char *filename)
+{
+ netsnmp_key key, *result = NULL;
+
+ netsnmp_assert(NULL != filename);
+
+ memset(&key, 0x00, sizeof(key)); /* clear search key */
+ key.info.filename = NETSNMP_REMOVE_CONST(char*,filename);
+ result = CONTAINER_FIND(_keys,&key);
+ return result;
+}
+#endif
+
+static int
+_time_filter(netsnmp_file *f, struct stat *idx)
+{
+ /** include if mtime or ctime newer than index mtime */
+ if (f && idx && f->stats &&
+ ((f->stats->st_mtime >= idx->st_mtime) ||
+ (f->stats->st_ctime >= idx->st_mtime)))
+ return NETSNMP_DIR_INCLUDE;
+
+ return NETSNMP_DIR_EXCLUDE;
+}
+
+/* ***************************************************************************
+ * ***************************************************************************
+ *
+ *
+ * cert map functions
+ *
+ *
+ * ***************************************************************************
+ * ***************************************************************************/
+#define MAP_CONFIG_TOKEN "certSecName"
+static void _parse_map(const char *token, char *line);
+static void _map_free(netsnmp_cert_map* entry, void *ctx);
+static void _purge_config_entries(void);
+
+static void
+_init_tlstmCertToTSN(void)
+{
+ const char *certSecName_help = MAP_CONFIG_TOKEN " PRIORITY FINGERPRINT "
+ "[--shaNN|md5] <--sn SECNAME | --rfc822 | --dns | --ip | --cn | --any>";
+
+ /*
+ * container for cert to fingerprint mapping, with fingerprint key
+ */
+ _maps = netsnmp_cert_map_container_create(1);
+
+ register_config_handler(NULL, MAP_CONFIG_TOKEN, _parse_map, _purge_config_entries,
+ certSecName_help);
+}
+
+netsnmp_cert_map *
+netsnmp_cert_map_alloc(char *fingerprint, X509 *ocert)
+{
+ netsnmp_cert_map *cert_map = SNMP_MALLOC_TYPEDEF(netsnmp_cert_map);
+ if (NULL == cert_map) {
+ snmp_log(LOG_ERR, "could not allocate netsnmp_cert_map\n");
+ return NULL;
+ }
+
+ if (fingerprint) {
+ /** MIB limits to 255 bytes; 2x since we've got ascii */
+ if (strlen(fingerprint) > (SNMPADMINLENGTH * 2)) {
+ snmp_log(LOG_ERR, "fingerprint %s exceeds max length %d\n",
+ fingerprint, (SNMPADMINLENGTH * 2));
+ free(cert_map);
+ return NULL;
+ }
+ cert_map->fingerprint = strdup(fingerprint);
+ }
+ if (ocert) {
+ cert_map->hashType = netsnmp_openssl_cert_get_hash_type(ocert);
+ cert_map->ocert = ocert;
+ }
+
+ return cert_map;
+}
+
+void
+netsnmp_cert_map_free(netsnmp_cert_map *cert_map)
+{
+ if (NULL == cert_map)
+ return;
+
+ SNMP_FREE(cert_map->fingerprint);
+ SNMP_FREE(cert_map->data);
+ /** x509 cert isn't ours */
+ free(cert_map); /* SNMP_FREE wasted on param */
+}
+
+int
+netsnmp_cert_map_add(netsnmp_cert_map *map)
+{
+ int rc;
+
+ if (NULL == map)
+ return -1;
+
+ DEBUGMSGTL(("cert:map:add", "pri %d, fp %s\n",
+ map->priority, map->fingerprint));
+
+ if ((rc = CONTAINER_INSERT(_maps, map)) != 0)
+ snmp_log(LOG_ERR, "could not insert new certificate map");
+
+ return rc;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CERT_MAP_REMOVE
+int
+netsnmp_cert_map_remove(netsnmp_cert_map *map)
+{
+ int rc;
+
+ if (NULL == map)
+ return -1;
+
+ DEBUGMSGTL(("cert:map:remove", "pri %d, fp %s\n",
+ map->priority, map->fingerprint));
+
+ if ((rc = CONTAINER_REMOVE(_maps, map)) != 0)
+ snmp_log(LOG_ERR, "could not remove certificate map");
+
+ return rc;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CERT_MAP_REMOVE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CERT_MAP_FIND
+netsnmp_cert_map *
+netsnmp_cert_map_find(netsnmp_cert_map *map)
+{
+ if (NULL == map)
+ return NULL;
+
+ return CONTAINER_FIND(_maps, map);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CERT_MAP_FIND */
+
+static void
+_map_free(netsnmp_cert_map *map, void *context)
+{
+ netsnmp_cert_map_free(map);
+}
+
+static int
+_map_compare(netsnmp_cert_map *lhs, netsnmp_cert_map *rhs)
+{
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+
+ if (lhs->priority < rhs->priority)
+ return -1;
+ else if (lhs->priority > rhs->priority)
+ return 1;
+
+ return strcmp(lhs->fingerprint, rhs->fingerprint);
+}
+
+static int
+_map_fp_compare(netsnmp_cert_map *lhs, netsnmp_cert_map *rhs)
+{
+ int rc;
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+
+ if ((rc = strcmp(lhs->fingerprint, rhs->fingerprint)) != 0)
+ return rc;
+
+ if (lhs->priority < rhs->priority)
+ return -1;
+ else if (lhs->priority > rhs->priority)
+ return 1;
+
+ return 0;
+}
+
+static int
+_map_fp_ncompare(netsnmp_cert_map *lhs, netsnmp_cert_map *rhs)
+{
+ netsnmp_assert((lhs != NULL) && (rhs != NULL));
+
+ return strncmp(lhs->fingerprint, rhs->fingerprint,
+ strlen(rhs->fingerprint));
+}
+
+netsnmp_container *
+netsnmp_cert_map_container_create(int with_fp)
+{
+ netsnmp_container *chain_map, *fp;
+
+ chain_map = netsnmp_container_find("cert_map:stack:binary_array");
+ if (NULL == chain_map) {
+ snmp_log(LOG_ERR, "could not allocate container for cert_map\n");
+ return NULL;
+ }
+
+ chain_map->container_name = strdup("cert_map");
+ chain_map->free_item = (netsnmp_container_obj_func*)_map_free;
+ chain_map->compare = (netsnmp_container_compare*)_map_compare;
+
+ if (!with_fp)
+ return chain_map;
+
+ /*
+ * add a secondary index to the table container
+ */
+ fp = netsnmp_container_find("cert2sn_fp:binary_array");
+ if (NULL == fp) {
+ snmp_log(LOG_ERR,
+ "error creating sub-container for tlstmCertToTSNTable\n");
+ CONTAINER_FREE(chain_map);
+ return NULL;
+ }
+ fp->container_name = strdup("cert2sn_fp");
+ fp->compare = (netsnmp_container_compare*)_map_fp_compare;
+ fp->ncompare = (netsnmp_container_compare*)_map_fp_ncompare;
+ netsnmp_container_add_index(chain_map, fp);
+
+ return chain_map;
+}
+
+int
+netsnmp_cert_parse_hash_type(const char *str)
+{
+ int rc = se_find_value_in_slist("cert_hash_alg", str);
+ if (SE_DNE == rc)
+ return NS_HASH_NONE;
+ return rc;
+}
+
+void
+netsnmp_cert_map_container_free(netsnmp_container *c)
+{
+ if (NULL == c)
+ return;
+
+ CONTAINER_FREE_ALL(c, NULL);
+ CONTAINER_FREE(c);
+}
+
+/** clear out config rows
+ * called during reconfig processing (e.g. SIGHUP)
+*/
+static void
+_purge_config_entries(void)
+{
+ /**
+ ** dup container
+ ** iterate looking for NSCM_FROM_CONFIG flag
+ ** delete from original
+ ** delete dup
+ **/
+ netsnmp_iterator *itr;
+ netsnmp_cert_map *cert_map;
+ netsnmp_container *cert_maps = netsnmp_cert_map_container();
+ netsnmp_container *tmp_maps = NULL;
+
+ if ((NULL == cert_maps) || (CONTAINER_SIZE(cert_maps) == 0))
+ return;
+
+ DEBUGMSGT(("cert:map:reconfig", "removing locally configured rows\n"));
+
+ /*
+ * duplicate cert_maps and then iterate over the copy. That way we can
+ * add/remove to cert_maps without distrubing the iterator.
+xx
+ */
+ tmp_maps = CONTAINER_DUP(cert_maps, NULL, 0);
+ if (NULL == tmp_maps) {
+ snmp_log(LOG_ERR, "could not duplicate maps for reconfig\n");
+ return;
+ }
+
+ itr = CONTAINER_ITERATOR(tmp_maps);
+ if (NULL == itr) {
+ snmp_log(LOG_ERR, "could not get iterator for reconfig\n");
+ CONTAINER_FREE(tmp_maps);
+ return;
+ }
+ cert_map = ITERATOR_FIRST(itr);
+ for( ; cert_map; cert_map = ITERATOR_NEXT(itr)) {
+
+ if (!(cert_map->flags & NSCM_FROM_CONFIG))
+ continue;
+
+ if (CONTAINER_REMOVE(cert_maps, cert_map) == 0)
+ netsnmp_cert_map_free(cert_map);
+ }
+ ITERATOR_RELEASE(itr);
+ CONTAINER_FREE(tmp_maps);
+
+ return;
+}
+
+/*
+ certSecName PRIORITY [--shaNN|md5] FINGERPRINT <--sn SECNAME | --rfc822 | --dns | --ip | --cn | --any>
+
+ certSecName 100 ff:..11 --sn Wes
+ certSecName 200 ee:..:22 --sn JohnDoe
+ certSecName 300 ee:..:22 --rfc822
+*/
+netsnmp_cert_map *
+netsnmp_certToTSN_parse_common(char **line)
+{
+ netsnmp_cert_map *map;
+ char *tmp, buf[SNMP_MAXBUF_SMALL];
+ size_t len;
+ netsnmp_cert *tmpcert;
+
+ if ((NULL == line) || (NULL == *line))
+ return NULL;
+
+ /** need somewhere to save rows */
+ if (NULL == _maps) {
+ NETSNMP_LOGONCE((LOG_ERR, "no container for certificate mappings\n"));
+ return NULL;
+ }
+
+ DEBUGMSGT(("cert:util:config", "parsing %s\n", *line));
+
+ /* read the priority */
+ len = sizeof(buf);
+ tmp = buf;
+ *line = read_config_read_octet_string(*line, (u_char **)&tmp, &len);
+ tmp[len] = 0;
+ if (!isdigit(0xFF & tmp[0])) {
+ netsnmp_config_error("could not parse priority");
+ return NULL;
+ }
+ map = netsnmp_cert_map_alloc(NULL, NULL);
+ if (NULL == map) {
+ netsnmp_config_error("could not allocate cert map struct");
+ return NULL;
+ }
+ map->flags |= NSCM_FROM_CONFIG;
+ map->priority = atoi(buf);
+
+ /* read the flag or the fingerprint */
+ len = sizeof(buf);
+ tmp = buf;
+ *line = read_config_read_octet_string(*line, (u_char **)&tmp, &len);
+ tmp[len] = 0;
+ if ((buf[0] == '-') && (buf[1] == '-')) {
+ map->hashType = netsnmp_cert_parse_hash_type(&buf[2]);
+ if (NS_HASH_NONE == map->hashType) {
+ netsnmp_config_error("invalid hash type");
+ goto end;
+ }
+
+ /** set up for fingerprint */
+ len = sizeof(buf);
+ tmp = buf;
+ *line = read_config_read_octet_string(*line, (u_char **)&tmp, &len);
+ tmp[len] = 0;
+ }
+ else
+ map->hashType = NS_HASH_SHA1;
+
+ /* look up the fingerprint */
+ tmpcert = netsnmp_cert_find(NS_CERT_REMOTE_PEER, NS_CERTKEY_MULTIPLE, buf);
+ if (NULL == tmpcert) {
+ /* assume it's a raw fingerprint we don't have */
+ netsnmp_fp_lowercase_and_strip_colon(buf);
+ map->fingerprint = strdup(buf);
+ } else {
+ map->fingerprint =
+ netsnmp_openssl_cert_get_fingerprint(tmpcert->ocert, -1);
+ }
+
+ if (NULL == *line) {
+ netsnmp_config_error("must specify map type");
+ goto end;
+ }
+
+ /* read the mapping type */
+ len = sizeof(buf);
+ tmp = buf;
+ *line = read_config_read_octet_string(*line, (u_char **)&tmp, &len);
+ tmp[len] = 0;
+ if ((buf[0] != '-') || (buf[1] != '-')) {
+ netsnmp_config_error("unexpected fromat: %s\n", *line);
+ goto end;
+ }
+ if (strcmp(&buf[2], "sn") == 0) {
+ if (NULL == *line) {
+ netsnmp_config_error("must specify secName for --sn");
+ goto end;
+ }
+ len = sizeof(buf);
+ tmp = buf;
+ *line = read_config_read_octet_string(*line, (u_char **)&tmp, &len);
+ map->data = strdup(buf);
+ if (map->data)
+ map->mapType = TSNM_tlstmCertSpecified;
+ }
+ else if (strcmp(&buf[2], "cn") == 0)
+ map->mapType = TSNM_tlstmCertCommonName;
+ else if (strcmp(&buf[2], "ip") == 0)
+ map->mapType = TSNM_tlstmCertSANIpAddress;
+ else if (strcmp(&buf[2], "rfc822") == 0)
+ map->mapType = TSNM_tlstmCertSANRFC822Name;
+ else if (strcmp(&buf[2], "dns") == 0)
+ map->mapType = TSNM_tlstmCertSANDNSName;
+ else if (strcmp(&buf[2], "any") == 0)
+ map->mapType = TSNM_tlstmCertSANAny;
+ else
+ netsnmp_config_error("unknown argument %s\n", buf);
+
+ end:
+ if (0 == map->mapType) {
+ netsnmp_cert_map_free(map);
+ map = NULL;
+ }
+
+ return map;
+}
+
+static void
+_parse_map(const char *token, char *line)
+{
+ netsnmp_cert_map *map = netsnmp_certToTSN_parse_common(&line);
+ if (NULL == map)
+ return;
+
+ if (netsnmp_cert_map_add(map) != 0) {
+ netsnmp_cert_map_free(map);
+ netsnmp_config_error(MAP_CONFIG_TOKEN
+ ": duplicate priority for certificate map");
+ }
+}
+
+static int
+_fill_cert_map(netsnmp_cert_map *cert_map, netsnmp_cert_map *entry)
+{
+ DEBUGMSGT(("cert:map:secname", "map: pri %d type %d data %s\n",
+ entry->priority, entry->mapType, entry->data));
+ cert_map->priority = entry->priority;
+ cert_map->mapType = entry->mapType;
+ cert_map->hashType = entry->hashType;
+ if (entry->data) {
+ cert_map->data = strdup(entry->data);
+ if (NULL == cert_map->data ) {
+ snmp_log(LOG_ERR, "secname map data dup failed\n");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ * get secname map(s) for fingerprints
+ */
+int
+netsnmp_cert_get_secname_maps(netsnmp_container *cert_maps)
+{
+ netsnmp_iterator *itr;
+ netsnmp_cert_map *cert_map, *new_cert_map, *entry;
+ netsnmp_container *new_maps = NULL;
+ netsnmp_void_array *results;
+ int j;
+
+ if ((NULL == cert_maps) || (CONTAINER_SIZE(cert_maps) == 0))
+ return -1;
+
+ DEBUGMSGT(("cert:map:secname", "looking for matches for %" NETSNMP_PRIz "d fingerprints\n",
+ CONTAINER_SIZE(cert_maps)));
+
+ /*
+ * duplicate cert_maps and then iterate over the copy. That way we can
+ * add/remove to cert_maps without distrubing the iterator.
+ */
+ new_maps = CONTAINER_DUP(cert_maps, NULL, 0);
+ if (NULL == new_maps) {
+ snmp_log(LOG_ERR, "could not duplicate maps for secname mapping\n");
+ return -1;
+ }
+
+ itr = CONTAINER_ITERATOR(new_maps);
+ if (NULL == itr) {
+ snmp_log(LOG_ERR, "could not get iterator for secname mappings\n");
+ CONTAINER_FREE(new_maps);
+ return -1;
+ }
+ cert_map = ITERATOR_FIRST(itr);
+ for( ; cert_map; cert_map = ITERATOR_NEXT(itr)) {
+
+ results = _find_subset_fp( netsnmp_cert_map_container(),
+ cert_map->fingerprint );
+ if (NULL == results) {
+ DEBUGMSGT(("cert:map:secname", "no match for %s\n",
+ cert_map->fingerprint));
+ if (CONTAINER_REMOVE(cert_maps, cert_map) != 0)
+ goto fail;
+ continue;
+ }
+ DEBUGMSGT(("cert:map:secname", "%" NETSNMP_PRIz "d matches for %s\n",
+ results->size, cert_map->fingerprint));
+ /*
+ * first entry is a freebie
+ */
+ entry = (netsnmp_cert_map*)results->array[0];
+ if (_fill_cert_map(cert_map, entry) != 0)
+ goto fail;
+
+ /*
+ * additional entries must be allocated/inserted
+ */
+ if (results->size > 1) {
+ for(j=1; j < results->size; ++j) {
+ entry = (netsnmp_cert_map*)results->array[j];
+ new_cert_map = netsnmp_cert_map_alloc(entry->fingerprint,
+ entry->ocert);
+ if (NULL == new_cert_map) {
+ snmp_log(LOG_ERR,
+ "could not allocate new cert map entry\n");
+ goto fail;
+ }
+ if (_fill_cert_map(new_cert_map, entry) != 0) {
+ netsnmp_cert_map_free(new_cert_map);
+ goto fail;
+ }
+ new_cert_map->ocert = cert_map->ocert;
+ if (CONTAINER_INSERT(cert_maps,new_cert_map) != 0) {
+ netsnmp_cert_map_free(new_cert_map);
+ goto fail;
+ }
+ } /* for results */
+ } /* results size > 1 */
+
+ free(results->array);
+ SNMP_FREE(results);
+ }
+ ITERATOR_RELEASE(itr);
+ CONTAINER_FREE(new_maps);
+
+ DEBUGMSGT(("cert:map:secname",
+ "found %" NETSNMP_PRIz "d matches for fingerprints\n",
+ CONTAINER_SIZE(cert_maps)));
+ return 0;
+
+ fail:
+ if (results) {
+ free(results->array);
+ free(results);
+ }
+ ITERATOR_RELEASE(itr);
+ CONTAINER_FREE(new_maps);
+ return -1;
+}
+
+/* ***************************************************************************
+ * ***************************************************************************
+ *
+ *
+ * snmpTlstmParmsTable data
+ *
+ *
+ * ***************************************************************************
+ * ***************************************************************************/
+#define PARAMS_CONFIG_TOKEN "snmpTlstmParams"
+static void _parse_params(const char *token, char *line);
+
+static void
+_init_tlstmParams(void)
+{
+ const char *params_help =
+ PARAMS_CONFIG_TOKEN " targetParamsName hashType:fingerPrint";
+
+ /*
+ * container for snmpTlstmParamsTable data
+ */
+ _tlstmParams = netsnmp_container_find("tlstmParams:string");
+ if (NULL == _tlstmParams)
+ snmp_log(LOG_ERR,
+ "error creating sub-container for tlstmParamsTable\n");
+ else
+ _tlstmParams->container_name = strdup("tlstmParams");
+
+ register_config_handler(NULL, PARAMS_CONFIG_TOKEN, _parse_params, NULL,
+ params_help);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TLSTMPARAMS_CONTAINER
+netsnmp_container *
+netsnmp_tlstmParams_container(void)
+{
+ return _tlstmParams;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TLSTMPARAMS_CONTAINER */
+
+snmpTlstmParams *
+netsnmp_tlstmParams_create(const char *name, int hashType, const char *fp,
+ int fp_len)
+{
+ snmpTlstmParams *stp = SNMP_MALLOC_TYPEDEF(snmpTlstmParams);
+ if (NULL == stp)
+ return NULL;
+
+ if (name)
+ stp->name = strdup(name);
+ stp->hashType = hashType;
+ if (fp)
+ stp->fingerprint = strdup(fp);
+ DEBUGMSGT(("9:tlstmParams:create", "0x%lx: %s\n", (u_long)stp,
+ stp->name ? stp->name : "null"));
+
+ return stp;
+}
+
+void
+netsnmp_tlstmParams_free(snmpTlstmParams *stp)
+{
+ if (NULL == stp)
+ return;
+
+ DEBUGMSGT(("9:tlstmParams:release", "0x%lx %s\n", (u_long)stp,
+ stp->name ? stp->name : "null"));
+ SNMP_FREE(stp->name);
+ SNMP_FREE(stp->fingerprint);
+ free(stp); /* SNMP_FREE pointless on parameter */
+}
+
+snmpTlstmParams *
+netsnmp_tlstmParams_restore_common(char **line)
+{
+ snmpTlstmParams *stp;
+ char *tmp, buf[SNMP_MAXBUF_SMALL];
+ size_t len;
+
+ if ((NULL == line) || (NULL == *line))
+ return NULL;
+
+ /** need somewhere to save rows */
+ netsnmp_assert(_tlstmParams);
+
+ stp = netsnmp_tlstmParams_create(NULL, 0, NULL, 0);
+ if (NULL == stp)
+ return NULL;
+
+ /** name */
+ len = sizeof(buf);
+ tmp = buf;
+ *line = read_config_read_octet_string(*line, (u_char **)&tmp, &len);
+ tmp[len] = 0;
+ /** xxx-rks: validate snmpadminstring? */
+ if (len)
+ stp->name = strdup(buf);
+
+ /** fingerprint hash type*/
+ len = sizeof(buf);
+ tmp = buf;
+ *line = read_config_read_octet_string(*line, (u_char **)&tmp, &len);
+ tmp[len] = 0;
+ if ((buf[0] == '-') && (buf[1] == '-')) {
+ stp->hashType = netsnmp_cert_parse_hash_type(&buf[2]);
+
+ /** set up for fingerprint */
+ len = sizeof(buf);
+ tmp = buf;
+ *line = read_config_read_octet_string(*line, (u_char **)&tmp, &len);
+ tmp[len] = 0;
+ }
+ else
+ stp->hashType =NS_HASH_SHA1;
+
+ netsnmp_fp_lowercase_and_strip_colon(buf);
+ stp->fingerprint = strdup(buf);
+ stp->fingerprint_len = strlen(buf);
+
+ DEBUGMSGTL(("tlstmParams:restore:common", "name '%s'\n", stp->name));
+
+ return stp;
+}
+
+int
+netsnmp_tlstmParams_add(snmpTlstmParams *stp)
+{
+ if (NULL == stp)
+ return -1;
+
+ DEBUGMSGTL(("tlstmParams:add", "adding entry 0x%lx %s\n", (u_long)stp,
+ stp->name));
+
+ if (CONTAINER_INSERT(_tlstmParams, stp) != 0) {
+ snmp_log(LOG_ERR, "error inserting tlstmParams %s", stp->name);
+ netsnmp_tlstmParams_free(stp);
+ return -1;
+ }
+
+ return 0;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TLSTMPARAMS_REMOVE
+int
+netsnmp_tlstmParams_remove(snmpTlstmParams *stp)
+{
+ if (NULL == stp)
+ return -1;
+
+ DEBUGMSGTL(("tlstmParams:remove", "removing entry 0x%lx %s\n", (u_long)stp,
+ stp->name));
+
+ if (CONTAINER_REMOVE(_tlstmParams, stp) != 0) {
+ snmp_log(LOG_ERR, "error removing tlstmParams %s", stp->name);
+ return -1;
+ }
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TLSTMPARAMS_REMOVE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TLSTMPARAMS_FIND
+snmpTlstmParams *
+netsnmp_tlstmParams_find(snmpTlstmParams *stp)
+{
+ snmpTlstmParams *found;
+
+ if (NULL == stp)
+ return NULL;
+
+ found = CONTAINER_FIND(_tlstmParams, stp);
+ return found;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TLSTMPARAMS_FIND */
+
+static void
+_parse_params(const char *token, char *line)
+{
+ snmpTlstmParams *stp = netsnmp_tlstmParams_restore_common(&line);
+
+ if (!stp)
+ return;
+
+ stp->flags = TLSTM_PARAMS_FROM_CONFIG | TLSTM_PARAMS_NONVOLATILE;
+
+ netsnmp_tlstmParams_add(stp);
+}
+
+static char *
+_find_tlstmParams_fingerprint(const char *name)
+{
+ snmpTlstmParams lookup_key, *result;
+
+ if (NULL == name)
+ return NULL;
+
+ lookup_key.name = NETSNMP_REMOVE_CONST(char*, name);
+
+ result = CONTAINER_FIND(_tlstmParams, &lookup_key);
+ if ((NULL == result) || (NULL == result->fingerprint))
+ return NULL;
+
+ return strdup(result->fingerprint);
+}
+/*
+ * END snmpTlstmParmsTable data
+ * ***************************************************************************/
+
+/* ***************************************************************************
+ * ***************************************************************************
+ *
+ *
+ * snmpTlstmAddrTable data
+ *
+ *
+ * ***************************************************************************
+ * ***************************************************************************/
+#define ADDR_CONFIG_TOKEN "snmpTlstmAddr"
+static void _parse_addr(const char *token, char *line);
+
+static void
+_init_tlstmAddr(void)
+{
+ const char *addr_help =
+ ADDR_CONFIG_TOKEN " targetAddrName hashType:fingerprint serverIdentity";
+
+ /*
+ * container for snmpTlstmAddrTable data
+ */
+ _tlstmAddr = netsnmp_container_find("tlstmAddr:string");
+ if (NULL == _tlstmAddr)
+ snmp_log(LOG_ERR,
+ "error creating sub-container for tlstmAddrTable\n");
+ else
+ _tlstmAddr->container_name = strdup("tlstmAddr");
+
+ register_config_handler(NULL, ADDR_CONFIG_TOKEN, _parse_addr, NULL,
+ addr_help);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TLSTMADDR_CONTAINER
+netsnmp_container *
+netsnmp_tlstmAddr_container(void)
+{
+ return _tlstmAddr;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TLSTMADDR_CONTAINER */
+
+/*
+ * create a new row in the table
+ */
+snmpTlstmAddr *
+netsnmp_tlstmAddr_create(char *targetAddrName)
+{
+ snmpTlstmAddr *entry;
+
+ if (NULL == targetAddrName)
+ return NULL;
+
+ entry = SNMP_MALLOC_TYPEDEF(snmpTlstmAddr);
+ if (!entry)
+ return NULL;
+
+ DEBUGMSGT(("tlstmAddr:entry:create", "entry %p %s\n", entry,
+ targetAddrName ? targetAddrName : "NULL"));
+
+ entry->name = strdup(targetAddrName);
+
+ return entry;
+}
+
+void
+netsnmp_tlstmAddr_free(snmpTlstmAddr *entry)
+{
+ if (!entry)
+ return;
+
+ SNMP_FREE(entry->name);
+ SNMP_FREE(entry->fingerprint);
+ SNMP_FREE(entry->identity);
+ free(entry);
+}
+
+int
+netsnmp_tlstmAddr_restore_common(char **line, char *name, size_t *name_len,
+ char *id, size_t *id_len, char *fp,
+ size_t *fp_len, u_char *ht)
+{
+ size_t fp_len_save = *fp_len;
+
+ *line = read_config_read_octet_string(*line, (u_char **)&name, name_len);
+ if (NULL == *line) {
+ config_perror("incomplete line");
+ return -1;
+ }
+ name[*name_len] = 0;
+
+ *line = read_config_read_octet_string(*line, (u_char **)&fp, fp_len);
+ if (NULL == *line) {
+ config_perror("incomplete line");
+ return -1;
+ }
+ fp[*fp_len] = 0;
+ if ((fp[0] == '-') && (fp[1] == '-')) {
+ *ht = netsnmp_cert_parse_hash_type(&fp[2]);
+
+ /** set up for fingerprint */
+ *fp_len = fp_len_save;
+ *line = read_config_read_octet_string(*line, (u_char **)&fp, fp_len);
+ fp[*fp_len] = 0;
+ }
+ else
+ *ht = NS_HASH_SHA1;
+ netsnmp_fp_lowercase_and_strip_colon(fp);
+ *fp_len = strlen(fp);
+
+ *line = read_config_read_octet_string(*line, (u_char **)&id, id_len);
+ id[*id_len] = 0;
+
+ if (*ht <= NS_HASH_NONE || *ht > NS_HASH_MAX) {
+ config_perror("invalid algorithm for fingerprint");
+ return -1;
+ }
+
+ if ((0 == *fp_len) && ((0 == *id_len || (*id_len == 1 && id[0] == '*')))) {
+ /*
+ * empty fingerprint not allowed with '*' identity
+ */
+ config_perror("must specify fingerprint for '*' identity");
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+netsnmp_tlstmAddr_add(snmpTlstmAddr *entry)
+{
+ if (!entry)
+ return -1;
+
+ DEBUGMSGTL(("tlstmAddr:add", "adding entry 0x%lx %s %s\n",
+ (u_long)entry, entry->name, entry->fingerprint));
+ if (CONTAINER_INSERT(_tlstmAddr, entry) != 0) {
+ snmp_log(LOG_ERR, "could not insert addr %s", entry->name);
+ netsnmp_tlstmAddr_free(entry);
+ return -1;
+ }
+
+ return 0;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TLSTMADDR_REMOVE
+int
+netsnmp_tlstmAddr_remove(snmpTlstmAddr *entry)
+{
+ if (!entry)
+ return -1;
+
+ if (CONTAINER_REMOVE(_tlstmAddr, entry) != 0) {
+ snmp_log(LOG_ERR, "could not remove addr %s", entry->name);
+ return -1;
+ }
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TLSTMADDR_REMOVE */
+
+static void
+_parse_addr(const char *token, char *line)
+{
+ snmpTlstmAddr *entry;
+ char name[SNMPADMINLENGTH + 1], id[SNMPADMINLENGTH + 1],
+ fingerprint[SNMPTLSFINGERPRINT_MAX_LEN + 1];
+ size_t name_len = sizeof(name), id_len = sizeof(id),
+ fp_len = sizeof(fingerprint);
+ u_char hashType;
+ int rc;
+
+ rc = netsnmp_tlstmAddr_restore_common(&line, name, &name_len, id, &id_len,
+ fingerprint, &fp_len, &hashType);
+ if (rc < 0)
+ return;
+
+ if (NULL != line)
+ config_pwarn("ignore extra tokens on line");
+
+ entry = netsnmp_tlstmAddr_create(name);
+ if (NULL == entry)
+ return;
+
+ entry->flags |= TLSTM_ADDR_FROM_CONFIG;
+ entry->hashType = hashType;
+ if (fp_len)
+ entry->fingerprint = strdup(fingerprint);
+ if (id_len)
+ entry->identity = strdup(id);
+
+ netsnmp_tlstmAddr_add(entry);
+}
+
+static char *
+_find_tlstmAddr_fingerprint(const char *name)
+{
+ snmpTlstmAddr lookup_key, *result;
+
+ if (NULL == name)
+ return NULL;
+
+ lookup_key.name = NETSNMP_REMOVE_CONST(char*, name);
+
+ result = CONTAINER_FIND(_tlstmAddr, &lookup_key);
+ if (NULL == result)
+ return NULL;
+
+ return result->fingerprint;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TLSTMADDR_GET_SERVERID
+char *
+netsnmp_tlstmAddr_get_serverId(const char *name)
+{
+ snmpTlstmAddr lookup_key, *result;
+
+ if (NULL == name)
+ return NULL;
+
+ lookup_key.name = NETSNMP_REMOVE_CONST(char*, name);
+
+ result = CONTAINER_FIND(_tlstmAddr, &lookup_key);
+ if (NULL == result)
+ return NULL;
+
+ return result->identity;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TLSTMADDR_GET_SERVERID */
+/*
+ * END snmpTlstmAddrTable data
+ * ***************************************************************************/
+
+#else
+netsnmp_feature_unused(cert_util);
+#endif /* NETSNMP_FEATURE_REMOVE_CERT_UTIL */
+netsnmp_feature_unused(cert_util);
+#endif /* defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL) */
diff --git a/snmplib/check_varbind.c b/snmplib/check_varbind.c
new file mode 100644
index 0000000..12b7a52
--- /dev/null
+++ b/snmplib/check_varbind.c
@@ -0,0 +1,283 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/library/check_varbind.h>
+
+netsnmp_feature_child_of(check_varbind_all, libnetsnmp)
+
+netsnmp_feature_child_of(check_vb_range, check_varbind_all)
+netsnmp_feature_child_of(check_vb_size_range, check_varbind_all)
+netsnmp_feature_child_of(check_vb_uint, check_varbind_all)
+netsnmp_feature_child_of(check_vb_storagetype, check_varbind_all)
+netsnmp_feature_child_of(check_vb_oid, check_varbind_all)
+netsnmp_feature_child_of(check_vb_type_and_max_size, check_varbind_all)
+netsnmp_feature_child_of(check_vb_type_and_max_size, check_varbind_all)
+netsnmp_feature_child_of(check_vb_rowstatus_with_storagetype, check_varbind_all)
+netsnmp_feature_child_of(check_vb_truthvalue, check_varbind_all)
+
+#ifdef NETSNMP_FEATURE_REQUIRE_CHECK_VB_ROWSTATUS_WITH_STORAGETYPE
+netsnmp_feature_require(check_rowstatus_with_storagetype_transition)
+#endif /* NETSNMP_FEATURE_REQUIRES_CHECK_VB_ROWSTATUS_WITH_STORAGETYPE */
+
+
+NETSNMP_INLINE int
+netsnmp_check_vb_type(const netsnmp_variable_list *var, int type )
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if (var->type != type) {
+ rc = SNMP_ERR_WRONGTYPE;
+ }
+
+ return rc;
+}
+
+NETSNMP_INLINE int
+netsnmp_check_vb_size(const netsnmp_variable_list *var, size_t size )
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ else if (var->val_len != size) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+
+ return rc;
+}
+
+NETSNMP_INLINE int
+netsnmp_check_vb_max_size(const netsnmp_variable_list *var, size_t size )
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ else if (var->val_len > size) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+
+ return rc;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_VB_RANGE
+NETSNMP_INLINE int
+netsnmp_check_vb_range(const netsnmp_variable_list *var,
+ size_t low, size_t high )
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if (((size_t)*var->val.integer < low) || ((size_t)*var->val.integer > high)) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+
+ return rc;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_VB_RANGE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_VB_SIZE_RANGE
+NETSNMP_INLINE int
+netsnmp_check_vb_size_range(const netsnmp_variable_list *var,
+ size_t low, size_t high )
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((var->val_len < low) || (var->val_len > high)) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+
+ return rc;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_VB_SIZE_RANGE */
+
+NETSNMP_INLINE int
+netsnmp_check_vb_type_and_size(const netsnmp_variable_list *var,
+ int type, size_t size)
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((rc = netsnmp_check_vb_type(var,type)))
+ ;
+ else
+ rc = netsnmp_check_vb_size(var, size);
+
+ return rc;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_VB_TYPE_AND_MAX_SIZE
+NETSNMP_INLINE int
+netsnmp_check_vb_type_and_max_size(const netsnmp_variable_list *var,
+ int type, size_t size)
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((rc = netsnmp_check_vb_type(var,type)))
+ ;
+ else
+ rc = netsnmp_check_vb_max_size(var, size);
+
+ return rc;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_VB_TYPE_AND_MAX_SIZE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_VB_OID
+NETSNMP_INLINE int
+netsnmp_check_vb_oid(const netsnmp_variable_list *var)
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((rc = netsnmp_check_vb_type(var,ASN_OBJECT_ID)))
+ ;
+ else
+ rc = netsnmp_check_vb_max_size(var, MAX_OID_LEN*sizeof(oid));
+
+ return rc;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_VB_OID */
+
+NETSNMP_INLINE int
+netsnmp_check_vb_int(const netsnmp_variable_list *var)
+{
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ return netsnmp_check_vb_type_and_size(var, ASN_INTEGER, sizeof(long));
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_VB_UINT
+NETSNMP_INLINE int
+netsnmp_check_vb_uint(const netsnmp_variable_list *var)
+{
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ return netsnmp_check_vb_type_and_size(var, ASN_UNSIGNED, sizeof(long));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_VB_UINT */
+
+NETSNMP_INLINE int
+netsnmp_check_vb_int_range(const netsnmp_variable_list *var, int low, int high)
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER, sizeof(long))))
+ return rc;
+
+ if ((*var->val.integer < low) || (*var->val.integer > high)) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+
+ return rc;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_VB_TRUTHVALUE
+int
+netsnmp_check_vb_truthvalue(const netsnmp_variable_list *var)
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER, sizeof(long))))
+ return rc;
+
+ return netsnmp_check_vb_int_range(var, 1, 2);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_VB_TRUTHVALUE */
+
+NETSNMP_INLINE int
+netsnmp_check_vb_rowstatus_value(const netsnmp_variable_list *var)
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER, sizeof(long))))
+ return rc;
+
+ if (*var->val.integer == RS_NOTREADY)
+ return SNMP_ERR_WRONGVALUE;
+
+ return netsnmp_check_vb_int_range(var, SNMP_ROW_NONEXISTENT,
+ SNMP_ROW_DESTROY);
+}
+
+int
+netsnmp_check_vb_rowstatus(const netsnmp_variable_list *var, int old_value)
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((rc = netsnmp_check_vb_rowstatus_value(var)))
+ return rc;
+
+ return check_rowstatus_transition(old_value, *var->val.integer);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_VB_ROWSTATUS_WITH_STORAGETYPE
+int
+netsnmp_check_vb_rowstatus_with_storagetype(const netsnmp_variable_list *var,
+ int old_value, int old_storage)
+{
+ register int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((rc = netsnmp_check_vb_rowstatus_value(var)))
+ return rc;
+
+ return check_rowstatus_with_storagetype_transition(old_value,
+ *var->val.integer,
+ old_storage);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_VB_ROWSTATUS_WITH_STORAGETYPE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_VB_STORAGETYPE
+int
+netsnmp_check_vb_storagetype(const netsnmp_variable_list *var, int old_value)
+{
+ int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == var)
+ return SNMP_ERR_GENERR;
+
+ if ((rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER, sizeof(long))))
+ return rc;
+
+ if ((rc = netsnmp_check_vb_int_range(var, SNMP_STORAGE_NONE,
+ SNMP_STORAGE_READONLY)))
+ return rc;
+
+ return check_storage_transition(old_value, *var->val.integer);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_VB_STORAGETYPE */
diff --git a/snmplib/closedir.c b/snmplib/closedir.c
new file mode 100644
index 0000000..8c4c50e
--- /dev/null
+++ b/snmplib/closedir.c
@@ -0,0 +1,20 @@
+/*
+ * closedir() replacement for MSVC.
+ */
+
+#define WIN32IO_IS_STDIO
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/types.h>
+#include <net-snmp/library/system.h>
+
+/*
+ * free the memory allocated by opendir
+ */
+int
+closedir(DIR * dirp)
+{
+ free(dirp->start);
+ free(dirp);
+ return 1;
+}
diff --git a/snmplib/container.c b/snmplib/container.c
new file mode 100644
index 0000000..b2ac97e
--- /dev/null
+++ b/snmplib/container.c
@@ -0,0 +1,714 @@
+/* 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 (C) 2007 Apple, 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/container_binary_array.h>
+#include <net-snmp/library/container_list_ssll.h>
+#include <net-snmp/library/container_null.h>
+
+netsnmp_feature_child_of(container_all, libnetsnmp)
+
+netsnmp_feature_child_of(container_factories, container_all)
+netsnmp_feature_child_of(container_types, container_all)
+netsnmp_feature_child_of(container_compare, container_all)
+netsnmp_feature_child_of(container_dup, container_all)
+netsnmp_feature_child_of(container_free_all, container_all)
+netsnmp_feature_child_of(subcontainer_find, container_all)
+
+netsnmp_feature_child_of(container_ncompare_cstring, container_compare)
+netsnmp_feature_child_of(container_compare_mem, container_compare)
+netsnmp_feature_child_of(container_compare_long, container_compare)
+netsnmp_feature_child_of(container_compare_ulong, container_compare)
+netsnmp_feature_child_of(container_compare_int32, container_compare)
+netsnmp_feature_child_of(container_compare_uint32, container_compare)
+
+netsnmp_feature_child_of(container_find_factory, container_factories)
+
+/** @defgroup container container
+ */
+
+/*------------------------------------------------------------------
+ */
+static netsnmp_container *containers = NULL;
+
+typedef struct container_type_s {
+ const char *name;
+ netsnmp_factory *factory;
+ netsnmp_container_compare *compare;
+} container_type;
+
+netsnmp_factory *
+netsnmp_container_get_factory(const char *type);
+
+/*------------------------------------------------------------------
+ */
+static void
+_factory_free(void *dat, void *context)
+{
+ container_type *data = (container_type *)dat;
+ if (data == NULL)
+ return;
+
+ if (data->name != NULL) {
+ DEBUGMSGTL(("container", " _factory_free_list() called for %s\n",
+ data->name));
+ free(NETSNMP_REMOVE_CONST(void *, data->name)); /* SNMP_FREE wasted on object about to be freed */
+ }
+ free(data); /* SNMP_FREE wasted on param */
+}
+
+/*------------------------------------------------------------------
+ */
+void
+netsnmp_container_init_list(void)
+{
+ if (NULL != containers)
+ return;
+
+ /*
+ * create a binary arry container to hold container
+ * factories
+ */
+ containers = netsnmp_container_get_binary_array();
+ containers->compare = netsnmp_compare_cstring;
+ containers->container_name = strdup("container list");
+
+ /*
+ * register containers
+ */
+ netsnmp_container_binary_array_init();
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_LINKED_LIST
+ netsnmp_container_ssll_init();
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_LINKED_LIST */
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_NULL
+ netsnmp_container_null_init();
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_NULL */
+
+ /*
+ * default aliases for some containers
+ */
+ netsnmp_container_register("table_container",
+ netsnmp_container_get_factory("binary_array"));
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_LINKED_LIST
+ netsnmp_container_register("linked_list",
+ netsnmp_container_get_factory("sorted_singly_linked_list"));
+ netsnmp_container_register("ssll_container",
+ netsnmp_container_get_factory("sorted_singly_linked_list"));
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_LINKED_LIST */
+
+ netsnmp_container_register_with_compare
+ ("cstring", netsnmp_container_get_factory("binary_array"),
+ netsnmp_compare_direct_cstring);
+
+ netsnmp_container_register_with_compare
+ ("string", netsnmp_container_get_factory("binary_array"),
+ netsnmp_compare_cstring);
+ netsnmp_container_register_with_compare
+ ("string_binary_array", netsnmp_container_get_factory("binary_array"),
+ netsnmp_compare_cstring);
+
+}
+
+void
+netsnmp_container_free_list(void)
+{
+ DEBUGMSGTL(("container", "netsnmp_container_free_list() called\n"));
+ if (containers == NULL)
+ return;
+
+ /*
+ * free memory used by each factory entry
+ */
+ CONTAINER_FOR_EACH(containers, ((netsnmp_container_obj_func *)_factory_free), NULL);
+
+ /*
+ * free factory container
+ */
+ CONTAINER_FREE(containers);
+ containers = NULL;
+}
+
+int
+netsnmp_container_register_with_compare(const char* name, netsnmp_factory *f,
+ netsnmp_container_compare *c)
+{
+ container_type *ct, tmp;
+
+ if (NULL==containers)
+ return -1;
+
+ tmp.name = NETSNMP_REMOVE_CONST(char *, name);
+ ct = (container_type *)CONTAINER_FIND(containers, &tmp);
+ if (NULL!=ct) {
+ DEBUGMSGT(("container_registry",
+ "replacing previous container factory\n"));
+ ct->factory = f;
+ }
+ else {
+ ct = SNMP_MALLOC_TYPEDEF(container_type);
+ if (NULL == ct)
+ return -1;
+ ct->name = strdup(name);
+ ct->factory = f;
+ ct->compare = c;
+ CONTAINER_INSERT(containers, ct);
+ }
+ DEBUGMSGT(("container_registry", "registered container factory %s (%s)\n",
+ ct->name, f->product));
+
+ return 0;
+}
+
+int
+netsnmp_container_register(const char* name, netsnmp_factory *f)
+{
+ return netsnmp_container_register_with_compare(name, f, NULL);
+}
+
+/*------------------------------------------------------------------
+ */
+netsnmp_factory *
+netsnmp_container_get_factory(const char *type)
+{
+ container_type ct, *found;
+
+ if (NULL==containers)
+ return NULL;
+
+ ct.name = type;
+ found = (container_type *)CONTAINER_FIND(containers, &ct);
+
+ return found ? found->factory : NULL;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_FIND_FACTORY
+netsnmp_factory *
+netsnmp_container_find_factory(const char *type_list)
+{
+ netsnmp_factory *f = NULL;
+ char *list, *entry;
+ char *st = NULL;
+
+ if (NULL==type_list)
+ return NULL;
+
+ list = strdup(type_list);
+ entry = strtok_r(list, ":", &st);
+ while(entry) {
+ f = netsnmp_container_get_factory(entry);
+ if (NULL != f)
+ break;
+ entry = strtok_r(NULL, ":", &st);
+ }
+
+ free(list);
+ return f;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_FIND_FACTORY */
+
+/*------------------------------------------------------------------
+ */
+static container_type *
+netsnmp_container_get_ct(const char *type)
+{
+ container_type ct;
+
+ if (NULL == containers)
+ return NULL;
+
+ ct.name = type;
+ return (container_type *)CONTAINER_FIND(containers, &ct);
+}
+
+static container_type *
+netsnmp_container_find_ct(const char *type_list)
+{
+ container_type *ct = NULL;
+ char *list, *entry;
+ char *st = NULL;
+
+ if (NULL==type_list)
+ return NULL;
+
+ list = strdup(type_list);
+ entry = strtok_r(list, ":", &st);
+ while(entry) {
+ ct = netsnmp_container_get_ct(entry);
+ if (NULL != ct)
+ break;
+ entry = strtok_r(NULL, ":", &st);
+ }
+
+ free(list);
+ return ct;
+}
+
+
+
+/*------------------------------------------------------------------
+ */
+netsnmp_container *
+netsnmp_container_get(const char *type)
+{
+ netsnmp_container *c;
+ container_type *ct = netsnmp_container_get_ct(type);
+ if (ct) {
+ c = (netsnmp_container *)(ct->factory->produce());
+ if (c && ct->compare)
+ c->compare = ct->compare;
+ return c;
+ }
+
+ return NULL;
+}
+
+/*------------------------------------------------------------------
+ */
+netsnmp_container *
+netsnmp_container_find(const char *type)
+{
+ container_type *ct = netsnmp_container_find_ct(type);
+ netsnmp_container *c = ct ? (netsnmp_container *)(ct->factory->produce()) : NULL;
+
+ /*
+ * provide default compare
+ */
+ if (c) {
+ if (ct->compare)
+ c->compare = ct->compare;
+ else if (NULL == c->compare)
+ c->compare = netsnmp_compare_netsnmp_index;
+ }
+
+ return c;
+}
+
+/*------------------------------------------------------------------
+ */
+void
+netsnmp_container_add_index(netsnmp_container *primary,
+ netsnmp_container *new_index)
+{
+ netsnmp_container *curr = primary;
+
+ if((NULL == new_index) || (NULL == primary)) {
+ snmp_log(LOG_ERR, "add index called with null pointer\n");
+ return;
+ }
+
+ while(curr->next)
+ curr = curr->next;
+
+ curr->next = new_index;
+ new_index->prev = curr;
+}
+
+/*------------------------------------------------------------------
+ * These functions should EXACTLY match the inline version in
+ * container.h. If you change one, change them both.
+ */
+int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k)
+{
+ while(x && x->insert_filter && x->insert_filter(x,k) == 1)
+ x = x->next;
+ if(x) {
+ int rc = x->insert(x,k);
+ if(rc)
+ snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n",
+ x->container_name ? x->container_name : "", rc);
+ else {
+ rc = CONTAINER_INSERT_HELPER(x->next, k);
+ if(rc)
+ x->remove(x,k);
+ }
+ return rc;
+ }
+ return 0;
+}
+
+/*------------------------------------------------------------------
+ * These functions should EXACTLY match the inline version in
+ * container.h. If you change one, change them both.
+ */
+int CONTAINER_INSERT(netsnmp_container* x, const void* k)
+{
+ /** start at first container */
+ while(x->prev)
+ x = x->prev;
+ return CONTAINER_INSERT_HELPER(x, k);
+}
+
+/*------------------------------------------------------------------
+ * These functions should EXACTLY match the inline version in
+ * container.h. If you change one, change them both.
+ */
+int CONTAINER_REMOVE(netsnmp_container *x, const void *k)
+{
+ int rc2, rc = 0;
+
+ /** start at last container */
+ while(x->next)
+ x = x->next;
+ while(x) {
+ rc2 = x->remove(x,k);
+ /** ignore remove errors if there is a filter in place */
+ if ((rc2) && (NULL == x->insert_filter)) {
+ snmp_log(LOG_ERR,"error on subcontainer '%s' remove (%d)\n",
+ x->container_name ? x->container_name : "", rc2);
+ rc = rc2;
+ }
+ x = x->prev;
+
+ }
+ return rc;
+}
+
+/*------------------------------------------------------------------
+ * These functions should EXACTLY match the function version in
+ * container.c. If you change one, change them both.
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_DUP
+netsnmp_container *CONTAINER_DUP(netsnmp_container *x, void *ctx, u_int flags)
+{
+ if (NULL == x->duplicate) {
+ snmp_log(LOG_ERR, "container '%s' does not support duplicate\n",
+ x->container_name ? x->container_name : "");
+ return NULL;
+ }
+ return x->duplicate(x, ctx, flags);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_DUP */
+
+/*------------------------------------------------------------------
+ * These functions should EXACTLY match the inline version in
+ * container.h. If you change one, change them both.
+ */
+int CONTAINER_FREE(netsnmp_container *x)
+{
+ int rc2, rc = 0;
+
+ /** start at last container */
+ while(x->next)
+ x = x->next;
+ while(x) {
+ netsnmp_container *tmp;
+ char *name;
+ tmp = x->prev;
+ name = x->container_name;
+ x->container_name = NULL;
+ rc2 = x->cfree(x);
+ if (rc2) {
+ snmp_log(LOG_ERR,"error on subcontainer '%s' cfree (%d)\n",
+ name ? name : "", rc2);
+ rc = rc2;
+ }
+ SNMP_FREE(name);
+ x = tmp;
+ }
+ return rc;
+}
+
+/*------------------------------------------------------------------
+ * These functions should EXACTLY match the function version in
+ * container.c. If you change one, change them both.
+ */
+/*
+ * clear all containers. When clearing the *first* container, and
+ * *only* the first container, call the function f for each item.
+ * After calling this function, all containers should be empty.
+ */
+void CONTAINER_CLEAR(netsnmp_container *x, netsnmp_container_obj_func *f,
+ void *c)
+{
+ /** start at last container */
+ while(x->next)
+ x = x->next;
+ while(x->prev) {
+ x->clear(x, NULL, c);
+ x = x->prev;
+ }
+ x->clear(x, f, c);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_FREE_ALL
+/*
+ * clear all containers. When clearing the *first* container, and
+ * *only* the first container, call the free_item function for each item.
+ * After calling this function, all containers should be empty.
+ */
+void CONTAINER_FREE_ALL(netsnmp_container *x, void *c)
+{
+ CONTAINER_CLEAR(x, x->free_item, c);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_FREE_ALL */
+
+#ifndef NETSNMP_FEATURE_REMOVE_SUBCONTAINER_FIND
+/*------------------------------------------------------------------
+ * These functions should EXACTLY match the function version in
+ * container.c. If you change one, change them both.
+ */
+/*
+ * Find a sub-container with the given name
+ */
+netsnmp_container *SUBCONTAINER_FIND(netsnmp_container *x,
+ const char* name)
+{
+ if ((NULL == x) || (NULL == name))
+ return NULL;
+
+ /** start at first container */
+ while(x->prev)
+ x = x->prev;
+ while(x) {
+ if ((NULL != x->container_name) && (0 == strcmp(name,x->container_name)))
+ break;
+ x = x->next;
+ }
+ return x;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SUBCONTAINER_FIND */
+
+
+/*------------------------------------------------------------------
+ */
+void
+netsnmp_init_container(netsnmp_container *c,
+ netsnmp_container_rc *init,
+ netsnmp_container_rc *cfree,
+ netsnmp_container_size *size,
+ netsnmp_container_compare *cmp,
+ netsnmp_container_op *ins,
+ netsnmp_container_op *rem,
+ netsnmp_container_rtn *fnd)
+{
+ if (c == NULL)
+ return;
+
+ c->init = init;
+ c->cfree = cfree;
+ c->get_size = size;
+ c->compare = cmp;
+ c->insert = ins;
+ c->remove = rem;
+ c->find = fnd;
+ c->free_item = netsnmp_container_simple_free;
+}
+
+int
+netsnmp_container_data_dup(netsnmp_container *dup, netsnmp_container *c)
+{
+ if (!dup || !c)
+ return -1;
+
+ if (c->container_name)
+ dup->container_name = strdup(c->container_name);
+ dup->compare = c->compare;
+ dup->ncompare = c->ncompare;
+ dup->release = c->release;
+ dup->insert_filter = c->insert_filter;
+ dup->free_item = c->free_item;
+ dup->sync = c->sync;
+ dup->flags = c->flags;
+
+ return 0;
+}
+
+/*------------------------------------------------------------------
+ *
+ * simple comparison routines
+ *
+ */
+int
+netsnmp_compare_netsnmp_index(const void *lhs, const void *rhs)
+{
+ int rc;
+ netsnmp_assert((NULL != lhs) && (NULL != rhs));
+ DEBUGIF("compare:index") {
+ DEBUGMSGT(("compare:index", "compare "));
+ DEBUGMSGSUBOID(("compare:index", ((const netsnmp_index *) lhs)->oids,
+ ((const netsnmp_index *) lhs)->len));
+ DEBUGMSG(("compare:index", " to "));
+ DEBUGMSGSUBOID(("compare:index", ((const netsnmp_index *) rhs)->oids,
+ ((const netsnmp_index *) rhs)->len));
+ DEBUGMSG(("compare:index", "\n"));
+ }
+ rc = snmp_oid_compare(((const netsnmp_index *) lhs)->oids,
+ ((const netsnmp_index *) lhs)->len,
+ ((const netsnmp_index *) rhs)->oids,
+ ((const netsnmp_index *) rhs)->len);
+ DEBUGMSGT(("compare:index", "result was %d\n", rc));
+ return rc;
+}
+
+int
+netsnmp_ncompare_netsnmp_index(const void *lhs, const void *rhs)
+{
+ int rc;
+ netsnmp_assert((NULL != lhs) && (NULL != rhs));
+ DEBUGIF("compare:index") {
+ DEBUGMSGT(("compare:index", "compare "));
+ DEBUGMSGSUBOID(("compare:index", ((const netsnmp_index *) lhs)->oids,
+ ((const netsnmp_index *) lhs)->len));
+ DEBUGMSG(("compare:index", " to "));
+ DEBUGMSGSUBOID(("compare:index", ((const netsnmp_index *) rhs)->oids,
+ ((const netsnmp_index *) rhs)->len));
+ DEBUGMSG(("compare:index", "\n"));
+ }
+ rc = snmp_oid_ncompare(((const netsnmp_index *) lhs)->oids,
+ ((const netsnmp_index *) lhs)->len,
+ ((const netsnmp_index *) rhs)->oids,
+ ((const netsnmp_index *) rhs)->len,
+ ((const netsnmp_index *) rhs)->len);
+ DEBUGMSGT(("compare:index", "result was %d\n", rc));
+ return rc;
+}
+
+int
+netsnmp_compare_cstring(const void * lhs, const void * rhs)
+{
+ return strcmp(((const container_type*)lhs)->name,
+ ((const container_type*)rhs)->name);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_NCOMPARE_CSTRING
+int
+netsnmp_ncompare_cstring(const void * lhs, const void * rhs)
+{
+ return strncmp(((const container_type*)lhs)->name,
+ ((const container_type*)rhs)->name,
+ strlen(((const container_type*)rhs)->name));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_NCOMPARE_CSTRING */
+
+int
+netsnmp_compare_direct_cstring(const void * lhs, const void * rhs)
+{
+ return strcmp((const char*)lhs, (const char*)rhs);
+}
+
+/*
+ * compare two memory buffers
+ *
+ * since snmp strings aren't NULL terminated, we can't use strcmp. So
+ * compare up to the length of the smaller, and then use length to
+ * break any ties.
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_MEM
+int
+netsnmp_compare_mem(const char * lhs, size_t lhs_len,
+ const char * rhs, size_t rhs_len)
+{
+ int rc, min = SNMP_MIN(lhs_len, rhs_len);
+
+ rc = memcmp(lhs, rhs, min);
+ if((rc==0) && (lhs_len != rhs_len)) {
+ if(lhs_len < rhs_len)
+ rc = -1;
+ else
+ rc = 1;
+ }
+
+ return rc;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_MEM */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_LONG
+int
+netsnmp_compare_long(const void * lhs, const void * rhs)
+{
+ typedef struct { long index; } dummy;
+
+ const dummy *lhd = (const dummy*)lhs;
+ const dummy *rhd = (const dummy*)rhs;
+
+ if (lhd->index < rhd->index)
+ return -1;
+ else if (lhd->index > rhd->index)
+ return 1;
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_LONG */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_ULONG
+int
+netsnmp_compare_ulong(const void * lhs, const void * rhs)
+{
+ typedef struct { u_long index; } dummy;
+
+ const dummy *lhd = (const dummy*)lhs;
+ const dummy *rhd = (const dummy*)rhs;
+
+ if (lhd->index < rhd->index)
+ return -1;
+ else if (lhd->index > rhd->index)
+ return 1;
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_ULONG */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_INT32
+int
+netsnmp_compare_int32(const void * lhs, const void * rhs)
+{
+ typedef struct { int32_t index; } dummy;
+
+ const dummy *lhd = (const dummy*)lhs;
+ const dummy *rhd = (const dummy*)rhs;
+
+ if (lhd->index < rhd->index)
+ return -1;
+ else if (lhd->index > rhd->index)
+ return 1;
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_INT32 */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_UINT32
+int
+netsnmp_compare_uint32(const void * lhs, const void * rhs)
+{
+ typedef struct { uint32_t index; } dummy;
+
+ const dummy *lhd = (const dummy*)lhs;
+ const dummy *rhd = (const dummy*)rhs;
+
+ if (lhd->index < rhd->index)
+ return -1;
+ else if (lhd->index > rhd->index)
+ return 1;
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_COMPARE_UINT32 */
+
+/*------------------------------------------------------------------
+ * netsnmp_container_simple_free
+ *
+ * useful function to pass to CONTAINER_FOR_EACH, when a simple
+ * free is needed for every item.
+ */
+void
+netsnmp_container_simple_free(void *data, void *context)
+{
+ if (data == NULL)
+ return;
+
+ DEBUGMSGTL(("verbose:container",
+ "netsnmp_container_simple_free) called for %p/%p\n",
+ data, context));
+ free((void*)data); /* SNMP_FREE wasted on param */
+}
diff --git a/snmplib/container_binary_array.c b/snmplib/container_binary_array.c
new file mode 100644
index 0000000..249a3a9
--- /dev/null
+++ b/snmplib/container_binary_array.c
@@ -0,0 +1,879 @@
+/*
+ * container_binary_array.c
+ * $Id$
+ *
+ * see comments in header file.
+ *
+ */
+
+#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>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/container_binary_array.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/snmp_assert.h>
+
+typedef struct binary_array_table_s {
+ size_t max_size; /* Size of the current data table */
+ size_t count; /* Index of the next free entry */
+ int dirty;
+ void **data; /* The table itself */
+} binary_array_table;
+
+typedef struct binary_array_iterator_s {
+ netsnmp_iterator base;
+
+ size_t pos;
+} binary_array_iterator;
+
+static netsnmp_iterator *_ba_iterator_get(netsnmp_container *c);
+
+/**********************************************************************
+ *
+ *
+ *
+ */
+static void
+array_qsort(void **data, int first, int last, netsnmp_container_compare *f)
+{
+ int i, j;
+ void *mid, *tmp;
+
+ i = first;
+ j = last;
+ mid = data[(first+last)/2];
+
+ do {
+ while (i < last && (*f)(data[i], mid) < 0)
+ ++i;
+ while (j > first && (*f)(mid, data[j]) < 0)
+ --j;
+
+ if(i < j) {
+ tmp = data[i];
+ data[i] = data[j];
+ data[j] = tmp;
+ ++i;
+ --j;
+ }
+ else if (i == j) {
+ ++i;
+ --j;
+ break;
+ }
+ } while(i <= j);
+
+ if (j > first)
+ array_qsort(data, first, j, f);
+
+ if (i < last)
+ array_qsort(data, i, last, f);
+}
+
+static int
+Sort_Array(netsnmp_container *c)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ netsnmp_assert(t!=NULL);
+ netsnmp_assert(c->compare!=NULL);
+
+ if (c->flags & CONTAINER_KEY_UNSORTED)
+ return 0;
+
+ if (t->dirty) {
+ /*
+ * Sort the table
+ */
+ if (t->count > 1)
+ array_qsort(t->data, 0, t->count - 1, c->compare);
+ t->dirty = 0;
+
+ /*
+ * no way to know if it actually changed... just assume so.
+ */
+ ++c->sync;
+ }
+
+ return 1;
+}
+
+static int
+linear_search(const void *val, netsnmp_container *c)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ size_t pos = 0;
+
+ if (!t->count)
+ return -1;
+
+ if (! (c->flags & CONTAINER_KEY_UNSORTED)) {
+ snmp_log(LOG_ERR, "linear search on sorted container %s?!?\n",
+ c->container_name);
+ return -1;
+ }
+
+ for (; pos < t->count; ++pos) {
+ if (c->compare(t->data[pos], val) == 0)
+ break;
+ }
+
+ if (pos >= t->count)
+ return -1;
+
+ return pos;
+}
+
+static int
+binary_search(const void *val, netsnmp_container *c, int exact)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ size_t len = t->count;
+ size_t half;
+ size_t middle = 0;
+ size_t first = 0;
+ int result = 0;
+
+ if (!len)
+ return -1;
+
+ if (c->flags & CONTAINER_KEY_UNSORTED) {
+ if (!exact) {
+ snmp_log(LOG_ERR, "non-exact search on unsorted container %s?!?\n",
+ c->container_name);
+ return -1;
+ }
+ return linear_search(val, c);
+ }
+
+ if (t->dirty)
+ Sort_Array(c);
+
+ while (len > 0) {
+ half = len >> 1;
+ middle = first;
+ middle += half;
+ if ((result =
+ c->compare(t->data[middle], val)) < 0) {
+ first = middle;
+ ++first;
+ len = len - half - 1;
+ } else {
+ if(result == 0) {
+ first = middle;
+ break;
+ }
+ len = half;
+ }
+ }
+
+ if (first >= t->count)
+ return -1;
+
+ if(first != middle) {
+ /* last compare wasn't against first, so get actual result */
+ result = c->compare(t->data[first], val);
+ }
+
+ if(result == 0) {
+ if (!exact) {
+ if (++first == t->count)
+ first = -1;
+ }
+ }
+ else {
+ if(exact)
+ first = -1;
+ }
+
+ return first;
+}
+
+NETSNMP_STATIC_INLINE binary_array_table *
+netsnmp_binary_array_initialize(void)
+{
+ binary_array_table *t;
+
+ t = SNMP_MALLOC_TYPEDEF(binary_array_table);
+ if (t == NULL)
+ return NULL;
+
+ t->max_size = 0;
+ t->count = 0;
+ t->dirty = 0;
+ t->data = NULL;
+
+ return t;
+}
+
+void
+netsnmp_binary_array_release(netsnmp_container *c)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ SNMP_FREE(t->data);
+ SNMP_FREE(t);
+ SNMP_FREE(c);
+}
+
+int
+netsnmp_binary_array_options_set(netsnmp_container *c, int set, u_int flags)
+{
+#define BA_FLAGS (CONTAINER_KEY_ALLOW_DUPLICATES|CONTAINER_KEY_UNSORTED)
+
+ if (set) {
+ if ((flags & BA_FLAGS) == flags)
+ c->flags = flags;
+ else
+ flags = (u_int)-1; /* unsupported flag */
+ }
+ else
+ return ((c->flags & flags) == flags);
+ return flags;
+}
+
+NETSNMP_STATIC_INLINE size_t
+netsnmp_binary_array_count(netsnmp_container *c)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ /*
+ * return count
+ */
+ return t ? t->count : 0;
+}
+
+NETSNMP_STATIC_INLINE void *
+netsnmp_binary_array_get(netsnmp_container *c, const void *key, int exact)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ int index = 0;
+
+ /*
+ * if there is no data, return NULL;
+ */
+ if (!t->count)
+ return NULL;
+
+ /*
+ * if the table is dirty, sort it.
+ */
+ if (t->dirty)
+ Sort_Array(c);
+
+ /*
+ * if there is a key, search. Otherwise default is 0;
+ */
+ if (key) {
+ if ((index = binary_search(key, c, exact)) == -1)
+ return NULL;
+ }
+
+ return t->data[index];
+}
+
+int
+netsnmp_binary_array_remove_at(netsnmp_container *c, size_t index, void **save)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+
+ if (save)
+ *save = NULL;
+
+ /*
+ * if there is no data, return NULL;
+ */
+ if (!t->count)
+ return 0;
+
+ /*
+ * find old data and save it, if ptr provided
+ */
+ if (save)
+ *save = t->data[index];
+
+ /*
+ * if entry was last item, just decrement count
+ */
+ --t->count;
+ if (index != t->count) {
+ /*
+ * otherwise, shift array down
+ */
+ memmove(&t->data[index], &t->data[index+1],
+ sizeof(void*) * (t->count - index));
+
+ ++c->sync;
+ }
+
+ return 0;
+}
+int
+netsnmp_binary_array_remove(netsnmp_container *c, const void *key, void **save)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ int index = 0;
+
+ if (save)
+ *save = NULL;
+
+ /*
+ * if there is no data, return NULL;
+ */
+ if (!t->count)
+ return 0;
+
+ /*
+ * if the table is dirty, sort it.
+ */
+ if (t->dirty)
+ Sort_Array(c);
+
+ /*
+ * search
+ */
+ if ((index = binary_search(key, c, 1)) == -1)
+ return -1;
+
+ return netsnmp_binary_array_remove_at(c, (size_t)index, save);
+}
+
+NETSNMP_STATIC_INLINE void
+netsnmp_binary_array_for_each(netsnmp_container *c,
+ netsnmp_container_obj_func *fe,
+ void *context, int sort)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ size_t i;
+
+ if (sort && t->dirty)
+ Sort_Array(c);
+
+ for (i = 0; i < t->count; ++i)
+ (*fe) (t->data[i], context);
+}
+
+NETSNMP_STATIC_INLINE void
+netsnmp_binary_array_clear(netsnmp_container *c,
+ netsnmp_container_obj_func *fe,
+ void *context)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+
+ if( NULL != fe ) {
+ size_t i;
+
+ for (i = 0; i < t->count; ++i)
+ (*fe) (t->data[i], context);
+ }
+
+ t->count = 0;
+ t->dirty = 0;
+ ++c->sync;
+}
+
+NETSNMP_STATIC_INLINE int
+netsnmp_binary_array_insert(netsnmp_container *c, const void *entry)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ int was_dirty = 0;
+ /*
+ * check for duplicates
+ */
+ if (! (c->flags & CONTAINER_KEY_ALLOW_DUPLICATES)) {
+ was_dirty = t->dirty;
+ if (NULL != netsnmp_binary_array_get(c, entry, 1)) {
+ DEBUGMSGTL(("container","not inserting duplicate key\n"));
+ return -1;
+ }
+ }
+
+ /*
+ * check if we need to resize the array
+ */
+ if (t->max_size <= t->count) {
+ /*
+ * Table is full, so extend it to double the size, or use 10 elements
+ * if it is empty.
+ */
+ size_t const new_max = t->max_size > 0 ? 2 * t->max_size : 10;
+ void ** const new_data =
+ (void**) realloc(t->data, new_max * sizeof(void*));
+
+ if (new_data == NULL)
+ return -1;
+
+ memset(new_data + t->max_size, 0x0,
+ (new_max - t->max_size) * sizeof(void*));
+
+ t->data = new_data;
+ t->max_size = new_max;
+ }
+
+ /*
+ * Insert the new entry into the data array
+ */
+ t->data[t->count++] = NETSNMP_REMOVE_CONST(void *, entry);
+ t->dirty = 1;
+
+ /*
+ * if array was dirty before we called get, sync was incremented when
+ * get called SortArray. If we didn't call get or the array wasn't dirty,
+ * bump sync now.
+ */
+ if (!was_dirty)
+ ++c->sync;
+
+ return 0;
+}
+
+/**********************************************************************
+ *
+ * Special case support for subsets
+ *
+ */
+static int
+binary_search_for_start(netsnmp_index *val, netsnmp_container *c)
+{
+ binary_array_table *t = (binary_array_table*)c->container_data;
+ size_t len = t->count;
+ size_t half;
+ size_t middle;
+ size_t first = 0;
+ int result = 0;
+
+ if (!len)
+ return -1;
+
+ if (t->dirty)
+ Sort_Array(c);
+
+ while (len > 0) {
+ half = len >> 1;
+ middle = first;
+ middle += half;
+ if ((result = c->ncompare(t->data[middle], val)) < 0) {
+ first = middle;
+ ++first;
+ len = len - half - 1;
+ } else
+ len = half;
+ }
+
+ if ((first >= t->count) ||
+ c->ncompare(t->data[first], val) != 0)
+ return -1;
+
+ return first;
+}
+
+void **
+netsnmp_binary_array_get_subset(netsnmp_container *c, void *key, int *len)
+{
+ binary_array_table *t;
+ void **subset;
+ int start, end;
+ size_t i;
+
+ /*
+ * if there is no data, return NULL;
+ */
+ if (!c || !key)
+ return NULL;
+
+ t = (binary_array_table*)c->container_data;
+ netsnmp_assert(c->ncompare);
+ if (!t->count | !c->ncompare)
+ return NULL;
+
+ /*
+ * if the table is dirty, sort it.
+ */
+ if (t->dirty)
+ Sort_Array(c);
+
+ /*
+ * find matching items
+ */
+ start = end = binary_search_for_start((netsnmp_index *)key, c);
+ if (start == -1)
+ return NULL;
+
+ for (i = start + 1; i < t->count; ++i) {
+ if (0 != c->ncompare(t->data[i], key))
+ break;
+ ++end;
+ }
+
+ *len = end - start + 1;
+ subset = (void **)malloc((*len) * sizeof(void*));
+ if (subset)
+ memcpy(subset, &t->data[start], sizeof(void*) * (*len));
+
+ return subset;
+}
+
+/**********************************************************************
+ *
+ * container
+ *
+ */
+static void *
+_ba_find(netsnmp_container *container, const void *data)
+{
+ return netsnmp_binary_array_get(container, data, 1);
+}
+
+static void *
+_ba_find_next(netsnmp_container *container, const void *data)
+{
+ return netsnmp_binary_array_get(container, data, 0);
+}
+
+static int
+_ba_insert(netsnmp_container *container, const void *data)
+{
+ return netsnmp_binary_array_insert(container, data);
+}
+
+static int
+_ba_remove(netsnmp_container *container, const void *data)
+{
+ return netsnmp_binary_array_remove(container,data, NULL);
+}
+
+static int
+_ba_free(netsnmp_container *container)
+{
+ netsnmp_binary_array_release(container);
+ return 0;
+}
+
+static size_t
+_ba_size(netsnmp_container *container)
+{
+ return netsnmp_binary_array_count(container);
+}
+
+static void
+_ba_for_each(netsnmp_container *container, netsnmp_container_obj_func *f,
+ void *context)
+{
+ netsnmp_binary_array_for_each(container, f, context, 1);
+}
+
+static void
+_ba_clear(netsnmp_container *container, netsnmp_container_obj_func *f,
+ void *context)
+{
+ netsnmp_binary_array_clear(container, f, context);
+}
+
+static netsnmp_void_array *
+_ba_get_subset(netsnmp_container *container, void *data)
+{
+ netsnmp_void_array * va;
+ void ** rtn;
+ int len;
+
+ rtn = netsnmp_binary_array_get_subset(container, data, &len);
+ if ((NULL==rtn) || (len <=0))
+ return NULL;
+
+ va = SNMP_MALLOC_TYPEDEF(netsnmp_void_array);
+ if (NULL==va)
+ {
+ free (rtn);
+ return NULL;
+ }
+
+ va->size = len;
+ va->array = rtn;
+
+ return va;
+}
+
+static int _ba_options(netsnmp_container *c, int set, u_int flags)
+{
+ return netsnmp_binary_array_options_set(c, set, flags);
+}
+
+static netsnmp_container *
+_ba_duplicate(netsnmp_container *c, void *ctx, u_int flags)
+{
+ netsnmp_container *dup;
+ binary_array_table *dupt, *t;
+
+ if (flags) {
+ snmp_log(LOG_ERR, "binary arry duplicate does not supprt flags yet\n");
+ return NULL;
+ }
+
+ dup = netsnmp_container_get_binary_array();
+ if (NULL == dup) {
+ snmp_log(LOG_ERR," no memory for binary array duplicate\n");
+ return NULL;
+ }
+ /*
+ * deal with container stuff
+ */
+ if (netsnmp_container_data_dup(dup, c) != 0) {
+ netsnmp_binary_array_release(dup);
+ return NULL;
+ }
+
+ /*
+ * deal with data
+ */
+ dupt = (binary_array_table*)dup->container_data;
+ t = (binary_array_table*)c->container_data;
+
+ dupt->max_size = t->max_size;
+ dupt->count = t->count;
+ dupt->dirty = t->dirty;
+
+ /*
+ * shallow copy
+ */
+ dupt->data = (void**) malloc(dupt->max_size * sizeof(void*));
+ if (NULL == dupt->data) {
+ snmp_log(LOG_ERR, "no memory for binary array duplicate\n");
+ netsnmp_binary_array_release(dup);
+ return NULL;
+ }
+
+ memcpy(dupt->data, t->data, dupt->max_size * sizeof(void*));
+
+ return dup;
+}
+
+netsnmp_container *
+netsnmp_container_get_binary_array(void)
+{
+ /*
+ * allocate memory
+ */
+ netsnmp_container *c = SNMP_MALLOC_TYPEDEF(netsnmp_container);
+ if (NULL==c) {
+ snmp_log(LOG_ERR, "couldn't allocate memory\n");
+ return NULL;
+ }
+
+ c->container_data = netsnmp_binary_array_initialize();
+
+ /*
+ * NOTE: CHANGES HERE MUST BE DUPLICATED IN duplicate AS WELL!!
+ */
+ netsnmp_init_container(c, NULL, _ba_free, _ba_size, NULL, _ba_insert,
+ _ba_remove, _ba_find);
+ c->find_next = _ba_find_next;
+ c->get_subset = _ba_get_subset;
+ c->get_iterator = _ba_iterator_get;
+ c->for_each = _ba_for_each;
+ c->clear = _ba_clear;
+ c->options = _ba_options;
+ c->duplicate = _ba_duplicate;
+
+ return c;
+}
+
+netsnmp_factory *
+netsnmp_container_get_binary_array_factory(void)
+{
+ static netsnmp_factory f = { "binary_array",
+ (netsnmp_factory_produce_f*)
+ netsnmp_container_get_binary_array };
+
+ return &f;
+}
+
+void
+netsnmp_container_binary_array_init(void)
+{
+ netsnmp_container_register("binary_array",
+ netsnmp_container_get_binary_array_factory());
+}
+
+/**********************************************************************
+ *
+ * iterator
+ *
+ */
+NETSNMP_STATIC_INLINE binary_array_table *
+_ba_it2cont(binary_array_iterator *it)
+{
+ if(NULL == it) {
+ netsnmp_assert(NULL != it);
+ return NULL;
+ }
+ if(NULL == it->base.container) {
+ netsnmp_assert(NULL != it->base.container);
+ return NULL;
+ }
+ if(NULL == it->base.container->container_data) {
+ netsnmp_assert(NULL != it->base.container->container_data);
+ return NULL;
+ }
+
+ return (binary_array_table*)(it->base.container->container_data);
+}
+
+NETSNMP_STATIC_INLINE void *
+_ba_iterator_position(binary_array_iterator *it, size_t pos)
+{
+ binary_array_table *t = _ba_it2cont(it);
+ if (NULL == t)
+ return t; /* msg already logged */
+
+ if(it->base.container->sync != it->base.sync) {
+ DEBUGMSGTL(("container:iterator", "out of sync\n"));
+ return NULL;
+ }
+
+ if(0 == t->count) {
+ DEBUGMSGTL(("container:iterator", "empty\n"));
+ return NULL;
+ }
+ else if(pos >= t->count) {
+ DEBUGMSGTL(("container:iterator", "end of container\n"));
+ return NULL;
+ }
+
+ return t->data[ pos ];
+}
+
+static void *
+_ba_iterator_curr(binary_array_iterator *it)
+{
+ if(NULL == it) {
+ netsnmp_assert(NULL != it);
+ return NULL;
+ }
+
+ return _ba_iterator_position(it, it->pos);
+}
+
+static void *
+_ba_iterator_first(binary_array_iterator *it)
+{
+ return _ba_iterator_position(it, 0);
+}
+
+static void *
+_ba_iterator_next(binary_array_iterator *it)
+{
+ if(NULL == it) {
+ netsnmp_assert(NULL != it);
+ return NULL;
+ }
+
+ ++it->pos;
+
+ return _ba_iterator_position(it, it->pos);
+}
+
+static void *
+_ba_iterator_last(binary_array_iterator *it)
+{
+ binary_array_table* t = _ba_it2cont(it);
+ if(NULL == t) {
+ netsnmp_assert(NULL != t);
+ return NULL;
+ }
+
+ return _ba_iterator_position(it, t->count - 1 );
+}
+
+static int
+_ba_iterator_remove(binary_array_iterator *it)
+{
+ binary_array_table* t = _ba_it2cont(it);
+ if(NULL == t) {
+ netsnmp_assert(NULL != t);
+ return -1;
+ }
+
+ /*
+ * since this iterator was used for the remove, keep it in sync with
+ * the container. Also, back up one so that next will be the position
+ * that was just removed.
+ */
+ ++it->base.sync;
+ return netsnmp_binary_array_remove_at(it->base.container, it->pos--, NULL);
+
+}
+
+static int
+_ba_iterator_reset(binary_array_iterator *it)
+{
+ binary_array_table* t = _ba_it2cont(it);
+ if(NULL == t) {
+ netsnmp_assert(NULL != t);
+ return -1;
+ }
+
+ if (t->dirty)
+ Sort_Array(it->base.container);
+
+ /*
+ * save sync count, to make sure container doesn't change while
+ * iterator is in use.
+ */
+ it->base.sync = it->base.container->sync;
+
+ it->pos = 0;
+
+ return 0;
+}
+
+static int
+_ba_iterator_release(netsnmp_iterator *it)
+{
+ free(it);
+
+ return 0;
+}
+
+static netsnmp_iterator *
+_ba_iterator_get(netsnmp_container *c)
+{
+ binary_array_iterator* it;
+
+ if(NULL == c)
+ return NULL;
+
+ it = SNMP_MALLOC_TYPEDEF(binary_array_iterator);
+ if(NULL == it)
+ return NULL;
+
+ it->base.container = c;
+
+ it->base.first = (netsnmp_iterator_rtn*)_ba_iterator_first;
+ it->base.next = (netsnmp_iterator_rtn*)_ba_iterator_next;
+ it->base.curr = (netsnmp_iterator_rtn*)_ba_iterator_curr;
+ it->base.last = (netsnmp_iterator_rtn*)_ba_iterator_last;
+ it->base.remove = (netsnmp_iterator_rc*)_ba_iterator_remove;
+ it->base.reset = (netsnmp_iterator_rc*)_ba_iterator_reset;
+ it->base.release = (netsnmp_iterator_rc*)_ba_iterator_release;
+
+ (void)_ba_iterator_reset(it);
+
+ return (netsnmp_iterator *)it;
+}
diff --git a/snmplib/container_iterator.c b/snmplib/container_iterator.c
new file mode 100644
index 0000000..41b14ff
--- /dev/null
+++ b/snmplib/container_iterator.c
@@ -0,0 +1,513 @@
+/*
+ * $Id$
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <sys/types.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/snmp_assert.h>
+
+#include <net-snmp/library/container_iterator.h>
+
+netsnmp_feature_child_of(container_iterator, container_types)
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_ITERATOR
+/**
+ * Holds iterator information containing functions which should be called
+ * by the iterator_handler to loop over your data set and sort it in a
+ * SNMP specific manner.
+ *
+ * The iterator_info typedef can be used instead of directly calling this
+ * struct if you would prefer.
+ */
+typedef struct iterator_info_s {
+ /*
+ * netsnmp_conatiner must be first
+ */
+ netsnmp_container c;
+
+ /*
+ * iterator data
+ */
+ Netsnmp_Iterator_Loop_Key *get_first;
+ Netsnmp_Iterator_Loop_Key *get_next;
+
+ Netsnmp_Iterator_Loop_Data *get_data;
+
+ Netsnmp_Iterator_Data *free_user_ctx;
+
+ Netsnmp_Iterator_Ctx *init_loop_ctx;
+ Netsnmp_Iterator_Ctx *cleanup_loop_ctx;
+ Netsnmp_Iterator_Ctx_Dup *save_pos;
+
+ Netsnmp_Iterator_Data * release_data;
+ Netsnmp_Iterator_Data * insert_data;
+ Netsnmp_Iterator_Data * remove_data;
+
+ Netsnmp_Iterator_Op * get_size;
+
+ int sorted;
+
+ /** This can be used by client handlers to store any
+ information they need */
+ void *user_ctx;
+} iterator_info;
+
+/**********************************************************************
+ *
+ * iterator
+ *
+ **********************************************************************/
+static void *
+_iterator_get(iterator_info *ii, const void *key)
+{
+ int cmp, rc = SNMP_ERR_NOERROR;
+ netsnmp_ref_void best = { NULL };
+ netsnmp_ref_void tmp = { NULL };
+ netsnmp_ref_void loop_ctx = { NULL };
+
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_get"));
+
+ if(ii->init_loop_ctx)
+ ii->init_loop_ctx(ii->user_ctx, &loop_ctx);
+
+ rc = ii->get_first(ii->user_ctx, &loop_ctx, &tmp);
+ if(SNMP_ERR_NOERROR != rc) {
+ if(SNMP_ENDOFMIBVIEW != rc)
+ snmp_log(LOG_ERR, "bad rc %d from get_next\n", rc);
+ }
+ else {
+ for( ;
+ (NULL != tmp.val) && (SNMP_ERR_NOERROR == rc);
+ rc = ii->get_next(ii->user_ctx, &loop_ctx, &tmp) ) {
+
+ /*
+ * if keys are equal, we are done.
+ */
+ cmp = ii->c.compare(tmp.val, key);
+ if(0 == cmp) {
+ best.val = tmp.val;
+ if(ii->get_data)
+ ii->get_data(ii->user_ctx, &loop_ctx, &best);
+ }
+
+ /*
+ * if data is sorted and if key is greater,
+ * we are done (not found)
+ */
+ if((cmp > 0) && ii->sorted)
+ break;
+ } /* end for */
+ }
+
+ if(ii->cleanup_loop_ctx)
+ ii->cleanup_loop_ctx(ii->user_ctx,&loop_ctx);
+
+ return best.val;
+}
+
+/**
+ *
+ * NOTE: the returned data context can be reused, to save from
+ * having to allocate memory repeatedly. However, in this case,
+ * the get_data and get_pos functions must be implemented to
+ * return unique memory that will be saved for later comparisons.
+ */
+static void *
+_iterator_get_next(iterator_info *ii, const void *key)
+{
+ int cmp, rc = SNMP_ERR_NOERROR;
+ netsnmp_ref_void best_val = { NULL };
+ netsnmp_ref_void best_ctx = { NULL };
+ netsnmp_ref_void tmp = { NULL };
+ netsnmp_ref_void loop_ctx = { NULL };
+
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_get_next"));
+
+ /*
+ * initialize loop context
+ */
+ if(ii->init_loop_ctx)
+ ii->init_loop_ctx(ii->user_ctx, &loop_ctx);
+
+ /*
+ * get first item
+ */
+ rc = ii->get_first(ii->user_ctx, &loop_ctx, &tmp);
+ if(SNMP_ERR_NOERROR == rc) {
+ /*
+ * special case: if key is null, find the first item.
+ * this is each if the container is sorted, since we're
+ * already done! Otherwise, get the next item for the
+ * first comparison in the loop below.
+ */
+ if (NULL == key) {
+ if(ii->get_data)
+ ii->save_pos(ii->user_ctx, &loop_ctx, &best_ctx, 1);
+ best_val.val = tmp.val;
+ if(ii->sorted)
+ tmp.val = NULL; /* so we skip for loop */
+ else
+ rc = ii->get_next(ii->user_ctx, &loop_ctx, &tmp);
+ }
+ /*
+ * loop over remaining items
+ */
+ for( ;
+ (NULL != tmp.val) && (rc == SNMP_ERR_NOERROR);
+ rc = ii->get_next(ii->user_ctx, &loop_ctx, &tmp) ) {
+
+ /*
+ * if we have a key, this is a get-next, and we need to compare
+ * the key to the tmp value to see if the tmp value is greater
+ * than the key, but less than any previous match.
+ *
+ * if there is no key, this is a get-first, and we need to
+ * compare the best value agains the tmp value to see if the
+ * tmp value is lesser than the best match.
+ */
+ if(key) /* get next */
+ cmp = ii->c.compare(tmp.val, key);
+ else { /* get first */
+ /*
+ * best value and tmp value should never be equal,
+ * otherwise we'd be comparing a pointer to itself.
+ * (see note on context reuse in comments above function.
+ */
+ if(best_val.val == tmp.val) {
+ snmp_log(LOG_ERR,"illegal reuse of data context in "
+ "container_iterator\n");
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+ cmp = ii->c.compare(best_val.val, tmp.val);
+ }
+ if(cmp > 0) {
+ /*
+ * if we don't have a key (get-first) or a current best match,
+ * then the comparison above is all we need to know that
+ * tmp is the best match. otherwise, compare against the
+ * current best match.
+ */
+ if((NULL == key) || (NULL == best_val.val) ||
+ ((cmp=ii->c.compare(tmp.val, best_val.val)) < 0) ) {
+ DEBUGMSGT(("container_iterator:results"," best match\n"));
+ best_val.val = tmp.val;
+ if(ii->get_data)
+ ii->save_pos(ii->user_ctx, &loop_ctx, &best_ctx, 1);
+ }
+ }
+ else if((cmp == 0) && ii->sorted && key) {
+ /*
+ * if keys are equal and container is sorted, then we know
+ * the next key will be the one we want.
+ * NOTE: if no vars, treat as generr, since we
+ * went past the end of the container when we know
+ * the next item is the one we want. (IGN-A)
+ */
+ rc = ii->get_next(ii->user_ctx, &loop_ctx, &tmp);
+ if(SNMP_ERR_NOERROR == rc) {
+ best_val.val = tmp.val;
+ if(ii->get_data)
+ ii->save_pos(ii->user_ctx, &loop_ctx, &best_ctx, 1);
+ }
+ else if(SNMP_ENDOFMIBVIEW == rc)
+ rc = SNMPERR_GENERR; /* not found */
+ break;
+ }
+
+ } /* end for */
+ }
+
+ /*
+ * no vars is ok, except as noted above (IGN-A)
+ */
+ if(SNMP_ENDOFMIBVIEW == rc)
+ rc = SNMP_ERR_NOERROR;
+
+ /*
+ * get data, iff necessary
+ * clear return value iff errors
+ */
+ if(SNMP_ERR_NOERROR == rc) {
+ if(ii->get_data && best_val.val) {
+ rc = ii->get_data(ii->user_ctx, &best_ctx, &best_val);
+ if(SNMP_ERR_NOERROR != rc) {
+ snmp_log(LOG_ERR, "bad rc %d from get_data\n", rc);
+ best_val.val = NULL;
+ }
+ }
+ }
+ else if(SNMP_ENDOFMIBVIEW != rc) {
+ snmp_log(LOG_ERR, "bad rc %d from get_next\n", rc);
+ best_val.val = NULL;
+ }
+
+ /*
+ * if we have a saved loop ctx, clean it up
+ */
+ if((best_ctx.val != NULL) && (best_ctx.val != loop_ctx.val) &&
+ (ii->cleanup_loop_ctx))
+ ii->cleanup_loop_ctx(ii->user_ctx,&best_ctx);
+
+ /*
+ * clean up loop ctx
+ */
+ if(ii->cleanup_loop_ctx)
+ ii->cleanup_loop_ctx(ii->user_ctx,&loop_ctx);
+
+ DEBUGMSGT(("container_iterator:results"," returning %p\n", best_val.val));
+ return best_val.val;
+}
+
+/**********************************************************************
+ *
+ * container
+ *
+ **********************************************************************/
+static void
+_iterator_free(iterator_info *ii)
+{
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_free"));
+
+ if(NULL == ii)
+ return;
+
+ if(ii->user_ctx)
+ ii->free_user_ctx(ii->user_ctx,ii->user_ctx);
+
+ free(ii);
+}
+
+static void *
+_iterator_find(iterator_info *ii, const void *data)
+{
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_find"));
+
+ if((NULL == ii) || (NULL == data))
+ return NULL;
+
+ return _iterator_get(ii, data);
+}
+
+static void *
+_iterator_find_next(iterator_info *ii, const void *data)
+{
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_find_next"));
+
+ if(NULL == ii)
+ return NULL;
+
+ return _iterator_get_next(ii, data);
+}
+
+static int
+_iterator_insert(iterator_info *ii, const void *data)
+{
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_insert"));
+
+ if(NULL == ii)
+ return -1;
+
+ if(NULL == ii->insert_data)
+ return -1;
+
+ return ii->insert_data(ii->user_ctx, data);
+}
+
+static int
+_iterator_remove(iterator_info *ii, const void *data)
+{
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_remove"));
+
+ if(NULL == ii)
+ return -1;
+
+ if(NULL == ii->remove_data)
+ return -1;
+
+ return ii->remove_data(ii->user_ctx, data);
+}
+
+static int
+_iterator_release(iterator_info *ii, const void *data)
+{
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_release"));
+
+ if(NULL == ii)
+ return -1;
+
+ if(NULL == ii->release_data)
+ return -1;
+
+ return ii->release_data(ii->user_ctx, data);
+}
+
+static size_t
+_iterator_size(iterator_info *ii)
+{
+ size_t count = 0;
+ netsnmp_ref_void loop_ctx = { NULL };
+ netsnmp_ref_void tmp = { NULL };
+
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_size"));
+
+ if(NULL == ii)
+ return -1;
+
+ if(NULL != ii->get_size)
+ return ii->get_size(ii->user_ctx);
+
+ /*
+ * no get_size. loop and count ourselves
+ */
+ if(ii->init_loop_ctx)
+ ii->init_loop_ctx(ii->user_ctx, &loop_ctx);
+
+ for( ii->get_first(ii->user_ctx, &loop_ctx, &tmp);
+ NULL != tmp.val;
+ ii->get_next(ii->user_ctx, &loop_ctx, &tmp) )
+ ++count;
+
+ if(ii->cleanup_loop_ctx)
+ ii->cleanup_loop_ctx(ii->user_ctx,&loop_ctx);
+
+ return count;
+}
+
+static void
+_iterator_for_each(iterator_info *ii, netsnmp_container_obj_func *f,
+ void *ctx)
+{
+ netsnmp_ref_void loop_ctx = { NULL };
+ netsnmp_ref_void tmp = { NULL };
+
+ DEBUGMSGT(("container_iterator",">%s\n", "_iterator_foreach"));
+
+ if(NULL == ii)
+ return;
+
+ if(ii->init_loop_ctx)
+ ii->init_loop_ctx(ii->user_ctx, &loop_ctx);
+
+ for( ii->get_first(ii->user_ctx, &loop_ctx, &tmp);
+ NULL != tmp.val;
+ ii->get_next(ii->user_ctx, &loop_ctx, &tmp) )
+ (*f) (tmp.val, ctx);
+
+ if(ii->cleanup_loop_ctx)
+ ii->cleanup_loop_ctx(ii->user_ctx,&loop_ctx);
+}
+
+static void
+_iterator_clear(netsnmp_container *container, netsnmp_container_obj_func *f,
+ void *context)
+{
+ snmp_log(LOG_WARNING,"clear is meaningless for iterator container.\n");
+}
+
+/**********************************************************************
+ *
+ */
+netsnmp_container*
+netsnmp_container_iterator_get(void *iterator_user_ctx,
+ netsnmp_container_compare * compare,
+ Netsnmp_Iterator_Loop_Key * get_first,
+ Netsnmp_Iterator_Loop_Key * get_next,
+ Netsnmp_Iterator_Loop_Data * get_data,
+ Netsnmp_Iterator_Ctx_Dup * save_pos,
+ Netsnmp_Iterator_Ctx * init_loop_ctx,
+ Netsnmp_Iterator_Ctx * cleanup_loop_ctx,
+ Netsnmp_Iterator_Data * free_user_ctx,
+ int sorted)
+{
+ iterator_info *ii;
+
+ /*
+ * sanity checks
+ */
+ if(get_data && ! save_pos) {
+ snmp_log(LOG_ERR, "save_pos required with get_data\n");
+ return NULL;
+ }
+
+ /*
+ * allocate memory
+ */
+ ii = SNMP_MALLOC_TYPEDEF(iterator_info);
+ if (NULL==ii) {
+ snmp_log(LOG_ERR, "couldn't allocate memory\n");
+ return NULL;
+ }
+
+ /*
+ * init container structure with iterator functions
+ */
+ ii->c.cfree = (netsnmp_container_rc*)_iterator_free;
+ ii->c.compare = compare;
+ ii->c.get_size = (netsnmp_container_size*)_iterator_size;
+ ii->c.init = NULL;
+ ii->c.insert = (netsnmp_container_op*)_iterator_insert;
+ ii->c.remove = (netsnmp_container_op*)_iterator_remove;
+ ii->c.release = (netsnmp_container_op*)_iterator_release;
+ ii->c.find = (netsnmp_container_rtn*)_iterator_find;
+ ii->c.find_next = (netsnmp_container_rtn*)_iterator_find_next;
+ ii->c.get_subset = NULL;
+ ii->c.get_iterator = NULL;
+ ii->c.for_each = (netsnmp_container_func*)_iterator_for_each;
+ ii->c.clear = _iterator_clear;
+
+ /*
+ * init iterator structure with user functions
+ */
+ ii->get_first = get_first;
+ ii->get_next = get_next;
+ ii->get_data = get_data;
+ ii->save_pos = save_pos;
+ ii->init_loop_ctx = init_loop_ctx;
+ ii->cleanup_loop_ctx = cleanup_loop_ctx;
+ ii->free_user_ctx = free_user_ctx;
+ ii->sorted = sorted;
+
+ ii->user_ctx = iterator_user_ctx;
+
+ return (netsnmp_container*)ii;
+}
+
+void
+netsnmp_container_iterator_set_data_cb(netsnmp_container *c,
+ Netsnmp_Iterator_Data * insert_data,
+ Netsnmp_Iterator_Data * remove_data,
+ Netsnmp_Iterator_Op * get_size)
+{
+ iterator_info *ii = (iterator_info *)c;
+ if(NULL == ii)
+ return;
+
+ ii->insert_data = insert_data;
+ ii->remove_data = remove_data;
+ ii->get_size = get_size;
+}
+#else /* NETSNMP_FEATURE_REMOVE_CONTAINER_ITERATOR */
+netsnmp_feature_unused(container_iterator);
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_ITERATOR */
diff --git a/snmplib/container_list_ssll.c b/snmplib/container_list_ssll.c
new file mode 100644
index 0000000..7ff01c4
--- /dev/null
+++ b/snmplib/container_list_ssll.c
@@ -0,0 +1,570 @@
+/*
+ * container_list_sl.c
+ * $Id$
+ *
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <sys/types.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/snmp_assert.h>
+
+#include <net-snmp/library/container_list_ssll.h>
+
+netsnmp_feature_child_of(container_linked_list, container_types)
+netsnmp_feature_child_of(container_fifo, container_types)
+netsnmp_feature_child_of(container_lifo, container_types)
+
+/* this is a fancy way of cleaning up ifdefs */
+#ifdef NETSNMP_FEATURE_REQUIRE_CONTAINER_FIFO
+netsnmp_feature_require(container_linked_list)
+#endif /* NETSNMP_FEATURE_REQUIRE_CONTAINER_FIFO */
+#ifdef NETSNMP_FEATURE_REQUIRE_CONTAINER_LIFO
+netsnmp_feature_require(container_linked_list)
+#endif /* NETSNMP_FEATURE_REQUIRE_CONTAINER_LIFO */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_LINKED_LIST
+typedef struct sl_node {
+ void *data;
+ struct sl_node *next;
+} sl_node;
+
+typedef struct sl_container_s {
+ netsnmp_container c;
+
+ size_t count; /* Index of the next free entry */
+ sl_node *head; /* head of list */
+
+ int unsorted; /* unsorted list? */
+ int fifo; /* lifo or fifo? */
+
+} sl_container;
+
+typedef struct ssll_iterator_s {
+ netsnmp_iterator base;
+
+ sl_node *pos;
+ sl_node *last;
+} ssll_iterator;
+
+static netsnmp_iterator *_ssll_iterator_get(netsnmp_container *c);
+
+
+static void *
+_get(netsnmp_container *c, const void *key, int exact)
+{
+ sl_container *sl = (sl_container*)c;
+ sl_node *curr = sl->head;
+ int rc = 0;
+
+ /*
+ * note: get-next on unsorted list is meaningless. we
+ * don't try to search whole array, looking for the next highest.
+ */
+ if( (NULL != curr) && (NULL != key)) {
+ while (curr) {
+ rc = sl->c.compare(curr->data, key);
+ if (rc == 0)
+ break;
+ else if (rc > 0) {
+ if (0 == sl->unsorted) {
+ /*
+ * if sorted, we can stop.
+ */
+ break;
+ }
+ }
+ curr = curr->next;
+ }
+
+ if((curr) && (!exact) && (rc == 0)) {
+ curr = curr->next;
+ }
+ }
+
+ return curr ? curr->data : NULL;
+}
+
+/**********************************************************************
+ *
+ *
+ *
+ **********************************************************************/
+static int
+_ssll_free(netsnmp_container *c)
+{
+ if(c) {
+ free(c);
+ }
+ return 0;
+}
+
+static void *
+_ssll_find(netsnmp_container *c, const void *data)
+{
+ if((NULL == c) || (NULL == data))
+ return NULL;
+
+ return _get(c, data, 1);
+}
+
+static void *
+_ssll_find_next(netsnmp_container *c, const void *data)
+{
+ if(NULL == c)
+ return NULL;
+
+ return _get(c, data, 0);
+}
+
+static int
+_ssll_insert(netsnmp_container *c, const void *data)
+{
+ sl_container *sl = (sl_container*)c;
+ sl_node *new_node, *curr = sl->head;
+
+ if(NULL == c)
+ return -1;
+
+ new_node = SNMP_MALLOC_TYPEDEF(sl_node);
+ if(NULL == new_node)
+ return -1;
+ new_node->data = NETSNMP_REMOVE_CONST(void *, data);
+ ++sl->count;
+ ++c->sync;
+
+ /*
+ * first node?
+ */
+ if(NULL == sl->head) {
+ sl->head = new_node;
+ return 0;
+ }
+
+ /*
+ * sorted or unsorted insert?
+ */
+ if (1 == sl->unsorted) {
+ /*
+ * unsorted: fifo, or lifo?
+ */
+ if (1 == sl->fifo) {
+ /*
+ * fifo: insert at tail
+ */
+ while(NULL != curr->next)
+ curr = curr->next;
+ curr->next = new_node;
+ }
+ else {
+ /*
+ * lifo: insert at head
+ */
+ new_node->next = sl->head;
+ sl->head = new_node;
+ }
+ }
+ else {
+ /*
+ * sorted
+ */
+ sl_node *last = NULL;
+ for( ; curr; last = curr, curr = curr->next) {
+ if(sl->c.compare(curr->data, data) > 0)
+ break;
+ }
+ if(NULL == last) {
+ new_node->next = sl->head;
+ sl->head = new_node;
+ }
+ else {
+ new_node->next = last->next;
+ last->next = new_node;
+ }
+ }
+
+ return 0;
+}
+
+static int
+_ssll_remove(netsnmp_container *c, const void *data)
+{
+ sl_container *sl = (sl_container*)c;
+ sl_node *curr = sl->head;
+
+ if((NULL == c) || (NULL == curr))
+ return -1;
+
+ /*
+ * special case for NULL data, act like stack
+ */
+ if ((NULL == data) ||
+ (sl->c.compare(sl->head->data, data) == 0)) {
+ curr = sl->head;
+ sl->head = sl->head->next;
+ }
+ else {
+ sl_node *last = sl->head;
+ int rc;
+ for(curr = sl->head->next ; curr; last = curr, curr = curr->next) {
+ rc = sl->c.compare(curr->data, data);
+ if (rc == 0) {
+ last->next = curr->next;
+ break;
+ }
+ else if ((rc > 0) && (0 == sl->unsorted)) {
+ /*
+ * if sorted and rc > 0, didn't find entry
+ */
+ curr = NULL;
+ break;
+ }
+ }
+ }
+
+ if(NULL == curr)
+ return -2;
+
+ /*
+ * free our node structure, but not the data
+ */
+ free(curr);
+ --sl->count;
+ ++c->sync;
+
+ return 0;
+}
+
+static size_t
+_ssll_size(netsnmp_container *c)
+{
+ sl_container *sl = (sl_container*)c;
+
+ if(NULL == c)
+ return 0;
+
+ return sl->count;
+}
+
+static void
+_ssll_for_each(netsnmp_container *c, netsnmp_container_obj_func *f,
+ void *context)
+{
+ sl_container *sl = (sl_container*)c;
+ sl_node *curr;
+
+ if(NULL == c)
+ return;
+
+ for(curr = sl->head; curr; curr = curr->next)
+ (*f) ((void *)curr->data, context);
+}
+
+static void
+_ssll_clear(netsnmp_container *c, netsnmp_container_obj_func *f,
+ void *context)
+{
+ sl_container *sl = (sl_container*)c;
+ sl_node *curr, *next;
+
+ if(NULL == c)
+ return;
+
+ for(curr = sl->head; curr; curr = next) {
+
+ next = curr->next;
+
+ if( NULL != f ) {
+ curr->next = NULL;
+ (*f) ((void *)curr->data, context);
+ }
+
+ /*
+ * free our node structure, but not the data
+ */
+ free(curr);
+ }
+ sl->head = NULL;
+ sl->count = 0;
+ ++c->sync;
+}
+
+/**********************************************************************
+ *
+ *
+ *
+ **********************************************************************/
+netsnmp_container *
+netsnmp_container_get_ssll(void)
+{
+ /*
+ * allocate memory
+ */
+ sl_container *sl = SNMP_MALLOC_TYPEDEF(sl_container);
+ if (NULL==sl) {
+ snmp_log(LOG_ERR, "couldn't allocate memory\n");
+ return NULL;
+ }
+
+ netsnmp_init_container((netsnmp_container *)sl, NULL, _ssll_free,
+ _ssll_size, NULL, _ssll_insert, _ssll_remove,
+ _ssll_find);
+ sl->c.find_next = _ssll_find_next;
+ sl->c.get_subset = NULL;
+ sl->c.get_iterator =_ssll_iterator_get;
+ sl->c.for_each = _ssll_for_each;
+ sl->c.clear = _ssll_clear;
+
+
+ return (netsnmp_container*)sl;
+}
+
+netsnmp_factory *
+netsnmp_container_get_ssll_factory(void)
+{
+ static netsnmp_factory f = {"sorted_singly_linked_list",
+ (netsnmp_factory_produce_f*)
+ netsnmp_container_get_ssll };
+
+ return &f;
+}
+
+
+netsnmp_container *
+netsnmp_container_get_usll(void)
+{
+ /*
+ * allocate memory
+ */
+ sl_container *sl = (sl_container *)netsnmp_container_get_ssll();
+ if (NULL==sl)
+ return NULL; /* msg already logged */
+
+ sl->unsorted = 1;
+
+ return (netsnmp_container*)sl;
+}
+
+netsnmp_container *
+netsnmp_container_get_singly_linked_list(int fifo)
+{
+ sl_container *sl = (sl_container *)netsnmp_container_get_usll();
+ if (NULL == sl)
+ return NULL; /* error already logged */
+
+ sl->fifo = fifo;
+
+ return (netsnmp_container *)sl;
+}
+
+netsnmp_container *
+netsnmp_container_get_fifo(void)
+{
+ return netsnmp_container_get_singly_linked_list(1);
+}
+
+netsnmp_factory *
+netsnmp_container_get_usll_factory(void)
+{
+ static netsnmp_factory f = {"unsorted_singly_linked_list-lifo",
+ (netsnmp_factory_produce_f*)
+ netsnmp_container_get_usll };
+
+ return &f;
+}
+
+netsnmp_factory *
+netsnmp_container_get_fifo_factory(void)
+{
+ static netsnmp_factory f = {"unsorted_singly_linked_list-fifo",
+ (netsnmp_factory_produce_f*)
+ netsnmp_container_get_fifo };
+
+ return &f;
+}
+
+void
+netsnmp_container_ssll_init(void)
+{
+ netsnmp_container_register("sorted_singly_linked_list",
+ netsnmp_container_get_ssll_factory());
+ netsnmp_container_register("unsorted_singly_linked_list",
+ netsnmp_container_get_usll_factory());
+ netsnmp_container_register("lifo",
+ netsnmp_container_get_usll_factory());
+ netsnmp_container_register("fifo",
+ netsnmp_container_get_fifo_factory());
+}
+
+
+/**********************************************************************
+ *
+ * iterator
+ *
+ */
+NETSNMP_STATIC_INLINE sl_container *
+_ssll_it2cont(ssll_iterator *it)
+{
+ if(NULL == it) {
+ netsnmp_assert(NULL != it);
+ return NULL;
+ }
+
+ if(NULL == it->base.container) {
+ netsnmp_assert(NULL != it->base.container);
+ return NULL;
+ }
+
+ if(it->base.container->sync != it->base.sync) {
+ DEBUGMSGTL(("container:iterator", "out of sync\n"));
+ return NULL;
+ }
+
+ return (sl_container *)it->base.container;
+}
+
+static void *
+_ssll_iterator_curr(ssll_iterator *it)
+{
+ sl_container *t = _ssll_it2cont(it);
+ if ((NULL == t) || (NULL == it->pos))
+ return NULL;
+
+ return it->pos->data;
+}
+
+static void *
+_ssll_iterator_first(ssll_iterator *it)
+{
+ sl_container *t = _ssll_it2cont(it);
+ if ((NULL == t) || (NULL == t->head))
+ return NULL;
+
+ return t->head->data;
+}
+
+static void *
+_ssll_iterator_next(ssll_iterator *it)
+{
+ sl_container *t = _ssll_it2cont(it);
+ if ((NULL == t) || (NULL == it->pos))
+ return NULL;
+
+ it->pos = it->pos->next;
+ if (NULL == it->pos)
+ return NULL;
+
+ return it->pos->data;
+}
+
+static void *
+_ssll_iterator_last(ssll_iterator *it)
+{
+ sl_node *n;
+ sl_container *t = _ssll_it2cont(it);
+ if(NULL == t)
+ return NULL;
+
+ if (it->last)
+ return it->last;
+
+ n = it->pos ? it->pos : t->head;
+ if (NULL == n)
+ return NULL;
+
+ while(n->next)
+ n = n->next;
+
+ if (NULL == n)
+ return NULL;
+
+ it->last = n;
+
+ return it->last->data;
+}
+
+static int
+_ssll_iterator_reset(ssll_iterator *it)
+{
+ sl_container *t;
+
+ /** can't use it2conf cuz we might be out of sync */
+ if(NULL == it) {
+ netsnmp_assert(NULL != it);
+ return 0;
+ }
+
+ if(NULL == it->base.container) {
+ netsnmp_assert(NULL != it->base.container);
+ return 0;
+ }
+ t = (sl_container *)it->base.container;
+ if(NULL == t)
+ return -1;
+
+ it->last = NULL;
+ it->pos = t->head;
+
+ /*
+ * save sync count, to make sure container doesn't change while
+ * iterator is in use.
+ */
+ it->base.sync = it->base.container->sync;
+
+ return 0;
+}
+
+static int
+_ssll_iterator_release(netsnmp_iterator *it)
+{
+ free(it);
+
+ return 0;
+}
+
+static netsnmp_iterator *
+_ssll_iterator_get(netsnmp_container *c)
+{
+ ssll_iterator* it;
+
+ if(NULL == c)
+ return NULL;
+
+ it = SNMP_MALLOC_TYPEDEF(ssll_iterator);
+ if(NULL == it)
+ return NULL;
+
+ it->base.container = c;
+
+ it->base.first = (netsnmp_iterator_rtn*)_ssll_iterator_first;
+ it->base.next = (netsnmp_iterator_rtn*)_ssll_iterator_next;
+ it->base.curr = (netsnmp_iterator_rtn*)_ssll_iterator_curr;
+ it->base.last = (netsnmp_iterator_rtn*)_ssll_iterator_last;
+ it->base.reset = (netsnmp_iterator_rc*)_ssll_iterator_reset;
+ it->base.release = (netsnmp_iterator_rc*)_ssll_iterator_release;
+
+ (void)_ssll_iterator_reset(it);
+
+ return (netsnmp_iterator *)it;
+}
+#else /* NETSNMP_FEATURE_REMOVE_CONTAINER_LINKED_LIST */
+netsnmp_feature_unused(container_linked_list);
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_LINKED_LIST */
diff --git a/snmplib/container_null.c b/snmplib/container_null.c
new file mode 100644
index 0000000..1f4870e
--- /dev/null
+++ b/snmplib/container_null.c
@@ -0,0 +1,191 @@
+/*
+ * container_null.c
+ * $Id$
+ *
+ * see comments in header file.
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/container_null.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/snmp_assert.h>
+
+netsnmp_feature_child_of(container_null, container_types)
+
+/** @defgroup null_container null_container
+ * Helps you implement specialized containers.
+ * @ingroup container
+ *
+ * This is a simple container that doesn't actually contain anything.
+ * All the methods simply log a debug message and return.
+ *
+ * The original intent for this container is as a wrapper for a specialized
+ * container. Implement the functions you need, create a null_container,
+ * and override the default functions with your specialized versions.
+ *
+ * You can use the 'container:null' debug token to see what functions are
+ * being called, to help determine if you need to implement them.
+ *
+ * @{
+ */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_NULL
+/**********************************************************************
+ *
+ * container
+ *
+ */
+static void *
+_null_find(netsnmp_container *container, const void *data)
+{
+ DEBUGMSGTL(("container:null:find","in\n"));
+ return NULL;
+}
+
+static void *
+_null_find_next(netsnmp_container *container, const void *data)
+{
+ DEBUGMSGTL(("container:null:find_next","in\n"));
+ return NULL;
+}
+
+static int
+_null_insert(netsnmp_container *container, const void *data)
+{
+ DEBUGMSGTL(("container:null:insert","in\n"));
+ return 0;
+}
+
+static int
+_null_remove(netsnmp_container *container, const void *data)
+{
+ DEBUGMSGTL(("container:null:remove","in\n"));
+ return 0;
+}
+
+static int
+_null_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("container:null:free","in\n"));
+ free(container);
+ return 0;
+}
+
+static int
+_null_init(netsnmp_container *container)
+{
+ DEBUGMSGTL(("container:null:","in\n"));
+ return 0;
+}
+
+static size_t
+_null_size(netsnmp_container *container)
+{
+ DEBUGMSGTL(("container:null:size","in\n"));
+ return 0;
+}
+
+static void
+_null_for_each(netsnmp_container *container, netsnmp_container_obj_func *f,
+ void *context)
+{
+ DEBUGMSGTL(("container:null:for_each","in\n"));
+}
+
+static netsnmp_void_array *
+_null_get_subset(netsnmp_container *container, void *data)
+{
+ DEBUGMSGTL(("container:null:get_subset","in\n"));
+ return NULL;
+}
+
+static void
+_null_clear(netsnmp_container *container, netsnmp_container_obj_func *f,
+ void *context)
+{
+ DEBUGMSGTL(("container:null:clear","in\n"));
+}
+
+/**********************************************************************
+ *
+ * factory
+ *
+ */
+
+netsnmp_container *
+netsnmp_container_get_null(void)
+{
+ /*
+ * allocate memory
+ */
+ netsnmp_container *c;
+ DEBUGMSGTL(("container:null:get_null","in\n"));
+ c = SNMP_MALLOC_TYPEDEF(netsnmp_container);
+ if (NULL==c) {
+ snmp_log(LOG_ERR, "couldn't allocate memory\n");
+ return NULL;
+ }
+
+ c->container_data = NULL;
+
+ c->get_size = _null_size;
+ c->init = _null_init;
+ c->cfree = _null_free;
+ c->insert = _null_insert;
+ c->remove = _null_remove;
+ c->find = _null_find;
+ c->find_next = _null_find_next;
+ c->get_subset = _null_get_subset;
+ c->get_iterator = NULL; /* _null_iterator; */
+ c->for_each = _null_for_each;
+ c->clear = _null_clear;
+
+ return c;
+}
+
+netsnmp_factory *
+netsnmp_container_get_null_factory(void)
+{
+ static netsnmp_factory f = { "null",
+ (netsnmp_factory_produce_f*)
+ netsnmp_container_get_null};
+
+ DEBUGMSGTL(("container:null:get_null_factory","in\n"));
+ return &f;
+}
+
+void
+netsnmp_container_null_init(void)
+{
+ netsnmp_container_register("null",
+ netsnmp_container_get_null_factory());
+}
+#else /* NETSNMP_FEATURE_REMOVE_CONTAINER_NULL */
+netsnmp_feature_unused(container_null);
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_NULL */
+/** @} */
+
diff --git a/snmplib/data_list.c b/snmplib/data_list.c
new file mode 100644
index 0000000..505d4fc
--- /dev/null
+++ b/snmplib/data_list.c
@@ -0,0 +1,383 @@
+/*
+ * netsnmp_data_list.c
+ *
+ * $Id$
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+
+netsnmp_feature_child_of(data_list_all, libnetsnmp)
+
+netsnmp_feature_child_of(data_list_add_data, data_list_all)
+netsnmp_feature_child_of(data_list_get_list_node, data_list_all)
+
+/** @defgroup data_list generic linked-list data handling with a string as a key.
+ * @ingroup library
+ * @{
+*/
+
+/** frees the data and a name at a given data_list node.
+ * Note that this doesn't free the node itself.
+ * @param node the node for which the data should be freed
+ */
+NETSNMP_INLINE void
+netsnmp_free_list_data(netsnmp_data_list *node)
+{
+ Netsnmp_Free_List_Data *beer;
+ if (!node)
+ return;
+
+ beer = node->free_func;
+ if (beer)
+ (beer) (node->data);
+ SNMP_FREE(node->name);
+}
+
+/** frees all data and nodes in a list.
+ * @param head the top node of the list to be freed.
+ */
+NETSNMP_INLINE void
+netsnmp_free_all_list_data(netsnmp_data_list *head)
+{
+ netsnmp_data_list *tmpptr;
+ for (; head;) {
+ netsnmp_free_list_data(head);
+ tmpptr = head;
+ head = head->next;
+ SNMP_FREE(tmpptr);
+ }
+}
+
+/** adds creates a data_list node given a name, data and a free function ptr.
+ * @param name the name of the node to cache the data.
+ * @param data the data to be stored under that name
+ * @param beer A function that can free the data pointer (in the future)
+ * @return a newly created data_list node which can be given to the netsnmp_add_list_data function.
+ */
+NETSNMP_INLINE netsnmp_data_list *
+netsnmp_create_data_list(const char *name, void *data,
+ Netsnmp_Free_List_Data * beer)
+{
+ netsnmp_data_list *node;
+
+ if (!name)
+ return NULL;
+ node = SNMP_MALLOC_TYPEDEF(netsnmp_data_list);
+ if (!node)
+ return NULL;
+ node->name = strdup(name);
+ if (!node->name) {
+ free(node);
+ return NULL;
+ }
+ node->data = data;
+ node->free_func = beer;
+ return node;
+}
+
+/** adds data to a datalist
+ * @param head a pointer to the head node of a data_list
+ * @param node a node to stash in the data_list
+ */
+NETSNMP_INLINE void
+netsnmp_data_list_add_node(netsnmp_data_list **head, netsnmp_data_list *node)
+{
+ netsnmp_data_list *ptr;
+
+ netsnmp_assert(NULL != head);
+ netsnmp_assert(NULL != node);
+ netsnmp_assert(NULL != node->name);
+
+ DEBUGMSGTL(("data_list","adding key '%s'\n", node->name));
+
+ if (!*head) {
+ *head = node;
+ return;
+ }
+
+ if (0 == strcmp(node->name, (*head)->name)) {
+ netsnmp_assert(!"list key == is unique"); /* always fail */
+ snmp_log(LOG_WARNING,
+ "WARNING: adding duplicate key '%s' to data list\n",
+ node->name);
+ }
+
+ for (ptr = *head; ptr->next != NULL; ptr = ptr->next) {
+ netsnmp_assert(NULL != ptr->name);
+ if (0 == strcmp(node->name, ptr->name)) {
+ netsnmp_assert(!"list key == is unique"); /* always fail */
+ snmp_log(LOG_WARNING,
+ "WARNING: adding duplicate key '%s' to data list\n",
+ node->name);
+ }
+ }
+
+ netsnmp_assert(NULL != ptr);
+ if (ptr) /* should always be true */
+ ptr->next = node;
+}
+
+/** adds data to a datalist
+ * @note netsnmp_data_list_add_node is preferred
+ * @param head a pointer to the head node of a data_list
+ * @param node a node to stash in the data_list
+ */
+/** */
+NETSNMP_INLINE void
+netsnmp_add_list_data(netsnmp_data_list **head, netsnmp_data_list *node)
+{
+ netsnmp_data_list_add_node(head, node);
+}
+
+/** adds data to a datalist
+ * @param head a pointer to the head node of a data_list
+ * @param name the name of the node to cache the data.
+ * @param data the data to be stored under that name
+ * @param beer A function that can free the data pointer (in the future)
+ * @return a newly created data_list node which was inserted in the list
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_DATA_LIST_ADD_DATA
+NETSNMP_INLINE netsnmp_data_list *
+netsnmp_data_list_add_data(netsnmp_data_list **head, const char *name,
+ void *data, Netsnmp_Free_List_Data * beer)
+{
+ netsnmp_data_list *node;
+ if (!name) {
+ snmp_log(LOG_ERR,"no name provided.");
+ return NULL;
+ }
+ node = netsnmp_create_data_list(name, data, beer);
+ if(NULL == node) {
+ snmp_log(LOG_ERR,"could not allocate memory for node.");
+ return NULL;
+ }
+
+ netsnmp_add_list_data(head, node);
+
+ return node;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DATA_LIST_ADD_DATA */
+
+/** returns a data_list node's data for a given name within a data_list
+ * @param head the head node of a data_list
+ * @param name the name to find
+ * @return a pointer to the data cached at that node
+ */
+NETSNMP_INLINE void *
+netsnmp_get_list_data(netsnmp_data_list *head, const char *name)
+{
+ if (!name)
+ return NULL;
+ for (; head; head = head->next)
+ if (head->name && strcmp(head->name, name) == 0)
+ break;
+ if (head)
+ return head->data;
+ return NULL;
+}
+
+/** returns a data_list node for a given name within a data_list
+ * @param head the head node of a data_list
+ * @param name the name to find
+ * @return a pointer to the data_list node
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_DATA_LIST_GET_LIST_NODE
+NETSNMP_INLINE netsnmp_data_list *
+netsnmp_get_list_node(netsnmp_data_list *head, const char *name)
+{
+ if (!name)
+ return NULL;
+ for (; head; head = head->next)
+ if (head->name && strcmp(head->name, name) == 0)
+ break;
+ if (head)
+ return head;
+ return NULL;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DATA_LIST_GET_LIST_NODE */
+
+/** Removes a named node from a data_list (and frees it)
+ * @param realhead a pointer to the head node of a data_list
+ * @param name the name to find and remove
+ * @return 0 on successful find-and-delete, 1 otherwise.
+ */
+int
+netsnmp_remove_list_node(netsnmp_data_list **realhead, const char *name)
+{
+ netsnmp_data_list *head, *prev;
+ if (!name)
+ return 1;
+ for (head = *realhead, prev = NULL; head;
+ prev = head, head = head->next) {
+ if (head->name && strcmp(head->name, name) == 0) {
+ if (prev)
+ prev->next = head->next;
+ else
+ *realhead = head->next;
+ netsnmp_free_list_data(head);
+ free(head);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+/** used to store registered save/parse handlers (specifically, parsing info) */
+static netsnmp_data_list *saveHead;
+
+/** registers to store a data_list set of data at persistent storage time
+ *
+ * @param datalist the data to be saved
+ * @param type the name of the application to save the data as. If left NULL the default application name that was registered during the init_snmp call will be used (recommended).
+ * @param token the unique token identifier string to use as the first word in the persistent file line.
+ * @param data_list_save_ptr a function pointer which will be called to save the rest of the data to a buffer.
+ * @param data_list_read_ptr a function pointer which can read the remainder of a saved line and return the application specific void * pointer.
+ * @param data_list_free_ptr a function pointer which will be passed to the data node for freeing it in the future when/if the list/node is cleaned up or destroyed.
+ */
+void
+netsnmp_register_save_list(netsnmp_data_list **datalist,
+ const char *type, const char *token,
+ Netsnmp_Save_List_Data *data_list_save_ptr,
+ Netsnmp_Read_List_Data *data_list_read_ptr,
+ Netsnmp_Free_List_Data *data_list_free_ptr)
+{
+ netsnmp_data_list_saveinfo *info;
+
+ if (!data_list_save_ptr && !data_list_read_ptr)
+ return;
+
+ info = SNMP_MALLOC_TYPEDEF(netsnmp_data_list_saveinfo);
+
+ if (!info) {
+ snmp_log(LOG_ERR, "couldn't malloc a netsnmp_data_list_saveinfo typedef");
+ return;
+ }
+
+ info->datalist = datalist;
+ info->token = token;
+ info->type = type;
+ if (!info->type) {
+ info->type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ }
+
+ /* function which will save the data */
+ info->data_list_save_ptr = data_list_save_ptr;
+ if (data_list_save_ptr)
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ netsnmp_save_all_data_callback, info);
+
+ /* function which will read the data back in */
+ info->data_list_read_ptr = data_list_read_ptr;
+ if (data_list_read_ptr) {
+ /** @todo netsnmp_register_save_list should handle the same token name being saved from different types? */
+ netsnmp_add_list_data(&saveHead,
+ netsnmp_create_data_list(token, info, NULL));
+ register_config_handler(type, token, netsnmp_read_data_callback,
+ NULL /* XXX */, NULL);
+ }
+
+ info->data_list_free_ptr = data_list_free_ptr;
+}
+
+
+/** intended to be registerd as a callback operation.
+ * It should be registered using:
+ *
+ * snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA, netsnmp_save_all_data_callback, INFO_POINTER);
+ *
+ * where INFO_POINTER is a pointer to a netsnmp_data_list_saveinfo object containing apporpriate registration information
+ */
+int
+netsnmp_save_all_data_callback(int major, int minor,
+ void *serverarg, void *clientarg) {
+ netsnmp_data_list_saveinfo *info = (netsnmp_data_list_saveinfo *)clientarg;
+
+ if (!clientarg) {
+ snmp_log(LOG_WARNING, "netsnmp_save_all_data_callback called with no passed data");
+ return SNMP_ERR_NOERROR;
+ }
+
+ netsnmp_save_all_data(*(info->datalist), info->type, info->token,
+ info->data_list_save_ptr);
+ return SNMP_ERR_NOERROR;
+}
+
+/** intended to be called as a callback during persistent save operations.
+ * See the netsnmp_save_all_data_callback for where this is typically used. */
+int
+netsnmp_save_all_data(netsnmp_data_list *head,
+ const char *type, const char *token,
+ Netsnmp_Save_List_Data * data_list_save_ptr)
+{
+ char buf[SNMP_MAXBUF], *cp;
+
+ for (; head; head = head->next) {
+ if (head->name) {
+ /* save begining of line */
+ snprintf(buf, sizeof(buf), "%s ", token);
+ cp = buf + strlen(buf);
+ cp = read_config_save_octet_string(cp, (u_char*)head->name,
+ strlen(head->name));
+ *cp++ = ' ';
+
+ /* call registered function to save the rest */
+ if (!(data_list_save_ptr)(cp,
+ sizeof(buf) - strlen(buf),
+ head->data)) {
+ read_config_store(type, buf);
+ }
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/** intended to be registerd as a .conf parser
+ * It should be registered using:
+ *
+ * register_app_config_handler("token", netsnmp_read_data_callback, XXX)
+ *
+ * where INFO_POINTER is a pointer to a netsnmp_data_list_saveinfo object
+ * containing apporpriate registration information
+ * @todo make netsnmp_read_data_callback deal with a free routine
+ */
+void
+netsnmp_read_data_callback(const char *token, char *line) {
+ netsnmp_data_list_saveinfo *info;
+ char *dataname = NULL;
+ size_t dataname_len;
+ void *data = NULL;
+
+ /* find the stashed information about what we're parsing */
+ info = (netsnmp_data_list_saveinfo *) netsnmp_get_list_data(saveHead, token);
+ if (!info) {
+ snmp_log(LOG_WARNING, "netsnmp_read_data_callback called without previously registered subparser");
+ return;
+ }
+
+ /* read in the token */
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &dataname, &dataname_len);
+
+ if (!line || !dataname)
+ return;
+
+ /* call the sub-parser to read the rest */
+ data = (info->data_list_read_ptr)(line, strlen(line));
+
+ if (!data) {
+ free(dataname);
+ return;
+ }
+
+ /* add to the datalist */
+ netsnmp_add_list_data(info->datalist,
+ netsnmp_create_data_list(dataname, data,
+ info->data_list_free_ptr));
+
+ return;
+}
+/** @} */
+
diff --git a/snmplib/default_store.c b/snmplib/default_store.c
new file mode 100644
index 0000000..8dbc9bc
--- /dev/null
+++ b/snmplib/default_store.c
@@ -0,0 +1,572 @@
+/*
+ * default_store.c: storage space for defaults
+ */
+/* 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 default_store storage space for defaults
+ * @ingroup library
+ *
+ The purpose of the default storage is three-fold:
+
+ 1) To create a global storage space without creating a
+ whole bunch of globally accessible variables or a
+ whole bunch of access functions to work with more
+ privately restricted variables.
+
+ 2) To provide a single location where the thread lock-
+ ing needs to be implemented. At the time of this
+ writing, however, thread locking is not yet in
+ place.
+
+ 3) To reduce the number of cross dependencies between
+ code pieces that may or may not be linked together
+ in the long run. This provides for a single loca-
+ tion in which configuration data, for example, can
+ be stored for a separate section of code that may
+ not be linked in to the application in question.
+
+ The functions defined here implement these goals.
+
+ Currently, three data types are supported: booleans, inte-
+ gers, and strings. Each of these data types have separate
+ storage spaces. In addition, the storage space for each
+ data type is divided further by the application level.
+ Currently, there are two storage spaces. The first is
+ reserved for the SNMP library itself. The second is
+ intended for use in applications and is not modified or
+ checked by the library, and, therefore, this is the space
+ usable by you.
+
+ These definitions correspond with the "storid" argument to the API
+ - \#define NETSNMP_DS_LIBRARY_ID 0
+ - \#define NETSNMP_DS_APPLICATION_ID 1
+ - \#define NETSNMP_DS_TOKEN_ID 2
+
+ These definitions correspond with the "which" argument to the API,
+ when the storeid argument is NETSNMP_DS_LIBRARY_ID
+
+ library booleans
+
+ - \#define NETSNMP_DS_LIB_MIB_ERRORS 0
+ - \#define NETSNMP_DS_LIB_SAVE_MIB_DESCRS 1
+ - \#define NETSNMP_DS_LIB_MIB_COMMENT_TERM 2
+ - \#define NETSNMP_DS_LIB_MIB_PARSE_LABEL 3
+ - \#define NETSNMP_DS_LIB_DUMP_PACKET 4
+ - \#define NETSNMP_DS_LIB_LOG_TIMESTAMP 5
+ - \#define NETSNMP_DS_LIB_DONT_READ_CONFIGS 6
+ - \#define NETSNMP_DS_LIB_MIB_REPLACE 7 replace objects from latest module
+ - \#define NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM 8 print only numeric enum values
+ - \#define NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS 9 print only numeric enum values
+ - \#define NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS 10 dont print oid indexes specially
+ - \#define NETSNMP_DS_LIB_ALARM_DONT_USE_SIG 11 don't use the alarm() signal
+ - \#define NETSNMP_DS_LIB_PRINT_FULL_OID 12 print fully qualified oids
+ - \#define NETSNMP_DS_LIB_QUICK_PRINT 13 print very brief output for parsing
+ - \#define NETSNMP_DS_LIB_RANDOM_ACCESS 14 random access to oid labels
+ - \#define NETSNMP_DS_LIB_REGEX_ACCESS 15 regex matching to oid labels
+ - \#define NETSNMP_DS_LIB_DONT_CHECK_RANGE 16 don't check values for ranges on send
+ - \#define NETSNMP_DS_LIB_NO_TOKEN_WARNINGS 17 no warn about unknown config tokens
+ - \#define NETSNMP_DS_LIB_NUMERIC_TIMETICKS 18 print timeticks as a number
+ - \#define NETSNMP_DS_LIB_ESCAPE_QUOTES 19 shell escape quote marks in oids
+ - \#define NETSNMP_DS_LIB_REVERSE_ENCODE 20 encode packets from back to front
+ - \#define NETSNMP_DS_LIB_PRINT_BARE_VALUE 21 just print value (not OID = value)
+ - \#define NETSNMP_DS_LIB_EXTENDED_INDEX 22 print extended index format [x1][x2]
+ - \#define NETSNMP_DS_LIB_PRINT_HEX_TEXT 23 print ASCII text along with hex strings
+ - \#define NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID 24 print OID's using the UCD-style prefix suppression
+ - \#define NETSNMP_DS_LIB_READ_UCD_STYLE_OID 25 require top-level OIDs to be prefixed with a dot
+ - \#define NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG 26 have the pre-mib parsing config tokens been processed
+ - \#define NETSNMP_DS_LIB_HAVE_READ_CONFIG 27 have the config tokens been processed
+ - \#define NETSNMP_DS_LIB_QUICKE_PRINT 28
+ - \#define NETSNMP_DS_LIB_DONT_PRINT_UNITS 29 don't print UNITS suffix
+ - \#define NETSNMP_DS_LIB_NO_DISPLAY_HINT 30 don't apply DISPLAY-HINTs
+ - \#define NETSNMP_DS_LIB_16BIT_IDS 31 restrict requestIDs, etc to 16-bit values
+ - \#define NETSNMP_DS_LIB_DONT_PERSIST_STATE 32 don't save/load any persistant state
+ - \#define NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT 33 print a leading 0 on hex values <= 'f'
+
+
+ library integers
+
+ - \#define NETSNMP_DS_LIB_MIB_WARNINGS 0
+ - \#define NETSNMP_DS_LIB_SECLEVEL 1
+ - \#define NETSNMP_DS_LIB_SNMPVERSION 2
+ - \#define NETSNMP_DS_LIB_DEFAULT_PORT 3
+ - \#define NETSNMP_DS_LIB_OID_OUTPUT_FORMAT 4
+ - \#define NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT 5
+
+ library strings
+
+ - \#define NETSNMP_DS_LIB_SECNAME 0
+ - \#define NETSNMP_DS_LIB_CONTEXT 1
+ - \#define NETSNMP_DS_LIB_PASSPHRASE 2
+ - \#define NETSNMP_DS_LIB_AUTHPASSPHRASE 3
+ - \#define NETSNMP_DS_LIB_PRIVPASSPHRASE 4
+ - \#define NETSNMP_DS_LIB_OPTIONALCONFIG 5
+ - \#define NETSNMP_DS_LIB_APPTYPE 6
+ - \#define NETSNMP_DS_LIB_COMMUNITY 7
+ - \#define NETSNMP_DS_LIB_PERSISTENT_DIR 8
+ - \#define NETSNMP_DS_LIB_CONFIGURATION_DIR 9
+ - \#define NETSNMP_DS_LIB_SECMODEL 10
+ - \#define NETSNMP_DS_LIB_MIBDIRS 11
+ - \#define NETSNMP_DS_LIB_OIDSUFFIX 12
+ - \#define NETSNMP_DS_LIB_OIDPREFIX 13
+ - \#define NETSNMP_DS_LIB_CLIENT_ADDR 14
+ - \#define NETSNMP_DS_LIB_TEMP_FILE_PATTERN 15
+ - \#define NETSNMP_DS_LIB_AUTHMASTERKEY 16
+ - \#define NETSNMP_DS_LIB_PRIVMASTERKEY 17
+ - \#define NETSNMP_DS_LIB_AUTHLOCALIZEDKEY 18
+ - \#define NETSNMP_DS_LIB_PRIVLOCALIZEDKEY 19
+
+ * @{
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <sys/types.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.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
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/library/default_store.h> /* for "internal" definitions */
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/snmp_api.h>
+
+netsnmp_feature_child_of(default_store_all, libnetsnmp)
+
+netsnmp_feature_child_of(default_store_void, default_store_all)
+
+#ifndef NETSNMP_FEATURE_REMOVE_DEFAULT_STORE_VOID
+#endif /* NETSNMP_FEATURE_REMOVE_DEFAULT_STORE_VOID */
+
+
+static const char * stores [NETSNMP_DS_MAX_IDS] = { "LIB", "APP", "TOK" };
+
+typedef struct netsnmp_ds_read_config_s {
+ u_char type;
+ char *token;
+ char *ftype;
+ int storeid;
+ int which;
+ struct netsnmp_ds_read_config_s *next;
+} netsnmp_ds_read_config;
+
+static netsnmp_ds_read_config *netsnmp_ds_configs = NULL;
+
+static int netsnmp_ds_integers[NETSNMP_DS_MAX_IDS][NETSNMP_DS_MAX_SUBIDS];
+static char netsnmp_ds_booleans[NETSNMP_DS_MAX_IDS][NETSNMP_DS_MAX_SUBIDS/8];
+static char *netsnmp_ds_strings[NETSNMP_DS_MAX_IDS][NETSNMP_DS_MAX_SUBIDS];
+#ifndef NETSNMP_FEATURE_REMOVE_DEFAULT_STORE_VOID
+static void *netsnmp_ds_voids[NETSNMP_DS_MAX_IDS][NETSNMP_DS_MAX_SUBIDS];
+#endif /* NETSNMP_FEATURE_REMOVE_DEFAULT_STORE_VOID */
+
+/*
+ * Prototype definitions
+ */
+void netsnmp_ds_handle_config(const char *token, char *line);
+
+/**
+ * Stores "true" or "false" given an int value for value into
+ * netsnmp_ds_booleans[store][which] slot.
+ *
+ * @param storeid an index to the boolean storage container's first index(store)
+ *
+ * @param which an index to the boolean storage container's second index(which)
+ *
+ * @param value if > 0, "true" is set into the slot otherwise "false"
+ *
+ * @return Returns SNMPPERR_GENERR if the storeid and which parameters do not
+ * correspond to a valid slot, or SNMPERR_SUCCESS otherwise.
+ */
+int
+netsnmp_ds_set_boolean(int storeid, int which, int value)
+{
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ DEBUGMSGTL(("netsnmp_ds_set_boolean", "Setting %s:%d = %d/%s\n",
+ stores[storeid], which, value, ((value) ? "True" : "False")));
+
+ if (value > 0) {
+ netsnmp_ds_booleans[storeid][which/8] |= (1 << (which % 8));
+ } else {
+ netsnmp_ds_booleans[storeid][which/8] &= (0xff7f >> (7 - (which % 8)));
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+int
+netsnmp_ds_toggle_boolean(int storeid, int which)
+{
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ if ((netsnmp_ds_booleans[storeid][which/8] & (1 << (which % 8))) == 0) {
+ netsnmp_ds_booleans[storeid][which/8] |= (1 << (which % 8));
+ } else {
+ netsnmp_ds_booleans[storeid][which/8] &= (0xff7f >> (7 - (which % 8)));
+ }
+
+ DEBUGMSGTL(("netsnmp_ds_toggle_boolean", "Setting %s:%d = %d/%s\n",
+ stores[storeid], which, netsnmp_ds_booleans[storeid][which/8],
+ ((netsnmp_ds_booleans[storeid][which/8]) ? "True" : "False")));
+
+ return SNMPERR_SUCCESS;
+}
+
+int
+netsnmp_ds_get_boolean(int storeid, int which)
+{
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ return (netsnmp_ds_booleans[storeid][which/8] & (1 << (which % 8))) ? 1:0;
+}
+
+int
+netsnmp_ds_set_int(int storeid, int which, int value)
+{
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ DEBUGMSGTL(("netsnmp_ds_set_int", "Setting %s:%d = %d\n",
+ stores[storeid], which, value));
+
+ netsnmp_ds_integers[storeid][which] = value;
+ return SNMPERR_SUCCESS;
+}
+
+int
+netsnmp_ds_get_int(int storeid, int which)
+{
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ return netsnmp_ds_integers[storeid][which];
+}
+
+int
+netsnmp_ds_set_string(int storeid, int which, const char *value)
+{
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ DEBUGMSGTL(("netsnmp_ds_set_string", "Setting %s:%d = \"%s\"\n",
+ stores[storeid], which, (value ? value : "(null)")));
+
+ /*
+ * is some silly person is calling us with our own pointer?
+ */
+ if (netsnmp_ds_strings[storeid][which] == value)
+ return SNMPERR_SUCCESS;
+
+ if (netsnmp_ds_strings[storeid][which] != NULL) {
+ free(netsnmp_ds_strings[storeid][which]);
+ netsnmp_ds_strings[storeid][which] = NULL;
+ }
+
+ if (value) {
+ netsnmp_ds_strings[storeid][which] = strdup(value);
+ } else {
+ netsnmp_ds_strings[storeid][which] = NULL;
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+char *
+netsnmp_ds_get_string(int storeid, int which)
+{
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
+ return NULL;
+ }
+
+ return netsnmp_ds_strings[storeid][which];
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_DEFAULT_STORE_VOID
+int
+netsnmp_ds_set_void(int storeid, int which, void *value)
+{
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
+ return SNMPERR_GENERR;
+ }
+
+ DEBUGMSGTL(("netsnmp_ds_set_void", "Setting %s:%d = %p\n",
+ stores[storeid], which, value));
+
+ netsnmp_ds_voids[storeid][which] = value;
+
+ return SNMPERR_SUCCESS;
+}
+
+void *
+netsnmp_ds_get_void(int storeid, int which)
+{
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
+ return NULL;
+ }
+
+ return netsnmp_ds_voids[storeid][which];
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DEFAULT_STORE_VOID */
+
+int
+netsnmp_ds_parse_boolean(char *line)
+{
+ char *value, *endptr;
+ int itmp;
+ char *st;
+
+ value = strtok_r(line, " \t\n", &st);
+ if (strcasecmp(value, "yes") == 0 ||
+ strcasecmp(value, "true") == 0) {
+ return 1;
+ } else if (strcasecmp(value, "no") == 0 ||
+ strcasecmp(value, "false") == 0) {
+ return 0;
+ } else {
+ itmp = strtol(value, &endptr, 10);
+ if (*endptr != 0 || itmp < 0 || itmp > 1) {
+ config_perror("Should be yes|no|true|false|0|1");
+ return -1;
+ }
+ return itmp;
+ }
+}
+
+void
+netsnmp_ds_handle_config(const char *token, char *line)
+{
+ netsnmp_ds_read_config *drsp;
+ char buf[SNMP_MAXBUF];
+ char *value, *endptr;
+ int itmp;
+ char *st;
+
+ DEBUGMSGTL(("netsnmp_ds_handle_config", "handling %s\n", token));
+
+ for (drsp = netsnmp_ds_configs;
+ drsp != NULL && strcasecmp(token, drsp->token) != 0;
+ drsp = drsp->next);
+
+ if (drsp != NULL) {
+ DEBUGMSGTL(("netsnmp_ds_handle_config",
+ "setting: token=%s, type=%d, id=%s, which=%d\n",
+ drsp->token, drsp->type, stores[drsp->storeid],
+ drsp->which));
+
+ switch (drsp->type) {
+ case ASN_BOOLEAN:
+ itmp = netsnmp_ds_parse_boolean(line);
+ if ( itmp != -1 )
+ netsnmp_ds_set_boolean(drsp->storeid, drsp->which, itmp);
+ DEBUGMSGTL(("netsnmp_ds_handle_config", "bool: %d\n", itmp));
+ break;
+
+ case ASN_INTEGER:
+ value = strtok_r(line, " \t\n", &st);
+ itmp = strtol(value, &endptr, 10);
+ if (*endptr != 0) {
+ config_perror("Bad integer value");
+ } else {
+ netsnmp_ds_set_int(drsp->storeid, drsp->which, itmp);
+ }
+ DEBUGMSGTL(("netsnmp_ds_handle_config", "int: %d\n", itmp));
+ break;
+
+ case ASN_OCTET_STR:
+ if (*line == '"') {
+ copy_nword(line, buf, sizeof(buf));
+ netsnmp_ds_set_string(drsp->storeid, drsp->which, buf);
+ } else {
+ netsnmp_ds_set_string(drsp->storeid, drsp->which, line);
+ }
+ DEBUGMSGTL(("netsnmp_ds_handle_config", "string: %s\n", line));
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "netsnmp_ds_handle_config: type %d (0x%02x)\n",
+ drsp->type, drsp->type);
+ break;
+ }
+ } else {
+ snmp_log(LOG_ERR, "netsnmp_ds_handle_config: no registration for %s\n",
+ token);
+ }
+}
+
+
+int
+netsnmp_ds_register_config(u_char type, const char *ftype, const char *token,
+ int storeid, int which)
+{
+ netsnmp_ds_read_config *drsp;
+
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS || token == NULL) {
+ return SNMPERR_GENERR;
+ }
+
+ if (netsnmp_ds_configs == NULL) {
+ netsnmp_ds_configs = SNMP_MALLOC_TYPEDEF(netsnmp_ds_read_config);
+ if (netsnmp_ds_configs == NULL)
+ return SNMPERR_GENERR;
+ drsp = netsnmp_ds_configs;
+ } else {
+ for (drsp = netsnmp_ds_configs; drsp->next != NULL; drsp = drsp->next);
+ drsp->next = SNMP_MALLOC_TYPEDEF(netsnmp_ds_read_config);
+ if (drsp->next == NULL)
+ return SNMPERR_GENERR;
+ drsp = drsp->next;
+ }
+
+ drsp->type = type;
+ drsp->ftype = strdup(ftype);
+ drsp->token = strdup(token);
+ drsp->storeid = storeid;
+ drsp->which = which;
+
+ switch (type) {
+ case ASN_BOOLEAN:
+ register_config_handler(ftype, token, netsnmp_ds_handle_config, NULL,
+ "(1|yes|true|0|no|false)");
+ break;
+
+ case ASN_INTEGER:
+ register_config_handler(ftype, token, netsnmp_ds_handle_config, NULL,
+ "integerValue");
+ break;
+
+ case ASN_OCTET_STR:
+ register_config_handler(ftype, token, netsnmp_ds_handle_config, NULL,
+ "string");
+ break;
+
+ }
+ return SNMPERR_SUCCESS;
+}
+
+int
+netsnmp_ds_register_premib(u_char type, const char *ftype, const char *token,
+ int storeid, int which)
+{
+ netsnmp_ds_read_config *drsp;
+
+ if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
+ which < 0 || which >= NETSNMP_DS_MAX_SUBIDS || token == NULL) {
+ return SNMPERR_GENERR;
+ }
+
+ if (netsnmp_ds_configs == NULL) {
+ netsnmp_ds_configs = SNMP_MALLOC_TYPEDEF(netsnmp_ds_read_config);
+ if (netsnmp_ds_configs == NULL)
+ return SNMPERR_GENERR;
+ drsp = netsnmp_ds_configs;
+ } else {
+ for (drsp = netsnmp_ds_configs; drsp->next != NULL; drsp = drsp->next);
+ drsp->next = SNMP_MALLOC_TYPEDEF(netsnmp_ds_read_config);
+ if (drsp->next == NULL)
+ return SNMPERR_GENERR;
+ drsp = drsp->next;
+ }
+
+ drsp->type = type;
+ drsp->ftype = strdup(ftype);
+ drsp->token = strdup(token);
+ drsp->storeid = storeid;
+ drsp->which = which;
+
+ switch (type) {
+ case ASN_BOOLEAN:
+ register_prenetsnmp_mib_handler(ftype, token, netsnmp_ds_handle_config,
+ NULL, "(1|yes|true|0|no|false)");
+ break;
+
+ case ASN_INTEGER:
+ register_prenetsnmp_mib_handler(ftype, token, netsnmp_ds_handle_config,
+ NULL, "integerValue");
+ break;
+
+ case ASN_OCTET_STR:
+ register_prenetsnmp_mib_handler(ftype, token, netsnmp_ds_handle_config,
+ NULL, "string");
+ break;
+
+ }
+ return SNMPERR_SUCCESS;
+}
+
+void
+netsnmp_ds_shutdown(void)
+{
+ netsnmp_ds_read_config *drsp;
+ int i, j;
+
+ for (drsp = netsnmp_ds_configs; drsp; drsp = netsnmp_ds_configs) {
+ netsnmp_ds_configs = drsp->next;
+
+ if (drsp->ftype && drsp->token) {
+ unregister_config_handler(drsp->ftype, drsp->token);
+ }
+ if (drsp->ftype != NULL) {
+ free(drsp->ftype);
+ }
+ if (drsp->token != NULL) {
+ free(drsp->token);
+ }
+ free(drsp);
+ }
+
+ for (i = 0; i < NETSNMP_DS_MAX_IDS; i++) {
+ for (j = 0; j < NETSNMP_DS_MAX_SUBIDS; j++) {
+ if (netsnmp_ds_strings[i][j] != NULL) {
+ free(netsnmp_ds_strings[i][j]);
+ netsnmp_ds_strings[i][j] = NULL;
+ }
+ }
+ }
+}
+/** @} */
diff --git a/snmplib/dir_utils.c b/snmplib/dir_utils.c
new file mode 100644
index 0000000..cbb6d00
--- /dev/null
+++ b/snmplib/dir_utils.c
@@ -0,0 +1,256 @@
+/* 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 (C) 2007 Apple, 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-features.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <stdio.h>
+#include <ctype.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
+
+#include <sys/types.h>
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+
+#include <errno.h>
+
+#if HAVE_DMALLOC_H
+# include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/file_utils.h>
+#include <net-snmp/library/dir_utils.h>
+
+netsnmp_feature_child_of(container_directory, container_types)
+#ifdef NETSNMP_FEATURE_REQUIRE_CONTAINER_DIRECTORY
+netsnmp_feature_require(file_utils)
+netsnmp_feature_require(container_free_all)
+#endif /* NETSNMP_FEATURE_REQUIRE_CONTAINER_DIRECTORY */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_DIRECTORY
+static int
+_insert_nsfile( netsnmp_container *c, const char *name, struct stat *stats,
+ u_int flags);
+
+/*
+ * read file names in a directory, with an optional filter
+ */
+netsnmp_container *
+netsnmp_directory_container_read_some(netsnmp_container *user_container,
+ const char *dirname,
+ netsnmp_directory_filter *filter,
+ void *filter_ctx, u_int flags)
+{
+ DIR *dir;
+ netsnmp_container *container = user_container;
+ struct dirent *file;
+ char path[SNMP_MAXPATH];
+ size_t dirname_len;
+ int rc;
+ struct stat statbuf;
+ netsnmp_file ns_file_tmp;
+
+ if ((flags & NETSNMP_DIR_RELATIVE_PATH) && (flags & NETSNMP_DIR_RECURSE)) {
+ DEBUGMSGTL(("directory:container",
+ "no support for relative path with recursion\n"));
+ return NULL;
+ }
+
+ DEBUGMSGTL(("directory:container", "reading %s\n", dirname));
+
+ /*
+ * create the container, if needed
+ */
+ if (NULL == container) {
+ if (flags & NETSNMP_DIR_NSFILE) {
+ container = netsnmp_container_find("nsfile_directory_container:"
+ "binary_array");
+ if (container) {
+ container->compare = (netsnmp_container_compare*)
+ netsnmp_file_compare_name;
+ container->free_item = (netsnmp_container_obj_func *)
+ netsnmp_file_container_free;
+ }
+ }
+ else
+ container = netsnmp_container_find("directory_container:cstring");
+ if (NULL == container)
+ return NULL;
+ container->container_name = strdup(dirname);
+ /** default to unsorted */
+ if (! (flags & NETSNMP_DIR_SORTED))
+ CONTAINER_SET_OPTIONS(container, CONTAINER_KEY_UNSORTED, rc);
+ }
+
+ dir = opendir(dirname);
+ if (NULL == dir) {
+ DEBUGMSGTL(("directory:container", " not a dir\n"));
+ if (container != user_container)
+ netsnmp_directory_container_free(container);
+ return NULL;
+ }
+
+ /** copy dirname into path */
+ if (flags & NETSNMP_DIR_RELATIVE_PATH)
+ dirname_len = 0;
+ else {
+ dirname_len = strlen(dirname);
+ strlcpy(path, dirname, sizeof(path));
+ if ((dirname_len + 2) > sizeof(path)) {
+ /** not enough room for files */
+ closedir(dir);
+ if (container != user_container)
+ netsnmp_directory_container_free(container);
+ return NULL;
+ }
+ path[dirname_len] = '/';
+ path[++dirname_len] = '\0';
+ }
+
+ /** iterate over dir */
+ while ((file = readdir(dir))) {
+
+ if ((file->d_name == NULL) || (file->d_name[0] == 0))
+ continue;
+
+ /** skip '.' and '..' */
+ if ((file->d_name[0] == '.') &&
+ ((file->d_name[1] == 0) ||
+ ((file->d_name[1] == '.') && ((file->d_name[2] == 0)))))
+ continue;
+
+ strlcpy(&path[dirname_len], file->d_name, sizeof(path) - dirname_len);
+ if (NULL != filter) {
+ if (flags & NETSNMP_DIR_NSFILE_STATS) {
+ /** use local vars for now */
+ if (stat(path, &statbuf) != 0) {
+ snmp_log(LOG_ERR, "could not stat %s\n", file->d_name);
+ break;
+ }
+ ns_file_tmp.stats = &statbuf;
+ ns_file_tmp.name = path;
+ rc = (*filter)(&ns_file_tmp, filter_ctx);
+ }
+ else
+ rc = (*filter)(path, filter_ctx);
+ if (0 == rc) {
+ DEBUGMSGTL(("directory:container:filtered", "%s\n",
+ file->d_name));
+ continue;
+ }
+ }
+
+ DEBUGMSGTL(("directory:container:found", "%s\n", path));
+ if ((flags & NETSNMP_DIR_RECURSE)
+#if defined(HAVE_STRUCT_DIRENT_D_TYPE) && defined(DT_DIR)
+ && (file->d_type == DT_DIR)
+#elif defined(S_ISDIR)
+ && (stat(file->d_name, &statbuf) != 0) && (S_ISDIR(statbuf.st_mode))
+#endif
+ ) {
+ /** xxx add the dir as well? not for now.. maybe another flag? */
+ netsnmp_directory_container_read(container, path, flags);
+ }
+ else if (flags & NETSNMP_DIR_NSFILE) {
+ if (_insert_nsfile( container, file->d_name,
+ filter ? &statbuf : NULL, flags ) < 0)
+ break;
+ }
+ else {
+ char *dup = strdup(path);
+ if (NULL == dup) {
+ snmp_log(LOG_ERR,
+ "strdup failed while building directory container\n");
+ break;
+ }
+ rc = CONTAINER_INSERT(container, dup);
+ if (-1 == rc ) {
+ DEBUGMSGTL(("directory:container", " err adding %s\n", path));
+ free(dup);
+ }
+ }
+ } /* while */
+
+ closedir(dir);
+
+ rc = CONTAINER_SIZE(container);
+ DEBUGMSGTL(("directory:container", " container now has %d items\n", rc));
+ if ((0 == rc) && !(flags & NETSNMP_DIR_EMPTY_OK)) {
+ netsnmp_directory_container_free(container);
+ return NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_directory_container_free(netsnmp_container *container)
+{
+ CONTAINER_FREE_ALL(container, NULL);
+ CONTAINER_FREE(container);
+}
+
+static int
+_insert_nsfile( netsnmp_container *c, const char *name, struct stat *stats,
+ u_int flags)
+{
+ int rc;
+ netsnmp_file *ns_file = netsnmp_file_new(name, 0, 0, 0);
+ if (NULL == ns_file) {
+ snmp_log(LOG_ERR, "error creating ns_file\n");
+ return -1;
+ }
+
+ if (flags & NETSNMP_DIR_NSFILE_STATS) {
+ ns_file->stats = (struct stat*)calloc(1,sizeof(*(ns_file->stats)));
+ if (NULL == ns_file->stats) {
+ snmp_log(LOG_ERR, "error creating stats for ns_file\n");
+ netsnmp_file_release(ns_file);
+ return -1;
+ }
+
+ /** use stats from earlier if we have them */
+ if (stats)
+ memcpy(ns_file->stats, stats, sizeof(*stats));
+ else
+ stat(ns_file->name, ns_file->stats);
+ }
+
+ rc = CONTAINER_INSERT(c, ns_file);
+ if (-1 == rc ) {
+ DEBUGMSGTL(("directory:container", " err adding %s\n", name));
+ netsnmp_file_release(ns_file);
+ }
+
+ return 0;
+}
+#else /* NETSNMP_FEATURE_REMOVE_CONTAINER_DIRECTORY */
+netsnmp_feature_unused(container_directory);
+#endif /* NETSNMP_FEATURE_REMOVE_CONTAINER_DIRECTORY */
diff --git a/snmplib/fd_event_manager.c b/snmplib/fd_event_manager.c
new file mode 100644
index 0000000..f9cf08e
--- /dev/null
+++ b/snmplib/fd_event_manager.c
@@ -0,0 +1,297 @@
+/* UNIT: File Descriptor (FD) Event Manager */
+#include <net-snmp/net-snmp-config.h>
+#ifdef HAVE_SYS_SELECT
+#include <sys/select.h>
+#endif
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/fd_event_manager.h>
+#include <net-snmp/library/snmp_logging.h>
+#include <net-snmp/library/large_fd_set.h>
+
+netsnmp_feature_child_of(fd_event_manager, libnetsnmp)
+
+#ifndef NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER
+int external_readfd[NUM_EXTERNAL_FDS], external_readfdlen = 0;
+int external_writefd[NUM_EXTERNAL_FDS], external_writefdlen = 0;
+int external_exceptfd[NUM_EXTERNAL_FDS], external_exceptfdlen = 0;
+void (*external_readfdfunc[NUM_EXTERNAL_FDS]) (int, void *);
+void (*external_writefdfunc[NUM_EXTERNAL_FDS]) (int, void *);
+void (*external_exceptfdfunc[NUM_EXTERNAL_FDS]) (int, void *);
+void *external_readfd_data[NUM_EXTERNAL_FDS];
+void *external_writefd_data[NUM_EXTERNAL_FDS];
+void *external_exceptfd_data[NUM_EXTERNAL_FDS];
+
+static int external_fd_unregistered;
+
+/*
+ * Register a given fd for read events. Call callback when events
+ * are received.
+ */
+int
+register_readfd(int fd, void (*func) (int, void *), void *data)
+{
+ if (external_readfdlen < NUM_EXTERNAL_FDS) {
+ external_readfd[external_readfdlen] = fd;
+ external_readfdfunc[external_readfdlen] = func;
+ external_readfd_data[external_readfdlen] = data;
+ external_readfdlen++;
+ DEBUGMSGTL(("fd_event_manager:register_readfd", "registered fd %d\n", fd));
+ return FD_REGISTERED_OK;
+ } else {
+ snmp_log(LOG_CRIT, "register_readfd: too many file descriptors\n");
+ return FD_REGISTRATION_FAILED;
+ }
+}
+
+/*
+ * Register a given fd for write events. Call callback when events
+ * are received.
+ */
+int
+register_writefd(int fd, void (*func) (int, void *), void *data)
+{
+ if (external_writefdlen < NUM_EXTERNAL_FDS) {
+ external_writefd[external_writefdlen] = fd;
+ external_writefdfunc[external_writefdlen] = func;
+ external_writefd_data[external_writefdlen] = data;
+ external_writefdlen++;
+ DEBUGMSGTL(("fd_event_manager:register_writefd", "registered fd %d\n", fd));
+ return FD_REGISTERED_OK;
+ } else {
+ snmp_log(LOG_CRIT,
+ "register_writefd: too many file descriptors\n");
+ return FD_REGISTRATION_FAILED;
+ }
+}
+
+/*
+ * Register a given fd for exception events. Call callback when events
+ * are received.
+ */
+int
+register_exceptfd(int fd, void (*func) (int, void *), void *data)
+{
+ if (external_exceptfdlen < NUM_EXTERNAL_FDS) {
+ external_exceptfd[external_exceptfdlen] = fd;
+ external_exceptfdfunc[external_exceptfdlen] = func;
+ external_exceptfd_data[external_exceptfdlen] = data;
+ external_exceptfdlen++;
+ DEBUGMSGTL(("fd_event_manager:register_exceptfd", "registered fd %d\n", fd));
+ return FD_REGISTERED_OK;
+ } else {
+ snmp_log(LOG_CRIT,
+ "register_exceptfd: too many file descriptors\n");
+ return FD_REGISTRATION_FAILED;
+ }
+}
+
+/*
+ * Unregister a given fd for read events.
+ */
+int
+unregister_readfd(int fd)
+{
+ int i, j;
+
+ for (i = 0; i < external_readfdlen; i++) {
+ if (external_readfd[i] == fd) {
+ external_readfdlen--;
+ for (j = i; j < external_readfdlen; j++) {
+ external_readfd[j] = external_readfd[j + 1];
+ external_readfdfunc[j] = external_readfdfunc[j + 1];
+ external_readfd_data[j] = external_readfd_data[j + 1];
+ }
+ DEBUGMSGTL(("fd_event_manager:unregister_readfd", "unregistered fd %d\n", fd));
+ external_fd_unregistered = 1;
+ return FD_UNREGISTERED_OK;
+ }
+ }
+ return FD_NO_SUCH_REGISTRATION;
+}
+
+/*
+ * Unregister a given fd for read events.
+ */
+int
+unregister_writefd(int fd)
+{
+ int i, j;
+
+ for (i = 0; i < external_writefdlen; i++) {
+ if (external_writefd[i] == fd) {
+ external_writefdlen--;
+ for (j = i; j < external_writefdlen; j++) {
+ external_writefd[j] = external_writefd[j + 1];
+ external_writefdfunc[j] = external_writefdfunc[j + 1];
+ external_writefd_data[j] = external_writefd_data[j + 1];
+ }
+ DEBUGMSGTL(("fd_event_manager:unregister_writefd", "unregistered fd %d\n", fd));
+ external_fd_unregistered = 1;
+ return FD_UNREGISTERED_OK;
+ }
+ }
+ return FD_NO_SUCH_REGISTRATION;
+}
+
+/*
+ * Unregister a given fd for exception events.
+ */
+int
+unregister_exceptfd(int fd)
+{
+ int i, j;
+
+ for (i = 0; i < external_exceptfdlen; i++) {
+ if (external_exceptfd[i] == fd) {
+ external_exceptfdlen--;
+ for (j = i; j < external_exceptfdlen; j++) {
+ external_exceptfd[j] = external_exceptfd[j + 1];
+ external_exceptfdfunc[j] = external_exceptfdfunc[j + 1];
+ external_exceptfd_data[j] = external_exceptfd_data[j + 1];
+ }
+ DEBUGMSGTL(("fd_event_manager:unregister_exceptfd", "unregistered fd %d\n",
+ fd));
+ external_fd_unregistered = 1;
+ return FD_UNREGISTERED_OK;
+ }
+ }
+ return FD_NO_SUCH_REGISTRATION;
+}
+
+/*
+ * NET-SNMP External Event Info
+ */
+void netsnmp_external_event_info(int *numfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
+{
+ netsnmp_large_fd_set lreadfds;
+ netsnmp_large_fd_set lwritefds;
+ netsnmp_large_fd_set lexceptfds;
+
+ netsnmp_large_fd_set_init(&lreadfds, FD_SETSIZE);
+ netsnmp_large_fd_set_init(&lwritefds, FD_SETSIZE);
+ netsnmp_large_fd_set_init(&lexceptfds, FD_SETSIZE);
+
+ netsnmp_copy_fd_set_to_large_fd_set(&lreadfds, readfds);
+ netsnmp_copy_fd_set_to_large_fd_set(&lwritefds, writefds);
+ netsnmp_copy_fd_set_to_large_fd_set(&lexceptfds, exceptfds);
+
+ netsnmp_external_event_info2(numfds, &lreadfds, &lwritefds, &lexceptfds);
+
+ if (netsnmp_copy_large_fd_set_to_fd_set(readfds, &lreadfds) < 0
+ || netsnmp_copy_large_fd_set_to_fd_set(writefds, &lwritefds) < 0
+ || netsnmp_copy_large_fd_set_to_fd_set(exceptfds, &lexceptfds) < 0)
+ {
+ snmp_log(LOG_ERR,
+ "Use netsnmp_external_event_info2() for processing"
+ " large file descriptors\n");
+ }
+
+ netsnmp_large_fd_set_cleanup(&lreadfds);
+ netsnmp_large_fd_set_cleanup(&lwritefds);
+ netsnmp_large_fd_set_cleanup(&lexceptfds);
+}
+
+void netsnmp_external_event_info2(int *numfds,
+ netsnmp_large_fd_set *readfds,
+ netsnmp_large_fd_set *writefds,
+ netsnmp_large_fd_set *exceptfds)
+{
+ int i;
+
+ external_fd_unregistered = 0;
+
+ for (i = 0; i < external_readfdlen; i++) {
+ NETSNMP_LARGE_FD_SET(external_readfd[i], readfds);
+ if (external_readfd[i] >= *numfds)
+ *numfds = external_readfd[i] + 1;
+ }
+ for (i = 0; i < external_writefdlen; i++) {
+ NETSNMP_LARGE_FD_SET(external_writefd[i], writefds);
+ if (external_writefd[i] >= *numfds)
+ *numfds = external_writefd[i] + 1;
+ }
+ for (i = 0; i < external_exceptfdlen; i++) {
+ NETSNMP_LARGE_FD_SET(external_exceptfd[i], exceptfds);
+ if (external_exceptfd[i] >= *numfds)
+ *numfds = external_exceptfd[i] + 1;
+ }
+}
+
+/*
+ * NET-SNMP Dispatch External Events
+ */
+void netsnmp_dispatch_external_events(int *count, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
+{
+ netsnmp_large_fd_set lreadfds;
+ netsnmp_large_fd_set lwritefds;
+ netsnmp_large_fd_set lexceptfds;
+
+ netsnmp_large_fd_set_init(&lreadfds, FD_SETSIZE);
+ netsnmp_large_fd_set_init(&lwritefds, FD_SETSIZE);
+ netsnmp_large_fd_set_init(&lexceptfds, FD_SETSIZE);
+
+ netsnmp_copy_fd_set_to_large_fd_set(&lreadfds, readfds);
+ netsnmp_copy_fd_set_to_large_fd_set(&lwritefds, writefds);
+ netsnmp_copy_fd_set_to_large_fd_set(&lexceptfds, exceptfds);
+
+ netsnmp_dispatch_external_events2(count, &lreadfds, &lwritefds, &lexceptfds);
+
+ if (netsnmp_copy_large_fd_set_to_fd_set(readfds, &lreadfds) < 0
+ || netsnmp_copy_large_fd_set_to_fd_set(writefds, &lwritefds) < 0
+ || netsnmp_copy_large_fd_set_to_fd_set(exceptfds, &lexceptfds) < 0)
+ {
+ snmp_log(LOG_ERR,
+ "Use netsnmp_dispatch_external_events2() for processing"
+ " large file descriptors\n");
+ }
+
+ netsnmp_large_fd_set_cleanup(&lreadfds);
+ netsnmp_large_fd_set_cleanup(&lwritefds);
+ netsnmp_large_fd_set_cleanup(&lexceptfds);
+}
+
+void netsnmp_dispatch_external_events2(int *count,
+ netsnmp_large_fd_set *readfds,
+ netsnmp_large_fd_set *writefds,
+ netsnmp_large_fd_set *exceptfds)
+{
+ int i;
+ for (i = 0;
+ *count && (i < external_readfdlen) && !external_fd_unregistered; i++) {
+ if (NETSNMP_LARGE_FD_ISSET(external_readfd[i], readfds)) {
+ DEBUGMSGTL(("fd_event_manager:netsnmp_dispatch_external_events",
+ "readfd[%d] = %d\n", i, external_readfd[i]));
+ external_readfdfunc[i] (external_readfd[i],
+ external_readfd_data[i]);
+ NETSNMP_LARGE_FD_CLR(external_readfd[i], readfds);
+ (*count)--;
+ }
+ }
+ for (i = 0;
+ *count && (i < external_writefdlen) && !external_fd_unregistered; i++) {
+ if (NETSNMP_LARGE_FD_ISSET(external_writefd[i], writefds)) {
+ DEBUGMSGTL(("fd_event_manager:netsnmp_dispatch_external_events",
+ "writefd[%d] = %d\n", i, external_writefd[i]));
+ external_writefdfunc[i] (external_writefd[i],
+ external_writefd_data[i]);
+ NETSNMP_LARGE_FD_CLR(external_writefd[i], writefds);
+ (*count)--;
+ }
+ }
+ for (i = 0;
+ *count && (i < external_exceptfdlen) && !external_fd_unregistered; i++) {
+ if (NETSNMP_LARGE_FD_ISSET(external_exceptfd[i], exceptfds)) {
+ DEBUGMSGTL(("fd_event_manager:netsnmp_dispatch_external_events",
+ "exceptfd[%d] = %d\n", i, external_exceptfd[i]));
+ external_exceptfdfunc[i] (external_exceptfd[i],
+ external_exceptfd_data[i]);
+ NETSNMP_LARGE_FD_CLR(external_exceptfd[i], exceptfds);
+ (*count)--;
+ }
+ }
+}
+#else /* !NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER */
+netsnmp_feature_unused(fd_event_manager);
+#endif /* !NETSNMP_FEATURE_REMOVE_FD_EVENT_MANAGER */
diff --git a/snmplib/file_utils.c b/snmplib/file_utils.c
new file mode 100644
index 0000000..5261431
--- /dev/null
+++ b/snmplib/file_utils.c
@@ -0,0 +1,263 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <stdio.h>
+#include <ctype.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
+
+#include <sys/types.h>
+
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#include <errno.h>
+
+#if HAVE_DMALLOC_H
+# include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/file_utils.h>
+
+netsnmp_feature_child_of(file_utils_all, libnetsnmp)
+netsnmp_feature_child_of(file_utils, file_utils_all)
+netsnmp_feature_child_of(file_close, file_utils_all)
+
+#ifndef NETSNMP_FEATURE_REMOVE_FILE_UTILS
+/*------------------------------------------------------------------
+ *
+ * Prototypes
+ *
+ */
+
+
+
+
+/*------------------------------------------------------------------
+ *
+ * Core Functions
+ *
+ */
+
+/**
+ * allocate a netsnmp_file structure
+ *
+ * This routine should be used instead of allocating on the stack,
+ * for future compatability.
+ */
+netsnmp_file *
+netsnmp_file_create(void)
+{
+ netsnmp_file *filei = SNMP_MALLOC_TYPEDEF(netsnmp_file);
+
+ /*
+ * 0 is a valid file descriptor, so init to -1
+ */
+ if (NULL != filei)
+ filei->fd = -1;
+ else {
+ snmp_log(LOG_WARNING,"failed to malloc netsnmp_file structure\n");
+ }
+
+ return filei;
+}
+
+/**
+ * open file and get stats
+ */
+netsnmp_file *
+netsnmp_file_new(const char *name, int fs_flags, mode_t mode, u_int ns_flags)
+{
+ netsnmp_file *filei = netsnmp_file_fill(NULL, name, fs_flags, mode, 0);
+ if (NULL == filei)
+ return NULL;
+
+ if (ns_flags & NETSNMP_FILE_STATS) {
+ filei->stats = (struct stat*)calloc(1, sizeof(*(filei->stats)));
+ if (NULL == filei->stats)
+ DEBUGMSGT(("nsfile:new", "no memory for stats\n"));
+ else if (stat(name, filei->stats) != 0)
+ DEBUGMSGT(("nsfile:new", "error getting stats\n"));
+ }
+
+ if (ns_flags & NETSNMP_FILE_AUTO_OPEN)
+ netsnmp_file_open(filei);
+
+ return filei;
+}
+
+
+/**
+ * fill core members in a netsnmp_file structure
+ *
+ * @param filei structure to fill; if NULL, a new one will be allocated
+ * @param name file name
+ * @param fs_flags filesystem flags passed to open()
+ * @param mode optional filesystem open modes passed to open()
+ * @param ns_flags net-snmp flags
+ */
+netsnmp_file *
+netsnmp_file_fill(netsnmp_file * filei, const char* name,
+ int fs_flags, mode_t mode, u_int ns_flags)
+{
+ if (NULL == filei) {
+ filei = netsnmp_file_create();
+ if (NULL == filei) /* failure already logged */
+ return NULL;
+ }
+
+ if (NULL != name)
+ filei->name = strdup(name);
+
+ filei->fs_flags = fs_flags;
+ filei->ns_flags = ns_flags;
+ filei->mode = mode;
+
+ return filei;
+}
+
+/**
+ * release a netsnmp_file structure
+ *
+ * @retval see close() man page
+ */
+int
+netsnmp_file_release(netsnmp_file * filei)
+{
+ int rc = 0;
+
+ if (NULL == filei)
+ return -1;
+
+ if ((filei->fd > 0) && NS_FI_AUTOCLOSE(filei->ns_flags))
+ rc = close(filei->fd);
+
+ if (NULL != filei->name)
+ free(filei->name); /* no point in SNMP_FREE */
+
+ if (NULL != filei->extras)
+ netsnmp_free_all_list_data(filei->extras);
+
+ if (NULL != filei->stats)
+ free(filei->stats);
+
+ SNMP_FREE(filei);
+
+ return rc;
+}
+
+/**
+ * open the file associated with a netsnmp_file structure
+ *
+ * @retval -1 : error opening file
+ * @retval >=0 : file descriptor for opened file
+ */
+int
+netsnmp_file_open(netsnmp_file * filei)
+{
+ /*
+ * basic sanity checks
+ */
+ if ((NULL == filei) || (NULL == filei->name))
+ return -1;
+
+ /*
+ * if file is already open, just return the fd.
+ */
+ if (-1 != filei->fd)
+ return filei->fd;
+
+ /*
+ * try to open the file, loging an error if we failed
+ */
+ if (0 == filei->mode)
+ filei->fd = open(filei->name, filei->fs_flags);
+ else
+ filei->fd = open(filei->name, filei->fs_flags, filei->mode);
+
+ if (filei->fd < 0) {
+ DEBUGMSGTL(("netsnmp_file", "error opening %s (%d)\n", filei->name, errno));
+ }
+
+ /*
+ * return results
+ */
+ return filei->fd;
+}
+
+
+/**
+ * close the file associated with a netsnmp_file structure
+ *
+ * @retval 0 : success
+ * @retval -1 : error
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_FILE_CLOSE
+int
+netsnmp_file_close(netsnmp_file * filei)
+{
+ int rc;
+
+ /*
+ * basic sanity checks
+ */
+ if ((NULL == filei) || (NULL != filei->name))
+ return -1;
+
+ /*
+ * make sure it's not already closed
+ */
+ if (-1 == filei->fd) {
+ return 0;
+ }
+
+ /*
+ * close the file, logging an error if we failed
+ */
+ rc = close(filei->fd);
+ if (rc < 0) {
+ DEBUGMSGTL(("netsnmp_file", "error closing %s (%d)\n", filei->name, errno));
+ }
+ else
+ filei->fd = -1;
+
+ return rc;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_FILE_CLOSE */
+
+void
+netsnmp_file_container_free(netsnmp_file *file, void *context)
+{
+ netsnmp_file_release(file);
+}
+
+int
+netsnmp_file_compare_name(netsnmp_file *lhs, netsnmp_file *rhs)
+{
+ netsnmp_assert((NULL != lhs) && (NULL != rhs));
+ netsnmp_assert((NULL != lhs->name) && (NULL != rhs->name));
+
+ return strcmp(lhs->name, rhs->name);
+}
+#else /* NETSNMP_FEATURE_REMOVE_FILE_UTILS */
+netsnmp_feature_unused(file_utils);
+#endif /* NETSNMP_FEATURE_REMOVE_FILE_UTILS */
diff --git a/snmplib/getopt.c b/snmplib/getopt.c
new file mode 100644
index 0000000..1e8e9c3
--- /dev/null
+++ b/snmplib/getopt.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+/*
+ * static char sccsid[] = "from: @(#)getopt.c 8.2 (Berkeley) 4/2/94";
+ */
+static char *rcsid =
+ "$Id$";
+#endif /* LIBC_SCCS and not lint */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <net-snmp/library/getopt.h>
+
+#ifdef _BSD
+extern char *__progname;
+#else
+#define __progname "getopt"
+#endif
+
+int opterr = 1, /* if error message should be printed */
+ optind = 1, /* index into parent argv vector */
+ optopt, /* character checked for validity */
+ optreset; /* reset getopt */
+char *optarg; /* argument associated with option */
+char EMSG[] = "";
+
+#define BADCH (int)'?'
+#define BADARG (int)':'
+
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt(int nargc, char *const *nargv, const char *ostr)
+{
+ static char *place = EMSG; /* option letter processing */
+ char *oli; /* option letter list index */
+
+ if (optreset || !*place) { /* update scanning pointer */
+ optreset = 0;
+ if (optind >= nargc || *(place = nargv[optind]) != '-') {
+ place = EMSG;
+ return (-1);
+ }
+ if (place[1] && *++place == '-') { /* found "--" */
+ ++optind;
+ place = EMSG;
+ return (-1);
+ }
+ } /* option letter okay? */
+ if ((optopt = (int) *place++) == (int) ':' ||
+ !(oli = strchr(ostr, optopt))) {
+ /*
+ * if the user didn't specify '-' as an option,
+ * assume it means -1.
+ */
+ if (optopt == (int) '-')
+ return (-1);
+ if (!*place)
+ ++optind;
+ if (opterr && *ostr != ':')
+ (void) fprintf(stderr,
+ "%s: illegal option -- %c\n", __progname,
+ optopt);
+ return (BADCH);
+ }
+ if (*++oli != ':') { /* don't need argument */
+ optarg = NULL;
+ if (!*place)
+ ++optind;
+ } else { /* need an argument */
+ if (*place) /* no white space */
+ optarg = place;
+ else if (nargc <= ++optind) { /* no arg */
+ place = EMSG;
+ if (*ostr == ':')
+ return (BADARG);
+ if (opterr)
+ (void) fprintf(stderr,
+ "%s: option requires an argument -- %c\n",
+ __progname, optopt);
+ return (BADCH);
+ } else /* white space */
+ optarg = nargv[optind];
+ place = EMSG;
+ ++optind;
+ }
+ return (optopt); /* dump back option letter */
+}
diff --git a/snmplib/gettimeofday.c b/snmplib/gettimeofday.c
new file mode 100644
index 0000000..df5c0a0
--- /dev/null
+++ b/snmplib/gettimeofday.c
@@ -0,0 +1,33 @@
+/*
+ * gettimeofday() replacement for MSVC.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/types.h>
+
+#ifdef HAVE_SYS_TIMEB_H
+# include <sys/timeb.h> /* _ftime() */
+#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 <net-snmp/library/system.h>
+
+int
+gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+ struct _timeb timebuffer;
+
+ _ftime(&timebuffer);
+ tv->tv_usec = timebuffer.millitm * 1000;
+ tv->tv_sec = (long)timebuffer.time;
+ return (0);
+}
diff --git a/snmplib/inet_ntop.c b/snmplib/inet_ntop.c
new file mode 100644
index 0000000..62dd36d
--- /dev/null
+++ b/snmplib/inet_ntop.c
@@ -0,0 +1,210 @@
+/* Id: inet_ntop.c,v 1.4 2001/04/17 07:53:47 lukem Exp */
+/* $NetBSD: inet_ntop.c,v 1.9 2000/01/22 22:19:16 mycroft Exp $ */
+
+/* Copyright (c) 1996 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 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_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/types.h>
+
+#include "inet_ntop.h"
+
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#endif
+
+#ifndef IN6ADDRSZ
+#define IN6ADDRSZ 16
+#endif
+
+#ifndef INT16SZ
+#define INT16SZ 2
+#endif
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static const char *inet_ntop4(const u_char *src, char *dst, size_t size);
+#ifdef NETSNMP_ENABLE_IPV6
+static const char *inet_ntop6(const u_char *src, char *dst, size_t size);
+#endif /* NETSNMP_ENABLE_IPV6 */
+
+/* char *
+ * inet_ntop(af, src, dst, size)
+ * convert a network format address to presentation format.
+ * return:
+ * pointer to presentation format address (`dst'), or NULL (see errno).
+ * author:
+ * Paul Vixie, 1996.
+ */
+const char *
+inet_ntop(int af, const void *src, char *dst, size_t size)
+{
+
+ switch (af) {
+ case AF_INET:
+ return (inet_ntop4(src, dst, size));
+#ifdef NETSNMP_ENABLE_IPV6
+ case AF_INET6:
+ return (inet_ntop6(src, dst, size));
+#endif
+ default:
+ errno = EAFNOSUPPORT;
+ return (NULL);
+ }
+ /* NOTREACHED */
+}
+
+/* const char *
+ * inet_ntop4(src, dst, size)
+ * format an IPv4 address, more or less like inet_ntoa()
+ * return:
+ * `dst' (as a const)
+ * notes:
+ * (1) uses no statics
+ * (2) takes a u_char* not an in_addr as input
+ * author:
+ * Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop4(const u_char *src, char *dst, size_t size)
+{
+ static const char fmt[] = "%u.%u.%u.%u";
+ char tmp[sizeof "255.255.255.255"];
+
+ if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
+ errno = ENOSPC;
+ return (NULL);
+ }
+ strcpy(dst, tmp);
+ return (dst);
+}
+
+#ifdef NETSNMP_ENABLE_IPV6
+/* const char *
+ * inet_ntop6(src, dst, size)
+ * convert IPv6 binary address into presentation (printable) format
+ * author:
+ * Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop6(const u_char *src, char *dst, size_t size)
+{
+ /*
+ * Note that int32_t and int16_t need only be "at least" large enough
+ * to contain a value of the specified size. On some systems, like
+ * Crays, there is no such thing as an integer variable with 16 bits.
+ * Keep this in mind if you think this function should have been coded
+ * to use pointer overlays. All the world's not a VAX.
+ */
+ char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
+ struct { int base, len; } best, cur;
+ u_int words[IN6ADDRSZ / INT16SZ];
+ int i;
+
+ /*
+ * Preprocess:
+ * Copy the input (bytewise) array into a wordwise array.
+ * Find the longest run of 0x00's in src[] for :: shorthanding.
+ */
+ memset(words, '\0', sizeof words);
+ for (i = 0; i < IN6ADDRSZ; i++)
+ words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
+ best.base = -1;
+ cur.base = -1;
+ for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
+ if (words[i] == 0) {
+ if (cur.base == -1)
+ cur.base = i, cur.len = 1;
+ else
+ cur.len++;
+ } else {
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ cur.base = -1;
+ }
+ }
+ }
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ }
+ if (best.base != -1 && best.len < 2)
+ best.base = -1;
+
+ /*
+ * Format the result.
+ */
+ tp = tmp;
+ for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
+ /* Are we inside the best run of 0x00's? */
+ if (best.base != -1 && i >= best.base &&
+ i < (best.base + best.len)) {
+ if (i == best.base)
+ *tp++ = ':';
+ continue;
+ }
+ /* Are we following an initial run of 0x00s or any real hex? */
+ if (i != 0)
+ *tp++ = ':';
+ /* Is this address an encapsulated IPv4? */
+ if (i == 6 && best.base == 0 &&
+ (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
+ if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
+ return (NULL);
+ tp += strlen(tp);
+ break;
+ }
+ tp += SPRINTF((tp, "%x", words[i]));
+ }
+ /* Was it a trailing run of 0x00's? */
+ if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
+ *tp++ = ':';
+ *tp++ = '\0';
+
+ /*
+ * Check for overflow, copy, and we're done.
+ */
+ if ((size_t)(tp - tmp) > size) {
+ errno = ENOSPC;
+ return (NULL);
+ }
+ strcpy(dst, tmp);
+ return (dst);
+}
+#endif
diff --git a/snmplib/inet_ntop.h b/snmplib/inet_ntop.h
new file mode 100644
index 0000000..a73ba78
--- /dev/null
+++ b/snmplib/inet_ntop.h
@@ -0,0 +1,10 @@
+#ifndef _INET_NTOP_H
+#define _INET_NTOP_H
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifndef HAVE_INET_NTOP
+const char *inet_ntop(int af, const void *src, char *dst, size_t size);
+#endif /*HAVE_INET_NTOP */
+
+#endif /*_INET_NTOP_H*/
diff --git a/snmplib/inet_pton.c b/snmplib/inet_pton.c
new file mode 100644
index 0000000..0ac1d60
--- /dev/null
+++ b/snmplib/inet_pton.c
@@ -0,0 +1,311 @@
+/* Id: inet_pton.c,v 1.5 2001/04/13 15:24:35 lukem Exp */
+/* $NetBSD: inet_pton.c,v 1.16 2000/02/07 18:51:02 itojun Exp $ */
+
+/* Copyright (c) 1996 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 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 <ctype.h>
+
+#if HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/types.h>
+#include "inet_pton.h"
+
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#endif
+
+#ifndef IN6ADDRSZ
+#define IN6ADDRSZ 16
+#endif
+
+#ifndef INT16SZ
+#define INT16SZ 2
+#endif
+
+#ifndef INADDRSZ
+#define INADDRSZ 4
+#endif
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static int inet_pton4(const char *src, u_char *dst, int pton);
+#ifdef NETSNMP_ENABLE_IPV6
+static int inet_pton6(const char *src, u_char *dst);
+#endif
+
+/* int
+ * inet_pton(af, src, dst)
+ * convert from presentation format (which usually means ASCII printable)
+ * to network format (which is usually some kind of binary format).
+ * return:
+ * 1 if the address was valid for the specified address family
+ * 0 if the address wasn't valid (`dst' is untouched in this case)
+ * -1 if some other error occurred (`dst' is untouched in this case, too)
+ * author:
+ * Paul Vixie, 1996.
+ */
+int
+inet_pton(int af, const char *src, void *dst)
+{
+
+ switch (af) {
+ case AF_INET:
+ return (inet_pton4(src, dst, 1));
+#ifdef NETSNMP_ENABLE_IPV6
+ case AF_INET6:
+ return (inet_pton6(src, dst));
+#endif
+ default:
+ errno = EAFNOSUPPORT;
+ return (-1);
+ }
+ /* NOTREACHED */
+}
+
+/* int
+ * inet_pton4(src, dst, pton)
+ * when last arg is 0: inet_aton(). with hexadecimal, octal and shorthand.
+ * when last arg is 1: inet_pton(). decimal dotted-quad only.
+ * return:
+ * 1 if `src' is a valid input, else 0.
+ * notice:
+ * does not touch `dst' unless it's returning 1.
+ * author:
+ * Paul Vixie, 1996.
+ */
+static int
+inet_pton4(const char *src, u_char *dst, int pton)
+{
+ u_int val;
+ u_int digit;
+ int base, n;
+ unsigned char c;
+ u_int parts[4];
+ register u_int *pp = parts;
+
+ c = *src;
+ for (;;) {
+ /*
+ * Collect number up to ``.''.
+ * Values are specified as for C:
+ * 0x=hex, 0=octal, isdigit=decimal.
+ */
+ if (!isdigit(c))
+ return (0);
+ val = 0; base = 10;
+ if (c == '0') {
+ c = *++src;
+ if (c == 'x' || c == 'X')
+ base = 16, c = *++src;
+ else if (isdigit(c) && c != '9')
+ base = 8;
+ }
+ /* inet_pton() takes decimal only */
+ if (pton && base != 10)
+ return (0);
+ for (;;) {
+ if (isdigit(c)) {
+ digit = c - '0';
+ if ((int)digit >= base)
+ break;
+ val = (val * base) + digit;
+ c = *++src;
+ } else if (base == 16 && isxdigit(c)) {
+ digit = c + 10 - (islower(c) ? 'a' : 'A');
+ if (digit >= 16)
+ break;
+ val = (val << 4) | digit;
+ c = *++src;
+ } else
+ break;
+ }
+ if (c == '.') {
+ /*
+ * Internet format:
+ * a.b.c.d
+ * a.b.c (with c treated as 16 bits)
+ * a.b (with b treated as 24 bits)
+ * a (with a treated as 32 bits)
+ */
+ if (pp >= parts + 3)
+ return (0);
+ *pp++ = val;
+ c = *++src;
+ } else
+ break;
+ }
+ /*
+ * Check for trailing characters.
+ */
+ if (c != '\0' && !isspace(c))
+ return (0);
+ /*
+ * Concoct the address according to
+ * the number of parts specified.
+ */
+ n = pp - parts + 1;
+ /* inet_pton() takes dotted-quad only. it does not take shorthand. */
+ if (pton && n != 4)
+ return (0);
+ switch (n) {
+
+ case 0:
+ return (0); /* initial nondigit */
+
+ case 1: /* a -- 32 bits */
+ break;
+
+ case 2: /* a.b -- 8.24 bits */
+ if (parts[0] > 0xff || val > 0xffffff)
+ return (0);
+ val |= parts[0] << 24;
+ break;
+
+ case 3: /* a.b.c -- 8.8.16 bits */
+ if ((parts[0] | parts[1]) > 0xff || val > 0xffff)
+ return (0);
+ val |= (parts[0] << 24) | (parts[1] << 16);
+ break;
+
+ case 4: /* a.b.c.d -- 8.8.8.8 bits */
+ if ((parts[0] | parts[1] | parts[2] | val) > 0xff)
+ return (0);
+ val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
+ break;
+ }
+ if (dst) {
+ val = htonl(val);
+ memcpy(dst, &val, INADDRSZ);
+ }
+ return (1);
+}
+
+#ifdef NETSNMP_ENABLE_IPV6
+/* int
+ * inet_pton6(src, dst)
+ * convert presentation level address to network order binary form.
+ * return:
+ * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
+ * notice:
+ * (1) does not touch `dst' unless it's returning 1.
+ * (2) :: in a full address is silently ignored.
+ * credit:
+ * inspired by Mark Andrews.
+ * author:
+ * Paul Vixie, 1996.
+ */
+static int
+inet_pton6(const char *src, u_char *dst)
+{
+ static const char xdigits_l[] = "0123456789abcdef",
+ xdigits_u[] = "0123456789ABCDEF";
+ u_char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
+ const char *xdigits, *curtok;
+ int ch, saw_xdigit;
+ u_int val;
+
+ memset((tp = tmp), '\0', IN6ADDRSZ);
+ endp = tp + IN6ADDRSZ;
+ colonp = NULL;
+ /* Leading :: requires some special handling. */
+ if (*src == ':')
+ if (*++src != ':')
+ return (0);
+ curtok = src;
+ saw_xdigit = 0;
+ val = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
+ pch = strchr((xdigits = xdigits_u), ch);
+ if (pch != NULL) {
+ val <<= 4;
+ val |= (pch - xdigits);
+ if (val > 0xffff)
+ return (0);
+ saw_xdigit = 1;
+ continue;
+ }
+ if (ch == ':') {
+ curtok = src;
+ if (!saw_xdigit) {
+ if (colonp)
+ return (0);
+ colonp = tp;
+ continue;
+ } else if (*src == '\0')
+ return (0);
+ if (tp + INT16SZ > endp)
+ return (0);
+ *tp++ = (u_char) (val >> 8) & 0xff;
+ *tp++ = (u_char) val & 0xff;
+ saw_xdigit = 0;
+ val = 0;
+ continue;
+ }
+ if (ch == '.' && ((tp + INADDRSZ) <= endp) &&
+ inet_pton4(curtok, tp, 1) > 0) {
+ tp += INADDRSZ;
+ saw_xdigit = 0;
+ break; /* '\0' was seen by inet_pton4(). */
+ }
+ return (0);
+ }
+ if (saw_xdigit) {
+ if (tp + INT16SZ > endp)
+ return (0);
+ *tp++ = (u_char) (val >> 8) & 0xff;
+ *tp++ = (u_char) val & 0xff;
+ }
+ if (colonp != NULL) {
+ /*
+ * Since some memmove()'s erroneously fail to handle
+ * overlapping regions, we'll do the shift by hand.
+ */
+ const int n = tp - colonp;
+ int i;
+
+ if (tp == endp)
+ return (0);
+ for (i = 1; i <= n; i++) {
+ endp[- i] = colonp[n - i];
+ colonp[n - i] = 0;
+ }
+ tp = endp;
+ }
+ if (tp != endp)
+ return (0);
+ memcpy(dst, tmp, IN6ADDRSZ);
+ return (1);
+}
+#endif
diff --git a/snmplib/inet_pton.h b/snmplib/inet_pton.h
new file mode 100644
index 0000000..c33f695
--- /dev/null
+++ b/snmplib/inet_pton.h
@@ -0,0 +1,10 @@
+#ifndef _INET_PTON_H
+#define _INET_PTON_H
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifndef HAVE_INET_PTON
+int inet_pton(int af, const char *src, void *dst);
+#endif /*HAVE_INET_PTON */
+
+#endif /*_INET_PTON_H*/
diff --git a/snmplib/int64.c b/snmplib/int64.c
new file mode 100644
index 0000000..51f1f32
--- /dev/null
+++ b/snmplib/int64.c
@@ -0,0 +1,461 @@
+/**
+ * @file int64.c
+ *
+ * @brief Functions for 64-bit integer computations.
+ *
+ * 21-jan-1998: David Perkins <dperkins@dsperkins.com>
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/int64.h>
+#include <net-snmp/library/snmp_assert.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/snmp_logging.h>
+
+#include <net-snmp/net-snmp-features.h>
+
+/**
+ * Divide an unsigned 64-bit integer by 10.
+ *
+ * @param[in] u64 Number to be divided.
+ * @param[out] pu64Q Quotient.
+ * @param[out] puR Remainder.
+ */
+void
+divBy10(U64 u64, U64 * pu64Q, unsigned int *puR)
+{
+ unsigned long ulT;
+ unsigned long ulQ;
+ unsigned long ulR;
+
+ /*
+ * top 16 bits
+ */
+ ulT = (u64.high >> 16) & 0x0ffff;
+ ulQ = ulT / 10;
+ ulR = ulT % 10;
+ pu64Q->high = ulQ << 16;
+
+ /*
+ * next 16
+ */
+ ulT = (u64.high & 0x0ffff);
+ ulT += (ulR << 16);
+ ulQ = ulT / 10;
+ ulR = ulT % 10;
+ pu64Q->high = pu64Q->high | ulQ;
+
+ /*
+ * next 16
+ */
+ ulT = ((u64.low >> 16) & 0x0ffff) + (ulR << 16);
+ ulQ = ulT / 10;
+ ulR = ulT % 10;
+ pu64Q->low = ulQ << 16;
+
+ /*
+ * final 16
+ */
+ ulT = (u64.low & 0x0ffff);
+ ulT += (ulR << 16);
+ ulQ = ulT / 10;
+ ulR = ulT % 10;
+ pu64Q->low = pu64Q->low | ulQ;
+
+ *puR = (unsigned int) (ulR);
+}
+
+/**
+ * Multiply an unsigned 64-bit integer by 10.
+ *
+ * @param[in] u64 Number to be multiplied.
+ * @param[out] pu64P Product.
+ */
+void
+multBy10(U64 u64, U64 * pu64P)
+{
+ unsigned long ulT;
+ unsigned long ulP;
+ unsigned long ulK;
+
+ /*
+ * lower 16 bits
+ */
+ ulT = u64.low & 0x0ffff;
+ ulP = ulT * 10;
+ ulK = ulP >> 16;
+ pu64P->low = ulP & 0x0ffff;
+
+ /*
+ * next 16
+ */
+ ulT = (u64.low >> 16) & 0x0ffff;
+ ulP = (ulT * 10) + ulK;
+ ulK = ulP >> 16;
+ pu64P->low = (ulP & 0x0ffff) << 16 | pu64P->low;
+
+ /*
+ * next 16 bits
+ */
+ ulT = u64.high & 0x0ffff;
+ ulP = (ulT * 10) + ulK;
+ ulK = ulP >> 16;
+ pu64P->high = ulP & 0x0ffff;
+
+ /*
+ * final 16
+ */
+ ulT = (u64.high >> 16) & 0x0ffff;
+ ulP = (ulT * 10) + ulK;
+ ulK = ulP >> 16;
+ pu64P->high = (ulP & 0x0ffff) << 16 | pu64P->high;
+}
+
+/**
+ * Add an unsigned 16-bit int to an unsigned 64-bit integer.
+ *
+ * @param[in,out] pu64 Number to be incremented.
+ * @param[in] u16 Amount to add.
+ *
+ */
+void
+incrByU16(U64 * pu64, unsigned int u16)
+{
+ incrByU32(pu64, u16);
+}
+
+/**
+ * Add an unsigned 32-bit int to an unsigned 64-bit integer.
+ *
+ * @param[in,out] pu64 Number to be incremented.
+ * @param[in] u32 Amount to add.
+ *
+ */
+void
+incrByU32(U64 * pu64, unsigned int u32)
+{
+ uint32_t tmp;
+
+ tmp = pu64->low;
+ pu64->low = (uint32_t)(tmp + u32);
+ if (pu64->low < tmp)
+ pu64->high = (uint32_t)(pu64->high + 1);
+}
+
+/**
+ * Subtract two 64-bit numbers.
+ *
+ * @param[in] pu64one Number to start from.
+ * @param[in] pu64two Amount to subtract.
+ * @param[out] pu64out pu64one - pu64two.
+ */
+void
+u64Subtract(const U64 * pu64one, const U64 * pu64two, U64 * pu64out)
+{
+ int carry;
+
+ carry = pu64one->low < pu64two->low;
+ pu64out->low = (uint32_t)(pu64one->low - pu64two->low);
+ pu64out->high = (uint32_t)(pu64one->high - pu64two->high - carry);
+}
+
+/**
+ * Add two 64-bit numbers.
+ *
+ * @param[in] pu64one Amount to add.
+ * @param[in,out] pu64out pu64out += pu64one.
+ */
+void
+u64Incr(U64 * pu64out, const U64 * pu64one)
+{
+ pu64out->high = (uint32_t)(pu64out->high + pu64one->high);
+ incrByU32(pu64out, pu64one->low);
+}
+
+/**
+ * Add the difference of two 64-bit numbers to a 64-bit counter.
+ *
+ * @param[in] pu64one
+ * @param[in] pu64two
+ * @param[out] pu64out pu64out += (pu64one - pu64two)
+ */
+void
+u64UpdateCounter(U64 * pu64out, const U64 * pu64one, const U64 * pu64two)
+{
+ U64 tmp;
+
+ u64Subtract(pu64one, pu64two, &tmp);
+ u64Incr(pu64out, &tmp);
+}
+
+netsnmp_feature_child_of(u64copy, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_U64COPY
+/**
+ * Copy a 64-bit number.
+ *
+ * @param[in] pu64two Number to be copied.
+ * @param[out] pu64one Where to store the copy - *pu64one = *pu64two.
+ */
+void
+u64Copy(U64 * pu64one, const U64 * pu64two)
+{
+ *pu64one = *pu64two;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_U64COPY */
+
+/**
+ * Set an unsigned 64-bit number to zero.
+ *
+ * @param[in] pu64 Number to be zeroed.
+ */
+void
+zeroU64(U64 * pu64)
+{
+ pu64->low = 0;
+ pu64->high = 0;
+}
+
+/**
+ * Check if an unsigned 64-bit number is zero.
+ *
+ * @param[in] pu64 Number to be checked.
+ */
+int
+isZeroU64(const U64 * pu64)
+{
+ return pu64->low == 0 && pu64->high == 0;
+}
+
+/**
+ * check the old and new values of a counter64 for 32bit wrapping
+ *
+ * @param adjust : set to 1 to auto-increment new_val->high
+ * if a 32bit wrap is detected.
+ *
+ * @param old_val
+ * @param new_val
+ *
+ * @note
+ * The old and new values must be be from within a time period
+ * which would only allow the 32bit portion of the counter to
+ * wrap once. i.e. if the 32bit portion of the counter could
+ * wrap every 60 seconds, the old and new values should be compared
+ * at least every 59 seconds (though I'd recommend at least every
+ * 50 seconds to allow for timer inaccuracies).
+ *
+ * @retval 64 : 64bit wrap
+ * @retval 32 : 32bit wrap
+ * @retval 0 : did not wrap
+ * @retval -1 : bad parameter
+ * @retval -2 : unexpected high value (changed by more than 1)
+ */
+int
+netsnmp_c64_check_for_32bit_wrap(struct counter64 *old_val,
+ struct counter64 *new_val,
+ int adjust)
+{
+ if( (NULL == old_val) || (NULL == new_val) )
+ return -1;
+
+ DEBUGMSGTL(("9:c64:check_wrap", "check wrap 0x%0lx.0x%0lx 0x%0lx.0x%0lx\n",
+ old_val->high, old_val->low, new_val->high, new_val->low));
+
+ /*
+ * check for wraps
+ */
+ if ((new_val->low >= old_val->low) &&
+ (new_val->high == old_val->high)) {
+ DEBUGMSGTL(("9:c64:check_wrap", "no wrap\n"));
+ return 0;
+ }
+
+ /*
+ * low wrapped. did high change?
+ */
+ if (new_val->high == old_val->high) {
+ DEBUGMSGTL(("c64:check_wrap", "32 bit wrap\n"));
+ if (adjust)
+ new_val->high = (uint32_t)(new_val->high + 1);
+ return 32;
+ }
+ else if (new_val->high == (uint32_t)(old_val->high + 1)) {
+ DEBUGMSGTL(("c64:check_wrap", "64 bit wrap\n"));
+ return 64;
+ }
+
+ return -2;
+}
+
+/**
+ * update a 64 bit value with the difference between two (possibly) 32 bit vals
+ *
+ * @param prev_val : the 64 bit current counter
+ * @param old_prev_val : the (possibly 32 bit) previous value
+ * @param new_val : the (possible 32bit) new value
+ * @param need_wrap_check: pointer to integer indicating if wrap check is needed
+ * flag may be cleared if 64 bit counter is detected
+ *
+ * @note
+ * The old_prev_val and new_val values must be be from within a time
+ * period which would only allow the 32bit portion of the counter to
+ * wrap once. i.e. if the 32bit portion of the counter could
+ * wrap every 60 seconds, the old and new values should be compared
+ * at least every 59 seconds (though I'd recommend at least every
+ * 50 seconds to allow for timer inaccuracies).
+ *
+ * Suggested use:
+ *
+ * static needwrapcheck = 1;
+ * static counter64 current, prev_val, new_val;
+ *
+ * your_functions_to_update_new_value(&new_val);
+ * if (0 == needwrapcheck)
+ * memcpy(current, new_val, sizeof(new_val));
+ * else {
+ * netsnmp_c64_check32_and_update(&current,&new,&prev,&needwrapcheck);
+ * memcpy(prev_val, new_val, sizeof(new_val));
+ * }
+ *
+ *
+ * @retval 0 : success
+ * @retval -1 : error checking for 32 bit wrap
+ * @retval -2 : look like we have 64 bit values, but sums aren't consistent
+ */
+int
+netsnmp_c64_check32_and_update(struct counter64 *prev_val, struct counter64 *new_val,
+ struct counter64 *old_prev_val, int *need_wrap_check)
+{
+ int rc;
+
+ /*
+ * counters are 32bit or unknown (which we'll treat as 32bit).
+ * update the prev values with the difference between the
+ * new stats and the prev old_stats:
+ * prev->stats += (new->stats - prev->old_stats)
+ */
+ if ((NULL == need_wrap_check) || (0 != *need_wrap_check)) {
+ rc = netsnmp_c64_check_for_32bit_wrap(old_prev_val,new_val, 1);
+ if (rc < 0) {
+ DEBUGMSGTL(("c64","32 bit check failed\n"));
+ return -1;
+ }
+ }
+ else
+ rc = 0;
+
+ /*
+ * update previous values
+ */
+ (void) u64UpdateCounter(prev_val, new_val, old_prev_val);
+
+ /*
+ * if wrap check was 32 bit, undo adjust, now that prev is updated
+ */
+ if (32 == rc) {
+ /*
+ * check wrap incremented high, so reset it. (Because having
+ * high set for a 32 bit counter will confuse us in the next update).
+ */
+ netsnmp_assert(1 == new_val->high);
+ new_val->high = 0;
+ }
+ else if (64 == rc) {
+ /*
+ * if we really have 64 bit counters, the summing we've been
+ * doing for prev values should be equal to the new values.
+ */
+ if ((prev_val->low != new_val->low) ||
+ (prev_val->high != new_val->high)) {
+ DEBUGMSGTL(("c64", "looks like a 64bit wrap, but prev!=new\n"));
+ return -2;
+ }
+ else if (NULL != need_wrap_check)
+ *need_wrap_check = 0;
+ }
+
+ return 0;
+}
+
+/** Convert an unsigned 64-bit number to ASCII. */
+void
+printU64(char *buf, /* char [I64CHARSZ+1]; */
+ const U64 * pu64)
+{
+ U64 u64a;
+ U64 u64b;
+
+ char aRes[I64CHARSZ + 1];
+ unsigned int u;
+ int j;
+
+ u64a = *pu64;
+ aRes[I64CHARSZ] = 0;
+ for (j = 0; j < I64CHARSZ; j++) {
+ divBy10(u64a, &u64b, &u);
+ aRes[(I64CHARSZ - 1) - j] = (char) ('0' + u);
+ u64a = u64b;
+ if (isZeroU64(&u64a))
+ break;
+ }
+ strcpy(buf, &aRes[(I64CHARSZ - 1) - j]);
+}
+
+/** Convert a signed 64-bit number to ASCII. */
+void
+printI64(char *buf, /* char [I64CHARSZ+1]; */
+ const U64 * pu64)
+{
+ U64 u64a;
+
+ if (pu64->high & 0x80000000) {
+ u64a.high = (uint32_t) ~pu64->high;
+ u64a.low = (uint32_t) ~pu64->low;
+ incrByU32(&u64a, 1); /* bit invert and incr by 1 to print 2s complement */
+ buf[0] = '-';
+ printU64(buf + 1, &u64a);
+ } else {
+ printU64(buf, pu64);
+ }
+}
+
+/** Convert a signed 64-bit integer from ASCII to U64. */
+int
+read64(U64 * i64, const char *str)
+{
+ U64 i64p;
+ unsigned int u;
+ int sign = 0;
+ int ok = 0;
+
+ zeroU64(i64);
+ if (*str == '-') {
+ sign = 1;
+ str++;
+ }
+
+ while (*str && isdigit((unsigned char)(*str))) {
+ ok = 1;
+ u = *str - '0';
+ multBy10(*i64, &i64p);
+ *i64 = i64p;
+ incrByU16(i64, u);
+ str++;
+ }
+ if (sign) {
+ i64->high = (uint32_t) ~i64->high;
+ i64->low = (uint32_t) ~i64->low;
+ incrByU16(i64, 1);
+ }
+ return ok;
+}
diff --git a/snmplib/keytools.c b/snmplib/keytools.c
new file mode 100644
index 0000000..0faa0de
--- /dev/null
+++ b/snmplib/keytools.c
@@ -0,0 +1,666 @@
+/* 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.
+ */
+
+/*
+ * keytools.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef 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_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/snmp_api.h>
+#ifdef NETSNMP_USE_OPENSSL
+# include <openssl/hmac.h>
+#else
+#ifdef NETSNMP_USE_INTERNAL_MD5
+#include <net-snmp/library/md5.h>
+#endif
+#endif
+#ifdef NETSNMP_USE_INTERNAL_CRYPTO
+#include <net-snmp/library/openssl_md5.h>
+#include <net-snmp/library/openssl_sha.h>
+#endif
+
+#ifdef NETSNMP_USE_PKCS11
+#include <security/cryptoki.h>
+#endif
+
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/keytools.h>
+
+#include <net-snmp/library/transform_oids.h>
+
+netsnmp_feature_child_of(usm_support, libnetsnmp)
+netsnmp_feature_child_of(usm_keytools, usm_support)
+
+#ifndef NETSNMP_FEATURE_REMOVE_USM_KEYTOOLS
+
+/*******************************************************************-o-******
+ * generate_Ku
+ *
+ * Parameters:
+ * *hashtype MIB OID for the transform type for hashing.
+ * hashtype_len Length of OID value.
+ * *P Pre-allocated bytes of passpharase.
+ * pplen Length of passphrase.
+ * *Ku Buffer to contain Ku.
+ * *kulen Length of Ku buffer.
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMPERR_GENERR All errors.
+ *
+ *
+ * Convert a passphrase into a master user key, Ku, according to the
+ * algorithm given in RFC 2274 concerning the SNMPv3 User Security Model (USM)
+ * as follows:
+ *
+ * Expand the passphrase to fill the passphrase buffer space, if necessary,
+ * concatenation as many duplicates as possible of P to itself. If P is
+ * larger than the buffer space, truncate it to fit.
+ *
+ * Then hash the result with the given hashtype transform. Return
+ * the result as Ku.
+ *
+ * If successful, kulen contains the size of the hash written to Ku.
+ *
+ * NOTE Passphrases less than USM_LENGTH_P_MIN characters in length
+ * cause an error to be returned.
+ * (Punt this check to the cmdline apps? XXX)
+ */
+int
+generate_Ku(const oid * hashtype, u_int hashtype_len,
+ const u_char * P, size_t pplen, u_char * Ku, size_t * kulen)
+#if defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+ int rval = SNMPERR_SUCCESS,
+ nbytes = USM_LENGTH_EXPANDED_PASSPHRASE;
+#if !defined(NETSNMP_USE_OPENSSL) && \
+ defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+ int ret;
+#endif
+
+ u_int i, pindex = 0;
+
+ u_char buf[USM_LENGTH_KU_HASHBLOCK], *bufp;
+
+#ifdef NETSNMP_USE_OPENSSL
+ EVP_MD_CTX *ctx = NULL;
+#elif NETSNMP_USE_INTERNAL_CRYPTO
+ SHA_CTX csha1;
+ MD5_CTX cmd5;
+ char cryptotype = 0;
+#define TYPE_MD5 1
+#define TYPE_SHA1 2
+#else
+ MDstruct MD;
+#endif
+ /*
+ * Sanity check.
+ */
+ if (!hashtype || !P || !Ku || !kulen || (*kulen <= 0)
+ || (hashtype_len != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit);
+ }
+
+ if (pplen < USM_LENGTH_P_MIN) {
+ snmp_log(LOG_ERR, "Error: passphrase chosen is below the length "
+ "requirements of the USM (min=%d).\n",USM_LENGTH_P_MIN);
+ snmp_set_detail("The supplied password length is too short.");
+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit);
+ }
+
+
+ /*
+ * Setup for the transform type.
+ */
+#ifdef NETSNMP_USE_OPENSSL
+
+#ifdef HAVE_EVP_MD_CTX_CREATE
+ ctx = EVP_MD_CTX_create();
+#else
+ ctx = malloc(sizeof(*ctx));
+ EVP_MD_CTX_init(ctx);
+#endif
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(hashtype, HMACMD5Auth))
+ EVP_DigestInit(ctx, EVP_md5());
+ else
+#endif
+ if (ISTRANSFORM(hashtype, HMACSHA1Auth))
+ EVP_DigestInit(ctx, EVP_sha1());
+ else
+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit);
+#elif NETSNMP_USE_INTERNAL_CRYPTO
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(hashtype, HMACMD5Auth)) {
+ MD5_Init(&cmd5);
+ cryptotype = TYPE_MD5;
+ } else
+#endif
+ if (ISTRANSFORM(hashtype, HMACSHA1Auth)) {
+ SHA1_Init(&csha1);
+ cryptotype = TYPE_SHA1;
+ } else {
+ return (SNMPERR_GENERR);
+ }
+#else
+ MDbegin(&MD);
+#endif /* NETSNMP_USE_OPENSSL */
+
+ while (nbytes > 0) {
+ bufp = buf;
+ for (i = 0; i < USM_LENGTH_KU_HASHBLOCK; i++) {
+ *bufp++ = P[pindex++ % pplen];
+ }
+#ifdef NETSNMP_USE_OPENSSL
+ EVP_DigestUpdate(ctx, buf, USM_LENGTH_KU_HASHBLOCK);
+#elif NETSNMP_USE_INTERNAL_CRYPTO
+ if (TYPE_SHA1 == cryptotype) {
+ rval = !SHA1_Update(&csha1, buf, USM_LENGTH_KU_HASHBLOCK);
+ } else {
+ rval = !MD5_Update(&cmd5, buf, USM_LENGTH_KU_HASHBLOCK);
+ }
+ if (rval != 0) {
+ return SNMPERR_USM_ENCRYPTIONERROR;
+ }
+#elif NETSNMP_USE_INTERNAL_MD5
+ if (MDupdate(&MD, buf, USM_LENGTH_KU_HASHBLOCK * 8)) {
+ rval = SNMPERR_USM_ENCRYPTIONERROR;
+ goto md5_fin;
+ }
+#endif /* NETSNMP_USE_OPENSSL */
+ nbytes -= USM_LENGTH_KU_HASHBLOCK;
+ }
+
+#ifdef NETSNMP_USE_OPENSSL
+ {
+ unsigned int tmp_len;
+
+ tmp_len = *kulen;
+ EVP_DigestFinal(ctx, (unsigned char *) Ku, &tmp_len);
+ *kulen = tmp_len;
+ /*
+ * what about free()
+ */
+ }
+#elif NETSNMP_USE_INTERNAL_CRYPTO
+ if (TYPE_SHA1 == cryptotype) {
+ SHA1_Final(Ku, &csha1);
+ } else {
+ MD5_Final(Ku, &cmd5);
+ }
+ ret = sc_get_properlength(hashtype, hashtype_len);
+ if (ret == SNMPERR_GENERR)
+ return SNMPERR_GENERR;
+ *kulen = ret;
+#elif NETSNMP_USE_INTERNAL_MD5
+ if (MDupdate(&MD, buf, 0)) {
+ rval = SNMPERR_USM_ENCRYPTIONERROR;
+ goto md5_fin;
+ }
+ ret = sc_get_properlength(hashtype, hashtype_len);
+ if (ret == SNMPERR_GENERR)
+ return SNMPERR_GENERR;
+ *kulen = ret;
+ MDget(&MD, Ku, *kulen);
+ md5_fin:
+ memset(&MD, 0, sizeof(MD));
+#endif /* NETSNMP_USE_INTERNAL_MD5 */
+
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ DEBUGMSGTL(("generate_Ku", "generating Ku (from %s): ", P));
+ for (i = 0; i < *kulen; i++)
+ DEBUGMSG(("generate_Ku", "%02x", Ku[i]));
+ DEBUGMSG(("generate_Ku", "\n"));
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+
+ generate_Ku_quit:
+ memset(buf, 0, sizeof(buf));
+#ifdef NETSNMP_USE_OPENSSL
+ if (ctx) {
+#ifdef HAVE_EVP_MD_CTX_DESTROY
+ EVP_MD_CTX_destroy(ctx);
+#else
+ EVP_MD_CTX_cleanup(ctx);
+ free(ctx);
+#endif
+ }
+#endif
+ return rval;
+
+} /* end generate_Ku() */
+#elif NETSNMP_USE_PKCS11
+{
+ int rval = SNMPERR_SUCCESS;
+
+ /*
+ * Sanity check.
+ */
+ if (!hashtype || !P || !Ku || !kulen || (*kulen <= 0)
+ || (hashtype_len != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit);
+ }
+
+ if (pplen < USM_LENGTH_P_MIN) {
+ snmp_log(LOG_ERR, "Error: passphrase chosen is below the length "
+ "requirements of the USM (min=%d).\n",USM_LENGTH_P_MIN);
+ snmp_set_detail("The supplied password length is too short.");
+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit);
+ }
+
+ /*
+ * Setup for the transform type.
+ */
+
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(hashtype, HMACMD5Auth))
+ return pkcs_generate_Ku(CKM_MD5, P, pplen, Ku, kulen);
+ else
+#endif
+ if (ISTRANSFORM(hashtype, HMACSHA1Auth))
+ return pkcs_generate_Ku(CKM_SHA_1, P, pplen, Ku, kulen);
+ else {
+ return (SNMPERR_GENERR);
+ }
+
+ generate_Ku_quit:
+
+ return rval;
+} /* end generate_Ku() */
+#else
+_KEYTOOLS_NOT_AVAILABLE
+#endif /* internal or openssl */
+/*******************************************************************-o-******
+ * generate_kul
+ *
+ * Parameters:
+ * *hashtype
+ * hashtype_len
+ * *engineID
+ * engineID_len
+ * *Ku Master key for a given user.
+ * ku_len Length of Ku in bytes.
+ * *Kul Localized key for a given user at engineID.
+ * *kul_len Length of Kul buffer (IN); Length of Kul key (OUT).
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMPERR_GENERR All errors.
+ *
+ *
+ * Ku MUST be the proper length (currently fixed) for the given hashtype.
+ *
+ * Upon successful return, Kul contains the localized form of Ku at
+ * engineID, and the length of the key is stored in kul_len.
+ *
+ * The localized key method is defined in RFC2274, Sections 2.6 and A.2, and
+ * originally documented in:
+ * U. Blumenthal, N. C. Hien, B. Wijnen,
+ * "Key Derivation for Network Management Applications",
+ * IEEE Network Magazine, April/May issue, 1997.
+ *
+ *
+ * ASSUMES SNMP_MAXBUF >= sizeof(Ku + engineID + Ku).
+ *
+ * NOTE Localized keys for privacy transforms are generated via
+ * the authentication transform held by the same usmUser.
+ *
+ * XXX An engineID of any length is accepted, even if larger than
+ * what is spec'ed for the textual convention.
+ */
+int
+generate_kul(const oid * hashtype, u_int hashtype_len,
+ const u_char * engineID, size_t engineID_len,
+ const u_char * Ku, size_t ku_len,
+ u_char * Kul, size_t * kul_len)
+#if defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_PKCS11) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+ int rval = SNMPERR_SUCCESS;
+ u_int nbytes = 0;
+ size_t properlength;
+ int iproperlength;
+
+ u_char buf[SNMP_MAXBUF];
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ int i;
+#endif
+
+
+ /*
+ * Sanity check.
+ */
+ if (!hashtype || !engineID || !Ku || !Kul || !kul_len
+ || (engineID_len <= 0) || (ku_len <= 0) || (*kul_len <= 0)
+ || (hashtype_len != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, generate_kul_quit);
+ }
+
+
+ iproperlength = sc_get_properlength(hashtype, hashtype_len);
+ if (iproperlength == SNMPERR_GENERR)
+ QUITFUN(SNMPERR_GENERR, generate_kul_quit);
+
+ properlength = (size_t) iproperlength;
+
+ if ((*kul_len < properlength) || (ku_len < properlength)) {
+ QUITFUN(SNMPERR_GENERR, generate_kul_quit);
+ }
+
+ /*
+ * Concatenate Ku and engineID properly, then hash the result.
+ * Store it in Kul.
+ */
+ nbytes = 0;
+ memcpy(buf, Ku, properlength);
+ nbytes += properlength;
+ memcpy(buf + nbytes, engineID, engineID_len);
+ nbytes += engineID_len;
+ memcpy(buf + nbytes, Ku, properlength);
+ nbytes += properlength;
+
+ rval = sc_hash(hashtype, hashtype_len, buf, nbytes, Kul, kul_len);
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ DEBUGMSGTL(("generate_kul", "generating Kul (from Ku): "));
+ for (i = 0; i < *kul_len; i++)
+ DEBUGMSG(("generate_kul", "%02x", Kul[i]));
+ DEBUGMSG(("generate_kul", "keytools\n"));
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+ QUITFUN(rval, generate_kul_quit);
+
+
+ generate_kul_quit:
+ return rval;
+
+} /* end generate_kul() */
+
+#else
+_KEYTOOLS_NOT_AVAILABLE
+#endif /* internal or openssl */
+/*******************************************************************-o-******
+ * encode_keychange
+ *
+ * Parameters:
+ * *hashtype MIB OID for the hash transform type.
+ * hashtype_len Length of the MIB OID hash transform type.
+ * *oldkey Old key that is used to encodes the new key.
+ * oldkey_len Length of oldkey in bytes.
+ * *newkey New key that is encoded using the old key.
+ * newkey_len Length of new key in bytes.
+ * *kcstring Buffer to contain the KeyChange TC string.
+ * *kcstring_len Length of kcstring buffer.
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMPERR_GENERR All errors.
+ *
+ *
+ * Uses oldkey and acquired random bytes to encode newkey into kcstring
+ * according to the rules of the KeyChange TC described in RFC 2274, Section 5.
+ *
+ * Upon successful return, *kcstring_len contains the length of the
+ * encoded string.
+ *
+ * ASSUMES Old and new key are always equal to each other, although
+ * this may be less than the transform type hash output
+ * output length (eg, using KeyChange for a DESPriv key when
+ * the user also uses SHA1Auth). This also implies that the
+ * hash placed in the second 1/2 of the key change string
+ * will be truncated before the XOR'ing when the hash output is
+ * larger than that 1/2 of the key change string.
+ *
+ * *kcstring_len will be returned as exactly twice that same
+ * length though the input buffer may be larger.
+ *
+ * XXX FIX: Does not handle varibable length keys.
+ * XXX FIX: Does not handle keys larger than the hash algorithm used.
+ */
+int
+encode_keychange(const oid * hashtype, u_int hashtype_len,
+ u_char * oldkey, size_t oldkey_len,
+ u_char * newkey, size_t newkey_len,
+ u_char * kcstring, size_t * kcstring_len)
+#if defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_PKCS11) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+ int rval = SNMPERR_SUCCESS;
+ int iproperlength;
+ size_t properlength;
+ size_t nbytes = 0;
+
+ u_char *tmpbuf = NULL;
+
+
+ /*
+ * Sanity check.
+ */
+ if (!kcstring || !kcstring_len)
+ return SNMPERR_GENERR;
+
+ if (!hashtype || !oldkey || !newkey || !kcstring || !kcstring_len
+ || (oldkey_len <= 0) || (newkey_len <= 0) || (*kcstring_len <= 0)
+ || (hashtype_len != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, encode_keychange_quit);
+ }
+
+ /*
+ * Setup for the transform type.
+ */
+ iproperlength = sc_get_properlength(hashtype, hashtype_len);
+ if (iproperlength == SNMPERR_GENERR)
+ QUITFUN(SNMPERR_GENERR, encode_keychange_quit);
+
+ if ((oldkey_len != newkey_len) || (*kcstring_len < (2 * oldkey_len))) {
+ QUITFUN(SNMPERR_GENERR, encode_keychange_quit);
+ }
+
+ properlength = SNMP_MIN(oldkey_len, (size_t)iproperlength);
+
+ /*
+ * Use the old key and some random bytes to encode the new key
+ * in the KeyChange TC format:
+ * . Get random bytes (store in first half of kcstring),
+ * . Hash (oldkey | random_bytes) (into second half of kcstring),
+ * . XOR hash and newkey (into second half of kcstring).
+ *
+ * Getting the wrong number of random bytes is considered an error.
+ */
+ nbytes = properlength;
+
+#if defined(NETSNMP_ENABLE_TESTING_CODE) && defined(RANDOMZEROS)
+ memset(kcstring, 0, nbytes);
+ DEBUGMSG(("encode_keychange",
+ "** Using all zero bits for \"random\" delta of )"
+ "the keychange string! **\n"));
+#else /* !NETSNMP_ENABLE_TESTING_CODE */
+ rval = sc_random(kcstring, &nbytes);
+ QUITFUN(rval, encode_keychange_quit);
+ if (nbytes != properlength) {
+ QUITFUN(SNMPERR_GENERR, encode_keychange_quit);
+ }
+#endif /* !NETSNMP_ENABLE_TESTING_CODE */
+
+ tmpbuf = (u_char *) malloc(properlength * 2);
+ if (tmpbuf) {
+ memcpy(tmpbuf, oldkey, properlength);
+ memcpy(tmpbuf + properlength, kcstring, properlength);
+
+ *kcstring_len -= properlength;
+ rval = sc_hash(hashtype, hashtype_len, tmpbuf, properlength * 2,
+ kcstring + properlength, kcstring_len);
+
+ QUITFUN(rval, encode_keychange_quit);
+
+ *kcstring_len = (properlength * 2);
+
+ kcstring += properlength;
+ nbytes = 0;
+ while ((nbytes++) < properlength) {
+ *kcstring++ ^= *newkey++;
+ }
+ }
+
+ encode_keychange_quit:
+ if (rval != SNMPERR_SUCCESS)
+ memset(kcstring, 0, *kcstring_len);
+ SNMP_FREE(tmpbuf);
+
+ return rval;
+
+} /* end encode_keychange() */
+
+#else
+_KEYTOOLS_NOT_AVAILABLE
+#endif /* internal or openssl */
+/*******************************************************************-o-******
+ * decode_keychange
+ *
+ * Parameters:
+ * *hashtype MIB OID of the hash transform to use.
+ * hashtype_len Length of the hash transform MIB OID.
+ * *oldkey Old key that is used to encode the new key.
+ * oldkey_len Length of oldkey in bytes.
+ * *kcstring Encoded KeyString buffer containing the new key.
+ * kcstring_len Length of kcstring in bytes.
+ * *newkey Buffer to hold the extracted new key.
+ * *newkey_len Length of newkey in bytes.
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMPERR_GENERR All errors.
+ *
+ *
+ * Decodes a string of bits encoded according to the KeyChange TC described
+ * in RFC 2274, Section 5. The new key is extracted from *kcstring with
+ * the aid of the old key.
+ *
+ * Upon successful return, *newkey_len contains the length of the new key.
+ *
+ *
+ * ASSUMES Old key is exactly 1/2 the length of the KeyChange buffer,
+ * although this length may be less than the hash transform
+ * output. Thus the new key length will be equal to the old
+ * key length.
+ */
+/*
+ * XXX: if the newkey is not long enough, it should be freed and remalloced
+ */
+int
+decode_keychange(const oid * hashtype, u_int hashtype_len,
+ u_char * oldkey, size_t oldkey_len,
+ u_char * kcstring, size_t kcstring_len,
+ u_char * newkey, size_t * newkey_len)
+#if defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_PKCS11) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+ int rval = SNMPERR_SUCCESS;
+ size_t properlength = 0;
+ int iproperlength = 0;
+ u_int nbytes = 0;
+
+ u_char *bufp, tmp_buf[SNMP_MAXBUF];
+ size_t tmp_buf_len = SNMP_MAXBUF;
+ u_char *tmpbuf = NULL;
+
+
+
+ /*
+ * Sanity check.
+ */
+ if (!hashtype || !oldkey || !kcstring || !newkey || !newkey_len
+ || (oldkey_len <= 0) || (kcstring_len <= 0) || (*newkey_len <= 0)
+ || (hashtype_len != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, decode_keychange_quit);
+ }
+
+
+ /*
+ * Setup for the transform type.
+ */
+ iproperlength = sc_get_properlength(hashtype, hashtype_len);
+ if (iproperlength == SNMPERR_GENERR)
+ QUITFUN(SNMPERR_GENERR, decode_keychange_quit);
+
+ properlength = (size_t) iproperlength;
+
+ if (((oldkey_len * 2) != kcstring_len) || (*newkey_len < oldkey_len)) {
+ QUITFUN(SNMPERR_GENERR, decode_keychange_quit);
+ }
+
+ properlength = oldkey_len;
+ *newkey_len = properlength;
+
+ /*
+ * Use the old key and the given KeyChange TC string to recover
+ * the new key:
+ * . Hash (oldkey | random_bytes) (into newkey),
+ * . XOR hash and encoded (second) half of kcstring (into newkey).
+ */
+ tmpbuf = (u_char *) malloc(properlength * 2);
+ if (tmpbuf) {
+ memcpy(tmpbuf, oldkey, properlength);
+ memcpy(tmpbuf + properlength, kcstring, properlength);
+
+ rval = sc_hash(hashtype, hashtype_len, tmpbuf, properlength * 2,
+ tmp_buf, &tmp_buf_len);
+ QUITFUN(rval, decode_keychange_quit);
+
+ memcpy(newkey, tmp_buf, properlength);
+ bufp = kcstring + properlength;
+ nbytes = 0;
+ while ((nbytes++) < properlength) {
+ *newkey++ ^= *bufp++;
+ }
+ }
+
+ decode_keychange_quit:
+ if (rval != SNMPERR_SUCCESS) {
+ if (newkey)
+ memset(newkey, 0, properlength);
+ }
+ memset(tmp_buf, 0, SNMP_MAXBUF);
+ SNMP_FREE(tmpbuf);
+
+ return rval;
+
+} /* end decode_keychange() */
+
+#else
+_KEYTOOLS_NOT_AVAILABLE
+#endif /* internal or openssl */
+#endif /* NETSNMP_FEATURE_REMOVE_USM_KEYTOOLS */
diff --git a/snmplib/large_fd_set.c b/snmplib/large_fd_set.c
new file mode 100644
index 0000000..32f57b3
--- /dev/null
+++ b/snmplib/large_fd_set.c
@@ -0,0 +1,244 @@
+/**
+ * @file large_fd_set.c
+ *
+ * @brief Macro's and functions for manipulation of large file descriptor sets.
+ */
+
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#include <string.h> /* memset(), which is invoked by FD_ZERO() */
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/library/snmp_assert.h>
+#include <net-snmp/library/large_fd_set.h>
+
+
+#if !defined(cygwin) && defined(HAVE_WINSOCK_H)
+
+void
+netsnmp_large_fd_setfd(SOCKET fd, netsnmp_large_fd_set * fdset)
+{
+ unsigned i;
+
+ netsnmp_assert(fd != INVALID_SOCKET);
+
+ if (fdset->lfs_set.fd_count == fdset->lfs_setsize)
+ netsnmp_large_fd_set_resize(fdset, 2 * (fdset->lfs_setsize + 1));
+
+ for (i = 0; i < fdset->lfs_set.fd_count; i++) {
+ if (fdset->lfs_set.fd_array[i] == (SOCKET) (fd))
+ break;
+ }
+
+ if (i == fdset->lfs_set.fd_count
+ && fdset->lfs_set.fd_count < fdset->lfs_setsize) {
+ fdset->lfs_set.fd_count++;
+ fdset->lfs_set.fd_array[i] = fd;
+ }
+}
+
+void
+netsnmp_large_fd_clr(SOCKET fd, netsnmp_large_fd_set * fdset)
+{
+ unsigned i;
+
+ netsnmp_assert(fd != INVALID_SOCKET);
+
+ for (i = 0; i < fdset->lfs_set.fd_count; i++) {
+ if (fdset->lfs_set.fd_array[i] == fd) {
+ while (i < fdset->lfs_set.fd_count - 1) {
+ fdset->lfs_set.fd_array[i] =
+ fdset->lfs_set.fd_array[i + 1];
+ i++;
+ }
+ fdset->lfs_set.fd_count--;
+ break;
+ }
+ }
+}
+
+int
+netsnmp_large_fd_is_set(SOCKET fd, netsnmp_large_fd_set * fdset)
+{
+ unsigned int i;
+
+ netsnmp_assert(fd != INVALID_SOCKET);
+
+ for (i = 0; i < fdset->lfs_set.fd_count; i++) {
+ if (fdset->lfs_set.fd_array[i] == fd)
+ return 1;
+ }
+ return 0;
+}
+
+#else
+
+void
+netsnmp_large_fd_setfd(int fd, netsnmp_large_fd_set * fdset)
+{
+ netsnmp_assert(fd >= 0);
+
+ while (fd >= (int)fdset->lfs_setsize)
+ netsnmp_large_fd_set_resize(fdset, 2 * (fdset->lfs_setsize + 1));
+
+ FD_SET(fd, fdset->lfs_setptr);
+}
+
+void
+netsnmp_large_fd_clr(int fd, netsnmp_large_fd_set * fdset)
+{
+ netsnmp_assert(fd >= 0);
+
+ if ((unsigned)fd < fdset->lfs_setsize)
+ FD_CLR(fd, fdset->lfs_setptr);
+}
+
+int
+netsnmp_large_fd_is_set(int fd, netsnmp_large_fd_set * fdset)
+{
+ netsnmp_assert(fd >= 0);
+
+ return (unsigned)fd < fdset->lfs_setsize && FD_ISSET(fd, fdset->lfs_setptr);
+}
+
+#endif
+
+void
+netsnmp_large_fd_set_init(netsnmp_large_fd_set * fdset, int setsize)
+{
+ fdset->lfs_setsize = 0;
+ fdset->lfs_setptr = NULL;
+#if !defined(cygwin) && defined(HAVE_WINSOCK_H)
+ fdset->lfs_set.fd_count = 0;
+#endif
+ netsnmp_large_fd_set_resize(fdset, setsize);
+}
+
+int
+netsnmp_large_fd_set_select(int numfds, netsnmp_large_fd_set *readfds,
+ netsnmp_large_fd_set *writefds,
+ netsnmp_large_fd_set *exceptfds,
+ struct timeval *timeout)
+{
+#if defined(cygwin) || !defined(HAVE_WINSOCK_H)
+ /* Bit-set representation: make sure all fds have at least size 'numfds'. */
+ if (readfds && readfds->lfs_setsize < numfds)
+ netsnmp_large_fd_set_resize(readfds, numfds);
+ if (writefds && writefds->lfs_setsize < numfds)
+ netsnmp_large_fd_set_resize(writefds, numfds);
+ if (exceptfds && exceptfds->lfs_setsize < numfds)
+ netsnmp_large_fd_set_resize(exceptfds, numfds);
+#else
+ /* Array representation: no resizing is necessary. */
+#endif
+
+ return select(numfds,
+ readfds ? readfds->lfs_setptr : NULL,
+ writefds ? writefds->lfs_setptr : NULL,
+ exceptfds ? exceptfds->lfs_setptr : NULL,
+ timeout);
+}
+
+int
+netsnmp_large_fd_set_resize(netsnmp_large_fd_set * fdset, int setsize)
+{
+ int fd_set_bytes;
+
+ if (fdset->lfs_setsize == setsize)
+ goto success;
+
+ if (setsize > FD_SETSIZE) {
+ fd_set_bytes = NETSNMP_FD_SET_BYTES(setsize);
+ if (fdset->lfs_setsize > FD_SETSIZE) {
+ fdset->lfs_setptr = realloc(fdset->lfs_setptr, fd_set_bytes);
+ if (!fdset->lfs_setptr)
+ goto out_of_mem;
+ } else {
+ fdset->lfs_setptr = malloc(fd_set_bytes);
+ if (!fdset->lfs_setptr)
+ goto out_of_mem;
+ *fdset->lfs_setptr = fdset->lfs_set;
+ }
+ } else {
+ if (fdset->lfs_setsize > FD_SETSIZE) {
+ fdset->lfs_set = *fdset->lfs_setptr;
+ free(fdset->lfs_setptr);
+ }
+ fdset->lfs_setptr = &fdset->lfs_set;
+ }
+
+#if defined(cygwin) || !defined(HAVE_WINSOCK_H)
+ {
+ int i;
+
+ /*
+ * Unix: when enlarging, clear the file descriptors defined in the
+ * resized *fdset but that were not defined in the original *fdset.
+ */
+ for (i = fdset->lfs_setsize; i < setsize; i++)
+ FD_CLR(i, fdset->lfs_setptr);
+ }
+#endif
+
+ fdset->lfs_setsize = setsize;
+#if !defined(cygwin) && defined(HAVE_WINSOCK_H)
+ if (setsize < fdset->lfs_set.fd_count)
+ fdset->lfs_set.fd_count = setsize;
+#endif
+success:
+ return 1;
+
+out_of_mem:
+ fdset->lfs_setsize = 0;
+#if !defined(cygwin) && defined(HAVE_WINSOCK_H)
+ fdset->lfs_set.fd_count = 0;
+#endif
+ return 0;
+}
+
+void
+netsnmp_large_fd_set_cleanup(netsnmp_large_fd_set * fdset)
+{
+ netsnmp_large_fd_set_resize(fdset, 0);
+ fdset->lfs_setsize = 0;
+ fdset->lfs_setptr = NULL;
+}
+
+void
+netsnmp_copy_fd_set_to_large_fd_set(netsnmp_large_fd_set * dst,
+ const fd_set * src)
+{
+ netsnmp_large_fd_set_resize(dst, FD_SETSIZE);
+ *dst->lfs_setptr = *src;
+}
+
+int
+netsnmp_copy_large_fd_set_to_fd_set(fd_set * dst,
+ const netsnmp_large_fd_set * src)
+{
+ /* Report failure if *src is larger than FD_SETSIZE. */
+ if (src->lfs_setsize > FD_SETSIZE) {
+ FD_ZERO(dst);
+ return -1;
+ }
+
+ *dst = *src->lfs_setptr;
+
+#if !(!defined(cygwin) && defined(HAVE_WINSOCK_H))
+ {
+ int i;
+
+ /* Unix: clear any file descriptors defined in *dst but not in *src. */
+ for (i = src->lfs_setsize; i < FD_SETSIZE; ++i)
+ FD_CLR(i, dst);
+ }
+#endif
+
+ return 0;
+}
diff --git a/snmplib/lcd_time.c b/snmplib/lcd_time.c
new file mode 100644
index 0000000..a69c072
--- /dev/null
+++ b/snmplib/lcd_time.c
@@ -0,0 +1,608 @@
+/*
+ * lcd_time.c
+ *
+ * XXX Should etimelist entries with <0,0> time tuples be timed out?
+ * XXX Need a routine to free the memory? (Perhaps at shutdown?)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <sys/types.h>
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.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
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/snmpusm.h>
+#include <net-snmp/library/lcd_time.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/snmpv3.h>
+
+#include <net-snmp/library/transform_oids.h>
+
+netsnmp_feature_child_of(usm_support, libnetsnmp)
+netsnmp_feature_child_of(usm_lcd_time, usm_support)
+
+#ifndef NETSNMP_FEATURE_REMOVE_USM_LCD_TIME
+
+/*
+ * Global static hashlist to contain Enginetime entries.
+ *
+ * New records are prepended to the appropriate list at the hash index.
+ */
+static Enginetime etimelist[ETIMELIST_SIZE];
+
+
+
+
+/*******************************************************************-o-******
+ * get_enginetime
+ *
+ * Parameters:
+ * *engineID
+ * engineID_len
+ * *engineboot
+ * *engine_time
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success -- when a record for engineID is found.
+ * SNMPERR_GENERR Otherwise.
+ *
+ *
+ * Lookup engineID and return the recorded values for the
+ * <engine_time, engineboot> tuple adjusted to reflect the estimated time
+ * at the engine in question.
+ *
+ * Special case: if engineID is NULL or if engineID_len is 0 then
+ * the time tuple is returned immediately as zero.
+ *
+ * XXX What if timediff wraps? >shrug<
+ * XXX Then: you need to increment the boots value. Now. Detecting
+ * this is another matter.
+ */
+int
+get_enginetime(const u_char * engineID,
+ u_int engineID_len,
+ u_int * engineboot,
+ u_int * engine_time, u_int authenticated)
+{
+ int rval = SNMPERR_SUCCESS;
+ int timediff = 0;
+ Enginetime e = NULL;
+
+
+
+ /*
+ * Sanity check.
+ */
+ if (!engine_time || !engineboot) {
+ QUITFUN(SNMPERR_GENERR, get_enginetime_quit);
+ }
+
+
+ /*
+ * Compute estimated current engine_time tuple at engineID if
+ * a record is cached for it.
+ */
+ *engine_time = *engineboot = 0;
+
+ if (!engineID || (engineID_len <= 0)) {
+ QUITFUN(SNMPERR_GENERR, get_enginetime_quit);
+ }
+
+ if (!(e = search_enginetime_list(engineID, engineID_len))) {
+ QUITFUN(SNMPERR_GENERR, get_enginetime_quit);
+ }
+#ifdef LCD_TIME_SYNC_OPT
+ if (!authenticated || e->authenticatedFlag) {
+#endif
+ *engine_time = e->engineTime;
+ *engineboot = e->engineBoot;
+
+ timediff = (int) (snmpv3_local_snmpEngineTime() - e->lastReceivedEngineTime);
+
+#ifdef LCD_TIME_SYNC_OPT
+ }
+#endif
+
+ if (timediff > (int) (ENGINETIME_MAX - *engine_time)) {
+ *engine_time = (timediff - (ENGINETIME_MAX - *engine_time));
+
+ /*
+ * FIX -- move this check up... should not change anything
+ * * if engineboot is already locked. ???
+ */
+ if (*engineboot < ENGINEBOOT_MAX) {
+ *engineboot += 1;
+ }
+
+ } else {
+ *engine_time += timediff;
+ }
+
+ DEBUGMSGTL(("lcd_get_enginetime", "engineID "));
+ DEBUGMSGHEX(("lcd_get_enginetime", engineID, engineID_len));
+ DEBUGMSG(("lcd_get_enginetime", ": boots=%d, time=%d\n", *engineboot,
+ *engine_time));
+
+ get_enginetime_quit:
+ return rval;
+
+} /* end get_enginetime() */
+
+/*******************************************************************-o-******
+ * get_enginetime
+ *
+ * Parameters:
+ * *engineID
+ * engineID_len
+ * *engineboot
+ * *engine_time
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success -- when a record for engineID is found.
+ * SNMPERR_GENERR Otherwise.
+ *
+ *
+ * Lookup engineID and return the recorded values for the
+ * <engine_time, engineboot> tuple adjusted to reflect the estimated time
+ * at the engine in question.
+ *
+ * Special case: if engineID is NULL or if engineID_len is 0 then
+ * the time tuple is returned immediately as zero.
+ *
+ * XXX What if timediff wraps? >shrug<
+ * XXX Then: you need to increment the boots value. Now. Detecting
+ * this is another matter.
+ */
+int
+get_enginetime_ex(u_char * engineID,
+ u_int engineID_len,
+ u_int * engineboot,
+ u_int * engine_time,
+ u_int * last_engine_time, u_int authenticated)
+{
+ int rval = SNMPERR_SUCCESS;
+ int timediff = 0;
+ Enginetime e = NULL;
+
+
+
+ /*
+ * Sanity check.
+ */
+ if (!engine_time || !engineboot || !last_engine_time) {
+ QUITFUN(SNMPERR_GENERR, get_enginetime_ex_quit);
+ }
+
+
+ /*
+ * Compute estimated current engine_time tuple at engineID if
+ * a record is cached for it.
+ */
+ *last_engine_time = *engine_time = *engineboot = 0;
+
+ if (!engineID || (engineID_len <= 0)) {
+ QUITFUN(SNMPERR_GENERR, get_enginetime_ex_quit);
+ }
+
+ if (!(e = search_enginetime_list(engineID, engineID_len))) {
+ QUITFUN(SNMPERR_GENERR, get_enginetime_ex_quit);
+ }
+#ifdef LCD_TIME_SYNC_OPT
+ if (!authenticated || e->authenticatedFlag) {
+#endif
+ *last_engine_time = *engine_time = e->engineTime;
+ *engineboot = e->engineBoot;
+
+ timediff = (int) (snmpv3_local_snmpEngineTime() - e->lastReceivedEngineTime);
+
+#ifdef LCD_TIME_SYNC_OPT
+ }
+#endif
+
+ if (timediff > (int) (ENGINETIME_MAX - *engine_time)) {
+ *engine_time = (timediff - (ENGINETIME_MAX - *engine_time));
+
+ /*
+ * FIX -- move this check up... should not change anything
+ * * if engineboot is already locked. ???
+ */
+ if (*engineboot < ENGINEBOOT_MAX) {
+ *engineboot += 1;
+ }
+
+ } else {
+ *engine_time += timediff;
+ }
+
+ DEBUGMSGTL(("lcd_get_enginetime_ex", "engineID "));
+ DEBUGMSGHEX(("lcd_get_enginetime_ex", engineID, engineID_len));
+ DEBUGMSG(("lcd_get_enginetime_ex", ": boots=%d, time=%d\n",
+ *engineboot, *engine_time));
+
+ get_enginetime_ex_quit:
+ return rval;
+
+} /* end get_enginetime_ex() */
+
+
+void free_enginetime(unsigned char *engineID, size_t engineID_len)
+{
+ Enginetime e = NULL;
+ int rval = 0;
+
+ rval = hash_engineID(engineID, engineID_len);
+ if (rval < 0)
+ return;
+
+ e = etimelist[rval];
+
+ while (e != NULL) {
+ etimelist[rval] = e->next;
+ SNMP_FREE(e->engineID);
+ SNMP_FREE(e);
+ e = etimelist[rval];
+ }
+
+}
+
+/*******************************************************************-o-****
+**
+ * free_etimelist
+ *
+ * Parameters:
+ * None
+ *
+ * Returns:
+ * void
+ *
+ *
+ * Free all of the memory used by entries in the etimelist.
+ *
+ */
+void free_etimelist(void)
+{
+ int index = 0;
+ Enginetime e = NULL;
+ Enginetime nextE = NULL;
+
+ for( ; index < ETIMELIST_SIZE; ++index)
+ {
+ e = etimelist[index];
+
+ while(e != NULL)
+ {
+ nextE = e->next;
+ SNMP_FREE(e->engineID);
+ SNMP_FREE(e);
+ e = nextE;
+ }
+
+ etimelist[index] = NULL;
+ }
+ return;
+}
+
+/*******************************************************************-o-******
+ * set_enginetime
+ *
+ * Parameters:
+ * *engineID
+ * engineID_len
+ * engineboot
+ * engine_time
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMPERR_GENERR Otherwise.
+ *
+ *
+ * Lookup engineID and store the given <engine_time, engineboot> tuple
+ * and then stamp the record with a consistent source of local time.
+ * If the engineID record does not exist, create one.
+ *
+ * Special case: engineID is NULL or engineID_len is 0 defines an engineID
+ * that is "always set."
+ *
+ * XXX "Current time within the local engine" == time(NULL)...
+ */
+int
+set_enginetime(const u_char * engineID,
+ u_int engineID_len,
+ u_int engineboot, u_int engine_time, u_int authenticated)
+{
+ int rval = SNMPERR_SUCCESS, iindex;
+ Enginetime e = NULL;
+
+
+
+ /*
+ * Sanity check.
+ */
+ if (!engineID || (engineID_len <= 0)) {
+ return rval;
+ }
+
+
+ /*
+ * Store the given <engine_time, engineboot> tuple in the record
+ * for engineID. Create a new record if necessary.
+ */
+ if (!(e = search_enginetime_list(engineID, engineID_len))) {
+ if ((iindex = hash_engineID(engineID, engineID_len)) < 0) {
+ QUITFUN(SNMPERR_GENERR, set_enginetime_quit);
+ }
+
+ e = (Enginetime) calloc(1, sizeof(*e));
+
+ e->next = etimelist[iindex];
+ etimelist[iindex] = e;
+
+ e->engineID = (u_char *) calloc(1, engineID_len);
+ memcpy(e->engineID, engineID, engineID_len);
+
+ e->engineID_len = engineID_len;
+ }
+#ifdef LCD_TIME_SYNC_OPT
+ if (authenticated || !e->authenticatedFlag) {
+ e->authenticatedFlag = authenticated;
+#else
+ if (authenticated) {
+#endif
+ e->engineTime = engine_time;
+ e->engineBoot = engineboot;
+ e->lastReceivedEngineTime = snmpv3_local_snmpEngineTime();
+ }
+
+ e = NULL; /* Indicates a successful update. */
+
+ DEBUGMSGTL(("lcd_set_enginetime", "engineID "));
+ DEBUGMSGHEX(("lcd_set_enginetime", engineID, engineID_len));
+ DEBUGMSG(("lcd_set_enginetime", ": boots=%d, time=%d\n", engineboot,
+ engine_time));
+
+ set_enginetime_quit:
+ SNMP_FREE(e);
+
+ return rval;
+
+} /* end set_enginetime() */
+
+
+
+
+/*******************************************************************-o-******
+ * search_enginetime_list
+ *
+ * Parameters:
+ * *engineID
+ * engineID_len
+ *
+ * Returns:
+ * Pointer to a etimelist record with engineID <engineID> -OR-
+ * NULL if no record exists.
+ *
+ *
+ * Search etimelist for an entry with engineID.
+ *
+ * ASSUMES that no engineID will have more than one record in the list.
+ */
+Enginetime
+search_enginetime_list(const u_char * engineID, u_int engineID_len)
+{
+ int rval = SNMPERR_SUCCESS;
+ Enginetime e = NULL;
+
+
+ /*
+ * Sanity check.
+ */
+ if (!engineID || (engineID_len <= 0)) {
+ QUITFUN(SNMPERR_GENERR, search_enginetime_list_quit);
+ }
+
+
+ /*
+ * Find the entry for engineID if there be one.
+ */
+ rval = hash_engineID(engineID, engineID_len);
+ if (rval < 0) {
+ QUITFUN(SNMPERR_GENERR, search_enginetime_list_quit);
+ }
+ e = etimelist[rval];
+
+ for ( /*EMPTY*/; e; e = e->next) {
+ if ((engineID_len == e->engineID_len)
+ && !memcmp(e->engineID, engineID, engineID_len)) {
+ break;
+ }
+ }
+
+
+ search_enginetime_list_quit:
+ return e;
+
+} /* end search_enginetime_list() */
+
+
+
+
+
+/*******************************************************************-o-******
+ * hash_engineID
+ *
+ * Parameters:
+ * *engineID
+ * engineID_len
+ *
+ * Returns:
+ * >0 etimelist index for this engineID.
+ * SNMPERR_GENERR Error.
+ *
+ *
+ * Use a cheap hash to build an index into the etimelist. Method is
+ * to hash the engineID, then split the hash into u_int's and add them up
+ * and modulo the size of the list.
+ *
+ */
+int
+hash_engineID(const u_char * engineID, u_int engineID_len)
+{
+ int rval = SNMPERR_GENERR;
+ size_t buf_len = SNMP_MAXBUF;
+ u_int additive = 0;
+ u_char *bufp, buf[SNMP_MAXBUF];
+ void *context = NULL;
+
+
+
+ /*
+ * Sanity check.
+ */
+ if (!engineID || (engineID_len <= 0)) {
+ QUITFUN(SNMPERR_GENERR, hash_engineID_quit);
+ }
+
+
+ /*
+ * Hash engineID into a list index.
+ */
+#ifndef NETSNMP_DISABLE_MD5
+ rval = sc_hash(usmHMACMD5AuthProtocol,
+ sizeof(usmHMACMD5AuthProtocol) / sizeof(oid),
+ engineID, engineID_len, buf, &buf_len);
+#else
+ rval = sc_hash(usmHMACSHA1AuthProtocol,
+ sizeof(usmHMACSHA1AuthProtocol) / sizeof(oid),
+ engineID, engineID_len, buf, &buf_len);
+#endif
+ QUITFUN(rval, hash_engineID_quit);
+
+ for (bufp = buf; (bufp - buf) < (int) buf_len; bufp += 4) {
+ additive += (u_int) * bufp;
+ }
+
+ hash_engineID_quit:
+ SNMP_FREE(context);
+ memset(buf, 0, SNMP_MAXBUF);
+
+ return (rval < 0) ? rval : (int)(additive % ETIMELIST_SIZE);
+
+} /* end hash_engineID() */
+
+
+
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+/*******************************************************************-o-******
+ * dump_etimelist_entry
+ *
+ * Parameters:
+ * e
+ * count
+ */
+void
+dump_etimelist_entry(Enginetime e, int count)
+{
+ u_int buflen;
+ char tabs[SNMP_MAXBUF], *t = tabs, *s;
+
+
+
+ count += 1;
+ while (count--) {
+ t += sprintf(t, " ");
+ }
+
+
+ buflen = e->engineID_len;
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ if (!(s = dump_snmpEngineID(e->engineID, &buflen))) {
+#endif
+ binary_to_hex(e->engineID, e->engineID_len, &s);
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ }
+#endif
+
+ DEBUGMSGTL(("dump_etimelist", "%s\n", tabs));
+ DEBUGMSGTL(("dump_etimelist", "%s%s (len=%d) <%d,%d>\n", tabs,
+ s, e->engineID_len, e->engineTime, e->engineBoot));
+ DEBUGMSGTL(("dump_etimelist", "%s%ld (%ld)", tabs,
+ e->lastReceivedEngineTime,
+ snmpv3_local_snmpEngineTime() - e->lastReceivedEngineTime));
+
+ SNMP_FREE(s);
+
+} /* end dump_etimelist_entry() */
+
+
+
+
+/*******************************************************************-o-******
+ * dump_etimelist
+ */
+void
+dump_etimelist(void)
+{
+ int iindex = -1, count = 0;
+ Enginetime e;
+
+
+
+ DEBUGMSGTL(("dump_etimelist", "\n"));
+
+ while (++iindex < ETIMELIST_SIZE) {
+ DEBUGMSG(("dump_etimelist", "[%d]", iindex));
+
+ count = 0;
+ e = etimelist[iindex];
+
+ while (e) {
+ dump_etimelist_entry(e, count++);
+ e = e->next;
+ }
+
+ if (count > 0) {
+ DEBUGMSG(("dump_etimelist", "\n"));
+ }
+ } /* endwhile */
+
+ DEBUGMSG(("dump_etimelist", "\n"));
+
+} /* end dump_etimelist() */
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+#endif /* NETSNMP_FEATURE_REMOVE_USM_LCD_TIME */
diff --git a/snmplib/md5.c b/snmplib/md5.c
new file mode 100644
index 0000000..fbfd43f
--- /dev/null
+++ b/snmplib/md5.c
@@ -0,0 +1,536 @@
+/*
+ * ** **************************************************************************
+ * ** md5.c -- Implementation of MD5 Message Digest Algorithm **
+ * ** Updated: 2/16/90 by Ronald L. Rivest **
+ * ** (C) 1990 RSA Data Security, Inc. **
+ * ** **************************************************************************
+ */
+
+/*
+ * ** To use MD5:
+ * ** -- Include md5.h in your program
+ * ** -- Declare an MDstruct MD to hold the state of the digest computation.
+ * ** -- Initialize MD using MDbegin(&MD)
+ * ** -- For each full block (64 bytes) X you wish to process, call
+ * ** MDupdate(&MD,X,512)
+ * ** (512 is the number of bits in a full block.)
+ * ** -- For the last block (less than 64 bytes) you wish to process,
+ * ** MDupdate(&MD,X,n)
+ * ** where n is the number of bits in the partial block. A partial
+ * ** block terminates the computation, so every MD computation should
+ * ** terminate by processing a partial block, even if it has n = 0.
+ * ** -- The message digest is available in MD.buffer[0] ... MD.buffer[3].
+ * ** (Least-significant byte of each word should be output first.)
+ * ** -- You can print out the digest using MDprint(&MD)
+ */
+
+/*
+ * Implementation notes:
+ * ** This implementation assumes that ints are 32-bit quantities.
+ * ** If the machine stores the least-significant byte of an int in the
+ * ** least-addressed byte (eg., VAX and 8086), then LOWBYTEFIRST should be
+ * ** set to TRUE. Otherwise (eg., SUNS), LOWBYTEFIRST should be set to
+ * ** FALSE. Note that on machines with LOWBYTEFIRST FALSE the routine
+ * ** MDupdate modifies has a side-effect on its input array (the order of bytes
+ * ** in each word are reversed). If this is undesired a call to MDreverse(X) can
+ * ** reverse the bytes of X back into order after each call to MDupdate.
+ */
+
+/*
+ * code uses WORDS_BIGENDIAN defined by configure now -- WH 9/27/95
+ */
+
+/*
+ * Compile-time includes
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifndef NETSNMP_DISABLE_MD5
+
+#include <stdio.h>
+#include <sys/types.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/utilities.h>
+#include <net-snmp/library/md5.h>
+
+/*
+ * Compile-time declarations of MD5 ``magic constants''.
+ */
+#define I0 0x67452301 /* Initial values for MD buffer */
+#define I1 0xefcdab89
+#define I2 0x98badcfe
+#define I3 0x10325476
+#define fs1 7 /* round 1 shift amounts */
+#define fs2 12
+#define fs3 17
+#define fs4 22
+#define gs1 5 /* round 2 shift amounts */
+#define gs2 9
+#define gs3 14
+#define gs4 20
+#define hs1 4 /* round 3 shift amounts */
+#define hs2 11
+#define hs3 16
+#define hs4 23
+#define is1 6 /* round 4 shift amounts */
+#define is2 10
+#define is3 15
+#define is4 21
+
+
+/*
+ * Compile-time macro declarations for MD5.
+ * ** Note: The ``rot'' operator uses the variable ``tmp''.
+ * ** It assumes tmp is declared as unsigned int, so that the >>
+ * ** operator will shift in zeros rather than extending the sign bit.
+ */
+#define f(X,Y,Z) ((X&Y) | ((~X)&Z))
+#define g(X,Y,Z) ((X&Z) | (Y&(~Z)))
+#define h(X,Y,Z) (X^Y^Z)
+#define i_(X,Y,Z) (Y ^ ((X) | (~Z)))
+#define rot(X,S) (tmp=X,(tmp<<S) | (tmp>>(32-S)))
+#define ff(A,B,C,D,i,s,lp) A = rot((A + f(B,C,D) + X[i] + lp),s) + B
+#define gg(A,B,C,D,i,s,lp) A = rot((A + g(B,C,D) + X[i] + lp),s) + B
+#define hh(A,B,C,D,i,s,lp) A = rot((A + h(B,C,D) + X[i] + lp),s) + B
+#define ii(A,B,C,D,i,s,lp) A = rot((A + i_(B,C,D) + X[i] + lp),s) + B
+
+#ifdef STDC_HEADERS
+#define Uns(num) num##U
+#else
+#define Uns(num) num
+#endif /* STDC_HEADERS */
+
+void MDreverse(unsigned int *);
+static void MDblock(MDptr, const unsigned int *);
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+/*
+ * MDprint(MDp)
+ * ** Print message digest buffer MDp as 32 hexadecimal digits.
+ * ** Order is from low-order byte of buffer[0] to high-order byte of buffer[3].
+ * ** Each byte is printed with high-order hexadecimal digit first.
+ * ** This is a user-callable routine.
+ */
+void
+MDprint(MDptr MDp)
+{
+ int i, j;
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 32; j = j + 8)
+ printf("%02x", (MDp->buffer[i] >> j) & 0xFF);
+ printf("\n");
+ fflush(stdout);
+}
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+/*
+ * MDbegin(MDp)
+ * ** Initialize message digest buffer MDp.
+ * ** This is a user-callable routine.
+ */
+void
+MDbegin(MDptr MDp)
+{
+ int i;
+ MDp->buffer[0] = I0;
+ MDp->buffer[1] = I1;
+ MDp->buffer[2] = I2;
+ MDp->buffer[3] = I3;
+ for (i = 0; i < 8; i++)
+ MDp->count[i] = 0;
+ MDp->done = 0;
+}
+
+/*
+ * MDreverse(X)
+ * ** Reverse the byte-ordering of every int in X.
+ * ** Assumes X is an array of 16 ints.
+ * ** The macro revx reverses the byte-ordering of the next word of X.
+ */
+#define revx { t = (*X << 16) | (*X >> 16); \
+ *X++ = ((t & 0xFF00FF00) >> 8) | ((t & 0x00FF00FF) << 8); }
+
+void
+MDreverse(unsigned int *X)
+{
+ register unsigned int t;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+ revx;
+}
+
+/*
+ * MDblock(MDp,X)
+ * ** Update message digest buffer MDp->buffer using 16-word data block X.
+ * ** Assumes all 16 words of X are full of data.
+ * ** Does not update MDp->count.
+ * ** This routine is not user-callable.
+ */
+static void
+MDblock(MDptr MDp, const unsigned int *X)
+{
+ register unsigned int tmp, A, B, C, D; /* hpux sysv sun */
+#ifdef WORDS_BIGENDIAN
+ MDreverse(X);
+#endif
+ A = MDp->buffer[0];
+ B = MDp->buffer[1];
+ C = MDp->buffer[2];
+ D = MDp->buffer[3];
+
+ /*
+ * Update the message digest buffer
+ */
+ ff(A, B, C, D, 0, fs1, Uns(3614090360)); /* Round 1 */
+ ff(D, A, B, C, 1, fs2, Uns(3905402710));
+ ff(C, D, A, B, 2, fs3, Uns(606105819));
+ ff(B, C, D, A, 3, fs4, Uns(3250441966));
+ ff(A, B, C, D, 4, fs1, Uns(4118548399));
+ ff(D, A, B, C, 5, fs2, Uns(1200080426));
+ ff(C, D, A, B, 6, fs3, Uns(2821735955));
+ ff(B, C, D, A, 7, fs4, Uns(4249261313));
+ ff(A, B, C, D, 8, fs1, Uns(1770035416));
+ ff(D, A, B, C, 9, fs2, Uns(2336552879));
+ ff(C, D, A, B, 10, fs3, Uns(4294925233));
+ ff(B, C, D, A, 11, fs4, Uns(2304563134));
+ ff(A, B, C, D, 12, fs1, Uns(1804603682));
+ ff(D, A, B, C, 13, fs2, Uns(4254626195));
+ ff(C, D, A, B, 14, fs3, Uns(2792965006));
+ ff(B, C, D, A, 15, fs4, Uns(1236535329));
+ gg(A, B, C, D, 1, gs1, Uns(4129170786)); /* Round 2 */
+ gg(D, A, B, C, 6, gs2, Uns(3225465664));
+ gg(C, D, A, B, 11, gs3, Uns(643717713));
+ gg(B, C, D, A, 0, gs4, Uns(3921069994));
+ gg(A, B, C, D, 5, gs1, Uns(3593408605));
+ gg(D, A, B, C, 10, gs2, Uns(38016083));
+ gg(C, D, A, B, 15, gs3, Uns(3634488961));
+ gg(B, C, D, A, 4, gs4, Uns(3889429448));
+ gg(A, B, C, D, 9, gs1, Uns(568446438));
+ gg(D, A, B, C, 14, gs2, Uns(3275163606));
+ gg(C, D, A, B, 3, gs3, Uns(4107603335));
+ gg(B, C, D, A, 8, gs4, Uns(1163531501));
+ gg(A, B, C, D, 13, gs1, Uns(2850285829));
+ gg(D, A, B, C, 2, gs2, Uns(4243563512));
+ gg(C, D, A, B, 7, gs3, Uns(1735328473));
+ gg(B, C, D, A, 12, gs4, Uns(2368359562));
+ hh(A, B, C, D, 5, hs1, Uns(4294588738)); /* Round 3 */
+ hh(D, A, B, C, 8, hs2, Uns(2272392833));
+ hh(C, D, A, B, 11, hs3, Uns(1839030562));
+ hh(B, C, D, A, 14, hs4, Uns(4259657740));
+ hh(A, B, C, D, 1, hs1, Uns(2763975236));
+ hh(D, A, B, C, 4, hs2, Uns(1272893353));
+ hh(C, D, A, B, 7, hs3, Uns(4139469664));
+ hh(B, C, D, A, 10, hs4, Uns(3200236656));
+ hh(A, B, C, D, 13, hs1, Uns(681279174));
+ hh(D, A, B, C, 0, hs2, Uns(3936430074));
+ hh(C, D, A, B, 3, hs3, Uns(3572445317));
+ hh(B, C, D, A, 6, hs4, Uns(76029189));
+ hh(A, B, C, D, 9, hs1, Uns(3654602809));
+ hh(D, A, B, C, 12, hs2, Uns(3873151461));
+ hh(C, D, A, B, 15, hs3, Uns(530742520));
+ hh(B, C, D, A, 2, hs4, Uns(3299628645));
+ ii(A, B, C, D, 0, is1, Uns(4096336452)); /* Round 4 */
+ ii(D, A, B, C, 7, is2, Uns(1126891415));
+ ii(C, D, A, B, 14, is3, Uns(2878612391));
+ ii(B, C, D, A, 5, is4, Uns(4237533241));
+ ii(A, B, C, D, 12, is1, Uns(1700485571));
+ ii(D, A, B, C, 3, is2, Uns(2399980690));
+ ii(C, D, A, B, 10, is3, Uns(4293915773));
+ ii(B, C, D, A, 1, is4, Uns(2240044497));
+ ii(A, B, C, D, 8, is1, Uns(1873313359));
+ ii(D, A, B, C, 15, is2, Uns(4264355552));
+ ii(C, D, A, B, 6, is3, Uns(2734768916));
+ ii(B, C, D, A, 13, is4, Uns(1309151649));
+ ii(A, B, C, D, 4, is1, Uns(4149444226));
+ ii(D, A, B, C, 11, is2, Uns(3174756917));
+ ii(C, D, A, B, 2, is3, Uns(718787259));
+ ii(B, C, D, A, 9, is4, Uns(3951481745));
+
+ MDp->buffer[0] += A;
+ MDp->buffer[1] += B;
+ MDp->buffer[2] += C;
+ MDp->buffer[3] += D;
+#ifdef WORDS_BIGENDIAN
+ MDreverse(X);
+#endif
+}
+
+/*
+ * MDupdate(MDp,X,count)
+ * ** Input: MDp -- an MDptr
+ * ** X -- a pointer to an array of unsigned characters.
+ * ** count -- the number of bits of X to use.
+ * ** (if not a multiple of 8, uses high bits of last byte.)
+ * ** Update MDp using the number of bits of X given by count.
+ * ** This is the basic input routine for an MD5 user.
+ * ** The routine completes the MD computation when count < 512, so
+ * ** every MD computation should end with one call to MDupdate with a
+ * ** count less than 512. A call with count 0 will be ignored if the
+ * ** MD has already been terminated (done != 0), so an extra call with count
+ * ** 0 can be given as a ``courtesy close'' to force termination if desired.
+ * ** Returns : 0 if processing succeeds or was already done;
+ * ** -1 if processing was already done
+ * ** -2 if count was too large
+ */
+int
+MDupdate(MDptr MDp, const unsigned char *X, unsigned int count)
+{
+ unsigned int i, tmp, bit, byte, mask;
+ unsigned char XX[64];
+ unsigned char *p;
+ /*
+ * return with no error if this is a courtesy close with count
+ * ** zero and MDp->done is true.
+ */
+ if (count == 0 && MDp->done)
+ return 0;
+ /*
+ * check to see if MD is already done and report error
+ */
+ if (MDp->done) {
+ return -1;
+ }
+ /*
+ * if (MDp->done) { fprintf(stderr,"\nError: MDupdate MD already done."); return; }
+ */
+ /*
+ * Add count to MDp->count
+ */
+ tmp = count;
+ p = MDp->count;
+ while (tmp) {
+ tmp += *p;
+ *p++ = tmp;
+ tmp = tmp >> 8;
+ }
+ /*
+ * Process data
+ */
+ if (count == 512) { /* Full block of data to handle */
+ MDblock(MDp, (const unsigned int *) X);
+ } else if (count > 512) /* Check for count too large */
+ return -2;
+ /*
+ * { fprintf(stderr,"\nError: MDupdate called with illegal count value %d.",count);
+ * return;
+ * }
+ */
+ else { /* partial block -- must be last block so finish up */
+ /*
+ * Find out how many bytes and residual bits there are
+ */
+ int copycount;
+ byte = count >> 3;
+ bit = count & 7;
+ copycount = byte;
+ if (bit)
+ copycount++;
+ /*
+ * Copy X into XX since we need to modify it
+ */
+ memset(XX, 0, sizeof(XX));
+ memcpy(XX, X, copycount);
+
+ /*
+ * Add padding '1' bit and low-order zeros in last byte
+ */
+ mask = ((unsigned long) 1) << (7 - bit);
+ XX[byte] = (XX[byte] | mask) & ~(mask - 1);
+ /*
+ * If room for bit count, finish up with this block
+ */
+ if (byte <= 55) {
+ for (i = 0; i < 8; i++)
+ XX[56 + i] = MDp->count[i];
+ MDblock(MDp, (unsigned int *) XX);
+ } else { /* need to do two blocks to finish up */
+ MDblock(MDp, (unsigned int *) XX);
+ for (i = 0; i < 56; i++)
+ XX[i] = 0;
+ for (i = 0; i < 8; i++)
+ XX[56 + i] = MDp->count[i];
+ MDblock(MDp, (unsigned int *) XX);
+ }
+ /*
+ * Set flag saying we're done with MD computation
+ */
+ MDp->done = 1;
+ }
+ return 0;
+}
+
+/*
+ * MDchecksum(data, len, MD5): do a checksum on an arbirtrary amount of data
+ */
+int
+MDchecksum(const u_char * data, size_t len, u_char * mac, size_t maclen)
+{
+ MDstruct md;
+ MDstruct *MD = &md;
+ int rc = 0;
+
+ MDbegin(MD);
+ while (len >= 64) {
+ rc = MDupdate(MD, data, 64 * 8);
+ if (rc)
+ goto check_end;
+ data += 64;
+ len -= 64;
+ }
+ rc = MDupdate(MD, data, len * 8);
+ if (rc)
+ goto check_end;
+
+ /*
+ * copy the checksum to the outgoing data (all of it that is requested).
+ */
+ MDget(MD, mac, maclen);
+
+ check_end:
+ memset(&md, 0, sizeof(md));
+ return rc;
+}
+
+
+/*
+ * MDsign(data, len, MD5): do a checksum on an arbirtrary amount
+ * of data, and prepended with a secret in the standard fashion
+ */
+int
+MDsign(const u_char * data, size_t len, u_char * mac, size_t maclen,
+ const u_char * secret, size_t secretlen)
+{
+#define HASHKEYLEN 64
+
+ MDstruct MD;
+ u_char K1[HASHKEYLEN];
+ u_char K2[HASHKEYLEN];
+ u_char extendedAuthKey[HASHKEYLEN];
+ u_char buf[HASHKEYLEN];
+ size_t i;
+ const u_char *cp;
+ u_char *newdata = NULL;
+ int rc = 0;
+
+ /*
+ * memset(K1,0,HASHKEYLEN);
+ * memset(K2,0,HASHKEYLEN);
+ * memset(buf,0,HASHKEYLEN);
+ * memset(extendedAuthKey,0,HASHKEYLEN);
+ */
+
+ if (secretlen != 16 || secret == NULL || mac == NULL || data == NULL ||
+ len <= 0 || maclen <= 0) {
+ /*
+ * DEBUGMSGTL(("md5","MD5 signing not properly initialized"));
+ */
+ return -1;
+ }
+
+ memset(extendedAuthKey, 0, HASHKEYLEN);
+ memcpy(extendedAuthKey, secret, secretlen);
+ for (i = 0; i < HASHKEYLEN; i++) {
+ K1[i] = extendedAuthKey[i] ^ 0x36;
+ K2[i] = extendedAuthKey[i] ^ 0x5c;
+ }
+
+ MDbegin(&MD);
+ rc = MDupdate(&MD, K1, HASHKEYLEN * 8);
+ if (rc)
+ goto update_end;
+
+ i = len;
+ if (((uintptr_t) data) % sizeof(long) != 0) {
+ /*
+ * this relies on the ability to use integer math and thus we
+ * must rely on data that aligns on 32-bit-word-boundries
+ */
+ memdup(&newdata, data, len);
+ cp = newdata;
+ } else {
+ cp = data;
+ }
+
+ while (i >= 64) {
+ rc = MDupdate(&MD, cp, 64 * 8);
+ if (rc)
+ goto update_end;
+ cp += 64;
+ i -= 64;
+ }
+
+ rc = MDupdate(&MD, cp, i * 8);
+ if (rc)
+ goto update_end;
+
+ memset(buf, 0, HASHKEYLEN);
+ MDget(&MD, buf, HASHKEYLEN);
+
+ MDbegin(&MD);
+ rc = MDupdate(&MD, K2, HASHKEYLEN * 8);
+ if (rc)
+ goto update_end;
+ rc = MDupdate(&MD, buf, 16 * 8);
+ if (rc)
+ goto update_end;
+
+ /*
+ * copy the sign checksum to the outgoing pointer
+ */
+ MDget(&MD, mac, maclen);
+
+ update_end:
+ memset(buf, 0, HASHKEYLEN);
+ memset(K1, 0, HASHKEYLEN);
+ memset(K2, 0, HASHKEYLEN);
+ memset(extendedAuthKey, 0, HASHKEYLEN);
+ memset(&MD, 0, sizeof(MD));
+
+ if (newdata)
+ free(newdata);
+ return rc;
+}
+
+void
+MDget(MDstruct * MD, u_char * buf, size_t buflen)
+{
+ int i, j;
+
+ /*
+ * copy the checksum to the outgoing data (all of it that is requested).
+ */
+ for (i = 0; i < 4 && i * 4 < (int) buflen; i++)
+ for (j = 0; j < 4 && i * 4 + j < (int) buflen; j++)
+ buf[i * 4 + j] = (MD->buffer[i] >> j * 8) & 0xff;
+}
+
+/*
+ * ** End of md5.c
+ * ****************************(cut)****************************************
+ */
+
+#endif /* NETSNMP_DISABLE_MD5 */
diff --git a/snmplib/mib.c b/snmplib/mib.c
new file mode 100644
index 0000000..cbabf25
--- /dev/null
+++ b/snmplib/mib.c
@@ -0,0 +1,6800 @@
+/*
+ * mib.c
+ *
+ * $Id$
+ *
+ * Update: 1998-07-17 <jhy@gsu.edu>
+ * Added print_oid_report* functions.
+ *
+ */
+/* 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, 1991, 1992 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>
+#include <net-snmp/net-snmp-features.h>
+
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# 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_NETINET_IN_H
+#include <netinet/in.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_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/parse.h>
+#include <net-snmp/library/int64.h>
+#include <net-snmp/library/snmp_client.h>
+
+netsnmp_feature_child_of(mib_api, libnetsnmp)
+netsnmp_feature_child_of(mib_strings_all, mib_api)
+
+netsnmp_feature_child_of(mib_snprint, mib_strings_all)
+netsnmp_feature_child_of(mib_snprint_description, mib_strings_all)
+netsnmp_feature_child_of(mib_snprint_variable, mib_strings_all)
+netsnmp_feature_child_of(mib_string_conversions, mib_strings_all)
+netsnmp_feature_child_of(print_mib, mib_strings_all)
+netsnmp_feature_child_of(snprint_objid, mib_strings_all)
+netsnmp_feature_child_of(snprint_value, mib_strings_all)
+
+netsnmp_feature_child_of(mib_to_asn_type, mib_api)
+
+/** @defgroup mib_utilities mib parsing and datatype manipulation routines.
+ * @ingroup library
+ *
+ * @{
+ */
+
+static char *uptimeString(u_long, char *, size_t);
+
+static struct tree *_get_realloc_symbol(const oid * objid, size_t objidlen,
+ struct tree *subtree,
+ u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc,
+ int *buf_overflow,
+ struct index_list *in_dices,
+ size_t * end_of_known);
+
+static int print_tree_node(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ struct tree *tp, int width);
+static void handle_mibdirs_conf(const char *token, char *line);
+static void handle_mibs_conf(const char *token, char *line);
+static void handle_mibfile_conf(const char *token, char *line);
+
+static void _oid_finish_printing(const oid * objid, size_t objidlen,
+ u_char ** buf, size_t * buf_len,
+ size_t * out_len,
+ int allow_realloc, int *buf_overflow);
+
+/*
+ * helper functions for get_module_node
+ */
+static int node_to_oid(struct tree *, oid *, size_t *);
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+static int _add_strings_to_oid(struct tree *, char *,
+ oid *, size_t *, size_t);
+#else
+static int _add_strings_to_oid(void *, char *,
+ oid *, size_t *, size_t);
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+NETSNMP_IMPORT struct tree *tree_head;
+static struct tree *tree_top;
+
+NETSNMP_IMPORT struct tree *Mib;
+struct tree *Mib; /* Backwards compatibility */
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+oid RFC1213_MIB[] = { 1, 3, 6, 1, 2, 1 };
+static char Standard_Prefix[] = ".1.3.6.1.2.1";
+
+/*
+ * Set default here as some uses of read_objid require valid pointer.
+ */
+static char *Prefix = &Standard_Prefix[0];
+typedef struct _PrefixList {
+ const char *str;
+ int len;
+} *PrefixListPtr, PrefixList;
+
+/*
+ * Here are the prefix strings.
+ * Note that the first one finds the value of Prefix or Standard_Prefix.
+ * Any of these MAY start with period; all will NOT end with period.
+ * Period is added where needed. See use of Prefix in this module.
+ */
+PrefixList mib_prefixes[] = {
+ {&Standard_Prefix[0]}, /* placeholder for Prefix data */
+ {".iso.org.dod.internet.mgmt.mib-2"},
+ {".iso.org.dod.internet.experimental"},
+ {".iso.org.dod.internet.private"},
+ {".iso.org.dod.internet.snmpParties"},
+ {".iso.org.dod.internet.snmpSecrets"},
+ {NULL, 0} /* end of list */
+};
+
+enum inet_address_type {
+ IPV4 = 1,
+ IPV6 = 2,
+ IPV4Z = 3,
+ IPV6Z = 4,
+ DNS = 16
+};
+
+
+/**
+ * @internal
+ * Converts timeticks to hours, minutes, seconds string.
+ *
+ * @param timeticks The timeticks to convert.
+ * @param buf Buffer to write to, has to be at
+ * least 40 Bytes large.
+ *
+ * @return The buffer.
+ */
+static char *
+uptimeString(u_long timeticks, char *buf, size_t buflen)
+{
+ int centisecs, seconds, minutes, hours, days;
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS)) {
+ snprintf(buf, buflen, "%lu", timeticks);
+ return buf;
+ }
+
+
+ centisecs = timeticks % 100;
+ timeticks /= 100;
+ days = timeticks / (60 * 60 * 24);
+ timeticks %= (60 * 60 * 24);
+
+ hours = timeticks / (60 * 60);
+ timeticks %= (60 * 60);
+
+ minutes = timeticks / 60;
+ seconds = timeticks % 60;
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT))
+ snprintf(buf, buflen, "%d:%d:%02d:%02d.%02d",
+ days, hours, minutes, seconds, centisecs);
+ else {
+ if (days == 0) {
+ snprintf(buf, buflen, "%d:%02d:%02d.%02d",
+ hours, minutes, seconds, centisecs);
+ } else if (days == 1) {
+ snprintf(buf, buflen, "%d day, %d:%02d:%02d.%02d",
+ days, hours, minutes, seconds, centisecs);
+ } else {
+ snprintf(buf, buflen, "%d days, %d:%02d:%02d.%02d",
+ days, hours, minutes, seconds, centisecs);
+ }
+ }
+ return buf;
+}
+
+
+
+/**
+ * @internal
+ * Prints the character pointed to if in human-readable ASCII range,
+ * otherwise prints a dot.
+ *
+ * @param buf Buffer to print the character to.
+ * @param ch Character to print.
+ */
+static void
+sprint_char(char *buf, const u_char ch)
+{
+ if (isprint(ch) || isspace(ch)) {
+ sprintf(buf, "%c", (int) ch);
+ } else {
+ sprintf(buf, ".");
+ }
+}
+
+
+
+/**
+ * Prints a hexadecimal string into a buffer.
+ *
+ * The characters pointed by *cp are encoded as hexadecimal string.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf address of the buffer to print to.
+ * @param buf_len address to an integer containing the size of buf.
+ * @param out_len incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param cp the array of characters to encode.
+ * @param line_len the array length of cp.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+_sprint_hexstring_line(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc, const u_char * cp, size_t line_len)
+{
+ const u_char *tp;
+ const u_char *cp2 = cp;
+ size_t lenleft = line_len;
+
+ /*
+ * Make sure there's enough room for the hex output....
+ */
+ while ((*out_len + line_len*3+1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ /*
+ * .... and display the hex values themselves....
+ */
+ for (; lenleft >= 8; lenleft-=8) {
+ sprintf((char *) (*buf + *out_len),
+ "%02X %02X %02X %02X %02X %02X %02X %02X ", cp[0], cp[1],
+ cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]);
+ *out_len += strlen((char *) (*buf + *out_len));
+ cp += 8;
+ }
+ for (; lenleft > 0; lenleft--) {
+ sprintf((char *) (*buf + *out_len), "%02X ", *cp++);
+ *out_len += strlen((char *) (*buf + *out_len));
+ }
+
+ /*
+ * .... plus (optionally) do the same for the ASCII equivalent.
+ */
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_HEX_TEXT)) {
+ while ((*out_len + line_len+5) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ sprintf((char *) (*buf + *out_len), " [");
+ *out_len += strlen((char *) (*buf + *out_len));
+ for (tp = cp2; tp < cp; tp++) {
+ sprint_char((char *) (*buf + *out_len), *tp);
+ (*out_len)++;
+ }
+ sprintf((char *) (*buf + *out_len), "]");
+ *out_len += strlen((char *) (*buf + *out_len));
+ }
+ return 1;
+}
+
+int
+sprint_realloc_hexstring(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc, const u_char * cp, size_t len)
+{
+ int line_len = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH);
+ if (!line_len)
+ line_len=len;
+
+ for (; (int)len > line_len; len -= line_len) {
+ if(!_sprint_hexstring_line(buf, buf_len, out_len, allow_realloc, cp, line_len))
+ return 0;
+ *(*buf + (*out_len)++) = '\n';
+ *(*buf + *out_len) = 0;
+ cp += line_len;
+ }
+ if(!_sprint_hexstring_line(buf, buf_len, out_len, allow_realloc, cp, len))
+ return 0;
+ *(*buf + *out_len) = 0;
+ return 1;
+}
+
+
+
+/**
+ * Prints an ascii string into a buffer.
+ *
+ * The characters pointed by *cp are encoded as an ascii string.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf address of the buffer to print to.
+ * @param buf_len address to an integer containing the size of buf.
+ * @param out_len incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param cp the array of characters to encode.
+ * @param len the array length of cp.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_asciistring(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const u_char * cp, size_t len)
+{
+ int i;
+
+ for (i = 0; i < (int) len; i++) {
+ if (isprint(*cp) || isspace(*cp)) {
+ if (*cp == '\\' || *cp == '"') {
+ if ((*out_len >= *buf_len) &&
+ !(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ *(*buf + (*out_len)++) = '\\';
+ }
+ if ((*out_len >= *buf_len) &&
+ !(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ *(*buf + (*out_len)++) = *cp++;
+ } else {
+ if ((*out_len >= *buf_len) &&
+ !(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ *(*buf + (*out_len)++) = '.';
+ cp++;
+ }
+ }
+ if ((*out_len >= *buf_len) &&
+ !(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ *(*buf + *out_len) = '\0';
+ return 1;
+}
+
+/**
+ * Prints an octet string into a buffer.
+ *
+ * The variable var is encoded as octet string.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_octet_string(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums, const char *hint,
+ const char *units)
+{
+ size_t saved_out_len = *out_len;
+ const char *saved_hint = hint;
+ int hex = 0, x = 0;
+ u_char *cp;
+ int output_format, cnt;
+
+ if ((var->type != ASN_OCTET_STR) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ const char str[] = "Wrong Type (should be OCTET STRING): ";
+ if (snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+
+ if (hint) {
+ int repeat, width = 1;
+ long value;
+ char code = 'd', separ = 0, term = 0, ch, intbuf[32];
+#define HEX2DIGIT_NEED_INIT 3
+ char hex2digit = HEX2DIGIT_NEED_INIT;
+ u_char *ecp;
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "STRING: ")) {
+ return 0;
+ }
+ }
+ cp = var->val.string;
+ ecp = cp + var->val_len;
+
+ while (cp < ecp) {
+ repeat = 1;
+ if (*hint) {
+ if (*hint == '*') {
+ repeat = *cp++;
+ hint++;
+ }
+ width = 0;
+ while ('0' <= *hint && *hint <= '9')
+ width = (width * 10) + (*hint++ - '0');
+ code = *hint++;
+ if ((ch = *hint) && ch != '*' && (ch < '0' || ch > '9')
+ && (width != 0
+ || (ch != 'x' && ch != 'd' && ch != 'o')))
+ separ = *hint++;
+ else
+ separ = 0;
+ if ((ch = *hint) && ch != '*' && (ch < '0' || ch > '9')
+ && (width != 0
+ || (ch != 'x' && ch != 'd' && ch != 'o')))
+ term = *hint++;
+ else
+ term = 0;
+ if (width == 0) /* Handle malformed hint strings */
+ width = 1;
+ }
+
+ while (repeat && cp < ecp) {
+ value = 0;
+ if (code != 'a' && code != 't') {
+ for (x = 0; x < width; x++) {
+ value = value * 256 + *cp++;
+ }
+ }
+ switch (code) {
+ case 'x':
+ if (HEX2DIGIT_NEED_INIT == hex2digit)
+ hex2digit = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT);
+ /*
+ * if value is < 16, it will be a single hex digit. If the
+ * width is 1 (we are outputting a byte at a time), pat it
+ * to 2 digits if NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT is set
+ * or all of the following are true:
+ * - we do not have a separation character
+ * - there is no hint left (or there never was a hint)
+ *
+ * e.g. for the data 0xAA01BB, would anyone really ever
+ * want the string "AA1BB"??
+ */
+ if (((value < 16) && (1 == width)) &&
+ (hex2digit || ((0 == separ) && (0 == *hint)))) {
+ sprintf(intbuf, "0%lx", value);
+ } else {
+ sprintf(intbuf, "%lx", value);
+ }
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, intbuf)) {
+ return 0;
+ }
+ break;
+ case 'd':
+ sprintf(intbuf, "%ld", value);
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, intbuf)) {
+ return 0;
+ }
+ break;
+ case 'o':
+ sprintf(intbuf, "%lo", value);
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, intbuf)) {
+ return 0;
+ }
+ break;
+ case 't': /* new in rfc 3411 */
+ case 'a':
+ cnt = SNMP_MIN(width, ecp - cp);
+ if (!sprint_realloc_asciistring(buf, buf_len, out_len,
+ allow_realloc, cp, cnt))
+ return 0;
+ cp += cnt;
+ break;
+ default:
+ *out_len = saved_out_len;
+ if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ "(Bad hint ignored: ")
+ && snmp_cstrcat(buf, buf_len, out_len,
+ allow_realloc, saved_hint)
+ && snmp_cstrcat(buf, buf_len, out_len,
+ allow_realloc, ") ")) {
+ return sprint_realloc_octet_string(buf, buf_len,
+ out_len,
+ allow_realloc,
+ var, enums,
+ NULL, NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (cp < ecp && separ) {
+ while ((*out_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = separ;
+ (*out_len)++;
+ *(*buf + *out_len) = '\0';
+ }
+ repeat--;
+ }
+
+ if (term && cp < ecp) {
+ while ((*out_len + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = term;
+ (*out_len)++;
+ *(*buf + *out_len) = '\0';
+ }
+ }
+
+ if (units) {
+ return (snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, " ")
+ && snmp_cstrcat(buf, buf_len, out_len, allow_realloc, units));
+ }
+ if ((*out_len >= *buf_len) &&
+ !(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ *(*buf + *out_len) = '\0';
+
+ return 1;
+ }
+
+ output_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT);
+ if (0 == output_format) {
+ output_format = NETSNMP_STRING_OUTPUT_GUESS;
+ }
+ switch (output_format) {
+ case NETSNMP_STRING_OUTPUT_GUESS:
+ hex = 0;
+ for (cp = var->val.string, x = 0; x < (int) var->val_len; x++, cp++) {
+ if (!isprint(*cp) && !isspace(*cp)) {
+ hex = 1;
+ }
+ }
+ break;
+
+ case NETSNMP_STRING_OUTPUT_ASCII:
+ hex = 0;
+ break;
+
+ case NETSNMP_STRING_OUTPUT_HEX:
+ hex = 1;
+ break;
+ }
+
+ if (var->val_len == 0) {
+ return snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\"\"");
+ }
+
+ if (hex) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\"")) {
+ return 0;
+ }
+ } else {
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, "Hex-STRING: ")) {
+ return 0;
+ }
+ }
+
+ if (!sprint_realloc_hexstring(buf, buf_len, out_len, allow_realloc,
+ var->val.string, var->val_len)) {
+ return 0;
+ }
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\"")) {
+ return 0;
+ }
+ }
+ } else {
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ "STRING: ")) {
+ return 0;
+ }
+ }
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, "\"")) {
+ return 0;
+ }
+ if (!sprint_realloc_asciistring
+ (buf, buf_len, out_len, allow_realloc, var->val.string,
+ var->val_len)) {
+ return 0;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\"")) {
+ return 0;
+ }
+ }
+
+ if (units) {
+ return (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " ")
+ && snmp_cstrcat(buf, buf_len, out_len, allow_realloc, units));
+ }
+ return 1;
+}
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+
+/**
+ * Prints a float into a buffer.
+ *
+ * The variable var is encoded as a floating point value.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_float(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ if ((var->type != ASN_OPAQUE_FLOAT) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ "Wrong Type (should be Float): ")) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, "Opaque: Float: ")) {
+ return 0;
+ }
+ }
+
+
+ /*
+ * How much space needed for max. length float? 128 is overkill.
+ */
+
+ while ((*out_len + 128 + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ sprintf((char *) (*buf + *out_len), "%f", *var->val.floatVal);
+ *out_len += strlen((char *) (*buf + *out_len));
+
+ if (units) {
+ return (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " ")
+ && snmp_cstrcat(buf, buf_len, out_len, allow_realloc, units));
+ }
+ return 1;
+}
+
+
+/**
+ * Prints a double into a buffer.
+ *
+ * The variable var is encoded as a double precision floating point value.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_double(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ if ((var->type != ASN_OPAQUE_DOUBLE) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ if (snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc,
+ "Wrong Type (should be Double): ")) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, "Opaque: Float: ")) {
+ return 0;
+ }
+ }
+
+ /*
+ * How much space needed for max. length double? 128 is overkill.
+ */
+
+ while ((*out_len + 128 + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ sprintf((char *) (*buf + *out_len), "%f", *var->val.doubleVal);
+ *out_len += strlen((char *) (*buf + *out_len));
+
+ if (units) {
+ return (snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, " ")
+ && snmp_cstrcat(buf, buf_len, out_len, allow_realloc, units));
+ }
+ return 1;
+}
+
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+
+
+/**
+ * Prints a counter into a buffer.
+ *
+ * The variable var is encoded as a counter value.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_counter64(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ char a64buf[I64CHARSZ + 1];
+
+ if ((var->type != ASN_COUNTER64
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ && var->type != ASN_OPAQUE_COUNTER64
+ && var->type != ASN_OPAQUE_I64 && var->type != ASN_OPAQUE_U64
+#endif
+ ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ "Wrong Type (should be Counter64): ")) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ if (var->type != ASN_COUNTER64) {
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, "Opaque: ")) {
+ return 0;
+ }
+ }
+#endif
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ switch (var->type) {
+ case ASN_OPAQUE_U64:
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, "UInt64: ")) {
+ return 0;
+ }
+ break;
+ case ASN_OPAQUE_I64:
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, "Int64: ")) {
+ return 0;
+ }
+ break;
+ case ASN_COUNTER64:
+ case ASN_OPAQUE_COUNTER64:
+#endif
+ if (!snmp_cstrcat
+ (buf, buf_len, out_len, allow_realloc, "Counter64: ")) {
+ return 0;
+ }
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ }
+#endif
+ }
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ if (var->type == ASN_OPAQUE_I64) {
+ printI64(a64buf, var->val.counter64);
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, a64buf)) {
+ return 0;
+ }
+ } else {
+#endif
+ printU64(a64buf, var->val.counter64);
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, a64buf)) {
+ return 0;
+ }
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ }
+#endif
+
+ if (units) {
+ return (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " ")
+ && snmp_cstrcat(buf, buf_len, out_len, allow_realloc, units));
+ }
+ return 1;
+}
+
+
+/**
+ * Prints an object identifier into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_opaque(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ if ((var->type != ASN_OPAQUE
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ && var->type != ASN_OPAQUE_COUNTER64
+ && var->type != ASN_OPAQUE_U64
+ && var->type != ASN_OPAQUE_I64
+ && var->type != ASN_OPAQUE_FLOAT && var->type != ASN_OPAQUE_DOUBLE
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ "Wrong Type (should be Opaque): ")) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ switch (var->type) {
+ case ASN_OPAQUE_COUNTER64:
+ case ASN_OPAQUE_U64:
+ case ASN_OPAQUE_I64:
+ return sprint_realloc_counter64(buf, buf_len, out_len,
+ allow_realloc, var, enums, hint,
+ units);
+ break;
+
+ case ASN_OPAQUE_FLOAT:
+ return sprint_realloc_float(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+ break;
+
+ case ASN_OPAQUE_DOUBLE:
+ return sprint_realloc_double(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+ break;
+
+ case ASN_OPAQUE:
+#endif
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ u_char str[] = "OPAQUE: ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ }
+ if (!sprint_realloc_hexstring(buf, buf_len, out_len, allow_realloc,
+ var->val.string, var->val_len)) {
+ return 0;
+ }
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ }
+#endif
+ if (units) {
+ return (snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " ")
+ && snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) units));
+ }
+ return 1;
+}
+
+
+/**
+ * Prints an object identifier into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_object_identifier(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ int buf_overflow = 0;
+
+ if ((var->type != ASN_OBJECT_ID) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] =
+ "Wrong Type (should be OBJECT IDENTIFIER): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ u_char str[] = "OID: ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ }
+
+ netsnmp_sprint_realloc_objid_tree(buf, buf_len, out_len, allow_realloc,
+ &buf_overflow,
+ (oid *) (var->val.objid),
+ var->val_len / sizeof(oid));
+
+ if (buf_overflow) {
+ return 0;
+ }
+
+ if (units) {
+ return (snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " ")
+ && snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) units));
+ }
+ return 1;
+}
+
+
+
+/**
+ * Prints a timetick variable into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_timeticks(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ char timebuf[40];
+
+ if ((var->type != ASN_TIMETICKS) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] = "Wrong Type (should be Timeticks): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS)) {
+ char str[32];
+ sprintf(str, "%lu", *(u_long *) var->val.integer);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) str)) {
+ return 0;
+ }
+ return 1;
+ }
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ char str[32];
+ sprintf(str, "Timeticks: (%lu) ", *(u_long *) var->val.integer);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) str)) {
+ return 0;
+ }
+ }
+ uptimeString(*(u_long *) (var->val.integer), timebuf, sizeof(timebuf));
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) timebuf)) {
+ return 0;
+ }
+ if (units) {
+ return (snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " ")
+ && snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) units));
+ }
+ return 1;
+}
+
+
+/**
+ * Prints an integer according to the hint into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param val The variable to encode.
+ * @param decimaltype The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may _NOT_ be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_hinted_integer(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ long val, const char decimaltype,
+ const char *hint, const char *units)
+{
+ char fmt[10] = "%l@", tmp[256];
+ int shift, len;
+
+ if (hint[1] == '-') {
+ shift = atoi(hint + 2);
+ } else {
+ shift = 0;
+ }
+
+ if (hint[0] == 'd') {
+ /*
+ * We might *actually* want a 'u' here.
+ */
+ fmt[2] = decimaltype;
+ } else {
+ /*
+ * DISPLAY-HINT character is 'b', 'o', or 'x'.
+ */
+ fmt[2] = hint[0];
+ }
+
+ sprintf(tmp, fmt, val);
+ if (shift != 0) {
+ len = strlen(tmp);
+ if (shift <= len) {
+ tmp[len + 1] = 0;
+ while (shift--) {
+ tmp[len] = tmp[len - 1];
+ len--;
+ }
+ tmp[len] = '.';
+ } else {
+ tmp[shift + 1] = 0;
+ while (shift) {
+ if (len-- > 0) {
+ tmp[shift] = tmp[len];
+ } else {
+ tmp[shift] = '0';
+ }
+ shift--;
+ }
+ tmp[0] = '.';
+ }
+ }
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc, (u_char *)tmp);
+}
+
+
+/**
+ * Prints an integer into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_integer(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ char *enum_string = NULL;
+
+ if ((var->type != ASN_INTEGER) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] = "Wrong Type (should be INTEGER): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+ for (; enums; enums = enums->next) {
+ if (enums->value == *var->val.integer) {
+ enum_string = enums->label;
+ break;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "INTEGER: ")) {
+ return 0;
+ }
+ }
+
+ if (enum_string == NULL ||
+ netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM)) {
+ if (hint) {
+ if (!(sprint_realloc_hinted_integer(buf, buf_len, out_len,
+ allow_realloc,
+ *var->val.integer, 'd',
+ hint, units))) {
+ return 0;
+ }
+ } else {
+ char str[32];
+ sprintf(str, "%ld", *var->val.integer);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) str)) {
+ return 0;
+ }
+ }
+ } else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) enum_string)) {
+ return 0;
+ }
+ } else {
+ char str[32];
+ sprintf(str, "(%ld)", *var->val.integer);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) enum_string)) {
+ return 0;
+ }
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) str)) {
+ return 0;
+ }
+ }
+
+ if (units) {
+ return (snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " ")
+ && snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) units));
+ }
+ return 1;
+}
+
+
+/**
+ * Prints an unsigned integer into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_uinteger(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ char *enum_string = NULL;
+
+ if ((var->type != ASN_UINTEGER) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] = "Wrong Type (should be UInteger32): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ for (; enums; enums = enums->next) {
+ if (enums->value == *var->val.integer) {
+ enum_string = enums->label;
+ break;
+ }
+ }
+
+ if (enum_string == NULL ||
+ netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM)) {
+ if (hint) {
+ if (!(sprint_realloc_hinted_integer(buf, buf_len, out_len,
+ allow_realloc,
+ *var->val.integer, 'u',
+ hint, units))) {
+ return 0;
+ }
+ } else {
+ char str[32];
+ sprintf(str, "%lu", *var->val.integer);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) str)) {
+ return 0;
+ }
+ }
+ } else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) enum_string)) {
+ return 0;
+ }
+ } else {
+ char str[32];
+ sprintf(str, "(%lu)", *var->val.integer);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) enum_string)) {
+ return 0;
+ }
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) str)) {
+ return 0;
+ }
+ }
+
+ if (units) {
+ return (snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " ")
+ && snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) units));
+ }
+ return 1;
+}
+
+
+/**
+ * Prints a gauge value into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_gauge(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ char tmp[32];
+
+ if ((var->type != ASN_GAUGE) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] =
+ "Wrong Type (should be Gauge32 or Unsigned32): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ u_char str[] = "Gauge32: ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ }
+ if (hint) {
+ if (!sprint_realloc_hinted_integer(buf, buf_len, out_len,
+ allow_realloc,
+ *var->val.integer, 'u', hint,
+ units)) {
+ return 0;
+ }
+ } else {
+ sprintf(tmp, "%u", (unsigned int)(*var->val.integer & 0xffffffff));
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) {
+ return 0;
+ }
+ }
+ if (units) {
+ return (snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " ")
+ && snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) units));
+ }
+ return 1;
+}
+
+
+/**
+ * Prints a counter value into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_counter(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ char tmp[32];
+
+ if ((var->type != ASN_COUNTER) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] = "Wrong Type (should be Counter32): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ u_char str[] = "Counter32: ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ }
+ sprintf(tmp, "%u", (unsigned int)(*var->val.integer & 0xffffffff));
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) {
+ return 0;
+ }
+ if (units) {
+ return (snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " ")
+ && snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) units));
+ }
+ return 1;
+}
+
+
+/**
+ * Prints a network address into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_networkaddress(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums, const char *hint,
+ const char *units)
+{
+ size_t i;
+
+ if ((var->type != ASN_IPADDRESS) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] = "Wrong Type (should be NetworkAddress): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ u_char str[] = "Network Address: ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ }
+
+ while ((*out_len + (var->val_len * 3) + 2) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ for (i = 0; i < var->val_len; i++) {
+ sprintf((char *) (*buf + *out_len), "%02X", var->val.string[i]);
+ *out_len += 2;
+ if (i < var->val_len - 1) {
+ *(*buf + *out_len) = ':';
+ (*out_len)++;
+ }
+ }
+ return 1;
+}
+
+
+/**
+ * Prints an ip-address into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_ipaddress(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ u_char *ip = var->val.string;
+
+ if ((var->type != ASN_IPADDRESS) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] = "Wrong Type (should be IpAddress): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ u_char str[] = "IpAddress: ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ }
+ while ((*out_len + 17) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ if (ip)
+ sprintf((char *) (*buf + *out_len), "%d.%d.%d.%d",
+ ip[0], ip[1], ip[2], ip[3]);
+ *out_len += strlen((char *) (*buf + *out_len));
+ return 1;
+}
+
+
+/**
+ * Prints a null value into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_null(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ if ((var->type != ASN_NULL) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] = "Wrong Type (should be NULL): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ } else {
+ u_char str[] = "NULL";
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc, str);
+ }
+}
+
+
+/**
+ * Prints a bit string into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_bitstring(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ int len, bit;
+ u_char *cp;
+ char *enum_string;
+
+ if ((var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] = "Wrong Type (should be BITS): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ u_char str[] = "\"";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ } else {
+ u_char str[] = "BITS: ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ }
+ if (!sprint_realloc_hexstring(buf, buf_len, out_len, allow_realloc,
+ var->val.bitstring, var->val_len)) {
+ return 0;
+ }
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ u_char str[] = "\"";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ } else {
+ cp = var->val.bitstring;
+ for (len = 0; len < (int) var->val_len; len++) {
+ for (bit = 0; bit < 8; bit++) {
+ if (*cp & (0x80 >> bit)) {
+ enum_string = NULL;
+ for (; enums; enums = enums->next) {
+ if (enums->value == (len * 8) + bit) {
+ enum_string = enums->label;
+ break;
+ }
+ }
+ if (enum_string == NULL ||
+ netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM)) {
+ char str[32];
+ sprintf(str, "%d ", (len * 8) + bit);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) str)) {
+ return 0;
+ }
+ } else {
+ char str[32];
+ sprintf(str, "(%d) ", (len * 8) + bit);
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) enum_string)) {
+ return 0;
+ }
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) str)) {
+ return 0;
+ }
+ }
+ }
+ }
+ cp++;
+ }
+ }
+ return 1;
+}
+
+int
+sprint_realloc_nsapaddress(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums, const char *hint,
+ const char *units)
+{
+ if ((var->type != ASN_NSAP) &&
+ (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+ u_char str[] = "Wrong Type (should be NsapAddress): ";
+ if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, var, NULL, NULL,
+ NULL);
+ } else {
+ return 0;
+ }
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ u_char str[] = "NsapAddress: ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+ return 0;
+ }
+ }
+
+ return sprint_realloc_hexstring(buf, buf_len, out_len, allow_realloc,
+ var->val.string, var->val_len);
+}
+
+
+/**
+ * Fallback routine for a bad type, prints "Variable has bad type" into a buffer.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_badtype(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ u_char str[] = "Variable has bad type";
+
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc, str);
+}
+
+
+
+/**
+ * Universal print routine, prints a variable into a buffer according to the variable
+ * type.
+ *
+ * If allow_realloc is true the buffer will be (re)allocated to fit in the
+ * needed size. (Note: *buf may change due to this.)
+ *
+ * @param buf Address of the buffer to print to.
+ * @param buf_len Address to an integer containing the size of buf.
+ * @param out_len Incremented by the number of characters printed.
+ * @param allow_realloc if not zero reallocate the buffer to fit the
+ * needed size.
+ * @param var The variable to encode.
+ * @param enums The enumeration ff this variable is enumerated. may be NULL.
+ * @param hint Contents of the DISPLAY-HINT clause of the MIB.
+ * See RFC 1903 Section 3.1 for details. may be NULL.
+ * @param units Contents of the UNITS clause of the MIB. may be NULL.
+ *
+ * @return 1 on success, or 0 on failure (out of memory, or buffer to
+ * small when not allowed to realloc.)
+ */
+int
+sprint_realloc_by_type(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ DEBUGMSGTL(("output", "sprint_by_type, type %d\n", var->type));
+
+ switch (var->type) {
+ case ASN_INTEGER:
+ return sprint_realloc_integer(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+ case ASN_OCTET_STR:
+ return sprint_realloc_octet_string(buf, buf_len, out_len,
+ allow_realloc, var, enums, hint,
+ units);
+ case ASN_BIT_STR:
+ return sprint_realloc_bitstring(buf, buf_len, out_len,
+ allow_realloc, var, enums, hint,
+ units);
+ case ASN_OPAQUE:
+ return sprint_realloc_opaque(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+ case ASN_OBJECT_ID:
+ return sprint_realloc_object_identifier(buf, buf_len, out_len,
+ allow_realloc, var, enums,
+ hint, units);
+ case ASN_TIMETICKS:
+ return sprint_realloc_timeticks(buf, buf_len, out_len,
+ allow_realloc, var, enums, hint,
+ units);
+ case ASN_GAUGE:
+ return sprint_realloc_gauge(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+ case ASN_COUNTER:
+ return sprint_realloc_counter(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+ case ASN_IPADDRESS:
+ return sprint_realloc_ipaddress(buf, buf_len, out_len,
+ allow_realloc, var, enums, hint,
+ units);
+ case ASN_NULL:
+ return sprint_realloc_null(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+ case ASN_UINTEGER:
+ return sprint_realloc_uinteger(buf, buf_len, out_len,
+ allow_realloc, var, enums, hint,
+ units);
+ case ASN_COUNTER64:
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_U64:
+ case ASN_OPAQUE_I64:
+ case ASN_OPAQUE_COUNTER64:
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ return sprint_realloc_counter64(buf, buf_len, out_len,
+ allow_realloc, var, enums, hint,
+ units);
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_FLOAT:
+ return sprint_realloc_float(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+ case ASN_OPAQUE_DOUBLE:
+ return sprint_realloc_double(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ default:
+ DEBUGMSGTL(("sprint_by_type", "bad type: %d\n", var->type));
+ return sprint_realloc_badtype(buf, buf_len, out_len, allow_realloc,
+ var, enums, hint, units);
+ }
+}
+
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+/**
+ * Retrieves the tree head.
+ *
+ * @return the tree head.
+ */
+struct tree *
+get_tree_head(void)
+{
+ return (tree_head);
+}
+
+static char *confmibdir = NULL;
+static char *confmibs = NULL;
+
+static void
+handle_mibdirs_conf(const char *token, char *line)
+{
+ char *ctmp;
+
+ if (confmibdir) {
+ if ((*line == '+') || (*line == '-')) {
+ ctmp = (char *) malloc(strlen(confmibdir) + strlen(line) + 2);
+ if (!ctmp) {
+ DEBUGMSGTL(("read_config:initmib",
+ "mibdir conf malloc failed"));
+ return;
+ }
+ if(*line++ == '+')
+ sprintf(ctmp, "%s%c%s", confmibdir, ENV_SEPARATOR_CHAR, line);
+ else
+ sprintf(ctmp, "%s%c%s", line, ENV_SEPARATOR_CHAR, confmibdir);
+ } else {
+ ctmp = strdup(line);
+ if (!ctmp) {
+ DEBUGMSGTL(("read_config:initmib", "mibs conf malloc failed"));
+ return;
+ }
+ }
+ SNMP_FREE(confmibdir);
+ } else {
+ ctmp = strdup(line);
+ if (!ctmp) {
+ DEBUGMSGTL(("read_config:initmib", "mibs conf malloc failed"));
+ return;
+ }
+ }
+ confmibdir = ctmp;
+ DEBUGMSGTL(("read_config:initmib", "using mibdirs: %s\n", confmibdir));
+}
+
+static void
+handle_mibs_conf(const char *token, char *line)
+{
+ char *ctmp;
+
+ if (confmibs) {
+ if ((*line == '+') || (*line == '-')) {
+ ctmp = (char *) malloc(strlen(confmibs) + strlen(line) + 2);
+ if (!ctmp) {
+ DEBUGMSGTL(("read_config:initmib", "mibs conf malloc failed"));
+ return;
+ }
+ if(*line++ == '+')
+ sprintf(ctmp, "%s%c%s", confmibs, ENV_SEPARATOR_CHAR, line);
+ else
+ sprintf(ctmp, "%s%c%s", line, ENV_SEPARATOR_CHAR, confmibdir);
+ } else {
+ ctmp = strdup(line);
+ if (!ctmp) {
+ DEBUGMSGTL(("read_config:initmib", "mibs conf malloc failed"));
+ return;
+ }
+ }
+ SNMP_FREE(confmibs);
+ } else {
+ ctmp = strdup(line);
+ if (!ctmp) {
+ DEBUGMSGTL(("read_config:initmib", "mibs conf malloc failed"));
+ return;
+ }
+ }
+ confmibs = ctmp;
+ DEBUGMSGTL(("read_config:initmib", "using mibs: %s\n", confmibs));
+}
+
+
+static void
+handle_mibfile_conf(const char *token, char *line)
+{
+ DEBUGMSGTL(("read_config:initmib", "reading mibfile: %s\n", line));
+ read_mib(line);
+}
+#endif
+
+static void
+handle_print_numeric(const char *token, char *line)
+{
+ const char *value;
+ char *st;
+
+ value = strtok_r(line, " \t\n", &st);
+ if (value && (
+ (strcasecmp(value, "yes") == 0) ||
+ (strcasecmp(value, "true") == 0) ||
+ (*value == '1') )) {
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+ }
+}
+
+char *
+snmp_out_toggle_options(char *options)
+{
+ while (*options) {
+ switch (*options++) {
+ case '0':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT);
+ break;
+ case 'a':
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT,
+ NETSNMP_STRING_OUTPUT_ASCII);
+ break;
+ case 'b':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS);
+ break;
+ case 'e':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM);
+ break;
+ case 'E':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_ESCAPE_QUOTES);
+ break;
+ case 'f':
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_FULL);
+ break;
+ case 'n':
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_NUMERIC);
+ break;
+ case 'q':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT);
+ break;
+ case 'Q':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT, 1);
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT);
+ break;
+ case 's':
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_SUFFIX);
+ break;
+ case 'S':
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_MODULE);
+ break;
+ case 't':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS);
+ break;
+ case 'T':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_HEX_TEXT);
+ break;
+ case 'u':
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_UCD);
+ break;
+ case 'U':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_PRINT_UNITS);
+ break;
+ case 'v':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_BARE_VALUE);
+ break;
+ case 'x':
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT,
+ NETSNMP_STRING_OUTPUT_HEX);
+ break;
+ case 'X':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_EXTENDED_INDEX);
+ break;
+ default:
+ return options - 1;
+ }
+ }
+ return NULL;
+}
+
+void
+snmp_out_toggle_options_usage(const char *lead, FILE * outf)
+{
+ fprintf(outf, "%s0: print leading 0 for single-digit hex characters\n", lead);
+ fprintf(outf, "%sa: print all strings in ascii format\n", lead);
+ fprintf(outf, "%sb: do not break OID indexes down\n", lead);
+ fprintf(outf, "%se: print enums numerically\n", lead);
+ fprintf(outf, "%sE: escape quotes in string indices\n", lead);
+ fprintf(outf, "%sf: print full OIDs on output\n", lead);
+ fprintf(outf, "%sn: print OIDs numerically\n", lead);
+ fprintf(outf, "%sq: quick print for easier parsing\n", lead);
+ fprintf(outf, "%sQ: quick print with equal-signs\n", lead); /* @@JDW */
+ fprintf(outf, "%ss: print only last symbolic element of OID\n", lead);
+ fprintf(outf, "%sS: print MIB module-id plus last element\n", lead);
+ fprintf(outf, "%st: print timeticks unparsed as numeric integers\n",
+ lead);
+ fprintf(outf,
+ "%sT: print human-readable text along with hex strings\n",
+ lead);
+ fprintf(outf, "%su: print OIDs using UCD-style prefix suppression\n",
+ lead);
+ fprintf(outf, "%sU: don't print units\n", lead);
+ fprintf(outf, "%sv: print values only (not OID = value)\n", lead);
+ fprintf(outf, "%sx: print all strings in hex format\n", lead);
+ fprintf(outf, "%sX: extended index format\n", lead);
+}
+
+char *
+snmp_in_options(char *optarg, int argc, char *const *argv)
+{
+ char *cp;
+
+ for (cp = optarg; *cp; cp++) {
+ switch (*cp) {
+ case 'b':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_REGEX_ACCESS);
+ break;
+ case 'R':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_RANDOM_ACCESS);
+ break;
+ case 'r':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_CHECK_RANGE);
+ break;
+ case 'h':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NO_DISPLAY_HINT);
+ break;
+ case 'u':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_READ_UCD_STYLE_OID);
+ break;
+ case 's':
+ /* What if argc/argv are null ? */
+ if (!*(++cp))
+ cp = argv[optind++];
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OIDSUFFIX,
+ cp);
+ return NULL;
+
+ case 'S':
+ /* What if argc/argv are null ? */
+ if (!*(++cp))
+ cp = argv[optind++];
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OIDPREFIX,
+ cp);
+ return NULL;
+
+ default:
+ /*
+ * Here? Or in snmp_parse_args?
+ snmp_log(LOG_ERR, "Unknown input option passed to -I: %c.\n", *cp);
+ */
+ return cp;
+ }
+ }
+ return NULL;
+}
+
+char *
+snmp_in_toggle_options(char *options)
+{
+ return snmp_in_options( options, 0, NULL );
+}
+
+
+/**
+ * Prints out a help usage for the in* toggle options.
+ *
+ * @param lead The lead to print for every line.
+ * @param outf The file descriptor to write to.
+ *
+ */
+void
+snmp_in_toggle_options_usage(const char *lead, FILE * outf)
+{
+ fprintf(outf, "%sb: do best/regex matching to find a MIB node\n", lead);
+ fprintf(outf, "%sh: don't apply DISPLAY-HINTs\n", lead);
+ fprintf(outf, "%sr: do not check values for range/type legality\n", lead);
+ fprintf(outf, "%sR: do random access to OID labels\n", lead);
+ fprintf(outf,
+ "%su: top-level OIDs must have '.' prefix (UCD-style)\n", lead);
+ fprintf(outf,
+ "%ss SUFFIX: Append all textual OIDs with SUFFIX before parsing\n",
+ lead);
+ fprintf(outf,
+ "%sS PREFIX: Prepend all textual OIDs with PREFIX before parsing\n",
+ lead);
+}
+
+/***
+ *
+ */
+void
+register_mib_handlers(void)
+{
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ register_prenetsnmp_mib_handler("snmp", "mibdirs",
+ handle_mibdirs_conf, NULL,
+ "[mib-dirs|+mib-dirs|-mib-dirs]");
+ register_prenetsnmp_mib_handler("snmp", "mibs",
+ handle_mibs_conf, NULL,
+ "[mib-tokens|+mib-tokens]");
+ register_config_handler("snmp", "mibfile",
+ handle_mibfile_conf, NULL, "mibfile-to-read");
+ /*
+ * register the snmp.conf configuration handlers for default
+ * parsing behaviour
+ */
+
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "showMibErrors",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_ERRORS);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "commentToEOL", /* Describes actual behaviour */
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_COMMENT_TERM);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "strictCommentTerm", /* Backward compatibility */
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_COMMENT_TERM);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "mibAllowUnderline",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_PARSE_LABEL);
+ netsnmp_ds_register_premib(ASN_INTEGER, "snmp", "mibWarningLevel",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_WARNINGS);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "mibReplaceWithLatest",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_REPLACE);
+#endif
+
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "printNumericEnums",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM);
+ register_prenetsnmp_mib_handler("snmp", "printNumericOids",
+ handle_print_numeric, NULL, "(1|yes|true|0|no|false)");
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "escapeQuotes",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_ESCAPE_QUOTES);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "dontBreakdownOids",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "quickPrinting",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "numericTimeticks",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS);
+ netsnmp_ds_register_premib(ASN_INTEGER, "snmp", "oidOutputFormat",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ netsnmp_ds_register_premib(ASN_INTEGER, "snmp", "suffixPrinting",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "extendedIndex",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_EXTENDED_INDEX);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "printHexText",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_HEX_TEXT);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "printValueOnly",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_BARE_VALUE);
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "dontPrintUnits",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_PRINT_UNITS);
+ netsnmp_ds_register_premib(ASN_INTEGER, "snmp", "hexOutputLength",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH);
+}
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+/*
+ * function : netsnmp_set_mib_directory
+ * - This function sets the string of the directories
+ * from which the MIB modules will be searched or
+ * loaded.
+ * arguments: const char *dir, which are the directories
+ * from which the MIB modules will be searched or
+ * loaded.
+ * returns : -
+ */
+void
+netsnmp_set_mib_directory(const char *dir)
+{
+ const char *newdir;
+ char *olddir, *tmpdir = NULL;
+
+ DEBUGTRACE;
+ if (NULL == dir) {
+ return;
+ }
+
+ olddir = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIBDIRS);
+ if (olddir) {
+ if ((*dir == '+') || (*dir == '-')) {
+ /** New dir starts with '+', thus we add it. */
+ tmpdir = (char *)malloc(strlen(dir) + strlen(olddir) + 2);
+ if (!tmpdir) {
+ DEBUGMSGTL(("read_config:initmib", "set mibdir malloc failed"));
+ return;
+ }
+ if (*dir++ == '+')
+ sprintf(tmpdir, "%s%c%s", olddir, ENV_SEPARATOR_CHAR, dir);
+ else
+ sprintf(tmpdir, "%s%c%s", dir, ENV_SEPARATOR_CHAR, olddir);
+ newdir = tmpdir;
+ } else {
+ newdir = dir;
+ }
+ } else {
+ /** If dir starts with '+' skip '+' it. */
+ newdir = ((*dir == '+') ? ++dir : dir);
+ }
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS,
+ newdir);
+
+ /** set_string calls strdup, so if we allocated memory, free it */
+ if (tmpdir == newdir) {
+ SNMP_FREE(tmpdir);
+ }
+}
+
+/*
+ * function : netsnmp_get_mib_directory
+ * - This function returns a string of the directories
+ * from which the MIB modules will be searched or
+ * loaded.
+ * If the value still does not exists, it will be made
+ * from the evironment variable 'MIBDIRS' and/or the
+ * default.
+ * arguments: -
+ * returns : char * of the directories in which the MIB modules
+ * will be searched/loaded.
+ */
+
+char *
+netsnmp_get_mib_directory(void)
+{
+ char *dir;
+
+ DEBUGTRACE;
+ dir = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS);
+ if (dir == NULL) {
+ DEBUGMSGTL(("get_mib_directory", "no mib directories set\n"));
+
+ /** Check if the environment variable is set */
+ dir = netsnmp_getenv("MIBDIRS");
+ if (dir == NULL) {
+ DEBUGMSGTL(("get_mib_directory", "no mib directories set by environment\n"));
+ /** Not set use hard coded path */
+ if (confmibdir == NULL) {
+ DEBUGMSGTL(("get_mib_directory", "no mib directories set by config\n"));
+ netsnmp_set_mib_directory(NETSNMP_DEFAULT_MIBDIRS);
+ }
+ else if ((*confmibdir == '+') || (*confmibdir == '-')) {
+ DEBUGMSGTL(("get_mib_directory", "mib directories set by config (but added)\n"));
+ netsnmp_set_mib_directory(NETSNMP_DEFAULT_MIBDIRS);
+ netsnmp_set_mib_directory(confmibdir);
+ }
+ else {
+ DEBUGMSGTL(("get_mib_directory", "mib directories set by config\n"));
+ netsnmp_set_mib_directory(confmibdir);
+ }
+ } else if ((*dir == '+') || (*dir == '-')) {
+ DEBUGMSGTL(("get_mib_directory", "mib directories set by environment (but added)\n"));
+ netsnmp_set_mib_directory(NETSNMP_DEFAULT_MIBDIRS);
+ netsnmp_set_mib_directory(dir);
+ } else {
+ DEBUGMSGTL(("get_mib_directory", "mib directories set by environment\n"));
+ netsnmp_set_mib_directory(dir);
+ }
+ dir = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS);
+ }
+ DEBUGMSGTL(("get_mib_directory", "mib directories set '%s'\n", dir));
+ return(dir);
+}
+
+/*
+ * function : netsnmp_fixup_mib_directory
+ * arguments: -
+ * returns : -
+ */
+void
+netsnmp_fixup_mib_directory(void)
+{
+ char *homepath = netsnmp_getenv("HOME");
+ char *mibpath = netsnmp_get_mib_directory();
+ char *oldmibpath = NULL;
+ char *ptr_home;
+ char *new_mibpath;
+
+ DEBUGTRACE;
+ if (homepath && mibpath) {
+ DEBUGMSGTL(("fixup_mib_directory", "mib directories '%s'\n", mibpath));
+ while ((ptr_home = strstr(mibpath, "$HOME"))) {
+ new_mibpath = (char *)malloc(strlen(mibpath) - strlen("$HOME") +
+ strlen(homepath)+1);
+ if (new_mibpath) {
+ *ptr_home = 0; /* null out the spot where we stop copying */
+ sprintf(new_mibpath, "%s%s%s", mibpath, homepath,
+ ptr_home + strlen("$HOME"));
+ /** swap in the new value and repeat */
+ mibpath = new_mibpath;
+ if (oldmibpath != NULL) {
+ SNMP_FREE(oldmibpath);
+ }
+ oldmibpath = new_mibpath;
+ } else {
+ break;
+ }
+ }
+
+ netsnmp_set_mib_directory(mibpath);
+
+ /* The above copies the mibpath for us, so... */
+
+ if (oldmibpath != NULL) {
+ SNMP_FREE(oldmibpath);
+ }
+
+ }
+
+}
+
+/**
+ * Initialises the mib reader.
+ *
+ * Reads in all settings from the environment.
+ */
+void
+netsnmp_init_mib(void)
+{
+ const char *prefix;
+ char *env_var, *entry;
+ PrefixListPtr pp = &mib_prefixes[0];
+ char *st = NULL;
+
+ if (Mib)
+ return;
+ netsnmp_init_mib_internals();
+
+ /*
+ * Initialise the MIB directory/ies
+ */
+ netsnmp_fixup_mib_directory();
+ env_var = strdup(netsnmp_get_mib_directory());
+ netsnmp_mibindex_load();
+
+ DEBUGMSGTL(("init_mib",
+ "Seen MIBDIRS: Looking in '%s' for mib dirs ...\n",
+ env_var));
+
+ entry = strtok_r(env_var, ENV_SEPARATOR, &st);
+ while (entry) {
+ add_mibdir(entry);
+ entry = strtok_r(NULL, ENV_SEPARATOR, &st);
+ }
+ SNMP_FREE(env_var);
+
+ env_var = netsnmp_getenv("MIBFILES");
+ if (env_var != NULL) {
+ if (*env_var == '+')
+ entry = strtok_r(env_var+1, ENV_SEPARATOR, &st);
+ else
+ entry = strtok_r(env_var, ENV_SEPARATOR, &st);
+ while (entry) {
+ add_mibfile(entry, NULL, NULL);
+ entry = strtok_r(NULL, ENV_SEPARATOR, &st);
+ }
+ }
+
+ netsnmp_init_mib_internals();
+
+ /*
+ * Read in any modules or mibs requested
+ */
+
+ env_var = netsnmp_getenv("MIBS");
+ if (env_var == NULL) {
+ if (confmibs != NULL)
+ env_var = strdup(confmibs);
+ else
+ env_var = strdup(NETSNMP_DEFAULT_MIBS);
+ } else {
+ env_var = strdup(env_var);
+ }
+ if (env_var && ((*env_var == '+') || (*env_var == '-'))) {
+ entry =
+ (char *) malloc(strlen(NETSNMP_DEFAULT_MIBS) + strlen(env_var) + 2);
+ if (!entry) {
+ DEBUGMSGTL(("init_mib", "env mibs malloc failed"));
+ SNMP_FREE(env_var);
+ return;
+ } else {
+ if (*env_var == '+')
+ sprintf(entry, "%s%c%s", NETSNMP_DEFAULT_MIBS, ENV_SEPARATOR_CHAR,
+ env_var+1);
+ else
+ sprintf(entry, "%s%c%s", env_var+1, ENV_SEPARATOR_CHAR,
+ NETSNMP_DEFAULT_MIBS );
+ }
+ SNMP_FREE(env_var);
+ env_var = entry;
+ }
+
+ DEBUGMSGTL(("init_mib",
+ "Seen MIBS: Looking in '%s' for mib files ...\n",
+ env_var));
+ entry = strtok_r(env_var, ENV_SEPARATOR, &st);
+ while (entry) {
+ if (strcasecmp(entry, DEBUG_ALWAYS_TOKEN) == 0) {
+ read_all_mibs();
+ } else if (strstr(entry, "/") != NULL) {
+ read_mib(entry);
+ } else {
+ netsnmp_read_module(entry);
+ }
+ entry = strtok_r(NULL, ENV_SEPARATOR, &st);
+ }
+ adopt_orphans();
+ SNMP_FREE(env_var);
+
+ env_var = netsnmp_getenv("MIBFILES");
+ if (env_var != NULL) {
+ if ((*env_var == '+') || (*env_var == '-')) {
+#ifdef NETSNMP_DEFAULT_MIBFILES
+ entry =
+ (char *) malloc(strlen(NETSNMP_DEFAULT_MIBFILES) +
+ strlen(env_var) + 2);
+ if (!entry) {
+ DEBUGMSGTL(("init_mib", "env mibfiles malloc failed"));
+ } else {
+ if (*env_var++ == '+')
+ sprintf(entry, "%s%c%s", NETSNMP_DEFAULT_MIBFILES, ENV_SEPARATOR_CHAR,
+ env_var );
+ else
+ sprintf(entry, "%s%c%s", env_var, ENV_SEPARATOR_CHAR,
+ NETSNMP_DEFAULT_MIBFILES );
+ }
+ SNMP_FREE(env_var);
+ env_var = entry;
+#else
+ env_var = strdup(env_var + 1);
+#endif
+ } else {
+ env_var = strdup(env_var);
+ }
+ } else {
+#ifdef NETSNMP_DEFAULT_MIBFILES
+ env_var = strdup(NETSNMP_DEFAULT_MIBFILES);
+#endif
+ }
+
+ if (env_var != NULL) {
+ DEBUGMSGTL(("init_mib",
+ "Seen MIBFILES: Looking in '%s' for mib files ...\n",
+ env_var));
+ entry = strtok_r(env_var, ENV_SEPARATOR, &st);
+ while (entry) {
+ read_mib(entry);
+ entry = strtok_r(NULL, ENV_SEPARATOR, &st);
+ }
+ SNMP_FREE(env_var);
+ }
+
+ prefix = netsnmp_getenv("PREFIX");
+
+ if (!prefix)
+ prefix = Standard_Prefix;
+
+ Prefix = (char *) malloc(strlen(prefix) + 2);
+ if (!Prefix)
+ DEBUGMSGTL(("init_mib", "Prefix malloc failed"));
+ else
+ strcpy(Prefix, prefix);
+
+ DEBUGMSGTL(("init_mib",
+ "Seen PREFIX: Looking in '%s' for prefix ...\n", Prefix));
+
+ /*
+ * remove trailing dot
+ */
+ if (Prefix) {
+ env_var = &Prefix[strlen(Prefix) - 1];
+ if (*env_var == '.')
+ *env_var = '\0';
+ }
+
+ pp->str = Prefix; /* fixup first mib_prefix entry */
+ /*
+ * now that the list of prefixes is built, save each string length.
+ */
+ while (pp->str) {
+ pp->len = strlen(pp->str);
+ pp++;
+ }
+
+ Mib = tree_head; /* Backwards compatibility */
+ tree_top = (struct tree *) calloc(1, sizeof(struct tree));
+ /*
+ * XX error check ?
+ */
+ if (tree_top) {
+ tree_top->label = strdup("(top)");
+ tree_top->child_list = tree_head;
+ }
+}
+
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+void
+init_mib(void)
+{
+ netsnmp_init_mib();
+}
+#endif
+
+
+/*
+ * Handle MIB indexes centrally
+ */
+static int _mibindex = 0; /* Last index in use */
+static int _mibindex_max = 0; /* Size of index array */
+char **_mibindexes = NULL;
+
+int _mibindex_add( const char *dirname, int i );
+void
+netsnmp_mibindex_load( void )
+{
+ DIR *dir;
+ struct dirent *file;
+ FILE *fp;
+ char tmpbuf[ 300];
+ char tmpbuf2[300];
+ int i;
+ char *cp;
+
+ /*
+ * Open the MIB index directory, or create it (empty)
+ */
+ snprintf( tmpbuf, sizeof(tmpbuf), "%s/mib_indexes",
+ get_persistent_directory());
+ tmpbuf[sizeof(tmpbuf)-1] = 0;
+ dir = opendir( tmpbuf );
+ if ( dir == NULL ) {
+ DEBUGMSGTL(("mibindex", "load: (new)\n"));
+ mkdirhier( tmpbuf, NETSNMP_AGENT_DIRECTORY_MODE, 0);
+ return;
+ }
+
+ /*
+ * Create a list of which directory each file refers to
+ */
+ while ((file = readdir( dir ))) {
+ if ( !isdigit((unsigned char)(file->d_name[0])))
+ continue;
+ i = atoi( file->d_name );
+
+ snprintf( tmpbuf, sizeof(tmpbuf), "%s/mib_indexes/%d",
+ get_persistent_directory(), i );
+ tmpbuf[sizeof(tmpbuf)-1] = 0;
+ fp = fopen( tmpbuf, "r" );
+ if (!fp)
+ continue;
+ cp = fgets( tmpbuf2, sizeof(tmpbuf2), fp );
+ if ( !cp ) {
+ DEBUGMSGTL(("mibindex", "Empty MIB index (%d)\n", i));
+ fclose(fp);
+ continue;
+ }
+ tmpbuf2[strlen(tmpbuf2)-1] = 0;
+ DEBUGMSGTL(("mibindex", "load: (%d) %s\n", i, tmpbuf2));
+ (void)_mibindex_add( tmpbuf2+4, i ); /* Skip 'DIR ' */
+ fclose( fp );
+ }
+ closedir( dir );
+}
+
+char *
+netsnmp_mibindex_lookup( const char *dirname )
+{
+ int i;
+ static char tmpbuf[300];
+
+ for (i=0; i<_mibindex; i++) {
+ if ( _mibindexes[i] &&
+ strcmp( _mibindexes[i], dirname ) == 0) {
+ snprintf(tmpbuf, sizeof(tmpbuf), "%s/mib_indexes/%d",
+ get_persistent_directory(), i);
+ tmpbuf[sizeof(tmpbuf)-1] = 0;
+ DEBUGMSGTL(("mibindex", "lookup: %s (%d) %s\n", dirname, i, tmpbuf ));
+ return tmpbuf;
+ }
+ }
+ DEBUGMSGTL(("mibindex", "lookup: (none)\n"));
+ return NULL;
+}
+
+int
+_mibindex_add( const char *dirname, int i )
+{
+ const int old_mibindex = _mibindex;
+
+ DEBUGMSGTL(("mibindex", "add: %s (%d)\n", dirname, i ));
+ if ( i == -1 )
+ i = _mibindex++;
+ if ( i >= _mibindex_max ) {
+ /*
+ * If the index array is full (or non-existent)
+ * then expand (or create) it
+ */
+ _mibindex_max = i + 10;
+ _mibindexes = realloc(_mibindexes,
+ _mibindex_max * sizeof(_mibindexes[0]));
+ netsnmp_assert(_mibindexes);
+ memset(_mibindexes + old_mibindex, 0,
+ (i - old_mibindex) * sizeof(_mibindexes[0]));
+ }
+ DEBUGMSGTL(("mibindex", "add: %d/%d/%d\n", i, _mibindex, _mibindex_max ));
+
+ _mibindexes[ i ] = strdup( dirname );
+ if ( i >= _mibindex )
+ _mibindex = i+1;
+
+ return i;
+}
+
+FILE *
+netsnmp_mibindex_new( const char *dirname )
+{
+ FILE *fp;
+ char tmpbuf[300];
+ char *cp;
+ int i;
+
+ cp = netsnmp_mibindex_lookup( dirname );
+ if (!cp) {
+ i = _mibindex_add( dirname, -1 );
+ snprintf( tmpbuf, sizeof(tmpbuf), "%s/mib_indexes/%d",
+ get_persistent_directory(), i );
+ tmpbuf[sizeof(tmpbuf)-1] = 0;
+ cp = tmpbuf;
+ }
+ DEBUGMSGTL(("mibindex", "new: %s (%s)\n", dirname, cp ));
+ fp = fopen( cp, "w" );
+ if (fp)
+ fprintf( fp, "DIR %s\n", dirname );
+ return fp;
+}
+
+
+/**
+ * Unloads all mibs.
+ */
+void
+shutdown_mib(void)
+{
+ unload_all_mibs();
+ if (tree_top) {
+ if (tree_top->label)
+ SNMP_FREE(tree_top->label);
+ SNMP_FREE(tree_top);
+ }
+ tree_head = NULL;
+ Mib = NULL;
+ if (_mibindexes) {
+ int i;
+ for (i = 0; i < _mibindex; ++i)
+ SNMP_FREE(_mibindexes[i]);
+ free(_mibindexes);
+ _mibindex = 0;
+ _mibindex_max = 0;
+ _mibindexes = NULL;
+ }
+ if (Prefix != NULL && Prefix != &Standard_Prefix[0])
+ SNMP_FREE(Prefix);
+ if (Prefix)
+ Prefix = NULL;
+ SNMP_FREE(confmibs);
+ SNMP_FREE(confmibdir);
+}
+
+/**
+ * Prints the MIBs to the file fp.
+ *
+ * @param fp The file descriptor to print to.
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_PRINT_MIB
+void
+print_mib(FILE * fp)
+{
+ print_subtree(fp, tree_head, 0);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_PRINT_MIB */
+
+void
+print_ascii_dump(FILE * fp)
+{
+ fprintf(fp, "dump DEFINITIONS ::= BEGIN\n");
+ print_ascii_dump_tree(fp, tree_head, 0);
+ fprintf(fp, "END\n");
+}
+
+
+/**
+ * Set's the printing function printomat in a subtree according
+ * it's type
+ *
+ * @param subtree The subtree to set.
+ */
+void
+set_function(struct tree *subtree)
+{
+ subtree->printer = NULL;
+ switch (subtree->type) {
+ case TYPE_OBJID:
+ subtree->printomat = sprint_realloc_object_identifier;
+ break;
+ case TYPE_OCTETSTR:
+ subtree->printomat = sprint_realloc_octet_string;
+ break;
+ case TYPE_INTEGER:
+ subtree->printomat = sprint_realloc_integer;
+ break;
+ case TYPE_INTEGER32:
+ subtree->printomat = sprint_realloc_integer;
+ break;
+ case TYPE_NETADDR:
+ subtree->printomat = sprint_realloc_networkaddress;
+ break;
+ case TYPE_IPADDR:
+ subtree->printomat = sprint_realloc_ipaddress;
+ break;
+ case TYPE_COUNTER:
+ subtree->printomat = sprint_realloc_counter;
+ break;
+ case TYPE_GAUGE:
+ subtree->printomat = sprint_realloc_gauge;
+ break;
+ case TYPE_TIMETICKS:
+ subtree->printomat = sprint_realloc_timeticks;
+ break;
+ case TYPE_OPAQUE:
+ subtree->printomat = sprint_realloc_opaque;
+ break;
+ case TYPE_NULL:
+ subtree->printomat = sprint_realloc_null;
+ break;
+ case TYPE_BITSTRING:
+ subtree->printomat = sprint_realloc_bitstring;
+ break;
+ case TYPE_NSAPADDRESS:
+ subtree->printomat = sprint_realloc_nsapaddress;
+ break;
+ case TYPE_COUNTER64:
+ subtree->printomat = sprint_realloc_counter64;
+ break;
+ case TYPE_UINTEGER:
+ subtree->printomat = sprint_realloc_uinteger;
+ break;
+ case TYPE_UNSIGNED32:
+ subtree->printomat = sprint_realloc_gauge;
+ break;
+ case TYPE_OTHER:
+ default:
+ subtree->printomat = sprint_realloc_by_type;
+ break;
+ }
+}
+
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+/**
+ * Reads an object identifier from an input string into internal OID form.
+ *
+ * When called, out_len must hold the maximum length of the output array.
+ *
+ * @param input the input string.
+ * @param output the oid wirte.
+ * @param out_len number of subid's in output.
+ *
+ * @return 1 if successful.
+ *
+ * If an error occurs, this function returns 0 and MAY set snmp_errno.
+ * snmp_errno is NOT set if SET_SNMP_ERROR evaluates to nothing.
+ * This can make multi-threaded use a tiny bit more robust.
+ */
+int
+read_objid(const char *input, oid * output, size_t * out_len)
+{ /* number of subid's in "output" */
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ struct tree *root = tree_top;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ char buf[SPRINT_MAX_LEN];
+ int ret, max_out_len;
+ char *name, ch;
+ const char *cp;
+
+ cp = input;
+ while ((ch = *cp)) {
+ if (('0' <= ch && ch <= '9')
+ || ('a' <= ch && ch <= 'z')
+ || ('A' <= ch && ch <= 'Z')
+ || ch == '-')
+ cp++;
+ else
+ break;
+ }
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (ch == ':')
+ return get_node(input, output, out_len);
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+ if (*input == '.')
+ input++;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_READ_UCD_STYLE_OID)) {
+ /*
+ * get past leading '.', append '.' to Prefix.
+ */
+ if (*Prefix == '.')
+ strlcpy(buf, Prefix + 1, sizeof(buf));
+ else
+ strlcpy(buf, Prefix, sizeof(buf));
+ strlcat(buf, ".", sizeof(buf));
+ strlcat(buf, input, sizeof(buf));
+ input = buf;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if ((root == NULL) && (tree_head != NULL)) {
+ root = tree_head;
+ }
+ else if (root == NULL) {
+ SET_SNMP_ERROR(SNMPERR_NOMIB);
+ *out_len = 0;
+ return 0;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ name = strdup(input);
+ max_out_len = *out_len;
+ *out_len = 0;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if ((ret =
+ _add_strings_to_oid(root, name, output, out_len,
+ max_out_len)) <= 0)
+#else
+ if ((ret =
+ _add_strings_to_oid(NULL, name, output, out_len,
+ max_out_len)) <= 0)
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ {
+ if (ret == 0)
+ ret = SNMPERR_UNKNOWN_OBJID;
+ SET_SNMP_ERROR(ret);
+ SNMP_FREE(name);
+ return 0;
+ }
+ SNMP_FREE(name);
+
+ return 1;
+}
+
+/**
+ *
+ */
+void
+netsnmp_sprint_realloc_objid(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ int *buf_overflow,
+ const oid * objid, size_t objidlen)
+{
+ u_char *tbuf = NULL, *cp = NULL;
+ size_t tbuf_len = 256, tout_len = 0;
+ int tbuf_overflow = 0;
+ int output_format;
+
+ if ((tbuf = (u_char *) calloc(tbuf_len, 1)) == NULL) {
+ tbuf_overflow = 1;
+ } else {
+ *tbuf = '.';
+ tout_len = 1;
+ }
+
+ _oid_finish_printing(objid, objidlen,
+ &tbuf, &tbuf_len, &tout_len,
+ allow_realloc, &tbuf_overflow);
+
+ if (tbuf_overflow) {
+ if (!*buf_overflow) {
+ snmp_strcat(buf, buf_len, out_len, allow_realloc, tbuf);
+ *buf_overflow = 1;
+ }
+ SNMP_FREE(tbuf);
+ return;
+ }
+
+ output_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ if (0 == output_format) {
+ output_format = NETSNMP_OID_OUTPUT_NUMERIC;
+ }
+ switch (output_format) {
+ case NETSNMP_OID_OUTPUT_FULL:
+ case NETSNMP_OID_OUTPUT_NUMERIC:
+ case NETSNMP_OID_OUTPUT_SUFFIX:
+ case NETSNMP_OID_OUTPUT_MODULE:
+ cp = tbuf;
+ break;
+
+ case NETSNMP_OID_OUTPUT_NONE:
+ default:
+ cp = NULL;
+ }
+
+ if (!*buf_overflow &&
+ !snmp_strcat(buf, buf_len, out_len, allow_realloc, cp)) {
+ *buf_overflow = 1;
+ }
+ SNMP_FREE(tbuf);
+}
+
+/**
+ *
+ */
+#ifdef NETSNMP_DISABLE_MIB_LOADING
+void
+netsnmp_sprint_realloc_objid_tree(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ int *buf_overflow,
+ const oid * objid, size_t objidlen)
+{
+ netsnmp_sprint_realloc_objid(buf, buf_len, out_len, allow_realloc,
+ buf_overflow, objid, objidlen);
+}
+#else
+struct tree *
+netsnmp_sprint_realloc_objid_tree(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ int *buf_overflow,
+ const oid * objid, size_t objidlen)
+{
+ u_char *tbuf = NULL, *cp = NULL;
+ size_t tbuf_len = 512, tout_len = 0;
+ struct tree *subtree = tree_head;
+ size_t midpoint_offset = 0;
+ int tbuf_overflow = 0;
+ int output_format;
+
+ if ((tbuf = (u_char *) calloc(tbuf_len, 1)) == NULL) {
+ tbuf_overflow = 1;
+ } else {
+ *tbuf = '.';
+ tout_len = 1;
+ }
+
+ subtree = _get_realloc_symbol(objid, objidlen, subtree,
+ &tbuf, &tbuf_len, &tout_len,
+ allow_realloc, &tbuf_overflow, NULL,
+ &midpoint_offset);
+
+ if (tbuf_overflow) {
+ if (!*buf_overflow) {
+ snmp_strcat(buf, buf_len, out_len, allow_realloc, tbuf);
+ *buf_overflow = 1;
+ }
+ SNMP_FREE(tbuf);
+ return subtree;
+ }
+
+ output_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ if (0 == output_format) {
+ output_format = NETSNMP_OID_OUTPUT_MODULE;
+ }
+ switch (output_format) {
+ case NETSNMP_OID_OUTPUT_FULL:
+ case NETSNMP_OID_OUTPUT_NUMERIC:
+ cp = tbuf;
+ break;
+
+ case NETSNMP_OID_OUTPUT_SUFFIX:
+ case NETSNMP_OID_OUTPUT_MODULE:
+ for (cp = tbuf; *cp; cp++);
+
+ if (midpoint_offset != 0) {
+ cp = tbuf + midpoint_offset - 2; /* beyond the '.' */
+ } else {
+ while (cp >= tbuf) {
+ if (isalpha(*cp)) {
+ break;
+ }
+ cp--;
+ }
+ }
+
+ while (cp >= tbuf) {
+ if (*cp == '.') {
+ break;
+ }
+ cp--;
+ }
+
+ cp++;
+
+ if ((NETSNMP_OID_OUTPUT_MODULE == output_format)
+ && cp > tbuf) {
+ char modbuf[256] = { 0 }, *mod =
+ module_name(subtree->modid, modbuf);
+
+ /*
+ * Don't add the module ID if it's just numeric (i.e. we couldn't look
+ * it up properly.
+ */
+
+ if (!*buf_overflow && modbuf[0] != '#') {
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) mod)
+ || !snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) "::")) {
+ *buf_overflow = 1;
+ }
+ }
+ }
+ break;
+
+ case NETSNMP_OID_OUTPUT_UCD:
+ {
+ PrefixListPtr pp = &mib_prefixes[0];
+ size_t ilen, tlen;
+ const char *testcp;
+
+ cp = tbuf;
+ tlen = strlen((char *) tbuf);
+
+ while (pp->str) {
+ ilen = pp->len;
+ testcp = pp->str;
+
+ if ((tlen > ilen) && memcmp(tbuf, testcp, ilen) == 0) {
+ cp += (ilen + 1);
+ break;
+ }
+ pp++;
+ }
+ break;
+ }
+
+ case NETSNMP_OID_OUTPUT_NONE:
+ default:
+ cp = NULL;
+ }
+
+ if (!*buf_overflow &&
+ !snmp_strcat(buf, buf_len, out_len, allow_realloc, cp)) {
+ *buf_overflow = 1;
+ }
+ SNMP_FREE(tbuf);
+ return subtree;
+}
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+int
+sprint_realloc_objid(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const oid * objid, size_t objidlen)
+{
+ int buf_overflow = 0;
+
+ netsnmp_sprint_realloc_objid_tree(buf, buf_len, out_len, allow_realloc,
+ &buf_overflow, objid, objidlen);
+ return !buf_overflow;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SPRINT_OBJID
+int
+snprint_objid(char *buf, size_t buf_len,
+ const oid * objid, size_t objidlen)
+{
+ size_t out_len = 0;
+
+ if (sprint_realloc_objid((u_char **) & buf, &buf_len, &out_len, 0,
+ objid, objidlen)) {
+ return (int) out_len;
+ } else {
+ return -1;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SPRINT_OBJID */
+
+/**
+ * Prints an oid to stdout.
+ *
+ * @param objid The oid to print
+ * @param objidlen The length of oidid.
+ */
+void
+print_objid(const oid * objid, size_t objidlen)
+{ /* number of subidentifiers */
+ fprint_objid(stdout, objid, objidlen);
+}
+
+
+/**
+ * Prints an oid to a file descriptor.
+ *
+ * @param f The file descriptor to print to.
+ * @param objid The oid to print
+ * @param objidlen The length of oidid.
+ */
+void
+fprint_objid(FILE * f, const oid * objid, size_t objidlen)
+{ /* number of subidentifiers */
+ u_char *buf = NULL;
+ size_t buf_len = 256, out_len = 0;
+ int buf_overflow = 0;
+
+ if ((buf = (u_char *) calloc(buf_len, 1)) == NULL) {
+ fprintf(f, "[TRUNCATED]\n");
+ return;
+ } else {
+ netsnmp_sprint_realloc_objid_tree(&buf, &buf_len, &out_len, 1,
+ &buf_overflow, objid, objidlen);
+ if (buf_overflow) {
+ fprintf(f, "%s [TRUNCATED]\n", buf);
+ } else {
+ fprintf(f, "%s\n", buf);
+ }
+ }
+
+ SNMP_FREE(buf);
+}
+
+int
+sprint_realloc_variable(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable)
+{
+ int buf_overflow = 0;
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ struct tree *subtree = tree_head;
+
+ subtree =
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ netsnmp_sprint_realloc_objid_tree(buf, buf_len, out_len,
+ allow_realloc, &buf_overflow,
+ objid, objidlen);
+
+ if (buf_overflow) {
+ return 0;
+ }
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_BARE_VALUE)) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " = ")) {
+ return 0;
+ }
+ } else {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " ")) {
+ return 0;
+ }
+ } else {
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc,
+ (const u_char *) " = ")) {
+ return 0;
+ }
+ } /* end if-else NETSNMP_DS_LIB_QUICK_PRINT */
+ } /* end if-else NETSNMP_DS_LIB_QUICKE_PRINT */
+ } else {
+ *out_len = 0;
+ }
+
+ if (variable->type == SNMP_NOSUCHOBJECT) {
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *)
+ "No Such Object available on this agent at this OID");
+ } else if (variable->type == SNMP_NOSUCHINSTANCE) {
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *)
+ "No Such Instance currently exists at this OID");
+ } else if (variable->type == SNMP_ENDOFMIBVIEW) {
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *)
+ "No more variables left in this MIB View (It is past the end of the MIB tree)");
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ } else if (subtree) {
+ const char *units = NULL;
+ const char *hint = NULL;
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_PRINT_UNITS)) {
+ units = subtree->units;
+ }
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_NO_DISPLAY_HINT)) {
+ hint = subtree->hint;
+ }
+
+ if (subtree->printomat) {
+ return (*subtree->printomat) (buf, buf_len, out_len,
+ allow_realloc, variable,
+ subtree->enums, hint,
+ units);
+ } else {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, variable,
+ subtree->enums, hint,
+ units);
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ } else {
+ /*
+ * Handle rare case where tree is empty.
+ */
+ return sprint_realloc_by_type(buf, buf_len, out_len, allow_realloc,
+ variable, NULL, NULL, NULL);
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNPRINT_VARABLE
+int
+snprint_variable(char *buf, size_t buf_len,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable)
+{
+ size_t out_len = 0;
+
+ if (sprint_realloc_variable((u_char **) & buf, &buf_len, &out_len, 0,
+ objid, objidlen, variable)) {
+ return (int) out_len;
+ } else {
+ return -1;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNPRINT_VARABLE */
+
+/**
+ * Prints a variable to stdout.
+ *
+ * @param objid The object id.
+ * @param objidlen The length of teh object id.
+ * @param variable The variable to print.
+ */
+void
+print_variable(const oid * objid,
+ size_t objidlen, const netsnmp_variable_list * variable)
+{
+ fprint_variable(stdout, objid, objidlen, variable);
+}
+
+
+/**
+ * Prints a variable to a file descriptor.
+ *
+ * @param f The file descriptor to print to.
+ * @param objid The object id.
+ * @param objidlen The length of teh object id.
+ * @param variable The variable to print.
+ */
+void
+fprint_variable(FILE * f,
+ const oid * objid,
+ size_t objidlen, const netsnmp_variable_list * variable)
+{
+ u_char *buf = NULL;
+ size_t buf_len = 256, out_len = 0;
+
+ if ((buf = (u_char *) calloc(buf_len, 1)) == NULL) {
+ fprintf(f, "[TRUNCATED]\n");
+ return;
+ } else {
+ if (sprint_realloc_variable(&buf, &buf_len, &out_len, 1,
+ objid, objidlen, variable)) {
+ fprintf(f, "%s\n", buf);
+ } else {
+ fprintf(f, "%s [TRUNCATED]\n", buf);
+ }
+ }
+
+ SNMP_FREE(buf);
+}
+
+int
+sprint_realloc_value(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable)
+{
+ if (variable->type == SNMP_NOSUCHOBJECT) {
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *)
+ "No Such Object available on this agent at this OID");
+ } else if (variable->type == SNMP_NOSUCHINSTANCE) {
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *)
+ "No Such Instance currently exists at this OID");
+ } else if (variable->type == SNMP_ENDOFMIBVIEW) {
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *)
+ "No more variables left in this MIB View (It is past the end of the MIB tree)");
+ } else {
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ const char *units = NULL;
+ struct tree *subtree = tree_head;
+ subtree = get_tree(objid, objidlen, subtree);
+ if (subtree && !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_PRINT_UNITS)) {
+ units = subtree->units;
+ }
+ if (subtree) {
+ if(subtree->printomat) {
+ return (*subtree->printomat) (buf, buf_len, out_len,
+ allow_realloc, variable,
+ subtree->enums, subtree->hint,
+ units);
+ } else {
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, variable,
+ subtree->enums, subtree->hint,
+ units);
+ }
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ return sprint_realloc_by_type(buf, buf_len, out_len,
+ allow_realloc, variable,
+ NULL, NULL, NULL);
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNPRINT_VALUE
+/* used in the perl module */
+int
+snprint_value(char *buf, size_t buf_len,
+ const oid * objid, size_t objidlen,
+ const netsnmp_variable_list * variable)
+{
+ size_t out_len = 0;
+
+ if (sprint_realloc_value((u_char **) & buf, &buf_len, &out_len, 0,
+ objid, objidlen, variable)) {
+ return (int) out_len;
+ } else {
+ return -1;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNPRINT_VALUE */
+
+void
+print_value(const oid * objid,
+ size_t objidlen, const netsnmp_variable_list * variable)
+{
+ fprint_value(stdout, objid, objidlen, variable);
+}
+
+void
+fprint_value(FILE * f,
+ const oid * objid,
+ size_t objidlen, const netsnmp_variable_list * variable)
+{
+ u_char *buf = NULL;
+ size_t buf_len = 256, out_len = 0;
+
+ if ((buf = (u_char *) calloc(buf_len, 1)) == NULL) {
+ fprintf(f, "[TRUNCATED]\n");
+ return;
+ } else {
+ if (sprint_realloc_value(&buf, &buf_len, &out_len, 1,
+ objid, objidlen, variable)) {
+ fprintf(f, "%s\n", buf);
+ } else {
+ fprintf(f, "%s [TRUNCATED]\n", buf);
+ }
+ }
+
+ SNMP_FREE(buf);
+}
+
+
+/**
+ * Takes the value in VAR and turns it into an OID segment in var->name.
+ *
+ * @param var The variable.
+ *
+ * @return SNMPERR_SUCCESS or SNMPERR_GENERR
+ */
+int
+build_oid_segment(netsnmp_variable_list * var)
+{
+ int i;
+ uint32_t ipaddr;
+
+ if (var->name && var->name != var->name_loc)
+ SNMP_FREE(var->name);
+ switch (var->type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ var->name_length = 1;
+ var->name = var->name_loc;
+ var->name[0] = *(var->val.integer);
+ break;
+
+ case ASN_IPADDRESS:
+ var->name_length = 4;
+ var->name = var->name_loc;
+ memcpy(&ipaddr, var->val.string, sizeof(ipaddr));
+ var->name[0] = (ipaddr >> 24) & 0xff;
+ var->name[1] = (ipaddr >> 16) & 0xff;
+ var->name[2] = (ipaddr >> 8) & 0xff;
+ var->name[3] = (ipaddr >> 0) & 0xff;
+ break;
+
+ case ASN_PRIV_IMPLIED_OBJECT_ID:
+ var->name_length = var->val_len / sizeof(oid);
+ if (var->name_length > (sizeof(var->name_loc) / sizeof(oid)))
+ var->name = (oid *) malloc(sizeof(oid) * (var->name_length));
+ else
+ var->name = var->name_loc;
+ 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;
+ if (var->name_length > (sizeof(var->name_loc) / sizeof(oid)))
+ var->name = (oid *) malloc(sizeof(oid) * (var->name_length));
+ else
+ var->name = var->name_loc;
+ 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;
+ if (var->name_length > (sizeof(var->name_loc) / sizeof(oid)))
+ var->name = (oid *) malloc(sizeof(oid) * (var->name_length));
+ else
+ var->name = var->name_loc;
+ 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;
+ if (var->name_length > (sizeof(var->name_loc) / sizeof(oid)))
+ var->name = (oid *) malloc(sizeof(oid) * (var->name_length));
+ else
+ var->name = var->name_loc;
+ 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(("build_oid_segment",
+ "invalid asn type: %d\n", var->type));
+ return SNMPERR_GENERR;
+ }
+
+ if (var->name_length > MAX_OID_LEN) {
+ DEBUGMSGTL(("build_oid_segment",
+ "Something terribly wrong, namelen = %lu\n",
+ (unsigned long)var->name_length));
+ return SNMPERR_GENERR;
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+build_oid_noalloc(oid * in, size_t in_len, size_t * out_len,
+ oid * prefix, size_t prefix_len,
+ netsnmp_variable_list * indexes)
+{
+ netsnmp_variable_list *var;
+
+ if (prefix) {
+ if (in_len < prefix_len)
+ return SNMPERR_GENERR;
+ memcpy(in, prefix, prefix_len * sizeof(oid));
+ *out_len = prefix_len;
+ } else {
+ *out_len = 0;
+ }
+
+ for (var = indexes; var != NULL; var = var->next_variable) {
+ if (build_oid_segment(var) != SNMPERR_SUCCESS)
+ return SNMPERR_GENERR;
+ if (var->name_length + *out_len <= in_len) {
+ memcpy(&(in[*out_len]), var->name,
+ sizeof(oid) * var->name_length);
+ *out_len += var->name_length;
+ } else {
+ return SNMPERR_GENERR;
+ }
+ }
+
+ DEBUGMSGTL(("build_oid_noalloc", "generated: "));
+ DEBUGMSGOID(("build_oid_noalloc", in, *out_len));
+ DEBUGMSG(("build_oid_noalloc", "\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+build_oid(oid ** out, size_t * out_len,
+ oid * prefix, size_t prefix_len, netsnmp_variable_list * indexes)
+{
+ oid tmpout[MAX_OID_LEN];
+
+ /*
+ * xxx-rks: inefficent. try only building segments to find index len:
+ * for (var = indexes; var != NULL; var = var->next_variable) {
+ * if (build_oid_segment(var) != SNMPERR_SUCCESS)
+ * return SNMPERR_GENERR;
+ * *out_len += var->name_length;
+ *
+ * then see if it fits in existing buffer, or realloc buffer.
+ */
+ if (build_oid_noalloc(tmpout, sizeof(tmpout), out_len,
+ prefix, prefix_len, indexes) != SNMPERR_SUCCESS)
+ return SNMPERR_GENERR;
+
+ /** xxx-rks: should free previous value? */
+ snmp_clone_mem((void **) out, (void *) tmpout, *out_len * sizeof(oid));
+
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * vblist_out must contain a pre-allocated string of variables into
+ * which indexes can be extracted based on the previously existing
+ * types in the variable chain
+ * returns:
+ * SNMPERR_GENERR on error
+ * SNMPERR_SUCCESS on success
+ */
+
+int
+parse_oid_indexes(oid * oidIndex, size_t oidLen,
+ netsnmp_variable_list * data)
+{
+ netsnmp_variable_list *var = data;
+
+ while (var && oidLen > 0) {
+
+ if (parse_one_oid_index(&oidIndex, &oidLen, var, 0) !=
+ SNMPERR_SUCCESS)
+ break;
+
+ var = var->next_variable;
+ }
+
+ if (var != NULL || oidLen != 0)
+ return SNMPERR_GENERR;
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+parse_one_oid_index(oid ** oidStart, size_t * oidLen,
+ netsnmp_variable_list * data, int complete)
+{
+ netsnmp_variable_list *var = data;
+ oid tmpout[MAX_OID_LEN];
+ unsigned int i;
+ unsigned int uitmp = 0;
+
+ oid *oidIndex = *oidStart;
+
+ if (var == NULL || ((*oidLen == 0) && (complete == 0)))
+ return SNMPERR_GENERR;
+ else {
+ switch (var->type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ if (*oidLen) {
+ snmp_set_var_value(var, (u_char *) oidIndex++,
+ sizeof(oid));
+ --(*oidLen);
+ } else {
+ snmp_set_var_value(var, (u_char *) oidLen, sizeof(long));
+ }
+ DEBUGMSGTL(("parse_oid_indexes",
+ "Parsed int(%d): %ld\n", var->type,
+ *var->val.integer));
+ break;
+
+ case ASN_IPADDRESS:
+ if ((4 > *oidLen) && (complete == 0))
+ return SNMPERR_GENERR;
+
+ for (i = 0; i < 4 && i < *oidLen; ++i) {
+ if (oidIndex[i] > 255) {
+ DEBUGMSGTL(("parse_oid_indexes",
+ "illegal oid in index: %" NETSNMP_PRIo "d\n",
+ oidIndex[0]));
+ return SNMPERR_GENERR; /* sub-identifier too large */
+ }
+ uitmp = uitmp + (oidIndex[i] << (8*(3-i)));
+ }
+ if (4 > (int) (*oidLen)) {
+ oidIndex += *oidLen;
+ (*oidLen) = 0;
+ } else {
+ oidIndex += 4;
+ (*oidLen) -= 4;
+ }
+ uitmp = htonl(uitmp); /* put it in proper order for byte copies */
+ uitmp =
+ snmp_set_var_value(var, (u_char *) &uitmp, 4);
+ DEBUGMSGTL(("parse_oid_indexes",
+ "Parsed ipaddr(%d): %d.%d.%d.%d\n", var->type,
+ var->val.string[0], var->val.string[1],
+ var->val.string[2], var->val.string[3]));
+ break;
+
+ case ASN_OBJECT_ID:
+ case ASN_PRIV_IMPLIED_OBJECT_ID:
+ if (var->type == ASN_PRIV_IMPLIED_OBJECT_ID) {
+ /*
+ * might not be implied, might be fixed len. check if
+ * caller set up val len, and use it if they did.
+ */
+ if (0 == var->val_len)
+ uitmp = *oidLen;
+ else {
+ DEBUGMSGTL(("parse_oid_indexes:fix", "fixed len oid\n"));
+ uitmp = var->val_len;
+ }
+ } else {
+ if (*oidLen) {
+ uitmp = *oidIndex++;
+ --(*oidLen);
+ } else {
+ uitmp = 0;
+ }
+ if ((uitmp > *oidLen) && (complete == 0))
+ return SNMPERR_GENERR;
+ }
+
+ if (uitmp > MAX_OID_LEN)
+ return SNMPERR_GENERR; /* too big and illegal */
+
+ if (uitmp > *oidLen) {
+ memcpy(tmpout, oidIndex, sizeof(oid) * (*oidLen));
+ memset(&tmpout[*oidLen], 0x00,
+ sizeof(oid) * (uitmp - *oidLen));
+ snmp_set_var_value(var, (u_char *) tmpout,
+ sizeof(oid) * uitmp);
+ oidIndex += *oidLen;
+ (*oidLen) = 0;
+ } else {
+ snmp_set_var_value(var, (u_char *) oidIndex,
+ sizeof(oid) * uitmp);
+ oidIndex += uitmp;
+ (*oidLen) -= uitmp;
+ }
+
+ DEBUGMSGTL(("parse_oid_indexes", "Parsed oid: "));
+ DEBUGMSGOID(("parse_oid_indexes",
+ var->val.objid, var->val_len / sizeof(oid)));
+ DEBUGMSG(("parse_oid_indexes", "\n"));
+ break;
+
+ case ASN_OPAQUE:
+ case ASN_OCTET_STR:
+ case ASN_PRIV_IMPLIED_OCTET_STR:
+ if (var->type == ASN_PRIV_IMPLIED_OCTET_STR) {
+ /*
+ * might not be implied, might be fixed len. check if
+ * caller set up val len, and use it if they did.
+ */
+ if (0 == var->val_len)
+ uitmp = *oidLen;
+ else {
+ DEBUGMSGTL(("parse_oid_indexes:fix", "fixed len str\n"));
+ uitmp = var->val_len;
+ }
+ } else {
+ if (*oidLen) {
+ uitmp = *oidIndex++;
+ --(*oidLen);
+ } else {
+ uitmp = 0;
+ }
+ if ((uitmp > *oidLen) && (complete == 0))
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * we handle this one ourselves since we don't have
+ * pre-allocated memory to copy from using
+ * snmp_set_var_value()
+ */
+
+ if (uitmp == 0)
+ break; /* zero length strings shouldn't malloc */
+
+ if (uitmp > MAX_OID_LEN)
+ return SNMPERR_GENERR; /* too big and illegal */
+
+ /*
+ * malloc by size+1 to allow a null to be appended.
+ */
+ var->val_len = uitmp;
+ var->val.string = (u_char *) calloc(1, uitmp + 1);
+ if (var->val.string == NULL)
+ return SNMPERR_GENERR;
+
+ if ((size_t)uitmp > (*oidLen)) {
+ for (i = 0; i < *oidLen; ++i)
+ var->val.string[i] = (u_char) * oidIndex++;
+ for (i = *oidLen; i < uitmp; ++i)
+ var->val.string[i] = '\0';
+ (*oidLen) = 0;
+ } else {
+ for (i = 0; i < uitmp; ++i)
+ var->val.string[i] = (u_char) * oidIndex++;
+ (*oidLen) -= uitmp;
+ }
+ var->val.string[uitmp] = '\0';
+
+ DEBUGMSGTL(("parse_oid_indexes",
+ "Parsed str(%d): %s\n", var->type,
+ var->val.string));
+ break;
+
+ default:
+ DEBUGMSGTL(("parse_oid_indexes",
+ "invalid asn type: %d\n", var->type));
+ return SNMPERR_GENERR;
+ }
+ }
+ (*oidStart) = oidIndex;
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * dump_realloc_oid_to_inetaddress:
+ * return 0 for failure,
+ * return 1 for success,
+ * return 2 for not handled
+ */
+
+int
+dump_realloc_oid_to_inetaddress(const int addr_type, const oid * objid, size_t objidlen,
+ u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ char quotechar)
+{
+ if (buf) {
+ int i, len;
+ char intbuf[64], * p;
+ unsigned char *zc;
+ unsigned long zone;
+
+ memset(intbuf, 0, 64);
+
+ p = intbuf;
+ *p = quotechar;
+ p++;
+ switch (addr_type) {
+ case IPV4:
+ case IPV4Z:
+ if ((addr_type == IPV4 && objidlen != 4) ||
+ (addr_type == IPV4Z && objidlen != 8))
+ return 2;
+
+ len = sprintf(p, "%" NETSNMP_PRIo "u.%" NETSNMP_PRIo "u."
+ "%" NETSNMP_PRIo "u.%" NETSNMP_PRIo "u",
+ objid[0], objid[1], objid[2], objid[3]);
+ p += len;
+ if (addr_type == IPV4Z) {
+ zc = (unsigned char*)&zone;
+ zc[0] = (u_char)(objid[4]);
+ zc[1] = (u_char)(objid[5]);
+ zc[2] = (u_char)(objid[6]);
+ zc[3] = (u_char)(objid[7]);
+ zone = ntohl(zone);
+ len = sprintf(p, "%%%lu", zone);
+ p += len;
+ }
+
+ break;
+
+ case IPV6:
+ case IPV6Z:
+ if ((addr_type == IPV6 && objidlen != 16) ||
+ (addr_type == IPV6Z && objidlen != 20))
+ return 2;
+
+ len = 0;
+ for (i = 0; i < 16; i ++) {
+ len = snprintf(p, 4, "%02" NETSNMP_PRIo "x:", objid[i]);
+ p += len;
+ }
+ p-- ; /* do not include the last ':' */
+
+ if (addr_type == IPV6Z) {
+ zc = (unsigned char*)&zone;
+ zc[0] = (u_char)(objid[16]);
+ zc[1] = (u_char)(objid[17]);
+ zc[2] = (u_char)(objid[18]);
+ zc[3] = (u_char)(objid[19]);
+ zone = ntohl(zone);
+ len = sprintf(p, "%%%lu", zone);
+ p += len;
+ }
+
+ break;
+
+ case DNS:
+ default:
+ /* DNS can just be handled by dump_realloc_oid_to_string() */
+ return 2;
+ }
+
+ *p = quotechar;
+
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc,
+ (const u_char *) intbuf);
+ }
+ return 1;
+}
+
+int
+dump_realloc_oid_to_string(const oid * objid, size_t objidlen,
+ u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ char quotechar)
+{
+ if (buf) {
+ int i, alen;
+
+ for (i = 0, alen = 0; i < (int) objidlen; i++) {
+ oid tst = objid[i];
+ if ((tst > 254) || (!isprint(tst))) {
+ tst = (oid) '.';
+ }
+
+ if (alen == 0) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_ESCAPE_QUOTES)) {
+ while ((*out_len + 2) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = '\\';
+ (*out_len)++;
+ }
+ while ((*out_len + 2) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = quotechar;
+ (*out_len)++;
+ }
+
+ while ((*out_len + 2) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = (char) tst;
+ (*out_len)++;
+ alen++;
+ }
+
+ if (alen) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_ESCAPE_QUOTES)) {
+ while ((*out_len + 2) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = '\\';
+ (*out_len)++;
+ }
+ while ((*out_len + 2) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = quotechar;
+ (*out_len)++;
+ }
+
+ *(*buf + *out_len) = '\0';
+ }
+
+ return 1;
+}
+
+void
+_oid_finish_printing(const oid * objid, size_t objidlen,
+ u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc, int *buf_overflow) {
+ char intbuf[64];
+ if (*buf != NULL && *(*buf + *out_len - 1) != '.') {
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) ".")) {
+ *buf_overflow = 1;
+ }
+ }
+
+ while (objidlen-- > 0) { /* output rest of name, uninterpreted */
+ sprintf(intbuf, "%" NETSNMP_PRIo "u.", *objid++);
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) intbuf)) {
+ *buf_overflow = 1;
+ }
+ }
+
+ if (*buf != NULL) {
+ *(*buf + *out_len - 1) = '\0'; /* remove trailing dot */
+ *out_len = *out_len - 1;
+ }
+}
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+static struct tree *
+_get_realloc_symbol(const oid * objid, size_t objidlen,
+ struct tree *subtree,
+ u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc, int *buf_overflow,
+ struct index_list *in_dices, size_t * end_of_known)
+{
+ struct tree *return_tree = NULL;
+ int extended_index =
+ netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_EXTENDED_INDEX);
+ int output_format =
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+ char intbuf[64];
+
+ if (!objid || !buf) {
+ return NULL;
+ }
+
+ for (; subtree; subtree = subtree->next_peer) {
+ if (*objid == subtree->subid) {
+ while (subtree->next_peer && subtree->next_peer->subid == *objid)
+ subtree = subtree->next_peer;
+ if (subtree->indexes) {
+ in_dices = subtree->indexes;
+ } else if (subtree->augments) {
+ struct tree *tp2 =
+ find_tree_node(subtree->augments, -1);
+ if (tp2) {
+ in_dices = tp2->indexes;
+ }
+ }
+
+ if (!strncmp(subtree->label, ANON, ANON_LEN) ||
+ (NETSNMP_OID_OUTPUT_NUMERIC == output_format)) {
+ sprintf(intbuf, "%lu", subtree->subid);
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *)
+ intbuf)) {
+ *buf_overflow = 1;
+ }
+ } else {
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *)
+ subtree->label)) {
+ *buf_overflow = 1;
+ }
+ }
+
+ if (objidlen > 1) {
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) ".")) {
+ *buf_overflow = 1;
+ }
+
+ return_tree = _get_realloc_symbol(objid + 1, objidlen - 1,
+ subtree->child_list,
+ buf, buf_len, out_len,
+ allow_realloc,
+ buf_overflow, in_dices,
+ end_of_known);
+ }
+
+ if (return_tree != NULL) {
+ return return_tree;
+ } else {
+ return subtree;
+ }
+ }
+ }
+
+
+ if (end_of_known) {
+ *end_of_known = *out_len;
+ }
+
+ /*
+ * Subtree not found.
+ */
+
+ while (in_dices && (objidlen > 0) &&
+ (NETSNMP_OID_OUTPUT_NUMERIC != output_format) &&
+ !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS)) {
+ size_t numids;
+ struct tree *tp;
+
+ tp = find_tree_node(in_dices->ilabel, -1);
+
+ if (!tp) {
+ /*
+ * Can't find an index in the mib tree. Bail.
+ */
+ goto finish_it;
+ }
+
+ if (extended_index) {
+ if (*buf != NULL && *(*buf + *out_len - 1) == '.') {
+ (*out_len)--;
+ }
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) "[")) {
+ *buf_overflow = 1;
+ }
+ }
+
+ switch (tp->type) {
+ case TYPE_OCTETSTR:
+ if (extended_index && tp->hint) {
+ netsnmp_variable_list var;
+ u_char buffer[1024];
+ int i;
+
+ memset(&var, 0, sizeof var);
+ if (in_dices->isimplied) {
+ numids = objidlen;
+ if (numids > objidlen)
+ goto finish_it;
+ } else if (tp->ranges && !tp->ranges->next
+ && tp->ranges->low == tp->ranges->high) {
+ numids = tp->ranges->low;
+ if (numids > objidlen)
+ goto finish_it;
+ } else {
+ numids = *objid;
+ if (numids >= objidlen)
+ goto finish_it;
+ objid++;
+ objidlen--;
+ }
+ if (numids > objidlen)
+ goto finish_it;
+ for (i = 0; i < (int) numids; i++)
+ buffer[i] = (u_char) objid[i];
+ var.type = ASN_OCTET_STR;
+ var.val.string = buffer;
+ var.val_len = numids;
+ if (!*buf_overflow) {
+ if (!sprint_realloc_octet_string(buf, buf_len, out_len,
+ allow_realloc, &var,
+ NULL, tp->hint,
+ NULL)) {
+ *buf_overflow = 1;
+ }
+ }
+ } else if (in_dices->isimplied) {
+ numids = objidlen;
+ if (numids > objidlen)
+ goto finish_it;
+
+ if (!*buf_overflow) {
+ if (!dump_realloc_oid_to_string
+ (objid, numids, buf, buf_len, out_len,
+ allow_realloc, '\'')) {
+ *buf_overflow = 1;
+ }
+ }
+ } else if (tp->ranges && !tp->ranges->next
+ && tp->ranges->low == tp->ranges->high) {
+ /*
+ * a fixed-length octet string
+ */
+ numids = tp->ranges->low;
+ if (numids > objidlen)
+ goto finish_it;
+
+ if (!*buf_overflow) {
+ if (!dump_realloc_oid_to_string
+ (objid, numids, buf, buf_len, out_len,
+ allow_realloc, '\'')) {
+ *buf_overflow = 1;
+ }
+ }
+ } else {
+ numids = (size_t) * objid + 1;
+ if (numids > objidlen)
+ goto finish_it;
+ if (numids == 1) {
+ if (netsnmp_ds_get_boolean
+ (NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_ESCAPE_QUOTES)) {
+ if (!*buf_overflow
+ && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) "\\")) {
+ *buf_overflow = 1;
+ }
+ }
+ if (!*buf_overflow
+ && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) "\"")) {
+ *buf_overflow = 1;
+ }
+ if (netsnmp_ds_get_boolean
+ (NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_ESCAPE_QUOTES)) {
+ if (!*buf_overflow
+ && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) "\\")) {
+ *buf_overflow = 1;
+ }
+ }
+ if (!*buf_overflow
+ && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) "\"")) {
+ *buf_overflow = 1;
+ }
+ } else {
+ if (!*buf_overflow) {
+ struct tree * next_peer;
+ int normal_handling = 1;
+
+ if (tp->next_peer) {
+ next_peer = tp->next_peer;
+ }
+
+ /* Try handling the InetAddress in the OID, in case of failure,
+ * use the normal_handling.
+ */
+ if (tp->next_peer &&
+ tp->tc_index != -1 &&
+ next_peer->tc_index != -1 &&
+ strcmp(get_tc_descriptor(tp->tc_index), "InetAddress") == 0 &&
+ strcmp(get_tc_descriptor(next_peer->tc_index),
+ "InetAddressType") == 0 ) {
+
+ int ret;
+ int addr_type = *(objid - 1);
+
+ ret = dump_realloc_oid_to_inetaddress(addr_type,
+ objid + 1, numids - 1, buf, buf_len, out_len,
+ allow_realloc, '"');
+ if (ret != 2) {
+ normal_handling = 0;
+ if (ret == 0) {
+ *buf_overflow = 1;
+ }
+
+ }
+ }
+ if (normal_handling && !dump_realloc_oid_to_string
+ (objid + 1, numids - 1, buf, buf_len, out_len,
+ allow_realloc, '"')) {
+ *buf_overflow = 1;
+ }
+ }
+ }
+ }
+ objid += numids;
+ objidlen -= numids;
+ break;
+
+ case TYPE_INTEGER32:
+ case TYPE_UINTEGER:
+ case TYPE_UNSIGNED32:
+ case TYPE_GAUGE:
+ case TYPE_INTEGER:
+ if (tp->enums) {
+ struct enum_list *ep = tp->enums;
+ while (ep && ep->value != (int) (*objid)) {
+ ep = ep->next;
+ }
+ if (ep) {
+ if (!*buf_overflow
+ && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) ep->label)) {
+ *buf_overflow = 1;
+ }
+ } else {
+ sprintf(intbuf, "%" NETSNMP_PRIo "u", *objid);
+ if (!*buf_overflow
+ && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) intbuf)) {
+ *buf_overflow = 1;
+ }
+ }
+ } else {
+ sprintf(intbuf, "%" NETSNMP_PRIo "u", *objid);
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *)
+ intbuf)) {
+ *buf_overflow = 1;
+ }
+ }
+ objid++;
+ objidlen--;
+ break;
+
+ case TYPE_TIMETICKS:
+ /* In an index, this is probably a timefilter */
+ if (extended_index) {
+ uptimeString( *objid, intbuf, sizeof( intbuf ) );
+ } else {
+ sprintf(intbuf, "%" NETSNMP_PRIo "u", *objid);
+ }
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *)
+ intbuf)) {
+ *buf_overflow = 1;
+ }
+ objid++;
+ objidlen--;
+ break;
+
+ case TYPE_OBJID:
+ if (in_dices->isimplied) {
+ numids = objidlen;
+ } else {
+ numids = (size_t) * objid + 1;
+ }
+ if (numids > objidlen)
+ goto finish_it;
+ if (extended_index) {
+ if (in_dices->isimplied) {
+ if (!*buf_overflow
+ && !netsnmp_sprint_realloc_objid_tree(buf, buf_len,
+ out_len,
+ allow_realloc,
+ buf_overflow,
+ objid,
+ numids)) {
+ *buf_overflow = 1;
+ }
+ } else {
+ if (!*buf_overflow
+ && !netsnmp_sprint_realloc_objid_tree(buf, buf_len,
+ out_len,
+ allow_realloc,
+ buf_overflow,
+ objid + 1,
+ numids -
+ 1)) {
+ *buf_overflow = 1;
+ }
+ }
+ } else {
+ _get_realloc_symbol(objid, numids, NULL, buf, buf_len,
+ out_len, allow_realloc, buf_overflow,
+ NULL, NULL);
+ }
+ objid += (numids);
+ objidlen -= (numids);
+ break;
+
+ case TYPE_IPADDR:
+ if (objidlen < 4)
+ goto finish_it;
+ sprintf(intbuf, "%" NETSNMP_PRIo "u.%" NETSNMP_PRIo "u."
+ "%" NETSNMP_PRIo "u.%" NETSNMP_PRIo "u",
+ objid[0], objid[1], objid[2], objid[3]);
+ objid += 4;
+ objidlen -= 4;
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) intbuf)) {
+ *buf_overflow = 1;
+ }
+ break;
+
+ case TYPE_NETADDR:{
+ oid ntype = *objid++;
+
+ objidlen--;
+ sprintf(intbuf, "%" NETSNMP_PRIo "u.", ntype);
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *)
+ intbuf)) {
+ *buf_overflow = 1;
+ }
+
+ if (ntype == 1 && objidlen >= 4) {
+ sprintf(intbuf, "%" NETSNMP_PRIo "u.%" NETSNMP_PRIo "u."
+ "%" NETSNMP_PRIo "u.%" NETSNMP_PRIo "u",
+ objid[0], objid[1], objid[2], objid[3]);
+ if (!*buf_overflow
+ && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) intbuf)) {
+ *buf_overflow = 1;
+ }
+ objid += 4;
+ objidlen -= 4;
+ } else {
+ goto finish_it;
+ }
+ }
+ break;
+
+ case TYPE_NSAPADDRESS:
+ default:
+ goto finish_it;
+ break;
+ }
+
+ if (extended_index) {
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) "]")) {
+ *buf_overflow = 1;
+ }
+ } else {
+ if (!*buf_overflow && !snmp_strcat(buf, buf_len, out_len,
+ allow_realloc,
+ (const u_char *) ".")) {
+ *buf_overflow = 1;
+ }
+ }
+ in_dices = in_dices->next;
+ }
+
+ finish_it:
+ _oid_finish_printing(objid, objidlen,
+ buf, buf_len, out_len,
+ allow_realloc, buf_overflow);
+ return NULL;
+}
+
+struct tree *
+get_tree(const oid * objid, size_t objidlen, struct tree *subtree)
+{
+ struct tree *return_tree = NULL;
+
+ for (; subtree; subtree = subtree->next_peer) {
+ if (*objid == subtree->subid)
+ goto found;
+ }
+
+ return NULL;
+
+ found:
+ while (subtree->next_peer && subtree->next_peer->subid == *objid)
+ subtree = subtree->next_peer;
+ if (objidlen > 1)
+ return_tree =
+ get_tree(objid + 1, objidlen - 1, subtree->child_list);
+ if (return_tree != NULL)
+ return return_tree;
+ else
+ return subtree;
+}
+
+/**
+ * Prints on oid description on stdout.
+ *
+ * @see fprint_description
+ */
+void
+print_description(oid * objid, size_t objidlen, /* number of subidentifiers */
+ int width)
+{
+ fprint_description(stdout, objid, objidlen, width);
+}
+
+
+/**
+ * Prints on oid description into a file descriptor.
+ *
+ * @param f The file descriptor to print to.
+ * @param objid The object identifier.
+ * @param objidlen The object id length.
+ * @param width Number of subidentifiers.
+ */
+void
+fprint_description(FILE * f, oid * objid, size_t objidlen,
+ int width)
+{
+ u_char *buf = NULL;
+ size_t buf_len = 256, out_len = 0;
+
+ if ((buf = (u_char *) calloc(buf_len, 1)) == NULL) {
+ fprintf(f, "[TRUNCATED]\n");
+ return;
+ } else {
+ if (!sprint_realloc_description(&buf, &buf_len, &out_len, 1,
+ objid, objidlen, width)) {
+ fprintf(f, "%s [TRUNCATED]\n", buf);
+ } else {
+ fprintf(f, "%s\n", buf);
+ }
+ }
+
+ SNMP_FREE(buf);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_MIB_SNPRINT_DESCRIPTION
+int
+snprint_description(char *buf, size_t buf_len,
+ oid * objid, size_t objidlen, int width)
+{
+ size_t out_len = 0;
+
+ if (sprint_realloc_description((u_char **) & buf, &buf_len, &out_len, 0,
+ objid, objidlen, width)) {
+ return (int) out_len;
+ } else {
+ return -1;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MIB_SNPRINT_DESCRIPTION */
+
+int
+sprint_realloc_description(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ oid * objid, size_t objidlen, int width)
+{
+ struct tree *tp = get_tree(objid, objidlen, tree_head);
+ struct tree *subtree = tree_head;
+ int pos, len;
+ char tmpbuf[128];
+ const char *cp;
+
+ if (NULL == tp)
+ return 0;
+
+ if (tp->type <= TYPE_SIMPLE_LAST)
+ cp = " OBJECT-TYPE";
+ else
+ switch (tp->type) {
+ case TYPE_TRAPTYPE:
+ cp = " TRAP-TYPE";
+ break;
+ case TYPE_NOTIFTYPE:
+ cp = " NOTIFICATION-TYPE";
+ break;
+ case TYPE_OBJGROUP:
+ cp = " OBJECT-GROUP";
+ break;
+ case TYPE_AGENTCAP:
+ cp = " AGENT-CAPABILITIES";
+ break;
+ case TYPE_MODID:
+ cp = " MODULE-IDENTITY";
+ break;
+ case TYPE_OBJIDENTITY:
+ cp = " OBJECT-IDENTITY";
+ break;
+ case TYPE_MODCOMP:
+ cp = " MODULE-COMPLIANCE";
+ break;
+ default:
+ sprintf(tmpbuf, " type_%d", tp->type);
+ cp = tmpbuf;
+ }
+
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tp->label) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, cp) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n")) {
+ return 0;
+ }
+ if (!print_tree_node(buf, buf_len, out_len, allow_realloc, tp, width))
+ return 0;
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "::= {"))
+ return 0;
+ pos = 5;
+ while (objidlen > 1) {
+ for (; subtree; subtree = subtree->next_peer) {
+ if (*objid == subtree->subid) {
+ while (subtree->next_peer && subtree->next_peer->subid == *objid)
+ subtree = subtree->next_peer;
+ if (strncmp(subtree->label, ANON, ANON_LEN)) {
+ snprintf(tmpbuf, sizeof(tmpbuf), " %s(%lu)", subtree->label, subtree->subid);
+ tmpbuf[ sizeof(tmpbuf)-1 ] = 0;
+ } else
+ sprintf(tmpbuf, " %lu", subtree->subid);
+ len = strlen(tmpbuf);
+ if (pos + len + 2 > width) {
+ if (!snmp_cstrcat(buf, buf_len, out_len,
+ allow_realloc, "\n "))
+ return 0;
+ pos = 5;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tmpbuf))
+ return 0;
+ pos += len;
+ objid++;
+ objidlen--;
+ break;
+ }
+ }
+ if (subtree)
+ subtree = subtree->child_list;
+ else
+ break;
+ }
+ while (objidlen > 1) {
+ sprintf(tmpbuf, " %" NETSNMP_PRIo "u", *objid);
+ len = strlen(tmpbuf);
+ if (pos + len + 2 > width) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n "))
+ return 0;
+ pos = 5;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tmpbuf))
+ return 0;
+ pos += len;
+ objid++;
+ objidlen--;
+ }
+ sprintf(tmpbuf, " %" NETSNMP_PRIo "u }", *objid);
+ len = strlen(tmpbuf);
+ if (pos + len + 2 > width) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n "))
+ return 0;
+ pos = 5;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tmpbuf))
+ return 0;
+ return 1;
+}
+
+static int
+print_tree_node(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ struct tree *tp, int width)
+{
+ const char *cp;
+ char str[MAXTOKEN];
+ int i, prevmod, pos, len;
+
+ if (tp) {
+ module_name(tp->modid, str);
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " -- FROM\t") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ pos = 16+strlen(str);
+ for (i = 1, prevmod = tp->modid; i < tp->number_modules; i++) {
+ if (prevmod != tp->module_list[i]) {
+ module_name(tp->module_list[i], str);
+ len = strlen(str);
+ if (pos + len + 2 > width) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ ",\n --\t\t"))
+ return 0;
+ pos = 16;
+ }
+ else {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, ", "))
+ return 0;
+ pos += 2;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ pos += len;
+ }
+ prevmod = tp->module_list[i];
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n"))
+ return 0;
+ if (tp->tc_index != -1) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " -- TEXTUAL CONVENTION ") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ get_tc_descriptor(tp->tc_index)) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n"))
+ return 0;
+ }
+ switch (tp->type) {
+ case TYPE_OBJID:
+ cp = "OBJECT IDENTIFIER";
+ break;
+ case TYPE_OCTETSTR:
+ cp = "OCTET STRING";
+ break;
+ case TYPE_INTEGER:
+ cp = "INTEGER";
+ break;
+ case TYPE_NETADDR:
+ cp = "NetworkAddress";
+ break;
+ case TYPE_IPADDR:
+ cp = "IpAddress";
+ break;
+ case TYPE_COUNTER:
+ cp = "Counter32";
+ break;
+ case TYPE_GAUGE:
+ cp = "Gauge32";
+ break;
+ case TYPE_TIMETICKS:
+ cp = "TimeTicks";
+ break;
+ case TYPE_OPAQUE:
+ cp = "Opaque";
+ break;
+ case TYPE_NULL:
+ cp = "NULL";
+ break;
+ case TYPE_COUNTER64:
+ cp = "Counter64";
+ break;
+ case TYPE_BITSTRING:
+ cp = "BITS";
+ break;
+ case TYPE_NSAPADDRESS:
+ cp = "NsapAddress";
+ break;
+ case TYPE_UINTEGER:
+ cp = "UInteger32";
+ break;
+ case TYPE_UNSIGNED32:
+ cp = "Unsigned32";
+ break;
+ case TYPE_INTEGER32:
+ cp = "Integer32";
+ break;
+ default:
+ cp = NULL;
+ break;
+ }
+#if NETSNMP_ENABLE_TESTING_CODE
+ if (!cp && (tp->ranges || tp->enums)) { /* ranges without type ? */
+ sprintf(str, "?0 with %s %s ?",
+ tp->ranges ? "Range" : "", tp->enums ? "Enum" : "");
+ cp = str;
+ }
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+ if (cp)
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " SYNTAX\t") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, cp))
+ return 0;
+ if (tp->ranges) {
+ struct range_list *rp = tp->ranges;
+ int first = 1;
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " ("))
+ return 0;
+ while (rp) {
+ switch (tp->type) {
+ case TYPE_INTEGER:
+ case TYPE_INTEGER32:
+ if (rp->low == rp->high)
+ sprintf(str, "%s%d", (first ? "" : " | "), rp->low );
+ else
+ sprintf(str, "%s%d..%d", (first ? "" : " | "),
+ rp->low, rp->high);
+ break;
+ case TYPE_UNSIGNED32:
+ case TYPE_OCTETSTR:
+ case TYPE_GAUGE:
+ case TYPE_UINTEGER:
+ if (rp->low == rp->high)
+ sprintf(str, "%s%u", (first ? "" : " | "),
+ (unsigned)rp->low );
+ else
+ sprintf(str, "%s%u..%u", (first ? "" : " | "),
+ (unsigned)rp->low, (unsigned)rp->high);
+ break;
+ default:
+ /* No other range types allowed */
+ break;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ if (first)
+ first = 0;
+ rp = rp->next;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, ") "))
+ return 0;
+ }
+ if (tp->enums) {
+ struct enum_list *ep = tp->enums;
+ int first = 1;
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " {"))
+ return 0;
+ pos = 16 + strlen(cp) + 2;
+ while (ep) {
+ if (first)
+ first = 0;
+ else
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, ", "))
+ return 0;
+ snprintf(str, sizeof(str), "%s(%d)", ep->label, ep->value);
+ str[ sizeof(str)-1 ] = 0;
+ len = strlen(str);
+ if (pos + len + 2 > width) {
+ if (!snmp_cstrcat(buf, buf_len, out_len,
+ allow_realloc, "\n\t\t "))
+ return 0;
+ pos = 18;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ pos += len + 2;
+ ep = ep->next;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "} "))
+ return 0;
+ }
+ if (cp)
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n"))
+ return 0;
+ if (tp->hint)
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " DISPLAY-HINT\t\"") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tp->hint) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\"\n"))
+ return 0;
+ if (tp->units)
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " UNITS\t\t\"") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tp->units) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\"\n"))
+ return 0;
+ switch (tp->access) {
+ case MIB_ACCESS_READONLY:
+ cp = "read-only";
+ break;
+ case MIB_ACCESS_READWRITE:
+ cp = "read-write";
+ break;
+ case MIB_ACCESS_WRITEONLY:
+ cp = "write-only";
+ break;
+ case MIB_ACCESS_NOACCESS:
+ cp = "not-accessible";
+ break;
+ case MIB_ACCESS_NOTIFY:
+ cp = "accessible-for-notify";
+ break;
+ case MIB_ACCESS_CREATE:
+ cp = "read-create";
+ break;
+ case 0:
+ cp = NULL;
+ break;
+ default:
+ sprintf(str, "access_%d", tp->access);
+ cp = str;
+ }
+ if (cp)
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " MAX-ACCESS\t") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, cp) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n"))
+ return 0;
+ switch (tp->status) {
+ case MIB_STATUS_MANDATORY:
+ cp = "mandatory";
+ break;
+ case MIB_STATUS_OPTIONAL:
+ cp = "optional";
+ break;
+ case MIB_STATUS_OBSOLETE:
+ cp = "obsolete";
+ break;
+ case MIB_STATUS_DEPRECATED:
+ cp = "deprecated";
+ break;
+ case MIB_STATUS_CURRENT:
+ cp = "current";
+ break;
+ case 0:
+ cp = NULL;
+ break;
+ default:
+ sprintf(str, "status_%d", tp->status);
+ cp = str;
+ }
+#if NETSNMP_ENABLE_TESTING_CODE
+ if (!cp && (tp->indexes)) { /* index without status ? */
+ sprintf(str, "?0 with %s ?", tp->indexes ? "Index" : "");
+ cp = str;
+ }
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+ if (cp)
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " STATUS\t") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, cp) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n"))
+ return 0;
+ if (tp->augments)
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " AUGMENTS\t{ ") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tp->augments) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " }\n"))
+ return 0;
+ if (tp->indexes) {
+ struct index_list *ip = tp->indexes;
+ int first = 1;
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " INDEX\t\t{ "))
+ return 0;
+ pos = 16 + 2;
+ while (ip) {
+ if (first)
+ first = 0;
+ else
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, ", "))
+ return 0;
+ snprintf(str, sizeof(str), "%s%s",
+ ip->isimplied ? "IMPLIED " : "",
+ ip->ilabel);
+ str[ sizeof(str)-1 ] = 0;
+ len = strlen(str);
+ if (pos + len + 2 > width) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n\t\t "))
+ return 0;
+ pos = 16 + 2;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ pos += len + 2;
+ ip = ip->next;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " }\n"))
+ return 0;
+ }
+ if (tp->varbinds) {
+ struct varbind_list *vp = tp->varbinds;
+ int first = 1;
+
+ if (tp->type == TYPE_TRAPTYPE) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " VARIABLES\t{ "))
+ return 0;
+ } else {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " OBJECTS\t{ "))
+ return 0;
+ }
+ pos = 16 + 2;
+ while (vp) {
+ if (first)
+ first = 0;
+ else
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, ", "))
+ return 0;
+ strlcpy(str, vp->vblabel, sizeof(str));
+ len = strlen(str);
+ if (pos + len + 2 > width) {
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ "\n\t\t "))
+ return 0;
+ pos = 16 + 2;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ pos += len + 2;
+ vp = vp->next;
+ }
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " }\n"))
+ return 0;
+ }
+ if (tp->description)
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " DESCRIPTION\t\"") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tp->description) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\"\n"))
+ return 0;
+ if (tp->defaultValue)
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
+ " DEFVAL\t{ ") ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tp->defaultValue) ||
+ !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, " }\n"))
+ return 0;
+ } else
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "No description\n"))
+ return 0;
+ return 1;
+}
+
+int
+get_module_node(const char *fname,
+ const char *module, oid * objid, size_t * objidlen)
+{
+ int modid, rc = 0;
+ struct tree *tp;
+ char *name, *cp;
+
+ if (!strcmp(module, "ANY"))
+ modid = -1;
+ else {
+ netsnmp_read_module(module);
+ modid = which_module(module);
+ if (modid == -1)
+ return 0;
+ }
+
+ /*
+ * Isolate the first component of the name ...
+ */
+ name = strdup(fname);
+ cp = strchr(name, '.');
+ if (cp != NULL) {
+ *cp = '\0';
+ cp++;
+ }
+ /*
+ * ... and locate it in the tree.
+ */
+ tp = find_tree_node(name, modid);
+ if (tp) {
+ size_t maxlen = *objidlen;
+
+ /*
+ * Set the first element of the object ID
+ */
+ if (node_to_oid(tp, objid, objidlen)) {
+ rc = 1;
+
+ /*
+ * If the name requested was more than one element,
+ * tag on the rest of the components
+ */
+ if (cp != NULL)
+ rc = _add_strings_to_oid(tp, cp, objid, objidlen, maxlen);
+ }
+ }
+
+ SNMP_FREE(name);
+ return (rc);
+}
+
+
+/**
+ * @internal
+ *
+ * Populates the object identifier from a node in the MIB hierarchy.
+ * Builds up the object ID, working backwards,
+ * starting from the end of the objid buffer.
+ * When the top of the MIB tree is reached, the buffer is adjusted.
+ *
+ * The buffer length is set to the number of subidentifiers
+ * for the object identifier associated with the MIB node.
+ *
+ * @return the number of subidentifiers copied.
+ *
+ * If 0 is returned, the objid buffer is too small,
+ * and the buffer contents are indeterminate.
+ * The buffer length can be used to create a larger buffer.
+ */
+static int
+node_to_oid(struct tree *tp, oid * objid, size_t * objidlen)
+{
+ int numids, lenids;
+ oid *op;
+
+ if (!tp || !objid || !objidlen)
+ return 0;
+
+ lenids = (int) *objidlen;
+ op = objid + lenids; /* points after the last element */
+
+ for (numids = 0; tp; tp = tp->parent, numids++) {
+ if (numids >= lenids)
+ continue;
+ --op;
+ *op = tp->subid;
+ }
+
+ *objidlen = (size_t) numids;
+ if (numids > lenids) {
+ return 0;
+ }
+
+ if (numids < lenids)
+ memmove(objid, op, numids * sizeof(oid));
+
+ return (numids);
+}
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+/*
+ * Replace \x with x stop at eos_marker
+ * return NULL if eos_marker not found
+ */
+static char *_apply_escapes(char *src, char eos_marker)
+{
+ char *dst;
+ int backslash = 0;
+
+ dst = src;
+ while (*src) {
+ if (backslash) {
+ backslash = 0;
+ *dst++ = *src;
+ } else {
+ if (eos_marker == *src) break;
+ if ('\\' == *src) {
+ backslash = 1;
+ } else {
+ *dst++ = *src;
+ }
+ }
+ src++;
+ }
+ if (!*src) {
+ /* never found eos_marker */
+ return NULL;
+ } else {
+ *dst = 0;
+ return src;
+ }
+}
+
+static int
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+_add_strings_to_oid(struct tree *tp, char *cp,
+ oid * objid, size_t * objidlen, size_t maxlen)
+#else
+_add_strings_to_oid(void *tp, char *cp,
+ oid * objid, size_t * objidlen, size_t maxlen)
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+{
+ oid subid;
+ int len_index = 1000000;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ struct tree *tp2 = NULL;
+ struct index_list *in_dices = NULL;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ char *fcp, *ecp, *cp2 = NULL;
+ char doingquote;
+ int len = -1, pos = -1;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ int check =
+ !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_CHECK_RANGE);
+ int do_hint = !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NO_DISPLAY_HINT);
+
+ while (cp && tp && tp->child_list) {
+ fcp = cp;
+ tp2 = tp->child_list;
+ /*
+ * Isolate the next entry
+ */
+ cp2 = strchr(cp, '.');
+ if (cp2)
+ *cp2++ = '\0';
+
+ /*
+ * Search for the appropriate child
+ */
+ if (isdigit((unsigned char)(*cp))) {
+ subid = strtoul(cp, &ecp, 0);
+ if (*ecp)
+ goto bad_id;
+ while (tp2 && tp2->subid != subid)
+ tp2 = tp2->next_peer;
+ } else {
+ while (tp2 && strcmp(tp2->label, fcp))
+ tp2 = tp2->next_peer;
+ if (!tp2)
+ goto bad_id;
+ subid = tp2->subid;
+ }
+ if (*objidlen >= maxlen)
+ goto bad_id;
+ while (tp2 && tp2->next_peer && tp2->next_peer->subid == subid)
+ tp2 = tp2->next_peer;
+ objid[*objidlen] = subid;
+ (*objidlen)++;
+
+ cp = cp2;
+ if (!tp2)
+ break;
+ tp = tp2;
+ }
+
+ if (tp && !tp->child_list) {
+ if ((tp2 = tp->parent)) {
+ if (tp2->indexes)
+ in_dices = tp2->indexes;
+ else if (tp2->augments) {
+ tp2 = find_tree_node(tp2->augments, -1);
+ if (tp2)
+ in_dices = tp2->indexes;
+ }
+ }
+ tp = NULL;
+ }
+
+ while (cp && in_dices) {
+ fcp = cp;
+
+ tp = find_tree_node(in_dices->ilabel, -1);
+ if (!tp)
+ break;
+ switch (tp->type) {
+ case TYPE_INTEGER:
+ case TYPE_INTEGER32:
+ case TYPE_UINTEGER:
+ case TYPE_UNSIGNED32:
+ case TYPE_TIMETICKS:
+ /*
+ * Isolate the next entry
+ */
+ cp2 = strchr(cp, '.');
+ if (cp2)
+ *cp2++ = '\0';
+ if (isdigit((unsigned char)(*cp))) {
+ subid = strtoul(cp, &ecp, 0);
+ if (*ecp)
+ goto bad_id;
+ } else {
+ if (tp->enums) {
+ struct enum_list *ep = tp->enums;
+ while (ep && strcmp(ep->label, cp))
+ ep = ep->next;
+ if (!ep)
+ goto bad_id;
+ subid = ep->value;
+ } else
+ goto bad_id;
+ }
+ if (check && tp->ranges) {
+ struct range_list *rp = tp->ranges;
+ int ok = 0;
+ if (tp->type == TYPE_INTEGER ||
+ tp->type == TYPE_INTEGER32) {
+ while (!ok && rp) {
+ if ((rp->low <= (int) subid)
+ && ((int) subid <= rp->high))
+ ok = 1;
+ else
+ rp = rp->next;
+ }
+ } else { /* check unsigned range */
+ while (!ok && rp) {
+ if (((unsigned int)rp->low <= subid)
+ && (subid <= (unsigned int)rp->high))
+ ok = 1;
+ else
+ rp = rp->next;
+ }
+ }
+ if (!ok)
+ goto bad_id;
+ }
+ if (*objidlen >= maxlen)
+ goto bad_id;
+ objid[*objidlen] = subid;
+ (*objidlen)++;
+ break;
+ case TYPE_IPADDR:
+ if (*objidlen + 4 > maxlen)
+ goto bad_id;
+ for (subid = 0; cp && subid < 4; subid++) {
+ fcp = cp;
+ cp2 = strchr(cp, '.');
+ if (cp2)
+ *cp2++ = 0;
+ objid[*objidlen] = strtoul(cp, &ecp, 0);
+ if (*ecp)
+ goto bad_id;
+ if (check && objid[*objidlen] > 255)
+ goto bad_id;
+ (*objidlen)++;
+ cp = cp2;
+ }
+ break;
+ case TYPE_OCTETSTR:
+ if (tp->ranges && !tp->ranges->next
+ && tp->ranges->low == tp->ranges->high)
+ len = tp->ranges->low;
+ else
+ len = -1;
+ pos = 0;
+ if (*cp == '"' || *cp == '\'') {
+ doingquote = *cp++;
+ /*
+ * insert length if requested
+ */
+ if (!in_dices->isimplied && len == -1) {
+ if (doingquote == '\'') {
+ snmp_set_detail
+ ("'-quote is for fixed length strings");
+ return 0;
+ }
+ if (*objidlen >= maxlen)
+ goto bad_id;
+ len_index = *objidlen;
+ (*objidlen)++;
+ } else if (doingquote == '"') {
+ snmp_set_detail
+ ("\"-quote is for variable length strings");
+ return 0;
+ }
+
+ cp2 = _apply_escapes(cp, doingquote);
+ if (!cp2) goto bad_id;
+ else {
+ unsigned char *new_val;
+ int new_val_len;
+ int parsed_hint = 0;
+ const char *parsed_value;
+
+ if (do_hint && tp->hint) {
+ parsed_value = parse_octet_hint(tp->hint, cp,
+ &new_val, &new_val_len);
+ parsed_hint = parsed_value == NULL;
+ }
+ if (parsed_hint) {
+ int i;
+ for (i = 0; i < new_val_len; i++) {
+ if (*objidlen >= maxlen) goto bad_id;
+ objid[ *objidlen ] = new_val[i];
+ (*objidlen)++;
+ pos++;
+ }
+ SNMP_FREE(new_val);
+ } else {
+ while(*cp) {
+ if (*objidlen >= maxlen) goto bad_id;
+ objid[ *objidlen ] = *cp++;
+ (*objidlen)++;
+ pos++;
+ }
+ }
+ }
+
+ cp2++;
+ if (!*cp2)
+ cp2 = NULL;
+ else if (*cp2 != '.')
+ goto bad_id;
+ else
+ cp2++;
+ if (check) {
+ if (len == -1) {
+ struct range_list *rp = tp->ranges;
+ int ok = 0;
+ while (rp && !ok)
+ if (rp->low <= pos && pos <= rp->high)
+ ok = 1;
+ else
+ rp = rp->next;
+ if (!ok)
+ goto bad_id;
+ if (!in_dices->isimplied)
+ objid[len_index] = pos;
+ } else if (pos != len)
+ goto bad_id;
+ }
+ else if (len == -1 && !in_dices->isimplied)
+ objid[len_index] = pos;
+ } else {
+ if (!in_dices->isimplied && len == -1) {
+ fcp = cp;
+ cp2 = strchr(cp, '.');
+ if (cp2)
+ *cp2++ = 0;
+ len = strtoul(cp, &ecp, 0);
+ if (*ecp)
+ goto bad_id;
+ if (*objidlen + len + 1 >= maxlen)
+ goto bad_id;
+ objid[*objidlen] = len;
+ (*objidlen)++;
+ cp = cp2;
+ }
+ while (len && cp) {
+ fcp = cp;
+ cp2 = strchr(cp, '.');
+ if (cp2)
+ *cp2++ = 0;
+ objid[*objidlen] = strtoul(cp, &ecp, 0);
+ if (*ecp)
+ goto bad_id;
+ if (check && objid[*objidlen] > 255)
+ goto bad_id;
+ (*objidlen)++;
+ len--;
+ cp = cp2;
+ }
+ }
+ break;
+ case TYPE_OBJID:
+ in_dices = NULL;
+ cp2 = cp;
+ break;
+ case TYPE_NETADDR:
+ fcp = cp;
+ cp2 = strchr(cp, '.');
+ if (cp2)
+ *cp2++ = 0;
+ subid = strtoul(cp, &ecp, 0);
+ if (*ecp)
+ goto bad_id;
+ if (*objidlen + 1 >= maxlen)
+ goto bad_id;
+ objid[*objidlen] = subid;
+ (*objidlen)++;
+ cp = cp2;
+ if (subid == 1) {
+ for (len = 0; cp && len < 4; len++) {
+ fcp = cp;
+ cp2 = strchr(cp, '.');
+ if (cp2)
+ *cp2++ = 0;
+ subid = strtoul(cp, &ecp, 0);
+ if (*ecp)
+ goto bad_id;
+ if (*objidlen + 1 >= maxlen)
+ goto bad_id;
+ if (check && subid > 255)
+ goto bad_id;
+ objid[*objidlen] = subid;
+ (*objidlen)++;
+ cp = cp2;
+ }
+ }
+ else {
+ in_dices = NULL;
+ }
+ break;
+ default:
+ snmp_log(LOG_ERR, "Unexpected index type: %d %s %s\n",
+ tp->type, in_dices->ilabel, cp);
+ in_dices = NULL;
+ cp2 = cp;
+ break;
+ }
+ cp = cp2;
+ if (in_dices)
+ in_dices = in_dices->next;
+ }
+
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ while (cp) {
+ fcp = cp;
+ switch (*cp) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ cp2 = strchr(cp, '.');
+ if (cp2)
+ *cp2++ = 0;
+ subid = strtoul(cp, &ecp, 0);
+ if (*ecp)
+ goto bad_id;
+ if (*objidlen >= maxlen)
+ goto bad_id;
+ objid[*objidlen] = subid;
+ (*objidlen)++;
+ break;
+ case '"':
+ case '\'':
+ doingquote = *cp++;
+ /*
+ * insert length if requested
+ */
+ if (doingquote == '"') {
+ if (*objidlen >= maxlen)
+ goto bad_id;
+ objid[*objidlen] = len = strchr(cp, doingquote) - cp;
+ (*objidlen)++;
+ }
+
+ if (!cp)
+ goto bad_id;
+ while (*cp && *cp != doingquote) {
+ if (*objidlen >= maxlen)
+ goto bad_id;
+ objid[*objidlen] = *cp++;
+ (*objidlen)++;
+ }
+ cp2 = cp + 1;
+ if (!*cp2)
+ cp2 = NULL;
+ else if (*cp2 == '.')
+ cp2++;
+ else
+ goto bad_id;
+ break;
+ default:
+ goto bad_id;
+ }
+ cp = cp2;
+ }
+ return 1;
+
+ bad_id:
+ {
+ char buf[256];
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (in_dices)
+ snprintf(buf, sizeof(buf), "Index out of range: %s (%s)",
+ fcp, in_dices->ilabel);
+ else if (tp)
+ snprintf(buf, sizeof(buf), "Sub-id not found: %s -> %s", tp->label, fcp);
+ else
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ snprintf(buf, sizeof(buf), "%s", fcp);
+ buf[ sizeof(buf)-1 ] = 0;
+
+ snmp_set_detail(buf);
+ }
+ return 0;
+}
+
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+/**
+ * @see comments on find_best_tree_node for usage after first time.
+ */
+int
+get_wild_node(const char *name, oid * objid, size_t * objidlen)
+{
+ struct tree *tp = find_best_tree_node(name, tree_head, NULL);
+ if (!tp)
+ return 0;
+ return get_node(tp->label, objid, objidlen);
+}
+
+int
+get_node(const char *name, oid * objid, size_t * objidlen)
+{
+ const char *cp;
+ char ch;
+ int res;
+
+ cp = name;
+ while ((ch = *cp))
+ if (('0' <= ch && ch <= '9')
+ || ('a' <= ch && ch <= 'z')
+ || ('A' <= ch && ch <= 'Z')
+ || ch == '-')
+ cp++;
+ else
+ break;
+ if (ch != ':')
+ if (*name == '.')
+ res = get_module_node(name + 1, "ANY", objid, objidlen);
+ else
+ res = get_module_node(name, "ANY", objid, objidlen);
+ else {
+ char *module;
+ /*
+ * requested name is of the form
+ * "module:subidentifier"
+ */
+ module = (char *) malloc((size_t) (cp - name + 1));
+ if (!module)
+ return SNMPERR_GENERR;
+ sprintf(module, "%.*s", (int) (cp - name), name);
+ cp++; /* cp now point to the subidentifier */
+ if (*cp == ':')
+ cp++;
+
+ /*
+ * 'cp' and 'name' *do* go that way round!
+ */
+ res = get_module_node(cp, module, objid, objidlen);
+ SNMP_FREE(module);
+ }
+ if (res == 0) {
+ SET_SNMP_ERROR(SNMPERR_UNKNOWN_OBJID);
+ }
+
+ return res;
+}
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+#ifdef testing
+
+main(int argc, char *argv[])
+{
+ oid objid[MAX_OID_LEN];
+ int objidlen = MAX_OID_LEN;
+ int count;
+ netsnmp_variable_list variable;
+
+ netsnmp_init_mib();
+ if (argc < 2)
+ print_subtree(stdout, tree_head, 0);
+ variable.type = ASN_INTEGER;
+ variable.val.integer = 3;
+ variable.val_len = 4;
+ for (argc--; argc; argc--, argv++) {
+ objidlen = MAX_OID_LEN;
+ printf("read_objid(%s) = %d\n",
+ argv[1], read_objid(argv[1], objid, &objidlen));
+ for (count = 0; count < objidlen; count++)
+ printf("%d.", objid[count]);
+ printf("\n");
+ print_variable(objid, objidlen, &variable);
+ }
+}
+
+#endif /* testing */
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+/*
+ * initialize: no peers included in the report.
+ */
+void
+clear_tree_flags(register struct tree *tp)
+{
+ for (; tp; tp = tp->next_peer) {
+ tp->reported = 0;
+ if (tp->child_list)
+ clear_tree_flags(tp->child_list);
+ /*RECURSE*/}
+}
+
+/*
+ * Update: 1998-07-17 <jhy@gsu.edu>
+ * Added print_oid_report* functions.
+ */
+static int print_subtree_oid_report_labeledoid = 0;
+static int print_subtree_oid_report_oid = 0;
+static int print_subtree_oid_report_symbolic = 0;
+static int print_subtree_oid_report_mibchildoid = 0;
+static int print_subtree_oid_report_suffix = 0;
+
+/*
+ * These methods recurse.
+ */
+static void print_parent_labeledoid(FILE *, struct tree *);
+static void print_parent_oid(FILE *, struct tree *);
+static void print_parent_mibchildoid(FILE *, struct tree *);
+static void print_parent_label(FILE *, struct tree *);
+static void print_subtree_oid_report(FILE *, struct tree *, int);
+
+
+void
+print_oid_report(FILE * fp)
+{
+ struct tree *tp;
+ clear_tree_flags(tree_head);
+ for (tp = tree_head; tp; tp = tp->next_peer)
+ print_subtree_oid_report(fp, tp, 0);
+}
+
+void
+print_oid_report_enable_labeledoid(void)
+{
+ print_subtree_oid_report_labeledoid = 1;
+}
+
+void
+print_oid_report_enable_oid(void)
+{
+ print_subtree_oid_report_oid = 1;
+}
+
+void
+print_oid_report_enable_suffix(void)
+{
+ print_subtree_oid_report_suffix = 1;
+}
+
+void
+print_oid_report_enable_symbolic(void)
+{
+ print_subtree_oid_report_symbolic = 1;
+}
+
+void
+print_oid_report_enable_mibchildoid(void)
+{
+ print_subtree_oid_report_mibchildoid = 1;
+}
+
+/*
+ * helper methods for print_subtree_oid_report()
+ * each one traverses back up the node tree
+ * until there is no parent. Then, the label combination
+ * is output, such that the parent is displayed first.
+ *
+ * Warning: these methods are all recursive.
+ */
+
+static void
+print_parent_labeledoid(FILE * f, struct tree *tp)
+{
+ if (tp) {
+ if (tp->parent) {
+ print_parent_labeledoid(f, tp->parent);
+ /*RECURSE*/}
+ fprintf(f, ".%s(%lu)", tp->label, tp->subid);
+ }
+}
+
+static void
+print_parent_oid(FILE * f, struct tree *tp)
+{
+ if (tp) {
+ if (tp->parent) {
+ print_parent_oid(f, tp->parent);
+ /*RECURSE*/}
+ fprintf(f, ".%lu", tp->subid);
+ }
+}
+
+
+static void print_parent_mibchildoid(FILE * f, struct tree *tp)
+{
+ static struct tree *temp;
+ unsigned long elems[100];
+ int elem_cnt = 0;
+ int i = 0;
+ temp = tp;
+ if (temp) {
+ while (temp->parent) {
+ elems[elem_cnt++] = temp->subid;
+ temp = temp->parent;
+ }
+ elems[elem_cnt++] = temp->subid;
+ }
+ for (i = elem_cnt - 1; i >= 0; i--) {
+ if (i == elem_cnt - 1) {
+ fprintf(f, "%lu", elems[i]);
+ } else {
+ fprintf(f, ".%lu", elems[i]);
+ }
+ }
+}
+
+static void
+print_parent_label(FILE * f, struct tree *tp)
+{
+ if (tp) {
+ if (tp->parent) {
+ print_parent_label(f, tp->parent);
+ /*RECURSE*/}
+ fprintf(f, ".%s", tp->label);
+ }
+}
+
+/**
+ * @internal
+ * This methods generates variations on the original print_subtree() report.
+ * Traverse the tree depth first, from least to greatest sub-identifier.
+ * Warning: this methods recurses and calls methods that recurse.
+ *
+ * @param f File descriptor to print to.
+ * @param tree ???
+ * @param count ???
+ */
+
+static void
+print_subtree_oid_report(FILE * f, struct tree *tree, int count)
+{
+ struct tree *tp;
+
+ count++;
+
+ /*
+ * sanity check
+ */
+ if (!tree) {
+ return;
+ }
+
+ /*
+ * find the not reported peer with the lowest sub-identifier.
+ * if no more, break the loop and cleanup.
+ * set "reported" flag, and create report for this peer.
+ * recurse using the children of this peer, if any.
+ */
+ while (1) {
+ register struct tree *ntp;
+
+ tp = NULL;
+ for (ntp = tree->child_list; ntp; ntp = ntp->next_peer) {
+ if (ntp->reported)
+ continue;
+
+ if (!tp || (tp->subid > ntp->subid))
+ tp = ntp;
+ }
+ if (!tp)
+ break;
+
+ tp->reported = 1;
+
+ if (print_subtree_oid_report_labeledoid) {
+ print_parent_labeledoid(f, tp);
+ fprintf(f, "\n");
+ }
+ if (print_subtree_oid_report_oid) {
+ print_parent_oid(f, tp);
+ fprintf(f, "\n");
+ }
+ if (print_subtree_oid_report_symbolic) {
+ print_parent_label(f, tp);
+ fprintf(f, "\n");
+ }
+ if (print_subtree_oid_report_mibchildoid) {
+ fprintf(f, "\"%s\"\t", tp->label);
+ fprintf(f, "\t\t\"");
+ print_parent_mibchildoid(f, tp);
+ fprintf(f, "\"\n");
+ }
+ if (print_subtree_oid_report_suffix) {
+ int i;
+ for (i = 0; i < count; i++)
+ fprintf(f, " ");
+ fprintf(f, "%s(%ld) type=%d", tp->label, tp->subid, tp->type);
+ if (tp->tc_index != -1)
+ fprintf(f, " tc=%d", tp->tc_index);
+ if (tp->hint)
+ fprintf(f, " hint=%s", tp->hint);
+ if (tp->units)
+ fprintf(f, " units=%s", tp->units);
+
+ fprintf(f, "\n");
+ }
+ print_subtree_oid_report(f, tp, count);
+ /*RECURSE*/}
+}
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+
+/**
+ * Converts timeticks to hours, minutes, seconds string.
+ *
+ * @param timeticks The timeticks to convert.
+ * @param buf Buffer to write to, has to be at
+ * least 40 Bytes large.
+ *
+ * @return The buffer
+ *
+ * @see uptimeString
+ */
+char *
+uptime_string(u_long timeticks, char *buf)
+{
+ return uptime_string_n( timeticks, buf, 40);
+}
+
+char *
+uptime_string_n(u_long timeticks, char *buf, size_t buflen)
+{
+ uptimeString(timeticks, buf, buflen);
+ return buf;
+}
+
+/**
+ * Given a string, parses an oid out of it (if possible).
+ * It will try to parse it based on predetermined configuration if
+ * present or by every method possible otherwise.
+ * If a suffix has been registered using NETSNMP_DS_LIB_OIDSUFFIX, it
+ * will be appended to the input string before processing.
+ *
+ * @param argv The OID to string parse
+ * @param root An OID array where the results are stored.
+ * @param rootlen The max length of the array going in and the data
+ * length coming out.
+ *
+ * @return The root oid pointer if successful, or NULL otherwise.
+ */
+
+oid *
+snmp_parse_oid(const char *argv, oid * root, size_t * rootlen)
+{
+ size_t savlen = *rootlen;
+ static size_t tmpbuf_len = 0;
+ static char *tmpbuf;
+ const char *suffix, *prefix;
+
+ suffix = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OIDSUFFIX);
+ prefix = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OIDPREFIX);
+ if ((suffix && suffix[0]) || (prefix && prefix[0])) {
+ if (!suffix)
+ suffix = "";
+ if (!prefix)
+ prefix = "";
+ if ((strlen(suffix) + strlen(prefix) + strlen(argv) + 2) > tmpbuf_len) {
+ tmpbuf_len = strlen(suffix) + strlen(argv) + strlen(prefix) + 2;
+ tmpbuf = (char *)realloc(tmpbuf, tmpbuf_len);
+ }
+ snprintf(tmpbuf, tmpbuf_len, "%s%s%s%s", prefix, argv,
+ ((suffix[0] == '.' || suffix[0] == '\0') ? "" : "."),
+ suffix);
+ argv = tmpbuf;
+ DEBUGMSGTL(("snmp_parse_oid","Parsing: %s\n",argv));
+ }
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_RANDOM_ACCESS)
+ || strchr(argv, ':')) {
+ if (get_node(argv, root, rootlen)) {
+ return root;
+ }
+ } else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_REGEX_ACCESS)) {
+ clear_tree_flags(tree_head);
+ if (get_wild_node(argv, root, rootlen)) {
+ return root;
+ }
+ } else {
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ if (read_objid(argv, root, rootlen)) {
+ return root;
+ }
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ *rootlen = savlen;
+ if (get_node(argv, root, rootlen)) {
+ return root;
+ }
+ *rootlen = savlen;
+ DEBUGMSGTL(("parse_oid", "wildly parsing\n"));
+ clear_tree_flags(tree_head);
+ if (get_wild_node(argv, root, rootlen)) {
+ return root;
+ }
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ return NULL;
+}
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+/*
+ * Use DISPLAY-HINT to parse a value into an octet string.
+ *
+ * note that "1d1d", "11" could have come from an octet string that
+ * looked like { 1, 1 } or an octet string that looked like { 11 }
+ * because of this, it's doubtful that anyone would use such a display
+ * string. Therefore, the parser ignores this case.
+ */
+
+struct parse_hints {
+ int length;
+ int repeat;
+ int format;
+ int separator;
+ int terminator;
+ unsigned char *result;
+ int result_max;
+ int result_len;
+};
+
+static void parse_hints_reset(struct parse_hints *ph)
+{
+ ph->length = 0;
+ ph->repeat = 0;
+ ph->format = 0;
+ ph->separator = 0;
+ ph->terminator = 0;
+}
+
+static void parse_hints_ctor(struct parse_hints *ph)
+{
+ parse_hints_reset(ph);
+ ph->result = NULL;
+ ph->result_max = 0;
+ ph->result_len = 0;
+}
+
+static int parse_hints_add_result_octet(struct parse_hints *ph, unsigned char octet)
+{
+ if (!(ph->result_len < ph->result_max)) {
+ ph->result_max = ph->result_len + 32;
+ if (!ph->result) {
+ ph->result = (unsigned char *)malloc(ph->result_max);
+ } else {
+ ph->result = (unsigned char *)realloc(ph->result, ph->result_max);
+ }
+ }
+
+ if (!ph->result) {
+ return 0; /* failed */
+ }
+
+ ph->result[ph->result_len++] = octet;
+ return 1; /* success */
+}
+
+static int parse_hints_parse(struct parse_hints *ph, const char **v_in_out)
+{
+ const char *v = *v_in_out;
+ char *nv;
+ int base;
+ int repeats = 0;
+ int repeat_fixup = ph->result_len;
+
+ if (ph->repeat) {
+ if (!parse_hints_add_result_octet(ph, 0)) {
+ return 0;
+ }
+ }
+ do {
+ base = 0;
+ switch (ph->format) {
+ case 'x': base += 6; /* fall through */
+ case 'd': base += 2; /* fall through */
+ case 'o': base += 8; /* fall through */
+ {
+ int i;
+ unsigned long number = strtol(v, &nv, base);
+ if (nv == v) return 0;
+ v = nv;
+ for (i = 0; i < ph->length; i++) {
+ int shift = 8 * (ph->length - 1 - i);
+ if (!parse_hints_add_result_octet(ph, (u_char)(number >> shift) )) {
+ return 0; /* failed */
+ }
+ }
+ }
+ break;
+
+ case 'a':
+ {
+ int i;
+
+ for (i = 0; i < ph->length && *v; i++) {
+ if (!parse_hints_add_result_octet(ph, *v++)) {
+ return 0; /* failed */
+ }
+ }
+ }
+ break;
+ }
+
+ repeats++;
+
+ if (ph->separator && *v) {
+ if (*v == ph->separator) {
+ v++;
+ } else {
+ return 0; /* failed */
+ }
+ }
+
+ if (ph->terminator) {
+ if (*v == ph->terminator) {
+ v++;
+ break;
+ }
+ }
+ } while (ph->repeat && *v);
+ if (ph->repeat) {
+ ph->result[repeat_fixup] = repeats;
+ }
+
+ *v_in_out = v;
+ return 1;
+}
+
+static void parse_hints_length_add_digit(struct parse_hints *ph, int digit)
+{
+ ph->length *= 10;
+ ph->length += digit - '0';
+}
+
+const char *parse_octet_hint(const char *hint, const char *value, unsigned char **new_val, int *new_val_len)
+{
+ const char *h = hint;
+ const char *v = value;
+ struct parse_hints ph;
+ int retval = 1;
+ /* See RFC 1443 */
+ enum {
+ HINT_1_2,
+ HINT_2_3,
+ HINT_1_2_4,
+ HINT_1_2_5
+ } state = HINT_1_2;
+
+ parse_hints_ctor(&ph);
+ while (*h && *v && retval) {
+ switch (state) {
+ case HINT_1_2:
+ if ('*' == *h) {
+ ph.repeat = 1;
+ state = HINT_2_3;
+ } else if (isdigit((unsigned char)(*h))) {
+ parse_hints_length_add_digit(&ph, *h);
+ state = HINT_2_3;
+ } else {
+ return v; /* failed */
+ }
+ break;
+
+ case HINT_2_3:
+ if (isdigit((unsigned char)(*h))) {
+ parse_hints_length_add_digit(&ph, *h);
+ /* state = HINT_2_3 */
+ } else if ('x' == *h || 'd' == *h || 'o' == *h || 'a' == *h) {
+ ph.format = *h;
+ state = HINT_1_2_4;
+ } else {
+ return v; /* failed */
+ }
+ break;
+
+ case HINT_1_2_4:
+ if ('*' == *h) {
+ retval = parse_hints_parse(&ph, &v);
+ parse_hints_reset(&ph);
+
+ ph.repeat = 1;
+ state = HINT_2_3;
+ } else if (isdigit((unsigned char)(*h))) {
+ retval = parse_hints_parse(&ph, &v);
+ parse_hints_reset(&ph);
+
+ parse_hints_length_add_digit(&ph, *h);
+ state = HINT_2_3;
+ } else {
+ ph.separator = *h;
+ state = HINT_1_2_5;
+ }
+ break;
+
+ case HINT_1_2_5:
+ if ('*' == *h) {
+ retval = parse_hints_parse(&ph, &v);
+ parse_hints_reset(&ph);
+
+ ph.repeat = 1;
+ state = HINT_2_3;
+ } else if (isdigit((unsigned char)(*h))) {
+ retval = parse_hints_parse(&ph, &v);
+ parse_hints_reset(&ph);
+
+ parse_hints_length_add_digit(&ph, *h);
+ state = HINT_2_3;
+ } else {
+ ph.terminator = *h;
+
+ retval = parse_hints_parse(&ph, &v);
+ parse_hints_reset(&ph);
+
+ state = HINT_1_2;
+ }
+ break;
+ }
+ h++;
+ }
+ while (*v && retval) {
+ retval = parse_hints_parse(&ph, &v);
+ }
+ if (retval) {
+ *new_val = ph.result;
+ *new_val_len = ph.result_len;
+ } else {
+ if (ph.result) {
+ SNMP_FREE(ph.result);
+ }
+ *new_val = NULL;
+ *new_val_len = 0;
+ }
+ return retval ? NULL : v;
+}
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+#ifdef test_display_hint
+
+int main(int argc, const char **argv)
+{
+ const char *hint;
+ const char *value;
+ unsigned char *new_val;
+ int new_val_len;
+ char *r;
+
+ if (argc < 3) {
+ fprintf(stderr, "usage: dh <hint> <value>\n");
+ exit(2);
+ }
+ hint = argv[1];
+ value = argv[2];
+ r = parse_octet_hint(hint, value, &new_val, &new_val_len);
+ printf("{\"%s\", \"%s\"}: \n\t", hint, value);
+ if (r) {
+ *r = 0;
+ printf("returned failed\n");
+ printf("value syntax error at: %s\n", value);
+ }
+ else {
+ int i;
+ printf("returned success\n");
+ for (i = 0; i < new_val_len; i++) {
+ int c = new_val[i] & 0xFF;
+ printf("%02X(%c) ", c, isprint(c) ? c : ' ');
+ }
+ SNMP_FREE(new_val);
+ }
+ printf("\n");
+ exit(0);
+}
+
+#endif /* test_display_hint */
+
+#ifndef NETSNMP_FEATURE_REMOVE_MIB_TO_ASN_TYPE
+u_char
+mib_to_asn_type(int mib_type)
+{
+ switch (mib_type) {
+ case TYPE_OBJID:
+ return ASN_OBJECT_ID;
+
+ case TYPE_OCTETSTR:
+ return ASN_OCTET_STR;
+
+ case TYPE_NETADDR:
+ case TYPE_IPADDR:
+ return ASN_IPADDRESS;
+
+ case TYPE_INTEGER32:
+ case TYPE_INTEGER:
+ return ASN_INTEGER;
+
+ case TYPE_COUNTER:
+ return ASN_COUNTER;
+
+ case TYPE_GAUGE:
+ return ASN_GAUGE;
+
+ case TYPE_TIMETICKS:
+ return ASN_TIMETICKS;
+
+ case TYPE_OPAQUE:
+ return ASN_OPAQUE;
+
+ case TYPE_NULL:
+ return ASN_NULL;
+
+ case TYPE_COUNTER64:
+ return ASN_COUNTER64;
+
+ case TYPE_BITSTRING:
+ return ASN_BIT_STR;
+
+ case TYPE_UINTEGER:
+ case TYPE_UNSIGNED32:
+ return ASN_UNSIGNED;
+
+ case TYPE_NSAPADDRESS:
+ return ASN_NSAP;
+
+ }
+ return -1;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MIB_TO_ASN_TYPE */
+
+/**
+ * Converts a string to its OID form.
+ * in example "hello" = 5 . 'h' . 'e' . 'l' . 'l' . 'o'
+ *
+ * @param S The string.
+ * @param O The oid.
+ * @param L The length of the oid.
+ *
+ * @return 0 on Sucess, 1 on failure.
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_MIB_STRING_CONVERSIONS
+int
+netsnmp_str2oid(const char *S, oid * O, int L)
+{
+ const char *c = S;
+ oid *o = &O[1];
+
+ --L; /* leave room for length prefix */
+
+ for (; *c && L; --L, ++o, ++c)
+ *o = *c;
+
+ /*
+ * make sure we got to the end of the string
+ */
+ if (*c != 0)
+ return 1;
+
+ /*
+ * set the length of the oid
+ */
+ *O = c - S;
+
+ return 0;
+}
+
+/**
+ * Converts an OID to its character form.
+ * in example 5 . 1 . 2 . 3 . 4 . 5 = 12345
+ *
+ * @param C The character buffer.
+ * @param L The length of the buffer.
+ * @param O The oid.
+ *
+ * @return 0 on Sucess, 1 on failure.
+ */
+int
+netsnmp_oid2chars(char *C, int L, const oid * O)
+{
+ char *c = C;
+ const oid *o = &O[1];
+
+ if (L < (int)*O)
+ return 1;
+
+ L = *O; /** length */
+ for (; L; --L, ++o, ++c) {
+ if (*o > 0xFF)
+ return 1;
+ *c = (char)*o;
+ }
+ return 0;
+}
+
+/**
+ * Converts an OID to its string form.
+ * in example 5 . 'h' . 'e' . 'l' . 'l' . 'o' = "hello\0" (null terminated)
+ *
+ * @param S The character string buffer.
+ * @param L The length of the string buffer.
+ * @param O The oid.
+ *
+ * @return 0 on Sucess, 1 on failure.
+ */
+int
+netsnmp_oid2str(char *S, int L, oid * O)
+{
+ int rc;
+
+ if (L <= (int)*O)
+ return 1;
+
+ rc = netsnmp_oid2chars(S, L, O);
+ if (rc)
+ return 1;
+
+ S[ *O ] = 0;
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MIB_STRING_CONVERSIONS */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_MIB_SNPRINT
+int
+snprint_by_type(char *buf, size_t buf_len,
+ netsnmp_variable_list * var,
+ const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_by_type((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_hexstring(char *buf, size_t buf_len, const u_char * cp, size_t len)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_hexstring((u_char **) & buf, &buf_len, &out_len, 0,
+ cp, len))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_asciistring(char *buf, size_t buf_len,
+ const u_char * cp, size_t len)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_asciistring
+ ((u_char **) & buf, &buf_len, &out_len, 0, cp, len))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_octet_string(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_octet_string
+ ((u_char **) & buf, &buf_len, &out_len, 0, var, enums, hint,
+ units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_opaque(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_opaque((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_object_identifier(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums, const char *hint,
+ const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_object_identifier
+ ((u_char **) & buf, &buf_len, &out_len, 0, var, enums, hint,
+ units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_timeticks(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_timeticks((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_hinted_integer(char *buf, size_t buf_len,
+ long val, const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_hinted_integer
+ ((u_char **) & buf, &buf_len, &out_len, 0, val, 'd', hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_integer(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_integer((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_uinteger(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_uinteger((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_gauge(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_gauge((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_counter(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_counter((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_networkaddress(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var,
+ const struct enum_list *enums, const char *hint,
+ const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_networkaddress
+ ((u_char **) & buf, &buf_len, &out_len, 0, var, enums, hint,
+ units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_ipaddress(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_ipaddress((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_null(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_null((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_bitstring(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_bitstring((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_nsapaddress(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_nsapaddress
+ ((u_char **) & buf, &buf_len, &out_len, 0, var, enums, hint,
+ units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_counter64(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_counter64((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_badtype(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_badtype((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+int
+snprint_float(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_float((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+
+int
+snprint_double(char *buf, size_t buf_len,
+ const netsnmp_variable_list * var, const struct enum_list *enums,
+ const char *hint, const char *units)
+{
+ size_t out_len = 0;
+ if (sprint_realloc_double((u_char **) & buf, &buf_len, &out_len, 0,
+ var, enums, hint, units))
+ return (int) out_len;
+ else
+ return -1;
+}
+#endif
+#endif /* NETSNMP_FEATURE_REMOVE_MIB_SNPRINT */
+/** @} */
+
diff --git a/snmplib/mt_support.c b/snmplib/mt_support.c
new file mode 100644
index 0000000..d28ebe4
--- /dev/null
+++ b/snmplib/mt_support.c
@@ -0,0 +1,169 @@
+/*
+ * mt_support.c - multi-thread resource locking support
+ */
+/*
+ * Author: Markku Laukkanen
+ * Created: 6-Sep-1999
+ * History:
+ * 8-Sep-1999 M. Slifcak method names changed;
+ * use array of resource locking structures.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <errno.h>
+#include <net-snmp/library/mt_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef NETSNMP_REENTRANT
+
+static mutex_type s_res[MT_MAX_IDS][MT_LIB_MAXIMUM]; /* locking structures */
+
+static mutex_type *
+_mt_res(int groupID, int resourceID)
+{
+ if (groupID < 0) {
+ return 0;
+ }
+ if (groupID >= MT_MAX_IDS) {
+ return 0;
+ }
+ if (resourceID < 0) {
+ return 0;
+ }
+ if (resourceID >= MT_LIB_MAXIMUM) {
+ return 0;
+ }
+ return (&s_res[groupID][resourceID]);
+}
+
+static int
+snmp_res_init_mutex(mutex_type *mutex)
+{
+ int rc = 0;
+#if HAVE_PTHREAD_H
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ rc = pthread_mutex_init(mutex, &attr);
+ pthread_mutexattr_destroy(&attr);
+#elif defined(WIN32)
+ InitializeCriticalSection(mutex);
+#endif
+
+ return rc;
+}
+
+int
+snmp_res_init(void)
+{
+ int ii, jj, rc = 0;
+ mutex_type *mutex;
+
+ for (jj = 0; (0 == rc) && (jj < MT_MAX_IDS); jj++) {
+ for (ii = 0; (0 == rc) && (ii < MT_LIB_MAXIMUM); ii++) {
+ mutex = _mt_res(jj, ii);
+ if (!mutex) {
+ continue;
+ }
+ rc = snmp_res_init_mutex(mutex);
+ }
+ }
+
+ return rc;
+}
+
+int
+snmp_res_destroy_mutex(int groupID, int resourceID)
+{
+ int rc = 0;
+ mutex_type *mutex = _mt_res(groupID, resourceID);
+ if (!mutex) {
+ return EFAULT;
+ }
+
+#if HAVE_PTHREAD_H
+ rc = pthread_mutex_destroy(mutex);
+#elif defined(WIN32)
+ DeleteCriticalSection(mutex);
+#endif
+
+ return rc;
+}
+
+int
+snmp_res_lock(int groupID, int resourceID)
+{
+ int rc = 0;
+ mutex_type *mutex = _mt_res(groupID, resourceID);
+
+ if (!mutex) {
+ return EFAULT;
+ }
+
+#if HAVE_PTHREAD_H
+ rc = pthread_mutex_lock(mutex);
+#elif defined(WIN32)
+ EnterCriticalSection(mutex);
+#endif
+
+ return rc;
+}
+
+int
+snmp_res_unlock(int groupID, int resourceID)
+{
+ int rc = 0;
+ mutex_type *mutex = _mt_res(groupID, resourceID);
+
+ if (!mutex) {
+ return EFAULT;
+ }
+
+#if HAVE_PTHREAD_H
+ rc = pthread_mutex_unlock(mutex);
+#elif defined(WIN32)
+ LeaveCriticalSection(mutex);
+#endif
+
+ return rc;
+}
+
+#else /* NETSNMP_REENTRANT */
+#ifdef WIN32
+
+/*
+ * Provide "do nothing" targets for Release (.DLL) builds.
+ */
+
+int
+snmp_res_init(void)
+{
+ return 0;
+}
+
+int
+snmp_res_lock(int groupID, int resourceID)
+{
+ return 0;
+}
+
+int
+snmp_res_unlock(int groupID, int resourceID)
+{
+ return 0;
+}
+
+int
+snmp_res_destroy_mutex(int groupID, int resourceID)
+{
+ return 0;
+}
+#endif /* WIN32 */
+#endif /* NETSNMP_REENTRANT */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/snmplib/oid_stash.c b/snmplib/oid_stash.c
new file mode 100644
index 0000000..8a79897
--- /dev/null
+++ b/snmplib/oid_stash.c
@@ -0,0 +1,461 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <string.h>
+
+#include <stdlib.h>
+#include <sys/types.h>
+
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+
+netsnmp_feature_child_of(oid_stash_all, libnetsnmp)
+netsnmp_feature_child_of(oid_stash, oid_stash_all)
+netsnmp_feature_child_of(oid_stash_no_free, oid_stash_all)
+
+#ifndef NETSNMP_FEATURE_REMOVE_OID_STASH
+
+/** @defgroup oid_stash Store and retrieve data referenced by an OID.
+ This is essentially a way of storing data associated with a given
+ OID. It stores a bunch of data pointers within a memory tree that
+ allows fairly efficient lookups with a heavily populated tree.
+ @ingroup library
+ @{
+*/
+
+/*
+ * xxx-rks: when you have some spare time:
+ *
+ * b) basically, everything currently creates one node per sub-oid,
+ * which is less than optimal. add code to create nodes with the
+ * longest possible OID per node, and split nodes when necessary
+ * during adds.
+ *
+ * c) If you are feeling really ambitious, also merge split nodes if
+ * possible on a delete.
+ *
+ * xxx-wes: uh, right, like I *ever* have that much time.
+ *
+ */
+
+/***************************************************************************
+ *
+ *
+ ***************************************************************************/
+
+/**
+ * Create an netsnmp_oid_stash node
+ *
+ * @param mysize the size of the child pointer array
+ *
+ * @return NULL on error, otherwise the newly allocated node
+ */
+netsnmp_oid_stash_node *
+netsnmp_oid_stash_create_sized_node(size_t mysize)
+{
+ netsnmp_oid_stash_node *ret;
+ ret = SNMP_MALLOC_TYPEDEF(netsnmp_oid_stash_node);
+ if (!ret)
+ return NULL;
+ ret->children = (netsnmp_oid_stash_node**) calloc(mysize, sizeof(netsnmp_oid_stash_node *));
+ if (!ret->children) {
+ free(ret);
+ return NULL;
+ }
+ ret->children_size = mysize;
+ return ret;
+}
+
+/** Creates a netsnmp_oid_stash_node.
+ * Assumes you want the default OID_STASH_CHILDREN_SIZE hash size for the node.
+ * @return NULL on error, otherwise the newly allocated node
+ */
+NETSNMP_INLINE netsnmp_oid_stash_node *
+netsnmp_oid_stash_create_node(void)
+{
+ return netsnmp_oid_stash_create_sized_node(OID_STASH_CHILDREN_SIZE);
+}
+
+netsnmp_feature_child_of(oid_stash_add_data, oid_stash_all)
+#ifndef NETSNMP_FEATURE_REMOVE_OID_STASH_ADD_DATA
+/** adds data to the stash at a given oid.
+
+ * @param root the top of the stash tree
+ * @param lookup the oid index to store the data at.
+ * @param lookup_len the length of the lookup oid.
+ * @param mydata the data to store
+
+ * @return SNMPERR_SUCCESS on success, SNMPERR_GENERR if data is
+ already there, SNMPERR_MALLOC on malloc failures or if arguments
+ passed in with NULL values.
+ */
+int
+netsnmp_oid_stash_add_data(netsnmp_oid_stash_node **root,
+ const oid * lookup, size_t lookup_len, void *mydata)
+{
+ netsnmp_oid_stash_node *curnode, *tmpp, *loopp;
+ unsigned int i;
+
+ if (!root || !lookup || lookup_len == 0)
+ return SNMPERR_GENERR;
+
+ if (!*root) {
+ *root = netsnmp_oid_stash_create_node();
+ if (!*root)
+ return SNMPERR_MALLOC;
+ }
+ DEBUGMSGTL(( "oid_stash", "stash_add_data "));
+ DEBUGMSGOID(("oid_stash", lookup, lookup_len));
+ DEBUGMSG(( "oid_stash", "\n"));
+ tmpp = NULL;
+ for (curnode = *root, i = 0; i < lookup_len; i++) {
+ tmpp = curnode->children[lookup[i] % curnode->children_size];
+ if (!tmpp) {
+ /*
+ * no child in array at all
+ */
+ tmpp = curnode->children[lookup[i] % curnode->children_size] =
+ netsnmp_oid_stash_create_node();
+ tmpp->value = lookup[i];
+ tmpp->parent = curnode;
+ } else {
+ for (loopp = tmpp; loopp; loopp = loopp->next_sibling) {
+ if (loopp->value == lookup[i])
+ break;
+ }
+ if (loopp) {
+ tmpp = loopp;
+ } else {
+ /*
+ * none exists. Create it
+ */
+ loopp = netsnmp_oid_stash_create_node();
+ loopp->value = lookup[i];
+ loopp->next_sibling = tmpp;
+ loopp->parent = curnode;
+ tmpp->prev_sibling = loopp;
+ curnode->children[lookup[i] % curnode->children_size] =
+ loopp;
+ tmpp = loopp;
+ }
+ /*
+ * tmpp now points to the proper node
+ */
+ }
+ curnode = tmpp;
+ }
+ /*
+ * tmpp now points to the exact match
+ */
+ if (curnode->thedata)
+ return SNMPERR_GENERR;
+ if (NULL == tmpp)
+ return SNMPERR_GENERR;
+ tmpp->thedata = mydata;
+ return SNMPERR_SUCCESS;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_OID_STASH_ADD_DATA */
+
+/** returns a node associated with a given OID.
+ * @param root the top of the stash tree
+ * @param lookup the oid to look up a node for.
+ * @param lookup_len the length of the lookup oid
+ */
+netsnmp_oid_stash_node *
+netsnmp_oid_stash_get_node(netsnmp_oid_stash_node *root,
+ const oid * lookup, size_t lookup_len)
+{
+ netsnmp_oid_stash_node *curnode, *tmpp, *loopp;
+ unsigned int i;
+
+ if (!root)
+ return NULL;
+ tmpp = NULL;
+ for (curnode = root, i = 0; i < lookup_len; i++) {
+ tmpp = curnode->children[lookup[i] % curnode->children_size];
+ if (!tmpp) {
+ return NULL;
+ } else {
+ for (loopp = tmpp; loopp; loopp = loopp->next_sibling) {
+ if (loopp->value == lookup[i])
+ break;
+ }
+ if (loopp) {
+ tmpp = loopp;
+ } else {
+ return NULL;
+ }
+ }
+ curnode = tmpp;
+ }
+ return tmpp;
+}
+
+/** returns the next node associated with a given OID. INCOMPLETE.
+ This is equivelent to a GETNEXT operation.
+ * @internal
+ * @param root the top of the stash tree
+ * @param lookup the oid to look up a node for.
+ * @param lookup_len the length of the lookup oid
+ */
+netsnmp_feature_child_of(oid_stash_iterate, oid_stash_all)
+#ifndef NETSNMP_FEATURE_REMOVE_OID_STASH_ITERATE
+netsnmp_oid_stash_node *
+netsnmp_oid_stash_getnext_node(netsnmp_oid_stash_node *root,
+ oid * lookup, size_t lookup_len)
+{
+ netsnmp_oid_stash_node *curnode, *tmpp, *loopp;
+ unsigned int i, j, bigger_than = 0, do_bigger = 0;
+
+ if (!root)
+ return NULL;
+ tmpp = NULL;
+
+ /* get closest matching node */
+ for (curnode = root, i = 0; i < lookup_len; i++) {
+ tmpp = curnode->children[lookup[i] % curnode->children_size];
+ if (!tmpp) {
+ break;
+ } else {
+ for (loopp = tmpp; loopp; loopp = loopp->next_sibling) {
+ if (loopp->value == lookup[i])
+ break;
+ }
+ if (loopp) {
+ tmpp = loopp;
+ } else {
+ break;
+ }
+ }
+ curnode = tmpp;
+ }
+
+ /* find the *next* node lexographically greater */
+ if (!curnode)
+ return NULL; /* ack! */
+
+ if (i+1 < lookup_len) {
+ bigger_than = lookup[i+1];
+ do_bigger = 1;
+ }
+
+ do {
+ /* check the children first */
+ tmpp = NULL;
+ /* next child must be (next) greater than our next search node */
+ /* XXX: should start this loop at best_nums[i]%... and wrap */
+ for(j = 0; j < curnode->children_size; j++) {
+ for (loopp = curnode->children[j];
+ loopp; loopp = loopp->next_sibling) {
+ if ((!do_bigger || loopp->value > bigger_than) &&
+ (!tmpp || tmpp->value > loopp->value)) {
+ tmpp = loopp;
+ /* XXX: can do better and include min_nums[i] */
+ if (tmpp->value <= curnode->children_size-1) {
+ /* best we can do. */
+ goto done_this_loop;
+ }
+ }
+ }
+ }
+
+ done_this_loop:
+ if (tmpp && tmpp->thedata)
+ /* found a node with data. Go with it. */
+ return tmpp;
+
+ if (tmpp) {
+ /* found a child node without data, maybe find a grandchild? */
+ do_bigger = 0;
+ curnode = tmpp;
+ } else {
+ /* no respectable children (the bums), we'll have to go up.
+ But to do so, they must be better than our current best_num + 1.
+ */
+ do_bigger = 1;
+ bigger_than = curnode->value;
+ curnode = curnode->parent;
+ }
+ } while (curnode);
+
+ /* fell off the top */
+ return NULL;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_OID_STASH_ITERATE */
+
+netsnmp_feature_child_of(oid_stash_get_data, oid_stash_all)
+#ifndef NETSNMP_FEATURE_REMOVE_OID_STASH_GET_DATA
+/** returns a data pointer associated with a given OID.
+
+ This is equivelent to netsnmp_oid_stash_get_node, but returns only
+ the data not the entire node.
+
+ * @param root the top of the stash
+ * @param lookup the oid to search for
+ * @param lookup_len the length of the search oid.
+ */
+void *
+netsnmp_oid_stash_get_data(netsnmp_oid_stash_node *root,
+ const oid * lookup, size_t lookup_len)
+{
+ netsnmp_oid_stash_node *ret;
+ ret = netsnmp_oid_stash_get_node(root, lookup, lookup_len);
+ if (ret)
+ return ret->thedata;
+ return NULL;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_OID_STASH_GET_DATA */
+
+netsnmp_feature_child_of(oid_stash_store_all, oid_stash_all)
+#ifndef NETSNMP_FEATURE_REMOVE_OID_STASH_STORE_ALL
+/** a wrapper around netsnmp_oid_stash_store for use with a snmp_alarm.
+ * when calling snmp_alarm, you can list this as a callback. The
+ * clientarg should be a pointer to a netsnmp_oid_stash_save_info
+ * pointer. It can also be called directly, of course. The last
+ * argument (clientarg) is the only one that is used. The rest are
+ * ignored by the function.
+ * @param majorID
+ * @param minorID
+ * @param serverarg
+ * @param clientarg A pointer to a netsnmp_oid_stash_save_info structure.
+ */
+int
+netsnmp_oid_stash_store_all(int majorID, int minorID,
+ void *serverarg, void *clientarg) {
+ oid oidbase[MAX_OID_LEN];
+ netsnmp_oid_stash_save_info *sinfo;
+
+ if (!clientarg)
+ return SNMP_ERR_NOERROR;
+
+ sinfo = (netsnmp_oid_stash_save_info *) clientarg;
+ netsnmp_oid_stash_store(*(sinfo->root), sinfo->token, sinfo->dumpfn,
+ oidbase,0);
+ return SNMP_ERR_NOERROR;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_OID_STASH_STORE_ALL */
+
+/** stores data in a starsh tree to peristent storage.
+
+ This function can be called to save all data in a stash tree to
+ Net-SNMP's percent storage. Make sure you register a parsing
+ function with the read_config system to re-incorperate your saved
+ data into future trees.
+
+ @param root the top of the stash to store.
+ @param tokenname the file token name to save in (passing "snmpd" will
+ save things into snmpd.conf).
+ @param dumpfn A function which can dump the data stored at a particular
+ node into a char buffer.
+ @param curoid must be a pointer to a OID array of length MAX_OID_LEN.
+ @param curoid_len must be 0 for the top level call.
+*/
+void
+netsnmp_oid_stash_store(netsnmp_oid_stash_node *root,
+ const char *tokenname, NetSNMPStashDump *dumpfn,
+ oid *curoid, size_t curoid_len) {
+
+ char buf[SNMP_MAXBUF];
+ netsnmp_oid_stash_node *tmpp;
+ char *cp;
+ char *appname = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ int i;
+
+ if (!tokenname || !root || !curoid || !dumpfn)
+ return;
+
+ for (i = 0; i < (int)root->children_size; i++) {
+ if (root->children[i]) {
+ for (tmpp = root->children[i]; tmpp; tmpp = tmpp->next_sibling) {
+ curoid[curoid_len] = tmpp->value;
+ if (tmpp->thedata) {
+ snprintf(buf, sizeof(buf), "%s ", tokenname);
+ cp = read_config_save_objid(buf+strlen(buf), curoid,
+ curoid_len+1);
+ *cp++ = ' ';
+ *cp = '\0';
+ if ((*dumpfn)(cp, sizeof(buf) - strlen(buf),
+ tmpp->thedata, tmpp))
+ read_config_store(appname, buf);
+ }
+ netsnmp_oid_stash_store(tmpp, tokenname, dumpfn,
+ curoid, curoid_len+1);
+ }
+ }
+ }
+}
+
+/** For debugging: dump the netsnmp_oid_stash tree to stdout
+ @param root The top of the tree
+ @param prefix a character string prefix printed to the beginning of each line.
+*/
+void
+oid_stash_dump(netsnmp_oid_stash_node *root, char *prefix)
+{
+ char myprefix[MAX_OID_LEN * 4];
+ netsnmp_oid_stash_node *tmpp;
+ int prefix_len = strlen(prefix) + 1; /* actually it's +2 */
+ unsigned int i;
+
+ memset(myprefix, ' ', MAX_OID_LEN * 4);
+ myprefix[prefix_len] = '\0';
+
+ for (i = 0; i < root->children_size; i++) {
+ if (root->children[i]) {
+ for (tmpp = root->children[i]; tmpp; tmpp = tmpp->next_sibling) {
+ printf("%s%" NETSNMP_PRIo "d@%d: %s\n", prefix, tmpp->value, i,
+ (tmpp->thedata) ? "DATA" : "");
+ oid_stash_dump(tmpp, myprefix);
+ }
+ }
+ }
+}
+
+/** Frees the contents of a netsnmp_oid_stash tree.
+ @param root the top of the tree (or branch to be freed)
+ @param freefn The function to be called on each data (void *)
+ pointer. If left NULL the system free() function will be called
+*/
+void
+netsnmp_oid_stash_free(netsnmp_oid_stash_node **root,
+ NetSNMPStashFreeNode *freefn) {
+
+ netsnmp_oid_stash_node *curnode, *tmpp;
+ unsigned int i;
+
+ if (!root || !*root)
+ return;
+
+ /* loop through all our children and free each node */
+ for (i = 0; i < (*root)->children_size; i++) {
+ if ((*root)->children[i]) {
+ for(tmpp = (*root)->children[i]; tmpp; tmpp = curnode) {
+ if (tmpp->thedata) {
+ if (freefn)
+ (*freefn)(tmpp->thedata);
+ else
+ free(tmpp->thedata);
+ }
+ curnode = tmpp->next_sibling;
+ netsnmp_oid_stash_free(&tmpp, freefn);
+ }
+ }
+ }
+ free((*root)->children);
+ free (*root);
+ *root = NULL;
+}
+
+#else /* NETSNMP_FEATURE_REMOVE_OID_STASH */
+netsnmp_feature_unused(oid_stash);
+#endif/* NETSNMP_FEATURE_REMOVE_OID_STASH */
+
+#ifndef NETSNMP_FEATURE_REMOVE_OID_STASH_NO_FREE
+void
+netsnmp_oid_stash_no_free(void *bogus)
+{
+ /* noop */
+}
+#endif /* NETSNMP_FEATURE_REMOVE_OID_STASH_NO_FREE */
+
+/** @} */
diff --git a/snmplib/opendir.c b/snmplib/opendir.c
new file mode 100644
index 0000000..6cb8e06
--- /dev/null
+++ b/snmplib/opendir.c
@@ -0,0 +1,139 @@
+/*
+ * opendir() replacement for MSVC.
+ */
+
+#define WIN32IO_IS_STDIO
+#define PATHLEN 1024
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/types.h>
+#include <net-snmp/library/system.h>
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#include <tchar.h>
+#include <windows.h>
+
+
+/*
+ * The idea here is to read all the directory names into a string table
+ * * (separated by nulls) and when one of the other dir functions is called
+ * * return the pointer to the current file name.
+ */
+DIR *
+opendir(const char *filename)
+{
+ DIR *p;
+ long len;
+ long idx;
+ char scannamespc[PATHLEN];
+ char *scanname = scannamespc;
+ struct stat sbuf;
+ WIN32_FIND_DATA FindData;
+ HANDLE fh;
+
+ /*
+ * check to see if filename is a directory
+ */
+ if ((stat(filename, &sbuf) < 0) || ((sbuf.st_mode & S_IFDIR) == 0)) {
+ return NULL;
+ }
+
+ /*
+ * get the file system characteristics
+ */
+ /*
+ * if(GetFullPathName(filename, SNMP_MAXPATH, root, &dummy)) {
+ * * if(dummy = strchr(root, '\\'))
+ * * *++dummy = '\0';
+ * * if(GetVolumeInformation(root, volname, SNMP_MAXPATH, &serial,
+ * * &maxname, &flags, 0, 0)) {
+ * * downcase = !(flags & FS_CASE_IS_PRESERVED);
+ * * }
+ * * }
+ * * else {
+ * * downcase = TRUE;
+ * * }
+ */
+
+ /*
+ * Create the search pattern
+ */
+ strcpy(scanname, filename);
+
+ if (strchr("/\\", *(scanname + strlen(scanname) - 1)) == NULL)
+ strcat(scanname, "/*");
+ else
+ strcat(scanname, "*");
+
+ /*
+ * do the FindFirstFile call
+ */
+ fh = FindFirstFile(scanname, &FindData);
+ if (fh == INVALID_HANDLE_VALUE) {
+ return NULL;
+ }
+
+ /*
+ * Get us a DIR structure
+ */
+ p = (DIR *) malloc(sizeof(DIR));
+ /*
+ * Newz(1303, p, 1, DIR);
+ */
+ if (p == NULL)
+ return NULL;
+
+ /*
+ * now allocate the first part of the string table for
+ * * the filenames that we find.
+ */
+ idx = strlen(FindData.cFileName) + 1;
+ p->start = (char *) malloc(idx);
+ /*
+ * New(1304, p->start, idx, char);
+ */
+ if (p->start == NULL) {
+ free(p);
+ return NULL;
+ }
+ strcpy(p->start, FindData.cFileName);
+ /*
+ * if(downcase)
+ * * strlwr(p->start);
+ */
+ p->nfiles = 0;
+
+ /*
+ * loop finding all the files that match the wildcard
+ * * (which should be all of them in this directory!).
+ * * the variable idx should point one past the null terminator
+ * * of the previous string found.
+ */
+ while (FindNextFile(fh, &FindData)) {
+ len = strlen(FindData.cFileName);
+ /*
+ * bump the string table size by enough for the
+ * * new name and it's null terminator
+ */
+ p->start = (char *) realloc((void *) p->start, idx + len + 1);
+ /*
+ * Renew(p->start, idx+len+1, char);
+ */
+ if (p->start == NULL) {
+ free(p);
+ return NULL;
+ }
+ strcpy(&p->start[idx], FindData.cFileName);
+ /*
+ * if (downcase)
+ * * strlwr(&p->start[idx]);
+ */
+ p->nfiles++;
+ idx += len + 1;
+ }
+ FindClose(fh);
+ p->size = idx;
+ p->curr = p->start;
+ return p;
+}
diff --git a/snmplib/openssl/OPENSSL-LICENSE b/snmplib/openssl/OPENSSL-LICENSE
new file mode 100644
index 0000000..a2c4adc
--- /dev/null
+++ b/snmplib/openssl/OPENSSL-LICENSE
@@ -0,0 +1,127 @@
+
+ LICENSE ISSUES
+ ==============
+
+ The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
+ the OpenSSL License and the original SSLeay license apply to the toolkit.
+ See below for the actual license texts. Actually both licenses are BSD-style
+ Open Source licenses. In case of any license issues related to OpenSSL
+ please contact openssl-core@openssl.org.
+
+ OpenSSL License
+ ---------------
+
+/* ====================================================================
+ * Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+ Original SSLeay License
+ -----------------------
+
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
diff --git a/snmplib/openssl/README b/snmplib/openssl/README
new file mode 100644
index 0000000..c84087b
--- /dev/null
+++ b/snmplib/openssl/README
@@ -0,0 +1,19 @@
+This directory contains modified crypto code from OpenSSL
+1.0.0.beta5. Please see the OpenSSL license from that release in the
+OPENSSL-LICENSE which will apply if this code is selected.
+
+Net-SNMP may be compiled with this code using the
+--with-openssl=internal flag to the configure command line.
+
+Note: It is generally a better idea to link with the latest OpenSSL
+library rather than rely on this internal support, as the latest
+OpenSSL code may contain important security or other fixes that may
+not have been incorporated into this snapshot. Small device vendors,
+however, have requested a stripped down version of the OpenSSL
+cryptography code in order to shrink their memory footprint and this
+feature provides such support.
+
+Note also that the new SNMP over DTLS, SNMP over TLS support also
+available in Net-SNMP 5.6 and beyond is incompatible with the internal
+version of the OpenSSL support since SNMP over (D)TLS requires the
+full TLS support available in OpenSSL.
diff --git a/snmplib/openssl/openssl_aes_cfb.c b/snmplib/openssl/openssl_aes_cfb.c
new file mode 100644
index 0000000..999e5a7
--- /dev/null
+++ b/snmplib/openssl/openssl_aes_cfb.c
@@ -0,0 +1,81 @@
+/* crypto/aes/aes_cfb.c -*- mode:C; c-file-style: "eay" -*- */
+/* ====================================================================
+ * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ */
+
+#include <net-snmp/library/openssl_aes.h>
+#include "openssl/openssl_modes.h"
+
+/* The input and output encrypted as though 128bit cfb mode is being
+ * used. The extra state information to record how much of the
+ * 128bit block we have used is contained in *num;
+ */
+
+void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc) {
+
+ CRYPTO_cfb128_encrypt(in,out,length,key,ivec,num,enc,(block128_f)AES_encrypt);
+}
+
+/* N.B. This expects the input to be packed, MS bit first */
+void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc)
+ {
+ CRYPTO_cfb128_1_encrypt(in,out,length,key,ivec,num,enc,(block128_f)AES_encrypt);
+ }
+
+void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc)
+ {
+ CRYPTO_cfb128_8_encrypt(in,out,length,key,ivec,num,enc,(block128_f)AES_encrypt);
+ }
+
diff --git a/snmplib/openssl/openssl_aes_core.c b/snmplib/openssl/openssl_aes_core.c
new file mode 100644
index 0000000..56301b9
--- /dev/null
+++ b/snmplib/openssl/openssl_aes_core.c
@@ -0,0 +1,1358 @@
+/* crypto/aes/aes_core.c -*- mode:C; c-file-style: "eay" -*- */
+/**
+ * rijndael-alg-fst.c
+ *
+ * @version 3.0 (December 2000)
+ *
+ * Optimised ANSI C code for the Rijndael cipher (now AES)
+ *
+ * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
+ * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
+ * @author Paulo Barreto <paulo.barreto@terra.com.br>
+ *
+ * This code is hereby placed in the public domain.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Note: rewritten a little bit to provide error control and an OpenSSL-
+ compatible API */
+
+#ifndef AES_DEBUG
+# ifndef NDEBUG
+# define NDEBUG
+# endif
+#endif
+#include <assert.h>
+
+#include <stdlib.h>
+#include <net-snmp/library/openssl_aes.h>
+#include "openssl_aes_local.h"
+
+#ifndef AES_ASM
+/*
+Te0[x] = S [x].[02, 01, 01, 03];
+Te1[x] = S [x].[03, 02, 01, 01];
+Te2[x] = S [x].[01, 03, 02, 01];
+Te3[x] = S [x].[01, 01, 03, 02];
+
+Td0[x] = Si[x].[0e, 09, 0d, 0b];
+Td1[x] = Si[x].[0b, 0e, 09, 0d];
+Td2[x] = Si[x].[0d, 0b, 0e, 09];
+Td3[x] = Si[x].[09, 0d, 0b, 0e];
+Td4[x] = Si[x].[01];
+*/
+
+static const u32 Te0[256] = {
+ 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
+ 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
+ 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
+ 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
+ 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
+ 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
+ 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
+ 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
+ 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
+ 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
+ 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
+ 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
+ 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
+ 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
+ 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
+ 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
+ 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
+ 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
+ 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
+ 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
+ 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
+ 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
+ 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
+ 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
+ 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
+ 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
+ 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
+ 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
+ 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
+ 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
+ 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
+ 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
+ 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
+ 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
+ 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
+ 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
+ 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
+ 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
+ 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
+ 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
+ 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
+ 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
+ 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
+ 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
+ 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
+ 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
+ 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
+ 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
+ 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
+ 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
+ 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
+ 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
+ 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
+ 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
+ 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
+ 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
+ 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
+ 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
+ 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
+ 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
+ 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
+ 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
+ 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
+ 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
+};
+static const u32 Te1[256] = {
+ 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
+ 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
+ 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
+ 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
+ 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
+ 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
+ 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
+ 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
+ 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
+ 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
+ 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
+ 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
+ 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
+ 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
+ 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
+ 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
+ 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
+ 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
+ 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
+ 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
+ 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
+ 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
+ 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
+ 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
+ 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
+ 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
+ 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
+ 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
+ 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
+ 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
+ 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
+ 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
+ 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
+ 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
+ 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
+ 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
+ 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
+ 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
+ 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
+ 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
+ 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
+ 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
+ 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
+ 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
+ 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
+ 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
+ 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
+ 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
+ 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
+ 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
+ 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
+ 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
+ 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
+ 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
+ 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
+ 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
+ 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
+ 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
+ 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
+ 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
+ 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
+ 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
+ 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
+ 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
+};
+static const u32 Te2[256] = {
+ 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
+ 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
+ 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
+ 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
+ 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
+ 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
+ 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
+ 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
+ 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
+ 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
+ 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
+ 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
+ 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
+ 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
+ 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
+ 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
+ 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
+ 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
+ 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
+ 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
+ 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
+ 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
+ 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
+ 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
+ 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
+ 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
+ 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
+ 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
+ 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
+ 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
+ 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
+ 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
+ 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
+ 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
+ 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
+ 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
+ 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
+ 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
+ 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
+ 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
+ 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
+ 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
+ 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
+ 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
+ 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
+ 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
+ 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
+ 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
+ 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
+ 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
+ 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
+ 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
+ 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
+ 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
+ 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
+ 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
+ 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
+ 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
+ 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
+ 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
+ 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
+ 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
+ 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
+ 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
+};
+static const u32 Te3[256] = {
+ 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
+ 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
+ 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
+ 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
+ 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
+ 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
+ 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
+ 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
+ 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
+ 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
+ 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
+ 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
+ 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
+ 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
+ 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
+ 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
+ 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
+ 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
+ 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
+ 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
+ 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
+ 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
+ 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
+ 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
+ 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
+ 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
+ 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
+ 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
+ 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
+ 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
+ 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
+ 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
+ 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
+ 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
+ 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
+ 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
+ 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
+ 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
+ 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
+ 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
+ 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
+ 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
+ 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
+ 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
+ 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
+ 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
+ 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
+ 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
+ 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
+ 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
+ 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
+ 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
+ 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
+ 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
+ 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
+ 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
+ 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
+ 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
+ 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
+ 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
+ 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
+ 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
+ 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
+ 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
+};
+
+static const u32 Td0[256] = {
+ 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
+ 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
+ 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
+ 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
+ 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
+ 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
+ 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
+ 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
+ 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
+ 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
+ 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
+ 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
+ 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
+ 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
+ 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
+ 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
+ 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
+ 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
+ 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
+ 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
+ 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
+ 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
+ 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
+ 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
+ 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
+ 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
+ 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
+ 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
+ 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
+ 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
+ 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
+ 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
+ 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
+ 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
+ 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
+ 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
+ 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
+ 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
+ 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
+ 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
+ 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
+ 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
+ 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
+ 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
+ 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
+ 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
+ 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
+ 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
+ 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
+ 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
+ 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
+ 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
+ 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
+ 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
+ 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
+ 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
+ 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
+ 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
+ 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
+ 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
+ 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
+ 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
+ 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
+ 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
+};
+static const u32 Td1[256] = {
+ 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
+ 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
+ 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
+ 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
+ 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
+ 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
+ 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
+ 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
+ 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
+ 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
+ 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
+ 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
+ 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
+ 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
+ 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
+ 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
+ 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
+ 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
+ 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
+ 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
+ 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
+ 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
+ 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
+ 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
+ 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
+ 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
+ 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
+ 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
+ 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
+ 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
+ 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
+ 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
+ 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
+ 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
+ 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
+ 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
+ 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
+ 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
+ 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
+ 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
+ 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
+ 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
+ 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
+ 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
+ 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
+ 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
+ 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
+ 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
+ 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
+ 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
+ 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
+ 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
+ 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
+ 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
+ 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
+ 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
+ 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
+ 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
+ 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
+ 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
+ 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
+ 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
+ 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
+ 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
+};
+static const u32 Td2[256] = {
+ 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
+ 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
+ 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
+ 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
+ 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
+ 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
+ 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
+ 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
+ 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
+ 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
+ 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
+ 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
+ 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
+ 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
+ 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
+ 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
+ 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
+ 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
+ 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
+ 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
+ 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
+ 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
+ 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
+ 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
+ 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
+ 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
+ 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
+ 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
+ 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
+ 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
+ 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
+ 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
+ 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
+ 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
+ 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
+ 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
+ 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
+ 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
+ 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
+ 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
+ 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
+ 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
+ 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
+ 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
+ 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
+ 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
+ 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
+ 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
+ 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
+ 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
+ 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
+ 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
+ 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
+ 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
+ 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
+ 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
+ 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
+ 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
+ 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
+ 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
+ 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
+ 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
+ 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
+ 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
+};
+static const u32 Td3[256] = {
+ 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
+ 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
+ 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
+ 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
+ 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
+ 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
+ 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
+ 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
+ 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
+ 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
+ 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
+ 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
+ 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
+ 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
+ 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
+ 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
+ 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
+ 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
+ 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
+ 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
+ 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
+ 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
+ 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
+ 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
+ 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
+ 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
+ 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
+ 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
+ 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
+ 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
+ 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
+ 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
+ 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
+ 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
+ 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
+ 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
+ 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
+ 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
+ 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
+ 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
+ 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
+ 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
+ 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
+ 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
+ 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
+ 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
+ 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
+ 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
+ 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
+ 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
+ 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
+ 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
+ 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
+ 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
+ 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
+ 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
+ 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
+ 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
+ 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
+ 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
+ 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
+ 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
+ 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
+ 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
+};
+static const u8 Td4[256] = {
+ 0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
+ 0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
+ 0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, 0xffU, 0x87U,
+ 0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU,
+ 0x54U, 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU,
+ 0xeeU, 0x4cU, 0x95U, 0x0bU, 0x42U, 0xfaU, 0xc3U, 0x4eU,
+ 0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, 0xb2U,
+ 0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U,
+ 0x72U, 0xf8U, 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U,
+ 0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, 0x65U, 0xb6U, 0x92U,
+ 0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU,
+ 0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U,
+ 0x90U, 0xd8U, 0xabU, 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU,
+ 0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, 0x45U, 0x06U,
+ 0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U,
+ 0xc1U, 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU,
+ 0x3aU, 0x91U, 0x11U, 0x41U, 0x4fU, 0x67U, 0xdcU, 0xeaU,
+ 0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, 0x73U,
+ 0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U,
+ 0xe2U, 0xf9U, 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU,
+ 0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, 0x29U, 0xc5U, 0x89U,
+ 0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU,
+ 0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U,
+ 0x9aU, 0xdbU, 0xc0U, 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U,
+ 0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, 0xc7U, 0x31U,
+ 0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU,
+ 0x60U, 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU,
+ 0x2dU, 0xe5U, 0x7aU, 0x9fU, 0x93U, 0xc9U, 0x9cU, 0xefU,
+ 0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, 0xb0U,
+ 0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U,
+ 0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
+ 0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
+};
+static const u32 rcon[] = {
+ 0x01000000, 0x02000000, 0x04000000, 0x08000000,
+ 0x10000000, 0x20000000, 0x40000000, 0x80000000,
+ 0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
+};
+
+/**
+ * Expand the cipher key into the encryption key schedule.
+ */
+int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key) {
+
+ u32 *rk;
+ int i = 0;
+ u32 temp;
+
+ if (!userKey || !key)
+ return -1;
+ if (bits != 128 && bits != 192 && bits != 256)
+ return -2;
+
+ rk = key->rd_key;
+
+ if (bits==128)
+ key->rounds = 10;
+ else if (bits==192)
+ key->rounds = 12;
+ else
+ key->rounds = 14;
+
+ rk[0] = GETU32(userKey );
+ rk[1] = GETU32(userKey + 4);
+ rk[2] = GETU32(userKey + 8);
+ rk[3] = GETU32(userKey + 12);
+ if (bits == 128) {
+ while (1) {
+ temp = rk[3];
+ rk[4] = rk[0] ^
+ (Te2[(temp >> 16) & 0xff] & 0xff000000) ^
+ (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
+ (Te0[(temp ) & 0xff] & 0x0000ff00) ^
+ (Te1[(temp >> 24) ] & 0x000000ff) ^
+ rcon[i];
+ rk[5] = rk[1] ^ rk[4];
+ rk[6] = rk[2] ^ rk[5];
+ rk[7] = rk[3] ^ rk[6];
+ if (++i == 10) {
+ return 0;
+ }
+ rk += 4;
+ }
+ }
+ rk[4] = GETU32(userKey + 16);
+ rk[5] = GETU32(userKey + 20);
+ if (bits == 192) {
+ while (1) {
+ temp = rk[ 5];
+ rk[ 6] = rk[ 0] ^
+ (Te2[(temp >> 16) & 0xff] & 0xff000000) ^
+ (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
+ (Te0[(temp ) & 0xff] & 0x0000ff00) ^
+ (Te1[(temp >> 24) ] & 0x000000ff) ^
+ rcon[i];
+ rk[ 7] = rk[ 1] ^ rk[ 6];
+ rk[ 8] = rk[ 2] ^ rk[ 7];
+ rk[ 9] = rk[ 3] ^ rk[ 8];
+ if (++i == 8) {
+ return 0;
+ }
+ rk[10] = rk[ 4] ^ rk[ 9];
+ rk[11] = rk[ 5] ^ rk[10];
+ rk += 6;
+ }
+ }
+ rk[6] = GETU32(userKey + 24);
+ rk[7] = GETU32(userKey + 28);
+ if (bits == 256) {
+ while (1) {
+ temp = rk[ 7];
+ rk[ 8] = rk[ 0] ^
+ (Te2[(temp >> 16) & 0xff] & 0xff000000) ^
+ (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
+ (Te0[(temp ) & 0xff] & 0x0000ff00) ^
+ (Te1[(temp >> 24) ] & 0x000000ff) ^
+ rcon[i];
+ rk[ 9] = rk[ 1] ^ rk[ 8];
+ rk[10] = rk[ 2] ^ rk[ 9];
+ rk[11] = rk[ 3] ^ rk[10];
+ if (++i == 7) {
+ return 0;
+ }
+ temp = rk[11];
+ rk[12] = rk[ 4] ^
+ (Te2[(temp >> 24) ] & 0xff000000) ^
+ (Te3[(temp >> 16) & 0xff] & 0x00ff0000) ^
+ (Te0[(temp >> 8) & 0xff] & 0x0000ff00) ^
+ (Te1[(temp ) & 0xff] & 0x000000ff);
+ rk[13] = rk[ 5] ^ rk[12];
+ rk[14] = rk[ 6] ^ rk[13];
+ rk[15] = rk[ 7] ^ rk[14];
+
+ rk += 8;
+ }
+ }
+ return 0;
+}
+
+/**
+ * Expand the cipher key into the decryption key schedule.
+ */
+int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key) {
+
+ u32 *rk;
+ int i, j, status;
+ u32 temp;
+
+ /* first, start with an encryption schedule */
+ status = AES_set_encrypt_key(userKey, bits, key);
+ if (status < 0)
+ return status;
+
+ rk = key->rd_key;
+
+ /* invert the order of the round keys: */
+ for (i = 0, j = 4*(key->rounds); i < j; i += 4, j -= 4) {
+ temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp;
+ temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
+ temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
+ temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
+ }
+ /* apply the inverse MixColumn transform to all round keys but the first and the last: */
+ for (i = 1; i < (key->rounds); i++) {
+ rk += 4;
+ rk[0] =
+ Td0[Te1[(rk[0] >> 24) ] & 0xff] ^
+ Td1[Te1[(rk[0] >> 16) & 0xff] & 0xff] ^
+ Td2[Te1[(rk[0] >> 8) & 0xff] & 0xff] ^
+ Td3[Te1[(rk[0] ) & 0xff] & 0xff];
+ rk[1] =
+ Td0[Te1[(rk[1] >> 24) ] & 0xff] ^
+ Td1[Te1[(rk[1] >> 16) & 0xff] & 0xff] ^
+ Td2[Te1[(rk[1] >> 8) & 0xff] & 0xff] ^
+ Td3[Te1[(rk[1] ) & 0xff] & 0xff];
+ rk[2] =
+ Td0[Te1[(rk[2] >> 24) ] & 0xff] ^
+ Td1[Te1[(rk[2] >> 16) & 0xff] & 0xff] ^
+ Td2[Te1[(rk[2] >> 8) & 0xff] & 0xff] ^
+ Td3[Te1[(rk[2] ) & 0xff] & 0xff];
+ rk[3] =
+ Td0[Te1[(rk[3] >> 24) ] & 0xff] ^
+ Td1[Te1[(rk[3] >> 16) & 0xff] & 0xff] ^
+ Td2[Te1[(rk[3] >> 8) & 0xff] & 0xff] ^
+ Td3[Te1[(rk[3] ) & 0xff] & 0xff];
+ }
+ return 0;
+}
+
+/*
+ * Encrypt a single block
+ * in and out can overlap
+ */
+void AES_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key) {
+
+ const u32 *rk;
+ u32 s0, s1, s2, s3, t0, t1, t2, t3;
+#ifndef FULL_UNROLL
+ int r;
+#endif /* ?FULL_UNROLL */
+
+ assert(in && out && key);
+ rk = key->rd_key;
+
+ /*
+ * map byte array block to cipher state
+ * and add initial round key:
+ */
+ s0 = GETU32(in ) ^ rk[0];
+ s1 = GETU32(in + 4) ^ rk[1];
+ s2 = GETU32(in + 8) ^ rk[2];
+ s3 = GETU32(in + 12) ^ rk[3];
+#ifdef FULL_UNROLL
+ /* round 1: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7];
+ /* round 2: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11];
+ /* round 3: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15];
+ /* round 4: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19];
+ /* round 5: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23];
+ /* round 6: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27];
+ /* round 7: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31];
+ /* round 8: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35];
+ /* round 9: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39];
+ if (key->rounds > 10) {
+ /* round 10: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43];
+ /* round 11: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47];
+ if (key->rounds > 12) {
+ /* round 12: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51];
+ /* round 13: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55];
+ }
+ }
+ rk += key->rounds << 2;
+#else /* !FULL_UNROLL */
+ /*
+ * Nr - 1 full rounds:
+ */
+ r = key->rounds >> 1;
+ for (;;) {
+ t0 =
+ Te0[(s0 >> 24) ] ^
+ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^
+ Te3[(s3 ) & 0xff] ^
+ rk[4];
+ t1 =
+ Te0[(s1 >> 24) ] ^
+ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^
+ Te3[(s0 ) & 0xff] ^
+ rk[5];
+ t2 =
+ Te0[(s2 >> 24) ] ^
+ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^
+ Te3[(s1 ) & 0xff] ^
+ rk[6];
+ t3 =
+ Te0[(s3 >> 24) ] ^
+ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^
+ Te3[(s2 ) & 0xff] ^
+ rk[7];
+
+ rk += 8;
+ if (--r == 0) {
+ break;
+ }
+
+ s0 =
+ Te0[(t0 >> 24) ] ^
+ Te1[(t1 >> 16) & 0xff] ^
+ Te2[(t2 >> 8) & 0xff] ^
+ Te3[(t3 ) & 0xff] ^
+ rk[0];
+ s1 =
+ Te0[(t1 >> 24) ] ^
+ Te1[(t2 >> 16) & 0xff] ^
+ Te2[(t3 >> 8) & 0xff] ^
+ Te3[(t0 ) & 0xff] ^
+ rk[1];
+ s2 =
+ Te0[(t2 >> 24) ] ^
+ Te1[(t3 >> 16) & 0xff] ^
+ Te2[(t0 >> 8) & 0xff] ^
+ Te3[(t1 ) & 0xff] ^
+ rk[2];
+ s3 =
+ Te0[(t3 >> 24) ] ^
+ Te1[(t0 >> 16) & 0xff] ^
+ Te2[(t1 >> 8) & 0xff] ^
+ Te3[(t2 ) & 0xff] ^
+ rk[3];
+ }
+#endif /* ?FULL_UNROLL */
+ /*
+ * apply last round and
+ * map cipher state to byte array block:
+ */
+ s0 =
+ (Te2[(t0 >> 24) ] & 0xff000000) ^
+ (Te3[(t1 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te0[(t2 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te1[(t3 ) & 0xff] & 0x000000ff) ^
+ rk[0];
+ PUTU32(out , s0);
+ s1 =
+ (Te2[(t1 >> 24) ] & 0xff000000) ^
+ (Te3[(t2 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te0[(t3 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te1[(t0 ) & 0xff] & 0x000000ff) ^
+ rk[1];
+ PUTU32(out + 4, s1);
+ s2 =
+ (Te2[(t2 >> 24) ] & 0xff000000) ^
+ (Te3[(t3 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te0[(t0 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te1[(t1 ) & 0xff] & 0x000000ff) ^
+ rk[2];
+ PUTU32(out + 8, s2);
+ s3 =
+ (Te2[(t3 >> 24) ] & 0xff000000) ^
+ (Te3[(t0 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te0[(t1 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te1[(t2 ) & 0xff] & 0x000000ff) ^
+ rk[3];
+ PUTU32(out + 12, s3);
+}
+
+/*
+ * Decrypt a single block
+ * in and out can overlap
+ */
+void AES_decrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key) {
+
+ const u32 *rk;
+ u32 s0, s1, s2, s3, t0, t1, t2, t3;
+#ifndef FULL_UNROLL
+ int r;
+#endif /* ?FULL_UNROLL */
+
+ assert(in && out && key);
+ rk = key->rd_key;
+
+ /*
+ * map byte array block to cipher state
+ * and add initial round key:
+ */
+ s0 = GETU32(in ) ^ rk[0];
+ s1 = GETU32(in + 4) ^ rk[1];
+ s2 = GETU32(in + 8) ^ rk[2];
+ s3 = GETU32(in + 12) ^ rk[3];
+#ifdef FULL_UNROLL
+ /* round 1: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7];
+ /* round 2: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11];
+ /* round 3: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15];
+ /* round 4: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19];
+ /* round 5: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23];
+ /* round 6: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27];
+ /* round 7: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31];
+ /* round 8: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35];
+ /* round 9: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39];
+ if (key->rounds > 10) {
+ /* round 10: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43];
+ /* round 11: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47];
+ if (key->rounds > 12) {
+ /* round 12: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51];
+ /* round 13: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55];
+ }
+ }
+ rk += key->rounds << 2;
+#else /* !FULL_UNROLL */
+ /*
+ * Nr - 1 full rounds:
+ */
+ r = key->rounds >> 1;
+ for (;;) {
+ t0 =
+ Td0[(s0 >> 24) ] ^
+ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^
+ Td3[(s1 ) & 0xff] ^
+ rk[4];
+ t1 =
+ Td0[(s1 >> 24) ] ^
+ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^
+ Td3[(s2 ) & 0xff] ^
+ rk[5];
+ t2 =
+ Td0[(s2 >> 24) ] ^
+ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^
+ Td3[(s3 ) & 0xff] ^
+ rk[6];
+ t3 =
+ Td0[(s3 >> 24) ] ^
+ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^
+ Td3[(s0 ) & 0xff] ^
+ rk[7];
+
+ rk += 8;
+ if (--r == 0) {
+ break;
+ }
+
+ s0 =
+ Td0[(t0 >> 24) ] ^
+ Td1[(t3 >> 16) & 0xff] ^
+ Td2[(t2 >> 8) & 0xff] ^
+ Td3[(t1 ) & 0xff] ^
+ rk[0];
+ s1 =
+ Td0[(t1 >> 24) ] ^
+ Td1[(t0 >> 16) & 0xff] ^
+ Td2[(t3 >> 8) & 0xff] ^
+ Td3[(t2 ) & 0xff] ^
+ rk[1];
+ s2 =
+ Td0[(t2 >> 24) ] ^
+ Td1[(t1 >> 16) & 0xff] ^
+ Td2[(t0 >> 8) & 0xff] ^
+ Td3[(t3 ) & 0xff] ^
+ rk[2];
+ s3 =
+ Td0[(t3 >> 24) ] ^
+ Td1[(t2 >> 16) & 0xff] ^
+ Td2[(t1 >> 8) & 0xff] ^
+ Td3[(t0 ) & 0xff] ^
+ rk[3];
+ }
+#endif /* ?FULL_UNROLL */
+ /*
+ * apply last round and
+ * map cipher state to byte array block:
+ */
+ s0 =
+ (Td4[(t0 >> 24) ] << 24) ^
+ (Td4[(t3 >> 16) & 0xff] << 16) ^
+ (Td4[(t2 >> 8) & 0xff] << 8) ^
+ (Td4[(t1 ) & 0xff]) ^
+ rk[0];
+ PUTU32(out , s0);
+ s1 =
+ (Td4[(t1 >> 24) ] << 24) ^
+ (Td4[(t0 >> 16) & 0xff] << 16) ^
+ (Td4[(t3 >> 8) & 0xff] << 8) ^
+ (Td4[(t2 ) & 0xff]) ^
+ rk[1];
+ PUTU32(out + 4, s1);
+ s2 =
+ (Td4[(t2 >> 24) ] << 24) ^
+ (Td4[(t1 >> 16) & 0xff] << 16) ^
+ (Td4[(t0 >> 8) & 0xff] << 8) ^
+ (Td4[(t3 ) & 0xff]) ^
+ rk[2];
+ PUTU32(out + 8, s2);
+ s3 =
+ (Td4[(t3 >> 24) ] << 24) ^
+ (Td4[(t2 >> 16) & 0xff] << 16) ^
+ (Td4[(t1 >> 8) & 0xff] << 8) ^
+ (Td4[(t0 ) & 0xff]) ^
+ rk[3];
+ PUTU32(out + 12, s3);
+}
+
+#else /* AES_ASM */
+
+static const u8 Te4[256] = {
+ 0x63U, 0x7cU, 0x77U, 0x7bU, 0xf2U, 0x6bU, 0x6fU, 0xc5U,
+ 0x30U, 0x01U, 0x67U, 0x2bU, 0xfeU, 0xd7U, 0xabU, 0x76U,
+ 0xcaU, 0x82U, 0xc9U, 0x7dU, 0xfaU, 0x59U, 0x47U, 0xf0U,
+ 0xadU, 0xd4U, 0xa2U, 0xafU, 0x9cU, 0xa4U, 0x72U, 0xc0U,
+ 0xb7U, 0xfdU, 0x93U, 0x26U, 0x36U, 0x3fU, 0xf7U, 0xccU,
+ 0x34U, 0xa5U, 0xe5U, 0xf1U, 0x71U, 0xd8U, 0x31U, 0x15U,
+ 0x04U, 0xc7U, 0x23U, 0xc3U, 0x18U, 0x96U, 0x05U, 0x9aU,
+ 0x07U, 0x12U, 0x80U, 0xe2U, 0xebU, 0x27U, 0xb2U, 0x75U,
+ 0x09U, 0x83U, 0x2cU, 0x1aU, 0x1bU, 0x6eU, 0x5aU, 0xa0U,
+ 0x52U, 0x3bU, 0xd6U, 0xb3U, 0x29U, 0xe3U, 0x2fU, 0x84U,
+ 0x53U, 0xd1U, 0x00U, 0xedU, 0x20U, 0xfcU, 0xb1U, 0x5bU,
+ 0x6aU, 0xcbU, 0xbeU, 0x39U, 0x4aU, 0x4cU, 0x58U, 0xcfU,
+ 0xd0U, 0xefU, 0xaaU, 0xfbU, 0x43U, 0x4dU, 0x33U, 0x85U,
+ 0x45U, 0xf9U, 0x02U, 0x7fU, 0x50U, 0x3cU, 0x9fU, 0xa8U,
+ 0x51U, 0xa3U, 0x40U, 0x8fU, 0x92U, 0x9dU, 0x38U, 0xf5U,
+ 0xbcU, 0xb6U, 0xdaU, 0x21U, 0x10U, 0xffU, 0xf3U, 0xd2U,
+ 0xcdU, 0x0cU, 0x13U, 0xecU, 0x5fU, 0x97U, 0x44U, 0x17U,
+ 0xc4U, 0xa7U, 0x7eU, 0x3dU, 0x64U, 0x5dU, 0x19U, 0x73U,
+ 0x60U, 0x81U, 0x4fU, 0xdcU, 0x22U, 0x2aU, 0x90U, 0x88U,
+ 0x46U, 0xeeU, 0xb8U, 0x14U, 0xdeU, 0x5eU, 0x0bU, 0xdbU,
+ 0xe0U, 0x32U, 0x3aU, 0x0aU, 0x49U, 0x06U, 0x24U, 0x5cU,
+ 0xc2U, 0xd3U, 0xacU, 0x62U, 0x91U, 0x95U, 0xe4U, 0x79U,
+ 0xe7U, 0xc8U, 0x37U, 0x6dU, 0x8dU, 0xd5U, 0x4eU, 0xa9U,
+ 0x6cU, 0x56U, 0xf4U, 0xeaU, 0x65U, 0x7aU, 0xaeU, 0x08U,
+ 0xbaU, 0x78U, 0x25U, 0x2eU, 0x1cU, 0xa6U, 0xb4U, 0xc6U,
+ 0xe8U, 0xddU, 0x74U, 0x1fU, 0x4bU, 0xbdU, 0x8bU, 0x8aU,
+ 0x70U, 0x3eU, 0xb5U, 0x66U, 0x48U, 0x03U, 0xf6U, 0x0eU,
+ 0x61U, 0x35U, 0x57U, 0xb9U, 0x86U, 0xc1U, 0x1dU, 0x9eU,
+ 0xe1U, 0xf8U, 0x98U, 0x11U, 0x69U, 0xd9U, 0x8eU, 0x94U,
+ 0x9bU, 0x1eU, 0x87U, 0xe9U, 0xceU, 0x55U, 0x28U, 0xdfU,
+ 0x8cU, 0xa1U, 0x89U, 0x0dU, 0xbfU, 0xe6U, 0x42U, 0x68U,
+ 0x41U, 0x99U, 0x2dU, 0x0fU, 0xb0U, 0x54U, 0xbbU, 0x16U
+};
+static const u32 rcon[] = {
+ 0x01000000, 0x02000000, 0x04000000, 0x08000000,
+ 0x10000000, 0x20000000, 0x40000000, 0x80000000,
+ 0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
+};
+
+/**
+ * Expand the cipher key into the encryption key schedule.
+ */
+int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key) {
+ u32 *rk;
+ int i = 0;
+ u32 temp;
+
+ if (!userKey || !key)
+ return -1;
+ if (bits != 128 && bits != 192 && bits != 256)
+ return -2;
+
+ rk = key->rd_key;
+
+ if (bits==128)
+ key->rounds = 10;
+ else if (bits==192)
+ key->rounds = 12;
+ else
+ key->rounds = 14;
+
+ rk[0] = GETU32(userKey );
+ rk[1] = GETU32(userKey + 4);
+ rk[2] = GETU32(userKey + 8);
+ rk[3] = GETU32(userKey + 12);
+ if (bits == 128) {
+ while (1) {
+ temp = rk[3];
+ rk[4] = rk[0] ^
+ (Te4[(temp >> 16) & 0xff] << 24) ^
+ (Te4[(temp >> 8) & 0xff] << 16) ^
+ (Te4[(temp ) & 0xff] << 8) ^
+ (Te4[(temp >> 24) ]) ^
+ rcon[i];
+ rk[5] = rk[1] ^ rk[4];
+ rk[6] = rk[2] ^ rk[5];
+ rk[7] = rk[3] ^ rk[6];
+ if (++i == 10) {
+ return 0;
+ }
+ rk += 4;
+ }
+ }
+ rk[4] = GETU32(userKey + 16);
+ rk[5] = GETU32(userKey + 20);
+ if (bits == 192) {
+ while (1) {
+ temp = rk[ 5];
+ rk[ 6] = rk[ 0] ^
+ (Te4[(temp >> 16) & 0xff] << 24) ^
+ (Te4[(temp >> 8) & 0xff] << 16) ^
+ (Te4[(temp ) & 0xff] << 8) ^
+ (Te4[(temp >> 24) ]) ^
+ rcon[i];
+ rk[ 7] = rk[ 1] ^ rk[ 6];
+ rk[ 8] = rk[ 2] ^ rk[ 7];
+ rk[ 9] = rk[ 3] ^ rk[ 8];
+ if (++i == 8) {
+ return 0;
+ }
+ rk[10] = rk[ 4] ^ rk[ 9];
+ rk[11] = rk[ 5] ^ rk[10];
+ rk += 6;
+ }
+ }
+ rk[6] = GETU32(userKey + 24);
+ rk[7] = GETU32(userKey + 28);
+ if (bits == 256) {
+ while (1) {
+ temp = rk[ 7];
+ rk[ 8] = rk[ 0] ^
+ (Te4[(temp >> 16) & 0xff] << 24) ^
+ (Te4[(temp >> 8) & 0xff] << 16) ^
+ (Te4[(temp ) & 0xff] << 8) ^
+ (Te4[(temp >> 24) ]) ^
+ rcon[i];
+ rk[ 9] = rk[ 1] ^ rk[ 8];
+ rk[10] = rk[ 2] ^ rk[ 9];
+ rk[11] = rk[ 3] ^ rk[10];
+ if (++i == 7) {
+ return 0;
+ }
+ temp = rk[11];
+ rk[12] = rk[ 4] ^
+ (Te4[(temp >> 24) ] << 24) ^
+ (Te4[(temp >> 16) & 0xff] << 16) ^
+ (Te4[(temp >> 8) & 0xff] << 8) ^
+ (Te4[(temp ) & 0xff]);
+ rk[13] = rk[ 5] ^ rk[12];
+ rk[14] = rk[ 6] ^ rk[13];
+ rk[15] = rk[ 7] ^ rk[14];
+
+ rk += 8;
+ }
+ }
+ return 0;
+}
+
+/**
+ * Expand the cipher key into the decryption key schedule.
+ */
+int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key) {
+
+ u32 *rk;
+ int i, j, status;
+ u32 temp;
+
+ /* first, start with an encryption schedule */
+ status = AES_set_encrypt_key(userKey, bits, key);
+ if (status < 0)
+ return status;
+
+ rk = key->rd_key;
+
+ /* invert the order of the round keys: */
+ for (i = 0, j = 4*(key->rounds); i < j; i += 4, j -= 4) {
+ temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp;
+ temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
+ temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
+ temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
+ }
+ /* apply the inverse MixColumn transform to all round keys but the first and the last: */
+ for (i = 1; i < (key->rounds); i++) {
+ rk += 4;
+ for (j = 0; j < 4; j++) {
+ u32 tp1, tp2, tp4, tp8, tp9, tpb, tpd, tpe, m;
+
+ tp1 = rk[j];
+ m = tp1 & 0x80808080;
+ tp2 = ((tp1 & 0x7f7f7f7f) << 1) ^
+ ((m - (m >> 7)) & 0x1b1b1b1b);
+ m = tp2 & 0x80808080;
+ tp4 = ((tp2 & 0x7f7f7f7f) << 1) ^
+ ((m - (m >> 7)) & 0x1b1b1b1b);
+ m = tp4 & 0x80808080;
+ tp8 = ((tp4 & 0x7f7f7f7f) << 1) ^
+ ((m - (m >> 7)) & 0x1b1b1b1b);
+ tp9 = tp8 ^ tp1;
+ tpb = tp9 ^ tp2;
+ tpd = tp9 ^ tp4;
+ tpe = tp8 ^ tp4 ^ tp2;
+#if defined(ROTATE)
+ rk[j] = tpe ^ ROTATE(tpd,16) ^
+ ROTATE(tp9,24) ^ ROTATE(tpb,8);
+#else
+ rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^
+ (tp9 >> 8) ^ (tp9 << 24) ^
+ (tpb >> 24) ^ (tpb << 8);
+#endif
+ }
+ }
+ return 0;
+}
+
+#endif /* AES_ASM */
diff --git a/snmplib/openssl/openssl_aes_local.h b/snmplib/openssl/openssl_aes_local.h
new file mode 100644
index 0000000..319832e
--- /dev/null
+++ b/snmplib/openssl/openssl_aes_local.h
@@ -0,0 +1,87 @@
+/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ */
+
+#ifndef HEADER_AES_LOCL_H
+#define HEADER_AES_LOCL_H
+
+#ifdef OPENSSL_NO_AES
+#error AES is disabled.
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
+# define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
+# define GETU32(p) SWAP(*((u32 *)(p)))
+# define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); }
+#else
+# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3]))
+# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); }
+#endif
+
+#ifdef AES_LONG
+typedef unsigned long u32;
+#else
+typedef unsigned int u32;
+#endif
+typedef unsigned short u16;
+typedef unsigned char u8;
+
+#define MAXKC (256/32)
+#define MAXKB (256/8)
+#define MAXNR 14
+
+/* This controls loop-unrolling in aes_core.c */
+#undef FULL_UNROLL
+
+#endif /* !HEADER_AES_LOCL_H */
diff --git a/snmplib/openssl/openssl_cbc_enc.c b/snmplib/openssl/openssl_cbc_enc.c
new file mode 100644
index 0000000..a91df83
--- /dev/null
+++ b/snmplib/openssl/openssl_cbc_enc.c
@@ -0,0 +1,61 @@
+/* crypto/des/cbc_enc.c */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#define CBC_ENC_C__DONT_UPDATE_IV
+
+#include "openssl_ncbc_enc.c" /* des_cbc_encrypt */
diff --git a/snmplib/openssl/openssl_cfb128.c b/snmplib/openssl/openssl_cfb128.c
new file mode 100644
index 0000000..5e0bc1e
--- /dev/null
+++ b/snmplib/openssl/openssl_cfb128.c
@@ -0,0 +1,250 @@
+/* ====================================================================
+ * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ */
+
+#include "openssl_modes.h"
+#include <string.h>
+
+#ifndef MODES_DEBUG
+# ifndef NDEBUG
+# define NDEBUG
+# endif
+#endif
+#include <assert.h>
+
+#define STRICT_ALIGNMENT
+#if defined(__i386) || defined(__i386__) || \
+ defined(__x86_64) || defined(__x86_64__) || \
+ defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \
+ defined(__s390__) || defined(__s390x__)
+# undef STRICT_ALIGNMENT
+#endif
+
+/* The input and output encrypted as though 128bit cfb mode is being
+ * used. The extra state information to record how much of the
+ * 128bit block we have used is contained in *num;
+ */
+void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block)
+{
+ unsigned int n;
+ size_t l = 0;
+
+ assert(in && out && key && ivec && num);
+
+ n = *num;
+
+ if (enc) {
+#if !defined(OPENSSL_SMALL_FOOTPRINT)
+ if (16%sizeof(size_t) == 0) do { /* always true actually */
+ while (n && len) {
+ *(out++) = ivec[n] ^= *(in++);
+ --len;
+ n = (n+1) % 16;
+ }
+#if defined(STRICT_ALIGNMENT)
+ if (((size_t)in|(size_t)out|(size_t)ivec)%sizeof(size_t) != 0)
+ break;
+#endif
+ while (len>=16) {
+ (*block)(ivec, ivec, key);
+ for (n=0; n<16; n+=sizeof(size_t)) {
+ *(size_t*)(out+n) =
+ *(size_t*)(ivec+n) ^= *(const size_t*)(in+n);
+ }
+ len -= 16;
+ out += 16;
+ in += 16;
+ }
+ n = 0;
+ if (len) {
+ (*block)(ivec, ivec, key);
+ while (len--) {
+ out[n] = ivec[n] ^= in[n];
+ ++n;
+ }
+ }
+ *num = n;
+ return;
+ } while (0);
+ /* the rest would be commonly eliminated by x86* compiler */
+#endif
+ while (l<len) {
+ if (n == 0) {
+ (*block)(ivec, ivec, key);
+ }
+ out[l] = ivec[n] ^= in[l];
+ ++l;
+ n = (n+1) % 16;
+ }
+ *num = n;
+ } else {
+#if !defined(OPENSSL_SMALL_FOOTPRINT)
+ if (16%sizeof(size_t) == 0) do { /* always true actually */
+ while (n && len) {
+ unsigned char c;
+ *(out++) = ivec[n] ^ (c = *(in++)); ivec[n] = c;
+ --len;
+ n = (n+1) % 16;
+ }
+#if defined(STRICT_ALIGNMENT)
+ if (((size_t)in|(size_t)out|(size_t)ivec)%sizeof(size_t) != 0)
+ break;
+#endif
+ while (len>=16) {
+ (*block)(ivec, ivec, key);
+ for (n=0; n<16; n+=sizeof(size_t)) {
+ size_t t = *(const size_t*)(in+n);
+ *(size_t*)(out+n) = *(const size_t*)(ivec+n) ^ t;
+ *(size_t*)(ivec+n) = t;
+ }
+ len -= 16;
+ out += 16;
+ in += 16;
+ }
+ n = 0;
+ if (len) {
+ (*block)(ivec, ivec, key);
+ while (len--) {
+ unsigned char c;
+ out[n] = ivec[n] ^ (c = in[n]); ivec[n] = c;
+ ++n;
+ }
+ }
+ *num = n;
+ return;
+ } while (0);
+ /* the rest would be commonly eliminated by x86* compiler */
+#endif
+ while (l<len) {
+ unsigned char c;
+ if (n == 0) {
+ (*block)(ivec, ivec, key);
+ }
+ out[l] = ivec[n] ^ (c = in[l]); ivec[n] = c;
+ ++l;
+ n = (n+1) % 16;
+ }
+ *num=n;
+ }
+}
+
+/* This expects a single block of size nbits for both in and out. Note that
+ it corrupts any extra bits in the last byte of out */
+static void cfbr_encrypt_block(const unsigned char *in,unsigned char *out,
+ int nbits,const void *key,
+ unsigned char ivec[16],int enc,
+ block128_f block)
+{
+ int n,rem,num;
+ unsigned char ovec[16*2 + 1]; /* +1 because we dererefence (but don't use) one byte off the end */
+
+ if (nbits<=0 || nbits>128) return;
+
+ /* fill in the first half of the new IV with the current IV */
+ memcpy(ovec,ivec,16);
+ /* construct the new IV */
+ (*block)(ivec,ivec,key);
+ num = (nbits+7)/8;
+ if (enc) /* encrypt the input */
+ for(n=0 ; n < num ; ++n)
+ out[n] = (ovec[16+n] = in[n] ^ ivec[n]);
+ else /* decrypt the input */
+ for(n=0 ; n < num ; ++n)
+ out[n] = (ovec[16+n] = in[n]) ^ ivec[n];
+ /* shift ovec left... */
+ rem = nbits%8;
+ num = nbits/8;
+ if(rem==0)
+ memcpy(ivec,ovec+num,16);
+ else
+ for(n=0 ; n < 16 ; ++n)
+ ivec[n] = ovec[n+num]<<rem | ovec[n+num+1]>>(8-rem);
+
+ /* it is not necessary to cleanse ovec, since the IV is not secret */
+}
+
+/* N.B. This expects the input to be packed, MS bit first */
+void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t bits, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block)
+{
+ size_t n;
+ unsigned char c[1],d[1];
+
+ assert(in && out && key && ivec && num);
+ assert(*num == 0);
+
+ memset(out,0,(bits+7)/8);
+ for(n=0 ; n<bits ; ++n)
+ {
+ c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0;
+ cfbr_encrypt_block(c,d,1,key,ivec,enc,block);
+ out[n/8]=(out[n/8]&~(1 << (unsigned int)(7-n%8))) |
+ ((d[0]&0x80) >> (unsigned int)(n%8));
+ }
+}
+
+void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block)
+{
+ size_t n;
+
+ assert(in && out && key && ivec && num);
+ assert(*num == 0);
+
+ for(n=0 ; n<length ; ++n)
+ cfbr_encrypt_block(&in[n],&out[n],8,key,ivec,enc,block);
+}
+
diff --git a/snmplib/openssl/openssl_des_enc.c b/snmplib/openssl/openssl_des_enc.c
new file mode 100644
index 0000000..ba70f9c
--- /dev/null
+++ b/snmplib/openssl/openssl_des_enc.c
@@ -0,0 +1,400 @@
+/* crypto/des/des_enc.c */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#include "openssl_des_local.h"
+#include "openssl_spr.h"
+
+void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
+ {
+ register DES_LONG l,r,t,u;
+#ifdef DES_PTR
+ register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
+#endif
+#ifndef DES_UNROLL
+ register int i;
+#endif
+ register DES_LONG *s;
+
+ r=data[0];
+ l=data[1];
+
+ IP(r,l);
+ /* Things have been modified so that the initial rotate is
+ * done outside the loop. This required the
+ * DES_SPtrans values in sp.h to be rotated 1 bit to the right.
+ * One perl script later and things have a 5% speed up on a sparc2.
+ * Thanks to Richard Outerbridge <71755.204@CompuServe.COM>
+ * for pointing this out. */
+ /* clear the top bits on machines with 8byte longs */
+ /* shift left by 2 */
+ r=ROTATE(r,29)&0xffffffffL;
+ l=ROTATE(l,29)&0xffffffffL;
+
+ s=ks->ks->deslong;
+ /* I don't know if it is worth the effort of loop unrolling the
+ * inner loop */
+ if (enc)
+ {
+#ifdef DES_UNROLL
+ D_ENCRYPT(l,r, 0); /* 1 */
+ D_ENCRYPT(r,l, 2); /* 2 */
+ D_ENCRYPT(l,r, 4); /* 3 */
+ D_ENCRYPT(r,l, 6); /* 4 */
+ D_ENCRYPT(l,r, 8); /* 5 */
+ D_ENCRYPT(r,l,10); /* 6 */
+ D_ENCRYPT(l,r,12); /* 7 */
+ D_ENCRYPT(r,l,14); /* 8 */
+ D_ENCRYPT(l,r,16); /* 9 */
+ D_ENCRYPT(r,l,18); /* 10 */
+ D_ENCRYPT(l,r,20); /* 11 */
+ D_ENCRYPT(r,l,22); /* 12 */
+ D_ENCRYPT(l,r,24); /* 13 */
+ D_ENCRYPT(r,l,26); /* 14 */
+ D_ENCRYPT(l,r,28); /* 15 */
+ D_ENCRYPT(r,l,30); /* 16 */
+#else
+ for (i=0; i<32; i+=4)
+ {
+ D_ENCRYPT(l,r,i+0); /* 1 */
+ D_ENCRYPT(r,l,i+2); /* 2 */
+ }
+#endif
+ }
+ else
+ {
+#ifdef DES_UNROLL
+ D_ENCRYPT(l,r,30); /* 16 */
+ D_ENCRYPT(r,l,28); /* 15 */
+ D_ENCRYPT(l,r,26); /* 14 */
+ D_ENCRYPT(r,l,24); /* 13 */
+ D_ENCRYPT(l,r,22); /* 12 */
+ D_ENCRYPT(r,l,20); /* 11 */
+ D_ENCRYPT(l,r,18); /* 10 */
+ D_ENCRYPT(r,l,16); /* 9 */
+ D_ENCRYPT(l,r,14); /* 8 */
+ D_ENCRYPT(r,l,12); /* 7 */
+ D_ENCRYPT(l,r,10); /* 6 */
+ D_ENCRYPT(r,l, 8); /* 5 */
+ D_ENCRYPT(l,r, 6); /* 4 */
+ D_ENCRYPT(r,l, 4); /* 3 */
+ D_ENCRYPT(l,r, 2); /* 2 */
+ D_ENCRYPT(r,l, 0); /* 1 */
+#else
+ for (i=30; i>0; i-=4)
+ {
+ D_ENCRYPT(l,r,i-0); /* 16 */
+ D_ENCRYPT(r,l,i-2); /* 15 */
+ }
+#endif
+ }
+
+ /* rotate and clear the top bits on machines with 8byte longs */
+ l=ROTATE(l,3)&0xffffffffL;
+ r=ROTATE(r,3)&0xffffffffL;
+
+ FP(r,l);
+ data[0]=l;
+ data[1]=r;
+ l=r=t=u=0;
+ }
+
+void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
+ {
+ register DES_LONG l,r,t,u;
+#ifdef DES_PTR
+ register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
+#endif
+#ifndef DES_UNROLL
+ register int i;
+#endif
+ register DES_LONG *s;
+
+ r=data[0];
+ l=data[1];
+
+ /* Things have been modified so that the initial rotate is
+ * done outside the loop. This required the
+ * DES_SPtrans values in sp.h to be rotated 1 bit to the right.
+ * One perl script later and things have a 5% speed up on a sparc2.
+ * Thanks to Richard Outerbridge <71755.204@CompuServe.COM>
+ * for pointing this out. */
+ /* clear the top bits on machines with 8byte longs */
+ r=ROTATE(r,29)&0xffffffffL;
+ l=ROTATE(l,29)&0xffffffffL;
+
+ s=ks->ks->deslong;
+ /* I don't know if it is worth the effort of loop unrolling the
+ * inner loop */
+ if (enc)
+ {
+#ifdef DES_UNROLL
+ D_ENCRYPT(l,r, 0); /* 1 */
+ D_ENCRYPT(r,l, 2); /* 2 */
+ D_ENCRYPT(l,r, 4); /* 3 */
+ D_ENCRYPT(r,l, 6); /* 4 */
+ D_ENCRYPT(l,r, 8); /* 5 */
+ D_ENCRYPT(r,l,10); /* 6 */
+ D_ENCRYPT(l,r,12); /* 7 */
+ D_ENCRYPT(r,l,14); /* 8 */
+ D_ENCRYPT(l,r,16); /* 9 */
+ D_ENCRYPT(r,l,18); /* 10 */
+ D_ENCRYPT(l,r,20); /* 11 */
+ D_ENCRYPT(r,l,22); /* 12 */
+ D_ENCRYPT(l,r,24); /* 13 */
+ D_ENCRYPT(r,l,26); /* 14 */
+ D_ENCRYPT(l,r,28); /* 15 */
+ D_ENCRYPT(r,l,30); /* 16 */
+#else
+ for (i=0; i<32; i+=4)
+ {
+ D_ENCRYPT(l,r,i+0); /* 1 */
+ D_ENCRYPT(r,l,i+2); /* 2 */
+ }
+#endif
+ }
+ else
+ {
+#ifdef DES_UNROLL
+ D_ENCRYPT(l,r,30); /* 16 */
+ D_ENCRYPT(r,l,28); /* 15 */
+ D_ENCRYPT(l,r,26); /* 14 */
+ D_ENCRYPT(r,l,24); /* 13 */
+ D_ENCRYPT(l,r,22); /* 12 */
+ D_ENCRYPT(r,l,20); /* 11 */
+ D_ENCRYPT(l,r,18); /* 10 */
+ D_ENCRYPT(r,l,16); /* 9 */
+ D_ENCRYPT(l,r,14); /* 8 */
+ D_ENCRYPT(r,l,12); /* 7 */
+ D_ENCRYPT(l,r,10); /* 6 */
+ D_ENCRYPT(r,l, 8); /* 5 */
+ D_ENCRYPT(l,r, 6); /* 4 */
+ D_ENCRYPT(r,l, 4); /* 3 */
+ D_ENCRYPT(l,r, 2); /* 2 */
+ D_ENCRYPT(r,l, 0); /* 1 */
+#else
+ for (i=30; i>0; i-=4)
+ {
+ D_ENCRYPT(l,r,i-0); /* 16 */
+ D_ENCRYPT(r,l,i-2); /* 15 */
+ }
+#endif
+ }
+ /* rotate and clear the top bits on machines with 8byte longs */
+ data[0]=ROTATE(l,3)&0xffffffffL;
+ data[1]=ROTATE(r,3)&0xffffffffL;
+ l=r=t=u=0;
+ }
+
+void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3)
+ {
+ register DES_LONG l,r;
+
+ l=data[0];
+ r=data[1];
+ IP(l,r);
+ data[0]=l;
+ data[1]=r;
+ DES_encrypt2((DES_LONG *)data,ks1,DES_ENCRYPT);
+ DES_encrypt2((DES_LONG *)data,ks2,DES_DECRYPT);
+ DES_encrypt2((DES_LONG *)data,ks3,DES_ENCRYPT);
+ l=data[0];
+ r=data[1];
+ FP(r,l);
+ data[0]=l;
+ data[1]=r;
+ }
+
+void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3)
+ {
+ register DES_LONG l,r;
+
+ l=data[0];
+ r=data[1];
+ IP(l,r);
+ data[0]=l;
+ data[1]=r;
+ DES_encrypt2((DES_LONG *)data,ks3,DES_DECRYPT);
+ DES_encrypt2((DES_LONG *)data,ks2,DES_ENCRYPT);
+ DES_encrypt2((DES_LONG *)data,ks1,DES_DECRYPT);
+ l=data[0];
+ r=data[1];
+ FP(r,l);
+ data[0]=l;
+ data[1]=r;
+ }
+
+#ifndef DES_DEFAULT_OPTIONS
+
+#undef CBC_ENC_C__DONT_UPDATE_IV
+#include "openssl_ncbc_enc.c" /* DES_ncbc_encrypt */
+
+void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3,
+ DES_cblock *ivec, int enc)
+ {
+ register DES_LONG tin0,tin1;
+ register DES_LONG tout0,tout1,xor0,xor1;
+ register const unsigned char *in;
+ unsigned char *out;
+ register long l=length;
+ DES_LONG tin[2];
+ unsigned char *iv;
+
+ in=input;
+ out=output;
+ iv = &(*ivec)[0];
+
+ if (enc)
+ {
+ c2l(iv,tout0);
+ c2l(iv,tout1);
+ for (l-=8; l>=0; l-=8)
+ {
+ c2l(in,tin0);
+ c2l(in,tin1);
+ tin0^=tout0;
+ tin1^=tout1;
+
+ tin[0]=tin0;
+ tin[1]=tin1;
+ DES_encrypt3((DES_LONG *)tin,ks1,ks2,ks3);
+ tout0=tin[0];
+ tout1=tin[1];
+
+ l2c(tout0,out);
+ l2c(tout1,out);
+ }
+ if (l != -8)
+ {
+ c2ln(in,tin0,tin1,l+8);
+ tin0^=tout0;
+ tin1^=tout1;
+
+ tin[0]=tin0;
+ tin[1]=tin1;
+ DES_encrypt3((DES_LONG *)tin,ks1,ks2,ks3);
+ tout0=tin[0];
+ tout1=tin[1];
+
+ l2c(tout0,out);
+ l2c(tout1,out);
+ }
+ iv = &(*ivec)[0];
+ l2c(tout0,iv);
+ l2c(tout1,iv);
+ }
+ else
+ {
+ register DES_LONG t0,t1;
+
+ c2l(iv,xor0);
+ c2l(iv,xor1);
+ for (l-=8; l>=0; l-=8)
+ {
+ c2l(in,tin0);
+ c2l(in,tin1);
+
+ t0=tin0;
+ t1=tin1;
+
+ tin[0]=tin0;
+ tin[1]=tin1;
+ DES_decrypt3((DES_LONG *)tin,ks1,ks2,ks3);
+ tout0=tin[0];
+ tout1=tin[1];
+
+ tout0^=xor0;
+ tout1^=xor1;
+ l2c(tout0,out);
+ l2c(tout1,out);
+ xor0=t0;
+ xor1=t1;
+ }
+ if (l != -8)
+ {
+ c2l(in,tin0);
+ c2l(in,tin1);
+
+ t0=tin0;
+ t1=tin1;
+
+ tin[0]=tin0;
+ tin[1]=tin1;
+ DES_decrypt3((DES_LONG *)tin,ks1,ks2,ks3);
+ tout0=tin[0];
+ tout1=tin[1];
+
+ tout0^=xor0;
+ tout1^=xor1;
+ l2cn(tout0,tout1,out,l+8);
+ xor0=t0;
+ xor1=t1;
+ }
+
+ iv = &(*ivec)[0];
+ l2c(xor0,iv);
+ l2c(xor1,iv);
+ }
+ tin0=tin1=tout0=tout1=xor0=xor1=0;
+ tin[0]=tin[1]=0;
+ }
+
+#endif /* DES_DEFAULT_OPTIONS */
diff --git a/snmplib/openssl/openssl_des_local.h b/snmplib/openssl/openssl_des_local.h
new file mode 100644
index 0000000..f91d844
--- /dev/null
+++ b/snmplib/openssl/openssl_des_local.h
@@ -0,0 +1,431 @@
+/* crypto/des/des_locl.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_DES_LOCL_H
+#define HEADER_DES_LOCL_H
+
+#if defined(OPENSSL_SYS_WIN32)
+#ifndef OPENSSL_SYS_MSDOS
+#define OPENSSL_SYS_MSDOS
+#endif
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifndef OPENSSL_SYS_MSDOS
+#if !defined(OPENSSL_SYS_VMS) || defined(__DECC)
+#ifdef OPENSSL_UNISTD
+# include OPENSSL_UNISTD
+#else
+# include <unistd.h>
+#endif
+#include <math.h>
+#endif
+#endif
+
+#include <net-snmp/library/openssl_des.h>
+
+#ifdef OPENSSL_SYS_MSDOS /* Visual C++ 2.1 (Windows NT/95) */
+#include <stdlib.h>
+#include <errno.h>
+#include <time.h>
+#include <io.h>
+#endif
+
+#if defined(__STDC__) || defined(OPENSSL_SYS_VMS) || defined(M_XENIX) || defined(OPENSSL_SYS_MSDOS)
+#include <string.h>
+#endif
+
+#ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+#endif
+
+#define ITERATIONS 16
+#define HALF_ITERATIONS 8
+
+/* used in des_read and des_write */
+#define MAXWRITE (1024*16)
+#define BSIZE (MAXWRITE+4)
+
+#define c2l(c,l) (l =((DES_LONG)(*((c)++))) , \
+ l|=((DES_LONG)(*((c)++)))<< 8L, \
+ l|=((DES_LONG)(*((c)++)))<<16L, \
+ l|=((DES_LONG)(*((c)++)))<<24L)
+
+/* NOTE - c is not incremented as per c2l */
+#define c2ln(c,l1,l2,n) { \
+ c+=n; \
+ l1=l2=0; \
+ switch (n) { \
+ case 8: l2 =((DES_LONG)(*(--(c))))<<24L; \
+ case 7: l2|=((DES_LONG)(*(--(c))))<<16L; \
+ case 6: l2|=((DES_LONG)(*(--(c))))<< 8L; \
+ case 5: l2|=((DES_LONG)(*(--(c)))); \
+ case 4: l1 =((DES_LONG)(*(--(c))))<<24L; \
+ case 3: l1|=((DES_LONG)(*(--(c))))<<16L; \
+ case 2: l1|=((DES_LONG)(*(--(c))))<< 8L; \
+ case 1: l1|=((DES_LONG)(*(--(c)))); \
+ } \
+ }
+
+#define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
+ *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>24L)&0xff))
+
+/* replacements for htonl and ntohl since I have no idea what to do
+ * when faced with machines with 8 byte longs. */
+#define HDRSIZE 4
+
+#define n2l(c,l) (l =((DES_LONG)(*((c)++)))<<24L, \
+ l|=((DES_LONG)(*((c)++)))<<16L, \
+ l|=((DES_LONG)(*((c)++)))<< 8L, \
+ l|=((DES_LONG)(*((c)++))))
+
+#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24L)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
+ *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
+ *((c)++)=(unsigned char)(((l) )&0xff))
+
+/* NOTE - c is not incremented as per l2c */
+#define l2cn(l1,l2,c,n) { \
+ c+=n; \
+ switch (n) { \
+ case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
+ case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
+ case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
+ case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
+ case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
+ case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
+ case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
+ case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
+ } \
+ }
+
+#if (defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER)) || defined(__ICC)
+#define ROTATE(a,n) (_lrotr(a,n))
+#elif defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC)
+# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
+# define ROTATE(a,n) ({ register unsigned int ret; \
+ asm ("rorl %1,%0" \
+ : "=r"(ret) \
+ : "I"(n),"0"(a) \
+ : "cc"); \
+ ret; \
+ })
+# endif
+#endif
+#ifndef ROTATE
+#define ROTATE(a,n) (((a)>>(n))+((a)<<(32-(n))))
+#endif
+
+/* Don't worry about the LOAD_DATA() stuff, that is used by
+ * fcrypt() to add it's little bit to the front */
+
+#ifdef DES_FCRYPT
+
+#define LOAD_DATA_tmp(R,S,u,t,E0,E1) \
+ { DES_LONG tmp; LOAD_DATA(R,S,u,t,E0,E1,tmp); }
+
+#define LOAD_DATA(R,S,u,t,E0,E1,tmp) \
+ t=R^(R>>16L); \
+ u=t&E0; t&=E1; \
+ tmp=(u<<16); u^=R^s[S ]; u^=tmp; \
+ tmp=(t<<16); t^=R^s[S+1]; t^=tmp
+#else
+#define LOAD_DATA_tmp(a,b,c,d,e,f) LOAD_DATA(a,b,c,d,e,f,g)
+#define LOAD_DATA(R,S,u,t,E0,E1,tmp) \
+ u=R^s[S ]; \
+ t=R^s[S+1]
+#endif
+
+/* The changes to this macro may help or hinder, depending on the
+ * compiler and the architecture. gcc2 always seems to do well :-).
+ * Inspired by Dana How <how@isl.stanford.edu>
+ * DO NOT use the alternative version on machines with 8 byte longs.
+ * It does not seem to work on the Alpha, even when DES_LONG is 4
+ * bytes, probably an issue of accessing non-word aligned objects :-( */
+#ifdef DES_PTR
+
+/* It recently occurred to me that 0^0^0^0^0^0^0 == 0, so there
+ * is no reason to not xor all the sub items together. This potentially
+ * saves a register since things can be xored directly into L */
+
+#if defined(DES_RISC1) || defined(DES_RISC2)
+#ifdef DES_RISC1
+#define D_ENCRYPT(LL,R,S) { \
+ unsigned int u1,u2,u3; \
+ LOAD_DATA(R,S,u,t,E0,E1,u1); \
+ u2=(int)u>>8L; \
+ u1=(int)u&0xfc; \
+ u2&=0xfc; \
+ t=ROTATE(t,4); \
+ u>>=16L; \
+ LL^= *(const DES_LONG *)(des_SP +u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x200+u2); \
+ u3=(int)(u>>8L); \
+ u1=(int)u&0xfc; \
+ u3&=0xfc; \
+ LL^= *(const DES_LONG *)(des_SP+0x400+u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x600+u3); \
+ u2=(int)t>>8L; \
+ u1=(int)t&0xfc; \
+ u2&=0xfc; \
+ t>>=16L; \
+ LL^= *(const DES_LONG *)(des_SP+0x100+u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x300+u2); \
+ u3=(int)t>>8L; \
+ u1=(int)t&0xfc; \
+ u3&=0xfc; \
+ LL^= *(const DES_LONG *)(des_SP+0x500+u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x700+u3); }
+#endif
+#ifdef DES_RISC2
+#define D_ENCRYPT(LL,R,S) { \
+ unsigned int u1,u2,s1,s2; \
+ LOAD_DATA(R,S,u,t,E0,E1,u1); \
+ u2=(int)u>>8L; \
+ u1=(int)u&0xfc; \
+ u2&=0xfc; \
+ t=ROTATE(t,4); \
+ LL^= *(const DES_LONG *)(des_SP +u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x200+u2); \
+ s1=(int)(u>>16L); \
+ s2=(int)(u>>24L); \
+ s1&=0xfc; \
+ s2&=0xfc; \
+ LL^= *(const DES_LONG *)(des_SP+0x400+s1); \
+ LL^= *(const DES_LONG *)(des_SP+0x600+s2); \
+ u2=(int)t>>8L; \
+ u1=(int)t&0xfc; \
+ u2&=0xfc; \
+ LL^= *(const DES_LONG *)(des_SP+0x100+u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x300+u2); \
+ s1=(int)(t>>16L); \
+ s2=(int)(t>>24L); \
+ s1&=0xfc; \
+ s2&=0xfc; \
+ LL^= *(const DES_LONG *)(des_SP+0x500+s1); \
+ LL^= *(const DES_LONG *)(des_SP+0x700+s2); }
+#endif
+#else
+#define D_ENCRYPT(LL,R,S) { \
+ LOAD_DATA_tmp(R,S,u,t,E0,E1); \
+ t=ROTATE(t,4); \
+ LL^= \
+ *(const DES_LONG *)(des_SP +((u )&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x200+((u>> 8L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x400+((u>>16L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x600+((u>>24L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x100+((t )&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x300+((t>> 8L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x500+((t>>16L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x700+((t>>24L)&0xfc)); }
+#endif
+
+#else /* original version */
+
+#if defined(DES_RISC1) || defined(DES_RISC2)
+#ifdef DES_RISC1
+#define D_ENCRYPT(LL,R,S) {\
+ unsigned int u1,u2,u3; \
+ LOAD_DATA(R,S,u,t,E0,E1,u1); \
+ u>>=2L; \
+ t=ROTATE(t,6); \
+ u2=(int)u>>8L; \
+ u1=(int)u&0x3f; \
+ u2&=0x3f; \
+ u>>=16L; \
+ LL^=DES_SPtrans[0][u1]; \
+ LL^=DES_SPtrans[2][u2]; \
+ u3=(int)u>>8L; \
+ u1=(int)u&0x3f; \
+ u3&=0x3f; \
+ LL^=DES_SPtrans[4][u1]; \
+ LL^=DES_SPtrans[6][u3]; \
+ u2=(int)t>>8L; \
+ u1=(int)t&0x3f; \
+ u2&=0x3f; \
+ t>>=16L; \
+ LL^=DES_SPtrans[1][u1]; \
+ LL^=DES_SPtrans[3][u2]; \
+ u3=(int)t>>8L; \
+ u1=(int)t&0x3f; \
+ u3&=0x3f; \
+ LL^=DES_SPtrans[5][u1]; \
+ LL^=DES_SPtrans[7][u3]; }
+#endif
+#ifdef DES_RISC2
+#define D_ENCRYPT(LL,R,S) {\
+ unsigned int u1,u2,s1,s2; \
+ LOAD_DATA(R,S,u,t,E0,E1,u1); \
+ u>>=2L; \
+ t=ROTATE(t,6); \
+ u2=(int)u>>8L; \
+ u1=(int)u&0x3f; \
+ u2&=0x3f; \
+ LL^=DES_SPtrans[0][u1]; \
+ LL^=DES_SPtrans[2][u2]; \
+ s1=(int)u>>16L; \
+ s2=(int)u>>24L; \
+ s1&=0x3f; \
+ s2&=0x3f; \
+ LL^=DES_SPtrans[4][s1]; \
+ LL^=DES_SPtrans[6][s2]; \
+ u2=(int)t>>8L; \
+ u1=(int)t&0x3f; \
+ u2&=0x3f; \
+ LL^=DES_SPtrans[1][u1]; \
+ LL^=DES_SPtrans[3][u2]; \
+ s1=(int)t>>16; \
+ s2=(int)t>>24L; \
+ s1&=0x3f; \
+ s2&=0x3f; \
+ LL^=DES_SPtrans[5][s1]; \
+ LL^=DES_SPtrans[7][s2]; }
+#endif
+
+#else
+
+#define D_ENCRYPT(LL,R,S) {\
+ LOAD_DATA_tmp(R,S,u,t,E0,E1); \
+ t=ROTATE(t,4); \
+ LL^=\
+ DES_SPtrans[0][(u>> 2L)&0x3f]^ \
+ DES_SPtrans[2][(u>>10L)&0x3f]^ \
+ DES_SPtrans[4][(u>>18L)&0x3f]^ \
+ DES_SPtrans[6][(u>>26L)&0x3f]^ \
+ DES_SPtrans[1][(t>> 2L)&0x3f]^ \
+ DES_SPtrans[3][(t>>10L)&0x3f]^ \
+ DES_SPtrans[5][(t>>18L)&0x3f]^ \
+ DES_SPtrans[7][(t>>26L)&0x3f]; }
+#endif
+#endif
+
+ /* IP and FP
+ * The problem is more of a geometric problem that random bit fiddling.
+ 0 1 2 3 4 5 6 7 62 54 46 38 30 22 14 6
+ 8 9 10 11 12 13 14 15 60 52 44 36 28 20 12 4
+ 16 17 18 19 20 21 22 23 58 50 42 34 26 18 10 2
+ 24 25 26 27 28 29 30 31 to 56 48 40 32 24 16 8 0
+
+ 32 33 34 35 36 37 38 39 63 55 47 39 31 23 15 7
+ 40 41 42 43 44 45 46 47 61 53 45 37 29 21 13 5
+ 48 49 50 51 52 53 54 55 59 51 43 35 27 19 11 3
+ 56 57 58 59 60 61 62 63 57 49 41 33 25 17 9 1
+
+ The output has been subject to swaps of the form
+ 0 1 -> 3 1 but the odd and even bits have been put into
+ 2 3 2 0
+ different words. The main trick is to remember that
+ t=((l>>size)^r)&(mask);
+ r^=t;
+ l^=(t<<size);
+ can be used to swap and move bits between words.
+
+ So l = 0 1 2 3 r = 16 17 18 19
+ 4 5 6 7 20 21 22 23
+ 8 9 10 11 24 25 26 27
+ 12 13 14 15 28 29 30 31
+ becomes (for size == 2 and mask == 0x3333)
+ t = 2^16 3^17 -- -- l = 0 1 16 17 r = 2 3 18 19
+ 6^20 7^21 -- -- 4 5 20 21 6 7 22 23
+ 10^24 11^25 -- -- 8 9 24 25 10 11 24 25
+ 14^28 15^29 -- -- 12 13 28 29 14 15 28 29
+
+ Thanks for hints from Richard Outerbridge - he told me IP&FP
+ could be done in 15 xor, 10 shifts and 5 ands.
+ When I finally started to think of the problem in 2D
+ I first got ~42 operations without xors. When I remembered
+ how to use xors :-) I got it to its final state.
+ */
+#define PERM_OP(a,b,t,n,m) ((t)=((((a)>>(n))^(b))&(m)),\
+ (b)^=(t),\
+ (a)^=((t)<<(n)))
+
+#define IP(l,r) \
+ { \
+ register DES_LONG tt; \
+ PERM_OP(r,l,tt, 4,0x0f0f0f0fL); \
+ PERM_OP(l,r,tt,16,0x0000ffffL); \
+ PERM_OP(r,l,tt, 2,0x33333333L); \
+ PERM_OP(l,r,tt, 8,0x00ff00ffL); \
+ PERM_OP(r,l,tt, 1,0x55555555L); \
+ }
+
+#define FP(l,r) \
+ { \
+ register DES_LONG tt; \
+ PERM_OP(l,r,tt, 1,0x55555555L); \
+ PERM_OP(r,l,tt, 8,0x00ff00ffL); \
+ PERM_OP(l,r,tt, 2,0x33333333L); \
+ PERM_OP(r,l,tt,16,0x0000ffffL); \
+ PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \
+ }
+
+extern const DES_LONG DES_SPtrans[8][64];
+
+void fcrypt_body(DES_LONG *out,DES_key_schedule *ks,
+ DES_LONG Eswap0, DES_LONG Eswap1);
+
+#ifdef OPENSSL_SMALL_FOOTPRINT
+#undef DES_UNROLL
+#endif
+#endif
diff --git a/snmplib/openssl/openssl_md32_common.h b/snmplib/openssl/openssl_md32_common.h
new file mode 100644
index 0000000..279916f
--- /dev/null
+++ b/snmplib/openssl/openssl_md32_common.h
@@ -0,0 +1,408 @@
+/* crypto/md32_common.h */
+/* ====================================================================
+ * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ */
+
+/*
+ * This is a generic 32 bit "collector" for message digest algorithms.
+ * Whenever needed it collects input character stream into chunks of
+ * 32 bit values and invokes a block function that performs actual hash
+ * calculations.
+ *
+ * Porting guide.
+ *
+ * Obligatory macros:
+ *
+ * DATA_ORDER_IS_BIG_ENDIAN or DATA_ORDER_IS_LITTLE_ENDIAN
+ * this macro defines byte order of input stream.
+ * HASH_CBLOCK
+ * size of a unit chunk HASH_BLOCK operates on.
+ * HASH_LONG
+ * has to be at lest 32 bit wide, if it's wider, then
+ * HASH_LONG_LOG2 *has to* be defined along
+ * HASH_CTX
+ * context structure that at least contains following
+ * members:
+ * typedef struct {
+ * ...
+ * HASH_LONG Nl,Nh;
+ * either {
+ * HASH_LONG data[HASH_LBLOCK];
+ * unsigned char data[HASH_CBLOCK];
+ * };
+ * unsigned int num;
+ * ...
+ * } HASH_CTX;
+ * data[] vector is expected to be zeroed upon first call to
+ * HASH_UPDATE.
+ * HASH_UPDATE
+ * name of "Update" function, implemented here.
+ * HASH_TRANSFORM
+ * name of "Transform" function, implemented here.
+ * HASH_FINAL
+ * name of "Final" function, implemented here.
+ * HASH_BLOCK_DATA_ORDER
+ * name of "block" function capable of treating *unaligned* input
+ * message in original (data) byte order, implemented externally.
+ * HASH_MAKE_STRING
+ * macro convering context variables to an ASCII hash string.
+ *
+ * MD5 example:
+ *
+ * #define DATA_ORDER_IS_LITTLE_ENDIAN
+ *
+ * #define HASH_LONG MD5_LONG
+ * #define HASH_LONG_LOG2 MD5_LONG_LOG2
+ * #define HASH_CTX MD5_CTX
+ * #define HASH_CBLOCK MD5_CBLOCK
+ * #define HASH_UPDATE MD5_Update
+ * #define HASH_TRANSFORM MD5_Transform
+ * #define HASH_FINAL MD5_Final
+ * #define HASH_BLOCK_DATA_ORDER md5_block_data_order
+ *
+ * <appro@fy.chalmers.se>
+ */
+
+#if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN)
+#error "DATA_ORDER must be defined!"
+#endif
+
+#ifndef HASH_CBLOCK
+#error "HASH_CBLOCK must be defined!"
+#endif
+#ifndef HASH_LONG
+#error "HASH_LONG must be defined!"
+#endif
+#ifndef HASH_CTX
+#error "HASH_CTX must be defined!"
+#endif
+
+#ifndef HASH_UPDATE
+#error "HASH_UPDATE must be defined!"
+#endif
+#ifndef HASH_TRANSFORM
+#error "HASH_TRANSFORM must be defined!"
+#endif
+#ifndef HASH_FINAL
+#error "HASH_FINAL must be defined!"
+#endif
+
+#ifndef HASH_BLOCK_DATA_ORDER
+#error "HASH_BLOCK_DATA_ORDER must be defined!"
+#endif
+
+/*
+ * Engage compiler specific rotate intrinsic function if available.
+ */
+#undef ROTATE
+#ifndef PEDANTIC
+# if defined(_MSC_VER) || defined(__ICC)
+# define ROTATE(a,n) _lrotl(a,n)
+# elif defined(__MWERKS__)
+# if defined(__POWERPC__)
+# define ROTATE(a,n) __rlwinm(a,n,0,31)
+# elif defined(__MC68K__)
+ /* Motorola specific tweak. <appro@fy.chalmers.se> */
+# define ROTATE(a,n) ( n<24 ? __rol(a,n) : __ror(a,32-n) )
+# else
+# define ROTATE(a,n) __rol(a,n)
+# endif
+# elif defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+ /*
+ * Some GNU C inline assembler templates. Note that these are
+ * rotates by *constant* number of bits! But that's exactly
+ * what we need here...
+ * <appro@fy.chalmers.se>
+ */
+# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
+# define ROTATE(a,n) ({ register unsigned int ret; \
+ asm ( \
+ "roll %1,%0" \
+ : "=r"(ret) \
+ : "I"(n), "0"(a) \
+ : "cc"); \
+ ret; \
+ })
+# elif defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \
+ defined(__powerpc) || defined(__ppc__) || defined(__powerpc64__)
+# define ROTATE(a,n) ({ register unsigned int ret; \
+ asm ( \
+ "rlwinm %0,%1,%2,0,31" \
+ : "=r"(ret) \
+ : "r"(a), "I"(n)); \
+ ret; \
+ })
+# elif defined(__s390x__)
+# define ROTATE(a,n) ({ register unsigned int ret; \
+ asm ("rll %0,%1,%2" \
+ : "=r"(ret) \
+ : "r"(a), "I"(n)); \
+ ret; \
+ })
+# endif
+# endif
+#endif /* PEDANTIC */
+
+#ifndef ROTATE
+#define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
+#endif
+
+#if defined(DATA_ORDER_IS_BIG_ENDIAN)
+
+#ifndef PEDANTIC
+# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+# if ((defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)) || \
+ (defined(__x86_64) || defined(__x86_64__))
+# if !defined(B_ENDIAN)
+ /*
+ * This gives ~30-40% performance improvement in SHA-256 compiled
+ * with gcc [on P4]. Well, first macro to be frank. We can pull
+ * this trick on x86* platforms only, because these CPUs can fetch
+ * unaligned data without raising an exception.
+ */
+# define HOST_c2l(c,l) ({ unsigned int r=*((const unsigned int *)(c)); \
+ asm ("bswapl %0":"=r"(r):"0"(r)); \
+ (c)+=4; (l)=r; })
+# define HOST_l2c(l,c) ({ unsigned int r=(l); \
+ asm ("bswapl %0":"=r"(r):"0"(r)); \
+ *((unsigned int *)(c))=r; (c)+=4; r; })
+# endif
+# endif
+# endif
+#endif
+#if defined(__s390__) || defined(__s390x__)
+# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, (l))
+# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l))
+#endif
+
+#ifndef HOST_c2l
+#define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24), \
+ l|=(((unsigned long)(*((c)++)))<<16), \
+ l|=(((unsigned long)(*((c)++)))<< 8), \
+ l|=(((unsigned long)(*((c)++))) ), \
+ l)
+#endif
+#ifndef HOST_l2c
+#define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>16)&0xff), \
+ *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
+ *((c)++)=(unsigned char)(((l) )&0xff), \
+ l)
+#endif
+
+#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
+
+#ifndef PEDANTIC
+# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+# if defined(__s390x__)
+# define HOST_c2l(c,l) ({ asm ("lrv %0,0(%1)" \
+ :"=r"(l) : "r"(c)); \
+ (c)+=4; (l); })
+# define HOST_l2c(l,c) ({ asm ("strv %0,0(%1)" \
+ : : "r"(l),"r"(c) : "memory"); \
+ (c)+=4; (l); })
+# endif
+# endif
+#endif
+#if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
+# ifndef B_ENDIAN
+ /* See comment in DATA_ORDER_IS_BIG_ENDIAN section. */
+# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, l)
+# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, l)
+# endif
+#endif
+
+#ifndef HOST_c2l
+#define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++))) ), \
+ l|=(((unsigned long)(*((c)++)))<< 8), \
+ l|=(((unsigned long)(*((c)++)))<<16), \
+ l|=(((unsigned long)(*((c)++)))<<24), \
+ l)
+#endif
+#ifndef HOST_l2c
+#define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
+ *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>16)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>24)&0xff), \
+ l)
+#endif
+
+#endif
+
+/*
+ * Time for some action:-)
+ */
+
+int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len)
+ {
+ const unsigned char *data=data_;
+ unsigned char *p;
+ HASH_LONG l;
+ size_t n;
+
+ if (len==0) return 1;
+
+ l=(c->Nl+(((HASH_LONG)len)<<3))&0xffffffffUL;
+ /* 95-05-24 eay Fixed a bug with the overflow handling, thanks to
+ * Wei Dai <weidai@eskimo.com> for pointing it out. */
+ if (l < c->Nl) /* overflow */
+ c->Nh++;
+ c->Nh+=(HASH_LONG)(len>>29); /* might cause compiler warning on 16-bit */
+ c->Nl=l;
+
+ n = c->num;
+ if (n != 0)
+ {
+ p=(unsigned char *)c->data;
+
+ if (len >= HASH_CBLOCK || len+n >= HASH_CBLOCK)
+ {
+ memcpy (p+n,data,HASH_CBLOCK-n);
+ HASH_BLOCK_DATA_ORDER (c,p,1);
+ n = HASH_CBLOCK-n;
+ data += n;
+ len -= n;
+ c->num = 0;
+ memset (p,0,HASH_CBLOCK); /* keep it zeroed */
+ }
+ else
+ {
+ memcpy (p+n,data,len);
+ c->num += (unsigned int)len;
+ return 1;
+ }
+ }
+
+ n = len/HASH_CBLOCK;
+ if (n > 0)
+ {
+ HASH_BLOCK_DATA_ORDER (c,data,n);
+ n *= HASH_CBLOCK;
+ data += n;
+ len -= n;
+ }
+
+ if (len != 0)
+ {
+ p = (unsigned char *)c->data;
+ c->num = (unsigned int)len;
+ memcpy (p,data,len);
+ }
+ return 1;
+ }
+
+
+void HASH_TRANSFORM (HASH_CTX *c, const unsigned char *data)
+ {
+ HASH_BLOCK_DATA_ORDER (c,data,1);
+ }
+
+
+int HASH_FINAL (unsigned char *md, HASH_CTX *c)
+ {
+ unsigned char *p = (unsigned char *)c->data;
+ size_t n = c->num;
+
+ p[n] = 0x80; /* there is always room for one */
+ n++;
+
+ if (n > (HASH_CBLOCK-8))
+ {
+ memset (p+n,0,HASH_CBLOCK-n);
+ n=0;
+ HASH_BLOCK_DATA_ORDER (c,p,1);
+ }
+ memset (p+n,0,HASH_CBLOCK-8-n);
+
+ p += HASH_CBLOCK-8;
+#if defined(DATA_ORDER_IS_BIG_ENDIAN)
+ (void)HOST_l2c(c->Nh,p);
+ (void)HOST_l2c(c->Nl,p);
+#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
+ (void)HOST_l2c(c->Nl,p);
+ (void)HOST_l2c(c->Nh,p);
+#endif
+ p -= HASH_CBLOCK;
+ HASH_BLOCK_DATA_ORDER (c,p,1);
+ c->num=0;
+ memset (p,0,HASH_CBLOCK);
+
+#ifndef HASH_MAKE_STRING
+#error "HASH_MAKE_STRING must be defined!"
+#else
+ HASH_MAKE_STRING(c,md);
+#endif
+
+ return 1;
+ }
+
+#ifndef MD32_REG_T
+#define MD32_REG_T long
+/*
+ * This comment was originaly written for MD5, which is why it
+ * discusses A-D. But it basically applies to all 32-bit digests,
+ * which is why it was moved to common header file.
+ *
+ * In case you wonder why A-D are declared as long and not
+ * as MD5_LONG. Doing so results in slight performance
+ * boost on LP64 architectures. The catch is we don't
+ * really care if 32 MSBs of a 64-bit register get polluted
+ * with eventual overflows as we *save* only 32 LSBs in
+ * *either* case. Now declaring 'em long excuses the compiler
+ * from keeping 32 MSBs zeroed resulting in 13% performance
+ * improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
+ * Well, to be honest it should say that this *prevents*
+ * performance degradation.
+ * <appro@fy.chalmers.se>
+ * Apparently there're LP64 compilers that generate better
+ * code if A-D are declared int. Most notably GCC-x86_64
+ * generates better code.
+ * <appro@fy.chalmers.se>
+ */
+#endif
diff --git a/snmplib/openssl/openssl_md5.c b/snmplib/openssl/openssl_md5.c
new file mode 100644
index 0000000..b87adb3
--- /dev/null
+++ b/snmplib/openssl/openssl_md5.c
@@ -0,0 +1,181 @@
+/* crypto/md5/md5_dgst.c */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#include <stdio.h>
+#include "openssl_md5_local.h"
+
+/* Implemented from RFC1321 The MD5 Message-Digest Algorithm
+ */
+
+#define INIT_DATA_A (unsigned long)0x67452301L
+#define INIT_DATA_B (unsigned long)0xefcdab89L
+#define INIT_DATA_C (unsigned long)0x98badcfeL
+#define INIT_DATA_D (unsigned long)0x10325476L
+
+int MD5_Init(MD5_CTX *c)
+ {
+ memset (c,0,sizeof(*c));
+ c->A=INIT_DATA_A;
+ c->B=INIT_DATA_B;
+ c->C=INIT_DATA_C;
+ c->D=INIT_DATA_D;
+ return 1;
+ }
+
+#ifndef md5_block_data_order
+#ifdef X
+#undef X
+#endif
+void md5_block_data_order (MD5_CTX *c, const void *data_, size_t num)
+ {
+ const unsigned char *data=data_;
+ register unsigned MD32_REG_T A,B,C,D,l;
+#ifndef MD32_XARRAY
+ /* See comment in crypto/sha/sha_locl.h for details. */
+ unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
+ XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
+# define X(i) XX##i
+#else
+ MD5_LONG XX[MD5_LBLOCK];
+# define X(i) XX[i]
+#endif
+
+ A=c->A;
+ B=c->B;
+ C=c->C;
+ D=c->D;
+
+ for (;num--;)
+ {
+ HOST_c2l(data,l); X( 0)=l; HOST_c2l(data,l); X( 1)=l;
+ /* Round 0 */
+ R0(A,B,C,D,X( 0), 7,0xd76aa478L); HOST_c2l(data,l); X( 2)=l;
+ R0(D,A,B,C,X( 1),12,0xe8c7b756L); HOST_c2l(data,l); X( 3)=l;
+ R0(C,D,A,B,X( 2),17,0x242070dbL); HOST_c2l(data,l); X( 4)=l;
+ R0(B,C,D,A,X( 3),22,0xc1bdceeeL); HOST_c2l(data,l); X( 5)=l;
+ R0(A,B,C,D,X( 4), 7,0xf57c0fafL); HOST_c2l(data,l); X( 6)=l;
+ R0(D,A,B,C,X( 5),12,0x4787c62aL); HOST_c2l(data,l); X( 7)=l;
+ R0(C,D,A,B,X( 6),17,0xa8304613L); HOST_c2l(data,l); X( 8)=l;
+ R0(B,C,D,A,X( 7),22,0xfd469501L); HOST_c2l(data,l); X( 9)=l;
+ R0(A,B,C,D,X( 8), 7,0x698098d8L); HOST_c2l(data,l); X(10)=l;
+ R0(D,A,B,C,X( 9),12,0x8b44f7afL); HOST_c2l(data,l); X(11)=l;
+ R0(C,D,A,B,X(10),17,0xffff5bb1L); HOST_c2l(data,l); X(12)=l;
+ R0(B,C,D,A,X(11),22,0x895cd7beL); HOST_c2l(data,l); X(13)=l;
+ R0(A,B,C,D,X(12), 7,0x6b901122L); HOST_c2l(data,l); X(14)=l;
+ R0(D,A,B,C,X(13),12,0xfd987193L); HOST_c2l(data,l); X(15)=l;
+ R0(C,D,A,B,X(14),17,0xa679438eL);
+ R0(B,C,D,A,X(15),22,0x49b40821L);
+ /* Round 1 */
+ R1(A,B,C,D,X( 1), 5,0xf61e2562L);
+ R1(D,A,B,C,X( 6), 9,0xc040b340L);
+ R1(C,D,A,B,X(11),14,0x265e5a51L);
+ R1(B,C,D,A,X( 0),20,0xe9b6c7aaL);
+ R1(A,B,C,D,X( 5), 5,0xd62f105dL);
+ R1(D,A,B,C,X(10), 9,0x02441453L);
+ R1(C,D,A,B,X(15),14,0xd8a1e681L);
+ R1(B,C,D,A,X( 4),20,0xe7d3fbc8L);
+ R1(A,B,C,D,X( 9), 5,0x21e1cde6L);
+ R1(D,A,B,C,X(14), 9,0xc33707d6L);
+ R1(C,D,A,B,X( 3),14,0xf4d50d87L);
+ R1(B,C,D,A,X( 8),20,0x455a14edL);
+ R1(A,B,C,D,X(13), 5,0xa9e3e905L);
+ R1(D,A,B,C,X( 2), 9,0xfcefa3f8L);
+ R1(C,D,A,B,X( 7),14,0x676f02d9L);
+ R1(B,C,D,A,X(12),20,0x8d2a4c8aL);
+ /* Round 2 */
+ R2(A,B,C,D,X( 5), 4,0xfffa3942L);
+ R2(D,A,B,C,X( 8),11,0x8771f681L);
+ R2(C,D,A,B,X(11),16,0x6d9d6122L);
+ R2(B,C,D,A,X(14),23,0xfde5380cL);
+ R2(A,B,C,D,X( 1), 4,0xa4beea44L);
+ R2(D,A,B,C,X( 4),11,0x4bdecfa9L);
+ R2(C,D,A,B,X( 7),16,0xf6bb4b60L);
+ R2(B,C,D,A,X(10),23,0xbebfbc70L);
+ R2(A,B,C,D,X(13), 4,0x289b7ec6L);
+ R2(D,A,B,C,X( 0),11,0xeaa127faL);
+ R2(C,D,A,B,X( 3),16,0xd4ef3085L);
+ R2(B,C,D,A,X( 6),23,0x04881d05L);
+ R2(A,B,C,D,X( 9), 4,0xd9d4d039L);
+ R2(D,A,B,C,X(12),11,0xe6db99e5L);
+ R2(C,D,A,B,X(15),16,0x1fa27cf8L);
+ R2(B,C,D,A,X( 2),23,0xc4ac5665L);
+ /* Round 3 */
+ R3(A,B,C,D,X( 0), 6,0xf4292244L);
+ R3(D,A,B,C,X( 7),10,0x432aff97L);
+ R3(C,D,A,B,X(14),15,0xab9423a7L);
+ R3(B,C,D,A,X( 5),21,0xfc93a039L);
+ R3(A,B,C,D,X(12), 6,0x655b59c3L);
+ R3(D,A,B,C,X( 3),10,0x8f0ccc92L);
+ R3(C,D,A,B,X(10),15,0xffeff47dL);
+ R3(B,C,D,A,X( 1),21,0x85845dd1L);
+ R3(A,B,C,D,X( 8), 6,0x6fa87e4fL);
+ R3(D,A,B,C,X(15),10,0xfe2ce6e0L);
+ R3(C,D,A,B,X( 6),15,0xa3014314L);
+ R3(B,C,D,A,X(13),21,0x4e0811a1L);
+ R3(A,B,C,D,X( 4), 6,0xf7537e82L);
+ R3(D,A,B,C,X(11),10,0xbd3af235L);
+ R3(C,D,A,B,X( 2),15,0x2ad7d2bbL);
+ R3(B,C,D,A,X( 9),21,0xeb86d391L);
+
+ A = c->A += A;
+ B = c->B += B;
+ C = c->C += C;
+ D = c->D += D;
+ }
+ }
+#endif
diff --git a/snmplib/openssl/openssl_md5_local.h b/snmplib/openssl/openssl_md5_local.h
new file mode 100644
index 0000000..47ef374
--- /dev/null
+++ b/snmplib/openssl/openssl_md5_local.h
@@ -0,0 +1,129 @@
+/* crypto/md5/md5_locl.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <net-snmp/openssl_md5.h>
+
+#ifndef MD5_LONG_LOG2
+#define MD5_LONG_LOG2 2 /* default to 32 bits */
+#endif
+
+#ifdef MD5_ASM
+# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) || \
+ defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)
+# define md5_block_data_order md5_block_asm_data_order
+# elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+# define md5_block_data_order md5_block_asm_data_order
+# endif
+#endif
+
+void md5_block_data_order (MD5_CTX *c, const void *p,size_t num);
+
+#define DATA_ORDER_IS_LITTLE_ENDIAN
+
+#define HASH_LONG MD5_LONG
+#define HASH_CTX MD5_CTX
+#define HASH_CBLOCK MD5_CBLOCK
+#define HASH_UPDATE MD5_Update
+#define HASH_TRANSFORM MD5_Transform
+#define HASH_FINAL MD5_Final
+#define HASH_MAKE_STRING(c,s) do { \
+ unsigned long ll; \
+ ll=(c)->A; HOST_l2c(ll,(s)); \
+ ll=(c)->B; HOST_l2c(ll,(s)); \
+ ll=(c)->C; HOST_l2c(ll,(s)); \
+ ll=(c)->D; HOST_l2c(ll,(s)); \
+ } while (0)
+#define HASH_BLOCK_DATA_ORDER md5_block_data_order
+
+#include "openssl_md32_common.h"
+
+/*
+#define F(x,y,z) (((x) & (y)) | ((~(x)) & (z)))
+#define G(x,y,z) (((x) & (z)) | ((y) & (~(z))))
+*/
+
+/* As pointed out by Wei Dai <weidai@eskimo.com>, the above can be
+ * simplified to the code below. Wei attributes these optimizations
+ * to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel.
+ */
+#define F(b,c,d) ((((c) ^ (d)) & (b)) ^ (d))
+#define G(b,c,d) ((((b) ^ (c)) & (d)) ^ (c))
+#define H(b,c,d) ((b) ^ (c) ^ (d))
+#define I(b,c,d) (((~(d)) | (b)) ^ (c))
+
+#define R0(a,b,c,d,k,s,t) { \
+ a+=((k)+(t)+F((b),(c),(d))); \
+ a=ROTATE(a,s); \
+ a+=b; };\
+
+#define R1(a,b,c,d,k,s,t) { \
+ a+=((k)+(t)+G((b),(c),(d))); \
+ a=ROTATE(a,s); \
+ a+=b; };
+
+#define R2(a,b,c,d,k,s,t) { \
+ a+=((k)+(t)+H((b),(c),(d))); \
+ a=ROTATE(a,s); \
+ a+=b; };
+
+#define R3(a,b,c,d,k,s,t) { \
+ a+=((k)+(t)+I((b),(c),(d))); \
+ a=ROTATE(a,s); \
+ a+=b; };
diff --git a/snmplib/openssl/openssl_modes.h b/snmplib/openssl/openssl_modes.h
new file mode 100644
index 0000000..af8d97d
--- /dev/null
+++ b/snmplib/openssl/openssl_modes.h
@@ -0,0 +1,59 @@
+/* ====================================================================
+ * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
+ *
+ * Rights for redistribution and usage in source and binary
+ * forms are granted according to the OpenSSL license.
+ */
+
+#include <stddef.h>
+
+typedef void (*block128_f)(const unsigned char in[16],
+ unsigned char out[16],
+ const void *key);
+
+typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int enc);
+
+void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+
+void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], unsigned char ecount_buf[16],
+ unsigned int *num, block128_f block);
+
+void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int *num,
+ block128_f block);
+
+void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block);
+void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block);
+void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t bits, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block);
+
+size_t CRYPTO_cts128_encrypt_block(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
diff --git a/snmplib/openssl/openssl_ncbc_enc.c b/snmplib/openssl/openssl_ncbc_enc.c
new file mode 100644
index 0000000..c38cb66
--- /dev/null
+++ b/snmplib/openssl/openssl_ncbc_enc.c
@@ -0,0 +1,148 @@
+/* crypto/des/ncbc_enc.c */
+/*
+ * #included by:
+ * cbc_enc.c (DES_cbc_encrypt)
+ * des_enc.c (DES_ncbc_encrypt)
+ */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#include "openssl_des_local.h"
+
+#ifdef CBC_ENC_C__DONT_UPDATE_IV
+void DES_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+ DES_key_schedule *_schedule, DES_cblock *ivec, int enc)
+#else
+void DES_ncbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+ DES_key_schedule *_schedule, DES_cblock *ivec, int enc)
+#endif
+ {
+ register DES_LONG tin0,tin1;
+ register DES_LONG tout0,tout1,xor0,xor1;
+ register long l=length;
+ DES_LONG tin[2];
+ unsigned char *iv;
+
+ iv = &(*ivec)[0];
+
+ if (enc)
+ {
+ c2l(iv,tout0);
+ c2l(iv,tout1);
+ for (l-=8; l>=0; l-=8)
+ {
+ c2l(in,tin0);
+ c2l(in,tin1);
+ tin0^=tout0; tin[0]=tin0;
+ tin1^=tout1; tin[1]=tin1;
+ DES_encrypt1((DES_LONG *)tin,_schedule,DES_ENCRYPT);
+ tout0=tin[0]; l2c(tout0,out);
+ tout1=tin[1]; l2c(tout1,out);
+ }
+ if (l != -8)
+ {
+ c2ln(in,tin0,tin1,l+8);
+ tin0^=tout0; tin[0]=tin0;
+ tin1^=tout1; tin[1]=tin1;
+ DES_encrypt1((DES_LONG *)tin,_schedule,DES_ENCRYPT);
+ tout0=tin[0]; l2c(tout0,out);
+ tout1=tin[1]; l2c(tout1,out);
+ }
+#ifndef CBC_ENC_C__DONT_UPDATE_IV
+ iv = &(*ivec)[0];
+ l2c(tout0,iv);
+ l2c(tout1,iv);
+#endif
+ }
+ else
+ {
+ c2l(iv,xor0);
+ c2l(iv,xor1);
+ for (l-=8; l>=0; l-=8)
+ {
+ c2l(in,tin0); tin[0]=tin0;
+ c2l(in,tin1); tin[1]=tin1;
+ DES_encrypt1((DES_LONG *)tin,_schedule,DES_DECRYPT);
+ tout0=tin[0]^xor0;
+ tout1=tin[1]^xor1;
+ l2c(tout0,out);
+ l2c(tout1,out);
+ xor0=tin0;
+ xor1=tin1;
+ }
+ if (l != -8)
+ {
+ c2l(in,tin0); tin[0]=tin0;
+ c2l(in,tin1); tin[1]=tin1;
+ DES_encrypt1((DES_LONG *)tin,_schedule,DES_DECRYPT);
+ tout0=tin[0]^xor0;
+ tout1=tin[1]^xor1;
+ l2cn(tout0,tout1,out,l+8);
+#ifndef CBC_ENC_C__DONT_UPDATE_IV
+ xor0=tin0;
+ xor1=tin1;
+#endif
+ }
+#ifndef CBC_ENC_C__DONT_UPDATE_IV
+ iv = &(*ivec)[0];
+ l2c(xor0,iv);
+ l2c(xor1,iv);
+#endif
+ }
+ tin0=tin1=tout0=tout1=xor0=xor1=0;
+ tin[0]=tin[1]=0;
+ }
diff --git a/snmplib/openssl/openssl_set_key.c b/snmplib/openssl/openssl_set_key.c
new file mode 100644
index 0000000..2b26b9c
--- /dev/null
+++ b/snmplib/openssl/openssl_set_key.c
@@ -0,0 +1,406 @@
+/* crypto/des/set_key.c */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+/* set_key.c v 1.4 eay 24/9/91
+ * 1.4 Speed up by 400% :-)
+ * 1.3 added register declarations.
+ * 1.2 unrolled make_key_sched a bit more
+ * 1.1 added norm_expand_bits
+ * 1.0 First working version
+ */
+int DES_check_key = 0;
+#include "openssl_des_local.h"
+
+static const unsigned char odd_parity[256]={
+ 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14,
+ 16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, 31, 31,
+ 32, 32, 35, 35, 37, 37, 38, 38, 41, 41, 42, 42, 44, 44, 47, 47,
+ 49, 49, 50, 50, 52, 52, 55, 55, 56, 56, 59, 59, 61, 61, 62, 62,
+ 64, 64, 67, 67, 69, 69, 70, 70, 73, 73, 74, 74, 76, 76, 79, 79,
+ 81, 81, 82, 82, 84, 84, 87, 87, 88, 88, 91, 91, 93, 93, 94, 94,
+ 97, 97, 98, 98,100,100,103,103,104,104,107,107,109,109,110,110,
+112,112,115,115,117,117,118,118,121,121,122,122,124,124,127,127,
+128,128,131,131,133,133,134,134,137,137,138,138,140,140,143,143,
+145,145,146,146,148,148,151,151,152,152,155,155,157,157,158,158,
+161,161,162,162,164,164,167,167,168,168,171,171,173,173,174,174,
+176,176,179,179,181,181,182,182,185,185,186,186,188,188,191,191,
+193,193,194,194,196,196,199,199,200,200,203,203,205,205,206,206,
+208,208,211,211,213,213,214,214,217,217,218,218,220,220,223,223,
+224,224,227,227,229,229,230,230,233,233,234,234,236,236,239,239,
+241,241,242,242,244,244,247,247,248,248,251,251,253,253,254,254};
+
+void DES_set_odd_parity(DES_cblock *key)
+ {
+ unsigned int i;
+
+ for (i=0; i<DES_KEY_SZ; i++)
+ (*key)[i]=odd_parity[(*key)[i]];
+ }
+
+int DES_check_key_parity(const_DES_cblock *key)
+ {
+ unsigned int i;
+
+ for (i=0; i<DES_KEY_SZ; i++)
+ {
+ if ((*key)[i] != odd_parity[(*key)[i]])
+ return(0);
+ }
+ return(1);
+ }
+
+/* Weak and semi week keys as take from
+ * %A D.W. Davies
+ * %A W.L. Price
+ * %T Security for Computer Networks
+ * %I John Wiley & Sons
+ * %D 1984
+ * Many thanks to smb@ulysses.att.com (Steven Bellovin) for the reference
+ * (and actual cblock values).
+ */
+#define NUM_WEAK_KEY 16
+static const DES_cblock weak_keys[NUM_WEAK_KEY]={
+ /* weak keys */
+ {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},
+ {0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE},
+ {0x1F,0x1F,0x1F,0x1F,0x0E,0x0E,0x0E,0x0E},
+ {0xE0,0xE0,0xE0,0xE0,0xF1,0xF1,0xF1,0xF1},
+ /* semi-weak keys */
+ {0x01,0xFE,0x01,0xFE,0x01,0xFE,0x01,0xFE},
+ {0xFE,0x01,0xFE,0x01,0xFE,0x01,0xFE,0x01},
+ {0x1F,0xE0,0x1F,0xE0,0x0E,0xF1,0x0E,0xF1},
+ {0xE0,0x1F,0xE0,0x1F,0xF1,0x0E,0xF1,0x0E},
+ {0x01,0xE0,0x01,0xE0,0x01,0xF1,0x01,0xF1},
+ {0xE0,0x01,0xE0,0x01,0xF1,0x01,0xF1,0x01},
+ {0x1F,0xFE,0x1F,0xFE,0x0E,0xFE,0x0E,0xFE},
+ {0xFE,0x1F,0xFE,0x1F,0xFE,0x0E,0xFE,0x0E},
+ {0x01,0x1F,0x01,0x1F,0x01,0x0E,0x01,0x0E},
+ {0x1F,0x01,0x1F,0x01,0x0E,0x01,0x0E,0x01},
+ {0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1,0xFE},
+ {0xFE,0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1}};
+
+int DES_is_weak_key(const_DES_cblock *key)
+ {
+ int i;
+
+ for (i=0; i<NUM_WEAK_KEY; i++)
+ /* Added == 0 to comparison, I obviously don't run
+ * this section very often :-(, thanks to
+ * engineering@MorningStar.Com for the fix
+ * eay 93/06/29
+ * Another problem, I was comparing only the first 4
+ * bytes, 97/03/18 */
+ if (memcmp(weak_keys[i],key,sizeof(DES_cblock)) == 0) return(1);
+ return(0);
+ }
+
+/* NOW DEFINED IN des_local.h
+ * See ecb_encrypt.c for a pseudo description of these macros.
+ * #define PERM_OP(a,b,t,n,m) ((t)=((((a)>>(n))^(b))&(m)),\
+ * (b)^=(t),\
+ * (a)=((a)^((t)<<(n))))
+ */
+
+#define HPERM_OP(a,t,n,m) ((t)=((((a)<<(16-(n)))^(a))&(m)),\
+ (a)=(a)^(t)^(t>>(16-(n))))
+
+static const DES_LONG des_skb[8][64]={
+ {
+ /* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
+ 0x00000000L,0x00000010L,0x20000000L,0x20000010L,
+ 0x00010000L,0x00010010L,0x20010000L,0x20010010L,
+ 0x00000800L,0x00000810L,0x20000800L,0x20000810L,
+ 0x00010800L,0x00010810L,0x20010800L,0x20010810L,
+ 0x00000020L,0x00000030L,0x20000020L,0x20000030L,
+ 0x00010020L,0x00010030L,0x20010020L,0x20010030L,
+ 0x00000820L,0x00000830L,0x20000820L,0x20000830L,
+ 0x00010820L,0x00010830L,0x20010820L,0x20010830L,
+ 0x00080000L,0x00080010L,0x20080000L,0x20080010L,
+ 0x00090000L,0x00090010L,0x20090000L,0x20090010L,
+ 0x00080800L,0x00080810L,0x20080800L,0x20080810L,
+ 0x00090800L,0x00090810L,0x20090800L,0x20090810L,
+ 0x00080020L,0x00080030L,0x20080020L,0x20080030L,
+ 0x00090020L,0x00090030L,0x20090020L,0x20090030L,
+ 0x00080820L,0x00080830L,0x20080820L,0x20080830L,
+ 0x00090820L,0x00090830L,0x20090820L,0x20090830L,
+ },{
+ /* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */
+ 0x00000000L,0x02000000L,0x00002000L,0x02002000L,
+ 0x00200000L,0x02200000L,0x00202000L,0x02202000L,
+ 0x00000004L,0x02000004L,0x00002004L,0x02002004L,
+ 0x00200004L,0x02200004L,0x00202004L,0x02202004L,
+ 0x00000400L,0x02000400L,0x00002400L,0x02002400L,
+ 0x00200400L,0x02200400L,0x00202400L,0x02202400L,
+ 0x00000404L,0x02000404L,0x00002404L,0x02002404L,
+ 0x00200404L,0x02200404L,0x00202404L,0x02202404L,
+ 0x10000000L,0x12000000L,0x10002000L,0x12002000L,
+ 0x10200000L,0x12200000L,0x10202000L,0x12202000L,
+ 0x10000004L,0x12000004L,0x10002004L,0x12002004L,
+ 0x10200004L,0x12200004L,0x10202004L,0x12202004L,
+ 0x10000400L,0x12000400L,0x10002400L,0x12002400L,
+ 0x10200400L,0x12200400L,0x10202400L,0x12202400L,
+ 0x10000404L,0x12000404L,0x10002404L,0x12002404L,
+ 0x10200404L,0x12200404L,0x10202404L,0x12202404L,
+ },{
+ /* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */
+ 0x00000000L,0x00000001L,0x00040000L,0x00040001L,
+ 0x01000000L,0x01000001L,0x01040000L,0x01040001L,
+ 0x00000002L,0x00000003L,0x00040002L,0x00040003L,
+ 0x01000002L,0x01000003L,0x01040002L,0x01040003L,
+ 0x00000200L,0x00000201L,0x00040200L,0x00040201L,
+ 0x01000200L,0x01000201L,0x01040200L,0x01040201L,
+ 0x00000202L,0x00000203L,0x00040202L,0x00040203L,
+ 0x01000202L,0x01000203L,0x01040202L,0x01040203L,
+ 0x08000000L,0x08000001L,0x08040000L,0x08040001L,
+ 0x09000000L,0x09000001L,0x09040000L,0x09040001L,
+ 0x08000002L,0x08000003L,0x08040002L,0x08040003L,
+ 0x09000002L,0x09000003L,0x09040002L,0x09040003L,
+ 0x08000200L,0x08000201L,0x08040200L,0x08040201L,
+ 0x09000200L,0x09000201L,0x09040200L,0x09040201L,
+ 0x08000202L,0x08000203L,0x08040202L,0x08040203L,
+ 0x09000202L,0x09000203L,0x09040202L,0x09040203L,
+ },{
+ /* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */
+ 0x00000000L,0x00100000L,0x00000100L,0x00100100L,
+ 0x00000008L,0x00100008L,0x00000108L,0x00100108L,
+ 0x00001000L,0x00101000L,0x00001100L,0x00101100L,
+ 0x00001008L,0x00101008L,0x00001108L,0x00101108L,
+ 0x04000000L,0x04100000L,0x04000100L,0x04100100L,
+ 0x04000008L,0x04100008L,0x04000108L,0x04100108L,
+ 0x04001000L,0x04101000L,0x04001100L,0x04101100L,
+ 0x04001008L,0x04101008L,0x04001108L,0x04101108L,
+ 0x00020000L,0x00120000L,0x00020100L,0x00120100L,
+ 0x00020008L,0x00120008L,0x00020108L,0x00120108L,
+ 0x00021000L,0x00121000L,0x00021100L,0x00121100L,
+ 0x00021008L,0x00121008L,0x00021108L,0x00121108L,
+ 0x04020000L,0x04120000L,0x04020100L,0x04120100L,
+ 0x04020008L,0x04120008L,0x04020108L,0x04120108L,
+ 0x04021000L,0x04121000L,0x04021100L,0x04121100L,
+ 0x04021008L,0x04121008L,0x04021108L,0x04121108L,
+ },{
+ /* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
+ 0x00000000L,0x10000000L,0x00010000L,0x10010000L,
+ 0x00000004L,0x10000004L,0x00010004L,0x10010004L,
+ 0x20000000L,0x30000000L,0x20010000L,0x30010000L,
+ 0x20000004L,0x30000004L,0x20010004L,0x30010004L,
+ 0x00100000L,0x10100000L,0x00110000L,0x10110000L,
+ 0x00100004L,0x10100004L,0x00110004L,0x10110004L,
+ 0x20100000L,0x30100000L,0x20110000L,0x30110000L,
+ 0x20100004L,0x30100004L,0x20110004L,0x30110004L,
+ 0x00001000L,0x10001000L,0x00011000L,0x10011000L,
+ 0x00001004L,0x10001004L,0x00011004L,0x10011004L,
+ 0x20001000L,0x30001000L,0x20011000L,0x30011000L,
+ 0x20001004L,0x30001004L,0x20011004L,0x30011004L,
+ 0x00101000L,0x10101000L,0x00111000L,0x10111000L,
+ 0x00101004L,0x10101004L,0x00111004L,0x10111004L,
+ 0x20101000L,0x30101000L,0x20111000L,0x30111000L,
+ 0x20101004L,0x30101004L,0x20111004L,0x30111004L,
+ },{
+ /* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */
+ 0x00000000L,0x08000000L,0x00000008L,0x08000008L,
+ 0x00000400L,0x08000400L,0x00000408L,0x08000408L,
+ 0x00020000L,0x08020000L,0x00020008L,0x08020008L,
+ 0x00020400L,0x08020400L,0x00020408L,0x08020408L,
+ 0x00000001L,0x08000001L,0x00000009L,0x08000009L,
+ 0x00000401L,0x08000401L,0x00000409L,0x08000409L,
+ 0x00020001L,0x08020001L,0x00020009L,0x08020009L,
+ 0x00020401L,0x08020401L,0x00020409L,0x08020409L,
+ 0x02000000L,0x0A000000L,0x02000008L,0x0A000008L,
+ 0x02000400L,0x0A000400L,0x02000408L,0x0A000408L,
+ 0x02020000L,0x0A020000L,0x02020008L,0x0A020008L,
+ 0x02020400L,0x0A020400L,0x02020408L,0x0A020408L,
+ 0x02000001L,0x0A000001L,0x02000009L,0x0A000009L,
+ 0x02000401L,0x0A000401L,0x02000409L,0x0A000409L,
+ 0x02020001L,0x0A020001L,0x02020009L,0x0A020009L,
+ 0x02020401L,0x0A020401L,0x02020409L,0x0A020409L,
+ },{
+ /* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */
+ 0x00000000L,0x00000100L,0x00080000L,0x00080100L,
+ 0x01000000L,0x01000100L,0x01080000L,0x01080100L,
+ 0x00000010L,0x00000110L,0x00080010L,0x00080110L,
+ 0x01000010L,0x01000110L,0x01080010L,0x01080110L,
+ 0x00200000L,0x00200100L,0x00280000L,0x00280100L,
+ 0x01200000L,0x01200100L,0x01280000L,0x01280100L,
+ 0x00200010L,0x00200110L,0x00280010L,0x00280110L,
+ 0x01200010L,0x01200110L,0x01280010L,0x01280110L,
+ 0x00000200L,0x00000300L,0x00080200L,0x00080300L,
+ 0x01000200L,0x01000300L,0x01080200L,0x01080300L,
+ 0x00000210L,0x00000310L,0x00080210L,0x00080310L,
+ 0x01000210L,0x01000310L,0x01080210L,0x01080310L,
+ 0x00200200L,0x00200300L,0x00280200L,0x00280300L,
+ 0x01200200L,0x01200300L,0x01280200L,0x01280300L,
+ 0x00200210L,0x00200310L,0x00280210L,0x00280310L,
+ 0x01200210L,0x01200310L,0x01280210L,0x01280310L,
+ },{
+ /* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */
+ 0x00000000L,0x04000000L,0x00040000L,0x04040000L,
+ 0x00000002L,0x04000002L,0x00040002L,0x04040002L,
+ 0x00002000L,0x04002000L,0x00042000L,0x04042000L,
+ 0x00002002L,0x04002002L,0x00042002L,0x04042002L,
+ 0x00000020L,0x04000020L,0x00040020L,0x04040020L,
+ 0x00000022L,0x04000022L,0x00040022L,0x04040022L,
+ 0x00002020L,0x04002020L,0x00042020L,0x04042020L,
+ 0x00002022L,0x04002022L,0x00042022L,0x04042022L,
+ 0x00000800L,0x04000800L,0x00040800L,0x04040800L,
+ 0x00000802L,0x04000802L,0x00040802L,0x04040802L,
+ 0x00002800L,0x04002800L,0x00042800L,0x04042800L,
+ 0x00002802L,0x04002802L,0x00042802L,0x04042802L,
+ 0x00000820L,0x04000820L,0x00040820L,0x04040820L,
+ 0x00000822L,0x04000822L,0x00040822L,0x04040822L,
+ 0x00002820L,0x04002820L,0x00042820L,0x04042820L,
+ 0x00002822L,0x04002822L,0x00042822L,0x04042822L,
+ }};
+
+int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule)
+ {
+ if (DES_check_key)
+ {
+ return DES_set_key_checked(key, schedule);
+ }
+ else
+ {
+ DES_set_key_unchecked(key, schedule);
+ return 0;
+ }
+ }
+
+/* return 0 if key parity is odd (correct),
+ * return -1 if key parity error,
+ * return -2 if illegal weak key.
+ */
+int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule)
+ {
+ if (!DES_check_key_parity(key))
+ return(-1);
+ if (DES_is_weak_key(key))
+ return(-2);
+ DES_set_key_unchecked(key, schedule);
+ return 0;
+ }
+
+void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule)
+ {
+ static const int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0};
+ register DES_LONG c,d,t,s,t2;
+ register const unsigned char *in;
+ register DES_LONG *k;
+ register int i;
+
+#ifdef OPENBSD_DEV_CRYPTO
+ memcpy(schedule->key,key,sizeof schedule->key);
+ schedule->session=NULL;
+#endif
+ k = &schedule->ks->deslong[0];
+ in = &(*key)[0];
+
+ c2l(in,c);
+ c2l(in,d);
+
+ /* do PC1 in 47 simple operations :-)
+ * Thanks to John Fletcher (john_fletcher@lccmail.ocf.llnl.gov)
+ * for the inspiration. :-) */
+ PERM_OP (d,c,t,4,0x0f0f0f0fL);
+ HPERM_OP(c,t,-2,0xcccc0000L);
+ HPERM_OP(d,t,-2,0xcccc0000L);
+ PERM_OP (d,c,t,1,0x55555555L);
+ PERM_OP (c,d,t,8,0x00ff00ffL);
+ PERM_OP (d,c,t,1,0x55555555L);
+ d= (((d&0x000000ffL)<<16L)| (d&0x0000ff00L) |
+ ((d&0x00ff0000L)>>16L)|((c&0xf0000000L)>>4L));
+ c&=0x0fffffffL;
+
+ for (i=0; i<ITERATIONS; i++)
+ {
+ if (shifts2[i])
+ { c=((c>>2L)|(c<<26L)); d=((d>>2L)|(d<<26L)); }
+ else
+ { c=((c>>1L)|(c<<27L)); d=((d>>1L)|(d<<27L)); }
+ c&=0x0fffffffL;
+ d&=0x0fffffffL;
+ /* could be a few less shifts but I am to lazy at this
+ * point in time to investigate */
+ s= des_skb[0][ (c )&0x3f ]|
+ des_skb[1][((c>> 6L)&0x03)|((c>> 7L)&0x3c)]|
+ des_skb[2][((c>>13L)&0x0f)|((c>>14L)&0x30)]|
+ des_skb[3][((c>>20L)&0x01)|((c>>21L)&0x06) |
+ ((c>>22L)&0x38)];
+ t= des_skb[4][ (d )&0x3f ]|
+ des_skb[5][((d>> 7L)&0x03)|((d>> 8L)&0x3c)]|
+ des_skb[6][ (d>>15L)&0x3f ]|
+ des_skb[7][((d>>21L)&0x0f)|((d>>22L)&0x30)];
+
+ /* table contained 0213 4657 */
+ t2=((t<<16L)|(s&0x0000ffffL))&0xffffffffL;
+ *(k++)=ROTATE(t2,30)&0xffffffffL;
+
+ t2=((s>>16L)|(t&0xffff0000L));
+ *(k++)=ROTATE(t2,26)&0xffffffffL;
+ }
+ }
+
+int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule)
+ {
+ return(DES_set_key(key,schedule));
+ }
+/*
+#undef des_fixup_key_parity
+void des_fixup_key_parity(des_cblock *key)
+ {
+ des_set_odd_parity(key);
+ }
+*/
diff --git a/snmplib/openssl/openssl_sha.h b/snmplib/openssl/openssl_sha.h
new file mode 100644
index 0000000..ec2ff09
--- /dev/null
+++ b/snmplib/openssl/openssl_sha.h
@@ -0,0 +1,199 @@
+/* crypto/sha/sha.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_SHA_H
+#define HEADER_SHA_H
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1))
+#error SHA is disabled.
+#endif
+
+#if defined(OPENSSL_FIPS)
+#define FIPS_SHA_SIZE_T size_t
+#endif
+
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! SHA_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+#if defined(__LP32__)
+#define SHA_LONG unsigned long
+#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+#define SHA_LONG unsigned long
+#define SHA_LONG_LOG2 3
+#else
+#define SHA_LONG unsigned int
+#endif
+
+#define SHA_LBLOCK 16
+#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a
+ * contiguous array of 32 bit
+ * wide big-endian values. */
+#define SHA_LAST_BLOCK (SHA_CBLOCK-8)
+#define SHA_DIGEST_LENGTH 20
+
+typedef struct SHAstate_st
+ {
+ SHA_LONG h0,h1,h2,h3,h4;
+ SHA_LONG Nl,Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num;
+ } SHA_CTX;
+
+#ifndef OPENSSL_NO_SHA0
+int SHA_Init(SHA_CTX *c);
+int SHA_Update(SHA_CTX *c, const void *data, size_t len);
+int SHA_Final(unsigned char *md, SHA_CTX *c);
+unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md);
+void SHA_Transform(SHA_CTX *c, const unsigned char *data);
+#endif
+#ifndef OPENSSL_NO_SHA1
+int SHA1_Init(SHA_CTX *c);
+int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
+int SHA1_Final(unsigned char *md, SHA_CTX *c);
+unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
+void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
+#endif
+
+#define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a
+ * contiguous array of 32 bit
+ * wide big-endian values. */
+#define SHA224_DIGEST_LENGTH 28
+#define SHA256_DIGEST_LENGTH 32
+
+typedef struct SHA256state_st
+ {
+ SHA_LONG h[8];
+ SHA_LONG Nl,Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num,md_len;
+ } SHA256_CTX;
+
+#ifndef OPENSSL_NO_SHA256
+int SHA224_Init(SHA256_CTX *c);
+int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
+int SHA224_Final(unsigned char *md, SHA256_CTX *c);
+unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md);
+int SHA256_Init(SHA256_CTX *c);
+int SHA256_Update(SHA256_CTX *c, const void *data, size_t len);
+int SHA256_Final(unsigned char *md, SHA256_CTX *c);
+unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md);
+void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
+#endif
+
+#define SHA384_DIGEST_LENGTH 48
+#define SHA512_DIGEST_LENGTH 64
+
+#ifndef OPENSSL_NO_SHA512
+/*
+ * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
+ * being exactly 64-bit wide. See Implementation Notes in sha512.c
+ * for further details.
+ */
+#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a
+ * contiguous array of 64 bit
+ * wide big-endian values. */
+#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
+#define SHA_LONG64 unsigned __int64
+#define U64(C) C##UI64
+#elif defined(__arch64__)
+#define SHA_LONG64 unsigned long
+#define U64(C) C##UL
+#else
+#define SHA_LONG64 unsigned long long
+#define U64(C) C##ULL
+#endif
+
+typedef struct SHA512state_st
+ {
+ SHA_LONG64 h[8];
+ SHA_LONG64 Nl,Nh;
+ union {
+ SHA_LONG64 d[SHA_LBLOCK];
+ unsigned char p[SHA512_CBLOCK];
+ } u;
+ unsigned int num,md_len;
+ } SHA512_CTX;
+#endif
+
+#ifndef OPENSSL_NO_SHA512
+int SHA384_Init(SHA512_CTX *c);
+int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
+int SHA384_Final(unsigned char *md, SHA512_CTX *c);
+unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md);
+int SHA512_Init(SHA512_CTX *c);
+int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
+int SHA512_Final(unsigned char *md, SHA512_CTX *c);
+unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md);
+void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/snmplib/openssl/openssl_sha1.c b/snmplib/openssl/openssl_sha1.c
new file mode 100644
index 0000000..0d048db
--- /dev/null
+++ b/snmplib/openssl/openssl_sha1.c
@@ -0,0 +1,65 @@
+/* crypto/sha/sha1dgst.c */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#undef SHA_0
+#define SHA_1
+
+/* The implementation is in ../md32_common.h */
+
+#include "openssl/openssl_sha_local.h"
+
diff --git a/snmplib/openssl/openssl_sha_local.h b/snmplib/openssl/openssl_sha_local.h
new file mode 100644
index 0000000..f7bc0dc
--- /dev/null
+++ b/snmplib/openssl/openssl_sha_local.h
@@ -0,0 +1,436 @@
+/* crypto/sha/sha_locl.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "openssl/openssl_sha.h"
+
+#define DATA_ORDER_IS_BIG_ENDIAN
+
+#define HASH_LONG SHA_LONG
+#define HASH_CTX SHA_CTX
+#define HASH_CBLOCK SHA_CBLOCK
+#define HASH_MAKE_STRING(c,s) do { \
+ unsigned long ll; \
+ ll=(c)->h0; HOST_l2c(ll,(s)); \
+ ll=(c)->h1; HOST_l2c(ll,(s)); \
+ ll=(c)->h2; HOST_l2c(ll,(s)); \
+ ll=(c)->h3; HOST_l2c(ll,(s)); \
+ ll=(c)->h4; HOST_l2c(ll,(s)); \
+ } while (0)
+
+#if defined(SHA_0)
+
+# define HASH_UPDATE SHA_Update
+# define HASH_TRANSFORM SHA_Transform
+# define HASH_FINAL SHA_Final
+# define HASH_INIT SHA_Init
+# define HASH_BLOCK_DATA_ORDER sha_block_data_order
+# define Xupdate(a,ix,ia,ib,ic,id) (ix=(a)=(ia^ib^ic^id))
+
+static void sha_block_data_order (SHA_CTX *c, const void *p,size_t num);
+
+#elif defined(SHA_1)
+
+# define HASH_UPDATE SHA1_Update
+# define HASH_TRANSFORM SHA1_Transform
+# define HASH_FINAL SHA1_Final
+# define HASH_INIT SHA1_Init
+# define HASH_BLOCK_DATA_ORDER sha1_block_data_order
+# if defined(__MWERKS__) && defined(__MC68K__)
+ /* Metrowerks for Motorola fails otherwise:-( <appro@fy.chalmers.se> */
+# define Xupdate(a,ix,ia,ib,ic,id) do { (a)=(ia^ib^ic^id); \
+ ix=(a)=ROTATE((a),1); \
+ } while (0)
+# else
+# define Xupdate(a,ix,ia,ib,ic,id) ( (a)=(ia^ib^ic^id), \
+ ix=(a)=ROTATE((a),1) \
+ )
+# endif
+
+#ifndef SHA1_ASM
+static
+#endif
+void sha1_block_data_order (SHA_CTX *c, const void *p,size_t num);
+
+#else
+# error "Either SHA_0 or SHA_1 must be defined."
+#endif
+
+#include "openssl_md32_common.h"
+
+#define INIT_DATA_h0 0x67452301UL
+#define INIT_DATA_h1 0xefcdab89UL
+#define INIT_DATA_h2 0x98badcfeUL
+#define INIT_DATA_h3 0x10325476UL
+#define INIT_DATA_h4 0xc3d2e1f0UL
+
+int HASH_INIT (SHA_CTX *c)
+ {
+ memset (c,0,sizeof(*c));
+ c->h0=INIT_DATA_h0;
+ c->h1=INIT_DATA_h1;
+ c->h2=INIT_DATA_h2;
+ c->h3=INIT_DATA_h3;
+ c->h4=INIT_DATA_h4;
+ return 1;
+ }
+
+#define K_00_19 0x5a827999UL
+#define K_20_39 0x6ed9eba1UL
+#define K_40_59 0x8f1bbcdcUL
+#define K_60_79 0xca62c1d6UL
+
+/* As pointed out by Wei Dai <weidai@eskimo.com>, F() below can be
+ * simplified to the code in F_00_19. Wei attributes these optimisations
+ * to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel.
+ * #define F(x,y,z) (((x) & (y)) | ((~(x)) & (z)))
+ * I've just become aware of another tweak to be made, again from Wei Dai,
+ * in F_40_59, (x&a)|(y&a) -> (x|y)&a
+ */
+#define F_00_19(b,c,d) ((((c) ^ (d)) & (b)) ^ (d))
+#define F_20_39(b,c,d) ((b) ^ (c) ^ (d))
+#define F_40_59(b,c,d) (((b) & (c)) | (((b)|(c)) & (d)))
+#define F_60_79(b,c,d) F_20_39(b,c,d)
+
+#ifndef OPENSSL_SMALL_FOOTPRINT
+
+#define BODY_00_15(i,a,b,c,d,e,f,xi) \
+ (f)=xi+(e)+K_00_19+ROTATE((a),5)+F_00_19((b),(c),(d)); \
+ (b)=ROTATE((b),30);
+
+#define BODY_16_19(i,a,b,c,d,e,f,xi,xa,xb,xc,xd) \
+ Xupdate(f,xi,xa,xb,xc,xd); \
+ (f)+=(e)+K_00_19+ROTATE((a),5)+F_00_19((b),(c),(d)); \
+ (b)=ROTATE((b),30);
+
+#define BODY_20_31(i,a,b,c,d,e,f,xi,xa,xb,xc,xd) \
+ Xupdate(f,xi,xa,xb,xc,xd); \
+ (f)+=(e)+K_20_39+ROTATE((a),5)+F_20_39((b),(c),(d)); \
+ (b)=ROTATE((b),30);
+
+#define BODY_32_39(i,a,b,c,d,e,f,xa,xb,xc,xd) \
+ Xupdate(f,xa,xa,xb,xc,xd); \
+ (f)+=(e)+K_20_39+ROTATE((a),5)+F_20_39((b),(c),(d)); \
+ (b)=ROTATE((b),30);
+
+#define BODY_40_59(i,a,b,c,d,e,f,xa,xb,xc,xd) \
+ Xupdate(f,xa,xa,xb,xc,xd); \
+ (f)+=(e)+K_40_59+ROTATE((a),5)+F_40_59((b),(c),(d)); \
+ (b)=ROTATE((b),30);
+
+#define BODY_60_79(i,a,b,c,d,e,f,xa,xb,xc,xd) \
+ Xupdate(f,xa,xa,xb,xc,xd); \
+ (f)=xa+(e)+K_60_79+ROTATE((a),5)+F_60_79((b),(c),(d)); \
+ (b)=ROTATE((b),30);
+
+#ifdef X
+#undef X
+#endif
+#ifndef MD32_XARRAY
+ /*
+ * Originally X was an array. As it's automatic it's natural
+ * to expect RISC compiler to accomodate at least part of it in
+ * the register bank, isn't it? Unfortunately not all compilers
+ * "find" this expectation reasonable:-( On order to make such
+ * compilers generate better code I replace X[] with a bunch of
+ * X0, X1, etc. See the function body below...
+ * <appro@fy.chalmers.se>
+ */
+# define X(i) XX##i
+#else
+ /*
+ * However! Some compilers (most notably HP C) get overwhelmed by
+ * that many local variables so that we have to have the way to
+ * fall down to the original behavior.
+ */
+# define X(i) XX[i]
+#endif
+
+#if !defined(SHA_1) || !defined(SHA1_ASM)
+static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num)
+ {
+ const unsigned char *data=p;
+ register unsigned MD32_REG_T A,B,C,D,E,T,l;
+#ifndef MD32_XARRAY
+ unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
+ XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
+#else
+ SHA_LONG XX[16];
+#endif
+
+ A=c->h0;
+ B=c->h1;
+ C=c->h2;
+ D=c->h3;
+ E=c->h4;
+
+ for (;;)
+ {
+ const union { long one; char little; } is_endian = {1};
+
+ if (!is_endian.little && sizeof(SHA_LONG)==4 && ((size_t)p%4)==0)
+ {
+ const SHA_LONG *W=(const SHA_LONG *)data;
+
+ X( 0) = W[0]; X( 1) = W[ 1];
+ BODY_00_15( 0,A,B,C,D,E,T,X( 0)); X( 2) = W[ 2];
+ BODY_00_15( 1,T,A,B,C,D,E,X( 1)); X( 3) = W[ 3];
+ BODY_00_15( 2,E,T,A,B,C,D,X( 2)); X( 4) = W[ 4];
+ BODY_00_15( 3,D,E,T,A,B,C,X( 3)); X( 5) = W[ 5];
+ BODY_00_15( 4,C,D,E,T,A,B,X( 4)); X( 6) = W[ 6];
+ BODY_00_15( 5,B,C,D,E,T,A,X( 5)); X( 7) = W[ 7];
+ BODY_00_15( 6,A,B,C,D,E,T,X( 6)); X( 8) = W[ 8];
+ BODY_00_15( 7,T,A,B,C,D,E,X( 7)); X( 9) = W[ 9];
+ BODY_00_15( 8,E,T,A,B,C,D,X( 8)); X(10) = W[10];
+ BODY_00_15( 9,D,E,T,A,B,C,X( 9)); X(11) = W[11];
+ BODY_00_15(10,C,D,E,T,A,B,X(10)); X(12) = W[12];
+ BODY_00_15(11,B,C,D,E,T,A,X(11)); X(13) = W[13];
+ BODY_00_15(12,A,B,C,D,E,T,X(12)); X(14) = W[14];
+ BODY_00_15(13,T,A,B,C,D,E,X(13)); X(15) = W[15];
+ BODY_00_15(14,E,T,A,B,C,D,X(14));
+ BODY_00_15(15,D,E,T,A,B,C,X(15));
+
+ data += SHA_CBLOCK;
+ }
+ else
+ {
+ HOST_c2l(data,l); X( 0)=l; HOST_c2l(data,l); X( 1)=l;
+ BODY_00_15( 0,A,B,C,D,E,T,X( 0)); HOST_c2l(data,l); X( 2)=l;
+ BODY_00_15( 1,T,A,B,C,D,E,X( 1)); HOST_c2l(data,l); X( 3)=l;
+ BODY_00_15( 2,E,T,A,B,C,D,X( 2)); HOST_c2l(data,l); X( 4)=l;
+ BODY_00_15( 3,D,E,T,A,B,C,X( 3)); HOST_c2l(data,l); X( 5)=l;
+ BODY_00_15( 4,C,D,E,T,A,B,X( 4)); HOST_c2l(data,l); X( 6)=l;
+ BODY_00_15( 5,B,C,D,E,T,A,X( 5)); HOST_c2l(data,l); X( 7)=l;
+ BODY_00_15( 6,A,B,C,D,E,T,X( 6)); HOST_c2l(data,l); X( 8)=l;
+ BODY_00_15( 7,T,A,B,C,D,E,X( 7)); HOST_c2l(data,l); X( 9)=l;
+ BODY_00_15( 8,E,T,A,B,C,D,X( 8)); HOST_c2l(data,l); X(10)=l;
+ BODY_00_15( 9,D,E,T,A,B,C,X( 9)); HOST_c2l(data,l); X(11)=l;
+ BODY_00_15(10,C,D,E,T,A,B,X(10)); HOST_c2l(data,l); X(12)=l;
+ BODY_00_15(11,B,C,D,E,T,A,X(11)); HOST_c2l(data,l); X(13)=l;
+ BODY_00_15(12,A,B,C,D,E,T,X(12)); HOST_c2l(data,l); X(14)=l;
+ BODY_00_15(13,T,A,B,C,D,E,X(13)); HOST_c2l(data,l); X(15)=l;
+ BODY_00_15(14,E,T,A,B,C,D,X(14));
+ BODY_00_15(15,D,E,T,A,B,C,X(15));
+ }
+
+ BODY_16_19(16,C,D,E,T,A,B,X( 0),X( 0),X( 2),X( 8),X(13));
+ BODY_16_19(17,B,C,D,E,T,A,X( 1),X( 1),X( 3),X( 9),X(14));
+ BODY_16_19(18,A,B,C,D,E,T,X( 2),X( 2),X( 4),X(10),X(15));
+ BODY_16_19(19,T,A,B,C,D,E,X( 3),X( 3),X( 5),X(11),X( 0));
+
+ BODY_20_31(20,E,T,A,B,C,D,X( 4),X( 4),X( 6),X(12),X( 1));
+ BODY_20_31(21,D,E,T,A,B,C,X( 5),X( 5),X( 7),X(13),X( 2));
+ BODY_20_31(22,C,D,E,T,A,B,X( 6),X( 6),X( 8),X(14),X( 3));
+ BODY_20_31(23,B,C,D,E,T,A,X( 7),X( 7),X( 9),X(15),X( 4));
+ BODY_20_31(24,A,B,C,D,E,T,X( 8),X( 8),X(10),X( 0),X( 5));
+ BODY_20_31(25,T,A,B,C,D,E,X( 9),X( 9),X(11),X( 1),X( 6));
+ BODY_20_31(26,E,T,A,B,C,D,X(10),X(10),X(12),X( 2),X( 7));
+ BODY_20_31(27,D,E,T,A,B,C,X(11),X(11),X(13),X( 3),X( 8));
+ BODY_20_31(28,C,D,E,T,A,B,X(12),X(12),X(14),X( 4),X( 9));
+ BODY_20_31(29,B,C,D,E,T,A,X(13),X(13),X(15),X( 5),X(10));
+ BODY_20_31(30,A,B,C,D,E,T,X(14),X(14),X( 0),X( 6),X(11));
+ BODY_20_31(31,T,A,B,C,D,E,X(15),X(15),X( 1),X( 7),X(12));
+
+ BODY_32_39(32,E,T,A,B,C,D,X( 0),X( 2),X( 8),X(13));
+ BODY_32_39(33,D,E,T,A,B,C,X( 1),X( 3),X( 9),X(14));
+ BODY_32_39(34,C,D,E,T,A,B,X( 2),X( 4),X(10),X(15));
+ BODY_32_39(35,B,C,D,E,T,A,X( 3),X( 5),X(11),X( 0));
+ BODY_32_39(36,A,B,C,D,E,T,X( 4),X( 6),X(12),X( 1));
+ BODY_32_39(37,T,A,B,C,D,E,X( 5),X( 7),X(13),X( 2));
+ BODY_32_39(38,E,T,A,B,C,D,X( 6),X( 8),X(14),X( 3));
+ BODY_32_39(39,D,E,T,A,B,C,X( 7),X( 9),X(15),X( 4));
+
+ BODY_40_59(40,C,D,E,T,A,B,X( 8),X(10),X( 0),X( 5));
+ BODY_40_59(41,B,C,D,E,T,A,X( 9),X(11),X( 1),X( 6));
+ BODY_40_59(42,A,B,C,D,E,T,X(10),X(12),X( 2),X( 7));
+ BODY_40_59(43,T,A,B,C,D,E,X(11),X(13),X( 3),X( 8));
+ BODY_40_59(44,E,T,A,B,C,D,X(12),X(14),X( 4),X( 9));
+ BODY_40_59(45,D,E,T,A,B,C,X(13),X(15),X( 5),X(10));
+ BODY_40_59(46,C,D,E,T,A,B,X(14),X( 0),X( 6),X(11));
+ BODY_40_59(47,B,C,D,E,T,A,X(15),X( 1),X( 7),X(12));
+ BODY_40_59(48,A,B,C,D,E,T,X( 0),X( 2),X( 8),X(13));
+ BODY_40_59(49,T,A,B,C,D,E,X( 1),X( 3),X( 9),X(14));
+ BODY_40_59(50,E,T,A,B,C,D,X( 2),X( 4),X(10),X(15));
+ BODY_40_59(51,D,E,T,A,B,C,X( 3),X( 5),X(11),X( 0));
+ BODY_40_59(52,C,D,E,T,A,B,X( 4),X( 6),X(12),X( 1));
+ BODY_40_59(53,B,C,D,E,T,A,X( 5),X( 7),X(13),X( 2));
+ BODY_40_59(54,A,B,C,D,E,T,X( 6),X( 8),X(14),X( 3));
+ BODY_40_59(55,T,A,B,C,D,E,X( 7),X( 9),X(15),X( 4));
+ BODY_40_59(56,E,T,A,B,C,D,X( 8),X(10),X( 0),X( 5));
+ BODY_40_59(57,D,E,T,A,B,C,X( 9),X(11),X( 1),X( 6));
+ BODY_40_59(58,C,D,E,T,A,B,X(10),X(12),X( 2),X( 7));
+ BODY_40_59(59,B,C,D,E,T,A,X(11),X(13),X( 3),X( 8));
+
+ BODY_60_79(60,A,B,C,D,E,T,X(12),X(14),X( 4),X( 9));
+ BODY_60_79(61,T,A,B,C,D,E,X(13),X(15),X( 5),X(10));
+ BODY_60_79(62,E,T,A,B,C,D,X(14),X( 0),X( 6),X(11));
+ BODY_60_79(63,D,E,T,A,B,C,X(15),X( 1),X( 7),X(12));
+ BODY_60_79(64,C,D,E,T,A,B,X( 0),X( 2),X( 8),X(13));
+ BODY_60_79(65,B,C,D,E,T,A,X( 1),X( 3),X( 9),X(14));
+ BODY_60_79(66,A,B,C,D,E,T,X( 2),X( 4),X(10),X(15));
+ BODY_60_79(67,T,A,B,C,D,E,X( 3),X( 5),X(11),X( 0));
+ BODY_60_79(68,E,T,A,B,C,D,X( 4),X( 6),X(12),X( 1));
+ BODY_60_79(69,D,E,T,A,B,C,X( 5),X( 7),X(13),X( 2));
+ BODY_60_79(70,C,D,E,T,A,B,X( 6),X( 8),X(14),X( 3));
+ BODY_60_79(71,B,C,D,E,T,A,X( 7),X( 9),X(15),X( 4));
+ BODY_60_79(72,A,B,C,D,E,T,X( 8),X(10),X( 0),X( 5));
+ BODY_60_79(73,T,A,B,C,D,E,X( 9),X(11),X( 1),X( 6));
+ BODY_60_79(74,E,T,A,B,C,D,X(10),X(12),X( 2),X( 7));
+ BODY_60_79(75,D,E,T,A,B,C,X(11),X(13),X( 3),X( 8));
+ BODY_60_79(76,C,D,E,T,A,B,X(12),X(14),X( 4),X( 9));
+ BODY_60_79(77,B,C,D,E,T,A,X(13),X(15),X( 5),X(10));
+ BODY_60_79(78,A,B,C,D,E,T,X(14),X( 0),X( 6),X(11));
+ BODY_60_79(79,T,A,B,C,D,E,X(15),X( 1),X( 7),X(12));
+
+ c->h0=(c->h0+E)&0xffffffffL;
+ c->h1=(c->h1+T)&0xffffffffL;
+ c->h2=(c->h2+A)&0xffffffffL;
+ c->h3=(c->h3+B)&0xffffffffL;
+ c->h4=(c->h4+C)&0xffffffffL;
+
+ if (--num == 0) break;
+
+ A=c->h0;
+ B=c->h1;
+ C=c->h2;
+ D=c->h3;
+ E=c->h4;
+
+ }
+ }
+#endif
+
+#else /* OPENSSL_SMALL_FOOTPRINT */
+
+#define BODY_00_15(xi) do { \
+ T=E+K_00_19+F_00_19(B,C,D); \
+ E=D, D=C, C=ROTATE(B,30), B=A; \
+ A=ROTATE(A,5)+T+xi; } while(0)
+
+#define BODY_16_19(xa,xb,xc,xd) do { \
+ Xupdate(T,xa,xa,xb,xc,xd); \
+ T+=E+K_00_19+F_00_19(B,C,D); \
+ E=D, D=C, C=ROTATE(B,30), B=A; \
+ A=ROTATE(A,5)+T; } while(0)
+
+#define BODY_20_39(xa,xb,xc,xd) do { \
+ Xupdate(T,xa,xa,xb,xc,xd); \
+ T+=E+K_20_39+F_20_39(B,C,D); \
+ E=D, D=C, C=ROTATE(B,30), B=A; \
+ A=ROTATE(A,5)+T; } while(0)
+
+#define BODY_40_59(xa,xb,xc,xd) do { \
+ Xupdate(T,xa,xa,xb,xc,xd); \
+ T+=E+K_40_59+F_40_59(B,C,D); \
+ E=D, D=C, C=ROTATE(B,30), B=A; \
+ A=ROTATE(A,5)+T; } while(0)
+
+#define BODY_60_79(xa,xb,xc,xd) do { \
+ Xupdate(T,xa,xa,xb,xc,xd); \
+ T=E+K_60_79+F_60_79(B,C,D); \
+ E=D, D=C, C=ROTATE(B,30), B=A; \
+ A=ROTATE(A,5)+T+xa; } while(0)
+
+#if !defined(SHA_1) || !defined(SHA1_ASM)
+static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num)
+ {
+ const unsigned char *data=p;
+ register unsigned MD32_REG_T A,B,C,D,E,T,l;
+ int i;
+ SHA_LONG X[16];
+
+ A=c->h0;
+ B=c->h1;
+ C=c->h2;
+ D=c->h3;
+ E=c->h4;
+
+ for (;;)
+ {
+ for (i=0;i<16;i++)
+ { HOST_c2l(data,l); X[i]=l; BODY_00_15(X[i]); }
+ for (i=0;i<4;i++)
+ { BODY_16_19(X[i], X[i+2], X[i+8], X[(i+13)&15]); }
+ for (;i<24;i++)
+ { BODY_20_39(X[i&15], X[(i+2)&15], X[(i+8)&15],X[(i+13)&15]); }
+ for (i=0;i<20;i++)
+ { BODY_40_59(X[(i+8)&15],X[(i+10)&15],X[i&15], X[(i+5)&15]); }
+ for (i=4;i<24;i++)
+ { BODY_60_79(X[(i+8)&15],X[(i+10)&15],X[i&15], X[(i+5)&15]); }
+
+ c->h0=(c->h0+A)&0xffffffffL;
+ c->h1=(c->h1+B)&0xffffffffL;
+ c->h2=(c->h2+C)&0xffffffffL;
+ c->h3=(c->h3+D)&0xffffffffL;
+ c->h4=(c->h4+E)&0xffffffffL;
+
+ if (--num == 0) break;
+
+ A=c->h0;
+ B=c->h1;
+ C=c->h2;
+ D=c->h3;
+ E=c->h4;
+
+ }
+ }
+#endif
+
+#endif
diff --git a/snmplib/openssl/openssl_spr.h b/snmplib/openssl/openssl_spr.h
new file mode 100644
index 0000000..98ec61e
--- /dev/null
+++ b/snmplib/openssl/openssl_spr.h
@@ -0,0 +1,204 @@
+/* crypto/des/spr.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+const DES_LONG DES_SPtrans[8][64]={
+{
+/* nibble 0 */
+0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
+0x02000000L, 0x00080802L, 0x00080002L, 0x02000002L,
+0x00080802L, 0x02080800L, 0x02080000L, 0x00000802L,
+0x02000802L, 0x02000000L, 0x00000000L, 0x00080002L,
+0x00080000L, 0x00000002L, 0x02000800L, 0x00080800L,
+0x02080802L, 0x02080000L, 0x00000802L, 0x02000800L,
+0x00000002L, 0x00000800L, 0x00080800L, 0x02080002L,
+0x00000800L, 0x02000802L, 0x02080002L, 0x00000000L,
+0x00000000L, 0x02080802L, 0x02000800L, 0x00080002L,
+0x02080800L, 0x00080000L, 0x00000802L, 0x02000800L,
+0x02080002L, 0x00000800L, 0x00080800L, 0x02000002L,
+0x00080802L, 0x00000002L, 0x02000002L, 0x02080000L,
+0x02080802L, 0x00080800L, 0x02080000L, 0x02000802L,
+0x02000000L, 0x00000802L, 0x00080002L, 0x00000000L,
+0x00080000L, 0x02000000L, 0x02000802L, 0x02080800L,
+0x00000002L, 0x02080002L, 0x00000800L, 0x00080802L,
+},{
+/* nibble 1 */
+0x40108010L, 0x00000000L, 0x00108000L, 0x40100000L,
+0x40000010L, 0x00008010L, 0x40008000L, 0x00108000L,
+0x00008000L, 0x40100010L, 0x00000010L, 0x40008000L,
+0x00100010L, 0x40108000L, 0x40100000L, 0x00000010L,
+0x00100000L, 0x40008010L, 0x40100010L, 0x00008000L,
+0x00108010L, 0x40000000L, 0x00000000L, 0x00100010L,
+0x40008010L, 0x00108010L, 0x40108000L, 0x40000010L,
+0x40000000L, 0x00100000L, 0x00008010L, 0x40108010L,
+0x00100010L, 0x40108000L, 0x40008000L, 0x00108010L,
+0x40108010L, 0x00100010L, 0x40000010L, 0x00000000L,
+0x40000000L, 0x00008010L, 0x00100000L, 0x40100010L,
+0x00008000L, 0x40000000L, 0x00108010L, 0x40008010L,
+0x40108000L, 0x00008000L, 0x00000000L, 0x40000010L,
+0x00000010L, 0x40108010L, 0x00108000L, 0x40100000L,
+0x40100010L, 0x00100000L, 0x00008010L, 0x40008000L,
+0x40008010L, 0x00000010L, 0x40100000L, 0x00108000L,
+},{
+/* nibble 2 */
+0x04000001L, 0x04040100L, 0x00000100L, 0x04000101L,
+0x00040001L, 0x04000000L, 0x04000101L, 0x00040100L,
+0x04000100L, 0x00040000L, 0x04040000L, 0x00000001L,
+0x04040101L, 0x00000101L, 0x00000001L, 0x04040001L,
+0x00000000L, 0x00040001L, 0x04040100L, 0x00000100L,
+0x00000101L, 0x04040101L, 0x00040000L, 0x04000001L,
+0x04040001L, 0x04000100L, 0x00040101L, 0x04040000L,
+0x00040100L, 0x00000000L, 0x04000000L, 0x00040101L,
+0x04040100L, 0x00000100L, 0x00000001L, 0x00040000L,
+0x00000101L, 0x00040001L, 0x04040000L, 0x04000101L,
+0x00000000L, 0x04040100L, 0x00040100L, 0x04040001L,
+0x00040001L, 0x04000000L, 0x04040101L, 0x00000001L,
+0x00040101L, 0x04000001L, 0x04000000L, 0x04040101L,
+0x00040000L, 0x04000100L, 0x04000101L, 0x00040100L,
+0x04000100L, 0x00000000L, 0x04040001L, 0x00000101L,
+0x04000001L, 0x00040101L, 0x00000100L, 0x04040000L,
+},{
+/* nibble 3 */
+0x00401008L, 0x10001000L, 0x00000008L, 0x10401008L,
+0x00000000L, 0x10400000L, 0x10001008L, 0x00400008L,
+0x10401000L, 0x10000008L, 0x10000000L, 0x00001008L,
+0x10000008L, 0x00401008L, 0x00400000L, 0x10000000L,
+0x10400008L, 0x00401000L, 0x00001000L, 0x00000008L,
+0x00401000L, 0x10001008L, 0x10400000L, 0x00001000L,
+0x00001008L, 0x00000000L, 0x00400008L, 0x10401000L,
+0x10001000L, 0x10400008L, 0x10401008L, 0x00400000L,
+0x10400008L, 0x00001008L, 0x00400000L, 0x10000008L,
+0x00401000L, 0x10001000L, 0x00000008L, 0x10400000L,
+0x10001008L, 0x00000000L, 0x00001000L, 0x00400008L,
+0x00000000L, 0x10400008L, 0x10401000L, 0x00001000L,
+0x10000000L, 0x10401008L, 0x00401008L, 0x00400000L,
+0x10401008L, 0x00000008L, 0x10001000L, 0x00401008L,
+0x00400008L, 0x00401000L, 0x10400000L, 0x10001008L,
+0x00001008L, 0x10000000L, 0x10000008L, 0x10401000L,
+},{
+/* nibble 4 */
+0x08000000L, 0x00010000L, 0x00000400L, 0x08010420L,
+0x08010020L, 0x08000400L, 0x00010420L, 0x08010000L,
+0x00010000L, 0x00000020L, 0x08000020L, 0x00010400L,
+0x08000420L, 0x08010020L, 0x08010400L, 0x00000000L,
+0x00010400L, 0x08000000L, 0x00010020L, 0x00000420L,
+0x08000400L, 0x00010420L, 0x00000000L, 0x08000020L,
+0x00000020L, 0x08000420L, 0x08010420L, 0x00010020L,
+0x08010000L, 0x00000400L, 0x00000420L, 0x08010400L,
+0x08010400L, 0x08000420L, 0x00010020L, 0x08010000L,
+0x00010000L, 0x00000020L, 0x08000020L, 0x08000400L,
+0x08000000L, 0x00010400L, 0x08010420L, 0x00000000L,
+0x00010420L, 0x08000000L, 0x00000400L, 0x00010020L,
+0x08000420L, 0x00000400L, 0x00000000L, 0x08010420L,
+0x08010020L, 0x08010400L, 0x00000420L, 0x00010000L,
+0x00010400L, 0x08010020L, 0x08000400L, 0x00000420L,
+0x00000020L, 0x00010420L, 0x08010000L, 0x08000020L,
+},{
+/* nibble 5 */
+0x80000040L, 0x00200040L, 0x00000000L, 0x80202000L,
+0x00200040L, 0x00002000L, 0x80002040L, 0x00200000L,
+0x00002040L, 0x80202040L, 0x00202000L, 0x80000000L,
+0x80002000L, 0x80000040L, 0x80200000L, 0x00202040L,
+0x00200000L, 0x80002040L, 0x80200040L, 0x00000000L,
+0x00002000L, 0x00000040L, 0x80202000L, 0x80200040L,
+0x80202040L, 0x80200000L, 0x80000000L, 0x00002040L,
+0x00000040L, 0x00202000L, 0x00202040L, 0x80002000L,
+0x00002040L, 0x80000000L, 0x80002000L, 0x00202040L,
+0x80202000L, 0x00200040L, 0x00000000L, 0x80002000L,
+0x80000000L, 0x00002000L, 0x80200040L, 0x00200000L,
+0x00200040L, 0x80202040L, 0x00202000L, 0x00000040L,
+0x80202040L, 0x00202000L, 0x00200000L, 0x80002040L,
+0x80000040L, 0x80200000L, 0x00202040L, 0x00000000L,
+0x00002000L, 0x80000040L, 0x80002040L, 0x80202000L,
+0x80200000L, 0x00002040L, 0x00000040L, 0x80200040L,
+},{
+/* nibble 6 */
+0x00004000L, 0x00000200L, 0x01000200L, 0x01000004L,
+0x01004204L, 0x00004004L, 0x00004200L, 0x00000000L,
+0x01000000L, 0x01000204L, 0x00000204L, 0x01004000L,
+0x00000004L, 0x01004200L, 0x01004000L, 0x00000204L,
+0x01000204L, 0x00004000L, 0x00004004L, 0x01004204L,
+0x00000000L, 0x01000200L, 0x01000004L, 0x00004200L,
+0x01004004L, 0x00004204L, 0x01004200L, 0x00000004L,
+0x00004204L, 0x01004004L, 0x00000200L, 0x01000000L,
+0x00004204L, 0x01004000L, 0x01004004L, 0x00000204L,
+0x00004000L, 0x00000200L, 0x01000000L, 0x01004004L,
+0x01000204L, 0x00004204L, 0x00004200L, 0x00000000L,
+0x00000200L, 0x01000004L, 0x00000004L, 0x01000200L,
+0x00000000L, 0x01000204L, 0x01000200L, 0x00004200L,
+0x00000204L, 0x00004000L, 0x01004204L, 0x01000000L,
+0x01004200L, 0x00000004L, 0x00004004L, 0x01004204L,
+0x01000004L, 0x01004200L, 0x01004000L, 0x00004004L,
+},{
+/* nibble 7 */
+0x20800080L, 0x20820000L, 0x00020080L, 0x00000000L,
+0x20020000L, 0x00800080L, 0x20800000L, 0x20820080L,
+0x00000080L, 0x20000000L, 0x00820000L, 0x00020080L,
+0x00820080L, 0x20020080L, 0x20000080L, 0x20800000L,
+0x00020000L, 0x00820080L, 0x00800080L, 0x20020000L,
+0x20820080L, 0x20000080L, 0x00000000L, 0x00820000L,
+0x20000000L, 0x00800000L, 0x20020080L, 0x20800080L,
+0x00800000L, 0x00020000L, 0x20820000L, 0x00000080L,
+0x00800000L, 0x00020000L, 0x20000080L, 0x20820080L,
+0x00020080L, 0x20000000L, 0x00000000L, 0x00820000L,
+0x20800080L, 0x20020080L, 0x20020000L, 0x00800080L,
+0x20820000L, 0x00000080L, 0x00800080L, 0x20020000L,
+0x20820080L, 0x00800000L, 0x20800000L, 0x20000080L,
+0x00820000L, 0x00020080L, 0x20020080L, 0x20800000L,
+0x00000080L, 0x20820000L, 0x00820080L, 0x00000000L,
+0x20000000L, 0x20800080L, 0x00020000L, 0x00820080L,
+}};
diff --git a/snmplib/parse.c b/snmplib/parse.c
new file mode 100644
index 0000000..1114586
--- /dev/null
+++ b/snmplib/parse.c
@@ -0,0 +1,5681 @@
+/*
+ * parse.c
+ *
+ */
+/* 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 1989, 1991, 1992 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>
+#include <net-snmp/net-snmp-features.h>
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+
+#if HAVE_LIMITS_H
+#include <limits.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
+#include <ctype.h>
+#include <sys/types.h>
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+/*
+ * Wow. This is ugly. -- Wes
+ */
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# 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 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_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
+#include <regex.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <errno.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/parse.h>
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/tools.h>
+
+netsnmp_feature_child_of(find_module, mib_api)
+netsnmp_feature_child_of(get_tc_description, mib_api)
+
+/*
+ * A linked list of nodes.
+ */
+struct node {
+ struct node *next;
+ char *label; /* This node's (unique) textual name */
+ u_long subid; /* This node's integer subidentifier */
+ int modid; /* The module containing this node */
+ char *parent; /* The parent's textual name */
+ int tc_index; /* index into tclist (-1 if NA) */
+ int type; /* The type of object this represents */
+ int access;
+ int status;
+ struct enum_list *enums; /* (optional) list of enumerated integers */
+ struct range_list *ranges;
+ struct index_list *indexes;
+ char *augments;
+ struct varbind_list *varbinds;
+ char *hint;
+ char *units;
+ char *description; /* description (a quoted string) */
+ char *reference; /* references (a quoted string) */
+ char *defaultValue;
+ char *filename;
+ int lineno;
+};
+
+/*
+ * This is one element of an object identifier with either an integer
+ * subidentifier, or a textual string label, or both.
+ * The subid is -1 if not present, and label is NULL if not present.
+ */
+struct subid_s {
+ int subid;
+ int modid;
+ char *label;
+};
+
+#define MAXTC 4096
+struct tc { /* textual conventions */
+ int type;
+ int modid;
+ char *descriptor;
+ char *hint;
+ struct enum_list *enums;
+ struct range_list *ranges;
+ char *description;
+} tclist[MAXTC];
+
+int mibLine = 0;
+const char *File = "(none)";
+static int anonymous = 0;
+
+struct objgroup {
+ char *name;
+ int line;
+ struct objgroup *next;
+} *objgroups = NULL, *objects = NULL, *notifs = NULL;
+
+#define SYNTAX_MASK 0x80
+/*
+ * types of tokens
+ * Tokens wiht the SYNTAX_MASK bit set are syntax tokens
+ */
+#define CONTINUE -1
+#define ENDOFFILE 0
+#define LABEL 1
+#define SUBTREE 2
+#define SYNTAX 3
+#define OBJID (4 | SYNTAX_MASK)
+#define OCTETSTR (5 | SYNTAX_MASK)
+#define INTEGER (6 | SYNTAX_MASK)
+#define NETADDR (7 | SYNTAX_MASK)
+#define IPADDR (8 | SYNTAX_MASK)
+#define COUNTER (9 | SYNTAX_MASK)
+#define GAUGE (10 | SYNTAX_MASK)
+#define TIMETICKS (11 | SYNTAX_MASK)
+#define KW_OPAQUE (12 | SYNTAX_MASK)
+#define NUL (13 | SYNTAX_MASK)
+#define SEQUENCE 14
+#define OF 15 /* SEQUENCE OF */
+#define OBJTYPE 16
+#define ACCESS 17
+#define READONLY 18
+#define READWRITE 19
+#define WRITEONLY 20
+#ifdef NOACCESS
+#undef NOACCESS /* agent 'NOACCESS' token */
+#endif
+#define NOACCESS 21
+#define STATUS 22
+#define MANDATORY 23
+#define KW_OPTIONAL 24
+#define OBSOLETE 25
+/*
+ * #define RECOMMENDED 26
+ */
+#define PUNCT 27
+#define EQUALS 28
+#define NUMBER 29
+#define LEFTBRACKET 30
+#define RIGHTBRACKET 31
+#define LEFTPAREN 32
+#define RIGHTPAREN 33
+#define COMMA 34
+#define DESCRIPTION 35
+#define QUOTESTRING 36
+#define INDEX 37
+#define DEFVAL 38
+#define DEPRECATED 39
+#define SIZE 40
+#define BITSTRING (41 | SYNTAX_MASK)
+#define NSAPADDRESS (42 | SYNTAX_MASK)
+#define COUNTER64 (43 | SYNTAX_MASK)
+#define OBJGROUP 44
+#define NOTIFTYPE 45
+#define AUGMENTS 46
+#define COMPLIANCE 47
+#define READCREATE 48
+#define UNITS 49
+#define REFERENCE 50
+#define NUM_ENTRIES 51
+#define MODULEIDENTITY 52
+#define LASTUPDATED 53
+#define ORGANIZATION 54
+#define CONTACTINFO 55
+#define UINTEGER32 (56 | SYNTAX_MASK)
+#define CURRENT 57
+#define DEFINITIONS 58
+#define END 59
+#define SEMI 60
+#define TRAPTYPE 61
+#define ENTERPRISE 62
+/*
+ * #define DISPLAYSTR (63 | SYNTAX_MASK)
+ */
+#define BEGIN 64
+#define IMPORTS 65
+#define EXPORTS 66
+#define ACCNOTIFY 67
+#define BAR 68
+#define RANGE 69
+#define CONVENTION 70
+#define DISPLAYHINT 71
+#define FROM 72
+#define AGENTCAP 73
+#define MACRO 74
+#define IMPLIED 75
+#define SUPPORTS 76
+#define INCLUDES 77
+#define VARIATION 78
+#define REVISION 79
+#define NOTIMPL 80
+#define OBJECTS 81
+#define NOTIFICATIONS 82
+#define MODULE 83
+#define MINACCESS 84
+#define PRODREL 85
+#define WRSYNTAX 86
+#define CREATEREQ 87
+#define NOTIFGROUP 88
+#define MANDATORYGROUPS 89
+#define GROUP 90
+#define OBJECT 91
+#define IDENTIFIER 92
+#define CHOICE 93
+#define LEFTSQBRACK 95
+#define RIGHTSQBRACK 96
+#define IMPLICIT 97
+#define APPSYNTAX (98 | SYNTAX_MASK)
+#define OBJSYNTAX (99 | SYNTAX_MASK)
+#define SIMPLESYNTAX (100 | SYNTAX_MASK)
+#define OBJNAME (101 | SYNTAX_MASK)
+#define NOTIFNAME (102 | SYNTAX_MASK)
+#define VARIABLES 103
+#define UNSIGNED32 (104 | SYNTAX_MASK)
+#define INTEGER32 (105 | SYNTAX_MASK)
+#define OBJIDENTITY 106
+/*
+ * Beware of reaching SYNTAX_MASK (0x80)
+ */
+
+struct tok {
+ const char *name; /* token name */
+ int len; /* length not counting nul */
+ int token; /* value */
+ int hash; /* hash of name */
+ struct tok *next; /* pointer to next in hash table */
+};
+
+
+static struct tok tokens[] = {
+ {"obsolete", sizeof("obsolete") - 1, OBSOLETE}
+ ,
+ {"Opaque", sizeof("Opaque") - 1, KW_OPAQUE}
+ ,
+ {"optional", sizeof("optional") - 1, KW_OPTIONAL}
+ ,
+ {"LAST-UPDATED", sizeof("LAST-UPDATED") - 1, LASTUPDATED}
+ ,
+ {"ORGANIZATION", sizeof("ORGANIZATION") - 1, ORGANIZATION}
+ ,
+ {"CONTACT-INFO", sizeof("CONTACT-INFO") - 1, CONTACTINFO}
+ ,
+ {"MODULE-IDENTITY", sizeof("MODULE-IDENTITY") - 1, MODULEIDENTITY}
+ ,
+ {"MODULE-COMPLIANCE", sizeof("MODULE-COMPLIANCE") - 1, COMPLIANCE}
+ ,
+ {"DEFINITIONS", sizeof("DEFINITIONS") - 1, DEFINITIONS}
+ ,
+ {"END", sizeof("END") - 1, END}
+ ,
+ {"AUGMENTS", sizeof("AUGMENTS") - 1, AUGMENTS}
+ ,
+ {"not-accessible", sizeof("not-accessible") - 1, NOACCESS}
+ ,
+ {"write-only", sizeof("write-only") - 1, WRITEONLY}
+ ,
+ {"NsapAddress", sizeof("NsapAddress") - 1, NSAPADDRESS}
+ ,
+ {"UNITS", sizeof("Units") - 1, UNITS}
+ ,
+ {"REFERENCE", sizeof("REFERENCE") - 1, REFERENCE}
+ ,
+ {"NUM-ENTRIES", sizeof("NUM-ENTRIES") - 1, NUM_ENTRIES}
+ ,
+ {"BITSTRING", sizeof("BITSTRING") - 1, BITSTRING}
+ ,
+ {"BIT", sizeof("BIT") - 1, CONTINUE}
+ ,
+ {"BITS", sizeof("BITS") - 1, BITSTRING}
+ ,
+ {"Counter64", sizeof("Counter64") - 1, COUNTER64}
+ ,
+ {"TimeTicks", sizeof("TimeTicks") - 1, TIMETICKS}
+ ,
+ {"NOTIFICATION-TYPE", sizeof("NOTIFICATION-TYPE") - 1, NOTIFTYPE}
+ ,
+ {"OBJECT-GROUP", sizeof("OBJECT-GROUP") - 1, OBJGROUP}
+ ,
+ {"OBJECT-IDENTITY", sizeof("OBJECT-IDENTITY") - 1, OBJIDENTITY}
+ ,
+ {"IDENTIFIER", sizeof("IDENTIFIER") - 1, IDENTIFIER}
+ ,
+ {"OBJECT", sizeof("OBJECT") - 1, OBJECT}
+ ,
+ {"NetworkAddress", sizeof("NetworkAddress") - 1, NETADDR}
+ ,
+ {"Gauge", sizeof("Gauge") - 1, GAUGE}
+ ,
+ {"Gauge32", sizeof("Gauge32") - 1, GAUGE}
+ ,
+ {"Unsigned32", sizeof("Unsigned32") - 1, UNSIGNED32}
+ ,
+ {"read-write", sizeof("read-write") - 1, READWRITE}
+ ,
+ {"read-create", sizeof("read-create") - 1, READCREATE}
+ ,
+ {"OCTETSTRING", sizeof("OCTETSTRING") - 1, OCTETSTR}
+ ,
+ {"OCTET", sizeof("OCTET") - 1, CONTINUE}
+ ,
+ {"OF", sizeof("OF") - 1, OF}
+ ,
+ {"SEQUENCE", sizeof("SEQUENCE") - 1, SEQUENCE}
+ ,
+ {"NULL", sizeof("NULL") - 1, NUL}
+ ,
+ {"IpAddress", sizeof("IpAddress") - 1, IPADDR}
+ ,
+ {"UInteger32", sizeof("UInteger32") - 1, UINTEGER32}
+ ,
+ {"INTEGER", sizeof("INTEGER") - 1, INTEGER}
+ ,
+ {"Integer32", sizeof("Integer32") - 1, INTEGER32}
+ ,
+ {"Counter", sizeof("Counter") - 1, COUNTER}
+ ,
+ {"Counter32", sizeof("Counter32") - 1, COUNTER}
+ ,
+ {"read-only", sizeof("read-only") - 1, READONLY}
+ ,
+ {"DESCRIPTION", sizeof("DESCRIPTION") - 1, DESCRIPTION}
+ ,
+ {"INDEX", sizeof("INDEX") - 1, INDEX}
+ ,
+ {"DEFVAL", sizeof("DEFVAL") - 1, DEFVAL}
+ ,
+ {"deprecated", sizeof("deprecated") - 1, DEPRECATED}
+ ,
+ {"SIZE", sizeof("SIZE") - 1, SIZE}
+ ,
+ {"MAX-ACCESS", sizeof("MAX-ACCESS") - 1, ACCESS}
+ ,
+ {"ACCESS", sizeof("ACCESS") - 1, ACCESS}
+ ,
+ {"mandatory", sizeof("mandatory") - 1, MANDATORY}
+ ,
+ {"current", sizeof("current") - 1, CURRENT}
+ ,
+ {"STATUS", sizeof("STATUS") - 1, STATUS}
+ ,
+ {"SYNTAX", sizeof("SYNTAX") - 1, SYNTAX}
+ ,
+ {"OBJECT-TYPE", sizeof("OBJECT-TYPE") - 1, OBJTYPE}
+ ,
+ {"TRAP-TYPE", sizeof("TRAP-TYPE") - 1, TRAPTYPE}
+ ,
+ {"ENTERPRISE", sizeof("ENTERPRISE") - 1, ENTERPRISE}
+ ,
+ {"BEGIN", sizeof("BEGIN") - 1, BEGIN}
+ ,
+ {"IMPORTS", sizeof("IMPORTS") - 1, IMPORTS}
+ ,
+ {"EXPORTS", sizeof("EXPORTS") - 1, EXPORTS}
+ ,
+ {"accessible-for-notify", sizeof("accessible-for-notify") - 1,
+ ACCNOTIFY}
+ ,
+ {"TEXTUAL-CONVENTION", sizeof("TEXTUAL-CONVENTION") - 1, CONVENTION}
+ ,
+ {"NOTIFICATION-GROUP", sizeof("NOTIFICATION-GROUP") - 1, NOTIFGROUP}
+ ,
+ {"DISPLAY-HINT", sizeof("DISPLAY-HINT") - 1, DISPLAYHINT}
+ ,
+ {"FROM", sizeof("FROM") - 1, FROM}
+ ,
+ {"AGENT-CAPABILITIES", sizeof("AGENT-CAPABILITIES") - 1, AGENTCAP}
+ ,
+ {"MACRO", sizeof("MACRO") - 1, MACRO}
+ ,
+ {"IMPLIED", sizeof("IMPLIED") - 1, IMPLIED}
+ ,
+ {"SUPPORTS", sizeof("SUPPORTS") - 1, SUPPORTS}
+ ,
+ {"INCLUDES", sizeof("INCLUDES") - 1, INCLUDES}
+ ,
+ {"VARIATION", sizeof("VARIATION") - 1, VARIATION}
+ ,
+ {"REVISION", sizeof("REVISION") - 1, REVISION}
+ ,
+ {"not-implemented", sizeof("not-implemented") - 1, NOTIMPL}
+ ,
+ {"OBJECTS", sizeof("OBJECTS") - 1, OBJECTS}
+ ,
+ {"NOTIFICATIONS", sizeof("NOTIFICATIONS") - 1, NOTIFICATIONS}
+ ,
+ {"MODULE", sizeof("MODULE") - 1, MODULE}
+ ,
+ {"MIN-ACCESS", sizeof("MIN-ACCESS") - 1, MINACCESS}
+ ,
+ {"PRODUCT-RELEASE", sizeof("PRODUCT-RELEASE") - 1, PRODREL}
+ ,
+ {"WRITE-SYNTAX", sizeof("WRITE-SYNTAX") - 1, WRSYNTAX}
+ ,
+ {"CREATION-REQUIRES", sizeof("CREATION-REQUIRES") - 1, CREATEREQ}
+ ,
+ {"MANDATORY-GROUPS", sizeof("MANDATORY-GROUPS") - 1, MANDATORYGROUPS}
+ ,
+ {"GROUP", sizeof("GROUP") - 1, GROUP}
+ ,
+ {"CHOICE", sizeof("CHOICE") - 1, CHOICE}
+ ,
+ {"IMPLICIT", sizeof("IMPLICIT") - 1, IMPLICIT}
+ ,
+ {"ObjectSyntax", sizeof("ObjectSyntax") - 1, OBJSYNTAX}
+ ,
+ {"SimpleSyntax", sizeof("SimpleSyntax") - 1, SIMPLESYNTAX}
+ ,
+ {"ApplicationSyntax", sizeof("ApplicationSyntax") - 1, APPSYNTAX}
+ ,
+ {"ObjectName", sizeof("ObjectName") - 1, OBJNAME}
+ ,
+ {"NotificationName", sizeof("NotificationName") - 1, NOTIFNAME}
+ ,
+ {"VARIABLES", sizeof("VARIABLES") - 1, VARIABLES}
+ ,
+ {NULL}
+};
+
+static struct module_compatability *module_map_head;
+static struct module_compatability module_map[] = {
+ {"RFC1065-SMI", "RFC1155-SMI", NULL, 0},
+ {"RFC1066-MIB", "RFC1156-MIB", NULL, 0},
+ /*
+ * 'mib' -> 'mib-2'
+ */
+ {"RFC1156-MIB", "RFC1158-MIB", NULL, 0},
+ /*
+ * 'snmpEnableAuthTraps' -> 'snmpEnableAuthenTraps'
+ */
+ {"RFC1158-MIB", "RFC1213-MIB", NULL, 0},
+ /*
+ * 'nullOID' -> 'zeroDotZero'
+ */
+ {"RFC1155-SMI", "SNMPv2-SMI", NULL, 0},
+ {"RFC1213-MIB", "SNMPv2-SMI", "mib-2", 0},
+ {"RFC1213-MIB", "SNMPv2-MIB", "sys", 3},
+ {"RFC1213-MIB", "IF-MIB", "if", 2},
+ {"RFC1213-MIB", "IP-MIB", "ip", 2},
+ {"RFC1213-MIB", "IP-MIB", "icmp", 4},
+ {"RFC1213-MIB", "TCP-MIB", "tcp", 3},
+ {"RFC1213-MIB", "UDP-MIB", "udp", 3},
+ {"RFC1213-MIB", "SNMPv2-SMI", "transmission", 0},
+ {"RFC1213-MIB", "SNMPv2-MIB", "snmp", 4},
+ {"RFC1231-MIB", "TOKENRING-MIB", NULL, 0},
+ {"RFC1271-MIB", "RMON-MIB", NULL, 0},
+ {"RFC1286-MIB", "SOURCE-ROUTING-MIB", "dot1dSr", 7},
+ {"RFC1286-MIB", "BRIDGE-MIB", NULL, 0},
+ {"RFC1315-MIB", "FRAME-RELAY-DTE-MIB", NULL, 0},
+ {"RFC1316-MIB", "CHARACTER-MIB", NULL, 0},
+ {"RFC1406-MIB", "DS1-MIB", NULL, 0},
+ {"RFC-1213", "RFC1213-MIB", NULL, 0},
+};
+
+#define MODULE_NOT_FOUND 0
+#define MODULE_LOADED_OK 1
+#define MODULE_ALREADY_LOADED 2
+/*
+ * #define MODULE_LOAD_FAILED 3
+ */
+#define MODULE_LOAD_FAILED MODULE_NOT_FOUND
+#define MODULE_SYNTAX_ERROR 4
+
+int gMibError = 0,gLoop = 0;
+char *gpMibErrorString = NULL;
+char gMibNames[STRINGMAX];
+
+#define HASHSIZE 32
+#define BUCKET(x) (x & (HASHSIZE-1))
+
+#define NHASHSIZE 128
+#define NBUCKET(x) (x & (NHASHSIZE-1))
+
+static struct tok *buckets[HASHSIZE];
+
+static struct node *nbuckets[NHASHSIZE];
+static struct tree *tbuckets[NHASHSIZE];
+static struct module *module_head = NULL;
+
+static struct node *orphan_nodes = NULL;
+NETSNMP_IMPORT struct tree *tree_head;
+struct tree *tree_head = NULL;
+
+#define NUMBER_OF_ROOT_NODES 3
+static struct module_import root_imports[NUMBER_OF_ROOT_NODES];
+
+static int current_module = 0;
+static int max_module = 0;
+static int first_err_module = 1;
+static char *last_err_module = NULL; /* no repeats on "Cannot find module..." */
+
+static void tree_from_node(struct tree *tp, struct node *np);
+static void do_subtree(struct tree *, struct node **);
+static void do_linkup(struct module *, struct node *);
+static void dump_module_list(void);
+static int get_token(FILE *, char *, int);
+static int parseQuoteString(FILE *, char *, int);
+static int tossObjectIdentifier(FILE *);
+static int name_hash(const char *);
+static void init_node_hash(struct node *);
+static void print_error(const char *, const char *, int);
+static void free_tree(struct tree *);
+static void free_partial_tree(struct tree *, int);
+static void free_node(struct node *);
+static void build_translation_table(void);
+static void init_tree_roots(void);
+static void merge_anon_children(struct tree *, struct tree *);
+static void unlink_tbucket(struct tree *);
+static void unlink_tree(struct tree *);
+static int getoid(FILE *, struct subid_s *, int);
+static struct node *parse_objectid(FILE *, char *);
+static int get_tc(const char *, int, int *, struct enum_list **,
+ struct range_list **, char **);
+static int get_tc_index(const char *, int);
+static struct enum_list *parse_enumlist(FILE *, struct enum_list **);
+static struct range_list *parse_ranges(FILE * fp, struct range_list **);
+static struct node *parse_asntype(FILE *, char *, int *, char *);
+static struct node *parse_objecttype(FILE *, char *);
+static struct node *parse_objectgroup(FILE *, char *, int,
+ struct objgroup **);
+static struct node *parse_notificationDefinition(FILE *, char *);
+static struct node *parse_trapDefinition(FILE *, char *);
+static struct node *parse_compliance(FILE *, char *);
+static struct node *parse_capabilities(FILE *, char *);
+static struct node *parse_moduleIdentity(FILE *, char *);
+static struct node *parse_macro(FILE *, char *);
+static void parse_imports(FILE *);
+static struct node *parse(FILE *, struct node *);
+
+static int read_module_internal(const char *);
+static int read_module_replacements(const char *);
+static int read_import_replacements(const char *,
+ struct module_import *);
+
+static void new_module(const char *, const char *);
+
+static struct node *merge_parse_objectid(struct node *, FILE *, char *);
+static struct index_list *getIndexes(FILE * fp, struct index_list **);
+static struct varbind_list *getVarbinds(FILE * fp, struct varbind_list **);
+static void free_indexes(struct index_list **);
+static void free_varbinds(struct varbind_list **);
+static void free_ranges(struct range_list **);
+static void free_enums(struct enum_list **);
+static struct range_list *copy_ranges(struct range_list *);
+static struct enum_list *copy_enums(struct enum_list *);
+
+static u_int compute_match(const char *search_base, const char *key);
+
+void
+snmp_mib_toggle_options_usage(const char *lead, FILE * outf)
+{
+ fprintf(outf, "%su: %sallow the use of underlines in MIB symbols\n",
+ lead, ((netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_PARSE_LABEL)) ?
+ "dis" : ""));
+ fprintf(outf, "%sc: %sallow the use of \"--\" to terminate comments\n",
+ lead, ((netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_COMMENT_TERM)) ?
+ "" : "dis"));
+
+ fprintf(outf, "%sd: %ssave the DESCRIPTIONs of the MIB objects\n",
+ lead, ((netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS)) ?
+ "do not " : ""));
+
+ fprintf(outf, "%se: disable errors when MIB symbols conflict\n", lead);
+
+ fprintf(outf, "%sw: enable warnings when MIB symbols conflict\n", lead);
+
+ fprintf(outf, "%sW: enable detailed warnings when MIB symbols conflict\n",
+ lead);
+
+ fprintf(outf, "%sR: replace MIB symbols from latest module\n", lead);
+}
+
+char *
+snmp_mib_toggle_options(char *options)
+{
+ if (options) {
+ while (*options) {
+ switch (*options) {
+ case 'u':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_PARSE_LABEL,
+ !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_PARSE_LABEL));
+ break;
+
+ case 'c':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_COMMENT_TERM);
+ break;
+
+ case 'e':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_ERRORS);
+ break;
+
+ case 'w':
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS, 1);
+ break;
+
+ case 'W':
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS, 2);
+ break;
+
+ case 'd':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS);
+ break;
+
+ case 'R':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_REPLACE);
+ break;
+
+ default:
+ /*
+ * return at the unknown option
+ */
+ return options;
+ }
+ options++;
+ }
+ }
+ return NULL;
+}
+
+static int
+name_hash(const char *name)
+{
+ int hash = 0;
+ const char *cp;
+
+ if (!name)
+ return 0;
+ for (cp = name; *cp; cp++)
+ hash += tolower((unsigned char)(*cp));
+ return (hash);
+}
+
+void
+netsnmp_init_mib_internals(void)
+{
+ register struct tok *tp;
+ register int b, i;
+ int max_modc;
+
+ if (tree_head)
+ return;
+
+ /*
+ * Set up hash list of pre-defined tokens
+ */
+ memset(buckets, 0, sizeof(buckets));
+ for (tp = tokens; tp->name; tp++) {
+ tp->hash = name_hash(tp->name);
+ b = BUCKET(tp->hash);
+ if (buckets[b])
+ tp->next = buckets[b]; /* BUG ??? */
+ buckets[b] = tp;
+ }
+
+ /*
+ * Initialise other internal structures
+ */
+
+ max_modc = sizeof(module_map) / sizeof(module_map[0]) - 1;
+ for (i = 0; i < max_modc; ++i)
+ module_map[i].next = &(module_map[i + 1]);
+ module_map[max_modc].next = NULL;
+ module_map_head = module_map;
+
+ memset(nbuckets, 0, sizeof(nbuckets));
+ memset(tbuckets, 0, sizeof(tbuckets));
+ memset(tclist, 0, MAXTC * sizeof(struct tc));
+ build_translation_table();
+ init_tree_roots(); /* Set up initial roots */
+ /*
+ * Relies on 'add_mibdir' having set up the modules
+ */
+}
+
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+void
+init_mib_internals(void)
+{
+ netsnmp_init_mib_internals();
+}
+#endif
+
+static void
+init_node_hash(struct node *nodes)
+{
+ struct node *np, *nextp;
+ int hash;
+
+ memset(nbuckets, 0, sizeof(nbuckets));
+ for (np = nodes; np;) {
+ nextp = np->next;
+ hash = NBUCKET(name_hash(np->parent));
+ np->next = nbuckets[hash];
+ nbuckets[hash] = np;
+ np = nextp;
+ }
+}
+
+static int erroneousMibs = 0;
+
+netsnmp_feature_child_of(parse_get_error_count, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_PARSE_GET_ERROR_COUNT
+int
+get_mib_parse_error_count(void)
+{
+ return erroneousMibs;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_PARSE_GET_ERROR_COUNT */
+
+
+static void
+print_error(const char *str, const char *token, int type)
+{
+ erroneousMibs++;
+ DEBUGMSGTL(("parse-mibs", "\n"));
+ if (type == ENDOFFILE)
+ snmp_log(LOG_ERR, "%s (EOF): At line %d in %s\n", str, mibLine,
+ File);
+ else if (token && *token)
+ snmp_log(LOG_ERR, "%s (%s): At line %d in %s\n", str, token,
+ mibLine, File);
+ else
+ snmp_log(LOG_ERR, "%s: At line %d in %s\n", str, mibLine, File);
+}
+
+static void
+print_module_not_found(const char *cp)
+{
+ if (first_err_module) {
+ snmp_log(LOG_ERR, "MIB search path: %s\n",
+ netsnmp_get_mib_directory());
+ first_err_module = 0;
+ }
+ if (!last_err_module || strcmp(cp, last_err_module))
+ print_error("Cannot find module", cp, CONTINUE);
+ if (last_err_module)
+ free(last_err_module);
+ last_err_module = strdup(cp);
+}
+
+static struct node *
+alloc_node(int modid)
+{
+ struct node *np;
+ np = (struct node *) calloc(1, sizeof(struct node));
+ if (np) {
+ np->tc_index = -1;
+ np->modid = modid;
+ np->filename = strdup(File);
+ np->lineno = mibLine;
+ }
+ return np;
+}
+
+static void
+unlink_tbucket(struct tree *tp)
+{
+ int hash = NBUCKET(name_hash(tp->label));
+ struct tree *otp = NULL, *ntp = tbuckets[hash];
+
+ while (ntp && ntp != tp) {
+ otp = ntp;
+ ntp = ntp->next;
+ }
+ if (!ntp)
+ snmp_log(LOG_EMERG, "Can't find %s in tbuckets\n", tp->label);
+ else if (otp)
+ otp->next = ntp->next;
+ else
+ tbuckets[hash] = tp->next;
+}
+
+static void
+unlink_tree(struct tree *tp)
+{
+ struct tree *otp = NULL, *ntp = tp->parent;
+
+ if (!ntp) { /* this tree has no parent */
+ DEBUGMSGTL(("unlink_tree", "Tree node %s has no parent\n",
+ tp->label));
+ } else {
+ ntp = ntp->child_list;
+
+ while (ntp && ntp != tp) {
+ otp = ntp;
+ ntp = ntp->next_peer;
+ }
+ if (!ntp)
+ snmp_log(LOG_EMERG, "Can't find %s in %s's children\n",
+ tp->label, tp->parent->label);
+ else if (otp)
+ otp->next_peer = ntp->next_peer;
+ else
+ tp->parent->child_list = tp->next_peer;
+ }
+
+ if (tree_head == tp)
+ tree_head = tp->next_peer;
+}
+
+static void
+free_partial_tree(struct tree *tp, int keep_label)
+{
+ if (!tp)
+ return;
+
+ /*
+ * remove the data from this tree node
+ */
+ free_enums(&tp->enums);
+ free_ranges(&tp->ranges);
+ free_indexes(&tp->indexes);
+ free_varbinds(&tp->varbinds);
+ if (!keep_label)
+ SNMP_FREE(tp->label);
+ SNMP_FREE(tp->hint);
+ SNMP_FREE(tp->units);
+ SNMP_FREE(tp->description);
+ SNMP_FREE(tp->reference);
+ SNMP_FREE(tp->augments);
+ SNMP_FREE(tp->defaultValue);
+}
+
+/*
+ * free a tree node. Note: the node must already have been unlinked
+ * from the tree when calling this routine
+ */
+static void
+free_tree(struct tree *Tree)
+{
+ if (!Tree)
+ return;
+
+ unlink_tbucket(Tree);
+ free_partial_tree(Tree, FALSE);
+ if (Tree->number_modules > 1)
+ free((char *) Tree->module_list);
+ free((char *) Tree);
+}
+
+static void
+free_node(struct node *np)
+{
+ if (!np)
+ return;
+
+ free_enums(&np->enums);
+ free_ranges(&np->ranges);
+ free_indexes(&np->indexes);
+ free_varbinds(&np->varbinds);
+ if (np->label)
+ free(np->label);
+ if (np->hint)
+ free(np->hint);
+ if (np->units)
+ free(np->units);
+ if (np->description)
+ free(np->description);
+ if (np->reference)
+ free(np->reference);
+ if (np->defaultValue)
+ free(np->defaultValue);
+ if (np->parent)
+ free(np->parent);
+ if (np->augments)
+ free(np->augments);
+ if (np->filename)
+ free(np->filename);
+ free((char *) np);
+}
+
+static void
+print_range_value(FILE * fp, int type, struct range_list * rp)
+{
+ switch (type) {
+ case TYPE_INTEGER:
+ case TYPE_INTEGER32:
+ if (rp->low == rp->high)
+ fprintf(fp, "%d", rp->low);
+ else
+ fprintf(fp, "%d..%d", rp->low, rp->high);
+ break;
+ case TYPE_UNSIGNED32:
+ case TYPE_OCTETSTR:
+ case TYPE_GAUGE:
+ case TYPE_UINTEGER:
+ if (rp->low == rp->high)
+ fprintf(fp, "%u", (unsigned)rp->low);
+ else
+ fprintf(fp, "%u..%u", (unsigned)rp->low, (unsigned)rp->high);
+ break;
+ default:
+ /* No other range types allowed */
+ break;
+ }
+}
+
+#ifdef TEST
+static void
+print_nodes(FILE * fp, struct node *root)
+{
+ struct enum_list *ep;
+ struct index_list *ip;
+ struct varbind_list *vp;
+ struct node *np;
+
+ for (np = root; np; np = np->next) {
+ fprintf(fp, "%s ::= { %s %ld } (%d)\n", np->label, np->parent,
+ np->subid, np->type);
+ if (np->tc_index >= 0)
+ fprintf(fp, " TC = %s\n", tclist[np->tc_index].descriptor);
+ if (np->enums) {
+ fprintf(fp, " Enums: \n");
+ for (ep = np->enums; ep; ep = ep->next) {
+ fprintf(fp, " %s(%d)\n", ep->label, ep->value);
+ }
+ }
+ if (np->ranges) {
+ struct range_list *rp;
+ fprintf(fp, " Ranges: ");
+ for (rp = np->ranges; rp; rp = rp->next) {
+ fprintf(fp, "\n ");
+ print_range_value(fp, np->type, rp);
+ }
+ fprintf(fp, "\n");
+ }
+ if (np->indexes) {
+ fprintf(fp, " Indexes: \n");
+ for (ip = np->indexes; ip; ip = ip->next) {
+ fprintf(fp, " %s\n", ip->ilabel);
+ }
+ }
+ if (np->augments)
+ fprintf(fp, " Augments: %s\n", np->augments);
+ if (np->varbinds) {
+ fprintf(fp, " Varbinds: \n");
+ for (vp = np->varbinds; vp; vp = vp->next) {
+ fprintf(fp, " %s\n", vp->vblabel);
+ }
+ }
+ if (np->hint)
+ fprintf(fp, " Hint: %s\n", np->hint);
+ if (np->units)
+ fprintf(fp, " Units: %s\n", np->units);
+ if (np->defaultValue)
+ fprintf(fp, " DefaultValue: %s\n", np->defaultValue);
+ }
+}
+#endif
+
+void
+print_subtree(FILE * f, struct tree *tree, int count)
+{
+ struct tree *tp;
+ int i;
+ char modbuf[256];
+
+ for (i = 0; i < count; i++)
+ fprintf(f, " ");
+ fprintf(f, "Children of %s(%ld):\n", tree->label, tree->subid);
+ count++;
+ for (tp = tree->child_list; tp; tp = tp->next_peer) {
+ for (i = 0; i < count; i++)
+ fprintf(f, " ");
+ fprintf(f, "%s:%s(%ld) type=%d",
+ module_name(tp->module_list[0], modbuf),
+ tp->label, tp->subid, tp->type);
+ if (tp->tc_index != -1)
+ fprintf(f, " tc=%d", tp->tc_index);
+ if (tp->hint)
+ fprintf(f, " hint=%s", tp->hint);
+ if (tp->units)
+ fprintf(f, " units=%s", tp->units);
+ if (tp->number_modules > 1) {
+ fprintf(f, " modules:");
+ for (i = 1; i < tp->number_modules; i++)
+ fprintf(f, " %s", module_name(tp->module_list[i], modbuf));
+ }
+ fprintf(f, "\n");
+ }
+ for (tp = tree->child_list; tp; tp = tp->next_peer) {
+ if (tp->child_list)
+ print_subtree(f, tp, count);
+ }
+}
+
+void
+print_ascii_dump_tree(FILE * f, struct tree *tree, int count)
+{
+ struct tree *tp;
+
+ count++;
+ for (tp = tree->child_list; tp; tp = tp->next_peer) {
+ fprintf(f, "%s OBJECT IDENTIFIER ::= { %s %ld }\n", tp->label,
+ tree->label, tp->subid);
+ }
+ for (tp = tree->child_list; tp; tp = tp->next_peer) {
+ if (tp->child_list)
+ print_ascii_dump_tree(f, tp, count);
+ }
+}
+
+static int translation_table[256];
+
+static void
+build_translation_table(void)
+{
+ int count;
+
+ for (count = 0; count < 256; count++) {
+ switch (count) {
+ case OBJID:
+ translation_table[count] = TYPE_OBJID;
+ break;
+ case OCTETSTR:
+ translation_table[count] = TYPE_OCTETSTR;
+ break;
+ case INTEGER:
+ translation_table[count] = TYPE_INTEGER;
+ break;
+ case NETADDR:
+ translation_table[count] = TYPE_NETADDR;
+ break;
+ case IPADDR:
+ translation_table[count] = TYPE_IPADDR;
+ break;
+ case COUNTER:
+ translation_table[count] = TYPE_COUNTER;
+ break;
+ case GAUGE:
+ translation_table[count] = TYPE_GAUGE;
+ break;
+ case TIMETICKS:
+ translation_table[count] = TYPE_TIMETICKS;
+ break;
+ case KW_OPAQUE:
+ translation_table[count] = TYPE_OPAQUE;
+ break;
+ case NUL:
+ translation_table[count] = TYPE_NULL;
+ break;
+ case COUNTER64:
+ translation_table[count] = TYPE_COUNTER64;
+ break;
+ case BITSTRING:
+ translation_table[count] = TYPE_BITSTRING;
+ break;
+ case NSAPADDRESS:
+ translation_table[count] = TYPE_NSAPADDRESS;
+ break;
+ case INTEGER32:
+ translation_table[count] = TYPE_INTEGER32;
+ break;
+ case UINTEGER32:
+ translation_table[count] = TYPE_UINTEGER;
+ break;
+ case UNSIGNED32:
+ translation_table[count] = TYPE_UNSIGNED32;
+ break;
+ case TRAPTYPE:
+ translation_table[count] = TYPE_TRAPTYPE;
+ break;
+ case NOTIFTYPE:
+ translation_table[count] = TYPE_NOTIFTYPE;
+ break;
+ case NOTIFGROUP:
+ translation_table[count] = TYPE_NOTIFGROUP;
+ break;
+ case OBJGROUP:
+ translation_table[count] = TYPE_OBJGROUP;
+ break;
+ case MODULEIDENTITY:
+ translation_table[count] = TYPE_MODID;
+ break;
+ case OBJIDENTITY:
+ translation_table[count] = TYPE_OBJIDENTITY;
+ break;
+ case AGENTCAP:
+ translation_table[count] = TYPE_AGENTCAP;
+ break;
+ case COMPLIANCE:
+ translation_table[count] = TYPE_MODCOMP;
+ break;
+ default:
+ translation_table[count] = TYPE_OTHER;
+ break;
+ }
+ }
+}
+
+static void
+init_tree_roots(void)
+{
+ struct tree *tp, *lasttp;
+ int base_modid;
+ int hash;
+
+ base_modid = which_module("SNMPv2-SMI");
+ if (base_modid == -1)
+ base_modid = which_module("RFC1155-SMI");
+ if (base_modid == -1)
+ base_modid = which_module("RFC1213-MIB");
+
+ /*
+ * build root node
+ */
+ tp = (struct tree *) calloc(1, sizeof(struct tree));
+ if (tp == NULL)
+ return;
+ tp->label = strdup("joint-iso-ccitt");
+ tp->modid = base_modid;
+ tp->number_modules = 1;
+ tp->module_list = &(tp->modid);
+ tp->subid = 2;
+ tp->tc_index = -1;
+ set_function(tp); /* from mib.c */
+ hash = NBUCKET(name_hash(tp->label));
+ tp->next = tbuckets[hash];
+ tbuckets[hash] = tp;
+ lasttp = tp;
+ root_imports[0].label = strdup(tp->label);
+ root_imports[0].modid = base_modid;
+
+ /*
+ * build root node
+ */
+ tp = (struct tree *) calloc(1, sizeof(struct tree));
+ if (tp == NULL)
+ return;
+ tp->next_peer = lasttp;
+ tp->label = strdup("ccitt");
+ tp->modid = base_modid;
+ tp->number_modules = 1;
+ tp->module_list = &(tp->modid);
+ tp->subid = 0;
+ tp->tc_index = -1;
+ set_function(tp); /* from mib.c */
+ hash = NBUCKET(name_hash(tp->label));
+ tp->next = tbuckets[hash];
+ tbuckets[hash] = tp;
+ lasttp = tp;
+ root_imports[1].label = strdup(tp->label);
+ root_imports[1].modid = base_modid;
+
+ /*
+ * build root node
+ */
+ tp = (struct tree *) calloc(1, sizeof(struct tree));
+ if (tp == NULL)
+ return;
+ tp->next_peer = lasttp;
+ tp->label = strdup("iso");
+ tp->modid = base_modid;
+ tp->number_modules = 1;
+ tp->module_list = &(tp->modid);
+ tp->subid = 1;
+ tp->tc_index = -1;
+ set_function(tp); /* from mib.c */
+ hash = NBUCKET(name_hash(tp->label));
+ tp->next = tbuckets[hash];
+ tbuckets[hash] = tp;
+ lasttp = tp;
+ root_imports[2].label = strdup(tp->label);
+ root_imports[2].modid = base_modid;
+
+ tree_head = tp;
+}
+
+#ifdef STRICT_MIB_PARSEING
+#define label_compare strcasecmp
+#else
+#define label_compare strcmp
+#endif
+
+
+struct tree *
+find_tree_node(const char *name, int modid)
+{
+ struct tree *tp, *headtp;
+ int count, *int_p;
+
+ if (!name || !*name)
+ return (NULL);
+
+ headtp = tbuckets[NBUCKET(name_hash(name))];
+ for (tp = headtp; tp; tp = tp->next) {
+ if (tp->label && !label_compare(tp->label, name)) {
+
+ if (modid == -1) /* Any module */
+ return (tp);
+
+ for (int_p = tp->module_list, count = 0;
+ count < tp->number_modules; ++count, ++int_p)
+ if (*int_p == modid)
+ return (tp);
+ }
+ }
+
+ return (NULL);
+}
+
+/*
+ * computes a value which represents how close name1 is to name2.
+ * * high scores mean a worse match.
+ * * (yes, the algorithm sucks!)
+ */
+#define MAX_BAD 0xffffff
+
+static u_int
+compute_match(const char *search_base, const char *key)
+{
+#if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
+ int rc;
+ regex_t parsetree;
+ regmatch_t pmatch;
+ rc = regcomp(&parsetree, key, REG_ICASE | REG_EXTENDED);
+ if (rc == 0)
+ rc = regexec(&parsetree, search_base, 1, &pmatch, 0);
+ regfree(&parsetree);
+ if (rc == 0) {
+ /*
+ * found
+ */
+ return pmatch.rm_so;
+ }
+#else /* use our own wildcard matcher */
+ /*
+ * first find the longest matching substring (ick)
+ */
+ char *first = NULL, *result = NULL, *entry;
+ const char *position;
+ char *newkey = strdup(key);
+ char *st;
+
+
+ entry = strtok_r(newkey, "*", &st);
+ position = search_base;
+ while (entry) {
+ result = strcasestr(position, entry);
+
+ if (result == NULL) {
+ free(newkey);
+ return MAX_BAD;
+ }
+
+ if (first == NULL)
+ first = result;
+
+ position = result + strlen(entry);
+ entry = strtok_r(NULL, "*", &st);
+ }
+ free(newkey);
+ if (result)
+ return (first - search_base);
+#endif
+
+ /*
+ * not found
+ */
+ return MAX_BAD;
+}
+
+/*
+ * Find the tree node that best matches the pattern string.
+ * Use the "reported" flag such that only one match
+ * is attempted for every node.
+ *
+ * Warning! This function may recurse.
+ *
+ * Caller _must_ invoke clear_tree_flags before first call
+ * to this function. This function may be called multiple times
+ * to ensure that the entire tree is traversed.
+ */
+
+struct tree *
+find_best_tree_node(const char *pattrn, struct tree *tree_top,
+ u_int * match)
+{
+ struct tree *tp, *best_so_far = NULL, *retptr;
+ u_int old_match = MAX_BAD, new_match = MAX_BAD;
+
+ if (!pattrn || !*pattrn)
+ return (NULL);
+
+ if (!tree_top)
+ tree_top = get_tree_head();
+
+ for (tp = tree_top; tp; tp = tp->next_peer) {
+ if (!tp->reported && tp->label)
+ new_match = compute_match(tp->label, pattrn);
+ tp->reported = 1;
+
+ if (new_match < old_match) {
+ best_so_far = tp;
+ old_match = new_match;
+ }
+ if (new_match == 0)
+ break; /* this is the best result we can get */
+ if (tp->child_list) {
+ retptr =
+ find_best_tree_node(pattrn, tp->child_list, &new_match);
+ if (new_match < old_match) {
+ best_so_far = retptr;
+ old_match = new_match;
+ }
+ if (new_match == 0)
+ break; /* this is the best result we can get */
+ }
+ }
+ if (match)
+ *match = old_match;
+ return (best_so_far);
+}
+
+
+static void
+merge_anon_children(struct tree *tp1, struct tree *tp2)
+ /*
+ * NB: tp1 is the 'anonymous' node
+ */
+{
+ struct tree *child1, *child2, *previous;
+
+ for (child1 = tp1->child_list; child1;) {
+
+ for (child2 = tp2->child_list, previous = NULL;
+ child2; previous = child2, child2 = child2->next_peer) {
+
+ if (child1->subid == child2->subid) {
+ /*
+ * Found 'matching' children,
+ * so merge them
+ */
+ if (!strncmp(child1->label, ANON, ANON_LEN)) {
+ merge_anon_children(child1, child2);
+
+ child1->child_list = NULL;
+ previous = child1; /* Finished with 'child1' */
+ child1 = child1->next_peer;
+ free_tree(previous);
+ goto next;
+ }
+
+ else if (!strncmp(child2->label, ANON, ANON_LEN)) {
+ merge_anon_children(child2, child1);
+
+ if (previous)
+ previous->next_peer = child2->next_peer;
+ else
+ tp2->child_list = child2->next_peer;
+ free_tree(child2);
+
+ previous = child1; /* Move 'child1' to 'tp2' */
+ child1 = child1->next_peer;
+ previous->next_peer = tp2->child_list;
+ tp2->child_list = previous;
+ for (previous = tp2->child_list;
+ previous; previous = previous->next_peer)
+ previous->parent = tp2;
+ goto next;
+ } else if (!label_compare(child1->label, child2->label)) {
+ if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS)) {
+ snmp_log(LOG_WARNING,
+ "Warning: %s.%ld is both %s and %s (%s)\n",
+ tp2->label, child1->subid, child1->label,
+ child2->label, File);
+ }
+ continue;
+ } else {
+ /*
+ * Two copies of the same node.
+ * 'child2' adopts the children of 'child1'
+ */
+
+ if (child2->child_list) {
+ for (previous = child2->child_list; previous->next_peer; previous = previous->next_peer); /* Find the end of the list */
+ previous->next_peer = child1->child_list;
+ } else
+ child2->child_list = child1->child_list;
+ for (previous = child1->child_list;
+ previous; previous = previous->next_peer)
+ previous->parent = child2;
+ child1->child_list = NULL;
+
+ previous = child1; /* Finished with 'child1' */
+ child1 = child1->next_peer;
+ free_tree(previous);
+ goto next;
+ }
+ }
+ }
+ /*
+ * If no match, move 'child1' to 'tp2' child_list
+ */
+ if (child1) {
+ previous = child1;
+ child1 = child1->next_peer;
+ previous->parent = tp2;
+ previous->next_peer = tp2->child_list;
+ tp2->child_list = previous;
+ }
+ next:;
+ }
+}
+
+
+/*
+ * Find all the children of root in the list of nodes. Link them into the
+ * tree and out of the nodes list.
+ */
+static void
+do_subtree(struct tree *root, struct node **nodes)
+{
+ struct tree *tp, *anon_tp = NULL;
+ struct tree *xroot = root;
+ struct node *np, **headp;
+ struct node *oldnp = NULL, *child_list = NULL, *childp = NULL;
+ int hash;
+ int *int_p;
+
+ while (xroot->next_peer && xroot->next_peer->subid == root->subid) {
+#if 0
+ printf("xroot: %s.%s => %s\n", xroot->parent->label, xroot->label,
+ xroot->next_peer->label);
+#endif
+ xroot = xroot->next_peer;
+ }
+
+ tp = root;
+ headp = &nbuckets[NBUCKET(name_hash(tp->label))];
+ /*
+ * Search each of the nodes for one whose parent is root, and
+ * move each into a separate list.
+ */
+ for (np = *headp; np; np = np->next) {
+ if (!label_compare(tp->label, np->parent)) {
+ /*
+ * take this node out of the node list
+ */
+ if (oldnp == NULL) {
+ *headp = np->next; /* fix root of node list */
+ } else {
+ oldnp->next = np->next; /* link around this node */
+ }
+ if (child_list)
+ childp->next = np;
+ else
+ child_list = np;
+ childp = np;
+ } else {
+ oldnp = np;
+ }
+
+ }
+ if (childp)
+ childp->next = NULL;
+ /*
+ * Take each element in the child list and place it into the tree.
+ */
+ for (np = child_list; np; np = np->next) {
+ struct tree *otp = NULL;
+ struct tree *xxroot = xroot;
+ anon_tp = NULL;
+ tp = xroot->child_list;
+
+ if (np->subid == -1) {
+ /*
+ * name ::= { parent }
+ */
+ np->subid = xroot->subid;
+ tp = xroot;
+ xxroot = xroot->parent;
+ }
+
+ while (tp) {
+ if (tp->subid == np->subid)
+ break;
+ else {
+ otp = tp;
+ tp = tp->next_peer;
+ }
+ }
+ if (tp) {
+ if (!label_compare(tp->label, np->label)) {
+ /*
+ * Update list of modules
+ */
+ int_p =
+ (int *) malloc((tp->number_modules + 1) * sizeof(int));
+ if (int_p == NULL)
+ return;
+ memcpy(int_p, tp->module_list,
+ tp->number_modules * sizeof(int));
+ int_p[tp->number_modules] = np->modid;
+ if (tp->number_modules > 1)
+ free((char *) tp->module_list);
+ ++tp->number_modules;
+ tp->module_list = int_p;
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_REPLACE)) {
+ /*
+ * Replace from node
+ */
+ tree_from_node(tp, np);
+ }
+ /*
+ * Handle children
+ */
+ do_subtree(tp, nodes);
+ continue;
+ }
+ if (!strncmp(np->label, ANON, ANON_LEN) ||
+ !strncmp(tp->label, ANON, ANON_LEN)) {
+ anon_tp = tp; /* Need to merge these two trees later */
+ } else if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS)) {
+ snmp_log(LOG_WARNING,
+ "Warning: %s.%ld is both %s and %s (%s)\n",
+ root->label, np->subid, tp->label, np->label,
+ File);
+ }
+ }
+
+ tp = (struct tree *) calloc(1, sizeof(struct tree));
+ if (tp == NULL)
+ return;
+ tp->parent = xxroot;
+ tp->modid = np->modid;
+ tp->number_modules = 1;
+ tp->module_list = &(tp->modid);
+ tree_from_node(tp, np);
+ tp->next_peer = otp ? otp->next_peer : xxroot->child_list;
+ if (otp)
+ otp->next_peer = tp;
+ else
+ xxroot->child_list = tp;
+ hash = NBUCKET(name_hash(tp->label));
+ tp->next = tbuckets[hash];
+ tbuckets[hash] = tp;
+ do_subtree(tp, nodes);
+
+ if (anon_tp) {
+ if (!strncmp(tp->label, ANON, ANON_LEN)) {
+ /*
+ * The new node is anonymous,
+ * so merge it with the existing one.
+ */
+ merge_anon_children(tp, anon_tp);
+
+ /*
+ * unlink and destroy tp
+ */
+ unlink_tree(tp);
+ free_tree(tp);
+ } else if (!strncmp(anon_tp->label, ANON, ANON_LEN)) {
+ struct tree *ntp;
+ /*
+ * The old node was anonymous,
+ * so merge it with the existing one,
+ * and fill in the full information.
+ */
+ merge_anon_children(anon_tp, tp);
+
+ /*
+ * unlink anon_tp from the hash
+ */
+ unlink_tbucket(anon_tp);
+
+ /*
+ * get rid of old contents of anon_tp
+ */
+ free_partial_tree(anon_tp, FALSE);
+
+ /*
+ * put in the current information
+ */
+ anon_tp->label = tp->label;
+ anon_tp->child_list = tp->child_list;
+ anon_tp->modid = tp->modid;
+ anon_tp->tc_index = tp->tc_index;
+ anon_tp->type = tp->type;
+ anon_tp->enums = tp->enums;
+ anon_tp->indexes = tp->indexes;
+ anon_tp->augments = tp->augments;
+ anon_tp->varbinds = tp->varbinds;
+ anon_tp->ranges = tp->ranges;
+ anon_tp->hint = tp->hint;
+ anon_tp->units = tp->units;
+ anon_tp->description = tp->description;
+ anon_tp->reference = tp->reference;
+ anon_tp->defaultValue = tp->defaultValue;
+ anon_tp->parent = tp->parent;
+
+ set_function(anon_tp);
+
+ /*
+ * update parent pointer in moved children
+ */
+ ntp = anon_tp->child_list;
+ while (ntp) {
+ ntp->parent = anon_tp;
+ ntp = ntp->next_peer;
+ }
+
+ /*
+ * hash in anon_tp in its new place
+ */
+ hash = NBUCKET(name_hash(anon_tp->label));
+ anon_tp->next = tbuckets[hash];
+ tbuckets[hash] = anon_tp;
+
+ /*
+ * unlink and destroy tp
+ */
+ unlink_tbucket(tp);
+ unlink_tree(tp);
+ free(tp);
+ } else {
+ /*
+ * Uh? One of these two should have been anonymous!
+ */
+ if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS)) {
+ snmp_log(LOG_WARNING,
+ "Warning: expected anonymous node (either %s or %s) in %s\n",
+ tp->label, anon_tp->label, File);
+ }
+ }
+ anon_tp = NULL;
+ }
+ }
+ /*
+ * free all nodes that were copied into tree
+ */
+ oldnp = NULL;
+ for (np = child_list; np; np = np->next) {
+ if (oldnp)
+ free_node(oldnp);
+ oldnp = np;
+ }
+ if (oldnp)
+ free_node(oldnp);
+}
+
+static void
+do_linkup(struct module *mp, struct node *np)
+{
+ struct module_import *mip;
+ struct node *onp, *oldp, *newp;
+ struct tree *tp;
+ int i, more;
+ /*
+ * All modules implicitly import
+ * the roots of the tree
+ */
+ if (snmp_get_do_debugging() > 1)
+ dump_module_list();
+ DEBUGMSGTL(("parse-mibs", "Processing IMPORTS for module %d %s\n",
+ mp->modid, mp->name));
+ if (mp->no_imports == 0) {
+ mp->no_imports = NUMBER_OF_ROOT_NODES;
+ mp->imports = root_imports;
+ }
+
+ /*
+ * Build the tree
+ */
+ init_node_hash(np);
+ for (i = 0, mip = mp->imports; i < mp->no_imports; ++i, ++mip) {
+ char modbuf[256];
+ DEBUGMSGTL(("parse-mibs", " Processing import: %s\n",
+ mip->label));
+ if (get_tc_index(mip->label, mip->modid) != -1)
+ continue;
+ tp = find_tree_node(mip->label, mip->modid);
+ if (!tp) {
+ snmp_log(LOG_WARNING,
+ "Did not find '%s' in module %s (%s)\n",
+ mip->label, module_name(mip->modid, modbuf),
+ File);
+ continue;
+ }
+ do_subtree(tp, &np);
+ }
+
+ /*
+ * If any nodes left over,
+ * check that they're not the result of a "fully qualified"
+ * name, and then add them to the list of orphans
+ */
+
+ if (!np)
+ return;
+ for (tp = tree_head; tp; tp = tp->next_peer)
+ do_subtree(tp, &np);
+ if (!np)
+ return;
+
+ /*
+ * quietly move all internal references to the orphan list
+ */
+ oldp = orphan_nodes;
+ do {
+ for (i = 0; i < NHASHSIZE; i++)
+ for (onp = nbuckets[i]; onp; onp = onp->next) {
+ struct node *op = NULL;
+ int hash = NBUCKET(name_hash(onp->label));
+ np = nbuckets[hash];
+ while (np) {
+ if (label_compare(onp->label, np->parent)) {
+ op = np;
+ np = np->next;
+ } else {
+ if (op)
+ op->next = np->next;
+ else
+ nbuckets[hash] = np->next;
+ np->next = orphan_nodes;
+ orphan_nodes = np;
+ op = NULL;
+ np = nbuckets[hash];
+ }
+ }
+ }
+ newp = orphan_nodes;
+ more = 0;
+ for (onp = orphan_nodes; onp != oldp; onp = onp->next) {
+ struct node *op = NULL;
+ int hash = NBUCKET(name_hash(onp->label));
+ np = nbuckets[hash];
+ while (np) {
+ if (label_compare(onp->label, np->parent)) {
+ op = np;
+ np = np->next;
+ } else {
+ if (op)
+ op->next = np->next;
+ else
+ nbuckets[hash] = np->next;
+ np->next = orphan_nodes;
+ orphan_nodes = np;
+ op = NULL;
+ np = nbuckets[hash];
+ more = 1;
+ }
+ }
+ }
+ oldp = newp;
+ } while (more);
+
+ /*
+ * complain about left over nodes
+ */
+ for (np = orphan_nodes; np && np->next; np = np->next); /* find the end of the orphan list */
+ for (i = 0; i < NHASHSIZE; i++)
+ if (nbuckets[i]) {
+ if (orphan_nodes)
+ onp = np->next = nbuckets[i];
+ else
+ onp = orphan_nodes = nbuckets[i];
+ nbuckets[i] = NULL;
+ while (onp) {
+ snmp_log(LOG_WARNING,
+ "Unlinked OID in %s: %s ::= { %s %ld }\n",
+ (mp->name ? mp->name : "<no module>"),
+ (onp->label ? onp->label : "<no label>"),
+ (onp->parent ? onp->parent : "<no parent>"),
+ onp->subid);
+ snmp_log(LOG_WARNING,
+ "Undefined identifier: %s near line %d of %s\n",
+ (onp->parent ? onp->parent : "<no parent>"),
+ onp->lineno, onp->filename);
+ np = onp;
+ onp = onp->next;
+ }
+ }
+ return;
+}
+
+
+/*
+ * Takes a list of the form:
+ * { iso org(3) dod(6) 1 }
+ * and creates several nodes, one for each parent-child pair.
+ * Returns 0 on error.
+ */
+static int
+getoid(FILE * fp, struct subid_s *id, /* an array of subids */
+ int length)
+{ /* the length of the array */
+ register int count;
+ int type;
+ char token[MAXTOKEN];
+
+ if ((type = get_token(fp, token, MAXTOKEN)) != LEFTBRACKET) {
+ print_error("Expected \"{\"", token, type);
+ return 0;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ for (count = 0; count < length; count++, id++) {
+ id->label = NULL;
+ id->modid = current_module;
+ id->subid = -1;
+ if (type == RIGHTBRACKET)
+ return count;
+ if (type == LABEL) {
+ /*
+ * this entry has a label
+ */
+ id->label = strdup(token);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == LEFTPAREN) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == NUMBER) {
+ id->subid = strtoul(token, NULL, 10);
+ if ((type =
+ get_token(fp, token, MAXTOKEN)) != RIGHTPAREN) {
+ print_error("Expected a closing parenthesis",
+ token, type);
+ return 0;
+ }
+ } else {
+ print_error("Expected a number", token, type);
+ return 0;
+ }
+ } else {
+ continue;
+ }
+ } else if (type == NUMBER) {
+ /*
+ * this entry has just an integer sub-identifier
+ */
+ id->subid = strtoul(token, NULL, 10);
+ } else {
+ print_error("Expected label or number", token, type);
+ return 0;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ print_error("Too long OID", token, type);
+ return 0;
+}
+
+/*
+ * Parse a sequence of object subidentifiers for the given name.
+ * The "label OBJECT IDENTIFIER ::=" portion has already been parsed.
+ *
+ * The majority of cases take this form :
+ * label OBJECT IDENTIFIER ::= { parent 2 }
+ * where a parent label and a child subidentifier number are specified.
+ *
+ * Variations on the theme include cases where a number appears with
+ * the parent, or intermediate subidentifiers are specified by label,
+ * by number, or both.
+ *
+ * Here are some representative samples :
+ * internet OBJECT IDENTIFIER ::= { iso org(3) dod(6) 1 }
+ * mgmt OBJECT IDENTIFIER ::= { internet 2 }
+ * rptrInfoHealth OBJECT IDENTIFIER ::= { snmpDot3RptrMgt 0 4 }
+ *
+ * Here is a very rare form :
+ * iso OBJECT IDENTIFIER ::= { 1 }
+ *
+ * Returns NULL on error. When this happens, memory may be leaked.
+ */
+static struct node *
+parse_objectid(FILE * fp, char *name)
+{
+ register int count;
+ register struct subid_s *op, *nop;
+ int length;
+ struct subid_s loid[32];
+ struct node *np, *root = NULL, *oldnp = NULL;
+ struct tree *tp;
+
+ if ((length = getoid(fp, loid, 32)) == 0) {
+ print_error("Bad object identifier", NULL, CONTINUE);
+ return NULL;
+ }
+
+ /*
+ * Handle numeric-only object identifiers,
+ * by labelling the first sub-identifier
+ */
+ op = loid;
+ if (!op->label) {
+ if (length == 1) {
+ print_error("Attempt to define a root oid", name, OBJECT);
+ return NULL;
+ }
+ for (tp = tree_head; tp; tp = tp->next_peer)
+ if ((int) tp->subid == op->subid) {
+ op->label = strdup(tp->label);
+ break;
+ }
+ }
+
+ /*
+ * Handle "label OBJECT-IDENTIFIER ::= { subid }"
+ */
+ if (length == 1) {
+ op = loid;
+ np = alloc_node(op->modid);
+ if (np == NULL)
+ return (NULL);
+ np->subid = op->subid;
+ np->label = strdup(name);
+ np->parent = op->label;
+ return np;
+ }
+
+ /*
+ * For each parent-child subid pair in the subid array,
+ * create a node and link it into the node list.
+ */
+ for (count = 0, op = loid, nop = loid + 1; count < (length - 1);
+ count++, op++, nop++) {
+ /*
+ * every node must have parent's name and child's name or number
+ */
+ /*
+ * XX the next statement is always true -- does it matter ??
+ */
+ if (op->label && (nop->label || (nop->subid != -1))) {
+ np = alloc_node(nop->modid);
+ if (np == NULL)
+ return (NULL);
+ if (root == NULL)
+ root = np;
+
+ np->parent = strdup(op->label);
+ if (count == (length - 2)) {
+ /*
+ * The name for this node is the label for this entry
+ */
+ np->label = strdup(name);
+ if (np->label == NULL) {
+ SNMP_FREE(np->parent);
+ SNMP_FREE(np);
+ return (NULL);
+ }
+ } else {
+ if (!nop->label) {
+ nop->label = (char *) malloc(20 + ANON_LEN);
+ if (nop->label == NULL) {
+ SNMP_FREE(np->parent);
+ SNMP_FREE(np);
+ return (NULL);
+ }
+ sprintf(nop->label, "%s%d", ANON, anonymous++);
+ }
+ np->label = strdup(nop->label);
+ }
+ if (nop->subid != -1)
+ np->subid = nop->subid;
+ else
+ print_error("Warning: This entry is pretty silly",
+ np->label, CONTINUE);
+
+ /*
+ * set up next entry
+ */
+ if (oldnp)
+ oldnp->next = np;
+ oldnp = np;
+ } /* end if(op->label... */
+ }
+
+ /*
+ * free the loid array
+ */
+ for (count = 0, op = loid; count < length; count++, op++) {
+ if (op->label)
+ free(op->label);
+ }
+
+ return root;
+}
+
+static int
+get_tc(const char *descriptor,
+ int modid,
+ int *tc_index,
+ struct enum_list **ep, struct range_list **rp, char **hint)
+{
+ int i;
+ struct tc *tcp;
+
+ i = get_tc_index(descriptor, modid);
+ if (tc_index)
+ *tc_index = i;
+ if (i != -1) {
+ tcp = &tclist[i];
+ if (ep) {
+ free_enums(ep);
+ *ep = copy_enums(tcp->enums);
+ }
+ if (rp) {
+ free_ranges(rp);
+ *rp = copy_ranges(tcp->ranges);
+ }
+ if (hint) {
+ if (*hint)
+ free(*hint);
+ *hint = (tcp->hint ? strdup(tcp->hint) : NULL);
+ }
+ return tcp->type;
+ }
+ return LABEL;
+}
+
+/*
+ * return index into tclist of given TC descriptor
+ * return -1 if not found
+ */
+static int
+get_tc_index(const char *descriptor, int modid)
+{
+ int i;
+ struct tc *tcp;
+ struct module *mp;
+ struct module_import *mip;
+
+ /*
+ * Check that the descriptor isn't imported
+ * by searching the import list
+ */
+
+ for (mp = module_head; mp; mp = mp->next)
+ if (mp->modid == modid)
+ break;
+ if (mp)
+ for (i = 0, mip = mp->imports; i < mp->no_imports; ++i, ++mip) {
+ if (!label_compare(mip->label, descriptor)) {
+ /*
+ * Found it - so amend the module ID
+ */
+ modid = mip->modid;
+ break;
+ }
+ }
+
+
+ for (i = 0, tcp = tclist; i < MAXTC; i++, tcp++) {
+ if (tcp->type == 0)
+ break;
+ if (!label_compare(descriptor, tcp->descriptor) &&
+ ((modid == tcp->modid) || (modid == -1))) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+/*
+ * translate integer tc_index to string identifier from tclist
+ * *
+ * * Returns pointer to string in table (should not be modified) or NULL
+ */
+const char *
+get_tc_descriptor(int tc_index)
+{
+ if (tc_index < 0 || tc_index >= MAXTC)
+ return NULL;
+ return (tclist[tc_index].descriptor);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_GET_TC_DESCRIPTION
+/* used in the perl module */
+const char *
+get_tc_description(int tc_index)
+{
+ if (tc_index < 0 || tc_index >= MAXTC)
+ return NULL;
+ return (tclist[tc_index].description);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_GET_TC_DESCRIPTION */
+
+
+/*
+ * Parses an enumeration list of the form:
+ * { label(value) label(value) ... }
+ * The initial { has already been parsed.
+ * Returns NULL on error.
+ */
+
+static struct enum_list *
+parse_enumlist(FILE * fp, struct enum_list **retp)
+{
+ register int type;
+ char token[MAXTOKEN];
+ struct enum_list *ep = NULL, **epp = &ep;
+
+ free_enums(retp);
+
+ while ((type = get_token(fp, token, MAXTOKEN)) != ENDOFFILE) {
+ if (type == RIGHTBRACKET)
+ break;
+ /* some enums use "deprecated" to indicate a no longer value label */
+ /* (EG: IP-MIB's IpAddressStatusTC) */
+ if (type == LABEL || type == DEPRECATED) {
+ /*
+ * this is an enumerated label
+ */
+ *epp =
+ (struct enum_list *) calloc(1, sizeof(struct enum_list));
+ if (*epp == NULL)
+ return (NULL);
+ /*
+ * a reasonable approximation for the length
+ */
+ (*epp)->label = strdup(token);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LEFTPAREN) {
+ print_error("Expected \"(\"", token, type);
+ return NULL;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != NUMBER) {
+ print_error("Expected integer", token, type);
+ return NULL;
+ }
+ (*epp)->value = strtol(token, NULL, 10);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != RIGHTPAREN) {
+ print_error("Expected \")\"", token, type);
+ return NULL;
+ }
+ epp = &(*epp)->next;
+ }
+ }
+ if (type == ENDOFFILE) {
+ print_error("Expected \"}\"", token, type);
+ return NULL;
+ }
+ *retp = ep;
+ return ep;
+}
+
+static struct range_list *
+parse_ranges(FILE * fp, struct range_list **retp)
+{
+ int low, high;
+ char nexttoken[MAXTOKEN];
+ int nexttype;
+ struct range_list *rp = NULL, **rpp = &rp;
+ int size = 0, taken = 1;
+
+ free_ranges(retp);
+
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ if (nexttype == SIZE) {
+ size = 1;
+ taken = 0;
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ if (nexttype != LEFTPAREN)
+ print_error("Expected \"(\" after SIZE", nexttoken, nexttype);
+ }
+
+ do {
+ if (!taken)
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ else
+ taken = 0;
+ high = low = strtoul(nexttoken, NULL, 10);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ if (nexttype == RANGE) {
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ errno = 0;
+ high = strtoul(nexttoken, NULL, 10);
+ if ( errno == ERANGE ) {
+ if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS))
+ snmp_log(LOG_WARNING,
+ "Warning: Upper bound not handled correctly (%s != %d): At line %d in %s\n",
+ nexttoken, high, mibLine, File);
+ }
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ }
+ *rpp = (struct range_list *) calloc(1, sizeof(struct range_list));
+ if (*rpp == NULL)
+ break;
+ (*rpp)->low = low;
+ (*rpp)->high = high;
+ rpp = &(*rpp)->next;
+
+ } while (nexttype == BAR);
+ if (size) {
+ if (nexttype != RIGHTPAREN)
+ print_error("Expected \")\" after SIZE", nexttoken, nexttype);
+ nexttype = get_token(fp, nexttoken, nexttype);
+ }
+ if (nexttype != RIGHTPAREN)
+ print_error("Expected \")\"", nexttoken, nexttype);
+
+ *retp = rp;
+ return rp;
+}
+
+/*
+ * Parses an asn type. Structures are ignored by this parser.
+ * Returns NULL on error.
+ */
+static struct node *
+parse_asntype(FILE * fp, char *name, int *ntype, char *ntoken)
+{
+ int type, i;
+ char token[MAXTOKEN];
+ char quoted_string_buffer[MAXQUOTESTR];
+ char *hint = NULL;
+ char *descr = NULL;
+ struct tc *tcp;
+ int level;
+
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == SEQUENCE || type == CHOICE) {
+ level = 0;
+ while ((type = get_token(fp, token, MAXTOKEN)) != ENDOFFILE) {
+ if (type == LEFTBRACKET) {
+ level++;
+ } else if (type == RIGHTBRACKET && --level == 0) {
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ return NULL;
+ }
+ }
+ print_error("Expected \"}\"", token, type);
+ return NULL;
+ } else if (type == LEFTBRACKET) {
+ struct node *np;
+ int ch_next = '{';
+ ungetc(ch_next, fp);
+ np = parse_objectid(fp, name);
+ if (np != NULL) {
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ return np;
+ }
+ return NULL;
+ } else if (type == LEFTSQBRACK) {
+ int size = 0;
+ do {
+ type = get_token(fp, token, MAXTOKEN);
+ } while (type != ENDOFFILE && type != RIGHTSQBRACK);
+ if (type != RIGHTSQBRACK) {
+ print_error("Expected \"]\"", token, type);
+ return NULL;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == IMPLICIT)
+ type = get_token(fp, token, MAXTOKEN);
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ if (*ntype == LEFTPAREN) {
+ switch (type) {
+ case OCTETSTR:
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ if (*ntype != SIZE) {
+ print_error("Expected SIZE", ntoken, *ntype);
+ return NULL;
+ }
+ size = 1;
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ if (*ntype != LEFTPAREN) {
+ print_error("Expected \"(\" after SIZE", ntoken,
+ *ntype);
+ return NULL;
+ }
+ /*
+ * fall through
+ */
+ case INTEGER:
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ do {
+ if (*ntype != NUMBER)
+ print_error("Expected NUMBER", ntoken, *ntype);
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ if (*ntype == RANGE) {
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ if (*ntype != NUMBER)
+ print_error("Expected NUMBER", ntoken, *ntype);
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ }
+ } while (*ntype == BAR);
+ if (*ntype != RIGHTPAREN) {
+ print_error("Expected \")\"", ntoken, *ntype);
+ return NULL;
+ }
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ if (size) {
+ if (*ntype != RIGHTPAREN) {
+ print_error("Expected \")\" to terminate SIZE",
+ ntoken, *ntype);
+ return NULL;
+ }
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ }
+ }
+ }
+ return NULL;
+ } else {
+ if (type == CONVENTION) {
+ while (type != SYNTAX && type != ENDOFFILE) {
+ if (type == DISPLAYHINT) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != QUOTESTRING)
+ print_error("DISPLAY-HINT must be string", token,
+ type);
+ else
+ hint = strdup(token);
+ } else if (type == DESCRIPTION &&
+ netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS)) {
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING)
+ print_error("DESCRIPTION must be string", token,
+ type);
+ else
+ descr = strdup(quoted_string_buffer);
+ } else
+ type =
+ get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == OBJECT) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != IDENTIFIER) {
+ print_error("Expected IDENTIFIER", token, type);
+ SNMP_FREE(hint);
+ return NULL;
+ }
+ type = OBJID;
+ }
+ } else if (type == OBJECT) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != IDENTIFIER) {
+ print_error("Expected IDENTIFIER", token, type);
+ return NULL;
+ }
+ type = OBJID;
+ }
+
+ if (type == LABEL) {
+ type = get_tc(token, current_module, NULL, NULL, NULL, NULL);
+ }
+
+ /*
+ * textual convention
+ */
+ for (i = 0; i < MAXTC; i++) {
+ if (tclist[i].type == 0)
+ break;
+ }
+
+ if (i == MAXTC) {
+ print_error("Too many textual conventions", token, type);
+ SNMP_FREE(hint);
+ return NULL;
+ }
+ if (!(type & SYNTAX_MASK)) {
+ print_error("Textual convention doesn't map to real type",
+ token, type);
+ SNMP_FREE(hint);
+ return NULL;
+ }
+ tcp = &tclist[i];
+ tcp->modid = current_module;
+ tcp->descriptor = strdup(name);
+ tcp->hint = hint;
+ tcp->description = descr;
+ tcp->type = type;
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ if (*ntype == LEFTPAREN) {
+ tcp->ranges = parse_ranges(fp, &tcp->ranges);
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ } else if (*ntype == LEFTBRACKET) {
+ /*
+ * if there is an enumeration list, parse it
+ */
+ tcp->enums = parse_enumlist(fp, &tcp->enums);
+ *ntype = get_token(fp, ntoken, MAXTOKEN);
+ }
+ return NULL;
+ }
+}
+
+
+/*
+ * Parses an OBJECT TYPE macro.
+ * Returns 0 on error.
+ */
+static struct node *
+parse_objecttype(FILE * fp, char *name)
+{
+ register int type;
+ char token[MAXTOKEN];
+ char nexttoken[MAXTOKEN];
+ char quoted_string_buffer[MAXQUOTESTR];
+ int nexttype, tctype;
+ register struct node *np;
+
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != SYNTAX) {
+ print_error("Bad format for OBJECT-TYPE", token, type);
+ return NULL;
+ }
+ np = alloc_node(current_module);
+ if (np == NULL)
+ return (NULL);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == OBJECT) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != IDENTIFIER) {
+ print_error("Expected IDENTIFIER", token, type);
+ free_node(np);
+ return NULL;
+ }
+ type = OBJID;
+ }
+ if (type == LABEL) {
+ int tmp_index;
+ tctype = get_tc(token, current_module, &tmp_index,
+ &np->enums, &np->ranges, &np->hint);
+ if (tctype == LABEL &&
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS) > 1) {
+ print_error("Warning: No known translation for type", token,
+ type);
+ }
+ type = tctype;
+ np->tc_index = tmp_index; /* store TC for later reference */
+ }
+ np->type = type;
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ switch (type) {
+ case SEQUENCE:
+ if (nexttype == OF) {
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+
+ }
+ break;
+ case INTEGER:
+ case INTEGER32:
+ case UINTEGER32:
+ case UNSIGNED32:
+ case COUNTER:
+ case GAUGE:
+ case BITSTRING:
+ case LABEL:
+ if (nexttype == LEFTBRACKET) {
+ /*
+ * if there is an enumeration list, parse it
+ */
+ np->enums = parse_enumlist(fp, &np->enums);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ } else if (nexttype == LEFTPAREN) {
+ /*
+ * if there is a range list, parse it
+ */
+ np->ranges = parse_ranges(fp, &np->ranges);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ }
+ break;
+ case OCTETSTR:
+ case KW_OPAQUE:
+ /*
+ * parse any SIZE specification
+ */
+ if (nexttype == LEFTPAREN) {
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ if (nexttype == SIZE) {
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ if (nexttype == LEFTPAREN) {
+ np->ranges = parse_ranges(fp, &np->ranges);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN); /* ) */
+ if (nexttype == RIGHTPAREN) {
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ break;
+ }
+ }
+ }
+ print_error("Bad SIZE syntax", token, type);
+ free_node(np);
+ return NULL;
+ }
+ break;
+ case OBJID:
+ case NETADDR:
+ case IPADDR:
+ case TIMETICKS:
+ case NUL:
+ case NSAPADDRESS:
+ case COUNTER64:
+ break;
+ default:
+ print_error("Bad syntax", token, type);
+ free_node(np);
+ return NULL;
+ }
+ if (nexttype == UNITS) {
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad UNITS", quoted_string_buffer, type);
+ free_node(np);
+ return NULL;
+ }
+ np->units = strdup(quoted_string_buffer);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ }
+ if (nexttype != ACCESS) {
+ print_error("Should be ACCESS", nexttoken, nexttype);
+ free_node(np);
+ return NULL;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != READONLY && type != READWRITE && type != WRITEONLY
+ && type != NOACCESS && type != READCREATE && type != ACCNOTIFY) {
+ print_error("Bad ACCESS type", token, type);
+ free_node(np);
+ return NULL;
+ }
+ np->access = type;
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != STATUS) {
+ print_error("Should be STATUS", token, type);
+ free_node(np);
+ return NULL;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != MANDATORY && type != CURRENT && type != KW_OPTIONAL &&
+ type != OBSOLETE && type != DEPRECATED) {
+ print_error("Bad STATUS", token, type);
+ free_node(np);
+ return NULL;
+ }
+ np->status = type;
+ /*
+ * Optional parts of the OBJECT-TYPE macro
+ */
+ type = get_token(fp, token, MAXTOKEN);
+ while (type != EQUALS && type != ENDOFFILE) {
+ switch (type) {
+ case DESCRIPTION:
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", quoted_string_buffer, type);
+ free_node(np);
+ return NULL;
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS)) {
+ np->description = strdup(quoted_string_buffer);
+ }
+ break;
+
+ case REFERENCE:
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad REFERENCE", quoted_string_buffer, type);
+ free_node(np);
+ return NULL;
+ }
+ np->reference = strdup(quoted_string_buffer);
+ break;
+ case INDEX:
+ if (np->augments) {
+ print_error("Cannot have both INDEX and AUGMENTS", token,
+ type);
+ free_node(np);
+ return NULL;
+ }
+ np->indexes = getIndexes(fp, &np->indexes);
+ if (np->indexes == NULL) {
+ print_error("Bad INDEX list", token, type);
+ free_node(np);
+ return NULL;
+ }
+ break;
+ case AUGMENTS:
+ if (np->indexes) {
+ print_error("Cannot have both INDEX and AUGMENTS", token,
+ type);
+ free_node(np);
+ return NULL;
+ }
+ np->indexes = getIndexes(fp, &np->indexes);
+ if (np->indexes == NULL) {
+ print_error("Bad AUGMENTS list", token, type);
+ free_node(np);
+ return NULL;
+ }
+ np->augments = strdup(np->indexes->ilabel);
+ free_indexes(&np->indexes);
+ break;
+ case DEFVAL:
+ /*
+ * Mark's defVal section
+ */
+ type = get_token(fp, quoted_string_buffer, MAXTOKEN);
+ if (type != LEFTBRACKET) {
+ print_error("Bad DEFAULTVALUE", quoted_string_buffer,
+ type);
+ free_node(np);
+ return NULL;
+ }
+
+ {
+ int level = 1;
+ char defbuf[512];
+
+ defbuf[0] = 0;
+ while (1) {
+ type = get_token(fp, quoted_string_buffer, MAXTOKEN);
+ if ((type == RIGHTBRACKET && --level == 0)
+ || type == ENDOFFILE)
+ break;
+ else if (type == LEFTBRACKET)
+ level++;
+ if (type == QUOTESTRING)
+ strlcat(defbuf, "\\\"", sizeof(defbuf));
+ strlcat(defbuf, quoted_string_buffer, sizeof(defbuf));
+ if (type == QUOTESTRING)
+ strlcat(defbuf, "\\\"", sizeof(defbuf));
+ strlcat(defbuf, " ", sizeof(defbuf));
+ }
+
+ if (type != RIGHTBRACKET) {
+ print_error("Bad DEFAULTVALUE", quoted_string_buffer,
+ type);
+ free_node(np);
+ return NULL;
+ }
+
+ defbuf[strlen(defbuf) - 1] = 0;
+ np->defaultValue = strdup(defbuf);
+ }
+
+ break;
+
+ case NUM_ENTRIES:
+ if (tossObjectIdentifier(fp) != OBJID) {
+ print_error("Bad Object Identifier", token, type);
+ free_node(np);
+ return NULL;
+ }
+ break;
+
+ default:
+ print_error("Bad format of optional clauses", token, type);
+ free_node(np);
+ return NULL;
+
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ if (type != EQUALS) {
+ print_error("Bad format", token, type);
+ free_node(np);
+ return NULL;
+ }
+ return merge_parse_objectid(np, fp, name);
+}
+
+/*
+ * Parses an OBJECT GROUP macro.
+ * Returns 0 on error.
+ *
+ * Also parses object-identity, since they are similar (ignore STATUS).
+ * - WJH 10/96
+ */
+static struct node *
+parse_objectgroup(FILE * fp, char *name, int what, struct objgroup **ol)
+{
+ int type;
+ char token[MAXTOKEN];
+ char quoted_string_buffer[MAXQUOTESTR];
+ struct node *np;
+
+ np = alloc_node(current_module);
+ if (np == NULL)
+ return (NULL);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == what) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LEFTBRACKET) {
+ print_error("Expected \"{\"", token, type);
+ goto skip;
+ }
+ do {
+ struct objgroup *o;
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LABEL) {
+ print_error("Bad identifier", token, type);
+ goto skip;
+ }
+ o = (struct objgroup *) malloc(sizeof(struct objgroup));
+ if (!o) {
+ print_error("Resource failure", token, type);
+ goto skip;
+ }
+ o->line = mibLine;
+ o->name = strdup(token);
+ o->next = *ol;
+ *ol = o;
+ type = get_token(fp, token, MAXTOKEN);
+ } while (type == COMMA);
+ if (type != RIGHTBRACKET) {
+ print_error("Expected \"}\" after list", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, type);
+ }
+ if (type != STATUS) {
+ print_error("Expected STATUS", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != CURRENT && type != DEPRECATED && type != OBSOLETE) {
+ print_error("Bad STATUS value", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != DESCRIPTION) {
+ print_error("Expected DESCRIPTION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", quoted_string_buffer, type);
+ free_node(np);
+ return NULL;
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS)) {
+ np->description = strdup(quoted_string_buffer);
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == REFERENCE) {
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad REFERENCE", quoted_string_buffer, type);
+ free_node(np);
+ return NULL;
+ }
+ np->reference = strdup(quoted_string_buffer);
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ if (type != EQUALS)
+ print_error("Expected \"::=\"", token, type);
+ skip:
+ while (type != EQUALS && type != ENDOFFILE)
+ type = get_token(fp, token, MAXTOKEN);
+
+ return merge_parse_objectid(np, fp, name);
+}
+
+/*
+ * Parses a NOTIFICATION-TYPE macro.
+ * Returns 0 on error.
+ */
+static struct node *
+parse_notificationDefinition(FILE * fp, char *name)
+{
+ register int type;
+ char token[MAXTOKEN];
+ char quoted_string_buffer[MAXQUOTESTR];
+ register struct node *np;
+
+ np = alloc_node(current_module);
+ if (np == NULL)
+ return (NULL);
+ type = get_token(fp, token, MAXTOKEN);
+ while (type != EQUALS && type != ENDOFFILE) {
+ switch (type) {
+ case DESCRIPTION:
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", quoted_string_buffer, type);
+ free_node(np);
+ return NULL;
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS)) {
+ np->description = strdup(quoted_string_buffer);
+ }
+ break;
+ case REFERENCE:
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad REFERENCE", quoted_string_buffer, type);
+ free_node(np);
+ return NULL;
+ }
+ np->reference = strdup(quoted_string_buffer);
+ break;
+ case OBJECTS:
+ np->varbinds = getVarbinds(fp, &np->varbinds);
+ if (!np->varbinds) {
+ print_error("Bad OBJECTS list", token, type);
+ free_node(np);
+ return NULL;
+ }
+ break;
+ default:
+ /*
+ * NOTHING
+ */
+ break;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ return merge_parse_objectid(np, fp, name);
+}
+
+/*
+ * Parses a TRAP-TYPE macro.
+ * Returns 0 on error.
+ */
+static struct node *
+parse_trapDefinition(FILE * fp, char *name)
+{
+ register int type;
+ char token[MAXTOKEN];
+ char quoted_string_buffer[MAXQUOTESTR];
+ register struct node *np;
+
+ np = alloc_node(current_module);
+ if (np == NULL)
+ return (NULL);
+ type = get_token(fp, token, MAXTOKEN);
+ while (type != EQUALS && type != ENDOFFILE) {
+ switch (type) {
+ case DESCRIPTION:
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", quoted_string_buffer, type);
+ free_node(np);
+ return NULL;
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS)) {
+ np->description = strdup(quoted_string_buffer);
+ }
+ break;
+ case REFERENCE:
+ /* I'm not sure REFERENCEs are legal in smiv1 traps??? */
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad REFERENCE", quoted_string_buffer, type);
+ free_node(np);
+ return NULL;
+ }
+ np->reference = strdup(quoted_string_buffer);
+ break;
+ case ENTERPRISE:
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == LEFTBRACKET) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LABEL) {
+ print_error("Bad Trap Format", token, type);
+ free_node(np);
+ return NULL;
+ }
+ np->parent = strdup(token);
+ /*
+ * Get right bracket
+ */
+ type = get_token(fp, token, MAXTOKEN);
+ } else if (type == LABEL) {
+ np->parent = strdup(token);
+ } else {
+ free_node(np);
+ return NULL;
+ }
+ break;
+ case VARIABLES:
+ np->varbinds = getVarbinds(fp, &np->varbinds);
+ if (!np->varbinds) {
+ print_error("Bad VARIABLES list", token, type);
+ free_node(np);
+ return NULL;
+ }
+ break;
+ default:
+ /*
+ * NOTHING
+ */
+ break;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ type = get_token(fp, token, MAXTOKEN);
+
+ np->label = strdup(name);
+
+ if (type != NUMBER) {
+ print_error("Expected a Number", token, type);
+ free_node(np);
+ return NULL;
+ }
+ np->subid = strtoul(token, NULL, 10);
+ np->next = alloc_node(current_module);
+ if (np->next == NULL) {
+ free_node(np);
+ return (NULL);
+ }
+
+ /* Catch the syntax error */
+ if (np->parent == NULL) {
+ free_node(np->next);
+ free_node(np);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return (NULL);
+ }
+
+ np->next->parent = np->parent;
+ np->parent = (char *) malloc(strlen(np->parent) + 2);
+ if (np->parent == NULL) {
+ free_node(np->next);
+ free_node(np);
+ return (NULL);
+ }
+ strcpy(np->parent, np->next->parent);
+ strcat(np->parent, "#");
+ np->next->label = strdup(np->parent);
+ return np;
+}
+
+
+/*
+ * Parses a compliance macro
+ * Returns 0 on error.
+ */
+static int
+eat_syntax(FILE * fp, char *token, int maxtoken)
+{
+ int type, nexttype;
+ struct node *np = alloc_node(current_module);
+ char nexttoken[MAXTOKEN];
+
+ if (!np)
+ return 0;
+
+ type = get_token(fp, token, maxtoken);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ switch (type) {
+ case INTEGER:
+ case INTEGER32:
+ case UINTEGER32:
+ case UNSIGNED32:
+ case COUNTER:
+ case GAUGE:
+ case BITSTRING:
+ case LABEL:
+ if (nexttype == LEFTBRACKET) {
+ /*
+ * if there is an enumeration list, parse it
+ */
+ np->enums = parse_enumlist(fp, &np->enums);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ } else if (nexttype == LEFTPAREN) {
+ /*
+ * if there is a range list, parse it
+ */
+ np->ranges = parse_ranges(fp, &np->ranges);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ }
+ break;
+ case OCTETSTR:
+ case KW_OPAQUE:
+ /*
+ * parse any SIZE specification
+ */
+ if (nexttype == LEFTPAREN) {
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ if (nexttype == SIZE) {
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ if (nexttype == LEFTPAREN) {
+ np->ranges = parse_ranges(fp, &np->ranges);
+ nexttype = get_token(fp, nexttoken, MAXTOKEN); /* ) */
+ if (nexttype == RIGHTPAREN) {
+ nexttype = get_token(fp, nexttoken, MAXTOKEN);
+ break;
+ }
+ }
+ }
+ print_error("Bad SIZE syntax", token, type);
+ free_node(np);
+ return nexttype;
+ }
+ break;
+ case OBJID:
+ case NETADDR:
+ case IPADDR:
+ case TIMETICKS:
+ case NUL:
+ case NSAPADDRESS:
+ case COUNTER64:
+ break;
+ default:
+ print_error("Bad syntax", token, type);
+ free_node(np);
+ return nexttype;
+ }
+ free_node(np);
+ return nexttype;
+}
+
+static int
+compliance_lookup(const char *name, int modid)
+{
+ if (modid == -1) {
+ struct objgroup *op =
+ (struct objgroup *) malloc(sizeof(struct objgroup));
+ if (!op)
+ return 0;
+ op->next = objgroups;
+ op->name = strdup(name);
+ op->line = mibLine;
+ objgroups = op;
+ return 1;
+ } else
+ return find_tree_node(name, modid) != NULL;
+}
+
+static struct node *
+parse_compliance(FILE * fp, char *name)
+{
+ int type;
+ char token[MAXTOKEN];
+ char quoted_string_buffer[MAXQUOTESTR];
+ struct node *np;
+
+ np = alloc_node(current_module);
+ if (np == NULL)
+ return (NULL);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != STATUS) {
+ print_error("Expected STATUS", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != CURRENT && type != DEPRECATED && type != OBSOLETE) {
+ print_error("Bad STATUS", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != DESCRIPTION) {
+ print_error("Expected DESCRIPTION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", quoted_string_buffer, type);
+ goto skip;
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS))
+ np->description = strdup(quoted_string_buffer);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == REFERENCE) {
+ type = get_token(fp, quoted_string_buffer, MAXTOKEN);
+ if (type != QUOTESTRING) {
+ print_error("Bad REFERENCE", quoted_string_buffer, type);
+ goto skip;
+ }
+ np->reference = strdup(quoted_string_buffer);
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ if (type != MODULE) {
+ print_error("Expected MODULE", token, type);
+ goto skip;
+ }
+ while (type == MODULE) {
+ int modid = -1;
+ char modname[MAXTOKEN];
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == LABEL
+ && strcmp(token, module_name(current_module, modname))) {
+ modid = read_module_internal(token);
+ if (modid != MODULE_LOADED_OK
+ && modid != MODULE_ALREADY_LOADED) {
+ print_error("Unknown module", token, type);
+ goto skip;
+ }
+ modid = which_module(token);
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ if (type == MANDATORYGROUPS) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LEFTBRACKET) {
+ print_error("Expected \"{\"", token, type);
+ goto skip;
+ }
+ do {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LABEL) {
+ print_error("Bad group name", token, type);
+ goto skip;
+ }
+ if (!compliance_lookup(token, modid))
+ print_error("Unknown group", token, type);
+ type = get_token(fp, token, MAXTOKEN);
+ } while (type == COMMA);
+ if (type != RIGHTBRACKET) {
+ print_error("Expected \"}\"", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ while (type == GROUP || type == OBJECT) {
+ if (type == GROUP) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LABEL) {
+ print_error("Bad group name", token, type);
+ goto skip;
+ }
+ if (!compliance_lookup(token, modid))
+ print_error("Unknown group", token, type);
+ type = get_token(fp, token, MAXTOKEN);
+ } else {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LABEL) {
+ print_error("Bad object name", token, type);
+ goto skip;
+ }
+ if (!compliance_lookup(token, modid))
+ print_error("Unknown group", token, type);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == SYNTAX)
+ type = eat_syntax(fp, token, MAXTOKEN);
+ if (type == WRSYNTAX)
+ type = eat_syntax(fp, token, MAXTOKEN);
+ if (type == MINACCESS) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != NOACCESS && type != ACCNOTIFY
+ && type != READONLY && type != WRITEONLY
+ && type != READCREATE && type != READWRITE) {
+ print_error("Bad MIN-ACCESS spec", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ }
+ if (type != DESCRIPTION) {
+ print_error("Expected DESCRIPTION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ }
+ skip:
+ while (type != EQUALS && type != ENDOFFILE)
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+
+ return merge_parse_objectid(np, fp, name);
+}
+
+
+/*
+ * Parses a capabilities macro
+ * Returns 0 on error.
+ */
+static struct node *
+parse_capabilities(FILE * fp, char *name)
+{
+ int type;
+ char token[MAXTOKEN];
+ char quoted_string_buffer[MAXQUOTESTR];
+ struct node *np;
+
+ np = alloc_node(current_module);
+ if (np == NULL)
+ return (NULL);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != PRODREL) {
+ print_error("Expected PRODUCT-RELEASE", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != QUOTESTRING) {
+ print_error("Expected STRING after PRODUCT-RELEASE", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != STATUS) {
+ print_error("Expected STATUS", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != CURRENT && type != OBSOLETE) {
+ print_error("STATUS should be current or obsolete", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != DESCRIPTION) {
+ print_error("Expected DESCRIPTION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, quoted_string_buffer, MAXTOKEN);
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", quoted_string_buffer, type);
+ goto skip;
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS)) {
+ np->description = strdup(quoted_string_buffer);
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == REFERENCE) {
+ type = get_token(fp, quoted_string_buffer, MAXTOKEN);
+ if (type != QUOTESTRING) {
+ print_error("Bad REFERENCE", quoted_string_buffer, type);
+ goto skip;
+ }
+ np->reference = strdup(quoted_string_buffer);
+ type = get_token(fp, token, type);
+ }
+ while (type == SUPPORTS) {
+ int modid;
+ struct tree *tp;
+
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LABEL) {
+ print_error("Bad module name", token, type);
+ goto skip;
+ }
+ modid = read_module_internal(token);
+ if (modid != MODULE_LOADED_OK && modid != MODULE_ALREADY_LOADED) {
+ print_error("Module not found", token, type);
+ goto skip;
+ }
+ modid = which_module(token);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != INCLUDES) {
+ print_error("Expected INCLUDES", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LEFTBRACKET) {
+ print_error("Expected \"{\"", token, type);
+ goto skip;
+ }
+ do {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LABEL) {
+ print_error("Expected group name", token, type);
+ goto skip;
+ }
+ tp = find_tree_node(token, modid);
+ if (!tp)
+ print_error("Group not found in module", token, type);
+ type = get_token(fp, token, MAXTOKEN);
+ } while (type == COMMA);
+ if (type != RIGHTBRACKET) {
+ print_error("Expected \"}\" after group list", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ while (type == VARIATION) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LABEL) {
+ print_error("Bad object name", token, type);
+ goto skip;
+ }
+ tp = find_tree_node(token, modid);
+ if (!tp)
+ print_error("Object not found in module", token, type);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == SYNTAX) {
+ type = eat_syntax(fp, token, MAXTOKEN);
+ }
+ if (type == WRSYNTAX) {
+ type = eat_syntax(fp, token, MAXTOKEN);
+ }
+ if (type == ACCESS) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != ACCNOTIFY && type != READONLY
+ && type != READWRITE && type != READCREATE
+ && type != WRITEONLY && type != NOTIMPL) {
+ print_error("Bad ACCESS", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ if (type == CREATEREQ) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LEFTBRACKET) {
+ print_error("Expected \"{\"", token, type);
+ goto skip;
+ }
+ do {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LABEL) {
+ print_error("Bad object name in list", token,
+ type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ } while (type == COMMA);
+ if (type != RIGHTBRACKET) {
+ print_error("Expected \"}\" after list", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ if (type == DEFVAL) {
+ int level = 1;
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LEFTBRACKET) {
+ print_error("Expected \"{\" after DEFVAL", token,
+ type);
+ goto skip;
+ }
+ do {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == LEFTBRACKET)
+ level++;
+ else if (type == RIGHTBRACKET)
+ level--;
+ } while (type != RIGHTBRACKET && type != ENDOFFILE
+ && level != 0);
+ if (type != RIGHTBRACKET) {
+ print_error("Missing \"}\" after DEFVAL", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ if (type != DESCRIPTION) {
+ print_error("Expected DESCRIPTION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, quoted_string_buffer, MAXTOKEN);
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", quoted_string_buffer, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ }
+ if (type != EQUALS)
+ print_error("Expected \"::=\"", token, type);
+ skip:
+ while (type != EQUALS && type != ENDOFFILE) {
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ }
+ return merge_parse_objectid(np, fp, name);
+}
+
+/*
+ * Parses a module identity macro
+ * Returns 0 on error.
+ */
+static void
+check_utc(const char *utc)
+{
+ int len, year, month, day, hour, minute;
+
+ len = strlen(utc);
+ if (utc[len - 1] != 'Z' && utc[len - 1] != 'z') {
+ print_error("Timestamp should end with Z", utc, QUOTESTRING);
+ return;
+ }
+ if (len == 11) {
+ len =
+ sscanf(utc, "%2d%2d%2d%2d%2dZ", &year, &month, &day, &hour,
+ &minute);
+ year += 1900;
+ } else if (len == 13)
+ len =
+ sscanf(utc, "%4d%2d%2d%2d%2dZ", &year, &month, &day, &hour,
+ &minute);
+ else {
+ print_error("Bad timestamp format (11 or 13 characters)",
+ utc, QUOTESTRING);
+ return;
+ }
+ if (len != 5) {
+ print_error("Bad timestamp format", utc, QUOTESTRING);
+ return;
+ }
+ if (month < 1 || month > 12)
+ print_error("Bad month in timestamp", utc, QUOTESTRING);
+ if (day < 1 || day > 31)
+ print_error("Bad day in timestamp", utc, QUOTESTRING);
+ if (hour < 0 || hour > 23)
+ print_error("Bad hour in timestamp", utc, QUOTESTRING);
+ if (minute < 0 || minute > 59)
+ print_error("Bad minute in timestamp", utc, QUOTESTRING);
+}
+
+static struct node *
+parse_moduleIdentity(FILE * fp, char *name)
+{
+ register int type;
+ char token[MAXTOKEN];
+ char quoted_string_buffer[MAXQUOTESTR];
+ register struct node *np;
+
+ np = alloc_node(current_module);
+ if (np == NULL)
+ return (NULL);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != LASTUPDATED) {
+ print_error("Expected LAST-UPDATED", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != QUOTESTRING) {
+ print_error("Need STRING for LAST-UPDATED", token, type);
+ goto skip;
+ }
+ check_utc(token);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != ORGANIZATION) {
+ print_error("Expected ORGANIZATION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != QUOTESTRING) {
+ print_error("Bad ORGANIZATION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != CONTACTINFO) {
+ print_error("Expected CONTACT-INFO", token, type);
+ goto skip;
+ }
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad CONTACT-INFO", quoted_string_buffer, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != DESCRIPTION) {
+ print_error("Expected DESCRIPTION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", quoted_string_buffer, type);
+ goto skip;
+ }
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS)) {
+ np->description = strdup(quoted_string_buffer);
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ while (type == REVISION) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != QUOTESTRING) {
+ print_error("Bad REVISION", token, type);
+ goto skip;
+ }
+ check_utc(token);
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != DESCRIPTION) {
+ print_error("Expected DESCRIPTION", token, type);
+ goto skip;
+ }
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ if (type != QUOTESTRING) {
+ print_error("Bad DESCRIPTION", quoted_string_buffer, type);
+ goto skip;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+ if (type != EQUALS)
+ print_error("Expected \"::=\"", token, type);
+ skip:
+ while (type != EQUALS && type != ENDOFFILE) {
+ type = get_token(fp, quoted_string_buffer, MAXQUOTESTR);
+ }
+ return merge_parse_objectid(np, fp, name);
+}
+
+
+/*
+ * Parses a MACRO definition
+ * Expect BEGIN, discard everything to end.
+ * Returns 0 on error.
+ */
+static struct node *
+parse_macro(FILE * fp, char *name)
+{
+ register int type;
+ char token[MAXTOKEN];
+ struct node *np;
+ int iLine = mibLine;
+
+ np = alloc_node(current_module);
+ if (np == NULL)
+ return (NULL);
+ type = get_token(fp, token, sizeof(token));
+ while (type != EQUALS && type != ENDOFFILE) {
+ type = get_token(fp, token, sizeof(token));
+ }
+ if (type != EQUALS) {
+ if (np)
+ free_node(np);
+ return NULL;
+ }
+ while (type != BEGIN && type != ENDOFFILE) {
+ type = get_token(fp, token, sizeof(token));
+ }
+ if (type != BEGIN) {
+ if (np)
+ free_node(np);
+ return NULL;
+ }
+ while (type != END && type != ENDOFFILE) {
+ type = get_token(fp, token, sizeof(token));
+ }
+ if (type != END) {
+ if (np)
+ free_node(np);
+ return NULL;
+ }
+
+ if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS)) {
+ snmp_log(LOG_WARNING,
+ "%s MACRO (lines %d..%d parsed and ignored).\n", name,
+ iLine, mibLine);
+ }
+
+ return np;
+}
+
+/*
+ * Parses a module import clause
+ * loading any modules referenced
+ */
+static void
+parse_imports(FILE * fp)
+{
+ register int type;
+ char token[MAXTOKEN];
+ char modbuf[256];
+#define MAX_IMPORTS 256
+ struct module_import import_list[MAX_IMPORTS];
+ int this_module;
+ struct module *mp;
+
+ int import_count = 0; /* Total number of imported descriptors */
+ int i = 0, old_i; /* index of first import from each module */
+
+ type = get_token(fp, token, MAXTOKEN);
+
+ /*
+ * Parse the IMPORTS clause
+ */
+ while (type != SEMI && type != ENDOFFILE) {
+ if (type == LABEL) {
+ if (import_count == MAX_IMPORTS) {
+ print_error("Too many imported symbols", token, type);
+ do {
+ type = get_token(fp, token, MAXTOKEN);
+ } while (type != SEMI && type != ENDOFFILE);
+ return;
+ }
+ import_list[import_count++].label = strdup(token);
+ } else if (type == FROM) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (import_count == i) { /* All imports are handled internally */
+ type = get_token(fp, token, MAXTOKEN);
+ continue;
+ }
+ this_module = which_module(token);
+
+ for (old_i = i; i < import_count; ++i)
+ import_list[i].modid = this_module;
+
+ /*
+ * Recursively read any pre-requisite modules
+ */
+ if (read_module_internal(token) == MODULE_NOT_FOUND) {
+ int found = 0;
+ for (; old_i < import_count; ++old_i) {
+ found += read_import_replacements(token, &import_list[old_i]);
+ }
+ if (!found)
+ print_module_not_found(token);
+ }
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+
+ /*
+ * Save the import information
+ * in the global module table
+ */
+ for (mp = module_head; mp; mp = mp->next)
+ if (mp->modid == current_module) {
+ if (import_count == 0)
+ return;
+ if (mp->imports && (mp->imports != root_imports)) {
+ /*
+ * this can happen if all modules are in one source file.
+ */
+ for (i = 0; i < mp->no_imports; ++i) {
+ DEBUGMSGTL(("parse-mibs",
+ "#### freeing Module %d '%s' %d\n",
+ mp->modid, mp->imports[i].label,
+ mp->imports[i].modid));
+ free((char *) mp->imports[i].label);
+ }
+ free((char *) mp->imports);
+ }
+ mp->imports = (struct module_import *)
+ calloc(import_count, sizeof(struct module_import));
+ if (mp->imports == NULL)
+ return;
+ for (i = 0; i < import_count; ++i) {
+ mp->imports[i].label = import_list[i].label;
+ mp->imports[i].modid = import_list[i].modid;
+ DEBUGMSGTL(("parse-mibs",
+ "#### adding Module %d '%s' %d\n", mp->modid,
+ mp->imports[i].label, mp->imports[i].modid));
+ }
+ mp->no_imports = import_count;
+ return;
+ }
+
+ /*
+ * Shouldn't get this far
+ */
+ print_module_not_found(module_name(current_module, modbuf));
+ return;
+}
+
+
+
+/*
+ * MIB module handling routines
+ */
+
+static void
+dump_module_list(void)
+{
+ struct module *mp = module_head;
+
+ DEBUGMSGTL(("parse-mibs", "Module list:\n"));
+ while (mp) {
+ DEBUGMSGTL(("parse-mibs", " %s %d %s %d\n", mp->name, mp->modid,
+ mp->file, mp->no_imports));
+ mp = mp->next;
+ }
+}
+
+int
+which_module(const char *name)
+{
+ struct module *mp;
+
+ for (mp = module_head; mp; mp = mp->next)
+ if (!label_compare(mp->name, name))
+ return (mp->modid);
+
+ DEBUGMSGTL(("parse-mibs", "Module %s not found\n", name));
+ return (-1);
+}
+
+/*
+ * module_name - copy module name to user buffer, return ptr to same.
+ */
+char *
+module_name(int modid, char *cp)
+{
+ struct module *mp;
+
+ for (mp = module_head; mp; mp = mp->next)
+ if (mp->modid == modid) {
+ strcpy(cp, mp->name);
+ return (cp);
+ }
+
+ if (modid != -1) DEBUGMSGTL(("parse-mibs", "Module %d not found\n", modid));
+ sprintf(cp, "#%d", modid);
+ return (cp);
+}
+
+/*
+ * Backwards compatability
+ * Read newer modules that replace the one specified:-
+ * either all of them (read_module_replacements),
+ * or those relating to a specified identifier (read_import_replacements)
+ * plus an interface to add new replacement requirements
+ */
+netsnmp_feature_child_of(parse_add_module_replacement, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_PARSE_ADD_MODULE_REPLACEMENT
+void
+add_module_replacement(const char *old_module,
+ const char *new_module_name,
+ const char *tag, int len)
+{
+ struct module_compatability *mcp;
+
+ mcp = (struct module_compatability *)
+ calloc(1, sizeof(struct module_compatability));
+ if (mcp == NULL)
+ return;
+
+ mcp->old_module = strdup(old_module);
+ mcp->new_module = strdup(new_module_name);
+ if (tag)
+ mcp->tag = strdup(tag);
+ mcp->tag_len = len;
+
+ mcp->next = module_map_head;
+ module_map_head = mcp;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_PARSE_ADD_MODULE_REPLACEMENT */
+
+static int
+read_module_replacements(const char *name)
+{
+ struct module_compatability *mcp;
+
+ for (mcp = module_map_head; mcp; mcp = mcp->next) {
+ if (!label_compare(mcp->old_module, name)) {
+ if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS)) {
+ snmp_log(LOG_WARNING,
+ "Loading replacement module %s for %s (%s)\n",
+ mcp->new_module, name, File);
+ }
+ (void) netsnmp_read_module(mcp->new_module);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static int
+read_import_replacements(const char *old_module_name,
+ struct module_import *identifier)
+{
+ struct module_compatability *mcp;
+
+ /*
+ * Look for matches first
+ */
+ for (mcp = module_map_head; mcp; mcp = mcp->next) {
+ if (!label_compare(mcp->old_module, old_module_name)) {
+
+ if ( /* exact match */
+ (mcp->tag_len == 0 &&
+ (mcp->tag == NULL ||
+ !label_compare(mcp->tag, identifier->label))) ||
+ /*
+ * prefix match
+ */
+ (mcp->tag_len != 0 &&
+ !strncmp(mcp->tag, identifier->label, mcp->tag_len))
+ ) {
+
+ if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS)) {
+ snmp_log(LOG_WARNING,
+ "Importing %s from replacement module %s instead of %s (%s)\n",
+ identifier->label, mcp->new_module,
+ old_module_name, File);
+ }
+ (void) netsnmp_read_module(mcp->new_module);
+ identifier->modid = which_module(mcp->new_module);
+ return 1; /* finished! */
+ }
+ }
+ }
+
+ /*
+ * If no exact match, load everything relevant
+ */
+ return read_module_replacements(old_module_name);
+}
+
+
+/*
+ * Read in the named module
+ * Returns the root of the whole tree
+ * (by analogy with 'read_mib')
+ */
+static int
+read_module_internal(const char *name)
+{
+ struct module *mp;
+ FILE *fp;
+ struct node *np;
+
+ netsnmp_init_mib_internals();
+
+ for (mp = module_head; mp; mp = mp->next)
+ if (!label_compare(mp->name, name)) {
+ const char *oldFile = File;
+ int oldLine = mibLine;
+ int oldModule = current_module;
+
+ if (mp->no_imports != -1) {
+ DEBUGMSGTL(("parse-mibs", "Module %s already loaded\n",
+ name));
+ return MODULE_ALREADY_LOADED;
+ }
+ if ((fp = fopen(mp->file, "r")) == NULL) {
+ int rval;
+ if (errno == ENOTDIR || errno == ENOENT)
+ rval = MODULE_NOT_FOUND;
+ else
+ rval = MODULE_LOAD_FAILED;
+ snmp_log_perror(mp->file);
+ return rval;
+ }
+#ifdef HAVE_FLOCKFILE
+ flockfile(fp);
+#endif
+ mp->no_imports = 0; /* Note that we've read the file */
+ File = mp->file;
+ mibLine = 1;
+ current_module = mp->modid;
+ /*
+ * Parse the file
+ */
+ np = parse(fp, NULL);
+#ifdef HAVE_FUNLOCKFILE
+ funlockfile(fp);
+#endif
+ fclose(fp);
+ File = oldFile;
+ mibLine = oldLine;
+ current_module = oldModule;
+ if ((np == NULL) && (gMibError == MODULE_SYNTAX_ERROR) )
+ return MODULE_SYNTAX_ERROR;
+ return MODULE_LOADED_OK;
+ }
+
+ return MODULE_NOT_FOUND;
+}
+
+void
+adopt_orphans(void)
+{
+ struct node *np, *onp;
+ struct tree *tp;
+ int i, adopted = 1;
+
+ if (!orphan_nodes)
+ return;
+ init_node_hash(orphan_nodes);
+ orphan_nodes = NULL;
+
+ while (adopted) {
+ adopted = 0;
+ for (i = 0; i < NHASHSIZE; i++)
+ if (nbuckets[i]) {
+ for (np = nbuckets[i]; np != NULL; np = np->next) {
+ tp = find_tree_node(np->parent, -1);
+ if (tp) {
+ do_subtree(tp, &np);
+ adopted = 1;
+ /*
+ * if do_subtree adopted the entire bucket, stop
+ */
+ if(NULL == nbuckets[i])
+ break;
+
+ /*
+ * do_subtree may modify nbuckets, and if np
+ * was adopted, np->next probably isn't an orphan
+ * anymore. if np is still in the bucket (do_subtree
+ * didn't adopt it) keep on plugging. otherwise
+ * start over, at the top of the bucket.
+ */
+ for(onp = nbuckets[i]; onp; onp = onp->next)
+ if(onp == np)
+ break;
+ if(NULL == onp) { /* not in the list */
+ np = nbuckets[i]; /* start over */
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * Report on outstanding orphans
+ * and link them back into the orphan list
+ */
+ for (i = 0; i < NHASHSIZE; i++)
+ if (nbuckets[i]) {
+ if (orphan_nodes)
+ onp = np->next = nbuckets[i];
+ else
+ onp = orphan_nodes = nbuckets[i];
+ nbuckets[i] = NULL;
+ while (onp) {
+ char modbuf[256];
+ snmp_log(LOG_WARNING,
+ "Cannot adopt OID in %s: %s ::= { %s %ld }\n",
+ module_name(onp->modid, modbuf),
+ (onp->label ? onp->label : "<no label>"),
+ (onp->parent ? onp->parent : "<no parent>"),
+ onp->subid);
+
+ np = onp;
+ onp = onp->next;
+ }
+ }
+}
+
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+struct tree *
+read_module(const char *name)
+{
+ return netsnmp_read_module(name);
+}
+#endif
+
+struct tree *
+netsnmp_read_module(const char *name)
+{
+ int status = 0;
+ status = read_module_internal(name);
+
+ if (status == MODULE_NOT_FOUND) {
+ if (!read_module_replacements(name))
+ print_module_not_found(name);
+ } else if (status == MODULE_SYNTAX_ERROR) {
+ gMibError = 0;
+ gLoop = 1;
+
+ strncat(gMibNames, " ", sizeof(gMibNames) - strlen(gMibNames) - 1);
+ strncat(gMibNames, name, sizeof(gMibNames) - strlen(gMibNames) - 1);
+ }
+
+ return tree_head;
+}
+
+/*
+ * Prototype definition
+ */
+void unload_module_by_ID(int modID, struct tree *tree_top);
+
+void
+unload_module_by_ID(int modID, struct tree *tree_top)
+{
+ struct tree *tp, *next;
+ int i;
+
+ for (tp = tree_top; tp; tp = next) {
+ /*
+ * Essentially, this is equivalent to the code fragment:
+ * if (tp->modID == modID)
+ * tp->number_modules--;
+ * but handles one tree node being part of several modules,
+ * and possible multiple copies of the same module ID.
+ */
+ int nmod = tp->number_modules;
+ if (nmod > 0) { /* in some module */
+ /*
+ * Remove all copies of this module ID
+ */
+ int cnt = 0, *pi1, *pi2 = tp->module_list;
+ for (i = 0, pi1 = pi2; i < nmod; i++, pi2++) {
+ if (*pi2 == modID)
+ continue;
+ cnt++;
+ *pi1++ = *pi2;
+ }
+ if (nmod != cnt) { /* in this module */
+ /*
+ * if ( (nmod - cnt) > 1)
+ * printf("Dup modid %d, %d times, '%s'\n", tp->modid, (nmod-cnt), tp->label); fflush(stdout); ?* XXDEBUG
+ */
+ tp->number_modules = cnt;
+ switch (cnt) {
+ case 0:
+ tp->module_list[0] = -1; /* Mark unused, and FALL THROUGH */
+
+ case 1: /* save the remaining module */
+ if (&(tp->modid) != tp->module_list) {
+ tp->modid = tp->module_list[0];
+ free(tp->module_list);
+ tp->module_list = &(tp->modid);
+ }
+ break;
+
+ default:
+ break;
+ }
+ } /* if tree node is in this module */
+ }
+ /*
+ * if tree node is in some module
+ */
+ next = tp->next_peer;
+
+
+ /*
+ * OK - that's dealt with *this* node.
+ * Now let's look at the children.
+ * (Isn't recursion wonderful!)
+ */
+ if (tp->child_list)
+ unload_module_by_ID(modID, tp->child_list);
+
+
+ if (tp->number_modules == 0) {
+ /*
+ * This node isn't needed any more (except perhaps
+ * for the sake of the children)
+ */
+ if (tp->child_list == NULL) {
+ unlink_tree(tp);
+ free_tree(tp);
+ } else {
+ free_partial_tree(tp, TRUE);
+ }
+ }
+ }
+}
+
+#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
+int
+unload_module(const char *name)
+{
+ return netsnmp_unload_module(name);
+}
+#endif
+
+int
+netsnmp_unload_module(const char *name)
+{
+ struct module *mp;
+ int modID = -1;
+
+ for (mp = module_head; mp; mp = mp->next)
+ if (!label_compare(mp->name, name)) {
+ modID = mp->modid;
+ break;
+ }
+
+ if (modID == -1) {
+ DEBUGMSGTL(("unload-mib", "Module %s not found to unload\n",
+ name));
+ return MODULE_NOT_FOUND;
+ }
+ unload_module_by_ID(modID, tree_head);
+ mp->no_imports = -1; /* mark as unloaded */
+ return MODULE_LOADED_OK; /* Well, you know what I mean! */
+}
+
+/*
+ * Clear module map, tree nodes, textual convention table.
+ */
+void
+unload_all_mibs(void)
+{
+ struct module *mp;
+ struct module_compatability *mcp;
+ struct tc *ptc;
+ unsigned int i;
+
+ for (mcp = module_map_head; mcp; mcp = module_map_head) {
+ if (mcp == module_map)
+ break;
+ module_map_head = mcp->next;
+ if (mcp->tag) free(NETSNMP_REMOVE_CONST(char *, mcp->tag));
+ free(NETSNMP_REMOVE_CONST(char *, mcp->old_module));
+ free(NETSNMP_REMOVE_CONST(char *, mcp->new_module));
+ free(mcp);
+ }
+
+ for (mp = module_head; mp; mp = module_head) {
+ struct module_import *mi = mp->imports;
+ if (mi) {
+ for (i = 0; i < (unsigned int)mp->no_imports; ++i) {
+ SNMP_FREE((mi + i)->label);
+ }
+ mp->no_imports = 0;
+ if (mi == root_imports)
+ memset(mi, 0, sizeof(*mi));
+ else
+ free(mi);
+ }
+
+ unload_module_by_ID(mp->modid, tree_head);
+ module_head = mp->next;
+ free(mp->name);
+ free(mp->file);
+ free(mp);
+ }
+ unload_module_by_ID(-1, tree_head);
+ /*
+ * tree nodes are cleared
+ */
+
+ for (i = 0, ptc = tclist; i < MAXTC; i++, ptc++) {
+ if (ptc->type == 0)
+ continue;
+ free_enums(&ptc->enums);
+ free_ranges(&ptc->ranges);
+ free(ptc->descriptor);
+ if (ptc->hint)
+ free(ptc->hint);
+ }
+ memset(tclist, 0, MAXTC * sizeof(struct tc));
+
+ memset(buckets, 0, sizeof(buckets));
+ memset(nbuckets, 0, sizeof(nbuckets));
+ memset(tbuckets, 0, sizeof(tbuckets));
+
+ for (i = 0; i < sizeof(root_imports) / sizeof(root_imports[0]); i++) {
+ SNMP_FREE(root_imports[i].label);
+ }
+
+ max_module = 0;
+ current_module = 0;
+ module_map_head = NULL;
+ SNMP_FREE(last_err_module);
+}
+
+static void
+new_module(const char *name, const char *file)
+{
+ struct module *mp;
+
+ for (mp = module_head; mp; mp = mp->next)
+ if (!label_compare(mp->name, name)) {
+ DEBUGMSGTL(("parse-mibs", " Module %s already noted\n", name));
+ /*
+ * Not the same file
+ */
+ if (label_compare(mp->file, file)) {
+ DEBUGMSGTL(("parse-mibs", " %s is now in %s\n",
+ name, file));
+ if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS)) {
+ snmp_log(LOG_WARNING,
+ "Warning: Module %s was in %s now is %s\n",
+ name, mp->file, file);
+ }
+
+ /*
+ * Use the new one in preference
+ */
+ free(mp->file);
+ mp->file = strdup(file);
+ }
+ return;
+ }
+
+ /*
+ * Add this module to the list
+ */
+ DEBUGMSGTL(("parse-mibs", " Module %d %s is in %s\n", max_module,
+ name, file));
+ mp = (struct module *) calloc(1, sizeof(struct module));
+ if (mp == NULL)
+ return;
+ mp->name = strdup(name);
+ mp->file = strdup(file);
+ mp->imports = NULL;
+ mp->no_imports = -1; /* Not yet loaded */
+ mp->modid = max_module;
+ ++max_module;
+
+ mp->next = module_head; /* Or add to the *end* of the list? */
+ module_head = mp;
+}
+
+
+static void
+scan_objlist(struct node *root, struct module *mp, struct objgroup *list, const char *error)
+{
+ int oLine = mibLine;
+
+ while (list) {
+ struct objgroup *gp = list;
+ struct node *np;
+ list = list->next;
+ np = root;
+ while (np)
+ if (label_compare(np->label, gp->name))
+ np = np->next;
+ else
+ break;
+ if (!np) {
+ int i;
+ struct module_import *mip;
+ /* if not local, check if it was IMPORTed */
+ for (i = 0, mip = mp->imports; i < mp->no_imports; i++, mip++)
+ if (strcmp(mip->label, gp->name) == 0)
+ break;
+ if (i == mp->no_imports) {
+ mibLine = gp->line;
+ print_error(error, gp->name, QUOTESTRING);
+ }
+ }
+ free(gp->name);
+ free(gp);
+ }
+ mibLine = oLine;
+}
+
+/*
+ * Parses a mib file and returns a linked list of nodes found in the file.
+ * Returns NULL on error.
+ */
+static struct node *
+parse(FILE * fp, struct node *root)
+{
+#ifdef TEST
+ extern void xmalloc_stats(FILE *);
+#endif
+ char token[MAXTOKEN];
+ char name[MAXTOKEN+1];
+ int type = LABEL;
+ int lasttype = LABEL;
+
+#define BETWEEN_MIBS 1
+#define IN_MIB 2
+ int state = BETWEEN_MIBS;
+ struct node *np, *nnp;
+ struct objgroup *oldgroups = NULL, *oldobjects = NULL, *oldnotifs =
+ NULL;
+
+ DEBUGMSGTL(("parse-file", "Parsing file: %s...\n", File));
+
+ if (last_err_module)
+ free(last_err_module);
+ last_err_module = NULL;
+
+ np = root;
+ if (np != NULL) {
+ /*
+ * now find end of chain
+ */
+ while (np->next)
+ np = np->next;
+ }
+
+ while (type != ENDOFFILE) {
+ if (lasttype == CONTINUE)
+ lasttype = type;
+ else
+ type = lasttype = get_token(fp, token, MAXTOKEN);
+
+ switch (type) {
+ case END:
+ if (state != IN_MIB) {
+ print_error("Error, END before start of MIB", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ } else {
+ struct module *mp;
+#ifdef TEST
+ printf("\nNodes for Module %s:\n", name);
+ print_nodes(stdout, root);
+#endif
+ for (mp = module_head; mp; mp = mp->next)
+ if (mp->modid == current_module)
+ break;
+ scan_objlist(root, mp, objgroups, "Undefined OBJECT-GROUP");
+ scan_objlist(root, mp, objects, "Undefined OBJECT");
+ scan_objlist(root, mp, notifs, "Undefined NOTIFICATION");
+ objgroups = oldgroups;
+ objects = oldobjects;
+ notifs = oldnotifs;
+ do_linkup(mp, root);
+ np = root = NULL;
+ }
+ state = BETWEEN_MIBS;
+#ifdef TEST
+ if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS)) {
+ /* xmalloc_stats(stderr); */
+ }
+#endif
+ continue;
+ case IMPORTS:
+ parse_imports(fp);
+ continue;
+ case EXPORTS:
+ while (type != SEMI && type != ENDOFFILE)
+ type = get_token(fp, token, MAXTOKEN);
+ continue;
+ case LABEL:
+ case INTEGER:
+ case INTEGER32:
+ case UINTEGER32:
+ case UNSIGNED32:
+ case COUNTER:
+ case COUNTER64:
+ case GAUGE:
+ case IPADDR:
+ case NETADDR:
+ case NSAPADDRESS:
+ case OBJSYNTAX:
+ case APPSYNTAX:
+ case SIMPLESYNTAX:
+ case OBJNAME:
+ case NOTIFNAME:
+ case KW_OPAQUE:
+ case TIMETICKS:
+ break;
+ case ENDOFFILE:
+ continue;
+ default:
+ strlcpy(name, token, sizeof(name));
+ type = get_token(fp, token, MAXTOKEN);
+ nnp = NULL;
+ if (type == MACRO) {
+ nnp = parse_macro(fp, name);
+ if (nnp == NULL) {
+ print_error("Bad parse of MACRO", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ /*
+ * return NULL;
+ */
+ }
+ free_node(nnp); /* IGNORE */
+ nnp = NULL;
+ } else
+ print_error(name, "is a reserved word", lasttype);
+ continue; /* see if we can parse the rest of the file */
+ }
+ strlcpy(name, token, sizeof(name));
+ type = get_token(fp, token, MAXTOKEN);
+ nnp = NULL;
+
+ /*
+ * Handle obsolete method to assign an object identifier to a
+ * module
+ */
+ if (lasttype == LABEL && type == LEFTBRACKET) {
+ while (type != RIGHTBRACKET && type != ENDOFFILE)
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == ENDOFFILE) {
+ print_error("Expected \"}\"", token, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+
+ switch (type) {
+ case DEFINITIONS:
+ if (state != BETWEEN_MIBS) {
+ print_error("Error, nested MIBS", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ state = IN_MIB;
+ current_module = which_module(name);
+ oldgroups = objgroups;
+ objgroups = NULL;
+ oldobjects = objects;
+ objects = NULL;
+ oldnotifs = notifs;
+ notifs = NULL;
+ if (current_module == -1) {
+ new_module(name, File);
+ current_module = which_module(name);
+ }
+ DEBUGMSGTL(("parse-mibs", "Parsing MIB: %d %s\n",
+ current_module, name));
+ while ((type = get_token(fp, token, MAXTOKEN)) != ENDOFFILE)
+ if (type == BEGIN)
+ break;
+ break;
+ case OBJTYPE:
+ nnp = parse_objecttype(fp, name);
+ if (nnp == NULL) {
+ print_error("Bad parse of OBJECT-TYPE", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case OBJGROUP:
+ nnp = parse_objectgroup(fp, name, OBJECTS, &objects);
+ if (nnp == NULL) {
+ print_error("Bad parse of OBJECT-GROUP", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case NOTIFGROUP:
+ nnp = parse_objectgroup(fp, name, NOTIFICATIONS, &notifs);
+ if (nnp == NULL) {
+ print_error("Bad parse of NOTIFICATION-GROUP", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case TRAPTYPE:
+ nnp = parse_trapDefinition(fp, name);
+ if (nnp == NULL) {
+ print_error("Bad parse of TRAP-TYPE", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case NOTIFTYPE:
+ nnp = parse_notificationDefinition(fp, name);
+ if (nnp == NULL) {
+ print_error("Bad parse of NOTIFICATION-TYPE", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case COMPLIANCE:
+ nnp = parse_compliance(fp, name);
+ if (nnp == NULL) {
+ print_error("Bad parse of MODULE-COMPLIANCE", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case AGENTCAP:
+ nnp = parse_capabilities(fp, name);
+ if (nnp == NULL) {
+ print_error("Bad parse of AGENT-CAPABILITIES", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case MACRO:
+ nnp = parse_macro(fp, name);
+ if (nnp == NULL) {
+ print_error("Bad parse of MACRO", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ /*
+ * return NULL;
+ */
+ }
+ free_node(nnp); /* IGNORE */
+ nnp = NULL;
+ break;
+ case MODULEIDENTITY:
+ nnp = parse_moduleIdentity(fp, name);
+ if (nnp == NULL) {
+ print_error("Bad parse of MODULE-IDENTITY", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case OBJIDENTITY:
+ nnp = parse_objectgroup(fp, name, OBJECTS, &objects);
+ if (nnp == NULL) {
+ print_error("Bad parse of OBJECT-IDENTITY", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case OBJECT:
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != IDENTIFIER) {
+ print_error("Expected IDENTIFIER", token, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ if (type != EQUALS) {
+ print_error("Expected \"::=\"", token, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ nnp = parse_objectid(fp, name);
+ if (nnp == NULL) {
+ print_error("Bad parse of OBJECT IDENTIFIER", NULL, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ break;
+ case EQUALS:
+ nnp = parse_asntype(fp, name, &type, token);
+ lasttype = CONTINUE;
+ break;
+ case ENDOFFILE:
+ break;
+ default:
+ print_error("Bad operator", token, type);
+ gMibError = MODULE_SYNTAX_ERROR;
+ return NULL;
+ }
+ if (nnp) {
+ if (np)
+ np->next = nnp;
+ else
+ np = root = nnp;
+ while (np->next)
+ np = np->next;
+ if (np->type == TYPE_OTHER)
+ np->type = type;
+ }
+ }
+ DEBUGMSGTL(("parse-file", "End of file (%s)\n", File));
+ return root;
+}
+
+/*
+ * return zero if character is not a label character.
+ */
+static int
+is_labelchar(int ich)
+{
+ if ((isalnum(ich)) || (ich == '-'))
+ return 1;
+ if (ich == '_' && netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_PARSE_LABEL)) {
+ return 1;
+ }
+
+ return 0;
+}
+
+/**
+ * Read a single character from a file. Assumes that the caller has invoked
+ * flockfile(). Uses fgetc_unlocked() instead of getc() since the former is
+ * implemented as an inline function in glibc. See also bug 3447196
+ * (http://sourceforge.net/tracker/?func=detail&aid=3447196&group_id=12694&atid=112694).
+ */
+static int netsnmp_getc(FILE *stream)
+{
+#ifdef HAVE_FGETC_UNLOCKED
+ return fgetc_unlocked(stream);
+#else
+ return getc(stream);
+#endif
+}
+
+/*
+ * Parses a token from the file. The type of the token parsed is returned,
+ * and the text is placed in the string pointed to by token.
+ * Warning: this method may recurse.
+ */
+static int
+get_token(FILE * fp, char *token, int maxtlen)
+{
+ register int ch, ch_next;
+ register char *cp = token;
+ register int hash = 0;
+ register struct tok *tp;
+ int too_long = 0;
+ enum { bdigits, xdigits, other } seenSymbols;
+
+ /*
+ * skip all white space
+ */
+ do {
+ ch = netsnmp_getc(fp);
+ if (ch == '\n')
+ mibLine++;
+ }
+ while (isspace(ch) && ch != EOF);
+ *cp++ = ch;
+ *cp = '\0';
+ switch (ch) {
+ case EOF:
+ return ENDOFFILE;
+ case '"':
+ return parseQuoteString(fp, token, maxtlen);
+ case '\'': /* binary or hex constant */
+ seenSymbols = bdigits;
+ while ((ch = netsnmp_getc(fp)) != EOF && ch != '\'') {
+ switch (seenSymbols) {
+ case bdigits:
+ if (ch == '0' || ch == '1')
+ break;
+ seenSymbols = xdigits;
+ case xdigits:
+ if (isxdigit(ch))
+ break;
+ seenSymbols = other;
+ case other:
+ break;
+ }
+ if (cp - token < maxtlen - 2)
+ *cp++ = ch;
+ }
+ if (ch == '\'') {
+ unsigned long val = 0;
+ char *run = token + 1;
+ ch = netsnmp_getc(fp);
+ switch (ch) {
+ case EOF:
+ return ENDOFFILE;
+ case 'b':
+ case 'B':
+ if (seenSymbols > bdigits) {
+ *cp++ = '\'';
+ *cp = 0;
+ return LABEL;
+ }
+ while (run != cp)
+ val = val * 2 + *run++ - '0';
+ break;
+ case 'h':
+ case 'H':
+ if (seenSymbols > xdigits) {
+ *cp++ = '\'';
+ *cp = 0;
+ return LABEL;
+ }
+ while (run != cp) {
+ ch = *run++;
+ if ('0' <= ch && ch <= '9')
+ val = val * 16 + ch - '0';
+ else if ('a' <= ch && ch <= 'f')
+ val = val * 16 + ch - 'a' + 10;
+ else if ('A' <= ch && ch <= 'F')
+ val = val * 16 + ch - 'A' + 10;
+ }
+ break;
+ default:
+ *cp++ = '\'';
+ *cp = 0;
+ return LABEL;
+ }
+ sprintf(token, "%ld", val);
+ return NUMBER;
+ } else
+ return LABEL;
+ case '(':
+ return LEFTPAREN;
+ case ')':
+ return RIGHTPAREN;
+ case '{':
+ return LEFTBRACKET;
+ case '}':
+ return RIGHTBRACKET;
+ case '[':
+ return LEFTSQBRACK;
+ case ']':
+ return RIGHTSQBRACK;
+ case ';':
+ return SEMI;
+ case ',':
+ return COMMA;
+ case '|':
+ return BAR;
+ case '.':
+ ch_next = netsnmp_getc(fp);
+ if (ch_next == '.')
+ return RANGE;
+ ungetc(ch_next, fp);
+ return LABEL;
+ case ':':
+ ch_next = netsnmp_getc(fp);
+ if (ch_next != ':') {
+ ungetc(ch_next, fp);
+ return LABEL;
+ }
+ ch_next = netsnmp_getc(fp);
+ if (ch_next != '=') {
+ ungetc(ch_next, fp);
+ return LABEL;
+ }
+ return EQUALS;
+ case '-':
+ ch_next = netsnmp_getc(fp);
+ if (ch_next == '-') {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_COMMENT_TERM)) {
+ /*
+ * Treat the rest of this line as a comment.
+ */
+ while ((ch_next != EOF) && (ch_next != '\n'))
+ ch_next = netsnmp_getc(fp);
+ } else {
+ /*
+ * Treat the rest of the line or until another '--' as a comment
+ */
+ /*
+ * (this is the "technically" correct way to parse comments)
+ */
+ ch = ' ';
+ ch_next = netsnmp_getc(fp);
+ while (ch_next != EOF && ch_next != '\n' &&
+ (ch != '-' || ch_next != '-')) {
+ ch = ch_next;
+ ch_next = netsnmp_getc(fp);
+ }
+ }
+ if (ch_next == EOF)
+ return ENDOFFILE;
+ if (ch_next == '\n')
+ mibLine++;
+ return get_token(fp, token, maxtlen);
+ }
+ ungetc(ch_next, fp);
+ /* fallthrough */
+ default:
+ /*
+ * Accumulate characters until end of token is found. Then attempt to
+ * match this token as a reserved word. If a match is found, return the
+ * type. Else it is a label.
+ */
+ if (!is_labelchar(ch))
+ return LABEL;
+ hash += tolower(ch);
+ more:
+ while (is_labelchar(ch_next = netsnmp_getc(fp))) {
+ hash += tolower(ch_next);
+ if (cp - token < maxtlen - 1)
+ *cp++ = ch_next;
+ else
+ too_long = 1;
+ }
+ ungetc(ch_next, fp);
+ *cp = '\0';
+
+ if (too_long)
+ print_error("Warning: token too long", token, CONTINUE);
+ for (tp = buckets[BUCKET(hash)]; tp; tp = tp->next) {
+ if ((tp->hash == hash) && (!label_compare(tp->name, token)))
+ break;
+ }
+ if (tp) {
+ if (tp->token != CONTINUE)
+ return (tp->token);
+ while (isspace((ch_next = netsnmp_getc(fp))))
+ if (ch_next == '\n')
+ mibLine++;
+ if (ch_next == EOF)
+ return ENDOFFILE;
+ if (isalnum(ch_next)) {
+ *cp++ = ch_next;
+ hash += tolower(ch_next);
+ goto more;
+ }
+ }
+ if (token[0] == '-' || isdigit((unsigned char)(token[0]))) {
+ for (cp = token + 1; *cp; cp++)
+ if (!isdigit((unsigned char)(*cp)))
+ return LABEL;
+ return NUMBER;
+ }
+ return LABEL;
+ }
+}
+
+netsnmp_feature_child_of(parse_get_token, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_PARSE_GET_TOKEN
+int
+snmp_get_token(FILE * fp, char *token, int maxtlen)
+{
+ return get_token(fp, token, maxtlen);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_PARSE_GET_TOKEN */
+
+int
+add_mibfile(const char* tmpstr, const char* d_name, FILE *ip )
+{
+ FILE *fp;
+ char token[MAXTOKEN], token2[MAXTOKEN];
+
+ /*
+ * which module is this
+ */
+ if ((fp = fopen(tmpstr, "r")) == NULL) {
+ snmp_log_perror(tmpstr);
+ return 1;
+ }
+ DEBUGMSGTL(("parse-mibs", "Checking file: %s...\n",
+ tmpstr));
+ mibLine = 1;
+ File = tmpstr;
+ if (get_token(fp, token, MAXTOKEN) != LABEL) {
+ fclose(fp);
+ return 1;
+ }
+ /*
+ * simple test for this being a MIB
+ */
+ if (get_token(fp, token2, MAXTOKEN) == DEFINITIONS) {
+ new_module(token, tmpstr);
+ if (ip)
+ fprintf(ip, "%s %s\n", token, d_name);
+ fclose(fp);
+ return 0;
+ } else {
+ fclose(fp);
+ return 1;
+ }
+}
+
+/* For Win32 platforms, the directory does not maintain a last modification
+ * date that we can compare with the modification date of the .index file.
+ * Therefore there is no way to know whether any .index file is valid.
+ * This is the reason for the #if !(defined(WIN32) || defined(cygwin))
+ * in the add_mibdir function
+ */
+int
+add_mibdir(const char *dirname)
+{
+ FILE *ip;
+ DIR *dir, *dir2;
+ const char *oldFile = File;
+ struct dirent *file;
+ char tmpstr[300];
+ int count = 0;
+ int fname_len = 0;
+#if !(defined(WIN32) || defined(cygwin))
+ char *token;
+ char space;
+ char newline;
+ struct stat dir_stat, idx_stat;
+ char tmpstr1[300];
+#endif
+
+ DEBUGMSGTL(("parse-mibs", "Scanning directory %s\n", dirname));
+#if !(defined(WIN32) || defined(cygwin))
+ token = netsnmp_mibindex_lookup( dirname );
+ if (token && stat(token, &idx_stat) == 0 && stat(dirname, &dir_stat) == 0) {
+ if (dir_stat.st_mtime < idx_stat.st_mtime) {
+ DEBUGMSGTL(("parse-mibs", "The index is good\n"));
+ if ((ip = fopen(token, "r")) != NULL) {
+ fgets(tmpstr, sizeof(tmpstr), ip); /* Skip dir line */
+ while (fscanf(ip, "%127s%c%299s%c", token, &space, tmpstr,
+ &newline) == 4) {
+
+ /*
+ * If an overflow of the token or tmpstr buffers has been
+ * found log a message and break out of the while loop,
+ * thus the rest of the file tokens will be ignored.
+ */
+ if (space != ' ' || newline != '\n') {
+ snmp_log(LOG_ERR,
+ "add_mibdir: strings scanned in from %s/%s " \
+ "are too large. count = %d\n ", dirname,
+ ".index", count);
+ break;
+ }
+
+ snprintf(tmpstr1, sizeof(tmpstr1), "%s/%s", dirname, tmpstr);
+ tmpstr1[ sizeof(tmpstr1)-1 ] = 0;
+ new_module(token, tmpstr1);
+ count++;
+ }
+ fclose(ip);
+ return count;
+ } else
+ DEBUGMSGTL(("parse-mibs", "Can't read index\n"));
+ } else
+ DEBUGMSGTL(("parse-mibs", "Index outdated\n"));
+ } else
+ DEBUGMSGTL(("parse-mibs", "No index\n"));
+#endif
+
+ if ((dir = opendir(dirname))) {
+ ip = netsnmp_mibindex_new( dirname );
+ while ((file = readdir(dir))) {
+ /*
+ * Only parse file names that don't begin with a '.'
+ * Also skip files ending in '~', or starting/ending
+ * with '#' which are typically editor backup files.
+ */
+ if (file->d_name != NULL) {
+ fname_len = strlen( file->d_name );
+ if (fname_len > 0 && file->d_name[0] != '.'
+ && file->d_name[0] != '#'
+ && file->d_name[fname_len-1] != '#'
+ && file->d_name[fname_len-1] != '~') {
+ snprintf(tmpstr, sizeof(tmpstr), "%s/%s", dirname, file->d_name);
+ tmpstr[ sizeof(tmpstr)-1 ] = 0;
+ if ((dir2 = opendir(tmpstr))) {
+ /*
+ * file is a directory, don't read it
+ */
+ closedir(dir2);
+ } else {
+ if ( !add_mibfile( tmpstr, file->d_name, ip ))
+ count++;
+ }
+ }
+ }
+ }
+ File = oldFile;
+ closedir(dir);
+ if (ip)
+ fclose(ip);
+ return (count);
+ }
+ else
+ DEBUGMSGTL(("parse-mibs","cannot open MIB directory %s\n", dirname));
+
+ return (-1);
+}
+
+
+/*
+ * Returns the root of the whole tree
+ * (for backwards compatability)
+ */
+struct tree *
+read_mib(const char *filename)
+{
+ FILE *fp;
+ char token[MAXTOKEN];
+
+ fp = fopen(filename, "r");
+ if (fp == NULL) {
+ snmp_log_perror(filename);
+ return NULL;
+ }
+ mibLine = 1;
+ File = filename;
+ DEBUGMSGTL(("parse-mibs", "Parsing file: %s...\n", filename));
+ if (get_token(fp, token, MAXTOKEN) != LABEL) {
+ snmp_log(LOG_ERR, "Failed to parse MIB file %s\n", filename);
+ fclose(fp);
+ return NULL;
+ }
+ fclose(fp);
+ new_module(token, filename);
+ (void) netsnmp_read_module(token);
+
+ return tree_head;
+}
+
+
+struct tree *
+read_all_mibs(void)
+{
+ struct module *mp;
+
+ for (mp = module_head; mp; mp = mp->next)
+ if (mp->no_imports == -1)
+ netsnmp_read_module(mp->name);
+ adopt_orphans();
+
+ /* If entered the syntax error loop in "read_module()" */
+ if (gLoop == 1) {
+ gLoop = 0;
+ if (gpMibErrorString != NULL) {
+ SNMP_FREE(gpMibErrorString);
+ }
+ gpMibErrorString = (char *) calloc(1, MAXQUOTESTR);
+ if (gpMibErrorString == NULL) {
+ snmp_log(LOG_CRIT, "failed to allocated memory for gpMibErrorString\n");
+ } else {
+ snprintf(gpMibErrorString, sizeof(gpMibErrorString)-1, "Error in parsing MIB module(s): %s ! Unable to load corresponding MIB(s)", gMibNames);
+ }
+ }
+
+ /* Caller's responsibility to free this memory */
+ tree_head->parseErrorString = gpMibErrorString;
+
+ return tree_head;
+}
+
+
+#ifdef TEST
+int main(int argc, char *argv[])
+{
+ int i;
+ struct tree *tp;
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_WARNINGS, 2);
+
+ netsnmp_init_mib();
+
+ if (argc == 1)
+ (void) read_all_mibs();
+ else
+ for (i = 1; i < argc; i++)
+ read_mib(argv[i]);
+
+ for (tp = tree_head; tp; tp = tp->next_peer)
+ print_subtree(stdout, tp, 0);
+ free_tree(tree_head);
+
+ return 0;
+}
+#endif /* TEST */
+
+static int
+parseQuoteString(FILE * fp, char *token, int maxtlen)
+{
+ register int ch;
+ int count = 0;
+ int too_long = 0;
+ char *token_start = token;
+
+ for (ch = netsnmp_getc(fp); ch != EOF; ch = netsnmp_getc(fp)) {
+ if (ch == '\r')
+ continue;
+ if (ch == '\n') {
+ mibLine++;
+ } else if (ch == '"') {
+ *token = '\0';
+ if (too_long && netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS) > 1) {
+ /*
+ * show short form for brevity sake
+ */
+ char ch_save = *(token_start + 50);
+ *(token_start + 50) = '\0';
+ print_error("Warning: string too long",
+ token_start, QUOTESTRING);
+ *(token_start + 50) = ch_save;
+ }
+ return QUOTESTRING;
+ }
+ /*
+ * maximum description length check. If greater, keep parsing
+ * but truncate the string
+ */
+ if (++count < maxtlen)
+ *token++ = ch;
+ else
+ too_long = 1;
+ }
+
+ return 0;
+}
+
+/*
+ * struct index_list *
+ * getIndexes(FILE *fp):
+ * This routine parses a string like { blah blah blah } and returns a
+ * list of the strings enclosed within it.
+ *
+ */
+static struct index_list *
+getIndexes(FILE * fp, struct index_list **retp)
+{
+ int type;
+ char token[MAXTOKEN];
+ char nextIsImplied = 0;
+
+ struct index_list *mylist = NULL;
+ struct index_list **mypp = &mylist;
+
+ free_indexes(retp);
+
+ type = get_token(fp, token, MAXTOKEN);
+
+ if (type != LEFTBRACKET) {
+ return NULL;
+ }
+
+ type = get_token(fp, token, MAXTOKEN);
+ while (type != RIGHTBRACKET && type != ENDOFFILE) {
+ if ((type == LABEL) || (type & SYNTAX_MASK)) {
+ *mypp =
+ (struct index_list *) calloc(1, sizeof(struct index_list));
+ if (*mypp) {
+ (*mypp)->ilabel = strdup(token);
+ (*mypp)->isimplied = nextIsImplied;
+ mypp = &(*mypp)->next;
+ nextIsImplied = 0;
+ }
+ } else if (type == IMPLIED) {
+ nextIsImplied = 1;
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+
+ *retp = mylist;
+ return mylist;
+}
+
+static struct varbind_list *
+getVarbinds(FILE * fp, struct varbind_list **retp)
+{
+ int type;
+ char token[MAXTOKEN];
+
+ struct varbind_list *mylist = NULL;
+ struct varbind_list **mypp = &mylist;
+
+ free_varbinds(retp);
+
+ type = get_token(fp, token, MAXTOKEN);
+
+ if (type != LEFTBRACKET) {
+ return NULL;
+ }
+
+ type = get_token(fp, token, MAXTOKEN);
+ while (type != RIGHTBRACKET && type != ENDOFFILE) {
+ if ((type == LABEL) || (type & SYNTAX_MASK)) {
+ *mypp =
+ (struct varbind_list *) calloc(1,
+ sizeof(struct
+ varbind_list));
+ if (*mypp) {
+ (*mypp)->vblabel = strdup(token);
+ mypp = &(*mypp)->next;
+ }
+ }
+ type = get_token(fp, token, MAXTOKEN);
+ }
+
+ *retp = mylist;
+ return mylist;
+}
+
+static void
+free_indexes(struct index_list **spp)
+{
+ if (spp && *spp) {
+ struct index_list *pp, *npp;
+
+ pp = *spp;
+ *spp = NULL;
+
+ while (pp) {
+ npp = pp->next;
+ if (pp->ilabel)
+ free(pp->ilabel);
+ free(pp);
+ pp = npp;
+ }
+ }
+}
+
+static void
+free_varbinds(struct varbind_list **spp)
+{
+ if (spp && *spp) {
+ struct varbind_list *pp, *npp;
+
+ pp = *spp;
+ *spp = NULL;
+
+ while (pp) {
+ npp = pp->next;
+ if (pp->vblabel)
+ free(pp->vblabel);
+ free(pp);
+ pp = npp;
+ }
+ }
+}
+
+static void
+free_ranges(struct range_list **spp)
+{
+ if (spp && *spp) {
+ struct range_list *pp, *npp;
+
+ pp = *spp;
+ *spp = NULL;
+
+ while (pp) {
+ npp = pp->next;
+ free(pp);
+ pp = npp;
+ }
+ }
+}
+
+static void
+free_enums(struct enum_list **spp)
+{
+ if (spp && *spp) {
+ struct enum_list *pp, *npp;
+
+ pp = *spp;
+ *spp = NULL;
+
+ while (pp) {
+ npp = pp->next;
+ if (pp->label)
+ free(pp->label);
+ free(pp);
+ pp = npp;
+ }
+ }
+}
+
+static struct enum_list *
+copy_enums(struct enum_list *sp)
+{
+ struct enum_list *xp = NULL, **spp = &xp;
+
+ while (sp) {
+ *spp = (struct enum_list *) calloc(1, sizeof(struct enum_list));
+ if (!*spp)
+ break;
+ (*spp)->label = strdup(sp->label);
+ (*spp)->value = sp->value;
+ spp = &(*spp)->next;
+ sp = sp->next;
+ }
+ return (xp);
+}
+
+static struct range_list *
+copy_ranges(struct range_list *sp)
+{
+ struct range_list *xp = NULL, **spp = &xp;
+
+ while (sp) {
+ *spp = (struct range_list *) calloc(1, sizeof(struct range_list));
+ if (!*spp)
+ break;
+ (*spp)->low = sp->low;
+ (*spp)->high = sp->high;
+ spp = &(*spp)->next;
+ sp = sp->next;
+ }
+ return (xp);
+}
+
+/*
+ * This routine parses a string like { blah blah blah } and returns OBJID if
+ * it is well formed, and NULL if not.
+ */
+static int
+tossObjectIdentifier(FILE * fp)
+{
+ int type;
+ char token[MAXTOKEN];
+ int bracketcount = 1;
+
+ type = get_token(fp, token, MAXTOKEN);
+
+ if (type != LEFTBRACKET)
+ return 0;
+ while ((type != RIGHTBRACKET || bracketcount > 0) && type != ENDOFFILE) {
+ type = get_token(fp, token, MAXTOKEN);
+ if (type == LEFTBRACKET)
+ bracketcount++;
+ else if (type == RIGHTBRACKET)
+ bracketcount--;
+ }
+
+ if (type == RIGHTBRACKET)
+ return OBJID;
+ else
+ return 0;
+}
+
+/* Find node in any MIB module
+ Used by Perl modules */
+struct tree *
+find_node(const char *name, struct tree *subtree)
+{ /* Unused */
+ return (find_tree_node(name, -1));
+}
+
+netsnmp_feature_child_of(parse_find_node2, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_PARSE_FIND_NODE2
+struct tree *
+find_node2(const char *name, const char *module)
+{
+ int modid = -1;
+ if (module) {
+ modid = which_module(module);
+ }
+ if (modid == -1)
+ {
+ return (NULL);
+ }
+ return (find_tree_node(name, modid));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_PARSE_FIND_NODE2 */
+
+#ifndef NETSNMP_FEATURE_REMOVE_FIND_MODULE
+/* Used in the perl module */
+struct module *
+find_module(int mid)
+{
+ struct module *mp;
+
+ for (mp = module_head; mp != NULL; mp = mp->next) {
+ if (mp->modid == mid)
+ break;
+ }
+ return mp;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_FIND_MODULE */
+
+
+static char leave_indent[256];
+static int leave_was_simple;
+
+static void
+print_mib_leaves(FILE * f, struct tree *tp, int width)
+{
+ struct tree *ntp;
+ char *ip = leave_indent + strlen(leave_indent) - 1;
+ char last_ipch = *ip;
+
+ *ip = '+';
+ if (tp->type == TYPE_OTHER || tp->type > TYPE_SIMPLE_LAST) {
+ fprintf(f, "%s--%s(%ld)\n", leave_indent, tp->label, tp->subid);
+ if (tp->indexes) {
+ struct index_list *xp = tp->indexes;
+ int first = 1, cpos = 0, len, cmax =
+ width - strlen(leave_indent) - 12;
+ *ip = last_ipch;
+ fprintf(f, "%s | Index: ", leave_indent);
+ while (xp) {
+ if (first)
+ first = 0;
+ else
+ fprintf(f, ", ");
+ cpos += (len = strlen(xp->ilabel) + 2);
+ if (cpos > cmax) {
+ fprintf(f, "\n");
+ fprintf(f, "%s | ", leave_indent);
+ cpos = len;
+ }
+ fprintf(f, "%s", xp->ilabel);
+ xp = xp->next;
+ }
+ fprintf(f, "\n");
+ *ip = '+';
+ }
+ } else {
+ const char *acc, *typ;
+ int size = 0;
+ switch (tp->access) {
+ case MIB_ACCESS_NOACCESS:
+ acc = "----";
+ break;
+ case MIB_ACCESS_READONLY:
+ acc = "-R--";
+ break;
+ case MIB_ACCESS_WRITEONLY:
+ acc = "--W-";
+ break;
+ case MIB_ACCESS_READWRITE:
+ acc = "-RW-";
+ break;
+ case MIB_ACCESS_NOTIFY:
+ acc = "---N";
+ break;
+ case MIB_ACCESS_CREATE:
+ acc = "CR--";
+ break;
+ default:
+ acc = " ";
+ break;
+ }
+ switch (tp->type) {
+ case TYPE_OBJID:
+ typ = "ObjID ";
+ break;
+ case TYPE_OCTETSTR:
+ typ = "String ";
+ size = 1;
+ break;
+ case TYPE_INTEGER:
+ if (tp->enums)
+ typ = "EnumVal ";
+ else
+ typ = "INTEGER ";
+ break;
+ case TYPE_NETADDR:
+ typ = "NetAddr ";
+ break;
+ case TYPE_IPADDR:
+ typ = "IpAddr ";
+ break;
+ case TYPE_COUNTER:
+ typ = "Counter ";
+ break;
+ case TYPE_GAUGE:
+ typ = "Gauge ";
+ break;
+ case TYPE_TIMETICKS:
+ typ = "TimeTicks";
+ break;
+ case TYPE_OPAQUE:
+ typ = "Opaque ";
+ size = 1;
+ break;
+ case TYPE_NULL:
+ typ = "Null ";
+ break;
+ case TYPE_COUNTER64:
+ typ = "Counter64";
+ break;
+ case TYPE_BITSTRING:
+ typ = "BitString";
+ break;
+ case TYPE_NSAPADDRESS:
+ typ = "NsapAddr ";
+ break;
+ case TYPE_UNSIGNED32:
+ typ = "Unsigned ";
+ break;
+ case TYPE_UINTEGER:
+ typ = "UInteger ";
+ break;
+ case TYPE_INTEGER32:
+ typ = "Integer32";
+ break;
+ default:
+ typ = " ";
+ break;
+ }
+ fprintf(f, "%s-- %s %s %s(%ld)\n", leave_indent, acc, typ,
+ tp->label, tp->subid);
+ *ip = last_ipch;
+ if (tp->tc_index >= 0)
+ fprintf(f, "%s Textual Convention: %s\n", leave_indent,
+ tclist[tp->tc_index].descriptor);
+ if (tp->enums) {
+ struct enum_list *ep = tp->enums;
+ int cpos = 0, cmax =
+ width - strlen(leave_indent) - 16;
+ fprintf(f, "%s Values: ", leave_indent);
+ while (ep) {
+ char buf[80];
+ int bufw;
+ if (ep != tp->enums)
+ fprintf(f, ", ");
+ snprintf(buf, sizeof(buf), "%s(%d)", ep->label, ep->value);
+ buf[ sizeof(buf)-1 ] = 0;
+ cpos += (bufw = strlen(buf) + 2);
+ if (cpos >= cmax) {
+ fprintf(f, "\n%s ", leave_indent);
+ cpos = bufw;
+ }
+ fprintf(f, "%s", buf);
+ ep = ep->next;
+ }
+ fprintf(f, "\n");
+ }
+ if (tp->ranges) {
+ struct range_list *rp = tp->ranges;
+ if (size)
+ fprintf(f, "%s Size: ", leave_indent);
+ else
+ fprintf(f, "%s Range: ", leave_indent);
+ while (rp) {
+ if (rp != tp->ranges)
+ fprintf(f, " | ");
+ print_range_value(f, tp->type, rp);
+ rp = rp->next;
+ }
+ fprintf(f, "\n");
+ }
+ }
+ *ip = last_ipch;
+ strcat(leave_indent, " |");
+ leave_was_simple = tp->type != TYPE_OTHER;
+
+ {
+ int i, j, count = 0;
+ struct leave {
+ oid id;
+ struct tree *tp;
+ } *leaves, *lp;
+
+ for (ntp = tp->child_list; ntp; ntp = ntp->next_peer)
+ count++;
+ if (count) {
+ leaves = (struct leave *) calloc(count, sizeof(struct leave));
+ if (!leaves)
+ return;
+ for (ntp = tp->child_list, count = 0; ntp;
+ ntp = ntp->next_peer) {
+ for (i = 0, lp = leaves; i < count; i++, lp++)
+ if (lp->id >= ntp->subid)
+ break;
+ for (j = count; j > i; j--)
+ leaves[j] = leaves[j - 1];
+ lp->id = ntp->subid;
+ lp->tp = ntp;
+ count++;
+ }
+ for (i = 1, lp = leaves; i <= count; i++, lp++) {
+ if (!leave_was_simple || lp->tp->type == 0)
+ fprintf(f, "%s\n", leave_indent);
+ if (i == count)
+ ip[3] = ' ';
+ print_mib_leaves(f, lp->tp, width);
+ }
+ free(leaves);
+ leave_was_simple = 0;
+ }
+ }
+ ip[1] = 0;
+}
+
+void
+print_mib_tree(FILE * f, struct tree *tp, int width)
+{
+ leave_indent[0] = ' ';
+ leave_indent[1] = 0;
+ leave_was_simple = 1;
+ print_mib_leaves(f, tp, width);
+}
+
+
+/*
+ * Merge the parsed object identifier with the existing node.
+ * If there is a problem with the identifier, release the existing node.
+ */
+static struct node *
+merge_parse_objectid(struct node *np, FILE * fp, char *name)
+{
+ struct node *nnp;
+ /*
+ * printf("merge defval --> %s\n",np->defaultValue);
+ */
+ nnp = parse_objectid(fp, name);
+ if (nnp) {
+
+ /*
+ * apply last OID sub-identifier data to the information
+ */
+ /*
+ * already collected for this node.
+ */
+ struct node *headp, *nextp;
+ int ncount = 0;
+ nextp = headp = nnp;
+ while (nnp->next) {
+ nextp = nnp;
+ ncount++;
+ nnp = nnp->next;
+ }
+
+ np->label = nnp->label;
+ np->subid = nnp->subid;
+ np->modid = nnp->modid;
+ np->parent = nnp->parent;
+ if (nnp->filename != NULL) {
+ free(nnp->filename);
+ }
+ free(nnp);
+
+ if (ncount) {
+ nextp->next = np;
+ np = headp;
+ }
+ } else {
+ free_node(np);
+ np = NULL;
+ }
+
+ return np;
+}
+
+/*
+ * transfer data to tree from node
+ *
+ * move pointers for alloc'd data from np to tp.
+ * this prevents them from being freed when np is released.
+ * parent member is not moved.
+ *
+ * CAUTION: nodes may be repeats of existing tree nodes.
+ * This can happen especially when resolving IMPORT clauses.
+ *
+ */
+static void
+tree_from_node(struct tree *tp, struct node *np)
+{
+ free_partial_tree(tp, FALSE);
+
+ tp->label = np->label;
+ np->label = NULL;
+ tp->enums = np->enums;
+ np->enums = NULL;
+ tp->ranges = np->ranges;
+ np->ranges = NULL;
+ tp->indexes = np->indexes;
+ np->indexes = NULL;
+ tp->augments = np->augments;
+ np->augments = NULL;
+ tp->varbinds = np->varbinds;
+ np->varbinds = NULL;
+ tp->hint = np->hint;
+ np->hint = NULL;
+ tp->units = np->units;
+ np->units = NULL;
+ tp->description = np->description;
+ np->description = NULL;
+ tp->reference = np->reference;
+ np->reference = NULL;
+ tp->defaultValue = np->defaultValue;
+ np->defaultValue = NULL;
+ tp->subid = np->subid;
+ tp->tc_index = np->tc_index;
+ tp->type = translation_table[np->type];
+ tp->access = np->access;
+ tp->status = np->status;
+
+ set_function(tp);
+}
+
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
diff --git a/snmplib/pkcs.c b/snmplib/pkcs.c
new file mode 100644
index 0000000..48e602a
--- /dev/null
+++ b/snmplib/pkcs.c
@@ -0,0 +1,779 @@
+/*
+ * 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.
+ */
+
+/*
+ * pkcs.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#ifdef NETSNMP_USE_PKCS11
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/keytools.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/callback.h>
+#include <security/cryptoki.h>
+
+typedef struct netsnmp_pkcs_slot_session_s {
+ CK_SLOT_ID sid;
+ CK_SESSION_HANDLE hdl;
+} netsnmp_pkcs_slot_session;
+
+typedef struct netsnmp_pkcs_slot_info_s {
+ int count;
+ netsnmp_pkcs_slot_session *pSession;
+} netsnmp_pkcs_slot_info;
+
+static CK_RV get_session_handle(CK_MECHANISM_TYPE, CK_FLAGS,\
+ CK_SESSION_HANDLE_PTR);
+static CK_RV get_slot_session_handle(netsnmp_pkcs_slot_session *,\
+ CK_SESSION_HANDLE_PTR);
+static char *pkcserr_string(CK_RV);
+static int free_slots(int, int, void *, void *);
+
+static netsnmp_pkcs_slot_info *pSlot = NULL;
+
+/*
+ * initialize the Cryptoki library.
+ */
+int
+pkcs_init(void)
+{
+ CK_RV rv;
+ CK_ULONG slotcount;
+ CK_SLOT_ID_PTR pSlotList = NULL;
+ netsnmp_pkcs_slot_session *tmp;
+ int i, rval = SNMPERR_SUCCESS;
+ /* Initialize pkcs */
+ if ((rv = C_Initialize(NULL)) != CKR_OK) {
+ DEBUGMSGTL(("pkcs_init", "C_Initialize failed: %s",
+ pkcserr_string(rv)));
+ return SNMPERR_SC_NOT_CONFIGURED;
+ }
+
+ /* Get slot count */
+ rv = C_GetSlotList(1, NULL_PTR, &slotcount);
+ if (rv != CKR_OK || slotcount == 0) {
+ DEBUGMSGTL(("pkcs_init", "C_GetSlotList failed: %s",
+ pkcserr_string(rv)));
+ QUITFUN(SNMPERR_GENERR, pkcs_init_quit);
+ }
+
+ /* Found at least one slot, allocate memory for slot list */
+ pSlotList = malloc(slotcount * sizeof (CK_SLOT_ID));
+ pSlot = malloc(sizeof (netsnmp_pkcs_slot_info));
+ pSlot->pSession = malloc(slotcount * sizeof (netsnmp_pkcs_slot_session));
+
+ if (pSlotList == NULL_PTR ||
+ pSlot == NULL_PTR ||
+ pSlot->pSession == NULL_PTR) {
+ DEBUGMSGTL(("pkcs_init","malloc failed."));
+ QUITFUN(SNMPERR_GENERR, pkcs_init_quit);
+ }
+
+ /* Get the list of slots */
+ if ((rv = C_GetSlotList(1, pSlotList, &slotcount)) != CKR_OK) {
+ DEBUGMSGTL(("pkcs_init", "C_GetSlotList failed: %s",
+ pkcserr_string(rv)));
+ QUITFUN(SNMPERR_GENERR, pkcs_init_quit);
+ }
+
+ /* initialize Slots structure */
+ pSlot->count = slotcount;
+ for (i = 0, tmp = pSlot->pSession; i < slotcount; i++, tmp++) {
+ tmp->sid = pSlotList[i];
+ tmp->hdl = NULL;
+ }
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_SHUTDOWN,
+ free_slots, NULL);
+
+ pkcs_init_quit:
+ SNMP_FREE(pSlotList);
+ return rval;
+}
+
+/*
+ * close all the opened sessions when finished with Cryptoki library.
+ */
+static int
+free_slots(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ int slotcount, i;
+
+ if (pSlot != NULL) {
+ slotcount = pSlot->count;
+ for (i = 0; i < slotcount; i++) {
+ if (pSlot->pSession->hdl != NULL) {
+ free(pSlot->pSession->hdl);
+ }
+ }
+ free(pSlot);
+ }
+
+ (void) C_Finalize(NULL);
+ return 0;
+}
+
+/*
+ * generate random data
+ */
+int
+pkcs_random(u_char * buf, size_t buflen)
+{
+ CK_SESSION_HANDLE hSession;
+
+ if (pSlot != NULL &&
+ get_slot_session_handle(pSlot->pSession, &hSession) == CKR_OK &&
+ C_GenerateRandom(hSession, buf, buflen) == CKR_OK) {
+ return SNMPERR_SUCCESS;
+ }
+
+ return SNMPERR_GENERR;
+}
+
+/*
+ * retrieve the session handle from the first slot that supports the specified
+ * mechanism.
+ */
+static CK_RV
+get_session_handle(CK_MECHANISM_TYPE mech_type, CK_FLAGS flag,
+ CK_SESSION_HANDLE_PTR sess)
+{
+ CK_RV rv = CKR_OK;
+ CK_MECHANISM_INFO info;
+ netsnmp_pkcs_slot_session *p = NULL;
+ int i, slotcount = 0;
+
+ if (pSlot) {
+ slotcount = pSlot->count;
+ p = pSlot->pSession;
+ }
+
+ /* Find a slot with matching mechanism */
+ for (i = 0; i < slotcount; i++, p++) {
+ rv = C_GetMechanismInfo(p->sid, mech_type, &info);
+
+ if (rv != CKR_OK) {
+ continue; /* to the next slot */
+ } else {
+ if (info.flags & flag) {
+ rv = get_slot_session_handle(p, sess);
+ break; /* found */
+ }
+ }
+ }
+
+ /* Show error if no matching mechanism found */
+ if (i == slotcount) {
+ DEBUGMSGTL(("pkcs_init","No cryptographic provider for %s",
+ mech_type));
+ return CKR_SESSION_HANDLE_INVALID;
+ }
+
+ return rv;
+}
+
+/*
+ * retrieve the session handle from the specified slot.
+ */
+static CK_RV
+get_slot_session_handle(netsnmp_pkcs_slot_session *p,
+ CK_SESSION_HANDLE_PTR sess)
+{
+ CK_RV rv = CKR_OK;
+ if (p == NULL) {
+ *sess = NULL;
+ return CKR_SESSION_HANDLE_INVALID;
+ }
+
+ if (p->hdl == NULL) {
+ /* Open a session */
+ rv = C_OpenSession(p->sid, CKF_SERIAL_SESSION,
+ NULL_PTR, NULL, &p->hdl);
+
+ if (rv != CKR_OK) {
+ DEBUGMSGTL(("get_slot_session_handle","can not open PKCS #11 session: %s",
+ pkcserr_string(rv)));
+ }
+ }
+ *sess = p->hdl;
+
+ return rv;
+}
+
+/*
+ * perform a signature operation to generate MAC.
+ */
+int
+pkcs_sign(CK_MECHANISM_TYPE mech_type, u_char * key, u_int keylen,
+ u_char * msg, u_int msglen, u_char * mac, size_t * maclen)
+{
+ /*
+ * Key template
+ */
+ CK_OBJECT_CLASS class = CKO_SECRET_KEY;
+ CK_KEY_TYPE keytype = CKK_GENERIC_SECRET;
+ CK_BBOOL truevalue = TRUE;
+ CK_BBOOL falsevalue= FALSE;
+ CK_ATTRIBUTE template[] = {
+ {CKA_CLASS, &class, sizeof (class)},
+ {CKA_KEY_TYPE, &keytype, sizeof (keytype)},
+ {CKA_SIGN, &truevalue, sizeof (truevalue)},
+ {CKA_TOKEN, &falsevalue, sizeof (falsevalue)},
+ {CKA_VALUE, key, keylen}
+ };
+ CK_SESSION_HANDLE hSession;
+ CK_MECHANISM mech;
+ CK_OBJECT_HANDLE hkey = (CK_OBJECT_HANDLE) 0;
+ int rval = SNMPERR_SUCCESS;
+ if (get_session_handle(mech_type, CKF_SIGN, &hSession) != CKR_OK ||
+ hSession == NULL) {
+ QUITFUN(SNMPERR_GENERR, pkcs_sign_quit);
+ }
+
+ /* create a key object */
+ if (C_CreateObject(hSession, template,
+ (sizeof (template) / sizeof (CK_ATTRIBUTE)), &hkey) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_sign_quit);
+ }
+
+ mech.mechanism = mech_type;
+ mech.pParameter = NULL_PTR;
+ mech.ulParameterLen = 0;
+
+ /* initialize a signature operation */
+ if (C_SignInit(hSession, &mech, hkey) != CKR_OK ) {
+ QUITFUN(SNMPERR_GENERR, pkcs_sign_quit);
+ }
+ /* continue a multiple-part signature operation */
+ if (C_SignUpdate(hSession, msg, msglen) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_sign_quit);
+ }
+ /* finish a multiple-part signature operation */
+ if (C_SignFinal(hSession, mac, maclen) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_sign_quit);
+ }
+
+ pkcs_sign_quit:
+
+ if (key != (CK_OBJECT_HANDLE) 0) {
+ (void) C_DestroyObject(hSession, hkey);
+ }
+ return rval;
+}
+
+/*
+ * perform a message-digesting operation.
+ */
+int
+pkcs_digest(CK_MECHANISM_TYPE mech_type, u_char * msg, u_int msglen,
+ u_char * digest, size_t * digestlen)
+{
+ int rval = SNMPERR_SUCCESS;
+ CK_SESSION_HANDLE hSession;
+ CK_MECHANISM mech;
+ if (get_session_handle(mech_type, CKF_DIGEST, &hSession) != CKR_OK ||
+ hSession == NULL) {
+ QUITFUN(SNMPERR_GENERR, pkcs_digest_quit);
+ }
+
+ mech.mechanism = mech_type;
+ mech.pParameter = NULL_PTR;
+ mech.ulParameterLen = 0;
+
+ /* initialize a message-digesting operation */
+ if (C_DigestInit(hSession, &mech)!= CKR_OK ) {
+ QUITFUN(SNMPERR_GENERR, pkcs_digest_quit);
+ }
+ /* continue a multiple-part message-digesting operation */
+ if (C_DigestUpdate(hSession, msg, msglen) != CKR_OK ) {
+ QUITFUN(SNMPERR_GENERR, pkcs_digest_quit);
+ }
+ /* finish a multiple-part message-digesting operation */
+ if (C_DigestFinal(hSession, digest, digestlen) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_digest_quit);
+ }
+
+ pkcs_digest_quit:
+ return rval;
+}
+
+/*
+ * encrypt plaintext into ciphertext using key and iv.
+ */
+int
+pkcs_encrpyt(CK_MECHANISM_TYPE mech_type, u_char * key, u_int keylen,
+ u_char * iv, u_int ivlen,
+ u_char * plaintext, u_int ptlen,
+ u_char * ciphertext, size_t * ctlen)
+{
+ int rval = SNMPERR_SUCCESS;
+ int pad_size, offset;
+ /*
+ * Key template
+ */
+ CK_OBJECT_CLASS class = CKO_SECRET_KEY;
+ CK_KEY_TYPE keytype = CKK_DES;
+ /* CK_KEY_TYPE AESkeytype = CKK_AES; */
+ CK_BBOOL truevalue = TRUE;
+ CK_BBOOL falsevalue = FALSE;
+
+ CK_ATTRIBUTE template[] = {
+ {CKA_CLASS, &class, sizeof (class)},
+ {CKA_KEY_TYPE, &keytype, sizeof (keytype)},
+ {CKA_ENCRYPT, &truevalue, sizeof (truevalue)},
+ {CKA_TOKEN, &falsevalue, sizeof (falsevalue)},
+ {CKA_VALUE, key, keylen}
+ };
+
+ CK_SESSION_HANDLE hSession;
+ CK_MECHANISM mech;
+ CK_OBJECT_HANDLE hkey = (CK_OBJECT_HANDLE) 0;
+
+ if (get_session_handle(mech_type, CKF_ENCRYPT,
+ &hSession) != CKR_OK ||
+ hSession == NULL) {
+ QUITFUN(SNMPERR_GENERR, pkcs_encrypt_quit);
+ }
+
+ if (C_CreateObject(hSession, template,
+ (sizeof (template) / sizeof (CK_ATTRIBUTE)),
+ &hkey) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_encrypt_quit);
+ }
+
+ mech.mechanism = mech_type;
+ mech.pParameter = iv;
+ mech.ulParameterLen = ivlen;
+
+ /* initialize an encryption operation */
+ if (C_EncryptInit(hSession, &mech, hkey) != CKR_OK ) {
+ QUITFUN(SNMPERR_GENERR, pkcs_encrypt_quit);
+ }
+
+ /* for DES */
+ pad_size = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES);
+
+ if (ptlen + pad_size - ptlen % pad_size > *ctlen) {
+ QUITFUN(SNMPERR_GENERR, pkcs_encrypt_quit);
+ }
+
+ for (offset = 0; offset < ptlen; offset += pad_size) {
+ /* continue a multiple-part encryption operation */
+ if (C_EncryptUpdate(hSession, plaintext + offset, pad_size,
+ ciphertext + offset, ctlen) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_encrypt_quit);
+ }
+ }
+
+ /* finish a multiple-part encryption operation */
+ if (C_EncryptFinal(hSession, ciphertext + offset, ctlen) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_encrypt_quit);
+ }
+ *ctlen = offset;
+
+ pkcs_encrypt_quit:
+ if (key != (CK_OBJECT_HANDLE) 0) {
+ (void) C_DestroyObject(hSession, hkey);
+ }
+ return rval;
+}
+
+/*
+ * decrypt ciphertext into plaintext using key and iv.
+ */
+int
+pkcs_decrpyt(CK_MECHANISM_TYPE mech_type, u_char * key, u_int keylen,
+ u_char * iv, u_int ivlen,
+ u_char * ciphertext, u_int ctlen,
+ u_char * plaintext, size_t * ptlen)
+{
+ int rval = SNMPERR_SUCCESS;
+ /*
+ * Key template
+ */
+ CK_OBJECT_CLASS class = CKO_SECRET_KEY;
+ CK_KEY_TYPE keytype = CKK_DES;
+ /* CK_KEY_TYPE AESkeytype = CKK_AES; */
+ CK_BBOOL truevalue = TRUE;
+ CK_BBOOL falsevalue= FALSE;
+ CK_ATTRIBUTE template[] = {
+ {CKA_CLASS, &class, sizeof (class)},
+ {CKA_KEY_TYPE, &keytype, sizeof (keytype)},
+ {CKA_DECRYPT, &truevalue, sizeof (truevalue)},
+ {CKA_TOKEN, &falsevalue, sizeof (falsevalue)},
+ {CKA_VALUE, key, keylen}
+ };
+ CK_SESSION_HANDLE hSession;
+ CK_MECHANISM mech;
+ CK_OBJECT_HANDLE hkey = (CK_OBJECT_HANDLE) 0;
+
+ if (get_session_handle(mech_type, CKF_DECRYPT, &hSession) != CKR_OK ||
+ hSession == NULL) {
+ QUITFUN(SNMPERR_GENERR, pkcs_decrypt_quit);
+ }
+
+ if (C_CreateObject(hSession, template,
+ (sizeof (template) / sizeof (CK_ATTRIBUTE)), &hkey) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_decrypt_quit);
+ }
+
+ mech.mechanism = mech_type;
+ mech.pParameter = iv;
+ mech.ulParameterLen = ivlen;
+
+ /* initialize a decryption operation */
+ if (C_DecryptInit(hSession, &mech, hkey) != CKR_OK ) {
+ QUITFUN(SNMPERR_GENERR, pkcs_decrypt_quit);
+ }
+ /* continue a multiple-part decryption operation */
+ if (C_DecryptUpdate(hSession, ciphertext, ctlen, plaintext,
+ ptlen) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_decrypt_quit);
+ }
+ /* finish a multiple-part decryption operation */
+ if (C_DecryptFinal(hSession, plaintext, ptlen) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_decrypt_quit);
+ }
+
+ pkcs_decrypt_quit:
+ if (key != (CK_OBJECT_HANDLE) 0) {
+ (void) C_DestroyObject(hSession, hkey);
+ }
+ return rval;
+}
+
+/*
+ * Convert a passphrase into a master user key, Ku, according to the
+ * algorithm given in RFC 2274 concerning the SNMPv3 User Security Model (USM)
+ */
+int
+pkcs_generate_Ku(CK_MECHANISM_TYPE mech_type, u_char * passphrase, u_int pplen,
+ u_char * Ku, size_t * kulen)
+{
+ int rval = SNMPERR_SUCCESS, nbytes = USM_LENGTH_EXPANDED_PASSPHRASE;
+ CK_SESSION_HANDLE hSession;
+ CK_MECHANISM mech;
+ u_int i, pindex = 0;
+ u_char buf[USM_LENGTH_KU_HASHBLOCK], *bufp;
+
+ if (get_session_handle(mech_type, CKF_DIGEST, &hSession) != CKR_OK ||
+ hSession == NULL) {
+ QUITFUN(SNMPERR_GENERR, pkcs_generate_Ku_quit);
+ }
+
+ mech.mechanism = mech_type;
+ mech.pParameter = NULL_PTR;
+ mech.ulParameterLen = 0;
+
+ /* initialize a message-digesting operation */
+ if (C_DigestInit(hSession, &mech)!= CKR_OK ) {
+ QUITFUN(SNMPERR_GENERR, pkcs_generate_Ku_quit);
+ }
+
+ while (nbytes > 0) {
+ bufp = buf;
+ for (i = 0; i < USM_LENGTH_KU_HASHBLOCK; i++) {
+ /*
+ * fill a buffer with the supplied passphrase. When the end
+ * of the passphrase is reachedcycle back to the beginning.
+ */
+ *bufp++ = passphrase[pindex++ % pplen];
+ }
+ /* continue a multiple-part message-digesting operation */
+ if (C_DigestUpdate(hSession, buf, USM_LENGTH_KU_HASHBLOCK) != CKR_OK ) {
+ QUITFUN(SNMPERR_GENERR, pkcs_generate_Ku_quit);
+ }
+ nbytes -= USM_LENGTH_KU_HASHBLOCK;
+ }
+ /* finish a multiple-part message-digesting operation */
+ if (C_DigestFinal(hSession, Ku, kulen) != CKR_OK) {
+ QUITFUN(SNMPERR_GENERR, pkcs_generate_Ku_quit);
+ }
+
+ pkcs_generate_Ku_quit:
+ return rval;
+}
+
+/*
+ * pkcserr_stringor: returns a string representation of the given
+ * return code.
+ */
+static char *
+pkcserr_string(CK_RV rv)
+{
+ static char errstr[128];
+ switch (rv) {
+ case CKR_OK:
+ return ("CKR_OK");
+ break;
+ case CKR_CANCEL:
+ return ("CKR_CANCEL");
+ break;
+ case CKR_HOST_MEMORY:
+ return ("CKR_HOST_MEMORY");
+ break;
+ case CKR_SLOT_ID_INVALID:
+ return ("CKR_SLOT_ID_INVALID");
+ break;
+ case CKR_GENERAL_ERROR:
+ return ("CKR_GENERAL_ERROR");
+ break;
+ case CKR_FUNCTION_FAILED:
+ return ("CKR_FUNCTION_FAILED");
+ break;
+ case CKR_ARGUMENTS_BAD:
+ return ("CKR_ARGUMENTS_BAD");
+ break;
+ case CKR_NO_EVENT:
+ return ("CKR_NO_EVENT");
+ break;
+ case CKR_NEED_TO_CREATE_THREADS:
+ return ("CKR_NEED_TO_CREATE_THREADS");
+ break;
+ case CKR_CANT_LOCK:
+ return ("CKR_CANT_LOCK");
+ break;
+ case CKR_ATTRIBUTE_READ_ONLY:
+ return ("CKR_ATTRIBUTE_READ_ONLY");
+ break;
+ case CKR_ATTRIBUTE_SENSITIVE:
+ return ("CKR_ATTRIBUTE_SENSITIVE");
+ break;
+ case CKR_ATTRIBUTE_TYPE_INVALID:
+ return ("CKR_ATTRIBUTE_TYPE_INVALID");
+ break;
+ case CKR_ATTRIBUTE_VALUE_INVALID:
+ return ("CKR_ATTRIBUTE_VALUE_INVALID");
+ break;
+ case CKR_DATA_INVALID:
+ return ("CKR_DATA_INVALID");
+ break;
+ case CKR_DATA_LEN_RANGE:
+ return ("CKR_DATA_LEN_RANGE");
+ break;
+ case CKR_DEVICE_ERROR:
+ return ("CKR_DEVICE_ERROR");
+ break;
+ case CKR_DEVICE_MEMORY:
+ return ("CKR_DEVICE_MEMORY");
+ break;
+ case CKR_DEVICE_REMOVED:
+ return ("CKR_DEVICE_REMOVED");
+ break;
+ case CKR_ENCRYPTED_DATA_INVALID:
+ return ("CKR_ENCRYPTED_DATA_INVALID");
+ break;
+ case CKR_ENCRYPTED_DATA_LEN_RANGE:
+ return ("CKR_ENCRYPTED_DATA_LEN_RANGE");
+ break;
+ case CKR_FUNCTION_CANCELED:
+ return ("CKR_FUNCTION_CANCELED");
+ break;
+ case CKR_FUNCTION_NOT_PARALLEL:
+ return ("CKR_FUNCTION_NOT_PARALLEL");
+ break;
+ case CKR_FUNCTION_NOT_SUPPORTED:
+ return ("CKR_FUNCTION_NOT_SUPPORTED");
+ break;
+ case CKR_KEY_HANDLE_INVALID:
+ return ("CKR_KEY_HANDLE_INVALID");
+ break;
+ case CKR_KEY_SIZE_RANGE:
+ return ("CKR_KEY_SIZE_RANGE");
+ break;
+ case CKR_KEY_TYPE_INCONSISTENT:
+ return ("CKR_KEY_TYPE_INCONSISTENT");
+ break;
+ case CKR_KEY_NOT_NEEDED:
+ return ("CKR_KEY_NOT_NEEDED");
+ break;
+ case CKR_KEY_CHANGED:
+ return ("CKR_KEY_CHANGED");
+ break;
+ case CKR_KEY_NEEDED:
+ return ("CKR_KEY_NEEDED");
+ break;
+ case CKR_KEY_INDIGESTIBLE:
+ return ("CKR_KEY_INDIGESTIBLE");
+ break;
+ case CKR_KEY_FUNCTION_NOT_PERMITTED:
+ return ("CKR_KEY_FUNCTION_NOT_PERMITTED");
+ break;
+ case CKR_KEY_NOT_WRAPPABLE:
+ return ("CKR_KEY_NOT_WRAPPABLE");
+ break;
+ case CKR_KEY_UNEXTRACTABLE:
+ return ("CKR_KEY_UNEXTRACTABLE");
+ break;
+ case CKR_MECHANISM_INVALID:
+ return ("CKR_MECHANISM_INVALID");
+ break;
+ case CKR_MECHANISM_PARAM_INVALID:
+ return ("CKR_MECHANISM_PARAM_INVALID");
+ break;
+ case CKR_OBJECT_HANDLE_INVALID:
+ return ("CKR_OBJECT_HANDLE_INVALID");
+ break;
+ case CKR_OPERATION_ACTIVE:
+ return ("CKR_OPERATION_ACTIVE");
+ break;
+ case CKR_OPERATION_NOT_INITIALIZED:
+ return ("CKR_OPERATION_NOT_INITIALIZED");
+ break;
+ case CKR_PIN_INCORRECT:
+ return ("CKR_PIN_INCORRECT");
+ break;
+ case CKR_PIN_INVALID:
+ return ("CKR_PIN_INVALID");
+ break;
+ case CKR_PIN_LEN_RANGE:
+ return ("CKR_PIN_LEN_RANGE");
+ break;
+ case CKR_PIN_EXPIRED:
+ return ("CKR_PIN_EXPIRED");
+ break;
+ case CKR_PIN_LOCKED:
+ return ("CKR_PIN_LOCKED");
+ break;
+ case CKR_SESSION_CLOSED:
+ return ("CKR_SESSION_CLOSED");
+ break;
+ case CKR_SESSION_COUNT:
+ return ("CKR_SESSION_COUNT");
+ break;
+ case CKR_SESSION_HANDLE_INVALID:
+ return ("CKR_SESSION_HANDLE_INVALID");
+ break;
+ case CKR_SESSION_PARALLEL_NOT_SUPPORTED:
+ return ("CKR_SESSION_PARALLEL_NOT_SUPPORTED");
+ break;
+ case CKR_SESSION_READ_ONLY:
+ return ("CKR_SESSION_READ_ONLY");
+ break;
+ case CKR_SESSION_EXISTS:
+ return ("CKR_SESSION_EXISTS");
+ break;
+ case CKR_SESSION_READ_ONLY_EXISTS:
+ return ("CKR_SESSION_READ_ONLY_EXISTS");
+ break;
+ case CKR_SESSION_READ_WRITE_SO_EXISTS:
+ return ("CKR_SESSION_READ_WRITE_SO_EXISTS");
+ break;
+ case CKR_SIGNATURE_INVALID:
+ return ("CKR_SIGNATURE_INVALID");
+ break;
+ case CKR_SIGNATURE_LEN_RANGE:
+ return ("CKR_SIGNATURE_LEN_RANGE");
+ break;
+ case CKR_TEMPLATE_INCOMPLETE:
+ return ("CKR_TEMPLATE_INCOMPLETE");
+ break;
+ case CKR_TEMPLATE_INCONSISTENT:
+ return ("CKR_TEMPLATE_INCONSISTENT");
+ break;
+ case CKR_TOKEN_NOT_PRESENT:
+ return ("CKR_TOKEN_NOT_PRESENT");
+ break;
+ case CKR_TOKEN_NOT_RECOGNIZED:
+ return ("CKR_TOKEN_NOT_RECOGNIZED");
+ break;
+ case CKR_TOKEN_WRITE_PROTECTED:
+ return ("CKR_TOKEN_WRITE_PROTECTED");
+ break;
+ case CKR_UNWRAPPING_KEY_HANDLE_INVALID:
+ return ("CKR_UNWRAPPING_KEY_HANDLE_INVALID");
+ break;
+ case CKR_UNWRAPPING_KEY_SIZE_RANGE:
+ return ("CKR_UNWRAPPING_KEY_SIZE_RANGE");
+ break;
+ case CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT:
+ return ("CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT");
+ break;
+ case CKR_USER_ALREADY_LOGGED_IN:
+ return ("CKR_USER_ALREADY_LOGGED_IN");
+ break;
+ case CKR_USER_NOT_LOGGED_IN:
+ return ("CKR_USER_NOT_LOGGED_IN");
+ break;
+ case CKR_USER_PIN_NOT_INITIALIZED:
+ return ("CKR_USER_PIN_NOT_INITIALIZED");
+ break;
+ case CKR_USER_TYPE_INVALID:
+ return ("CKR_USER_TYPE_INVALID");
+ break;
+ case CKR_USER_ANOTHER_ALREADY_LOGGED_IN:
+ return ("CKR_USER_ANOTHER_ALREADY_LOGGED_IN");
+ break;
+ case CKR_USER_TOO_MANY_TYPES:
+ return ("CKR_USER_TOO_MANY_TYPES");
+ break;
+ case CKR_WRAPPED_KEY_INVALID:
+ return ("CKR_WRAPPED_KEY_INVALID");
+ break;
+ case CKR_WRAPPED_KEY_LEN_RANGE:
+ return ("CKR_WRAPPED_KEY_LEN_RANGE");
+ break;
+ case CKR_WRAPPING_KEY_HANDLE_INVALID:
+ return ("CKR_WRAPPING_KEY_HANDLE_INVALID");
+ break;
+ case CKR_WRAPPING_KEY_SIZE_RANGE:
+ return ("CKR_WRAPPING_KEY_SIZE_RANGE");
+ break;
+ case CKR_WRAPPING_KEY_TYPE_INCONSISTENT:
+ return ("CKR_WRAPPING_KEY_TYPE_INCONSISTENT");
+ break;
+ case CKR_RANDOM_SEED_NOT_SUPPORTED:
+ return ("CKR_RANDOM_SEED_NOT_SUPPORTED");
+ break;
+ case CKR_RANDOM_NO_RNG:
+ return ("CKR_RANDOM_NO_RNG");
+ break;
+ case CKR_DOMAIN_PARAMS_INVALID:
+ return ("CKR_DOMAIN_PARAMS_INVALID");
+ break;
+ case CKR_BUFFER_TOO_SMALL:
+ return ("CKR_BUFFER_TOO_SMALL");
+ break;
+ case CKR_SAVED_STATE_INVALID:
+ return ("CKR_SAVED_STATE_INVALID");
+ break;
+ case CKR_INFORMATION_SENSITIVE:
+ return ("CKR_INFORMATION_SENSITIVE");
+ break;
+ case CKR_STATE_UNSAVEABLE:
+ return ("CKR_STATE_UNSAVEABLE");
+ break;
+ case CKR_CRYPTOKI_NOT_INITIALIZED:
+ return ("CKR_CRYPTOKI_NOT_INITIALIZED");
+ break;
+ case CKR_CRYPTOKI_ALREADY_INITIALIZED:
+ return ("CKR_CRYPTOKI_ALREADY_INITIALIZED");
+ break;
+ case CKR_MUTEX_BAD:
+ return ("CKR_MUTEX_BAD");
+ break;
+ case CKR_MUTEX_NOT_LOCKED:
+ return ("CKR_MUTEX_NOT_LOCKED");
+ break;
+ case CKR_VENDOR_DEFINED:
+ return ("CKR_VENDOR_DEFINED");
+ break;
+ default:
+ /* rv not found */
+ snprintf(errstr, sizeof (errstr),
+ "Unknown return code: 0x%x", rv);
+ return (errstr);
+ break;
+ }
+}
+#else
+int pkcs_unused; /* Suppress "empty translation unit" warning */
+#endif
diff --git a/snmplib/read_config.c b/snmplib/read_config.c
new file mode 100644
index 0000000..d512c5d
--- /dev/null
+++ b/snmplib/read_config.c
@@ -0,0 +1,2357 @@
+/*
+ * read_config.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 read_config parsing various configuration files at run time
+ * @ingroup library
+ *
+ * The read_config related functions are a fairly extensible system of
+ * parsing various configuration files at the run time.
+ *
+ * The idea is that the calling application is able to register
+ * handlers for certain tokens specified in certain types
+ * of files. The read_configs function can then be called
+ * to look for all the files that it has registrations for,
+ * find the first word on each line, and pass the remainder
+ * to the appropriately registered handler.
+ *
+ * For persistent configuration storage you will need to use the
+ * read_config_read_data, read_config_store, and read_config_store_data
+ * APIs in conjunction with first registering a
+ * callback so when the agent shutsdown for whatever reason data is written
+ * to your configuration files. The following explains in more detail the
+ * sequence to make this happen.
+ *
+ * This is the callback registration API, you need to call this API with
+ * the appropriate parameters in order to configure persistent storage needs.
+ *
+ * int snmp_register_callback(int major, int minor,
+ * SNMPCallback *new_callback,
+ * void *arg);
+ *
+ * You will need to set major to SNMP_CALLBACK_LIBRARY, minor to
+ * SNMP_CALLBACK_STORE_DATA. arg is whatever you want.
+ *
+ * Your callback function's prototype is:
+ * int (SNMPCallback) (int majorID, int minorID, void *serverarg,
+ * void *clientarg);
+ *
+ * The majorID, minorID and clientarg are what you passed in the callback
+ * registration above. When the callback is called you have to essentially
+ * transfer all your state from memory to disk. You do this by generating
+ * configuration lines into a buffer. The lines are of the form token
+ * followed by token parameters.
+ *
+ * Finally storing is done using read_config_store(type, buffer);
+ * type is the application name this can be obtained from:
+ *
+ * netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_APPTYPE);
+ *
+ * Now, reading back the data: This is done by registering a config handler
+ * for your token using the register_config_handler function. Your
+ * handler will be invoked and you can parse in the data using the
+ * read_config_read APIs.
+ *
+ * @{
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <stdio.h>
+#include <ctype.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 HAVE_SYS_PARAM_H
+#include <sys/param.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
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.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_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#include <errno.h>
+
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# 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_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/library/read_config.h> /* for "internal" definitions */
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/parse.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/callback.h>
+
+netsnmp_feature_child_of(read_config_all, libnetsnmp)
+
+netsnmp_feature_child_of(unregister_app_config_handler, read_config_all)
+netsnmp_feature_child_of(read_config_register_app_prenetsnmp_mib_handler, netsnmp_unused)
+netsnmp_feature_child_of(read_config_register_const_config_handler, netsnmp_unused)
+
+static int config_errors;
+
+struct config_files *config_files = NULL;
+
+
+static struct config_line *
+internal_register_config_handler(const char *type_param,
+ const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void), const char *help,
+ int when)
+{
+ struct config_files **ctmp = &config_files;
+ struct config_line **ltmp;
+ const char *type = type_param;
+
+ if (type == NULL || *type == '\0') {
+ type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ }
+
+ /*
+ * Handle multiple types (recursively)
+ */
+ if (strchr(type, ':')) {
+ struct config_line *ltmp2 = NULL;
+ char buf[STRINGMAX];
+ char *cptr = buf;
+
+ strlcpy(buf, type, STRINGMAX);
+ while (cptr) {
+ char* c = cptr;
+ cptr = strchr(cptr, ':');
+ if(cptr) {
+ *cptr = '\0';
+ ++cptr;
+ }
+ ltmp2 = internal_register_config_handler(c, token, parser,
+ releaser, help, when);
+ }
+ return ltmp2;
+ }
+
+ /*
+ * Find type in current list -OR- create a new file type.
+ */
+ while (*ctmp != NULL && strcmp((*ctmp)->fileHeader, type)) {
+ ctmp = &((*ctmp)->next);
+ }
+
+ if (*ctmp == NULL) {
+ *ctmp = (struct config_files *)
+ calloc(1, sizeof(struct config_files));
+ if (!*ctmp) {
+ return NULL;
+ }
+
+ (*ctmp)->fileHeader = strdup(type);
+ DEBUGMSGTL(("9:read_config:type", "new type %s\n", type));
+ }
+
+ DEBUGMSGTL(("9:read_config:register_handler", "registering %s %s\n",
+ type, token));
+ /*
+ * Find parser type in current list -OR- create a new
+ * line parser entry.
+ */
+ ltmp = &((*ctmp)->start);
+
+ while (*ltmp != NULL && strcmp((*ltmp)->config_token, token)) {
+ ltmp = &((*ltmp)->next);
+ }
+
+ if (*ltmp == NULL) {
+ *ltmp = (struct config_line *)
+ calloc(1, sizeof(struct config_line));
+ if (!*ltmp) {
+ return NULL;
+ }
+
+ (*ltmp)->config_time = when;
+ (*ltmp)->config_token = strdup(token);
+ if (help != NULL)
+ (*ltmp)->help = strdup(help);
+ }
+
+ /*
+ * Add/Replace the parse/free functions for the given line type
+ * in the given file type.
+ */
+ (*ltmp)->parse_line = parser;
+ (*ltmp)->free_func = releaser;
+
+ return (*ltmp);
+
+} /* end register_config_handler() */
+
+struct config_line *
+register_prenetsnmp_mib_handler(const char *type,
+ const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void), const char *help)
+{
+ return internal_register_config_handler(type, token, parser, releaser,
+ help, PREMIB_CONFIG);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_READ_CONFIG_REGISTER_APP_PRENETSNMP_MIB_HANDLER
+struct config_line *
+register_app_prenetsnmp_mib_handler(const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void),
+ const char *help)
+{
+ return (register_prenetsnmp_mib_handler
+ (NULL, token, parser, releaser, help));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_READ_CONFIG_REGISTER_APP_PRENETSNMP_MIB_HANDLER */
+
+/**
+ * register_config_handler registers handlers for certain tokens specified in
+ * certain types of files.
+ *
+ * Allows a module writer use/register multiple configuration files based off
+ * of the type parameter. A module writer may want to set up multiple
+ * configuration files to separate out related tasks/variables or just for
+ * management of where to put tokens as the module or modules get more complex
+ * in regard to handling token registrations.
+ *
+ * @param type the configuration file used, e.g., if snmp.conf is the
+ * file where the token is located use "snmp" here.
+ * Multiple colon separated tokens might be used.
+ * If NULL or "" then the configuration file used will be
+ * \<application\>.conf.
+ *
+ * @param token the token being parsed from the file. Must be non-NULL.
+ *
+ * @param parser the handler function pointer that use the specified
+ * token and the rest of the line to do whatever is required
+ * Should be non-NULL in order to make use of this API.
+ *
+ * @param releaser if non-NULL, the function specified is called when
+ * unregistering config handler or when configuration
+ * files are re-read.
+ * This function should free any resources allocated by
+ * the token handler function.
+ *
+ * @param help if non-NULL, used to display help information on the
+ * expected arguments after the token.
+ *
+ * @return Pointer to a new config line entry or NULL on error.
+ */
+struct config_line *
+register_config_handler(const char *type,
+ const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void), const char *help)
+{
+ return internal_register_config_handler(type, token, parser, releaser,
+ help, NORMAL_CONFIG);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_READ_CONFIG_REGISTER_CONST_CONFIG_HANDLER
+struct config_line *
+register_const_config_handler(const char *type,
+ const char *token,
+ void (*parser) (const char *, const char *),
+ void (*releaser) (void), const char *help)
+{
+ return internal_register_config_handler(type, token,
+ (void(*)(const char *, char *))
+ parser, releaser,
+ help, NORMAL_CONFIG);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_READ_CONFIG_REGISTER_CONST_CONFIG_HANDLER */
+
+struct config_line *
+register_app_config_handler(const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void), const char *help)
+{
+ return (register_config_handler(NULL, token, parser, releaser, help));
+}
+
+
+
+/**
+ * uregister_config_handler un-registers handlers given a specific type_param
+ * and token.
+ *
+ * @param type_param the configuration file used where the token is located.
+ * Used to lookup the config file entry
+ *
+ * @param token the token that is being unregistered
+ *
+ * @return void
+ */
+void
+unregister_config_handler(const char *type_param, const char *token)
+{
+ struct config_files **ctmp = &config_files;
+ struct config_line **ltmp;
+ const char *type = type_param;
+
+ if (type == NULL || *type == '\0') {
+ type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ }
+
+ /*
+ * Handle multiple types (recursively)
+ */
+ if (strchr(type, ':')) {
+ char buf[STRINGMAX];
+ char *cptr = buf;
+
+ strlcpy(buf, type, STRINGMAX);
+ while (cptr) {
+ char* c = cptr;
+ cptr = strchr(cptr, ':');
+ if(cptr) {
+ *cptr = '\0';
+ ++cptr;
+ }
+ unregister_config_handler(c, token);
+ }
+ return;
+ }
+
+ /*
+ * find type in current list
+ */
+ while (*ctmp != NULL && strcmp((*ctmp)->fileHeader, type)) {
+ ctmp = &((*ctmp)->next);
+ }
+
+ if (*ctmp == NULL) {
+ /*
+ * Not found, return.
+ */
+ return;
+ }
+
+ ltmp = &((*ctmp)->start);
+ if (*ltmp == NULL) {
+ /*
+ * Not found, return.
+ */
+ return;
+ }
+ if (strcmp((*ltmp)->config_token, token) == 0) {
+ /*
+ * found it at the top of the list
+ */
+ struct config_line *ltmp2 = (*ltmp)->next;
+ if ((*ltmp)->free_func)
+ (*ltmp)->free_func();
+ SNMP_FREE((*ltmp)->config_token);
+ SNMP_FREE((*ltmp)->help);
+ SNMP_FREE(*ltmp);
+ (*ctmp)->start = ltmp2;
+ return;
+ }
+ while ((*ltmp)->next != NULL
+ && strcmp((*ltmp)->next->config_token, token)) {
+ ltmp = &((*ltmp)->next);
+ }
+ if ((*ltmp)->next != NULL) {
+ struct config_line *ltmp2 = (*ltmp)->next->next;
+ if ((*ltmp)->next->free_func)
+ (*ltmp)->next->free_func();
+ SNMP_FREE((*ltmp)->next->config_token);
+ SNMP_FREE((*ltmp)->next->help);
+ SNMP_FREE((*ltmp)->next);
+ (*ltmp)->next = ltmp2;
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_UNREGISTER_APP_CONFIG_HANDLER
+void
+unregister_app_config_handler(const char *token)
+{
+ unregister_config_handler(NULL, token);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UNREGISTER_APP_CONFIG_HANDLER */
+
+void
+unregister_all_config_handlers(void)
+{
+ struct config_files *ctmp, *save;
+ struct config_line *ltmp;
+
+ /*
+ * Keep using config_files until there are no more!
+ */
+ for (ctmp = config_files; ctmp;) {
+ for (ltmp = ctmp->start; ltmp; ltmp = ctmp->start) {
+ unregister_config_handler(ctmp->fileHeader,
+ ltmp->config_token);
+ }
+ SNMP_FREE(ctmp->fileHeader);
+ save = ctmp->next;
+ SNMP_FREE(ctmp);
+ ctmp = save;
+ config_files = save;
+ }
+}
+
+#ifdef TESTING
+void
+print_config_handlers(void)
+{
+ struct config_files *ctmp = config_files;
+ struct config_line *ltmp;
+
+ for (; ctmp != NULL; ctmp = ctmp->next) {
+ DEBUGMSGTL(("read_config", "read_conf: %s\n", ctmp->fileHeader));
+ for (ltmp = ctmp->start; ltmp != NULL; ltmp = ltmp->next)
+ DEBUGMSGTL(("read_config", " %s\n",
+ ltmp->config_token));
+ }
+}
+#endif
+
+static unsigned int linecount;
+static const char *curfilename;
+
+struct config_line *
+read_config_get_handlers(const char *type)
+{
+ struct config_files *ctmp = config_files;
+ for (; ctmp != NULL && strcmp(ctmp->fileHeader, type);
+ ctmp = ctmp->next);
+ if (ctmp)
+ return ctmp->start;
+ return NULL;
+}
+
+int
+read_config_with_type_when(const char *filename, const char *type, int when)
+{
+ struct config_line *ctmp = read_config_get_handlers(type);
+ if (ctmp)
+ return read_config(filename, ctmp, when);
+ else
+ DEBUGMSGTL(("read_config",
+ "read_config: I have no registrations for type:%s,file:%s\n",
+ type, filename));
+ return SNMPERR_GENERR; /* No config files read */
+}
+
+int
+read_config_with_type(const char *filename, const char *type)
+{
+ return read_config_with_type_when(filename, type, EITHER_CONFIG);
+}
+
+
+struct config_line *
+read_config_find_handler(struct config_line *line_handlers,
+ const char *token)
+{
+ struct config_line *lptr;
+
+ for (lptr = line_handlers; lptr != NULL; lptr = lptr->next) {
+ if (!strcasecmp(token, lptr->config_token)) {
+ return lptr;
+ }
+ }
+ return NULL;
+}
+
+
+/*
+ * searches a config_line linked list for a match
+ */
+int
+run_config_handler(struct config_line *lptr,
+ const char *token, char *cptr, int when)
+{
+ char *cp;
+ lptr = read_config_find_handler(lptr, token);
+ if (lptr != NULL) {
+ if (when == EITHER_CONFIG || lptr->config_time == when) {
+ DEBUGMSGTL(("read_config:parser",
+ "Found a parser. Calling it: %s / %s\n", token,
+ cptr));
+ /*
+ * Make sure cptr is non-null
+ */
+ char tmpbuf[1];
+ if (!cptr) {
+ tmpbuf[0] = '\0';
+ cptr = tmpbuf;
+ }
+
+ /*
+ * Stomp on any trailing whitespace
+ */
+ cp = &(cptr[strlen(cptr)-1]);
+ while ((cp > cptr) && isspace((unsigned char)(*cp))) {
+ *(cp--) = '\0';
+ }
+ (*(lptr->parse_line)) (token, cptr);
+ }
+ else
+ DEBUGMSGTL(("9:read_config:parser",
+ "%s handler not registered for this time\n", token));
+ } else if (when != PREMIB_CONFIG &&
+ !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_NO_TOKEN_WARNINGS)) {
+ netsnmp_config_warn("Unknown token: %s.", token);
+ return SNMPERR_GENERR;
+ }
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * takens an arbitrary string and tries to intepret it based on the
+ * known configuration handlers for all registered types. May produce
+ * inconsistent results when multiple tokens of the same name are
+ * registered under different file types.
+ */
+
+/*
+ * we allow = delimeters here
+ */
+#define SNMP_CONFIG_DELIMETERS " \t="
+
+int
+snmp_config_when(char *line, int when)
+{
+ char *cptr, buf[STRINGMAX];
+ struct config_line *lptr = NULL;
+ struct config_files *ctmp = config_files;
+ char *st;
+
+ if (line == NULL) {
+ config_perror("snmp_config() called with a null string.");
+ return SNMPERR_GENERR;
+ }
+
+ strlcpy(buf, line, STRINGMAX);
+ cptr = strtok_r(buf, SNMP_CONFIG_DELIMETERS, &st);
+ if (!cptr) {
+ netsnmp_config_warn("Wrong format: %s", line);
+ return SNMPERR_GENERR;
+ }
+ if (cptr[0] == '[') {
+ if (cptr[strlen(cptr) - 1] != ']') {
+ netsnmp_config_error("no matching ']' for type %s.", cptr + 1);
+ return SNMPERR_GENERR;
+ }
+ cptr[strlen(cptr) - 1] = '\0';
+ lptr = read_config_get_handlers(cptr + 1);
+ if (lptr == NULL) {
+ netsnmp_config_error("No handlers regestered for type %s.",
+ cptr + 1);
+ return SNMPERR_GENERR;
+ }
+ cptr = strtok_r(NULL, SNMP_CONFIG_DELIMETERS, &st);
+ lptr = read_config_find_handler(lptr, cptr);
+ } else {
+ /*
+ * we have to find a token
+ */
+ for (; ctmp != NULL && lptr == NULL; ctmp = ctmp->next)
+ lptr = read_config_find_handler(ctmp->start, cptr);
+ }
+ if (lptr == NULL && netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_NO_TOKEN_WARNINGS)) {
+ netsnmp_config_warn("Unknown token: %s.", cptr);
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * use the original string instead since strtok_r messed up the original
+ */
+ line = skip_white(line + (cptr - buf) + strlen(cptr) + 1);
+
+ return (run_config_handler(lptr, cptr, line, when));
+}
+
+int
+netsnmp_config(char *line)
+{
+ int ret = SNMP_ERR_NOERROR;
+ DEBUGMSGTL(("snmp_config", "remembering line \"%s\"\n", line));
+ netsnmp_config_remember(line); /* always remember it so it's read
+ * processed after a free_config()
+ * call */
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HAVE_READ_CONFIG)) {
+ DEBUGMSGTL(("snmp_config", " ... processing it now\n"));
+ ret = snmp_config_when(line, NORMAL_CONFIG);
+ }
+ return ret;
+}
+
+void
+netsnmp_config_remember_in_list(char *line,
+ struct read_config_memory **mem)
+{
+ if (mem == NULL)
+ return;
+
+ while (*mem != NULL)
+ mem = &((*mem)->next);
+
+ *mem = SNMP_MALLOC_STRUCT(read_config_memory);
+ if (*mem != NULL) {
+ if (line)
+ (*mem)->line = strdup(line);
+ }
+}
+
+void
+netsnmp_config_remember_free_list(struct read_config_memory **mem)
+{
+ struct read_config_memory *tmpmem;
+ while (*mem) {
+ SNMP_FREE((*mem)->line);
+ tmpmem = (*mem)->next;
+ SNMP_FREE(*mem);
+ *mem = tmpmem;
+ }
+}
+
+void
+netsnmp_config_process_memory_list(struct read_config_memory **memp,
+ int when, int clear)
+{
+
+ struct read_config_memory *mem;
+
+ if (!memp)
+ return;
+
+ mem = *memp;
+
+ while (mem) {
+ DEBUGMSGTL(("read_config:mem", "processing memory: %s\n", mem->line));
+ snmp_config_when(mem->line, when);
+ mem = mem->next;
+ }
+
+ if (clear)
+ netsnmp_config_remember_free_list(memp);
+}
+
+/*
+ * default storage location implementation
+ */
+static struct read_config_memory *memorylist = NULL;
+
+void
+netsnmp_config_remember(char *line)
+{
+ netsnmp_config_remember_in_list(line, &memorylist);
+}
+
+void
+netsnmp_config_process_memories(void)
+{
+ netsnmp_config_process_memory_list(&memorylist, EITHER_CONFIG, 1);
+}
+
+void
+netsnmp_config_process_memories_when(int when, int clear)
+{
+ netsnmp_config_process_memory_list(&memorylist, when, clear);
+}
+
+/*******************************************************************-o-******
+ * read_config
+ *
+ * Parameters:
+ * *filename
+ * *line_handler
+ * when
+ *
+ * Read <filename> and process each line in accordance with the list of
+ * <line_handler> functions.
+ *
+ *
+ * For each line in <filename>, search the list of <line_handler>'s
+ * for an entry that matches the first token on the line. This comparison is
+ * case insensitive.
+ *
+ * For each match, check that <when> is the designated time for the
+ * <line_handler> function to be executed before processing the line.
+ *
+ * Returns SNMPERR_SUCCESS if the file is processed successfully.
+ * Returns SNMPERR_GENERR if it cannot.
+ * Note that individual config token errors do not trigger SNMPERR_GENERR
+ * It's only if the whole file cannot be processed for some reason.
+ */
+int
+read_config(const char *filename,
+ struct config_line *line_handler, int when)
+{
+ static int depth = 0;
+ static int files = 0;
+
+ const char * const prev_filename = curfilename;
+ const unsigned int prev_linecount = linecount;
+
+ FILE *ifile;
+ char *line = NULL; /* current line buffer */
+ size_t linesize = 0; /* allocated size of line */
+
+ /* reset file counter when recursion depth is 0 */
+ if (depth == 0)
+ files = 0;
+
+ if ((ifile = fopen(filename, "r")) == NULL) {
+#ifdef ENOENT
+ if (errno == ENOENT) {
+ DEBUGMSGTL(("read_config", "%s: %s\n", filename,
+ strerror(errno)));
+ } else
+#endif /* ENOENT */
+#ifdef EACCES
+ if (errno == EACCES) {
+ DEBUGMSGTL(("read_config", "%s: %s\n", filename,
+ strerror(errno)));
+ } else
+#endif /* EACCES */
+ {
+ snmp_log_perror(filename);
+ }
+ return SNMPERR_GENERR;
+ }
+
+#define CONFIG_MAX_FILES 4096
+ if (files > CONFIG_MAX_FILES) {
+ netsnmp_config_error("maximum conf file count (%d) exceeded\n",
+ CONFIG_MAX_FILES);
+ fclose(ifile);
+ return SNMPERR_GENERR;
+ }
+#define CONFIG_MAX_RECURSE_DEPTH 16
+ if (depth > CONFIG_MAX_RECURSE_DEPTH) {
+ netsnmp_config_error("nested include depth > %d\n",
+ CONFIG_MAX_RECURSE_DEPTH);
+ fclose(ifile);
+ return SNMPERR_GENERR;
+ }
+
+ linecount = 0;
+ curfilename = filename;
+
+ ++files;
+ ++depth;
+
+ DEBUGMSGTL(("read_config:file", "Reading configuration %s (%d)\n",
+ filename, when));
+
+ while (ifile) {
+ size_t linelen = 0; /* strlen of the current line */
+ char *cptr;
+ struct config_line *lptr = line_handler;
+
+ for (;;) {
+ if (linesize <= linelen + 1) {
+ char *tmp = realloc(line, linesize + 256);
+ if (tmp) {
+ line = tmp;
+ linesize += 256;
+ } else {
+ netsnmp_config_error("Failed to allocate memory\n");
+ free(line);
+ fclose(ifile);
+ return SNMPERR_GENERR;
+ }
+ }
+ if (fgets(line + linelen, linesize - linelen, ifile) == NULL) {
+ line[linelen] = '\0';
+ fclose (ifile);
+ ifile = NULL;
+ break;
+ }
+
+ linelen += strlen(line + linelen);
+
+ if (line[linelen - 1] == '\n') {
+ line[linelen - 1] = '\0';
+ break;
+ }
+ }
+
+ ++linecount;
+ DEBUGMSGTL(("9:read_config:line", "%s:%d examining: %s\n",
+ filename, linecount, line));
+ /*
+ * check blank line or # comment
+ */
+ if ((cptr = skip_white(line))) {
+ char token[STRINGMAX];
+
+ cptr = copy_nword(cptr, token, sizeof(token));
+ if (token[0] == '[') {
+ if (token[strlen(token) - 1] != ']') {
+ netsnmp_config_error("no matching ']' for type %s.",
+ &token[1]);
+ continue;
+ }
+ token[strlen(token) - 1] = '\0';
+ lptr = read_config_get_handlers(&token[1]);
+ if (lptr == NULL) {
+ netsnmp_config_error("No handlers regestered for type %s.",
+ &token[1]);
+ continue;
+ }
+ DEBUGMSGTL(("read_config:context",
+ "Switching to new context: %s%s\n",
+ ((cptr) ? "(this line only) " : ""),
+ &token[1]));
+ if (cptr == NULL) {
+ /*
+ * change context permanently
+ */
+ line_handler = lptr;
+ continue;
+ } else {
+ /*
+ * the rest of this line only applies.
+ */
+ cptr = copy_nword(cptr, token, sizeof(token));
+ }
+ } else if ((token[0] == 'i') && (strncasecmp(token,"include", 7 )==0)) {
+ if ( strcasecmp( token, "include" )==0) {
+ if (when != PREMIB_CONFIG &&
+ !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_NO_TOKEN_WARNINGS)) {
+ netsnmp_config_warn("Ambiguous token '%s' - use 'includeSearch' (or 'includeFile') instead.", token);
+ }
+ continue;
+ } else if ( strcasecmp( token, "includedir" )==0) {
+ DIR *d;
+ struct dirent *entry;
+ char fname[SNMP_MAXPATH];
+ int len;
+
+ if (cptr == NULL) {
+ if (when != PREMIB_CONFIG)
+ netsnmp_config_error("Blank line following %s token.", token);
+ continue;
+ }
+ if ((d=opendir(cptr)) == NULL ) {
+ if (when != PREMIB_CONFIG)
+ netsnmp_config_error("Can't open include dir '%s'.", cptr);
+ continue;
+ }
+ while ((entry = readdir( d )) != NULL ) {
+ if ( entry->d_name && entry->d_name[0] != '.') {
+ len = NAMLEN(entry);
+ if ((len > 5) && (strcmp(&(entry->d_name[len-5]),".conf") == 0)) {
+ snprintf(fname, SNMP_MAXPATH, "%s/%s",
+ cptr, entry->d_name);
+ (void)read_config(fname, line_handler, when);
+ }
+ }
+ }
+ closedir(d);
+ continue;
+ } else if ( strcasecmp( token, "includefile" )==0) {
+ char fname[SNMP_MAXPATH], *cp;
+
+ if (cptr == NULL) {
+ if (when != PREMIB_CONFIG)
+ netsnmp_config_error("Blank line following %s token.", token);
+ continue;
+ }
+ if ( cptr[0] == '/' ) {
+ strlcpy(fname, cptr, SNMP_MAXPATH);
+ } else {
+ strlcpy(fname, filename, SNMP_MAXPATH);
+ cp = strrchr(fname, '/');
+ if (!cp)
+ fname[0] = '\0';
+ else
+ *(++cp) = '\0';
+ strlcat(fname, cptr, SNMP_MAXPATH);
+ }
+ if (read_config(fname, line_handler, when) !=
+ SNMPERR_SUCCESS && when != PREMIB_CONFIG)
+ netsnmp_config_error("Included file '%s' not found.",
+ fname);
+ continue;
+ } else if ( strcasecmp( token, "includesearch" )==0) {
+ struct config_files ctmp;
+ int len, ret;
+
+ if (cptr == NULL) {
+ if (when != PREMIB_CONFIG)
+ netsnmp_config_error("Blank line following %s token.", token);
+ continue;
+ }
+ len = strlen(cptr);
+ ctmp.fileHeader = cptr;
+ ctmp.start = line_handler;
+ ctmp.next = NULL;
+ if ((len > 5) && (strcmp(&cptr[len-5],".conf") == 0))
+ cptr[len-5] = 0; /* chop off .conf */
+ ret = read_config_files_of_type(when,&ctmp);
+ if ((len > 5) && (cptr[len-5] == 0))
+ cptr[len-5] = '.'; /* restore .conf */
+ if (( ret != SNMPERR_SUCCESS ) && (when != PREMIB_CONFIG))
+ netsnmp_config_error("Included config '%s' not found.", cptr);
+ continue;
+ } else {
+ lptr = line_handler;
+ }
+ } else {
+ lptr = line_handler;
+ }
+ if (cptr == NULL) {
+ netsnmp_config_error("Blank line following %s token.", token);
+ } else {
+ DEBUGMSGTL(("read_config:line", "%s:%d examining: %s\n",
+ filename, linecount, line));
+ run_config_handler(lptr, token, cptr, when);
+ }
+ }
+ }
+ free(line);
+ linecount = prev_linecount;
+ curfilename = prev_filename;
+ --depth;
+ return SNMPERR_SUCCESS;
+
+} /* end read_config() */
+
+
+
+void
+free_config(void)
+{
+ struct config_files *ctmp = config_files;
+ struct config_line *ltmp;
+
+ for (; ctmp != NULL; ctmp = ctmp->next)
+ for (ltmp = ctmp->start; ltmp != NULL; ltmp = ltmp->next)
+ if (ltmp->free_func)
+ (*(ltmp->free_func)) ();
+}
+
+/*
+ * Return SNMPERR_SUCCESS if any config files are processed
+ * Return SNMPERR_GENERR if _no_ config files are processed
+ * Whether this is actually an error is left to the application
+ */
+int
+read_configs_optional(const char *optional_config, int when)
+{
+ char *newp, *cp, *st = NULL;
+ int ret = SNMPERR_GENERR;
+ char *type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+
+ if ((NULL == optional_config) || (NULL == type))
+ return ret;
+
+ DEBUGMSGTL(("read_configs_optional",
+ "reading optional configuration tokens for %s\n", type));
+
+ newp = strdup(optional_config); /* strtok_r messes it up */
+ cp = strtok_r(newp, ",", &st);
+ while (cp) {
+ struct stat statbuf;
+ if (stat(cp, &statbuf)) {
+ DEBUGMSGTL(("read_config",
+ "Optional File \"%s\" does not exist.\n", cp));
+ snmp_log_perror(cp);
+ } else {
+ DEBUGMSGTL(("read_config:opt",
+ "Reading optional config file: \"%s\"\n", cp));
+ if ( read_config_with_type_when(cp, type, when) == SNMPERR_SUCCESS )
+ ret = SNMPERR_SUCCESS;
+ }
+ cp = strtok_r(NULL, ",", &st);
+ }
+ free(newp);
+ return ret;
+}
+
+void
+read_configs(void)
+{
+ char *optional_config = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OPTIONALCONFIG);
+
+ snmp_call_callbacks(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_PRE_READ_CONFIG, NULL);
+
+ DEBUGMSGTL(("read_config", "reading normal configuration tokens\n"));
+
+ if ((NULL != optional_config) && (*optional_config == '-')) {
+ (void)read_configs_optional(++optional_config, NORMAL_CONFIG);
+ optional_config = NULL; /* clear, so we don't read them twice */
+ }
+
+ (void)read_config_files(NORMAL_CONFIG);
+
+ /*
+ * do this even when the normal above wasn't done
+ */
+ if (NULL != optional_config)
+ (void)read_configs_optional(optional_config, NORMAL_CONFIG);
+
+ netsnmp_config_process_memories_when(NORMAL_CONFIG, 1);
+
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HAVE_READ_CONFIG, 1);
+ snmp_call_callbacks(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG, NULL);
+}
+
+void
+read_premib_configs(void)
+{
+ char *optional_config = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OPTIONALCONFIG);
+
+ snmp_call_callbacks(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_PRE_PREMIB_READ_CONFIG, NULL);
+
+ DEBUGMSGTL(("read_config", "reading premib configuration tokens\n"));
+
+ if ((NULL != optional_config) && (*optional_config == '-')) {
+ (void)read_configs_optional(++optional_config, PREMIB_CONFIG);
+ optional_config = NULL; /* clear, so we don't read them twice */
+ }
+
+ (void)read_config_files(PREMIB_CONFIG);
+
+ if (NULL != optional_config)
+ (void)read_configs_optional(optional_config, PREMIB_CONFIG);
+
+ netsnmp_config_process_memories_when(PREMIB_CONFIG, 0);
+
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG, 1);
+ snmp_call_callbacks(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_PREMIB_READ_CONFIG, NULL);
+}
+
+/*******************************************************************-o-******
+ * set_configuration_directory
+ *
+ * Parameters:
+ * char *dir - value of the directory
+ * Sets the configuration directory. Multiple directories can be
+ * specified, but need to be seperated by 'ENV_SEPARATOR_CHAR'.
+ */
+void
+set_configuration_directory(const char *dir)
+{
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CONFIGURATION_DIR, dir);
+}
+
+/*******************************************************************-o-******
+ * get_configuration_directory
+ *
+ * Parameters: -
+ * Retrieve the configuration directory or directories.
+ * (For backwards compatibility that is:
+ * SNMPCONFPATH, SNMPSHAREPATH, SNMPLIBPATH, HOME/.snmp
+ * First check whether the value is set.
+ * If not set give it the default value.
+ * Return the value.
+ * We always retrieve it new, since we have to do it anyway if it is just set.
+ */
+const char *
+get_configuration_directory(void)
+{
+ char defaultPath[SPRINT_MAX_LEN];
+ char *homepath;
+
+ if (NULL == netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CONFIGURATION_DIR)) {
+ homepath = netsnmp_getenv("HOME");
+ snprintf(defaultPath, sizeof(defaultPath), "%s%c%s%c%s%s%s%s",
+ SNMPCONFPATH, ENV_SEPARATOR_CHAR,
+ SNMPSHAREPATH, ENV_SEPARATOR_CHAR, SNMPLIBPATH,
+ ((homepath == NULL) ? "" : ENV_SEPARATOR),
+ ((homepath == NULL) ? "" : homepath),
+ ((homepath == NULL) ? "" : "/.snmp"));
+ defaultPath[ sizeof(defaultPath)-1 ] = 0;
+ set_configuration_directory(defaultPath);
+ }
+ return (netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CONFIGURATION_DIR));
+}
+
+/*******************************************************************-o-******
+ * set_persistent_directory
+ *
+ * Parameters:
+ * char *dir - value of the directory
+ * Sets the configuration directory.
+ * No multiple directories may be specified.
+ * (However, this is not checked)
+ */
+void
+set_persistent_directory(const char *dir)
+{
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PERSISTENT_DIR, dir);
+}
+
+/*******************************************************************-o-******
+ * get_persistent_directory
+ *
+ * Parameters: -
+ * Function will retrieve the persisten directory value.
+ * First check whether the value is set.
+ * If not set give it the default value.
+ * Return the value.
+ * We always retrieve it new, since we have to do it anyway if it is just set.
+ */
+const char *
+get_persistent_directory(void)
+{
+ if (NULL == netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PERSISTENT_DIR)) {
+ const char *persdir = netsnmp_getenv("SNMP_PERSISTENT_DIR");
+ if (NULL == persdir)
+ persdir = NETSNMP_PERSISTENT_DIRECTORY;
+ set_persistent_directory(persdir);
+ }
+ return (netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PERSISTENT_DIR));
+}
+
+/*******************************************************************-o-******
+ * set_temp_file_pattern
+ *
+ * Parameters:
+ * char *pattern - value of the file pattern
+ * Sets the temp file pattern.
+ * Multiple patterns may not be specified.
+ * (However, this is not checked)
+ */
+void
+set_temp_file_pattern(const char *pattern)
+{
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TEMP_FILE_PATTERN, pattern);
+}
+
+/*******************************************************************-o-******
+ * get_temp_file_pattern
+ *
+ * Parameters: -
+ * Function will retrieve the temp file pattern value.
+ * First check whether the value is set.
+ * If not set give it the default value.
+ * Return the value.
+ * We always retrieve it new, since we have to do it anyway if it is just set.
+ */
+const char *
+get_temp_file_pattern(void)
+{
+ if (NULL == netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TEMP_FILE_PATTERN)) {
+ set_temp_file_pattern(NETSNMP_TEMP_FILE_PATTERN);
+ }
+ return (netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TEMP_FILE_PATTERN));
+}
+
+/**
+ * utility routine for read_config_files
+ *
+ * Return SNMPERR_SUCCESS if any config files are processed
+ * Return SNMPERR_GENERR if _no_ config files are processed
+ * Whether this is actually an error is left to the application
+ */
+static int
+read_config_files_in_path(const char *path, struct config_files *ctmp,
+ int when, const char *perspath, const char *persfile)
+{
+ int done, j;
+ char configfile[300];
+ char *cptr1, *cptr2, *envconfpath;
+ struct stat statbuf;
+ int ret = SNMPERR_GENERR;
+
+ if ((NULL == path) || (NULL == ctmp))
+ return SNMPERR_GENERR;
+
+ envconfpath = strdup(path);
+
+ DEBUGMSGTL(("read_config:path", " config path used for %s:%s (persistent path:%s)\n",
+ ctmp->fileHeader, envconfpath, perspath));
+ cptr1 = cptr2 = envconfpath;
+ done = 0;
+ while ((!done) && (*cptr2 != 0)) {
+ while (*cptr1 != 0 && *cptr1 != ENV_SEPARATOR_CHAR)
+ cptr1++;
+ if (*cptr1 == 0)
+ done = 1;
+ else
+ *cptr1 = 0;
+
+ DEBUGMSGTL(("read_config:dir", " config dir: %s\n", cptr2 ));
+ if (stat(cptr2, &statbuf) != 0) {
+ /*
+ * Directory not there, continue
+ */
+ DEBUGMSGTL(("read_config:dir", " Directory not present: %s\n", cptr2 ));
+ cptr2 = ++cptr1;
+ continue;
+ }
+#ifdef S_ISDIR
+ if (!S_ISDIR(statbuf.st_mode)) {
+ /*
+ * Not a directory, continue
+ */
+ DEBUGMSGTL(("read_config:dir", " Not a directory: %s\n", cptr2 ));
+ cptr2 = ++cptr1;
+ continue;
+ }
+#endif
+
+ /*
+ * for proper persistent storage retrieval, we need to read old backup
+ * copies of the previous storage files. If the application in
+ * question has died without the proper call to snmp_clean_persistent,
+ * then we read all the configuration files we can, starting with
+ * the oldest first.
+ */
+ if (strncmp(cptr2, perspath, strlen(perspath)) == 0 ||
+ (persfile != NULL &&
+ strncmp(cptr2, persfile, strlen(persfile)) == 0)) {
+ DEBUGMSGTL(("read_config:persist", " persist dir: %s\n", cptr2 ));
+ /*
+ * limit this to the known storage directory only
+ */
+ for (j = 0; j <= NETSNMP_MAX_PERSISTENT_BACKUPS; j++) {
+ snprintf(configfile, sizeof(configfile),
+ "%s/%s.%d.conf", cptr2,
+ ctmp->fileHeader, j);
+ configfile[ sizeof(configfile)-1 ] = 0;
+ if (stat(configfile, &statbuf) != 0) {
+ /*
+ * file not there, continue
+ */
+ break;
+ } else {
+ /*
+ * backup exists, read it
+ */
+ DEBUGMSGTL(("read_config_files",
+ "old config file found: %s, parsing\n",
+ configfile));
+ if (read_config(configfile, ctmp->start, when) == SNMPERR_SUCCESS)
+ ret = SNMPERR_SUCCESS;
+ }
+ }
+ }
+ snprintf(configfile, sizeof(configfile),
+ "%s/%s.conf", cptr2, ctmp->fileHeader);
+ configfile[ sizeof(configfile)-1 ] = 0;
+ if (read_config(configfile, ctmp->start, when) == SNMPERR_SUCCESS)
+ ret = SNMPERR_SUCCESS;
+ snprintf(configfile, sizeof(configfile),
+ "%s/%s.local.conf", cptr2, ctmp->fileHeader);
+ configfile[ sizeof(configfile)-1 ] = 0;
+ if (read_config(configfile, ctmp->start, when) == SNMPERR_SUCCESS)
+ ret = SNMPERR_SUCCESS;
+
+ if(done)
+ break;
+
+ cptr2 = ++cptr1;
+ }
+ SNMP_FREE(envconfpath);
+ return ret;
+}
+
+/*******************************************************************-o-******
+ * read_config_files
+ *
+ * Parameters:
+ * when == PREMIB_CONFIG, NORMAL_CONFIG -or- EITHER_CONFIG
+ *
+ *
+ * Traverse the list of config file types, performing the following actions
+ * for each --
+ *
+ * First, build a search path for config files. If the contents of
+ * environment variable SNMPCONFPATH are NULL, then use the following
+ * path list (where the last entry exists only if HOME is non-null):
+ *
+ * SNMPSHAREPATH:SNMPLIBPATH:${HOME}/.snmp
+ *
+ * Then, In each of these directories, read config files by the name of:
+ *
+ * <dir>/<fileHeader>.conf -AND-
+ * <dir>/<fileHeader>.local.conf
+ *
+ * where <fileHeader> is taken from the config file type structure.
+ *
+ *
+ * PREMIB_CONFIG causes free_config() to be invoked prior to any other action.
+ *
+ *
+ * EXITs if any 'config_errors' are logged while parsing config file lines.
+ *
+ * Return SNMPERR_SUCCESS if any config files are processed
+ * Return SNMPERR_GENERR if _no_ config files are processed
+ * Whether this is actually an error is left to the application
+ */
+int
+read_config_files_of_type(int when, struct config_files *ctmp)
+{
+ const char *confpath, *persfile, *envconfpath;
+ char *perspath;
+ int ret = SNMPERR_GENERR;
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_PERSIST_STATE)
+ || netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DISABLE_CONFIG_LOAD)
+ || (NULL == ctmp)) return ret;
+
+ /*
+ * these shouldn't change
+ */
+ confpath = get_configuration_directory();
+ persfile = netsnmp_getenv("SNMP_PERSISTENT_FILE");
+ envconfpath = netsnmp_getenv("SNMPCONFPATH");
+
+
+ /*
+ * read the config files. strdup() the result of
+ * get_persistent_directory() to avoid that parsing the "persistentDir"
+ * keyword transforms the perspath pointer into a dangling pointer.
+ */
+ perspath = strdup(get_persistent_directory());
+ if (envconfpath == NULL) {
+ /*
+ * read just the config files (no persistent stuff), since
+ * persistent path can change via conf file. Then get the
+ * current persistent directory, and read files there.
+ */
+ if ( read_config_files_in_path(confpath, ctmp, when, perspath,
+ persfile) == SNMPERR_SUCCESS )
+ ret = SNMPERR_SUCCESS;
+ free(perspath);
+ perspath = strdup(get_persistent_directory());
+ if ( read_config_files_in_path(perspath, ctmp, when, perspath,
+ persfile) == SNMPERR_SUCCESS )
+ ret = SNMPERR_SUCCESS;
+ }
+ else {
+ /*
+ * only read path specified by user
+ */
+ if ( read_config_files_in_path(envconfpath, ctmp, when, perspath,
+ persfile) == SNMPERR_SUCCESS )
+ ret = SNMPERR_SUCCESS;
+ }
+ free(perspath);
+ return ret;
+}
+
+/*
+ * Return SNMPERR_SUCCESS if any config files are processed
+ * Return SNMPERR_GENERR if _no_ config files are processed
+ * Whether this is actually an error is left to the application
+ */
+int
+read_config_files(int when) {
+
+ struct config_files *ctmp = config_files;
+ int ret = SNMPERR_GENERR;
+
+ config_errors = 0;
+
+ if (when == PREMIB_CONFIG)
+ free_config();
+
+ /*
+ * read all config file types
+ */
+ for (; ctmp != NULL; ctmp = ctmp->next) {
+ if ( read_config_files_of_type(when, ctmp) == SNMPERR_SUCCESS )
+ ret = SNMPERR_SUCCESS;
+ }
+
+ if (config_errors) {
+ snmp_log(LOG_ERR, "net-snmp: %d error(s) in config file(s)\n",
+ config_errors);
+ }
+ return ret;
+}
+
+void
+read_config_print_usage(const char *lead)
+{
+ struct config_files *ctmp = config_files;
+ struct config_line *ltmp;
+
+ if (lead == NULL)
+ lead = "";
+
+ for (ctmp = config_files; ctmp != NULL; ctmp = ctmp->next) {
+ snmp_log(LOG_INFO, "%sIn %s.conf and %s.local.conf:\n", lead,
+ ctmp->fileHeader, ctmp->fileHeader);
+ for (ltmp = ctmp->start; ltmp != NULL; ltmp = ltmp->next) {
+ DEBUGIF("read_config_usage") {
+ if (ltmp->config_time == PREMIB_CONFIG)
+ DEBUGMSG(("read_config_usage", "*"));
+ else
+ DEBUGMSG(("read_config_usage", " "));
+ }
+ if (ltmp->help) {
+ snmp_log(LOG_INFO, "%s%s%-24s %s\n", lead, lead,
+ ltmp->config_token, ltmp->help);
+ } else {
+ DEBUGIF("read_config_usage") {
+ snmp_log(LOG_INFO, "%s%s%-24s [NO HELP]\n", lead, lead,
+ ltmp->config_token);
+ }
+ }
+ }
+ }
+}
+
+/**
+ * read_config_store intended for use by applications to store permenant
+ * configuration information generated by sets or persistent counters.
+ * Appends line to a file named either ENV(SNMP_PERSISTENT_FILE) or
+ * "<NETSNMP_PERSISTENT_DIRECTORY>/<type>.conf".
+ * Adds a trailing newline to the stored file if necessary.
+ *
+ * @param type is the application name
+ * @param line is the configuration line written to the application name's
+ * configuration file
+ *
+ * @return void
+ */
+void
+read_config_store(const char *type, const char *line)
+{
+#ifdef NETSNMP_PERSISTENT_DIRECTORY
+ char file[512], *filep;
+ FILE *fout;
+#ifdef NETSNMP_PERSISTENT_MASK
+ mode_t oldmask;
+#endif
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_PERSIST_STATE)
+ || netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD)) return;
+
+ /*
+ * store configuration directives in the following order of preference:
+ * 1. ENV variable SNMP_PERSISTENT_FILE
+ * 2. configured <NETSNMP_PERSISTENT_DIRECTORY>/<type>.conf
+ */
+ if ((filep = netsnmp_getenv("SNMP_PERSISTENT_FILE")) == NULL) {
+ snprintf(file, sizeof(file),
+ "%s/%s.conf", get_persistent_directory(), type);
+ file[ sizeof(file)-1 ] = 0;
+ filep = file;
+ }
+#ifdef NETSNMP_PERSISTENT_MASK
+ oldmask = umask(NETSNMP_PERSISTENT_MASK);
+#endif
+ if (mkdirhier(filep, NETSNMP_AGENT_DIRECTORY_MODE, 1)) {
+ snmp_log(LOG_ERR,
+ "Failed to create the persistent directory for %s\n",
+ file);
+ }
+ if ((fout = fopen(filep, "a")) != NULL) {
+ fprintf(fout, "%s", line);
+ if (line[strlen(line)] != '\n')
+ fprintf(fout, "\n");
+ DEBUGMSGTL(("read_config:store", "storing: %s\n", line));
+ fclose(fout);
+ } else {
+ snmp_log(LOG_ERR, "read_config_store open failure on %s\n", filep);
+ }
+#ifdef NETSNMP_PERSISTENT_MASK
+ umask(oldmask);
+#endif
+
+#endif
+} /* end read_config_store() */
+
+void
+read_app_config_store(const char *line)
+{
+ read_config_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE), line);
+}
+
+
+
+
+/*******************************************************************-o-******
+ * snmp_save_persistent
+ *
+ * Parameters:
+ * *type
+ *
+ *
+ * Save the file "<NETSNMP_PERSISTENT_DIRECTORY>/<type>.conf" into a backup copy
+ * called "<NETSNMP_PERSISTENT_DIRECTORY>/<type>.%d.conf", which %d is an
+ * incrementing number on each call, but less than NETSNMP_MAX_PERSISTENT_BACKUPS.
+ *
+ * Should be called just before all persistent information is supposed to be
+ * written to move aside the existing persistent cache.
+ * snmp_clean_persistent should then be called afterward all data has been
+ * saved to remove these backup files.
+ *
+ * Note: on an rename error, the files are removed rather than saved.
+ *
+ */
+void
+snmp_save_persistent(const char *type)
+{
+ char file[512], fileold[SPRINT_MAX_LEN];
+ struct stat statbuf;
+ int j;
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_PERSIST_STATE)
+ || netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE)) return;
+
+ DEBUGMSGTL(("snmp_save_persistent", "saving %s files...\n", type));
+ snprintf(file, sizeof(file),
+ "%s/%s.conf", get_persistent_directory(), type);
+ file[ sizeof(file)-1 ] = 0;
+ if (stat(file, &statbuf) == 0) {
+ for (j = 0; j <= NETSNMP_MAX_PERSISTENT_BACKUPS; j++) {
+ snprintf(fileold, sizeof(fileold),
+ "%s/%s.%d.conf", get_persistent_directory(), type, j);
+ fileold[ sizeof(fileold)-1 ] = 0;
+ if (stat(fileold, &statbuf) != 0) {
+ DEBUGMSGTL(("snmp_save_persistent",
+ " saving old config file: %s -> %s.\n", file,
+ fileold));
+ if (rename(file, fileold)) {
+ snmp_log(LOG_ERR, "Cannot rename %s to %s\n", file, fileold);
+ /* moving it failed, try nuking it, as leaving
+ * it around is very bad. */
+ if (unlink(file) == -1)
+ snmp_log(LOG_ERR, "Cannot unlink %s\n", file);
+ }
+ break;
+ }
+ }
+ }
+ /*
+ * save a warning header to the top of the new file
+ */
+ snprintf(fileold, sizeof(fileold),
+ "%s%s# Please save normal configuration tokens for %s in SNMPCONFPATH/%s.conf.\n# Only \"createUser\" tokens should be placed here by %s administrators.\n%s",
+ "#\n# net-snmp (or ucd-snmp) persistent data file.\n#\n############################################################################\n# STOP STOP STOP STOP STOP STOP STOP STOP STOP \n",
+ "#\n# **** DO NOT EDIT THIS FILE ****\n#\n# STOP STOP STOP STOP STOP STOP STOP STOP STOP \n############################################################################\n#\n# DO NOT STORE CONFIGURATION ENTRIES HERE.\n",
+ type, type, type,
+ "# (Did I mention: do not edit this file?)\n#\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
+ fileold[ sizeof(fileold)-1 ] = 0;
+ read_config_store(type, fileold);
+}
+
+
+/*******************************************************************-o-******
+ * snmp_clean_persistent
+ *
+ * Parameters:
+ * *type
+ *
+ *
+ * Unlink all backup files called "<NETSNMP_PERSISTENT_DIRECTORY>/<type>.%d.conf".
+ *
+ * Should be called just after we successfull dumped the last of the
+ * persistent data, to remove the backup copies of previous storage dumps.
+ *
+ * XXX Worth overwriting with random bytes first? This would
+ * ensure that the data is destroyed, even a buffer containing the
+ * data persists in memory or swap. Only important if secrets
+ * will be stored here.
+ */
+void
+snmp_clean_persistent(const char *type)
+{
+ char file[512];
+ struct stat statbuf;
+ int j;
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_PERSIST_STATE)
+ || netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE)) return;
+
+ DEBUGMSGTL(("snmp_clean_persistent", "cleaning %s files...\n", type));
+ snprintf(file, sizeof(file),
+ "%s/%s.conf", get_persistent_directory(), type);
+ file[ sizeof(file)-1 ] = 0;
+ if (stat(file, &statbuf) == 0) {
+ for (j = 0; j <= NETSNMP_MAX_PERSISTENT_BACKUPS; j++) {
+ snprintf(file, sizeof(file),
+ "%s/%s.%d.conf", get_persistent_directory(), type, j);
+ file[ sizeof(file)-1 ] = 0;
+ if (stat(file, &statbuf) == 0) {
+ DEBUGMSGTL(("snmp_clean_persistent",
+ " removing old config file: %s\n", file));
+ if (unlink(file) == -1)
+ snmp_log(LOG_ERR, "Cannot unlink %s\n", file);
+ }
+ }
+ }
+}
+
+
+
+
+/*
+ * config_perror: prints a warning string associated with a file and
+ * line number of a .conf file and increments the error count.
+ */
+static void
+config_vlog(int level, const char *levelmsg, const char *str, va_list args)
+{
+ char tmpbuf[256];
+ char* buf = tmpbuf;
+ int len = snprintf(tmpbuf, sizeof(tmpbuf), "%s: line %d: %s: %s\n",
+ curfilename, linecount, levelmsg, str);
+ if (len >= (int)sizeof(tmpbuf)) {
+ buf = (char*)malloc(len + 1);
+ sprintf(buf, "%s: line %d: %s: %s\n",
+ curfilename, linecount, levelmsg, str);
+ }
+ snmp_vlog(level, buf, args);
+ if (buf != tmpbuf)
+ free(buf);
+}
+
+void
+netsnmp_config_error(const char *str, ...)
+{
+ va_list args;
+ va_start(args, str);
+ config_vlog(LOG_ERR, "Error", str, args);
+ va_end(args);
+ config_errors++;
+}
+
+void
+netsnmp_config_warn(const char *str, ...)
+{
+ va_list args;
+ va_start(args, str);
+ config_vlog(LOG_WARNING, "Warning", str, args);
+ va_end(args);
+}
+
+void
+config_perror(const char *str)
+{
+ netsnmp_config_error("%s", str);
+}
+
+void
+config_pwarn(const char *str)
+{
+ netsnmp_config_warn("%s", str);
+}
+
+/*
+ * skip all white spaces and return 1 if found something either end of
+ * line or a comment character
+ */
+char *
+skip_white(char *ptr)
+{
+ return NETSNMP_REMOVE_CONST(char *, skip_white_const(ptr));
+}
+
+const char *
+skip_white_const(const char *ptr)
+{
+ if (ptr == NULL)
+ return (NULL);
+ while (*ptr != 0 && isspace((unsigned char)*ptr))
+ ptr++;
+ if (*ptr == 0 || *ptr == '#')
+ return (NULL);
+ return (ptr);
+}
+
+char *
+skip_not_white(char *ptr)
+{
+ return NETSNMP_REMOVE_CONST(char *, skip_not_white_const(ptr));
+}
+
+const char *
+skip_not_white_const(const char *ptr)
+{
+ if (ptr == NULL)
+ return (NULL);
+ while (*ptr != 0 && !isspace((unsigned char)*ptr))
+ ptr++;
+ if (*ptr == 0 || *ptr == '#')
+ return (NULL);
+ return (ptr);
+}
+
+char *
+skip_token(char *ptr)
+{
+ return NETSNMP_REMOVE_CONST(char *, skip_token_const(ptr));
+}
+
+const char *
+skip_token_const(const char *ptr)
+{
+ ptr = skip_white_const(ptr);
+ ptr = skip_not_white_const(ptr);
+ ptr = skip_white_const(ptr);
+ return (ptr);
+}
+
+/*
+ * copy_word
+ * copies the next 'token' from 'from' into 'to', maximum len-1 characters.
+ * currently a token is anything seperate by white space
+ * or within quotes (double or single) (i.e. "the red rose"
+ * is one token, \"the red rose\" is three tokens)
+ * a '\' character will allow a quote character to be treated
+ * as a regular character
+ * It returns a pointer to first non-white space after the end of the token
+ * being copied or to 0 if we reach the end.
+ * Note: Partially copied words (greater than len) still returns a !NULL ptr
+ * Note: partially copied words are, however, null terminated.
+ */
+
+char *
+copy_nword(char *from, char *to, int len)
+{
+ return NETSNMP_REMOVE_CONST(char *, copy_nword_const(from, to, len));
+}
+
+const char *
+copy_nword_const(const char *from, char *to, int len)
+{
+ char quote;
+ if (!from || !to)
+ return NULL;
+ if ((*from == '\"') || (*from == '\'')) {
+ quote = *(from++);
+ while ((*from != quote) && (*from != 0)) {
+ if ((*from == '\\') && (*(from + 1) != 0)) {
+ if (len > 0) { /* don't copy beyond len bytes */
+ *to++ = *(from + 1);
+ if (--len == 0)
+ *(to - 1) = '\0'; /* null protect the last spot */
+ }
+ from = from + 2;
+ } else {
+ if (len > 0) { /* don't copy beyond len bytes */
+ *to++ = *from++;
+ if (--len == 0)
+ *(to - 1) = '\0'; /* null protect the last spot */
+ } else
+ from++;
+ }
+ }
+ if (*from == 0) {
+ DEBUGMSGTL(("read_config_copy_word",
+ "no end quote found in config string\n"));
+ } else
+ from++;
+ } else {
+ while (*from != 0 && !isspace((unsigned char)(*from))) {
+ if ((*from == '\\') && (*(from + 1) != 0)) {
+ if (len > 0) { /* don't copy beyond len bytes */
+ *to++ = *(from + 1);
+ if (--len == 0)
+ *(to - 1) = '\0'; /* null protect the last spot */
+ }
+ from = from + 2;
+ } else {
+ if (len > 0) { /* don't copy beyond len bytes */
+ *to++ = *from++;
+ if (--len == 0)
+ *(to - 1) = '\0'; /* null protect the last spot */
+ } else
+ from++;
+ }
+ }
+ }
+ if (len > 0)
+ *to = 0;
+ from = skip_white_const(from);
+ return (from);
+} /* copy_nword */
+
+/*
+ * copy_word
+ * copies the next 'token' from 'from' into 'to'.
+ * currently a token is anything seperate by white space
+ * or within quotes (double or single) (i.e. "the red rose"
+ * is one token, \"the red rose\" is three tokens)
+ * a '\' character will allow a quote character to be treated
+ * as a regular character
+ * It returns a pointer to first non-white space after the end of the token
+ * being copied or to 0 if we reach the end.
+ */
+
+static int have_warned = 0;
+char *
+copy_word(char *from, char *to)
+{
+ if (!have_warned) {
+ snmp_log(LOG_INFO,
+ "copy_word() called. Use copy_nword() instead.\n");
+ have_warned = 1;
+ }
+ return copy_nword(from, to, SPRINT_MAX_LEN);
+} /* copy_word */
+
+/*
+ * read_config_save_octet_string(): saves an octet string as a length
+ * followed by a string of hex
+ */
+char *
+read_config_save_octet_string(char *saveto, u_char * str, size_t len)
+{
+ int i;
+ u_char *cp;
+
+ /*
+ * is everything easily printable
+ */
+ for (i = 0, cp = str; i < (int) len && cp &&
+ (isalpha(*cp) || isdigit(*cp) || *cp == ' '); cp++, i++);
+
+ if (len != 0 && i == (int) len) {
+ *saveto++ = '"';
+ memcpy(saveto, str, len);
+ saveto += len;
+ *saveto++ = '"';
+ *saveto = '\0';
+ } else {
+ if (str != NULL) {
+ sprintf(saveto, "0x");
+ saveto += 2;
+ for (i = 0; i < (int) len; i++) {
+ sprintf(saveto, "%02x", str[i]);
+ saveto = saveto + 2;
+ }
+ } else {
+ sprintf(saveto, "\"\"");
+ saveto += 2;
+ }
+ }
+ return saveto;
+}
+
+/**
+ * Reads an octet string that was saved by the
+ * read_config_save_octet_string() function.
+ *
+ * @param[in] readfrom Pointer to the input data to be parsed.
+ * @param[in,out] str Pointer to the output buffer pointer. The data
+ * written to the output buffer will be '\0'-terminated. If *str == NULL,
+ * an output buffer will be allocated that is one byte larger than the
+ * data stored.
+ * @param[in,out] len If str != NULL, *len is the size of the buffer *str
+ * points at. If str == NULL, the value passed via *len is ignored.
+ * Before this function returns the number of bytes read will be stored
+ * in *len. If a buffer overflow occurs, *len will be set to 0.
+ *
+ * @return A pointer to the next character in the input to be parsed if
+ * parsing succeeded; NULL when the end of the input string has been reached
+ * or if an error occurred.
+ */
+char *
+read_config_read_octet_string(const char *readfrom, u_char ** str,
+ size_t * len)
+{
+ return NETSNMP_REMOVE_CONST(char *,
+ read_config_read_octet_string_const(readfrom, str, len));
+}
+
+const char *
+read_config_read_octet_string_const(const char *readfrom, u_char ** str,
+ size_t * len)
+{
+ u_char *cptr;
+ const char *cptr1;
+ u_int tmp;
+ size_t i, ilen;
+
+ if (readfrom == NULL || str == NULL || len == NULL)
+ return NULL;
+
+ if (strncasecmp(readfrom, "0x", 2) == 0) {
+ /*
+ * A hex string submitted. How long?
+ */
+ readfrom += 2;
+ cptr1 = skip_not_white_const(readfrom);
+ if (cptr1)
+ ilen = (cptr1 - readfrom);
+ else
+ ilen = strlen(readfrom);
+
+ if (ilen % 2) {
+ snmp_log(LOG_WARNING,"invalid hex string: wrong length\n");
+ DEBUGMSGTL(("read_config_read_octet_string",
+ "invalid hex string: wrong length"));
+ return NULL;
+ }
+ ilen = ilen / 2;
+
+ /*
+ * malloc data space if needed (+1 for good measure)
+ */
+ if (*str == NULL) {
+ *str = (u_char *) malloc(ilen + 1);
+ if (!*str)
+ return NULL;
+ } else {
+ /*
+ * require caller to have +1, and bail if not enough space.
+ */
+ if (ilen >= *len) {
+ snmp_log(LOG_WARNING,"buffer too small to read octet string (%lu < %lu)\n",
+ (unsigned long)*len, (unsigned long)ilen);
+ DEBUGMSGTL(("read_config_read_octet_string",
+ "buffer too small (%lu < %lu)", (unsigned long)*len, (unsigned long)ilen));
+ *len = 0;
+ cptr1 = skip_not_white_const(readfrom);
+ return skip_white_const(cptr1);
+ }
+ }
+
+ /*
+ * copy validated data
+ */
+ cptr = *str;
+ for (i = 0; i < ilen; i++) {
+ if (1 == sscanf(readfrom, "%2x", &tmp))
+ *cptr++ = (u_char) tmp;
+ else {
+ /*
+ * we may lose memory, but don't know caller's buffer XX free(cptr);
+ */
+ return (NULL);
+ }
+ readfrom += 2;
+ }
+ /*
+ * Terminate the output buffer.
+ */
+ *cptr++ = '\0';
+ *len = ilen;
+ readfrom = skip_white_const(readfrom);
+ } else {
+ /*
+ * Normal string
+ */
+
+ /*
+ * malloc string space if needed (including NULL terminator)
+ */
+ if (*str == NULL) {
+ char buf[SNMP_MAXBUF];
+ readfrom = copy_nword_const(readfrom, buf, sizeof(buf));
+
+ *len = strlen(buf);
+ *str = (u_char *) malloc(*len + 1);
+ if (*str == NULL)
+ return NULL;
+ memcpy(*str, buf, *len + 1);
+ } else {
+ readfrom = copy_nword_const(readfrom, (char *) *str, *len);
+ if (*len)
+ *len = strlen((char *) *str);
+ }
+ }
+
+ return readfrom;
+}
+
+/*
+ * read_config_save_objid(): saves an objid as a numerical string
+ */
+char *
+read_config_save_objid(char *saveto, oid * objid, size_t len)
+{
+ int i;
+
+ if (len == 0) {
+ strcat(saveto, "NULL");
+ saveto += strlen(saveto);
+ return saveto;
+ }
+
+ /*
+ * in case len=0, this makes it easier to read it back in
+ */
+ for (i = 0; i < (int) len; i++) {
+ sprintf(saveto, ".%" NETSNMP_PRIo "d", objid[i]);
+ saveto += strlen(saveto);
+ }
+ return saveto;
+}
+
+/*
+ * read_config_read_objid(): reads an objid from a format saved by the above
+ */
+char *
+read_config_read_objid(char *readfrom, oid ** objid, size_t * len)
+{
+ return NETSNMP_REMOVE_CONST(char *,
+ read_config_read_objid_const(readfrom, objid, len));
+}
+
+const char *
+read_config_read_objid_const(const char *readfrom, oid ** objid, size_t * len)
+{
+
+ if (objid == NULL || readfrom == NULL || len == NULL)
+ return NULL;
+
+ if (*objid == NULL) {
+ *len = 0;
+ if ((*objid = (oid *) malloc(MAX_OID_LEN * sizeof(oid))) == NULL)
+ return NULL;
+ *len = MAX_OID_LEN;
+ }
+
+ if (strncmp(readfrom, "NULL", 4) == 0) {
+ /*
+ * null length oid
+ */
+ *len = 0;
+ } else {
+ /*
+ * qualify the string for read_objid
+ */
+ char buf[SPRINT_MAX_LEN];
+ copy_nword_const(readfrom, buf, sizeof(buf));
+
+ if (!read_objid(buf, *objid, len)) {
+ DEBUGMSGTL(("read_config_read_objid", "Invalid OID"));
+ *len = 0;
+ return NULL;
+ }
+ }
+
+ readfrom = skip_token_const(readfrom);
+ return readfrom;
+}
+
+/**
+ * read_config_read_data reads data of a given type from a token(s) on a
+ * configuration line. The supported types are:
+ *
+ * - ASN_INTEGER
+ * - ASN_TIMETICKS
+ * - ASN_UNSIGNED
+ * - ASN_OCTET_STR
+ * - ASN_BIT_STR
+ * - ASN_OBJECT_ID
+ *
+ * @param type the asn data type to be read in.
+ *
+ * @param readfrom the configuration line data to be read.
+ *
+ * @param dataptr an allocated pointer expected to match the type being read
+ * (int *, u_int *, char **, oid **)
+ *
+ * @param len is the length of an asn oid or octet/bit string, not required
+ * for the asn integer, unsigned integer, and timeticks types
+ *
+ * @return the next token in the configuration line. NULL if none left or
+ * if an unknown type.
+ *
+ */
+char *
+read_config_read_data(int type, char *readfrom, void *dataptr,
+ size_t * len)
+{
+ int *intp;
+ char **charpp;
+ oid **oidpp;
+ unsigned int *uintp;
+
+ if (dataptr && readfrom)
+ switch (type) {
+ case ASN_INTEGER:
+ intp = (int *) dataptr;
+ *intp = atoi(readfrom);
+ readfrom = skip_token(readfrom);
+ return readfrom;
+
+ case ASN_TIMETICKS:
+ case ASN_UNSIGNED:
+ uintp = (unsigned int *) dataptr;
+ *uintp = strtoul(readfrom, NULL, 0);
+ readfrom = skip_token(readfrom);
+ return readfrom;
+
+ case ASN_IPADDRESS:
+ intp = (int *) dataptr;
+ *intp = inet_addr(readfrom);
+ if ((*intp == -1) &&
+ (strncmp(readfrom, "255.255.255.255", 15) != 0))
+ return NULL;
+ readfrom = skip_token(readfrom);
+ return readfrom;
+
+ case ASN_OCTET_STR:
+ case ASN_BIT_STR:
+ charpp = (char **) dataptr;
+ return read_config_read_octet_string(readfrom,
+ (u_char **) charpp, len);
+
+ case ASN_OBJECT_ID:
+ oidpp = (oid **) dataptr;
+ return read_config_read_objid(readfrom, oidpp, len);
+
+ default:
+ DEBUGMSGTL(("read_config_read_data", "Fail: Unknown type: %d",
+ type));
+ return NULL;
+ }
+ return NULL;
+}
+
+/*
+ * read_config_read_memory():
+ *
+ * similar to read_config_read_data, but expects a generic memory
+ * pointer rather than a specific type of pointer. Len is expected to
+ * be the amount of available memory.
+ */
+char *
+read_config_read_memory(int type, char *readfrom,
+ char *dataptr, size_t * len)
+{
+ int *intp;
+ unsigned int *uintp;
+ char buf[SPRINT_MAX_LEN];
+
+ if (!dataptr || !readfrom)
+ return NULL;
+
+ switch (type) {
+ case ASN_INTEGER:
+ if (*len < sizeof(int))
+ return NULL;
+ intp = (int *) dataptr;
+ readfrom = copy_nword(readfrom, buf, sizeof(buf));
+ *intp = atoi(buf);
+ *len = sizeof(int);
+ return readfrom;
+
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_UNSIGNED:
+ if (*len < sizeof(unsigned int))
+ return NULL;
+ uintp = (unsigned int *) dataptr;
+ readfrom = copy_nword(readfrom, buf, sizeof(buf));
+ *uintp = strtoul(buf, NULL, 0);
+ *len = sizeof(unsigned int);
+ return readfrom;
+
+ case ASN_IPADDRESS:
+ if (*len < sizeof(int))
+ return NULL;
+ intp = (int *) dataptr;
+ readfrom = copy_nword(readfrom, buf, sizeof(buf));
+ *intp = inet_addr(buf);
+ if ((*intp == -1) && (strcmp(buf, "255.255.255.255") != 0))
+ return NULL;
+ *len = sizeof(int);
+ return readfrom;
+
+ case ASN_OCTET_STR:
+ case ASN_BIT_STR:
+ case ASN_PRIV_IMPLIED_OCTET_STR:
+ return read_config_read_octet_string(readfrom,
+ (u_char **) & dataptr, len);
+
+ case ASN_PRIV_IMPLIED_OBJECT_ID:
+ case ASN_OBJECT_ID:
+ readfrom =
+ read_config_read_objid(readfrom, (oid **) & dataptr, len);
+ *len *= sizeof(oid);
+ return readfrom;
+
+ case ASN_COUNTER64:
+ if (*len < sizeof(U64))
+ return NULL;
+ *len = sizeof(U64);
+ read64((U64 *) dataptr, readfrom);
+ readfrom = skip_token(readfrom);
+ return readfrom;
+ }
+
+ DEBUGMSGTL(("read_config_read_memory", "Fail: Unknown type: %d", type));
+ return NULL;
+}
+
+/**
+ * read_config_store_data stores data of a given type to a configuration line
+ * into the storeto buffer.
+ * Calls read_config_store_data_prefix with the prefix parameter set to a char
+ * space. The supported types are:
+ *
+ * - ASN_INTEGER
+ * - ASN_TIMETICKS
+ * - ASN_UNSIGNED
+ * - ASN_OCTET_STR
+ * - ASN_BIT_STR
+ * - ASN_OBJECT_ID
+ *
+ * @param type the asn data type to be stored
+ *
+ * @param storeto a pre-allocated char buffer which will contain the data
+ * to be stored
+ *
+ * @param dataptr contains the value to be stored, the supported pointers:
+ * (int *, u_int *, char **, oid **)
+ *
+ * @param len is the length of the value to be stored
+ * (not required for the asn integer, unsigned integer,
+ * and timeticks types)
+ *
+ * @return character pointer to the end of the line. NULL if an unknown type.
+ */
+char *
+read_config_store_data(int type, char *storeto, void *dataptr, size_t * len)
+{
+ return read_config_store_data_prefix(' ', type, storeto, dataptr,
+ (len ? *len : 0));
+}
+
+char *
+read_config_store_data_prefix(char prefix, int type, char *storeto,
+ void *dataptr, size_t len)
+{
+ int *intp;
+ u_char **charpp;
+ unsigned int *uintp;
+ struct in_addr in;
+ oid **oidpp;
+
+ if (dataptr && storeto)
+ switch (type) {
+ case ASN_INTEGER:
+ intp = (int *) dataptr;
+ sprintf(storeto, "%c%d", prefix, *intp);
+ return (storeto + strlen(storeto));
+
+ case ASN_TIMETICKS:
+ case ASN_UNSIGNED:
+ uintp = (unsigned int *) dataptr;
+ sprintf(storeto, "%c%u", prefix, *uintp);
+ return (storeto + strlen(storeto));
+
+ case ASN_IPADDRESS:
+ in.s_addr = *(unsigned int *) dataptr;
+ sprintf(storeto, "%c%s", prefix, inet_ntoa(in));
+ return (storeto + strlen(storeto));
+
+ case ASN_OCTET_STR:
+ case ASN_BIT_STR:
+ *storeto++ = prefix;
+ charpp = (u_char **) dataptr;
+ return read_config_save_octet_string(storeto, *charpp, len);
+
+ case ASN_OBJECT_ID:
+ *storeto++ = prefix;
+ oidpp = (oid **) dataptr;
+ return read_config_save_objid(storeto, *oidpp, len);
+
+ default:
+ DEBUGMSGTL(("read_config_store_data_prefix",
+ "Fail: Unknown type: %d", type));
+ return NULL;
+ }
+ return NULL;
+}
+
+/** @} */
diff --git a/snmplib/readdir.c b/snmplib/readdir.c
new file mode 100644
index 0000000..33ff83d
--- /dev/null
+++ b/snmplib/readdir.c
@@ -0,0 +1,51 @@
+/*
+ * readdir() replacement for MSVC.
+ */
+
+#define WIN32IO_IS_STDIO
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/types.h>
+#include <net-snmp/library/system.h>
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#include <tchar.h>
+#include <windows.h>
+
+
+/*
+ * Readdir just returns the current string pointer and bumps the
+ * * string pointer to the nDllExport entry.
+ */
+struct direct *
+readdir(DIR * dirp)
+{
+ int len;
+ static int dummy = 0;
+
+ if (dirp->curr) {
+ /*
+ * first set up the structure to return
+ */
+ len = strlen(dirp->curr);
+ strcpy(dirp->dirstr.d_name, dirp->curr);
+ dirp->dirstr.d_namlen = len;
+
+ /*
+ * Fake an inode
+ */
+ dirp->dirstr.d_ino = dummy++;
+
+ /*
+ * Now set up for the nDllExport call to readdir
+ */
+ dirp->curr += len + 1;
+ if (dirp->curr >= (dirp->start + dirp->size)) {
+ dirp->curr = NULL;
+ }
+
+ return &(dirp->dirstr);
+ } else
+ return NULL;
+}
diff --git a/snmplib/scapi.c b/snmplib/scapi.c
new file mode 100644
index 0000000..fdd33ff
--- /dev/null
+++ b/snmplib/scapi.c
@@ -0,0 +1,1359 @@
+/* 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.
+ */
+
+/*
+ * scapi.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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 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
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+
+netsnmp_feature_child_of(usm_support, libnetsnmp)
+netsnmp_feature_child_of(usm_scapi, usm_support)
+
+#ifndef NETSNMP_FEATURE_REMOVE_USM_SCAPI
+
+#ifdef NETSNMP_USE_INTERNAL_MD5
+#include <net-snmp/library/md5.h>
+#endif
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/snmpusm.h>
+#include <net-snmp/library/keytools.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/transform_oids.h>
+
+#ifdef NETSNMP_USE_INTERNAL_CRYPTO
+#include <net-snmp/library/openssl_md5.h>
+#include <net-snmp/library/openssl_sha.h>
+#include <net-snmp/library/openssl_des.h>
+#include <net-snmp/library/openssl_aes.h>
+#endif
+
+#ifdef NETSNMP_USE_OPENSSL
+#include <openssl/hmac.h>
+#include <openssl/evp.h>
+#include <openssl/rand.h>
+#include <openssl/des.h>
+#ifdef HAVE_AES
+#include <openssl/aes.h>
+#endif
+
+#ifndef NETSNMP_DISABLE_DES
+#ifdef HAVE_STRUCT_DES_KS_STRUCT_WEAK_KEY
+/* these are older names for newer structures that exist in openssl .9.7 */
+#define DES_key_schedule des_key_schedule
+#define DES_cblock des_cblock
+#define DES_key_sched des_key_sched
+#define DES_ncbc_encrypt des_ncbc_encrypt
+#define DES_cbc_encrypt des_cbc_encrypt
+#define OLD_DES
+#endif
+#endif
+
+#endif /* HAVE_OPENSSL */
+
+#ifdef NETSNMP_USE_INTERNAL_CRYPTO
+#endif
+
+#ifdef NETSNMP_USE_PKCS11
+#include <security/cryptoki.h>
+#endif
+
+#ifdef QUITFUN
+#undef QUITFUN
+#define QUITFUN(e, l) \
+ if (e != SNMPERR_SUCCESS) { \
+ rval = SNMPERR_SC_GENERAL_FAILURE; \
+ goto l ; \
+ }
+#endif
+
+#ifdef NETSNMP_USE_INTERNAL_CRYPTO
+static
+int SHA1_hmac(const u_char * data, size_t len, u_char * mac, size_t maclen,
+ const u_char * secret, size_t secretlen);
+
+static
+int MD5_hmac(const u_char * data, size_t len, u_char * mac, size_t maclen,
+ const u_char * secret, size_t secretlen);
+#endif
+
+/*
+ * sc_get_properlength(oid *hashtype, u_int hashtype_len):
+ *
+ * Given a hashing type ("hashtype" and its length hashtype_len), return
+ * the length of the hash result.
+ *
+ * Returns either the length or SNMPERR_GENERR for an unknown hashing type.
+ */
+int
+sc_get_properlength(const oid * hashtype, u_int hashtype_len)
+{
+ DEBUGTRACE;
+ /*
+ * Determine transform type hash length.
+ */
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(hashtype, HMACMD5Auth)) {
+ return BYTESIZE(SNMP_TRANS_AUTHLEN_HMACMD5);
+ } else
+#endif
+ if (ISTRANSFORM(hashtype, HMACSHA1Auth)) {
+ return BYTESIZE(SNMP_TRANS_AUTHLEN_HMACSHA1);
+ }
+ return SNMPERR_GENERR;
+}
+
+netsnmp_feature_child_of(scapi_get_proper_priv_length, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_SCAPI_GET_PROPER_PRIV_LENGTH
+int
+sc_get_proper_priv_length(const oid * privtype, u_int privtype_len)
+{
+ int properlength = 0;
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(privtype, DESPriv)) {
+ properlength = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES);
+ }
+#endif
+#ifdef HAVE_AES
+ if (ISTRANSFORM(privtype, AESPriv)) {
+ properlength = BYTESIZE(SNMP_TRANS_PRIVLEN_AES);
+ }
+#endif
+ return properlength;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SCAPI_GET_PROPER_PRIV_LENGTH */
+
+
+/*******************************************************************-o-******
+ * sc_init
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ */
+int
+sc_init(void)
+{
+ int rval = SNMPERR_SUCCESS;
+
+#if !defined(NETSNMP_USE_OPENSSL)
+#if defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+ struct timeval tv;
+
+ DEBUGTRACE;
+
+ gettimeofday(&tv, (struct timezone *) 0);
+
+ srandom((unsigned)(tv.tv_sec ^ tv.tv_usec));
+#elif NETSNMP_USE_PKCS11
+ DEBUGTRACE;
+ rval = pkcs_init();
+#else
+ rval = SNMPERR_SC_NOT_CONFIGURED;
+#endif /* NETSNMP_USE_INTERNAL_MD5 */
+ /*
+ * XXX ogud: The only reason to do anything here with openssl is to
+ * * XXX ogud: seed random number generator
+ */
+#endif /* ifndef NETSNMP_USE_OPENSSL */
+ return rval;
+} /* end sc_init() */
+
+/*******************************************************************-o-******
+ * sc_random
+ *
+ * Parameters:
+ * *buf Pre-allocated buffer.
+ * *buflen Size of buffer.
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ */
+int
+sc_random(u_char * buf, size_t * buflen)
+#if defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_PKCS11) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+ int rval = SNMPERR_SUCCESS;
+#if !defined(NETSNMP_USE_OPENSSL) && !defined(NETSNMP_USE_PKCS11)
+ int i;
+ int rndval;
+ u_char *ucp = buf;
+#endif
+
+ DEBUGTRACE;
+
+#ifdef NETSNMP_USE_OPENSSL
+ RAND_bytes(buf, *buflen); /* will never fail */
+#elif NETSNMP_USE_PKCS11 /* NETSNMP_USE_PKCS11 */
+ pkcs_random(buf, *buflen);
+#else /* NETSNMP_USE_INTERNAL_MD5 */
+ /*
+ * fill the buffer with random integers. Note that random()
+ * is defined in config.h and may not be truly the random()
+ * system call if something better existed
+ */
+ rval = *buflen - *buflen % sizeof(rndval);
+ for (i = 0; i < rval; i += sizeof(rndval)) {
+ rndval = random();
+ memcpy(ucp, &rndval, sizeof(rndval));
+ ucp += sizeof(rndval);
+ }
+
+ rndval = random();
+ memcpy(ucp, &rndval, *buflen % sizeof(rndval));
+
+ rval = SNMPERR_SUCCESS;
+#endif /* NETSNMP_USE_OPENSSL */
+ return rval;
+
+} /* end sc_random() */
+
+#else
+_SCAPI_NOT_CONFIGURED
+#endif /* */
+/*******************************************************************-o-******
+ * sc_generate_keyed_hash
+ *
+ * Parameters:
+ * authtype Type of authentication transform.
+ * authtypelen
+ * *key Pointer to key (Kul) to use in keyed hash.
+ * keylen Length of key in bytes.
+ * *message Pointer to the message to hash.
+ * msglen Length of the message.
+ * *MAC Will be returned with allocated bytes containg hash.
+ * *maclen Length of the hash buffer in bytes; also indicates
+ * whether the MAC should be truncated.
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMPERR_GENERR All errs
+ *
+ *
+ * A hash of the first msglen bytes of message using a keyed hash defined
+ * by authtype is created and stored in MAC. MAC is ASSUMED to be a buffer
+ * of at least maclen bytes. If the length of the hash is greater than
+ * maclen, it is truncated to fit the buffer. If the length of the hash is
+ * less than maclen, maclen set to the number of hash bytes generated.
+ *
+ * ASSUMED that the number of hash bits is a multiple of 8.
+ */
+int
+sc_generate_keyed_hash(const oid * authtype, size_t authtypelen,
+ const u_char * key, u_int keylen,
+ const u_char * message, u_int msglen,
+ u_char * MAC, size_t * maclen)
+#if defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_PKCS11) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+ int rval = SNMPERR_SUCCESS;
+ int iproperlength;
+ size_t properlength;
+
+ u_char buf[SNMP_MAXBUF_SMALL];
+#if defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_PKCS11)
+ unsigned int buf_len = sizeof(buf);
+#endif
+
+ DEBUGTRACE;
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ {
+ int i;
+ DEBUGMSG(("sc_generate_keyed_hash",
+ "sc_generate_keyed_hash(): key=0x"));
+ for (i = 0; i < keylen; i++)
+ DEBUGMSG(("sc_generate_keyed_hash", "%02x", key[i] & 0xff));
+ DEBUGMSG(("sc_generate_keyed_hash", " (%d)\n", keylen));
+ }
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+ /*
+ * Sanity check.
+ */
+ if (!authtype || !key || !message || !MAC || !maclen
+ || (keylen <= 0) || (msglen <= 0) || (*maclen <= 0)
+ || (authtypelen != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, sc_generate_keyed_hash_quit);
+ }
+
+ iproperlength = sc_get_properlength(authtype, authtypelen);
+ if (iproperlength == SNMPERR_GENERR)
+ return SNMPERR_GENERR;
+ properlength = (size_t)iproperlength;
+ if (keylen < properlength) {
+ QUITFUN(SNMPERR_GENERR, sc_generate_keyed_hash_quit);
+ }
+#ifdef NETSNMP_USE_OPENSSL
+ /*
+ * Determine transform type.
+ */
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(authtype, HMACMD5Auth))
+ HMAC(EVP_md5(), key, keylen, message, msglen, buf, &buf_len);
+ else
+#endif
+ if (ISTRANSFORM(authtype, HMACSHA1Auth))
+ HMAC(EVP_sha1(), key, keylen, message, msglen, buf, &buf_len);
+ else {
+ QUITFUN(SNMPERR_GENERR, sc_generate_keyed_hash_quit);
+ }
+ if (buf_len != properlength) {
+ QUITFUN(rval, sc_generate_keyed_hash_quit);
+ }
+ if (*maclen > buf_len)
+ *maclen = buf_len;
+ memcpy(MAC, buf, *maclen);
+
+#elif NETSNMP_USE_PKCS11 /* NETSNMP_USE_PKCS11 */
+
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(authtype, HMACMD5Auth)) {
+ if (pkcs_sign(CKM_MD5_HMAC,key, keylen, message,
+ msglen, buf, &buf_len) != SNMPERR_SUCCESS) {
+ QUITFUN(SNMPERR_GENERR, sc_generate_keyed_hash_quit);
+ }
+ } else
+#endif
+ if (ISTRANSFORM(authtype, HMACSHA1Auth)) {
+ if (pkcs_sign(CKM_SHA_1_HMAC,key, keylen, message,
+ msglen, buf, &buf_len) != SNMPERR_SUCCESS) {
+ QUITFUN(SNMPERR_GENERR, sc_generate_keyed_hash_quit);
+ }
+ } else {
+ QUITFUN(SNMPERR_GENERR, sc_generate_keyed_hash_quit);
+ }
+
+ if (buf_len != properlength) {
+ QUITFUN(rval, sc_generate_keyed_hash_quit);
+ }
+ if (*maclen > buf_len)
+ *maclen = buf_len;
+ memcpy(MAC, buf, *maclen);
+
+#elif NETSNMP_USE_INTERNAL_CRYPTO
+ if (*maclen > properlength)
+ *maclen = properlength;
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(authtype, HMACMD5Auth))
+ rval = MD5_hmac(message, msglen, MAC, *maclen, key, keylen);
+ else
+#endif
+ if (ISTRANSFORM(authtype, HMACSHA1Auth))
+ rval = SHA1_hmac(message, msglen, MAC, *maclen, key, keylen);
+ else {
+ QUITFUN(SNMPERR_GENERR, sc_generate_keyed_hash_quit);
+ }
+ if (rval != 0) {
+ rval = SNMPERR_GENERR;
+ goto sc_generate_keyed_hash_quit;
+ }
+#else /* NETSNMP_USE_INTERNAL_MD5 */
+ if (*maclen > properlength)
+ *maclen = properlength;
+ if (MDsign(message, msglen, MAC, *maclen, key, keylen)) {
+ rval = SNMPERR_GENERR;
+ goto sc_generate_keyed_hash_quit;
+ }
+#endif /* NETSNMP_USE_OPENSSL */
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ {
+ char *s;
+ int len = binary_to_hex(MAC, *maclen, &s);
+
+ DEBUGMSGTL(("scapi", "Full v3 message hash: %s\n", s));
+ SNMP_ZERO(s, len);
+ SNMP_FREE(s);
+ }
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+ sc_generate_keyed_hash_quit:
+ memset(buf, 0, SNMP_MAXBUF_SMALL);
+ return rval;
+} /* end sc_generate_keyed_hash() */
+
+#else
+ _SCAPI_NOT_CONFIGURED
+#endif /* */
+/*
+ * sc_hash(): a generic wrapper around whatever hashing package we are using.
+ *
+ * IN:
+ * hashtype - oid pointer to a hash type
+ * hashtypelen - length of oid pointer
+ * buf - u_char buffer to be hashed
+ * buf_len - integer length of buf data
+ * MAC_len - length of the passed MAC buffer size.
+ *
+ * OUT:
+ * MAC - pre-malloced space to store hash output.
+ * MAC_len - length of MAC output to the MAC buffer.
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMP_SC_GENERAL_FAILURE Any error.
+ */
+int
+sc_hash(const oid * hashtype, size_t hashtypelen, const u_char * buf,
+ size_t buf_len, u_char * MAC, size_t * MAC_len)
+#if defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_PKCS11) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+#if defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_PKCS11) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+ int rval = SNMPERR_SUCCESS;
+#endif
+#if defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_PKCS11)
+ unsigned int tmp_len;
+#endif
+ int ret;
+
+#ifdef NETSNMP_USE_OPENSSL
+ const EVP_MD *hashfn;
+ EVP_MD_CTX *cptr;
+#endif
+#ifdef NETSNMP_USE_INTERNAL_CRYPTO
+ MD5_CTX cmd5;
+ SHA_CTX csha1;
+#endif
+ DEBUGTRACE;
+
+ if (hashtype == NULL || buf == NULL || buf_len <= 0 ||
+ MAC == NULL || MAC_len == NULL )
+ return (SNMPERR_GENERR);
+ ret = sc_get_properlength(hashtype, hashtypelen);
+ if (( ret < 0 ) || (*MAC_len < (size_t)ret ))
+ return (SNMPERR_GENERR);
+
+#ifdef NETSNMP_USE_OPENSSL
+ /*
+ * Determine transform type.
+ */
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(hashtype, HMACMD5Auth)) {
+ hashfn = (const EVP_MD *) EVP_md5();
+ } else
+#endif
+ if (ISTRANSFORM(hashtype, HMACSHA1Auth)) {
+ hashfn = (const EVP_MD *) EVP_sha1();
+ } else {
+ return (SNMPERR_GENERR);
+ }
+
+/** initialize the pointer */
+#ifdef HAVE_EVP_MD_CTX_CREATE
+ cptr = EVP_MD_CTX_create();
+#else
+ cptr = malloc(sizeof(*cptr));
+#if defined(OLD_DES)
+ memset(cptr, 0, sizeof(*cptr));
+#else
+ EVP_MD_CTX_init(cptr);
+#endif
+#endif
+ EVP_DigestInit(cptr, hashfn);
+
+/** pass the data */
+ EVP_DigestUpdate(cptr, buf, buf_len);
+
+/** do the final pass */
+ EVP_DigestFinal(cptr, MAC, &tmp_len);
+ *MAC_len = tmp_len;
+#ifdef HAVE_EVP_MD_CTX_DESTROY
+ EVP_MD_CTX_destroy(cptr);
+#else
+#if !defined(OLD_DES)
+ EVP_MD_CTX_cleanup(cptr);
+#endif
+ free(cptr);
+#endif
+ return (rval);
+
+#elif NETSNMP_USE_INTERNAL_CRYPTO
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(hashtype, HMACMD5Auth)) {
+ if (*MAC_len < MD5_DIGEST_LENGTH)
+ return (SNMPERR_GENERR); /* the buffer isn't big enough */
+ MD5_Init(&cmd5);
+ MD5_Update(&cmd5, buf, buf_len);
+ MD5_Final(MAC, &cmd5);
+ *MAC_len = MD5_DIGEST_LENGTH;
+ } else
+#endif
+ if (ISTRANSFORM(hashtype, HMACSHA1Auth)) {
+ if (*MAC_len < SHA_DIGEST_LENGTH)
+ return (SNMPERR_GENERR); /* the buffer isn't big enough */
+ SHA1_Init(&csha1);
+ SHA1_Update(&csha1, buf, buf_len);
+ SHA1_Final(MAC, &csha1);
+ *MAC_len = SHA_DIGEST_LENGTH;
+
+ } else {
+ return (SNMPERR_GENERR);
+ }
+ return (rval);
+#elif NETSNMP_USE_PKCS11 /* NETSNMP_USE_PKCS11 */
+
+#ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(hashtype, HMACMD5Auth)) {
+ rval = pkcs_digest(CKM_MD5, buf, buf_len, MAC, &tmp_len);
+ *MAC_len = tmp_len;
+ } else
+#endif
+ if (ISTRANSFORM(hashtype, HMACSHA1Auth)) {
+ rval = pkcs_digest(CKM_SHA_1, buf, buf_len, MAC, &tmp_len);
+ *MAC_len = tmp_len;
+ } else {
+ return (SNMPERR_GENERR);
+ }
+
+ return (rval);
+
+#else /* NETSNMP_USE_INTERNAL_MD5 */
+
+ if (MDchecksum(buf, buf_len, MAC, *MAC_len)) {
+ return SNMPERR_GENERR;
+ }
+ if (*MAC_len > 16)
+ *MAC_len = 16;
+ return SNMPERR_SUCCESS;
+
+#endif /* NETSNMP_USE_OPENSSL */
+}
+#else /* !defined(NETSNMP_USE_OPENSSL) && !defined(NETSNMP_USE_INTERNAL_MD5) */
+_SCAPI_NOT_CONFIGURED
+#endif /* !defined(NETSNMP_USE_OPENSSL) && !defined(NETSNMP_USE_INTERNAL_MD5) */
+/*******************************************************************-o-******
+ * sc_check_keyed_hash
+ *
+ * Parameters:
+ * authtype Transform type of authentication hash.
+ * *key Key bits in a string of bytes.
+ * keylen Length of key in bytes.
+ * *message Message for which to check the hash.
+ * msglen Length of message.
+ * *MAC Given hash.
+ * maclen Length of given hash; indicates truncation if it is
+ * shorter than the normal size of output for
+ * given hash transform.
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMP_SC_GENERAL_FAILURE Any error
+ *
+ *
+ * Check the hash given in MAC against the hash of message. If the length
+ * of MAC is less than the length of the transform hash output, only maclen
+ * bytes are compared. The length of MAC cannot be greater than the
+ * length of the hash transform output.
+ */
+int
+sc_check_keyed_hash(const oid * authtype, size_t authtypelen,
+ const u_char * key, u_int keylen,
+ const u_char * message, u_int msglen,
+ const u_char * MAC, u_int maclen)
+#if defined(NETSNMP_USE_INTERNAL_MD5) || defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_PKCS11) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+ int rval = SNMPERR_SUCCESS;
+ size_t buf_len = SNMP_MAXBUF_SMALL;
+
+ u_char buf[SNMP_MAXBUF_SMALL];
+
+ DEBUGTRACE;
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ {
+ int i;
+ DEBUGMSG(("scapi", "sc_check_keyed_hash(): key=0x"));
+ for (i = 0; i < keylen; i++)
+ DEBUGMSG(("scapi", "%02x", key[i] & 0xff));
+ DEBUGMSG(("scapi", " (%d)\n", keylen));
+ }
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+ /*
+ * Sanity check.
+ */
+ if (!authtype || !key || !message || !MAC
+ || (keylen <= 0) || (msglen <= 0) || (maclen <= 0)
+ || (authtypelen != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, sc_check_keyed_hash_quit);
+ }
+
+
+ if (maclen != USM_MD5_AND_SHA_AUTH_LEN) {
+ QUITFUN(SNMPERR_GENERR, sc_check_keyed_hash_quit);
+ }
+
+ /*
+ * Generate a full hash of the message, then compare
+ * the result with the given MAC which may shorter than
+ * the full hash length.
+ */
+ rval = sc_generate_keyed_hash(authtype, authtypelen,
+ key, keylen,
+ message, msglen, buf, &buf_len);
+ QUITFUN(rval, sc_check_keyed_hash_quit);
+
+ if (maclen > msglen) {
+ QUITFUN(SNMPERR_GENERR, sc_check_keyed_hash_quit);
+
+ } else if (memcmp(buf, MAC, maclen) != 0) {
+ QUITFUN(SNMPERR_GENERR, sc_check_keyed_hash_quit);
+ }
+
+
+ sc_check_keyed_hash_quit:
+ memset(buf, 0, SNMP_MAXBUF_SMALL);
+
+ return rval;
+
+} /* end sc_check_keyed_hash() */
+
+#else
+_SCAPI_NOT_CONFIGURED
+#endif /* NETSNMP_USE_INTERNAL_MD5 */
+/*******************************************************************-o-******
+ * sc_encrypt
+ *
+ * Parameters:
+ * privtype Type of privacy cryptographic transform.
+ * *key Key bits for crypting.
+ * keylen Length of key (buffer) in bytes.
+ * *iv IV bits for crypting.
+ * ivlen Length of iv (buffer) in bytes.
+ * *plaintext Plaintext to crypt.
+ * ptlen Length of plaintext.
+ * *ciphertext Ciphertext to crypt.
+ * *ctlen Length of ciphertext.
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMPERR_SC_NOT_CONFIGURED Encryption is not supported.
+ * SNMPERR_SC_GENERAL_FAILURE Any other error
+ *
+ *
+ * Encrypt plaintext into ciphertext using key and iv.
+ *
+ * ctlen contains actual number of crypted bytes in ciphertext upon
+ * successful return.
+ */
+int
+sc_encrypt(const oid * privtype, size_t privtypelen,
+ u_char * key, u_int keylen,
+ u_char * iv, u_int ivlen,
+ const u_char * plaintext, u_int ptlen,
+ u_char * ciphertext, size_t * ctlen)
+#if defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+ int rval = SNMPERR_SUCCESS;
+ u_int properlength = 0, properlength_iv = 0;
+ u_char pad_block[128]; /* bigger than anything I need */
+ u_char my_iv[128]; /* ditto */
+ int pad, plast, pad_size = 0;
+ int have_trans;
+#ifndef NETSNMP_DISABLE_DES
+#ifdef OLD_DES
+ DES_key_schedule key_sch;
+#else
+ DES_key_schedule key_sched_store;
+ DES_key_schedule *key_sch = &key_sched_store;
+#endif
+ DES_cblock key_struct;
+#endif
+#ifdef HAVE_AES
+ AES_KEY aes_key;
+ int new_ivlen = 0;
+#endif
+
+ DEBUGTRACE;
+
+ /*
+ * Sanity check.
+ */
+#if !defined(NETSNMP_ENABLE_SCAPI_AUTHPRIV)
+ snmp_log(LOG_ERR, "Encryption support not enabled.\n");
+ return SNMPERR_SC_NOT_CONFIGURED;
+#endif
+
+ if (!privtype || !key || !iv || !plaintext || !ciphertext || !ctlen
+ || (keylen <= 0) || (ivlen <= 0) || (ptlen <= 0) || (*ctlen <= 0)
+ || (privtypelen != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ } else if (ptlen > *ctlen) {
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ }
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ {
+ size_t buf_len = 128, out_len = 0;
+ u_char *buf = (u_char *) malloc(buf_len);
+
+ if (buf != NULL) {
+ if (sprint_realloc_hexstring(&buf, &buf_len, &out_len, 1,
+ iv, ivlen)) {
+ DEBUGMSGTL(("scapi", "encrypt: IV: %s/", buf));
+ } else {
+ DEBUGMSGTL(("scapi", "encrypt: IV: %s [TRUNCATED]/", buf));
+ }
+ out_len = 0;
+ if (sprint_realloc_hexstring(&buf, &buf_len, &out_len, 1,
+ key, keylen)) {
+ DEBUGMSG(("scapi", "%s\n", buf));
+ } else {
+ DEBUGMSG(("scapi", "%s [TRUNCATED]\n", buf));
+ }
+ out_len = 0;
+ if (sprint_realloc_hexstring(&buf, &buf_len, &out_len, 1,
+ plaintext, 16)) {
+ DEBUGMSGTL(("scapi", "encrypt: string: %s\n", buf));
+ } else {
+ DEBUGMSGTL(("scapi", "encrypt: string: %s [TRUNCATED]\n",
+ buf));
+ }
+ free(buf);
+ } else {
+ DEBUGMSGTL(("scapi",
+ "encrypt: malloc fail for debug output\n"));
+ }
+ }
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+
+ /*
+ * Determine privacy transform.
+ */
+ have_trans = 0;
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(privtype, DESPriv)) {
+ properlength = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES);
+ properlength_iv = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES_IV);
+ pad_size = properlength;
+ have_trans = 1;
+ }
+#endif
+#ifdef HAVE_AES
+ if (ISTRANSFORM(privtype, AESPriv)) {
+ properlength = BYTESIZE(SNMP_TRANS_PRIVLEN_AES);
+ properlength_iv = BYTESIZE(SNMP_TRANS_PRIVLEN_AES_IV);
+ have_trans = 1;
+ }
+#endif
+ if (!have_trans) {
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ }
+
+ if ((keylen < properlength) || (ivlen < properlength_iv)) {
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ }
+
+ memset(my_iv, 0, sizeof(my_iv));
+
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(privtype, DESPriv)) {
+
+ /*
+ * now calculate the padding needed
+ */
+ pad = pad_size - (ptlen % pad_size);
+ plast = (int) ptlen - (pad_size - pad);
+ if (pad == pad_size)
+ pad = 0;
+ if (ptlen + pad > *ctlen) {
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit); /* not enough space */
+ }
+ if (pad > 0) { /* copy data into pad block if needed */
+ memcpy(pad_block, plaintext + plast, pad_size - pad);
+ memset(&pad_block[pad_size - pad], pad, pad); /* filling in padblock */
+ }
+
+ memcpy(key_struct, key, sizeof(key_struct));
+ (void) DES_key_sched(&key_struct, key_sch);
+
+ memcpy(my_iv, iv, ivlen);
+ /*
+ * encrypt the data
+ */
+ DES_ncbc_encrypt(plaintext, ciphertext, plast, key_sch,
+ (DES_cblock *) my_iv, DES_ENCRYPT);
+ if (pad > 0) {
+ /*
+ * then encrypt the pad block
+ */
+ DES_ncbc_encrypt(pad_block, ciphertext + plast, pad_size,
+ key_sch, (DES_cblock *) my_iv, DES_ENCRYPT);
+ *ctlen = plast + pad_size;
+ } else {
+ *ctlen = plast;
+ }
+ }
+#endif
+#ifdef HAVE_AES
+ if (ISTRANSFORM(privtype, AESPriv)) {
+ (void) AES_set_encrypt_key(key, properlength*8, &aes_key);
+
+ memcpy(my_iv, iv, ivlen);
+ /*
+ * encrypt the data
+ */
+ AES_cfb128_encrypt(plaintext, ciphertext, ptlen,
+ &aes_key, my_iv, &new_ivlen, AES_ENCRYPT);
+ *ctlen = ptlen;
+ }
+#endif
+ sc_encrypt_quit:
+ /*
+ * clear memory just in case
+ */
+ memset(my_iv, 0, sizeof(my_iv));
+ memset(pad_block, 0, sizeof(pad_block));
+#ifndef NETSNMP_DISABLE_DES
+ memset(key_struct, 0, sizeof(key_struct));
+#ifdef OLD_DES
+ memset(&key_sch, 0, sizeof(key_sch));
+#else
+ memset(&key_sched_store, 0, sizeof(key_sched_store));
+#endif
+#endif
+#ifdef HAVE_AES
+ memset(&aes_key,0,sizeof(aes_key));
+#endif
+ return rval;
+
+} /* end sc_encrypt() */
+#elif defined(NETSNMP_USE_PKCS11)
+{
+ int rval = SNMPERR_SUCCESS;
+ u_int properlength, properlength_iv;
+ u_char pkcs_des_key[8];
+
+ DEBUGTRACE;
+
+ /*
+ * Sanity check.
+ */
+#if !defined(NETSNMP_ENABLE_SCAPI_AUTHPRIV)
+ snmp_log(LOG_ERR, "Encryption support not enabled.\n");
+ return SNMPERR_SC_NOT_CONFIGURED;
+#endif
+
+ if (!privtype || !key || !iv || !plaintext || !ciphertext || !ctlen
+ || (keylen <= 0) || (ivlen <= 0) || (ptlen <= 0) || (*ctlen <= 0)
+ || (privtypelen != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ } else if (ptlen > *ctlen) {
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ }
+
+ /*
+ * Determine privacy transform.
+ */
+ if (ISTRANSFORM(privtype, DESPriv)) {
+ properlength = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES);
+ properlength_iv = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES_IV);
+ } else {
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ }
+
+ if ((keylen < properlength) || (ivlen < properlength_iv)) {
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ }
+
+ if (ISTRANSFORM(privtype, DESPriv)) {
+ memset(pkcs_des_key, 0, sizeof(pkcs_des_key));
+ memcpy(pkcs_des_key, key, sizeof(pkcs_des_key));
+ rval = pkcs_encrpyt(CKM_DES_CBC, pkcs_des_key,
+ sizeof(pkcs_des_key), iv, ivlen, plaintext, ptlen,
+ ciphertext, ctlen);
+ }
+
+ sc_encrypt_quit:
+ return rval;
+}
+#else
+{
+# if NETSNMP_USE_INTERNAL_MD5
+ {
+ snmp_log(LOG_ERR, "Encryption support not enabled.\n");
+ DEBUGMSGTL(("scapi", "Encrypt function not defined.\n"));
+ return SNMPERR_SC_GENERAL_FAILURE;
+ }
+
+# else
+ _SCAPI_NOT_CONFIGURED
+# endif /* NETSNMP_USE_INTERNAL_MD5 */
+}
+#endif /* */
+
+
+
+/*******************************************************************-o-******
+ * sc_decrypt
+ *
+ * Parameters:
+ * privtype
+ * *key
+ * keylen
+ * *iv
+ * ivlen
+ * *ciphertext
+ * ctlen
+ * *plaintext
+ * *ptlen
+ *
+ * Returns:
+ * SNMPERR_SUCCESS Success.
+ * SNMPERR_SC_NOT_CONFIGURED Encryption is not supported.
+ * SNMPERR_SC_GENERAL_FAILURE Any other error
+ *
+ *
+ * Decrypt ciphertext into plaintext using key and iv.
+ *
+ * ptlen contains actual number of plaintext bytes in plaintext upon
+ * successful return.
+ */
+int
+sc_decrypt(const oid * privtype, size_t privtypelen,
+ u_char * key, u_int keylen,
+ u_char * iv, u_int ivlen,
+ u_char * ciphertext, u_int ctlen,
+ u_char * plaintext, size_t * ptlen)
+#if defined(NETSNMP_USE_OPENSSL) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
+{
+
+ int rval = SNMPERR_SUCCESS;
+ u_char my_iv[128];
+#ifndef NETSNMP_DISABLE_DES
+#ifdef OLD_DES
+ DES_key_schedule key_sch;
+#else
+ DES_key_schedule key_sched_store;
+ DES_key_schedule *key_sch = &key_sched_store;
+#endif
+ DES_cblock key_struct;
+#endif
+ u_int properlength = 0, properlength_iv = 0;
+ int have_transform;
+#ifdef HAVE_AES
+ int new_ivlen = 0;
+ AES_KEY aes_key;
+#endif
+
+ DEBUGTRACE;
+
+ if (!privtype || !key || !iv || !plaintext || !ciphertext || !ptlen
+ || (ctlen <= 0) || (*ptlen <= 0) || (*ptlen < ctlen)
+ || (privtypelen != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, sc_decrypt_quit);
+ }
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ {
+ size_t buf_len = 128, out_len = 0;
+ u_char *buf = (u_char *) malloc(buf_len);
+
+ if (buf != NULL) {
+ if (sprint_realloc_hexstring(&buf, &buf_len, &out_len, 1,
+ iv, ivlen)) {
+ DEBUGMSGTL(("scapi", "decrypt: IV: %s/", buf));
+ } else {
+ DEBUGMSGTL(("scapi", "decrypt: IV: %s [TRUNCATED]/", buf));
+ }
+ out_len = 0;
+ if (sprint_realloc_hexstring(&buf, &buf_len, &out_len, 1,
+ key, keylen)) {
+ DEBUGMSG(("scapi", "%s\n", buf));
+ } else {
+ DEBUGMSG(("scapi", "%s\n", buf));
+ }
+ free(buf);
+ } else {
+ DEBUGMSGTL(("scapi",
+ "decrypt: malloc fail for debug output\n"));
+ }
+ }
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+ /*
+ * Determine privacy transform.
+ */
+ have_transform = 0;
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(privtype, DESPriv)) {
+ properlength = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES);
+ properlength_iv = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES_IV);
+ have_transform = 1;
+ }
+#endif
+#ifdef HAVE_AES
+ if (ISTRANSFORM(privtype, AESPriv)) {
+ properlength = BYTESIZE(SNMP_TRANS_PRIVLEN_AES);
+ properlength_iv = BYTESIZE(SNMP_TRANS_PRIVLEN_AES_IV);
+ have_transform = 1;
+ }
+#endif
+ if (!have_transform) {
+ QUITFUN(SNMPERR_GENERR, sc_decrypt_quit);
+ }
+
+ if ((keylen < properlength) || (ivlen < properlength_iv)) {
+ QUITFUN(SNMPERR_GENERR, sc_decrypt_quit);
+ }
+
+ memset(my_iv, 0, sizeof(my_iv));
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(privtype, DESPriv)) {
+ memcpy(key_struct, key, sizeof(key_struct));
+ (void) DES_key_sched(&key_struct, key_sch);
+
+ memcpy(my_iv, iv, ivlen);
+ DES_cbc_encrypt(ciphertext, plaintext, ctlen, key_sch,
+ (DES_cblock *) my_iv, DES_DECRYPT);
+ *ptlen = ctlen;
+ }
+#endif
+#ifdef HAVE_AES
+ if (ISTRANSFORM(privtype, AESPriv)) {
+ (void) AES_set_encrypt_key(key, properlength*8, &aes_key);
+
+ memcpy(my_iv, iv, ivlen);
+ /*
+ * encrypt the data
+ */
+ AES_cfb128_encrypt(ciphertext, plaintext, ctlen,
+ &aes_key, my_iv, &new_ivlen, AES_DECRYPT);
+ *ptlen = ctlen;
+ }
+#endif
+
+ /*
+ * exit cond
+ */
+ sc_decrypt_quit:
+#ifndef NETSNMP_DISABLE_DES
+#ifdef OLD_DES
+ memset(&key_sch, 0, sizeof(key_sch));
+#else
+ memset(&key_sched_store, 0, sizeof(key_sched_store));
+#endif
+ memset(key_struct, 0, sizeof(key_struct));
+#endif
+ memset(my_iv, 0, sizeof(my_iv));
+ return rval;
+} /* USE OPEN_SSL */
+#elif NETSNMP_USE_PKCS11 /* USE PKCS */
+{
+ int rval = SNMPERR_SUCCESS;
+ u_int properlength, properlength_iv;
+ u_char pkcs_des_key[8];
+
+ DEBUGTRACE;
+
+ if (!privtype || !key || !iv || !plaintext || !ciphertext || !ptlen
+ || (ctlen <= 0) || (*ptlen <= 0) || (*ptlen < ctlen)
+ || (privtypelen != USM_LENGTH_OID_TRANSFORM)) {
+ QUITFUN(SNMPERR_GENERR, sc_decrypt_quit);
+ }
+
+ /*
+ * Determine privacy transform.
+ */
+ if (ISTRANSFORM(privtype, DESPriv)) {
+ properlength = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES);
+ properlength_iv = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES_IV);
+ } else {
+ QUITFUN(SNMPERR_GENERR, sc_decrypt_quit);
+ }
+
+ if ((keylen < properlength) || (ivlen < properlength_iv)) {
+ QUITFUN(SNMPERR_GENERR, sc_decrypt_quit);
+ }
+
+ if (ISTRANSFORM(privtype, DESPriv)) {
+ memset(pkcs_des_key, 0, sizeof(pkcs_des_key));
+ memcpy(pkcs_des_key, key, sizeof(pkcs_des_key));
+ rval = pkcs_decrpyt(CKM_DES_CBC, pkcs_des_key,
+ sizeof(pkcs_des_key), iv, ivlen, ciphertext,
+ ctlen, plaintext, ptlen);
+ *ptlen = ctlen;
+ }
+
+ sc_decrypt_quit:
+ return rval;
+} /* USE PKCS */
+#else
+{
+#if !defined(NETSNMP_ENABLE_SCAPI_AUTHPRIV)
+ snmp_log(LOG_ERR, "Encryption support not enabled.\n");
+ return SNMPERR_SC_NOT_CONFIGURED;
+#else
+# if NETSNMP_USE_INTERNAL_MD5
+ {
+ DEBUGMSGTL(("scapi", "Decryption function not defined.\n"));
+ return SNMPERR_SC_GENERAL_FAILURE;
+ }
+
+# else
+ _SCAPI_NOT_CONFIGURED
+# endif /* NETSNMP_USE_INTERNAL_MD5 */
+#endif /* */
+}
+#endif /* NETSNMP_USE_OPENSSL */
+
+#ifdef NETSNMP_USE_INTERNAL_CRYPTO
+
+/* These functions are basically copies of the MDSign() routine in
+ md5.c modified to be used with the OpenSSL hashing functions. The
+ copyright below is from the md5.c file that these functions were
+ taken from: */
+
+/*
+ * ** **************************************************************************
+ * ** md5.c -- Implementation of MD5 Message Digest Algorithm **
+ * ** Updated: 2/16/90 by Ronald L. Rivest **
+ * ** (C) 1990 RSA Data Security, Inc. **
+ * ** **************************************************************************
+ */
+
+/*
+ * MD5_hmac(data, len, MD5): do a checksum on an arbirtrary amount
+ * of data, and prepended with a secret in the standard fashion
+ */
+static int
+MD5_hmac(const u_char * data, size_t len, u_char * mac, size_t maclen,
+ const u_char * secret, size_t secretlen)
+{
+#define MD5_HASHKEYLEN 64
+#define MD5_SECRETKEYLEN 16
+
+ MD5_CTX cmd5;
+ u_char K1[MD5_HASHKEYLEN];
+ u_char K2[MD5_HASHKEYLEN];
+ u_char extendedAuthKey[MD5_HASHKEYLEN];
+ u_char buf[MD5_HASHKEYLEN];
+ size_t i;
+ const u_char *cp;
+ u_char *newdata = NULL;
+ int rc = 0;
+
+ /*
+ * memset(K1,0,MD5_HASHKEYLEN);
+ * memset(K2,0,MD5_HASHKEYLEN);
+ * memset(buf,0,MD5_HASHKEYLEN);
+ * memset(extendedAuthKey,0,MD5_HASHKEYLEN);
+ */
+
+ if (secretlen != MD5_SECRETKEYLEN || secret == NULL ||
+ mac == NULL || data == NULL ||
+ len <= 0 || maclen <= 0) {
+ /*
+ * DEBUGMSGTL(("md5","MD5 signing not properly initialized"));
+ */
+ return -1;
+ }
+
+ memset(extendedAuthKey, 0, MD5_HASHKEYLEN);
+ memcpy(extendedAuthKey, secret, secretlen);
+ for (i = 0; i < MD5_HASHKEYLEN; i++) {
+ K1[i] = extendedAuthKey[i] ^ 0x36;
+ K2[i] = extendedAuthKey[i] ^ 0x5c;
+ }
+
+ MD5_Init(&cmd5);
+ rc = !MD5_Update(&cmd5, K1, MD5_HASHKEYLEN);
+ if (rc)
+ goto update_end;
+
+ i = len;
+ if (((uintptr_t) data) % sizeof(long) != 0) {
+ /*
+ * this relies on the ability to use integer math and thus we
+ * must rely on data that aligns on 32-bit-word-boundries
+ */
+ memdup(&newdata, data, len);
+ cp = newdata;
+ } else {
+ cp = data;
+ }
+
+ while (i >= 64) {
+ rc = !MD5_Update(&cmd5, cp, 64);
+ if (rc)
+ goto update_end;
+ cp += 64;
+ i -= 64;
+ }
+
+ rc = !MD5_Update(&cmd5, cp, i);
+ if (rc)
+ goto update_end;
+
+ memset(buf, 0, MD5_HASHKEYLEN);
+ MD5_Final(buf, &cmd5);
+
+ MD5_Init(&cmd5);
+ rc = !MD5_Update(&cmd5, K2, MD5_HASHKEYLEN);
+ if (rc)
+ goto update_end;
+ rc = !MD5_Update(&cmd5, buf, MD5_SECRETKEYLEN);
+ if (rc)
+ goto update_end;
+
+ /*
+ * copy the sign checksum to the outgoing pointer
+ */
+ MD5_Final(buf, &cmd5);
+ memcpy(mac, buf, maclen);
+
+ update_end:
+ memset(buf, 0, MD5_HASHKEYLEN);
+ memset(K1, 0, MD5_HASHKEYLEN);
+ memset(K2, 0, MD5_HASHKEYLEN);
+ memset(extendedAuthKey, 0, MD5_HASHKEYLEN);
+ memset(&cmd5, 0, sizeof(cmd5));
+
+ if (newdata)
+ free(newdata);
+ return rc;
+}
+
+static int
+SHA1_hmac(const u_char * data, size_t len, u_char * mac, size_t maclen,
+ const u_char * secret, size_t secretlen)
+{
+#define SHA1_HASHKEYLEN 64
+#define SHA1_SECRETKEYLEN 20
+
+ SHA_CTX csha1;
+ u_char K1[SHA1_HASHKEYLEN];
+ u_char K2[SHA1_HASHKEYLEN];
+ u_char extendedAuthKey[SHA1_HASHKEYLEN];
+ u_char buf[SHA1_HASHKEYLEN];
+ size_t i;
+ const u_char *cp;
+ u_char *newdata = NULL;
+ int rc = 0;
+
+ /*
+ * memset(K1,0,SHA1_HASHKEYLEN);
+ * memset(K2,0,SHA1_HASHKEYLEN);
+ * memset(buf,0,SHA1_HASHKEYLEN);
+ * memset(extendedAuthKey,0,SHA1_HASHKEYLEN);
+ */
+
+ if (secretlen != SHA1_SECRETKEYLEN || secret == NULL ||
+ mac == NULL || data == NULL ||
+ len <= 0 || maclen <= 0) {
+ /*
+ * DEBUGMSGTL(("sha1","SHA1 signing not properly initialized"));
+ */
+ return -1;
+ }
+
+ memset(extendedAuthKey, 0, SHA1_HASHKEYLEN);
+ memcpy(extendedAuthKey, secret, secretlen);
+ for (i = 0; i < SHA1_HASHKEYLEN; i++) {
+ K1[i] = extendedAuthKey[i] ^ 0x36;
+ K2[i] = extendedAuthKey[i] ^ 0x5c;
+ }
+
+ SHA1_Init(&csha1);
+ rc = !SHA1_Update(&csha1, K1, SHA1_HASHKEYLEN);
+ if (rc)
+ goto update_end;
+
+ i = len;
+ if (((uintptr_t) data) % sizeof(long) != 0) {
+ /*
+ * this relies on the ability to use integer math and thus we
+ * must rely on data that aligns on 32-bit-word-boundries
+ */
+ memdup(&newdata, data, len);
+ cp = newdata;
+ } else {
+ cp = data;
+ }
+
+ while (i >= 64) {
+ rc = !SHA1_Update(&csha1, cp, 64);
+ if (rc)
+ goto update_end;
+ cp += 64;
+ i -= 64;
+ }
+
+ rc = !SHA1_Update(&csha1, cp, i);
+ if (rc)
+ goto update_end;
+
+ memset(buf, 0, SHA1_HASHKEYLEN);
+ SHA1_Final(buf, &csha1);
+
+ SHA1_Init(&csha1);
+ rc = !SHA1_Update(&csha1, K2, SHA1_HASHKEYLEN);
+ if (rc)
+ goto update_end;
+ rc = !SHA1_Update(&csha1, buf, SHA1_SECRETKEYLEN);
+ if (rc)
+ goto update_end;
+
+ /*
+ * copy the sign checksum to the outgoing pointer
+ */
+ SHA1_Final(buf, &csha1);
+ memcpy(mac, buf, maclen);
+
+ update_end:
+ memset(buf, 0, SHA1_HASHKEYLEN);
+ memset(K1, 0, SHA1_HASHKEYLEN);
+ memset(K2, 0, SHA1_HASHKEYLEN);
+ memset(extendedAuthKey, 0, SHA1_HASHKEYLEN);
+ memset(&csha1, 0, sizeof(csha1));
+
+ if (newdata)
+ free(newdata);
+ return rc;
+}
+#endif /* NETSNMP_USE_INTERNAL_CRYPTO */
+#endif /* NETSNMP_FEATURE_REMOVE_USM_SCAPI */
diff --git a/snmplib/snmp-tc.c b/snmplib/snmp-tc.c
new file mode 100644
index 0000000..891c3a0
--- /dev/null
+++ b/snmplib/snmp-tc.c
@@ -0,0 +1,476 @@
+/*
+ * Host Resources MIB - utility functions - hr_utils.c
+ *
+ */
+
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <sys/types.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <ctype.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.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 <net-snmp/types.h>
+#include <net-snmp/library/snmp-tc.h> /* for "internal" definitions */
+#include <net-snmp/library/snmp_api.h>
+
+netsnmp_feature_child_of(snmp_tc_all, libnetsnmp)
+
+netsnmp_feature_child_of(netsnmp_dateandtime_set_buf_from_vars, netsnmp_unused)
+netsnmp_feature_child_of(date_n_time, snmp_tc_all)
+netsnmp_feature_child_of(ctime_to_timet, snmp_tc_all)
+netsnmp_feature_child_of(check_rowstatus_with_storagetype_transition, snmp_tc_all)
+
+#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_DATEANDTIME_SET_BUF_FROM_VARS
+/*
+ DateAndTime ::= TEXTUAL-CONVENTION
+ DISPLAY-HINT "2d-1d-1d,1d:1d:1d.1d,1a1d:1d"
+ STATUS current
+ DESCRIPTION
+ "A date-time specification.
+
+ field octets contents range
+ ----- ------ -------- -----
+ 1 1-2 year* 0..65536
+ 2 3 month 1..12
+ 3 4 day 1..31
+ 4 5 hour 0..23
+ 5 6 minutes 0..59
+ 6 7 seconds 0..60
+ (use 60 for leap-second)
+ 7 8 deci-seconds 0..9
+ 8 9 direction from UTC '+' / '-'
+ 9 10 hours from UTC* 0..13
+ 10 11 minutes from UTC 0..59
+
+ * Notes:
+ - the value of year is in network-byte order
+ - daylight saving time in New Zealand is +13
+
+ For example, Tuesday May 26, 1992 at 1:30:15 PM EDT would be
+ displayed as:
+
+ 1992-5-26,13:30:15.0,-4:0
+
+ Note that if only local time is known, then timezone
+ information (fields 8-10) is not present."
+ SYNTAX OCTET STRING (SIZE (8 | 11))
+*/
+
+int
+netsnmp_dateandtime_set_buf_from_vars(u_char *buf, size_t *bufsize,
+ u_short year, u_char month, u_char day,
+ u_char hour, u_char minutes,
+ u_char seconds, u_char deci_seconds,
+ int utc_offset_direction,
+ u_char utc_offset_hours,
+ u_char utc_offset_minutes)
+{
+ u_short tmp_year = htons(year);
+
+ /*
+ * if we have a utc offset, need 11 bytes. Otherwise we
+ * just need 8 bytes.
+ */
+ if(utc_offset_direction) {
+ if(*bufsize < 11)
+ return SNMPERR_RANGE;
+
+ /*
+ * set utc offset data
+ */
+ buf[8] = (utc_offset_direction < 0) ? '-' : '+';
+ buf[9] = utc_offset_hours;
+ buf[10] = utc_offset_minutes;
+ *bufsize = 11;
+ }
+ else if(*bufsize < 8)
+ return SNMPERR_RANGE;
+ else
+ *bufsize = 8;
+
+ /*
+ * set basic date/time data
+ */
+ memcpy(buf, &tmp_year, sizeof(tmp_year));
+ buf[2] = month;
+ buf[3] = day;
+ buf[4] = hour;
+ buf[5] = minutes;
+ buf[6] = seconds;
+ buf[7] = deci_seconds;
+
+ return SNMPERR_SUCCESS;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_DATEANDTIME_SET_BUF_FROM_VARS */
+
+#ifndef NETSNMP_FEATURE_REMOVE_DATE_N_TIME
+u_char *
+date_n_time(const time_t * when, size_t * length)
+{
+ struct tm *tm_p;
+ static u_char string[11];
+ unsigned short yauron;
+
+ /*
+ * Null time
+ */
+ if (when == NULL || *when == 0 || *when == (time_t) - 1) {
+ string[0] = 0;
+ string[1] = 0;
+ string[2] = 1;
+ string[3] = 1;
+ string[4] = 0;
+ string[5] = 0;
+ string[6] = 0;
+ string[7] = 0;
+ *length = 8;
+ return string;
+ }
+
+
+ /*
+ * Basic 'local' time handling
+ */
+ tm_p = localtime(when);
+ yauron = tm_p->tm_year + 1900;
+ string[0] = (u_char)(yauron >> 8);
+ string[1] = (u_char)yauron;
+ string[2] = tm_p->tm_mon + 1;
+ string[3] = tm_p->tm_mday;
+ string[4] = tm_p->tm_hour;
+ string[5] = tm_p->tm_min;
+ string[6] = tm_p->tm_sec;
+ string[7] = 0;
+ *length = 8;
+
+#if defined(HAVE_STRUCT_TM_TM_GMTOFF) || defined(HAVE_TIMEZONE_VARIABLE)
+ /*
+ * Timezone offset
+ */
+ {
+#ifdef HAVE_STRUCT_TM_TM_GMTOFF
+ const int tzoffset = -tm_p->tm_gmtoff; /* Seconds east of UTC */
+#else
+ const int tzoffset = timezone; /* Seconds west of UTC */
+#endif
+ if (tzoffset > 0)
+ string[8] = '-';
+ else
+ string[8] = '+';
+ string[9] = abs(tzoffset) / 3600;
+ string[10] = (abs(tzoffset) - string[9] * 3600) / 60;
+ *length = 11;
+ }
+#endif
+
+#if defined(SYSV) && !HAVE_STRUCT_TM_TM_GMTOFF
+ /*
+ * Daylight saving time
+ */
+ if (tm_p->tm_isdst > 0) {
+ /*
+ * Assume add one hour
+ */
+ if (string[8] == '-')
+ --string[9];
+ else
+ ++string[9];
+
+ if (string[9] == 0)
+ string[8] = '+';
+ }
+#endif
+
+ return string;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_DATE_N_TIME */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CTIME_TO_TIMET
+time_t
+ctime_to_timet(const char *str)
+{
+ struct tm tm;
+
+ if (strlen(str) < 24)
+ return 0;
+
+ /*
+ * Month
+ */
+ if (!strncmp(str + 4, "Jan", 3))
+ tm.tm_mon = 0;
+ else if (!strncmp(str + 4, "Feb", 3))
+ tm.tm_mon = 1;
+ else if (!strncmp(str + 4, "Mar", 3))
+ tm.tm_mon = 2;
+ else if (!strncmp(str + 4, "Apr", 3))
+ tm.tm_mon = 3;
+ else if (!strncmp(str + 4, "May", 3))
+ tm.tm_mon = 4;
+ else if (!strncmp(str + 4, "Jun", 3))
+ tm.tm_mon = 5;
+ else if (!strncmp(str + 4, "Jul", 3))
+ tm.tm_mon = 6;
+ else if (!strncmp(str + 4, "Aug", 3))
+ tm.tm_mon = 7;
+ else if (!strncmp(str + 4, "Sep", 3))
+ tm.tm_mon = 8;
+ else if (!strncmp(str + 4, "Oct", 3))
+ tm.tm_mon = 9;
+ else if (!strncmp(str + 4, "Nov", 3))
+ tm.tm_mon = 10;
+ else if (!strncmp(str + 4, "Dec", 3))
+ tm.tm_mon = 11;
+ else
+ return 0;
+
+ tm.tm_mday = atoi(str + 8);
+ tm.tm_hour = atoi(str + 11);
+ tm.tm_min = atoi(str + 14);
+ tm.tm_sec = atoi(str + 17);
+ tm.tm_year = atoi(str + 20) - 1900;
+
+ /*
+ * Cope with timezone and DST
+ */
+
+#ifdef SYSV
+ if (daylight)
+ tm.tm_isdst = 1;
+
+ tm.tm_sec -= timezone;
+#endif
+
+ return (mktime(&tm));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CTIME_TO_TIMET */
+
+/*
+ * blatantly lifted from opensnmp
+ */
+char
+check_rowstatus_transition(int oldValue, int newValue)
+{
+ /*
+ * From the SNMPv2-TC MIB:
+ * STATE
+ * +--------------+-----------+-------------+-------------
+ * | A | B | C | D
+ * | |status col.|status column|
+ * |status column | is | is |status column
+ * ACTION |does not exist| notReady | notInService| is active
+ * --------------+--------------+-----------+-------------+-------------
+ * set status |noError ->D|inconsist- |inconsistent-|inconsistent-
+ * column to | or | entValue| Value| Value
+ * createAndGo |inconsistent- | | |
+ * | Value| | |
+ * --------------+--------------+-----------+-------------+-------------
+ * set status |noError see 1|inconsist- |inconsistent-|inconsistent-
+ * column to | or | entValue| Value| Value
+ * createAndWait |wrongValue | | |
+ * --------------+--------------+-----------+-------------+-------------
+ * set status |inconsistent- |inconsist- |noError |noError
+ * column to | Value| entValue| |
+ * active | | | |
+ * | | or | |
+ * | | | |
+ * | |see 2 ->D|see 8 ->D| ->D
+ * --------------+--------------+-----------+-------------+-------------
+ * set status |inconsistent- |inconsist- |noError |noError ->C
+ * column to | Value| entValue| |
+ * notInService | | | |
+ * | | or | | or
+ * | | | |
+ * | |see 3 ->C| ->C|see 6
+ * --------------+--------------+-----------+-------------+-------------
+ * set status |noError |noError |noError |noError ->A
+ * column to | | | | or
+ * destroy | ->A| ->A| ->A|see 7
+ * --------------+--------------+-----------+-------------+-------------
+ * set any other |see 4 |noError |noError |see 5
+ * column to some| | | |
+ * value | | see 1| ->C| ->D
+ * --------------+--------------+-----------+-------------+-------------
+
+ * (1) goto B or C, depending on information available to the
+ * agent.
+
+ * (2) if other variable bindings included in the same PDU,
+ * provide values for all columns which are missing but
+ * required, and all columns have acceptable values, then
+ * return noError and goto D.
+
+ * (3) if other variable bindings included in the same PDU,
+ * provide legal values for all columns which are missing but
+ * required, then return noError and goto C.
+
+ * (4) at the discretion of the agent, the return value may be
+ * either:
+
+ * inconsistentName: because the agent does not choose to
+ * create such an instance when the corresponding
+ * RowStatus instance does not exist, or
+
+ * inconsistentValue: if the supplied value is
+ * inconsistent with the state of some other MIB object's
+ * value, or
+
+ * noError: because the agent chooses to create the
+ * instance.
+
+ * If noError is returned, then the instance of the status
+ * column must also be created, and the new state is B or C,
+ * depending on the information available to the agent. If
+ * inconsistentName or inconsistentValue is returned, the row
+ * remains in state A.
+
+ * (5) depending on the MIB definition for the column/table,
+ * either noError or inconsistentValue may be returned.
+
+ * (6) the return value can indicate one of the following
+ * errors:
+
+ * wrongValue: because the agent does not support
+ * notInService (e.g., an agent which does not support
+ * createAndWait), or
+
+ * inconsistentValue: because the agent is unable to take
+ * the row out of service at this time, perhaps because it
+ * is in use and cannot be de-activated.
+
+ * (7) the return value can indicate the following error:
+
+ * inconsistentValue: because the agent is unable to
+ * remove the row at this time, perhaps because it is in
+ * use and cannot be de-activated.
+
+ * (8) the transition to D can fail, e.g., if the values of the
+ * conceptual row are inconsistent, then the error code would
+ * be inconsistentValue.
+
+ * NOTE: Other processing of (this and other varbinds of) the
+ * set request may result in a response other than noError
+ * being returned, e.g., wrongValue, noCreation, etc.
+ */
+
+ switch (newValue) {
+ /*
+ * these two end up being equivelent as far as checking the
+ * status goes, although the final states are based on the
+ * newValue.
+ */
+ case RS_ACTIVE:
+ case RS_NOTINSERVICE:
+ if (oldValue == RS_NOTINSERVICE || oldValue == RS_ACTIVE)
+ ;
+ else
+ return SNMP_ERR_INCONSISTENTVALUE;
+ break;
+
+ case RS_NOTREADY:
+ /*
+ * Illegal set value.
+ */
+ return SNMP_ERR_WRONGVALUE;
+ break;
+
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (oldValue != RS_NONEXISTENT)
+ /*
+ * impossible, we already exist.
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ break;
+
+ case RS_DESTROY:
+ break;
+
+ default:
+ return SNMP_ERR_WRONGVALUE;
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_ROWSTATUS_WITH_STORAGETYPE_TRANSITION
+char
+check_rowstatus_with_storagetype_transition(int oldValue, int newValue,
+ int oldStorage)
+{
+ /*
+ * can not destroy permanent or readonly rows
+ */
+ if ((RS_DESTROY == newValue) &&
+ ((SNMP_STORAGE_PERMANENT == oldStorage) ||
+ (SNMP_STORAGE_READONLY == oldStorage)))
+ return SNMP_ERR_WRONGVALUE;
+
+ return check_rowstatus_transition(oldValue, newValue);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_ROWSTATUS_WITH_STORAGETYPE_TRANSITION */
+
+netsnmp_feature_child_of(check_storage_transition, snmp_tc_all)
+#ifndef NETSNMP_FEATURE_REMOVE_CHECK_STORAGE_TRANSITION
+char
+check_storage_transition(int oldValue, int newValue)
+{
+ /*
+ * From the SNMPv2-TC MIB:
+
+ * "Describes the memory realization of a conceptual row. A
+ * row which is volatile(2) is lost upon reboot. A row which
+ * is either nonVolatile(3), permanent(4) or readOnly(5), is
+ * backed up by stable storage. A row which is permanent(4)
+ * can be changed but not deleted. A row which is readOnly(5)
+ * cannot be changed nor deleted.
+
+ * If the value of an object with this syntax is either
+ * permanent(4) or readOnly(5), it cannot be written.
+ * Conversely, if the value is either other(1), volatile(2) or
+ * nonVolatile(3), it cannot be modified to be permanent(4) or
+ * readOnly(5). (All illegal modifications result in a
+ * 'wrongValue' error.)
+
+ * Every usage of this textual convention is required to
+ * specify the columnar objects which a permanent(4) row must
+ * at a minimum allow to be writable."
+ */
+ switch (oldValue) {
+ case SNMP_STORAGE_PERMANENT:
+ case SNMP_STORAGE_READONLY:
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+ case SNMP_STORAGE_NONE:
+ case SNMP_STORAGE_OTHER:
+ case SNMP_STORAGE_VOLATILE:
+ case SNMP_STORAGE_NONVOLATILE:
+ if (newValue == SNMP_STORAGE_PERMANENT ||
+ newValue == SNMP_STORAGE_READONLY)
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CHECK_STORAGE_TRANSITION */
diff --git a/snmplib/snmp.c b/snmplib/snmp.c
new file mode 100644
index 0000000..c3763e9
--- /dev/null
+++ b/snmplib/snmp.c
@@ -0,0 +1,462 @@
+/*
+ * Simple Network Management Protocol (RFC 1067).
+ *
+ */
+/**********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+#include <ctype.h>
+
+#ifdef KINETICS
+#include "gw.h"
+#include "ab.h"
+#include "inet.h"
+#include "fp4/cmdmacro.h"
+#include "fp4/pbuf.h"
+#include "glob.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <sys/types.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#ifndef NULL
+#define NULL 0
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#ifdef vms
+#include <in.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp.h> /* for "internal" definitions */
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/mib.h>
+
+/** @mainpage Net-SNMP Coding Documentation
+ * @section Introduction
+
+ This is the Net-SNMP coding and API reference documentation. It is
+ incomplete, but when combined with the manual page set and
+ tutorials forms a pretty comprehensive starting point.
+
+ @section Starting out
+
+ The best places to start learning are the @e Net-SNMP @e tutorial
+ (http://www.Net-SNMP.org/tutorial-5/) and the @e Modules and @e
+ Examples sections of this document.
+
+*/
+
+void
+xdump(const void * data, size_t length, const char *prefix)
+{
+ const u_char * const cp = (const u_char*)data;
+ int col, count;
+ char *buffer;
+
+ buffer = (char *) malloc(strlen(prefix) + 80);
+ if (!buffer) {
+ snmp_log(LOG_NOTICE,
+ "xdump: malloc failed. packet-dump skipped\n");
+ return;
+ }
+
+ count = 0;
+ while (count < (int) length) {
+ strcpy(buffer, prefix);
+ sprintf(buffer + strlen(buffer), "%.4d: ", count);
+
+ for (col = 0; ((count + col) < (int) length) && col < 16; col++) {
+ sprintf(buffer + strlen(buffer), "%02X ", cp[count + col]);
+ if (col % 4 == 3)
+ strcat(buffer, " ");
+ }
+ for (; col < 16; col++) { /* pad end of buffer with zeros */
+ strcat(buffer, " ");
+ if (col % 4 == 3)
+ strcat(buffer, " ");
+ }
+ strcat(buffer, " ");
+ for (col = 0; ((count + col) < (int) length) && col < 16; col++) {
+ buffer[col + 60] =
+ isprint(cp[count + col]) ? cp[count + col] : '.';
+ }
+ buffer[col + 60] = '\n';
+ buffer[col + 60 + 1] = 0;
+ snmp_log(LOG_DEBUG, "%s", buffer);
+ count += col;
+ }
+ snmp_log(LOG_DEBUG, "\n");
+ free(buffer);
+
+} /* end xdump() */
+
+/*
+ * u_char * snmp_parse_var_op(
+ * u_char *data IN - pointer to the start of object
+ * oid *var_name OUT - object id of variable
+ * int *var_name_len IN/OUT - length of variable name
+ * u_char *var_val_type OUT - type of variable (int or octet string) (one byte)
+ * int *var_val_len OUT - length of variable
+ * u_char **var_val OUT - pointer to ASN1 encoded value of variable
+ * int *listlength IN/OUT - number of valid bytes left in var_op_list
+ */
+
+u_char *
+snmp_parse_var_op(u_char * data,
+ oid * var_name,
+ size_t * var_name_len,
+ u_char * var_val_type,
+ size_t * var_val_len,
+ u_char ** var_val, size_t * listlength)
+{
+ u_char var_op_type;
+ size_t var_op_len = *listlength;
+ u_char *var_op_start = data;
+
+ data = asn_parse_sequence(data, &var_op_len, &var_op_type,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR), "var_op");
+ if (data == NULL) {
+ /*
+ * msg detail is set
+ */
+ return NULL;
+ }
+ DEBUGDUMPHEADER("recv", "Name");
+ data =
+ asn_parse_objid(data, &var_op_len, &var_op_type, var_name,
+ var_name_len);
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ ERROR_MSG("No OID for variable");
+ return NULL;
+ }
+ if (var_op_type !=
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID))
+ return NULL;
+ *var_val = data; /* save pointer to this object */
+ /*
+ * find out what type of object this is
+ */
+ data = asn_parse_header(data, &var_op_len, var_val_type);
+ if (data == NULL) {
+ ERROR_MSG("No header for value");
+ return NULL;
+ }
+ /*
+ * XXX no check for type!
+ */
+ *var_val_len = var_op_len;
+ data += var_op_len;
+ *listlength -= (int) (data - var_op_start);
+ return data;
+}
+
+/*
+ * u_char * snmp_build_var_op(
+ * u_char *data IN - pointer to the beginning of the output buffer
+ * oid *var_name IN - object id of variable
+ * int *var_name_len IN - length of object id
+ * u_char var_val_type IN - type of variable
+ * int var_val_len IN - length of variable
+ * u_char *var_val IN - value of variable
+ * int *listlength IN/OUT - number of valid bytes left in
+ * output buffer
+ */
+
+u_char *
+snmp_build_var_op(u_char * data,
+ oid * var_name,
+ size_t * var_name_len,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * var_val, size_t * listlength)
+{
+ size_t dummyLen, headerLen;
+ u_char *dataPtr;
+
+ dummyLen = *listlength;
+ dataPtr = data;
+#if 0
+ data = asn_build_sequence(data, &dummyLen,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ 0);
+ if (data == NULL) {
+ return NULL;
+ }
+#endif
+ if (dummyLen < 4)
+ return NULL;
+ data += 4;
+ dummyLen -= 4;
+
+ headerLen = data - dataPtr;
+ *listlength -= headerLen;
+ DEBUGDUMPHEADER("send", "Name");
+ data = asn_build_objid(data, listlength,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OBJECT_ID), var_name,
+ *var_name_len);
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ ERROR_MSG("Can't build OID for variable");
+ return NULL;
+ }
+ DEBUGDUMPHEADER("send", "Value");
+ switch (var_val_type) {
+ case ASN_INTEGER:
+ data = asn_build_int(data, listlength, var_val_type,
+ (long *) var_val, var_val_len);
+ break;
+ case ASN_GAUGE:
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ data = asn_build_unsigned_int(data, listlength, var_val_type,
+ (u_long *) var_val, var_val_len);
+ break;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_COUNTER64:
+ case ASN_OPAQUE_U64:
+#endif
+ case ASN_COUNTER64:
+ data = asn_build_unsigned_int64(data, listlength, var_val_type,
+ (struct counter64 *) var_val,
+ var_val_len);
+ break;
+ case ASN_OCTET_STR:
+ case ASN_IPADDRESS:
+ case ASN_OPAQUE:
+ case ASN_NSAP:
+ data = asn_build_string(data, listlength, var_val_type,
+ var_val, var_val_len);
+ break;
+ case ASN_OBJECT_ID:
+ data = asn_build_objid(data, listlength, var_val_type,
+ (oid *) var_val, var_val_len / sizeof(oid));
+ break;
+ case ASN_NULL:
+ data = asn_build_null(data, listlength, var_val_type);
+ break;
+ case ASN_BIT_STR:
+ data = asn_build_bitstring(data, listlength, var_val_type,
+ var_val, var_val_len);
+ break;
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ data = asn_build_null(data, listlength, var_val_type);
+ break;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_FLOAT:
+ data = asn_build_float(data, listlength, var_val_type,
+ (float *) var_val, var_val_len);
+ break;
+ case ASN_OPAQUE_DOUBLE:
+ data = asn_build_double(data, listlength, var_val_type,
+ (double *) var_val, var_val_len);
+ break;
+ case ASN_OPAQUE_I64:
+ data = asn_build_signed_int64(data, listlength, var_val_type,
+ (struct counter64 *) var_val,
+ var_val_len);
+ break;
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ default:
+ {
+ char error_buf[64];
+ snprintf(error_buf, sizeof(error_buf),
+ "wrong type in snmp_build_var_op: %d", var_val_type);
+ ERROR_MSG(error_buf);
+ data = NULL;
+ }
+ }
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ return NULL;
+ }
+ dummyLen = (data - dataPtr) - headerLen;
+
+ asn_build_sequence(dataPtr, &dummyLen,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ dummyLen);
+ return data;
+}
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+int
+snmp_realloc_rbuild_var_op(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, int allow_realloc,
+ const oid * var_name, size_t * var_name_len,
+ u_char var_val_type,
+ u_char * var_val, size_t var_val_len)
+{
+ size_t start_offset = *offset;
+ int rc = 0;
+
+ /*
+ * Encode the value.
+ */
+ DEBUGDUMPHEADER("send", "Value");
+
+ switch (var_val_type) {
+ case ASN_INTEGER:
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, allow_realloc,
+ var_val_type, (long *) var_val,
+ var_val_len);
+ break;
+
+ case ASN_GAUGE:
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ rc = asn_realloc_rbuild_unsigned_int(pkt, pkt_len, offset,
+ allow_realloc, var_val_type,
+ (u_long *) var_val,
+ var_val_len);
+ break;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_COUNTER64:
+ case ASN_OPAQUE_U64:
+#endif
+ case ASN_COUNTER64:
+ rc = asn_realloc_rbuild_unsigned_int64(pkt, pkt_len, offset,
+ allow_realloc, var_val_type,
+ (struct counter64 *)
+ var_val, var_val_len);
+ break;
+
+ case ASN_OCTET_STR:
+ case ASN_IPADDRESS:
+ case ASN_OPAQUE:
+ case ASN_NSAP:
+ rc = asn_realloc_rbuild_string(pkt, pkt_len, offset, allow_realloc,
+ var_val_type, var_val, var_val_len);
+ break;
+
+ case ASN_OBJECT_ID:
+ rc = asn_realloc_rbuild_objid(pkt, pkt_len, offset, allow_realloc,
+ var_val_type, (oid *) var_val,
+ var_val_len / sizeof(oid));
+ break;
+
+ case ASN_NULL:
+ rc = asn_realloc_rbuild_null(pkt, pkt_len, offset, allow_realloc,
+ var_val_type);
+ break;
+
+ case ASN_BIT_STR:
+ rc = asn_realloc_rbuild_bitstring(pkt, pkt_len, offset,
+ allow_realloc, var_val_type,
+ var_val, var_val_len);
+ break;
+
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ rc = asn_realloc_rbuild_null(pkt, pkt_len, offset, allow_realloc,
+ var_val_type);
+ break;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_FLOAT:
+ rc = asn_realloc_rbuild_float(pkt, pkt_len, offset, allow_realloc,
+ var_val_type, (float *) var_val,
+ var_val_len);
+ break;
+
+ case ASN_OPAQUE_DOUBLE:
+ rc = asn_realloc_rbuild_double(pkt, pkt_len, offset, allow_realloc,
+ var_val_type, (double *) var_val,
+ var_val_len);
+ break;
+
+ case ASN_OPAQUE_I64:
+ rc = asn_realloc_rbuild_signed_int64(pkt, pkt_len, offset,
+ allow_realloc, var_val_type,
+ (struct counter64 *) var_val,
+ var_val_len);
+ break;
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ default:
+ {
+ char error_buf[64];
+ snprintf(error_buf, sizeof(error_buf),
+ "wrong type in snmp_realloc_rbuild_var_op: %d", var_val_type);
+ ERROR_MSG(error_buf);
+ rc = 0;
+ }
+ }
+ DEBUGINDENTLESS();
+
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * Build the OID.
+ */
+
+ DEBUGDUMPHEADER("send", "Name");
+ rc = asn_realloc_rbuild_objid(pkt, pkt_len, offset, allow_realloc,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OBJECT_ID), var_name,
+ *var_name_len);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ ERROR_MSG("Can't build OID for variable");
+ return 0;
+ }
+
+ /*
+ * Build the sequence header.
+ */
+
+ rc = asn_realloc_rbuild_sequence(pkt, pkt_len, offset, allow_realloc,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR),
+ *offset - start_offset);
+ return rc;
+}
+
+#endif /* NETSNMP_USE_REVERSE_ASNENCODING */
diff --git a/snmplib/snmp_alarm.c b/snmplib/snmp_alarm.c
new file mode 100644
index 0000000..c015102
--- /dev/null
+++ b/snmplib/snmp_alarm.c
@@ -0,0 +1,489 @@
+/*
+ * snmp_alarm.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 snmp_alarm generic library based alarm timers for various parts of an application
+ * @ingroup library
+ *
+ * @{
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <signal.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_STRING_H
+#include <string.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_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmp_alarm.h>
+
+static struct snmp_alarm *thealarms = NULL;
+static int start_alarms = 0;
+static unsigned int regnum = 1;
+
+int
+init_alarm_post_config(int majorid, int minorid, void *serverarg,
+ void *clientarg)
+{
+ start_alarms = 1;
+ set_an_alarm();
+ return SNMPERR_SUCCESS;
+}
+
+void
+init_snmp_alarm(void)
+{
+ start_alarms = 0;
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ init_alarm_post_config, NULL);
+}
+
+void
+sa_update_entry(struct snmp_alarm *a)
+{
+ if (!timerisset(&a->t_lastM)) {
+ /*
+ * First call of sa_update_entry() for alarm a: set t_lastM and t_nextM.
+ */
+ netsnmp_get_monotonic_clock(&a->t_lastM);
+ NETSNMP_TIMERADD(&a->t_lastM, &a->t, &a->t_nextM);
+ } else if (!timerisset(&a->t_nextM)) {
+ /*
+ * We've been called but not reset for the next call.
+ */
+ if (a->flags & SA_REPEAT) {
+ if (timerisset(&a->t)) {
+ NETSNMP_TIMERADD(&a->t_lastM, &a->t, &a->t_nextM);
+ } else {
+ DEBUGMSGTL(("snmp_alarm",
+ "update_entry: illegal interval specified\n"));
+ snmp_alarm_unregister(a->clientreg);
+ }
+ } else {
+ /*
+ * Single time call, remove it.
+ */
+ snmp_alarm_unregister(a->clientreg);
+ }
+ }
+}
+
+/**
+ * This function removes the callback function from a list of registered
+ * alarms, unregistering the alarm.
+ *
+ * @param clientreg is a unique unsigned integer representing a registered
+ * alarm which the client wants to unregister.
+ *
+ * @return void
+ *
+ * @see snmp_alarm_register
+ * @see snmp_alarm_register_hr
+ * @see snmp_alarm_unregister_all
+ */
+void
+snmp_alarm_unregister(unsigned int clientreg)
+{
+ struct snmp_alarm *sa_ptr, **prevNext = &thealarms;
+
+ for (sa_ptr = thealarms;
+ sa_ptr != NULL && sa_ptr->clientreg != clientreg;
+ sa_ptr = sa_ptr->next) {
+ prevNext = &(sa_ptr->next);
+ }
+
+ if (sa_ptr != NULL) {
+ *prevNext = sa_ptr->next;
+ DEBUGMSGTL(("snmp_alarm", "unregistered alarm %d\n",
+ sa_ptr->clientreg));
+ /*
+ * Note: do not free the clientarg, it's the client's responsibility
+ */
+ free(sa_ptr);
+ } else {
+ DEBUGMSGTL(("snmp_alarm", "no alarm %d to unregister\n", clientreg));
+ }
+}
+
+/**
+ * This function unregisters all alarms currently stored.
+ *
+ * @return void
+ *
+ * @see snmp_alarm_register
+ * @see snmp_alarm_register_hr
+ * @see snmp_alarm_unregister
+ */
+void
+snmp_alarm_unregister_all(void)
+{
+ struct snmp_alarm *sa_ptr, *sa_tmp;
+
+ for (sa_ptr = thealarms; sa_ptr != NULL; sa_ptr = sa_tmp) {
+ sa_tmp = sa_ptr->next;
+ free(sa_ptr);
+ }
+ DEBUGMSGTL(("snmp_alarm", "ALL alarms unregistered\n"));
+ thealarms = NULL;
+}
+
+struct snmp_alarm *
+sa_find_next(void)
+{
+ struct snmp_alarm *a, *lowest = NULL;
+
+ for (a = thealarms; a != NULL; a = a->next)
+ if (!(a->flags & SA_FIRED)
+ && (lowest == NULL || timercmp(&a->t_nextM, &lowest->t_nextM, <)))
+ lowest = a;
+
+ return lowest;
+}
+
+NETSNMP_IMPORT struct snmp_alarm *sa_find_specific(unsigned int clientreg);
+struct snmp_alarm *
+sa_find_specific(unsigned int clientreg)
+{
+ struct snmp_alarm *sa_ptr;
+ for (sa_ptr = thealarms; sa_ptr != NULL; sa_ptr = sa_ptr->next) {
+ if (sa_ptr->clientreg == clientreg) {
+ return sa_ptr;
+ }
+ }
+ return NULL;
+}
+
+void
+run_alarms(void)
+{
+ struct snmp_alarm *a;
+ unsigned int clientreg;
+ struct timeval t_now;
+
+ /*
+ * Loop through everything we have repeatedly looking for the next thing to
+ * call until all events are finally in the future again.
+ */
+
+ while ((a = sa_find_next()) != NULL) {
+ netsnmp_get_monotonic_clock(&t_now);
+
+ if (timercmp(&a->t_nextM, &t_now, >))
+ return;
+
+ clientreg = a->clientreg;
+ a->flags |= SA_FIRED;
+ DEBUGMSGTL(("snmp_alarm", "run alarm %d\n", clientreg));
+ (*(a->thecallback)) (clientreg, a->clientarg);
+ DEBUGMSGTL(("snmp_alarm", "alarm %d completed\n", clientreg));
+
+ a = sa_find_specific(clientreg);
+ if (a) {
+ a->t_lastM = t_now;
+ timerclear(&a->t_nextM);
+ a->flags &= ~SA_FIRED;
+ sa_update_entry(a);
+ } else {
+ DEBUGMSGTL(("snmp_alarm", "alarm %d deleted itself\n",
+ clientreg));
+ }
+ }
+}
+
+
+
+RETSIGTYPE
+alarm_handler(int a)
+{
+ run_alarms();
+ set_an_alarm();
+}
+
+
+
+/**
+ * Look up the time at which the next alarm will fire.
+ *
+ * @param[out] alarm_tm Time at which the next alarm will fire.
+ * @param[in] now Earliest time that should be written into *alarm_tm.
+ *
+ * @return Zero if no alarms are scheduled; non-zero 'clientreg' value
+ * identifying the first alarm that will fire if one or more alarms are
+ * scheduled.
+ */
+int
+netsnmp_get_next_alarm_time(struct timeval *alarm_tm, const struct timeval *now)
+{
+ struct snmp_alarm *sa_ptr;
+
+ sa_ptr = sa_find_next();
+
+ if (sa_ptr) {
+ netsnmp_assert(alarm_tm);
+ netsnmp_assert(timerisset(&sa_ptr->t_nextM));
+ if (timercmp(&sa_ptr->t_nextM, now, >))
+ *alarm_tm = sa_ptr->t_nextM;
+ else
+ *alarm_tm = *now;
+ return sa_ptr->clientreg;
+ } else {
+ return 0;
+ }
+}
+
+/**
+ * Get the time until the next alarm will fire.
+ *
+ * @param[out] delta Time until the next alarm.
+ *
+ * @return Zero if no alarms are scheduled; non-zero 'clientreg' value
+ * identifying the first alarm that will fire if one or more alarms are
+ * scheduled.
+ */
+int
+get_next_alarm_delay_time(struct timeval *delta)
+{
+ struct timeval t_now, alarm_tm;
+ int res;
+
+ netsnmp_get_monotonic_clock(&t_now);
+ res = netsnmp_get_next_alarm_time(&alarm_tm, &t_now);
+ if (res)
+ NETSNMP_TIMERSUB(&alarm_tm, &t_now, delta);
+ return res;
+}
+
+
+void
+set_an_alarm(void)
+{
+ struct timeval delta;
+ int nextalarm = get_next_alarm_delay_time(&delta);
+
+ /*
+ * We don't use signals if they asked us nicely not to. It's expected
+ * they'll check the next alarm time and do their own calling of
+ * run_alarms().
+ */
+
+ if (nextalarm && !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG)) {
+#ifndef WIN32
+# ifdef HAVE_SETITIMER
+ struct itimerval it;
+
+ it.it_value = delta;
+ timerclear(&it.it_interval);
+
+ signal(SIGALRM, alarm_handler);
+ setitimer(ITIMER_REAL, &it, NULL);
+ DEBUGMSGTL(("snmp_alarm", "schedule alarm %d in %ld.%03ld seconds\n",
+ nextalarm, (long) delta.tv_sec, (delta.tv_usec / 1000)));
+# else /* HAVE_SETITIMER */
+# ifdef SIGALRM
+ signal(SIGALRM, alarm_handler);
+ alarm(delta.tv_sec);
+ DEBUGMSGTL(("snmp_alarm",
+ "schedule alarm %d in roughly %ld seconds\n", nextalarm,
+ delta.tv_sec));
+# endif /* SIGALRM */
+# endif /* HAVE_SETITIMER */
+#endif /* WIN32 */
+
+ } else {
+ DEBUGMSGTL(("snmp_alarm", "no alarms found to schedule\n"));
+ }
+}
+
+
+/**
+ * This function registers function callbacks to occur at a specific time
+ * in the future.
+ *
+ * @param when is an unsigned integer specifying when the callback function
+ * will be called in seconds.
+ *
+ * @param flags is an unsigned integer that specifies how frequent the callback
+ * function is called in seconds. Should be SA_REPEAT or 0. If
+ * flags is set with SA_REPEAT, then the registered callback function
+ * will be called every SA_REPEAT seconds. If flags is 0 then the
+ * function will only be called once and then removed from the
+ * registered alarm list.
+ *
+ * @param thecallback is a pointer SNMPAlarmCallback which is the callback
+ * function being stored and registered.
+ *
+ * @param clientarg is a void pointer used by the callback function. This
+ * pointer is assigned to snmp_alarm->clientarg and passed into the
+ * callback function for the client's specific needs.
+ *
+ * @return Returns a unique unsigned integer(which is also passed as the first
+ * argument of each callback), which can then be used to remove the
+ * callback from the list at a later point in the future using the
+ * snmp_alarm_unregister() function. If memory could not be allocated
+ * for the snmp_alarm struct 0 is returned.
+ *
+ * @see snmp_alarm_unregister
+ * @see snmp_alarm_register_hr
+ * @see snmp_alarm_unregister_all
+ */
+unsigned int
+snmp_alarm_register(unsigned int when, unsigned int flags,
+ SNMPAlarmCallback * thecallback, void *clientarg)
+{
+ struct timeval t;
+
+ if (0 == when) {
+ t.tv_sec = 0;
+ t.tv_usec = 1;
+ } else {
+ t.tv_sec = when;
+ t.tv_usec = 0;
+ }
+
+ return snmp_alarm_register_hr(t, flags, thecallback, clientarg);
+}
+
+
+/**
+ * This function offers finer granularity as to when the callback
+ * function is called by making use of t->tv_usec value forming the
+ * "when" aspect of snmp_alarm_register().
+ *
+ * @param t is a timeval structure used to specify when the callback
+ * function(alarm) will be called. Adds the ability to specify
+ * microseconds. t.tv_sec and t.tv_usec are assigned
+ * to snmp_alarm->tv_sec and snmp_alarm->tv_usec respectively internally.
+ * The snmp_alarm_register function only assigns seconds(it's when
+ * argument).
+ *
+ * @param flags is an unsigned integer that specifies how frequent the callback
+ * function is called in seconds. Should be SA_REPEAT or NULL. If
+ * flags is set with SA_REPEAT, then the registered callback function
+ * will be called every SA_REPEAT seconds. If flags is NULL then the
+ * function will only be called once and then removed from the
+ * registered alarm list.
+ *
+ * @param cb is a pointer SNMPAlarmCallback which is the callback
+ * function being stored and registered.
+ *
+ * @param cd is a void pointer used by the callback function. This
+ * pointer is assigned to snmp_alarm->clientarg and passed into the
+ * callback function for the client's specific needs.
+ *
+ * @return Returns a unique unsigned integer(which is also passed as the first
+ * argument of each callback), which can then be used to remove the
+ * callback from the list at a later point in the future using the
+ * snmp_alarm_unregister() function. If memory could not be allocated
+ * for the snmp_alarm struct 0 is returned.
+ *
+ * @see snmp_alarm_register
+ * @see snmp_alarm_unregister
+ * @see snmp_alarm_unregister_all
+ */
+unsigned int
+snmp_alarm_register_hr(struct timeval t, unsigned int flags,
+ SNMPAlarmCallback * cb, void *cd)
+{
+ struct snmp_alarm **s = NULL;
+
+ for (s = &(thealarms); *s != NULL; s = &((*s)->next));
+
+ *s = SNMP_MALLOC_STRUCT(snmp_alarm);
+ if (*s == NULL) {
+ return 0;
+ }
+
+ (*s)->t = t;
+ (*s)->flags = flags;
+ (*s)->clientarg = cd;
+ (*s)->thecallback = cb;
+ (*s)->clientreg = regnum++;
+ (*s)->next = NULL;
+
+ sa_update_entry(*s);
+
+ DEBUGMSGTL(("snmp_alarm",
+ "registered alarm %d, t = %ld.%03ld, flags=0x%02x\n",
+ (*s)->clientreg, (long) (*s)->t.tv_sec, ((*s)->t.tv_usec / 1000),
+ (*s)->flags));
+
+ if (start_alarms) {
+ set_an_alarm();
+ }
+
+ return (*s)->clientreg;
+}
+
+/**
+ * This function resets an existing alarm.
+ *
+ * @param clientreg is a unique unsigned integer representing a registered
+ * alarm which the client wants to unregister.
+ *
+ * @return 0 on success, -1 if the alarm was not found
+ *
+ * @see snmp_alarm_register
+ * @see snmp_alarm_register_hr
+ * @see snmp_alarm_unregister
+ */
+int
+snmp_alarm_reset(unsigned int clientreg)
+{
+ struct snmp_alarm *a;
+ struct timeval t_now;
+ if ((a = sa_find_specific(clientreg)) != NULL) {
+ netsnmp_get_monotonic_clock(&t_now);
+ a->t_lastM.tv_sec = t_now.tv_sec;
+ a->t_lastM.tv_usec = t_now.tv_usec;
+ a->t_nextM.tv_sec = 0;
+ a->t_nextM.tv_usec = 0;
+ NETSNMP_TIMERADD(&t_now, &a->t, &a->t_nextM);
+ return 0;
+ }
+ DEBUGMSGTL(("snmp_alarm_reset", "alarm %d not found\n",
+ clientreg));
+ return -1;
+}
+/** @} */
diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c
new file mode 100644
index 0000000..33e6157
--- /dev/null
+++ b/snmplib/snmp_api.c
@@ -0,0 +1,7382 @@
+
+/* 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 1989, 1991, 1992 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 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 library The Net-SNMP library
+ * @{
+ */
+/*
+ * snmp_api.c - API for access to snmp.
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <stdio.h>
+#include <ctype.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 HAVE_SYS_PARAM_H
+#include <sys/param.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_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_IO_H
+#include <io.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_NET_IF_DL_H
+#ifndef dynix
+#include <net/if_dl.h>
+#else
+#include <sys/net/if_dl.h>
+#endif
+#endif
+#include <errno.h>
+
+#if HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#define SNMP_NEED_REQUEST_LIST
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp.h> /* for xdump & {build,parse}_var_op */
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_client.h>
+#include <net-snmp/library/parse.h>
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/int64.h>
+#include <net-snmp/library/snmpv3.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/large_fd_set.h>
+#ifdef NETSNMP_SECMOD_USM
+#include <net-snmp/library/snmpusm.h>
+#endif
+#ifdef NETSNMP_SECMOD_KSM
+#include <net-snmp/library/snmpksm.h>
+#endif
+#include <net-snmp/library/keytools.h>
+#include <net-snmp/library/lcd_time.h>
+#include <net-snmp/library/snmp_alarm.h>
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/snmp_service.h>
+#include <net-snmp/library/vacm.h>
+
+netsnmp_feature_child_of(statistics, libnetsnmp)
+netsnmp_feature_child_of(snmp_api, libnetsnmp)
+netsnmp_feature_child_of(oid_is_subtree, snmp_api)
+netsnmp_feature_child_of(snmpv3_probe_contextEngineID_rfc5343, snmp_api)
+
+#if defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL)
+extern void netsnmp_certs_init(void);
+extern void netsnmp_certs_shutdown(void);
+#endif
+
+static void _init_snmp(void);
+
+static int _snmp_store_needed = 0;
+
+#include "../agent/mibgroup/agentx/protocol.h"
+#include <net-snmp/library/transform_oids.h>
+#ifndef timercmp
+#define timercmp(tvp, uvp, cmp) \
+ /* CSTYLED */ \
+ ((tvp)->tv_sec cmp (uvp)->tv_sec || \
+ ((tvp)->tv_sec == (uvp)->tv_sec && \
+ /* CSTYLED */ \
+ (tvp)->tv_usec cmp (uvp)->tv_usec))
+#endif
+#ifndef timerclear
+#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
+#endif
+
+/*
+ * Globals.
+ */
+#define MAX_PACKET_LENGTH (0x7fffffff)
+#ifndef NETSNMP_STREAM_QUEUE_LEN
+#define NETSNMP_STREAM_QUEUE_LEN 5
+#endif
+
+#ifndef BSD4_3
+#define BSD4_2
+#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
+
+static oid default_enterprise[] = { 1, 3, 6, 1, 4, 1, 3, 1, 1 };
+/*
+ * enterprises.cmu.systems.cmuSNMP
+ */
+
+#define DEFAULT_COMMUNITY "public"
+#define DEFAULT_RETRIES 5
+#define DEFAULT_TIMEOUT ONE_SEC
+#define DEFAULT_REMPORT SNMP_PORT
+#define DEFAULT_ENTERPRISE default_enterprise
+#define DEFAULT_TIME 0
+
+/*
+ * don't set higher than 0x7fffffff, and I doubt it should be that high
+ * * = 4 gig snmp messages max
+ */
+#define MAXIMUM_PACKET_SIZE 0x7fffffff
+
+/*
+ * Internal information about the state of the snmp session.
+ */
+struct snmp_internal_session {
+ netsnmp_request_list *requests; /* Info about outstanding requests */
+ netsnmp_request_list *requestsEnd; /* ptr to end of list */
+ int (*hook_pre) (netsnmp_session *, netsnmp_transport *,
+ void *, int);
+ int (*hook_parse) (netsnmp_session *, netsnmp_pdu *,
+ u_char *, size_t);
+ int (*hook_post) (netsnmp_session *, netsnmp_pdu *, int);
+ int (*hook_build) (netsnmp_session *, netsnmp_pdu *,
+ u_char *, size_t *);
+ int (*hook_realloc_build) (netsnmp_session *,
+ netsnmp_pdu *, u_char **,
+ size_t *, size_t *);
+ int (*check_packet) (u_char *, size_t);
+ netsnmp_pdu *(*hook_create_pdu) (netsnmp_transport *,
+ void *, size_t);
+
+ u_char *packet;
+ size_t packet_len, packet_size;
+};
+
+static const char *api_errors[-SNMPERR_MAX + 1] = {
+ "No error", /* SNMPERR_SUCCESS */
+ "Generic error", /* SNMPERR_GENERR */
+ "Invalid local port", /* SNMPERR_BAD_LOCPORT */
+ "Unknown host", /* SNMPERR_BAD_ADDRESS */
+ "Unknown session", /* SNMPERR_BAD_SESSION */
+ "Too long", /* SNMPERR_TOO_LONG */
+ "No socket", /* SNMPERR_NO_SOCKET */
+ "Cannot send V2 PDU on V1 session", /* SNMPERR_V2_IN_V1 */
+ "Cannot send V1 PDU on V2 session", /* SNMPERR_V1_IN_V2 */
+ "Bad value for non-repeaters", /* SNMPERR_BAD_REPEATERS */
+ "Bad value for max-repetitions", /* SNMPERR_BAD_REPETITIONS */
+ "Error building ASN.1 representation", /* SNMPERR_BAD_ASN1_BUILD */
+ "Failure in sendto", /* SNMPERR_BAD_SENDTO */
+ "Bad parse of ASN.1 type", /* SNMPERR_BAD_PARSE */
+ "Bad version specified", /* SNMPERR_BAD_VERSION */
+ "Bad source party specified", /* SNMPERR_BAD_SRC_PARTY */
+ "Bad destination party specified", /* SNMPERR_BAD_DST_PARTY */
+ "Bad context specified", /* SNMPERR_BAD_CONTEXT */
+ "Bad community specified", /* SNMPERR_BAD_COMMUNITY */
+ "Cannot send noAuth/Priv", /* SNMPERR_NOAUTH_DESPRIV */
+ "Bad ACL definition", /* SNMPERR_BAD_ACL */
+ "Bad Party definition", /* SNMPERR_BAD_PARTY */
+ "Session abort failure", /* SNMPERR_ABORT */
+ "Unknown PDU type", /* SNMPERR_UNKNOWN_PDU */
+ "Timeout", /* SNMPERR_TIMEOUT */
+ "Failure in recvfrom", /* SNMPERR_BAD_RECVFROM */
+ "Unable to determine contextEngineID", /* SNMPERR_BAD_ENG_ID */
+ "No securityName specified", /* SNMPERR_BAD_SEC_NAME */
+ "Unable to determine securityLevel", /* SNMPERR_BAD_SEC_LEVEL */
+ "ASN.1 parse error in message", /* SNMPERR_ASN_PARSE_ERR */
+ "Unknown security model in message", /* SNMPERR_UNKNOWN_SEC_MODEL */
+ "Invalid message (e.g. msgFlags)", /* SNMPERR_INVALID_MSG */
+ "Unknown engine ID", /* SNMPERR_UNKNOWN_ENG_ID */
+ "Unknown user name", /* SNMPERR_UNKNOWN_USER_NAME */
+ "Unsupported security level", /* SNMPERR_UNSUPPORTED_SEC_LEVEL */
+ "Authentication failure (incorrect password, community or key)", /* SNMPERR_AUTHENTICATION_FAILURE */
+ "Not in time window", /* SNMPERR_NOT_IN_TIME_WINDOW */
+ "Decryption error", /* SNMPERR_DECRYPTION_ERR */
+ "SCAPI general failure", /* SNMPERR_SC_GENERAL_FAILURE */
+ "SCAPI sub-system not configured", /* SNMPERR_SC_NOT_CONFIGURED */
+ "Key tools not available", /* SNMPERR_KT_NOT_AVAILABLE */
+ "Unknown Report message", /* SNMPERR_UNKNOWN_REPORT */
+ "USM generic error", /* SNMPERR_USM_GENERICERROR */
+ "USM unknown security name (no such user exists)", /* SNMPERR_USM_UNKNOWNSECURITYNAME */
+ "USM unsupported security level (this user has not been configured for that level of security)", /* SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL */
+ "USM encryption error", /* SNMPERR_USM_ENCRYPTIONERROR */
+ "USM authentication failure (incorrect password or key)", /* SNMPERR_USM_AUTHENTICATIONFAILURE */
+ "USM parse error", /* SNMPERR_USM_PARSEERROR */
+ "USM unknown engineID", /* SNMPERR_USM_UNKNOWNENGINEID */
+ "USM not in time window", /* SNMPERR_USM_NOTINTIMEWINDOW */
+ "USM decryption error", /* SNMPERR_USM_DECRYPTIONERROR */
+ "MIB not initialized", /* SNMPERR_NOMIB */
+ "Value out of range", /* SNMPERR_RANGE */
+ "Sub-id out of range", /* SNMPERR_MAX_SUBID */
+ "Bad sub-id in object identifier", /* SNMPERR_BAD_SUBID */
+ "Object identifier too long", /* SNMPERR_LONG_OID */
+ "Bad value name", /* SNMPERR_BAD_NAME */
+ "Bad value notation", /* SNMPERR_VALUE */
+ "Unknown Object Identifier", /* SNMPERR_UNKNOWN_OBJID */
+ "No PDU in snmp_send", /* SNMPERR_NULL_PDU */
+ "Missing variables in PDU", /* SNMPERR_NO_VARS */
+ "Bad variable type", /* SNMPERR_VAR_TYPE */
+ "Out of memory (malloc failure)", /* SNMPERR_MALLOC */
+ "Kerberos related error", /* SNMPERR_KRB5 */
+ "Protocol error", /* SNMPERR_PROTOCOL */
+ "OID not increasing", /* SNMPERR_OID_NONINCREASING */
+ "Context probe", /* SNMPERR_JUST_A_CONTEXT_PROBE */
+ "Configuration data found but the transport can't be configured", /* SNMPERR_TRANSPORT_NO_CONFIG */
+ "Transport configuration failed", /* SNMPERR_TRANSPORT_CONFIG_ERROR */
+};
+
+static const char *secLevelName[] = {
+ "BAD_SEC_LEVEL",
+ "noAuthNoPriv",
+ "authNoPriv",
+ "authPriv"
+};
+
+/*
+ * Multiple threads may changes these variables.
+ * Suggest using the Single API, which does not use Sessions.
+ *
+ * Reqid may need to be protected. Time will tell...
+ *
+ */
+/*
+ * MTCRITICAL_RESOURCE
+ */
+/*
+ * use token in comments to individually protect these resources
+ */
+struct session_list *Sessions = NULL; /* MT_LIB_SESSION */
+static long Reqid = 0; /* MT_LIB_REQUESTID */
+static long Msgid = 0; /* MT_LIB_MESSAGEID */
+static long Sessid = 0; /* MT_LIB_SESSIONID */
+static long Transid = 0; /* MT_LIB_TRANSID */
+int snmp_errno = 0;
+/*
+ * END MTCRITICAL_RESOURCE
+ */
+
+/*
+ * global error detail storage
+ */
+static char snmp_detail[192];
+static int snmp_detail_f = 0;
+
+/*
+ * Prototypes.
+ */
+int snmp_build(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, netsnmp_session * pss,
+ netsnmp_pdu *pdu);
+static int snmp_parse(void *, netsnmp_session *, netsnmp_pdu *,
+ u_char *, size_t);
+
+static void snmpv3_calc_msg_flags(int, int, u_char *);
+static int snmpv3_verify_msg(netsnmp_request_list *, netsnmp_pdu *);
+static int snmpv3_build(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, netsnmp_session * session,
+ netsnmp_pdu *pdu);
+static int snmp_parse_version(u_char *, size_t);
+static int snmp_resend_request(struct session_list *slp,
+ netsnmp_request_list *rp,
+ int incr_retries);
+static void register_default_handlers(void);
+static struct session_list *snmp_sess_copy(netsnmp_session * pss);
+int snmp_get_errno(void);
+NETSNMP_IMPORT
+void snmp_synch_reset(netsnmp_session * notused);
+NETSNMP_IMPORT
+void snmp_synch_setup(netsnmp_session * notused);
+
+#ifndef HAVE_STRERROR
+const char *
+strerror(int err)
+{
+ extern const char *sys_errlist[];
+ extern int sys_nerr;
+
+ if (err < 0 || err >= sys_nerr)
+ return "Unknown error";
+ return sys_errlist[err];
+}
+#endif
+
+const char *
+snmp_pdu_type(int type)
+{
+ static char unknown[20];
+ switch(type) {
+ case SNMP_MSG_GET:
+ return "GET";
+ case SNMP_MSG_GETNEXT:
+ return "GETNEXT";
+ case SNMP_MSG_GETBULK:
+ return "GETBULK";
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_SET:
+ return "SET";
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ case SNMP_MSG_RESPONSE:
+ return "RESPONSE";
+ case SNMP_MSG_INFORM:
+ return "INFORM";
+ case SNMP_MSG_TRAP2:
+ return "TRAP2";
+ case SNMP_MSG_REPORT:
+ return "REPORT";
+ default:
+ snprintf(unknown, sizeof(unknown), "?0x%2X?", type);
+ return unknown;
+ }
+}
+
+#define DEBUGPRINTPDUTYPE(token, type) \
+ DEBUGDUMPSECTION(token, snmp_pdu_type(type))
+
+long
+snmp_get_next_reqid(void)
+{
+ long retVal;
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_REQUESTID);
+ retVal = 1 + Reqid; /*MTCRITICAL_RESOURCE */
+ if (!retVal)
+ retVal = 2;
+ Reqid = retVal;
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_16BIT_IDS))
+ retVal &= 0x7fff; /* mask to 15 bits */
+ else
+ retVal &= 0x7fffffff; /* mask to 31 bits */
+
+ if (!retVal) {
+ Reqid = retVal = 2;
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_REQUESTID);
+ return retVal;
+}
+
+long
+snmp_get_next_msgid(void)
+{
+ long retVal;
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_MESSAGEID);
+ retVal = 1 + Msgid; /*MTCRITICAL_RESOURCE */
+ if (!retVal)
+ retVal = 2;
+ Msgid = retVal;
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_16BIT_IDS))
+ retVal &= 0x7fff; /* mask to 15 bits */
+ else
+ retVal &= 0x7fffffff; /* mask to 31 bits */
+
+ if (!retVal) {
+ Msgid = retVal = 2;
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_MESSAGEID);
+ return retVal;
+}
+
+long
+snmp_get_next_sessid(void)
+{
+ long retVal;
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSIONID);
+ retVal = 1 + Sessid; /*MTCRITICAL_RESOURCE */
+ if (!retVal)
+ retVal = 2;
+ Sessid = retVal;
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_16BIT_IDS))
+ retVal &= 0x7fff; /* mask to 15 bits */
+ else
+ retVal &= 0x7fffffff; /* mask to 31 bits */
+
+ if (!retVal) {
+ Sessid = retVal = 2;
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSIONID);
+ return retVal;
+}
+
+long
+snmp_get_next_transid(void)
+{
+ long retVal;
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_TRANSID);
+ retVal = 1 + Transid; /*MTCRITICAL_RESOURCE */
+ if (!retVal)
+ retVal = 2;
+ Transid = retVal;
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_16BIT_IDS))
+ retVal &= 0x7fff; /* mask to 15 bits */
+ else
+ retVal &= 0x7fffffff; /* mask to 31 bits */
+
+ if (!retVal) {
+ Transid = retVal = 2;
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_TRANSID);
+ return retVal;
+}
+
+void
+snmp_perror(const char *prog_string)
+{
+ const char *str;
+ int xerr;
+ xerr = snmp_errno; /*MTCRITICAL_RESOURCE */
+ str = snmp_api_errstring(xerr);
+ snmp_log(LOG_ERR, "%s: %s\n", prog_string, str);
+}
+
+void
+snmp_set_detail(const char *detail_string)
+{
+ if (detail_string != NULL) {
+ strlcpy((char *) snmp_detail, detail_string, sizeof(snmp_detail));
+ snmp_detail_f = 1;
+ }
+}
+
+/*
+ * returns pointer to static data
+ */
+/*
+ * results not guaranteed in multi-threaded use
+ */
+const char *
+snmp_api_errstring(int snmp_errnumber)
+{
+ const char *msg = "";
+ static char msg_buf[SPRINT_MAX_LEN];
+
+ if (snmp_errnumber >= SNMPERR_MAX && snmp_errnumber <= SNMPERR_GENERR) {
+ msg = api_errors[-snmp_errnumber];
+ } else if (snmp_errnumber != SNMPERR_SUCCESS) {
+ msg = NULL;
+ }
+ if (!msg) {
+ snprintf(msg_buf, sizeof(msg_buf), "Unknown error: %d", snmp_errnumber);
+ msg_buf[sizeof(msg_buf)-1] = '\0';
+ } else if (snmp_detail_f) {
+ snprintf(msg_buf, sizeof(msg_buf), "%s (%s)", msg, snmp_detail);
+ msg_buf[sizeof(msg_buf)-1] = '\0';
+ snmp_detail_f = 0;
+ } else {
+ strlcpy(msg_buf, msg, sizeof(msg_buf));
+ }
+
+ return (msg_buf);
+}
+
+/*
+ * snmp_error - return error data
+ * Inputs : address of errno, address of snmp_errno, address of string
+ * Caller must free the string returned after use.
+ */
+void
+snmp_error(netsnmp_session * psess,
+ int *p_errno, int *p_snmp_errno, char **p_str)
+{
+ char buf[SPRINT_MAX_LEN];
+ int snmp_errnumber;
+
+ if (p_errno)
+ *p_errno = psess->s_errno;
+ if (p_snmp_errno)
+ *p_snmp_errno = psess->s_snmp_errno;
+ if (p_str == NULL)
+ return;
+
+ strcpy(buf, "");
+ snmp_errnumber = psess->s_snmp_errno;
+ if (snmp_errnumber >= SNMPERR_MAX && snmp_errnumber <= SNMPERR_GENERR) {
+ if (snmp_detail_f) {
+ snprintf(buf, sizeof(buf), "%s (%s)", api_errors[-snmp_errnumber],
+ snmp_detail);
+ buf[sizeof(buf)-1] = '\0';
+ snmp_detail_f = 0;
+ }
+ else
+ strlcpy(buf, api_errors[-snmp_errnumber], sizeof(buf));
+ } else {
+ if (snmp_errnumber) {
+ snprintf(buf, sizeof(buf), "Unknown Error %d", snmp_errnumber);
+ buf[sizeof(buf)-1] = '\0';
+ }
+ }
+
+ /*
+ * append a useful system errno interpretation.
+ */
+ if (psess->s_errno) {
+ const char* error = strerror(psess->s_errno);
+ if(error == NULL)
+ error = "Unknown Error";
+ snprintf (&buf[strlen(buf)], sizeof(buf)-strlen(buf),
+ " (%s)", error);
+ }
+ buf[sizeof(buf)-1] = '\0';
+ *p_str = strdup(buf);
+}
+
+/*
+ * snmp_sess_error - same as snmp_error for single session API use.
+ */
+void
+snmp_sess_error(void *sessp, int *p_errno, int *p_snmp_errno, char **p_str)
+{
+ struct session_list *slp = (struct session_list *) sessp;
+
+ if ((slp) && (slp->session))
+ snmp_error(slp->session, p_errno, p_snmp_errno, p_str);
+}
+
+/*
+ * netsnmp_sess_log_error(): print a error stored in a session pointer
+ */
+void
+netsnmp_sess_log_error(int priority,
+ const char *prog_string, netsnmp_session * ss)
+{
+ char *err;
+ snmp_error(ss, NULL, NULL, &err);
+ snmp_log(priority, "%s: %s\n", prog_string, err);
+ SNMP_FREE(err);
+}
+
+/*
+ * snmp_sess_perror(): print a error stored in a session pointer
+ */
+void
+snmp_sess_perror(const char *prog_string, netsnmp_session * ss)
+{
+ netsnmp_sess_log_error(LOG_ERR, prog_string, ss);
+}
+
+
+
+/*
+ * Primordial SNMP library initialization.
+ * Initializes mutex locks.
+ * Invokes minimum required initialization for displaying MIB objects.
+ * Gets initial request ID for all transactions,
+ * and finds which port SNMP over UDP uses.
+ * SNMP over AppleTalk is not currently supported.
+ *
+ * Warning: no debug messages here.
+ */
+static char _init_snmp_init_done = 0;
+static void
+_init_snmp(void)
+{
+
+ struct timeval tv;
+ long tmpReqid, tmpMsgid;
+
+ if (_init_snmp_init_done)
+ return;
+ _init_snmp_init_done = 1;
+ Reqid = 1;
+
+ snmp_res_init(); /* initialize the mt locking structures */
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ netsnmp_init_mib_internals();
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ netsnmp_tdomain_init();
+
+ gettimeofday(&tv, (struct timezone *) 0);
+ /*
+ * Now = tv;
+ */
+
+ /*
+ * get pseudo-random values for request ID and message ID
+ */
+#ifdef SVR4
+ srand48(tv.tv_sec ^ tv.tv_usec);
+ tmpReqid = lrand48();
+ tmpMsgid = lrand48();
+#else
+ srandom((unsigned)(tv.tv_sec ^ tv.tv_usec));
+ tmpReqid = random();
+ tmpMsgid = random();
+#endif
+
+ /*
+ * don't allow zero value to repeat init
+ */
+ if (tmpReqid == 0)
+ tmpReqid = 1;
+ if (tmpMsgid == 0)
+ tmpMsgid = 1;
+ Reqid = tmpReqid;
+ Msgid = tmpMsgid;
+
+ netsnmp_register_default_domain("snmp", "udp udp6");
+ netsnmp_register_default_domain("snmptrap", "udp udp6");
+
+ netsnmp_register_default_target("snmp", "udp", ":161");
+ netsnmp_register_default_target("snmp", "tcp", ":161");
+ netsnmp_register_default_target("snmp", "udp6", ":161");
+ netsnmp_register_default_target("snmp", "tcp6", ":161");
+ netsnmp_register_default_target("snmp", "dtlsudp", ":10161");
+ netsnmp_register_default_target("snmp", "tlstcp", ":10161");
+ netsnmp_register_default_target("snmp", "ipx", "/36879");
+
+ netsnmp_register_default_target("snmptrap", "udp", ":162");
+ netsnmp_register_default_target("snmptrap", "tcp", ":162");
+ netsnmp_register_default_target("snmptrap", "udp6", ":162");
+ netsnmp_register_default_target("snmptrap", "tcp6", ":162");
+ netsnmp_register_default_target("snmptrap", "dtlsudp", ":10162");
+ netsnmp_register_default_target("snmptrap", "tlstcp", ":10162");
+ netsnmp_register_default_target("snmptrap", "ipx", "/36880");
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH, 16);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_RETRIES,
+ DEFAULT_RETRIES);
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_REVERSE_ENCODE,
+ NETSNMP_DEFAULT_ASNENCODING_DIRECTION);
+#endif
+}
+
+/*
+ * Initializes the session structure.
+ * May perform one time minimal library initialization.
+ * No MIB file processing is done via this call.
+ */
+void
+snmp_sess_init(netsnmp_session * session)
+{
+ _init_snmp();
+
+ /*
+ * initialize session to default values
+ */
+
+ memset(session, 0, sizeof(netsnmp_session));
+ session->remote_port = SNMP_DEFAULT_REMPORT;
+ session->timeout = SNMP_DEFAULT_TIMEOUT;
+ session->retries = SNMP_DEFAULT_RETRIES;
+ session->version = SNMP_DEFAULT_VERSION;
+ session->securityModel = SNMP_DEFAULT_SECMODEL;
+ session->rcvMsgMaxSize = SNMP_MAX_MSG_SIZE;
+ session->flags |= SNMP_FLAGS_DONT_PROBE;
+}
+
+
+static void
+register_default_handlers(void)
+{
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp", "dumpPacket",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DUMP_PACKET);
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp", "reverseEncodeBER",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_REVERSE_ENCODE);
+ netsnmp_ds_register_config(ASN_INTEGER, "snmp", "defaultPort",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DEFAULT_PORT);
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defCommunity",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_COMMUNITY);
+#endif
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "noTokenWarnings",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NO_TOKEN_WARNINGS);
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp", "noRangeCheck",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_CHECK_RANGE);
+ netsnmp_ds_register_premib(ASN_OCTET_STR, "snmp", "persistentDir",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PERSISTENT_DIR);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "tempFilePattern",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_TEMP_FILE_PATTERN);
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp", "noDisplayHint",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NO_DISPLAY_HINT);
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp", "16bitIDs",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_16BIT_IDS);
+ netsnmp_ds_register_premib(ASN_OCTET_STR, "snmp", "clientaddr",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_CLIENT_ADDR);
+ netsnmp_ds_register_config(ASN_INTEGER, "snmp", "serverSendBuf",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SERVERSENDBUF);
+ netsnmp_ds_register_config(ASN_INTEGER, "snmp", "serverRecvBuf",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SERVERRECVBUF);
+ netsnmp_ds_register_config(ASN_INTEGER, "snmp", "clientSendBuf",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_CLIENTSENDBUF);
+ netsnmp_ds_register_config(ASN_INTEGER, "snmp", "clientRecvBuf",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_CLIENTRECVBUF);
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp", "noPersistentLoad",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD);
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp", "noPersistentSave",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE);
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp",
+ "noContextEngineIDDiscovery",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_NO_DISCOVERY);
+ netsnmp_ds_register_config(ASN_INTEGER, "snmp", "timeout",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_TIMEOUT);
+ netsnmp_ds_register_config(ASN_INTEGER, "snmp", "retries",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_RETRIES);
+
+ netsnmp_register_service_handlers();
+}
+
+static int init_snmp_init_done = 0; /* To prevent double init's. */
+/**
+ * Calls the functions to do config file loading and mib module parsing
+ * in the correct order.
+ *
+ * @param type label for the config file "type"
+ *
+ * @return void
+ *
+ * @see init_agent
+ */
+void
+init_snmp(const char *type)
+{
+ if (init_snmp_init_done) {
+ return;
+ }
+
+ init_snmp_init_done = 1;
+
+ /*
+ * make the type available everywhere else
+ */
+ if (type && !netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE)) {
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE, type);
+ }
+
+ _init_snmp();
+
+ /*
+ * set our current locale properly to initialize isprint() type functions
+ */
+#ifdef HAVE_SETLOCALE
+ setlocale(LC_CTYPE, "");
+#endif
+
+ snmp_debug_init(); /* should be done first, to turn on debugging ASAP */
+ netsnmp_container_init_list();
+ init_callbacks();
+ init_snmp_logging();
+ snmp_init_statistics();
+ register_mib_handlers();
+ register_default_handlers();
+ init_snmp_transport();
+ init_snmpv3(type);
+ init_snmp_alarm();
+ init_snmp_enum(type);
+ init_vacm();
+#if defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL)
+ netsnmp_certs_init();
+#endif
+#ifdef DNSSEC_LOCAL_VALIDATION
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp", "dnssecWarnOnly",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DNSSEC_WARN_ONLY);
+#endif
+
+ read_premib_configs();
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ netsnmp_init_mib();
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+ read_configs();
+
+} /* end init_snmp() */
+
+/**
+ * set a flag indicating that the persistent store needs to be saved.
+ */
+void
+snmp_store_needed(const char *type)
+{
+ DEBUGMSGTL(("snmp_store", "setting needed flag...\n"));
+ _snmp_store_needed = 1;
+}
+
+void
+snmp_store_if_needed(void)
+{
+ if (0 == _snmp_store_needed)
+ return;
+
+ DEBUGMSGTL(("snmp_store", "store needed...\n"));
+ snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE));
+ _snmp_store_needed = 0;
+}
+
+void
+snmp_store(const char *type)
+{
+ DEBUGMSGTL(("snmp_store", "storing stuff...\n"));
+ snmp_save_persistent(type);
+ snmp_call_callbacks(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA, NULL);
+ snmp_clean_persistent(type);
+}
+
+
+/**
+ * Shuts down the application, saving any needed persistent storage,
+ * and appropriate clean up.
+ *
+ * @param type Label for the config file "type" used
+ *
+ * @return void
+ */
+void
+snmp_shutdown(const char *type)
+{
+ snmp_store(type);
+ snmp_call_callbacks(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_SHUTDOWN, NULL);
+ shutdown_snmp_logging();
+ snmp_alarm_unregister_all();
+ snmp_close_sessions();
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ shutdown_mib();
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+#if defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL)
+ netsnmp_certs_shutdown();
+#endif
+ unregister_all_config_handlers();
+ netsnmp_container_free_list();
+ clear_sec_mod();
+ clear_snmp_enum();
+ netsnmp_clear_tdomain_list();
+ clear_callback();
+ netsnmp_ds_shutdown();
+ netsnmp_clear_default_target();
+ netsnmp_clear_default_domain();
+ shutdown_secmod();
+
+ init_snmp_init_done = 0;
+ _init_snmp_init_done = 0;
+}
+
+
+/*
+ * Sets up the session with the snmp_session information provided by the user.
+ * Then opens and binds the necessary low-level transport. A handle to the
+ * created session is returned (this is NOT the same as the pointer passed to
+ * snmp_open()). On any error, NULL is returned and snmp_errno is set to the
+ * appropriate error code.
+ */
+netsnmp_session *
+snmp_open(netsnmp_session *session)
+{
+ struct session_list *slp;
+ slp = (struct session_list *) snmp_sess_open(session);
+ if (!slp) {
+ return NULL;
+ }
+
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ slp->next = Sessions;
+ Sessions = slp;
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+
+ return (slp->session);
+}
+
+/*
+ * extended open
+ */
+netsnmp_feature_child_of(snmp_open_ex, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_SNMP_OPEN_EX
+netsnmp_session *
+snmp_open_ex(netsnmp_session *session,
+ int (*fpre_parse) (netsnmp_session *, netsnmp_transport *,
+ void *, int),
+ int (*fparse) (netsnmp_session *, netsnmp_pdu *, u_char *,
+ size_t),
+ int (*fpost_parse) (netsnmp_session *, netsnmp_pdu *, int),
+
+ int (*fbuild) (netsnmp_session *, netsnmp_pdu *, u_char *,
+ size_t *),
+ int (*frbuild) (netsnmp_session *, netsnmp_pdu *,
+ u_char **, size_t *, size_t *),
+ int (*fcheck) (u_char *, size_t)
+ )
+{
+ struct session_list *slp;
+ slp = (struct session_list *) snmp_sess_open(session);
+ if (!slp) {
+ return NULL;
+ }
+ slp->internal->hook_pre = fpre_parse;
+ slp->internal->hook_parse = fparse;
+ slp->internal->hook_post = fpost_parse;
+ slp->internal->hook_build = fbuild;
+ slp->internal->hook_realloc_build = frbuild;
+ slp->internal->check_packet = fcheck;
+
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ slp->next = Sessions;
+ Sessions = slp;
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+
+ return (slp->session);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMP_OPEN_EX */
+
+static struct session_list *
+_sess_copy(netsnmp_session * in_session)
+{
+ struct session_list *slp;
+ struct snmp_internal_session *isp;
+ netsnmp_session *session;
+ struct snmp_secmod_def *sptr;
+ char *cp;
+ u_char *ucp;
+
+ in_session->s_snmp_errno = 0;
+ in_session->s_errno = 0;
+
+ /*
+ * Copy session structure and link into list
+ */
+ slp = (struct session_list *) calloc(1, sizeof(struct session_list));
+ if (slp == NULL) {
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return (NULL);
+ }
+
+ slp->transport = NULL;
+
+ isp = (struct snmp_internal_session *)calloc(1, sizeof(struct snmp_internal_session));
+
+ if (isp == NULL) {
+ snmp_sess_close(slp);
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return (NULL);
+ }
+
+ slp->internal = isp;
+ slp->session = (netsnmp_session *)malloc(sizeof(netsnmp_session));
+ if (slp->session == NULL) {
+ snmp_sess_close(slp);
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return (NULL);
+ }
+ memmove(slp->session, in_session, sizeof(netsnmp_session));
+ session = slp->session;
+
+ /*
+ * zero out pointers so if we have to free the session we wont free mem
+ * owned by in_session
+ */
+ session->localname = NULL;
+ session->peername = NULL;
+ session->community = NULL;
+ session->contextEngineID = NULL;
+ session->contextName = NULL;
+ session->securityEngineID = NULL;
+ session->securityName = NULL;
+ session->securityAuthProto = NULL;
+ session->securityPrivProto = NULL;
+ /*
+ * session now points to the new structure that still contains pointers to
+ * data allocated elsewhere. Some of this data is copied to space malloc'd
+ * here, and the pointer replaced with the new one.
+ */
+
+ if (in_session->peername != NULL) {
+ session->peername = (char *)malloc(strlen(in_session->peername) + 1);
+ if (session->peername == NULL) {
+ snmp_sess_close(slp);
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return (NULL);
+ }
+ strcpy(session->peername, in_session->peername);
+ }
+
+ /*
+ * Fill in defaults if necessary
+ */
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ if (in_session->community_len != SNMP_DEFAULT_COMMUNITY_LEN) {
+ ucp = (u_char *) malloc(in_session->community_len);
+ if (ucp != NULL)
+ memmove(ucp, in_session->community, in_session->community_len);
+ } else {
+ if ((cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_COMMUNITY)) != NULL) {
+ session->community_len = strlen(cp);
+ ucp = (u_char *) malloc(session->community_len);
+ if (ucp)
+ memmove(ucp, cp, session->community_len);
+ } else {
+#ifdef NETSNMP_NO_ZEROLENGTH_COMMUNITY
+ session->community_len = strlen(DEFAULT_COMMUNITY);
+ ucp = (u_char *) malloc(session->community_len);
+ if (ucp)
+ memmove(ucp, DEFAULT_COMMUNITY, session->community_len);
+#else
+ ucp = (u_char *) strdup("");
+#endif
+ }
+ }
+
+ if (ucp == NULL) {
+ snmp_sess_close(slp);
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return (NULL);
+ }
+ session->community = ucp; /* replace pointer with pointer to new data */
+#endif
+
+ if (session->securityLevel <= 0) {
+ session->securityLevel =
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SECLEVEL);
+ }
+
+ if (in_session->securityEngineIDLen > 0) {
+ ucp = (u_char *) malloc(in_session->securityEngineIDLen);
+ if (ucp == NULL) {
+ snmp_sess_close(slp);
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return (NULL);
+ }
+ memmove(ucp, in_session->securityEngineID,
+ in_session->securityEngineIDLen);
+ session->securityEngineID = ucp;
+
+ }
+
+ if (in_session->contextEngineIDLen > 0) {
+ ucp = (u_char *) malloc(in_session->contextEngineIDLen);
+ if (ucp == NULL) {
+ snmp_sess_close(slp);
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return (NULL);
+ }
+ memmove(ucp, in_session->contextEngineID,
+ in_session->contextEngineIDLen);
+ session->contextEngineID = ucp;
+ } else if (in_session->securityEngineIDLen > 0) {
+ /*
+ * default contextEngineID to securityEngineIDLen if defined
+ */
+ ucp = (u_char *) malloc(in_session->securityEngineIDLen);
+ if (ucp == NULL) {
+ snmp_sess_close(slp);
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return (NULL);
+ }
+ memmove(ucp, in_session->securityEngineID,
+ in_session->securityEngineIDLen);
+ session->contextEngineID = ucp;
+ session->contextEngineIDLen = in_session->securityEngineIDLen;
+ }
+
+ if (in_session->contextName) {
+ session->contextName = strdup(in_session->contextName);
+ if (session->contextName == NULL) {
+ snmp_sess_close(slp);
+ return (NULL);
+ }
+ session->contextNameLen = in_session->contextNameLen;
+ } else {
+ if ((cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CONTEXT)) != NULL)
+ cp = strdup(cp);
+ else
+ cp = strdup(SNMP_DEFAULT_CONTEXT);
+ if (cp == NULL) {
+ snmp_sess_close(slp);
+ return (NULL);
+ }
+ session->contextName = cp;
+ session->contextNameLen = strlen(cp);
+ }
+
+ if (in_session->securityName) {
+ session->securityName = strdup(in_session->securityName);
+ if (session->securityName == NULL) {
+ snmp_sess_close(slp);
+ return (NULL);
+ }
+ } else if ((cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SECNAME)) != NULL) {
+ cp = strdup(cp);
+ if (cp == NULL) {
+ snmp_sess_close(slp);
+ return (NULL);
+ }
+ session->securityName = cp;
+ session->securityNameLen = strlen(cp);
+ }
+
+ if (session->retries == SNMP_DEFAULT_RETRIES) {
+ int retry = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_RETRIES);
+ if (retry < 0)
+ session->retries = DEFAULT_RETRIES;
+ else
+ session->retries = retry;
+ }
+ if (session->timeout == SNMP_DEFAULT_TIMEOUT) {
+ int timeout = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TIMEOUT);
+ if (timeout <= 0)
+ session->timeout = DEFAULT_TIMEOUT;
+ else
+ session->timeout = timeout * ONE_SEC;
+ }
+ session->sessid = snmp_get_next_sessid();
+
+ snmp_call_callbacks(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_SESSION_INIT,
+ session);
+
+ if ((sptr = find_sec_mod(session->securityModel)) != NULL) {
+ /*
+ * security module specific copying
+ */
+ if (sptr->session_setup) {
+ int ret = (*sptr->session_setup) (in_session, session);
+ if (ret != SNMPERR_SUCCESS) {
+ snmp_sess_close(slp);
+ return NULL;
+ }
+ }
+
+ /*
+ * security module specific opening
+ */
+ if (sptr->session_open) {
+ int ret = (*sptr->session_open) (session);
+ if (ret != SNMPERR_SUCCESS) {
+ snmp_sess_close(slp);
+ return NULL;
+ }
+ }
+ }
+
+ /* Anything below this point should only be done if the transport
+ had no say in the matter */
+ if (session->securityLevel == 0)
+ session->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
+
+ return (slp);
+}
+
+static struct session_list *
+snmp_sess_copy(netsnmp_session * pss)
+{
+ struct session_list *psl;
+ psl = _sess_copy(pss);
+ if (!psl) {
+ if (!pss->s_snmp_errno) {
+ pss->s_snmp_errno = SNMPERR_GENERR;
+ }
+ SET_SNMP_ERROR(pss->s_snmp_errno);
+ }
+ return psl;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMPV3_PROBE_CONTEXTENGINEID_RFC5343
+/**
+ * probe for engineID using RFC 5343 probing mechanisms
+ *
+ * Designed to be a callback for within a security model's probe_engineid hook.
+ * Since it's likely multiple security models won't have engineIDs to
+ * probe for then this function is a callback likely to be used by
+ * multiple future security models. E.G. both SSH and DTLS.
+ */
+int
+snmpv3_probe_contextEngineID_rfc5343(void *slp, netsnmp_session *session) {
+ netsnmp_pdu *pdu = NULL, *response = NULL;
+ static oid snmpEngineIDoid[] = { 1,3,6,1,6,3,10,2,1,1,0};
+ static size_t snmpEngineIDoid_len = 11;
+
+ static char probeEngineID[] = { (char)0x80, 0, 0, 0, 6 };
+ static size_t probeEngineID_len = sizeof(probeEngineID);
+
+ int status;
+
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+ if (!pdu)
+ return SNMP_ERR_GENERR;
+ pdu->version = SNMP_VERSION_3;
+ /* don't require a securityName */
+ if (session->securityName) {
+ pdu->securityName = strdup(session->securityName);
+ pdu->securityNameLen = strlen(pdu->securityName);
+ }
+ pdu->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
+ pdu->securityModel = session->securityModel;
+ if (memdup(&pdu->contextEngineID, probeEngineID, probeEngineID_len) !=
+ SNMPERR_SUCCESS) {
+ snmp_log(LOG_ERR, "failed to clone memory for rfc5343 probe\n");
+ snmp_free_pdu(pdu);
+ return SNMP_ERR_GENERR;
+ }
+ pdu->contextEngineIDLen = probeEngineID_len;
+
+ snmp_add_null_var(pdu, snmpEngineIDoid, snmpEngineIDoid_len);
+
+ DEBUGMSGTL(("snmp_api", "probing for engineID using rfc5343 methods...\n"));
+ session->flags |= SNMP_FLAGS_DONT_PROBE; /* prevent recursion */
+ status = snmp_sess_synch_response(slp, pdu, &response);
+
+ if ((response == NULL) || (status != STAT_SUCCESS)) {
+ snmp_log(LOG_ERR, "failed rfc5343 contextEngineID probing\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /* check that the response makes sense */
+ if (NULL != response->variables &&
+ NULL != response->variables->name &&
+ snmp_oid_compare(response->variables->name,
+ response->variables->name_length,
+ snmpEngineIDoid, snmpEngineIDoid_len) == 0 &&
+ ASN_OCTET_STR == response->variables->type &&
+ NULL != response->variables->val.string &&
+ response->variables->val_len > 0) {
+ if (memdup(&session->contextEngineID,
+ response->variables->val.string,
+ response->variables->val_len) != SNMPERR_SUCCESS) {
+ snmp_log(LOG_ERR, "failed rfc5343 contextEngineID probing: memory allocation failed\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /* technically there likely isn't a securityEngineID but just
+ in case anyone goes looking we might as well have one */
+ if (memdup(&session->securityEngineID,
+ response->variables->val.string,
+ response->variables->val_len) != SNMPERR_SUCCESS) {
+ snmp_log(LOG_ERR, "failed rfc5343 securityEngineID probing: memory allocation failed\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ session->securityEngineIDLen = session->contextEngineIDLen =
+ response->variables->val_len;
+
+ if (snmp_get_do_debugging()) {
+ size_t i;
+ DEBUGMSGTL(("snmp_sess_open",
+ " probe found engineID: "));
+ for (i = 0; i < session->securityEngineIDLen; i++)
+ DEBUGMSG(("snmp_sess_open", "%02x",
+ session->securityEngineID[i]));
+ DEBUGMSG(("snmp_sess_open", "\n"));
+ }
+ }
+ return SNMPERR_SUCCESS;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMPV3_PROBE_CONTEXTENGINEID_RFC5343 */
+
+
+/**
+ * probe for peer engineID
+ *
+ * @param slp session list pointer.
+ * @param in_session session for errors
+ *
+ * @note
+ * - called by _sess_open(), snmp_sess_add_ex()
+ * - in_session is the user supplied session provided to those functions.
+ * - the first session in slp should the internal allocated copy of in_session
+ *
+ * @return 0 : error
+ * @return 1 : ok
+ *
+ */
+int
+snmpv3_engineID_probe(struct session_list *slp,
+ netsnmp_session * in_session)
+{
+ netsnmp_session *session;
+ int status;
+ struct snmp_secmod_def *sptr = NULL;
+
+ if (slp == NULL || slp->session == NULL) {
+ return 0;
+ }
+
+ session = slp->session;
+ netsnmp_assert_or_return(session != NULL, 0);
+ sptr = find_sec_mod(session->securityModel);
+
+ /*
+ * If we are opening a V3 session and we don't know engineID we must probe
+ * it -- this must be done after the session is created and inserted in the
+ * list so that the response can handled correctly.
+ */
+
+ if (session->version == SNMP_VERSION_3 &&
+ (0 == (session->flags & SNMP_FLAGS_DONT_PROBE))) {
+ if (NULL != sptr && NULL != sptr->probe_engineid) {
+ DEBUGMSGTL(("snmp_api", "probing for engineID using security model callback...\n"));
+ /* security model specific mechanism of determining engineID */
+ status = (*sptr->probe_engineid) (slp, in_session);
+ if (status != SNMPERR_SUCCESS)
+ return 0;
+ } else {
+ /* XXX: default to the default RFC5343 contextEngineID Probe? */
+ return 0;
+ }
+ }
+
+ /* see if there was any hooks to call after the engineID probing */
+ if (sptr && sptr->post_probe_engineid) {
+ status = (*sptr->post_probe_engineid)(slp, in_session);
+ if (status != SNMPERR_SUCCESS)
+ return 0;
+ }
+
+ return 1;
+}
+
+/*******************************************************************-o-******
+ * netsnmp_sess_config_transport
+ *
+ * Parameters:
+ * *in_session
+ * *in_transport
+ *
+ * Returns:
+ * SNMPERR_SUCCESS - Yay
+ * SNMPERR_GENERR - Generic Error
+ * SNMPERR_TRANSPORT_CONFIG_ERROR - Transport rejected config
+ * SNMPERR_TRANSPORT_NO_CONFIG - Transport can't config
+ */
+int
+netsnmp_sess_config_transport(netsnmp_container *transport_configuration,
+ netsnmp_transport *transport)
+{
+ /* Optional supplimental transport configuration information and
+ final call to actually open the transport */
+ if (transport_configuration) {
+ DEBUGMSGTL(("snmp_sess", "configuring transport\n"));
+ if (transport->f_config) {
+ netsnmp_iterator *iter;
+ netsnmp_transport_config *config_data;
+ int ret;
+
+ iter = CONTAINER_ITERATOR(transport_configuration);
+ if (NULL == iter) {
+ return SNMPERR_GENERR;
+ }
+
+ for(config_data = (netsnmp_transport_config*)ITERATOR_FIRST(iter); config_data;
+ config_data = (netsnmp_transport_config*)ITERATOR_NEXT(iter)) {
+ ret = transport->f_config(transport, config_data->key,
+ config_data->value);
+ if (ret) {
+ return SNMPERR_TRANSPORT_CONFIG_ERROR;
+ }
+ }
+ } else {
+ return SNMPERR_TRANSPORT_NO_CONFIG;
+ }
+ }
+ return SNMPERR_SUCCESS;
+}
+
+
+/**
+ * Copies configuration from the session and calls f_open
+ * This function copies any configuration stored in the session
+ * pointer to the transport if it has a f_config pointer and then
+ * calls the transport's f_open function to actually open the
+ * connection.
+ *
+ * @param in_session A pointer to the session that config information is in.
+ * @param transport A pointer to the transport to config/open.
+ *
+ * @return SNMPERR_SUCCESS : on success
+ */
+
+/*******************************************************************-o-******
+ * netsnmp_sess_config_transport
+ *
+ * Parameters:
+ * *in_session
+ * *in_transport
+ *
+ * Returns:
+ * SNMPERR_SUCCESS - Yay
+ * SNMPERR_GENERR - Generic Error
+ * SNMPERR_TRANSPORT_CONFIG_ERROR - Transport rejected config
+ * SNMPERR_TRANSPORT_NO_CONFIG - Transport can't config
+ */
+int
+netsnmp_sess_config_and_open_transport(netsnmp_session *in_session,
+ netsnmp_transport *transport)
+{
+ int rc;
+
+ DEBUGMSGTL(("snmp_sess", "opening transport: %x\n", transport->flags & NETSNMP_TRANSPORT_FLAG_OPENED));
+
+ /* don't double open */
+ if (transport->flags & NETSNMP_TRANSPORT_FLAG_OPENED)
+ return SNMPERR_SUCCESS;
+
+ if ((rc = netsnmp_sess_config_transport(in_session->transport_configuration,
+ transport)) != SNMPERR_SUCCESS) {
+ in_session->s_snmp_errno = rc;
+ in_session->s_errno = 0;
+ return rc;
+ }
+
+ if (transport->f_open)
+ transport = transport->f_open(transport);
+
+ if (transport == NULL) {
+ DEBUGMSGTL(("snmp_sess", "couldn't interpret peername\n"));
+ in_session->s_snmp_errno = SNMPERR_BAD_ADDRESS;
+ in_session->s_errno = errno;
+ snmp_set_detail(in_session->peername);
+ return SNMPERR_BAD_ADDRESS;
+ }
+
+ transport->flags |= NETSNMP_TRANSPORT_FLAG_OPENED;
+ DEBUGMSGTL(("snmp_sess", "done opening transport: %x\n", transport->flags & NETSNMP_TRANSPORT_FLAG_OPENED));
+ return SNMPERR_SUCCESS;
+}
+
+/*******************************************************************-o-******
+ * snmp_sess_open
+ *
+ * Parameters:
+ * *in_session
+ *
+ * Returns:
+ * Pointer to a session in the session list -OR- FIX -- right?
+ * NULL on failure.
+ *
+ * The "spin-free" version of snmp_open.
+ */
+static void *
+_sess_open(netsnmp_session * in_session)
+{
+ netsnmp_transport *transport = NULL;
+ int rc;
+
+ in_session->s_snmp_errno = 0;
+ in_session->s_errno = 0;
+
+ _init_snmp();
+
+ {
+ char *clientaddr_save = NULL;
+
+ if (NULL != in_session->localname) {
+ clientaddr_save =
+ netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CLIENT_ADDR);
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CLIENT_ADDR,
+ in_session->localname);
+ }
+
+ if (in_session->flags & SNMP_FLAGS_STREAM_SOCKET) {
+ transport =
+ netsnmp_tdomain_transport_full("snmp", in_session->peername,
+ in_session->local_port, "tcp",
+ NULL);
+ } else {
+ transport =
+ netsnmp_tdomain_transport_full("snmp", in_session->peername,
+ in_session->local_port, "udp",
+ NULL);
+ }
+
+ if (NULL != clientaddr_save)
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CLIENT_ADDR, clientaddr_save);
+ }
+
+ if (transport == NULL) {
+ DEBUGMSGTL(("_sess_open", "couldn't interpret peername\n"));
+ in_session->s_snmp_errno = SNMPERR_BAD_ADDRESS;
+ in_session->s_errno = errno;
+ snmp_set_detail(in_session->peername);
+ return NULL;
+ }
+
+ /* Optional supplimental transport configuration information and
+ final call to actually open the transport */
+ if ((rc = netsnmp_sess_config_and_open_transport(in_session, transport))
+ != SNMPERR_SUCCESS) {
+ transport = NULL;
+ return NULL;
+ }
+
+#if defined(SO_BROADCAST) && defined(SOL_SOCKET)
+ if ( in_session->flags & SNMP_FLAGS_UDP_BROADCAST) {
+ int b = 1;
+ int rc;
+
+ rc = setsockopt(transport->sock, SOL_SOCKET, SO_BROADCAST,
+ (char *)&b, sizeof(b));
+
+ if ( rc != 0 ) {
+ in_session->s_snmp_errno = SNMPERR_BAD_ADDRESS; /* good as any? */
+ in_session->s_errno = errno;
+
+ DEBUGMSGTL(("_sess_open", "couldn't enable UDP_BROADCAST\n"));
+ return NULL;
+ }
+ }
+#endif
+
+ return snmp_sess_add(in_session, transport, NULL, NULL);
+}
+
+/*
+ * EXTENDED SESSION API ------------------------------------------
+ *
+ * snmp_sess_add_ex, snmp_sess_add, snmp_add
+ *
+ * Analogous to snmp_open family of functions, but taking a netsnmp_transport
+ * pointer as an extra argument. Unlike snmp_open et al. it doesn't attempt
+ * to interpret the in_session->peername as a transport endpoint specifier,
+ * but instead uses the supplied transport. JBPN
+ *
+ */
+
+netsnmp_session *
+snmp_add(netsnmp_session * in_session,
+ netsnmp_transport *transport,
+ int (*fpre_parse) (netsnmp_session *, netsnmp_transport *, void *,
+ int), int (*fpost_parse) (netsnmp_session *,
+ netsnmp_pdu *, int))
+{
+ struct session_list *slp;
+ slp = (struct session_list *) snmp_sess_add_ex(in_session, transport,
+ fpre_parse, NULL,
+ fpost_parse, NULL, NULL,
+ NULL, NULL);
+ if (slp == NULL) {
+ return NULL;
+ }
+
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ slp->next = Sessions;
+ Sessions = slp;
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+
+ return (slp->session);
+}
+
+netsnmp_session *
+snmp_add_full(netsnmp_session * in_session,
+ netsnmp_transport *transport,
+ int (*fpre_parse) (netsnmp_session *, netsnmp_transport *,
+ void *, int),
+ int (*fparse) (netsnmp_session *, netsnmp_pdu *, u_char *,
+ size_t),
+ int (*fpost_parse) (netsnmp_session *, netsnmp_pdu *, int),
+ int (*fbuild) (netsnmp_session *, netsnmp_pdu *, u_char *,
+ size_t *), int (*frbuild) (netsnmp_session *,
+ netsnmp_pdu *,
+ u_char **,
+ size_t *,
+ size_t *),
+ int (*fcheck) (u_char *, size_t),
+ netsnmp_pdu *(*fcreate_pdu) (netsnmp_transport *, void *,
+ size_t))
+{
+ struct session_list *slp;
+ slp = (struct session_list *) snmp_sess_add_ex(in_session, transport,
+ fpre_parse, fparse,
+ fpost_parse, fbuild,
+ frbuild, fcheck,
+ fcreate_pdu);
+ if (slp == NULL) {
+ return NULL;
+ }
+
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ slp->next = Sessions;
+ Sessions = slp;
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+
+ return (slp->session);
+}
+
+
+
+void *
+snmp_sess_add_ex(netsnmp_session * in_session,
+ netsnmp_transport *transport,
+ int (*fpre_parse) (netsnmp_session *, netsnmp_transport *,
+ void *, int),
+ int (*fparse) (netsnmp_session *, netsnmp_pdu *, u_char *,
+ size_t),
+ int (*fpost_parse) (netsnmp_session *, netsnmp_pdu *,
+ int),
+ int (*fbuild) (netsnmp_session *, netsnmp_pdu *, u_char *,
+ size_t *),
+ int (*frbuild) (netsnmp_session *, netsnmp_pdu *,
+ u_char **, size_t *, size_t *),
+ int (*fcheck) (u_char *, size_t),
+ netsnmp_pdu *(*fcreate_pdu) (netsnmp_transport *, void *,
+ size_t))
+{
+ struct session_list *slp;
+ int rc;
+
+ _init_snmp();
+
+ if (transport == NULL)
+ return NULL;
+
+ if (in_session == NULL) {
+ transport->f_close(transport);
+ netsnmp_transport_free(transport);
+ return NULL;
+ }
+
+ /* if the transport hasn't been fully opened yet, open it now */
+ if ((rc = netsnmp_sess_config_and_open_transport(in_session, transport))
+ != SNMPERR_SUCCESS) {
+ return NULL;
+ }
+
+ if (transport->f_setup_session) {
+ if (SNMPERR_SUCCESS !=
+ transport->f_setup_session(transport, in_session)) {
+ netsnmp_transport_free(transport);
+ return NULL;
+ }
+ }
+
+
+ DEBUGMSGTL(("snmp_sess_add", "fd %d\n", transport->sock));
+
+
+ if ((slp = snmp_sess_copy(in_session)) == NULL) {
+ transport->f_close(transport);
+ netsnmp_transport_free(transport);
+ return (NULL);
+ }
+
+ slp->transport = transport;
+ slp->internal->hook_pre = fpre_parse;
+ slp->internal->hook_parse = fparse;
+ slp->internal->hook_post = fpost_parse;
+ slp->internal->hook_build = fbuild;
+ slp->internal->hook_realloc_build = frbuild;
+ slp->internal->check_packet = fcheck;
+ slp->internal->hook_create_pdu = fcreate_pdu;
+
+ slp->session->rcvMsgMaxSize = transport->msgMaxSize;
+
+ if (slp->session->version == SNMP_VERSION_3) {
+ DEBUGMSGTL(("snmp_sess_add",
+ "adding v3 session -- maybe engineID probe now\n"));
+ if (!snmpv3_engineID_probe(slp, slp->session)) {
+ DEBUGMSGTL(("snmp_sess_add", "engine ID probe failed\n"));
+ snmp_sess_close(slp);
+ return NULL;
+ }
+ }
+
+ slp->session->flags &= ~SNMP_FLAGS_DONT_PROBE;
+
+ return (void *) slp;
+} /* end snmp_sess_add_ex() */
+
+
+
+void *
+snmp_sess_add(netsnmp_session * in_session,
+ netsnmp_transport *transport,
+ int (*fpre_parse) (netsnmp_session *, netsnmp_transport *,
+ void *, int),
+ int (*fpost_parse) (netsnmp_session *, netsnmp_pdu *, int))
+{
+ return snmp_sess_add_ex(in_session, transport, fpre_parse, NULL,
+ fpost_parse, NULL, NULL, NULL, NULL);
+}
+
+
+
+void *
+snmp_sess_open(netsnmp_session * pss)
+{
+ void *pvoid;
+ pvoid = _sess_open(pss);
+ if (!pvoid) {
+ SET_SNMP_ERROR(pss->s_snmp_errno);
+ }
+ return pvoid;
+}
+
+int
+create_user_from_session(netsnmp_session * session) {
+#ifdef NETSNMP_SECMOD_USM
+ return usm_create_user_from_session(session);
+#else
+ snmp_log(LOG_ERR, "create_user_from_session called when USM wasn't compiled in");
+ netsnmp_assert(0 == 1);
+ return SNMP_ERR_GENERR;
+#endif
+}
+
+
+/*
+ * Do a "deep free()" of a netsnmp_session.
+ *
+ * CAUTION: SHOULD ONLY BE USED FROM snmp_sess_close() OR SIMILAR.
+ * (hence it is static)
+ */
+
+static void
+snmp_free_session(netsnmp_session * s)
+{
+ if (s) {
+ SNMP_FREE(s->localname);
+ SNMP_FREE(s->peername);
+ SNMP_FREE(s->community);
+ SNMP_FREE(s->contextEngineID);
+ SNMP_FREE(s->contextName);
+ SNMP_FREE(s->securityEngineID);
+ SNMP_FREE(s->securityName);
+ SNMP_FREE(s->securityAuthProto);
+ SNMP_FREE(s->securityPrivProto);
+ SNMP_FREE(s->paramName);
+
+ /*
+ * clear session from any callbacks
+ */
+ netsnmp_callback_clear_client_arg(s, 0, 0);
+
+ free((char *) s);
+ }
+}
+
+/*
+ * Close the input session. Frees all data allocated for the session,
+ * dequeues any pending requests, and closes any sockets allocated for
+ * the session. Returns 0 on error, 1 otherwise.
+ */
+int
+snmp_sess_close(void *sessp)
+{
+ struct session_list *slp = (struct session_list *) sessp;
+ netsnmp_transport *transport;
+ struct snmp_internal_session *isp;
+ netsnmp_session *sesp = NULL;
+ struct snmp_secmod_def *sptr;
+
+ if (slp == NULL) {
+ return 0;
+ }
+
+ if (slp->session != NULL &&
+ (sptr = find_sec_mod(slp->session->securityModel)) != NULL &&
+ sptr->session_close != NULL) {
+ (*sptr->session_close) (slp->session);
+ }
+
+ isp = slp->internal;
+ slp->internal = NULL;
+
+ if (isp) {
+ netsnmp_request_list *rp, *orp;
+
+ SNMP_FREE(isp->packet);
+
+ /*
+ * Free each element in the input request list.
+ */
+ rp = isp->requests;
+ while (rp) {
+ orp = rp;
+ rp = rp->next_request;
+ if (orp->callback) {
+ orp->callback(NETSNMP_CALLBACK_OP_TIMED_OUT,
+ slp->session, orp->pdu->reqid,
+ orp->pdu, orp->cb_data);
+ }
+ snmp_free_pdu(orp->pdu);
+ free((char *) orp);
+ }
+
+ free((char *) isp);
+ }
+
+ transport = slp->transport;
+ slp->transport = NULL;
+
+ if (transport) {
+ transport->f_close(transport);
+ netsnmp_transport_free(transport);
+ }
+
+ sesp = slp->session;
+ slp->session = NULL;
+
+ /*
+ * The following is necessary to avoid memory leakage when closing AgentX
+ * sessions that may have multiple subsessions. These hang off the main
+ * session at ->subsession, and chain through ->next.
+ */
+
+ if (sesp != NULL && sesp->subsession != NULL) {
+ netsnmp_session *subsession = sesp->subsession, *tmpsub;
+
+ while (subsession != NULL) {
+ DEBUGMSGTL(("snmp_sess_close",
+ "closing session %p, subsession %p\n", sesp,
+ subsession));
+ tmpsub = subsession->next;
+ snmp_free_session(subsession);
+ subsession = tmpsub;
+ }
+ }
+
+ snmp_free_session(sesp);
+ free((char *) slp);
+ return 1;
+}
+
+int
+snmp_close(netsnmp_session * session)
+{
+ struct session_list *slp = NULL, *oslp = NULL;
+
+ { /*MTCRITICAL_RESOURCE */
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ if (Sessions && Sessions->session == session) { /* If first entry */
+ slp = Sessions;
+ Sessions = slp->next;
+ } else {
+ for (slp = Sessions; slp; slp = slp->next) {
+ if (slp->session == session) {
+ if (oslp) /* if we found entry that points here */
+ oslp->next = slp->next; /* link around this entry */
+ break;
+ }
+ oslp = slp;
+ }
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ } /*END MTCRITICAL_RESOURCE */
+ if (slp == NULL) {
+ return 0;
+ }
+ return snmp_sess_close((void *) slp);
+}
+
+int
+snmp_close_sessions(void)
+{
+ struct session_list *slp;
+
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ while (Sessions) {
+ slp = Sessions;
+ Sessions = Sessions->next;
+ snmp_sess_close((void *) slp);
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ return 1;
+}
+
+static void
+snmpv3_calc_msg_flags(int sec_level, int msg_command, u_char * flags)
+{
+ *flags = 0;
+ if (sec_level == SNMP_SEC_LEVEL_AUTHNOPRIV)
+ *flags = SNMP_MSG_FLAG_AUTH_BIT;
+ else if (sec_level == SNMP_SEC_LEVEL_AUTHPRIV)
+ *flags = SNMP_MSG_FLAG_AUTH_BIT | SNMP_MSG_FLAG_PRIV_BIT;
+
+ if (SNMP_CMD_CONFIRMED(msg_command))
+ *flags |= SNMP_MSG_FLAG_RPRT_BIT;
+
+ return;
+}
+
+static int
+snmpv3_verify_msg(netsnmp_request_list *rp, netsnmp_pdu *pdu)
+{
+ netsnmp_pdu *rpdu;
+
+ if (!rp || !rp->pdu || !pdu)
+ return 0;
+ /*
+ * Reports don't have to match anything according to the spec
+ */
+ if (pdu->command == SNMP_MSG_REPORT)
+ return 1;
+ rpdu = rp->pdu;
+ if (rp->request_id != pdu->reqid || rpdu->reqid != pdu->reqid)
+ return 0;
+ if (rpdu->version != pdu->version)
+ return 0;
+ if (rpdu->securityModel != pdu->securityModel)
+ return 0;
+ if (rpdu->securityLevel != pdu->securityLevel)
+ return 0;
+
+ if (rpdu->contextEngineIDLen != pdu->contextEngineIDLen ||
+ memcmp(rpdu->contextEngineID, pdu->contextEngineID,
+ pdu->contextEngineIDLen))
+ return 0;
+ if (rpdu->contextNameLen != pdu->contextNameLen ||
+ memcmp(rpdu->contextName, pdu->contextName, pdu->contextNameLen))
+ return 0;
+
+ /* tunneled transports don't have a securityEngineID... that's
+ USM specific (and maybe other future ones) */
+ if (pdu->securityModel == SNMP_SEC_MODEL_USM &&
+ (rpdu->securityEngineIDLen != pdu->securityEngineIDLen ||
+ memcmp(rpdu->securityEngineID, pdu->securityEngineID,
+ pdu->securityEngineIDLen)))
+ return 0;
+
+ /* the securityName must match though regardless of secmodel */
+ if (rpdu->securityNameLen != pdu->securityNameLen ||
+ memcmp(rpdu->securityName, pdu->securityName,
+ pdu->securityNameLen))
+ return 0;
+ return 1;
+}
+
+
+/*
+ * SNMPv3
+ * * Takes a session and a pdu and serializes the ASN PDU into the area
+ * * pointed to by packet. out_length is the size of the data area available.
+ * * Returns the length of the completed packet in out_length. If any errors
+ * * occur, -1 is returned. If all goes well, 0 is returned.
+ */
+static int
+snmpv3_build(u_char ** pkt, size_t * pkt_len, size_t * offset,
+ netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ int ret;
+
+ session->s_snmp_errno = 0;
+ session->s_errno = 0;
+
+ /*
+ * do validation for PDU types
+ */
+ switch (pdu->command) {
+ case SNMP_MSG_RESPONSE:
+ case SNMP_MSG_TRAP2:
+ case SNMP_MSG_REPORT:
+ netsnmp_assert(0 == (pdu->flags & UCD_MSG_FLAG_EXPECT_RESPONSE));
+ /*
+ * Fallthrough
+ */
+#ifndef NETSNMP_NOTIFY_ONLY
+ case SNMP_MSG_GET:
+ case SNMP_MSG_GETNEXT:
+#endif /* ! NETSNMP_NOTIFY_ONLY */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_SET:
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ case SNMP_MSG_INFORM:
+ if (pdu->errstat == SNMP_DEFAULT_ERRSTAT)
+ pdu->errstat = 0;
+ if (pdu->errindex == SNMP_DEFAULT_ERRINDEX)
+ pdu->errindex = 0;
+ break;
+
+#ifndef NETSNMP_NOTIFY_ONLY
+ case SNMP_MSG_GETBULK:
+ if (pdu->max_repetitions < 0) {
+ session->s_snmp_errno = SNMPERR_BAD_REPETITIONS;
+ return -1;
+ }
+ if (pdu->non_repeaters < 0) {
+ session->s_snmp_errno = SNMPERR_BAD_REPEATERS;
+ return -1;
+ }
+ break;
+#endif /* ! NETSNMP_NOTIFY_ONLY */
+
+ case SNMP_MSG_TRAP:
+ session->s_snmp_errno = SNMPERR_V1_IN_V2;
+ return -1;
+
+ default:
+ session->s_snmp_errno = SNMPERR_UNKNOWN_PDU;
+ return -1;
+ }
+
+ /* Do we need to set the session security engineid? */
+ if (pdu->securityEngineIDLen == 0) {
+ if (session->securityEngineIDLen) {
+ snmpv3_clone_engineID(&pdu->securityEngineID,
+ &pdu->securityEngineIDLen,
+ session->securityEngineID,
+ session->securityEngineIDLen);
+ }
+ }
+
+ /* Do we need to set the session context engineid? */
+ if (pdu->contextEngineIDLen == 0) {
+ if (session->contextEngineIDLen) {
+ snmpv3_clone_engineID(&pdu->contextEngineID,
+ &pdu->contextEngineIDLen,
+ session->contextEngineID,
+ session->contextEngineIDLen);
+ } else if (pdu->securityEngineIDLen) {
+ snmpv3_clone_engineID(&pdu->contextEngineID,
+ &pdu->contextEngineIDLen,
+ pdu->securityEngineID,
+ pdu->securityEngineIDLen);
+ }
+ }
+
+ if (pdu->contextName == NULL) {
+ if (!session->contextName) {
+ session->s_snmp_errno = SNMPERR_BAD_CONTEXT;
+ return -1;
+ }
+ pdu->contextName = strdup(session->contextName);
+ if (pdu->contextName == NULL) {
+ session->s_snmp_errno = SNMPERR_GENERR;
+ return -1;
+ }
+ pdu->contextNameLen = session->contextNameLen;
+ }
+ if (pdu->securityModel == SNMP_DEFAULT_SECMODEL) {
+ pdu->securityModel = session->securityModel;
+ if (pdu->securityModel == SNMP_DEFAULT_SECMODEL) {
+ pdu->securityModel = se_find_value_in_slist("snmp_secmods", netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SECMODEL));
+
+ if (pdu->securityModel <= 0) {
+ pdu->securityModel = SNMP_SEC_MODEL_USM;
+ }
+ }
+ }
+ if (pdu->securityNameLen == 0 && pdu->securityName == NULL) {
+ if (session->securityModel != SNMP_SEC_MODEL_TSM &&
+ session->securityNameLen == 0) {
+ session->s_snmp_errno = SNMPERR_BAD_SEC_NAME;
+ return -1;
+ }
+ if (session->securityName) {
+ pdu->securityName = strdup(session->securityName);
+ if (pdu->securityName == NULL) {
+ session->s_snmp_errno = SNMPERR_GENERR;
+ return -1;
+ }
+ pdu->securityNameLen = session->securityNameLen;
+ } else {
+ pdu->securityName = strdup("");
+ session->securityName = strdup("");
+ }
+ }
+ if (pdu->securityLevel == 0) {
+ if (session->securityLevel == 0) {
+ session->s_snmp_errno = SNMPERR_BAD_SEC_LEVEL;
+ return -1;
+ }
+ pdu->securityLevel = session->securityLevel;
+ }
+ DEBUGMSGTL(("snmp_build",
+ "Building SNMPv3 message (secName:\"%s\", secLevel:%s)...\n",
+ ((session->securityName) ? (char *) session->securityName :
+ ((pdu->securityName) ? (char *) pdu->securityName :
+ "ERROR: undefined")), secLevelName[pdu->securityLevel]));
+
+ DEBUGDUMPSECTION("send", "SNMPv3 Message");
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_REVERSE_ENCODE)) {
+ ret = snmpv3_packet_realloc_rbuild(pkt, pkt_len, offset,
+ session, pdu, NULL, 0);
+ } else {
+#endif
+ ret = snmpv3_packet_build(session, pdu, *pkt, pkt_len, NULL, 0);
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ }
+#endif
+ DEBUGINDENTLESS();
+ if (-1 != ret) {
+ session->s_snmp_errno = ret;
+ }
+
+ return ret;
+
+} /* end snmpv3_build() */
+
+
+
+
+static u_char *
+snmpv3_header_build(netsnmp_session * session, netsnmp_pdu *pdu,
+ u_char * packet, size_t * out_length,
+ size_t length, u_char ** msg_hdr_e)
+{
+ u_char *global_hdr, *global_hdr_e;
+ u_char *cp;
+ u_char msg_flags;
+ long max_size;
+ long sec_model;
+ u_char *pb, *pb0e;
+
+ /*
+ * Save current location and build SEQUENCE tag and length placeholder
+ * * for SNMP message sequence (actual length inserted later)
+ */
+ cp = asn_build_sequence(packet, out_length,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ length);
+ if (cp == NULL)
+ return NULL;
+ if (msg_hdr_e != NULL)
+ *msg_hdr_e = cp;
+ pb0e = cp;
+
+
+ /*
+ * store the version field - msgVersion
+ */
+ DEBUGDUMPHEADER("send", "SNMP Version Number");
+ cp = asn_build_int(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), (long *) &pdu->version,
+ sizeof(pdu->version));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ global_hdr = cp;
+ /*
+ * msgGlobalData HeaderData
+ */
+ DEBUGDUMPSECTION("send", "msgGlobalData");
+ cp = asn_build_sequence(cp, out_length,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), 0);
+ if (cp == NULL)
+ return NULL;
+ global_hdr_e = cp;
+
+
+ /*
+ * msgID
+ */
+ DEBUGDUMPHEADER("send", "msgID");
+ cp = asn_build_int(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &pdu->msgid,
+ sizeof(pdu->msgid));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ /*
+ * msgMaxSize
+ */
+ max_size = session->rcvMsgMaxSize;
+ DEBUGDUMPHEADER("send", "msgMaxSize");
+ cp = asn_build_int(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &max_size,
+ sizeof(max_size));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ /*
+ * msgFlags
+ */
+ snmpv3_calc_msg_flags(pdu->securityLevel, pdu->command, &msg_flags);
+ DEBUGDUMPHEADER("send", "msgFlags");
+ cp = asn_build_string(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), &msg_flags,
+ sizeof(msg_flags));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ /*
+ * msgSecurityModel
+ */
+ sec_model = pdu->securityModel;
+ DEBUGDUMPHEADER("send", "msgSecurityModel");
+ cp = asn_build_int(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &sec_model,
+ sizeof(sec_model));
+ DEBUGINDENTADD(-4); /* return from global data indent */
+ if (cp == NULL)
+ return NULL;
+
+
+ /*
+ * insert actual length of globalData
+ */
+ pb = asn_build_sequence(global_hdr, out_length,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ cp - global_hdr_e);
+ if (pb == NULL)
+ return NULL;
+
+
+ /*
+ * insert the actual length of the entire packet
+ */
+ pb = asn_build_sequence(packet, out_length,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ length + (cp - pb0e));
+ if (pb == NULL)
+ return NULL;
+
+ return cp;
+
+} /* end snmpv3_header_build() */
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+
+int
+snmpv3_header_realloc_rbuild(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, netsnmp_session * session,
+ netsnmp_pdu *pdu)
+{
+ size_t start_offset = *offset;
+ u_char msg_flags;
+ long max_size, sec_model;
+ int rc = 0;
+
+ /*
+ * msgSecurityModel.
+ */
+ sec_model = pdu->securityModel;
+ DEBUGDUMPHEADER("send", "msgSecurityModel");
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &sec_model,
+ sizeof(sec_model));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * msgFlags.
+ */
+ snmpv3_calc_msg_flags(pdu->securityLevel, pdu->command, &msg_flags);
+ DEBUGDUMPHEADER("send", "msgFlags");
+ rc = asn_realloc_rbuild_string(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR), &msg_flags,
+ sizeof(msg_flags));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * msgMaxSize.
+ */
+ max_size = session->rcvMsgMaxSize;
+ DEBUGDUMPHEADER("send", "msgMaxSize");
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &max_size,
+ sizeof(max_size));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * msgID.
+ */
+ DEBUGDUMPHEADER("send", "msgID");
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &pdu->msgid,
+ sizeof(pdu->msgid));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * Global data sequence.
+ */
+ rc = asn_realloc_rbuild_sequence(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR),
+ *offset - start_offset);
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * Store the version field - msgVersion.
+ */
+ DEBUGDUMPHEADER("send", "SNMP Version Number");
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER),
+ (long *) &pdu->version,
+ sizeof(pdu->version));
+ DEBUGINDENTLESS();
+ return rc;
+} /* end snmpv3_header_realloc_rbuild() */
+#endif /* NETSNMP_USE_REVERSE_ASNENCODING */
+
+static u_char *
+snmpv3_scopedPDU_header_build(netsnmp_pdu *pdu,
+ u_char * packet, size_t * out_length,
+ u_char ** spdu_e)
+{
+ u_char *scopedPdu, *pb;
+
+ pb = scopedPdu = packet;
+ pb = asn_build_sequence(pb, out_length,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), 0);
+ if (pb == NULL)
+ return NULL;
+ if (spdu_e)
+ *spdu_e = pb;
+
+ DEBUGDUMPHEADER("send", "contextEngineID");
+ pb = asn_build_string(pb, out_length,
+ (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR),
+ pdu->contextEngineID, pdu->contextEngineIDLen);
+ DEBUGINDENTLESS();
+ if (pb == NULL)
+ return NULL;
+
+ DEBUGDUMPHEADER("send", "contextName");
+ pb = asn_build_string(pb, out_length,
+ (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR),
+ (u_char *) pdu->contextName,
+ pdu->contextNameLen);
+ DEBUGINDENTLESS();
+ if (pb == NULL)
+ return NULL;
+
+ return pb;
+
+} /* end snmpv3_scopedPDU_header_build() */
+
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+int
+snmpv3_scopedPDU_header_realloc_rbuild(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, netsnmp_pdu *pdu,
+ size_t body_len)
+{
+ size_t start_offset = *offset;
+ int rc = 0;
+
+ /*
+ * contextName.
+ */
+ DEBUGDUMPHEADER("send", "contextName");
+ rc = asn_realloc_rbuild_string(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR),
+ (u_char *) pdu->contextName,
+ pdu->contextNameLen);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * contextEngineID.
+ */
+ DEBUGDUMPHEADER("send", "contextEngineID");
+ rc = asn_realloc_rbuild_string(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR),
+ pdu->contextEngineID,
+ pdu->contextEngineIDLen);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ rc = asn_realloc_rbuild_sequence(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR),
+ *offset - start_offset + body_len);
+
+ return rc;
+} /* end snmpv3_scopedPDU_header_realloc_rbuild() */
+#endif /* NETSNMP_USE_REVERSE_ASNENCODING */
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+/*
+ * returns 0 if success, -1 if fail, not 0 if SM build failure
+ */
+int
+snmpv3_packet_realloc_rbuild(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, netsnmp_session * session,
+ netsnmp_pdu *pdu, u_char * pdu_data,
+ size_t pdu_data_len)
+{
+ u_char *scoped_pdu, *hdrbuf = NULL, *hdr = NULL;
+ size_t hdrbuf_len = SNMP_MAX_MSG_V3_HDRS, hdr_offset =
+ 0, spdu_offset = 0;
+ size_t body_end_offset = *offset, body_len = 0;
+ struct snmp_secmod_def *sptr = NULL;
+ int rc = 0;
+
+ /*
+ * Build a scopedPDU structure into the packet buffer.
+ */
+ DEBUGPRINTPDUTYPE("send", pdu->command);
+ if (pdu_data) {
+ while ((*pkt_len - *offset) < pdu_data_len) {
+ if (!asn_realloc(pkt, pkt_len)) {
+ return -1;
+ }
+ }
+
+ *offset += pdu_data_len;
+ memcpy(*pkt + *pkt_len - *offset, pdu_data, pdu_data_len);
+ } else {
+ rc = snmp_pdu_realloc_rbuild(pkt, pkt_len, offset, pdu);
+ if (rc == 0) {
+ return -1;
+ }
+ }
+ body_len = *offset - body_end_offset;
+
+ DEBUGDUMPSECTION("send", "ScopedPdu");
+ rc = snmpv3_scopedPDU_header_realloc_rbuild(pkt, pkt_len, offset,
+ pdu, body_len);
+ if (rc == 0) {
+ return -1;
+ }
+ spdu_offset = *offset;
+ DEBUGINDENTADD(-4); /* Return from Scoped PDU. */
+
+ if ((hdrbuf = (u_char *) malloc(hdrbuf_len)) == NULL) {
+ return -1;
+ }
+
+ rc = snmpv3_header_realloc_rbuild(&hdrbuf, &hdrbuf_len, &hdr_offset,
+ session, pdu);
+ if (rc == 0) {
+ SNMP_FREE(hdrbuf);
+ return -1;
+ }
+ hdr = hdrbuf + hdrbuf_len - hdr_offset;
+ scoped_pdu = *pkt + *pkt_len - spdu_offset;
+
+ /*
+ * Call the security module to possibly encrypt and authenticate the
+ * message---the entire message to transmitted on the wire is returned.
+ */
+
+ sptr = find_sec_mod(pdu->securityModel);
+ DEBUGDUMPSECTION("send", "SM msgSecurityParameters");
+ if (sptr && sptr->encode_reverse) {
+ struct snmp_secmod_outgoing_params parms;
+
+ parms.msgProcModel = pdu->msgParseModel;
+ parms.globalData = hdr;
+ parms.globalDataLen = hdr_offset;
+ parms.maxMsgSize = SNMP_MAX_MSG_SIZE;
+ parms.secModel = pdu->securityModel;
+ parms.secEngineID = pdu->securityEngineID;
+ parms.secEngineIDLen = pdu->securityEngineIDLen;
+ parms.secName = pdu->securityName;
+ parms.secNameLen = pdu->securityNameLen;
+ parms.secLevel = pdu->securityLevel;
+ parms.scopedPdu = scoped_pdu;
+ parms.scopedPduLen = spdu_offset;
+ parms.secStateRef = pdu->securityStateRef;
+ parms.wholeMsg = pkt;
+ parms.wholeMsgLen = pkt_len;
+ parms.wholeMsgOffset = offset;
+ parms.session = session;
+ parms.pdu = pdu;
+
+ rc = (*sptr->encode_reverse) (&parms);
+ } else {
+ if (!sptr) {
+ snmp_log(LOG_ERR,
+ "no such security service available: %d\n",
+ pdu->securityModel);
+ } else if (!sptr->encode_reverse) {
+ snmp_log(LOG_ERR,
+ "security service %d doesn't support reverse encoding.\n",
+ pdu->securityModel);
+ }
+ rc = -1;
+ }
+
+ DEBUGINDENTLESS();
+ SNMP_FREE(hdrbuf);
+ return rc;
+} /* end snmpv3_packet_realloc_rbuild() */
+#endif /* NETSNMP_USE_REVERSE_ASNENCODING */
+
+/*
+ * returns 0 if success, -1 if fail, not 0 if SM build failure
+ */
+int
+snmpv3_packet_build(netsnmp_session * session, netsnmp_pdu *pdu,
+ u_char * packet, size_t * out_length,
+ u_char * pdu_data, size_t pdu_data_len)
+{
+ u_char *global_data, *sec_params, *spdu_hdr_e;
+ size_t global_data_len, sec_params_len;
+ u_char spdu_buf[SNMP_MAX_MSG_SIZE];
+ size_t spdu_buf_len, spdu_len;
+ u_char *cp;
+ int result;
+ struct snmp_secmod_def *sptr;
+
+ global_data = packet;
+
+ /*
+ * build the headers for the packet, returned addr = start of secParams
+ */
+ sec_params = snmpv3_header_build(session, pdu, global_data,
+ out_length, 0, NULL);
+ if (sec_params == NULL)
+ return -1;
+ global_data_len = sec_params - global_data;
+ sec_params_len = *out_length; /* length left in packet buf for sec_params */
+
+
+ /*
+ * build a scopedPDU structure into spdu_buf
+ */
+ spdu_buf_len = SNMP_MAX_MSG_SIZE;
+ DEBUGDUMPSECTION("send", "ScopedPdu");
+ cp = snmpv3_scopedPDU_header_build(pdu, spdu_buf, &spdu_buf_len,
+ &spdu_hdr_e);
+ if (cp == NULL)
+ return -1;
+
+ /*
+ * build the PDU structure onto the end of spdu_buf
+ */
+ DEBUGPRINTPDUTYPE("send", ((pdu_data) ? *pdu_data : 0x00));
+ if (pdu_data) {
+ memcpy(cp, pdu_data, pdu_data_len);
+ cp += pdu_data_len;
+ } else {
+ cp = snmp_pdu_build(pdu, cp, &spdu_buf_len);
+ if (cp == NULL)
+ return -1;
+ }
+ DEBUGINDENTADD(-4); /* return from Scoped PDU */
+
+ /*
+ * re-encode the actual ASN.1 length of the scopedPdu
+ */
+ spdu_len = cp - spdu_hdr_e; /* length of scopedPdu minus ASN.1 headers */
+ spdu_buf_len = SNMP_MAX_MSG_SIZE;
+ if (asn_build_sequence(spdu_buf, &spdu_buf_len,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ spdu_len) == NULL)
+ return -1;
+ spdu_len = cp - spdu_buf; /* the length of the entire scopedPdu */
+
+
+ /*
+ * call the security module to possibly encrypt and authenticate the
+ * message - the entire message to transmitted on the wire is returned
+ */
+ cp = NULL;
+ *out_length = SNMP_MAX_MSG_SIZE;
+ DEBUGDUMPSECTION("send", "SM msgSecurityParameters");
+ sptr = find_sec_mod(pdu->securityModel);
+ if (sptr && sptr->encode_forward) {
+ struct snmp_secmod_outgoing_params parms;
+ parms.msgProcModel = pdu->msgParseModel;
+ parms.globalData = global_data;
+ parms.globalDataLen = global_data_len;
+ parms.maxMsgSize = SNMP_MAX_MSG_SIZE;
+ parms.secModel = pdu->securityModel;
+ parms.secEngineID = pdu->securityEngineID;
+ parms.secEngineIDLen = pdu->securityEngineIDLen;
+ parms.secName = pdu->securityName;
+ parms.secNameLen = pdu->securityNameLen;
+ parms.secLevel = pdu->securityLevel;
+ parms.scopedPdu = spdu_buf;
+ parms.scopedPduLen = spdu_len;
+ parms.secStateRef = pdu->securityStateRef;
+ parms.secParams = sec_params;
+ parms.secParamsLen = &sec_params_len;
+ parms.wholeMsg = &cp;
+ parms.wholeMsgLen = out_length;
+ parms.session = session;
+ parms.pdu = pdu;
+ result = (*sptr->encode_forward) (&parms);
+ } else {
+ if (!sptr) {
+ snmp_log(LOG_ERR, "no such security service available: %d\n",
+ pdu->securityModel);
+ } else if (!sptr->encode_forward) {
+ snmp_log(LOG_ERR,
+ "security service %d doesn't support forward out encoding.\n",
+ pdu->securityModel);
+ }
+ result = -1;
+ }
+ DEBUGINDENTLESS();
+ return result;
+
+} /* end snmpv3_packet_build() */
+
+
+/*
+ * Takes a session and a pdu and serializes the ASN PDU into the area
+ * pointed to by *pkt. *pkt_len is the size of the data area available.
+ * Returns the length of the completed packet in *offset. If any errors
+ * occur, -1 is returned. If all goes well, 0 is returned.
+ */
+
+static int
+_snmp_build(u_char ** pkt, size_t * pkt_len, size_t * offset,
+ netsnmp_session * session, netsnmp_pdu *pdu)
+{
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ u_char *h0e = NULL;
+ size_t start_offset = *offset;
+ long version;
+ int rc = 0;
+#endif /* support for community based SNMP */
+
+ u_char *cp;
+ size_t length;
+
+ session->s_snmp_errno = 0;
+ session->s_errno = 0;
+
+ if (pdu->version == SNMP_VERSION_3) {
+ return snmpv3_build(pkt, pkt_len, offset, session, pdu);
+ }
+
+ switch (pdu->command) {
+ case SNMP_MSG_RESPONSE:
+ netsnmp_assert(0 == (pdu->flags & UCD_MSG_FLAG_EXPECT_RESPONSE));
+ /*
+ * Fallthrough
+ */
+#ifndef NETSNMP_NOTIFY_ONLY
+ case SNMP_MSG_GET:
+ case SNMP_MSG_GETNEXT:
+#endif /* ! NETSNMP_NOTIFY_ONLY */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_SET:
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ /*
+ * all versions support these PDU types
+ */
+ /*
+ * initialize defaulted PDU fields
+ */
+
+ if (pdu->errstat == SNMP_DEFAULT_ERRSTAT)
+ pdu->errstat = 0;
+ if (pdu->errindex == SNMP_DEFAULT_ERRINDEX)
+ pdu->errindex = 0;
+ break;
+
+ case SNMP_MSG_TRAP2:
+ netsnmp_assert(0 == (pdu->flags & UCD_MSG_FLAG_EXPECT_RESPONSE));
+ /*
+ * Fallthrough
+ */
+ case SNMP_MSG_INFORM:
+#ifndef NETSNMP_DISABLE_SNMPV1
+ /*
+ * not supported in SNMPv1 and SNMPsec
+ */
+ if (pdu->version == SNMP_VERSION_1) {
+ session->s_snmp_errno = SNMPERR_V2_IN_V1;
+ return -1;
+ }
+#endif
+ if (pdu->errstat == SNMP_DEFAULT_ERRSTAT)
+ pdu->errstat = 0;
+ if (pdu->errindex == SNMP_DEFAULT_ERRINDEX)
+ pdu->errindex = 0;
+ break;
+
+#ifndef NETSNMP_NOTIFY_ONLY
+ case SNMP_MSG_GETBULK:
+ /*
+ * not supported in SNMPv1 and SNMPsec
+ */
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (pdu->version == SNMP_VERSION_1) {
+ session->s_snmp_errno = SNMPERR_V2_IN_V1;
+ return -1;
+ }
+#endif
+ if (pdu->max_repetitions < 0) {
+ session->s_snmp_errno = SNMPERR_BAD_REPETITIONS;
+ return -1;
+ }
+ if (pdu->non_repeaters < 0) {
+ session->s_snmp_errno = SNMPERR_BAD_REPEATERS;
+ return -1;
+ }
+ break;
+#endif /* ! NETSNMP_NOTIFY_ONLY */
+
+ case SNMP_MSG_TRAP:
+ /*
+ * *only* supported in SNMPv1 and SNMPsec
+ */
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (pdu->version != SNMP_VERSION_1) {
+ session->s_snmp_errno = SNMPERR_V1_IN_V2;
+ return -1;
+ }
+#endif
+ /*
+ * initialize defaulted Trap PDU fields
+ */
+ pdu->reqid = 1; /* give a bogus non-error reqid for traps */
+ if (pdu->enterprise_length == SNMP_DEFAULT_ENTERPRISE_LENGTH) {
+ pdu->enterprise = (oid *) malloc(sizeof(DEFAULT_ENTERPRISE));
+ if (pdu->enterprise == NULL) {
+ session->s_snmp_errno = SNMPERR_MALLOC;
+ return -1;
+ }
+ memmove(pdu->enterprise, DEFAULT_ENTERPRISE,
+ sizeof(DEFAULT_ENTERPRISE));
+ pdu->enterprise_length =
+ sizeof(DEFAULT_ENTERPRISE) / sizeof(oid);
+ }
+ if (pdu->time == SNMP_DEFAULT_TIME)
+ pdu->time = DEFAULT_TIME;
+ /*
+ * don't expect a response
+ */
+ pdu->flags &= (~UCD_MSG_FLAG_EXPECT_RESPONSE);
+ break;
+
+ case SNMP_MSG_REPORT: /* SNMPv3 only */
+ default:
+ session->s_snmp_errno = SNMPERR_UNKNOWN_PDU;
+ return -1;
+ }
+
+ /*
+ * save length
+ */
+ length = *pkt_len;
+
+ /*
+ * setup administrative fields based on version
+ */
+ /*
+ * build the message wrapper and all the administrative fields
+ * upto the PDU sequence
+ * (note that actual length of message will be inserted later)
+ */
+ switch (pdu->version) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+#endif
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+#ifdef NETSNMP_NO_ZEROLENGTH_COMMUNITY
+ if (pdu->community_len == 0) {
+ if (session->community_len == 0) {
+ session->s_snmp_errno = SNMPERR_BAD_COMMUNITY;
+ return -1;
+ }
+ pdu->community = (u_char *) malloc(session->community_len);
+ if (pdu->community == NULL) {
+ session->s_snmp_errno = SNMPERR_MALLOC;
+ return -1;
+ }
+ memmove(pdu->community,
+ session->community, session->community_len);
+ pdu->community_len = session->community_len;
+ }
+#else /* !NETSNMP_NO_ZEROLENGTH_COMMUNITY */
+ if (pdu->community_len == 0 && pdu->command != SNMP_MSG_RESPONSE) {
+ /*
+ * copy session community exactly to pdu community
+ */
+ if (0 == session->community_len) {
+ SNMP_FREE(pdu->community);
+ } else if (pdu->community_len == session->community_len) {
+ memmove(pdu->community,
+ session->community, session->community_len);
+ } else {
+ SNMP_FREE(pdu->community);
+ pdu->community = (u_char *) malloc(session->community_len);
+ if (pdu->community == NULL) {
+ session->s_snmp_errno = SNMPERR_MALLOC;
+ return -1;
+ }
+ memmove(pdu->community,
+ session->community, session->community_len);
+ }
+ pdu->community_len = session->community_len;
+ }
+#endif /* !NETSNMP_NO_ZEROLENGTH_COMMUNITY */
+
+ DEBUGMSGTL(("snmp_send", "Building SNMPv%ld message...\n",
+ (1 + pdu->version)));
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_REVERSE_ENCODE)) {
+ DEBUGPRINTPDUTYPE("send", pdu->command);
+ rc = snmp_pdu_realloc_rbuild(pkt, pkt_len, offset, pdu);
+ if (rc == 0) {
+ return -1;
+ }
+
+ DEBUGDUMPHEADER("send", "Community String");
+ rc = asn_realloc_rbuild_string(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ pdu->community,
+ pdu->community_len);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return -1;
+ }
+
+
+ /*
+ * Store the version field.
+ */
+ DEBUGDUMPHEADER("send", "SNMP Version Number");
+
+ version = pdu->version;
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_INTEGER),
+ (long *) &version,
+ sizeof(version));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return -1;
+ }
+
+ /*
+ * Build the final sequence.
+ */
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (pdu->version == SNMP_VERSION_1) {
+ DEBUGDUMPSECTION("send", "SNMPv1 Message");
+ } else {
+#endif
+ DEBUGDUMPSECTION("send", "SNMPv2c Message");
+#ifndef NETSNMP_DISABLE_SNMPV1
+ }
+#endif
+ rc = asn_realloc_rbuild_sequence(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR),
+ *offset - start_offset);
+ DEBUGINDENTLESS();
+
+ if (rc == 0) {
+ return -1;
+ }
+ return 0;
+ } else {
+
+#endif /* NETSNMP_USE_REVERSE_ASNENCODING */
+ /*
+ * Save current location and build SEQUENCE tag and length
+ * placeholder for SNMP message sequence
+ * (actual length will be inserted later)
+ */
+ cp = asn_build_sequence(*pkt, pkt_len,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR), 0);
+ if (cp == NULL) {
+ return -1;
+ }
+ h0e = cp;
+
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (pdu->version == SNMP_VERSION_1) {
+ DEBUGDUMPSECTION("send", "SNMPv1 Message");
+ } else {
+#endif
+ DEBUGDUMPSECTION("send", "SNMPv2c Message");
+#ifndef NETSNMP_DISABLE_SNMPV1
+ }
+#endif
+
+ /*
+ * store the version field
+ */
+ DEBUGDUMPHEADER("send", "SNMP Version Number");
+
+ version = pdu->version;
+ cp = asn_build_int(cp, pkt_len,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), (long *) &version,
+ sizeof(version));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return -1;
+
+ /*
+ * store the community string
+ */
+ DEBUGDUMPHEADER("send", "Community String");
+ cp = asn_build_string(cp, pkt_len,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), pdu->community,
+ pdu->community_len);
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return -1;
+ break;
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ }
+#endif /* NETSNMP_USE_REVERSE_ASNENCODING */
+ break;
+#endif /* support for community based SNMP */
+ case SNMP_VERSION_2p:
+ case SNMP_VERSION_sec:
+ case SNMP_VERSION_2u:
+ case SNMP_VERSION_2star:
+ default:
+ session->s_snmp_errno = SNMPERR_BAD_VERSION;
+ return -1;
+ }
+
+ DEBUGPRINTPDUTYPE("send", pdu->command);
+ cp = snmp_pdu_build(pdu, cp, pkt_len);
+ DEBUGINDENTADD(-4); /* return from entire v1/v2c message */
+ if (cp == NULL)
+ return -1;
+
+ /*
+ * insert the actual length of the message sequence
+ */
+ switch (pdu->version) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+#endif
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ asn_build_sequence(*pkt, &length,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ cp - h0e);
+ break;
+#endif /* support for community based SNMP */
+
+ case SNMP_VERSION_2p:
+ case SNMP_VERSION_sec:
+ case SNMP_VERSION_2u:
+ case SNMP_VERSION_2star:
+ default:
+ session->s_snmp_errno = SNMPERR_BAD_VERSION;
+ return -1;
+ }
+ *pkt_len = cp - *pkt;
+ return 0;
+}
+
+int
+snmp_build(u_char ** pkt, size_t * pkt_len, size_t * offset,
+ netsnmp_session * pss, netsnmp_pdu *pdu)
+{
+ int rc;
+ rc = _snmp_build(pkt, pkt_len, offset, pss, pdu);
+ if (rc) {
+ if (!pss->s_snmp_errno) {
+ snmp_log(LOG_ERR, "snmp_build: unknown failure");
+ pss->s_snmp_errno = SNMPERR_BAD_ASN1_BUILD;
+ }
+ SET_SNMP_ERROR(pss->s_snmp_errno);
+ rc = -1;
+ }
+ return rc;
+}
+
+/*
+ * on error, returns NULL (likely an encoding problem).
+ */
+u_char *
+snmp_pdu_build(netsnmp_pdu *pdu, u_char * cp, size_t * out_length)
+{
+ u_char *h1, *h1e, *h2, *h2e;
+ netsnmp_variable_list *vp;
+ size_t length;
+
+ length = *out_length;
+ /*
+ * Save current location and build PDU tag and length placeholder
+ * (actual length will be inserted later)
+ */
+ h1 = cp;
+ cp = asn_build_sequence(cp, out_length, (u_char) pdu->command, 0);
+ if (cp == NULL)
+ return NULL;
+ h1e = cp;
+
+ /*
+ * store fields in the PDU preceeding the variable-bindings sequence
+ */
+ if (pdu->command != SNMP_MSG_TRAP) {
+ /*
+ * PDU is not an SNMPv1 trap
+ */
+
+ DEBUGDUMPHEADER("send", "request_id");
+ /*
+ * request id
+ */
+ cp = asn_build_int(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &pdu->reqid,
+ sizeof(pdu->reqid));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ /*
+ * error status (getbulk non-repeaters)
+ */
+ DEBUGDUMPHEADER("send", "error status");
+ cp = asn_build_int(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &pdu->errstat,
+ sizeof(pdu->errstat));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ /*
+ * error index (getbulk max-repetitions)
+ */
+ DEBUGDUMPHEADER("send", "error index");
+ cp = asn_build_int(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &pdu->errindex,
+ sizeof(pdu->errindex));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+ } else {
+ /*
+ * an SNMPv1 trap PDU
+ */
+
+ /*
+ * enterprise
+ */
+ DEBUGDUMPHEADER("send", "enterprise OBJID");
+ cp = asn_build_objid(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OBJECT_ID),
+ (oid *) pdu->enterprise,
+ pdu->enterprise_length);
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ /*
+ * agent-addr
+ */
+ DEBUGDUMPHEADER("send", "agent Address");
+ cp = asn_build_string(cp, out_length,
+ (u_char) (ASN_IPADDRESS | ASN_PRIMITIVE),
+ (u_char *) pdu->agent_addr, 4);
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ /*
+ * generic trap
+ */
+ DEBUGDUMPHEADER("send", "generic trap number");
+ cp = asn_build_int(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER),
+ (long *) &pdu->trap_type,
+ sizeof(pdu->trap_type));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ /*
+ * specific trap
+ */
+ DEBUGDUMPHEADER("send", "specific trap number");
+ cp = asn_build_int(cp, out_length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER),
+ (long *) &pdu->specific_type,
+ sizeof(pdu->specific_type));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+
+ /*
+ * timestamp
+ */
+ DEBUGDUMPHEADER("send", "timestamp");
+ cp = asn_build_unsigned_int(cp, out_length,
+ (u_char) (ASN_TIMETICKS |
+ ASN_PRIMITIVE), &pdu->time,
+ sizeof(pdu->time));
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+ }
+
+ /*
+ * Save current location and build SEQUENCE tag and length placeholder
+ * for variable-bindings sequence
+ * (actual length will be inserted later)
+ */
+ h2 = cp;
+ cp = asn_build_sequence(cp, out_length,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), 0);
+ if (cp == NULL)
+ return NULL;
+ h2e = cp;
+
+ /*
+ * Store variable-bindings
+ */
+ DEBUGDUMPSECTION("send", "VarBindList");
+ for (vp = pdu->variables; vp; vp = vp->next_variable) {
+ DEBUGDUMPSECTION("send", "VarBind");
+ cp = snmp_build_var_op(cp, vp->name, &vp->name_length, vp->type,
+ vp->val_len, (u_char *) vp->val.string,
+ out_length);
+ DEBUGINDENTLESS();
+ if (cp == NULL)
+ return NULL;
+ }
+ DEBUGINDENTLESS();
+
+ /*
+ * insert actual length of variable-bindings sequence
+ */
+ asn_build_sequence(h2, &length,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ cp - h2e);
+
+ /*
+ * insert actual length of PDU sequence
+ */
+ asn_build_sequence(h1, &length, (u_char) pdu->command, cp - h1e);
+
+ return cp;
+}
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+/*
+ * On error, returns 0 (likely an encoding problem).
+ */
+int
+snmp_pdu_realloc_rbuild(u_char ** pkt, size_t * pkt_len, size_t * offset,
+ netsnmp_pdu *pdu)
+{
+#ifndef VPCACHE_SIZE
+#define VPCACHE_SIZE 50
+#endif
+ netsnmp_variable_list *vpcache[VPCACHE_SIZE];
+ netsnmp_variable_list *vp, *tmpvp;
+ size_t start_offset = *offset;
+ int i, wrapped = 0, notdone, final, rc = 0;
+
+ DEBUGMSGTL(("snmp_pdu_realloc_rbuild", "starting\n"));
+ for (vp = pdu->variables, i = VPCACHE_SIZE - 1; vp;
+ vp = vp->next_variable, i--) {
+ if (i < 0) {
+ wrapped = notdone = 1;
+ i = VPCACHE_SIZE - 1;
+ DEBUGMSGTL(("snmp_pdu_realloc_rbuild", "wrapped\n"));
+ }
+ vpcache[i] = vp;
+ }
+ final = i + 1;
+
+ do {
+ for (i = final; i < VPCACHE_SIZE; i++) {
+ vp = vpcache[i];
+ DEBUGDUMPSECTION("send", "VarBind");
+ rc = snmp_realloc_rbuild_var_op(pkt, pkt_len, offset, 1,
+ vp->name, &vp->name_length,
+ vp->type,
+ (u_char *) vp->val.string,
+ vp->val_len);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+ }
+
+ DEBUGINDENTLESS();
+ if (wrapped) {
+ notdone = 1;
+ for (i = 0; i < final; i++) {
+ vp = vpcache[i];
+ DEBUGDUMPSECTION("send", "VarBind");
+ rc = snmp_realloc_rbuild_var_op(pkt, pkt_len, offset, 1,
+ vp->name, &vp->name_length,
+ vp->type,
+ (u_char *) vp->val.string,
+ vp->val_len);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+ }
+
+ if (final == 0) {
+ tmpvp = vpcache[VPCACHE_SIZE - 1];
+ } else {
+ tmpvp = vpcache[final - 1];
+ }
+ wrapped = 0;
+
+ for (vp = pdu->variables, i = VPCACHE_SIZE - 1;
+ vp && vp != tmpvp; vp = vp->next_variable, i--) {
+ if (i < 0) {
+ wrapped = 1;
+ i = VPCACHE_SIZE - 1;
+ DEBUGMSGTL(("snmp_pdu_realloc_rbuild", "wrapped\n"));
+ }
+ vpcache[i] = vp;
+ }
+ final = i + 1;
+ } else {
+ notdone = 0;
+ }
+ } while (notdone);
+
+ /*
+ * Save current location and build SEQUENCE tag and length placeholder for
+ * variable-bindings sequence (actual length will be inserted later).
+ */
+
+ rc = asn_realloc_rbuild_sequence(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR),
+ *offset - start_offset);
+
+ /*
+ * Store fields in the PDU preceeding the variable-bindings sequence.
+ */
+ if (pdu->command != SNMP_MSG_TRAP) {
+ /*
+ * Error index (getbulk max-repetitions).
+ */
+ DEBUGDUMPHEADER("send", "error index");
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_INTEGER),
+ &pdu->errindex, sizeof(pdu->errindex));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * Error status (getbulk non-repeaters).
+ */
+ DEBUGDUMPHEADER("send", "error status");
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_INTEGER),
+ &pdu->errstat, sizeof(pdu->errstat));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * Request ID.
+ */
+ DEBUGDUMPHEADER("send", "request_id");
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_INTEGER), &pdu->reqid,
+ sizeof(pdu->reqid));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+ } else {
+ /*
+ * An SNMPv1 trap PDU.
+ */
+
+ /*
+ * Timestamp.
+ */
+ DEBUGDUMPHEADER("send", "timestamp");
+ rc = asn_realloc_rbuild_unsigned_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_TIMETICKS |
+ ASN_PRIMITIVE),
+ &pdu->time,
+ sizeof(pdu->time));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * Specific trap.
+ */
+ DEBUGDUMPHEADER("send", "specific trap number");
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_INTEGER),
+ (long *) &pdu->specific_type,
+ sizeof(pdu->specific_type));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * Generic trap.
+ */
+ DEBUGDUMPHEADER("send", "generic trap number");
+ rc = asn_realloc_rbuild_int(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_INTEGER),
+ (long *) &pdu->trap_type,
+ sizeof(pdu->trap_type));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * Agent-addr.
+ */
+ DEBUGDUMPHEADER("send", "agent Address");
+ rc = asn_realloc_rbuild_string(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_IPADDRESS |
+ ASN_PRIMITIVE),
+ (u_char *) pdu->agent_addr, 4);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+
+ /*
+ * Enterprise.
+ */
+ DEBUGDUMPHEADER("send", "enterprise OBJID");
+ rc = asn_realloc_rbuild_objid(pkt, pkt_len, offset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_OBJECT_ID),
+ (oid *) pdu->enterprise,
+ pdu->enterprise_length);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ return 0;
+ }
+ }
+
+ /*
+ * Build the PDU sequence.
+ */
+ rc = asn_realloc_rbuild_sequence(pkt, pkt_len, offset, 1,
+ (u_char) pdu->command,
+ *offset - start_offset);
+ return rc;
+}
+#endif /* NETSNMP_USE_REVERSE_ASNENCODING */
+
+/*
+ * Parses the packet received to determine version, either directly
+ * from packets version field or inferred from ASN.1 construct.
+ */
+static int
+snmp_parse_version(u_char * data, size_t length)
+{
+ u_char type;
+ long version = SNMPERR_BAD_VERSION;
+
+ data = asn_parse_sequence(data, &length, &type,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR), "version");
+ if (data) {
+ DEBUGDUMPHEADER("recv", "SNMP Version");
+ data =
+ asn_parse_int(data, &length, &type, &version, sizeof(version));
+ DEBUGINDENTLESS();
+ if (!data || type != ASN_INTEGER) {
+ return SNMPERR_BAD_VERSION;
+ }
+ }
+ return version;
+}
+
+
+int
+snmpv3_parse(netsnmp_pdu *pdu,
+ u_char * data,
+ size_t * length,
+ u_char ** after_header, netsnmp_session * sess)
+{
+ u_char type, msg_flags;
+ long ver, msg_max_size, msg_sec_model;
+ size_t max_size_response;
+ u_char tmp_buf[SNMP_MAX_MSG_SIZE];
+ size_t tmp_buf_len;
+ u_char pdu_buf[SNMP_MAX_MSG_SIZE];
+ u_char *mallocbuf = NULL;
+ size_t pdu_buf_len = SNMP_MAX_MSG_SIZE;
+ u_char *sec_params;
+ u_char *msg_data;
+ u_char *cp;
+ size_t asn_len, msg_len;
+ int ret, ret_val;
+ struct snmp_secmod_def *sptr;
+
+
+ msg_data = data;
+ msg_len = *length;
+
+
+ /*
+ * message is an ASN.1 SEQUENCE
+ */
+ DEBUGDUMPSECTION("recv", "SNMPv3 Message");
+ data = asn_parse_sequence(data, length, &type,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR), "message");
+ if (data == NULL) {
+ /*
+ * error msg detail is set
+ */
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTLESS();
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+
+ /*
+ * parse msgVersion
+ */
+ DEBUGDUMPHEADER("recv", "SNMP Version Number");
+ data = asn_parse_int(data, length, &type, &ver, sizeof(ver));
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ ERROR_MSG("bad parse of version");
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTLESS();
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+ pdu->version = ver;
+
+ /*
+ * parse msgGlobalData sequence
+ */
+ cp = data;
+ asn_len = *length;
+ DEBUGDUMPSECTION("recv", "msgGlobalData");
+ data = asn_parse_sequence(data, &asn_len, &type,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ "msgGlobalData");
+ if (data == NULL) {
+ /*
+ * error msg detail is set
+ */
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTADD(-4);
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+ *length -= data - cp; /* subtract off the length of the header */
+
+ /*
+ * msgID
+ */
+ DEBUGDUMPHEADER("recv", "msgID");
+ data =
+ asn_parse_int(data, length, &type, &pdu->msgid,
+ sizeof(pdu->msgid));
+ DEBUGINDENTLESS();
+ if (data == NULL || type != ASN_INTEGER) {
+ ERROR_MSG("error parsing msgID");
+ DEBUGINDENTADD(-4);
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+
+ /*
+ * Check the msgID we received is a legal value. If not, then increment
+ * snmpInASNParseErrs and return the appropriate error (see RFC 2572,
+ * para. 7.2, section 2 -- note that a bad msgID means that the received
+ * message is NOT a serialiization of an SNMPv3Message, since the msgID
+ * field is out of bounds).
+ */
+
+ if (pdu->msgid < 0 || pdu->msgid > 0x7fffffff) {
+ snmp_log(LOG_ERR, "Received bad msgID (%ld %s %s).\n", pdu->msgid,
+ (pdu->msgid < 0) ? "<" : ">",
+ (pdu->msgid < 0) ? "0" : "2^31 - 1");
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTADD(-4);
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+
+ /*
+ * msgMaxSize
+ */
+ DEBUGDUMPHEADER("recv", "msgMaxSize");
+ data = asn_parse_int(data, length, &type, &msg_max_size,
+ sizeof(msg_max_size));
+ DEBUGINDENTLESS();
+ if (data == NULL || type != ASN_INTEGER) {
+ ERROR_MSG("error parsing msgMaxSize");
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTADD(-4);
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+
+ /*
+ * Check the msgMaxSize we received is a legal value. If not, then
+ * increment snmpInASNParseErrs and return the appropriate error (see RFC
+ * 2572, para. 7.2, section 2 -- note that a bad msgMaxSize means that the
+ * received message is NOT a serialiization of an SNMPv3Message, since the
+ * msgMaxSize field is out of bounds).
+ *
+ * Note we store the msgMaxSize on a per-session basis which also seems
+ * reasonable; it could vary from PDU to PDU but that would be strange
+ * (also since we deal with a PDU at a time, it wouldn't make any
+ * difference to our responses, if any).
+ */
+
+ if (msg_max_size < 484) {
+ snmp_log(LOG_ERR, "Received bad msgMaxSize (%lu < 484).\n",
+ msg_max_size);
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTADD(-4);
+ return SNMPERR_ASN_PARSE_ERR;
+ } else if (msg_max_size > 0x7fffffff) {
+ snmp_log(LOG_ERR, "Received bad msgMaxSize (%lu > 2^31 - 1).\n",
+ msg_max_size);
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTADD(-4);
+ return SNMPERR_ASN_PARSE_ERR;
+ } else {
+ DEBUGMSGTL(("snmpv3_parse", "msgMaxSize %lu received\n",
+ msg_max_size));
+ sess->sndMsgMaxSize = msg_max_size;
+ }
+
+ /*
+ * msgFlags
+ */
+ tmp_buf_len = SNMP_MAX_MSG_SIZE;
+ DEBUGDUMPHEADER("recv", "msgFlags");
+ data = asn_parse_string(data, length, &type, tmp_buf, &tmp_buf_len);
+ DEBUGINDENTLESS();
+ if (data == NULL || type != ASN_OCTET_STR || tmp_buf_len != 1) {
+ ERROR_MSG("error parsing msgFlags");
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTADD(-4);
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+ msg_flags = *tmp_buf;
+ if (msg_flags & SNMP_MSG_FLAG_RPRT_BIT)
+ pdu->flags |= SNMP_MSG_FLAG_RPRT_BIT;
+ else
+ pdu->flags &= (~SNMP_MSG_FLAG_RPRT_BIT);
+
+ /*
+ * msgSecurityModel
+ */
+ DEBUGDUMPHEADER("recv", "msgSecurityModel");
+ data = asn_parse_int(data, length, &type, &msg_sec_model,
+ sizeof(msg_sec_model));
+ DEBUGINDENTADD(-4); /* return from global data indent */
+ if (data == NULL || type != ASN_INTEGER ||
+ msg_sec_model < 1 || msg_sec_model > 0x7fffffff) {
+ ERROR_MSG("error parsing msgSecurityModel");
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTLESS();
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+ sptr = find_sec_mod(msg_sec_model);
+ if (!sptr) {
+ snmp_log(LOG_WARNING, "unknown security model: %ld\n",
+ msg_sec_model);
+ snmp_increment_statistic(STAT_SNMPUNKNOWNSECURITYMODELS);
+ DEBUGINDENTLESS();
+ return SNMPERR_UNKNOWN_SEC_MODEL;
+ }
+ pdu->securityModel = msg_sec_model;
+
+ if (msg_flags & SNMP_MSG_FLAG_PRIV_BIT &&
+ !(msg_flags & SNMP_MSG_FLAG_AUTH_BIT)) {
+ ERROR_MSG("invalid message, illegal msgFlags");
+ snmp_increment_statistic(STAT_SNMPINVALIDMSGS);
+ DEBUGINDENTLESS();
+ return SNMPERR_INVALID_MSG;
+ }
+ pdu->securityLevel = ((msg_flags & SNMP_MSG_FLAG_AUTH_BIT)
+ ? ((msg_flags & SNMP_MSG_FLAG_PRIV_BIT)
+ ? SNMP_SEC_LEVEL_AUTHPRIV
+ : SNMP_SEC_LEVEL_AUTHNOPRIV)
+ : SNMP_SEC_LEVEL_NOAUTH);
+ /*
+ * end of msgGlobalData
+ */
+
+ /*
+ * securtityParameters OCTET STRING begins after msgGlobalData
+ */
+ sec_params = data;
+ pdu->contextEngineID = (u_char *) calloc(1, SNMP_MAX_ENG_SIZE);
+ pdu->contextEngineIDLen = SNMP_MAX_ENG_SIZE;
+
+ /*
+ * Note: there is no length limit on the msgAuthoritativeEngineID field,
+ * although we would EXPECT it to be limited to 32 (the SnmpEngineID TC
+ * limit). We'll use double that here to be on the safe side.
+ */
+
+ pdu->securityEngineID = (u_char *) calloc(1, SNMP_MAX_ENG_SIZE * 2);
+ pdu->securityEngineIDLen = SNMP_MAX_ENG_SIZE * 2;
+ pdu->securityName = (char *) calloc(1, SNMP_MAX_SEC_NAME_SIZE);
+ pdu->securityNameLen = SNMP_MAX_SEC_NAME_SIZE;
+
+ if ((pdu->securityName == NULL) ||
+ (pdu->securityEngineID == NULL) ||
+ (pdu->contextEngineID == NULL)) {
+ return SNMPERR_MALLOC;
+ }
+
+ if (pdu_buf_len < msg_len
+ && pdu->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ /*
+ * space needed is larger than we have in the default buffer
+ */
+ mallocbuf = (u_char *) calloc(1, msg_len);
+ pdu_buf_len = msg_len;
+ cp = mallocbuf;
+ } else {
+ memset(pdu_buf, 0, pdu_buf_len);
+ cp = pdu_buf;
+ }
+
+ DEBUGDUMPSECTION("recv", "SM msgSecurityParameters");
+ if (sptr->decode) {
+ struct snmp_secmod_incoming_params parms;
+ parms.msgProcModel = pdu->msgParseModel;
+ parms.maxMsgSize = msg_max_size;
+ parms.secParams = sec_params;
+ parms.secModel = msg_sec_model;
+ parms.secLevel = pdu->securityLevel;
+ parms.wholeMsg = msg_data;
+ parms.wholeMsgLen = msg_len;
+ parms.secEngineID = pdu->securityEngineID;
+ parms.secEngineIDLen = &pdu->securityEngineIDLen;
+ parms.secName = pdu->securityName;
+ parms.secNameLen = &pdu->securityNameLen;
+ parms.scopedPdu = &cp;
+ parms.scopedPduLen = &pdu_buf_len;
+ parms.maxSizeResponse = &max_size_response;
+ parms.secStateRef = &pdu->securityStateRef;
+ parms.sess = sess;
+ parms.pdu = pdu;
+ parms.msg_flags = msg_flags;
+ ret_val = (*sptr->decode) (&parms);
+ } else {
+ SNMP_FREE(mallocbuf);
+ DEBUGINDENTLESS();
+ snmp_log(LOG_WARNING, "security service %ld can't decode packets\n",
+ msg_sec_model);
+ return (-1);
+ }
+
+ if (ret_val != SNMPERR_SUCCESS) {
+ DEBUGDUMPSECTION("recv", "ScopedPDU");
+ /*
+ * Parse as much as possible -- though I don't see the point? [jbpn].
+ */
+ if (cp) {
+ cp = snmpv3_scopedPDU_parse(pdu, cp, &pdu_buf_len);
+ }
+ if (cp) {
+ DEBUGPRINTPDUTYPE("recv", *cp);
+ snmp_pdu_parse(pdu, cp, &pdu_buf_len);
+ DEBUGINDENTADD(-8);
+ } else {
+ DEBUGINDENTADD(-4);
+ }
+
+ SNMP_FREE(mallocbuf);
+ return ret_val;
+ }
+
+ /*
+ * parse plaintext ScopedPDU sequence
+ */
+ *length = pdu_buf_len;
+ DEBUGDUMPSECTION("recv", "ScopedPDU");
+ data = snmpv3_scopedPDU_parse(pdu, cp, length);
+ if (data == NULL) {
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ DEBUGINDENTADD(-4);
+ SNMP_FREE(mallocbuf);
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+
+ /*
+ * parse the PDU.
+ */
+ if (after_header != NULL) {
+ *after_header = data;
+ tmp_buf_len = *length;
+ }
+
+ DEBUGPRINTPDUTYPE("recv", *data);
+ ret = snmp_pdu_parse(pdu, data, length);
+ DEBUGINDENTADD(-8);
+
+ if (after_header != NULL) {
+ *length = tmp_buf_len;
+ }
+
+ if (ret != SNMPERR_SUCCESS) {
+ ERROR_MSG("error parsing PDU");
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ SNMP_FREE(mallocbuf);
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+
+ SNMP_FREE(mallocbuf);
+ return SNMPERR_SUCCESS;
+} /* end snmpv3_parse() */
+
+#define ERROR_STAT_LENGTH 11
+
+int
+snmpv3_make_report(netsnmp_pdu *pdu, int error)
+{
+
+ long ltmp;
+ static oid unknownSecurityLevel[] =
+ { 1, 3, 6, 1, 6, 3, 15, 1, 1, 1, 0 };
+ static oid notInTimeWindow[] =
+ { 1, 3, 6, 1, 6, 3, 15, 1, 1, 2, 0 };
+ static oid unknownUserName[] =
+ { 1, 3, 6, 1, 6, 3, 15, 1, 1, 3, 0 };
+ static oid unknownEngineID[] =
+ { 1, 3, 6, 1, 6, 3, 15, 1, 1, 4, 0 };
+ static oid wrongDigest[] = { 1, 3, 6, 1, 6, 3, 15, 1, 1, 5, 0 };
+ static oid decryptionError[] =
+ { 1, 3, 6, 1, 6, 3, 15, 1, 1, 6, 0 };
+ oid *err_var;
+ int err_var_len;
+ int stat_ind;
+ struct snmp_secmod_def *sptr;
+
+ switch (error) {
+ case SNMPERR_USM_UNKNOWNENGINEID:
+ stat_ind = STAT_USMSTATSUNKNOWNENGINEIDS;
+ err_var = unknownEngineID;
+ err_var_len = ERROR_STAT_LENGTH;
+ break;
+ case SNMPERR_USM_UNKNOWNSECURITYNAME:
+ stat_ind = STAT_USMSTATSUNKNOWNUSERNAMES;
+ err_var = unknownUserName;
+ err_var_len = ERROR_STAT_LENGTH;
+ break;
+ case SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL:
+ stat_ind = STAT_USMSTATSUNSUPPORTEDSECLEVELS;
+ err_var = unknownSecurityLevel;
+ err_var_len = ERROR_STAT_LENGTH;
+ break;
+ case SNMPERR_USM_AUTHENTICATIONFAILURE:
+ stat_ind = STAT_USMSTATSWRONGDIGESTS;
+ err_var = wrongDigest;
+ err_var_len = ERROR_STAT_LENGTH;
+ break;
+ case SNMPERR_USM_NOTINTIMEWINDOW:
+ stat_ind = STAT_USMSTATSNOTINTIMEWINDOWS;
+ err_var = notInTimeWindow;
+ err_var_len = ERROR_STAT_LENGTH;
+ break;
+ case SNMPERR_USM_DECRYPTIONERROR:
+ stat_ind = STAT_USMSTATSDECRYPTIONERRORS;
+ err_var = decryptionError;
+ err_var_len = ERROR_STAT_LENGTH;
+ break;
+ default:
+ return SNMPERR_GENERR;
+ }
+
+ snmp_free_varbind(pdu->variables); /* free the current varbind */
+
+ pdu->variables = NULL;
+ SNMP_FREE(pdu->securityEngineID);
+ pdu->securityEngineID =
+ snmpv3_generate_engineID(&pdu->securityEngineIDLen);
+ SNMP_FREE(pdu->contextEngineID);
+ pdu->contextEngineID =
+ snmpv3_generate_engineID(&pdu->contextEngineIDLen);
+ pdu->command = SNMP_MSG_REPORT;
+ pdu->errstat = 0;
+ pdu->errindex = 0;
+ SNMP_FREE(pdu->contextName);
+ pdu->contextName = strdup("");
+ pdu->contextNameLen = strlen(pdu->contextName);
+
+ /*
+ * reports shouldn't cache previous data.
+ */
+ /*
+ * FIX - yes they should but USM needs to follow new EoP to determine
+ * which cached values to use
+ */
+ if (pdu->securityStateRef) {
+ sptr = find_sec_mod(pdu->securityModel);
+ if (sptr) {
+ if (sptr->pdu_free_state_ref) {
+ (*sptr->pdu_free_state_ref) (pdu->securityStateRef);
+ } else {
+ snmp_log(LOG_ERR,
+ "Security Model %d can't free state references\n",
+ pdu->securityModel);
+ }
+ } else {
+ snmp_log(LOG_ERR,
+ "Can't find security model to free ptr: %d\n",
+ pdu->securityModel);
+ }
+ pdu->securityStateRef = NULL;
+ }
+
+ if (error == SNMPERR_USM_NOTINTIMEWINDOW) {
+ pdu->securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
+ } else {
+ pdu->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
+ }
+
+ /*
+ * find the appropriate error counter
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_STATISTICS
+ ltmp = snmp_get_statistic(stat_ind);
+#else /* !NETSNMP_FEATURE_REMOVE_STATISTICS */
+ ltmp = 1;
+#endif /* !NETSNMP_FEATURE_REMOVE_STATISTICS */
+
+ /*
+ * return the appropriate error counter
+ */
+ snmp_pdu_add_variable(pdu, err_var, err_var_len,
+ ASN_COUNTER, & ltmp, sizeof(ltmp));
+
+ return SNMPERR_SUCCESS;
+} /* end snmpv3_make_report() */
+
+
+int
+snmpv3_get_report_type(netsnmp_pdu *pdu)
+{
+ static oid snmpMPDStats[] = { 1, 3, 6, 1, 6, 3, 11, 2, 1 };
+ static oid targetStats[] = { 1, 3, 6, 1, 6, 3, 12, 1 };
+ static oid usmStats[] = { 1, 3, 6, 1, 6, 3, 15, 1, 1 };
+ netsnmp_variable_list *vp;
+ int rpt_type = SNMPERR_UNKNOWN_REPORT;
+
+ if (pdu == NULL || pdu->variables == NULL)
+ return rpt_type;
+ vp = pdu->variables;
+ /* MPD or USM based report statistics objects have the same length prefix
+ * so the actual statistics OID will have this length,
+ * plus one subidentifier for the scalar MIB object itself,
+ * and one for the instance subidentifier
+ */
+ if (vp->name_length == REPORT_STATS_LEN + 2) {
+ if (memcmp(snmpMPDStats, vp->name, REPORT_STATS_LEN * sizeof(oid)) == 0) {
+ switch (vp->name[REPORT_STATS_LEN]) {
+ case REPORT_snmpUnknownSecurityModels_NUM:
+ rpt_type = SNMPERR_UNKNOWN_SEC_MODEL;
+ break;
+ case REPORT_snmpInvalidMsgs_NUM:
+ rpt_type = SNMPERR_INVALID_MSG;
+ break;
+ case REPORT_snmpUnknownPDUHandlers_NUM:
+ rpt_type = SNMPERR_BAD_VERSION;
+ break;
+ }
+ } else if (memcmp(usmStats, vp->name, REPORT_STATS_LEN * sizeof(oid)) == 0) {
+ switch (vp->name[REPORT_STATS_LEN]) {
+ case REPORT_usmStatsUnsupportedSecLevels_NUM:
+ rpt_type = SNMPERR_UNSUPPORTED_SEC_LEVEL;
+ break;
+ case REPORT_usmStatsNotInTimeWindows_NUM:
+ rpt_type = SNMPERR_NOT_IN_TIME_WINDOW;
+ break;
+ case REPORT_usmStatsUnknownUserNames_NUM:
+ rpt_type = SNMPERR_UNKNOWN_USER_NAME;
+ break;
+ case REPORT_usmStatsUnknownEngineIDs_NUM:
+ rpt_type = SNMPERR_UNKNOWN_ENG_ID;
+ break;
+ case REPORT_usmStatsWrongDigests_NUM:
+ rpt_type = SNMPERR_AUTHENTICATION_FAILURE;
+ break;
+ case REPORT_usmStatsDecryptionErrors_NUM:
+ rpt_type = SNMPERR_DECRYPTION_ERR;
+ break;
+ }
+ }
+ }
+ /* Context-based report statistics from the Target MIB are similar
+ * but the OID prefix has a different length
+ */
+ if (vp->name_length == REPORT_STATS_LEN2 + 2) {
+ if (memcmp(targetStats, vp->name, REPORT_STATS_LEN2 * sizeof(oid)) == 0) {
+ switch (vp->name[REPORT_STATS_LEN2]) {
+ case REPORT_snmpUnavailableContexts_NUM:
+ rpt_type = SNMPERR_BAD_CONTEXT;
+ break;
+ case REPORT_snmpUnknownContexts_NUM:
+ rpt_type = SNMPERR_BAD_CONTEXT;
+ break;
+ }
+ }
+ }
+ DEBUGMSGTL(("report", "Report type: %d\n", rpt_type));
+ return rpt_type;
+}
+
+/*
+ * Parses the packet received on the input session, and places the data into
+ * the input pdu. length is the length of the input packet.
+ * If any errors are encountered, -1 or USM error is returned.
+ * Otherwise, a 0 is returned.
+ */
+static int
+_snmp_parse(void *sessp,
+ netsnmp_session * session,
+ netsnmp_pdu *pdu, u_char * data, size_t length)
+{
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ u_char community[COMMUNITY_MAX_LEN];
+ size_t community_length = COMMUNITY_MAX_LEN;
+#endif
+ int result = -1;
+
+ static oid snmpEngineIDoid[] = { 1,3,6,1,6,3,10,2,1,1,0};
+ static size_t snmpEngineIDoid_len = 11;
+
+ static char ourEngineID[SNMP_SEC_PARAM_BUF_SIZE];
+ static size_t ourEngineID_len = sizeof(ourEngineID);
+
+ netsnmp_pdu *pdu2 = NULL;
+
+ session->s_snmp_errno = 0;
+ session->s_errno = 0;
+
+ /*
+ * Ensure all incoming PDUs have a unique means of identification
+ * (This is not restricted to AgentX handling,
+ * though that is where the need becomes visible)
+ */
+ pdu->transid = snmp_get_next_transid();
+
+ if (session->version != SNMP_DEFAULT_VERSION) {
+ pdu->version = session->version;
+ } else {
+ pdu->version = snmp_parse_version(data, length);
+ }
+
+ switch (pdu->version) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+#endif
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ DEBUGMSGTL(("snmp_api", "Parsing SNMPv%ld message...\n",
+ (1 + pdu->version)));
+
+ /*
+ * authenticates message and returns length if valid
+ */
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (pdu->version == SNMP_VERSION_1) {
+ DEBUGDUMPSECTION("recv", "SNMPv1 message\n");
+ } else {
+#endif
+ DEBUGDUMPSECTION("recv", "SNMPv2c message\n");
+#ifndef NETSNMP_DISABLE_SNMPV1
+ }
+#endif
+ data = snmp_comstr_parse(data, &length,
+ community, &community_length,
+ &pdu->version);
+ if (data == NULL)
+ return -1;
+
+ if (pdu->version != session->version &&
+ session->version != SNMP_DEFAULT_VERSION) {
+ session->s_snmp_errno = SNMPERR_BAD_VERSION;
+ return -1;
+ }
+
+ /*
+ * maybe get the community string.
+ */
+ pdu->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
+ pdu->securityModel =
+#ifndef NETSNMP_DISABLE_SNMPV1
+ (pdu->version == SNMP_VERSION_1) ? SNMP_SEC_MODEL_SNMPv1 :
+#endif
+ SNMP_SEC_MODEL_SNMPv2c;
+ SNMP_FREE(pdu->community);
+ pdu->community_len = 0;
+ pdu->community = (u_char *) 0;
+ if (community_length) {
+ pdu->community_len = community_length;
+ pdu->community = (u_char *) malloc(community_length);
+ if (pdu->community == NULL) {
+ session->s_snmp_errno = SNMPERR_MALLOC;
+ return -1;
+ }
+ memmove(pdu->community, community, community_length);
+ }
+ if (session->authenticator) {
+ data = session->authenticator(data, &length,
+ community, community_length);
+ if (data == NULL) {
+ session->s_snmp_errno = SNMPERR_AUTHENTICATION_FAILURE;
+ return -1;
+ }
+ }
+
+ DEBUGDUMPSECTION("recv", "PDU");
+ result = snmp_pdu_parse(pdu, data, &length);
+ if (result < 0) {
+ /*
+ * This indicates a parse error.
+ */
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ }
+ DEBUGINDENTADD(-6);
+ break;
+#endif /* support for community based SNMP */
+
+ case SNMP_VERSION_3:
+ result = snmpv3_parse(pdu, data, &length, NULL, session);
+ DEBUGMSGTL(("snmp_parse",
+ "Parsed SNMPv3 message (secName:%s, secLevel:%s): %s\n",
+ pdu->securityName, secLevelName[pdu->securityLevel],
+ snmp_api_errstring(result)));
+
+ if (result) {
+ struct snmp_secmod_def *secmod =
+ find_sec_mod(pdu->securityModel);
+ if (!sessp) {
+ session->s_snmp_errno = result;
+ } else {
+ /*
+ * Call the security model to special handle any errors
+ */
+
+ if (secmod && secmod->handle_report) {
+ struct session_list *slp = (struct session_list *) sessp;
+ (*secmod->handle_report)(sessp, slp->transport, session,
+ result, pdu);
+ }
+ }
+ if (pdu->securityStateRef != NULL) {
+ if (secmod && secmod->pdu_free_state_ref) {
+ secmod->pdu_free_state_ref(pdu->securityStateRef);
+ pdu->securityStateRef = NULL;
+ }
+ }
+ }
+
+ /* Implement RFC5343 here for two reasons:
+ 1) From a security perspective it handles this otherwise
+ always approved request earlier. It bypasses the need
+ for authorization to the snmpEngineID scalar, which is
+ what is what RFC3415 appendix A species as ok. Note
+ that we haven't bypassed authentication since if there
+ was an authentication eror it would have been handled
+ above in the if(result) part at the lastet.
+ 2) From an application point of view if we let this request
+ get all the way to the application, it'd require that
+ all application types supporting discovery also fire up
+ a minimal agent in order to handle just this request
+ which seems like overkill. Though there is no other
+ application types that currently need discovery (NRs
+ accept notifications from contextEngineIDs that derive
+ from the NO not the NR). Also a lame excuse for doing
+ it here.
+ 3) Less important technically, but the net-snmp agent
+ doesn't currently handle registrations of different
+ engineIDs either and it would have been a lot more work
+ to implement there since we'd need to support that
+ first. :-/ Supporting multiple context engineIDs should
+ be done anyway, so it's not a valid excuse here.
+ 4) There is a lot less to do if we trump the agent at this
+ point; IE, the agent does a lot more unnecessary
+ processing when the only thing that should ever be in
+ this context by definition is the single scalar.
+ */
+
+ /* special RFC5343 engineID discovery engineID check */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_NO_DISCOVERY) &&
+ SNMP_MSG_RESPONSE != pdu->command &&
+ NULL != pdu->contextEngineID &&
+ pdu->contextEngineIDLen == 5 &&
+ pdu->contextEngineID[0] == 0x80 &&
+ pdu->contextEngineID[1] == 0x00 &&
+ pdu->contextEngineID[2] == 0x00 &&
+ pdu->contextEngineID[3] == 0x00 &&
+ pdu->contextEngineID[4] == 0x06) {
+
+ /* define a result so it doesn't get past us at this point
+ and gets dropped by future parts of the stack */
+ result = SNMPERR_JUST_A_CONTEXT_PROBE;
+
+ DEBUGMSGTL(("snmpv3_contextid", "starting context ID discovery\n"));
+ /* ensure exactly one variable */
+ if (NULL != pdu->variables &&
+ NULL == pdu->variables->next_variable &&
+
+ /* if it's a GET, match it exactly */
+ ((SNMP_MSG_GET == pdu->command &&
+ snmp_oid_compare(snmpEngineIDoid,
+ snmpEngineIDoid_len,
+ pdu->variables->name,
+ pdu->variables->name_length) == 0)
+ /* if it's a GETNEXT ensure it's less than the engineID oid */
+ ||
+ (SNMP_MSG_GETNEXT == pdu->command &&
+ snmp_oid_compare(snmpEngineIDoid,
+ snmpEngineIDoid_len,
+ pdu->variables->name,
+ pdu->variables->name_length) > 0)
+ )) {
+
+ DEBUGMSGTL(("snmpv3_contextid",
+ " One correct variable found\n"));
+
+ /* Note: we're explictly not handling a GETBULK. Deal. */
+
+ /* set up the response */
+ pdu2 = snmp_clone_pdu(pdu);
+
+ /* free the current varbind */
+ snmp_free_varbind(pdu2->variables);
+
+ /* set the variables */
+ pdu2->variables = NULL;
+ pdu2->command = SNMP_MSG_RESPONSE;
+ pdu2->errstat = 0;
+ pdu2->errindex = 0;
+
+ ourEngineID_len =
+ snmpv3_get_engineID((u_char*)ourEngineID, ourEngineID_len);
+ if (0 != ourEngineID_len) {
+
+ DEBUGMSGTL(("snmpv3_contextid",
+ " responding with our engineID\n"));
+
+ snmp_pdu_add_variable(pdu2,
+ snmpEngineIDoid, snmpEngineIDoid_len,
+ ASN_OCTET_STR,
+ ourEngineID, ourEngineID_len);
+
+ /* send the response */
+ if (0 == snmp_sess_send(sessp, pdu2)) {
+
+ DEBUGMSGTL(("snmpv3_contextid",
+ " sent it off!\n"));
+
+ snmp_free_pdu(pdu2);
+
+ snmp_log(LOG_ERR, "sending a response to the context engineID probe failed\n");
+ }
+ } else {
+ snmp_log(LOG_ERR, "failed to get our own engineID!\n");
+ }
+ } else {
+ snmp_log(LOG_WARNING,
+ "received an odd context engineID probe\n");
+ }
+ }
+
+ break;
+ case SNMPERR_BAD_VERSION:
+ ERROR_MSG("error parsing snmp message version");
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ session->s_snmp_errno = SNMPERR_BAD_VERSION;
+ break;
+ case SNMP_VERSION_sec:
+ case SNMP_VERSION_2u:
+ case SNMP_VERSION_2star:
+ case SNMP_VERSION_2p:
+ default:
+ ERROR_MSG("unsupported snmp message version");
+ snmp_increment_statistic(STAT_SNMPINBADVERSIONS);
+
+ /*
+ * need better way to determine OS independent
+ * INT32_MAX value, for now hardcode
+ */
+ if (pdu->version < 0 || pdu->version > 2147483647) {
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ }
+ session->s_snmp_errno = SNMPERR_BAD_VERSION;
+ break;
+ }
+
+ return result;
+}
+
+static int
+snmp_parse(void *sessp,
+ netsnmp_session * pss,
+ netsnmp_pdu *pdu, u_char * data, size_t length)
+{
+ int rc;
+
+ rc = _snmp_parse(sessp, pss, pdu, data, length);
+ if (rc) {
+ if (!pss->s_snmp_errno) {
+ pss->s_snmp_errno = SNMPERR_BAD_PARSE;
+ }
+ SET_SNMP_ERROR(pss->s_snmp_errno);
+ }
+
+ return rc;
+}
+
+int
+snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
+{
+ u_char type;
+ u_char msg_type;
+ u_char *var_val;
+ int badtype = 0;
+ size_t len;
+ size_t four;
+ netsnmp_variable_list *vp = NULL;
+ oid objid[MAX_OID_LEN];
+
+ /*
+ * Get the PDU type
+ */
+ data = asn_parse_header(data, length, &msg_type);
+ if (data == NULL)
+ return -1;
+ DEBUGMSGTL(("dumpv_recv"," Command %s\n", snmp_pdu_type(msg_type)));
+ pdu->command = msg_type;
+ pdu->flags &= (~UCD_MSG_FLAG_RESPONSE_PDU);
+
+ /*
+ * get the fields in the PDU preceeding the variable-bindings sequence
+ */
+ switch (pdu->command) {
+ case SNMP_MSG_TRAP:
+ /*
+ * enterprise
+ */
+ pdu->enterprise_length = MAX_OID_LEN;
+ data = asn_parse_objid(data, length, &type, objid,
+ &pdu->enterprise_length);
+ if (data == NULL)
+ return -1;
+ pdu->enterprise =
+ (oid *) malloc(pdu->enterprise_length * sizeof(oid));
+ if (pdu->enterprise == NULL) {
+ return -1;
+ }
+ memmove(pdu->enterprise, objid,
+ pdu->enterprise_length * sizeof(oid));
+
+ /*
+ * agent-addr
+ */
+ four = 4;
+ data = asn_parse_string(data, length, &type,
+ (u_char *) pdu->agent_addr, &four);
+ if (data == NULL)
+ return -1;
+
+ /*
+ * generic trap
+ */
+ data = asn_parse_int(data, length, &type, (long *) &pdu->trap_type,
+ sizeof(pdu->trap_type));
+ if (data == NULL)
+ return -1;
+ /*
+ * specific trap
+ */
+ data =
+ asn_parse_int(data, length, &type,
+ (long *) &pdu->specific_type,
+ sizeof(pdu->specific_type));
+ if (data == NULL)
+ return -1;
+
+ /*
+ * timestamp
+ */
+ data = asn_parse_unsigned_int(data, length, &type, &pdu->time,
+ sizeof(pdu->time));
+ if (data == NULL)
+ return -1;
+
+ break;
+
+ case SNMP_MSG_RESPONSE:
+ case SNMP_MSG_REPORT:
+ pdu->flags |= UCD_MSG_FLAG_RESPONSE_PDU;
+ /*
+ * fallthrough
+ */
+
+#ifndef NETSNMP_NOTIFY_ONLY
+ case SNMP_MSG_GET:
+ case SNMP_MSG_GETNEXT:
+ case SNMP_MSG_GETBULK:
+#endif /* ! NETSNMP_NOTIFY_ONLY */
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_SET:
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ case SNMP_MSG_TRAP2:
+ case SNMP_MSG_INFORM:
+ /*
+ * PDU is not an SNMPv1 TRAP
+ */
+
+ /*
+ * request id
+ */
+ DEBUGDUMPHEADER("recv", "request_id");
+ data = asn_parse_int(data, length, &type, &pdu->reqid,
+ sizeof(pdu->reqid));
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ return -1;
+ }
+
+ /*
+ * error status (getbulk non-repeaters)
+ */
+ DEBUGDUMPHEADER("recv", "error status");
+ data = asn_parse_int(data, length, &type, &pdu->errstat,
+ sizeof(pdu->errstat));
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ return -1;
+ }
+
+ /*
+ * error index (getbulk max-repetitions)
+ */
+ DEBUGDUMPHEADER("recv", "error index");
+ data = asn_parse_int(data, length, &type, &pdu->errindex,
+ sizeof(pdu->errindex));
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ return -1;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "Bad PDU type received: 0x%.2x\n", pdu->command);
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ return -1;
+ }
+
+ /*
+ * get header for variable-bindings sequence
+ */
+ DEBUGDUMPSECTION("recv", "VarBindList");
+ data = asn_parse_sequence(data, length, &type,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ "varbinds");
+ if (data == NULL)
+ return -1;
+
+ /*
+ * get each varBind sequence
+ */
+ while ((int) *length > 0) {
+ netsnmp_variable_list *vptemp;
+ vptemp = (netsnmp_variable_list *) malloc(sizeof(*vptemp));
+ if (NULL == vptemp) {
+ return -1;
+ }
+ if (NULL == vp) {
+ pdu->variables = vptemp;
+ } else {
+ vp->next_variable = vptemp;
+ }
+ vp = vptemp;
+
+ vp->next_variable = NULL;
+ vp->val.string = NULL;
+ vp->name_length = MAX_OID_LEN;
+ vp->name = NULL;
+ vp->index = 0;
+ vp->data = NULL;
+ vp->dataFreeHook = NULL;
+ DEBUGDUMPSECTION("recv", "VarBind");
+ data = snmp_parse_var_op(data, objid, &vp->name_length, &vp->type,
+ &vp->val_len, &var_val, length);
+ if (data == NULL)
+ return -1;
+ if (snmp_set_var_objid(vp, objid, vp->name_length))
+ return -1;
+
+ len = MAX_PACKET_LENGTH;
+ DEBUGDUMPHEADER("recv", "Value");
+ switch ((short) vp->type) {
+ case ASN_INTEGER:
+ vp->val.integer = (long *) vp->buf;
+ vp->val_len = sizeof(long);
+ asn_parse_int(var_val, &len, &vp->type,
+ (long *) vp->val.integer,
+ sizeof(*vp->val.integer));
+ break;
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ vp->val.integer = (long *) vp->buf;
+ vp->val_len = sizeof(u_long);
+ asn_parse_unsigned_int(var_val, &len, &vp->type,
+ (u_long *) vp->val.integer,
+ vp->val_len);
+ break;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_COUNTER64:
+ case ASN_OPAQUE_U64:
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ case ASN_COUNTER64:
+ vp->val.counter64 = (struct counter64 *) vp->buf;
+ vp->val_len = sizeof(struct counter64);
+ asn_parse_unsigned_int64(var_val, &len, &vp->type,
+ (struct counter64 *) vp->val.
+ counter64, vp->val_len);
+ break;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_FLOAT:
+ vp->val.floatVal = (float *) vp->buf;
+ vp->val_len = sizeof(float);
+ asn_parse_float(var_val, &len, &vp->type,
+ vp->val.floatVal, vp->val_len);
+ break;
+ case ASN_OPAQUE_DOUBLE:
+ vp->val.doubleVal = (double *) vp->buf;
+ vp->val_len = sizeof(double);
+ asn_parse_double(var_val, &len, &vp->type,
+ vp->val.doubleVal, vp->val_len);
+ break;
+ case ASN_OPAQUE_I64:
+ vp->val.counter64 = (struct counter64 *) vp->buf;
+ vp->val_len = sizeof(struct counter64);
+ asn_parse_signed_int64(var_val, &len, &vp->type,
+ (struct counter64 *) vp->val.counter64,
+ sizeof(*vp->val.counter64));
+
+ break;
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ case ASN_OCTET_STR:
+ case ASN_IPADDRESS:
+ case ASN_OPAQUE:
+ case ASN_NSAP:
+ if (vp->val_len < sizeof(vp->buf)) {
+ vp->val.string = (u_char *) vp->buf;
+ } else {
+ vp->val.string = (u_char *) malloc(vp->val_len);
+ }
+ if (vp->val.string == NULL) {
+ return -1;
+ }
+ asn_parse_string(var_val, &len, &vp->type, vp->val.string,
+ &vp->val_len);
+ break;
+ case ASN_OBJECT_ID:
+ vp->val_len = MAX_OID_LEN;
+ asn_parse_objid(var_val, &len, &vp->type, objid, &vp->val_len);
+ vp->val_len *= sizeof(oid);
+ vp->val.objid = (oid *) malloc(vp->val_len);
+ if (vp->val.objid == NULL) {
+ return -1;
+ }
+ memmove(vp->val.objid, objid, vp->val_len);
+ break;
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ case ASN_NULL:
+ break;
+ case ASN_BIT_STR:
+ vp->val.bitstring = (u_char *) malloc(vp->val_len);
+ if (vp->val.bitstring == NULL) {
+ return -1;
+ }
+ asn_parse_bitstring(var_val, &len, &vp->type,
+ vp->val.bitstring, &vp->val_len);
+ break;
+ default:
+ snmp_log(LOG_ERR, "bad type returned (%x)\n", vp->type);
+ badtype = -1;
+ break;
+ }
+ DEBUGINDENTADD(-4);
+ }
+ return badtype;
+}
+
+/*
+ * snmp v3 utility function to parse into the scopedPdu. stores contextName
+ * and contextEngineID in pdu struct. Also stores pdu->command (handy for
+ * Report generation).
+ *
+ * returns pointer to begining of PDU or NULL on error.
+ */
+u_char *
+snmpv3_scopedPDU_parse(netsnmp_pdu *pdu, u_char * cp, size_t * length)
+{
+ u_char tmp_buf[SNMP_MAX_MSG_SIZE];
+ size_t tmp_buf_len;
+ u_char type;
+ size_t asn_len;
+ u_char *data;
+
+ pdu->command = 0; /* initialize so we know if it got parsed */
+ asn_len = *length;
+ data = asn_parse_sequence(cp, &asn_len, &type,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ "plaintext scopedPDU");
+ if (data == NULL) {
+ return NULL;
+ }
+ *length -= data - cp;
+
+ /*
+ * contextEngineID from scopedPdu
+ */
+ DEBUGDUMPHEADER("recv", "contextEngineID");
+ data = asn_parse_string(data, length, &type, pdu->contextEngineID,
+ &pdu->contextEngineIDLen);
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ ERROR_MSG("error parsing contextEngineID from scopedPdu");
+ return NULL;
+ }
+
+ /*
+ * parse contextName from scopedPdu
+ */
+ tmp_buf_len = SNMP_MAX_CONTEXT_SIZE;
+ DEBUGDUMPHEADER("recv", "contextName");
+ data = asn_parse_string(data, length, &type, tmp_buf, &tmp_buf_len);
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ ERROR_MSG("error parsing contextName from scopedPdu");
+ return NULL;
+ }
+
+ if (tmp_buf_len) {
+ pdu->contextName = (char *) malloc(tmp_buf_len);
+ memmove(pdu->contextName, tmp_buf, tmp_buf_len);
+ pdu->contextNameLen = tmp_buf_len;
+ } else {
+ pdu->contextName = strdup("");
+ pdu->contextNameLen = 0;
+ }
+ if (pdu->contextName == NULL) {
+ ERROR_MSG("error copying contextName from scopedPdu");
+ return NULL;
+ }
+
+ /*
+ * Get the PDU type
+ */
+ asn_len = *length;
+ cp = asn_parse_header(data, &asn_len, &type);
+ if (cp == NULL)
+ return NULL;
+
+ pdu->command = type;
+
+ return data;
+}
+
+/*
+ * These functions send PDUs using an active session:
+ * snmp_send - traditional API, no callback
+ * snmp_async_send - traditional API, with callback
+ * snmp_sess_send - single session API, no callback
+ * snmp_sess_async_send - single session API, with callback
+ *
+ * Call snmp_build to create a serialized packet (the pdu).
+ * If necessary, set some of the pdu data from the
+ * session defaults.
+ * If there is an expected response for this PDU,
+ * queue a corresponding request on the list
+ * of outstanding requests for this session,
+ * and store the callback vectors in the request.
+ *
+ * Send the pdu to the target identified by this session.
+ * Return on success:
+ * The request id of the pdu is returned, and the pdu is freed.
+ * Return on failure:
+ * Zero (0) is returned.
+ * The caller must call snmp_free_pdu if 0 is returned.
+ */
+int
+snmp_send(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ return snmp_async_send(session, pdu, NULL, NULL);
+}
+
+int
+snmp_sess_send(void *sessp, netsnmp_pdu *pdu)
+{
+ return snmp_sess_async_send(sessp, pdu, NULL, NULL);
+}
+
+int
+snmp_async_send(netsnmp_session * session,
+ netsnmp_pdu *pdu, snmp_callback callback, void *cb_data)
+{
+ void *sessp = snmp_sess_pointer(session);
+ return snmp_sess_async_send(sessp, pdu, callback, cb_data);
+}
+
+static int
+_sess_async_send(void *sessp,
+ netsnmp_pdu *pdu, snmp_callback callback, void *cb_data)
+{
+ struct session_list *slp = (struct session_list *) sessp;
+ netsnmp_session *session;
+ struct snmp_internal_session *isp;
+ netsnmp_transport *transport = NULL;
+ u_char *pktbuf = NULL, *packet = NULL;
+ size_t pktbuf_len = 0, offset = 0, length = 0;
+ int result;
+ long reqid;
+
+ if (slp == NULL) {
+ return 0;
+ } else {
+ session = slp->session;
+ isp = slp->internal;
+ transport = slp->transport;
+ if (!session || !isp || !transport) {
+ DEBUGMSGTL(("sess_async_send", "send fail: closing...\n"));
+ return 0;
+ }
+ }
+
+ if (pdu == NULL) {
+ session->s_snmp_errno = SNMPERR_NULL_PDU;
+ return 0;
+ }
+
+ session->s_snmp_errno = 0;
+ session->s_errno = 0;
+
+ /*
+ * Check/setup the version.
+ */
+ if (pdu->version == SNMP_DEFAULT_VERSION) {
+ if (session->version == SNMP_DEFAULT_VERSION) {
+ session->s_snmp_errno = SNMPERR_BAD_VERSION;
+ return 0;
+ }
+ pdu->version = session->version;
+ } else if (session->version == SNMP_DEFAULT_VERSION) {
+ /*
+ * It's OK
+ */
+ } else if (pdu->version != session->version) {
+ /*
+ * ENHANCE: we should support multi-lingual sessions
+ */
+ session->s_snmp_errno = SNMPERR_BAD_VERSION;
+ return 0;
+ }
+
+ /*
+ * do we expect a response?
+ */
+ switch (pdu->command) {
+
+ case SNMP_MSG_RESPONSE:
+ case SNMP_MSG_TRAP:
+ case SNMP_MSG_TRAP2:
+ case SNMP_MSG_REPORT:
+ case AGENTX_MSG_CLEANUPSET:
+ case AGENTX_MSG_RESPONSE:
+ pdu->flags &= ~UCD_MSG_FLAG_EXPECT_RESPONSE;
+ break;
+
+ default:
+ pdu->flags |= UCD_MSG_FLAG_EXPECT_RESPONSE;
+ break;
+ }
+
+ /*
+ * check to see if we need a v3 engineID probe
+ */
+ if ((pdu->version == SNMP_VERSION_3) &&
+ (pdu->flags & UCD_MSG_FLAG_EXPECT_RESPONSE) &&
+ (session->securityEngineIDLen == 0) &&
+ (0 == (session->flags & SNMP_FLAGS_DONT_PROBE))) {
+ int rc;
+ DEBUGMSGTL(("snmpv3_build", "delayed probe for engineID\n"));
+ rc = snmpv3_engineID_probe(slp, session);
+ if (rc == 0)
+ return 0; /* s_snmp_errno already set */
+ }
+
+ if ((pktbuf = (u_char *)malloc(2048)) == NULL) {
+ DEBUGMSGTL(("sess_async_send",
+ "couldn't malloc initial packet buffer\n"));
+ session->s_snmp_errno = SNMPERR_MALLOC;
+ return 0;
+ } else {
+ pktbuf_len = 2048;
+ }
+
+#if TEMPORARILY_DISABLED
+ /*
+ * NULL variable are allowed in certain PDU types.
+ * In particular, SNMPv3 engineID probes are of this form.
+ * There is an internal PDU flag to indicate that this
+ * is acceptable, but until the construction of engineID
+ * probes can be amended to set this flag, we'll simply
+ * skip this test altogether.
+ */
+ if (pdu->variables == NULL) {
+ switch (pdu->command) {
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ case SNMP_MSG_SET:
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ case SNMP_MSG_GET:
+ case SNMP_MSG_GETNEXT:
+ case SNMP_MSG_GETBULK:
+ case SNMP_MSG_RESPONSE:
+ case SNMP_MSG_TRAP2:
+ case SNMP_MSG_REPORT:
+ case SNMP_MSG_INFORM:
+ session->s_snmp_errno = snmp_errno = SNMPERR_NO_VARS;
+ return 0;
+ case SNMP_MSG_TRAP:
+ break;
+ }
+ }
+#endif
+
+
+ /*
+ * Build the message to send.
+ */
+ if (isp->hook_realloc_build) {
+ result = isp->hook_realloc_build(session, pdu,
+ &pktbuf, &pktbuf_len, &offset);
+ packet = pktbuf;
+ length = offset;
+ } else if (isp->hook_build) {
+ packet = pktbuf;
+ length = pktbuf_len;
+ result = isp->hook_build(session, pdu, pktbuf, &length);
+ } else {
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_REVERSE_ENCODE)) {
+ result =
+ snmp_build(&pktbuf, &pktbuf_len, &offset, session, pdu);
+ packet = pktbuf + pktbuf_len - offset;
+ length = offset;
+ } else {
+#endif
+ packet = pktbuf;
+ length = pktbuf_len;
+ result = snmp_build(&pktbuf, &length, &offset, session, pdu);
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ }
+#endif
+ }
+
+ if (result < 0) {
+ DEBUGMSGTL(("sess_async_send", "encoding failure\n"));
+ SNMP_FREE(pktbuf);
+ return 0;
+ }
+
+ /*
+ * Make sure we don't send something that is bigger than the msgMaxSize
+ * specified in the received PDU.
+ */
+
+ if (session->sndMsgMaxSize != 0 && length > session->sndMsgMaxSize) {
+ DEBUGMSGTL(("sess_async_send",
+ "length of packet (%lu) exceeds session maximum (%lu)\n",
+ (unsigned long)length, (unsigned long)session->sndMsgMaxSize));
+ session->s_snmp_errno = SNMPERR_TOO_LONG;
+ SNMP_FREE(pktbuf);
+ return 0;
+ }
+
+ /*
+ * Check that the underlying transport is capable of sending a packet as
+ * large as length.
+ */
+
+ if (transport->msgMaxSize != 0 && length > transport->msgMaxSize) {
+ DEBUGMSGTL(("sess_async_send",
+ "length of packet (%lu) exceeds transport maximum (%lu)\n",
+ (unsigned long)length, (unsigned long)transport->msgMaxSize));
+ session->s_snmp_errno = SNMPERR_TOO_LONG;
+ SNMP_FREE(pktbuf);
+ return 0;
+ }
+
+ /*
+ * Send the message.
+ */
+
+ DEBUGMSGTL(("sess_process_packet", "sending message id#%ld reqid#%ld len %"
+ NETSNMP_PRIz "u\n", pdu->msgid, pdu->reqid, length));
+ result = netsnmp_transport_send(transport, packet, length,
+ &(pdu->transport_data),
+ &(pdu->transport_data_length));
+
+ SNMP_FREE(pktbuf);
+
+ if (result < 0) {
+ session->s_snmp_errno = SNMPERR_BAD_SENDTO;
+ session->s_errno = errno;
+ return 0;
+ }
+
+ reqid = pdu->reqid;
+
+ /*
+ * Add to pending requests list if we expect a response.
+ */
+ if (pdu->flags & UCD_MSG_FLAG_EXPECT_RESPONSE) {
+ netsnmp_request_list *rp;
+ struct timeval tv;
+
+ rp = (netsnmp_request_list *) calloc(1,
+ sizeof(netsnmp_request_list));
+ if (rp == NULL) {
+ session->s_snmp_errno = SNMPERR_GENERR;
+ return 0;
+ }
+
+ netsnmp_get_monotonic_clock(&tv);
+ rp->pdu = pdu;
+ rp->request_id = pdu->reqid;
+ rp->message_id = pdu->msgid;
+ rp->callback = callback;
+ rp->cb_data = cb_data;
+ rp->retries = 0;
+ if (pdu->flags & UCD_MSG_FLAG_PDU_TIMEOUT) {
+ rp->timeout = pdu->time * 1000000L;
+ } else {
+ rp->timeout = session->timeout;
+ }
+ rp->timeM = tv;
+ tv.tv_usec += rp->timeout;
+ tv.tv_sec += tv.tv_usec / 1000000L;
+ tv.tv_usec %= 1000000L;
+ rp->expireM = tv;
+
+ /*
+ * XX lock should be per session !
+ */
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ if (isp->requestsEnd) {
+ rp->next_request = isp->requestsEnd->next_request;
+ isp->requestsEnd->next_request = rp;
+ isp->requestsEnd = rp;
+ } else {
+ rp->next_request = isp->requests;
+ isp->requests = rp;
+ isp->requestsEnd = rp;
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ } else {
+ /*
+ * No response expected...
+ */
+ if (reqid) {
+ /*
+ * Free v1 or v2 TRAP PDU iff no error
+ */
+ snmp_free_pdu(pdu);
+ }
+ }
+
+ return reqid;
+}
+
+int
+snmp_sess_async_send(void *sessp,
+ netsnmp_pdu *pdu,
+ snmp_callback callback, void *cb_data)
+{
+ int rc;
+
+ if (sessp == NULL) {
+ snmp_errno = SNMPERR_BAD_SESSION; /*MTCRITICAL_RESOURCE */
+ return (0);
+ }
+ /*
+ * send pdu
+ */
+ rc = _sess_async_send(sessp, pdu, callback, cb_data);
+ if (rc == 0) {
+ struct session_list *psl;
+ netsnmp_session *pss;
+ psl = (struct session_list *) sessp;
+ pss = psl->session;
+ SET_SNMP_ERROR(pss->s_snmp_errno);
+ }
+ return rc;
+}
+
+
+/*
+ * Frees the variable and any malloc'd data associated with it.
+ */
+void
+snmp_free_var_internals(netsnmp_variable_list * var)
+{
+ if (!var)
+ return;
+
+ if (var->name != var->name_loc)
+ SNMP_FREE(var->name);
+ if (var->val.string != var->buf)
+ SNMP_FREE(var->val.string);
+ if (var->data) {
+ if (var->dataFreeHook) {
+ var->dataFreeHook(var->data);
+ var->data = NULL;
+ } else {
+ SNMP_FREE(var->data);
+ }
+ }
+}
+
+void
+snmp_free_var(netsnmp_variable_list * var)
+{
+ snmp_free_var_internals(var);
+ free((char *) var);
+}
+
+void
+snmp_free_varbind(netsnmp_variable_list * var)
+{
+ netsnmp_variable_list *ptr;
+ while (var) {
+ ptr = var->next_variable;
+ snmp_free_var(var);
+ var = ptr;
+ }
+}
+
+/*
+ * Frees the pdu and any malloc'd data associated with it.
+ */
+void
+snmp_free_pdu(netsnmp_pdu *pdu)
+{
+ struct snmp_secmod_def *sptr;
+
+ if (!pdu)
+ return;
+
+ /*
+ * If the command field is empty, that probably indicates
+ * that this PDU structure has already been freed.
+ * Log a warning and return (rather than freeing things again)
+ *
+ * Note that this does not pick up dual-frees where the
+ * memory is set to random junk, which is probably more serious.
+ *
+ * rks: while this is a good idea, there are two problems.
+ * 1) agentx sets command to 0 in some cases
+ * 2) according to Wes, a bad decode of a v3 message could
+ * result in a 0 at this offset.
+ * so I'm commenting it out until a better solution is found.
+ * note that I'm leaving the memset, below....
+ *
+ if (pdu->command == 0) {
+ snmp_log(LOG_WARNING, "snmp_free_pdu probably called twice\n");
+ return;
+ }
+ */
+ if ((sptr = find_sec_mod(pdu->securityModel)) != NULL &&
+ sptr->pdu_free != NULL) {
+ (*sptr->pdu_free) (pdu);
+ }
+ snmp_free_varbind(pdu->variables);
+ SNMP_FREE(pdu->enterprise);
+ SNMP_FREE(pdu->community);
+ SNMP_FREE(pdu->contextEngineID);
+ SNMP_FREE(pdu->securityEngineID);
+ SNMP_FREE(pdu->contextName);
+ SNMP_FREE(pdu->securityName);
+ SNMP_FREE(pdu->transport_data);
+ memset(pdu, 0, sizeof(netsnmp_pdu));
+ free((char *) pdu);
+}
+
+netsnmp_pdu *
+snmp_create_sess_pdu(netsnmp_transport *transport, void *opaque,
+ size_t olength)
+{
+ netsnmp_pdu *pdu = (netsnmp_pdu *)calloc(1, sizeof(netsnmp_pdu));
+ if (pdu == NULL) {
+ DEBUGMSGTL(("sess_process_packet", "can't malloc space for PDU\n"));
+ return NULL;
+ }
+
+ /*
+ * Save the transport-level data specific to this reception (e.g. UDP
+ * source address).
+ */
+
+ pdu->transport_data = opaque;
+ pdu->transport_data_length = olength;
+ pdu->tDomain = transport->domain;
+ pdu->tDomainLen = transport->domain_length;
+ return pdu;
+}
+
+
+/*
+ * This function processes a complete (according to asn_check_packet or the
+ * AgentX equivalent) packet, parsing it into a PDU and calling the relevant
+ * callbacks. On entry, packetptr points at the packet in the session's
+ * buffer and length is the length of the packet.
+ */
+
+static int
+_sess_process_packet(void *sessp, netsnmp_session * sp,
+ struct snmp_internal_session *isp,
+ netsnmp_transport *transport,
+ void *opaque, int olength,
+ u_char * packetptr, int length)
+{
+ struct session_list *slp = (struct session_list *) sessp;
+ netsnmp_pdu *pdu;
+ netsnmp_request_list *rp, *orp = NULL;
+ struct snmp_secmod_def *sptr;
+ int ret = 0, handled = 0;
+
+ DEBUGMSGTL(("sess_process_packet",
+ "session %p fd %d pkt %p length %d\n", sessp,
+ transport->sock, packetptr, length));
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,NETSNMP_DS_LIB_DUMP_PACKET)) {
+ char *addrtxt = netsnmp_transport_peer_string(transport, opaque, olength);
+ snmp_log(LOG_DEBUG, "\nReceived %d byte packet from %s\n",
+ length, addrtxt);
+ SNMP_FREE(addrtxt);
+ xdump(packetptr, length, "");
+ }
+
+ /*
+ * Do transport-level filtering (e.g. IP-address based allow/deny).
+ */
+
+ if (isp->hook_pre) {
+ if (isp->hook_pre(sp, transport, opaque, olength) == 0) {
+ DEBUGMSGTL(("sess_process_packet", "pre-parse fail\n"));
+ SNMP_FREE(opaque);
+ return -1;
+ }
+ }
+
+ if (isp->hook_create_pdu) {
+ pdu = isp->hook_create_pdu(transport, opaque, olength);
+ } else {
+ pdu = snmp_create_sess_pdu(transport, opaque, olength);
+ }
+
+ if (pdu == NULL) {
+ snmp_log(LOG_ERR, "pdu failed to be created\n");
+ SNMP_FREE(opaque);
+ return -1;
+ }
+
+ /* if the transport was a magic tunnel, mark the PDU as having come
+ through one. */
+ if (transport->flags & NETSNMP_TRANSPORT_FLAG_TUNNELED) {
+ pdu->flags |= UCD_MSG_FLAG_TUNNELED;
+ }
+
+ if (isp->hook_parse) {
+ ret = isp->hook_parse(sp, pdu, packetptr, length);
+ } else {
+ ret = snmp_parse(sessp, sp, pdu, packetptr, length);
+ }
+
+ DEBUGMSGTL(("sess_process_packet", "received message id#%ld reqid#%ld len "
+ "%u\n", pdu->msgid, pdu->reqid, length));
+
+ if (ret != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("sess_process_packet", "parse fail\n"));
+ }
+
+ if (isp->hook_post) {
+ if (isp->hook_post(sp, pdu, ret) == 0) {
+ DEBUGMSGTL(("sess_process_packet", "post-parse fail\n"));
+ ret = SNMPERR_ASN_PARSE_ERR;
+ }
+ }
+
+ if (ret != SNMP_ERR_NOERROR) {
+ /*
+ * Call the security model to free any securityStateRef supplied w/ msg.
+ */
+ if (pdu->securityStateRef != NULL) {
+ sptr = find_sec_mod(pdu->securityModel);
+ if (sptr != NULL) {
+ if (sptr->pdu_free_state_ref != NULL) {
+ (*sptr->pdu_free_state_ref) (pdu->securityStateRef);
+ } else {
+ snmp_log(LOG_ERR,
+ "Security Model %d can't free state references\n",
+ pdu->securityModel);
+ }
+ } else {
+ snmp_log(LOG_ERR,
+ "Can't find security model to free ptr: %d\n",
+ pdu->securityModel);
+ }
+ pdu->securityStateRef = NULL;
+ }
+ snmp_free_pdu(pdu);
+ return -1;
+ }
+
+ if (pdu->flags & UCD_MSG_FLAG_RESPONSE_PDU) {
+ /*
+ * Call USM to free any securityStateRef supplied with the message.
+ */
+ if (pdu->securityStateRef) {
+ sptr = find_sec_mod(pdu->securityModel);
+ if (sptr) {
+ if (sptr->pdu_free_state_ref) {
+ (*sptr->pdu_free_state_ref) (pdu->securityStateRef);
+ } else {
+ snmp_log(LOG_ERR,
+ "Security Model %d can't free state references\n",
+ pdu->securityModel);
+ }
+ } else {
+ snmp_log(LOG_ERR,
+ "Can't find security model to free ptr: %d\n",
+ pdu->securityModel);
+ }
+ pdu->securityStateRef = NULL;
+ }
+
+ for (rp = isp->requests; rp; orp = rp, rp = rp->next_request) {
+ snmp_callback callback;
+ void *magic;
+
+ if (pdu->version == SNMP_VERSION_3) {
+ /*
+ * msgId must match for v3 messages.
+ */
+ if (rp->message_id != pdu->msgid) {
+ DEBUGMSGTL(("sess_process_packet", "unmatched msg id: %ld != %ld\n",
+ rp->message_id, pdu->msgid));
+ continue;
+ }
+
+ /*
+ * Check that message fields match original, if not, no further
+ * processing.
+ */
+ if (!snmpv3_verify_msg(rp, pdu)) {
+ break;
+ }
+ } else {
+ if (rp->request_id != pdu->reqid) {
+ continue;
+ }
+ }
+
+ if (rp->callback) {
+ callback = rp->callback;
+ magic = rp->cb_data;
+ } else {
+ callback = sp->callback;
+ magic = sp->callback_magic;
+ }
+ handled = 1;
+
+ /*
+ * MTR snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION); ?* XX lock
+ * should be per session !
+ */
+
+ if (callback == NULL
+ || callback(NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE, sp,
+ pdu->reqid, pdu, magic) == 1) {
+ if (pdu->command == SNMP_MSG_REPORT) {
+ if (sp->s_snmp_errno == SNMPERR_NOT_IN_TIME_WINDOW ||
+ snmpv3_get_report_type(pdu) ==
+ SNMPERR_NOT_IN_TIME_WINDOW) {
+ /*
+ * trigger immediate retry on recoverable Reports
+ * * (notInTimeWindow), incr_retries == TRUE to prevent
+ * * inifinite resend
+ */
+ if (rp->retries <= sp->retries) {
+ snmp_resend_request(slp, rp, TRUE);
+ break;
+ } else {
+ /* We're done with retries, so no longer waiting for a response */
+ ((struct synch_state*)magic)->waiting = 0;
+ }
+ } else {
+ if (SNMPV3_IGNORE_UNAUTH_REPORTS) {
+ break;
+ } else { /* Set the state to no longer be waiting, since we're done with retries */
+ ((struct synch_state*)magic)->waiting = 0;
+ }
+ }
+
+ /*
+ * Handle engineID discovery.
+ */
+ if (!sp->securityEngineIDLen && pdu->securityEngineIDLen) {
+ sp->securityEngineID =
+ (u_char *) malloc(pdu->securityEngineIDLen);
+ if (sp->securityEngineID == NULL) {
+ /*
+ * TODO FIX: recover after message callback *?
+ */
+ return -1;
+ }
+ memcpy(sp->securityEngineID, pdu->securityEngineID,
+ pdu->securityEngineIDLen);
+ sp->securityEngineIDLen = pdu->securityEngineIDLen;
+ if (!sp->contextEngineIDLen) {
+ sp->contextEngineID =
+ (u_char *) malloc(pdu->
+ securityEngineIDLen);
+ if (sp->contextEngineID == NULL) {
+ /*
+ * TODO FIX: recover after message callback *?
+ */
+ return -1;
+ }
+ memcpy(sp->contextEngineID,
+ pdu->securityEngineID,
+ pdu->securityEngineIDLen);
+ sp->contextEngineIDLen =
+ pdu->securityEngineIDLen;
+ }
+ }
+ }
+
+ /*
+ * Successful, so delete request.
+ */
+ if (isp->requests == rp) {
+ isp->requests = rp->next_request;
+ if (isp->requestsEnd == rp) {
+ isp->requestsEnd = NULL;
+ }
+ } else {
+ orp->next_request = rp->next_request;
+ if (isp->requestsEnd == rp) {
+ isp->requestsEnd = orp;
+ }
+ }
+ snmp_free_pdu(rp->pdu);
+ free((char *) rp);
+ /*
+ * There shouldn't be any more requests with the same reqid.
+ */
+ break;
+ }
+ /*
+ * MTR snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION); ?* XX lock should be per session !
+ */
+ }
+ } else {
+ if (sp->callback) {
+ /*
+ * MTR snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ */
+ handled = 1;
+ sp->callback(NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE,
+ sp, pdu->reqid, pdu, sp->callback_magic);
+ /*
+ * MTR snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ */
+ }
+ }
+
+ /*
+ * Call USM to free any securityStateRef supplied with the message.
+ */
+ if (pdu != NULL && pdu->securityStateRef &&
+ pdu->command == SNMP_MSG_TRAP2) {
+ sptr = find_sec_mod(pdu->securityModel);
+ if (sptr) {
+ if (sptr->pdu_free_state_ref) {
+ (*sptr->pdu_free_state_ref) (pdu->securityStateRef);
+ } else {
+ snmp_log(LOG_ERR,
+ "Security Model %d can't free state references\n",
+ pdu->securityModel);
+ }
+ } else {
+ snmp_log(LOG_ERR,
+ "Can't find security model to free ptr: %d\n",
+ pdu->securityModel);
+ }
+ pdu->securityStateRef = NULL;
+ }
+
+ if (!handled) {
+ snmp_increment_statistic(STAT_SNMPUNKNOWNPDUHANDLERS);
+ DEBUGMSGTL(("sess_process_packet", "unhandled PDU\n"));
+ }
+
+ snmp_free_pdu(pdu);
+ return 0;
+}
+
+/*
+ * Checks to see if any of the fd's set in the fdset belong to
+ * snmp. Each socket with it's fd set has a packet read from it
+ * and snmp_parse is called on the packet received. The resulting pdu
+ * is passed to the callback routine for that session. If the callback
+ * routine returns successfully, the pdu and it's request are deleted.
+ */
+void
+snmp_read(fd_set * fdset)
+{
+ netsnmp_large_fd_set lfdset;
+
+ netsnmp_large_fd_set_init(&lfdset, FD_SETSIZE);
+ netsnmp_copy_fd_set_to_large_fd_set(&lfdset, fdset);
+ snmp_read2(&lfdset);
+ netsnmp_large_fd_set_cleanup(&lfdset);
+}
+
+void
+snmp_read2(netsnmp_large_fd_set * fdset)
+{
+ struct session_list *slp;
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ for (slp = Sessions; slp; slp = slp->next) {
+ snmp_sess_read2((void *) slp, fdset);
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+}
+
+/*
+ * Same as snmp_read, but works just one session.
+ * returns 0 if success, -1 if fail
+ * MTR: can't lock here and at snmp_read
+ * Beware recursive send maybe inside snmp_read callback function.
+ */
+int
+_sess_read(void *sessp, netsnmp_large_fd_set * fdset)
+{
+ struct session_list *slp = (struct session_list *) sessp;
+ netsnmp_session *sp = slp ? slp->session : NULL;
+ struct snmp_internal_session *isp = slp ? slp->internal : NULL;
+ netsnmp_transport *transport = slp ? slp->transport : NULL;
+ size_t pdulen = 0, rxbuf_len = 65536;
+ u_char *rxbuf = NULL;
+ int length = 0, olength = 0, rc = 0;
+ void *opaque = NULL;
+
+ if (!sp || !isp || !transport) {
+ DEBUGMSGTL(("sess_read", "read fail: closing...\n"));
+ return 0;
+ }
+
+ /* to avoid subagent crash */
+ if (transport->sock < 0) {
+ snmp_log (LOG_INFO, "transport->sock got negative fd value %d\n", transport->sock);
+ return 0;
+ }
+
+ if (!fdset || !(NETSNMP_LARGE_FD_ISSET(transport->sock, fdset))) {
+ DEBUGMSGTL(("sess_read", "not reading %d (fdset %p set %d)\n",
+ transport->sock, fdset,
+ fdset ? NETSNMP_LARGE_FD_ISSET(transport->sock, fdset)
+ : -9));
+ return 0;
+ }
+
+ sp->s_snmp_errno = 0;
+ sp->s_errno = 0;
+
+ if (transport->flags & NETSNMP_TRANSPORT_FLAG_LISTEN) {
+ int data_sock = transport->f_accept(transport);
+
+ if (data_sock >= 0) {
+ /*
+ * We've successfully accepted a new stream-based connection.
+ * It's not too clear what should happen here if we are using the
+ * single-session API at this point. Basically a "session
+ * accepted" callback is probably needed to hand the new session
+ * over to the application.
+ *
+ * However, for now, as in the original snmp_api, we will ASSUME
+ * that we're using the traditional API, and simply add the new
+ * session to the list. Note we don't have to get the Session
+ * list lock here, because under that assumption we already hold
+ * it (this is also why we don't just use snmp_add).
+ *
+ * The moral of the story is: don't use listening stream-based
+ * transports in a multi-threaded environment because something
+ * will go HORRIBLY wrong (and also that SNMP/TCP is not trivial).
+ *
+ * Another open issue: what should happen to sockets that have
+ * been accept()ed from a listening socket when that original
+ * socket is closed? If they are left open, then attempting to
+ * re-open the listening socket will fail, which is semantically
+ * confusing. Perhaps there should be some kind of chaining in
+ * the transport structure so that they can all be closed.
+ * Discuss. ;-)
+ */
+
+ netsnmp_transport *new_transport=netsnmp_transport_copy(transport);
+ if (new_transport != NULL) {
+ struct session_list *nslp = NULL;
+
+ new_transport->sock = data_sock;
+ new_transport->flags &= ~NETSNMP_TRANSPORT_FLAG_LISTEN;
+
+ nslp = (struct session_list *)snmp_sess_add_ex(sp,
+ new_transport, isp->hook_pre, isp->hook_parse,
+ isp->hook_post, isp->hook_build,
+ isp->hook_realloc_build, isp->check_packet,
+ isp->hook_create_pdu);
+
+ if (nslp != NULL) {
+ nslp->next = Sessions;
+ Sessions = nslp;
+ /*
+ * Tell the new session about its existance if possible.
+ */
+ DEBUGMSGTL(("sess_read",
+ "perform callback with op=CONNECT\n"));
+ (void)nslp->session->callback(NETSNMP_CALLBACK_OP_CONNECT,
+ nslp->session, 0, NULL,
+ sp->callback_magic);
+ }
+ return 0;
+ } else {
+ sp->s_snmp_errno = SNMPERR_MALLOC;
+ sp->s_errno = errno;
+ snmp_set_detail(strerror(errno));
+ return -1;
+ }
+ } else {
+ sp->s_snmp_errno = SNMPERR_BAD_RECVFROM;
+ sp->s_errno = errno;
+ snmp_set_detail(strerror(errno));
+ return -1;
+ }
+ }
+
+ /*
+ * Work out where to receive the data to.
+ */
+
+ if (transport->flags & NETSNMP_TRANSPORT_FLAG_STREAM) {
+ if (isp->packet == NULL) {
+ /*
+ * We have no saved packet. Allocate one.
+ */
+ if ((isp->packet = (u_char *) malloc(rxbuf_len)) == NULL) {
+ DEBUGMSGTL(("sess_read", "can't malloc %lu bytes for rxbuf\n",
+ (unsigned long)rxbuf_len));
+ return 0;
+ } else {
+ rxbuf = isp->packet;
+ isp->packet_size = rxbuf_len;
+ isp->packet_len = 0;
+ }
+ } else {
+ /*
+ * We have saved a partial packet from last time. Extend that, if
+ * necessary, and receive new data after the old data.
+ */
+ u_char *newbuf;
+
+ if (isp->packet_size < isp->packet_len + rxbuf_len) {
+ newbuf =
+ (u_char *) realloc(isp->packet,
+ isp->packet_len + rxbuf_len);
+ if (newbuf == NULL) {
+ DEBUGMSGTL(("sess_read",
+ "can't malloc %lu more for rxbuf (%lu tot)\n",
+ (unsigned long)rxbuf_len, (unsigned long)(isp->packet_len + rxbuf_len)));
+ return 0;
+ } else {
+ isp->packet = newbuf;
+ isp->packet_size = isp->packet_len + rxbuf_len;
+ rxbuf = isp->packet + isp->packet_len;
+ }
+ } else {
+ rxbuf = isp->packet + isp->packet_len;
+ rxbuf_len = isp->packet_size - isp->packet_len;
+ }
+ }
+ } else {
+ if ((rxbuf = (u_char *) malloc(rxbuf_len)) == NULL) {
+ DEBUGMSGTL(("sess_read", "can't malloc %lu bytes for rxbuf\n",
+ (unsigned long)rxbuf_len));
+ return 0;
+ }
+ }
+
+ length = netsnmp_transport_recv(transport, rxbuf, rxbuf_len, &opaque,
+ &olength);
+
+ if (length == -1 && !(transport->flags & NETSNMP_TRANSPORT_FLAG_STREAM)) {
+ sp->s_snmp_errno = SNMPERR_BAD_RECVFROM;
+ sp->s_errno = errno;
+ snmp_set_detail(strerror(errno));
+ SNMP_FREE(rxbuf);
+ SNMP_FREE(opaque);
+ return -1;
+ }
+
+ if (0 == length && transport->flags & NETSNMP_TRANSPORT_FLAG_EMPTY_PKT) {
+ /* this allows for a transport that needs to return from
+ * packet processing that doesn't necessarily have any
+ * consumable data in it. */
+
+ /* reset the flag since it's a per-message flag */
+ transport->flags &= (~NETSNMP_TRANSPORT_FLAG_EMPTY_PKT);
+
+ return 0;
+ }
+
+ /*
+ * Remote end closed connection.
+ */
+
+ if (length <= 0 && transport->flags & NETSNMP_TRANSPORT_FLAG_STREAM) {
+ /*
+ * Alert the application if possible.
+ */
+ if (sp->callback != NULL) {
+ DEBUGMSGTL(("sess_read", "perform callback with op=DISCONNECT\n"));
+ (void) sp->callback(NETSNMP_CALLBACK_OP_DISCONNECT, sp, 0,
+ NULL, sp->callback_magic);
+ }
+ /*
+ * Close socket and mark session for deletion.
+ */
+ DEBUGMSGTL(("sess_read", "fd %d closed\n", transport->sock));
+ transport->f_close(transport);
+ SNMP_FREE(isp->packet);
+ SNMP_FREE(opaque);
+ return -1;
+ }
+
+ if (transport->flags & NETSNMP_TRANSPORT_FLAG_STREAM) {
+ u_char *pptr = isp->packet;
+ void *ocopy = NULL;
+
+ isp->packet_len += length;
+
+ while (isp->packet_len > 0) {
+
+ /*
+ * Get the total data length we're expecting (and need to wait
+ * for).
+ */
+ if (isp->check_packet) {
+ pdulen = isp->check_packet(pptr, isp->packet_len);
+ } else {
+ pdulen = asn_check_packet(pptr, isp->packet_len);
+ }
+
+ DEBUGMSGTL(("sess_read", " loop packet_len %lu, PDU length %lu\n",
+ (unsigned long)isp->packet_len, (unsigned long)pdulen));
+
+ if (pdulen > MAX_PACKET_LENGTH) {
+ /*
+ * Illegal length, drop the connection.
+ */
+ snmp_log(LOG_ERR,
+ "Received broken packet. Closing session.\n");
+ if (sp->callback != NULL) {
+ DEBUGMSGTL(("sess_read",
+ "perform callback with op=DISCONNECT\n"));
+ (void)sp->callback(NETSNMP_CALLBACK_OP_DISCONNECT,
+ sp, 0, NULL, sp->callback_magic);
+ }
+ DEBUGMSGTL(("sess_read", "fd %d closed\n", transport->sock));
+ transport->f_close(transport);
+ SNMP_FREE(opaque);
+ /** XXX-rks: why no SNMP_FREE(isp->packet); ?? */
+ return -1;
+ }
+
+ if (pdulen > isp->packet_len || pdulen == 0) {
+ /*
+ * We don't have a complete packet yet. If we've already
+ * processed a packet, break out so we'll shift this packet
+ * to the start of the buffer. If we're already at the
+ * start, simply return and wait for more data to arrive.
+ */
+ DEBUGMSGTL(("sess_read",
+ "pkt not complete (need %lu got %lu so far)\n",
+ (unsigned long)pdulen, (unsigned long)isp->packet_len));
+
+ if (pptr != isp->packet)
+ break; /* opaque freed for us outside of loop. */
+
+ SNMP_FREE(opaque);
+ return 0;
+ }
+
+ /* We have *at least* one complete packet in the buffer now. If
+ we have possibly more than one packet, we must copy the opaque
+ pointer because we may need to reuse it for a later packet. */
+
+ if (pdulen < isp->packet_len) {
+ if (olength > 0 && opaque != NULL) {
+ ocopy = malloc(olength);
+ if (ocopy != NULL) {
+ memcpy(ocopy, opaque, olength);
+ }
+ }
+ } else if (pdulen == isp->packet_len) {
+ /* Common case -- exactly one packet. No need to copy the
+ opaque pointer. */
+ ocopy = opaque;
+ opaque = NULL;
+ }
+
+ if ((rc = _sess_process_packet(sessp, sp, isp, transport,
+ ocopy, ocopy?olength:0, pptr,
+ pdulen))) {
+ /*
+ * Something went wrong while processing this packet -- set the
+ * errno.
+ */
+ if (sp->s_snmp_errno != 0) {
+ SET_SNMP_ERROR(sp->s_snmp_errno);
+ }
+ }
+
+ /* ocopy has been free()d by _sess_process_packet by this point,
+ so set it to NULL. */
+
+ ocopy = NULL;
+
+ /* Step past the packet we've just dealt with. */
+
+ pptr += pdulen;
+ isp->packet_len -= pdulen;
+ }
+
+ /* If we had more than one packet, then we were working with copies
+ of the opaque pointer, so we still need to free() the opaque
+ pointer itself. */
+
+ SNMP_FREE(opaque);
+
+ if (isp->packet_len >= MAXIMUM_PACKET_SIZE) {
+ /*
+ * Obviously this should never happen!
+ */
+ snmp_log(LOG_ERR,
+ "too large packet_len = %lu, dropping connection %d\n",
+ (unsigned long)(isp->packet_len), transport->sock);
+ transport->f_close(transport);
+ /** XXX-rks: why no SNMP_FREE(isp->packet); ?? */
+ return -1;
+ } else if (isp->packet_len == 0) {
+ /*
+ * This is good: it means the packet buffer contained an integral
+ * number of PDUs, so we don't have to save any data for next
+ * time. We can free() the buffer now to keep the memory
+ * footprint down.
+ */
+ SNMP_FREE(isp->packet);
+ isp->packet_size = 0;
+ isp->packet_len = 0;
+ return rc;
+ }
+
+ /*
+ * If we get here, then there is a partial packet of length
+ * isp->packet_len bytes starting at pptr left over. Move that to the
+ * start of the buffer, and then realloc() the buffer down to size to
+ * reduce the memory footprint.
+ */
+
+ memmove(isp->packet, pptr, isp->packet_len);
+ DEBUGMSGTL(("sess_read", "end: memmove(%p, %p, %lu); realloc(%p, %lu)\n",
+ isp->packet, pptr, (unsigned long)isp->packet_len,
+ isp->packet, (unsigned long)isp->packet_len));
+
+ if ((rxbuf = (u_char *)realloc(isp->packet, isp->packet_len)) == NULL) {
+ /*
+ * I don't see why this should ever fail, but it's not a big deal.
+ */
+ DEBUGMSGTL(("sess_read", "realloc() failed\n"));
+ } else {
+ DEBUGMSGTL(("sess_read", "realloc() okay, old buffer %p, new %p\n",
+ isp->packet, rxbuf));
+ isp->packet = rxbuf;
+ isp->packet_size = isp->packet_len;
+ }
+ return rc;
+ } else {
+ rc = _sess_process_packet(sessp, sp, isp, transport, opaque,
+ olength, rxbuf, length);
+ SNMP_FREE(rxbuf);
+ return rc;
+ }
+}
+
+
+
+/*
+ * returns 0 if success, -1 if fail
+ */
+int
+snmp_sess_read(void *sessp, fd_set * fdset)
+{
+ int rc;
+ netsnmp_large_fd_set lfdset;
+
+ netsnmp_large_fd_set_init(&lfdset, FD_SETSIZE);
+ netsnmp_copy_fd_set_to_large_fd_set(&lfdset, fdset);
+ rc = snmp_sess_read2(sessp, &lfdset);
+ netsnmp_large_fd_set_cleanup(&lfdset);
+ return rc;
+}
+
+int
+snmp_sess_read2(void *sessp, netsnmp_large_fd_set * fdset)
+{
+ struct session_list *psl;
+ netsnmp_session *pss;
+ int rc;
+
+ rc = _sess_read(sessp, fdset);
+ psl = (struct session_list *) sessp;
+ pss = psl->session;
+ if (rc && pss->s_snmp_errno) {
+ SET_SNMP_ERROR(pss->s_snmp_errno);
+ }
+ return rc;
+}
+
+
+/**
+ * Returns info about what snmp requires from a select statement.
+ * numfds is the number of fds in the list that are significant.
+ * All file descriptors opened for SNMP are OR'd into the fdset.
+ * If activity occurs on any of these file descriptors, snmp_read
+ * should be called with that file descriptor set
+ *
+ * The timeout is the latest time that SNMP can wait for a timeout. The
+ * select should be done with the minimum time between timeout and any other
+ * timeouts necessary. This should be checked upon each invocation of select.
+ * If a timeout is received, snmp_timeout should be called to check if the
+ * timeout was for SNMP. (snmp_timeout is idempotent)
+ *
+ * The value of block indicates how the timeout value is interpreted.
+ * If block is true on input, the timeout value will be treated as undefined,
+ * but it must be available for setting in snmp_select_info. On return,
+ * block is set to true if the value returned for timeout is undefined;
+ * when block is set to false, timeout may be used as a parmeter to 'select'.
+ *
+ * snmp_select_info returns the number of open sockets. (i.e. The number of
+ * sessions open)
+ *
+ * @see See also snmp_sess_select_info2_flags().
+ */
+int
+snmp_select_info(int *numfds, fd_set *fdset, struct timeval *timeout,
+ int *block)
+{
+ return snmp_sess_select_info(NULL, numfds, fdset, timeout, block);
+}
+
+/**
+ * @see See also snmp_sess_select_info2_flags().
+ */
+int
+snmp_select_info2(int *numfds, netsnmp_large_fd_set *fdset,
+ struct timeval *timeout, int *block)
+{
+ return snmp_sess_select_info2(NULL, numfds, fdset, timeout, block);
+}
+
+/**
+ * @see See also snmp_sess_select_info2_flags().
+ */
+int
+snmp_sess_select_info(void *sessp, int *numfds, fd_set *fdset,
+ struct timeval *timeout, int *block)
+{
+ return snmp_sess_select_info_flags(sessp, numfds, fdset, timeout, block,
+ NETSNMP_SELECT_NOFLAGS);
+}
+
+/**
+ * @see See also snmp_sess_select_info2_flags().
+ */
+int
+snmp_sess_select_info_flags(void *sessp, int *numfds, fd_set *fdset,
+ struct timeval *timeout, int *block, int flags)
+{
+ int rc;
+ netsnmp_large_fd_set lfdset;
+
+ netsnmp_large_fd_set_init(&lfdset, FD_SETSIZE);
+ netsnmp_copy_fd_set_to_large_fd_set(&lfdset, fdset);
+ rc = snmp_sess_select_info2_flags(sessp, numfds, &lfdset, timeout,
+ block, flags);
+ if (netsnmp_copy_large_fd_set_to_fd_set(fdset, &lfdset) < 0) {
+ snmp_log(LOG_ERR,
+ "Use snmp_sess_select_info2() for processing"
+ " large file descriptors\n");
+ }
+ netsnmp_large_fd_set_cleanup(&lfdset);
+ return rc;
+}
+
+/**
+ * @see See also snmp_sess_select_info2_flags().
+ */
+int
+snmp_sess_select_info2(void *sessp, int *numfds, netsnmp_large_fd_set *fdset,
+ struct timeval *timeout, int *block)
+{
+ return snmp_sess_select_info2_flags(sessp, numfds, fdset, timeout, block,
+ NETSNMP_SELECT_NOFLAGS);
+}
+
+/**
+ * Compute/update the arguments to be passed to select().
+ *
+ * @param[in] sessp Which sessions to process: either a pointer to a
+ * specific session or NULL which means to process all sessions.
+ * @param[in,out] numfds On POSIX systems one more than the the largest file
+ * descriptor that is present in *fdset. On systems that use Winsock (MinGW
+ * and MSVC), do not use the value written into *numfds.
+ * @param[in,out] fdset A large file descriptor set to which all file
+ * descriptors will be added that are associated with one of the examined
+ * sessions.
+ * @param[in,out] timeout On input, if *block = 1, the maximum time the caller
+ * will block while waiting for Net-SNMP activity. On output, if this function
+ * has set *block to 0, the maximum time the caller is allowed to wait before
+ * invoking the Net-SNMP processing functions (snmp_read(), snmp_timeout()
+ * and run_alarms()). If this function has set *block to 1, *timeout won't
+ * have been modified and no alarms are active.
+ * @param[in,out] block On input, whether the caller prefers to block forever
+ * when no alarms are active. On output, 0 means that no alarms are active
+ * nor that there is a timeout pending for any of the processed sessions.
+ * @param[in] flags Either 0 or NETSNMP_SELECT_NOALARMS.
+ *
+ * @return Number of sessions processed by this function.
+ *
+ * @see See also agent_check_and_process() for an example of how to use this
+ * function.
+ */
+int
+snmp_sess_select_info2_flags(void *sessp, int *numfds,
+ netsnmp_large_fd_set * fdset,
+ struct timeval *timeout, int *block, int flags)
+{
+ struct session_list *slp, *next = NULL;
+ netsnmp_request_list *rp;
+ struct timeval now, earliest, alarm_tm;
+ int active = 0, requests = 0;
+ int next_alarm = 0;
+
+ timerclear(&earliest);
+
+ /*
+ * For each session examined, add its socket to the fdset,
+ * and if it is the earliest timeout to expire, mark it as lowest.
+ * If a single session is specified, do just for that session.
+ */
+
+ DEBUGMSGTL(("sess_select", "for %s session%s: ",
+ sessp ? "single" : "all", sessp ? "" : "s"));
+
+ for (slp = sessp ? sessp : Sessions; slp; slp = next) {
+ next = slp->next;
+
+ if (slp->transport == NULL) {
+ /*
+ * Close in progress -- skip this one.
+ */
+ DEBUGMSG(("sess_select", "skip "));
+ continue;
+ }
+
+ if (slp->transport->sock == -1) {
+ /*
+ * This session was marked for deletion.
+ */
+ DEBUGMSG(("sess_select", "delete\n"));
+ if (sessp == NULL) {
+ snmp_close(slp->session);
+ } else {
+ snmp_sess_close(slp);
+ }
+ DEBUGMSGTL(("sess_select", "for %s session%s: ",
+ sessp ? "single" : "all", sessp ? "" : "s"));
+ continue;
+ }
+
+ DEBUGMSG(("sess_select", "%d ", slp->transport->sock));
+ if ((slp->transport->sock + 1) > *numfds) {
+ *numfds = (slp->transport->sock + 1);
+ }
+
+ NETSNMP_LARGE_FD_SET(slp->transport->sock, fdset);
+ if (slp->internal != NULL && slp->internal->requests) {
+ /*
+ * Found another session with outstanding requests.
+ */
+ requests++;
+ for (rp = slp->internal->requests; rp; rp = rp->next_request) {
+ if (!timerisset(&earliest)
+ || (timerisset(&rp->expireM)
+ && timercmp(&rp->expireM, &earliest, <))) {
+ earliest = rp->expireM;
+ DEBUGMSG(("verbose:sess_select","(to in %d.%06d sec) ",
+ (int)earliest.tv_sec, (int)earliest.tv_usec));
+ }
+ }
+ }
+
+ active++;
+ if (sessp) {
+ /*
+ * Single session processing.
+ */
+ break;
+ }
+ }
+ DEBUGMSG(("sess_select", "\n"));
+
+ netsnmp_get_monotonic_clock(&now);
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG) &&
+ !(flags & NETSNMP_SELECT_NOALARMS)) {
+ next_alarm = netsnmp_get_next_alarm_time(&alarm_tm, &now);
+ if (next_alarm)
+ DEBUGMSGT(("sess_select","next alarm at %ld.%06ld sec\n",
+ (long)alarm_tm.tv_sec, (long)alarm_tm.tv_usec));
+ }
+ if (next_alarm == 0 && requests == 0) {
+ /*
+ * If none are active, skip arithmetic.
+ */
+ DEBUGMSGT(("sess_select","blocking:no session requests or alarms.\n"));
+ *block = 1; /* can block - timeout value is undefined if no requests */
+ return active;
+ }
+
+ if (next_alarm &&
+ (!timerisset(&earliest) || timercmp(&alarm_tm, &earliest, <)))
+ earliest = alarm_tm;
+
+ NETSNMP_TIMERSUB(&earliest, &now, &earliest);
+ if (earliest.tv_sec < 0) {
+ time_t overdue_ms = -(earliest.tv_sec * 1000 + earliest.tv_usec / 1000);
+ if (overdue_ms >= 10)
+ DEBUGMSGT(("verbose:sess_select","timer overdue by %ld ms\n",
+ (long) overdue_ms));
+ timerclear(&earliest);
+ } else {
+ DEBUGMSGT(("verbose:sess_select","timer due in %d.%06d sec\n",
+ (int)earliest.tv_sec, (int)earliest.tv_usec));
+ }
+
+ /*
+ * if it was blocking before or our delta time is less, reset timeout
+ */
+ if ((*block || (timercmp(&earliest, timeout, <)))) {
+ DEBUGMSGT(("verbose:sess_select",
+ "setting timer to %d.%06d sec, clear block (was %d)\n",
+ (int)earliest.tv_sec, (int)earliest.tv_usec, *block));
+ *timeout = earliest;
+ *block = 0;
+ }
+ return active;
+}
+
+/*
+ * snmp_timeout should be called whenever the timeout from snmp_select_info
+ * expires, but it is idempotent, so snmp_timeout can be polled (probably a
+ * cpu expensive proposition). snmp_timeout checks to see if any of the
+ * sessions have an outstanding request that has timed out. If it finds one
+ * (or more), and that pdu has more retries available, a new packet is formed
+ * from the pdu and is resent. If there are no more retries available, the
+ * callback for the session is used to alert the user of the timeout.
+ */
+void
+snmp_timeout(void)
+{
+ struct session_list *slp;
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ for (slp = Sessions; slp; slp = slp->next) {
+ snmp_sess_timeout((void *) slp);
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+}
+
+static int
+snmp_resend_request(struct session_list *slp, netsnmp_request_list *rp,
+ int incr_retries)
+{
+ struct snmp_internal_session *isp;
+ netsnmp_session *sp;
+ netsnmp_transport *transport;
+ u_char *pktbuf = NULL, *packet = NULL;
+ size_t pktbuf_len = 0, offset = 0, length = 0;
+ struct timeval tv, now;
+ int result = 0;
+
+ sp = slp->session;
+ isp = slp->internal;
+ transport = slp->transport;
+ if (!sp || !isp || !transport) {
+ DEBUGMSGTL(("sess_read", "resend fail: closing...\n"));
+ return 0;
+ }
+
+ if ((pktbuf = (u_char *)malloc(2048)) == NULL) {
+ DEBUGMSGTL(("sess_resend",
+ "couldn't malloc initial packet buffer\n"));
+ return 0;
+ } else {
+ pktbuf_len = 2048;
+ }
+
+ if (incr_retries) {
+ rp->retries++;
+ }
+
+ /*
+ * Always increment msgId for resent messages.
+ */
+ rp->pdu->msgid = rp->message_id = snmp_get_next_msgid();
+
+ if (isp->hook_realloc_build) {
+ result = isp->hook_realloc_build(sp, rp->pdu,
+ &pktbuf, &pktbuf_len, &offset);
+
+ packet = pktbuf;
+ length = offset;
+ } else if (isp->hook_build) {
+ packet = pktbuf;
+ length = pktbuf_len;
+ result = isp->hook_build(sp, rp->pdu, pktbuf, &length);
+ } else {
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_REVERSE_ENCODE)) {
+ result =
+ snmp_build(&pktbuf, &pktbuf_len, &offset, sp, rp->pdu);
+ packet = pktbuf + pktbuf_len - offset;
+ length = offset;
+ } else {
+#endif
+ packet = pktbuf;
+ length = pktbuf_len;
+ result = snmp_build(&pktbuf, &length, &offset, sp, rp->pdu);
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+ }
+#endif
+ }
+
+ if (result < 0) {
+ /*
+ * This should never happen.
+ */
+ DEBUGMSGTL(("sess_resend", "encoding failure\n"));
+ SNMP_FREE(pktbuf);
+ return -1;
+ }
+
+ DEBUGMSGTL(("sess_process_packet", "resending message id#%ld reqid#%ld "
+ "rp_reqid#%ld rp_msgid#%ld len %" NETSNMP_PRIz "u\n",
+ rp->pdu->msgid, rp->pdu->reqid, rp->request_id, rp->message_id, length));
+ result = netsnmp_transport_send(transport, packet, length,
+ &(rp->pdu->transport_data),
+ &(rp->pdu->transport_data_length));
+
+ /*
+ * We are finished with the local packet buffer, if we allocated one (due
+ * to there being no saved packet).
+ */
+
+ if (pktbuf != NULL) {
+ SNMP_FREE(pktbuf);
+ packet = NULL;
+ }
+
+ if (result < 0) {
+ sp->s_snmp_errno = SNMPERR_BAD_SENDTO;
+ sp->s_errno = errno;
+ snmp_set_detail(strerror(errno));
+ return -1;
+ } else {
+ netsnmp_get_monotonic_clock(&now);
+ tv = now;
+ rp->timeM = tv;
+ tv.tv_usec += rp->timeout;
+ tv.tv_sec += tv.tv_usec / 1000000L;
+ tv.tv_usec %= 1000000L;
+ rp->expireM = tv;
+ }
+ return 0;
+}
+
+
+
+void
+snmp_sess_timeout(void *sessp)
+{
+ struct session_list *slp = (struct session_list *) sessp;
+ netsnmp_session *sp;
+ struct snmp_internal_session *isp;
+ netsnmp_request_list *rp, *orp = NULL, *freeme = NULL;
+ struct timeval now;
+ snmp_callback callback;
+ void *magic;
+ struct snmp_secmod_def *sptr;
+
+ sp = slp->session;
+ isp = slp->internal;
+ if (!sp || !isp) {
+ DEBUGMSGTL(("sess_read", "timeout fail: closing...\n"));
+ return;
+ }
+
+ netsnmp_get_monotonic_clock(&now);
+
+ /*
+ * For each request outstanding, check to see if it has expired.
+ */
+ for (rp = isp->requests; rp; rp = rp->next_request) {
+ if (freeme != NULL) {
+ /*
+ * frees rp's after the for loop goes on to the next_request
+ */
+ free((char *) freeme);
+ freeme = NULL;
+ }
+
+ if ((timercmp(&rp->expireM, &now, <))) {
+ if ((sptr = find_sec_mod(rp->pdu->securityModel)) != NULL &&
+ sptr->pdu_timeout != NULL) {
+ /*
+ * call security model if it needs to know about this
+ */
+ (*sptr->pdu_timeout) (rp->pdu);
+ }
+
+ /*
+ * this timer has expired
+ */
+ if (rp->retries >= sp->retries) {
+ if (rp->callback) {
+ callback = rp->callback;
+ magic = rp->cb_data;
+ } else {
+ callback = sp->callback;
+ magic = sp->callback_magic;
+ }
+
+ /*
+ * No more chances, delete this entry
+ */
+ if (callback) {
+ callback(NETSNMP_CALLBACK_OP_TIMED_OUT, sp,
+ rp->pdu->reqid, rp->pdu, magic);
+ }
+ if (isp->requests == rp) {
+ isp->requests = rp->next_request;
+ if (isp->requestsEnd == rp) {
+ isp->requestsEnd = NULL;
+ }
+ } else {
+ orp->next_request = rp->next_request;
+ if (isp->requestsEnd == rp) {
+ isp->requestsEnd = orp;
+ }
+ }
+ snmp_free_pdu(rp->pdu); /* FIX rp is already free'd! */
+ freeme = rp;
+ continue; /* don't update orp below */
+ } else {
+ if (snmp_resend_request(slp, rp, TRUE)) {
+ break;
+ }
+ }
+ }
+ orp = rp;
+ }
+
+ if (freeme != NULL) {
+ free((char *) freeme);
+ freeme = NULL;
+ }
+}
+
+/*
+ * lexicographical compare two object identifiers.
+ * * Returns -1 if name1 < name2,
+ * * 0 if name1 = name2,
+ * * 1 if name1 > name2
+ * *
+ * * Caution: this method is called often by
+ * * command responder applications (ie, agent).
+ */
+int
+snmp_oid_ncompare(const oid * in_name1,
+ size_t len1,
+ const oid * in_name2, size_t len2, size_t max_len)
+{
+ register int len;
+ register const oid *name1 = in_name1;
+ register const oid *name2 = in_name2;
+ size_t min_len;
+
+ /*
+ * len = minimum of len1 and len2
+ */
+ if (len1 < len2)
+ min_len = len1;
+ else
+ min_len = len2;
+
+ if (min_len > max_len)
+ min_len = max_len;
+
+ len = min_len;
+
+ /*
+ * 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)) {
+ if (*(name1) < *(name2))
+ return -1;
+ return 1;
+ }
+ name1++;
+ name2++;
+ }
+
+ if (min_len != max_len) {
+ /*
+ * both OIDs equal up to length of shorter OID
+ */
+ if (len1 < len2)
+ return -1;
+ if (len2 < len1)
+ return 1;
+ }
+
+ return 0;
+}
+
+/** lexicographical compare two object identifiers.
+ *
+ * Caution: this method is called often by
+ * command responder applications (ie, agent).
+ *
+ * @return -1 if name1 < name2, 0 if name1 = name2, 1 if name1 > name2
+ */
+int
+snmp_oid_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)) {
+ if (*(name1) < *(name2))
+ return -1;
+ return 1;
+ }
+ name1++;
+ name2++;
+ }
+ /*
+ * both OIDs equal up to length of shorter OID
+ */
+ if (len1 < len2)
+ return -1;
+ if (len2 < len1)
+ return 1;
+ return 0;
+}
+
+/** lexicographical compare two object identifiers and return the point where they differ
+ *
+ * Caution: this method is called often by
+ * command responder applications (ie, agent).
+ *
+ * @return -1 if name1 < name2, 0 if name1 = name2, 1 if name1 > name2 and offpt = len where name1 != name2
+ */
+int
+netsnmp_oid_compare_ll(const oid * in_name1,
+ size_t len1, const oid * in_name2, size_t len2,
+ size_t *offpt)
+{
+ register int len;
+ register const oid *name1 = in_name1;
+ register const oid *name2 = in_name2;
+ int initlen;
+
+ /*
+ * len = minimum of len1 and len2
+ */
+ if (len1 < len2)
+ initlen = len = len1;
+ else
+ initlen = 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)) {
+ *offpt = initlen - len;
+ if (*(name1) < *(name2))
+ return -1;
+ return 1;
+ }
+ name1++;
+ name2++;
+ }
+ /*
+ * both OIDs equal up to length of shorter OID
+ */
+ *offpt = initlen - len;
+ if (len1 < len2)
+ return -1;
+ if (len2 < len1)
+ return 1;
+ return 0;
+}
+
+/** Compares 2 OIDs to determine if they are equal up until the shortest length.
+ * @param in_name1 A pointer to the first oid.
+ * @param len1 length of the first OID (in segments, not bytes)
+ * @param in_name2 A pointer to the second oid.
+ * @param len2 length of the second OID (in segments, not bytes)
+ * @return 0 if they are equal, 1 if in_name1 is > in_name2, or -1 if <.
+ */
+int
+snmp_oidtree_compare(const oid * in_name1,
+ size_t len1, const oid * in_name2, size_t len2)
+{
+ int len = ((len1 < len2) ? len1 : len2);
+
+ return (snmp_oid_compare(in_name1, len, in_name2, len));
+}
+
+int
+snmp_oidsubtree_compare(const oid * in_name1,
+ size_t len1, const oid * in_name2, size_t len2)
+{
+ int len = ((len1 < len2) ? len1 : len2);
+
+ return (snmp_oid_compare(in_name1, len1, in_name2, len));
+}
+
+/** Compares 2 OIDs to determine if they are exactly equal.
+ * This should be faster than doing a snmp_oid_compare for different
+ * length OIDs, since the length is checked first and if != returns
+ * immediately. Might be very slighly faster if lengths are ==.
+ * @param in_name1 A pointer to the first oid.
+ * @param len1 length of the first OID (in segments, not bytes)
+ * @param in_name2 A pointer to the second oid.
+ * @param len2 length of the second OID (in segments, not bytes)
+ * @return 0 if they are equal, 1 if they are not.
+ */
+int
+netsnmp_oid_equals(const oid * in_name1,
+ size_t len1, const oid * in_name2, size_t len2)
+{
+ register const oid *name1 = in_name1;
+ register const oid *name2 = in_name2;
+ register int len = len1;
+
+ /*
+ * len = minimum of len1 and len2
+ */
+ if (len1 != len2)
+ return 1;
+ /*
+ * Handle 'null' OIDs
+ */
+ if (len1 == 0)
+ return 0; /* Two null OIDs are (trivially) the same */
+ if (!name1 || !name2)
+ return 1; /* Otherwise something's wrong, so report a non-match */
+ /*
+ * 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;
+ }
+ return 0;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_OID_IS_SUBTREE
+/** Identical to netsnmp_oid_equals, except only the length up to len1 is compared.
+ * Functionally, this determines if in_name2 is equal or a subtree of in_name1
+ * @param in_name1 A pointer to the first oid.
+ * @param len1 length of the first OID (in segments, not bytes)
+ * @param in_name2 A pointer to the second oid.
+ * @param len2 length of the second OID (in segments, not bytes)
+ * @return 0 if one is a common prefix of the other.
+ */
+int
+netsnmp_oid_is_subtree(const oid * in_name1,
+ size_t len1, const oid * in_name2, size_t len2)
+{
+ if (len1 > len2)
+ return 1;
+
+ if (memcmp(in_name1, in_name2, len1 * sizeof(oid)))
+ return 1;
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_OID_IS_SUBTREE */
+
+/** Given two OIDs, determine the common prefix to them both.
+ * @param in_name1 A pointer to the first oid.
+ * @param len1 Length of the first oid.
+ * @param in_name2 A pointer to the second oid.
+ * @param len2 Length of the second oid.
+ * @return length of common prefix
+ * 0 if no common prefix, -1 on error.
+ */
+int
+netsnmp_oid_find_prefix(const oid * in_name1, size_t len1,
+ const oid * in_name2, size_t len2)
+{
+ int i;
+ size_t min_size;
+
+ if (!in_name1 || !in_name2 || !len1 || !len2)
+ return -1;
+
+ if (in_name1[0] != in_name2[0])
+ return 0; /* No match */
+ min_size = SNMP_MIN(len1, len2);
+ for(i = 0; i < (int)min_size; i++) {
+ if (in_name1[i] != in_name2[i])
+ return i; /* 'í' is the first differing subidentifier
+ So the common prefix is 0..(i-1), of length i */
+ }
+ return min_size; /* The shorter OID is a prefix of the longer, and
+ hence is precisely the common prefix of the two.
+ Return its length. */
+}
+
+static int _check_range(struct tree *tp, long ltmp, int *resptr,
+ const char *errmsg)
+{
+ char *cp = NULL;
+ char *temp = NULL;
+ int temp_len = 0;
+ int check = !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_CHECK_RANGE);
+
+ if (check && tp && tp->ranges) {
+ struct range_list *rp = tp->ranges;
+ while (rp) {
+ if (rp->low <= ltmp && ltmp <= rp->high) break;
+ /* Allow four digits per range value */
+ temp_len += ((rp->low != rp->high) ? 14 : 8 );
+ rp = rp->next;
+ }
+ if (!rp) {
+ *resptr = SNMPERR_RANGE;
+ temp = (char *)malloc( temp_len+strlen(errmsg)+7);
+ if ( temp ) {
+ /* Append the Display Hint range information to the error message */
+ sprintf( temp, "%s :: {", errmsg );
+ cp = temp+(strlen(temp));
+ for ( rp = tp->ranges; rp; rp=rp->next ) {
+ if ( rp->low != rp->high )
+ sprintf( cp, "(%d..%d), ", rp->low, rp->high );
+ else
+ sprintf( cp, "(%d), ", rp->low );
+ cp += strlen(cp);
+ }
+ *(cp-2) = '}'; /* Replace the final comma with a '}' */
+ *(cp-1) = 0;
+ snmp_set_detail(temp);
+ free(temp);
+ }
+ return 0;
+ }
+ }
+ free(temp);
+ return 1;
+}
+
+
+/*
+ * Add a variable with the requested name to the end of the list of
+ * variables for this pdu.
+ */
+netsnmp_variable_list *
+snmp_pdu_add_variable(netsnmp_pdu *pdu,
+ const oid * name,
+ size_t name_length,
+ u_char type, const void * value, size_t len)
+{
+ return snmp_varlist_add_variable(&pdu->variables, name, name_length,
+ type, value, len);
+}
+
+/*
+ * Add a variable with the requested name to the end of the list of
+ * variables for this pdu.
+ */
+netsnmp_variable_list *
+snmp_varlist_add_variable(netsnmp_variable_list ** varlist,
+ const oid * name,
+ size_t name_length,
+ u_char type, const void * value, size_t len)
+{
+ netsnmp_variable_list *vars, *vtmp;
+ int rc;
+
+ if (varlist == NULL)
+ return NULL;
+
+ vars = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
+ if (vars == NULL)
+ return NULL;
+
+ vars->type = type;
+
+ rc = snmp_set_var_value( vars, value, len );
+ if (( 0 != rc ) ||
+ (name != NULL && snmp_set_var_objid(vars, name, name_length))) {
+ snmp_free_var(vars);
+ return NULL;
+ }
+
+ /*
+ * put only qualified variable onto varlist
+ */
+ if (*varlist == NULL) {
+ *varlist = vars;
+ } else {
+ for (vtmp = *varlist; vtmp->next_variable;
+ vtmp = vtmp->next_variable);
+
+ vtmp->next_variable = vars;
+ }
+
+ return vars;
+}
+
+
+
+/*
+ * Add a variable with the requested name to the end of the list of
+ * variables for this pdu.
+ * Returns:
+ * may set these error types :
+ * SNMPERR_RANGE - type, value, or length not found or out of range
+ * SNMPERR_VALUE - value is not correct
+ * SNMPERR_VAR_TYPE - type is not correct
+ * SNMPERR_BAD_NAME - name is not found
+ *
+ * returns 0 if success, error if failure.
+ */
+int
+snmp_add_var(netsnmp_pdu *pdu,
+ const oid * name, size_t name_length, char type, const char *value)
+{
+ char *st;
+ const char *cp;
+ char *ecp, *vp;
+ int result = SNMPERR_SUCCESS;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ int check = !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_CHECK_RANGE);
+ int do_hint = !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_NO_DISPLAY_HINT);
+ u_char *hintptr;
+ struct tree *tp;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ u_char *buf = NULL;
+ const u_char *buf_ptr = NULL;
+ size_t buf_len = 0, value_len = 0, tint;
+ in_addr_t atmp;
+ long ltmp;
+ int itmp;
+ struct enum_list *ep;
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ double dtmp;
+ float ftmp;
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ struct counter64 c64tmp;
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ tp = get_tree(name, name_length, get_tree_head());
+ if (!tp || !tp->type || tp->type > TYPE_SIMPLE_LAST) {
+ check = 0;
+ }
+ if (!(tp && tp->hint))
+ do_hint = 0;
+
+ if (tp && type == '=') {
+ /*
+ * generic assignment - let the tree node decide value format
+ */
+ switch (tp->type) {
+ case TYPE_INTEGER:
+ case TYPE_INTEGER32:
+ type = 'i';
+ break;
+ case TYPE_GAUGE:
+ case TYPE_UNSIGNED32:
+ type = 'u';
+ break;
+ case TYPE_UINTEGER:
+ type = '3';
+ break;
+ case TYPE_COUNTER:
+ type = 'c';
+ break;
+ case TYPE_COUNTER64:
+ type = 'C';
+ break;
+ case TYPE_TIMETICKS:
+ type = 't';
+ break;
+ case TYPE_OCTETSTR:
+ type = 's';
+ break;
+ case TYPE_BITSTRING:
+ type = 'b';
+ break;
+ case TYPE_IPADDR:
+ type = 'a';
+ break;
+ case TYPE_OBJID:
+ type = 'o';
+ break;
+ }
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+ switch (type) {
+ case 'i':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && tp->type != TYPE_INTEGER
+ && tp->type != TYPE_INTEGER32) {
+ value = "INTEGER";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ if (!*value)
+ goto fail;
+ ltmp = strtol(value, &ecp, 10);
+ if (*ecp) {
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ ep = tp ? tp->enums : NULL;
+ while (ep) {
+ if (strcmp(value, ep->label) == 0) {
+ ltmp = ep->value;
+ break;
+ }
+ ep = ep->next;
+ }
+ if (!ep) {
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ result = SNMPERR_RANGE; /* ?? or SNMPERR_VALUE; */
+ snmp_set_detail(value);
+ break;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ }
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (!_check_range(tp, ltmp, &result, value))
+ break;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_INTEGER,
+ &ltmp, sizeof(ltmp));
+ break;
+
+ case 'u':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && tp->type != TYPE_GAUGE && tp->type != TYPE_UNSIGNED32) {
+ value = "Unsigned32";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ ltmp = strtoul(value, &ecp, 10);
+ if (*value && !*ecp)
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_UNSIGNED,
+ &ltmp, sizeof(ltmp));
+ else
+ goto fail;
+ break;
+
+ case '3':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && tp->type != TYPE_UINTEGER) {
+ value = "UInteger32";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ ltmp = strtoul(value, &ecp, 10);
+ if (*value && !*ecp)
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_UINTEGER,
+ &ltmp, sizeof(ltmp));
+ else
+ goto fail;
+ break;
+
+ case 'c':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && tp->type != TYPE_COUNTER) {
+ value = "Counter32";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ ltmp = strtoul(value, &ecp, 10);
+ if (*value && !*ecp)
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_COUNTER,
+ &ltmp, sizeof(ltmp));
+ else
+ goto fail;
+ break;
+
+ case 'C':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && tp->type != TYPE_COUNTER64) {
+ value = "Counter64";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ if (read64(&c64tmp, value))
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_COUNTER64,
+ &c64tmp, sizeof(c64tmp));
+ else
+ goto fail;
+ break;
+
+ case 't':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && tp->type != TYPE_TIMETICKS) {
+ value = "Timeticks";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ ltmp = strtoul(value, &ecp, 10);
+ if (*value && !*ecp)
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_TIMETICKS,
+ &ltmp, sizeof(long));
+ else
+ goto fail;
+ break;
+
+ case 'a':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && tp->type != TYPE_IPADDR) {
+ value = "IpAddress";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ atmp = inet_addr(value);
+ if (atmp != (in_addr_t) -1 || !strcmp(value, "255.255.255.255"))
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_IPADDRESS,
+ &atmp, sizeof(atmp));
+ else
+ goto fail;
+ break;
+
+ case 'o':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && tp->type != TYPE_OBJID) {
+ value = "OBJECT IDENTIFIER";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ if ((buf = (u_char *)malloc(sizeof(oid) * MAX_OID_LEN)) == NULL) {
+ result = SNMPERR_MALLOC;
+ } else {
+ tint = MAX_OID_LEN;
+ if (snmp_parse_oid(value, (oid *) buf, &tint)) {
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OBJECT_ID,
+ buf, sizeof(oid) * tint);
+ } else {
+ result = snmp_errno; /*MTCRITICAL_RESOURCE */
+ }
+ }
+ break;
+
+ case 's':
+ case 'x':
+ case 'd':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && tp->type != TYPE_OCTETSTR && tp->type != TYPE_BITSTRING) {
+ value = "OCTET STRING";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+ if ('s' == type && do_hint && !parse_octet_hint(tp->hint, value, &hintptr, &itmp)) {
+ if (_check_range(tp, itmp, &result, "Value does not match DISPLAY-HINT")) {
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OCTET_STR,
+ hintptr, itmp);
+ }
+ SNMP_FREE(hintptr);
+ hintptr = buf;
+ break;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ if (type == 'd') {
+ if (!snmp_decimal_to_binary
+ (&buf, &buf_len, &value_len, 1, value)) {
+ result = SNMPERR_VALUE;
+ snmp_set_detail(value);
+ break;
+ }
+ buf_ptr = buf;
+ } else if (type == 'x') {
+ if (!snmp_hex_to_binary(&buf, &buf_len, &value_len, 1, value)) {
+ result = SNMPERR_VALUE;
+ snmp_set_detail(value);
+ break;
+ }
+ /* initialize itmp value so that range check below works */
+ itmp = value_len;
+ buf_ptr = buf;
+ } else if (type == 's') {
+ buf_ptr = (const u_char *)value;
+ value_len = strlen(value);
+ }
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (!_check_range(tp, value_len, &result, "Bad string length"))
+ break;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OCTET_STR,
+ buf_ptr, value_len);
+ break;
+
+ case 'n':
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_NULL, NULL, 0);
+ break;
+
+ case 'b':
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ if (check && (tp->type != TYPE_BITSTRING || !tp->enums)) {
+ value = "BITS";
+ result = SNMPERR_VALUE;
+ goto type_error;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ tint = 0;
+ if ((buf = (u_char *) malloc(256)) == NULL) {
+ result = SNMPERR_MALLOC;
+ break;
+ } else {
+ buf_len = 256;
+ memset(buf, 0, buf_len);
+ }
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ for (ep = tp ? tp->enums : NULL; ep; ep = ep->next) {
+ if (ep->value / 8 >= (int) tint) {
+ tint = ep->value / 8 + 1;
+ }
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+ vp = strdup(value);
+ for (cp = strtok_r(vp, " ,\t", &st); cp; cp = strtok_r(NULL, " ,\t", &st)) {
+ int ix, bit;
+
+ ltmp = strtoul(cp, &ecp, 0);
+ if (*ecp != 0) {
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ for (ep = tp ? tp->enums : NULL; ep != NULL; ep = ep->next) {
+ if (strncmp(ep->label, cp, strlen(ep->label)) == 0) {
+ break;
+ }
+ }
+ if (ep != NULL) {
+ ltmp = ep->value;
+ } else {
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ result = SNMPERR_RANGE; /* ?? or SNMPERR_VALUE; */
+ snmp_set_detail(cp);
+ SNMP_FREE(buf);
+ SNMP_FREE(vp);
+ goto out;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ }
+
+ ix = ltmp / 8;
+ if (ix >= (int) tint) {
+ tint = ix + 1;
+ }
+ if (ix >= (int)buf_len && !snmp_realloc(&buf, &buf_len)) {
+ result = SNMPERR_MALLOC;
+ break;
+ }
+ bit = 0x80 >> ltmp % 8;
+ buf[ix] |= bit;
+
+ }
+ SNMP_FREE(vp);
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OCTET_STR,
+ buf, tint);
+ break;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case 'U':
+ if (read64(&c64tmp, value))
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OPAQUE_U64,
+ &c64tmp, sizeof(c64tmp));
+ else
+ goto fail;
+ break;
+
+ case 'I':
+ if (read64(&c64tmp, value))
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OPAQUE_I64,
+ &c64tmp, sizeof(c64tmp));
+ else
+ goto fail;
+ break;
+
+ case 'F':
+ if (sscanf(value, "%f", &ftmp) == 1)
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OPAQUE_FLOAT,
+ &ftmp, sizeof(ftmp));
+ else
+ goto fail;
+ break;
+
+ case 'D':
+ if (sscanf(value, "%lf", &dtmp) == 1)
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OPAQUE_DOUBLE,
+ &dtmp, sizeof(dtmp));
+ else
+ goto fail;
+ break;
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+
+ default:
+ result = SNMPERR_VAR_TYPE;
+ buf = (u_char *)calloc(1, 4);
+ if (buf != NULL) {
+ sprintf((char *)buf, "\"%c\"", type);
+ snmp_set_detail((char *)buf);
+ }
+ break;
+ }
+
+ SNMP_FREE(buf);
+ SET_SNMP_ERROR(result);
+ return result;
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ type_error:
+ {
+ char error_msg[256];
+ char undef_msg[32];
+ const char *var_type;
+ switch (tp->type) {
+ case TYPE_OBJID:
+ var_type = "OBJECT IDENTIFIER";
+ break;
+ case TYPE_OCTETSTR:
+ var_type = "OCTET STRING";
+ break;
+ case TYPE_INTEGER:
+ var_type = "INTEGER";
+ break;
+ case TYPE_NETADDR:
+ var_type = "NetworkAddress";
+ break;
+ case TYPE_IPADDR:
+ var_type = "IpAddress";
+ break;
+ case TYPE_COUNTER:
+ var_type = "Counter32";
+ break;
+ case TYPE_GAUGE:
+ var_type = "Gauge32";
+ break;
+ case TYPE_TIMETICKS:
+ var_type = "Timeticks";
+ break;
+ case TYPE_OPAQUE:
+ var_type = "Opaque";
+ break;
+ case TYPE_NULL:
+ var_type = "Null";
+ break;
+ case TYPE_COUNTER64:
+ var_type = "Counter64";
+ break;
+ case TYPE_BITSTRING:
+ var_type = "BITS";
+ break;
+ case TYPE_NSAPADDRESS:
+ var_type = "NsapAddress";
+ break;
+ case TYPE_UINTEGER:
+ var_type = "UInteger";
+ break;
+ case TYPE_UNSIGNED32:
+ var_type = "Unsigned32";
+ break;
+ case TYPE_INTEGER32:
+ var_type = "Integer32";
+ break;
+ default:
+ sprintf(undef_msg, "TYPE_%d", tp->type);
+ var_type = undef_msg;
+ }
+ snprintf(error_msg, sizeof(error_msg),
+ "Type of attribute is %s, not %s", var_type, value);
+ error_msg[ sizeof(error_msg)-1 ] = 0;
+ result = SNMPERR_VAR_TYPE;
+ snmp_set_detail(error_msg);
+ goto out;
+ }
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ fail:
+ result = SNMPERR_VALUE;
+ snmp_set_detail(value);
+ out:
+ SET_SNMP_ERROR(result);
+ return result;
+}
+
+/*
+ * returns NULL or internal pointer to session
+ * use this pointer for the other snmp_sess* routines,
+ * which guarantee action will occur ONLY for this given session.
+ */
+void *
+snmp_sess_pointer(netsnmp_session * session)
+{
+ struct session_list *slp;
+
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ for (slp = Sessions; slp; slp = slp->next) {
+ if (slp->session == session) {
+ break;
+ }
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+
+ if (slp == NULL) {
+ snmp_errno = SNMPERR_BAD_SESSION; /*MTCRITICAL_RESOURCE */
+ return (NULL);
+ }
+ return ((void *) slp);
+}
+
+/*
+ * Input : an opaque pointer, returned by snmp_sess_open.
+ * returns NULL or pointer to session.
+ */
+netsnmp_session *
+snmp_sess_session(void *sessp)
+{
+ struct session_list *slp = (struct session_list *) sessp;
+ if (slp == NULL)
+ return (NULL);
+ return (slp->session);
+}
+
+/**
+ * Look up a session that already may have been closed.
+ *
+ * @param sessp Opaque pointer, returned by snmp_sess_open.
+ *
+ * @return Pointer to session upon success or NULL upon failure.
+ *
+ * @see snmp_sess_session()
+ */
+netsnmp_session *
+snmp_sess_session_lookup(void *sessp)
+{
+ struct session_list *slp;
+
+ snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
+ for (slp = Sessions; slp; slp = slp->next) {
+ if (slp == sessp) {
+ break;
+ }
+ }
+ snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
+
+ return (netsnmp_session *)slp;
+}
+
+
+/*
+ * snmp_sess_transport: takes an opaque pointer (as returned by
+ * snmp_sess_open or snmp_sess_pointer) and returns the corresponding
+ * netsnmp_transport pointer (or NULL if the opaque pointer does not correspond
+ * to an active internal session).
+ */
+
+netsnmp_transport *
+snmp_sess_transport(void *sessp)
+{
+ struct session_list *slp = (struct session_list *) sessp;
+ if (slp == NULL) {
+ return NULL;
+ } else {
+ return slp->transport;
+ }
+}
+
+
+
+/*
+ * snmp_sess_transport_set: set the transport pointer for the opaque
+ * session pointer sp.
+ */
+
+void
+snmp_sess_transport_set(void *sp, netsnmp_transport *t)
+{
+ struct session_list *slp = (struct session_list *) sp;
+ if (slp != NULL) {
+ slp->transport = t;
+ }
+}
+
+
+/*
+ * snmp_duplicate_objid: duplicates (mallocs) an objid based on the
+ * input objid
+ */
+oid *
+snmp_duplicate_objid(const oid * objToCopy, size_t objToCopyLen)
+{
+ oid *returnOid;
+ if (objToCopy != NULL && objToCopyLen != 0) {
+ returnOid = (oid *) malloc(objToCopyLen * sizeof(oid));
+ if (returnOid) {
+ memcpy(returnOid, objToCopy, objToCopyLen * sizeof(oid));
+ }
+ } else
+ returnOid = NULL;
+ return returnOid;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_STATISTICS
+/*
+ * generic statistics counter functions
+ */
+static u_int statistics[NETSNMP_STAT_MAX_STATS];
+
+u_int
+snmp_increment_statistic(int which)
+{
+ if (which >= 0 && which < NETSNMP_STAT_MAX_STATS) {
+ statistics[which]++;
+ return statistics[which];
+ }
+ return 0;
+}
+
+u_int
+snmp_increment_statistic_by(int which, int count)
+{
+ if (which >= 0 && which < NETSNMP_STAT_MAX_STATS) {
+ statistics[which] += count;
+ return statistics[which];
+ }
+ return 0;
+}
+
+u_int
+snmp_get_statistic(int which)
+{
+ if (which >= 0 && which < NETSNMP_STAT_MAX_STATS)
+ return statistics[which];
+ return 0;
+}
+
+void
+snmp_init_statistics(void)
+{
+ memset(statistics, 0, sizeof(statistics));
+}
+/** @} */
+#endif /* NETSNMP_FEATURE_REMOVE_STATISTICS */
diff --git a/snmplib/snmp_auth.c b/snmplib/snmp_auth.c
new file mode 100644
index 0000000..4b408f1
--- /dev/null
+++ b/snmplib/snmp_auth.c
@@ -0,0 +1,240 @@
+/*
+ * snmp_auth.c
+ *
+ * Community name parse/build routines.
+ */
+/**********************************************************************
+ Copyright 1988, 1989, 1991, 1992 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.
+******************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef KINETICS
+#include "gw.h"
+#include "fp4/cmdmacro.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
+#include <sys/types.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_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_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#ifdef vms
+#include <in.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/md5.h>
+#include <net-snmp/library/scapi.h>
+
+/*
+ * Globals.
+ */
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+/*******************************************************************-o-******
+ * snmp_comstr_parse
+ *
+ * Parameters:
+ * *data (I) Message.
+ * *length (I/O) Bytes left in message.
+ * *psid (O) Community string.
+ * *slen (O) Length of community string.
+ * *version (O) Message version.
+ *
+ * Returns:
+ * Pointer to the remainder of data.
+ *
+ *
+ * Parse the header of a community string-based message such as that found
+ * in SNMPv1 and SNMPv2c.
+ */
+u_char *
+snmp_comstr_parse(u_char * data,
+ size_t * length,
+ u_char * psid, size_t * slen, long *version)
+{
+ u_char type;
+ long ver;
+ size_t origlen = *slen;
+
+ /*
+ * Message is an ASN.1 SEQUENCE.
+ */
+ data = asn_parse_sequence(data, length, &type,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ "auth message");
+ if (data == NULL) {
+ return NULL;
+ }
+
+ /*
+ * First field is the version.
+ */
+ DEBUGDUMPHEADER("recv", "SNMP version");
+ data = asn_parse_int(data, length, &type, &ver, sizeof(ver));
+ DEBUGINDENTLESS();
+ *version = ver;
+ if (data == NULL) {
+ ERROR_MSG("bad parse of version");
+ return NULL;
+ }
+
+ /*
+ * second field is the community string for SNMPv1 & SNMPv2c
+ */
+ DEBUGDUMPHEADER("recv", "community string");
+ data = asn_parse_string(data, length, &type, psid, slen);
+ DEBUGINDENTLESS();
+ if (data == NULL) {
+ ERROR_MSG("bad parse of community");
+ return NULL;
+ }
+ psid[SNMP_MIN(*slen, origlen - 1)] = '\0';
+ return (u_char *) data;
+
+} /* end snmp_comstr_parse() */
+
+
+
+
+/*******************************************************************-o-******
+ * snmp_comstr_build
+ *
+ * Parameters:
+ * *data
+ * *length
+ * *psid
+ * *slen
+ * *version
+ * messagelen
+ *
+ * Returns:
+ * Pointer into 'data' after built section.
+ *
+ *
+ * Build the header of a community string-based message such as that found
+ * in SNMPv1 and SNMPv2c.
+ *
+ * NOTE: The length of the message will have to be inserted later,
+ * if not known.
+ *
+ * NOTE: Version is an 'int'. (CMU had it as a long, but was passing
+ * in a *int. Grrr.) Assign version to verfix and pass in
+ * that to asn_build_int instead which expects a long. -- WH
+ */
+u_char *
+snmp_comstr_build(u_char * data,
+ size_t * length,
+ u_char * psid,
+ size_t * slen, long *version, size_t messagelen)
+{
+ long verfix = *version;
+ u_char *h1 = data;
+ u_char *h1e;
+ size_t hlength = *length;
+
+
+ /*
+ * Build the the message wrapper (note length will be inserted later).
+ */
+ data =
+ asn_build_sequence(data, length,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), 0);
+ if (data == NULL) {
+ return NULL;
+ }
+ h1e = data;
+
+
+ /*
+ * Store the version field.
+ */
+ data = asn_build_int(data, length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &verfix, sizeof(verfix));
+ if (data == NULL) {
+ return NULL;
+ }
+
+
+ /*
+ * Store the community string.
+ */
+ data = asn_build_string(data, length,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), psid,
+ *(u_char *) slen);
+ if (data == NULL) {
+ return NULL;
+ }
+
+
+ /*
+ * Insert length.
+ */
+ asn_build_sequence(h1, &hlength,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ data - h1e + messagelen);
+
+
+ return data;
+
+} /* end snmp_comstr_build() */
+#endif /* support for community based SNMP */
diff --git a/snmplib/snmp_client.c b/snmplib/snmp_client.c
new file mode 100644
index 0000000..c1aa9c4
--- /dev/null
+++ b/snmplib/snmp_client.c
@@ -0,0 +1,1885 @@
+/*
+ * snmp_client.c - a toolkit of common functions for an SNMP client.
+ *
+ */
+/* 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, 1991, 1992 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_client various PDU processing routines
+ * @ingroup library
+ *
+ * @{
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.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
+# 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_SYS_PARAM_H
+#include <sys/param.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_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+
+#include <net-snmp/agent/ds_agent.h>
+#include <net-snmp/library/default_store.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_client.h>
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/snmpusm.h>
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/snmp_logging.h>
+#include <net-snmp/library/snmp_assert.h>
+#include <net-snmp/pdu_api.h>
+
+netsnmp_feature_child_of(snmp_client_all, libnetsnmp)
+
+netsnmp_feature_child_of(snmp_split_pdu, snmp_client_all)
+netsnmp_feature_child_of(snmp_reset_var_types, snmp_client_all)
+netsnmp_feature_child_of(query_set_default_session, snmp_client_all)
+netsnmp_feature_child_of(row_create, snmp_client_all)
+
+#ifndef BSD4_3
+#define BSD4_2
+#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
+
+/*
+ * Prototype definitions
+ */
+static int snmp_synch_input(int op, netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu, void *magic);
+
+netsnmp_pdu *
+snmp_pdu_create(int command)
+{
+ netsnmp_pdu *pdu;
+
+ pdu = (netsnmp_pdu *) calloc(1, sizeof(netsnmp_pdu));
+ if (pdu) {
+ pdu->version = SNMP_DEFAULT_VERSION;
+ pdu->command = command;
+ pdu->errstat = SNMP_DEFAULT_ERRSTAT;
+ pdu->errindex = SNMP_DEFAULT_ERRINDEX;
+ pdu->securityModel = SNMP_DEFAULT_SECMODEL;
+ pdu->transport_data = NULL;
+ pdu->transport_data_length = 0;
+ pdu->securityNameLen = 0;
+ pdu->contextNameLen = 0;
+ pdu->time = 0;
+ pdu->reqid = snmp_get_next_reqid();
+ pdu->msgid = snmp_get_next_msgid();
+ }
+ return pdu;
+
+}
+
+
+/*
+ * Add a null variable with the requested name to the end of the list of
+ * variables for this pdu.
+ */
+netsnmp_variable_list *
+snmp_add_null_var(netsnmp_pdu *pdu, const oid * name, size_t name_length)
+{
+ return snmp_pdu_add_variable(pdu, name, name_length, ASN_NULL, NULL, 0);
+}
+
+
+#include <net-snmp/library/snmp_debug.h>
+static int
+snmp_synch_input(int op,
+ netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu, void *magic)
+{
+ struct synch_state *state = (struct synch_state *) magic;
+ int rpt_type;
+
+ if (reqid != state->reqid && pdu && pdu->command != SNMP_MSG_REPORT) {
+ DEBUGMSGTL(("snmp_synch", "Unexpected response (ReqID: %d,%d - Cmd %d)\n",
+ reqid, state->reqid, pdu->command ));
+ return 0;
+ }
+
+ state->waiting = 0;
+ DEBUGMSGTL(("snmp_synch", "Response (ReqID: %d - Cmd %d)\n",
+ reqid, (pdu ? pdu->command : -1)));
+
+ if (op == NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE && pdu) {
+ if (pdu->command == SNMP_MSG_REPORT) {
+ rpt_type = snmpv3_get_report_type(pdu);
+ if (SNMPV3_IGNORE_UNAUTH_REPORTS ||
+ rpt_type == SNMPERR_NOT_IN_TIME_WINDOW) {
+ state->waiting = 1;
+ }
+ state->pdu = NULL;
+ state->status = STAT_ERROR;
+ session->s_snmp_errno = rpt_type;
+ SET_SNMP_ERROR(rpt_type);
+ } else if (pdu->command == SNMP_MSG_RESPONSE) {
+ /*
+ * clone the pdu to return to snmp_synch_response
+ */
+ state->pdu = snmp_clone_pdu(pdu);
+ state->status = STAT_SUCCESS;
+ session->s_snmp_errno = SNMPERR_SUCCESS;
+ }
+ else {
+ char msg_buf[50];
+ state->status = STAT_ERROR;
+ session->s_snmp_errno = SNMPERR_PROTOCOL;
+ SET_SNMP_ERROR(SNMPERR_PROTOCOL);
+ snprintf(msg_buf, sizeof(msg_buf), "Expected RESPONSE-PDU but got %s-PDU",
+ snmp_pdu_type(pdu->command));
+ snmp_set_detail(msg_buf);
+ return 0;
+ }
+ } else if (op == NETSNMP_CALLBACK_OP_TIMED_OUT) {
+ state->pdu = NULL;
+ state->status = STAT_TIMEOUT;
+ session->s_snmp_errno = SNMPERR_TIMEOUT;
+ SET_SNMP_ERROR(SNMPERR_TIMEOUT);
+ } else if (op == NETSNMP_CALLBACK_OP_DISCONNECT) {
+ state->pdu = NULL;
+ state->status = STAT_ERROR;
+ session->s_snmp_errno = SNMPERR_ABORT;
+ SET_SNMP_ERROR(SNMPERR_ABORT);
+ }
+
+ return 1;
+}
+
+
+/*
+ * Clone an SNMP variable data structure.
+ * Sets pointers to structure private storage, or
+ * allocates larger object identifiers and values as needed.
+ *
+ * Caller must make list association for cloned variable.
+ *
+ * Returns 0 if successful.
+ */
+int
+snmp_clone_var(netsnmp_variable_list * var, netsnmp_variable_list * newvar)
+{
+ if (!newvar || !var)
+ return 1;
+
+ memmove(newvar, var, sizeof(netsnmp_variable_list));
+ newvar->next_variable = NULL;
+ newvar->name = NULL;
+ newvar->val.string = NULL;
+ newvar->data = NULL;
+ newvar->dataFreeHook = NULL;
+ newvar->index = 0;
+
+ /*
+ * Clone the object identifier and the value.
+ * Allocate memory iff original will not fit into local storage.
+ */
+ if (snmp_set_var_objid(newvar, var->name, var->name_length))
+ return 1;
+
+ /*
+ * need a pointer to copy a string value.
+ */
+ if (var->val.string) {
+ if (var->val.string != &var->buf[0]) {
+ if (var->val_len <= sizeof(var->buf))
+ newvar->val.string = newvar->buf;
+ else {
+ newvar->val.string = (u_char *) malloc(var->val_len);
+ if (!newvar->val.string)
+ return 1;
+ }
+ memmove(newvar->val.string, var->val.string, var->val_len);
+ } else { /* fix the pointer to new local store */
+ newvar->val.string = newvar->buf;
+ /*
+ * no need for a memmove, since we copied the whole var
+ * struct (and thus var->buf) at the beginning of this function.
+ */
+ }
+ } else {
+ newvar->val.string = NULL;
+ newvar->val_len = 0;
+ }
+
+ return 0;
+}
+
+
+/*
+ * Possibly make a copy of source memory buffer.
+ * Will reset destination pointer if source pointer is NULL.
+ * Returns 0 if successful, 1 if memory allocation fails.
+ */
+int
+snmp_clone_mem(void **dstPtr, const void *srcPtr, unsigned len)
+{
+ *dstPtr = NULL;
+ if (srcPtr) {
+ *dstPtr = malloc(len + 1);
+ if (!*dstPtr) {
+ return 1;
+ }
+ memmove(*dstPtr, srcPtr, len);
+ /*
+ * this is for those routines that expect 0-terminated strings!!!
+ * someone should rather have called strdup
+ */
+ ((char *) *dstPtr)[len] = 0;
+ }
+ return 0;
+}
+
+
+/*
+ * Walks through a list of varbinds and frees and allocated memory,
+ * restoring pointers to local buffers
+ */
+void
+snmp_reset_var_buffers(netsnmp_variable_list * var)
+{
+ while (var) {
+ if (var->name != var->name_loc) {
+ if(NULL != var->name)
+ free(var->name);
+ var->name = var->name_loc;
+ var->name_length = 0;
+ }
+ if (var->val.string != var->buf) {
+ if (NULL != var->val.string)
+ free(var->val.string);
+ var->val.string = var->buf;
+ var->val_len = 0;
+ }
+ var = var->next_variable;
+ }
+}
+
+/*
+ * Creates and allocates a clone of the input PDU,
+ * but does NOT copy the variables.
+ * This function should be used with another function,
+ * such as _copy_pdu_vars.
+ *
+ * Returns a pointer to the cloned PDU if successful.
+ * Returns 0 if failure.
+ */
+static
+netsnmp_pdu *
+_clone_pdu_header(netsnmp_pdu *pdu)
+{
+ netsnmp_pdu *newpdu;
+ struct snmp_secmod_def *sptr;
+ int ret;
+
+ newpdu = (netsnmp_pdu *) malloc(sizeof(netsnmp_pdu));
+ if (!newpdu)
+ return NULL;
+ memmove(newpdu, pdu, sizeof(netsnmp_pdu));
+
+ /*
+ * reset copied pointers if copy fails
+ */
+ newpdu->variables = NULL;
+ newpdu->enterprise = NULL;
+ newpdu->community = NULL;
+ newpdu->securityEngineID = NULL;
+ newpdu->securityName = NULL;
+ newpdu->contextEngineID = NULL;
+ newpdu->contextName = NULL;
+ newpdu->transport_data = NULL;
+
+ /*
+ * copy buffers individually. If any copy fails, all are freed.
+ */
+ if (snmp_clone_mem((void **) &newpdu->enterprise, pdu->enterprise,
+ sizeof(oid) * pdu->enterprise_length) ||
+ snmp_clone_mem((void **) &newpdu->community, pdu->community,
+ pdu->community_len) ||
+ snmp_clone_mem((void **) &newpdu->contextEngineID,
+ pdu->contextEngineID, pdu->contextEngineIDLen)
+ || snmp_clone_mem((void **) &newpdu->securityEngineID,
+ pdu->securityEngineID, pdu->securityEngineIDLen)
+ || snmp_clone_mem((void **) &newpdu->contextName, pdu->contextName,
+ pdu->contextNameLen)
+ || snmp_clone_mem((void **) &newpdu->securityName,
+ pdu->securityName, pdu->securityNameLen)
+ || snmp_clone_mem((void **) &newpdu->transport_data,
+ pdu->transport_data,
+ pdu->transport_data_length)) {
+ snmp_free_pdu(newpdu);
+ return NULL;
+ }
+
+ if (pdu != NULL && pdu->securityStateRef &&
+ pdu->command == SNMP_MSG_TRAP2) {
+
+ ret = usm_clone_usmStateReference((struct usmStateReference *) pdu->securityStateRef,
+ (struct usmStateReference **) &newpdu->securityStateRef );
+
+ if (ret)
+ {
+ snmp_free_pdu(newpdu);
+ return 0;
+ }
+ }
+
+ if ((sptr = find_sec_mod(newpdu->securityModel)) != NULL &&
+ sptr->pdu_clone != NULL) {
+ /*
+ * call security model if it needs to know about this
+ */
+ (*sptr->pdu_clone) (pdu, newpdu);
+ }
+
+ return newpdu;
+}
+
+static
+netsnmp_variable_list *
+_copy_varlist(netsnmp_variable_list * var, /* source varList */
+ int errindex, /* index of variable to drop (if any) */
+ int copy_count)
+{ /* !=0 number variables to copy */
+ netsnmp_variable_list *newhead, *newvar, *oldvar;
+ int ii = 0;
+
+ newhead = NULL;
+ oldvar = NULL;
+
+ while (var && (copy_count-- > 0)) {
+ /*
+ * Drop the specified variable (if applicable)
+ */
+ if (++ii == errindex) {
+ var = var->next_variable;
+ continue;
+ }
+
+ /*
+ * clone the next variable. Cleanup if alloc fails
+ */
+ newvar = (netsnmp_variable_list *)
+ malloc(sizeof(netsnmp_variable_list));
+ if (snmp_clone_var(var, newvar)) {
+ if (newvar)
+ free((char *) newvar);
+ snmp_free_varbind(newhead);
+ return NULL;
+ }
+
+ /*
+ * add cloned variable to new list
+ */
+ if (NULL == newhead)
+ newhead = newvar;
+ if (oldvar)
+ oldvar->next_variable = newvar;
+ oldvar = newvar;
+
+ var = var->next_variable;
+ }
+ return newhead;
+}
+
+
+/*
+ * Copy some or all variables from source PDU to target PDU.
+ * This function consolidates many of the needs of PDU variables:
+ * Clone PDU : copy all the variables.
+ * Split PDU : skip over some variables to copy other variables.
+ * Fix PDU : remove variable associated with error index.
+ *
+ * Designed to work with _clone_pdu_header.
+ *
+ * If drop_err is set, drop any variable associated with errindex.
+ * If skip_count is set, skip the number of variable in pdu's list.
+ * While copy_count is greater than zero, copy pdu variables to newpdu.
+ *
+ * If an error occurs, newpdu is freed and pointer is set to 0.
+ *
+ * Returns a pointer to the cloned PDU if successful.
+ * Returns 0 if failure.
+ */
+static
+netsnmp_pdu *
+_copy_pdu_vars(netsnmp_pdu *pdu, /* source PDU */
+ netsnmp_pdu *newpdu, /* target PDU */
+ int drop_err, /* !=0 drop errored variable */
+ int skip_count, /* !=0 number of variables to skip */
+ int copy_count)
+{ /* !=0 number of variables to copy */
+ netsnmp_variable_list *var;
+#if TEMPORARILY_DISABLED
+ int copied;
+#endif
+ int drop_idx;
+
+ if (!newpdu)
+ return NULL; /* where is PDU to copy to ? */
+
+ if (drop_err)
+ drop_idx = pdu->errindex - skip_count;
+ else
+ drop_idx = 0;
+
+ var = pdu->variables;
+ while (var && (skip_count-- > 0)) /* skip over pdu variables */
+ var = var->next_variable;
+
+#if TEMPORARILY_DISABLED
+ copied = 0;
+ if (pdu->flags & UCD_MSG_FLAG_FORCE_PDU_COPY)
+ copied = 1; /* We're interested in 'empty' responses too */
+#endif
+
+ newpdu->variables = _copy_varlist(var, drop_idx, copy_count);
+#if TEMPORARILY_DISABLED
+ if (newpdu->variables)
+ copied = 1;
+#endif
+
+#if ALSO_TEMPORARILY_DISABLED
+ /*
+ * Error if bad errindex or if target PDU has no variables copied
+ */
+ if ((drop_err && (ii < pdu->errindex))
+#if TEMPORARILY_DISABLED
+ /*
+ * SNMPv3 engineID probes are allowed to be empty.
+ * See the comment in snmp_api.c for further details
+ */
+ || copied == 0
+#endif
+ ) {
+ snmp_free_pdu(newpdu);
+ return 0;
+ }
+#endif
+ return newpdu;
+}
+
+
+/*
+ * Creates (allocates and copies) a clone of the input PDU.
+ * If drop_err is set, don't copy any variable associated with errindex.
+ * This function is called by snmp_clone_pdu and snmp_fix_pdu.
+ *
+ * Returns a pointer to the cloned PDU if successful.
+ * Returns 0 if failure.
+ */
+static
+netsnmp_pdu *
+_clone_pdu(netsnmp_pdu *pdu, int drop_err)
+{
+ netsnmp_pdu *newpdu;
+ newpdu = _clone_pdu_header(pdu);
+ newpdu = _copy_pdu_vars(pdu, newpdu, drop_err, 0, 10000); /* skip none, copy all */
+
+ return newpdu;
+}
+
+
+/*
+ * This function will clone a full varbind list
+ *
+ * Returns a pointer to the cloned varbind list if successful.
+ * Returns 0 if failure
+ */
+netsnmp_variable_list *
+snmp_clone_varbind(netsnmp_variable_list * varlist)
+{
+ return _copy_varlist(varlist, 0, 10000); /* skip none, copy all */
+}
+
+/*
+ * This function will clone a PDU including all of its variables.
+ *
+ * Returns a pointer to the cloned PDU if successful.
+ * Returns 0 if failure
+ */
+netsnmp_pdu *
+snmp_clone_pdu(netsnmp_pdu *pdu)
+{
+ return _clone_pdu(pdu, 0); /* copies all variables */
+}
+
+
+/*
+ * This function will clone a PDU including some of its variables.
+ *
+ * If skip_count is not zero, it defines the number of variables to skip.
+ * If copy_count is not zero, it defines the number of variables to copy.
+ *
+ * Returns a pointer to the cloned PDU if successful.
+ * Returns 0 if failure.
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_SNMP_SPLIT_PDU
+netsnmp_pdu *
+snmp_split_pdu(netsnmp_pdu *pdu, int skip_count, int copy_count)
+{
+ netsnmp_pdu *newpdu;
+ newpdu = _clone_pdu_header(pdu);
+ newpdu = _copy_pdu_vars(pdu, newpdu, 0, /* don't drop any variables */
+ skip_count, copy_count);
+
+ return newpdu;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMP_SPLIT_PDU */
+
+
+/*
+ * If there was an error in the input pdu, creates a clone of the pdu
+ * that includes all the variables except the one marked by the errindex.
+ * The command is set to the input command and the reqid, errstat, and
+ * errindex are set to default values.
+ * If the error status didn't indicate an error, the error index didn't
+ * indicate a variable, the pdu wasn't a get response message, the
+ * marked variable was not present in the initial request, or there
+ * would be no remaining variables, this function will return 0.
+ * If everything was successful, a pointer to the fixed cloned pdu will
+ * be returned.
+ */
+netsnmp_pdu *
+snmp_fix_pdu(netsnmp_pdu *pdu, int command)
+{
+ netsnmp_pdu *newpdu;
+
+ if ((pdu->command != SNMP_MSG_RESPONSE)
+ || (pdu->errstat == SNMP_ERR_NOERROR)
+ || (NULL == pdu->variables)
+ || (pdu->errindex > (int)snmp_varbind_len(pdu))
+ || (pdu->errindex <= 0)) {
+ return NULL; /* pre-condition tests fail */
+ }
+
+ newpdu = _clone_pdu(pdu, 1); /* copies all except errored variable */
+ if (!newpdu)
+ return NULL;
+ if (!newpdu->variables) {
+ snmp_free_pdu(newpdu);
+ return NULL; /* no variables. "should not happen" */
+ }
+ newpdu->command = command;
+ newpdu->reqid = snmp_get_next_reqid();
+ newpdu->msgid = snmp_get_next_msgid();
+ newpdu->errstat = SNMP_DEFAULT_ERRSTAT;
+ newpdu->errindex = SNMP_DEFAULT_ERRINDEX;
+
+ return newpdu;
+}
+
+
+/*
+ * Returns the number of variables bound to a PDU structure
+ */
+unsigned long
+snmp_varbind_len(netsnmp_pdu *pdu)
+{
+ register netsnmp_variable_list *vars;
+ unsigned long retVal = 0;
+ if (pdu)
+ for (vars = pdu->variables; vars; vars = vars->next_variable) {
+ retVal++;
+ }
+
+ return retVal;
+}
+
+/*
+ * Add object identifier name to SNMP variable.
+ * If the name is large, additional memory is allocated.
+ * Returns 0 if successful.
+ */
+
+int
+snmp_set_var_objid(netsnmp_variable_list * vp,
+ const oid * objid, size_t name_length)
+{
+ size_t len = sizeof(oid) * name_length;
+
+ if (vp->name != vp->name_loc && vp->name != NULL) {
+ /*
+ * Probably previously-allocated "big storage". Better free it
+ * else memory leaks possible.
+ */
+ free(vp->name);
+ }
+
+ /*
+ * use built-in storage for smaller values
+ */
+ if (len <= sizeof(vp->name_loc)) {
+ vp->name = vp->name_loc;
+ } else {
+ vp->name = (oid *) malloc(len);
+ if (!vp->name)
+ return 1;
+ }
+ if (objid)
+ memmove(vp->name, objid, len);
+ vp->name_length = name_length;
+ return 0;
+}
+
+/**
+ * snmp_set_var_typed_value is used to set data into the netsnmp_variable_list
+ * structure. Used to return data to the snmp request via the
+ * netsnmp_request_info structure's requestvb pointer.
+ *
+ * @param newvar the structure gets populated with the given data, type,
+ * val_str, and val_len.
+ * @param type is the asn data type to be copied
+ * @param val_str is a buffer containing the value to be copied into the
+ * newvar structure.
+ * @param val_len the length of val_str
+ *
+ * @return returns 0 on success and 1 on a malloc error
+ */
+
+int
+snmp_set_var_typed_value(netsnmp_variable_list * newvar, u_char type,
+ const void * val_str, size_t val_len)
+{
+ newvar->type = type;
+ return snmp_set_var_value(newvar, val_str, val_len);
+}
+
+int
+snmp_set_var_typed_integer(netsnmp_variable_list * newvar,
+ u_char type, long val)
+{
+ newvar->type = type;
+ return snmp_set_var_value(newvar, &val, sizeof(long));
+}
+
+int
+count_varbinds(netsnmp_variable_list * var_ptr)
+{
+ int count = 0;
+
+ for (; var_ptr != NULL; var_ptr = var_ptr->next_variable)
+ count++;
+
+ return count;
+}
+
+netsnmp_feature_child_of(count_varbinds_of_type, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_COUNT_VARBINDS_OF_TYPE
+int
+count_varbinds_of_type(netsnmp_variable_list * var_ptr, u_char type)
+{
+ int count = 0;
+
+ for (; var_ptr != NULL; var_ptr = var_ptr->next_variable)
+ if (var_ptr->type == type)
+ count++;
+
+ return count;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_COUNT_VARBINDS_OF_TYPE */
+
+netsnmp_feature_child_of(find_varind_of_type, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_FIND_VARIND_OF_TYPE
+netsnmp_variable_list *
+find_varbind_of_type(netsnmp_variable_list * var_ptr, u_char type)
+{
+ for (; var_ptr != NULL && var_ptr->type != type;
+ var_ptr = var_ptr->next_variable);
+
+ return var_ptr;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_FIND_VARIND_OF_TYPE */
+
+netsnmp_variable_list*
+find_varbind_in_list( netsnmp_variable_list *vblist,
+ const oid *name, size_t len)
+{
+ for (; vblist != NULL; vblist = vblist->next_variable)
+ if (!snmp_oid_compare(vblist->name, vblist->name_length, name, len))
+ return vblist;
+
+ return NULL;
+}
+
+/*
+ * Add some value to SNMP variable.
+ * If the value is large, additional memory is allocated.
+ * Returns 0 if successful.
+ */
+
+int
+snmp_set_var_value(netsnmp_variable_list * vars,
+ const void * value, size_t len)
+{
+ int largeval = 1;
+
+ /*
+ * xxx-rks: why the unconditional free? why not use existing
+ * memory, if len < vars->val_len ?
+ */
+ if (vars->val.string && vars->val.string != vars->buf) {
+ free(vars->val.string);
+ }
+ vars->val.string = NULL;
+ vars->val_len = 0;
+
+ if (value == NULL && len > 0) {
+ snmp_log(LOG_ERR, "bad size for NULL value\n");
+ return 1;
+ }
+
+ /*
+ * use built-in storage for smaller values
+ */
+ if (len <= sizeof(vars->buf)) {
+ vars->val.string = (u_char *) vars->buf;
+ largeval = 0;
+ }
+
+ if ((0 == len) || (NULL == value)) {
+ vars->val.string[0] = 0;
+ return 0;
+ }
+
+ vars->val_len = len;
+ switch (vars->type) {
+ case ASN_INTEGER:
+ case ASN_UNSIGNED:
+ case ASN_TIMETICKS:
+ case ASN_COUNTER:
+ case ASN_UINTEGER:
+ if (vars->val_len == sizeof(int)) {
+ if (ASN_INTEGER == vars->type) {
+ const int *val_int
+ = (const int *) value;
+ *(vars->val.integer) = (long) *val_int;
+ } else {
+ const u_int *val_uint
+ = (const u_int *) value;
+ *(vars->val.integer) = (unsigned long) *val_uint;
+ }
+ }
+#if SIZEOF_LONG != SIZEOF_INT
+ else if (vars->val_len == sizeof(long)){
+ const u_long *val_ulong
+ = (const u_long *) value;
+ *(vars->val.integer) = *val_ulong;
+ if (*(vars->val.integer) > 0xffffffff) {
+ snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
+ *(vars->val.integer) &= 0xffffffff;
+ }
+ }
+#endif
+#if defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG != SIZEOF_LONG_LONG)
+#if !defined(SIZEOF_INTMAX_T) || (SIZEOF_LONG_LONG != SIZEOF_INTMAX_T)
+ else if (vars->val_len == sizeof(long long)){
+ const unsigned long long *val_ullong
+ = (const unsigned long long *) value;
+ *(vars->val.integer) = (long) *val_ullong;
+ if (*(vars->val.integer) > 0xffffffff) {
+ snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
+ *(vars->val.integer) &= 0xffffffff;
+ }
+ }
+#endif
+#endif
+#if defined(SIZEOF_INTMAX_T) && (SIZEOF_LONG != SIZEOF_INTMAX_T)
+ else if (vars->val_len == sizeof(intmax_t)){
+ const uintmax_t *val_uintmax_t
+ = (const uintmax_t *) value;
+ *(vars->val.integer) = (long) *val_uintmax_t;
+ if (*(vars->val.integer) > 0xffffffff) {
+ snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
+ *(vars->val.integer) &= 0xffffffff;
+ }
+ }
+#endif
+#if SIZEOF_SHORT != SIZEOF_INT
+ else if (vars->val_len == sizeof(short)) {
+ if (ASN_INTEGER == vars->type) {
+ const short *val_short
+ = (const short *) value;
+ *(vars->val.integer) = (long) *val_short;
+ } else {
+ const u_short *val_ushort
+ = (const u_short *) value;
+ *(vars->val.integer) = (unsigned long) *val_ushort;
+ }
+ }
+#endif
+ else if (vars->val_len == sizeof(char)) {
+ if (ASN_INTEGER == vars->type) {
+ const char *val_char
+ = (const char *) value;
+ *(vars->val.integer) = (long) *val_char;
+ } else {
+ const u_char *val_uchar
+ = (const u_char *) value;
+ *(vars->val.integer) = (unsigned long) *val_uchar;
+ }
+ }
+ else {
+ snmp_log(LOG_ERR,"bad size for integer-like type (%d)\n",
+ (int)vars->val_len);
+ return (1);
+ }
+ vars->val_len = sizeof(long);
+ break;
+
+ case ASN_OBJECT_ID:
+ case ASN_PRIV_IMPLIED_OBJECT_ID:
+ case ASN_PRIV_INCL_RANGE:
+ case ASN_PRIV_EXCL_RANGE:
+ if (largeval) {
+ vars->val.objid = (oid *) malloc(vars->val_len);
+ }
+ if (vars->val.objid == NULL) {
+ snmp_log(LOG_ERR,"no storage for OID\n");
+ return 1;
+ }
+ memmove(vars->val.objid, value, vars->val_len);
+ break;
+
+ case ASN_IPADDRESS: /* snmp_build_var_op treats IPADDR like a string */
+ if (4 != vars->val_len) {
+ netsnmp_assert("ipaddress length == 4");
+ }
+ /** FALL THROUGH */
+ case ASN_PRIV_IMPLIED_OCTET_STR:
+ case ASN_OCTET_STR:
+ case ASN_BIT_STR:
+ case ASN_OPAQUE:
+ case ASN_NSAP:
+ if (vars->val_len >= sizeof(vars->buf)) {
+ vars->val.string = (u_char *) malloc(vars->val_len + 1);
+ }
+ if (vars->val.string == NULL) {
+ snmp_log(LOG_ERR,"no storage for string\n");
+ return 1;
+ }
+ memmove(vars->val.string, value, vars->val_len);
+ /*
+ * Make sure the string is zero-terminated; some bits of code make
+ * this assumption. Easier to do this here than fix all these wrong
+ * assumptions.
+ */
+ vars->val.string[vars->val_len] = '\0';
+ break;
+
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ case ASN_NULL:
+ vars->val_len = 0;
+ vars->val.string = NULL;
+ break;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_U64:
+ case ASN_OPAQUE_I64:
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ case ASN_COUNTER64:
+ if (largeval) {
+ snmp_log(LOG_ERR,"bad size for counter 64 (%d)\n",
+ (int)vars->val_len);
+ return (1);
+ }
+ vars->val_len = sizeof(struct counter64);
+ memmove(vars->val.counter64, value, vars->val_len);
+ break;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_FLOAT:
+ if (largeval) {
+ snmp_log(LOG_ERR,"bad size for opaque float (%d)\n",
+ (int)vars->val_len);
+ return (1);
+ }
+ vars->val_len = sizeof(float);
+ memmove(vars->val.floatVal, value, vars->val_len);
+ break;
+
+ case ASN_OPAQUE_DOUBLE:
+ if (largeval) {
+ snmp_log(LOG_ERR,"bad size for opaque double (%d)\n",
+ (int)vars->val_len);
+ return (1);
+ }
+ vars->val_len = sizeof(double);
+ memmove(vars->val.doubleVal, value, vars->val_len);
+ break;
+
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+
+ default:
+ snmp_log(LOG_ERR,"Internal error in type switching\n");
+ snmp_set_detail("Internal error in type switching\n");
+ return (1);
+ }
+
+ return 0;
+}
+
+void
+snmp_replace_var_types(netsnmp_variable_list * vbl, u_char old_type,
+ u_char new_type)
+{
+ while (vbl) {
+ if (vbl->type == old_type) {
+ snmp_set_var_typed_value(vbl, new_type, NULL, 0);
+ }
+ vbl = vbl->next_variable;
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMP_RESET_VAR_TYPES
+void
+snmp_reset_var_types(netsnmp_variable_list * vbl, u_char new_type)
+{
+ while (vbl) {
+ snmp_set_var_typed_value(vbl, new_type, NULL, 0);
+ vbl = vbl->next_variable;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMP_RESET_VAR_TYPES */
+
+int
+snmp_synch_response_cb(netsnmp_session * ss,
+ netsnmp_pdu *pdu,
+ netsnmp_pdu **response, snmp_callback pcb)
+{
+ struct synch_state lstate, *state;
+ snmp_callback cbsav;
+ void *cbmagsav;
+ int numfds, count;
+ fd_set fdset;
+ struct timeval timeout, *tvp;
+ int block;
+
+ memset((void *) &lstate, 0, sizeof(lstate));
+ state = &lstate;
+ cbsav = ss->callback;
+ cbmagsav = ss->callback_magic;
+ ss->callback = pcb;
+ ss->callback_magic = (void *) state;
+
+ if ((state->reqid = snmp_send(ss, pdu)) == 0) {
+ snmp_free_pdu(pdu);
+ state->status = STAT_ERROR;
+ } else
+ state->waiting = 1;
+
+ while (state->waiting) {
+ numfds = 0;
+ FD_ZERO(&fdset);
+ block = NETSNMP_SNMPBLOCK;
+ tvp = &timeout;
+ timerclear(tvp);
+ snmp_sess_select_info_flags(0, &numfds, &fdset, tvp, &block,
+ NETSNMP_SELECT_NOALARMS);
+ if (block == 1)
+ tvp = NULL; /* block without timeout */
+ count = select(numfds, &fdset, NULL, NULL, tvp);
+ if (count > 0) {
+ snmp_read(&fdset);
+ } else {
+ switch (count) {
+ case 0:
+ snmp_timeout();
+ break;
+ case -1:
+ if (errno == EINTR) {
+ continue;
+ } else {
+ snmp_errno = SNMPERR_GENERR; /*MTCRITICAL_RESOURCE */
+ /*
+ * CAUTION! if another thread closed the socket(s)
+ * waited on here, the session structure was freed.
+ * It would be nice, but we can't rely on the pointer.
+ * ss->s_snmp_errno = SNMPERR_GENERR;
+ * ss->s_errno = errno;
+ */
+ snmp_set_detail(strerror(errno));
+ }
+ /*
+ * FALLTHRU
+ */
+ default:
+ state->status = STAT_ERROR;
+ state->waiting = 0;
+ }
+ }
+
+ if ( ss->flags & SNMP_FLAGS_RESP_CALLBACK ) {
+ void (*cb)(void);
+ cb = (void (*)(void))(ss->myvoid);
+ cb(); /* Used to invoke 'netsnmp_check_outstanding_agent_requests();'
+ on internal AgentX queries. */
+ }
+ }
+ *response = state->pdu;
+ ss->callback = cbsav;
+ ss->callback_magic = cbmagsav;
+ return state->status;
+}
+
+int
+snmp_synch_response(netsnmp_session * ss,
+ netsnmp_pdu *pdu, netsnmp_pdu **response)
+{
+ return snmp_synch_response_cb(ss, pdu, response, snmp_synch_input);
+}
+
+int
+snmp_sess_synch_response(void *sessp,
+ netsnmp_pdu *pdu, netsnmp_pdu **response)
+{
+ netsnmp_session *ss;
+ struct synch_state lstate, *state;
+ snmp_callback cbsav;
+ void *cbmagsav;
+ int numfds, count;
+ fd_set fdset;
+ struct timeval timeout, *tvp;
+ int block;
+
+ ss = snmp_sess_session(sessp);
+ if (ss == NULL) {
+ return STAT_ERROR;
+ }
+
+ memset((void *) &lstate, 0, sizeof(lstate));
+ state = &lstate;
+ cbsav = ss->callback;
+ cbmagsav = ss->callback_magic;
+ ss->callback = snmp_synch_input;
+ ss->callback_magic = (void *) state;
+
+ if ((state->reqid = snmp_sess_send(sessp, pdu)) == 0) {
+ snmp_free_pdu(pdu);
+ state->status = STAT_ERROR;
+ } else
+ state->waiting = 1;
+
+ while (state->waiting) {
+ numfds = 0;
+ FD_ZERO(&fdset);
+ block = NETSNMP_SNMPBLOCK;
+ tvp = &timeout;
+ timerclear(tvp);
+ snmp_sess_select_info_flags(sessp, &numfds, &fdset, tvp, &block,
+ NETSNMP_SELECT_NOALARMS);
+ if (block == 1)
+ tvp = NULL; /* block without timeout */
+ count = select(numfds, &fdset, NULL, NULL, tvp);
+ if (count > 0) {
+ snmp_sess_read(sessp, &fdset);
+ } else
+ switch (count) {
+ case 0:
+ snmp_sess_timeout(sessp);
+ break;
+ case -1:
+ if (errno == EINTR) {
+ continue;
+ } else {
+ snmp_errno = SNMPERR_GENERR; /*MTCRITICAL_RESOURCE */
+ /*
+ * CAUTION! if another thread closed the socket(s)
+ * waited on here, the session structure was freed.
+ * It would be nice, but we can't rely on the pointer.
+ * ss->s_snmp_errno = SNMPERR_GENERR;
+ * ss->s_errno = errno;
+ */
+ snmp_set_detail(strerror(errno));
+ }
+ /*
+ * FALLTHRU
+ */
+ default:
+ state->status = STAT_ERROR;
+ state->waiting = 0;
+ }
+ }
+ *response = state->pdu;
+ ss->callback = cbsav;
+ ss->callback_magic = cbmagsav;
+ return state->status;
+}
+
+
+const char *
+snmp_errstring(int errstat)
+{
+ const char * const error_string[19] = {
+ "(noError) No Error",
+ "(tooBig) Response message would have been too large.",
+ "(noSuchName) There is no such variable name in this MIB.",
+ "(badValue) The value given has the wrong type or length.",
+ "(readOnly) The two parties used do not have access to use the specified SNMP PDU.",
+ "(genError) A general failure occured",
+ "noAccess",
+ "wrongType (The set datatype does not match the data type the agent expects)",
+ "wrongLength (The set value has an illegal length from what the agent expects)",
+ "wrongEncoding",
+ "wrongValue (The set value is illegal or unsupported in some way)",
+ "noCreation (That table does not support row creation or that object can not ever be created)",
+ "inconsistentValue (The set value is illegal or unsupported in some way)",
+ "resourceUnavailable (This is likely a out-of-memory failure within the agent)",
+ "commitFailed",
+ "undoFailed",
+ "authorizationError (access denied to that object)",
+ "notWritable (That object does not support modification)",
+ "inconsistentName (That object can not currently be created)"
+ };
+
+ if (errstat <= MAX_SNMP_ERR && errstat >= SNMP_ERR_NOERROR) {
+ return error_string[errstat];
+ } else {
+ return "Unknown Error";
+ }
+}
+
+
+
+/*
+ *
+ * Convenience routines to make various requests
+ * over the specified SNMP session.
+ *
+ */
+#include <net-snmp/library/snmp_debug.h>
+
+static netsnmp_session *_def_query_session = NULL;
+
+#ifndef NETSNMP_FEATURE_REMOVE_QUERY_SET_DEFAULT_SESSION
+void
+netsnmp_query_set_default_session( netsnmp_session *sess) {
+ DEBUGMSGTL(("iquery", "set default session %p\n", sess));
+ _def_query_session = sess;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_QUERY_SET_DEFAULT_SESSION */
+
+/**
+ * Return a pointer to the default internal query session.
+ */
+netsnmp_session *
+netsnmp_query_get_default_session_unchecked( void ) {
+ DEBUGMSGTL(("iquery", "get default session %p\n", _def_query_session));
+ return _def_query_session;
+}
+
+/**
+ * Return a pointer to the default internal query session and log a
+ * warning message once if this session does not exist.
+ */
+netsnmp_session *
+netsnmp_query_get_default_session( void ) {
+ static int warning_logged = 0;
+
+ if (! _def_query_session && ! warning_logged) {
+ if (! netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME)) {
+ snmp_log(LOG_WARNING,
+ "iquerySecName has not been configured - internal queries will fail\n");
+ } else {
+ snmp_log(LOG_WARNING,
+ "default session is not available - internal queries will fail\n");
+ }
+ warning_logged = 1;
+ }
+
+ return netsnmp_query_get_default_session_unchecked();
+}
+
+
+/*
+ * Internal utility routine to actually send the query
+ */
+static int _query(netsnmp_variable_list *list,
+ int request,
+ netsnmp_session *session) {
+
+ netsnmp_pdu *pdu = snmp_pdu_create( request );
+ netsnmp_pdu *response = NULL;
+ netsnmp_variable_list *vb1, *vb2, *vtmp;
+ int ret, count;
+
+ DEBUGMSGTL(("iquery", "query on session %p\n", session));
+ /*
+ * Clone the varbind list into the request PDU...
+ */
+ pdu->variables = snmp_clone_varbind( list );
+retry:
+ if ( session )
+ ret = snmp_synch_response( session, pdu, &response );
+ else if (_def_query_session)
+ ret = snmp_synch_response( _def_query_session, pdu, &response );
+ else {
+ /* No session specified */
+ snmp_free_pdu(pdu);
+ return SNMP_ERR_GENERR;
+ }
+ DEBUGMSGTL(("iquery", "query returned %d\n", ret));
+
+ /*
+ * ....then copy the results back into the
+ * list (assuming the request succeeded!).
+ * This avoids having to worry about how this
+ * list was originally allocated.
+ */
+ if ( ret == SNMP_ERR_NOERROR ) {
+ if ( response->errstat != SNMP_ERR_NOERROR ) {
+ DEBUGMSGT(("iquery", "Error in packet: %s\n",
+ snmp_errstring(response->errstat)));
+ /*
+ * If the request failed, then remove the
+ * offending varbind and try again.
+ * (all except SET requests)
+ *
+ * XXX - implement a library version of
+ * NETSNMP_DS_APP_DONT_FIX_PDUS ??
+ */
+ ret = response->errstat;
+ if (response->errindex != 0) {
+ DEBUGMSGT(("iquery:result", "Failed object:\n"));
+ for (count = 1, vtmp = response->variables;
+ vtmp && count != response->errindex;
+ vtmp = vtmp->next_variable, count++)
+ /*EMPTY*/;
+ if (vtmp)
+ DEBUGMSGVAR(("iquery:result", vtmp));
+ DEBUGMSG(("iquery:result", "\n"));
+ }
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+ if (request != SNMP_MSG_SET &&
+ response->errindex != 0) {
+ DEBUGMSGTL(("iquery", "retrying query (%d, %ld)\n", ret, response->errindex));
+ pdu = snmp_fix_pdu( response, request );
+ snmp_free_pdu( response );
+ response = NULL;
+ if ( pdu != NULL )
+ goto retry;
+ }
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+ } else {
+ for (vb1 = response->variables, vb2 = list;
+ vb1;
+ vb1 = vb1->next_variable, vb2 = vb2->next_variable) {
+ DEBUGMSGVAR(("iquery:result", vb1));
+ DEBUGMSG(("iquery:results", "\n"));
+ if ( !vb2 ) {
+ ret = SNMP_ERR_GENERR;
+ break;
+ }
+ vtmp = vb2->next_variable;
+ snmp_free_var_internals( vb2 );
+ snmp_clone_var( vb1, vb2 );
+ vb2->next_variable = vtmp;
+ }
+ }
+ } else {
+ /* Distinguish snmp_send errors from SNMP errStat errors */
+ ret = -ret;
+ }
+ snmp_free_pdu( response );
+ return ret;
+}
+
+/*
+ * These are simple wrappers round the internal utility routine
+ */
+int netsnmp_query_get(netsnmp_variable_list *list,
+ netsnmp_session *session){
+ return _query( list, SNMP_MSG_GET, session );
+}
+
+
+int netsnmp_query_getnext(netsnmp_variable_list *list,
+ netsnmp_session *session){
+ return _query( list, SNMP_MSG_GETNEXT, session );
+}
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+int netsnmp_query_set(netsnmp_variable_list *list,
+ netsnmp_session *session){
+ return _query( list, SNMP_MSG_SET, session );
+}
+#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * A walk needs a bit more work.
+ */
+int netsnmp_query_walk(netsnmp_variable_list *list,
+ netsnmp_session *session) {
+ /*
+ * Create a working copy of the original (single)
+ * varbind, so we can use this varbind parameter
+ * to check when we've finished walking this subtree.
+ */
+ netsnmp_variable_list *vb = snmp_clone_varbind( list );
+ netsnmp_variable_list *res_list = NULL;
+ netsnmp_variable_list *res_last = NULL;
+ int ret;
+
+ /*
+ * Now walk the tree as usual
+ */
+ ret = _query( vb, SNMP_MSG_GETNEXT, session );
+ while ( ret == SNMP_ERR_NOERROR &&
+ snmp_oidtree_compare( list->name, list->name_length,
+ vb->name, vb->name_length ) == 0) {
+
+ /*
+ * Copy each response varbind to the end of the result list
+ * and then re-use this to ask for the next entry.
+ */
+ if ( res_last ) {
+ res_last->next_variable = snmp_clone_varbind( vb );
+ res_last = res_last->next_variable;
+ } else {
+ res_list = snmp_clone_varbind( vb );
+ res_last = res_list;
+ }
+ ret = _query( vb, SNMP_MSG_GETNEXT, session );
+ }
+ /*
+ * Copy the first result back into the original varbind parameter,
+ * add the rest of the results (if any), and clean up.
+ */
+ if ( res_list ) {
+ snmp_clone_var( res_list, list );
+ list->next_variable = res_list->next_variable;
+ res_list->next_variable = NULL;
+ snmp_free_varbind( res_list );
+ }
+ snmp_free_varbind( vb );
+ return ret;
+}
+
+/** **************************************************************************
+ *
+ * state machine
+ *
+ */
+int
+netsnmp_state_machine_run( netsnmp_state_machine_input *input)
+{
+ netsnmp_state_machine_step *current, *last;
+
+ netsnmp_require_ptr_LRV( input, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( input->steps, SNMPERR_GENERR );
+ last = current = input->steps;
+
+ DEBUGMSGT(("state_machine:run", "starting step: %s\n", current->name));
+
+ while (current) {
+
+ /*
+ * log step and check for required data
+ */
+ DEBUGMSGT(("state_machine:run", "at step: %s\n", current->name));
+ if (NULL == current->run) {
+ DEBUGMSGT(("state_machine:run", "no run step\n"));
+ current->result = last->result;
+ break;
+ }
+
+ /*
+ * run step
+ */
+ DEBUGMSGT(("state_machine:run", "running step: %s\n", current->name));
+ current->result = (*current->run)( input, current );
+ ++input->steps_so_far;
+
+ /*
+ * log result and move to next step
+ */
+ input->last_run = current;
+ DEBUGMSGT(("state_machine:run:result", "step %s returned %d\n",
+ current->name, current->result));
+ if (SNMPERR_SUCCESS == current->result)
+ current = current->on_success;
+ else if (SNMPERR_ABORT == current->result) {
+ DEBUGMSGT(("state_machine:run:result", "ABORT from %s\n",
+ current->name));
+ break;
+ }
+ else
+ current = current->on_error;
+ }
+
+ /*
+ * run cleanup
+ */
+ if ((input->cleanup) && (input->cleanup->run))
+ (*input->cleanup->run)( input, input->last_run );
+
+ return input->last_run->result;
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+#ifndef NETSNMP_FEATURE_REMOVE_ROW_CREATE
+/** **************************************************************************
+ *
+ * row create state machine steps
+ *
+ */
+typedef struct rowcreate_state_s {
+
+ netsnmp_session *session;
+ netsnmp_variable_list *vars;
+ int row_status_index;
+} rowcreate_state;
+
+static netsnmp_variable_list *
+_get_vb_num(netsnmp_variable_list *vars, int index)
+{
+ for (; vars && index > 0; --index)
+ vars = vars->next_variable;
+
+ if (!vars || index > 0)
+ return NULL;
+
+ return vars;
+}
+
+
+/*
+ * cleanup
+ */
+static int
+_row_status_state_cleanup(netsnmp_state_machine_input *input,
+ netsnmp_state_machine_step *step)
+{
+ rowcreate_state *ctx;
+
+ netsnmp_require_ptr_LRV( input, SNMPERR_ABORT );
+ netsnmp_require_ptr_LRV( step, SNMPERR_ABORT );
+
+ DEBUGMSGT(("row_create:called", "_row_status_state_cleanup, last run step was %s rc %d\n",
+ step->name, step->result));
+
+ ctx = (rowcreate_state *)input->input_context;
+ if (ctx && ctx->vars)
+ snmp_free_varbind( ctx->vars );
+
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * send a request to activate the row
+ */
+static int
+_row_status_state_activate(netsnmp_state_machine_input *input,
+ netsnmp_state_machine_step *step)
+{
+ rowcreate_state *ctx;
+ netsnmp_variable_list *rs_var, *var = NULL;
+ int32_t rc, val = RS_ACTIVE;
+
+ netsnmp_require_ptr_LRV( input, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( step, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( input->input_context, SNMPERR_GENERR );
+
+ ctx = (rowcreate_state *)input->input_context;
+
+ DEBUGMSGT(("row_create:called", "called %s\n", step->name));
+
+ /*
+ * just send the rowstatus varbind
+ */
+ rs_var = _get_vb_num(ctx->vars, ctx->row_status_index);
+ netsnmp_require_ptr_LRV(rs_var, SNMPERR_GENERR);
+
+ var = snmp_varlist_add_variable(&var, rs_var->name, rs_var->name_length,
+ rs_var->type, &val, sizeof(val));
+ netsnmp_require_ptr_LRV( var, SNMPERR_GENERR );
+
+ /*
+ * send set
+ */
+ rc = netsnmp_query_set( var, ctx->session );
+ if (-2 == rc)
+ rc = SNMPERR_ABORT;
+
+ snmp_free_varbind(var);
+
+ return rc;
+}
+
+/*
+ * send each non-row status column, one at a time
+ */
+static int
+_row_status_state_single_value_cols(netsnmp_state_machine_input *input,
+ netsnmp_state_machine_step *step)
+{
+ rowcreate_state *ctx;
+ netsnmp_variable_list *var, *tmp_next, *row_status;
+ int rc = SNMPERR_GENERR;
+
+ netsnmp_require_ptr_LRV( input, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( step, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( input->input_context, SNMPERR_GENERR );
+
+ ctx = (rowcreate_state *)input->input_context;
+
+ DEBUGMSGT(("row_create:called", "called %s\n", step->name));
+
+ row_status = _get_vb_num(ctx->vars, ctx->row_status_index);
+ netsnmp_require_ptr_LRV(row_status, SNMPERR_GENERR);
+
+ /*
+ * try one varbind at a time
+ */
+ for (var = ctx->vars; var; var = var->next_variable) {
+ if (var == row_status)
+ continue;
+
+ tmp_next = var->next_variable;
+ var->next_variable = NULL;
+
+ /*
+ * send set
+ */
+ rc = netsnmp_query_set( var, ctx->session );
+ var->next_variable = tmp_next;
+ if (-2 == rc)
+ rc = SNMPERR_ABORT;
+ if (rc != SNMPERR_SUCCESS)
+ break;
+ }
+
+ return rc;
+}
+
+/*
+ * send all values except row status
+ */
+static int
+_row_status_state_multiple_values_cols(netsnmp_state_machine_input *input,
+ netsnmp_state_machine_step *step)
+{
+ rowcreate_state *ctx;
+ netsnmp_variable_list *vars, *var, *last, *row_status;
+ int rc;
+
+ netsnmp_require_ptr_LRV( input, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( step, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( input->input_context, SNMPERR_GENERR );
+
+ ctx = (rowcreate_state *)input->input_context;
+
+ DEBUGMSGT(("row_create:called", "called %s\n", step->name));
+
+ vars = snmp_clone_varbind(ctx->vars);
+ netsnmp_require_ptr_LRV(vars, SNMPERR_GENERR);
+
+ row_status = _get_vb_num(vars, ctx->row_status_index);
+ if (NULL == row_status) {
+ snmp_free_varbind(vars);
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * remove row status varbind
+ */
+ if (row_status == vars) {
+ vars = row_status->next_variable;
+ row_status->next_variable = NULL;
+ }
+ else {
+ for (last=vars, var=last->next_variable;
+ var;
+ last=var, var = var->next_variable) {
+ if (var == row_status) {
+ last->next_variable = var->next_variable;
+ break;
+ }
+ }
+ }
+ snmp_free_var(row_status);
+
+ /*
+ * send set
+ */
+ rc = netsnmp_query_set( vars, ctx->session );
+ if (-2 == rc)
+ rc = SNMPERR_ABORT;
+
+ snmp_free_varbind(vars);
+
+ return rc;
+}
+
+/*
+ * send a createAndWait request with no other values
+ */
+static int
+_row_status_state_single_value_createAndWait(netsnmp_state_machine_input *input,
+ netsnmp_state_machine_step *step)
+{
+ rowcreate_state *ctx;
+ netsnmp_variable_list *var = NULL, *rs_var;
+ int32_t rc, val = RS_CREATEANDWAIT;
+
+ netsnmp_require_ptr_LRV( input, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( step, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( input->input_context, SNMPERR_GENERR );
+
+ ctx = (rowcreate_state *)input->input_context;
+
+ DEBUGMSGT(("row_create:called", "called %s\n", step->name));
+
+ rs_var = _get_vb_num(ctx->vars, ctx->row_status_index);
+ netsnmp_require_ptr_LRV(rs_var, SNMPERR_GENERR);
+
+ var = snmp_varlist_add_variable(&var, rs_var->name, rs_var->name_length,
+ rs_var->type, &val, sizeof(val));
+ netsnmp_require_ptr_LRV(var, SNMPERR_GENERR);
+
+ /*
+ * send set
+ */
+ rc = netsnmp_query_set( var, ctx->session );
+ if (-2 == rc)
+ rc = SNMPERR_ABORT;
+
+ snmp_free_varbind(var);
+
+ return rc;
+}
+
+/*
+ * send a creatAndWait request with all values
+ */
+static int
+_row_status_state_all_values_createAndWait(netsnmp_state_machine_input *input,
+ netsnmp_state_machine_step *step)
+{
+ rowcreate_state *ctx;
+ netsnmp_variable_list *vars, *rs_var;
+ int rc;
+
+ netsnmp_require_ptr_LRV( input, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( step, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( input->input_context, SNMPERR_GENERR );
+
+ ctx = (rowcreate_state *)input->input_context;
+
+ DEBUGMSGT(("row_create:called", "called %s\n", step->name));
+
+ vars = snmp_clone_varbind(ctx->vars);
+ netsnmp_require_ptr_LRV(vars, SNMPERR_GENERR);
+
+ /*
+ * make sure row stats is createAndWait
+ */
+ rs_var = _get_vb_num(vars, ctx->row_status_index);
+ if (NULL == rs_var) {
+ snmp_free_varbind(vars);
+ return SNMPERR_GENERR;
+ }
+
+ if (*rs_var->val.integer != RS_CREATEANDWAIT)
+ *rs_var->val.integer = RS_CREATEANDWAIT;
+
+ /*
+ * send set
+ */
+ rc = netsnmp_query_set( vars, ctx->session );
+ if (-2 == rc)
+ rc = SNMPERR_ABORT;
+
+ snmp_free_varbind(vars);
+
+ return rc;
+}
+
+
+/**
+ * send createAndGo request with all values
+ */
+static int
+_row_status_state_all_values_createAndGo(netsnmp_state_machine_input *input,
+ netsnmp_state_machine_step *step)
+{
+ rowcreate_state *ctx;
+ netsnmp_variable_list *vars, *rs_var;
+ int rc;
+
+ netsnmp_require_ptr_LRV( input, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( step, SNMPERR_GENERR );
+ netsnmp_require_ptr_LRV( input->input_context, SNMPERR_GENERR );
+
+ ctx = (rowcreate_state *)input->input_context;
+
+ DEBUGMSGT(("row_create:called", "called %s\n", step->name));
+
+ vars = snmp_clone_varbind(ctx->vars);
+ netsnmp_require_ptr_LRV(vars, SNMPERR_GENERR);
+
+ /*
+ * make sure row stats is createAndGo
+ */
+ rs_var = _get_vb_num(vars, ctx->row_status_index + 1);
+ if (NULL == rs_var) {
+ snmp_free_varbind(vars);
+ return SNMPERR_GENERR;
+ }
+
+ if (*rs_var->val.integer != RS_CREATEANDGO)
+ *rs_var->val.integer = RS_CREATEANDGO;
+
+ /*
+ * send set
+ */
+ rc = netsnmp_query_set( vars, ctx->session );
+ if (-2 == rc)
+ rc = SNMPERR_ABORT;
+
+ snmp_free_varbind(vars);
+
+ return rc;
+}
+
+/** **************************************************************************
+ *
+ * row api
+ *
+ */
+int
+netsnmp_row_create(netsnmp_session *sess, netsnmp_variable_list *vars,
+ int row_status_index)
+{
+ netsnmp_state_machine_step rc_cleanup =
+ { "row_create_cleanup", 0, _row_status_state_cleanup,
+ 0, NULL, NULL, 0, NULL };
+ netsnmp_state_machine_step rc_activate =
+ { "row_create_activate", 0, _row_status_state_activate,
+ 0, NULL, NULL, 0, NULL };
+ netsnmp_state_machine_step rc_sv_cols =
+ { "row_create_single_value_cols", 0,
+ _row_status_state_single_value_cols, 0, &rc_activate,NULL, 0, NULL };
+ netsnmp_state_machine_step rc_mv_cols =
+ { "row_create_multiple_values_cols", 0,
+ _row_status_state_multiple_values_cols, 0, &rc_activate, &rc_sv_cols,
+ 0, NULL };
+ netsnmp_state_machine_step rc_sv_caw =
+ { "row_create_single_value_createAndWait", 0,
+ _row_status_state_single_value_createAndWait, 0, &rc_mv_cols, NULL,
+ 0, NULL };
+ netsnmp_state_machine_step rc_av_caw =
+ { "row_create_all_values_createAndWait", 0,
+ _row_status_state_all_values_createAndWait, 0, &rc_activate,
+ &rc_sv_caw, 0, NULL };
+ netsnmp_state_machine_step rc_av_cag =
+ { "row_create_all_values_createAndGo", 0,
+ _row_status_state_all_values_createAndGo, 0, NULL, &rc_av_caw, 0,
+ NULL };
+
+ netsnmp_state_machine_input sm_input = { "row_create_machine", 0,
+ &rc_av_cag, &rc_cleanup };
+ rowcreate_state state;
+
+ netsnmp_require_ptr_LRV( sess, SNMPERR_GENERR);
+ netsnmp_require_ptr_LRV( vars, SNMPERR_GENERR);
+
+ state.session = sess;
+ state.vars = vars;
+
+ state.row_status_index = row_status_index;
+ sm_input.input_context = &state;
+
+ netsnmp_state_machine_run( &sm_input);
+
+ return SNMPERR_SUCCESS;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_ROW_CREATE */
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+
+/** @} */
diff --git a/snmplib/snmp_debug.c b/snmplib/snmp_debug.c
new file mode 100644
index 0000000..27ce233
--- /dev/null
+++ b/snmplib/snmp_debug.c
@@ -0,0 +1,578 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <limits.h>
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <stdarg.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/library/snmp_debug.h> /* For this file's "internal" definitions */
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/snmp_api.h>
+
+#define SNMP_DEBUG_DISABLED 0
+#define SNMP_DEBUG_ACTIVE 1
+#define SNMP_DEBUG_EXCLUDED 2
+
+#ifndef NETSNMP_NO_DEBUGGING
+
+static int dodebug = NETSNMP_ALWAYS_DEBUG;
+int debug_num_tokens = 0;
+static int debug_print_everything = 0;
+
+netsnmp_token_descr dbg_tokens[MAX_DEBUG_TOKENS];
+
+/*
+ * Number of spaces to indent debug outpur. Valid range is [0,INT_MAX]
+ */
+static int debugindent = 0;
+
+int
+debug_indent_get(void)
+{
+ return debugindent;
+}
+
+const char*
+debug_indent(void)
+{
+#define SPACES " " \
+ " "
+ if ((sizeof(SPACES) - 1) < (unsigned int)debugindent) {
+ snmp_log(LOG_ERR, "Too deep indentation for debug_indent. "
+ "Consider using \"%%*s\", debug_indent_get(), \"\" instead.");
+ return SPACES;
+ }
+ return SPACES + sizeof(SPACES) - 1 - debugindent;
+#undef SPACES
+}
+
+void
+debug_indent_add(int amount)
+{
+ if (-debugindent <= amount && amount <= INT_MAX - debugindent)
+ debugindent += amount;
+}
+
+NETSNMP_IMPORT void
+debug_config_register_tokens(const char *configtoken, char *tokens);
+
+void
+debug_config_register_tokens(const char *configtoken, char *tokens)
+{
+ debug_register_tokens(tokens);
+}
+
+NETSNMP_IMPORT void
+debug_config_turn_on_debugging(const char *configtoken, char *line);
+
+void
+debug_config_turn_on_debugging(const char *configtoken, char *line)
+{
+ snmp_set_do_debugging(atoi(line));
+}
+
+void
+debug_register_tokens(const char *tokens)
+{
+ char *newp, *cp;
+ char *st = NULL;
+ int status;
+
+ if (tokens == NULL || *tokens == 0)
+ return;
+
+ newp = strdup(tokens); /* strtok_r messes it up */
+ cp = strtok_r(newp, DEBUG_TOKEN_DELIMITER, &st);
+ while (cp) {
+ if (strlen(cp) < MAX_DEBUG_TOKEN_LEN) {
+ if (strcasecmp(cp, DEBUG_ALWAYS_TOKEN) == 0) {
+ debug_print_everything = 1;
+ } else if (debug_num_tokens < MAX_DEBUG_TOKENS) {
+ if ('-' == *cp) {
+ ++cp;
+ status = SNMP_DEBUG_EXCLUDED;
+ }
+ else
+ status = SNMP_DEBUG_ACTIVE;
+ dbg_tokens[debug_num_tokens].token_name = strdup(cp);
+ dbg_tokens[debug_num_tokens++].enabled = status;
+ snmp_log(LOG_NOTICE, "registered debug token %s, %d\n", cp, status);
+ } else {
+ snmp_log(LOG_NOTICE, "Unable to register debug token %s\n", cp);
+ }
+ } else {
+ snmp_log(LOG_NOTICE, "Debug token %s over length\n", cp);
+ }
+ cp = strtok_r(NULL, DEBUG_TOKEN_DELIMITER, &st);
+ }
+ free(newp);
+}
+
+/*
+ * Print all registered tokens along with their current status
+ */
+void
+debug_print_registered_tokens(void) {
+ int i;
+
+ snmp_log(LOG_INFO, "%d tokens registered :\n", debug_num_tokens);
+ for (i=0; i<debug_num_tokens; i++) {
+ snmp_log( LOG_INFO, "%d) %s : %d\n",
+ i, dbg_tokens [i].token_name, dbg_tokens [i].enabled);
+ }
+}
+
+
+/*
+ * Enable logs on a given token
+ */
+int
+debug_enable_token_logs (const char *token) {
+ int i;
+
+ /* debugging flag is on or off */
+ if (!dodebug)
+ return SNMPERR_GENERR;
+
+ if (debug_num_tokens == 0 || debug_print_everything) {
+ /* no tokens specified, print everything */
+ return SNMPERR_SUCCESS;
+ } else {
+ for(i=0; i < debug_num_tokens; i++) {
+ if (dbg_tokens[i].token_name &&
+ strncmp(dbg_tokens[i].token_name, token,
+ strlen(dbg_tokens[i].token_name)) == 0) {
+ dbg_tokens[i].enabled = SNMP_DEBUG_ACTIVE;
+ return SNMPERR_SUCCESS;
+ }
+ }
+ }
+ return SNMPERR_GENERR;
+}
+
+/*
+ * Diable logs on a given token
+ */
+int
+debug_disable_token_logs (const char *token) {
+ int i;
+
+ /* debugging flag is on or off */
+ if (!dodebug)
+ return SNMPERR_GENERR;
+
+ if (debug_num_tokens == 0 || debug_print_everything) {
+ /* no tokens specified, print everything */
+ return SNMPERR_SUCCESS;
+ } else {
+ for(i=0; i < debug_num_tokens; i++) {
+ if (strncmp(dbg_tokens[i].token_name, token,
+ strlen(dbg_tokens[i].token_name)) == 0) {
+ dbg_tokens[i].enabled = SNMP_DEBUG_DISABLED;
+ return SNMPERR_SUCCESS;
+ }
+ }
+ }
+ return SNMPERR_GENERR;
+}
+
+/*
+ * debug_is_token_registered(char *TOKEN):
+ *
+ * returns SNMPERR_SUCCESS
+ * or SNMPERR_GENERR
+ *
+ * if TOKEN has been registered and debugging support is turned on.
+ */
+int
+debug_is_token_registered(const char *token)
+{
+ int i, rc;
+
+ /*
+ * debugging flag is on or off
+ */
+ if (!dodebug)
+ return SNMPERR_GENERR;
+
+ if (debug_num_tokens == 0 || debug_print_everything) {
+ /*
+ * no tokens specified, print everything
+ */
+ return SNMPERR_SUCCESS;
+ }
+ else
+ rc = SNMPERR_GENERR; /* ! found = err */
+
+ for (i = 0; i < debug_num_tokens; i++) {
+ if (SNMP_DEBUG_DISABLED == dbg_tokens[i].enabled)
+ continue;
+ if (dbg_tokens[i].token_name &&
+ strncmp(dbg_tokens[i].token_name, token,
+ strlen(dbg_tokens[i].token_name)) == 0) {
+ if (SNMP_DEBUG_ACTIVE == dbg_tokens[i].enabled)
+ return SNMPERR_SUCCESS; /* active */
+ else
+ return SNMPERR_GENERR; /* excluded */
+ }
+ }
+ return rc;
+}
+
+void
+debugmsg(const char *token, const char *format, ...)
+{
+ if (debug_is_token_registered(token) == SNMPERR_SUCCESS) {
+ va_list debugargs;
+
+ va_start(debugargs, format);
+ snmp_vlog(LOG_DEBUG, format, debugargs);
+ va_end(debugargs);
+ }
+}
+
+void
+debugmsg_oid(const char *token, const oid * theoid, size_t len)
+{
+ u_char *buf = NULL;
+ size_t buf_len = 0, out_len = 0;
+
+ if (sprint_realloc_objid(&buf, &buf_len, &out_len, 1, theoid, len)) {
+ if (buf != NULL) {
+ debugmsg(token, "%s", buf);
+ }
+ } else {
+ if (buf != NULL) {
+ debugmsg(token, "%s [TRUNCATED]", buf);
+ }
+ }
+
+ if (buf != NULL) {
+ free(buf);
+ }
+}
+
+void
+debugmsg_suboid(const char *token, const oid * theoid, size_t len)
+{
+ u_char *buf = NULL;
+ size_t buf_len = 0, out_len = 0;
+ int buf_overflow = 0;
+
+ netsnmp_sprint_realloc_objid(&buf, &buf_len, &out_len, 1,
+ &buf_overflow, theoid, len);
+ if(buf_overflow) {
+ if (buf != NULL) {
+ debugmsg(token, "%s [TRUNCATED]", buf);
+ }
+ } else {
+ if (buf != NULL) {
+ debugmsg(token, "%s", buf);
+ }
+ }
+
+ if (buf != NULL) {
+ free(buf);
+ }
+}
+
+void
+debugmsg_var(const char *token, netsnmp_variable_list * var)
+{
+ u_char *buf = NULL;
+ size_t buf_len = 0, out_len = 0;
+
+ if (var == NULL || token == NULL) {
+ return;
+ }
+
+ if (sprint_realloc_variable(&buf, &buf_len, &out_len, 1,
+ var->name, var->name_length, var)) {
+ if (buf != NULL) {
+ debugmsg(token, "%s", buf);
+ }
+ } else {
+ if (buf != NULL) {
+ debugmsg(token, "%s [TRUNCATED]", buf);
+ }
+ }
+
+ if (buf != NULL) {
+ free(buf);
+ }
+}
+
+void
+debugmsg_oidrange(const char *token, const oid * theoid, size_t len,
+ size_t var_subid, oid range_ubound)
+{
+ u_char *buf = NULL;
+ size_t buf_len = 0, out_len = 0, i = 0;
+ int rc = 0;
+
+ if (var_subid == 0) {
+ rc = sprint_realloc_objid(&buf, &buf_len, &out_len, 1, theoid,
+ len);
+ } else {
+ char tmpbuf[128];
+ /* XXX - ? check for 0 == var_subid -1 ? */
+ rc = sprint_realloc_objid(&buf, &buf_len, &out_len, 1, theoid,
+ var_subid-1); /* Adjust for C's 0-based array indexing */
+ if (rc) {
+ sprintf(tmpbuf, ".%" NETSNMP_PRIo "u--%" NETSNMP_PRIo "u",
+ theoid[var_subid - 1], range_ubound);
+ rc = snmp_cstrcat(&buf, &buf_len, &out_len, 1, tmpbuf);
+ if (rc) {
+ for (i = var_subid; i < len; i++) {
+ sprintf(tmpbuf, ".%" NETSNMP_PRIo "u", theoid[i]);
+ if (!snmp_cstrcat(&buf, &buf_len, &out_len, 1, tmpbuf)) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+
+ if (buf != NULL) {
+ debugmsg(token, "%s%s", buf, rc ? "" : " [TRUNCATED]");
+ free(buf);
+ }
+}
+
+void
+debugmsg_hex(const char *token, const u_char * thedata, size_t len)
+{
+ u_char *buf = NULL;
+ size_t buf_len = 0, out_len = 0;
+
+ if (sprint_realloc_hexstring
+ (&buf, &buf_len, &out_len, 1, thedata, len)) {
+ if (buf != NULL) {
+ debugmsg(token, "%s", buf);
+ }
+ } else {
+ if (buf != NULL) {
+ debugmsg(token, "%s [TRUNCATED]", buf);
+ }
+ }
+
+ if (buf != NULL) {
+ free(buf);
+ }
+}
+
+void
+debugmsg_hextli(const char *token, const u_char * thedata, size_t len)
+{
+ char buf[SPRINT_MAX_LEN], token2[SPRINT_MAX_LEN];
+ u_char *b3 = NULL;
+ size_t b3_len = 0, o3_len = 0;
+ int incr;
+ sprintf(token2, "dumpx_%s", token);
+
+ /*
+ * XX tracing lines removed from this function DEBUGTRACE;
+ */
+ DEBUGIF(token2) {
+ for (incr = 16; len > 0; len -= incr, thedata += incr) {
+ if ((int) len < incr) {
+ incr = len;
+ }
+ /*
+ * XXnext two lines were DEBUGPRINTINDENT(token);
+ */
+ sprintf(buf, "dumpx%s", token);
+ debugmsg(buf, "%s: %*s", token2, debug_indent_get(), "");
+ if (sprint_realloc_hexstring
+ (&b3, &b3_len, &o3_len, 1, thedata, incr)) {
+ if (b3 != NULL) {
+ debugmsg(token2, "%s", b3);
+ }
+ } else {
+ if (b3 != NULL) {
+ debugmsg(token2, "%s [TRUNCATED]", b3);
+ }
+ }
+ o3_len = 0;
+ }
+ }
+ if (b3 != NULL) {
+ free(b3);
+ }
+}
+
+void
+debugmsgtoken(const char *token, const char *format, ...)
+{
+ va_list debugargs;
+
+ va_start(debugargs, format);
+ debugmsg(token, "%s: ", token);
+ va_end(debugargs);
+}
+
+void
+debug_combo_nc(const char *token, const char *format, ...)
+{
+ va_list debugargs;
+
+ va_start(debugargs, format);
+ snmp_log(LOG_DEBUG, "%s: ", token);
+ snmp_vlog(LOG_DEBUG, format, debugargs);
+ va_end(debugargs);
+}
+
+/*
+ * for speed, these shouldn't be in default_storage space
+ */
+void
+snmp_set_do_debugging(int val)
+{
+ dodebug = val;
+}
+
+int
+snmp_get_do_debugging(void)
+{
+ return dodebug;
+}
+
+#else /* ! NETSNMP_NO_DEBUGGING */
+
+#if __GNUC__ > 2
+#define UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#endif
+
+int debug_indent_get(void) { return 0; }
+
+const char* debug_indent(void) { return ""; }
+
+void debug_indent_add(int amount UNUSED) { }
+
+NETSNMP_IMPORT void
+debug_config_register_tokens(const char *configtoken, char *tokens);
+
+void
+debug_config_register_tokens(const char *configtoken UNUSED,
+ char *tokens UNUSED)
+{ }
+
+NETSNMP_IMPORT void
+debug_config_turn_on_debugging(const char *configtoken, char *line);
+
+void
+debug_config_turn_on_debugging(const char *configtoken UNUSED,
+ char *line UNUSED)
+{ }
+
+void
+debug_register_tokens(const char *tokens UNUSED)
+{ }
+
+void
+debug_print_registered_tokens(void)
+{ }
+
+
+int
+debug_enable_token_logs (const char *token UNUSED)
+{ return SNMPERR_GENERR; }
+
+int
+debug_disable_token_logs (const char *token UNUSED)
+{ return SNMPERR_GENERR; }
+
+int
+debug_is_token_registered(const char *token UNUSED)
+{ return SNMPERR_GENERR; }
+
+void
+debugmsg(const char *token UNUSED, const char *format UNUSED, ...)
+{ }
+
+void
+debugmsg_oid(const char *token UNUSED, const oid * theoid UNUSED,
+ size_t len UNUSED)
+{ }
+
+void
+debugmsg_suboid(const char *token UNUSED, const oid * theoid UNUSED,
+ size_t len UNUSED)
+{ }
+
+void
+debugmsg_var(const char *token UNUSED, netsnmp_variable_list * var UNUSED)
+{ }
+
+void
+debugmsg_oidrange(const char *token UNUSED, const oid * theoid UNUSED,
+ size_t len UNUSED, size_t var_subid UNUSED,
+ oid range_ubound UNUSED)
+{ }
+
+void
+debugmsg_hex(const char *token UNUSED, const u_char * thedata UNUSED,
+ size_t len UNUSED)
+{ }
+
+void
+debugmsg_hextli(const char *token UNUSED, const u_char * thedata UNUSED,
+ size_t len UNUSED)
+{ }
+
+void
+debugmsgtoken(const char *token UNUSED, const char *format UNUSED, ...)
+{ }
+
+void
+debug_combo_nc(const char *token UNUSED, const char *format UNUSED, ...)
+{ }
+
+void
+snmp_set_do_debugging(int val UNUSED)
+{ }
+
+int
+snmp_get_do_debugging(void)
+{
+ return 0;
+}
+
+#endif /* NETSNMP_NO_DEBUGGING */
+
+void
+snmp_debug_init(void)
+{
+ register_prenetsnmp_mib_handler("snmp", "doDebugging",
+ debug_config_turn_on_debugging, NULL,
+ "(1|0)");
+ register_prenetsnmp_mib_handler("snmp", "debugTokens",
+ debug_config_register_tokens, NULL,
+ "token[,token...]");
+}
diff --git a/snmplib/snmp_enum.c b/snmplib/snmp_enum.c
new file mode 100644
index 0000000..8a6bd38
--- /dev/null
+++ b/snmplib/snmp_enum.c
@@ -0,0 +1,475 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+#include <sys/types.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_enum.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/snmp_assert.h>
+
+netsnmp_feature_child_of(snmp_enum_all, libnetsnmp)
+
+netsnmp_feature_child_of(se_find_free_value_in_slist, snmp_enum_all)
+netsnmp_feature_child_of(snmp_enum_store_list, snmp_enum_all)
+netsnmp_feature_child_of(snmp_enum_store_slist, snmp_enum_all)
+netsnmp_feature_child_of(snmp_enum_clear, snmp_enum_all)
+
+struct snmp_enum_list_str {
+ char *name;
+ struct snmp_enum_list *list;
+ struct snmp_enum_list_str *next;
+};
+
+static struct snmp_enum_list ***snmp_enum_lists;
+unsigned int current_maj_num;
+unsigned int current_min_num;
+static struct snmp_enum_list_str *sliststorage;
+
+static void
+free_enum_list(struct snmp_enum_list *list);
+
+int
+init_snmp_enum(const char *type)
+{
+ int i;
+
+ if (NULL != snmp_enum_lists)
+ return SE_OK;
+
+ snmp_enum_lists = (struct snmp_enum_list ***)
+ calloc(1, sizeof(struct snmp_enum_list **) * SE_MAX_IDS);
+ if (!snmp_enum_lists)
+ return SE_NOMEM;
+ current_maj_num = SE_MAX_IDS;
+
+ for (i = 0; i < SE_MAX_IDS; i++) {
+ if (!snmp_enum_lists[i])
+ snmp_enum_lists[i] = (struct snmp_enum_list **)
+ calloc(1, sizeof(struct snmp_enum_list *) * SE_MAX_SUBIDS);
+ if (!snmp_enum_lists[i])
+ return SE_NOMEM;
+ }
+ current_min_num = SE_MAX_SUBIDS;
+
+ register_config_handler(type, "enum", se_read_conf, NULL, NULL);
+ return SE_OK;
+}
+
+int
+se_store_in_list(struct snmp_enum_list *new_list,
+ unsigned int major, unsigned int minor)
+{
+ int ret = SE_OK;
+
+ if (major > current_maj_num || minor > current_min_num) {
+ /*
+ * XXX: realloc
+ */
+ return SE_NOMEM;
+ }
+ netsnmp_assert(NULL != snmp_enum_lists);
+
+ if (snmp_enum_lists[major][minor] != NULL)
+ ret = SE_ALREADY_THERE;
+
+ snmp_enum_lists[major][minor] = new_list;
+
+ return ret;
+}
+
+void
+se_read_conf(const char *word, char *cptr)
+{
+ int major, minor;
+ int value;
+ char *cp, *cp2;
+ char e_name[BUFSIZ];
+ char e_enum[ BUFSIZ];
+
+ if (!cptr || *cptr=='\0')
+ return;
+
+ /*
+ * Extract the first token
+ * (which should be the name of the list)
+ */
+ cp = copy_nword(cptr, e_name, sizeof(e_name));
+ cp = skip_white(cp);
+ if (!cp || *cp=='\0')
+ return;
+
+
+ /*
+ * Add each remaining enumeration to the list,
+ * using the appropriate style interface
+ */
+ if (sscanf(e_name, "%d:%d", &major, &minor) == 2) {
+ /*
+ * Numeric major/minor style
+ */
+ while (1) {
+ cp = copy_nword(cp, e_enum, sizeof(e_enum));
+ if (sscanf(e_enum, "%d:", &value) != 1) {
+ break;
+ }
+ cp2 = e_enum;
+ while (*(cp2++) != ':')
+ ;
+ se_add_pair(major, minor, strdup(cp2), value);
+ if (!cp)
+ break;
+ }
+ } else {
+ /*
+ * Named enumeration
+ */
+ while (1) {
+ cp = copy_nword(cp, e_enum, sizeof(e_enum));
+ if (sscanf(e_enum, "%d:", &value) != 1) {
+ break;
+ }
+ cp2 = e_enum;
+ while (*(cp2++) != ':')
+ ;
+ se_add_pair_to_slist(e_name, strdup(cp2), value);
+ if (!cp)
+ break;
+ }
+ }
+}
+
+void
+se_store_enum_list(struct snmp_enum_list *new_list,
+ const char *token, const char *type)
+{
+ struct snmp_enum_list *listp = new_list;
+ char line[2048];
+ char buf[512];
+ int len;
+
+ snprintf(line, sizeof(line), "enum %s", token);
+ while (listp) {
+ snprintf(buf, sizeof(buf), " %d:%s", listp->value, listp->label);
+ /*
+ * Calculate the space left in the buffer.
+ * If this is not sufficient to include the next enum,
+ * then save the line so far, and start again.
+ */
+ len = sizeof(line) - strlen(line);
+ if ((int)strlen(buf) > len) {
+ read_config_store(type, line);
+ snprintf(line, sizeof(line), "enum %s", token);
+ len = sizeof(line) - strlen(line);
+ }
+
+ strncat(line, buf, len);
+ listp = listp->next;
+ }
+
+ read_config_store(type, line);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMP_ENUM_STORE_LIST
+void
+se_store_list(unsigned int major, unsigned int minor, const char *type)
+{
+ char token[32];
+
+ snprintf(token, sizeof(token), "%d:%d", major, minor);
+ se_store_enum_list(se_find_list(major, minor), token, type);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMP_ENUM_STORE_LIST */
+
+struct snmp_enum_list *
+se_find_list(unsigned int major, unsigned int minor)
+{
+ if (major > current_maj_num || minor > current_min_num)
+ return NULL;
+ netsnmp_assert(NULL != snmp_enum_lists);
+
+ return snmp_enum_lists[major][minor];
+}
+
+int
+se_find_value_in_list(struct snmp_enum_list *list, const char *label)
+{
+ if (!list)
+ return SE_DNE; /* XXX: um, no good solution here */
+ while (list) {
+ if (strcmp(list->label, label) == 0)
+ return (list->value);
+ list = list->next;
+ }
+
+ return SE_DNE; /* XXX: um, no good solution here */
+}
+
+int
+se_find_free_value_in_list(struct snmp_enum_list *list)
+{
+ int max_value = 0;
+ if (!list)
+ return SE_DNE;
+
+ for (;list; list=list->next) {
+ if (max_value < list->value)
+ max_value = list->value;
+ }
+ return max_value+1;
+}
+
+int
+se_find_value(unsigned int major, unsigned int minor, const char *label)
+{
+ return se_find_value_in_list(se_find_list(major, minor), label);
+}
+
+int
+se_find_free_value(unsigned int major, unsigned int minor)
+{
+ return se_find_free_value_in_list(se_find_list(major, minor));
+}
+
+char *
+se_find_label_in_list(struct snmp_enum_list *list, int value)
+{
+ if (!list)
+ return NULL;
+ while (list) {
+ if (list->value == value)
+ return (list->label);
+ list = list->next;
+ }
+ return NULL;
+}
+
+char *
+se_find_label(unsigned int major, unsigned int minor, int value)
+{
+ return se_find_label_in_list(se_find_list(major, minor), value);
+}
+
+int
+se_add_pair_to_list(struct snmp_enum_list **list, char *label, int value)
+{
+ struct snmp_enum_list *lastnode = NULL, *tmp;
+
+ if (!list)
+ return SE_DNE;
+
+ tmp = *list;
+ while (tmp) {
+ if (tmp->value == value) {
+ free(label);
+ return (SE_ALREADY_THERE);
+ }
+ lastnode = tmp;
+ tmp = tmp->next;
+ }
+
+ if (lastnode) {
+ lastnode->next = SNMP_MALLOC_STRUCT(snmp_enum_list);
+ lastnode = lastnode->next;
+ } else {
+ (*list) = SNMP_MALLOC_STRUCT(snmp_enum_list);
+ lastnode = (*list);
+ }
+ if (!lastnode) {
+ free(label);
+ return (SE_NOMEM);
+ }
+ lastnode->label = label;
+ lastnode->value = value;
+ lastnode->next = NULL;
+ return (SE_OK);
+}
+
+int
+se_add_pair(unsigned int major, unsigned int minor, char *label, int value)
+{
+ struct snmp_enum_list *list = se_find_list(major, minor);
+ int created = (list) ? 1 : 0;
+ int ret = se_add_pair_to_list(&list, label, value);
+ if (!created)
+ se_store_in_list(list, major, minor);
+ return ret;
+}
+
+/*
+ * remember a list of enums based on a lookup name.
+ */
+static struct snmp_enum_list **
+se_find_slist_ptr(const char *listname)
+{
+ struct snmp_enum_list_str *sptr;
+ if (!listname)
+ return NULL;
+
+ for (sptr = sliststorage; sptr != NULL; sptr = sptr->next)
+ if (sptr->name && strcmp(sptr->name, listname) == 0)
+ return &sptr->list;
+
+ return NULL;
+}
+
+struct snmp_enum_list *
+se_find_slist(const char *listname)
+{
+ struct snmp_enum_list **ptr = se_find_slist_ptr(listname);
+ return ptr ? *ptr : NULL;
+}
+
+char *
+se_find_label_in_slist(const char *listname, int value)
+{
+ return (se_find_label_in_list(se_find_slist(listname), value));
+}
+
+int
+se_find_value_in_slist(const char *listname, const char *label)
+{
+ return (se_find_value_in_list(se_find_slist(listname), label));
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SE_FIND_FREE_VALUE_IN_SLIST
+int
+se_find_free_value_in_slist(const char *listname)
+{
+ return (se_find_free_value_in_list(se_find_slist(listname)));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SE_FIND_FREE_VALUE_IN_SLIST */
+
+int
+se_add_pair_to_slist(const char *listname, char *label, int value)
+{
+ struct snmp_enum_list *list = se_find_slist(listname);
+ int created = (list) ? 1 : 0;
+ int ret = se_add_pair_to_list(&list, label, value);
+
+ if (!created) {
+ struct snmp_enum_list_str *sptr =
+ SNMP_MALLOC_STRUCT(snmp_enum_list_str);
+ if (!sptr) {
+ free_enum_list(list);
+ return SE_NOMEM;
+ }
+ sptr->next = sliststorage;
+ sptr->name = strdup(listname);
+ sptr->list = list;
+ sliststorage = sptr;
+ }
+ return ret;
+}
+
+static void
+free_enum_list(struct snmp_enum_list *list)
+{
+ struct snmp_enum_list *next;
+
+ while (list) {
+ next = list->next;
+ SNMP_FREE(list->label);
+ SNMP_FREE(list);
+ list = next;
+ }
+}
+
+void
+clear_snmp_enum(void)
+{
+ struct snmp_enum_list_str *sptr = sliststorage, *next = NULL;
+ int i, j;
+
+ while (sptr != NULL) {
+ next = sptr->next;
+ free_enum_list(sptr->list);
+ SNMP_FREE(sptr->name);
+ SNMP_FREE(sptr);
+ sptr = next;
+ }
+ sliststorage = NULL;
+
+ if (snmp_enum_lists) {
+ for (i = 0; i < SE_MAX_IDS; i++) {
+ if (snmp_enum_lists[i]) {
+ for (j = 0; j < SE_MAX_SUBIDS; j++) {
+ if (snmp_enum_lists[i][j])
+ free_enum_list(snmp_enum_lists[i][j]);
+ }
+ SNMP_FREE(snmp_enum_lists[i]);
+ }
+ }
+ SNMP_FREE(snmp_enum_lists);
+ }
+}
+
+void
+se_clear_list(struct snmp_enum_list **list)
+{
+ struct snmp_enum_list *this_entry, *next_entry;
+
+ if (!list)
+ return;
+
+ this_entry = *list;
+ while (this_entry) {
+ next_entry = this_entry->next;
+ SNMP_FREE(this_entry->label);
+ SNMP_FREE(this_entry);
+ this_entry = next_entry;
+ }
+ *list = NULL;
+ return;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMP_ENUM_STORE_SLIST
+void
+se_store_slist(const char *listname, const char *type)
+{
+ struct snmp_enum_list *list = se_find_slist(listname);
+ se_store_enum_list(list, listname, type);
+}
+
+int
+se_store_slist_callback(int majorID, int minorID,
+ void *serverargs, void *clientargs)
+{
+ char *appname = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ se_store_slist((char *)clientargs, appname);
+ return SNMPERR_SUCCESS;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMP_ENUM_STORE_SLIST */
+
+#ifndef NETSNMP_FEATURE_REMOVE_SNMP_ENUM_CLEAR
+void
+se_clear_slist(const char *listname)
+{
+ se_clear_list(se_find_slist_ptr(listname));
+}
+
+void
+se_clear_all_lists(void)
+{
+ struct snmp_enum_list_str *sptr = NULL;
+
+ for (sptr = sliststorage; sptr != NULL; sptr = sptr->next)
+ se_clear_list(&(sptr->list));
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SNMP_ENUM_CLEAR */
diff --git a/snmplib/snmp_logging.c b/snmplib/snmp_logging.c
new file mode 100644
index 0000000..a2cd55a
--- /dev/null
+++ b/snmplib/snmp_logging.c
@@ -0,0 +1,1462 @@
+/*
+ * logging.c - generic logging for snmp-agent
+ * * Contributed by Ragnar Kjørstad, ucd@ragnark.vestdata.no 1999-06-26
+ */
+/* 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 snmp_logging generic logging for net-snmp
+ * @ingroup library
+ *
+ * @{
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <stdio.h>
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <ctype.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#if HAVE_SYSLOG_H
+#include <syslog.h>
+#ifndef LOG_CONS /* Interesting Ultrix feature */
+#include <sys/syslog.h>
+#endif
+#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_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <stdarg.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/library/snmp_logging.h> /* For this file's "internal" definitions */
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/callback.h>
+#define LOGLENGTH 1024
+
+#ifdef va_copy
+#define NEED_VA_END_AFTER_VA_COPY
+#else
+#ifdef __vacopy
+#define vacopy __vacopy
+#define NEED_VA_END_AFTER_VA_COPY
+#else
+#define va_copy(dest, src) memcpy (&dest, &src, sizeof (va_list))
+#endif
+#endif
+
+netsnmp_feature_child_of(logging_all, libnetsnmp)
+
+netsnmp_feature_child_of(logging_outputs, logging_all)
+netsnmp_feature_child_of(logging_file, logging_outputs)
+netsnmp_feature_child_of(logging_stdio, logging_outputs)
+netsnmp_feature_child_of(logging_syslog, logging_outputs)
+netsnmp_feature_child_of(logging_external, logging_all)
+
+netsnmp_feature_child_of(enable_stderrlog, logging_all)
+
+netsnmp_feature_child_of(logging_enable_calllog, netsnmp_unused)
+netsnmp_feature_child_of(logging_enable_loghandler, netsnmp_unused)
+
+/* default to the file/stdio/syslog set */
+netsnmp_feature_want(logging_outputs)
+
+/*
+ * logh_head: A list of all log handlers, in increasing order of priority
+ * logh_priorities: 'Indexes' into this list, by priority
+ */
+netsnmp_log_handler *logh_head = NULL;
+netsnmp_log_handler *logh_priorities[LOG_DEBUG+1];
+static int logh_enabled = 0;
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+static char syslogname[64] = DEFAULT_LOG_ID;
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+void
+netsnmp_disable_this_loghandler(netsnmp_log_handler *logh)
+{
+ if (!logh || (0 == logh->enabled))
+ return;
+ logh->enabled = 0;
+ --logh_enabled;
+ netsnmp_assert(logh_enabled >= 0);
+}
+
+void
+netsnmp_enable_this_loghandler(netsnmp_log_handler *logh)
+{
+ if (!logh || (0 != logh->enabled))
+ return;
+ logh->enabled = 1;
+ ++logh_enabled;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+void
+netsnmp_enable_filelog(netsnmp_log_handler *logh, int dont_zero_log);
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+
+#ifndef HAVE_VSNPRINTF
+ /*
+ * Need to use the UCD-provided one
+ */
+int vsnprintf(char *str, size_t count, const char *fmt,
+ va_list arg);
+#endif
+
+void
+parse_config_logOption(const char *token, char *cptr)
+{
+ int my_argc = 0 ;
+ char **my_argv = NULL;
+
+ snmp_log_options( cptr, my_argc, my_argv );
+}
+
+void
+init_snmp_logging(void)
+{
+ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "logTimestamp",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_LOG_TIMESTAMP);
+ register_prenetsnmp_mib_handler("snmp", "logOption",
+ parse_config_logOption, NULL, "string");
+
+}
+
+void
+shutdown_snmp_logging(void)
+{
+ snmp_disable_log();
+ while(NULL != logh_head)
+ netsnmp_remove_loghandler( logh_head );
+}
+
+/*
+ * These definitions handle 4.2 systems without additional syslog facilities.
+ */
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+#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
+#ifndef LOG_USER
+#define LOG_USER 0
+#endif
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+/* Set line buffering mode for a stream. */
+void
+netsnmp_set_line_buffering(FILE *stream)
+{
+#if defined(WIN32)
+ /*
+ * According to MSDN, the Microsoft Visual Studio C runtime library does
+ * not support line buffering, so turn off buffering completely.
+ * See also http://msdn.microsoft.com/en-us/library/86cebhfs(VS.71).aspx.
+ */
+ setvbuf(stream, NULL, _IONBF, BUFSIZ);
+#elif defined(HAVE_SETLINEBUF)
+ /* setlinefunction() is a function from the BSD Unix API. */
+ setlinebuf(stream);
+#else
+ /* See also the C89 or C99 standard for more information about setvbuf(). */
+ setvbuf(stream, NULL, _IOLBF, BUFSIZ);
+#endif
+}
+
+/*
+ * Decodes log priority.
+ * @param optarg - IN - priority to decode, "0" or "0-7"
+ * OUT - points to last character after the decoded priority
+ * @param pri_max - OUT - maximum priority (i.e. 0x7 from "0-7")
+ */
+int
+decode_priority( char **optarg, int *pri_max )
+{
+ int pri_low = LOG_DEBUG;
+
+ if (*optarg == NULL)
+ return -1;
+
+ switch (**optarg) {
+ case '0':
+ case '!':
+ pri_low = LOG_EMERG;
+ break;
+ case '1':
+ case 'a':
+ case 'A':
+ pri_low = LOG_ALERT;
+ break;
+ case '2':
+ case 'c':
+ case 'C':
+ pri_low = LOG_CRIT;
+ break;
+ case '3':
+ case 'e':
+ case 'E':
+ pri_low = LOG_ERR;
+ break;
+ case '4':
+ case 'w':
+ case 'W':
+ pri_low = LOG_WARNING;
+ break;
+ case '5':
+ case 'n':
+ case 'N':
+ pri_low = LOG_NOTICE;
+ break;
+ case '6':
+ case 'i':
+ case 'I':
+ pri_low = LOG_INFO;
+ break;
+ case '7':
+ case 'd':
+ case 'D':
+ pri_low = LOG_DEBUG;
+ break;
+ default:
+ fprintf(stderr, "invalid priority: %c\n",**optarg);
+ return -1;
+ }
+ *optarg = *optarg+1;
+
+ if (pri_max && **optarg=='-') {
+ *optarg = *optarg + 1; /* skip '-' */
+ *pri_max = decode_priority( optarg, NULL );
+ if (*pri_max == -1) return -1;
+ if (pri_low < *pri_max) {
+ int tmp = pri_low;
+ pri_low = *pri_max;
+ *pri_max = tmp;
+ }
+
+ }
+ return pri_low;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+int
+decode_facility( char *optarg )
+{
+ if (optarg == NULL)
+ return -1;
+
+ switch (*optarg) {
+ case 'd':
+ case 'D':
+ return LOG_DAEMON;
+ case 'u':
+ case 'U':
+ return LOG_USER;
+ case '0':
+ return LOG_LOCAL0;
+ case '1':
+ return LOG_LOCAL1;
+ case '2':
+ return LOG_LOCAL2;
+ case '3':
+ return LOG_LOCAL3;
+ case '4':
+ return LOG_LOCAL4;
+ case '5':
+ return LOG_LOCAL5;
+ case '6':
+ return LOG_LOCAL6;
+ case '7':
+ return LOG_LOCAL7;
+ default:
+ fprintf(stderr, "invalid syslog facility: %c\n",*optarg);
+ return -1;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+int
+snmp_log_options(char *optarg, int argc, char *const *argv)
+{
+ char *cp = optarg;
+ /*
+ * Hmmm... this doesn't seem to work.
+ * The main agent 'getopt' handling assumes
+ * that the -L option takes an argument,
+ * and objects if this is missing.
+ * Trying to differentiate between
+ * new-style "-Lx", and old-style "-L xx"
+ * is likely to be a major headache.
+ */
+ char missing_opt = 'e'; /* old -L is new -Le */
+ int priority = LOG_DEBUG;
+ int pri_max = LOG_EMERG;
+ int inc_optind = 0;
+ netsnmp_log_handler *logh;
+
+ DEBUGMSGT(("logging:options", "optarg: '%s', argc %d, argv '%s'\n",
+ optarg, argc, argv ? argv[0] : "NULL"));
+ optarg++;
+ if (!*cp)
+ cp = &missing_opt;
+
+ /*
+ * Support '... -Lx=value ....' syntax
+ */
+ if (*optarg == '=') {
+ optarg++;
+ }
+ /*
+ * and '.... "-Lx value" ....' (*with* the quotes)
+ */
+ while (*optarg && isspace((unsigned char)(*optarg))) {
+ optarg++;
+ }
+ /*
+ * Finally, handle ".... -Lx value ...." syntax
+ * (*without* surrounding quotes)
+ */
+ if ((!*optarg) && (NULL != argv)) {
+ /*
+ * We've run off the end of the argument
+ * so move on to the next.
+ * But we might not actually need it, so don't
+ * increment optind just yet!
+ */
+ optarg = argv[optind];
+ inc_optind = 1;
+ }
+
+ DEBUGMSGT(("logging:options", "*cp: '%c'\n", *cp));
+ switch (*cp) {
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+ /*
+ * Log to Standard Error
+ */
+ case 'E':
+ priority = decode_priority( &optarg, &pri_max );
+ if (priority == -1) return -1;
+ if (inc_optind)
+ optind++;
+ /* Fallthrough */
+ case 'e':
+ logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_STDERR, priority);
+ if (logh) {
+ netsnmp_set_line_buffering(stderr);
+ logh->pri_max = pri_max;
+ logh->token = strdup("stderr");
+ }
+ break;
+
+ /*
+ * Log to Standard Output
+ */
+ case 'O':
+ priority = decode_priority( &optarg, &pri_max );
+ if (priority == -1) return -1;
+ if (inc_optind)
+ optind++;
+ /* Fallthrough */
+ case 'o':
+ logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_STDERR, priority);
+ if (logh) {
+ netsnmp_set_line_buffering(stdout);
+ logh->pri_max = pri_max;
+ logh->token = strdup("stdout");
+ logh->imagic = 1; /* stdout, not stderr */
+ }
+ break;
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+
+ /*
+ * Log to a named file
+ */
+ case 'F':
+ priority = decode_priority( &optarg, &pri_max );
+ if (priority == -1 || !argv) return -1;
+ optarg = argv[++optind];
+ /* Fallthrough */
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+ case 'f':
+ if (inc_optind)
+ optind++;
+ if (!optarg) {
+ fprintf(stderr, "Missing log file\n");
+ return -1;
+ }
+ logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_FILE, priority);
+ if (logh) {
+ logh->pri_max = pri_max;
+ logh->token = strdup(optarg);
+ netsnmp_enable_filelog(logh,
+ netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPEND_LOGFILES));
+ }
+ break;
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+ /*
+ * Log to syslog
+ */
+ case 'S':
+ priority = decode_priority( &optarg, &pri_max );
+ if (priority == -1 || !argv) return -1;
+ if (!optarg[0]) {
+ /* The command line argument with priority does not contain log
+ * facility. The facility must be in next argument then. */
+ optind++;
+ if (optind < argc)
+ optarg = argv[optind];
+ }
+ /* Fallthrough */
+ case 's':
+ if (inc_optind)
+ optind++;
+ if (!optarg) {
+ fprintf(stderr, "Missing syslog facility\n");
+ return -1;
+ }
+ logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_SYSLOG, priority);
+ if (logh) {
+ int facility = decode_facility(optarg);
+ if (facility == -1) return -1;
+ logh->pri_max = pri_max;
+ logh->token = strdup(snmp_log_syslogname(NULL));
+ logh->magic = (void *)(intptr_t)facility;
+ snmp_enable_syslog_ident(snmp_log_syslogname(NULL), facility);
+ }
+ break;
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+ /*
+ * Don't log
+ */
+ case 'N':
+ priority = decode_priority( &optarg, &pri_max );
+ if (priority == -1) return -1;
+ if (inc_optind)
+ optind++;
+ /* Fallthrough */
+ case 'n':
+ /*
+ * disable all logs to clean them up (close files, etc),
+ * remove all log handlers, then register a null handler.
+ */
+ snmp_disable_log();
+ while(NULL != logh_head)
+ netsnmp_remove_loghandler( logh_head );
+ logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_NONE, priority);
+ if (logh) {
+ logh->pri_max = pri_max;
+ }
+ break;
+
+ default:
+ fprintf(stderr, "Unknown logging option passed to -L: %c.\n", *cp);
+ return -1;
+ }
+ return 0;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+char *
+snmp_log_syslogname(const char *pstr)
+{
+ if (pstr)
+ strlcpy (syslogname, pstr, sizeof(syslogname));
+
+ return syslogname;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+void
+snmp_log_options_usage(const char *lead, FILE * outf)
+{
+ const char *pri1_msg = " for level 'pri' and above";
+ const char *pri2_msg = " for levels 'p1' to 'p2'";
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+ fprintf(outf, "%se: log to standard error\n", lead);
+ fprintf(outf, "%so: log to standard output\n", lead);
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+ fprintf(outf, "%sn: don't log at all\n", lead);
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+ fprintf(outf, "%sf file: log to the specified file\n", lead);
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+ fprintf(outf, "%ss facility: log to syslog (via the specified facility)\n", lead);
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+ fprintf(outf, "\n%s(variants)\n", lead);
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+ fprintf(outf, "%s[EON] pri: log to standard error, output or /dev/null%s\n", lead, pri1_msg);
+ fprintf(outf, "%s[EON] p1-p2: log to standard error, output or /dev/null%s\n", lead, pri2_msg);
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+ fprintf(outf, "%s[FS] pri token: log to file/syslog%s\n", lead, pri1_msg);
+ fprintf(outf, "%s[FS] p1-p2 token: log to file/syslog%s\n", lead, pri2_msg);
+}
+
+/**
+ * Is logging done?
+ *
+ * @return Returns 0 if logging is off, 1 when it is done.
+ *
+ */
+int
+snmp_get_do_logging(void)
+{
+ return (logh_enabled > 0);
+}
+
+
+static char *
+sprintf_stamp(time_t * now, char *sbuf)
+{
+ time_t Now;
+ struct tm *tm;
+
+ if (now == NULL) {
+ now = &Now;
+ time(now);
+ }
+ tm = localtime(now);
+ sprintf(sbuf, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d ",
+ tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
+ return sbuf;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+void
+snmp_disable_syslog_entry(netsnmp_log_handler *logh)
+{
+ if (!logh || !logh->enabled || logh->type != NETSNMP_LOGHANDLER_SYSLOG)
+ return;
+
+#ifdef WIN32
+ if (logh->magic) {
+ HANDLE eventlog_h = (HANDLE)logh->magic;
+ CloseEventLog(eventlog_h);
+ logh->magic = NULL;
+ }
+#else
+ closelog();
+ logh->imagic = 0;
+#endif
+
+ netsnmp_disable_this_loghandler(logh);
+}
+
+void
+snmp_disable_syslog(void)
+{
+ netsnmp_log_handler *logh;
+
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->enabled && logh->type == NETSNMP_LOGHANDLER_SYSLOG)
+ snmp_disable_syslog_entry(logh);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+void
+snmp_disable_filelog_entry(netsnmp_log_handler *logh)
+{
+ if (!logh /* || !logh->enabled */ || logh->type != NETSNMP_LOGHANDLER_FILE)
+ return;
+
+ if (logh->magic) {
+ fputs("\n", (FILE*)logh->magic); /* XXX - why? */
+ fclose((FILE*)logh->magic);
+ logh->magic = NULL;
+ }
+ netsnmp_disable_this_loghandler(logh);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+void
+snmp_disable_filelog(void)
+{
+ netsnmp_log_handler *logh;
+
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->enabled && logh->type == NETSNMP_LOGHANDLER_FILE)
+ snmp_disable_filelog_entry(logh);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+/*
+ * returns that status of stderr logging
+ *
+ * @retval 0 : stderr logging disabled
+ * @retval 1 : stderr logging enabled
+ */
+int
+snmp_stderrlog_status(void)
+{
+ netsnmp_log_handler *logh;
+
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->enabled && (logh->type == NETSNMP_LOGHANDLER_STDOUT ||
+ logh->type == NETSNMP_LOGHANDLER_STDERR)) {
+ return 1;
+ }
+
+ return 0;
+}
+
+void
+snmp_disable_stderrlog(void)
+{
+ netsnmp_log_handler *logh;
+
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->enabled && (logh->type == NETSNMP_LOGHANDLER_STDOUT ||
+ logh->type == NETSNMP_LOGHANDLER_STDERR)) {
+ netsnmp_disable_this_loghandler(logh);
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_ENABLE_CALLLOG
+void
+snmp_disable_calllog(void)
+{
+ netsnmp_log_handler *logh;
+
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->enabled && logh->type == NETSNMP_LOGHANDLER_CALLBACK) {
+ netsnmp_disable_this_loghandler(logh);
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_ENABLE_CALLLOG */
+
+void
+snmp_disable_log(void)
+{
+ netsnmp_log_handler *logh;
+
+ for (logh = logh_head; logh; logh = logh->next) {
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+ if (logh->type == NETSNMP_LOGHANDLER_SYSLOG)
+ snmp_disable_syslog_entry(logh);
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+ if (logh->type == NETSNMP_LOGHANDLER_FILE)
+ snmp_disable_filelog_entry(logh);
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+ netsnmp_disable_this_loghandler(logh);
+ }
+}
+
+/*
+ * close and reopen all file based logs, to allow logfile
+ * rotation.
+ */
+void
+netsnmp_logging_restart(void)
+{
+ netsnmp_log_handler *logh;
+ int doneone = 0;
+
+ for (logh = logh_head; logh; logh = logh->next) {
+ if (0 == logh->enabled)
+ continue;
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+ if (logh->type == NETSNMP_LOGHANDLER_SYSLOG) {
+ snmp_disable_syslog_entry(logh);
+ snmp_enable_syslog_ident(logh->token,(int)(intptr_t)logh->magic);
+ doneone = 1;
+ }
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+ if (logh->type == NETSNMP_LOGHANDLER_FILE && !doneone) {
+ snmp_disable_filelog_entry(logh);
+ /** hmm, don't zero status isn't saved.. i think it's
+ * safer not to overwrite, in case a hup is just to
+ * re-read config files...
+ */
+ netsnmp_enable_filelog(logh, 1);
+ }
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+ }
+}
+
+/* ================================================== */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+void
+snmp_enable_syslog(void)
+{
+ snmp_enable_syslog_ident(snmp_log_syslogname(NULL), LOG_DAEMON);
+}
+
+void
+snmp_enable_syslog_ident(const char *ident, const int facility)
+{
+ netsnmp_log_handler *logh;
+ int found = 0;
+ int enable = 1;
+#ifdef WIN32
+ HANDLE eventlog_h;
+#else
+ void *eventlog_h = NULL;
+#endif
+
+ snmp_disable_syslog(); /* ??? */
+#ifdef WIN32
+ eventlog_h = OpenEventLog(NULL, ident);
+ if (eventlog_h == NULL) {
+ /*
+ * Hmmm.....
+ * Maybe disable this handler, and log the error ?
+ */
+ fprintf(stderr, "Could not open event log for %s. "
+ "Last error: 0x%x\n", ident, GetLastError());
+ enable = 0;
+ }
+#else
+ openlog(snmp_log_syslogname(ident), LOG_CONS | LOG_PID, facility);
+#endif
+
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->type == NETSNMP_LOGHANDLER_SYSLOG) {
+ logh->magic = (void*)eventlog_h;
+ logh->imagic = enable; /* syslog open */
+ if (logh->enabled && (0 == enable))
+ netsnmp_disable_this_loghandler(logh);
+ else if ((0 == logh->enabled) && enable)
+ netsnmp_enable_this_loghandler(logh);
+ found = 1;
+ }
+
+ if (!found) {
+ logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_SYSLOG,
+ LOG_DEBUG );
+ if (logh) {
+ logh->magic = (void*)eventlog_h;
+ logh->token = strdup(ident);
+ logh->imagic = enable; /* syslog open */
+ if (logh->enabled && (0 == enable))
+ netsnmp_disable_this_loghandler(logh);
+ else if ((0 == logh->enabled) && enable)
+ netsnmp_enable_this_loghandler(logh);
+ }
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+void
+netsnmp_enable_filelog(netsnmp_log_handler *logh, int dont_zero_log)
+{
+ FILE *logfile;
+
+ if (!logh)
+ return;
+
+ if (!logh->magic) {
+ logfile = fopen(logh->token, dont_zero_log ? "a" : "w");
+ if (!logfile) {
+ snmp_log_perror(logh->token);
+ return;
+ }
+ logh->magic = (void*)logfile;
+ netsnmp_set_line_buffering(logfile);
+ }
+ netsnmp_enable_this_loghandler(logh);
+}
+
+void
+snmp_enable_filelog(const char *logfilename, int dont_zero_log)
+{
+ netsnmp_log_handler *logh;
+
+ /*
+ * don't disable ALL filelogs whenever a new one is enabled.
+ * this prevents '-Lf file' from working in snmpd, as the
+ * call to set up /var/log/snmpd.log will disable the previous
+ * log setup.
+ * snmp_disable_filelog();
+ */
+
+ if (logfilename) {
+ logh = netsnmp_find_loghandler( logfilename );
+ if (!logh) {
+ logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_FILE,
+ LOG_DEBUG );
+ if (logh)
+ logh->token = strdup(logfilename);
+ }
+ if (logh)
+ netsnmp_enable_filelog(logh, dont_zero_log);
+ } else {
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->type == NETSNMP_LOGHANDLER_FILE)
+ netsnmp_enable_filelog(logh, dont_zero_log);
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_ENABLE_STDERRLOG
+/* used in the perl modules and ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c */
+void
+snmp_enable_stderrlog(void)
+{
+ netsnmp_log_handler *logh;
+ int found = 0;
+
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->type == NETSNMP_LOGHANDLER_STDOUT ||
+ logh->type == NETSNMP_LOGHANDLER_STDERR) {
+ netsnmp_enable_this_loghandler(logh);
+ found = 1;
+ }
+
+ if (!found) {
+ logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_STDERR,
+ LOG_DEBUG );
+ if (logh)
+ logh->token = strdup("stderr");
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_ENABLE_STDERRLOG */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_ENABLE_CALLLOG
+void
+snmp_enable_calllog(void) /* XXX - or take a callback routine ??? */
+{
+ netsnmp_log_handler *logh;
+ int found = 0;
+
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->type == NETSNMP_LOGHANDLER_CALLBACK) {
+ netsnmp_enable_this_loghandler(logh);
+ found = 1;
+ }
+
+ if (!found) {
+ logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_CALLBACK,
+ LOG_DEBUG );
+ if (logh)
+ logh->token = strdup("callback");
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_ENABLE_CALLLOG */
+
+
+/* ==================================================== */
+
+
+netsnmp_log_handler *
+netsnmp_find_loghandler( const char *token )
+{
+ netsnmp_log_handler *logh;
+ if (!token)
+ return NULL;
+
+ for (logh = logh_head; logh; logh = logh->next)
+ if (logh->token && !strcmp( token, logh->token ))
+ break;
+
+ return logh;
+}
+
+int
+netsnmp_add_loghandler( netsnmp_log_handler *logh )
+{
+ int i;
+ netsnmp_log_handler *logh2;
+
+ if (!logh)
+ return 0;
+
+ /*
+ * Find the appropriate point for the new entry...
+ * (logh2 will point to the entry immediately following)
+ */
+ for (logh2 = logh_head; logh2; logh2 = logh2->next)
+ if ( logh2->priority >= logh->priority )
+ break;
+
+ /*
+ * ... and link it into the main list.
+ */
+ if (logh2) {
+ if (logh2->prev)
+ logh2->prev->next = logh;
+ else
+ logh_head = logh;
+ logh->next = logh2;
+ logh2->prev = logh;
+ } else if (logh_head ) {
+ /*
+ * If logh2 is NULL, we're tagging on to the end
+ */
+ for (logh2 = logh_head; logh2->next; logh2 = logh2->next)
+ ;
+ logh2->next = logh;
+ } else {
+ logh_head = logh;
+ }
+
+ /*
+ * Also tweak the relevant priority-'index' array.
+ */
+ for (i=LOG_EMERG; i<=logh->priority; i++)
+ if (!logh_priorities[i] ||
+ logh_priorities[i]->priority >= logh->priority)
+ logh_priorities[i] = logh;
+
+ return 1;
+}
+
+netsnmp_log_handler *
+netsnmp_register_loghandler( int type, int priority )
+{
+ netsnmp_log_handler *logh;
+
+ logh = SNMP_MALLOC_TYPEDEF(netsnmp_log_handler);
+ if (!logh)
+ return NULL;
+
+ DEBUGMSGT(("logging:register", "registering log type %d with pri %d\n",
+ type, priority));
+
+ logh->type = type;
+ switch ( type ) {
+ case NETSNMP_LOGHANDLER_STDOUT:
+ logh->imagic = 1;
+ /* fallthrough */
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+ case NETSNMP_LOGHANDLER_STDERR:
+ logh->handler = log_handler_stdouterr;
+ break;
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+ case NETSNMP_LOGHANDLER_FILE:
+ logh->handler = log_handler_file;
+ logh->imagic = 1;
+ break;
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+ case NETSNMP_LOGHANDLER_SYSLOG:
+ logh->handler = log_handler_syslog;
+ break;
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+ case NETSNMP_LOGHANDLER_CALLBACK:
+ logh->handler = log_handler_callback;
+ break;
+ case NETSNMP_LOGHANDLER_NONE:
+ logh->handler = log_handler_null;
+ break;
+ default:
+ free(logh);
+ return NULL;
+ }
+ logh->priority = priority;
+ netsnmp_enable_this_loghandler(logh);
+ netsnmp_add_loghandler( logh );
+ return logh;
+}
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_ENABLE_LOGHANDLER
+int
+netsnmp_enable_loghandler( const char *token )
+{
+ netsnmp_log_handler *logh;
+
+ logh = netsnmp_find_loghandler( token );
+ if (!logh)
+ return 0;
+ netsnmp_enable_this_loghandler(logh);
+ return 1;
+}
+
+
+int
+netsnmp_disable_loghandler( const char *token )
+{
+ netsnmp_log_handler *logh;
+
+ logh = netsnmp_find_loghandler( token );
+ if (!logh)
+ return 0;
+ netsnmp_disable_this_loghandler(logh);
+ return 1;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_ENABLE_LOGHANDLER */
+
+int
+netsnmp_remove_loghandler( netsnmp_log_handler *logh )
+{
+ int i;
+ if (!logh)
+ return 0;
+
+ if (logh->prev)
+ logh->prev->next = logh->next;
+ else
+ logh_head = logh->next;
+
+ if (logh->next)
+ logh->next->prev = logh->prev;
+
+ for (i=LOG_EMERG; i<=logh->priority; i++)
+ logh_priorities[i] = NULL;
+ free(NETSNMP_REMOVE_CONST(char*, logh->token));
+ SNMP_FREE(logh);
+
+ return 1;
+}
+
+/* ==================================================== */
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+int
+log_handler_stdouterr( netsnmp_log_handler* logh, int pri, const char *str)
+{
+ static int newline = 1; /* MTCRITICAL_RESOURCE */
+ const char *newline_ptr;
+ char sbuf[40];
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_LOG_TIMESTAMP) && newline) {
+ sprintf_stamp(NULL, sbuf);
+ } else {
+ strcpy(sbuf, "");
+ }
+ /*
+ * Remember whether or not the current line ends with a newline for the
+ * next call of log_handler_stdouterr().
+ */
+ newline_ptr = strrchr(str, '\n');
+ newline = newline_ptr && newline_ptr[1] == 0;
+
+ if (logh->imagic)
+ printf( "%s%s", sbuf, str);
+ else
+ fprintf(stderr, "%s%s", sbuf, str);
+
+ return 1;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG
+#ifdef WIN32
+int
+log_handler_syslog( netsnmp_log_handler* logh, int pri, const char *str)
+{
+ WORD etype;
+ LPCTSTR event_msg[2];
+ HANDLE eventlog_h = logh->magic;
+
+ /*
+ ** EVENT TYPES:
+ **
+ ** Information (EVENTLOG_INFORMATION_TYPE)
+ ** Information events indicate infrequent but significant
+ ** successful operations.
+ ** Warning (EVENTLOG_WARNING_TYPE)
+ ** Warning events indicate problems that are not immediately
+ ** significant, but that may indicate conditions that could
+ ** cause future problems. Resource consumption is a good
+ ** candidate for a warning event.
+ ** Error (EVENTLOG_ERROR_TYPE)
+ ** Error events indicate significant problems that the user
+ ** should know about. Error events usually indicate a loss of
+ ** functionality or data.
+ */
+ switch (pri) {
+ case LOG_EMERG:
+ case LOG_ALERT:
+ case LOG_CRIT:
+ case LOG_ERR:
+ etype = EVENTLOG_ERROR_TYPE;
+ break;
+ case LOG_WARNING:
+ etype = EVENTLOG_WARNING_TYPE;
+ break;
+ case LOG_NOTICE:
+ case LOG_INFO:
+ case LOG_DEBUG:
+ etype = EVENTLOG_INFORMATION_TYPE;
+ break;
+ default:
+ etype = EVENTLOG_INFORMATION_TYPE;
+ break;
+ }
+ event_msg[0] = str;
+ event_msg[1] = NULL;
+ /* NOTE: 4th parameter must match winservice.mc:MessageId value */
+ if (!ReportEvent(eventlog_h, etype, 0, 100, NULL, 1, 0, event_msg, NULL)) {
+ /*
+ * Hmmm.....
+ * Maybe disable this handler, and log the error ?
+ */
+ fprintf(stderr, "Could not report event. Last error: 0x%x\n",
+ GetLastError());
+ return 0;
+ }
+ return 1;
+}
+#else
+int
+log_handler_syslog( netsnmp_log_handler* logh, int pri, const char *str)
+{
+ /*
+ * XXX
+ * We've got three items of information to work with:
+ * Is the syslog currently open?
+ * What ident string to use?
+ * What facility to log to?
+ *
+ * We've got two "magic" locations (imagic & magic) plus the token
+ */
+ if (!(logh->imagic)) {
+ const char *ident = logh->token;
+ int facility = (int)(intptr_t)logh->magic;
+ if (!ident)
+ ident = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ openlog(ident, LOG_CONS | LOG_PID, facility);
+ logh->imagic = 1;
+ }
+ syslog( pri, "%s", str );
+ return 1;
+}
+#endif /* !WIN32 */
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_SYSLOG */
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_FILE
+int
+log_handler_file( netsnmp_log_handler* logh, int pri, const char *str)
+{
+ FILE *fhandle;
+ char sbuf[40];
+
+ /*
+ * We use imagic to save information about whether the next output
+ * will start a new line, and thus might need a timestamp
+ */
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_LOG_TIMESTAMP) && logh->imagic) {
+ sprintf_stamp(NULL, sbuf);
+ } else {
+ strcpy(sbuf, "");
+ }
+
+ /*
+ * If we haven't already opened the file, then do so.
+ * Save the filehandle pointer for next time.
+ *
+ * Note that this should still work, even if the file
+ * is closed in the meantime (e.g. a regular "cleanup" sweep)
+ */
+ fhandle = (FILE*)logh->magic;
+ if (!logh->magic) {
+ fhandle = fopen(logh->token, "a+");
+ if (!fhandle)
+ return 0;
+ logh->magic = (void*)fhandle;
+ }
+ fprintf(fhandle, "%s%s", sbuf, str);
+ fflush(fhandle);
+ logh->imagic = str[strlen(str) - 1] == '\n';
+ return 1;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_FILE */
+
+int
+log_handler_callback(netsnmp_log_handler* logh, int pri, const char *str)
+{
+ /*
+ * XXX - perhaps replace 'snmp_call_callbacks' processing
+ * with individual callback log_handlers ??
+ */
+ struct snmp_log_message slm;
+ int dodebug = snmp_get_do_debugging();
+
+ slm.priority = pri;
+ slm.msg = str;
+ if (dodebug) /* turn off debugging inside the callbacks else will loop */
+ snmp_set_do_debugging(0);
+ snmp_call_callbacks(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_LOGGING, &slm);
+ if (dodebug)
+ snmp_set_do_debugging(dodebug);
+ return 1;
+}
+
+int
+log_handler_null( netsnmp_log_handler* logh, int pri, const char *str)
+{
+ /*
+ * Dummy log handler - just throw away the error completely
+ * You probably don't really want to do this!
+ */
+ return 1;
+}
+
+void
+snmp_log_string(int priority, const char *str)
+{
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+ static int stderr_enabled = 0;
+ static netsnmp_log_handler lh = { 1, 0, 0, 0, "stderr",
+ log_handler_stdouterr, 0, NULL, NULL,
+ NULL };
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+ netsnmp_log_handler *logh;
+
+ /*
+ * We've got to be able to log messages *somewhere*!
+ * If you don't want stderr logging, then enable something else.
+ */
+ if (0 == logh_enabled) {
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+ if (!stderr_enabled) {
+ ++stderr_enabled;
+ netsnmp_set_line_buffering(stderr);
+ }
+ log_handler_stdouterr( &lh, priority, str );
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+
+ return;
+ }
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
+ else if (stderr_enabled) {
+ stderr_enabled = 0;
+ log_handler_stdouterr( &lh, LOG_INFO,
+ "Log handling defined - disabling stderr\n" );
+ }
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
+
+
+ /*
+ * Start at the given priority, and work "upwards"....
+ */
+ logh = logh_priorities[priority];
+ for ( ; logh; logh = logh->next ) {
+ /*
+ * ... but skipping any handlers with a "maximum priority"
+ * that we have already exceeded. And don't forget to
+ * ensure this logging is turned on (see snmp_disable_stderrlog
+ * and its cohorts).
+ */
+ if (logh->enabled && (priority >= logh->pri_max))
+ logh->handler( logh, priority, str );
+ }
+}
+
+/* ==================================================== */
+
+
+/**
+ * This snmp logging function allows variable argument list given the
+ * specified priority, format and a populated va_list structure.
+ * The default logfile this function writes to is /var/log/snmpd.log.
+ *
+ * @param priority is an integer representing the type of message to be written
+ * to the snmp log file. The types are errors, warning, and information.
+ * - The error types are:
+ * - LOG_EMERG system is unusable
+ * - LOG_ALERT action must be taken immediately
+ * - LOG_CRIT critical conditions
+ * - LOG_ERR error conditions
+ * - The warning type is:
+ * - LOG_WARNING warning conditions
+ * - The information types are:
+ * - LOG_NOTICE normal but significant condition
+ * - LOG_INFO informational
+ * - LOG_DEBUG debug-level messages
+ *
+ * @param format is a pointer to a char representing the variable argument list
+ * format used.
+ *
+ * @param ap is a va_list type used to traverse the list of arguments.
+ *
+ * @return Returns 0 on success, -1 when the code could not format the log-
+ * string, -2 when dynamic memory could not be allocated if the length
+ * of the log buffer is greater then 1024 bytes. For each of these
+ * errors a LOG_ERR messgae is written to the logfile.
+ *
+ * @see snmp_log
+ */
+int
+snmp_vlog(int priority, const char *format, va_list ap)
+{
+ char buffer[LOGLENGTH];
+ int length;
+ char *dynamic;
+ va_list aq;
+
+ va_copy(aq, ap);
+ length = vsnprintf(buffer, LOGLENGTH, format, ap);
+ va_end(ap);
+
+ if (length == 0) {
+#ifdef NEED_VA_END_AFTER_VA_COPY
+ va_end(aq);
+#endif
+ return (0); /* Empty string */
+ }
+
+ if (length == -1) {
+ snmp_log_string(LOG_ERR, "Could not format log-string\n");
+#ifdef NEED_VA_END_AFTER_VA_COPY
+ va_end(aq);
+#endif
+ return (-1);
+ }
+
+ if (length < LOGLENGTH) {
+ snmp_log_string(priority, buffer);
+#ifdef NEED_VA_END_AFTER_VA_COPY
+ va_end(aq);
+#endif
+ return (0);
+ }
+
+ dynamic = (char *) malloc(length + 1);
+ if (dynamic == NULL) {
+ snmp_log_string(LOG_ERR,
+ "Could not allocate memory for log-message\n");
+ snmp_log_string(priority, buffer);
+#ifdef NEED_VA_END_AFTER_VA_COPY
+ va_end(aq);
+#endif
+ return (-2);
+ }
+
+ vsnprintf(dynamic, length + 1, format, aq);
+ snmp_log_string(priority, dynamic);
+ free(dynamic);
+ va_end(aq);
+ return 0;
+}
+
+/**
+ * This snmp logging function allows variable argument list given the
+ * specified format and priority. Calls the snmp_vlog function.
+ * The default logfile this function writes to is /var/log/snmpd.log.
+ *
+ * @see snmp_vlog
+ */
+int
+snmp_log(int priority, const char *format, ...)
+{
+ va_list ap;
+ int ret;
+ va_start(ap, format);
+ ret = snmp_vlog(priority, format, ap);
+ va_end(ap);
+ return (ret);
+}
+
+/*
+ * log a critical error.
+ */
+void
+snmp_log_perror(const char *s)
+{
+ char *error = strerror(errno);
+ if (s) {
+ if (error)
+ snmp_log(LOG_ERR, "%s: %s\n", s, error);
+ else
+ snmp_log(LOG_ERR, "%s: Error %d out-of-range\n", s, errno);
+ } else {
+ if (error)
+ snmp_log(LOG_ERR, "%s\n", error);
+ else
+ snmp_log(LOG_ERR, "Error %d out-of-range\n", errno);
+ }
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_EXTERNAL
+/* external access to logh_head variable */
+netsnmp_log_handler *
+get_logh_head(void)
+{
+ return logh_head;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_EXTERNAL */
+
+/** @} */
diff --git a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c
new file mode 100644
index 0000000..3b0eaa8
--- /dev/null
+++ b/snmplib/snmp_openssl.c
@@ -0,0 +1,879 @@
+/*
+ * snmp_openssl.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/net-snmp-features.h>
+
+#if defined(NETSNMP_USE_OPENSSL) && defined(HAVE_LIBSSL) && !defined(NETSNMP_FEATURE_REMOVE_CERT_UTIL)
+
+netsnmp_feature_require(container_free_all)
+
+netsnmp_feature_child_of(openssl_cert_get_subjectAltNames, netsnmp_unused)
+netsnmp_feature_child_of(openssl_ht2nid, netsnmp_unused)
+netsnmp_feature_child_of(openssl_err_log, netsnmp_unused)
+netsnmp_feature_child_of(cert_dump_names, netsnmp_unused)
+
+#include <ctype.h>
+
+#include <openssl/evp.h>
+#include <openssl/ssl.h>
+#include <openssl/x509.h>
+#include <openssl/x509v3.h>
+#include <openssl/err.h>
+#include <openssl/objects.h>
+
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/cert_util.h>
+#include <net-snmp/library/snmp_openssl.h>
+
+static u_char have_started_already = 0;
+
+/*
+ * This code merely does openssl initialization so that multilpe
+ * modules are safe to call netsnmp_init_openssl() for bootstrapping
+ * without worrying about other callers that may have already done so.
+ */
+void netsnmp_init_openssl(void) {
+
+ /* avoid duplicate calls */
+ if (have_started_already)
+ return;
+ have_started_already = 1;
+
+ DEBUGMSGTL(("snmp_openssl", "initializing\n"));
+
+ /* Initializing OpenSSL */
+ SSL_library_init();
+ SSL_load_error_strings();
+ ERR_load_BIO_strings();
+ OpenSSL_add_all_algorithms();
+}
+
+/** netsnmp_openssl_cert_get_name: get subject name field from cert
+ * @internal
+ */
+/** instead of exposing this function, make helper functions for each
+ * field, like netsnmp_openssl_cert_get_commonName, below */
+static char *
+_cert_get_name(X509 *ocert, int which, char **buf, int *len, int flags)
+{
+ X509_NAME *osubj_name;
+ int space;
+ char *buf_ptr;
+
+ if ((NULL == ocert) || ((buf && !len) || (len && !buf)))
+ return NULL;
+
+ osubj_name = X509_get_subject_name(ocert);
+ if (NULL == osubj_name) {
+ DEBUGMSGT(("openssl:cert:name", "no subject name!\n"));
+ return NULL;
+ }
+
+ /** see if buf is big enough, or allocate buf if none specified */
+ space = X509_NAME_get_text_by_NID(osubj_name, which, NULL, 0);
+ if (-1 == space)
+ return NULL;
+ ++space; /* for NUL */
+ if (buf && *buf) {
+ if (*len < space)
+ return NULL;
+ buf_ptr = *buf;
+ }
+ else {
+ buf_ptr = calloc(1,space);
+ if (!buf_ptr)
+ return NULL;
+ }
+ space = X509_NAME_get_text_by_NID(osubj_name, which, buf_ptr, space);
+ if (len)
+ *len = space;
+
+ return buf_ptr;
+}
+
+/** netsnmp_openssl_cert_get_subjectName: get subject name field from cert
+ */
+char *
+netsnmp_openssl_cert_get_subjectName(X509 *ocert, char **buf, int *len)
+{
+ X509_NAME *osubj_name;
+ int space;
+ char *buf_ptr;
+
+ if ((NULL == ocert) || ((buf && !len) || (len && !buf)))
+ return NULL;
+
+ osubj_name = X509_get_subject_name(ocert);
+ if (NULL == osubj_name) {
+ DEBUGMSGT(("openssl:cert:name", "no subject name!\n"));
+ return NULL;
+ }
+
+ if (buf) {
+ buf_ptr = *buf;
+ space = *len;
+ }
+ else {
+ buf_ptr = NULL;
+ space = 0;
+ }
+ buf_ptr = X509_NAME_oneline(osubj_name, buf_ptr, space);
+ if (len)
+ *len = strlen(buf_ptr);
+
+ return buf_ptr;
+}
+
+/** netsnmp_openssl_cert_get_commonName: get commonName for cert.
+ * if a pointer to a buffer and its length are specified, they will be
+ * used. otherwise, a new buffer will be allocated, which the caller will
+ * be responsbile for releasing.
+ */
+char *
+netsnmp_openssl_cert_get_commonName(X509 *ocert, char **buf, int *len)
+{
+ return _cert_get_name(ocert, NID_commonName, buf, len, 0);
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_CERT_DUMP_NAMES
+/** netsnmp_openssl_cert_dump_name: dump subject names in cert
+ */
+void
+netsnmp_openssl_cert_dump_names(X509 *ocert)
+{
+ int i, onid;
+ X509_NAME_ENTRY *oname_entry;
+ X509_NAME *osubj_name;
+ const char *prefix_short, *prefix_long;
+
+ if (NULL == ocert)
+ return;
+
+ osubj_name = X509_get_subject_name(ocert);
+ if (NULL == osubj_name) {
+ DEBUGMSGT(("9:cert:dump:names", "no subject name!\n"));
+ return;
+ }
+
+ for (i = 0; i < X509_NAME_entry_count(osubj_name); i++) {
+ oname_entry = X509_NAME_get_entry(osubj_name, i);
+ netsnmp_assert(NULL != oname_entry);
+
+ if (oname_entry->value->type != V_ASN1_PRINTABLESTRING)
+ continue;
+
+ /** get NID */
+ onid = OBJ_obj2nid(oname_entry->object);
+ if (onid == NID_undef) {
+ prefix_long = prefix_short = "UNKNOWN";
+ }
+ else {
+ prefix_long = OBJ_nid2ln(onid);
+ prefix_short = OBJ_nid2sn(onid);
+ }
+
+ DEBUGMSGT(("9:cert:dump:names",
+ "[%02d] NID type %d, ASN type %d\n", i, onid,
+ oname_entry->value->type));
+ DEBUGMSGT(("9:cert:dump:names", "%s/%s: '%s'\n", prefix_long,
+ prefix_short, ASN1_STRING_data(oname_entry->value)));
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CERT_DUMP_NAMES */
+
+static char *
+_cert_get_extension(X509_EXTENSION *oext, char **buf, int *len, int flags)
+{
+ int space;
+ char *buf_ptr = NULL;
+ u_char *data;
+ BIO *bio;
+
+ if ((NULL == oext) || ((buf && !len) || (len && !buf)))
+ return NULL;
+
+ bio = BIO_new(BIO_s_mem());
+ if (NULL == bio) {
+ snmp_log(LOG_ERR, "could not get bio for extension\n");
+ return NULL;
+ }
+ if (X509V3_EXT_print(bio, oext, 0, 0) != 1) {
+ snmp_log(LOG_ERR, "could not print extension!\n");
+ BIO_vfree(bio);
+ return NULL;
+ }
+
+ space = BIO_get_mem_data(bio, &data);
+ if (buf && *buf) {
+ if (*len < space)
+ buf_ptr = NULL;
+ else
+ buf_ptr = *buf;
+ }
+ else
+ buf_ptr = calloc(1,space + 1);
+
+ if (!buf_ptr) {
+ snmp_log(LOG_ERR,
+ "not enough space or error in allocation for extenstion\n");
+ BIO_vfree(bio);
+ return NULL;
+ }
+ memcpy(buf_ptr, data, space);
+ buf_ptr[space] = 0;
+ if (len)
+ *len = space;
+
+ BIO_vfree(bio);
+
+ return buf_ptr;
+}
+
+/** netsnmp_openssl_cert_get_extension: get extension field from cert
+ * @internal
+ */
+/** instead of exposing this function, make helper functions for each
+ * field, like netsnmp_openssl_cert_get_subjectAltName, below */
+X509_EXTENSION *
+_cert_get_extension_at(X509 *ocert, int pos, char **buf, int *len, int flags)
+{
+ X509_EXTENSION *oext;
+
+ if ((NULL == ocert) || ((buf && !len) || (len && !buf)))
+ return NULL;
+
+ oext = X509_get_ext(ocert,pos);
+ if (NULL == oext) {
+ snmp_log(LOG_ERR, "extension number %d not found!\n", pos);
+ netsnmp_openssl_cert_dump_extensions(ocert);
+ return NULL;
+ }
+
+ return oext;
+}
+
+/** netsnmp_openssl_cert_get_extension: get extension field from cert
+ * @internal
+ */
+/** instead of exposing this function, make helper functions for each
+ * field, like netsnmp_openssl_cert_get_subjectAltName, below */
+static char *
+_cert_get_extension_str_at(X509 *ocert, int pos, char **buf, int *len,
+ int flags)
+{
+ X509_EXTENSION *oext;
+
+ if ((NULL == ocert) || ((buf && !len) || (len && !buf)))
+ return NULL;
+
+ oext = X509_get_ext(ocert,pos);
+ if (NULL == oext) {
+ snmp_log(LOG_ERR, "extension number %d not found!\n", pos);
+ netsnmp_openssl_cert_dump_extensions(ocert);
+ return NULL;
+ }
+
+ return _cert_get_extension(oext, buf, len, flags);
+}
+
+/** _cert_get_extension_id: get extension field from cert
+ * @internal
+ */
+/** instead of exposing this function, make helper functions for each
+ * field, like netsnmp_openssl_cert_get_subjectAltName, below */
+X509_EXTENSION *
+_cert_get_extension_id(X509 *ocert, int which, char **buf, int *len, int flags)
+{
+ int pos;
+
+ if ((NULL == ocert) || ((buf && !len) || (len && !buf)))
+ return NULL;
+
+ pos = X509_get_ext_by_NID(ocert,which,-1);
+ if (pos < 0) {
+ DEBUGMSGT(("openssl:cert:name", "no extension %d\n", which));
+ return NULL;
+ }
+
+ return _cert_get_extension_at(ocert, pos, buf, len, flags);
+}
+
+/** _cert_get_extension_id_str: get extension field from cert
+ * @internal
+ */
+/** instead of exposing this function, make helper functions for each
+ * field, like netsnmp_openssl_cert_get_subjectAltName, below */
+static char *
+_cert_get_extension_id_str(X509 *ocert, int which, char **buf, int *len,
+ int flags)
+{
+ int pos;
+
+ if ((NULL == ocert) || ((buf && !len) || (len && !buf)))
+ return NULL;
+
+ pos = X509_get_ext_by_NID(ocert,which,-1);
+ if (pos < 0) {
+ DEBUGMSGT(("openssl:cert:name", "no extension %d\n", which));
+ return NULL;
+ }
+
+ return _cert_get_extension_str_at(ocert, pos, buf, len, flags);
+}
+
+static char *
+_extract_oname(const GENERAL_NAME *oname)
+{
+ char ipbuf[60], *buf = NULL, *rtn = NULL;
+
+ if (NULL == oname)
+ return NULL;
+
+ switch ( oname->type ) {
+ case GEN_EMAIL:
+ case GEN_DNS:
+ /*case GEN_URI:*/
+ ASN1_STRING_to_UTF8((unsigned char**)&buf, oname->d.ia5);
+ if (buf)
+ rtn = strdup(buf);
+ break;
+
+ case GEN_IPADD:
+ if (oname->d.iPAddress->length == 4) {
+ sprintf(ipbuf, "%d.%d.%d.%d", oname->d.iPAddress->data[0],
+ oname->d.iPAddress->data[1],
+ oname->d.iPAddress->data[2],
+ oname->d.iPAddress->data[3]);
+ rtn = strdup(ipbuf);
+ }
+ else if ((oname->d.iPAddress->length == 16) ||
+ (oname->d.iPAddress->length == 20)) {
+ char *pos = ipbuf;
+ int j;
+ for(j = 0; j < oname->d.iPAddress->length; ++j) {
+ *pos++ = VAL2HEX(oname->d.iPAddress->data[j]);
+ *pos++ = ':';
+ }
+ *pos = '\0';
+ rtn = strdup(ipbuf);
+ }
+ else
+ NETSNMP_LOGONCE((LOG_WARNING, "unexpected ip addr length %d\n",
+ oname->d.iPAddress->length));
+
+ break;
+ default:
+ DEBUGMSGT(("openssl:cert:san", "unknown/unsupported type %d\n",
+ oname->type));
+ break;
+ }
+ DEBUGMSGT(("9:openssl:cert:san", "san=%s\n", buf));
+ if (buf)
+ OPENSSL_free(buf);
+
+ return rtn;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_OPENSSL_CERT_GET_SUBJECTALTNAMES
+/** netsnmp_openssl_cert_get_subjectAltName: get subjectAltName for cert.
+ * if a pointer to a buffer and its length are specified, they will be
+ * used. otherwise, a new buffer will be allocated, which the caller will
+ * be responsbile for releasing.
+ */
+char *
+netsnmp_openssl_cert_get_subjectAltNames(X509 *ocert, char **buf, int *len)
+{
+ return _cert_get_extension_id_str(ocert, NID_subject_alt_name, buf, len, 0);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_CERT_GET_SUBJECTALTNAMES */
+
+void
+netsnmp_openssl_cert_dump_extensions(X509 *ocert)
+{
+ X509_EXTENSION *extension;
+ const char *extension_name;
+ char buf[SNMP_MAXBUF_SMALL], *buf_ptr = buf, *str, *lf;
+ int i, num_extensions, buf_len, nid;
+
+ if (NULL == ocert)
+ return;
+
+ DEBUGIF("9:cert:dump")
+ ;
+ else
+ return; /* bail if debug not enabled */
+
+ num_extensions = X509_get_ext_count(ocert);
+ if (0 == num_extensions)
+ DEBUGMSGT(("9:cert:dump", " 0 extensions\n"));
+ for(i = 0; i < num_extensions; i++) {
+ extension = X509_get_ext(ocert, i);
+ nid = OBJ_obj2nid(X509_EXTENSION_get_object(extension));
+ extension_name = OBJ_nid2sn(nid);
+ buf_len = sizeof(buf);
+ str = _cert_get_extension_str_at(ocert, i, &buf_ptr, &buf_len, 0);
+ lf = strchr(str, '\n'); /* look for multiline strings */
+ if (NULL != lf)
+ *lf = '\0'; /* only log first line of multiline here */
+ DEBUGMSGT(("9:cert:dump", " %2d: %s = %s\n", i,
+ extension_name, str));
+ while(lf) { /* log remaining parts of multiline string */
+ str = ++lf;
+ if (*str == '\0')
+ break;
+ lf = strchr(str, '\n');
+ if (NULL == lf)
+ break;
+ *lf = '\0';
+ DEBUGMSGT(("9:cert:dump", " %s\n", str));
+ }
+ }
+}
+
+static int _htmap[NS_HASH_MAX + 1] = {
+ 0, NID_md5WithRSAEncryption, NID_sha1WithRSAEncryption,
+ NID_sha224WithRSAEncryption, NID_sha256WithRSAEncryption,
+ NID_sha384WithRSAEncryption, NID_sha512WithRSAEncryption };
+
+int
+_nid2ht(int nid)
+{
+ int i;
+ for (i=1; i<= NS_HASH_MAX; ++i) {
+ if (nid == _htmap[i])
+ return i;
+ }
+ return 0;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_OPENSSL_HT2NID
+int
+_ht2nid(int ht)
+{
+ if ((ht < 0) || (ht > NS_HASH_MAX))
+ return 0;
+ return _htmap[ht];
+}
+#endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_HT2NID */
+
+/**
+ * returns allocated pointer caller must free.
+ */
+int
+netsnmp_openssl_cert_get_hash_type(X509 *ocert)
+{
+ if (NULL == ocert)
+ return 0;
+
+ return _nid2ht(OBJ_obj2nid(ocert->sig_alg->algorithm));
+}
+
+/**
+ * returns allocated pointer caller must free.
+ */
+char *
+netsnmp_openssl_cert_get_fingerprint(X509 *ocert, int alg)
+{
+ u_char fingerprint[EVP_MAX_MD_SIZE];
+ u_int fingerprint_len, nid;
+ const EVP_MD *digest;
+ char *result = NULL;
+
+ if (NULL == ocert)
+ return NULL;
+
+ nid = OBJ_obj2nid(ocert->sig_alg->algorithm);
+ DEBUGMSGT(("9:openssl:fingerprint", "alg %d, cert nid %d (%d)\n", alg, nid,
+ _nid2ht(nid)));
+
+ if ((-1 == alg) && nid)
+ alg = _nid2ht(nid);
+
+ switch (alg) {
+ case NS_HASH_MD5:
+ snmp_log(LOG_ERR, "hash type md5 not yet supported\n");
+ return NULL;
+ break;
+
+ case NS_HASH_NONE:
+ snmp_log(LOG_ERR, "hash type none not supported. using SHA1\n");
+ /** fall through */
+
+ case NS_HASH_SHA1:
+ digest = EVP_sha1();
+ break;
+
+#ifdef HAVE_EVP_SHA224
+ case NS_HASH_SHA224:
+ digest = EVP_sha224();
+ break;
+
+ case NS_HASH_SHA256:
+ digest = EVP_sha256();
+ break;
+
+#endif
+#ifdef HAVE_EVP_SHA384
+ case NS_HASH_SHA384:
+ digest = EVP_sha384();
+ break;
+
+ case NS_HASH_SHA512:
+ digest = EVP_sha512();
+ break;
+#endif
+
+ default:
+ snmp_log(LOG_ERR, "unknown hash algorithm %d\n", alg);
+ return NULL;
+ }
+
+ if (_nid2ht(nid) != alg) {
+ DEBUGMSGT(("openssl:fingerprint",
+ "WARNING: alg %d does not match cert alg %d\n",
+ alg, _nid2ht(nid)));
+ }
+ if (X509_digest(ocert,digest,fingerprint,&fingerprint_len)) {
+ binary_to_hex(fingerprint, fingerprint_len, &result);
+ if (NULL == result)
+ snmp_log(LOG_ERR, "failed to hexify fingerprint\n");
+ else
+ DEBUGMSGT(("9:openssl:fingerprint", "fingerprint %s\n", result));
+ }
+ else
+ snmp_log(LOG_ERR,"failed to compute fingerprint\n");
+
+ return result;
+}
+
+/**
+ * get container of netsnmp_cert_map structures from an ssl connection
+ * certificate chain.
+ */
+netsnmp_container *
+netsnmp_openssl_get_cert_chain(SSL *ssl)
+{
+ X509 *ocert, *ocert_tmp;
+ STACK_OF(X509) *ochain;
+ char *fingerprint;
+ netsnmp_container *chain_map;
+ netsnmp_cert_map *cert_map;
+ int i;
+
+ netsnmp_assert_or_return(ssl != NULL, NULL);
+
+ if (NULL == (ocert = SSL_get_peer_certificate(ssl))) {
+ /** no peer cert */
+ snmp_log(LOG_ERR, "SSL peer has no certificate\n");
+ return NULL;
+ }
+ DEBUGIF("9:cert:dump") {
+ netsnmp_openssl_cert_dump_extensions(ocert);
+ }
+
+ /*
+ * get fingerprint and save it
+ */
+ fingerprint = netsnmp_openssl_cert_get_fingerprint(ocert, -1);
+ if (NULL == fingerprint)
+ return NULL;
+
+ /*
+ * allocate cert map. Don't pass in fingerprint, since it would strdup
+ * it and we've already got a copy.
+ */
+ cert_map = netsnmp_cert_map_alloc(NULL, ocert);
+ if (NULL == cert_map) {
+ free(fingerprint);
+ return NULL;
+ }
+ cert_map->fingerprint = fingerprint;
+ cert_map->hashType = netsnmp_openssl_cert_get_hash_type(ocert);
+
+ chain_map = netsnmp_cert_map_container_create(0); /* no fp subcontainer */
+ if (NULL == chain_map) {
+ netsnmp_cert_map_free(cert_map);
+ return NULL;
+ }
+
+ CONTAINER_INSERT(chain_map, cert_map);
+
+ /** check for a chain to a CA */
+ ochain = SSL_get_peer_cert_chain(ssl);
+ if ((NULL == ochain) || (0 == sk_num((const void *)ochain))) {
+ DEBUGMSGT(("ssl:cert:chain", "peer has no cert chain\n"));
+ }
+ else {
+ /*
+ * loop over chain, adding fingerprint / cert for each
+ */
+ DEBUGMSGT(("ssl:cert:chain", "examining cert chain\n"));
+ for(i = 0; i < sk_num((const void *)ochain); ++i) {
+ ocert_tmp = (X509*)sk_value((const void *)ochain,i);
+ fingerprint = netsnmp_openssl_cert_get_fingerprint(ocert_tmp,
+ NS_HASH_SHA1);
+ if (NULL == fingerprint)
+ break;
+ cert_map = netsnmp_cert_map_alloc(NULL, ocert);
+ if (NULL == cert_map) {
+ free(fingerprint);
+ break;
+ }
+ cert_map->fingerprint = fingerprint;
+ cert_map->hashType = netsnmp_openssl_cert_get_hash_type(ocert_tmp);
+
+ CONTAINER_INSERT(chain_map, cert_map);
+ } /* chain loop */
+ /*
+ * if we broke out of loop before finishing, clean up
+ */
+ if (i < sk_num((const void *)ochain))
+ CONTAINER_FREE_ALL(chain_map, NULL);
+ } /* got peer chain */
+
+ DEBUGMSGT(("ssl:cert:chain", "found %" NETSNMP_PRIz "u certs in chain\n",
+ CONTAINER_SIZE(chain_map)));
+ if (CONTAINER_SIZE(chain_map) == 0) {
+ CONTAINER_FREE(chain_map);
+ chain_map = NULL;
+ }
+
+ return chain_map;
+}
+
+/*
+tlstmCertSANRFC822Name "Maps a subjectAltName's rfc822Name to a
+ tmSecurityName. The local part of the rfc822Name is
+ passed unaltered but the host-part of the name must
+ be passed in lower case.
+ Example rfc822Name Field: FooBar@Example.COM
+ is mapped to tmSecurityName: FooBar@example.com"
+
+tlstmCertSANDNSName "Maps a subjectAltName's dNSName to a
+ tmSecurityName after first converting it to all
+ lower case."
+
+tlstmCertSANIpAddress "Maps a subjectAltName's iPAddress to a
+ tmSecurityName by transforming the binary encoded
+ address as follows:
+ 1) for IPv4 the value is converted into a decimal
+ dotted quad address (e.g. '192.0.2.1')
+ 2) for IPv6 addresses the value is converted into a
+ 32-character all lowercase hexadecimal string
+ without any colon separators.
+
+ Note that the resulting length is the maximum
+ length supported by the View-Based Access Control
+ Model (VACM). Note that using both the Transport
+ Security Model's support for transport prefixes
+ (see the SNMP-TSM-MIB's
+ snmpTsmConfigurationUsePrefix object for details)
+ will result in securityName lengths that exceed
+ what VACM can handle."
+
+tlstmCertSANAny "Maps any of the following fields using the
+ corresponding mapping algorithms:
+ | rfc822Name | tlstmCertSANRFC822Name |
+ | dNSName | tlstmCertSANDNSName |
+ | iPAddress | tlstmCertSANIpAddress |
+ The first matching subjectAltName value found in the
+ certificate of the above types MUST be used when
+ deriving the tmSecurityName."
+*/
+char *
+_cert_get_san_type(X509 *ocert, int mapType)
+{
+ GENERAL_NAMES *onames;
+ const GENERAL_NAME *oname = NULL;
+ char *buf = NULL, *lower = NULL;
+ int count, i;
+
+ onames = (GENERAL_NAMES *)X509_get_ext_d2i(ocert, NID_subject_alt_name,
+ NULL, NULL );
+ if (NULL == onames)
+ return NULL;
+
+ count = sk_GENERAL_NAME_num(onames);
+
+ for (i=0 ; i <count; ++i) {
+ oname = sk_GENERAL_NAME_value(onames, i);
+
+ if (GEN_DNS == oname->type) {
+ if ((TSNM_tlstmCertSANDNSName == mapType) ||
+ (TSNM_tlstmCertSANAny == mapType)) {
+ lower = buf = _extract_oname( oname );;
+ break;
+ }
+ }
+ else if (GEN_IPADD == oname->type) {
+ if ((TSNM_tlstmCertSANIpAddress == mapType) ||
+ (TSNM_tlstmCertSANAny == mapType))
+ buf = _extract_oname(oname);
+ break;
+ }
+ else if (GEN_EMAIL == oname->type) {
+ if ((TSNM_tlstmCertSANRFC822Name == mapType) ||
+ (TSNM_tlstmCertSANAny == mapType)) {
+ buf = _extract_oname(oname);
+ lower = strchr(buf, '@');
+ if (NULL == lower) {
+ DEBUGMSGT(("openssl:secname:extract",
+ "email %s has no '@'!\n", buf));
+ }
+ else {
+ ++lower;
+ break;
+ }
+ }
+
+ }
+ } /* for loop */
+
+ if (lower)
+ for ( ; *lower; ++lower )
+ if (isascii(*lower))
+ *lower = tolower(0xFF & *lower);
+ DEBUGMSGT(("openssl:cert:extension:san", "#%d type %d: %s\n", i,
+ oname ? oname->type : -1, buf ? buf : "NULL"));
+
+ return buf;
+}
+
+char *
+netsnmp_openssl_extract_secname(netsnmp_cert_map *cert_map,
+ netsnmp_cert_map *peer_cert)
+{
+ char *rtn = NULL;
+
+ if (NULL == cert_map)
+ return NULL;
+
+ DEBUGMSGT(("openssl:secname:extract",
+ "checking priority %d, san of type %d for %s\n",
+ cert_map->priority, cert_map->mapType, peer_cert->fingerprint));
+
+ switch(cert_map->mapType) {
+ case TSNM_tlstmCertSpecified:
+ rtn = strdup(cert_map->data);
+ break;
+
+ case TSNM_tlstmCertSANRFC822Name:
+ case TSNM_tlstmCertSANDNSName:
+ case TSNM_tlstmCertSANIpAddress:
+ case TSNM_tlstmCertSANAny:
+ if (NULL == peer_cert) {
+ DEBUGMSGT(("openssl:secname:extract", "no peer cert for %s\n",
+ cert_map->fingerprint));
+ break;
+ }
+ rtn = _cert_get_san_type(peer_cert->ocert, cert_map->mapType);
+ if (NULL == rtn) {
+ DEBUGMSGT(("openssl:secname:extract", "no san for %s\n",
+ peer_cert->fingerprint));
+ }
+ break;
+
+ case TSNM_tlstmCertCommonName:
+ rtn = netsnmp_openssl_cert_get_commonName(cert_map->ocert, NULL,
+ NULL);
+ break;
+ default:
+ snmp_log(LOG_ERR, "cant extract secname for unknown map type %d\n",
+ cert_map->mapType);
+ break;
+ } /* switch mapType */
+
+ if (rtn) {
+ DEBUGMSGT(("openssl:secname:extract",
+ "found map %d, type %d for %s: %s\n", cert_map->priority,
+ cert_map->mapType, peer_cert->fingerprint, rtn));
+ if (strlen(rtn) >32) {
+ DEBUGMSGT(("openssl:secname:extract",
+ "secName longer than 32 chars! dropping...\n"));
+ SNMP_FREE(rtn);
+ }
+ }
+ else
+ DEBUGMSGT(("openssl:secname:extract",
+ "no map of type %d for %s\n",
+ cert_map->mapType, peer_cert->fingerprint));
+ return rtn;
+}
+
+int
+netsnmp_openssl_cert_issued_by(X509 *issuer, X509 *cert)
+{
+ return (X509_check_issued(issuer, cert) == X509_V_OK);
+}
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG
+void
+netsnmp_openssl_err_log(const char *prefix)
+{
+ unsigned long err;
+ for (err = ERR_get_error(); err; err = ERR_get_error()) {
+ snmp_log(LOG_ERR,"%s: %ld\n", prefix ? prefix: "openssl error", err);
+ snmp_log(LOG_ERR, "library=%d, function=%d, reason=%d\n",
+ ERR_GET_LIB(err), ERR_GET_FUNC(err), ERR_GET_REASON(err));
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG */
+
+void
+netsnmp_openssl_null_checks(SSL *ssl, int *null_auth, int *null_cipher)
+{
+ const SSL_CIPHER *cipher;
+ char tmp_buf[128], *cipher_alg, *auth_alg;
+
+ if (null_auth)
+ *null_auth = -1; /* unknown */
+ if (null_cipher)
+ *null_cipher = -1; /* unknown */
+ if (NULL == ssl)
+ return;
+
+ cipher = SSL_get_current_cipher(ssl);
+ if (NULL == cipher) {
+ DEBUGMSGTL(("ssl:cipher", "no cipher yet\n"));
+ return;
+ }
+ SSL_CIPHER_description(NETSNMP_REMOVE_CONST(SSL_CIPHER *, cipher), tmp_buf, sizeof(tmp_buf));
+ /** no \n since tmp_buf already has one */
+ DEBUGMSGTL(("ssl:cipher", "current cipher: %s", tmp_buf));
+
+ /*
+ * run "openssl ciphers -v eNULL" and "openssl ciphers -v aNULL"
+ * to see NULL encryption/authentication algorithms. e.g.
+ *
+ * EXP-ADH-RC4-MD5 SSLv3 Kx=DH(512) Au=None Enc=RC4(40) Mac=MD5 export
+ * NULL-SHA SSLv3 Kx=RSA Au=RSA Enc=None Mac=SHA1
+ */
+ if (null_cipher) {
+ cipher_alg = strstr(tmp_buf, "Enc=");
+ if (cipher_alg) {
+ cipher_alg += 4;
+ if (strncmp(cipher_alg,"None", 4) == 0)
+ *null_cipher = 1;
+ else
+ *null_cipher = 0;
+ }
+ }
+ if (null_auth) {
+ auth_alg = strstr(tmp_buf, "Au=");
+ if (auth_alg) {
+ auth_alg += 3;
+ if (strncmp(auth_alg,"None", 4) == 0)
+ *null_auth = 1;
+ else
+ *null_auth = 0;
+ }
+ }
+}
+
+#endif /* NETSNMP_USE_OPENSSL && HAVE_LIBSSL && !defined(NETSNMP_FEATURE_REMOVE_CERT_UTIL) */
diff --git a/snmplib/snmp_parse_args.c b/snmplib/snmp_parse_args.c
new file mode 100644
index 0000000..c73b84c
--- /dev/null
+++ b/snmplib/snmp_parse_args.c
@@ -0,0 +1,832 @@
+/*
+ * snmp_parse_args.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 <errno.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
+#include <sys/types.h>
+#include <stdio.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <ctype.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.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_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/library/snmp_parse_args.h> /* for "internal" definitions */
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_client.h>
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/keytools.h>
+
+#include <net-snmp/version.h>
+#include <net-snmp/library/parse.h>
+#include <net-snmp/library/snmpv3.h>
+#include <net-snmp/library/transform_oids.h>
+
+int random_access = 0;
+
+void
+snmp_parse_args_usage(FILE * outf)
+{
+ fprintf(outf, "[OPTIONS] AGENT");
+}
+
+void
+snmp_parse_args_descriptions(FILE * outf)
+{
+ fprintf(outf, " Version: %s\n", netsnmp_get_version());
+ fprintf(outf, " Web: http://www.net-snmp.org/\n");
+ fprintf(outf,
+ " Email: net-snmp-coders@lists.sourceforge.net\n\nOPTIONS:\n");
+ fprintf(outf, " -h, --help\t\tdisplay this help message\n");
+ fprintf(outf,
+ " -H\t\t\tdisplay configuration file directives understood\n");
+ fprintf(outf, " -v 1|2c|3\t\tspecifies SNMP version to use\n");
+ fprintf(outf, " -V, --version\t\tdisplay package version number\n");
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ fprintf(outf, "SNMP Version 1 or 2c specific\n");
+ fprintf(outf, " -c COMMUNITY\t\tset the community string\n");
+#endif /* support for community based SNMP */
+ fprintf(outf, "SNMP Version 3 specific\n");
+ fprintf(outf,
+ " -a PROTOCOL\t\tset authentication protocol (MD5|SHA)\n");
+ fprintf(outf,
+ " -A PASSPHRASE\t\tset authentication protocol pass phrase\n");
+ fprintf(outf,
+ " -e ENGINE-ID\t\tset security engine ID (e.g. 800000020109840301)\n");
+ fprintf(outf,
+ " -E ENGINE-ID\t\tset context engine ID (e.g. 800000020109840301)\n");
+ fprintf(outf,
+ " -l LEVEL\t\tset security level (noAuthNoPriv|authNoPriv|authPriv)\n");
+ fprintf(outf, " -n CONTEXT\t\tset context name (e.g. bridge1)\n");
+ fprintf(outf, " -u USER-NAME\t\tset security name (e.g. bert)\n");
+#ifdef HAVE_AES
+ fprintf(outf, " -x PROTOCOL\t\tset privacy protocol (DES|AES)\n");
+#else
+ fprintf(outf, " -x PROTOCOL\t\tset privacy protocol (DES)\n");
+#endif
+ fprintf(outf, " -X PASSPHRASE\t\tset privacy protocol pass phrase\n");
+ fprintf(outf,
+ " -Z BOOTS,TIME\t\tset destination engine boots/time\n");
+ fprintf(outf, "General communication options\n");
+ fprintf(outf, " -r RETRIES\t\tset the number of retries\n");
+ fprintf(outf,
+ " -t TIMEOUT\t\tset the request timeout (in seconds)\n");
+ fprintf(outf, "Debugging\n");
+ fprintf(outf, " -d\t\t\tdump input/output packets in hexadecimal\n");
+ fprintf(outf,
+ " -D[TOKEN[,...]]\tturn on debugging output for the specified TOKENs\n\t\t\t (ALL gives extremely verbose debugging output)\n");
+ fprintf(outf, "General options\n");
+ fprintf(outf,
+ " -m MIB[:...]\t\tload given list of MIBs (ALL loads everything)\n");
+ fprintf(outf,
+ " -M DIR[:...]\t\tlook in given list of directories for MIBs\n");
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ fprintf(outf,
+ " (default: %s)\n", netsnmp_get_mib_directory());
+ fprintf(outf,
+ " -P MIBOPTS\t\tToggle various defaults controlling MIB parsing:\n");
+ snmp_mib_toggle_options_usage("\t\t\t ", outf);
+#endif
+ fprintf(outf,
+ " -O OUTOPTS\t\tToggle various defaults controlling output display:\n");
+ snmp_out_toggle_options_usage("\t\t\t ", outf);
+ fprintf(outf,
+ " -I INOPTS\t\tToggle various defaults controlling input parsing:\n");
+ snmp_in_toggle_options_usage("\t\t\t ", outf);
+ fprintf(outf,
+ " -L LOGOPTS\t\tToggle various defaults controlling logging:\n");
+ snmp_log_options_usage("\t\t\t ", outf);
+ fflush(outf);
+}
+
+#define BUF_SIZE 512
+
+void
+handle_long_opt(const char *myoptarg)
+{
+ char *cp, *cp2;
+ /*
+ * else it's a long option, so process it like name=value
+ */
+ cp = (char *)malloc(strlen(myoptarg) + 3);
+ if (!cp)
+ return;
+ strcpy(cp, myoptarg);
+ cp2 = strchr(cp, '=');
+ if (!cp2 && !strchr(cp, ' ')) {
+ /*
+ * well, they didn't specify an argument as far as we
+ * can tell. Give them a '1' as the argument (which
+ * works for boolean tokens and a few others) and let
+ * them suffer from there if it's not what they
+ * wanted
+ */
+ strcat(cp, " 1");
+ } else {
+ /*
+ * replace the '=' with a ' '
+ */
+ if (cp2)
+ *cp2 = ' ';
+ }
+ netsnmp_config(cp);
+ free(cp);
+}
+
+extern int snmpv3_options(char *optarg, netsnmp_session * session,
+ char **Apsz, char **Xpsz, int argc,
+ char *const *argv);
+
+int
+netsnmp_parse_args(int argc,
+ char **argv,
+ netsnmp_session * session, const char *localOpts,
+ void (*proc) (int, char *const *, int),
+ int flags)
+{
+ static char *sensitive[4] = { NULL, NULL, NULL, NULL };
+ int arg, sp = 0, testcase = 0;
+ char *cp;
+ char *Apsz = NULL;
+ char *Xpsz = NULL;
+ char *Cpsz = NULL;
+ char Opts[BUF_SIZE];
+ int zero_sensitive = !( flags & NETSNMP_PARSE_ARGS_NOZERO );
+
+ /*
+ * initialize session to default values
+ */
+ snmp_sess_init(session);
+ strcpy(Opts, "Y:VhHm:M:O:I:P:D:dv:r:t:c:Z:e:E:n:u:l:x:X:a:A:p:T:-:3:s:S:L:");
+ if (localOpts) {
+ if (strlen(localOpts) + strlen(Opts) >= sizeof(Opts)) {
+ snmp_log(LOG_ERR, "Too many localOpts in snmp_parse_args()\n");
+ return -1;
+ }
+ strcat(Opts, localOpts);
+ }
+
+ /*
+ * get the options
+ */
+ DEBUGMSGTL(("snmp_parse_args", "starting: %d/%d\n", optind, argc));
+ for (arg = 0; arg < argc; arg++) {
+ DEBUGMSGTL(("snmp_parse_args", " arg %d = %s\n", arg, argv[arg]));
+ }
+
+ optind = 1;
+ while ((arg = getopt(argc, argv, Opts)) != EOF) {
+ DEBUGMSGTL(("snmp_parse_args", "handling (#%d): %c\n", optind, arg));
+ switch (arg) {
+ case '-':
+ if (strcasecmp(optarg, "help") == 0) {
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ if (strcasecmp(optarg, "version") == 0) {
+ fprintf(stderr,"NET-SNMP version: %s\n",netsnmp_get_version());
+ return (NETSNMP_PARSE_ARGS_SUCCESS_EXIT);
+ }
+
+ handle_long_opt(optarg);
+ break;
+
+ case 'V':
+ fprintf(stderr, "NET-SNMP version: %s\n", netsnmp_get_version());
+ return (NETSNMP_PARSE_ARGS_SUCCESS_EXIT);
+
+ case 'h':
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ break;
+
+ case 'H':
+ init_snmp("snmpapp");
+ fprintf(stderr, "Configuration directives understood:\n");
+ read_config_print_usage(" ");
+ return (NETSNMP_PARSE_ARGS_SUCCESS_EXIT);
+
+ case 'Y':
+ netsnmp_config_remember(optarg);
+ break;
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ case 'm':
+ setenv("MIBS", optarg, 1);
+ break;
+
+ case 'M':
+ netsnmp_get_mib_directory(); /* prepare the default directories */
+ netsnmp_set_mib_directory(optarg);
+ break;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+ case 'O':
+ cp = snmp_out_toggle_options(optarg);
+ if (cp != NULL) {
+ fprintf(stderr, "Unknown output option passed to -O: %c.\n",
+ *cp);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+ case 'I':
+ cp = snmp_in_options(optarg, argc, argv);
+ if (cp != NULL) {
+ fprintf(stderr, "Unknown input option passed to -I: %c.\n",
+ *cp);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ case 'P':
+ cp = snmp_mib_toggle_options(optarg);
+ if (cp != NULL) {
+ fprintf(stderr,
+ "Unknown parsing option passed to -P: %c.\n", *cp);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+ case 'D':
+ debug_register_tokens(optarg);
+ snmp_set_do_debugging(1);
+ break;
+
+ case 'd':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET, 1);
+ break;
+
+ case 'v':
+ session->version = -1;
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (!strcmp(optarg, "1")) {
+ session->version = SNMP_VERSION_1;
+ }
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ if (!strcasecmp(optarg, "2c")) {
+ session->version = SNMP_VERSION_2c;
+ }
+#endif
+ if (!strcasecmp(optarg, "3")) {
+ session->version = SNMP_VERSION_3;
+ }
+ if (session->version == -1) {
+ fprintf(stderr,
+ "Invalid version specified after -v flag: %s\n",
+ optarg);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+ case 'p':
+ fprintf(stderr, "Warning: -p option is no longer used - ");
+ fprintf(stderr, "specify the remote host as HOST:PORT\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ break;
+
+ case 'T':
+ {
+ char leftside[SNMP_MAXBUF_MEDIUM], rightside[SNMP_MAXBUF_MEDIUM];
+ char *tmpcp, *tmpopt;
+
+ /* ensure we have a proper argument */
+ tmpopt = strdup(optarg);
+ tmpcp = strchr(tmpopt, '=');
+ if (!tmpcp) {
+ fprintf(stderr, "-T expects a NAME=VALUE pair.\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ *tmpcp++ = '\0';
+
+ /* create the transport config container if this is the first */
+ if (!session->transport_configuration) {
+ netsnmp_container_init_list();
+ session->transport_configuration =
+ netsnmp_container_find("transport_configuration:fifo");
+ if (!session->transport_configuration) {
+ fprintf(stderr, "failed to initialize the transport configuration container\n");
+ free(tmpopt);
+ return (NETSNMP_PARSE_ARGS_ERROR);
+ }
+
+ session->transport_configuration->compare =
+ (netsnmp_container_compare*)
+ netsnmp_transport_config_compare;
+ }
+
+ /* set the config */
+ strlcpy(leftside, tmpopt, sizeof(leftside));
+ strlcpy(rightside, tmpcp, sizeof(rightside));
+
+ CONTAINER_INSERT(session->transport_configuration,
+ netsnmp_transport_create_config(leftside,
+ rightside));
+ free(tmpopt);
+ }
+ break;
+
+ case 't':
+ session->timeout = (long)(atof(optarg) * 1000000L);
+ if (session->timeout <= 0) {
+ fprintf(stderr, "Invalid timeout in seconds after -t flag.\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+ case 'r':
+ session->retries = atoi(optarg);
+ if (session->retries < 0 || !isdigit((unsigned char)(optarg[0]))) {
+ fprintf(stderr, "Invalid number of retries after -r flag.\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+ case 'c':
+ if (zero_sensitive) {
+ if ((sensitive[sp] = strdup(optarg)) != NULL) {
+ Cpsz = sensitive[sp];
+ memset(optarg, '\0', strlen(optarg));
+ sp++;
+ } else {
+ fprintf(stderr, "malloc failure processing -c flag.\n");
+ return NETSNMP_PARSE_ARGS_ERROR;
+ }
+ } else {
+ Cpsz = optarg;
+ }
+ break;
+
+ case '3':
+ /* TODO: This needs to zero things too. */
+ if (snmpv3_options(optarg, session, &Apsz, &Xpsz, argc, argv) < 0){
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+ case 'L':
+ if (snmp_log_options(optarg, argc, argv) < 0) {
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+#define SNMPV3_CMD_OPTIONS
+#ifdef SNMPV3_CMD_OPTIONS
+ case 'Z':
+ errno = 0;
+ session->engineBoots = strtoul(optarg, &cp, 10);
+ if (errno || cp == optarg) {
+ fprintf(stderr, "Need engine boots value after -Z flag.\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ if (*cp == ',') {
+ char *endptr;
+ cp++;
+ session->engineTime = strtoul(cp, &endptr, 10);
+ if (errno || cp == endptr) {
+ fprintf(stderr, "Need engine time after \"-Z engineBoot,\".\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ }
+ /*
+ * Handle previous '-Z boot time' syntax
+ */
+ else if (optind < argc) {
+ session->engineTime = strtoul(argv[optind], &cp, 10);
+ if (errno || cp == argv[optind]) {
+ fprintf(stderr, "Need engine time after \"-Z engineBoot\".\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ } else {
+ fprintf(stderr, "Need engine time after \"-Z engineBoot\".\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+ case 'e':{
+ size_t ebuf_len = 32, eout_len = 0;
+ u_char *ebuf = (u_char *)malloc(ebuf_len);
+
+ if (ebuf == NULL) {
+ fprintf(stderr, "malloc failure processing -e flag.\n");
+ return (NETSNMP_PARSE_ARGS_ERROR);
+ }
+ if (!snmp_hex_to_binary
+ (&ebuf, &ebuf_len, &eout_len, 1, optarg)) {
+ fprintf(stderr, "Bad engine ID value after -e flag.\n");
+ free(ebuf);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ if ((eout_len < 5) || (eout_len > 32)) {
+ fprintf(stderr, "Invalid engine ID value after -e flag.\n");
+ free(ebuf);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ session->securityEngineID = ebuf;
+ session->securityEngineIDLen = eout_len;
+ break;
+ }
+
+ case 'E':{
+ size_t ebuf_len = 32, eout_len = 0;
+ u_char *ebuf = (u_char *)malloc(ebuf_len);
+
+ if (ebuf == NULL) {
+ fprintf(stderr, "malloc failure processing -E flag.\n");
+ return (NETSNMP_PARSE_ARGS_ERROR);
+ }
+ if (!snmp_hex_to_binary(&ebuf, &ebuf_len,
+ &eout_len, 1, optarg)) {
+ fprintf(stderr, "Bad engine ID value after -E flag.\n");
+ free(ebuf);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ if ((eout_len < 5) || (eout_len > 32)) {
+ fprintf(stderr, "Invalid engine ID value after -E flag.\n");
+ free(ebuf);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ session->contextEngineID = ebuf;
+ session->contextEngineIDLen = eout_len;
+ break;
+ }
+
+ case 'n':
+ session->contextName = optarg;
+ session->contextNameLen = strlen(optarg);
+ break;
+
+ case 'u':
+ if (zero_sensitive) {
+ if ((sensitive[sp] = strdup(optarg)) != NULL) {
+ session->securityName = sensitive[sp];
+ session->securityNameLen = strlen(sensitive[sp]);
+ memset(optarg, '\0', strlen(optarg));
+ sp++;
+ } else {
+ fprintf(stderr, "malloc failure processing -u flag.\n");
+ return NETSNMP_PARSE_ARGS_ERROR;
+ }
+ } else {
+ session->securityName = optarg;
+ session->securityNameLen = strlen(optarg);
+ }
+ break;
+
+ case 'l':
+ if (!strcasecmp(optarg, "noAuthNoPriv") || !strcmp(optarg, "1")
+ || !strcasecmp(optarg, "noauth")
+ || !strcasecmp(optarg, "nanp")) {
+ session->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
+ } else if (!strcasecmp(optarg, "authNoPriv")
+ || !strcmp(optarg, "2")
+ || !strcasecmp(optarg, "auth")
+ || !strcasecmp(optarg, "anp")) {
+ session->securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
+ } else if (!strcasecmp(optarg, "authPriv")
+ || !strcmp(optarg, "3")
+ || !strcasecmp(optarg, "priv")
+ || !strcasecmp(optarg, "ap")) {
+ session->securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
+ } else {
+ fprintf(stderr,
+ "Invalid security level specified after -l flag: %s\n",
+ optarg);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+
+ break;
+
+#ifdef NETSNMP_SECMOD_USM
+ case 'a':
+#ifndef NETSNMP_DISABLE_MD5
+ if (!strcasecmp(optarg, "MD5")) {
+ session->securityAuthProto = usmHMACMD5AuthProtocol;
+ session->securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
+ } else
+#endif
+ if (!strcasecmp(optarg, "SHA")) {
+ session->securityAuthProto = usmHMACSHA1AuthProtocol;
+ session->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
+ } else {
+ fprintf(stderr,
+ "Invalid authentication protocol specified after -a flag: %s\n",
+ optarg);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+ case 'x':
+ testcase = 0;
+#ifndef NETSNMP_DISABLE_DES
+ if (!strcasecmp(optarg, "DES")) {
+ testcase = 1;
+ session->securityPrivProto = usmDESPrivProtocol;
+ session->securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN;
+ }
+#endif
+#ifdef HAVE_AES
+ if (!strcasecmp(optarg, "AES128") ||
+ !strcasecmp(optarg, "AES")) {
+ testcase = 1;
+ session->securityPrivProto = usmAESPrivProtocol;
+ session->securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
+ }
+#endif
+ if (testcase == 0) {
+ fprintf(stderr,
+ "Invalid privacy protocol specified after -x flag: %s\n",
+ optarg);
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ break;
+
+ case 'A':
+ if (zero_sensitive) {
+ if ((sensitive[sp] = strdup(optarg)) != NULL) {
+ Apsz = sensitive[sp];
+ memset(optarg, '\0', strlen(optarg));
+ sp++;
+ } else {
+ fprintf(stderr, "malloc failure processing -A flag.\n");
+ return NETSNMP_PARSE_ARGS_ERROR;
+ }
+ } else {
+ Apsz = optarg;
+ }
+ break;
+
+ case 'X':
+ if (zero_sensitive) {
+ if ((sensitive[sp] = strdup(optarg)) != NULL) {
+ Xpsz = sensitive[sp];
+ memset(optarg, '\0', strlen(optarg));
+ sp++;
+ } else {
+ fprintf(stderr, "malloc failure processing -X flag.\n");
+ return NETSNMP_PARSE_ARGS_ERROR;
+ }
+ } else {
+ Xpsz = optarg;
+ }
+ break;
+#endif /* SNMPV3_CMD_OPTIONS */
+#endif /* NETSNMP_SECMOD_USM */
+
+ case '?':
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ break;
+
+ default:
+ proc(argc, argv, arg);
+ break;
+ }
+ }
+ DEBUGMSGTL(("snmp_parse_args", "finished: %d/%d\n", optind, argc));
+
+ /*
+ * read in MIB database and initialize the snmp library
+ */
+ init_snmp("snmpapp");
+
+ /*
+ * session default version
+ */
+ if (session->version == SNMP_DEFAULT_VERSION) {
+ /*
+ * run time default version
+ */
+ session->version = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SNMPVERSION);
+
+ /*
+ * compile time default version
+ */
+ if (!session->version) {
+ switch (NETSNMP_DEFAULT_SNMP_VERSION) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case 1:
+ session->version = SNMP_VERSION_1;
+ break;
+#endif
+
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case 2:
+ session->version = SNMP_VERSION_2c;
+ break;
+#endif
+
+ case 3:
+ session->version = SNMP_VERSION_3;
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "Can't determine a valid SNMP version for the session\n");
+ return(NETSNMP_PARSE_ARGS_ERROR);
+ }
+ } else {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (session->version == NETSNMP_DS_SNMP_VERSION_1) /* bogus value. version 1 actually = 0 */
+ session->version = SNMP_VERSION_1;
+#endif
+ }
+ }
+
+#ifdef NETSNMP_SECMOD_USM
+ /* XXX: this should ideally be moved to snmpusm.c somehow */
+
+ /*
+ * make master key from pass phrases
+ */
+ if (Apsz) {
+ session->securityAuthKeyLen = USM_AUTH_KU_LEN;
+ if (session->securityAuthProto == NULL) {
+ /*
+ * get .conf set default
+ */
+ const oid *def =
+ get_default_authtype(&session->securityAuthProtoLen);
+ session->securityAuthProto =
+ snmp_duplicate_objid(def, session->securityAuthProtoLen);
+ }
+ if (session->securityAuthProto == NULL) {
+#ifndef NETSNMP_DISABLE_MD5
+ /*
+ * assume MD5
+ */
+ session->securityAuthProto =
+ snmp_duplicate_objid(usmHMACMD5AuthProtocol,
+ USM_AUTH_PROTO_MD5_LEN);
+ session->securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
+#else
+ session->securityAuthProto =
+ snmp_duplicate_objid(usmHMACSHA1AuthProtocol,
+ USM_AUTH_PROTO_SHA_LEN);
+ session->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
+#endif
+ }
+ if (generate_Ku(session->securityAuthProto,
+ session->securityAuthProtoLen,
+ (u_char *) Apsz, strlen(Apsz),
+ session->securityAuthKey,
+ &session->securityAuthKeyLen) != SNMPERR_SUCCESS) {
+ snmp_perror(argv[0]);
+ fprintf(stderr,
+ "Error generating a key (Ku) from the supplied authentication pass phrase. \n");
+ return (NETSNMP_PARSE_ARGS_ERROR);
+ }
+ }
+ if (Xpsz) {
+ session->securityPrivKeyLen = USM_PRIV_KU_LEN;
+ if (session->securityPrivProto == NULL) {
+ /*
+ * get .conf set default
+ */
+ const oid *def =
+ get_default_privtype(&session->securityPrivProtoLen);
+ session->securityPrivProto =
+ snmp_duplicate_objid(def, session->securityPrivProtoLen);
+ }
+ if (session->securityPrivProto == NULL) {
+ /*
+ * assume DES
+ */
+#ifndef NETSNMP_DISABLE_DES
+ session->securityPrivProto =
+ snmp_duplicate_objid(usmDESPrivProtocol,
+ USM_PRIV_PROTO_DES_LEN);
+ session->securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN;
+#else
+ session->securityPrivProto =
+ snmp_duplicate_objid(usmAESPrivProtocol,
+ USM_PRIV_PROTO_AES_LEN);
+ session->securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
+#endif
+
+ }
+ if (generate_Ku(session->securityAuthProto,
+ session->securityAuthProtoLen,
+ (u_char *) Xpsz, strlen(Xpsz),
+ session->securityPrivKey,
+ &session->securityPrivKeyLen) != SNMPERR_SUCCESS) {
+ snmp_perror(argv[0]);
+ fprintf(stderr,
+ "Error generating a key (Ku) from the supplied privacy pass phrase. \n");
+ return (NETSNMP_PARSE_ARGS_ERROR);
+ }
+ }
+#endif /* NETSNMP_SECMOD_USM */
+
+ /*
+ * get the hostname
+ */
+ if (optind == argc) {
+ fprintf(stderr, "No hostname specified.\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ session->peername = argv[optind++]; /* hostname */
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ /*
+ * If v1 or v2c, check community has been set, either by a -c option above,
+ * or via a default token somewhere.
+ * If neither, it will be taken from the incoming request PDU.
+ */
+
+#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
+ {
+ if (Cpsz == NULL) {
+ Cpsz = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_COMMUNITY);
+ if (Cpsz == NULL) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY)){
+ DEBUGMSGTL(("snmp_parse_args",
+ "ignoring that the community string is not present\n"));
+ session->community = NULL;
+ session->community_len = 0;
+ } else {
+ fprintf(stderr, "No community name specified.\n");
+ return (NETSNMP_PARSE_ARGS_ERROR_USAGE);
+ }
+ }
+ } else {
+ session->community = (unsigned char *)Cpsz;
+ session->community_len = strlen(Cpsz);
+ }
+ }
+#endif /* support for community based SNMP */
+
+ return optind;
+}
+
+int
+snmp_parse_args(int argc,
+ char **argv,
+ netsnmp_session * session, const char *localOpts,
+ void (*proc) (int, char *const *, int))
+{
+ return netsnmp_parse_args(argc, argv, session, localOpts, proc, 0);
+}
diff --git a/snmplib/snmp_secmod.c b/snmplib/snmp_secmod.c
new file mode 100644
index 0000000..9e60a42
--- /dev/null
+++ b/snmplib/snmp_secmod.c
@@ -0,0 +1,206 @@
+/*
+ * security service wrapper to support pluggable security models
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <stdio.h>
+#include <ctype.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_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_enum.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/snmpv3-security-includes.h>
+
+#include <net-snmp/net-snmp-features.h>
+
+static struct snmp_secmod_list *registered_services = NULL;
+
+static SNMPCallback set_default_secmod;
+
+void
+init_secmod(void)
+{
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_SESSION_INIT, set_default_secmod,
+ NULL);
+
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defSecurityModel",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SECMODEL);
+ /*
+ * this file is generated by configure for all the stuff we're using
+ */
+#include "snmpsm_init.h"
+}
+
+void
+shutdown_secmod(void)
+{
+ #include "snmpsm_shutdown.h"
+}
+
+int
+register_sec_mod(int secmod, const char *modname,
+ struct snmp_secmod_def *newdef)
+{
+ int result;
+ struct snmp_secmod_list *sptr;
+ char *othername;
+
+ for (sptr = registered_services; sptr; sptr = sptr->next) {
+ if (sptr->securityModel == secmod) {
+ return SNMPERR_GENERR;
+ }
+ }
+ sptr = SNMP_MALLOC_STRUCT(snmp_secmod_list);
+ if (sptr == NULL)
+ return SNMPERR_MALLOC;
+ sptr->secDef = newdef;
+ sptr->securityModel = secmod;
+ sptr->next = registered_services;
+ registered_services = sptr;
+ if ((result =
+ se_add_pair_to_slist("snmp_secmods", strdup(modname), secmod))
+ != SE_OK) {
+ switch (result) {
+ case SE_NOMEM:
+ snmp_log(LOG_CRIT, "snmp_secmod: no memory\n");
+ break;
+
+ case SE_ALREADY_THERE:
+ othername = se_find_label_in_slist("snmp_secmods", secmod);
+ if (strcmp(othername, modname) != 0) {
+ snmp_log(LOG_ERR,
+ "snmp_secmod: two security modules %s and %s registered with the same security number\n",
+ modname, othername);
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "snmp_secmod: unknown error trying to register a new security module\n");
+ break;
+ }
+ return SNMPERR_GENERR;
+ }
+ return SNMPERR_SUCCESS;
+}
+
+netsnmp_feature_child_of(unregister_sec_mod, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_UNREGISTER_SEC_MOD
+int
+unregister_sec_mod(int secmod)
+{
+ struct snmp_secmod_list *sptr, *lptr;
+
+ for (sptr = registered_services, lptr = NULL; sptr;
+ lptr = sptr, sptr = sptr->next) {
+ if (sptr->securityModel == secmod) {
+ if ( lptr )
+ lptr->next = sptr->next;
+ else
+ registered_services = sptr->next;
+ SNMP_FREE(sptr->secDef);
+ SNMP_FREE(sptr);
+ return SNMPERR_SUCCESS;
+ }
+ }
+ /*
+ * not registered
+ */
+ return SNMPERR_GENERR;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UNREGISTER_SEC_MOD */
+
+void
+clear_sec_mod(void)
+{
+ struct snmp_secmod_list *tmp = registered_services, *next = NULL;
+
+ while (tmp != NULL) {
+ next = tmp->next;
+ SNMP_FREE(tmp->secDef);
+ SNMP_FREE(tmp);
+ tmp = next;
+ }
+ registered_services = NULL;
+}
+
+
+struct snmp_secmod_def *
+find_sec_mod(int secmod)
+{
+ struct snmp_secmod_list *sptr;
+
+ for (sptr = registered_services; sptr; sptr = sptr->next) {
+ if (sptr->securityModel == secmod) {
+ return sptr->secDef;
+ }
+ }
+ /*
+ * not registered
+ */
+ return NULL;
+}
+
+/* try to pick a reasonable security module default based on what was
+ compiled into the net-snmp package */
+#ifdef USM_SEC_MODEL_NUMBER
+#define NETSNMP_SECMOD_DEFAULT_MODEL USM_SEC_MODEL_NUMBER
+#elif defined(TSM_SEC_MODEL_NUMBER)
+#define NETSNMP_SECMOD_DEFAULT_MODEL TSM_SEC_MODEL_NUMBER
+#elif defined(KSM_SEC_MODEL_NUMBER)
+#define NETSNMP_SECMOD_DEFAULT_MODEL KSM_SEC_MODEL_NUMBER
+#else
+/* else we give up and leave it blank */
+#define NETSNMP_SECMOD_DEFAULT_MODEL -1
+#endif
+
+static int
+set_default_secmod(int major, int minor, void *serverarg, void *clientarg)
+{
+ netsnmp_session *sess = (netsnmp_session *) serverarg;
+ char *cptr;
+ int model;
+
+ if (!sess)
+ return SNMPERR_GENERR;
+ if (sess->securityModel == SNMP_DEFAULT_SECMODEL) {
+ if ((cptr = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SECMODEL)) != NULL) {
+ if ((model = se_find_value_in_slist("snmp_secmods", cptr))
+ != SE_DNE) {
+ sess->securityModel = model;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown security model name: %s. Forcing USM instead.\n",
+ cptr);
+ sess->securityModel = NETSNMP_SECMOD_DEFAULT_MODEL;
+ return SNMPERR_GENERR;
+ }
+ } else {
+ sess->securityModel = NETSNMP_SECMOD_DEFAULT_MODEL;
+ }
+ }
+ return SNMPERR_SUCCESS;
+}
diff --git a/snmplib/snmp_service.c b/snmplib/snmp_service.c
new file mode 100644
index 0000000..54cb4ac
--- /dev/null
+++ b/snmplib/snmp_service.c
@@ -0,0 +1,432 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/library/snmp_transport.h>
+
+static char**
+create_word_array_helper(const char* cptr, size_t idx, char* tmp, size_t tmplen)
+{
+ char* item;
+ char** res;
+ cptr = copy_nword_const(cptr, tmp, tmplen);
+ item = strdup(tmp);
+ if (cptr)
+ res = create_word_array_helper(cptr, idx + 1, tmp, tmplen);
+ else {
+ res = (char**)malloc(sizeof(char*) * (idx + 2));
+ res[idx + 1] = NULL;
+ }
+ res[idx] = item;
+ return res;
+}
+
+static char**
+create_word_array(const char* cptr)
+{
+ size_t tmplen = strlen(cptr);
+ char* tmp = (char*)malloc(tmplen + 1);
+ char** res = create_word_array_helper(cptr, 0, tmp, tmplen + 1);
+ free(tmp);
+ return res;
+}
+
+static void
+destroy_word_array(char** arr)
+{
+ if (arr) {
+ char** run = arr;
+ while(*run) {
+ free(*run);
+ ++run;
+ }
+ free(arr);
+ }
+}
+
+struct netsnmp_lookup_domain {
+ char* application;
+ char** userDomain;
+ char** domain;
+ struct netsnmp_lookup_domain* next;
+};
+
+static struct netsnmp_lookup_domain* domains = NULL;
+
+int
+netsnmp_register_default_domain(const char* application, const char* domain)
+{
+ struct netsnmp_lookup_domain *run = domains, *prev = NULL;
+ int res = 0;
+
+ while (run != NULL && strcmp(run->application, application) < 0) {
+ prev = run;
+ run = run->next;
+ }
+ if (run && strcmp(run->application, application) == 0) {
+ if (run->domain != NULL) {
+ destroy_word_array(run->domain);
+ run->domain = NULL;
+ res = 1;
+ }
+ } else {
+ run = SNMP_MALLOC_STRUCT(netsnmp_lookup_domain);
+ run->application = strdup(application);
+ run->userDomain = NULL;
+ if (prev) {
+ run->next = prev->next;
+ prev->next = run;
+ } else {
+ run->next = domains;
+ domains = run;
+ }
+ }
+ if (domain) {
+ run->domain = create_word_array(domain);
+ } else if (run->userDomain == NULL) {
+ if (prev)
+ prev->next = run->next;
+ else
+ domains = run->next;
+ free(run->application);
+ free(run);
+ }
+ return res;
+}
+
+void
+netsnmp_clear_default_domain(void)
+{
+ while (domains) {
+ struct netsnmp_lookup_domain *tmp = domains;
+ domains = domains->next;
+ free(tmp->application);
+ destroy_word_array(tmp->userDomain);
+ destroy_word_array(tmp->domain);
+ free(tmp);
+ }
+}
+
+static void
+netsnmp_register_user_domain(const char* token, char* cptr)
+{
+ struct netsnmp_lookup_domain *run = domains, *prev = NULL;
+ size_t len = strlen(cptr) + 1;
+ char* application = (char*)malloc(len);
+ char** domain;
+
+ {
+ char* cp = copy_nword(cptr, application, len);
+ if (cp == NULL) {
+ netsnmp_config_error("No domain(s) in registration of "
+ "defDomain \"%s\"", application);
+ free(application);
+ return;
+ }
+ domain = create_word_array(cp);
+ }
+
+ while (run != NULL && strcmp(run->application, application) < 0) {
+ prev = run;
+ run = run->next;
+ }
+ if (run && strcmp(run->application, application) == 0) {
+ if (run->userDomain != NULL) {
+ config_perror("Default transport already registered for this "
+ "application");
+ destroy_word_array(domain);
+ free(application);
+ return;
+ }
+ } else {
+ run = SNMP_MALLOC_STRUCT(netsnmp_lookup_domain);
+ run->application = strdup(application);
+ run->domain = NULL;
+ if (prev) {
+ run->next = prev->next;
+ prev->next = run;
+ } else {
+ run->next = domains;
+ domains = run;
+ }
+ }
+ run->userDomain = domain;
+ free(application);
+}
+
+static void
+netsnmp_clear_user_domain(void)
+{
+ struct netsnmp_lookup_domain *run = domains, *prev = NULL;
+
+ while (run) {
+ if (run->userDomain != NULL) {
+ destroy_word_array(run->userDomain);
+ run->userDomain = NULL;
+ }
+ if (run->domain == NULL) {
+ struct netsnmp_lookup_domain *tmp = run;
+ if (prev)
+ run = prev->next = run->next;
+ else
+ run = domains = run->next;
+ free(tmp->application);
+ free(tmp);
+ } else {
+ prev = run;
+ run = run->next;
+ }
+ }
+}
+
+const char* const *
+netsnmp_lookup_default_domains(const char* application)
+{
+ const char * const * res;
+
+ if (application == NULL)
+ res = NULL;
+ else {
+ struct netsnmp_lookup_domain *run = domains;
+
+ while (run && strcmp(run->application, application) < 0)
+ run = run->next;
+ if (run && strcmp(run->application, application) == 0)
+ if (run->userDomain)
+ res = (const char * const *)run->userDomain;
+ else
+ res = (const char * const *)run->domain;
+ else
+ res = NULL;
+ }
+ DEBUGMSGTL(("defaults",
+ "netsnmp_lookup_default_domain(\"%s\") ->",
+ application ? application : "[NIL]"));
+ if (res) {
+ const char * const * r = res;
+ while(*r) {
+ DEBUGMSG(("defaults", " \"%s\"", *r));
+ ++r;
+ }
+ DEBUGMSG(("defaults", "\n"));
+ } else
+ DEBUGMSG(("defaults", " \"[NIL]\"\n"));
+ return res;
+}
+
+const char*
+netsnmp_lookup_default_domain(const char* application)
+{
+ const char * const * res = netsnmp_lookup_default_domains(application);
+ return (res ? *res : NULL);
+}
+
+struct netsnmp_lookup_target {
+ char* application;
+ char* domain;
+ char* userTarget;
+ char* target;
+ struct netsnmp_lookup_target* next;
+};
+
+static struct netsnmp_lookup_target* targets = NULL;
+
+/**
+ * Add an (application, domain, target) triplet to the targets list if target
+ * != NULL. Remove an entry if target == NULL and the userTarget pointer for
+ * the entry found is also NULL. Keep at most one target per (application,
+ * domain) pair.
+ *
+ * @return 1 if an entry for (application, domain) was already present in the
+ * targets list or 0 if such an entry was not yet present in the targets list.
+ */
+int
+netsnmp_register_default_target(const char* application, const char* domain,
+ const char* target)
+{
+ struct netsnmp_lookup_target *run = targets, *prev = NULL;
+ int i = 0, res = 0;
+ while (run && ((i = strcmp(run->application, application)) < 0 ||
+ (i == 0 && strcmp(run->domain, domain) < 0))) {
+ prev = run;
+ run = run->next;
+ }
+ if (run && i == 0 && strcmp(run->domain, domain) == 0) {
+ if (run->target != NULL) {
+ free(run->target);
+ run->target = NULL;
+ res = 1;
+ }
+ } else {
+ run = SNMP_MALLOC_STRUCT(netsnmp_lookup_target);
+ run->application = strdup(application);
+ run->domain = strdup(domain);
+ run->userTarget = NULL;
+ if (prev) {
+ run->next = prev->next;
+ prev->next = run;
+ } else {
+ run->next = targets;
+ targets = run;
+ }
+ }
+ if (target) {
+ run->target = strdup(target);
+ } else if (run->userTarget == NULL) {
+ if (prev)
+ prev->next = run->next;
+ else
+ targets = run->next;
+ free(run->domain);
+ free(run->application);
+ free(run);
+ }
+ return res;
+}
+
+/**
+ * Clear the targets list.
+ */
+void
+netsnmp_clear_default_target(void)
+{
+ while (targets) {
+ struct netsnmp_lookup_target *tmp = targets;
+ targets = targets->next;
+ free(tmp->application);
+ free(tmp->domain);
+ free(tmp->userTarget);
+ free(tmp->target);
+ free(tmp);
+ }
+}
+
+static void
+netsnmp_register_user_target(const char* token, char* cptr)
+{
+ struct netsnmp_lookup_target *run = targets, *prev = NULL;
+ size_t len = strlen(cptr) + 1;
+ char* application = (char*)malloc(len);
+ char* domain = (char*)malloc(len);
+ char* target = (char*)malloc(len);
+ int i = 0;
+
+ {
+ char* cp = copy_nword(cptr, application, len);
+ if (cp == NULL) {
+ netsnmp_config_error("No domain and target in registration of "
+ "defTarget \"%s\"", application);
+ goto done;
+ }
+ cp = copy_nword(cp, domain, len);
+ if (cp == NULL) {
+ netsnmp_config_error("No target in registration of "
+ "defTarget \"%s\" \"%s\"",
+ application, domain);
+ goto done;
+ }
+ cp = copy_nword(cp, target, len);
+ if (cp)
+ config_pwarn("Trailing junk found");
+ }
+
+ while (run && ((i = strcmp(run->application, application)) < 0 ||
+ (i == 0 && strcmp(run->domain, domain) < 0))) {
+ prev = run;
+ run = run->next;
+ }
+ if (run && i == 0 && strcmp(run->domain, domain) == 0) {
+ if (run->userTarget != NULL) {
+ config_perror("Default target already registered for this "
+ "application-domain combination");
+ goto done;
+ }
+ } else {
+ run = SNMP_MALLOC_STRUCT(netsnmp_lookup_target);
+ run->application = strdup(application);
+ run->domain = strdup(domain);
+ run->target = NULL;
+ if (prev) {
+ run->next = prev->next;
+ prev->next = run;
+ } else {
+ run->next = targets;
+ targets = run;
+ }
+ }
+ run->userTarget = strdup(target);
+ done:
+ free(target);
+ free(domain);
+ free(application);
+}
+
+static void
+netsnmp_clear_user_target(void)
+{
+ struct netsnmp_lookup_target *run = targets, *prev = NULL;
+
+ while (run) {
+ if (run->userTarget != NULL) {
+ free(run->userTarget);
+ run->userTarget = NULL;
+ }
+ if (run->target == NULL) {
+ struct netsnmp_lookup_target *tmp = run;
+ if (prev)
+ run = prev->next = run->next;
+ else
+ run = targets = run->next;
+ free(tmp->application);
+ free(tmp->domain);
+ free(tmp);
+ } else {
+ prev = run;
+ run = run->next;
+ }
+ }
+}
+
+const char*
+netsnmp_lookup_default_target(const char* application, const char* domain)
+{
+ int i = 0;
+ struct netsnmp_lookup_target *run = targets;
+ const char *res;
+
+ if (application == NULL || domain == NULL)
+ res = NULL;
+ else {
+ while (run && ((i = strcmp(run->application, application)) < 0 ||
+ (i == 0 && strcmp(run->domain, domain) < 0)))
+ run = run->next;
+ if (run && i == 0 && strcmp(run->domain, domain) == 0)
+ if (run->userTarget != NULL)
+ res = run->userTarget;
+ else
+ res = run->target;
+ else
+ res = NULL;
+ }
+ DEBUGMSGTL(("defaults",
+ "netsnmp_lookup_default_target(\"%s\", \"%s\") -> \"%s\"\n",
+ application ? application : "[NIL]",
+ domain ? domain : "[NIL]",
+ res ? res : "[NIL]"));
+ return res;
+}
+
+void
+netsnmp_register_service_handlers(void)
+{
+ register_config_handler("snmp:", "defDomain",
+ netsnmp_register_user_domain,
+ netsnmp_clear_user_domain,
+ "application domain");
+ register_config_handler("snmp:", "defTarget",
+ netsnmp_register_user_target,
+ netsnmp_clear_user_target,
+ "application domain target");
+}
diff --git a/snmplib/snmp_transport.c b/snmplib/snmp_transport.c
new file mode 100644
index 0000000..9b16245
--- /dev/null
+++ b/snmplib/snmp_transport.c
@@ -0,0 +1,768 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_transport.h>
+
+#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <sys/types.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <ctype.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/default_store.h>
+
+#include <net-snmp/library/snmpUDPDomain.h>
+#ifdef NETSNMP_TRANSPORT_TLSBASE_DOMAIN
+#include <net-snmp/library/snmpTLSBaseDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+#include <net-snmp/library/snmpTLSTCPDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_STD_DOMAIN
+#include <net-snmp/library/snmpSTDDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_TCP_DOMAIN
+#include <net-snmp/library/snmpTCPDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+#include <net-snmp/library/snmpDTLSUDPDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_SSH_DOMAIN
+#include <net-snmp/library/snmpSSHDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_ALIAS_DOMAIN
+#include <net-snmp/library/snmpAliasDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_IPX_DOMAIN
+#include <net-snmp/library/snmpIPXDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+#include <net-snmp/library/snmpUnixDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
+#include <net-snmp/library/snmpAAL5PVCDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+#include <net-snmp/library/snmpUDPIPv6Domain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+#include <net-snmp/library/snmpTCPIPv6Domain.h>
+#endif
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_service.h>
+#include <net-snmp/library/read_config.h>
+
+netsnmp_feature_child_of(transport_all, libnetsnmp)
+
+netsnmp_feature_child_of(tdomain_support, transport_all)
+netsnmp_feature_child_of(tdomain_transport_oid, transport_all)
+netsnmp_feature_child_of(sockaddr_size, transport_all)
+
+/*
+ * Our list of supported transport domains.
+ */
+
+static netsnmp_tdomain *domain_list = NULL;
+
+
+
+/*
+ * The standard SNMP domains.
+ */
+
+oid netsnmpUDPDomain[] = { 1, 3, 6, 1, 6, 1, 1 };
+size_t netsnmpUDPDomain_len = OID_LENGTH(netsnmpUDPDomain);
+oid netsnmpCLNSDomain[] = { 1, 3, 6, 1, 6, 1, 2 };
+size_t netsnmpCLNSDomain_len = OID_LENGTH(netsnmpCLNSDomain);
+oid netsnmpCONSDomain[] = { 1, 3, 6, 1, 6, 1, 3 };
+size_t netsnmpCONSDomain_len = OID_LENGTH(netsnmpCONSDomain);
+oid netsnmpDDPDomain[] = { 1, 3, 6, 1, 6, 1, 4 };
+size_t netsnmpDDPDomain_len = OID_LENGTH(netsnmpDDPDomain);
+oid netsnmpIPXDomain[] = { 1, 3, 6, 1, 6, 1, 5 };
+size_t netsnmpIPXDomain_len = OID_LENGTH(netsnmpIPXDomain);
+
+
+
+static void netsnmp_tdomain_dump(void);
+
+
+
+void
+init_snmp_transport(void)
+{
+ netsnmp_ds_register_config(ASN_BOOLEAN,
+ "snmp", "dontLoadHostConfig",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_LOAD_HOST_FILES);
+}
+
+/*
+ * Make a deep copy of an netsnmp_transport.
+ */
+netsnmp_transport *
+netsnmp_transport_copy(netsnmp_transport *t)
+{
+ netsnmp_transport *n = NULL;
+
+ if (t == NULL) {
+ return NULL;
+ }
+
+ n = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (n == NULL) {
+ return NULL;
+ }
+
+ if (t->domain != NULL) {
+ n->domain = t->domain;
+ n->domain_length = t->domain_length;
+ } else {
+ n->domain = NULL;
+ n->domain_length = 0;
+ }
+
+ if (t->local != NULL) {
+ n->local = (u_char *) malloc(t->local_length);
+ if (n->local == NULL) {
+ netsnmp_transport_free(n);
+ return NULL;
+ }
+ n->local_length = t->local_length;
+ memcpy(n->local, t->local, t->local_length);
+ } else {
+ n->local = NULL;
+ n->local_length = 0;
+ }
+
+ if (t->remote != NULL) {
+ n->remote = (u_char *) malloc(t->remote_length);
+ if (n->remote == NULL) {
+ netsnmp_transport_free(n);
+ return NULL;
+ }
+ n->remote_length = t->remote_length;
+ memcpy(n->remote, t->remote, t->remote_length);
+ } else {
+ n->remote = NULL;
+ n->remote_length = 0;
+ }
+
+ if (t->data != NULL && t->data_length > 0) {
+ n->data = malloc(t->data_length);
+ if (n->data == NULL) {
+ netsnmp_transport_free(n);
+ return NULL;
+ }
+ n->data_length = t->data_length;
+ memcpy(n->data, t->data, t->data_length);
+ } else {
+ n->data = NULL;
+ n->data_length = 0;
+ }
+
+ n->msgMaxSize = t->msgMaxSize;
+ n->f_accept = t->f_accept;
+ n->f_recv = t->f_recv;
+ n->f_send = t->f_send;
+ n->f_close = t->f_close;
+ n->f_copy = t->f_copy;
+ n->f_config = t->f_config;
+ n->f_fmtaddr = t->f_fmtaddr;
+ n->sock = t->sock;
+ n->flags = t->flags;
+ n->base_transport = netsnmp_transport_copy(t->base_transport);
+
+ /* give the transport a chance to do "special things" */
+ if (t->f_copy)
+ t->f_copy(t, n);
+
+ return n;
+}
+
+
+
+void
+netsnmp_transport_free(netsnmp_transport *t)
+{
+ if (NULL == t)
+ return;
+
+ SNMP_FREE(t->local);
+ SNMP_FREE(t->remote);
+ SNMP_FREE(t->data);
+ netsnmp_transport_free(t->base_transport);
+
+ SNMP_FREE(t);
+}
+
+/*
+ * netsnmp_transport_peer_string
+ *
+ * returns string representation of peer address.
+ *
+ * caller is responsible for freeing the allocated string.
+ */
+char *
+netsnmp_transport_peer_string(netsnmp_transport *t, void *data, int len)
+{
+ char *str;
+
+ if (NULL == t)
+ return NULL;
+
+ if (t->f_fmtaddr != NULL)
+ str = t->f_fmtaddr(t, data, len);
+ else
+ str = strdup("<UNKNOWN>");
+
+ return str;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_SOCKADDR_SIZE
+int
+netsnmp_sockaddr_size(struct sockaddr *sa)
+{
+ if (NULL == sa)
+ return 0;
+
+ switch (sa->sa_family) {
+ case AF_INET:
+ return sizeof(struct sockaddr_in);
+ break;
+#ifdef NETSNMP_ENABLE_IPV6
+ case AF_INET6:
+ return sizeof(struct sockaddr_in6);
+ break;
+#endif
+ }
+
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_SOCKADDR_SIZE */
+
+int
+netsnmp_transport_send(netsnmp_transport *t, void *packet, int length,
+ void **opaque, int *olength)
+{
+ int dumpPacket, debugLength;
+
+ if ((NULL == t) || (NULL == t->f_send)) {
+ DEBUGMSGTL(("transport:pkt:send", "NULL transport or send function\n"));
+ return SNMPERR_GENERR;
+ }
+
+ dumpPacket = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET);
+ debugLength = (SNMPERR_SUCCESS ==
+ debug_is_token_registered("transport:send"));
+
+ if (dumpPacket | debugLength) {
+ char *str = netsnmp_transport_peer_string(t,
+ opaque ? *opaque : NULL,
+ olength ? *olength : 0);
+ if (debugLength)
+ DEBUGMSGT_NC(("transport:send","%lu bytes to %s\n",
+ (unsigned long)length, str));
+ if (dumpPacket)
+ snmp_log(LOG_DEBUG, "\nSending %lu bytes to %s\n",
+ (unsigned long)length, str);
+ SNMP_FREE(str);
+ }
+ if (dumpPacket)
+ xdump(packet, length, "");
+
+ return t->f_send(t, packet, length, opaque, olength);
+}
+
+int
+netsnmp_transport_recv(netsnmp_transport *t, void *packet, int length,
+ void **opaque, int *olength)
+{
+ int debugLength;
+
+ if ((NULL == t) || (NULL == t->f_recv)) {
+ DEBUGMSGTL(("transport:recv", "NULL transport or recv function\n"));
+ return SNMPERR_GENERR;
+ }
+
+ length = t->f_recv(t, packet, length, opaque, olength);
+
+ if (length <=0)
+ return length; /* don't log timeouts/socket closed */
+
+ debugLength = (SNMPERR_SUCCESS ==
+ debug_is_token_registered("transport:recv"));
+
+ if (debugLength) {
+ char *str = netsnmp_transport_peer_string(t,
+ opaque ? *opaque : NULL,
+ olength ? *olength : 0);
+ if (debugLength)
+ DEBUGMSGT_NC(("transport:recv","%d bytes from %s\n",
+ length, str));
+ SNMP_FREE(str);
+ }
+
+ return length;
+}
+
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_TDOMAIN_SUPPORT
+int
+netsnmp_tdomain_support(const oid * in_oid,
+ size_t in_len,
+ const oid ** out_oid, size_t * out_len)
+{
+ netsnmp_tdomain *d = NULL;
+
+ for (d = domain_list; d != NULL; d = d->next) {
+ if (netsnmp_oid_equals(in_oid, in_len, d->name, d->name_length) == 0) {
+ if (out_oid != NULL && out_len != NULL) {
+ *out_oid = d->name;
+ *out_len = d->name_length;
+ }
+ return 1;
+ }
+ }
+ return 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDOMAIN_SUPPORT */
+
+
+void
+netsnmp_tdomain_init(void)
+{
+ DEBUGMSGTL(("tdomain", "netsnmp_tdomain_init() called\n"));
+
+/* include the configure generated list of constructor calls */
+#include "transports/snmp_transport_inits.h"
+
+ netsnmp_tdomain_dump();
+}
+
+void
+netsnmp_clear_tdomain_list(void)
+{
+ netsnmp_tdomain *list = domain_list, *next = NULL;
+ DEBUGMSGTL(("tdomain", "clear_tdomain_list() called\n"));
+
+ while (list != NULL) {
+ next = list->next;
+ SNMP_FREE(list->prefix);
+ /* attention!! list itself is not in the heap, so we must not free it! */
+ list = next;
+ }
+ domain_list = NULL;
+}
+
+
+static void
+netsnmp_tdomain_dump(void)
+{
+ netsnmp_tdomain *d;
+ int i = 0;
+
+ DEBUGMSGTL(("tdomain", "domain_list -> "));
+ for (d = domain_list; d != NULL; d = d->next) {
+ DEBUGMSG(("tdomain", "{ "));
+ DEBUGMSGOID(("tdomain", d->name, d->name_length));
+ DEBUGMSG(("tdomain", ", \""));
+ for (i = 0; d->prefix[i] != NULL; i++) {
+ DEBUGMSG(("tdomain", "%s%s", d->prefix[i],
+ (d->prefix[i + 1]) ? "/" : ""));
+ }
+ DEBUGMSG(("tdomain", "\" } -> "));
+ }
+ DEBUGMSG(("tdomain", "[NIL]\n"));
+}
+
+
+
+int
+netsnmp_tdomain_register(netsnmp_tdomain *n)
+{
+ netsnmp_tdomain **prevNext = &domain_list, *d;
+
+ if (n != NULL) {
+ for (d = domain_list; d != NULL; d = d->next) {
+ if (netsnmp_oid_equals(n->name, n->name_length,
+ d->name, d->name_length) == 0) {
+ /*
+ * Already registered.
+ */
+ return 0;
+ }
+ prevNext = &(d->next);
+ }
+ n->next = NULL;
+ *prevNext = n;
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+
+
+netsnmp_feature_child_of(tdomain_unregister, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_TDOMAIN_UNREGISTER
+int
+netsnmp_tdomain_unregister(netsnmp_tdomain *n)
+{
+ netsnmp_tdomain **prevNext = &domain_list, *d;
+
+ if (n != NULL) {
+ for (d = domain_list; d != NULL; d = d->next) {
+ if (netsnmp_oid_equals(n->name, n->name_length,
+ d->name, d->name_length) == 0) {
+ *prevNext = n->next;
+ SNMP_FREE(n->prefix);
+ return 1;
+ }
+ prevNext = &(d->next);
+ }
+ return 0;
+ } else {
+ return 0;
+ }
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDOMAIN_UNREGISTER */
+
+
+static netsnmp_tdomain *
+find_tdomain(const char* spec)
+{
+ netsnmp_tdomain *d;
+ for (d = domain_list; d != NULL; d = d->next) {
+ int i;
+ for (i = 0; d->prefix[i] != NULL; i++)
+ if (strcasecmp(d->prefix[i], spec) == 0) {
+ DEBUGMSGTL(("tdomain",
+ "Found domain \"%s\" from specifier \"%s\"\n",
+ d->prefix[0], spec));
+ return d;
+ }
+ }
+ DEBUGMSGTL(("tdomain", "Found no domain from specifier \"%s\"\n", spec));
+ return NULL;
+}
+
+static int
+netsnmp_is_fqdn(const char *thename)
+{
+ if (!thename)
+ return 0;
+ while(*thename) {
+ if (*thename != '.' && !isupper((unsigned char)*thename) &&
+ !islower((unsigned char)*thename) &&
+ !isdigit((unsigned char)*thename) && *thename != '-') {
+ return 0;
+ }
+ thename++;
+ }
+ return 1;
+}
+
+/*
+ * Locate the appropriate transport domain and call the create function for
+ * it.
+ */
+netsnmp_transport *
+netsnmp_tdomain_transport_full(const char *application,
+ const char *str, int local,
+ const char *default_domain,
+ const char *default_target)
+{
+ netsnmp_tdomain *match = NULL;
+ const char *addr = NULL;
+ const char * const *spec = NULL;
+ int any_found = 0;
+ char buf[SNMP_MAXPATH];
+
+ DEBUGMSGTL(("tdomain",
+ "tdomain_transport_full(\"%s\", \"%s\", %d, \"%s\", \"%s\")\n",
+ application, str ? str : "[NIL]", local,
+ default_domain ? default_domain : "[NIL]",
+ default_target ? default_target : "[NIL]"));
+
+ /* see if we can load a host-name specific set of conf files */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_LOAD_HOST_FILES) &&
+ netsnmp_is_fqdn(str)) {
+ static int have_added_handler = 0;
+ char *newhost;
+ struct config_line *config_handlers;
+ struct config_files file_names;
+ char *prev_hostname;
+
+ /* register a "transport" specifier */
+ if (!have_added_handler) {
+ have_added_handler = 1;
+ netsnmp_ds_register_config(ASN_OCTET_STR,
+ "snmp", "transport",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HOSTNAME);
+ }
+
+ /* we save on specific setting that we don't allow to change
+ from one transport creation to the next; ie, we don't want
+ the "transport" specifier to be a default. It should be a
+ single invocation use only */
+ prev_hostname = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HOSTNAME);
+ if (prev_hostname)
+ prev_hostname = strdup(prev_hostname);
+
+ /* read in the hosts/STRING.conf files */
+ config_handlers = read_config_get_handlers("snmp");
+ snprintf(buf, sizeof(buf)-1, "hosts/%s", str);
+ file_names.fileHeader = buf;
+ file_names.start = config_handlers;
+ file_names.next = NULL;
+ DEBUGMSGTL(("tdomain", "checking for host specific config %s\n",
+ buf));
+ read_config_files_of_type(EITHER_CONFIG, &file_names);
+
+ if (NULL !=
+ (newhost = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HOSTNAME))) {
+ strlcpy(buf, newhost, sizeof(buf));
+ str = buf;
+ }
+
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HOSTNAME,
+ prev_hostname);
+ SNMP_FREE(prev_hostname);
+ }
+
+ /* First try - assume that there is a domain in str (domain:target) */
+
+ if (str != NULL) {
+ const char *cp;
+ if ((cp = strchr(str, ':')) != NULL) {
+ char* mystring = (char*)malloc(cp + 1 - str);
+ memcpy(mystring, str, cp - str);
+ mystring[cp - str] = '\0';
+ addr = cp + 1;
+
+ match = find_tdomain(mystring);
+ free(mystring);
+ }
+ }
+
+ /*
+ * Second try, if there is no domain in str (target), then try the
+ * default domain
+ */
+
+ if (match == NULL) {
+ addr = str;
+ if (addr && *addr == '/') {
+ DEBUGMSGTL(("tdomain",
+ "Address starts with '/', so assume \"unix\" "
+ "domain\n"));
+ match = find_tdomain("unix");
+ } else if (default_domain) {
+ DEBUGMSGTL(("tdomain",
+ "Use user specified default domain \"%s\"\n",
+ default_domain));
+ match = find_tdomain(default_domain);
+ } else {
+ spec = netsnmp_lookup_default_domains(application);
+ if (spec == NULL) {
+ DEBUGMSGTL(("tdomain",
+ "No default domain found, assume \"udp\"\n"));
+ match = find_tdomain("udp");
+ } else {
+ const char * const * r = spec;
+ DEBUGMSGTL(("tdomain",
+ "Use application default domains"));
+ while(*r) {
+ DEBUGMSG(("tdomain", " \"%s\"", *r));
+ ++r;
+ }
+ DEBUGMSG(("tdomain", "\n"));
+ }
+ }
+ }
+
+ for(;;) {
+ if (match) {
+ netsnmp_transport *t = NULL;
+ const char* addr2;
+
+ any_found = 1;
+ /*
+ * Ok, we know what domain to try, lets see what default data
+ * should be used with it
+ */
+ if (default_target != NULL)
+ addr2 = default_target;
+ else
+ addr2 = netsnmp_lookup_default_target(application,
+ match->prefix[0]);
+ DEBUGMSGTL(("tdomain",
+ "trying domain \"%s\" address \"%s\" "
+ "default address \"%s\"\n",
+ match->prefix[0], addr ? addr : "[NIL]",
+ addr2 ? addr2 : "[NIL]"));
+ if (match->f_create_from_tstring) {
+ NETSNMP_LOGONCE((LOG_WARNING,
+ "transport domain %s uses deprecated f_create_from_tstring\n",
+ match->prefix[0]));
+ t = match->f_create_from_tstring(addr, local);
+ }
+ else
+ t = match->f_create_from_tstring_new(addr, local, addr2);
+ if (t) {
+ return t;
+ }
+ }
+ addr = str;
+ if (spec && *spec)
+ match = find_tdomain(*spec++);
+ else
+ break;
+ }
+ if (!any_found)
+ snmp_log(LOG_ERR, "No support for any checked transport domain\n");
+ return NULL;
+}
+
+
+netsnmp_transport *
+netsnmp_tdomain_transport(const char *str, int local,
+ const char *default_domain)
+{
+ return netsnmp_tdomain_transport_full("snmp", str, local, default_domain,
+ NULL);
+}
+
+
+#ifndef NETSNMP_FEATURE_REMOVE_TDOMAIN_TRANSPORT_OID
+netsnmp_transport *
+netsnmp_tdomain_transport_oid(const oid * dom,
+ size_t dom_len,
+ const u_char * o, size_t o_len, int local)
+{
+ netsnmp_tdomain *d;
+ int i;
+
+ DEBUGMSGTL(("tdomain", "domain \""));
+ DEBUGMSGOID(("tdomain", dom, dom_len));
+ DEBUGMSG(("tdomain", "\"\n"));
+
+ for (d = domain_list; d != NULL; d = d->next) {
+ for (i = 0; d->prefix[i] != NULL; i++) {
+ if (netsnmp_oid_equals(dom, dom_len, d->name, d->name_length) ==
+ 0) {
+ return d->f_create_from_ostring(o, o_len, local);
+ }
+ }
+ }
+
+ snmp_log(LOG_ERR, "No support for requested transport domain\n");
+ return NULL;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TDOMAIN_TRANSPORT_OID */
+
+netsnmp_transport*
+netsnmp_transport_open(const char* application, const char* str, int local)
+{
+ return netsnmp_tdomain_transport_full(application, str, local, NULL, NULL);
+}
+
+netsnmp_transport*
+netsnmp_transport_open_server(const char* application, const char* str)
+{
+ return netsnmp_tdomain_transport_full(application, str, 1, NULL, NULL);
+}
+
+netsnmp_transport*
+netsnmp_transport_open_client(const char* application, const char* str)
+{
+ return netsnmp_tdomain_transport_full(application, str, 0, NULL, NULL);
+}
+
+/** adds a transport to a linked list of transports.
+ Returns 1 on failure, 0 on success */
+int
+netsnmp_transport_add_to_list(netsnmp_transport_list **transport_list,
+ netsnmp_transport *transport)
+{
+ netsnmp_transport_list *newptr =
+ SNMP_MALLOC_TYPEDEF(netsnmp_transport_list);
+
+ if (!newptr)
+ return 1;
+
+ newptr->next = *transport_list;
+ newptr->transport = transport;
+
+ *transport_list = newptr;
+
+ return 0;
+}
+
+
+/** removes a transport from a linked list of transports.
+ Returns 1 on failure, 0 on success */
+int
+netsnmp_transport_remove_from_list(netsnmp_transport_list **transport_list,
+ netsnmp_transport *transport)
+{
+ netsnmp_transport_list *ptr = *transport_list, *lastptr = NULL;
+
+ while (ptr && ptr->transport != transport) {
+ lastptr = ptr;
+ ptr = ptr->next;
+ }
+
+ if (!ptr)
+ return 1;
+
+ if (lastptr)
+ lastptr->next = ptr->next;
+ else
+ *transport_list = ptr->next;
+
+ SNMP_FREE(ptr);
+
+ return 0;
+}
+
+int
+netsnmp_transport_config_compare(netsnmp_transport_config *left,
+ netsnmp_transport_config *right) {
+ return strcmp(left->key, right->key);
+}
+
+netsnmp_transport_config *
+netsnmp_transport_create_config(char *key, char *value) {
+ netsnmp_transport_config *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_transport_config);
+ entry->key = strdup(key);
+ entry->value = strdup(value);
+ return entry;
+}
diff --git a/snmplib/snmp_version.c b/snmplib/snmp_version.c
new file mode 100644
index 0000000..7d34c0d
--- /dev/null
+++ b/snmplib/snmp_version.c
@@ -0,0 +1,14 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/version.h>
+
+/* expose ONLY for benefit of grandfathered code */
+#ifndef UCD_COMPATIBLE
+static
+#endif
+const char *NetSnmpVersionInfo = PACKAGE_VERSION;
+
+const char *
+netsnmp_get_version(void)
+{
+ return NetSnmpVersionInfo;
+}
diff --git a/snmplib/snmpksm.c b/snmplib/snmpksm.c
new file mode 100644
index 0000000..06febe2
--- /dev/null
+++ b/snmplib/snmpksm.c
@@ -0,0 +1,1884 @@
+/*
+ * snmpksm.c
+ *
+ * This code implements the Kerberos Security Model (KSM) for SNMP.
+ *
+ * Security number - 2066432
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.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_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <errno.h>
+
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#ifdef NETSNMP_USE_KERBEROS_HEIMDAL
+#ifndef NETSNMP_USE_KERBEROS_MIT
+#define OLD_HEIMDAL
+#endif /* ! NETSNMP_USE_KERBEROS_MIT */
+#endif /* NETSNMP_USE_KERBEROS_HEIMDAL */
+
+#ifdef NETSNMP_USE_KERBEROS_HEIMDAL
+#define oid heimdal_oid_renamed
+#endif /* NETSNMP_USE_KERBEROS_HEIMDAL */
+#include <krb5.h>
+#include <com_err.h>
+#ifdef NETSNMP_USE_KERBEROS_HEIMDAL
+#undef oid
+#endif /* NETSNMP_USE_KERBEROS_HEIMDAL */
+
+#ifdef NETSNMP_USE_KERBEROS_HEIMDAL
+#define CHECKSUM_TYPE(x) (x)->cksumtype
+#define CHECKSUM_CONTENTS(x) ((char *)((x)->checksum.data))
+#define CHECKSUM_LENGTH(x) (x)->checksum.length
+#define TICKET_CLIENT(x) (x)->client
+#else /* NETSNMP_USE_KERBEROS_HEIMDAL */
+#define CHECKSUM_TYPE(x) (x)->checksum_type
+#define CHECKSUM_CONTENTS(x) (x)->contents
+#define CHECKSUM_LENGTH(x) (x)->length
+#define TICKET_CLIENT(x) (x)->enc_part2->client
+#endif /* NETSNMP_USE_KERBEROS_HEIMDAL */
+
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/keytools.h>
+#include <net-snmp/library/snmpv3.h>
+#include <net-snmp/library/lcd_time.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/snmpksm.h>
+
+static krb5_context kcontext = NULL;
+static krb5_rcache rcache = NULL;
+static krb5_keytab keytab = NULL;
+static int keytab_setup = 0;
+static const char *service_name = NULL;
+
+static int ksm_session_init(netsnmp_session *);
+static void ksm_free_state_ref(void *);
+static int ksm_free_pdu(netsnmp_pdu *);
+static int ksm_clone_pdu(netsnmp_pdu *, netsnmp_pdu *);
+
+static int ksm_insert_cache(long, krb5_auth_context, u_char *,
+ size_t);
+static void ksm_decrement_ref_count(long);
+static void ksm_increment_ref_count(long);
+static struct ksm_cache_entry *ksm_get_cache(long);
+
+#define HASHSIZE 64
+
+/*
+ * Our information stored for the response PDU.
+ */
+
+struct ksm_secStateRef {
+ krb5_auth_context auth_context;
+ krb5_cksumtype cksumtype;
+};
+
+/*
+ * A KSM outgoing pdu cache entry
+ */
+
+struct ksm_cache_entry {
+ long msgid;
+ int refcount;
+ krb5_auth_context auth_context;
+ u_char *secName;
+ size_t secNameLen;
+ struct ksm_cache_entry *next;
+};
+
+/*
+ * Poor man's hash table
+ */
+
+static struct ksm_cache_entry *ksm_hash_table[HASHSIZE];
+
+/*
+ * Stuff to deal with config values
+ * Note the conditionals that wrap these--i don't know if these are
+ * needed, since i don't know how library initialization and callbacks
+ * and stuff work
+ */
+
+static int
+init_snmpksm_post_config(int majorid, int minorid, void *serverarg,
+ void *clientarg)
+{
+
+ if (kcontext == NULL) {
+ /* not reached, i'd imagine */
+ return SNMPERR_KRB5;
+ }
+
+ if (service_name == NULL) {
+ /* always reached, i'd imagine */
+ char *c = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_KSM_SERVICE_NAME);
+ if (c != NULL) {
+ service_name = c;
+ }
+ else {
+ service_name = "host";
+ }
+ }
+
+ if (keytab_setup == 0) {
+ /* always reached, i'd imagine */
+ char *c = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_KSM_KEYTAB);
+ if (c) {
+ krb5_error_code retval;
+ DEBUGMSGTL(("ksm", "Using keytab %s\n", c));
+ retval = krb5_kt_resolve(kcontext, c, &keytab);
+ if (retval) {
+ DEBUGMSGTL(("ksm", "krb5_kt_resolve(\"%s\") failed. KSM "
+ "config callback failing\n", error_message(retval)));
+ return SNMPERR_KRB5;
+ }
+ }
+ else {
+ DEBUGMSGTL(("ksm", "Using default keytab\n", c));
+ }
+ keytab_setup = 1;
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * Initialize all of the state required for Kerberos (right now, just call
+ * krb5_init_context).
+ */
+
+void
+init_ksm(void)
+{
+ krb5_error_code retval;
+ struct snmp_secmod_def *def;
+ int i;
+
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defKSMKeytab",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_KSM_KEYTAB);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defKSMServiceName",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_KSM_SERVICE_NAME);
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ init_snmpksm_post_config, NULL);
+
+
+ if (kcontext == NULL) {
+ retval = krb5_init_context(&kcontext);
+
+ if (retval) {
+ DEBUGMSGTL(("ksm", "krb5_init_context failed (%s), not "
+ "registering KSM\n", error_message(retval)));
+ return;
+ }
+ }
+
+ for (i = 0; i < HASHSIZE; i++)
+ ksm_hash_table[i] = NULL;
+
+ def = SNMP_MALLOC_STRUCT(snmp_secmod_def);
+
+ if (!def) {
+ DEBUGMSGTL(("ksm", "Unable to malloc snmp_secmod struct, not "
+ "registering KSM\n"));
+ return;
+ }
+
+ def->encode_reverse = ksm_rgenerate_out_msg;
+ def->decode = ksm_process_in_msg;
+ def->session_open = ksm_session_init;
+ def->pdu_free_state_ref = ksm_free_state_ref;
+ def->pdu_free = ksm_free_pdu;
+ def->pdu_clone = ksm_clone_pdu;
+
+ register_sec_mod(NETSNMP_SEC_MODEL_KSM, "ksm", def);
+}
+
+void shutdown_ksm(void)
+{
+}
+
+/*
+ * These routines implement a simple cache for information we need to
+ * process responses. When we send out a request, it contains an AP_REQ;
+ * we get back an AP_REP, and we need the authorization context from the
+ * AP_REQ to decrypt the AP_REP. But because right now there's nothing
+ * that gets preserved across calls to rgenerate_out_msg to process_in_msg,
+ * we cache these internally based on the message ID (we also cache the
+ * passed-in security name, for reasons that are mostly stupid).
+ */
+
+static int
+ksm_insert_cache(long msgid, krb5_auth_context auth_context,
+ u_char * secName, size_t secNameLen)
+{
+ struct ksm_cache_entry *entry;
+ int bucket;
+ int retval;
+
+ entry = SNMP_MALLOC_STRUCT(ksm_cache_entry);
+
+ if (!entry)
+ return SNMPERR_MALLOC;
+
+ entry->msgid = msgid;
+ entry->auth_context = auth_context;
+ entry->refcount = 1;
+
+ retval = memdup(&entry->secName, secName, secNameLen);
+
+ if (retval != SNMPERR_SUCCESS) {
+ free(entry);
+ return retval;
+ }
+
+ entry->secNameLen = secNameLen;
+
+ bucket = msgid % HASHSIZE;
+
+ entry->next = ksm_hash_table[bucket];
+ ksm_hash_table[bucket] = entry;
+
+ return SNMPERR_SUCCESS;
+}
+
+static struct ksm_cache_entry *
+ksm_get_cache(long msgid)
+{
+ struct ksm_cache_entry *entry;
+ int bucket;
+
+ bucket = msgid % HASHSIZE;
+
+ for (entry = ksm_hash_table[bucket]; entry != NULL;
+ entry = entry->next)
+ if (entry->msgid == msgid)
+ return entry;
+
+ return NULL;
+}
+
+static void
+ksm_decrement_ref_count(long msgid)
+{
+ struct ksm_cache_entry *entry, *entry1;
+ int bucket;
+
+ bucket = msgid % HASHSIZE;
+
+ if (ksm_hash_table[bucket] && ksm_hash_table[bucket]->msgid == msgid) {
+ entry = ksm_hash_table[bucket];
+
+ /*
+ * If the reference count is zero, then free it
+ */
+
+ if (--entry->refcount <= 0) {
+ DEBUGMSGTL(("ksm", "Freeing entry for msgid %ld\n", msgid));
+ krb5_auth_con_free(kcontext, entry->auth_context);
+ free(entry->secName);
+ ksm_hash_table[bucket] = entry->next;
+ free(entry);
+ }
+
+ return;
+
+ } else if (ksm_hash_table[bucket])
+ for (entry1 = ksm_hash_table[bucket], entry = entry1->next;
+ entry != NULL; entry1 = entry, entry = entry->next)
+ if (entry->msgid == msgid) {
+
+ if (--entry->refcount <= 0) {
+ DEBUGMSGTL(("ksm", "Freeing entry for msgid %ld\n",
+ msgid));
+ krb5_auth_con_free(kcontext, entry->auth_context);
+ free(entry->secName);
+ entry1->next = entry->next;
+ free(entry);
+ }
+
+ return;
+ }
+
+ DEBUGMSGTL(("ksm",
+ "KSM: Unable to decrement cache entry for msgid %ld.\n",
+ msgid));
+}
+
+static void
+ksm_increment_ref_count(long msgid)
+{
+ struct ksm_cache_entry *entry = ksm_get_cache(msgid);
+
+ if (!entry) {
+ DEBUGMSGTL(("ksm", "Unable to find cache entry for msgid %ld "
+ "for increment\n", msgid));
+ return;
+ }
+
+ entry->refcount++;
+}
+
+/*
+ * Initialize specific session information (right now, just set up things to
+ * not do an engineID probe)
+ */
+
+static int
+ksm_session_init(netsnmp_session * sess)
+{
+ DEBUGMSGTL(("ksm",
+ "KSM: Reached our session initialization callback\n"));
+
+ sess->flags |= SNMP_FLAGS_DONT_PROBE;
+
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * Free our state information (this is only done on the agent side)
+ */
+
+static void
+ksm_free_state_ref(void *ptr)
+{
+ struct ksm_secStateRef *ref = (struct ksm_secStateRef *) ptr;
+
+ DEBUGMSGTL(("ksm", "KSM: Freeing state reference\n"));
+
+ krb5_auth_con_free(kcontext, ref->auth_context);
+
+ free(ref);
+}
+
+/*
+ * This is called when the PDU is freed; this will decrement reference counts
+ * for entries in our state cache.
+ */
+
+static int
+ksm_free_pdu(netsnmp_pdu *pdu)
+{
+ ksm_decrement_ref_count(pdu->msgid);
+
+ DEBUGMSGTL(("ksm", "Decrementing cache entry for PDU msgid %ld\n",
+ pdu->msgid));
+
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * This is called when a PDU is cloned (to increase reference counts)
+ */
+
+static int
+ksm_clone_pdu(netsnmp_pdu *pdu, netsnmp_pdu *pdu2)
+{
+ ksm_increment_ref_count(pdu->msgid);
+
+ DEBUGMSGTL(("ksm", "Incrementing cache entry for PDU msgid %ld\n",
+ pdu->msgid));
+
+ return SNMPERR_SUCCESS;
+}
+
+/****************************************************************************
+ *
+ * ksm_generate_out_msg
+ *
+ * Parameters:
+ * (See list below...)
+ *
+ * Returns:
+ * SNMPERR_GENERIC On success.
+ * SNMPERR_KRB5
+ * ... and others
+ *
+ *
+ * Generate an outgoing message.
+ *
+ ****************************************************************************/
+
+int
+ksm_rgenerate_out_msg(struct snmp_secmod_outgoing_params *parms)
+{
+ krb5_auth_context auth_context = NULL;
+ krb5_error_code retcode;
+ krb5_ccache cc = NULL;
+ int retval = SNMPERR_SUCCESS;
+ krb5_data outdata, ivector;
+ krb5_keyblock *subkey = NULL;
+#ifdef NETSNMP_USE_KERBEROS_MIT
+ krb5_data input;
+ krb5_enc_data output;
+ unsigned int numcksumtypes;
+ krb5_cksumtype *cksumtype_array;
+#elif defined OLD_HEIMDAL /* NETSNMP_USE_KERBEROS_MIT */
+ krb5_crypto heim_crypto = NULL;
+#else /* NETSNMP_USE_KERBEROS_MIT */
+ krb5_encrypt_block eblock;
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+ size_t blocksize, encrypted_length;
+ unsigned char *encrypted_data = NULL;
+ long zero = 0, tmp;
+ int i;
+ u_char *cksum_pointer, *endp = *parms->wholeMsg;
+ krb5_cksumtype cksumtype;
+ krb5_checksum pdu_checksum;
+ u_char **wholeMsg = parms->wholeMsg;
+ size_t *offset = parms->wholeMsgOffset, seq_offset;
+ struct ksm_secStateRef *ksm_state = (struct ksm_secStateRef *)
+ parms->secStateRef;
+#ifdef OLD_HEIMDAL
+ krb5_data encrypted_scoped_pdu;
+#endif /* OLD_HEIMDAL */
+ int rc;
+ char *colon = NULL;
+
+ DEBUGMSGTL(("ksm", "Starting KSM processing\n"));
+
+ outdata.length = 0;
+ outdata.data = NULL;
+ ivector.length = 0;
+ ivector.data = NULL;
+ CHECKSUM_CONTENTS(&pdu_checksum) = NULL;
+
+ if (!ksm_state) {
+ /*
+ * If we've got a port number as part of the "peername", then
+ * suppress this (temporarily) while we build the credential info.
+ * XXX - what about "udp:host" style addresses?
+ */
+ colon = strrchr(params->session->peername, ':');
+ if (colon != NULL) {
+ *colon='\0';
+ }
+
+ /*
+ * If we don't have a ksm_state, then we're a request. Get a
+ * credential cache and build a ap_req.
+ */
+ retcode = krb5_cc_default(kcontext, &cc);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "KSM: krb5_cc_default failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ DEBUGMSGTL(("ksm", "KSM: Set credential cache successfully\n"));
+
+ /*
+ * This seems odd, since we don't need this until later (or earlier,
+ * depending on how you look at it), but because the most likely
+ * errors are Kerberos at this point, I'll get this now to save
+ * time not encoding the rest of the packet.
+ *
+ * Also, we need the subkey to encrypt the PDU (if required).
+ */
+
+ retcode =
+ krb5_mk_req(kcontext, &auth_context,
+ AP_OPTS_MUTUAL_REQUIRED | AP_OPTS_USE_SUBKEY,
+ (char *) service_name, parms->session->peername, NULL,
+ cc, &outdata);
+
+ if (colon != NULL)
+ *colon=':';
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "KSM: krb5_mk_req failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ DEBUGMSGTL(("ksm", "KSM: ticket retrieved successfully for \"%s/%s\" "
+ "(may not be actual ticket sname)\n", service_name,
+ parms->session->peername));
+
+ } else {
+
+ /*
+ * Grab the auth_context from our security state reference
+ */
+
+ auth_context = ksm_state->auth_context;
+
+ /*
+ * Bundle up an AP_REP. Note that we do this only when we
+ * have a security state reference (which means we're in an agent
+ * and we're sending a response).
+ */
+
+ DEBUGMSGTL(("ksm", "KSM: Starting reply processing.\n"));
+
+ retcode = krb5_mk_rep(kcontext, auth_context, &outdata);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "KSM: krb5_mk_rep failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ DEBUGMSGTL(("ksm", "KSM: Finished with krb5_mk_rep()\n"));
+ }
+
+ /*
+ * If we have to encrypt the PDU, do that now
+ */
+
+ if (parms->secLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+
+ DEBUGMSGTL(("ksm", "KSM: Starting PDU encryption.\n"));
+
+ /*
+ * It's weird -
+ *
+ * If we're on the manager, it's a local subkey (because that's in
+ * our AP_REQ)
+ *
+ * If we're on the agent, it's a remote subkey (because that comes
+ * FROM the received AP_REQ).
+ */
+
+ if (ksm_state)
+ retcode = krb5_auth_con_getremotesubkey(kcontext, auth_context,
+ &subkey);
+ else
+ retcode = krb5_auth_con_getlocalsubkey(kcontext, auth_context,
+ &subkey);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm",
+ "KSM: krb5_auth_con_getlocalsubkey failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ /*
+ * Note that here we need to handle different things between the
+ * old and new crypto APIs. First, we need to get the final encrypted
+ * length of the PDU.
+ */
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+ retcode = krb5_c_encrypt_length(kcontext, subkey->enctype,
+ parms->scopedPduLen,
+ &encrypted_length);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm",
+ "Encryption length calculation failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+#elif defined OLD_HEIMDAL
+ retcode = krb5_crypto_init(kcontext, subkey, 0, &heim_crypto);
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "krb5_crypto_init failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+ encrypted_length = krb5_get_wrapped_length(kcontext, heim_crypto,
+ parms->scopedPduLen);
+#else /* NETSNMP_USE_KERBEROS_MIT */
+
+ krb5_use_enctype(kcontext, &eblock, subkey->enctype);
+ retcode = krb5_process_key(kcontext, &eblock, subkey);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "krb5_process_key failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ encrypted_length = krb5_encrypt_size(parms->scopedPduLen,
+ eblock.crypto_entry);
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+#ifndef OLD_HEIMDAL /* since heimdal allocs the space for us */
+ encrypted_data = malloc(encrypted_length);
+
+ if (!encrypted_data) {
+ DEBUGMSGTL(("ksm",
+ "KSM: Unable to malloc %d bytes for encrypt "
+ "buffer: %s\n", parms->scopedPduLen,
+ strerror(errno)));
+ retval = SNMPERR_MALLOC;
+#ifndef NETSNMP_USE_KERBEROS_MIT
+ krb5_finish_key(kcontext, &eblock);
+#endif /* ! NETSNMP_USE_KERBEROS_MIT */
+
+ goto error;
+ }
+#endif /* ! OLD_HEIMDAL */
+
+ /*
+ * We need to set up a blank initialization vector for the encryption.
+ * Use a block of all zero's (which is dependent on the block size
+ * of the encryption method).
+ */
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+
+ retcode = krb5_c_block_size(kcontext, subkey->enctype, &blocksize);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm",
+ "Unable to determine crypto block size: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+#elif defined (OLD_HEIMDAL) /* NETSNMP_USE_KERBEROS_MIT */
+#else /* NETSNMP_USE_KERBEROS_MIT */
+
+ blocksize =
+ krb5_enctype_array[subkey->enctype]->system->block_length;
+
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+#ifndef OLD_HEIMDAL /* since allocs the space for us */
+ ivector.data = malloc(blocksize);
+
+ if (!ivector.data) {
+ DEBUGMSGTL(("ksm", "Unable to allocate %d bytes for ivector\n",
+ blocksize));
+ retval = SNMPERR_MALLOC;
+ goto error;
+ }
+
+ ivector.length = blocksize;
+ memset(ivector.data, 0, blocksize);
+#endif /* OLD_HEIMDAL */
+
+ /*
+ * Finally! Do the encryption!
+ */
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+
+ input.data = (char *) parms->scopedPdu;
+ input.length = parms->scopedPduLen;
+ output.ciphertext.data = (char *) encrypted_data;
+ output.ciphertext.length = encrypted_length;
+
+ retcode =
+ krb5_c_encrypt(kcontext, subkey, KSM_KEY_USAGE_ENCRYPTION,
+ &ivector, &input, &output);
+
+#elif defined OLD_HEIMDAL /* NETSNMP_USE_KERBEROS_MIT */
+
+ krb5_data_zero(&encrypted_scoped_pdu);
+ retcode = krb5_encrypt(kcontext, heim_crypto, KSM_KEY_USAGE_ENCRYPTION,
+ parms->scopedPdu, parms->scopedPduLen,
+ &encrypted_scoped_pdu);
+ if (retcode == 0) {
+ encrypted_length = encrypted_scoped_pdu.length;
+ encrypted_data = encrypted_scoped_pdu.data;
+ krb5_data_zero(&encrypted_scoped_pdu);
+ }
+#else /* NETSNMP_USE_KERBEROS_MIT */
+
+ retcode = krb5_encrypt(kcontext, (krb5_pointer) parms->scopedPdu,
+ (krb5_pointer) encrypted_data,
+ parms->scopedPduLen, &eblock, ivector.data);
+
+ krb5_finish_key(kcontext, &eblock);
+
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "KSM: krb5_encrypt failed: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail(error_message(retcode));
+ goto error;
+ }
+
+ *offset = 0;
+
+ rc = asn_realloc_rbuild_string(wholeMsg, parms->wholeMsgLen,
+ offset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ encrypted_data,
+ encrypted_length);
+
+ if (rc == 0) {
+ DEBUGMSGTL(("ksm", "Building encrypted payload failed.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+
+ DEBUGMSGTL(("ksm", "KSM: Encryption complete.\n"));
+
+ } else {
+ /*
+ * Plaintext PDU (not encrypted)
+ */
+
+ if (*parms->wholeMsgLen < parms->scopedPduLen) {
+ DEBUGMSGTL(("ksm", "Not enough room for plaintext PDU.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+ }
+
+ /*
+ * Start encoding the msgSecurityParameters
+ *
+ * For now, use 0 for the response hint
+ */
+
+ DEBUGMSGTL(("ksm", "KSM: scopedPdu added to payload\n"));
+
+ seq_offset = *offset;
+
+ rc = asn_realloc_rbuild_int(wholeMsg, parms->wholeMsgLen,
+ offset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_INTEGER),
+ (long *) &zero, sizeof(zero));
+
+ if (rc == 0) {
+ DEBUGMSGTL(("ksm", "Building ksm security parameters failed.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+
+ rc = asn_realloc_rbuild_string(wholeMsg, parms->wholeMsgLen,
+ offset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ (u_char *) outdata.data,
+ outdata.length);
+
+ if (rc == 0) {
+ DEBUGMSGTL(("ksm", "Building ksm AP_REQ failed.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+
+ /*
+ * If we didn't encrypt the packet, we haven't yet got the subkey.
+ * Get that now.
+ */
+
+ if (!subkey) {
+ if (ksm_state)
+ retcode = krb5_auth_con_getremotesubkey(kcontext, auth_context,
+ &subkey);
+ else
+ retcode = krb5_auth_con_getlocalsubkey(kcontext, auth_context,
+ &subkey);
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "krb5_auth_con_getlocalsubkey failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+#ifdef OLD_HEIMDAL
+ retcode = krb5_crypto_init(kcontext, subkey, 0, &heim_crypto);
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "krb5_crypto_init failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+#endif /* OLD_HEIMDAL */
+ }
+
+ /*
+ * Now, we need to pick the "right" checksum algorithm. For old
+ * crypto, just pick CKSUMTYPE_RSA_MD5_DES; for new crypto, pick
+ * one of the "approved" ones.
+ */
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+ retcode = krb5_c_keyed_checksum_types(kcontext, subkey->enctype,
+ &numcksumtypes, &cksumtype_array);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "Unable to find appropriate keyed checksum: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ if (numcksumtypes <= 0) {
+ DEBUGMSGTL(("ksm", "We received a list of zero cksumtypes for this "
+ "enctype (%d)\n", subkey->enctype));
+ snmp_set_detail("No valid checksum type for this encryption type");
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ /*
+ * It's not clear to me from the API which checksum you're supposed
+ * to support, so I'm taking a guess at the first one
+ */
+
+ cksumtype = cksumtype_array[0];
+
+ krb5_free_cksumtypes(kcontext, cksumtype_array);
+
+ DEBUGMSGTL(("ksm", "KSM: Choosing checksum type of %d (subkey type "
+ "of %d)\n", cksumtype, subkey->enctype));
+
+ retcode = krb5_c_checksum_length(kcontext, cksumtype, &blocksize);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "Unable to determine checksum length: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ CHECKSUM_LENGTH(&pdu_checksum) = blocksize;
+
+#else /* NETSNMP_USE_KERBEROS_MIT */
+ if (ksm_state)
+ cksumtype = ksm_state->cksumtype;
+ else
+#ifdef OLD_HEIMDAL
+ {
+ /* no way to tell what kind of checksum to use without trying */
+ retval = krb5_create_checksum(kcontext, heim_crypto,
+ KSM_KEY_USAGE_CHECKSUM, 0,
+ parms->scopedPdu, parms->scopedPduLen,
+ &pdu_checksum);
+ if (retval) {
+ DEBUGMSGTL(("ksm", "Unable to create a checksum: %s\n",
+ error_message(retval)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+ cksumtype = CHECKSUM_TYPE(&pdu_checksum);
+ }
+#else /* OLD_HEIMDAL */
+ cksumtype = CKSUMTYPE_RSA_MD5_DES;
+#endif /* OLD_HEIMDAL */
+
+#ifdef OLD_HEIMDAL
+ if (!krb5_checksum_is_keyed(kcontext, cksumtype)) {
+#else /* OLD_HEIMDAL */
+ if (!is_keyed_cksum(cksumtype)) {
+#endif /* OLD_HEIMDAL */
+ DEBUGMSGTL(("ksm", "Checksum type %d is not a keyed checksum\n",
+ cksumtype));
+ snmp_set_detail("Checksum is not a keyed checksum");
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+#ifdef OLD_HEIMDAL
+ if (!krb5_checksum_is_collision_proof(kcontext, cksumtype)) {
+#else /* OLD_HEIMDAL */
+ if (!is_coll_proof_cksum(cksumtype)) {
+#endif /* OLD_HEIMDAL */
+ DEBUGMSGTL(("ksm", "Checksum type %d is not a collision-proof "
+ "checksum\n", cksumtype));
+ snmp_set_detail("Checksum is not a collision-proof checksum");
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+#ifdef OLD_HEIMDAL
+ if (CHECKSUM_CONTENTS(&pdu_checksum) != NULL ) {
+ /* we did the bogus checksum--don't need to ask for the size again
+ * or initialize cksumtype; just free the bits */
+ free(CHECKSUM_CONTENTS(&pdu_checksum));
+ CHECKSUM_CONTENTS(&pdu_checksum) = NULL;
+ }
+ else {
+ retval = krb5_checksumsize(kcontext, cksumtype,
+ &CHECKSUM_LENGTH(&pdu_checksum));
+ if (retval) {
+ DEBUGMSGTL(("ksm", "Unable to determine checksum length: %s\n",
+ error_message(retval)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+#else /* OLD_HEIMDAL */
+ CHECKSUM_LENGTH(&pdu_checksum) = krb5_checksum_size(kcontext, cksumtype);
+#endif /* OLD_HEIMDAL */
+ CHECKSUM_TYPE(&pdu_checksum) = cksumtype;
+#ifdef OLD_HEIMDAL
+ }
+#endif /* OLD_HEIMDAL */
+
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+ /*
+ * Note that here, we're just leaving blank space for the checksum;
+ * we remember where that is, and we'll fill it in later.
+ */
+
+ *offset += CHECKSUM_LENGTH(&pdu_checksum);
+ memset(*wholeMsg + *parms->wholeMsgLen - *offset, 0, CHECKSUM_LENGTH(&pdu_checksum));
+
+ cksum_pointer = *wholeMsg + *parms->wholeMsgLen - *offset;
+
+ rc = asn_realloc_rbuild_header(wholeMsg, parms->wholeMsgLen,
+ parms->wholeMsgOffset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ CHECKSUM_LENGTH(&pdu_checksum));
+
+ if (rc == 0) {
+ DEBUGMSGTL(("ksm", "Building ksm security parameters failed.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+
+ tmp = cksumtype;
+ rc = asn_realloc_rbuild_int(wholeMsg, parms->wholeMsgLen,
+ parms->wholeMsgOffset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_INTEGER),
+ &tmp, sizeof(tmp));
+
+ if (rc == 0) {
+ DEBUGMSGTL(("ksm", "Building ksm security parameters failed.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+
+ rc = asn_realloc_rbuild_sequence(wholeMsg, parms->wholeMsgLen,
+ parms->wholeMsgOffset, 1,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR),
+ *offset - seq_offset);
+
+ if (rc == 0) {
+ DEBUGMSGTL(("ksm", "Building ksm security parameters failed.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+
+ rc = asn_realloc_rbuild_header(wholeMsg, parms->wholeMsgLen,
+ parms->wholeMsgOffset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ *offset - seq_offset);
+
+ if (rc == 0) {
+ DEBUGMSGTL(("ksm", "Building ksm security parameters failed.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+
+ DEBUGMSGTL(("ksm", "KSM: Security parameter encoding completed\n"));
+
+ /*
+ * We're done with the KSM security parameters - now we do the global
+ * header and wrap up the whole PDU.
+ */
+
+ if (*parms->wholeMsgLen < parms->globalDataLen) {
+ DEBUGMSGTL(("ksm", "Building global data failed.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+
+ *offset += parms->globalDataLen;
+ memcpy(*wholeMsg + *parms->wholeMsgLen - *offset,
+ parms->globalData, parms->globalDataLen);
+
+ rc = asn_realloc_rbuild_sequence(wholeMsg, parms->wholeMsgLen,
+ offset, 1,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR),
+ *offset);
+
+ if (rc == 0) {
+ DEBUGMSGTL(("ksm", "Building master packet sequence.\n"));
+ retval = SNMPERR_TOO_LONG;
+ goto error;
+ }
+
+ DEBUGMSGTL(("ksm", "KSM: PDU master packet encoding complete.\n"));
+
+ /*
+ * Now we need to checksum the entire PDU (since it's built).
+ */
+
+#ifndef OLD_HEIMDAL /* since heimdal allocs the mem for us */
+ CHECKSUM_CONTENTS(&pdu_checksum) = malloc(CHECKSUM_LENGTH(&pdu_checksum));
+
+ if (!CHECKSUM_CONTENTS(&pdu_checksum)) {
+ DEBUGMSGTL(("ksm", "Unable to malloc %d bytes for checksum\n",
+ CHECKSUM_LENGTH(&pdu_checksum)));
+ retval = SNMPERR_MALLOC;
+ goto error;
+ }
+#endif /* ! OLD_HEIMDAL */
+#ifdef NETSNMP_USE_KERBEROS_MIT
+
+ input.data = (char *) (*wholeMsg + *parms->wholeMsgLen - *offset);
+ input.length = *offset;
+ retcode = krb5_c_make_checksum(kcontext, cksumtype, subkey,
+ KSM_KEY_USAGE_CHECKSUM, &input,
+ &pdu_checksum);
+
+#elif defined(OLD_HEIMDAL) /* NETSNMP_USE_KERBEROS_MIT */
+
+ retcode = krb5_create_checksum(kcontext, heim_crypto,
+ KSM_KEY_USAGE_CHECKSUM, cksumtype,
+ *wholeMsg + *parms->wholeMsgLen
+ - *offset, *offset, &pdu_checksum);
+#else /* NETSNMP_USE_KERBEROS_MIT */
+
+ retcode = krb5_calculate_checksum(kcontext, cksumtype, *wholeMsg +
+ *parms->wholeMsgLen - *offset,
+ *offset,
+ (krb5_pointer) subkey->contents,
+ subkey->length, &pdu_checksum);
+
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "Calculate checksum failed: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail(error_message(retcode));
+ goto error;
+ }
+
+ DEBUGMSGTL(("ksm", "KSM: Checksum calculation complete.\n"));
+
+ memcpy(cksum_pointer, CHECKSUM_CONTENTS(&pdu_checksum), CHECKSUM_LENGTH(&pdu_checksum));
+
+ DEBUGMSGTL(("ksm", "KSM: Writing checksum of %d bytes at offset %d\n",
+ CHECKSUM_LENGTH(&pdu_checksum), cksum_pointer - (*wholeMsg + 1)));
+
+ DEBUGMSGTL(("ksm", "KSM: Checksum:"));
+
+ for (i = 0; i < CHECKSUM_LENGTH(&pdu_checksum); i++)
+ DEBUGMSG(("ksm", " %02x",
+ (unsigned int) CHECKSUM_CONTENTS(&pdu_checksum)[i]));
+
+ DEBUGMSG(("ksm", "\n"));
+
+ /*
+ * If we're _not_ called as part of a response (null ksm_state),
+ * then save the auth_context for later using our cache routines.
+ */
+
+ if (!ksm_state) {
+ if ((retval = ksm_insert_cache(parms->pdu->msgid, auth_context,
+ (u_char *) parms->secName,
+ parms->secNameLen)) !=
+ SNMPERR_SUCCESS)
+ goto error;
+ auth_context = NULL;
+ }
+
+ DEBUGMSGTL(("ksm", "KSM processing complete!\n"));
+
+ error:
+
+ if (CHECKSUM_CONTENTS(&pdu_checksum))
+#ifdef NETSNMP_USE_KERBEROS_MIT
+ krb5_free_checksum_contents(kcontext, &pdu_checksum);
+#else /* NETSNMP_USE_KERBEROS_MIT */
+ free(CHECKSUM_CONTENTS(&pdu_checksum));
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+ if (ivector.data)
+ free(ivector.data);
+
+ if (subkey)
+ krb5_free_keyblock(kcontext, subkey);
+
+#ifdef OLD_HEIMDAL /* OLD_HEIMDAL */
+ if (heim_crypto)
+ krb5_crypto_destroy(kcontext, heim_crypto);
+#endif /* OLD_HEIMDAL */
+
+ if (encrypted_data)
+ free(encrypted_data);
+
+ if (cc)
+ krb5_cc_close(kcontext, cc);
+
+ if (auth_context && !ksm_state)
+ krb5_auth_con_free(kcontext, auth_context);
+
+ return retval;
+}
+
+/****************************************************************************
+ *
+ * ksm_process_in_msg
+ *
+ * Parameters:
+ * (See list below...)
+ *
+ * Returns:
+ * KSM_ERR_NO_ERROR On success.
+ * SNMPERR_KRB5
+ * KSM_ERR_GENERIC_ERROR
+ * KSM_ERR_UNSUPPORTED_SECURITY_LEVEL
+ *
+ *
+ * Processes an incoming message.
+ *
+ ****************************************************************************/
+
+int
+ksm_process_in_msg(struct snmp_secmod_incoming_params *parms)
+{
+ long temp;
+ krb5_cksumtype cksumtype;
+ krb5_auth_context auth_context = NULL;
+ krb5_error_code retcode;
+ krb5_checksum checksum;
+ krb5_data ap_req, ivector;
+ krb5_flags flags;
+ krb5_keyblock *subkey = NULL;
+#ifdef NETSNMP_USE_KERBEROS_MIT
+ krb5_data input, output;
+ krb5_boolean valid;
+ krb5_enc_data in_crypt;
+#elif defined OLD_HEIMDAL /* NETSNMP_USE_KERBEROS_MIT */
+ krb5_data output;
+ krb5_crypto heim_crypto = NULL;
+#else /* NETSNMP_USE_KERBEROS_MIT */
+ krb5_encrypt_block eblock;
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+ krb5_ticket *ticket = NULL;
+ int retval = SNMPERR_SUCCESS, response = 0;
+ size_t length =
+ parms->wholeMsgLen - (u_int) (parms->secParams - parms->wholeMsg);
+ u_char *current = parms->secParams, type;
+ size_t cksumlength, blocksize;
+ long hint;
+ char *cname;
+ struct ksm_secStateRef *ksm_state;
+ struct ksm_cache_entry *entry;
+
+ DEBUGMSGTL(("ksm", "Processing has begun\n"));
+
+ CHECKSUM_CONTENTS(&checksum) = NULL;
+ ap_req.data = NULL;
+ ivector.length = 0;
+ ivector.data = NULL;
+
+ /*
+ * First, parse the security parameters (because we need the subkey inside
+ * of the ticket to do anything
+ */
+
+ if ((current = asn_parse_sequence(current, &length, &type,
+ (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ "ksm first octet")) == NULL) {
+ DEBUGMSGTL(("ksm", "Initial security paramter parsing failed\n"));
+
+ retval = SNMPERR_ASN_PARSE_ERR;
+ goto error;
+ }
+
+ if ((current = asn_parse_sequence(current, &length, &type,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ "ksm sequence")) == NULL) {
+ DEBUGMSGTL(("ksm",
+ "Security parameter sequence parsing failed\n"));
+
+ retval = SNMPERR_ASN_PARSE_ERR;
+ goto error;
+ }
+
+ if ((current = asn_parse_int(current, &length, &type, &temp,
+ sizeof(temp))) == NULL) {
+ DEBUGMSGTL(("ksm", "Security parameter checksum type parsing"
+ "failed\n"));
+
+ retval = SNMPERR_ASN_PARSE_ERR;
+ goto error;
+ }
+
+ cksumtype = temp;
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+ if (!krb5_c_valid_cksumtype(cksumtype)) {
+ DEBUGMSGTL(("ksm", "Invalid checksum type (%d)\n", cksumtype));
+
+ retval = SNMPERR_KRB5;
+ snmp_set_detail("Invalid checksum type");
+ goto error;
+ }
+
+ if (!krb5_c_is_keyed_cksum(cksumtype)) {
+ DEBUGMSGTL(("ksm", "Checksum type %d is not a keyed checksum\n",
+ cksumtype));
+ snmp_set_detail("Checksum is not a keyed checksum");
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ if (!krb5_c_is_coll_proof_cksum(cksumtype)) {
+ DEBUGMSGTL(("ksm", "Checksum type %d is not a collision-proof "
+ "checksum\n", cksumtype));
+ snmp_set_detail("Checksum is not a collision-proof checksum");
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+#else /* ! NETSNMP_USE_KERBEROS_MIT */
+#ifdef OLD_HEIMDAL
+ /* kludge */
+ if (krb5_checksumsize(kcontext, cksumtype, &cksumlength)) {
+#else /* OLD_HEIMDAL */
+ if (!valid_cksumtype(cksumtype)) {
+#endif /* OLD_HEIMDAL */
+ DEBUGMSGTL(("ksm", "Invalid checksum type (%d)\n", cksumtype));
+
+ retval = SNMPERR_KRB5;
+ snmp_set_detail("Invalid checksum type");
+ goto error;
+ }
+
+#ifdef OLD_HEIMDAL
+ if (!krb5_checksum_is_keyed(kcontext, cksumtype)) {
+#else /* OLD_HEIMDAL */
+ if (!is_keyed_cksum(cksumtype)) {
+#endif /* OLD_HEIMDAL */
+ DEBUGMSGTL(("ksm", "Checksum type %d is not a keyed checksum\n",
+ cksumtype));
+ snmp_set_detail("Checksum is not a keyed checksum");
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+#ifdef OLD_HEIMDAL
+ if (!krb5_checksum_is_collision_proof(kcontext, cksumtype)) {
+#else /* OLD_HEIMDAL */
+ if (!is_coll_proof_cksum(cksumtype)) {
+#endif /* OLD_HEIMDAL */
+ DEBUGMSGTL(("ksm", "Checksum type %d is not a collision-proof "
+ "checksum\n", cksumtype));
+ snmp_set_detail("Checksum is not a collision-proof checksum");
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+ CHECKSUM_TYPE(&checksum) = cksumtype;
+
+ cksumlength = length;
+
+ if ((current = asn_parse_sequence(current, &cksumlength, &type,
+ (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), "ksm checksum")) ==
+ NULL) {
+ DEBUGMSGTL(("ksm",
+ "Security parameter checksum parsing failed\n"));
+
+ retval = SNMPERR_ASN_PARSE_ERR;
+ goto error;
+ }
+
+ CHECKSUM_CONTENTS(&checksum) = malloc(cksumlength);
+ if (!CHECKSUM_CONTENTS(&checksum)) {
+ DEBUGMSGTL(("ksm", "Unable to malloc %d bytes for checksum.\n",
+ cksumlength));
+ retval = SNMPERR_MALLOC;
+ goto error;
+ }
+
+ memcpy(CHECKSUM_CONTENTS(&checksum), current, cksumlength);
+
+ CHECKSUM_LENGTH(&checksum) = cksumlength;
+ CHECKSUM_TYPE(&checksum) = cksumtype;
+
+ /*
+ * Zero out the checksum so the validation works correctly
+ */
+
+ memset(current, 0, cksumlength);
+
+ current += cksumlength;
+ length = parms->wholeMsgLen - (u_int) (current - parms->wholeMsg);
+
+ if ((current = asn_parse_sequence(current, &length, &type,
+ (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), "ksm ap_req")) ==
+ NULL) {
+ DEBUGMSGTL(("ksm", "KSM security parameter AP_REQ/REP parsing "
+ "failed\n"));
+
+ retval = SNMPERR_ASN_PARSE_ERR;
+ goto error;
+ }
+
+ ap_req.length = length;
+ ap_req.data = malloc(length);
+ if (!ap_req.data) {
+ DEBUGMSGTL(("ksm",
+ "KSM unable to malloc %d bytes for AP_REQ/REP.\n",
+ length));
+ retval = SNMPERR_MALLOC;
+ goto error;
+ }
+
+ memcpy(ap_req.data, current, length);
+
+ current += length;
+ length = parms->wholeMsgLen - (u_int) (current - parms->wholeMsg);
+
+ if ((current = asn_parse_int(current, &length, &type, &hint,
+ sizeof(hint))) == NULL) {
+ DEBUGMSGTL(("ksm",
+ "KSM security parameter hint parsing failed\n"));
+
+ retval = SNMPERR_ASN_PARSE_ERR;
+ goto error;
+ }
+
+ /*
+ * Okay! We've got it all! Now try decoding the damn ticket.
+ *
+ * But of course there's a WRINKLE! We need to figure out if we're
+ * processing a AP_REQ or an AP_REP. How do we do that? We're going
+ * to cheat, and look at the first couple of bytes (which is what
+ * the Kerberos library routines do anyway).
+ *
+ * If there are ever new Kerberos message formats, we'll need to fix
+ * this here.
+ *
+ * If it's a _response_, then we need to get the auth_context
+ * from our cache.
+ */
+
+ if (ap_req.length
+#ifndef NETSNMP_USE_KERBEROS_HEIMDAL
+ && (ap_req.data[0] == 0x6e || ap_req.data[0] == 0x4e)) {
+#else /* NETSNMP_USE_KERBEROS_HEIMDAL */
+ && (((char *)ap_req.data)[0] == 0x6e || ((char *)ap_req.data)[0] == 0x4e)) {
+#endif
+
+ /*
+ * We need to initalize the authorization context, and set the
+ * replay cache in it (and initialize the replay cache if we
+ * haven't already
+ */
+
+ retcode = krb5_auth_con_init(kcontext, &auth_context);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "krb5_auth_con_init failed: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail(error_message(retcode));
+ goto error;
+ }
+
+ if (!rcache) {
+ krb5_data server;
+ server.data = "host";
+ server.length = strlen(server.data);
+
+ retcode = krb5_get_server_rcache(kcontext, &server, &rcache);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "krb5_get_server_rcache failed: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail(error_message(retcode));
+ goto error;
+ }
+ }
+
+ retcode = krb5_auth_con_setrcache(kcontext, auth_context, rcache);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "krb5_auth_con_setrcache failed: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail(error_message(retcode));
+ goto error;
+ }
+
+ retcode = krb5_rd_req(kcontext, &auth_context, &ap_req, NULL,
+ keytab, &flags, &ticket);
+
+ krb5_auth_con_setrcache(kcontext, auth_context, NULL);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "krb5_rd_req() failed: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail(error_message(retcode));
+ goto error;
+ }
+
+ retcode =
+ krb5_unparse_name(kcontext, TICKET_CLIENT(ticket), &cname);
+
+ if (retcode == 0) {
+ DEBUGMSGTL(("ksm", "KSM authenticated principal name: %s\n",
+ cname));
+ free(cname);
+ }
+
+ /*
+ * Check to make sure AP_OPTS_MUTUAL_REQUIRED was set
+ */
+
+ if (!(flags & AP_OPTS_MUTUAL_REQUIRED)) {
+ DEBUGMSGTL(("ksm",
+ "KSM MUTUAL_REQUIRED not set in request!\n"));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail("MUTUAL_REQUIRED not set in message");
+ goto error;
+ }
+
+ retcode =
+ krb5_auth_con_getremotesubkey(kcontext, auth_context, &subkey);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "KSM remote subkey retrieval failed: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail(error_message(retcode));
+ goto error;
+ }
+
+#ifndef NETSNMP_USE_KERBEROS_HEIMDAL
+ } else if (ap_req.length && (ap_req.data[0] == 0x6f ||
+ ap_req.data[0] == 0x4f)) {
+#else /* NETSNMP_USE_KERBEROS_HEIMDAL */
+ } else if (ap_req.length && (((char *)ap_req.data)[0] == 0x6f ||
+ ((char *)ap_req.data)[0] == 0x4f)) {
+#endif /* NETSNMP_USE_KERBEROS_HEIMDAL */
+ /*
+ * Looks like a response; let's see if we've got that auth_context
+ * in our cache.
+ */
+
+ krb5_ap_rep_enc_part *repl = NULL;
+
+ response = 1;
+
+ entry = ksm_get_cache(parms->pdu->msgid);
+
+ if (!entry) {
+ DEBUGMSGTL(("ksm",
+ "KSM: Unable to find auth_context for PDU with "
+ "message ID of %ld\n", parms->pdu->msgid));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ auth_context = entry->auth_context;
+
+ /*
+ * In that case, let's call the rd_rep function
+ */
+
+ retcode = krb5_rd_rep(kcontext, auth_context, &ap_req, &repl);
+
+ if (repl)
+ krb5_free_ap_rep_enc_part(kcontext, repl);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "KSM: krb5_rd_rep() failed: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ DEBUGMSGTL(("ksm", "KSM: krb5_rd_rep() decoded successfully.\n"));
+
+ retcode =
+ krb5_auth_con_getlocalsubkey(kcontext, auth_context, &subkey);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "Unable to retrieve local subkey: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail("Unable to retrieve local subkey");
+ goto error;
+ }
+
+ } else {
+#ifndef NETSNMP_USE_KERBEROS_HEIMDAL
+ DEBUGMSGTL(("ksm", "Unknown Kerberos message type (%02x)\n",
+ ap_req.data[0]));
+#else /* NETSNMP_USE_KERBEROS_HEIMDAL */
+ DEBUGMSGTL(("ksm", "Unknown Kerberos message type (%02x)\n",
+ ((char *)ap_req.data)[0]));
+#endif
+ retval = SNMPERR_KRB5;
+ snmp_set_detail("Unknown Kerberos message type");
+ goto error;
+ }
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+ input.data = (char *) parms->wholeMsg;
+ input.length = parms->wholeMsgLen;
+
+ retcode =
+ krb5_c_verify_checksum(kcontext, subkey, KSM_KEY_USAGE_CHECKSUM,
+ &input, &checksum, &valid);
+#elif defined(OLD_HEIMDAL) /* NETSNMP_USE_KERBEROS_MIT */
+ retcode = krb5_crypto_init(kcontext, subkey, 0, &heim_crypto);
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "krb5_crypto_init failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+ retcode = krb5_verify_checksum(kcontext, heim_crypto,
+ KSM_KEY_USAGE_CHECKSUM, parms->wholeMsg,
+ parms->wholeMsgLen, &checksum);
+#else /* NETSNMP_USE_KERBEROS_MIT */
+ retcode = krb5_verify_checksum(kcontext, cksumtype, &checksum,
+ parms->wholeMsg, parms->wholeMsgLen,
+ (krb5_pointer) subkey->contents,
+ subkey->length);
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "KSM checksum verification failed: %s\n",
+ error_message(retcode)));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail(error_message(retcode));
+ goto error;
+ }
+
+ /*
+ * Don't ask me why they didn't simply return an error, but we have
+ * to check to see if "valid" is false.
+ */
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+ if (!valid) {
+ DEBUGMSGTL(("ksm", "Computed checksum did not match supplied "
+ "checksum!\n"));
+ retval = SNMPERR_KRB5;
+ snmp_set_detail
+ ("Computed checksum did not match supplied checksum");
+ goto error;
+ }
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+ /*
+ * Handle an encrypted PDU. Note that it's an OCTET_STRING of the
+ * output of whatever Kerberos cryptosystem you're using (defined by
+ * the encryption type). Note that this is NOT the EncryptedData
+ * sequence - it's what goes in the "cipher" field of EncryptedData.
+ */
+
+ if (parms->secLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+
+ if ((current = asn_parse_sequence(current, &length, &type,
+ (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), "ksm pdu")) ==
+ NULL) {
+ DEBUGMSGTL(("ksm", "KSM sPDU octet decoding failed\n"));
+ retval = SNMPERR_ASN_PARSE_ERR;
+ goto error;
+ }
+
+ /*
+ * The PDU is now pointed at by "current", and the length is in
+ * "length".
+ */
+
+ DEBUGMSGTL(("ksm", "KSM starting sPDU decode\n"));
+
+ /*
+ * We need to set up a blank initialization vector for the decryption.
+ * Use a block of all zero's (which is dependent on the block size
+ * of the encryption method).
+ */
+
+#ifdef NETSNMP_USE_KERBEROS_MIT
+
+ retcode = krb5_c_block_size(kcontext, subkey->enctype, &blocksize);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm",
+ "Unable to determine crypto block size: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+#elif defined(OLD_HEIMDAL) /* NETSNMP_USE_KERBEROS_MIT */
+#else /* NETSNMP_USE_KERBEROS_MIT */
+
+ blocksize =
+ krb5_enctype_array[subkey->enctype]->system->block_length;
+
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+#ifndef OLD_HEIMDAL
+ ivector.data = malloc(blocksize);
+
+ if (!ivector.data) {
+ DEBUGMSGTL(("ksm", "Unable to allocate %d bytes for ivector\n",
+ blocksize));
+ retval = SNMPERR_MALLOC;
+ goto error;
+ }
+
+ ivector.length = blocksize;
+ memset(ivector.data, 0, blocksize);
+
+#ifndef NETSNMP_USE_KERBEROS_MIT
+
+ krb5_use_enctype(kcontext, &eblock, subkey->enctype);
+
+ retcode = krb5_process_key(kcontext, &eblock, subkey);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "KSM key post-processing failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+#endif /* !NETSNMP_USE_KERBEROS_MIT */
+
+#endif /* ! OLD_HEIMDAL */
+
+ if (length > *parms->scopedPduLen) {
+ DEBUGMSGTL(("ksm", "KSM not enough room - have %d bytes to "
+ "decrypt but only %d bytes available\n", length,
+ *parms->scopedPduLen));
+ retval = SNMPERR_TOO_LONG;
+#ifndef NETSNMP_USE_KERBEROS_MIT
+#ifndef OLD_HEIMDAL
+ krb5_finish_key(kcontext, &eblock);
+#endif /* ! OLD_HEIMDAL */
+#endif /* ! NETSNMP_USE_KERBEROS_MIT */
+ goto error;
+ }
+#ifdef NETSNMP_USE_KERBEROS_MIT
+ in_crypt.ciphertext.data = (char *) current;
+ in_crypt.ciphertext.length = length;
+ in_crypt.enctype = subkey->enctype;
+ output.data = (char *) *parms->scopedPdu;
+ output.length = *parms->scopedPduLen;
+
+ retcode =
+ krb5_c_decrypt(kcontext, subkey, KSM_KEY_USAGE_ENCRYPTION,
+ &ivector, &in_crypt, &output);
+#elif defined (OLD_HEIMDAL) /* NETSNMP_USE_KERBEROS_MIT */
+ retcode = krb5_decrypt(kcontext, heim_crypto, KSM_KEY_USAGE_ENCRYPTION,
+ current, length, &output);
+ if (retcode == 0) {
+ *parms->scopedPdu = (char *) output.data;
+ *parms->scopedPduLen = output.length;
+ krb5_data_zero(&output);
+ }
+#else /* NETSNMP_USE_KERBEROS_MIT */
+
+ retcode = krb5_decrypt(kcontext, (krb5_pointer) current,
+ *parms->scopedPdu, length, &eblock,
+ ivector.data);
+
+ krb5_finish_key(kcontext, &eblock);
+
+#endif /* NETSNMP_USE_KERBEROS_MIT */
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "Decryption failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ *parms->scopedPduLen = length;
+
+ } else {
+ /*
+ * Clear PDU
+ */
+
+ *parms->scopedPdu = current;
+ *parms->scopedPduLen =
+ parms->wholeMsgLen - (current - parms->wholeMsg);
+ }
+
+ /*
+ * A HUGE GROSS HACK
+ */
+
+ *parms->maxSizeResponse = parms->maxMsgSize - 200;
+
+ DEBUGMSGTL(("ksm", "KSM processing complete\n"));
+
+ /*
+ * Set the secName to the right value (a hack for now). But that's
+ * only used for when we're processing a request, not a response.
+ */
+
+ if (!response) {
+
+ retcode = krb5_unparse_name(kcontext, TICKET_CLIENT(ticket),
+ &cname);
+
+ if (retcode) {
+ DEBUGMSGTL(("ksm", "KSM krb5_unparse_name failed: %s\n",
+ error_message(retcode)));
+ snmp_set_detail(error_message(retcode));
+ retval = SNMPERR_KRB5;
+ goto error;
+ }
+
+ if (strlen(cname) > *parms->secNameLen + 1) {
+ DEBUGMSGTL(("ksm",
+ "KSM: Principal length (%d) is too long (%d)\n",
+ strlen(cname), parms->secNameLen));
+ retval = SNMPERR_TOO_LONG;
+ free(cname);
+ goto error;
+ }
+
+ strcpy(parms->secName, cname);
+ *parms->secNameLen = strlen(cname);
+
+ free(cname);
+
+ /*
+ * Also, if we're not a response, keep around our auth_context so we
+ * can encode the reply message correctly
+ */
+
+ ksm_state = SNMP_MALLOC_STRUCT(ksm_secStateRef);
+
+ if (!ksm_state) {
+ DEBUGMSGTL(("ksm", "KSM unable to malloc memory for "
+ "ksm_secStateRef\n"));
+ retval = SNMPERR_MALLOC;
+ goto error;
+ }
+
+ ksm_state->auth_context = auth_context;
+ auth_context = NULL;
+ ksm_state->cksumtype = cksumtype;
+
+ *parms->secStateRef = ksm_state;
+ } else {
+
+ /*
+ * We _still_ have to set the secName in process_in_msg(). Do
+ * that now with what we were passed in before (we cached it,
+ * remember?)
+ */
+
+ memcpy(parms->secName, entry->secName, entry->secNameLen);
+ *parms->secNameLen = entry->secNameLen;
+ }
+
+ /*
+ * Just in case
+ */
+
+ parms->secEngineID = (u_char *) "";
+ *parms->secEngineIDLen = 0;
+
+ auth_context = NULL; /* So we don't try to free it on success */
+
+ error:
+ if (retval == SNMPERR_ASN_PARSE_ERR &&
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS) == 0)
+ DEBUGMSGTL(("ksm", "Failed to increment statistics.\n"));
+
+ if (subkey)
+ krb5_free_keyblock(kcontext, subkey);
+
+#ifdef OLD_HEIMDAL /* OLD_HEIMDAL */
+ if (heim_crypto)
+ krb5_crypto_destroy(kcontext, heim_crypto);
+#endif /* OLD_HEIMDAL */
+
+ if (CHECKSUM_CONTENTS(&checksum))
+ free(CHECKSUM_CONTENTS(&checksum));
+
+ if (ivector.data)
+ free(ivector.data);
+
+ if (ticket)
+ krb5_free_ticket(kcontext, ticket);
+
+ if (!response && auth_context)
+ krb5_auth_con_free(kcontext, auth_context);
+
+ if (ap_req.data)
+ free(ap_req.data);
+
+ return retval;
+}
diff --git a/snmplib/snmptsm.c b/snmplib/snmptsm.c
new file mode 100644
index 0000000..bf4b612
--- /dev/null
+++ b/snmplib/snmptsm.c
@@ -0,0 +1,627 @@
+/*
+ * snmptsmsm.c -- Implements RFC #5591
+ *
+ * This code implements a security model that assumes the local user
+ * that executed the agent is the user who's attributes are passed up
+ * by the transport underneath. The RFC describing this security
+ * model is RFC5591.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/library/snmptsm.h>
+
+#ifdef NETSNMP_TRANSPORT_SSH_DOMAIN
+#include <net-snmp/library/snmpSSHDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+#include <net-snmp/library/snmpDTLSUDPDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+#include <net-snmp/library/snmpTLSTCPDomain.h>
+#endif
+#ifdef NETSNMP_TRANSPORT_DTLSSCTP_DOMAIN
+#include <net-snmp/library/snmpDTLSSCTPDomain.h>
+#endif
+
+netsnmp_feature_require(snmpv3_probe_contextEngineID_rfc5343)
+netsnmp_feature_require(row_create)
+
+#include <unistd.h>
+
+static int tsm_session_init(netsnmp_session *);
+static void tsm_free_state_ref(void *);
+static int tsm_clone_pdu(netsnmp_pdu *, netsnmp_pdu *);
+static int tsm_free_pdu(netsnmp_pdu *pdu);
+
+u_int next_sess_id = 1;
+
+/** Initialize the TSM security module */
+void
+init_tsm(void)
+{
+ struct snmp_secmod_def *def;
+ int ret;
+
+ def = SNMP_MALLOC_STRUCT(snmp_secmod_def);
+
+ if (!def) {
+ snmp_log(LOG_ERR,
+ "Unable to malloc snmp_secmod struct, not registering TSM\n");
+ return;
+ }
+
+ def->encode_reverse = tsm_rgenerate_out_msg;
+ def->decode = tsm_process_in_msg;
+ def->session_open = tsm_session_init;
+ def->pdu_free_state_ref = tsm_free_state_ref;
+ def->pdu_clone = tsm_clone_pdu;
+ def->pdu_free = tsm_free_pdu;
+ def->probe_engineid = snmpv3_probe_contextEngineID_rfc5343;
+
+ DEBUGMSGTL(("tsm","registering ourselves\n"));
+ ret = register_sec_mod(SNMP_SEC_MODEL_TSM, "tsm", def);
+ DEBUGMSGTL(("tsm"," returned %d\n", ret));
+
+ netsnmp_ds_register_config(ASN_BOOLEAN, "snmp", "tsmUseTransportPrefix",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TSM_USE_PREFIX);
+}
+
+/** shutdown the TSM security module */
+void
+shutdown_tsm(void)
+{
+}
+
+/*
+ * Initialize specific session information (right now, just set up things to
+ * not do an engineID probe)
+ */
+
+static int
+tsm_session_init(netsnmp_session * sess)
+{
+ DEBUGMSGTL(("tsm",
+ "TSM: Reached our session initialization callback\n"));
+
+ sess->flags |= SNMP_FLAGS_DONT_PROBE;
+
+ /* XXX: likely needed for something: */
+ /*
+ tsmsession = sess->securityInfo =
+ if (!tsmsession)
+ return SNMPERR_GENERR;
+ */
+
+ return SNMPERR_SUCCESS;
+}
+
+/** Free our state information (this is only done on the agent side) */
+static void
+tsm_free_state_ref(void *ptr)
+{
+ netsnmp_tsmSecurityReference *tsmRef;
+
+ if (NULL == ptr)
+ return;
+
+ tsmRef = (netsnmp_tsmSecurityReference *) ptr;
+ /* the tmStateRef is always taken care of by the normal PDU, since this
+ is just a reference to that one */
+ /* DON'T DO: SNMP_FREE(tsmRef->tmStateRef); */
+ /* SNMP_FREE(tsmRef); ? */
+}
+
+static int
+tsm_free_pdu(netsnmp_pdu *pdu)
+{
+ /* free the security reference */
+ if (pdu->securityStateRef) {
+ tsm_free_state_ref(pdu->securityStateRef);
+ pdu->securityStateRef = NULL;
+ }
+ return 0;
+}
+
+/** This is called when a PDU is cloned (to increase reference counts) */
+static int
+tsm_clone_pdu(netsnmp_pdu *pdu, netsnmp_pdu *pdu2)
+{
+ netsnmp_tsmSecurityReference *oldref, *newref;
+
+ oldref = pdu->securityStateRef;
+ if (!oldref)
+ return SNMPERR_SUCCESS;
+
+ newref = SNMP_MALLOC_TYPEDEF(netsnmp_tsmSecurityReference);
+ DEBUGMSGTL(("tsm", "cloned as pdu=%p, ref=%p (oldref=%p)\n",
+ pdu2, newref, pdu2->securityStateRef));
+ if (!newref)
+ return SNMPERR_GENERR;
+
+ memcpy(newref, oldref, sizeof(*oldref));
+
+ pdu2->securityStateRef = newref;
+
+ /* the tm state reference is just a link to the one in the pdu,
+ which was already copied by snmp_clone_pdu before handing it to
+ us. */
+
+ memdup((u_char **) &newref->tmStateRef, oldref->tmStateRef,
+ sizeof(*oldref->tmStateRef));
+ return SNMPERR_SUCCESS;
+}
+
+/* asn.1 easing definitions */
+#define TSMBUILD_OR_ERR(fun, args, msg, desc) \
+ DEBUGDUMPHEADER("send", desc); \
+ rc = fun args; \
+ DEBUGINDENTLESS(); \
+ if (rc == 0) { \
+ DEBUGMSGTL(("tsm",msg)); \
+ retval = SNMPERR_TOO_LONG; \
+ goto outerr; \
+ }
+
+/****************************************************************************
+ *
+ * tsm_generate_out_msg
+ *
+ * Parameters:
+ * (See list below...)
+ *
+ * Returns:
+ * SNMPERR_SUCCESS On success.
+ * ... and others
+ *
+ *
+ * Generate an outgoing message.
+ *
+ ****************************************************************************/
+
+int
+tsm_rgenerate_out_msg(struct snmp_secmod_outgoing_params *parms)
+{
+ u_char **wholeMsg = parms->wholeMsg;
+ size_t *offset = parms->wholeMsgOffset;
+ int rc;
+
+ size_t *wholeMsgLen = parms->wholeMsgLen;
+ netsnmp_tsmSecurityReference *tsmSecRef;
+ netsnmp_tmStateReference *tmStateRef;
+ int tmStateRefLocal = 0;
+
+ DEBUGMSGTL(("tsm", "Starting TSM processing\n"));
+
+ /* if we have this, then this message to be sent is in response to
+ something that came in earlier and the tsmSecRef was created by
+ the tsm_process_in_msg. */
+ tsmSecRef = parms->secStateRef;
+
+ if (tsmSecRef) {
+ /* 4.2, step 1: If there is a securityStateReference (Response
+ or Report message), then this Security Model uses the
+ cached information rather than the information provided by
+ the ASI. */
+
+ /* 4.2, step 1: Extract the tmStateReference from the
+ securityStateReference cache. */
+ netsnmp_assert_or_return(NULL != tsmSecRef->tmStateRef, SNMPERR_GENERR);
+ tmStateRef = tsmSecRef->tmStateRef;
+
+ /* 4.2 step 1: Set the tmRequestedSecurityLevel to the value
+ of the extracted tmTransportSecurityLevel. */
+ tmStateRef->requestedSecurityLevel = tmStateRef->transportSecurityLevel;
+
+ /* 4.2 step 1: Set the tmSameSecurity parameter in the
+ tmStateReference cache to true. */
+ tmStateRef->sameSecurity = NETSNMP_TM_USE_SAME_SECURITY;
+
+ /* 4.2 step 1: The cachedSecurityData for this message can
+ now be discarded. */
+ SNMP_FREE(parms->secStateRef);
+ } else {
+ /* 4.2, step 2: If there is no securityStateReference (e.g., a
+ Request-type or Notification message), then create a
+ tmStateReference cache. */
+ tmStateRef = SNMP_MALLOC_TYPEDEF(netsnmp_tmStateReference);
+ netsnmp_assert_or_return(NULL != tmStateRef, SNMPERR_GENERR);
+ tmStateRefLocal = 1;
+
+ /* XXX: we don't actually use this really in our implementation */
+ /* 4.2, step 2: Set tmTransportDomain to the value of
+ transportDomain, tmTransportAddress to the value of
+ transportAddress */
+
+ /* 4.2, step 2: and tmRequestedSecurityLevel to the value of
+ securityLevel. */
+ tmStateRef->requestedSecurityLevel = parms->secLevel;
+
+ /* 4.2, step 2: Set the transaction-specific tmSameSecurity
+ parameter to false. */
+ tmStateRef->sameSecurity = NETSNMP_TM_SAME_SECURITY_NOT_REQUIRED;
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TSM_USE_PREFIX)) {
+ /* XXX: probably shouldn't be a hard-coded list of
+ supported transports */
+ /* 4.2, step 2: If the snmpTsmConfigurationUsePrefix
+ object is set to true, then use the transportDomain to
+ look up the corresponding prefix. */
+ const char *prefix;
+ if (strncmp("ssh:",parms->session->peername,4) == 0)
+ prefix = "ssh:";
+ else if (strncmp("dtls:",parms->session->peername,5) == 0)
+ prefix = "dtls:";
+ else if (strncmp("tls:",parms->session->peername,4) == 0)
+ prefix = "tls:";
+ else {
+ /* 4.2, step 2: If the prefix lookup fails for any
+ reason, then the snmpTsmUnknownPrefixes counter is
+ incremented, an error indication is returned to the
+ calling module, and message processing stops. */
+ snmp_increment_statistic(STAT_TSM_SNMPTSMUNKNOWNPREFIXES);
+ SNMP_FREE(tmStateRef);
+ return SNMPERR_GENERR;
+ }
+
+ /* 4.2, step 2: If the lookup succeeds, but there is no
+ prefix in the securityName, or the prefix returned does
+ not match the prefix in the securityName, or the length
+ of the prefix is less than 1 or greater than 4 US-ASCII
+ alpha-numeric characters, then the
+ snmpTsmInvalidPrefixes counter is incremented, an error
+ indication is returned to the calling module, and
+ message processing stops. */
+ if (strchr(parms->secName, ':') == 0 ||
+ strlen(prefix)+1 >= parms->secNameLen ||
+ strncmp(parms->secName, prefix, strlen(prefix)) != 0 ||
+ parms->secName[strlen(prefix)] != ':') {
+ /* Note: since we're assiging the prefixes above the
+ prefix lengths always meet the 1-4 criteria */
+ snmp_increment_statistic(STAT_TSM_SNMPTSMINVALIDPREFIXES);
+ SNMP_FREE(tmStateRef);
+ return SNMPERR_GENERR;
+ }
+
+ /* 4.2, step 2: Strip the transport-specific prefix and
+ trailing ':' character (US-ASCII 0x3a) from the
+ securityName. Set tmSecurityName to the value of
+ securityName. */
+ memcpy(tmStateRef->securityName,
+ parms->secName + strlen(prefix) + 1,
+ parms->secNameLen - strlen(prefix) - 1);
+ tmStateRef->securityNameLen = parms->secNameLen - strlen(prefix) -1;
+ } else {
+ /* 4.2, step 2: If the snmpTsmConfigurationUsePrefix object is
+ set to false, then set tmSecurityName to the value
+ of securityName. */
+ memcpy(tmStateRef->securityName, parms->secName,
+ parms->secNameLen);
+ tmStateRef->securityNameLen = parms->secNameLen;
+ }
+ }
+
+ /* truncate the security name with a '\0' for safety */
+ tmStateRef->securityName[tmStateRef->securityNameLen] = '\0';
+
+ /* 4.2, step 3: Set securityParameters to a zero-length OCTET
+ * STRING ('0400').
+ */
+ DEBUGDUMPHEADER("send", "tsm security parameters");
+ rc = asn_realloc_rbuild_header(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR), 0);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ DEBUGMSGTL(("tsm", "building msgSecurityParameters failed.\n"));
+ if (tmStateRefLocal)
+ SNMP_FREE(tmStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ /* 4.2, step 4: Combine the message parts into a wholeMsg and
+ calculate wholeMsgLength.
+ */
+ while ((*wholeMsgLen - *offset) < parms->globalDataLen) {
+ if (!asn_realloc(wholeMsg, wholeMsgLen)) {
+ DEBUGMSGTL(("tsm", "building global data failed.\n"));
+ if (tmStateRefLocal)
+ SNMP_FREE(tmStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+ }
+
+ *offset += parms->globalDataLen;
+ memcpy(*wholeMsg + *wholeMsgLen - *offset,
+ parms->globalData, parms->globalDataLen);
+
+ /* 4.2, step 5: The wholeMsg, wholeMsgLength, securityParameters,
+ and tmStateReference are returned to the calling Message
+ Processing Model with the statusInformation set to success. */
+
+ /* For the Net-SNMP implemantion that actually means we start
+ encoding the full packet sequence from here before returning it */
+
+ /*
+ * Total packet sequence.
+ */
+ rc = asn_realloc_rbuild_sequence(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR), *offset);
+ if (rc == 0) {
+ DEBUGMSGTL(("tsm", "building master packet sequence failed.\n"));
+ if (tmStateRefLocal)
+ SNMP_FREE(tmStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ if (parms->pdu->transport_data &&
+ parms->pdu->transport_data != tmStateRef) {
+ snmp_log(LOG_ERR, "tsm: needed to free transport data\n");
+ SNMP_FREE(parms->pdu->transport_data);
+ }
+
+ /* put the transport state reference into the PDU for the transport */
+ if (SNMPERR_SUCCESS !=
+ memdup((u_char **) &parms->pdu->transport_data,
+ tmStateRef, sizeof(*tmStateRef))) {
+ snmp_log(LOG_ERR, "tsm: malloc failure\n");
+ }
+ parms->pdu->transport_data_length = sizeof(*tmStateRef);
+
+ if (tmStateRefLocal)
+ SNMP_FREE(tmStateRef);
+ DEBUGMSGTL(("tsm", "TSM processing completed.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+/****************************************************************************
+ *
+ * tsm_process_in_msg
+ *
+ * Parameters:
+ * (See list below...)
+ *
+ * Returns:
+ * TSM_ERR_NO_ERROR On success.
+ * TSM_ERR_GENERIC_ERROR
+ * TSM_ERR_UNSUPPORTED_SECURITY_LEVEL
+ *
+ *
+ * Processes an incoming message.
+ *
+ ****************************************************************************/
+
+int
+tsm_process_in_msg(struct snmp_secmod_incoming_params *parms)
+{
+ u_char type_value;
+ size_t remaining;
+ u_char *data_ptr;
+ netsnmp_tmStateReference *tmStateRef;
+ netsnmp_tsmSecurityReference *tsmSecRef;
+ u_char ourEngineID[SNMP_MAX_ENG_SIZE];
+ static size_t ourEngineID_len = sizeof(ourEngineID);
+
+ /* Section 5.2, step 1: Set the securityEngineID to the local
+ snmpEngineID. */
+ ourEngineID_len =
+ snmpv3_get_engineID((u_char*) ourEngineID, ourEngineID_len);
+ netsnmp_assert_or_return(ourEngineID_len != 0 &&
+ ourEngineID_len <= *parms->secEngineIDLen,
+ SNMPERR_GENERR);
+ memcpy(parms->secEngineID, ourEngineID, *parms->secEngineIDLen);
+
+ /* Section 5.2, step 2: If tmStateReference does not refer to a
+ cache containing values for tmTransportDomain,
+ tmTransportAddress, tmSecurityName, and
+ tmTransportSecurityLevel, then the snmpTsmInvalidCaches counter
+ is incremented, an error indication is returned to the calling
+ module, and Security Model processing stops for this
+ message. */
+ if (!parms->pdu->transport_data ||
+ sizeof(netsnmp_tmStateReference) !=
+ parms->pdu->transport_data_length) {
+ /* if we're not coming in over a proper transport; bail! */
+ DEBUGMSGTL(("tsm","improper transport data\n"));
+ return -1;
+ }
+ tmStateRef = (netsnmp_tmStateReference *) parms->pdu->transport_data;
+ parms->pdu->transport_data = NULL;
+
+ if (tmStateRef == NULL ||
+ /* not needed: tmStateRef->transportDomain == NULL || */
+ /* not needed: tmStateRef->transportAddress == NULL || */
+ tmStateRef->securityName[0] == '\0'
+ ) {
+ snmp_increment_statistic(STAT_TSM_SNMPTSMINVALIDCACHES);
+ return SNMPERR_GENERR;
+ }
+
+ /* Section 5.2, step 3: Copy the tmSecurityName to securityName. */
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TSM_USE_PREFIX)) {
+ /* Section 5.2, step 3:
+ If the snmpTsmConfigurationUsePrefix object is set to true, then
+ use the tmTransportDomain to look up the corresponding prefix.
+ */
+ const char *prefix = NULL;
+ /*
+ possibilities:
+ |--------------------+-------|
+ | snmpTLSTCPDomain | tls: |
+ | snmpDTLSUDPDomain | dtls: |
+ | snmpSSHDomain | ssh: |
+ |--------------------+-------|
+ */
+
+ if (tmStateRef->transportDomain == NULL) {
+ /* XXX: snmpTsmInvalidCaches++ ??? */
+ return SNMPERR_GENERR;
+ }
+
+ /* XXX: cache in session! */
+#ifdef NETSNMP_TRANSPORT_SSH_DOMAIN
+ if (netsnmp_oid_equals(netsnmp_snmpSSHDomain,
+ netsnmp_snmpSSHDomain_len,
+ tmStateRef->transportDomain,
+ tmStateRef->transportDomainLen) == 0) {
+ prefix = "ssh";
+ }
+#endif /* NETSNMP_TRANSPORT_SSH_DOMAIN */
+
+#ifdef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+ if (netsnmp_oid_equals(netsnmpDTLSUDPDomain,
+ netsnmpDTLSUDPDomain_len,
+ tmStateRef->transportDomain,
+ tmStateRef->transportDomainLen) == 0) {
+
+ prefix = "dtls";
+ }
+#endif /* NETSNMP_TRANSPORT_DTLSUDP_DOMAIN */
+
+#ifdef NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+ if (netsnmp_oid_equals(netsnmpTLSTCPDomain,
+ netsnmpTLSTCPDomain_len,
+ tmStateRef->transportDomain,
+ tmStateRef->transportDomainLen) == 0) {
+
+ prefix = "tls";
+ }
+#endif /* NETSNMP_TRANSPORT_TLSTCP_DOMAIN */
+
+ /* Section 5.2, step 3:
+ If the prefix lookup fails for any reason, then the
+ snmpTsmUnknownPrefixes counter is incremented, an error
+ indication is returned to the calling module, and message
+ processing stops.
+ */
+ if (prefix == NULL) {
+ snmp_increment_statistic(STAT_TSM_SNMPTSMUNKNOWNPREFIXES);
+ return SNMPERR_GENERR;
+ }
+
+ /* Section 5.2, step 3:
+ If the lookup succeeds but the prefix length is less than 1 or
+ greater than 4 octets, then the snmpTsmInvalidPrefixes counter
+ is incremented, an error indication is returned to the calling
+ module, and message processing stops.
+ */
+#ifdef NOT_USING_HARDCODED_PREFIXES
+ /* the above code actually ensures this will never happen as
+ we don't support a dynamic prefix database where this might
+ happen. */
+ if (strlen(prefix) < 1 || strlen(prefix) > 4) {
+ /* XXX: snmpTsmInvalidPrefixes++ */
+ return SNMPERR_GENERR;
+ }
+#endif
+
+ /* Section 5.2, step 3:
+ Set the securityName to be the concatenation of the prefix, a
+ ':' character (US-ASCII 0x3a), and the tmSecurityName.
+ */
+ snprintf(parms->secName, *parms->secNameLen,
+ "%s:%s", prefix, tmStateRef->securityName);
+ } else {
+ /* if the use prefix flag wasn't set, do a straight copy */
+ strncpy(parms->secName, tmStateRef->securityName, *parms->secNameLen);
+ }
+
+ /* set the length of the security name */
+ *parms->secNameLen = strlen(parms->secName);
+ DEBUGMSGTL(("tsm", "user: %s/%d\n", parms->secName, (int)*parms->secNameLen));
+
+ /* Section 5.2 Step 4:
+ Compare the value of tmTransportSecurityLevel in the
+ tmStateReference cache to the value of the securityLevel
+ parameter passed in the processIncomingMsg ASI. If securityLevel
+ specifies privacy (Priv) and tmTransportSecurityLevel specifies
+ no privacy (noPriv), or if securityLevel specifies authentication
+ (auth) and tmTransportSecurityLevel specifies no authentication
+ (noAuth) was provided by the Transport Model, then the
+ snmpTsmInadequateSecurityLevels counter is incremented, an error
+ indication (unsupportedSecurityLevel) together with the OID and
+ value of the incremented counter is returned to the calling
+ module, and Transport Security Model processing stops for this
+ message.*/
+ if (parms->secLevel > tmStateRef->transportSecurityLevel) {
+ snmp_increment_statistic(STAT_TSM_SNMPTSMINADEQUATESECURITYLEVELS);
+ DEBUGMSGTL(("tsm", "inadequate security level: %d\n", parms->secLevel));
+ /* net-snmp returns error codes not OIDs, which are dealt with later */
+ return SNMPERR_UNSUPPORTED_SEC_LEVEL;
+ }
+
+ /* Section 5.2 Step 5
+ The tmStateReference is cached as cachedSecurityData so that a
+ possible response to this message will use the same security
+ parameters. Then securityStateReference is set for subsequent
+ references to this cached data.
+ */
+ if (NULL == *parms->secStateRef) {
+ tsmSecRef = SNMP_MALLOC_TYPEDEF(netsnmp_tsmSecurityReference);
+ } else {
+ tsmSecRef = *parms->secStateRef;
+ }
+
+ netsnmp_assert_or_return(NULL != tsmSecRef, SNMPERR_GENERR);
+
+ *parms->secStateRef = tsmSecRef;
+ tsmSecRef->tmStateRef = tmStateRef;
+
+ /* If this did not come through a tunneled connection, this
+ security model is inappropriate (and would be a HUGE security
+ hole to assume otherwise). This is functionally a double check
+ since the pdu wouldn't have transport data otherwise. But this
+ is safer though is functionally an extra step beyond the TSM
+ RFC. */
+ DEBUGMSGTL(("tsm","checking how we got here\n"));
+ if (!(parms->pdu->flags & UCD_MSG_FLAG_TUNNELED)) {
+ DEBUGMSGTL(("tsm"," pdu not tunneled\n"));
+ if (!(parms->sess->flags & NETSNMP_TRANSPORT_FLAG_TUNNELED)) {
+ DEBUGMSGTL(("tsm"," session not tunneled\n"));
+ return SNMPERR_USM_AUTHENTICATIONFAILURE;
+ }
+ DEBUGMSGTL(("tsm"," but session is tunneled\n"));
+ } else {
+ DEBUGMSGTL(("tsm"," tunneled\n"));
+ }
+
+ /* Section 5.2, Step 6:
+ The scopedPDU component is extracted from the wholeMsg. */
+ /*
+ * Eat the first octet header.
+ */
+ remaining = parms->wholeMsgLen - (parms->secParams - parms->wholeMsg);
+ if ((data_ptr = asn_parse_sequence(parms->secParams, &remaining,
+ &type_value,
+ (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ "tsm first octet")) == NULL) {
+ /*
+ * RETURN parse error
+ */
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+
+ *parms->scopedPdu = data_ptr;
+ *parms->scopedPduLen = parms->wholeMsgLen - (data_ptr - parms->wholeMsg);
+
+ /* Section 5.2, Step 7:
+ The maxSizeResponseScopedPDU is calculated. This is the maximum
+ size allowed for a scopedPDU for a possible Response message.
+ */
+ *parms->maxSizeResponse = parms->maxMsgSize; /* XXX */
+
+ /* Section 5.2, Step 8:
+ The statusInformation is set to success and a return is made to
+ the calling module passing back the OUT parameters as specified
+ in the processIncomingMsg ASI.
+ */
+ return SNMPERR_SUCCESS;
+}
diff --git a/snmplib/snmpusm.c b/snmplib/snmpusm.c
new file mode 100644
index 0000000..d8d8932
--- /dev/null
+++ b/snmplib/snmpusm.c
@@ -0,0 +1,4668 @@
+/* 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.
+ */
+/*
+ * snmpusm.c
+ *
+ * Routines to manipulate a information about a "user" as
+ * defined by the SNMP-USER-BASED-SM-MIB MIB.
+ *
+ * All functions usm_set_usmStateReference_*() return 0 on success, -1
+ * otherwise.
+ *
+ * !! Tab stops set to 4 in some parts of this file. !!
+ * (Designated on a per function.)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <sys/types.h>
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.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_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/keytools.h>
+#include <net-snmp/library/snmpv3.h>
+#include <net-snmp/library/lcd_time.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/snmpusm.h>
+
+netsnmp_feature_child_of(usm_all, libnetsnmp)
+netsnmp_feature_child_of(usm_support, usm_all)
+
+netsnmp_feature_require(usm_support)
+
+oid usmNoAuthProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 1, 1 };
+#ifndef NETSNMP_DISABLE_MD5
+oid usmHMACMD5AuthProtocol[10] =
+ { 1, 3, 6, 1, 6, 3, 10, 1, 1, 2 };
+#endif
+oid usmHMACSHA1AuthProtocol[10] =
+ { 1, 3, 6, 1, 6, 3, 10, 1, 1, 3 };
+oid usmNoPrivProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 2, 1 };
+#ifndef NETSNMP_DISABLE_DES
+oid usmDESPrivProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 2, 2 };
+#endif
+oid usmAESPrivProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 2, 4 };
+/* backwards compat */
+oid *usmAES128PrivProtocol = usmAESPrivProtocol;
+
+static u_int dummy_etime, dummy_eboot; /* For ISENGINEKNOWN(). */
+
+/*
+ * Set up default snmpv3 parameter value storage.
+ */
+#ifdef NETSNMP_SECMOD_USM
+static const oid *defaultAuthType = NULL;
+static size_t defaultAuthTypeLen = 0;
+static const oid *defaultPrivType = NULL;
+static size_t defaultPrivTypeLen = 0;
+#endif /* NETSNMP_SECMOD_USM */
+
+/*
+ * Globals.
+ */
+static u_int salt_integer;
+#ifdef HAVE_AES
+static u_int salt_integer64_1, salt_integer64_2;
+#endif
+ /*
+ * 1/2 of seed for the salt. Cf. RFC2274, Sect 8.1.1.1.
+ */
+
+static struct usmUser *noNameUser = NULL;
+/*
+ * Local storage (LCD) of the default user list.
+ */
+static struct usmUser *userList = NULL;
+
+/*
+ * Prototypes
+ */
+int
+ usm_check_secLevel_vs_protocols(int level,
+ const oid * authProtocol,
+ u_int authProtocolLen,
+ const oid * privProtocol,
+ u_int privProtocolLen);
+int
+ usm_calc_offsets(size_t globalDataLen,
+ int secLevel, size_t secEngineIDLen,
+ size_t secNameLen, size_t scopedPduLen,
+ u_long engineboots, long engine_time,
+ size_t * theTotalLength,
+ size_t * authParamsOffset,
+ size_t * privParamsOffset,
+ size_t * dataOffset, size_t * datalen,
+ size_t * msgAuthParmLen,
+ size_t * msgPrivParmLen, size_t * otstlen,
+ size_t * seq_len, size_t * msgSecParmLen);
+/*
+ * Set a given field of the secStateRef.
+ *
+ * Allocate <len> bytes for type <type> pointed to by ref-><field>.
+ * Then copy in <item> and record its length in ref-><field_len>.
+ *
+ * Return 0 on success, -1 otherwise.
+ */
+#define MAKE_ENTRY( type, item, len, field, field_len ) \
+{ \
+ if (ref == NULL) \
+ return -1; \
+ if (ref->field != NULL) { \
+ SNMP_ZERO(ref->field, ref->field_len); \
+ SNMP_FREE(ref->field); \
+ } \
+ ref->field_len = 0; \
+ if (len == 0 || item == NULL) { \
+ return 0; \
+ } \
+ if ((ref->field = (type*) malloc (len * sizeof(type))) == NULL) \
+ { \
+ return -1; \
+ } \
+ \
+ memcpy (ref->field, item, len * sizeof(type)); \
+ ref->field_len = len; \
+ \
+ return 0; \
+}
+
+
+int
+free_enginetime_on_shutdown(int majorid, int minorid, void *serverarg,
+ void *clientarg)
+{
+ u_char engineID[SNMP_MAX_ENG_SIZE];
+ size_t engineID_len = sizeof(engineID);
+
+ DEBUGMSGTL(("snmpv3", "free enginetime callback called\n"));
+
+ engineID_len = snmpv3_get_engineID(engineID, engineID_len);
+ if (engineID_len > 0)
+ free_enginetime(engineID, engineID_len);
+ return 0;
+}
+
+struct usmStateReference *
+usm_malloc_usmStateReference(void)
+{
+ struct usmStateReference *retval = (struct usmStateReference *)
+ calloc(1, sizeof(struct usmStateReference));
+
+ return retval;
+} /* end usm_malloc_usmStateReference() */
+
+
+void
+usm_free_usmStateReference(void *old)
+{
+ struct usmStateReference *old_ref = (struct usmStateReference *) old;
+
+ if (old_ref) {
+
+ SNMP_FREE(old_ref->usr_name);
+ SNMP_FREE(old_ref->usr_engine_id);
+ SNMP_FREE(old_ref->usr_auth_protocol);
+ SNMP_FREE(old_ref->usr_priv_protocol);
+
+ if (old_ref->usr_auth_key) {
+ SNMP_ZERO(old_ref->usr_auth_key, old_ref->usr_auth_key_length);
+ SNMP_FREE(old_ref->usr_auth_key);
+ }
+ if (old_ref->usr_priv_key) {
+ SNMP_ZERO(old_ref->usr_priv_key, old_ref->usr_priv_key_length);
+ SNMP_FREE(old_ref->usr_priv_key);
+ }
+
+ SNMP_ZERO(old_ref, sizeof(*old_ref));
+ SNMP_FREE(old_ref);
+
+ }
+
+} /* end usm_free_usmStateReference() */
+
+struct usmUser *
+usm_get_userList(void)
+{
+ return userList;
+}
+
+int
+usm_set_usmStateReference_name(struct usmStateReference *ref,
+ char *name, size_t name_len)
+{
+ MAKE_ENTRY(char, name, name_len, usr_name, usr_name_length);
+}
+
+int
+usm_set_usmStateReference_engine_id(struct usmStateReference *ref,
+ u_char * engine_id,
+ size_t engine_id_len)
+{
+ MAKE_ENTRY(u_char, engine_id, engine_id_len,
+ usr_engine_id, usr_engine_id_length);
+}
+
+int
+usm_set_usmStateReference_auth_protocol(struct usmStateReference *ref,
+ oid * auth_protocol,
+ size_t auth_protocol_len)
+{
+ MAKE_ENTRY(oid, auth_protocol, auth_protocol_len,
+ usr_auth_protocol, usr_auth_protocol_length);
+}
+
+int
+usm_set_usmStateReference_auth_key(struct usmStateReference *ref,
+ u_char * auth_key, size_t auth_key_len)
+{
+ MAKE_ENTRY(u_char, auth_key, auth_key_len,
+ usr_auth_key, usr_auth_key_length);
+}
+
+int
+usm_set_usmStateReference_priv_protocol(struct usmStateReference *ref,
+ oid * priv_protocol,
+ size_t priv_protocol_len)
+{
+ MAKE_ENTRY(oid, priv_protocol, priv_protocol_len,
+ usr_priv_protocol, usr_priv_protocol_length);
+}
+
+int
+usm_set_usmStateReference_priv_key(struct usmStateReference *ref,
+ u_char * priv_key, size_t priv_key_len)
+{
+ MAKE_ENTRY(u_char, priv_key, priv_key_len,
+ usr_priv_key, usr_priv_key_length);
+}
+
+int
+usm_set_usmStateReference_sec_level(struct usmStateReference *ref,
+ int sec_level)
+{
+ if (ref == NULL)
+ return -1;
+ ref->usr_sec_level = sec_level;
+ return 0;
+}
+
+int
+usm_clone_usmStateReference(struct usmStateReference *from, struct usmStateReference **to)
+{
+ struct usmStateReference *cloned_usmStateRef;
+
+ if (from == NULL || to == NULL)
+ return -1;
+
+ *to = usm_malloc_usmStateReference();
+ cloned_usmStateRef = *to;
+
+ if (usm_set_usmStateReference_name(cloned_usmStateRef, from->usr_name, from->usr_name_length) ||
+ usm_set_usmStateReference_engine_id(cloned_usmStateRef, from->usr_engine_id, from->usr_engine_id_length) ||
+ usm_set_usmStateReference_auth_protocol(cloned_usmStateRef, from->usr_auth_protocol, from->usr_auth_protocol_length) ||
+ usm_set_usmStateReference_auth_key(cloned_usmStateRef, from->usr_auth_key, from->usr_auth_key_length) ||
+ usm_set_usmStateReference_priv_protocol(cloned_usmStateRef, from->usr_priv_protocol, from->usr_priv_protocol_length) ||
+ usm_set_usmStateReference_priv_key(cloned_usmStateRef, from->usr_priv_key, from->usr_priv_key_length) ||
+ usm_set_usmStateReference_sec_level(cloned_usmStateRef, from->usr_sec_level))
+ {
+ usm_free_usmStateReference(*to);
+ *to = NULL;
+ return -1;
+ }
+
+ return 0;
+
+}
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+/*******************************************************************-o-******
+ * emergency_print
+ *
+ * Parameters:
+ * *field
+ * length
+ *
+ * This is a print routine that is solely included so that it can be
+ * used in gdb. Don't use it as a function, it will be pulled before
+ * a real release of the code.
+ *
+ * tab stop 4
+ *
+ * XXX fflush() only works on FreeBSD; core dumps on Sun OS's
+ */
+void
+emergency_print(u_char * field, u_int length)
+{
+ int iindex;
+ int start = 0;
+ int stop = 25;
+
+ while (start < stop) {
+ for (iindex = start; iindex < stop; iindex++)
+ printf("%02X ", field[iindex]);
+
+ printf("\n");
+ start = stop;
+ stop = stop + 25 < length ? stop + 25 : length;
+ }
+ fflush(0);
+
+} /* end emergency_print() */
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+
+/*******************************************************************-o-******
+ * asn_predict_int_length
+ *
+ * Parameters:
+ * type (UNUSED)
+ * number
+ * len
+ *
+ * Returns:
+ * Number of bytes necessary to store the ASN.1 encoded value of 'number'.
+ *
+ *
+ * This gives the number of bytes that the ASN.1 encoder (in asn1.c) will
+ * use to encode a particular integer value.
+ *
+ * Returns the length of the integer -- NOT THE HEADER!
+ *
+ * Do this the same way as asn_build_int()...
+ */
+int
+asn_predict_int_length(int type, long number, size_t len)
+{
+ register u_long mask;
+
+
+ if (len != sizeof(long))
+ return -1;
+
+ mask = ((u_long) 0x1FF) << ((8 * (sizeof(long) - 1)) - 1);
+ /*
+ * mask is 0xFF800000 on a big-endian machine
+ */
+
+ while ((((number & mask) == 0) || ((number & mask) == mask))
+ && len > 1) {
+ len--;
+ number <<= 8;
+ }
+
+ return len;
+
+} /* end asn_predict_length() */
+
+
+
+
+/*******************************************************************-o-******
+ * asn_predict_length
+ *
+ * Parameters:
+ * type
+ * *ptr
+ * u_char_len
+ *
+ * Returns:
+ * Length in bytes: 1 + <n> + <u_char_len>, where
+ *
+ * 1 For the ASN.1 type.
+ * <n> # of bytes to store length of data.
+ * <u_char_len> Length of data associated with ASN.1 type.
+ *
+ * This gives the number of bytes that the ASN.1 encoder (in asn1.c) will
+ * use to encode a particular integer value. This is as broken as the
+ * currently used encoder.
+ *
+ * XXX How is <n> chosen, exactly??
+ */
+int
+asn_predict_length(int type, u_char * ptr, size_t u_char_len)
+{
+
+ if (type & ASN_SEQUENCE)
+ return 1 + 3 + u_char_len;
+
+ if (type & ASN_INTEGER) {
+ u_long value;
+ memcpy(&value, ptr, u_char_len);
+ u_char_len = asn_predict_int_length(type, value, u_char_len);
+ }
+
+ if (u_char_len < 0x80)
+ return 1 + 1 + u_char_len;
+ else if (u_char_len < 0xFF)
+ return 1 + 2 + u_char_len;
+ else
+ return 1 + 3 + u_char_len;
+
+} /* end asn_predict_length() */
+
+
+
+
+/*******************************************************************-o-******
+ * usm_calc_offsets
+ *
+ * Parameters:
+ * (See list below...)
+ *
+ * Returns:
+ * 0 On success,
+ * -1 Otherwise.
+ *
+ *
+ * This routine calculates the offsets into an outgoing message buffer
+ * for the necessary values. The outgoing buffer will generically
+ * look like this:
+ *
+ * SNMPv3 Message
+ * SEQ len[11]
+ * INT len version
+ * Header
+ * SEQ len
+ * INT len MsgID
+ * INT len msgMaxSize
+ * OST len msgFlags (OST = OCTET STRING)
+ * INT len msgSecurityModel
+ * MsgSecurityParameters
+ * [1] OST len[2]
+ * SEQ len[3]
+ * OST len msgAuthoritativeEngineID
+ * INT len msgAuthoritativeEngineBoots
+ * INT len msgAuthoritativeEngineTime
+ * OST len msgUserName
+ * OST len[4] [5] msgAuthenticationParameters
+ * OST len[6] [7] msgPrivacyParameters
+ * MsgData
+ * [8] OST len[9] [10] encryptedPDU
+ * or
+ * [8,10] SEQUENCE len[9] scopedPDU
+ * [12]
+ *
+ * The bracketed points will be needed to be identified ([x] is an index
+ * value, len[x] means a length value). Here is a semantic guide to them:
+ *
+ * [1] = globalDataLen (input)
+ * [2] = otstlen
+ * [3] = seq_len
+ * [4] = msgAuthParmLen (may be 0 or 12)
+ * [5] = authParamsOffset
+ * [6] = msgPrivParmLen (may be 0 or 8)
+ * [7] = privParamsOffset
+ * [8] = globalDataLen + msgSecParmLen
+ * [9] = datalen
+ * [10] = dataOffset
+ * [11] = theTotalLength - the length of the header itself
+ * [12] = theTotalLength
+ */
+int
+usm_calc_offsets(size_t globalDataLen, /* SNMPv3Message + HeaderData */
+ int secLevel, size_t secEngineIDLen, size_t secNameLen, size_t scopedPduLen, /* An BER encoded sequence. */
+ u_long engineboots, /* XXX (asn1.c works in long, not int.) */
+ long engine_time, /* XXX (asn1.c works in long, not int.) */
+ size_t * theTotalLength, /* globalDataLen + msgSecurityP. + msgData */
+ size_t * authParamsOffset, /* Distance to auth bytes. */
+ size_t * privParamsOffset, /* Distance to priv bytes. */
+ size_t * dataOffset, /* Distance to scopedPdu SEQ -or- the
+ * crypted (data) portion of msgData. */
+ size_t * datalen, /* Size of msgData OCTET STRING encoding. */
+ size_t * msgAuthParmLen, /* Size of msgAuthenticationParameters. */
+ size_t * msgPrivParmLen, /* Size of msgPrivacyParameters. */
+ size_t * otstlen, /* Size of msgSecurityP. O.S. encoding. */
+ size_t * seq_len, /* Size of msgSecurityP. SEQ data. */
+ size_t * msgSecParmLen)
+{ /* Size of msgSecurityP. SEQ. */
+ int engIDlen, /* Sizes of OCTET STRING and SEQ encodings */
+ engBtlen, /* for fields within */
+ engTmlen, /* msgSecurityParameters portion of */
+ namelen, /* SNMPv3Message. */
+ authlen, privlen, ret;
+
+ /*
+ * If doing authentication, msgAuthParmLen = 12 else msgAuthParmLen = 0.
+ * If doing encryption, msgPrivParmLen = 8 else msgPrivParmLen = 0.
+ */
+ *msgAuthParmLen = (secLevel == SNMP_SEC_LEVEL_AUTHNOPRIV
+ || secLevel == SNMP_SEC_LEVEL_AUTHPRIV) ? 12 : 0;
+
+ *msgPrivParmLen = (secLevel == SNMP_SEC_LEVEL_AUTHPRIV) ? 8 : 0;
+
+
+ /*
+ * Calculate lengths.
+ */
+ if ((engIDlen = asn_predict_length(ASN_OCTET_STR,
+ NULL, secEngineIDLen)) == -1) {
+ return -1;
+ }
+
+ if ((engBtlen = asn_predict_length(ASN_INTEGER,
+ (u_char *) & engineboots,
+ sizeof(long))) == -1) {
+ return -1;
+ }
+
+ if ((engTmlen = asn_predict_length(ASN_INTEGER,
+ (u_char *) & engine_time,
+ sizeof(long))) == -1) {
+ return -1;
+ }
+
+ if ((namelen = asn_predict_length(ASN_OCTET_STR,
+ NULL, secNameLen)) == -1) {
+ return -1;
+ }
+
+ if ((authlen = asn_predict_length(ASN_OCTET_STR,
+ NULL, *msgAuthParmLen)) == -1) {
+ return -1;
+ }
+
+ if ((privlen = asn_predict_length(ASN_OCTET_STR,
+ NULL, *msgPrivParmLen)) == -1) {
+ return -1;
+ }
+
+ *seq_len =
+ engIDlen + engBtlen + engTmlen + namelen + authlen + privlen;
+
+ if ((ret = asn_predict_length(ASN_SEQUENCE,
+ NULL, *seq_len)) == -1) {
+ return -1;
+ }
+ *otstlen = (size_t)ret;
+
+ if ((ret = asn_predict_length(ASN_OCTET_STR,
+ NULL, *otstlen)) == -1) {
+ return -1;
+ }
+ *msgSecParmLen = (size_t)ret;
+
+ *authParamsOffset = globalDataLen + +(*msgSecParmLen - *seq_len)
+ + engIDlen + engBtlen + engTmlen + namelen
+ + (authlen - *msgAuthParmLen);
+
+ *privParamsOffset = *authParamsOffset + *msgAuthParmLen
+ + (privlen - *msgPrivParmLen);
+
+
+ /*
+ * Compute the size of the plaintext. Round up to account for cipher
+ * block size, if necessary.
+ *
+ * XXX This is hardwired for 1DES... If scopedPduLen is already
+ * a multiple of 8, then *add* 8 more; otherwise, round up
+ * to the next multiple of 8.
+ *
+ * FIX Calculation of encrypted portion of msgData and consequent
+ * setting and sanity checking of theTotalLength, et al. should
+ * occur *after* encryption has taken place.
+ */
+ if (secLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ scopedPduLen = ROUNDUP8(scopedPduLen);
+
+ if ((ret = asn_predict_length(ASN_OCTET_STR, NULL, scopedPduLen)) == -1) {
+ return -1;
+ }
+ *datalen = (size_t)ret;
+ } else {
+ *datalen = scopedPduLen;
+ }
+
+ *dataOffset = globalDataLen + *msgSecParmLen +
+ (*datalen - scopedPduLen);
+ *theTotalLength = globalDataLen + *msgSecParmLen + *datalen;
+
+ return 0;
+
+} /* end usm_calc_offsets() */
+
+
+
+
+
+#ifndef NETSNMP_DISABLE_DES
+/*******************************************************************-o-******
+ * usm_set_salt
+ *
+ * Parameters:
+ * *iv (O) Buffer to contain IV.
+ * *iv_length (O) Length of iv.
+ * *priv_salt (I) Salt portion of private key.
+ * priv_salt_length (I) Length of priv_salt.
+ * *msgSalt (I/O) Pointer salt portion of outgoing msg buffer.
+ *
+ * Returns:
+ * 0 On success,
+ * -1 Otherwise.
+ *
+ * Determine the initialization vector for the DES-CBC encryption.
+ * (Cf. RFC 2274, 8.1.1.1.)
+ *
+ * iv is defined as the concatenation of engineBoots and the
+ * salt integer.
+ * The salt integer is incremented.
+ * The resulting salt is copied into the msgSalt buffer.
+ * The result of the concatenation is then XORed with the salt
+ * portion of the private key (last 8 bytes).
+ * The IV result is returned individually for further use.
+ */
+int
+usm_set_salt(u_char * iv,
+ size_t * iv_length,
+ u_char * priv_salt, size_t priv_salt_length, u_char * msgSalt)
+{
+ size_t propersize_salt = BYTESIZE(USM_DES_SALT_LENGTH);
+ int net_boots;
+ int net_salt_int;
+ /*
+ * net_* should be encoded in network byte order. XXX Why?
+ */
+ int iindex;
+
+
+ /*
+ * Sanity check.
+ */
+ if (!iv || !iv_length || !priv_salt || (*iv_length != propersize_salt)
+ || (priv_salt_length < propersize_salt)) {
+ return -1;
+ }
+
+
+ net_boots = htonl(snmpv3_local_snmpEngineBoots());
+ net_salt_int = htonl(salt_integer);
+
+ salt_integer += 1;
+
+ memcpy(iv, &net_boots, propersize_salt / 2);
+ memcpy(iv + (propersize_salt / 2), &net_salt_int, propersize_salt / 2);
+
+ if (msgSalt)
+ memcpy(msgSalt, iv, propersize_salt);
+
+
+ /*
+ * Turn the salt into an IV: XOR <boots, salt_int> with salt
+ * portion of priv_key.
+ */
+ for (iindex = 0; iindex < (int) propersize_salt; iindex++)
+ iv[iindex] ^= priv_salt[iindex];
+
+
+ return 0;
+
+} /* end usm_set_salt() */
+#endif
+
+#ifdef HAVE_AES
+/*******************************************************************-o-******
+ * usm_set_aes_iv
+ *
+ * Parameters:
+ * *iv (O) Buffer to contain IV.
+ * *iv_length (O) Length of iv.
+ * net_boots (I) the network byte order of the authEng boots val
+ * net_time (I) the network byte order of the authEng time val
+ * *salt (O) A buffer for the outgoing salt (= 8 bytes of iv)
+ *
+ * Returns:
+ * 0 On success,
+ * -1 Otherwise.
+ *
+ * Determine the initialization vector for AES encryption.
+ * (draft-blumenthal-aes-usm-03.txt, 3.1.2.2)
+ *
+ * iv is defined as the concatenation of engineBoots, engineTime
+ and a 64 bit salt-integer.
+ * The 64 bit salt integer is incremented.
+ * The resulting salt is copied into the salt buffer.
+ * The IV result is returned individually for further use.
+ */
+int
+usm_set_aes_iv(u_char * iv,
+ size_t * iv_length,
+ u_int net_boots,
+ u_int net_time,
+ u_char * salt)
+{
+ /*
+ * net_* should be encoded in network byte order.
+ */
+ int net_salt_int1, net_salt_int2;
+#define PROPER_AES_IV_SIZE 64
+
+ /*
+ * Sanity check.
+ */
+ if (!iv || !iv_length) {
+ return -1;
+ }
+
+ net_salt_int1 = htonl(salt_integer64_1);
+ net_salt_int2 = htonl(salt_integer64_2);
+
+ if ((salt_integer64_2 += 1) == 0)
+ salt_integer64_2 += 1;
+
+ /* XXX: warning: hard coded proper lengths */
+ memcpy(iv, &net_boots, 4);
+ memcpy(iv+4, &net_time, 4);
+ memcpy(iv+8, &net_salt_int1, 4);
+ memcpy(iv+12, &net_salt_int2, 4);
+
+ memcpy(salt, iv+8, 8); /* only copy the needed portion */
+ return 0;
+} /* end usm_set_salt() */
+#endif /* HAVE_AES */
+
+int
+usm_secmod_generate_out_msg(struct snmp_secmod_outgoing_params *parms)
+{
+ if (!parms)
+ return SNMPERR_GENERR;
+
+ return usm_generate_out_msg(parms->msgProcModel,
+ parms->globalData, parms->globalDataLen,
+ parms->maxMsgSize, parms->secModel,
+ parms->secEngineID, parms->secEngineIDLen,
+ parms->secName, parms->secNameLen,
+ parms->secLevel,
+ parms->scopedPdu, parms->scopedPduLen,
+ parms->secStateRef,
+ parms->secParams, parms->secParamsLen,
+ parms->wholeMsg, parms->wholeMsgLen);
+}
+
+/*******************************************************************-o-******
+ * usm_generate_out_msg
+ *
+ * Parameters:
+ * (See list below...)
+ *
+ * Returns:
+ * SNMPERR_SUCCESS On success.
+ * SNMPERR_USM_AUTHENTICATIONFAILURE
+ * SNMPERR_USM_ENCRYPTIONERROR
+ * SNMPERR_USM_GENERICERROR
+ * SNMPERR_USM_UNKNOWNSECURITYNAME
+ * SNMPERR_USM_GENERICERROR
+ * SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL
+ *
+ *
+ * Generates an outgoing message.
+ *
+ * XXX Beware of misnomers!
+ */
+int
+usm_generate_out_msg(int msgProcModel, /* (UNUSED) */
+ u_char * globalData, /* IN */
+ /*
+ * Pointer to msg header data will point to the beginning
+ * * of the entire packet buffer to be transmitted on wire,
+ * * memory will be contiguous with secParams, typically
+ * * this pointer will be passed back as beginning of
+ * * wholeMsg below. asn seq. length is updated w/ new length.
+ * *
+ * * While this points to a buffer that should be big enough
+ * * for the whole message, only the first two parts
+ * * of the message are completed, namely SNMPv3Message and
+ * * HeaderData. globalDataLen (next parameter) represents
+ * * the length of these two completed parts.
+ */
+ size_t globalDataLen, /* IN - Length of msg header data. */
+ int maxMsgSize, /* (UNUSED) */
+ int secModel, /* (UNUSED) */
+ u_char * secEngineID, /* IN - Pointer snmpEngineID. */
+ size_t secEngineIDLen, /* IN - SnmpEngineID length. */
+ char *secName, /* IN - Pointer to securityName. */
+ size_t secNameLen, /* IN - SecurityName length. */
+ int secLevel, /* IN - AuthNoPriv, authPriv etc. */
+ u_char * scopedPdu, /* IN */
+ /*
+ * Pointer to scopedPdu will be encrypted by USM if needed
+ * * and written to packet buffer immediately following
+ * * securityParameters, entire msg will be authenticated by
+ * * USM if needed.
+ */
+ size_t scopedPduLen, /* IN - scopedPdu length. */
+ void *secStateRef, /* IN */
+ /*
+ * secStateRef, pointer to cached info provided only for
+ * * Response, otherwise NULL.
+ */
+ u_char * secParams, /* OUT */
+ /*
+ * BER encoded securityParameters pointer to offset within
+ * * packet buffer where secParams should be written, the
+ * * entire BER encoded OCTET STRING (including header) is
+ * * written here by USM secParams = globalData +
+ * * globalDataLen.
+ */
+ size_t * secParamsLen, /* IN/OUT - Len available, len returned. */
+ u_char ** wholeMsg, /* OUT */
+ /*
+ * Complete authenticated/encrypted message - typically
+ * * the pointer to start of packet buffer provided in
+ * * globalData is returned here, could also be a separate
+ * * buffer.
+ */
+ size_t * wholeMsgLen)
+{ /* IN/OUT - Len available, len returned. */
+ size_t otstlen;
+ size_t seq_len;
+ size_t msgAuthParmLen;
+ size_t msgPrivParmLen;
+ size_t msgSecParmLen;
+ size_t authParamsOffset;
+ size_t privParamsOffset;
+ size_t datalen;
+ size_t dataOffset;
+ size_t theTotalLength;
+
+ u_char *ptr;
+ size_t ptr_len;
+ size_t remaining;
+ size_t offSet;
+ u_int boots_uint;
+ u_int time_uint;
+ long boots_long;
+ long time_long;
+
+ /*
+ * Indirection because secStateRef values override parameters.
+ *
+ * None of these are to be free'd - they are either pointing to
+ * what's in the secStateRef or to something either in the
+ * actual prarmeter list or the user list.
+ */
+
+ char *theName = NULL;
+ u_int theNameLength = 0;
+ u_char *theEngineID = NULL;
+ u_int theEngineIDLength = 0;
+ u_char *theAuthKey = NULL;
+ u_int theAuthKeyLength = 0;
+ const oid *theAuthProtocol = NULL;
+ u_int theAuthProtocolLength = 0;
+ u_char *thePrivKey = NULL;
+ u_int thePrivKeyLength = 0;
+ const oid *thePrivProtocol = NULL;
+ u_int thePrivProtocolLength = 0;
+ int theSecLevel = 0; /* No defined const for bad
+ * value (other then err).
+ */
+
+ DEBUGMSGTL(("usm", "USM processing has begun.\n"));
+
+ if (secStateRef != NULL) {
+ /*
+ * To hush the compiler for now. XXX
+ */
+ struct usmStateReference *ref
+ = (struct usmStateReference *) secStateRef;
+
+ theName = ref->usr_name;
+ theNameLength = ref->usr_name_length;
+ theEngineID = ref->usr_engine_id;
+ theEngineIDLength = ref->usr_engine_id_length;
+
+ if (!theEngineIDLength) {
+ theEngineID = secEngineID;
+ theEngineIDLength = secEngineIDLen;
+ }
+
+ theAuthProtocol = ref->usr_auth_protocol;
+ theAuthProtocolLength = ref->usr_auth_protocol_length;
+ theAuthKey = ref->usr_auth_key;
+ theAuthKeyLength = ref->usr_auth_key_length;
+ thePrivProtocol = ref->usr_priv_protocol;
+ thePrivProtocolLength = ref->usr_priv_protocol_length;
+ thePrivKey = ref->usr_priv_key;
+ thePrivKeyLength = ref->usr_priv_key_length;
+ theSecLevel = ref->usr_sec_level;
+ }
+
+ /*
+ * Identify the user record.
+ */
+ else {
+ struct usmUser *user;
+
+ /*
+ * we do allow an unknown user name for
+ * unauthenticated requests.
+ */
+ if ((user = usm_get_user(secEngineID, secEngineIDLen, secName))
+ == NULL && secLevel != SNMP_SEC_LEVEL_NOAUTH) {
+ DEBUGMSGTL(("usm", "Unknown User(%s)\n", secName));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_UNKNOWNSECURITYNAME;
+ }
+
+ theName = secName;
+ theNameLength = secNameLen;
+ theEngineID = secEngineID;
+ theSecLevel = secLevel;
+ theEngineIDLength = secEngineIDLen;
+ if (user) {
+ theAuthProtocol = user->authProtocol;
+ theAuthProtocolLength = user->authProtocolLen;
+ theAuthKey = user->authKey;
+ theAuthKeyLength = user->authKeyLen;
+ thePrivProtocol = user->privProtocol;
+ thePrivProtocolLength = user->privProtocolLen;
+ thePrivKey = user->privKey;
+ thePrivKeyLength = user->privKeyLen;
+ } else {
+ /*
+ * unknown users can not do authentication (obviously)
+ */
+ theAuthProtocol = usmNoAuthProtocol;
+ theAuthProtocolLength =
+ sizeof(usmNoAuthProtocol) / sizeof(oid);
+ theAuthKey = NULL;
+ theAuthKeyLength = 0;
+ thePrivProtocol = usmNoPrivProtocol;
+ thePrivProtocolLength =
+ sizeof(usmNoPrivProtocol) / sizeof(oid);
+ thePrivKey = NULL;
+ thePrivKeyLength = 0;
+ }
+ } /* endif -- secStateRef==NULL */
+
+
+ /*
+ * From here to the end of the function, avoid reference to
+ * secName, secEngineID, secLevel, and associated lengths.
+ */
+
+
+ /*
+ * Check to see if the user can use the requested sec services.
+ */
+ if (usm_check_secLevel_vs_protocols(theSecLevel,
+ theAuthProtocol,
+ theAuthProtocolLength,
+ thePrivProtocol,
+ thePrivProtocolLength) == 1) {
+ DEBUGMSGTL(("usm", "Unsupported Security Level (%d)\n",
+ theSecLevel));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL;
+ }
+
+
+ /*
+ * Retrieve the engine information.
+ *
+ * XXX No error is declared in the EoP when sending messages to
+ * unknown engines, processing continues w/ boots/time == (0,0).
+ */
+ if (get_enginetime(theEngineID, theEngineIDLength,
+ &boots_uint, &time_uint, FALSE) == -1) {
+ DEBUGMSGTL(("usm", "%s\n", "Failed to find engine data."));
+ }
+
+ boots_long = boots_uint;
+ time_long = time_uint;
+
+
+ /*
+ * Set up the Offsets.
+ */
+ if (usm_calc_offsets(globalDataLen, theSecLevel, theEngineIDLength,
+ theNameLength, scopedPduLen, boots_long,
+ time_long, &theTotalLength, &authParamsOffset,
+ &privParamsOffset, &dataOffset, &datalen,
+ &msgAuthParmLen, &msgPrivParmLen, &otstlen,
+ &seq_len, &msgSecParmLen) == -1) {
+ DEBUGMSGTL(("usm", "Failed calculating offsets.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ /*
+ * So, we have the offsets for the three parts that need to be
+ * determined, and an overall length. Now we need to make
+ * sure all of this would fit in the outgoing buffer, and
+ * whether or not we need to make a new buffer, etc.
+ */
+
+
+ /*
+ * Set wholeMsg as a pointer to globalData. Sanity check for
+ * the proper size.
+ *
+ * Mark workspace in the message with bytes of all 1's to make it
+ * easier to find mistakes in raw message dumps.
+ */
+ ptr = *wholeMsg = globalData;
+ if (theTotalLength > *wholeMsgLen) {
+ DEBUGMSGTL(("usm", "Message won't fit in buffer.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ ptr_len = *wholeMsgLen = theTotalLength;
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ memset(&ptr[globalDataLen], 0xFF, theTotalLength - globalDataLen);
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+ /*
+ * Do the encryption.
+ */
+ if (theSecLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ size_t encrypted_length = theTotalLength - dataOffset;
+ size_t salt_length = BYTESIZE(USM_MAX_SALT_LENGTH);
+ u_char salt[BYTESIZE(USM_MAX_SALT_LENGTH)];
+
+ /*
+ * XXX Hardwired to seek into a 1DES private key!
+ */
+#ifdef HAVE_AES
+ if (ISTRANSFORM(thePrivProtocol, AESPriv)) {
+ if (!thePrivKey ||
+ usm_set_aes_iv(salt, &salt_length,
+ htonl(boots_uint), htonl(time_uint),
+ &ptr[privParamsOffset]) == -1) {
+ DEBUGMSGTL(("usm", "Can't set AES iv.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_GENERICERROR;
+ }
+ }
+#endif
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(thePrivProtocol, DESPriv)) {
+ if (!thePrivKey ||
+ (usm_set_salt(salt, &salt_length,
+ thePrivKey + 8, thePrivKeyLength - 8,
+ &ptr[privParamsOffset])
+ == -1)) {
+ DEBUGMSGTL(("usm", "Can't set DES-CBC salt.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_GENERICERROR;
+ }
+ }
+#endif
+
+ if (sc_encrypt(thePrivProtocol, thePrivProtocolLength,
+ thePrivKey, thePrivKeyLength,
+ salt, salt_length,
+ scopedPdu, scopedPduLen,
+ &ptr[dataOffset], &encrypted_length)
+ != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("usm", "encryption error.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_ENCRYPTIONERROR;
+ }
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ if (debug_is_token_registered("usm/dump") == SNMPERR_SUCCESS) {
+ dump_chunk("usm/dump", "This data was encrypted:",
+ scopedPdu, scopedPduLen);
+ dump_chunk("usm/dump", "salt + Encrypted form:",
+ salt, salt_length);
+ dump_chunk("usm/dump", NULL,
+ &ptr[dataOffset], encrypted_length);
+ dump_chunk("usm/dump", "*wholeMsg:",
+ *wholeMsg, theTotalLength);
+ }
+#endif
+
+
+ ptr = *wholeMsg;
+ ptr_len = *wholeMsgLen = theTotalLength;
+
+
+ /*
+ * XXX Sanity check for salt length should be moved up
+ * under usm_calc_offsets() or tossed.
+ */
+ if ((encrypted_length != (theTotalLength - dataOffset))
+ || (salt_length != msgPrivParmLen)) {
+ DEBUGMSGTL(("usm", "encryption length error.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_ENCRYPTIONERROR;
+ }
+
+ DEBUGMSGTL(("usm", "Encryption successful.\n"));
+ }
+
+ /*
+ * No encryption for you!
+ */
+ else {
+ memcpy(&ptr[dataOffset], scopedPdu, scopedPduLen);
+ }
+
+
+
+ /*
+ * Start filling in the other fields (in prep for authentication).
+ *
+ * offSet is an octet string header, which is different from all
+ * the other headers.
+ */
+ remaining = ptr_len - globalDataLen;
+
+ offSet = ptr_len - remaining;
+ asn_build_header(&ptr[offSet], &remaining,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), otstlen);
+
+ offSet = ptr_len - remaining;
+ asn_build_sequence(&ptr[offSet], &remaining,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), seq_len);
+
+ offSet = ptr_len - remaining;
+ DEBUGDUMPHEADER("send", "msgAuthoritativeEngineID");
+ asn_build_string(&ptr[offSet], &remaining,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), theEngineID,
+ theEngineIDLength);
+ DEBUGINDENTLESS();
+
+ offSet = ptr_len - remaining;
+ DEBUGDUMPHEADER("send", "msgAuthoritativeEngineBoots");
+ asn_build_int(&ptr[offSet], &remaining,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),
+ &boots_long, sizeof(long));
+ DEBUGINDENTLESS();
+
+ offSet = ptr_len - remaining;
+ DEBUGDUMPHEADER("send", "msgAuthoritativeEngineTime");
+ asn_build_int(&ptr[offSet], &remaining,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),
+ &time_long, sizeof(long));
+ DEBUGINDENTLESS();
+
+ offSet = ptr_len - remaining;
+ DEBUGDUMPHEADER("send", "msgUserName");
+ asn_build_string(&ptr[offSet], &remaining,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), (u_char *) theName,
+ theNameLength);
+ DEBUGINDENTLESS();
+
+
+ /*
+ * Note: if there is no authentication being done,
+ * msgAuthParmLen is 0, and there is no effect (other than
+ * inserting a zero-length header) of the following
+ * statements.
+ */
+
+ offSet = ptr_len - remaining;
+ asn_build_header(&ptr[offSet],
+ &remaining,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), msgAuthParmLen);
+
+ if (theSecLevel == SNMP_SEC_LEVEL_AUTHNOPRIV
+ || theSecLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ offSet = ptr_len - remaining;
+ memset(&ptr[offSet], 0, msgAuthParmLen);
+ }
+
+ remaining -= msgAuthParmLen;
+
+
+ /*
+ * Note: if there is no encryption being done, msgPrivParmLen
+ * is 0, and there is no effect (other than inserting a
+ * zero-length header) of the following statements.
+ */
+
+ offSet = ptr_len - remaining;
+ asn_build_header(&ptr[offSet],
+ &remaining,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR), msgPrivParmLen);
+
+ remaining -= msgPrivParmLen; /* Skipping the IV already there. */
+
+
+ /*
+ * For privacy, need to add the octet string header for it.
+ */
+ if (theSecLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ offSet = ptr_len - remaining;
+ asn_build_header(&ptr[offSet],
+ &remaining,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ theTotalLength - dataOffset);
+ }
+
+
+ /*
+ * Adjust overall length and store it as the first SEQ length
+ * of the SNMPv3Message.
+ *
+ * FIX 4 is a magic number!
+ */
+ remaining = theTotalLength;
+ asn_build_sequence(ptr, &remaining,
+ (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ theTotalLength - 4);
+
+
+ /*
+ * Now, time to consider / do authentication.
+ */
+ if (theSecLevel == SNMP_SEC_LEVEL_AUTHNOPRIV
+ || theSecLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ size_t temp_sig_len = msgAuthParmLen;
+ u_char *temp_sig = (u_char *) malloc(temp_sig_len);
+
+ if (temp_sig == NULL) {
+ DEBUGMSGTL(("usm", "Out of memory.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ if (sc_generate_keyed_hash(theAuthProtocol, theAuthProtocolLength,
+ theAuthKey, theAuthKeyLength,
+ ptr, ptr_len, temp_sig, &temp_sig_len)
+ != SNMP_ERR_NOERROR) {
+ /*
+ * FIX temp_sig_len defined?!
+ */
+ SNMP_ZERO(temp_sig, temp_sig_len);
+ SNMP_FREE(temp_sig);
+ DEBUGMSGTL(("usm", "Signing failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_AUTHENTICATIONFAILURE;
+ }
+
+ if (temp_sig_len != msgAuthParmLen) {
+ SNMP_ZERO(temp_sig, temp_sig_len);
+ SNMP_FREE(temp_sig);
+ DEBUGMSGTL(("usm", "Signing lengths failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_AUTHENTICATIONFAILURE;
+ }
+
+ memcpy(&ptr[authParamsOffset], temp_sig, msgAuthParmLen);
+
+ SNMP_ZERO(temp_sig, temp_sig_len);
+ SNMP_FREE(temp_sig);
+
+ }
+
+ /*
+ * endif -- create keyed hash
+ */
+ usm_free_usmStateReference(secStateRef);
+
+ DEBUGMSGTL(("usm", "USM processing completed.\n"));
+
+ return SNMPERR_SUCCESS;
+
+} /* end usm_generate_out_msg() */
+
+#ifdef NETSNMP_USE_REVERSE_ASNENCODING
+int
+usm_secmod_rgenerate_out_msg(struct snmp_secmod_outgoing_params *parms)
+{
+ if (!parms)
+ return SNMPERR_GENERR;
+
+ return usm_rgenerate_out_msg(parms->msgProcModel,
+ parms->globalData, parms->globalDataLen,
+ parms->maxMsgSize, parms->secModel,
+ parms->secEngineID, parms->secEngineIDLen,
+ parms->secName, parms->secNameLen,
+ parms->secLevel,
+ parms->scopedPdu, parms->scopedPduLen,
+ parms->secStateRef,
+ parms->wholeMsg, parms->wholeMsgLen,
+ parms->wholeMsgOffset);
+}
+
+int
+usm_rgenerate_out_msg(int msgProcModel, /* (UNUSED) */
+ u_char * globalData, /* IN */
+ /*
+ * points at the msgGlobalData, which is of length given by next
+ * parameter.
+ */
+ size_t globalDataLen, /* IN - Length of msg header data. */
+ int maxMsgSize, /* (UNUSED) */
+ int secModel, /* (UNUSED) */
+ u_char * secEngineID, /* IN - Pointer snmpEngineID. */
+ size_t secEngineIDLen, /* IN - SnmpEngineID length. */
+ char *secName, /* IN - Pointer to securityName. */
+ size_t secNameLen, /* IN - SecurityName length. */
+ int secLevel, /* IN - AuthNoPriv, authPriv etc. */
+ u_char * scopedPdu, /* IN */
+ /*
+ * Pointer to scopedPdu will be encrypted by USM if needed
+ * * and written to packet buffer immediately following
+ * * securityParameters, entire msg will be authenticated by
+ * * USM if needed.
+ */
+ size_t scopedPduLen, /* IN - scopedPdu length. */
+ void *secStateRef, /* IN */
+ /*
+ * secStateRef, pointer to cached info provided only for
+ * * Response, otherwise NULL.
+ */
+ u_char ** wholeMsg, /* IN/OUT */
+ /*
+ * Points at the pointer to the packet buffer, which might get extended
+ * if necessary via realloc().
+ */
+ size_t * wholeMsgLen, /* IN/OUT */
+ /*
+ * Length of the entire packet buffer, **not** the length of the
+ * packet.
+ */
+ size_t * offset /* IN/OUT */
+ /*
+ * Offset from the end of the packet buffer to the start of the packet,
+ * also known as the packet length.
+ */
+ )
+{
+ size_t msgAuthParmLen = 0;
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ size_t theTotalLength;
+#endif
+
+ u_int boots_uint;
+ u_int time_uint;
+ long boots_long;
+ long time_long;
+
+ /*
+ * Indirection because secStateRef values override parameters.
+ *
+ * None of these are to be free'd - they are either pointing to
+ * what's in the secStateRef or to something either in the
+ * actual parameter list or the user list.
+ */
+
+ char *theName = NULL;
+ u_int theNameLength = 0;
+ u_char *theEngineID = NULL;
+ u_int theEngineIDLength = 0;
+ u_char *theAuthKey = NULL;
+ u_int theAuthKeyLength = 0;
+ const oid *theAuthProtocol = NULL;
+ u_int theAuthProtocolLength = 0;
+ u_char *thePrivKey = NULL;
+ u_int thePrivKeyLength = 0;
+ const oid *thePrivProtocol = NULL;
+ u_int thePrivProtocolLength = 0;
+ int theSecLevel = 0; /* No defined const for bad
+ * value (other then err). */
+ size_t salt_length = 0, save_salt_length = 0;
+ u_char salt[BYTESIZE(USM_MAX_SALT_LENGTH)];
+ u_char authParams[USM_MAX_AUTHSIZE];
+ u_char iv[BYTESIZE(USM_MAX_SALT_LENGTH)];
+ size_t sp_offset = 0, mac_offset = 0;
+ int rc = 0;
+
+ DEBUGMSGTL(("usm", "USM processing has begun (offset %d)\n", (int)*offset));
+
+ if (secStateRef != NULL) {
+ /*
+ * To hush the compiler for now. XXX
+ */
+ struct usmStateReference *ref
+ = (struct usmStateReference *) secStateRef;
+
+ theName = ref->usr_name;
+ theNameLength = ref->usr_name_length;
+ theEngineID = ref->usr_engine_id;
+ theEngineIDLength = ref->usr_engine_id_length;
+
+ if (!theEngineIDLength) {
+ theEngineID = secEngineID;
+ theEngineIDLength = secEngineIDLen;
+ }
+
+ theAuthProtocol = ref->usr_auth_protocol;
+ theAuthProtocolLength = ref->usr_auth_protocol_length;
+ theAuthKey = ref->usr_auth_key;
+ theAuthKeyLength = ref->usr_auth_key_length;
+ thePrivProtocol = ref->usr_priv_protocol;
+ thePrivProtocolLength = ref->usr_priv_protocol_length;
+ thePrivKey = ref->usr_priv_key;
+ thePrivKeyLength = ref->usr_priv_key_length;
+ theSecLevel = ref->usr_sec_level;
+ }
+
+ /*
+ * * Identify the user record.
+ */
+ else {
+ struct usmUser *user;
+
+ /*
+ * we do allow an unknown user name for
+ * unauthenticated requests.
+ */
+ if ((user = usm_get_user(secEngineID, secEngineIDLen, secName))
+ == NULL && secLevel != SNMP_SEC_LEVEL_NOAUTH) {
+ DEBUGMSGTL(("usm", "Unknown User\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_UNKNOWNSECURITYNAME;
+ }
+
+ theName = secName;
+ theNameLength = secNameLen;
+ theEngineID = secEngineID;
+ theSecLevel = secLevel;
+ theEngineIDLength = secEngineIDLen;
+ if (user) {
+ theAuthProtocol = user->authProtocol;
+ theAuthProtocolLength = user->authProtocolLen;
+ theAuthKey = user->authKey;
+ theAuthKeyLength = user->authKeyLen;
+ thePrivProtocol = user->privProtocol;
+ thePrivProtocolLength = user->privProtocolLen;
+ thePrivKey = user->privKey;
+ thePrivKeyLength = user->privKeyLen;
+ } else {
+ /*
+ * unknown users can not do authentication (obviously)
+ */
+ theAuthProtocol = usmNoAuthProtocol;
+ theAuthProtocolLength =
+ sizeof(usmNoAuthProtocol) / sizeof(oid);
+ theAuthKey = NULL;
+ theAuthKeyLength = 0;
+ thePrivProtocol = usmNoPrivProtocol;
+ thePrivProtocolLength =
+ sizeof(usmNoPrivProtocol) / sizeof(oid);
+ thePrivKey = NULL;
+ thePrivKeyLength = 0;
+ }
+ } /* endif -- secStateRef==NULL */
+
+
+ /*
+ * From here to the end of the function, avoid reference to
+ * secName, secEngineID, secLevel, and associated lengths.
+ */
+
+
+ /*
+ * Check to see if the user can use the requested sec services.
+ */
+ if (usm_check_secLevel_vs_protocols(theSecLevel,
+ theAuthProtocol,
+ theAuthProtocolLength,
+ thePrivProtocol,
+ thePrivProtocolLength) == 1) {
+ DEBUGMSGTL(("usm", "Unsupported Security Level or type (%d)\n",
+ theSecLevel));
+
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL;
+ }
+
+
+ /*
+ * * Retrieve the engine information.
+ * *
+ * * XXX No error is declared in the EoP when sending messages to
+ * * unknown engines, processing continues w/ boots/time == (0,0).
+ */
+ if (get_enginetime(theEngineID, theEngineIDLength,
+ &boots_uint, &time_uint, FALSE) == -1) {
+ DEBUGMSGTL(("usm", "%s\n", "Failed to find engine data."));
+ }
+
+ boots_long = boots_uint;
+ time_long = time_uint;
+
+ if (theSecLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ /*
+ * Initially assume that the ciphertext will end up the same size as
+ * the plaintext plus some padding. Really sc_encrypt ought to be able
+ * to grow this for us, a la asn_realloc_rbuild_<type> functions, but
+ * this will do for now.
+ */
+ u_char *ciphertext = NULL;
+ size_t ciphertextlen = scopedPduLen + 64;
+
+ if ((ciphertext = (u_char *) malloc(ciphertextlen)) == NULL) {
+ DEBUGMSGTL(("usm",
+ "couldn't malloc %d bytes for encrypted PDU\n",
+ (int)ciphertextlen));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_MALLOC;
+ }
+
+ /*
+ * XXX Hardwired to seek into a 1DES private key!
+ */
+#ifdef HAVE_AES
+ if (ISTRANSFORM(thePrivProtocol, AESPriv)) {
+ salt_length = BYTESIZE(USM_AES_SALT_LENGTH);
+ save_salt_length = BYTESIZE(USM_AES_SALT_LENGTH)/2;
+ if (!thePrivKey ||
+ usm_set_aes_iv(salt, &salt_length,
+ htonl(boots_uint), htonl(time_uint),
+ iv) == -1) {
+ DEBUGMSGTL(("usm", "Can't set AES iv.\n"));
+ usm_free_usmStateReference(secStateRef);
+ SNMP_FREE(ciphertext);
+ return SNMPERR_USM_GENERICERROR;
+ }
+ }
+#endif
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(thePrivProtocol, DESPriv)) {
+ salt_length = BYTESIZE(USM_DES_SALT_LENGTH);
+ save_salt_length = BYTESIZE(USM_DES_SALT_LENGTH);
+ if (!thePrivKey || (usm_set_salt(salt, &salt_length,
+ thePrivKey + 8,
+ thePrivKeyLength - 8,
+ iv) == -1)) {
+ DEBUGMSGTL(("usm", "Can't set DES-CBC salt.\n"));
+ usm_free_usmStateReference(secStateRef);
+ SNMP_FREE(ciphertext);
+ return SNMPERR_USM_GENERICERROR;
+ }
+ }
+#endif
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ if (debug_is_token_registered("usm/dump") == SNMPERR_SUCCESS) {
+ dump_chunk("usm/dump", "This data was encrypted:",
+ scopedPdu, scopedPduLen);
+ }
+#endif
+
+ if (sc_encrypt(thePrivProtocol, thePrivProtocolLength,
+ thePrivKey, thePrivKeyLength,
+ salt, salt_length,
+ scopedPdu, scopedPduLen,
+ ciphertext, &ciphertextlen) != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("usm", "encryption error.\n"));
+ usm_free_usmStateReference(secStateRef);
+ SNMP_FREE(ciphertext);
+ return SNMPERR_USM_ENCRYPTIONERROR;
+ }
+
+ /*
+ * Write the encrypted scopedPdu back into the packet buffer.
+ */
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ theTotalLength = *wholeMsgLen;
+#endif
+ *offset = 0;
+ rc = asn_realloc_rbuild_string(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_UNIVERSAL |
+ ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ ciphertext, ciphertextlen);
+ if (rc == 0) {
+ DEBUGMSGTL(("usm", "Encryption failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ SNMP_FREE(ciphertext);
+ return SNMPERR_USM_ENCRYPTIONERROR;
+ }
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ if (debug_is_token_registered("usm/dump") == SNMPERR_SUCCESS) {
+ dump_chunk("usm/dump", "salt + Encrypted form: ", salt,
+ salt_length);
+ dump_chunk("usm/dump", "wholeMsg:",
+ (*wholeMsg + *wholeMsgLen - *offset), *offset);
+ }
+#endif
+
+ DEBUGMSGTL(("usm", "Encryption successful.\n"));
+ SNMP_FREE(ciphertext);
+ } else {
+ /*
+ * theSecLevel != SNMP_SEC_LEVEL_AUTHPRIV
+ */
+ }
+
+ /*
+ * Start encoding the msgSecurityParameters.
+ */
+
+ sp_offset = *offset;
+
+ DEBUGDUMPHEADER("send", "msgPrivacyParameters");
+ /*
+ * msgPrivacyParameters (warning: assumes DES salt).
+ */
+ rc = asn_realloc_rbuild_string(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR),
+ iv,
+ save_salt_length);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ DEBUGMSGTL(("usm", "building privParams failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ DEBUGDUMPHEADER("send", "msgAuthenticationParameters");
+ /*
+ * msgAuthenticationParameters (warnings assumes 0x00 by 12).
+ */
+ if (theSecLevel == SNMP_SEC_LEVEL_AUTHNOPRIV
+ || theSecLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ memset(authParams, 0, USM_MD5_AND_SHA_AUTH_LEN);
+ msgAuthParmLen = USM_MD5_AND_SHA_AUTH_LEN;
+ }
+
+ rc = asn_realloc_rbuild_string(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR), authParams,
+ msgAuthParmLen);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ DEBUGMSGTL(("usm", "building authParams failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ /*
+ * Remember where to put the actual HMAC we calculate later on. An
+ * encoded OCTET STRING of length USM_MD5_AND_SHA_AUTH_LEN has an ASN.1
+ * header of length 2, hence the fudge factor.
+ */
+
+ mac_offset = *offset - 2;
+
+ /*
+ * msgUserName.
+ */
+ DEBUGDUMPHEADER("send", "msgUserName");
+ rc = asn_realloc_rbuild_string(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR),
+ (u_char *) theName, theNameLength);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ DEBUGMSGTL(("usm", "building authParams failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ /*
+ * msgAuthoritativeEngineTime.
+ */
+ DEBUGDUMPHEADER("send", "msgAuthoritativeEngineTime");
+ rc = asn_realloc_rbuild_int(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &time_long,
+ sizeof(long));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ DEBUGMSGTL(("usm",
+ "building msgAuthoritativeEngineTime failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ /*
+ * msgAuthoritativeEngineBoots.
+ */
+ DEBUGDUMPHEADER("send", "msgAuthoritativeEngineBoots");
+ rc = asn_realloc_rbuild_int(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &boots_long,
+ sizeof(long));
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ DEBUGMSGTL(("usm",
+ "building msgAuthoritativeEngineBoots failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ DEBUGDUMPHEADER("send", "msgAuthoritativeEngineID");
+ rc = asn_realloc_rbuild_string(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR), theEngineID,
+ theEngineIDLength);
+ DEBUGINDENTLESS();
+ if (rc == 0) {
+ DEBUGMSGTL(("usm", "building msgAuthoritativeEngineID failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ /*
+ * USM msgSecurityParameters sequence header
+ */
+ rc = asn_realloc_rbuild_sequence(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR),
+ *offset - sp_offset);
+ if (rc == 0) {
+ DEBUGMSGTL(("usm", "building usm security parameters failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ /*
+ * msgSecurityParameters OCTET STRING wrapper.
+ */
+ rc = asn_realloc_rbuild_header(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR),
+ *offset - sp_offset);
+
+ if (rc == 0) {
+ DEBUGMSGTL(("usm", "building msgSecurityParameters failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ /*
+ * Copy in the msgGlobalData and msgVersion.
+ */
+ while ((*wholeMsgLen - *offset) < globalDataLen) {
+ if (!asn_realloc(wholeMsg, wholeMsgLen)) {
+ DEBUGMSGTL(("usm", "building global data failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+ }
+
+ *offset += globalDataLen;
+ memcpy(*wholeMsg + *wholeMsgLen - *offset, globalData, globalDataLen);
+
+ /*
+ * Total packet sequence.
+ */
+ rc = asn_realloc_rbuild_sequence(wholeMsg, wholeMsgLen, offset, 1,
+ (u_char) (ASN_SEQUENCE |
+ ASN_CONSTRUCTOR), *offset);
+ if (rc == 0) {
+ DEBUGMSGTL(("usm", "building master packet sequence failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_TOO_LONG;
+ }
+
+ /*
+ * Now consider / do authentication.
+ */
+
+ if (theSecLevel == SNMP_SEC_LEVEL_AUTHNOPRIV ||
+ theSecLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ size_t temp_sig_len = msgAuthParmLen;
+ u_char *temp_sig = (u_char *) malloc(temp_sig_len);
+ u_char *proto_msg = *wholeMsg + *wholeMsgLen - *offset;
+ size_t proto_msg_len = *offset;
+
+
+ if (temp_sig == NULL) {
+ DEBUGMSGTL(("usm", "Out of memory.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ if (sc_generate_keyed_hash(theAuthProtocol, theAuthProtocolLength,
+ theAuthKey, theAuthKeyLength,
+ proto_msg, proto_msg_len,
+ temp_sig, &temp_sig_len)
+ != SNMP_ERR_NOERROR) {
+ SNMP_FREE(temp_sig);
+ DEBUGMSGTL(("usm", "Signing failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_AUTHENTICATIONFAILURE;
+ }
+
+ if (temp_sig_len != msgAuthParmLen) {
+ SNMP_FREE(temp_sig);
+ DEBUGMSGTL(("usm", "Signing lengths failed.\n"));
+ usm_free_usmStateReference(secStateRef);
+ return SNMPERR_USM_AUTHENTICATIONFAILURE;
+ }
+
+ memcpy(*wholeMsg + *wholeMsgLen - mac_offset, temp_sig,
+ msgAuthParmLen);
+ SNMP_FREE(temp_sig);
+ }
+ /*
+ * endif -- create keyed hash
+ */
+ usm_free_usmStateReference(secStateRef);
+ DEBUGMSGTL(("usm", "USM processing completed.\n"));
+ return SNMPERR_SUCCESS;
+} /* end usm_rgenerate_out_msg() */
+
+#endif /* */
+
+
+
+/*******************************************************************-o-******
+ * usm_parse_security_parameters
+ *
+ * Parameters:
+ * (See list below...)
+ *
+ * Returns:
+ * 0 On success,
+ * -1 Otherwise.
+ *
+ * tab stop 4
+ *
+ * Extracts values from the security header and data portions of the
+ * incoming buffer.
+ */
+int
+usm_parse_security_parameters(u_char * secParams,
+ size_t remaining,
+ u_char * secEngineID,
+ size_t * secEngineIDLen,
+ u_int * boots_uint,
+ u_int * time_uint,
+ char *secName,
+ size_t * secNameLen,
+ u_char * signature,
+ size_t * signature_length,
+ u_char * salt,
+ size_t * salt_length, u_char ** data_ptr)
+{
+ u_char *parse_ptr = secParams;
+ u_char *value_ptr;
+ u_char *next_ptr;
+ u_char type_value;
+
+ size_t octet_string_length = remaining;
+ size_t sequence_length;
+ size_t remaining_bytes;
+
+ long boots_long;
+ long time_long;
+
+ u_int origNameLen;
+
+
+ /*
+ * Eat the first octet header.
+ */
+ if ((value_ptr = asn_parse_sequence(parse_ptr, &octet_string_length,
+ &type_value,
+ (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_OCTET_STR),
+ "usm first octet")) == NULL) {
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+
+
+ /*
+ * Eat the sequence header.
+ */
+ parse_ptr = value_ptr;
+ sequence_length = octet_string_length;
+
+ if ((value_ptr = asn_parse_sequence(parse_ptr, &sequence_length,
+ &type_value,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ "usm sequence")) == NULL) {
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+
+
+ /*
+ * Retrieve the engineID.
+ */
+ parse_ptr = value_ptr;
+ remaining_bytes = sequence_length;
+
+ DEBUGDUMPHEADER("recv", "msgAuthoritativeEngineID");
+ if ((next_ptr
+ = asn_parse_string(parse_ptr, &remaining_bytes, &type_value,
+ secEngineID, secEngineIDLen)) == NULL) {
+ DEBUGINDENTLESS();
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+ DEBUGINDENTLESS();
+
+ if (type_value !=
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR)) {
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+
+
+ /*
+ * Retrieve the engine boots, notice switch in the way next_ptr and
+ * remaining_bytes are used (to accomodate the asn code).
+ */
+ DEBUGDUMPHEADER("recv", "msgAuthoritativeEngineBoots");
+ if ((next_ptr = asn_parse_int(next_ptr, &remaining_bytes, &type_value,
+ &boots_long, sizeof(long))) == NULL) {
+ DEBUGINDENTLESS();
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+ DEBUGINDENTLESS();
+
+ if (type_value !=
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER)) {
+ DEBUGINDENTLESS();
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+
+ *boots_uint = (u_int) boots_long;
+
+
+ /*
+ * Retrieve the time value.
+ */
+ DEBUGDUMPHEADER("recv", "msgAuthoritativeEngineTime");
+ if ((next_ptr = asn_parse_int(next_ptr, &remaining_bytes, &type_value,
+ &time_long, sizeof(long))) == NULL) {
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+ DEBUGINDENTLESS();
+
+ if (type_value !=
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER)) {
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+
+ *time_uint = (u_int) time_long;
+
+ if (*boots_uint > ENGINEBOOT_MAX || *time_uint > ENGINETIME_MAX) {
+ return -1;
+ }
+
+ /*
+ * Retrieve the secName.
+ */
+ origNameLen = *secNameLen;
+
+
+ DEBUGDUMPHEADER("recv", "msgUserName");
+ if ((next_ptr
+ = asn_parse_string(next_ptr, &remaining_bytes, &type_value,
+ (u_char *) secName, secNameLen)) == NULL) {
+ DEBUGINDENTLESS();
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+ DEBUGINDENTLESS();
+
+ /*
+ * FIX -- doesn't this also indicate a buffer overrun?
+ */
+ if (origNameLen < *secNameLen + 1) {
+ /*
+ * RETURN parse error, but it's really a parameter error
+ */
+ return -1;
+ }
+
+ if (*secNameLen > 32) {
+ /*
+ * This is a USM-specific limitation over and above the above
+ * limitation (which will probably default to the length of an
+ * SnmpAdminString, i.e. 255). See RFC 2574, sec. 2.4.
+ */
+ return -1;
+ }
+
+ secName[*secNameLen] = '\0';
+
+ if (type_value !=
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR)) {
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+
+
+ /*
+ * Retrieve the signature and blank it if there.
+ */
+ DEBUGDUMPHEADER("recv", "msgAuthenticationParameters");
+ if ((next_ptr
+ = asn_parse_string(next_ptr, &remaining_bytes, &type_value,
+ signature, signature_length)) == NULL) {
+ DEBUGINDENTLESS();
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+ DEBUGINDENTLESS();
+
+ if (type_value !=
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR)) {
+ /*
+ * RETURN parse error
+ */ return -1;
+ }
+
+ if (*signature_length != 0) { /* Blanking for authentication step later */
+ memset(next_ptr - (u_long) * signature_length,
+ 0, *signature_length);
+ }
+
+
+ /*
+ * Retrieve the salt.
+ *
+ * Note that the next ptr is where the data section starts.
+ */
+ DEBUGDUMPHEADER("recv", "msgPrivacyParameters");
+ if ((*data_ptr
+ = asn_parse_string(next_ptr, &remaining_bytes, &type_value,
+ salt, salt_length)) == NULL) {
+ DEBUGINDENTLESS();
+ /*
+ * RETURN parse error
+ */ return -2;
+ }
+ DEBUGINDENTLESS();
+
+ if (type_value !=
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR)) {
+ /*
+ * RETURN parse error
+ */ return -2;
+ }
+
+ return 0;
+
+} /* end usm_parse_security_parameters() */
+
+
+
+
+/*******************************************************************-o-******
+ * usm_check_and_update_timeliness
+ *
+ * Parameters:
+ * *secEngineID
+ * secEngineIDen
+ * boots_uint
+ * time_uint
+ * *error
+ *
+ * Returns:
+ * 0 On success,
+ * -1 Otherwise.
+ *
+ *
+ * Performs the incoming timeliness checking and setting.
+ */
+int
+usm_check_and_update_timeliness(u_char * secEngineID,
+ size_t secEngineIDLen,
+ u_int boots_uint,
+ u_int time_uint, int *error)
+{
+ u_char myID[USM_MAX_ID_LENGTH];
+ u_long myIDLength =
+ snmpv3_get_engineID(myID, USM_MAX_ID_LENGTH);
+ u_int myBoots;
+ u_int myTime;
+
+
+
+ if ((myIDLength > USM_MAX_ID_LENGTH) || (myIDLength == 0)) {
+ /*
+ * We're probably already screwed...buffer overwrite. XXX?
+ */
+ DEBUGMSGTL(("usm", "Buffer overflow.\n"));
+ *error = SNMPERR_USM_GENERICERROR;
+ return -1;
+ }
+
+ myBoots = snmpv3_local_snmpEngineBoots();
+ myTime = snmpv3_local_snmpEngineTime();
+
+
+ /*
+ * IF the time involved is local
+ * Make sure message is inside the time window
+ * ELSE
+ * IF boots is higher or boots is the same and time is higher
+ * remember this new data
+ * ELSE
+ * IF !(boots same and time within USM_TIME_WINDOW secs)
+ * Message is too old
+ * ELSE
+ * Message is ok, but don't take time
+ * ENDIF
+ * ENDIF
+ * ENDIF
+ */
+
+ /*
+ * This is a local reference.
+ */
+ if (secEngineIDLen == myIDLength
+ && memcmp(secEngineID, myID, myIDLength) == 0) {
+ u_int time_difference = myTime > time_uint ?
+ myTime - time_uint : time_uint - myTime;
+
+ if (boots_uint == ENGINEBOOT_MAX
+ || boots_uint != myBoots
+ || time_difference > USM_TIME_WINDOW) {
+ snmp_increment_statistic(STAT_USMSTATSNOTINTIMEWINDOWS);
+
+ DEBUGMSGTL(("usm",
+ "boot_uint %u myBoots %u time_diff %u => not in time window\n",
+ boots_uint, myBoots, time_difference));
+ *error = SNMPERR_USM_NOTINTIMEWINDOW;
+ return -1;
+ }
+
+ *error = SNMPERR_SUCCESS;
+ return 0;
+ }
+
+ /*
+ * This is a remote reference.
+ */
+ else {
+ u_int theirBoots, theirTime, theirLastTime;
+ u_int time_difference;
+
+ if (get_enginetime_ex(secEngineID, secEngineIDLen,
+ &theirBoots, &theirTime,
+ &theirLastTime, TRUE)
+ != SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("usm", "%s\n",
+ "Failed to get remote engine's times."));
+
+ *error = SNMPERR_USM_GENERICERROR;
+ return -1;
+ }
+
+ time_difference = theirTime > time_uint ?
+ theirTime - time_uint : time_uint - theirTime;
+
+
+ /*
+ * XXX Contrary to the pseudocode:
+ * See if boots is invalid first.
+ */
+ if (theirBoots == ENGINEBOOT_MAX || theirBoots > boots_uint) {
+ DEBUGMSGTL(("usm", "%s\n", "Remote boot count invalid."));
+
+ *error = SNMPERR_USM_NOTINTIMEWINDOW;
+ return -1;
+ }
+
+
+ /*
+ * Boots is ok, see if the boots is the same but the time
+ * is old.
+ */
+ if (theirBoots == boots_uint && time_uint < theirLastTime) {
+ if (time_difference > USM_TIME_WINDOW) {
+ DEBUGMSGTL(("usm", "%s\n", "Message too old."));
+ *error = SNMPERR_USM_NOTINTIMEWINDOW;
+ return -1;
+ }
+
+ else { /* Old, but acceptable */
+
+ *error = SNMPERR_SUCCESS;
+ return 0;
+ }
+ }
+
+
+ /*
+ * Message is ok, either boots has been advanced, or
+ * time is greater than before with the same boots.
+ */
+
+ if (set_enginetime(secEngineID, secEngineIDLen,
+ boots_uint, time_uint, TRUE)
+ != SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("usm", "%s\n",
+ "Failed updating remote boot/time."));
+ *error = SNMPERR_USM_GENERICERROR;
+ return -1;
+ }
+
+ *error = SNMPERR_SUCCESS;
+ return 0; /* Fresh message and time updated */
+
+ } /* endif -- local or remote time reference. */
+
+
+} /* end usm_check_and_update_timeliness() */
+
+
+
+int
+usm_secmod_process_in_msg(struct snmp_secmod_incoming_params *parms)
+{
+ if (!parms)
+ return SNMPERR_GENERR;
+
+ return usm_process_in_msg(parms->msgProcModel,
+ parms->maxMsgSize,
+ parms->secParams,
+ parms->secModel,
+ parms->secLevel,
+ parms->wholeMsg,
+ parms->wholeMsgLen,
+ parms->secEngineID,
+ parms->secEngineIDLen,
+ parms->secName,
+ parms->secNameLen,
+ parms->scopedPdu,
+ parms->scopedPduLen,
+ parms->maxSizeResponse,
+ parms->secStateRef,
+ parms->sess, parms->msg_flags);
+}
+
+/*******************************************************************-o-******
+ * usm_process_in_msg
+ *
+ * Parameters:
+ * (See list below...)
+ *
+ * Returns:
+ * SNMPERR_SUCCESS On success.
+ * SNMPERR_USM_AUTHENTICATIONFAILURE
+ * SNMPERR_USM_DECRYPTIONERROR
+ * SNMPERR_USM_GENERICERROR
+ * SNMPERR_USM_PARSEERROR
+ * SNMPERR_USM_UNKNOWNENGINEID
+ * SNMPERR_USM_PARSEERROR
+ * SNMPERR_USM_UNKNOWNSECURITYNAME
+ * SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL
+ *
+ *
+ * ASSUMES size of decrypt_buf will always be >= size of encrypted sPDU.
+ *
+ * FIX Memory leaks if secStateRef is allocated and a return occurs
+ * without cleaning up. May contain secrets...
+ */
+int
+usm_process_in_msg(int msgProcModel, /* (UNUSED) */
+ size_t maxMsgSize, /* IN - Used to calc maxSizeResponse. */
+ u_char * secParams, /* IN - BER encoded securityParameters. */
+ int secModel, /* (UNUSED) */
+ int secLevel, /* IN - AuthNoPriv, authPriv etc. */
+ u_char * wholeMsg, /* IN - Original v3 message. */
+ size_t wholeMsgLen, /* IN - Msg length. */
+ u_char * secEngineID, /* OUT - Pointer snmpEngineID. */
+ size_t * secEngineIDLen, /* IN/OUT - Len available, len returned. */
+ /*
+ * NOTE: Memory provided by caller.
+ */
+ char *secName, /* OUT - Pointer to securityName. */
+ size_t * secNameLen, /* IN/OUT - Len available, len returned. */
+ u_char ** scopedPdu, /* OUT - Pointer to plaintext scopedPdu. */
+ size_t * scopedPduLen, /* IN/OUT - Len available, len returned. */
+ size_t * maxSizeResponse, /* OUT - Max size of Response PDU. */
+ void **secStateRf, /* OUT - Ref to security state. */
+ netsnmp_session * sess, /* IN - session which got the message */
+ u_char msg_flags)
+{ /* IN - v3 Message flags. */
+ size_t remaining = wholeMsgLen - (u_int)
+ ((u_long) * secParams - (u_long) * wholeMsg);
+ u_int boots_uint;
+ u_int time_uint;
+#ifdef HAVE_AES
+ u_int net_boots, net_time;
+#endif
+ u_char signature[BYTESIZE(USM_MAX_KEYEDHASH_LENGTH)];
+ size_t signature_length = BYTESIZE(USM_MAX_KEYEDHASH_LENGTH);
+ u_char salt[BYTESIZE(USM_MAX_SALT_LENGTH)];
+ size_t salt_length = BYTESIZE(USM_MAX_SALT_LENGTH);
+ u_char iv[BYTESIZE(USM_MAX_SALT_LENGTH)];
+ u_int iv_length = BYTESIZE(USM_MAX_SALT_LENGTH);
+ u_char *data_ptr;
+ u_char *value_ptr;
+ u_char type_value;
+ u_char *end_of_overhead = NULL;
+ int error;
+ int i, rc = 0;
+ struct usmStateReference **secStateRef =
+ (struct usmStateReference **) secStateRf;
+
+ struct usmUser *user;
+
+
+ DEBUGMSGTL(("usm", "USM processing begun...\n"));
+
+
+ if (secStateRef) {
+ usm_free_usmStateReference(*secStateRef);
+ *secStateRef = usm_malloc_usmStateReference();
+ if (*secStateRef == NULL) {
+ DEBUGMSGTL(("usm", "Out of memory.\n"));
+ return SNMPERR_USM_GENERICERROR;
+ }
+ }
+
+
+ /*
+ * Make sure the *secParms is an OCTET STRING.
+ * Extract the user name, engine ID, and security level.
+ */
+ if ((rc = usm_parse_security_parameters(secParams, remaining,
+ secEngineID, secEngineIDLen,
+ &boots_uint, &time_uint,
+ secName, secNameLen,
+ signature, &signature_length,
+ salt, &salt_length,
+ &data_ptr)) < 0) {
+ DEBUGMSGTL(("usm", "Parsing failed (rc %d).\n", rc));
+ if (rc == -2) {
+ /*
+ * This indicates a decryptionError.
+ */
+ snmp_increment_statistic(STAT_USMSTATSDECRYPTIONERRORS);
+ return SNMPERR_USM_DECRYPTIONERROR;
+ }
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ return SNMPERR_USM_PARSEERROR;
+ }
+
+ /*
+ * RFC 2574 section 8.3.2
+ * 1) If the privParameters field is not an 8-octet OCTET STRING,
+ * then an error indication (decryptionError) is returned to the
+ * calling module.
+ */
+ if ((secLevel == SNMP_SEC_LEVEL_AUTHPRIV) && (salt_length != 8)) {
+ snmp_increment_statistic(STAT_USMSTATSDECRYPTIONERRORS);
+ return SNMPERR_USM_DECRYPTIONERROR;
+ }
+
+ if (secLevel != SNMP_SEC_LEVEL_AUTHPRIV) {
+ /*
+ * pull these out now so reports can use them
+ */
+ *scopedPdu = data_ptr;
+ *scopedPduLen = wholeMsgLen - (data_ptr - wholeMsg);
+ end_of_overhead = data_ptr;
+ }
+
+ if (secStateRef) {
+ /*
+ * Cache the name, engine ID, and security level,
+ * * per step 2 (section 3.2)
+ */
+ if (usm_set_usmStateReference_name
+ (*secStateRef, secName, *secNameLen) == -1) {
+ DEBUGMSGTL(("usm", "%s\n", "Couldn't cache name."));
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ if (usm_set_usmStateReference_engine_id
+ (*secStateRef, secEngineID, *secEngineIDLen) == -1) {
+ DEBUGMSGTL(("usm", "%s\n", "Couldn't cache engine id."));
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ if (usm_set_usmStateReference_sec_level(*secStateRef, secLevel) ==
+ -1) {
+ DEBUGMSGTL(("usm", "%s\n", "Couldn't cache security level."));
+ return SNMPERR_USM_GENERICERROR;
+ }
+ }
+
+
+ /*
+ * Locate the engine ID record.
+ * If it is unknown, then either create one or note this as an error.
+ */
+ if ((sess && (sess->isAuthoritative == SNMP_SESS_AUTHORITATIVE ||
+ (sess->isAuthoritative == SNMP_SESS_UNKNOWNAUTH &&
+ (msg_flags & SNMP_MSG_FLAG_RPRT_BIT)))) ||
+ (!sess && (msg_flags & SNMP_MSG_FLAG_RPRT_BIT))) {
+ if (ISENGINEKNOWN(secEngineID, *secEngineIDLen) == FALSE) {
+ DEBUGMSGTL(("usm", "Unknown Engine ID.\n"));
+ snmp_increment_statistic(STAT_USMSTATSUNKNOWNENGINEIDS);
+ return SNMPERR_USM_UNKNOWNENGINEID;
+ }
+ } else {
+ if (ENSURE_ENGINE_RECORD(secEngineID, *secEngineIDLen)
+ != SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("usm", "%s\n", "Couldn't ensure engine record."));
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ }
+
+
+ /*
+ * Locate the User record.
+ * If the user/engine ID is unknown, report this as an error.
+ */
+ if ((user = usm_get_user_from_list(secEngineID, *secEngineIDLen,
+ secName, userList,
+ (((sess && sess->isAuthoritative ==
+ SNMP_SESS_AUTHORITATIVE) ||
+ (!sess)) ? 0 : 1)))
+ == NULL) {
+ DEBUGMSGTL(("usm", "Unknown User(%s)\n", secName));
+ snmp_increment_statistic(STAT_USMSTATSUNKNOWNUSERNAMES);
+ return SNMPERR_USM_UNKNOWNSECURITYNAME;
+ }
+
+ /* ensure the user is active */
+ if (user->userStatus != RS_ACTIVE) {
+ DEBUGMSGTL(("usm", "Attempt to use an inactive user.\n"));
+ return SNMPERR_USM_UNKNOWNSECURITYNAME;
+ }
+
+ /*
+ * Make sure the security level is appropriate.
+ */
+
+ rc = usm_check_secLevel(secLevel, user);
+ if (1 == rc) {
+ DEBUGMSGTL(("usm", "Unsupported Security Level (%d).\n",
+ secLevel));
+ snmp_increment_statistic(STAT_USMSTATSUNSUPPORTEDSECLEVELS);
+ return SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL;
+ } else if (rc != 0) {
+ DEBUGMSGTL(("usm", "Unknown issue.\n"));
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ /*
+ * Check the authentication credentials of the message.
+ */
+ if (secLevel == SNMP_SEC_LEVEL_AUTHNOPRIV
+ || secLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ if (sc_check_keyed_hash(user->authProtocol, user->authProtocolLen,
+ user->authKey, user->authKeyLen,
+ wholeMsg, wholeMsgLen,
+ signature, signature_length)
+ != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("usm", "Verification failed.\n"));
+ snmp_increment_statistic(STAT_USMSTATSWRONGDIGESTS);
+ snmp_log(LOG_WARNING, "Authentication failed for %s\n",
+ user->name);
+ return SNMPERR_USM_AUTHENTICATIONFAILURE;
+ }
+
+ DEBUGMSGTL(("usm", "Verification succeeded.\n"));
+ }
+
+
+ /*
+ * Steps 10-11 user is already set - relocated before timeliness
+ * check in case it fails - still save user data for response.
+ *
+ * Cache the keys and protocol oids, per step 11 (s3.2).
+ */
+ if (secStateRef) {
+ if (usm_set_usmStateReference_auth_protocol(*secStateRef,
+ user->authProtocol,
+ user->
+ authProtocolLen) ==
+ -1) {
+ DEBUGMSGTL(("usm", "%s\n",
+ "Couldn't cache authentication protocol."));
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ if (usm_set_usmStateReference_auth_key(*secStateRef,
+ user->authKey,
+ user->authKeyLen) == -1) {
+ DEBUGMSGTL(("usm", "%s\n",
+ "Couldn't cache authentication key."));
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ if (usm_set_usmStateReference_priv_protocol(*secStateRef,
+ user->privProtocol,
+ user->
+ privProtocolLen) ==
+ -1) {
+ DEBUGMSGTL(("usm", "%s\n",
+ "Couldn't cache privacy protocol."));
+ return SNMPERR_USM_GENERICERROR;
+ }
+
+ if (usm_set_usmStateReference_priv_key(*secStateRef,
+ user->privKey,
+ user->privKeyLen) == -1) {
+ DEBUGMSGTL(("usm", "%s\n", "Couldn't cache privacy key."));
+ return SNMPERR_USM_GENERICERROR;
+ }
+ }
+
+
+ /*
+ * Perform the timeliness/time manager functions.
+ */
+ if (secLevel == SNMP_SEC_LEVEL_AUTHNOPRIV
+ || secLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ if (usm_check_and_update_timeliness(secEngineID, *secEngineIDLen,
+ boots_uint, time_uint,
+ &error) == -1) {
+ return error;
+ }
+ }
+#ifdef LCD_TIME_SYNC_OPT
+ /*
+ * Cache the unauthenticated time to use in case we don't have
+ * anything better - this guess will be no worse than (0,0)
+ * that we normally use.
+ */
+ else {
+ set_enginetime(secEngineID, *secEngineIDLen,
+ boots_uint, time_uint, FALSE);
+ }
+#endif /* LCD_TIME_SYNC_OPT */
+
+
+ /*
+ * If needed, decrypt the scoped PDU.
+ */
+ if (secLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
+ remaining = wholeMsgLen - (data_ptr - wholeMsg);
+
+ if ((value_ptr = asn_parse_sequence(data_ptr, &remaining,
+ &type_value,
+ (ASN_UNIVERSAL | ASN_PRIMITIVE
+ | ASN_OCTET_STR),
+ "encrypted sPDU")) == NULL) {
+ DEBUGMSGTL(("usm", "%s\n",
+ "Failed while parsing encrypted sPDU."));
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ usm_free_usmStateReference(*secStateRef);
+ *secStateRef = NULL;
+ return SNMPERR_USM_PARSEERROR;
+ }
+
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(user->privProtocol, DESPriv)) {
+ /*
+ * From RFC2574:
+ *
+ * "Before decryption, the encrypted data length is verified.
+ * If the length of the OCTET STRING to be decrypted is not
+ * an integral multiple of 8 octets, the decryption process
+ * is halted and an appropriate exception noted."
+ */
+
+ if (remaining % 8 != 0) {
+ DEBUGMSGTL(("usm",
+ "Ciphertext is %lu bytes, not an integer multiple of 8 (rem %lu)\n",
+ (unsigned long)remaining, (unsigned long)remaining % 8));
+ snmp_increment_statistic(STAT_USMSTATSDECRYPTIONERRORS);
+ usm_free_usmStateReference(*secStateRef);
+ *secStateRef = NULL;
+ return SNMPERR_USM_DECRYPTIONERROR;
+ }
+
+ end_of_overhead = value_ptr;
+
+ if ( !user->privKey ) {
+ DEBUGMSGTL(("usm", "No privacy pass phrase for %s\n", user->secName));
+ snmp_increment_statistic(STAT_USMSTATSDECRYPTIONERRORS);
+ usm_free_usmStateReference(*secStateRef);
+ *secStateRef = NULL;
+ return SNMPERR_USM_DECRYPTIONERROR;
+ }
+
+ /*
+ * XOR the salt with the last (iv_length) bytes
+ * of the priv_key to obtain the IV.
+ */
+ iv_length = BYTESIZE(USM_DES_SALT_LENGTH);
+ for (i = 0; i < (int) iv_length; i++)
+ iv[i] = salt[i] ^ user->privKey[iv_length + i];
+ }
+#endif
+#ifdef HAVE_AES
+ if (ISTRANSFORM(user->privProtocol, AESPriv)) {
+ iv_length = BYTESIZE(USM_AES_SALT_LENGTH);
+ net_boots = ntohl(boots_uint);
+ net_time = ntohl(time_uint);
+ memcpy(iv, &net_boots, 4);
+ memcpy(iv+4, &net_time, 4);
+ memcpy(iv+8, salt, salt_length);
+ }
+#endif
+
+ if (sc_decrypt(user->privProtocol, user->privProtocolLen,
+ user->privKey, user->privKeyLen,
+ iv, iv_length,
+ value_ptr, remaining, *scopedPdu, scopedPduLen)
+ != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("usm", "%s\n", "Failed decryption."));
+ snmp_increment_statistic(STAT_USMSTATSDECRYPTIONERRORS);
+ return SNMPERR_USM_DECRYPTIONERROR;
+ }
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ if (debug_is_token_registered("usm/dump") == SNMPERR_SUCCESS) {
+ dump_chunk("usm/dump", "Cypher Text", value_ptr, remaining);
+ dump_chunk("usm/dump", "salt + Encrypted form:",
+ salt, salt_length);
+ dump_chunk("usm/dump", "IV + Encrypted form:", iv, iv_length);
+ dump_chunk("usm/dump", "Decrypted chunk:",
+ *scopedPdu, *scopedPduLen);
+ }
+#endif
+ }
+ /*
+ * sPDU is plaintext.
+ */
+ else {
+ *scopedPdu = data_ptr;
+ *scopedPduLen = wholeMsgLen - (data_ptr - wholeMsg);
+ end_of_overhead = data_ptr;
+
+ } /* endif -- PDU decryption */
+
+
+ /*
+ * Calculate the biggest sPDU for the response (i.e., whole - ovrhd).
+ *
+ * FIX Correct?
+ */
+ *maxSizeResponse = maxMsgSize - (end_of_overhead - wholeMsg);
+
+
+ DEBUGMSGTL(("usm", "USM processing completed.\n"));
+
+ return SNMPERR_SUCCESS;
+
+} /* end usm_process_in_msg() */
+
+void
+usm_handle_report(void *sessp,
+ netsnmp_transport *transport, netsnmp_session *session,
+ int result, netsnmp_pdu *pdu)
+{
+ /*
+ * handle reportable errors
+ */
+
+ /* this will get in our way */
+ usm_free_usmStateReference(pdu->securityStateRef);
+ pdu->securityStateRef = NULL;
+
+ switch (result) {
+ case SNMPERR_USM_AUTHENTICATIONFAILURE:
+ {
+ int res = session->s_snmp_errno;
+ session->s_snmp_errno = result;
+ if (session->callback) {
+ session->callback(NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE,
+ session, pdu->reqid, pdu,
+ session->callback_magic);
+ }
+ session->s_snmp_errno = res;
+ }
+ /* fallthrough */
+ case SNMPERR_USM_UNKNOWNENGINEID:
+ case SNMPERR_USM_UNKNOWNSECURITYNAME:
+ case SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL:
+ case SNMPERR_USM_NOTINTIMEWINDOW:
+ case SNMPERR_USM_DECRYPTIONERROR:
+
+ if (SNMP_CMD_CONFIRMED(pdu->command) ||
+ (pdu->command == 0
+ && (pdu->flags & SNMP_MSG_FLAG_RPRT_BIT))) {
+ netsnmp_pdu *pdu2;
+ int flags = pdu->flags;
+
+ pdu->flags |= UCD_MSG_FLAG_FORCE_PDU_COPY;
+ pdu2 = snmp_clone_pdu(pdu);
+ pdu->flags = pdu2->flags = flags;
+ snmpv3_make_report(pdu2, result);
+ if (0 == snmp_sess_send(sessp, pdu2)) {
+ snmp_free_pdu(pdu2);
+ /*
+ * TODO: indicate error
+ */
+ }
+ }
+ break;
+ }
+}
+
+/* sets up initial default session parameters */
+int
+usm_session_init(netsnmp_session *in_session, netsnmp_session *session)
+{
+ char *cp;
+ size_t i;
+
+ if (in_session->securityAuthProtoLen > 0) {
+ session->securityAuthProto =
+ snmp_duplicate_objid(in_session->securityAuthProto,
+ in_session->securityAuthProtoLen);
+ if (session->securityAuthProto == NULL) {
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return SNMPERR_MALLOC;
+ }
+ } else if (get_default_authtype(&i) != NULL) {
+ session->securityAuthProto =
+ snmp_duplicate_objid(get_default_authtype(NULL), i);
+ session->securityAuthProtoLen = i;
+ }
+
+ if (in_session->securityPrivProtoLen > 0) {
+ session->securityPrivProto =
+ snmp_duplicate_objid(in_session->securityPrivProto,
+ in_session->securityPrivProtoLen);
+ if (session->securityPrivProto == NULL) {
+ in_session->s_snmp_errno = SNMPERR_MALLOC;
+ return SNMPERR_MALLOC;
+ }
+ } else if (get_default_privtype(&i) != NULL) {
+ session->securityPrivProto =
+ snmp_duplicate_objid(get_default_privtype(NULL), i);
+ session->securityPrivProtoLen = i;
+ }
+
+ if ((in_session->securityAuthKeyLen <= 0) &&
+ ((cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_AUTHMASTERKEY)))) {
+ size_t buflen = sizeof(session->securityAuthKey);
+ u_char *tmpp = session->securityAuthKey;
+ session->securityAuthKeyLen = 0;
+ /* it will be a hex string */
+ if (!snmp_hex_to_binary(&tmpp, &buflen,
+ &session->securityAuthKeyLen, 0, cp)) {
+ snmp_set_detail("error parsing authentication master key");
+ return SNMP_ERR_GENERR;
+ }
+ } else if ((in_session->securityAuthKeyLen <= 0) &&
+ ((cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_AUTHPASSPHRASE)) ||
+ (cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PASSPHRASE)))) {
+ session->securityAuthKeyLen = USM_AUTH_KU_LEN;
+ if (generate_Ku(session->securityAuthProto,
+ session->securityAuthProtoLen,
+ (u_char *) cp, strlen(cp),
+ session->securityAuthKey,
+ &session->securityAuthKeyLen) != SNMPERR_SUCCESS) {
+ snmp_set_detail
+ ("Error generating a key (Ku) from the supplied authentication pass phrase.");
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+
+ if ((in_session->securityPrivKeyLen <= 0) &&
+ ((cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PRIVMASTERKEY)))) {
+ size_t buflen = sizeof(session->securityPrivKey);
+ u_char *tmpp = session->securityPrivKey;
+ session->securityPrivKeyLen = 0;
+ /* it will be a hex string */
+ if (!snmp_hex_to_binary(&tmpp, &buflen,
+ &session->securityPrivKeyLen, 0, cp)) {
+ snmp_set_detail("error parsing encryption master key");
+ return SNMP_ERR_GENERR;
+ }
+ } else if ((in_session->securityPrivKeyLen <= 0) &&
+ ((cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PRIVPASSPHRASE)) ||
+ (cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PASSPHRASE)))) {
+ session->securityPrivKeyLen = USM_PRIV_KU_LEN;
+ if (generate_Ku(session->securityAuthProto,
+ session->securityAuthProtoLen,
+ (u_char *) cp, strlen(cp),
+ session->securityPrivKey,
+ &session->securityPrivKeyLen) != SNMPERR_SUCCESS) {
+ snmp_set_detail
+ ("Error generating a key (Ku) from the supplied privacy pass phrase.");
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+
+/*
+ * usm_create_user_from_session(netsnmp_session *session):
+ *
+ * creates a user in the usm table from the information in a session.
+ * If the user already exists, it is updated with the current
+ * information from the session
+ *
+ * Parameters:
+ * session -- IN: pointer to the session to use when creating the user.
+ *
+ * Returns:
+ * SNMPERR_SUCCESS
+ * SNMPERR_GENERR
+ */
+int
+usm_create_user_from_session(netsnmp_session * session)
+{
+ struct usmUser *user;
+ int user_just_created = 0;
+ char *cp;
+
+ /*
+ * - don't create-another/copy-into user for this session by default
+ * - bail now (no error) if we don't have an engineID
+ */
+ if (SNMP_FLAGS_USER_CREATED == (session->flags & SNMP_FLAGS_USER_CREATED) ||
+ session->securityModel != SNMP_SEC_MODEL_USM ||
+ session->version != SNMP_VERSION_3 ||
+ session->securityNameLen == 0 ||
+ session->securityEngineIDLen == 0)
+ return SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("usm", "no flag defined... continuing\n"));
+ session->flags |= SNMP_FLAGS_USER_CREATED;
+
+ /*
+ * now that we have the engineID, create an entry in the USM list
+ * for this user using the information in the session
+ */
+ user = usm_get_user_from_list(session->securityEngineID,
+ session->securityEngineIDLen,
+ session->securityName,
+ usm_get_userList(), 0);
+ DEBUGMSGTL(("usm", "user exists? x=%p\n", user));
+ if (user == NULL) {
+ DEBUGMSGTL(("usm", "Building user %s...\n",
+ session->securityName));
+ /*
+ * user doesn't exist so we create and add it
+ */
+ user = (struct usmUser *) calloc(1, sizeof(struct usmUser));
+ if (user == NULL)
+ return SNMPERR_GENERR;
+
+ /*
+ * copy in the securityName
+ */
+ if (session->securityName) {
+ user->name = strdup(session->securityName);
+ user->secName = strdup(session->securityName);
+ if (user->name == NULL || user->secName == NULL) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ }
+
+ /*
+ * copy in the engineID
+ */
+ if (memdup(&user->engineID, session->securityEngineID,
+ session->securityEngineIDLen) != SNMPERR_SUCCESS) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ user->engineIDLen = session->securityEngineIDLen;
+
+ user_just_created = 1;
+ }
+
+ /*
+ * copy the auth protocol
+ */
+ if (user->authProtocol == NULL && session->securityAuthProto != NULL) {
+ SNMP_FREE(user->authProtocol);
+ user->authProtocol =
+ snmp_duplicate_objid(session->securityAuthProto,
+ session->securityAuthProtoLen);
+ if (user->authProtocol == NULL) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ user->authProtocolLen = session->securityAuthProtoLen;
+ }
+
+ /*
+ * copy the priv protocol
+ */
+ if (user->privProtocol == NULL && session->securityPrivProto != NULL) {
+ SNMP_FREE(user->privProtocol);
+ user->privProtocol =
+ snmp_duplicate_objid(session->securityPrivProto,
+ session->securityPrivProtoLen);
+ if (user->privProtocol == NULL) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ user->privProtocolLen = session->securityPrivProtoLen;
+ }
+
+ /*
+ * copy in the authentication Key. If not localized, localize it
+ */
+ if (user->authKey == NULL) {
+ if (session->securityAuthLocalKey != NULL
+ && session->securityAuthLocalKeyLen != 0) {
+ /* already localized key passed in. use it */
+ SNMP_FREE(user->authKey);
+ if (memdup(&user->authKey, session->securityAuthLocalKey,
+ session->securityAuthLocalKeyLen) != SNMPERR_SUCCESS) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ user->authKeyLen = session->securityAuthLocalKeyLen;
+ } else if (session->securityAuthKey != NULL
+ && session->securityAuthKeyLen != 0) {
+ SNMP_FREE(user->authKey);
+ user->authKey = (u_char *) calloc(1, USM_LENGTH_KU_HASHBLOCK);
+ if (user->authKey == NULL) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ user->authKeyLen = USM_LENGTH_KU_HASHBLOCK;
+ if (generate_kul(user->authProtocol, user->authProtocolLen,
+ session->securityEngineID,
+ session->securityEngineIDLen,
+ session->securityAuthKey,
+ session->securityAuthKeyLen, user->authKey,
+ &user->authKeyLen) != SNMPERR_SUCCESS) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ } else if ((cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_AUTHLOCALIZEDKEY))) {
+ size_t buflen = USM_AUTH_KU_LEN;
+ SNMP_FREE(user->authKey);
+ user->authKey = (u_char *)malloc(buflen); /* max length needed */
+ user->authKeyLen = 0;
+ /* it will be a hex string */
+ if (!snmp_hex_to_binary(&user->authKey, &buflen, &user->authKeyLen,
+ 0, cp)) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ }
+ }
+
+ /*
+ * copy in the privacy Key. If not localized, localize it
+ */
+ if (user->privKey == NULL) {
+ if (session->securityPrivLocalKey != NULL
+ && session->securityPrivLocalKeyLen != 0) {
+ /* already localized key passed in. use it */
+ SNMP_FREE(user->privKey);
+ if (memdup(&user->privKey, session->securityPrivLocalKey,
+ session->securityPrivLocalKeyLen) != SNMPERR_SUCCESS) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ user->privKeyLen = session->securityPrivLocalKeyLen;
+ } else if (session->securityPrivKey != NULL
+ && session->securityPrivKeyLen != 0) {
+ SNMP_FREE(user->privKey);
+ user->privKey = (u_char *) calloc(1, USM_LENGTH_KU_HASHBLOCK);
+ if (user->privKey == NULL) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ user->privKeyLen = USM_LENGTH_KU_HASHBLOCK;
+ if (generate_kul(user->authProtocol, user->authProtocolLen,
+ session->securityEngineID,
+ session->securityEngineIDLen,
+ session->securityPrivKey,
+ session->securityPrivKeyLen, user->privKey,
+ &user->privKeyLen) != SNMPERR_SUCCESS) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ } else if ((cp = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PRIVLOCALIZEDKEY))) {
+ size_t buflen = USM_PRIV_KU_LEN;
+ SNMP_FREE(user->privKey);
+ user->privKey = (u_char *)malloc(buflen); /* max length needed */
+ user->privKeyLen = 0;
+ /* it will be a hex string */
+ if (!snmp_hex_to_binary(&user->privKey, &buflen, &user->privKeyLen,
+ 0, cp)) {
+ usm_free_user(user);
+ return SNMPERR_GENERR;
+ }
+ }
+ }
+
+ if (user_just_created) {
+ /*
+ * add the user into the database
+ */
+ user->userStatus = RS_ACTIVE;
+ user->userStorageType = ST_READONLY;
+ usm_add_user(user);
+ }
+
+ return SNMPERR_SUCCESS;
+
+
+}
+
+/* A wrapper around the hook */
+int
+usm_create_user_from_session_hook(void *slp, netsnmp_session *session)
+{
+ DEBUGMSGTL(("usm", "potentially bootstrapping the USM table from session data\n"));
+ return usm_create_user_from_session(session);
+}
+
+static int
+usm_build_probe_pdu(netsnmp_pdu **pdu)
+{
+ struct usmUser *user;
+
+ /*
+ * create the pdu
+ */
+ if (!pdu)
+ return -1;
+ *pdu = snmp_pdu_create(SNMP_MSG_GET);
+ if (!(*pdu))
+ return -1;
+ (*pdu)->version = SNMP_VERSION_3;
+ (*pdu)->securityName = strdup("");
+ (*pdu)->securityNameLen = strlen((*pdu)->securityName);
+ (*pdu)->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
+ (*pdu)->securityModel = SNMP_SEC_MODEL_USM;
+
+ /*
+ * create the empty user
+ */
+ user = usm_get_user(NULL, 0, (*pdu)->securityName);
+ if (user == NULL) {
+ user = (struct usmUser *) calloc(1, sizeof(struct usmUser));
+ if (user == NULL) {
+ snmp_free_pdu(*pdu);
+ *pdu = (netsnmp_pdu *) NULL;
+ return -1;
+ }
+ user->name = strdup((*pdu)->securityName);
+ user->secName = strdup((*pdu)->securityName);
+ user->authProtocolLen = sizeof(usmNoAuthProtocol) / sizeof(oid);
+ user->authProtocol =
+ snmp_duplicate_objid(usmNoAuthProtocol, user->authProtocolLen);
+ user->privProtocolLen = sizeof(usmNoPrivProtocol) / sizeof(oid);
+ user->privProtocol =
+ snmp_duplicate_objid(usmNoPrivProtocol, user->privProtocolLen);
+ usm_add_user(user);
+ }
+ return 0;
+}
+
+int usm_discover_engineid(void *slpv, netsnmp_session *session) {
+ netsnmp_pdu *pdu = NULL, *response = NULL;
+ int status, i;
+ struct session_list *slp = (struct session_list *) slpv;
+
+ if (usm_build_probe_pdu(&pdu) != 0) {
+ DEBUGMSGTL(("snmp_api", "unable to create probe PDU\n"));
+ return SNMP_ERR_GENERR;
+ }
+ DEBUGMSGTL(("snmp_api", "probing for engineID...\n"));
+ session->flags |= SNMP_FLAGS_DONT_PROBE; /* prevent recursion */
+ status = snmp_sess_synch_response(slp, pdu, &response);
+
+ if ((response == NULL) && (status == STAT_SUCCESS)) {
+ status = STAT_ERROR;
+ }
+
+ switch (status) {
+ case STAT_SUCCESS:
+ session->s_snmp_errno = SNMPERR_INVALID_MSG; /* XX?? */
+ DEBUGMSGTL(("snmp_sess_open",
+ "error: expected Report as response to probe: %s (%ld)\n",
+ snmp_errstring(response->errstat),
+ response->errstat));
+ break;
+ case STAT_ERROR: /* this is what we expected -> Report == STAT_ERROR */
+ session->s_snmp_errno = SNMPERR_UNKNOWN_ENG_ID;
+ break;
+ case STAT_TIMEOUT:
+ session->s_snmp_errno = SNMPERR_TIMEOUT;
+ break;
+ default:
+ DEBUGMSGTL(("snmp_sess_open",
+ "unable to connect with remote engine: %s (%d)\n",
+ snmp_api_errstring(session->s_snmp_errno),
+ session->s_snmp_errno));
+ break;
+ }
+
+ if (slp->session->securityEngineIDLen == 0) {
+ DEBUGMSGTL(("snmp_api",
+ "unable to determine remote engine ID\n"));
+ /* clear the flag so that probe occurs on next inform */
+ session->flags &= ~SNMP_FLAGS_DONT_PROBE;
+ return SNMP_ERR_GENERR;
+ }
+
+ session->s_snmp_errno = SNMPERR_SUCCESS;
+ if (snmp_get_do_debugging()) {
+ DEBUGMSGTL(("snmp_sess_open",
+ " probe found engineID: "));
+ for (i = 0; i < slp->session->securityEngineIDLen; i++)
+ DEBUGMSG(("snmp_sess_open", "%02x",
+ slp->session->securityEngineID[i]));
+ DEBUGMSG(("snmp_sess_open", "\n"));
+ }
+
+ /*
+ * if boot/time supplied set it for this engineID
+ */
+ if (session->engineBoots || session->engineTime) {
+ set_enginetime(session->securityEngineID,
+ session->securityEngineIDLen,
+ session->engineBoots, session->engineTime,
+ TRUE);
+ }
+ return SNMPERR_SUCCESS;
+}
+
+void
+init_usm(void)
+{
+ struct snmp_secmod_def *def;
+ char *type;
+
+ DEBUGMSGTL(("init_usm", "unit_usm: %" NETSNMP_PRIo "u %" NETSNMP_PRIo "u\n",
+ usmNoPrivProtocol[0], usmNoPrivProtocol[1]));
+
+ sc_init(); /* initalize scapi code */
+
+ /*
+ * register ourselves as a security service
+ */
+ def = SNMP_MALLOC_STRUCT(snmp_secmod_def);
+ if (def == NULL)
+ return;
+ /*
+ * XXX: def->init_sess_secmod move stuff from snmp_api.c
+ */
+ def->encode_reverse = usm_secmod_rgenerate_out_msg;
+ def->encode_forward = usm_secmod_generate_out_msg;
+ def->decode = usm_secmod_process_in_msg;
+ def->pdu_free_state_ref = usm_free_usmStateReference;
+ def->session_setup = usm_session_init;
+ def->handle_report = usm_handle_report;
+ def->probe_engineid = usm_discover_engineid;
+ def->post_probe_engineid = usm_create_user_from_session_hook;
+ register_sec_mod(USM_SEC_MODEL_NUMBER, "usm", def);
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_PREMIB_READ_CONFIG,
+ init_usm_post_config, NULL);
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_SHUTDOWN,
+ deinit_usm_post_config, NULL);
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_SHUTDOWN,
+ free_engineID, NULL);
+
+ register_config_handler("snmp", "defAuthType", snmpv3_authtype_conf,
+ NULL, "MD5|SHA");
+ register_config_handler("snmp", "defPrivType", snmpv3_privtype_conf,
+ NULL,
+#ifdef HAVE_AES
+ "DES|AES"
+#else
+ "DES (AES support not available)"
+#endif
+ );
+
+ /*
+ * Free stuff at shutdown time
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_SHUTDOWN,
+ free_enginetime_on_shutdown, NULL);
+
+
+ type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_APPTYPE);
+
+ register_config_handler(type, "userSetAuthPass", usm_set_password,
+ NULL, NULL);
+ register_config_handler(type, "userSetPrivPass", usm_set_password,
+ NULL, NULL);
+ register_config_handler(type, "userSetAuthKey", usm_set_password, NULL,
+ NULL);
+ register_config_handler(type, "userSetPrivKey", usm_set_password, NULL,
+ NULL);
+ register_config_handler(type, "userSetAuthLocalKey", usm_set_password,
+ NULL, NULL);
+ register_config_handler(type, "userSetPrivLocalKey", usm_set_password,
+ NULL, NULL);
+}
+
+void
+init_usm_conf(const char *app)
+{
+ register_config_handler(app, "usmUser",
+ usm_parse_config_usmUser, NULL, NULL);
+ register_config_handler(app, "createUser",
+ usm_parse_create_usmUser, NULL,
+ "username [-e ENGINEID] (MD5|SHA) authpassphrase [DES [privpassphrase]]");
+
+ /*
+ * we need to be called back later
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ usm_store_users, NULL);
+}
+
+/*
+ * initializations for the USM.
+ *
+ * Should be called after the (engineid) configuration files have been read.
+ *
+ * Set "arbitrary" portion of salt to a random number.
+ */
+int
+init_usm_post_config(int majorid, int minorid, void *serverarg,
+ void *clientarg)
+{
+ size_t salt_integer_len = sizeof(salt_integer);
+
+ if (sc_random((u_char *) & salt_integer, &salt_integer_len) !=
+ SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("usm", "sc_random() failed: using time() as salt.\n"));
+ salt_integer = (u_int) time(NULL);
+ }
+
+#ifdef HAVE_AES
+ salt_integer_len = sizeof (salt_integer64_1);
+ if (sc_random((u_char *) & salt_integer64_1, &salt_integer_len) !=
+ SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("usm", "sc_random() failed: using time() as aes1 salt.\n"));
+ salt_integer64_1 = (u_int) time(NULL);
+ }
+ salt_integer_len = sizeof (salt_integer64_1);
+ if (sc_random((u_char *) & salt_integer64_2, &salt_integer_len) !=
+ SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("usm", "sc_random() failed: using time() as aes2 salt.\n"));
+ salt_integer64_2 = (u_int) time(NULL);
+ }
+#endif
+
+#ifndef NETSNMP_DISABLE_MD5
+ noNameUser = usm_create_initial_user("", usmHMACMD5AuthProtocol,
+ USM_LENGTH_OID_TRANSFORM,
+#ifndef NETSNMP_DISABLE_DES
+ usmDESPrivProtocol,
+#else
+ usmAESPrivProtocol,
+#endif
+ USM_LENGTH_OID_TRANSFORM);
+#else
+ noNameUser = usm_create_initial_user("", usmHMACSHA1AuthProtocol,
+ USM_LENGTH_OID_TRANSFORM,
+#ifndef NETSNMP_DISABLE_DES
+ usmDESPrivProtocol,
+#else
+ usmAESPrivProtocol,
+#endif
+ USM_LENGTH_OID_TRANSFORM);
+#endif
+
+ if ( noNameUser ) {
+ SNMP_FREE(noNameUser->engineID);
+ noNameUser->engineIDLen = 0;
+ }
+
+ return SNMPERR_SUCCESS;
+} /* end init_usm_post_config() */
+
+int
+deinit_usm_post_config(int majorid, int minorid, void *serverarg,
+ void *clientarg)
+{
+ if (usm_free_user(noNameUser) != NULL) {
+ DEBUGMSGTL(("deinit_usm_post_config", "could not free initial user\n"));
+ return SNMPERR_GENERR;
+ }
+ noNameUser = NULL;
+
+ DEBUGMSGTL(("deinit_usm_post_config", "initial user removed\n"));
+ return SNMPERR_SUCCESS;
+} /* end deinit_usm_post_config() */
+
+void
+clear_user_list(void)
+{
+ struct usmUser *tmp = userList, *next = NULL;
+
+ while (tmp != NULL) {
+ next = tmp->next;
+ usm_free_user(tmp);
+ tmp = next;
+ }
+ userList = NULL;
+
+}
+
+void
+shutdown_usm(void)
+{
+ free_etimelist();
+ clear_user_list();
+}
+
+/*******************************************************************-o-******
+ * usm_check_secLevel
+ *
+ * Parameters:
+ * level
+ * *user
+ *
+ * Returns:
+ * 0 On success,
+ * -1 Otherwise.
+ *
+ * Checks that a given security level is valid for a given user.
+ */
+int
+usm_check_secLevel(int level, struct usmUser *user)
+{
+
+ if (user->userStatus != RS_ACTIVE)
+ return -1;
+
+ DEBUGMSGTL(("comparex", "Comparing: %" NETSNMP_PRIo "u %" NETSNMP_PRIo "u ",
+ usmNoPrivProtocol[0], usmNoPrivProtocol[1]));
+ DEBUGMSGOID(("comparex", usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid)));
+ DEBUGMSG(("comparex", "\n"));
+ if (level == SNMP_SEC_LEVEL_AUTHPRIV
+ && (netsnmp_oid_equals(user->privProtocol, user->privProtocolLen,
+ usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid)) ==
+ 0)) {
+ DEBUGMSGTL(("usm", "Level: %d\n", level));
+ DEBUGMSGTL(("usm", "User (%s) Auth Protocol: ", user->name));
+ DEBUGMSGOID(("usm", user->authProtocol, user->authProtocolLen));
+ DEBUGMSG(("usm", ", User Priv Protocol: "));
+ DEBUGMSGOID(("usm", user->privProtocol, user->privProtocolLen));
+ DEBUGMSG(("usm", "\n"));
+ return 1;
+ }
+ if ((level == SNMP_SEC_LEVEL_AUTHPRIV
+ || level == SNMP_SEC_LEVEL_AUTHNOPRIV)
+ &&
+ (netsnmp_oid_equals
+ (user->authProtocol, user->authProtocolLen, usmNoAuthProtocol,
+ sizeof(usmNoAuthProtocol) / sizeof(oid)) == 0)) {
+ DEBUGMSGTL(("usm", "Level: %d\n", level));
+ DEBUGMSGTL(("usm", "User (%s) Auth Protocol: ", user->name));
+ DEBUGMSGOID(("usm", user->authProtocol, user->authProtocolLen));
+ DEBUGMSG(("usm", ", User Priv Protocol: "));
+ DEBUGMSGOID(("usm", user->privProtocol, user->privProtocolLen));
+ DEBUGMSG(("usm", "\n"));
+ return 1;
+ }
+
+ return 0;
+
+} /* end usm_check_secLevel() */
+
+
+
+
+/*******************************************************************-o-******
+ * usm_check_secLevel_vs_protocols
+ *
+ * Parameters:
+ * level
+ * *authProtocol
+ * authProtocolLen
+ * *privProtocol
+ * privProtocolLen
+ *
+ * Returns:
+ * 0 On success,
+ * 1 Otherwise.
+ *
+ * Same as above but with explicitly named transform types instead of taking
+ * from the usmUser structure.
+ */
+int
+usm_check_secLevel_vs_protocols(int level,
+ const oid * authProtocol,
+ u_int authProtocolLen,
+ const oid * privProtocol,
+ u_int privProtocolLen)
+{
+
+ if (level == SNMP_SEC_LEVEL_AUTHPRIV
+ &&
+ (netsnmp_oid_equals
+ (privProtocol, privProtocolLen, usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid)) == 0)) {
+ DEBUGMSGTL(("usm", "Level: %d\n", level));
+ DEBUGMSGTL(("usm", "Auth Protocol: "));
+ DEBUGMSGOID(("usm", authProtocol, authProtocolLen));
+ DEBUGMSG(("usm", ", Priv Protocol: "));
+ DEBUGMSGOID(("usm", privProtocol, privProtocolLen));
+ DEBUGMSG(("usm", "\n"));
+ return 1;
+ }
+ if ((level == SNMP_SEC_LEVEL_AUTHPRIV
+ || level == SNMP_SEC_LEVEL_AUTHNOPRIV)
+ &&
+ (netsnmp_oid_equals
+ (authProtocol, authProtocolLen, usmNoAuthProtocol,
+ sizeof(usmNoAuthProtocol) / sizeof(oid)) == 0)) {
+ DEBUGMSGTL(("usm", "Level: %d\n", level));
+ DEBUGMSGTL(("usm", "Auth Protocol: "));
+ DEBUGMSGOID(("usm", authProtocol, authProtocolLen));
+ DEBUGMSG(("usm", ", Priv Protocol: "));
+ DEBUGMSGOID(("usm", privProtocol, privProtocolLen));
+ DEBUGMSG(("usm", "\n"));
+ return 1;
+ }
+
+ return 0;
+
+} /* end usm_check_secLevel_vs_protocols() */
+
+
+
+
+/*
+ * usm_get_user(): Returns a user from userList based on the engineID,
+ * engineIDLen and name of the requested user.
+ */
+
+struct usmUser *
+usm_get_user(u_char * engineID, size_t engineIDLen, char *name)
+{
+ DEBUGMSGTL(("usm", "getting user %s\n", name));
+ return usm_get_user_from_list(engineID, engineIDLen, name, userList,
+ 1);
+}
+
+struct usmUser *
+usm_get_user_from_list(u_char * engineID, size_t engineIDLen,
+ char *name, struct usmUser *puserList,
+ int use_default)
+{
+ struct usmUser *ptr;
+ char noName[] = "";
+ if (name == NULL)
+ name = noName;
+ for (ptr = puserList; ptr != NULL; ptr = ptr->next) {
+ if (ptr->name && !strcmp(ptr->name, name)) {
+ DEBUGMSGTL(("usm", "match on user %s\n", ptr->name));
+ if (ptr->engineIDLen == engineIDLen &&
+ ((ptr->engineID == NULL && engineID == NULL) ||
+ (ptr->engineID != NULL && engineID != NULL &&
+ memcmp(ptr->engineID, engineID, engineIDLen) == 0)))
+ return ptr;
+ DEBUGMSGTL(("usm", "no match on engineID ("));
+ if (engineID) {
+ DEBUGMSGHEX(("usm", engineID, engineIDLen));
+ } else {
+ DEBUGMSGTL(("usm", "Empty EngineID"));
+ }
+ DEBUGMSG(("usm", ")\n"));
+ }
+ }
+
+ /*
+ * return "" user used to facilitate engineID discovery
+ */
+ if (use_default && !strcmp(name, ""))
+ return noNameUser;
+ return NULL;
+}
+
+/*
+ * usm_add_user(): Add's a user to the userList, sorted by the
+ * engineIDLength then the engineID then the name length then the name
+ * to facilitate getNext calls on a usmUser table which is indexed by
+ * these values.
+ *
+ * returns the head of the list (which could change due to this add).
+ */
+
+struct usmUser *
+usm_add_user(struct usmUser *user)
+{
+ struct usmUser *uptr;
+ uptr = usm_add_user_to_list(user, userList);
+ if (uptr != NULL)
+ userList = uptr;
+ return uptr;
+}
+
+struct usmUser *
+usm_add_user_to_list(struct usmUser *user, struct usmUser *puserList)
+{
+ struct usmUser *nptr, *pptr, *optr;
+
+ /*
+ * loop through puserList till we find the proper, sorted place to
+ * insert the new user
+ */
+ /* XXX - how to handle a NULL user->name ?? */
+ /* XXX - similarly for a NULL nptr->name ?? */
+ for (nptr = puserList, pptr = NULL; nptr != NULL;
+ pptr = nptr, nptr = nptr->next) {
+ if (nptr->engineIDLen > user->engineIDLen)
+ break;
+
+ if (user->engineID == NULL && nptr->engineID != NULL)
+ break;
+
+ if (nptr->engineIDLen == user->engineIDLen &&
+ (nptr->engineID != NULL && user->engineID != NULL &&
+ memcmp(nptr->engineID, user->engineID,
+ user->engineIDLen) > 0))
+ break;
+
+ if (!(nptr->engineID == NULL && user->engineID != NULL)) {
+ if (nptr->engineIDLen == user->engineIDLen &&
+ ((nptr->engineID == NULL && user->engineID == NULL) ||
+ memcmp(nptr->engineID, user->engineID,
+ user->engineIDLen) == 0)
+ && strlen(nptr->name) > strlen(user->name))
+ break;
+
+ if (nptr->engineIDLen == user->engineIDLen &&
+ ((nptr->engineID == NULL && user->engineID == NULL) ||
+ memcmp(nptr->engineID, user->engineID,
+ user->engineIDLen) == 0)
+ && strlen(nptr->name) == strlen(user->name)
+ && strcmp(nptr->name, user->name) > 0)
+ break;
+
+ if (nptr->engineIDLen == user->engineIDLen &&
+ ((nptr->engineID == NULL && user->engineID == NULL) ||
+ memcmp(nptr->engineID, user->engineID,
+ user->engineIDLen) == 0)
+ && strlen(nptr->name) == strlen(user->name)
+ && strcmp(nptr->name, user->name) == 0) {
+ /*
+ * the user is an exact match of a previous entry.
+ * Credentials may be different, though, so remove
+ * the old entry (and add the new one)!
+ */
+ if (pptr) { /* change prev's next pointer */
+ pptr->next = nptr->next;
+ }
+ if (nptr->next) { /* change next's prev pointer */
+ nptr->next->prev = pptr;
+ }
+ optr = nptr;
+ nptr = optr->next; /* add new user at this position */
+ /* free the old user */
+ optr->next=NULL;
+ optr->prev=NULL;
+ usm_free_user(optr);
+ break; /* new user will be added below */
+ }
+ }
+ }
+
+ /*
+ * nptr should now point to the user that we need to add ourselves
+ * in front of, and pptr should be our new 'prev'.
+ */
+
+ /*
+ * change our pointers
+ */
+ user->prev = pptr;
+ user->next = nptr;
+
+ /*
+ * change the next's prev pointer
+ */
+ if (user->next)
+ user->next->prev = user;
+
+ /*
+ * change the prev's next pointer
+ */
+ if (user->prev)
+ user->prev->next = user;
+
+ /*
+ * 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 (pptr = user; pptr->prev != NULL; pptr = pptr->prev);
+ return pptr;
+}
+
+/*
+ * usm_remove_user(): finds and removes a user from a list
+ */
+struct usmUser *
+usm_remove_user(struct usmUser *user)
+{
+ return usm_remove_user_from_list(user, &userList);
+}
+
+struct usmUser *
+usm_remove_user_from_list(struct usmUser *user,
+ struct usmUser **ppuserList)
+{
+ struct usmUser *nptr, *pptr;
+
+ /*
+ * NULL pointers aren't allowed
+ */
+ if (ppuserList == NULL)
+ return NULL;
+
+ if (*ppuserList == NULL)
+ return NULL;
+
+ /*
+ * find the user in the list
+ */
+ for (nptr = *ppuserList, pptr = NULL; nptr != NULL;
+ pptr = nptr, nptr = nptr->next) {
+ if (nptr == user)
+ break;
+ }
+
+ if (nptr) {
+ /*
+ * remove the user from the linked list
+ */
+ if (pptr) {
+ pptr->next = nptr->next;
+ }
+ if (nptr->next) {
+ nptr->next->prev = pptr;
+ }
+ } else {
+ /*
+ * user didn't exist
+ */
+ return NULL;
+ }
+ if (nptr == *ppuserList) /* we're the head of the list, need to change
+ * * the head to the next user */
+ *ppuserList = nptr->next;
+ return *ppuserList;
+} /* end usm_remove_user_from_list() */
+
+
+
+
+/*
+ * usm_free_user(): calls free() on all needed parts of struct usmUser and
+ * the user himself.
+ *
+ * Note: This should *not* be called on an object in a list (IE,
+ * remove it from the list first, and set next and prev to NULL), but
+ * will try to reconnect the list pieces again if it is called this
+ * way. If called on the head of the list, the entire list will be
+ * lost.
+ */
+struct usmUser *
+usm_free_user(struct usmUser *user)
+{
+ if (user == NULL)
+ return NULL;
+
+ SNMP_FREE(user->engineID);
+ SNMP_FREE(user->name);
+ SNMP_FREE(user->secName);
+ SNMP_FREE(user->cloneFrom);
+ SNMP_FREE(user->userPublicString);
+ SNMP_FREE(user->authProtocol);
+ SNMP_FREE(user->privProtocol);
+
+ if (user->authKey != NULL) {
+ SNMP_ZERO(user->authKey, user->authKeyLen);
+ SNMP_FREE(user->authKey);
+ }
+
+ if (user->privKey != NULL) {
+ SNMP_ZERO(user->privKey, user->privKeyLen);
+ SNMP_FREE(user->privKey);
+ }
+
+
+ /*
+ * FIX Why not put this check *first?*
+ */
+ if (user->prev != NULL) { /* ack, this shouldn't happen */
+ user->prev->next = user->next;
+ }
+ if (user->next != NULL) {
+ user->next->prev = user->prev;
+ if (user->prev != NULL) /* ack this is really bad, because it means
+ * * we'll loose the head of some structure tree */
+ DEBUGMSGTL(("usm",
+ "Severe: Asked to free the head of a usmUser tree somewhere."));
+ }
+
+
+ SNMP_ZERO(user, sizeof(*user));
+ SNMP_FREE(user);
+
+ return NULL; /* for convenience to returns from calling functions */
+
+} /* end usm_free_user() */
+
+
+
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+/*
+ * take a given user and clone the security info into another
+ */
+struct usmUser *
+usm_cloneFrom_user(struct usmUser *from, struct usmUser *to)
+{
+ /*
+ * copy the authProtocol oid row pointer
+ */
+ SNMP_FREE(to->authProtocol);
+
+ if ((to->authProtocol =
+ snmp_duplicate_objid(from->authProtocol,
+ from->authProtocolLen)) != NULL)
+ to->authProtocolLen = from->authProtocolLen;
+ else
+ to->authProtocolLen = 0;
+
+
+ /*
+ * copy the authKey
+ */
+ SNMP_FREE(to->authKey);
+
+ if (from->authKeyLen > 0 &&
+ (to->authKey = (u_char *) malloc(from->authKeyLen))
+ != NULL) {
+ to->authKeyLen = from->authKeyLen;
+ memcpy(to->authKey, from->authKey, to->authKeyLen);
+ } else {
+ to->authKey = NULL;
+ to->authKeyLen = 0;
+ }
+
+
+ /*
+ * copy the privProtocol oid row pointer
+ */
+ SNMP_FREE(to->privProtocol);
+
+ if ((to->privProtocol =
+ snmp_duplicate_objid(from->privProtocol,
+ from->privProtocolLen)) != NULL)
+ to->privProtocolLen = from->privProtocolLen;
+ else
+ to->privProtocolLen = 0;
+
+ /*
+ * copy the privKey
+ */
+ SNMP_FREE(to->privKey);
+
+ if (from->privKeyLen > 0 &&
+ (to->privKey = (u_char *) malloc(from->privKeyLen))
+ != NULL) {
+ to->privKeyLen = from->privKeyLen;
+ memcpy(to->privKey, from->privKey, to->privKeyLen);
+ } else {
+ to->privKey = NULL;
+ to->privKeyLen = 0;
+ }
+ return to;
+}
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+/*
+ * usm_create_user(void):
+ * create a default empty user, instantiating only the auth/priv
+ * protocols to noAuth and noPriv OID pointers
+ */
+struct usmUser *
+usm_create_user(void)
+{
+ struct usmUser *newUser;
+
+ /*
+ * create the new user
+ */
+ newUser = (struct usmUser *) calloc(1, sizeof(struct usmUser));
+ if (newUser == NULL)
+ return NULL;
+
+ /*
+ * fill the auth/priv protocols
+ */
+ if ((newUser->authProtocol =
+ snmp_duplicate_objid(usmNoAuthProtocol,
+ sizeof(usmNoAuthProtocol) / sizeof(oid))) ==
+ NULL)
+ return usm_free_user(newUser);
+ newUser->authProtocolLen = sizeof(usmNoAuthProtocol) / sizeof(oid);
+
+ if ((newUser->privProtocol =
+ snmp_duplicate_objid(usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid))) ==
+ NULL)
+ return usm_free_user(newUser);
+ newUser->privProtocolLen = sizeof(usmNoPrivProtocol) / sizeof(oid);
+
+ /*
+ * set the storage type to nonvolatile, and the status to ACTIVE
+ */
+ newUser->userStorageType = ST_NONVOLATILE;
+ newUser->userStatus = RS_ACTIVE;
+ return newUser;
+
+} /* end usm_clone_user() */
+
+
+
+
+/*
+ * usm_create_initial_user(void):
+ * creates an initial user, filled with the defaults defined in the
+ * USM document.
+ */
+struct usmUser *
+usm_create_initial_user(const char *name,
+ const oid * authProtocol, size_t authProtocolLen,
+ const oid * privProtocol, size_t privProtocolLen)
+{
+ struct usmUser *newUser = usm_create_user();
+ if (newUser == NULL)
+ return NULL;
+
+ if ((newUser->name = strdup(name)) == NULL)
+ return usm_free_user(newUser);
+
+ if ((newUser->secName = strdup(name)) == NULL)
+ return usm_free_user(newUser);
+
+ if ((newUser->engineID =
+ snmpv3_generate_engineID(&newUser->engineIDLen)) == NULL)
+ return usm_free_user(newUser);
+
+ if ((newUser->cloneFrom = (oid *) malloc(sizeof(oid) * 2)) == NULL)
+ return usm_free_user(newUser);
+ newUser->cloneFrom[0] = 0;
+ newUser->cloneFrom[1] = 0;
+ newUser->cloneFromLen = 2;
+
+ SNMP_FREE(newUser->privProtocol);
+ if ((newUser->privProtocol = snmp_duplicate_objid(privProtocol,
+ privProtocolLen)) ==
+ NULL) {
+ return usm_free_user(newUser);
+ }
+ newUser->privProtocolLen = privProtocolLen;
+
+ SNMP_FREE(newUser->authProtocol);
+ if ((newUser->authProtocol = snmp_duplicate_objid(authProtocol,
+ authProtocolLen)) ==
+ NULL) {
+ return usm_free_user(newUser);
+ }
+ newUser->authProtocolLen = authProtocolLen;
+
+ newUser->userStatus = RS_ACTIVE;
+ newUser->userStorageType = ST_READONLY;
+
+ return newUser;
+}
+
+/*
+ * this is a callback that can store all known users based on a
+ * previously registered application ID
+ */
+int
+usm_store_users(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ /*
+ * figure out our application name
+ */
+ char *appname = (char *) clientarg;
+ if (appname == NULL) {
+ appname = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ }
+
+ /*
+ * save the user base
+ */
+ usm_save_users("usmUser", appname);
+
+ /*
+ * never fails
+ */
+ return SNMPERR_SUCCESS;
+}
+
+
+/*
+ * usm_save_users(): saves a list of users to the persistent cache
+ */
+void
+usm_save_users(const char *token, const char *type)
+{
+ usm_save_users_from_list(userList, token, type);
+}
+
+void
+usm_save_users_from_list(struct usmUser *puserList, const char *token,
+ const char *type)
+{
+ struct usmUser *uptr;
+ for (uptr = puserList; uptr != NULL; uptr = uptr->next) {
+ if (uptr->userStorageType == ST_NONVOLATILE)
+ usm_save_user(uptr, token, type);
+ }
+}
+
+/*
+ * usm_save_user(): saves a user to the persistent cache
+ */
+void
+usm_save_user(struct usmUser *user, const char *token, const char *type)
+{
+ char line[4096];
+ char *cptr;
+
+ memset(line, 0, sizeof(line));
+
+ sprintf(line, "%s %d %d ", token, user->userStatus,
+ user->userStorageType);
+ cptr = &line[strlen(line)]; /* the NULL */
+ cptr =
+ read_config_save_octet_string(cptr, user->engineID,
+ user->engineIDLen);
+ *cptr++ = ' ';
+ cptr = read_config_save_octet_string(cptr, (u_char *) user->name,
+ (user->name == NULL) ? 0 :
+ strlen(user->name));
+ *cptr++ = ' ';
+ cptr = read_config_save_octet_string(cptr, (u_char *) user->secName,
+ (user->secName == NULL) ? 0 :
+ strlen(user->secName));
+ *cptr++ = ' ';
+ cptr =
+ read_config_save_objid(cptr, user->cloneFrom, user->cloneFromLen);
+ *cptr++ = ' ';
+ cptr = read_config_save_objid(cptr, user->authProtocol,
+ user->authProtocolLen);
+ *cptr++ = ' ';
+ cptr =
+ read_config_save_octet_string(cptr, user->authKey,
+ user->authKeyLen);
+ *cptr++ = ' ';
+ cptr = read_config_save_objid(cptr, user->privProtocol,
+ user->privProtocolLen);
+ *cptr++ = ' ';
+ cptr =
+ read_config_save_octet_string(cptr, user->privKey,
+ user->privKeyLen);
+ *cptr++ = ' ';
+ cptr = read_config_save_octet_string(cptr, user->userPublicString,
+ user->userPublicStringLen);
+
+ read_config_store(type, line);
+}
+
+/*
+ * usm_parse_user(): reads in a line containing a saved user profile
+ * and returns a pointer to a newly created struct usmUser.
+ */
+struct usmUser *
+usm_read_user(const char *line)
+{
+ struct usmUser *user;
+ size_t len;
+ size_t expected_privKeyLen = 0;
+
+ user = usm_create_user();
+ if (user == NULL)
+ return NULL;
+
+ user->userStatus = atoi(line);
+ line = skip_token_const(line);
+ user->userStorageType = atoi(line);
+ line = skip_token_const(line);
+ line = read_config_read_octet_string_const(line, &user->engineID,
+ &user->engineIDLen);
+
+ /*
+ * set the lcd entry for this engineID to the minimum boots/time
+ * values so that its a known engineid and won't return a report pdu.
+ * This is mostly important when receiving v3 traps so that the usm
+ * will at least continue processing them.
+ */
+ set_enginetime(user->engineID, user->engineIDLen, 1, 0, 0);
+
+ line = read_config_read_octet_string(line, (u_char **) & user->name,
+ &len);
+ line = read_config_read_octet_string(line, (u_char **) & user->secName,
+ &len);
+ SNMP_FREE(user->cloneFrom);
+ user->cloneFromLen = 0;
+
+ line = read_config_read_objid_const(line, &user->cloneFrom,
+ &user->cloneFromLen);
+
+ SNMP_FREE(user->authProtocol);
+ user->authProtocolLen = 0;
+
+ line = read_config_read_objid_const(line, &user->authProtocol,
+ &user->authProtocolLen);
+ line = read_config_read_octet_string_const(line, &user->authKey,
+ &user->authKeyLen);
+ SNMP_FREE(user->privProtocol);
+ user->privProtocolLen = 0;
+
+ line = read_config_read_objid_const(line, &user->privProtocol,
+ &user->privProtocolLen);
+ line = read_config_read_octet_string(line, &user->privKey,
+ &user->privKeyLen);
+#ifndef NETSNMP_DISABLE_DES
+ if (ISTRANSFORM(user->privProtocol, DESPriv)) {
+ /* DES uses a 128 bit key, 64 bits of which is a salt */
+ expected_privKeyLen = 16;
+ }
+#endif
+#ifdef HAVE_AES
+ if (ISTRANSFORM(user->privProtocol, AESPriv)) {
+ expected_privKeyLen = 16;
+ }
+#endif
+ /* For backwards compatibility */
+ if (user->privKeyLen > expected_privKeyLen) {
+ user->privKeyLen = expected_privKeyLen;
+ }
+
+ line = read_config_read_octet_string(line, &user->userPublicString,
+ &user->userPublicStringLen);
+ return user;
+}
+
+/*
+ * snmpd.conf parsing routines
+ */
+void
+usm_parse_config_usmUser(const char *token, char *line)
+{
+ struct usmUser *uptr;
+
+ uptr = usm_read_user(line);
+ if ( uptr)
+ usm_add_user(uptr);
+}
+
+
+
+
+/*******************************************************************-o-******
+ * usm_set_password
+ *
+ * Parameters:
+ * *token
+ * *line
+ *
+ *
+ * format: userSetAuthPass secname engineIDLen engineID pass
+ * or: userSetPrivPass secname engineIDLen engineID pass
+ * or: userSetAuthKey secname engineIDLen engineID KuLen Ku
+ * or: userSetPrivKey secname engineIDLen engineID KuLen Ku
+ * or: userSetAuthLocalKey secname engineIDLen engineID KulLen Kul
+ * or: userSetPrivLocalKey secname engineIDLen engineID KulLen Kul
+ *
+ * type is: 1=passphrase; 2=Ku; 3=Kul.
+ *
+ *
+ * ASSUMES Passwords are null-terminated printable strings.
+ */
+void
+usm_set_password(const char *token, char *line)
+{
+ char *cp;
+ char nameBuf[SNMP_MAXBUF];
+ u_char *engineID = NULL;
+ size_t engineIDLen = 0;
+ struct usmUser *user;
+
+ cp = copy_nword(line, nameBuf, sizeof(nameBuf));
+ if (cp == NULL) {
+ config_perror("invalid name specifier");
+ return;
+ }
+
+ DEBUGMSGTL(("usm", "comparing: %s and %s\n", cp, WILDCARDSTRING));
+ if (strncmp(cp, WILDCARDSTRING, strlen(WILDCARDSTRING)) == 0) {
+ /*
+ * match against all engineIDs we know about
+ */
+ cp = skip_token(cp);
+ for (user = userList; user != NULL; user = user->next) {
+ if (user->secName && strcmp(user->secName, nameBuf) == 0) {
+ usm_set_user_password(user, token, cp);
+ }
+ }
+ } else {
+ cp = read_config_read_octet_string(cp, &engineID, &engineIDLen);
+ if (cp == NULL) {
+ config_perror("invalid engineID specifier");
+ SNMP_FREE(engineID);
+ return;
+ }
+
+ user = usm_get_user(engineID, engineIDLen, nameBuf);
+ if (user == NULL) {
+ config_perror("not a valid user/engineID pair");
+ SNMP_FREE(engineID);
+ return;
+ }
+ usm_set_user_password(user, token, cp);
+ SNMP_FREE(engineID);
+ }
+}
+
+/*
+ * uses the rest of LINE to configure USER's password of type TOKEN
+ */
+void
+usm_set_user_password(struct usmUser *user, const char *token, char *line)
+{
+ char *cp = line;
+ u_char *engineID = user->engineID;
+ size_t engineIDLen = user->engineIDLen;
+
+ u_char **key;
+ size_t *keyLen;
+ u_char userKey[SNMP_MAXBUF_SMALL];
+ size_t userKeyLen = SNMP_MAXBUF_SMALL;
+ u_char *userKeyP = userKey;
+ int type, ret;
+
+ /*
+ * Retrieve the "old" key and set the key type.
+ */
+ if (!token) {
+ return;
+ } else if (strcmp(token, "userSetAuthPass") == 0) {
+ key = &user->authKey;
+ keyLen = &user->authKeyLen;
+ type = 0;
+ } else if (strcmp(token, "userSetPrivPass") == 0) {
+ key = &user->privKey;
+ keyLen = &user->privKeyLen;
+ type = 0;
+ } else if (strcmp(token, "userSetAuthKey") == 0) {
+ key = &user->authKey;
+ keyLen = &user->authKeyLen;
+ type = 1;
+ } else if (strcmp(token, "userSetPrivKey") == 0) {
+ key = &user->privKey;
+ keyLen = &user->privKeyLen;
+ type = 1;
+ } else if (strcmp(token, "userSetAuthLocalKey") == 0) {
+ key = &user->authKey;
+ keyLen = &user->authKeyLen;
+ type = 2;
+ } else if (strcmp(token, "userSetPrivLocalKey") == 0) {
+ key = &user->privKey;
+ keyLen = &user->privKeyLen;
+ type = 2;
+ } else {
+ /*
+ * no old key, or token was not recognized
+ */
+ return;
+ }
+
+ if (*key) {
+ /*
+ * (destroy and) free the old key
+ */
+ memset(*key, 0, *keyLen);
+ SNMP_FREE(*key);
+ }
+
+ if (type == 0) {
+ /*
+ * convert the password into a key
+ */
+ if (cp == NULL) {
+ config_perror("missing user password");
+ return;
+ }
+ ret = generate_Ku(user->authProtocol, user->authProtocolLen,
+ (u_char *) cp, strlen(cp), userKey, &userKeyLen);
+
+ if (ret != SNMPERR_SUCCESS) {
+ config_perror("setting key failed (in sc_genKu())");
+ return;
+ }
+ } else if (type == 1) {
+ cp = read_config_read_octet_string(cp, &userKeyP, &userKeyLen);
+
+ if (cp == NULL) {
+ config_perror("invalid user key");
+ return;
+ }
+ }
+
+ if (type < 2) {
+ *key = (u_char *) malloc(SNMP_MAXBUF_SMALL);
+ *keyLen = SNMP_MAXBUF_SMALL;
+ ret = generate_kul(user->authProtocol, user->authProtocolLen,
+ engineID, engineIDLen,
+ userKey, userKeyLen, *key, keyLen);
+ if (ret != SNMPERR_SUCCESS) {
+ config_perror("setting key failed (in generate_kul())");
+ return;
+ }
+
+ /*
+ * (destroy and) free the old key
+ */
+ memset(userKey, 0, sizeof(userKey));
+
+ } else {
+ /*
+ * the key is given, copy it in
+ */
+ cp = read_config_read_octet_string(cp, key, keyLen);
+
+ if (cp == NULL) {
+ config_perror("invalid localized user key");
+ return;
+ }
+ }
+} /* end usm_set_password() */
+
+void
+usm_parse_create_usmUser(const char *token, char *line)
+{
+ char *cp;
+ char buf[SNMP_MAXBUF_MEDIUM];
+ struct usmUser *newuser;
+ u_char userKey[SNMP_MAXBUF_SMALL], *tmpp;
+ size_t userKeyLen = SNMP_MAXBUF_SMALL;
+ size_t privKeyLen = 0;
+ size_t ret;
+ int ret2;
+ int testcase;
+
+ newuser = usm_create_user();
+
+ /*
+ * READ: Security Name
+ */
+ cp = copy_nword(line, buf, sizeof(buf));
+
+ /*
+ * might be a -e ENGINEID argument
+ */
+ if (strcmp(buf, "-e") == 0) {
+ size_t ebuf_len = 32, eout_len = 0;
+ u_char *ebuf = (u_char *) malloc(ebuf_len);
+
+ if (ebuf == NULL) {
+ config_perror("malloc failure processing -e flag");
+ usm_free_user(newuser);
+ return;
+ }
+
+ /*
+ * Get the specified engineid from the line.
+ */
+ cp = copy_nword(cp, buf, sizeof(buf));
+ if (!snmp_hex_to_binary(&ebuf, &ebuf_len, &eout_len, 1, buf)) {
+ config_perror("invalid EngineID argument to -e");
+ usm_free_user(newuser);
+ SNMP_FREE(ebuf);
+ return;
+ }
+
+ newuser->engineID = ebuf;
+ newuser->engineIDLen = eout_len;
+ cp = copy_nword(cp, buf, sizeof(buf));
+ } else {
+ newuser->engineID = snmpv3_generate_engineID(&ret);
+ if (ret == 0) {
+ usm_free_user(newuser);
+ return;
+ }
+ newuser->engineIDLen = ret;
+ }
+
+ newuser->secName = strdup(buf);
+ newuser->name = strdup(buf);
+
+ if (!cp)
+ goto add; /* no authentication or privacy type */
+
+ /*
+ * READ: Authentication Type
+ */
+#ifndef NETSNMP_DISABLE_MD5
+ if (strncmp(cp, "MD5", 3) == 0) {
+ memcpy(newuser->authProtocol, usmHMACMD5AuthProtocol,
+ sizeof(usmHMACMD5AuthProtocol));
+ } else
+#endif
+ if (strncmp(cp, "SHA", 3) == 0) {
+ memcpy(newuser->authProtocol, usmHMACSHA1AuthProtocol,
+ sizeof(usmHMACSHA1AuthProtocol));
+ } else {
+ config_perror("Unknown authentication protocol");
+ usm_free_user(newuser);
+ return;
+ }
+
+ cp = skip_token(cp);
+
+ /*
+ * READ: Authentication Pass Phrase or key
+ */
+ if (!cp) {
+ config_perror("no authentication pass phrase");
+ usm_free_user(newuser);
+ return;
+ }
+ cp = copy_nword(cp, buf, sizeof(buf));
+ if (strcmp(buf,"-m") == 0) {
+ /* a master key is specified */
+ cp = copy_nword(cp, buf, sizeof(buf));
+ ret = sizeof(userKey);
+ tmpp = userKey;
+ userKeyLen = 0;
+ if (!snmp_hex_to_binary(&tmpp, &ret, &userKeyLen, 0, buf)) {
+ config_perror("invalid key value argument to -m");
+ usm_free_user(newuser);
+ return;
+ }
+ } else if (strcmp(buf,"-l") != 0) {
+ /* a password is specified */
+ userKeyLen = sizeof(userKey);
+ ret2 = generate_Ku(newuser->authProtocol, newuser->authProtocolLen,
+ (u_char *) buf, strlen(buf), userKey, &userKeyLen);
+ if (ret2 != SNMPERR_SUCCESS) {
+ config_perror("could not generate the authentication key from the "
+ "supplied pass phrase.");
+ usm_free_user(newuser);
+ return;
+ }
+ }
+
+ /*
+ * And turn it into a localized key
+ */
+ ret2 = sc_get_properlength(newuser->authProtocol,
+ newuser->authProtocolLen);
+ if (ret2 <= 0) {
+ config_perror("Could not get proper authentication protocol key length");
+ usm_free_user(newuser);
+ return;
+ }
+ newuser->authKey = (u_char *) malloc(ret2);
+
+ if (strcmp(buf,"-l") == 0) {
+ /* a local key is directly specified */
+ cp = copy_nword(cp, buf, sizeof(buf));
+ newuser->authKeyLen = 0;
+ ret = ret2;
+ if (!snmp_hex_to_binary(&newuser->authKey, &ret,
+ &newuser->authKeyLen, 0, buf)) {
+ config_perror("invalid key value argument to -l");
+ usm_free_user(newuser);
+ return;
+ }
+ if (ret != newuser->authKeyLen) {
+ config_perror("improper key length to -l");
+ usm_free_user(newuser);
+ return;
+ }
+ } else {
+ newuser->authKeyLen = ret2;
+ ret2 = generate_kul(newuser->authProtocol, newuser->authProtocolLen,
+ newuser->engineID, newuser->engineIDLen,
+ userKey, userKeyLen,
+ newuser->authKey, &newuser->authKeyLen);
+ if (ret2 != SNMPERR_SUCCESS) {
+ config_perror("could not generate localized authentication key "
+ "(Kul) from the master key (Ku).");
+ usm_free_user(newuser);
+ return;
+ }
+ }
+
+ if (!cp)
+ goto add; /* no privacy type (which is legal) */
+
+ /*
+ * READ: Privacy Type
+ */
+ testcase = 0;
+#ifndef NETSNMP_DISABLE_DES
+ if (strncmp(cp, "DES", 3) == 0) {
+ memcpy(newuser->privProtocol, usmDESPrivProtocol,
+ sizeof(usmDESPrivProtocol));
+ testcase = 1;
+ /* DES uses a 128 bit key, 64 bits of which is a salt */
+ privKeyLen = 16;
+ }
+#endif
+#ifdef HAVE_AES
+ if (strncmp(cp, "AES128", 6) == 0 ||
+ strncmp(cp, "AES", 3) == 0) {
+ memcpy(newuser->privProtocol, usmAESPrivProtocol,
+ sizeof(usmAESPrivProtocol));
+ testcase = 1;
+ privKeyLen = 16;
+ }
+#endif
+ if (testcase == 0) {
+ config_perror("Unknown privacy protocol");
+ usm_free_user(newuser);
+ return;
+ }
+
+ cp = skip_token(cp);
+ /*
+ * READ: Encryption Pass Phrase or key
+ */
+ if (!cp) {
+ /*
+ * assume the same as the authentication key
+ */
+ memdup(&newuser->privKey, newuser->authKey, newuser->authKeyLen);
+ newuser->privKeyLen = newuser->authKeyLen;
+ } else {
+ cp = copy_nword(cp, buf, sizeof(buf));
+
+ if (strcmp(buf,"-m") == 0) {
+ /* a master key is specified */
+ cp = copy_nword(cp, buf, sizeof(buf));
+ ret = sizeof(userKey);
+ tmpp = userKey;
+ userKeyLen = 0;
+ if (!snmp_hex_to_binary(&tmpp, &ret, &userKeyLen, 0, buf)) {
+ config_perror("invalid key value argument to -m");
+ usm_free_user(newuser);
+ return;
+ }
+ } else if (strcmp(buf,"-l") != 0) {
+ /* a password is specified */
+ userKeyLen = sizeof(userKey);
+ ret2 = generate_Ku(newuser->authProtocol, newuser->authProtocolLen,
+ (u_char *) buf, strlen(buf), userKey, &userKeyLen);
+ if (ret2 != SNMPERR_SUCCESS) {
+ config_perror("could not generate the privacy key from the "
+ "supplied pass phrase.");
+ usm_free_user(newuser);
+ return;
+ }
+ }
+
+ /*
+ * And turn it into a localized key
+ */
+ ret2 = sc_get_properlength(newuser->authProtocol,
+ newuser->authProtocolLen);
+ if (ret2 < 0) {
+ config_perror("could not get proper key length to use for the "
+ "privacy algorithm.");
+ usm_free_user(newuser);
+ return;
+ }
+ newuser->privKey = (u_char *) malloc(ret2);
+
+ if (strcmp(buf,"-l") == 0) {
+ /* a local key is directly specified */
+ cp = copy_nword(cp, buf, sizeof(buf));
+ ret = ret2;
+ newuser->privKeyLen = 0;
+ if (!snmp_hex_to_binary(&newuser->privKey, &ret,
+ &newuser->privKeyLen, 0, buf)) {
+ config_perror("invalid key value argument to -l");
+ usm_free_user(newuser);
+ return;
+ }
+ } else {
+ newuser->privKeyLen = ret2;
+ ret2 = generate_kul(newuser->authProtocol, newuser->authProtocolLen,
+ newuser->engineID, newuser->engineIDLen,
+ userKey, userKeyLen,
+ newuser->privKey, &newuser->privKeyLen);
+ if (ret2 != SNMPERR_SUCCESS) {
+ config_perror("could not generate localized privacy key "
+ "(Kul) from the master key (Ku).");
+ usm_free_user(newuser);
+ return;
+ }
+ }
+ }
+
+ if ((newuser->privKeyLen >= privKeyLen) || (privKeyLen == 0)){
+ newuser->privKeyLen = privKeyLen;
+ }
+ else {
+ /* The privKey length is smaller than required by privProtocol */
+ usm_free_user(newuser);
+ return;
+ }
+
+ add:
+ usm_add_user(newuser);
+ DEBUGMSGTL(("usmUser", "created a new user %s at ", newuser->secName));
+ DEBUGMSGHEX(("usmUser", newuser->engineID, newuser->engineIDLen));
+ DEBUGMSG(("usmUser", "\n"));
+}
+
+void
+snmpv3_authtype_conf(const char *word, char *cptr)
+{
+#ifndef NETSNMP_DISABLE_MD5
+ if (strcasecmp(cptr, "MD5") == 0)
+ defaultAuthType = usmHMACMD5AuthProtocol;
+ else
+#endif
+ if (strcasecmp(cptr, "SHA") == 0)
+ defaultAuthType = usmHMACSHA1AuthProtocol;
+ else
+ config_perror("Unknown authentication type");
+ defaultAuthTypeLen = USM_LENGTH_OID_TRANSFORM;
+ DEBUGMSGTL(("snmpv3", "set default authentication type: %s\n", cptr));
+}
+
+const oid *
+get_default_authtype(size_t * len)
+{
+ if (defaultAuthType == NULL) {
+ defaultAuthType = SNMP_DEFAULT_AUTH_PROTO;
+ defaultAuthTypeLen = SNMP_DEFAULT_AUTH_PROTOLEN;
+ }
+ if (len)
+ *len = defaultAuthTypeLen;
+ return defaultAuthType;
+}
+
+void
+snmpv3_privtype_conf(const char *word, char *cptr)
+{
+ int testcase = 0;
+
+#ifndef NETSNMP_DISABLE_DES
+ if (strcasecmp(cptr, "DES") == 0) {
+ testcase = 1;
+ defaultPrivType = usmDESPrivProtocol;
+ }
+#endif
+
+#if HAVE_AES
+ /* XXX AES: assumes oid length == des oid length */
+ if (strcasecmp(cptr, "AES128") == 0 ||
+ strcasecmp(cptr, "AES") == 0) {
+ testcase = 1;
+ defaultPrivType = usmAES128PrivProtocol;
+ }
+#endif
+ if (testcase == 0)
+ config_perror("Unknown privacy type");
+ defaultPrivTypeLen = SNMP_DEFAULT_PRIV_PROTOLEN;
+ DEBUGMSGTL(("snmpv3", "set default privacy type: %s\n", cptr));
+}
+
+const oid *
+get_default_privtype(size_t * len)
+{
+ if (defaultPrivType == NULL) {
+#ifndef NETSNMP_DISABLE_DES
+ defaultPrivType = usmDESPrivProtocol;
+#else
+ defaultPrivType = usmAESPrivProtocol;
+#endif
+ defaultPrivTypeLen = USM_LENGTH_OID_TRANSFORM;
+ }
+ if (len)
+ *len = defaultPrivTypeLen;
+ return defaultPrivType;
+}
+
diff --git a/snmplib/snmpv3.c b/snmplib/snmpv3.c
new file mode 100644
index 0000000..435cafd
--- /dev/null
+++ b/snmplib/snmpv3.c
@@ -0,0 +1,1273 @@
+/*
+ * snmpv3.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <errno.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#include <stdio.h>
+#include <sys/types.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_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <ctype.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+/*
+ * Stuff needed for getHwAddress(...)
+ */
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/snmpv3.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/lcd_time.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/keytools.h>
+#include <net-snmp/library/lcd_time.h>
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/snmpusm.h>
+#include <net-snmp/library/transform_oids.h>
+
+#include <net-snmp/net-snmp-features.h>
+
+static u_long engineBoots = 1;
+static unsigned int engineIDType = ENGINEID_TYPE_NETSNMP_RND;
+static unsigned char *engineID = NULL;
+static size_t engineIDLength = 0;
+static unsigned char *engineIDNic = NULL;
+static unsigned int engineIDIsSet = 0; /* flag if ID set by config */
+static unsigned char *oldEngineID = NULL;
+static size_t oldEngineIDLength = 0;
+static struct timeval snmpv3starttime;
+
+#if defined(IFHWADDRLEN) && defined(SIOCGIFHWADDR)
+static int getHwAddress(const char *networkDevice, char *addressOut);
+#endif
+
+/*******************************************************************-o-******
+ * snmpv3_secLevel_conf
+ *
+ * Parameters:
+ * *word
+ * *cptr
+ *
+ * Line syntax:
+ * defSecurityLevel "noAuthNoPriv" | "authNoPriv" | "authPriv"
+ */
+
+int
+parse_secLevel_conf(const char *word, char *cptr) {
+ if (strcasecmp(cptr, "noAuthNoPriv") == 0 || strcmp(cptr, "1") == 0 ||
+ strcasecmp(cptr, "nanp") == 0) {
+ return SNMP_SEC_LEVEL_NOAUTH;
+ } else if (strcasecmp(cptr, "authNoPriv") == 0 || strcmp(cptr, "2") == 0 ||
+ strcasecmp(cptr, "anp") == 0) {
+ return SNMP_SEC_LEVEL_AUTHNOPRIV;
+ } else if (strcasecmp(cptr, "authPriv") == 0 || strcmp(cptr, "3") == 0 ||
+ strcasecmp(cptr, "ap") == 0) {
+ return SNMP_SEC_LEVEL_AUTHPRIV;
+ } else {
+ return -1;
+ }
+}
+
+void
+snmpv3_secLevel_conf(const char *word, char *cptr)
+{
+ int secLevel;
+
+ if ((secLevel = parse_secLevel_conf( word, cptr )) >= 0 ) {
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SECLEVEL, secLevel);
+ } else {
+ netsnmp_config_error("Unknown security level: %s", cptr);
+ }
+ DEBUGMSGTL(("snmpv3", "default secLevel set to: %s = %d\n", cptr,
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SECLEVEL)));
+}
+
+
+NETSNMP_IMPORT int
+snmpv3_options(char *optarg, netsnmp_session * session, char **Apsz,
+ char **Xpsz, int argc, char *const *argv);
+int
+snmpv3_options(char *optarg, netsnmp_session * session, char **Apsz,
+ char **Xpsz, int argc, char *const *argv)
+{
+ char *cp = optarg;
+ int testcase;
+ optarg++;
+ /*
+ * Support '... -3x=value ....' syntax
+ */
+ if (*optarg == '=') {
+ optarg++;
+ }
+ /*
+ * and '.... "-3x value" ....' (*with* the quotes)
+ */
+ while (*optarg && isspace((unsigned char)(*optarg))) {
+ optarg++;
+ }
+ /*
+ * Finally, handle ".... -3x value ...." syntax
+ * (*without* surrounding quotes)
+ */
+ if (!*optarg) {
+ /*
+ * We've run off the end of the argument
+ * so move on the the next.
+ */
+ optarg = argv[optind++];
+ if (optind > argc) {
+ fprintf(stderr,
+ "Missing argument after SNMPv3 '-3%c' option.\n", *cp);
+ return (-1);
+ }
+ }
+
+ switch (*cp) {
+
+ case 'Z':
+ errno=0;
+ session->engineBoots = strtoul(optarg, &cp, 10);
+ if (errno || cp == optarg) {
+ fprintf(stderr, "Need engine boots value after -3Z flag.\n");
+ return (-1);
+ }
+ if (*cp == ',') {
+ char *endptr;
+ cp++;
+ session->engineTime = strtoul(cp, &endptr, 10);
+ if (errno || cp == endptr) {
+ fprintf(stderr, "Need engine time after \"-3Z engineBoot,\".\n");
+ return (-1);
+ }
+ } else {
+ fprintf(stderr, "Need engine time after \"-3Z engineBoot,\".\n");
+ return (-1);
+ }
+ break;
+
+ case 'e':{
+ size_t ebuf_len = 32, eout_len = 0;
+ u_char *ebuf = (u_char *) malloc(ebuf_len);
+
+ if (ebuf == NULL) {
+ fprintf(stderr, "malloc failure processing -3e flag.\n");
+ return (-1);
+ }
+ if (!snmp_hex_to_binary
+ (&ebuf, &ebuf_len, &eout_len, 1, optarg)) {
+ fprintf(stderr, "Bad engine ID value after -3e flag.\n");
+ SNMP_FREE(ebuf);
+ return (-1);
+ }
+ session->securityEngineID = ebuf;
+ session->securityEngineIDLen = eout_len;
+ break;
+ }
+
+ case 'E':{
+ size_t ebuf_len = 32, eout_len = 0;
+ u_char *ebuf = (u_char *) malloc(ebuf_len);
+
+ if (ebuf == NULL) {
+ fprintf(stderr, "malloc failure processing -3E flag.\n");
+ return (-1);
+ }
+ if (!snmp_hex_to_binary
+ (&ebuf, &ebuf_len, &eout_len, 1, optarg)) {
+ fprintf(stderr, "Bad engine ID value after -3E flag.\n");
+ SNMP_FREE(ebuf);
+ return (-1);
+ }
+ session->contextEngineID = ebuf;
+ session->contextEngineIDLen = eout_len;
+ break;
+ }
+
+ case 'n':
+ session->contextName = optarg;
+ session->contextNameLen = strlen(optarg);
+ break;
+
+ case 'u':
+ session->securityName = optarg;
+ session->securityNameLen = strlen(optarg);
+ break;
+
+ case 'l':
+ if (!strcasecmp(optarg, "noAuthNoPriv") || !strcmp(optarg, "1") ||
+ !strcasecmp(optarg, "nanp")) {
+ session->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
+ } else if (!strcasecmp(optarg, "authNoPriv")
+ || !strcmp(optarg, "2") || !strcasecmp(optarg, "anp")) {
+ session->securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
+ } else if (!strcasecmp(optarg, "authPriv") || !strcmp(optarg, "3")
+ || !strcasecmp(optarg, "ap")) {
+ session->securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
+ } else {
+ fprintf(stderr,
+ "Invalid security level specified after -3l flag: %s\n",
+ optarg);
+ return (-1);
+ }
+
+ break;
+
+#ifdef NETSNMP_SECMOD_USM
+ case 'a':
+#ifndef NETSNMP_DISABLE_MD5
+ if (!strcasecmp(optarg, "MD5")) {
+ session->securityAuthProto = usmHMACMD5AuthProtocol;
+ session->securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
+ } else
+#endif
+ if (!strcasecmp(optarg, "SHA")) {
+ session->securityAuthProto = usmHMACSHA1AuthProtocol;
+ session->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
+ } else {
+ fprintf(stderr,
+ "Invalid authentication protocol specified after -3a flag: %s\n",
+ optarg);
+ return (-1);
+ }
+ break;
+
+ case 'x':
+ testcase = 0;
+#ifndef NETSNMP_DISABLE_DES
+ if (!strcasecmp(optarg, "DES")) {
+ session->securityPrivProto = usmDESPrivProtocol;
+ session->securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN;
+ testcase = 1;
+ }
+#endif
+#ifdef HAVE_AES
+ if (!strcasecmp(optarg, "AES128") ||
+ strcasecmp(optarg, "AES")) {
+ session->securityPrivProto = usmAES128PrivProtocol;
+ session->securityPrivProtoLen = USM_PRIV_PROTO_AES128_LEN;
+ testcase = 1;
+ }
+#endif
+ if (testcase == 0) {
+ fprintf(stderr,
+ "Invalid privacy protocol specified after -3x flag: %s\n",
+ optarg);
+ return (-1);
+ }
+ break;
+
+ case 'A':
+ *Apsz = optarg;
+ break;
+
+ case 'X':
+ *Xpsz = optarg;
+ break;
+#endif /* NETSNMP_SECMOD_USM */
+
+ case 'm': {
+ size_t bufSize = sizeof(session->securityAuthKey);
+ u_char *tmpp = session->securityAuthKey;
+ if (!snmp_hex_to_binary(&tmpp, &bufSize,
+ &session->securityAuthKeyLen, 0, optarg)) {
+ fprintf(stderr, "Bad key value after -3m flag.\n");
+ return (-1);
+ }
+ break;
+ }
+
+ case 'M': {
+ size_t bufSize = sizeof(session->securityPrivKey);
+ u_char *tmpp = session->securityPrivKey;
+ if (!snmp_hex_to_binary(&tmpp, &bufSize,
+ &session->securityPrivKeyLen, 0, optarg)) {
+ fprintf(stderr, "Bad key value after -3M flag.\n");
+ return (-1);
+ }
+ break;
+ }
+
+ case 'k': {
+ size_t kbuf_len = 32, kout_len = 0;
+ u_char *kbuf = (u_char *) malloc(kbuf_len);
+
+ if (kbuf == NULL) {
+ fprintf(stderr, "malloc failure processing -3k flag.\n");
+ return (-1);
+ }
+ if (!snmp_hex_to_binary
+ (&kbuf, &kbuf_len, &kout_len, 1, optarg)) {
+ fprintf(stderr, "Bad key value after -3k flag.\n");
+ SNMP_FREE(kbuf);
+ return (-1);
+ }
+ session->securityAuthLocalKey = kbuf;
+ session->securityAuthLocalKeyLen = kout_len;
+ break;
+ }
+
+ case 'K': {
+ size_t kbuf_len = 32, kout_len = 0;
+ u_char *kbuf = (u_char *) malloc(kbuf_len);
+
+ if (kbuf == NULL) {
+ fprintf(stderr, "malloc failure processing -3K flag.\n");
+ return (-1);
+ }
+ if (!snmp_hex_to_binary
+ (&kbuf, &kbuf_len, &kout_len, 1, optarg)) {
+ fprintf(stderr, "Bad key value after -3K flag.\n");
+ SNMP_FREE(kbuf);
+ return (-1);
+ }
+ session->securityPrivLocalKey = kbuf;
+ session->securityPrivLocalKeyLen = kout_len;
+ break;
+ }
+
+ default:
+ fprintf(stderr, "Unknown SNMPv3 option passed to -3: %c.\n", *cp);
+ return -1;
+ }
+ return 0;
+}
+
+/*******************************************************************-o-******
+ * setup_engineID
+ *
+ * Parameters:
+ * **eidp
+ * *text Printable (?) text to be plugged into the snmpEngineID.
+ *
+ * Return:
+ * Length of allocated engineID string in bytes, -OR-
+ * -1 on error.
+ *
+ *
+ * Create an snmpEngineID using text and the local IP address. If eidp
+ * is defined, use it to return a pointer to the newly allocated data.
+ * Otherwise, use the result to define engineID defined in this module.
+ *
+ * Line syntax:
+ * engineID <text> | NULL
+ *
+ * XXX What if a node has multiple interfaces?
+ * XXX What if multiple engines all choose the same address?
+ * (answer: You're screwed, because you might need a kul database
+ * which is dependant on the current engineID. Enumeration and other
+ * tricks won't work).
+ */
+int
+setup_engineID(u_char ** eidp, const char *text)
+{
+ int enterpriseid = htonl(NETSNMP_ENTERPRISE_OID),
+ netsnmpoid = htonl(NETSNMP_OID),
+ localsetup = (eidp) ? 0 : 1;
+
+ /*
+ * Use local engineID if *eidp == NULL.
+ */
+#ifdef HAVE_GETHOSTNAME
+ u_char buf[SNMP_MAXBUF_SMALL];
+ struct hostent *hent = NULL;
+#endif
+ u_char *bufp = NULL;
+ size_t len;
+ int localEngineIDType = engineIDType;
+ int tmpint;
+ time_t tmptime;
+
+ engineIDIsSet = 1;
+
+#ifdef HAVE_GETHOSTNAME
+#ifdef AF_INET6
+ /*
+ * see if they selected IPV4 or IPV6 support
+ */
+ if ((ENGINEID_TYPE_IPV6 == localEngineIDType) ||
+ (ENGINEID_TYPE_IPV4 == localEngineIDType)) {
+ /*
+ * get the host name and save the information
+ */
+ gethostname((char *) buf, sizeof(buf));
+ hent = netsnmp_gethostbyname((char *) buf);
+ if (hent && hent->h_addrtype == AF_INET6) {
+ localEngineIDType = ENGINEID_TYPE_IPV6;
+ } else {
+ /*
+ * Not IPV6 so we go with default
+ */
+ localEngineIDType = ENGINEID_TYPE_IPV4;
+ }
+ }
+#else
+ /*
+ * No IPV6 support. Check if they selected IPV6 engineID type.
+ * If so make it IPV4 instead
+ */
+ if (ENGINEID_TYPE_IPV6 == localEngineIDType) {
+ localEngineIDType = ENGINEID_TYPE_IPV4;
+ }
+ if (ENGINEID_TYPE_IPV4 == localEngineIDType) {
+ /*
+ * get the host name and save the information
+ */
+ gethostname((char *) buf, sizeof(buf));
+ hent = netsnmp_gethostbyname((char *) buf);
+ }
+#endif
+#endif /* HAVE_GETHOSTNAME */
+
+ /*
+ * Determine if we have text and if so setup our localEngineIDType
+ * * appropriately.
+ */
+ if (NULL != text) {
+ engineIDType = localEngineIDType = ENGINEID_TYPE_TEXT;
+ }
+ /*
+ * Determine length of the engineID string.
+ */
+ len = 5; /* always have 5 leading bytes */
+ switch (localEngineIDType) {
+ case ENGINEID_TYPE_TEXT:
+ if (NULL == text) {
+ snmp_log(LOG_ERR,
+ "Can't set up engineID of type text from an empty string.\n");
+ return -1;
+ }
+ len += strlen(text); /* 5 leading bytes+text. No NULL char */
+ break;
+#if defined(IFHWADDRLEN) && defined(SIOCGIFHWADDR)
+ case ENGINEID_TYPE_MACADDR: /* MAC address */
+ len += 6; /* + 6 bytes for MAC address */
+ break;
+#endif
+ case ENGINEID_TYPE_IPV4: /* IPv4 */
+ len += 4; /* + 4 byte IPV4 address */
+ break;
+ case ENGINEID_TYPE_IPV6: /* IPv6 */
+ len += 16; /* + 16 byte IPV6 address */
+ break;
+ case ENGINEID_TYPE_NETSNMP_RND: /* Net-SNMP specific encoding */
+ if (engineID) /* already setup, keep current value */
+ return engineIDLength;
+ if (oldEngineID) {
+ len = oldEngineIDLength;
+ } else {
+ len += sizeof(int) + sizeof(time_t);
+ }
+ break;
+ default:
+ snmp_log(LOG_ERR,
+ "Unknown EngineID type requested for setup (%d). Using IPv4.\n",
+ localEngineIDType);
+ localEngineIDType = ENGINEID_TYPE_IPV4; /* make into IPV4 */
+ len += 4; /* + 4 byte IPv4 address */
+ break;
+ } /* switch */
+
+
+ /*
+ * Allocate memory and store enterprise ID.
+ */
+ if ((bufp = (u_char *) malloc(len)) == NULL) {
+ snmp_log_perror("setup_engineID malloc");
+ return -1;
+ }
+ if (localEngineIDType == ENGINEID_TYPE_NETSNMP_RND)
+ /*
+ * we must use the net-snmp enterprise id here, regardless
+ */
+ memcpy(bufp, &netsnmpoid, sizeof(netsnmpoid)); /* XXX Must be 4 bytes! */
+ else
+ memcpy(bufp, &enterpriseid, sizeof(enterpriseid)); /* XXX Must be 4 bytes! */
+
+ bufp[0] |= 0x80;
+
+
+ /*
+ * Store the given text -OR- the first found IP address
+ * -OR- the MAC address -OR- random elements
+ * (the latter being the recommended default)
+ */
+ switch (localEngineIDType) {
+ case ENGINEID_TYPE_NETSNMP_RND:
+ if (oldEngineID) {
+ /*
+ * keep our previous notion of the engineID
+ */
+ memcpy(bufp, oldEngineID, oldEngineIDLength);
+ } else {
+ /*
+ * Here we've desigend our own ENGINEID that is not based on
+ * an address which may change and may even become conflicting
+ * in the future like most of the default v3 engineID types
+ * suffer from.
+ *
+ * Ours is built from 2 fairly random elements: a random number and
+ * the current time in seconds. This method suffers from boxes
+ * that may not have a correct clock setting and random number
+ * seed at startup, but few OSes should have that problem.
+ */
+ bufp[4] = ENGINEID_TYPE_NETSNMP_RND;
+ tmpint = random();
+ memcpy(bufp + 5, &tmpint, sizeof(tmpint));
+ tmptime = time(NULL);
+ memcpy(bufp + 5 + sizeof(tmpint), &tmptime, sizeof(tmptime));
+ }
+ break;
+ case ENGINEID_TYPE_TEXT:
+ bufp[4] = ENGINEID_TYPE_TEXT;
+ memcpy((char *) bufp + 5, (text), strlen(text));
+ break;
+#ifdef HAVE_GETHOSTNAME
+#ifdef AF_INET6
+ case ENGINEID_TYPE_IPV6:
+ bufp[4] = ENGINEID_TYPE_IPV6;
+ memcpy(bufp + 5, hent->h_addr_list[0], hent->h_length);
+ break;
+#endif
+#endif
+#if defined(IFHWADDRLEN) && defined(SIOCGIFHWADDR)
+ case ENGINEID_TYPE_MACADDR:
+ {
+ int x;
+ bufp[4] = ENGINEID_TYPE_MACADDR;
+ /*
+ * use default NIC if none provided
+ */
+ if (NULL == engineIDNic) {
+ x = getHwAddress(DEFAULT_NIC, (char *)&bufp[5]);
+ } else {
+ x = getHwAddress((char *)engineIDNic, (char *)&bufp[5]);
+ }
+ if (0 != x)
+ /*
+ * function failed fill MAC address with zeros
+ */
+ {
+ memset(&bufp[5], 0, 6);
+ }
+ }
+ break;
+#endif
+ case ENGINEID_TYPE_IPV4:
+ default:
+ bufp[4] = ENGINEID_TYPE_IPV4;
+#ifdef HAVE_GETHOSTNAME
+ if (hent && hent->h_addrtype == AF_INET) {
+ memcpy(bufp + 5, hent->h_addr_list[0], hent->h_length);
+ } else { /* Unknown address type. Default to 127.0.0.1. */
+
+ bufp[5] = 127;
+ bufp[6] = 0;
+ bufp[7] = 0;
+ bufp[8] = 1;
+ }
+#else /* HAVE_GETHOSTNAME */
+ /*
+ * Unknown address type. Default to 127.0.0.1.
+ */
+ bufp[5] = 127;
+ bufp[6] = 0;
+ bufp[7] = 0;
+ bufp[8] = 1;
+#endif /* HAVE_GETHOSTNAME */
+ break;
+ }
+
+ /*
+ * Pass the string back to the calling environment, or use it for
+ * our local engineID.
+ */
+ if (localsetup) {
+ SNMP_FREE(engineID);
+ engineID = bufp;
+ engineIDLength = len;
+
+ } else {
+ *eidp = bufp;
+ }
+
+
+ return len;
+
+} /* end setup_engineID() */
+
+int
+free_engineID(int majorid, int minorid, void *serverarg,
+ void *clientarg)
+{
+ SNMP_FREE(engineID);
+ SNMP_FREE(engineIDNic);
+ SNMP_FREE(oldEngineID);
+ engineIDIsSet = 0;
+ return 0;
+}
+
+/*******************************************************************-o-******
+ * engineBoots_conf
+ *
+ * Parameters:
+ * *word
+ * *cptr
+ *
+ * Line syntax:
+ * engineBoots <num_boots>
+ */
+void
+engineBoots_conf(const char *word, char *cptr)
+{
+ engineBoots = atoi(cptr) + 1;
+ DEBUGMSGTL(("snmpv3", "engineBoots: %lu\n", engineBoots));
+}
+
+/*******************************************************************-o-******
+ * engineIDType_conf
+ *
+ * Parameters:
+ * *word
+ * *cptr
+ *
+ * Line syntax:
+ * engineIDType <1 or 3>
+ * 1 is default for IPv4 engine ID type. Will automatically
+ * chose between IPv4 & IPv6 if either 1 or 2 is specified.
+ * 2 is for IPv6.
+ * 3 is hardware (MAC) address, currently supported under Linux
+ */
+void
+engineIDType_conf(const char *word, char *cptr)
+{
+ engineIDType = atoi(cptr);
+ /*
+ * verify valid type selected
+ */
+ switch (engineIDType) {
+ case ENGINEID_TYPE_IPV4: /* IPv4 */
+ case ENGINEID_TYPE_IPV6: /* IPv6 */
+ /*
+ * IPV? is always good
+ */
+ break;
+#if defined(IFHWADDRLEN) && defined(SIOCGIFHWADDR)
+ case ENGINEID_TYPE_MACADDR: /* MAC address */
+ break;
+#endif
+ default:
+ /*
+ * unsupported one chosen
+ */
+ config_perror("Unsupported enginedIDType, forcing IPv4");
+ engineIDType = ENGINEID_TYPE_IPV4;
+ }
+ DEBUGMSGTL(("snmpv3", "engineIDType: %d\n", engineIDType));
+}
+
+/*******************************************************************-o-******
+ * engineIDNic_conf
+ *
+ * Parameters:
+ * *word
+ * *cptr
+ *
+ * Line syntax:
+ * engineIDNic <string>
+ * eth0 is default
+ */
+void
+engineIDNic_conf(const char *word, char *cptr)
+{
+ /*
+ * Make sure they haven't already specified the engineID via the
+ * * configuration file
+ */
+ if (0 == engineIDIsSet)
+ /*
+ * engineID has NOT been set via configuration file
+ */
+ {
+ /*
+ * See if already set if so erase & release it
+ */
+ SNMP_FREE(engineIDNic);
+ engineIDNic = (u_char *) malloc(strlen(cptr) + 1);
+ if (NULL != engineIDNic) {
+ strcpy((char *) engineIDNic, cptr);
+ DEBUGMSGTL(("snmpv3", "Initializing engineIDNic: %s\n",
+ engineIDNic));
+ } else {
+ DEBUGMSGTL(("snmpv3",
+ "Error allocating memory for engineIDNic!\n"));
+ }
+ } else {
+ DEBUGMSGTL(("snmpv3",
+ "NOT setting engineIDNic, engineID already set\n"));
+ }
+}
+
+/*******************************************************************-o-******
+ * engineID_conf
+ *
+ * Parameters:
+ * *word
+ * *cptr
+ *
+ * This function reads a string from the configuration file and uses that
+ * string to initialize the engineID. It's assumed to be human readable.
+ */
+void
+engineID_conf(const char *word, char *cptr)
+{
+ setup_engineID(NULL, cptr);
+ DEBUGMSGTL(("snmpv3", "initialized engineID with: %s\n", cptr));
+}
+
+void
+version_conf(const char *word, char *cptr)
+{
+ int valid = 0;
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if ((strcmp(cptr, "1") == 0) ||
+ (strcmp(cptr, "v1") == 0)) {
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SNMPVERSION,
+ NETSNMP_DS_SNMP_VERSION_1); /* bogus value */
+ valid = 1;
+ }
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ if ((strcasecmp(cptr, "2c") == 0) ||
+ (strcasecmp(cptr, "v2c") == 0)) {
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SNMPVERSION,
+ NETSNMP_DS_SNMP_VERSION_2c);
+ valid = 1;
+ }
+#endif
+ if ((strcasecmp(cptr, "3" ) == 0) ||
+ (strcasecmp(cptr, "v3" ) == 0)) {
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SNMPVERSION,
+ NETSNMP_DS_SNMP_VERSION_3);
+ valid = 1;
+ }
+ if (!valid) {
+ config_perror("Unknown version specification");
+ return;
+ }
+ DEBUGMSGTL(("snmpv3", "set default version to %d\n",
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SNMPVERSION)));
+}
+
+/*
+ * oldengineID_conf(const char *, char *):
+ *
+ * Reads a octet string encoded engineID into the oldEngineID and
+ * oldEngineIDLen pointers.
+ */
+void
+oldengineID_conf(const char *word, char *cptr)
+{
+ read_config_read_octet_string(cptr, &oldEngineID, &oldEngineIDLength);
+}
+
+/*
+ * exactEngineID_conf(const char *, char *):
+ *
+ * Reads a octet string encoded engineID into the engineID and
+ * engineIDLen pointers.
+ */
+void
+exactEngineID_conf(const char *word, char *cptr)
+{
+ read_config_read_octet_string(cptr, &engineID, &engineIDLength);
+ if (engineIDLength > MAX_ENGINEID_LENGTH) {
+ netsnmp_config_error(
+ "exactEngineID '%s' too long; truncating to %d bytes",
+ cptr, MAX_ENGINEID_LENGTH);
+ engineID[MAX_ENGINEID_LENGTH - 1] = '\0';
+ engineIDLength = MAX_ENGINEID_LENGTH;
+ }
+ engineIDIsSet = 1;
+ engineIDType = ENGINEID_TYPE_EXACT;
+}
+
+
+/*
+ * merely call
+ */
+netsnmp_feature_child_of(get_enginetime_alarm, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_GET_ENGINETIME_ALARM
+void
+get_enginetime_alarm(unsigned int regnum, void *clientargs)
+{
+ /* we do this every so (rarely) often just to make sure we watch
+ wrapping of the times() output */
+ snmpv3_local_snmpEngineTime();
+}
+#endif /* NETSNMP_FEATURE_REMOVE_GET_ENGINETIME_ALARM */
+
+/*******************************************************************-o-******
+ * init_snmpv3
+ *
+ * Parameters:
+ * *type Label for the config file "type" used by calling entity.
+ *
+ * Set time and engineID.
+ * Set parsing functions for config file tokens.
+ * Initialize SNMP Crypto API (SCAPI).
+ */
+void
+init_snmpv3(const char *type)
+{
+ netsnmp_get_monotonic_clock(&snmpv3starttime);
+
+ if (!type)
+ type = "__snmpapp__";
+
+ /*
+ * we need to be called back later
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ init_snmpv3_post_config, NULL);
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_PREMIB_READ_CONFIG,
+ init_snmpv3_post_premib_config, NULL);
+ /*
+ * we need to be called back later
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ snmpv3_store, (void *) strdup(type));
+
+ /*
+ * initialize submodules
+ */
+ /*
+ * NOTE: this must be after the callbacks are registered above,
+ * since they need to be called before the USM callbacks.
+ */
+ init_secmod();
+
+ /*
+ * register all our configuration handlers (ack, there's a lot)
+ */
+
+ /*
+ * handle engineID setup before everything else which may depend on it
+ */
+ register_prenetsnmp_mib_handler(type, "engineID", engineID_conf, NULL,
+ "string");
+ register_prenetsnmp_mib_handler(type, "oldEngineID", oldengineID_conf,
+ NULL, NULL);
+ register_prenetsnmp_mib_handler(type, "exactEngineID", exactEngineID_conf,
+ NULL, NULL);
+ register_prenetsnmp_mib_handler(type, "engineIDType",
+ engineIDType_conf, NULL, "num");
+ register_prenetsnmp_mib_handler(type, "engineIDNic", engineIDNic_conf,
+ NULL, "string");
+ register_config_handler(type, "engineBoots", engineBoots_conf, NULL,
+ NULL);
+
+ /*
+ * default store config entries
+ */
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defSecurityName",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SECNAME);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defContext",
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_CONTEXT);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defPassphrase",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PASSPHRASE);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defAuthPassphrase",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_AUTHPASSPHRASE);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defPrivPassphrase",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PRIVPASSPHRASE);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defAuthMasterKey",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_AUTHMASTERKEY);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defPrivMasterKey",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PRIVMASTERKEY);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defAuthLocalizedKey",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_AUTHLOCALIZEDKEY);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "defPrivLocalizedKey",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_PRIVLOCALIZEDKEY);
+ register_config_handler("snmp", "defVersion", version_conf, NULL,
+ "1|2c|3");
+
+ register_config_handler("snmp", "defSecurityLevel",
+ snmpv3_secLevel_conf, NULL,
+ "noAuthNoPriv|authNoPriv|authPriv");
+}
+
+/*
+ * initializations for SNMPv3 to be called after the configuration files
+ * have been read.
+ */
+
+int
+init_snmpv3_post_config(int majorid, int minorid, void *serverarg,
+ void *clientarg)
+{
+
+ size_t engineIDLen;
+ u_char *c_engineID;
+
+ c_engineID = snmpv3_generate_engineID(&engineIDLen);
+
+ if (engineIDLen == 0 || !c_engineID) {
+ /*
+ * Somethine went wrong - help!
+ */
+ SNMP_FREE(c_engineID);
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * if our engineID has changed at all, the boots record must be set to 1
+ */
+ if (engineIDLen != oldEngineIDLength ||
+ oldEngineID == NULL || c_engineID == NULL ||
+ memcmp(oldEngineID, c_engineID, engineIDLen) != 0) {
+ engineBoots = 1;
+ }
+
+#ifdef NETSNMP_SECMOD_USM
+ /*
+ * for USM set our local engineTime in the LCD timing cache
+ */
+ set_enginetime(c_engineID, engineIDLen,
+ snmpv3_local_snmpEngineBoots(),
+ snmpv3_local_snmpEngineTime(), TRUE);
+#endif /* NETSNMP_SECMOD_USM */
+
+ SNMP_FREE(c_engineID);
+ return SNMPERR_SUCCESS;
+}
+
+int
+init_snmpv3_post_premib_config(int majorid, int minorid, void *serverarg,
+ void *clientarg)
+{
+ if (!engineIDIsSet)
+ setup_engineID(NULL, NULL);
+
+ return SNMPERR_SUCCESS;
+}
+
+/*******************************************************************-o-******
+ * store_snmpv3
+ *
+ * Parameters:
+ * *type
+ */
+int
+snmpv3_store(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ char line[SNMP_MAXBUF_SMALL];
+ u_char c_engineID[SNMP_MAXBUF_SMALL];
+ int engineIDLen;
+ const char *type = (const char *) clientarg;
+
+ if (type == NULL) /* should never happen, since the arg is ours */
+ type = "unknown";
+
+ sprintf(line, "engineBoots %ld", engineBoots);
+ read_config_store(type, line);
+
+ engineIDLen = snmpv3_get_engineID(c_engineID, SNMP_MAXBUF_SMALL);
+
+ if (engineIDLen) {
+ /*
+ * store the engineID used for this run
+ */
+ sprintf(line, "oldEngineID ");
+ read_config_save_octet_string(line + strlen(line), c_engineID,
+ engineIDLen);
+ read_config_store(type, line);
+ }
+ return SNMPERR_SUCCESS;
+} /* snmpv3_store() */
+
+u_long
+snmpv3_local_snmpEngineBoots(void)
+{
+ return engineBoots;
+}
+
+
+/*******************************************************************-o-******
+ * snmpv3_get_engineID
+ *
+ * Parameters:
+ * *buf
+ * buflen
+ *
+ * Returns:
+ * Length of engineID On Success
+ * SNMPERR_GENERR Otherwise.
+ *
+ *
+ * Store engineID in buf; return the length.
+ *
+ */
+size_t
+snmpv3_get_engineID(u_char * buf, size_t buflen)
+{
+ /*
+ * Sanity check.
+ */
+ if (!buf || (buflen < engineIDLength)) {
+ return 0;
+ }
+ if (!engineID) {
+ return 0;
+ }
+
+ memcpy(buf, engineID, engineIDLength);
+ return engineIDLength;
+
+} /* end snmpv3_get_engineID() */
+
+/*******************************************************************-o-******
+ * snmpv3_clone_engineID
+ *
+ * Parameters:
+ * **dest
+ * *dest_len
+ * src
+ * srclen
+ *
+ * Returns:
+ * Length of engineID On Success
+ * 0 Otherwise.
+ *
+ *
+ * Clones engineID, creates memory
+ *
+ */
+int
+snmpv3_clone_engineID(u_char ** dest, size_t * destlen, u_char * src,
+ size_t srclen)
+{
+ if (!dest || !destlen)
+ return 0;
+
+ SNMP_FREE(*dest);
+ *destlen = 0;
+
+ if (srclen && src) {
+ *dest = (u_char *) malloc(srclen);
+ if (*dest == NULL)
+ return 0;
+ memmove(*dest, src, srclen);
+ *destlen = srclen;
+ }
+ return *destlen;
+} /* end snmpv3_clone_engineID() */
+
+
+/*******************************************************************-o-******
+ * snmpv3_generate_engineID
+ *
+ * Parameters:
+ * *length
+ *
+ * Returns:
+ * Pointer to copy of engineID On Success.
+ * NULL If malloc() or snmpv3_get_engineID()
+ * fail.
+ *
+ * Generates a malloced copy of our engineID.
+ *
+ * 'length' is set to the length of engineID -OR- < 0 on failure.
+ */
+u_char *
+snmpv3_generate_engineID(size_t * length)
+{
+ u_char *newID;
+ newID = (u_char *) malloc(engineIDLength);
+
+ if (newID) {
+ *length = snmpv3_get_engineID(newID, engineIDLength);
+ }
+
+ if (*length == 0) {
+ SNMP_FREE(newID);
+ newID = NULL;
+ }
+
+ return newID;
+
+} /* end snmpv3_generate_engineID() */
+
+/**
+ * Return the value of snmpEngineTime. According to RFC 3414 snmpEngineTime
+ * is a 31-bit counter. engineBoots must be incremented every time that
+ * counter wraps around.
+ *
+ * @see See also <a href="http://tools.ietf.org/html/rfc3414">RFC 3414</a>.
+ *
+ * @note It is assumed that this function is called at least once every
+ * 2**31 seconds.
+ */
+u_long
+snmpv3_local_snmpEngineTime(void)
+{
+#ifdef NETSNMP_FEATURE_CHECKING
+ netsnmp_feature_require(calculate_sectime_diff)
+#endif /* NETSNMP_FEATURE_CHECKING */
+
+ static uint32_t last_engineTime;
+ struct timeval now;
+ uint32_t engineTime;
+
+ netsnmp_get_monotonic_clock(&now);
+ engineTime = calculate_sectime_diff(&now, &snmpv3starttime) & 0x7fffffffL;
+ if (engineTime < last_engineTime)
+ engineBoots++;
+ last_engineTime = engineTime;
+ return engineTime;
+}
+
+
+
+/*
+ * Code only for Linux systems
+ */
+#if defined(IFHWADDRLEN) && defined(SIOCGIFHWADDR)
+static int
+getHwAddress(const char *networkDevice, /* e.g. "eth0", "eth1" */
+ char *addressOut)
+{ /* return address. Len=IFHWADDRLEN */
+ /*
+ * getHwAddress(...)
+ * *
+ * * This function will return a Network Interfaces Card's Hardware
+ * * address (aka MAC address).
+ * *
+ * * Input Parameter(s):
+ * * networkDevice - a null terminated string with the name of a network
+ * * device. Examples: eth0, eth1, etc...
+ * *
+ * * Output Parameter(s):
+ * * addressOut - This is the binary value of the hardware address.
+ * * This value is NOT converted into a hexadecimal string.
+ * * The caller must pre-allocate for a return value of
+ * * length IFHWADDRLEN
+ * *
+ * * Return value: This function will return zero (0) for success. If
+ * * an error occurred the function will return -1.
+ * *
+ * * Caveats: This has only been tested on Ethernet networking cards.
+ */
+ int sock; /* our socket */
+ struct ifreq request; /* struct which will have HW address */
+
+ if ((NULL == networkDevice) || (NULL == addressOut)) {
+ return -1;
+ }
+ /*
+ * In order to find out the hardware (MAC) address of our system under
+ * * Linux we must do the following:
+ * * 1. Create a socket
+ * * 2. Do an ioctl(...) call with the SIOCGIFHWADDRLEN operation.
+ */
+ sock = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock < 0) {
+ return -1;
+ }
+ /*
+ * erase the request block
+ */
+ memset(&request, 0, sizeof(request));
+ /*
+ * copy the name of the net device we want to find the HW address for
+ */
+ strlcpy(request.ifr_name, networkDevice, IFNAMSIZ);
+ /*
+ * Get the HW address
+ */
+ if (ioctl(sock, SIOCGIFHWADDR, &request)) {
+ close(sock);
+ return -1;
+ }
+ close(sock);
+ memcpy(addressOut, request.ifr_hwaddr.sa_data, IFHWADDRLEN);
+ return 0;
+}
+#endif
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+/**
+ * Set SNMPv3 engineBoots and start time.
+ *
+ * @note This function does not exist. Go away. It certainly should never be
+ * used, unless in a testing scenario, which is why it was created
+ */
+void
+snmpv3_set_engineBootsAndTime(int boots, int ttime)
+{
+ engineBoots = boots;
+ netsnmp_get_monotonic_clock(&snmpv3starttime);
+ snmpv3starttime.tv_sec -= ttime;
+}
+#endif
diff --git a/snmplib/snprintf.c b/snmplib/snprintf.c
new file mode 100644
index 0000000..726c4f4
--- /dev/null
+++ b/snmplib/snprintf.c
@@ -0,0 +1,808 @@
+/*
+ * Copyright Patrick Powell 1995
+ * This code is based on code written by Patrick Powell (papowell@astart.com)
+ * It may be used for any purpose as long as this notice remains intact
+ * on all source code distributions
+ */
+
+/**************************************************************
+ * Original:
+ * Patrick Powell Tue Apr 11 09:48:21 PDT 1995
+ * A bombproof version of doprnt (dopr) included.
+ * Sigh. This sort of thing is always nasty do deal with. Note that
+ * the version here does not include floating point...
+ *
+ * snprintf() is used instead of sprintf() as it does limit checks
+ * for string length. This covers a nasty loophole.
+ *
+ * The other functions are there to prevent NULL pointers from
+ * causing nast effects.
+ *
+ * More Recently:
+ * Brandon Long <blong@fiction.net> 9/15/96 for mutt 0.43
+ * This was ugly. It is still ugly. I opted out of floating point
+ * numbers, but the formatter understands just about everything
+ * from the normal C string format, at least as far as I can tell from
+ * the Solaris 2.5 printf(3S) man page.
+ *
+ * Brandon Long <blong@fiction.net> 10/22/97 for mutt 0.87.1
+ * Ok, added some minimal floating point support, which means this
+ * probably requires libm on most operating systems. Don't yet
+ * support the exponent (e,E) and sigfig (g,G). Also, fmtint()
+ * was pretty badly broken, it just wasn't being exercised in ways
+ * which showed it, so that's been fixed. Also, formated the code
+ * to mutt conventions, and removed dead code left over from the
+ * original. Also, there is now a builtin-test, just compile with:
+ * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
+ * and run snprintf for results.
+ *
+ * Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i
+ * The PGP code was using unsigned hexadecimal formats.
+ * Unfortunately, unsigned formats simply didn't work.
+ *
+ * Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8
+ * The original code assumed that both snprintf() and vsnprintf() were
+ * missing. Some systems only have snprintf() but not vsnprintf(), so
+ * the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF.
+ *
+ * Andrew Tridgell (tridge@samba.org) Oct 1998
+ * fixed handling of %.0f
+ * added test for HAVE_LONG_DOUBLE
+ *
+ **************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+
+#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+
+# include <stdarg.h>
+# define VA_LOCAL_DECL va_list ap
+# define VA_START(f) va_start(ap, f)
+# define VA_SHIFT(v,t) ; /* no-op for ANSI */
+# define VA_END va_end(ap)
+
+#ifdef HAVE_LONG_DOUBLE
+#define LDOUBLE long double
+#else
+#define LDOUBLE double
+#endif
+
+int snprintf(char *str, size_t count, const char *fmt, ...);
+int vsnprintf(char *str, size_t count, const char *fmt,
+ va_list arg);
+
+static void dopr(char *buffer, size_t maxlen, const char *format,
+ va_list args);
+static void fmtstr(char *buffer, size_t * currlen, size_t maxlen,
+ char *value, int flags, int min, int max);
+static void fmtint(char *buffer, size_t * currlen, size_t maxlen,
+ long value, int base, int min, int max, int flags);
+static void fmtfp(char *buffer, size_t * currlen, size_t maxlen,
+ LDOUBLE fvalue, int min, int max, int flags);
+static void dopr_outch(char *buffer, size_t * currlen, size_t maxlen,
+ char c);
+
+/*
+ * dopr(): poor man's version of doprintf
+ */
+
+/*
+ * format read states
+ */
+#define DP_S_DEFAULT 0
+#define DP_S_FLAGS 1
+#define DP_S_MIN 2
+#define DP_S_DOT 3
+#define DP_S_MAX 4
+#define DP_S_MOD 5
+#define DP_S_CONV 6
+#define DP_S_DONE 7
+
+/*
+ * format flags - Bits
+ */
+#define DP_F_MINUS (1 << 0)
+#define DP_F_PLUS (1 << 1)
+#define DP_F_SPACE (1 << 2)
+#define DP_F_NUM (1 << 3)
+#define DP_F_ZERO (1 << 4)
+#define DP_F_UP (1 << 5)
+#define DP_F_UNSIGNED (1 << 6)
+
+/*
+ * Conversion Flags
+ */
+#define DP_C_SHORT 1
+#define DP_C_LONG 2
+#define DP_C_LDOUBLE 3
+
+#define char_to_int(p) (p - '0')
+#define MAX(p,q) ((p >= q) ? p : q)
+
+static void
+dopr(char *buffer, size_t maxlen, const char *format, va_list args)
+{
+ char ch;
+ long value;
+ LDOUBLE fvalue;
+ char *strvalue;
+ int min;
+ int max;
+ int state;
+ int flags;
+ int cflags;
+ size_t currlen;
+
+ state = DP_S_DEFAULT;
+ currlen = flags = cflags = min = 0;
+ max = -1;
+ ch = *format++;
+
+ while (state != DP_S_DONE) {
+ if ((ch == '\0') || (currlen >= maxlen))
+ state = DP_S_DONE;
+
+ switch (state) {
+ case DP_S_DEFAULT:
+ if (ch == '%')
+ state = DP_S_FLAGS;
+ else
+ dopr_outch(buffer, &currlen, maxlen, ch);
+ ch = *format++;
+ break;
+ case DP_S_FLAGS:
+ switch (ch) {
+ case '-':
+ flags |= DP_F_MINUS;
+ ch = *format++;
+ break;
+ case '+':
+ flags |= DP_F_PLUS;
+ ch = *format++;
+ break;
+ case ' ':
+ flags |= DP_F_SPACE;
+ ch = *format++;
+ break;
+ case '#':
+ flags |= DP_F_NUM;
+ ch = *format++;
+ break;
+ case '0':
+ flags |= DP_F_ZERO;
+ ch = *format++;
+ break;
+ default:
+ state = DP_S_MIN;
+ break;
+ }
+ break;
+ case DP_S_MIN:
+ if (isdigit(ch)) {
+ min = 10 * min + char_to_int(ch);
+ ch = *format++;
+ } else if (ch == '*') {
+ min = va_arg(args, int);
+ ch = *format++;
+ state = DP_S_DOT;
+ } else
+ state = DP_S_DOT;
+ break;
+ case DP_S_DOT:
+ if (ch == '.') {
+ state = DP_S_MAX;
+ ch = *format++;
+ } else
+ state = DP_S_MOD;
+ break;
+ case DP_S_MAX:
+ if (isdigit(ch)) {
+ if (max < 0)
+ max = 0;
+ max = 10 * max + char_to_int(ch);
+ ch = *format++;
+ } else if (ch == '*') {
+ max = va_arg(args, int);
+ ch = *format++;
+ state = DP_S_MOD;
+ } else
+ state = DP_S_MOD;
+ break;
+ case DP_S_MOD:
+ /*
+ * Currently, we don't support Long Long, bummer
+ */
+ switch (ch) {
+ case 'h':
+ cflags = DP_C_SHORT;
+ ch = *format++;
+ break;
+ case 'l':
+ cflags = DP_C_LONG;
+ ch = *format++;
+ break;
+ case 'L':
+ cflags = DP_C_LDOUBLE;
+ ch = *format++;
+ break;
+ default:
+ break;
+ }
+ state = DP_S_CONV;
+ break;
+ case DP_S_CONV:
+ switch (ch) {
+ case 'd':
+ case 'i':
+ if (cflags == DP_C_SHORT)
+ value = va_arg(args, short int);
+ else if (cflags == DP_C_LONG)
+ value = va_arg(args, long int);
+ else
+ value = va_arg(args, int);
+ fmtint(buffer, &currlen, maxlen, value, 10, min, max,
+ flags);
+ break;
+ case 'o':
+ flags |= DP_F_UNSIGNED;
+ if (cflags == DP_C_SHORT)
+ value = va_arg(args, unsigned short int);
+ else if (cflags == DP_C_LONG)
+ value = va_arg(args, unsigned long int);
+ else
+ value = va_arg(args, unsigned int);
+ fmtint(buffer, &currlen, maxlen, value, 8, min, max,
+ flags);
+ break;
+ case 'u':
+ flags |= DP_F_UNSIGNED;
+ if (cflags == DP_C_SHORT)
+ value = va_arg(args, unsigned short int);
+ else if (cflags == DP_C_LONG)
+ value = va_arg(args, unsigned long int);
+ else
+ value = va_arg(args, unsigned int);
+ fmtint(buffer, &currlen, maxlen, value, 10, min, max,
+ flags);
+ break;
+ case 'X':
+ flags |= DP_F_UP;
+ case 'x':
+ flags |= DP_F_UNSIGNED;
+ if (cflags == DP_C_SHORT)
+ value = va_arg(args, unsigned short int);
+ else if (cflags == DP_C_LONG)
+ value = va_arg(args, unsigned long int);
+ else
+ value = va_arg(args, unsigned int);
+ fmtint(buffer, &currlen, maxlen, value, 16, min, max,
+ flags);
+ break;
+ case 'f':
+ if (cflags == DP_C_LDOUBLE)
+ fvalue = va_arg(args, LDOUBLE);
+ else
+ fvalue = va_arg(args, double);
+ /*
+ * um, floating point?
+ */
+ fmtfp(buffer, &currlen, maxlen, fvalue, min, max, flags);
+ break;
+ case 'E':
+ flags |= DP_F_UP;
+ case 'e':
+ if (cflags == DP_C_LDOUBLE)
+ fvalue = va_arg(args, LDOUBLE);
+ else
+ fvalue = va_arg(args, double);
+ break;
+ case 'G':
+ flags |= DP_F_UP;
+ case 'g':
+ if (cflags == DP_C_LDOUBLE)
+ fvalue = va_arg(args, LDOUBLE);
+ else
+ fvalue = va_arg(args, double);
+ break;
+ case 'c':
+ dopr_outch(buffer, &currlen, maxlen, va_arg(args, int));
+ break;
+ case 's':
+ strvalue = va_arg(args, char *);
+ if (max < 0)
+ max = maxlen; /* ie, no max */
+ fmtstr(buffer, &currlen, maxlen, strvalue, flags, min,
+ max);
+ break;
+ case 'p':
+ strvalue = (char *) va_arg(args, void *);
+ fmtint(buffer, &currlen, maxlen, (long) strvalue, 16, min,
+ max, flags);
+ break;
+ case 'n':
+ if (cflags == DP_C_SHORT) {
+ short int *num;
+ num = va_arg(args, short int *);
+ *num = currlen;
+ } else if (cflags == DP_C_LONG) {
+ long int *num;
+ num = va_arg(args, long int *);
+ *num = currlen;
+ } else {
+ int *num;
+ num = va_arg(args, int *);
+ *num = currlen;
+ }
+ break;
+ case '%':
+ dopr_outch(buffer, &currlen, maxlen, ch);
+ break;
+ case 'w':
+ /*
+ * not supported yet, treat as next char
+ */
+ ch = *format++;
+ break;
+ default:
+ /*
+ * Unknown, skip
+ */
+ break;
+ }
+ ch = *format++;
+ state = DP_S_DEFAULT;
+ flags = cflags = min = 0;
+ max = -1;
+ break;
+ case DP_S_DONE:
+ break;
+ default:
+ /*
+ * hmm?
+ */
+ break; /* some picky compilers need this */
+ }
+ }
+ if (currlen < maxlen - 1)
+ buffer[currlen] = '\0';
+ else
+ buffer[maxlen - 1] = '\0';
+}
+
+static void
+fmtstr(char *buffer, size_t * currlen, size_t maxlen,
+ char *value, int flags, int min, int max)
+{
+ int padlen, strln; /* amount to pad */
+ int cnt = 0;
+
+ if (value == 0) {
+ value = "<NULL>";
+ }
+
+ for (strln = 0; value[strln]; ++strln); /* strlen */
+ padlen = min - strln;
+ if (padlen < 0)
+ padlen = 0;
+ if (flags & DP_F_MINUS)
+ padlen = -padlen; /* Left Justify */
+
+ while ((padlen > 0) && (cnt < max)) {
+ dopr_outch(buffer, currlen, maxlen, ' ');
+ --padlen;
+ ++cnt;
+ }
+ while (*value && (cnt < max)) {
+ dopr_outch(buffer, currlen, maxlen, *value++);
+ ++cnt;
+ }
+ while ((padlen < 0) && (cnt < max)) {
+ dopr_outch(buffer, currlen, maxlen, ' ');
+ ++padlen;
+ ++cnt;
+ }
+}
+
+/*
+ * Have to handle DP_F_NUM (ie 0x and 0 alternates)
+ */
+
+static void
+fmtint(char *buffer, size_t * currlen, size_t maxlen,
+ long value, int base, int min, int max, int flags)
+{
+ int signvalue = 0;
+ unsigned long uvalue;
+ char convert[20];
+ int place = 0;
+ int spadlen = 0; /* amount to space pad */
+ int zpadlen = 0; /* amount to zero pad */
+ int caps = 0;
+
+ if (max < 0)
+ max = 0;
+
+ uvalue = value;
+
+ if (!(flags & DP_F_UNSIGNED)) {
+ if (value < 0) {
+ signvalue = '-';
+ uvalue = -value;
+ } else if (flags & DP_F_PLUS) /* Do a sign (+/i) */
+ signvalue = '+';
+ else if (flags & DP_F_SPACE)
+ signvalue = ' ';
+ }
+
+ if (flags & DP_F_UP)
+ caps = 1; /* Should characters be upper case? */
+
+ do {
+ convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
+ [uvalue % (unsigned) base];
+ uvalue = (uvalue / (unsigned) base);
+ } while (uvalue && (place < 20));
+ if (place == 20)
+ place--;
+ convert[place] = 0;
+
+ zpadlen = max - place;
+ spadlen = min - MAX(max, place) - (signvalue ? 1 : 0);
+ if (zpadlen < 0)
+ zpadlen = 0;
+ if (spadlen < 0)
+ spadlen = 0;
+ if (flags & DP_F_ZERO) {
+ zpadlen = MAX(zpadlen, spadlen);
+ spadlen = 0;
+ }
+ if (flags & DP_F_MINUS)
+ spadlen = -spadlen; /* Left Justifty */
+
+#ifdef DEBUG_SNPRINTF
+ dprint(1,
+ (debugfile, "zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
+ zpadlen, spadlen, min, max, place));
+#endif
+
+ /*
+ * Spaces
+ */
+ while (spadlen > 0) {
+ dopr_outch(buffer, currlen, maxlen, ' ');
+ --spadlen;
+ }
+
+ /*
+ * Sign
+ */
+ if (signvalue)
+ dopr_outch(buffer, currlen, maxlen, signvalue);
+
+ /*
+ * Zeros
+ */
+ if (zpadlen > 0) {
+ while (zpadlen > 0) {
+ dopr_outch(buffer, currlen, maxlen, '0');
+ --zpadlen;
+ }
+ }
+
+ /*
+ * Digits
+ */
+ while (place > 0)
+ dopr_outch(buffer, currlen, maxlen, convert[--place]);
+
+ /*
+ * Left Justified spaces
+ */
+ while (spadlen < 0) {
+ dopr_outch(buffer, currlen, maxlen, ' ');
+ ++spadlen;
+ }
+}
+
+static LDOUBLE
+abs_val(LDOUBLE value)
+{
+ LDOUBLE result = value;
+
+ if (value < 0)
+ result = -value;
+
+ return result;
+}
+
+static LDOUBLE
+pow10(int exp)
+{
+ LDOUBLE result = 1;
+
+ while (exp) {
+ result *= 10;
+ exp--;
+ }
+
+ return result;
+}
+
+static long
+round(LDOUBLE value)
+{
+ long intpart;
+
+ intpart = value;
+ value = value - intpart;
+ if (value >= 0.5)
+ intpart++;
+
+ return intpart;
+}
+
+static void
+fmtfp(char *buffer, size_t * currlen, size_t maxlen,
+ LDOUBLE fvalue, int min, int max, int flags)
+{
+ int signvalue = 0;
+ LDOUBLE ufvalue;
+ char iconvert[20];
+ char fconvert[20];
+ int iplace = 0;
+ int fplace = 0;
+ int padlen = 0; /* amount to pad */
+ int zpadlen = 0;
+ int caps = 0;
+ long intpart;
+ long fracpart;
+
+ /*
+ * AIX manpage says the default is 0, but Solaris says the default
+ * is 6, and sprintf on AIX defaults to 6
+ */
+ if (max < 0)
+ max = 6;
+
+ ufvalue = abs_val(fvalue);
+
+ if (fvalue < 0)
+ signvalue = '-';
+ else if (flags & DP_F_PLUS) /* Do a sign (+/i) */
+ signvalue = '+';
+ else if (flags & DP_F_SPACE)
+ signvalue = ' ';
+
+#if 0
+ if (flags & DP_F_UP)
+ caps = 1; /* Should characters be upper case? */
+#endif
+
+ intpart = ufvalue;
+
+ /*
+ * Sorry, we only support 9 digits past the decimal because of our
+ * conversion method
+ */
+ if (max > 9)
+ max = 9;
+
+ /*
+ * We "cheat" by converting the fractional part to integer by
+ * * multiplying by a factor of 10
+ */
+ fracpart = round((pow10(max)) * (ufvalue - intpart));
+
+ if (fracpart >= pow10(max)) {
+ intpart++;
+ fracpart -= pow10(max);
+ }
+#ifdef DEBUG_SNPRINTF
+ dprint(1,
+ (debugfile, "fmtfp: %f =? %d.%d\n", fvalue, intpart, fracpart));
+#endif
+
+ /*
+ * Convert integer part
+ */
+ do {
+ iconvert[iplace++] =
+ (caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10];
+ intpart = (intpart / 10);
+ } while (intpart && (iplace < 20));
+ if (iplace == 20)
+ iplace--;
+ iconvert[iplace] = 0;
+
+ /*
+ * Convert fractional part
+ */
+ do {
+ fconvert[fplace++] =
+ (caps ? "0123456789ABCDEF" : "0123456789abcdef")[fracpart %
+ 10];
+ fracpart = (fracpart / 10);
+ } while (fracpart && (fplace < 20));
+ if (fplace == 20)
+ fplace--;
+ fconvert[fplace] = 0;
+
+ /*
+ * -1 for decimal point, another -1 if we are printing a sign
+ */
+ padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
+ zpadlen = max - fplace;
+ if (zpadlen < 0)
+ zpadlen = 0;
+ if (padlen < 0)
+ padlen = 0;
+ if (flags & DP_F_MINUS)
+ padlen = -padlen; /* Left Justifty */
+
+ if ((flags & DP_F_ZERO) && (padlen > 0)) {
+ if (signvalue) {
+ dopr_outch(buffer, currlen, maxlen, signvalue);
+ --padlen;
+ signvalue = 0;
+ }
+ while (padlen > 0) {
+ dopr_outch(buffer, currlen, maxlen, '0');
+ --padlen;
+ }
+ }
+ while (padlen > 0) {
+ dopr_outch(buffer, currlen, maxlen, ' ');
+ --padlen;
+ }
+ if (signvalue)
+ dopr_outch(buffer, currlen, maxlen, signvalue);
+
+ while (iplace > 0)
+ dopr_outch(buffer, currlen, maxlen, iconvert[--iplace]);
+
+ /*
+ * Decimal point. This should probably use locale to find the correct
+ * char to print out.
+ */
+ if (max > 0) {
+ dopr_outch(buffer, currlen, maxlen, '.');
+
+ while (fplace > 0)
+ dopr_outch(buffer, currlen, maxlen, fconvert[--fplace]);
+ }
+
+ while (zpadlen > 0) {
+ dopr_outch(buffer, currlen, maxlen, '0');
+ --zpadlen;
+ }
+
+ while (padlen < 0) {
+ dopr_outch(buffer, currlen, maxlen, ' ');
+ ++padlen;
+ }
+}
+
+static void
+dopr_outch(char *buffer, size_t * currlen, size_t maxlen, char c)
+{
+ if (*currlen < maxlen)
+ buffer[(*currlen)++] = c;
+}
+
+#ifndef HAVE_VSNPRINTF
+int
+vsnprintf(char *str, size_t count, const char *fmt, va_list args)
+{
+ str[0] = 0;
+ dopr(str, count, fmt, args);
+ return (strlen(str));
+}
+#endif /* !HAVE_VSNPRINTF */
+
+#ifndef HAVE_SNPRINTF
+/*
+ * VARARGS3
+ */
+int
+snprintf(char *str, size_t count, const char *fmt, ...)
+{
+ VA_LOCAL_DECL;
+
+ VA_START(fmt);
+ VA_SHIFT(str, char *);
+ VA_SHIFT(count, size_t);
+ VA_SHIFT(fmt, char *);
+ (void) vsnprintf(str, count, fmt, ap);
+ VA_END;
+ return (strlen(str));
+}
+#endif /* !HAVE_SNPRINTF */
+
+#ifdef TEST_SNPRINTF
+#ifndef LONG_STRING
+#define LONG_STRING 1024
+#endif
+int
+main(void)
+{
+ char buf1[LONG_STRING];
+ char buf2[LONG_STRING];
+ char *fp_fmt[] = {
+ "%-1.5f",
+ "%1.5f",
+ "%123.9f",
+ "%10.5f",
+ "% 10.5f",
+ "%+22.9f",
+ "%+4.9f",
+ "%01.3f",
+ "%4f",
+ "%3.1f",
+ "%3.2f",
+ "%.0f",
+ "%.1f",
+ NULL
+ };
+ double fp_nums[] =
+ { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
+ 0.9996, 1.996, 4.136, 0
+ };
+ char *int_fmt[] = {
+ "%-1.5d",
+ "%1.5d",
+ "%123.9d",
+ "%5.5d",
+ "%10.5d",
+ "% 10.5d",
+ "%+22.33d",
+ "%01.3d",
+ "%4d",
+ NULL
+ };
+ long int_nums[] = { -1, 134, 91340, 341, 0203, 0 };
+ int x, y;
+ int fail = 0;
+ int num = 0;
+
+ printf("Testing snprintf format codes against system sprintf...\n");
+
+ for (x = 0; fp_fmt[x] != NULL; x++)
+ for (y = 0; fp_nums[y] != 0; y++) {
+ snprintf(buf1, sizeof(buf1), fp_fmt[x], fp_nums[y]);
+ sprintf(buf2, fp_fmt[x], fp_nums[y]);
+ if (strcmp(buf1, buf2)) {
+ printf
+ ("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
+ fp_fmt[x], buf1, buf2);
+ fail++;
+ }
+ num++;
+ }
+
+ for (x = 0; int_fmt[x] != NULL; x++)
+ for (y = 0; int_nums[y] != 0; y++) {
+ snprintf(buf1, sizeof(buf1), int_fmt[x], int_nums[y]);
+ sprintf(buf2, int_fmt[x], int_nums[y]);
+ if (strcmp(buf1, buf2)) {
+ printf
+ ("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
+ int_fmt[x], buf1, buf2);
+ fail++;
+ }
+ num++;
+ }
+ printf("%d tests failed out of %d.\n", fail, num);
+}
+#endif /* SNPRINTF_TEST */
+
+#else
+int snprintf_unused; /* Suppress "empty translation unit" warning */
+#endif /* !HAVE_SNPRINTF */
diff --git a/snmplib/strlcat.c b/snmplib/strlcat.c
new file mode 100644
index 0000000..90713ca
--- /dev/null
+++ b/snmplib/strlcat.c
@@ -0,0 +1,67 @@
+/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */
+
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, 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>
+
+#ifndef HAVE_STRLCAT
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <sys/types.h>
+
+#include <net-snmp/library/system.h>
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+size_t
+strlcat(char * __restrict dst, const char * __restrict src, size_t siz)
+{
+ char *d = dst;
+ const char *s = src;
+ size_t n = siz;
+ size_t dlen;
+
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (n-- != 0 && *d != '\0')
+ d++;
+ dlen = d - dst;
+ n = siz - dlen;
+
+ if (n == 0)
+ return(dlen + strlen(s));
+ while (*s != '\0') {
+ if (n != 1) {
+ *d++ = *s;
+ n--;
+ }
+ s++;
+ }
+ *d = '\0';
+
+ return(dlen + (s - src)); /* count does not include NUL */
+}
+
+#endif
diff --git a/snmplib/strlcpy.c b/snmplib/strlcpy.c
new file mode 100644
index 0000000..0235a30
--- /dev/null
+++ b/snmplib/strlcpy.c
@@ -0,0 +1,43 @@
+/*
+ * 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 <sys/types.h>
+
+#include <net-snmp/library/system.h>
+
+/*
+ * Copies src to the dest buffer. The copy will never overflow the dest buffer
+ * and dest will always be null terminated, len is the size of the dest buffer.
+ *
+ * Returns the length of the src buffer.
+ */
+size_t
+strlcpy(char *dest, const char *src, size_t len)
+{
+ size_t src_len = strlen(src);
+ size_t new_len;
+
+ if (len == 0) {
+ return (src_len);
+ }
+
+ if (src_len >= len) {
+ new_len = len - 1;
+ } else {
+ new_len = src_len;
+ }
+
+ memcpy(dest, src, new_len);
+ dest[new_len] = '\0';
+ return (src_len);
+}
diff --git a/snmplib/strtok_r.c b/snmplib/strtok_r.c
new file mode 100644
index 0000000..21d47d6
--- /dev/null
+++ b/snmplib/strtok_r.c
@@ -0,0 +1,94 @@
+
+/* $NetBSD: strtok_r.c,v 1.9 2003/08/07 16:43:53 agc Exp $ */
+
+/*
+ * Copyright (c) 1988 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#ifndef WIN32
+#include <sys/cdefs.h>
+#endif
+
+#include <string.h>
+
+#include <net-snmp/library/system.h>
+
+/*
+ * thread-safe version of strtok
+ */
+char *
+strtok_r(char *s, const char *delim, char **lasts)
+{
+ const char *spanp;
+ int c, sc;
+ char *tok;
+
+ /* s may be NULL */
+ /*netsnmp_assert(delim != NULL);*/
+ /*netsnmp_assert(lasts != NULL);*/
+
+ if (s == NULL && (s = *lasts) == NULL)
+ return (NULL);
+
+ /*
+ * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
+ */
+cont:
+ c = *s++;
+ for (spanp = delim; (sc = *spanp++) != 0;) {
+ if (c == sc)
+ goto cont;
+ }
+
+ if (c == 0) { /* no non-delimiter characters */
+ *lasts = NULL;
+ return (NULL);
+ }
+ tok = s - 1;
+
+ /*
+ * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
+ * Note that delim must have one NUL; we stop if we see that, too.
+ */
+ for (;;) {
+ c = *s++;
+ spanp = delim;
+ do {
+ if ((sc = *spanp++) == c) {
+ if (c == 0)
+ s = NULL;
+ else
+ s[-1] = 0;
+ *lasts = s;
+ return (tok);
+ }
+ } while (sc != 0);
+ }
+ /* NOTREACHED */
+}
diff --git a/snmplib/strtol.c b/snmplib/strtol.c
new file mode 100644
index 0000000..c71f8ba
--- /dev/null
+++ b/snmplib/strtol.c
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 1990 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)strtol.c 5.4 (Berkeley) 2/23/91";
+#endif /* LIBC_SCCS and not lint */
+
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+/*
+ * Convert a string to a long integer.
+ *
+ * Ignores `locale' stuff. Assumes that the upper and lower case
+ * alphabets and digits are each contiguous.
+ */
+long
+strtol(const char *nptr, char **endptr, int base)
+{
+ const char *s = nptr;
+ unsigned long acc;
+ int c;
+ unsigned long cutoff;
+ int neg = 0, any, cutlim;
+
+ /*
+ * Skip white space and pick up leading +/- sign if any. If base is 0,
+ * allow 0x for hex and 0 for octal, else assume decimal; if base is
+ * already 16, allow 0x.
+ */
+ do {
+ c = *s++;
+ } while (isspace(c));
+ if (c == '-') {
+ neg = 1;
+ c = *s++;
+ } else if (c == '+')
+ c = *s++;
+ if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X')) {
+ c = s[1];
+ s += 2;
+ base = 16;
+ }
+ if (base == 0)
+ base = c == '0' ? 8 : 10;
+
+ /*
+ * Compute the cutoff value between legal numbers and illegal numbers.
+ * That is the largest legal value, divided by the base. An input
+ * number that is greater than this value, if followed by a legal
+ * input character, is too big. One that is equal to this value may
+ * be valid or not; the limit between valid and invalid numbers is
+ * then based on the last digit. For instance, if the range for longs
+ * is [-2147483648..2147483647] and the input base is 10, cutoff will
+ * be set to 214748364 and cutlim to either 7 (neg==0) or 8 (neg==1),
+ * meaning that if we have accumulated a value > 214748364, or equal
+ * but the next digit is > 7 (or 8), the number is too big, and we
+ * will return a range error.
+ *
+ * Set any if any `digits' consumed; make it negative to indicate
+ * overflow.
+ */
+ cutoff = neg ? -(unsigned long) LONG_MIN : LONG_MAX;
+ cutlim = cutoff % (unsigned long) base;
+ cutoff /= (unsigned long) base;
+ for (acc = 0, any = 0;; c = *s++) {
+ if (isdigit(c))
+ c -= '0';
+ else if (isalpha(c))
+ c -= isupper(c) ? 'A' - 10 : 'a' - 10;
+ else
+ break;
+ if (c >= base)
+ break;
+ if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ any = -1;
+ else {
+ any = 1;
+ acc *= base;
+ acc += c;
+ }
+ }
+ if (any < 0) {
+ acc = neg ? LONG_MIN : LONG_MAX;
+ errno = ERANGE;
+ } else if (neg)
+ acc = -acc;
+ if (endptr != 0)
+ *endptr = any ? s - 1 : (char *) nptr;
+ return (acc);
+}
diff --git a/snmplib/strtoul.c b/snmplib/strtoul.c
new file mode 100644
index 0000000..7aea330
--- /dev/null
+++ b/snmplib/strtoul.c
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 1990, 1993
+ * 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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+/*
+ * Convert a string to an unsigned long integer.
+ *
+ * Ignores `locale' stuff. Assumes that the upper and lower case
+ * alphabets and digits are each contiguous.
+ */
+unsigned long
+strtoul(const char *nptr, char **endptr, int base)
+{
+ const char *s = nptr;
+ unsigned long acc;
+ unsigned char c;
+ unsigned long cutoff;
+ int neg = 0, any, cutlim;
+
+ /*
+ * See strtol for comments as to the logic used.
+ */
+ do {
+ c = *s++;
+ } while (isspace(c));
+ if (c == '-') {
+ neg = 1;
+ c = *s++;
+ } else if (c == '+')
+ c = *s++;
+ if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X')) {
+ c = s[1];
+ s += 2;
+ base = 16;
+ }
+ if (base == 0)
+ base = c == '0' ? 8 : 10;
+ cutoff = (unsigned long) ULONG_MAX / (unsigned long) base;
+ cutlim = (unsigned long) ULONG_MAX % (unsigned long) base;
+ for (acc = 0, any = 0;; c = *s++) {
+ if (!isascii(c))
+ break;
+ if (isdigit(c))
+ c -= '0';
+ else if (isalpha(c))
+ c -= isupper(c) ? 'A' - 10 : 'a' - 10;
+ else
+ break;
+ if (c >= base)
+ break;
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
+ any = -1;
+ else {
+ any = 1;
+ acc *= base;
+ acc += c;
+ }
+ }
+ if (any < 0) {
+ acc = ULONG_MAX;
+ errno = ERANGE;
+ } else if (neg)
+ acc = -acc;
+ if (endptr != 0)
+ *endptr = (char *) (any ? s - 1 : nptr);
+ return (acc);
+}
diff --git a/snmplib/strtoull.c b/snmplib/strtoull.c
new file mode 100644
index 0000000..6c98fc4
--- /dev/null
+++ b/snmplib/strtoull.c
@@ -0,0 +1,158 @@
+/*
+ * An implementation of strtoull() for compilers that do not have this
+ * function, e.g. MSVC.
+ * See also http://www.opengroup.org/onlinepubs/000095399/functions/strtoul.html
+ * for more information about strtoull().
+ */
+
+
+/*
+ * For MSVC, disable the warning "unary minus operator applied to unsigned
+ * type, result still unsigned"
+ */
+#ifdef _MSC_VER
+#pragma warning (disable: 4146)
+#endif
+
+
+#define __STDC_CONSTANT_MACROS /* Enable UINT64_C in <stdint.h> */
+#define __STDC_FORMAT_MACROS /* Enable PRIu64 in <inttypes.h> */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <errno.h>
+#include <ctype.h>
+#include <limits.h>
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/system.h>
+
+/*
+ * UINT64_C: C99 macro for the suffix for uint64_t constants.
+ */
+#ifndef UINT64_C
+#ifdef _MSC_VER
+#define UINT64_C(c) c##ui64
+#else
+#define UINT64_C(c) c##ULL
+#endif
+#endif
+
+/*
+ * According to the C99 standard, the constant ULLONG_MAX must be defined in
+ * <limits.h>. Define it here for pre-C99 compilers.
+ */
+#ifndef ULLONG_MAX
+#define ULLONG_MAX UINT64_C(0xffffffffffffffff)
+#endif
+
+uint64_t
+strtoull(const char *nptr, char **endptr, int base)
+{
+ uint64_t result = 0;
+ const char *p;
+ const char *first_nonspace;
+ const char *digits_start;
+ int sign = 1;
+ int out_of_range = 0;
+
+ if (base != 0 && (base < 2 || base > 36))
+ goto invalid_input;
+
+ p = nptr;
+
+ /*
+ * Process the initial, possibly empty, sequence of white-space characters.
+ */
+ while (isspace((unsigned char) (*p)))
+ p++;
+
+ first_nonspace = p;
+
+ /*
+ * Determine sign.
+ */
+ if (*p == '+')
+ p++;
+ else if (*p == '-') {
+ p++;
+ sign = -1;
+ }
+
+ if (base == 0) {
+ /*
+ * Determine base.
+ */
+ if (*p == '0') {
+ if ((p[1] == 'x' || p[1] == 'X')) {
+ if (isxdigit((unsigned char)(p[2]))) {
+ base = 16;
+ p += 2;
+ } else {
+ /*
+ * Special case: treat the string "0x" without any further
+ * hex digits as a decimal number.
+ */
+ base = 10;
+ }
+ } else {
+ base = 8;
+ p++;
+ }
+ } else {
+ base = 10;
+ }
+ } else if (base == 16) {
+ /*
+ * For base 16, skip the optional "0x" / "0X" prefix.
+ */
+ if (*p == '0' && (p[1] == 'x' || p[1] == 'X')
+ && isxdigit((unsigned char)(p[2]))) {
+ p += 2;
+ }
+ }
+
+ digits_start = p;
+
+ for (; *p; p++) {
+ int digit;
+ digit = ('0' <= *p && *p <= '9') ? *p - '0'
+ : ('a' <= *p && *p <= 'z') ? (*p - 'a' + 10)
+ : ('A' <= *p && *p <= 'Z') ? (*p - 'A' + 10) : 36;
+ if (digit < base) {
+ if (! out_of_range) {
+ if (result > ULLONG_MAX / base
+ || result * base > ULLONG_MAX - digit) {
+ out_of_range = 1;
+ }
+ result = result * base + digit;
+ }
+ } else
+ break;
+ }
+
+ if (p > first_nonspace && p == digits_start)
+ goto invalid_input;
+
+ if (p == first_nonspace)
+ p = nptr;
+
+ if (endptr)
+ *endptr = (char *) p;
+
+ if (out_of_range) {
+ errno = ERANGE;
+ return ULLONG_MAX;
+ }
+
+ return sign > 0 ? result : -result;
+
+ invalid_input:
+ errno = EINVAL;
+ if (endptr)
+ *endptr = (char *) nptr;
+ return 0;
+}
diff --git a/snmplib/system.c b/snmplib/system.c
new file mode 100644
index 0000000..207762d
--- /dev/null
+++ b/snmplib/system.c
@@ -0,0 +1,1426 @@
+/*
+ * 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:
+ */
+/***********************************************************
+ Copyright 1992 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.
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright (C) 2007 Apple, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+/*
+ * System dependent routines go here
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+
+#if HAVE_IO_H
+#include <io.h>
+#endif
+#if HAVE_DIRECT_H
+#include <direct.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.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/types.h>
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#ifdef HAVE_NLIST_H
+#include <nlist.h>
+#endif
+
+#if HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#if defined(hpux10) || defined(hpux11)
+#include <sys/pstat.h>
+#endif
+
+#if HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+
+#if HAVE_SYS_SYSTEMCFG_H
+#include <sys/systemcfg.h>
+#endif
+
+#if HAVE_SYS_SYSTEMINFO_H
+#include <sys/systeminfo.h>
+#endif
+
+#if defined(darwin9)
+#include <crt_externs.h> /* for _NSGetArgv() */
+#endif
+
+#if HAVE_PWD_H
+#include <pwd.h>
+#endif
+#if HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef DNSSEC_LOCAL_VALIDATION
+#if 1 /*HAVE_ARPA_NAMESER_H*/
+#include <arpa/nameser.h>
+#endif
+#include <validator/validator.h>
+/* NetSNMP and DNSSEC-Tools both define FREE. We'll not use either here. */
+#undef FREE
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+#include <net-snmp/library/system.h> /* for "internal" definitions */
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/read_config.h> /* for get_temp_file_pattern() */
+
+#include "inet_ntop.h"
+
+/* NetSNMP and DNSSEC-Tools both define FREE. We'll not use either here. */
+#undef FREE
+
+netsnmp_feature_child_of(system_all, libnetsnmp)
+
+netsnmp_feature_child_of(user_information, system_all)
+netsnmp_feature_child_of(calculate_sectime_diff, system_all)
+
+#ifndef IFF_LOOPBACK
+# define IFF_LOOPBACK 0
+#endif
+
+#ifdef INADDR_LOOPBACK
+# define LOOPBACK INADDR_LOOPBACK
+#else
+# define LOOPBACK 0x7f000001
+#endif
+
+#ifndef EAI_FAIL
+# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
+#endif
+
+#if defined(HAVE_FORK)
+static void
+_daemon_prep(int stderr_log)
+{
+ /* Avoid keeping any directory in use. */
+ chdir("/");
+
+ if (stderr_log)
+ return;
+
+ /*
+ * Close inherited file descriptors to avoid
+ * keeping unnecessary references.
+ */
+ close(0);
+ close(1);
+ close(2);
+
+ /*
+ * Redirect std{in,out,err} to /dev/null, just in case.
+ */
+ open("/dev/null", O_RDWR);
+ dup(0);
+ dup(0);
+}
+#endif
+
+/**
+ * fork current process into the background.
+ *
+ * This function forks a process into the background, in order to
+ * become a daemon process. It does a few things along the way:
+ *
+ * - becoming a process/session group leader, and forking a second time so
+ * that process/session group leader can exit.
+ *
+ * - changing the working directory to /
+ *
+ * - closing stdin, stdout and stderr (unless stderr_log is set) and
+ * redirecting them to /dev/null
+ *
+ * @param quit_immediately : indicates if the parent process should
+ * exit after a successful fork.
+ * @param stderr_log : indicates if stderr is being used for
+ * logging and shouldn't be closed
+ * @returns -1 : fork error
+ * 0 : child process returning
+ * >0 : parent process returning. returned value is the child PID.
+ */
+int
+netsnmp_daemonize(int quit_immediately, int stderr_log)
+{
+ int i = 0;
+ DEBUGMSGT(("daemonize","deamonizing...\n"));
+#if HAVE_FORK
+#if defined(darwin9)
+ char path [PATH_MAX] = "";
+ uint32_t size = sizeof (path);
+
+ /*
+ * if we are already launched in a "daemonized state", just
+ * close & redirect the file descriptors
+ */
+ if(getppid() <= 2) {
+ _daemon_prep(stderr_log);
+ return 0;
+ }
+
+ if (_NSGetExecutablePath (path, &size))
+ return -1;
+#endif
+ /*
+ * Fork to return control to the invoking process and to
+ * guarantee that we aren't a process group leader.
+ */
+ i = fork();
+ if (i != 0) {
+ /* Parent. */
+ DEBUGMSGT(("daemonize","first fork returned %d.\n", i));
+ if(i == -1) {
+ snmp_log(LOG_ERR,"first fork failed (errno %d) in "
+ "netsnmp_daemonize()\n", errno);
+ return -1;
+ }
+ if (quit_immediately) {
+ DEBUGMSGT(("daemonize","parent exiting\n"));
+ exit(0);
+ }
+ } else {
+ /* Child. */
+#ifdef HAVE_SETSID
+ /* Become a process/session group leader. */
+ setsid();
+#endif
+ /*
+ * Fork to let the process/session group leader exit.
+ */
+ if ((i = fork()) != 0) {
+ DEBUGMSGT(("daemonize","second fork returned %d.\n", i));
+ if(i == -1) {
+ snmp_log(LOG_ERR,"second fork failed (errno %d) in "
+ "netsnmp_daemonize()\n", errno);
+ }
+ /* Parent. */
+ exit(0);
+ }
+#ifndef WIN32
+ else {
+ /* Child. */
+
+ DEBUGMSGT(("daemonize","child continuing\n"));
+
+#if ! defined(darwin9)
+ _daemon_prep(stderr_log);
+#else
+ /*
+ * Some darwin calls (using mach ports) don't work after
+ * a fork. So, now that we've forked, we re-exec ourself
+ * to ensure that the child's mach ports are all set up correctly,
+ * the getppid call above will prevent the exec child from
+ * forking...
+ */
+ char * const *argv = *_NSGetArgv ();
+ DEBUGMSGT(("daemonize","re-execing forked child\n"));
+ execv (path, argv);
+ snmp_log(LOG_ERR,"Forked child unable to re-exec - %s.\n", strerror (errno));
+ exit (0);
+#endif
+ }
+#endif /* !WIN32 */
+ }
+#endif /* HAVE_FORK */
+ return i;
+}
+
+/*
+ * *********************************************
+ */
+#ifdef WIN32
+in_addr_t
+get_myaddr(void)
+{
+ char local_host[130];
+ int result;
+ LPHOSTENT lpstHostent;
+ SOCKADDR_IN in_addr, remote_in_addr;
+ SOCKET hSock;
+ int nAddrSize = sizeof(SOCKADDR);
+
+ in_addr.sin_addr.s_addr = INADDR_ANY;
+
+ result = gethostname(local_host, sizeof(local_host));
+ if (result == 0) {
+ lpstHostent = gethostbyname((LPSTR) local_host);
+ if (lpstHostent) {
+ in_addr.sin_addr.s_addr =
+ *((u_long FAR *) (lpstHostent->h_addr));
+ return ((in_addr_t) in_addr.sin_addr.s_addr);
+ }
+ }
+
+ /*
+ * if we are here, than we don't have host addr
+ */
+ hSock = socket(AF_INET, SOCK_DGRAM, 0);
+ if (hSock != INVALID_SOCKET) {
+ /*
+ * connect to any port and address
+ */
+ remote_in_addr.sin_family = AF_INET;
+ remote_in_addr.sin_port = htons(IPPORT_ECHO);
+ remote_in_addr.sin_addr.s_addr = inet_addr("0.0.0.0");
+ result =
+ connect(hSock, (LPSOCKADDR) & remote_in_addr,
+ sizeof(SOCKADDR));
+ if (result != SOCKET_ERROR) {
+ /*
+ * get local ip address
+ */
+ getsockname(hSock, (LPSOCKADDR) & in_addr,
+ (int FAR *) &nAddrSize);
+ }
+ closesocket(hSock);
+ }
+ return ((in_addr_t) in_addr.sin_addr.s_addr);
+}
+
+long
+get_uptime(void)
+{
+ long return_value = 0;
+ DWORD buffersize = (sizeof(PERF_DATA_BLOCK) +
+ sizeof(PERF_OBJECT_TYPE)),
+ type = REG_EXPAND_SZ;
+ PPERF_DATA_BLOCK perfdata = NULL;
+
+ /*
+ * min requirement is one PERF_DATA_BLOCK plus one PERF_OBJECT_TYPE
+ */
+ perfdata = (PPERF_DATA_BLOCK) malloc(buffersize);
+ if (!perfdata)
+ return 0;
+
+ memset(perfdata, 0, buffersize);
+
+ RegQueryValueEx(HKEY_PERFORMANCE_DATA,
+ "Global", NULL, &type, (LPBYTE) perfdata, &buffersize);
+
+ /*
+ * we can not rely on the return value since there is always more so
+ * we check the signature
+ */
+
+ if (wcsncmp(perfdata->Signature, L"PERF", 4) == 0) {
+ /*
+ * signature ok, and all we need is in the in the PERF_DATA_BLOCK
+ */
+ return_value = (long) ((perfdata->PerfTime100nSec.QuadPart /
+ (LONGLONG) 100000));
+ } else
+ return_value = GetTickCount() / 10;
+
+ RegCloseKey(HKEY_PERFORMANCE_DATA);
+ free(perfdata);
+
+ return return_value;
+}
+
+char *
+winsock_startup(void)
+{
+ WORD VersionRequested;
+ WSADATA stWSAData;
+ int i;
+ static char errmsg[100];
+
+ /* winsock 1: use MAKEWORD(1,1) */
+ /* winsock 2: use MAKEWORD(2,2) */
+
+ VersionRequested = MAKEWORD(2,2);
+ i = WSAStartup(VersionRequested, &stWSAData);
+ if (i != 0) {
+ if (i == WSAVERNOTSUPPORTED)
+ sprintf(errmsg,
+ "Unable to init. socket lib, does not support 1.1");
+ else {
+ sprintf(errmsg, "Socket Startup error %d", i);
+ }
+ return (errmsg);
+ }
+ return (NULL);
+}
+
+void
+winsock_cleanup(void)
+{
+ WSACleanup();
+}
+
+#else /* ! WIN32 */
+/*******************************************************************/
+
+/*
+ * XXX What if we have multiple addresses? Or no addresses for that matter?
+ * XXX Could it be computed once then cached? Probably not worth it (not
+ * used very often).
+ */
+in_addr_t
+get_myaddr(void)
+{
+ int sd, i, lastlen = 0;
+ struct ifconf ifc;
+ struct ifreq *ifrp = NULL;
+ in_addr_t addr;
+ char *buf = NULL;
+
+ 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 = (char *) 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);
+ }
+
+ for (ifrp = ifc.ifc_req;
+ (char *)ifrp < (char *)ifc.ifc_req + ifc.ifc_len;
+#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
+ ifrp = (struct ifreq *)(((char *) ifrp) +
+ sizeof(ifrp->ifr_name) +
+ ifrp->ifr_addr.sa_len)
+#else
+ ifrp++
+#endif
+ ) {
+ if (ifrp->ifr_addr.sa_family != AF_INET) {
+ continue;
+ }
+ addr = ((struct sockaddr_in *) &(ifrp->ifr_addr))->sin_addr.s_addr;
+
+ if (ioctl(sd, SIOCGIFFLAGS, (char *) ifrp) < 0) {
+ continue;
+ }
+ if ((ifrp->ifr_flags & IFF_UP)
+#ifdef IFF_RUNNING
+ && (ifrp->ifr_flags & IFF_RUNNING)
+#endif /* IFF_RUNNING */
+ && !(ifrp->ifr_flags & IFF_LOOPBACK)
+ && addr != LOOPBACK) {
+ /*
+ * I *really* don't understand why this is necessary. Perhaps for
+ * some broken platform? Leave it for now. JBPN
+ */
+#ifdef SYS_IOCTL_H_HAS_SIOCGIFADDR
+ if (ioctl(sd, SIOCGIFADDR, (char *) ifrp) < 0) {
+ continue;
+ }
+ addr =
+ ((struct sockaddr_in *) &(ifrp->ifr_addr))->sin_addr.
+ s_addr;
+#endif
+ free(buf);
+ close(sd);
+ return addr;
+ }
+ }
+ free(buf);
+ close(sd);
+ return 0;
+}
+
+
+#if !defined(solaris2) && !defined(linux) && !defined(cygwin)
+/*
+ * Returns boottime in centiseconds(!).
+ * Caches this for future use.
+ */
+long
+get_boottime(void)
+{
+ static long boottime_csecs = 0;
+#if defined(hpux10) || defined(hpux11)
+ struct pst_static pst_buf;
+#else
+ struct timeval boottime;
+#ifdef NETSNMP_CAN_USE_SYSCTL
+ int mib[2];
+ size_t len;
+#elif defined(NETSNMP_CAN_USE_NLIST)
+ int kmem;
+ static struct nlist nl[] = {
+#if !defined(hpux)
+ {(char *) "_boottime"},
+#else
+ {(char *) "boottime"},
+#endif
+ {(char *) ""}
+ };
+#endif /* NETSNMP_CAN_USE_SYSCTL */
+#endif /* hpux10 || hpux 11 */
+
+
+ if (boottime_csecs != 0)
+ return (boottime_csecs);
+
+#if defined(hpux10) || defined(hpux11)
+ pstat_getstatic(&pst_buf, sizeof(struct pst_static), 1, 0);
+ boottime_csecs = pst_buf.boot_time * 100;
+#elif NETSNMP_CAN_USE_SYSCTL
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_BOOTTIME;
+
+ len = sizeof(boottime);
+
+ sysctl(mib, 2, &boottime, &len, NULL, 0);
+ boottime_csecs = (boottime.tv_sec * 100) + (boottime.tv_usec / 10000);
+#elif defined(NETSNMP_CAN_USE_NLIST)
+ if ((kmem = open("/dev/kmem", 0)) < 0)
+ return 0;
+ nlist(KERNEL_LOC, nl);
+ if (nl[0].n_type == 0) {
+ close(kmem);
+ return 0;
+ }
+
+ lseek(kmem, (long) nl[0].n_value, L_SET);
+ read(kmem, &boottime, sizeof(boottime));
+ close(kmem);
+ boottime_csecs = (boottime.tv_sec * 100) + (boottime.tv_usec / 10000);
+#else
+ return 0;
+#endif /* hpux10 || hpux 11 */
+
+ return (boottime_csecs);
+}
+#endif
+
+/**
+ * Returns the system uptime in centiseconds.
+ *
+ * @note The value returned by this function is not identical to sysUpTime
+ * defined in RFC 1213. get_uptime() returns the system uptime while
+ * sysUpTime represents the time that has elapsed since the most recent
+ * restart of the network manager (snmpd).
+ *
+ * @see See also netsnmp_get_agent_uptime().
+ */
+long
+get_uptime(void)
+{
+#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ struct nlist nl;
+ int kmem;
+ time_t lbolt;
+ nl.n_name = "lbolt";
+ if(knlist(&nl, 1, sizeof(struct nlist)) != 0) return(0);
+ if(nl.n_type == 0 || nl.n_value == 0) return(0);
+ if((kmem = open("/dev/mem", 0)) < 0) return 0;
+ lseek(kmem, (long) nl.n_value, L_SET);
+ read(kmem, &lbolt, sizeof(lbolt));
+ close(kmem);
+ return(lbolt);
+#elif defined(solaris2)
+ kstat_ctl_t *ksc = kstat_open();
+ kstat_t *ks;
+ kid_t kid;
+ kstat_named_t *named;
+ u_long lbolt = 0;
+
+ if (ksc) {
+ ks = kstat_lookup(ksc, "unix", -1, "system_misc");
+ if (ks) {
+ kid = kstat_read(ksc, ks, NULL);
+ if (kid != -1) {
+ named = kstat_data_lookup(ks, "lbolt");
+ if (named) {
+#ifdef KSTAT_DATA_UINT32
+ lbolt = named->value.ui32;
+#else
+ lbolt = named->value.ul;
+#endif
+ }
+ }
+ }
+ kstat_close(ksc);
+ }
+ return lbolt;
+#elif defined(linux) || defined(cygwin)
+ FILE *in = fopen("/proc/uptime", "r");
+ long uptim = 0, a, b;
+ if (in) {
+ if (2 == fscanf(in, "%ld.%ld", &a, &b))
+ uptim = a * 100 + b;
+ fclose(in);
+ }
+ return uptim;
+#else
+ struct timeval now;
+ long boottime_csecs, nowtime_csecs;
+
+ boottime_csecs = get_boottime();
+ if (boottime_csecs == 0)
+ return 0;
+ gettimeofday(&now, (struct timezone *) 0);
+ nowtime_csecs = (now.tv_sec * 100) + (now.tv_usec / 10000);
+
+ return (nowtime_csecs - boottime_csecs);
+#endif
+}
+
+#endif /* ! WIN32 */
+/*******************************************************************/
+
+#ifdef DNSSEC_LOCAL_VALIDATION
+static val_context_t *_val_context = NULL;
+
+static val_context_t *
+netsnmp_validator_context(void)
+{
+ if (NULL == _val_context) {
+ int rc;
+ char *apptype = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ DEBUGMSGTL(("dns:sec:context", "creating dnssec context for %s\n",
+ apptype));
+ rc = val_create_context(apptype, &_val_context);
+ }
+
+ return _val_context;
+}
+#endif /* DNSSEC_LOCAL_VALIDATION */
+
+int
+netsnmp_gethostbyname_v4(const char* name, in_addr_t *addr_out)
+{
+#if HAVE_GETADDRINFO
+ struct addrinfo *addrs = NULL;
+ struct addrinfo hint;
+ int err;
+
+ memset(&hint, 0, sizeof hint);
+ hint.ai_flags = 0;
+ hint.ai_family = PF_INET;
+ hint.ai_socktype = SOCK_DGRAM;
+ hint.ai_protocol = 0;
+
+ err = netsnmp_getaddrinfo(name, NULL, &hint, &addrs);
+ if (err != 0) {
+#if HAVE_GAI_STRERROR
+ snmp_log(LOG_ERR, "getaddrinfo: %s %s\n", name,
+ gai_strerror(err));
+#else
+ snmp_log(LOG_ERR, "getaddrinfo: %s (error %d)\n", name,
+ err);
+#endif
+ return -1;
+ }
+
+ if (addrs != NULL) {
+ memcpy(addr_out,
+ &((struct sockaddr_in *) addrs->ai_addr)->sin_addr,
+ sizeof(in_addr_t));
+ freeaddrinfo(addrs);
+ } else {
+ DEBUGMSGTL(("get_thisaddr",
+ "Failed to resolve IPv4 hostname\n"));
+ }
+ return 0;
+
+#elif HAVE_GETHOSTBYNAME
+ struct hostent *hp = NULL;
+
+ hp = netsnmp_gethostbyname(name);
+ if (hp == NULL) {
+ DEBUGMSGTL(("get_thisaddr",
+ "hostname (couldn't resolve)\n"));
+ return -1;
+ } else if (hp->h_addrtype != AF_INET) {
+ DEBUGMSGTL(("get_thisaddr",
+ "hostname (not AF_INET!)\n"));
+ return -1;
+ } else {
+ DEBUGMSGTL(("get_thisaddr",
+ "hostname (resolved okay)\n"));
+ memcpy(addr_out, hp->h_addr, sizeof(in_addr_t));
+ }
+ return 0;
+
+#elif HAVE_GETIPNODEBYNAME
+ struct hostent *hp = NULL;
+ int err;
+
+ hp = getipnodebyname(peername, AF_INET, 0, &err);
+ if (hp == NULL) {
+ DEBUGMSGTL(("get_thisaddr",
+ "hostname (couldn't resolve = %d)\n", err));
+ return -1;
+ }
+ DEBUGMSGTL(("get_thisaddr",
+ "hostname (resolved okay)\n"));
+ memcpy(addr_out, hp->h_addr, sizeof(in_addr_t));
+ return 0;
+
+#else /* HAVE_GETIPNODEBYNAME */
+ return -1;
+#endif
+}
+
+int
+netsnmp_getaddrinfo(const char *name, const char *service,
+ const struct addrinfo *hints, struct addrinfo **res)
+{
+#if HAVE_GETADDRINFO
+ struct addrinfo *addrs = NULL;
+ struct addrinfo hint;
+ int err;
+#ifdef DNSSEC_LOCAL_VALIDATION
+ val_status_t val_status;
+#endif
+
+ DEBUGMSGTL(("dns:getaddrinfo", "looking up %s:%s\n", name, service));
+
+ if (NULL == hints) {
+ memset(&hint, 0, sizeof hint);
+ hint.ai_flags = 0;
+ hint.ai_family = PF_INET;
+ hint.ai_socktype = SOCK_DGRAM;
+ hint.ai_protocol = 0;
+ hints = &hint;
+ } else {
+ memcpy(&hint, hints, sizeof hint);
+ }
+
+#ifndef DNSSEC_LOCAL_VALIDATION
+ err = getaddrinfo(name, NULL, &hint, &addrs);
+#else /* DNSSEC_LOCAL_VALIDATION */
+ err = val_getaddrinfo(netsnmp_validator_context(), name, NULL, &hint,
+ &addrs, &val_status);
+ DEBUGMSGTL(("dns:sec:val", "err %d, val_status %d / %s; trusted: %d\n",
+ err, val_status, p_val_status(val_status),
+ val_istrusted(val_status)));
+ if (! val_istrusted(val_status)) {
+ int rc;
+ if ((err != 0) && VAL_GETADDRINFO_HAS_STATUS(err)) {
+ snmp_log(LOG_WARNING,
+ "WARNING: UNTRUSTED error in DNS resolution for %s!\n",
+ name);
+ rc = EAI_FAIL;
+ } else {
+ snmp_log(LOG_WARNING,
+ "The authenticity of DNS response is not trusted (%s)\n",
+ p_val_status(val_status));
+ rc = EAI_NONAME;
+ }
+ /** continue anyways if DNSSEC_WARN_ONLY is set */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DNSSEC_WARN_ONLY))
+ return rc;
+ }
+
+
+#endif /* DNSSEC_LOCAL_VALIDATION */
+ *res = addrs;
+ if ((0 == err) && addrs && addrs->ai_addr) {
+ DEBUGMSGTL(("dns:getaddrinfo", "answer { AF_INET, %s:%hu }\n",
+ inet_ntoa(((struct sockaddr_in*)addrs->ai_addr)->sin_addr),
+ ntohs(((struct sockaddr_in*)addrs->ai_addr)->sin_port)));
+ }
+ return err;
+#else
+ NETSNMP_LOGONCE((LOG_ERR, "getaddrinfo not available"));
+ return EAI_FAIL;
+#endif /* getaddrinfo */
+}
+
+struct hostent *
+netsnmp_gethostbyname(const char *name)
+{
+#if HAVE_GETHOSTBYNAME
+#ifdef DNSSEC_LOCAL_VALIDATION
+ val_status_t val_status;
+#endif
+ struct hostent *hp = NULL;
+
+ if (NULL == name)
+ return NULL;
+
+ DEBUGMSGTL(("dns:gethostbyname", "looking up %s\n", name));
+
+#ifdef DNSSEC_LOCAL_VALIDATION
+ hp = val_gethostbyname(netsnmp_validator_context(), name, &val_status);
+ DEBUGMSGTL(("dns:sec:val", "val_status %d / %s; trusted: %d\n",
+ val_status, p_val_status(val_status),
+ val_istrusted(val_status)));
+ if (!val_istrusted(val_status)) {
+ snmp_log(LOG_WARNING,
+ "The authenticity of DNS response is not trusted (%s)\n",
+ p_val_status(val_status));
+ /** continue anyways if DNSSEC_WARN_ONLY is set */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DNSSEC_WARN_ONLY))
+ hp = NULL;
+ }
+ else if (val_does_not_exist(val_status) && hp)
+ hp = NULL;
+#else
+ hp = gethostbyname(name);
+#endif
+ if (hp == NULL) {
+ DEBUGMSGTL(("dns:gethostbyname",
+ "couldn't resolve %s\n", name));
+ } else if (hp->h_addrtype != AF_INET) {
+ DEBUGMSGTL(("dns:gethostbyname",
+ "warning: response for %s not AF_INET!\n", name));
+ } else {
+ DEBUGMSGTL(("dns:gethostbyname",
+ "%s resolved okay\n", name));
+ }
+ return hp;
+#else
+ NETSNMP_LOGONCE((LOG_ERR, "gethostbyname not available"));
+ return NULL;
+#endif /* HAVE_GETHOSTBYNAME */
+}
+
+/**
+ * Look up the host name via DNS.
+ *
+ * @param[in] addr Pointer to the address to resolve. This argument points e.g.
+ * to a struct in_addr for AF_INET or to a struct in6_addr for AF_INET6.
+ * @param[in] len Length in bytes of *addr.
+ * @param[in] type Address family, e.g. AF_INET or AF_INET6.
+ *
+ * @return Pointer to a hostent structure if address lookup succeeded or NULL
+ * if the lookup failed.
+ *
+ * @see See also the gethostbyaddr() man page.
+ */
+struct hostent *
+netsnmp_gethostbyaddr(const void *addr, socklen_t len, int type)
+{
+#if HAVE_GETHOSTBYADDR
+ struct hostent *hp = NULL;
+ char buf[64];
+
+ DEBUGMSGTL(("dns:gethostbyaddr", "resolving %s\n",
+ inet_ntop(type, addr, buf, sizeof(buf))));
+
+#ifdef DNSSEC_LOCAL_VALIDATION
+ val_status_t val_status;
+ hp = val_gethostbyaddr(netsnmp_validator_context(), addr, len, type,
+ &val_status);
+ DEBUGMSGTL(("dns:sec:val", "val_status %d / %s; trusted: %d\n",
+ val_status, p_val_status(val_status),
+ val_istrusted(val_status)));
+ if (!val_istrusted(val_status)) {
+ snmp_log(LOG_WARNING,
+ "The authenticity of DNS response is not trusted (%s)\n",
+ p_val_status(val_status));
+ /** continue anyways if DNSSEC_WARN_ONLY is set */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DNSSEC_WARN_ONLY))
+ hp = NULL;
+ }
+ else if (val_does_not_exist(val_status) && hp)
+ hp = NULL;
+#else
+ hp = gethostbyaddr(addr, len, type);
+#endif
+ if (hp == NULL) {
+ DEBUGMSGTL(("dns:gethostbyaddr", "couldn't resolve addr\n"));
+ } else if (hp->h_addrtype != AF_INET) {
+ DEBUGMSGTL(("dns:gethostbyaddr",
+ "warning: response for addr not AF_INET!\n"));
+ } else {
+ DEBUGMSGTL(("dns:gethostbyaddr", "addr resolved okay\n"));
+ }
+ return hp;
+#else
+ NETSNMP_LOGONCE((LOG_ERR, "gethostbyaddr not available"));
+ return NULL;
+#endif
+}
+
+/*******************************************************************/
+
+#ifndef HAVE_STRNCASECMP
+
+/*
+ * test for NULL pointers before and NULL characters after
+ * * comparing possibly non-NULL strings.
+ * * WARNING: This function does NOT check for array overflow.
+ */
+int
+strncasecmp(const char *s1, const char *s2, size_t nch)
+{
+ size_t ii;
+ int res = -1;
+
+ if (!s1) {
+ if (!s2)
+ return 0;
+ return (-1);
+ }
+ if (!s2)
+ return (1);
+
+ for (ii = 0; (ii < nch) && *s1 && *s2; ii++, s1++, s2++) {
+ res = (int) (tolower(*s1) - tolower(*s2));
+ if (res != 0)
+ break;
+ }
+
+ if (ii == nch) {
+ s1--;
+ s2--;
+ }
+
+ if (!*s1) {
+ if (!*s2)
+ return 0;
+ return (-1);
+ }
+ if (!*s2)
+ return (1);
+
+ return (res);
+}
+
+int
+strcasecmp(const char *s1, const char *s2)
+{
+ return strncasecmp(s1, s2, 1000000);
+}
+
+#endif /* HAVE_STRNCASECMP */
+
+
+#ifndef HAVE_STRDUP
+char *
+strdup(const char *src)
+{
+ int len;
+ char *dst;
+
+ len = strlen(src) + 1;
+ if ((dst = (char *) malloc(len)) == NULL)
+ return (NULL);
+ strcpy(dst, src);
+ return (dst);
+}
+#endif /* HAVE_STRDUP */
+
+#ifndef HAVE_SETENV
+int
+setenv(const char *name, const char *value, int overwrite)
+{
+ char *cp;
+ int ret;
+
+ if (overwrite == 0) {
+ if (getenv(name))
+ return 0;
+ }
+ cp = (char *) malloc(strlen(name) + strlen(value) + 2);
+ if (cp == NULL)
+ return -1;
+ sprintf(cp, "%s=%s", name, value);
+ ret = putenv(cp);
+#ifdef WIN32
+ free(cp);
+#endif
+ return ret;
+}
+#endif /* HAVE_SETENV */
+
+netsnmp_feature_child_of(calculate_time_diff, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_CALCULATE_TIME_DIFF
+/**
+ * Compute (*now - *then) in centiseconds.
+ */
+int
+calculate_time_diff(const struct timeval *now, const struct timeval *then)
+{
+ struct timeval diff;
+
+ NETSNMP_TIMERSUB(now, then, &diff);
+ return (int)(diff.tv_sec * 100 + diff.tv_usec / 10000);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CALCULATE_TIME_DIFF */
+
+#ifndef NETSNMP_FEATURE_REMOVE_CALCULATE_SECTIME_DIFF
+/** Compute rounded (*now - *then) in seconds. */
+u_int
+calculate_sectime_diff(const struct timeval *now, const struct timeval *then)
+{
+ struct timeval diff;
+
+ NETSNMP_TIMERSUB(now, then, &diff);
+ return diff.tv_sec + (diff.tv_usec >= 500000L);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_CALCULATE_SECTIME_DIFF */
+
+#ifndef HAVE_STRCASESTR
+/*
+ * only glibc2 has this.
+ */
+char *
+strcasestr(const char *haystack, const char *needle)
+{
+ const char *cp1 = haystack, *cp2 = needle;
+ const char *cx;
+ int tstch1, tstch2;
+
+ /*
+ * printf("looking for '%s' in '%s'\n", needle, haystack);
+ */
+ if (cp1 && cp2 && *cp1 && *cp2)
+ for (cp1 = haystack, cp2 = needle; *cp1;) {
+ cx = cp1;
+ cp2 = needle;
+ do {
+ /*
+ * printf("T'%c' ", *cp1);
+ */
+ if (!*cp2) { /* found the needle */
+ /*
+ * printf("\nfound '%s' in '%s'\n", needle, cx);
+ */
+ return NETSNMP_REMOVE_CONST(char *, cx);
+ }
+ if (!*cp1)
+ break;
+
+ tstch1 = toupper(*cp1);
+ tstch2 = toupper(*cp2);
+ if (tstch1 != tstch2)
+ break;
+ /*
+ * printf("M'%c' ", *cp1);
+ */
+ cp1++;
+ cp2++;
+ }
+ while (1);
+ if (*cp1)
+ cp1++;
+ }
+ /*
+ * printf("\n");
+ */
+ if (cp1 && *cp1)
+ return NETSNMP_REMOVE_CONST(char *, cp1);
+
+ return NULL;
+}
+#endif
+
+int
+mkdirhier(const char *pathname, mode_t mode, int skiplast)
+{
+ struct stat sbuf;
+ char *ourcopy = strdup(pathname);
+ char *entry;
+ char *buf = NULL;
+ char *st = NULL;
+ int res;
+
+ res = SNMPERR_GENERR;
+ if (!ourcopy)
+ goto out;
+
+ buf = malloc(strlen(pathname) + 2);
+ if (!buf)
+ goto out;
+
+#if defined (WIN32) || defined (cygwin)
+ /* convert backslash to forward slash */
+ for (entry = ourcopy; *entry; entry++)
+ if (*entry == '\\')
+ *entry = '/';
+#endif
+
+ entry = strtok_r(ourcopy, "/", &st);
+
+ buf[0] = '\0';
+
+#if defined (WIN32) || defined (cygwin)
+ /*
+ * Check if first entry contains a drive-letter
+ * e.g "c:/path"
+ */
+ if ((entry) && (':' == entry[1]) &&
+ (('\0' == entry[2]) || ('/' == entry[2]))) {
+ strcat(buf, entry);
+ entry = strtok_r(NULL, "/", &st);
+ }
+#endif
+
+ /*
+ * check to see if filename is a directory
+ */
+ while (entry) {
+ strcat(buf, "/");
+ strcat(buf, entry);
+ entry = strtok_r(NULL, "/", &st);
+ if (entry == NULL && skiplast)
+ break;
+ if (stat(buf, &sbuf) < 0) {
+ /*
+ * DNE, make it
+ */
+#ifdef WIN32
+ if (CreateDirectory(buf, NULL) == 0)
+#else
+ if (mkdir(buf, mode) == -1)
+#endif
+ goto out;
+ else
+ snmp_log(LOG_INFO, "Created directory: %s\n", buf);
+ } else {
+ /*
+ * exists, is it a file?
+ */
+ if ((sbuf.st_mode & S_IFDIR) == 0) {
+ /*
+ * ack! can't make a directory on top of a file
+ */
+ goto out;
+ }
+ }
+ }
+ res = SNMPERR_SUCCESS;
+out:
+ free(buf);
+ free(ourcopy);
+ return res;
+}
+
+/**
+ * netsnmp_mktemp creates a temporary file based on the
+ * configured tempFilePattern
+ *
+ * @return file descriptor
+ */
+const char *
+netsnmp_mktemp(void)
+{
+#ifdef PATH_MAX
+ static char name[PATH_MAX];
+#else
+ static char name[256];
+#endif
+ int fd = -1;
+
+ strlcpy(name, get_temp_file_pattern(), sizeof(name));
+#ifdef HAVE_MKSTEMP
+ {
+ mode_t oldmask = umask(~(S_IRUSR | S_IWUSR));
+ netsnmp_assert(oldmask != (mode_t)(-1));
+ fd = mkstemp(name);
+ umask(oldmask);
+ }
+#else
+ if (mktemp(name)) {
+# ifndef WIN32
+ fd = open(name, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR);
+# else
+ /*
+ * Win32 needs _S_IREAD | _S_IWRITE to set permissions on file
+ * after closing
+ */
+ fd = _open(name, _O_CREAT | _O_EXCL | _O_WRONLY, _S_IREAD | _S_IWRITE);
+# endif
+ }
+#endif
+ if (fd >= 0) {
+ close(fd);
+ DEBUGMSGTL(("netsnmp_mktemp", "temp file created: %s\n",
+ name));
+ return name;
+ }
+ snmp_log(LOG_ERR, "netsnmp_mktemp: error creating file %s\n",
+ name);
+ return NULL;
+}
+
+/*
+ * This function was created to differentiate actions
+ * that are appropriate for Linux 2.4 kernels, but not later kernels.
+ *
+ * This function can be used to test kernels on any platform that supports uname().
+ *
+ * If not running a platform that supports uname(), return -1.
+ *
+ * If ospname matches, and the release matches up through the prefix,
+ * return 0.
+ * If the release is ordered higher, return 1.
+ * Be aware that "ordered higher" is not a guarantee of correctness.
+ */
+int
+netsnmp_os_prematch(const char *ospmname,
+ const char *ospmrelprefix)
+{
+#if HAVE_SYS_UTSNAME_H
+static int printOSonce = 1;
+ struct utsname utsbuf;
+ if ( 0 != uname(&utsbuf))
+ return -1;
+
+ if (printOSonce) {
+ printOSonce = 0;
+ /* show the four elements that the kernel can be sure of */
+ DEBUGMSGT(("daemonize","sysname '%s',\nrelease '%s',\nversion '%s',\nmachine '%s'\n",
+ utsbuf.sysname, utsbuf.release, utsbuf.version, utsbuf.machine));
+ }
+ if (0 != strcasecmp(utsbuf.sysname, ospmname)) return -1;
+
+ /* Required to match only the leading characters */
+ return strncasecmp(utsbuf.release, ospmrelprefix, strlen(ospmrelprefix));
+
+#else
+
+ return -1;
+
+#endif /* HAVE_SYS_UTSNAME_H */
+}
+
+/**
+ * netsnmp_os_kernel_width determines kernel width at runtime
+ * Currently implemented for IRIX, AIX and Tru64 Unix
+ *
+ * @return kernel width (usually 32 or 64) on success, -1 on error
+ */
+int
+netsnmp_os_kernel_width(void)
+{
+#ifdef irix6
+ char buf[8];
+ sysinfo(_MIPS_SI_OS_NAME, buf, 7);
+ if (strncmp("IRIX64", buf, 6) == 0) {
+ return 64;
+ } else if (strncmp("IRIX", buf, 4) == 0) {
+ return 32;
+ } else {
+ return -1;
+ }
+#elif defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
+ return (__KERNEL_32() ? 32 : (__KERNEL_64() ? 64 : -1));
+#elif defined(osf4) || defined(osf5) || defined(__alpha)
+ return 64; /* Alpha is always 64bit */
+#else
+ /* kernel width detection not implemented */
+ return -1;
+#endif
+}
+
+netsnmp_feature_child_of(str_to_uid, user_information)
+#ifndef NETSNMP_FEATURE_REMOVE_STR_TO_UID
+/**
+ * Convert a user name or number into numeric form.
+ *
+ * @param[in] useroruid Either a Unix user name or the ASCII representation
+ * of a user number.
+ *
+ * @return Either a user number > 0 or 0 if useroruid is not a valid user
+ * name, not a valid user number or the name of the root user.
+ */
+int netsnmp_str_to_uid(const char *useroruid) {
+ int uid;
+#if HAVE_GETPWNAM && HAVE_PWD_H
+ struct passwd *pwd;
+#endif
+
+ uid = atoi(useroruid);
+
+ if (uid == 0) {
+#if HAVE_GETPWNAM && HAVE_PWD_H
+ pwd = getpwnam(useroruid);
+ uid = pwd ? pwd->pw_uid : 0;
+ endpwent();
+#endif
+ if (uid == 0)
+ snmp_log(LOG_WARNING, "Can't identify user (%s).\n", useroruid);
+ }
+ return uid;
+
+}
+#endif /* NETSNMP_FEATURE_REMOVE_STR_TO_UID */
+
+netsnmp_feature_child_of(str_to_gid, user_information)
+#ifndef NETSNMP_FEATURE_REMOVE_STR_TO_GID
+/**
+ * Convert a group name or number into numeric form.
+ *
+ * @param[in] grouporgid Either a Unix group name or the ASCII representation
+ * of a group number.
+ *
+ * @return Either a group number > 0 or 0 if grouporgid is not a valid group
+ * name, not a valid group number or the root group.
+ */
+int netsnmp_str_to_gid(const char *grouporgid)
+{
+ int gid;
+
+ gid = atoi(grouporgid);
+
+ if (gid == 0) {
+#if HAVE_GETGRNAM && HAVE_GRP_H
+ struct group *grp;
+
+ grp = getgrnam(grouporgid);
+ gid = grp ? grp->gr_gid : 0;
+ endgrent();
+#endif
+ if (gid == 0)
+ snmp_log(LOG_WARNING, "Can't identify group (%s).\n", grouporgid);
+ }
+
+ return gid;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_STR_TO_GID */
diff --git a/snmplib/text_utils.c b/snmplib/text_utils.c
new file mode 100644
index 0000000..32596be
--- /dev/null
+++ b/snmplib/text_utils.c
@@ -0,0 +1,526 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <stdio.h>
+#include <ctype.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
+
+#include <sys/types.h>
+
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#include <errno.h>
+
+#if HAVE_DMALLOC_H
+# include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/file_utils.h>
+#include <net-snmp/library/text_utils.h>
+
+netsnmp_feature_child_of(text_utils, libnetsnmp)
+
+netsnmp_feature_provide(text_utils)
+#ifdef NETSNMP_FEATURE_REQUIRE_TEXT_UTILS
+netsnmp_feature_require(file_utils)
+#endif /* NETSNMP_FEATURE_REQUIRE_TEXT_UTILS */
+
+#ifndef NETSNMP_FEATURE_REMOVE_TEXT_UTILS
+/*------------------------------------------------------------------
+ *
+ * Prototypes
+ *
+ */
+/*
+ * parse methods
+ */
+void
+_pm_save_index_string_string(FILE *f, netsnmp_container *cin,
+ int flags);
+void
+_pm_save_everything(FILE *f, netsnmp_container *cin, int flags);
+void
+_pm_user_function(FILE *f, netsnmp_container *cin,
+ netsnmp_line_process_info *lpi, int flags);
+
+
+/*
+ * line processors
+ */
+int _process_line_tvi(netsnmp_line_info *line_info, void *mem,
+ struct netsnmp_line_process_info_s* lpi);
+
+
+
+/*------------------------------------------------------------------
+ *
+ * Text file processing functions
+ *
+ */
+
+/**
+ * process text file, reading into extras
+ */
+netsnmp_container *
+netsnmp_file_text_parse(netsnmp_file *f, netsnmp_container *cin,
+ int parse_mode, u_int flags, void *context)
+{
+ netsnmp_container *c = cin;
+ FILE *fin;
+ int rc;
+
+ if (NULL == f)
+ return NULL;
+
+ if ((NULL == c) && (!(flags & PM_FLAG_NO_CONTAINER))) {
+ c = netsnmp_container_find("text_parse:binary_array");
+ if (NULL == c)
+ return NULL;
+ }
+
+ rc = netsnmp_file_open(f);
+ if (rc < 0) { /** error already logged */
+ if ((NULL !=c) && (c != cin))
+ CONTAINER_FREE(c);
+ return NULL;
+ }
+
+ /*
+ * get a stream from the file descriptor. This DOES NOT rewind the
+ * file (if fd was previously opened).
+ */
+ fin = fdopen(f->fd, "r");
+ if (NULL == fin) {
+ if (NS_FI_AUTOCLOSE(f->ns_flags))
+ close(f->fd);
+ if ((NULL !=c) && (c != cin))
+ CONTAINER_FREE(c);
+ return NULL;
+ }
+
+ switch (parse_mode) {
+
+ case PM_SAVE_EVERYTHING:
+ _pm_save_everything(fin, c, flags);
+ break;
+
+ case PM_INDEX_STRING_STRING:
+ _pm_save_index_string_string(fin, c, flags);
+ break;
+
+ case PM_USER_FUNCTION:
+ if (NULL != context)
+ _pm_user_function(fin, c, (netsnmp_line_process_info*)context,
+ flags);
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown parse mode %d\n", parse_mode);
+ break;
+ }
+
+
+ /*
+ * close the stream, which will have the side effect of also closing
+ * the file descriptor, so we need to reset it.
+ */
+ fclose(fin);
+ f->fd = -1;
+
+ return c;
+}
+
+netsnmp_feature_child_of(text_token_container_from_file, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE_TEXT_TOKEN_CONTAINER_FROM_FILE
+netsnmp_container *
+netsnmp_text_token_container_from_file(const char *file, u_int flags,
+ netsnmp_container *cin, void *context)
+{
+ netsnmp_line_process_info lpi;
+ netsnmp_container *c = cin, *c_rc;
+ netsnmp_file *fp;
+
+ if (NULL == file)
+ return NULL;
+
+ /*
+ * allocate file resources
+ */
+ fp = netsnmp_file_fill(NULL, file, O_RDONLY, 0, 0);
+ if (NULL == fp) /** msg already logged */
+ return NULL;
+
+ memset(&lpi, 0x0, sizeof(lpi));
+ lpi.mem_size = sizeof(netsnmp_token_value_index);
+ lpi.process = _process_line_tvi;
+ lpi.user_context = context;
+
+ if (NULL == c) {
+ c = netsnmp_container_find("string:binary_array");
+ if (NULL == c) {
+ snmp_log(LOG_ERR,"malloc failed\n");
+ netsnmp_file_release(fp);
+ return NULL;
+ }
+ }
+
+ c_rc = netsnmp_file_text_parse(fp, c, PM_USER_FUNCTION, 0, &lpi);
+
+ /*
+ * if we got a bad return and the user didn't pass us a container,
+ * we need to release the container we allocated.
+ */
+ if ((NULL == c_rc) && (NULL == cin)) {
+ CONTAINER_FREE(c);
+ c = NULL;
+ }
+ else
+ c = c_rc;
+
+ /*
+ * release file resources
+ */
+ netsnmp_file_release(fp);
+
+ return c;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TEXT_TOKEN_CONTAINER_FROM_FILE */
+
+
+/*------------------------------------------------------------------
+ *
+ * Text file process modes helper functions
+ *
+ */
+
+/**
+ * @internal
+ * parse mode: save everything
+ */
+void
+_pm_save_everything(FILE *f, netsnmp_container *cin, int flags)
+{
+ char line[STRINGMAX], *ptr;
+ size_t len;
+
+ netsnmp_assert(NULL != f);
+ netsnmp_assert(NULL != cin);
+
+ while (fgets(line, sizeof(line), f) != NULL) {
+
+ ptr = line;
+ len = strlen(line) - 1;
+ if (line[len] == '\n')
+ line[len] = 0;
+
+ /*
+ * save blank line or comment?
+ */
+ if (flags & PM_FLAG_SKIP_WHITESPACE) {
+ if (NULL == (ptr = skip_white(ptr)))
+ continue;
+ }
+
+ ptr = strdup(line);
+ if (NULL == ptr) {
+ snmp_log(LOG_ERR,"malloc failed\n");
+ break;
+ }
+
+ CONTAINER_INSERT(cin,ptr);
+ }
+}
+
+/**
+ * @internal
+ * parse mode:
+ */
+void
+_pm_save_index_string_string(FILE *f, netsnmp_container *cin,
+ int flags)
+{
+ char line[STRINGMAX], *ptr;
+ netsnmp_token_value_index *tvi;
+ size_t count = 0, len;
+
+ netsnmp_assert(NULL != f);
+ netsnmp_assert(NULL != cin);
+
+ while (fgets(line, sizeof(line), f) != NULL) {
+
+ ++count;
+ ptr = line;
+ len = strlen(line) - 1;
+ if (line[len] == '\n')
+ line[len] = 0;
+
+ /*
+ * save blank line or comment?
+ */
+ if (flags & PM_FLAG_SKIP_WHITESPACE) {
+ if (NULL == (ptr = skip_white(ptr)))
+ continue;
+ }
+
+ tvi = SNMP_MALLOC_TYPEDEF(netsnmp_token_value_index);
+ if (NULL == tvi) {
+ snmp_log(LOG_ERR,"malloc failed\n");
+ break;
+ }
+
+ /*
+ * copy whole line, then set second pointer to
+ * after token. One malloc, 2 strings!
+ */
+ tvi->index = count;
+ tvi->token = strdup(line);
+ if (NULL == tvi->token) {
+ snmp_log(LOG_ERR,"malloc failed\n");
+ free(tvi);
+ break;
+ }
+ tvi->value.cp = skip_not_white(tvi->token);
+ if (NULL != tvi->value.cp) {
+ *(tvi->value.cp) = 0;
+ ++(tvi->value.cp);
+ }
+ CONTAINER_INSERT(cin, tvi);
+ }
+}
+
+/**
+ * @internal
+ * parse mode:
+ */
+void
+_pm_user_function(FILE *f, netsnmp_container *cin,
+ netsnmp_line_process_info *lpi, int flags)
+{
+ char buf[STRINGMAX];
+ netsnmp_line_info li;
+ void *mem = NULL;
+ int rc;
+
+ netsnmp_assert(NULL != f);
+ netsnmp_assert(NULL != cin);
+
+ /*
+ * static buf, or does the user want the memory?
+ */
+ if (flags & PMLP_FLAG_ALLOC_LINE) {
+ if (0 != lpi->line_max)
+ li.line_max = lpi->line_max;
+ else
+ li.line_max = STRINGMAX;
+ li.line = (char *)calloc(li.line_max, 1);
+ if (NULL == li.line) {
+ snmp_log(LOG_ERR,"malloc failed\n");
+ return;
+ }
+ }
+ else {
+ li.line = buf;
+ li.line_max = sizeof(buf);
+ }
+
+ li.index = 0;
+ while (fgets(li.line, li.line_max, f) != NULL) {
+
+ ++li.index;
+ li.start = li.line;
+ li.line_len = strlen(li.line) - 1;
+ if ((!(lpi->flags & PMLP_FLAG_LEAVE_NEWLINE)) &&
+ (li.line[li.line_len] == '\n'))
+ li.line[li.line_len] = 0;
+
+ /*
+ * save blank line or comment?
+ */
+ if (!(lpi->flags & PMLP_FLAG_PROCESS_WHITESPACE)) {
+ if (NULL == (li.start = skip_white(li.start)))
+ continue;
+ }
+
+ /*
+ * do we need to allocate memory for the use?
+ * if the last call didn't use the memory we allocated,
+ * re-use it. Otherwise, allocate new chunk.
+ */
+ if ((0 != lpi->mem_size) && (NULL == mem)) {
+ mem = calloc(lpi->mem_size, 1);
+ if (NULL == mem) {
+ snmp_log(LOG_ERR,"malloc failed\n");
+ break;
+ }
+ }
+
+ /*
+ * do they want a copy ot the line?
+ */
+ if (lpi->flags & PMLP_FLAG_STRDUP_LINE) {
+ li.start = strdup(li.start);
+ if (NULL == li.start) {
+ snmp_log(LOG_ERR,"malloc failed\n");
+ break;
+ }
+ }
+ else if (lpi->flags & PMLP_FLAG_ALLOC_LINE) {
+ li.start = li.line;
+ }
+
+ /*
+ * call the user function. If the function wants to save
+ * the memory chunk, insert it in the container, the clear
+ * pointer so we reallocate next time.
+ */
+ li.start_len = strlen(li.start);
+ rc = (*lpi->process)(&li, mem, lpi);
+ if (PMLP_RC_MEMORY_USED == rc) {
+
+ if (!(lpi->flags & PMLP_FLAG_NO_CONTAINER))
+ CONTAINER_INSERT(cin, mem);
+
+ mem = NULL;
+
+ if (lpi->flags & PMLP_FLAG_ALLOC_LINE) {
+ li.line = (char *)calloc(li.line_max, 1);
+ if (NULL == li.line) {
+ snmp_log(LOG_ERR,"malloc failed\n");
+ break;
+ }
+ }
+ }
+ else if (PMLP_RC_MEMORY_UNUSED == rc ) {
+ /*
+ * they didn't use the memory. if li.start was a strdup, we have
+ * to release it. leave mem, we can re-use it (its a fixed size).
+ */
+ if (lpi->flags & PMLP_FLAG_STRDUP_LINE)
+ free(li.start); /* no point in SNMP_FREE */
+ }
+ else {
+ if (PMLP_RC_STOP_PROCESSING != rc )
+ snmp_log(LOG_ERR, "unknown rc %d from text processor\n", rc);
+ break;
+ }
+ }
+ SNMP_FREE(mem);
+}
+
+/*------------------------------------------------------------------
+ *
+ * Test line process helper functions
+ *
+ */
+/**
+ * @internal
+ * process token value index line
+ */
+int
+_process_line_tvi(netsnmp_line_info *line_info, void *mem,
+ struct netsnmp_line_process_info_s* lpi)
+{
+ netsnmp_token_value_index *tvi = (netsnmp_token_value_index *)mem;
+ char *ptr;
+
+ /*
+ * get token
+ */
+ ptr = skip_not_white(line_info->start);
+ if (NULL == ptr) {
+ DEBUGMSGTL(("text:util:tvi", "no value after token '%s'\n",
+ line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+
+ /*
+ * null terminate, search for value;
+ */
+ *(ptr++) = 0;
+ ptr = skip_white(ptr);
+ if (NULL == ptr) {
+ DEBUGMSGTL(("text:util:tvi", "no value after token '%s'\n",
+ line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+
+ /*
+ * get value
+ */
+ switch((int)(intptr_t)lpi->user_context) {
+
+ case PMLP_TYPE_UNSIGNED:
+ tvi->value.ul = strtoul(ptr, NULL, 0);
+ if ((errno == ERANGE) && (ULONG_MAX == tvi->value.ul))
+ snmp_log(LOG_WARNING,"value overflow\n");
+ break;
+
+
+ case PMLP_TYPE_INTEGER:
+ tvi->value.sl = strtol(ptr, NULL, 0);
+ if ((errno == ERANGE) &&
+ ((LONG_MAX == tvi->value.sl) ||
+ (LONG_MIN == tvi->value.sl)))
+ snmp_log(LOG_WARNING,"value over/under-flow\n");
+ break;
+
+ case PMLP_TYPE_STRING:
+ tvi->value.cp = strdup(ptr);
+ break;
+
+ case PMLP_TYPE_BOOLEAN:
+ if (isdigit((unsigned char)(*ptr)))
+ tvi->value.ul = strtoul(ptr, NULL, 0);
+ else if (strcasecmp(ptr,"true") == 0)
+ tvi->value.ul = 1;
+ else if (strcasecmp(ptr,"false") == 0)
+ tvi->value.ul = 0;
+ else {
+ snmp_log(LOG_WARNING,"bad value for boolean\n");
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unsupported value type %d\n",
+ (int)(intptr_t)lpi->user_context);
+ break;
+ }
+
+ /*
+ * save token and value
+ */
+ tvi->token = strdup(line_info->start);
+ tvi->index = line_info->index;
+
+ return PMLP_RC_MEMORY_USED;
+}
+
+#else /* ! NETSNMP_FEATURE_REMOVE_TEXT_UTILS */
+netsnmp_feature_unused(text_utils);
+#endif /* ! NETSNMP_FEATURE_REMOVE_TEXT_UTILS */
diff --git a/snmplib/tools.c b/snmplib/tools.c
new file mode 100644
index 0000000..8e4852a
--- /dev/null
+++ b/snmplib/tools.c
@@ -0,0 +1,1376 @@
+/*
+ * tools.c
+ */
+
+#define NETSNMP_TOOLS_C 1 /* dont re-define malloc wrappers here */
+
+#ifdef HAVE_CRTDBG_H
+/*
+ * Define _CRTDBG_MAP_ALLOC such that in debug builds (when _DEBUG has been
+ * defined) e.g. malloc() is rerouted to _malloc_dbg().
+ */
+#define _CRTDBG_MAP_ALLOC 1
+#include <crtdbg.h>
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/types.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
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
+#endif
+#ifdef cygwin
+#include <windows.h>
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+#include <net-snmp/library/tools.h> /* for "internal" definitions */
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/scapi.h>
+
+netsnmp_feature_child_of(tools_all, libnetsnmp)
+
+netsnmp_feature_child_of(memory_wrappers, tools_all)
+netsnmp_feature_child_of(valgrind, tools_all)
+netsnmp_feature_child_of(string_time_to_secs, tools_all)
+netsnmp_feature_child_of(netsnmp_check_definedness, valgrind)
+
+netsnmp_feature_child_of(uatime_ready, netsnmp_unused)
+netsnmp_feature_child_of(timeval_tticks, netsnmp_unused)
+
+netsnmp_feature_child_of(memory_strdup, memory_wrappers)
+netsnmp_feature_child_of(memory_calloc, memory_wrappers)
+netsnmp_feature_child_of(memory_malloc, memory_wrappers)
+netsnmp_feature_child_of(memory_realloc, memory_wrappers)
+netsnmp_feature_child_of(memory_free, memory_wrappers)
+
+#ifndef NETSNMP_FEATURE_REMOVE_MEMORY_WRAPPERS
+/**
+ * This function is a wrapper for the strdup function.
+ *
+ * @note The strdup() implementation calls _malloc_dbg() when linking with
+ * MSVCRT??D.dll and malloc() when linking with MSVCRT??.dll
+ */
+char * netsnmp_strdup( const char * ptr)
+{
+ return strdup(ptr);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MEMORY_STRDUP */
+#ifndef NETSNMP_FEATURE_REMOVE_MEMORY_CALLOC
+/**
+ * This function is a wrapper for the calloc function.
+ */
+void * netsnmp_calloc(size_t nmemb, size_t size)
+{
+ return calloc(nmemb, size);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MEMORY_CALLOC */
+#ifndef NETSNMP_FEATURE_REMOVE_MEMORY_MALLOC
+/**
+ * This function is a wrapper for the malloc function.
+ */
+void * netsnmp_malloc(size_t size)
+{
+ return malloc(size);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MEMORY_MALLOC */
+#ifndef NETSNMP_FEATURE_REMOVE_MEMORY_REALLOC
+/**
+ * This function is a wrapper for the realloc function.
+ */
+void * netsnmp_realloc( void * ptr, size_t size)
+{
+ return realloc(ptr, size);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MEMORY_REALLOC */
+#ifndef NETSNMP_FEATURE_REMOVE_MEMORY_FREE
+/**
+ * This function is a wrapper for the free function.
+ * It calls free only if the calling parameter has a non-zero value.
+ */
+void netsnmp_free( void * ptr)
+{
+ if (ptr)
+ free(ptr);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_MEMORY_FREE */
+
+/**
+ * This function increase the size of the buffer pointed at by *buf, which is
+ * initially of size *buf_len. Contents are preserved **AT THE BOTTOM END OF
+ * THE BUFFER**. If memory can be (re-)allocated then it returns 1, else it
+ * returns 0.
+ *
+ * @param buf pointer to a buffer pointer
+ * @param buf_len pointer to current size of buffer in bytes
+ *
+ * @note
+ * The current re-allocation algorithm is to increase the buffer size by
+ * whichever is the greater of 256 bytes or the current buffer size, up to
+ * a maximum increase of 8192 bytes.
+ */
+int
+snmp_realloc(u_char ** buf, size_t * buf_len)
+{
+ u_char *new_buf = NULL;
+ size_t new_buf_len = 0;
+
+ if (buf == NULL) {
+ return 0;
+ }
+
+ if (*buf_len <= 255) {
+ new_buf_len = *buf_len + 256;
+ } else if (*buf_len > 255 && *buf_len <= 8191) {
+ new_buf_len = *buf_len * 2;
+ } else if (*buf_len > 8191) {
+ new_buf_len = *buf_len + 8192;
+ }
+
+ if (*buf == NULL) {
+ new_buf = (u_char *) malloc(new_buf_len);
+ } else {
+ new_buf = (u_char *) realloc(*buf, new_buf_len);
+ }
+
+ if (new_buf != NULL) {
+ *buf = new_buf;
+ *buf_len = new_buf_len;
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+int
+snmp_strcat(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc, const u_char * s)
+{
+ if (buf == NULL || buf_len == NULL || out_len == NULL) {
+ return 0;
+ }
+
+ if (s == NULL) {
+ /*
+ * Appending a NULL string always succeeds since it is a NOP.
+ */
+ return 1;
+ }
+
+ while ((*out_len + strlen((const char *) s) + 1) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ strcpy((char *) (*buf + *out_len), (const char *) s);
+ *out_len += strlen((char *) (*buf + *out_len));
+ return 1;
+}
+
+/** zeros memory before freeing it.
+ *
+ * @param *buf Pointer at bytes to free.
+ * @param size Number of bytes in buf.
+ */
+void
+free_zero(void *buf, size_t size)
+{
+ if (buf) {
+ memset(buf, 0, size);
+ free(buf);
+ }
+
+} /* end free_zero() */
+
+#ifndef NETSNMP_FEATURE_REMOVE_USM_SCAPI
+/**
+ * Returns pointer to allocaed & set buffer on success, size contains
+ * number of random bytes filled. buf is NULL and *size set to KMT
+ * error value upon failure.
+ *
+ * @param size Number of bytes to malloc() and fill with random bytes.
+ *
+ * @return a malloced buffer
+ *
+ */
+u_char *
+malloc_random(size_t * size)
+{
+ int rval = SNMPERR_SUCCESS;
+ u_char *buf = (u_char *) calloc(1, *size);
+
+ if (buf) {
+ rval = sc_random(buf, size);
+
+ if (rval < 0) {
+ free_zero(buf, *size);
+ buf = NULL;
+ } else {
+ *size = rval;
+ }
+ }
+
+ return buf;
+
+} /* end malloc_random() */
+#endif /* NETSNMP_FEATURE_REMOVE_USM_SCAPI */
+
+/** Duplicates a memory block.
+ * Copies a existing memory location from a pointer to another, newly
+ malloced, pointer.
+
+ * @param to Pointer to allocate and copy memory to.
+ * @param from Pointer to copy memory from.
+ * @param size Size of the data to be copied.
+ *
+ * @return SNMPERR_SUCCESS on success, SNMPERR_GENERR on failure.
+ */
+int
+memdup(u_char ** to, const void * from, size_t size)
+{
+ if (to == NULL)
+ return SNMPERR_GENERR;
+ if (from == NULL) {
+ *to = NULL;
+ return SNMPERR_SUCCESS;
+ }
+ if ((*to = (u_char *) malloc(size)) == NULL)
+ return SNMPERR_GENERR;
+ memcpy(*to, from, size);
+ return SNMPERR_SUCCESS;
+
+} /* end memdup() */
+
+#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_CHECK_DEFINEDNESS
+/**
+ * When running under Valgrind, check whether all bytes in the range [packet,
+ * packet+length) are defined. Let Valgrind print a backtrace if one or more
+ * bytes with uninitialized values have been found. This function can help to
+ * find the cause of undefined value errors if --track-origins=yes is not
+ * sufficient. Does nothing when not running under Valgrind.
+ *
+ * Note: this requires a fairly recent valgrind.
+ */
+void
+netsnmp_check_definedness(const void *packet, size_t length)
+{
+#if defined(__VALGRIND_MAJOR__) && defined(__VALGRIND_MINOR__) \
+ && (__VALGRIND_MAJOR__ > 3 \
+ || (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6))
+
+ if (RUNNING_ON_VALGRIND) {
+ int i;
+ char vbits;
+
+ for (i = 0; i < length; ++i) {
+ if (VALGRIND_GET_VBITS((const char *)packet + i, &vbits, 1) == 1
+ && vbits)
+ VALGRIND_PRINTF_BACKTRACE("Undefined: byte %d/%d", i,
+ (int)length);
+ }
+ }
+
+#endif
+}
+#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_CHECK_DEFINEDNESS */
+
+/** copies a (possible) unterminated string of a given length into a
+ * new buffer and null terminates it as well (new buffer MAY be one
+ * byte longer to account for this */
+char *
+netsnmp_strdup_and_null(const u_char * from, size_t from_len)
+{
+ char *ret;
+
+ if (from_len == 0 || from[from_len - 1] != '\0') {
+ ret = (char *)malloc(from_len + 1);
+ if (!ret)
+ return NULL;
+ ret[from_len] = '\0';
+ } else {
+ ret = (char *)malloc(from_len);
+ if (!ret)
+ return NULL;
+ ret[from_len - 1] = '\0';
+ }
+ memcpy(ret, from, from_len);
+ return ret;
+}
+
+/** converts binary to hexidecimal
+ *
+ * @param *input Binary data.
+ * @param len Length of binary data.
+ * @param **dest NULL terminated string equivalent in hex.
+ * @param *dest_len size of destination buffer
+ * @param allow_realloc flag indicating if buffer can be realloc'd
+ *
+ * @return olen Length of output string not including NULL terminator.
+ */
+u_int
+netsnmp_binary_to_hex(u_char ** dest, size_t *dest_len, int allow_realloc,
+ const u_char * input, size_t len)
+{
+ u_int olen = (len * 2) + 1;
+ u_char *s, *op;
+ const u_char *ip = input;
+
+ if (dest == NULL || dest_len == NULL || input == NULL)
+ return 0;
+
+ if (NULL == *dest) {
+ s = (unsigned char *) calloc(1, olen);
+ *dest_len = olen;
+ }
+ else
+ s = *dest;
+
+ if (*dest_len < olen) {
+ if (!allow_realloc)
+ return 0;
+ *dest_len = olen;
+ if (snmp_realloc(dest, dest_len))
+ return 0;
+ }
+
+ op = s;
+ while (ip - input < (int) len) {
+ *op++ = VAL2HEX((*ip >> 4) & 0xf);
+ *op++ = VAL2HEX(*ip & 0xf);
+ ip++;
+ }
+ *op = '\0';
+
+ if (s != *dest)
+ *dest = s;
+ *dest_len = olen;
+
+ return olen;
+
+} /* end netsnmp_binary_to_hex() */
+
+/** converts binary to hexidecimal
+ *
+ * @param *input Binary data.
+ * @param len Length of binary data.
+ * @param **output NULL terminated string equivalent in hex.
+ *
+ * @return olen Length of output string not including NULL terminator.
+ *
+ * FIX Is there already one of these in the UCD SNMP codebase?
+ * The old one should be used, or this one should be moved to
+ * snmplib/snmp_api.c.
+ */
+u_int
+binary_to_hex(const u_char * input, size_t len, char **output)
+{
+ size_t out_len = 0;
+
+ *output = NULL; /* will alloc new buffer */
+
+ return netsnmp_binary_to_hex((u_char**)output, &out_len, 1, input, len);
+} /* end binary_to_hex() */
+
+
+
+
+/**
+ * hex_to_binary2
+ * @param *input Printable data in base16.
+ * @param len Length in bytes of data.
+ * @param **output Binary data equivalent to input.
+ *
+ * @return SNMPERR_GENERR on failure, otherwise length of allocated string.
+ *
+ * Input of an odd length is right aligned.
+ *
+ * FIX Another version of "hex-to-binary" which takes odd length input
+ * strings. It also allocates the memory to hold the binary data.
+ * Should be integrated with the official hex_to_binary() function.
+ */
+int
+hex_to_binary2(const u_char * input, size_t len, char **output)
+{
+ u_int olen = (len / 2) + (len % 2);
+ char *s = (char *) calloc(1, (olen) ? olen : 1), *op = s;
+ const u_char *ip = input;
+
+
+ *output = NULL;
+ *op = 0;
+ if (len % 2) {
+ if (!isxdigit(*ip))
+ goto hex_to_binary2_quit;
+ *op++ = HEX2VAL(*ip);
+ ip++;
+ }
+
+ while (ip - input < (int) len) {
+ if (!isxdigit(*ip))
+ goto hex_to_binary2_quit;
+ *op = HEX2VAL(*ip) << 4;
+ ip++;
+
+ if (!isxdigit(*ip))
+ goto hex_to_binary2_quit;
+ *op++ += HEX2VAL(*ip);
+ ip++;
+ }
+
+ *output = s;
+ return olen;
+
+ hex_to_binary2_quit:
+ free_zero(s, olen);
+ return -1;
+
+} /* end hex_to_binary2() */
+
+int
+snmp_decimal_to_binary(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc, const char *decimal)
+{
+ int subid = 0;
+ const char *cp = decimal;
+
+ if (buf == NULL || buf_len == NULL || out_len == NULL
+ || decimal == NULL) {
+ return 0;
+ }
+
+ while (*cp != '\0') {
+ if (isspace((int) *cp) || *cp == '.') {
+ cp++;
+ continue;
+ }
+ if (!isdigit((int) *cp)) {
+ return 0;
+ }
+ if ((subid = atoi(cp)) > 255) {
+ return 0;
+ }
+ if ((*out_len >= *buf_len) &&
+ !(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ *(*buf + *out_len) = (u_char) subid;
+ (*out_len)++;
+ while (isdigit((int) *cp)) {
+ cp++;
+ }
+ }
+ return 1;
+}
+
+/**
+ * convert an ASCII hex string (with specified delimiters) to binary
+ *
+ * @param buf address of a pointer (pointer to pointer) for the output buffer.
+ * If allow_realloc is set, the buffer may be grown via snmp_realloc
+ * to accomodate the data.
+ *
+ * @param buf_len pointer to a size_t containing the initial size of buf.
+ *
+ * @param offset On input, a pointer to a size_t indicating an offset into buf.
+ * The binary data will be stored at this offset.
+ * On output, this pointer will have updated the offset to be
+ * the first byte after the converted data.
+ *
+ * @param allow_realloc If true, the buffer can be reallocated. If false, and
+ * the buffer is not large enough to contain the string,
+ * an error will be returned.
+ *
+ * @param hex pointer to hex string to be converted. May be prefixed by
+ * "0x" or "0X".
+ *
+ * @param delim point to a string of allowed delimiters between bytes.
+ * If not specified, any non-hex characters will be an error.
+ *
+ * @retval 1 success
+ * @retval 0 error
+ */
+int
+netsnmp_hex_to_binary(u_char ** buf, size_t * buf_len, size_t * offset,
+ int allow_realloc, const char *hex, const char *delim)
+{
+ unsigned int subid = 0;
+ const char *cp = hex;
+
+ if (buf == NULL || buf_len == NULL || offset == NULL || hex == NULL) {
+ return 0;
+ }
+
+ if ((*cp == '0') && ((*(cp + 1) == 'x') || (*(cp + 1) == 'X'))) {
+ cp += 2;
+ }
+
+ while (*cp != '\0') {
+ if (!isxdigit((int) *cp) ||
+ !isxdigit((int) *(cp+1))) {
+ if ((NULL != delim) && (NULL != strchr(delim, *cp))) {
+ cp++;
+ continue;
+ }
+ return 0;
+ }
+ if (sscanf(cp, "%2x", &subid) == 0) {
+ return 0;
+ }
+ /*
+ * if we dont' have enough space, realloc.
+ * (snmp_realloc will adjust buf_len to new size)
+ */
+ if ((*offset >= *buf_len) &&
+ !(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ *(*buf + *offset) = (u_char) subid;
+ (*offset)++;
+ if (*++cp == '\0') {
+ /*
+ * Odd number of hex digits is an error.
+ */
+ return 0;
+ } else {
+ cp++;
+ }
+ }
+ return 1;
+}
+
+/**
+ * convert an ASCII hex string to binary
+ *
+ * @note This is a wrapper which calls netsnmp_hex_to_binary with a
+ * delimiter string of " ".
+ *
+ * See netsnmp_hex_to_binary for parameter descriptions.
+ *
+ * @retval 1 success
+ * @retval 0 error
+ */
+int
+snmp_hex_to_binary(u_char ** buf, size_t * buf_len, size_t * offset,
+ int allow_realloc, const char *hex)
+{
+ return netsnmp_hex_to_binary(buf, buf_len, offset, allow_realloc, hex, " ");
+}
+
+/*******************************************************************-o-******
+ * dump_chunk
+ *
+ * Parameters:
+ * *title (May be NULL.)
+ * *buf
+ * size
+ */
+void
+dump_chunk(const char *debugtoken, const char *title, const u_char * buf,
+ int size)
+{
+ int printunit = 64; /* XXX Make global. */
+ char chunk[SNMP_MAXBUF], *s, *sp;
+
+ if (title && (*title != '\0')) {
+ DEBUGMSGTL((debugtoken, "%s\n", title));
+ }
+
+
+ memset(chunk, 0, SNMP_MAXBUF);
+ size = binary_to_hex(buf, size, &s);
+ sp = s;
+
+ while (size > 0) {
+ if (size > printunit) {
+ memcpy(chunk, sp, printunit);
+ chunk[printunit] = '\0';
+ DEBUGMSGTL((debugtoken, "\t%s\n", chunk));
+ } else {
+ DEBUGMSGTL((debugtoken, "\t%s\n", sp));
+ }
+
+ sp += printunit;
+ size -= printunit;
+ }
+
+
+ SNMP_FREE(s);
+
+} /* end dump_chunk() */
+
+
+
+
+/*******************************************************************-o-******
+ * dump_snmpEngineID
+ *
+ * Parameters:
+ * *estring
+ * *estring_len
+ *
+ * Returns:
+ * Allocated memory pointing to a string of buflen char representing
+ * a printf'able form of the snmpEngineID.
+ *
+ * -OR- NULL on error.
+ *
+ *
+ * Translates the snmpEngineID TC into a printable string. From RFC 2271,
+ * Section 5 (pp. 36-37):
+ *
+ * First bit: 0 Bit string structured by means non-SNMPv3.
+ * 1 Structure described by SNMPv3 SnmpEngineID TC.
+ *
+ * Bytes 1-4: Enterprise ID. (High bit of first byte is ignored.)
+ *
+ * Byte 5: 0 (RESERVED by IANA.)
+ * 1 IPv4 address. ( 4 octets)
+ * 2 IPv6 address. ( 16 octets)
+ * 3 MAC address. ( 6 octets)
+ * 4 Locally defined text. (0-27 octets)
+ * 5 Locally defined octets. (0-27 octets)
+ * 6-127 (RESERVED for enterprise.)
+ *
+ * Bytes 6-32: (Determined by byte 5.)
+ *
+ *
+ * Non-printable characters are given in hex. Text is given in quotes.
+ * IP and MAC addresses are given in standard (UN*X) conventions. Sections
+ * are comma separated.
+ *
+ * esp, remaining_len and s trace the state of the constructed buffer.
+ * s will be defined if there is something to return, and it will point
+ * to the end of the constructed buffer.
+ *
+ *
+ * ASSUME "Text" means printable characters.
+ *
+ * XXX Must the snmpEngineID always have a minimum length of 12?
+ * (Cf. part 2 of the TC definition.)
+ * XXX Does not enforce upper-bound of 32 bytes.
+ * XXX Need a switch to decide whether to use DNS name instead of a simple
+ * IP address.
+ *
+ * FIX Use something other than snprint_hexstring which doesn't add
+ * trailing spaces and (sometimes embedded) newlines...
+ */
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+char *
+dump_snmpEngineID(const u_char * estring, size_t * estring_len)
+{
+#define eb(b) ( *(esp+b) & 0xff )
+
+ int rval = SNMPERR_SUCCESS, gotviolation = 0, slen = 0;
+ u_int remaining_len;
+
+ char buf[SNMP_MAXBUF], *s = NULL, *t;
+ const u_char *esp = estring;
+
+ struct in_addr iaddr;
+
+
+
+ /*
+ * Sanity check.
+ */
+ if (!estring || (*estring_len <= 0)) {
+ QUITFUN(SNMPERR_GENERR, dump_snmpEngineID_quit);
+ }
+ remaining_len = *estring_len;
+ memset(buf, 0, SNMP_MAXBUF);
+
+
+
+ /*
+ * Test first bit. Return immediately with a hex string, or
+ * begin by formatting the enterprise ID.
+ */
+ if (!(*esp & 0x80)) {
+ snprint_hexstring(buf, SNMP_MAXBUF, esp, remaining_len);
+ s = strchr(buf, '\0');
+ s -= 1;
+ goto dump_snmpEngineID_quit;
+ }
+
+ s = buf;
+ s += sprintf(s, "enterprise %d, ", ((*(esp + 0) & 0x7f) << 24) |
+ ((*(esp + 1) & 0xff) << 16) |
+ ((*(esp + 2) & 0xff) << 8) | ((*(esp + 3) & 0xff)));
+ /*
+ * XXX Ick.
+ */
+
+ if (remaining_len < 5) { /* XXX Violating string. */
+ goto dump_snmpEngineID_quit;
+ }
+
+ esp += 4; /* Incremented one more in the switch below. */
+ remaining_len -= 5;
+
+
+
+ /*
+ * Act on the fifth byte.
+ */
+ switch ((int) *esp++) {
+ case 1: /* IPv4 address. */
+
+ if (remaining_len < 4)
+ goto dump_snmpEngineID_violation;
+ memcpy(&iaddr.s_addr, esp, 4);
+
+ if (!(t = inet_ntoa(iaddr)))
+ goto dump_snmpEngineID_violation;
+ s += sprintf(s, "%s", t);
+
+ esp += 4;
+ remaining_len -= 4;
+ break;
+
+ case 2: /* IPv6 address. */
+
+ if (remaining_len < 16)
+ goto dump_snmpEngineID_violation;
+
+ s += sprintf(s,
+ "%02X%02X %02X%02X %02X%02X %02X%02X::"
+ "%02X%02X %02X%02X %02X%02X %02X%02X",
+ eb(0), eb(1), eb(2), eb(3),
+ eb(4), eb(5), eb(6), eb(7),
+ eb(8), eb(9), eb(10), eb(11),
+ eb(12), eb(13), eb(14), eb(15));
+
+ esp += 16;
+ remaining_len -= 16;
+ break;
+
+ case 3: /* MAC address. */
+
+ if (remaining_len < 6)
+ goto dump_snmpEngineID_violation;
+
+ s += sprintf(s, "%02X:%02X:%02X:%02X:%02X:%02X",
+ eb(0), eb(1), eb(2), eb(3), eb(4), eb(5));
+
+ esp += 6;
+ remaining_len -= 6;
+ break;
+
+ case 4: /* Text. */
+
+ s += sprintf(s, "\"%.*s\"", (int) (sizeof(buf)-strlen(buf)-3), esp);
+ goto dump_snmpEngineID_quit;
+ break;
+
+ /*NOTREACHED*/ case 5: /* Octets. */
+
+ snprint_hexstring(s, (SNMP_MAXBUF - (s-buf)),
+ esp, remaining_len);
+ s = strchr(buf, '\0');
+ s -= 1;
+ goto dump_snmpEngineID_quit;
+ break;
+
+ /*NOTREACHED*/ dump_snmpEngineID_violation:
+ case 0: /* Violation of RESERVED,
+ * * -OR- of expected length.
+ */
+ gotviolation = 1;
+ s += sprintf(s, "!!! ");
+
+ default: /* Unknown encoding. */
+
+ if (!gotviolation) {
+ s += sprintf(s, "??? ");
+ }
+ snprint_hexstring(s, (SNMP_MAXBUF - (s-buf)),
+ esp, remaining_len);
+ s = strchr(buf, '\0');
+ s -= 1;
+
+ goto dump_snmpEngineID_quit;
+
+ } /* endswitch */
+
+
+
+ /*
+ * Cases 1-3 (IP and MAC addresses) should not have trailing
+ * octets, but perhaps they do. Throw them in too. XXX
+ */
+ if (remaining_len > 0) {
+ s += sprintf(s, " (??? ");
+
+ snprint_hexstring(s, (SNMP_MAXBUF - (s-buf)),
+ esp, remaining_len);
+ s = strchr(buf, '\0');
+ s -= 1;
+
+ s += sprintf(s, ")");
+ }
+
+
+
+ dump_snmpEngineID_quit:
+ if (s) {
+ slen = s - buf + 1;
+ s = calloc(1, slen);
+ memcpy(s, buf, (slen) - 1);
+ }
+
+ memset(buf, 0, SNMP_MAXBUF); /* XXX -- Overkill? XXX: Yes! */
+
+ return s;
+
+#undef eb
+} /* end dump_snmpEngineID() */
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+
+/**
+ * Create a new real-time marker.
+ *
+ * \deprecated Use netsnmp_set_monotonic_marker() instead.
+ *
+ * @note Caller must free time marker when no longer needed.
+ */
+marker_t
+atime_newMarker(void)
+{
+ marker_t pm = (marker_t) calloc(1, sizeof(struct timeval));
+ gettimeofday((struct timeval *) pm, NULL);
+ return pm;
+}
+
+/**
+ * Set a time marker to the current value of the real-time clock.
+ * \deprecated Use netsnmp_set_monotonic_marker() instead.
+ */
+void
+atime_setMarker(marker_t pm)
+{
+ if (!pm)
+ return;
+
+ gettimeofday((struct timeval *) pm, NULL);
+}
+
+/**
+ * Query the current value of the monotonic clock.
+ *
+ * Returns the current value of a monotonic clock if such a clock is provided by
+ * the operating system or the wall clock time if no such clock is provided by
+ * the operating system. A monotonic clock is a clock that is never adjusted
+ * backwards and that proceeds at the same rate as wall clock time.
+ *
+ * @param[out] tv Pointer to monotonic clock time.
+ */
+void netsnmp_get_monotonic_clock(struct timeval* tv)
+{
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
+ struct timespec ts;
+ int res;
+
+ res = clock_gettime(CLOCK_MONOTONIC, &ts);
+ if (res >= 0) {
+ tv->tv_sec = ts.tv_sec;
+ tv->tv_usec = ts.tv_nsec / 1000;
+ } else {
+ netsnmp_assert(FALSE);
+ memset(tv, 0, sizeof(*tv));
+ }
+#elif defined(WIN32)
+ /*
+ * Windows: return tick count. Note: the rate at which the tick count
+ * increases is not adjusted by the time synchronization algorithm, so
+ * expect an error of <= 100 ppm for the rate at which this clock
+ * increases.
+ */
+ typedef ULONGLONG (WINAPI * pfGetTickCount64)(void);
+ static int s_initialized;
+ static pfGetTickCount64 s_pfGetTickCount64;
+ uint64_t now64;
+
+ if (!s_initialized) {
+ HMODULE hKernel32 = GetModuleHandle("kernel32");
+ s_pfGetTickCount64 =
+ (pfGetTickCount64) GetProcAddress(hKernel32, "GetTickCount64");
+ s_initialized = TRUE;
+ }
+
+ if (s_pfGetTickCount64) {
+ /* Windows Vista, Windows 2008 or any later Windows version */
+ now64 = (*s_pfGetTickCount64)();
+ } else {
+ /* Windows XP, Windows 2003 or any earlier Windows version */
+ static uint32_t s_wraps, s_last;
+ uint32_t now;
+
+ now = GetTickCount();
+ if (now < s_last)
+ s_wraps++;
+ s_last = now;
+ now64 = ((uint64_t)s_wraps << 32) | now;
+ }
+ tv->tv_sec = now64 / 1000;
+ tv->tv_usec = (now64 % 1000) * 1000;
+#else
+ /* At least FreeBSD 4 doesn't provide monotonic clock support. */
+#warning Not sure how to query a monotonically increasing clock on your system. \
+Timers will not work correctly if the system clock is adjusted by e.g. ntpd.
+ gettimeofday(tv, NULL);
+#endif
+}
+
+/**
+ * Set a time marker to the current value of the monotonic clock.
+ */
+void
+netsnmp_set_monotonic_marker(marker_t *pm)
+{
+ if (!*pm)
+ *pm = malloc(sizeof(struct timeval));
+ if (*pm)
+ netsnmp_get_monotonic_clock(*pm);
+}
+
+/**
+ * Returns the difference (in msec) between the two markers
+ *
+ * \deprecated Don't use in new code.
+ */
+long
+atime_diff(const_marker_t first, const_marker_t second)
+{
+ struct timeval diff;
+
+ NETSNMP_TIMERSUB((const struct timeval *) second, (const struct timeval *) first, &diff);
+
+ return (long)(diff.tv_sec * 1000 + diff.tv_usec / 1000);
+}
+
+/**
+ * Returns the difference (in u_long msec) between the two markers
+ *
+ * \deprecated Don't use in new code.
+ */
+u_long
+uatime_diff(const_marker_t first, const_marker_t second)
+{
+ struct timeval diff;
+
+ NETSNMP_TIMERSUB((const struct timeval *) second, (const struct timeval *) first, &diff);
+
+ return (((u_long) diff.tv_sec) * 1000 + diff.tv_usec / 1000);
+}
+
+/**
+ * Returns the difference (in u_long 1/100th secs) between the two markers
+ * (functionally this is what sysUpTime needs)
+ *
+ * \deprecated Don't use in new code.
+ */
+u_long
+uatime_hdiff(const_marker_t first, const_marker_t second)
+{
+ struct timeval diff;
+
+ NETSNMP_TIMERSUB((const struct timeval *) second, (const struct timeval *) first, &diff);
+ return ((u_long) diff.tv_sec) * 100 + diff.tv_usec / 10000;
+}
+
+/**
+ * Test: Has (marked time plus delta) exceeded current time ?
+ * Returns 0 if test fails or cannot be tested (no marker).
+ *
+ * \deprecated Use netsnmp_ready_monotonic() instead.
+ */
+int
+atime_ready(const_marker_t pm, int delta_ms)
+{
+ marker_t now;
+ long diff;
+ if (!pm)
+ return 0;
+
+ now = atime_newMarker();
+
+ diff = atime_diff(pm, now);
+ free(now);
+ if (diff < delta_ms)
+ return 0;
+
+ return 1;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_UATIME_READY
+/**
+ * Test: Has (marked time plus delta) exceeded current time ?
+ * Returns 0 if test fails or cannot be tested (no marker).
+ *
+ * \deprecated Use netsnmp_ready_monotonic() instead.
+ */
+int
+uatime_ready(const_marker_t pm, unsigned int delta_ms)
+{
+ marker_t now;
+ u_long diff;
+ if (!pm)
+ return 0;
+
+ now = atime_newMarker();
+
+ diff = uatime_diff(pm, now);
+ free(now);
+ if (diff < delta_ms)
+ return 0;
+
+ return 1;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UATIME_READY */
+
+/**
+ * Is the current time past (marked time plus delta) ?
+ *
+ * @param[in] pm Pointer to marked time as obtained via
+ * netsnmp_set_monotonic_marker().
+ * @param[in] delta_ms Time delta in milliseconds.
+ *
+ * @return pm != NULL && now >= (*pm + delta_ms)
+ */
+int
+netsnmp_ready_monotonic(const_marker_t pm, int delta_ms)
+{
+ struct timeval now, diff, delta;
+
+ netsnmp_assert(delta_ms >= 0);
+ if (pm) {
+ netsnmp_get_monotonic_clock(&now);
+ NETSNMP_TIMERSUB(&now, (const struct timeval *) pm, &diff);
+ delta.tv_sec = delta_ms / 1000;
+ delta.tv_usec = (delta_ms % 1000) * 1000UL;
+ return timercmp(&diff, &delta, >=) ? TRUE : FALSE;
+ } else {
+ return FALSE;
+ }
+}
+
+
+ /*
+ * Time-related utility functions
+ */
+
+/**
+ * Return the number of timeTicks since the given marker
+ *
+ * \deprecated Don't use in new code.
+ */
+int
+marker_tticks(const_marker_t pm)
+{
+ int res;
+ marker_t now = atime_newMarker();
+
+ res = atime_diff(pm, now);
+ free(now);
+ return res / 10; /* atime_diff works in msec, not csec */
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_TIMEVAL_TTICKS
+/**
+ * \deprecated Don't use in new code.
+ */
+int
+timeval_tticks(const struct timeval *tv)
+{
+ return marker_tticks((const_marker_t) tv);
+}
+#endif /* NETSNMP_FEATURE_REMOVE_TIMEVAL_TTICKS */
+
+/**
+ * Non Windows: Returns a pointer to the desired environment variable
+ * or NULL if the environment variable does not exist.
+ *
+ * Windows: Returns a pointer to the desired environment variable
+ * if it exists. If it does not, the variable is looked up
+ * in the registry in HKCU\\Net-SNMP or HKLM\\Net-SNMP
+ * (whichever it finds first) and stores the result in the
+ * environment variable. It then returns a pointer to
+ * environment variable.
+ */
+
+char *netsnmp_getenv(const char *name)
+{
+#if !defined (WIN32) && !defined (cygwin)
+ return (getenv(name));
+#else
+ char *temp = NULL;
+ HKEY hKey;
+ unsigned char * key_value = NULL;
+ DWORD key_value_size = 0;
+ DWORD key_value_type = 0;
+ DWORD getenv_worked = 0;
+
+ DEBUGMSGTL(("read_config", "netsnmp_getenv called with name: %s\n",name));
+
+ if (!(name))
+ return NULL;
+
+ /* Try environment variable first */
+ temp = getenv(name);
+ if (temp) {
+ getenv_worked = 1;
+ DEBUGMSGTL(("read_config", "netsnmp_getenv will return from ENV: %s\n",temp));
+ }
+
+ /* Next try HKCU */
+ if (temp == NULL)
+ {
+ if (getenv("SNMP_IGNORE_WINDOWS_REGISTRY"))
+ return NULL;
+
+ if (RegOpenKeyExA(
+ HKEY_CURRENT_USER,
+ "SOFTWARE\\Net-SNMP",
+ 0,
+ KEY_QUERY_VALUE,
+ &hKey) == ERROR_SUCCESS) {
+
+ if (RegQueryValueExA(
+ hKey,
+ name,
+ NULL,
+ &key_value_type,
+ NULL, /* Just get the size */
+ &key_value_size) == ERROR_SUCCESS) {
+
+ SNMP_FREE(key_value);
+
+ /* Allocate memory needed +1 to allow RegQueryValueExA to NULL terminate the
+ * string data in registry is missing one (which is unlikely).
+ */
+ key_value = malloc((sizeof(char) * key_value_size)+sizeof(char));
+
+ if (RegQueryValueExA(
+ hKey,
+ name,
+ NULL,
+ &key_value_type,
+ key_value,
+ &key_value_size) == ERROR_SUCCESS) {
+ }
+ temp = (char *) key_value;
+ }
+ RegCloseKey(hKey);
+ if (temp)
+ DEBUGMSGTL(("read_config", "netsnmp_getenv will return from HKCU: %s\n",temp));
+ }
+ }
+
+ /* Next try HKLM */
+ if (temp == NULL)
+ {
+ if (RegOpenKeyExA(
+ HKEY_LOCAL_MACHINE,
+ "SOFTWARE\\Net-SNMP",
+ 0,
+ KEY_QUERY_VALUE,
+ &hKey) == ERROR_SUCCESS) {
+
+ if (RegQueryValueExA(
+ hKey,
+ name,
+ NULL,
+ &key_value_type,
+ NULL, /* Just get the size */
+ &key_value_size) == ERROR_SUCCESS) {
+
+ SNMP_FREE(key_value);
+
+ /* Allocate memory needed +1 to allow RegQueryValueExA to NULL terminate the
+ * string data in registry is missing one (which is unlikely).
+ */
+ key_value = malloc((sizeof(char) * key_value_size)+sizeof(char));
+
+ if (RegQueryValueExA(
+ hKey,
+ name,
+ NULL,
+ &key_value_type,
+ key_value,
+ &key_value_size) == ERROR_SUCCESS) {
+ }
+ temp = (char *) key_value;
+
+ }
+ RegCloseKey(hKey);
+ if (temp)
+ DEBUGMSGTL(("read_config", "netsnmp_getenv will return from HKLM: %s\n",temp));
+ }
+ }
+
+ if (temp && !getenv_worked) {
+ setenv(name, temp, 1);
+ SNMP_FREE(temp);
+ }
+
+ DEBUGMSGTL(("read_config", "netsnmp_getenv returning: %s\n",getenv(name)));
+
+ return(getenv(name));
+#endif
+}
+
+/**
+ * Set an environment variable.
+ *
+ * This function is only necessary on Windows for the MSVC and MinGW
+ * environments. If the process that uses the Net-SNMP DLL (e.g. a Perl
+ * interpreter) and the Net-SNMP have been built with a different compiler
+ * version then each will have a separate set of environment variables.
+ * This function allows to set an environment variable such that it gets
+ * noticed by the Net-SNMP DLL.
+ */
+int netsnmp_setenv(const char *envname, const char *envval, int overwrite)
+{
+ return setenv(envname, envval, overwrite);
+}
+
+/*
+ * swap the order of an inet addr string
+ */
+int
+netsnmp_addrstr_hton(char *ptr, size_t len)
+{
+#ifndef WORDS_BIGENDIAN
+ char tmp[8];
+
+ if (8 == len) {
+ tmp[0] = ptr[6];
+ tmp[1] = ptr[7];
+ tmp[2] = ptr[4];
+ tmp[3] = ptr[5];
+ tmp[4] = ptr[2];
+ tmp[5] = ptr[3];
+ tmp[6] = ptr[0];
+ tmp[7] = ptr[1];
+ memcpy (ptr, &tmp, 8);
+ }
+ else if (32 == len) {
+ netsnmp_addrstr_hton(ptr , 8);
+ netsnmp_addrstr_hton(ptr+8 , 8);
+ netsnmp_addrstr_hton(ptr+16, 8);
+ netsnmp_addrstr_hton(ptr+24, 8);
+ }
+ else
+ return -1;
+#endif
+
+ return 0;
+}
+
+#ifndef NETSNMP_FEATURE_REMOVE_STRING_TIME_TO_SECS
+/**
+ * Takes a time string like 4h and converts it to seconds.
+ * The string time given may end in 's' for seconds (the default
+ * anyway if no suffix is specified),
+ * 'm' for minutes, 'h' for hours, 'd' for days, or 'w' for weeks. The
+ * upper case versions are also accepted.
+ *
+ * @param time_string The time string to convert.
+ *
+ * @return seconds converted from the string
+ * @return -1 : on failure
+ */
+int
+netsnmp_string_time_to_secs(const char *time_string) {
+ int secs = -1;
+ if (!time_string || !time_string[0])
+ return secs;
+
+ secs = atoi(time_string);
+
+ if (isdigit((unsigned char)time_string[strlen(time_string)-1]))
+ return secs; /* no letter specified, it's already in seconds */
+
+ switch (time_string[strlen(time_string)-1]) {
+ case 's':
+ case 'S':
+ /* already in seconds */
+ break;
+
+ case 'm':
+ case 'M':
+ secs = secs * 60;
+ break;
+
+ case 'h':
+ case 'H':
+ secs = secs * 60 * 60;
+ break;
+
+ case 'd':
+ case 'D':
+ secs = secs * 60 * 60 * 24;
+ break;
+
+ case 'w':
+ case 'W':
+ secs = secs * 60 * 60 * 24 * 7;
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "time string %s contains an invalid suffix letter\n",
+ time_string);
+ return -1;
+ }
+
+ DEBUGMSGTL(("string_time_to_secs", "Converted time string %s to %d\n",
+ time_string, secs));
+ return secs;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_STRING_TIME_TO_SECS */
diff --git a/snmplib/transports/snmpAAL5PVCDomain.c b/snmplib/transports/snmpAAL5PVCDomain.c
new file mode 100644
index 0000000..5ac69a1
--- /dev/null
+++ b/snmplib/transports/snmpAAL5PVCDomain.c
@@ -0,0 +1,374 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/library/snmpAAL5PVCDomain.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.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
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <atm.h>
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/tools.h>
+
+
+oid netsnmp_AAL5PVCDomain[10] = { NETSNMP_ENTERPRISE_MIB, 3, 3, 3 };
+static netsnmp_tdomain aal5pvcDomain;
+
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+static char *
+netsnmp_aal5pvc_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ struct sockaddr_atmpvc *to = NULL;
+
+ if (data != NULL && len == sizeof(struct sockaddr_atmpvc)) {
+ to = (struct sockaddr_atmpvc *) data;
+ } else if (t != NULL && t->data != NULL &&
+ t->data_length == sizeof(struct sockaddr_atmpvc)) {
+ to = (struct sockaddr_atmpvc *) t->data;
+ }
+ if (to == NULL) {
+ return strdup("AAL5 PVC: unknown");
+ } else {
+ char tmp[64];
+ sprintf(tmp, "AAL5 PVC: %hd.%hd.%d", to->sap_addr.itf,
+ to->sap_addr.vpi, to->sap_addr.vci);
+ return strdup(tmp);
+ }
+}
+
+
+
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+static int
+netsnmp_aal5pvc_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+
+ if (t != NULL && t->sock >= 0) {
+ while (rc < 0) {
+ rc = recvfrom(t->sock, buf, size, 0, NULL, NULL);
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+
+ if (rc >= 0) {
+ DEBUGIF("netsnmp_aal5pvc") {
+ char *str = netsnmp_aal5pvc_fmtaddr(t, NULL, 0);
+ DEBUGMSGTL(("netsnmp_aal5pvc",
+ "recv on fd %d got %d bytes (from %s)\n", t->sock,
+ rc, str));
+ free(str);
+ }
+ } else {
+ DEBUGMSGTL(("netsnmp_aal5pvc", "recv on fd %d err %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ }
+ *opaque = NULL;
+ *olength = 0;
+ }
+ return rc;
+}
+
+
+
+static int
+netsnmp_aal5pvc_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ struct sockaddr *to = NULL;
+
+ if (opaque != NULL && *opaque != NULL &&
+ *olength == sizeof(struct sockaddr_atmpvc)) {
+ to = (struct sockaddr *) (*opaque);
+ } else if (t != NULL && t->data != NULL &&
+ t->data_length == sizeof(struct sockaddr_atmpvc)) {
+ to = (struct sockaddr *) (t->data);
+ }
+
+ if (to != NULL && t != NULL && t->sock >= 0) {
+ DEBUGIF("netsnmp_aal5pvc") {
+ char *str = netsnmp_aal5pvc_fmtaddr(NULL, (void *)to,
+ sizeof(struct sockaddr_atmpvc));
+ DEBUGMSGTL(("netsnmp_aal5pvc",
+ "send %d bytes from %p to %s on fd %d\n",
+ size, buf, str, t->sock));
+ free(str);
+ }
+ while (rc < 0) {
+ rc = sendto(t->sock, buf, size, 0, NULL, 0);
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ }
+ return rc;
+}
+
+
+
+static int
+netsnmp_aal5pvc_close(netsnmp_transport *t)
+{
+ int rc = -1;
+
+ if (t->sock >= 0) {
+ DEBUGMSGTL(("netsnmp_aal5pvc", "close fd %d\n", t->sock));
+#ifndef HAVE_CLOSESOCKET
+ rc = close(t->sock);
+#else
+ rc = closesocket(t->sock);
+#endif
+ t->sock = -1;
+ }
+ return rc;
+}
+
+
+
+/*
+ * Open an AAL5 PVC transport for SNMP. Local is TRUE if addr is the local
+ * NSAP to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote NSAP to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_aal5pvc_transport(struct sockaddr_atmpvc *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+
+#ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+ if (addr == NULL || addr->sap_family != AF_ATMPVC) {
+ return NULL;
+ }
+
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (t == NULL) {
+ return NULL;
+ }
+
+ DEBUGIF("netsnmp_aal5pvc") {
+ char *str = netsnmp_aal5pvc_fmtaddr(NULL, (void *) addr,
+ sizeof(struct sockaddr_atmpvc));
+ DEBUGMSGTL(("netsnmp_aal5pvc", "open %s %s\n",
+ local ? "local" : "remote", str));
+ free(str);
+ }
+
+ t->domain = netsnmp_AAL5PVCDomain;
+ t->domain_length =
+ sizeof(netsnmp_AAL5PVCDomain) / sizeof(netsnmp_AAL5PVCDomain[0]);
+
+ t->sock = socket(PF_ATMPVC, SOCK_DGRAM, 0);
+ if (t->sock < 0) {
+ DEBUGMSGTL(("netsnmp_aal5pvc","socket failed (%s)\n",strerror(errno)));
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ DEBUGMSGTL(("netsnmp_aal5pvc", "fd %d opened\n", t->sock));
+
+ {
+ /*
+ * Set up the QOS parameters.
+ */
+
+ struct atm_qos qos = { 0 };
+ qos.aal = ATM_AAL5;
+ qos.rxtp.traffic_class = ATM_UBR;
+ qos.rxtp.max_sdu = SNMP_MAX_LEN; /* Hmm -- this is a bit small? */
+ qos.txtp = qos.rxtp;
+
+ if (setsockopt(t->sock, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0) {
+ DEBUGMSGTL(("netsnmp_aal5pvc", "setsockopt failed (%s)\n",
+ strerror(errno)));
+ netsnmp_aal5pvc_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ }
+
+ if (local) {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ t->local = (unsigned char*)malloc(8);
+ if (t->local == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ t->local[0] = (addr->sap_addr.itf & 0xff00) >> 8;
+ t->local[1] = (addr->sap_addr.itf & 0x00ff) >> 0;
+ t->local[2] = (addr->sap_addr.vpi & 0xff00) >> 8;
+ t->local[3] = (addr->sap_addr.vpi & 0x00ff) >> 0;
+ t->local[4] = (addr->sap_addr.vci & 0xff000000) >> 24;
+ t->local[5] = (addr->sap_addr.vci & 0x00ff0000) >> 16;
+ t->local[6] = (addr->sap_addr.vci & 0x0000ff00) >> 8;
+ t->local[7] = (addr->sap_addr.vci & 0x000000ff) >> 0;
+ t->local_length = 8;
+
+ if (bind(t->sock, (struct sockaddr *) addr,
+ sizeof(struct sockaddr_atmpvc)) < 0) {
+ DEBUGMSGTL(("netsnmp_aal5pvc", "bind failed (%s)\n",
+ strerror(errno)));
+ netsnmp_aal5pvc_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ } else {
+ t->remote = (unsigned char*)malloc(8);
+ if (t->remote == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ t->remote[0] = (addr->sap_addr.itf & 0xff00) >> 8;
+ t->remote[1] = (addr->sap_addr.itf & 0x00ff) >> 0;
+ t->remote[2] = (addr->sap_addr.vpi & 0xff00) >> 8;
+ t->remote[3] = (addr->sap_addr.vpi & 0x00ff) >> 0;
+ t->remote[4] = (addr->sap_addr.vci & 0xff000000) >> 24;
+ t->remote[5] = (addr->sap_addr.vci & 0x00ff0000) >> 16;
+ t->remote[6] = (addr->sap_addr.vci & 0x0000ff00) >> 8;
+ t->remote[7] = (addr->sap_addr.vci & 0x000000ff) >> 0;
+ t->remote_length = 8;
+
+ if (connect(t->sock, (struct sockaddr *) addr,
+ sizeof(struct sockaddr_atmpvc)) < 0) {
+ DEBUGMSGTL(("netsnmp_aal5pvc", "connect failed (%s)\n",
+ strerror(errno)));
+ netsnmp_aal5pvc_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ }
+
+ t->data = malloc(sizeof(struct sockaddr_atmpvc));
+ if (t->data == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->data, addr, sizeof(struct sockaddr_atmpvc));
+ t->data_length = sizeof(struct sockaddr_atmpvc);
+
+ /*
+ * 16-bit length field in the trailer, no headers.
+ */
+
+ t->msgMaxSize = 0xffff;
+ t->f_recv = netsnmp_aal5pvc_recv;
+ t->f_send = netsnmp_aal5pvc_send;
+ t->f_close = netsnmp_aal5pvc_close;
+ t->f_accept = NULL;
+ t->f_fmtaddr = netsnmp_aal5pvc_fmtaddr;
+
+ return t;
+}
+
+
+
+netsnmp_transport *
+netsnmp_aal5pvc_create_tstring(const char *str, int local,
+ const char *default_target)
+{
+ struct sockaddr_atmpvc addr;
+
+ if (str == NULL || *str == '\0')
+ str = default_target;
+
+ if (str != NULL) {
+ addr.sap_family = AF_ATMPVC;
+
+ if (sscanf(str, "%hd.%hd.%d", &(addr.sap_addr.itf),
+ &(addr.sap_addr.vpi), &(addr.sap_addr.vci)) == 3) {
+ return netsnmp_aal5pvc_transport(&addr, local);
+ } else if (sscanf(str, "%hd.%d", &(addr.sap_addr.vpi),
+ &(addr.sap_addr.vci)) == 2) {
+ addr.sap_addr.itf = 0;
+ return netsnmp_aal5pvc_transport(&addr, local);
+ } else if (sscanf(str, "%d", &(addr.sap_addr.vci)) == 1) {
+ addr.sap_addr.itf = 0;
+ addr.sap_addr.vpi = 0;
+ return netsnmp_aal5pvc_transport(&addr, local);
+ } else {
+ return NULL;
+ }
+ } else {
+ return NULL;
+ }
+}
+
+
+
+netsnmp_transport *
+netsnmp_aal5pvc_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ struct sockaddr_atmpvc addr;
+
+ if (o_len == 8) {
+ addr.sap_family = AF_ATMPVC;
+ addr.sap_addr.itf = (o[0] << 8) + (o[1] << 0);
+ addr.sap_addr.vpi = (o[2] << 8) + (o[3] << 0);
+ addr.sap_addr.vci =
+ (o[4] << 24) + (o[5] << 16) + (o[6] << 8) + (o[7] << 0);
+ return netsnmp_aal5pvc_transport(&addr, local);
+ }
+
+ return NULL;
+}
+
+
+
+void
+netsnmp_aal5pvc_ctor(void)
+{
+ aal5pvcDomain.name = netsnmp_AAL5PVCDomain;
+ aal5pvcDomain.name_length = sizeof(netsnmp_AAL5PVCDomain) / sizeof(oid);
+ aal5pvcDomain.prefix = (const char**)calloc(3, sizeof(char *));
+ aal5pvcDomain.prefix[0] = "aal5pvc";
+ aal5pvcDomain.prefix[1] = "pvc";
+
+ aal5pvcDomain.f_create_from_tstring = NULL;
+ aal5pvcDomain.f_create_from_tstring_new = netsnmp_aal5pvc_create_tstring;
+ aal5pvcDomain.f_create_from_ostring = netsnmp_aal5pvc_create_ostring;
+
+ netsnmp_tdomain_register(&aal5pvcDomain);
+}
diff --git a/snmplib/transports/snmpAliasDomain.c b/snmplib/transports/snmpAliasDomain.c
new file mode 100644
index 0000000..eb50cad
--- /dev/null
+++ b/snmplib/transports/snmpAliasDomain.c
@@ -0,0 +1,116 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpAliasDomain.h>
+
+#include <stdio.h>
+#include <sys/types.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
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+#include <net-snmp/config_api.h>
+
+oid netsnmp_snmpALIASDomain[] = { 1,3,6,1,4,1,8072,3,3,7 };
+static netsnmp_tdomain aliasDomain;
+
+/* simple storage mechanism */
+static netsnmp_data_list *alias_memory = NULL;
+
+#ifdef HAVE_DMALLOC_H
+static void free_wrapper(void * p)
+{
+ free(p);
+}
+#else
+#define free_wrapper free
+#endif
+
+/* An alias parser */
+void
+parse_alias_config(const char *token, char *line) {
+ char aliasname[SPRINT_MAX_LEN];
+ char transportdef[SPRINT_MAX_LEN];
+ /* copy the first word (the alias) out and then assume the rest is
+ transport */
+ line = copy_nword(line, aliasname, sizeof(aliasname));
+ line = copy_nword(line, transportdef, sizeof(transportdef));
+ if (line)
+ config_perror("more data than expected");
+ netsnmp_data_list_add_node(&alias_memory,
+ netsnmp_create_data_list(aliasname,
+ strdup(transportdef),
+ &free_wrapper));
+}
+
+void
+free_alias_config(void) {
+ netsnmp_free_all_list_data(alias_memory);
+ alias_memory = NULL;
+}
+
+/*
+ * Open a ALIAS-based transport for SNMP. Local is TRUE if addr is the local
+ * address to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote address to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_alias_create_tstring(const char *str, int local,
+ const char *default_target)
+{
+ const char *aliasdata;
+
+ aliasdata = (const char*)netsnmp_get_list_data(alias_memory, str);
+ if (!aliasdata) {
+ snmp_log(LOG_ERR, "No alias found for %s\n", str);
+ return NULL;
+ }
+
+ return netsnmp_tdomain_transport(aliasdata,local,default_target);
+}
+
+
+
+netsnmp_transport *
+netsnmp_alias_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ fprintf(stderr, "make ostring\n");
+ return NULL;
+}
+
+void
+netsnmp_alias_ctor(void)
+{
+ aliasDomain.name = netsnmp_snmpALIASDomain;
+ aliasDomain.name_length = sizeof(netsnmp_snmpALIASDomain) / sizeof(oid);
+ aliasDomain.prefix = (const char **)calloc(2, sizeof(char *));
+ aliasDomain.prefix[0] = "alias";
+
+ aliasDomain.f_create_from_tstring = NULL;
+ aliasDomain.f_create_from_tstring_new = netsnmp_alias_create_tstring;
+ aliasDomain.f_create_from_ostring = netsnmp_alias_create_ostring;
+
+ netsnmp_tdomain_register(&aliasDomain);
+
+ register_config_handler("snmp", "alias", parse_alias_config,
+ free_alias_config, "NAME TRANSPORT_DEFINITION");
+}
diff --git a/snmplib/transports/snmpCallbackDomain.c b/snmplib/transports/snmpCallbackDomain.c
new file mode 100644
index 0000000..95018b8
--- /dev/null
+++ b/snmplib/transports/snmpCallbackDomain.c
@@ -0,0 +1,628 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/library/snmpCallbackDomain.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.h>
+#include <errno.h>
+
+#ifdef WIN32
+#include <net-snmp/library/winpipe.h>
+#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_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+#if HAVE_IO_H
+#include <io.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_client.h>
+
+#ifndef NETSNMP_STREAM_QUEUE_LEN
+#define NETSNMP_STREAM_QUEUE_LEN 5
+#endif
+
+#ifdef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+
+static netsnmp_transport_list *trlist = NULL;
+
+static int callback_count = 0;
+
+typedef struct callback_hack_s {
+ void *orig_transport_data;
+ netsnmp_pdu *pdu;
+} callback_hack;
+
+typedef struct callback_queue_s {
+ int callback_num;
+ netsnmp_callback_pass *item;
+ struct callback_queue_s *next, *prev;
+} callback_queue;
+
+callback_queue *thequeue;
+
+static netsnmp_transport *
+find_transport_from_callback_num(int num)
+{
+ static netsnmp_transport_list *ptr;
+ for (ptr = trlist; ptr; ptr = ptr->next)
+ if (((netsnmp_callback_info *) ptr->transport->data)->
+ callback_num == num)
+ return ptr->transport;
+ return NULL;
+}
+
+static void
+callback_debug_pdu(const char *ourstring, netsnmp_pdu *pdu)
+{
+ netsnmp_variable_list *vb;
+ int i = 1;
+ DEBUGMSGTL((ourstring,
+ "PDU: command = %d, errstat = %ld, errindex = %ld\n",
+ pdu->command, pdu->errstat, pdu->errindex));
+ for (vb = pdu->variables; vb; vb = vb->next_variable) {
+ DEBUGMSGTL((ourstring, " var %d:", i++));
+ DEBUGMSGVAR((ourstring, vb));
+ DEBUGMSG((ourstring, "\n"));
+ }
+}
+
+void
+callback_push_queue(int num, netsnmp_callback_pass *item)
+{
+ callback_queue *newitem = SNMP_MALLOC_TYPEDEF(callback_queue);
+ callback_queue *ptr;
+
+ if (newitem == NULL)
+ return;
+ newitem->callback_num = num;
+ newitem->item = item;
+ if (thequeue) {
+ for (ptr = thequeue; ptr && ptr->next; ptr = ptr->next) {
+ }
+ ptr->next = newitem;
+ newitem->prev = ptr;
+ } else {
+ thequeue = newitem;
+ }
+ DEBUGIF("dump_send_callback_transport") {
+ callback_debug_pdu("dump_send_callback_transport", item->pdu);
+ }
+}
+
+netsnmp_callback_pass *
+callback_pop_queue(int num)
+{
+ netsnmp_callback_pass *cp;
+ callback_queue *ptr;
+
+ for (ptr = thequeue; ptr; ptr = ptr->next) {
+ if (ptr->callback_num == num) {
+ if (ptr->prev) {
+ ptr->prev->next = ptr->next;
+ } else {
+ thequeue = ptr->next;
+ }
+ if (ptr->next) {
+ ptr->next->prev = ptr->prev;
+ }
+ cp = ptr->item;
+ SNMP_FREE(ptr);
+ DEBUGIF("dump_recv_callback_transport") {
+ callback_debug_pdu("dump_recv_callback_transport",
+ cp->pdu);
+ }
+ return cp;
+ }
+ }
+ return NULL;
+}
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+char *
+netsnmp_callback_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ char buf[SPRINT_MAX_LEN];
+ netsnmp_callback_info *mystuff;
+
+ if (!t)
+ return strdup("callback: unknown");
+
+ mystuff = (netsnmp_callback_info *) t->data;
+
+ if (!mystuff)
+ return strdup("callback: unknown");
+
+ snprintf(buf, SPRINT_MAX_LEN, "callback: %d on fd %d",
+ mystuff->callback_num, mystuff->pipefds[0]);
+ return strdup(buf);
+}
+
+
+
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+int
+netsnmp_callback_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ char newbuf[1];
+ netsnmp_callback_info *mystuff = (netsnmp_callback_info *) t->data;
+
+ DEBUGMSGTL(("transport_callback", "hook_recv enter\n"));
+
+ while (rc < 0) {
+#ifdef WIN32
+ rc = recvfrom(mystuff->pipefds[0], newbuf, 1, 0, NULL, 0);
+#else
+ rc = read(mystuff->pipefds[0], newbuf, 1);
+#endif
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ if (rc > 0)
+ memset(buf, 0, rc);
+
+ if (mystuff->linkedto) {
+ /*
+ * we're the client. We don't need to do anything.
+ */
+ } else {
+ /*
+ * malloc the space here, but it's filled in by
+ * snmp_callback_created_pdu() below
+ */
+ int *returnnum = (int *) calloc(1, sizeof(int));
+ *opaque = returnnum;
+ *olength = sizeof(int);
+ }
+ DEBUGMSGTL(("transport_callback", "hook_recv exit\n"));
+ return rc;
+}
+
+
+
+int
+netsnmp_callback_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int from, rc = -1;
+ netsnmp_callback_info *mystuff = (netsnmp_callback_info *) t->data;
+ netsnmp_callback_pass *cp;
+
+ /*
+ * extract the pdu from the hacked buffer
+ */
+ netsnmp_transport *other_side;
+ callback_hack *ch = (callback_hack *) * opaque;
+ netsnmp_pdu *pdu = ch->pdu;
+ *opaque = ch->orig_transport_data;
+ SNMP_FREE(ch);
+
+ DEBUGMSGTL(("transport_callback", "hook_send enter\n"));
+
+ cp = SNMP_MALLOC_TYPEDEF(netsnmp_callback_pass);
+ if (!cp)
+ return -1;
+
+ cp->pdu = snmp_clone_pdu(pdu);
+ if (cp->pdu->transport_data) {
+ /*
+ * not needed and not properly freed later
+ */
+ SNMP_FREE(cp->pdu->transport_data);
+ }
+
+ if (cp->pdu->flags & UCD_MSG_FLAG_EXPECT_RESPONSE)
+ cp->pdu->flags ^= UCD_MSG_FLAG_EXPECT_RESPONSE;
+
+ /*
+ * push the sent pdu onto the stack
+ */
+ /*
+ * AND send a bogus byte to the remote callback receiver's pipe
+ */
+ if (mystuff->linkedto) {
+ /*
+ * we're the client, send it to the parent
+ */
+ cp->return_transport_num = mystuff->callback_num;
+
+ other_side = find_transport_from_callback_num(mystuff->linkedto);
+ if (!other_side) {
+ snmp_free_pdu(cp->pdu);
+ SNMP_FREE(cp);
+ return -1;
+ }
+
+ while (rc < 0) {
+#ifdef WIN32
+ rc = sendto(((netsnmp_callback_info*) other_side->data)->pipefds[1], " ", 1, 0, NULL, 0);
+#else
+ rc = write(((netsnmp_callback_info *)other_side->data)->pipefds[1],
+ " ", 1);
+#endif
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ callback_push_queue(mystuff->linkedto, cp);
+ /*
+ * we don't need the transport data any more
+ */
+ SNMP_FREE(*opaque);
+ } else {
+ /*
+ * we're the server, send it to the person that sent us the request
+ */
+ from = **((int **) opaque);
+ /*
+ * we don't need the transport data any more
+ */
+ SNMP_FREE(*opaque);
+ other_side = find_transport_from_callback_num(from);
+ if (!other_side) {
+ snmp_free_pdu(cp->pdu);
+ SNMP_FREE(cp);
+ return -1;
+ }
+ while (rc < 0) {
+#ifdef WIN32
+ rc = sendto(((netsnmp_callback_info*) other_side->data)->pipefds[1], " ", 1, 0, NULL, 0);
+#else
+ rc = write(((netsnmp_callback_info *)other_side->data)->pipefds[1],
+ " ", 1);
+#endif
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ callback_push_queue(from, cp);
+ }
+
+ DEBUGMSGTL(("transport_callback", "hook_send exit\n"));
+ return 0;
+}
+
+
+
+int
+netsnmp_callback_close(netsnmp_transport *t)
+{
+ int rc;
+ netsnmp_callback_info *mystuff = (netsnmp_callback_info *) t->data;
+ DEBUGMSGTL(("transport_callback", "hook_close enter\n"));
+
+#ifdef WIN32
+ rc = closesocket(mystuff->pipefds[0]);
+ rc |= closesocket(mystuff->pipefds[1]);
+#else
+ rc = close(mystuff->pipefds[0]);
+ rc |= close(mystuff->pipefds[1]);
+#endif
+
+ rc |= netsnmp_transport_remove_from_list(&trlist, t);
+
+ DEBUGMSGTL(("transport_callback", "hook_close exit\n"));
+ return rc;
+}
+
+
+
+int
+netsnmp_callback_accept(netsnmp_transport *t)
+{
+ DEBUGMSGTL(("transport_callback", "hook_accept enter\n"));
+ DEBUGMSGTL(("transport_callback", "hook_accept exit\n"));
+ return -1;
+}
+
+
+
+/*
+ * Open a Callback-domain transport for SNMP. Local is TRUE if addr
+ * is the local address to bind to (i.e. this is a server-type
+ * session); otherwise addr is the remote address to send things to
+ * (and we make up a temporary name for the local end of the
+ * connection).
+ */
+
+netsnmp_transport *
+netsnmp_callback_transport(int to)
+{
+
+ netsnmp_transport *t = NULL;
+ netsnmp_callback_info *mydata;
+ int rc;
+
+ /*
+ * transport
+ */
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (!t)
+ return NULL;
+
+ /*
+ * our stuff
+ */
+ mydata = SNMP_MALLOC_TYPEDEF(netsnmp_callback_info);
+ if (!mydata) {
+ SNMP_FREE(t);
+ return NULL;
+ }
+ mydata->linkedto = to;
+ mydata->callback_num = ++callback_count;
+ mydata->data = NULL;
+ t->data = mydata;
+
+#ifdef WIN32
+ rc = create_winpipe_transport(mydata->pipefds);
+#else
+ rc = pipe(mydata->pipefds);
+#endif
+ t->sock = mydata->pipefds[0];
+
+ if (rc) {
+ SNMP_FREE(mydata);
+ SNMP_FREE(t);
+ return NULL;
+ }
+
+ t->f_recv = netsnmp_callback_recv;
+ t->f_send = netsnmp_callback_send;
+ t->f_close = netsnmp_callback_close;
+ t->f_accept = netsnmp_callback_accept;
+ t->f_fmtaddr = netsnmp_callback_fmtaddr;
+
+ netsnmp_transport_add_to_list(&trlist, t);
+
+ if (to)
+ DEBUGMSGTL(("transport_callback", "initialized %d linked to %d\n",
+ mydata->callback_num, to));
+ else
+ DEBUGMSGTL(("transport_callback",
+ "initialized master listening on %d\n",
+ mydata->callback_num));
+ return t;
+}
+
+int
+netsnmp_callback_hook_parse(netsnmp_session * sp,
+ netsnmp_pdu *pdu,
+ u_char * packetptr, size_t len)
+{
+ if (SNMP_MSG_RESPONSE == pdu->command ||
+ SNMP_MSG_REPORT == pdu->command)
+ pdu->flags |= UCD_MSG_FLAG_RESPONSE_PDU;
+ else
+ pdu->flags &= (~UCD_MSG_FLAG_RESPONSE_PDU);
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+netsnmp_callback_hook_build(netsnmp_session * sp,
+ netsnmp_pdu *pdu, u_char * ptk, size_t * len)
+{
+ /*
+ * very gross hack, as this is passed later to the transport_send
+ * function
+ */
+ callback_hack *ch = SNMP_MALLOC_TYPEDEF(callback_hack);
+ if (ch == NULL)
+ return -1;
+ DEBUGMSGTL(("transport_callback", "hook_build enter\n"));
+ ch->pdu = pdu;
+ ch->orig_transport_data = pdu->transport_data;
+ pdu->transport_data = ch;
+ switch (pdu->command) {
+ case SNMP_MSG_GETBULK:
+ if (pdu->max_repetitions < 0) {
+ sp->s_snmp_errno = SNMPERR_BAD_REPETITIONS;
+ return -1;
+ }
+ if (pdu->non_repeaters < 0) {
+ sp->s_snmp_errno = SNMPERR_BAD_REPEATERS;
+ return -1;
+ }
+ break;
+ case SNMP_MSG_RESPONSE:
+ case SNMP_MSG_TRAP:
+ case SNMP_MSG_TRAP2:
+ pdu->flags &= (~UCD_MSG_FLAG_EXPECT_RESPONSE);
+ /*
+ * Fallthrough
+ */
+ default:
+ if (pdu->errstat == SNMP_DEFAULT_ERRSTAT)
+ pdu->errstat = 0;
+ if (pdu->errindex == SNMP_DEFAULT_ERRINDEX)
+ pdu->errindex = 0;
+ break;
+ }
+
+ /*
+ * Copy missing values from session defaults
+ */
+ switch (pdu->version) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+#endif
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ if (pdu->community_len == 0) {
+ if (sp->community_len == 0) {
+ sp->s_snmp_errno = SNMPERR_BAD_COMMUNITY;
+ return -1;
+ }
+ pdu->community = (u_char *) malloc(sp->community_len);
+ if (pdu->community == NULL) {
+ sp->s_snmp_errno = SNMPERR_MALLOC;
+ return -1;
+ }
+ memmove(pdu->community,
+ sp->community, sp->community_len);
+ pdu->community_len = sp->community_len;
+ }
+ break;
+#endif
+ case SNMP_VERSION_3:
+ if (pdu->securityNameLen == 0) {
+ pdu->securityName = (char *)malloc(sp->securityNameLen);
+ if (pdu->securityName == NULL) {
+ sp->s_snmp_errno = SNMPERR_MALLOC;
+ return -1;
+ }
+ memmove(pdu->securityName,
+ sp->securityName, sp->securityNameLen);
+ pdu->securityNameLen = sp->securityNameLen;
+ }
+ if (pdu->securityModel == -1)
+ pdu->securityModel = sp->securityModel;
+ if (pdu->securityLevel == 0)
+ pdu->securityLevel = sp->securityLevel;
+ /* WHAT ELSE ?? */
+ }
+ ptk[0] = 0;
+ *len = 1;
+ DEBUGMSGTL(("transport_callback", "hook_build exit\n"));
+ return 1;
+}
+
+int
+netsnmp_callback_check_packet(u_char * pkt, size_t len)
+{
+ return 1;
+}
+
+netsnmp_pdu *
+netsnmp_callback_create_pdu(netsnmp_transport *transport,
+ void *opaque, size_t olength)
+{
+ netsnmp_pdu *pdu;
+ netsnmp_callback_pass *cp =
+ callback_pop_queue(((netsnmp_callback_info *) transport->data)->
+ callback_num);
+ if (!cp)
+ return NULL;
+ pdu = cp->pdu;
+ pdu->transport_data = opaque;
+ pdu->transport_data_length = olength;
+ if (opaque) /* if created, we're the server */
+ *((int *) opaque) = cp->return_transport_num;
+ SNMP_FREE(cp);
+ return pdu;
+}
+
+netsnmp_session *
+netsnmp_callback_open(int attach_to,
+ int (*return_func) (int op,
+ netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu,
+ void *magic),
+ int (*fpre_parse) (netsnmp_session *,
+ struct netsnmp_transport_s *,
+ void *, int),
+ int (*fpost_parse) (netsnmp_session *, netsnmp_pdu *,
+ int))
+{
+ netsnmp_session callback_sess, *callback_ss;
+ netsnmp_transport *callback_tr;
+
+ callback_tr = netsnmp_callback_transport(attach_to);
+ snmp_sess_init(&callback_sess);
+ callback_sess.callback = return_func;
+ if (attach_to) {
+ /*
+ * client
+ */
+ /*
+ * trysess.community = (u_char *) callback_ss;
+ */
+ } else {
+ callback_sess.isAuthoritative = SNMP_SESS_AUTHORITATIVE;
+ }
+ callback_sess.remote_port = 0;
+ callback_sess.retries = 0;
+ callback_sess.timeout = 30000000;
+ callback_sess.version = SNMP_DEFAULT_VERSION; /* (mostly) bogus */
+ callback_ss = snmp_add_full(&callback_sess, callback_tr,
+ fpre_parse,
+ netsnmp_callback_hook_parse, fpost_parse,
+ netsnmp_callback_hook_build,
+ NULL,
+ netsnmp_callback_check_packet,
+ netsnmp_callback_create_pdu);
+ if (callback_ss)
+ callback_ss->local_port =
+ ((netsnmp_callback_info *) callback_tr->data)->callback_num;
+ return callback_ss;
+}
+
+
+
+void
+netsnmp_clear_callback_list(void)
+{
+
+ netsnmp_transport_list *list = trlist, *next = NULL;
+ netsnmp_transport *tr = NULL;
+
+ DEBUGMSGTL(("callback_clear", "called netsnmp_callback_clear_list()\n"));
+ while (list != NULL) {
+ next = list->next;
+ tr = list->transport;
+
+ if (tr != NULL) {
+ tr->f_close(tr);
+ netsnmp_transport_remove_from_list(&trlist, tr);
+ netsnmp_transport_free(tr);
+ }
+ list = next;
+ }
+ trlist = NULL;
+
+}
+
+#endif /* NETSNMP_TRANSPORT_CALLBACK_DOMAIN */
diff --git a/snmplib/transports/snmpDTLSUDPDomain.c b/snmplib/transports/snmpDTLSUDPDomain.c
new file mode 100644
index 0000000..9c56d19
--- /dev/null
+++ b/snmplib/transports/snmpDTLSUDPDomain.c
@@ -0,0 +1,1788 @@
+/* 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 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.
+ */
+/*
+ * See the following web pages for useful documentation on this transport:
+ * http://www.net-snmp.org/wiki/index.php/TUT:Using_TLS
+ * http://www.net-snmp.org/wiki/index.php/Using_DTLS
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef HAVE_LIBSSL_DTLS
+
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_require(cert_util)
+netsnmp_feature_require(sockaddr_size)
+
+#include <net-snmp/library/snmpDTLSUDPDomain.h>
+#include <net-snmp/library/snmpUDPIPv6Domain.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.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
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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
+#if HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/system.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/callback.h>
+
+#include "openssl/bio.h"
+#include "openssl/ssl.h"
+#include "openssl/err.h"
+#include "openssl/rand.h"
+
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+#include <net-snmp/library/snmpTLSBaseDomain.h>
+#include <net-snmp/library/snmpUDPDomain.h>
+#include <net-snmp/library/cert_util.h>
+#include <net-snmp/library/snmp_openssl.h>
+
+#ifndef INADDR_NONE
+#define INADDR_NONE -1
+#endif
+
+#define WE_ARE_SERVER 0
+#define WE_ARE_CLIENT 1
+
+oid netsnmpDTLSUDPDomain[] = { TRANSPORT_DOMAIN_DTLS_UDP_IP };
+size_t netsnmpDTLSUDPDomain_len = OID_LENGTH(netsnmpDTLSUDPDomain);
+
+static netsnmp_tdomain dtlsudpDomain;
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+static int openssl_addr_index6 = 0;
+#endif
+
+/* this stores openssl credentials for each connection since openssl
+ can't do it for us at the moment; hopefully future versions will
+ change */
+typedef struct bio_cache_s {
+ BIO *read_bio; /* OpenSSL will read its incoming SSL packets from here */
+ BIO *write_bio; /* OpenSSL will write its outgoing SSL packets to here */
+ netsnmp_sockaddr_storage sas;
+ u_int flags;
+ struct bio_cache_s *next;
+ int msgnum;
+ char *write_cache;
+ size_t write_cache_len;
+ _netsnmpTLSBaseData *tlsdata;
+} bio_cache;
+
+/** bio_cache flags */
+#define NETSNMP_BIO_HAVE_COOKIE 0x0001 /* verified cookie */
+#define NETSNMP_BIO_CONNECTED 0x0002 /* recieved decoded data */
+#define NETSNMP_BIO_DISCONNECTED 0x0004 /* peer shutdown */
+
+static bio_cache *biocache = NULL;
+
+static int openssl_addr_index = 0;
+
+static int netsnmp_dtls_verify_cookie(SSL *ssl, unsigned char *cookie,
+ unsigned int cookie_len);
+static int netsnmp_dtls_gen_cookie(SSL *ssl, unsigned char *cookie,
+ unsigned int *cookie_len);
+
+/* this stores remote connections in a list to search through */
+/* XXX: optimize for searching */
+/* XXX: handle state issues for new connections to reduce DOS issues */
+/* (TLS should do this, but openssl can't do more than one ctx per sock */
+/* XXX: put a timer on the cache for expirary purposes */
+static bio_cache *find_bio_cache(netsnmp_sockaddr_storage *from_addr) {
+ bio_cache *cachep = NULL;
+
+ for(cachep = biocache; cachep; cachep = cachep->next) {
+
+ if (cachep->sas.sa.sa_family != from_addr->sa.sa_family)
+ continue;
+
+ if ((from_addr->sa.sa_family == AF_INET) &&
+ ((cachep->sas.sin.sin_addr.s_addr !=
+ from_addr->sin.sin_addr.s_addr) ||
+ (cachep->sas.sin.sin_port != from_addr->sin.sin_port)))
+ continue;
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ else if ((from_addr->sa.sa_family == AF_INET6) &&
+ ((cachep->sas.sin6.sin6_port != from_addr->sin6.sin6_port) ||
+ (cachep->sas.sin6.sin6_scope_id !=
+ from_addr->sin6.sin6_scope_id) ||
+ (memcmp(cachep->sas.sin6.sin6_addr.s6_addr,
+ from_addr->sin6.sin6_addr.s6_addr,
+ sizeof(from_addr->sin6.sin6_addr.s6_addr)) != 0)))
+ continue;
+#endif
+ /* found an existing connection */
+ break;
+ }
+ return cachep;
+}
+
+/* removes a single cache entry and returns SUCCESS on finding and
+ removing it. */
+static int remove_bio_cache(bio_cache *thiscache) {
+ bio_cache *cachep = NULL, *prevcache = NULL;
+ cachep = biocache;
+ while(cachep) {
+ if (cachep == thiscache) {
+
+ /* remove it from the list */
+ if (NULL == prevcache) {
+ /* at the first cache in the list */
+ biocache = thiscache->next;
+ } else {
+ prevcache->next = thiscache->next;
+ }
+
+ return SNMPERR_SUCCESS;
+ }
+ prevcache = cachep;
+ cachep = cachep->next;
+ }
+ return SNMPERR_GENERR;
+}
+
+/* frees the contents of a bio_cache */
+static void free_bio_cache(bio_cache *cachep) {
+/* These are freed by the SSL_free() call */
+/*
+ BIO_free(cachep->read_bio);
+ BIO_free(cachep->write_bio);
+*/
+ DEBUGMSGTL(("9:dtlsudp:bio_cache", "releasing %p\n", cachep));
+ SNMP_FREE(cachep->write_cache);
+ netsnmp_tlsbase_free_tlsdata(cachep->tlsdata);
+}
+
+static void remove_and_free_bio_cache(bio_cache *cachep) {
+ /** no debug, remove_bio_cache does it */
+ remove_bio_cache(cachep);
+ free_bio_cache(cachep);
+}
+
+
+/* XXX: lots of malloc/state cleanup needed */
+#define DIEHERE(msg) do { snmp_log(LOG_ERR, "%s\n", msg); return NULL; } while(0)
+
+static bio_cache *
+start_new_cached_connection(netsnmp_transport *t,
+ netsnmp_sockaddr_storage *remote_addr,
+ int we_are_client) {
+ bio_cache *cachep = NULL;
+ _netsnmpTLSBaseData *tlsdata;
+
+ DEBUGTRACETOK("9:dtlsudp");
+
+ /* RFC5953: section 5.3.1, step 1:
+ 1) The snmpTlstmSessionOpens counter is incremented.
+ */
+ if (we_are_client)
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENS);
+
+ if (!t->sock)
+ DIEHERE("no socket passed in to start_new_cached_connection\n");
+ if (!remote_addr)
+ DIEHERE("no remote_addr passed in to start_new_cached_connection\n");
+
+ cachep = SNMP_MALLOC_TYPEDEF(bio_cache);
+ if (!cachep)
+ return NULL;
+
+ /* allocate our TLS specific data */
+ if (NULL == (tlsdata = netsnmp_tlsbase_allocate_tlsdata(t, !we_are_client))) {
+ SNMP_FREE(cachep);
+ return NULL;
+ }
+ cachep->tlsdata = tlsdata;
+
+ /* RFC5953: section 5.3.1, step 1:
+ 2) The client selects the appropriate certificate and cipher_suites
+ for the key agreement based on the tmSecurityName and the
+ tmRequestedSecurityLevel for the session. For sessions being
+ established as a result of a SNMP-TARGET-MIB based operation, the
+ certificate will potentially have been identified via the
+ snmpTlstmParamsTable mapping and the cipher_suites will have to
+ be taken from system-wide or implementation-specific
+ configuration. If no row in the snmpTlstmParamsTable exists then
+ implementations MAY choose to establish the connection using a
+ default client certificate available to the application.
+ Otherwise, the certificate and appropriate cipher_suites will
+ need to be passed to the openSession() ASI as supplemental
+ information or configured through an implementation-dependent
+ mechanism. It is also implementation-dependent and possibly
+ policy-dependent how tmRequestedSecurityLevel will be used to
+ influence the security capabilities provided by the (D)TLS
+ connection. However this is done, the security capabilities
+ provided by (D)TLS MUST be at least as high as the level of
+ security indicated by the tmRequestedSecurityLevel parameter.
+ The actual security level of the session is reported in the
+ tmStateReference cache as tmSecurityLevel. For (D)TLS to provide
+ strong authentication, each principal acting as a command
+ generator SHOULD have its own certificate.
+ */
+ /* Implementation notes:
+ + This Information is passed in via the transport and default
+ paremeters
+ */
+ /* see if we have base configuration to copy in to this new one */
+ if (NULL != t->data && t->data_length == sizeof(_netsnmpTLSBaseData)) {
+ _netsnmpTLSBaseData *parentdata = t->data;
+ if (parentdata->our_identity)
+ tlsdata->our_identity = strdup(parentdata->our_identity);
+ if (parentdata->their_identity)
+ tlsdata->their_identity = strdup(parentdata->their_identity);
+ if (parentdata->their_fingerprint)
+ tlsdata->their_fingerprint = strdup(parentdata->their_fingerprint);
+ if (parentdata->trust_cert)
+ tlsdata->trust_cert = strdup(parentdata->trust_cert);
+ if (parentdata->their_hostname)
+ tlsdata->their_hostname = strdup(parentdata->their_hostname);
+ }
+
+ DEBUGMSGTL(("dtlsudp", "starting a new connection\n"));
+ cachep->next = biocache;
+ biocache = cachep;
+
+ if (remote_addr->sa.sa_family == AF_INET)
+ memcpy(&cachep->sas.sin, &remote_addr->sin, sizeof(remote_addr->sin));
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ else if (remote_addr->sa.sa_family == AF_INET6)
+ memcpy(&cachep->sas.sin6, &remote_addr->sin6, sizeof(remote_addr->sin6));
+#endif
+ else
+ DIEHERE("unknown address family");
+
+ /* create caching memory bios for OpenSSL to read and write to */
+
+ cachep->read_bio = BIO_new(BIO_s_mem()); /* openssl reads from */
+ if (!cachep->read_bio)
+ DIEHERE("failed to create the openssl read_bio");
+
+ cachep->write_bio = BIO_new(BIO_s_mem()); /* openssl writes to */
+ if (!cachep->write_bio) {
+ BIO_free(cachep->read_bio);
+ cachep->read_bio = NULL;
+ DIEHERE("failed to create the openssl write_bio");
+ }
+
+ BIO_set_mem_eof_return(cachep->read_bio, -1);
+ BIO_set_mem_eof_return(cachep->write_bio, -1);
+
+ if (we_are_client) {
+ /* we're the client */
+ DEBUGMSGTL(("dtlsudp",
+ "starting a new connection as a client to sock: %d\n",
+ t->sock));
+ tlsdata->ssl = SSL_new(sslctx_client_setup(DTLSv1_method(), tlsdata));
+
+ /* XXX: session setting 735 */
+ } else {
+ /* we're the server */
+ SSL_CTX *ctx = sslctx_server_setup(DTLSv1_method());
+ if (!ctx) {
+ BIO_free(cachep->read_bio);
+ BIO_free(cachep->write_bio);
+ cachep->read_bio = NULL;
+ cachep->write_bio = NULL;
+ DIEHERE("failed to create the SSL Context");
+ }
+
+ /* turn on cookie exchange */
+ /* Set DTLS cookie generation and verification callbacks */
+ SSL_CTX_set_cookie_generate_cb(ctx, netsnmp_dtls_gen_cookie);
+ SSL_CTX_set_cookie_verify_cb(ctx, netsnmp_dtls_verify_cookie);
+
+ tlsdata->ssl = SSL_new(ctx);
+ }
+
+ if (!tlsdata->ssl) {
+ BIO_free(cachep->read_bio);
+ BIO_free(cachep->write_bio);
+ cachep->read_bio = NULL;
+ cachep->write_bio = NULL;
+ DIEHERE("failed to create the SSL session structure");
+ }
+
+ SSL_set_mode(tlsdata->ssl, SSL_MODE_AUTO_RETRY);
+
+ /* set the bios that openssl should read from and write to */
+ /* (and we'll do the opposite) */
+ SSL_set_bio(tlsdata->ssl, cachep->read_bio, cachep->write_bio);
+
+ /* RFC5953: section 5.3.1, step 1:
+ 3) Using the destTransportDomain and destTransportAddress values,
+ the client will initiate the (D)TLS handshake protocol to
+ establish session keys for message integrity and encryption.
+
+ If the attempt to establish a session is unsuccessful, then
+ snmpTlstmSessionOpenErrors is incremented, an error indication is
+ returned, and processing stops. If the session failed to open
+ because the presented server certificate was unknown or invalid
+ then the snmpTlstmSessionUnknownServerCertificate or
+ snmpTlstmSessionInvalidServerCertificates MUST be incremented and
+ a snmpTlstmServerCertificateUnknown or
+ snmpTlstmServerInvalidCertificate notification SHOULD be sent as
+ appropriate. Reasons for server certificate invalidation
+ includes, but is not limited to, cryptographic validation
+ failures and an unexpected presented certificate identity.
+ */
+ /* Implementation notes:
+ + Because we're working asyncronously the real "end" point of
+ opening a connection doesn't occur here as certificate
+ verification and other things needs to happen first in the
+ verify callback, etc. See the netsnmp_dtlsudp_recv()
+ function for the final processing.
+ */
+ /* set the SSL notion of we_are_client/server */
+ if (we_are_client)
+ SSL_set_connect_state(tlsdata->ssl);
+ else {
+ /* XXX: we need to only create cache entries when cookies succeed */
+
+ SSL_set_options(tlsdata->ssl, SSL_OP_COOKIE_EXCHANGE);
+
+ SSL_set_ex_data(tlsdata->ssl, openssl_addr_index, cachep);
+
+ SSL_set_accept_state(tlsdata->ssl);
+ }
+
+ /* RFC5953: section 5.3.1, step 1:
+ 6) The TLSTM-specific session identifier (tlstmSessionID) is set in
+ the tmSessionID of the tmStateReference passed to the TLS
+ Transport Model to indicate that the session has been established
+ successfully and to point to a specific (D)TLS connection for
+ future use. The tlstmSessionID is also stored in the LCD for
+ later lookup during processing of incoming messages
+ (Section 5.1.2).
+ */
+ /* Implementation notes:
+ + our sessionID is stored as the transport's data pointer member
+ */
+ DEBUGMSGT(("9:dtlsudp:bio_cache:created", "%p\n", cachep));
+
+ return cachep;
+}
+
+static bio_cache *
+find_or_create_bio_cache(netsnmp_transport *t,
+ netsnmp_sockaddr_storage *from_addr,
+ int we_are_client) {
+ bio_cache *cachep = find_bio_cache(from_addr);
+ if (NULL == cachep) {
+ /* none found; need to start a new context */
+ cachep = start_new_cached_connection(t, from_addr, we_are_client);
+ if (NULL == cachep) {
+ snmp_log(LOG_ERR, "failed to open a new dtls connection\n");
+ }
+ } else {
+ DEBUGMSGT(("9:dtlsudp:bio_cache:found", "%p\n", cachep));
+ }
+ return cachep;
+}
+
+static netsnmp_indexed_addr_pair *
+_extract_addr_pair(netsnmp_transport *t, void *opaque, int olen)
+{
+ netsnmp_indexed_addr_pair *addr_pair = NULL;
+
+ if (opaque && olen == sizeof(netsnmp_tmStateReference)) {
+ netsnmp_tmStateReference *tmStateRef =
+ (netsnmp_tmStateReference *) opaque;
+
+ if (tmStateRef->have_addresses)
+ addr_pair = &(tmStateRef->addresses);
+ }
+ if ((NULL == addr_pair) && (NULL != t)) {
+ if (t->data != NULL &&
+ t->data_length == sizeof(netsnmp_indexed_addr_pair))
+ addr_pair = (netsnmp_indexed_addr_pair *) (t->data);
+ else if (t->data != NULL &&
+ t->data_length == sizeof(_netsnmpTLSBaseData)) {
+ _netsnmpTLSBaseData *tlsdata = (_netsnmpTLSBaseData *) t->data;
+ addr_pair = (netsnmp_indexed_addr_pair *) (tlsdata->addr);
+ }
+ }
+
+ return addr_pair;
+}
+
+static struct sockaddr *
+_find_remote_sockaddr(netsnmp_transport *t, void *opaque, int olen, int *socklen)
+{
+ netsnmp_indexed_addr_pair *addr_pair = _extract_addr_pair(t, opaque, olen);
+ struct sockaddr *sa = NULL;
+
+ if (NULL == addr_pair)
+ return NULL;
+
+ sa = &addr_pair->remote_addr.sa;
+ *socklen = netsnmp_sockaddr_size(sa);
+ return sa;
+}
+
+
+/*
+ * Reads data from our internal openssl outgoing BIO and sends any
+ * queued packets out the UDP port
+ */
+static int
+_netsnmp_send_queued_dtls_pkts(netsnmp_transport *t, bio_cache *cachep) {
+ int outsize, rc2;
+ u_char outbuf[65535];
+
+ DEBUGTRACETOK("9:dtlsudp");
+
+ /* for memory bios, we now read from openssl's write
+ buffer (ie, the packet to go out) and send it out
+ the udp port manually */
+
+ outsize = BIO_read(cachep->write_bio, outbuf, sizeof(outbuf));
+ if (outsize > 0) {
+ DEBUGMSGTL(("dtlsudp", "have %d bytes to send\n", outsize));
+
+ /* should always be true. */
+ int socksize;
+ struct sockaddr *sa;
+ sa = _find_remote_sockaddr(t, NULL, 0, &socksize);
+ if (NULL == sa)
+ sa = &cachep->sas.sa;
+ socksize = netsnmp_sockaddr_size(sa);
+ rc2 = t->base_transport->f_send(t, outbuf, outsize, (void**)&sa,
+ &socksize);
+ if (rc2 == -1) {
+ snmp_log(LOG_ERR, "failed to send a DTLS specific packet\n");
+ }
+ } else
+ DEBUGMSGTL(("9:dtlsudp", "have 0 bytes to send\n"));
+
+ return outsize;
+}
+
+/*
+ * If we have any outgoing SNMP data queued that OpenSSL/DTLS couldn't send
+ * (likely due to DTLS control packets needing to go out first)
+ * then this function attempts to send them.
+ */
+/* returns SNMPERR_SUCCESS if we succeeded in getting the data out */
+/* returns SNMPERR_GENERR if we still need more time */
+static int
+_netsnmp_bio_try_and_write_buffered(netsnmp_transport *t, bio_cache *cachep) {
+ int rc;
+ _netsnmpTLSBaseData *tlsdata;
+
+ DEBUGTRACETOK("9:dtlsudp");
+
+ tlsdata = cachep->tlsdata;
+
+ /* make sure we have something to write */
+ if (!cachep->write_cache || cachep->write_cache_len == 0)
+ return SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("dtlsudp", "Trying to write %" NETSNMP_PRIz "d of buffered data\n",
+ cachep->write_cache_len));
+
+ /* try and write out the cached data */
+ rc = SSL_write(tlsdata->ssl, cachep->write_cache, cachep->write_cache_len);
+
+ while (rc == -1) {
+ int errnum = SSL_get_error(tlsdata->ssl, rc);
+ int bytesout;
+
+ /* don't treat want_read/write errors as real errors */
+ if (errnum != SSL_ERROR_WANT_READ &&
+ errnum != SSL_ERROR_WANT_WRITE) {
+ DEBUGMSGTL(("dtlsudp", "ssl_write error (of buffered data)\n"));
+ _openssl_log_error(rc, tlsdata->ssl, "SSL_write");
+ return SNMPERR_GENERR;
+ }
+
+ /* check to see if we have outgoing DTLS packets to send */
+ /* (SSL_write could have created DTLS control packets) */
+ bytesout = _netsnmp_send_queued_dtls_pkts(t, cachep);
+
+ /* If want_read/write but failed to actually send anything
+ then we need to wait for the other side, so quit */
+ if ((errnum == SSL_ERROR_WANT_READ ||
+ errnum == SSL_ERROR_WANT_WRITE) &&
+ bytesout <= 0) {
+ /* we've failed; must need to wait longer */
+ return SNMPERR_GENERR;
+ }
+
+ /* retry writing */
+ DEBUGMSGTL(("9:dtlsudp", "recalling ssl_write\n"));
+ rc = SSL_write(tlsdata->ssl, cachep->write_cache,
+ cachep->write_cache_len);
+ }
+
+ if (rc > 0)
+ cachep->msgnum++;
+
+ if (_netsnmp_send_queued_dtls_pkts(t, cachep) > 0) {
+ SNMP_FREE(cachep->write_cache);
+ cachep->write_cache_len = 0;
+ DEBUGMSGTL(("dtlsudp", " Write was successful\n"));
+ return SNMPERR_SUCCESS;
+ }
+ DEBUGMSGTL(("dtlsudp", " failed to send over UDP socket\n"));
+ return SNMPERR_GENERR;
+}
+
+static int
+_netsnmp_add_buffered_data(bio_cache *cachep, char *buf, size_t size) {
+ if (cachep->write_cache && cachep->write_cache_len > 0) {
+ size_t newsize = cachep->write_cache_len + size;
+
+ char *newbuf = realloc(cachep->write_cache, newsize);
+ if (NULL == newbuf) {
+ /* ack! malloc failure */
+ /* XXX: free and close */
+ return SNMPERR_GENERR;
+ }
+ cachep->write_cache = newbuf;
+
+ /* write the new packet to the end */
+ memcpy(cachep->write_cache + cachep->write_cache_len,
+ buf, size);
+ cachep->write_cache_len = newsize;
+ } else {
+ if (SNMPERR_SUCCESS !=
+ memdup((u_char **) &cachep->write_cache, buf, size)) {
+ /* ack! malloc failure */
+ /* XXX: free and close */
+ return SNMPERR_GENERR;
+ }
+ cachep->write_cache_len = size;
+ }
+ return SNMPERR_SUCCESS;
+}
+
+static int
+netsnmp_dtlsudp_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ netsnmp_indexed_addr_pair *addr_pair = NULL;
+ struct sockaddr *from;
+ netsnmp_tmStateReference *tmStateRef = NULL;
+ _netsnmpTLSBaseData *tlsdata;
+ bio_cache *cachep;
+
+ DEBUGTRACETOK("9:dtlsudp");
+
+ if (NULL == t || t->sock == 0)
+ return -1;
+
+ /* create a tmStateRef cache for slow fill-in */
+ tmStateRef = SNMP_MALLOC_TYPEDEF(netsnmp_tmStateReference);
+
+ if (tmStateRef == NULL) {
+ *opaque = NULL;
+ *olength = 0;
+ return -1;
+ }
+
+ /* Set the transportDomain */
+ memcpy(tmStateRef->transportDomain,
+ netsnmpDTLSUDPDomain, sizeof(netsnmpDTLSUDPDomain[0]) *
+ netsnmpDTLSUDPDomain_len);
+ tmStateRef->transportDomainLen = netsnmpDTLSUDPDomain_len;
+
+ addr_pair = &tmStateRef->addresses;
+ tmStateRef->have_addresses = 1;
+ from = (struct sockaddr *) &(addr_pair->remote_addr);
+
+ while (rc < 0) {
+ char *opaque = NULL;
+ int olen;
+ rc = t->base_transport->f_recv(t, buf, size, (void**)&opaque, &olen);
+ if (rc > 0)
+ memcpy(from, opaque, olen);
+ SNMP_FREE(opaque);
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+
+ DEBUGMSGTL(("dtlsudp", "received %d raw bytes on way to dtls\n", rc));
+ if (rc < 0) {
+ DEBUGMSGTL(("dtlsudp", "recvfrom fd %d err %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ SNMP_FREE(tmStateRef);
+ return -1;
+ }
+
+ /* now that we have the from address filled in, we can look up
+ the openssl context and have openssl read and process
+ appropriately */
+
+ /* RFC5953: section 5.1, step 1:
+ 1) Determine the tlstmSessionID for the incoming message. The
+ tlstmSessionID MUST be a unique session identifier for this
+ (D)TLS connection. The contents and format of this identifier
+ are implementation-dependent as long as it is unique to the
+ session. A session identifier MUST NOT be reused until all
+ references to it are no longer in use. The tmSessionID is equal
+ to the tlstmSessionID discussed in Section 5.1.1. tmSessionID
+ refers to the session identifier when stored in the
+ tmStateReference and tlstmSessionID refers to the session
+ identifier when stored in the LCD. They MUST always be equal
+ when processing a given session's traffic.
+
+ If this is the first message received through this session and
+ the session does not have an assigned tlstmSessionID yet then the
+ snmpTlstmSessionAccepts counter is incremented and a
+ tlstmSessionID for the session is created. This will only happen
+ on the server side of a connection because a client would have
+ already assigned a tlstmSessionID during the openSession()
+ invocation. Implementations may have performed the procedures
+ described in Section 5.3.2 prior to this point or they may
+ perform them now, but the procedures described in Section 5.3.2
+ MUST be performed before continuing beyond this point.
+ */
+
+ /* RFC5953: section 5.1, step 2:
+ 2) Create a tmStateReference cache for the subsequent reference and
+ assign the following values within it:
+
+ tmTransportDomain = snmpTLSTCPDomain or snmpDTLSUDPDomain as
+ appropriate.
+
+ tmTransportAddress = The address the message originated from.
+
+ tmSecurityLevel = The derived tmSecurityLevel for the session,
+ as discussed in Section 3.1.2 and Section 5.3.
+
+ tmSecurityName = The derived tmSecurityName for the session as
+ discussed in Section 5.3. This value MUST be constant during
+ the lifetime of the session.
+
+ tmSessionID = The tlstmSessionID described in step 1 above.
+ */
+
+ /* if we don't have a cachep for this connection then
+ we're receiving something new and are the server
+ side */
+ cachep =
+ find_or_create_bio_cache(t, &addr_pair->remote_addr, WE_ARE_SERVER);
+ if (NULL == cachep) {
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONACCEPTS);
+ SNMP_FREE(tmStateRef);
+ return -1;
+ }
+ tlsdata = cachep->tlsdata;
+ if (NULL == tlsdata->ssl) {
+ /*
+ * this happens when the server starts but doesn't have an
+ * identity and a client connects...
+ */
+ snmp_log(LOG_ERR,
+ "DTLSUDP: missing tlsdata!\n");
+ /*snmp_increment_statistic( XXX-rks ??? );*/
+ SNMP_FREE(tmStateRef);
+ return -1;
+ }
+
+ /* Implementation notes:
+ - we use the t->data memory pointer as the session ID
+ - the transport domain is already the correct type if we got here
+ - if we don't have a session yet (eg, no tmSessionID from the
+ specs) then we create one automatically here.
+ */
+
+ /* write the received buffer to the memory-based input bio */
+ BIO_write(cachep->read_bio, buf, rc);
+
+ /* RFC5953: section 5.1, step 3:
+ 3) The incomingMessage and incomingMessageLength are assigned values
+ from the (D)TLS processing.
+ */
+ /* Implementation notes:
+ + rc = incomingMessageLength
+ + buf = IncomingMessage
+ */
+
+ /* XXX: in Wes' other example we do a SSL_pending() call
+ too to ensure we're ready to read... it's possible
+ that buffered stuff in openssl won't be caught by the
+ net-snmp select loop because it's already been pulled
+ out; need to deal with this) */
+ rc = SSL_read(tlsdata->ssl, buf, size);
+
+ /*
+ * moved netsnmp_openssl_null_checks to netsnmp_tlsbase_wrapup_recv.
+ * currently netsnmp_tlsbase_wrapup_recv is where we check for
+ * algorithm compliance, but we (sometimes) know the algorithms
+ * at this point, so we could bail earlier (here)...
+ */
+
+ while (rc == -1) {
+ int errnum = SSL_get_error(tlsdata->ssl, rc);
+ int bytesout;
+
+ /* don't treat want_read/write errors as real errors */
+ if (errnum != SSL_ERROR_WANT_READ &&
+ errnum != SSL_ERROR_WANT_WRITE) {
+ _openssl_log_error(rc, tlsdata->ssl, "SSL_read");
+ break;
+ }
+
+ /* check to see if we have outgoing DTLS packets to send */
+ /* (SSL_read could have created DTLS control packets) */
+ bytesout = _netsnmp_send_queued_dtls_pkts(t, cachep);
+
+ /* If want_read/write but failed to actually send
+ anything then we need to wait for the other side,
+ so quit */
+ if ((errnum == SSL_ERROR_WANT_READ ||
+ errnum == SSL_ERROR_WANT_WRITE) &&
+ bytesout <= 0)
+ break;
+
+ /* retry reading */
+ DEBUGMSGTL(("9:dtlsudp", "recalling ssl_read\n"));
+ rc = SSL_read(tlsdata->ssl, buf, size);
+ }
+
+ if (rc == -1) {
+ SNMP_FREE(tmStateRef);
+
+ DEBUGMSGTL(("9:dtlsudp", "no decoded data from dtls\n"));
+
+ if (SSL_get_error(tlsdata->ssl, rc) == SSL_ERROR_WANT_READ) {
+ DEBUGMSGTL(("9dtlsudp","here: want read!\n"));
+
+ /* see if we have buffered write date to send out first */
+ if (cachep->write_cache) {
+ _netsnmp_bio_try_and_write_buffered(t, cachep);
+ /* XXX: check error or not here? */
+ /* (what would we do differently?) */
+ }
+
+ rc = -1; /* XXX: it's ok, but what's the right return? */
+ }
+ else
+ _openssl_log_error(rc, tlsdata->ssl, "SSL_read");
+
+#if 0 /* to dump cache if we don't have a cookie, this is where to do it */
+ if (!(cachep->flags & NETSNMP_BIO_HAVE_COOKIE))
+ remove_and_free_bio_cache(cachep);
+#endif
+ return rc;
+ }
+
+ DEBUGMSGTL(("dtlsudp", "received %d decoded bytes from dtls\n", rc));
+
+ if ((0 == rc) && (SSL_get_shutdown(tlsdata->ssl) & SSL_RECEIVED_SHUTDOWN)) {
+ DEBUGMSGTL(("dtlsudp", "peer disconnected\n"));
+ cachep->flags |= NETSNMP_BIO_DISCONNECTED;
+ remove_and_free_bio_cache(cachep);
+ SNMP_FREE(tmStateRef);
+ return rc;
+ }
+ cachep->flags |= NETSNMP_BIO_CONNECTED;
+
+ /* Until we've locally assured ourselves that all is well in
+ certificate-verification-land we need to be prepared to stop
+ here and ensure all our required checks have been done. */
+ if (0 == (tlsdata->flags & NETSNMP_TLSBASE_CERT_FP_VERIFIED)) {
+ int verifyresult;
+
+ if (tlsdata->flags & NETSNMP_TLSBASE_IS_CLIENT) {
+
+ /* verify that the server's certificate is the correct one */
+
+ /* RFC5953: section 5.3.1, step 1:
+ 3) Using the destTransportDomain and
+ destTransportAddress values, the client will
+ initiate the (D)TLS handshake protocol to establish
+ session keys for message integrity and encryption.
+
+ If the attempt to establish a session is
+ unsuccessful, then snmpTlstmSessionOpenErrors is
+ incremented, an error indication is returned, and
+ processing stops. If the session failed to open
+ because the presented server certificate was
+ unknown or invalid then the
+ snmpTlstmSessionUnknownServerCertificate or
+ snmpTlstmSessionInvalidServerCertificates MUST be
+ incremented and a snmpTlstmServerCertificateUnknown
+ or snmpTlstmServerInvalidCertificate notification
+ SHOULD be sent as appropriate. Reasons for server
+ certificate invalidation includes, but is not
+ limited to, cryptographic validation failures and
+ an unexpected presented certificate identity.
+ */
+ /* RFC5953: section 5.3.1, step 1:
+ 4) The (D)TLS client MUST then verify that the (D)TLS
+ server's presented certificate is the expected
+ certificate. The (D)TLS client MUST NOT transmit
+ SNMP messages until the server certificate has been
+ authenticated, the client certificate has been
+ transmitted and the TLS connection has been fully
+ established.
+
+ If the connection is being established from
+ configuration based on SNMP-TARGET-MIB
+ configuration, then the snmpTlstmAddrTable
+ DESCRIPTION clause describes how the verification
+ is done (using either a certificate fingerprint, or
+ an identity authenticated via certification path
+ validation).
+
+ If the connection is being established for reasons
+ other than configuration found in the
+ SNMP-TARGET-MIB then configuration and procedures
+ outside the scope of this document should be
+ followed. Configuration mechanisms SHOULD be
+ similar in nature to those defined in the
+ snmpTlstmAddrTable to ensure consistency across
+ management configuration systems. For example, a
+ command-line tool for generating SNMP GETs might
+ support specifying either the server's certificate
+ fingerprint or the expected host name as a command
+ line argument.
+ */
+ /* RFC5953: section 5.3.1, step 1:
+ 5) (D)TLS provides assurance that the authenticated
+ identity has been signed by a trusted configured
+ certification authority. If verification of the
+ server's certificate fails in any way (for example
+ because of failures in cryptographic verification
+ or the presented identity did not match the
+ expected named entity) then the session
+ establishment MUST fail, the
+ snmpTlstmSessionInvalidServerCertificates object is
+ incremented. If the session can not be opened for
+ any reason at all, including cryptographic
+ verification failures and snmpTlstmCertToTSNTable
+ lookup failures, then the
+ snmpTlstmSessionOpenErrors counter is incremented
+ and processing stops.
+ */
+
+ /* Implementation notes:
+ + in the following function the server's certificate and
+ presented commonname or subjectAltName is checked
+ according to the rules in the snmpTlstmAddrTable.
+ */
+ if ((verifyresult = netsnmp_tlsbase_verify_server_cert(tlsdata->ssl, tlsdata))
+ != SNMPERR_SUCCESS) {
+ if (verifyresult == SNMPERR_TLS_NO_CERTIFICATE) {
+ /* assume we simply haven't received it yet and there
+ is more data to wait-for or send */
+ /* XXX: probably need to check for whether we should
+ send stuff from our end to continue the transaction
+ */
+ SNMP_FREE(tmStateRef);
+ return -1;
+ } else {
+ /* XXX: free needed memory */
+ snmp_log(LOG_ERR,
+ "DTLSUDP: failed to verify ssl certificate (of the server)\n");
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONUNKNOWNSERVERCERTIFICATE);
+ /* Step 5 says these are always incremented */
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONINVALIDSERVERCERTIFICATES);
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENERRORS);
+ SNMP_FREE(tmStateRef);
+ return -1;
+ }
+ }
+ tlsdata->flags |= NETSNMP_TLSBASE_CERT_FP_VERIFIED;
+ DEBUGMSGTL(("dtlsudp", "Verified the server's certificate\n"));
+ } else {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ /* verify that the client's certificate is the correct one */
+
+ if ((verifyresult = netsnmp_tlsbase_verify_client_cert(tlsdata->ssl, tlsdata))
+ != SNMPERR_SUCCESS) {
+ if (verifyresult == SNMPERR_TLS_NO_CERTIFICATE) {
+ /* assume we simply haven't received it yet and there
+ is more data to wait-for or send */
+ /* XXX: probably need to check for whether we should
+ send stuff from our end to continue the transaction
+ */
+ SNMP_FREE(tmStateRef);
+ return -1;
+ } else {
+ /* XXX: free needed memory */
+ snmp_log(LOG_ERR,
+ "DTLSUDP: failed to verify ssl certificate (of the client)\n");
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCLIENTCERTIFICATES);
+ SNMP_FREE(tmStateRef);
+ return -1;
+ }
+ }
+ tlsdata->flags |= NETSNMP_TLSBASE_CERT_FP_VERIFIED;
+ DEBUGMSGTL(("dtlsudp", "Verified the client's certificate\n"));
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ }
+ }
+
+ if (rc > 0)
+ cachep->msgnum++;
+
+ if (BIO_ctrl_pending(cachep->write_bio) > 0) {
+ _netsnmp_send_queued_dtls_pkts(t, cachep);
+ }
+
+ DEBUGIF ("9:dtlsudp") {
+ char *str =
+ t->base_transport->f_fmtaddr(t, addr_pair,
+ sizeof(netsnmp_indexed_addr_pair));
+ DEBUGMSGTL(("9:dtlsudp",
+ "recvfrom fd %d got %d bytes (from %s)\n",
+ t->sock, rc, str));
+ free(str);
+ }
+
+ /* see if we have buffered write date to send out first */
+ if (cachep->write_cache) {
+ if (SNMPERR_GENERR ==
+ _netsnmp_bio_try_and_write_buffered(t, cachep)) {
+ /* we still have data that can't get out in the buffer */
+ /* XXX: nothing to do here? */
+ }
+ }
+
+ if (netsnmp_tlsbase_wrapup_recv(tmStateRef, tlsdata, opaque, olength) !=
+ SNMPERR_SUCCESS)
+ return SNMPERR_GENERR;
+
+ /* RFC5953: section 5.1, step 4:
+ 4) The TLS Transport Model passes the transportDomain,
+ transportAddress, incomingMessage, and incomingMessageLength to
+ the Dispatcher using the receiveMessage ASI:
+
+ statusInformation =
+ receiveMessage(
+ IN transportDomain -- snmpTLSTCPDomain or snmpDTLSUDPDomain,
+ IN transportAddress -- address for the received message
+ IN incomingMessage -- the whole SNMP message from (D)TLS
+ IN incomingMessageLength -- the length of the SNMP message
+ IN tmStateReference -- transport info
+ )
+ */
+ /* Implementation notes: those pamateres are all passed outward
+ using the functions arguments and the return code below (the length) */
+
+ return rc;
+}
+
+
+
+static int
+netsnmp_dtlsudp_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ netsnmp_indexed_addr_pair *addr_pair = NULL;
+ bio_cache *cachep = NULL;
+ netsnmp_tmStateReference *tmStateRef = NULL;
+ u_char outbuf[65535];
+ _netsnmpTLSBaseData *tlsdata = NULL;
+ int socksize;
+ struct sockaddr *sa;
+
+ DEBUGTRACETOK("9:dtlsudp");
+ DEBUGMSGTL(("dtlsudp", "sending %d bytes\n", size));
+
+ if (NULL == t || t->sock <= 0) {
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCACHES);
+ snmp_log(LOG_ERR, "invalid netsnmp_dtlsudp_send usage\n");
+ return -1;
+ }
+
+ /* determine remote addresses */
+ addr_pair = _extract_addr_pair(t, opaque ? *opaque : NULL,
+ olength ? *olength : 0);
+ if (NULL == addr_pair) {
+ /* RFC5953: section 5.2, step 1:
+ 1) If tmStateReference does not refer to a cache containing values
+ for tmTransportDomain, tmTransportAddress, tmSecurityName,
+ tmRequestedSecurityLevel, and tmSameSecurity, then increment the
+ snmpTlstmSessionInvalidCaches counter, discard the message, and
+ return the error indication in the statusInformation. Processing
+ of this message stops.
+ */
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCACHES);
+ snmp_log(LOG_ERR, "dtlsudp_send: can't get address to send to\n");
+ return -1;
+ }
+
+ /* RFC5953: section 5.2, step 2:
+ 2) Extract the tmSessionID, tmTransportDomain, tmTransportAddress,
+ tmSecurityName, tmRequestedSecurityLevel, and tmSameSecurity
+ values from the tmStateReference. Note: The tmSessionID value
+ may be undefined if no session exists yet over which the message
+ can be sent.
+ */
+ /* Implementation notes:
+ - we use the t->data memory pointer as the session ID
+ - the transport domain is already the correct type if we got here
+ - if we don't have a session yet (eg, no tmSessionID from the
+ specs) then we create one automatically here.
+ */
+ if (opaque != NULL && *opaque != NULL &&
+ olength != NULL && *olength == sizeof(netsnmp_tmStateReference))
+ tmStateRef = (netsnmp_tmStateReference *) *opaque;
+
+
+ /* RFC5953: section 5.2, step 3:
+ 3) If tmSameSecurity is true and either tmSessionID is undefined or
+ refers to a session that is no longer open then increment the
+ snmpTlstmSessionNoSessions counter, discard the message and
+ return the error indication in the statusInformation. Processing
+ of this message stops.
+ */
+ /* RFC5953: section 5.2, step 4:
+ 4) If tmSameSecurity is false and tmSessionID refers to a session
+ that is no longer available then an implementation SHOULD open a
+ new session using the openSession() ASI (described in greater
+ detail in step 5b). Instead of opening a new session an
+ implementation MAY return a snmpTlstmSessionNoSessions error to
+ the calling module and stop processing of the message.
+ */
+ /* Implementation Notes:
+ - We would never get here if the sessionID was different. We
+ tie packets directly to the transport object and it could
+ never be sent back over a different transport, which is what
+ the above text is trying to prevent.
+ - Auto-connections are handled higher in the Net-SNMP library stack
+ */
+
+ /* RFC5953: section 5.2, step 5:
+ 5) If tmSessionID is undefined, then use tmTransportDomain,
+ tmTransportAddress, tmSecurityName and tmRequestedSecurityLevel
+ to see if there is a corresponding entry in the LCD suitable to
+ send the message over.
+
+ 5a) If there is a corresponding LCD entry, then this session
+ will be used to send the message.
+
+ 5b) If there is no corresponding LCD entry, then open a session
+ using the openSession() ASI (discussed further in
+ Section 5.3.1). Implementations MAY wish to offer message
+ buffering to prevent redundant openSession() calls for the
+ same cache entry. If an error is returned from
+ openSession(), then discard the message, discard the
+ tmStateReference, increment the snmpTlstmSessionOpenErrors,
+ return an error indication to the calling module and stop
+ processing of the message.
+ */
+
+ /* we're always a client if we're sending to something unknown yet */
+ if (NULL ==
+ (cachep = find_or_create_bio_cache(t, &addr_pair->remote_addr,
+ WE_ARE_CLIENT))) {
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENERRORS);
+ return -1;
+ }
+
+ tlsdata = cachep->tlsdata;
+ if (NULL == tlsdata || NULL == tlsdata->ssl) {
+ /** xxx mem lean? free created bio cache? */
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONNOSESSIONS);
+ snmp_log(LOG_ERR, "bad tls data or ssl ptr in netsnmp_dtlsudp_send\n");
+ return -1;
+ }
+
+ if (!tlsdata->securityName && tmStateRef &&
+ tmStateRef->securityNameLen > 0) {
+ tlsdata->securityName = strdup(tmStateRef->securityName);
+ }
+
+ /* see if we have previous outgoing data to send */
+ if (cachep->write_cache) {
+ if (SNMPERR_GENERR == _netsnmp_bio_try_and_write_buffered(t, cachep)) {
+ /* we still have data that can't get out in the buffer */
+
+ /* add the new data to the end of the existing cache */
+ if (_netsnmp_add_buffered_data(cachep, buf, size) !=
+ SNMPERR_SUCCESS) {
+ /* XXX: free and close */
+ }
+ return -1;
+ }
+ }
+
+ DEBUGIF ("9:dtlsudp") {
+ char *str = t->base_transport->f_fmtaddr(t, (void *) addr_pair,
+ sizeof(netsnmp_indexed_addr_pair));
+ DEBUGMSGTL(("9:dtlsudp", "send %d bytes from %p to %s on fd %d\n",
+ size, buf, str, t->sock));
+ free(str);
+ }
+
+ /* RFC5953: section 5.2, step 6:
+ 6) Using either the session indicated by the tmSessionID if there
+ was one or the session resulting from a previous step (4 or 5),
+ pass the outgoingMessage to (D)TLS for encapsulation and
+ transmission.
+ */
+ rc = SSL_write(tlsdata->ssl, buf, size);
+
+ while (rc == -1) {
+ int bytesout;
+ int errnum = SSL_get_error(tlsdata->ssl, rc);
+
+ /* don't treat want_read/write errors as real errors */
+ if (errnum != SSL_ERROR_WANT_READ &&
+ errnum != SSL_ERROR_WANT_WRITE) {
+ DEBUGMSGTL(("dtlsudp", "ssl_write error\n"));
+ _openssl_log_error(rc, tlsdata->ssl, "SSL_write");
+ break;
+ }
+
+ /* check to see if we have outgoing DTLS packets to send */
+ /* (SSL_read could have created DTLS control packets) */
+ bytesout = _netsnmp_send_queued_dtls_pkts(t, cachep);
+
+ /* If want_read/write but failed to actually send
+ anything then we need to wait for the other side,
+ so quit */
+ if ((errnum == SSL_ERROR_WANT_READ ||
+ errnum == SSL_ERROR_WANT_WRITE) &&
+ bytesout <= 0) {
+ /* We need more data written to or read from the socket
+ but we're failing to do so and need to wait till the
+ socket is ready again; unfortunately this means we need
+ to buffer the SNMP data temporarily in the mean time */
+
+ /* remember the packet */
+ if (_netsnmp_add_buffered_data(cachep, buf, size) !=
+ SNMPERR_SUCCESS) {
+
+ /* XXX: free and close */
+ return -1;
+ }
+
+ /* exit out of the loop until we get caled again from
+ socket data */
+ break;
+ }
+ DEBUGMSGTL(("9:dtlsudp", "recalling ssl_write\n"));
+ rc = SSL_write(tlsdata->ssl, buf, size);
+ }
+
+ if (rc > 0)
+ cachep->msgnum++;
+
+ /* for memory bios, we now read from openssl's write buffer (ie,
+ the packet to go out) and send it out the udp port manually */
+ rc = BIO_read(cachep->write_bio, outbuf, sizeof(outbuf));
+ if (rc <= 0) {
+ /* in theory an ok thing */
+ return 0;
+ }
+ socksize = netsnmp_sockaddr_size(&cachep->sas.sa);
+ sa = &cachep->sas.sa;
+ rc = t->base_transport->f_send(t, outbuf, rc, (void**)&sa, &socksize);
+
+ return rc;
+}
+
+
+
+static int
+netsnmp_dtlsudp_close(netsnmp_transport *t)
+{
+ /* XXX: issue a proper dtls closure notification(s) */
+
+ bio_cache *cachep = NULL;
+ _netsnmpTLSBaseData *tlsbase = NULL;
+
+ DEBUGTRACETOK("9:dtlsudp");
+
+ DEBUGMSGTL(("dtlsudp:close", "closing dtlsudp transport %p\n", t));
+
+ /* RFC5953: section 5.4, step 1:
+ 1) Increment either the snmpTlstmSessionClientCloses or the
+ snmpTlstmSessionServerCloses counter as appropriate.
+ */
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONCLIENTCLOSES);
+
+ /* RFC5953: section 5.4, step 2:
+ 2) Look up the session using the tmSessionID.
+ */
+ /* Implementation notes:
+ + Our session id is stored as the t->data pointer
+ */
+ if (NULL != t->data && t->data_length == sizeof(_netsnmpTLSBaseData)) {
+ tlsbase = (_netsnmpTLSBaseData *) t->data;
+
+ if (tlsbase->addr)
+ cachep = find_bio_cache(&tlsbase->addr->remote_addr);
+ }
+
+ /* RFC5953: section 5.4, step 3:
+ 3) If there is no open session associated with the tmSessionID, then
+ closeSession processing is completed.
+ */
+ if (NULL == cachep)
+ return netsnmp_socketbase_close(t);
+
+ /* if we have any remaining packtes to send, try to send them */
+ if (cachep->write_cache_len > 0) {
+ int i = 0;
+ char buf[8192];
+ int rc;
+ void *opaque = NULL;
+ int opaque_len = 0;
+ fd_set readfs;
+ struct timeval tv;
+
+ DEBUGMSGTL(("dtlsudp:close",
+ "%" NETSNMP_PRIz "d bytes remain in write_cache\n",
+ cachep->write_cache_len));
+
+ /*
+ * if negotiations have completed and we've received data, try and
+ * send any queued packets.
+ */
+ if (cachep->flags & NETSNMP_BIO_CONNECTED) {
+ /* make configurable:
+ - do this at all?
+ - retries
+ - timeout
+ */
+ for (i = 0; i < 6 && cachep->write_cache_len != 0; ++i) {
+
+ /* first see if we can send out what we have */
+ _netsnmp_bio_try_and_write_buffered(t, cachep);
+ if (cachep->write_cache_len == 0)
+ break;
+
+ /* if we've failed that, we probably need to wait for packets */
+ FD_ZERO(&readfs);
+ FD_SET(t->sock, &readfs);
+ tv.tv_sec = 0;
+ tv.tv_usec = 50000;
+ rc = select(t->sock+1, &readfs, NULL, NULL, &tv);
+ if (rc > 0) {
+ /* junk recv for catching negotations still in play */
+ opaque_len = 0;
+ netsnmp_dtlsudp_recv(t, buf, sizeof(buf),
+ &opaque, &opaque_len);
+ SNMP_FREE(opaque);
+ }
+ } /* for loop */
+ }
+
+ /** dump anything that wasn't sent */
+ if (cachep->write_cache_len > 0) {
+ DEBUGMSGTL(("dtlsudp:close",
+ "dumping %" NETSNMP_PRIz "d bytes from write_cache\n",
+ cachep->write_cache_len));
+ SNMP_FREE(cachep->write_cache);
+ cachep->write_cache_len = 0;
+ }
+ }
+
+ /* RFC5953: section 5.4, step 4:
+ 4) Have (D)TLS close the specified connection. This MUST include
+ sending a close_notify TLS Alert to inform the other side that
+ session cleanup may be performed.
+ */
+ if (NULL != cachep->tlsdata && NULL != cachep->tlsdata->ssl) {
+
+ DEBUGMSGTL(("dtlsudp:close", "closing SSL socket\n"));
+ SSL_shutdown(cachep->tlsdata->ssl);
+
+ /* send the close_notify we maybe generated in step 4 */
+ if (BIO_ctrl_pending(cachep->write_bio) > 0)
+ _netsnmp_send_queued_dtls_pkts(t, cachep);
+ }
+
+ remove_and_free_bio_cache(cachep);
+
+ return netsnmp_socketbase_close(t);
+}
+
+char *
+netsnmp_dtlsudp_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ int sa_len;
+ struct sockaddr *sa = _find_remote_sockaddr(t, data, len, &sa_len);
+ if (sa) {
+ data = sa;
+ len = sa_len;
+ }
+
+ return netsnmp_ipv4_fmtaddr("DTLSUDP", t, data, len);
+}
+
+/*
+ * Open a DTLS-based transport for SNMP. Local is TRUE if addr is the local
+ * address to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote address to send things to.
+ */
+
+static netsnmp_transport *
+_transport_common(netsnmp_transport *t, int local)
+{
+ char *tmp = NULL;
+ int tmp_len;
+
+ DEBUGTRACETOK("9:dtlsudp");
+
+ if (NULL == t)
+ return NULL;
+
+ /** save base transport for clients; need in send/recv functions later */
+ if (t->data) { /* don't copy data */
+ tmp = t->data;
+ tmp_len = t->data_length;
+ t->data = NULL;
+ }
+ t->base_transport = netsnmp_transport_copy(t);
+
+ if (tmp) {
+ t->data = tmp;
+ t->data_length = tmp_len;
+ }
+ if (NULL != t->data &&
+ t->data_length == sizeof(netsnmp_indexed_addr_pair)) {
+ _netsnmpTLSBaseData *tlsdata =
+ netsnmp_tlsbase_allocate_tlsdata(t, local);
+ tlsdata->addr = t->data;
+ t->data = tlsdata;
+ t->data_length = sizeof(_netsnmpTLSBaseData);
+ }
+
+ /*
+ * Set Domain
+ */
+ t->domain = netsnmpDTLSUDPDomain;
+ t->domain_length = netsnmpDTLSUDPDomain_len;
+
+ t->f_recv = netsnmp_dtlsudp_recv;
+ t->f_send = netsnmp_dtlsudp_send;
+ t->f_close = netsnmp_dtlsudp_close;
+ t->f_config = netsnmp_tlsbase_config;
+ t->f_setup_session = netsnmp_tlsbase_session_init;
+ t->f_accept = NULL;
+ t->f_fmtaddr = netsnmp_dtlsudp_fmtaddr;
+
+ t->flags = NETSNMP_TRANSPORT_FLAG_TUNNELED;
+
+ return t;
+}
+
+netsnmp_transport *
+netsnmp_dtlsudp_transport(struct sockaddr_in *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+
+ DEBUGTRACETOK("dtlsudp");
+
+ t = netsnmp_udp_transport(addr, local);
+ if (NULL == t)
+ return NULL;
+
+ _transport_common(t, local);
+
+ if (!local) {
+ /* dtls needs to bind the socket for SSL_write to work */
+ if (connect(t->sock, (struct sockaddr *) addr, sizeof(*addr)) == -1)
+ snmp_log(LOG_ERR, "dtls: failed to connect\n");
+ }
+
+ return t;
+}
+
+
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+
+char *
+netsnmp_dtlsudp6_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ int sa_len;
+ struct sockaddr *sa = _find_remote_sockaddr(t, data, len, &sa_len);
+ if (sa) {
+ data = sa;
+ len = sa_len;
+ }
+
+ return netsnmp_ipv6_fmtaddr("DTLSUDP6", t, data, len);
+}
+
+/*
+ * Open a DTLS-based transport for SNMP. Local is TRUE if addr is the local
+ * address to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote address to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_dtlsudp6_transport(struct sockaddr_in6 *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+
+ DEBUGTRACETOK("dtlsudp");
+
+ t = netsnmp_udp6_transport(addr, local);
+ if (NULL == t)
+ return NULL;
+
+ _transport_common(t, local);
+
+ if (!local) {
+ /* dtls needs to bind the socket for SSL_write to work */
+ if (connect(t->sock, (struct sockaddr *) addr, sizeof(*addr)) == -1)
+ snmp_log(LOG_ERR, "dtls: failed to connect\n");
+ }
+
+ /* XXX: Potentially set sock opts here (SO_SNDBUF/SO_RCV_BUF) */
+ /* XXX: and buf size */
+
+ t->f_fmtaddr = netsnmp_dtlsudp6_fmtaddr;
+
+ return t;
+}
+#endif
+
+
+netsnmp_transport *
+netsnmp_dtlsudp_create_tstring(const char *str, int isserver,
+ const char *default_target)
+{
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ struct sockaddr_in6 addr6;
+#endif
+ struct sockaddr_in addr;
+ netsnmp_transport *t;
+ _netsnmpTLSBaseData *tlsdata;
+ char buf[SPRINT_MAX_LEN], *cp;
+
+ if (netsnmp_sockaddr_in2(&addr, str, default_target))
+ t = netsnmp_dtlsudp_transport(&addr, isserver);
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ else if (netsnmp_sockaddr_in6_2(&addr6, str, default_target))
+ t = netsnmp_dtlsudp6_transport(&addr6, isserver);
+#endif
+ else
+ return NULL;
+
+
+ /* see if we can extract the remote hostname */
+ if (!isserver && t && t->data && str) {
+ tlsdata = (_netsnmpTLSBaseData *) t->data;
+ /* search for a : */
+ if (NULL != (cp = strrchr(str, ':'))) {
+ sprintf(buf, "%.*s", (int) SNMP_MIN(cp - str, sizeof(buf) - 1),
+ str);
+ } else {
+ /* else the entire spec is a host name only */
+ strlcpy(buf, str, sizeof(buf));
+ }
+ tlsdata->their_hostname = strdup(buf);
+ }
+ return t;
+}
+
+
+netsnmp_transport *
+netsnmp_dtlsudp_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ struct sockaddr_in addr;
+
+ if (o_len == 6) {
+ unsigned short porttmp = (o[4] << 8) + o[5];
+ addr.sin_family = AF_INET;
+ memcpy((u_char *) & (addr.sin_addr.s_addr), o, 4);
+ addr.sin_port = htons(porttmp);
+ return netsnmp_dtlsudp_transport(&addr, local);
+ }
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ else if (o_len == 18) {
+ struct sockaddr_in6 addr6;
+ unsigned short porttmp = (o[16] << 8) + o[17];
+ addr6.sin6_family = AF_INET6;
+ memcpy((u_char *) & (addr6.sin6_addr.s6_addr), o, 4);
+ addr6.sin6_port = htons(porttmp);
+ return netsnmp_dtlsudp6_transport(&addr6, local);
+ }
+#endif
+ return NULL;
+}
+
+void
+netsnmp_dtlsudp_ctor(void)
+{
+ char indexname[] = "_netsnmp_addr_info";
+ static const char *prefixes[] = { "dtlsudp", "dtls"
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ , "dtlsudp6", "dtls6"
+#endif
+ };
+ int i, num_prefixes = sizeof(prefixes) / sizeof(char *);
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ char indexname6[] = "_netsnmp_addr_info6";
+#endif
+
+ DEBUGMSGTL(("dtlsudp", "registering DTLS constructor\n"));
+
+ /* config settings */
+
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ if (!openssl_addr_index6)
+ openssl_addr_index6 =
+ SSL_get_ex_new_index(0, indexname6, NULL, NULL, NULL);
+#endif
+
+ dtlsudpDomain.name = netsnmpDTLSUDPDomain;
+ dtlsudpDomain.name_length = netsnmpDTLSUDPDomain_len;
+ dtlsudpDomain.prefix = (const char**)calloc(num_prefixes + 1,
+ sizeof(char *));
+ for (i = 0; i < num_prefixes; ++ i)
+ dtlsudpDomain.prefix[i] = prefixes[i];
+
+ dtlsudpDomain.f_create_from_tstring = NULL;
+ dtlsudpDomain.f_create_from_tstring_new = netsnmp_dtlsudp_create_tstring;
+ dtlsudpDomain.f_create_from_ostring = netsnmp_dtlsudp_create_ostring;
+
+ if (!openssl_addr_index)
+ openssl_addr_index =
+ SSL_get_ex_new_index(0, indexname, NULL, NULL, NULL);
+
+ netsnmp_tdomain_register(&dtlsudpDomain);
+}
+
+/*
+ * Much of the code below was taken from the OpenSSL example code
+ * and is subject to the OpenSSL copyright.
+ */
+#define NETSNMP_COOKIE_SECRET_LENGTH 16
+int cookie_initialized=0;
+unsigned char cookie_secret[NETSNMP_COOKIE_SECRET_LENGTH];
+
+typedef union {
+ struct sockaddr sa;
+ struct sockaddr_in s4;
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ struct sockaddr_in6 s6;
+#endif
+} _peer_union;
+
+int netsnmp_dtls_gen_cookie(SSL *ssl, unsigned char *cookie,
+ unsigned int *cookie_len)
+{
+ unsigned char *buffer, result[EVP_MAX_MD_SIZE];
+ unsigned int length, resultlength;
+ bio_cache *cachep = NULL;
+ _peer_union *peer;
+
+ /* Initialize a random secret */
+ if (!cookie_initialized) {
+ if (!RAND_bytes(cookie_secret, NETSNMP_COOKIE_SECRET_LENGTH)) {
+ snmp_log(LOG_ERR, "dtls: error setting random cookie secret\n");
+ return 0;
+ }
+ cookie_initialized = 1;
+ }
+
+ DEBUGMSGT(("dtlsudp:cookie", "generating cookie...\n"));
+
+ /* Read peer information */
+ cachep = SSL_get_ex_data(ssl, openssl_addr_index);
+ if (!cachep) {
+ snmp_log(LOG_ERR, "dtls: failed to get the peer address\n");
+ return 0;
+ }
+ peer = (_peer_union *)&cachep->sas;
+
+ /* Create buffer with peer's address and port */
+ length = 0;
+ switch (peer->sa.sa_family) {
+ case AF_INET:
+ length += sizeof(struct in_addr);
+ length += sizeof(peer->s4.sin_port);
+ break;
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ case AF_INET6:
+ length += sizeof(struct in6_addr);
+ length += sizeof(peer->s6.sin6_port);
+ break;
+#endif
+ default:
+ snmp_log(LOG_ERR, "dtls generating cookie: unknown family: %d\n",
+ peer->sa.sa_family);
+ return 0;
+ }
+ buffer = malloc(length);
+ if (buffer == NULL) {
+ snmp_log(LOG_ERR,"dtls: out of memory\n");
+ return 0;
+ }
+
+ switch (peer->sa.sa_family) {
+ case AF_INET:
+ memcpy(buffer,
+ &peer->s4.sin_port,
+ sizeof(peer->s4.sin_port));
+ memcpy(buffer + sizeof(peer->s4.sin_port),
+ &peer->s4.sin_addr,
+ sizeof(struct in_addr));
+ break;
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ case AF_INET6:
+ memcpy(buffer,
+ &peer->s6.sin6_port,
+ sizeof(peer->s6.sin6_port));
+ memcpy(buffer + sizeof(peer->s6.sin6_port),
+ &peer->s6.sin6_addr,
+ sizeof(struct in6_addr));
+ break;
+#endif
+ default:
+ snmp_log(LOG_ERR, "dtls: unknown address family generating a cookie\n");
+ return 0;
+ }
+
+ /* Calculate HMAC of buffer using the secret */
+ HMAC(EVP_sha1(), cookie_secret, NETSNMP_COOKIE_SECRET_LENGTH,
+ buffer, length, result, &resultlength);
+ OPENSSL_free(buffer);
+
+ memcpy(cookie, result, resultlength);
+ *cookie_len = resultlength;
+
+ DEBUGMSGT(("9:dtlsudp:cookie", "generated %d byte cookie\n", *cookie_len));
+
+ return 1;
+}
+
+int netsnmp_dtls_verify_cookie(SSL *ssl, unsigned char *cookie,
+ unsigned int cookie_len)
+{
+ unsigned char *buffer, result[EVP_MAX_MD_SIZE];
+ unsigned int length, resultlength, rc;
+ bio_cache *cachep = NULL;
+ _peer_union *peer;
+
+ /* If secret isn't initialized yet, the cookie can't be valid */
+ if (!cookie_initialized)
+ return 0;
+
+ DEBUGMSGT(("9:dtlsudp:cookie", "verifying %d byte cookie\n", cookie_len));
+
+ cachep = SSL_get_ex_data(ssl, openssl_addr_index);
+ if (!cachep) {
+ snmp_log(LOG_ERR, "dtls: failed to get the peer address\n");
+ return 0;
+ }
+ peer = (_peer_union *)&cachep->sas;
+
+ /* Create buffer with peer's address and port */
+ length = 0;
+ switch (peer->sa.sa_family) {
+ case AF_INET:
+ length += sizeof(struct in_addr);
+ length += sizeof(peer->s4.sin_port);
+ break;
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ case AF_INET6:
+ length += sizeof(struct in6_addr);
+ length += sizeof(peer->s6.sin6_port);
+ break;
+#endif
+ default:
+ snmp_log(LOG_ERR,
+ "dtls: unknown address family %d generating a cookie\n",
+ peer->sa.sa_family);
+ return 0;
+ }
+ buffer = malloc(length);
+ if (buffer == NULL) {
+ snmp_log(LOG_ERR, "dtls: unknown address family generating a cookie\n");
+ return 0;
+ }
+
+ switch (peer->sa.sa_family) {
+ case AF_INET:
+ memcpy(buffer,
+ &peer->s4.sin_port,
+ sizeof(peer->s4.sin_port));
+ memcpy(buffer + sizeof(peer->s4.sin_port),
+ &peer->s4.sin_addr,
+ sizeof(struct in_addr));
+ break;
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ case AF_INET6:
+ memcpy(buffer,
+ &peer->s6.sin6_port,
+ sizeof(peer->s6.sin6_port));
+ memcpy(buffer + sizeof(peer->s6.sin6_port),
+ &peer->s6.sin6_addr,
+ sizeof(struct in6_addr));
+ break;
+#endif
+ default:
+ snmp_log(LOG_ERR,
+ "dtls: unknown address family %d generating a cookie\n",
+ peer->sa.sa_family);
+ return 0;
+ }
+
+ /* Calculate HMAC of buffer using the secret */
+ HMAC(EVP_sha1(), cookie_secret, NETSNMP_COOKIE_SECRET_LENGTH,
+ buffer, length, result, &resultlength);
+ OPENSSL_free(buffer);
+
+ if (cookie_len != resultlength || memcmp(result, cookie, resultlength) != 0)
+ rc = 0;
+ else {
+ rc = 1;
+ cachep->flags |= NETSNMP_BIO_HAVE_COOKIE;
+ }
+
+ DEBUGMSGT(("dtlsudp:cookie", "verify cookie: %d\n", rc));
+
+ return rc;
+}
+
+#endif /* HAVE_LIBSSL_DTLS */
diff --git a/snmplib/transports/snmpIPXDomain.c b/snmplib/transports/snmpIPXDomain.c
new file mode 100644
index 0000000..24c13a4
--- /dev/null
+++ b/snmplib/transports/snmpIPXDomain.c
@@ -0,0 +1,467 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/library/snmpIPXDomain.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.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
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/tools.h>
+
+#define SNMP_IPX_DEFAULT_PORT 36879 /* Specified in RFC 1420. */
+static netsnmp_tdomain ipxDomain;
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+static char *
+netsnmp_ipx_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ struct sockaddr_ipx *to = NULL;
+
+ if (data != NULL && len == sizeof(struct sockaddr_ipx)) {
+ to = (struct sockaddr_ipx *) data;
+ } else if (t != NULL && t->data != NULL) {
+ to = (struct sockaddr_ipx *) t->data;
+ }
+ if (to == NULL) {
+ return strdup("IPX: unknown");
+ } else {
+ char tmp[64];
+ sprintf(tmp, "IPX: %08X:%02X%02X%02X%02X%02X%02X/%hu",
+ ntohl(to->sipx_network), to->sipx_node[0],
+ to->sipx_node[1], to->sipx_node[2], to->sipx_node[3],
+ to->sipx_node[4], to->sipx_node[5], ntohs(to->sipx_port));
+ return strdup(tmp);
+ }
+}
+
+
+
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+static int
+netsnmp_ipx_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ socklen_t fromlen = sizeof(struct sockaddr);
+ struct sockaddr *from;
+
+ if (t != NULL && t->sock >= 0) {
+ from = (struct sockaddr *)malloc(sizeof(struct sockaddr_ipx));
+ if (from == NULL) {
+ *opaque = NULL;
+ *olength = 0;
+ return -1;
+ } else {
+ memset(from, 0, fromlen);
+ }
+
+ while (rc < 0) {
+ rc = recvfrom(t->sock, buf, size, 0, from, &fromlen);
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+
+ if (rc >= 0) {
+ DEBUGIF("netsnmp_ipx") {
+ char *str = netsnmp_ipx_fmtaddr(NULL, from, fromlen);
+ DEBUGMSGTL(("netsnmp_ipx",
+ "recvfrom fd %d got %d bytes(from %s)\n",
+ t->sock, rc, str));
+ free(str);
+ }
+ } else {
+ DEBUGMSGTL(("netsnmp_ipx", "recvfrom fd %d err %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ }
+ *opaque = (void *) from;
+ *olength = sizeof(struct sockaddr_ipx);
+ }
+ return rc;
+}
+
+
+
+static int
+netsnmp_ipx_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ struct sockaddr *to = NULL;
+
+ if (opaque != NULL && *opaque != NULL &&
+ *olength == sizeof(struct sockaddr_ipx)) {
+ to = (struct sockaddr *) (*opaque);
+ } else if (t != NULL && t->data != NULL &&
+ t->data_length == sizeof(struct sockaddr_ipx)) {
+ to = (struct sockaddr *) (t->data);
+ }
+
+ if (to != NULL && t != NULL && t->sock >= 0) {
+ DEBUGIF("netsnmp_ipx") {
+ char *str = netsnmp_ipx_fmtaddr(NULL, (void *)to,
+ sizeof(struct sockaddr_ipx));
+ DEBUGMSGTL(("netsnmp_ipx", "send %d bytes from %p to %s on fd %d\n",
+ size, buf, str, t->sock));
+ free(str);
+ }
+ while (rc < 0) {
+ rc = sendto(t->sock, buf, size, 0, to, sizeof(struct sockaddr));
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ }
+ return rc;
+}
+
+
+
+static int
+netsnmp_ipx_close(netsnmp_transport *t)
+{
+ int rc = -1;
+ if (t->sock >= 0) {
+#ifndef HAVE_CLOSESOCKET
+ rc = close(t->sock);
+#else
+ rc = closesocket(t->sock);
+#endif
+ t->sock = -1;
+ }
+ return rc;
+}
+
+
+
+/*
+ * Open a IPX-based transport for SNMP. Local is TRUE if addr is the local
+ * address to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote address to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_ipx_transport(struct sockaddr_ipx *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+ int rc = 0;
+
+#ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+ if (addr == NULL || addr->sipx_family != AF_IPX) {
+ return NULL;
+ }
+
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (t == NULL) {
+ return NULL;
+ }
+
+ DEBUGIF("netsnmp_ipx") {
+ char *str = netsnmp_ipx_fmtaddr(NULL, (void *)addr,
+ sizeof(struct sockaddr_ipx));
+ DEBUGMSGTL(("netsnmp_ipx", "open %s %s\n", local ? "local" : "remote",
+ str));
+ free(str);
+ }
+
+ t->domain = netsnmpIPXDomain;
+ t->domain_length = netsnmpIPXDomain_len;
+
+ t->sock = socket(AF_IPX, SOCK_DGRAM, AF_IPX);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ if (local) {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ t->local = (unsigned char*)malloc(12);
+ if (t->local == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(&(t->local[00]), (u_char *) & (addr->sipx_network), 4);
+ memcpy(&(t->local[04]), (u_char *) & (addr->sipx_node), 6);
+ memcpy(&(t->local[10]), (u_char *) & (addr->sipx_port), 2);
+ t->local_length = 12;
+
+ /*
+ * This session is inteneded as a server, so we must bind on to the
+ * given address (which may include a particular network and/or node
+ * address, but definitely includes a port number).
+ */
+
+ rc = bind(t->sock, (struct sockaddr *) addr,
+ sizeof(struct sockaddr));
+ if (rc != 0) {
+ netsnmp_ipx_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ t->data = NULL;
+ t->data_length = 0;
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ } else {
+ t->remote = (unsigned char*)malloc(12);
+ if (t->remote == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(&(t->remote[00]), (u_char *) & (addr->sipx_network), 4);
+ memcpy(&(t->remote[04]), (u_char *) & (addr->sipx_node), 6);
+ memcpy(&(t->remote[10]), (u_char *) & (addr->sipx_port), 2);
+ t->remote_length = 12;
+
+ /*
+ * This is a client session. Save the address in the
+ * transport-specific data pointer for later use by snmp_ipx_send.
+ */
+
+ t->data = malloc(sizeof(struct sockaddr_ipx));
+ if (t->data == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->data, addr, sizeof(struct sockaddr_ipx));
+ t->data_length = sizeof(struct sockaddr_ipx);
+ }
+
+ /*
+ * Maximum size of an IPX PDU is 576 bytes including a 30-byte header.
+ * Ridiculous!
+ */
+
+ t->msgMaxSize = 576 - 30;
+ t->f_recv = netsnmp_ipx_recv;
+ t->f_send = netsnmp_ipx_send;
+ t->f_close = netsnmp_ipx_close;
+ t->f_accept = NULL;
+ t->f_fmtaddr = netsnmp_ipx_fmtaddr;
+
+ return t;
+}
+
+
+
+/*
+ * Attempt to parse a string of the form [%08x]:%12x[/%d] where the parts
+ * are the network number, the node address and the port in that order.
+ */
+
+int
+netsnmp_sockaddr_ipx2(struct sockaddr_ipx *addr, const char *peername,
+ const char *default_target)
+{
+ char *input = NULL, *def = NULL;
+ const char *network, *node, *port;
+ char *tmp;
+ unsigned long i;
+
+ if (addr == NULL) {
+ return 0;
+ }
+ memset(addr, 0, sizeof(struct sockaddr_ipx));
+
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx",
+ "addr %p, peername \"%s\" default_target \"%s\"\n",
+ addr, peername ? peername : "[NIL]",
+ default_target ? default_target : "[NIL]"));
+
+ addr->sipx_family = AF_IPX;
+ addr->sipx_type = 4; /* Specified in RFC 1420. */
+
+ network = input = strdup(peername ? peername : "");
+ tmp = strchr(input, ':');
+ if (tmp != NULL) {
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx", "Node identified\n"));
+ *tmp++ = '\0';
+ node = tmp;
+ tmp = strchr(tmp, '/');
+ } else {
+ node = NULL;
+ tmp = strchr(input, '/');
+ }
+ if (tmp != NULL) {
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx", "Port identified\n"));
+ *tmp++ = '\0';
+ port = tmp;
+ } else
+ port = NULL;
+
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx", "Address: %s:%s/%s\n",
+ network ? network : "[NIL]", node ? node : "[NIL]",
+ port ? port : "[NIL]"));
+
+ def = strdup(default_target ? default_target : "");
+ if (network == NULL || *network == '\0')
+ network = def;
+ tmp = strchr(def, ':');
+ if (tmp != NULL) {
+ *tmp++ = '\0';
+ if (node == NULL || *node == '\0')
+ node = tmp;
+ tmp = strchr(tmp, '/');
+ } else
+ tmp = strchr(def, '/');
+ if (tmp != NULL) {
+ *tmp++ = '\0';
+ if (port == NULL || *port == '\0')
+ port = tmp;
+ }
+
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx", "Address: %s:%s/%s\n",
+ network ? network : "[NIL]", node ? node : "[NIL]",
+ port ? port : "[NIL]"));
+
+ if (network == NULL || *network == '\0')
+ network = "0";
+
+ if (node == NULL || *node == '\0')
+ node = "000000000000";
+
+ if (port == NULL || *port == '\0')
+ port = __STRING(SNMP_IPX_DEFAULT_PORT);
+
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx", "Address: %s:%s/%s\n",
+ network ? network : "[NIL]", node ? node : "[NIL]",
+ port ? port : "[NIL]"));
+
+ if(sscanf(network, "%8lx%*c", &i) == 1) {
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx", "network parsed okay\n"));
+ addr->sipx_network = htonl(i);
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx",
+ "failed to parse network part of address\n"));
+ free(def);
+ free(input);
+ return 0;
+ }
+
+ if(sscanf(node, "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%*c",
+ &addr->sipx_node[0], &addr->sipx_node[1],
+ &addr->sipx_node[2], &addr->sipx_node[3],
+ &addr->sipx_node[4], &addr->sipx_node[5]) == 6) {
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx", "node parsed okay\n"));
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx",
+ "failed to parse node part of address\n"));
+ free(def);
+ free(input);
+ return 0;
+ }
+
+ if(sscanf(port, "%lu%*c", &i) == 1) {
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx", "port parsed okay\n"));
+ addr->sipx_port = htons(i);
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_ipx",
+ "failed to parse port part of address\n"));
+ free(def);
+ free(input);
+ return 0;
+ }
+
+ free(def);
+ free(input);
+ return 1;
+}
+
+
+
+int
+netsnmp_sockaddr_ipx(struct sockaddr_ipx *addr, const char *peername)
+{
+ return netsnmp_sockaddr_ipx2(addr, peername, NULL);
+}
+
+
+
+netsnmp_transport *
+netsnmp_ipx_create_tstring(const char *str, int local,
+ const char *default_target)
+{
+ struct sockaddr_ipx addr;
+
+ if (netsnmp_sockaddr_ipx2(&addr, str, default_target)) {
+ return netsnmp_ipx_transport(&addr, local);
+ } else {
+ return NULL;
+ }
+}
+
+
+
+netsnmp_transport *
+netsnmp_ipx_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ struct sockaddr_ipx addr;
+
+ if (o_len == 12) {
+ addr.sipx_family = AF_IPX;
+ memcpy((u_char *) & (addr.sipx_network), &(o[00]), 4);
+ memcpy((u_char *) & (addr.sipx_node), &(o[04]), 6);
+ memcpy((u_char *) & (addr.sipx_port), &(o[10]), 2);
+ return netsnmp_ipx_transport(&addr, local);
+ }
+ return NULL;
+}
+
+
+
+void
+netsnmp_ipx_ctor(void)
+{
+ ipxDomain.name = netsnmpIPXDomain;
+ ipxDomain.name_length = netsnmpIPXDomain_len;
+ ipxDomain.prefix = (const char**)calloc(2, sizeof(char *));
+ ipxDomain.prefix[0] = "ipx";
+
+ ipxDomain.f_create_from_tstring = NULL;
+ ipxDomain.f_create_from_tstring_new = netsnmp_ipx_create_tstring;
+ ipxDomain.f_create_from_ostring = netsnmp_ipx_create_ostring;
+
+ netsnmp_tdomain_register(&ipxDomain);
+}
diff --git a/snmplib/transports/snmpIPv4BaseDomain.c b/snmplib/transports/snmpIPv4BaseDomain.c
new file mode 100644
index 0000000..41a6cb6
--- /dev/null
+++ b/snmplib/transports/snmpIPv4BaseDomain.c
@@ -0,0 +1,223 @@
+/* IPV4 base transport support functions
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpIPv4BaseDomain.h>
+
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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 <net-snmp/types.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/default_store.h>
+#include <net-snmp/library/system.h>
+
+
+#ifndef INADDR_NONE
+#define INADDR_NONE -1
+#endif
+
+int
+netsnmp_sockaddr_in(struct sockaddr_in *addr,
+ const char *inpeername, int remote_port)
+{
+ char buf[sizeof(int) * 3 + 2];
+ sprintf(buf, ":%u", remote_port);
+ return netsnmp_sockaddr_in2(addr, inpeername, remote_port ? buf : NULL);
+}
+
+int
+netsnmp_sockaddr_in2(struct sockaddr_in *addr,
+ const char *inpeername, const char *default_target)
+{
+ int ret;
+
+ if (addr == NULL) {
+ return 0;
+ }
+
+ DEBUGMSGTL(("netsnmp_sockaddr_in",
+ "addr %p, inpeername \"%s\", default_target \"%s\"\n",
+ addr, inpeername ? inpeername : "[NIL]",
+ default_target ? default_target : "[NIL]"));
+
+ memset(addr, 0, sizeof(struct sockaddr_in));
+ addr->sin_addr.s_addr = htonl(INADDR_ANY);
+ addr->sin_family = AF_INET;
+ addr->sin_port = htons((u_short)SNMP_PORT);
+
+ {
+ int port = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DEFAULT_PORT);
+
+ if (port != 0) {
+ addr->sin_port = htons((u_short)port);
+ } else if (default_target != NULL)
+ netsnmp_sockaddr_in2(addr, default_target, NULL);
+ }
+
+ if (inpeername != NULL && *inpeername != '\0') {
+ const char *host, *port;
+ char *peername = NULL;
+ char *cp;
+ /*
+ * Duplicate the peername because we might want to mank around with
+ * it.
+ */
+
+ peername = strdup(inpeername);
+ if (peername == NULL) {
+ return 0;
+ }
+
+ /*
+ * Try and extract an appended port number.
+ */
+ cp = strchr(peername, ':');
+ if (cp != NULL) {
+ *cp = '\0';
+ port = cp + 1;
+ host = peername;
+ } else {
+ host = NULL;
+ port = peername;
+ }
+
+ /*
+ * Try to convert the user port specifier
+ */
+ if (port && *port == '\0')
+ port = NULL;
+
+ if (port != NULL) {
+ long int l;
+ char* ep;
+
+ DEBUGMSGTL(("netsnmp_sockaddr_in", "check user service %s\n",
+ port));
+
+ l = strtol(port, &ep, 10);
+ if (ep != port && *ep == '\0' && 0 <= l && l <= 0x0ffff)
+ addr->sin_port = htons((u_short)l);
+ else {
+ if (host == NULL) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in",
+ "servname not numeric, "
+ "check if it really is a destination)\n"));
+ host = port;
+ port = NULL;
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_in",
+ "servname not numeric\n"));
+ free(peername);
+ return 0;
+ }
+ }
+ }
+
+ /*
+ * Try to convert the user host specifier
+ */
+ if (host && *host == '\0')
+ host = NULL;
+
+ if (host != NULL) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in",
+ "check destination %s\n", host));
+
+
+ if (strcmp(peername, "255.255.255.255") == 0 ) {
+ /*
+ * The explicit broadcast address hack
+ */
+ DEBUGMSGTL(("netsnmp_sockaddr_in", "Explicit UDP broadcast\n"));
+ addr->sin_addr.s_addr = INADDR_NONE;
+ } else {
+ ret =
+ netsnmp_gethostbyname_v4(peername, &addr->sin_addr.s_addr);
+ if (ret < 0) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in",
+ "couldn't resolve hostname\n"));
+ free(peername);
+ return 0;
+ }
+ DEBUGMSGTL(("netsnmp_sockaddr_in",
+ "hostname (resolved okay)\n"));
+ }
+ }
+ free(peername);
+ }
+
+ /*
+ * Finished
+ */
+
+ DEBUGMSGTL(("netsnmp_sockaddr_in", "return { AF_INET, %s:%hu }\n",
+ inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)));
+ return 1;
+}
+
+char *
+netsnmp_ipv4_fmtaddr(const char *prefix, netsnmp_transport *t,
+ void *data, int len)
+{
+ netsnmp_indexed_addr_pair *addr_pair = NULL;
+ struct hostent *host;
+ char tmp[64];
+
+ if (data != NULL && len == sizeof(netsnmp_indexed_addr_pair)) {
+ addr_pair = (netsnmp_indexed_addr_pair *) data;
+ } else if (t != NULL && t->data != NULL) {
+ addr_pair = (netsnmp_indexed_addr_pair *) t->data;
+ }
+
+ if (addr_pair == NULL) {
+ snprintf(tmp, sizeof(tmp), "%s: unknown", prefix);
+ } else {
+ struct sockaddr_in *to = NULL;
+ to = (struct sockaddr_in *) &(addr_pair->remote_addr);
+ if (to == NULL) {
+ snprintf(tmp, sizeof(tmp), "%s: unknown->[%s]:%hu", prefix,
+ inet_ntoa(addr_pair->local_addr.sin.sin_addr),
+ ntohs(addr_pair->local_addr.sin.sin_port));
+ } else if ( t && t->flags & NETSNMP_TRANSPORT_FLAG_HOSTNAME ) {
+ /* XXX: hmm... why isn't this prefixed */
+ /* assuming intentional */
+ host = netsnmp_gethostbyaddr((char *)&to->sin_addr, 4, AF_INET);
+ return (host ? strdup(host->h_name) : NULL);
+ } else {
+ snprintf(tmp, sizeof(tmp), "%s: [%s]:%hu->", prefix,
+ inet_ntoa(to->sin_addr), ntohs(to->sin_port));
+ snprintf(tmp + strlen(tmp), sizeof(tmp)-strlen(tmp), "[%s]:%hu",
+ inet_ntoa(addr_pair->local_addr.sin.sin_addr),
+ ntohs(addr_pair->local_addr.sin.sin_port));
+ }
+ }
+ tmp[sizeof(tmp)-1] = '\0';
+ return strdup(tmp);
+}
+
diff --git a/snmplib/transports/snmpIPv6BaseDomain.c b/snmplib/transports/snmpIPv6BaseDomain.c
new file mode 100644
index 0000000..9bad950
--- /dev/null
+++ b/snmplib/transports/snmpIPv6BaseDomain.c
@@ -0,0 +1,426 @@
+/* IPV6 base transport support functions
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef NETSNMP_ENABLE_IPV6
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpIPv6BaseDomain.h>
+#include <net-snmp/library/system.h>
+
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/default_store.h>
+#include <net-snmp/library/snmp_logging.h>
+
+#include "inet_ntop.h"
+#include "inet_pton.h"
+
+
+#if defined(WIN32) && !defined(IF_NAMESIZE)
+#define IF_NAMESIZE 12
+#endif
+
+
+#if defined(HAVE_WINSOCK_H) && !defined(mingw32)
+static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
+#endif
+
+
+static unsigned
+netsnmp_if_nametoindex(const char *ifname)
+{
+#if defined(WIN32)
+ return atoi(ifname);
+#elif defined(HAVE_IF_NAMETOINDEX)
+ return if_nametoindex(ifname);
+#else
+ return 0;
+#endif
+}
+
+static char *
+netsnmp_if_indextoname(unsigned ifindex, char *ifname)
+{
+#if defined(WIN32)
+ snprintf(ifname, IF_NAMESIZE, "%u", ifindex);
+ return ifname;
+#elif defined(HAVE_IF_NAMETOINDEX)
+ return if_indextoname(ifindex, ifname);
+#else
+ return NULL;
+#endif
+}
+
+char *
+netsnmp_ipv6_fmtaddr(const char *prefix, netsnmp_transport *t,
+ void *data, int len)
+{
+ struct sockaddr_in6 *to = NULL;
+ char addr[INET6_ADDRSTRLEN];
+ char tmp[INET6_ADDRSTRLEN + 18];
+
+ DEBUGMSGTL(("netsnmp_ipv6", "fmtaddr: t = %p, data = %p, len = %d\n", t,
+ data, len));
+ if (data != NULL && len == sizeof(struct sockaddr_in6)) {
+ to = (struct sockaddr_in6 *) data;
+ } else if (t != NULL && t->data != NULL) {
+ to = (struct sockaddr_in6 *) t->data;
+ }
+ if (to == NULL) {
+ snprintf(tmp, sizeof(tmp), "%s: unknown", prefix);
+ } else {
+ char scope_id[IF_NAMESIZE + 1] = "";
+
+#if defined(HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID)
+ if (to->sin6_scope_id
+ && netsnmp_if_indextoname(to->sin6_scope_id, &scope_id[1])) {
+ scope_id[0] = '%';
+ }
+#endif
+ snprintf(tmp, sizeof(tmp), "%s: [%s%s]:%hu", prefix,
+ inet_ntop(AF_INET6, (void *) &(to->sin6_addr), addr,
+ INET6_ADDRSTRLEN), scope_id, ntohs(to->sin6_port));
+ }
+ tmp[sizeof(tmp)-1] = '\0';
+ return strdup(tmp);
+}
+
+int
+netsnmp_sockaddr_in6_2(struct sockaddr_in6 *addr,
+ const char *inpeername, const char *default_target)
+{
+ char *cp = NULL, *peername = NULL;
+ char debug_addr[INET6_ADDRSTRLEN];
+#if HAVE_GETADDRINFO
+ struct addrinfo *addrs = NULL;
+ int err;
+#elif HAVE_GETIPNODEBYNAME
+ struct hostent *hp = NULL;
+ int err;
+#elif HAVE_GETHOSTBYNAME
+ struct hostent *hp = NULL;
+#endif
+ int portno;
+
+ if (addr == NULL) {
+ return 0;
+ }
+
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "addr %p, peername \"%s\", default_target \"%s\"\n",
+ addr, inpeername ? inpeername : "[NIL]",
+ default_target ? default_target : "[NIL]"));
+
+ memset(addr, 0, sizeof(struct sockaddr_in6));
+ addr->sin6_family = AF_INET6;
+ addr->sin6_addr = in6addr_any;
+ addr->sin6_port = htons((u_short)SNMP_PORT);
+
+ {
+ int port = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DEFAULT_PORT);
+ if (port != 0)
+ addr->sin6_port = htons((u_short)port);
+ else if (default_target != NULL)
+ netsnmp_sockaddr_in6_2(addr, default_target, NULL);
+ }
+
+ if (inpeername != NULL) {
+ /*
+ * Duplicate the peername because we might want to mank around with
+ * it.
+ */
+
+ peername = strdup(inpeername);
+ if (peername == NULL) {
+ return 0;
+ }
+
+ for (cp = peername; *cp && isdigit((unsigned char) *cp); cp++);
+ portno = atoi(peername);
+ if (!*cp && portno != 0) {
+ /*
+ * Okay, it looks like JUST a port number.
+ */
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "totally numeric: %d\n",
+ portno));
+ addr->sin6_port = htons((u_short)portno);
+ goto resolved;
+ }
+
+ /*
+ * See if it is an IPv6 address covered with square brackets. Also check
+ * for an appended :port.
+ */
+ if (*peername == '[') {
+ cp = strchr(peername, ']');
+ if (cp != NULL) {
+ /*
+ * See if it is an IPv6 link-local address with interface
+ * name as <zone_id>, like fe80::1234%eth0.
+ * Please refer to the internet draft, IPv6 Scoped Address Architecture
+ * http://www.ietf.org/internet-drafts/draft-ietf-ipngwg-scoping-arch-04.txt
+ *
+ */
+ char *scope_id;
+ unsigned int if_index = 0;
+ *cp = '\0';
+ scope_id = strchr(peername + 1, '%');
+ if (scope_id != NULL) {
+ *scope_id = '\0';
+ if_index = netsnmp_if_nametoindex(scope_id + 1);
+ }
+ if (*(cp + 1) == ':') {
+ portno = atoi(cp+2);
+ if (portno != 0 &&
+ inet_pton(AF_INET6, peername + 1,
+ (void *) &(addr->sin6_addr))) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "IPv6 address with port suffix :%d\n",
+ portno));
+ if (portno > 0 && portno < 0xffff) {
+ addr->sin6_port = htons((u_short)portno);
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "invalid port number: %d", portno));
+ return 0;
+ }
+
+#if defined(HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID)
+ addr->sin6_scope_id = if_index;
+#endif
+ goto resolved;
+ }
+ } else {
+ if (inet_pton
+ (AF_INET6, peername + 1,
+ (void *) &(addr->sin6_addr))) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "IPv6 address with square brackets\n"));
+ portno = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DEFAULT_PORT);
+ if (portno <= 0)
+ portno = SNMP_PORT;
+ addr->sin6_port = htons((u_short)portno);
+#if defined(HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID)
+ addr->sin6_scope_id = if_index;
+#endif
+ goto resolved;
+ }
+ }
+ if (scope_id != NULL) {
+ *scope_id = '%';
+ }
+ *cp = ']';
+ }
+ }
+
+ cp = strrchr(peername, ':');
+ if (cp != NULL) {
+ char *scope_id;
+ unsigned int if_index = 0;
+ *cp = '\0';
+ scope_id = strchr(peername + 1, '%');
+ if (scope_id != NULL) {
+ *scope_id = '\0';
+ if_index = netsnmp_if_nametoindex(scope_id + 1);
+ }
+ portno = atoi(cp + 1);
+ if (portno != 0 &&
+ inet_pton(AF_INET6, peername,
+ (void *) &(addr->sin6_addr))) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "IPv6 address with port suffix :%d\n",
+ atoi(cp + 1)));
+ if (portno > 0 && portno < 0xffff) {
+ addr->sin6_port = htons((u_short)portno);
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "invalid port number: %d", portno));
+ return 0;
+ }
+
+#if defined(HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID)
+ addr->sin6_scope_id = if_index;
+#endif
+ goto resolved;
+ }
+ if (scope_id != NULL) {
+ *scope_id = '%';
+ }
+ *cp = ':';
+ }
+
+ /*
+ * See if it is JUST an IPv6 address.
+ */
+ if (inet_pton(AF_INET6, peername, (void *) &(addr->sin6_addr))) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "just IPv6 address\n"));
+ goto resolved;
+ }
+
+ /*
+ * Well, it must be a hostname then, possibly with an appended :port.
+ * Sort that out first.
+ */
+
+ cp = strrchr(peername, ':');
+ if (cp != NULL) {
+ *cp = '\0';
+ portno = atoi(cp + 1);
+ if (portno != 0) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "hostname(?) with port suffix :%d\n",
+ portno));
+ if (portno > 0 && portno < 0xffff) {
+ addr->sin6_port = htons((u_short)portno);
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "invalid port number: %d", portno));
+ return 0;
+ }
+
+ } else {
+ /*
+ * No idea, looks bogus but we might as well pass the full thing to
+ * the name resolver below.
+ */
+ *cp = ':';
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "hostname(?) with embedded ':'?\n"));
+ }
+ /*
+ * Fall through.
+ */
+ }
+
+ if (peername[0] == '\0') {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "empty hostname\n"));
+ free(peername);
+ return 0;
+ }
+
+#if HAVE_GETADDRINFO
+ {
+ struct addrinfo hint = { 0 };
+ hint.ai_flags = 0;
+ hint.ai_family = PF_INET6;
+ hint.ai_socktype = SOCK_DGRAM;
+ hint.ai_protocol = 0;
+
+ err = netsnmp_getaddrinfo(peername, NULL, &hint, &addrs);
+ }
+ if (err != 0) {
+#if HAVE_GAI_STRERROR
+ snmp_log(LOG_ERR, "getaddrinfo(\"%s\", NULL, ...): %s\n", peername,
+ gai_strerror(err));
+#else
+ snmp_log(LOG_ERR, "getaddrinfo(\"%s\", NULL, ...): (error %d)\n",
+ peername, err);
+#endif
+ free(peername);
+ return 0;
+ }
+ if (addrs != NULL) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "hostname (resolved okay)\n"));
+ memcpy(&addr->sin6_addr,
+ &((struct sockaddr_in6 *) addrs->ai_addr)->sin6_addr,
+ sizeof(struct in6_addr));
+ freeaddrinfo(addrs);
+ }
+ else {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "Failed to resolve IPv6 hostname\n"));
+ }
+#elif HAVE_GETIPNODEBYNAME
+ hp = getipnodebyname(peername, AF_INET6, 0, &err);
+ if (hp == NULL) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "hostname (couldn't resolve = %d)\n", err));
+ free(peername);
+ return 0;
+ }
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "hostname (resolved okay)\n"));
+ memcpy(&(addr->sin6_addr), hp->h_addr, hp->h_length);
+#elif HAVE_GETHOSTBYNAME
+ hp = netsnmp_gethostbyname(peername);
+ if (hp == NULL) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "hostname (couldn't resolve)\n"));
+ free(peername);
+ return 0;
+ } else {
+ if (hp->h_addrtype != AF_INET6) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "hostname (not AF_INET6!)\n"));
+ free(peername);
+ return 0;
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6",
+ "hostname (resolved okay)\n"));
+ memcpy(&(addr->sin6_addr), hp->h_addr, hp->h_length);
+ }
+ }
+#else /*HAVE_GETHOSTBYNAME */
+ /*
+ * There is no name resolving function available.
+ */
+ snmp_log(LOG_ERR,
+ "no getaddrinfo()/getipnodebyname()/gethostbyname()\n");
+ free(peername);
+ return 0;
+#endif /*HAVE_GETHOSTBYNAME */
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "NULL peername"));
+ return 0;
+ }
+
+ resolved:
+ DEBUGMSGTL(("netsnmp_sockaddr_in6", "return { AF_INET6, [%s]:%hu }\n",
+ inet_ntop(AF_INET6, &addr->sin6_addr, debug_addr,
+ sizeof(debug_addr)), ntohs(addr->sin6_port)));
+ free(peername);
+ return 1;
+}
+
+
+int
+netsnmp_sockaddr_in6(struct sockaddr_in6 *addr,
+ const char *inpeername, int remote_port)
+{
+ char buf[sizeof(remote_port) * 3 + 2];
+ sprintf(buf, ":%u", remote_port);
+ return netsnmp_sockaddr_in6_2(addr, inpeername, remote_port ? buf : NULL);
+}
+
+#endif /* NETSNMP_ENABLE_IPV6 */
diff --git a/snmplib/transports/snmpSSHDomain.c b/snmplib/transports/snmpSSHDomain.c
new file mode 100644
index 0000000..a9ed81f
--- /dev/null
+++ b/snmplib/transports/snmpSSHDomain.c
@@ -0,0 +1,1010 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/library/snmpSSHDomain.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <errno.h>
+
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#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_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+#include <pwd.h>
+
+#ifndef MAXPATHLEN
+#warn no system max path length detected
+#define MAXPATHLEN 2048
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/system.h>
+#include <net-snmp/library/default_store.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/snmpIPv4BaseDomain.h>
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+#include <net-snmp/library/read_config.h>
+
+netsnmp_feature_require(user_information)
+
+#define MAX_NAME_LENGTH 127
+
+#define NETSNMP_SSHTOSNMP_VERSION1 1
+#define NETSNMP_MAX_SSHTOSNMP_VERSION 1
+
+#define DEFAULT_SOCK_NAME "sshdomainsocket"
+
+typedef struct netsnmp_ssh_addr_pair_s {
+ struct sockaddr_in remote_addr;
+ struct in_addr local_addr;
+ LIBSSH2_SESSION *session;
+ LIBSSH2_CHANNEL *channel;
+ char username[MAX_NAME_LENGTH+1];
+ struct sockaddr_un unix_socket_end;
+ char socket_path[MAXPATHLEN];
+} netsnmp_ssh_addr_pair;
+
+const oid netsnmp_snmpSSHDomain[] = { TRANSPORT_DOMAIN_SSH_IP };
+static netsnmp_tdomain sshDomain;
+
+#define SNMPSSHDOMAIN_USE_EXTERNAL_PIPE 1
+
+/*
+ * Not static since it is needed here as well as in snmpUDPDomain, but not
+ * public either
+ */
+int
+netsnmp_sockaddr_in2(struct sockaddr_in *addr,
+ const char *inpeername, const char *default_target);
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+static char *
+netsnmp_ssh_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ netsnmp_ssh_addr_pair *addr_pair = NULL;
+
+ if (data != NULL && len == sizeof(netsnmp_ssh_addr_pair)) {
+ addr_pair = (netsnmp_ssh_addr_pair *) data;
+ } else if (t != NULL && t->data != NULL) {
+ addr_pair = (netsnmp_ssh_addr_pair *) t->data;
+ }
+
+ if (addr_pair == NULL) {
+ return strdup("SSH: unknown");
+ } else {
+ struct sockaddr_in *to = NULL;
+ char tmp[64];
+ to = (struct sockaddr_in *) &(addr_pair->remote_addr);
+ if (to == NULL) {
+ return strdup("SSH: unknown");
+ }
+
+ sprintf(tmp, "SSH: [%s]:%hd",
+ inet_ntoa(to->sin_addr), ntohs(to->sin_port));
+ return strdup(tmp);
+ }
+}
+
+
+
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+static int
+netsnmp_ssh_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ netsnmp_tmStateReference *tmStateRef = NULL;
+ netsnmp_ssh_addr_pair *addr_pair = NULL;
+ int iamclient = 0;
+
+ DEBUGMSGTL(("ssh", "at the top of ssh_recv\n"));
+ DEBUGMSGTL(("ssh", "t=%p\n", t));
+ if (t != NULL && t->data != NULL) {
+ addr_pair = (netsnmp_ssh_addr_pair *) t->data;
+ }
+
+ DEBUGMSGTL(("ssh", "addr_pair=%p\n", addr_pair));
+ if (t != NULL && addr_pair && addr_pair->channel) {
+ DEBUGMSGTL(("ssh", "t=%p, addr_pair=%p, channel=%p\n",
+ t, addr_pair, addr_pair->channel));
+ iamclient = 1;
+ while (rc < 0) {
+ rc = libssh2_channel_read(addr_pair->channel, buf, size);
+ if (rc < 0) { /* XXX: from tcp; ssh equiv?: && errno != EINTR */
+ DEBUGMSGTL(("ssh", "recv fd %d err %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ break;
+ }
+ DEBUGMSGTL(("ssh", "recv fd %d got %d bytes\n",
+ t->sock, rc));
+ }
+ } else if (t != NULL) {
+
+#ifdef SNMPSSHDOMAIN_USE_EXTERNAL_PIPE
+
+ socklen_t tolen = sizeof(struct sockaddr_un);
+
+ if (t != NULL && t->sock >= 0) {
+ struct sockaddr *to;
+ to = (struct sockaddr *) SNMP_MALLOC_STRUCT(sockaddr_un);
+ if (NULL == to) {
+ *opaque = NULL;
+ *olength = 0;
+ return -1;
+ }
+
+ if(getsockname(t->sock, to, &tolen) != 0){
+ free(to);
+ *opaque = NULL;
+ *olength = 0;
+ return -1;
+ };
+
+ if (addr_pair->username[0] == '\0') {
+ /* we don't have a username yet, so this is the first message */
+ struct ucred *remoteuser;
+ struct msghdr msg;
+ struct iovec iov[1];
+ char cmsg[CMSG_SPACE(sizeof(remoteuser))+4096];
+ struct cmsghdr *cmsgptr;
+ u_char *charbuf = buf;
+
+ iov[0].iov_base = buf;
+ iov[0].iov_len = size;
+
+ memset(&msg, 0, sizeof msg);
+ msg.msg_iov = iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = &cmsg;
+ msg.msg_controllen = sizeof(cmsg);
+
+ rc = recvmsg(t->sock, &msg, MSG_DONTWAIT); /* use DONTWAIT? */
+ if (rc <= 0) {
+ return rc;
+ }
+
+ /* we haven't received the starting info */
+ if ((u_char) charbuf[0] > NETSNMP_SSHTOSNMP_VERSION1) {
+ /* unsupported connection version */
+ snmp_log(LOG_ERR, "received unsupported sshtosnmp version: %d\n", charbuf[0]);
+ return -1;
+ }
+
+ DEBUGMSGTL(("ssh", "received first msg over SSH; internal SSH protocol version %d\n", charbuf[0]));
+
+ for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL; cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
+ if (cmsgptr->cmsg_level == SOL_SOCKET && cmsgptr->cmsg_type == SCM_CREDENTIALS) {
+ /* received credential info */
+ struct passwd *user_pw;
+
+ remoteuser = (struct ucred *) CMSG_DATA(cmsgptr);
+
+ if ((user_pw = getpwuid(remoteuser->uid)) == NULL) {
+ snmp_log(LOG_ERR, "No user found for uid %d\n",
+ remoteuser->uid);
+ return -1;
+ }
+ if (strlen(user_pw->pw_name) >
+ sizeof(addr_pair->username)-1) {
+ snmp_log(LOG_ERR,
+ "User name '%s' too long for snmp\n",
+ user_pw->pw_name);
+ return -1;
+ }
+ strlcpy(addr_pair->username, user_pw->pw_name,
+ sizeof(addr_pair->username));
+ }
+ DEBUGMSGTL(("ssh", "Setting user name to %s\n",
+ addr_pair->username));
+ }
+
+ if (addr_pair->username[0] == '\0') {
+ snmp_log(LOG_ERR,
+ "failed to extract username from sshd connected unix socket\n");
+ return -1;
+ }
+
+ if (rc == 1) {
+ /* the only packet we received was the starting one */
+ t->flags |= NETSNMP_TRANSPORT_FLAG_EMPTY_PKT;
+ return 0;
+ }
+
+ rc -= 1;
+ memmove(charbuf, &charbuf[1], rc);
+ } else {
+ while (rc < 0) {
+ rc = recvfrom(t->sock, buf, size, 0, NULL, NULL);
+ if (rc < 0 && errno != EINTR) {
+ DEBUGMSGTL(("ssh", "recv fd %d err %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ return rc;
+ }
+ *opaque = (void*)to;
+ *olength = sizeof(struct sockaddr_un);
+ }
+ }
+ DEBUGMSGTL(("ssh", "recv fd %d got %d bytes\n",
+ t->sock, rc));
+ }
+
+#else /* we're called directly by sshd and use stdin/out */
+
+ struct passwd *user_pw;
+
+ iamclient = 0;
+ /* we're on the server side and should read from stdin */
+ while (rc < 0) {
+ rc = read(STDIN_FILENO, buf, size);
+ if (rc < 0 && errno != EINTR) {
+ DEBUGMSGTL(("ssh",
+ " read on stdin failed: %d (\"%s\")\n",
+ errno, strerror(errno)));
+ break;
+ }
+ if (rc == 0) {
+ /* 0 input is probably bad since we selected on it */
+ DEBUGMSGTL(("ssh", "got a 0 read on stdin\n"));
+ return -1;
+ }
+ DEBUGMSGTL(("ssh", "read on stdin got %d bytes\n", rc));
+ }
+
+/* XXX: need to check the username, but addr_pair doesn't exist! */
+ /*
+ DEBUGMSGTL(("ssh", "current username=%s\n", c));
+ if (addr_pair->username[0] == '\0') {
+ if ((user_pw = getpwuid(getuid())) == NULL) {
+ snmp_log(LOG_ERR, "No user found for uid %d\n", getuid());
+ return -1;
+ }
+ if (strlen(user_pw->pw_name) > sizeof(addr_pair->username)-1) {
+ snmp_log(LOG_ERR, "User name '%s' too long for snmp\n",
+ user_pw->pw_name);
+ return -1;
+ }
+ strlcpy(addr_pair->username, user_pw->pw_name,
+ sizeof(addr_pair->username));
+ }
+ */
+
+#endif /* ! SNMPSSHDOMAIN_USE_EXTERNAL_PIPE */
+ }
+
+ /* create a tmStateRef cache */
+ tmStateRef = SNMP_MALLOC_TYPEDEF(netsnmp_tmStateReference);
+
+ /* secshell document says were always authpriv, even if NULL algorithms */
+ /* ugh! */
+ /* XXX: disallow NULL in our implementations */
+ tmStateRef->transportSecurityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
+
+ /* XXX: figure out how to get the specified local secname from the session */
+ if (iamclient && 0) {
+ /* XXX: we're on the client; we should have named the
+ connection ourselves... pull this from session somehow? */
+ strlcpy(tmStateRef->securityName, addr_pair->username,
+ sizeof(tmStateRef->securityName));
+ } else {
+#ifdef SNMPSSHDOMAIN_USE_EXTERNAL_PIPE
+ strlcpy(tmStateRef->securityName, addr_pair->username,
+ sizeof(tmStateRef->securityName));
+#else /* we're called directly by sshd and use stdin/out */
+ /* we're on the server... */
+ /* XXX: this doesn't copy properly and can get pointer
+ reference issues */
+ if (strlen(getenv("USER")) > 127) {
+ /* ruh roh */
+ /* XXX: clean up */
+ return -1;
+ exit;
+ }
+
+ /* XXX: detect and throw out overflow secname sizes rather
+ than truncating. */
+ strlcpy(tmStateRef->securityName, getenv("USER"),
+ sizeof(tmStateRef->securityName));
+#endif /* ! SNMPSSHDOMAIN_USE_EXTERNAL_PIPE */
+ }
+ tmStateRef->securityName[sizeof(tmStateRef->securityName)-1] = '\0';
+ tmStateRef->securityNameLen = strlen(tmStateRef->securityName);
+ *opaque = tmStateRef;
+ *olength = sizeof(netsnmp_tmStateReference);
+
+ return rc;
+}
+
+
+
+static int
+netsnmp_ssh_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+
+ netsnmp_ssh_addr_pair *addr_pair = NULL;
+ netsnmp_tmStateReference *tmStateRef = NULL;
+
+ if (t != NULL && t->data != NULL) {
+ addr_pair = (netsnmp_ssh_addr_pair *) t->data;
+ }
+
+ if (opaque != NULL && *opaque != NULL &&
+ *olength == sizeof(netsnmp_tmStateReference)) {
+ tmStateRef = (netsnmp_tmStateReference *) *opaque;
+ }
+
+ if (!tmStateRef) {
+ /* this is now an error according to my memory in the recent draft */
+ snmp_log(LOG_ERR, "netsnmp_ssh_send wasn't passed a valid tmStateReference\n");
+ return -1;
+ }
+
+ if (NULL != t && NULL != addr_pair && NULL != addr_pair->channel) {
+ if (addr_pair->username[0] == '\0') {
+ strlcpy(addr_pair->username, tmStateRef->securityName,
+ sizeof(addr_pair->username));
+ } else if (strcmp(addr_pair->username, tmStateRef->securityName) != 0 ||
+ strlen(addr_pair->username) != tmStateRef->securityNameLen) {
+ /* error! they must always match */
+ snmp_log(LOG_ERR, "netsnmp_ssh_send was passed a tmStateReference with a securityName not equal to previous messages\n");
+ return -1;
+ }
+ while (rc < 0) {
+ rc = libssh2_channel_write(addr_pair->channel, buf, size);
+ if (rc < 0) { /* XXX: && errno != EINTR */
+ break;
+ }
+ }
+ } else if (t != NULL) {
+#ifdef SNMPSSHDOMAIN_USE_EXTERNAL_PIPE
+
+ while (rc < 0) {
+ rc = sendto(t->sock, buf, size, 0, NULL, 0);
+
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+
+#else /* we're called directly by sshd and use stdin/out */
+ /* on the server; send to stdout */
+ while (rc < 0) {
+ rc = write(STDOUT_FILENO, buf, size);
+ fflush(stdout);
+ if (rc < 0 && errno != EINTR) { /* XXX: && errno != EINTR */
+ break;
+ }
+ }
+#endif
+ }
+
+ return rc;
+}
+
+
+
+static int
+netsnmp_ssh_close(netsnmp_transport *t)
+{
+ int rc = -1;
+ netsnmp_ssh_addr_pair *addr_pair = NULL;
+
+ if (t != NULL && t->data != NULL) {
+ addr_pair = (netsnmp_ssh_addr_pair *) t->data;
+ }
+
+ if (t != NULL && addr_pair && t->sock >= 0) {
+ DEBUGMSGTL(("ssh", "close fd %d\n", t->sock));
+
+ if (addr_pair->channel) {
+ libssh2_channel_close(addr_pair->channel);
+ libssh2_channel_free(addr_pair->channel);
+ addr_pair->channel = NULL;
+ }
+
+ if (addr_pair->session) {
+ libssh2_session_disconnect(addr_pair->session, "Normal Shutdown");
+ libssh2_session_free(addr_pair->session);
+ addr_pair->session = NULL;
+ }
+
+#ifndef HAVE_CLOSESOCKET
+ rc = close(t->sock);
+#else
+ rc = closesocket(t->sock);
+#endif
+ t->sock = -1;
+
+#ifdef SNMPSSHDOMAIN_USE_EXTERNAL_PIPE
+
+ close(t->sock);
+
+ if (!addr_pair->session && !addr_pair->channel) {
+ /* unix socket based connection */
+ close(t->sock);
+
+ /* XXX: make configurable */
+ unlink(addr_pair->socket_path);
+ }
+
+#else /* we're called directly by sshd and use stdin/out */
+
+ /* on the server: close stdin/out */
+ close(STDIN_FILENO);
+ close(STDOUT_FILENO);
+#endif /* ! SNMPSSHDOMAIN_USE_EXTERNAL_PIPE */
+
+ } else {
+
+#ifndef SNMPSSHDOMAIN_USE_EXTERNAL_PIPE
+ /* on the server: close stdin/out */
+ close(STDIN_FILENO);
+ close(STDOUT_FILENO);
+#endif /* ! SNMPSSHDOMAIN_USE_EXTERNAL_PIPE */
+
+ }
+ return rc;
+}
+
+
+
+static int
+netsnmp_ssh_accept(netsnmp_transport *t)
+{
+#ifdef SNMPSSHDOMAIN_USE_EXTERNAL_PIPE
+
+ /* much of this is duplicated from snmpUnixDomain.c */
+
+ netsnmp_ssh_addr_pair *addr_pair;
+ int newsock = -1;
+ struct sockaddr *farend = NULL;
+ socklen_t farendlen = sizeof(struct sockaddr_un);
+
+
+ if (t != NULL && t->sock >= 0) {
+ addr_pair = SNMP_MALLOC_TYPEDEF(netsnmp_ssh_addr_pair);
+
+ if (addr_pair == NULL) {
+ /*
+ * Indicate that the acceptance of this socket failed.
+ */
+ DEBUGMSGTL(("ssh", "accept: malloc failed\n"));
+ return -1;
+ }
+
+ farend = (struct sockaddr *) &addr_pair->unix_socket_end;
+
+ newsock = accept(t->sock, farend, &farendlen);
+
+ /* set the SO_PASSCRED option so we can receive the remote uid */
+ {
+ int one = 1;
+ setsockopt(newsock, SOL_SOCKET, SO_PASSCRED, (void *) &one,
+ sizeof(one));
+ }
+
+ if (newsock < 0) {
+ DEBUGMSGTL(("ssh","accept failed rc %d errno %d \"%s\"\n",
+ newsock, errno, strerror(errno)));
+ free(addr_pair);
+ return newsock;
+ }
+
+ if (t->data != NULL) {
+ free(t->data);
+ }
+
+ DEBUGMSGTL(("ssh", "accept succeeded (farend %p len %d)\n",
+ farend, farendlen));
+ t->data = addr_pair;
+ t->data_length = sizeof(netsnmp_ssh_addr_pair);
+ netsnmp_sock_buffer_set(newsock, SO_SNDBUF, 1, 0);
+ netsnmp_sock_buffer_set(newsock, SO_RCVBUF, 1, 0);
+ return newsock;
+ } else {
+ return -1;
+ }
+
+#else /* we're called directly by sshd and use stdin/out */
+ /* we don't need to do anything; server side uses stdin/out */
+ /* XXX: check that we're an ssh connection */
+
+ return STDIN_FILENO; /* return stdin */
+#endif /* ! SNMPSSHDOMAIN_USE_EXTERNAL_PIPE */
+
+}
+
+
+
+/*
+ * Open a SSH-based transport for SNMP. Local is TRUE if addr is the local
+ * address to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote address to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_ssh_transport(struct sockaddr_in *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+ netsnmp_ssh_addr_pair *addr_pair = NULL;
+ int rc = 0;
+ int i, auth_pw = 0;
+ const char *fingerprint;
+ char *userauthlist;
+ struct sockaddr_un *unaddr;
+ const char *sockpath =
+ netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SSHTOSNMP_SOCKET);
+ char tmpsockpath[MAXPATHLEN];
+
+#ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+ if (addr == NULL || addr->sin_family != AF_INET) {
+ return NULL;
+ }
+
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (t == NULL) {
+ return NULL;
+ }
+
+ t->domain = netsnmp_snmpSSHDomain;
+ t->domain_length = netsnmp_snmpSSHDomain_len;
+ t->flags = NETSNMP_TRANSPORT_FLAG_STREAM | NETSNMP_TRANSPORT_FLAG_TUNNELED;
+
+ addr_pair = SNMP_MALLOC_TYPEDEF(netsnmp_ssh_addr_pair);
+ if (addr_pair == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ t->data = addr_pair;
+ t->data_length = sizeof(netsnmp_ssh_addr_pair);
+
+ if (local) {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+#ifdef SNMPSSHDOMAIN_USE_EXTERNAL_PIPE
+
+ /* XXX: set t->local and t->local_length */
+
+
+ t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN;
+
+ unaddr = &addr_pair->unix_socket_end;
+
+ /* open a unix domain socket */
+ /* XXX: get data from the transport def for it's location */
+ unaddr->sun_family = AF_UNIX;
+ if (NULL == sockpath) {
+ sprintf(tmpsockpath, "%s/%s", get_persistent_directory(),
+ DEFAULT_SOCK_NAME);
+ sockpath = tmpsockpath;
+ }
+
+ strcpy(unaddr->sun_path, sockpath);
+ strcpy(addr_pair->socket_path, sockpath);
+
+ t->sock = socket(PF_UNIX, SOCK_STREAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /* set the SO_PASSCRED option so we can receive the remote uid */
+ {
+ int one = 1;
+ setsockopt(t->sock, SOL_SOCKET, SO_PASSCRED, (void *) &one,
+ sizeof(one));
+ }
+
+ unlink(unaddr->sun_path);
+ rc = bind(t->sock, (struct sockaddr *) unaddr, SUN_LEN(unaddr));
+ if (rc != 0) {
+ DEBUGMSGTL(("netsnmp_ssh_transport",
+ "couldn't bind \"%s\", errno %d (%s)\n",
+ unaddr->sun_path, errno, strerror(errno)));
+ netsnmp_ssh_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+
+ /* set the socket permissions */
+ {
+ /*
+ * Apply any settings to the ownership/permissions of the
+ * Sshdomain socket
+ */
+ int sshdomain_sock_perm =
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_SSHDOMAIN_SOCK_PERM);
+ int sshdomain_sock_user =
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_SSHDOMAIN_SOCK_USER);
+ int sshdomain_sock_group =
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_SSHDOMAIN_SOCK_GROUP);
+
+ DEBUGMSGTL(("ssh", "here: %s, %d, %d, %d\n",
+ unaddr->sun_path,
+ sshdomain_sock_perm, sshdomain_sock_user,
+ sshdomain_sock_group));
+ if (sshdomain_sock_perm != 0) {
+ DEBUGMSGTL(("ssh", "Setting socket perms to %d\n",
+ sshdomain_sock_perm));
+ chmod(unaddr->sun_path, sshdomain_sock_perm);
+ }
+
+ if (sshdomain_sock_user || sshdomain_sock_group) {
+ /*
+ * If either of user or group haven't been set,
+ * then leave them unchanged.
+ */
+ if (sshdomain_sock_user == 0 )
+ sshdomain_sock_user = -1;
+ if (sshdomain_sock_group == 0 )
+ sshdomain_sock_group = -1;
+ DEBUGMSGTL(("ssh", "Setting socket user/group to %d/%d\n",
+ sshdomain_sock_user, sshdomain_sock_group));
+ chown(unaddr->sun_path,
+ sshdomain_sock_user, sshdomain_sock_group);
+ }
+ }
+
+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
+ if (rc != 0) {
+ DEBUGMSGTL(("netsnmp_ssh_transport",
+ "couldn't listen to \"%s\", errno %d (%s)\n",
+ unaddr->sun_path, errno, strerror(errno)));
+ netsnmp_ssh_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+
+#else /* we're called directly by sshd and use stdin/out */
+ /* for ssh on the server side we've been launched so bind to
+ stdin/out */
+
+ /* nothing to do */
+
+ /* XXX: verify we're inside ssh */
+ t->sock = STDIN_FILENO;
+#endif /* ! SNMPSSHDOMAIN_USE_EXTERNAL_PIPE */
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ } else {
+ char *username;
+ char *keyfilepub;
+ char *keyfilepriv;
+
+ /* use the requested user name */
+ /* XXX: default to the current user name on the system like ssh does */
+ username = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SSH_USERNAME);
+ if (!username || 0 == *username) {
+ snmp_log(LOG_ERR, "You must specify a ssh username to use. See the snmp.conf manual page\n");
+ return NULL;
+ }
+
+ /* use the requested public key file */
+ keyfilepub = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SSH_PUBKEY);
+ if (!keyfilepub || 0 == *keyfilepub) {
+ /* XXX: default to ~/.ssh/id_rsa.pub */
+ snmp_log(LOG_ERR, "You must specify a ssh public key file to use. See the snmp.conf manual page\n");
+ return NULL;
+ }
+
+ /* use the requested private key file */
+ keyfilepriv = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SSH_PRIVKEY);
+ if (!keyfilepriv || 0 == *keyfilepriv) {
+ /* XXX: default to keyfilepub without the .pub suffix */
+ snmp_log(LOG_ERR, "You must specify a ssh private key file to use. See the snmp.conf manual page\n");
+ return NULL;
+ }
+
+ /* xxx: need an ipv6 friendly one too (sigh) */
+
+ /* XXX: not ideal when structs don't actually match size wise */
+ memcpy(&(addr_pair->remote_addr), addr, sizeof(struct sockaddr_in));
+
+ t->sock = socket(PF_INET, SOCK_STREAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ t->remote = (u_char *)malloc(6);
+ if (t->remote == NULL) {
+ netsnmp_ssh_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->remote, (u_char *) & (addr->sin_addr.s_addr), 4);
+ t->remote[4] = (htons(addr->sin_port) & 0xff00) >> 8;
+ t->remote[5] = (htons(addr->sin_port) & 0x00ff) >> 0;
+ t->remote_length = 6;
+
+ /*
+ * This is a client-type session, so attempt to connect to the far
+ * end. We don't go non-blocking here because it's not obvious what
+ * you'd then do if you tried to do snmp_sends before the connection
+ * had completed. So this can block.
+ */
+
+ rc = connect(t->sock, (struct sockaddr *)addr,
+ sizeof(struct sockaddr));
+
+ if (rc < 0) {
+ netsnmp_ssh_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /*
+ * Allow user to override the send and receive buffers. Default is
+ * to use os default. Don't worry too much about errors --
+ * just plough on regardless.
+ */
+ netsnmp_sock_buffer_set(t->sock, SO_SNDBUF, local, 0);
+ netsnmp_sock_buffer_set(t->sock, SO_RCVBUF, local, 0);
+
+ /* open the SSH session and channel */
+ addr_pair->session = libssh2_session_init();
+ if (libssh2_session_startup(addr_pair->session, t->sock)) {
+ shutdown:
+ snmp_log(LOG_ERR, "Failed to establish an SSH session\n");
+ netsnmp_ssh_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /* At this point we havn't authenticated, The first thing to
+ do is check the hostkey's fingerprint against our known
+ hosts Your app may have it hard coded, may go to a file,
+ may present it to the user, that's your call
+ */
+ fingerprint =
+ libssh2_hostkey_hash(addr_pair->session, LIBSSH2_HOSTKEY_HASH_MD5);
+ DEBUGMSGTL(("ssh", "Fingerprint: "));
+ for(i = 0; i < 16; i++) {
+ DEBUGMSG(("ssh", "%02x",
+ (unsigned char)fingerprint[i]));
+ }
+ DEBUGMSG(("ssh", "\n"));
+
+ /* check what authentication methods are available */
+ userauthlist =
+ libssh2_userauth_list(addr_pair->session,
+ username, strlen(username));
+ DEBUGMSG(("ssh", "Authentication methods: %s\n", userauthlist));
+
+ /* XXX: allow other types */
+ /* XXX: 4 seems magic to me... */
+ if (strstr(userauthlist, "publickey") != NULL) {
+ auth_pw |= 4;
+ }
+
+ /* XXX: hard coded paths and users */
+ if (auth_pw & 4) {
+ /* public key */
+ if (libssh2_userauth_publickey_fromfile(addr_pair->session,
+ username,
+ keyfilepub, keyfilepriv,
+ NULL)) {
+ snmp_log(LOG_ERR,"Authentication by public key failed!\n");
+ goto shutdown;
+ } else {
+ DEBUGMSG(("ssh",
+ "\tAuthentication by public key succeeded.\n"));
+ }
+ } else {
+ snmp_log(LOG_ERR,"Authentication by public key failed!\n");
+ goto shutdown;
+ }
+
+ /* we've now authenticated both sides; contining onward ... */
+
+ /* Request a channel */
+ if (!(addr_pair->channel =
+ libssh2_channel_open_session(addr_pair->session))) {
+ snmp_log(LOG_ERR, "Unable to open a session\n");
+ goto shutdown;
+ }
+
+ /* Request a terminal with 'vanilla' terminal emulation
+ * See /etc/termcap for more options
+ */
+ /* XXX: needed? doubt it */
+/* if (libssh2_channel_request_pty(addr_pair->channel, "vanilla")) { */
+/* snmp_log(LOG_ERR, "Failed requesting pty\n"); */
+/* goto shutdown; */
+/* } */
+ if (libssh2_channel_subsystem(addr_pair->channel, "snmp")) {
+ snmp_log(LOG_ERR, "Failed to request the ssh 'snmp' subsystem\n");
+ goto shutdown;
+ }
+ }
+
+ DEBUGMSG(("ssh","Opened connection.\n"));
+ /*
+ * Message size is not limited by this transport (hence msgMaxSize
+ * is equal to the maximum legal size of an SNMP message).
+ */
+
+ t->msgMaxSize = 0x7fffffff;
+ t->f_recv = netsnmp_ssh_recv;
+ t->f_send = netsnmp_ssh_send;
+ t->f_close = netsnmp_ssh_close;
+ t->f_accept = netsnmp_ssh_accept;
+ t->f_fmtaddr = netsnmp_ssh_fmtaddr;
+
+ return t;
+}
+
+
+
+netsnmp_transport *
+netsnmp_ssh_create_tstring(const char *str, int local,
+ const char *default_target)
+{
+ struct sockaddr_in addr;
+
+ if (netsnmp_sockaddr_in2(&addr, str, default_target)) {
+ return netsnmp_ssh_transport(&addr, local);
+ } else {
+ return NULL;
+ }
+}
+
+
+
+netsnmp_transport *
+netsnmp_ssh_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ struct sockaddr_in addr;
+
+ if (o_len == 6) {
+ unsigned short porttmp = (o[4] << 8) + o[5];
+ addr.sin_family = AF_INET;
+ memcpy((u_char *) & (addr.sin_addr.s_addr), o, 4);
+ addr.sin_port = htons(porttmp);
+ return netsnmp_ssh_transport(&addr, local);
+ }
+ return NULL;
+}
+
+void
+sshdomain_parse_socket(const char *token, char *cptr)
+{
+ char *socket_perm, *socket_user, *socket_group;
+ int uid = -1;
+ int gid = -1;
+ int s_perm = -1;
+ char *st;
+
+ DEBUGMSGTL(("ssh/config", "parsing socket info: %s\n", cptr));
+ socket_perm = strtok_r(cptr, " \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_LIBRARY_ID,
+ NETSNMP_DS_SSHDOMAIN_SOCK_PERM, s_perm);
+ DEBUGMSGTL(("ssh/config", "socket permissions: %o (%d)\n",
+ s_perm, s_perm));
+ }
+ /*
+ * Try to handle numeric UIDs or user names for the socket owner
+ */
+ if (socket_user) {
+ uid = netsnmp_str_to_uid(socket_user);
+ if ( uid != 0 )
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_SSHDOMAIN_SOCK_USER, uid);
+ DEBUGMSGTL(("ssh/config", "socket owner: %s (%d)\n",
+ socket_user, uid));
+ }
+
+ /*
+ * and similarly for the socket group ownership
+ */
+ if (socket_group) {
+ gid = netsnmp_str_to_gid(socket_group);
+ if ( gid != 0 )
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_SSHDOMAIN_SOCK_GROUP, gid);
+ DEBUGMSGTL(("ssh/config", "socket group: %s (%d)\n",
+ socket_group, gid));
+ }
+}
+
+void
+netsnmp_ssh_ctor(void)
+{
+ sshDomain.name = netsnmp_snmpSSHDomain;
+ sshDomain.name_length = netsnmp_snmpSSHDomain_len;
+ sshDomain.prefix = (const char **)calloc(2, sizeof(char *));
+ sshDomain.prefix[0] = "ssh";
+
+ sshDomain.f_create_from_tstring = NULL;
+ sshDomain.f_create_from_tstring_new = netsnmp_ssh_create_tstring;
+ sshDomain.f_create_from_ostring = netsnmp_ssh_create_ostring;
+
+ register_config_handler("snmp", "sshtosnmpsocketperms",
+ &sshdomain_parse_socket, NULL,
+ "socketperms [username [groupname]]");
+
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "sshtosnmpsocket",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SSHTOSNMP_SOCKET);
+
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "sshusername",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SSH_USERNAME);
+
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "sshpublickey",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SSH_PUBKEY);
+
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "sshprivatekey",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SSH_PRIVKEY);
+
+ DEBUGMSGTL(("ssh", "registering the ssh domain\n"));
+ netsnmp_tdomain_register(&sshDomain);
+}
+
+
diff --git a/snmplib/transports/snmpSTDDomain.c b/snmplib/transports/snmpSTDDomain.c
new file mode 100644
index 0000000..0a1c3f9
--- /dev/null
+++ b/snmplib/transports/snmpSTDDomain.c
@@ -0,0 +1,285 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/library/snmpSTDDomain.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <signal.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
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/tools.h>
+
+oid netsnmp_snmpSTDDomain[] = { TRANSPORT_DOMAIN_STD_IP };
+static netsnmp_tdomain stdDomain;
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+static char *
+netsnmp_std_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ char *buf;
+ DEBUGMSGTL(("domain:std","formatting addr. data=%p\n",t->data));
+ if (t->data) {
+ netsnmp_std_data *data = (netsnmp_std_data*)t->data;
+ buf = (char*)malloc(SNMP_MAXBUF_MEDIUM);
+ if (!buf)
+ return strdup("STDInOut");
+ snprintf(buf, SNMP_MAXBUF_MEDIUM, "STD:%s", data->prog);
+ DEBUGMSGTL(("domain:std"," formatted:=%s\n",buf));
+ return buf;
+ }
+ return strdup("STDInOut");
+}
+
+
+
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+static int
+netsnmp_std_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+
+ DEBUGMSGTL(("domain:std","recv on sock %d. data=%p\n",t->sock, t->data));
+ while (rc < 0) {
+ rc = read(t->sock, buf, size);
+ DEBUGMSGTL(("domain:std"," bytes: %d.\n", rc));
+ if (rc < 0 && errno != EINTR) {
+ DEBUGMSGTL(("netsnmp_std", " read on fd %d failed: %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ break;
+ }
+ if (rc == 0) {
+ /* 0 input is probably bad since we selected on it */
+ return -1;
+ }
+ DEBUGMSGTL(("netsnmp_std", "read on stdin got %d bytes\n", rc));
+ }
+
+ return rc;
+}
+
+
+
+static int
+netsnmp_std_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+
+ DEBUGMSGTL(("domain:std","send on sock. data=%p\n", t->data));
+ while (rc < 0) {
+ if (t->data) {
+ netsnmp_std_data *data = (netsnmp_std_data*)t->data;
+ rc = write(data->outfd, buf, size);
+ } else {
+ /* straight to stdout */
+ rc = write(1, buf, size);
+ }
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ return rc;
+}
+
+static int
+netsnmp_std_close(netsnmp_transport *t)
+{
+ DEBUGMSGTL(("domain:std","close. data=%p\n", t->data));
+ if (t->data) {
+ netsnmp_std_data *data = (netsnmp_std_data*)t->data;
+ close(data->outfd);
+ close(t->sock);
+
+ /* kill the child too */
+ DEBUGMSGTL(("domain:std"," killing %d\n", data->childpid));
+ kill(data->childpid, SIGTERM);
+ sleep(1);
+ kill(data->childpid, SIGKILL);
+ /* XXX: set an alarm to kill harder the child */
+ } else {
+ /* close stdout/in */
+ close(1);
+ close(0);
+ }
+ return 0;
+}
+
+
+
+static int
+netsnmp_std_accept(netsnmp_transport *t)
+{
+ DEBUGMSGTL(("domain:std"," accept data=%p\n", t->data));
+ /* nothing to do here */
+ return 0;
+}
+
+/*
+ * Open a STDIN/STDOUT -based transport for SNMP.
+ */
+
+netsnmp_transport *
+netsnmp_std_transport(const char *instring, size_t instring_len,
+ const char *default_target)
+{
+ netsnmp_transport *t;
+
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (t == NULL) {
+ return NULL;
+ }
+
+ t->domain = netsnmp_snmpSTDDomain;
+ t->domain_length =
+ sizeof(netsnmp_snmpSTDDomain) / sizeof(netsnmp_snmpSTDDomain[0]);
+
+ t->sock = 0;
+ t->flags = NETSNMP_TRANSPORT_FLAG_STREAM | NETSNMP_TRANSPORT_FLAG_TUNNELED;
+
+ /*
+ * Message size is not limited by this transport (hence msgMaxSize
+ * is equal to the maximum legal size of an SNMP message).
+ */
+
+ t->msgMaxSize = 0x7fffffff;
+ t->f_recv = netsnmp_std_recv;
+ t->f_send = netsnmp_std_send;
+ t->f_close = netsnmp_std_close;
+ t->f_accept = netsnmp_std_accept;
+ t->f_fmtaddr = netsnmp_std_fmtaddr;
+
+ /*
+ * if instring is not null length, it specifies a path to a prog
+ * XXX: plus args
+ */
+ if (instring_len == 0 && default_target != NULL) {
+ instring = default_target;
+ instring_len = strlen(default_target);
+ }
+
+ if (instring_len != 0) {
+ int infd[2], outfd[2]; /* sockets to and from the client */
+ int childpid;
+
+ if (pipe(infd) || pipe(outfd)) {
+ snmp_log(LOG_ERR,
+ "Failed to create needed pipes for a STD transport");
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ childpid = fork();
+ /* parentpid => childpid */
+ /* infd[1] => infd[0] */
+ /* outfd[0] <= outfd[1] */
+
+ if (childpid) {
+ netsnmp_std_data *data;
+
+ /* we're in the parent */
+ close(infd[0]);
+ close(outfd[1]);
+
+ data = SNMP_MALLOC_TYPEDEF(netsnmp_std_data);
+ if (!data) {
+ snmp_log(LOG_ERR, "snmpSTDDomain: malloc failed");
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ t->data = data;
+ t->data_length = sizeof(netsnmp_std_data);
+ t->sock = outfd[0];
+ data->prog = strdup(instring);
+ data->outfd = infd[1];
+ data->childpid = childpid;
+ DEBUGMSGTL(("domain:std","parent. data=%p\n", t->data));
+ } else {
+ /* we're in the child */
+
+ /* close stdin */
+ close(0);
+ /* copy pipe output to stdout */
+ dup(infd[0]);
+
+ /* close stdout */
+ close(1);
+ /* copy pipe output to stdin */
+ dup(outfd[1]);
+
+ /* close all the pipes themselves */
+ close(infd[0]);
+ close(infd[1]);
+ close(outfd[0]);
+ close(outfd[1]);
+
+ /* call exec */
+ system(instring);
+ /* XXX: TODO: use exec form instead; needs args */
+ /* execv(instring, NULL); */
+ exit(0);
+
+ /* ack... we should never ever get here */
+ snmp_log(LOG_ERR, "STD transport returned after execv()\n");
+ }
+ }
+
+ return t;
+}
+
+netsnmp_transport *
+netsnmp_std_create_tstring(const char *instring, int local,
+ const char *default_target)
+{
+ return netsnmp_std_transport(instring, strlen(instring), default_target);
+}
+
+netsnmp_transport *
+netsnmp_std_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ return netsnmp_std_transport((const char*)o, o_len, NULL);
+}
+
+void
+netsnmp_std_ctor(void)
+{
+ stdDomain.name = netsnmp_snmpSTDDomain;
+ stdDomain.name_length = sizeof(netsnmp_snmpSTDDomain) / sizeof(oid);
+ stdDomain.prefix = (const char **)calloc(2, sizeof(char *));
+ stdDomain.prefix[0] = "std";
+
+ stdDomain.f_create_from_tstring = NULL;
+ stdDomain.f_create_from_tstring_new = netsnmp_std_create_tstring;
+ stdDomain.f_create_from_ostring = netsnmp_std_create_ostring;
+
+ netsnmp_tdomain_register(&stdDomain);
+}
diff --git a/snmplib/transports/snmpSocketBaseDomain.c b/snmplib/transports/snmpSocketBaseDomain.c
new file mode 100644
index 0000000..3fb6632
--- /dev/null
+++ b/snmplib/transports/snmpSocketBaseDomain.c
@@ -0,0 +1,362 @@
+/**
+ * @file snmpSocketBaseDomain.c
+ *
+ * @brief Socket support functions.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+
+#include <stddef.h>
+#include <stdio.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <ctype.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <errno.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/default_store.h>
+#include <net-snmp/library/system.h>
+#include <net-snmp/library/snmp_assert.h>
+
+/* all sockets pretty much close the same way */
+int netsnmp_socketbase_close(netsnmp_transport *t) {
+ int rc = -1;
+ if (t->sock >= 0) {
+#ifndef HAVE_CLOSESOCKET
+ rc = close(t->sock);
+#else
+ rc = closesocket(t->sock);
+#endif
+ t->sock = -1;
+ }
+ return rc;
+}
+
+/*
+ * find largest possible buffer between current size and specified size.
+ *
+ * Try to maximize the current buffer of type "optname"
+ * to the maximum allowable size by the OS (as close to
+ * size as possible)
+ */
+static int
+_sock_buffer_maximize(int s, int optname, const char *buftype, int size)
+{
+ int curbuf = 0;
+ socklen_t curbuflen = sizeof(int);
+ int lo, mid, hi;
+
+ /*
+ * First we need to determine our current buffer
+ */
+ if ((getsockopt(s, SOL_SOCKET, optname, (void *) &curbuf,
+ &curbuflen) == 0)
+ && (curbuflen == sizeof(int))) {
+
+ DEBUGMSGTL(("verbose:socket:buffer:max", "Current %s is %d\n",
+ buftype, curbuf));
+
+ /*
+ * Let's not be stupid ... if we were asked for less than what we
+ * already have, then forget about it
+ */
+ if (size <= curbuf) {
+ DEBUGMSGTL(("verbose:socket:buffer:max",
+ "Requested %s <= current buffer\n", buftype));
+ return curbuf;
+ }
+
+ /*
+ * Do a binary search the optimal buffer within 1k of the point of
+ * failure. This is rather bruteforce, but simple
+ */
+ hi = size;
+ lo = curbuf;
+
+ while (hi - lo > 1024) {
+ mid = (lo + hi) / 2;
+ if (setsockopt(s, SOL_SOCKET, optname, (void *) &mid,
+ sizeof(int)) == 0) {
+ lo = mid; /* Success: search between mid and hi */
+ } else {
+ hi = mid; /* Failed: search between lo and mid */
+ }
+ }
+
+ /*
+ * Now print if this optimization helped or not
+ */
+ if (getsockopt(s,SOL_SOCKET, optname, (void *) &curbuf,
+ &curbuflen) == 0) {
+ DEBUGMSGTL(("socket:buffer:max",
+ "Maximized %s: %d\n",buftype, curbuf));
+ }
+ } else {
+ /*
+ * There is really not a lot we can do anymore.
+ * If the OS doesn't give us the current buffer, then what's the
+ * point in trying to make it better
+ */
+ DEBUGMSGTL(("socket:buffer:max", "Get %s failed ... giving up!\n",
+ buftype));
+ curbuf = -1;
+ }
+
+ return curbuf;
+}
+
+
+static const char *
+_sock_buf_type_get(int optname, int local)
+{
+ if (optname == SO_SNDBUF) {
+ if (local)
+ return "server send buffer";
+ else
+ return "client send buffer";
+ } else if (optname == SO_RCVBUF) {
+ if (local)
+ return "server receive buffer";
+ else
+ return "client receive buffer";
+ }
+
+ return "unknown buffer";
+}
+
+/*
+ *
+ * Get the requested buffersize, based on
+ * - sockettype : client (local = 0) or server (local = 1)
+ * - buffertype : send (optname = SO_SNDBUF) or recv (SO_RCVBUF)
+ *
+ * In case a compile time buffer was specified, then use that one
+ * if there was no runtime configuration override
+ */
+static int
+_sock_buffer_size_get(int optname, int local, const char **buftype)
+{
+ int size;
+
+ if (NULL != buftype)
+ *buftype = _sock_buf_type_get(optname, local);
+
+ if (optname == SO_SNDBUF) {
+ if (local) {
+ size = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SERVERSENDBUF);
+#ifdef NETSNMP_DEFAULT_SERVER_SEND_BUF
+ if (size <= 0)
+ size = NETSNMP_DEFAULT_SERVER_SEND_BUF;
+#endif
+ } else {
+ size = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CLIENTSENDBUF);
+#ifdef NETSNMP_DEFAULT_CLIENT_SEND_BUF
+ if (size <= 0)
+ size = NETSNMP_DEFAULT_CLIENT_SEND_BUF;
+#endif
+ }
+ } else if (optname == SO_RCVBUF) {
+ if (local) {
+ size = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SERVERRECVBUF);
+#ifdef NETSNMP_DEFAULT_SERVER_RECV_BUF
+ if (size <= 0)
+ size = NETSNMP_DEFAULT_SERVER_RECV_BUF;
+#endif
+ } else {
+ size = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CLIENTRECVBUF);
+#ifdef NETSNMP_DEFAULT_CLIENT_RECV_BUF
+ if (size <= 0)
+ size = NETSNMP_DEFAULT_CLIENT_RECV_BUF;
+#endif
+ }
+ } else {
+ size = 0;
+ }
+
+ DEBUGMSGTL(("socket:buffer", "Requested %s is %d\n",
+ (buftype) ? *buftype : "unknown buffer", size));
+
+ return(size);
+}
+
+/*
+ * set socket buffer size
+ *
+ * @param ss : socket
+ * @param optname: SO_SNDBUF or SO_RCVBUF
+ * @param local : 1 for server, 0 for client
+ * @param reqbuf : requested size, or 0 for default
+ *
+ * @retval -1 : error
+ * @retval >0 : new buffer size
+ */
+int
+netsnmp_sock_buffer_set(int s, int optname, int local, int size)
+{
+#if ! defined(SO_SNDBUF) && ! defined(SO_RCVBUF)
+ DEBUGMSGTL(("socket:buffer", "Changing socket buffer is not supported\n"));
+ return -1;
+#else
+ const char *buftype;
+ int curbuf = 0;
+ socklen_t curbuflen = sizeof(int);
+
+# ifndef SO_SNDBUF
+ if (SO_SNDBUF == optname) {
+ DEBUGMSGTL(("socket:buffer",
+ "Changing socket send buffer is not supported\n"));
+ return -1;
+ }
+# endif /*SO_SNDBUF */
+# ifndef SO_RCVBUF
+ if (SO_RCVBUF == optname) {
+ DEBUGMSGTL(("socket:buffer",
+ "Changing socket receive buffer is not supported\n"));
+ return -1;
+ }
+# endif /*SO_RCVBUF */
+
+ /*
+ * What is the requested buffer size ?
+ */
+ if (0 == size)
+ size = _sock_buffer_size_get(optname, local, &buftype);
+ else {
+ buftype = _sock_buf_type_get(optname, local);
+ DEBUGMSGT(("verbose:socket:buffer", "Requested %s is %d\n",
+ buftype, size));
+ }
+
+ if ((getsockopt(s, SOL_SOCKET, optname, (void *) &curbuf,
+ &curbuflen) == 0)
+ && (curbuflen == sizeof(int))) {
+
+ DEBUGMSGT(("verbose:socket:buffer", "Original %s is %d\n",
+ buftype, curbuf));
+ if (curbuf >= size) {
+ DEBUGMSGT(("verbose:socket:buffer",
+ "New %s size is smaller than original!\n", buftype));
+ }
+ }
+
+ /*
+ * If the buffersize was not specified or it was a negative value
+ * then don't change the OS buffers at all
+ */
+ if (size <= 0) {
+ DEBUGMSGT(("socket:buffer",
+ "%s not valid or not specified; using OS default(%d)\n",
+ buftype,curbuf));
+ return curbuf;
+ }
+
+ /*
+ * Try to set the requested send buffer
+ */
+ if (setsockopt(s, SOL_SOCKET, optname, (void *) &size, sizeof(int)) == 0) {
+ /*
+ * Because some platforms lie about the actual buffer that has been
+ * set (Linux will always say it worked ...), we print some
+ * diagnostic output for debugging
+ */
+ DEBUGIF("socket:buffer") {
+ DEBUGMSGT(("socket:buffer", "Set %s to %d\n",
+ buftype, size));
+ if ((getsockopt(s, SOL_SOCKET, optname, (void *) &curbuf,
+ &curbuflen) == 0)
+ && (curbuflen == sizeof(int))) {
+
+ DEBUGMSGT(("verbose:socket:buffer",
+ "Now %s is %d\n", buftype, curbuf));
+ }
+ }
+ /*
+ * If the new buffer is smaller than the size we requested, we will
+ * try to increment the new buffer with 1k increments
+ * (this will sometime allow us to reach a more optimal buffer.)
+ * For example : On Solaris, if the max OS buffer is 100k and you
+ * request 110k, you end up with the default 8k :-(
+ */
+ if (curbuf < size) {
+ curbuf = _sock_buffer_maximize(s, optname, buftype, size);
+ if(-1 != curbuf)
+ size = curbuf;
+ }
+
+ } else {
+ /*
+ * Obviously changing the buffer failed, most like like because we
+ * requested a buffer greater than the OS limit.
+ * Therefore we need to search for an optimal buffer that is close
+ * enough to the point of failure.
+ * This will allow us to reach a more optimal buffer.
+ * For example : On Solaris, if the max OS buffer is 100k and you
+ * request 110k, you end up with the default 8k :-(
+ * After this quick seach we would get 1k close to 100k (the max)
+ */
+ DEBUGMSGTL(("socket:buffer", "couldn't set %s to %d\n",
+ buftype, size));
+
+ curbuf = _sock_buffer_maximize(s, optname, buftype, size);
+ if(-1 != curbuf)
+ size = curbuf;
+ }
+
+ return size;
+#endif
+}
+
+
+/**
+ * Sets the mode of a socket for all subsequent I/O operations.
+ *
+ * @param[in] sock Socket descriptor (Unix) or socket handle (Windows).
+ * @param[in] non_blocking_mode I/O mode: non-zero selects non-blocking mode;
+ * zero selects blocking mode.
+ *
+ * @return zero upon success and a negative value upon error.
+ */
+int
+netsnmp_set_non_blocking_mode(int sock, int non_blocking_mode)
+{
+#ifdef WIN32
+ u_long arg;
+
+ arg = non_blocking_mode;
+ return ioctlsocket(sock, FIONBIO, &arg);
+#else
+ int sockflags;
+
+ if ((sockflags = fcntl(sock, F_GETFL, 0)) >= 0) {
+ return fcntl(sock, F_SETFL,
+ non_blocking_mode ? sockflags | O_NONBLOCK
+ : sockflags & ~O_NONBLOCK);
+ } else
+ return -1;
+#endif
+}
diff --git a/snmplib/transports/snmpTCPBaseDomain.c b/snmplib/transports/snmpTCPBaseDomain.c
new file mode 100644
index 0000000..fc70dba
--- /dev/null
+++ b/snmplib/transports/snmpTCPBaseDomain.c
@@ -0,0 +1,99 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpTCPBaseDomain.h>
+
+#include <stdio.h>
+#include <sys/types.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
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+
+#include <net-snmp/library/snmp_transport.h>
+
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+int netsnmp_tcpbase_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+
+ if (t != NULL && t->sock >= 0) {
+ while (rc < 0) {
+ rc = recvfrom(t->sock, buf, size, 0, NULL, NULL);
+ if (rc < 0 && errno != EINTR) {
+ DEBUGMSGTL(("netsnmp_tcpbase", "recv fd %d err %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ break;
+ }
+ DEBUGMSGTL(("netsnmp_tcpbase", "recv fd %d got %d bytes\n",
+ t->sock, rc));
+ }
+ } else {
+ return -1;
+ }
+
+ if (opaque != NULL && olength != NULL) {
+ if (t->data_length > 0) {
+ if ((*opaque = malloc(t->data_length)) != NULL) {
+ memcpy(*opaque, t->data, t->data_length);
+ *olength = t->data_length;
+ } else {
+ *olength = 0;
+ }
+ } else {
+ *opaque = NULL;
+ *olength = 0;
+ }
+ }
+
+ return rc;
+}
+
+int netsnmp_tcpbase_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength) {
+ int rc = -1;
+
+ if (t != NULL && t->sock >= 0) {
+ while (rc < 0) {
+ rc = sendto(t->sock, buf, size, 0, NULL, 0);
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ }
+ return rc;
+}
diff --git a/snmplib/transports/snmpTCPDomain.c b/snmplib/transports/snmpTCPDomain.c
new file mode 100644
index 0000000..b8bdba4
--- /dev/null
+++ b/snmplib/transports/snmpTCPDomain.c
@@ -0,0 +1,351 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpTCPDomain.h>
+
+#include <stdio.h>
+#include <sys/types.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
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+
+#include <net-snmp/library/snmpIPv4BaseDomain.h>
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+#include <net-snmp/library/snmpTCPBaseDomain.h>
+#include <net-snmp/library/tools.h>
+
+/*
+ * needs to be in sync with the definitions in snmplib/snmpUDPDomain.c
+ * and perl/agent/agent.xs
+ */
+typedef netsnmp_indexed_addr_pair netsnmp_udp_addr_pair;
+
+oid netsnmp_snmpTCPDomain[] = { TRANSPORT_DOMAIN_TCP_IP };
+static netsnmp_tdomain tcpDomain;
+
+/*
+ * Not static since it is needed here as well as in snmpUDPDomain, but not
+ * public either
+ */
+int
+netsnmp_sockaddr_in2(struct sockaddr_in *addr,
+ const char *inpeername, const char *default_target);
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+static char *
+netsnmp_tcp_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ return netsnmp_ipv4_fmtaddr("TCP", t, data, len);
+}
+
+static int
+netsnmp_tcp_accept(netsnmp_transport *t)
+{
+ struct sockaddr *farend = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;
+ int newsock = -1;
+ socklen_t farendlen = sizeof(netsnmp_udp_addr_pair);
+
+ addr_pair = (netsnmp_udp_addr_pair *)malloc(farendlen);
+ if (addr_pair == NULL) {
+ /*
+ * Indicate that the acceptance of this socket failed.
+ */
+ DEBUGMSGTL(("netsnmp_tcp", "accept: malloc failed\n"));
+ return -1;
+ }
+ memset(addr_pair, 0, sizeof *addr_pair);
+ farend = &addr_pair->remote_addr.sa;
+
+ if (t != NULL && t->sock >= 0) {
+ newsock = accept(t->sock, farend, &farendlen);
+
+ if (newsock < 0) {
+ DEBUGMSGTL(("netsnmp_tcp", "accept failed rc %d errno %d \"%s\"\n",
+ newsock, errno, strerror(errno)));
+ free(addr_pair);
+ return newsock;
+ }
+
+ if (t->data != NULL) {
+ free(t->data);
+ }
+
+ t->data = addr_pair;
+ t->data_length = sizeof(netsnmp_udp_addr_pair);
+ DEBUGIF("netsnmp_tcp") {
+ char *str = netsnmp_tcp_fmtaddr(NULL, farend, farendlen);
+ DEBUGMSGTL(("netsnmp_tcp", "accept succeeded (from %s)\n", str));
+ free(str);
+ }
+
+ /*
+ * Try to make the new socket blocking.
+ */
+
+ if (netsnmp_set_non_blocking_mode(newsock, FALSE) < 0)
+ DEBUGMSGTL(("netsnmp_tcp", "couldn't f_getfl of fd %d\n",
+ newsock));
+
+ /*
+ * Allow user to override the send and receive buffers. Default is
+ * to use os default. Don't worry too much about errors --
+ * just plough on regardless.
+ */
+ netsnmp_sock_buffer_set(newsock, SO_SNDBUF, 1, 0);
+ netsnmp_sock_buffer_set(newsock, SO_RCVBUF, 1, 0);
+
+ return newsock;
+ } else {
+ free(addr_pair);
+ return -1;
+ }
+}
+
+
+
+/*
+ * Open a TCP-based transport for SNMP. Local is TRUE if addr is the local
+ * address to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote address to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_tcp_transport(struct sockaddr_in *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;
+ int rc = 0;
+
+#ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+ if (addr == NULL || addr->sin_family != AF_INET) {
+ return NULL;
+ }
+
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (t == NULL) {
+ return NULL;
+ }
+
+ addr_pair = (netsnmp_udp_addr_pair *)malloc(sizeof(netsnmp_udp_addr_pair));
+ if (addr_pair == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memset(addr_pair, 0, sizeof *addr_pair);
+ t->data = addr_pair;
+ t->data_length = sizeof(netsnmp_udp_addr_pair);
+ memcpy(&(addr_pair->remote_addr), addr, sizeof(struct sockaddr_in));
+
+ t->domain = netsnmp_snmpTCPDomain;
+ t->domain_length =
+ sizeof(netsnmp_snmpTCPDomain) / sizeof(netsnmp_snmpTCPDomain[0]);
+
+ t->sock = socket(PF_INET, SOCK_STREAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ t->flags = NETSNMP_TRANSPORT_FLAG_STREAM;
+
+ if (local) {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ int opt = 1;
+
+ /*
+ * This session is inteneded as a server, so we must bind to the given
+ * IP address (which may include an interface address, or could be
+ * INADDR_ANY, but will always include a port number.
+ */
+
+ t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN;
+ t->local = (u_char *)malloc(6);
+ if (t->local == NULL) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->local, (u_char *) & (addr->sin_addr.s_addr), 4);
+ t->local[4] = (htons(addr->sin_port) & 0xff00) >> 8;
+ t->local[5] = (htons(addr->sin_port) & 0x00ff) >> 0;
+ t->local_length = 6;
+
+ /*
+ * We should set SO_REUSEADDR too.
+ */
+
+ setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt,
+ sizeof(opt));
+
+ rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr));
+ if (rc != 0) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /*
+ * Since we are going to be letting select() tell us when connections
+ * are ready to be accept()ed, we need to make the socket non-blocking
+ * to avoid the race condition described in W. R. Stevens, ``Unix
+ * Network Programming Volume I Second Edition'', pp. 422--4, which
+ * could otherwise wedge the agent.
+ */
+
+ netsnmp_set_non_blocking_mode(t->sock, TRUE);
+
+ /*
+ * Now sit here and wait for connections to arrive.
+ */
+
+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
+ if (rc != 0) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /*
+ * no buffer size on listen socket - doesn't make sense
+ */
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ } else {
+ t->remote = (u_char *)malloc(6);
+ if (t->remote == NULL) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->remote, (u_char *) & (addr->sin_addr.s_addr), 4);
+ t->remote[4] = (htons(addr->sin_port) & 0xff00) >> 8;
+ t->remote[5] = (htons(addr->sin_port) & 0x00ff) >> 0;
+ t->remote_length = 6;
+
+ /*
+ * This is a client-type session, so attempt to connect to the far
+ * end. We don't go non-blocking here because it's not obvious what
+ * you'd then do if you tried to do snmp_sends before the connection
+ * had completed. So this can block.
+ */
+
+ rc = connect(t->sock, (struct sockaddr *)addr,
+ sizeof(struct sockaddr));
+
+ if (rc < 0) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /*
+ * Allow user to override the send and receive buffers. Default is
+ * to use os default. Don't worry too much about errors --
+ * just plough on regardless.
+ */
+ netsnmp_sock_buffer_set(t->sock, SO_SNDBUF, local, 0);
+ netsnmp_sock_buffer_set(t->sock, SO_RCVBUF, local, 0);
+ }
+
+ /*
+ * Message size is not limited by this transport (hence msgMaxSize
+ * is equal to the maximum legal size of an SNMP message).
+ */
+
+ t->msgMaxSize = 0x7fffffff;
+ t->f_recv = netsnmp_tcpbase_recv;
+ t->f_send = netsnmp_tcpbase_send;
+ t->f_close = netsnmp_socketbase_close;
+ t->f_accept = netsnmp_tcp_accept;
+ t->f_fmtaddr = netsnmp_tcp_fmtaddr;
+
+ return t;
+}
+
+
+
+netsnmp_transport *
+netsnmp_tcp_create_tstring(const char *str, int local,
+ const char *default_target)
+{
+ struct sockaddr_in addr;
+
+ if (netsnmp_sockaddr_in2(&addr, str, default_target)) {
+ return netsnmp_tcp_transport(&addr, local);
+ } else {
+ return NULL;
+ }
+}
+
+
+
+netsnmp_transport *
+netsnmp_tcp_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ struct sockaddr_in addr;
+
+ if (o_len == 6) {
+ unsigned short porttmp = (o[4] << 8) + o[5];
+ addr.sin_family = AF_INET;
+ memcpy((u_char *) & (addr.sin_addr.s_addr), o, 4);
+ addr.sin_port = htons(porttmp);
+ return netsnmp_tcp_transport(&addr, local);
+ }
+ return NULL;
+}
+
+
+
+void
+netsnmp_tcp_ctor(void)
+{
+ tcpDomain.name = netsnmp_snmpTCPDomain;
+ tcpDomain.name_length = sizeof(netsnmp_snmpTCPDomain) / sizeof(oid);
+ tcpDomain.prefix = (const char **)calloc(2, sizeof(char *));
+ tcpDomain.prefix[0] = "tcp";
+
+ tcpDomain.f_create_from_tstring = NULL;
+ tcpDomain.f_create_from_tstring_new = netsnmp_tcp_create_tstring;
+ tcpDomain.f_create_from_ostring = netsnmp_tcp_create_ostring;
+
+ netsnmp_tdomain_register(&tcpDomain);
+}
diff --git a/snmplib/transports/snmpTCPIPv6Domain.c b/snmplib/transports/snmpTCPIPv6Domain.c
new file mode 100644
index 0000000..3c96856
--- /dev/null
+++ b/snmplib/transports/snmpTCPIPv6Domain.c
@@ -0,0 +1,374 @@
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpTCPIPv6Domain.h>
+
+#include <stdio.h>
+#include <sys/types.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
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+#include <net-snmp/library/snmpTCPBaseDomain.h>
+#include <net-snmp/library/tools.h>
+
+#include "inet_ntop.h"
+
+oid netsnmp_TCPIPv6Domain[] = { TRANSPORT_DOMAIN_TCP_IPV6 };
+static netsnmp_tdomain tcp6Domain;
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+static char *
+netsnmp_tcp6_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ return netsnmp_ipv6_fmtaddr("TCP/IPv6", t, data, len);
+}
+
+static int
+netsnmp_tcp6_accept(netsnmp_transport *t)
+{
+ struct sockaddr_in6 *farend = NULL;
+ int newsock = -1;
+ socklen_t farendlen = sizeof(struct sockaddr_in6);
+
+ farend = (struct sockaddr_in6 *) malloc(sizeof(struct sockaddr_in6));
+
+ if (farend == NULL) {
+ /*
+ * Indicate that the acceptance of this socket failed.
+ */
+ DEBUGMSGTL(("netsnmp_tcp6", "accept: malloc failed\n"));
+ return -1;
+ }
+
+ if (t != NULL && t->sock >= 0) {
+ newsock = accept(t->sock, (struct sockaddr *) farend, &farendlen);
+
+ if (newsock < 0) {
+ DEBUGMSGTL(("netsnmp_tcp6","accept failed rc %d errno %d \"%s\"\n",
+ newsock, errno, strerror(errno)));
+ free(farend);
+ return newsock;
+ }
+
+ if (t->data != NULL) {
+ free(t->data);
+ }
+
+ t->data = farend;
+ t->data_length = farendlen;
+ DEBUGIF("netsnmp_tcp6") {
+ char *str = netsnmp_tcp6_fmtaddr(NULL, farend, farendlen);
+ DEBUGMSGTL(("netsnmp_tcp6", "accept succeeded (from %s)\n", str));
+ free(str);
+ }
+
+ /*
+ * Try to make the new socket blocking.
+ */
+
+ if (netsnmp_set_non_blocking_mode(newsock, FALSE) < 0)
+ DEBUGMSGTL(("netsnmp_tcp6",
+ "accept: couldn't f_getfl of fd %d\n", newsock));
+
+ /*
+ * Allow user to override the send and receive buffers. Default is
+ * to use os default. Don't worry too much about errors --
+ * just plough on regardless.
+ */
+ netsnmp_sock_buffer_set(newsock, SO_SNDBUF, 1, 0);
+ netsnmp_sock_buffer_set(newsock, SO_RCVBUF, 1, 0);
+
+ return newsock;
+ } else {
+ free(farend);
+ return -1;
+ }
+}
+
+
+
+/*
+ * Open a TCP/IPv6-based transport for SNMP. Local is TRUE if addr is the
+ * local address to bind to (i.e. this is a server-type session); otherwise
+ * addr is the remote address to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+ int rc = 0;
+
+#ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+ if (addr == NULL || addr->sin6_family != AF_INET6) {
+ return NULL;
+ }
+
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (t == NULL) {
+ return NULL;
+ }
+
+ DEBUGIF("netsnmp_tcp6") {
+ char *str = netsnmp_tcp6_fmtaddr(NULL, (void *)addr,
+ sizeof(struct sockaddr_in6));
+ DEBUGMSGTL(("netsnmp_tcp6", "open %s %s\n", local ? "local" : "remote",
+ str));
+ free(str);
+ }
+
+ t->data = malloc(sizeof(netsnmp_indexed_addr_pair));
+ if (t->data == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ t->data_length = sizeof(netsnmp_indexed_addr_pair);
+ memcpy(t->data, addr, sizeof(struct sockaddr_in6));
+
+ t->domain = netsnmp_TCPIPv6Domain;
+ t->domain_length = sizeof(netsnmp_TCPIPv6Domain) / sizeof(oid);
+
+ t->sock = socket(PF_INET6, SOCK_STREAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ t->flags = NETSNMP_TRANSPORT_FLAG_STREAM;
+
+ if (local) {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ int opt = 1;
+
+ /*
+ * This session is inteneded as a server, so we must bind on to the
+ * given IP address, which may include an interface address, or could
+ * be INADDR_ANY, but certainly includes a port number.
+ */
+
+#ifdef IPV6_V6ONLY
+ /* Try to restrict PF_INET6 socket to IPv6 communications only. */
+ {
+ int one=1;
+ if (setsockopt(t->sock, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&one, sizeof(one)) != 0) {
+ DEBUGMSGTL(("netsnmp_tcp6", "couldn't set IPV6_V6ONLY to %d bytes: %s\n", one, strerror(errno)));
+ }
+ }
+#endif
+
+ t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN;
+ t->local = (unsigned char*)malloc(18);
+ if (t->local == NULL) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->local, addr->sin6_addr.s6_addr, 16);
+ t->local[16] = (addr->sin6_port & 0xff00) >> 8;
+ t->local[17] = (addr->sin6_port & 0x00ff) >> 0;
+ t->local_length = 18;
+
+ /*
+ * We should set SO_REUSEADDR too.
+ */
+
+ setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof(opt));
+
+ rc = bind(t->sock, (struct sockaddr *) addr,
+ sizeof(struct sockaddr_in6));
+ if (rc != 0) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /*
+ * Since we are going to be letting select() tell us when connections
+ * are ready to be accept()ed, we need to make the socket n0n-blocking
+ * to avoid the race condition described in W. R. Stevens, ``Unix
+ * Network Programming Volume I Second Edition'', pp. 422--4, which
+ * could otherwise wedge the agent.
+ */
+
+ netsnmp_set_non_blocking_mode(t->sock, TRUE);
+
+ /*
+ * Now sit here and wait for connections to arrive.
+ */
+
+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
+ if (rc != 0) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /*
+ * no buffer size on listen socket - doesn't make sense
+ */
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ } else {
+ t->remote = (unsigned char*)malloc(18);
+ if (t->remote == NULL) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->remote, addr->sin6_addr.s6_addr, 16);
+ t->remote[16] = (addr->sin6_port & 0xff00) >> 8;
+ t->remote[17] = (addr->sin6_port & 0x00ff) >> 0;
+ t->remote_length = 18;
+
+ /*
+ * This is a client-type session, so attempt to connect to the far
+ * end. We don't go non-blocking here because it's not obvious what
+ * you'd then do if you tried to do snmp_sends before the connection
+ * had completed. So this can block.
+ */
+
+ rc = connect(t->sock, (struct sockaddr *) addr,
+ sizeof(struct sockaddr_in6));
+
+ DEBUGMSGTL(("netsnmp_tcp6", "connect returns %d\n", rc));
+
+ if (rc < 0) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /*
+ * Allow user to override the send and receive buffers. Default is
+ * to use os default. Don't worry too much about errors --
+ * just plough on regardless.
+ */
+ netsnmp_sock_buffer_set(t->sock, SO_SNDBUF, local, 0);
+ netsnmp_sock_buffer_set(t->sock, SO_RCVBUF, local, 0);
+ }
+
+ /*
+ * Message size is not limited by this transport (hence msgMaxSize
+ * is equal to the maximum legal size of an SNMP message).
+ */
+
+ t->msgMaxSize = 0x7fffffff;
+ t->f_recv = netsnmp_tcpbase_recv;
+ t->f_send = netsnmp_tcpbase_send;
+ t->f_close = netsnmp_socketbase_close;
+ t->f_accept = netsnmp_tcp6_accept;
+ t->f_fmtaddr = netsnmp_tcp6_fmtaddr;
+
+ return t;
+}
+
+/*
+ * Not extern but still defined in snmpUDPIPv6Domain.c
+ */
+extern int
+netsnmp_sockaddr_in6_2(struct sockaddr_in6*, const char*, const char*);
+
+netsnmp_transport *
+netsnmp_tcp6_create_tstring(const char *str, int local,
+ const char *default_target)
+{
+ struct sockaddr_in6 addr;
+
+ if (netsnmp_sockaddr_in6_2(&addr, str, default_target)) {
+ return netsnmp_tcp6_transport(&addr, local);
+ } else {
+ return NULL;
+ }
+}
+
+
+/*
+ * See:
+ *
+ * http://www.ietf.org/internet-drafts/draft-ietf-ops-taddress-mib-01.txt
+ *
+ * (or newer equivalent) for details of the TC which we are using for
+ * the mapping here.
+ */
+
+netsnmp_transport *
+netsnmp_tcp6_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ struct sockaddr_in6 addr;
+
+ if (o_len == 18) {
+ memset((u_char *) & addr, 0, sizeof(struct sockaddr_in6));
+ addr.sin6_family = AF_INET6;
+ memcpy((u_char *) & (addr.sin6_addr.s6_addr), o, 16);
+ addr.sin6_port = (o[16] << 8) + o[17];
+ return netsnmp_tcp6_transport(&addr, local);
+ }
+ return NULL;
+}
+
+
+void
+netsnmp_tcpipv6_ctor(void)
+{
+ tcp6Domain.name = netsnmp_TCPIPv6Domain;
+ tcp6Domain.name_length = sizeof(netsnmp_TCPIPv6Domain) / sizeof(oid);
+ tcp6Domain.f_create_from_tstring = NULL;
+ tcp6Domain.f_create_from_tstring_new = netsnmp_tcp6_create_tstring;
+ tcp6Domain.f_create_from_ostring = netsnmp_tcp6_create_ostring;
+ tcp6Domain.prefix = (const char**)calloc(4, sizeof(char *));
+ tcp6Domain.prefix[0] = "tcp6";
+ tcp6Domain.prefix[1] = "tcpv6";
+ tcp6Domain.prefix[2] = "tcpipv6";
+
+ netsnmp_tdomain_register(&tcp6Domain);
+}
+
+#endif /* NETSNMP_TRANSPORT_TCPIPV6_DOMAIN */
+
diff --git a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c
new file mode 100644
index 0000000..c54d6ad
--- /dev/null
+++ b/snmplib/transports/snmpTLSBaseDomain.c
@@ -0,0 +1,1183 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_require(cert_util)
+
+#include <net-snmp/library/snmpTLSBaseDomain.h>
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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>
+#include <ctype.h>
+
+/* OpenSSL Includes */
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/x509.h>
+#include <openssl/x509_vfy.h>
+#include <openssl/x509v3.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/library/cert_util.h>
+#include <net-snmp/library/snmp_openssl.h>
+#include <net-snmp/library/default_store.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/library/snmp_logging.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/snmp_assert.h>
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/snmp_secmod.h>
+#include <net-snmp/library/read_config.h>
+#include <net-snmp/library/system.h>
+
+#define LOGANDDIE(msg) do { snmp_log(LOG_ERR, "%s\n", msg); return 0; } while(0)
+
+int openssl_local_index;
+
+/* this is called during negotiationn */
+int verify_callback(int ok, X509_STORE_CTX *ctx) {
+ int err, depth;
+ char buf[1024], *fingerprint;
+ X509 *thecert;
+ netsnmp_cert *cert;
+ _netsnmp_verify_info *verify_info;
+ SSL *ssl;
+
+ thecert = X509_STORE_CTX_get_current_cert(ctx);
+ err = X509_STORE_CTX_get_error(ctx);
+ depth = X509_STORE_CTX_get_error_depth(ctx);
+
+ /* things to do: */
+
+ X509_NAME_oneline(X509_get_subject_name(thecert), buf, sizeof(buf));
+ fingerprint = netsnmp_openssl_cert_get_fingerprint(thecert, -1);
+ DEBUGMSGTL(("tls_x509:verify", "Cert: %s\n", buf));
+ DEBUGMSGTL(("tls_x509:verify", " fp: %s\n", fingerprint ?
+ fingerprint : "unknown"));
+
+ ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
+ verify_info = SSL_get_ex_data(ssl, openssl_local_index);
+
+ if (verify_info && ok && depth > 0) {
+ /* remember that a parent certificate has been marked as trusted */
+ verify_info->flags |= VRFY_PARENT_WAS_OK;
+ }
+
+ /* this ensures for self-signed certificates we have a valid
+ locally known fingerprint and then accept it */
+ if (!ok &&
+ (X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT == err ||
+ X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY == err ||
+ X509_V_ERR_CERT_UNTRUSTED == err ||
+ X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE == err ||
+ X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN == err)) {
+
+ cert = netsnmp_cert_find(NS_CERT_REMOTE_PEER, NS_CERTKEY_FINGERPRINT,
+ (void*)fingerprint);
+ if (cert)
+ DEBUGMSGTL(("tls_x509:verify", " Found locally: %s/%s\n",
+ cert->info.dir, cert->info.filename));
+
+
+ if (cert) {
+ DEBUGMSGTL(("tls_x509:verify", "verify_callback called with: ok=%d ctx=%p depth=%d err=%i:%s\n", ok, ctx, depth, err, X509_verify_cert_error_string(err)));
+ DEBUGMSGTL(("tls_x509:verify", " accepting matching fp of self-signed certificate found in: %s\n",
+ cert->info.filename));
+ SNMP_FREE(fingerprint);
+ return 1;
+ } else {
+ DEBUGMSGTL(("tls_x509:verify", " no matching fp found\n"));
+ /* log where we are and why called */
+ snmp_log(LOG_ERR, "tls verification failure: ok=%d ctx=%p depth=%d err=%i:%s\n", ok, ctx, depth, err, X509_verify_cert_error_string(err));
+ SNMP_FREE(fingerprint);
+ return 0;
+ }
+
+ if (0 == depth && verify_info &&
+ (verify_info->flags & VRFY_PARENT_WAS_OK)) {
+ DEBUGMSGTL(("tls_x509:verify", "verify_callback called with: ok=%d ctx=%p depth=%d err=%i:%s\n", ok, ctx, depth, err, X509_verify_cert_error_string(err)));
+ DEBUGMSGTL(("tls_x509:verify", " a parent was ok, so returning ok for this child certificate\n"));
+ SNMP_FREE(fingerprint);
+ return 1; /* we'll check the hostname later at this level */
+ }
+ }
+
+ if (0 == ok)
+ snmp_log(LOG_ERR, "tls verification failure: ok=%d ctx=%p depth=%d err=%i:%s\n", ok, ctx, depth, err, X509_verify_cert_error_string(err));
+ else
+ DEBUGMSGTL(("tls_x509:verify", "verify_callback called with: ok=%d ctx=%p depth=%d err=%i:%s\n", ok, ctx, depth, err, X509_verify_cert_error_string(err)));
+ DEBUGMSGTL(("tls_x509:verify", " returning the passed in value of %d\n",
+ ok));
+ SNMP_FREE(fingerprint);
+ return(ok);
+}
+
+#define VERIFIED_FINGERPRINT 0
+#define NO_FINGERPRINT_AVAILABLE 1
+#define FAILED_FINGERPRINT_VERIFY 2
+
+static int
+_netsnmp_tlsbase_verify_remote_fingerprint(X509 *remote_cert,
+ _netsnmpTLSBaseData *tlsdata,
+ int try_default) {
+
+ char *fingerprint;
+
+ fingerprint =
+ netsnmp_openssl_cert_get_fingerprint(remote_cert, -1);
+
+ if (!fingerprint) {
+ /* no peer cert */
+ snmp_log(LOG_ERR, "failed to get fingerprint of remote certificate\n");
+ return FAILED_FINGERPRINT_VERIFY;
+ }
+
+ if (!tlsdata->their_fingerprint && tlsdata->their_identity) {
+ /* we have an identity; try and find it's fingerprint */
+ netsnmp_cert *peer_cert;
+ peer_cert =
+ netsnmp_cert_find(NS_CERT_REMOTE_PEER, NS_CERTKEY_MULTIPLE,
+ tlsdata->their_identity);
+
+ if (peer_cert)
+ tlsdata->their_fingerprint =
+ netsnmp_openssl_cert_get_fingerprint(peer_cert->ocert, -1);
+ }
+
+ if (!tlsdata->their_fingerprint && try_default) {
+ /* try for the default instead */
+ netsnmp_cert *peer_cert;
+ peer_cert =
+ netsnmp_cert_find(NS_CERT_REMOTE_PEER, NS_CERTKEY_DEFAULT,
+ NULL);
+
+ if (peer_cert)
+ tlsdata->their_fingerprint =
+ netsnmp_openssl_cert_get_fingerprint(peer_cert->ocert, -1);
+ }
+
+ if (tlsdata->their_fingerprint) {
+ netsnmp_fp_lowercase_and_strip_colon(tlsdata->their_fingerprint);
+ if (0 != strcmp(tlsdata->their_fingerprint, fingerprint)) {
+ snmp_log(LOG_ERR, "The fingerprint from the remote side's certificate didn't match the expected\n");
+ snmp_log(LOG_ERR, " got %s, expected %s\n",
+ fingerprint, tlsdata->their_fingerprint);
+ free(fingerprint);
+ return FAILED_FINGERPRINT_VERIFY;
+ }
+ } else {
+ DEBUGMSGTL(("tls_x509:verify", "No fingerprint for the remote entity available to verify\n"));
+ free(fingerprint);
+ return NO_FINGERPRINT_AVAILABLE;
+ }
+
+ free(fingerprint);
+ return VERIFIED_FINGERPRINT;
+}
+
+/* this is called after the connection on the client side by us to check
+ other aspects about the connection */
+int
+netsnmp_tlsbase_verify_server_cert(SSL *ssl, _netsnmpTLSBaseData *tlsdata) {
+ /* XXX */
+ X509 *remote_cert;
+ char *check_name;
+ int ret;
+
+ netsnmp_assert_or_return(ssl != NULL, SNMPERR_GENERR);
+ netsnmp_assert_or_return(tlsdata != NULL, SNMPERR_GENERR);
+
+ if (NULL == (remote_cert = SSL_get_peer_certificate(ssl))) {
+ /* no peer cert */
+ DEBUGMSGTL(("tls_x509:verify",
+ "remote connection provided no certificate (yet)\n"));
+ return SNMPERR_TLS_NO_CERTIFICATE;
+ }
+
+ /* make sure that the fingerprint matches */
+ ret = _netsnmp_tlsbase_verify_remote_fingerprint(remote_cert, tlsdata, 1);
+ switch(ret) {
+ case VERIFIED_FINGERPRINT:
+ return SNMPERR_SUCCESS;
+
+ case FAILED_FINGERPRINT_VERIFY:
+ return SNMPERR_GENERR;
+
+ case NO_FINGERPRINT_AVAILABLE:
+ if (tlsdata->their_hostname && tlsdata->their_hostname[0] != '\0') {
+ GENERAL_NAMES *onames;
+ const GENERAL_NAME *oname = NULL;
+ int i, j;
+ int count;
+ char buf[SPRINT_MAX_LEN];
+ int is_wildcarded = 0;
+ char *compare_to;
+
+ /* see if the requested hostname has a wildcard prefix */
+ if (strncmp(tlsdata->their_hostname, "*.", 2) == 0) {
+ is_wildcarded = 1;
+ compare_to = tlsdata->their_hostname + 2;
+ } else {
+ compare_to = tlsdata->their_hostname;
+ }
+
+ /* if the hostname we were expecting to talk to matches
+ the cert, then we can accept this connection. */
+
+ /* check against the DNS subjectAltName */
+ onames = (GENERAL_NAMES *)X509_get_ext_d2i(remote_cert,
+ NID_subject_alt_name,
+ NULL, NULL );
+ if (NULL != onames) {
+ count = sk_GENERAL_NAME_num(onames);
+
+ for (i=0 ; i <count; ++i) {
+ oname = sk_GENERAL_NAME_value(onames, i);
+ if (GEN_DNS == oname->type) {
+
+ /* get the value */
+ ASN1_STRING_to_UTF8((unsigned char**)&check_name,
+ oname->d.ia5);
+
+ /* convert to lowercase for comparisons */
+ for (j = 0 ;
+ *check_name && j < sizeof(buf)-1;
+ ++check_name, ++j ) {
+ if (isascii(*check_name))
+ buf[j] = tolower(0xFF & *check_name);
+ }
+ if (j < sizeof(buf))
+ buf[j] = '\0';
+ check_name = buf;
+
+ if (is_wildcarded) {
+ /* we *only* allow passing till the first '.' */
+ /* ie *.example.com can't match a.b.example.com */
+ check_name = strchr(check_name, '.') + 1;
+ }
+
+ DEBUGMSGTL(("tls_x509:verify", "checking subjectAltname of dns:%s\n", check_name));
+ if (strcmp(compare_to, check_name) == 0) {
+
+ DEBUGMSGTL(("tls_x509:verify", "Successful match on a subjectAltname of dns:%s\n", check_name));
+ return SNMPERR_SUCCESS;
+ }
+ }
+ }
+ }
+
+ /* check the common name for a match */
+ check_name =
+ netsnmp_openssl_cert_get_commonName(remote_cert, NULL, NULL);
+
+ if (is_wildcarded) {
+ /* we *only* allow passing till the first '.' */
+ /* ie *.example.com can't match a.b.example.com */
+ check_name = strchr(check_name, '.') + 1;
+ }
+
+ if (strcmp(compare_to, check_name) == 0) {
+ DEBUGMSGTL(("tls_x509:verify", "Successful match on a common name of %s\n", check_name));
+ return SNMPERR_SUCCESS;
+ }
+
+ snmp_log(LOG_ERR, "No matching names in the certificate to match the expected %s\n", tlsdata->their_hostname);
+ return SNMPERR_GENERR;
+
+ }
+ /* XXX: check for hostname match instead */
+ snmp_log(LOG_ERR, "Can not verify a remote server identity without configuration\n");
+ return SNMPERR_GENERR;
+ }
+ DEBUGMSGTL(("tls_x509:verify", "shouldn't get here\n"));
+ return SNMPERR_GENERR;
+}
+
+/* this is called after the connection on the server side by us to check
+ the validity of the client's certificate */
+int
+netsnmp_tlsbase_verify_client_cert(SSL *ssl, _netsnmpTLSBaseData *tlsdata) {
+ /* XXX */
+ X509 *remote_cert;
+ int ret;
+
+ /* RFC5953: section 5.3.2, paragraph 1:
+ A (D)TLS server should accept new session connections from any client
+ that it is able to verify the client's credentials for. This is done
+ by authenticating the client's presented certificate through a
+ certificate path validation process (e.g. [RFC5280]) or through
+ certificate fingerprint verification using fingerprints configured in
+ the snmpTlstmCertToTSNTable. Afterward the server will determine the
+ identity of the remote entity using the following procedures.
+ */
+ /* Implementation notes:
+ + path validation is taken care of during the openssl verify
+ routines, our part of which is hanlded in verify_callback
+ above.
+ + fingerprint verification happens below.
+ */
+ if (NULL == (remote_cert = SSL_get_peer_certificate(ssl))) {
+ /* no peer cert */
+ DEBUGMSGTL(("tls_x509:verify",
+ "remote connection provided no certificate (yet)\n"));
+ return SNMPERR_TLS_NO_CERTIFICATE;
+ }
+
+ /* we don't force a known remote fingerprint for a client since we
+ will accept any certificate we know about (and later derive the
+ securityName from it and apply access control) */
+ ret = _netsnmp_tlsbase_verify_remote_fingerprint(remote_cert, tlsdata, 0);
+ switch(ret) {
+ case FAILED_FINGERPRINT_VERIFY:
+ DEBUGMSGTL(("tls_x509:verify", "failed to verify a client fingerprint\n"));
+ return SNMPERR_GENERR;
+
+ case NO_FINGERPRINT_AVAILABLE:
+ DEBUGMSGTL(("tls_x509:verify", "no known fingerprint available (not a failure case)\n"));
+ return SNMPERR_SUCCESS;
+
+ case VERIFIED_FINGERPRINT:
+ DEBUGMSGTL(("tls_x509:verify", "Verified client fingerprint\n"));
+ tlsdata->flags |= NETSNMP_TLSBASE_CERT_FP_VERIFIED;
+ return SNMPERR_SUCCESS;
+ }
+
+ DEBUGMSGTL(("tls_x509:verify", "shouldn't get here\n"));
+ return SNMPERR_GENERR;
+}
+
+/* this is called after the connection on the server side by us to
+ check other aspects about the connection and obtain the
+ securityName from the remote certificate. */
+int
+netsnmp_tlsbase_extract_security_name(SSL *ssl, _netsnmpTLSBaseData *tlsdata) {
+ netsnmp_container *chain_maps;
+ netsnmp_cert_map *cert_map, *peer_cert;
+ netsnmp_iterator *itr;
+ int rc;
+
+ netsnmp_assert_or_return(ssl != NULL, SNMPERR_GENERR);
+ netsnmp_assert_or_return(tlsdata != NULL, SNMPERR_GENERR);
+
+ if (NULL == (chain_maps = netsnmp_openssl_get_cert_chain(ssl)))
+ return SNMPERR_GENERR;
+ /*
+ * map fingerprints to mapping entries
+ */
+ rc = netsnmp_cert_get_secname_maps(chain_maps);
+ if ((-1 == rc) || (CONTAINER_SIZE(chain_maps) == 0)) {
+ netsnmp_cert_map_container_free(chain_maps);
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * change container to sorted (by clearing unsorted option), then
+ * iterate over it until we find a map that returns a secname.
+ */
+ CONTAINER_SET_OPTIONS(chain_maps, 0, rc);
+ itr = CONTAINER_ITERATOR(chain_maps);
+ if (NULL == itr) {
+ snmp_log(LOG_ERR, "could not get iterator for secname fingerprints\n");
+ netsnmp_cert_map_container_free(chain_maps);
+ return SNMPERR_GENERR;
+ }
+ peer_cert = cert_map = ITERATOR_FIRST(itr);
+ for( ; !tlsdata->securityName && cert_map; cert_map = ITERATOR_NEXT(itr))
+ tlsdata->securityName =
+ netsnmp_openssl_extract_secname(cert_map, peer_cert);
+ ITERATOR_RELEASE(itr);
+
+ netsnmp_cert_map_container_free(chain_maps);
+
+ return (tlsdata->securityName ? SNMPERR_SUCCESS : SNMPERR_GENERR);
+}
+
+int
+_trust_this_cert(SSL_CTX *the_ctx, char *certspec) {
+ netsnmp_cert *trustcert;
+
+ DEBUGMSGTL(("sslctx_client", "Trying to load a trusted certificate: %s\n",
+ certspec));
+
+ /* load this identifier into the trust chain */
+ trustcert = netsnmp_cert_find(NS_CERT_CA,
+ NS_CERTKEY_MULTIPLE,
+ certspec);
+ if (!trustcert)
+ trustcert = netsnmp_cert_find(NS_CERT_REMOTE_PEER,
+ NS_CERTKEY_MULTIPLE,
+ certspec);
+ if (!trustcert)
+ LOGANDDIE("failed to find requested certificate to trust");
+
+ /* Add the certificate to the context */
+ if (netsnmp_cert_trust_ca(the_ctx, trustcert) != SNMPERR_SUCCESS)
+ LOGANDDIE("failed to load trust certificate");
+
+ return 1;
+}
+
+void
+_load_trusted_certs(SSL_CTX *the_ctx) {
+ netsnmp_container *trusted_certs = NULL;
+ netsnmp_iterator *trusted_cert_iterator = NULL;
+ char *fingerprint;
+
+ trusted_certs = netsnmp_cert_get_trustlist();
+ trusted_cert_iterator = CONTAINER_ITERATOR(trusted_certs);
+ if (trusted_cert_iterator) {
+ for (fingerprint = (char *) ITERATOR_FIRST(trusted_cert_iterator);
+ fingerprint; fingerprint = ITERATOR_NEXT(trusted_cert_iterator)) {
+ if (!_trust_this_cert(the_ctx, fingerprint))
+ snmp_log(LOG_ERR, "failed to load trust cert: %s\n",
+ fingerprint);
+ }
+ ITERATOR_RELEASE(trusted_cert_iterator);
+ }
+}
+
+SSL_CTX *
+_sslctx_common_setup(SSL_CTX *the_ctx, _netsnmpTLSBaseData *tlsbase) {
+ char *crlFile;
+ char *cipherList;
+ X509_LOOKUP *lookup;
+ X509_STORE *cert_store = NULL;
+
+ _load_trusted_certs(the_ctx);
+
+ /* add in the CRLs if available */
+
+ crlFile = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_X509_CRL_FILE);
+ if (NULL != crlFile) {
+ cert_store = SSL_CTX_get_cert_store(the_ctx);
+ DEBUGMSGTL(("sslctx_client", "loading CRL: %s\n", crlFile));
+ if (!cert_store)
+ LOGANDDIE("failed to find certificate store");
+ if (!(lookup = X509_STORE_add_lookup(cert_store, X509_LOOKUP_file())))
+ LOGANDDIE("failed to create a lookup function for the CRL file");
+ if (X509_load_crl_file(lookup, crlFile, X509_FILETYPE_PEM) != 1)
+ LOGANDDIE("failed to load the CRL file");
+ /* tell openssl to check CRLs */
+ X509_STORE_set_flags(cert_store,
+ X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
+ }
+
+ cipherList = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TLS_ALGORITMS);
+ if (NULL != cipherList) {
+ if (SSL_CTX_set_cipher_list(the_ctx, cipherList) != 1)
+ LOGANDDIE("failed to set the cipher list to the requested value");
+ else
+ snmp_log(LOG_INFO,"set SSL cipher list to '%s'\n", cipherList);
+ }
+ return the_ctx;
+}
+
+SSL_CTX *
+sslctx_client_setup(const SSL_METHOD *method, _netsnmpTLSBaseData *tlsbase) {
+ netsnmp_cert *id_cert, *peer_cert;
+ SSL_CTX *the_ctx;
+
+ /***********************************************************************
+ * Set up the client context
+ */
+ the_ctx = SSL_CTX_new(NETSNMP_REMOVE_CONST(SSL_METHOD *, method));
+ if (!the_ctx) {
+ snmp_log(LOG_ERR, "ack: %p\n", the_ctx);
+ LOGANDDIE("can't create a new context");
+ }
+ SSL_CTX_set_read_ahead (the_ctx, 1); /* Required for DTLS */
+
+ SSL_CTX_set_verify(the_ctx,
+ SSL_VERIFY_PEER|
+ SSL_VERIFY_FAIL_IF_NO_PEER_CERT|
+ SSL_VERIFY_CLIENT_ONCE,
+ &verify_callback);
+
+ if (tlsbase->our_identity) {
+ DEBUGMSGTL(("sslctx_client", "looking for local id: %s\n", tlsbase->our_identity));
+ id_cert = netsnmp_cert_find(NS_CERT_IDENTITY, NS_CERTKEY_MULTIPLE,
+ tlsbase->our_identity);
+ } else {
+ DEBUGMSGTL(("sslctx_client", "looking for default local id: %s\n", tlsbase->our_identity));
+ id_cert = netsnmp_cert_find(NS_CERT_IDENTITY, NS_CERTKEY_DEFAULT, NULL);
+ }
+
+ if (!id_cert)
+ LOGANDDIE ("error finding client identity keys");
+
+ if (!id_cert->key || !id_cert->key->okey)
+ LOGANDDIE("failed to load private key");
+
+ DEBUGMSGTL(("sslctx_client", "using public key: %s\n",
+ id_cert->info.filename));
+ DEBUGMSGTL(("sslctx_client", "using private key: %s\n",
+ id_cert->key->info.filename));
+
+ if (SSL_CTX_use_certificate(the_ctx, id_cert->ocert) <= 0)
+ LOGANDDIE("failed to set the certificate to use");
+
+ if (SSL_CTX_use_PrivateKey(the_ctx, id_cert->key->okey) <= 0)
+ LOGANDDIE("failed to set the private key to use");
+
+ if (!SSL_CTX_check_private_key(the_ctx))
+ LOGANDDIE("public and private keys incompatible");
+
+ if (tlsbase->their_identity)
+ peer_cert = netsnmp_cert_find(NS_CERT_REMOTE_PEER,
+ NS_CERTKEY_MULTIPLE,
+ tlsbase->their_identity);
+ else
+ peer_cert = netsnmp_cert_find(NS_CERT_REMOTE_PEER, NS_CERTKEY_DEFAULT,
+ NULL);
+ if (peer_cert) {
+ DEBUGMSGTL(("sslctx_client", "server's expected public key: %s\n",
+ peer_cert ? peer_cert->info.filename : "none"));
+
+ /* Trust the expected certificate */
+ if (netsnmp_cert_trust_ca(the_ctx, peer_cert) != SNMPERR_SUCCESS)
+ LOGANDDIE ("failed to set verify paths");
+ }
+
+ /* trust a certificate (possibly a CA) aspecifically passed in */
+ if (tlsbase->trust_cert) {
+ if (!_trust_this_cert(the_ctx, tlsbase->trust_cert))
+ return 0;
+ }
+
+ return _sslctx_common_setup(the_ctx, tlsbase);
+}
+
+SSL_CTX *
+sslctx_server_setup(const SSL_METHOD *method) {
+ netsnmp_cert *id_cert;
+
+ /***********************************************************************
+ * Set up the server context
+ */
+ /* setting up for ssl */
+ SSL_CTX *the_ctx = SSL_CTX_new(NETSNMP_REMOVE_CONST(SSL_METHOD *, method));
+ if (!the_ctx) {
+ LOGANDDIE("can't create a new context");
+ }
+
+ id_cert = netsnmp_cert_find(NS_CERT_IDENTITY, NS_CERTKEY_DEFAULT, NULL);
+ if (!id_cert)
+ LOGANDDIE ("error finding server identity keys");
+
+ if (!id_cert->key || !id_cert->key->okey)
+ LOGANDDIE("failed to load private key");
+
+ DEBUGMSGTL(("sslctx_server", "using public key: %s\n",
+ id_cert->info.filename));
+ DEBUGMSGTL(("sslctx_server", "using private key: %s\n",
+ id_cert->key->info.filename));
+
+ if (SSL_CTX_use_certificate(the_ctx, id_cert->ocert) <= 0)
+ LOGANDDIE("failed to set the certificate to use");
+
+ if (SSL_CTX_use_PrivateKey(the_ctx, id_cert->key->okey) <= 0)
+ LOGANDDIE("failed to set the private key to use");
+
+ if (!SSL_CTX_check_private_key(the_ctx))
+ LOGANDDIE("public and private keys incompatible");
+
+ SSL_CTX_set_read_ahead(the_ctx, 1); /* XXX: DTLS only? */
+
+ SSL_CTX_set_verify(the_ctx,
+ SSL_VERIFY_PEER|
+ SSL_VERIFY_FAIL_IF_NO_PEER_CERT|
+ SSL_VERIFY_CLIENT_ONCE,
+ &verify_callback);
+
+ return _sslctx_common_setup(the_ctx, NULL);
+}
+
+int
+netsnmp_tlsbase_config(struct netsnmp_transport_s *t, const char *token, const char *value) {
+ _netsnmpTLSBaseData *tlsdata;
+
+ netsnmp_assert_or_return(t != NULL, -1);
+ netsnmp_assert_or_return(t->data != NULL, -1);
+
+ tlsdata = t->data;
+
+ if ((strcmp(token, "localCert") == 0) ||
+ (strcmp(token, "our_identity") == 0)) {
+ SNMP_FREE(tlsdata->our_identity);
+ tlsdata->our_identity = strdup(value);
+ DEBUGMSGT(("tls:config","our identity %s\n", value));
+ }
+
+ if ((strcmp(token, "peerCert") == 0) ||
+ (strcmp(token, "their_identity") == 0)) {
+ SNMP_FREE(tlsdata->their_identity);
+ tlsdata->their_identity = strdup(value);
+ DEBUGMSGT(("tls:config","their identity %s\n", value));
+ }
+
+ if ((strcmp(token, "peerHostname") == 0) ||
+ (strcmp(token, "their_hostname") == 0)) {
+ SNMP_FREE(tlsdata->their_hostname);
+ tlsdata->their_hostname = strdup(value);
+ }
+
+ if ((strcmp(token, "trust_cert") == 0) ||
+ (strcmp(token, "trustCert") == 0)) {
+ SNMP_FREE(tlsdata->trust_cert);
+ tlsdata->trust_cert = strdup(value);
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+int
+netsnmp_tlsbase_session_init(struct netsnmp_transport_s *transport,
+ struct snmp_session *sess) {
+ /* the default security model here should be TSM; most other
+ things won't work with TLS because we'll throw out the packet
+ if it doesn't have a proper tmStateRef (and onyl TSM generates
+ this at the moment */
+ if (!(transport->flags & NETSNMP_TRANSPORT_FLAG_LISTEN)) {
+ if (sess->securityModel == SNMP_DEFAULT_SECMODEL) {
+ sess->securityModel = SNMP_SEC_MODEL_TSM;
+ } else if (sess->securityModel != SNMP_SEC_MODEL_TSM) {
+ sess->securityModel = SNMP_SEC_MODEL_TSM;
+ snmp_log(LOG_ERR, "A security model other than TSM is being used with (D)TLS; using TSM anyways\n");
+ }
+
+ if (NULL == sess->securityName) {
+ /* client side doesn't need a real securityName */
+ /* XXX: call-home issues require them to set one for VACM; but
+ we don't do callhome yet */
+ sess->securityName = strdup("__BOGUS__");
+ sess->securityNameLen = strlen(sess->securityName);
+ }
+
+ if (sess->version != SNMP_VERSION_3) {
+ sess->version = SNMP_VERSION_3;
+ snmp_log(LOG_ERR, "A SNMP version other than 3 was requested with (D)TLS; using 3 anyways\n");
+ }
+
+ if (sess->securityLevel <= 0) {
+ sess->securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
+ }
+ }
+ return SNMPERR_SUCCESS;
+}
+
+static int have_done_bootstrap = 0;
+
+static int
+tls_bootstrap(int majorid, int minorid, void *serverarg, void *clientarg) {
+ char indexname[] = "_netsnmp_verify_info";
+
+ /* don't do this more than once */
+ if (have_done_bootstrap)
+ return 0;
+ have_done_bootstrap = 1;
+
+ netsnmp_certs_load();
+
+ openssl_local_index =
+ SSL_get_ex_new_index(0, indexname, NULL, NULL, NULL);
+
+ return 0;
+}
+
+int
+tls_get_verify_info_index() {
+ return openssl_local_index;
+}
+
+static void _parse_client_cert(const char *tok, char *line)
+{
+ config_pwarn("clientCert is deprecated. Clients should use localCert, servers should use peerCert");
+ if (*line == '"') {
+ char buf[SNMP_MAXBUF];
+ copy_nword(line, buf, sizeof(buf));
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_X509_CLIENT_PUB, buf);
+ } else
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_X509_CLIENT_PUB, line);
+}
+
+static void _parse_server_cert(const char *tok, char *line)
+{
+ config_pwarn("serverCert is deprecated. Clients should use peerCert, servers should use localCert.");
+ if (*line == '"') {
+ char buf[SNMP_MAXBUF];
+ copy_nword(line, buf, sizeof(buf));
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_X509_CLIENT_PUB, buf);
+ } else
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_X509_SERVER_PUB, line);
+}
+
+void
+netsnmp_tlsbase_ctor(void) {
+
+ /* bootstrap ssl since we'll need it */
+ netsnmp_init_openssl();
+
+ /* the private client cert to authenticate with */
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "extraX509SubDir",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CERT_EXTRA_SUBDIR);
+
+ /* Do we have a CRL list? */
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "x509CRLFile",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_X509_CRL_FILE);
+
+ /* What TLS algorithms should be use */
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "tlsAlgorithms",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TLS_ALGORITMS);
+
+ /*
+ * for the client
+ */
+
+ /* the public client cert to authenticate with */
+ register_config_handler("snmp", "clientCert", _parse_client_cert, NULL,
+ NULL);
+
+ /*
+ * for the server
+ */
+
+ /* The X509 server key to use */
+ register_config_handler("snmp", "serverCert", _parse_server_cert, NULL,
+ NULL);
+ /*
+ * remove cert config ambiguity: localCert, peerCert
+ */
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "localCert",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TLS_LOCAL_CERT);
+ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "peerCert",
+ NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_TLS_PEER_CERT);
+
+ /*
+ * register our boot-strapping needs
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_PREMIB_READ_CONFIG,
+ tls_bootstrap, NULL);
+
+}
+
+_netsnmpTLSBaseData *
+netsnmp_tlsbase_allocate_tlsdata(netsnmp_transport *t, int isserver) {
+
+ _netsnmpTLSBaseData *tlsdata;
+
+ if (NULL == t)
+ return NULL;
+
+ /* allocate our TLS specific data */
+ tlsdata = SNMP_MALLOC_TYPEDEF(_netsnmpTLSBaseData);
+ if (NULL == tlsdata) {
+ SNMP_FREE(t);
+ return NULL;
+ }
+
+ if (!isserver)
+ tlsdata->flags |= NETSNMP_TLSBASE_IS_CLIENT;
+
+ return tlsdata;
+}
+
+void netsnmp_tlsbase_free_tlsdata(_netsnmpTLSBaseData *tlsbase) {
+ if (!tlsbase)
+ return;
+
+ DEBUGMSGTL(("tlsbase","Freeing TLS Base data for a session\n"));
+
+ if (tlsbase->ssl)
+ SSL_free(tlsbase->ssl);
+
+ if (tlsbase->ssl_context)
+ SSL_CTX_free(tlsbase->ssl_context);
+ /* don't free the accept_bio since it's the parent bio */
+ /*
+ if (tlsbase->accept_bio)
+ BIO_free(tlsbase->accept_bio);
+ */
+ /* and this is freed by the SSL shutdown */
+ /*
+ if (tlsbase->accepted_bio)
+ BIO_free(tlsbase->accept_bio);
+ */
+
+ /* free the config data */
+ SNMP_FREE(tlsbase->securityName);
+ SNMP_FREE(tlsbase->addr_string);
+ SNMP_FREE(tlsbase->our_identity);
+ SNMP_FREE(tlsbase->their_identity);
+ SNMP_FREE(tlsbase->their_fingerprint);
+ SNMP_FREE(tlsbase->their_hostname);
+ SNMP_FREE(tlsbase->trust_cert);
+
+ /* free the base itself */
+ SNMP_FREE(tlsbase);
+}
+
+int netsnmp_tlsbase_wrapup_recv(netsnmp_tmStateReference *tmStateRef,
+ _netsnmpTLSBaseData *tlsdata,
+ void **opaque, int *olength) {
+ int no_auth, no_priv;
+
+ if (NULL == tlsdata)
+ return SNMPERR_GENERR;
+
+ /* RFC5953 Section 5.1.2 step 2: tmSecurityLevel */
+ /*
+ * Don't accept null authentication. Null encryption ok.
+ *
+ * XXX: this should actually check for a configured list of encryption
+ * algorithms to map to NOPRIV, but for the moment we'll
+ * accept any encryption alogrithms that openssl is using.
+ */
+ netsnmp_openssl_null_checks(tlsdata->ssl, &no_auth, &no_priv);
+ if (no_auth == 1) { /* null/unknown authentication */
+ /* xxx-rks: snmp_increment_statistic(STAT_???); */
+ snmp_log(LOG_ERR, "tls connection with NULL authentication\n");
+ SNMP_FREE(tmStateRef);
+ return SNMPERR_GENERR;
+ }
+ else if (no_priv == 1) /* null/unknown encryption */
+ tmStateRef->transportSecurityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
+ else
+ tmStateRef->transportSecurityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
+ DEBUGMSGTL(("tls:secLevel", "SecLevel %d\n",
+ tmStateRef->transportSecurityLevel));
+
+ /* use x509 cert to do lookup to secname if DNE in cachep yet */
+
+ /* RFC5953: section 5.3.2, paragraph 2:
+ The (D)TLS server identifies the authenticated identity from the
+ (D)TLS client's principal certificate using configuration information
+ from the snmpTlstmCertToTSNTable mapping table. The (D)TLS server
+ MUST request and expect a certificate from the client and MUST NOT
+ accept SNMP messages over the (D)TLS connection until the client has
+ sent a certificate and it has been authenticated. The resulting
+ derived tmSecurityName is recorded in the tmStateReference cache as
+ tmSecurityName. The details of the lookup process are fully
+ described in the DESCRIPTION clause of the snmpTlstmCertToTSNTable
+ MIB object. If any verification fails in any way (for example
+ because of failures in cryptographic verification or because of the
+ lack of an appropriate row in the snmpTlstmCertToTSNTable) then the
+ session establishment MUST fail, and the
+ snmpTlstmSessionInvalidClientCertificates object is incremented. If
+ the session can not be opened for any reason at all, including
+ cryptographic verification failures, then the
+ snmpTlstmSessionOpenErrors counter is incremented and processing
+ stops.
+ */
+
+ if (!tlsdata->securityName) {
+ netsnmp_tlsbase_extract_security_name(tlsdata->ssl, tlsdata);
+ if (NULL != tlsdata->securityName) {
+ DEBUGMSGTL(("tls", "set SecName to: %s\n", tlsdata->securityName));
+ } else {
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCLIENTCERTIFICATES);
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENERRORS);
+ SNMP_FREE(tmStateRef);
+ return SNMPERR_GENERR;
+ }
+ }
+
+ /* RFC5953 Section 5.1.2 step 2: tmSecurityName */
+ /* XXX: detect and throw out overflow secname sizes rather
+ than truncating. */
+ strlcpy(tmStateRef->securityName, tlsdata->securityName,
+ sizeof(tmStateRef->securityName));
+ tmStateRef->securityNameLen = strlen(tmStateRef->securityName);
+
+ /* RFC5953 Section 5.1.2 step 2: tmSessionID */
+ /* use our TLSData pointer as the session ID */
+ memcpy(tmStateRef->sessionID, &tlsdata, sizeof(netsnmp_tmStateReference *));
+
+ /* save the tmStateRef in our special pointer */
+ *opaque = tmStateRef;
+ *olength = sizeof(netsnmp_tmStateReference);
+
+ return SNMPERR_SUCCESS;
+}
+
+netsnmp_feature_child_of(_x509_get_error, netsnmp_unused)
+#ifndef NETSNMP_FEATURE_REMOVE__X509_GET_ERROR
+const char * _x509_get_error(int x509failvalue, const char *location) {
+ static const char *reason = NULL;
+
+ /* XXX: use this instead: X509_verify_cert_error_string(err) */
+
+ switch (x509failvalue) {
+ case X509_V_OK:
+ reason = "X509_V_OK";
+ break;
+ case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
+ reason = "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT";
+ break;
+ case X509_V_ERR_UNABLE_TO_GET_CRL:
+ reason = "X509_V_ERR_UNABLE_TO_GET_CRL";
+ break;
+ case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE:
+ reason = "X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE";
+ break;
+ case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE:
+ reason = "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE";
+ break;
+ case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY:
+ reason = "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY";
+ break;
+ case X509_V_ERR_CERT_SIGNATURE_FAILURE:
+ reason = "X509_V_ERR_CERT_SIGNATURE_FAILURE";
+ break;
+ case X509_V_ERR_CRL_SIGNATURE_FAILURE:
+ reason = "X509_V_ERR_CRL_SIGNATURE_FAILURE";
+ break;
+ case X509_V_ERR_CERT_NOT_YET_VALID:
+ reason = "X509_V_ERR_CERT_NOT_YET_VALID";
+ break;
+ case X509_V_ERR_CERT_HAS_EXPIRED:
+ reason = "X509_V_ERR_CERT_HAS_EXPIRED";
+ break;
+ case X509_V_ERR_CRL_NOT_YET_VALID:
+ reason = "X509_V_ERR_CRL_NOT_YET_VALID";
+ break;
+ case X509_V_ERR_CRL_HAS_EXPIRED:
+ reason = "X509_V_ERR_CRL_HAS_EXPIRED";
+ break;
+ case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
+ reason = "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD";
+ break;
+ case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
+ reason = "X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD";
+ break;
+ case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD:
+ reason = "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD";
+ break;
+ case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD:
+ reason = "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD";
+ break;
+ case X509_V_ERR_OUT_OF_MEM:
+ reason = "X509_V_ERR_OUT_OF_MEM";
+ break;
+ case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
+ reason = "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT";
+ break;
+ case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
+ reason = "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN";
+ break;
+ case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
+ reason = "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY";
+ break;
+ case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
+ reason = "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE";
+ break;
+ case X509_V_ERR_CERT_CHAIN_TOO_LONG:
+ reason = "X509_V_ERR_CERT_CHAIN_TOO_LONG";
+ break;
+ case X509_V_ERR_CERT_REVOKED:
+ reason = "X509_V_ERR_CERT_REVOKED";
+ break;
+ case X509_V_ERR_INVALID_CA:
+ reason = "X509_V_ERR_INVALID_CA";
+ break;
+ case X509_V_ERR_PATH_LENGTH_EXCEEDED:
+ reason = "X509_V_ERR_PATH_LENGTH_EXCEEDED";
+ break;
+ case X509_V_ERR_INVALID_PURPOSE:
+ reason = "X509_V_ERR_INVALID_PURPOSE";
+ break;
+ case X509_V_ERR_CERT_UNTRUSTED:
+ reason = "X509_V_ERR_CERT_UNTRUSTED";
+ break;
+ case X509_V_ERR_CERT_REJECTED:
+ reason = "X509_V_ERR_CERT_REJECTED";
+ break;
+ case X509_V_ERR_SUBJECT_ISSUER_MISMATCH:
+ reason = "X509_V_ERR_SUBJECT_ISSUER_MISMATCH";
+ break;
+ case X509_V_ERR_AKID_SKID_MISMATCH:
+ reason = "X509_V_ERR_AKID_SKID_MISMATCH";
+ break;
+ case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH:
+ reason = "X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH";
+ break;
+ case X509_V_ERR_KEYUSAGE_NO_CERTSIGN:
+ reason = "X509_V_ERR_KEYUSAGE_NO_CERTSIGN";
+ break;
+ case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER:
+ reason = "X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER";
+ break;
+ case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION:
+ reason = "X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION";
+ break;
+ case X509_V_ERR_KEYUSAGE_NO_CRL_SIGN:
+ reason = "X509_V_ERR_KEYUSAGE_NO_CRL_SIGN";
+ break;
+ case X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION:
+ reason = "X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION";
+ break;
+ case X509_V_ERR_INVALID_NON_CA:
+ reason = "X509_V_ERR_INVALID_NON_CA";
+ break;
+ case X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED:
+ reason = "X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED";
+ break;
+ case X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE:
+ reason = "X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE";
+ break;
+ case X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED:
+ reason = "X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED";
+ break;
+#ifdef X509_V_ERR_INVALID_EXTENSION /* not avail on darwin */
+ case X509_V_ERR_INVALID_EXTENSION:
+ reason = "X509_V_ERR_INVALID_EXTENSION";
+ break;
+#endif
+#ifdef X509_V_ERR_INVALID_POLICY_EXTENSION /* not avail on darwin */
+ case X509_V_ERR_INVALID_POLICY_EXTENSION:
+ reason = "X509_V_ERR_INVALID_POLICY_EXTENSION";
+ break;
+#endif
+#ifdef X509_V_ERR_NO_EXPLICIT_POLICY /* not avail on darwin */
+ case X509_V_ERR_NO_EXPLICIT_POLICY:
+ reason = "X509_V_ERR_NO_EXPLICIT_POLICY";
+ break;
+#endif
+#ifdef X509_V_ERR_UNNESTED_RESOURCE /* not avail on darwin */
+ case X509_V_ERR_UNNESTED_RESOURCE:
+ reason = "X509_V_ERR_UNNESTED_RESOURCE";
+ break;
+#endif
+ case X509_V_ERR_APPLICATION_VERIFICATION:
+ reason = "X509_V_ERR_APPLICATION_VERIFICATION";
+ break;
+ default:
+ reason = "unknown failure code";
+ }
+
+ return reason;
+}
+#endif /* NETSNMP_FEATURE_REMOVE__X509_GET_ERROR */
+
+void _openssl_log_error(int rc, SSL *con, const char *location) {
+ const char *reason, *file, *data;
+ unsigned long numerical_reason;
+ int flags, line;
+
+ snmp_log(LOG_ERR, "---- OpenSSL Related Errors: ----\n");
+
+ /* SSL specific errors */
+ if (con) {
+
+ int sslnum = SSL_get_error(con, rc);
+
+ switch(sslnum) {
+ case SSL_ERROR_NONE:
+ reason = "SSL_ERROR_NONE";
+ break;
+
+ case SSL_ERROR_SSL:
+ reason = "SSL_ERROR_SSL";
+ break;
+
+ case SSL_ERROR_WANT_READ:
+ reason = "SSL_ERROR_WANT_READ";
+ break;
+
+ case SSL_ERROR_WANT_WRITE:
+ reason = "SSL_ERROR_WANT_WRITE";
+ break;
+
+ case SSL_ERROR_WANT_X509_LOOKUP:
+ reason = "SSL_ERROR_WANT_X509_LOOKUP";
+ break;
+
+ case SSL_ERROR_SYSCALL:
+ reason = "SSL_ERROR_SYSCALL";
+ snmp_log(LOG_ERR, "TLS error: %s: rc=%d, sslerror = %d (%s): system_error=%d (%s)\n",
+ location, rc, sslnum, reason, errno, strerror(errno));
+ snmp_log(LOG_ERR, "TLS Error: %s\n",
+ ERR_reason_error_string(ERR_get_error()));
+ return;
+
+ case SSL_ERROR_ZERO_RETURN:
+ reason = "SSL_ERROR_ZERO_RETURN";
+ break;
+
+ case SSL_ERROR_WANT_CONNECT:
+ reason = "SSL_ERROR_WANT_CONNECT";
+ break;
+
+ case SSL_ERROR_WANT_ACCEPT:
+ reason = "SSL_ERROR_WANT_ACCEPT";
+ break;
+
+ default:
+ reason = "unknown";
+ }
+
+ snmp_log(LOG_ERR, " TLS error: %s: rc=%d, sslerror = %d (%s)\n",
+ location, rc, sslnum, reason);
+
+ snmp_log(LOG_ERR, " TLS Error: %s\n",
+ ERR_reason_error_string(ERR_get_error()));
+
+ }
+
+ /* other errors */
+ while ((numerical_reason =
+ ERR_get_error_line_data(&file, &line, &data, &flags)) != 0) {
+ snmp_log(LOG_ERR, " error: #%lu (file %s, line %d)\n",
+ numerical_reason, file, line);
+
+ /* if we have a text translation: */
+ if (data && (flags & ERR_TXT_STRING)) {
+ snmp_log(LOG_ERR, " Textual Error: %s\n", data);
+ /*
+ * per openssl man page: If it has been allocated by
+ * OPENSSL_malloc(), *flags&ERR_TXT_MALLOCED is true.
+ *
+ * arggh... stupid openssl prototype for ERR_get_error_line_data
+ * wants a const char **, but returns something that we might
+ * need to free??
+ */
+ if (flags & ERR_TXT_MALLOCED)
+ OPENSSL_free(NETSNMP_REMOVE_CONST(void *, data)); }
+ }
+
+ snmp_log(LOG_ERR, "---- End of OpenSSL Errors ----\n");
+}
diff --git a/snmplib/transports/snmpTLSTCPDomain.c b/snmplib/transports/snmpTLSTCPDomain.c
new file mode 100644
index 0000000..a92091e
--- /dev/null
+++ b/snmplib/transports/snmpTLSTCPDomain.c
@@ -0,0 +1,1041 @@
+/* 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:
+ */
+/*
+ * See the following web pages for useful documentation on this transport:
+ * http://www.net-snmp.org/wiki/index.php/TUT:Using_TLS
+ * http://www.net-snmp.org/wiki/index.php/Using_DTLS
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-features.h>
+
+netsnmp_feature_require(cert_util)
+
+#include <net-snmp/library/snmpTLSTCPDomain.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.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
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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
+#if HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/library/snmp_assert.h>
+#include <net-snmp/library/snmpIPv4BaseDomain.h>
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+#include <net-snmp/library/snmpTLSBaseDomain.h>
+#include <net-snmp/library/system.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/cert_util.h>
+#include <net-snmp/library/snmp_openssl.h>
+#include <net-snmp/library/callback.h>
+
+#include "openssl/bio.h"
+#include "openssl/ssl.h"
+#include "openssl/err.h"
+
+#ifndef INADDR_NONE
+#define INADDR_NONE -1
+#endif
+
+#define WE_ARE_SERVER 0
+#define WE_ARE_CLIENT 1
+
+oid netsnmpTLSTCPDomain[] = { TRANSPORT_DOMAIN_TLS_TCP_IP };
+size_t netsnmpTLSTCPDomain_len = OID_LENGTH(netsnmpTLSTCPDomain);
+
+static netsnmp_tdomain tlstcpDomain;
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+static char *
+netsnmp_tlstcp_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ if (NULL == data || 0 == len || 0 == ((char *) data)[0])
+ return strdup("TLSTCP: unknown");
+ else if (len == sizeof(netsnmp_indexed_addr_pair) ||
+ len == sizeof(struct sockaddr_in))
+ return netsnmp_ipv4_fmtaddr("TLSTCP", t, data, len);
+ else {
+ /* an already ascii formatted string */
+ char buf[1024];
+ snprintf(buf, sizeof(buf)-1, "TLSTCP: %s", (char *) data);
+ return strdup(buf);
+ }
+}
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+static int
+netsnmp_tlstcp_copy(netsnmp_transport *oldt, netsnmp_transport *newt)
+{
+ _netsnmpTLSBaseData *oldtlsdata = (_netsnmpTLSBaseData *) oldt->data;
+ _netsnmpTLSBaseData *newtlsdata = (_netsnmpTLSBaseData *) newt->data;
+ oldtlsdata->accepted_bio = NULL;
+ oldtlsdata->ssl = NULL;
+ newtlsdata->ssl_context = NULL;
+
+ if (oldtlsdata->addr_string)
+ newtlsdata->addr_string = strdup(oldtlsdata->addr_string);
+ if (oldtlsdata->securityName)
+ newtlsdata->securityName = strdup(oldtlsdata->securityName);
+ if (oldtlsdata->our_identity)
+ newtlsdata->our_identity = strdup(oldtlsdata->our_identity);
+ if (oldtlsdata->their_identity)
+ newtlsdata->their_identity = strdup(oldtlsdata->their_identity);
+ if (oldtlsdata->their_fingerprint)
+ newtlsdata->their_fingerprint = strdup(oldtlsdata->their_fingerprint);
+ if (oldtlsdata->their_hostname)
+ newtlsdata->their_hostname = strdup(oldtlsdata->their_hostname);
+ if (oldtlsdata->trust_cert)
+ newtlsdata->trust_cert = strdup(oldtlsdata->trust_cert);
+ if (oldtlsdata->addr)
+ memdup((u_char**)&newtlsdata->addr, oldtlsdata->addr,
+ sizeof(*oldtlsdata->addr));
+
+ return 0;
+}
+
+static int
+netsnmp_tlstcp_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ netsnmp_tmStateReference *tmStateRef = NULL;
+ _netsnmpTLSBaseData *tlsdata;
+
+ if (NULL == t || t->sock < 0 || NULL == t->data) {
+ snmp_log(LOG_ERR,
+ "tlstcp received an invalid invocation with missing data\n");
+ DEBUGMSGTL(("tlstcp", "recvfrom fd %d err %d (\"%s\")\n",
+ (t ? t->sock : -1), errno, strerror(errno)));
+ DEBUGMSGTL(("tlstcp", " tdata = %p\n", t->data));
+ return -1;
+ }
+
+ /* RFC5953 Section 5.1.2 step 1:
+ 1) Determine the tlstmSessionID for the incoming message. The
+ tlstmSessionID MUST be a unique session identifier for this
+ (D)TLS connection. The contents and format of this identifier
+ are implementation-dependent as long as it is unique to the
+ session. A session identifier MUST NOT be reused until all
+ references to it are no longer in use. The tmSessionID is
+ equal to the tlstmSessionID discussed in Section 5.1.1.
+ tmSessionID refers to the session identifier when stored in the
+ tmStateReference and tlstmSessionID refers to the session
+ identifier when stored in the LCD. They MUST always be equal
+ when processing a given session's traffic.
+ */
+ /* For this implementation we use the t->data memory pointer as
+ the sessionID. As it's a pointer to session specific data tied
+ with the transport object we know it'll never be realloated
+ (ie, duplicated) until release by this transport object and is
+ safe to use as a unique session identifier. */
+
+ tlsdata = t->data;
+ if (NULL == tlsdata->ssl) {
+ snmp_log(LOG_ERR,
+ "tlstcp received an invalid invocation without ssl data\n");
+ return -1;
+ }
+
+ /* RFC5953 Section 5.1.2 step 1, part2:
+ * This part (incrementing the counter) is done in the
+ netsnmp_tlstcp_accept function.
+ */
+
+
+ /* RFC5953 Section 5.1.2 step 2:
+ * Create a tmStateReference cache for the subsequent reference and
+ assign the following values within it:
+
+ tmTransportDomain = snmpTLSTCPDomain or snmpDTLSUDPDomain as
+ appropriate.
+
+ tmTransportAddress = The address the message originated from.
+
+ tmSecurityLevel = The derived tmSecurityLevel for the session,
+ as discussed in Section 3.1.2 and Section 5.3.
+
+ tmSecurityName = The fderived tmSecurityName for the session as
+ discussed in Section 5.3. This value MUST
+ be constant during the lifetime of the
+ session.
+
+ tmSessionID = The tlstmSessionID described in step 1 above.
+ */
+
+ /* Implementation notes:
+ * - The tmTransportDomain is represented by the transport object
+ * - The tmpSessionID is represented by the tlsdata pointer (as
+ discussed above)
+ * - The following items are handled later in netsnmp_tlsbase_wrapup_recv:
+ - tmSecurityLevel
+ - tmSecurityName
+ - tmSessionID
+ */
+
+ /* create a tmStateRef cache for slow fill-in */
+ tmStateRef = SNMP_MALLOC_TYPEDEF(netsnmp_tmStateReference);
+
+ if (tmStateRef == NULL) {
+ *opaque = NULL;
+ *olength = 0;
+ return -1;
+ }
+
+ /* Set the transportDomain */
+ memcpy(tmStateRef->transportDomain,
+ netsnmpTLSTCPDomain, sizeof(netsnmpTLSTCPDomain[0]) *
+ netsnmpTLSTCPDomain_len);
+ tmStateRef->transportDomainLen = netsnmpTLSTCPDomain_len;
+
+ /* Set the tmTransportAddress */
+ tmStateRef->have_addresses = 1;
+
+ /* RFC5953 Section 5.1.2 step 1:
+ * 3) The incomingMessage and incomingMessageLength are assigned values
+ from the (D)TLS processing.
+ */
+
+ /* Implementation notes:
+ - incomingMessage = buf pointer
+ - incomingMessageLength = rc
+ */
+
+ /* read the packet from openssl */
+ do {
+ rc = SSL_read(tlsdata->ssl, buf, size);
+ if (rc == 0) {
+ /* XXX closed connection */
+ DEBUGMSGTL(("tlstcp", "remote side closed connection\n"));
+ /* XXX: openssl cleanup */
+ SNMP_FREE(tmStateRef);
+ return -1;
+ }
+ if (rc == -1) {
+ int err = SSL_get_error(tlsdata->ssl, rc);
+ if (err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE) {
+ /* error detected */
+ _openssl_log_error(rc, tlsdata->ssl, "SSL_read");
+ SNMP_FREE(tmStateRef);
+ return rc;
+ }
+ }
+ /* retry read for SSL_ERROR_WANT_READ || SSL_ERROR_WANT_WRITE */
+ } while (rc <= 0);
+
+ DEBUGMSGTL(("tlstcp", "received %d decoded bytes from tls\n", rc));
+
+ /* log the packet */
+ DEBUGIF("tlstcp") {
+ char *str = netsnmp_tlstcp_fmtaddr(t, NULL, 0);
+ DEBUGMSGTL(("tlstcp",
+ "recvfrom fd %d got %d bytes (from %s)\n",
+ t->sock, rc, str));
+ free(str);
+ }
+
+ /* Other wrap-up things common to TLS and DTLS */
+ if (netsnmp_tlsbase_wrapup_recv(tmStateRef, tlsdata, opaque, olength) !=
+ SNMPERR_SUCCESS)
+ return SNMPERR_GENERR;
+
+ /* RFC5953 Section 5.1.2 step 1:
+ * 4) The TLS Transport Model passes the transportDomain,
+ transportAddress, incomingMessage, and incomingMessageLength to
+ the Dispatcher using the receiveMessage ASI:
+ */
+
+ /* In our implementation, this is done simply by returning */
+ return rc;
+}
+
+
+
+static int
+netsnmp_tlstcp_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ netsnmp_tmStateReference *tmStateRef = NULL;
+ _netsnmpTLSBaseData *tlsdata;
+
+ DEBUGTRACETOK("tlstcp");
+
+ /* RFC5953 section 5.2:
+ 1) If tmStateReference does not refer to a cache containing values
+ for tmTransportDomain, tmTransportAddress, tmSecurityName,
+ tmRequestedSecurityLevel, and tmSameSecurity, then increment the
+ snmpTlstmSessionInvalidCaches counter, discard the message, and
+ return the error indication in the statusInformation. Processing
+ of this message stops.
+ */
+ /* Implementation Notes: the tmStateReference is stored in the opaque ptr */
+ if (opaque != NULL && *opaque != NULL &&
+ *olength == sizeof(netsnmp_tmStateReference)) {
+ tmStateRef = (netsnmp_tmStateReference *) *opaque;
+ } else {
+ snmp_log(LOG_ERR, "TLSTCP was called with an invalid state; possibly the wrong security model is in use. It should be 'tsm'.\n");
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCACHES);
+ return SNMPERR_GENERR;
+ }
+
+ /* RFC5953 section 5.2:
+ 2) Extract the tmSessionID, tmTransportDomain, tmTransportAddress,
+ tmSecurityName, tmRequestedSecurityLevel, and tmSameSecurity
+ values from the tmStateReference. Note: The tmSessionID value
+ may be undefined if no session exists yet over which the message
+ can be sent.
+ */
+ /* Implementation Notes:
+ - Our session will always exist by now as it's created when the
+ transport object is created. Auto-session creation is handled
+ higher in the stack.
+ - We don't "extract" per say since we just leave the data in
+ the structure.
+ - The sessionID is stored in the t->data memory pointer.
+ */
+
+ /* RFC5953 section 5.2:
+ 3) If tmSameSecurity is true and either tmSessionID is undefined or
+ refers to a session that is no longer open then increment the
+ snmpTlstmSessionNoSessions counter, discard the message and
+ return the error indication in the statusInformation. Processing
+ of this message stops.
+ */
+ /* Implementation Notes:
+ - We would never get here if the sessionID was either undefined
+ or different. We tie packets directly to the transport
+ object and it could never be sent back over a different
+ transport, which is what the above text is trying to prevent.
+ */
+
+ /* RFC5953 section 5.2:
+ 4) If tmSameSecurity is false and tmSessionID refers to a session
+ that is no longer available then an implementation SHOULD open a
+ new session using the openSession() ASI (described in greater
+ detail in step 5b). Instead of opening a new session an
+ implementation MAY return a snmpTlstmSessionNoSessions error to
+ the calling module and stop processing of the message.
+ */
+ /* Implementation Notes:
+ - We would never get here if the sessionID was either undefined
+ or different. We tie packets directly to the transport
+ object and it could never be sent back over a different
+ transport, which is what the above text is trying to prevent.
+ - Auto-connections are handled higher in the Net-SNMP library stack
+ */
+
+ /* RFC5953 section 5.2:
+ 5) If tmSessionID is undefined, then use tmTransportDomain,
+ tmTransportAddress, tmSecurityName and tmRequestedSecurityLevel
+ to see if there is a corresponding entry in the LCD suitable to
+ send the message over.
+
+ 5a) If there is a corresponding LCD entry, then this session
+ will be used to send the message.
+
+ 5b) If there is not a corresponding LCD entry, then open a
+ session using the openSession() ASI (discussed further in
+ Section 5.3.1). Implementations MAY wish to offer message
+ buffering to prevent redundant openSession() calls for the
+ same cache entry. If an error is returned from
+ openSession(), then discard the message, discard the
+ tmStateReference, increment the snmpTlstmSessionOpenErrors,
+ return an error indication to the calling module and stop
+ processing of the message.
+ */
+ /* Implementation Notes:
+ - We would never get here if the sessionID was either undefined
+ or different. We tie packets directly to the transport
+ object and it could never be sent back over a different
+ transport, which is what the above text is trying to prevent.
+ - Auto-connections are handled higher in the Net-SNMP library stack
+ */
+
+ /* our session pointer is functionally t->data */
+ if (NULL == t->data) {
+ snmp_log(LOG_ERR, "netsnmp_tlstcp_send received no incoming data\n");
+ return -1;
+ }
+
+ tlsdata = t->data;
+
+ if (tlsdata->ssl == NULL) {
+ snmp_log(LOG_ERR, "tlstcp_send was called without a SSL connection.\n");
+ return SNMPERR_GENERR;
+ }
+
+ /* If the first packet and we have no secname, then copy the
+ important securityName data into the longer-lived session
+ reference information. */
+ if ((tlsdata->flags & NETSNMP_TLSBASE_IS_CLIENT) &&
+ !tlsdata->securityName && tmStateRef && tmStateRef->securityNameLen > 0)
+ tlsdata->securityName = strdup(tmStateRef->securityName);
+
+
+ /* RFC5953 section 5.2:
+ 6) Using either the session indicated by the tmSessionID if there
+ was one or the session resulting from a previous step (4 or 5),
+ pass the outgoingMessage to (D)TLS for encapsulation and
+ transmission.
+ */
+ rc = SSL_write(tlsdata->ssl, buf, size);
+ DEBUGMSGTL(("tlstcp", "wrote %d bytes\n", size));
+ if (rc < 0) {
+ _openssl_log_error(rc, tlsdata->ssl, "SSL_write");
+ }
+
+ return rc;
+}
+
+
+
+static int
+netsnmp_tlstcp_close(netsnmp_transport *t)
+{
+ _netsnmpTLSBaseData *tlsdata;
+
+ if (NULL == t || NULL == t->data)
+ return -1;
+
+ /* RFC5953 Section 5.4. Closing a Session
+
+ 1) Increment either the snmpTlstmSessionClientCloses or the
+ snmpTlstmSessionServerCloses counter as appropriate.
+ */
+ if (t->flags & NETSNMP_TLSBASE_IS_CLIENT)
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONCLIENTCLOSES);
+ else
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONSERVERCLOSES);
+
+ /* RFC5953 Section 5.4. Closing a Session
+ 2) Look up the session using the tmSessionID.
+ */
+ tlsdata = (_netsnmpTLSBaseData *) t->data;
+
+ /* RFC5953 Section 5.4. Closing a Session
+ 3) If there is no open session associated with the tmSessionID, then
+ closeSession processing is completed.
+ */
+ /* Implementation notes: if we have a non-zero tlsdata then it's
+ always true */
+
+ /* RFC5953 Section 5.3.1: Establishing a Session as a Client
+ 4) Have (D)TLS close the specified connection. This SHOULD include
+ sending a close_notify TLS Alert to inform the other side that
+ session cleanup may be performed.
+ */
+
+ DEBUGMSGTL(("tlstcp", "Shutting down SSL connection\n"));
+ if (tlsdata->ssl) {
+ SSL_shutdown(tlsdata->ssl);
+ }
+
+ netsnmp_tlsbase_free_tlsdata(tlsdata);
+
+ t->data = NULL;
+ return netsnmp_socketbase_close(t);
+}
+
+static int
+netsnmp_tlstcp_accept(netsnmp_transport *t)
+{
+ BIO *accepted_bio;
+ int rc;
+ SSL_CTX *ctx;
+ SSL *ssl;
+ _netsnmpTLSBaseData *tlsdata = NULL;
+
+ DEBUGMSGTL(("tlstcp", "netsnmp_tlstcp_accept called\n"));
+
+ tlsdata = (_netsnmpTLSBaseData *) t->data;
+
+ rc = BIO_do_accept(tlsdata->accept_bio);
+
+ if (rc <= 0) {
+ snmp_log(LOG_ERR, "BIO_do_accept failed\n");
+ _openssl_log_error(rc, NULL, "BIO_do_accept");
+ /* XXX: need to close the listening connection here? */
+ return -1;
+ }
+
+ tlsdata->accepted_bio = accepted_bio = BIO_pop(tlsdata->accept_bio);
+ if (!accepted_bio) {
+ snmp_log(LOG_ERR, "Failed to pop an accepted bio off the bio staack\n");
+ /* XXX: need to close the listening connection here? */
+ return -1;
+ }
+
+ /* create the OpenSSL TLS context */
+ ctx = tlsdata->ssl_context;
+
+ /* create the server's main SSL bio */
+ ssl = tlsdata->ssl = SSL_new(ctx);
+ if (!tlsdata->ssl) {
+ snmp_log(LOG_ERR, "TLSTCP: Failed to create a SSL BIO\n");
+ BIO_free(accepted_bio);
+ tlsdata->accepted_bio = NULL;
+ return -1;
+ }
+
+ SSL_set_bio(ssl, accepted_bio, accepted_bio);
+
+ if ((rc = SSL_accept(ssl)) <= 0) {
+ snmp_log(LOG_ERR, "TLSTCP: Failed SSL_accept\n");
+ _openssl_log_error(rc, ssl, "SSL_accept");
+ SSL_shutdown(tlsdata->ssl);
+ SSL_free(tlsdata->ssl);
+ tlsdata->accepted_bio = NULL; /* freed by SSL_free */
+ tlsdata->ssl = NULL;
+ return -1;
+ }
+
+ /*
+ * currently netsnmp_tlsbase_wrapup_recv is where we check for
+ * algorithm compliance, but for tls we know the algorithms
+ * at this point, so we could bail earlier...
+ */
+#if 0 /* moved checks to netsnmp_tlsbase_wrapup_recv */
+ netsnmp_openssl_null_checks(tlsdata->ssl, &no_auth, NULL);
+ if (no_auth != 0) { /* null/unknown authentication */
+ /* xxx-rks: snmp_increment_statistic(STAT_???); */
+ snmp_log(LOG_ERR, "tlstcp: connection with NULL authentication\n");
+ SSL_shutdown(tlsdata->ssl);
+ SSL_free(tlsdata->ssl);
+ tlsdata->accepted_bio = NULL; /* freed by SSL_free */
+ tlsdata->ssl = NULL;
+ return -1;
+ }
+#endif
+
+ /* RFC5953 Section 5.3.2: Accepting a Session as a Server
+ A (D)TLS server should accept new session connections from any client
+ that it is able to verify the client's credentials for. This is done
+ by authenticating the client's presented certificate through a
+ certificate path validation process (e.g. [RFC5280]) or through
+ certificate fingerprint verification using fingerprints configured in
+ the snmpTlstmCertToTSNTable. Afterward the server will determine the
+ identity of the remote entity using the following procedures.
+
+ The (D)TLS server identifies the authenticated identity from the
+ (D)TLS client's principal certificate using configuration information
+ from the snmpTlstmCertToTSNTable mapping table. The (D)TLS server
+ MUST request and expect a certificate from the client and MUST NOT
+ accept SNMP messages over the (D)TLS connection until the client has
+ sent a certificate and it has been authenticated. The resulting
+ derived tmSecurityName is recorded in the tmStateReference cache as
+ tmSecurityName. The details of the lookup process are fully
+ described in the DESCRIPTION clause of the snmpTlstmCertToTSNTable
+ MIB object. If any verification fails in any way (for example
+ because of failures in cryptographic verification or because of the
+ lack of an appropriate row in the snmpTlstmCertToTSNTable) then the
+ session establishment MUST fail, and the
+ snmpTlstmSessionInvalidClientCertificates object is incremented. If
+ the session can not be opened for any reason at all, including
+ cryptographic verification failures, then the
+ snmpTlstmSessionOpenErrors counter is incremented and processing
+ stops.
+
+ Servers that wish to support multiple principals at a particular port
+ SHOULD make use of a (D)TLS extension that allows server-side
+ principal selection like the Server Name Indication extension defined
+ in Section 3.1 of [RFC4366]. Supporting this will allow, for
+ example, sending notifications to a specific principal at a given TCP
+ or UDP port.
+ */
+ /* Implementation notes:
+ - we expect fingerprints to be stored in the transport config
+ - we do not currently support mulitple principals and only offer one
+ */
+ if ((rc = netsnmp_tlsbase_verify_client_cert(ssl, tlsdata))
+ != SNMPERR_SUCCESS) {
+ /* XXX: free needed memory */
+ snmp_log(LOG_ERR, "TLSTCP: Falied checking client certificate\n");
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCLIENTCERTIFICATES);
+ SSL_shutdown(tlsdata->ssl);
+ SSL_free(tlsdata->ssl);
+ tlsdata->accepted_bio = NULL; /* freed by SSL_free */
+ tlsdata->ssl = NULL;
+ return -1;
+ }
+
+
+ /* XXX: check acceptance criteria here */
+
+ DEBUGMSGTL(("tlstcp", "accept succeeded on sock %d\n", t->sock));
+
+ /* RFC5953 Section 5.1.2 step 1, part2::
+ * If this is the first message received through this session and
+ the session does not have an assigned tlstmSessionID yet then the
+ snmpTlstmSessionAccepts counter is incremented and a
+ tlstmSessionID for the session is created. This will only happen
+ on the server side of a connection because a client would have
+ already assigned a tlstmSessionID during the openSession()
+ invocation. Implementations may have performed the procedures
+ described in Section 5.3.2 prior to this point or they may
+ perform them now, but the procedures described in Section 5.3.2
+ MUST be performed before continuing beyond this point.
+ */
+ /* We're taking option 2 and incrementing the session accepts here
+ rather than upon receiving the first packet */
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONACCEPTS);
+
+ /* XXX: check that it returns something so we can free stuff? */
+ return BIO_get_fd(tlsdata->accepted_bio, NULL);
+}
+
+
+netsnmp_transport *
+netsnmp_tlstcp_open(netsnmp_transport *t)
+{
+ _netsnmpTLSBaseData *tlsdata;
+ BIO *bio;
+ SSL_CTX *ctx;
+ SSL *ssl;
+ int rc = 0;
+ _netsnmp_verify_info *verify_info;
+
+ netsnmp_assert_or_return(t != NULL, NULL);
+ netsnmp_assert_or_return(t->data != NULL, NULL);
+ netsnmp_assert_or_return(sizeof(_netsnmpTLSBaseData) == t->data_length,
+ NULL);
+
+ tlsdata = t->data;
+
+ if (tlsdata->flags & NETSNMP_TLSBASE_IS_CLIENT) {
+ /* Is the client */
+
+ /* RFC5953 Section 5.3.1: Establishing a Session as a Client
+ * 1) The snmpTlstmSessionOpens counter is incremented.
+ */
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENS);
+
+ /* RFC5953 Section 5.3.1: Establishing a Session as a Client
+ 2) The client selects the appropriate certificate and cipher_suites
+ for the key agreement based on the tmSecurityName and the
+ tmRequestedSecurityLevel for the session. For sessions being
+ established as a result of a SNMP-TARGET-MIB based operation, the
+ certificate will potentially have been identified via the
+ snmpTlstmParamsTable mapping and the cipher_suites will have to
+ be taken from system-wide or implementation-specific
+ configuration. If no row in the snmpTlstmParamsTable exists then
+ implementations MAY choose to establish the connection using a
+ default client certificate available to the application.
+ Otherwise, the certificate and appropriate cipher_suites will
+ need to be passed to the openSession() ASI as supplemental
+ information or configured through an implementation-dependent
+ mechanism. It is also implementation-dependent and possibly
+ policy-dependent how tmRequestedSecurityLevel will be used to
+ influence the security capabilities provided by the (D)TLS
+ connection. However this is done, the security capabilities
+ provided by (D)TLS MUST be at least as high as the level of
+ security indicated by the tmRequestedSecurityLevel parameter.
+ The actual security level of the session is reported in the
+ tmStateReference cache as tmSecurityLevel. For (D)TLS to provide
+ strong authentication, each principal acting as a command
+ generator SHOULD have its own certificate.
+ */
+ /*
+ Implementation notes: we do most of this in the
+ sslctx_client_setup The transport should have been
+ f_config()ed with the proper fingerprints to use (which is
+ stored in tlsdata), or we'll use the default identity
+ fingerprint if that can be found.
+ */
+
+ /* XXX: check securityLevel and ensure no NULL fingerprints are used */
+
+ /* set up the needed SSL context */
+ tlsdata->ssl_context = ctx =
+ sslctx_client_setup(TLSv1_method(), tlsdata);
+ if (!ctx) {
+ snmp_log(LOG_ERR, "failed to create TLS context\n");
+ return NULL;
+ }
+
+ /* RFC5953 Section 5.3.1: Establishing a Session as a Client
+ 3) Using the destTransportDomain and destTransportAddress values,
+ the client will initiate the (D)TLS handshake protocol to
+ establish session keys for message integrity and encryption.
+ */
+ /* Implementation note:
+ The transport domain and address are pre-processed by this point
+ */
+
+ /* Create a BIO connection for it */
+ DEBUGMSGTL(("tlstcp", "connecting to tlstcp %s\n",
+ tlsdata->addr_string));
+ t->remote = (void *) strdup(tlsdata->addr_string);
+ t->remote_length = strlen(tlsdata->addr_string) + 1;
+
+ bio = BIO_new_connect(tlsdata->addr_string);
+
+ /* RFC5953 Section 5.3.1: Establishing a Session as a Client
+ 3) continued:
+ If the attempt to establish a session is unsuccessful, then
+ snmpTlstmSessionOpenErrors is incremented, an error indication is
+ returned, and processing stops.
+ */
+
+ if (NULL == bio) {
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENERRORS);
+ snmp_log(LOG_ERR, "tlstcp: failed to create bio\n");
+ _openssl_log_error(rc, NULL, "BIO creation");
+ return NULL;
+ }
+
+
+ /* Tell the BIO to actually do the connection */
+ if ((rc = BIO_do_connect(bio)) <= 0) {
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENERRORS);
+ snmp_log(LOG_ERR, "tlstcp: failed to connect to %s\n",
+ tlsdata->addr_string);
+ _openssl_log_error(rc, NULL, "BIO_do_connect");
+ BIO_free(bio);
+ return NULL;
+ }
+
+ /* Create the SSL layer on top of the socket bio */
+ ssl = tlsdata->ssl = SSL_new(ctx);
+ if (NULL == ssl) {
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENERRORS);
+ snmp_log(LOG_ERR, "tlstcp: failed to create a SSL connection\n");
+ BIO_free(bio);
+ return NULL;
+ }
+
+ /* Bind the SSL layer to the BIO */
+ SSL_set_bio(ssl, bio, bio);
+ SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
+
+ verify_info = SNMP_MALLOC_TYPEDEF(_netsnmp_verify_info);
+ if (NULL == verify_info) {
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENERRORS);
+ snmp_log(LOG_ERR, "tlstcp: failed to create a SSL connection\n");
+ SSL_shutdown(ssl);
+ BIO_free(bio);
+ return NULL;
+ }
+
+ SSL_set_ex_data(ssl, tls_get_verify_info_index(), verify_info);
+
+ /* Then have SSL do it's connection over the BIO */
+ if ((rc = SSL_connect(ssl)) <= 0) {
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONOPENERRORS);
+ snmp_log(LOG_ERR, "tlstcp: failed to ssl_connect\n");
+ BIO_free(bio);
+ return NULL;
+ }
+
+ /* RFC5953 Section 5.3.1: Establishing a Session as a Client
+ 3) continued:
+ If the session failed to open because the presented
+ server certificate was unknown or invalid then the
+ snmpTlstmSessionUnknownServerCertificate or
+ snmpTlstmSessionInvalidServerCertificates MUST be
+ incremented and a snmpTlstmServerCertificateUnknown or
+ snmpTlstmServerInvalidCertificate notification SHOULD be
+ sent as appropriate. Reasons for server certificate
+ invalidation includes, but is not limited to,
+ cryptographic validation failures and an unexpected
+ presented certificate identity.
+ */
+
+ /* RFC5953 Section 5.3.1: Establishing a Session as a Client
+ 4) The (D)TLS client MUST then verify that the (D)TLS server's
+ presented certificate is the expected certificate. The (D)TLS
+ client MUST NOT transmit SNMP messages until the server
+ certificate has been authenticated, the client certificate has
+ been transmitted and the TLS connection has been fully
+ established.
+
+ If the connection is being established from configuration based
+ on SNMP-TARGET-MIB configuration, then the snmpTlstmAddrTable
+ DESCRIPTION clause describes how the verification is done (using
+ either a certificate fingerprint, or an identity authenticated
+ via certification path validation).
+
+ If the connection is being established for reasons other than
+ configuration found in the SNMP-TARGET-MIB then configuration and
+ procedures outside the scope of this document should be followed.
+ Configuration mechanisms SHOULD be similar in nature to those
+ defined in the snmpTlstmAddrTable to ensure consistency across
+ management configuration systems. For example, a command-line
+ tool for generating SNMP GETs might support specifying either the
+ server's certificate fingerprint or the expected host name as a
+ command line argument.
+ */
+
+ /* Implementation notes:
+ - All remote certificate fingerprints are expected to be
+ stored in the transport's config information. This is
+ true both for CLI clients and TARGET-MIB sessions.
+ - netsnmp_tlsbase_verify_server_cert implements these checks
+ */
+ if (netsnmp_tlsbase_verify_server_cert(ssl, tlsdata) != SNMPERR_SUCCESS) {
+ /* XXX: unknown vs invalid; two counters */
+ snmp_increment_statistic(STAT_TLSTM_SNMPTLSTMSESSIONUNKNOWNSERVERCERTIFICATE);
+ snmp_log(LOG_ERR, "tlstcp: failed to verify ssl certificate\n");
+ SSL_shutdown(ssl);
+ BIO_free(bio);
+ return NULL;
+ }
+
+ /* RFC5953 Section 5.3.1: Establishing a Session as a Client
+ 5) (D)TLS provides assurance that the authenticated identity has
+ been signed by a trusted configured certification authority. If
+ verification of the server's certificate fails in any way (for
+ example because of failures in cryptographic verification or the
+ presented identity did not match the expected named entity) then
+ the session establishment MUST fail, the
+ snmpTlstmSessionInvalidServerCertificates object is incremented.
+ If the session can not be opened for any reason at all, including
+ cryptographic verification failures, then the
+ snmpTlstmSessionOpenErrors counter is incremented and processing
+ stops.
+
+ */
+ /* XXX: add snmpTlstmSessionInvalidServerCertificates on
+ crypto failure */
+
+ /* RFC5953 Section 5.3.1: Establishing a Session as a Client
+ 6) The TLSTM-specific session identifier (tlstmSessionID) is set in
+ the tmSessionID of the tmStateReference passed to the TLS
+ Transport Model to indicate that the session has been established
+ successfully and to point to a specific (D)TLS connection for
+ future use. The tlstmSessionID is also stored in the LCD for
+ later lookup during processing of incoming messages
+ (Section 5.1.2).
+ */
+ /* Implementation notes:
+ - the tlsdata pointer is used as our session identifier, as
+ noted in the netsnmp_tlstcp_recv() function comments.
+ */
+
+ t->sock = BIO_get_fd(bio, NULL);
+
+ } else {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ /* Is the server */
+
+ /* Create the socket bio */
+ DEBUGMSGTL(("tlstcp", "listening on tlstcp port %s\n",
+ tlsdata->addr_string));
+ tlsdata->accept_bio = BIO_new_accept(tlsdata->addr_string);
+ t->local = (void *) strdup(tlsdata->addr_string);
+ t->local_length = strlen(tlsdata->addr_string)+1;
+ if (NULL == tlsdata->accept_bio) {
+ snmp_log(LOG_ERR, "TLSTCP: Falied to create a accept BIO\n");
+ return NULL;
+ }
+
+ /* openssl requires an initial accept to bind() the socket */
+ if (BIO_do_accept(tlsdata->accept_bio) <= 0) {
+ _openssl_log_error(rc, tlsdata->ssl, "BIO_do__accept");
+ snmp_log(LOG_ERR, "TLSTCP: Falied to do first accept on the TLS accept BIO\n");
+ return NULL;
+ }
+
+ /* create the OpenSSL TLS context */
+ tlsdata->ssl_context =
+ sslctx_server_setup(TLSv1_method());
+
+ t->sock = BIO_get_fd(tlsdata->accept_bio, NULL);
+ t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN;
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ }
+ return t;
+}
+
+/*
+ * Create a TLS-based transport for SNMP. Local is TRUE if addr is the local
+ * address to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote address to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_tlstcp_transport(const char *addr_string, int isserver)
+{
+ netsnmp_transport *t = NULL;
+ _netsnmpTLSBaseData *tlsdata;
+ char *cp;
+ char buf[SPRINT_MAX_LEN];
+
+#ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (isserver)
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+ /* allocate our transport structure */
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (NULL == t) {
+ return NULL;
+ }
+
+ /* allocate our TLS specific data */
+ if (NULL == (tlsdata = netsnmp_tlsbase_allocate_tlsdata(t, isserver)))
+ return NULL;
+
+ if (!isserver)
+ t->flags |= NETSNMP_TLSBASE_IS_CLIENT;
+
+ tlsdata->addr_string = strdup(addr_string);
+
+ /* see if we can extract the remote hostname */
+ if (!isserver && tlsdata && addr_string) {
+ /* search for a : */
+ if (NULL != (cp = strrchr(addr_string, ':'))) {
+ sprintf(buf, "%.*s",
+ (int) SNMP_MIN(cp - addr_string, sizeof(buf) - 1),
+ addr_string);
+ } else {
+ /* else the entire spec is a host name only */
+ strlcpy(buf, addr_string, sizeof(buf));
+ }
+ tlsdata->their_hostname = strdup(buf);
+ }
+
+ t->data = tlsdata;
+ t->data_length = sizeof(_netsnmpTLSBaseData);
+
+ /*
+ * Set Domain
+ */
+ t->domain = netsnmpTLSTCPDomain;
+ t->domain_length = netsnmpTLSTCPDomain_len;
+
+ /*
+ * 16-bit length field, 8 byte TLS header, 20 byte IPv4 header
+ */
+
+ t->msgMaxSize = 0xffff - 8 - 20;
+ t->f_recv = netsnmp_tlstcp_recv;
+ t->f_send = netsnmp_tlstcp_send;
+ t->f_open = netsnmp_tlstcp_open;
+ t->f_close = netsnmp_tlstcp_close;
+ t->f_accept = netsnmp_tlstcp_accept;
+ t->f_copy = netsnmp_tlstcp_copy;
+ t->f_config = netsnmp_tlsbase_config;
+ t->f_setup_session = netsnmp_tlsbase_session_init;
+ t->f_fmtaddr = netsnmp_tlstcp_fmtaddr;
+
+ t->flags |= NETSNMP_TRANSPORT_FLAG_TUNNELED | NETSNMP_TRANSPORT_FLAG_STREAM;
+
+ return t;
+}
+
+netsnmp_transport *
+netsnmp_tlstcp_create_tstring(const char *str, int local,
+ const char *default_target)
+{
+ char buf[SPRINT_MAX_LEN];
+
+ if (str == NULL || *str == '\0')
+ str = default_target + 1; /* drop the leading : */
+ else if (!strchr(str, ':')) {
+ /* it's either :port or :address. Try to guess which. */
+ const char *cp;
+ int isport = 1;
+ for(cp = str; *cp != '\0'; cp++) {
+ /* if ALL numbers, it must be just a port */
+ /* if it contains anything else, assume a host or ip address */
+ if (!isdigit(0xFF & *cp)) {
+ isport = 0;
+ break;
+ }
+ }
+ if (isport) {
+ /* Just :NNN can be passed to openssl */
+ snprintf(buf, sizeof(buf)-1, "0.0.0.0:%s", str);
+ } else {
+ /* add the default port */
+ snprintf(buf, sizeof(buf)-1, "%s%s", str, default_target);
+ }
+ str = buf;
+ }
+ return netsnmp_tlstcp_transport(str, local);
+}
+
+
+netsnmp_transport *
+netsnmp_tlstcp_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ char buf[SPRINT_MAX_LEN];
+
+ /* ensure buf is big enough */
+ if (o_len > SPRINT_MAX_LEN - 1)
+ return NULL;
+
+ memcpy(buf, o, o_len);
+ buf[o_len] = '\0';
+
+ return netsnmp_tlstcp_transport(buf, local);
+}
+
+void
+netsnmp_tlstcp_ctor(void)
+{
+ DEBUGMSGTL(("tlstcp", "registering TLS constructor\n"));
+
+ /* config settings */
+
+ tlstcpDomain.name = netsnmpTLSTCPDomain;
+ tlstcpDomain.name_length = netsnmpTLSTCPDomain_len;
+ tlstcpDomain.prefix = (const char**)calloc(3, sizeof(char *));
+ tlstcpDomain.prefix[0] = "tlstcp";
+ tlstcpDomain.prefix[1] = "tls";
+
+ tlstcpDomain.f_create_from_tstring = NULL;
+ tlstcpDomain.f_create_from_tstring_new = netsnmp_tlstcp_create_tstring;
+ tlstcpDomain.f_create_from_ostring = netsnmp_tlstcp_create_ostring;
+
+ netsnmp_tdomain_register(&tlstcpDomain);
+}
diff --git a/snmplib/transports/snmpUDPBaseDomain.c b/snmplib/transports/snmpUDPBaseDomain.c
new file mode 100644
index 0000000..612fe74
--- /dev/null
+++ b/snmplib/transports/snmpUDPBaseDomain.c
@@ -0,0 +1,354 @@
+/* UDP base transport support functions
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpUDPBaseDomain.h>
+
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.h>
+#if 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_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+#include <errno.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+#include <net-snmp/library/snmpUDPDomain.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/default_store.h>
+#include <net-snmp/library/system.h>
+#include <net-snmp/library/snmp_assert.h>
+
+void
+_netsnmp_udp_sockopt_set(int fd, int local)
+{
+#ifdef SO_BSDCOMPAT
+ /*
+ * Patch for Linux. Without this, UDP packets that fail get an ICMP
+ * response. Linux turns the failed ICMP response into an error message
+ * and return value, unlike all other OS's.
+ */
+ if (0 == netsnmp_os_prematch("Linux","2.4"))
+ {
+ int one = 1;
+ DEBUGMSGTL(("socket:option", "setting socket option SO_BSDCOMPAT\n"));
+ setsockopt(fd, SOL_SOCKET, SO_BSDCOMPAT, (void *) &one,
+ sizeof(one));
+ }
+#endif /*SO_BSDCOMPAT */
+ /*
+ * SO_REUSEADDR will allow multiple apps to open the same port at
+ * the same time. Only the last one to open the socket will get
+ * data. Obviously, for an agent, this is a bad thing. There should
+ * only be one listener.
+ */
+#ifdef ALLOW_PORT_HIJACKING
+#ifdef SO_REUSEADDR
+ /*
+ * Allow the same port to be specified multiple times without failing.
+ * (useful for a listener)
+ */
+ {
+ int one = 1;
+ DEBUGMSGTL(("socket:option", "setting socket option SO_REUSEADDR\n"));
+ setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *) &one,
+ sizeof(one));
+ }
+#endif /*SO_REUSEADDR */
+#endif
+
+ /*
+ * Try to set the send and receive buffers to a reasonably large value, so
+ * that we can send and receive big PDUs (defaults to 8192 bytes (!) on
+ * Solaris, for instance). Don't worry too much about errors -- just
+ * plough on regardless.
+ */
+ netsnmp_sock_buffer_set(fd, SO_SNDBUF, local, 0);
+ netsnmp_sock_buffer_set(fd, SO_RCVBUF, local, 0);
+}
+
+#if (defined(linux) && defined(IP_PKTINFO)) \
+ || defined(IP_RECVDSTADDR) && HAVE_STRUCT_MSGHDR_MSG_CONTROL \
+ && HAVE_STRUCT_MSGHDR_MSG_FLAGS
+#if defined(linux) && defined(IP_PKTINFO)
+#elif defined(IP_RECVDSTADDR)
+# ifndef IP_SENDSRCADDR
+# define IP_SENDSRCADDR IP_RECVDSTADDR /* DragonFly BSD */
+# endif
+#endif
+
+#define netsnmp_udpbase_recvfrom_sendto_defined
+
+enum {
+#if defined(linux) && defined(IP_PKTINFO)
+ cmsg_data_size = sizeof(struct in_pktinfo)
+#elif defined(IP_RECVDSTADDR)
+ cmsg_data_size = sizeof(struct in_addr)
+#endif
+};
+
+int
+netsnmp_udpbase_recvfrom(int s, void *buf, int len, struct sockaddr *from,
+ socklen_t *fromlen, struct sockaddr *dstip,
+ socklen_t *dstlen, int *if_index)
+{
+ int r;
+ struct iovec iov;
+ char cmsg[CMSG_SPACE(cmsg_data_size)];
+ struct cmsghdr *cm;
+ struct msghdr msg;
+
+ iov.iov_base = buf;
+ iov.iov_len = len;
+
+ memset(&msg, 0, sizeof msg);
+ msg.msg_name = from;
+ msg.msg_namelen = *fromlen;
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = &cmsg;
+ msg.msg_controllen = sizeof(cmsg);
+
+ r = recvmsg(s, &msg, NETSNMP_DONTWAIT);
+
+ if (r == -1) {
+ return -1;
+ }
+
+ DEBUGMSGTL(("udpbase:recv", "got source addr: %s\n",
+ inet_ntoa(((struct sockaddr_in *)from)->sin_addr)));
+
+ {
+ /* Get the local port number for use in diagnostic messages */
+ int r2 = getsockname(s, dstip, dstlen);
+ netsnmp_assert(r2 == 0);
+ }
+
+ for (cm = CMSG_FIRSTHDR(&msg); cm != NULL; cm = CMSG_NXTHDR(&msg, cm)) {
+#if defined(linux) && defined(IP_PKTINFO)
+ if (cm->cmsg_level == SOL_IP && cm->cmsg_type == IP_PKTINFO) {
+ struct in_pktinfo* src = (struct in_pktinfo *)CMSG_DATA(cm);
+ netsnmp_assert(dstip->sa_family == AF_INET);
+ ((struct sockaddr_in*)dstip)->sin_addr = src->ipi_addr;
+ *if_index = src->ipi_ifindex;
+ DEBUGMSGTL(("udpbase:recv",
+ "got destination (local) addr %s, iface %d\n",
+ inet_ntoa(((struct sockaddr_in*)dstip)->sin_addr),
+ *if_index));
+ }
+#elif defined(IP_RECVDSTADDR)
+ if (cm->cmsg_level == IPPROTO_IP && cm->cmsg_type == IP_RECVDSTADDR) {
+ struct in_addr* src = (struct in_addr *)CMSG_DATA(cm);
+ ((struct sockaddr_in*)dstip)->sin_addr = *src;
+ DEBUGMSGTL(("netsnmp_udp", "got destination (local) addr %s\n",
+ inet_ntoa(((struct sockaddr_in*)dstip)->sin_addr)));
+ }
+#endif
+ }
+ return r;
+}
+
+int netsnmp_udpbase_sendto(int fd, struct in_addr *srcip, int if_index,
+ struct sockaddr *remote, void *data, int len)
+{
+ struct iovec iov;
+ struct msghdr m = { 0 };
+ char cmsg[CMSG_SPACE(cmsg_data_size)];
+ int rc;
+
+ iov.iov_base = data;
+ iov.iov_len = len;
+
+ m.msg_name = remote;
+ m.msg_namelen = sizeof(struct sockaddr_in);
+ m.msg_iov = &iov;
+ m.msg_iovlen = 1;
+ m.msg_flags = 0;
+
+ if (srcip && srcip->s_addr != INADDR_ANY) {
+ struct cmsghdr *cm;
+
+ DEBUGMSGTL(("udpbase:sendto", "sending from %s\n", inet_ntoa(*srcip)));
+
+ memset(cmsg, 0, sizeof(cmsg));
+
+ m.msg_control = &cmsg;
+ m.msg_controllen = sizeof(cmsg);
+
+ cm = CMSG_FIRSTHDR(&m);
+ cm->cmsg_len = CMSG_LEN(cmsg_data_size);
+
+#if defined(linux) && defined(IP_PKTINFO)
+ cm->cmsg_level = SOL_IP;
+ cm->cmsg_type = IP_PKTINFO;
+
+ {
+ struct in_pktinfo ipi = { 0 };
+ ipi.ipi_ifindex = 0;
+ ipi.ipi_spec_dst.s_addr = srcip->s_addr;
+ memcpy(CMSG_DATA(cm), &ipi, sizeof(ipi));
+ }
+
+ rc = sendmsg(fd, &m, NETSNMP_NOSIGNAL|NETSNMP_DONTWAIT);
+ if (rc >= 0 || errno != EINVAL)
+ return rc;
+
+ /*
+ * The error might be caused by broadcast srcip (i.e. we're responding
+ * to a broadcast request) - sendmsg does not like it. Try to resend it
+ * using the interface on which it was received
+ */
+
+ DEBUGMSGTL(("udpbase:sendto", "re-sending on iface %d\n", if_index));
+
+ {
+ struct in_pktinfo ipi = { 0 };
+ ipi.ipi_ifindex = if_index;
+ ipi.ipi_spec_dst.s_addr = INADDR_ANY;
+ memcpy(CMSG_DATA(cm), &ipi, sizeof(ipi));
+ }
+#elif defined(IP_SENDSRCADDR)
+ cm->cmsg_level = IPPROTO_IP;
+ cm->cmsg_type = IP_SENDSRCADDR;
+ memcpy((struct in_addr *)CMSG_DATA(cm), srcip, sizeof(struct in_addr));
+#endif
+ rc = sendmsg(fd, &m, NETSNMP_NOSIGNAL|NETSNMP_DONTWAIT);
+ if (rc >= 0 || errno != EINVAL)
+ return rc;
+
+ DEBUGMSGTL(("udpbase:sendto", "re-sending without source address\n"));
+ m.msg_control = NULL;
+ m.msg_controllen = 0;
+ }
+
+ return sendmsg(fd, &m, NETSNMP_NOSIGNAL|NETSNMP_DONTWAIT);
+}
+#endif /* (linux && IP_PKTINFO) || IP_RECVDSTADDR */
+
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+int
+netsnmp_udpbase_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ socklen_t fromlen = sizeof(struct sockaddr);
+ netsnmp_indexed_addr_pair *addr_pair = NULL;
+ struct sockaddr *from;
+
+ if (t != NULL && t->sock >= 0) {
+ addr_pair = (netsnmp_indexed_addr_pair *) malloc(sizeof(netsnmp_indexed_addr_pair));
+ if (addr_pair == NULL) {
+ *opaque = NULL;
+ *olength = 0;
+ return -1;
+ } else {
+ memset(addr_pair, 0, sizeof(netsnmp_indexed_addr_pair));
+ from = &addr_pair->remote_addr.sa;
+ }
+
+ while (rc < 0) {
+#ifdef netsnmp_udpbase_recvfrom_sendto_defined
+ socklen_t local_addr_len = sizeof(addr_pair->local_addr);
+ rc = netsnmp_udp_recvfrom(t->sock, buf, size, from, &fromlen,
+ (struct sockaddr*)&(addr_pair->local_addr),
+ &local_addr_len, &(addr_pair->if_index));
+#else
+ rc = recvfrom(t->sock, buf, size, NETSNMP_DONTWAIT, from, &fromlen);
+#endif /* netsnmp_udpbase_recvfrom_sendto_defined */
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+
+ if (rc >= 0) {
+ DEBUGIF("netsnmp_udp") {
+ char *str = netsnmp_udp_fmtaddr(
+ NULL, addr_pair, sizeof(netsnmp_indexed_addr_pair));
+ DEBUGMSGTL(("netsnmp_udp",
+ "recvfrom fd %d got %d bytes (from %s)\n",
+ t->sock, rc, str));
+ free(str);
+ }
+ } else {
+ DEBUGMSGTL(("netsnmp_udp", "recvfrom fd %d err %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ }
+ *opaque = (void *)addr_pair;
+ *olength = sizeof(netsnmp_indexed_addr_pair);
+ }
+ return rc;
+}
+
+
+
+int
+netsnmp_udpbase_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ netsnmp_indexed_addr_pair *addr_pair = NULL;
+ struct sockaddr *to = NULL;
+
+ if (opaque != NULL && *opaque != NULL &&
+ ((*olength == sizeof(netsnmp_indexed_addr_pair) ||
+ (*olength == sizeof(struct sockaddr_in))))) {
+ addr_pair = (netsnmp_indexed_addr_pair *) (*opaque);
+ } else if (t != NULL && t->data != NULL &&
+ t->data_length == sizeof(netsnmp_indexed_addr_pair)) {
+ addr_pair = (netsnmp_indexed_addr_pair *) (t->data);
+ }
+
+ to = &addr_pair->remote_addr.sa;
+
+ if (to != NULL && t != NULL && t->sock >= 0) {
+ DEBUGIF("netsnmp_udp") {
+ char *str = netsnmp_udp_fmtaddr(NULL, (void *) addr_pair,
+ sizeof(netsnmp_indexed_addr_pair));
+ DEBUGMSGTL(("netsnmp_udp", "send %d bytes from %p to %s on fd %d\n",
+ size, buf, str, t->sock));
+ free(str);
+ }
+ while (rc < 0) {
+#ifdef netsnmp_udpbase_recvfrom_sendto_defined
+ rc = netsnmp_udp_sendto(t->sock,
+ addr_pair ? &(addr_pair->local_addr.sin.sin_addr) : NULL,
+ addr_pair ? addr_pair->if_index : 0, to, buf, size);
+#else
+ rc = sendto(t->sock, buf, size, 0, to, sizeof(struct sockaddr));
+#endif /* netsnmp_udpbase_recvfrom_sendto_defined */
+ if (rc < 0 && errno != EINTR) {
+ DEBUGMSGTL(("netsnmp_udp", "sendto error, rc %d (errno %d)\n",
+ rc, errno));
+ break;
+ }
+ }
+ }
+ return rc;
+}
diff --git a/snmplib/transports/snmpUDPDomain.c b/snmplib/transports/snmpUDPDomain.c
new file mode 100644
index 0000000..638c2b1
--- /dev/null
+++ b/snmplib/transports/snmpUDPDomain.c
@@ -0,0 +1,520 @@
+/* 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 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/types.h>
+#include <net-snmp/library/snmpUDPDomain.h>
+#include <net-snmp/library/snmpUDPIPv4BaseDomain.h>
+
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.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
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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
+#if HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+#include <net-snmp/library/system.h>
+#include <net-snmp/library/tools.h>
+
+#include "inet_ntop.h"
+#include "inet_pton.h"
+
+#ifndef INADDR_NONE
+#define INADDR_NONE -1
+#endif
+
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
+
+static netsnmp_tdomain udpDomain;
+
+/*
+ * needs to be in sync with the definitions in snmplib/snmpTCPDomain.c
+ * and perl/agent/agent.xs
+ */
+typedef netsnmp_indexed_addr_pair netsnmp_udp_addr_pair;
+
+/*
+ * not static, since snmpUDPIPv6Domain needs it, but not public, either.
+ * (ie don't put it in a public header.)
+ */
+void _netsnmp_udp_sockopt_set(int fd, int server);
+int
+netsnmp_sockaddr_in2(struct sockaddr_in *addr,
+ const char *inpeername, const char *default_target);
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+char *
+netsnmp_udp_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ return netsnmp_ipv4_fmtaddr("UDP", t, data, len);
+}
+
+
+
+#if (defined(linux) && defined(IP_PKTINFO)) \
+ || defined(IP_RECVDSTADDR) && HAVE_STRUCT_MSGHDR_MSG_CONTROL \
+ && HAVE_STRUCT_MSGHDR_MSG_FLAGS
+
+int netsnmp_udp_recvfrom(int s, void *buf, int len, struct sockaddr *from, socklen_t *fromlen, struct sockaddr *dstip, socklen_t *dstlen, int *if_index)
+{
+ /** udpiv4 just calls udpbase. should we skip directly to there? */
+ return netsnmp_udpipv4_recvfrom(s, buf, len, from, fromlen, dstip, dstlen,
+ if_index);
+}
+
+int netsnmp_udp_sendto(int fd, struct in_addr *srcip, int if_index, struct sockaddr *remote,
+ void *data, int len)
+{
+ /** udpiv4 just calls udpbase. should we skip directly to there? */
+ return netsnmp_udpipv4_sendto(fd, srcip, if_index, remote, data, len);
+}
+#endif /* (linux && IP_PKTINFO) || IP_RECVDSTADDR */
+
+/*
+ * Open a UDP-based transport for SNMP. Local is TRUE if addr is the local
+ * address to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote address to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_udp_transport(struct sockaddr_in *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+
+ t = netsnmp_udpipv4base_transport(addr, local);
+ if (NULL == t) {
+ return NULL;
+ }
+
+ /*
+ * Set Domain
+ */
+
+ t->domain = netsnmpUDPDomain;
+ t->domain_length = netsnmpUDPDomain_len;
+
+ /*
+ * 16-bit length field, 8 byte UDP header, 20 byte IPv4 header
+ */
+
+ t->msgMaxSize = 0xffff - 8 - 20;
+ t->f_recv = netsnmp_udpbase_recv;
+ t->f_send = netsnmp_udpbase_send;
+ t->f_close = netsnmp_socketbase_close;
+ t->f_accept = NULL;
+ t->f_fmtaddr = netsnmp_udp_fmtaddr;
+
+ return t;
+}
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+/*
+ * The following functions provide the "com2sec" configuration token
+ * functionality for compatibility.
+ */
+
+#define EXAMPLE_NETWORK "NETWORK"
+#define EXAMPLE_COMMUNITY "COMMUNITY"
+
+typedef struct com2SecEntry_s {
+ const char *secName;
+ const char *contextName;
+ struct com2SecEntry_s *next;
+ in_addr_t network;
+ in_addr_t mask;
+ const char community[1];
+} com2SecEntry;
+
+static com2SecEntry *com2SecList = NULL, *com2SecListLast = NULL;
+
+void
+netsnmp_udp_parse_security(const char *token, char *param)
+{
+ char secName[VACMSTRINGLEN + 1];
+ size_t secNameLen;
+ char contextName[VACMSTRINGLEN + 1];
+ size_t contextNameLen;
+ char community[COMMUNITY_MAX_LEN + 1];
+ size_t communityLen;
+ char source[270]; /* dns-name(253)+/(1)+mask(15)+\0(1) */
+ struct in_addr network, mask;
+
+ /*
+ * Get security, source address/netmask and community strings.
+ */
+
+ param = copy_nword( param, secName, sizeof(secName));
+ if (strcmp(secName, "-Cn") == 0) {
+ if (!param) {
+ config_perror("missing CONTEXT_NAME parameter");
+ return;
+ }
+ param = copy_nword( param, contextName, sizeof(contextName));
+ contextNameLen = strlen(contextName) + 1;
+ if (contextNameLen > VACMSTRINGLEN) {
+ config_perror("context name too long");
+ return;
+ }
+ if (!param) {
+ config_perror("missing NAME parameter");
+ return;
+ }
+ param = copy_nword( param, secName, sizeof(secName));
+ } else {
+ contextNameLen = 0;
+ }
+
+ secNameLen = strlen(secName) + 1;
+ if (secNameLen == 1) {
+ config_perror("empty NAME parameter");
+ return;
+ } else if (secNameLen > VACMSTRINGLEN) {
+ config_perror("security name too long");
+ return;
+ }
+
+ if (!param) {
+ config_perror("missing SOURCE parameter");
+ return;
+ }
+ param = copy_nword( param, source, sizeof(source));
+ if (source[0] == '\0') {
+ config_perror("empty SOURCE parameter");
+ return;
+ }
+ if (strncmp(source, EXAMPLE_NETWORK, strlen(EXAMPLE_NETWORK)) == 0) {
+ config_perror("example config NETWORK not properly configured");
+ return;
+ }
+
+ if (!param) {
+ config_perror("missing COMMUNITY parameter");
+ return;
+ }
+ param = copy_nword( param, community, sizeof(community));
+ if (community[0] == '\0') {
+ config_perror("empty COMMUNITY parameter");
+ return;
+ }
+ communityLen = strlen(community) + 1;
+ if (communityLen >= COMMUNITY_MAX_LEN) {
+ config_perror("community name too long");
+ return;
+ }
+ if (communityLen == sizeof(EXAMPLE_COMMUNITY) &&
+ memcmp(community, EXAMPLE_COMMUNITY, sizeof(EXAMPLE_COMMUNITY)) == 0) {
+ config_perror("example config COMMUNITY not properly configured");
+ return;
+ }
+
+ /* Deal with the "default" case first. */
+ if (strcmp(source, "default") == 0) {
+ network.s_addr = 0;
+ mask.s_addr = 0;
+ } else {
+ /* Split the source/netmask parts */
+ char *strmask = strchr(source, '/');
+ if (strmask != NULL)
+ /* Mask given. */
+ *strmask++ = '\0';
+
+ /* Try interpreting as a dotted quad. */
+ if (inet_pton(AF_INET, source, &network) == 0) {
+ /* Nope, wasn't a dotted quad. Must be a hostname. */
+ int ret = netsnmp_gethostbyname_v4(source, &network.s_addr);
+ if (ret < 0) {
+ config_perror("cannot resolve source hostname");
+ return;
+ }
+ }
+
+ /* Now work out the mask. */
+ if (strmask == NULL || *strmask == '\0') {
+ /* No mask was given. Assume /32 */
+ mask.s_addr = (in_addr_t)(~0UL);
+ } else {
+ /* Try to interpret mask as a "number of 1 bits". */
+ char* cp;
+ long maskLen = strtol(strmask, &cp, 10);
+ if (*cp == '\0') {
+ if (0 < maskLen && maskLen <= 32)
+ mask.s_addr = htonl((in_addr_t)(~0UL << (32 - maskLen)));
+ else if (maskLen == 0)
+ mask.s_addr = 0;
+ else {
+ config_perror("bad mask length");
+ return;
+ }
+ }
+ /* Try to interpret mask as a dotted quad. */
+ else if (inet_pton(AF_INET, strmask, &mask) == 0) {
+ config_perror("bad mask");
+ return;
+ }
+
+ /* Check that the network and mask are consistent. */
+ if (network.s_addr & ~mask.s_addr) {
+ config_perror("source/mask mismatch");
+ return;
+ }
+ }
+ }
+
+ {
+ void* v = malloc(offsetof(com2SecEntry, community) + communityLen +
+ secNameLen + contextNameLen);
+
+ com2SecEntry* e = (com2SecEntry*)v;
+ char* last = ((char*)v) + offsetof(com2SecEntry, community);
+
+ if (v == NULL) {
+ config_perror("memory error");
+ return;
+ }
+
+ /*
+ * Everything is okay. Copy the parameters to the structure allocated
+ * above and add it to END of the list.
+ */
+
+ {
+ char buf1[INET_ADDRSTRLEN];
+ char buf2[INET_ADDRSTRLEN];
+ DEBUGMSGTL(("netsnmp_udp_parse_security",
+ "<\"%s\", %s/%s> => \"%s\"\n", community,
+ inet_ntop(AF_INET, &network, buf1, sizeof(buf1)),
+ inet_ntop(AF_INET, &mask, buf2, sizeof(buf2)),
+ secName));
+ }
+
+ memcpy(last, community, communityLen);
+ last += communityLen;
+ memcpy(last, secName, secNameLen);
+ e->secName = last;
+ last += secNameLen;
+ if (contextNameLen) {
+ memcpy(last, contextName, contextNameLen);
+ e->contextName = last;
+ } else
+ e->contextName = last - 1;
+ e->network = network.s_addr;
+ e->mask = mask.s_addr;
+ e->next = NULL;
+
+ if (com2SecListLast != NULL) {
+ com2SecListLast->next = e;
+ com2SecListLast = e;
+ } else {
+ com2SecListLast = com2SecList = e;
+ }
+ }
+}
+
+void
+netsnmp_udp_com2SecList_free(void)
+{
+ com2SecEntry *e = com2SecList;
+ while (e != NULL) {
+ com2SecEntry *tmp = e;
+ e = e->next;
+ free(tmp);
+ }
+ com2SecList = com2SecListLast = NULL;
+}
+#endif /* support for community based SNMP */
+
+void
+netsnmp_udp_agent_config_tokens_register(void)
+{
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ register_app_config_handler("com2sec", netsnmp_udp_parse_security,
+ netsnmp_udp_com2SecList_free,
+ "[-Cn CONTEXT] secName IPv4-network-address[/netmask] community");
+#endif /* support for community based SNMP */
+}
+
+
+
+/*
+ * Return 0 if there are no com2sec entries, or return 1 if there ARE com2sec
+ * entries. On return, if a com2sec entry matched the passed parameters,
+ * then *secName points at the appropriate security name, or is NULL if the
+ * parameters did not match any com2sec entry.
+ */
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+int
+netsnmp_udp_getSecName(void *opaque, int olength,
+ const char *community,
+ size_t community_len, const char **secName,
+ const char **contextName)
+{
+ const com2SecEntry *c;
+ netsnmp_udp_addr_pair *addr_pair = (netsnmp_udp_addr_pair *) opaque;
+ struct sockaddr_in *from = (struct sockaddr_in *) &(addr_pair->remote_addr);
+ char *ztcommunity = NULL;
+
+ if (secName != NULL) {
+ *secName = NULL; /* Haven't found anything yet */
+ }
+
+ /*
+ * Special case if there are NO entries (as opposed to no MATCHING
+ * entries).
+ */
+
+ if (com2SecList == NULL) {
+ DEBUGMSGTL(("netsnmp_udp_getSecName", "no com2sec entries\n"));
+ return 0;
+ }
+
+ /*
+ * If there is no IPv4 source address, then there can be no valid security
+ * name.
+ */
+
+ DEBUGMSGTL(("netsnmp_udp_getSecName", "opaque = %p (len = %d), sizeof = %d, family = %d (%d)\n",
+ opaque, olength, (int)sizeof(netsnmp_udp_addr_pair), from->sin_family, AF_INET));
+ if (opaque == NULL || olength != sizeof(netsnmp_udp_addr_pair) ||
+ from->sin_family != AF_INET) {
+ DEBUGMSGTL(("netsnmp_udp_getSecName",
+ "no IPv4 source address in PDU?\n"));
+ return 1;
+ }
+
+ DEBUGIF("netsnmp_udp_getSecName") {
+ ztcommunity = (char *)malloc(community_len + 1);
+ if (ztcommunity != NULL) {
+ memcpy(ztcommunity, community, community_len);
+ ztcommunity[community_len] = '\0';
+ }
+
+ DEBUGMSGTL(("netsnmp_udp_getSecName", "resolve <\"%s\", 0x%08lx>\n",
+ ztcommunity ? ztcommunity : "<malloc error>",
+ (unsigned long)(from->sin_addr.s_addr)));
+ }
+
+ for (c = com2SecList; c != NULL; c = c->next) {
+ {
+ char buf1[INET_ADDRSTRLEN];
+ char buf2[INET_ADDRSTRLEN];
+ DEBUGMSGTL(("netsnmp_udp_getSecName","compare <\"%s\", %s/%s>",
+ c->community,
+ inet_ntop(AF_INET, &c->network, buf1, sizeof(buf1)),
+ inet_ntop(AF_INET, &c->mask, buf2, sizeof(buf2))));
+ }
+ if ((community_len == strlen(c->community)) &&
+ (memcmp(community, c->community, community_len) == 0) &&
+ ((from->sin_addr.s_addr & c->mask) == c->network)) {
+ DEBUGMSG(("netsnmp_udp_getSecName", "... SUCCESS\n"));
+ if (secName != NULL) {
+ *secName = c->secName;
+ *contextName = c->contextName;
+ }
+ break;
+ }
+ DEBUGMSG(("netsnmp_udp_getSecName", "... nope\n"));
+ }
+ if (ztcommunity != NULL) {
+ free(ztcommunity);
+ }
+ return 1;
+}
+#endif /* support for community based SNMP */
+
+
+netsnmp_transport *
+netsnmp_udp_create_tstring(const char *str, int local,
+ const char *default_target)
+{
+ struct sockaddr_in addr;
+
+ if (netsnmp_sockaddr_in2(&addr, str, default_target)) {
+ return netsnmp_udp_transport(&addr, local);
+ } else {
+ return NULL;
+ }
+}
+
+
+netsnmp_transport *
+netsnmp_udp_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ struct sockaddr_in addr;
+
+ if (o_len == 6) {
+ unsigned short porttmp = (o[4] << 8) + o[5];
+ addr.sin_family = AF_INET;
+ memcpy((u_char *) & (addr.sin_addr.s_addr), o, 4);
+ addr.sin_port = htons(porttmp);
+ return netsnmp_udp_transport(&addr, local);
+ }
+ return NULL;
+}
+
+
+void
+netsnmp_udp_ctor(void)
+{
+ udpDomain.name = netsnmpUDPDomain;
+ udpDomain.name_length = netsnmpUDPDomain_len;
+ udpDomain.prefix = (const char**)calloc(2, sizeof(char *));
+ udpDomain.prefix[0] = "udp";
+
+ udpDomain.f_create_from_tstring = NULL;
+ udpDomain.f_create_from_tstring_new = netsnmp_udp_create_tstring;
+ udpDomain.f_create_from_ostring = netsnmp_udp_create_ostring;
+
+ netsnmp_tdomain_register(&udpDomain);
+}
diff --git a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snmpUDPIPv4BaseDomain.c
new file mode 100644
index 0000000..c67427b
--- /dev/null
+++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c
@@ -0,0 +1,211 @@
+/* IPV4 base transport support functions
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmpUDPIPv4BaseDomain.h>
+
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.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>
+
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/snmp_assert.h>
+#include <net-snmp/library/default_store.h>
+
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+
+#if (defined(linux) && defined(IP_PKTINFO)) \
+ || defined(IP_RECVDSTADDR) && HAVE_STRUCT_MSGHDR_MSG_CONTROL \
+ && HAVE_STRUCT_MSGHDR_MSG_FLAGS
+
+int netsnmp_udpipv4_recvfrom(int s, void *buf, int len, struct sockaddr *from,
+ socklen_t *fromlen, struct sockaddr *dstip,
+ socklen_t *dstlen, int *if_index)
+{
+ return netsnmp_udpbase_recvfrom(s, buf, len, from, fromlen, dstip, dstlen,
+ if_index);
+}
+
+int netsnmp_udpipv4_sendto(int fd, struct in_addr *srcip, int if_index,
+ struct sockaddr *remote, void *data, int len)
+{
+ return netsnmp_udpbase_sendto(fd, srcip, if_index, remote, data, len);
+}
+#endif /* (linux && IP_PKTINFO) || IP_RECVDSTADDR */
+
+netsnmp_transport *
+netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+ int rc = 0, rc2;
+ char *client_socket = NULL;
+ netsnmp_indexed_addr_pair addr_pair;
+ socklen_t local_addr_len;
+
+#ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+ if (addr == NULL || addr->sin_family != AF_INET) {
+ return NULL;
+ }
+
+ memset(&addr_pair, 0, sizeof(netsnmp_indexed_addr_pair));
+ memcpy(&(addr_pair.remote_addr), addr, sizeof(struct sockaddr_in));
+
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ netsnmp_assert_or_return(t != NULL, NULL);
+
+ DEBUGIF("netsnmp_udpbase") {
+ char *str = netsnmp_udp_fmtaddr(NULL, (void *)&addr_pair,
+ sizeof(netsnmp_indexed_addr_pair));
+ DEBUGMSGTL(("netsnmp_udpbase", "open %s %s\n",
+ local ? "local" : "remote", str));
+ free(str);
+ }
+
+ t->sock = socket(PF_INET, SOCK_DGRAM, 0);
+ DEBUGMSGTL(("UDPBase", "openned socket %d as local=%d\n", t->sock, local));
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ _netsnmp_udp_sockopt_set(t->sock, local);
+
+ if (local) {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ /*
+ * This session is inteneded as a server, so we must bind on to the
+ * given IP address, which may include an interface address, or could
+ * be INADDR_ANY, but certainly includes a port number.
+ */
+
+ t->local = (u_char *) malloc(6);
+ if (t->local == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->local, (u_char *) & (addr->sin_addr.s_addr), 4);
+ t->local[4] = (htons(addr->sin_port) & 0xff00) >> 8;
+ t->local[5] = (htons(addr->sin_port) & 0x00ff) >> 0;
+ t->local_length = 6;
+
+#if defined(linux) && defined(IP_PKTINFO)
+ {
+ int sockopt = 1;
+ if (setsockopt(t->sock, SOL_IP, IP_PKTINFO, &sockopt, sizeof sockopt) == -1) {
+ DEBUGMSGTL(("netsnmp_udpbase", "couldn't set IP_PKTINFO: %s\n",
+ strerror(errno)));
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ DEBUGMSGTL(("netsnmp_udpbase", "set IP_PKTINFO\n"));
+ }
+#elif defined(IP_RECVDSTADDR)
+ {
+ int sockopt = 1;
+ if (setsockopt(t->sock, IPPROTO_IP, IP_RECVDSTADDR, &sockopt, sizeof sockopt) == -1) {
+ DEBUGMSGTL(("netsnmp_udp", "couldn't set IP_RECVDSTADDR: %s\n",
+ strerror(errno)));
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ DEBUGMSGTL(("netsnmp_udp", "set IP_RECVDSTADDR\n"));
+ }
+#endif
+ rc = bind(t->sock, (struct sockaddr *) addr,
+ sizeof(struct sockaddr));
+ if (rc != 0) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ t->data = NULL;
+ t->data_length = 0;
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ } else {
+ /*
+ * This is a client session. If we've been given a
+ * client address to send from, then bind to that.
+ * Otherwise the send will use "something sensible".
+ */
+ client_socket = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CLIENT_ADDR);
+ if (client_socket) {
+ struct sockaddr_in client_addr;
+ netsnmp_sockaddr_in2(&client_addr, client_socket, NULL);
+ client_addr.sin_port = 0;
+ DEBUGMSGTL(("netsnmp_udpbase", "binding socket: %d\n", t->sock));
+ rc = bind(t->sock, (struct sockaddr *)&client_addr,
+ sizeof(struct sockaddr));
+ if ( rc != 0 ) {
+ DEBUGMSGTL(("netsnmp_udpbase", "failed to bind for clientaddr: %d %s\n",
+ errno, strerror(errno)));
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ local_addr_len = sizeof(addr_pair.local_addr);
+ rc2 = getsockname(t->sock, (struct sockaddr*)&addr_pair.local_addr,
+ &local_addr_len);
+ netsnmp_assert(rc2 == 0);
+ }
+
+ DEBUGIF("netsnmp_udpbase") {
+ char *str = netsnmp_udp_fmtaddr(NULL, (void *)&addr_pair,
+ sizeof(netsnmp_indexed_addr_pair));
+ DEBUGMSGTL(("netsnmp_udpbase", "client open %s\n", str));
+ free(str);
+ }
+
+ /*
+ * Save the (remote) address in the
+ * transport-specific data pointer for later use by netsnmp_udp_send.
+ */
+
+ t->data = malloc(sizeof(netsnmp_indexed_addr_pair));
+ t->remote = (u_char *)malloc(6);
+ if (t->data == NULL || t->remote == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->remote, (u_char *) & (addr->sin_addr.s_addr), 4);
+ t->remote[4] = (htons(addr->sin_port) & 0xff00) >> 8;
+ t->remote[5] = (htons(addr->sin_port) & 0x00ff) >> 0;
+ t->remote_length = 6;
+ memcpy(t->data, &addr_pair, sizeof(netsnmp_indexed_addr_pair));
+ t->data_length = sizeof(netsnmp_indexed_addr_pair);
+ }
+
+ return t;
+}
diff --git a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c
new file mode 100644
index 0000000..b3eaae4
--- /dev/null
+++ b/snmplib/transports/snmpUDPIPv6Domain.c
@@ -0,0 +1,788 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/library/snmpUDPIPv6Domain.h>
+#include <net-snmp/library/system.h>
+
+#include <net-snmp/types.h>
+
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.h>
+#include <errno.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <stddef.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#if defined(HAVE_WINSOCK_H) && !defined(mingw32)
+static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
+#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
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#if HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+#define SS_FAMILY ss_family
+#elif HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
+#define SS_FAMILY __ss_family
+#endif
+
+#if defined(darwin)
+#include <stdint.h> /* for uint8_t */
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+#include <net-snmp/library/tools.h>
+
+#include "inet_ntop.h"
+#include "inet_pton.h"
+
+oid netsnmp_UDPIPv6Domain[] = { TRANSPORT_DOMAIN_UDP_IPV6 };
+static netsnmp_tdomain udp6Domain;
+
+/*
+ * from snmpUDPDomain. not static, but not public, either.
+ * (ie don't put it in a public header.)
+ */
+extern void _netsnmp_udp_sockopt_set(int fd, int server);
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+static char *
+netsnmp_udp6_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ return netsnmp_ipv6_fmtaddr("UDP/IPv6", t, data, len);
+}
+
+
+
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+static int
+netsnmp_udp6_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ socklen_t fromlen = sizeof(struct sockaddr_in6);
+ struct sockaddr *from;
+
+ if (t != NULL && t->sock >= 0) {
+ from = (struct sockaddr *) malloc(sizeof(struct sockaddr_in6));
+ if (from == NULL) {
+ *opaque = NULL;
+ *olength = 0;
+ return -1;
+ } else {
+ memset(from, 0, fromlen);
+ }
+
+ while (rc < 0) {
+ rc = recvfrom(t->sock, buf, size, 0, from, &fromlen);
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+
+ if (rc >= 0) {
+ DEBUGIF("netsnmp_udp6") {
+ char *str = netsnmp_udp6_fmtaddr(NULL, from, fromlen);
+ DEBUGMSGTL(("netsnmp_udp6",
+ "recvfrom fd %d got %d bytes (from %s)\n", t->sock,
+ rc, str));
+ free(str);
+ }
+ } else {
+ DEBUGMSGTL(("netsnmp_udp6", "recvfrom fd %d err %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ }
+ *opaque = (void *) from;
+ *olength = sizeof(struct sockaddr_in6);
+ }
+ return rc;
+}
+
+
+
+static int
+netsnmp_udp6_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ struct sockaddr *to = NULL;
+
+ if (opaque != NULL && *opaque != NULL &&
+ *olength == sizeof(struct sockaddr_in6)) {
+ to = (struct sockaddr *) (*opaque);
+ } else if (t != NULL && t->data != NULL &&
+ ((t->data_length == sizeof(struct sockaddr_in6)) ||
+ (t->data_length == sizeof(netsnmp_indexed_addr_pair)))) {
+ to = (struct sockaddr *) (t->data);
+ }
+
+ if (to != NULL && t != NULL && t->sock >= 0) {
+ DEBUGIF("netsnmp_udp6") {
+ char *str = netsnmp_udp6_fmtaddr(NULL, (void *)to,
+ sizeof(struct sockaddr_in6));
+ DEBUGMSGTL(("netsnmp_udp6",
+ "send %d bytes from %p to %s on fd %d\n",
+ size, buf, str, t->sock));
+ free(str);
+ }
+ while (rc < 0) {
+ rc = sendto(t->sock, buf, size, 0, to,sizeof(struct sockaddr_in6));
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ }
+ return rc;
+}
+
+
+/*
+ * Open a UDP/IPv6-based transport for SNMP. Local is TRUE if addr is the
+ * local address to bind to (i.e. this is a server-type session); otherwise
+ * addr is the remote address to send things to.
+ */
+
+netsnmp_transport *
+netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+ int rc = 0;
+
+#ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+ if (addr == NULL || addr->sin6_family != AF_INET6) {
+ return NULL;
+ }
+
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (t == NULL) {
+ return NULL;
+ }
+
+ DEBUGIF("netsnmp_udp6") {
+ char *str = netsnmp_udp6_fmtaddr(NULL, (void *) addr,
+ sizeof(struct sockaddr_in6));
+ DEBUGMSGTL(("netsnmp_udp6", "open %s %s\n", local ? "local" : "remote",
+ str));
+ free(str);
+ }
+
+ t->domain = netsnmp_UDPIPv6Domain;
+ t->domain_length =
+ sizeof(netsnmp_UDPIPv6Domain) / sizeof(netsnmp_UDPIPv6Domain[0]);
+
+ t->sock = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ _netsnmp_udp_sockopt_set(t->sock, local);
+
+ if (local) {
+#ifndef NETSNMP_NO_LISTEN_SUPPORT
+ /*
+ * This session is intended as a server, so we must bind on to the
+ * given IP address, which may include an interface address, or could
+ * be INADDR_ANY, but certainly includes a port number.
+ */
+
+#ifdef IPV6_V6ONLY
+ /* Try to restrict PF_INET6 socket to IPv6 communications only. */
+ {
+ int one=1;
+ if (setsockopt(t->sock, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&one, sizeof(one)) != 0) {
+ DEBUGMSGTL(("netsnmp_udp6", "couldn't set IPV6_V6ONLY to %d bytes: %s\n", one, strerror(errno)));
+ }
+ }
+#endif
+
+ rc = bind(t->sock, (struct sockaddr *) addr,
+ sizeof(struct sockaddr_in6));
+ if (rc != 0) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ t->local = (unsigned char*)malloc(18);
+ if (t->local == NULL) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->local, addr->sin6_addr.s6_addr, 16);
+ t->local[16] = (addr->sin6_port & 0xff00) >> 8;
+ t->local[17] = (addr->sin6_port & 0x00ff) >> 0;
+ t->local_length = 18;
+ t->data = NULL;
+ t->data_length = 0;
+#else /* NETSNMP_NO_LISTEN_SUPPORT */
+ return NULL;
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ } else {
+ /*
+ * This is a client session. Save the address in the
+ * transport-specific data pointer for later use by netsnmp_udp6_send.
+ */
+
+ t->data = malloc(sizeof(netsnmp_indexed_addr_pair));
+ if (t->data == NULL) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->data, addr, sizeof(struct sockaddr_in6));
+ t->data_length = sizeof(netsnmp_indexed_addr_pair);
+ t->remote = (unsigned char*)malloc(18);
+ if (t->remote == NULL) {
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->remote, addr->sin6_addr.s6_addr, 16);
+ t->remote[16] = (addr->sin6_port & 0xff00) >> 8;
+ t->remote[17] = (addr->sin6_port & 0x00ff) >> 0;
+ t->remote_length = 18;
+ }
+
+ /*
+ * 16-bit length field, 8 byte UDP header, 40 byte IPv6 header.
+ */
+
+ t->msgMaxSize = 0xffff - 8 - 40;
+ t->f_recv = netsnmp_udp6_recv;
+ t->f_send = netsnmp_udp6_send;
+ t->f_close = netsnmp_socketbase_close;
+ t->f_accept = NULL;
+ t->f_fmtaddr = netsnmp_udp6_fmtaddr;
+
+ return t;
+}
+
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+/*
+ * The following functions provide the "com2sec6" configuration token
+ * functionality for compatibility.
+ */
+
+#define EXAMPLE_NETWORK "NETWORK"
+#define EXAMPLE_COMMUNITY "COMMUNITY"
+
+typedef struct com2Sec6Entry_s {
+ const char *secName;
+ const char *contextName;
+ struct com2Sec6Entry_s *next;
+ struct in6_addr network;
+ struct in6_addr mask;
+ const char community[1];
+} com2Sec6Entry;
+
+static com2Sec6Entry *com2Sec6List = NULL, *com2Sec6ListLast = NULL;
+
+
+NETSNMP_STATIC_INLINE int
+create_com2Sec6Entry(const struct addrinfo* const run,
+ const struct in6_addr* const mask,
+ const char* const secName,
+ const size_t secNameLen,
+ const char* const contextName,
+ const size_t contextNameLen,
+ const char* const community,
+ const size_t communityLen,
+ com2Sec6Entry** const begin,
+ com2Sec6Entry** const end)
+{
+ const struct sockaddr_in6 * const run_addr =
+ (const struct sockaddr_in6*)run->ai_addr;
+ int i;
+
+ /* Check that the network and mask are consistent. */
+ for (i = 0; i < 16; ++i) {
+ if (run_addr->sin6_addr.s6_addr[i] & ~mask->s6_addr[i]) {
+ config_perror("source/mask mismatch");
+ return 1;
+ }
+ }
+
+ {
+ char buf1[INET6_ADDRSTRLEN];
+ char buf2[INET6_ADDRSTRLEN];
+ DEBUGMSGTL(("netsnmp_udp6_parse_security",
+ "<\"%s\", %s/%s> => \"%s\"\n",
+ community,
+ inet_ntop(AF_INET6, &run_addr->sin6_addr,
+ buf1, sizeof(buf1)),
+ inet_ntop(AF_INET6, mask, buf2, sizeof(buf2)),
+ secName));
+ }
+
+ {
+ /* Allocate all the needed chunks */
+ void * const v =
+ malloc(offsetof(com2Sec6Entry, community) + communityLen +
+ secNameLen + contextNameLen);
+
+ com2Sec6Entry* const e = (com2Sec6Entry*)v;
+ char *last = ((char*)v) + offsetof(com2Sec6Entry, community);
+
+ if (v == NULL) {
+ config_perror("memory error");
+ return 1;
+ }
+
+ memcpy(last, community, communityLen);
+ last += communityLen;
+
+ memcpy(last, secName, secNameLen);
+ e->secName = last;
+ last += secNameLen;
+
+ if (contextNameLen) {
+ memcpy(last, contextName, contextNameLen);
+ e->contextName = last;
+ } else
+ e->contextName = last - 1;
+
+ memcpy(&e->network, &run_addr->sin6_addr, sizeof(struct in6_addr));
+ memcpy(&e->mask, mask, sizeof(struct in6_addr));
+
+ e->next = NULL;
+ if (*end != NULL) {
+ (*end)->next = e;
+ *end = e;
+ } else {
+ *end = *begin = e;
+ }
+ }
+ return 0;
+}
+
+void
+netsnmp_udp6_parse_security(const char *token, char *param)
+{
+ char secName[VACMSTRINGLEN + 1];
+ size_t secNameLen;
+ char contextName[VACMSTRINGLEN + 1];
+ size_t contextNameLen;
+ char community[COMMUNITY_MAX_LEN + 1];
+ size_t communityLen;
+ char source[300]; /* dns-name(253)+/(1)+mask(45)+\0(1) */
+ struct in6_addr mask;
+
+ /*
+ * Get security, source address/netmask and community strings.
+ */
+
+ param = copy_nword( param, secName, sizeof(secName));
+ if (strcmp(secName, "-Cn") == 0) {
+ if (!param) {
+ config_perror("missing CONTEXT_NAME parameter");
+ return;
+ }
+ param = copy_nword( param, contextName, sizeof(contextName));
+ contextNameLen = strlen(contextName) + 1;
+ if (contextNameLen > VACMSTRINGLEN) {
+ config_perror("context name too long");
+ return;
+ }
+ if (!param) {
+ config_perror("missing NAME parameter");
+ return;
+ }
+ param = copy_nword( param, secName, sizeof(secName));
+ } else {
+ contextNameLen = 0;
+ }
+
+ secNameLen = strlen(secName) + 1;
+ if (secNameLen == 1) {
+ config_perror("empty NAME parameter");
+ return;
+ } else if (secNameLen > VACMSTRINGLEN) {
+ config_perror("security name too long");
+ return;
+ }
+
+ if (!param) {
+ config_perror("missing SOURCE parameter");
+ return;
+ }
+ param = copy_nword( param, source, sizeof(source));
+ if (source[0] == '\0') {
+ config_perror("empty SOURCE parameter");
+ return;
+ }
+ if (strncmp(source, EXAMPLE_NETWORK, strlen(EXAMPLE_NETWORK)) == 0) {
+ config_perror("example config NETWORK not properly configured");
+ return;
+ }
+
+ if (!param) {
+ config_perror("missing COMMUNITY parameter");
+ return;
+ }
+ param = copy_nword( param, community, sizeof(community));
+ if (community[0] == '\0') {
+ config_perror("empty COMMUNITY parameter");
+ return;
+ }
+ communityLen = strlen(community) + 1;
+ if (communityLen >= COMMUNITY_MAX_LEN) {
+ config_perror("community name too long");
+ return;
+ }
+ if (communityLen == sizeof(EXAMPLE_COMMUNITY) &&
+ memcmp(community, EXAMPLE_COMMUNITY, sizeof(EXAMPLE_COMMUNITY)) == 0) {
+ config_perror("example config COMMUNITY not properly configured");
+ return;
+ }
+
+ /* Possible mask cases
+ * "default" <=> 0::0/0
+ * <hostname>[/] <=> <hostname>/128
+ * <hostname>/number <=> <hostname>/number
+ * <hostname>/<mask> <=> <hostname>/<mask>
+ */
+ {
+ /* Deal with the "default" case first. */
+ const int isdefault = strcmp(source, "default") == 0;
+
+ if (isdefault) {
+ memset(mask.s6_addr, '\0', sizeof(mask.s6_addr));
+ } else {
+ /* Split the source/netmask parts */
+ char *strmask = strchr(source, '/');
+ if (strmask != NULL)
+ /* Mask given. */
+ *strmask++ = '\0';
+
+ /* Try to interpret the mask */
+ if (strmask == NULL || *strmask == '\0') {
+ /* No mask was given. Assume /128 */
+ memset(mask.s6_addr, '\xff', sizeof(mask.s6_addr));
+ } else {
+ /* Try to interpret mask as a "number of 1 bits". */
+ char* cp;
+ long masklength = strtol(strmask, &cp, 10);
+ if (*cp == '\0') {
+ if (0 <= masklength && masklength <= 128) {
+ const int j = masklength / 8;
+ const int jj = masklength % 8;
+ memset(mask.s6_addr, '\xff', j);
+ if (j < 16) {
+ mask.s6_addr[j] = ((uint8_t)~0U << (8 - jj));
+ memset(mask.s6_addr + j + 1, '\0', 15 - j);
+ }
+ } else {
+ config_perror("bad mask length");
+ return;
+ }
+ }
+ /* Try to interpret mask numerically. */
+ else if (inet_pton(AF_INET6, strmask, &mask) != 1) {
+ config_perror("bad mask");
+ return;
+ }
+ }
+ }
+
+ {
+ struct sockaddr_in6 pton_addr;
+ struct addrinfo hints, *res = NULL;
+ memset(&hints, '\0', sizeof(hints));
+
+ /* First check if default, otherwise try to parse as a numeric
+ * address, if that also fails try to lookup the address */
+ if (isdefault) {
+ memset(&pton_addr.sin6_addr.s6_addr, '\0',
+ sizeof(struct in6_addr));
+ } else if (inet_pton(AF_INET6, source, &pton_addr.sin6_addr) != 1) {
+ /* Nope, wasn't a numeric address. Must be a hostname. */
+#if HAVE_GETADDRINFO
+ int gai_error;
+
+ hints.ai_family = AF_INET6;
+ hints.ai_socktype = SOCK_DGRAM;
+ gai_error = netsnmp_getaddrinfo(source, NULL, &hints, &res);
+ if (gai_error != 0) {
+ config_perror(gai_strerror(gai_error));
+ return;
+ }
+#else
+ config_perror("getaddrinfo() not available");
+ return;
+#endif
+ }
+ if (res == NULL) {
+ hints.ai_addrlen = sizeof(pton_addr);
+ hints.ai_addr = (struct sockaddr*)&pton_addr;
+ hints.ai_next = NULL;
+ res = &hints;
+ }
+
+ {
+ struct addrinfo *run;
+ int failed = 0;
+ com2Sec6Entry *begin = NULL, *end = NULL;
+
+ for (run = res; run && !failed; run = run->ai_next)
+ failed =
+ create_com2Sec6Entry(run, &mask,
+ secName, secNameLen,
+ contextName, contextNameLen,
+ community, communityLen,
+ &begin, &end);
+
+ if (failed) {
+ /* Free eventually allocated chunks */
+ while (begin) {
+ end = begin;
+ begin = begin->next;
+ free(end);
+ }
+ } else if (com2Sec6ListLast != NULL) {
+ com2Sec6ListLast->next = begin;
+ com2Sec6ListLast = end;
+ } else {
+ com2Sec6List = begin;
+ com2Sec6ListLast = end;
+ }
+ }
+#if HAVE_GETADDRINFO
+ if (res != &hints)
+ freeaddrinfo(res);
+#endif
+ }
+ }
+}
+
+void
+netsnmp_udp6_com2Sec6List_free(void)
+{
+ com2Sec6Entry *e = com2Sec6List;
+ while (e != NULL) {
+ com2Sec6Entry *tmp = e;
+ e = e->next;
+ free(tmp);
+ }
+ com2Sec6List = com2Sec6ListLast = NULL;
+}
+
+#endif /* support for community based SNMP */
+
+void
+netsnmp_udp6_agent_config_tokens_register(void)
+{
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ register_app_config_handler("com2sec6", netsnmp_udp6_parse_security,
+ netsnmp_udp6_com2Sec6List_free,
+ "[-Cn CONTEXT] secName IPv6-network-address[/netmask] community");
+#endif /* support for community based SNMP */
+}
+
+
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+
+/*
+ * Return 0 if there are no com2sec entries, or return 1 if there ARE com2sec
+ * entries. On return, if a com2sec entry matched the passed parameters,
+ * then *secName points at the appropriate security name, or is NULL if the
+ * parameters did not match any com2sec entry.
+ */
+
+int
+netsnmp_udp6_getSecName(void *opaque, int olength,
+ const char *community,
+ int community_len,
+ const char **secName, const char **contextName)
+{
+ const com2Sec6Entry *c;
+ struct sockaddr_in6 *from = (struct sockaddr_in6 *) opaque;
+ char *ztcommunity = NULL;
+ char str6[INET6_ADDRSTRLEN];
+
+ if (secName != NULL) {
+ *secName = NULL; /* Haven't found anything yet */
+ }
+
+ /*
+ * Special case if there are NO entries (as opposed to no MATCHING
+ * entries).
+ */
+
+ if (com2Sec6List == NULL) {
+ DEBUGMSGTL(("netsnmp_udp6_getSecName", "no com2sec entries\n"));
+ return 0;
+ }
+
+ /*
+ * If there is no IPv6 source address, then there can be no valid security
+ * name.
+ */
+
+ if (opaque == NULL || olength != sizeof(struct sockaddr_in6)
+ || from->sin6_family != PF_INET6) {
+ DEBUGMSGTL(("netsnmp_udp6_getSecName",
+ "no IPv6 source address in PDU?\n"));
+ return 1;
+ }
+
+ ztcommunity = (char *) malloc(community_len + 1);
+ if (ztcommunity != NULL) {
+ memcpy(ztcommunity, community, community_len);
+ ztcommunity[community_len] = '\0';
+ }
+
+ inet_ntop(AF_INET6, &from->sin6_addr, str6, sizeof(str6));
+ DEBUGMSGTL(("netsnmp_udp6_getSecName", "resolve <\"%s\", %s>\n",
+ ztcommunity ? ztcommunity : "<malloc error>", str6));
+
+ for (c = com2Sec6List; c != NULL; c = c->next) {
+ {
+ char buf1[INET6_ADDRSTRLEN];
+ char buf2[INET6_ADDRSTRLEN];
+ DEBUGMSGTL(("netsnmp_udp6_getSecName",
+ "compare <\"%s\", %s/%s>", c->community,
+ inet_ntop(AF_INET6, &c->network, buf1, sizeof(buf1)),
+ inet_ntop(AF_INET6, &c->mask, buf2, sizeof(buf2))));
+ }
+ if ((community_len == (int)strlen(c->community)) &&
+ (memcmp(community, c->community, community_len) == 0)) {
+ int i, ok = 1;
+ for (i = 0; ok && i < 16; ++i)
+ if ((from->sin6_addr.s6_addr[i] & c->mask.s6_addr[i]) !=
+ c->network.s6_addr[i])
+ ok = 0;
+ if (ok) {
+ DEBUGMSG(("netsnmp_udp6_getSecName", "... SUCCESS\n"));
+ if (secName != NULL) {
+ *secName = c->secName;
+ *contextName = c->contextName;
+ }
+ }
+ }
+ }
+ DEBUGMSG(("netsnmp_udp6_getSecName", "... nope\n"));
+
+ if (ztcommunity != NULL) {
+ free(ztcommunity);
+ }
+ return 1;
+}
+#endif /* support for community based SNMP */
+
+netsnmp_transport *
+netsnmp_udp6_create_tstring(const char *str, int local,
+ const char *default_target)
+{
+ struct sockaddr_in6 addr;
+
+ if (netsnmp_sockaddr_in6_2(&addr, str, default_target)) {
+ return netsnmp_udp6_transport(&addr, local);
+ } else {
+ return NULL;
+ }
+}
+
+
+/*
+ * See:
+ *
+ * http://www.ietf.org/internet-drafts/draft-ietf-ops-taddress-mib-01.txt
+ *
+ * (or newer equivalent) for details of the TC which we are using for
+ * the mapping here.
+ */
+
+netsnmp_transport *
+netsnmp_udp6_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ struct sockaddr_in6 addr;
+
+ if (o_len == 18) {
+ memset((u_char *) & addr, 0, sizeof(struct sockaddr_in6));
+ addr.sin6_family = AF_INET6;
+ memcpy((u_char *) & (addr.sin6_addr.s6_addr), o, 16);
+ addr.sin6_port = (o[16] << 8) + o[17];
+ return netsnmp_udp6_transport(&addr, local);
+ }
+ return NULL;
+}
+
+
+void
+netsnmp_udpipv6_ctor(void)
+{
+ udp6Domain.name = netsnmp_UDPIPv6Domain;
+ udp6Domain.name_length = sizeof(netsnmp_UDPIPv6Domain) / sizeof(oid);
+ udp6Domain.f_create_from_tstring = NULL;
+ udp6Domain.f_create_from_tstring_new = netsnmp_udp6_create_tstring;
+ udp6Domain.f_create_from_ostring = netsnmp_udp6_create_ostring;
+ udp6Domain.prefix = (const char**)calloc(5, sizeof(char *));
+ udp6Domain.prefix[0] = "udp6";
+ udp6Domain.prefix[1] = "ipv6";
+ udp6Domain.prefix[2] = "udpv6";
+ udp6Domain.prefix[3] = "udpipv6";
+
+ netsnmp_tdomain_register(&udp6Domain);
+}
+
+#else
+
+#ifdef NETSNMP_DLL
+/* need this hook for win32 MSVC++ DLL build */
+void
+netsnmp_udp6_agent_config_tokens_register(void)
+{ }
+#endif
+
+#endif /* NETSNMP_TRANSPORT_UDPIPV6_DOMAIN */
+
diff --git a/snmplib/transports/snmpUnixDomain.c b/snmplib/transports/snmpUnixDomain.c
new file mode 100644
index 0000000..674dc2b
--- /dev/null
+++ b/snmplib/transports/snmpUnixDomain.c
@@ -0,0 +1,752 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <sys/types.h>
+#include <net-snmp/library/snmpUnixDomain.h>
+
+#include <stddef.h>
+#include <stdio.h>
+#include <ctype.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
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_transport.h>
+#include <net-snmp/library/snmpSocketBaseDomain.h>
+#include <net-snmp/library/system.h> /* mkdirhier */
+#include <net-snmp/library/tools.h>
+
+netsnmp_feature_child_of(transport_unix_socket_all, transport_all)
+netsnmp_feature_child_of(unix_socket_paths, transport_unix_socket_all)
+
+#ifndef NETSNMP_STREAM_QUEUE_LEN
+#define NETSNMP_STREAM_QUEUE_LEN 5
+#endif
+
+#ifndef SUN_LEN
+/*
+ * Evaluate to actual length of the `sockaddr_un' structure.
+ */
+#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ + strlen ((ptr)->sun_path))
+#endif
+
+oid netsnmp_UnixDomain[] = { TRANSPORT_DOMAIN_LOCAL };
+static netsnmp_tdomain unixDomain;
+
+
+/*
+ * This is the structure we use to hold transport-specific data.
+ */
+
+typedef struct _sockaddr_un_pair {
+ int local;
+ struct sockaddr_un server;
+ struct sockaddr_un client;
+} sockaddr_un_pair;
+
+
+/*
+ * Return a string representing the address in data, or else the "far end"
+ * address if data is NULL.
+ */
+
+static char *
+netsnmp_unix_fmtaddr(netsnmp_transport *t, void *data, int len)
+{
+ struct sockaddr_un *to = NULL;
+
+ if (data != NULL) {
+ to = (struct sockaddr_un *) data;
+ } else if (t != NULL && t->data != NULL) {
+ to = &(((sockaddr_un_pair *) t->data)->server);
+ len = SUN_LEN(to);
+ }
+ if (to == NULL) {
+ /*
+ * "Local IPC" is the Posix.1g term for Unix domain protocols,
+ * according to W. R. Stevens, ``Unix Network Programming Volume I
+ * Second Edition'', p. 374.
+ */
+ return strdup("Local IPC: unknown");
+ } else if (to->sun_path[0] == 0) {
+ /*
+ * This is an abstract name. We could render it as hex or something
+ * but let's not worry about that for now.
+ */
+ return strdup("Local IPC: abstract");
+ } else {
+ char *tmp = (char *) malloc(16 + len);
+ if (tmp != NULL) {
+ sprintf(tmp, "Local IPC: %s", to->sun_path);
+ }
+ return tmp;
+ }
+}
+
+
+
+/*
+ * You can write something into opaque that will subsequently get passed back
+ * to your send function if you like. For instance, you might want to
+ * remember where a PDU came from, so that you can send a reply there...
+ */
+
+static int
+netsnmp_unix_recv(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+ socklen_t tolen = sizeof(struct sockaddr_un);
+ struct sockaddr *to;
+
+
+ if (t != NULL && t->sock >= 0) {
+ to = (struct sockaddr *) malloc(sizeof(struct sockaddr_un));
+ if (to == NULL) {
+ *opaque = NULL;
+ *olength = 0;
+ return -1;
+ } else {
+ memset(to, 0, tolen);
+ }
+ if(getsockname(t->sock, to, &tolen) != 0){
+ free(to);
+ *opaque = NULL;
+ *olength = 0;
+ return -1;
+ };
+ while (rc < 0) {
+#ifdef MSG_DONTWAIT
+ rc = recvfrom(t->sock, buf, size, MSG_DONTWAIT, NULL, NULL);
+#else
+ rc = recvfrom(t->sock, buf, size, 0, NULL, NULL);
+#endif
+ if (rc < 0 && errno != EINTR) {
+ DEBUGMSGTL(("netsnmp_unix", "recv fd %d err %d (\"%s\")\n",
+ t->sock, errno, strerror(errno)));
+ return rc;
+ }
+ *opaque = (void*)to;
+ *olength = sizeof(struct sockaddr_un);
+ }
+ DEBUGMSGTL(("netsnmp_unix", "recv fd %d got %d bytes\n", t->sock, rc));
+ }
+ return rc;
+}
+
+
+
+static int
+netsnmp_unix_send(netsnmp_transport *t, void *buf, int size,
+ void **opaque, int *olength)
+{
+ int rc = -1;
+
+ if (t != NULL && t->sock >= 0) {
+ DEBUGMSGTL(("netsnmp_unix", "send %d bytes to %p on fd %d\n",
+ size, buf, t->sock));
+ while (rc < 0) {
+ rc = sendto(t->sock, buf, size, 0, NULL, 0);
+ if (rc < 0 && errno != EINTR) {
+ break;
+ }
+ }
+ }
+ return rc;
+}
+
+
+
+static int
+netsnmp_unix_close(netsnmp_transport *t)
+{
+ int rc = 0;
+ sockaddr_un_pair *sup = (sockaddr_un_pair *) t->data;
+
+ if (t->sock >= 0) {
+#ifndef HAVE_CLOSESOCKET
+ rc = close(t->sock);
+#else
+ rc = closesocket(t->sock);
+#endif
+ t->sock = -1;
+ if (sup != NULL) {
+ if (sup->local) {
+ if (sup->server.sun_path[0] != 0) {
+ DEBUGMSGTL(("netsnmp_unix", "close: server unlink(\"%s\")\n",
+ sup->server.sun_path));
+ unlink(sup->server.sun_path);
+ }
+ } else {
+ if (sup->client.sun_path[0] != 0) {
+ DEBUGMSGTL(("netsnmp_unix", "close: client unlink(\"%s\")\n",
+ sup->client.sun_path));
+ unlink(sup->client.sun_path);
+ }
+ }
+ }
+ return rc;
+ } else {
+ return -1;
+ }
+}
+
+
+
+static int
+netsnmp_unix_accept(netsnmp_transport *t)
+{
+ struct sockaddr *farend = NULL;
+ int newsock = -1;
+ socklen_t farendlen = sizeof(struct sockaddr_un);
+
+ farend = (struct sockaddr *) malloc(farendlen);
+
+ if (farend == NULL) {
+ /*
+ * Indicate that the acceptance of this socket failed.
+ */
+ DEBUGMSGTL(("netsnmp_unix", "accept: malloc failed\n"));
+ return -1;
+ }
+ memset(farend, 0, farendlen);
+
+ if (t != NULL && t->sock >= 0) {
+ newsock = accept(t->sock, farend, &farendlen);
+
+ if (newsock < 0) {
+ DEBUGMSGTL(("netsnmp_unix","accept failed rc %d errno %d \"%s\"\n",
+ newsock, errno, strerror(errno)));
+ free(farend);
+ return newsock;
+ }
+
+ if (t->data != NULL) {
+ free(t->data);
+ }
+
+ DEBUGMSGTL(("netsnmp_unix", "accept succeeded (farend %p len %d)\n",
+ farend, farendlen));
+ t->data = farend;
+ t->data_length = sizeof(struct sockaddr_un);
+ netsnmp_sock_buffer_set(newsock, SO_SNDBUF, 1, 0);
+ netsnmp_sock_buffer_set(newsock, SO_RCVBUF, 1, 0);
+ return newsock;
+ } else {
+ free(farend);
+ return -1;
+ }
+}
+
+static int create_path = 0;
+static mode_t create_mode;
+
+#ifndef NETSNMP_FEATURE_REMOVE_UNIX_SOCKET_PATHS
+/** If trying to create unix sockets in nonexisting directories then
+ * try to create the directory with mask mode.
+ */
+void netsnmp_unix_create_path_with_mode(int mode)
+{
+ create_path = 1;
+ create_mode = mode;
+}
+
+/** If trying to create unix sockets in nonexisting directories then
+ * fail.
+ */
+void netsnmp_unix_dont_create_path(void)
+{
+ create_path = 0;
+}
+#endif /* NETSNMP_FEATURE_REMOVE_UNIX_SOCKET_PATHS */
+
+/*
+ * Open a Unix-domain transport for SNMP. Local is TRUE if addr is the local
+ * address to bind to (i.e. this is a server-type session); otherwise addr is
+ * the remote address to send things to (and we make up a temporary name for
+ * the local end of the connection).
+ */
+
+netsnmp_transport *
+netsnmp_unix_transport(struct sockaddr_un *addr, int local)
+{
+ netsnmp_transport *t = NULL;
+ sockaddr_un_pair *sup = NULL;
+ int rc = 0;
+
+#ifdef NETSNMP_NO_LISTEN_SUPPORT
+ /* SPECIAL CIRCUMSTANCE: We still want AgentX to be able to operate,
+ so we allow for unix domain socktes to still listen when everything
+ else isn't allowed to. Thus, we ignore this define in this file.
+ */
+#endif /* NETSNMP_NO_LISTEN_SUPPORT */
+
+ if (addr == NULL || addr->sun_family != AF_UNIX) {
+ return NULL;
+ }
+
+ t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
+ if (t == NULL) {
+ return NULL;
+ }
+
+ DEBUGIF("netsnmp_unix") {
+ char *str = netsnmp_unix_fmtaddr(NULL, (void *)addr,
+ sizeof(struct sockaddr_un));
+ DEBUGMSGTL(("netsnmp_unix", "open %s %s\n", local ? "local" : "remote",
+ str));
+ free(str);
+ }
+
+ t->domain = netsnmp_UnixDomain;
+ t->domain_length =
+ sizeof(netsnmp_UnixDomain) / sizeof(netsnmp_UnixDomain[0]);
+
+ t->data = malloc(sizeof(sockaddr_un_pair));
+ if (t->data == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memset(t->data, 0, sizeof(sockaddr_un_pair));
+ t->data_length = sizeof(sockaddr_un_pair);
+ sup = (sockaddr_un_pair *) t->data;
+
+ t->sock = socket(PF_UNIX, SOCK_STREAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ t->flags = NETSNMP_TRANSPORT_FLAG_STREAM;
+
+ if (local) {
+ t->local = (u_char *)malloc(strlen(addr->sun_path));
+ if (t->local == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->local, addr->sun_path, strlen(addr->sun_path));
+ t->local_length = strlen(addr->sun_path);
+
+ /*
+ * This session is inteneded as a server, so we must bind to the given
+ * path (unlinking it first, to avoid errors).
+ */
+
+ t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN;
+
+ unlink(addr->sun_path);
+ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr));
+
+ if (rc != 0 && errno == ENOENT && create_path) {
+ rc = mkdirhier(addr->sun_path, create_mode, 1);
+ if (rc != 0) {
+ netsnmp_unix_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr));
+ }
+ if (rc != 0) {
+ DEBUGMSGTL(("netsnmp_unix_transport",
+ "couldn't bind \"%s\", errno %d (%s)\n",
+ addr->sun_path, errno, strerror(errno)));
+ netsnmp_unix_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /*
+ * Save the address in the transport-specific data pointer for later
+ * use by netsnmp_unix_close.
+ */
+
+ sup->server.sun_family = AF_UNIX;
+ strcpy(sup->server.sun_path, addr->sun_path);
+ sup->local = 1;
+
+ /*
+ * Now sit here and listen for connections to arrive.
+ */
+
+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
+ if (rc != 0) {
+ DEBUGMSGTL(("netsnmp_unix_transport",
+ "couldn't listen to \"%s\", errno %d (%s)\n",
+ addr->sun_path, errno, strerror(errno)));
+ netsnmp_unix_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ } else {
+ t->remote = (u_char *)malloc(strlen(addr->sun_path));
+ if (t->remote == NULL) {
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ memcpy(t->remote, addr->sun_path, strlen(addr->sun_path));
+ t->remote_length = strlen(addr->sun_path);
+
+ rc = connect(t->sock, (struct sockaddr *) addr,
+ sizeof(struct sockaddr_un));
+ if (rc != 0) {
+ DEBUGMSGTL(("netsnmp_unix_transport",
+ "couldn't connect to \"%s\", errno %d (%s)\n",
+ addr->sun_path, errno, strerror(errno)));
+ netsnmp_unix_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+
+ /*
+ * Save the remote address in the transport-specific data pointer for
+ * later use by netsnmp_unix_send.
+ */
+
+ sup->server.sun_family = AF_UNIX;
+ strcpy(sup->server.sun_path, addr->sun_path);
+ sup->local = 0;
+ netsnmp_sock_buffer_set(t->sock, SO_SNDBUF, local, 0);
+ netsnmp_sock_buffer_set(t->sock, SO_RCVBUF, local, 0);
+ }
+
+ /*
+ * Message size is not limited by this transport (hence msgMaxSize
+ * is equal to the maximum legal size of an SNMP message).
+ */
+
+ t->msgMaxSize = 0x7fffffff;
+ t->f_recv = netsnmp_unix_recv;
+ t->f_send = netsnmp_unix_send;
+ t->f_close = netsnmp_unix_close;
+ t->f_accept = netsnmp_unix_accept;
+ t->f_fmtaddr = netsnmp_unix_fmtaddr;
+
+ return t;
+}
+
+netsnmp_transport *
+netsnmp_unix_create_tstring(const char *string, int local,
+ const char *default_target)
+{
+ struct sockaddr_un addr;
+
+ if (string && *string != '\0') {
+ } else if (default_target && *default_target != '\0') {
+ string = default_target;
+ }
+
+ if ((string != NULL && *string != '\0') &&
+ (strlen(string) < sizeof(addr.sun_path))) {
+ addr.sun_family = AF_UNIX;
+ memset(addr.sun_path, 0, sizeof(addr.sun_path));
+ strlcpy(addr.sun_path, string, sizeof(addr.sun_path));
+ return netsnmp_unix_transport(&addr, local);
+ } else {
+ if (string != NULL && *string != '\0') {
+ snmp_log(LOG_ERR, "Path too long for Unix domain transport\n");
+ }
+ return NULL;
+ }
+}
+
+
+
+netsnmp_transport *
+netsnmp_unix_create_ostring(const u_char * o, size_t o_len, int local)
+{
+ struct sockaddr_un addr;
+
+ if (o_len > 0 && o_len < (sizeof(addr.sun_path) - 1)) {
+ addr.sun_family = AF_UNIX;
+ memset(addr.sun_path, 0, sizeof(addr.sun_path));
+ strlcpy(addr.sun_path, (const char *)o, sizeof(addr.sun_path));
+ return netsnmp_unix_transport(&addr, local);
+ } else {
+ if (o_len > 0) {
+ snmp_log(LOG_ERR, "Path too long for Unix domain transport\n");
+ }
+ }
+ return NULL;
+}
+
+
+
+void
+netsnmp_unix_ctor(void)
+{
+ unixDomain.name = netsnmp_UnixDomain;
+ unixDomain.name_length = sizeof(netsnmp_UnixDomain) / sizeof(oid);
+ unixDomain.prefix = (const char**)calloc(2, sizeof(char *));
+ unixDomain.prefix[0] = "unix";
+
+ unixDomain.f_create_from_tstring = NULL;
+ unixDomain.f_create_from_tstring_new = netsnmp_unix_create_tstring;
+ unixDomain.f_create_from_ostring = netsnmp_unix_create_ostring;
+
+ netsnmp_tdomain_register(&unixDomain);
+}
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+/* support for SNMPv1 and SNMPv2c on unix domain*/
+
+#define EXAMPLE_COMMUNITY "COMMUNITY"
+typedef struct com2SecUnixEntry_s {
+ const char* sockpath;
+ const char* secName;
+ const char* contextName;
+ struct com2SecUnixEntry_s *next;
+ unsigned short pathlen;
+ const char community[1];
+} com2SecUnixEntry;
+
+static com2SecUnixEntry *com2SecUnixList = NULL, *com2SecUnixListLast = NULL;
+
+
+int
+netsnmp_unix_getSecName(void *opaque, int olength,
+ const char *community,
+ size_t community_len,
+ const char **secName, const char **contextName)
+{
+ const com2SecUnixEntry *c;
+ struct sockaddr_un *to = (struct sockaddr_un *) opaque;
+ char *ztcommunity = NULL;
+
+ if (secName != NULL) {
+ *secName = NULL; /* Haven't found anything yet */
+ }
+
+ /*
+ * Special case if there are NO entries (as opposed to no MATCHING
+ * entries).
+ */
+
+ if (com2SecUnixList == NULL) {
+ DEBUGMSGTL(("netsnmp_unix_getSecName", "no com2sec entries\n"));
+ return 0;
+ }
+
+ /*
+ * If there is no unix socket path, then there can be no valid security
+ * name.
+ */
+
+ if (opaque == NULL || olength != sizeof(struct sockaddr_un) ||
+ to->sun_family != AF_UNIX) {
+ DEBUGMSGTL(("netsnmp_unix_getSecName",
+ "no unix destine address in PDU?\n"));
+ return 1;
+ }
+
+ DEBUGIF("netsnmp_unix_getSecName") {
+ ztcommunity = (char *)malloc(community_len + 1);
+ if (ztcommunity != NULL) {
+ memcpy(ztcommunity, community, community_len);
+ ztcommunity[community_len] = '\0';
+ }
+
+ DEBUGMSGTL(("netsnmp_unix_getSecName", "resolve <\"%s\">\n",
+ ztcommunity ? ztcommunity : "<malloc error>"));
+ }
+
+ for (c = com2SecUnixList; c != NULL; c = c->next) {
+ DEBUGMSGTL(("netsnmp_unix_getSecName","compare <\"%s\",to socket %s>",
+ c->community, c->sockpath ));
+ if ((community_len == strlen(c->community)) &&
+ (memcmp(community, c->community, community_len) == 0) &&
+ /* compare sockpath, if pathlen == 0, always match */
+ (strlen(to->sun_path) == c->pathlen || c->pathlen == 0) &&
+ (memcmp(to->sun_path, c->sockpath, c->pathlen) == 0)
+ ) {
+ DEBUGMSG(("netsnmp_unix_getSecName", "... SUCCESS\n"));
+ if (secName != NULL) {
+ *secName = c->secName;
+ *contextName = c->contextName;
+ }
+ break;
+ }
+ DEBUGMSG(("netsnmp_unix_getSecName", "... nope\n"));
+ }
+ if (ztcommunity != NULL) {
+ free(ztcommunity);
+ }
+ return 1;
+}
+
+void
+netsnmp_unix_parse_security(const char *token, char *param)
+{
+ char secName[VACMSTRINGLEN + 1];
+ size_t secNameLen;
+ char contextName[VACMSTRINGLEN + 1];
+ size_t contextNameLen;
+ char community[COMMUNITY_MAX_LEN + 1];
+ size_t communityLen;
+ char sockpath[sizeof(((struct sockaddr_un*)0)->sun_path) + 1];
+ size_t sockpathLen;
+
+ param = copy_nword( param, secName, sizeof(secName));
+ if (strcmp(secName, "-Cn") == 0) {
+ if (!param) {
+ config_perror("missing CONTEXT_NAME parameter");
+ return;
+ }
+ param = copy_nword( param, contextName, sizeof(contextName));
+ contextNameLen = strlen(contextName) + 1;
+ if (contextNameLen > VACMSTRINGLEN) {
+ config_perror("context name too long");
+ return;
+ }
+ if (!param) {
+ config_perror("missing NAME parameter");
+ return;
+ }
+ param = copy_nword( param, secName, sizeof(secName));
+ } else {
+ contextNameLen = 0;
+ }
+
+ secNameLen = strlen(secName) + 1;
+ if (secNameLen == 1) {
+ config_perror("empty NAME parameter");
+ return;
+ } else if (secNameLen > VACMSTRINGLEN) {
+ config_perror("security name too long");
+ return;
+ }
+
+ if (!param) {
+ config_perror("missing SOCKPATH parameter");
+ return;
+ }
+ param = copy_nword( param, sockpath, sizeof(sockpath));
+ if (sockpath[0] == '\0') {
+ config_perror("empty SOCKPATH parameter");
+ return;
+ }
+ sockpathLen = strlen(sockpath) + 1;
+ if (sockpathLen > sizeof(((struct sockaddr_un*)0)->sun_path)) {
+ config_perror("sockpath too long");
+ return;
+ }
+
+ if (!param) {
+ config_perror("missing COMMUNITY parameter");
+ return;
+ }
+ param = copy_nword( param, community, sizeof(community));
+ if (community[0] == '\0') {
+ config_perror("empty COMMUNITY parameter");
+ return;
+ }
+ communityLen = strlen(community) + 1;
+ if (communityLen >= COMMUNITY_MAX_LEN) {
+ config_perror("community name too long");
+ return;
+ }
+ if (communityLen == sizeof(EXAMPLE_COMMUNITY) &&
+ memcmp(community, EXAMPLE_COMMUNITY, sizeof(EXAMPLE_COMMUNITY)) == 0) {
+ config_perror("example config COMMUNITY not properly configured");
+ return;
+ }
+
+ /* Deal with the "default" case */
+ if(strcmp(sockpath, "default") == 0) {
+ sockpathLen = 0;
+ }
+
+ {
+ void* v = malloc(offsetof(com2SecUnixEntry, community) + communityLen +
+ sockpathLen + secNameLen + contextNameLen);
+ com2SecUnixEntry* e = (com2SecUnixEntry*)v;
+ char* last = ((char*)v) + offsetof(com2SecUnixEntry, community);
+ if (e == NULL) {
+ config_perror("memory error");
+ return;
+ }
+
+ DEBUGMSGTL(("netsnmp_unix_parse_security",
+ "<\"%s\", \"%.*s\"> => \"%s\"\n",
+ community, (int)sockpathLen, sockpath, secName));
+
+ memcpy(last, community, communityLen);
+ last += communityLen;
+
+ if (sockpathLen) {
+ e->sockpath = last;
+ memcpy(last, sockpath, sockpathLen);
+ last += sockpathLen;
+ e->pathlen = sockpathLen - 1;
+ } else {
+ e->sockpath = last - 1;
+ e->pathlen = 0;
+ }
+
+ e->secName = last;
+ memcpy(last, secName, secNameLen);
+ last += secNameLen;
+
+ if (contextNameLen) {
+ e->contextName = last;
+ memcpy(last, contextName, contextNameLen);
+ last += contextNameLen;
+ } else
+ e->contextName = last - 1;
+
+ e->next = NULL;
+
+ if (com2SecUnixListLast != NULL) {
+ com2SecUnixListLast->next = e;
+ com2SecUnixListLast = e;
+ } else {
+ com2SecUnixListLast = com2SecUnixList = e;
+ }
+ }
+}
+
+void
+netsnmp_unix_com2SecList_free(void)
+{
+ com2SecUnixEntry *e = com2SecUnixList;
+ while (e != NULL) {
+ com2SecUnixEntry *tmp = e;
+ e = e->next;
+ free(tmp);
+ }
+ com2SecUnixList = com2SecUnixListLast = NULL;
+}
+#endif /* support for community based SNMP */
+
+void
+netsnmp_unix_agent_config_tokens_register(void)
+{
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ register_app_config_handler("com2secunix", netsnmp_unix_parse_security,
+ netsnmp_unix_com2SecList_free,
+ "[-Cn CONTEXT] secName sockpath community");
+#endif /* support for community based SNMP */
+}
diff --git a/snmplib/ucd-snmp-includes.h b/snmplib/ucd-snmp-includes.h
new file mode 100644
index 0000000..717cadf
--- /dev/null
+++ b/snmplib/ucd-snmp-includes.h
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <sys/time.h>
+
+/*
+ * uncomment if you don't have in_addr_t in netinet/in.h
+ */
+/*
+ * typedef u_int in_addr_t;
+ */
+
+#include <ucd-snmp/asn1.h>
+#include <ucd-snmp/snmp_api.h>
+#include <ucd-snmp/snmp_impl.h>
+#include <ucd-snmp/snmp_client.h>
+#include <ucd-snmp/mib.h>
+#include <ucd-snmp/snmp.h>
+
+#include <ucd-snmp/default_store.h>
+#include <ucd-snmp/snmp_logging.h>
+#include <ucd-snmp/snmp_debug.h>
+#include <ucd-snmp/read_config.h>
+#include <ucd-snmp/tools.h>
+#include <ucd-snmp/system.h>
diff --git a/snmplib/ucd_compat.c b/snmplib/ucd_compat.c
new file mode 100644
index 0000000..64c1e13
--- /dev/null
+++ b/snmplib/ucd_compat.c
@@ -0,0 +1,230 @@
+/*
+ * For compatibility with applications built using
+ * previous versions of the UCD library only.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-features.h>
+
+#include <net-snmp/types.h>
+#include <net-snmp/session_api.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/library/mib.h> /* for OID O/P format enums */
+#include <net-snmp/library/ucd_compat.h>
+
+netsnmp_feature_child_of(ucd_compatibility, libnetsnmp)
+
+#ifndef NETSNMP_FEATURE_REMOVE_UCD_COMPATIBILITY
+/*
+ * use <netsnmp_session *)->s_snmp_errno instead
+ */
+int
+snmp_get_errno(void)
+{
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * synch_reset and synch_setup are no longer used.
+ */
+NETSNMP_IMPORT void snmp_synch_reset(netsnmp_session * notused);
+void
+snmp_synch_reset(netsnmp_session * notused)
+{
+}
+NETSNMP_IMPORT void snmp_synch_setup(netsnmp_session * notused);
+void
+snmp_synch_setup(netsnmp_session * notused)
+{
+}
+
+
+void
+snmp_set_dump_packet(int x)
+{
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET, x);
+}
+
+int
+snmp_get_dump_packet(void)
+{
+ return netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET);
+}
+
+void
+snmp_set_quick_print(int x)
+{
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT, x);
+}
+
+int
+snmp_get_quick_print(void)
+{
+ return netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_QUICK_PRINT);
+}
+
+
+void
+snmp_set_suffix_only(int x)
+{
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, x);
+}
+
+int
+snmp_get_suffix_only(void)
+{
+ return netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
+}
+
+void
+snmp_set_full_objid(int x)
+{
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
+ NETSNMP_OID_OUTPUT_FULL);
+}
+
+int
+snmp_get_full_objid(void)
+{
+ return (NETSNMP_OID_OUTPUT_FULL ==
+ netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT));
+}
+
+void
+snmp_set_random_access(int x)
+{
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_RANDOM_ACCESS, x);
+}
+
+int
+snmp_get_random_access(void)
+{
+ return netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_RANDOM_ACCESS);
+}
+
+void
+snmp_set_mib_errors(int err)
+{
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_ERRORS, err);
+}
+
+void
+snmp_set_mib_warnings(int warn)
+{
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_WARNINGS, warn);
+}
+
+void
+snmp_set_save_descriptions(int save)
+{
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_SAVE_MIB_DESCRS, save);
+}
+
+void
+snmp_set_mib_comment_term(int save)
+{
+ /*
+ * 0=strict, 1=EOL terminated
+ */
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_COMMENT_TERM, save);
+}
+
+void
+snmp_set_mib_parse_label(int save)
+{
+ /*
+ * 0=strict, 1=underscore OK in label
+ */
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_MIB_PARSE_LABEL, save);
+}
+
+int
+ds_set_boolean (int storeid, int which, int value)
+{
+ return netsnmp_ds_set_boolean(storeid, which, value);
+}
+
+int
+ds_get_boolean (int storeid, int which)
+{
+ return netsnmp_ds_get_boolean(storeid, which);
+}
+
+int
+ds_toggle_boolean (int storeid, int which)
+{
+ return netsnmp_ds_toggle_boolean(storeid, which);
+}
+
+int
+ds_set_int (int storeid, int which, int value)
+{
+ return netsnmp_ds_set_int(storeid, which, value);
+}
+
+int
+ds_get_int (int storeid, int which)
+{
+ return netsnmp_ds_get_int(storeid, which);
+}
+
+
+int
+ds_set_string (int storeid, int which, const char *value)
+{
+ return netsnmp_ds_set_string(storeid, which, value);
+}
+
+char *
+ds_get_string (int storeid, int which)
+{
+ return netsnmp_ds_get_string(storeid, which);
+}
+
+int
+ds_set_void (int storeid, int which, void *value)
+{
+ return netsnmp_ds_set_void(storeid, which, value);
+}
+
+void *
+ds_get_void (int storeid, int which)
+{
+ return netsnmp_ds_get_void(storeid, which);
+}
+
+int
+ds_register_config (u_char type, const char *ftype,
+ const char *token, int storeid, int which)
+{
+ return netsnmp_ds_register_config(type, ftype, token, storeid, which);
+}
+
+int
+ds_register_premib (u_char type, const char *ftype,
+ const char *token, int storeid, int which)
+{
+ return netsnmp_ds_register_premib(type, ftype, token, storeid, which);
+}
+
+void
+ds_shutdown (void)
+{
+ netsnmp_ds_shutdown();
+}
+#else /* !NETSNMP_FEATURE_REMOVE_UCD_COMPATIBILITY */
+netsnmp_feature_unused(ucd_compatibility);
+#endif /* !NETSNMP_FEATURE_REMOVE_UCD_COMPATIBILITY */
diff --git a/snmplib/vacm.c b/snmplib/vacm.c
new file mode 100644
index 0000000..c639785
--- /dev/null
+++ b/snmplib/vacm.c
@@ -0,0 +1,1163 @@
+/* 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.
+ */
+
+/*
+ * vacm.c
+ *
+ * SNMPv3 View-based Access Control Model
+ */
+
+#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 HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <stdio.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_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/config_api.h>
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/vacm.h>
+
+static struct vacm_viewEntry *viewList = NULL, *viewScanPtr = NULL;
+static struct vacm_accessEntry *accessList = NULL, *accessScanPtr = NULL;
+static struct vacm_groupEntry *groupList = NULL, *groupScanPtr = NULL;
+
+/*
+ * Macro to extend view masks with 1 bits when shorter than subtree lengths
+ * REF: vacmViewTreeFamilyMask [RFC3415], snmpNotifyFilterMask [RFC3413]
+ */
+
+#define VIEW_MASK(viewPtr, idx, mask) \
+ ((idx >= viewPtr->viewMaskLen) ? mask : (viewPtr->viewMask[idx] & mask))
+
+/**
+ * Initilizes the VACM code.
+ * Specifically:
+ * - adds a set of enums mapping view numbers to human readable names
+ */
+void
+init_vacm(void)
+{
+ /* views for access via get/set/send-notifications */
+ se_add_pair_to_slist(VACM_VIEW_ENUM_NAME, strdup("read"),
+ VACM_VIEW_READ);
+ se_add_pair_to_slist(VACM_VIEW_ENUM_NAME, strdup("write"),
+ VACM_VIEW_WRITE);
+ se_add_pair_to_slist(VACM_VIEW_ENUM_NAME, strdup("notify"),
+ VACM_VIEW_NOTIFY);
+
+ /* views for permissions when receiving notifications */
+ se_add_pair_to_slist(VACM_VIEW_ENUM_NAME, strdup("log"),
+ VACM_VIEW_LOG);
+ se_add_pair_to_slist(VACM_VIEW_ENUM_NAME, strdup("execute"),
+ VACM_VIEW_EXECUTE);
+ se_add_pair_to_slist(VACM_VIEW_ENUM_NAME, strdup("net"),
+ VACM_VIEW_NET);
+}
+
+void
+vacm_save(const char *token, const char *type)
+{
+ struct vacm_viewEntry *vptr;
+ struct vacm_accessEntry *aptr;
+ struct vacm_groupEntry *gptr;
+ int i;
+
+ for (vptr = viewList; vptr != NULL; vptr = vptr->next) {
+ if (vptr->viewStorageType == ST_NONVOLATILE)
+ vacm_save_view(vptr, token, type);
+ }
+
+ for (aptr = accessList; aptr != NULL; aptr = aptr->next) {
+ if (aptr->storageType == ST_NONVOLATILE) {
+ /* Store the standard views (if set) */
+ if ( aptr->views[VACM_VIEW_READ ][0] ||
+ aptr->views[VACM_VIEW_WRITE ][0] ||
+ aptr->views[VACM_VIEW_NOTIFY][0] )
+ vacm_save_access(aptr, token, type);
+ /* Store any other (valid) access views */
+ for ( i=VACM_VIEW_NOTIFY+1; i<VACM_MAX_VIEWS; i++ ) {
+ if ( aptr->views[i][0] )
+ vacm_save_auth_access(aptr, token, type, i);
+ }
+ }
+ }
+
+ for (gptr = groupList; gptr != NULL; gptr = gptr->next) {
+ if (gptr->storageType == ST_NONVOLATILE)
+ vacm_save_group(gptr, token, type);
+ }
+}
+
+/*
+ * vacm_save_view(): saves a view entry to the persistent cache
+ */
+void
+vacm_save_view(struct vacm_viewEntry *view, const char *token,
+ const char *type)
+{
+ char line[4096];
+ char *cptr;
+
+ memset(line, 0, sizeof(line));
+ snprintf(line, sizeof(line), "%s%s %d %d %d ", token, "View",
+ view->viewStatus, view->viewStorageType, view->viewType);
+ line[ sizeof(line)-1 ] = 0;
+ cptr = &line[strlen(line)]; /* the NULL */
+
+ cptr =
+ read_config_save_octet_string(cptr, (u_char *) view->viewName + 1,
+ view->viewName[0]);
+ *cptr++ = ' ';
+ cptr =
+ read_config_save_objid(cptr, view->viewSubtree+1,
+ view->viewSubtreeLen-1);
+ *cptr++ = ' ';
+ cptr = read_config_save_octet_string(cptr, (u_char *) view->viewMask,
+ view->viewMaskLen);
+
+ read_config_store(type, line);
+}
+
+void
+vacm_parse_config_view(const char *token, const char *line)
+{
+ struct vacm_viewEntry view;
+ struct vacm_viewEntry *vptr;
+ char *viewName = (char *) &view.viewName;
+ oid *viewSubtree = (oid *) & view.viewSubtree;
+ u_char *viewMask;
+ size_t len;
+
+ view.viewStatus = atoi(line);
+ line = skip_token_const(line);
+ view.viewStorageType = atoi(line);
+ line = skip_token_const(line);
+ view.viewType = atoi(line);
+ line = skip_token_const(line);
+ len = sizeof(view.viewName);
+ line =
+ read_config_read_octet_string(line, (u_char **) & viewName, &len);
+ view.viewSubtreeLen = MAX_OID_LEN;
+ line =
+ read_config_read_objid_const(line, (oid **) & viewSubtree,
+ &view.viewSubtreeLen);
+
+ vptr =
+ vacm_createViewEntry(view.viewName, view.viewSubtree,
+ view.viewSubtreeLen);
+ if (!vptr) {
+ return;
+ }
+
+ vptr->viewStatus = view.viewStatus;
+ vptr->viewStorageType = view.viewStorageType;
+ vptr->viewType = view.viewType;
+ viewMask = vptr->viewMask;
+ vptr->viewMaskLen = sizeof(vptr->viewMask);
+ line =
+ read_config_read_octet_string(line, &viewMask, &vptr->viewMaskLen);
+}
+
+/*
+ * vacm_save_access(): saves an access entry to the persistent cache
+ */
+void
+vacm_save_access(struct vacm_accessEntry *access_entry, const char *token,
+ const char *type)
+{
+ char line[4096];
+ char *cptr;
+
+ memset(line, 0, sizeof(line));
+ snprintf(line, sizeof(line), "%s%s %d %d %d %d %d ",
+ token, "Access", access_entry->status,
+ access_entry->storageType, access_entry->securityModel,
+ access_entry->securityLevel, access_entry->contextMatch);
+ line[ sizeof(line)-1 ] = 0;
+ cptr = &line[strlen(line)]; /* the NULL */
+ cptr =
+ read_config_save_octet_string(cptr,
+ (u_char *) access_entry->groupName + 1,
+ access_entry->groupName[0] + 1);
+ *cptr++ = ' ';
+ cptr =
+ read_config_save_octet_string(cptr,
+ (u_char *) access_entry->contextPrefix + 1,
+ access_entry->contextPrefix[0] + 1);
+
+ *cptr++ = ' ';
+ cptr = read_config_save_octet_string(cptr, (u_char *) access_entry->views[VACM_VIEW_READ],
+ strlen(access_entry->views[VACM_VIEW_READ]) + 1);
+ *cptr++ = ' ';
+ cptr =
+ read_config_save_octet_string(cptr, (u_char *) access_entry->views[VACM_VIEW_WRITE],
+ strlen(access_entry->views[VACM_VIEW_WRITE]) + 1);
+ *cptr++ = ' ';
+ cptr =
+ read_config_save_octet_string(cptr, (u_char *) access_entry->views[VACM_VIEW_NOTIFY],
+ strlen(access_entry->views[VACM_VIEW_NOTIFY]) + 1);
+
+ read_config_store(type, line);
+}
+
+void
+vacm_save_auth_access(struct vacm_accessEntry *access_entry,
+ const char *token, const char *type, int authtype)
+{
+ char line[4096];
+ char *cptr;
+
+ memset(line, 0, sizeof(line));
+ snprintf(line, sizeof(line), "%s%s %d %d %d %d %d ",
+ token, "AuthAccess", access_entry->status,
+ access_entry->storageType, access_entry->securityModel,
+ access_entry->securityLevel, access_entry->contextMatch);
+ line[ sizeof(line)-1 ] = 0;
+ cptr = &line[strlen(line)]; /* the NULL */
+ cptr =
+ read_config_save_octet_string(cptr,
+ (u_char *) access_entry->groupName + 1,
+ access_entry->groupName[0] + 1);
+ *cptr++ = ' ';
+ cptr =
+ read_config_save_octet_string(cptr,
+ (u_char *) access_entry->contextPrefix + 1,
+ access_entry->contextPrefix[0] + 1);
+
+ snprintf(cptr, sizeof(line)-(cptr-line), " %d ", authtype);
+ while ( *cptr )
+ cptr++;
+
+ *cptr++ = ' ';
+ cptr = read_config_save_octet_string(cptr,
+ (u_char *)access_entry->views[authtype],
+ strlen(access_entry->views[authtype]) + 1);
+
+ read_config_store(type, line);
+}
+
+char *
+_vacm_parse_config_access_common(struct vacm_accessEntry **aptr,
+ const char *line)
+{
+ struct vacm_accessEntry access;
+ char *cPrefix = (char *) &access.contextPrefix;
+ char *gName = (char *) &access.groupName;
+ size_t len;
+
+ access.status = atoi(line);
+ line = skip_token_const(line);
+ access.storageType = atoi(line);
+ line = skip_token_const(line);
+ access.securityModel = atoi(line);
+ line = skip_token_const(line);
+ access.securityLevel = atoi(line);
+ line = skip_token_const(line);
+ access.contextMatch = atoi(line);
+ line = skip_token_const(line);
+ len = sizeof(access.groupName);
+ line = read_config_read_octet_string(line, (u_char **) &gName, &len);
+ len = sizeof(access.contextPrefix);
+ line = read_config_read_octet_string(line, (u_char **) &cPrefix, &len);
+
+ *aptr = vacm_getAccessEntry(access.groupName,
+ access.contextPrefix,
+ access.securityModel,
+ access.securityLevel);
+ if (!*aptr)
+ *aptr = vacm_createAccessEntry(access.groupName,
+ access.contextPrefix,
+ access.securityModel,
+ access.securityLevel);
+ if (!*aptr)
+ return NULL;
+
+ (*aptr)->status = access.status;
+ (*aptr)->storageType = access.storageType;
+ (*aptr)->securityModel = access.securityModel;
+ (*aptr)->securityLevel = access.securityLevel;
+ (*aptr)->contextMatch = access.contextMatch;
+ return NETSNMP_REMOVE_CONST(char *, line);
+}
+
+void
+vacm_parse_config_access(const char *token, const char *line)
+{
+ struct vacm_accessEntry *aptr;
+ char *readView, *writeView, *notifyView;
+ size_t len;
+
+ line = _vacm_parse_config_access_common(&aptr, line);
+ if (!line)
+ return;
+
+ readView = (char *) aptr->views[VACM_VIEW_READ];
+ len = sizeof(aptr->views[VACM_VIEW_READ]);
+ line =
+ read_config_read_octet_string(line, (u_char **) & readView, &len);
+ writeView = (char *) aptr->views[VACM_VIEW_WRITE];
+ len = sizeof(aptr->views[VACM_VIEW_WRITE]);
+ line =
+ read_config_read_octet_string(line, (u_char **) & writeView, &len);
+ notifyView = (char *) aptr->views[VACM_VIEW_NOTIFY];
+ len = sizeof(aptr->views[VACM_VIEW_NOTIFY]);
+ line =
+ read_config_read_octet_string(line, (u_char **) & notifyView,
+ &len);
+}
+
+void
+vacm_parse_config_auth_access(const char *token, const char *line)
+{
+ struct vacm_accessEntry *aptr;
+ int authtype;
+ char *view;
+ size_t len;
+
+ line = _vacm_parse_config_access_common(&aptr, line);
+ if (!line)
+ return;
+
+ authtype = atoi(line);
+ line = skip_token_const(line);
+
+ view = (char *) aptr->views[authtype];
+ len = sizeof(aptr->views[authtype]);
+ line = read_config_read_octet_string(line, (u_char **) & view, &len);
+}
+
+/*
+ * vacm_save_group(): saves a group entry to the persistent cache
+ */
+void
+vacm_save_group(struct vacm_groupEntry *group_entry, const char *token,
+ const char *type)
+{
+ char line[4096];
+ char *cptr;
+
+ memset(line, 0, sizeof(line));
+ snprintf(line, sizeof(line), "%s%s %d %d %d ",
+ token, "Group", group_entry->status,
+ group_entry->storageType, group_entry->securityModel);
+ line[ sizeof(line)-1 ] = 0;
+ cptr = &line[strlen(line)]; /* the NULL */
+
+ cptr =
+ read_config_save_octet_string(cptr,
+ (u_char *) group_entry->securityName + 1,
+ group_entry->securityName[0] + 1);
+ *cptr++ = ' ';
+ cptr = read_config_save_octet_string(cptr, (u_char *) group_entry->groupName,
+ strlen(group_entry->groupName) + 1);
+
+ read_config_store(type, line);
+}
+
+void
+vacm_parse_config_group(const char *token, const char *line)
+{
+ struct vacm_groupEntry group;
+ struct vacm_groupEntry *gptr;
+ char *securityName = (char *) &group.securityName;
+ char *groupName;
+ size_t len;
+
+ group.status = atoi(line);
+ line = skip_token_const(line);
+ group.storageType = atoi(line);
+ line = skip_token_const(line);
+ group.securityModel = atoi(line);
+ line = skip_token_const(line);
+ len = sizeof(group.securityName);
+ line =
+ read_config_read_octet_string(line, (u_char **) & securityName,
+ &len);
+
+ gptr = vacm_createGroupEntry(group.securityModel, group.securityName);
+ if (!gptr)
+ return;
+
+ gptr->status = group.status;
+ gptr->storageType = group.storageType;
+ groupName = (char *) gptr->groupName;
+ len = sizeof(group.groupName);
+ line =
+ read_config_read_octet_string(line, (u_char **) & groupName, &len);
+}
+
+struct vacm_viewEntry *
+netsnmp_view_get(struct vacm_viewEntry *head, const char *viewName,
+ oid * viewSubtree, size_t viewSubtreeLen, int mode)
+{
+ struct vacm_viewEntry *vp, *vpret = NULL;
+ char view[VACMSTRINGLEN];
+ int found, glen;
+ int count=0;
+
+ glen = (int) strlen(viewName);
+ if (glen < 0 || glen > VACM_MAX_STRING)
+ return NULL;
+ view[0] = glen;
+ strcpy(view + 1, viewName);
+ for (vp = head; vp; vp = vp->next) {
+ if (!memcmp(view, vp->viewName, glen + 1)
+ && viewSubtreeLen >= (vp->viewSubtreeLen - 1)) {
+ int mask = 0x80;
+ unsigned int oidpos, maskpos = 0;
+ found = 1;
+
+ for (oidpos = 0;
+ found && oidpos < vp->viewSubtreeLen - 1;
+ oidpos++) {
+ if (mode==VACM_MODE_IGNORE_MASK || (VIEW_MASK(vp, maskpos, mask) != 0)) {
+ if (viewSubtree[oidpos] !=
+ vp->viewSubtree[oidpos + 1])
+ found = 0;
+ }
+ if (mask == 1) {
+ mask = 0x80;
+ maskpos++;
+ } else
+ mask >>= 1;
+ }
+
+ if (found) {
+ /*
+ * match successful, keep this node if its longer than
+ * the previous or (equal and lexicographically greater
+ * than the previous).
+ */
+ count++;
+ if (mode == VACM_MODE_CHECK_SUBTREE) {
+ vpret = vp;
+ } else if (vpret == NULL
+ || vp->viewSubtreeLen > vpret->viewSubtreeLen
+ || (vp->viewSubtreeLen == vpret->viewSubtreeLen
+ && snmp_oid_compare(vp->viewSubtree + 1,
+ vp->viewSubtreeLen - 1,
+ vpret->viewSubtree + 1,
+ vpret->viewSubtreeLen - 1) >
+ 0)) {
+ vpret = vp;
+ }
+ }
+ }
+ }
+ DEBUGMSGTL(("vacm:getView", ", %s\n", (vpret) ? "found" : "none"));
+ if (mode == VACM_MODE_CHECK_SUBTREE && count > 1) {
+ return NULL;
+ }
+ return vpret;
+}
+
+/*******************************************************************o-o******
+ * vacm_checkSubtree
+ *
+ * Check to see if everything within a subtree is in view, not in view,
+ * or possibly both.
+ *
+ * Parameters:
+ * *viewName - Name of view to check
+ * *viewSubtree - OID of subtree
+ * viewSubtreeLen - length of subtree OID
+ *
+ * Returns:
+ * VACM_SUCCESS The OID is included in the view.
+ * VACM_NOTINVIEW If no entry in the view list includes the
+ * provided OID, or the OID is explicitly excluded
+ * from the view.
+ * VACM_SUBTREE_UNKNOWN The entire subtree has both allowed and disallowed
+ * portions.
+ */
+int
+netsnmp_view_subtree_check(struct vacm_viewEntry *head, const char *viewName,
+ oid * viewSubtree, size_t viewSubtreeLen)
+{
+ struct vacm_viewEntry *vp, *vpShorter = NULL, *vpLonger = NULL;
+ char view[VACMSTRINGLEN];
+ int found, glen;
+
+ glen = (int) strlen(viewName);
+ if (glen < 0 || glen > VACM_MAX_STRING)
+ return VACM_NOTINVIEW;
+ view[0] = glen;
+ strcpy(view + 1, viewName);
+ DEBUGMSGTL(("9:vacm:checkSubtree", "view %s\n", viewName));
+ for (vp = head; vp; vp = vp->next) {
+ if (!memcmp(view, vp->viewName, glen + 1)) {
+ /*
+ * If the subtree defined in the view is shorter than or equal
+ * to the subtree we are comparing, then it might envelop the
+ * subtree we are comparing against.
+ */
+ if (viewSubtreeLen >= (vp->viewSubtreeLen - 1)) {
+ int mask = 0x80;
+ unsigned int oidpos, maskpos = 0;
+ found = 1;
+
+ /*
+ * check the mask
+ */
+ for (oidpos = 0;
+ found && oidpos < vp->viewSubtreeLen - 1;
+ oidpos++) {
+ if (VIEW_MASK(vp, maskpos, mask) != 0) {
+ if (viewSubtree[oidpos] !=
+ vp->viewSubtree[oidpos + 1])
+ found = 0;
+ }
+ if (mask == 1) {
+ mask = 0x80;
+ maskpos++;
+ } else
+ mask >>= 1;
+ }
+
+ if (found) {
+ /*
+ * match successful, keep this node if it's longer than
+ * the previous or (equal and lexicographically greater
+ * than the previous).
+ */
+ DEBUGMSGTL(("9:vacm:checkSubtree", " %s matched?\n", vp->viewName));
+
+ if (vpShorter == NULL
+ || vp->viewSubtreeLen > vpShorter->viewSubtreeLen
+ || (vp->viewSubtreeLen == vpShorter->viewSubtreeLen
+ && snmp_oid_compare(vp->viewSubtree + 1,
+ vp->viewSubtreeLen - 1,
+ vpShorter->viewSubtree + 1,
+ vpShorter->viewSubtreeLen - 1) >
+ 0)) {
+ vpShorter = vp;
+ }
+ }
+ }
+ /*
+ * If the subtree defined in the view is longer than the
+ * subtree we are comparing, then it might ambiguate our
+ * response.
+ */
+ else {
+ int mask = 0x80;
+ unsigned int oidpos, maskpos = 0;
+ found = 1;
+
+ /*
+ * check the mask up to the length of the provided subtree
+ */
+ for (oidpos = 0;
+ found && oidpos < viewSubtreeLen;
+ oidpos++) {
+ if (VIEW_MASK(vp, maskpos, mask) != 0) {
+ if (viewSubtree[oidpos] !=
+ vp->viewSubtree[oidpos + 1])
+ found = 0;
+ }
+ if (mask == 1) {
+ mask = 0x80;
+ maskpos++;
+ } else
+ mask >>= 1;
+ }
+
+ if (found) {
+ /*
+ * match successful. If we already found a match
+ * with a different view type, then parts of the subtree
+ * are included and others are excluded, so return UNKNOWN.
+ */
+ DEBUGMSGTL(("9:vacm:checkSubtree", " %s matched?\n", vp->viewName));
+ if (vpLonger != NULL
+ && (vpLonger->viewType != vp->viewType)) {
+ DEBUGMSGTL(("vacm:checkSubtree", ", %s\n", "unknown"));
+ return VACM_SUBTREE_UNKNOWN;
+ }
+ else if (vpLonger == NULL) {
+ vpLonger = vp;
+ }
+ }
+ }
+ }
+ }
+ DEBUGMSGTL(("9:vacm:checkSubtree", " %s matched\n", viewName));
+
+ /*
+ * If we found a matching view subtree with a longer OID than the provided
+ * OID, check to see if its type is consistent with any matching view
+ * subtree we may have found with a shorter OID than the provided OID.
+ *
+ * The view type of the longer OID is inconsistent with the shorter OID in
+ * either of these two cases:
+ * 1) No matching shorter OID was found and the view type of the longer
+ * OID is INCLUDE.
+ * 2) A matching shorter ID was found and its view type doesn't match
+ * the view type of the longer OID.
+ */
+ if (vpLonger != NULL) {
+ if ((!vpShorter && vpLonger->viewType != SNMP_VIEW_EXCLUDED)
+ || (vpShorter && vpLonger->viewType != vpShorter->viewType)) {
+ DEBUGMSGTL(("vacm:checkSubtree", ", %s\n", "unknown"));
+ return VACM_SUBTREE_UNKNOWN;
+ }
+ }
+
+ if (vpShorter && vpShorter->viewType != SNMP_VIEW_EXCLUDED) {
+ DEBUGMSGTL(("vacm:checkSubtree", ", %s\n", "included"));
+ return VACM_SUCCESS;
+ }
+
+ DEBUGMSGTL(("vacm:checkSubtree", ", %s\n", "excluded"));
+ return VACM_NOTINVIEW;
+}
+
+void
+vacm_scanViewInit(void)
+{
+ viewScanPtr = viewList;
+}
+
+struct vacm_viewEntry *
+vacm_scanViewNext(void)
+{
+ struct vacm_viewEntry *returnval = viewScanPtr;
+ if (viewScanPtr)
+ viewScanPtr = viewScanPtr->next;
+ return returnval;
+}
+
+struct vacm_viewEntry *
+netsnmp_view_create(struct vacm_viewEntry **head, const char *viewName,
+ oid * viewSubtree, size_t viewSubtreeLen)
+{
+ struct vacm_viewEntry *vp, *lp, *op = NULL;
+ int cmp, cmp2, glen;
+
+ glen = (int) strlen(viewName);
+ if (glen < 0 || glen > VACM_MAX_STRING)
+ return NULL;
+ vp = (struct vacm_viewEntry *) calloc(1,
+ sizeof(struct vacm_viewEntry));
+ if (vp == NULL)
+ return NULL;
+ vp->reserved =
+ (struct vacm_viewEntry *) calloc(1, sizeof(struct vacm_viewEntry));
+ if (vp->reserved == NULL) {
+ free(vp);
+ return NULL;
+ }
+
+ vp->viewName[0] = glen;
+ strcpy(vp->viewName + 1, viewName);
+ vp->viewSubtree[0] = viewSubtreeLen;
+ memcpy(vp->viewSubtree + 1, viewSubtree, viewSubtreeLen * sizeof(oid));
+ vp->viewSubtreeLen = viewSubtreeLen + 1;
+
+ lp = *head;
+ while (lp) {
+ cmp = memcmp(lp->viewName, vp->viewName, glen + 1);
+ cmp2 = snmp_oid_compare(lp->viewSubtree, lp->viewSubtreeLen,
+ vp->viewSubtree, vp->viewSubtreeLen);
+ if (cmp == 0 && cmp2 > 0)
+ break;
+ if (cmp > 0)
+ break;
+ op = lp;
+ lp = lp->next;
+ }
+ vp->next = lp;
+ if (op)
+ op->next = vp;
+ else
+ *head = vp;
+ return vp;
+}
+
+void
+netsnmp_view_destroy(struct vacm_viewEntry **head, const char *viewName,
+ oid * viewSubtree, size_t viewSubtreeLen)
+{
+ struct vacm_viewEntry *vp, *lastvp = NULL;
+
+ if ((*head) && !strcmp((*head)->viewName + 1, viewName)
+ && (*head)->viewSubtreeLen == viewSubtreeLen
+ && !memcmp((char *) (*head)->viewSubtree, (char *) viewSubtree,
+ viewSubtreeLen * sizeof(oid))) {
+ vp = (*head);
+ (*head) = (*head)->next;
+ } else {
+ for (vp = (*head); vp; vp = vp->next) {
+ if (!strcmp(vp->viewName + 1, viewName)
+ && vp->viewSubtreeLen == viewSubtreeLen
+ && !memcmp((char *) vp->viewSubtree, (char *) viewSubtree,
+ viewSubtreeLen * sizeof(oid)))
+ break;
+ lastvp = vp;
+ }
+ if (!vp || !lastvp)
+ return;
+ lastvp->next = vp->next;
+ }
+ if (vp->reserved)
+ free(vp->reserved);
+ free(vp);
+ return;
+}
+
+void
+netsnmp_view_clear(struct vacm_viewEntry **head)
+{
+ struct vacm_viewEntry *vp;
+ while ((vp = (*head))) {
+ (*head) = vp->next;
+ if (vp->reserved)
+ free(vp->reserved);
+ free(vp);
+ }
+}
+
+struct vacm_groupEntry *
+vacm_getGroupEntry(int securityModel, const char *securityName)
+{
+ struct vacm_groupEntry *vp;
+ char secname[VACMSTRINGLEN];
+ int glen;
+
+ glen = (int) strlen(securityName);
+ if (glen < 0 || glen > VACM_MAX_STRING)
+ return NULL;
+ secname[0] = glen;
+ strcpy(secname + 1, securityName);
+
+ for (vp = groupList; vp; vp = vp->next) {
+ if ((securityModel == vp->securityModel
+ || vp->securityModel == SNMP_SEC_MODEL_ANY)
+ && !memcmp(vp->securityName, secname, glen + 1))
+ return vp;
+ }
+ return NULL;
+}
+
+void
+vacm_scanGroupInit(void)
+{
+ groupScanPtr = groupList;
+}
+
+struct vacm_groupEntry *
+vacm_scanGroupNext(void)
+{
+ struct vacm_groupEntry *returnval = groupScanPtr;
+ if (groupScanPtr)
+ groupScanPtr = groupScanPtr->next;
+ return returnval;
+}
+
+struct vacm_groupEntry *
+vacm_createGroupEntry(int securityModel, const char *securityName)
+{
+ struct vacm_groupEntry *gp, *lg, *og;
+ int cmp, glen;
+
+ glen = (int) strlen(securityName);
+ if (glen < 0 || glen > VACM_MAX_STRING)
+ return NULL;
+ gp = (struct vacm_groupEntry *) calloc(1,
+ sizeof(struct vacm_groupEntry));
+ if (gp == NULL)
+ return NULL;
+ gp->reserved =
+ (struct vacm_groupEntry *) calloc(1,
+ sizeof(struct vacm_groupEntry));
+ if (gp->reserved == NULL) {
+ free(gp);
+ return NULL;
+ }
+
+ gp->securityModel = securityModel;
+ gp->securityName[0] = glen;
+ strcpy(gp->securityName + 1, securityName);
+
+ lg = groupList;
+ og = NULL;
+ while (lg) {
+ if (lg->securityModel > securityModel)
+ break;
+ if (lg->securityModel == securityModel &&
+ (cmp =
+ memcmp(lg->securityName, gp->securityName, glen + 1)) > 0)
+ break;
+ /*
+ * if (lg->securityModel == securityModel && cmp == 0) abort();
+ */
+ og = lg;
+ lg = lg->next;
+ }
+ gp->next = lg;
+ if (og == NULL)
+ groupList = gp;
+ else
+ og->next = gp;
+ return gp;
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+void
+vacm_destroyGroupEntry(int securityModel, const char *securityName)
+{
+ struct vacm_groupEntry *vp, *lastvp = NULL;
+
+ if (groupList && groupList->securityModel == securityModel
+ && !strcmp(groupList->securityName + 1, securityName)) {
+ vp = groupList;
+ groupList = groupList->next;
+ } else {
+ for (vp = groupList; vp; vp = vp->next) {
+ if (vp->securityModel == securityModel
+ && !strcmp(vp->securityName + 1, securityName))
+ break;
+ lastvp = vp;
+ }
+ if (!vp || !lastvp)
+ return;
+ lastvp->next = vp->next;
+ }
+ if (vp->reserved)
+ free(vp->reserved);
+ free(vp);
+ return;
+}
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+void
+vacm_destroyAllGroupEntries(void)
+{
+ struct vacm_groupEntry *gp;
+ while ((gp = groupList)) {
+ groupList = gp->next;
+ if (gp->reserved)
+ free(gp->reserved);
+ free(gp);
+ }
+}
+
+struct vacm_accessEntry *
+_vacm_choose_best( struct vacm_accessEntry *current,
+ struct vacm_accessEntry *candidate)
+{
+ /*
+ * RFC 3415: vacmAccessTable:
+ * 2) if this set has [more than] one member, ...
+ * it comes down to deciding how to weight the
+ * preferences between ContextPrefixes,
+ * SecurityModels, and SecurityLevels
+ */
+ if (( !current ) ||
+ /* a) if the subset of entries with securityModel
+ * matching the securityModel in the message is
+ * not empty, then discard the rest
+ */
+ ( current->securityModel == SNMP_SEC_MODEL_ANY &&
+ candidate->securityModel != SNMP_SEC_MODEL_ANY ) ||
+ /* b) if the subset of entries with vacmAccessContextPrefix
+ * matching the contextName in the message is
+ * not empty, then discard the rest
+ */
+ ( current->contextMatch == CONTEXT_MATCH_PREFIX &&
+ candidate->contextMatch == CONTEXT_MATCH_EXACT ) ||
+ /* c) discard all entries with ContextPrefixes shorter
+ * than the longest one remaining in the set
+ */
+ ( current->contextMatch == CONTEXT_MATCH_PREFIX &&
+ current->contextPrefix[0] < candidate->contextPrefix[0] ) ||
+ /* d) select the entry with the highest securityLevel
+ */
+ ( current->securityLevel < candidate->securityLevel )) {
+
+ return candidate;
+ }
+
+ return current;
+}
+
+struct vacm_accessEntry *
+vacm_getAccessEntry(const char *groupName,
+ const char *contextPrefix,
+ int securityModel, int securityLevel)
+{
+ struct vacm_accessEntry *vp, *best=NULL;
+ char group[VACMSTRINGLEN];
+ char context[VACMSTRINGLEN];
+ int glen, clen;
+
+ glen = (int) strlen(groupName);
+ if (glen < 0 || glen > VACM_MAX_STRING)
+ return NULL;
+ clen = (int) strlen(contextPrefix);
+ if (clen < 0 || clen > VACM_MAX_STRING)
+ return NULL;
+
+ group[0] = glen;
+ strcpy(group + 1, groupName);
+ context[0] = clen;
+ strcpy(context + 1, contextPrefix);
+ for (vp = accessList; vp; vp = vp->next) {
+ if ((securityModel == vp->securityModel
+ || vp->securityModel == SNMP_SEC_MODEL_ANY)
+ && securityLevel >= vp->securityLevel
+ && !memcmp(vp->groupName, group, glen + 1)
+ &&
+ ((vp->contextMatch == CONTEXT_MATCH_EXACT
+ && clen == vp->contextPrefix[0]
+ && (memcmp(vp->contextPrefix, context, clen + 1) == 0))
+ || (vp->contextMatch == CONTEXT_MATCH_PREFIX
+ && clen >= vp->contextPrefix[0]
+ && (memcmp(vp->contextPrefix + 1, context + 1,
+ vp->contextPrefix[0]) == 0))))
+ best = _vacm_choose_best( best, vp );
+ }
+ return best;
+}
+
+void
+vacm_scanAccessInit(void)
+{
+ accessScanPtr = accessList;
+}
+
+struct vacm_accessEntry *
+vacm_scanAccessNext(void)
+{
+ struct vacm_accessEntry *returnval = accessScanPtr;
+ if (accessScanPtr)
+ accessScanPtr = accessScanPtr->next;
+ return returnval;
+}
+
+struct vacm_accessEntry *
+vacm_createAccessEntry(const char *groupName,
+ const char *contextPrefix,
+ int securityModel, int securityLevel)
+{
+ struct vacm_accessEntry *vp, *lp, *op = NULL;
+ int cmp, glen, clen;
+
+ glen = (int) strlen(groupName);
+ if (glen < 0 || glen > VACM_MAX_STRING)
+ return NULL;
+ clen = (int) strlen(contextPrefix);
+ if (clen < 0 || clen > VACM_MAX_STRING)
+ return NULL;
+ vp = (struct vacm_accessEntry *) calloc(1,
+ sizeof(struct
+ vacm_accessEntry));
+ if (vp == NULL)
+ return NULL;
+ vp->reserved =
+ (struct vacm_accessEntry *) calloc(1,
+ sizeof(struct
+ vacm_accessEntry));
+ if (vp->reserved == NULL) {
+ free(vp);
+ return NULL;
+ }
+
+ vp->securityModel = securityModel;
+ vp->securityLevel = securityLevel;
+ vp->groupName[0] = glen;
+ strcpy(vp->groupName + 1, groupName);
+ vp->contextPrefix[0] = clen;
+ strcpy(vp->contextPrefix + 1, contextPrefix);
+
+ lp = accessList;
+ while (lp) {
+ cmp = memcmp(lp->groupName, vp->groupName, glen + 1);
+ if (cmp > 0)
+ break;
+ if (cmp < 0)
+ goto next;
+ cmp = memcmp(lp->contextPrefix, vp->contextPrefix, clen + 1);
+ if (cmp > 0)
+ break;
+ if (cmp < 0)
+ goto next;
+ if (lp->securityModel > securityModel)
+ break;
+ if (lp->securityModel < securityModel)
+ goto next;
+ if (lp->securityLevel > securityLevel)
+ break;
+ next:
+ op = lp;
+ lp = lp->next;
+ }
+ vp->next = lp;
+ if (op == NULL)
+ accessList = vp;
+ else
+ op->next = vp;
+ return vp;
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+void
+vacm_destroyAccessEntry(const char *groupName,
+ const char *contextPrefix,
+ int securityModel, int securityLevel)
+{
+ struct vacm_accessEntry *vp, *lastvp = NULL;
+
+ if (accessList && accessList->securityModel == securityModel
+ && accessList->securityLevel == securityLevel
+ && !strcmp(accessList->groupName + 1, groupName)
+ && !strcmp(accessList->contextPrefix + 1, contextPrefix)) {
+ vp = accessList;
+ accessList = accessList->next;
+ } else {
+ for (vp = accessList; vp; vp = vp->next) {
+ if (vp->securityModel == securityModel
+ && vp->securityLevel == securityLevel
+ && !strcmp(vp->groupName + 1, groupName)
+ && !strcmp(vp->contextPrefix + 1, contextPrefix))
+ break;
+ lastvp = vp;
+ }
+ if (!vp || !lastvp)
+ return;
+ lastvp->next = vp->next;
+ }
+ if (vp->reserved)
+ free(vp->reserved);
+ free(vp);
+ return;
+}
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+void
+vacm_destroyAllAccessEntries(void)
+{
+ struct vacm_accessEntry *ap;
+ while ((ap = accessList)) {
+ accessList = ap->next;
+ if (ap->reserved)
+ free(ap->reserved);
+ free(ap);
+ }
+}
+
+int
+store_vacm(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ /*
+ * figure out our application name
+ */
+ char *appname = (char *) clientarg;
+ if (appname == NULL) {
+ appname = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ }
+
+ /*
+ * save the VACM MIB
+ */
+ vacm_save("vacm", appname);
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * returns 1 if vacm has *any* (non-built-in) configuration entries,
+ * regardless of whether or not there is enough to make a decision,
+ * else return 0
+ */
+int
+vacm_is_configured(void)
+{
+ if (accessList == NULL && groupList == NULL) {
+ return 0;
+ }
+ return 1;
+}
+
+/*
+ * backwards compatability
+ */
+struct vacm_viewEntry *
+vacm_getViewEntry(const char *viewName,
+ oid * viewSubtree, size_t viewSubtreeLen, int mode)
+{
+ return netsnmp_view_get( viewList, viewName, viewSubtree, viewSubtreeLen,
+ mode);
+}
+
+int
+vacm_checkSubtree(const char *viewName,
+ oid * viewSubtree, size_t viewSubtreeLen)
+{
+ return netsnmp_view_subtree_check( viewList, viewName, viewSubtree,
+ viewSubtreeLen);
+}
+
+struct vacm_viewEntry *
+vacm_createViewEntry(const char *viewName,
+ oid * viewSubtree, size_t viewSubtreeLen)
+{
+ return netsnmp_view_create( &viewList, viewName, viewSubtree,
+ viewSubtreeLen);
+}
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+void
+vacm_destroyViewEntry(const char *viewName,
+ oid * viewSubtree, size_t viewSubtreeLen)
+{
+ netsnmp_view_destroy( &viewList, viewName, viewSubtree, viewSubtreeLen);
+}
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+void
+vacm_destroyAllViewEntries(void)
+{
+ netsnmp_view_clear( &viewList );
+}
+
diff --git a/snmplib/winpipe.c b/snmplib/winpipe.c
new file mode 100644
index 0000000..bbe37f1
--- /dev/null
+++ b/snmplib/winpipe.c
@@ -0,0 +1,222 @@
+/*
+ Copyright (c) Fabasoft R&D Software GmbH & Co KG, 2003
+ oss@fabasoft.com
+ Author: Bernhard Penz <bernhard.penz@fabasoft.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * The name of Fabasoft R&D Software GmbH & Co KG or any of its subsidiaries,
+ brand or product names may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifdef WIN32
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/types.h>
+#include <net-snmp/library/snmp_assert.h>
+#include <net-snmp/library/winpipe.h>
+#include <io.h>
+
+static int InitUPDSocket(SOCKET *sock, struct sockaddr_in *socketaddress)
+{
+ *sock = 0;
+ memset(socketaddress, 0, sizeof(struct sockaddr_in));
+
+ if( (*sock = socket(AF_INET, SOCK_DGRAM, 0)) == SOCKET_ERROR)
+ {
+ netsnmp_assert(GetLastError() != WSANOTINITIALISED);
+ return -1;
+ }
+ socketaddress->sin_family = AF_INET;
+ socketaddress->sin_addr.S_un.S_addr = htonl(INADDR_LOOPBACK);
+ socketaddress->sin_port = 0;
+
+ if(bind(*sock, (struct sockaddr *) socketaddress, sizeof(struct sockaddr)) == SOCKET_ERROR)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int ConnectUDPSocket(SOCKET *sock, struct sockaddr_in *socketaddress, SOCKET *remotesocket)
+{
+ int size = sizeof(struct sockaddr);
+ if (getsockname(*sock, (struct sockaddr *) socketaddress, &size) == SOCKET_ERROR)
+ {
+ return -1;
+ }
+
+ if(size != sizeof(struct sockaddr))
+ {
+ return -1;
+ }
+
+ if (connect(*remotesocket, (struct sockaddr *) socketaddress, sizeof(struct sockaddr)) == SOCKET_ERROR)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int TestUDPSend(SOCKET *sock, struct sockaddr_in *socketaddress)
+{
+ unsigned short port = socketaddress->sin_port;
+
+ int bytessent = sendto(*sock, (char *) &port, sizeof(port), 0, NULL, 0);
+ if(bytessent != sizeof(port))
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int TestUDPReceive(SOCKET *sock, SOCKET *remotesocket, struct sockaddr_in *remotesocketaddress)
+{
+ struct sockaddr_in recvfromaddress;
+ unsigned short readbuffer[2];
+ int size = sizeof(struct sockaddr);
+
+ int bytesreceived = recvfrom(*sock,(char *) &readbuffer, sizeof(readbuffer), 0, (struct sockaddr *) &recvfromaddress, &size) ;
+ if(bytesreceived != sizeof(unsigned short) || size != sizeof(struct sockaddr) || readbuffer[0] != (unsigned short) remotesocketaddress->sin_port || recvfromaddress.sin_family != remotesocketaddress->sin_family || recvfromaddress.sin_addr.S_un.S_addr != remotesocketaddress->sin_addr.S_un.S_addr || recvfromaddress.sin_port != remotesocketaddress->sin_port)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+static void CloseUDPSocketPair(SOCKET *socketpair)
+{
+ if(socketpair[0] != INVALID_SOCKET)
+ {
+ closesocket(socketpair[0]);
+ }
+ if(socketpair[1] != INVALID_SOCKET)
+ {
+ closesocket(socketpair[1]);
+ }
+}
+
+/*
+ Windows unnamed pipe emulation, used to enable select()
+ on a Windows machine for the CALLBACK (pipe-based) transport domain.
+*/
+int create_winpipe_transport(int *pipefds)
+{
+ SOCKET socketpair[2];
+ struct sockaddr_in socketaddress[2];
+
+ struct timeval waittime = {0, 200000};
+ fd_set readset;
+
+ if (InitUPDSocket(&socketpair[0], &socketaddress[0]))
+ {
+ CloseUDPSocketPair(socketpair);
+ return -1;
+ }
+ if (InitUPDSocket(&socketpair[1], &socketaddress[1]))
+ {
+ CloseUDPSocketPair(socketpair);
+ return -1;
+ }
+
+ /*
+ I have two UDP sockets - now lets connect them to each other.
+ */
+
+ if (ConnectUDPSocket(&socketpair[0], &socketaddress[0], &socketpair[1]))
+ {
+ CloseUDPSocketPair(socketpair);
+ return -1;
+ }
+ if(ConnectUDPSocket(&socketpair[1], &socketaddress[1], &socketpair[0]))
+ {
+ CloseUDPSocketPair(socketpair);
+ return -1;
+ }
+
+ /*
+ The two sockets are connected to each other, now lets test the connection
+ by sending the own port number.
+ */
+ if(TestUDPSend(&socketpair[0], &socketaddress[0]))
+ {
+ CloseUDPSocketPair(socketpair);
+ return -1;
+ }
+ if(TestUDPSend(&socketpair[1], &socketaddress[1]))
+ {
+ CloseUDPSocketPair(socketpair);
+ return -1;
+ }
+
+ /*
+ Port numbers sent, now lets select() on the socketpair and check that
+ both messages got through
+ */
+ FD_ZERO(&readset);
+ FD_SET(socketpair[0], &readset);
+ FD_SET(socketpair[1], &readset);
+
+ /*
+ For some unknown reason the timeout setting in the select call does not have
+ the desired effect, and for yet another unknown reason a Sleep(1) solves this
+ problem.
+ */
+ Sleep(1);
+ if(select(0, &readset, NULL, NULL, &waittime) != 2 || !FD_ISSET(socketpair[0], &readset) || !FD_ISSET(socketpair[1], &readset))
+ {
+ CloseUDPSocketPair(socketpair);
+ return -1;
+ }
+
+ /*
+ Check if the packets I receive were really sent by me, and nobody else
+ tried to sneak.
+ */
+ if(TestUDPReceive(&socketpair[0], &socketpair[1], &socketaddress[1]))
+ {
+ CloseUDPSocketPair(socketpair);
+ return -1;
+ }
+ if(TestUDPReceive(&socketpair[1], &socketpair[0], &socketaddress[0]))
+ {
+ CloseUDPSocketPair(socketpair);
+ return -1;
+ }
+
+ /*
+ All sanity checks passed, I can return a "UDP pipe"
+ */
+ pipefds[0] = (int) socketpair[0];
+ pipefds[1] = (int) socketpair[1];
+
+ return 0;
+}
+
+#endif /* WIN32 */
+
diff --git a/snmplib/winservice.c b/snmplib/winservice.c
new file mode 100644
index 0000000..10b6e1c
--- /dev/null
+++ b/snmplib/winservice.c
@@ -0,0 +1,1108 @@
+/*
+ * Windows Service related function definitions
+ * By Raju Krishnappa(raju_krishnappa@yahoo.com)
+ *
+ */
+
+#ifdef WIN32
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <windows.h>
+#include <tchar.h>
+
+#include <stdio.h> /* sprintf */
+#include <process.h> /* beginthreadex */
+
+#include <net-snmp/library/winservice.h>
+
+#ifdef mingw32 /* MinGW doesn't fully support exception handling. */
+
+#define TRY if(1)
+#define LEAVE goto labelFIN
+#define FINALLY do { \
+labelFIN: \
+ ; \
+} while(0); if(1)
+
+#else
+
+#define TRY __try
+#define LEAVE __leave
+#define FINALLY __finally
+
+#endif /* mingw32 */
+
+
+#define CountOf(arr) ( sizeof(arr) / sizeof(arr[0]) )
+
+
+#if defined(WIN32) && defined(HAVE_WIN32_PLATFORM_SDK) && !defined(mingw32)
+#pragma comment(lib, "iphlpapi.lib")
+#ifdef USING_WINEXTDLL_MODULE
+#pragma comment(lib, "snmpapi.lib")
+#pragma comment(lib, "mgmtapi.lib")
+#endif
+#endif
+
+
+ /*
+ * External global variables used here
+ */
+
+ /*
+ * Application Name
+ * This should be declared by the application, which wants to register as
+ * windows service
+ */
+extern LPTSTR app_name_long;
+
+ /*
+ * Declare global variable
+ */
+
+ /*
+ * Flag to indicate whether process is running as Service
+ */
+BOOL g_fRunningAsService = FALSE;
+
+ /*
+ * Variable to maintain Current Service status
+ */
+static SERVICE_STATUS ServiceStatus;
+
+ /*
+ * Service Handle
+ */
+static SERVICE_STATUS_HANDLE hServiceStatus = 0L;
+
+ /*
+ * Service Table Entry
+ */
+SERVICE_TABLE_ENTRY ServiceTableEntry[] = {
+ {NULL, ServiceMain}, /* Service Main function */
+ {NULL, NULL}
+};
+
+ /*
+ * Handle to Thread, to implement Pause, Resume and Stop functions
+ */
+static HANDLE hServiceThread = NULL; /* Thread Handle */
+
+ /*
+ * Holds calling partys Function Entry point, that should start
+ * when entering service mode
+ */
+static INT (*ServiceEntryPoint) (INT Argc, LPTSTR Argv[]) = 0L;
+
+ /*
+ * To hold Stop Function address, to be called when STOP request
+ * received from the SCM
+ */
+static VOID (*StopFunction) (VOID) = 0L;
+
+
+ /*
+ * To update windows service status to SCM
+ */
+static BOOL UpdateServiceStatus (DWORD dwStatus, DWORD dwErrorCode,
+ DWORD dwWaitHint);
+
+ /*
+ * To Report current service status to SCM
+ */
+static BOOL ReportCurrentServiceStatus (VOID);
+
+VOID
+ProcessError (WORD eventLogType, LPCTSTR pszMessage, int useGetLastError, int quiet);
+
+ /*
+ * To register as Windows Service with SCM(Service Control Manager)
+ * Input - Service Name, Service Display Name,Service Description and
+ * Service startup arguments
+ */
+int
+RegisterService (LPCTSTR lpszServiceName, LPCTSTR lpszServiceDisplayName,
+ LPCTSTR lpszServiceDescription,
+ InputParams * StartUpArg, int quiet) /* Startup argument to the service */
+{
+ TCHAR szServicePath[MAX_PATH]; /* To hold module File name */
+ TCHAR MsgErrorString[MAX_STR_SIZE]; /* Message or Error string */
+ TCHAR szServiceCommand[MAX_PATH + 9]; /* Command to execute */
+ SC_HANDLE hSCManager = NULL;
+ SC_HANDLE hService = NULL;
+ TCHAR szRegAppLogKey[] =
+ _T("SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\");
+ TCHAR szRegKey[512];
+ HKEY hKey = NULL; /* Key to registry entry */
+ HKEY hParamKey = NULL; /* To store startup parameters */
+ DWORD dwData; /* Type of logging supported */
+ DWORD i, j; /* Loop variables */
+ int exitStatus = 0;
+ GetModuleFileName (NULL, szServicePath, MAX_PATH);
+ TRY
+ {
+
+ /*
+ * Open Service Control Manager handle
+ */
+ hSCManager = OpenSCManager (NULL, NULL, SC_MANAGER_CREATE_SERVICE);
+ if (hSCManager == NULL)
+ {
+ ProcessError (EVENTLOG_ERROR_TYPE, _T ("Can't open SCM (Service Control Manager)"), 1, quiet);
+ exitStatus = SERVICE_ERROR_SCM_OPEN;
+ LEAVE;
+ }
+
+ /*
+ * Generate the command to be executed by the SCM
+ */
+ _sntprintf (szServiceCommand, CountOf(szServiceCommand), _T("%s %s"), szServicePath, _T ("-service"));
+
+ /*
+ * Create the desired service
+ */
+ hService = CreateService (hSCManager, lpszServiceName, lpszServiceDisplayName,
+ SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
+ SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, szServiceCommand,
+ NULL, /* load-order group */
+ NULL, /* group member tag */
+ NULL, /* dependencies */
+ NULL, /* account */
+ NULL); /* password */
+ if (hService == NULL)
+ {
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"),
+ _T ("Can't create service"), lpszServiceDisplayName);
+ ProcessError (EVENTLOG_ERROR_TYPE, MsgErrorString, 1, quiet);
+
+ exitStatus = SERVICE_ERROR_CREATE_SERVICE;
+ LEAVE;
+ }
+
+ /*
+ * Create registry entries for the event log
+ */
+ /*
+ * Create registry Application event log key
+ */
+ _tcscpy (szRegKey, szRegAppLogKey);
+ _tcscat (szRegKey, lpszServiceName);
+
+ /*
+ * Create registry key
+ */
+ if (RegCreateKey (HKEY_LOCAL_MACHINE, szRegKey, &hKey) != ERROR_SUCCESS)
+ {
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"),
+ _T ("is unable to create registry entries"), lpszServiceDisplayName);
+ ProcessError (EVENTLOG_ERROR_TYPE, MsgErrorString, 1, quiet);
+ exitStatus = SERVICE_ERROR_CREATE_REGISTRY_ENTRIES;
+ LEAVE;
+ }
+
+ /*
+ * Add Event ID message file name to the 'EventMessageFile' subkey
+ */
+ RegSetValueEx (hKey, _T("EventMessageFile"), 0, REG_EXPAND_SZ,
+ (CONST BYTE *) szServicePath,
+ _tcslen (szServicePath) + sizeof (TCHAR));
+
+ /*
+ * Set the supported types flags.
+ */
+ dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
+ RegSetValueEx (hKey, _T("TypesSupported"), 0, REG_DWORD,
+ (CONST BYTE *) & dwData, sizeof (DWORD));
+
+ /*
+ * Close Registry key
+ */
+ RegCloseKey (hKey);
+
+ /*
+ * Set Service Description String and save startup parameters if present
+ */
+ if (lpszServiceDescription != NULL || StartUpArg->Argc > 2)
+ {
+ /*
+ * Create Registry Key path
+ */
+ _tcscpy (szRegKey, _T ("SYSTEM\\CurrentControlSet\\Services\\"));
+ _tcscat (szRegKey, app_name_long);
+ hKey = NULL;
+
+ /*
+ * Open Registry key using Create and Set access.
+ */
+ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_WRITE,
+ &hKey) != ERROR_SUCCESS)
+ {
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"),
+ _T ("is unable to create registry entries"),
+ lpszServiceDisplayName);
+ ProcessError (EVENTLOG_ERROR_TYPE, MsgErrorString, 1, quiet);
+ exitStatus = SERVICE_ERROR_CREATE_REGISTRY_ENTRIES;
+ LEAVE;
+ }
+
+ /*
+ * Create description subkey and the set value
+ */
+ if (lpszServiceDescription != NULL)
+ {
+ if (RegSetValueEx (hKey, _T("Description"), 0, REG_SZ,
+ (CONST BYTE *) lpszServiceDescription,
+ _tcslen (lpszServiceDescription) +
+ sizeof (TCHAR)) != ERROR_SUCCESS)
+ {
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"),
+ _T ("is unable to create registry entries"),
+ lpszServiceDisplayName);
+ ProcessError (EVENTLOG_ERROR_TYPE, MsgErrorString, 1, quiet);
+ exitStatus = SERVICE_ERROR_CREATE_REGISTRY_ENTRIES;
+ LEAVE;
+ };
+ }
+
+ /*
+ * Save startup arguments if they are present
+ */
+ if (StartUpArg->Argc > 2)
+ {
+ /*
+ * Create Subkey parameters
+ */
+ if (RegCreateKeyEx
+ (hKey, _T("Parameters"), 0, NULL,
+ REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
+ &hParamKey, NULL) != ERROR_SUCCESS)
+ {
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"),
+ _T ("is unable to create registry entries"),
+ lpszServiceDisplayName);
+ ProcessError (EVENTLOG_ERROR_TYPE, MsgErrorString, 1, quiet);
+ exitStatus = SERVICE_ERROR_CREATE_REGISTRY_ENTRIES;
+ LEAVE;
+ }
+
+ /*
+ * Save parameters
+ */
+
+ /*
+ * Loop through arguments
+ */
+ if (quiet) /* Make sure we don't store -quiet arg */
+ i = 3;
+ else
+ i = 2;
+
+ for (j = 1; i < StartUpArg->Argc; i++, j++)
+ {
+ _sntprintf (szRegKey, CountOf(szRegKey), _T("%s%d"), _T ("Param"), j);
+
+ /*
+ * Create registry key
+ */
+ if (RegSetValueEx
+ (hParamKey, szRegKey, 0, REG_SZ,
+ (CONST BYTE *) StartUpArg->Argv[i],
+ _tcslen (StartUpArg->Argv[i]) +
+ sizeof (TCHAR)) != ERROR_SUCCESS)
+ {
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"),
+ _T ("is unable to create registry entries"),
+ lpszServiceDisplayName);
+ ProcessError (EVENTLOG_ERROR_TYPE, MsgErrorString, 1, quiet);
+ exitStatus = SERVICE_ERROR_CREATE_REGISTRY_ENTRIES;
+ LEAVE;
+ };
+ }
+ }
+
+ /*
+ * Everything is set, delete hKey
+ */
+ RegCloseKey (hParamKey);
+ RegCloseKey (hKey);
+ }
+
+ /*
+ * Ready to log messages
+ */
+
+ /*
+ * Successfully registered as service
+ */
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"), lpszServiceName,
+ _T ("successfully registered as a service"));
+
+ /*
+ * Log message to eventlog
+ */
+ ProcessError (EVENTLOG_INFORMATION_TYPE, MsgErrorString, 0, quiet);
+ }
+
+ FINALLY
+ {
+ if (hSCManager)
+ CloseServiceHandle (hSCManager);
+ if (hService)
+ CloseServiceHandle (hService);
+ if (hKey)
+ RegCloseKey (hKey);
+ if (hParamKey)
+ RegCloseKey (hParamKey);
+ }
+ return (exitStatus);
+}
+
+ /*
+ * Unregister the service with the Windows SCM
+ * Input - ServiceName
+ */
+int
+UnregisterService (LPCTSTR lpszServiceName, int quiet)
+{
+ TCHAR MsgErrorString[MAX_STR_SIZE]; /* Message or Error string */
+ SC_HANDLE hSCManager = NULL; /* SCM handle */
+ SC_HANDLE hService = NULL; /* Service Handle */
+ SERVICE_STATUS sStatus;
+ TCHAR szRegAppLogKey[] =
+ _T("SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\");
+ TCHAR szRegKey[512];
+ int exitStatus = 0;
+/* HKEY hKey = NULL; ?* Key to registry entry */
+ TRY
+ {
+ /*
+ * Open Service Control Manager
+ */
+ hSCManager = OpenSCManager (NULL, NULL, SC_MANAGER_CREATE_SERVICE);
+ if (hSCManager == NULL)
+ {
+ ProcessError (EVENTLOG_ERROR_TYPE, _T ("Can't open SCM (Service Control Manager)"), 1, quiet);
+ exitStatus = SERVICE_ERROR_SCM_OPEN;
+ LEAVE;
+ }
+
+ /*
+ * Open registered service
+ */
+ hService = OpenService (hSCManager, lpszServiceName, SERVICE_ALL_ACCESS);
+ if (hService == NULL)
+ {
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"), _T ("Can't open service"),
+ lpszServiceName);
+ ProcessError (EVENTLOG_ERROR_TYPE, MsgErrorString, 1, quiet);
+ exitStatus = SERVICE_ERROR_OPEN_SERVICE;
+ LEAVE;
+ }
+
+ /*
+ * Query service status
+ * If running stop before deleting
+ */
+ if (QueryServiceStatus (hService, &sStatus))
+ {
+ if (sStatus.dwCurrentState == SERVICE_RUNNING
+ || sStatus.dwCurrentState == SERVICE_PAUSED)
+ {
+ ControlService (hService, SERVICE_CONTROL_STOP, &sStatus);
+ }
+ };
+
+ /*
+ * Delete the service
+ */
+ if (DeleteService (hService) == FALSE)
+ {
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"), _T ("Can't delete service"),
+ lpszServiceName);
+
+ /*
+ * Log message to eventlog
+ */
+ ProcessError (EVENTLOG_ERROR_TYPE, MsgErrorString, 0, quiet);
+ LEAVE;
+ }
+
+ /*
+ * Log "Service deleted successfully " message to eventlog
+ */
+ _sntprintf (MsgErrorString, CountOf(MsgErrorString), _T("%s %s"), lpszServiceName, _T ("service deleted"));
+ ProcessError (EVENTLOG_INFORMATION_TYPE, MsgErrorString, 0, quiet);
+
+ /*
+ * Delete registry entries for EventLog
+ */
+ _tcscpy (szRegKey, szRegAppLogKey);
+ _tcscat (szRegKey, lpszServiceName);
+ RegDeleteKey (HKEY_LOCAL_MACHINE, szRegKey);
+ }
+
+ /*
+ * Delete the handles
+ */
+ FINALLY
+ {
+ if (hService)
+ CloseServiceHandle (hService);
+ if (hSCManager)
+ CloseServiceHandle (hSCManager);
+ }
+ return (exitStatus);
+}
+
+ /*
+ * Write a message to the Windows event log.
+ */
+VOID
+WriteToEventLog (WORD wType, LPCTSTR pszFormat, ...)
+{
+ TCHAR szMessage[512];
+ LPCTSTR LogStr[1];
+ va_list ArgList;
+ HANDLE hEventSource = NULL;
+
+ va_start (ArgList, pszFormat);
+ _vsntprintf (szMessage, CountOf(szMessage), pszFormat, ArgList);
+ va_end (ArgList);
+ LogStr[0] = szMessage;
+ hEventSource = RegisterEventSource (NULL, app_name_long);
+ if (hEventSource == NULL)
+ return;
+ ReportEvent (hEventSource, wType, 0,
+ DISPLAY_MSG,
+ NULL, 1, 0, LogStr, NULL);
+ DeregisterEventSource (hEventSource);
+}
+
+ /*
+ * Pre-process the second command-line argument from the user.
+ * Service related options are:
+ * -register - registers the service
+ * -unregister - unregisters the service
+ * -service - run as service
+ * other command-line arguments are ignored here.
+ *
+ * Return: Type indicating the option specified
+ */
+INT
+ParseCmdLineForServiceOption (int argc, TCHAR * argv[], int *quiet)
+{
+ int nReturn = RUN_AS_CONSOLE; /* default is to run as a console application */
+
+ if (argc >= 2)
+ {
+
+ /*
+ * second argument present
+ */
+ if (lstrcmpi (_T ("-register"), argv[1]) == 0)
+ {
+ nReturn = REGISTER_SERVICE;
+ }
+
+ else if (lstrcmpi (_T ("-unregister"), argv[1]) == 0)
+ {
+ nReturn = UN_REGISTER_SERVICE;
+ }
+
+ else if (lstrcmpi (_T ("-service"), argv[1]) == 0)
+ {
+ nReturn = RUN_AS_SERVICE;
+ }
+ }
+
+ if (argc >= 3)
+ {
+ /*
+ * third argument present
+ */
+ if (lstrcmpi (_T ("-quiet"), argv[2]) == 0)
+ {
+ *quiet = 1;
+ }
+ }
+
+ return nReturn;
+}
+
+ /*
+ * Write error message to event log, console or pop-up window.
+ *
+ * If useGetLastError is 1, the last error returned from GetLastError()
+ * is appended to pszMessage, separated by a ": ".
+ *
+ * eventLogType: MessageBox equivalent:
+ *
+ * EVENTLOG_INFORMATION_TYPE MB_ICONASTERISK
+ * EVENTLOG_WARNING_TYPE MB_ICONEXCLAMATION
+ * EVENTLOG_ERROR_TYPE MB_ICONSTOP
+ *
+ */
+VOID
+ProcessError (WORD eventLogType, LPCTSTR pszMessage, int useGetLastError, int quiet)
+{
+ HANDLE hEventSource = NULL;
+ TCHAR pszMessageFull[MAX_STR_SIZE]; /* Combined pszMessage and GetLastError */
+
+ /*
+ * If useGetLastError enabled, generate text from GetLastError() and append to
+ * pszMessageFull
+ */
+ if (useGetLastError) {
+ LPTSTR pErrorMsgTemp = NULL;
+ FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (),
+ MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) & pErrorMsgTemp, 0, NULL);
+
+ _sntprintf (pszMessageFull, CountOf(pszMessageFull), _T("%s: %s"), pszMessage, pErrorMsgTemp);
+ if (pErrorMsgTemp) {
+ LocalFree (pErrorMsgTemp);
+ pErrorMsgTemp = NULL;
+ }
+ }
+ else {
+ _sntprintf (pszMessageFull, CountOf(pszMessageFull), _T("%s"), pszMessage);
+ }
+
+ hEventSource = RegisterEventSource (NULL, app_name_long);
+ if (hEventSource != NULL) {
+ LPCTSTR LogStr[1];
+ LogStr[0] = pszMessageFull;
+
+ if (ReportEvent (hEventSource,
+ eventLogType,
+ 0,
+ DISPLAY_MSG, /* just output the text to the event log */
+ NULL,
+ 1,
+ 0,
+ LogStr,
+ NULL)) {
+ }
+ else {
+ LPTSTR pErrorMsgTemp = NULL;
+ FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (),
+ MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) & pErrorMsgTemp, 0, NULL);
+ _ftprintf(stderr,_T("Could NOT lot to Event Log. Error returned from ReportEvent(): %s\n"),pErrorMsgTemp);
+ if (pErrorMsgTemp) {
+ LocalFree (pErrorMsgTemp);
+ pErrorMsgTemp = NULL;
+ }
+ }
+ DeregisterEventSource (hEventSource);
+ }
+
+ if (quiet) {
+ _ftprintf(stderr,_T("%s\n"),pszMessageFull);
+ }
+ else {
+ switch (eventLogType) {
+ case EVENTLOG_INFORMATION_TYPE:
+ MessageBox (NULL, pszMessageFull, app_name_long, MB_ICONASTERISK);
+ break;
+ case EVENTLOG_WARNING_TYPE:
+ MessageBox (NULL, pszMessageFull, app_name_long, MB_ICONEXCLAMATION);
+ break;
+ case EVENTLOG_ERROR_TYPE:
+ MessageBox (NULL, pszMessageFull, app_name_long, MB_ICONSTOP);
+ break;
+ default:
+ MessageBox (NULL, pszMessageFull, app_name_long, EVENTLOG_WARNING_TYPE);
+ break;
+ }
+ }
+}
+
+ /*
+ * Update current service status.
+ * Sends the current service status to the SCM. Also updates
+ * the global service status structure.
+ */
+static BOOL
+UpdateServiceStatus (DWORD dwStatus, DWORD dwErrorCode, DWORD dwWaitHint)
+{
+ DWORD static dwCheckpoint = 1;
+ DWORD dwControls = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_PAUSE_CONTINUE;
+ if (g_fRunningAsService == FALSE)
+ return FALSE;
+ ZeroMemory (&ServiceStatus, sizeof (ServiceStatus));
+ ServiceStatus.dwServiceType = SERVICE_WIN32;
+ ServiceStatus.dwCurrentState = dwStatus;
+ ServiceStatus.dwWaitHint = dwWaitHint;
+ if (dwErrorCode)
+ {
+ ServiceStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR;
+ ServiceStatus.dwServiceSpecificExitCode = dwErrorCode;
+ }
+
+ /*
+ * special cases that depend on the new state
+ */
+ switch (dwStatus)
+ {
+ case SERVICE_START_PENDING:
+ dwControls = 0;
+ break;
+ case SERVICE_RUNNING:
+ case SERVICE_STOPPED:
+ dwCheckpoint = 0;
+ break;
+ }
+ ServiceStatus.dwCheckPoint = dwCheckpoint++;
+ ServiceStatus.dwControlsAccepted = dwControls;
+ return ReportCurrentServiceStatus ();
+}
+
+ /*
+ * Reports current service status to SCM
+ */
+static BOOL
+ReportCurrentServiceStatus ()
+{
+ return SetServiceStatus (hServiceStatus, &ServiceStatus);
+}
+
+ /*
+ * ServiceMain function.
+ */
+VOID WINAPI
+ServiceMain (DWORD argc, LPTSTR argv[])
+{
+ SECURITY_ATTRIBUTES SecurityAttributes;
+ unsigned threadId;
+
+ /*
+ * Input arguments
+ */
+ DWORD ArgCount = 0;
+ LPTSTR *ArgArray = NULL;
+ TCHAR szRegKey[512];
+ HKEY hParamKey = NULL;
+ DWORD TotalParams = 0;
+ DWORD i;
+ InputParams ThreadInputParams;
+
+ /*
+ * Build the Input parameters to pass to worker thread
+ */
+
+ /*
+ * SCM sends Service Name as first arg, increment to point
+ * arguments user specified while starting control agent
+ */
+
+ /*
+ * Read registry parameter
+ */
+ ArgCount = 1;
+
+ /*
+ * Create registry key path
+ */
+ _sntprintf (szRegKey, CountOf(szRegKey), _T("%s%s\\%s"),
+ _T ("SYSTEM\\CurrentControlSet\\Services\\"), app_name_long,
+ _T("Parameters"));
+ if (RegOpenKeyEx
+ (HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_ALL_ACCESS, &hParamKey) == ERROR_SUCCESS)
+ {
+
+ /*
+ * Read startup configuration information
+ */
+ /*
+ * Find number of subkeys inside parameters
+ */
+ if (RegQueryInfoKey (hParamKey, NULL, NULL, 0,
+ NULL, NULL, NULL, &TotalParams,
+ NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
+ {
+ if (TotalParams != 0)
+ {
+ ArgCount += TotalParams;
+
+ /*
+ * Allocate memory to hold strings
+ */
+ ArgArray = calloc(ArgCount, sizeof(ArgArray[0]));
+ if (ArgArray == 0)
+ {
+ WriteToEventLog (EVENTLOG_ERROR_TYPE,
+ _T ("Resource failure"));
+ return;
+ }
+
+ /*
+ * Copy first argument
+ */
+ ArgArray[0] = _tcsdup (argv[0]);
+ for (i = 1; i <= TotalParams; i++)
+ {
+ DWORD dwErrorcode;
+ DWORD nSize;
+ DWORD nRegkeyType;
+ TCHAR *szValue;
+
+ /*
+ * Create Subkey value name
+ */
+ _sntprintf (szRegKey, CountOf(szRegKey), _T("%s%d"), _T("Param"), i);
+
+ /*
+ * Query subkey.
+ */
+ nSize = 0;
+ dwErrorcode = RegQueryValueEx(hParamKey, szRegKey, NULL,
+ &nRegkeyType, NULL, &nSize);
+ if (dwErrorcode == ERROR_SUCCESS) {
+ if (nRegkeyType == REG_SZ || nRegkeyType == REG_EXPAND_SZ) {
+ szValue = malloc(nSize + sizeof(szValue[0]));
+ if (szValue) {
+ dwErrorcode = RegQueryValueEx(hParamKey, szRegKey, NULL,
+ &nRegkeyType, (LPBYTE)szValue, &nSize);
+ if (dwErrorcode == ERROR_SUCCESS) {
+ szValue[nSize] = 0;
+ ArgArray[i] = szValue;
+ } else {
+ free(szValue);
+ WriteToEventLog(EVENTLOG_ERROR_TYPE, _T("Querying registry key %s failed: error code %ld"), szRegKey, dwErrorcode);
+ }
+ } else
+ WriteToEventLog(EVENTLOG_ERROR_TYPE, _T("Querying registry key %s failed: out of memory"), szRegKey);
+ } else
+ WriteToEventLog(EVENTLOG_ERROR_TYPE, _T("Type %ld of registry key %s is incorrect"), nRegkeyType, szRegKey);
+ } else
+ WriteToEventLog(EVENTLOG_ERROR_TYPE, _T("Querying registry key %s failed: error code %ld"), szRegKey, dwErrorcode);
+
+ if (!ArgArray[i]) {
+ TotalParams = ArgCount = i;
+ break;
+ }
+ }
+ }
+ }
+ RegCloseKey (hParamKey);
+ }
+ if (ArgCount == 1)
+ {
+
+ /*
+ * No startup args are given
+ */
+ ThreadInputParams.Argc = argc;
+ ThreadInputParams.Argv = argv;
+ }
+
+ else
+ {
+ ThreadInputParams.Argc = ArgCount;
+ ThreadInputParams.Argv = ArgArray;
+ }
+
+ /*
+ * Register Service Control Handler
+ */
+ hServiceStatus = RegisterServiceCtrlHandler (app_name_long, ControlHandler);
+ if (hServiceStatus == 0)
+ {
+ WriteToEventLog (EVENTLOG_ERROR_TYPE,
+ _T ("RegisterServiceCtrlHandler failed"));
+ return;
+ }
+
+ /*
+ * Update the service status to START_PENDING.
+ */
+ UpdateServiceStatus (SERVICE_START_PENDING, NO_ERROR, SCM_WAIT_INTERVAL);
+
+ /*
+ * Start the worker thread, which does the majority of the work .
+ */
+ TRY
+ {
+ if (SetSimpleSecurityAttributes (&SecurityAttributes) == FALSE)
+ {
+ WriteToEventLog (EVENTLOG_ERROR_TYPE,
+ _T ("Couldn't init security attributes"));
+ LEAVE;
+ }
+ hServiceThread =
+ (void *) _beginthreadex (&SecurityAttributes, 0,
+ ThreadFunction,
+ (void *) &ThreadInputParams, 0, &threadId);
+ if (hServiceThread == NULL)
+ {
+ WriteToEventLog (EVENTLOG_ERROR_TYPE, _T ("Couldn't start worker thread"));
+ LEAVE;
+ }
+
+ /*
+ * Set service status to SERVICE_RUNNING.
+ */
+ UpdateServiceStatus (SERVICE_RUNNING, NO_ERROR, SCM_WAIT_INTERVAL);
+
+ /*
+ * Wait until the worker thread finishes.
+ */
+ WaitForSingleObject (hServiceThread, INFINITE);
+ }
+ FINALLY
+ {
+ /*
+ * Release resources
+ */
+ UpdateServiceStatus (SERVICE_STOPPED, NO_ERROR, SCM_WAIT_INTERVAL);
+ if (hServiceThread)
+ CloseHandle (hServiceThread);
+ FreeSecurityAttributes (&SecurityAttributes);
+
+ /*
+ * Free allocated argument list
+ */
+ if (ArgCount > 1 && ArgArray != NULL)
+ {
+ /*
+ * Free all strings
+ */
+ for (i = 0; i < ArgCount; i++)
+ {
+ free (ArgArray[i]);
+ }
+ free (ArgArray);
+ }
+ }
+}
+
+ /*
+ * Function to start as Windows service
+ * The calling party should specify their entry point as input parameter
+ * Returns TRUE if the Service is started successfully
+ */
+BOOL
+RunAsService (INT (*ServiceFunction) (INT, LPTSTR *))
+{
+
+ /*
+ * Set the ServiceEntryPoint
+ */
+ ServiceEntryPoint = ServiceFunction;
+
+ /*
+ * By default, mark as Running as a service
+ */
+ g_fRunningAsService = TRUE;
+
+ /*
+ * Initialize ServiceTableEntry table
+ */
+ ServiceTableEntry[0].lpServiceName = app_name_long; /* Application Name */
+
+ /*
+ * Call SCM via StartServiceCtrlDispatcher to run as Service
+ * * If the function returns TRUE we are running as Service,
+ */
+ if (StartServiceCtrlDispatcher (ServiceTableEntry) == FALSE)
+ {
+ g_fRunningAsService = FALSE;
+
+ /*
+ * Some other error has occurred.
+ */
+ WriteToEventLog (EVENTLOG_ERROR_TYPE,
+ _T ("Couldn't start service - %s"), app_name_long);
+ }
+ return g_fRunningAsService;
+}
+
+ /*
+ * Service control handler function
+ * Responds to SCM commands/requests
+ * This service handles 4 commands
+ * - interrogate, pause, continue and stop.
+ */
+VOID WINAPI
+ControlHandler (DWORD dwControl)
+{
+ switch (dwControl)
+ {
+ case SERVICE_CONTROL_INTERROGATE:
+ ProcessServiceInterrogate ();
+ break;
+
+ case SERVICE_CONTROL_PAUSE:
+ ProcessServicePause ();
+ break;
+
+ case SERVICE_CONTROL_CONTINUE:
+ ProcessServiceContinue ();
+ break;
+
+ case SERVICE_CONTROL_STOP:
+ ProcessServiceStop ();
+ break;
+ }
+}
+
+ /*
+ * To stop the service.
+ * If a stop function was registered, invoke it,
+ * otherwise terminate the worker thread.
+ * After stopping, Service status is set to STOP in
+ * main loop
+ */
+VOID
+ProcessServiceStop (VOID)
+{
+ UpdateServiceStatus (SERVICE_STOP_PENDING, NO_ERROR, SCM_WAIT_INTERVAL);
+
+ if (StopFunction != NULL)
+ {
+ (*StopFunction) ();
+ }
+
+ else
+ {
+ TerminateThread (hServiceThread, 0);
+ }
+}
+
+ /*
+ * Returns the current state of the service to the SCM.
+ */
+VOID
+ProcessServiceInterrogate (VOID)
+{
+ ReportCurrentServiceStatus ();
+}
+
+ /*
+ * To Create a security descriptor with a NULL ACL, which
+ * allows unlimited access. Returns a SECURITY_ATTRIBUTES
+ * structure that contains the security descriptor.
+ * The structure contains a dynamically allocated security
+ * descriptor that must be freed either manually, or by
+ * calling FreeSecurityAttributes
+ */
+BOOL
+SetSimpleSecurityAttributes (SECURITY_ATTRIBUTES * pSecurityAttr)
+{
+ BOOL fReturn = FALSE;
+ SECURITY_DESCRIPTOR *pSecurityDesc = NULL;
+
+ /*
+ * If an invalid address is passed as a parameter, return
+ * FALSE right away.
+ */
+ if (!pSecurityAttr)
+ return FALSE;
+ pSecurityDesc =
+ (SECURITY_DESCRIPTOR *) LocalAlloc (LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH);
+ if (!pSecurityDesc)
+ return FALSE;
+ fReturn =
+ InitializeSecurityDescriptor (pSecurityDesc, SECURITY_DESCRIPTOR_REVISION);
+ if (fReturn != FALSE)
+ {
+ fReturn = SetSecurityDescriptorDacl (pSecurityDesc, TRUE, NULL, FALSE);
+ }
+ if (fReturn != FALSE)
+ {
+ pSecurityAttr->nLength = sizeof (SECURITY_ATTRIBUTES);
+ pSecurityAttr->lpSecurityDescriptor = pSecurityDesc;
+ pSecurityAttr->bInheritHandle = TRUE;
+ }
+
+ else
+ {
+ /*
+ * Couldn't initialize or set security descriptor.
+ */
+ LocalFree (pSecurityDesc);
+ }
+ return fReturn;
+}
+
+ /*
+ * This function Frees the security descriptor, if any was created.
+ */
+VOID
+FreeSecurityAttributes (SECURITY_ATTRIBUTES * pSecurityAttr)
+{
+ if (pSecurityAttr && pSecurityAttr->lpSecurityDescriptor)
+ LocalFree (pSecurityAttr->lpSecurityDescriptor);
+}
+
+ /*
+ * This function runs in the worker thread
+ * until an exit is forced, or until the SCM issues the STOP command.
+ * Invokes registered service function
+ * Returns when called registered function returns
+ *
+ * Input:
+ * lpParam contains argc and argv, pass to service main function
+ */
+unsigned WINAPI
+ThreadFunction (LPVOID lpParam)
+{
+ InputParams * pInputArg = (InputParams *) lpParam;
+ return (*ServiceEntryPoint) (pInputArg->Argc, pInputArg->Argv);
+}
+
+ /*
+ * This function is called to register an application-specific function
+ * which is invoked when the SCM stops the worker thread.
+ */
+VOID
+RegisterStopFunction (VOID (*StopFunc) (VOID))
+{
+ StopFunction = StopFunc;
+}
+
+ /*
+ * SCM pause command invokes this function
+ * If the service is not running, this function does nothing.
+ * Otherwise, suspend the worker thread and update the status.
+ */
+VOID
+ProcessServicePause (VOID)
+{
+ if (ServiceStatus.dwCurrentState == SERVICE_RUNNING)
+ {
+ UpdateServiceStatus (SERVICE_PAUSE_PENDING, NO_ERROR, SCM_WAIT_INTERVAL);
+
+ if (SuspendThread (hServiceThread) != -1)
+ {
+ UpdateServiceStatus (SERVICE_PAUSED, NO_ERROR, SCM_WAIT_INTERVAL);
+ }
+ }
+}
+
+ /*
+ * SCM resume command invokes this function
+ * If the service is not paused, this function does nothing.
+ * Otherwise, resume the worker thread and update the status.
+ */
+VOID
+ProcessServiceContinue (VOID)
+{
+ if (ServiceStatus.dwCurrentState == SERVICE_PAUSED)
+ {
+ UpdateServiceStatus (SERVICE_CONTINUE_PENDING, NO_ERROR, SCM_WAIT_INTERVAL);
+
+ if (ResumeThread (hServiceThread) != -1)
+ {
+ UpdateServiceStatus (SERVICE_RUNNING, NO_ERROR, SCM_WAIT_INTERVAL);
+ }
+ }
+}
+
+#endif /* WIN32 */
+
+
diff --git a/snmplib/winservice.mc b/snmplib/winservice.mc
new file mode 100644
index 0000000..5099b91
--- /dev/null
+++ b/snmplib/winservice.mc
@@ -0,0 +1,11 @@
+;//Message catalog for Windows Serivce Support routines
+;//To support event logging functionality
+;//By Raju Krishnappa(raju_krishnappa@yahoo.com)
+
+;//Message ID descriptions
+
+MessageId=100
+SymbolicName=DISPLAY_MSG
+Language=English
+%1.
+.
diff --git a/snmplib/winservice.rc b/snmplib/winservice.rc
new file mode 100644
index 0000000..0885a89
--- /dev/null
+++ b/snmplib/winservice.rc
@@ -0,0 +1,2 @@
+LANGUAGE 0x9,0x1
+1 11 MSG00001.bin
diff --git a/snmplib/winservicerc.rc b/snmplib/winservicerc.rc
new file mode 100644
index 0000000..0885a89
--- /dev/null
+++ b/snmplib/winservicerc.rc
@@ -0,0 +1,2 @@
+LANGUAGE 0x9,0x1
+1 11 MSG00001.bin
diff --git a/stamp-h b/stamp-h
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/stamp-h
@@ -0,0 +1 @@
+timestamp
diff --git a/stamp-h.in b/stamp-h.in
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/stamp-h.in
@@ -0,0 +1 @@
+timestamp
diff --git a/testing/Makefile.in b/testing/Makefile.in
new file mode 100644
index 0000000..0e70132
--- /dev/null
+++ b/testing/Makefile.in
@@ -0,0 +1,120 @@
+#
+# Makefile for testing
+#
+
+# 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)
+
+USELIBS = ../snmplib/libsnmp.$(LIB_EXTENSION)$(LIB_VERSION)
+LIBS = -L../snmplib $(CC_RUNTIME_ARG) -lsnmp @LIBS@
+
+PARSEOBJS =
+
+CPPFLAGS = $(SNMPLIB_INCLUDES) @CPPFLAGS@
+CC = @CC@ $(CPPFLAGS)
+
+all:
+ @echo "Select one of the following targets to run:"
+ @echo ""
+ @echo " make test -- default test suites"
+ @echo " make testall -- Run all available tests"
+ @echo " make testfailed -- Run only the tests that failed last time."
+ @echo " make testsimple -- Run tests directly with simple_run"
+ @echo ""
+ @echo "Set additional test parameters with TESTOPTS=args"
+ @echo ""
+ @echo "Also see the RUNFULLTESTS script for details"
+
+test:
+ @if test "x$(PERL)" = "x" \
+ -o "x@PERL_SYSTEM_INVOKES_POSIX_SHELL@" != xyes \
+ || { ! $(PERL) -e 'require TAP::Harness;' >/dev/null 2>&1 \
+ && ! $(PERL) -e 'require Test::Harness;' >/dev/null 2>&1; };\
+ then \
+ echo $(srcdir)/RUNTESTS ; \
+ $(srcdir)/RUNTESTS ; \
+ else \
+ echo $(srcdir)/RUNFULLTESTS $(TESTOPTS) ; \
+ $(PERL) $(srcdir)/RUNFULLTESTS $(TESTOPTS) ; \
+ fi
+
+testsimple:
+ @(export srcdir=$(top_srcdir) ; \
+ export builddir=$(top_builddir) ; \
+ $(srcdir)/fulltests/support/simple_run $(TESTOPTS) \
+ )
+
+testall:
+ $(srcdir)/RUNFULLTESTS -g all $(TESTOPTS)
+
+testfailed:
+ $(srcdir)/RUNFULLTESTS -f $(TESTOPTS)
+
+
+test-mibs:
+ cd $(srcdir)/rfc1213 ; ./run
+
+etest: etimetest.o $(PARSEOBJS) $(USELIBS)
+ ${CC} -o $@ etimetest.o $(PARSEOBJS) ${LDFLAGS} ${LIBS}
+
+ktest: keymanagetest.o $(PARSEOBJS) $(USELIBS)
+ ${CC} -o $@ keymanagetest.o $(PARSEOBJS) ${LDFLAGS} ${LIBS}
+
+misctest: misctest.o $(PARSEOBJS) $(USELIBS)
+ ${CC} -o $@ misctest.o $(PARSEOBJS) ${LDFLAGS} ${LIBS}
+
+stest: scapitest.o $(PARSEOBJS) $(USELIBS)
+ ${CC} -o $@ scapitest.o $(PARSEOBJS) ${LDFLAGS} ${LIBS}
+
+clean: testclean
+ rm -f *.o core *.core $(TARG)
+
+testclean:
+ -rm -fr /tmp/snmp-test*
+
+install: installdirs $(TARG)
+ @for i in $(TARG) ; \
+ do $(INSTALL) $$i $(INSTALL_PREFIX)$(bindir) ; \
+ echo "install: installed $$i in $(INSTALL_PREFIX)$(bindir)" ; \
+ done
+
+installdirs:
+ @$(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(snmplibdir) $(INSTALL_PREFIX)$(bindir)
+
+dependlocal:
+ makedepend $(CPPFLAGS) -o.lo $(srcdir)/*.c
+
+depend: dependlocal
+
+nosysdepend:
+ makedepend $(CPPFLAGS) -o.lo *.c
+ $(PERL) -n -i.bak $(top_srcdir)/makenosysdepend.pl Makefile
+
+makefileindepend: nosysdepend
+ $(PERL) $(top_srcdir)/makefileindepend.pl
+
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+
+etimetest.lo: ../config.h ../m/generic.h ../s/generic.h ../s/linux.h
+etimetest.lo: ../snmplib/asn1.h ../snmplib/callback.h ../snmplib/lcd_time.h
+etimetest.lo: ../snmplib/snmp_api.h ../snmplib/snmp_debug.h ../snmplib/tools.h
+etimetest.lo: ../s/sysv.h
+keymanagetest.lo: ../config.h ../m/generic.h ../s/generic.h ../s/linux.h
+keymanagetest.lo: ../snmplib/asn1.h ../snmplib/callback.h ../snmplib/keytools.h
+keymanagetest.lo: ../snmplib/scapi.h ../snmplib/snmp_api.h ../snmplib/tools.h
+keymanagetest.lo: ../snmplib/transform_oids.h ../s/sysv.h
+misctest.lo: ../config.h ../m/generic.h ../s/generic.h ../s/linux.h
+misctest.lo: ../snmplib/asn1.h ../snmplib/callback.h ../snmplib/snmp_api.h
+misctest.lo: ../snmplib/tools.h ../snmplib/transform_oids.h ../s/sysv.h
+scapitest.lo: ../config.h ../m/generic.h ../s/generic.h ../s/linux.h
+scapitest.lo: ../snmplib/asn1.h ../snmplib/callback.h ../snmplib/keytools.h
+scapitest.lo: ../snmplib/scapi.h ../snmplib/snmp_api.h ../snmplib/tools.h
+scapitest.lo: ../snmplib/transform_oids.h ../s/sysv.h
+T.lo: ../config.h ../m/generic.h ../s/generic.h ../s/linux.h ../s/sysv.h
diff --git a/testing/README b/testing/README
new file mode 100644
index 0000000..faccc3e
--- /dev/null
+++ b/testing/README
@@ -0,0 +1,16 @@
+The RUNFULLTESTS script is a wrapper around the tests. All the
+tests are required to produce TAP output (hopefully soon to be
+standardized itself).
+
+By default RUNFULLTESTS only executes the tests in fulltests/default.
+Use the -g flag to test other subdirectories, or use '-g all' to test
+everything it can find.
+
+See the documentation contained in the RUNFULLTESTS script for details
+on:
+
+ - how to run particular sets of tests
+ - how to write tests
+ - how to write _build scripts
+ - how to write _run scripts
+
diff --git a/testing/RUNFULLTESTS b/testing/RUNFULLTESTS
new file mode 100755
index 0000000..7f60157
--- /dev/null
+++ b/testing/RUNFULLTESTS
@@ -0,0 +1,813 @@
+#!/usr/bin/env perl
+
+use Getopt::Long;
+#use Data::Dumper;
+use File::Basename;
+use Cwd qw(abs_path);
+use strict;
+
+########################################
+# Globals and Command Line options
+
+my %opts = ('groups' => 'default',
+ 'master-directory' => 'fulltests',
+ 'srcdir' => dirname("$0") . "/..",
+ 'builddir' => '..',
+ 'failed-file' => 'failed_tests',
+ );
+
+Getopt::Long::Configure(qw(no_ignore_case));
+GetOptions(\%opts,
+ "verbose",
+ "help|?",
+ "quiet|q",
+ "groups|g=s",
+ "r=s",
+ "debug",
+ "srcdir|D=s",
+ "builddir|d=s",
+ "f",
+ "F",
+ "failed-file=s",
+ "master-directory=s",
+ ) || ++$opts{'help'};
+
+# Change srcdir and builddir to absolute paths
+$opts{'srcdir'} = abs_path($opts{'srcdir'});
+$opts{'builddir'} = abs_path($opts{'builddir'});
+# Set exeext.
+$opts{'exeext'} = join(readpipe($opts{'builddir'} . '/net-snmp-config --exeext'));
+
+usage() if ($opts{'help'});
+
+# Build the harness object
+my %args = (
+ verbosity => ($opts{'verbose'} ? 1 : ($opts{'quiet'} ? -1 : 0)),
+ exec => \&decide_exec,
+ # this option is *really* weird in how it works
+ failures => ($opts{'quiet'} ? 0 : ($opts{'verbose'} ? 0 : 1)),
+ errors => ($opts{'quiet'} ? 0 : 1),
+ );
+
+# list of support infrastructure components
+my %support;
+my %sources;
+
+# if the -d option was specified, pass on the source root directory to all apps
+if (exists($opts{'master-directory'})) {
+ $ENV{'NETSNMPSRCDIR'} = $opts{'master-directory'};
+} else {
+ $ENV{'NETSNMPSRCDIR'} = '.';
+}
+
+# pass srcdir and builddir to all apps
+$ENV{'srcdir'} = $opts{'srcdir'};
+$ENV{'builddir'} = $opts{'builddir'};
+
+# set up MIBDIRS to refer to the src directory
+if (!$ENV{'MIBDIRS'}) {
+ $ENV{'MIBDIRS'} = "$opts{srcdir}/mibs";
+}
+
+########################################
+# Protection measures
+$ENV{'SNMPCONFPATH'} = "/dev/null";
+
+# create the testing harness infrastructure
+
+my $harness;
+if (eval { require TAP::Harness; } ) {
+ import TAP::Harness;
+ $harness = TAP::Harness->new(\%args);
+} else {
+ require Test::Harness;
+ import Test::Harness;
+ if ($opts{'groups'} ne 'default') {
+ print STDERR "
+ERROR: I can not find the perl TAP::Harness module. We support the
+more common Test::Harness module but only for the default test group.
+
+Either:
+ 1) run only the default tests (i.e., just \"make test\")
+ 2) install the TAP::Harness perl module
+
+";
+ exit 1;
+ }
+}
+
+
+########################################
+# gather the tests
+my @tests;
+
+DEBUG("Gathering and building tests:\n");
+find_support();
+if ($opts{'f'}) {
+ DIE("The -f and -g options can not be both specified\n")
+ if ($opts{'groups'} ne 'default');
+ DIE("The -f and -r options can not be both specified\n") if ($opts{'r'});
+ DIE("No $opts{'failed-file'} file was found to read failed state from\n")
+ if (! -f $opts{'failed-file'});
+ open(F, $opts{'failed-file'});
+ while (<F>) {
+ chomp;
+ push @tests, build_test($_);
+ }
+} else {
+ @tests = gather_tests($opts{'groups'}, $opts{'r'});
+}
+
+########################################
+# rename them to remove parent dirs
+@tests = rename_tests(@tests);
+
+########################################
+# run the tests
+
+DEBUG("Running tests:\n");
+DEBUG("-" x 78, "\n");
+
+my $results;
+if ($harness) {
+ $results = $harness->runtests(@tests);
+} else {
+ # minimal backwards compat with Test::Harness
+ run_older_perl_tests(@tests);
+}
+
+my @failed = $results->failed();
+if (!$opts{'q'} && $#failed > -1) {
+ print "\nWe failed these ", (1 + $#failed), " tests:\n";
+ my @lines = @failed;
+ map { if (exists($sources{$_})) { $_ = "$_ ( $sources{$_} )"} } @lines;
+ print " ", join("\n ",@lines), "\n";
+}
+
+if (!$opts{'F'}) {
+ open(F,">$opts{'failed-file'}");
+ if ($#failed > -1) {
+ print F join("\n", get_sources(@failed)) . "\n";
+ }
+ close(F);
+}
+
+exit($results->all_passed() ? 0 : 1);
+
+######################################################################
+# Infrastructure
+#
+
+########################################
+# decides how we should execute a test
+#
+sub decide_exec {
+ my ( $harness, $testfile ) = @_;
+
+ # 1) Parse the $testfile argument.
+ my ($dirname, $groupname, $basename, $app_extension, $file_extension) =
+ ($testfile =~ /([^\/]+)\/([^\/]+)\/([^\/]+)_([^\/_]+)\.*([^\/\.]*)$/);
+ $app_extension =~ s/$opts{'exeext'}\$//;
+
+ # 2) we have a RUN_TYPE file in the same directory
+ if (exists($support{'run'}{$app_extension}{$groupname})) {
+ return [$support{'run'}{$app_extension}{$groupname}, $testfile];
+ }
+
+ # 3) return a generic run script
+ if (exists($support{'run'}{$app_extension}{'generic'})) {
+ return [$support{'run'}{$app_extension}{'generic'}, $testfile];
+ }
+
+ # 4) give up and let the test harness decide itself
+ return undef;
+}
+
+sub gather_tests {
+ my ( $groups, $regexp ) = @_;
+ my @groups;
+
+ # figure out the list of groups we need to search through
+ if ($groups eq 'all') {
+ # find every group we can
+ # we exclude:
+ # - things not a directory
+ # - anything with "template" in the name
+ @groups =
+ grep { !/(template|support)/ &&
+ -d $_ && s/$opts{'srcdir'}\/testing\/$opts{'master-directory'}.// } glob("$opts{'srcdir'}/testing/$opts{'master-directory'}/*");
+ } else {
+ # they specified a comma separated list
+ @groups = split(/,\s*/, $groups);
+ }
+ DEBUG("Checking groups: ", join(", ", @groups), "\n");
+
+ my @tests;
+ foreach my $group (@groups) {
+ my @files;
+
+ DEBUG("checking group $group\n");
+
+ if (! -d "$opts{'srcdir'}/testing/$opts{'master-directory'}/$group") {
+ ERROR("group '$group' is not a directory under '$opts{'srcdir'}/testing/$opts{'master-directory'}'; ignoring\n");
+ next;
+ }
+
+ # push on all files that start with T[NUM]*
+ push_or_skip(\@tests, $regexp, glob("$opts{'srcdir'}/testing/$opts{'master-directory'}/$group/T[0-9]*"));
+ }
+
+ return @tests;
+}
+
+sub push_or_skip {
+ my ($array, $regexp, @files) = @_;
+ foreach my $file (@files) {
+ next if ($file =~ /.(bak|old|orig|rej)$/);
+ next if ($file =~ /~$/);
+ next if (defined($regexp) && $file !~ /$regexp/i);
+ DEBUG(" Adding file $file\n");
+ push @$array, build_test($file);
+ }
+}
+
+# rename all the tests to remove the top subdir to help readability
+sub rename_tests {
+ my (@tests) = @_;
+ my @newtests;
+
+ # yes, I could have used map. But I didn't.
+ foreach my $file (@tests) {
+ my $title = "$file";
+ my $foundheader = 0;
+ $title = $sources{$file} if (exists($sources{$file}));
+
+ open(SRC, $title);
+ while (<SRC>) {
+ if (/(HEADER|TITLE)\s+['"]*(.*)/) {
+ $title = $2;
+ $title =~ s/\s*\*\/.*//;
+ $title =~ s/['"]$//;
+ $foundheader = 1;
+ last;
+ }
+ }
+ close(SRC);
+
+ if (! $foundheader) {
+ $title =~ s/^$opts{'srcdir'}\/testing\///;
+ $title =~ s/$opts{'master-directory'}.//;
+ }
+ $sources{$title} = $sources{$file} || $file;
+ push @newtests, [$file, $title];
+ }
+ return @newtests;
+}
+
+# called to possibly manipluate the list of tests to run by building some
+sub build_tests {
+ my (@tests) = @_;
+ my @newtests;
+
+ foreach my $test (@tests) {
+ my $title;
+
+ my $built = build_test($test);
+ if (ref($built) eq 'ARRAY') {
+ push @newtests, @$built;
+ } elsif ($built ne "") {
+ push @newtests, $built;
+ }
+ }
+ return @newtests;
+}
+
+#
+# Finds scripts that are used to build and run actual commands
+#
+sub find_builders {
+ $support{'build'} = {};
+ find_scripts('build', $support{'build'});
+}
+
+sub find_runners {
+ $support{'run'} = {};
+ find_scripts('run', $support{'run'});
+}
+
+sub find_support {
+ find_builders();
+ find_runners();
+}
+
+sub find_scripts {
+ my ($buildname, $hashref) = @_;
+ my $count;
+ DEBUG("looking for $buildname scripts\n");
+ foreach my $builder (glob("$opts{'srcdir'}/testing/$opts{'master-directory'}/*/*_${buildname}")) {
+ next if ($builder =~ /~$/);
+ next if ($builder =~ /.(bak|orig|rej|old)$/);
+
+ my ($group, $type) = ($builder =~ /([^\/]+)\/([^\/]*)_${buildname}/);
+ # save this as a certain group builder
+ $hashref->{$type}{$group} = $builder;
+
+ # save this as a generic builder if there isn't a better
+ # generic one, such as one that exists in the support
+ # directory.
+ if (!exists($hashref->{$type}{'generic'}) || $group eq 'support') {
+ $hashref->{$type}{'generic'} = $builder;
+ }
+ $count++;
+ }
+ DEBUG(" found $count\n");
+}
+
+# called to build a test from a registerd builder
+sub build_test {
+ my ($testfile) = @_;
+
+ my ($dirname, $groupname, $basename, $app_extension, $file_extension) =
+ ($testfile =~ /([^\/]+)\/([^\/]+)\/([^\/]+)_([^\/_]+)\.([^\/\.]+)$/);
+
+ # is this even a buildable type recipe?
+ if (!$dirname || !$basename || !$app_extension || !$file_extension) {
+ return $testfile;
+ }
+
+ DEBUG("found: $testfile => $dirname, $basename, $app_extension, $file_extension\n");
+
+ # choices:
+ # 1) we have a registered subroutine to build an extension from
+ # XXX
+
+ # 2) we have a BUILD_TYPE file in the same directory
+ if (exists($support{'build'}{$app_extension}{$dirname})) {
+ return
+ call_build_script($support{'build'}{$app_extension}{$dirname}, $testfile);
+ }
+
+ # 3) return a generic build script
+ if (exists($support{'build'}{$app_extension}{'generic'})) {
+ return
+ call_build_script($support{'build'}{$app_extension}{'generic'}, $testfile);
+ }
+
+ # 4) we assume it's fine as is
+ return $testfile;
+}
+
+sub call_build_script {
+ my ($scriptname, $filename) = @_;
+
+ my $maybenewfile = $filename;
+ $maybenewfile =~ s/.[^\.]+$/$opts{'exeext'}/;
+ $maybenewfile =~ s/T([^\/]+)$/B$1/; # change prefix to B for 'Built'
+ $maybenewfile =~ s/^$opts{'srcdir'}\///;
+
+ my $newpath = $maybenewfile;
+ $newpath =~ s/\/[^\/]*$//;
+
+ if (! -d $newpath) {
+ DEBUG("making directory $newpath\n");
+ system("$opts{'srcdir'}/mkinstalldirs $newpath");
+ }
+
+ my $lastline;
+ DEBUG("BUILDING: $scriptname $filename $maybenewfile\n");
+ open(B,"$scriptname $filename $maybenewfile|");
+ while (<B>) {
+ $lastline = $_;
+ }
+ chomp($lastline);
+
+ DEBUG(" result: $lastline\n");
+ return undef if ($lastline eq 'fail');
+ return undef if ($lastline eq 'skip');
+ return $filename if ($lastline eq '');
+ $sources{$lastline} = $filename; # remember where we came from
+ return $lastline;
+}
+
+sub get_sources {
+ my (@names) = @_;
+ map { if (exists($sources{$_})) { $_ = $sources{$_} } } @names;
+ return @names;
+}
+
+sub run_older_perl_tests {
+ #
+ # Older versions of perl used a different test suite called Test::Harness
+ # It is much more limited than TAP::Harness;
+ #
+ # Here we massage our older tests into something that will work under
+ # Test::Harness too.
+ #
+ my @tests = @_;
+
+ # create the temporary files
+ my @tempfiles;
+ if (! -d "$opts{'master-directory'}") {
+ mkdir("$opts{'master-directory'}", 0777);
+ }
+ if (! -d "$opts{'master-directory'}/temptests") {
+ mkdir("$opts{'master-directory'}/temptests", 0777);
+ }
+ foreach my $test (@tests) {
+ my $tempfile = "$test->[0].t";
+ $tempfile =~ s#^$opts{'srcdir'}#$opts{'builddir'}#;
+ $tempfile =~ s#$opts{'master-directory'}/default/#$opts{'master-directory'}/temptests/#;
+ open(T, ">$tempfile") || die("$tempfile: $!");
+ print T "# functionally perl\n\nsystem(\"$opts{'srcdir'}/testing/fulltests/support/simple_run $test->[0]\");\n";
+ close(T);
+ chmod(0755, $tempfile);
+ push @tempfiles, $tempfile;
+ }
+
+ $results = runtests(@tempfiles);
+
+ unlink(@tempfiles) || die("$@ $!");
+ exit;
+}
+
+# usage output
+sub usage {
+ print "$0 [OPTIONS]\n";
+
+ print "\nOPTIONS:\n";
+ print " -v\t\t\tRuns in verbose mode; dumping all test output\n";
+ print " --verbose\n";
+ print " -q\t\t\tRuns in quieter mode; dumps less test output\n";
+ print " --quiet\n";
+ print " -g GROUP\t\tRuns the group of specified tests (default = 'default')\n";
+ print " --group GROUP\n";
+ print "\t\t\t(use 'all' to run all tests)\n";
+ print " -r REGEXP\t\tOnly run test files matching this regexp\n";
+ print " -f\t\t\tRun only the failed tests from the last run\n";
+ print " -F\t\t\tDon't create the failed_tests file\n";
+ print " --failed-file FILE\tThe location of the failed state file\n";
+ print " -D PATH\t\tSource directory\n";
+ print " --srcdir PATH\n";
+ print " (currently '$opts{'srcdir'}')\n";
+ print " -d PATH\t\tBuild directory to be tested\n";
+ print " --builddir PATH\n";
+ print " (currently '$opts{'builddir'}')\n";
+ print " --master-directory DIRNAME\n";
+ print " (default = 'fulltests')\n";
+ print " -h\t\t\tThis help output\n";
+ print " --help\n";
+ print " --debug\t\tDebugging output\n\n";
+ exit;
+}
+
+sub DEBUG {
+ return if (!$opts{'debug'});
+ print @_;
+}
+
+sub ERROR {
+ print STDERR "Error:", @_;
+}
+
+sub DIE {
+ ERROR(@_);
+ exit 1;
+}
+
+=pod
+
+=head1 NAME
+
+runfulltests - the Net-SNMP test suite coordinator
+
+=head1 SYNOPSIS
+
+runfulltests [OPTIONS]
+
+# ./RUNFULLTESTS
+
+# ./RUNFULLTESTS -g all
+
+=head1 DESCRIPTION
+
+B<RUNFULLTESTS> is a TAP (see below) output aggregator and test suite
+management program. It runs groups of tests that it can find in the
+I<fulltests> sub-directory. It defaults to running a basic set of
+high-level Net-SNMP tests found in the fulltests/default directory.
+To run a different set of tests see the -g flag.
+
+It is able to keep state and remember which tests failed so that
+during development you can simply re-run only the "last failed tests"
+using the -f switch.
+
+=head2 Perl Requirements
+
+Ideally it should be run under a fairly modern version of perl (eg,
+5.10) but minmial support is provided for older versions of perl as
+well.
+
+If no perl is available on the system, there is also a fall-back
+"RUNTESTS" suite which merely executes the default scripts for testing
+compliance of the high-level applications.
+
+=head2 Important Notes About Writing New Tests
+
+When designing new tests it is strongly encouraged that some
+conventions are followed:
+
+ - Design the test files so they can be build/run without them
+ needing to be build/run within a testing harness like this one
+ (B<RUNFULLTESTS>). IE, you should be able to run them directly by
+ hand for debugging purposes without requiring them to be invoked
+ within this or any other testing harness.
+ - Name them beginning with TNNN where NNN is a 3 digit number
+
+The rational behind these rules follows in the sections below
+
+=head1 OPTIONS
+
+=over
+
+=item -g GROUP
+
+=item --group GROUP
+
+By default the "default" group of tests is run. Which is really just
+everything that B<RUNFULLTESTS> can find from the I<fulltests/default>
+sub-directory. The -g switch can be used to specify other
+sub-directories of tests to run. The argument is a comma-separated
+list of subdirectories to use.
+
+The special keyword I<all> can be used to run every test in every
+subdirectory of the I<fulltests> directory.
+
+=item -r REGEXP
+
+Only run test files that match the I<REGEXP> regular expression.
+
+To run only tests of a certain file name you might combine this with
+'-g all'. E.G., -g all -r snmpv3 will run all snmpv3 (named) tests
+that B<RUNFULLTESTS> can find.
+
+=item -f
+
+Only run the tests that failed from the last run.
+
+=item --failed-file FILE
+
+Where to store the state of which tests have failed.
+
+=item -F
+
+Don't save state to the failed-file.
+
+=item -D PATH
+
+=item --srcdir PATH
+
+If RUNFULLTESTS is being executed from a build directory other than
+where the source files are located, this flag can be used to specify
+where the Net-SNMP root source directory is found.
+
+=item -d PATH
+
+=item --builddir PATH
+
+Specifies the root of the build directory.
+
+=item --master-directory DIRNAME
+
+Specifies an alternate master directory. The default is "fulltests"
+
+=item -v
+
+=item --verbose
+
+Turns on verbose output mode.
+
+=item -q
+
+=item --quiet
+
+Turns on quiet output mode.
+
+=item --debug
+
+Turns on debugging output (which primarily shows how B<RUNFULLTESTS>
+is collecting tests to run, etc).
+
+=item -h
+
+=item --help
+
+Command line usage help output.
+
+=back
+
+=head1 TEST ARCHITECTURE
+
+=head2 TAP output
+
+TAP stands for "Test Anything Protocol". TAP was originally
+perl-specific but has been turning out to be a generic protocol for
+testing just about anything. It's heavily documented at:
+
+ http://testanything.org/wiki/index.php/Main_Page
+
+We're using TAP because it's highly flexible and separates the
+invidual tests from the "collect and report" aspect. RUNFULLTESTS is
+simply a perl-based implementation for collecting and summarizing the
+test results. Other collection agents could be used instead of this
+one, and any sort of test or language could be used for the individual
+tests as well (in fact the default suite has some that are SH-based,
+C-based, ...).
+
+It may be that eventually the TAP protocol actually makes it into the
+IETF (http://testanything.org/wiki/index.php/TAP_at_IETF:_Draft_Standard).
+
+The syntax of TAP is very simple. See the above web page for a
+complete description, but this will provide you a minimal "getting
+started" example and shows the output of 5 sub-tests run from a single
+test application.
+
+ 1..5
+ ok 1 - Yay
+ ok 2 - Second part succeeded
+ not ok 3 - Oh no... A problem occurred.
+ not ok 4 - The computer thought 2+2 was 5
+ ok 5 - All is well that ends well
+
+That's it. Output from a test tool like that is auto-summarized by
+this application in success/fail reports.
+
+=head2 Testing Phases
+
+The testing process goes through the following phases:
+
+ - Test and Infrastructure Collection
+ - Test Execution
+ - Build if needed
+ - Run
+
+=head2 Test Collection
+
+B<RUNFULLTESTS> will search all the requested groups for files that
+begin with the letter 'T'. They are executed in alphabetical order
+within their group. Convention is to number test files with a three
+digit (zero-padded) number after the 'T' letter to ensure ordering is
+as expected.
+
+Files to be collected by B<RUNFULLTESTS> are made up of a number of
+components to support a flexible build and execution system (discussed
+in detail in the following sections). They are structured as follows:
+
+ T<NNN><NAME>_<TYPE>.<SUFFIX>
+
+Where:
+
+ NNN: Is the 3 digit number mentioned above.
+ NAME: The filename of the test describing what it's about
+ TYPE: The internal "type" of the test, which is used later in building
+ and execution (see below).
+ .SUFFIX: An optional file-type suffix
+
+Examples:
+
+ fulltests/default/T001snmpv1get_simple
+ fulltests/snmpv3/T040keymanagetest_capp.c
+
+Any other files are ignored in terms of tests and may be supplimental
+to the above build systems. (Supporting files, by convention, begin
+with a capital 'S').
+
+=head3 Full Title
+
+Within the file there may be a line containing "HEADER ..." that will
+be examined for a better title of the test. Anything before "HEADER"
+will be ignored, and the special "*/" will be replaced as well. For
+example, these are valid header source lines:
+
+ # HEADER A cool test
+ /* HEADER A cool test from my C-based source file */
+
+=head2 Infrastructure Collection
+
+In addition to test files, I<infrastructure> files are searched for
+and remembered for later use (again, see below). These files will be
+of the form:
+
+ <TYPE>_<USEAGE>
+
+Where:
+
+ TYPE: The type name matching the file to support.
+
+ USAGE: How this file should be used. Currently should be either
+ I<build> or I<run> as described below.
+
+Example files
+
+ fulltests/support/clib_build
+ fulltests/support/simple_run
+
+Infrastructure files may exist in the source directory of where they're
+expected to be run (ie, parallel to the test files) or they may exist
+in the special "support" directory if they're expected to be
+generically used across multilpe test group types.
+
+=head2 Test Execution
+
+Tests are run in two phases using the following pseudo-algorithm:
+
+ + for each test file
+ + if an appropriate TYPE_build file exists for a test {
+ + run "TYPE_build TESTFILE"
+ + record the last line as the new TESTFILE to run
+ }
+
+ + if an apporpriate TYPE_run file exists for a test {
+ + run "TYPE_run TESTFILE"
+ + collect it's output as the TAP output
+ } else {
+ + run "TESTFILE"
+ + collect it's output as the TAP output
+ }
+
+For example, if the following files existed:
+
+ fulltests/examplres/T001testing_examp
+ fulltests/examplres/examp_build
+ fulltests/examplres/examp_run
+
+Then the following would be the rough execution:
+
+ newfile = `fulltests/examplres/examp_build \
+ fulltests/examplres/T001testing_examp | tail -1`
+ fulltests/examplres/examp_run $newfile
+
+=head1 TEST TYPES
+
+Net-SNMP testing comes with a number of test suite "builders" and
+"runners" that are useful for developing new tests. These are
+documented here:
+
+=over
+
+=item simple
+
+I<simple> test files are simple sh-shell-script files used to test
+high-level functionality of Net-SNMP tools. They're easy to write and
+should generally contain the following sort of structure:
+
+ . ../support/simple_eval_tools.sh
+ HEADER my name
+ STARTAGENT
+ CAPTURE "snmpget..."
+ CHECK "for this string"
+ STOPAGENT
+ FINISHED
+
+Example file: fulltests/default/T001snmpv1get_simple
+
+=item capp
+
+I<capp> files are fundamentally full C-source-code applications that
+are built and linked against the libnetsnmp library. Thus, a file
+named I<T001mytest_capp.c> is compiled using the same compiler used to
+compile Net-SNMP and linked against the required libraries for a basic
+Net-SNMP application. It should, of course, produce TAP output after
+it's compiled and run.
+
+Example file: fulltests/snmpv3/T010scapitest_capp.c
+
+=item clib
+
+I<clib> files are simple C-source-code files that are wrapped into a
+main() application with appropriate #include files, etc. I<clib>
+files are designed primarly to write quick unit-tests for the Net-SNMP
+core library.
+
+Example file: fulltests/unit-tests/T001defaultstore_clib.c
+
+=item Write your own!
+
+This test system is designed to be flexible and expandable if the
+basic architecture is followed. The goal is to make it easy to create
+very simple test suites or complex unit-tests or anything in between.
+
+=back
+
+=head1 DEBUGGING BROKEN TESTS
+
+If the individual tests are designed well, you should be able to
+re-run individual tests outside of the B<RUNFULLTESTS> aggregation
+environment using the appropriate _build and _run scripts as needed.
+Test writers are encouraged to output comments in their TAP output to
+help users debug the results.
+
+=head1 Author
+
+Original architecture: Wes Hardaker <hardaker@users.sourceforge.net>
+
+=cut
+
diff --git a/testing/RUNTESTS b/testing/RUNTESTS
new file mode 100755
index 0000000..e11c969
--- /dev/null
+++ b/testing/RUNTESTS
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+srcdir=`dirname $0`
+srcdir=`cd $srcdir; pwd`
+srcdir=`dirname $srcdir`
+
+# set up MIBDIRS to refer to the src directory
+if [ "x$MIBDIRS" = "x" ]; then
+ MIBDIRS=${srcdir}/mibs
+ export MIBDIRS
+fi
+
+# Make sure MinGW / MSYS users have the pskill.exe program to stop the agent and
+# snmptrapd
+if [ "x$OSTYPE" = "xmsys" -a "x`type pskill.exe 2>/dev/null`" = "x" ]; then
+ echo "Could not find pskill.exe. Aborting tests."
+ echo "pskill.exe can be installed as follows:"
+ echo "- Download pskill.exe from http://technet.microsoft.com/en-us/sysinternals/default.aspx."
+ echo "- Copy pskill.exe to C:\\MinGW\\msys\\1.0\\bin."
+ exit 1
+fi
+
+success_count=0
+failed_count=0
+rm -f failed_tests
+for i in "${srcdir}"/testing/fulltests/default/T*$1*; do
+ echo "RUNNING $i"
+ ${srcdir}/testing/fulltests/support/simple_run $i
+ if [ $? = 0 ]; then
+ success_count=`expr $success_count + 1`
+ else
+ failed_count=`expr $failed_count + 1`
+ echo "$i" >> failed_tests
+ fi
+done
+
+if [ -f failed_tests ]; then
+ echo
+ echo Failed tests:
+ cat failed_tests
+fi
+echo
+echo Summary: $success_count / `expr $failed_count + $success_count` succeeded.
+
+exit $failed_count
diff --git a/testing/fulltests/default/Sv1config b/testing/fulltests/default/Sv1config
new file mode 100644
index 0000000..f3c045b
--- /dev/null
+++ b/testing/fulltests/default/Sv1config
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+snmp_version=v1
+. ./Svanyconfig
diff --git a/testing/fulltests/default/Sv2cconfig b/testing/fulltests/default/Sv2cconfig
new file mode 100644
index 0000000..375e087
--- /dev/null
+++ b/testing/fulltests/default/Sv2cconfig
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+snmp_version=v2c
+. ./Svanyconfig
diff --git a/testing/fulltests/default/Sv3config b/testing/fulltests/default/Sv3config
new file mode 100644
index 0000000..55df5b4
--- /dev/null
+++ b/testing/fulltests/default/Sv3config
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+[ "x$SNMP_SMUX_SOCKET" = "x" ] && SNMP_SMUX_SOCKET=1.0.0.0
+
+CONFIGAGENT [snmp] persistentdir $SNMP_TMP_PERSISTENTDIR
+CONFIGAGENT smuxsocket $SNMP_SMUX_SOCKET
+
+# XXX: auto-switch to a supported protocol instead.
+if test "x$DEFAUTHTYPE" = "x"; then
+ if grep '^#define NETSNMP_USE_OPENSSL 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null ; then
+ DEFAUTHTYPE="SHA"
+ else
+ DEFAUTHTYPE="MD5"
+ fi
+fi
+
+if test "x$DEFPRIVTYPE" = "x"; then
+ # XXX: HAVE_AES depends on cpp logic, so we need to test for lower-level stuff
+ if grep '^#define NETSNMP_USE_OPENSSL 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null ; then
+ if grep '^#define HAVE_OPENSSL_AES_H 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null ; then
+ if grep '^#define HAVE_AES_CFB128_ENCRYPT 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null ; then
+ DEFPRIVTYPE="AES"
+ else
+ DEFPRIVTYPE="DES"
+ fi
+ else
+ DEFPRIVTYPE="DES"
+ fi
+ else
+ DEFPRIVTYPE=""
+ fi
+fi
+
+CONFIGAGENT createUser initial $DEFAUTHTYPE initial_test_pass_auth $DEFPRIVTYPE
+CONFIGAGENT createUser template $DEFAUTHTYPE template_test_pass_auth $DEFPRIVTYPE
+CONFIGAGENT rwuser initial noauth
+CONFIGAGENT rwuser newtestuser
+
+NOAUTHTESTARGS="-l nanp -u initial -v 3"
+AUTHTESTARGS="-l anp -u initial -v 3 -a $DEFAUTHTYPE -A initial_test_pass_auth"
+PRIVTESTARGS="-l ap -u initial -v 3 -a $DEFAUTHTYPE -A initial_test_pass_auth -x $DEFPRIVTYPE -X initial_test_pass_auth"
+
+AUTHNOPASSTESTARGS="-l anp -u initial -v 3 -a $DEFAUTHTYPE"
+PRIVNOPASSTESTARGS="-l ap -u initial -v 3 -a $DEFAUTHTYPE -x $DEFPRIVTYPE"
diff --git a/testing/fulltests/default/Sv3usmconfigagent b/testing/fulltests/default/Sv3usmconfigagent
new file mode 100644
index 0000000..72aaffa
--- /dev/null
+++ b/testing/fulltests/default/Sv3usmconfigagent
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# SNMPv3 USM config for snmpd
+#
+
+## common SNMPv3 USM config
+. ./Sv3usmconfigbase
+
+## standard config
+CONFIGAGENT [snmp] persistentdir $SNMP_TMP_PERSISTENTDIR
+[ "x$SNMP_SMUX_SOCKET" = "x" ] && SNMP_SMUX_SOCKET=1.0.0.0
+CONFIGAGENT smuxsocket $SNMP_SMUX_SOCKET
+[ "x$CREATEAUTHUSER" != "x" ] && CONFIGAGENT $CREATEAUTHUSER
+[ "x$CREATEAUTHUSER2" != "x" ] && CONFIGAGENT $CREATEAUTHUSER2
+[ "x$CREATEPRIVUSER" != "x" ] && CONFIGAGENT $CREATEPRIVUSER
+[ "x$CREATEPRIVUSER2" != "x" ] && CONFIGAGENT $CREATEPRIVUSER2
+CONFIGAGENT rwuser $TESTAUTHUSER auth
+CONFIGAGENT rwuser $TESTPRIVUSER priv
+
+CONFIGAGENT_ENGINEID() {
+ AGENT_ENGINEID=0x80001f88801ff4905ea7804943
+ CONFIGAGENT oldEngineID $AGENT_ENGINEID
+}
diff --git a/testing/fulltests/default/Sv3usmconfigbase b/testing/fulltests/default/Sv3usmconfigbase
new file mode 100644
index 0000000..d2fb981
--- /dev/null
+++ b/testing/fulltests/default/Sv3usmconfigbase
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# SNMPv3 base config
+#
+# Input+Output variables:
+# DEFSECURITYLEVEL noAuthNoPriv|authNoPriv|authPriv
+# DEFAUTHTYPE MD5|SHA
+# DEFPRIVTYPE DES|AES
+# TESTNOAUTHUSER <myuser>
+# TEST(AUTH|PRIV)USER[2] <myuser>
+# TEST(AUTH|PRIV)PASS[2] <mypass>
+#
+# Input variables:
+# CREATEUSERENGINEID <engineid>
+#
+# Output variables:
+# CREATEAUTHUSER[2]
+# CREATEPRIVUSER[2]
+# CREATENOAUTHUSER
+# TESTNOAUTHARGS
+# TESTAUTHARGS[NOPASS][2]
+# TESTPRIVARGS[NOPASS][2]
+#
+
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+## Defaults
+[ "x$DEFSECURITYLEVEL" = "x" ] && DEFSECURITYLEVEL=authPriv
+
+## auto-probe best auth type
+if grep '^#define NETSNMP_USE_OPENSSL 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null ; then
+ MAXAUTHTYPE=SHA
+elif grep '^#define NETSNMP_USE_INTERNAL_CRYPTO 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null ; then
+ MAXAUTHTYPE=SHA
+else
+ # MD5 is always available internally
+ MAXAUTHTYPE=MD5
+fi
+
+## auto-probe best priv type
+# XXX: HAVE_AES depends on cpp logic, so we need to test for lower-level stuff
+if grep '^#define NETSNMP_USE_OPENSSL 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null; then
+ if grep '^#define HAVE_OPENSSL_AES_H 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null && \
+ grep '^#define HAVE_AES_CFB128_ENCRYPT 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null ; then
+ MAXPRIVTYPE=AES
+ else
+ MAXPRIVTYPE=DES
+ fi
+elif grep '^#define NETSNMP_USE_INTERNAL_CRYPTO 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null; then
+ MAXPRIVTYPE=AES
+else
+ MAXPRIVTYPE=""
+fi
+
+CREATEUSERCMD="createUser"
+[ "x$CREATEUSERENGINEID" != "x" ] && CREATEUSERCMD="$CREATEUSERCMD -e $CREATEUSERENGINEID"
+
+## auth setup
+if [ "x$DEFSECURITYLEVEL" = "xauthPriv" -o "x$DEFSECURITYLEVEL" = "xauthNoPriv" ]; then
+ [ "x$MAXAUTHTYPE" = "x" ] && SKIP
+ [ "x$DEFAUTHTYPE" = "xSHA" -a "x$MAXAUTHTYPE" != "xSHA" ] && SKIP
+ [ "x$DEFAUTHTYPE" = "x" ] && DEFAUTHTYPE=$MAXAUTHTYPE
+ # user/pass setup (XXX: randomize)
+ [ "x$TESTAUTHUSER" = "x" ] && TESTAUTHUSER=initial_auth
+ [ "x$TESTAUTHUSER2" = "x" ] && TESTAUTHUSER2=template_auth
+ [ "x$TESTAUTHPASS" = "x" ] && TESTAUTHPASS=initial_test_pass_auth
+ [ "x$TESTAUTHPASS2" = "x" ] && TESTAUTHPASS2=template_test_pass_auth
+ CREATEAUTHUSER="$CREATEUSERCMD $TESTAUTHUSER $DEFAUTHTYPE $TESTAUTHPASS"
+ CREATEAUTHUSER2="$CREATEUSERCMD $TESTAUTHUSER2 $DEFAUTHTYPE $TESTAUTHPASS2"
+ # command args
+ TESTAUTHARGSNOPASS="-v 3 -l anp -u $TESTAUTHUSER -a $DEFAUTHTYPE"
+ TESTAUTHARGSNOPASS2="-v 3 -l anp -u $TESTAUTHUSER2 -a $DEFAUTHTYPE"
+ TESTAUTHARGS="$TESTAUTHARGSNOPASS -A $TESTAUTHPASS"
+ TESTAUTHARGS2="$TESTAUTHARGSNOPASS2 -A $TESTAUTHPASS2"
+fi
+
+## priv setup
+if [ "x$DEFSECURITYLEVEL" = "xauthPriv" ]; then
+ [ "x$MAXPRIVTYPE" = "x" ] && SKIP
+ [ "x$DEFPRIVTYPE" = "xAES" -a "x$MAXPRIVTYPE" != "xAES" ] && SKIP
+ [ "x$DEFPRIVTYPE" = "x" ] && DEFPRIVTYPE=$MAXPRIVTYPE
+ # user/pass setup (XXX: randomize)
+ [ "x$TESTPRIVUSER" = "x" ] && TESTPRIVUSER=initial_priv
+ [ "x$TESTPRIVUSER2" = "x" ] && TESTPRIVUSER2=template_priv
+ [ "x$TESTPRIVPASS" = "x" ] && TESTPRIVPASS=initial_test_pass_priv
+ [ "x$TESTPRIVPASS2" = "x" ] && TESTPRIVPASS2=template_test_pass_priv
+ CREATEPRIVUSER="$CREATEUSERCMD $TESTPRIVUSER $DEFAUTHTYPE $TESTAUTHPASS $DEFPRIVTYPE $TESTPRIVPASS"
+ CREATEPRIVUSER2="$CREATEUSERCMD $TESTPRIVUSER2 $DEFAUTHTYPE $TESTAUTHPASS2 $DEFPRIVTYPE $TESTPRIVPASS2"
+ # command args
+ TESTPRIVARGSNOPASS="-v 3 -l ap -u $TESTPRIVUSER -a $DEFAUTHTYPE -x $DEFPRIVTYPE"
+ TESTPRIVARGSNOPASS2="-v 3 -l ap -u $TESTPRIVUSER2 -a $DEFAUTHTYPE -x $DEFPRIVTYPE"
+ TESTPRIVARGS="$TESTPRIVARGSNOPASS -A $TESTAUTHPASS -X $TESTPRIVPASS"
+ TESTPRIVARGS2="$TESTPRIVARGSNOPASS2 -A $TESTAUTHPASS2 -X $TESTPRIVPASS2"
+fi
+
+## noauth setup
+[ "x$TESTNOAUTHUSER" = "x" ] && TESTNOAUTHUSER=initial
+TESTNOAUTHARGS="-v 3 -l nanp -u $TESTNOAUTHUSER"
+CREATENOAUTHUSER="$CREATEUSERCMD $TESTNOAUTHUSER"
+
diff --git a/testing/fulltests/default/Sv3usmconfigtrapd b/testing/fulltests/default/Sv3usmconfigtrapd
new file mode 100644
index 0000000..4938959
--- /dev/null
+++ b/testing/fulltests/default/Sv3usmconfigtrapd
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# SNMPv3 USM config for snmptrapd
+#
+
+TRAPD_ENGINEID=0x80001f88802b3d0e06bbdf4e43
+
+## common SNMPv3 USM config
+. ./Sv3usmconfigbase
+
+## standard config
+CONFIGTRAPD [snmp] persistentDir $SNMP_TMP_PERSISTENTDIR
+CONFIGTRAPD oldEngineID $TRAPD_ENGINEID
+[ "x$CREATENOAUTHUSER" != "x" ] && CONFIGTRAPD $CREATENOAUTHUSER
+[ "x$CREATEAUTHUSER" != "x" ] && CONFIGTRAPD $CREATEAUTHUSER
+[ "x$CREATEAUTHUSER2" != "x" ] && CONFIGTRAPD $CREATEAUTHUSER2
+[ "x$CREATEPRIVUSER" != "x" ] && CONFIGTRAPD $CREATEPRIVUSER
+[ "x$CREATEPRIVUSER2" != "x" ] && CONFIGTRAPD $CREATEPRIVUSER2
+
diff --git a/testing/fulltests/default/Sv3vacmconfig b/testing/fulltests/default/Sv3vacmconfig
new file mode 100644
index 0000000..7c35e36
--- /dev/null
+++ b/testing/fulltests/default/Sv3vacmconfig
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# generically set up the user "initial1" and "initial2" for snmp v3
+# access to the agent.
+
+# Configuration:
+#initial1 can access .1.3.6.1.2.1.1.1, deny others
+#initial2 can access all except .1.3.6.1.2.1.1.1
+
+# XXX: do autoselection of supported algorithms
+SKIPIF NETSNMP_DISABLE_MD5
+SKIPIF NETSNMP_DISABLE_DES
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+CONFIGAGENT [snmp] persistentdir $SNMP_TMP_PERSISTENTDIR
+
+CONFIGAGENT createUser initial1 MD5 initial_test_pass_auth DES
+CONFIGAGENT createUser initial2 MD5 initial_test_pass_auth DES
+
+
+CONFIGAGENT group testcommunitygroup1 usm initial1
+CONFIGAGENT group testcommunitygroup2 usm initial2
+
+CONFIGAGENT view system1 included .1.3.6.1.2.1.1.1
+CONFIGAGENT view system2 included .1
+CONFIGAGENT view system2 excluded .1.3.6.1.2.1.1.1
+CONFIGAGENT 'access testcommunitygroup1 "" any auth exact system1 none none'
+CONFIGAGENT 'access testcommunitygroup2 "" any auth exact system2 none none'
+
diff --git a/testing/fulltests/default/Svacmconfig b/testing/fulltests/default/Svacmconfig
new file mode 100644
index 0000000..d9d862d
--- /dev/null
+++ b/testing/fulltests/default/Svacmconfig
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# standard V1 configuration: testcommunity1 testcommunity2
+# testcommunity1 can access .1.3.6.1.2.1.1.1, others are denied
+# generically set up the community "testcommunity1 and testcommunity2" for various snmp
+# version access to the agent.
+
+if [ "x$snmp_version" = "x" ]; then
+ snmp_version="any"
+fi
+
+CONFIGAGENT [snmp] persistentdir $SNMP_TMP_PERSISTENTDIR
+
+CONFIGAGENT rocommunity testrocommunity 127.0.0.1 .1.3.6.1.2.1.1.5.0
+CONFIGAGENT rwcommunity testrwcommunity 127.0.0.1 .1.3.6.1.2.1.1.5.0
+
+CONFIGAGENT com2sec testcommunitysec1 default testcommunity1
+CONFIGAGENT com2sec testcommunitysec2 default testcommunity2
+
+if [ "$SNMP_TRANSPORT_SPEC" = "udp6" -o "$SNMP_TRANSPORT_SPEC" = "tcp6" ];then
+CONFIGAGENT rocommunity6 testrocommunity ::1 .1.3.6.1.2.1.1.5.0
+CONFIGAGENT rwcommunity6 testrwcommunity ::1 .1.3.6.1.2.1.1.5.0
+CONFIGAGENT com2sec6 testcommunitysec1 default testcommunity1
+CONFIGAGENT com2sec6 testcommunitysec2 default testcommunity2
+fi
+
+if [ "$SNMP_TRANSPORT_SPEC" = "unix" ];then
+CONFIGAGENT com2secunix testcommunitysec1 testcommunity1
+CONFIGAGENT com2secunix testcommunitysec2 testcommunity2
+fi
+
+CONFIGAGENT group testcommunitygroup1 $snmp_version testcommunitysec1
+CONFIGAGENT group testcommunitygroup2 $snmp_version testcommunitysec2
+
+CONFIGAGENT view system1 included .1.3.6.1.2.1.1.1
+CONFIGAGENT view system2 included .1
+CONFIGAGENT view system2 excluded .1.3.6.1.2.1.1.1
+CONFIGAGENT 'access testcommunitygroup1 "" any noauth exact system1 none none'
+CONFIGAGENT 'access testcommunitygroup2 "" any noauth exact system2 none none'
+
diff --git a/testing/fulltests/default/Svanyconfig b/testing/fulltests/default/Svanyconfig
new file mode 100644
index 0000000..8cb53dc
--- /dev/null
+++ b/testing/fulltests/default/Svanyconfig
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# generically set up the community "testcommunity" for various snmp
+# version access to the agent.
+
+if [ "x$snmp_version" = "x" ]; then
+ snmp_version="any"
+fi
+if [ "x$snmp_write_access" = "x" ]; then
+ snmp_write_access="none"
+fi
+
+[ "x$SNMP_SMUX_SOCKET" = "x" ] && SNMP_SMUX_SOCKET=1.0.0.0
+
+CONFIGAGENT [snmp] persistentdir $SNMP_TMP_PERSISTENTDIR
+CONFIGAGENT smuxsocket $SNMP_SMUX_SOCKET
+
+CONFIGAGENT com2sec testcommunitysec default testcommunity
+if [ "$SNMP_TRANSPORT_SPEC" = "udp6" -o "$SNMP_TRANSPORT_SPEC" = "tcp6" ];then
+ CONFIGAGENT com2sec6 testcommunitysec default testcommunity
+fi
+
+if [ "$SNMP_TRANSPORT_SPEC" = "unix" ];then
+ CONFIGAGENT com2secunix testcommunitysec testcommunity
+fi
+
+CONFIGAGENT group testcommunitygroup $snmp_version testcommunitysec
+CONFIGAGENT view all included .1 80
+CONFIGAGENT "access testcommunitygroup '' any noauth exact all $snmp_write_access none"
diff --git a/testing/fulltests/default/T000configure_simple b/testing/fulltests/default/T000configure_simple
new file mode 100644
index 0000000..2e2b4ef
--- /dev/null
+++ b/testing/fulltests/default/T000configure_simple
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if test -f ../support/simple_eval_tools.sh ; then
+ . ../support/simple_eval_tools.sh
+ versionfile=$SNMP_BASEDIR/../../../dist/autoconf-version
+ configurefile=$SNMP_BASEDIR/../../../configure
+else
+ . ../eval_tools.sh
+ versionfile=$SNMP_BASEDIR/../dist/autoconf-version
+ configurefile=$SNMP_BASEDIR/../configure
+fi
+
+HEADER Checking the Net-SNMP configure script validity
+
+VERSIONNEEDED=`cat $versionfile`
+
+CHECKORDIE "^# Generated by GNU Autoconf $VERSIONNEEDED for Net-SNMP " \
+ "$configurefile"
+SAVE_RESULTS
+
+echo "bogus" > $SNMP_TMPDIR/foo.pid
+FINISHED
diff --git a/testing/fulltests/default/T001snmpv1get_simple b/testing/fulltests/default/T001snmpv1get_simple
new file mode 100644
index 0000000..07d3847
--- /dev/null
+++ b/testing/fulltests/default/T001snmpv1get_simple
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv1 support
+
+SKIPIF NETSNMP_DISABLE_SNMPV1
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcomunnity
+. ./Sv1config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+CAPTURE "snmpgetnext -On $SNMP_FLAGS -c testcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3"
+
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.1"
+
+CHECKORDIE "Error in packet"
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c notavalidcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+CHECKORDIE "Timeout"
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T0141snmpv2cset_simple b/testing/fulltests/default/T0141snmpv2cset_simple
new file mode 100644
index 0000000..18d9bae
--- /dev/null
+++ b/testing/fulltests/default/T0141snmpv2cset_simple
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2c set of system.sysContact.0
+
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V2C configuration: testcomunnity
+snmp_write_access='all'
+. ./Sv2cconfig
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+CHECK ".1.3.6.1.2.1.1.4.0 = STRING:"
+
+CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 s foobartestingbaz"
+
+CHECK ".1.3.6.1.2.1.1.4.0 = STRING:"
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+CHECK "STRING: foobartestingbaz"
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T014snmpv2cget_simple b/testing/fulltests/default/T014snmpv2cget_simple
new file mode 100644
index 0000000..43dffd5
--- /dev/null
+++ b/testing/fulltests/default/T014snmpv2cget_simple
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2c get of system.sysUpTime.0
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V2C configuration: testcomunnity
+. ./Sv2cconfig
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T015snmpv2cgetnext_simple b/testing/fulltests/default/T015snmpv2cgetnext_simple
new file mode 100644
index 0000000..7c6eaa9
--- /dev/null
+++ b/testing/fulltests/default/T015snmpv2cgetnext_simple
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2c getnext of system.sysUpTime
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V2C configuration: testcomunnity
+. ./Sv2cconfig
+
+STARTAGENT
+
+CAPTURE "snmpgetnext -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T0160snmpv2cbulkget_simple b/testing/fulltests/default/T0160snmpv2cbulkget_simple
new file mode 100755
index 0000000..38ec3b3
--- /dev/null
+++ b/testing/fulltests/default/T0160snmpv2cbulkget_simple
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2c bulkget of system components
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V2 configuration: testcomunnity
+. ./Sv2cconfig
+
+STARTAGENT
+
+CAPTURE "snmpbulkget $SNMP_FLAGS -v2c -On -Cn1 -Cr2 -c testcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4 .1.3.6.1.2.1.1"
+
+STOPAGENT
+
+CHECKORDIE ".1.3.6.1.2.1.1.4.0 = STRING:"
+CHECKORDIE ".1.3.6.1.2.1.1.1.0 = STRING:"
+CHECKORDIE ".1.3.6.1.2.1.1.2.0 = OID:"
+
+CHECKCOUNT 0 ".1.3.6.1.2.1.1.3.0"
+
+CHECKCOUNT 0 ".1.3.6.1.2.1.1.5.0"
+
+FINISHED
diff --git a/testing/fulltests/default/T016snmpv2cgetfail_simple b/testing/fulltests/default/T016snmpv2cgetfail_simple
new file mode 100644
index 0000000..1cd0e94
--- /dev/null
+++ b/testing/fulltests/default/T016snmpv2cgetfail_simple
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#
+# test snmpv2c get support by reading a variable
+#
+
+. ../support/simple_eval_tools.sh
+
+HEADER for failure of SNMPv2c get with wrong community
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+SKIPIFNOT USING_MIBII_VACM_CONF_MODULE
+
+#
+# Begin test
+#
+
+# standard V2C configuration: testcomunnity
+. ./Sv2cconfig
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c notavalidcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK "Timeout"
+
+FINISHED
diff --git a/testing/fulltests/default/T017snmpv2ctov1getfail_simple b/testing/fulltests/default/T017snmpv2ctov1getfail_simple
new file mode 100644
index 0000000..4c812c0
--- /dev/null
+++ b/testing/fulltests/default/T017snmpv2ctov1getfail_simple
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#
+# test snmpv2c get support by reading a variable
+#
+
+. ../support/simple_eval_tools.sh
+
+HEADER for failure of SNMPv2c get against SNMPv1 agent
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIF NETSNMP_DISABLE_SNMPV1
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V2C configuration: testcomunnity
+. ./Sv1config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c notavalidcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK "Timeout"
+
+FINISHED
diff --git a/testing/fulltests/default/T018snmpv1tov2cgetfail_simple b/testing/fulltests/default/T018snmpv1tov2cgetfail_simple
new file mode 100644
index 0000000..d9b8b6a
--- /dev/null
+++ b/testing/fulltests/default/T018snmpv1tov2cgetfail_simple
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER for failure of SNMPv1 get against SNMPv2c agent
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIF NETSNMP_DISABLE_SNMPV1
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V2C configuration: testcomunnity
+. ./Sv2cconfig
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c notavalidcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK "Timeout"
+
+FINISHED
diff --git a/testing/fulltests/default/T019snmpv2cnosuch_simple b/testing/fulltests/default/T019snmpv2cnosuch_simple
new file mode 100644
index 0000000..78a0bb1
--- /dev/null
+++ b/testing/fulltests/default/T019snmpv2cnosuch_simple
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2c get of system.sysUpTime.1
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V2C configuration: testcomunnity
+. ./Sv2cconfig
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.1"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.1 = No Such Instance"
+
+FINISHED
diff --git a/testing/fulltests/default/T020snmpv3get_simple b/testing/fulltests/default/T020snmpv3get_simple
new file mode 100644
index 0000000..20b59e4
--- /dev/null
+++ b/testing/fulltests/default/T020snmpv3get_simple
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 get using noAuthNoPriv of .1.3.6.1.2.1.1.3.0
+
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# configure the agent to accept user initial with noAuthNoPriv
+. ./Sv3config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS $NOAUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T021snmpv3getnext_simple b/testing/fulltests/default/T021snmpv3getnext_simple
new file mode 100755
index 0000000..54c82d3
--- /dev/null
+++ b/testing/fulltests/default/T021snmpv3getnext_simple
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 getnext using initial of .1.3.6.1.2.1.1.3
+
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# configure the agent to accept user initial with noAuthNoPriv
+. ./Sv3config
+
+STARTAGENT
+
+CAPTURE "snmpgetnext -On $SNMP_FLAGS $NOAUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T0220snmpv3bulkget_simple b/testing/fulltests/default/T0220snmpv3bulkget_simple
new file mode 100755
index 0000000..7eddccf
--- /dev/null
+++ b/testing/fulltests/default/T0220snmpv3bulkget_simple
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 bulkget of system
+
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V3 configuration:
+. ./Sv3config
+
+STARTAGENT
+
+CAPTURE "snmpbulkget $SNMP_FLAGS -On -Cn1 -Cr2 $NOAUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4 .1.3.6.1.2.1.1"
+
+STOPAGENT
+
+CHECKORDIE ".1.3.6.1.2.1.1.4.0 = STRING:"
+CHECKORDIE ".1.3.6.1.2.1.1.1.0 = STRING:"
+CHECKORDIE ".1.3.6.1.2.1.1.2.0 = OID:"
+
+CHECKCOUNT 0 ".1.3.6.1.2.1.1.3.0"
+
+CHECKCOUNT 0 ".1.3.6.1.2.1.1.5.0"
+
+FINISHED
diff --git a/testing/fulltests/default/T022snmpv3getMD5_simple b/testing/fulltests/default/T022snmpv3getMD5_simple
new file mode 100755
index 0000000..eed4292
--- /dev/null
+++ b/testing/fulltests/default/T022snmpv3getMD5_simple
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 get using MD5/noPriv of .1.3.6.1.2.1.1.3.0
+
+SKIPIF NETSNMP_DISABLE_MD5
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+DEFAUTHTYPE="MD5"
+. ./Sv3config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T023snmpv3getMD5AES_simple b/testing/fulltests/default/T023snmpv3getMD5AES_simple
new file mode 100644
index 0000000..985b2a4
--- /dev/null
+++ b/testing/fulltests/default/T023snmpv3getMD5AES_simple
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 get using MD5/AES of .1.3.6.1.2.1.1.3.0
+
+SKIPIFNOT NETSNMP_CAN_DO_CRYPTO
+SKIPIFNOT NETSNMP_ENABLE_SCAPI_AUTHPRIV
+SKIPIFNOT HAVE_AES_CFB128_ENCRYPT
+SKIPIF NETSNMP_DISABLE_MD5
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+DEFAUTHTYPE=MD5
+DEFPRIVTYPE=AES
+. ./Sv3config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS $PRIVTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T023snmpv3getMD5DES_simple b/testing/fulltests/default/T023snmpv3getMD5DES_simple
new file mode 100755
index 0000000..000478a
--- /dev/null
+++ b/testing/fulltests/default/T023snmpv3getMD5DES_simple
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 get using MD5/DES of .1.3.6.1.2.1.1.3.0
+
+SKIPIFNOT NETSNMP_CAN_DO_CRYPTO
+SKIPIFNOT NETSNMP_ENABLE_SCAPI_AUTHPRIV
+SKIPIF NETSNMP_DISABLE_MD5
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+DEFAUTHTYPE=MD5
+DEFPRIVTYPE=DES
+. ./Sv3config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS $PRIVTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T024snmpv3getSHA1_simple b/testing/fulltests/default/T024snmpv3getSHA1_simple
new file mode 100755
index 0000000..80b7f4f
--- /dev/null
+++ b/testing/fulltests/default/T024snmpv3getSHA1_simple
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 get using SHA/noPriv of .1.3.6.1.2.1.1.3.0
+
+SKIPIFNOT NETSNMP_CAN_DO_CRYPTO
+
+#
+# Begin test
+#
+
+# standard V3 configuration for templateSHA user
+DEFAUTHTYPE="SHA"
+. ./Sv3config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T025snmpv3getSHADES_simple b/testing/fulltests/default/T025snmpv3getSHADES_simple
new file mode 100755
index 0000000..d01a4ef
--- /dev/null
+++ b/testing/fulltests/default/T025snmpv3getSHADES_simple
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 get using SHA/DES of .1.3.6.1.2.1.1.3.0
+
+SKIPIFNOT NETSNMP_CAN_DO_CRYPTO
+SKIPIFNOT NETSNMP_ENABLE_SCAPI_AUTHPRIV
+SKIPIF NETSNMP_DISABLE_DES
+
+#
+# Begin test
+#
+
+# standard V3 configuration for templateSHA user
+DEFAUTHTYPE="SHA"
+DEFPRIVTYPE="DES"
+. ./Sv3config
+
+AGENT_FLAGS="$AGENT_FLAGS -I-winExtDLL"
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS $PRIVTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T026snmpv3getSHAAES_simple b/testing/fulltests/default/T026snmpv3getSHAAES_simple
new file mode 100644
index 0000000..561cdab
--- /dev/null
+++ b/testing/fulltests/default/T026snmpv3getSHAAES_simple
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 get using SHA/AES of .1.3.6.1.2.1.1.3.0
+
+SKIPIFNOT NETSNMP_CAN_DO_CRYPTO
+SKIPIFNOT NETSNMP_ENABLE_SCAPI_AUTHPRIV
+SKIPIFNOT HAVE_AES_CFB128_ENCRYPT
+
+#
+# Begin test
+#
+
+# standard V3 configuration for templateSHA user
+DEFPRIVTYPE="AES"
+DEFAUTHTYPE="SHA"
+. ./Sv3config
+
+AGENT_FLAGS="$AGENT_FLAGS -I-winExtDLL"
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS $PRIVTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T027snmpv3Defaults_simple b/testing/fulltests/default/T027snmpv3Defaults_simple
new file mode 100644
index 0000000..ea42f47
--- /dev/null
+++ b/testing/fulltests/default/T027snmpv3Defaults_simple
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 get using default config of .1.3.6.1.2.1.1.3.0
+
+SKIPIFNOT NETSNMP_CAN_DO_CRYPTO
+SKIPIFNOT NETSNMP_ENABLE_SCAPI_AUTHPRIV
+SKIPIFNOT HAVE_AES_CFB128_ENCRYPT
+
+#
+# Begin test
+#
+
+# standard V3 configuration for templateSHA user
+DEFPRIVTYPE="AES"
+DEFAUTHTYPE="SHA"
+. ./Sv3config
+
+STARTAGENT
+
+CONFIGAPP defPrivType AES
+CONFIGAPP defAuthType SHA
+CONFIGAPP defContext \"\"
+CONFIGAPP defAuthPassPhrase initial_test_pass_auth
+CONFIGAPP defPrivPassPhrase initial_test_pass_auth
+CONFIGAPP defSecurityLevel authPriv
+CONFIGAPP defSecurityName initial
+
+# make sure that the above configuration tokens properly set things up so that
+# no flags are needed
+CAPTURE "snmpget -On $SNMP_FLAGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/default/T028snmpv3getfail_simple b/testing/fulltests/default/T028snmpv3getfail_simple
new file mode 100755
index 0000000..ada8a13
--- /dev/null
+++ b/testing/fulltests/default/T028snmpv3getfail_simple
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER for failure of SNMPv3 get using unknown user.
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+. ./Sv3config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -l nanp -u unknownuser $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK "Unknown user name"
+
+FINISHED
diff --git a/testing/fulltests/default/T030snmpv3usercreation_simple b/testing/fulltests/default/T030snmpv3usercreation_simple
new file mode 100644
index 0000000..28eaae8
--- /dev/null
+++ b/testing/fulltests/default/T030snmpv3usercreation_simple
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 agent USM user management with snmpusm
+
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
+SKIPIFNOT USING_SNMPV3_USMUSER_MODULE
+SKIPIFNOT NETSNMP_CAN_DO_CRYPTO
+SKIPIFNOT NETSNMP_ENABLE_SCAPI_AUTHPRIV
+
+#
+# Begin test
+#
+
+# standard SNMPv3 USM agent configuration
+DEFSECURITYLEVEL=authPriv
+. ./Sv3usmconfigagent
+
+# test user
+NEWUSER=newtestuser
+NEWAUTHPASS=newauthpass
+NEWPRIVPASS=newprivpass
+NEWAUTHPRIVPASS=newauthprivpass
+
+# configure agent
+CONFIGAGENT rwuser $NEWUSER
+
+# Start the agent
+STARTAGENT
+
+## usmUserTable management
+
+## 1) create, clone, test, delete
+
+# create new (vanilla) user
+CAPTURE "snmpusm $SNMP_FLAGS $TESTPRIVARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT create $NEWUSER"
+CHECKORDIE "User successfully created"
+
+# clone
+CAPTURE "snmpusm $SNMP_FLAGS $TESTPRIVARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT cloneFrom $NEWUSER $TESTPRIVUSER"
+CHECKORDIE "User successfully cloned"
+
+# test (authPriv)
+CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -A $TESTAUTHPASS -x $DEFPRIVTYPE -X $TESTPRIVPASS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+# delete
+CAPTURE "snmpusm $SNMP_FLAGS $TESTPRIVARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT delete $NEWUSER"
+CHECKORDIE "User successfully deleted"
+
+## 2) create w/ clone, passwd (auth), passwd (priv), test (authPriv+authNoPriv)
+
+# create+clone template user
+CAPTURE "snmpusm $SNMP_FLAGS $TESTPRIVARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT create $NEWUSER $TESTPRIVUSER2"
+CHECKORDIE "User successfully created"
+
+# change auth passphrase of new user
+CAPTURE "snmpusm $SNMP_FLAGS $TESTPRIVARGS -Ca $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT passwd $TESTAUTHPASS2 $NEWAUTHPASS $NEWUSER"
+CHECKORDIE "SNMPv3 Key(s) successfully changed"
+
+# change priv passphrase of new user
+CAPTURE "snmpusm $SNMP_FLAGS $TESTPRIVARGS -Cx $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT passwd $TESTPRIVPASS2 $NEWPRIVPASS $NEWUSER"
+CHECKORDIE "SNMPv3 Key(s) successfully changed"
+
+# test (authNoPriv)
+CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -u $NEWUSER -l anp -a $DEFAUTHTYPE -A $NEWAUTHPASS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+# test (authPriv)
+CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -A $NEWAUTHPASS -x $DEFPRIVTYPE -X $NEWPRIVPASS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+## 3) passwd (priv), passwd (auth+priv), test
+
+# change priv passphrase (to auth passphrase) by the user himself
+CAPTURE "snmpusm $SNMP_FLAGS -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -A $NEWAUTHPASS -x $DEFPRIVTYPE -X $NEWPRIVPASS -Cx $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT passwd $NEWPRIVPASS $NEWAUTHPASS"
+CHECKORDIE "SNMPv3 Key(s) successfully changed"
+
+# change both passphrases at once
+CAPTURE "snmpusm $SNMP_FLAGS -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -A $NEWAUTHPASS -x $DEFPRIVTYPE -X $NEWAUTHPASS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT passwd $NEWAUTHPASS $NEWAUTHPRIVPASS"
+CHECKORDIE "SNMPv3 Key(s) successfully changed"
+
+# test (authPriv)
+CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -A $NEWAUTHPRIVPASS -x $DEFPRIVTYPE -X $NEWAUTHPRIVPASS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+## 5) persistency I: reconfigure (SIGHUP), re-test
+
+if ISDEFINED HAVE_SIGHUP; then
+
+HUPAGENT
+DELAY
+
+# test (authPriv)
+CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -A $NEWAUTHPRIVPASS -x $DEFPRIVTYPE -X $NEWAUTHPRIVPASS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+## 5) persistency II: stop, start, re-test
+
+STOPAGENT
+DELAY
+# make sure it picks up persistent config and uses a new logfile
+SNMPCONFPATH="${SNMP_TMPDIR}${SNMP_ENV_SEPARATOR}${SNMP_TMP_PERSISTENTDIR}"
+export SNMPCONFPATH
+SNMP_CONFIG_FILE="does-not-exist"
+SNMP_SNMPD_LOG_FILE=${SNMP_TMPDIR}/snmpd2.log
+STARTAGENT
+
+# test (authPriv)
+CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -A $NEWAUTHPRIVPASS -x $DEFPRIVTYPE -X $NEWAUTHPRIVPASS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+fi
+
+## stop agent and finish
+STOPAGENT
+FINISHED
diff --git a/testing/fulltests/default/T035snmpv3trapdusermgmt_simple b/testing/fulltests/default/T035snmpv3trapdusermgmt_simple
new file mode 100644
index 0000000..be7aab6
--- /dev/null
+++ b/testing/fulltests/default/T035snmpv3trapdusermgmt_simple
@@ -0,0 +1,126 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 snmptrapd USM user management with snmpusm
+
+SKIPIFNOT USING_AGENTX_MASTER_MODULE
+SKIPIFNOT USING_AGENTX_SUBAGENT_MODULE
+SKIPIFNOT USING_SNMPV3_USMUSER_MODULE
+SKIPIF NETSNMP_SNMPTRAPD_DISABLE_AGENTX
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
+SKIPIFNOT NETSNMP_CAN_DO_CRYPTO
+SKIPIFNOT NETSNMP_ENABLE_SCAPI_AUTHPRIV
+
+#
+# Begin test
+#
+
+# configure AgentX socket
+if [ "x$SNMP_TRANSPORT_SPEC" = "xunix" ]; then
+ AGENT_FLAGS="$AGENT_FLAGS -x $SNMP_TMPDIR/agentx_socket"
+ TRAPD_FLAGS="$TRAPD_FLAGS -x $SNMP_TMPDIR/agentx_socket"
+else
+ AGENT_FLAGS="$AGENT_FLAGS -x tcp:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT}"
+ TRAPD_FLAGS="$TRAPD_FLAGS -x tcp:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT}"
+fi
+
+# standard SNMPv3 USM agent configuration
+DEFSECURITYLEVEL=authPriv
+. ./Sv3usmconfigagent
+
+# save agent access
+AGENT_TESTAUTHARGS=$TESTAUTHARGS
+AGENT_TESTPRIVARGS=$TESTPRIVARGS
+
+# configure agent as AgentX master
+CONFIGAGENT master agentx
+
+# Start the master agent
+STARTAGENT
+
+# standard SNMPv3 USM snmptrapd configuration
+. ./Sv3usmconfigtrapd
+
+# configure snmptrapd
+NEWAUTHKEY=0x7458ead7a0b5a753e21bfcb87f6c9803ebef68cf
+NEWPRIVKEY=0x98e2696d1cf34d904dfcae76bf01c473
+NEWUSER=newtestuser
+NEWAUTHPASS=newauthpass
+NEWPRIVPASS=newprivpass
+NEWUSER2=newtestuser_vanilla
+CONFIGTRAPD authuser log $NEWUSER auth
+
+# start snmptrapd
+STARTTRAPD
+
+# delay to let it connect and register all MIBs
+DELAY
+
+## verify snmptrapd usmUserTable management
+
+SNMPUSM_TRAPD_CONTEXT_ARGS="-n snmptrapd -CE $TRAPD_ENGINEID"
+
+## 1) create, clone, passwd auth, passwd priv, test
+
+# create vanilla user
+CAPTURE "snmpusm $SNMP_FLAGS $AGENT_TESTAUTHARGS $SNMPUSM_TRAPD_CONTEXT_ARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT create $NEWUSER2"
+CHECKORDIE "User successfully created"
+
+# clone template user
+CAPTURE "snmpusm $SNMP_FLAGS $AGENT_TESTAUTHARGS $SNMPUSM_TRAPD_CONTEXT_ARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT create $NEWUSER $TESTPRIVUSER"
+CHECKORDIE "User successfully created"
+
+# change auth passphrase of new user
+CAPTURE "snmpusm $SNMP_FLAGS $AGENT_TESTAUTHARGS $SNMPUSM_TRAPD_CONTEXT_ARGS -Ca $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT passwd $TESTAUTHPASS $NEWAUTHPASS $NEWUSER"
+CHECKORDIE "SNMPv3 Key(s) successfully changed"
+
+# change priv passphrase of new user
+CAPTURE "snmpusm $SNMP_FLAGS $AGENT_TESTPRIVARGS $SNMPUSM_TRAPD_CONTEXT_ARGS -Cx $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT passwd $TESTPRIVPASS $NEWPRIVPASS $NEWUSER"
+CHECKORDIE "SNMPv3 Key(s) successfully changed"
+
+# test (anp)
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 3 -u $NEWUSER -l anp -a $DEFAUTHTYPE -A $NEWAUTHPASS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_inform_anp"
+DELAY
+CHECKTRAPDORDIE "received_inform_anp"
+
+# test (ap)
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -A $NEWAUTHPASS -x $DEFPRIVTYPE -X $NEWPRIVPASS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_inform_ap"
+DELAY
+CHECKTRAPDORDIE "received_inform_ap"
+
+## 2) change localized auth key, test, change localized priv key, test
+
+# change localized auth key
+CAPTURE "snmpusm $SNMP_FLAGS $AGENT_TESTAUTHARGS $SNMPUSM_TRAPD_CONTEXT_ARGS -Ca -Ck $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT passwd $NEWAUTHPASS $NEWAUTHKEY $NEWUSER"
+CHECKORDIE "SNMPv3 Key(s) successfully changed"
+
+# test (anp)
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 3 -u $NEWUSER -l anp -a $DEFAUTHTYPE -3k $NEWAUTHKEY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_inform_anp2"
+DELAY
+CHECKTRAPDORDIE "received_inform_anp2"
+
+# change localized priv key
+CAPTURE "snmpusm $SNMP_FLAGS $AGENT_TESTPRIVARGS $SNMPUSM_TRAPD_CONTEXT_ARGS -Cx -Ck $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT passwd $NEWPRIVPASS $NEWPRIVKEY $NEWUSER"
+CHECKORDIE "SNMPv3 Key(s) successfully changed"
+
+# test (ap)
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -3k $NEWAUTHKEY -x $DEFPRIVTYPE -3K $NEWPRIVKEY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_inform_ap2"
+DELAY
+CHECKTRAPDORDIE "received_inform_ap2"
+
+## 3) persistency I: reconfigure (SIGHUP), re-test
+
+# reconfigure snmptrapd
+HUPTRAPD
+
+# test (ap)
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 3 -u $NEWUSER -l ap -a $DEFAUTHTYPE -3k $NEWAUTHKEY -x $DEFPRIVTYPE -3K $NEWPRIVKEY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_inform_ap3"
+DELAY
+CHECKTRAPDORDIE "received_inform_ap3"
+
+## stop daemons and finish
+STOPTRAPD
+STOPAGENT
+FINISHED
diff --git a/testing/fulltests/default/T049snmpv3inform_simple b/testing/fulltests/default/T049snmpv3inform_simple
new file mode 100644
index 0000000..99cb5eb
--- /dev/null
+++ b/testing/fulltests/default/T049snmpv3inform_simple
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+DEFSECURITYLEVEL=noAuthNoPriv
+
+HEADER "SNMPv3 informs (noAuthNoPriv) received and sent by tools"
+
+#
+# Begin test
+#
+
+CONFIGTRAPD createUser testuser
+CONFIGTRAPD authuser log testuser $DEFSECURITYLEVEL
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 3 -u testuser -l nanp $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_inform_$DEFSECURITYLEVEL"
+
+STOPTRAPD
+
+CHECKTRAPD "received_inform_$DEFSECURITYLEVEL"
+
+FINISHED
diff --git a/testing/fulltests/default/T049snmpv3informauth_simple b/testing/fulltests/default/T049snmpv3informauth_simple
new file mode 100644
index 0000000..0f18577
--- /dev/null
+++ b/testing/fulltests/default/T049snmpv3informauth_simple
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+DEFSECURITYLEVEL=authNoPriv
+
+HEADER "SNMPv3 informs (authNoPriv) received and sent by tools"
+
+#
+# Begin test
+#
+
+. ./Sv3usmconfigtrapd
+CONFIGTRAPD authuser log $TESTAUTHUSER $DEFSECURITYLEVEL
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d $TESTAUTHARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_inform_$DEFSECURITYLEVEL"
+
+STOPTRAPD
+
+CHECKTRAPD "received_inform_$DEFSECURITYLEVEL"
+
+FINISHED
diff --git a/testing/fulltests/default/T049snmpv3informpriv_simple b/testing/fulltests/default/T049snmpv3informpriv_simple
new file mode 100644
index 0000000..e8f47de
--- /dev/null
+++ b/testing/fulltests/default/T049snmpv3informpriv_simple
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+DEFSECURITYLEVEL=authPriv
+
+HEADER "SNMPv3 informs (authPriv) received and sent by tools"
+
+SKIPIFNOT NETSNMP_CAN_DO_CRYPTO
+SKIPIFNOT NETSNMP_ENABLE_SCAPI_AUTHPRIV
+
+#
+# Begin test
+#
+
+. ./Sv3usmconfigtrapd
+CONFIGTRAPD authuser log $TESTPRIVUSER $DEFSECURITYLEVEL
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d $TESTPRIVARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_inform_$DEFSECURITYLEVEL"
+
+STOPTRAPD
+
+CHECKTRAPD "received_inform_$DEFSECURITYLEVEL"
+
+FINISHED
diff --git a/testing/fulltests/default/T050snmpv3trap_simple b/testing/fulltests/default/T050snmpv3trap_simple
new file mode 100644
index 0000000..2b7a4a8
--- /dev/null
+++ b/testing/fulltests/default/T050snmpv3trap_simple
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 traps received and sent by tools
+
+#SKIPIFNOT NETSNMP_USE_OPENSSL
+SKIPIFNOT NETSNMP_ENABLE_SCAPI_AUTHPRIV
+
+#
+# Begin test
+#
+
+CREATEUSERENGINEID=0x80001f88802b3d0e06bbdf4321
+. ./Sv3usmconfigtrapd
+CONFIGTRAPD authuser log $TESTNOAUTHUSER noAuthNoPriv
+CONFIGTRAPD authuser log $TESTAUTHUSER authNoPriv
+CONFIGTRAPD authuser log $TESTPRIVUSER authPriv
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+CAPTURE "snmptrap -d -e $CREATEUSERENGINEID $TESTNOAUTHARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_trap_nanp"
+DELAY
+CAPTURE "snmptrap -d -e $CREATEUSERENGINEID $TESTAUTHARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_trap_anp"
+DELAY
+CAPTURE "snmptrap -d -e $CREATEUSERENGINEID $TESTPRIVARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s received_trap_ap"
+DELAY
+
+STOPTRAPD
+
+CHECKTRAPD "received_trap_nanp"
+CHECKTRAPD "received_trap_anp"
+CHECKTRAPD "received_trap_ap"
+
+FINISHED
diff --git a/testing/fulltests/default/T051snmpv2ctrap_simple b/testing/fulltests/default/T051snmpv2ctrap_simple
new file mode 100644
index 0000000..8e1be6b
--- /dev/null
+++ b/testing/fulltests/default/T051snmpv2ctrap_simple
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2c traps received and sent by tools
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_MIBII_VACM_CONF_MODULE
+
+#
+# Begin test
+#
+
+CONFIGTRAPD authcommunity log testcommunity
+CONFIGTRAPD agentxsocket /dev/null
+
+TRAPD_FLAGS="$TRAPD_FLAGS -On"
+
+STARTTRAPD
+
+CAPTURE "snmptrap -d -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s blah"
+
+STOPTRAPD
+
+CHECKTRAPD ".1.3.6.1.6.3.1.1.4.1.0 = OID: .1.3.6.1.6.3.1.1.5.1"
+
+FINISHED
diff --git a/testing/fulltests/default/T052snmpv2cinform_simple b/testing/fulltests/default/T052snmpv2cinform_simple
new file mode 100644
index 0000000..4208df8
--- /dev/null
+++ b/testing/fulltests/default/T052snmpv2cinform_simple
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2c informs received and sent by tools
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_MIBII_VACM_CONF_MODULE
+
+#
+# Begin test
+#
+
+CONFIGTRAPD authcommunity log testcommunity
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s blah"
+
+STOPTRAPD
+
+CHECKTRAPD "Received"
+
+FINISHED
diff --git a/testing/fulltests/default/T053agentv1trap_simple b/testing/fulltests/default/T053agentv1trap_simple
new file mode 100644
index 0000000..44b219e
--- /dev/null
+++ b/testing/fulltests/default/T053agentv1trap_simple
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER snmpv1 traps are sent by snmpd API
+
+SKIPIFNOT USING_EXAMPLES_EXAMPLE_MODULE
+SKIPIFNOT HAVE_SIGHUP
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcomunnity
+. ./Sv3config
+CONFIGAGENT trapsink ${SNMP_TRANSPORT_SPEC}:${SNMP_TEST_DEST}${SNMP_SNMPTRAPD_PORT} public
+
+CONFIGTRAPD authcommunity log public
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+AGENT_FLAGS="$AGENT_FLAGS -Dexample,header_generic,add_trap"
+STARTAGENT
+
+CAPTURE "snmpset -On $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.2021.254.7.0 i 1"
+
+STOPAGENT
+
+STOPTRAPD
+
+CHECKTRAPD "Enterprise Specific Trap (99)"
+
+FINISHED
diff --git a/testing/fulltests/default/T054agentv2ctrap_simple b/testing/fulltests/default/T054agentv2ctrap_simple
new file mode 100644
index 0000000..f5b6904
--- /dev/null
+++ b/testing/fulltests/default/T054agentv2ctrap_simple
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER snmpv2c traps are sent by snmpd API
+
+SKIPIFNOT USING_EXAMPLES_EXAMPLE_MODULE
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity
+. ./Sv3config
+CONFIGAGENT trap2sink ${SNMP_TRANSPORT_SPEC}:${SNMP_TEST_DEST}${SNMP_SNMPTRAPD_PORT} public
+CONFIGTRAPD authcommunity log public
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+AGENT_FLAGS="$AGENT_FLAGS"
+STARTAGENT
+
+#DELAY
+CAPTURE "snmpset -On -t 3 -r 0 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.2021.254.8.0 i 1"
+
+STOPAGENT
+
+STOPTRAPD
+
+CHECKTRAPD "life the universe and everything"
+
+FINISHED
diff --git a/testing/fulltests/default/T055agentv1mintrap_simple b/testing/fulltests/default/T055agentv1mintrap_simple
new file mode 100644
index 0000000..4a1c0e1
--- /dev/null
+++ b/testing/fulltests/default/T055agentv1mintrap_simple
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER snmpv1 traps are sent by snmpd without notification mib support
+
+SKIPIFNOT USING_EXAMPLES_EXAMPLE_MODULE
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity
+. ./Sv3config
+CONFIGAGENT trapsink ${SNMP_TRANSPORT_SPEC}:${SNMP_TEST_DEST}${SNMP_SNMPTRAPD_PORT} public
+CONFIGTRAPD authcommunity log public
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+# initialize only the example mib, and not the notification mib stuff
+AGENT_FLAGS="$AGENT_FLAGS -Dexample,header_generic,add_trap,mib_init,callback -I example,usmUser,usmConf,vacm_vars"
+STARTAGENT
+
+CAPTURE "snmpset -On $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.2021.254.7.0 i 1"
+
+STOPAGENT
+
+STOPTRAPD
+
+CHECKTRAPD "Enterprise Specific Trap (99)"
+
+FINISHED
diff --git a/testing/fulltests/default/T056agentv2cmintrap_simple b/testing/fulltests/default/T056agentv2cmintrap_simple
new file mode 100644
index 0000000..73c7a23
--- /dev/null
+++ b/testing/fulltests/default/T056agentv2cmintrap_simple
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER snmpv2c traps are sent by snmpd without notification mib support
+
+SKIPIFNOT USING_EXAMPLES_EXAMPLE_MODULE
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity
+. ./Sv3config
+CONFIGAGENT trap2sink ${SNMP_TRANSPORT_SPEC}:${SNMP_TEST_DEST}${SNMP_SNMPTRAPD_PORT} public
+CONFIGTRAPD authcommunity log public
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+# initialize only the example mib, and not the notification mib stuff
+AGENT_FLAGS="$AGENT_FLAGS -Dexample,header_generic,add_trap,mib_init,callback -I example,usmUser,usmConf,vacm_vars"
+STARTAGENT
+
+#DELAY
+CAPTURE "snmpset -On -t 3 -r 0 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.2021.254.8.0 i 1"
+
+STOPAGENT
+
+STOPTRAPD
+
+CHECKTRAPD "life the universe and everything"
+
+FINISHED
diff --git a/testing/fulltests/default/T057trapdauthtest2_simple b/testing/fulltests/default/T057trapdauthtest2_simple
new file mode 100644
index 0000000..6a43989
--- /dev/null
+++ b/testing/fulltests/default/T057trapdauthtest2_simple
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+HEADER snmptrapd discards of unauthorized notification types
+
+#
+# Begin test
+#
+
+CONFIGTRAPD createUser testuser
+CONFIGTRAPD authuser log testuser noAuthNoPriv .1.3.6.1.6.3.1.1.5.2
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 3 -u testuser -l nanp $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 system.sysContact.0 s blah"
+
+STOPTRAPD
+
+CHECKTRAPDCOUNT 0 "coldStart"
+
+FINISHED
diff --git a/testing/fulltests/default/T057trapdauthtest3_simple b/testing/fulltests/default/T057trapdauthtest3_simple
new file mode 100644
index 0000000..078ef38
--- /dev/null
+++ b/testing/fulltests/default/T057trapdauthtest3_simple
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+HEADER snmptrapd discards of incorrect view types
+
+#
+# Begin test
+#
+
+CONFIGTRAPD createUser testuser
+CONFIGTRAPD authuser execute testuser noAuthNoPriv
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 3 -u testuser -l nanp $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 system.sysContact.0 s blah"
+
+STOPTRAPD
+
+CHECKTRAPDCOUNT 0 "coldStart"
+
+FINISHED
diff --git a/testing/fulltests/default/T057trapdauthtest_simple b/testing/fulltests/default/T057trapdauthtest_simple
new file mode 100644
index 0000000..4e2fc10
--- /dev/null
+++ b/testing/fulltests/default/T057trapdauthtest_simple
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+HEADER snmptrapd authorization failure of non authorized users
+
+#
+# Begin test
+#
+
+CONFIGTRAPD createUser testuser
+CONFIGTRAPD authuser log testuser noAuthNoPriv
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -v 3 -u nottestuser -l nanp $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 system.sysContact.0 s blah"
+
+STOPTRAPD
+
+CHECKTRAPDCOUNT 0 "coldStart"
+
+FINISHED
diff --git a/testing/fulltests/default/T058agentauthtrap_simple b/testing/fulltests/default/T058agentauthtrap_simple
new file mode 100644
index 0000000..aa63639
--- /dev/null
+++ b/testing/fulltests/default/T058agentauthtrap_simple
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER authentication failure traps are sent by snmpd
+
+SKIPIF NETSNMP_DISABLE_SNMPV1
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity
+. ./Sv1config
+# add in a v1 trap sink
+CONFIGAGENT trapsink $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT public
+CONFIGAGENT authtrapenable 1
+CONFIGTRAPD authcommunity log public
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+STARTAGENT
+
+# give the agent more time to start up. We only want to fire one
+# request (retries = 0) to make sure only one trap is sent.
+#DELAY
+CAPTURE "snmpget -On -r 0 -t 5 $SNMP_FLAGS -v 1 -c wrongcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+STOPTRAPD
+
+CHECKTRAPD "Authentication Failure Trap"
+
+FINISHED
diff --git a/testing/fulltests/default/T059trapdtraphandle_simple b/testing/fulltests/default/T059trapdtraphandle_simple
new file mode 100755
index 0000000..53d5b90
--- /dev/null
+++ b/testing/fulltests/default/T059trapdtraphandle_simple
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# Testing this script is possible by running e.g. the following commands:
+# srcdir=/z/software/net-snmp/trunk builddir=/z/software/net-snmp/trunk-mingw
+# cd $builddir/testing
+# TRAPD_FLAGS="-Dsnmptrapd -Drun:shell" $srcdir/testing/fulltests/support/simple_run $srcdir/testing/fulltests/default/T059trapdtraphandle_simple
+
+# "inline" trap handler
+if [ "x$1" = "xtraphandle" ]; then
+ cat - >>"$2"
+ exit 0
+fi
+
+. ../support/simple_eval_tools.sh
+
+TRAPHANDLE_LOGFILE=${SNMP_TMPDIR}/traphandle.log
+
+HEADER snmptrapd traphandle: launching external shell script
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_UTILITIES_EXECUTE_MODULE
+SKIPIFNOT HAVE_SIGHUP
+
+#
+# Begin test
+#
+
+snmp_version=v2c
+TESTCOMMUNITY=testcommunity
+
+# Make the paths of arguments $0 and $1 absolute.
+NETSNMPDIR="`pwd`"
+NETSNMPDIR="`dirname ${NETSNMPDIR}`"
+NETSNMPDIR="`dirname ${NETSNMPDIR}`"
+NETSNMPDIR="`dirname ${NETSNMPDIR}`"
+if [ "`echo $1|cut -c1`" = "/" ]; then
+ traphandle_arg="$1"
+else
+ traphandle_arg="${NETSNMPDIR}/$1"
+fi
+
+CONFIGTRAPD [snmp] persistentDir $SNMP_TMP_PERSISTENTDIR
+CONFIGTRAPD [snmp] tempFilePattern /tmp/snmpd-tmp-XXXXXX
+CONFIGTRAPD authcommunity execute $TESTCOMMUNITY
+CONFIGTRAPD doNotLogTraps true
+if [ "x$OSTYPE" = "xmsys" ]; then
+ CONFIGTRAPD traphandle default $MSYS_SH -c "'" $traphandle_arg traphandle $TRAPHANDLE_LOGFILE "'"
+else
+ CONFIGTRAPD traphandle default $traphandle_arg traphandle $TRAPHANDLE_LOGFILE
+fi
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+## 1) test notification handler
+
+CAPTURE "snmptrap -d -Ci -t $SNMP_SLEEP -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s handled_inform_$snmp_version"
+DELAY
+CHECKORDIE "handled_inform_$snmp_version" $TRAPHANDLE_LOGFILE
+
+## 2) persistency: reconfigure (SIGHUP), re-test
+
+HUPTRAPD
+CAPTURE "snmptrap -d -Ci -t $SNMP_SLEEP -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 .1.3.6.1.6.3.1.1.5.1 .1.3.6.1.2.1.1.4.0 s handled_inform2_$snmp_version"
+DELAY
+CHECKORDIE "handled_inform2_$snmp_version" $TRAPHANDLE_LOGFILE
+
+## stop
+STOPTRAPD
+
+FINISHED
diff --git a/testing/fulltests/default/T060trapdperl_simple b/testing/fulltests/default/T060trapdperl_simple
new file mode 100755
index 0000000..33741e0
--- /dev/null
+++ b/testing/fulltests/default/T060trapdperl_simple
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER 'snmptrapd embedded perl support (NetSNMP::TrapReceiver)'
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT NETSNMP_EMBEDDED_PERL
+SKIPIFNOT HAVE_SIGHUP
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+#
+# Begin test
+#
+
+snmp_version=v2c
+TESTCOMMUNITY=testcommunity
+TESTOID=.1.3.6.1.6.3.1.1.5.1
+TESTOID2=.1.3.6.1.6.3.1.1.5.2
+VAROID=.1.3.6.1.2.1.1.4.0
+EMBPERL_LOGFILE=${SNMP_TMPDIR}/embperl.log
+
+# make sure that we can fulfill all library dependencies
+_ld_lib_path="${SNMP_UPDIR}/snmplib/.libs:${SNMP_UPDIR}/agent/.libs:${SNMP_UPDIR}/agent/helpers/.libs"
+if [ x$OSTYPE = xcygwin ]; then
+ PATH="${_ld_lib_path}:$PATH"
+fi
+
+echo "use blib qw(${SNMP_UPDIR}/perl);" > ${SNMP_TMPDIR}/snmp_perl_trapd.pl
+echo "use NetSNMP::TrapReceiver;" >> ${SNMP_TMPDIR}/snmp_perl_trapd.pl
+
+CONFIGTRAPD authcommunity execute $TESTCOMMUNITY
+CONFIGTRAPD perlInitFile ${SNMP_TMPDIR}/snmp_perl_trapd.pl
+CONFIGTRAPD 'perl sub my_receiver { open LOG,">>'$EMBPERL_LOGFILE'"; print LOG "handled_by_embperl\n"; close LOG };'
+CONFIGTRAPD 'perl sub my_receiver2 { open LOG,">>'$EMBPERL_LOGFILE'"; print LOG "handled_again_by_embperl\n"; close LOG };'
+CONFIGTRAPD 'perl NetSNMP::TrapReceiver::register("'$TESTOID'", \&my_receiver) || warn "register_perl_handler_failed";'
+CONFIGTRAPD 'perl NetSNMP::TrapReceiver::register("'$TESTOID2'", \&my_receiver2) || warn "register_second_perl_handler_failed";'
+CONFIGTRAPD 'perl print STDERR "registered_perl_handler_ok\n";'
+CONFIGTRAPD agentxsocket /dev/null
+
+STARTTRAPD
+
+## 1) trigger embedded perl notification handler
+
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 $TESTOID $VAROID s handled_trap_$snmp_version"
+
+## 2) persistency: reconfigure (SIGHUP), re-trigger
+
+HUPTRAPD
+CAPTURE "snmptrap -Ci -t $SNMP_SLEEP -d -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT 0 $TESTOID2 $VAROID s handled_trap2_$snmp_version"
+
+## stop
+STOPTRAPD
+
+
+CHECKORDIE "handled_by_embperl" $EMBPERL_LOGFILE
+CHECKORDIE "handled_again_by_embperl" $EMBPERL_LOGFILE
+
+FINISHED
diff --git a/testing/fulltests/default/T061agentperl_simple b/testing/fulltests/default/T061agentperl_simple
new file mode 100755
index 0000000..c20a3ff
--- /dev/null
+++ b/testing/fulltests/default/T061agentperl_simple
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER 'snmpd embedded perl support (using NetSNMP::agent)'
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT NETSNMP_EMBEDDED_PERL
+SKIPIFNOT HAVE_SIGHUP
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+#
+# Begin test
+#
+
+snmp_version=v2c
+TESTCOMMUNITY=testcommunity
+. ./Sv2cconfig
+
+TESTOID=.1.3.6.1.4.1.8872.9999.9999.1.0
+TESTOID2=.1.3.6.1.4.1.8872.9999.9999.2.0
+EMBPERL_AGENT=${SNMP_TMPDIR}/hello.pl
+cat >$EMBPERL_AGENT <<END
+#!/usr/bin/env perl
+# minimal embedded perl agent
+
+my \$regat = '.1.3.6.1.4.1.8872.9999.9999'; # netSnmpPlayPen
+my \$myoid = \$regat . ".1.0"; # the "hello world" OID
+my \$myoid2 = \$regat . ".2.0"; # the "hello again world" OID
+
+use NetSNMP::OID qw(:all);
+use NetSNMP::agent qw(:all);
+use NetSNMP::ASN qw(:all);
+use SNMP;
+
+my \$regoid = new NetSNMP::OID(\$regat);
+\$agent->register("hello", \$regoid, \&my_snmp_handler);
+
+sub my_snmp_handler {
+ my (\$handler, \$registration_info, \$request_info, \$requests) = @_;
+ for(my \$request = \$requests; \$request; \$request = \$request->next()) {
+ if (\$request_info->getMode() == MODE_GET) {
+ if (\$request->getOID() == new NetSNMP::OID(\$myoid)) {
+ \$request->setValue(ASN_OCTET_STR, "hello world");
+ last;
+ } elsif (\$request->getOID() == new NetSNMP::OID(\$myoid2)) {
+ \$request->setValue(ASN_OCTET_STR, "hello again world");
+ last;
+ }
+ }
+ }
+}
+END
+
+echo "use blib qw(${SNMP_UPDIR}/perl);" > ${SNMP_TMPDIR}/snmp_perl.pl
+echo 'use NetSNMP::agent;' >> ${SNMP_TMPDIR}/snmp_perl.pl
+echo '$agent = new NetSNMP::agent('"'dont_init_agent' => 1, 'dont_init_lib' => 1);" >> ${SNMP_TMPDIR}/snmp_perl.pl
+
+CONFIGAGENT perlInitFile ${SNMP_TMPDIR}/snmp_perl.pl
+CONFIGAGENT "perl do '$EMBPERL_AGENT';"
+CONFIGAGENT 'perl print STDERR "registered_perl_agent_ok";'
+
+STARTAGENT
+
+## 1) SNMP GET against embedded perl mib module
+CAPTURE "snmpget -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $TESTOID"
+CHECK "hello world"
+
+## 2) persistency: reconfigure (HUP), re-test
+HUPAGENT
+CAPTURE "snmpget -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $TESTOID2"
+CHECK "hello again world"
+
+## stop
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T065agentextend_simple b/testing/fulltests/default/T065agentextend_simple
new file mode 100644
index 0000000..07dcae3
--- /dev/null
+++ b/testing/fulltests/default/T065agentextend_simple
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER "extending agent functionality with extend"
+
+[ "x$OSTYPE" = xmsys -a "x$MSYS_SH" = x ] && SKIP "\$MSYS_SH has not been set"
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_AGENT_EXTEND_MODULE
+SKIPIFNOT USING_UTILITIES_EXECUTE_MODULE
+
+# make sure snmpget can be executed
+SNMPGET="${SNMP_UPDIR}/apps/snmpget"
+[ -x "$SNMPGET" ] || SKIP
+
+snmp_version=v2c
+TESTCOMMUNITY=testcommunity
+. ./Sv2cconfig
+
+#
+# Begin test
+#
+
+index='"hello"'
+if [ "x$OSTYPE" = "xmsys" ]; then
+ CONFIGAGENT extend hello $MSYS_SH -c "'" echo hello_world "'"
+else
+ CONFIGAGENT extend hello /usr/bin/env echo hello_world
+fi
+
+STARTAGENT
+
+# NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."hello" = STRING: "hello_world"
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.8072.1.3.2.3.1.1.$index"
+CHECKORDIE "STRING: hello_world"
+
+#NET-SNMP-EXTEND-MIB::nsExtendOutputFull."hello" = STRING: "hello_world"
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.8072.1.3.2.3.1.2.$index"
+CHECKORDIE "STRING: hello_world"
+
+#NET-SNMP-EXTEND-MIB::nsExtendOutLine."hello".1 = STRING: "hello_world"
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.8072.1.3.2.4.1.2.$index.1"
+CHECKORDIE "STRING: hello_world"
+
+#NET-SNMP-EXTEND-MIB::nsExtendOutNumLines."hello" = INTEGER: 1
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.8072.1.3.2.3.1.3.$index"
+CHECKORDIE "INTEGER: 1"
+
+#NET-SNMP-EXTEND-MIB::nsExtendResult."hello" = INTEGER: 0
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.8072.1.3.2.3.1.4.$index"
+CHECKORDIE "INTEGER: 0"
+
+STOPAGENT
+FINISHED
diff --git a/testing/fulltests/default/T066pass_simple b/testing/fulltests/default/T066pass_simple
new file mode 100644
index 0000000..6396ed1
--- /dev/null
+++ b/testing/fulltests/default/T066pass_simple
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER "extending agent functionality with pass"
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_UCD_SNMP_PASS_MODULE
+SKIPIFNOT USING_UTILITIES_EXECUTE_MODULE
+
+# Don't run this test on MinGW - local/passtest is a shell script and
+# hence passing it to the MSVCRT popen() doesn't work.
+[ "x$OSTYPE" = "xmsys" ] && SKIP "MinGW"
+
+# make sure snmpget and snmpwalk can be executed
+SNMPGET="${builddir}/apps/snmpget"
+[ -x "$SNMPGET" ] || SKIP
+SNMPWALK="${builddir}/apps/snmpwalk"
+[ -x "$SNMPWALK" ] || SKIP
+
+snmp_version=v2c
+TESTCOMMUNITY=testcommunity
+. ./Sv2cconfig
+
+#
+# Begin test
+#
+oid=.1.3.6.1.4.1.8072.2.255 # NET-SNMP-PASS-MIB::netSnmpPassExamples
+CONFIGAGENT pass $oid ${srcdir}/local/passtest
+
+ORIG_AGENT_FLAGS="$AGENT_FLAGS"
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -Ducd-snmp/pass"
+STARTAGENT
+
+#COMMENT Check a full walk of the sample data
+CAPTURE "$SNMPWALK $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $oid"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassString.0 = STRING: Life, the Universe, and Everything"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassInteger.1 = INTEGER: 42"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassOID.1 = OID: NET-SNMP-PASS-MIB::netSnmpPassOIDValue"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassTimeTicks.0 = Timeticks: (363136200) 42 days, 0:42:42.00 "
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassIpAddress.0 = IpAddress: 127.0.0.1"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassCounter.0 = Counter32: 42"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassGauge.0 = Gauge32: 42"
+
+#COMMENT A couple of spot checks of GET requests.
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT NET-SNMP-PASS-MIB::netSnmpPassInteger.1"
+CHECKORDIE "INTEGER: 42"
+
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT NET-SNMP-PASS-MIB::netSnmpPassCounter.0"
+CHECKORDIE "Counter32: 42"
+
+STOPAGENT
+FINISHED
diff --git a/testing/fulltests/default/T067passpersist_simple b/testing/fulltests/default/T067passpersist_simple
new file mode 100644
index 0000000..6051b8f
--- /dev/null
+++ b/testing/fulltests/default/T067passpersist_simple
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER "extending agent functionality with pass_persist"
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_UCD_SNMP_PASS_PERSIST_MODULE
+
+# Don't run this test on MinGW - local/pass_persisttest is a shell script and
+# hence passing it to the MSVCRT popen() doesn't work.
+[ "x$OSTYPE" = "xmsys" ] && SKIP "MinGW"
+
+[ -x /usr/bin/perl ] || SKIP "/usr/bin/perl not found"
+
+# make sure snmpget and snmpwalk can be executed
+SNMPGET="${builddir}/apps/snmpget"
+[ -x "$SNMPGET" ] || SKIP
+SNMPWALK="${builddir}/apps/snmpwalk"
+[ -x "$SNMPWALK" ] || SKIP
+
+snmp_version=v2c
+TESTCOMMUNITY=testcommunity
+. ./Sv2cconfig
+
+#
+# Begin test
+#
+oid=.1.3.6.1.4.1.8072.2.255 # NET-SNMP-PASS-MIB::netSnmpPassExamples
+CONFIGAGENT pass_persist $oid ${srcdir}/local/pass_persisttest
+
+ORIG_AGENT_FLAGS="$AGENT_FLAGS"
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -Ducd-snmp/pass_persist"
+PASS_PERSIST_PIDFILE="$SNMP_TMPDIR/pass_persist.pid.$$"
+export PASS_PERSIST_PIDFILE
+STARTAGENT
+
+#COMMENT Check a full walk of the sample data
+CAPTURE "$SNMPWALK $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $oid"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassString.0 = STRING: Life, the Universe, and Everything"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassInteger.1 = INTEGER: 42"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassOID.1 = OID: NET-SNMP-PASS-MIB::netSnmpPassOIDValue"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassTimeTicks.0 = Timeticks: (363136200) 42 days, 0:42:42.00 "
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassIpAddress.0 = IpAddress: 127.0.0.1"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassCounter.0 = Counter32: 1"
+CHECKORDIE "NET-SNMP-PASS-MIB::netSnmpPassGauge.0 = Gauge32: 42"
+
+#COMMENT A couple of spot checks of GET requests.
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT NET-SNMP-PASS-MIB::netSnmpPassInteger.1"
+CHECKORDIE "INTEGER: 42"
+
+#COMMENT netSnmpPassCounter should increment, since this is pass_persist
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT NET-SNMP-PASS-MIB::netSnmpPassCounter.0"
+CHECKORDIE "Counter32: 2"
+
+#COMMENT now kill the pass_persist script, and check that it recovers.
+STOPPROG $PASS_PERSIST_PIDFILE
+#COMMENT netSnmpPassCounter should have reverted to 1, as this is a new instance.
+CAPTURE "$SNMPGET $SNMP_FLAGS -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT NET-SNMP-PASS-MIB::netSnmpPassCounter.0"
+CHECKORDIE "Counter32: 1"
+
+STOPAGENT
+FINISHED
diff --git a/testing/fulltests/default/T070com2sec_simple b/testing/fulltests/default/T070com2sec_simple
new file mode 100644
index 0000000..9f76fcd
--- /dev/null
+++ b/testing/fulltests/default/T070com2sec_simple
@@ -0,0 +1,159 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER com2sec directive
+
+SKIPIFNOT NETSNMP_TRANSPORT_UDP_DOMAIN
+SKIPIF NETSNMP_NO_DEBUGGING
+
+#
+# Begin test
+#
+
+# 401a Test missing CONTEXT
+CONFIGAGENT 'com2sec -Cn'
+# 401b Test empty CONTEXT
+CONFIGAGENT 'com2sec -Cn ""'
+# 401c Test overlong CONTEXT (34 chars)
+CONFIGAGENT 'com2sec -Cn 1234567890123456789012345678901234'
+
+# 402a Test missing secName
+CONFIGAGENT 'com2sec'
+# 402b Test empty secName
+CONFIGAGENT 'com2sec ""'
+# 402c Test overlong secName (34 chars)
+CONFIGAGENT 'com2sec 1234567890123456789012345678901234'
+# 402d Test valid context and missing secName
+CONFIGAGENT 'com2sec -Cn 123456789012345678901234567890123'
+# 402e Test valid context and empty secName
+CONFIGAGENT 'com2sec -Cn 123456789012345678901234567890123 ""'
+
+# 403a Test missing network address
+CONFIGAGENT 'com2sec t403a'
+# 403b Test empty network address
+CONFIGAGENT 'com2sec t403b ""'
+# 403c Test forbidden value (now why it is forbidden...)
+CONFIGAGENT 'com2sec t403c NETWORK'
+
+# 404a Test missing community
+CONFIGAGENT 'com2sec t404a default'
+# 404b Test empty community
+CONFIGAGENT 'com2sec t404b default ""'
+# 404c Test forbidden value (now why it is forbidden...)
+CONFIGAGENT 'com2sec t404c default COMMUNITY'
+# 404d Test overlong community (255 chars)
+CONFIGAGENT 'com2sec t404d default 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345'
+# 404e Test valid community
+CONFIGAGENT 'com2sec t404e default 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234'
+
+# 405a Test 'default' configuration
+CONFIGAGENT 'com2sec t405a default c405a'
+# 405b Test ip address configuration
+CONFIGAGENT 'com2sec t405b 10.0.0.0 c405b'
+# 405c Test valid numeric mask
+CONFIGAGENT 'com2sec t405c 10.0.0.0/8 c405c'
+# 405d Test invalid numeric mask (too big)
+CONFIGAGENT 'com2sec t405d 10.0.0.0/33 c405d'
+# 405e Test invalid numeric mask (negative)
+CONFIGAGENT 'com2sec t405e 10.0.0.0/-1 c405e'
+# 405f Test valid ip address mask
+CONFIGAGENT 'com2sec t405f 10.0.0.0/255.0.0.0 c405f'
+# 405g Test invalid ip address mask
+CONFIGAGENT 'com2sec t405g 10.0.0.0/512.0.0.0 c405g'
+# 405h Test invalid ip address mask
+CONFIGAGENT 'com2sec t405h 10.0.0.0/hh c405h'
+# 405i Test address with 1 bits not covered by the mask
+CONFIGAGENT 'com2sec t405i 10.0.0.0/3.192.0.0 c405i'
+# 405j Test that 0.0.0.0 works (alias for default)
+CONFIGAGENT 'com2sec t405j 0.0.0.0 c405j'
+# 405k Test that 0.0.0.0/0 works (alias for default)
+CONFIGAGENT 'com2sec t405k 0.0.0.0/0 c405k'
+# 405l Test that 0.0.0.0/0.0.0.0 works (alias for default)
+CONFIGAGENT 'com2sec t405l 0.0.0.0/0.0.0.0 c405l'
+
+# 406a Test maximally long address/mask
+CONFIGAGENT 'com2sec t406a 255.255.255.255/255.255.255.255 c406a'
+
+# 407a Test non existant host name
+CONFIGAGENT 'com2sec t407a no.such.address. c407a'
+# 407b Test maximally long host name/mask
+CONFIGAGENT 'com2sec t407b a23456789012345678901234567890123456789012345678901234567890123.a23456789012345678901234567890123456789012345678901234567890123.a23456789012345678901234567890123456789012345678901234567890123.a234567890123456789012345678901234567890123456789012345678901./255.255.255.255 c407b'
+
+# 408 Lookup tests, require network access
+# 408a Test lookup returning a single host
+CONFIGAGENT 'com2sec t408a www.ietf.org c408a'
+# 408a Test lookup returning multiple hosts
+CONFIGAGENT 'com2sec t408b www.google.com c408b'
+
+# Default agent setup
+CONFIGAGENT "[snmp] persistentdir $SNMP_TMP_PERSISTENTDIR"
+# Dummy config to prevent the basic_setup warning
+CONFIGAGENT 'rocommunity public 127.0.0.0/8'
+
+AGENT_FLAGS='-Dnetsnmp_udp_parse_security,netsnmp_udp6_parse_security,netsnmp_unix_parse_security'
+
+STARTAGENT
+
+SAVECHECKAGENT() {
+ CHECKAGENT "$@"
+ if [ "x$return_value" != "x0" ] ; then
+ FINISHED
+ fi
+}
+
+SAVECHECKAGENT 'line 1: Error: missing CONTEXT_NAME parameter'
+SAVECHECKAGENT 'line 2: Error: missing NAME parameter'
+SAVECHECKAGENT 'line 3: Error: context name too long'
+CHECKAGENTCOUNT atleastone 'line 4: Error: Blank line following com2sec token.'
+SAVECHECKAGENT 'line 5: Error: empty NAME parameter'
+SAVECHECKAGENT 'line 6: Error: security name too long'
+SAVECHECKAGENT 'line 7: Error: missing NAME parameter'
+SAVECHECKAGENT 'line 8: Error: empty NAME parameter'
+SAVECHECKAGENT 'line 9: Error: missing SOURCE parameter'
+SAVECHECKAGENT 'line 10: Error: empty SOURCE parameter'
+SAVECHECKAGENT 'line 11: Error: example config NETWORK not properly configured'
+SAVECHECKAGENT 'line 12: Error: missing COMMUNITY parameter'
+SAVECHECKAGENT 'line 13: Error: empty COMMUNITY parameter'
+SAVECHECKAGENT 'line 14: Error: example config COMMUNITY not properly configured'
+SAVECHECKAGENT 'line 15: Error: community name too long'
+SAVECHECKAGENT '<"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234", 0.0.0.0/0.0.0.0> => "t404e"'
+SAVECHECKAGENT '<"c405a", 0.0.0.0/0.0.0.0> => "t405a"'
+SAVECHECKAGENT '<"c405b", 10.0.0.0/255.255.255.255> => "t405b"'
+SAVECHECKAGENT '<"c405c", 10.0.0.0/255.0.0.0> => "t405c"'
+SAVECHECKAGENT 'line 20: Error: bad mask length'
+SAVECHECKAGENT 'line 21: Error: bad mask length'
+SAVECHECKAGENT '<"c405f", 10.0.0.0/255.0.0.0> => "t405f"'
+SAVECHECKAGENT 'line 23: Error: bad mask'
+SAVECHECKAGENT 'line 24: Error: bad mask'
+SAVECHECKAGENT 'line 25: Error: source/mask mismatch'
+SAVECHECKAGENT '<"c405j", 0.0.0.0/255.255.255.255> => "t405j"'
+SAVECHECKAGENT '<"c405k", 0.0.0.0/0.0.0.0> => "t405k"'
+SAVECHECKAGENT '<"c405l", 0.0.0.0/0.0.0.0> => "t405l"'
+SAVECHECKAGENT '<"c406a", 255.255.255.255/255.255.255.255> => "t406a"'
+SAVECHECKAGENT 'line 30: Error:' # msg from h_strerror so it varies
+SAVECHECKAGENT 'line 31: Error:' # msg from h_strerror so it varies
+
+CHECKAGENT '<"c408a"'
+if [ "$snmp_last_test_result" -eq 0 ] ; then
+ CHECKAGENT 'line 32: Error:'
+ if [ "$snmp_last_test_result" -ne 1 ] ; then
+ return_value=1
+ FINISHED
+ fi
+elif [ "$snmp_last_test_result" -ne 1 ] ; then
+ return_value=1
+ FINISHED
+fi
+
+CHECKAGENT '<"c408b"'
+if [ "$snmp_last_test_result" -eq 0 ] ; then
+ CHECKAGENT 'line 33: Error:'
+ if [ "$snmp_last_test_result" -ne 1 ] ; then
+ return_value=1
+ fi
+elif [ "$snmp_last_test_result" -ne 1 ] ; then
+ return_value=1
+fi
+
+FINISHED
diff --git a/testing/fulltests/default/T071com2sec6_simple b/testing/fulltests/default/T071com2sec6_simple
new file mode 100644
index 0000000..550a25b
--- /dev/null
+++ b/testing/fulltests/default/T071com2sec6_simple
@@ -0,0 +1,155 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER com2sec6 directive
+
+SKIPIFNOT NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+SKIPIF NETSNMP_NO_DEBUGGING
+
+#
+# Begin test
+#
+
+# 601a Test missing CONTEXT
+CONFIGAGENT 'com2sec6 -Cn'
+# 601b Test empty CONTEXT
+CONFIGAGENT 'com2sec6 -Cn ""'
+# 601c Test overlong CONTEXT (34 chars)
+CONFIGAGENT 'com2sec6 -Cn 1234567890123456789012345678901234'
+
+# 602a Test missing secName
+CONFIGAGENT 'com2sec6'
+# 602b Test empty secName
+CONFIGAGENT 'com2sec6 ""'
+# 602c Test overlong secName (34 chars)
+CONFIGAGENT 'com2sec6 1234567890123456789012345678901234'
+# 602d Test valid context and missing secName
+CONFIGAGENT 'com2sec6 -Cn 123456789012345678901234567890123'
+# 602e Test valid context and empty secName
+CONFIGAGENT 'com2sec6 -Cn 123456789012345678901234567890123 ""'
+
+# 603a Test missing network address
+CONFIGAGENT 'com2sec6 t603a'
+# 603b Test empty network address
+CONFIGAGENT 'com2sec6 t603b ""'
+# 603c Test forbidden value
+CONFIGAGENT 'com2sec6 t603c NETWORK'
+
+# 604a Test missing COMMUNITY
+CONFIGAGENT 'com2sec6 t604a default'
+# 604b 'Error: empty COMMUNITY parameter'
+CONFIGAGENT 'com2sec6 t604b default ""'
+# 604c Test overlong COMMUNITY
+CONFIGAGENT 'com2sec6 t604c default 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345'
+# 604d Test barely valid community
+CONFIGAGENT 'com2sec6 t604d default 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234'
+# 604e Test forbidden value
+CONFIGAGENT 'com2sec6 t604e default COMMUNITY'
+
+# 605a Test 'default' configuration
+CONFIGAGENT 'com2sec6 t605a default c605a'
+# 605b Test ip address configuration
+CONFIGAGENT 'com2sec6 t605b aa00:: c605b'
+# 605c Test valid numeric mask
+CONFIGAGENT 'com2sec6 t605c aa00::/8 c605c'
+# 605d Test invalid numeric mask (too big)
+CONFIGAGENT 'com2sec6 t605d aa00::/129 c605d'
+# 605e Test invalid numeric mask (negative)
+CONFIGAGENT 'com2sec6 t605e aa00::/-1 c605e'
+# 605f Test valid ip address mask
+CONFIGAGENT 'com2sec6 t605f aa00::/ff00:: c605f'
+# 605g Test invalid ip address mask
+CONFIGAGENT 'com2sec6 t605g aa00::/fffff:: c605g'
+# 605h Test invalid ip address mask
+CONFIGAGENT 'com2sec6 t605h aa00::/gg00:: c605h'
+# 605i Test address with 1 bits not covered by the mask
+CONFIGAGENT 'com2sec6 t605i aa00::/0ff0:: c605i'
+
+# 606a Test maximally long address/mask
+CONFIGAGENT 'com2sec6 t606a ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff c606a'
+
+# 607a Test non existant host name
+CONFIGAGENT 'com2sec6 t607a no.such.address. c607a'
+# 607b Test maximally long host name/mask
+CONFIGAGENT 'com2sec6 t607b a23456789012345678901234567890123456789012345678901234567890123.a23456789012345678901234567890123456789012345678901234567890123.a23456789012345678901234567890123456789012345678901234567890123.a234567890123456789012345678901234567890123456789012345678901./ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff c607b'
+
+# 608 Lookup tests, require network access
+# 608a Test lookup returning a single host
+CONFIGAGENT 'com2sec6 t608a www.ietf.org c608a'
+# 608b Test lookup returning multiple hosts
+CONFIGAGENT 'com2sec6 t608b ipv6.google.com c608b'
+
+# Default agent setup
+CONFIGAGENT "[snmp] persistentdir $SNMP_TMP_PERSISTENTDIR"
+# Dummy config to prevent the basic_setup warning
+CONFIGAGENT 'rocommunity public 127.0.0.0/8'
+
+AGENT_FLAGS='-Dnetsnmp_udp_parse_security,netsnmp_udp6_parse_security,netsnmp_unix_parse_security'
+
+STARTAGENT
+
+SAVECHECKAGENT() {
+ CHECKAGENT "$@"
+ if [ "x$return_value" != "x0" ] ; then
+ FINISHED
+ fi
+}
+
+# 601
+SAVECHECKAGENT 'line 1: Error: missing CONTEXT_NAME parameter'
+SAVECHECKAGENT 'line 2: Error: missing NAME parameter'
+SAVECHECKAGENT 'line 3: Error: context name too long'
+# 602
+CHECKAGENTCOUNT atleastone 'line 4: Error: Blank line following com2sec6 token.'
+SAVECHECKAGENT 'line 5: Error: empty NAME parameter'
+SAVECHECKAGENT 'line 6: Error: security name too long'
+SAVECHECKAGENT 'line 7: Error: missing NAME parameter'
+SAVECHECKAGENT 'line 8: Error: empty NAME parameter'
+# 603
+SAVECHECKAGENT 'line 9: Error: missing SOURCE parameter'
+SAVECHECKAGENT 'line 10: Error: empty SOURCE parameter'
+SAVECHECKAGENT 'line 11: Error: example config NETWORK not properly configured'
+# 604
+SAVECHECKAGENT 'line 12: Error: missing COMMUNITY parameter'
+SAVECHECKAGENT 'line 13: Error: empty COMMUNITY parameter'
+SAVECHECKAGENT 'line 14: Error: community name too long'
+SAVECHECKAGENT '<"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234", ::/::> => "t604d"'
+SAVECHECKAGENT 'line 16: Error: example config COMMUNITY not properly configured'
+# 605
+SAVECHECKAGENT '<"c605a", ::/::> => "t605a"'
+SAVECHECKAGENT '<"c605b", aa00::/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff> => "t605b"'
+SAVECHECKAGENT '<"c605c", aa00::/ff00::> => "t605c"'
+SAVECHECKAGENT 'line 20: Error: bad mask length'
+SAVECHECKAGENT 'line 21: Error: bad mask length'
+SAVECHECKAGENT '<"c605f", aa00::/ff00::> => "t605f"'
+SAVECHECKAGENT 'line 23: Error: bad mask'
+SAVECHECKAGENT 'line 24: Error: bad mask'
+SAVECHECKAGENT 'line 25: Error: source/mask mismatch'
+# 606
+SAVECHECKAGENT '<"c606a", ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff> => "t606a"'
+# 607
+SAVECHECKAGENT 'line 27: Error:'
+SAVECHECKAGENT 'line 28: Error:'
+
+# 608
+CHECKAGENT '<"c608a"'
+if [ "$snmp_last_test_result" -eq 0 ] ; then
+ CHECKAGENT 'line 29: Error:'
+ errnum=`expr $errnum - 1`
+ if [ "$snmp_last_test_result" -ne 1 ] ; then
+ FINISHED
+ fi
+elif [ "$snmp_last_test_result" -ne 1 ] ; then
+ FINISHED
+fi
+
+CHECKAGENTCOUNT atleastone '<"c608b"'
+if [ "$snmp_last_test_result" -eq 0 ] ; then
+ CHECKAGENT 'line 30: Error:'
+ if [ "$snmp_last_test_result" -eq 1 ] ; then
+ errnum=`expr $errnum - 1`
+ fi
+fi
+
+FINISHED
diff --git a/testing/fulltests/default/T072com2secunix_simple b/testing/fulltests/default/T072com2secunix_simple
new file mode 100644
index 0000000..a89de5d
--- /dev/null
+++ b/testing/fulltests/default/T072com2secunix_simple
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER com2secunix directive
+
+SKIPIFNOT NETSNMP_TRANSPORT_UNIX_DOMAIN
+SKIPIF NETSNMP_NO_DEBUGGING
+SKIPIFNOT SIZEOF_SOCKADDR_UN_SUN_PATH
+
+#
+# Prepare test
+#
+if [ `uname -s` = SunOS ]
+then AWK=nawk
+else AWK=awk
+fi
+
+sun_path_sized=`$AWK '/^#define SIZEOF_SOCKADDR_UN_SUN_PATH/ { res = "a"; for(n = 2; n < $3; ++n) { res = res substr("1234567890", n % 10, 1); } print res; }' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h`
+
+#
+# Begin test
+#
+
+# u01a Test missing CONTEXT
+CONFIGAGENT 'com2secunix -Cn'
+# u01a Test empty CONTEXT
+CONFIGAGENT 'com2secunix -Cn ""'
+# u01c Test overlong CONTEXT (34 chars)
+CONFIGAGENT 'com2secunix -Cn 1234567890123456789012345678901234'
+
+# u02a Test missing secName
+CONFIGAGENT 'com2secunix'
+# u02b Test empty secName
+CONFIGAGENT 'com2secunix ""'
+# u02c Test overlong secName (34 chars)
+CONFIGAGENT 'com2secunix 1234567890123456789012345678901234'
+# u02d Test valid context and missing secName
+CONFIGAGENT 'com2secunix -Cn 123456789012345678901234567890123'
+# u02e Test valid context and empty secName
+CONFIGAGENT 'com2secunix -Cn 123456789012345678901234567890123 ""'
+
+# u03a Test missing sockpath
+CONFIGAGENT 'com2secunix tu03a'
+# u03b Test empty sockpath
+CONFIGAGENT 'com2secunix tu03b ""'
+# u03c Test overlong sockpath (sizeof(sockaddr_un.sun_path) chars)
+CONFIGAGENT "com2secunix tu03c ${sun_path_sized}x"
+# u03d Test valid sockpath (sizeof(sockaddr_un.sun_path) - 1 chars)
+CONFIGAGENT "com2secunix tu03d ${sun_path_sized}"
+
+# u04a Test missing community
+CONFIGAGENT 'com2secunix tu04a default'
+# u04b Test empty community
+CONFIGAGENT 'com2secunix tu04b default ""'
+# u04c Test forbidden value (now why it is forbidden...)
+CONFIGAGENT 'com2secunix tu04c default COMMUNITY'
+# u04d Test overlong community (255 chars)
+CONFIGAGENT 'com2secunix tu04d default 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345'
+# u04e Test valid community
+CONFIGAGENT 'com2secunix tu04e default 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234'
+
+# u05a Test 'default' configuration
+CONFIGAGENT 'com2secunix tu05a default cu05a'
+
+# u07a Test non existant sockpath
+CONFIGAGENT 'com2secunix tu07a /dev/null/no/such cu07a'
+
+# Default agent setup
+CONFIGAGENT "[snmp] persistentdir $SNMP_TMP_PERSISTENTDIR"
+# Dummy config to prevent the basic_setup warning
+CONFIGAGENT 'rocommunity public 127.0.0.0/8'
+
+AGENT_FLAGS='-Dnetsnmp_udp_parse_security,netsnmp_udp6_parse_security,netsnmp_unix_parse_security'
+
+STARTAGENT
+
+SAVECHECKAGENT() {
+ CHECKAGENT "$@"
+ if [ "x$return_value" != "x0" ] ; then
+ FINISHED
+ fi
+}
+
+# u01
+SAVECHECKAGENT 'line 1: Error: missing CONTEXT_NAME parameter'
+SAVECHECKAGENT 'line 2: Error: missing NAME parameter'
+SAVECHECKAGENT 'line 3: Error: context name too long'
+# u02
+CHECKAGENTCOUNT atleastone 'line 4: Error: Blank line following com2secunix token.'
+SAVECHECKAGENT 'line 5: Error: empty NAME parameter'
+SAVECHECKAGENT 'line 6: Error: security name too long'
+SAVECHECKAGENT 'line 7: Error: missing NAME parameter'
+SAVECHECKAGENT 'line 8: Error: empty NAME parameter'
+# u03
+SAVECHECKAGENT 'line 9: Error: missing SOCKPATH parameter'
+SAVECHECKAGENT 'line 10: Error: empty SOCKPATH parameter'
+SAVECHECKAGENT 'line 11: Error: sockpath too long'
+SAVECHECKAGENT 'line 12: Error: missing COMMUNITY parameter'
+# u04
+SAVECHECKAGENT 'line 13: Error: missing COMMUNITY parameter'
+SAVECHECKAGENT 'line 14: Error: empty COMMUNITY parameter'
+SAVECHECKAGENT 'line 15: Error: example config COMMUNITY not properly configured'
+SAVECHECKAGENT 'line 16: Error: community name too long'
+SAVECHECKAGENT '<"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234", ""> => "tu04e"'
+# u05
+SAVECHECKAGENT '<"cu05a", ""> => "tu05a"'
+# u07
+SAVECHECKAGENT '<"cu07a", "/dev/null/no/such"> => "tu07a"'
+
+FINISHED
diff --git a/testing/fulltests/default/T100agenthup_simple b/testing/fulltests/default/T100agenthup_simple
new file mode 100755
index 0000000..d4949e1
--- /dev/null
+++ b/testing/fulltests/default/T100agenthup_simple
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER that the agent responds properly to a kill -HUP
+
+SKIPIF NETSNMP_DISABLE_SNMPV1
+
+SKIPIFNOT HAVE_SIGHUP
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcomunnity
+. ./Sv1config
+
+STARTAGENT
+
+# add a agent configuration line that wouldn't have been there when
+# the started up.
+CONFIGAGENT syslocation not-anywhere-in-particular
+
+# kill -HUP the agent to get it to re-read the .conf file.
+DELAY
+kill -HUP `cat $SNMP_SNMPD_PID_FILE` > /dev/null 2>&1
+DELAY
+
+# And see if it has the new value.
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.6.0"
+
+STOPAGENT
+
+CHECK "not-anywhere-in-particular"
+
+FINISHED
diff --git a/testing/fulltests/default/T110agentxget_simple b/testing/fulltests/default/T110agentxget_simple
new file mode 100644
index 0000000..2f91d36
--- /dev/null
+++ b/testing/fulltests/default/T110agentxget_simple
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER AgentX GET support
+
+SKIPIFNOT USING_AGENTX_MASTER_MODULE
+SKIPIFNOT USING_AGENTX_SUBAGENT_MODULE
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+. ./Sv3config
+
+# Start the agent without initializing the system mib.
+if [ "x$SNMP_TRANSPORT_SPEC" = "xunix" ];then
+ORIG_AGENT_FLAGS="$AGENT_FLAGS -x $SNMP_TMPDIR/agentx_socket"
+else
+ORIG_AGENT_FLAGS="$AGENT_FLAGS -x tcp:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT}"
+fi
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib,winExtDLL"
+STARTAGENT
+
+# test to see that the current agent doesn't support the system mib
+CAPTURE "snmpget -On $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object"
+
+if test "$snmp_last_test_result" = 1; then
+ # test the agentx subagent by first running it...
+
+ SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
+ SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
+ AGENT_FLAGS="$ORIG_AGENT_FLAGS -X -I system_mib"
+ SNMP_CONFIG_FILE="$SNMP_TMPDIR/bogus.conf"
+ STARTAGENT
+
+ # test to see that the agent now supports setting the system mib
+ CAPTURE "snmpget -On $SNMP_FLAGS -t 3 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+ CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+ # stop the subagent
+ STOPAGENT
+
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
+fi
+
+# stop the master agent
+STOPAGENT
+
+# all done (whew)
+FINISHED
diff --git a/testing/fulltests/default/T111agentxset_simple b/testing/fulltests/default/T111agentxset_simple
new file mode 100644
index 0000000..87939bd
--- /dev/null
+++ b/testing/fulltests/default/T111agentxset_simple
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER AgentX SET support
+
+SKIPIFNOT USING_AGENTX_MASTER_MODULE
+SKIPIFNOT USING_AGENTX_SUBAGENT_MODULE
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+. ./Sv3config
+
+# Start the agent without initializing the system mib.
+if [ "x$SNMP_TRANSPORT_SPEC" = "xunix" ];then
+ORIG_AGENT_FLAGS="$AGENT_FLAGS -x $SNMP_TMPDIR/agentx_socket"
+else
+ORIG_AGENT_FLAGS="$AGENT_FLAGS -x tcp:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT}"
+fi
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib,winExtDLL -DAgentX"
+STARTAGENT
+
+# test to see that the current agent doesn't support the system mib
+CAPTURE "snmpget -On -t 3 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+CHECK ".1.3.6.1.2.1.1.4.0 = No Such Object"
+
+if test "$snmp_last_test_result" = 1; then
+ # test the AgentX subagent by first running it...
+
+ SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
+ SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
+ AGENT_FLAGS="$ORIG_AGENT_FLAGS -X -I system_mib"
+ SNMP_CONFIG_FILE="$SNMP_TMPDIR/bogus.conf"
+ echo "psyscontact testcontact" >> $SNMP_CONFIG_FILE
+ STARTAGENT
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+ CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testcontact"
+
+ if test "$snmp_last_test_result" = 1; then
+
+ # test to see that the agent now supports setting the system mib
+ CAPTURE "snmpset -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 s newtestcontact"
+
+ CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*newtestcontact"
+
+ if test "$snmp_last_test_result" = 1; then
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+ CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*newtestcontact"
+ fi
+ fi
+
+ # stop the subagent
+ STOPAGENT
+
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
+fi
+
+# stop the master agent
+STOPAGENT
+
+# all done (whew)
+FINISHED
diff --git a/testing/fulltests/default/T112agentxsetfail_simple b/testing/fulltests/default/T112agentxsetfail_simple
new file mode 100644
index 0000000..d610b41
--- /dev/null
+++ b/testing/fulltests/default/T112agentxsetfail_simple
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER AgentX illegal SET handling support
+
+SKIPIFNOT USING_AGENTX_MASTER_MODULE
+SKIPIFNOT USING_AGENTX_SUBAGENT_MODULE
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+. ./Sv3config
+
+# Start the agent without initializing the system mib.
+if [ "x$SNMP_TRANSPORT_SPEC" = "xunix" ];then
+ORIG_AGENT_FLAGS="$AGENT_FLAGS -x $SNMP_TMPDIR/agentx_socket"
+else
+ORIG_AGENT_FLAGS="$AGENT_FLAGS -x tcp:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT}"
+fi
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib,winExtDLL -DAgentX"
+STARTAGENT
+
+# test to see that the current agent doesn't support the system mib
+CAPTURE "snmpget -On -t 3 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+CHECK ".1.3.6.1.2.1.1.4.0 = No Such Object"
+
+if test "$snmp_last_test_result" = 1; then
+ # test the AgentX subagent by first running it...
+
+ SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
+ SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
+ AGENT_FLAGS="$ORIG_AGENT_FLAGS -X -I system_mib"
+ SNMP_CONFIG_FILE="$SNMP_TMPDIR/bogus.conf"
+ STARTAGENT
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+ # we don't know the real value, unfortunately, so we test for what
+ # we should *not* get back.
+ CHECKCOUNT 0 ".1.3.6.1.2.1.1.4.0 = No Such Object"
+
+ if test "$snmp_last_test_result" = 0; then
+
+ # test to see that the agent now supports setting the system mib
+ CAPTURE "snmpset -On -Ir $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 i 4"
+
+ CHECK "wrongType"
+
+ fi
+
+ # stop the subagent
+ STOPAGENT
+
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
+fi
+
+# stop the master agent
+STOPAGENT
+
+# all done (whew)
+FINISHED
diff --git a/testing/fulltests/default/T113agentxtrap_simple b/testing/fulltests/default/T113agentxtrap_simple
new file mode 100644
index 0000000..4fa5e2f
--- /dev/null
+++ b/testing/fulltests/default/T113agentxtrap_simple
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER AgentX trap sending support
+
+SKIPIFNOT USING_AGENTX_MASTER_MODULE
+SKIPIFNOT USING_AGENTX_SUBAGENT_MODULE
+SKIPIFNOT USING_EXAMPLES_EXAMPLE_MODULE
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+#
+# Begin test
+#
+
+# start the trap demon
+CONFIGTRAPD authcommunity log public
+STARTTRAPD
+
+# standard V3 configuration for initial user
+. ./Sv3config
+# configure the trap receiver.
+CONFIGAGENT trapsink ${SNMP_TRANSPORT_SPEC}:${SNMP_TEST_DEST}${SNMP_SNMPTRAPD_PORT} public
+
+# Start the agent without initializing the example mib.
+if [ "x$SNMP_TRANSPORT_SPEC" = "xunix" ];then
+ORIG_AGENT_FLAGS="$AGENT_FLAGS -x $SNMP_TMPDIR/agentx_socket"
+else
+ORIG_AGENT_FLAGS="$AGENT_FLAGS -x tcp:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT}"
+fi
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -example"
+STARTAGENT
+
+# test to see that the current agent doesn't support the example mib
+CAPTURE "snmpget -On -t 3 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.2021.254.1.0"
+
+CHECK "No Such Object"
+
+if test "$snmp_last_test_result" = 1; then
+ # test the AgentX subagent by first running it...
+
+ SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
+ SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
+ AGENT_FLAGS="$ORIG_AGENT_FLAGS -X -I example -Dadd"
+ SNMP_CONFIG_FILE="$SNMP_TMPDIR/bogus.conf"
+
+ STARTAGENT
+
+ # test to see that the agent now supports the example mib
+ CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.2021.254.1.0"
+
+ CHECK "life the universe and everything"
+
+ if test "$snmp_last_test_result" = 1; then
+
+ # test to see that the agent now sends a trap from the exmaple mib
+ CAPTURE "snmpset -On -r 0 -t 3 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.2021.254.8.0 i 1"
+ DELAY
+ CHECKTRAPD "life the universe and everything"
+
+ fi
+
+ # stop the subagent
+ STOPAGENT
+
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
+fi
+
+# stop the master agent
+STOPAGENT
+
+# stop the trap demon
+STOPTRAPD
+
+# all done (whew)
+FINISHED
diff --git a/testing/fulltests/default/T114agentxagentxtrap_simple b/testing/fulltests/default/T114agentxagentxtrap_simple
new file mode 100644
index 0000000..58475d0
--- /dev/null
+++ b/testing/fulltests/default/T114agentxagentxtrap_simple
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER AgentX trap sending support using agentxtrap
+
+SKIPIFNOT USING_AGENTX_MASTER_MODULE
+SKIPIFNOT NETSNMP_SECMOD_USM
+
+#
+# Begin test
+#
+
+# start the trap demon
+CONFIGTRAPD authcommunity log public
+STARTTRAPD
+
+# standard V3 configuration for initial user
+. ./Sv3config
+# configure the trap receiver.
+CONFIGAGENT trap2sink ${SNMP_TRANSPORT_SPEC}:${SNMP_TEST_DEST}${SNMP_SNMPTRAPD_PORT} public
+
+# Start the agent
+if [ "x$SNMP_TRANSPORT_SPEC" = "xunix" ];then
+AGENTX_SERVER="-x $SNMP_TMPDIR/agentx_socket"
+else
+AGENTX_SERVER="-x tcp:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT}"
+fi
+AGENT_FLAGS="$AGENT_FLAGS $AGENTX_SERVER"
+STARTAGENT
+
+CAPTURE "agentxtrap $AGENTX_SERVER 0.0 0.0 s mostly_harmless"
+
+# stop the master agent
+STOPAGENT
+
+# stop the trap demon
+STOPTRAPD
+
+# Check that the trap was received
+CHECKTRAPD "= STRING: \"*mostly_harmless\"*"
+
+# all done (whew)
+FINISHED
diff --git a/testing/fulltests/default/T115agentxperl_simple b/testing/fulltests/default/T115agentxperl_simple
new file mode 100755
index 0000000..a44a202
--- /dev/null
+++ b/testing/fulltests/default/T115agentxperl_simple
@@ -0,0 +1,115 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER 'AgentX subagent in Perl (using NetSNMP::agent)'
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_AGENTX_MASTER_MODULE
+SKIPIFNOT USING_AGENTX_SUBAGENT_MODULE
+SKIPIFNOT HAVE_SIGHUP
+# make sure the toolkit has been configured --with-perl-modules
+[ -d ${SNMP_UPDIR}/perl/blib/arch/auto/NetSNMP/agent ] || SKIP
+
+#
+# Begin test
+#
+
+snmp_version=v2c
+TESTCOMMUNITY=testcommunity
+. ./Sv2cconfig
+
+TESTOID=.1.3.6.1.4.1.8872.9999.9999.1.0
+TESTOID2=.1.3.6.1.4.1.8872.9999.9999.2.0
+AGENTX_SOCKET=${SNMP_TMPDIR}/agentx_socket
+PERL_SUBAGENT=${SNMP_TMPDIR}/hello.pl
+PERL_SUBAGENT_CONF=${SNMP_TMPDIR}/hello.conf
+
+cat >$PERL_SUBAGENT <<END
+#!${SNMP_PERLPROG}
+# minimal AgentX subagent in Perl
+
+use blib qw(${SNMP_UPDIR}/perl);
+use NetSNMP::OID qw(:all);
+use NetSNMP::agent qw(:all);
+use NetSNMP::ASN qw(:all);
+use NetSNMP::agent::default_store;
+use NetSNMP::default_store qw(:all);
+use SNMP;
+
+## double-fork daemon
+my \$pid;
+unless (\$pid = fork) {
+ unless (fork) {
+ ## start main code
+ my \$regat = '.1.3.6.1.4.1.8872.9999.9999'; # netSnmpPlayPen
+ my \$myoid = \$regat . ".1.0"; # the "hello world" OID
+ my \$myoid2 = \$regat . ".2.0"; # the "hello again world" OID
+
+ my \$pidfile = shift; # take PID file as first argument
+ open(PIDFILE, ">\$pidfile") or die "Couldn't open \$pidfile";
+ print PIDFILE \$\$;
+ close(PIDFILE);
+
+sub my_snmp_handler {
+ my (\$handler, \$registration_info, \$request_info, \$requests) = @_;
+ for(my \$request = \$requests; \$request; \$request = \$request->next()) {
+ if (\$request_info->getMode() == MODE_GET) {
+ if (\$request->getOID() == new NetSNMP::OID(\$myoid)) {
+ \$request->setValue(ASN_OCTET_STR, "hello world");
+ last;
+ } elsif (\$request->getOID() == new NetSNMP::OID(\$myoid2)) {
+ \$request->setValue(ASN_OCTET_STR, "hello again world");
+ last;
+ }
+ }
+ }
+}
+sub shut_it_down { \$running = 0; }
+
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1);
+ my \$agent = new NetSNMP::agent('Name' => 'hello', 'AgentX' => 1);
+ my \$regoid = new NetSNMP::OID(\$regat);
+ \$agent->register("hello", \$regoid, \&my_snmp_handler);
+
+ \$SIG{'INT'} = \&shut_it_down;
+ \$SIG{'QUIT'} = \&shut_it_down;
+ \$running = 1;
+ while(\$running) {
+ \$agent->agent_check_and_process(1);
+ }
+ \$agent->shutdown();
+ ## end main code
+ exit 0;
+ }
+ exit 0;
+}
+waitpid(\$pid, 0);
+END
+
+echo "agentxsocket $AGENTX_SOCKET" > $PERL_SUBAGENT_CONF
+
+CONFIGAGENT master agentx
+CONFIGAGENT agentxsocket $AGENTX_SOCKET
+
+STARTAGENT
+
+# start perl subagent
+/usr/bin/env SNMPCONFPATH="${SNMP_TMPDIR}${SNMP_ENV_SEPARATOR}${SNMP_TMP_PERSISTENTDIR}" $SNMP_PERLPROG $PERL_SUBAGENT $SNMP_AGENTX_PID_FILE >$SNMP_AGENTX_LOG_FILE 2>&1
+DELAY
+
+## 1) SNMP GET against mib object implemented by the perl subagent
+CAPTURE "snmpget -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $TESTOID"
+CHECK "hello world"
+
+## 2) persistency: reconfigure master agent (HUP), re-test
+HUPAGENT
+CAPTURE "snmpget -$snmp_version -c $TESTCOMMUNITY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $TESTOID2"
+CHECK "hello again world"
+
+## stop
+STOPAGENT
+STOPPROG $SNMP_AGENTX_PID_FILE
+
+FINISHED
diff --git a/testing/fulltests/default/T120proxyget_simple b/testing/fulltests/default/T120proxyget_simple
new file mode 100644
index 0000000..12c58fd
--- /dev/null
+++ b/testing/fulltests/default/T120proxyget_simple
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER Proxy GET support
+
+SKIPIFNOT USING_UCD_SNMP_PROXY_MODULE
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+
+# XXX: ucd-snmp/proxy doesn't properly support TCP -- remove this once it does
+[ "x$SNMP_TRANSPORT_SPEC" = "xtcp" -o "x$SNMP_TRANSPORT_SPEC" = "xtcp6" ] && SKIP
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+. ./Sv3config
+# config the proxy
+CONFIGAGENT proxy -t 2 -r 1 -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT} .1.3.6.1.2.1.1
+
+# Start the agent without initializing the system mib.
+ORIG_AGENT_FLAGS="$AGENT_FLAGS"
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib,winExtDLL -Dproxy"
+STARTAGENT
+
+# test to see that the current agent doesn't support the system mib
+#CAPTURE "snmpget -On -t 3 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+#CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object"
+
+#if test "$snmp_last_test_result" = 1; then
+ # test the proxy subagent by first running it...
+
+ SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
+ SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
+ SNMP_CONFIG_FILE="$SNMP_TMPDIR/proxy.conf"
+ echo "rwcommunity testcommunity" >> $SNMP_CONFIG_FILE
+ if [ "$SNMP_TRANSPORT_SPEC" = "udp6" -o "$SNMP_TRANSPORT_SPEC" = "tcp6" ];then
+ echo "rwcommunity6 testcommunity" >> $SNMP_CONFIG_FILE
+ fi
+ AGENT_FLAGS=$ORIG_AGENT_FLAGS
+ ORIG_SNMP_SNMPD_PORT=$SNMP_SNMPD_PORT
+ SNMP_SNMPD_PORT="${SNMP_AGENTX_PORT}"
+ STARTAGENT
+ SNMP_SNMPD_PORT=$ORIG_SNMP_SNMPD_PORT
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+ CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+ # stop the subagent
+ STOPAGENT
+
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
+#fi
+
+# stop the master agent
+STOPAGENT
+
+# all done (whew)
+FINISHED
diff --git a/testing/fulltests/default/T121proxyset_simple b/testing/fulltests/default/T121proxyset_simple
new file mode 100644
index 0000000..977ddb9
--- /dev/null
+++ b/testing/fulltests/default/T121proxyset_simple
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER Proxy SET support
+
+SKIPIFNOT USING_UCD_SNMP_PROXY_MODULE
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
+
+# XXX: ucd-snmp/proxy doesn't properly support TCP -- remove this once it does
+[ "x$SNMP_TRANSPORT_SPEC" = "xtcp" -o "x$SNMP_TRANSPORT_SPEC" = "xtcp6" ] && SKIP
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+. ./Sv3config
+# config the proxy
+CONFIGAGENT proxy -t 2 -r 1 -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT} .1.3.6.1.2.1.1
+
+# Start the agent without initializing the system mib.
+ORIG_AGENT_FLAGS="$AGENT_FLAGS"
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib,winExtDLL -Dproxy"
+STARTAGENT
+
+# test to see that the current agent doesn't support the system mib
+#CAPTURE "snmpget -On -t 3 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+#CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object"
+
+#if test "$snmp_last_test_result" = 1; then
+ # test the proxy subagent by first running it...
+
+ SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
+ SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
+ SNMP_CONFIG_FILE="$SNMP_TMPDIR/proxy.conf"
+ echo "rwcommunity testcommunity" >> $SNMP_CONFIG_FILE
+ if [ "$SNMP_TRANSPORT_SPEC" = "udp6" -o "$SNMP_TRANSPORT_SPEC" = "tcp6" ];then
+ echo "rwcommunity6 testcommunity" >> $SNMP_CONFIG_FILE
+ fi
+ echo "psyscontact testcontact" >> $SNMP_CONFIG_FILE
+ AGENT_FLAGS="$ORIG_AGENT_FLAGS -Dmib_init"
+ ORIG_SNMP_SNMPD_PORT=$SNMP_SNMPD_PORT
+ SNMP_SNMPD_PORT="${SNMP_AGENTX_PORT}"
+ STARTAGENT
+ SNMP_SNMPD_PORT=$ORIG_SNMP_SNMPD_PORT
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+ CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testcontact"
+
+ if test "$snmp_last_test_result" = 1; then
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpset -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 s testnewcontact"
+
+ CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testnewcontact"
+
+ if test "$snmp_last_test_result" = 1; then
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+ CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testnewcontact"
+ fi
+ fi
+
+ # stop the subagent
+ STOPAGENT
+
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
+#fi
+
+# stop the master agent
+STOPAGENT
+
+# all done (whew)
+FINISHED
diff --git a/testing/fulltests/default/T122proxysetfail_simple b/testing/fulltests/default/T122proxysetfail_simple
new file mode 100644
index 0000000..7dad797
--- /dev/null
+++ b/testing/fulltests/default/T122proxysetfail_simple
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER Proxy illegal SET handling support
+
+SKIPIFNOT USING_UCD_SNMP_PROXY_MODULE
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
+
+# XXX: ucd-snmp/proxy doesn't properly support TCP -- remove this once it does
+[ "x$SNMP_TRANSPORT_SPEC" = "xtcp" ] && SKIP
+
+#
+# Begin test
+#
+
+# standard V3 configuration for initial user
+. ./Sv3config
+# config the proxy
+CONFIGAGENT proxy -t 2 -r 1 -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT} .1.3.6.1.2.1.1
+
+# Start the agent without initializing the system mib.
+ORIG_AGENT_FLAGS="$AGENT_FLAGS"
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib,winExtDLL -Dproxy"
+STARTAGENT
+
+# test to see that the current agent doesn't support the system mib
+#CAPTURE "snmpget -On -t 3 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+#CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object"
+
+#if test "$snmp_last_test_result" = 1; then
+ # test the proxy subagent by first running it...
+
+ SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
+ SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
+ SNMP_CONFIG_FILE="$SNMP_TMPDIR/proxy.conf"
+ echo "rwcommunity testcommunity" >> $SNMP_CONFIG_FILE
+ if [ "$SNMP_TRANSPORT_SPEC" = "udp6" -o "$SNMP_TRANSPORT_SPEC" = "tcp6" ];then
+ echo "rwcommunity6 testcommunity" >> $SNMP_CONFIG_FILE
+ fi
+# echo "syscontact testcontact" >> $SNMP_CONFIG_FILE
+ AGENT_FLAGS="$ORIG_AGENT_FLAGS -Dmib_init"
+ ORIG_SNMP_SNMPD_PORT=$SNMP_SNMPD_PORT
+ SNMP_SNMPD_PORT="${SNMP_AGENTX_PORT}"
+ STARTAGENT
+ SNMP_SNMPD_PORT=$ORIG_SNMP_SNMPD_PORT
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+
+ # we don't know the real value, unfortunately, so we test for what
+ # we should *not* get back.
+ CHECKCOUNT 0 ".1.3.6.1.2.1.1.4.0 = No Such Object"
+
+ if test "$snmp_last_test_result" = 0; then
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpset -On -Ir $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 i 42"
+
+ # 5.0.x snmpset shows error on single line
+ #CHECK ".1.3.6.1.2.1.1.4.0 = Wrong Type"
+ # 5.1.x snmpset shows error on multiple lines
+ CHECK "Reason: wrongType"
+ CHECK "Failed object: .1.3.6.1.2.1.1.4.0"
+
+ fi
+
+ # stop the subagent
+ STOPAGENT
+
+ SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
+ SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
+#fi
+
+# stop the master agent
+STOPAGENT
+
+# all done (whew)
+FINISHED
diff --git a/testing/fulltests/default/T130snmpv1vacmget_simple b/testing/fulltests/default/T130snmpv1vacmget_simple
new file mode 100644
index 0000000..80623f4
--- /dev/null
+++ b/testing/fulltests/default/T130snmpv1vacmget_simple
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv1 vacm acceptance support
+SKIPIF NETSNMP_DISABLE_SNMPV1
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity1 testcommunity2
+# testcommunity1 can access .1.3.6.1.2.1.1.1, others are denied
+# testcommunity2 can access all except .1.3.6.1.2.1.1.1
+# This case test for successful access
+snmp_version=v1
+. ./Svacmconfig
+
+AGENT_FLAGS="$AGENT_FLAGS -I-winExtDLL"
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity1 -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.1.0"
+
+CHECKORDIE ".1.3.6.1.2.1.1.1.0 = STRING:"
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity2 -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks: "
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T131snmpv2cvacmget_simple b/testing/fulltests/default/T131snmpv2cvacmget_simple
new file mode 100644
index 0000000..4f72370
--- /dev/null
+++ b/testing/fulltests/default/T131snmpv2cvacmget_simple
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2 vacm acceptance support
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+
+#
+# Begin test
+#
+
+
+# standard V1 configuration: testcommunity1 testcommunity2
+# testcommunity1 can access .1.3.6.1.2.1.1.1, others are denied
+# testcommunity2 can access all except .1.3.6.1.2.1.1.1
+# This case test for successful access
+
+snmp_version=v2c
+. ./Svacmconfig
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity1 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.1.0"
+
+CHECKORDIE ".1.3.6.1.2.1.1.1.0 = STRING:"
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity2 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks: "
+
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T132snmpv3vacmget_simple b/testing/fulltests/default/T132snmpv3vacmget_simple
new file mode 100644
index 0000000..004d0dd
--- /dev/null
+++ b/testing/fulltests/default/T132snmpv3vacmget_simple
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 vacm acceptance support
+
+#
+# Begin test
+#
+
+# Configuration:
+#initial1 can access .1.3.6.1.2.1.1.1, deny others
+#initial2 can access all except .1.3.6.1.2.1.1.1
+#This case test for successful access
+
+snmp_version=v3
+. ./Sv3vacmconfig
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -v3 -a MD5 -A initial_test_pass_auth -u initial1 -l anp $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.1.0"
+
+CHECKORDIE ".1.3.6.1.2.1.1.1.0 = STRING:"
+
+CAPTURE "snmpget -On $SNMP_FLAGS -v3 -a MD5 -A initial_test_pass_auth -u initial2 -l anp $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks: "
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T140snmpv1vacmgetfail_simple b/testing/fulltests/default/T140snmpv1vacmgetfail_simple
new file mode 100644
index 0000000..a47f94d
--- /dev/null
+++ b/testing/fulltests/default/T140snmpv1vacmgetfail_simple
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv1 vacm denial support
+
+SKIPIF NETSNMP_DISABLE_SNMPV1
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity1 testcommunity2
+# testcommunity1 can access .1.3.6.1.2.1.1.1, others are denied
+# testcommunity2 can access all except .1.3.6.1.2.1.1.1
+# This case test for denied access
+
+snmp_version=v1
+. ./Svacmconfig
+
+STARTAGENT
+
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity1 -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+CHECKORDIE "Reason: (noSuchName) There is no such variable name in this MIB."
+
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity2 -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.1.0"
+
+CHECKORDIE "Reason: (noSuchName) There is no such variable name in this MIB."
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T141snmpv2cvacmgetfail_simple b/testing/fulltests/default/T141snmpv2cvacmgetfail_simple
new file mode 100644
index 0000000..cd362aa
--- /dev/null
+++ b/testing/fulltests/default/T141snmpv2cvacmgetfail_simple
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2 vacm denial support
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
+SKIPIFNOT USING_MIBII_VACM_CONF_MODULE
+
+#
+# Begin test
+#
+
+
+# standard V1 configuration: testcommunity1 testcommunity2
+# testcommunity1 can access .1.3.6.1.2.1.1.1, others are denied
+# testcommunity2 can access all except .1.3.6.1.2.1.1.1
+# This case test for denied access
+
+snmp_version=v2c
+. ./Svacmconfig
+
+STARTAGENT
+
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity1 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = No Such Object available on this agent at this OID"
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity2 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.1.0"
+CHECKORDIE ".1.3.6.1.2.1.1.1.0 = No Such Object available on this agent at this OID"
+
+CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity1 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.5.0 s dummy"
+CHECKORDIE "Reason: noAccess"
+
+CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity2 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.5.0 s dummy"
+CHECKORDIE "Reason: noAccess"
+
+CAPTURE "snmpset -On $SNMP_FLAGS -c testrwcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.5.0 s dummy"
+CHECKORDIE ".1.3.6.1.2.1.1.5.0 = STRING: \"*dummy"
+
+CAPTURE "snmpset -On $SNMP_FLAGS -c testrocommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.5.0 s dummy"
+CHECKORDIE "Reason: noAccess"
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T142snmpv3vacmgetfail_simple b/testing/fulltests/default/T142snmpv3vacmgetfail_simple
new file mode 100644
index 0000000..cfc000b
--- /dev/null
+++ b/testing/fulltests/default/T142snmpv3vacmgetfail_simple
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv3 vacm denial support
+
+#
+# Begin test
+#
+
+# Configuration:
+#initial1 can access .1.3.6.1.2.1.1.1, deny others
+#initial2 can access all except .1.3.6.1.2.1.1.1
+#This case test for denied access
+
+snmp_version=v3
+. ./Sv3vacmconfig
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -v3 -a MD5 -A initial_test_pass_auth -u initial1 -l anp $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+CHECKORDIE ".1.3.6.1.2.1.1.3.0 = No Such Object available on this agent at this OID"
+
+
+CAPTURE "snmpget -On $SNMP_FLAGS -v3 -a MD5 -A initial_test_pass_auth -u initial2 -l anp $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.1.0"
+
+CHECKORDIE ".1.3.6.1.2.1.1.1.0 = No Such Object available on this agent at this OID"
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T150solarishostcpu_simple b/testing/fulltests/default/T150solarishostcpu_simple
new file mode 100644
index 0000000..4a3ee6a
--- /dev/null
+++ b/testing/fulltests/default/T150solarishostcpu_simple
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER 1st CPU on Solaris using HOST-RESOURCES
+
+if test "x`uname -s`" != "xSunOS" ; then
+ SKIP "not running solaris"
+fi
+
+SKIPIF NETSNMP_DISABLE_SNMPV1
+SKIPIFNOT USING_HOST_HR_DEVICE_MODULE
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity
+. ./Sv1config
+
+STARTAGENT
+
+# ask for the description of the first CPU in the system
+
+CAPTURE "snmpgetnext -On $SNMP_FLAGS -c testcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.25.3.2.1.3.767"
+
+CHECKORDIE ' = STRING: "*CPU '
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/default/T151solarishostdisk_simple b/testing/fulltests/default/T151solarishostdisk_simple
new file mode 100644
index 0000000..77a117f
--- /dev/null
+++ b/testing/fulltests/default/T151solarishostdisk_simple
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER initial load device on Solaris using HOST-RESOURCES
+
+if test `uname -s` != "SunOS" ; then
+ # a bogus skip for !suns
+ SKIP "not running solaris"
+fi
+
+SKIPIFNOT USING_HOST_HR_SYSTEM_MODULE
+SKIPIF NETSNMP_DISABLE_SNMPV1
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity
+. ./Sv1config
+
+STARTAGENT
+
+# ask for the index of the initial device (hrSystemInitialLoadDevice.0)
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.25.1.3.0"
+
+STOPAGENT
+
+CHECKORDIE "^.1.3.6.1.2.1.25.1.3.0 = INTEGER:"
+
+FINISHED
diff --git a/testing/fulltests/default/T152hostuptime_simple b/testing/fulltests/default/T152hostuptime_simple
new file mode 100644
index 0000000..4d62b35
--- /dev/null
+++ b/testing/fulltests/default/T152hostuptime_simple
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER uptime using HOST-RESOURCES
+
+SKIPIFNOT USING_HOST_HR_SYSTEM_MODULE
+
+SKIPIF NETSNMP_DISABLE_SNMPV1
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity
+. ./Sv1config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.25.1.1.0"
+
+STOPAGENT
+
+CHECKORDIE "^.1.3.6.1.2.1.25.1.1.0 = Timeticks:"
+
+FINISHED
+
diff --git a/testing/fulltests/default/T153solarisswap_simple b/testing/fulltests/default/T153solarisswap_simple
new file mode 100644
index 0000000..055dd45
--- /dev/null
+++ b/testing/fulltests/default/T153solarisswap_simple
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER swap on Solaris using HOST-RESOURCES
+
+if test `uname -s` != "SunOS" ; then
+ SKIP "not running solaris"
+fi
+
+ISDEFINED USING_HOST_HR_STORAGE_MODULE || ISDEFINED USING_HOST_HRH_STORAGE_MODULE || SKIP "Not using hrStorage"
+
+SKIPIF NETSNMP_DISABLE_SNMPV1
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity
+. ./Sv1config
+
+STARTAGENT
+
+# ask for hrStorageSize.10 which reports overall swap size
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 1 $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.25.2.3.1.5.10"
+
+STOPAGENT
+
+CHECKORDIE "^.1.3.6.1.2.1.25.2.3.1.5.10 = INTEGER:"
+
+FINISHED
diff --git a/testing/fulltests/default/T154dismanpingmib_simple b/testing/fulltests/default/T154dismanpingmib_simple
new file mode 100644
index 0000000..45cffe0
--- /dev/null
+++ b/testing/fulltests/default/T154dismanpingmib_simple
@@ -0,0 +1,116 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DISMAN PING MIB
+
+[ "$UID" = 0 ] || SKIP "Not permitted to create raw sockets"
+SKIPIFNOT USING_DISMAN_PING_MIB_MODULE
+SKIPIF NETSNMP_DISABLE_SNMPV1
+
+# SNMPv2-TC
+active=1
+createAndWait=5
+destroy=6
+# DISMAN-PING-MIB
+DISMAN_PING_MIB=.1.3.6.1.2.1.80.1
+pingCtlEntry=${DISMAN_PING_MIB}.2.1
+pingCtlTargetAddressType=${pingCtlEntry}.3
+pingCtlTargetAddresTypeIpv4=1
+pingCtlTargetAddress=${pingCtlEntry}.4
+pingCtlProbeCount=${pingCtlEntry}.7
+pingCtlAdminStatus=${pingCtlEntry}.8
+pingCtlAdminStatusEnabled=1
+pingCtlFrequency=${pingCtlEntry}.10
+pingCtlDescr=${pingCtlEntry}.17
+pingCtlRowStatus=${pingCtlEntry}.23
+pingResultsEntry=${DISMAN_PING_MIB}.3.1
+pingResultsProbeResponses=${pingResultsEntry}.7
+pingResultsSentProbes=${pingResultsEntry}.8
+# Test configuration
+TARGET_ADDRESS=127.0.0.1
+IDXPFX=8.78.101.116.45.83.78.77.80.6.84.49.53.52 # "Net-SNMP"."T154"
+IDXS="${IDXPFX}.95.49 ${IDXPFX}.95.50 ${IDXPFX}.95.51"
+PROBE_COUNT=5
+
+
+#
+# Begin test
+#
+
+# standard V1 configuration: testcommunity
+snmp_write_access='all'
+. ./Sv1config
+
+STARTAGENT
+
+for IDX in $IDXS; do
+
+CAPTURE "snmpset -One $SNMP_FLAGS -c testcommunity -v1 \
+ $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT \
+ $pingCtlRowStatus.$IDX i $destroy"
+
+CHECK "^$pingCtlRowStatus.$IDX = INTEGER: $destroy"
+
+CAPTURE "snmpset -One $SNMP_FLAGS -c testcommunity -v1 \
+ $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT \
+ $pingCtlRowStatus.$IDX i $createAndWait"
+
+CHECK "^$pingCtlRowStatus.$IDX = INTEGER: $createAndWait"
+
+CAPTURE "snmpset -One $SNMP_FLAGS -c testcommunity -v1 \
+ $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT \
+ $pingCtlTargetAddressType.$IDX i $pingCtlTargetAddresTypeIpv4 \
+ $pingCtlTargetAddress.$IDX s $TARGET_ADDRESS \
+ $pingCtlFrequency.$IDX u 1 \
+ $pingCtlDescr.$IDX s ScriptGenerated \
+ $pingCtlProbeCount.$IDX u ${PROBE_COUNT} \
+ $pingCtlAdminStatus.$IDX i $pingCtlAdminStatusEnabled"
+
+CHECK "^$pingCtlAdminStatus.$IDX = INTEGER: $pingCtlAdminStatusEnabled"
+
+CAPTURE "snmpset -One $SNMP_FLAGS -c testcommunity -v1 \
+ $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT \
+ $pingCtlRowStatus.$IDX i $active"
+
+CHECK "^$pingCtlRowStatus.$IDX = INTEGER: $active"
+
+done
+
+sleep ${PROBE_COUNT}
+sleep 2
+
+for IDX in $IDXS; do
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v1 \
+ $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT \
+ $pingResultsSentProbes.$IDX"
+
+CHECK "^$pingResultsSentProbes.$IDX = Gauge32: ${PROBE_COUNT}"
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v1 \
+ $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT \
+ $pingResultsProbeResponses.$IDX"
+
+CHECK "^$pingResultsProbeResponses.$IDX = Gauge32: ${PROBE_COUNT}"
+
+done
+
+# Delete first row and leave the remaining rows in the table.
+
+for IDX in $IDXS; do
+
+CAPTURE "snmpset -One $SNMP_FLAGS -c testcommunity -v1 \
+ $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT \
+ $pingCtlRowStatus.$IDX i $destroy"
+
+CHECK "^$pingCtlRowStatus.$IDX = INTEGER: $destroy"
+
+break
+
+done
+
+STOPAGENT
+
+
+FINISHED
diff --git a/testing/fulltests/default/T160snmpnetstat_simple b/testing/fulltests/default/T160snmpnetstat_simple
new file mode 100644
index 0000000..33159d2
--- /dev/null
+++ b/testing/fulltests/default/T160snmpnetstat_simple
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+# snmpnetstat test only works with UDP or TCP
+if [ "x$SNMP_TRANSPORT_SPEC" = "x" -o "x$SNMP_TRANSPORT_SPEC" = "xudp" ]; then
+ proto=udp
+ HEADER "if snmpnetstat finds the running agent in udpTable"
+ SKIPIFNOT USING_MIBII_UDPTABLE_MODULE
+elif [ "x$SNMP_TRANSPORT_SPEC" = "xtcp" ]; then
+ proto=tcp
+ HEADER "if snmpnetstat finds the running agent in tcpTable"
+ SKIPIFNOT USING_MIBII_TCPTABLE_MODULE
+else
+ HEADER "if snmpnetstat finds the running agent in udpTable/tcpTable"
+ SKIP
+fi
+
+# on some systems the agent needs to be run as root to access udpTable/tcpTable
+# - else force skip
+case "x`uname -s`" in
+ xAIX) [ "x`id -u`" != "x0" ] && SKIP;;
+ xHP-UX) [ "x`id -u`" != "x0" ] && SKIP;;
+ xIRIX*) [ "x`id -u`" != "x0" ] && SKIP;;
+ xNetBSD) [ "x`id -u`" != "x0" ] && SKIP;;
+ xOpenBSD) [ "x`id -u`" != "x0" ] && SKIP;;
+ xOSF1) [ "x`id -u`" != "x0" ] && SKIP;;
+esac
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+
+# make sure snmpnetstat can be executed
+SNMPNETSTAT="${SNMP_UPDIR}/apps/snmpnetstat/snmpnetstat"
+[ -x "$SNMPNETSTAT" ] || SKIP
+
+snmp_version=v2c
+. ./Sv2cconfig
+
+#
+# Begin test
+#
+
+STARTAGENT
+
+CAPTURE "$SNMPNETSTAT -Cn -Cp $proto -$snmp_version -c testcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT"
+CHECKEXACT "127.0.0.1.$SNMP_SNMPD_PORT"
+# multiple occurrences (especially in tcpTable) are fine
+if [ "$snmp_last_test_result" != 0 ] ; then
+ return_value=0
+else
+ return_value=1
+fi
+
+STOPAGENT
+FINISHED
diff --git a/testing/fulltests/default/T200snmpv2cwalkall_simple b/testing/fulltests/default/T200snmpv2cwalkall_simple
new file mode 100644
index 0000000..3bbc2ae
--- /dev/null
+++ b/testing/fulltests/default/T200snmpv2cwalkall_simple
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER "full snmpwalk (SNMPv2c) against agent (may take time)"
+
+if test `uname -s` = "HP-UX" ; then
+ if test `id -u` != "0" ; then
+ # The agent needs to be run as root - else force skip
+ SKIP
+ fi
+fi
+
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+
+# make sure snmpwalk can be executed
+SNMPWALK="${SNMP_UPDIR}/apps/snmpwalk"
+[ -x "$SNMPWALK" ] || SKIP
+
+snmp_version=v2c
+. ./Sv2cconfig
+
+#
+# Begin test
+#
+
+# higher timeout/retry values for safety
+TIMEOUT=10
+RETRY=5
+
+STARTAGENT
+
+CAPTURE "$SNMPWALK $SNMP_FLAGS -$snmp_version -c testcommunity -t $TIMEOUT -r $RETRY $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1"
+ISDEFINED USING_WINEXTDLL_MODULE || ISDEFINED USING_ETHERLIKE_MIB_DOT3STATSTABLE_MODULE || CHECKANDDIE "= Wrong Type (should be "
+CHECKORDIE "No more variables left in this MIB View"
+
+STOPAGENT
+FINISHED
diff --git a/testing/fulltests/perl/NetSNMPTestTransport.pm b/testing/fulltests/perl/NetSNMPTestTransport.pm
new file mode 100644
index 0000000..38bcfee
--- /dev/null
+++ b/testing/fulltests/perl/NetSNMPTestTransport.pm
@@ -0,0 +1,54 @@
+BEGIN {
+ if (exists($ENV{'srcdir'})) {
+ push @INC, "$ENV{'srcdir'}/testing/fulltests/support";
+ } elsif (-d "fulltests/support") {
+ push @INC, "fulltests/support";
+ } elsif (-d "../support") {
+ push @INC, "../support";
+ }
+}
+
+package NetSNMPTestTransport;
+
+use NetSNMPTest;
+use Test;
+use SNMP;
+
+our @ISA = qw(NetSNMPTest);
+
+sub run_tests {
+ my ($self) = @_;
+
+ plan(tests => 2);
+
+ # set it up with a snmpv3 USM user
+ $self->config_agent("createuser testuser MD5 notareallpassword");
+ $self->config_agent("rwuser testuser");
+ $self->config_agent("syscontact itworked");
+
+ $self->DIE("failed to start the agent") if (!$self->start_agent());
+
+ # now create a session to test things with
+ my $session = new SNMP::Session(DestHost => $self->{'agentaddress'},
+ Version => '3',
+ SecName => 'testuser',
+ SecLevel => 'authNoPriv',
+ AuthProto => 'MD5',
+ AuthPass => 'notareallpassword');
+
+ ok(ref($session), 'SNMP::Session', "created a session");
+
+ ######################################################################
+ # GET test
+ if (ref($session) eq 'SNMP::Session') {
+ $value = $session->get('sysContact.0');
+ ok($value, 'itworked');
+ }
+
+ ######################################################################
+ # cleanup
+ $self->stop_agent();
+}
+
+
+1;
diff --git a/testing/fulltests/perl/T001basic.t b/testing/fulltests/perl/T001basic.t
new file mode 100644
index 0000000..c7af105
--- /dev/null
+++ b/testing/fulltests/perl/T001basic.t
@@ -0,0 +1,93 @@
+#!/usr/bin/perl
+
+# HEADER Basic perl functionality to a UDP agent
+
+BEGIN {
+ if (exists($ENV{'srcdir'})) {
+ push @INC, "$ENV{'srcdir'}/testing/fulltests/support";
+ } elsif (-d "fulltests/support") {
+ push @INC, "fulltests/support";
+ } elsif (-d "../support") {
+ push @INC, "../support";
+ }
+}
+
+use NetSNMPTest;
+use Test;
+use SNMP;
+
+my $value;
+
+plan(tests => 10);
+
+ok(1,1,"started up");
+
+# use a basic UDP port
+my $destination = "udp:localhost:9897";
+
+my $test = new NetSNMPTest(agentaddress => $destination);
+
+# set it up with a snmpv3 USM user
+$test->config_agent("createuser testuser MD5 notareallpassword");
+$test->config_agent("rwuser testuser");
+$test->config_agent("syscontact itworked");
+
+$test->DIE("failed to start the agent") if (!$test->start_agent());
+
+# now create a session to test things with
+my $session = new SNMP::Session(DestHost => $destination,
+ Version => '3',
+ SecName => 'testuser',
+ SecLevel => 'authNoPriv',
+ AuthProto => 'MD5',
+ AuthPass => 'notareallpassword');
+
+ok(ref($session), 'SNMP::Session', "created a session");
+
+
+######################################################################
+# GET test
+$value = $session->get('sysContact.0');
+
+ok($value, 'itworked');
+
+######################################################################
+# GETNEXT test
+$value = $session->getnext('sysContact');
+
+ok($value, 'itworked');
+
+######################################################################
+# SET test
+$value = $session->get('sysLocation.0');
+
+ok($value ne 'yep', 1, 'Ensuring the sysLocation setting is not "yep"');
+
+my $varbind = new SNMP::Varbind(['sysLocation', '0', 'yep', 'OCTETSTR']);
+
+
+$value = $session->set($varbind);
+
+ok(($value == 0), 1, 'return value from set was a success');
+
+my $value = $session->get('sysLocation.0');
+
+ok($value, 'yep');
+
+######################################################################
+# GETBULK test
+$varbind = new SNMP::Varbind(['sysContact']);
+my @values = $session->getbulk(0, 3, $varbind);
+
+ok($#values == 2);
+ok($values[0] eq 'itworked');
+ok($values[2] eq 'yep');
+
+######################################################################
+# gettable() test
+
+
+
+######################################################################
+# cleanup
+$test->stop_agent();
diff --git a/testing/fulltests/perl/T101udp.t b/testing/fulltests/perl/T101udp.t
new file mode 100644
index 0000000..5f015d2
--- /dev/null
+++ b/testing/fulltests/perl/T101udp.t
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+# HEADER Perl UDP IPv4 Test
+
+BEGIN {
+ if (exists($ENV{'srcdir'})) {
+ push @INC, "$ENV{'srcdir'}/testing/fulltests/perl";
+ } elsif (-d "fulltests/perl") {
+ push @INC, "fulltests/perl";
+ } elsif (-d "../perl") {
+ push @INC, "../perl";
+ }
+}
+use NetSNMPTestTransport;
+
+my $test = new NetSNMPTestTransport(agentaddress => "udp:localhost:9875");
+$test->require_feature("NETSNMP_TRANSPORT_UDP_DOMAIN");
+$test->run_tests();
diff --git a/testing/fulltests/perl/T102tcp.t b/testing/fulltests/perl/T102tcp.t
new file mode 100644
index 0000000..2fa07ac
--- /dev/null
+++ b/testing/fulltests/perl/T102tcp.t
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+# HEADER Perl TCP IPv4 Test
+
+BEGIN {
+ if (exists($ENV{'srcdir'})) {
+ push @INC, "$ENV{'srcdir'}/testing/fulltests/perl";
+ } elsif (-d "fulltests/perl") {
+ push @INC, "fulltests/perl";
+ } elsif (-d "../perl") {
+ push @INC, "../perl";
+ }
+}
+use NetSNMPTestTransport;
+
+my $test = new NetSNMPTestTransport(agentaddress => "tcp:localhost:9875");
+$test->require_feature("NETSNMP_TRANSPORT_TCP_DOMAIN");
+$test->run_tests();
diff --git a/testing/fulltests/perl/T103udp6.t b/testing/fulltests/perl/T103udp6.t
new file mode 100644
index 0000000..3ecb332
--- /dev/null
+++ b/testing/fulltests/perl/T103udp6.t
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+# HEADER Perl UDP IPv6 Test
+
+BEGIN {
+ if (exists($ENV{'srcdir'})) {
+ push @INC, "$ENV{'srcdir'}/testing/fulltests/perl";
+ } elsif (-d "fulltests/perl") {
+ push @INC, "fulltests/perl";
+ } elsif (-d "../perl") {
+ push @INC, "../perl";
+ }
+}
+use NetSNMPTestTransport;
+
+my $test = new NetSNMPTestTransport(agentaddress => "udp6:[::1]:9875");
+$test->require_feature("NETSNMP_TRANSPORT_UDPIPV6_DOMAIN");
+$test->run_tests();
diff --git a/testing/fulltests/perl/T104tcp6.t b/testing/fulltests/perl/T104tcp6.t
new file mode 100644
index 0000000..58222d0
--- /dev/null
+++ b/testing/fulltests/perl/T104tcp6.t
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+# HEADER Perl TCP IPv6 Test
+
+BEGIN {
+ if (exists($ENV{'srcdir'})) {
+ push @INC, "$ENV{'srcdir'}/testing/fulltests/perl";
+ } elsif (-d "fulltests/perl") {
+ push @INC, "fulltests/perl";
+ } elsif (-d "../perl") {
+ push @INC, "../perl";
+ }
+}
+use NetSNMPTestTransport;
+
+my $test = new NetSNMPTestTransport(agentaddress => "tcp6:[::1]:9875");
+$test->require_feature("NETSNMP_TRANSPORT_TCPIPV6_DOMAIN");
+$test->run_tests();
diff --git a/testing/fulltests/perl/T105unix.t b/testing/fulltests/perl/T105unix.t
new file mode 100644
index 0000000..3c01719
--- /dev/null
+++ b/testing/fulltests/perl/T105unix.t
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+
+# HEADER Perl Unix Domain Socket Test
+
+BEGIN {
+ if (exists($ENV{'srcdir'})) {
+ push @INC, "$ENV{'srcdir'}/testing/fulltests/perl";
+ } elsif (-d "fulltests/perl") {
+ push @INC, "fulltests/perl";
+ } elsif (-d "../perl") {
+ push @INC, "../perl";
+ }
+}
+use NetSNMPTestTransport;
+
+my $test = new NetSNMPTestTransport(agentaddress => "bogus");
+$test->require_feature("NETSNMP_TRANSPORT_UNIX_DOMAIN");
+$test->{'agentaddress'} = "unix:" . $test->{'dir'} . "/unixtestsocket";
+$test->run_tests();
diff --git a/testing/fulltests/read-only/T0141snmpv2csetfail_simple b/testing/fulltests/read-only/T0141snmpv2csetfail_simple
new file mode 100644
index 0000000..9705f49
--- /dev/null
+++ b/testing/fulltests/read-only/T0141snmpv2csetfail_simple
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER SNMPv2c set failure to system.sysContact.0
+
+SKIPIFNOT NETSNMP_NO_WRITE_SUPPORT
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+#
+# Begin test
+#
+
+# standard V2C configuration: testcomunnity
+snmp_write_access='all'
+(cd ../default ; . ./Sv2cconfig)
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
+
+CHECK ".1.3.6.1.2.1.1.4.0 = STRING:"
+
+CAPTURE "snmpset -r 0 -t 1 -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 s foobartestingbaz"
+
+CHECK "Timeout: No Response"
+
+STOPAGENT
+
+CHECKAGENT 'Bad PDU type received'
+
+FINISHED
diff --git a/testing/fulltests/snmpv3/T010scapitest_capp.c b/testing/fulltests/snmpv3/T010scapitest_capp.c
new file mode 100644
index 0000000..ee794a7
--- /dev/null
+++ b/testing/fulltests/snmpv3/T010scapitest_capp.c
@@ -0,0 +1,459 @@
+/*
+ * scapitest.c
+ *
+ * HEADER Testing SCAPI API
+ *
+ * Expected SUCCESSes: 2 + 10 + 1 for all tests.
+ *
+ * Returns:
+ * Number of FAILUREs.
+ *
+ *
+ * ASSUMES No key management functions return non-zero success codes.
+ *
+ * XXX Split into individual modules?
+ * XXX Error/fringe conditions should be tested.
+ *
+ *
+ * Test of sc_random. SUCCESSes: 2.
+ * REQUIRES a human to spot check for obvious non-randomness...
+ *
+ * Test of sc_generate_keyed_hash and sc_check_keyed_hash. SUCCESSes: 10.
+ *
+ * Test of sc_encrypt and sc_decrypt. SUCCESSes: 1.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/keytools.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/transform_oids.h>
+#include <net-snmp/library/callback.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/library/snmpusm.h>
+
+#include <stdlib.h>
+
+extern char *optarg;
+extern int optind, optopt, opterr;
+
+#define DEBUG /* */
+
+
+
+/*
+ * Globals, &c...
+ */
+char *local_progname;
+int testcount=0;
+int failcount=0;
+
+#define USAGE "Usage: %s [-h][-acHr]"
+#define OPTIONLIST "achHr"
+
+int doalltests = 0, docrypt = 0, dokeyedhash = 0, dorandom = 0;
+
+#define ALLOPTIONS (doalltests + docrypt + dokeyedhash + dorandom)
+
+
+
+#define LOCAL_MAXBUF (1024 * 8)
+#define NL "\n"
+
+#define OUTPUT(o) printf("# %s\n", o);
+
+#define SUCCESS(s) \
+{ \
+ printf("# Done with %s\n", s); \
+}
+
+#define FAILED(e, f) \
+{ \
+ if (e != SNMPERR_SUCCESS) { \
+ printf("not ok: %d - %s\n", ++testcount, f); \
+ failcount += 1; \
+ } else { \
+ printf("ok: %d - %s\n", ++testcount, f); \
+ } \
+ fflush(stdout); \
+}
+
+#define BIGSTRING \
+ (const u_char *) \
+ " A port may be a pleasant retreat for any mind grown weary of" \
+ "the struggle for existence. The vast expanse of sky, the" \
+ "mobile architecture of the clouds, the chameleon coloration" \
+ "of the sea, the beacons flashing on the shore, together make" \
+ "a prism which is marvellously calculated to entertain but not" \
+ "fatigue the eye. The lofty ships with their complex webs of" \
+ "rigging, swayed to and fro by the swell in harmonious dance," \
+ "all help to maintain a taste for rhythm and beauty in the" \
+ "mind. And above all there is a mysterious, aristrocratic kind" \
+ "of pleasure to be had, for those who have lost all curiosity" \
+ "or ambition, as they strech on the belvedere or lean over the" \
+ "mole to watch the arrivals and departures of other men, those" \
+ "who still have sufficient strength of purpose in them, the" \
+ "urge to travel or enrich themselves." \
+ " -- Baudelaire" \
+ " From _The_Poems_in_Prose_, \"The Port\" (XLI)."
+
+#define BIGSECRET \
+ (const u_char *) \
+ "Shhhh... Don't tell *anyone* about this. Not a soul."
+#define BKWDSECRET \
+ (const u_char *) \
+ ".luos a toN .siht tuoba *enoyna* llet t'noD ...hhhhS"
+
+#define MLCOUNT_MAX 6 /* MAC Length Count Maximum. */
+
+
+
+/*
+ * Prototypes.
+ */
+void usage(void);
+
+int test_docrypt(void);
+int test_dokeyedhash(void);
+int test_dorandom(void);
+
+
+
+
+int
+main(int argc, char **argv)
+{
+ int rval = SNMPERR_SUCCESS;
+ char ch;
+
+ local_progname = argv[0];
+
+ /*
+ * Parse.
+ */
+ while ((ch = getopt(argc, argv, OPTIONLIST)) != EOF) {
+ switch (ch) {
+ case 'a':
+ doalltests = 1;
+ break;
+ case 'c':
+ docrypt = 1;
+ break;
+ case 'H':
+ dokeyedhash = 1;
+ break;
+ case 'r':
+ dorandom = 1;
+ break;
+ case 'h':
+ rval = 0;
+ default:
+ usage();
+ exit(rval);
+ }
+
+ argc -= 1;
+ argv += 1;
+ optind = 1;
+ } /* endwhile getopt */
+
+ if ((argc > 1)) {
+ usage();
+ exit(1000);
+
+ } else if (ALLOPTIONS != 1) {
+ doalltests = 1;
+ }
+
+
+ /*
+ * Test stuff.
+ */
+ rval = sc_init();
+ FAILED(rval, "sc_init() return code");
+
+
+ if (docrypt || doalltests) {
+ test_docrypt();
+ }
+ if (dokeyedhash || doalltests) {
+ test_dokeyedhash();
+ }
+ if (dorandom || doalltests) {
+ test_dorandom();
+ }
+
+ printf("1..%d\n", testcount);
+ return 0;
+} /* end main() */
+
+
+
+
+
+void
+usage(void)
+{
+ printf( USAGE
+ "" NL
+ " -a All tests." NL
+ " -c Test of sc_encrypt()/sc_decrypt()."
+ NL
+ " -h Help."
+ NL
+ " -H Test sc_{generate,check}_keyed_hash()."
+ NL
+ " -r Test sc_random()."
+ NL "" NL, local_progname);
+
+} /* end usage() */
+
+
+
+
+/*******************************************************************-o-******
+ * test_dorandom
+ *
+ * One large request, one set of short requests.
+ *
+ * Returns:
+ * Number of failures.
+ *
+ * XXX probably should split up into individual options.
+ */
+int
+test_dorandom(void)
+{
+ int rval = SNMPERR_SUCCESS,
+ origrequest = (1024 * 2),
+ origrequest_short = 19, shortcount = 7, i;
+ size_t nbytes = origrequest;
+ u_char buf[LOCAL_MAXBUF];
+
+ OUTPUT("Random test -- large request:");
+
+ rval = sc_random(buf, &nbytes);
+ FAILED(rval, "sc_random() return code");
+
+ if (nbytes != origrequest) {
+ FAILED(SNMPERR_GENERR,
+ "sc_random() returned different than requested.");
+ }
+
+ dump_chunk("scapitest", NULL, buf, nbytes);
+
+ SUCCESS("Random test -- large request.");
+
+
+ OUTPUT("Random test -- short requests:");
+ origrequest_short = 16;
+
+ for (i = 0; i < shortcount; i++) {
+ nbytes = origrequest_short;
+ rval = sc_random(buf, &nbytes);
+ FAILED(rval, "sc_random() return code");
+
+ if (nbytes != origrequest_short) {
+ FAILED(SNMPERR_GENERR,
+ "sc_random() returned different " "than requested.");
+ }
+
+ dump_chunk("scapitest", NULL, buf, nbytes);
+ } /* endfor */
+
+ SUCCESS("Random test -- short requests.");
+
+
+ return failcount;
+
+} /* end test_dorandom() */
+
+
+
+/*******************************************************************-o-******
+ * test_dokeyedhash
+ *
+ * Returns:
+ * Number of failures.
+ *
+ *
+ * Test keyed hashes with a variety of MAC length requests.
+ *
+ *
+ * NOTE Both tests intentionally use the same secret
+ *
+ * FIX Get input or output from some other package which hashes...
+ * XXX Could cut this in half with a little indirection...
+ */
+int
+test_dokeyedhash(void)
+{
+ int rval = SNMPERR_SUCCESS,
+ bigstring_len = strlen((const char *) BIGSTRING),
+ secret_len = strlen((const char *) BIGSECRET),
+ properlength,
+ mlcount = 0; /* MAC Length count. */
+ size_t hblen; /* Hash Buffer length. */
+
+ u_int hashbuf_len[MLCOUNT_MAX] = {
+ LOCAL_MAXBUF,
+ USM_MD5_AND_SHA_AUTH_LEN,
+ USM_MD5_AND_SHA_AUTH_LEN,
+ USM_MD5_AND_SHA_AUTH_LEN,
+ 7,
+ 0,
+ };
+
+ u_char hashbuf[LOCAL_MAXBUF];
+ char *s;
+
+ test_dokeyedhash_again:
+
+ OUTPUT("Starting Keyed hash test using MD5 --");
+
+ memset(hashbuf, 0, LOCAL_MAXBUF);
+ hblen = hashbuf_len[mlcount];
+ properlength = BYTESIZE(SNMP_TRANS_AUTHLEN_HMACMD5);
+
+ rval =
+ sc_generate_keyed_hash(usmHMACMD5AuthProtocol,
+ USM_LENGTH_OID_TRANSFORM, BIGSECRET,
+ secret_len, BIGSTRING,
+ bigstring_len,
+ hashbuf, &hblen);
+ FAILED(rval, "sc_generate_keyed_hash() return code");
+
+ if (hashbuf_len[mlcount] > properlength) {
+ if (hblen != properlength) {
+ FAILED(SNMPERR_GENERR, "Wrong MD5 hash length returned. (1)");
+ }
+
+ } else if (hblen != hashbuf_len[mlcount]) {
+ FAILED(SNMPERR_GENERR, "Wrong MD5 hash length returned. (2)");
+ }
+
+ rval =
+ sc_check_keyed_hash(usmHMACMD5AuthProtocol,
+ USM_LENGTH_OID_TRANSFORM, BIGSECRET,
+ secret_len, BIGSTRING, bigstring_len, hashbuf,
+ hblen);
+ FAILED(rval, "sc_check_keyed_hash() return code");
+
+ binary_to_hex(hashbuf, hblen, &s);
+ printf("# hash buffer (len=%" NETSNMP_PRIz "u, request=%d): %s\n",
+ hblen, hashbuf_len[mlcount], s);
+ SNMP_FREE(s);
+
+
+
+ OUTPUT("Starting Keyed hash test using SHA1 --");
+
+ memset(hashbuf, 0, LOCAL_MAXBUF);
+ hblen = hashbuf_len[mlcount];
+ properlength = BYTESIZE(SNMP_TRANS_AUTHLEN_HMACSHA1);
+
+ rval =
+ sc_generate_keyed_hash(usmHMACSHA1AuthProtocol,
+ USM_LENGTH_OID_TRANSFORM, BIGSECRET,
+ secret_len, BIGSTRING, bigstring_len,
+ hashbuf, &hblen);
+ FAILED(rval, "sc_generate_keyed_hash() return code");
+
+ if (hashbuf_len[mlcount] > properlength) {
+ if (hblen != properlength) {
+ FAILED(SNMPERR_GENERR,
+ "Wrong SHA1 hash length returned. (1)");
+ }
+
+ } else if (hblen != hashbuf_len[mlcount]) {
+ FAILED(SNMPERR_GENERR, "Wrong SHA1 hash length returned. (2)");
+ }
+
+ rval =
+ sc_check_keyed_hash(usmHMACSHA1AuthProtocol,
+ USM_LENGTH_OID_TRANSFORM, BIGSECRET,
+ secret_len, BIGSTRING, bigstring_len, hashbuf,
+ hblen);
+ FAILED(rval, "sc_check_keyed_hash() return code");
+
+ binary_to_hex(hashbuf, hblen, &s);
+ printf("# hash buffer (len=%" NETSNMP_PRIz "u, request=%d): %s\n",
+ hblen, hashbuf_len[mlcount], s);
+ SNMP_FREE(s);
+
+ SUCCESS("Keyed hash test using SHA1.");
+
+ /*
+ * Run the basic hash tests but vary the size MAC requests.
+ */
+ if (hashbuf_len[++mlcount] != 0) {
+ goto test_dokeyedhash_again;
+ }
+
+
+ return failcount;
+
+} /* end test_dokeyedhash() */
+
+
+
+
+
+/*******************************************************************-o-******
+ * test_docrypt
+ *
+ * Returns:
+ * Number of failures.
+ */
+int
+test_docrypt(void)
+{
+ int rval = SNMPERR_SUCCESS,
+ bigstring_len = strlen((const char *) BIGSTRING),
+ secret_len = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES),
+ iv_len = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES_IV);
+
+ size_t buf_len = LOCAL_MAXBUF;
+ size_t cryptbuf_len = LOCAL_MAXBUF;
+
+ u_char buf[LOCAL_MAXBUF],
+ cryptbuf[LOCAL_MAXBUF], secret[LOCAL_MAXBUF], iv[LOCAL_MAXBUF];
+
+ OUTPUT("Starting Test 1DES-CBC --");
+
+
+ memset(buf, 0, LOCAL_MAXBUF);
+
+ memcpy(secret, BIGSECRET, secret_len);
+ memcpy(iv, BKWDSECRET, iv_len);
+
+ rval = sc_encrypt(usmDESPrivProtocol, USM_LENGTH_OID_TRANSFORM,
+ secret, secret_len,
+ iv, iv_len,
+ BIGSTRING, bigstring_len, cryptbuf, &cryptbuf_len);
+ FAILED(rval, "sc_encrypt() return code.");
+
+ rval = sc_decrypt(usmDESPrivProtocol, USM_LENGTH_OID_TRANSFORM,
+ secret, secret_len,
+ iv, iv_len, cryptbuf, cryptbuf_len, buf, &buf_len);
+ FAILED(rval, "sc_decrypt() return code.");
+
+ /* ignore the pad */
+ buf_len -= buf[buf_len-1];
+
+ FAILED((buf_len != bigstring_len), "Decrypted buffer is the right length.");
+ printf("# original length: %d\n", bigstring_len);
+ printf("# output length: %" NETSNMP_PRIz "u\n", buf_len);
+
+ FAILED((memcmp(buf, BIGSTRING, bigstring_len) != 0),
+ "Decrypted buffer is the same as the original plaintext.");
+ return failcount;
+} /* end test_docrypt() */
diff --git a/testing/fulltests/snmpv3/T020hashtests_capp.c b/testing/fulltests/snmpv3/T020hashtests_capp.c
new file mode 100644
index 0000000..9cb5b47
--- /dev/null
+++ b/testing/fulltests/snmpv3/T020hashtests_capp.c
@@ -0,0 +1,117 @@
+/* HEADER testing SCAPI hashing functions */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <stdio.h>
+
+void print_hash(const char *label, u_char *MAC, size_t MAC_LEN);
+
+
+int
+main(int argc, char **argv) {
+ u_char buf[] = "wes hardaker";
+ u_char MAC[20];
+ size_t MAC_LEN = 20;
+ u_char sha1key[20] = "55555555555555555555";
+ u_char md5key[16] = "5555555555555555";
+
+ u_char sha1proper[20] = { 0x4a, 0x55, 0x2f, 0x65, 0x79, 0x3a, 0x49, 0x35,
+ 0x37, 0x91, 0x51, 0x1d,
+ 0xa0, 0x8c, 0x7a, 0x45, 0x50, 0x34, 0xd4, 0x23};
+ u_char md5proper[16] = { 0xe5, 0x92, 0xfa, 0x4b, 0x06, 0xe6, 0x27, 0xd7,
+ 0xc8, 0x18, 0xfa, 0x7a,
+ 0xd0, 0x82, 0xeb, 0x66};
+ int result;
+
+ printf("1..2\n");
+
+ memset(MAC, 0, MAC_LEN);
+ sc_hash(usmHMACSHA1AuthProtocol, OID_LENGTH(usmHMACSHA1AuthProtocol),
+ buf, sizeof(buf)-1,
+ MAC, &MAC_LEN);
+
+ print_hash("sha1 hash", MAC, MAC_LEN);
+
+ memset(MAC, 0, MAC_LEN);
+ sc_hash(usmHMACMD5AuthProtocol, OID_LENGTH(usmHMACMD5AuthProtocol),
+ buf, sizeof(buf)-1,
+ MAC, &MAC_LEN);
+
+ print_hash("md5 hash", MAC, MAC_LEN);
+
+ MAC_LEN = 20;
+ sc_generate_keyed_hash(usmHMACSHA1AuthProtocol,
+ OID_LENGTH(usmHMACSHA1AuthProtocol),
+ sha1key, sizeof(sha1key),
+ buf, sizeof(buf)-1,
+ MAC, &MAC_LEN);
+
+ print_hash("sha1 keyed", MAC, MAC_LEN);
+
+ result =
+ sc_check_keyed_hash(usmHMACSHA1AuthProtocol,
+ OID_LENGTH(usmHMACSHA1AuthProtocol),
+ sha1key, sizeof(sha1key),
+ buf, sizeof(buf)-1,
+ sha1proper, 12);
+ if (0 == result) {
+ printf("ok: 1 - sha1 keyed compare was equal\n");
+ } else {
+ printf("not ok: 1 - sha1 keyed compare was not equal\n");
+ }
+
+
+ MAC_LEN = 16;
+ sc_generate_keyed_hash(usmHMACMD5AuthProtocol,
+ OID_LENGTH(usmHMACMD5AuthProtocol),
+ md5key, sizeof(md5key),
+ buf, sizeof(buf)-1,
+ MAC, &MAC_LEN);
+
+ print_hash("md5 keyed", MAC, MAC_LEN);
+
+
+ MAC_LEN = 16;
+ result =
+ sc_check_keyed_hash(usmHMACMD5AuthProtocol,
+ OID_LENGTH(usmHMACMD5AuthProtocol),
+ md5key, sizeof(md5key),
+ buf, sizeof(buf)-1,
+ md5proper, 12);
+
+ if (0 == result) {
+ printf("ok: 2 - md5 keyed compare was equal\n");
+ } else {
+ printf("not ok: 2 - md5 keyed compare was not equal\n");
+ }
+
+ MAC_LEN = 20;
+ memset(MAC, 0, MAC_LEN);
+ generate_Ku(usmHMACSHA1AuthProtocol,
+ OID_LENGTH(usmHMACSHA1AuthProtocol),
+ buf, sizeof(buf)-1,
+ MAC, &MAC_LEN);
+ print_hash("sha1 Ku", MAC, MAC_LEN);
+
+ MAC_LEN = 16;
+ memset(MAC, 0, MAC_LEN);
+ generate_Ku(usmHMACMD5AuthProtocol,
+ OID_LENGTH(usmHMACMD5AuthProtocol),
+ buf, sizeof(buf)-1,
+ MAC, &MAC_LEN);
+ print_hash("md5 Ku", MAC, MAC_LEN);
+
+ /* XXX: todo: compare results and ensure they're always the same
+ values; the algorithms aren't time-dependent. */
+ return (0);
+}
+
+void
+print_hash(const char *label, u_char *MAC, size_t MAC_LEN) {
+ int i;
+ printf("# %-10s %" NETSNMP_PRIz "u:\n", label, MAC_LEN);
+ for(i=0; i < MAC_LEN; i++) {
+ printf("# %02x ", MAC[i]);
+ }
+ printf("\n");
+}
diff --git a/testing/fulltests/snmpv3/T040keymanagetest_capp.c b/testing/fulltests/snmpv3/T040keymanagetest_capp.c
new file mode 100644
index 0000000..d68f663
--- /dev/null
+++ b/testing/fulltests/snmpv3/T040keymanagetest_capp.c
@@ -0,0 +1,636 @@
+/*
+ * keymanagetest.c
+ *
+ * HEADER Testing key management API functionality
+ *
+ * Expected SUCCESSes: 2 + 2 + 3 for all tests.
+ *
+ * Returns:
+ * Number of FAILUREs.
+ *
+ *
+ * FIX Or how about passing a usmUser name and looking up the entry as
+ * a means of getting key material? This means the userList is
+ * available from an application...
+ *
+ * ASSUMES No key management functions return non-zero success codes.
+ *
+ * Test of generate_Ku(). SUCCESSes: 2
+ * Test of generate_kul(). SUCCESSes: 2
+ * Test of {encode,decode}_keychange(). SUCCESSes: 3
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <unistd.h>
+#include <ctype.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/keytools.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/transform_oids.h>
+#include <net-snmp/library/callback.h>
+
+#include <stdlib.h>
+
+extern char *optarg;
+extern int optind, optopt, opterr;
+
+int testcount = 0;
+
+/*
+ * Globals, &c...
+ */
+char *local_progname;
+
+#define USAGE "Usage: %s [-h][-aklu][-E <engineID>][-N <newkey>][-O <oldkey>][-P <passphrase>]"
+#define OPTIONLIST "aqE:hklN:O:P:u"
+
+int doalltests = 0, dogenKu = 0, dogenkul = 0, dokeychange = 0;
+
+#define ALLOPTIONS (doalltests + dogenKu + dogenkul + dokeychange)
+
+
+#define LOCAL_MAXBUF (1024 * 8)
+#define NL "\n"
+
+#define OUTPUTALWAYS(o) fprintf(stdout, "# %s\n", o);
+#define OUTPUT(o) if (!bequiet) { OUTPUTALWAYS(o); }
+
+#define SUCCESS(s) \
+{ \
+ fprintf(stdout, "# Done with %s\n", s); \
+}
+
+#define FAILED(e, f) \
+{ \
+ if ((e) != SNMPERR_SUCCESS) { \
+ fprintf(stdout, "not ok: %d - %s\n", ++testcount, f); \
+ failcount += 1; \
+ } else { \
+ fprintf(stdout, "ok: %d - %s\n", ++testcount, f); \
+ } \
+ fflush(stdout); \
+}
+
+#define DETAILINT(s, i) \
+ fprintf(stdout, "# %s: %d\n", s, i);
+
+/*
+ * Test specific globals.
+ */
+#define ENGINEID_DEFAULT "1.2.3.4wild"
+#define PASSPHRASE_DEFAULT "Clay's Conclusion: Creativity is great, " \
+ "but plagiarism is faster."
+#define OLDKEY_DEFAULT "This is a very old key."
+#define NEWKEY_DEFAULT "This key, on the other hand, is very new."
+
+u_char *engineID = NULL;
+char *passphrase = NULL;
+const u_char *oldkey = NULL;
+const u_char *newkey = NULL;
+int bequiet = 0;
+
+
+/*
+ * Prototypes.
+ */
+void usage(FILE * ofp);
+
+int test_genkul(void);
+int test_genKu(void);
+int test_keychange(void);
+
+
+
+
+int
+main(int argc, char **argv)
+{
+ int rval = SNMPERR_SUCCESS, failcount = 0;
+ char ch;
+
+ local_progname = argv[0];
+ optarg = NULL;
+
+ /*
+ * Parse.
+ */
+ while ((ch = getopt(argc, argv, OPTIONLIST)) != EOF) {
+ switch (ch) {
+ case 'a':
+ doalltests = 1;
+ break;
+ case 'E':
+ engineID = (u_char *) optarg;
+ break;
+ case 'k':
+ dokeychange = 1;
+ break;
+ case 'l':
+ dogenkul = 1;
+ break;
+ case 'N':
+ newkey = (u_char *) optarg;
+ break;
+ case 'O':
+ oldkey = (u_char *) optarg;
+ break;
+ case 'P':
+ passphrase = optarg;
+ break;
+ case 'u':
+ dogenKu = 1;
+ break;
+ case 'q':
+ bequiet = 1;
+ break;
+ case 'h':
+ rval = 0;
+ default:
+ usage(stdout);
+ exit(rval);
+ }
+
+ argc -= 1;
+ argv += 1;
+ if (optarg) {
+ argc -= 1;
+ argv += 1;
+ }
+
+ optind = 1;
+ optarg = NULL;
+ } /* endwhile getopt */
+
+ if ((argc > 1)) {
+ usage(stdout);
+ exit(1000);
+
+ } else if (ALLOPTIONS != 1) {
+ doalltests = 1;
+ }
+
+
+ /*
+ * Test stuff.
+ */
+ rval = sc_init();
+ FAILED(rval, "sc_init().");
+
+ if (dogenKu || doalltests) {
+ failcount += test_genKu();
+ }
+ if (dogenkul || doalltests) {
+ failcount += test_genkul();
+ }
+ if (dokeychange || doalltests) {
+ failcount += test_keychange();
+ }
+
+ fprintf(stdout, "1..%d\n", testcount);
+ return failcount;
+
+} /* end main() */
+
+
+
+
+
+void
+usage(FILE * ofp)
+{
+ fprintf(ofp,
+ USAGE
+ "" NL
+ " -a All tests." NL
+ " -E [0x]<engineID> snmpEngineID string."
+ NL
+ " -k Test {encode,decode}_keychange()."
+ NL
+ " -l generate_kul()."
+ NL
+ " -h Help."
+ NL
+ " -N [0x]<newkey> New key (for testing KeyChange TC)."
+ NL
+ " -O [0x]<oldkey> Old key (for testing KeyChange TC)."
+ NL
+ " -P <passphrase> Source string for usmUser master key."
+ NL
+ " -u generate_Ku()."
+ NL
+ " -q be quiet."
+ NL "" NL, local_progname);
+
+} /* end usage() */
+
+
+
+
+#ifdef EXAMPLE
+/*******************************************************************-o-******
+ * test_dosomething
+ *
+ * Test template.
+ *
+ * Returns:
+ * Number of failures.
+ */
+int
+test_dosomething(void)
+{
+ int rval = SNMPERR_SUCCESS, failcount = 0;
+
+ EM0(1, "UNIMPLEMENTED"); /* EM(1); */
+
+ test_dosomething_quit:
+ return failcount;
+
+} /* end test_dosomething() */
+#endif /* EXAMPLE */
+
+
+
+/*******************************************************************-o-******
+ * test_genKu
+ *
+ * Returns:
+ * Number of failures.
+ *
+ *
+ * Test generation of usmUser master key from a passphrase.
+ *
+ * ASSUMES Passphrase is made of printable characters!
+ */
+int
+test_genKu(void)
+{
+ int rval = SNMPERR_SUCCESS,
+ failcount = 0,
+ properlength = BYTESIZE(SNMP_TRANS_AUTHLEN_HMACMD5);
+ size_t kulen;
+ const char *hashname = "usmHMACMD5AuthProtocol.";
+ char *s;
+ u_char Ku[LOCAL_MAXBUF];
+ oid *hashtype = usmHMACMD5AuthProtocol;
+
+ OUTPUT("Test of generate_Ku --");
+
+ /*
+ * Set passphrase.
+ */
+ if (!passphrase) {
+ passphrase = strdup(PASSPHRASE_DEFAULT);
+ }
+ if (!bequiet)
+ fprintf(stdout, "Passphrase%s: %s\n",
+ (strcmp(passphrase, PASSPHRASE_DEFAULT) == 0) ? " (default)" : "",
+ passphrase);
+
+
+ test_genKu_again:
+ memset(Ku, 0, LOCAL_MAXBUF);
+ kulen = LOCAL_MAXBUF;
+
+ rval = generate_Ku(hashtype, USM_LENGTH_OID_TRANSFORM,
+ (const u_char *) passphrase, strlen(passphrase),
+ Ku, &kulen);
+ FAILED(rval, "generate_Ku().");
+
+ FAILED((kulen != properlength),
+ "Ku length is the right length for this hashtype.");
+
+ binary_to_hex(Ku, kulen, &s);
+ if (!bequiet)
+ fprintf(stdout, "# Ku (len=%" NETSNMP_PRIz "u): %s\n", kulen, s);
+ free_zero(s, kulen);
+
+ OUTPUT(hashname);
+
+ if (hashtype == usmHMACMD5AuthProtocol) {
+ hashtype = usmHMACSHA1AuthProtocol;
+ hashname = "usmHMACSHA1AuthProtocol.";
+ properlength = BYTESIZE(SNMP_TRANS_AUTHLEN_HMACSHA1);
+ goto test_genKu_again;
+ }
+
+ return failcount;
+
+} /* end test_genKu() */
+
+
+
+
+/*******************************************************************-o-******
+ * test_genkul
+ *
+ * Returns:
+ * Number of failures.
+ *
+ *
+ * Test of generate_kul().
+ *
+ * A passphrase and engineID are hashed into a master key Ku using
+ * both known hash transforms. Localized keys, also using both hash
+ * transforms, are generated from each of these master keys.
+ *
+ * ASSUME generate_Ku is already tested.
+ * ASSUME engineID is initially a NULL terminated string.
+ */
+int
+test_genkul(void)
+{
+ int rval = SNMPERR_SUCCESS,
+ failcount = 0,
+ properlength, engineID_len, isdefault = FALSE;
+
+ size_t kulen, kul_len;
+ char *s = NULL;
+ const char *testname = "Using HMACMD5 to create master key.";
+ const char *hashname_Ku = "usmHMACMD5AuthProtocol";
+
+ u_char Ku[LOCAL_MAXBUF], kul[LOCAL_MAXBUF];
+
+ oid *hashtype_Ku = usmHMACMD5AuthProtocol, *hashtype_kul;
+
+ OUTPUT("Test of generate_kul --");
+
+ /*
+ * Set passphrase and engineID.
+ *
+ * If engineID begins with 0x, assume it is written in (printable)
+ * hex and convert it to binary data.
+ */
+ if (!passphrase) {
+ passphrase = strdup(PASSPHRASE_DEFAULT);
+ }
+ if (!bequiet)
+ fprintf(stdout, "# Passphrase%s: %s\n",
+ (strcmp(passphrase, PASSPHRASE_DEFAULT) == 0) ? " (default)" : "",
+ passphrase);
+
+ if (!engineID) {
+ engineID = (u_char *) strdup(ENGINEID_DEFAULT);
+ isdefault = TRUE;
+ }
+
+ engineID_len = strlen((char *) engineID);
+
+ if (tolower(*(engineID + 1)) == 'x') {
+ engineID_len =
+ hex_to_binary2(engineID + 2, engineID_len - 2, &s);
+ FAILED((engineID_len < 0),
+ "Could not resolve hex engineID.");
+ engineID = (u_char *) s;
+ binary_to_hex(engineID, engineID_len, &s);
+ }
+
+ if (!bequiet)
+ fprintf(stdout, "# engineID%s (len=%d): %s\n",
+ (isdefault) ? " (default)" : "",
+ engineID_len, ((s != 0) ? ((u_char *) s) : engineID));
+ SNMP_FREE(s);
+
+
+
+ /*
+ * Create a master key using both hash transforms; create localized
+ * keys using both hash transforms from each master key.
+ */
+ test_genkul_again_master:
+ memset(Ku, 0, LOCAL_MAXBUF);
+ kulen = LOCAL_MAXBUF;
+ hashtype_kul = usmHMACMD5AuthProtocol;
+ properlength = BYTESIZE(SNMP_TRANS_AUTHLEN_HMACMD5);
+
+
+ rval = generate_Ku(hashtype_Ku, USM_LENGTH_OID_TRANSFORM,
+ (u_char *) passphrase, strlen(passphrase), Ku, &kulen);
+ FAILED(rval, "generate_Ku().");
+
+ binary_to_hex(Ku, kulen, &s);
+ if (!bequiet)
+ fprintf(stdout,
+ "# Master Ku using \"%s\": \t%s\n", hashname_Ku, s);
+ free_zero(s, kulen);
+
+
+ test_genkul_again_local:
+ memset(kul, 0, LOCAL_MAXBUF);
+ kul_len = LOCAL_MAXBUF;
+
+ rval = generate_kul(hashtype_kul, USM_LENGTH_OID_TRANSFORM,
+ engineID, engineID_len, Ku, kulen, kul, &kul_len);
+
+ if ((hashtype_Ku == usmHMACMD5AuthProtocol)
+ && (hashtype_kul == usmHMACSHA1AuthProtocol)) {
+ FAILED((rval == SNMPERR_SUCCESS),
+ "generate_kul SHOULD fail when Ku length is "
+ "less than hash transform length.");
+ } else {
+ FAILED(rval, "generate_kul().");
+
+ FAILED(kul_len != properlength,
+ "checking if kul length is right for the given hashtype.");
+
+ binary_to_hex(kul, kul_len, &s);
+ fprintf(stdout, "# kul (%s) (len=%" NETSNMP_PRIz "u): %s\n",
+ ((hashtype_Ku == usmHMACMD5AuthProtocol) ? "MD5" : "SHA"),
+ kul_len, s);
+ free_zero(s, kul_len);
+ }
+
+
+ /*
+ * Create localized key using the other hash transform, but from
+ * * the same master key.
+ */
+ if (hashtype_kul == usmHMACMD5AuthProtocol) {
+ hashtype_kul = usmHMACSHA1AuthProtocol;
+ properlength = BYTESIZE(SNMP_TRANS_AUTHLEN_HMACSHA1);
+ goto test_genkul_again_local;
+ }
+
+ SUCCESS(testname);
+
+
+ /*
+ * Re-create the master key using the other hash transform.
+ */
+ if (hashtype_Ku == usmHMACMD5AuthProtocol) {
+ hashtype_Ku = usmHMACSHA1AuthProtocol;
+ hashname_Ku = "usmHMACSHA1AuthProtocol";
+ testname = "Using HMACSHA1 to create master key.";
+ goto test_genkul_again_master;
+ }
+
+ return failcount;
+
+} /* end test_genkul() */
+
+
+
+
+/*******************************************************************-o-******
+ * test_keychange
+ *
+ * Returns:
+ * Number of failures.
+ *
+ *
+ * Test of KeyChange TC implementation.
+ *
+ * ASSUME newkey and oldkey begin as NULL terminated strings.
+ */
+int
+test_keychange(void)
+{
+ int rval = SNMPERR_SUCCESS,
+ failcount = 0,
+ properlength = BYTESIZE(SNMP_TRANS_AUTHLEN_HMACMD5),
+ oldkey_len,
+ newkey_len,
+ isdefault_new = FALSE, isdefault_old = FALSE;
+ size_t keychange_len, temp_len;
+
+ const char *hashname = "usmHMACMD5AuthProtocol.";
+ char *s;
+
+ u_char oldkey_buf[LOCAL_MAXBUF],
+ newkey_buf[LOCAL_MAXBUF],
+ temp_buf[LOCAL_MAXBUF], keychange_buf[LOCAL_MAXBUF];
+
+ oid *hashtype = usmHMACMD5AuthProtocol;
+
+ OUTPUT("Test of KeyChange TC --");
+
+
+ /*
+ * Set newkey and oldkey.
+ */
+ if (!newkey) { /* newkey */
+ newkey = (const u_char *) NEWKEY_DEFAULT;
+ isdefault_new = TRUE;
+ }
+ newkey_len = strlen((const char *) newkey);
+
+ if (tolower(*(newkey + 1)) == 'x') {
+ newkey_len = hex_to_binary2((const u_char *) newkey + 2,
+ newkey_len - 2, &s);
+ FAILED(newkey_len < 0,
+ "Could not resolve hex newkey.");
+ newkey = (const u_char *) s;
+ binary_to_hex((const u_char *) newkey, newkey_len, &s);
+ }
+
+ if (!oldkey) { /* oldkey */
+ oldkey = (const u_char *) OLDKEY_DEFAULT;
+ isdefault_old = TRUE;
+ }
+ oldkey_len = strlen((const char *) oldkey);
+
+ if (tolower(*(oldkey + 1)) == 'x') {
+ oldkey_len = hex_to_binary2((const u_char *) oldkey + 2,
+ oldkey_len - 2, &s);
+ FAILED(oldkey_len < 0,
+ "Could not resolve hex oldkey.");
+ oldkey = (const u_char *) s;
+ binary_to_hex(oldkey, oldkey_len, &s);
+ }
+
+
+
+ test_keychange_again:
+ memset(oldkey_buf, 0, LOCAL_MAXBUF);
+ memset(newkey_buf, 0, LOCAL_MAXBUF);
+ memset(keychange_buf, 0, LOCAL_MAXBUF);
+ memset(temp_buf, 0, LOCAL_MAXBUF);
+
+ memcpy(oldkey_buf, oldkey, SNMP_MIN(oldkey_len, properlength));
+ memcpy(newkey_buf, newkey, SNMP_MIN(newkey_len, properlength));
+ keychange_len = LOCAL_MAXBUF;
+
+
+ binary_to_hex(oldkey_buf, properlength, &s);
+ fprintf(stdout, "# oldkey%s (len=%d): %s\n",
+ (isdefault_old) ? " (default)" : "", properlength, s);
+ SNMP_FREE(s);
+
+ binary_to_hex(newkey_buf, properlength, &s);
+ fprintf(stdout, "# newkey%s (len=%d): %s\n",
+ (isdefault_new) ? " (default)" : "", properlength, s);
+ SNMP_FREE(s);
+
+
+ rval = encode_keychange(hashtype, USM_LENGTH_OID_TRANSFORM,
+ oldkey_buf, properlength,
+ newkey_buf, properlength,
+ keychange_buf, &keychange_len);
+ FAILED(rval, "encode_keychange().");
+
+ FAILED(keychange_len != (properlength * 2),
+ "KeyChange string (encoded) is not proper length "
+ "for this hash transform.");
+
+ binary_to_hex(keychange_buf, keychange_len, &s);
+ fprintf(stdout, "# (%s) KeyChange string: %s\n",
+ ((hashtype == usmHMACMD5AuthProtocol) ? "MD5" : "SHA"), s);
+ SNMP_FREE(s);
+
+ temp_len = properlength;
+ rval = decode_keychange(hashtype, USM_LENGTH_OID_TRANSFORM,
+ oldkey_buf, properlength,
+ keychange_buf, properlength * 2,
+ temp_buf, &temp_len);
+ FAILED(rval, "decode_keychange().");
+
+ FAILED(temp_len != properlength,
+ "decoded newkey is not proper length for "
+ "this hash transform.");
+
+ binary_to_hex(temp_buf, temp_len, &s);
+ fprintf(stdout, "# decoded newkey: %s\n", s);
+ SNMP_FREE(s);
+
+
+ FAILED(memcmp(newkey_buf, temp_buf, temp_len),
+ "newkey did not decode properly.");
+
+
+ SUCCESS(hashname);
+
+
+ /*
+ * Multiplex different test combinations.
+ *
+ * First clause is for Test #2, second clause is for (last) Test #3.
+ */
+ if (hashtype == usmHMACMD5AuthProtocol) {
+ hashtype = usmHMACSHA1AuthProtocol;
+ hashname = "usmHMACSHA1AuthProtocol (w/DES length kul's).";
+ properlength = BYTESIZE(SNMP_TRANS_PRIVLEN_1DES)
+ + BYTESIZE(SNMP_TRANS_PRIVLEN_1DES_IV);
+ goto test_keychange_again;
+
+ } else if (properlength < BYTESIZE(SNMP_TRANS_AUTHLEN_HMACSHA1)) {
+ hashtype = usmHMACSHA1AuthProtocol;
+ hashname = "usmHMACSHA1AuthProtocol.";
+ properlength = BYTESIZE(SNMP_TRANS_AUTHLEN_HMACSHA1);
+ goto test_keychange_again;
+ }
+
+ return failcount;
+
+} /* end test_keychange() */
diff --git a/testing/fulltests/snmpv3/T050etimetest_capp.c b/testing/fulltests/snmpv3/T050etimetest_capp.c
new file mode 100644
index 0000000..53951aa
--- /dev/null
+++ b/testing/fulltests/snmpv3/T050etimetest_capp.c
@@ -0,0 +1,420 @@
+/*
+ * etimetest.c
+ *
+ * HEADER Testing engineID hashing and timing
+ *
+ * Expected SUCCESSes for all tests: 3
+ *
+ * Returns:
+ * Number of FAILUREs.
+ *
+ * Test of hash_engineID(). SUCCESSes: 0
+ * Test of LCD Engine ID and Time List. SUCCESSes: 3
+ *
+ * FIX Devise a test for {set,get}_enginetime(..., FALSE).
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <unistd.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/scapi.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/library/lcd_time.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/callback.h>
+
+static u_int dummy_etime, dummy_eboot; /* For ISENGINEKNOWN(). */
+
+
+#include <stdlib.h>
+
+extern char *optarg;
+extern int optind, optopt, opterr;
+
+int testcount=0;
+
+/*
+ * Globals, &c...
+ */
+char *local_progname;
+
+#define USAGE "Usage: %s [-h][-s <seconds>][-aeH]"
+#define OPTIONLIST "aehHs:"
+
+int doalltests = 0, dohashindex = 0, doetimetest = 0;
+
+#define ALLOPTIONS (doalltests + dohashindex + doetimetest)
+
+
+
+#define LOCAL_MAXBUF (1024 * 8)
+#define NL "\n"
+
+#define OUTPUT(o) fprintf(stdout, "# %s\n", o);
+
+#define SUCCESS(s) \
+{ \
+ fprintf(stdout, "# Done with %s\n", s); \
+}
+
+#define FAILED(e, f) \
+{ \
+ if (e != SNMPERR_SUCCESS) { \
+ fprintf(stdout, "not ok: %d - %s\n", ++testcount, f); \
+ failcount += 1; \
+ } else { \
+ fprintf(stdout, "ok: %d - %s\n", ++testcount, f); \
+ } \
+ fflush(stdout); \
+}
+
+#define DETAILINT(s, i) \
+ fprintf(stdout, "# %s: %d\n", s, i);
+
+/*
+ * Global variables.
+ */
+int sleeptime = 2;
+
+#define BLAT "alk;djf;an riu;alicenmrul;aiknglksajhe1 adcfalcenrco2"
+
+
+
+
+/*
+ * Prototypes.
+ */
+void usage(FILE * ofp);
+
+int test_etime(void);
+int test_hashindex(void);
+
+
+
+
+int
+main(int argc, char **argv)
+{
+ int rval = SNMPERR_SUCCESS, failcount = 0;
+ char ch;
+
+ local_progname = argv[0];
+
+ /*
+ * Parse.
+ */
+ while ((ch = getopt(argc, argv, OPTIONLIST)) != EOF) {
+ switch (ch) {
+ case 'a':
+ doalltests = 1;
+ break;
+ case 'e':
+ doetimetest = 1;
+ break;
+ case 'H':
+ dohashindex = 1;
+ break;
+ case 's':
+ sleeptime = atoi(optarg);
+ if (sleeptime < 0) {
+ usage(stderr);
+ exit(1000);
+ }
+ break;
+ break;
+ case 'h':
+ rval = 0;
+ default:
+ usage(stdout);
+ exit(rval);
+ }
+
+ argc -= 1;
+ argv += 1;
+ if (optarg) {
+ argc -= 1;
+ argv += 1;
+ optarg = NULL;
+ }
+ optind = 1;
+ } /* endwhile getopt */
+
+ if ((argc > 1)) {
+ usage(stdout);
+ exit(1000);
+
+ } else if (ALLOPTIONS != 1) {
+ doalltests = 1;
+ }
+
+ init_snmp("testing");
+
+ /*
+ * test stuff.
+ */
+ rval = sc_init();
+ FAILED(rval, "sc_init()");
+
+
+ if (dohashindex || doalltests) {
+ failcount += test_hashindex();
+ }
+ if (doetimetest || doalltests) {
+ failcount += test_etime();
+ }
+
+
+ fprintf(stdout, "1..%d\n", testcount);
+ return 0;
+} /* end main() */
+
+
+
+
+
+void
+usage(FILE * ofp)
+{
+ fprintf(ofp,
+ USAGE
+ "" NL
+ " -a All tests." NL
+ " -e Exercise the list of enginetimes."
+ NL
+ " -h Help."
+ NL
+ " -H Test hash_engineID()."
+ NL
+ " -s <seconds> Seconds to pause. (Default: 0.)"
+ NL NL, local_progname);
+
+} /* end usage() */
+
+
+
+
+#ifdef EXAMPLE
+/*******************************************************************-o-******
+ * test_dosomething
+ *
+ * Returns:
+ * Number of failures.
+ *
+ *
+ * Test template.
+ */
+int
+test_dosomething(void)
+{
+ int rval = SNMPERR_SUCCESS, failcount = 0;
+
+ test_dosomething_quit:
+ return failcount;
+
+} /* end test_dosomething() */
+#endif /* EXAMPLE */
+
+
+
+
+
+/*******************************************************************-o-******
+ * test_hashindex
+ *
+ * Returns:
+ * Number of failures.
+ *
+ *
+ * Test hash_engineID().
+ */
+int
+test_hashindex(void)
+{
+ int /* rval = SNMPERR_SUCCESS, */
+ failcount = 0;
+ const u_char *s;
+
+ OUTPUT("Visual spot check of hash index outputs. "
+ "(Success or failure not noted.)");
+
+ s = (const u_char *) " A";
+ fprintf(stdout, "# %s = %d\n", s, hash_engineID(s, strlen((const char *) s)));
+
+ s = (const u_char *) " BB";
+ fprintf(stdout, "# %s = %d\n", s, hash_engineID(s, strlen((const char *) s)));
+
+ s = (const u_char *) " CCC";
+ fprintf(stdout, "# %s = %d\n", s, hash_engineID(s, strlen((const char *) s)));
+
+ s = (const u_char *) " DDDD";
+ fprintf(stdout, "# %s = %d\n", s, hash_engineID(s, strlen((const char *) s)));
+
+ s = (const u_char *) " EEEEE";
+ fprintf(stdout, "# %s = %d\n", s, hash_engineID(s, strlen((const char *) s)));
+
+ s = (const u_char *) BLAT;
+ fprintf(stdout, "# %s = %d\n", s, hash_engineID(s, strlen((const char *) s)));
+
+
+ OUTPUT("Visual spot check -- DONE.");
+
+ return failcount;
+
+} /* end test_hashindex() */
+
+
+
+
+
+/*******************************************************************-o-******
+ * test_etime
+ *
+ * Returns:
+ * Number of failures.
+ *
+ * Test of LCD Engine ID and Time List.
+ */
+int
+test_etime(void)
+{
+ int rval = SNMPERR_SUCCESS, failcount = 0;
+ u_int etime, eboot;
+
+ /*
+ * ------------------------------------ -o-
+ */
+ OUTPUT("Query of empty list, two set actions.");
+
+
+ rval = ISENGINEKNOWN((const u_char *) "A", 1);
+ if (rval == TRUE) {
+ FAILED(SNMPERR_GENERR, "Query of empty list returned TRUE.")
+ }
+
+
+ rval = set_enginetime((const u_char *) "BB", 2, 2, 20, TRUE);
+ FAILED(rval, "set_enginetime()");
+
+
+ rval = set_enginetime((const u_char *) "CCC", 3, 31, 90127, TRUE);
+ FAILED(rval, "set_enginetime()");
+
+
+ SUCCESS("Check of empty list, and two additions.");
+
+
+
+ /*
+ * ------------------------------------ -o-
+ */
+ OUTPUT("Add entries using macros, test for existence with macros.");
+
+
+ rval = ENSURE_ENGINE_RECORD((const u_char *) "DDDD", 4);
+ FAILED(rval, "ENSURE_ENGINE_RECORD()");
+
+
+ rval = MAKENEW_ENGINE_RECORD((const u_char *) "EEEEE", 5);
+ if (rval == SNMPERR_SUCCESS) {
+ FAILED(rval,
+ "MAKENEW_ENGINE_RECORD returned success for "
+ "missing record.");
+ }
+
+
+ rval = MAKENEW_ENGINE_RECORD((const u_char *) "BB", 2);
+ FAILED(rval, "MAKENEW_ENGINE_RECORD().");
+
+
+ SUCCESS
+ ("Added entries with macros, tested for existence with macros.");
+
+
+
+ /*
+ * ------------------------------------ -o-
+ */
+ OUTPUT("Dump the list and then sleep.");
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ dump_etimelist();
+#endif
+
+ fprintf(stdout, "# Sleeping for %d second%s... ",
+ sleeptime, (sleeptime == 1) ? "" : "s");
+
+ sleep(sleeptime);
+
+
+ /*
+ * ------------------------------------ -o-
+ */
+ OUTPUT
+ ("Retrieve data from real/stubbed records, update real/stubbed.");
+
+
+
+ rval = get_enginetime((const u_char *) "BB", 2, &eboot, &etime, TRUE);
+ FAILED(rval, "get_enginetime().");
+
+ fprintf(stdout, "# BB = <%d,%d>\n", eboot, etime);
+ if ((etime < 20) || (eboot < 2)) {
+ FAILED(SNMPERR_GENERR,
+ "get_enginetime() returned bad values. (1)");
+ }
+
+ rval = get_enginetime((const u_char *) "DDDD", 4, &eboot, &etime, FALSE);
+ FAILED(rval, "get_enginetime().");
+
+ fprintf(stdout, "# DDDD = <%d,%d>\n", eboot, etime);
+ if ((etime < sleeptime) || (eboot != 0)) {
+ FAILED(SNMPERR_GENERR,
+ "get_enginetime() returned bad values. (2)");
+ }
+
+
+ rval = set_enginetime((const u_char *) "CCC", 3, 234, 10000, TRUE);
+ FAILED(rval, "set_enginetime().");
+
+
+ rval = set_enginetime((const u_char *) "EEEEE", 5, 9876, 55555, TRUE);
+ FAILED(rval, "set_enginetime().");
+
+
+ SUCCESS("Retrieval and updates.");
+
+
+
+ /*
+ * ------------------------------------ -o-
+ */
+ OUTPUT("Sleep again, then dump the list one last time.");
+
+ fprintf(stdout, "# Sleeping for %d second%s...\n",
+ sleeptime, (sleeptime == 1) ? "" : "s");
+
+ sleep(sleeptime);
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ dump_etimelist();
+#endif
+
+ return failcount;
+
+} /* end test_etime() */
diff --git a/testing/fulltests/support/NetSNMPTest.pm b/testing/fulltests/support/NetSNMPTest.pm
new file mode 100644
index 0000000..e4ac040
--- /dev/null
+++ b/testing/fulltests/support/NetSNMPTest.pm
@@ -0,0 +1,172 @@
+package NetSNMPTest;
+
+use File::Temp qw(tempfile tempdir);
+use IO::File;
+use Data::Dumper;
+use strict;
+
+sub new {
+ my $type = shift;
+ my ($class) = ref($type) || $type;
+ my $self = {};
+ %$self = @_;
+ bless($self, $class);
+ $self->init();
+ return $self;
+}
+
+sub init {
+ my ($self) = @_;
+ $self->{'dir'} = tempdir();
+ print "# using tempdir $self->{dir}\n";
+
+ foreach my $suffix (qw(conf pid log out)) {
+ $self->{"snmpd.$suffix"} ||= $self->{'dir'} . "/snmpd.$suffix";
+ }
+ $self->{'snmp.conf'} ||= $self->{'dir'} . "/snmp.conf";
+
+ $self->{'confdir'} ||= $self->{'dir'};
+ $self->{'persistentdir'} ||= $self->{'dir'} . "/persistent";
+}
+
+sub config_file {
+ my ($self, $file, $string) = @_;
+ my $fh = new IO::File (">> $file");
+ $fh->print($string);
+ if ($string !~ /\n$/) {
+ $fh->print("\n");
+ }
+ $fh->close();
+}
+
+sub config_agent {
+ my ($self, $string) = @_;
+ $self->config_file($self->{'snmpd.conf'}, $string);
+}
+
+sub config_app {
+ my ($self, $string) = @_;
+ $self->config_file($self->{'snmp.conf'}, $string);
+}
+
+sub require_feature {
+ my ($self, $feature) = @_;
+ my $srcdir = $ENV{'srcdir'} || "..";
+ my $fh = new IO::File("$srcdir/include/net-snmp/net-snmp-config.h");
+ while (<$fh>) {
+ if (/#define $feature 1/) {
+ $fh->close();
+ return 1;
+ }
+ }
+ print "1..0 # SKIP missing $feature\n";
+ exit;
+}
+
+sub start_agent {
+ my ($self, $flags) = @_;
+
+ $flags ||= $self->{'snmpdflags'};
+
+ $ENV{'SNMPCONFPATH'} = $self->{'confdir'};
+ $ENV{'SNMP_PERSISTENT_DIR'} = $self->{'peristentdir'};
+
+ my $cmd = "snmpd $flags -r -U -p $self->{'snmpd.pid'} -Lf $self->{'snmpd.log'} $self->{'agentaddress'} > $self->{'snmpd.out'} 2>&1";
+ System("$cmd &");
+
+ sleep(1);
+
+ return $self->wait_for($self->{'snmpd.log'}, "NET-SNMP version");
+}
+
+sub stop_agent {
+ my ($self) = @_;
+ my $pidfile = new IO::File "$self->{'snmpd.pid'}";
+ my $pid = <$pidfile>;
+ kill("TERM", $pid);
+ $self->wait_for($self->{'snmpd.log'}, 'shutting down');
+}
+
+# returns 1 on success, 0 on failure
+sub wait_for {
+ my ($self, $filename, $regexp, $maxtime) = @_;
+ my $fh = new IO::File "$filename";
+ return 0 if (!$fh);
+
+ $maxtime = 10 if (!defined($maxtime));
+
+ my $timecount = 0;
+ # print "# reading from: $filename\n";
+ while (1) {
+ my $line = <$fh>;
+ # print "# line: $line\n";
+ if ($line eq "") {
+ if ($timecount == $maxtime) {
+ return 0;
+ }
+ sleep(1);
+ print "# sleeping ...\n";
+ $fh->clearerr();
+ $timecount++;
+ } else {
+ chomp($line);
+ if ($line =~ /$regexp/) {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+sub Debug {
+ print "# " . join(" ",@_);
+}
+
+sub System {
+ my ($cmd) = @_;
+ Debug("running: ", $cmd, "\n");
+ system($cmd);
+}
+
+sub DIE {
+ my $self = shift;
+ $self->stop_agent();
+ die @_;
+}
+
+1;
+
+=pod
+
+=head1 NAME
+
+NetSNMPTest - simple testing module for testing perl tests
+
+=head1 USAGE
+
+use NetSNMPTest;
+use Test;
+use SNMP;
+
+my $destination = "udp:localhost:9876";
+
+my $test = new NetSNMPTest(agentaddress => $destination);
+
+$test->require_feature("SOME_IFDEF_FROM_NET_SNMP_CONFIG_H");
+
+$test->config_agent("rocommunity public");
+$test->config_agent("syscontact testvalue");
+$test->DIE("failed to start the agent") if (!$test->start_agent());
+
+my $session = new SNMP::Session(DestHost => $destination,
+ Version => '2c',
+ Community => 'public');
+
+my $value = $session->get('sysContact.0');
+plan(tests => 1);
+ok($value, 'testvalue');
+
+$test->stop_agent();
+
+=cut
+
diff --git a/testing/fulltests/support/cagentlib_build b/testing/fulltests/support/cagentlib_build
new file mode 100755
index 0000000..55a35ae
--- /dev/null
+++ b/testing/fulltests/support/cagentlib_build
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# build the C test file ...
+
+rm -f "$2.c"
+cat >>"$2.c" <<EOF
+/* net-snmp standard headers */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* testing specific header */
+#include <net-snmp/library/testing.h>
+
+/* standard headers */
+#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
+
+int
+main(int argc, char *argv[]) {
+
+EOF
+echo >>"$2.c" "#line 1 \"$1\""
+cat >>"$2.c" "$1"
+cat >>"$2.c" <<EOF
+
+ if (__did_plan == 0) {
+ PLAN(__test_counter);
+ }
+
+ return(0);
+}
+
+EOF
+
+# ... and compile it.
+${builddir}/libtool --mode=link `${builddir}/net-snmp-config --build-command` -I$builddir/include -I$srcdir/include -o $2 $2.c ${builddir}/snmplib/libnetsnmp.la ${builddir}/agent/libnetsnmpagent.la `${builddir}/net-snmp-config --external-libs`
+echo $2
diff --git a/testing/fulltests/support/cagentlib_run b/testing/fulltests/support/cagentlib_run
new file mode 100755
index 0000000..84f54e1
--- /dev/null
+++ b/testing/fulltests/support/cagentlib_run
@@ -0,0 +1,8 @@
+#!/bin/sh
+${DYNAMIC_ANALYZER} ${builddir}/libtool --mode=execute "$1" 2>&1 \
+| \
+if [ "x$SNMP_SAVE_TMPDIR" = "xyes" ]; then
+ tee "/tmp/snmp-unit-test-`basename $1`"
+else
+ cat
+fi
diff --git a/testing/fulltests/support/capp_build b/testing/fulltests/support/capp_build
new file mode 100755
index 0000000..dc038c6
--- /dev/null
+++ b/testing/fulltests/support/capp_build
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+${builddir}/libtool --mode=link `${builddir}/net-snmp-config --build-command` -I$builddir/include -I$srcdir/include -o $2 $1 ${builddir}/snmplib/libnetsnmp.la `${builddir}/net-snmp-config --external-libs`
+echo $2
diff --git a/testing/fulltests/support/capp_run b/testing/fulltests/support/capp_run
new file mode 100755
index 0000000..84f54e1
--- /dev/null
+++ b/testing/fulltests/support/capp_run
@@ -0,0 +1,8 @@
+#!/bin/sh
+${DYNAMIC_ANALYZER} ${builddir}/libtool --mode=execute "$1" 2>&1 \
+| \
+if [ "x$SNMP_SAVE_TMPDIR" = "xyes" ]; then
+ tee "/tmp/snmp-unit-test-`basename $1`"
+else
+ cat
+fi
diff --git a/testing/fulltests/support/clib_build b/testing/fulltests/support/clib_build
new file mode 100755
index 0000000..0c7eb6d
--- /dev/null
+++ b/testing/fulltests/support/clib_build
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# build the C test file ...
+
+rm -f "$2.c"
+cat >>"$2.c" <<EOF
+/* net-snmp standard headers */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/library/large_fd_set.h>
+
+/* testing specific header */
+#include <net-snmp/library/testing.h>
+
+/* standard headers */
+#include <errno.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
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETINET_IP6_H
+#include <netinet/ip6.h>
+#endif
+#ifndef HAVE_INET_PTON
+#include "snmplib/inet_pton.h"
+#endif
+#ifndef HAVE_INET_NTOP
+#include "snmplib/inet_ntop.h"
+#endif
+
+int
+main(int argc, char *argv[]) {
+
+EOF
+echo >>"$2.c" "#line 1 \"$1\""
+cat >>"$2.c" "$1"
+cat >>"$2.c" <<EOF
+
+ if (__did_plan == 0) {
+ PLAN(__test_counter);
+ }
+
+ return(0);
+}
+
+EOF
+
+# ... and compile it.
+${builddir}/libtool --mode=link `${builddir}/net-snmp-config --build-command` -I$builddir/include -I$srcdir -I$srcdir/include -o $2 $2.c ${builddir}/snmplib/libnetsnmp.la `${builddir}/net-snmp-config --external-libs`
+echo $2
diff --git a/testing/fulltests/support/clib_run b/testing/fulltests/support/clib_run
new file mode 100755
index 0000000..84f54e1
--- /dev/null
+++ b/testing/fulltests/support/clib_run
@@ -0,0 +1,8 @@
+#!/bin/sh
+${DYNAMIC_ANALYZER} ${builddir}/libtool --mode=execute "$1" 2>&1 \
+| \
+if [ "x$SNMP_SAVE_TMPDIR" = "xyes" ]; then
+ tee "/tmp/snmp-unit-test-`basename $1`"
+else
+ cat
+fi
diff --git a/testing/fulltests/support/simple_TESTCONF.sh b/testing/fulltests/support/simple_TESTCONF.sh
new file mode 100644
index 0000000..83c38c2
--- /dev/null
+++ b/testing/fulltests/support/simple_TESTCONF.sh
@@ -0,0 +1,260 @@
+#! /bin/sh -f
+
+#
+# Variables: (* = exported)
+# *SNMP_TMPDIR: place to put files used in testing.
+# SNMP_TESTDIR: where the test scripts are kept.
+# *SNMP_PERSISTENT_FILE: where to store the agent's persistent information
+# (XXX: this should be specific to just the agent)
+
+# MinGW/MSYS only: translate an MSYS path back into a DOS path such that snmpd
+# and the Net-SNMP applications can understand it. One of the features of MSYS
+# is that if a POSIX-style path is passed as a command-line argument to an
+# executable that MSYS translates that path to a DOS-style path before
+# starting the executable. This is a key feature of MSYS that makes it
+# possible to run shell scripts unmodified and at the same time to use
+# executables that accept DOS-style paths. There is no support however for
+# automatical translation of environment variables that contain paths. Hence
+# this function that translates paths explicitly.
+translate_path() {
+ if [ "$OSTYPE" = msys ]; then
+ local t=`set \
+ | sed -n -e "s/^$1='\(.*\)'$/${SNMP_ENV_SEPARATOR}\1/p" \
+ -e "s/^$1=\(.*\)$/${SNMP_ENV_SEPARATOR}\1/p" \
+ | sed -e "s|${SNMP_ENV_SEPARATOR}/c/|${SNMP_ENV_SEPARATOR}c:/|g" \
+ -e "s|${SNMP_ENV_SEPARATOR}/tmp/|${SNMP_ENV_SEPARATOR}c:/windows/temp/|g" \
+ | sed -e "s/^${SNMP_ENV_SEPARATOR}//" \
+ `
+ eval "$1='$t'"
+ fi
+}
+
+#
+# Only allow ourselves to be eval'ed once
+#
+if [ "x$TESTCONF_SH_EVALED" != "xyes" ]; then
+ TESTCONF_SH_EVALED=yes
+
+#
+# set cpu and memory limits to prevent major damage
+#
+# defaults: 1h CPU, 500MB VMEM
+#
+[ "x$SNMP_LIMIT_VMEM" = "x" ] && SNMP_LIMIT_VMEM=512000
+[ "x$SNMP_LIMIT_CPU" = "x" ] && SNMP_LIMIT_CPU=3600
+# ulimit will fail if existing limit is lower -- ignore because it's ok
+ulimit -S -t $SNMP_LIMIT_CPU 2>/dev/null
+# not all sh-alikes support "ulimit -v" -- play safe
+[ "x$BASH_VERSION" != "x" ] && ulimit -S -v $SNMP_LIMIT_VMEM 2>/dev/null
+
+#
+# Set up an NL suppressing echo command
+#
+case "`echo 'x\c'`" in
+ 'x\c')
+ ECHO() { echo -n $*; }
+ ;;
+ x)
+ ECHO() { echo $*\\c; }
+ ;;
+ *)
+ echo "I don't understand your echo command ..."
+ exit 1
+ ;;
+esac
+#
+# how verbose should we be (0 or 1)
+#
+if [ "x$SNMP_VERBOSE" = "x" ]; then
+ SNMP_VERBOSE=0
+ export SNMP_VERBOSE
+fi
+
+SNMP_ENV_SEPARATOR="`${builddir}/net-snmp-config --env-separator`"
+
+if [ "x$MIBDIRS" = "x" ]; then
+ if [ "x$SNMP_PREFER_NEAR_MIBS" = "x1" ]; then
+ MIBDIRS=${srcdir}/mibs
+ export MIBDIRS
+ fi
+fi
+
+# Set up the path to the programs we want to use.
+if [ "x$SNMP_PATH" = "x" ]; then
+ PATH=${builddir}/agent:${builddir}/apps:$PATH
+ export PATH
+ SNMP_PATH=yes
+ export SNMP_PATH
+fi
+
+# make sure that we can fulfill all library dependencies
+_ld_lib_path="${SNMP_UPDIR}/snmplib/.libs:${SNMP_UPDIR}/agent/.libs:${SNMP_UPDIR}/agent/helpers/.libs"
+case `uname` in
+ CYGWIN*)
+ PATH="${_ld_lib_path}:$PATH"
+ export PATH
+ ;;
+ Darwin*)
+ if [ "x$DYLD_LIBRARY_PATH" != "x" ]; then
+ DYLD_LIBRARY_PATH="${_ld_lib_path}:${DYLD_LIBRARY_PATH}"
+ else
+ DYLD_LIBRARY_PATH="${_ld_lib_path}"
+ fi
+ export DYLD_LIBRARY_PATH
+ ;;
+ HP-UX*)
+ if [ "x$SHLIB_PATH" != "x" ]; then
+ SHLIB_PATH="${_ld_lib_path}:${SHLIB_PATH}"
+ else
+ SHLIB_PATH="${_ld_lib_path}"
+ fi
+ export SHLIB_PATH
+ ;;
+ *)
+ if [ "x$LD_LIBRARY_PATH" != "x" ]; then
+ LD_LIBRARY_PATH="${_ld_lib_path}:${LD_LIBRARY_PATH}"
+ else
+ LD_LIBRARY_PATH="${_ld_lib_path}"
+ fi
+ export LD_LIBRARY_PATH
+ ;;
+esac
+
+# Set up temporary directory
+if [ "x$SNMP_HEADERONLY" != "xyes" ]; then
+ if [ "x$SNMP_TMPDIR" = "x" ]; then
+ if [ "x$testnum" = "x" ] ; then
+ testnum=0
+ fi
+ SNMP_TMPDIR="/tmp/snmp-test-$testnum-$$"
+ translate_path SNMP_TMPDIR
+ export SNMP_TMPDIR
+ if [ -d $SNMP_TMPDIR ]; then
+ echo "$0: ERROR: $SNMP_TMPDIR already existed."
+ exit 1;
+ fi
+ fi
+ if [ ! -d $SNMP_TMPDIR ]; then
+ mkdir -p $SNMP_TMPDIR
+ chmod 0700 $SNMP_TMPDIR
+ fi
+ if [ "x$SNMP_TMP_PERSISTENTDIR" = "x" ]; then
+ SNMP_TMP_PERSISTENTDIR=$SNMP_TMPDIR/persist
+ export SNMP_TMP_PERSISTENTDIR
+ fi
+ if [ ! -d $SNMP_TMP_PERSISTENTDIR ]; then
+ mkdir $SNMP_TMP_PERSISTENTDIR
+ chmod 0700 $SNMP_TMP_PERSISTENTDIR
+ fi
+fi
+
+if [ "x$SNMP_SAVE_TMPDIR" = "x" ]; then
+ SNMP_SAVE_TMPDIR="no"
+ export SNMP_SAVE_TMPDIR
+fi
+
+SNMP_IGNORE_WINDOWS_REGISTRY="true"
+export SNMP_IGNORE_WINDOWS_REGISTRY
+SNMP_PERLPROG="`${builddir}/net-snmp-config --perlprog`"
+SNMP_TESTDIR="$SNMP_BASEDIR/tests"
+SNMP_CONFIG_FILE="$SNMP_TMPDIR/snmpd.conf"
+SNMPTRAPD_CONFIG_FILE="$SNMP_TMPDIR/snmptrapd.conf"
+SNMPAPP_CONFIG_FILE="$SNMP_TMPDIR/snmp.conf"
+AGENTX_CONFIG_FILE="$SNMP_TMPDIR/agentx.conf"
+SNMP_SNMPTRAPD_LOG_FILE="$SNMP_TMPDIR/snmptrapd.log"
+SNMP_SNMPTRAPD_PID_FILE="$SNMP_TMPDIR/snmptrapd.pid"
+SNMP_SNMPD_PID_FILE="$SNMP_TMPDIR/snmpd.pid"
+SNMP_SNMPD_LOG_FILE="$SNMP_TMPDIR/snmpd.log"
+SNMP_AGENTX_PID_FILE="$SNMP_TMPDIR/agentx.pid"
+SNMP_AGENTX_LOG_FILE="$SNMP_TMPDIR/agentx.log"
+SNMPCONFPATH="${SNMP_TMPDIR}${SNMP_ENV_SEPARATOR}${SNMP_TMP_PERSISTENTDIR}"
+translate_path SNMPCONFPATH
+export SNMPCONFPATH
+SNMP_PERSISTENT_DIR=$SNMP_TMP_PERSISTENTDIR
+translate_path SNMP_PERSISTENT_DIR
+export SNMP_PERSISTENT_DIR
+#SNMP_PERSISTENT_FILE="$SNMP_TMP_PERSISTENTDIR/persistent-store.conf"
+#export SNMP_PERSISTENT_FILE
+
+## Setup default flags and ports iff not done
+if [ "x$SNMP_FLAGS" = "x" ]; then
+ SNMP_FLAGS="-d"
+fi
+if test -x /bin/netstat ; then
+ NETSTAT=/bin/netstat
+elif test -x /usr/bin/netstat ; then
+ NETSTAT=/usr/bin/netstat
+elif test -x /usr/sbin/netstat ; then
+ # e.g. Tru64 Unix
+ NETSTAT=/usr/sbin/netstat
+elif test -x /usr/etc/netstat ; then
+ # e.g. IRIX
+ NETSTAT=/usr/etc/netstat
+elif test -x /cygdrive/c/windows/system32/netstat ; then
+ # Cygwin
+ NETSTAT=/cygdrive/c/windows/system32/netstat
+elif test -x /c/Windows/System32/netstat ; then
+ # MinGW + MSYS
+ NETSTAT=/c/Windows/System32/netstat
+else
+ NETSTAT=""
+fi
+
+if [ "x$OSTYPE" = "xmsys" ]; then
+ # Obtain the MSYS installation path from the !C: environment variable,
+ # remove surrounding single quotes and convert backslashes into forward
+ # slashes.
+ MSYS_PATH="$(set \
+ | sed -n 's|^\!C:='"'"'\(.*\)'"'"'$|\1|p' | sed 's|\\|/|g')"
+ MSYS_SH="$MSYS_PATH/sh.exe"
+fi
+
+PROBE_FOR_PORT() {
+ BASE_PORT=$1
+ MAX_RETRIES=10
+ if test -x "$NETSTAT" ; then
+ if test -z "$RANDOM"; then
+ RANDOM=2
+ fi
+ while :
+ do
+ BASE_PORT=`expr $BASE_PORT + \( $RANDOM % 100 \)`
+ IN_USE=`$NETSTAT -a -n 2>/dev/null | grep "[\.:]$BASE_PORT "`
+ if [ $? -ne 0 ]; then
+ echo "$BASE_PORT"
+ break
+ fi
+ MAX_RETRIES=`expr $MAX_RETRIES - 1`
+ if [ $MAX_RETRIES -eq 0 ]; then
+ echo "ERROR: Could not find available port." >&2
+ echo "NOPORT"
+ exit 255
+ fi
+ done
+ fi
+}
+
+if [ "x$SNMP_SNMPD_PORT" = "x" ]; then
+ SNMP_SNMPD_PORT=`PROBE_FOR_PORT 8765`
+fi
+if [ "x$SNMP_SNMPTRAPD_PORT" = "x" ]; then
+ SNMP_SNMPTRAPD_PORT=`PROBE_FOR_PORT 5678`
+fi
+if [ "x$SNMP_AGENTX_PORT" = "x" ]; then
+ SNMP_AGENTX_PORT=`PROBE_FOR_PORT 7676`
+fi
+if [ "x$SNMP_TRANSPORT_SPEC" = "x" ];then
+ SNMP_TRANSPORT_SPEC="udp"
+fi
+if [ "x$SNMP_TEST_DEST" = "x" -a $SNMP_TRANSPORT_SPEC != "unix" ];then
+ SNMP_TEST_DEST="127.0.0.1:"
+fi
+export SNMP_FLAGS SNMP_SNMPD_PORT SNMP_SNMPTRAPD_PORT
+
+# Make sure the agent doesn't parse any config file but what we give it.
+# this is mainly to protect against a broken agent that doesn't
+# properly handle combinations of -c and -C. (since I've broke it before).
+#SNMPCONFPATH="$SNMP_TMPDIR/does-not-exist"
+#export SNMPCONFPATH
+
+fi # Only allow ourselves to be eval'ed once
diff --git a/testing/fulltests/support/simple_eval_tools.sh b/testing/fulltests/support/simple_eval_tools.sh
new file mode 100644
index 0000000..314d9bb
--- /dev/null
+++ b/testing/fulltests/support/simple_eval_tools.sh
@@ -0,0 +1,695 @@
+#
+# eval_tools.sh
+#
+# Output functions for script tests. Source this from other test scripts
+# to establish a standardized repertory of test functions.
+#
+#
+# Except where noted, all functions return:
+# 0 On success, (Bourne Shell's ``true'')
+# non-0 Otherwise.
+#
+# Input arguments to each function are documented with each function.
+#
+#
+# XXX Suggestions:
+# DEBUG ON|OFF
+# dump CAPTURE output to stdout as well as to junkoutputfile.
+#
+
+#
+# Only allow ourselves to be eval'ed once
+#
+if [ "x$EVAL_TOOLS_SH_EVALED" != "xyes" ]; then
+ EVAL_TOOLS_SH_EVALED=yes
+
+#
+# Variables used in global environment of calling script.
+#
+failcount=0
+testnum=0
+errnum=0
+junkoutputfilebase="$SNMP_TMPDIR/output-`basename $0`$$"
+junkoutputfile=$junkoutputfilebase
+outputcount=0
+separator="-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
+if [ -z "$OK_TO_SAVE_RESULT" ] ; then
+OK_TO_SAVE_RESULT=1
+export OK_TO_SAVE_RESULT
+fi
+
+#
+# HEADER: returns a single line when SNMP_HEADERONLY mode and exits.
+#
+HEADER() {
+ if [ "x$SNMP_HEADERONLY" != "x" ]; then
+ echo test $*
+ exit 0;
+ else
+ { echo "# testing $*"; echo ""; } >> $SNMP_TMPDIR/invoked
+ fi
+}
+
+
+#------------------------------------ -o-
+#
+OUTPUT() { # <any_arguments>
+ cat <<GRONK
+
+
+$*
+
+
+GRONK
+}
+
+CAN_USLEEP() {
+ if [ "$SNMP_CAN_USLEEP" = 0 -o "$SNMP_CAN_USLEEP" = 1 ] ; then
+ return 0
+ fi
+ sleep .1 > /dev/null 2>&1
+ if [ $? = 0 ] ; then
+ SNMP_CAN_USLEEP=1
+ else
+ SNMP_CAN_USLEEP=0
+ fi
+ export SNMP_CAN_USLEEP
+}
+
+
+#------------------------------------ -o-
+#
+SUCCESS() { # <any_arguments>
+ [ "$failcount" -ne 0 ] && return
+ cat <<GROINK
+
+SUCCESS: $*
+
+GROINK
+}
+
+
+
+#------------------------------------ -o-
+#
+FAILED() { # <return_value>, <any_arguments>
+ [ "$1" -eq 0 ] && return
+ shift
+
+ failcount=`expr $failcount + 1`
+ cat <<GRONIK
+
+FAILED: $*
+
+GRONIK
+}
+
+#------------------------------------ -o-
+#
+SKIP() {
+ REMOVETESTDATA
+ echo "1..0 # SKIP $*"
+ exit 0
+}
+
+ISDEFINED() {
+ grep "^#define $1 " ${builddir}/include/net-snmp/net-snmp-config.h ${builddir}/include/net-snmp/agent/mib_module_config.h ${builddir}/include/net-snmp/agent/agent_module_config.h > /dev/null
+}
+
+SKIPIFNOT() {
+ ISDEFINED "$1" || SKIP "$1 is not defined"
+}
+
+SKIPIF() {
+ ISDEFINED "$1" && SKIP "$1 is defined"
+}
+
+#------------------------------------ -o-
+#
+VERIFY() { # <path_to_file(s)>
+ local missingfiles=
+
+ for f in $*; do
+ [ -f "$f" ] && continue
+ echo "FAILED: Cannot find file \"$f\"."
+ missingfiles=true
+ done
+
+ [ "$missingfiles" = true ] && exit 1000
+}
+
+NEWOUTPUTFILE() {
+ outputcount=`expr $outputcount + 1`
+ junkoutputfile="${junkoutputfilebase}-$outputcount"
+}
+
+#------------------------------------ -o-
+#
+STARTTEST() {
+ NEWOUTPUTFILE
+ [ ! -f "$junkoutputfile" ] && {
+ touch $junkoutputfile
+ return
+ }
+ echo "FAILED: Output file already exists: \"$junkoutputfile\"."
+ exit 1000
+}
+
+
+#------------------------------------ -o-
+#
+STOPTEST() {
+ rm -f "$junkoutputfile"
+}
+
+
+#------------------------------------ -o-
+#
+REMOVETESTDATA() {
+# ECHO "removing $SNMP_TMPDIR "
+ rm -rf $SNMP_TMPDIR
+}
+
+#------------------------------------ -o-
+#
+OUTPUTENVVARS() {
+ echo "SNMPCONFPATH=$SNMPCONFPATH" >> $1
+ echo "SNMP_PERSISTENT_DIR=$SNMP_PERSISTENT_DIR" >> $1
+ echo "MIBDIRS=$MIBDIRS" >> $1
+ echo "PATH=$PATH" >> $1
+ echo "export SNMPCONFPATH" >> $1
+ echo "export SNMP_PERSISTENT_DIR" >> $1
+ echo "export MIBDIRS" >> $1
+ echo "export PATH" >> $1
+}
+
+#------------------------------------ -o-
+# Captures output from command, and returns the command's exit code.
+loggedvars=0
+CAPTURE() { # <command_with_arguments_to_execute>
+ NEWOUTPUTFILE
+
+ # track invoked command per test when verbose
+ if [ $SNMP_VERBOSE -gt 0 ]; then
+ OUTPUTENVVARS $junkoutputfile.invoked
+ echo $* >> $junkoutputfile.invoked
+ fi
+
+ if [ $loggedvars = 0 ]; then
+ OUTPUTENVVARS $SNMP_TMPDIR/invoked
+ loggedvars=1
+ fi
+ echo $* >> $SNMP_TMPDIR/invoked
+
+ if [ $SNMP_VERBOSE -gt 0 ]; then
+ cat <<KNORG
+
+EXECUTING: $*
+
+KNORG
+
+ fi
+ echo "RUNNING: $*" > $junkoutputfile
+ ( $* 2>&1 ) >> $junkoutputfile 2>&1
+ RC=$?
+
+ if [ $SNMP_VERBOSE -gt 1 ]; then
+ echo "Command Output: "
+ echo "MIBDIR $MIBDIRS $MIBS"
+ echo "$separator"
+ cat $junkoutputfile | sed 's/^/ /'
+ echo "$separator"
+ fi
+ return $RC
+}
+
+#------------------------------------ -o-
+# Delay to let processes settle
+DELAY() {
+ if [ "$SNMP_SLEEP" != "0" ] ; then
+ sleep $SNMP_SLEEP
+ fi
+}
+
+SAVE_RESULTS() {
+ real_return_value=$return_value
+}
+
+#
+# Checks the output result against what we expect.
+# Sets return_value to 0 or 1.
+#
+EXPECTRESULT() {
+ if [ $OK_TO_SAVE_RESULT -ne 0 ] ; then
+ if [ "$snmp_last_test_result" = "$1" ]; then
+ return_value=0
+ else
+ return_value=1
+ fi
+ fi
+}
+
+CHECKCOUNT() {
+ CHECKFILECOUNT "$junkoutputfile" $@
+}
+
+CHECKVALUEIS() {
+ value1=$1
+ value2=$2
+ if [ "x$value1" = "x$value2" ]; then
+ GOOD "$3"
+ else
+ BAD "$3"
+ fi
+}
+
+CHECKVALUEISNT() {
+ value1=$1
+ value2=$2
+ if [ "x$value1" = "x$value2" ]; then
+ BAD "$3"
+ else
+ GOOD "$3"
+ fi
+}
+
+#------------------------------------ -o-
+# Returns: Count of matched lines.
+#
+CHECKFILECOUNT() { # <pattern_to_match>
+ chkfile=$1
+ ckfcount=$2
+ shift
+ shift
+ if [ $SNMP_VERBOSE -gt 0 ]; then
+ echo -n "checking $chkfile for $ckfcount \"$*\"..."
+ fi
+
+ if [ -f $chkfile ]; then
+ rval=`grep -c "$*" "$chkfile" 2>/dev/null`
+ else
+ COMMENT "Note: file $chkfile does not exist and we were asked to check it"
+ rval=0
+ fi
+
+ if [ $SNMP_VERBOSE -gt 0 ]; then
+ echo "$rval matches found"
+ fi
+
+ snmp_last_test_result=$rval
+ EXPECTRESULT $ckfcount # default
+ if [ "$ckfcount" != "noerror" ]; then
+ if [ "$ckfcount" = "atleastone" ]; then
+ if [ "$rval" -ne "0" ]; then
+ GOOD "found $ckfcount copies of '$*' in output ($chkfile); needed one"
+ else
+ BAD "found $rval copies of '$*' in output ($chkfile); expected 1"
+ COMMENT "Outputfile: $chkfile"
+ fi
+ else
+ if [ "$rval" = "$ckfcount" ]; then
+ GOOD "found $ckfcount copies of '$*' in output ($chkfile)"
+ else
+ BAD "found $rval copies of '$*' in output ($chkfile); expected $ckfcount"
+ COMMENT "Outputfile: $chkfile"
+ fi
+ fi
+ fi
+ return $rval
+}
+
+CHECK() {
+ CHECKCOUNT 1 $@
+}
+
+CHECKFILE() {
+ file=$1
+ shift
+ CHECKFILECOUNT $file 1 $@
+}
+
+CHECKTRAPD() {
+ CHECKFILE $SNMP_SNMPTRAPD_LOG_FILE $@
+}
+
+CHECKTRAPDCOUNT() {
+ count=$1
+ shift
+ CHECKFILECOUNT $SNMP_SNMPTRAPD_LOG_FILE $count $@
+}
+
+CHECKTRAPDORDIE() {
+ CHECKORDIE $@ $SNMP_SNMPTRAPD_LOG_FILE
+}
+
+CHECKAGENT() {
+ CHECKFILE $SNMP_SNMPD_LOG_FILE $@
+}
+
+CHECKAGENTCOUNT() {
+ count=$1
+ shift
+ CHECKFILECOUNT $SNMP_SNMPD_LOG_FILE $count $@
+}
+
+# Return 0 (true) if a process with pid $1 exists and 1 (false) if no process
+# with pid $1 exists. Do not use this function on MinGW: the PIDs written by
+# snmpd and snmptrapd to their pid files are not visible in the MinGW/MSYS
+# process table.
+ISRUNNING() {
+ #ps -e 2>/dev/null | egrep "^[ ]*$1[ ]+" >/dev/null 2>&1
+ kill -0 "$pid" 2>/dev/null
+}
+
+# Echo a command that asks the process with pid $1 to stop.
+ECHOSENDSIGTERM() {
+ if [ "x$OSTYPE" = "xmsys" ]; then
+ echo pskill.exe $1
+ else
+ echo kill -TERM $1
+ fi
+}
+
+# Echo a command that stops the process with pid $1 forcibly.
+ECHOSENDSIGKILL() {
+ if [ "x$OSTYPE" = "xmsys" ]; then
+ echo pskill.exe $1
+ else
+ echo kill -KILL $1
+ fi
+}
+
+# Wait until the shell statement "$@" evaluates to false.
+WAITFORNOTCOND() {
+ CAN_USLEEP
+ if [ $SNMP_CAN_USLEEP = 1 ] ; then
+ sleeptime=`expr $SNMP_SLEEP '*' 50`
+ else
+ sleeptime=`expr $SNMP_SLEEP '*' 5`
+ fi
+ while [ $sleeptime -gt 0 ] && eval "$@"; do
+ if [ $SNMP_CAN_USLEEP = 1 ]; then
+ sleep .1
+ else
+ sleep 1
+ fi
+ sleeptime=`expr $sleeptime - 1`
+ done
+}
+
+# Wait until the shell statement "$@" evaluates to true.
+WAITFORCOND() {
+ WAITFORNOTCOND if "$@;" then false ";" else true ";" fi
+}
+
+WAITFORAGENT() {
+ WAITFOR "$@" $SNMP_SNMPD_LOG_FILE
+}
+
+WAITFORTRAPD() {
+ WAITFOR "$@" $SNMP_SNMPTRAPD_LOG_FILE
+}
+
+# Wait until pattern "$1" appears in file "$2".
+WAITFOR() {
+ WAITFORCOND grep "$1" "$2" ">/dev/null" "2>&1"
+}
+
+GOOD() {
+ testnum=`expr $testnum + 1`
+ echo "ok $testnum - $1"
+ echo "# ok $testnum - $1" >> $SNMP_TMPDIR/invoked
+}
+
+BAD() {
+ testnum=`expr $testnum + 1`
+ errnum=`expr $errnum + 1`
+ echo "not ok $testnum - $1"
+ echo "# not ok $testnum - $1" >> $SNMP_TMPDIR/invoked
+}
+
+COMMENT() {
+ echo "# $@"
+ echo "# $@" >> $SNMP_TMPDIR/invoked
+}
+
+# CHECKORDIE "grep string" ["file"] .. FAIL if "grep string" is *not* found
+CHECKORDIE() {
+ if [ "x$2" = "x" ]; then
+ CHECKFILE "$junkoutputfile" "$1"
+ else
+ CHECKFILECOUNT "$2" 1 "$1"
+ fi
+}
+
+# CHECKANDDIE "grep string" ["file"] .. FAIL if "grep string" *is* found
+CHECKANDDIE() {
+ if [ "x$2" = "x" ]; then
+ CHECKFILECOUNT "$junkoutputfile" 0 "$1"
+ else
+ CHECKFILECOUNT "$2" 0 "$1"
+ fi
+}
+
+#------------------------------------ -o-
+# Returns: Count of matched lines.
+#
+CHECKEXACT() { # <pattern_to_match_exactly>
+ rval=`egrep -c "^$*\$|^$*[^a-zA-Z0-9_]|[^a-zA-Z0-9_]$*\$|[^a-zA-Z0-9_]$*[^a-zA-Z0-9_]" "$junkoutputfile" 2>/dev/null`
+ snmp_last_test_result=$rval
+ EXPECTRESULT 1 # default
+ return $rval
+}
+
+CONFIGAGENT() {
+ if [ "x$SNMP_CONFIG_FILE" = "x" ]; then
+ echo "$0: failed because var: SNMP_CONFIG_FILE wasn't set"
+ exit 1;
+ fi
+ echo $* >> $SNMP_CONFIG_FILE
+}
+
+CONFIGTRAPD() {
+ if [ "x$SNMPTRAPD_CONFIG_FILE" = "x" ]; then
+ echo "$0: failed because var: SNMPTRAPD_CONFIG_FILE wasn't set"
+ exit 1;
+ fi
+ echo $* >> $SNMPTRAPD_CONFIG_FILE
+}
+
+CONFIGAPP() {
+ if [ "x$SNMPAPP_CONFIG_FILE" = "x" ]; then
+ echo "$0: failed because var: SNMPAPP_CONFIG_FILE wasn't set"
+ exit 1;
+ fi
+ echo $* >> $SNMPAPP_CONFIG_FILE
+}
+
+#
+# common to STARTAGENT and STARTTRAPD
+# log command to "invoked" file
+#
+STARTPROG() {
+ if [ "x$DYNAMIC_ANALYZER" != "x" ]; then
+ COMMAND="$DYNAMIC_ANALYZER $COMMAND"
+ fi
+ if [ $SNMP_VERBOSE -gt 1 ]; then
+ echo "$CFG_FILE contains: "
+ if [ -f $CFG_FILE ]; then
+ cat $CFG_FILE
+ else
+ echo "[no config file]"
+ fi
+ fi
+ if test -f $CFG_FILE; then
+ COMMAND="$COMMAND -C -c $CFG_FILE"
+ fi
+ if [ "x$PORT_SPEC" != "x" ]; then
+ COMMAND="$COMMAND $PORT_SPEC"
+ fi
+ if [ $SNMP_VERBOSE -gt 0 ]; then
+ echo "running: $COMMAND"
+ fi
+ echo $COMMAND >> $SNMP_TMPDIR/invoked
+ if [ $SNMP_VERBOSE -gt 0 ]; then
+ OUTPUTENVVARS $LOG_FILE.command
+ echo $COMMAND >> $LOG_FILE.command
+ fi
+ if [ "x$OSTYPE" = "xmsys" ]; then
+ $COMMAND > $LOG_FILE.stdout 2>&1 &
+ ## COMMAND="cmd.exe //c start //min $COMMAND"
+ ## start $COMMAND > $LOG_FILE.stdout 2>&1
+ else
+ $COMMAND > $LOG_FILE.stdout 2>&1
+ fi
+}
+
+#------------------------------------ -o-
+STARTAGENT() {
+ SNMPDSTARTED=1
+ COMMAND="snmpd $SNMP_FLAGS -r -U -p $SNMP_SNMPD_PID_FILE -Lf $SNMP_SNMPD_LOG_FILE $AGENT_FLAGS"
+ CFG_FILE=$SNMP_CONFIG_FILE
+ LOG_FILE=$SNMP_SNMPD_LOG_FILE
+ PORT_SPEC="$SNMP_SNMPD_PORT"
+ if [ "x$SNMP_TRANSPORT_SPEC" != "x" ]; then
+ PORT_SPEC="${SNMP_TRANSPORT_SPEC}:${SNMP_TEST_DEST}${PORT_SPEC}"
+ fi
+ STARTPROG
+ WAITFORCOND test -f $SNMP_SNMPD_PID_FILE
+ WAITFORAGENT "NET-SNMP version"
+}
+
+#------------------------------------ -o-
+STARTTRAPD() {
+ TRAPDSTARTED=1
+ COMMAND="snmptrapd -d -p $SNMP_SNMPTRAPD_PID_FILE -Lf $SNMP_SNMPTRAPD_LOG_FILE $TRAPD_FLAGS"
+ CFG_FILE=$SNMPTRAPD_CONFIG_FILE
+ LOG_FILE=$SNMP_SNMPTRAPD_LOG_FILE
+ PORT_SPEC="$SNMP_SNMPTRAPD_PORT"
+ if [ "x$SNMP_TRANSPORT_SPEC" != "x" ]; then
+ PORT_SPEC="${SNMP_TRANSPORT_SPEC}:${SNMP_TEST_DEST}${PORT_SPEC}"
+ fi
+ STARTPROG
+ WAITFORCOND test -f $SNMP_SNMPTRAPD_PID_FILE
+ WAITFORTRAPD "NET-SNMP version"
+}
+
+## sending SIGHUP for reconfiguration
+#
+HUPPROG() {
+ if [ -f $1 ]; then
+ if [ "x$OSTYPE" = "xmsys" ]; then
+ COMMAND='echo "Skipping SIGHUP (not possible with MinGW)"'
+ else
+ COMMAND="kill -HUP `cat $1`"
+ fi
+ echo $COMMAND >> $SNMP_TMPDIR/invoked
+ VERBOSE_OUT 0 $COMMAND
+ $COMMAND > /dev/null 2>&1
+ fi
+}
+
+HUPAGENT() {
+ HUPPROG $SNMP_SNMPD_PID_FILE
+ if [ "x$OSTYPE" != "xmsys" ]; then
+ WAITFORAGENT "restarted"
+ fi
+}
+
+HUPTRAPD() {
+ HUPPROG $SNMP_SNMPTRAPD_PID_FILE
+ if [ "x$OSTYPE" != "xmsys" ]; then
+ WAITFORTRAPD "restarted"
+ fi
+}
+
+
+## used by STOPAGENT and STOPTRAPD
+# delay before kill to allow previous action to finish
+# this is especially important for interaction between
+# master agent and sub agent.
+STOPPROG() {
+ pid="`cat $1 2>/dev/null`"
+ if [ "x$pid" != "x" ]; then
+ COMMAND="`ECHOSENDSIGTERM $pid`"
+ echo "$COMMAND ($1)" >> $SNMP_TMPDIR/invoked
+ VERBOSE_OUT 0 "$COMMAND ($1)"
+ $COMMAND >/dev/null 2>&1
+ if [ "x$OSTYPE" = "xmsys" ]; then
+ # Wait until $pid and its parent have stopped.
+ sleep 1
+ else
+ WAITFORNOTCOND "ISRUNNING $pid"
+ fi
+ fi
+}
+
+#------------------------------------ -o-
+#
+STOPAGENT() {
+ SAVE_RESULTS
+ STOPPROG $SNMP_SNMPD_PID_FILE
+ if [ $SNMP_VERBOSE -gt 1 ]; then
+ echo "Agent Output:"
+ echo "$separator [stdout]"
+ cat $SNMP_SNMPD_LOG_FILE.stdout
+ echo "$separator [logfile]"
+ cat $SNMP_SNMPD_LOG_FILE
+ echo "$separator"
+ fi
+}
+
+#------------------------------------ -o-
+#
+STOPTRAPD() {
+ SAVE_RESULTS
+ STOPPROG $SNMP_SNMPTRAPD_PID_FILE
+ if [ $SNMP_VERBOSE -gt 1 ]; then
+ echo "snmptrapd Output:"
+ echo "$separator [stdout]"
+ cat $SNMP_SNMPTRAPD_LOG_FILE.stdout
+ echo "$separator [logfile]"
+ cat $SNMP_SNMPTRAPD_LOG_FILE
+ echo "$separator"
+ fi
+}
+
+#------------------------------------ -o-
+#
+FINISHED() {
+
+ ## no more changes to test result.
+ OK_TO_SAVE_RESULT=0
+
+ pids="`cat $SNMP_TMPDIR/*pid* 2>/dev/null`"
+ if [ "$SNMPDSTARTED" = "1" ] ; then
+ STOPAGENT
+ fi
+ if [ "$TRAPDSTARTED" = "1" ] ; then
+ STOPTRAPD
+ fi
+ for pid in $pids; do
+ if [ "x$OSTYPE" = "xmsys" ] || ISRUNNING $pid; then
+ if [ "x$OSTYPE" != "xmsys" ]; then
+ SNMP_SAVE_TMPDIR=yes
+ fi
+ COMMAND="`ECHOSENDSIGKILL $pid`"
+ echo "$COMMAND ($pfile)" >> $SNMP_TMPDIR/invoked
+ VERBOSE_OUT 0 "$COMMAND ($pfile)"
+ $COMMAND > /dev/null 2>&1
+ return_value=1
+ fi
+ done
+
+ # report the number of tests done
+ GOOD "got to FINISHED"
+ echo "1..$testnum"
+
+ if [ "x$errnum" != "x0" ]; then
+ if [ -s core ] ; then
+ # XX hope that only one prog cores !
+ cp core $SNMP_TMPDIR/core.$$
+ rm -f core
+ fi
+ echo "$headerStr...FAIL" >> $SNMP_TMPDIR/invoked
+ exit 1
+ fi
+
+ echo "$headerStr...ok" >> $SNMP_TMPDIR/invoked
+
+ if [ "x$SNMP_SAVE_TMPDIR" != "xyes" ]; then
+ REMOVETESTDATA
+ fi
+ exit 0
+}
+
+#------------------------------------ -o-
+#
+VERBOSE_OUT() {
+ if [ $SNMP_VERBOSE -gt $1 ]; then
+ shift
+ echo "$*"
+ fi
+}
+
+fi # Only allow ourselves to be eval'ed once
diff --git a/testing/fulltests/support/simple_run b/testing/fulltests/support/simple_run
new file mode 100755
index 0000000..1978009
--- /dev/null
+++ b/testing/fulltests/support/simple_run
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+if [ $# = 0 ]; then
+ echo "Usage: $0 <testscript> [<args>]"
+ exit 1
+fi
+
+if [ "x$builddir" = "x" ]; then
+ cd ..
+ builddir=`pwd`
+ if cd testing 2>/dev/null; then
+ :
+ else
+ echo "Error: $0 must be started from inside the testing directory in the source tree."
+ echo "The builddir environment variable can be set to point to the build directory."
+ exit 1
+ fi
+fi
+
+if [ "x$srcdir" = "x" ]; then
+ srcdir=`dirname $0`
+ srcdir=`cd $srcdir; cd ../..; pwd`
+ srcdir=`dirname $srcdir`
+ cd $srcdir
+ if cd testing 2>/dev/null; then
+ :
+ else
+ echo "Error: $0 must be started from inside the testing directory in the source tree."
+ echo "The builddir environment variable can be set to point to the build directory."
+ exit 1
+ fi
+fi
+
+testscript=$1
+if [ `echo $testscript | cut -c 1-1` != '/' ]; then
+ testscript="`pwd`/$1"
+fi
+
+SNMP_BASEDIR=`dirname $0`
+
+## prefer MIB files found in source hierarchy
+SNMP_PREFER_NEAR_MIBS=1
+
+export SNMP_PREFER_NEAR_MIBS
+SNMP_TEST_PREFIX=${SNMP_TEST_PREFIX:=T}
+export SNMP_TEST_PREFIX
+
+SNMP_ORIGDIR=`pwd` ## this script may be invoked with relative path
+export SNMP_ORIGDIR
+
+SNMP_UPDIR=${builddir} ## build directory
+if [ "x$DYNAMIC_ANALYZER" = "x" ]; then
+ SNMP_SLEEP_DEFAULT=1
+else
+ SNMP_SLEEP_DEFAULT=10
+fi
+SNMP_SLEEP=${SNMP_SLEEP:=$SNMP_SLEEP_DEFAULT} ## default seconds to sleep
+export SNMP_SLEEP
+
+# Find executables in source first, then build, then existing PATH.
+## Add to PATH if a binary is found.
+
+cd $SNMP_UPDIR
+SNMP_UPDIR=`pwd`
+bf=snmpget
+if [ -x "$bf" ] ; then
+ PATH=$SNMP_UPDIR:$PATH
+else
+ for dd in apps bin ; do
+ bf=$dd/snmpget
+ if [ -x "$bf" ] ; then
+ PATH=$SNMP_UPDIR/$dd:$PATH
+ break
+ fi
+ done
+fi
+for dd in agent bin sbin ; do
+ bf=$dd/snmpd
+ if [ -x "$bf" ] ; then
+ PATH=$SNMP_UPDIR/$dd:$PATH
+ break
+ fi
+done
+
+bf=include/net-snmp/net-snmp-config.h
+if [ ! -s "$bf" ] ; then
+ echo "No \"$bf\" in $SNMP_UPDIR . Some tests will be skipped"
+fi
+unset bf
+
+# Run from the test scripts directory.
+cd $SNMP_ORIGDIR ; cd ${SNMP_BASEDIR}
+SNMP_BASEDIR=`pwd`
+export SNMP_BASEDIR
+
+PATH=${SNMP_BASEDIR}:$PATH
+export PATH
+SNMP_PATH=yes
+export SNMP_PATH
+
+export SNMP_UPDIR
+
+#
+# Source the testing configuration file
+#
+
+testnum="`basename $testscript`"
+
+. simple_TESTCONF.sh
+
+. simple_eval_tools.sh
+
+cd `dirname $testscript`
+PATH=`pwd`:$PATH
+export PATH
+
+. `basename $testscript`
+
+FINISHED
diff --git a/testing/fulltests/tls/S300tlsperl.pl b/testing/fulltests/tls/S300tlsperl.pl
new file mode 100644
index 0000000..3ea7c0b
--- /dev/null
+++ b/testing/fulltests/tls/S300tlsperl.pl
@@ -0,0 +1,54 @@
+#!/usr/bin/perl
+
+BEGIN {
+ if (exists($ENV{'srcdir'})) {
+ push @INC, "$ENV{'srcdir'}/testing/fulltests/support";
+ } elsif (-d "fulltests/support") {
+ push @INC, "fulltests/support";
+ } elsif (-d "../support") {
+ push @INC, "../support";
+ }
+}
+use NetSNMPTest;
+use Test;
+use SNMP;
+
+my $test = new NetSNMPTest(agentaddress => $agentaddress);
+
+$test->require_feature($feature);
+
+my $netsnmpcert = "$ENV{'srcdir'}/local/net-snmp-cert -I -C $test->{'dir'}";
+
+system("$netsnmpcert gencert -I -t snmpd > /dev/null 2>&1");
+system("$netsnmpcert gencert -I -t snmpapp --cn snmpapp > /dev/null 2>&1");
+system("$netsnmpcert gencert -I -t perl --cn perl > /dev/null 2>&1");
+
+my $fp = `$netsnmpcert showcerts --fingerprint --brief perl`;
+chomp($fp);
+print "# using local fp: $fp\n";
+
+plan(tests => 2);
+$test->config_agent("syscontact itworked");
+$test->config_agent("rwuser -s tsm perl");
+$test->config_agent("certSecName 100 snmpapp --cn");
+$test->config_agent("certSecName 101 $fp --cn");
+
+$test->DIE("failed to start the agent") if (!$test->start_agent(" -Dtls,ssl,tsm,cert:map"));
+
+# now create a session to test things with
+my $session = new SNMP::Session(DestHost => $test->{'agentaddress'},
+ TheirIdentity => 'snmpd',
+ OurIdentity => 'perl');
+
+ok(ref($session), 'SNMP::Session', "created a session");
+
+######################################################################
+# GET test
+if (ref($session) eq 'SNMP::Session') {
+ my $value = $session->get('sysContact.0');
+ ok($value, 'itworked');
+}
+
+######################################################################
+# cleanup
+$test->stop_agent();
diff --git a/testing/fulltests/tls/SCipherTests b/testing/fulltests/tls/SCipherTests
new file mode 100644
index 0000000..95af0b9
--- /dev/null
+++ b/testing/fulltests/tls/SCipherTests
@@ -0,0 +1,62 @@
+. STlsVars
+
+# create a CA
+
+CAPTURE $NSCERT genca --cn ca-net-snmp.org $NSCERTARGS
+CAFP=`$NSCERT showcas --fingerprint --brief ca-net-snmp.org $NSCERTARGS`
+CHECKVALUEISNT "$CAFP" "" "generated fingerprint for ca-net-snmp.org certificate"
+
+# create a server certificate using the CA certificate
+CAPTURE $NSCERT gencert -t snmpd --with-ca ca-net-snmp.org $checknametype ${checknameprefix}foobar $NSCERTARGS
+SNMPDFP=`$NSCERT showcert --fingerprint --brief snmpd $NSCERTARGS`
+
+CONFIGAGENT '[snmp]' serverCert $SNMPDFP
+
+# create a user certificate
+CAPTURE $NSCERT gencert -t snmpapp --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmpapp $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+CONFIGAGENT certSecName 10 $TESTUSERFP --cn
+CONFIGAGENT rwuser -s tsm testuser authpriv
+
+CONFIGAPP clientCert $TESTUSERFP
+CONFIGAPP serverCert $SNMPDFP
+
+CONFIGAPP trustCert $CAFP
+
+# specify an exact list of ciphers to accept
+CONFIGAGENT '[snmp]' tlsAlgorithms DHE-RSA-AES256-SHA:AES256-SHA:DES-CBC3-SHA
+
+FLAGS="-On $SNMP_FLAGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT"
+
+# start up the agent
+STARTAGENT
+
+# ensure we can access it via standard algorithms on the client side
+DOSETTEST defaultAlgs "$FLAGS"
+
+# limit the client to the same set
+CONFIGAPP tlsAlgorithms DHE-RSA-AES256-SHA:AES256-SHA:DES-CBC3-SHA
+
+# and test
+DOSETTEST specificAlgs "$FLAGS"
+
+# drop one cipher
+CONFIGAPP tlsAlgorithms DHE-RSA-AES256-SHA:AES256-SHA
+
+# and test
+DOSETTEST onlyAes256Sha "$FLAGS"
+
+# and finally ensure we can get back to working again
+CONFIGAPP tlsAlgorithms DHE-RSA-AES256-SHA:AES256-SHA
+DOSETTEST worksAgain "$FLAGS"
+
+
+########################################
+# DONE
+
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/tls/SCrl b/testing/fulltests/tls/SCrl
new file mode 100644
index 0000000..4167403
--- /dev/null
+++ b/testing/fulltests/tls/SCrl
@@ -0,0 +1,98 @@
+#!/bin/sh
+
+. STlsVars
+
+# this file contains tests common to both tls and dtls usages
+
+TLSDIR=$SNMP_TMPDIR/tls
+
+#########################################
+# Create the certificates
+
+# create the ca
+CAPTURE $NSCERT genca --cn ca-net-snmp.org $NSCERTARGS
+
+# snmpd
+HOSTNAME=`hostname`
+CAPTURE $NSCERT gencert --with-ca ca-net-snmp.org -t snmpd --cn $HOSTNAME $NSCERTARGS
+SERVERFP=`$NSCERT showcerts --fingerprint --brief snmpd $NSCERTARGS`
+CHECKVALUEISNT "$SERVERFP" "" "generated fingerprint for snmpd certificate"
+
+# user
+CAPTURE $NSCERT gencert --with-ca ca-net-snmp.org -t snmpapp --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmpapp $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+# user2
+CAPTURE $NSCERT gencert --with-ca ca-net-snmp.org -t snmpapp2 --cn 'testuser2' $NSCERTARGS
+TESTUSER2FP=`$NSCERT showcerts --fingerprint --brief snmpapp2 $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSER2FP" "" "generated fingerprint for testuser2 certificate"
+
+########################################
+# Configure the .conf files
+
+CONFIGAPP serverCert $SERVERFP
+
+# common name mappings
+CONFIGAGENT certSecName 9 $TESTUSERFP --cn
+CONFIGAGENT certSecName 10 $TESTUSER2FP --cn
+CONFIGAGENT rwuser -s tsm testuser authpriv
+CONFIGAGENT rwuser -s tsm testuser2 authpriv
+
+CRLFILE=$SNMP_TMPDIR/crlfile.pem
+
+# configure the CRL locations
+CONFIGAGENT '[snmp]' x509crlfile $CRLFILE
+CONFIGAPP '[snmp]' x509crlfile $CRLFILE
+
+CRLCACMD="env DIR=$TLSDIR CN=ca-net-snp.org openssl ca"
+CRLARGS="-config $TLSDIR/.openssl.conf -keyfile $TLSDIR/private/ca-net-snmp.org.key -cert $TLSDIR/ca-certs/ca-net-snmp.org.crt"
+
+# generate the initial CRL
+touch $TLSDIR/.index
+echo "01" > $TLSDIR/.crlnumber
+CAPTURE "$CRLCACMD -gencrl $CRLARGS -out $CRLFILE"
+
+#
+# put the second client into the CRL and it shouldn't work
+#
+CAPTURE "$CRLCACMD -revoke $TLSDIR/certs/snmpapp2.crt $CRLARGS -out $CRLFILE"
+CAPTURE "$CRLCACMD -gencrl $CRLARGS -out $CRLFILE"
+
+
+######################################################################
+# Run the actual list of tests
+#
+
+# start the agent up
+FLAGS="-Dtls -On $SNMP_FLAGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT"
+AGENT_FLAGS="-Dtls"
+STARTAGENT
+
+# using user 1 - a common name mapped certificate
+# (using the default "snmpapp" certificate because we don't specify another)
+CAPTURE "snmpget -Dssl $FLAGS .1.3.6.1.2.1.1.3.0"
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+# using user 2 should now fail
+CAPTURE "snmpget -T our_identity=snmpapp2 -Dssl $FLAGS .1.3.6.1.2.1.1.3.0"
+
+CHECKCOUNT 0 ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+CHECKAGENT "certificate revoked"
+
+#
+# now put the server's cert into the client crl file
+#
+CAPTURE "$CRLCACMD -revoke $TLSDIR/certs/snmpd.crt $CRLARGS"
+CAPTURE "$CRLCACMD -gencrl $CRLARGS -out $CRLFILE"
+
+# user 1 should now fail on the client side
+CAPTURE "snmpget -Dssl $FLAGS .1.3.6.1.2.1.1.3.0"
+
+CHECK "certificate revoked"
+
+# cleanup
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/tls/STlsAgentTrap b/testing/fulltests/tls/STlsAgentTrap
new file mode 100644
index 0000000..ab0c341
--- /dev/null
+++ b/testing/fulltests/tls/STlsAgentTrap
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+. STlsVars
+
+SKIPIFNOT USING_EXAMPLES_EXAMPLE_MODULE
+
+#########################################
+# CERTIFICATE SETUP
+#
+
+# produce the certificates to use
+
+# snmptrapd
+HOSTNAME=`hostname`
+CAPTURE $NSCERT gencert -t snmptrapd --cn $HOSTNAME $NSCERTARGS
+TRAPDFP=`$NSCERT showcerts --fingerprint --brief snmptrapd $NSCERTARGS`
+CHECKVALUEISNT "$TRAPDFP" "" "generated fingerprint for snmptrapd certificate"
+
+# snmpd
+HOSTNAME=`hostname`
+CAPTURE $NSCERT gencert -t snmpd --cn $HOSTNAME $NSCERTARGS
+SERVERFP=`$NSCERT showcerts --fingerprint --brief snmpd $NSCERTARGS`
+CHECKVALUEISNT "$SERVERFP" "" "generated fingerprint for snmpd certificate"
+
+# user
+CAPTURE $NSCERT gencert -t snmpapp --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmpapp $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+#########################################
+# Configuration
+
+# snmpd
+CONFIGAGENT trapsess -Ci -T our_identity=$TESTUSERFP -T their_identity=$TRAPDFP ${SNMP_TRANSPORT_SPEC}:${SNMP_TEST_DEST}${SNMP_SNMPTRAPD_PORT}
+CONFIGAGENT '[snmp]' serverCert $SERVERFP
+CONFIGAGENT certSecName 9 $TESTUSERFP --cn
+CONFIGAGENT rwuser -s tsm testuser
+
+# snmptrapd
+CONFIGTRAPD '[snmp]' serverCert $TRAPDFP
+CONFIGTRAPD certSecName 9 $TESTUSERFP --cn
+CONFIGTRAPD authuser log -s tsm testuser authpriv
+CONFIGTRAPD agentxsocket /dev/null
+
+# general
+
+#
+# Begin test
+#
+
+STARTTRAPD
+
+# initialize only the example mib, and not the notification mib stuff
+AGENT_FLAGS="$AGENT_FLAGS -Dexample,header_generic"
+STARTAGENT
+
+#DELAY
+CAPTURE "snmpset -T their_identity=snmpd -T our_identity=snmpapp -On -t 3 -r 0 $SNMP_FLAGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.4.1.2021.254.8.0 i 1"
+
+STOPAGENT
+
+STOPTRAPD
+
+CHECKTRAPD "life the universe and everything"
+
+FINISHED
diff --git a/testing/fulltests/tls/STlsCNSession b/testing/fulltests/tls/STlsCNSession
new file mode 100644
index 0000000..b9a61b8
--- /dev/null
+++ b/testing/fulltests/tls/STlsCNSession
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+checknametype="--san"
+checknameprefix="DNS:"
+
+. STlsServerSession
diff --git a/testing/fulltests/tls/STlsName b/testing/fulltests/tls/STlsName
new file mode 100644
index 0000000..e484da6
--- /dev/null
+++ b/testing/fulltests/tls/STlsName
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+checknametype="--cn"
+checknameprefix=""
+
+. STlsServer
diff --git a/testing/fulltests/tls/STlsSan b/testing/fulltests/tls/STlsSan
new file mode 100644
index 0000000..294a0b4
--- /dev/null
+++ b/testing/fulltests/tls/STlsSan
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+checknametype="--san"
+checknameprefix="DNS:"
+
+. STlsServer
diff --git a/testing/fulltests/tls/STlsSanSession b/testing/fulltests/tls/STlsSanSession
new file mode 100644
index 0000000..b9a61b8
--- /dev/null
+++ b/testing/fulltests/tls/STlsSanSession
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+checknametype="--san"
+checknameprefix="DNS:"
+
+. STlsServerSession
diff --git a/testing/fulltests/tls/STlsServer b/testing/fulltests/tls/STlsServer
new file mode 100644
index 0000000..1e8002d
--- /dev/null
+++ b/testing/fulltests/tls/STlsServer
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+. STlsVars
+
+# create a CA
+
+CAPTURE $NSCERT genca --cn ca-net-snmp.org $NSCERTARGS
+CAFP=`$NSCERT showcas --fingerprint --brief ca-net-snmp.org $NSCERTARGS`
+CHECKVALUEISNT "$CAFP" "" "generated fingerprint for ca-net-snmp.org certificate"
+
+# create a server certificate using the CA certificate
+CAPTURE $NSCERT gencert -t snmpd --with-ca ca-net-snmp.org $checknametype ${checknameprefix}a.b.example.com $NSCERTARGS
+SNMPDFP=`$NSCERT showcert --fingerprint --brief snmpd $NSCERTARGS`
+
+CONFIGAGENT '[snmp]' serverCert $SNMPDFP
+
+# create a user certificate
+CAPTURE $NSCERT gencert -t snmpapp --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmpapp $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+CONFIGAGENT certSecName 10 $TESTUSERFP --cn
+CONFIGAGENT rwuser -s tsm testuser authpriv
+
+CONFIGAPP clientCert $TESTUSERFP
+
+# start the agent up
+FLAGS="-On $SNMP_FLAGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT"
+
+# start up the agent
+STARTAGENT
+
+########################################
+# Positive tests
+# (should work)
+
+# ensure we can access it via a direct FP check
+DOSETTEST fingerprintIdentity "-T their_identity=$SNMPDFP $FLAGS"
+
+# ensure we can access it via a file based identity check
+DOSETTEST filenameIdentity "-T their_identity=snmpd $FLAGS"
+
+# ensure we can access it via trusting their CA certificate and a
+# matching commoname
+DOSETTEST hostnameIdentity "-T trust_cert=$CAFP -T their_hostname=a.b.example.com $FLAGS"
+
+########################################
+# Negative tests
+# (should fail)
+
+# if we don't load the CA certificate we shouldn't connect
+DOFAILSETTEST noTrustCACert "-T their_hostname=a.b.example.com $FLAGS"
+
+# if we specify a different hostname we should fail hostname test
+# ("localhos" without the "t" is intentional here)
+DOFAILSETTEST incorrectNameA.B.Example.Co "-T their_hostname=a.b.example.co $FLAGS"
+DOFAILSETTEST incorrectNameA.B.Example.Comt "-T their_hostname=a.b.example.comt $FLAGS"
+
+# if we specify the CA cert's but don't specify the hostname, it
+# should fail (this may change in the future if we pull the hostname
+# from the transport specifier)
+DOFAILSETTEST certWithoutHost "-T trust_cert=$CAFP $FLAGS"
+
+########################################
+# Wildcard tests
+#
+DOSETTEST wildcardMatch "-T trust_cert=$CAFP -T their_hostname=*.b.example.com $FLAGS"
+
+DOFAILSETTEST noDoubleWildcard "-T trust_cert=$CAFP -T their_hostname=*.example.com $FLAGS"
+
+
+########################################
+# DONE
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/tls/STlsServerSession b/testing/fulltests/tls/STlsServerSession
new file mode 100644
index 0000000..acf68e5
--- /dev/null
+++ b/testing/fulltests/tls/STlsServerSession
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+. STlsVars
+
+# this is usually something like "localhost:", so we need to strip the :
+OURHOST=`echo $SNMP_TEST_DEST | sed 's/:.*//'`
+
+# create a CA
+
+CAPTURE $NSCERT genca --cn ca-net-snmp.org $NSCERTARGS
+CAFP=`$NSCERT showcas --fingerprint --brief ca-net-snmp.org $NSCERTARGS`
+CHECKVALUEISNT "$CAFP" "" "generated fingerprint for ca-net-snmp.org certificate"
+
+# create a server certificate using the CA certificate
+CAPTURE $NSCERT gencert -t snmpd --with-ca ca-net-snmp.org $checknametype ${checknameprefix}$OURHOST $NSCERTARGS
+SNMPDFP=`$NSCERT showcert --fingerprint --brief snmpd $NSCERTARGS`
+
+CONFIGAGENT '[snmp]' serverCert $SNMPDFP
+
+# create a user certificate
+CAPTURE $NSCERT gencert -t snmpapp --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmpapp $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+CONFIGAGENT certSecName 10 $TESTUSERFP --cn
+CONFIGAGENT rwuser -s tsm testuser authpriv
+
+CONFIGAPP clientCert $TESTUSERFP
+
+# start the agent up
+FLAGS="-On $SNMP_FLAGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT"
+
+# start up the agent
+STARTAGENT
+
+########################################
+# Positive tests
+# (should work)
+
+# ensure we can access it via a direct FP check
+DOSETTEST fingerprintIdentity "-T their_identity=$SNMPDFP $FLAGS"
+
+# directly specify the host name
+DOSETTEST hostnameIdentity "-T trust_cert=$CAFP -T their_hostname=$OURHOST $FLAGS"
+
+# This should also work because we:
+# - trust the CA cert
+# - use a session destname that matches the certificate
+DOSETTEST sessionnameIdentity "-T trust_cert=$CAFP $FLAGS"
+
+########################################
+# DONE
+
+#sleep 500
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/tls/STlsTrapdUser b/testing/fulltests/tls/STlsTrapdUser
new file mode 100644
index 0000000..e14c427
--- /dev/null
+++ b/testing/fulltests/tls/STlsTrapdUser
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+. STlsVars
+
+#########################################
+# CERTIFICATE SETUP
+#
+
+# produce the certificates to use
+
+# snmptrapd
+HOSTNAME=`hostname`
+CAPTURE $NSCERT gencert -t snmptrapdd --cn $HOSTNAME $NSCERTARGS
+SERVERFP=`$NSCERT showcerts --fingerprint --brief snmptrapdd $NSCERTARGS`
+CHECKVALUEISNT "$SERVERFP" "" "generated fingerprint for snmptrapdd certificate"
+
+# user
+CAPTURE $NSCERT gencert -t snmpapp --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmpapp $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+# CA certificate
+
+CAPTURE $NSCERT genca --cn ca-net-snmp.org $NSCERTARGS
+CAFP=`$NSCERT showcas --fingerprint --brief ca-net-snmp.org $NSCERTARGS`
+CHECKVALUEISNT "$CAFP" "" "generated fingerprint for ca-net-snmp.org certificate"
+
+# user 9: CA signed user cert
+CAPTURE $NSCERT gencert -t causer --with-ca ca-net-snmp.org --san email:user9@test.net-snmp.org --email user9@test.net-snmp.org $NSCERTARGS
+CAUSERFP=`$NSCERT showcerts --fingerprint --brief causer $NSCERTARGS`
+CHECKVALUEISNT "$CAUSERFP" "" "generated fingerprint for causer certificate"
+
+#########################################
+# AGENT CONFIGURATION
+#
+
+CONFIGTRAPD '[snmp]' debugTokens tsm
+# ,tls,ssl,cert,tsm
+CONFIGTRAPD '[snmp]' doDebugging 1
+CONFIGTRAPD '[snmp]' serverCert $SERVERFP
+
+CONFIGTRAPD '[snmp]' trustCert $CAFP
+
+# common name mappings
+CONFIGTRAPD certSecName 9 $TESTUSERFP --cn
+
+CONFIGTRAPD certSecName 100 $CAFP --rfc822
+
+CONFIGAPP serverCert $SERVERFP
+CONFIGAPP defSecurityModel tsm
+
+CONFIGTRAPD authuser log -s tsm testuser authpriv
+
+# this file contains tests common to both tls and dtls usages
+
+# start the agent up
+FLAGS="-Dtls -On $SNMP_FLAGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT"
+
+STARTTRAPD
+
+########################################
+# POST-TRAPD-STARTUP Certificates
+# user
+CAPTURE $NSCERT gencert -t snmptrap --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmptrap $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+######################################################################
+# ACTUAL TESTS
+#
+# Run the actual list of tests
+#
+
+# using user 1 - a common name mapped certificate
+# (using the default "snmpapp" certificate because we don't specify another)
+DOTRAPTEST user1TrapTest "$FLAGS"
+
+# failing using the CA signed cert without
+DOFAILTRAPTEST user2UnknownUser "-T our_identity=snmptrap $FLAGS"
+
+# using user 1 - sending an INFORM
+# (using the default "snmpapp" certificate because we don't specify another)
+DOTRAPTEST user1InformTest "-Ci $FLAGS"
+
+STOPTRAPD
+
+FINISHED
diff --git a/testing/fulltests/tls/STlsUsers b/testing/fulltests/tls/STlsUsers
new file mode 100644
index 0000000..2cb03a6
--- /dev/null
+++ b/testing/fulltests/tls/STlsUsers
@@ -0,0 +1,262 @@
+#!/bin/sh
+
+. STlsVars
+
+#########################################
+# CERTIFICATE SETUP
+#
+
+# produce the certificates to use
+
+# snmpd
+HOSTNAME=`hostname`
+CAPTURE $NSCERT gencert -t snmpd --cn $HOSTNAME $NSCERTARGS
+SERVERFP=`$NSCERT showcerts --fingerprint --brief snmpd $NSCERTARGS`
+CHECKVALUEISNT "$SERVERFP" "" "generated fingerprint for snmpd certificate"
+
+# user
+CAPTURE $NSCERT gencert -t snmpapp --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmpapp $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+# user 1.5
+CAPTURE $NSCERT gencert -t snmpapp2 --cn 'testuser2' $NSCERTARGS
+TESTUSER2FP=`$NSCERT showcerts --fingerprint --brief snmpapp2 $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSER2FP" "" "generated fingerprint for testuser certificate"
+
+# user 2
+CAPTURE $NSCERT gencert -t otheruser --cn 'otheruser' $NSCERTARGS
+OTHERUSERFP=`$NSCERT showcerts --fingerprint --brief otheruser $NSCERTARGS`
+CHECKVALUEISNT "$OTHERUSERFP" "" "generated fingerprint for otheruser certificate"
+
+# user 3
+CAPTURE $NSCERT gencert -t invaliduser --cn 'invaliduser' $NSCERTARGS
+INVALIDUSERFP=`$NSCERT showcerts --fingerprint --brief invaliduser $NSCERTARGS`
+CHECKVALUEISNT "$INVALIDUSERFP" "" "generated fingerprint for otheruser certificate"
+
+# user 4
+CAPTURE $NSCERT gencert -t unmapped --cn 'unmapped' $NSCERTARGS
+UNMAPPEDFP=`$NSCERT showcerts --fingerprint --brief unmapped $NSCERTARGS`
+CHECKVALUEISNT "$UNMAPPEDFP" "" "generated fingerprint for unmapped certificate"
+
+# user 5
+CAPTURE $NSCERT gencert -t mappeduser --cn 'mappeduser' $NSCERTARGS
+MAPPEDUSERFP=`$NSCERT showcerts --fingerprint --brief mappeduser $NSCERTARGS`
+CHECKVALUEISNT "$MAPPEDUSERFP" "" "generated fingerprint for mappeduser certificate"
+
+# user 6: SAN email
+CAPTURE $NSCERT gencert -t email --san email:foobaruser@example.com $NSCERTARGS
+EMAILUSERFP=`$NSCERT showcerts --fingerprint --brief email $NSCERTARGS`
+CHECKVALUEISNT "$EMAILUSERFP" "" "generated fingerprint for email certificate"
+
+# user 7: SAN dns
+CAPTURE $NSCERT gencert -t dns --san DNS:foobar.example.com $NSCERTARGS
+DNSUSERFP=`$NSCERT showcerts --fingerprint --brief dns $NSCERTARGS`
+CHECKVALUEISNT "$DNSUSERFP" "" "generated fingerprint for dns certificate"
+
+# user 8: SAN IPv4
+CAPTURE $NSCERT gencert -t ipaddr --san IP:127.0.0.1 $NSCERTARGS
+IPUSERFP=`$NSCERT showcerts --fingerprint --brief ipaddr $NSCERTARGS`
+CHECKVALUEISNT "$IPUSERFP" "" "generated fingerprint for ipaddr certificate"
+
+# user 8.1: afile
+CAPTURE $NSCERT gencert -t afile --cn afileuser $NSCERTARGS
+AFILEUSERFP=`$NSCERT showcerts --fingerprint --brief afile $NSCERTARGS`
+CHECKVALUEISNT "$AFILEUSERFP" "" "generated fingerprint for afile certificate"
+
+
+# CA certificate
+
+CAPTURE $NSCERT genca --cn ca-net-snmp.org $NSCERTARGS
+CAFP=`$NSCERT showcas --fingerprint --brief ca-net-snmp.org $NSCERTARGS`
+CHECKVALUEISNT "$CAFP" "" "generated fingerprint for ca-net-snmp.org certificate"
+
+# user 9: CA signed user cert
+CAPTURE $NSCERT gencert -t causer --with-ca ca-net-snmp.org --san email:user9@test.net-snmp.org --email user9@test.net-snmp.org $NSCERTARGS
+CAUSERFP=`$NSCERT showcerts --fingerprint --brief causer $NSCERTARGS`
+CHECKVALUEISNT "$CAUSERFP" "" "generated fingerprint for causer certificate"
+
+CAPTURE $NSCERT gencert -t cadirect9b --with-ca ca-net-snmp.org --san email:user9b@test.net-snmp.org --email user9b@test.net-snmp.org $NSCERTARGS
+CADIRECTFP=`$NSCERT showcerts --fingerprint --brief cadirect9b $NSCERTARGS`
+CHECKVALUEISNT "$CADIRECTFP" "" "generated fingerprint for cadirect certificate"
+
+CAPTURE $NSCERT genca --cn ca2-net-snmp.org $NSCERTARGS
+CA2FP=`$NSCERT showcas --fingerprint --brief ca2-net-snmp.org $NSCERTARGS`
+CHECKVALUEISNT "$CA2FP" "" "generated fingerprint for ca2-net-snmp.org certificate"
+
+CAPTURE $NSCERT gencert -t cadirect9c --with-ca ca2-net-snmp.org --san email:user9c@test.net-snmp.org --email user9c@test.net-snmp.org $NSCERTARGS
+CADIRECT9CFP=`$NSCERT showcerts --fingerprint --brief cadirect9c $NSCERTARGS`
+CHECKVALUEISNT "$CADIRECT9CFP" "" "generated fingerprint for cadirect9c certificate"
+
+CAPTURE $NSCERT gencert -t cadirect9d --with-ca ca2-net-snmp.org --san email:user9d@test.net-snmp.org --email user9d@test.net-snmp.org $NSCERTARGS
+CADIRECT9DFP=`$NSCERT showcerts --fingerprint --brief cadirect9d $NSCERTARGS`
+CHECKVALUEISNT "$CADIRECT9DFP" "" "generated fingerprint for cadirect9d certificate"
+
+#########################################
+# AGENT CONFIGURATION
+#
+
+CONFIGAGENT '[snmp]' debugTokens tsm
+# ,tls,ssl,cert,tsm
+CONFIGAGENT '[snmp]' doDebugging 1
+CONFIGAGENT '[snmp]' logTimestamp 1
+CONFIGAGENT '[snmp]' serverCert $SERVERFP
+
+CONFIGAGENT '[snmp]' trustCert $CAFP
+CONFIGAGENT '[snmp]' trustCert $CADIRECT9CFP
+
+# common name mappings
+CONFIGAGENT certSecName 9 $TESTUSERFP --cn
+CONFIGAGENT certSecName 10 $TESTUSER2FP --cn
+CONFIGAGENT certSecName 11 $OTHERUSERFP --cn
+CONFIGAGENT certSecName 12 $INVALIDUSERFP --cn
+
+CONFIGAGENT certSecName 20 $MAPPEDUSERFP --sn aftermapping
+CONFIGAGENT certSecName 21 $EMAILUSERFP --rfc822
+CONFIGAGENT certSecName 22 $DNSUSERFP --dns
+CONFIGAGENT certSecName 23 $IPUSERFP --ip
+CONFIGAGENT certSecName 24 afile --cn
+
+CONFIGAGENT certSecName 100 $CAFP --rfc822
+CONFIGAGENT certSecName 101 $CADIRECTFP --sn causerdirectmap
+CONFIGAGENT certSecName 102 $CADIRECT9CFP --sn causerdirect9cmap
+# intentionally not mapped:
+#CONFIGAGENT certSecName 1001 $CADIRECT9DFP --sn causerdirect9dmap
+
+# *** INTENTIONALLY NOT MAPPING AT ALL: ***
+# CONFIGAGENT certSecName 1000 $UNMAPPEDFP ....
+
+CONFIGAPP serverCert $SERVERFP
+CONFIGAPP defSecurityModel tsm
+CONFIGAPP logTimestamp 1
+
+CONFIGAGENT rwuser -s tsm testuser authpriv
+CONFIGAGENT rwuser -s tsm testuser2 authpriv
+CONFIGAGENT rwuser -s tsm otheruser authpriv
+CONFIGAGENT rwuser -s tsm aftermapping authpriv
+
+CONFIGAGENT rwuser -s tsm foobaruser@example.com authpriv
+CONFIGAGENT rwuser -s tsm foobar.example.com authpriv
+CONFIGAGENT rwuser -s tsm 127.0.0.1 authpriv
+CONFIGAGENT rwuser -s tsm user8@test.net-snmp.org authpriv
+CONFIGAGENT rwuser -s tsm user9@test.net-snmp.org authpriv
+CONFIGAGENT rwuser -s tsm user10@test.net-snmp.org authpriv
+CONFIGAGENT rwuser -s tsm afileuser authpriv
+CONFIGAGENT rwuser -s tsm causerdirectmap authpriv
+CONFIGAGENT rwuser -s tsm causerdirect9cmap authpriv
+
+
+# this file contains tests common to both tls and dtls usages
+
+# start the agent up
+FLAGS="-Dtls -v3 -On $SNMP_FLAGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT"
+
+STARTAGENT
+
+# shouldn't have config errors
+CHECKAGENTCOUNT 0 ": Error:"
+
+######################################################################
+# EXTENDED CERTIFICATE SETUP
+#
+# Perform more steps of configuration that should occur *after* the
+# agent has started in order to prevent it from having seen these
+# files ahead of time.
+
+# this user's fingerprint should not be recognized
+CAPTURE $NSCERT gencert -t unknownuser --san email:unknownuser@example.com $NSCERTARGS
+UNKNOWNUSER=`$NSCERT showcerts --fingerprint --brief unknownuser $NSCERTARGS`
+CHECKVALUEISNT "$UNMAPPEDFP" "" "generated fingerprint for unknownuser certificate"
+
+# this user's fingerprint should not be directly recognized, but it's
+# CA should.
+
+# user 10: CA signed cert
+CAPTURE $NSCERT gencert -D -t unknowncauser --cn unknowncauser@net-snmp.org --email unknowncauser@net-snmp.org --with-ca ca-net-snmp.org --san email:user10@test.net-snmp.org $NSCERTARGS
+UNKNOWNCAUSERFP=`$NSCERT showcerts --fingerprint --brief unknowncauser $NSCERTARGS`
+CHECKVALUEISNT "$UNKNOWNCAUSERFP" "" "generated fingerprint for unknowncauser certificate"
+
+######################################################################
+# ACTUAL TESTS
+#
+# Run the actual list of tests
+#
+
+# using user 1 - a common name mapped certificate
+# (using the default "snmpapp" certificate because we don't specify another)
+DOSETTEST user1SnmpApp "$FLAGS"
+
+# now rerun the test after specifying our default using the (same) fingerprint
+CONFIGAPP clientCert $TESTUSER2FP
+DOSETTEST user1ClientPub "$FLAGS"
+
+# using user 2 - a common name mapped certificate with a direct -T FP request
+DOSETTEST user2DashTFPFlag "-T our_identity=$OTHERUSERFP $FLAGS"
+
+CHECKAGENTCOUNT 4 "otheruser"
+
+# using user 2, specifying the file name instead of the fingerprint
+DOSETTEST user2DashTFileFlag "-T our_identity=otheruser $FLAGS"
+
+CHECKAGENTCOUNT 8 "otheruser"
+
+# using user 3 - an invalid certificate (mapped but not authorized)
+DOFAILSETTEST "invalidUnauthorizedCert" "-T our_identity=$INVALIDUSERFP $FLAGS"
+
+CHECK "authorizationError"
+
+# using user 4 - an unmapped certificate
+DOFAILSETTEST "unmappedCertificate" "-T our_identity=$UNMAPPEDFP $FLAGS"
+
+CHECK "failed rfc5343"
+
+# Check *their* certificate with a different one than expected; should fail
+DOFAILSETTEST "incorectServerCertificate" "-r 0 -T our_identity=$OTHERUSERFP -T their_identity=$OTHERUSERFP $FLAGS"
+
+CHECK "failed to verify ssl certificate"
+
+# using user 5 - a completely remapped certificate (direct specified secname)
+DOSETTEST user5RemappedSecname "-T our_identity=$MAPPEDUSERFP $FLAGS"
+
+# using user 6 - a subjectAltName=email certificate mapping
+DOSETTEST user6SANEmail "-T our_identity=$EMAILUSERFP $FLAGS"
+
+# using user 7 - a subjectAltName=dns certificate mapping
+DOSETTEST user7SANDNS "-T our_identity=$DNSUSERFP $FLAGS"
+
+# using user 8 - a subjectAltName=ipv4 certificate mapping
+DOSETTEST user8SANIP "-T our_identity=$IPUSERFP $FLAGS"
+
+# using user 8 - test that certmapping works from a local filename
+DOSETTEST afileuser "-T our_identity=afile $FLAGS"
+
+# using user 9 - a CA signed certificate
+DOSETTEST user9CASignedCert "-T our_identity=$CAUSERFP -T trust_cert=$CAFP $FLAGS"
+
+# using user 9b - a CA signed certificate with a user-based fp mapping
+DOSETTEST user9bCASignedDirectMap "-T our_identity=$CADIRECTFP $FLAGS"
+
+# using user 9c - a CA2 signed certificate with a user-based fp mapping
+DOSETTEST user9cCASignedDirectMap "-T our_identity=$CADIRECT9CFP $FLAGS"
+
+# using user 9d - a CA2 signed certificate no user-based fp mapping
+DOFAILSETTEST user9dCASignedDirectMap "-T our_identity=$CADIRECT9DFP $FLAGS"
+
+# using user unknown - the server will not have seen this fingerprint at all
+CAPTURE "snmpget -T our_identity=$UNKNOWNUSER -T trust_cert=$CAFP $FLAGS .1.3.6.1.2.1.1.6.0"
+
+# different types of failure messaages for tls/dtls...
+if [ $SNMP_TRANSPORT_SPEC = dtlsudp ]; then
+ CHECK "failed rfc5343 contextEngineID probing"
+ CHECKAGENTCOUNT 1 "TLS Error: no certificate returned"
+else
+ CHECK "failed to ssl_connect"
+ CHECKAGENTCOUNT 1 "Failed SSL_accept"
+fi
+
+# using the user without a known fingerprint but with a known CA
+DOSETTEST userNewFromCA " -T trust_cert=$CAFP -T our_identity=$UNKNOWNCAUSERFP $FLAGS"
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/tls/STlsVars b/testing/fulltests/tls/STlsVars
new file mode 100644
index 0000000..bba84f9
--- /dev/null
+++ b/testing/fulltests/tls/STlsVars
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPTRAPD_PORT
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+
+export NET_SNMP_CRT_CFGTOOL="${builddir}/net-snmp-config"
+NSCERT="perl $SNMP_BASEDIR/../../../local/net-snmp-cert -I"
+NSCERTARGS="-C $SNMP_TMPDIR"
+
+DOSETTEST() {
+ value=$1
+ args=$2
+
+ # SNMPv2-MIB::sysLocation.0
+ CAPTURE "snmpset $args .1.3.6.1.2.1.1.6.0 s '$value'"
+
+ CAPTURE "snmpget $args .1.3.6.1.2.1.1.6.0"
+
+ CHECK "STRING: '$value'"
+}
+
+
+DOFAILSETTEST() {
+ value=$1
+ args=$2
+
+ # SNMPv2-MIB::sysLocation.0
+ CAPTURE "snmpset $args .1.3.6.1.2.1.1.6.0 s '$value'"
+
+ CAPTURE "snmpget $args .1.3.6.1.2.1.1.6.0"
+
+ CHECKCOUNT 0 "$value"
+}
+
+DOTRAPTEST() {
+ value=$1
+ args=$2
+
+ # IF-MIB::linkUp
+ CAPTURE "snmptrap $args 0 .1.3.6.1.6.3.1.1.5.4 system.sysContact.0 s $value"
+
+ CHECKTRAPD "STRING: $value"
+}
+
+DOFAILTRAPTEST() {
+ value=$1
+ args=$2
+
+ # IF-MIB::linkUp
+ CAPTURE "snmptrap $args 0 .1.3.6.1.6.3.1.1.5.4 system.sysContact.0 s $value"
+
+ CHECKTRAPDCOUNT 0 "$value"
+}
+
diff --git a/testing/fulltests/tls/STsmPrefix b/testing/fulltests/tls/STsmPrefix
new file mode 100644
index 0000000..ec0f8d6
--- /dev/null
+++ b/testing/fulltests/tls/STsmPrefix
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+. STlsVars
+
+# this file contains tests common to both tls and dtls usages
+
+export NET_SNMP_CRT_CFGTOOL="${builddir}/net-snmp-config"
+NSCERT="perl $SNMP_BASEDIR/../../../local/net-snmp-cert"
+NSCERTARGS="-I -C $SNMP_TMPDIR"
+
+TLSDIR=$SNMP_TMPDIR/tls
+
+#########################################
+# Create the certificates
+
+# create the ca
+CAPTURE $NSCERT genca --cn ca-net-snmp.org $NSCERTARGS
+
+# snmpd
+HOSTNAME=`hostname`
+CAPTURE $NSCERT gencert --with-ca ca-net-snmp.org -t snmpd --cn $HOSTNAME $NSCERTARGS
+SERVERFP=`$NSCERT showcerts --fingerprint --brief snmpd $NSCERTARGS`
+CHECKVALUEISNT "$SERVERFP" "" "generated fingerprint for snmpd certificate"
+
+# user
+CAPTURE $NSCERT gencert --with-ca ca-net-snmp.org -t snmpapp --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmpapp $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+# user2
+CAPTURE $NSCERT gencert --with-ca ca-net-snmp.org -t snmpapp2 --cn 'testuser2' $NSCERTARGS
+TESTUSER2FP=`$NSCERT showcerts --fingerprint --brief snmpapp2 $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSER2FP" "" "generated fingerprint for testuser2 certificate"
+
+CONFIGAPP serverCert $SERVERFP
+CONFIGAGENT certSecName 9 $TESTUSERFP --cn
+CONFIGAGENT certSecName 10 $TESTUSER2FP --cn
+CONFIGAGENT rwuser -s tsm testuser authpriv
+CONFIGAGENT rwuser -s tsm $TSM_PREFIX:testuser2 authpriv
+CONFIGAGENT rocommunity public
+
+#
+# Start the agent
+#
+AGENT_FLAGS="-Dtsm udp:9999"
+FLAGS="-On $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT"
+STARTAGENT
+
+CAPTURE "snmpget -Dssl $FLAGS .1.3.6.1.2.1.190.1.2.1.0"
+CHECK ".1.3.6.1.2.1.190.1.2.1.0 = INTEGER: false"
+
+# using user 1 - a common name mapped certificate
+# (using the default "snmpapp" certificate because we don't specify another)
+CAPTURE "snmpget -Dssl $FLAGS .1.3.6.1.2.1.1.3.0"
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+# using user 2 should now fail because no prefix is applied
+CAPTURE "snmpget -T our_identity=snmpapp2 -Dssl $FLAGS .1.3.6.1.2.1.1.3.0"
+
+CHECKCOUNT 0 ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+CHECK "authorizationError"
+
+# set the TSM prefix scalar to 1 to turn on prefixing
+CAPTURE "snmpset -Dssl $FLAGS .1.3.6.1.2.1.190.1.2.1.0 i 1"
+
+
+# using user 2 should now work and the prefix should have been added
+# to the securityName, so the agent now accepts it
+CAPTURE "snmpget -T our_identity=snmpapp2 -Dssl $FLAGS .1.3.6.1.2.1.190.1.2.1.0"
+
+CHECK ".1.3.6.1.2.1.190.1.2.1.0 = INTEGER: true"
+
+# using user 1 should now fail because the prefix has added to the
+# securityName, so the agent now accepts it
+CAPTURE "snmpget -Dssl $FLAGS .1.3.6.1.2.1.1.3.0"
+
+CHECKCOUNT 0 ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+CHECK "authorizationError"
+
+CAPTURE "snmpget -v 1 -c public 127.0.0.1:9999 .1.3.6.1.2.1.190.1.2.1.0"
+
+# cleanup
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/tls/T101DtlsUser_simple b/testing/fulltests/tls/T101DtlsUser_simple
new file mode 100755
index 0000000..10caede
--- /dev/null
+++ b/testing/fulltests/tls/T101DtlsUser_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP user certificate tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+
+. ./STlsUsers
diff --git a/testing/fulltests/tls/T102TlsUser_simple b/testing/fulltests/tls/T102TlsUser_simple
new file mode 100644
index 0000000..a3fe119
--- /dev/null
+++ b/testing/fulltests/tls/T102TlsUser_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP user certificate tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+
+. ./STlsUsers
diff --git a/testing/fulltests/tls/T111DtlsServer_simple b/testing/fulltests/tls/T111DtlsServer_simple
new file mode 100644
index 0000000..6b42494
--- /dev/null
+++ b/testing/fulltests/tls/T111DtlsServer_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP server certificate tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+
+. ./STlsName
diff --git a/testing/fulltests/tls/T112TlsServer_simple b/testing/fulltests/tls/T112TlsServer_simple
new file mode 100644
index 0000000..adefa94
--- /dev/null
+++ b/testing/fulltests/tls/T112TlsServer_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP server certificate tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+
+. ./STlsName
diff --git a/testing/fulltests/tls/T113DtlsSan_simple b/testing/fulltests/tls/T113DtlsSan_simple
new file mode 100644
index 0000000..1edb3c5
--- /dev/null
+++ b/testing/fulltests/tls/T113DtlsSan_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP server SAN tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+
+. ./STlsSan
diff --git a/testing/fulltests/tls/T114TlsSan_simple b/testing/fulltests/tls/T114TlsSan_simple
new file mode 100644
index 0000000..af5e8bc
--- /dev/null
+++ b/testing/fulltests/tls/T114TlsSan_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP server SAN tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+
+. ./STlsSan
diff --git a/testing/fulltests/tls/T115DtlsSanSession_simple b/testing/fulltests/tls/T115DtlsSanSession_simple
new file mode 100644
index 0000000..b9d5fcd
--- /dev/null
+++ b/testing/fulltests/tls/T115DtlsSanSession_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP server SAN tests using session desthost
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+
+. ./STlsSanSession
diff --git a/testing/fulltests/tls/T116TlsSanSession_simple b/testing/fulltests/tls/T116TlsSanSession_simple
new file mode 100644
index 0000000..191fcf3
--- /dev/null
+++ b/testing/fulltests/tls/T116TlsSanSession_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP server SAN tests using session desthost
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+
+. ./STlsSanSession
diff --git a/testing/fulltests/tls/T117DtlsCNSession_simple b/testing/fulltests/tls/T117DtlsCNSession_simple
new file mode 100644
index 0000000..0beea55
--- /dev/null
+++ b/testing/fulltests/tls/T117DtlsCNSession_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP server commonName tests using session desthost
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+
+. ./STlsCNSession
diff --git a/testing/fulltests/tls/T118TlsCNSession_simple b/testing/fulltests/tls/T118TlsCNSession_simple
new file mode 100644
index 0000000..305ab46
--- /dev/null
+++ b/testing/fulltests/tls/T118TlsCNSession_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP server commonName tests using session desthost
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+
+. ./STlsCNSession
diff --git a/testing/fulltests/tls/T121DtlsTrap_simple b/testing/fulltests/tls/T121DtlsTrap_simple
new file mode 100644
index 0000000..5c7c7bc
--- /dev/null
+++ b/testing/fulltests/tls/T121DtlsTrap_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP trap tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+
+. ./STlsTrapdUser
diff --git a/testing/fulltests/tls/T122TlsTrap_simple b/testing/fulltests/tls/T122TlsTrap_simple
new file mode 100644
index 0000000..e8aee17
--- /dev/null
+++ b/testing/fulltests/tls/T122TlsTrap_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP trap tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+
+. ./STlsTrapdUser
diff --git a/testing/fulltests/tls/T131DtlsAgentTrap_simple b/testing/fulltests/tls/T131DtlsAgentTrap_simple
new file mode 100644
index 0000000..846faa9
--- /dev/null
+++ b/testing/fulltests/tls/T131DtlsAgentTrap_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP agent trap tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+
+. ./STlsAgentTrap
diff --git a/testing/fulltests/tls/T132TlsAgentTrap_simple b/testing/fulltests/tls/T132TlsAgentTrap_simple
new file mode 100644
index 0000000..cb44013
--- /dev/null
+++ b/testing/fulltests/tls/T132TlsAgentTrap_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP agent trap tests
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+
+. ./STlsAgentTrap
diff --git a/testing/fulltests/tls/T141DtlsCrl_simple b/testing/fulltests/tls/T141DtlsCrl_simple
new file mode 100644
index 0000000..92a8e4f
--- /dev/null
+++ b/testing/fulltests/tls/T141DtlsCrl_simple
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP CRL Handling
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+
+. ./SCrl
diff --git a/testing/fulltests/tls/T142TlsCrl_simple b/testing/fulltests/tls/T142TlsCrl_simple
new file mode 100644
index 0000000..2723c13
--- /dev/null
+++ b/testing/fulltests/tls/T142TlsCrl_simple
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP CRL Handling
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+
+. ./SCrl
diff --git a/testing/fulltests/tls/T151DtlsCiphers_simple b/testing/fulltests/tls/T151DtlsCiphers_simple
new file mode 100644
index 0000000..6cbbec4
--- /dev/null
+++ b/testing/fulltests/tls/T151DtlsCiphers_simple
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP Cipher Selection
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+
+. SCipherTests
diff --git a/testing/fulltests/tls/T152TlsCiphers_simple b/testing/fulltests/tls/T152TlsCiphers_simple
new file mode 100644
index 0000000..c828dc9
--- /dev/null
+++ b/testing/fulltests/tls/T152TlsCiphers_simple
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP Cipher Selection
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+
+. SCipherTests
diff --git a/testing/fulltests/tls/T200TlsIpv6_simple b/testing/fulltests/tls/T200TlsIpv6_simple
new file mode 100644
index 0000000..5e37f4c
--- /dev/null
+++ b/testing/fulltests/tls/T200TlsIpv6_simple
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP over IPV6
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+SKIPIFNOT NETSNMP_TRANSPORT_TLSIPV6_DOMAIN
+
+# ensure we have a localhost6 entry
+
+# XXX: this stems from broken issues in openssl that refuse [::1]:
+# style accept strings (it works for client connections).
+grep localhost6 /etc/hosts > /dev/null 2>&1
+if [ $? = 1 ] ; then
+ SKIP This test requires a localhost6 entry in /etc/hosts
+fi
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+SNMP_TEST_DEST='localhost6:'
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+
+. ../transports/Stlstests
diff --git a/testing/fulltests/tls/T300TlsPerl.t b/testing/fulltests/tls/T300TlsPerl.t
new file mode 100644
index 0000000..fb8edb9
--- /dev/null
+++ b/testing/fulltests/tls/T300TlsPerl.t
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+
+# HEADER Perl TLS/TCP Test
+
+$agentaddress = "tlstcp:localhost:9875";
+$feature = "NETSNMP_TRANSPORT_TLSTCP_DOMAIN";
+
+do "$ENV{'srcdir'}/testing/fulltests/tls/S300tlsperl.pl";
diff --git a/testing/fulltests/tls/T301DtlsPerl.t b/testing/fulltests/tls/T301DtlsPerl.t
new file mode 100644
index 0000000..3d980c7
--- /dev/null
+++ b/testing/fulltests/tls/T301DtlsPerl.t
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+
+# HEADER Perl DTLS/UDP Test
+
+$agentaddress = "dtlsudp:localhost:9875";
+$feature = "NETSNMP_TRANSPORT_TLSTCP_DOMAIN";
+
+do "$ENV{'srcdir'}/testing/fulltests/tls/S300tlsperl.pl";
diff --git a/testing/fulltests/tls/T401DtlsTsmPrefix_simple b/testing/fulltests/tls/T401DtlsTsmPrefix_simple
new file mode 100644
index 0000000..dc85ad9
--- /dev/null
+++ b/testing/fulltests/tls/T401DtlsTsmPrefix_simple
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TSM prefixing support for DTLS/UDP
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+TSM_PREFIX=dtls
+
+. ./STsmPrefix
diff --git a/testing/fulltests/tls/T402TlsTsmPrefix_simple b/testing/fulltests/tls/T402TlsTsmPrefix_simple
new file mode 100644
index 0000000..0c62eef
--- /dev/null
+++ b/testing/fulltests/tls/T402TlsTsmPrefix_simple
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TSM prefixing support for TLS/TCP
+
+SKIPIFNOT NETSNMP_TRANSPORT_TLSTCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+TSM_PREFIX=tls
+
+. ./STsmPrefix
diff --git a/testing/fulltests/transports/Stlstests b/testing/fulltests/transports/Stlstests
new file mode 100644
index 0000000..21b2b82
--- /dev/null
+++ b/testing/fulltests/transports/Stlstests
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# this file contains tests common to both tls and dtls usages
+
+export NET_SNMP_CRT_CFGTOOL="${builddir}/net-snmp-config"
+NSCERT="perl $SNMP_BASEDIR/../../../local/net-snmp-cert -I"
+NSCERTARGS="-C $SNMP_TMPDIR"
+
+#########################################
+# Create the certificates
+
+# snmpd
+HOSTNAME=`hostname`
+CAPTURE $NSCERT gencert -t snmpd --cn $HOSTNAME $NSCERTARGS
+SERVERFP=`$NSCERT showcerts --fingerprint --brief snmpd $NSCERTARGS`
+CHECKVALUEISNT "$SERVERFP" "" "generated fingerprint for snmpd certificate"
+
+# user
+CAPTURE $NSCERT gencert -t snmpapp --cn 'testuser' $NSCERTARGS
+TESTUSERFP=`$NSCERT showcerts --fingerprint --brief snmpapp $NSCERTARGS`
+CHECKVALUEISNT "$TESTUSERFP" "" "generated fingerprint for testuser certificate"
+
+########################################
+# Configure the .conf files
+
+CONFIGAPP serverCert $SERVERFP
+
+# common name mappings
+CONFIGAGENT certSecName 9 $TESTUSERFP --cn
+CONFIGAGENT rwuser -s tsm testuser authpriv
+
+######################################################################
+# Run the actual list of tests
+#
+
+# start the agent up
+FLAGS="-On $SNMP_FLAGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT"
+
+STARTAGENT
+
+# using user 1 - a common name mapped certificate
+# (using the default "snmpapp" certificate because we don't specify another)
+CAPTURE "snmpget $FLAGS .1.3.6.1.2.1.1.3.0"
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+STOPAGENT
+
+FINISHED
diff --git a/testing/fulltests/transports/Stransport b/testing/fulltests/transports/Stransport
new file mode 100755
index 0000000..b33ff57
--- /dev/null
+++ b/testing/fulltests/transports/Stransport
@@ -0,0 +1,18 @@
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+
+# configure the agent to accept user initial with noAuthNoPriv
+. ../default/Sv3config
+
+STARTAGENT
+
+CAPTURE "snmpget -On $SNMP_FLAGS $NOAUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
+
+STOPAGENT
+
+CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
+
+FINISHED
diff --git a/testing/fulltests/transports/T300udp_simple b/testing/fulltests/transports/T300udp_simple
new file mode 100644
index 0000000..65a67f0
--- /dev/null
+++ b/testing/fulltests/transports/T300udp_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER UDP Transport
+
+SKIPIFNOT NETSNMP_TRANSPORT_UDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=udp
+
+. ./Stransport
diff --git a/testing/fulltests/transports/T310tcp_simple b/testing/fulltests/transports/T310tcp_simple
new file mode 100644
index 0000000..50c6a8a
--- /dev/null
+++ b/testing/fulltests/transports/T310tcp_simple
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TCP Transport
+
+SKIPIFNOT NETSNMP_TRANSPORT_TCP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tcp
+
+. ./Stransport
diff --git a/testing/fulltests/transports/T320udpv6_simple b/testing/fulltests/transports/T320udpv6_simple
new file mode 100644
index 0000000..6a607c6
--- /dev/null
+++ b/testing/fulltests/transports/T320udpv6_simple
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER UDP6 Transport
+
+SKIPIFNOT NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=udp6
+SNMP_TEST_DEST="[::1]:"
+
+. ./Stransport
diff --git a/testing/fulltests/transports/T330tcpv6_simple b/testing/fulltests/transports/T330tcpv6_simple
new file mode 100644
index 0000000..09eb350
--- /dev/null
+++ b/testing/fulltests/transports/T330tcpv6_simple
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TCP6 Transport
+
+SKIPIFNOT NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tcp6
+SNMP_TEST_DEST="[::1]:"
+
+. ./Stransport
diff --git a/testing/fulltests/transports/T350unix_simple b/testing/fulltests/transports/T350unix_simple
new file mode 100644
index 0000000..053ba1f
--- /dev/null
+++ b/testing/fulltests/transports/T350unix_simple
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER Unix Transport
+
+SKIPIFNOT NETSNMP_TRANSPORT_UNIX_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=unix
+SNMP_TEST_DEST=${SNMP_TMPDIR}/testunixsocket
+
+. ./Stransport
+
+# cleanup
+rm -f $SNMP_TEST_DEST
diff --git a/testing/fulltests/transports/T360dtlsudp_simple b/testing/fulltests/transports/T360dtlsudp_simple
new file mode 100644
index 0000000..5899378
--- /dev/null
+++ b/testing/fulltests/transports/T360dtlsudp_simple
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER DTLS-UDP Transport
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=dtlsudp
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+
+. ./Stlstests
diff --git a/testing/fulltests/transports/T361tlstcp_simple b/testing/fulltests/transports/T361tlstcp_simple
new file mode 100644
index 0000000..7972a2e
--- /dev/null
+++ b/testing/fulltests/transports/T361tlstcp_simple
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER TLS-TCP Transport
+
+SKIPIFNOT NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
+
+#
+# Begin test
+#
+
+SNMP_TRANSPORT_SPEC=tlstcp
+export SNMP_TRANSPORT_SPEC
+export SNMP_SNMPD_PORT
+export SNMP_TEST_DEST
+
+. ./Stlstests
diff --git a/testing/fulltests/transports/T399alias_simple b/testing/fulltests/transports/T399alias_simple
new file mode 100644
index 0000000..5f48311
--- /dev/null
+++ b/testing/fulltests/transports/T399alias_simple
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER ALIAS Transport
+
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+SKIPIFNOT NETSNMP_TRANSPORT_ALIAS_DOMAIN
+
+#
+# Begin test
+#
+
+# configure the agent to accept user initial with noAuthNoPriv
+. ../default/Sv3config
+
+CONFIGAPP alias aliastest udp:localhost:$SNMP_SNMPD_PORT
+CONFIGAGENT '[snmp]' alias aliastest udp:localhost:$SNMP_SNMPD_PORT
+
+SNMP_TRANSPORT_SPEC=alias
+SNMP_TEST_DEST="aliastest"
+SNMP_SNMPD_PORT=""
+
+. ./Stransport
diff --git a/testing/fulltests/transports/test-localhost.cert b/testing/fulltests/transports/test-localhost.cert
new file mode 100644
index 0000000..2b49b26
--- /dev/null
+++ b/testing/fulltests/transports/test-localhost.cert
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----
+MIID2jCCAsKgAwIBAgIJAISEQRgZJXH4MA0GCSqGSIb3DQEBBQUAMFExCzAJBgNV
+BAYTAlVTMQswCQYDVQQIEwJDQTEOMAwGA1UEBxMFRGF2aXMxETAPBgNVBAoTCE5l
+dC1TTk1QMRIwEAYDVQQDEwlsb2NhbGhvc3QwHhcNMDkwNzA5MjMzNjMwWhcNMDkw
+ODA4MjMzNjMwWjBRMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDjAMBgNVBAcT
+BURhdmlzMREwDwYDVQQKEwhOZXQtU05NUDESMBAGA1UEAxMJbG9jYWxob3N0MIIB
+IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4yjcQ7njcwny6NsFgM5WwEcV
+GtVe+h2k41JU9lJ9I1Eg7kRsSfJ7z9jX5JXpHXUXq54Mt/sLODeheyE8z5Zwjplc
+MGxLiPdRRp/3Bmlh3qrPLRLR17B+1MkcIz9UBUut2PusxEeCeA/g8RVEwK8oPger
+4I+KaXonXWmhm85EEHlWmZHTDTDa6MXURNs+EqcQrWRgHyf8bQhwpSjBzmbUtVq5
+ipVNWmqxPlSTkj5CqkrbNdkpOIBvZ6ThFfi2rwPDO+YzrucFcM+BfKRCDBcC4TsN
+2z0S1IseJGTNO1iidMrjCVzoIbMB+GouXjLJXAuLIF0X3dP+yOZzeSt5J2vCgQID
+AQABo4G0MIGxMB0GA1UdDgQWBBR+ZduNAGvbAtjo8+7DPUOI5CpQRjCBgQYDVR0j
+BHoweIAUfmXbjQBr2wLY6PPuwz1DiOQqUEahVaRTMFExCzAJBgNVBAYTAlVTMQsw
+CQYDVQQIEwJDQTEOMAwGA1UEBxMFRGF2aXMxETAPBgNVBAoTCE5ldC1TTk1QMRIw
+EAYDVQQDEwlsb2NhbGhvc3SCCQCEhEEYGSVx+DAMBgNVHRMEBTADAQH/MA0GCSqG
+SIb3DQEBBQUAA4IBAQCa2+5tz+fmgw9h8AF9l++8M1Lnzqrmsvy45phxx5f/rZe8
+BrspMlrT6bKcM9CTqezjkDZOrGEuYvcbMea2ntlXG0CIMxhWpgczwxZizGYIN6f1
+CK5siPlOzKObpkAwUjWbLm7N2BJGKp3FMq11Jt31tUwJTBc5viYzWBCQV4CxVoL5
+MqMfVyKjOK0eqgMvtrRgZ6t/098OiE4USheW+++b0zzo8Um/YIA9JQmCbZ4bh6jd
+/AgZhKRR5bXiOGmCLVweDV4MTi12Y285GBbylbdDuj8YV7mu7NzOn5kJ6xI00Vuc
+bGWtdcpEGkW7Zn4YCuxszpqtM3jLGZHCUqCuKSeP
+-----END CERTIFICATE-----
diff --git a/testing/fulltests/transports/test-localhost.priv b/testing/fulltests/transports/test-localhost.priv
new file mode 100644
index 0000000..2e2a8eb
--- /dev/null
+++ b/testing/fulltests/transports/test-localhost.priv
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEA4yjcQ7njcwny6NsFgM5WwEcVGtVe+h2k41JU9lJ9I1Eg7kRs
+SfJ7z9jX5JXpHXUXq54Mt/sLODeheyE8z5ZwjplcMGxLiPdRRp/3Bmlh3qrPLRLR
+17B+1MkcIz9UBUut2PusxEeCeA/g8RVEwK8oPger4I+KaXonXWmhm85EEHlWmZHT
+DTDa6MXURNs+EqcQrWRgHyf8bQhwpSjBzmbUtVq5ipVNWmqxPlSTkj5CqkrbNdkp
+OIBvZ6ThFfi2rwPDO+YzrucFcM+BfKRCDBcC4TsN2z0S1IseJGTNO1iidMrjCVzo
+IbMB+GouXjLJXAuLIF0X3dP+yOZzeSt5J2vCgQIDAQABAoIBADH4niPj864t5Rrm
+e5pvSdQ4juL9R0x8UvaS+Q/K665mPXlM4gmOZ0A88pldhQ+u34soVKHwfvJaApME
+p8z+yjoEcKxSVneF+IIx1HS7oAUMzFCdED6DnBMRPrheSQx1LoRKMSJonMHutEw0
+opBEt/SVWXEoAonbjmdVQnD0+jIpJRHYvPj8TWGtv7Vl7nHVTQBUYy+jd1CBQ4jA
+emHK5IGx++ytrfNXA1uDa38t8cSHg2Kpr8vhwkzZWVxskS46wSP/sPBqK/wg+Fxd
+8WovaGXpiyLb2Kj15rHBqd5wFeKHGJI/Q/X4qVvxLjKGeFJ1GDNvvg8mevRZ9Rei
+yIBu8oUCgYEA895WxeaC0S8dKZVAR7eXLauHUQ/lAIjql8OtdsHBfpTRLWvs9IpQ
+8y0n4sgcB/4iaBVVp8W414zjutCxXJrq5ZHKOi5zVqpPsamkKQYnGKfbU2q0WptD
+T1z2pLSk1L/MHjhbuwZbe0Hxf7vPg10loukFlUGkEajaHKOnhy1/BtcCgYEA7nW7
+4VmVcDM8yYblNNQPv2THoowZJlST9v7+Q9pjoYMYvruQWKcZyIjFSt9hetrfBtxO
++QxUqvfB8d/RSzg7wF7AmWHa3EfgT7h3X8glh7isb9YIRn6qBtxysWTXRqNGM+Wf
+hxylFQXezJPZ0hSbdXZThhwvvzD41Zbjq3XJzmcCgYEAoA4MO4Tn1O0sIa+gabF4
+GnRasnxRG4HBHmxCPBA8s5xukXYlJfZl3MSFShV2OFS2NkPSXPOrNmV0zZbM4W+X
+vaZq6La14mqTNZKWeIpePJNmoqAE0PbYPY1RH5akHDHpgOgSZHRutD36h5A3SQto
+eTyg+m4Dhcehp2xNtq3Iki8CgYEA3vPPTVxv/264iAgK58DaVG3KxezNWuw7R/WU
+ECbxfkJPcY124Zyi278dD+sZfj+DxStY3zwrMYril95XFkgmfa9Zzk8SzWCalo73
+deNxS5tcBliMdjTZjf6xcbDCIrZn3f/0juQ2aRiK/qXCQ8ymqUWPxFU4Qz9reHBS
+v64qmEMCgYEAsumq+jUoa3qYna45vyBMQf6NJLWCFYXloAtKVTECCb88T6MVyrOE
+cyj0Ybek+iezN8tbJHqiSWVtnRA9kjrC0ArwOKDipNFRkFogpURajzb/LnUQdW+P
+rOtNuLaNnLVo2kiK4QNbd+3BJQCDPBcZQq6dGccvyNXYVtfExY4WI2c=
+-----END RSA PRIVATE KEY-----
diff --git a/testing/fulltests/transports/test-user.cert b/testing/fulltests/transports/test-user.cert
new file mode 100644
index 0000000..4d56b35
--- /dev/null
+++ b/testing/fulltests/transports/test-user.cert
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----
+MIID4zCCAsugAwIBAgIJAIpBQHzq+nhbMA0GCSqGSIb3DQEBBQUAMFQxCzAJBgNV
+BAYTAlVTMQswCQYDVQQIEwJDQTEOMAwGA1UEBxMFRGF2aXMxETAPBgNVBAoTCE5l
+dC1TTk1QMRUwEwYDVQQDEwxkdGxzdGVzdHVzZXIwHhcNMDkwNzA5MjM0MDA2WhcN
+MDkwODA4MjM0MDA2WjBUMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDjAMBgNV
+BAcTBURhdmlzMREwDwYDVQQKEwhOZXQtU05NUDEVMBMGA1UEAxMMZHRsc3Rlc3R1
+c2VyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0rw9BcVYbzJ8cjc4
+M0FX7h4ywT53xtCWypQXLgwNx7GduZU1DTzhVrcyWpeT8aw+ztW9wmH4NEeORSTK
+vGZJJPe3qJiFiPKNSJ17QzKSVG0QStJMPUFSCq7nNYIzZ3blliMHSDJef3q6bx+l
+4NUaDX03Usacgke8CCZlA51BRf+OOtqWNWoJ4QXucuJ/rERqgYRR1f7Pojs35ZAE
+7c71/WVcztl68tLH6yVZhpVDQKd+Ee/Mpir5j2X7FoRp3dUn5ATjpBw6WETw9tbU
+gjbcsrG4wE6czK0YSTxNTGJzC9rvEq3S+vbjPzLBVxrAWxXd7tAMkUSUWVJjCMMv
+e7hoOQIDAQABo4G3MIG0MB0GA1UdDgQWBBTFWVMk7fsGCU2GsKY9nk0bC2PN+jCB
+hAYDVR0jBH0we4AUxVlTJO37BglNhrCmPZ5NGwtjzfqhWKRWMFQxCzAJBgNVBAYT
+AlVTMQswCQYDVQQIEwJDQTEOMAwGA1UEBxMFRGF2aXMxETAPBgNVBAoTCE5ldC1T
+Tk1QMRUwEwYDVQQDEwxkdGxzdGVzdHVzZXKCCQCKQUB86vp4WzAMBgNVHRMEBTAD
+AQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCWxKFEohA+Vl+gj4x0ng5FUMuHtTbtLbSG
+1+r6S94LvMBedloYT7mPIPgcVbMT5fqAeQpfVIaC0i5PkiUI9H2MXtO2AdBa5Jx5
+q18OdUj/LjGA3B7josq5HnIT/0OThYkAeKLIVDLHxiqOYrmFwqZOsK5BZ1RM/6Yl
++/UZuwujuHtnwRW3VWskVVFTF4NGKZ5f7lA+NSYqbHn/7OBqqgS2GxnSzcCD9BOq
+9zNMZoiW3jW+EoIL62pRtE+S/iL1BRBct4xwNP/RQyN4iaDVg0SC10YSSXk4+of+
+e2gCLgCxs0VyBzG8fIoX8Riq7cV99G119M1KT45jXcos1hO2gYuB
+-----END CERTIFICATE-----
diff --git a/testing/fulltests/transports/test-user.priv b/testing/fulltests/transports/test-user.priv
new file mode 100644
index 0000000..62507e3
--- /dev/null
+++ b/testing/fulltests/transports/test-user.priv
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEA0rw9BcVYbzJ8cjc4M0FX7h4ywT53xtCWypQXLgwNx7GduZU1
+DTzhVrcyWpeT8aw+ztW9wmH4NEeORSTKvGZJJPe3qJiFiPKNSJ17QzKSVG0QStJM
+PUFSCq7nNYIzZ3blliMHSDJef3q6bx+l4NUaDX03Usacgke8CCZlA51BRf+OOtqW
+NWoJ4QXucuJ/rERqgYRR1f7Pojs35ZAE7c71/WVcztl68tLH6yVZhpVDQKd+Ee/M
+pir5j2X7FoRp3dUn5ATjpBw6WETw9tbUgjbcsrG4wE6czK0YSTxNTGJzC9rvEq3S
++vbjPzLBVxrAWxXd7tAMkUSUWVJjCMMve7hoOQIDAQABAoIBADcXaOiST+06CJif
+YPzdT0x77o7gctWyAEnTbz/lfNDA2VgD7suYJ9zQpcRTLiUW/5B5BlPD4uxf7Iyc
+8rdQEj0s2YGk5fwIVPEv4mKN3P1fScwVsEKvSfBrCxzM/f1Fcv3OCIBSUqwG/KhC
+YM4nR9lQ696i95WDhV+oEe5g9QiELdADDlc1bv+nb9tVBzUTmHQgpGjwyaJMIzIV
+qkfpC4RV8Ojt5ELb6XjJRFxg9Qi+4kw6mLbBc/inysvVQBmsWLLlCKpbHt02YfUB
+atVODzTR5aUbcQKnNnHmojU05irbCeUXphgQKV9iuzsiWMV4edJ6tW8B10BuSlH5
+b0GNuwECgYEA/fwKmQ0jgrLjRc16cE2GWMZRmqBufTtGSw9tdohmUMIPqNt4+/XQ
+gKV0sfFZgsLLUG50xqRR6mmkzS7TVwl4uRqcrF7DRKKAkyFJP3QkLSQm+4EZFxOv
+dpHVLVpO1QJ+71YE4zKOdIfWRaoh5ZlEpGw3uzf+U0oNTD79X5fOA6ECgYEA1GhW
+iSEbU+2YPny4qeXdf8hcSn9+Ur6cBzxLhYMUHNI9ysyAQn3//MLoRConokiUEWG5
+BLO2zSmNqvHWKRBzaGr6Zjo/tGTWgOWnpLQMq+XYmDxWxDGCTLH2edqC+VIIqBnB
+QmLYBvde9En1UI/c3Cspb18Nh92I+VGZNPzPHZkCgYAPU82D7QIOmiMTDFJuQo9v
+/g/gp/vi/NfCId02QQcDqqJtS0li0zPQ/6sqLel79at1YCUV88apwdRbOY8xenXZ
+ndyEnndkRfZCasjT1nt0afEcTm8oMFzvZ9+YjBGj0zG72dITr/Je3++zZpADHhvB
+XHKEjt1/Q0HILyj1QuEA4QKBgQCUbfkSyJzVMHI0MGnG6Ae59ORxdthqsCJOeBb6
+TJfwcAaYQgHa9Tu+gOFYSPD7WaaG4vgszf0PL1t9OpQCjClprWAfsdK0l8bBujpF
+QUCdmveZooirf0FjoPTxP/5Ihcfg2GaRoor9iz3CjjAsROv8uviwiAbni6rdNuVN
+/uAo+QKBgQCfQf1RBj/iMmOZdi4SifBODmseJEYeAMlfEQBHPFmThNLiflz+VN17
+uqHS5IghPK0sXb7pOQmC2hCxT2sWybJx+qKsoOYHLQyrG5kg7CgVjltm6Hzwyizt
+Kuw6T4cUj1qRQG8aATL+sGuT69FHTSE3va5tlf9oYGsM6rIoA43g3w==
+-----END RSA PRIVATE KEY-----
diff --git a/testing/fulltests/unit-tests/T001defaultstore_clib.c b/testing/fulltests/unit-tests/T001defaultstore_clib.c
new file mode 100644
index 0000000..0144f7d
--- /dev/null
+++ b/testing/fulltests/unit-tests/T001defaultstore_clib.c
@@ -0,0 +1,35 @@
+/* HEADER Testing the default_store API */
+int i, j;
+char buf[1024];
+
+/* first we load everything up */
+
+for(i = 0; i < NETSNMP_DS_MAX_IDS; i++) {
+ /* booleans */
+ for(j = 0; j < NETSNMP_DS_MAX_SUBIDS; j++) {
+ OKF(SNMPERR_SUCCESS == netsnmp_ds_set_boolean(i, j, (i*j)%2),
+ ("default store boolean: setting %d/%d returned failure", i, j));
+ OKF(SNMPERR_SUCCESS == netsnmp_ds_set_int(i, j, i*j),
+ ("default store int: setting %d/%d returned failure", i, j));
+ sprintf(buf,"%d/%d", i, j);
+ OKF(SNMPERR_SUCCESS == netsnmp_ds_set_string(i, j, buf),
+ ("default store string: setting %d/%d returned failure", i, j));
+ }
+}
+
+/* then we check all the values */
+
+for(i = 0; i < NETSNMP_DS_MAX_IDS; i++) {
+ /* booleans */
+ for(j = 0; j < NETSNMP_DS_MAX_SUBIDS; j++) {
+ OKF(netsnmp_ds_get_boolean(i, j) == (i*j)%2,
+ ("default store boolean %d/%d was the expected value", i, j));
+ OKF(netsnmp_ds_get_int(i, j) == (i*j),
+ ("default store int %d/%d was the expected value", i, j));
+ sprintf(buf,"%d/%d", i, j);
+ OKF(strcmp(netsnmp_ds_get_string(i, j), buf) == 0,
+ ("default store string %d/%d was the expected value", i, j));
+ }
+}
+
+netsnmp_ds_shutdown();
diff --git a/testing/fulltests/unit-tests/T002containers_clib.c b/testing/fulltests/unit-tests/T002containers_clib.c
new file mode 100644
index 0000000..99b2e94
--- /dev/null
+++ b/testing/fulltests/unit-tests/T002containers_clib.c
@@ -0,0 +1,35 @@
+/* HEADER Testing the container API */
+
+netsnmp_container *container;
+void *p;
+
+init_snmp("container-test");
+container = netsnmp_container_find("fifo");
+container->compare = (netsnmp_container_compare*) strcmp;
+
+CONTAINER_INSERT(container, "foo");
+CONTAINER_INSERT(container, "bar");
+CONTAINER_INSERT(container, "baz");
+
+OK(CONTAINER_FIND(container, "bar") != NULL,
+ "should be able to find the stored 'bar' string");
+
+OK(CONTAINER_FIND(container, "foobar") == NULL,
+ "shouldn't be able to find the (not) stored 'foobar' string");
+
+OK(CONTAINER_SIZE(container) == 3,
+ "container has the proper size for the elements we've added");
+
+CONTAINER_REMOVE(container, "bar");
+
+OK(CONTAINER_FIND(container, "bar") == NULL,
+ "should no longer be able to find the (reoved) 'bar' string");
+
+OK(CONTAINER_SIZE(container) == 2,
+ "container has the proper size for the elements after a removal");
+
+while ((p = CONTAINER_FIRST(container)))
+ CONTAINER_REMOVE(container, p);
+CONTAINER_FREE(container);
+
+snmp_shutdown("container-test");
diff --git a/testing/fulltests/unit-tests/T003copy_nword_clib.c b/testing/fulltests/unit-tests/T003copy_nword_clib.c
new file mode 100644
index 0000000..7d67ed0
--- /dev/null
+++ b/testing/fulltests/unit-tests/T003copy_nword_clib.c
@@ -0,0 +1,142 @@
+/* HEADER Testing copy_nword */
+
+#define ASSERT1(cond) \
+ do { \
+ ++__test_counter; \
+ if ((cond)) \
+ printf("ok %d\n", __test_counter); \
+ else { \
+ printf("not ok %d - %d: %s failed\n", \
+ __test_counter, __LINE__, #cond); \
+ } \
+ } while (0)
+
+#define ASSERT2(cond, on_error) \
+ do { \
+ ++__test_counter; \
+ if ((cond)) \
+ printf("ok %d\n", __test_counter); \
+ else { \
+ printf("not ok %d - %d: %s failed, ", \
+ __test_counter, __LINE__, #cond); \
+ printf on_error ; \
+ } \
+ } while (0)
+
+{
+ /* A quoted string */
+ char input[] = "\"The red rose\"";
+ char output[sizeof(input)] = "";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "The red rose") == 0,
+ ("output = >%s<\n", output));
+ ASSERT1(run == NULL);
+}
+
+{
+ /* Escaped quotes */
+ char input[] = "\\\"The red rose\\\"";
+ char output[sizeof(input)] = "";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "\"The") == 0, ("output = >%s<\n", output));
+ ASSERT2(run == input + 6,
+ ("run = input + %" NETSNMP_PRIz "d\n", run - input));
+ run = copy_nword(run, output, sizeof(output));
+ ASSERT2(strcmp(output, "red") == 0, ("output = >%s<\n", output));
+ ASSERT2(run == input + 10,
+ ("run = input + %" NETSNMP_PRIz "d\n", run - input));
+ run = copy_nword(run, output, sizeof(output));
+ ASSERT2(strcmp(output, "rose\"") == 0, ("output = >%s<\n", output));
+ ASSERT1(run == NULL);
+}
+
+{
+ /* Unterminated "-quote */
+ char input[] = "\"The";
+ char output[sizeof(input)] = "";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "The") == 0, ("output = >%s<\n", output));
+ ASSERT1(run == NULL);
+}
+
+{
+ /* Unterminated '-quote */
+ char input[] = "\'The";
+ char output[sizeof(input)] = "";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "The") == 0, ("output = >%s<\n", output));
+ ASSERT1(run == NULL);
+}
+
+{
+ /* Extract from NULL */
+ char output[10] = "";
+ char* run = NULL;
+ run = copy_nword(run, output, sizeof(output));
+ ASSERT1(run == NULL);
+}
+
+{
+ /* Extract to NULL */
+ char input[] = "The red rose";
+ char* output = NULL;
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT1(run == NULL);
+}
+
+{
+ /* Long token */
+ char input[] = "\"Very long token that overflows the buffer\" foo";
+ char output[10] = "";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "Very long") == 0, ("output = >%s<\n", output));
+ ASSERT2(run == input + 44,
+ ("run = input + %" NETSNMP_PRIz "d\n", run - input));
+}
+
+{
+ /* Quoted end of string / embedded \0 */
+ char input[] = "The\\\0red rose";
+ char output[sizeof(input)] = "";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "The\\") == 0, ("output = >%s<\n", output));
+ ASSERT1(run == NULL);
+}
+
+{
+ /* Empty string */
+ char input[] = "";
+ char output[sizeof(input) + 1] = "X";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "") == 0, ("output = >%s<\n", output));
+ ASSERT2(run == NULL, ("run = >%s<\n", run));
+}
+
+{
+ /* Whitespace string */
+ char input[] = " \t ";
+ char output[sizeof(input)] = "X";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "") == 0, ("output = >%s<\n", output));
+ ASSERT2(run == NULL, ("run = >%s<\n", run));
+}
+
+{
+ /* Quote, no whitespace after */
+ char input[] = "\"The\"red rose";
+ char output[sizeof(input)] = "";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "The") == 0, ("output = >%s<\n", output));
+ ASSERT2(run == input + 5,
+ ("run = input + %" NETSNMP_PRIz "d\n", run - input));
+}
+
+{
+ /* Quote, no whitespace before */
+ char input[] = "The\"red\" rose";
+ char output[sizeof(input)] = "";
+ char* run = copy_nword(input, output, sizeof(output));
+ ASSERT2(strcmp(output, "The\"red\"") == 0, ("output = >%s<\n", output));
+ ASSERT2(run == input + 9,
+ ("run = input + %" NETSNMP_PRIz "d\n", run - input));
+}
diff --git a/testing/fulltests/unit-tests/T004snmp_enum_clib.c b/testing/fulltests/unit-tests/T004snmp_enum_clib.c
new file mode 100644
index 0000000..d28b19b
--- /dev/null
+++ b/testing/fulltests/unit-tests/T004snmp_enum_clib.c
@@ -0,0 +1,105 @@
+/* HEADER Testing snmp_enum */
+
+#define CONFIG_TYPE "snmp-enum-unit-test"
+#define STRING1 "life, and everything"
+#define STRING2 "restaurant at the end of the universe"
+#define STRING3 "label3"
+#define LONG_STRING "a-string-of-255-characters-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
+
+#define STORE_AND_COMPARE(maj, min, s) \
+ { \
+ FILE *fp; \
+ int read = 0; \
+ char *p, contents[4096]; \
+ \
+ se_store_list(maj, min, CONFIG_TYPE); \
+ fp = fopen(tmp_persist_file, "r"); \
+ if (fp) { \
+ read = fread(contents, 1, sizeof(contents) - 1, fp); \
+ fclose(fp); \
+ } \
+ contents[read > 0 ? read : 0] = '\0'; \
+ for (p = contents; *p; ++p) \
+ if (*p == '\n') \
+ *p = '|'; \
+ OKF(strcmp(contents, (s)) == 0, \
+ ("stored list %s <> %s", (s), contents)); \
+ remove(tmp_persist_file); \
+ }
+
+char tmp_persist_file[256];
+char *se_find_result;
+
+sprintf(tmp_persist_file, "/tmp/snmp-enum-unit-test-%d", getpid());
+netsnmp_setenv("SNMP_PERSISTENT_FILE", tmp_persist_file, 1);
+
+init_snmp_enum("snmp");
+
+STORE_AND_COMPARE(1, 1, "enum 1:1|");
+
+se_add_pair(1, 1, strdup("hi"), 1);
+
+STORE_AND_COMPARE(1, 1, "enum 1:1 1:hi|");
+
+se_add_pair(1, 1, strdup("there"), 2);
+
+STORE_AND_COMPARE(1, 1, "enum 1:1 1:hi 2:there|");
+
+se_add_pair(1, 1, strdup(LONG_STRING), 3);
+se_add_pair(1, 1, strdup(LONG_STRING), 4);
+se_add_pair(1, 1, strdup(LONG_STRING), 5);
+se_add_pair(1, 1, strdup(LONG_STRING), 6);
+se_add_pair(1, 1, strdup(LONG_STRING), 7);
+se_add_pair(1, 1, strdup(LONG_STRING), 8);
+se_add_pair(1, 1, strdup(LONG_STRING), 9);
+
+STORE_AND_COMPARE(1, 1, "enum 1:1 1:hi 2:there 3:" LONG_STRING " 4:" LONG_STRING
+ " 5:" LONG_STRING " 6:" LONG_STRING " 7:" LONG_STRING
+ " 8:" LONG_STRING " 9:" LONG_STRING "|");
+
+se_add_pair(1, 1, strdup(LONG_STRING), 10);
+
+STORE_AND_COMPARE(1, 1, "enum 1:1 1:hi 2:there 3:" LONG_STRING " 4:" LONG_STRING
+ " 5:" LONG_STRING " 6:" LONG_STRING " 7:" LONG_STRING
+ " 8:" LONG_STRING " 9:" LONG_STRING "|"
+ "enum 1:1 10:" LONG_STRING "|");
+
+OK(se_find_value(1, 1, "hi") == 1,
+ "lookup by number #1 should be the proper string");
+OK(strcmp(se_find_label(1, 1, 2), "there") == 0,
+ "lookup by string #1 should be the proper number");
+
+
+se_add_pair_to_slist("testing", strdup(STRING1), 42);
+se_add_pair_to_slist("testing", strdup(STRING2), 2);
+se_add_pair_to_slist("testing", strdup(STRING3), 2);
+
+OK(se_find_value_in_slist("testing", STRING1) == 42,
+ "lookup by number should be the proper string");
+OK(strcmp(se_find_label_in_slist("testing", 2), STRING2) == 0,
+ "lookup by string should be the proper number");
+
+se_clear_slist("testing");
+
+
+se_read_conf("enum",
+ NETSNMP_REMOVE_CONST(char *, "2:3 1:apple 2:pear 3:kiwifruit"));
+OK(se_find_list(2, 3), "list (2, 3) should be present");
+if (se_find_list(2, 3)) {
+ OK(se_find_value(2, 3, "kiwifruit") == 3,
+ "lookup by string should return the proper value");
+ se_find_result = se_find_label(2, 3, 2);
+ OK(se_find_result && strcmp(se_find_result, "pear") == 0,
+ "lookup by label should return the proper string");
+}
+
+se_read_conf("enum",
+ NETSNMP_REMOVE_CONST(char *, "fruit 1:apple 2:pear 3:kiwifruit"));
+OK(se_find_value_in_slist("fruit", "kiwifruit") == 3,
+ "lookup by string should return the proper value");
+se_find_result = se_find_label_in_slist("fruit", 2);
+OK(se_find_result && strcmp(se_find_result, "pear") == 0,
+ "lookup by value should return the proper string");
+
+clear_snmp_enum();
+unregister_all_config_handlers();
diff --git a/testing/fulltests/unit-tests/T005table_dataset_cagentlib.c b/testing/fulltests/unit-tests/T005table_dataset_cagentlib.c
new file mode 100644
index 0000000..cac940e
--- /dev/null
+++ b/testing/fulltests/unit-tests/T005table_dataset_cagentlib.c
@@ -0,0 +1,58 @@
+/* HEADER Testing table_dataset */
+
+/*
+ * Note: the primary purpose of this unit test is to verify whether all memory
+ * that is allocated for storing a table dataset is freed properly. Feel free
+ * to extend this unit test such that it tests more of the table dataset code.
+ */
+
+enum { COL3 = 2, COL4 = 3, COL5 = 4, };
+
+static const oid Oid[] = { 1, 3, 6, 1, 3, 277 };
+netsnmp_table_data_set* tds;
+netsnmp_handler_registration* th;
+netsnmp_table_row* row;
+int32_t ival;
+int32_t i, j;
+
+init_agent("snmpd");
+init_snmp("snmpd");
+
+tds = netsnmp_create_table_data_set("table_dataset unit-test");
+OK(tds, "table data set creation");
+
+netsnmp_table_dataset_add_index(tds, ASN_INTEGER);
+netsnmp_table_dataset_add_index(tds, ASN_INTEGER);
+netsnmp_table_set_add_default_row(tds, COL3, ASN_INTEGER, FALSE, NULL, 0);
+netsnmp_table_set_add_default_row(tds, COL4, ASN_COUNTER, FALSE, NULL, 0);
+netsnmp_table_set_add_default_row(tds, COL5, ASN_OCTET_STR, FALSE, NULL, 0);
+
+th = netsnmp_create_handler_registration("unit-test handler", NULL, Oid,
+ OID_LENGTH(Oid), HANDLER_CAN_RWRITE);
+OK(th, "table handler registration");
+
+OK(netsnmp_register_table_data_set(th, tds, NULL) == SNMPERR_SUCCESS,
+ "table data set registration");
+
+for (i = 1; i <= 2; i++) {
+ for (j = 1; j <= 2; j++) {
+ row = netsnmp_create_table_data_row();
+ netsnmp_table_row_add_index(row, ASN_INTEGER, &i, sizeof(i));
+ netsnmp_table_row_add_index(row, ASN_INTEGER, &j, sizeof(j));
+ netsnmp_table_dataset_add_row(tds, row);
+
+ ival = 10 * i + j;
+ OK(netsnmp_set_row_column(row, COL3, ASN_INTEGER, &ival, sizeof(ival))
+ == SNMPERR_SUCCESS, "set INTEGER column");
+ OK(netsnmp_set_row_column(row, COL5, ASN_OCTET_STR, "test",
+ sizeof("test") - 1)
+ == SNMPERR_SUCCESS, "set OCTET_STR column");
+ }
+}
+
+netsnmp_delete_table_data_set(tds);
+
+snmp_shutdown("snmpd");
+shutdown_agent();
+
+OK(TRUE, "done");
diff --git a/testing/fulltests/unit-tests/T006snmp_handler_registration_cagentlib.c b/testing/fulltests/unit-tests/T006snmp_handler_registration_cagentlib.c
new file mode 100644
index 0000000..ed7ae68
--- /dev/null
+++ b/testing/fulltests/unit-tests/T006snmp_handler_registration_cagentlib.c
@@ -0,0 +1,46 @@
+/* HEADER Testing SNMP handler registration */
+
+static oid Oid[] = { 1, 3, 6, 1, 3, 327 }; /* experimental.327 */
+netsnmp_handler_registration *handler, *handler2;
+netsnmp_mib_handler *dh;
+netsnmp_cache *nc, *nc2;
+
+init_snmp("snmp");
+
+handler = netsnmp_create_handler_registration("experimental.327", NULL,
+ Oid, OID_LENGTH(Oid), HANDLER_CAN_RWRITE);
+OK(handler != NULL, "Handler creation.");
+
+nc = netsnmp_cache_create(10, NULL, NULL, Oid, OID_LENGTH(Oid));
+OK(nc, "netsnmp_cache allocation");
+OK(snmp_oid_compare(nc->rootoid, nc->rootoid_len, Oid, OID_LENGTH(Oid)) == 0,
+ "Handler private OID.");
+
+handler->handler->myvoid = nc;
+netsnmp_cache_handler_owns_cache(handler->handler);
+
+nc2 = handler->handler->myvoid;
+OK(nc2, "Handler private data");
+OK(snmp_oid_compare(nc2->rootoid, nc2->rootoid_len, Oid, OID_LENGTH(Oid)) == 0,
+ "Handler private OID.");
+
+OK(netsnmp_register_instance(handler) == MIB_REGISTERED_OK,
+ "MIB registration.");
+
+handler2 = netsnmp_create_handler_registration("experimental.327", NULL,
+ Oid, OID_LENGTH(Oid), HANDLER_CAN_RWRITE);
+OK(handler2 != NULL, "Second registration");
+
+OK(netsnmp_register_instance(handler2) == MIB_DUPLICATE_REGISTRATION,
+ "Duplicate MIB registration.");
+
+dh = netsnmp_handler_dup(handler->handler);
+OK(dh, "Handler duplication.");
+
+OK(netsnmp_unregister_handler(handler) == SNMPERR_SUCCESS,
+ "Handler unregistration.");
+
+netsnmp_handler_free(dh);
+OK(TRUE, "Freeing duplicate handler");
+
+snmp_shutdown("snmp");
diff --git a/testing/fulltests/unit-tests/T007inet_pton_clib.c b/testing/fulltests/unit-tests/T007inet_pton_clib.c
new file mode 100644
index 0000000..e9b00fa
--- /dev/null
+++ b/testing/fulltests/unit-tests/T007inet_pton_clib.c
@@ -0,0 +1,60 @@
+/* HEADER Testing inet_pton() and inet_ntop() */
+
+int i;
+char str[128];
+struct in_addr in_addr;
+struct in6_addr in6_addr;
+
+static const struct { const char* s; unsigned char b[4]; } in_testdata[] = {
+ { "0.0.0.0", { 0, 0, 0, 0 } },
+ { "1.2.3.4", { 1, 2, 3, 4 } },
+ { "255.255.255.255", { 255, 255, 255, 255 } },
+};
+
+static const struct { const char* s; unsigned char b[16]; } in6_testdata[] = {
+ { "::", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, },
+ { "::1", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }, },
+ { "1::", { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, },
+ { "1::1", { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }, },
+};
+
+for (i = 0; i < sizeof(in_testdata)/sizeof(in_testdata[0]); ++i) {
+ const unsigned char *const b = in_testdata[i].b;
+
+ OKF(inet_pton(AF_INET, in_testdata[i].s, &in_addr) == 1,
+ ("IPv4 inet_pton(%s)", in_testdata[i].s));
+ OK(ntohl(in_addr.s_addr)
+ == ((b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]),
+ "inet_pton() value");
+ OK(inet_ntop(AF_INET, &in_addr, str, sizeof(str)) == str,
+ "IPv4 inet_ntop()");
+ OKF(strcmp(in_testdata[i].s, str) == 0,
+ ("%s =?= %s", in_testdata[i].s, str));
+}
+
+
+for (i = 0; i < sizeof(in6_testdata)/sizeof(in6_testdata[0]); ++i) {
+ const unsigned char *const b = in6_testdata[i].b;
+ const unsigned char *const r = (void *)&in6_addr;
+ int result, j;
+
+ result = inet_pton(AF_INET6, in6_testdata[i].s, &in6_addr);
+ OKF(result == 1,
+ ("IPv6 inet_pton(%s) -> %d; "
+ " %02x%02x:%02x%02x:%02x%02x:%02x%02x"
+ ":%02x%02x:%02x%02x:%02x%02x:%02x%02x",
+ in6_testdata[i].s, result,
+ r[0], r[1], r[ 2], r[ 3], r[ 4], r[ 5], r[ 6], r[ 7],
+ r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15]
+ ));
+ for (j = 0; j < 16; ++j)
+ printf("%02x ", b[j]);
+ printf("\n");
+ for (j = 0; j < 16; ++j)
+ OKF(r[j] == b[j],
+ ("IPv6 inet_pton() value (%#02x =?= %#02x)", r[j], b[j]));
+ OK(inet_ntop(AF_INET6, &in6_addr, str, sizeof(str)) == str,
+ "IPv6 inet_ntop()");
+ OKF(strcmp(in6_testdata[i].s, str) == 0,
+ ("%s =?= %s", in6_testdata[i].s, str));
+}
diff --git a/testing/fulltests/unit-tests/T008asn1_clib.c b/testing/fulltests/unit-tests/T008asn1_clib.c
new file mode 100644
index 0000000..73a2f73
--- /dev/null
+++ b/testing/fulltests/unit-tests/T008asn1_clib.c
@@ -0,0 +1,182 @@
+/* HEADER Testing ASN.1 encoding and decoding */
+
+int i;
+
+#if 0
+snmp_set_do_debugging(TRUE);
+debug_register_tokens("dumpv_recv,dumpv_send,asn");
+#endif
+
+{
+ const long intval[] = {
+ -0x80000000L,
+ -0x7fffffffL,
+ -0xffffL,
+ -3,
+ -1,
+ 0,
+ 1,
+ 3,
+ 0xffff,
+ 0x7fffffff,
+ };
+ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+ u_char encoded[256];
+ size_t encoded_length;
+ u_char *build_result;
+ size_t decoded_length;
+ u_char decoded_type;
+ long decoded_value = 0;
+ u_char *parse_result;
+
+ encoded_length = sizeof(encoded);
+ build_result = asn_build_int(encoded, &encoded_length, ASN_INTEGER,
+ &intval[i], sizeof(intval[i]));
+ OKF(build_result + encoded_length == encoded + sizeof(encoded),
+ ("asn_build_int(%ld)", intval[i]));
+ decoded_length = sizeof(encoded) - encoded_length;
+ parse_result = asn_parse_int(encoded, &decoded_length, &decoded_type,
+ &decoded_value, sizeof(decoded_value));
+ OKF(parse_result == build_result && decoded_type == ASN_INTEGER
+ && decoded_value == intval[i],
+ ("asn_parse_int(asn_build_int(%ld)) %s; decoded type %d <> %d;"
+ " decoded value %ld",
+ intval[i], parse_result == build_result ? "succeeded" : "failed",
+ decoded_type, ASN_INTEGER, decoded_value));
+ }
+}
+
+{
+ const unsigned long intval[] = {
+ 0, 1, 3, 0xffff, 0x7fffffff, 0x80000000U, 0xffffffffU
+ };
+ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+ u_char encoded[256];
+ size_t encoded_length;
+ u_char *build_result;
+ size_t decoded_length;
+ u_char decoded_type;
+ unsigned long decoded_value = 0;
+ u_char *parse_result;
+
+ encoded_length = sizeof(encoded);
+ build_result = asn_build_unsigned_int(encoded, &encoded_length,
+ ASN_UINTEGER,
+ &intval[i], sizeof(intval[i]));
+ OKF(build_result + encoded_length == encoded + sizeof(encoded),
+ ("asn_build_unsigned_int(%lu)", intval[i]));
+ decoded_length = sizeof(encoded) - encoded_length;
+ parse_result = asn_parse_unsigned_int(encoded, &decoded_length,
+ &decoded_type, &decoded_value,
+ sizeof(decoded_value));
+ OKF(parse_result && decoded_type == ASN_UINTEGER
+ && decoded_value == intval[i],
+ ("asn_parse_unsigned_int(asn_build_unsigned_int(%lu)) %s;"
+ " decoded type %d <> %d; decoded value %lu",
+ intval[i], parse_result == build_result ? "succeeded" : "failed",
+ decoded_type, ASN_UINTEGER, decoded_value));
+ }
+}
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+
+#define TOINT64(c) ((long long)(long)(c).high << 32 | (c).low)
+
+{
+ const struct counter64 intval[] = {
+ { 0x80000000U, 0U },
+ { 0x80000000U, 0xffffffffU },
+ { 0xffffffffU, 0 },
+ { 0xffffffffU, 0xffff0000U },
+ { 0xffffffffU, 0xfffffffcU },
+ { 0xffffffffU, 0xffffffffU },
+ { 0, 0 },
+ { 0, 1 },
+ { 0, 3 },
+ { 0, 0xffff },
+ { 0, 0x7fffffff },
+ { 1, 0 },
+ { 1, 0xffffffff },
+ { 0x7fffffff, 0 },
+ { 0x7fffffff, 0xdeadbeef },
+ { 0x7fffffff, 0xffffffff },
+ };
+ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+ u_char encoded[256];
+ size_t encoded_length;
+ u_char *build_result;
+ size_t decoded_length;
+ u_char decoded_type;
+ struct counter64 decoded_value = { };
+ u_char *parse_result;
+
+ encoded_length = sizeof(encoded);
+ build_result = asn_build_signed_int64(encoded, &encoded_length,
+ ASN_OPAQUE_I64,
+ &intval[i], sizeof(intval[i]));
+ OKF(build_result + encoded_length == encoded + sizeof(encoded),
+ ("asn_build_signed_int64(%lld)", TOINT64(intval[i])));
+ decoded_length = sizeof(encoded) - encoded_length;
+ parse_result = asn_parse_signed_int64(encoded, &decoded_length,
+ &decoded_type, &decoded_value,
+ sizeof(decoded_value));
+ OKF(parse_result == build_result && decoded_type == ASN_OPAQUE_I64
+ && memcmp(&decoded_value, &intval[i], sizeof(decoded_value)) == 0,
+ ("asn_parse_signed_int64(asn_build_signed_int64(%lld)) %s;"
+ " decoded type %d <> %d; decoded value %lld",
+ TOINT64(intval[i]),
+ parse_result == build_result ? "succeeded" : "failed",
+ decoded_type, ASN_OPAQUE_I64, TOINT64(decoded_value)));
+ }
+}
+
+#endif
+
+#define TOUINT64(c) ((unsigned long long)(c).high << 32 | (c).low)
+
+{
+ const struct counter64 intval[] = {
+ { 0, 0 },
+ { 0, 1 },
+ { 0, 3 },
+ { 0, 0xffff },
+ { 0, 0x7fffffff },
+ { 0, 0x80000000 },
+ { 0, 0xffffffff },
+ { 1, 0 },
+ { 1, 0xffffffff },
+ { 0x7fffffff, 0 },
+ { 0x7fffffff, 0xdeadbeef },
+ { 0x7fffffff, 0xffffffff },
+ { 0xffffffff, 0 },
+ { 0xffffffff, 0xdeadbeef },
+ { 0xffffffff, 0xffffffff },
+ };
+ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+ u_char encoded[256];
+ size_t encoded_length;
+ u_char *build_result;
+ size_t decoded_length;
+ u_char decoded_type;
+ struct counter64 decoded_value = { };
+ u_char *parse_result;
+
+ encoded_length = sizeof(encoded);
+ build_result = asn_build_unsigned_int64(encoded, &encoded_length,
+ ASN_COUNTER64,
+ &intval[i], sizeof(intval[i]));
+ OKF(build_result + encoded_length == encoded + sizeof(encoded),
+ ("asn_build_unsigned_int64(%llu)", TOUINT64(intval[i])));
+ decoded_length = sizeof(encoded) - encoded_length;
+ parse_result = asn_parse_unsigned_int64(encoded, &decoded_length,
+ &decoded_type, &decoded_value,
+ sizeof(decoded_value));
+ OKF(parse_result && decoded_type == ASN_COUNTER64
+ && memcmp(&decoded_value, &intval[i], sizeof(decoded_value)) == 0,
+ ("asn_parse_unsigned_int64(asn_build_unsigned_int64(%llu)) %s;"
+ " decoded type %d <> %d; decoded value %llu",
+ TOUINT64(intval[i]),
+ parse_result == build_result ? "succeeded" : "failed",
+ decoded_type, ASN_COUNTER64, TOUINT64(decoded_value)));
+ }
+}
diff --git a/testing/fulltests/unit-tests/T009large_fd_set_clib.c b/testing/fulltests/unit-tests/T009large_fd_set_clib.c
new file mode 100644
index 0000000..eee4d41
--- /dev/null
+++ b/testing/fulltests/unit-tests/T009large_fd_set_clib.c
@@ -0,0 +1,46 @@
+/* HEADER Testing netsnmp_large_fd_set */
+
+netsnmp_large_fd_set fds;
+netsnmp_large_fd_set_init(&fds, 2000);
+OKF(fds.lfs_setsize == 2000, ("initialization"));
+OKF(netsnmp_large_fd_set_resize(&fds, 2000) == 1, ("resizing to 2000"));
+NETSNMP_LARGE_FD_ZERO(&fds);
+
+{
+ int i;
+ for (i = 0; i < fds.lfs_setsize; ++i) {
+ OKF(!NETSNMP_LARGE_FD_ISSET(i, &fds), ("%d is not set", i));
+ NETSNMP_LARGE_FD_SET(i, &fds);
+ OKF(NETSNMP_LARGE_FD_ISSET(i, &fds), ("%d is set", i));
+ NETSNMP_LARGE_FD_CLR(i, &fds);
+ OKF(!NETSNMP_LARGE_FD_ISSET(i, &fds), ("%d is not set", i));
+ }
+}
+
+OKF(netsnmp_large_fd_set_resize(&fds, 3000) == 1, ("resizing to 3000"));
+
+{
+ int i;
+ for (i = 0; i < fds.lfs_setsize; ++i) {
+ OKF(!NETSNMP_LARGE_FD_ISSET(i, &fds), ("%d is not set", i));
+ NETSNMP_LARGE_FD_SET(i, &fds);
+ OKF(NETSNMP_LARGE_FD_ISSET(i, &fds), ("%d is set", i));
+ NETSNMP_LARGE_FD_CLR(i, &fds);
+ OKF(!NETSNMP_LARGE_FD_ISSET(i, &fds), ("%d is not set", i));
+ }
+}
+
+OKF(netsnmp_large_fd_set_resize(&fds, 1000) == 1, ("resizing to 1000"));
+
+{
+ int i;
+ for (i = 0; i < fds.lfs_setsize; ++i) {
+ OKF(!NETSNMP_LARGE_FD_ISSET(i, &fds), ("%d is not set", i));
+ NETSNMP_LARGE_FD_SET(i, &fds);
+ OKF(NETSNMP_LARGE_FD_ISSET(i, &fds), ("%d is set", i));
+ NETSNMP_LARGE_FD_CLR(i, &fds);
+ OKF(!NETSNMP_LARGE_FD_ISSET(i, &fds), ("%d is not set", i));
+ }
+}
+
+netsnmp_large_fd_set_cleanup(&fds);
diff --git a/testing/fulltests/unit-tests/T010netsnmp_string_time_to_secs_clib.c b/testing/fulltests/unit-tests/T010netsnmp_string_time_to_secs_clib.c
new file mode 100644
index 0000000..e31aeeb
--- /dev/null
+++ b/testing/fulltests/unit-tests/T010netsnmp_string_time_to_secs_clib.c
@@ -0,0 +1,45 @@
+/* HEADER Testing the netsnmp_string_time_to_secs API */
+int secs;
+
+#define TESTIT(x,y) \
+ OKF(y == (secs = netsnmp_string_time_to_secs(x)), \
+ ("netsnmp_string_time_to_secs of %s returned %d, not 5", x, secs))
+
+TESTIT("5", 5);
+TESTIT("5", 5);
+
+TESTIT("5s", 5);
+TESTIT("5S", 5);
+
+TESTIT("5m", 5 * 60);
+TESTIT("5M", 5 * 60);
+
+TESTIT("5h", 5 * 60 * 60);
+TESTIT("5H", 5 * 60 * 60);
+
+TESTIT("5d", 5 * 60 * 60 * 24);
+TESTIT("5D", 5 * 60 * 60 * 24);
+
+TESTIT("5w", 5 * 60 * 60 * 24 * 7);
+TESTIT("5W", 5 * 60 * 60 * 24 * 7);
+
+/* now with longer times */
+TESTIT("1234", 1234);
+TESTIT("1234", 1234);
+
+TESTIT("1234s", 1234);
+TESTIT("1234S", 1234);
+
+TESTIT("1234m", 1234 * 60);
+TESTIT("1234M", 1234 * 60);
+
+TESTIT("1234h", 1234 * 60 * 60);
+TESTIT("1234H", 1234 * 60 * 60);
+
+TESTIT("1234d", 1234 * 60 * 60 * 24);
+TESTIT("1234D", 1234 * 60 * 60 * 24);
+
+TESTIT("1234w", 1234 * 60 * 60 * 24 * 7);
+TESTIT("1234W", 1234 * 60 * 60 * 24 * 7);
+
+
diff --git a/testing/fulltests/unit-tests/T011snmp_old_api_registration_cagentlib.c b/testing/fulltests/unit-tests/T011snmp_old_api_registration_cagentlib.c
new file mode 100644
index 0000000..6f1d449
--- /dev/null
+++ b/testing/fulltests/unit-tests/T011snmp_old_api_registration_cagentlib.c
@@ -0,0 +1,46 @@
+/* HEADER Testing SNMP handler registration via the old API */
+
+static oid Oid[] = { 1, 3, 6, 1, 3, 327 }; /* experimental.327 */
+struct variable var_array[] = {
+ { 0, 0/*type*/, 0/*acl*/, NULL/*findVar*/, 7, { 1, 3, 6, 1, 3, 327, 1 } },
+ { 0, 0/*type*/, 0/*acl*/, NULL/*findVar*/, 7, { 1, 3, 6, 1, 3, 327, 2 } },
+ { 0, 0/*type*/, 0/*acl*/, NULL/*findVar*/, 7, { 1, 3, 6, 1, 3, 327, 3 } },
+};
+netsnmp_session *sess;
+int res;
+
+init_snmp("snmp");
+
+sess = calloc(1, sizeof(*sess));
+snmp_sess_init(sess);
+
+res =
+netsnmp_register_old_api("exp.327.a",
+ var_array,
+ sizeof(var_array[0]),
+ sizeof(var_array)/sizeof(var_array[0]),
+ Oid,
+ sizeof(Oid)/sizeof(Oid[0]),
+ 2, /* priority */
+ 0, /* range_subid */
+ 0, /* range_ubound */
+ sess,
+ "context", 5/*timeout*/, 0/*flags - ignored*/);
+OK(res == SNMPERR_SUCCESS, "Handler registration (1).");
+
+/* Verify that duplicate registration does not cause any havoc. */
+res =
+netsnmp_register_old_api("exp.327.b",
+ var_array,
+ sizeof(var_array[0]),
+ sizeof(var_array)/sizeof(var_array[0]),
+ Oid,
+ sizeof(Oid)/sizeof(Oid[0]),
+ 2, /* priority */
+ 0, /* range_subid */
+ 0, /* range_ubound */
+ sess,
+ "context", 5/*timeout*/, 0/*flags - ignored*/);
+OK(res == SNMPERR_SUCCESS, "Handler registration (2).");
+
+snmp_shutdown("snmp");
diff --git a/testing/fulltests/unit-tests/T012binary_array_oid_clib.c b/testing/fulltests/unit-tests/T012binary_array_oid_clib.c
new file mode 100644
index 0000000..aeeb502
--- /dev/null
+++ b/testing/fulltests/unit-tests/T012binary_array_oid_clib.c
@@ -0,0 +1,72 @@
+/* HEADER Testing binary OID array */
+
+static const char test_name[] = "binary-array-of-OIDs-test";
+oid o1 = 1;
+oid o2 = 2;
+oid o3 = 6;
+oid o4 = 8;
+oid o5 = 9;
+oid ox = 7;
+oid oy = 10;
+netsnmp_index i1, i2, i3, i4, i5, ix, iy, *ip;
+const netsnmp_index *const i_last = &i5;
+netsnmp_index *a[] = { &ix, &iy };
+netsnmp_index *b[] = { &i4, &i2, &i3, &i1, &i5 };
+netsnmp_container *c;
+int i;
+
+init_snmp(test_name);
+
+c = netsnmp_container_get_binary_array();
+c->compare = netsnmp_compare_netsnmp_index;
+
+i1.oids = &o1;
+i2.oids = &o2;
+i3.oids = &o3;
+i4.oids = &o4;
+i5.oids = &o5;
+ix.oids = &ox;
+iy.oids = &oy;
+i1.len = i2.len = i3.len = i4.len = i5.len = ix.len = iy.len = 1;
+
+for (i = 0; i < sizeof(b)/sizeof(b[0]); ++i)
+ CONTAINER_INSERT(c, b[i]);
+
+for (ip = CONTAINER_FIRST(c); ip; ip = CONTAINER_NEXT(c, ip)) {
+ for (i = sizeof(b)/sizeof(b[0]) - 1; i >= 0; --i)
+ if (c->compare(ip, b[i]) == 0)
+ break;
+ OKF(i >= 0, ("OID b[%d] = %" NETSNMP_PRIo "d present", i, b[i]->oids[0]));
+}
+
+for (i = 0; i < sizeof(b)/sizeof(b[0]); ++i) {
+ ip = CONTAINER_FIND(c, b[i]);
+ OKF(ip, ("Value b[%d] = %" NETSNMP_PRIo "d present", i, b[i]->oids[0]));
+ ip = CONTAINER_NEXT(c, b[i]);
+ if (c->compare(b[i], i_last) < 0)
+ OKF(ip && c->compare(b[i], ip) < 0,
+ ("Successor of b[%d] = %" NETSNMP_PRIo "d is %" NETSNMP_PRIo "d",
+ i, b[i]->oids[0], ip->oids[0]));
+ else
+ OKF(!ip, ("No successor found for b[%d] = %" NETSNMP_PRIo "d", i,
+ b[i]->oids[0]));
+}
+
+for (i = 0; i < sizeof(a)/sizeof(a[0]); ++i) {
+ ip = CONTAINER_FIND(c, a[i]);
+ OKF(!ip, ("a[%d] = %" NETSNMP_PRIo "d absent", i, a[i]->oids[0]));
+ ip = CONTAINER_NEXT(c, a[i]);
+ if (c->compare(a[i], i_last) < 0)
+ OKF(ip && c->compare(ip, a[i]) > 0,
+ ("Successor of a[%d] = %" NETSNMP_PRIo "d is %" NETSNMP_PRIo "d",
+ i, a[i]->oids[0], ip->oids[0]));
+ else
+ OKF(!ip, ("No successor found for a[%d] = %" NETSNMP_PRIo "d", i,
+ a[i]->oids[0]));
+}
+
+while ((ip = CONTAINER_FIRST(c)))
+ CONTAINER_REMOVE(c, ip);
+CONTAINER_FREE(c);
+
+snmp_shutdown(test_name);
diff --git a/testing/fulltests/unit-tests/T013binary_array_string_clib.c b/testing/fulltests/unit-tests/T013binary_array_string_clib.c
new file mode 100644
index 0000000..cc4361b
--- /dev/null
+++ b/testing/fulltests/unit-tests/T013binary_array_string_clib.c
@@ -0,0 +1,59 @@
+/* HEADER Testing binary string array */
+
+static const char test_name[] = "binary-array-of-strings-test";
+const char o1[] = "zebra";
+const char o2[] = "b-two";
+const char o3[] = "b";
+const char o4[] = "cedar";
+const char o5[] = "alpha";
+const char ox[] = "dev";
+const char oy[] = "aa";
+const char* const o_last = o1;
+const char *ip;
+const char *const a[] = { ox, oy };
+const char *const b[] = { o4, o2, o3, o1, o5 };
+netsnmp_container *c;
+int i;
+
+init_snmp(test_name);
+
+c = netsnmp_container_get_binary_array();
+c->compare = (netsnmp_container_compare*)strcmp;
+
+for (i = 0; i < sizeof(b)/sizeof(b[0]); ++i)
+ CONTAINER_INSERT(c, b[i]);
+
+for (ip = CONTAINER_FIRST(c); ip; ip = CONTAINER_NEXT(c, ip)) {
+ for (i = sizeof(b)/sizeof(b[0]) - 1; i >= 0; --i)
+ if (c->compare(ip, b[i]) == 0)
+ break;
+ OKF(i >= 0, ("string b[%d] = \"%s\" present", i, b[i]));
+}
+
+for (i = 0; i < sizeof(b)/sizeof(b[0]); ++i) {
+ ip = CONTAINER_FIND(c, b[i]);
+ OKF(ip, ("b[%d] = \"%s\" present", i, b[i]));
+ ip = CONTAINER_NEXT(c, b[i]);
+ if (c->compare(b[i], o_last) < 0)
+ OKF(ip && c->compare(b[i], ip) < 0,
+ ("Successor of b[%d] = \"%s\" is \"%s\"", i, b[i], ip));
+ else
+ OKF(!ip, ("No successor found for b[%d] = \"%s\"", i, b[i]));
+}
+
+for (i = 0; i < sizeof(a)/sizeof(a[0]); ++i) {
+ ip = CONTAINER_FIND(c, a[i]);
+ OKF(!ip, ("a[%d] = \"%s\" absent", i, a[i]));
+ ip = CONTAINER_NEXT(c, a[i]);
+ if (c->compare(a[i], o_last) < 0)
+ OKF(ip && c->compare(ip, a[i]) > 0,
+ ("Successor of a[%d] = \"%s\" is \"%s\"", i, a[i], ip));
+ else
+ OKF(!ip, ("No successor found for a[%d] = \"%s\"", i, a[i]));
+}
+
+while ((ip = CONTAINER_FIRST(c)))
+ CONTAINER_REMOVE(c, ip);
+CONTAINER_FREE(c);
+
+snmp_shutdown(test_name);
diff --git a/testing/fulltests/unit-tests/T014gethostbyaddr_clib.c b/testing/fulltests/unit-tests/T014gethostbyaddr_clib.c
new file mode 100644
index 0000000..4c633ed
--- /dev/null
+++ b/testing/fulltests/unit-tests/T014gethostbyaddr_clib.c
@@ -0,0 +1,55 @@
+/* HEADER Testing netsnmp_gethostbyaddr() */
+
+SOCK_STARTUP;
+
+{
+ int ran_test = 0;
+#ifdef HAVE_GETHOSTBYADDR
+ struct hostent *h;
+ struct in_addr v4loop;
+ struct sockaddr_in sin_addr;
+ int s;
+
+ v4loop.s_addr = htonl(INADDR_LOOPBACK);
+ memset(&sin_addr, 0, sizeof(sin_addr));
+ sin_addr.sin_family = AF_INET;
+ sin_addr.sin_addr = v4loop;
+ s = socket(AF_INET, SOCK_DGRAM, 0);
+ if (s >= 0) {
+ if (bind(s, (struct sockaddr *)&sin_addr, sizeof(sin_addr)) >= 0) {
+ h = netsnmp_gethostbyaddr(&v4loop, sizeof(v4loop), AF_INET);
+ OKF(h && strcmp(h->h_name, "localhost") == 0,
+ ("127.0.0.1 lookup (%s)", h ? h->h_name : "(failed)"));
+ ran_test = 1;
+ }
+ close(s);
+ }
+#endif
+ if (!ran_test)
+ OKF(1, ("Skipped IPv4 test"));
+}
+
+{
+ struct hostent *h;
+ static const struct in6_addr v6loop = IN6ADDR_LOOPBACK_INIT;
+ struct sockaddr_in6 sin6_addr;
+ int s, ran_test = 0;
+
+ memset(&sin6_addr, 0, sizeof(sin6_addr));
+ sin6_addr.sin6_family = AF_INET6;
+ sin6_addr.sin6_addr = v6loop;
+ s = socket(AF_INET6, SOCK_DGRAM, 0);
+ if (s >= 0) {
+ if (bind(s, (struct sockaddr*)&sin6_addr, sizeof(sin6_addr)) >= 0) {
+ h = netsnmp_gethostbyaddr(&v6loop, sizeof(v6loop), AF_INET6);
+ OKF(h && strcmp(h->h_name, "localhost") == 0,
+ ("::1 lookup (%s)", h ? h->h_name : "(failed)"));
+ ran_test = 1;
+ }
+ close(s);
+ }
+ if (!ran_test)
+ OKF(1, ("Skipped IPv6 test"));
+}
+
+SOCK_CLEANUP;
diff --git a/testing/fulltests/unit-tests/T015int64_clib.c b/testing/fulltests/unit-tests/T015int64_clib.c
new file mode 100644
index 0000000..5f5f4b6
--- /dev/null
+++ b/testing/fulltests/unit-tests/T015int64_clib.c
@@ -0,0 +1,82 @@
+/* HEADER Testing 64-bit integer operations (U64). */
+
+int i, j;
+char buf[22];
+static const int64_t intval[] = {
+ 0,
+ -1,
+ 1,
+ 37,
+ 0x7fffffffUL,
+ 0x80000000UL,
+ 0x99999999UL,
+ 0x7fffffffffffffffULL,
+ 0x8000000000000000ULL,
+};
+
+for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+ U64 a, b;
+ a.low = (uint32_t)intval[i];
+ a.high = (uint32_t)(intval[i] >> 32);
+ printI64(buf, &a);
+ read64(&b, buf);
+ OKF(memcmp(&a, &b, sizeof(a)) == 0,
+ ("[%d]: %" PRId64 " <> %s <> %" PRId64, i, intval[i], buf,
+ ((uint64_t)b.high) << 32 | b.low));
+}
+
+for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+ for (j = i; j < sizeof(intval)/sizeof(intval[0]); ++j) {
+ U64 a, b;
+ uint64_t d;
+ a.low = (uint32_t)intval[i];
+ a.high = (uint32_t)(intval[i] >> 32);
+ b.low = (uint32_t)intval[j];
+ b.high = (uint32_t)(intval[j] >> 32);
+ u64Incr(&a, &b);
+ d = (uint64_t)a.high << 32 | a.low;
+ OKF(intval[i] + intval[j] == d,
+ ("%" PRId64 " + %" PRId64 " = %" PRId64 " <> %" PRId64, intval[i],
+ intval[j], intval[i] + intval[j], d));
+ }
+}
+
+for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+ for (j = i; j < sizeof(intval)/sizeof(intval[0]); ++j) {
+ U64 a, b, c;
+ uint64_t d;
+ a.low = (uint32_t)intval[i];
+ a.high = (uint32_t)(intval[i] >> 32);
+ b.low = (uint32_t)intval[j];
+ b.high = (uint32_t)(intval[j] >> 32);
+ u64Subtract(&a, &b, &c);
+ d = (uint64_t)c.high << 32 | c.low;
+ OKF(intval[i] - intval[j] == d,
+ ("%" PRId64 " - %" PRId64 " = %" PRId64 " <> %" PRId64, intval[i],
+ intval[j], intval[i] - intval[j], d));
+ }
+}
+
+{
+ U64 old_val, new_val;
+ old_val.low = 7;
+ old_val.high = 0;
+ new_val = old_val;
+ OK(netsnmp_c64_check_for_32bit_wrap(&old_val, &new_val, 0) == 0, "cwrap1");
+ new_val.low = 8;
+ OK(netsnmp_c64_check_for_32bit_wrap(&old_val, &new_val, 0) == 0, "cwrap2");
+ new_val.low = 6;
+ OK(netsnmp_c64_check_for_32bit_wrap(&old_val, &new_val, 0) == 32, "cwrap3");
+ OK(netsnmp_c64_check_for_32bit_wrap(&old_val, &new_val, 1) == 32
+ && new_val.low == 6 && new_val.high == 1, "cwrap4");
+ old_val.low = 7;
+ old_val.high = 0xffffffffU;
+ new_val.low = 7;
+ new_val.high = old_val.high;
+ OK(netsnmp_c64_check_for_32bit_wrap(&old_val, &new_val, 0) == 0, "cwrap5");
+ new_val.low = 8;
+ OK(netsnmp_c64_check_for_32bit_wrap(&old_val, &new_val, 0) == 0, "cwrap6");
+ new_val.low = 6;
+ new_val.high = 0;
+ OK(netsnmp_c64_check_for_32bit_wrap(&old_val, &new_val, 0) == 64, "cwrap7");
+}
diff --git a/testing/fulltests/unit-tests/T016read_config_clib.c b/testing/fulltests/unit-tests/T016read_config_clib.c
new file mode 100644
index 0000000..c11a591
--- /dev/null
+++ b/testing/fulltests/unit-tests/T016read_config_clib.c
@@ -0,0 +1,82 @@
+/* HEADER Testing read_config_read_octet_string_const(). */
+
+struct read_config_testcase {
+ /*
+ * inputs
+ */
+ const char *(*pf) (const char * readfrom, u_char ** str,
+ size_t * len);
+ const char *readfrom;
+ size_t obuf_len;
+
+ /*
+ * expected outputs
+ */
+ size_t expected_offset;
+ const u_char *expected_output;
+ size_t expected_len;
+};
+
+static const u_char obuf1[] = { 1, 0, 2 };
+static const u_char obuf2[] = { 'a', 'b', 'c', 0 };
+
+static const struct read_config_testcase test_input[] = {
+ { &read_config_read_octet_string_const, "", 1, -1, NULL, 0 },
+ { &read_config_read_octet_string_const, "0x0", 1, -1, NULL, 1 },
+ { &read_config_read_octet_string_const, "0x0 0", 1, -1, NULL, 1 },
+
+ { &read_config_read_octet_string_const, "0x010002", 1, -1, NULL, 0 },
+ { &read_config_read_octet_string_const, "0x010002", 2, -1, NULL, 0 },
+ { &read_config_read_octet_string_const, "0x010002", 3, -1, obuf1, 0 },
+ { &read_config_read_octet_string_const, "0x010002", 4, -1, obuf1, 3 },
+ { &read_config_read_octet_string_const, "0x010002 0", 4, 9, obuf1, 3 },
+ { &read_config_read_octet_string_const, "0x010002", 0, -1, obuf1, 3 },
+
+ { &read_config_read_octet_string_const, "abc", 1, -1, NULL, 0 },
+ { &read_config_read_octet_string_const, "abc z", 1, 4, NULL, 0 },
+ { &read_config_read_octet_string_const, "abc", 2, -1, NULL, 1 },
+ { &read_config_read_octet_string_const, "abc", 3, -1, obuf2, 2 },
+ { &read_config_read_octet_string_const, "abc", 4, -1, obuf2, 3 },
+ { &read_config_read_octet_string_const, "abc z", 4, 4, obuf2, 3 },
+ { &read_config_read_octet_string_const, "abc", 0, -1, obuf2, 3 },
+};
+
+unsigned int i, j, ok;
+
+for (i = 0; i < sizeof(test_input) / sizeof(test_input[0]); i++) {
+ const struct read_config_testcase *const p = &test_input[i];
+ size_t len = p->obuf_len;
+ u_char *str = len > 0 ? malloc(len) : NULL;
+ const char *result;
+ size_t offset;
+
+ fflush(stdout);
+ result = (p->pf) (p->readfrom, &str, &len);
+ offset = result ? result - p->readfrom : -1;
+ OKF(offset == p->expected_offset,
+ ("test %d: expected offset %zd, got offset %" NETSNMP_PRIz "d",
+ i, p->expected_offset, offset));
+ if (offset == p->expected_offset) {
+ OKF(len == p->expected_len,
+ ("test %d: expected length %" NETSNMP_PRIz "d, got length %"
+ NETSNMP_PRIz "d", i, p->expected_len, len));
+ if (len == p->expected_len) {
+ ok = len < 0 || !p->expected_output
+ || memcmp(str, p->expected_output, len) == 0
+ || p->expected_output[len] != 0;
+ OKF(ok, ("test %d: output buffer mismatch", i));
+ if (!ok) {
+ printf("Expected: ");
+ for (j = 0; j < p->expected_len; ++j)
+ printf("%02x ", p->expected_output[j]);
+ printf("\nActual: ");
+ for (j = 0; j < len; ++j)
+ printf("%02x ", str[j]);
+ printf("\n");
+ }
+ }
+ }
+
+ if (str)
+ free(str);
+}
diff --git a/testing/fulltests/unit-tests/T017strtoull_clib.c b/testing/fulltests/unit-tests/T017strtoull_clib.c
new file mode 100644
index 0000000..4ab9cad
--- /dev/null
+++ b/testing/fulltests/unit-tests/T017strtoull_clib.c
@@ -0,0 +1,94 @@
+/* HEADER Testing strtoull(). */
+
+#ifdef HAVE_STRTOULL
+
+OK(1, "Skipping strtoull() test because using strtoull() from C library.\n");;
+
+#else
+
+/*
+ * UINT64_C: C99 macro for the suffix for uint64_t constants.
+ */
+#ifndef UINT64_C
+#ifdef _MSC_VER
+#define UINT64_C(c) c##ui64
+#else
+#define UINT64_C(c) c##ULL
+#endif
+#endif
+
+/*
+ * According to the C99 standard, the constant ULLONG_MAX must be defined in
+ * <limits.h>. Define it here for pre-C99 compilers.
+ */
+#ifndef ULLONG_MAX
+#define ULLONG_MAX UINT64_C(0xffffffffffffffff)
+#endif
+
+#ifndef PRIu64
+#ifdef _MSC_VER
+#define PRIu64 "I64u"
+#else
+#define PRIu64 "llu"
+#endif
+#endif
+
+struct strtoull_testcase {
+ /*
+ * inputs
+ */
+ const char *nptr;
+ int base;
+ /*
+ * expected outputs
+ */
+ int expected_errno;
+ int expected_end;
+ uint64_t expected_result;
+};
+
+static const struct strtoull_testcase test_input[] = {
+ {"0x0", 0, 0, 3, 0},
+ {"1", 0, 0, 1, 1},
+ {"0x1", 0, 0, 3, 1},
+ {" -0666", 0, 0, 7, -0666},
+ {" -0x666", 0, 0, 8, -0x666},
+ {"18446744073709551614", 0, 0, 20, UINT64_C(0xfffffffffffffffe)},
+ {"0xfffffffffffffffe", 0, 0, 18, UINT64_C(0xfffffffffffffffe)},
+ {"18446744073709551615", 0, 0, 20, UINT64_C(0xffffffffffffffff)},
+ {"0xffffffffffffffff", 0, 0, 18, UINT64_C(0xffffffffffffffff)},
+ {"18446744073709551616", 0, ERANGE, 20, UINT64_C(0xffffffffffffffff)},
+ {"0x10000000000000000", 0, ERANGE, 19, UINT64_C(0xffffffffffffffff)},
+ {"ff", 16, 0, 2, 255},
+ {"0xff", 16, 0, 4, 255},
+ {" ", 0, 0, 0, 0},
+ {"0x", 0, 0, 1, 0},
+ {"0x", 8, 0, 1, 0},
+ {"0x", 16, 0, 1, 0},
+ {"zyyy", 0, 0, 0, 0},
+ {"0xfffffffffffffffff", 0, ERANGE, 19, ULLONG_MAX},
+ {"0xfffffffffffffffffz", 0, ERANGE, 19, ULLONG_MAX}
+};
+
+unsigned int i;
+
+for (i = 0; i < sizeof(test_input) / sizeof(test_input[0]); i++) {
+ const struct strtoull_testcase *const p = &test_input[i];
+ char *endptr;
+ uint64_t result;
+
+ errno = 0;
+ result = strtoull(p->nptr, &endptr, p->base);
+ OKF(errno == p->expected_errno,
+ ("test %d (input \"%s\"): expected errno %d, got errno %d",
+ i, p->nptr, p->expected_errno, errno));
+ OKF(result == p->expected_result,
+ ("test %d (input \"%s\"): expected result %" PRIu64
+ ", got result %" PRIu64,
+ i, p->nptr, p->expected_result, result));
+ OKF(endptr - p->nptr == p->expected_end,
+ ("test %d (input \"%s\"): expected end %d, got end %d",
+ i, p->nptr, p->expected_end, (int) (endptr - p->nptr)));
+}
+
+#endif
diff --git a/testing/fulltests/unit-tests/T018read_config_capp.c b/testing/fulltests/unit-tests/T018read_config_capp.c
new file mode 100644
index 0000000..d6a92c9
--- /dev/null
+++ b/testing/fulltests/unit-tests/T018read_config_capp.c
@@ -0,0 +1,129 @@
+/*
+ * etimetest.c
+ *
+ * HEADER Testing read_config.c shutdown callback
+ *
+ * Expected SUCCESSes for all tests: 8
+ *
+ * Test of snmpd_unregister_config_handler SUCCESSes: 4
+ * Test of unregister_all_config_handlers SUCCESSes: 4
+ *
+ */
+
+#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/testing.h>
+
+/* #undef TEST_INTERNAL_API */
+#define TEST_INTERNAL_API 1
+
+/*
+ * Global variables.
+ */
+int callback_called = 0;
+
+static void test_callback(void);
+static void test_callback(void) {
+ ++callback_called;
+};
+
+static void parse_config(const char *token, char *cptr);
+static void parse_config(const char *token, char *cptr) {
+ /* do nothing */
+};
+
+/* each test returns 0 on success, and >0 on failure */
+int test1(void);
+int test2(void);
+int test3(void);
+
+int (*tests[])(void) = { test1, test2, test3 };
+
+int main(int argc, char *argv[])
+{
+ int i,ret=0;
+ for(i=0;i<sizeof(tests)/sizeof(*tests);++i)
+ ret+=tests[i]();
+ if (__did_plan == 0) {
+ PLAN(__test_counter);
+ }
+ return ret;
+}
+
+int test1() {
+ int sum = 0;
+ callback_called = 0;
+ fprintf(stdout, "# snmpd_unregister_config_handler tests\n");
+ init_snmp("testing");
+ OKF(callback_called==0, ("Callback shouldn't be called before registering it - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ callback_called = 0;
+ register_app_config_handler("testing", parse_config, test_callback, "module-name module-path");
+ OKF(callback_called==0, ("Callback shouldn't be called after registering it - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ callback_called = 0;
+ unregister_app_config_handler("testing");
+ OKF(callback_called==1, ("Callback should have been called once and only once after unregistering handler - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ callback_called = 0;
+ snmp_shutdown("testing");
+ OKF(callback_called==0, ("Callback should have been called once and only once after shutdown - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ return (sum==1)?0:1;
+}
+
+int test2(void) {
+ int sum = 0;
+ callback_called = 0;
+ fprintf(stdout, "# unregister_all_config_handlers tests\n");
+ init_snmp("testing");
+ OKF(callback_called==0, ("Callback shouldn't be called before registering it - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ callback_called = 0;
+ register_app_config_handler("testing", parse_config, test_callback, "module-name module-path");
+ OKF(callback_called==0, ("Callback shouldn't be called after registering it - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ callback_called = 0;
+ snmp_shutdown("testing");
+ OKF(callback_called==1, ("Callback should have been called once and only once during shutdown - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ return (sum==1)?0:1;
+}
+
+int test3(void) {
+#ifdef TEST_INTERNAL_API
+ int sum = 0;
+ callback_called = 0;
+ fprintf(stdout, "# unregister_all_config_handlers internal api tests\n");
+ init_snmp("testing");
+ OKF(callback_called==0, ("Callback shouldn't be called before registering it - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ callback_called = 0;
+ register_app_config_handler("testing", parse_config, test_callback, "module-name module-path");
+ OKF(callback_called==0, ("Callback shouldn't be called after registering it - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ callback_called = 0;
+ unregister_all_config_handlers();
+ OKF(callback_called==1, ("Callback should have been called once and only once after unregistering handler - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ callback_called = 0;
+ snmp_shutdown("testing");
+ OKF(callback_called==0, ("Callback should not have been called during shutdown after unregistering handler - it was called %d times\n",callback_called));
+ sum += callback_called;
+
+ return (sum==1)?0:1;
+#else
+ return 0;
+#endif
+}
diff --git a/testing/fulltests/unit-tests/T019_snmp_service_clib.c b/testing/fulltests/unit-tests/T019_snmp_service_clib.c
new file mode 100644
index 0000000..42ec8d3
--- /dev/null
+++ b/testing/fulltests/unit-tests/T019_snmp_service_clib.c
@@ -0,0 +1,253 @@
+/* HEADER Testing domain and target registrations from snmp_service. */
+
+/* Setup configuration reading */
+netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE, "testprog");
+
+netsnmp_register_service_handlers();
+
+netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_HAVE_READ_CONFIG, 1);
+
+/* Clear all default values */
+netsnmp_clear_default_domain();
+netsnmp_clear_default_target();
+
+/* Test domain lookup */
+
+OK(netsnmp_register_default_domain("a", "") == 0,
+ "register an empty token in domain 'a'");
+
+OK(netsnmp_register_default_domain("b", "alfa") == 0,
+ "register a single token in domain 'b'");
+
+OK(netsnmp_register_default_domain("c", "alfa beta") == 0,
+ "register two tokens in domain 'c'");
+
+#define OK_STRCMP(name, value, expected) \
+ OKF(value != NULL && strcmp(expected, value) == 0, \
+ ("Lookup of '" #name "' expected '" expected "', got %s%s%s", \
+ value ? "'" : "", value ? value : "NULL", value ? "'" : ""))
+
+#define OK_STR_IS_NULL(name, value) \
+ OKF(value == NULL, \
+ ("Lookup of '" #name "' expected NULL, got %s%s%s", \
+ value ? "'" : "", value ? value : "NULL", value ? "'" : ""))
+
+#define OK_IS_NULL(name, value) \
+ OKF(value == NULL, ("Lookup of '" #name "' expected NULL, got %p", value))
+
+#define OK_IS_NOT_NULL(name, value) \
+ OKF(value != NULL, ("Lookup of '" #name "' expected non-NULL, got %p", value))
+
+{
+ const char *t;
+
+ t = netsnmp_lookup_default_domain("a");
+ OK_STRCMP(a, t, "");
+
+ t = netsnmp_lookup_default_domain("b");
+ OK_STRCMP(b, t, "alfa");
+
+ t = netsnmp_lookup_default_domain("c");
+ OK_STRCMP(c, t, "alfa");
+
+ t = netsnmp_lookup_default_domain("d");
+ OK_STR_IS_NULL(d, t);
+}
+
+{
+ const char *const *t;
+
+ t = netsnmp_lookup_default_domains("a");
+ OK_IS_NOT_NULL(a, t);
+ OK_STRCMP(a[0], t[0], "");
+ OK_STR_IS_NULL(a[1], t[1]);
+
+ t = netsnmp_lookup_default_domains("b");
+ OK_IS_NOT_NULL(b, t);
+ OK_STRCMP(b[0], t[0], "alfa");
+ OK_STR_IS_NULL(b[1], t[1]);
+
+ t = netsnmp_lookup_default_domains("c");
+ OK_IS_NOT_NULL(c, t);
+ OK_STRCMP(c[0], t[0], "alfa");
+ OK_STRCMP(c[1], t[1], "beta");
+ OK_STR_IS_NULL(c[2], t[2]);
+
+ t = netsnmp_lookup_default_domains("d");
+ OK_IS_NULL(d, t);
+}
+
+{
+ char cfg[] = "defDomain=b gamma";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS, "register user domain for 'b'");
+}
+
+{
+ char cfg[] = "defDomain=c gamma delta";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS, "register user domains for 'c'");
+}
+
+{
+ char cfg[] = "defDomain=b2 gamma";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS, "register user domain for 'b2'");
+}
+
+{
+ char cfg[] = "defDomain=c2 gamma delta";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS, "register user domains for 'c2'");
+}
+
+{
+ const char *t;
+
+ t = netsnmp_lookup_default_domain("b");
+ OK_STRCMP(b, t, "gamma");
+
+ t = netsnmp_lookup_default_domain("b2");
+ OK_STRCMP(b2, t, "gamma");
+
+ t = netsnmp_lookup_default_domain("c");
+ OK_STRCMP(c, t, "gamma");
+
+ t = netsnmp_lookup_default_domain("c2");
+ OK_STRCMP(c2, t, "gamma");
+}
+
+{
+ const char *const *t;
+
+ t = netsnmp_lookup_default_domains("b");
+ OK_IS_NOT_NULL(b, t);
+ OK_STRCMP(b[0], t[0], "gamma");
+ OK_STR_IS_NULL(b[1], t[1]);
+
+ t = netsnmp_lookup_default_domains("b2");
+ OK_IS_NOT_NULL(b2, t);
+ OK_STRCMP(b2[0], t[0], "gamma");
+ OK_STR_IS_NULL(b2[1], t[1]);
+
+ t = netsnmp_lookup_default_domains("c");
+ OK_IS_NOT_NULL(c, t);
+ OK_STRCMP(c[0], t[0], "gamma");
+ OK_STRCMP(c[1], t[1], "delta");
+ OK_STR_IS_NULL(c[2], t[2]);
+
+ t = netsnmp_lookup_default_domains("c2");
+ OK_IS_NOT_NULL(c2, t);
+ OK_STRCMP(c2[0], t[0], "gamma");
+ OK_STRCMP(c2[1], t[1], "delta");
+ OK_STR_IS_NULL(c2[2], t[2]);
+}
+
+{
+ char cfg[] = "defDomain=";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS, "Empty config line");
+}
+
+{
+ const char* t;
+ char cfg[] = "defDomain=e";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS, "Incomplete config line");
+ t = netsnmp_lookup_default_domain("e");
+ OK_STR_IS_NULL(e, t);
+}
+
+/* Test target lookup */
+
+OK(netsnmp_register_default_target("b", "alfa", "alfa-domain:b") == 0,
+ "register a 'alfa:alfa-domain:b' for application 'b'");
+
+OK(netsnmp_register_default_target("b", "beta", "beta-domain:b") == 0,
+ "register a 'beta:beta-domain:b' for application 'b'");
+
+OK(netsnmp_register_default_target("c", "alfa", "alfa-domain:c") == 0,
+ "register a 'alfa:alfa-domain:c' for application 'c'");
+
+{
+ const char *t;
+
+ t = netsnmp_lookup_default_target("b", "alfa");
+ OK_STRCMP(b:alfa, t, "alfa-domain:b");
+
+ t = netsnmp_lookup_default_target("b", "beta");
+ OK_STRCMP(b:beta, t, "beta-domain:b");
+
+ t = netsnmp_lookup_default_target("c", "alfa");
+ OK_STRCMP(c:alfa, t, "alfa-domain:c");
+
+ t = netsnmp_lookup_default_target("a", "alfa");
+ OK_STR_IS_NULL(a:alfa, t);
+
+ t = netsnmp_lookup_default_target("b", "gamma");
+ OK_STR_IS_NULL(b:gamma, t);
+
+ t = netsnmp_lookup_default_target("c", "beta");
+ OK_STR_IS_NULL(c:beta, t);
+}
+
+{
+ char cfg[] = "defTarget=b alfa user-alfa:b";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS,
+ "register user target 'alfa:user-alfa:b' for application 'b'");
+}
+
+{
+ char cfg[] = "defTarget=b gamma user-gamma:b";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS,
+ "register user target 'gamma:user-gamma:b' for application 'b'");
+}
+
+{
+ char cfg[] = "defTarget=c alfa user-alfa:c";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS,
+ "register user target 'alfa:user-alfa:c' for application 'c'");
+}
+
+
+{
+ const char *t;
+
+ t = netsnmp_lookup_default_target("b", "alfa");
+ OK_STRCMP(b:alfa, t, "user-alfa:b");
+
+ t = netsnmp_lookup_default_target("b", "beta");
+ OK_STRCMP(b:beta, t, "beta-domain:b");
+
+ t = netsnmp_lookup_default_target("c", "alfa");
+ OK_STRCMP(c:alfa, t, "user-alfa:c");
+
+ t = netsnmp_lookup_default_target("a", "alfa");
+ OK_STR_IS_NULL(a:alfa, t);
+
+ t = netsnmp_lookup_default_target("b", "gamma");
+ OK_STRCMP(b:gamma, t, "user-gamma:b");
+
+ t = netsnmp_lookup_default_target("b", "delta");
+ OK_STR_IS_NULL(b:delta, t);
+
+ t = netsnmp_lookup_default_target("c", "beta");
+ OK_STR_IS_NULL(c:beta, t);
+}
+
+{
+ char cfg[] = "defTarget=";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS, "Empty config line");
+}
+
+{
+ const char* t;
+ char cfg[] = "defTarget=e1";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS, "Incomplete config line #1");
+ t = netsnmp_lookup_default_target("e1", "");
+ OK_STR_IS_NULL(e1:, t);
+}
+
+{
+ const char* t;
+ char cfg[] = "defTarget=e2 omega";
+ OK(netsnmp_config(cfg) == SNMPERR_SUCCESS, "Incomplete config line #2");
+ t = netsnmp_lookup_default_target("e2", "omega");
+ OK_STR_IS_NULL(e2:omega, t);
+}
diff --git a/testing/fulltests/unit-tests/T101pdu_type_clib.c b/testing/fulltests/unit-tests/T101pdu_type_clib.c
new file mode 100644
index 0000000..771aa61
--- /dev/null
+++ b/testing/fulltests/unit-tests/T101pdu_type_clib.c
@@ -0,0 +1,13 @@
+/* HEADER PDU type descriptions */
+const char *pdu_description;
+pdu_description = snmp_pdu_type(SNMP_MSG_GET);
+OKF((strcmp(pdu_description, "GET") == 0),
+ ("SNMP GET PDU type did not return the expected identifier (GET): %s",
+ pdu_description));
+
+#ifdef NETSNMP_NO_WRITE_SUPPORT
+pdu_description = snmp_pdu_type(163);
+OKF((strcmp(pdu_description, "?0xA3?") == 0),
+ ("SNMP SET PDU type did not return the expected unknown identifier (?0xA3?): %s",
+ pdu_description));
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
diff --git a/testing/fulltests/unit-tests/T102pdu_build_clib.c b/testing/fulltests/unit-tests/T102pdu_build_clib.c
new file mode 100644
index 0000000..1fba69e
--- /dev/null
+++ b/testing/fulltests/unit-tests/T102pdu_build_clib.c
@@ -0,0 +1,67 @@
+/* HEADER PDU building */
+
+SOCK_STARTUP;
+
+netsnmp_pdu *pdu;
+u_char *packet;
+size_t packet_len, offset = 0;
+netsnmp_session session, *ss;
+int rc;
+
+/* prototype copied from snmp_api.c */
+int snmp_build(u_char ** pkt, size_t * pkt_len,
+ size_t * offset, netsnmp_session * pss,
+ netsnmp_pdu *pdu);
+
+init_snmp("testing");
+snmp_sess_init(&session);
+session.version = SNMP_VERSION_2c;
+session.peername = strdup("udp:127.0.0.1"); /* we won't actually connect */
+session.community = (u_char *) strdup("bogus");
+session.community_len = strlen((char *) session.community);
+ss = snmp_open(&session);
+
+OKF((ss != NULL), ("Creating a session failed"));
+if (ss == NULL)
+ snmp_perror("ack");
+
+packet_len = 4096;
+packet = malloc(packet_len);
+
+pdu = snmp_pdu_create(SNMP_MSG_GET);
+pdu->version = session.version;
+
+OKF((pdu != NULL), ("Creating a GET PDU failed"));
+
+rc = snmp_build(&packet, &packet_len, &offset, ss, pdu);
+
+#ifndef NETSNMP_NOTIFY_ONLY
+OKF((rc == SNMPERR_SUCCESS),
+ ("Building a GET PDU/packet should have worked: %d", rc));
+#else /* NETSNMP_NOTIFY_ONLY */
+OKF((rc != SNMPERR_SUCCESS),
+ ("Building a GET PDU/packet should have failed: %d", rc));
+#endif /* NETSNMP_NOTIFY_ONLY */
+
+offset = 0;
+pdu->command = 163; /* a SET message */
+rc = snmp_build(&packet, &packet_len, &offset, ss, pdu);
+
+#ifndef NETSNMP_NO_WRITE_SUPPORT
+OKF((rc == SNMPERR_SUCCESS),
+ ("Building a SET PDU/packet should have succeeded: %d", rc));
+#else /* NETSNMP_NO_WRITE_SUPPORT */
+OKF((rc != SNMPERR_SUCCESS),
+ ("Building a SET PDU/packet should have failed: %d", rc));
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
+
+
+
+offset = 0;
+pdu->command = SNMP_MSG_INFORM;
+rc = snmp_build(&packet, &packet_len, &offset, ss, pdu);
+
+OKF((rc == SNMPERR_SUCCESS),
+ ("Building an INFORM PDU/packet should have succeed: %d", rc));
+
+SOCK_CLEANUP;
diff --git a/testing/fulltests/unit-tests/T103pdu_parse_clib.c b/testing/fulltests/unit-tests/T103pdu_parse_clib.c
new file mode 100644
index 0000000..8d5882d
--- /dev/null
+++ b/testing/fulltests/unit-tests/T103pdu_parse_clib.c
@@ -0,0 +1,22 @@
+/* HEADER Parsing of PDUs */
+netsnmp_pdu pdu;
+int rc;
+u_char data[] = {
+ 0xA2, 0x1D, 0x02, 0x04, 0x4E, 0x39,
+ 0xB2, 0x8E, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00,
+ 0x30, 0x0F, 0x30, 0x0D, 0x06, 0x08, 0x2B, 0x06,
+ 0x01, 0x02, 0x01, 0x01, 0x04, 0x00, 0x04, 0x01,
+ 0x66
+};
+size_t data_length=sizeof(data);
+
+rc = snmp_pdu_parse(&pdu, data, &data_length);
+
+OKF((rc == 0), ("Parsing of a generic PDU failed"));
+
+#ifdef NETSNMP_NO_WRITE_SUPPORT
+data[0] = 0xA3; /* changes it to a SET pdu */
+rc = snmp_pdu_parse(&pdu, data, &data_length);
+
+OKF((rc != 0), ("Parsing of a generic SET PDU succeeded"));
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
diff --git a/testing/rfc1213/README b/testing/rfc1213/README
new file mode 100644
index 0000000..3802aa8
--- /dev/null
+++ b/testing/rfc1213/README
@@ -0,0 +1,25 @@
+#######################################
+# Ling Xiaofeng
+#
+
+These test cases are to test for accessing RFC-1213MIB variable
+To run test:
+cd this directory and type
+./run
+
+#######################################
+# 07-Apr-2004 Mike Slifcak adapted for use with "make test" [RUNTESTS]
+#
+Options
+ Environment Variables
+
+ SNMP_SLEEP -- number of seconds delay between actions. Defaults to 1
+ SNMP_VERBOSE - 1=verbose messages; 0=dots plus summary. Defaults to 0
+
+
+Notes for proper operation in certain environments
+
+ Msys/MinGW provides a _minimal_ GNU environment
+ For best results with these tests:
+ copy c:\msys\bin\sh.exe c:\msys\bin\bash.exe
+
diff --git a/testing/rfc1213/run b/testing/rfc1213/run
new file mode 100755
index 0000000..e07a7af
--- /dev/null
+++ b/testing/rfc1213/run
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+
+cd `dirname $0`
+
+PATH=..:$PATH
+
+. ../eval_tools.sh
+
+. test_fun
+. snmpfun.sh
+
+SNMP_SLEEP=${SNMP_SLEEP:-"1"}
+SNMP_VERBOSE=${SNMP_VERBOSE:-"0"}
+
+trap "STOPAGENT; DELAY; summary; exit 1" 1 2 3 9 15 19
+
+if [ -z "$1" ] ; then
+ LIST="testmib1.sh testmib2.sh testmib3.sh"
+ MULTI="yes"
+else
+ LIST=testmib${1}.sh
+fi
+
+for f in $LIST
+do
+ if [ -n "$MULTI" ] ; then
+ echo ## start next in series on new line
+ fi
+ if [ $SNMP_VERBOSE -ne 0 ] ; then
+ echo "run test in $f"
+ fi
+
+ . $f
+ dperline=0
+
+ for ic in $iclist
+ do
+ eval tplist=\"\$$ic\"
+ for tp in $tplist
+ do
+ $tp
+ done
+ done
+
+ STOPAGENT
+ DELAY
+done
+
+summary
+
+if [ $fail_num -ne 0 ] ; then
+ RC=1
+else
+ RC=0
+fi
+
+exit $RC
+
diff --git a/testing/rfc1213/snmpfun.sh b/testing/rfc1213/snmpfun.sh
new file mode 100644
index 0000000..d87c240
--- /dev/null
+++ b/testing/rfc1213/snmpfun.sh
@@ -0,0 +1,78 @@
+
+# functions used by RFC-1213 MIB test modules
+
+myport=$SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT
+
+noauth="" # no - use Auth+Priv . yes - no auth, no priv
+
+if [ "x$noauth" = xyes ] ; then
+ TEST_AUTHPRIV_PARMS="-l noAuthnoPriv"
+else
+ TEST_AUTHPRIV_PARMS="-l authNoPriv -a MD5 -A testpass"
+fi
+
+config()
+{
+ rm -f $SNMP_CONFIG_FILE
+ CONFIGAGENT rwcommunity test
+ STARTAGENT
+}
+
+configv3()
+{
+ rm -f $SNMP_CONFIG_FILE
+ CONFIGAGENT rwcommunity test
+ CONFIGAGENT rwuser testrwuser noauth
+ CONFIGAGENT createUser testrwuser MD5 testpass
+ STARTAGENT
+}
+
+get_snmp_variable()
+{
+ test_start "Access $2.0 by SNMPv$1..."
+ CAPTURE "snmpget -v $1 -c test $myport $2.0"
+ if [ $? != 0 ];then
+ test_finish FAIL
+ else
+ test_finish PASS
+ fi
+
+}
+
+get_snmpv3_variable()
+{
+ test_start "Access $2.0 by SNMPv3..."
+ CAPTURE "snmpget -v 3 -u testrwuser $TEST_AUTHPRIV_PARMS $myport $2.0"
+ if [ $? != 0 ];then
+ test_finish FAIL
+ else
+ test_finish PASS
+ fi
+
+}
+
+get_snmp_table()
+{
+ test_start "Access table $2 by SNMPv$1..."
+ CAPTURE "snmpgetnext -Of -v $1 -c test $myport $2"
+ CHECKFILE '' "\.$2\."
+ if [ "$snmp_last_test_result" = 0 ] ; then
+ test_finish FAIL
+ else
+ test_finish PASS
+ fi
+
+}
+
+get_snmpv3_table()
+{
+ test_start "Access table $2 by SNMPv3..."
+ CAPTURE "snmpgetnext -Of -v 3 -u testrwuser $TEST_AUTHPRIV_PARMS $myport $2"
+ CHECKFILE '' "\.$2\."
+ if [ "$snmp_last_test_result" = 0 ] ; then
+ test_finish FAIL
+ else
+ test_finish PASS
+ fi
+
+}
diff --git a/testing/rfc1213/test_fun b/testing/rfc1213/test_fun
new file mode 100644
index 0000000..b5c6080
--- /dev/null
+++ b/testing/rfc1213/test_fun
@@ -0,0 +1,68 @@
+## no ANSI color for cygwin
+pass_num=0;
+fail_num=0;
+case_num=0;
+tcase_str=""
+dperline=0
+max_dperline=25 # maximum dots per line
+
+pass_info()
+{
+ if [ $SNMP_VERBOSE -ne 0 ] ; then
+# if [ "x$OSTYPE" = "xcygwin" ] ; then
+ echo -en $1
+# else
+# echo -en "\033[1;32m$1\033[0;39m"
+# fi
+ fi
+}
+
+fail_info()
+{
+ if [ $SNMP_VERBOSE -eq 0 ] ; then
+ echo
+ ECHO $tcase_str
+ fi
+# if [ "x$OSTYPE" = "xcygwin" ] ; then
+ echo -en $1
+# else
+# echo -en "\033[1;31m$1\033[0;39m"
+# fi
+}
+
+test_start()
+{
+ case_num=`expr $case_num + 1`;
+ tcase_str="$testnum.$case_num:$1 "
+ if [ $SNMP_VERBOSE -ne 0 ] ; then
+ ECHO $tcase_str
+ else
+ ECHO "."
+ dperline=`expr $dperline + 1`
+ if [ $dperline -ge $max_dperline ] ; then
+ dperline=0
+ echo
+ fi
+ fi
+}
+
+test_finish()
+{
+ if [ x$1 == x"PASS" ];then
+ pass_num=`expr $pass_num + 1`
+ pass_info "PASS\n"
+ else
+ fail_num=`expr $fail_num + 1`
+ fail_info "FAIL\n"
+ fi
+ tcase_str=""
+}
+
+summary()
+{
+ if [ $case_num -ne $pass_num ] ; then
+ echo
+ ECHO "$testnum: $case_num total, $pass_num passed, $fail_num failed. "
+ fi
+}
+
diff --git a/testing/rfc1213/testmib1.sh b/testing/rfc1213/testmib1.sh
new file mode 100644
index 0000000..7da5333
--- /dev/null
+++ b/testing/rfc1213/testmib1.sh
@@ -0,0 +1,448 @@
+#!/bin/sh
+#
+# Test for RFC-1213MIB variable
+#
+#
+
+HEADER RFC-1213 MIB SNMPv1 access
+
+iclist="ic1 " # list invocable components
+
+ic1="tp1 tp2 tp3 tp4 tp5 tp6 tp7 tp8 tp9 tp10 tp11 tp12 tp13 tp14 tp15 tp16 tp17 tp18 tp19 tp20 tp21 tp22 tp23 tp24 tp25 tp26 tp27 tp28 tp29 tp30 tp31 tp32 tp33 tp34 tp35 tp36 tp37 tp38 tp39 tp40 tp41 tp42 tp43 tp44 tp45 tp46 tp47 tp48 tp49 tp50 tp51 tp52 tp53 tp54 tp55 tp56 tp57 tp58 tp59 tp60 tp61 tp62 tp63 tp64 tp65 tp66 tp67 tp68 tp69 tp70 tp71 tp72 tp73 tp74 tp75 tp76 tp77 tp78 tp79 tp80 tp81 tp82 tp83 tp84 tp85 tp86 tp87 tp88 tp89 tp90 tp91 tp92 tp93 tp94 tp95 tp96 tp97 tp98 tp99 tp100 tp101 tp102 tp103 tp104 tp105 tp106 tp107 tp108"
+
+
+config
+
+tp1()
+{
+ get_snmp_variable 1 system.sysDescr
+}
+tp2()
+{
+ get_snmp_variable 1 system.sysObjectID
+}
+tp3()
+{
+ get_snmp_variable 1 system.sysUpTime
+}
+tp4()
+{
+ get_snmp_variable 1 system.sysContact
+}
+tp5()
+{
+ get_snmp_variable 1 system.sysName
+}
+tp6()
+{
+ get_snmp_variable 1 system.sysLocation
+}
+tp7()
+{
+ get_snmp_variable 1 interfaces.ifNumber
+}
+tp8()
+{
+ get_snmp_table 1 interfaces.ifTable
+}
+tp9()
+{
+ get_snmp_table 1 at.atTable
+}
+tp10()
+{
+ get_snmp_variable 1 ip.ipInReceives
+}
+tp11()
+{
+ get_snmp_variable 1 ip.ipForwarding
+}
+tp12()
+{
+ get_snmp_variable 1 ip.ipDefaultTTL
+}
+tp13()
+{
+ get_snmp_variable 1 ip.ipInReceives
+}
+tp14()
+{
+ get_snmp_variable 1 ip.ipInHdrErrors
+}
+tp15()
+{
+ get_snmp_variable 1 ip.ipInAddrErrors
+}
+tp16()
+{
+ get_snmp_variable 1 ip.ipForwDatagrams
+}
+tp17()
+{
+ get_snmp_variable 1 ip.ipInUnknownProtos
+}
+tp18()
+{
+ get_snmp_variable 1 ip.ipInDiscards
+}
+tp19()
+{
+ get_snmp_variable 1 ip.ipInDelivers
+}
+tp20()
+{
+ get_snmp_variable 1 ip.ipOutRequests
+}
+tp21()
+{
+ get_snmp_variable 1 ip.ipOutDiscards
+}
+tp22()
+{
+ get_snmp_variable 1 ip.ipOutNoRoutes
+}
+tp23()
+{
+ get_snmp_variable 1 ip.ipReasmTimeout
+}
+tp24()
+{
+ get_snmp_variable 1 ip.ipReasmReqds
+}
+tp25()
+{
+ get_snmp_variable 1 ip.ipReasmOKs
+}
+tp26()
+{
+ get_snmp_variable 1 ip.ipReasmFails
+}
+tp27()
+{
+ get_snmp_variable 1 ip.ipFragOKs
+}
+tp28()
+{
+ get_snmp_variable 1 ip.ipFragFails
+}
+tp29()
+{
+ get_snmp_variable 1 ip.ipFragCreates
+}
+tp30()
+{
+ get_snmp_variable 1 ip.ipRoutingDiscards
+}
+tp31()
+{
+ get_snmp_table 1 ip.ipAddrTable
+}
+tp32()
+{
+ get_snmp_table 1 ip.ipRouteTable
+}
+tp33()
+{
+ get_snmp_table 1 ip.ipNetToMediaTable
+}
+tp34()
+{
+ get_snmp_variable 1 icmp.icmpInMsgs
+}
+tp35()
+{
+ get_snmp_variable 1 icmp.icmpInErrors
+}
+tp36()
+{
+ get_snmp_variable 1 icmp.icmpInDestUnreachs
+}
+tp37()
+{
+ get_snmp_variable 1 icmp.icmpInTimeExcds
+}
+tp38()
+{
+ get_snmp_variable 1 icmp.icmpInParmProbs
+}
+tp39()
+{
+ get_snmp_variable 1 icmp.icmpInSrcQuenchs
+}
+tp40()
+{
+ get_snmp_variable 1 icmp.icmpInRedirects
+}
+tp41()
+{
+ get_snmp_variable 1 icmp.icmpInEchos
+}
+tp42()
+{
+ get_snmp_variable 1 icmp.icmpInEchoReps
+}
+tp43()
+{
+ get_snmp_variable 1 icmp.icmpInTimestamps
+}
+tp44()
+{
+ get_snmp_variable 1 icmp.icmpInTimestampReps
+}
+tp45()
+{
+ get_snmp_variable 1 icmp.icmpInAddrMasks
+}
+tp46()
+{
+ get_snmp_variable 1 icmp.icmpInAddrMaskReps
+}
+tp47()
+{
+ get_snmp_variable 1 icmp.icmpOutMsgs
+}
+tp48()
+{
+ get_snmp_variable 1 icmp.icmpOutErrors
+}
+tp49()
+{
+ get_snmp_variable 1 icmp.icmpOutDestUnreachs
+}
+tp50()
+{
+ get_snmp_variable 1 icmp.icmpOutTimeExcds
+}
+tp51()
+{
+ get_snmp_variable 1 icmp.icmpOutParmProbs
+}
+tp52()
+{
+ get_snmp_variable 1 icmp.icmpOutSrcQuenchs
+}
+tp53()
+{
+ get_snmp_variable 1 icmp.icmpOutRedirects
+}
+tp54()
+{
+ get_snmp_variable 1 icmp.icmpOutEchos
+}
+tp55()
+{
+ get_snmp_variable 1 icmp.icmpOutEchoReps
+}
+tp56()
+{
+ get_snmp_variable 1 icmp.icmpOutTimestamps
+}
+tp57()
+{
+ get_snmp_variable 1 icmp.icmpOutTimestampReps
+}
+tp58()
+{
+ get_snmp_variable 1 icmp.icmpOutAddrMasks
+}
+tp59()
+{
+ get_snmp_variable 1 icmp.icmpOutAddrMaskReps
+}
+tp60()
+{
+ get_snmp_variable 1 tcp.tcpActiveOpens
+}
+tp61()
+{
+ get_snmp_variable 1 tcp.tcpRtoAlgorithm
+}
+tp62()
+{
+ get_snmp_variable 1 tcp.tcpRtoMin
+}
+tp63()
+{
+ get_snmp_variable 1 tcp.tcpRtoMax
+}
+tp64()
+{
+ get_snmp_variable 1 tcp.tcpMaxConn
+}
+tp65()
+{
+ get_snmp_variable 1 tcp.tcpActiveOpens
+}
+tp66()
+{
+ get_snmp_variable 1 tcp.tcpPassiveOpens
+}
+tp67()
+{
+ get_snmp_variable 1 tcp.tcpAttemptFails
+}
+tp68()
+{
+ get_snmp_variable 1 tcp.tcpEstabResets
+}
+tp69()
+{
+ get_snmp_variable 1 tcp.tcpCurrEstab
+}
+tp70()
+{
+ get_snmp_variable 1 tcp.tcpInSegs
+}
+tp71()
+{
+ get_snmp_variable 1 tcp.tcpOutSegs
+}
+tp72()
+{
+ get_snmp_variable 1 tcp.tcpRetransSegs
+}
+tp73()
+{
+ get_snmp_variable 1 tcp.tcpInErrs
+}
+tp74()
+{
+ get_snmp_variable 1 tcp.tcpOutRsts
+}
+tp75()
+{
+ get_snmp_table 1 tcp.tcpConnTable
+}
+tp76()
+{
+ get_snmp_variable 1 udp.udpInDatagrams
+}
+tp77()
+{
+ get_snmp_variable 1 udp.udpNoPorts
+}
+tp78()
+{
+ get_snmp_variable 1 udp.udpInErrors
+}
+tp79()
+{
+ get_snmp_variable 1 udp.udpOutDatagrams
+}
+tp80()
+{
+ get_snmp_table 1 udp.udpTable
+}
+tp81()
+{
+ get_snmp_variable 1 snmp.snmpInPkts
+}
+tp82()
+{
+ get_snmp_variable 1 snmp.snmpOutPkts
+}
+tp83()
+{
+ get_snmp_variable 1 snmp.snmpInBadVersions
+}
+tp84()
+{
+ get_snmp_variable 1 snmp.snmpInBadCommunityNames
+}
+tp85()
+{
+ get_snmp_variable 1 snmp.snmpInBadCommunityUses
+}
+tp86()
+{
+ get_snmp_variable 1 snmp.snmpInASNParseErrs
+}
+tp87()
+{
+ get_snmp_variable 1 snmp.snmpInTooBigs
+}
+tp88()
+{
+ get_snmp_variable 1 snmp.snmpInNoSuchNames
+}
+tp89()
+{
+ get_snmp_variable 1 snmp.snmpInBadValues
+}
+tp90()
+{
+ get_snmp_variable 1 snmp.snmpInReadOnlys
+}
+tp91()
+{
+ get_snmp_variable 1 snmp.snmpInGenErrs
+}
+tp92()
+{
+ get_snmp_variable 1 snmp.snmpInTotalReqVars
+}
+tp93()
+{
+ get_snmp_variable 1 snmp.snmpInTotalSetVars
+}
+tp94()
+{
+ get_snmp_variable 1 snmp.snmpInGetRequests
+}
+tp95()
+{
+ get_snmp_variable 1 snmp.snmpInGetNexts
+}
+tp96()
+{
+ get_snmp_variable 1 snmp.snmpInSetRequests
+}
+tp97()
+{
+ get_snmp_variable 1 snmp.snmpInGetResponses
+}
+tp98()
+{
+ get_snmp_variable 1 snmp.snmpInTraps
+}
+tp99()
+{
+ get_snmp_variable 1 snmp.snmpOutTooBigs
+}
+tp100()
+{
+ get_snmp_variable 1 snmp.snmpOutNoSuchNames
+}
+tp101()
+{
+ get_snmp_variable 1 snmp.snmpOutBadValues
+}
+tp102()
+{
+ get_snmp_variable 1 snmp.snmpOutGenErrs
+}
+tp103()
+{
+ get_snmp_variable 1 snmp.snmpOutGetRequests
+}
+tp104()
+{
+ get_snmp_variable 1 snmp.snmpOutGetNexts
+}
+tp105()
+{
+ get_snmp_variable 1 snmp.snmpOutSetRequests
+}
+tp106()
+{
+ get_snmp_variable 1 snmp.snmpOutGetResponses
+}
+tp107()
+{
+ get_snmp_variable 1 snmp.snmpOutTraps
+}
+tp108()
+{
+ get_snmp_variable 1 snmp.snmpEnableAuthenTraps
+}
+
diff --git a/testing/rfc1213/testmib2.sh b/testing/rfc1213/testmib2.sh
new file mode 100644
index 0000000..adae571
--- /dev/null
+++ b/testing/rfc1213/testmib2.sh
@@ -0,0 +1,447 @@
+#!/bin/sh
+#
+# Test for RFC-1213MIB variable
+#
+#
+
+HEADER RFC-1213 MIB SNMPv2c access
+
+iclist="ic1 " # list invocable components
+
+ic1="tp1 tp2 tp3 tp4 tp5 tp6 tp7 tp8 tp9 tp10 tp11 tp12 tp13 tp14 tp15 tp16 tp17 tp18 tp19 tp20 tp21 tp22 tp23 tp24 tp25 tp26 tp27 tp28 tp29 tp30 tp31 tp32 tp33 tp34 tp35 tp36 tp37 tp38 tp39 tp40 tp41 tp42 tp43 tp44 tp45 tp46 tp47 tp48 tp49 tp50 tp51 tp52 tp53 tp54 tp55 tp56 tp57 tp58 tp59 tp60 tp61 tp62 tp63 tp64 tp65 tp66 tp67 tp68 tp69 tp70 tp71 tp72 tp73 tp74 tp75 tp76 tp77 tp78 tp79 tp80 tp81 tp82 tp83 tp84 tp85 tp86 tp87 tp88 tp89 tp90 tp91 tp92 tp93 tp94 tp95 tp96 tp97 tp98 tp99 tp100 tp101 tp102 tp103 tp104 tp105 tp106 tp107 tp108"
+
+config
+
+tp1()
+{
+ get_snmp_variable 2c system.sysDescr
+}
+tp2()
+{
+ get_snmp_variable 2c system.sysObjectID
+}
+tp3()
+{
+ get_snmp_variable 2c system.sysUpTime
+}
+tp4()
+{
+ get_snmp_variable 2c system.sysContact
+}
+tp5()
+{
+ get_snmp_variable 2c system.sysName
+}
+tp6()
+{
+ get_snmp_variable 2c system.sysLocation
+}
+tp7()
+{
+ get_snmp_variable 2c interfaces.ifNumber
+}
+tp8()
+{
+ get_snmp_table 2c interfaces.ifTable
+}
+tp9()
+{
+ get_snmp_table 2c at.atTable
+}
+tp10()
+{
+ get_snmp_variable 2c ip.ipInReceives
+}
+tp11()
+{
+ get_snmp_variable 2c ip.ipForwarding
+}
+tp12()
+{
+ get_snmp_variable 2c ip.ipDefaultTTL
+}
+tp13()
+{
+ get_snmp_variable 2c ip.ipInReceives
+}
+tp14()
+{
+ get_snmp_variable 2c ip.ipInHdrErrors
+}
+tp15()
+{
+ get_snmp_variable 2c ip.ipInAddrErrors
+}
+tp16()
+{
+ get_snmp_variable 2c ip.ipForwDatagrams
+}
+tp17()
+{
+ get_snmp_variable 2c ip.ipInUnknownProtos
+}
+tp18()
+{
+ get_snmp_variable 2c ip.ipInDiscards
+}
+tp19()
+{
+ get_snmp_variable 2c ip.ipInDelivers
+}
+tp20()
+{
+ get_snmp_variable 2c ip.ipOutRequests
+}
+tp21()
+{
+ get_snmp_variable 2c ip.ipOutDiscards
+}
+tp22()
+{
+ get_snmp_variable 2c ip.ipOutNoRoutes
+}
+tp23()
+{
+ get_snmp_variable 2c ip.ipReasmTimeout
+}
+tp24()
+{
+ get_snmp_variable 2c ip.ipReasmReqds
+}
+tp25()
+{
+ get_snmp_variable 2c ip.ipReasmOKs
+}
+tp26()
+{
+ get_snmp_variable 2c ip.ipReasmFails
+}
+tp27()
+{
+ get_snmp_variable 2c ip.ipFragOKs
+}
+tp28()
+{
+ get_snmp_variable 2c ip.ipFragFails
+}
+tp29()
+{
+ get_snmp_variable 2c ip.ipFragCreates
+}
+tp30()
+{
+ get_snmp_variable 2c ip.ipRoutingDiscards
+}
+tp31()
+{
+ get_snmp_table 2c ip.ipAddrTable
+}
+tp32()
+{
+ get_snmp_table 2c ip.ipRouteTable
+}
+tp33()
+{
+ get_snmp_table 2c ip.ipNetToMediaTable
+}
+tp34()
+{
+ get_snmp_variable 2c icmp.icmpInMsgs
+}
+tp35()
+{
+ get_snmp_variable 2c icmp.icmpInErrors
+}
+tp36()
+{
+ get_snmp_variable 2c icmp.icmpInDestUnreachs
+}
+tp37()
+{
+ get_snmp_variable 2c icmp.icmpInTimeExcds
+}
+tp38()
+{
+ get_snmp_variable 2c icmp.icmpInParmProbs
+}
+tp39()
+{
+ get_snmp_variable 2c icmp.icmpInSrcQuenchs
+}
+tp40()
+{
+ get_snmp_variable 2c icmp.icmpInRedirects
+}
+tp41()
+{
+ get_snmp_variable 2c icmp.icmpInEchos
+}
+tp42()
+{
+ get_snmp_variable 2c icmp.icmpInEchoReps
+}
+tp43()
+{
+ get_snmp_variable 2c icmp.icmpInTimestamps
+}
+tp44()
+{
+ get_snmp_variable 2c icmp.icmpInTimestampReps
+}
+tp45()
+{
+ get_snmp_variable 2c icmp.icmpInAddrMasks
+}
+tp46()
+{
+ get_snmp_variable 2c icmp.icmpInAddrMaskReps
+}
+tp47()
+{
+ get_snmp_variable 2c icmp.icmpOutMsgs
+}
+tp48()
+{
+ get_snmp_variable 2c icmp.icmpOutErrors
+}
+tp49()
+{
+ get_snmp_variable 2c icmp.icmpOutDestUnreachs
+}
+tp50()
+{
+ get_snmp_variable 2c icmp.icmpOutTimeExcds
+}
+tp51()
+{
+ get_snmp_variable 2c icmp.icmpOutParmProbs
+}
+tp52()
+{
+ get_snmp_variable 2c icmp.icmpOutSrcQuenchs
+}
+tp53()
+{
+ get_snmp_variable 2c icmp.icmpOutRedirects
+}
+tp54()
+{
+ get_snmp_variable 2c icmp.icmpOutEchos
+}
+tp55()
+{
+ get_snmp_variable 2c icmp.icmpOutEchoReps
+}
+tp56()
+{
+ get_snmp_variable 2c icmp.icmpOutTimestamps
+}
+tp57()
+{
+ get_snmp_variable 2c icmp.icmpOutTimestampReps
+}
+tp58()
+{
+ get_snmp_variable 2c icmp.icmpOutAddrMasks
+}
+tp59()
+{
+ get_snmp_variable 2c icmp.icmpOutAddrMaskReps
+}
+tp60()
+{
+ get_snmp_variable 2c tcp.tcpActiveOpens
+}
+tp61()
+{
+ get_snmp_variable 2c tcp.tcpRtoAlgorithm
+}
+tp62()
+{
+ get_snmp_variable 2c tcp.tcpRtoMin
+}
+tp63()
+{
+ get_snmp_variable 2c tcp.tcpRtoMax
+}
+tp64()
+{
+ get_snmp_variable 2c tcp.tcpMaxConn
+}
+tp65()
+{
+ get_snmp_variable 2c tcp.tcpActiveOpens
+}
+tp66()
+{
+ get_snmp_variable 2c tcp.tcpPassiveOpens
+}
+tp67()
+{
+ get_snmp_variable 2c tcp.tcpAttemptFails
+}
+tp68()
+{
+ get_snmp_variable 2c tcp.tcpEstabResets
+}
+tp69()
+{
+ get_snmp_variable 2c tcp.tcpCurrEstab
+}
+tp70()
+{
+ get_snmp_variable 2c tcp.tcpInSegs
+}
+tp71()
+{
+ get_snmp_variable 2c tcp.tcpOutSegs
+}
+tp72()
+{
+ get_snmp_variable 2c tcp.tcpRetransSegs
+}
+tp73()
+{
+ get_snmp_variable 2c tcp.tcpInErrs
+}
+tp74()
+{
+ get_snmp_variable 2c tcp.tcpOutRsts
+}
+tp75()
+{
+ get_snmp_table 2c tcp.tcpConnTable
+}
+tp76()
+{
+ get_snmp_variable 2c udp.udpInDatagrams
+}
+tp77()
+{
+ get_snmp_variable 2c udp.udpNoPorts
+}
+tp78()
+{
+ get_snmp_variable 2c udp.udpInErrors
+}
+tp79()
+{
+ get_snmp_variable 2c udp.udpOutDatagrams
+}
+tp80()
+{
+ get_snmp_table 2c udp.udpTable
+}
+tp81()
+{
+ get_snmp_variable 2c snmp.snmpInPkts
+}
+tp82()
+{
+ get_snmp_variable 2c snmp.snmpOutPkts
+}
+tp83()
+{
+ get_snmp_variable 2c snmp.snmpInBadVersions
+}
+tp84()
+{
+ get_snmp_variable 2c snmp.snmpInBadCommunityNames
+}
+tp85()
+{
+ get_snmp_variable 2c snmp.snmpInBadCommunityUses
+}
+tp86()
+{
+ get_snmp_variable 2c snmp.snmpInASNParseErrs
+}
+tp87()
+{
+ get_snmp_variable 2c snmp.snmpInTooBigs
+}
+tp88()
+{
+ get_snmp_variable 2c snmp.snmpInNoSuchNames
+}
+tp89()
+{
+ get_snmp_variable 2c snmp.snmpInBadValues
+}
+tp90()
+{
+ get_snmp_variable 2c snmp.snmpInReadOnlys
+}
+tp91()
+{
+ get_snmp_variable 2c snmp.snmpInGenErrs
+}
+tp92()
+{
+ get_snmp_variable 2c snmp.snmpInTotalReqVars
+}
+tp93()
+{
+ get_snmp_variable 2c snmp.snmpInTotalSetVars
+}
+tp94()
+{
+ get_snmp_variable 2c snmp.snmpInGetRequests
+}
+tp95()
+{
+ get_snmp_variable 2c snmp.snmpInGetNexts
+}
+tp96()
+{
+ get_snmp_variable 2c snmp.snmpInSetRequests
+}
+tp97()
+{
+ get_snmp_variable 2c snmp.snmpInGetResponses
+}
+tp98()
+{
+ get_snmp_variable 2c snmp.snmpInTraps
+}
+tp99()
+{
+ get_snmp_variable 2c snmp.snmpOutTooBigs
+}
+tp100()
+{
+ get_snmp_variable 2c snmp.snmpOutNoSuchNames
+}
+tp101()
+{
+ get_snmp_variable 2c snmp.snmpOutBadValues
+}
+tp102()
+{
+ get_snmp_variable 2c snmp.snmpOutGenErrs
+}
+tp103()
+{
+ get_snmp_variable 2c snmp.snmpOutGetRequests
+}
+tp104()
+{
+ get_snmp_variable 2c snmp.snmpOutGetNexts
+}
+tp105()
+{
+ get_snmp_variable 2c snmp.snmpOutSetRequests
+}
+tp106()
+{
+ get_snmp_variable 2c snmp.snmpOutGetResponses
+}
+tp107()
+{
+ get_snmp_variable 2c snmp.snmpOutTraps
+}
+tp108()
+{
+ get_snmp_variable 2c snmp.snmpEnableAuthenTraps
+}
+
diff --git a/testing/rfc1213/testmib3.sh b/testing/rfc1213/testmib3.sh
new file mode 100644
index 0000000..e1038c9
--- /dev/null
+++ b/testing/rfc1213/testmib3.sh
@@ -0,0 +1,448 @@
+#!/bin/sh
+#
+# Test for RFC-1213MIB variable
+#
+#
+
+HEADER RFC-1213 MIB SNMPv3 access
+
+iclist="ic1 " # list invocable components
+
+ic1="tp1 tp2 tp3 tp4 tp5 tp6 tp7 tp8 tp9 tp10 tp11 tp12 tp13 tp14 tp15 tp16 tp17 tp18 tp19 tp20 tp21 tp22 tp23 tp24 tp25 tp26 tp27 tp28 tp29 tp30 tp31 tp32 tp33 tp34 tp35 tp36 tp37 tp38 tp39 tp40 tp41 tp42 tp43 tp44 tp45 tp46 tp47 tp48 tp49 tp50 tp51 tp52 tp53 tp54 tp55 tp56 tp57 tp58 tp59 tp60 tp61 tp62 tp63 tp64 tp65 tp66 tp67 tp68 tp69 tp70 tp71 tp72 tp73 tp74 tp75 tp76 tp77 tp78 tp79 tp80 tp81 tp82 tp83 tp84 tp85 tp86 tp87 tp88 tp89 tp90 tp91 tp92 tp93 tp94 tp95 tp96 tp97 tp98 tp99 tp100 tp101 tp102 tp103 tp104 tp105 tp106 tp107 tp108"
+
+configv3
+
+tp1()
+{
+ get_snmpv3_variable 3 system.sysDescr
+}
+tp2()
+{
+ get_snmpv3_variable 3 system.sysObjectID
+}
+tp3()
+{
+ get_snmpv3_variable 3 system.sysUpTime
+}
+tp4()
+{
+ get_snmpv3_variable 3 system.sysContact
+}
+tp5()
+{
+ get_snmpv3_variable 3 system.sysName
+}
+tp6()
+{
+ get_snmpv3_variable 3 system.sysLocation
+}
+tp7()
+{
+ get_snmpv3_variable 3 interfaces.ifNumber
+}
+tp8()
+{
+ get_snmpv3_table 3 interfaces.ifTable
+}
+tp9()
+{
+ get_snmpv3_table 3 at.atTable
+}
+tp10()
+{
+ get_snmpv3_variable 3 ip.ipInReceives
+}
+tp11()
+{
+ get_snmpv3_variable 3 ip.ipForwarding
+}
+tp12()
+{
+ get_snmpv3_variable 3 ip.ipDefaultTTL
+}
+tp13()
+{
+ get_snmpv3_variable 3 ip.ipInReceives
+}
+tp14()
+{
+ get_snmpv3_variable 3 ip.ipInHdrErrors
+}
+tp15()
+{
+ get_snmpv3_variable 3 ip.ipInAddrErrors
+}
+tp16()
+{
+ get_snmpv3_variable 3 ip.ipForwDatagrams
+}
+tp17()
+{
+ get_snmpv3_variable 3 ip.ipInUnknownProtos
+}
+tp18()
+{
+ get_snmpv3_variable 3 ip.ipInDiscards
+}
+tp19()
+{
+ get_snmpv3_variable 3 ip.ipInDelivers
+}
+tp20()
+{
+ get_snmpv3_variable 3 ip.ipOutRequests
+}
+tp21()
+{
+ get_snmpv3_variable 3 ip.ipOutDiscards
+}
+tp22()
+{
+ get_snmpv3_variable 3 ip.ipOutNoRoutes
+}
+tp23()
+{
+ get_snmpv3_variable 3 ip.ipReasmTimeout
+}
+tp24()
+{
+ get_snmpv3_variable 3 ip.ipReasmReqds
+}
+tp25()
+{
+ get_snmpv3_variable 3 ip.ipReasmOKs
+}
+tp26()
+{
+ get_snmpv3_variable 3 ip.ipReasmFails
+}
+tp27()
+{
+ get_snmpv3_variable 3 ip.ipFragOKs
+}
+tp28()
+{
+ get_snmpv3_variable 3 ip.ipFragFails
+}
+tp29()
+{
+ get_snmpv3_variable 3 ip.ipFragCreates
+}
+tp30()
+{
+ get_snmpv3_variable 3 ip.ipRoutingDiscards
+}
+tp31()
+{
+ get_snmpv3_table 3 ip.ipAddrTable
+}
+tp32()
+{
+ get_snmpv3_table 3 ip.ipRouteTable
+}
+tp33()
+{
+ get_snmpv3_table 3 ip.ipNetToMediaTable
+}
+tp34()
+{
+ get_snmpv3_variable 3 icmp.icmpInMsgs
+}
+tp35()
+{
+ get_snmpv3_variable 3 icmp.icmpInErrors
+}
+tp36()
+{
+ get_snmpv3_variable 3 icmp.icmpInDestUnreachs
+}
+tp37()
+{
+ get_snmpv3_variable 3 icmp.icmpInTimeExcds
+}
+tp38()
+{
+ get_snmpv3_variable 3 icmp.icmpInParmProbs
+}
+tp39()
+{
+ get_snmpv3_variable 3 icmp.icmpInSrcQuenchs
+}
+tp40()
+{
+ get_snmpv3_variable 3 icmp.icmpInRedirects
+}
+tp41()
+{
+ get_snmpv3_variable 3 icmp.icmpInEchos
+}
+tp42()
+{
+ get_snmpv3_variable 3 icmp.icmpInEchoReps
+}
+tp43()
+{
+ get_snmpv3_variable 3 icmp.icmpInTimestamps
+}
+tp44()
+{
+ get_snmpv3_variable 3 icmp.icmpInTimestampReps
+}
+tp45()
+{
+ get_snmpv3_variable 3 icmp.icmpInAddrMasks
+}
+tp46()
+{
+ get_snmpv3_variable 3 icmp.icmpInAddrMaskReps
+}
+tp47()
+{
+ get_snmpv3_variable 3 icmp.icmpOutMsgs
+}
+tp48()
+{
+ get_snmpv3_variable 3 icmp.icmpOutErrors
+}
+tp49()
+{
+ get_snmpv3_variable 3 icmp.icmpOutDestUnreachs
+}
+tp50()
+{
+ get_snmpv3_variable 3 icmp.icmpOutTimeExcds
+}
+tp51()
+{
+ get_snmpv3_variable 3 icmp.icmpOutParmProbs
+}
+tp52()
+{
+ get_snmpv3_variable 3 icmp.icmpOutSrcQuenchs
+}
+tp53()
+{
+ get_snmpv3_variable 3 icmp.icmpOutRedirects
+}
+tp54()
+{
+ get_snmpv3_variable 3 icmp.icmpOutEchos
+}
+tp55()
+{
+ get_snmpv3_variable 3 icmp.icmpOutEchoReps
+}
+tp56()
+{
+ get_snmpv3_variable 3 icmp.icmpOutTimestamps
+}
+tp57()
+{
+ get_snmpv3_variable 3 icmp.icmpOutTimestampReps
+}
+tp58()
+{
+ get_snmpv3_variable 3 icmp.icmpOutAddrMasks
+}
+tp59()
+{
+ get_snmpv3_variable 3 icmp.icmpOutAddrMaskReps
+}
+tp60()
+{
+ get_snmpv3_variable 3 tcp.tcpActiveOpens
+}
+tp61()
+{
+ get_snmpv3_variable 3 tcp.tcpRtoAlgorithm
+}
+tp62()
+{
+ get_snmpv3_variable 3 tcp.tcpRtoMin
+}
+tp63()
+{
+ get_snmpv3_variable 3 tcp.tcpRtoMax
+}
+tp64()
+{
+ get_snmpv3_variable 3 tcp.tcpMaxConn
+}
+tp65()
+{
+ get_snmpv3_variable 3 tcp.tcpActiveOpens
+}
+tp66()
+{
+ get_snmpv3_variable 3 tcp.tcpPassiveOpens
+}
+tp67()
+{
+ get_snmpv3_variable 3 tcp.tcpAttemptFails
+}
+tp68()
+{
+ get_snmpv3_variable 3 tcp.tcpEstabResets
+}
+tp69()
+{
+ get_snmpv3_variable 3 tcp.tcpCurrEstab
+}
+tp70()
+{
+ get_snmpv3_variable 3 tcp.tcpInSegs
+}
+tp71()
+{
+ get_snmpv3_variable 3 tcp.tcpOutSegs
+}
+tp72()
+{
+ get_snmpv3_variable 3 tcp.tcpRetransSegs
+}
+tp73()
+{
+ get_snmpv3_variable 3 tcp.tcpInErrs
+}
+tp74()
+{
+ get_snmpv3_variable 3 tcp.tcpOutRsts
+}
+tp75()
+{
+ get_snmpv3_table 3 tcp.tcpConnTable
+}
+tp76()
+{
+ get_snmpv3_variable 3 udp.udpInDatagrams
+}
+tp77()
+{
+ get_snmpv3_variable 3 udp.udpNoPorts
+}
+tp78()
+{
+ get_snmpv3_variable 3 udp.udpInErrors
+}
+tp79()
+{
+ get_snmpv3_variable 3 udp.udpOutDatagrams
+}
+tp80()
+{
+ get_snmpv3_table 3 udp.udpTable
+}
+tp81()
+{
+ get_snmpv3_variable 3 snmp.snmpInPkts
+}
+tp82()
+{
+ get_snmpv3_variable 3 snmp.snmpOutPkts
+}
+tp83()
+{
+ get_snmpv3_variable 3 snmp.snmpInBadVersions
+}
+tp84()
+{
+ get_snmpv3_variable 3 snmp.snmpInBadCommunityNames
+}
+tp85()
+{
+ get_snmpv3_variable 3 snmp.snmpInBadCommunityUses
+}
+tp86()
+{
+ get_snmpv3_variable 3 snmp.snmpInASNParseErrs
+}
+tp87()
+{
+ get_snmpv3_variable 3 snmp.snmpInTooBigs
+}
+tp88()
+{
+ get_snmpv3_variable 3 snmp.snmpInNoSuchNames
+}
+tp89()
+{
+ get_snmpv3_variable 3 snmp.snmpInBadValues
+}
+tp90()
+{
+ get_snmpv3_variable 3 snmp.snmpInReadOnlys
+}
+tp91()
+{
+ get_snmpv3_variable 3 snmp.snmpInGenErrs
+}
+tp92()
+{
+ get_snmpv3_variable 3 snmp.snmpInTotalReqVars
+}
+tp93()
+{
+ get_snmpv3_variable 3 snmp.snmpInTotalSetVars
+}
+tp94()
+{
+ get_snmpv3_variable 3 snmp.snmpInGetRequests
+}
+tp95()
+{
+ get_snmpv3_variable 3 snmp.snmpInGetNexts
+}
+tp96()
+{
+ get_snmpv3_variable 3 snmp.snmpInSetRequests
+}
+tp97()
+{
+ get_snmpv3_variable 3 snmp.snmpInGetResponses
+}
+tp98()
+{
+ get_snmpv3_variable 3 snmp.snmpInTraps
+}
+tp99()
+{
+ get_snmpv3_variable 3 snmp.snmpOutTooBigs
+}
+tp100()
+{
+ get_snmpv3_variable 3 snmp.snmpOutNoSuchNames
+}
+tp101()
+{
+ get_snmpv3_variable 3 snmp.snmpOutBadValues
+}
+tp102()
+{
+ get_snmpv3_variable 3 snmp.snmpOutGenErrs
+}
+tp103()
+{
+ get_snmpv3_variable 3 snmp.snmpOutGetRequests
+}
+tp104()
+{
+ get_snmpv3_variable 3 snmp.snmpOutGetNexts
+}
+tp105()
+{
+ get_snmpv3_variable 3 snmp.snmpOutSetRequests
+}
+tp106()
+{
+ get_snmpv3_variable 3 snmp.snmpOutGetResponses
+}
+tp107()
+{
+ get_snmpv3_variable 3 snmp.snmpOutTraps
+}
+tp108()
+{
+ get_snmpv3_variable 3 snmp.snmpEnableAuthenTraps
+}
+
+
diff --git a/win32/Configure b/win32/Configure
new file mode 100644
index 0000000..f3286bb
--- /dev/null
+++ b/win32/Configure
@@ -0,0 +1,427 @@
+#!/usr/bin/perl
+#
+# Configure script for Net-SNMP and MSVC
+# Written by Alex Burger
+# March 5th, 2004
+#
+use Getopt::Long;
+use strict;
+
+my $version = "unknown";
+my $config;
+my $sdk = 0;
+my $linktype;
+my $prefix;
+my $prefixdos;
+my $openssl = 0;
+my $b_ipv6 = 0;
+my $b_winextdll = 0;
+my $help = 0;
+
+GetOptions ('config=s' => \$config,
+ 'with-sdk' => \$sdk,
+ 'linktype=s' => \$linktype,
+ 'destdir=s' => \$prefix,
+ 'prefix=s' => \$prefix,
+ 'with-ssl' => \$openssl,
+ 'with-ipv6' => \$b_ipv6,
+ 'with-winextdll' => \$b_winextdll,
+ 'help' => \$help);
+
+if ($help == 1)
+{
+my $USAGE = qq/
+Usage:
+ perl Configure [<options>]
+
+Options:
+
+ --config=[release | debug] Compile as release or with debug symbols
+ --with-sdk Link against MS Platform SDK
+ --linktype=[static | dynamic] Build static or dynamic (DLL)
+ --prefix=\"path\" Set INSTALL_BASE path (install path)
+ --destdir=\"path\" Same as --prefix
+ --with-ssl Link against OpenSSL
+ --with-ipv6 Build in IPv6 transports (enables SDK)
+ --with-winextdll Build winExtDLL agent (enables SDK, see README.win32)
+ --help This help screen
+/;
+
+ print $USAGE;
+
+ exit(0);
+
+}
+
+$config = lc($config);
+if (($config ne "debug") && ($config ne "release")) {
+ $config = "release";
+}
+
+$linktype = lc($linktype);
+if (($linktype ne "static") && ($linktype ne "dynamic")) {
+ $linktype = "static";
+}
+
+if ($prefix eq "") {
+ $prefix = "c:/usr";
+}
+
+# Make sure prefix only contains forward slashes
+$prefix =~ s/\\/\//g;
+
+$prefixdos = "\"$prefix\"";
+# Make sure prefixdos only contains backward slashes
+$prefixdos =~ s/\//\\/g;
+
+# Enable SDK for IPV6 and winExtDLL
+if ($b_ipv6 == 1) {
+ $sdk = 1;
+}
+if ($b_winextdll == 1) {
+ $sdk = 1;
+}
+
+print "\n\n";
+
+###############################################
+#
+# Determine version from unix configure script
+#
+###############################################
+
+my $unix_configure_in = "../configure";
+
+open (UNIX_CONFIGURE_IN, "<$unix_configure_in") || die "Can't Open $unix_configure_in\n";
+
+while (<UNIX_CONFIGURE_IN>)
+{
+ chomp;
+ /PACKAGE_VERSION='(.*)'/;
+ if ($1 ne "") {
+ $version = $1;
+ last;
+ }
+}
+
+###############################################
+#
+# Create main Makefile
+#
+###############################################
+{
+ my $makefile_out = "Makefile";
+ my $makefile_in = "Makefile.in";
+
+ open (MAKE_OUT, ">$makefile_out") || die "Can't Open $makefile_out\n";
+ open (MAKE_IN, "<$makefile_in") || die "Can't Open $makefile_in\n";
+
+ print "creating $makefile_out\n";
+
+ while (<MAKE_IN>)
+ {
+ chomp;
+ if ($sdk == 1) {
+ s/^SDK=/SDK=true/;
+ }
+ else {
+ s/^SDK=/SDK=false/;
+ }
+
+ s/^LINKTYPE=/LINKTYPE=$linktype/;
+ s/^CFG=/CFG=$config/;
+ s/^PREFIX=/PREFIX=$prefix/;
+ s/^PREFIX_DOS=/PREFIX_DOS=$prefixdos/;
+ s/^SSL=.*/SSL=$openssl/;
+
+ print MAKE_OUT $_ . "\n";
+ }
+}
+
+###############################################
+#
+# Create Makefiles for applications from
+# Makefile-apps.in
+# (except for snmpnetstat)
+#
+###############################################
+my @programs = qw
+/encode_keychange
+snmpbulkget
+snmpbulkwalk
+snmpdelta
+snmpdf
+snmpget
+snmpgetnext
+snmpset
+snmpstatus
+snmptable
+snmptest
+snmptranslate
+snmptrap
+snmpusm
+snmpvacm
+snmpwalk
+/;
+
+foreach my $progName (@programs) {
+
+ my $makefile_out = "$progName\\Makefile";
+ my $makefile_in = "Makefile-apps.in";
+
+ my $outdir = $config;
+ my $intdir = $config;
+
+ open (MAKE_OUT, ">$makefile_out") || die "Can't Open $makefile_out\n";
+ open (MAKE_IN, "<$makefile_in") || die "Can't Open $makefile_in\n";
+
+ print "creating $makefile_out\n";
+
+ while (<MAKE_IN>)
+ {
+ chomp;
+
+ s/^LINKTYPE=/LINKTYPE=$linktype/;
+ s/^PROGNAME=/PROGNAME=$progName/;
+ s/^CFG=/CFG=$config/;
+ s/^OUTDIR=/OUTDIR=.\\$outdir/;
+ s/^INTDIR=/INTDIR=.\\$intdir/;
+ s/^SSL=.*/SSL=$openssl/;
+
+ print MAKE_OUT $_ . "\n";
+ }
+}
+
+###############################################
+#
+# Create Makefiles for snmpnetstat from
+# snmpnetstat\Makefile.in
+#
+###############################################
+my @programs = qw
+/snmpnetstat
+/;
+
+foreach my $progName (@programs) {
+
+ my $makefile_out = "$progName\\Makefile";
+ my $makefile_in = "$progName\\Makefile.in";
+
+ my $outdir = $config;
+ my $intdir = $config;
+
+ open (MAKE_OUT, ">$makefile_out") || die "Can't Open $makefile_out\n";
+ open (MAKE_IN, "<$makefile_in") || die "Can't Open $makefile_in\n";
+
+ print "creating $makefile_out\n";
+
+ while (<MAKE_IN>)
+ {
+ chomp;
+
+ s/^LINKTYPE=/LINKTYPE=$linktype/;
+ s/^PROGNAME=/PROGNAME=$progName/;
+ s/^CFG=/CFG=$config/;
+ s/^OUTDIR=/OUTDIR=.\\$outdir/;
+ s/^INTDIR=/INTDIR=.\\$intdir/;
+ s/^SSL=.*/SSL=$openssl/;
+
+ print MAKE_OUT $_ . "\n";
+ }
+}
+
+
+###############################################
+#
+# Create Makefiles for libraries
+# from name\Makefile.in
+#
+###############################################
+my @programs = qw
+/libagent
+libnetsnmptrapd
+netsnmpmibs
+/;
+
+if ($linktype eq "dynamic") {
+ push (@programs, "libsnmp_dll");
+}
+else {
+ push (@programs, "libsnmp");
+}
+
+foreach my $progName (@programs) {
+
+ my $makefile_out = "$progName\\Makefile";
+ my $makefile_in = "$progName\\Makefile.in";
+
+ my $outdir = $config;
+ my $intdir = $config;
+
+ open (MAKE_OUT, ">$makefile_out") || die "Can't Open $makefile_out\n";
+ open (MAKE_IN, "<$makefile_in") || die "Can't Open $makefile_in\n";
+
+ print "creating $makefile_out\n";
+
+ while (<MAKE_IN>)
+ {
+ chomp;
+
+ if ($sdk == 1) {
+ s/^SDK=/SDK=true/;
+ }
+ else {
+ s/^SDK=/SDK=false/;
+ }
+
+ s/^PROGNAME=/PROGNAME=$progName/;
+ s/^CFG=/CFG=$config/;
+ s/^OUTDIR=/OUTDIR=.\\$outdir/;
+ s/^INTDIR=/INTDIR=.\\$intdir/;
+ s/^SSL=.*/SSL=$openssl/;
+ print MAKE_OUT $_ . "\n";
+ }
+}
+
+###############################################
+#
+# Create Makefiles for daemons
+# from name\Makefile.in
+#
+###############################################
+my @programs = qw
+/snmpd
+snmptrapd
+/;
+
+foreach my $progName (@programs) {
+
+ my $makefile_out = "$progName\\Makefile";
+ my $makefile_in = "$progName\\Makefile.in";
+
+ my $outdir = $config;
+ my $intdir = $config;
+
+ open (MAKE_OUT, ">$makefile_out") || die "Can't Open $makefile_out\n";
+ open (MAKE_IN, "<$makefile_in") || die "Can't Open $makefile_in\n";
+
+ print "creating $makefile_out\n";
+
+ while (<MAKE_IN>)
+ {
+ chomp;
+
+ if ($sdk == 1) {
+ s/^SDK=/SDK=true/;
+ }
+ else {
+ s/^SDK=/SDK=false/;
+ }
+
+ s/^LINKTYPE=/LINKTYPE=$linktype/;
+ s/^PROGNAME=/PROGNAME=$progName/;
+ s/^CFG=/CFG=$config/;
+ s/^OUTDIR=/OUTDIR=.\\$outdir/;
+ s/^INTDIR=/INTDIR=.\\$intdir/;
+ s/^SSL=.*/SSL=$openssl/;
+
+ print MAKE_OUT $_ . "\n";
+ }
+}
+
+###############################################
+#
+# Create Makefile for Perl scripts in local
+# from local\Makefile.in
+#
+###############################################
+
+my $makefile_out = "local\\Makefile";
+my $makefile_in = "local\\Makefile.in";
+
+my $outdir = $config;
+
+open (MAKE_OUT, ">$makefile_out") || die "Can't Open $makefile_out\n";
+open (MAKE_IN, "<$makefile_in") || die "Can't Open $makefile_in\n";
+
+print "creating $makefile_out\n";
+
+while (<MAKE_IN>)
+{
+ chomp;
+
+ s/^OUTDIR=/OUTDIR=.\\$outdir/;
+ s/^PREFIX=/PREFIX=$prefix/;
+ s/^PREFIX_DOS=/PREFIX_DOS=$prefixdos/;
+
+ print MAKE_OUT $_ . "\n";
+}
+
+
+###############################################
+#
+# Create net-snmp-config.h
+#
+###############################################
+{
+ my $file_out = "net-snmp\\net-snmp-config.h";
+ my $file_in = "net-snmp\\net-snmp-config.h.in";
+
+ open (FILE_OUT, ">$file_out") || die "Can't Open $file_out\n";
+ open (FILE_IN, "<$file_in") || die "Can't Open $file_in\n";
+
+ print "creating $file_out\n";
+
+ while (<FILE_IN>)
+ {
+ chomp;
+ s/^#define PACKAGE_VERSION.*/#define PACKAGE_VERSION \"$version\"/;
+ if ($prefix ne "") {
+ s/^#define INSTALL_BASE.*/#define INSTALL_BASE \"$prefix\"/;
+ }
+ if ($linktype eq "dynamic") {
+ s/^.*#undef NETSNMP_USE_DLL.*/#define NETSNMP_USE_DLL 1/;
+ }
+ if ($sdk == 1) {
+ s/^.*#undef HAVE_WIN32_PLATFORM_SDK.*/#define HAVE_WIN32_PLATFORM_SDK 1/;
+ }
+ if ($openssl == 1) {
+ s/^.*#undef NETSNMP_USE_OPENSSL.*/#define NETSNMP_USE_OPENSSL 1/;
+ }
+ if ($b_ipv6 == 1) {
+ s/^.*#undef NETSNMP_ENABLE_IPV6.*/#define NETSNMP_ENABLE_IPV6 1/;
+ }
+ if ($b_winextdll == 1) {
+ s/^.*#undef USING_WINEXTDLL_MODULE.*/#define USING_WINEXTDLL_MODULE 1/;
+ }
+
+ print FILE_OUT $_ . "\n";
+ }
+}
+
+
+print qq/
+---------------------------------------------------------
+ Net-SNMP configuration summary:
+---------------------------------------------------------
+
+/;
+
+if ($version eq "unknown") {
+ $version = "unknown - Could not determine version from ../configure!";
+}
+
+print " Version: $version\n";
+print " Config type: $config\n";
+print " SDK: " . ($sdk == 1 ? "enabled" : "disabled") . "\n";
+print " Link type: $linktype\n";
+print " Prefix / Destdir: " . ($prefix ne "" ? $prefix : "(default)") . "\n";
+print " OpenSSL: " . ($openssl == 1 ? "enabled" : "disabled") . "\n";
+print " IPv6 transport: " . ($b_ipv6 == 1 ? "enabled" : "disabled") . "\n";
+print " winExtDLL agent: " . ($b_winextdll == 1 ? "enabled" : "disabled") . "\n";
+
+if ($ENV{INCLUDE} eq "") {
+ print "\n\nVisual Studio environment not detected. Please run VCVARS32.BAT before\n";
+ print "running nmake\n\n";
+}
+
diff --git a/win32/EXAMPLE.conf.win32 b/win32/EXAMPLE.conf.win32
new file mode 100644
index 0000000..6995d2e
--- /dev/null
+++ b/win32/EXAMPLE.conf.win32
@@ -0,0 +1,156 @@
+## Of the following Net-SNMP agent features
+## NONE are supported on Net-SNMP-5.1.1 Win32 platforms
+## Process checks "proc" config token
+## Executable scripts "exec" config token
+## Disk checks "disk" config token
+## Load average checks "load" config token
+## Extensible sections "exec" config token with shelltest
+## Pass-through control "pass" config token
+
+###############################################################################
+#
+# EXAMPLE.conf:
+# An example configuration file for configuring the ucd-snmp snmpd agent.
+#
+###############################################################################
+#
+# This file is intended to only be an example. If, however, you want
+# to use it, it should be placed in c:/usr-mingw/etc/share/snmp/snmpd.conf.
+# When the snmpd agent starts up, this is where it will look for it.
+#
+# You might be interested in generating your own snmpd.conf file using
+# the "snmpconf" program (perl script) instead. It's a nice menu
+# based interface to writing well commented configuration files. Try it!
+#
+# Note: This file is automatically generated from EXAMPLE.conf.def.
+# Do NOT read the EXAMPLE.conf.def file! Instead, after you have run
+# configure & make, and then make sure you read the EXAMPLE.conf file
+# instead, as it will tailor itself to your configuration.
+
+# All lines beginning with a '#' are comments and are intended for you
+# to read. All other lines are configuration commands for the agent.
+
+#
+# PLEASE: read the snmpd.conf(5) manual page as well!
+#
+
+
+###############################################################################
+# Access Control
+###############################################################################
+
+# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
+# KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
+# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.
+
+# By far, the most common question I get about the agent is "why won't
+# it work?", when really it should be "how do I configure the agent to
+# allow me to access it?"
+#
+# By default, the agent responds to the "public" community for read
+# only access, if run out of the box without any configuration file in
+# place. The following examples show you other ways of configuring
+# the agent so that you can change the community names, and give
+# yourself write access as well.
+#
+# The following lines change the access permissions of the agent so
+# that the COMMUNITY string provides read-only access to your entire
+# NETWORK (EG: 10.10.10.0/24), and read/write access to only the
+# localhost (127.0.0.1, not its real ipaddress).
+#
+# For more information, read the FAQ as well as the snmpd.conf(5)
+# manual page.
+
+####
+# First, map the community name (COMMUNITY) into a security name
+# (local and mynetwork, depending on where the request is coming
+# from):
+
+# sec.name source community
+com2sec local localhost COMMUNITY
+com2sec mynetwork NETWORK/24 COMMUNITY
+
+####
+# Second, map the security names into group names:
+
+# sec.model sec.name
+group MyRWGroup v1 local
+group MyRWGroup v2c local
+group MyRWGroup usm local
+group MyROGroup v1 mynetwork
+group MyROGroup v2c mynetwork
+group MyROGroup usm mynetwork
+
+####
+# Third, create a view for us to let the groups have rights to:
+
+# incl/excl subtree mask
+view all included .1 80
+
+####
+# Finally, grant the 2 groups access to the 1 view with different
+# write permissions:
+
+# context sec.model sec.level match read write notif
+access MyROGroup "" any noauth exact all none none
+access MyRWGroup "" any noauth exact all all none
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# System contact information
+#
+
+# It is also possible to set the sysContact and sysLocation system
+# variables through the snmpd.conf file. **PLEASE NOTE** that setting
+# the value of these objects here makes these objects READ-ONLY
+# (regardless of any access control settings). Any attempt to set the
+# value of an object whose value is given here will fail with an error
+# status of notWritable.
+
+syslocation Right here, right now.
+syscontact Me <me@somewhere.org>
+
+# Example output of snmpwalk:
+# % snmpwalk -v 1 -c public localhost system
+# system.sysDescr.0 = "Windows NT 2000 SP4"
+# system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.win32
+# system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
+# system.sysContact.0 = "Me <me@somewhere.org>"
+# system.sysName.0 = "name"
+# system.sysLocation.0 = "Right here, right now."
+# system.sysServices.0 = 72
+
+
+# -----------------------------------------------------------------------------
+
+###############################################################################
+# Subagent control
+#
+
+# The agent can support subagents using a number of extension mechanisms.
+# From the 4.2.1 release, AgentX support is being compiled in by default.
+# However, this is still experimental code, so should not be used on
+# critical production systems.
+# Please see the file README.agentx for more details.
+#
+# If having read, marked, learnt and inwardly digested this information,
+# you decide that you do wish to make use of this mechanism, simply
+# uncomment the following directive.
+#
+# master agentx
+#
+# I repeat - this is *NOT* regarded as suitable for front-line production
+# systems, though it is probably stable enough for day-to-day use.
+# Probably.
+#
+# No refunds will be given.
+
+
+###############################################################################
+# Further Information
+#
+# See the snmpd.conf manual page, and the output of "snmpd -H".
+# MUCH more can be done with the snmpd.conf than is shown as an
+# example here.
diff --git a/win32/Makefile-apps.in b/win32/Makefile-apps.in
new file mode 100644
index 0000000..2113ade
--- /dev/null
+++ b/win32/Makefile-apps.in
@@ -0,0 +1,217 @@
+PROGNAME=
+CFG=
+OUTDIR=
+INTDIR=
+LINKTYPE=
+SSL=
+
+# Set to 1 to allow the building using the DLL version of SNMPLIB.
+ALLOW_DLL=1
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+!IF "$(CFG)" == "release"
+
+ALL : "..\bin\$(OUTDIR)\$(PROGNAME).exe" "$(INTDIR)"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\$(PROGNAME).obj"
+ -@erase "$(INTDIR)\vc??.idb"
+ -@erase "$(INTDIR)\$(PROGNAME).pch"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest"
+
+"..\bin\$(OUTDIR)" :
+ if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+
+!IF "$(LINKTYPE)" == "dynamic"
+CPP_PROJ=$(CPP_PROJ) /D "NMAKE_NETSNMP_USE_DLL"
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\$(PROGNAME).bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=netsnmp.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:"../bin/$(OUTDIR)/$(PROGNAME).pdb" /debug /out:"..\bin\$(OUTDIR)/$(PROGNAME).exe" /libpath:"../lib/release"
+LINK32_OBJS= \
+ "$(INTDIR)\$(PROGNAME).obj"
+
+"..\bin\$(OUTDIR)\$(PROGNAME).exe" : "..\bin\$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+!IF "$(LINKTYPE)" == "static" || "$(ALLOW_DLL)" == "1"
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ if exist "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" \
+ mt.exe -manifest "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" -outputresource:"..\bin\$(OUTDIR)\$(PROGNAME).exe";1
+!ELSE # Linktype check
+ -@echo .
+ -@echo Aborting build. Applications can not be built using --linktype=dynamic
+ -@echo .
+!ENDIF
+
+!ELSEIF "$(CFG)" == "debug"
+
+ALL : "..\bin\$(OUTDIR)\$(PROGNAME).exe" "$(INTDIR)\$(PROGNAME).bsc" "$(INTDIR)"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\$(PROGNAME).obj"
+ -@erase "$(INTDIR)\$(PROGNAME).sbr"
+ -@erase "$(INTDIR)\vc??.idb"
+ -@erase "$(INTDIR)\vc??.pdb"
+ -@erase "$(INTDIR)\$(PROGNAME).bsc"
+ -@erase "$(INTDIR)\$(PROGNAME).pdb"
+ -@erase "$(INTDIR)\$(PROGNAME).pch"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest"
+
+"..\bin\$(OUTDIR)" :
+ if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+
+!IF "$(LINKTYPE)" == "dynamic"
+CPP_PROJ=$(CPP_PROJ) /D "NMAKE_NETSNMP_USE_DLL"
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\$(PROGNAME).bsc"
+BSC32_SBRS= \
+ "$(INTDIR)\$(PROGNAME).sbr"
+
+"$(INTDIR)\$(PROGNAME).bsc" : "..\bin\$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=netsnmp.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /pdb:"../bin/$(OUTDIR)/$(PROGNAME).pdb" /debug /out:"..\bin\$(OUTDIR)/$(PROGNAME).exe" /pdbtype:sept /libpath:"../lib/debug"
+LINK32_OBJS= \
+ "$(INTDIR)\$(PROGNAME).obj"
+
+"..\bin\$(OUTDIR)\$(PROGNAME).exe" : "..\bin\$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+!IF "$(LINKTYPE)" == "static" || "$(ALLOW_DLL)" == "1"
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ if exist "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" \
+ mt.exe -manifest "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" -outputresource:"..\bin\$(OUTDIR)\$(PROGNAME).exe";1
+!ELSE # Linktype check
+ -@echo .
+ -@echo Aborting build. Applications can not be built using --linktype=dynamic
+ -@echo .
+!ENDIF
+
+!ENDIF
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("$(PROGNAME).dep")
+!INCLUDE "$(PROGNAME).dep"
+!ELSE
+!MESSAGE Warning: cannot find "$(PROGNAME).dep"
+!ENDIF
+!ENDIF
+
+
+!IF "$(CFG)" == "release" || "$(CFG)" == "debug"
+SOURCE=..\..\apps\$(PROGNAME).c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\$(PROGNAME).obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\$(PROGNAME).obj" "$(INTDIR)\$(PROGNAME).sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+
+!ENDIF
+
+
diff --git a/win32/Makefile.in b/win32/Makefile.in
new file mode 100644
index 0000000..bba5464
--- /dev/null
+++ b/win32/Makefile.in
@@ -0,0 +1,503 @@
+SDK=
+LINKTYPE=
+CFG=
+PREFIX=
+PREFIX_DOS=
+PERL=
+NMAKE=nmake /nologo
+
+all : libs apps snmptrapd snmpd local
+
+clean : apps_clean libs_clean snmptrapd_clean snmpd_clean local_clean
+
+snmpd : snmpd_
+snmpd_clean : snmpd_clean_
+netsnmpmibs : netsnmpmibs_
+netsnmpmibs_clean : netsnmpmibs_clean_
+
+!IF "$(LINKTYPE)" == "static"
+libsnmp : libsnmp_
+libsnmp_clean : libsnmp_clean_
+!ELSE
+libsnmp : libsnmp_dll_
+libsnmp_clean : libsnmp_dll_clean_
+!ENDIF
+
+libs : libagent libsnmp libnetsnmptrapd netsnmpmibs
+libs_clean : libagent_clean libsnmp_clean libnetsnmptrapd_clean netsnmpmibs_clean
+
+apps : snmpdf snmpset snmpusm snmptest snmptrap snmpvacm snmpwalk snmpdelta snmptable snmpstatus snmpbulkget snmpget snmpgetnext snmpbulkwalk snmptranslate encode_keychange snmpnetstat
+
+apps_clean : snmpdf_clean snmpset_clean snmpusm_clean snmptest_clean snmptrap_clean snmpvacm_clean snmpwalk_clean snmpdelta_clean snmptable_clean snmpstatus_clean snmpbulkget_clean snmpget_clean snmpgetnext_clean snmpbulkwalk_clean snmptranslate_clean encode_keychange_clean snmpnetstat_clean
+
+local : snmpconf mib2c traptoemail
+
+local_clean : snmpconf_clean mib2c_clean traptoemail_clean
+
+perl :
+!IF "$(LINKTYPE)" == "static"
+ -@echo .
+ -@echo WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ -@echo ===============================================================
+ -@echo Building Perl modules using static SNMPLIB library.
+ -@echo .
+ -@echo Some modules will not function correctly with the static version
+ -@echo of the SNMPLIB library.
+ -@echo .
+ -@echo nmake perl_test will not complete due to a crash in the OID
+ -@echo module.
+ -@echo ===============================================================
+ -@echo .
+ -@echo .
+!ELSE # dynamic/static check
+ -@echo .
+ -@echo ===============================================================
+ -@echo Building Perl modules using dynamic (DLL) SNMPLIB library.
+ -@echo .
+ -@echo ===============================================================
+ -@echo .
+ -@echo .
+!ENDIF # dynamic/static check
+ cd ..\perl
+!IF "$(CFG)" == "release"
+ perl Makefile.PL CAPI=TRUE -NET-SNMP-IN-SOURCE=TRUE
+!ELSE # release/debug check
+ perl Makefile.PL CAPI=TRUE -NET-SNMP-IN-SOURCE=TRUE -NET-SNMP-DEBUG=TRUE
+!ENDIF # release/debug check
+ $(NMAKE)
+ cd ..\win32
+
+perl_test :
+!IF "$(LINKTYPE)" == "static" # Check in case test triggers build
+ -@echo .
+ -@echo Perl test aborted.
+ -@echo Perl modules must be build against dynamic (DLL) libraries
+ -@echo .
+!ELSE # dynamic/static check
+ cd ..\perl
+ $(NMAKE) test
+ cd ..\win32
+!ENDIF # dynamic/static check
+
+perl_install :
+!IF "$(LINKTYPE)" == "static" # Check in case install triggers build
+ -@echo .
+ -@echo Perl install aborted.
+ -@echo Perl modules must be build against dynamic (DLL) libraries
+ -@echo .
+!ELSE # dynamic/static check
+ cd ..\perl
+ $(NMAKE) install
+ cd ..\win32
+!ENDIF # dynamic/static check
+
+perl_clean :
+ cd ..\perl
+ $(NMAKE) clean
+ cd ..\win32
+
+
+##############
+#
+# Build
+#
+libagent ::
+ cd libagent
+ $(NMAKE) all
+ cd ..
+
+libsnmp_ ::
+ cd libsnmp
+ $(NMAKE) all
+ cd ..
+
+libsnmp_dll_ ::
+ cd libsnmp_dll
+ $(NMAKE) all
+ cd ..
+
+libnetsnmptrapd ::
+ cd libnetsnmptrapd
+ $(NMAKE) all
+ cd ..
+
+netsnmpmibs_ ::
+ cd netsnmpmibs
+ $(NMAKE) all
+ cd ..
+
+snmpdf ::
+ cd snmpdf
+ $(NMAKE) all
+ cd ..
+
+snmpset ::
+ cd snmpset
+ $(NMAKE) all
+ cd ..
+
+snmpusm ::
+ cd snmpusm
+ $(NMAKE) all
+ cd ..
+
+snmptest ::
+ cd snmptest
+ $(NMAKE) all
+ cd ..
+
+snmptrap ::
+ cd snmptrap
+ $(NMAKE) all
+ cd ..
+
+snmpvacm ::
+ cd snmpvacm
+ $(NMAKE) all
+ cd ..
+
+snmpwalk ::
+ cd snmpwalk
+ $(NMAKE) all
+ cd ..
+
+snmpdelta ::
+ cd snmpdelta
+ $(NMAKE) all
+ cd ..
+
+snmptable ::
+ cd snmptable
+ $(NMAKE) all
+ cd ..
+
+snmpstatus ::
+ cd snmpstatus
+ $(NMAKE) all
+ cd ..
+
+snmpbulkget ::
+ cd snmpbulkget
+ $(NMAKE) all
+ cd ..
+
+snmpget ::
+ cd snmpget
+ $(NMAKE) all
+ cd ..
+
+snmpgetnext ::
+ cd snmpgetnext
+ $(NMAKE) all
+ cd ..
+
+snmpbulkwalk ::
+ cd snmpbulkwalk
+ $(NMAKE) all
+ cd ..
+
+snmptranslate ::
+ cd snmptranslate
+ $(NMAKE) all
+ cd ..
+
+encode_keychange ::
+ cd encode_keychange
+ $(NMAKE) all
+ cd ..
+
+snmpnetstat ::
+ cd snmpnetstat
+ $(NMAKE) all
+ cd ..
+
+snmptrapd ::
+ cd snmptrapd
+ $(NMAKE) all
+ cd ..
+
+snmpd_ ::
+ cd snmpd
+ $(NMAKE) all
+ cd ..
+
+snmpconf ::
+ cd local
+ $(NMAKE) snmpconf
+ cd ..
+
+mib2c ::
+ cd local
+ $(NMAKE) mib2c
+ cd ..
+
+traptoemail ::
+ cd local
+ $(NMAKE) traptoemail
+ cd ..
+
+##############
+#
+# Clean
+#
+libagent_clean ::
+ cd libagent
+ $(NMAKE) clean
+ cd ..
+
+libsnmp_clean_ ::
+ cd libsnmp
+ $(NMAKE) clean
+ cd ..
+
+libsnmp_dll_clean_ ::
+ cd libsnmp_dll
+ $(NMAKE) clean
+ cd ..
+
+libnetsnmptrapd_clean ::
+ cd libnetsnmptrapd
+ $(NMAKE) clean
+ cd ..
+
+netsnmpmibs_clean_ ::
+ cd netsnmpmibs
+ $(NMAKE) clean
+ cd ..
+
+snmpdf_clean ::
+ cd snmpdf
+ $(NMAKE) clean
+ cd ..
+
+snmpset_clean ::
+ cd snmpset
+ $(NMAKE) clean
+ cd ..
+
+snmpusm_clean ::
+ cd snmpusm
+ $(NMAKE) clean
+ cd ..
+
+snmptest_clean ::
+ cd snmptest
+ $(NMAKE) clean
+ cd ..
+
+snmptrap_clean ::
+ cd snmptrap
+ $(NMAKE) clean
+ cd ..
+
+snmpvacm_clean ::
+ cd snmpvacm
+ $(NMAKE) clean
+ cd ..
+
+snmpwalk_clean ::
+ cd snmpwalk
+ $(NMAKE) clean
+ cd ..
+
+snmpdelta_clean ::
+ cd snmpdelta
+ $(NMAKE) clean
+ cd ..
+
+snmptable_clean ::
+ cd snmptable
+ $(NMAKE) clean
+ cd ..
+
+snmpstatus_clean ::
+ cd snmpstatus
+ $(NMAKE) clean
+ cd ..
+
+snmpbulkget_clean ::
+ cd snmpbulkget
+ $(NMAKE) clean
+ cd ..
+
+snmpget_clean ::
+ cd snmpget
+ $(NMAKE) clean
+ cd ..
+
+snmpgetnext_clean ::
+ cd snmpgetnext
+ $(NMAKE) clean
+ cd ..
+
+snmpbulkwalk_clean ::
+ cd snmpbulkwalk
+ $(NMAKE) clean
+ cd ..
+
+snmptranslate_clean ::
+ cd snmptranslate
+ $(NMAKE) clean
+ cd ..
+
+encode_keychange_clean ::
+ cd encode_keychange
+ $(NMAKE) clean
+ cd ..
+
+snmpnetstat_clean ::
+ cd snmpnetstat
+ $(NMAKE) clean
+ cd ..
+
+snmptrapd_clean ::
+ cd snmptrapd
+ $(NMAKE) clean
+ cd ..
+
+snmpd_clean_ ::
+ cd snmpd
+ $(NMAKE) clean
+ cd ..
+
+snmpconf_clean ::
+ cd local
+ $(NMAKE) snmpconf_clean
+ cd ..
+
+mib2c_clean ::
+ cd local
+ $(NMAKE) mib2c_clean
+ cd ..
+
+traptoemail_clean ::
+ cd local
+ $(NMAKE) traptoemail_clean
+ cd ..
+
+##############
+
+help ::
+ @-echo "NMAKE option Description"
+ @-echo "============ =============================================="
+ @-echo " "
+ @-echo "all libs apps snmptrapd snmpd "
+ @-echo "clean libs_clean apps_clean snmptrapd_clean "
+ @-echo " snmpd_clean "
+ @-echo "libs libagent libsnmp libnetsnmptrapd netsnmpmibs "
+ @-echo "libs_clean libagent_clean libnetsnmptrapd_clean "
+ @-echo " libsnmp_clean netsnmpmibs_clean "
+ @-echo " "
+ @-echo "apps encode_keychange snmpbulkget snmpbulkwalk "
+ @-echo " snmpdelta snmpdf snmpget snmpgetnext "
+ @-echo " snmpnetstsat snmpset snmpstatus snmptable "
+ @-echo " snmptest snmptranslate snmptrap snmpusm "
+ @-echo " snmpvacm snmpwalk "
+ @-echo " "
+ @-echo "apps_clean (clean all the apps) "
+ @-echo " "
+ @-echo "local snmpconf, mib2c, traptoemail "
+ @-echo "local_clean snmpconf_clean, mib2c_clean, traptoemail_clean"
+ @-echo " "
+ @-echo "snmptrapd Trap daemon "
+ @-echo "snmptrapd_clean Trap daemon clean "
+ @-echo " "
+ @-echo "snmpd Agent "
+ @-echo "snmpd_clean Agent clean "
+ @-echo " "
+ @-echo "install Install Net-SNMP without Perl "
+ @-echo " "
+ @-echo "install_devel Install Development files "
+ @-echo " "
+ @-echo "perl Configure (in source) and then nmake "
+ @-echo "perl_clean Perl clean "
+ @-echo "perl_test Perl tests "
+ @-echo "perl_install Perl installs "
+
+
+install ::
+ cd ..
+ @-echo Creating $(PREFIX_DOS) sub-directories
+ @-mkdir $(PREFIX_DOS) > NUL:
+ @-mkdir $(PREFIX_DOS)\bin > NUL:
+ @-mkdir $(PREFIX_DOS)\etc > NUL:
+ @-mkdir $(PREFIX_DOS)\etc\snmp > NUL:
+ @-mkdir $(PREFIX_DOS)\share > NUL:
+ @-mkdir $(PREFIX_DOS)\share\snmp > NUL:
+ @-mkdir $(PREFIX_DOS)\share\snmp\mibs > NUL:
+ @-mkdir $(PREFIX_DOS)\share\snmp\snmpconf-data > NUL:
+ @-mkdir $(PREFIX_DOS)\share\snmp\snmpconf-data\snmp-data > NUL:
+ @-mkdir $(PREFIX_DOS)\share\snmp\snmpconf-data\snmpd-data > NUL:
+ @-mkdir $(PREFIX_DOS)\share\snmp\snmpconf-data\snmptrapd-data > NUL:
+ @-mkdir $(PREFIX_DOS)\share\snmp\mib2c-data > NUL:
+ @-mkdir $(PREFIX_DOS)\snmp > NUL:
+ @-mkdir $(PREFIX_DOS)\snmp\persist > NUL:
+ @-mkdir $(PREFIX_DOS)\temp > NUL:
+ @-mkdir $(PREFIX_DOS)\include > NUL:
+ @-mkdir $(PREFIX_DOS)\include\net-snmp > NUL:
+ @-mkdir $(PREFIX_DOS)\include\net-snmp\agent > NUL:
+
+ @-echo Copying MIB files to $(PREFIX_DOS)\share\snmp\mibs
+ @-Copy mibs\*.txt $(PREFIX_DOS)\share\snmp\mibs > NUL:
+
+ @-echo Copying compiled programs to $(PREFIX_DOS)\bin
+ @-Copy win32\bin\$(CFG)\*.exe $(PREFIX_DOS)\bin > NUL:
+
+ @-echo Copying (local) scripts to $(PREFIX_DOS)\bin
+ @-Copy win32\bin\$(CFG)\snmpconf $(PREFIX_DOS)\bin > NUL:
+ @-Copy win32\local\snmpconf.bat $(PREFIX_DOS)\bin > NUL:
+ @-Copy win32\bin\$(CFG)\mib2c $(PREFIX_DOS)\bin > NUL:
+ @-Copy win32\local\mib2c.bat $(PREFIX_DOS)\bin > NUL:
+ @-Copy win32\bin\$(CFG)\traptoemail $(PREFIX_DOS)\bin > NUL:
+ @-Copy win32\local\traptoemail.bat $(PREFIX_DOS)\bin > NUL:
+
+ @-echo Copying snmpconf files to $(PREFIX_DOS)\share\snmp\snmpconf-data\snmp-data
+ @-Copy local\snmpconf.dir\snmp-data\*.* $(PREFIX_DOS)\share\snmp\snmpconf-data\snmp-data > NUL:
+ @-Copy local\snmpconf.dir\snmpd-data\*.* $(PREFIX_DOS)\share\snmp\snmpconf-data\snmpd-data > NUL:
+ @-Copy local\snmpconf.dir\snmptrapd-data\*.* $(PREFIX_DOS)\share\snmp\snmpconf-data\snmptrapd-data > NUL:
+
+ @-echo Copying mib2c config files to $(PREFIX_DOS)\share\snmp
+ @-Copy local\mib2c*.conf $(PREFIX_DOS)\share\snmp > NUL:
+ @-Copy local\mib2c-conf.d\*.* $(PREFIX_DOS)\share\snmp\mib2c-data > NUL:
+
+ @-echo Copying header files to $(PREFIX_DOS)\include
+ @-copy win32\net-snmp\*.h $(PREFIX_DOS)\include\net-snmp > NUL:
+ @-copy win32\net-snmp\agent\*.h $(PREFIX_DOS)\include\net-snmp\agent > NUL:
+
+ @-echo Copying DLL files to $(PREFIX_DOS)
+ @-Copy win32\bin\$(CFG)\*.dll $(PREFIX_DOS)\bin > NUL:
+
+ @-echo Copying DLL files to %SYSTEMROOT%\System32
+ @-Copy win32\bin\$(CFG)\*.dll %SYSTEMROOT%\System32 > NUL:
+
+ @-echo Done copying files to $(PREFIX_DOS)
+ cd win32
+
+
+install_devel ::
+ cd ..
+ @-echo Creating $(PREFIX_DOS) sub-directories
+ @-mkdir $(PREFIX_DOS) > NUL:
+ @-mkdir $(PREFIX_DOS)\lib > NUL:
+ @-mkdir $(PREFIX_DOS)\include > NUL:
+ @-mkdir $(PREFIX_DOS)\include\net-snmp > NUL:
+
+ @-echo Copying PDB files to $(PREFIX_DOS)\bin
+ @-Copy win32\bin\$(CFG)\*.pdb $(PREFIX_DOS)\bin > NUL:
+
+ @-echo Copying library files to $(PREFIX_DOS)\lib
+ @-copy win32\lib\$(CFG)\*.lib $(PREFIX_DOS)\lib > NUL:
+
+ @-echo Copying header files to $(PREFIX_DOS)\include
+ @-xcopy include\net-snmp\*.h $(PREFIX_DOS)\include\net-snmp /s /y > NUL:
+ @-copy win32\net-snmp\*.h $(PREFIX_DOS)\include\net-snmp > NUL:
+ @-copy win32\net-snmp\agent\*.h $(PREFIX_DOS)\include\net-snmp\agent > NUL:
+ @-copy win32\net-snmp\library\*.h $(PREFIX_DOS)\include\net-snmp\library > NUL:
+
+ @-echo Done copying files to $(PREFIX_DOS)
+
+ @-echo Copying PDB files to %SYSTEMROOT%\System32
+ @-Copy win32\bin\$(CFG)\*.pdb %SYSTEMROOT%\System32 > NUL:
+
+ cd win32
+
diff --git a/win32/MgmtApi-winExtDLL.h b/win32/MgmtApi-winExtDLL.h
new file mode 100644
index 0000000..9905a9c
--- /dev/null
+++ b/win32/MgmtApi-winExtDLL.h
@@ -0,0 +1,77 @@
+/*
+ * This file is a copy of the header file <snmp.h> from the MinGW project.
+ * The licensing for the Win32 API is defined in the
+ * MinGW file README.w32api, which states:
+
+ "Unless otherwise stated in individual source files,
+
+ THIS SOFTWARE IS NOT COPYRIGHTED
+
+ This source code is offered for use in the public domain. You may use,
+ modify or distribute it freely.
+
+ This source code is distributed in the hope that it will be useful but
+ WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ DISCLAIMED. This includes but is not limited to warranties of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+ */
+
+/*
+ mgmtapi.h - Header file for the SNMP Management API
+
+ Written by Filip Navara <xnavara@volny.cz>
+
+ References (2003-08-25):
+ http://msdn.microsoft.com/library/en-us/snmp/snmp/snmp_reference.asp
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+#ifndef _MGMTAPI_H
+#define _MGMTAPI_H
+#if __GNUC__ >= 3
+#pragma GCC system_header
+#endif
+
+#ifndef _SNMP_H
+#include <snmp.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SNMP_MGMTAPI_TIMEOUT 40
+#define SNMP_MGMTAPI_SELECT_FDERRORS 41
+#define SNMP_MGMTAPI_TRAP_ERRORS 42
+#define SNMP_MGMTAPI_TRAP_DUPINIT 43
+#define SNMP_MGMTAPI_NOTRAPS 44
+#define SNMP_MGMTAPI_AGAIN 45
+#define SNMP_MGMTAPI_INVALID_CTL 46
+#define SNMP_MGMTAPI_INVALID_SESSION 47
+#define SNMP_MGMTAPI_INVALID_BUFFER 48
+#define MGMCTL_SETAGENTPORT 1
+
+#ifndef RC_INVOKED
+
+typedef PVOID LPSNMP_MGR_SESSION;
+
+BOOL WINSNMPAPI SnmpMgrClose(LPSNMP_MGR_SESSION);
+BOOL WINSNMPAPI SnmpMgrCtl(LPSNMP_MGR_SESSION,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD);
+BOOL WINSNMPAPI SnmpMgrGetTrap(AsnObjectIdentifier*,AsnNetworkAddress*,AsnInteger*,AsnInteger*,AsnTimeticks*,SnmpVarBindList*);
+BOOL WINSNMPAPI SnmpMgrGetTrapEx(AsnObjectIdentifier*,AsnNetworkAddress*,AsnNetworkAddress*,AsnInteger*,AsnInteger*,AsnOctetString*,AsnTimeticks*,SnmpVarBindList*);
+BOOL WINSNMPAPI SnmpMgrOidToStr(AsnObjectIdentifier*,LPSTR*);
+LPSNMP_MGR_SESSION WINSNMPAPI SnmpMgrOpen(LPSTR,LPSTR,INT,INT);
+INT WINSNMPAPI SnmpMgrRequest(LPSNMP_MGR_SESSION,BYTE,SnmpVarBindList*,AsnInteger*,AsnInteger*);
+BOOL WINSNMPAPI SnmpMgrStrToOid(LPSTR,AsnObjectIdentifier*);
+BOOL WINSNMPAPI SnmpMgrTrapListen(HANDLE*);
+
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/win32/Snmp-winExtDLL.h b/win32/Snmp-winExtDLL.h
new file mode 100644
index 0000000..10f1990
--- /dev/null
+++ b/win32/Snmp-winExtDLL.h
@@ -0,0 +1,278 @@
+/*
+ * This file is a copy of the header file <snmp.h> from the MinGW project.
+ * The licensing for the Win32 API is defined in the
+ * MinGW file README.w32api, which states:
+
+ "Unless otherwise stated in individual source files,
+
+ THIS SOFTWARE IS NOT COPYRIGHTED
+
+ This source code is offered for use in the public domain. You may use,
+ modify or distribute it freely.
+
+ This source code is distributed in the hope that it will be useful but
+ WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ DISCLAIMED. This includes but is not limited to warranties of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+ */
+
+/*
+ snmp.h - Header file for the Windows SNMP API
+
+ Written by Filip Navara <xnavara@volny.cz>
+
+ References (2003-08-25):
+ http://msdn.microsoft.com/library/en-us/snmp/snmp/snmp_reference.asp
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+#ifndef _SNMP_H
+#define _SNMP_H
+#if __GNUC__ >= 3
+#pragma GCC system_header
+#endif
+
+#ifndef _WINDOWS_H
+#include <windows.h>
+#endif
+
+#include <pshpack4.h>
+
+#ifndef WINSNMPAPI
+#define WINSNMPAPI WINAPI
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define DEFAULT_SNMP_PORT_UDP 161
+#define DEFAULT_SNMP_PORT_IPX 36879
+#define DEFAULT_SNMPTRAP_PORT_UDP 162
+#define DEFAULT_SNMPTRAP_PORT_IPX 36880
+#ifndef _SNMP_ASN_DEFINED
+#define _SNMP_ASN_DEFINED
+#define MS_ASN_UNIVERSAL 0x00
+#define MS_ASN_PRIMITIVE 0x00
+#define MS_ASN_CONSTRUCTOR 0x20
+#define MS_ASN_APPLICATION 0x40
+#define MS_ASN_CONTEXT 0x80
+#define MS_ASN_PRIVATE 0xC0
+#define SNMP_PDU_GET (ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 0)
+#define SNMP_PDU_GETNEXT (ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 1)
+#define SNMP_PDU_RESPONSE (ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 2)
+#define SNMP_PDU_SET (ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 3)
+#define SNMP_PDU_GETBULK (ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 4)
+#define SNMP_PDU_V1TRAP (ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 4)
+#define SNMP_PDU_INFORM (ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 6)
+#define SNMP_PDU_TRAP (ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 7)
+#define SNMP_PDU_REPORT (ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 8)
+#endif /* _SNMP_ASN_DEFINED */
+#define MS_ASN_INTEGER (ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 2)
+#define MS_ASN_BITS (ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 3)
+#define MS_ASN_OCTETSTRING (ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 4)
+#define MS_ASN_NULL (ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 5)
+#define MS_ASN_OBJECTIDENTIFIER (ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 6)
+#define MS_ASN_INTEGER32 ASN_INTEGER
+#define MS_ASN_SEQUENCE (ASN_UNIVERSAL | MS_ASN_CONSTRUCTOR | 0x10)
+#define MS_ASN_SEQUENCEOF ASN_SEQUENCE
+#define MS_ASN_IPADDRESS (ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x00)
+#define MS_ASN_COUNTER32 (ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x01)
+#define MS_ASN_GAUGE32 (ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x02)
+#define MS_ASN_TIMETICKS (ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x03)
+#define MS_ASN_OPAQUE (ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x04)
+#define MS_ASN_COUNTER64 (ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x06)
+#define MS_ASN_UNSIGNED32 (ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x07)
+#define SNMP_EXCEPTION_NOSUCHOBJECT (ASN_CONTEXT | MS_ASN_PRIMITIVE | 0x00)
+#define SNMP_EXCEPTION_NOSUCHINSTANCE (ASN_CONTEXT | MS_ASN_PRIMITIVE | 0x01)
+#define SNMP_EXCEPTION_ENDOFMIBVIEW (ASN_CONTEXT | MS_ASN_PRIMITIVE | 0x02)
+#define SNMP_EXTENSION_GET SNMP_PDU_GET
+#define SNMP_EXTENSION_GET_NEXT SNMP_PDU_GETNEXT
+#define SNMP_EXTENSION_GET_BULK SNMP_PDU_GETBULK
+#define SNMP_EXTENSION_SET_TEST (ASN_PRIVATE | MS_ASN_CONSTRUCTOR | 0x0)
+#define SNMP_EXTENSION_SET_COMMIT SNMP_PDU_SET
+#define SNMP_EXTENSION_SET_UNDO (ASN_PRIVATE | MS_ASN_CONSTRUCTOR | 0x1)
+#define SNMP_EXTENSION_SET_CLEANUP (ASN_PRIVATE | MS_ASN_CONSTRUCTOR | 0x2)
+#define SNMP_ERRORSTATUS_NOERROR 0
+#define SNMP_ERRORSTATUS_TOOBIG 1
+#define SNMP_ERRORSTATUS_NOSUCHNAME 2
+#define SNMP_ERRORSTATUS_BADVALUE 3
+#define SNMP_ERRORSTATUS_READONLY 4
+#define SNMP_ERRORSTATUS_GENERR 5
+#define SNMP_ERRORSTATUS_NOACCESS 6
+#define SNMP_ERRORSTATUS_WRONGTYPE 7
+#define SNMP_ERRORSTATUS_WRONGLENGTH 8
+#define SNMP_ERRORSTATUS_WRONGENCODING 9
+#define SNMP_ERRORSTATUS_WRONGVALUE 10
+#define SNMP_ERRORSTATUS_NOCREATION 11
+#define SNMP_ERRORSTATUS_INCONSISTENTVALUE 12
+#define SNMP_ERRORSTATUS_RESOURCEUNAVAILABLE 13
+#define SNMP_ERRORSTATUS_COMMITFAILED 14
+#define SNMP_ERRORSTATUS_UNDOFAILED 15
+#define SNMP_ERRORSTATUS_AUTHORIZATIONERROR 16
+#define SNMP_ERRORSTATUS_NOTWRITABLE 17
+#define SNMP_ERRORSTATUS_INCONSISTENTNAME 18
+#define SNMP_GENERICTRAP_COLDSTART 0
+#define SNMP_GENERICTRAP_WARMSTART 1
+#define SNMP_GENERICTRAP_LINKDOWN 2
+#define SNMP_GENERICTRAP_LINKUP 3
+#define SNMP_GENERICTRAP_AUTHFAILURE 4
+#define SNMP_GENERICTRAP_EGPNEIGHLOSS 5
+#define SNMP_GENERICTRAP_ENTERSPECIFIC 6
+#define SNMP_ACCESS_NONE 0
+#define SNMP_ACCESS_NOTIFY 1
+#define SNMP_ACCESS_READ_ONLY 2
+#define SNMP_ACCESS_READ_WRITE 3
+#define SNMP_ACCESS_READ_CREATE 4
+#define SNMPAPI_ERROR FALSE
+#define SNMPAPI_NOERROR TRUE
+#define SNMP_LOG_SILENT 0
+#define SNMP_LOG_FATAL 1
+#define SNMP_LOG_ERROR 2
+#define SNMP_LOG_WARNING 3
+#define SNMP_LOG_TRACE 4
+#define SNMP_LOG_VERBOSE 5
+#define SNMP_OUTPUT_TO_CONSOLE 1
+#define SNMP_OUTPUT_TO_LOGFILE 2
+#define SNMP_OUTPUT_TO_EVENTLOG 4
+#define SNMP_OUTPUT_TO_DEBUGGER 8
+#define SNMP_MAX_OID_LEN 128
+#define SNMP_MEM_ALLOC_ERROR 1
+#define SNMP_BERAPI_INVALID_LENGTH 10
+#define SNMP_BERAPI_INVALID_TAG 11
+#define SNMP_BERAPI_OVERFLOW 12
+#define SNMP_BERAPI_SHORT_BUFFER 13
+#define SNMP_BERAPI_INVALID_OBJELEM 14
+#define SNMP_PDUAPI_UNRECOGNIZED_PDU 20
+#define SNMP_PDUAPI_INVALID_ES 21
+#define SNMP_PDUAPI_INVALID_GT 22
+#define SNMP_AUTHAPI_INVALID_VERSION 30
+#define SNMP_AUTHAPI_INVALID_MSG_TYPE 31
+#define SNMP_AUTHAPI_TRIV_AUTH_FAILED 32
+
+#ifndef RC_INVOKED
+
+typedef INT SNMPAPI;
+typedef LONG AsnInteger32;
+typedef ULONG AsnUnsigned32;
+typedef ULARGE_INTEGER AsnCounter64;
+typedef AsnUnsigned32 AsnCounter32;
+typedef AsnUnsigned32 AsnGauge32;
+typedef AsnUnsigned32 AsnTimeticks;
+typedef struct {
+ BYTE *stream;
+ UINT length;
+ BOOL dynamic;
+} AsnOctetString, AsnBits, AsnSequence, AsnImplicitSequence, AsnIPAddress, AsnNetworkAddress, AsnDisplayString, AsnOpaque;
+typedef struct {
+ UINT idLength;
+ UINT *ids;
+} AsnObjectIdentifier, AsnObjectName;
+typedef struct {
+ BYTE asnType;
+ union {
+ AsnInteger32 number;
+ AsnUnsigned32 unsigned32;
+ AsnCounter64 counter64;
+ AsnOctetString string;
+ AsnBits bits;
+ AsnObjectIdentifier object;
+ AsnSequence sequence;
+ AsnIPAddress address;
+ AsnCounter32 counter;
+ AsnGauge32 gauge;
+ AsnTimeticks ticks;
+ AsnOpaque arbitrary;
+ } asnValue;
+} AsnAny, AsnObjectSyntax;
+typedef struct {
+ AsnObjectName name;
+ AsnObjectSyntax value;
+} SnmpVarBind;
+typedef struct {
+ SnmpVarBind *list;
+ UINT len;
+} SnmpVarBindList;
+
+VOID WINSNMPAPI SnmpExtensionClose(void);
+BOOL WINSNMPAPI SnmpExtensionInit(DWORD,HANDLE*,AsnObjectIdentifier*);
+BOOL WINSNMPAPI SnmpExtensionInitEx(AsnObjectIdentifier*);
+BOOL WINSNMPAPI SnmpExtensionMonitor(LPVOID);
+BOOL WINSNMPAPI SnmpExtensionQuery(BYTE,SnmpVarBindList*,AsnInteger32*,AsnInteger32*);
+BOOL WINSNMPAPI SnmpExtensionQueryEx(DWORD,DWORD,SnmpVarBindList*,AsnOctetString*,AsnInteger32*,AsnInteger32*);
+BOOL WINSNMPAPI SnmpExtensionTrap(AsnObjectIdentifier*,AsnInteger32*,AsnInteger32*,AsnTimeticks*,SnmpVarBindList*);
+DWORD WINSNMPAPI SnmpSvcGetUptime(void);
+VOID WINSNMPAPI SnmpSvcSetLogLevel(INT);
+VOID WINSNMPAPI SnmpSvcSetLogType(INT);
+SNMPAPI WINSNMPAPI SnmpUtilAsnAnyCpy(AsnAny*,AsnAny*);
+VOID WINSNMPAPI SnmpUtilAsnAnyFree(AsnAny*);
+VOID WINSNMPAPI SnmpUtilDbgPrint(INT,LPSTR,...);
+LPSTR WINSNMPAPI SnmpUtilIdsToA(UINT*,UINT);
+LPVOID WINSNMPAPI SnmpUtilMemAlloc(UINT);
+VOID WINSNMPAPI SnmpUtilMemFree(LPVOID);
+LPVOID WINSNMPAPI SnmpUtilMemReAlloc(LPVOID,UINT);
+SNMPAPI WINSNMPAPI SnmpUtilOctetsCmp(AsnOctetString*,AsnOctetString*);
+SNMPAPI WINSNMPAPI SnmpUtilOctetsCpy(AsnOctetString*,AsnOctetString*);
+VOID WINSNMPAPI SnmpUtilOctetsFree(AsnOctetString*);
+SNMPAPI WINSNMPAPI SnmpUtilOctetsNCmp(AsnOctetString*,AsnOctetString*,UINT);
+SNMPAPI WINSNMPAPI SnmpUtilOidAppend(AsnObjectIdentifier*,AsnObjectIdentifier*);
+SNMPAPI WINSNMPAPI SnmpUtilOidCmp(AsnObjectIdentifier*,AsnObjectIdentifier*);
+SNMPAPI WINSNMPAPI SnmpUtilOidCpy(AsnObjectIdentifier*,AsnObjectIdentifier*);
+VOID WINSNMPAPI SnmpUtilOidFree(AsnObjectIdentifier*);
+SNMPAPI WINSNMPAPI SnmpUtilOidNCmp(AsnObjectIdentifier*,AsnObjectIdentifier*,UINT);
+LPSTR WINSNMPAPI SnmpUtilOidToA(AsnObjectIdentifier*);
+VOID WINSNMPAPI SnmpUtilPrintAsnAny(AsnAny*);
+VOID WINSNMPAPI SnmpUtilPrintOid(AsnObjectIdentifier*);
+SNMPAPI WINSNMPAPI SnmpUtilVarBindCpy( SnmpVarBind*,SnmpVarBind*);
+SNMPAPI WINSNMPAPI SnmpUtilVarBindListCpy(SnmpVarBindList*,SnmpVarBindList*);
+VOID WINSNMPAPI SnmpUtilVarBindFree(SnmpVarBind*);
+VOID WINSNMPAPI SnmpUtilVarBindListFree(SnmpVarBindList*);
+
+#ifndef SNMPSTRICT
+#define SNMP_malloc SnmpUtilMemAlloc
+#define SNMP_free SnmpUtilMemFree
+#define SNMP_realloc SnmpUtilMemReAlloc
+#define SNMP_DBG_malloc SnmpUtilMemAlloc
+#define SNMP_DBG_free SnmpUtilMemFree
+#define SNMP_DBG_realloc SnmpUtilMemReAlloc
+#define SNMP_oidappend SnmpUtilOidAppend
+#define SNMP_oidcmp SnmpUtilOidCmp
+#define SNMP_oidcpy SnmpUtilOidCpy
+#define SNMP_oidfree SnmpUtilOidFree
+#define SNMP_oidncmp SnmpUtilOidNCmp
+#define SNMP_printany SnmpUtilPrintAsnAny
+#define SNMP_CopyVarBind SnmpUtilVarBindCpy
+#define SNMP_CopyVarBindList SnmpUtilVarBindListCpy
+#define SNMP_FreeVarBind SnmpUtilVarBindFree
+#define SNMP_FreeVarBindList SnmpUtilVarBindListFree
+#define MS_ASN_RFC1155_IPADDRESS MS_ASN_IPADDRESS
+#define MS_ASN_RFC1155_COUNTER MS_ASN_COUNTER32
+#define MS_ASN_RFC1155_GAUGE MS_ASN_GAUGE32
+#define MS_ASN_RFC1155_TIMETICKS MS_ASN_TIMETICKS
+#define MS_ASN_RFC1155_OPAQUE MS_ASN_OPAQUE
+#define MS_ASN_RFC1213_DISPSTRING MS_ASN_OCTETSTRING
+#define MS_ASN_RFC1157_GETREQUEST SNMP_PDU_GET
+#define MS_ASN_RFC1157_GETNEXTREQUEST SNMP_PDU_GETNEXT
+#define MS_ASN_RFC1157_GETRESPONSE SNMP_PDU_RESPONSE
+#define MS_ASN_RFC1157_SETREQUEST SNMP_PDU_SET
+#define MS_ASN_RFC1157_TRAP SNMP_PDU_V1TRAP
+#define MS_ASN_CONTEXTSPECIFIC MS_ASN_CONTEXT
+#define MS_ASN_PRIMATIVE MS_ASN_PRIMITIVE
+#define RFC1157VarBindList SnmpVarBindList
+#define RFC1157VarBind SnmpVarBind
+#define AsnInteger AsnInteger32
+#define AsnCounter AsnCounter32
+#define AsnGauge AsnGauge32
+#endif /* SNMPSTRICT */
+
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+}
+#endif
+#include <poppack.h>
+#endif
diff --git a/win32/agent_module_dot_conf.h b/win32/agent_module_dot_conf.h
new file mode 100644
index 0000000..8ead61b
--- /dev/null
+++ b/win32/agent_module_dot_conf.h
@@ -0,0 +1 @@
+/* This file is automatically generated by configure. Do not modify by hand. */
diff --git a/win32/agent_module_includes.h b/win32/agent_module_includes.h
new file mode 100644
index 0000000..3974449
--- /dev/null
+++ b/win32/agent_module_includes.h
@@ -0,0 +1,10 @@
+/* This file is automatically generated by configure. Do not modify by hand. */
+#include "mibgroup/snmpv3/usmConf.h"
+#include "mibgroup/agentx/master.h"
+#include "mibgroup/agentx/subagent.h"
+#include "mibgroup/mibII/vacm_conf.h"
+#include "mibgroup/utilities/execute.h"
+#include "mibgroup/agentx/protocol.h"
+#include "mibgroup/agentx/client.h"
+#include "mibgroup/agentx/master_admin.h"
+#include "mibgroup/agentx/agentx_config.h"
diff --git a/win32/agent_module_inits.h b/win32/agent_module_inits.h
new file mode 100644
index 0000000..f5f0536
--- /dev/null
+++ b/win32/agent_module_inits.h
@@ -0,0 +1,5 @@
+/* This file is automatically generated by configure. Do not modify by hand. */
+ if (should_init("usmConf")) init_usmConf();
+ if (should_init("iquery")) init_iquery();
+ if (should_init("vacm_conf")) init_vacm_conf();
+
diff --git a/win32/build.bat b/win32/build.bat
new file mode 100755
index 0000000..96935b3
--- /dev/null
+++ b/win32/build.bat
@@ -0,0 +1,5 @@
+@echo off
+
+cd win32 > NUL: 2>&1
+perl build.pl
+
diff --git a/win32/build.pl b/win32/build.pl
new file mode 100644
index 0000000..196b779
--- /dev/null
+++ b/win32/build.pl
@@ -0,0 +1,338 @@
+#!/usr/bin/perl
+#
+# Build script for Net-SNMP and MSVC
+# Written by Alex Burger - alex_b@users.sourceforge.net
+# March 12th, 2004
+#
+use strict;
+my $openssl = "disabled";
+my $b_ipv6 = "disabled";
+my $b_winextdll = "disabled";
+my $sdk = "disabled";
+my $default_install_base = "c:/usr";
+my $install_base = $default_install_base;
+my $install = "enabled";
+my $install_devel = "disabled";
+my $perl = "disabled";
+my $perl_install = "disabled";
+my $logging = "enabled";
+my $debug = "disabled";
+my $configOpts = "";
+my $cTmp = "";
+my $linktype = "static";
+my $option;
+
+# Prepend win32\ if running from main directory
+my $current_pwd = `%COMSPEC% /c cd`;
+chomp $current_pwd;
+if (! ($current_pwd =~ /\\win32$/)) {
+ chdir ("win32");
+ $current_pwd = `%COMSPEC% /c cd`;
+ chomp $current_pwd;
+}
+
+if ( -d $ENV{MSVCDir} || -d $ENV{VCINSTALLDIR}) {
+}
+else {
+ print "\nPlease run VCVARS32.BAT first to set up the Visual Studio build\n" .
+ "environment.\n\n";
+ system("pause");
+ exit;
+}
+
+while (1) {
+ print "\n\nNet-SNMP build and install options\n";
+ print "==================================\n\n";
+ print "1. OpenSSL support: " . $openssl. "\n";
+ print "2. Platform SDK support: " . $sdk . "\n";
+ print "\n";
+ print "3. Install path: " . $install_base . "\n";
+ print "4. Install after build: " . $install . "\n";
+ print "\n";
+ print "5. Perl modules: " . $perl . "\n";
+ print "6. Install perl modules: " . $perl_install . "\n";
+ print "\n";
+ print "7. Quiet build (logged): " . $logging . "\n";
+ print "8. Debug mode: " . $debug . "\n";
+ print "\n";
+ print "9. IPv6 transports (requires SDK): " . $b_ipv6 . "\n";
+ print "10. winExtDLL agent (requires SDK): " . $b_winextdll . "\n";
+ print "\n";
+ print "11. Link type: " . $linktype . "\n";
+ print "\n";
+ print "12. Install development files " . $install_devel . "\n";
+ print "\nF. Finished - start build\n";
+ print "Q. Quit - abort build\n\n";
+ print "Select option to set / toggle: ";
+
+ chomp ($option = <>);
+ if ($option eq "1") {
+ if ($openssl eq "enabled") {
+ $openssl = "disabled";
+ }
+ else {
+ $openssl = "enabled";
+ }
+ }
+ elsif ($option eq "2") {
+ if ($sdk eq "enabled") {
+ $sdk = "disabled";
+ }
+ else {
+ $sdk = "enabled";
+ }
+ }
+ elsif ($option eq "9") {
+ if ($b_ipv6 eq "enabled") {
+ $b_ipv6 = "disabled";
+ }
+ else {
+ $b_ipv6 = "enabled";
+ if ($sdk = "disabled") {
+ print "\n\n* SDK required for IPv6 and has been automatically enabled";
+ $sdk = "enabled";
+ }
+ }
+ }
+ elsif ($option eq "10") {
+ if ($b_winextdll eq "enabled") {
+ $b_winextdll = "disabled";
+ }
+ else {
+ $b_winextdll = "enabled";
+ if ($sdk = "disabled") {
+ print "\n\n* SDK required for IPv6 and has been automatically enabled";
+ $sdk = "enabled";
+ }
+ }
+ }
+ elsif ($option eq "3") {
+ print "Please enter the new install path [$default_install_base]: ";
+ chomp ($install_base = <>);
+ if ($install_base eq "") {
+ $install_base = $default_install_base;
+ }
+ $install_base =~ s/\\/\//g;
+ }
+ elsif ($option eq "4") {
+ if ($install eq "enabled") {
+ $install = "disabled";
+ }
+ else {
+ $install = "enabled";
+ }
+ }
+ elsif ($option eq "12") {
+ if ($install_devel eq "enabled") {
+ $install_devel = "disabled";
+ }
+ else {
+ $install_devel = "enabled";
+ }
+ }
+ elsif ($option eq "5") {
+ if ($perl eq "enabled") {
+ $perl = "disabled";
+ }
+ else {
+ $perl = "enabled";
+ }
+ }
+ elsif ($option eq "6") {
+ if ($perl_install eq "enabled") {
+ $perl_install = "disabled";
+ }
+ else {
+ $perl_install = "enabled";
+ }
+ }
+ elsif ($option eq "7") {
+ if ($logging eq "enabled") {
+ $logging = "disabled";
+ }
+ else {
+ $logging = "enabled";
+ }
+ }
+ elsif ($option eq "8") {
+ if ($debug eq "enabled") {
+ $debug = "disabled";
+ }
+ else {
+ $debug = "enabled";
+ }
+ }
+ elsif ($option eq "11") {
+ if ($linktype eq "static") {
+ $linktype = "dynamic";
+ }
+ else {
+ $linktype = "static";
+ }
+ }
+ elsif (lc($option) eq "f") {
+ last;
+ }
+ elsif (lc($option) eq "q") {
+ exit;
+ }
+}
+
+$cTmp = ($openssl eq "enabled" ? "--with-ssl" : "" );
+$configOpts = "$cTmp";
+$cTmp = ($sdk eq "enabled" ? "--with-sdk" : "" );
+$configOpts = "$configOpts $cTmp";
+$cTmp = ($b_ipv6 eq "enabled" ? "--with-ipv6" : "" );
+$configOpts = "$configOpts $cTmp";
+$cTmp = ($b_winextdll eq "enabled" ? "--with-winextdll" : "" );
+$configOpts = "$configOpts $cTmp";
+$cTmp = ($debug eq "enabled" ? "--config=debug" : "--config=release" );
+$configOpts = "$configOpts $cTmp";
+
+# Set environment variables
+
+# Set to not search for non-existent ".dep" files
+$ENV{NO_EXTERNAL_DEPS}="1";
+
+# Set PATH environment variable so Perl make tests can locate the DLL
+$ENV{PATH} = "$current_pwd\\bin\\" . ($debug eq "enabled" ? "debug" : "release" ) . ";$ENV{PATH}";
+
+# Set MIBDIRS environment variable so Perl make tests can locate the mibs
+my $temp_mibdir = "$current_pwd/../mibs";
+$temp_mibdir =~ s/\\/\//g;
+$ENV{MIBDIRS}=$temp_mibdir;
+
+# Set SNMPCONFPATH environment variable so Perl conf.t test can locate
+# the configuration files.
+# See the note about environment variables in the Win32 section of
+# perl/SNMP/README for details on why this is needed.
+$ENV{SNMPCONFPATH}="t";$ENV{SNMPCONFPATH};
+
+print "\nBuilding...\n";
+
+if ($logging eq "enabled") {
+ print "\nCreating *.out log files.\n\n";
+}
+
+if ($logging eq "enabled") {
+ print "Deleting old log files...\n";
+ system("del *.out > NUL: 2>&1");
+
+ # Delete net-snmp-config.h from main include folder just in case it was created by a Cygwin or MinGW build
+ system("del ..\\include\\net-snmp\\net-snmp-config.h > NUL: 2>&1");
+ unlink "../snmplib/transports/snmp_transport_inits.h";
+
+ print "Running Configure...\n";
+ system("perl Configure $configOpts --linktype=$linktype --prefix=\"$install_base\" > configure.out 2>&1") == 0 || die "Build error (see configure.out)";
+
+ print "Cleaning...\n";
+ system("nmake /nologo clean > clean.out 2>&1") == 0 || die "Build error (see clean.out)";
+
+ print "Building main package...\n";
+ system("nmake /nologo > make.out 2>&1") == 0 || die "Build error (see make.out)";
+
+ if ($perl eq "enabled") {
+ if ($linktype eq "static") {
+ print "Running Configure for DLL...\n";
+ system("perl Configure $configOpts --linktype=dynamic --prefix=\"$install_base\" > perlconfigure.out 2>&1") == 0 || die "Build error (see perlconfigure.out)";
+
+ print "Cleaning libraries...\n";
+ system("nmake /nologo libs_clean >> clean.out 2>&1") == 0 || die "Build error (see clean.out)";
+
+ print "Building DLL libraries...\n";
+ system("nmake /nologo libs > dll.out 2>&1") == 0 || die "Build error (see dll.out)";
+ }
+
+ print "Cleaning Perl....\n";
+ system("nmake /nologo perl_clean >> clean.out 2>&1"); # If already cleaned, Makefile is gone so don't worry about errors!
+
+ print "Building Perl modules...\n";
+ system("nmake /nologo perl > perlmake.out 2>&1") == 0 || die "Build error (see perlmake.out)";
+
+ print "Testing Perl modules...\n";
+ system("nmake /nologo perl_test > perltest.out 2>&1"); # Don't die if all the tests don't pass..
+
+ if ($perl_install eq "enabled") {
+ print "Installing Perl modules...\n";
+ system("nmake /nologo perl_install > perlinstall.out 2>&1") == 0 || die "Build error (see perlinstall.out)";
+ }
+
+ print "\nSee perltest.out for Perl test results\n";
+ }
+
+ print "\n";
+ if ($install eq "enabled") {
+ print "Installing main package...\n";
+ system("nmake /nologo install > install.out 2>&1") == 0 || die "Build error (see install.out)";
+ }
+ else {
+ print "Type nmake install to install the package to $install_base\n";
+ }
+
+ if ($install_devel eq "enabled") {
+ print "Installing development files...\n";
+ system("nmake /nologo install_devel > install_devel.out 2>&1") == 0 || die "Build error (see install_devel.out)";
+ }
+ else {
+ print "Type nmake install_devel to install the development files to $install_base\n";
+ }
+
+ if ($perl_install eq "disabled" && $perl eq "enabled") {
+ print "Type nmake perl_install to install the Perl modules\n";
+ }
+}
+else {
+ system("del *.out");
+
+ # Delete net-snmp-config.h from main include folder just in case it was created by a Cygwin or MinGW build
+ system("del ..\\include\\net-snmp\\net-snmp-config.h > NUL: 2>&1");
+
+ system("perl Configure $configOpts --linktype=$linktype --prefix=\"$install_base\"") == 0 || die "Build error (see above)";
+ system("nmake /nologo clean") == 0 || die "Build error (see above)";
+ system("nmake /nologo") == 0 || die "Build error (see above)";
+
+ if ($perl eq "enabled") {
+ if ($linktype eq "static") {
+ system("perl Configure $configOpts --linktype=dynamic --prefix=\"$install_base\"") == 0 || die "Build error (see above)";
+ system("nmake /nologo libs_clean") == 0 || die "Build error (see above)";
+ system("nmake /nologo libs") == 0 || die "Build error (see above)";
+ }
+
+ system("nmake /nologo perl_clean"); # If already cleaned, Makefile is gone so don't worry about errors!
+ system("nmake /nologo perl") == 0 || die "Build error (see above)";
+
+ my $path_old = $ENV{PATH};
+ $ENV{PATH} = "$current_pwd\\bin\\" . ($debug eq "enabled" ? "debug" : "release" ) . ";$ENV{PATH}";
+ system("nmake /nologo perl_test"); # Don't die if all the tests don't pass..
+ $ENV{PATH} = $path_old;
+
+ if ($perl_install eq "enabled") {
+ print "Installing Perl modules...\n";
+ system("nmake /nologo perl_install") == 0 || die "Build error (see above)";
+ }
+ }
+
+ print "\n";
+ if ($install eq "enabled") {
+ print "Installing main package...\n";
+ system("nmake /nologo install") == 0 || die "Build error (see above)";
+ }
+ else {
+ print "Type nmake install to install the package to $install_base\n";
+ }
+
+ if ($install_devel eq "enabled") {
+ print "Installing development files...\n";
+ system("nmake /nologo install_devel > install_devel.out 2>&1") == 0 || die "Build error (see install_devel.out)";
+ }
+ else {
+ print "Type nmake install_devel to install the development files to $install_base\n";
+ }
+
+ if ($perl_install eq "disabled" && $perl eq "enabled") {
+ print "Type nmake perl_install to install the Perl modules\n";
+ }
+}
+
+print "\nDone!\n";
+
diff --git a/win32/config.h.borland b/win32/config.h.borland
new file mode 100644
index 0000000..47e1b07
--- /dev/null
+++ b/win32/config.h.borland
@@ -0,0 +1,786 @@
+/* config.h: a general config file */
+
+/* Define IN_UCD_SNMP_SOURCE if compiling inside the ucd-snmp source tree */
+#define IN_UCD_SNMP_SOURCE 1
+
+/* UC-Davis' IANA-assigned enterprise number is 2021 */
+#define ENTERPRISE_NUMBER 2021
+
+/* don't change these values! */
+#define NETSNMP_SNMPV1 0xAAAA /* readable by anyone */
+#define NETSNMP_SNMPV2ANY 0xA000 /* V2 Any type (includes NoAuth) */
+#define NETSNMP_SNMPV2AUTH 0x8000 /* V2 Authenticated requests only */
+
+/* default list of mibs to load */
+#define NETSNMP_DEFAULT_MIBS "IP-MIB;IF-MIB;TCP-MIB;UDP-MIB;SNMPv2-MIB;RFC1213-MIB;UCD-SNMP-MIB;UCD-DEMO-MIB;SNMP-TARGET-MIB;SNMP-VIEW-BASED-ACM-MIB;SNMP-COMMUNITY-MIB;UCD-DLMOD-MIB;SNMP-FRAMEWORK-MIB;SNMP-MPD-MIB;SNMP-USER-BASED-SM-MIB;SNMP-NOTIFICATION-MIB;SNMPv2-TM"
+
+/* default location to look for mibs to load using the above tokens
+ and/or those in the MIBS envrionment variable*/
+
+#define NETSNMP_DEFAULT_MIBDIRS "/USR/MIBS"
+
+/* default mib files to load, specified by path. */
+
+#undef NETSNMP_DEFAULT_MIBFILES
+
+/* should we compile to use special opaque types: float, double,
+ counter64, i64, ui64, union? */
+#define NETSNMP_WITH_OPAQUE_SPECIAL_TYPES 1
+
+/* comment the next line if you are compiling with libsnmp.h
+ and are not using the UC-Davis SNMP library. */
+#define UCD_SNMP_LIBRARY 1
+
+/* define if you want to compile support for both authentication and
+ privacy support. */
+#define NETSNMP_ENABLE_SCAPI_AUTHPRIV 1
+
+/* define if you are using the internal MD5 code */
+#define NETSNMP_USE_INTERNAL_MD5 1
+
+/* add in recent CMU library extensions (not complete) */
+#define CMU_COMPATIBLE 1
+
+/* should "--" comments in mibs be a comment till the end of the line
+ or also until another "--", the latter being the technically
+ correct. */
+#undef MIB_COMMENT_IS_EOL_TERMINATED
+
+/* debugging stuff */
+#undef NETSNMP_NO_DEBUGGING /* if defined, we optimize the code
+ to exclude all debugging calls. */
+#define NETSNMP_ALWAYS_DEBUG 0 /* Always print debugging information and
+ ignore the -D flag passed to the cmds */
+
+/* Define if using alloca.c. */
+#undef C_ALLOCA
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+#undef CRAY_STACKSEG_END
+
+/* Define if you have alloca, as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
+
+/* Define if you have the getmntent function. */
+#undef HAVE_GETMNTENT
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef pid_t
+
+/* Define as the return type of signal handlers (int or void). */
+#define RETSIGTYPE void
+
+/* Define if you have raise() instead of alarm() */
+
+#define HAVE_RAISE 1
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#undef STACK_DIRECTION
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define if you have the gettimeofday function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define if your processor stores words with the most significant
+ byte first (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
+
+#define SNMPDLMODPATH "/USR/LIB/DLMOD"
+#define SNMPLIBPATH "/USR/LIB"
+#define SNMPSHAREPATH "/USR/SHARE/SNMP"
+#define SNMPCONFPATH "/USR"
+
+/* SNMPPATH contains (more) important files */
+
+#undef SNMPPATH
+
+/* NETSNMP_LOGFILE: If defined it closes stdout/err/in and opens this in out/err's
+ place. (stdin is closed so that sh scripts won't wait for it) */
+
+#undef NETSNMP_LOGFILE
+
+/* NETSNMP_PERSISTENT_DIRECTORY: If defined, the library is capabile of saving
+ persisant information to this directory in the form of configuration
+ lines: NETSNMP_PERSISTENT_DIRECTORY/NAME.persistent.conf */
+#define NETSNMP_PERSISTENT_DIRECTORY "/USR/SNMP/PERSIST"
+
+#define NETSNMP_MAX_PERSISTENT_BACKUPS 10
+/* default system contact */
+#define NETSNMP_SYS_CONTACT "unknown"
+
+/* system location */
+#define NETSNMP_SYS_LOC "unknown"
+
+/* location of UNIX kernel */
+#define KERNEL_LOC "unknown"
+
+/* location of mount table list */
+#define ETC_MNTTAB "unknown"
+
+/* location of swap device (ok if not found) */
+#undef DMEM_LOC
+
+/* define rtentry to ortentry on SYSV machines (alphas) */
+#define RTENTRY rtentry;
+
+/* Use BSD 4.4 routing table entries? */
+#undef RTENTRY_4_4
+
+/* Does the rtentry structure have a rt_next node */
+#undef RTENTRY_RT_NEXT
+
+#define PSCMD "/bin/ps"
+
+/* Where is the uname command */
+#define UNAMEPROG "/bin/uname"
+
+/* testing code sections. */
+/* #undef NETSNMP_ENABLE_TESTING_CODE */
+
+/* If you don't have root access don't exit upon kmem errors */
+#undef NETSNMP_NO_ROOT_ACCESS
+
+/* Define if you have the gethostbyname function. */
+#define HAVE_GETHOSTBYNAME 1
+
+/* Define if you have the gethostname function. */
+#define HAVE_GETHOSTNAME 1
+
+/* Define if you have the getloadavg function. */
+#undef HAVE_GETLOADAVG
+
+/* Define if you have the setenv function. */
+#undef HAVE_SETENV
+
+/* Define if you have the strtoul function. */
+#define HAVE_STRTOUL 1
+
+/* Define if you have the vsnprintf function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define if you have the kvm_openfiles function. */
+#undef HAVE_KVM_OPENFILES
+
+/* Define if you have the lrand48 function. */
+#undef HAVE_LRAND48
+
+/* Define if you have the rand function. */
+#define HAVE_RAND 1
+
+/* Define if you have the random function. */
+#undef HAVE_RANDOM
+
+/* Define if you have the select function. */
+#undef HAVE_SELECT
+
+/* Define if you have the setmntent function. */
+#undef HAVE_SETMNTENT
+
+/* Define if you have the sigblock function. */
+#undef HAVE_SIGBLOCK
+
+/* Define if you have the sighold function. */
+#undef HAVE_SIGHOLD
+
+/* Define if you have the signal function. */
+#undef HAVE_SIGNAL
+
+/* Define if you have the sigset function. */
+#undef HAVE_SIGSET
+
+/* Define if you have the socket function. */
+#define HAVE_SOCKET 1
+
+/* Define if you have <winsock.h> header file. */
+#define HAVE_WINSOCK_H 1
+
+/* Define if you have the closesocket function. */
+#define HAVE_CLOSESOCKET 1
+
+/* Define if you have the statfs function. */
+#undef HAVE_STATFS
+
+/* Define if you have the statvfs function. */
+#undef HAVE_STATVFS
+
+/* Define if you have the strcasecmp function */
+#define HAVE_STRCASECMP 1
+
+/* Define if you have the snprintf function */
+#define HAVE_SNPRINTF 1
+
+/* use win32 strdup */
+#define strdup _strdup
+
+/* Define if you have the strtol function. */
+#define HAVE_STRTOL 1
+
+/* Define if you have the tcgetattr function. */
+/* #define HAVE_TCGETATTR 1 */
+
+/* Define if you have the uname function. */
+#undef HAVE_UNAME
+
+/* Define if you have <io.h> header file. */
+#define HAVE_IO_H 1
+
+/* Define if you have <process.h> header file. (Win32-getpid) */
+#define HAVE_PROCESS_H 1
+
+/* Define if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <err.h> header file. */
+#undef HAVE_ERR_H
+
+/* Define if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define if you have the <fstab.h> header file. */
+#undef HAVE_FSTAB_H
+
+/* Define if you have the <inet/mib2.h> header file. */
+#undef HAVE_INET_MIB2_H
+
+/* Define if you have the <kstat.h> header file. */
+#undef HAVE_KSTAT_H
+
+/* Define if you have the <kvm.h> header file. */
+#undef HAVE_KVM_H
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <machine/param.h> header file. */
+#undef HAVE_MACHINE_PARAM_H
+
+/* Define if you have the <machine/pte.h> header file. */
+#undef HAVE_MACHINE_PTE_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <mntent.h> header file. */
+#undef HAVE_MNTENT_H
+
+/* Define if you have the <mtab.h> header file. */
+#undef HAVE_MTAB_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <net/if_dl.h> header file. */
+#undef HAVE_NET_IF_DL_H
+
+/* Define if you have the <net/if_types.h> header file. */
+#undef HAVE_NET_IF_TYPES_H
+
+/* Define if you have the <netinet/icmp_var.h> header file. */
+#undef HAVE_NETINET_ICMP_VAR_H
+
+/* Define if you have the <netinet/if_ether.h> header file. */
+#undef HAVE_NETINET_IF_ETHER_H
+
+/* Define if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define if you have the <netinet/in_pcb.h> header file. */
+#undef HAVE_NETINET_IN_PCB_H
+
+/* Define if you have the <netinet/in_var.h> header file. */
+#undef HAVE_NETINET_IN_VAR_H
+
+/* Define if you have the <netinet/ip_var.h> header file. */
+#undef HAVE_NETINET_IP_VAR_H
+
+/* Define if you have the <netinet/tcp_fsm.h> header file. */
+#undef HAVE_NETINET_TCP_FSM_H
+
+/* Define if you have the <netinet/tcp_timer.h> header file. */
+#undef HAVE_NETINET_TCP_TIMER_H
+
+/* Define if you have the <netinet/tcp_var.h> header file. */
+#undef HAVE_NETINET_TCP_VAR_H
+
+/* Define if you have the <netinet/tcpip.h> header file. */
+#undef HAVE_NETINET_TCPIP_H
+
+/* Define if you have the <netinet/udp_var.h> header file. */
+#undef HAVE_NETINET_UDP_VAR_H
+
+/* Define if you have the <sgtty.h> header file. */
+#undef HAVE_SGTTY_H
+
+/* Define if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <sys/conf.h> header file. */
+#undef HAVE_SYS_CONF_H
+
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/dmap.h> header file. */
+#undef HAVE_SYS_DMAP_H
+
+/* Define if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define if you have the <sys/fixpoint.h> header file. */
+#undef HAVE_SYS_FIXPOINT_H
+
+/* Define if you have the <sys/fs.h> header file. */
+#undef HAVE_SYS_FS_H
+
+/* Define if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define if you have the <sys/hashing.h> header file. */
+#undef HAVE_SYS_HASHING_H
+
+/* Define if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define if you have the <sys/mbuf.h> header file. */
+#undef HAVE_SYS_MBUF_H
+
+/* Define if you have the <sys/mnttab.h> header file. */
+#undef HAVE_SYS_MNTTAB_H
+
+/* Define if you have the <sys/mount.h> header file. */
+#undef HAVE_SYS_MOUNT_H
+
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <sys/proc.h> header file. */
+#undef HAVE_SYS_PROC_H
+
+/* Define if you have the <sys/protosw.h> header file. */
+#undef HAVE_SYS_PROTOSW_H
+
+/* Define if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H
+
+/* Define if you have the <sys/statvfs.h> header file. */
+#undef HAVE_SYS_STATVFS_H
+
+/* Define if you have the <sys/swap.h> header file. */
+#undef HAVE_SYS_SWAP_H
+
+/* Define if you have the <sys/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
+/* Define if you have the <sys/tcpipstats.h> header file. */
+#undef HAVE_SYS_TCPIPSTATS_H
+
+/* Define if you have the <sys/user.h> header file. */
+#undef HAVE_SYS_USER_H
+
+/* Define if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
+
+/* Define if you have the <sys/vfs.h> header file. */
+#undef HAVE_SYS_VFS_H
+
+/* Define if you have the <sys/vm.h> header file. */
+#undef HAVE_SYS_VM_H
+
+/* Define if you have the <sys/vmmac.h> header file. */
+#undef HAVE_SYS_VMMAC_H
+
+/* Define if you have the <sys/vmmeter.h> header file. */
+#undef HAVE_SYS_VMMETER_H
+
+/* Define if you have the <sys/vmparam.h> header file. */
+#undef HAVE_SYS_VMPARAM_H
+
+/* Define if you have the <sys/vmsystm.h> header file. */
+#undef HAVE_SYS_VMSYSTM_H
+
+/* Define if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
+
+/* Define if you have the <ufs/ffs/fs.h> header file. */
+#undef HAVE_UFS_FFS_FS_H
+
+/* Define if you have the <ufs/fs.h> header file. */
+#undef HAVE_UFS_FS_H
+
+/* Define if you have the <ufs/ufs/dinode.h> header file. */
+#undef HAVE_UFS_UFS_DINODE_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <utsname.h> header file. */
+#undef HAVE_UTSNAME_H
+
+/* Define if you have the <vm/swap_pager.h> header file. */
+#undef HAVE_VM_SWAP_PAGER_H
+
+/* Define if you have the <vm/vm.h> header file. */
+#undef HAVE_VM_VM_H
+
+/* Define if you have the <xti.h> header file. */
+#undef HAVE_XTI_H
+
+/* Define if you have the crypto library (-lcrypto). */
+#undef HAVE_LIBCRYPTO
+
+/* Define if you have the elf library (-lelf). */
+#undef HAVE_LIBELF
+
+/* Define if you have the kstat library (-lkstat). */
+#undef HAVE_LIBKSTAT
+
+/* Define if you have the m library (-lm). */
+#undef HAVE_LIBM
+
+/* Define if you have the mld library (-lmld). */
+#undef HAVE_LIBMLD
+
+/* Define if you have the nsl library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define if you have the socket library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
+/* ifnet structure tests */
+#undef STRUCT_IFNET_HAS_IF_BAUDRATE
+#undef STRUCT_IFNET_HAS_IF_TYPE
+#undef STRUCT_IFNET_HAS_IF_IMCASTS
+#undef STRUCT_IFNET_HAS_IF_IQDROPS
+#undef STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_SEC
+#undef STRUCT_IFNET_HAS_IF_NOPROTO
+#undef STRUCT_IFNET_HAS_IF_OMCASTS
+#undef STRUCT_IFNET_HAS_IF_XNAME
+#undef STRUCT_IFNET_HAS_IF_OBYTES
+#undef STRUCT_IFNET_HAS_IF_IBYTES
+#undef STRUCT_IFNET_HAS_IF_ADDRLIST
+
+/* tcpstat.tcps_rcvmemdrop */
+#undef STRUCT_TCPSTAT_HAS_TCPS_RCVMEMDROP
+
+/* udpstat.udps_discard */
+#undef STRUCT_UDPSTAT_HAS_UDPS_DISCARD
+
+/* arphd.at_next */
+#undef STRUCT_ARPHD_HAS_AT_NEXT
+
+/* ifaddr.ifa_next */
+#undef STRUCT_IFADDR_HAS_IFA_NEXT
+
+/* ifnet.if_mtu */
+#undef STRUCT_IFNET_HAS_IF_MTU
+
+/* ifnet needs to have _KERNEL defined */
+#undef IFNET_NEEDS_KERNEL
+
+/* sysctl works to get boottime, etc... */
+#undef NETSNMP_CAN_USE_SYSCTL
+
+/* type check for in_addr_t */
+#define in_addr_t u_long
+
+/* mib pointer to the top of the extensible tree. This has been
+ assigned to UCDavis by the iana group. Optionally, point this to the
+ location in the tree your company/organization has been allocated. */
+
+/* location of the extensible mib tree */
+#define EXTENSIBLEMIB 1,3,6,1,4,1,2021
+/* location of the extensible mib tree */
+#define EXTENSIBLEDOTMIB 1.3.6.1.4.1.2021
+/* count the above numbers */
+#define EXTENSIBLENUM 7
+
+/* the ErrorFlag is V1 accessable because HP Openview does not support
+ V2. You can make this list of pairs as long as you want, just make
+ sure to end it in -1.*/
+
+#define SECURITYEXCEPTIONS {100,NETSNMP_SNMPV1,-1} /* the ErrorFlag is V1 */
+
+/* Mib-2 tree Info */
+/* These are the system information variables. */
+
+#define NETSNMP_VERS_DESC "unknown" /* overridden at run time */
+#define NETSNMP_SYS_NAME "unknown" /* overridden at run time */
+
+/* comment out the second define to turn off functionality for any of
+ these: (See README for details) */
+
+/* proc PROCESSNAME [MAX] [MIN] */
+#define NETSNMP_PROCMIBNUM 2
+#define USEPROCMIB
+
+/* exec/shell NAME COMMAND */
+#define NETSNMP_SHELLMIBNUM 8
+#define USESHELLMIB
+
+/* swap MIN */
+#define NETSNMP_MEMMIBNUM 4
+#if defined(hpux9) || defined(bsdi2)
+#define USEMEMMIB
+#endif
+
+/* disk DISK MINSIZE */
+#define NETSNMP_DISKMIBNUM 9
+#if (HAVE_FSTAB_H || HAVE_SYS_STATVFS_H)
+#define USEDISKMIB
+#endif
+
+/* load 1 5 15 */
+#define NETSNMP_LOADAVEMIBNUM 10
+#define USELOADAVEMIB
+
+/* pass MIBOID command */
+#define USEPASSMIB
+
+/* which version are you using? This mibloc will tell you */
+#define NETSNMP_VERSIONMIBNUM 100
+#define USEVERSIONMIB
+
+/* Reports errors the agent runs into */
+/* (typically its "can't fork, no mem" problems) */
+#define NETSNMP_ERRORMIBNUM 101
+#define USEERRORMIB
+
+/* The sub id of EXENSIBLEMIB returned to queries of
+ .iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0 */
+#define NETSNMP_AGENTID 250
+
+/* This ID is returned after the NETSNMP_AGENTID above. IE, the resulting
+ value returned by a query to sysObjectID is
+ EXTENSIBLEMIB.NETSNMP_AGENTID.???, where ??? is defined below by OSTYPE */
+
+#define NETSNMP_HPUX9ID 1
+#define NETSNMP_SUNOS4ID 2
+#define NETSNMP_SOLARISID 3
+#define NETSNMP_OSFID 4
+#define NETSNMP_ULTRIXID 5
+#define NETSNMP_HPUX10ID 6
+#define NETSNMP_NETBSD1ID 7
+#define NETSNMP_FREEBSDID 8
+#define NETSNMP_IRIXID 9
+#define NETSNMP_LINUXID 10
+#define NETSNMP_BSDIID 11
+#define NETSNMP_OPENBSDID 12
+#define NETSNMP_WIN32ID 13
+#define NETSNMP_UNKNOWNID 255
+
+#ifdef hpux9
+#define OSTYPE NETSNMP_HPUX9ID
+#endif
+#ifdef hpux10
+#define OSTYPE NETSNMP_HPUX10ID
+#endif
+#ifdef sunos4
+#define OSTYPE NETSNMP_SUNOS4ID
+#endif
+#ifdef solaris2
+#define OSTYPE NETSNMP_SOLARISID
+#endif
+#if defined(osf3) || defined(osf4) || defined(osf5)
+#define OSTYPE NETSNMP_OSFID
+#endif
+#ifdef ultrix4
+#define OSTYPE NETSNMP_ULTRIXID
+#endif
+#ifdef netbsd1
+#define OSTYPE NETSNMP_NETBSD1ID
+#endif
+#ifdef freebsd2
+#define OSTYPE NETSNMP_FREEBSDID
+#endif
+#if defined(irix6) || defined(irix5)
+#define OSTYPE NETSNMP_IRIXID
+#endif
+#ifdef linux
+#define OSTYPE NETSNMP_LINUXID
+#endif
+#if defined(bsdi2) || defined(bsdi3)
+#define OSTYPE NETSNMP_BSDIID
+#endif
+#ifdef openbsd2
+#define OSTYPE NETSNMP_OPENBSDID
+#endif
+#define OSTYPE NETSNMP_WIN32ID
+/* unknown */
+#ifndef OSTYPE
+#define OSTYPE NETSNMP_UNKNOWNID
+#endif
+
+/* how long to wait (seconds) for error querys before reseting the error trap.*/
+#define NETSNMP_ERRORTIMELENGTH 600
+
+/* Exec command to fix PROC problems */
+/* %s will be replaced by the process name in error */
+
+#define NETSNMP_PROCFIXCMD "/usr/local/bin/perl /local/scripts/fixproc %s"
+
+/* Exec command to fix EXEC problems */
+/* %s will be replaced by the exec/script name in error */
+
+#define NETSNMP_EXECFIXCMD "/usr/local/bin/perl /local/scripts/fixproc %s"
+
+/* Should exec output Cashing be used (speeds up things greatly), and
+ if so, After how many seconds should the cache re-newed? Note:
+ Don't define CASHETIME to disable cashing completely */
+
+#define NETSNMP_EXCACHETIME 30
+#define NETSNMP_CACHEFILE ".snmp-exec-cache"
+#define NETSNMP_MAXCACHESIZE (200*80) /* roughly 200 lines max */
+
+#define MAXDISKS 10 /* can't scan more than this number */
+
+/* misc defaults */
+
+/* default of 100 meg minimum if the minimum size is not specified in
+ the config file */
+#define NETSNMP_DEFDISKMINIMUMSPACE 100000
+
+#define NETSNMP_DEFMAXLOADAVE 12.0 /* default maximum load average before error */
+
+#define NETSNMP_MAXREADCOUNT 20 /* max times to loop reading output from
+ execs. Because of sleep(1)s, this will also
+ be time to wait (in seconds) for exec to finish */
+
+#define NETSNMP_SNMPBLOCK 1 /* Set to 1 if you want snmpgets to block and never
+ timeout. Original CMU code had this
+ hardcoded into the code as = 1 */
+
+#define NETSNMP_RESTARTSLEEP 5 /* How long to wait after a snmpset to
+ EXTENSIBLEMIB.NETSNMP_VERSIONMIBNUM.VERRESTARTAGENT
+ before restarting the agent. This is
+ necessary to finish the snmpset reply
+ before restarting. */
+
+/* Number of community strings to store */
+#define NETSNMP_NUM_COMMUNITIES 5
+
+/* UNdefine to allow specifying zero-length community string */
+/* #define NETSNMP_NO_ZEROLENGTH_COMMUNITY 1 */
+
+#define NETSNMP_LASTFIELD -1 /* internal define */
+
+/* Define if you have the strdup function. */
+#undef HAVE_STRDUP
+
+/* Define if you have the strerror function. */
+#define HAVE_STRERROR 1
+
+/* define random functions */
+
+#ifndef HAVE_RANDOM
+#ifdef HAVE_LRAND48
+#define random lrand48
+#define srandom(s) srand48(s)
+#else
+#ifdef HAVE_RAND
+#define random rand
+#define srandom(s) srand(s)
+#endif
+#endif
+#endif
+
+/* define signal if DNE */
+
+#ifndef HAVE_SIGNAL
+#ifdef HAVE_SIGSET
+#define signal(a,b) sigset(a,b)
+#endif
+#endif
+
+/* Not-to-be-compiled macros for use by configure only */
+#define config_require(x)
+#define config_arch_require(x,y)
+#define config_parse_dot_conf(w,x,y,z)
+#define config_add_mib(x)
+
+#ifndef DONT_INC_STRUCTS
+/*#include "agent/mibgroup/struct.h" */
+#endif
+
+#ifndef linux
+#ifndef solaris2
+#define bsdlike
+#endif
+#endif
+
+/* detect Borland C++ WIN32 definition, add Visual C++ define */
+#ifdef __WIN32__
+#ifndef WIN32
+#define WIN32
+#endif /* WIN32 */
+#endif /* __WIN32__ */
+
+#ifdef WIN32
+
+#define HAVE_GETPID 1
+
+int strcasecmp(const char *s1, const char *s2);
+#define vsnprintf _vsnprintf
+
+#define EADDRINUSE WSAEADDRINUSE
+
+#define ENV_SEPARATOR ";"
+#define ENV_SEPARATOR_CHAR ';'
+
+
+#else
+
+#define ENV_SEPARATOR ":"
+#define ENV_SEPARATOR_CHAR ':'
+
+#endif
+
+/* typedef unsigned short mode_t; */
+
+#define NETSNMP_AGENT_DIRECTORY_MODE 0700
+
+/* reverse encoding BER packets is both faster and more efficient in space. */
+#define NETSNMP_USE_REVERSE_ASNENCODING 1
+#define NETSNMP_DEFAULT_ASNENCODING_DIRECTION 1 /* 1 = reverse, 0 = forwards */
+
diff --git a/win32/encode_keychange/encode_keychange.dsp b/win32/encode_keychange/encode_keychange.dsp
new file mode 100644
index 0000000..5a252f5
--- /dev/null
+++ b/win32/encode_keychange/encode_keychange.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="encode_keychange" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=encode_keychange - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "encode_keychange.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "encode_keychange.mak" CFG="encode_keychange - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "encode_keychange - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "encode_keychange - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "encode_keychange - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/encode_keychange.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "encode_keychange - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/encode_keychange.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "encode_keychange - Win32 Release"
+# Name "encode_keychange - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\encode_keychange.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/install-net-snmp.bat b/win32/install-net-snmp.bat
new file mode 100755
index 0000000..6692c30
--- /dev/null
+++ b/win32/install-net-snmp.bat
@@ -0,0 +1,120 @@
+@echo off
+REM Install the Net-SNMP Project files on the local machine.
+REM
+REM Run this script from the base Net-SNMP source directory
+REM after the successful build has completed.
+
+REM **** IMPORTANT NOTE ****
+REM The value for INSTALL_BASE in win32\net-snmp\net-snmp-config.h, and
+REM The value for INSTALL_BASE below **MUST** match
+
+REM Use backslashes to delimit sub-directories in path.
+set INSTALL_BASE="c:\usr"
+
+if "%1" == "-?" goto help
+if "%1" == "/?" goto help
+if "%1" == "-h" goto help
+if "%1" == "/h" goto help
+if "%1" == "-help" goto help
+if "%1" == "/help" goto help
+goto start
+
+:help
+echo .
+echo This script will compile the Net-SNMP Perl modules. Net-SNMP must
+echo already be installed.
+echo .
+echo The current install base is %INSTALL_BASE%.
+echo This must match the directory that Net-SNMP has been installed in.
+echo .
+echo To change the installation directory, modify the INSTALL_BASE variable
+echo inside this script.
+echo .
+echo Run this script from the base of the source directory, NOT the win32
+echo directory.
+echo .
+goto end
+
+:start
+
+set progVer=release
+if "%1" NEQ "-debug" goto nodebug
+set progVer=debug
+shift
+
+:nodebug
+
+REM make sure script runs from above the win32 directory
+cd win32 > NUL: 2>&1
+cd .. > NUL: 2>&1
+
+echo Installing %progVer% versions
+
+echo Remember to run this script from the base of the source directory.
+
+echo Creating %INSTALL_BASE% sub-directories
+
+mkdir %INSTALL_BASE% > NUL:
+mkdir %INSTALL_BASE%\bin > NUL:
+mkdir %INSTALL_BASE%\etc > NUL:
+mkdir %INSTALL_BASE%\etc\snmp > NUL:
+mkdir %INSTALL_BASE%\share > NUL:
+mkdir %INSTALL_BASE%\share\snmp > NUL:
+mkdir %INSTALL_BASE%\share\snmp\mibs > NUL:
+mkdir %INSTALL_BASE%\share\snmp\snmpconf-data > NUL:
+mkdir %INSTALL_BASE%\share\snmp\snmpconf-data\snmp-data > NUL:
+mkdir %INSTALL_BASE%\share\snmp\snmpconf-data\snmpd-data > NUL:
+mkdir %INSTALL_BASE%\share\snmp\snmpconf-data\snmptrapd-data > NUL:
+mkdir %INSTALL_BASE%\share\snmp\mib2c-data > NUL:
+mkdir %INSTALL_BASE%\snmp > NUL:
+mkdir %INSTALL_BASE%\snmp\persist > NUL:
+mkdir %INSTALL_BASE%\temp > NUL:
+mkdir %INSTALL_BASE%\include > NUL:
+mkdir %INSTALL_BASE%\include\net-snmp > NUL:
+mkdir %INSTALL_BASE%\include\ucd-snmp > NUL:
+mkdir %INSTALL_BASE%\lib > NUL:
+
+echo Copying MIB files to %INSTALL_BASE%\share\snmp\mibs
+Copy mibs\*.txt %INSTALL_BASE%\share\snmp\mibs > NUL:
+
+echo Copying compiled programs to %INSTALL_BASE%\bin
+Copy win32\bin\%progVer%\*.exe %INSTALL_BASE%\bin > NUL:
+Copy local\snmpconf %INSTALL_BASE%\bin > NUL:
+Copy local\snmpconf.bat %INSTALL_BASE%\bin > NUL:
+Copy local\mib2c %INSTALL_BASE%\bin > NUL:
+Copy local\mib2c.bat %INSTALL_BASE%\bin > NUL:
+Copy local\traptoemail %INSTALL_BASE%\bin > NUL:
+Copy local\traptoemail.bat %INSTALL_BASE%\bin > NUL:
+
+echo Copying snmpconf files to %INSTALL_BASE%\share\snmp\snmpconf-data\snmp-data
+Copy local\snmpconf.dir\snmp-data\*.* %INSTALL_BASE%\share\snmp\snmpconf-data\snmp-data > NUL:
+Copy local\snmpconf.dir\snmpd-data\*.* %INSTALL_BASE%\share\snmp\snmpconf-data\snmpd-data > NUL:
+Copy local\snmpconf.dir\snmptrapd-data\*.* %INSTALL_BASE%\share\snmp\snmpconf-data\snmptrapd-data > NUL:
+
+echo Copying mib2c config files to %INSTALL_BASE%\share\snmp
+Copy local\mib2c*.conf %INSTALL_BASE%\share\snmp > NUL:
+Copy local\mib2c-conf.d\*.* %INSTALL_BASE%\share\snmp\mib2c-data > NUL:
+
+REM
+REM Copy the remaining files used only to develop
+REM other software that uses Net-SNMP libraries.
+REM
+echo Copying link libraries to %INSTALL_BASE%\lib
+Copy win32\lib\%progVer%\*.* %INSTALL_BASE%\lib > NUL:
+
+echo Copying header files to %INSTALL_BASE%\include
+xcopy /E /Y include\net-snmp\*.h %INSTALL_BASE%\include\net-snmp > NUL:
+xcopy /E /Y include\ucd-snmp\*.h %INSTALL_BASE%\include\ucd-snmp > NUL:
+xcopy /E /Y win32\net-snmp\*.* %INSTALL_BASE%\include\net-snmp > NUL:
+
+REM
+REM If built with OpenSSL, we need the DLL library, too.
+REM
+echo Copying DLL files to %INSTALL_BASE%
+Copy win32\bin\%progVer%\*.dll %INSTALL_BASE%\bin > NUL:
+
+echo Copying DLL files to %SYSTEMROOT%\System32
+Copy win32\bin\%progVer%\*.dll %SYSTEMROOT%\System32 > NUL:
+
+echo Done copying files to %INSTALL_BASE%
+
diff --git a/win32/libagent/Makefile.in b/win32/libagent/Makefile.in
new file mode 100644
index 0000000..30a6cf6
--- /dev/null
+++ b/win32/libagent/Makefile.in
@@ -0,0 +1,297 @@
+PROGNAME=
+CFG=
+OUTDIR=
+INTDIR=
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+ALL : "..\lib\$(OUTDIR)\netsnmpagent.lib"
+
+
+LIB32_OBJS= \
+ "$(INTDIR)\agent_handler.obj" \
+ "$(INTDIR)\agent_index.obj" \
+ "$(INTDIR)\agent_read_config.obj" \
+ "$(INTDIR)\agent_registry.obj" \
+ "$(INTDIR)\agent_sysORTable.obj" \
+ "$(INTDIR)\agent_trap.obj" \
+ "$(INTDIR)\all_helpers.obj" \
+ "$(INTDIR)\baby_steps.obj" \
+ "$(INTDIR)\bulk_to_next.obj" \
+ "$(INTDIR)\cache_handler.obj" \
+ "$(INTDIR)\debug_handler.obj" \
+ "$(INTDIR)\instance.obj" \
+ "$(INTDIR)\mode_end_call.obj" \
+ "$(INTDIR)\multiplexer.obj" \
+ "$(INTDIR)\null.obj" \
+ "$(INTDIR)\old_api.obj" \
+ "$(INTDIR)\read_only.obj" \
+ "$(INTDIR)\row_merge.obj" \
+ "$(INTDIR)\scalar.obj" \
+ "$(INTDIR)\scalar_group.obj" \
+ "$(INTDIR)\serialize.obj" \
+ "$(INTDIR)\snmp_agent.obj" \
+ "$(INTDIR)\snmp_vars.obj" \
+ "$(INTDIR)\stash_cache.obj" \
+ "$(INTDIR)\stash_to_next.obj" \
+ "$(INTDIR)\table.obj" \
+ "$(INTDIR)\table_array.obj" \
+ "$(INTDIR)\table_container.obj" \
+ "$(INTDIR)\table_data.obj" \
+ "$(INTDIR)\table_dataset.obj" \
+ "$(INTDIR)\table_iterator.obj" \
+ "$(INTDIR)\table_tdata.obj" \
+ "$(INTDIR)\watcher.obj"
+
+CLEAN :
+ -@for %f in ($(LIB32_OBJS)) do erase %%f
+ -@erase "$(INTDIR)\vc??.idb"
+ -@erase "..\lib\$(OUTDIR)\netsnmpagent.lib"
+
+"..\lib\$(OUTDIR)" :
+ if not exist "..\lib\$(OUTDIR)/$(NULL)" mkdir "..\lib\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+!IF "$(CFG)" == "release"
+CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+!ELSE
+CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+
+RSC=rc.exe
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\lib\$(OUTDIR)\netsnmpagent.lib"
+
+"..\lib\$(OUTDIR)\netsnmpagent.lib" : "..\lib\$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("libagent.dep")
+!INCLUDE "libagent.dep"
+!ELSE
+!MESSAGE Warning: cannot find "libagent.dep"
+!ENDIF
+!ENDIF
+
+
+SOURCE=..\..\agent\agent_handler.c
+
+"$(INTDIR)\agent_handler.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\agent_index.c
+
+"$(INTDIR)\agent_index.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\agent_read_config.c
+
+"$(INTDIR)\agent_read_config.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\agent_registry.c
+
+"$(INTDIR)\agent_registry.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\agent_sysORTable.c
+
+"$(INTDIR)\agent_sysORTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\agent_trap.c
+
+"$(INTDIR)\agent_trap.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\snmp_agent.c
+
+"$(INTDIR)\snmp_agent.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\snmp_vars.c
+
+"$(INTDIR)\snmp_vars.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\all_helpers.c
+
+"$(INTDIR)\all_helpers.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\baby_steps.c
+
+"$(INTDIR)\baby_steps.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\bulk_to_next.c
+
+"$(INTDIR)\bulk_to_next.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\cache_handler.c
+
+"$(INTDIR)\cache_handler.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\debug_handler.c
+
+"$(INTDIR)\debug_handler.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\instance.c
+
+"$(INTDIR)\instance.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\mode_end_call.c
+
+"$(INTDIR)\mode_end_call.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\multiplexer.c
+
+"$(INTDIR)\multiplexer.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\null.c
+
+"$(INTDIR)\null.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\old_api.c
+
+"$(INTDIR)\old_api.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\read_only.c
+
+"$(INTDIR)\read_only.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\row_merge.c
+
+"$(INTDIR)\row_merge.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\scalar.c
+
+"$(INTDIR)\scalar.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\scalar_group.c
+
+"$(INTDIR)\scalar_group.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\serialize.c
+
+"$(INTDIR)\serialize.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\stash_cache.c
+
+"$(INTDIR)\stash_cache.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\stash_to_next.c
+
+"$(INTDIR)\stash_to_next.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\table.c
+
+"$(INTDIR)\table.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\table_array.c
+
+"$(INTDIR)\table_array.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\table_container.c
+
+"$(INTDIR)\table_container.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\table_data.c
+
+"$(INTDIR)\table_data.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\table_tdata.c
+
+"$(INTDIR)\table_tdata.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\table_dataset.c
+
+"$(INTDIR)\table_dataset.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\table_iterator.c
+
+"$(INTDIR)\table_iterator.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\helpers\watcher.c
+
+"$(INTDIR)\watcher.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
diff --git a/win32/libagent/libagent.dsp b/win32/libagent/libagent.dsp
new file mode 100644
index 0000000..892e8d3
--- /dev/null
+++ b/win32/libagent/libagent.dsp
@@ -0,0 +1,316 @@
+# Microsoft Developer Studio Project File - Name="libagent" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=libagent - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "libagent.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "libagent.mak" CFG="libagent - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "libagent - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "libagent - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "libagent - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "../lib/release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"../lib/release/netsnmpagent.lib"
+
+!ELSEIF "$(CFG)" == "libagent - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "../lib/debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"../lib/debug/netsnmpagent.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "libagent - Win32 Release"
+# Name "libagent - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\agent\agent_handler.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\agent_index.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\agent_read_config.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\agent_registry.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\agent_sysORTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\agent_trap.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\all_helpers.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\baby_steps.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\bulk_to_next.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\cache_handler.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\debug_handler.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\instance.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\mode_end_call.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\multiplexer.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\null.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\old_api.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\read_only.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\row_merge.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\scalar.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\scalar_group.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\serialize.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\snmp_agent.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\snmp_vars.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\stash_cache.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\stash_to_next.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\table.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\table_array.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\table_container.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\table_data.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\table_dataset.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\table_iterator.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\table_tdata.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\helpers\watcher.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\agent_handler.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\agent_index.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\agent_read_config.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\agent_registry.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\agent_sysORTable.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\agent_trap.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\all_helpers.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\bulk_to_next.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\debug_handler.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\instance.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\multiplexer.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\null.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\old_api.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\read_only.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\serialize.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\snmp_agent.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\snmp_vars.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\table.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\table_array.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\table_data.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\table_dataset.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\table_iterator.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\table_tdata.h"
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/win32/libnetsnmptrapd/Makefile.in b/win32/libnetsnmptrapd/Makefile.in
new file mode 100644
index 0000000..3824919
--- /dev/null
+++ b/win32/libnetsnmptrapd/Makefile.in
@@ -0,0 +1,202 @@
+PROGNAME=
+CFG=
+OUTDIR=
+INTDIR=
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+!IF "$(CFG)" == "release"
+
+ALL : "..\lib\$(OUTDIR)\netsnmptrapd.lib"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\snmptrapd.obj"
+ -@erase "$(INTDIR)\snmptrapd_handlers.obj"
+ -@erase "$(INTDIR)\snmptrapd_log.obj"
+ -@erase "$(INTDIR)\snmptrapd_auth.obj"
+ -@erase "$(INTDIR)\winservice.obj"
+ -@erase "$(INTDIR)\vc??.idb"
+ -@erase "$(INTDIR)\$(PROGNAME).pch"
+ -@erase "..\lib\$(OUTDIR)\netsnmptrapd.lib"
+
+"..\lib\$(OUTDIR)" :
+ if not exist "..\lib\$(OUTDIR)/$(NULL)" mkdir "..\lib\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\libnetsnmptrapd.bsc"
+BSC32_SBRS= \
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\lib\$(OUTDIR)\netsnmptrapd.lib"
+LIB32_OBJS= \
+ "$(INTDIR)\snmptrapd.obj" \
+ "$(INTDIR)\snmptrapd_handlers.obj" \
+ "$(INTDIR)\snmptrapd_log.obj" \
+ "$(INTDIR)\snmptrapd_auth.obj" \
+ "$(INTDIR)\winservice.obj"
+
+"..\lib\$(OUTDIR)\netsnmptrapd.lib" : "..\lib\$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "debug"
+
+ALL : "..\lib\$(OUTDIR)\netsnmptrapd.lib"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\snmptrapd.obj"
+ -@erase "$(INTDIR)\snmptrapd_handlers.obj"
+ -@erase "$(INTDIR)\snmptrapd_log.obj"
+ -@erase "$(INTDIR)\snmptrapd_auth.obj"
+ -@erase "$(INTDIR)\winservice.obj"
+ -@erase "$(INTDIR)\vc??.idb"
+ -@erase "$(INTDIR)\vc??.pdb"
+ -@erase "$(INTDIR)\$(PROGNAME).pch"
+ -@erase "..\lib\$(OUTDIR)\netsnmptrapd.lib"
+
+"..\lib\$(OUTDIR)" :
+ if not exist "..\lib\$(OUTDIR)/$(NULL)" mkdir "..\lib\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\libnetsnmptrapd.bsc"
+BSC32_SBRS= \
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\lib\$(OUTDIR)\netsnmptrapd.lib"
+LIB32_OBJS= \
+ "$(INTDIR)\snmptrapd.obj" \
+ "$(INTDIR)\snmptrapd_handlers.obj" \
+ "$(INTDIR)\snmptrapd_log.obj" \
+ "$(INTDIR)\snmptrapd_auth.obj" \
+ "$(INTDIR)\winservice.obj"
+
+"..\lib\$(OUTDIR)\netsnmptrapd.lib" : "..\lib\$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+!ENDIF
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("libnetsnmptrapd.dep")
+!INCLUDE "libnetsnmptrapd.dep"
+!ELSE
+!MESSAGE Warning: cannot find "libnetsnmptrapd.dep"
+!ENDIF
+!ENDIF
+
+
+!IF "$(CFG)" == "release" || "$(CFG)" == "debug"
+SOURCE=..\..\apps\snmptrapd.c
+
+"$(INTDIR)\snmptrapd.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\apps\snmptrapd_handlers.c
+
+"$(INTDIR)\snmptrapd_handlers.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\apps\snmptrapd_log.c
+
+"$(INTDIR)\snmptrapd_log.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\apps\snmptrapd_auth.c
+
+"$(INTDIR)\snmptrapd_auth.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\winservice.c
+
+"$(INTDIR)\winservice.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
diff --git a/win32/libnetsnmptrapd/libnetsnmptrapd.dsp b/win32/libnetsnmptrapd/libnetsnmptrapd.dsp
new file mode 100644
index 0000000..08b41ff
--- /dev/null
+++ b/win32/libnetsnmptrapd/libnetsnmptrapd.dsp
@@ -0,0 +1,124 @@
+# Microsoft Developer Studio Project File - Name="libnetsnmptrapd" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=libnetsnmptrapd - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "libnetsnmptrapd.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "libnetsnmptrapd.mak" CFG="libnetsnmptrapd - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "libnetsnmptrapd - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "libnetsnmptrapd - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "libnetsnmptrapd - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "../lib/release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"../lib/release/netsnmptrapd.lib"
+
+!ELSEIF "$(CFG)" == "libnetsnmptrapd - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "../lib/debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"../lib/debug/netsnmptrapd.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "libnetsnmptrapd - Win32 Release"
+# Name "libnetsnmptrapd - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\apps\snmptrapd.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmptrapd_auth.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmptrapd_handlers.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmptrapd_log.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\notification-log-mib\notification_log.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\apps\snmptrapd_auth.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\apps\snmptrapd_handlers.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\apps\snmptrapd_log.h"
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/win32/libsnmp/Makefile.in b/win32/libsnmp/Makefile.in
new file mode 100644
index 0000000..98d83c8
--- /dev/null
+++ b/win32/libsnmp/Makefile.in
@@ -0,0 +1,525 @@
+PROGNAME=
+CFG=
+OUTDIR=
+INTDIR=
+SDK=
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+ALL : "..\lib\$(OUTDIR)\netsnmp.lib"
+
+LIB32_OBJS= \
+ "$(INTDIR)\asn1.obj" \
+ "$(INTDIR)\callback.obj" \
+ "$(INTDIR)\check_varbind.obj" \
+ "$(INTDIR)\closedir.obj" \
+ "$(INTDIR)\container.obj" \
+ "$(INTDIR)\container_binary_array.obj" \
+ "$(INTDIR)\container_iterator.obj" \
+ "$(INTDIR)\container_list_ssll.obj" \
+ "$(INTDIR)\container_null.obj" \
+ "$(INTDIR)\data_list.obj" \
+ "$(INTDIR)\default_store.obj" \
+ "$(INTDIR)\fd_event_manager.obj" \
+ "$(INTDIR)\getopt.obj" \
+ "$(INTDIR)\gettimeofday.obj" \
+ "$(INTDIR)\inet_ntop.obj" \
+ "$(INTDIR)\inet_pton.obj" \
+ "$(INTDIR)\int64.obj" \
+ "$(INTDIR)\keytools.obj" \
+ "$(INTDIR)\large_fd_set.obj" \
+ "$(INTDIR)\lcd_time.obj" \
+ "$(INTDIR)\md5.obj" \
+ "$(INTDIR)\mib.obj" \
+ "$(INTDIR)\mt_support.obj" \
+ "$(INTDIR)\oid_stash.obj" \
+ "$(INTDIR)\opendir.obj" \
+ "$(INTDIR)\parse.obj" \
+ "$(INTDIR)\read_config.obj" \
+ "$(INTDIR)\readdir.obj" \
+ "$(INTDIR)\scapi.obj" \
+ "$(INTDIR)\snmp-tc.obj" \
+ "$(INTDIR)\snmp.obj" \
+ "$(INTDIR)\snmpCallbackDomain.obj" \
+ "$(INTDIR)\snmpIPv4BaseDomain.obj" \
+ "$(INTDIR)\snmpSocketBaseDomain.obj" \
+ "$(INTDIR)\snmpTCPBaseDomain.obj" \
+ "$(INTDIR)\snmpTCPDomain.obj" \
+ "$(INTDIR)\snmpUDPBaseDomain.obj" \
+ "$(INTDIR)\snmpUDPDomain.obj" \
+ "$(INTDIR)\snmpUDPIPv4BaseDomain.obj" \
+ "$(INTDIR)\snmp_alarm.obj" \
+ "$(INTDIR)\snmp_api.obj" \
+ "$(INTDIR)\snmp_auth.obj" \
+ "$(INTDIR)\snmp_client.obj" \
+ "$(INTDIR)\snmp_debug.obj" \
+ "$(INTDIR)\snmp_enum.obj" \
+ "$(INTDIR)\snmp_logging.obj" \
+ "$(INTDIR)\snmp_parse_args.obj" \
+ "$(INTDIR)\snmp_secmod.obj" \
+ "$(INTDIR)\snmp_service.obj" \
+ "$(INTDIR)\snmp_transport.obj" \
+ "$(INTDIR)\snmp_version.obj" \
+ "$(INTDIR)\snmpusm.obj" \
+ "$(INTDIR)\snmpv3.obj" \
+ "$(INTDIR)\strlcat.obj" \
+ "$(INTDIR)\strlcpy.obj" \
+ "$(INTDIR)\strtok_r.obj" \
+ "$(INTDIR)\strtoull.obj" \
+ "$(INTDIR)\system.obj" \
+ "$(INTDIR)\tools.obj" \
+ "$(INTDIR)\ucd_compat.obj" \
+ "$(INTDIR)\vacm.obj" \
+ "$(INTDIR)\winpipe.obj"
+!IF "$(SDK)" == "true"
+LIB32_OBJS=$(LIB32_OBJS)\
+ "$(INTDIR)\snmpIPv6BaseDomain.obj" \
+ "$(INTDIR)\snmpTCPIPv6Domain.obj" \
+ "$(INTDIR)\snmpUDPIPv6Domain.obj"
+!ENDIF
+
+CLEAN :
+ -@for %f in $(LIB32_OBJS) do erase %%f
+ -@erase "..\lib\$(OUTDIR)\netsnmp.lib"
+
+"..\lib\$(OUTDIR)" :
+ if not exist "..\lib\$(OUTDIR)/$(NULL)" mkdir "..\lib\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+!IF "$(CFG)" == "release"
+CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+!ELSEIF "$(CFG)" == "debug"
+CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+
+RSC=rc.exe
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\lib\$(OUTDIR)\netsnmp.lib"
+"..\lib\$(OUTDIR)\netsnmp.lib" : "..\lib\$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("$(PROGNAME).dep")
+!INCLUDE "$(PROGNAME).dep"
+!ELSE
+!MESSAGE Warning: cannot find "$(PROGNAME).dep"
+!ENDIF
+!ENDIF
+
+
+SOURCE=..\..\snmplib\asn1.c
+
+"$(INTDIR)\asn1.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\callback.c
+
+"$(INTDIR)\callback.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\check_varbind.c
+
+"$(INTDIR)\check_varbind.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\closedir.c
+
+"$(INTDIR)\closedir.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container.c
+
+"$(INTDIR)\container.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container_binary_array.c
+
+"$(INTDIR)\container_binary_array.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container_iterator.c
+
+"$(INTDIR)\container_iterator.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container_list_ssll.c
+
+"$(INTDIR)\container_list_ssll.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container_null.c
+
+"$(INTDIR)\container_null.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\data_list.c
+
+"$(INTDIR)\data_list.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\default_store.c
+
+"$(INTDIR)\default_store.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\fd_event_manager.c
+
+"$(INTDIR)\fd_event_manager.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\getopt.c
+
+"$(INTDIR)\getopt.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\gettimeofday.c
+
+"$(INTDIR)\gettimeofday.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\inet_ntop.c
+
+"$(INTDIR)\inet_ntop.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\inet_pton.c
+
+"$(INTDIR)\inet_pton.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\int64.c
+
+"$(INTDIR)\int64.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\keytools.c
+
+"$(INTDIR)\keytools.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\large_fd_set.c
+
+"$(INTDIR)\large_fd_set.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\lcd_time.c
+
+"$(INTDIR)\lcd_time.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\md5.c
+
+"$(INTDIR)\md5.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\mib.c
+
+"$(INTDIR)\mib.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\mt_support.c
+
+"$(INTDIR)\mt_support.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\oid_stash.c
+
+"$(INTDIR)\oid_stash.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\opendir.c
+
+"$(INTDIR)\opendir.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\parse.c
+
+"$(INTDIR)\parse.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\read_config.c
+
+"$(INTDIR)\read_config.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\readdir.c
+
+"$(INTDIR)\readdir.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\scapi.c
+
+"$(INTDIR)\scapi.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\snmplib\snmp-tc.c"
+
+"$(INTDIR)\snmp-tc.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp.c
+
+"$(INTDIR)\snmp.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpCallbackDomain.c
+
+"$(INTDIR)\snmpCallbackDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpIPv4BaseDomain.c
+
+"$(INTDIR)\snmpIPv4BaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpIPv6BaseDomain.c
+
+"$(INTDIR)\snmpIPv6BaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpSocketBaseDomain.c
+
+"$(INTDIR)\snmpSocketBaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpTCPBaseDomain.c
+
+"$(INTDIR)\snmpTCPBaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpTCPDomain.c
+
+"$(INTDIR)\snmpTCPDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpTCPIPv6Domain.c
+
+"$(INTDIR)\snmpTCPIPv6Domain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpUDPBaseDomain.c
+
+"$(INTDIR)\snmpUDPBaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpUDPDomain.c
+
+"$(INTDIR)\snmpUDPDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpUDPIPv4BaseDomain.c
+
+"$(INTDIR)\snmpUDPIPv4BaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpUDPIPv6Domain.c
+
+"$(INTDIR)\snmpUDPIPv6Domain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_alarm.c
+
+"$(INTDIR)\snmp_alarm.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_api.c
+
+"$(INTDIR)\snmp_api.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_auth.c
+
+"$(INTDIR)\snmp_auth.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_client.c
+
+"$(INTDIR)\snmp_client.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_debug.c
+
+"$(INTDIR)\snmp_debug.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_enum.c
+
+"$(INTDIR)\snmp_enum.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_logging.c
+
+"$(INTDIR)\snmp_logging.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_parse_args.c
+
+"$(INTDIR)\snmp_parse_args.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_secmod.c
+
+"$(INTDIR)\snmp_secmod.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_service.c
+
+"$(INTDIR)\snmp_service.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_transport.c
+
+"$(INTDIR)\snmp_transport.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_version.c
+
+"$(INTDIR)\snmp_version.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmpusm.c
+
+"$(INTDIR)\snmpusm.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmpv3.c
+
+"$(INTDIR)\snmpv3.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\strlcat.c
+
+"$(INTDIR)\strlcat.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\strlcpy.c
+
+"$(INTDIR)\strlcpy.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\strtok_r.c
+
+"$(INTDIR)\strtok_r.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\strtoull.c
+
+"$(INTDIR)\strtoull.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\system.c
+
+"$(INTDIR)\system.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\tools.c
+
+"$(INTDIR)\tools.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\ucd_compat.c
+
+"$(INTDIR)\ucd_compat.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\vacm.c
+
+"$(INTDIR)\vacm.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\winpipe.c
+
+"$(INTDIR)\winpipe.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
diff --git a/win32/libsnmp/libsnmp.dsp b/win32/libsnmp/libsnmp.dsp
new file mode 100644
index 0000000..2386331
--- /dev/null
+++ b/win32/libsnmp/libsnmp.dsp
@@ -0,0 +1,512 @@
+# Microsoft Developer Studio Project File - Name="libsnmp" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=libsnmp - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "libsnmp.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "libsnmp.mak" CFG="libsnmp - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "libsnmp - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "libsnmp - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "libsnmp - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "../lib/release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"../lib/release/netsnmp.lib"
+
+!ELSEIF "$(CFG)" == "libsnmp - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "../lib/debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"../lib/debug/netsnmp.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "libsnmp - Win32 Release"
+# Name "libsnmp - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\snmplib\asn1.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\callback.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\check_varbind.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\closedir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container_binary_array.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container_iterator.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container_list_ssll.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container_null.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\data_list.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\default_store.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\fd_event_manager.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\getopt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\gettimeofday.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\inet_ntop.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\inet_pton.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\int64.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\keytools.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\large_fd_set.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\lcd_time.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\md5.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\mib.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\mt_support.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\oid_stash.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\opendir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\parse.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\read_config.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\readdir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\scapi.c
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\snmplib\snmp-tc.c"
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_alarm.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_api.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_auth.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_client.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_debug.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_enum.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_logging.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_parse_args.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_secmod.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_service.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_transport.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_version.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpAliasDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpCallbackDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpIPv4BaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpIPv6BaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpSocketBaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpTCPBaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpTCPDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpTCPIPv6Domain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpUDPBaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpUDPDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpUDPIPv4BaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpUDPIPv6Domain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmpusm.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmpv3.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\strlcat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\strlcpy.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\strtok_r.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\strtoull.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\system.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\tools.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\ucd_compat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\vacm.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\winpipe.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\asn1.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\callback.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\check_varbind.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\container.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\data_list.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\default_store.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\fd_event_manager.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\getopt.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\int64.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\keytools.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\large_fd_set.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\lcd_time.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\md5.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\mib.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\mt_support.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\oid_stash.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\parse.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\read_config.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\scapi.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp-tc.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_alarm.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_api.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_client.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_debug.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_enum.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_logging.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_parse_args.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_secmod.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_transport.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpCallbackDomain.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpTCPDomain.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpUDPDomain.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpusm.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpv3.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\strtok_r.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\system.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\tools.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\ucd_compat.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\vacm.h"
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/win32/libsnmp_dll/Makefile.in b/win32/libsnmp_dll/Makefile.in
new file mode 100644
index 0000000..42235d2
--- /dev/null
+++ b/win32/libsnmp_dll/Makefile.in
@@ -0,0 +1,541 @@
+PROGNAME=
+CFG=
+OUTDIR=
+INTDIR=
+SSL=
+SDK=
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+ALL : "..\bin\$(OUTDIR)\netsnmp.dll"
+
+LINK32_OBJS= \
+ "$(INTDIR)\asn1.obj" \
+ "$(INTDIR)\callback.obj" \
+ "$(INTDIR)\check_varbind.obj" \
+ "$(INTDIR)\closedir.obj" \
+ "$(INTDIR)\container.obj" \
+ "$(INTDIR)\container_binary_array.obj" \
+ "$(INTDIR)\container_iterator.obj" \
+ "$(INTDIR)\container_list_ssll.obj" \
+ "$(INTDIR)\container_null.obj" \
+ "$(INTDIR)\data_list.obj" \
+ "$(INTDIR)\default_store.obj" \
+ "$(INTDIR)\fd_event_manager.obj" \
+ "$(INTDIR)\getopt.obj" \
+ "$(INTDIR)\gettimeofday.obj" \
+ "$(INTDIR)\inet_ntop.obj" \
+ "$(INTDIR)\inet_pton.obj" \
+ "$(INTDIR)\int64.obj" \
+ "$(INTDIR)\keytools.obj" \
+ "$(INTDIR)\large_fd_set.obj" \
+ "$(INTDIR)\lcd_time.obj" \
+ "$(INTDIR)\md5.obj" \
+ "$(INTDIR)\mib.obj" \
+ "$(INTDIR)\mt_support.obj" \
+ "$(INTDIR)\oid_stash.obj" \
+ "$(INTDIR)\opendir.obj" \
+ "$(INTDIR)\parse.obj" \
+ "$(INTDIR)\read_config.obj" \
+ "$(INTDIR)\readdir.obj" \
+ "$(INTDIR)\scapi.obj" \
+ "$(INTDIR)\snmp-tc.obj" \
+ "$(INTDIR)\snmp.obj" \
+ "$(INTDIR)\snmpCallbackDomain.obj" \
+ "$(INTDIR)\snmpIPv4BaseDomain.obj" \
+ "$(INTDIR)\snmpSocketBaseDomain.obj" \
+ "$(INTDIR)\snmpTCPBaseDomain.obj" \
+ "$(INTDIR)\snmpTCPDomain.obj" \
+ "$(INTDIR)\snmpUDPBaseDomain.obj" \
+ "$(INTDIR)\snmpUDPDomain.obj" \
+ "$(INTDIR)\snmpUDPIPv4BaseDomain.obj" \
+ "$(INTDIR)\snmp_alarm.obj" \
+ "$(INTDIR)\snmp_api.obj" \
+ "$(INTDIR)\snmp_auth.obj" \
+ "$(INTDIR)\snmp_client.obj" \
+ "$(INTDIR)\snmp_debug.obj" \
+ "$(INTDIR)\snmp_enum.obj" \
+ "$(INTDIR)\snmp_logging.obj" \
+ "$(INTDIR)\snmp_parse_args.obj" \
+ "$(INTDIR)\snmp_secmod.obj" \
+ "$(INTDIR)\snmp_service.obj" \
+ "$(INTDIR)\snmp_transport.obj" \
+ "$(INTDIR)\snmp_version.obj" \
+ "$(INTDIR)\snmpusm.obj" \
+ "$(INTDIR)\snmpv3.obj" \
+ "$(INTDIR)\strlcat.obj" \
+ "$(INTDIR)\strlcpy.obj" \
+ "$(INTDIR)\strtok_r.obj" \
+ "$(INTDIR)\strtoull.obj" \
+ "$(INTDIR)\system.obj" \
+ "$(INTDIR)\tools.obj" \
+ "$(INTDIR)\ucd_compat.obj" \
+ "$(INTDIR)\vacm.obj" \
+ "$(INTDIR)\winpipe.obj"
+!IF "$(SDK)" == "true"
+LINK32_OBJS=$(LINK32_OBJS)\
+ "$(INTDIR)\snmpIPv6BaseDomain.obj" \
+ "$(INTDIR)\snmpTCPIPv6Domain.obj" \
+ "$(INTDIR)\snmpUDPIPv6Domain.obj"
+!ENDIF
+
+CLEAN :
+ -@for %f in ($(LINK32_OBJS)) do erase %%f
+ -@erase "..\lib\$(OUTDIR)\netsnmp.exp"
+ -@erase "..\lib\$(OUTDIR)\netsnmp.lib"
+ -@erase "..\bin\$(OUTDIR)\netsnmp.dll"
+ -@erase "..\bin\$(OUTDIR)\netsnmp.dll.manifest"
+
+"..\lib\$(OUTDIR)" :
+ if not exist "..\lib\$(OUTDIR)/$(NULL)" mkdir "..\lib\$(OUTDIR)"
+
+"..\bin\$(OUTDIR)" :
+ if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+!IF "$(CFG)" == "release"
+CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /D "NETSNMP_DLL" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+!ELSE
+CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /D "NETSNMP_DLL" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+MTL=midl.exe
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+RSC=rc.exe
+LINK32=link.exe
+!IF "$(CFG)" == "release"
+LINK32_FLAGS=advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /dll /pdb:"../bin/$(OUTDIR)/netsnmp.pdb" /debug /def:".\libsnmp.def" /out:"../bin/$(OUTDIR)/netsnmp.dll" /implib:"../lib/$(OUTDIR)/netsnmp.lib"
+!ELSE
+LINK32_FLAGS=advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /dll /incremental:no /pdb:"../bin/$(OUTDIR)/netsnmp.pdb" /debug /def:".\libsnmp.def" /out:"../bin/$(OUTDIR)/netsnmp.dll" /implib:"../lib/$(OUTDIR)/netsnmp.lib"
+!ENDIF
+
+"..\bin\$(OUTDIR)\netsnmp.dll" : "..\bin\$(OUTDIR)" "..\lib\$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ if exist "../bin/$(OUTDIR)/netsnmp.dll.manifest" \
+ mt.exe -manifest "../bin/$(OUTDIR)/netsnmp.dll.manifest" -outputresource:"../bin/$(OUTDIR)/netsnmp.dll";2
+LINK32=link.exe
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("libsnmp_dll.dep")
+!INCLUDE "libsnmp_dll.dep"
+!ELSE
+!MESSAGE Warning: cannot find "libsnmp_dll.dep"
+!ENDIF
+!ENDIF
+
+
+SOURCE=..\..\snmplib\asn1.c
+
+"$(INTDIR)\asn1.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\callback.c
+
+"$(INTDIR)\callback.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\check_varbind.c
+
+"$(INTDIR)\check_varbind.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\closedir.c
+
+"$(INTDIR)\closedir.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container.c
+
+"$(INTDIR)\container.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container_binary_array.c
+
+"$(INTDIR)\container_binary_array.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container_iterator.c
+
+"$(INTDIR)\container_iterator.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container_list_ssll.c
+
+"$(INTDIR)\container_list_ssll.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\container_null.c
+
+"$(INTDIR)\container_null.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\data_list.c
+
+"$(INTDIR)\data_list.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\default_store.c
+
+"$(INTDIR)\default_store.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\fd_event_manager.c
+
+"$(INTDIR)\fd_event_manager.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\getopt.c
+
+"$(INTDIR)\getopt.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\gettimeofday.c
+
+"$(INTDIR)\gettimeofday.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\inet_ntop.c
+
+"$(INTDIR)\inet_ntop.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\inet_pton.c
+
+"$(INTDIR)\inet_pton.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\int64.c
+
+"$(INTDIR)\int64.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\keytools.c
+
+"$(INTDIR)\keytools.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\large_fd_set.c
+
+"$(INTDIR)\large_fd_set.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\lcd_time.c
+
+"$(INTDIR)\lcd_time.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\md5.c
+
+"$(INTDIR)\md5.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\mib.c
+
+"$(INTDIR)\mib.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\mt_support.c
+
+"$(INTDIR)\mt_support.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\oid_stash.c
+
+"$(INTDIR)\oid_stash.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\opendir.c
+
+"$(INTDIR)\opendir.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\parse.c
+
+"$(INTDIR)\parse.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\read_config.c
+
+"$(INTDIR)\read_config.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\readdir.c
+
+"$(INTDIR)\readdir.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\scapi.c
+
+"$(INTDIR)\scapi.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\snmplib\snmp-tc.c"
+
+"$(INTDIR)\snmp-tc.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp.c
+
+"$(INTDIR)\snmp.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpCallbackDomain.c
+
+"$(INTDIR)\snmpCallbackDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpIPv4BaseDomain.c
+
+"$(INTDIR)\snmpIPv4BaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpIPv6BaseDomain.c
+
+"$(INTDIR)\snmpIPv6BaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpSocketBaseDomain.c
+
+"$(INTDIR)\snmpSocketBaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpTCPBaseDomain.c
+
+"$(INTDIR)\snmpTCPBaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpTCPDomain.c
+
+"$(INTDIR)\snmpTCPDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpTCPIPv6Domain.c
+
+"$(INTDIR)\snmpTCPIPv6Domain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpUDPBaseDomain.c
+
+"$(INTDIR)\snmpUDPBaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpUDPDomain.c
+
+"$(INTDIR)\snmpUDPDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpUDPIPv4BaseDomain.c
+
+"$(INTDIR)\snmpUDPIPv4BaseDomain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\transports\snmpUDPIPv6Domain.c
+
+"$(INTDIR)\snmpUDPIPv6Domain.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_alarm.c
+
+"$(INTDIR)\snmp_alarm.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_api.c
+
+"$(INTDIR)\snmp_api.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_auth.c
+
+"$(INTDIR)\snmp_auth.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_client.c
+
+"$(INTDIR)\snmp_client.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_debug.c
+
+"$(INTDIR)\snmp_debug.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_enum.c
+
+"$(INTDIR)\snmp_enum.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_logging.c
+
+"$(INTDIR)\snmp_logging.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_parse_args.c
+
+"$(INTDIR)\snmp_parse_args.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_secmod.c
+
+"$(INTDIR)\snmp_secmod.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_service.c
+
+"$(INTDIR)\snmp_service.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_transport.c
+
+"$(INTDIR)\snmp_transport.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmp_version.c
+
+"$(INTDIR)\snmp_version.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmpusm.c
+
+"$(INTDIR)\snmpusm.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\snmpv3.c
+
+"$(INTDIR)\snmpv3.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\strlcat.c
+
+"$(INTDIR)\strlcat.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\strlcpy.c
+
+"$(INTDIR)\strlcpy.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\strtok_r.c
+
+"$(INTDIR)\strtok_r.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\strtoull.c
+
+"$(INTDIR)\strtoull.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\system.c
+
+"$(INTDIR)\system.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\tools.c
+
+"$(INTDIR)\tools.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\ucd_compat.c
+
+"$(INTDIR)\ucd_compat.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\vacm.c
+
+"$(INTDIR)\vacm.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\winpipe.c
+
+"$(INTDIR)\winpipe.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
diff --git a/win32/libsnmp_dll/libsnmp.def b/win32/libsnmp_dll/libsnmp.def
new file mode 100644
index 0000000..45dd356
--- /dev/null
+++ b/win32/libsnmp_dll/libsnmp.def
@@ -0,0 +1,2 @@
+; This .def file is obsolete. Do not add any names of exported functions here
+; but add NETSNMP_IMPORT to function declarations instead.
diff --git a/win32/libsnmp_dll/libsnmp_dll.dsp b/win32/libsnmp_dll/libsnmp_dll.dsp
new file mode 100644
index 0000000..12c0414
--- /dev/null
+++ b/win32/libsnmp_dll/libsnmp_dll.dsp
@@ -0,0 +1,523 @@
+# Microsoft Developer Studio Project File - Name="libsnmp_dll" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=libsnmp_dll - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "libsnmp_dll.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "libsnmp_dll.mak" CFG="libsnmp_dll - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "libsnmp_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "libsnmp_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "libsnmp_dll - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "../lib/release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /D "NETSNMP_DLL" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /D "NETSNMP_DLL" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /dll /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /dll /pdb:none /machine:I386 /def:".\libsnmp.def" /out:"../bin/release/netsnmp.dll"
+
+!ELSEIF "$(CFG)" == "libsnmp_dll - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "../lib/debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /D "NETSNMP_DLL" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /D "NETSNMP_DLL" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /dll /incremental:no /debug /machine:I386 /def:".\libsnmp.def" /out:"../bin/debug/netsnmp.dll"
+
+!ENDIF
+
+# Begin Target
+
+# Name "libsnmp_dll - Win32 Release"
+# Name "libsnmp_dll - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\snmplib\asn1.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\callback.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\check_varbind.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\closedir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container_binary_array.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container_iterator.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container_list_ssll.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\container_null.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\data_list.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\default_store.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\fd_event_manager.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\getopt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\gettimeofday.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\inet_ntop.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\inet_pton.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\int64.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\keytools.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\large_fd_set.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\lcd_time.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\md5.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\mib.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\mt_support.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\oid_stash.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\opendir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\parse.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\read_config.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\readdir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\scapi.c
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\snmplib\snmp-tc.c"
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_alarm.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_api.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_auth.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_client.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_debug.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_enum.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_logging.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_parse_args.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_secmod.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_service.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_transport.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmp_version.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpAliasDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpCallbackDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpIPv4BaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpIPv6BaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpSocketBaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpTCPBaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpTCPDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpTCPIPv6Domain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpUDPBaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpUDPDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpUDPIPv4BaseDomain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\transports\snmpUDPIPv6Domain.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmpusm.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\snmpv3.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\strlcat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\strlcpy.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\strtok_r.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\strtoull.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\system.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\tools.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\ucd_compat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\vacm.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\winpipe.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\asn1.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\callback.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\check_varbind.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\container.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\data_list.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\default_store.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\fd_event_manager.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\getopt.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\int64.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\keytools.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\large_fd_set.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\lcd_time.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\md5.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\mib.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\mt_support.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\oid_stash.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\parse.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\read_config.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\scapi.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp-tc.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_alarm.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_api.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_client.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_debug.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_enum.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_logging.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_parse_args.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_secmod.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmp_transport.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpCallbackDomain.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpTCPDomain.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpUDPDomain.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpusm.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\snmpv3.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\strtok_r.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\system.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\tools.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\ucd_compat.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\vacm.h"
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\libsnmp.def
+# End Source File
+# End Target
+# End Project
diff --git a/win32/local/Makefile.in b/win32/local/Makefile.in
new file mode 100644
index 0000000..6293379
--- /dev/null
+++ b/win32/local/Makefile.in
@@ -0,0 +1,32 @@
+#
+# local (scripts) directory Makefile
+#
+OUTDIR=
+PREFIX=
+PREFIX_DOS=
+
+ALL: snmpconf mib2c traptoemail
+
+"..\bin\$(OUTDIR)" :
+ if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"
+
+snmpconf: "..\..\local\snmpconf" "..\bin\$(OUTDIR)"
+ perl -p -e "s#/usr/local#$(PREFIX)#g;" ..\..\local\snmpconf > ..\bin\$(OUTDIR)\snmpconf
+
+mib2c: "..\..\local\mib2c" "..\bin\$(OUTDIR)"
+ perl -p -e "s#/usr/local#$(PREFIX)#g;" ..\..\local\mib2c > ..\bin\$(OUTDIR)\mib2c
+
+traptoemail: "..\..\local\traptoemail" "..\bin\$(OUTDIR)"
+ perl -p -e "s#/usr/local#$(PREFIX)#g;" ..\..\local\traptoemail > ..\bin\$(OUTDIR)\traptoemail
+
+CLEAN: snmpconf_clean mib2c_clean traptoemail_clean
+
+snmpconf_clean:
+ -@erase "..\bin\$(OUTDIR)\snmpconf"
+
+mib2c_clean:
+ -@erase "..\bin\$(OUTDIR)\mib2c"
+
+traptoemail_clean:
+ -@erase "..\bin\$(OUTDIR)\traptoemail"
+
diff --git a/win32/local/mib2c.bat b/win32/local/mib2c.bat
new file mode 100644
index 0000000..2b13f1b
--- /dev/null
+++ b/win32/local/mib2c.bat
@@ -0,0 +1,26 @@
+@echo off
+set MYPERLPROGRAM=c:\usr\bin\mib2c
+
+perl -v > NUL 2>&1
+if ERRORLEVEL 1 goto no_perl
+rem Perl found!
+
+if "%OS%"=="Windows_NT" goto winnt
+perl "%MYPERLPROGRAM%" %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15
+goto end
+
+:winnt
+perl "%MYPERLPROGRAM%" %*
+goto end
+
+:no_perl
+echo %MYPERLPROGRAM% requires Perl to run.
+echo .
+echo A version of Perl for Windows is available from
+echo http://www.activestate.com/Products/ActivePerl
+echo .
+echo Please install Perl and run this program again.
+echo .
+pause
+
+:end
diff --git a/win32/local/snmpconf.bat b/win32/local/snmpconf.bat
new file mode 100644
index 0000000..f0c2496
--- /dev/null
+++ b/win32/local/snmpconf.bat
@@ -0,0 +1,26 @@
+@echo off
+set MYPERLPROGRAM=c:\usr\bin\snmpconf
+
+perl -v > NUL 2>&1
+if ERRORLEVEL 1 goto no_perl
+rem Perl found!
+
+if "%OS%"=="Windows_NT" goto winnt
+perl "%MYPERLPROGRAM%" %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15
+goto end
+
+:winnt
+perl "%MYPERLPROGRAM%" %*
+goto end
+
+:no_perl
+echo %MYPERLPROGRAM% requires Perl to run.
+echo .
+echo A version of Perl for Windows is available from
+echo http://www.activestate.com/Products/ActivePerl
+echo .
+echo Please install Perl and run this program again.
+echo .
+pause
+
+:end
diff --git a/win32/local/traptoemail.bat b/win32/local/traptoemail.bat
new file mode 100644
index 0000000..954244f
--- /dev/null
+++ b/win32/local/traptoemail.bat
@@ -0,0 +1,26 @@
+@echo off
+set MYPERLPROGRAM=c:\usr\bin\traptoemail
+
+perl -v > NUL 2>&1
+if ERRORLEVEL 1 goto no_perl
+rem Perl found!
+
+if "%OS%"=="Windows_NT" goto winnt
+perl "%MYPERLPROGRAM%" %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15
+goto end
+
+:winnt
+perl "%MYPERLPROGRAM%" %*
+goto end
+
+:no_perl
+echo %MYPERLPROGRAM% requires Perl to run.
+echo .
+echo A version of Perl for Windows is available from
+echo http://www.activestate.com/Products/ActivePerl
+echo .
+echo Please install Perl and run this program again.
+echo .
+pause
+
+:end
diff --git a/win32/mib_module_dot_conf.h b/win32/mib_module_dot_conf.h
new file mode 100644
index 0000000..8ead61b
--- /dev/null
+++ b/win32/mib_module_dot_conf.h
@@ -0,0 +1 @@
+/* This file is automatically generated by configure. Do not modify by hand. */
diff --git a/win32/mib_module_includes.h b/win32/mib_module_includes.h
new file mode 100644
index 0000000..014ade0
--- /dev/null
+++ b/win32/mib_module_includes.h
@@ -0,0 +1,177 @@
+
+/* This file is automatically generated by configure. Do not modify by hand. */
+
+/*
+ * The defines found in net-snmp/agent/mib_module_config.h
+ * are used to include/exclude header files referenced here.
+ */
+
+#include "mibgroup/mibII.h"
+#include "mibgroup/ucd_snmp.h"
+#include "mibgroup/snmpv3mibs.h"
+#include "mibgroup/notification.h"
+#include "mibgroup/target.h"
+#include "mibgroup/agent_mibs.h"
+
+#ifdef USING_AGENTX_MODULE
+#include "mibgroup/agentx.h"
+#endif
+
+#include "mibgroup/agent_mibs.h"
+#include "mibgroup/utilities.h"
+
+#ifdef USING_HOST_MODULE
+#include "mibgroup/host.h"
+#endif
+
+#ifdef USING_RMON_MODULE
+#include "mibgroup/Rmon.h"
+#endif
+
+#ifdef USING_DISMAN_EVENT_MODULE
+#include "mibgroup/disman/event.h"
+#endif
+
+#ifdef USING_SMUX_MODULE
+#include "mibgroup/smux.h"
+#endif
+
+#ifndef WIN32
+#include "mibgroup/mibII/ipv6.h"
+#endif
+
+#include "mibgroup/mibII/system_mib.h"
+#include "mibgroup/mibII/sysORTable.h"
+
+#ifdef HAVE_WIN32_PLATFORM_SDK
+#include "mibgroup/mibII/at.h"
+#include "mibgroup/mibII/interfaces.h"
+#include "mibgroup/mibII/tcp.h"
+#include "mibgroup/mibII/icmp.h"
+#include "mibgroup/mibII/ip.h"
+#include "mibgroup/mibII/udp.h"
+#include "mibgroup/mibII/tcpTable.h"
+#include "mibgroup/mibII/ipAddr.h"
+#include "mibgroup/mibII/udpTable.h"
+#include "mibgroup/mibII/var_route.h"
+#endif
+
+#include "mibgroup/mibII/snmp_mib.h"
+#include "mibgroup/mibII/vacm_vars.h"
+#include "mibgroup/mibII/setSerialNo.h"
+
+#ifdef USING_UCD_SNMP_MODULE
+#include "mibgroup/ucd-snmp/memory.h"
+#include "mibgroup/ucd-snmp/vmstat.h"
+#include "mibgroup/ucd-snmp/proc.h"
+#include "mibgroup/ucd-snmp/versioninfo.h"
+#include "mibgroup/ucd-snmp/pass.h"
+#include "mibgroup/ucd-snmp/pass_persist.h"
+#include "mibgroup/ucd-snmp/disk.h"
+#include "mibgroup/ucd-snmp/loadave.h"
+#include "mibgroup/ucd-snmp/extensible.h"
+#include "mibgroup/agent/extend.h"
+#include "mibgroup/ucd-snmp/errormib.h"
+#include "mibgroup/ucd-snmp/file.h"
+#include "mibgroup/ucd-snmp/proxy.h"
+#endif
+
+#if HAVE_REGEX_H
+#include "mibgroup/ucd-snmp/logmatch.h"
+#endif
+
+#include "mibgroup/snmpv3/snmpEngine.h"
+#include "mibgroup/snmpv3/snmpMPDStats.h"
+#include "mibgroup/snmpv3/usmStats.h"
+#include "mibgroup/snmpv3/usmUser.h"
+#include "mibgroup/notification/snmpNotifyTable.h"
+#include "mibgroup/notification/snmpNotifyFilterProfileTable.h"
+#include "mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h"
+#include "mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h"
+#include "mibgroup/target/snmpTargetAddrEntry.h"
+#include "mibgroup/target/snmpTargetParamsEntry.h"
+#include "mibgroup/target/target.h"
+#include "mibgroup/target/target_counters.h"
+#include "mibgroup/agent/nsTransactionTable.h"
+#include "mibgroup/agent/nsModuleTable.h"
+#include "mibgroup/agent/nsDebug.h"
+#include "mibgroup/agent/nsCache.h"
+#include "mibgroup/agent/nsLogging.h"
+#include "mibgroup/utilities/iquery.h"
+#include "mibgroup/utilities/override.h"
+
+#ifdef USING_HOST_MODULE
+#include "mibgroup/host/hr_system.h"
+#include "mibgroup/host/hr_storage.h"
+#include "mibgroup/host/hr_device.h"
+#include "mibgroup/host/hr_other.h"
+#include "mibgroup/host/hr_proc.h"
+#include "mibgroup/host/hr_network.h"
+#include "mibgroup/host/hr_print.h"
+#include "mibgroup/host/hr_disk.h"
+#include "mibgroup/host/hr_partition.h"
+#include "mibgroup/host/hr_filesys.h"
+#include "mibgroup/host/hr_swrun.h"
+#include "mibgroup/host/hr_swinst.h"
+#endif
+
+#ifdef USING_RMON_MODULE
+#include "mibgroup/Rmon/rows.h"
+#include "mibgroup/Rmon/agutil.h"
+#include "mibgroup/Rmon/statistics.h"
+#include "mibgroup/Rmon/alarm.h"
+#include "mibgroup/Rmon/history.h"
+#include "mibgroup/Rmon/event.h"
+#endif
+
+#ifdef USING_DISMAN_EVENT_MODULE
+#include "mibgroup/disman/event/mteEventConf.h"
+#include "mibgroup/disman/event/mteEvent.h"
+#include "mibgroup/disman/event/mteEventNotificationTable.h"
+#include "mibgroup/disman/event/mteEventSetTable.h"
+#include "mibgroup/disman/event/mteEventTable.h"
+#include "mibgroup/disman/event/mteObjectsConf.h"
+#include "mibgroup/disman/event/mteObjects.h"
+#include "mibgroup/disman/event/mteObjectsTable.h"
+#include "mibgroup/disman/event/mteScalars.h"
+#include "mibgroup/disman/event/mteTriggerBooleanTable.h"
+#include "mibgroup/disman/event/mteTriggerConf.h"
+#include "mibgroup/disman/event/mteTriggerDeltaTable.h"
+#include "mibgroup/disman/event/mteTriggerExistenceTable.h"
+#include "mibgroup/disman/event/mteTrigger.h"
+#include "mibgroup/disman/event/mteTriggerTable.h"
+#include "mibgroup/disman/event/mteTriggerThresholdTable.h"
+#endif
+
+#ifdef USING_SMUX_MODULE
+#include "mibgroup/smux/smux.h"
+#endif
+
+#include "mibgroup/mibII/route_write.h"
+#include "mibgroup/util_funcs.h"
+#include "mibgroup/mibII/vacm_context.h"
+#include "mibgroup/mibII/vacm_conf.h"
+#include "mibgroup/utilities/execute.h"
+#include "mibgroup/header_complex.h"
+
+#ifdef USING_AGENTX_MODULE
+#include "mibgroup/agentx/master.h"
+#include "mibgroup/agentx/subagent.h"
+#include "mibgroup/agentx/protocol.h"
+#include "mibgroup/agentx/client.h"
+#include "mibgroup/agentx/master_admin.h"
+#include "mibgroup/agentx/agentx_config.h"
+#endif
+
+#ifdef USING_EXAMPLES_EXAMPLE_MODULE
+#include "mibgroup/examples/example.h"
+#endif
+
+#ifdef USING_EXAMPLES_UCDDEMOPUBLIC_MODULE
+#include "mibgroup/examples/ucdDemoPublic.h"
+#endif
+
+#ifdef USING_WINEXTDLL_MODULE
+#include "mibgroup/winExtDLL.h"
+#endif
+
diff --git a/win32/mib_module_inits.h b/win32/mib_module_inits.h
new file mode 100644
index 0000000..a4b39bc
--- /dev/null
+++ b/win32/mib_module_inits.h
@@ -0,0 +1,120 @@
+/* This file is automatically generated by configure. Do not modify by hand. */
+
+/* don't use hand -- use notepad !! */
+/* The controlling defines are declared in mib_module_config.h */
+
+ if (should_init("system_mib")) init_system_mib();
+ if (should_init("sysORTable")) init_sysORTable();
+
+#ifdef HAVE_WIN32_PLATFORM_SDK
+ if (should_init("at")) init_at();
+ if (should_init("interfaces")) init_interfaces();
+ if (should_init("tcp")) init_tcp();
+ if (should_init("tcpTable")) init_tcpTable();
+ if (should_init("icmp")) init_icmp();
+ if (should_init("ip")) init_ip();
+ if (should_init("udp")) init_udp();
+ if (should_init("udpTable")) init_udpTable();
+ if (should_init("var_route")) init_var_route();
+#endif
+
+ if (should_init("snmp_mib")) init_snmp_mib();
+ if (should_init("vacm_vars")) init_vacm_vars();
+ if (should_init("setSerialNo")) init_setSerialNo();
+#ifdef USING_UCD_SNMP_MODULE
+ if (should_init("proc")) init_proc();
+ if (should_init("versioninfo")) init_versioninfo();
+ if (should_init("pass")) init_pass();
+ if (should_init("pass_persist")) init_pass_persist();
+#ifndef _MSC_VER
+ if (should_init("disk")) init_disk();
+#endif
+ if (should_init("loadave")) init_loadave();
+ if (should_init("extensible")) init_extensible();
+ if (should_init("extend")) init_extend();
+ if (should_init("errormib")) init_errormib();
+ if (should_init("file")) init_file();
+ if (should_init("proxy")) init_proxy();
+#endif
+ if (should_init("snmpEngine")) init_snmpEngine();
+ if (should_init("snmpMPDStats")) init_snmpMPDStats();
+ if (should_init("usmStats")) init_usmStats();
+ if (should_init("usmUser")) init_usmUser();
+ if (should_init("snmpNotifyTable")) init_snmpNotifyTable();
+ if (should_init("snmpNotifyFilterTable")) init_snmpNotifyFilterTable();
+ if (should_init("snmpNotifyFilterProfileTable")) init_snmpNotifyFilterProfileTable();
+ if (should_init("snmpTargetAddrEntry")) init_snmpTargetAddrEntry();
+ if (should_init("snmpTargetParamsEntry")) init_snmpTargetParamsEntry();
+ if (should_init("target_counters")) init_target_counters();
+ if (should_init("nsTransactionTable")) init_nsTransactionTable();
+ if (should_init("nsModuleTable")) init_nsModuleTable();
+ if (should_init("nsDebug")) init_nsDebug();
+ if (should_init("nsCache")) init_nsCache();
+ if (should_init("nsLogging")) init_nsLogging();
+
+#ifdef USING_HOST_MODULE
+ if (should_init("hr_system")) init_hr_system();
+ if (should_init("hr_storage")) init_hr_storage();
+ if (should_init("hr_device")) init_hr_device();
+ if (should_init("hr_other")) init_hr_other();
+ if (should_init("hr_proc")) init_hr_proc();
+ if (should_init("hr_network")) init_hr_network();
+ if (should_init("hr_print")) init_hr_print();
+ if (should_init("hr_disk")) init_hr_disk();
+ if (should_init("hr_partition")) init_hr_partition();
+ if (should_init("hr_filesys")) init_hr_filesys();
+ if (should_init("hr_swrun")) init_hr_swrun();
+ if (should_init("hr_swinst")) init_hr_swinst();
+#endif
+
+#ifdef USING_RMON_MODULE
+ if (should_init("rows")) init_rows();
+ if (should_init("agutil")) init_agutil();
+ if (should_init("statistics")) init_statistics();
+ if (should_init("alarm")) init_alarm();
+ if (should_init("history")) init_history();
+ if (should_init("event")) init_event();
+#endif
+
+ if (should_init("override")) init_override();
+
+#ifdef USING_DISMAN_EVENT_MODULE
+ if (should_init("mteTrigger")) init_mteTrigger();
+ if (should_init("mteTriggerConf")) init_mteTriggerConf();
+ if (should_init("mteTriggerTable")) init_mteTriggerTable();
+ if (should_init("mteTriggerDeltaTable")) init_mteTriggerDeltaTable();
+ if (should_init("mteTriggerExistenceTable")) init_mteTriggerExistenceTable();
+ if (should_init("mteTriggerBooleanTable")) init_mteTriggerBooleanTable();
+ if (should_init("mteTriggerThresholdTable")) init_mteTriggerThresholdTable();
+ if (should_init("mteObjects")) init_mteObjects();
+ if (should_init("mteObjectsConf")) init_mteObjectsConf();
+ if (should_init("mteObjectsTable")) init_mteObjectsTable();
+ if (should_init("mteEvent")) init_mteEvent();
+ if (should_init("mteEventConf")) init_mteEventConf();
+ if (should_init("mteEventTable")) init_mteEventTable();
+ if (should_init("mteEventNotificationTable")) init_mteEventNotificationTable();
+ if (should_init("mteEventSetTable")) init_mteEventSetTable();
+#endif
+
+ if (should_init("vacm_context")) init_vacm_context();
+
+#ifdef USING_SMUX_MODULE
+ if (should_init("smux")) init_smux();
+#endif
+
+#ifdef USING_EXAMPLES_EXAMPLE_MODULE
+ if (should_init("example")) init_example();
+#endif
+
+#ifdef USING_EXAMPLES_UCDDEMOPUBLIC_MODULE
+ if (should_init("ucdDemoPublic")) init_ucdDemoPublic();
+#endif
+
+#ifdef USING_MIBII_IPV6_MODULE
+ if (should_init("ipv6")) init_ipv6();
+#endif
+
+#ifdef USING_WINEXTDLL_MODULE
+ if (should_init("winExtDLL")) init_winExtDLL();
+#endif
+
diff --git a/win32/mib_module_shutdown.h b/win32/mib_module_shutdown.h
new file mode 100644
index 0000000..36a6dd4
--- /dev/null
+++ b/win32/mib_module_shutdown.h
@@ -0,0 +1,11 @@
+/* This file is automatically generated by configure. Do not modify by hand. */
+ if (should_init("proxy")) shutdown_proxy();
+ if (should_init("snmpNotifyFilterTable")) shutdown_snmpNotifyFilterTable();
+
+#ifdef USING_UCD_SNMP_MODULE
+ if (should_init("pass_persist")) shutdown_pass_persist();
+#endif
+
+#ifdef USING_WINEXTDLL_MODULE
+ if (should_init("winExtDLL")) shutdown_winExtDLL();
+#endif
diff --git a/win32/net-snmp/agent/agent_module_config.h b/win32/net-snmp/agent/agent_module_config.h
new file mode 100644
index 0000000..c2b3e3e
--- /dev/null
+++ b/win32/net-snmp/agent/agent_module_config.h
@@ -0,0 +1,32 @@
+/* This file is automatically generated by configure. Do not modify by hand. */
+/* Define if compiling with the snmpv3/usmConf module files. */
+#define USING_SNMPV3_USMCONF_MODULE 1
+
+#ifdef USING_AGENTX_MODULE
+
+/* Define if compiling with the agentx/master module files. */
+#define USING_AGENTX_MASTER_MODULE 1
+
+/* Define if compiling with the agentx/subagent module files. */
+#define USING_AGENTX_SUBAGENT_MODULE 1
+
+/* Define if compiling with the agentx/protocol module files. */
+#define USING_AGENTX_PROTOCOL_MODULE 1
+
+/* Define if compiling with the agentx/client module files. */
+#define USING_AGENTX_CLIENT_MODULE 1
+
+/* Define if compiling with the agentx/master_admin module files. */
+#define USING_AGENTX_MASTER_ADMIN_MODULE 1
+
+/* Define if compiling with the agentx/agentx_config module files. */
+#define USING_AGENTX_AGENTX_CONFIG_MODULE 1
+
+#endif /* USING_AGENTX_MODULE */
+
+/* Define if compiling with the mibII/vacm_conf module files. */
+#define USING_MIBII_VACM_CONF_MODULE 1
+
+/* Define if compiling with the utilities/execute module files. */
+#define USING_UTILITIES_EXECUTE_MODULE 1
+
diff --git a/win32/net-snmp/agent/mib_module_config.h b/win32/net-snmp/agent/mib_module_config.h
new file mode 100644
index 0000000..4978dc8
--- /dev/null
+++ b/win32/net-snmp/agent/mib_module_config.h
@@ -0,0 +1,335 @@
+/* This file is automatically generated by configure. Do not modify by hand. */
+
+#ifndef MIB_MODULE_CONFIG_H
+#define MIB_MODULE_CONFIG_H
+
+/* Define if compiling with the mibII module files. */
+#define USING_MIBII_MODULE 1
+
+/* Define if compiling with the ucd_snmp module files. */
+#define USING_UCD_SNMP_MODULE 1
+
+/* Define if compiling with the snmpv3mibs module files. */
+#define USING_SNMPV3MIBS_MODULE 1
+
+/* Define if compiling with the notification module files. */
+#define USING_NOTIFICATION_MODULE 1
+
+/* Define if compiling with the disman/event module files. */
+#define USING_DISMAN_EVENT_MODULE 1
+
+/* Define if compiling with the notification-log-mib module files. */
+#ifdef HAVE_WIN32_PLATFORM_SDK
+#define USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE 1
+#endif
+
+/* Define if compiling with the target module files. */
+#define USING_TARGET_MODULE 1
+
+/* Define if compiling with the examples/ucdDemoPublic module files. */
+#define USING_EXAMPLES_UCDDEMOPUBLIC_MODULE 1
+
+/* Define if compiling with the examples/example module files. */
+#define USING_EXAMPLES_EXAMPLE_MODULE 1
+
+/* Define if compiling with the agent_mibs module files. */
+#define USING_AGENT_MIBS_MODULE 1
+
+/* Define if compiling with the agent_mibs module files. */
+#define USING_AGENT_MIBS_MODULE 1
+
+/* Define if compiling with the utilities module files. */
+#define USING_UTILITIES_MODULE 1
+
+/* Define if compiling with the mibII/ipv6 module files. */
+/* #undef USING_MIBII_IPV6_MODULE */
+
+/* Define if compiling with the mibII/system_mib module files. */
+#define USING_MIBII_SYSTEM_MIB_MODULE 1
+
+/* Define if compiling with the mibII/sysORTable module files. */
+#define USING_MIBII_SYSORTABLE_MODULE 1
+
+/* Define if compiling with the mibII/at module files. */
+#define USING_MIBII_AT_MODULE 1
+
+/* Define if compiling with the mibII/interfaces module files. */
+#define USING_MIBII_INTERFACES_MODULE 1
+
+/* Define if compiling with the mibII/snmp_mib module files. */
+#define USING_MIBII_SNMP_MIB_MODULE 1
+
+/* Define if compiling with the mibII/tcp module files. */
+#define USING_MIBII_TCP_MODULE 1
+
+/* Define if compiling with the mibII/icmp module files. */
+#define USING_MIBII_ICMP_MODULE 1
+
+/* Define if compiling with the mibII/ip module files. */
+#define USING_MIBII_IP_MODULE 1
+
+/* Define if compiling with the mibII/udp module files. */
+#define USING_MIBII_UDP_MODULE 1
+
+/* Define if compiling with the mibII/vacm_vars module files. */
+#define USING_MIBII_VACM_VARS_MODULE 1
+
+/* Define if compiling with the mibII/setSerialNo module files. */
+#define USING_MIBII_SETSERIALNO_MODULE 1
+
+
+#ifdef USING_UCD_SNMP_MODULE
+
+/* Define if compiling with the ucd-snmp/memory module files. */
+#define USING_UCD_SNMP_MEMORY_MODULE 1
+
+/* Define if compiling with the ucd-snmp/vmstat module files. */
+#define USING_UCD_SNMP_VMSTAT_MODULE 1
+
+/* Define if compiling with the ucd-snmp/proc module files. */
+#define USING_UCD_SNMP_PROC_MODULE 1
+
+/* Define if compiling with the ucd-snmp/versioninfo module files. */
+#define USING_UCD_SNMP_VERSIONINFO_MODULE 1
+
+/* Define if compiling with the ucd-snmp/pass module files. */
+#define USING_UCD_SNMP_PASS_MODULE 1
+
+/* Define if compiling with the ucd-snmp/pass_persist module files. */
+#define USING_UCD_SNMP_PASS_PERSIST_MODULE 1
+
+/* Define if compiling with the ucd-snmp/disk module files. */
+#define USING_UCD_SNMP_DISK_MODULE 1
+
+/* Define if compiling with the ucd-snmp/loadave module files. */
+#define USING_UCD_SNMP_LOADAVE_MODULE 1
+
+/* Define if compiling with the ucd-snmp/extensible module files. */
+#define USING_UCD_SNMP_EXTENSIBLE_MODULE 1
+
+/* Define if compiling with the agent/extend module files. */
+#define USING_AGENT_EXTEND_MODULE 1
+
+/* Define if compiling with the ucd-snmp/errormib module files. */
+#define USING_UCD_SNMP_ERRORMIB_MODULE 1
+
+/* Define if compiling with the ucd-snmp/file module files. */
+#define USING_UCD_SNMP_FILE_MODULE 1
+
+/* Define if compiling with the ucd-snmp/dlmod module files. */
+#define USING_UCD_SNMP_DLMOD_MODULE 1
+
+/* Define if compiling with the ucd-snmp/proxy module files. */
+#define USING_UCD_SNMP_PROXY_MODULE 1
+
+#endif /* USING_UCD_SNMP_MODULE */
+
+
+#if HAVE_REGEX_H
+/* Define if compiling with the ucd-snmp/logmatch module files. */
+#define USING_UCD_SNMP_LOGMATCH_MODULE 1
+#endif
+
+/* Define if compiling with the snmpv3/snmpEngine module files. */
+#define USING_SNMPV3_SNMPENGINE_MODULE 1
+
+/* Define if compiling with the snmpv3/snmpMPDStats module files. */
+#define USING_SNMPV3_SNMPMPDSTATS_MODULE 1
+
+/* Define if compiling with the snmpv3/usmStats module files. */
+#define USING_SNMPV3_USMSTATS_MODULE 1
+
+/* Define if compiling with the snmpv3/usmUser module files. */
+#define USING_SNMPV3_USMUSER_MODULE 1
+
+/* Define if compiling with the notification/snmpNotifyTable module files. */
+#define USING_NOTIFICATION_SNMPNOTIFYTABLE_MODULE 1
+
+/* Define if compiling with the notification/snmpNotifyFilterTable module files. */
+#define USING_NOTIFICATION_SNMPNOTIFYFILTERTABLE_MODULE 1
+
+/* Define if compiling with the notification/snmpNotifyFilterProfileTable module files. */
+#define USING_NOTIFICATION_SNMPNOTIFYFILTERPROFILETABLE_MODULE 1
+
+/* Define if compiling with the target/snmpTargetAddrEntry module files. */
+#define USING_TARGET_SNMPTARGETADDRENTRY_MODULE 1
+
+/* Define if compiling with the target/snmpTargetParamsEntry module files. */
+#define USING_TARGET_SNMPTARGETPARAMSENTRY_MODULE 1
+
+/* Define if compiling with the target/target module files. */
+#define USING_TARGET_TARGET_MODULE 1
+
+/* Define if compiling with the target/target_counters module files. */
+#define USING_TARGET_TARGET_COUNTERS_MODULE 1
+
+/* Define if compiling with the agent/nsTransactionTable module files. */
+#define USING_AGENT_NSTRANSACTIONTABLE_MODULE 1
+
+/* Define if compiling with the agent/nsModuleTable module files. */
+#define USING_AGENT_NSMODULETABLE_MODULE 1
+
+/* Define if compiling with the agent/nsDebug module files. */
+#define USING_AGENT_NSDEBUG_MODULE 1
+
+/* Define if compiling with the agent/nsCache module files. */
+#define USING_AGENT_NSCACHE_MODULE 1
+
+/* Define if compiling with the agent/nsLogging module files. */
+#define USING_AGENT_NSLOGGING_MODULE 1
+
+/* Define if compiling with the utilities/override module files. */
+#define USING_UTILITIES_OVERRIDE_MODULE 1
+
+
+#ifdef USING_HOST_MODULE
+
+/* Define if compiling with the host/hr_system module files. */
+#define USING_HOST_HR_SYSTEM_MODULE 1
+
+/* Define if compiling with the host/hr_storage module files. */
+#define USING_HOST_HR_STORAGE_MODULE 1
+
+/* Define if compiling with the host/hr_device module files. */
+#define USING_HOST_HR_DEVICE_MODULE 1
+
+/* Define if compiling with the host/hr_other module files. */
+#define USING_HOST_HR_OTHER_MODULE 1
+
+/* Define if compiling with the host/hr_proc module files. */
+#define USING_HOST_HR_PROC_MODULE 1
+
+/* Define if compiling with the host/hr_network module files. */
+#define USING_HOST_HR_NETWORK_MODULE 1
+
+/* Define if compiling with the host/hr_print module files. */
+#define USING_HOST_HR_PRINT_MODULE 1
+
+/* Define if compiling with the host/hr_disk module files. */
+#define USING_HOST_HR_DISK_MODULE 1
+
+/* Define if compiling with the host/hr_partition module files. */
+#define USING_HOST_HR_PARTITION_MODULE 1
+
+/* Define if compiling with the host/hr_filesys module files. */
+#define USING_HOST_HR_FILESYS_MODULE 1
+
+/* Define if compiling with the host/hr_swrun module files. */
+#define USING_HOST_HR_SWRUN_MODULE 1
+
+/* Define if compiling with the host/hr_swinst module files. */
+#define USING_HOST_HR_SWINST_MODULE 1
+
+#endif /* USING_HOST_MODULE */
+
+
+#ifdef USING_RMON_MODULE
+
+/* Define if compiling with the Rmon/rows module files. */
+#define USING_RMON_ROWS_MODULE 1
+
+/* Define if compiling with the Rmon/agutil module files. */
+#define USING_RMON_AGUTIL_MODULE 1
+
+/* Define if compiling with the Rmon/statistics module files. */
+#define USING_RMON_STATISTICS_MODULE 1
+
+/* Define if compiling with the Rmon/alarm module files. */
+#define USING_RMON_ALARM_MODULE 1
+
+/* Define if compiling with the Rmon/history module files. */
+#define USING_RMON_HISTORY_MODULE 1
+
+/* Define if compiling with the Rmon/event module files. */
+#define USING_RMON_EVENT_MODULE 1
+
+#endif /* USING_RMON_MODULE */
+
+
+#ifdef USING_DISMAN_EVENT_MODULE
+
+/* Define if compiling with the disman/event/mteScalars module files. */
+#define USING_DISMAN_EVENT_MTESCALARS_MODULE 1
+
+/* Define if compiling with the disman/event/mteTrigger module files. */
+#define USING_DISMAN_EVENT_MTETRIGGER_MODULE 1
+
+/* Define if compiling with the disman/event/mteTriggerTable module files. */
+#define USING_DISMAN_EVENT_MTETRIGGERTABLE_MODULE 1
+
+/* Define if compiling with the disman/event/mteTriggerDeltaTable module files. */
+#define USING_DISMAN_EVENT_MTETRIGGERDELTATABLE_MODULE 1
+
+/* Define if compiling with the disman/event/mteTriggerExistenceTable module files. */
+#define USING_DISMAN_EVENT_MTETRIGGEREXISTENCETABLE_MODULE 1
+
+/* Define if compiling with the disman/event/mteTriggerBooleanTable module files. */
+#define USING_DISMAN_EVENT_MTETRIGGERBOOLEANTABLE_MODULE 1
+
+/* Define if compiling with the disman/event/mteTriggerThresholdTable module files. */
+#define USING_DISMAN_EVENT_MTETRIGGERTHRESHOLDTABLE_MODULE 1
+
+/* Define if compiling with the disman/event/mteTriggerConf module files. */
+#define USING_DISMAN_EVENT_MTETRIGGERCONF_MODULE 1
+
+/* Define if compiling with the disman/event/mteEvent module files. */
+#define USING_DISMAN_EVENT_MTEEVENT_MODULE 1
+
+/* Define if compiling with the disman/event/mteEventTable module files. */
+#define USING_DISMAN_EVENT_MTEEVENTTABLE_MODULE 1
+
+/* Define if compiling with the disman/event/mteEventSetTable module files. */
+#define USING_DISMAN_EVENT_MTEEVENTSETTABLE_MODULE 1
+
+/* Define if compiling with the disman/event/mteEventNotificationTable module files. */
+#define USING_DISMAN_EVENT_MTEEVENTNOTIFICATIONTABLE_MODULE 1
+
+/* Define if compiling with the disman/event/mteEventConf module files. */
+#define USING_DISMAN_EVENT_MTEEVENTCONF_MODULE 1
+
+/* Define if compiling with the disman/event/mteObjects module files. */
+#define USING_DISMAN_EVENT_MTEOBJECTS_MODULE 1
+
+/* Define if compiling with the disman/event/mteObjectsTable module files. */
+#define USING_DISMAN_EVENT_MTEOBJECTSTABLE_MODULE 1
+
+/* Define if compiling with the disman/event/mteObjectsConf module files. */
+#define USING_DISMAN_EVENT_MTEOBJECTSCONF_MODULE 1
+
+#endif /* USING_DISMAN_EVENT_MODULE */
+
+#ifdef USING_SMUX_MODULE
+
+/* Define if compiling with the smux/smux module files. */
+#define USING_SMUX_SMUX_MODULE 1
+
+#endif /* USING_SMUX_MODULE */
+
+
+/* Define if compiling with the mibII/var_route module files. */
+#define USING_MIBII_VAR_ROUTE_MODULE 1
+
+/* Define if compiling with the mibII/route_write module files. */
+#define USING_MIBII_ROUTE_WRITE_MODULE 1
+
+/* Define if compiling with the util_funcs module files. */
+#define USING_UTIL_FUNCS_MODULE 1
+
+/* Define if compiling with the mibII/tcpTable module files. */
+#define USING_MIBII_TCPTABLE_MODULE 1
+
+/* Define if compiling with the mibII/ipAddr module files. */
+#define USING_MIBII_IPADDR_MODULE 1
+
+/* Define if compiling with the mibII/udpTable module files. */
+#define USING_MIBII_UDPTABLE_MODULE 1
+
+/* Define if compiling with the mibII/vacm_context module files. */
+#define USING_MIBII_VACM_CONTEXT_MODULE 1
+
+/* Define if compiling with the header_complex module files. */
+#define USING_HEADER_COMPLEX_MODULE 1
+
+
+#endif /* MIB_MODULE_CONFIG_H */
+
diff --git a/win32/net-snmp/library/snmpv3-security-includes.h b/win32/net-snmp/library/snmpv3-security-includes.h
new file mode 100644
index 0000000..5dd2a45
--- /dev/null
+++ b/win32/net-snmp/library/snmpv3-security-includes.h
@@ -0,0 +1,2 @@
+/* This file is automatically generated by configure. Do not modify by hand. */
+#include <net-snmp/library/snmpusm.h>
diff --git a/win32/net-snmp/net-snmp-config.h b/win32/net-snmp/net-snmp-config.h
new file mode 100644
index 0000000..7791ee0
--- /dev/null
+++ b/win32/net-snmp/net-snmp-config.h
@@ -0,0 +1,1811 @@
+/* include/net-snmp/net-snmp-config.h.in. Generated from configure.in by autoheader. */
+/* modified by hand with care. */
+
+#ifndef NET_SNMP_CONFIG_H
+#define NET_SNMP_CONFIG_H
+
+/* _MSC_VER values
+ 1600 = 10.0 (2010)
+ 1500 = 9.0 (2008)
+ 1400 = 8.0 (2005)
+ 1310 = 7.1 (2003)
+ 1300 = 7.0 (2002)
+ 1200 = 6.0
+*/
+
+#ifdef _MSC_VER
+/* Disable warning 4018: signed/unsigned mismatch. */
+#pragma warning (disable: 4018)
+#endif
+
+/* Automatically set by Windows perl Configure script.
+ * When compiling with the MSVC workspace, this must be set manually.
+ * See the PACKAGE_VERSION variable in Unix /configure script
+*/
+#ifndef PACKAGE_VERSION
+#define PACKAGE_VERSION "unknown"
+#endif
+
+/* Define HAVE_WIN32_PLATFORM_SDK if you have:
+ * Microsoft Visual Studio MSVC 6.0 and the Platform SDK (PSDK)
+ * Microsoft Visual Studio.Net 2002
+ * Microsoft Visual Studio.Net 2003
+ */
+#define HAVE_WIN32_PLATFORM_SDK 1
+
+/* Define NETSNMP_ENABLE_IPV6 to enable IPv6. IPv6 is only available on
+ * Windows XP and higher. */
+/* #undef NETSNMP_ENABLE_IPV6 */
+
+/* Only use Windows API functions available on Windows 2000 SP4 or later.
+ * We need at least SP1 for some IPv6 defines in ws2ipdef.h
+ */
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x501 /*_WIN32_WINNT_WIN2K*/
+#else
+#if _WIN32_WINNT < 0x501
+#error _WIN32_WINNT is too low - it should be set to at least 0x501.
+#endif
+#endif
+
+#define INSTALL_BASE "c:/usr"
+
+/* config.h: a general config file */
+
+/* Default (SNMP) version number for the tools to use */
+#define NETSNMP_DEFAULT_SNMP_VERSION 3
+
+/* don't change these values! */
+#define NETSNMP_SNMPV1 0xAAAA /* readable by anyone */
+#define NETSNMP_SNMPV2ANY 0xA000 /* V2 Any type (includes NoAuth) */
+#define NETSNMP_SNMPV2AUTH 0x8000 /* V2 Authenticated requests only */
+
+/* default list of mibs to load */
+
+#define NETSNMP_DEFAULT_MIBS "IP-MIB;IF-MIB;TCP-MIB;UDP-MIB;HOST-RESOURCES-MIB;SNMPv2-MIB;RFC1213-MIB;NOTIFICATION-LOG-MIB;UCD-SNMP-MIB;UCD-DEMO-MIB;SNMP-TARGET-MIB;NET-SNMP-AGENT-MIB;DISMAN-EVENT-MIB;SNMP-VIEW-BASED-ACM-MIB;SNMP-COMMUNITY-MIB;SNMP-FRAMEWORK-MIB;SNMP-MPD-MIB;SNMP-USER-BASED-SM-MIB;SNMP-NOTIFICATION-MIB;SNMPv2-TM"
+
+/* default location to look for mibs to load using the above tokens
+ and/or those in the MIBS envrionment variable*/
+#define NETSNMP_DEFAULT_MIBDIRS INSTALL_BASE ## "/share/snmp/mibs"
+
+/* default mib files to load, specified by path. */
+/* #undef NETSNMP_DEFAULT_MIBFILES */
+
+/* should we compile to use special opaque types: float, double,
+ counter64, i64, ui64, union? */
+#define NETSNMP_WITH_OPAQUE_SPECIAL_TYPES 1
+
+/* comment the next line if you are compiling with libsnmp.h
+ and are not using the UC-Davis SNMP library. */
+#define UCD_SNMP_LIBRARY 1
+
+/* define if you want to compile support for both authentication and
+ privacy support. */
+#define NETSNMP_ENABLE_SCAPI_AUTHPRIV 1
+
+/* define if you are using the MD5 code ...*/
+/* #undef NETSNMP_USE_INTERNAL_MD5 */
+
+/* define if you are using the codeS11 library ...*/
+/* #undef NETSNMP_USE_PKCS11 */
+
+/* add in recent CMU library extensions (not complete) */
+/* #undef CMU_COMPATIBLE */
+
+/* add in recent resource lock functions (not complete) */
+/* #undef NETSNMP_REENTRANT */
+
+/* debugging stuff */
+/* if defined, we optimize the code to exclude all debugging calls. */
+/* #undef NETSNMP_NO_DEBUGGING */
+/* ignore the -D flag and always print debugging information */
+#define NETSNMP_ALWAYS_DEBUG 0
+
+/* reverse encoding BER packets is both faster and more efficient in space. */
+#define NETSNMP_USE_REVERSE_ASNENCODING 1
+#define NETSNMP_DEFAULT_ASNENCODING_DIRECTION 1 /* 1 = reverse, 0 = forwards */
+
+/* NETSNMP_PERSISTENT_DIRECTORY: If defined, the library is capabile of saving
+ persisant information to this directory in the form of configuration
+ lines: NETSNMP_PERSISTENT_DIRECTORY/NAME.persistent.conf */
+#define NETSNMP_PERSISTENT_DIRECTORY INSTALL_BASE ## "/snmp/persist"
+
+/* NETSNMP_PERSISTENT_MASK: the umask permissions to set up persistent files with */
+/* #undef NETSNMP_PERSISTENT_MASK -- no win32 umask */
+
+/* NETSNMP_AGENT_DIRECTORY_MODE: the mode the agents should use to create
+ directories with. Since the data stored here is probably sensitive, it
+ probably should be read-only by root/administrator. */
+#define NETSNMP_AGENT_DIRECTORY_MODE 0700
+
+/* NETSNMP_MAX_PERSISTENT_BACKUPS:
+ * The maximum number of persistent backups the library will try to
+ * read from the persistent cache directory. If an application fails to
+ * close down successfully more than this number of times, data will be lost.
+ */
+#define NETSNMP_MAX_PERSISTENT_BACKUPS 10
+
+
+/* define if you are embedding perl in the main agent */
+/* #undef NETSNMP_EMBEDDED_PERL */
+
+#if notused
+/* define the system type include file here */
+#define NETSNMP_SYSTEM_INCLUDE_FILE <net-snmp/system/generic.h>
+
+/* define the machine (cpu) type include file here */
+#define NETSNMP_MACHINE_INCLUDE_FILE <net-snmp/machine/generic.h>
+#endif
+
+/* SNMPLIBDIR contains important files */
+
+#define SNMPLIBPATH INSTALL_BASE ## "/lib"
+#define SNMPSHAREPATH INSTALL_BASE ## "/share/snmp"
+#define SNMPCONFPATH INSTALL_BASE ## "/etc/snmp"
+#define SNMPDLMODPATH INSTALL_BASE ## "/lib/dlmod"
+
+/* NETSNMP_LOGFILE: If defined it closes stdout/err/in and opens this in out/err's
+ place. (stdin is closed so that sh scripts won't wait for it) */
+/* #undef NETSNMP_LOGFILE */
+
+/* default system contact */
+#define NETSNMP_SYS_CONTACT "unknown"
+
+/* system location */
+#define NETSNMP_SYS_LOC "unknown"
+
+/* Use libwrap to handle allow/deny hosts? */
+/* #undef NETSNMP_USE_LIBWRAP */
+
+/* Use dmalloc to do malloc debugging? */
+/* #undef HAVE_DMALLOC_H */
+
+/* location of UNIX kernel */
+#define KERNEL_LOC "unknown"
+
+/* location of mount table list */
+#define ETC_MNTTAB "unknown"
+
+/* location of swap device (ok if not found) */
+/* #undef DMEM_LOC */
+
+/* Command to generate ps output, the final column must be the process
+ name withOUT arguments */
+#define PSCMD "/bin/ps"
+
+/* Where is the uname command */
+#define UNAMEPROG "/bin/uname"
+
+/* pattern for temporary file names */
+#define NETSNMP_TEMP_FILE_PATTERN INSTALL_BASE ## "/temp/snmpdXXXXXX"
+
+/* testing code sections. */
+/* #undef NETSNMP_ENABLE_TESTING_CODE */
+
+/* If you don't have root access don't exit upon kmem errors */
+/* #undef NETSNMP_NO_ROOT_ACCESS */
+
+/* If we don't want to use kmem. */
+/* #undef NETSNMP_NO_KMEM_USAGE */
+
+/* If you don't want the agent to report on variables it doesn't have data for */
+#define NETSNMP_NO_DUMMY_VALUES 1
+
+/* Define if statfs takes 2 args and the second argument has
+ type struct fs_data. [Ultrix] */
+/* #undef STAT_STATFS_FS_DATA */
+
+/* Define if the TCP timer constants in <netinet/tcp_timer.h>
+ depend on the integer variable `hz'. [FreeBSD 4.x] */
+/* #undef TCPTV_NEEDS_HZ */
+
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define to 1 if using `alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Define if DES encryption should not be supported */
+/* #undef NETSNMP_DISABLE_DES */
+
+/* Define if MD5 authentication should not be supported */
+/* #undef NETSNMP_DISABLE_MD5 */
+
+/* Define if mib loading and parsing code should not be included */
+/* #undef NETSNMP_DISABLE_MIB_LOADING */
+
+/* Define if SNMPv1 code should not be included */
+/* #undef NETSNMP_DISABLE_SNMPV1 */
+
+/* Define if SNMPv2c code should not be included */
+/* #undef NETSNMP_DISABLE_SNMPV2C */
+
+/* Define to 1 if you have the `AES_cfb128_encrypt' function. */
+/* #undef HAVE_AES_CFB128_ENCRYPT */
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+/* #undef HAVE_ALLOCA */
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+/* #undef HAVE_ARPA_INET_H */
+
+/* Define to 1 if you have the <asm/page.h> header file. */
+/* #undef HAVE_ASM_PAGE_H */
+
+/* Define to 1 if you have the `cgetnext' function. */
+/* #undef HAVE_CGETNEXT */
+
+/* Define to 1 if you have the <crtdbg.h> header file. */
+#define HAVE_CRTDBG_H 1
+
+/* Define to 1 if you have the <direct.h> header file. */
+#define HAVE_DIRECT_H 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_DIRENT_H */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the `dlopen' function. */
+/* #undef HAVE_DLOPEN */
+
+/* Define to 1 if you have the <err.h> header file. */
+/* #undef HAVE_ERR_H */
+
+/* Define to 1 if you have the `eval_pv' function. */
+/* #undef HAVE_EVAL_PV */
+
+/* Define to 1 if you have the `execv' function. */
+/* #undef HAVE_EXECV */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `fork' function. */
+/* #undef HAVE_FORK */
+
+/* Define to 1 if you have the <fstab.h> header file. */
+/* #undef HAVE_FSTAB_H */
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+/* #undef HAVE_GETADDRINFO */
+
+/* Define to 1 if you have the `getdtablesize' function. */
+/* #undef HAVE_GETDTABLESIZE */
+
+/* Define to 1 if you have the `getfsstat' function. */
+/* #undef HAVE_GETFSSTAT */
+
+/* Define to 1 if you have the `getgrnam' function. */
+/* #undef HAVE_GETGRNAM */
+
+/* Define to 1 if you have the `gethostname' function. */
+#define HAVE_GETHOSTNAME 1
+
+/* Define to 1 if you have the `getipnodebyname' function. */
+/* #undef HAVE_GETIPNODEBYNAME */
+
+/* Define to 1 if you have the `getloadavg' function. */
+/* #undef HAVE_GETLOADAVG */
+
+/* Define to 1 if you have the `getmntent' function. */
+/* #undef HAVE_GETMNTENT */
+
+/* Define to 1 if you have the <getopt.h> header file. */
+/* #undef HAVE_GETOPT_H */
+
+/* Define to 1 if you have the `getpagesize' function. */
+/* #undef HAVE_GETPAGESIZE */
+
+/* Define to 1 if you have the `getpid' function. */
+#define HAVE_GETPID 1
+
+/* Define to 1 if you have the `getpwnam' function. */
+/* #undef HAVE_GETPWNAM */
+
+/* Define to 1 if you have the `gettimeofday' function. */
+/* #undef HAVE_GETTIMEOFDAY */
+
+/* Define to 1 if you have the <grp.h> header file. */
+/* #undef HAVE_GRP_H */
+
+/* Define to 1 if you have the `if_freenameindex' function. */
+/* #undef HAVE_IF_FREENAMEINDEX */
+
+/* Define to 1 if you have the `if_nameindex' function. */
+/* #undef HAVE_IF_NAMEINDEX */
+
+/* Define to 1 if you have the <inet/mib2.h> header file. */
+/* #undef HAVE_INET_MIB2_H */
+
+#ifdef HAVE_WIN32_PLATFORM_SDK
+/* Define to 1 if you have the <iphlpapi.h> header file. */
+#define HAVE_IPHLPAPI_H
+#endif
+
+/* Define to 1 if the system has the type `int32_t'. */
+#define HAVE_INT32_T 1
+
+/* define if you have type uint32_t */
+#define HAVE_UINT32_T 1
+
+/* define if you have type u_int32_t */
+#undef HAVE_U_INT32_T
+
+/* define if you have type int64_t */
+#define HAVE_INT64_T 1
+
+/* define if you have type uint64_t */
+#define HAVE_UINT64_T 1
+
+/* define if you have type u_int64_t */
+#undef HAVE_U_INT64_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Define to 1 if you have the <ioctls.h> header file. */
+/* #undef HAVE_IOCTLS_H */
+
+/* Define to 1 if you have the <io.h> header file. */
+#define HAVE_IO_H 1
+
+/* Define to 1 if you have the `knlist' function. */
+/* #undef HAVE_KNLIST */
+
+/* Define to 1 if you have the <kstat.h> header file. */
+/* #undef HAVE_KSTAT_H */
+
+/* Define to 1 if you have the `kvm_getprocs' function. */
+/* #undef HAVE_KVM_GETPROCS */
+
+/* Define to 1 if you have the <kvm.h> header file. */
+/* #undef HAVE_KVM_H */
+
+/* Define to 1 if you have the `kvm_openfiles' function. */
+/* #undef HAVE_KVM_OPENFILES */
+
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+/* #undef HAVE_LIBCRYPTO */
+
+/* Define to 1 if you have the `efence' library (-lefence). */
+/* #undef HAVE_LIBEFENCE */
+
+/* Define to 1 if you have the `elf' library (-lelf). */
+/* #undef HAVE_LIBELF */
+
+/* Define to 1 if you have the `kstat' library (-lkstat). */
+/* #undef HAVE_LIBKSTAT */
+
+/* Define to 1 if you have the `m' library (-lm). */
+/* #undef HAVE_LIBM */
+
+/* Define to 1 if you have the `mld' library (-lmld). */
+/* #undef HAVE_LIBMLD */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the <libperfstat.h> header file. */
+/* #undef HAVE_LIBPERFSTAT_H */
+
+/* Define to 1 if you have the `pkcs11' library (-lpkcs11). */
+/* #undef HAVE_LIBPKCS11 */
+
+/* Define to 1 if you have the `RSAglue' library (-lRSAglue). */
+/* #undef HAVE_LIBRSAGLUE */
+
+/* Define to 1 if you have the `rsaref' library (-lrsaref). */
+/* #undef HAVE_LIBRSAREF */
+
+/* Define to 1 if you have the `sensors' library (-lsensors). */
+/* #undef HAVE_LIBSENSORS */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <linux/hdreg.h> header file. */
+/* #undef HAVE_LINUX_HDREG_H */
+
+/* Define to 1 if you have the <linux/tasks.h> header file. */
+/* #undef HAVE_LINUX_TASKS_H */
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if you have the `lrand48' function. */
+/* #undef HAVE_LRAND48 */
+
+/* Define to 1 if you have the <machine/param.h> header file. */
+/* #undef HAVE_MACHINE_PARAM_H */
+
+/* Define to 1 if you have the <machine/pte.h> header file. */
+/* #undef HAVE_MACHINE_PTE_H */
+
+/* Define to 1 if you have the <machine/types.h> header file. */
+/* #undef HAVE_MACHINE_TYPES_H */
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mkstemp' function. */
+/* #undef HAVE_MKSTEMP */
+
+/* Define to 1 if you have the `mktime' function. */
+/* #undef HAVE_MKTIME */
+
+/* Define to 1 if you have the <mntent.h> header file. */
+/* #undef HAVE_MNTENT_H */
+
+/* Define to 1 if you have the <mtab.h> header file. */
+/* #undef HAVE_MTAB_H */
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <netdb.h> header file. */
+/* #undef HAVE_NETDB_H */
+
+/* Define to 1 if you have the <netinet6/in6_pcb.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_IN6_PCB_H */
+
+/* Define to 1 if you have the <netinet6/in6_var.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_IN6_VAR_H */
+
+/* Define to 1 if you have the <netinet6/ip6_var.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_IP6_VAR_H */
+
+/* Define to 1 if you have the <netinet6/nd6.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_ND6_H */
+
+/* Define to 1 if you have the <netinet6/tcp6_fsm.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_TCP6_FSM_H */
+
+/* Define to 1 if you have the <netinet6/tcp6.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_TCP6_H */
+
+/* Define to 1 if you have the <netinet6/tcp6_timer.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_TCP6_TIMER_H */
+
+/* Define to 1 if you have the <netinet6/tcp6_var.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_TCP6_VAR_H */
+
+/* Define to 1 if you have the <netinet/icmp_var.h> header file. */
+/* #undef HAVE_NETINET_ICMP_VAR_H */
+
+/* Define to 1 if you have the <netinet/if_ether.h> header file. */
+/* #undef HAVE_NETINET_IF_ETHER_H */
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+/* #undef HAVE_NETINET_IN_H */
+
+/* Define to 1 if you have the <netinet/in_systm.h> header file. */
+/* #undef HAVE_NETINET_IN_SYSTM_H */
+
+/* Define to 1 if you have the <netinet/in_var.h> header file. */
+/* #undef HAVE_NETINET_IN_VAR_H */
+
+/* Define to 1 if you have the <netinet/ip6.h> header file. */
+/* #undef HAVE_NETINET_IP6_H */
+
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+/* #undef HAVE_NETINET_IP_H */
+
+/* Define to 1 if you have the <netinet/ip_icmp.h> header file. */
+/* #undef HAVE_NETINET_IP_ICMP_H */
+
+/* Define to 1 if you have the <netinet/icmp6.h> header file. */
+/* #undef HAVE_NETINET_ICMP6_H */
+
+/* Define to 1 if you have the <netinet/ip_var.h> header file. */
+/* #undef HAVE_NETINET_IP_VAR_H */
+
+/* Define to 1 if you have the <netinet/tcpip.h> header file. */
+/* #undef HAVE_NETINET_TCPIP_H */
+
+/* Define to 1 if you have the <netinet/tcp_fsm.h> header file. */
+/* #undef HAVE_NETINET_TCP_FSM_H */
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+/* #undef HAVE_NETINET_TCP_H */
+
+/* Define to 1 if you have the <netinet/tcp_timer.h> header file. */
+/* #undef HAVE_NETINET_TCP_TIMER_H */
+
+/* Define to 1 if you have the <netinet/tcp_var.h> header file. */
+/* #undef HAVE_NETINET_TCP_VAR_H */
+
+/* Define to 1 if you have the <netinet/udp.h> header file. */
+/* #undef HAVE_NETINET_UDP_H */
+
+/* Define to 1 if you have the <netinet/udp_var.h> header file. */
+/* #undef HAVE_NETINET_UDP_VAR_H */
+
+/* Define to 1 if you have the <netipx/ipx.h> header file. */
+/* #undef HAVE_NETIPX_IPX_H */
+
+/* Define to 1 if you have the <net/if_dl.h> header file. */
+/* #undef HAVE_NET_IF_DL_H */
+
+/* Define to 1 if you have the <net/if.h> header file. */
+/* #undef HAVE_NET_IF_H */
+
+/* Define to 1 if you have the <net/if_mib.h> header file. */
+/* #undef HAVE_NET_IF_MIB_H */
+
+/* Define to 1 if you have the <net/if_types.h> header file. */
+/* #undef HAVE_NET_IF_TYPES_H */
+
+/* Define to 1 if you have the <net/if_var.h> header file. */
+/* #undef HAVE_NET_IF_VAR_H */
+
+/* Define to 1 if you have the <net/route.h> header file. */
+/* #undef HAVE_NET_ROUTE_H */
+
+/* Define to 1 if you have the `nlist' function. */
+/* #undef HAVE_NLIST */
+
+/* Define to 1 if you have the <nlist.h> header file. */
+/* #undef HAVE_NLIST_H */
+
+/* Define to 1 if you have the <openssl/aes.h> header file. */
+/* #undef HAVE_OPENSSL_AES_H */
+
+/* Define to 1 if you have the <openssl/des.h> header file. */
+/* #undef HAVE_OPENSSL_DES_H */
+
+/* Define to 1 if you have the <openssl/dh.h> header file. */
+/* #undef HAVE_OPENSSL_DH_H */
+
+/* Define to 1 if you have the <openssl/evp.h> header file. */
+/* #undef HAVE_OPENSSL_EVP_H */
+
+/* Define to 1 if you have the <openssl/hmac.h> header file. */
+/* #undef HAVE_OPENSSL_HMAC_H */
+
+/* Define to 1 if you have the <osreldate.h> header file. */
+/* #undef HAVE_OSRELDATE_H */
+
+/* Define to 1 if you have the <pkginfo.h> header file. */
+/* #undef HAVE_PKGINFO_H */
+
+/* Define to 1 if you have the <pkglocs.h> header file. */
+/* #undef HAVE_PKGLOCS_H */
+
+/* Define if you have <process.h> header file. (Win32-getpid) */
+#define HAVE_PROCESS_H 1
+
+/* Define to 1 if you have the <pthread.h> header file. */
+/* #undef HAVE_PTHREAD_H */
+
+/* Define to 1 if you have the <pwd.h> header file. */
+/* #undef HAVE_PWD_H */
+
+/* Define to 1 if you have the `rand' function. */
+#define HAVE_RAND 1
+
+/* Define to 1 if you have the `random' function. */
+#define HAVE_RAND 1
+
+/* Define to 1 if you have the `regcomp' function. */
+/* #undef HAVE_REGCOMP */
+
+/* Define to 1 if you have the <regex.h> header file. */
+/* #undef HAVE_REGEX_H */
+
+/* Define to 1 if you have the `rpmGetPath' function. */
+/* #undef HAVE_RPMGETPATH */
+
+/* Define to 1 if you have the <rpmio.h> header file. */
+/* #undef HAVE_RPMIO_H */
+
+/* Define to 1 if you have the <rpm/rpmio.h> header file. */
+/* #undef HAVE_RPM_RPMIO_H */
+
+/* Define to 1 if you have the <search.h> header file. */
+#define HAVE_SEARCH_H 1
+
+/* Define to 1 if you have the <security/cryptoki.h> header file. */
+/* #undef HAVE_SECURITY_CRYPTOKI_H */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef HAVE_SELECT */
+
+/* Define to 1 if you have the `setenv' function. */
+/* #undef HAVE_SETENV */
+
+/* Define to 1 if you have the `setgid' function. */
+/* #undef HAVE_SETGID */
+
+/* Define to 1 if you have the `setgroups' function. */
+/* #undef HAVE_SETGROUPS */
+
+/* Define to 1 if you have the `setitimer' function. */
+/* #undef HAVE_SETITIMER */
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `setmntent' function. */
+/* #undef HAVE_SETMNTENT */
+
+/* Define to 1 if you have the `setsid' function. */
+/* #undef HAVE_SETSID */
+
+/* Define to 1 if you have the `setuid' function. */
+/* #undef HAVE_SETUID */
+
+/* Define to 1 if you have the <sgtty.h> header file. */
+/* #undef HAVE_SGTTY_H */
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef HAVE_SIGACTION */
+
+/* Define to 1 if you have the `sigalrm' function. */
+/* #undef HAVE_SIGALRM */
+
+/* Define to 1 if you have the `sigblock' function. */
+/* #undef HAVE_SIGBLOCK */
+
+/* Define to 1 if you have the `sighold' function. */
+/* #undef HAVE_SIGHOLD */
+
+/* Define to 1 if you have the `signal' function. */
+/* #undef HAVE_SIGNAL */
+
+/* Define to 1 if you have the `sigset' function. */
+/* #undef HAVE_SIGSET */
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if you have the `statfs' function. */
+/* #undef HAVE_STATFS */
+
+/* Define to 1 if you have the `statvfs' function. */
+/* #undef HAVE_STATVFS */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_STDINT_H 1
+#endif
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `stime' function. */
+/* #undef HAVE_STIME */
+
+/* Define to 1 if you have the `strcasestr' function. */
+/* #undef HAVE_STRCASESTR */
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+/* #undef HAVE_STRINGS_H */
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef HAVE_STRLCPY */
+
+/* Define to 1 if you have the `strncasecmp' function. */
+/* #undef HAVE_STRNCASECMP */
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
+/* Define to 1 if you have the <syslog.h> header file. */
+/* #undef HAVE_SYSLOG_H */
+
+/* Define to 1 if you have the `system' function. */
+#define HAVE_SYSTEM 1
+
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+/* #undef HAVE_SYS_CDEFS_H */
+
+/* Define to 1 if you have the <sys/conf.h> header file. */
+/* #undef HAVE_SYS_CONF_H */
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/diskio.h> header file. */
+/* #undef HAVE_SYS_DISKIO_H */
+
+/* Define to 1 if you have the <sys/dkio.h> header file. */
+/* #undef HAVE_SYS_DKIO_H */
+
+/* Define to 1 if you have the <sys/dmap.h> header file. */
+/* #undef HAVE_SYS_DMAP_H */
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+/* #undef HAVE_SYS_FILE_H */
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+/* #undef HAVE_SYS_FILIO_H */
+
+/* Define to 1 if you have the <sys/fixpoint.h> header file. */
+/* #undef HAVE_SYS_FIXPOINT_H */
+
+/* Define to 1 if you have the <sys/fs.h> header file. */
+/* #undef HAVE_SYS_FS_H */
+
+/* Define to 1 if you have the <sys/hashing.h> header file. */
+/* #undef HAVE_SYS_HASHING_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/loadavg.h> header file. */
+/* #undef HAVE_SYS_LOADAVG_H */
+
+/* Define to 1 if you have the <sys/mbuf.h> header file. */
+/* #undef HAVE_SYS_MBUF_H */
+
+/* Define to 1 if you have the <sys/mntent.h> header file. */
+/* #undef HAVE_SYS_MNTENT_H */
+
+/* Define to 1 if you have the <sys/mnttab.h> header file. */
+/* #undef HAVE_SYS_MNTTAB_H */
+
+/* Define to 1 if you have the <sys/mount.h> header file. */
+/* #undef HAVE_SYS_MOUNT_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+/* #undef HAVE_SYS_PARAM_H */
+
+/* Define to 1 if you have the <sys/pool.h> header file. */
+/* #undef HAVE_SYS_POOL_H */
+
+/* Define to 1 if you have the <sys/proc.h> header file. */
+/* #undef HAVE_SYS_PROC_H */
+
+/* Define to 1 if you have the <sys/protosw.h> header file. */
+/* #undef HAVE_SYS_PROTOSW_H */
+
+/* Define to 1 if you have the <sys/pstat.h> header file. */
+/* #undef HAVE_SYS_PSTAT_H */
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+/* #undef HAVE_SYS_QUEUE_H */
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/socketvar.h> header file. */
+/* #undef HAVE_SYS_SOCKETVAR_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+/* #undef HAVE_SYS_SOCKIO_H */
+
+/* Define to 1 if you have the <sys/statfs.h> header file. */
+/* #undef HAVE_SYS_STATFS_H */
+
+/* Define to 1 if you have the <sys/statvfs.h> header file. */
+/* #undef HAVE_SYS_STATVFS_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/stream.h> header file. */
+/* #undef HAVE_SYS_STREAM_H */
+
+/* Define to 1 if you have the <sys/swap.h> header file. */
+/* #undef HAVE_SYS_SWAP_H */
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+/* #undef HAVE_SYS_SYSCTL_H */
+
+/* Define to 1 if you have the <sys/sysmp.h> header file. */
+/* #undef HAVE_SYS_SYSMP_H */
+
+/* Define to 1 if you have the <sys/tcpipstats.h> header file. */
+/* #undef HAVE_SYS_TCPIPSTATS_H */
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+/* #undef HAVE_SYS_TIME_H */
+
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#define HAVE_SYS_TIMEB_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+/* #undef HAVE_SYS_UN_H */
+
+/* Define to 1 if you have the <sys/user.h> header file. */
+/* #undef HAVE_SYS_USER_H */
+
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+/* #undef HAVE_SYS_UTSNAME_H */
+
+/* Define to 1 if you have the <sys/vfs.h> header file. */
+/* #undef HAVE_SYS_VFS_H */
+
+/* Define to 1 if you have the <sys/vmmac.h> header file. */
+/* #undef HAVE_SYS_VMMAC_H */
+
+/* Define to 1 if you have the <sys/vmmeter.h> header file. */
+/* #undef HAVE_SYS_VMMETER_H */
+
+/* Define to 1 if you have the <sys/vmparam.h> header file. */
+/* #undef HAVE_SYS_VMPARAM_H */
+
+/* Define to 1 if you have the <sys/vmsystm.h> header file. */
+/* #undef HAVE_SYS_VMSYSTM_H */
+
+/* Define to 1 if you have the <sys/vm.h> header file. */
+/* #undef HAVE_SYS_VM_H */
+
+/* Define to 1 if you have the <sys/vnode.h> header file. */
+/* #undef HAVE_SYS_VNODE_H */
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to 1 if you have the `tcgetattr' function. */
+/* #undef HAVE_TCGETATTR */
+
+/* Define to 1 if you have the <ufs/ffs/fs.h> header file. */
+/* #undef HAVE_UFS_FFS_FS_H */
+
+/* Define to 1 if you have the <ufs/fs.h> header file. */
+/* #undef HAVE_UFS_FS_H */
+
+/* Define to 1 if you have the <ufs/ufs/dinode.h> header file. */
+/* #undef HAVE_UFS_UFS_DINODE_H */
+
+/* Define to 1 if you have the <ufs/ufs/inode.h> header file. */
+/* #undef HAVE_UFS_UFS_INODE_H */
+
+/* Define to 1 if you have the <ufs/ufs/quota.h> header file. */
+/* #undef HAVE_UFS_UFS_QUOTA_H */
+
+/* Define to 1 if you have the `uname' function. */
+/* #undef HAVE_UNAME */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if you have the `usleep' function. */
+/* #undef HAVE_USLEEP */
+
+/* Define to 1 if you have the <utmpx.h> header file. */
+/* #undef HAVE_UTMPX_H */
+
+/* Define to 1 if you have the <utsname.h> header file. */
+/* #undef HAVE_UTSNAME_H */
+
+/* Define to 1 if you have the <uvm/uvm_extern.h> header file. */
+/* #undef HAVE_UVM_UVM_EXTERN_H */
+
+/* Define to 1 if you have the <uvm/uvm_param.h> header file. */
+/* #undef HAVE_UVM_UVM_PARAM_H */
+
+/* Define to 1 if you have the <vm/swap_pager.h> header file. */
+/* #undef HAVE_VM_SWAP_PAGER_H */
+
+/* Define to 1 if you have the <vm/vm_extern.h> header file. */
+/* #undef HAVE_VM_VM_EXTERN_H */
+
+/* Define to 1 if you have the <vm/vm.h> header file. */
+/* #undef HAVE_VM_VM_H */
+
+/* Define to 1 if you have the <vm/vm_param.h> header file. */
+/* #undef HAVE_VM_VM_PARAM_H */
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the <winsock.h> header file. */
+#define HAVE_WINSOCK_H 1
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#define HAVE_WINSOCK2_H 1
+
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#define HAVE_WS2TCPIP_H 1
+
+/* Define to 1 if you have the <xti.h> header file. */
+/* #undef HAVE_XTI_H */
+
+/* Define to the address where bug reports for this package should be sent. */
+/* #undef PACKAGE_BUGREPORT */
+
+/* Define to the full name of this package. */
+#ifndef PACKAGE_NAME
+#define PACKAGE_NAME "Net-SNMP"
+#endif
+
+/* Define to the full name and version of this package. */
+/* #undef PACKAGE_STRING */
+
+/* Define to the one symbol short name of this package. */
+#ifndef PACKAGE_TARNAME
+#define PACKAGE_TARNAME "net-snmp"
+#endif
+
+/* Define to the version of this package. */
+/* #undef PACKAGE_VERSION */
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of a `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of a `intmax_t', as computed by sizeof. */
+#define SIZEOF_INTMAX_T 8
+
+/* The size of a `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+/* #undef TIME_WITH_SYS_TIME */
+
+/* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+/* # undef _ALL_SOURCE */
+#endif
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
+#define inline __inline
+
+/* Define to `long' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef pid_t */
+
+/* define if you have getdevs() */
+/* #undef HAVE_GETDEVS */
+
+/* define if you have devstat_getdevs() */
+/* #undef HAVE_DEVSTAT_GETDEVS */
+
+/* define if you have <netinet/in_pcb.h> */
+/* #undef HAVE_NETINET_IN_PCB_H */
+
+/* define if you have <sys/disklabel.h> */
+/* #undef HAVE_SYS_DISKLABEL_H */
+
+/* define if you are using linux and /proc/net/dev has the compressed
+ field, which exists in linux kernels 2.2 and greater. */
+/* #undef PROC_NET_DEV_HAS_COMPRESSED */
+
+/* define rtentry to ortentry on SYSV machines (alphas) */
+#define RTENTRY rtentry;
+
+/* Use BSD 4.4 routing table entries? */
+/* #undef RTENTRY_4_4 */
+
+/* Does struct sigaction have a sa_sigaction field? */
+/* #undef HAVE_STRUCT_SIGACTION_SA_SIGACTION */
+
+/* Does struct sockaddr have a sa_len field? */
+/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
+
+/* Does struct sockaddr have a sa_family2 field? */
+/* #undef HAVE_STRUCT_SOCKADDR_SA_UNION_SA_GENERIC_SA_FAMILY2 */
+
+/* Does struct in6_addr have a s6_un.sa6_ladd field? */
+/* #undef HAVE_STRUCT_IN6_ADDR_S6_UN_SA6_LADDR */
+
+/* msghdr.msg_control */
+/* #undef HAVE_STRUCT_MSGHDR_MSG_CONTROL */
+
+/* msghdr.msg_flags */
+/* #undef HAVE_STRUCT_MSGHDR_MSG_FLAGS */
+
+/* rtentry structure tests */
+/* #undef RTENTRY_RT_NEXT */
+/* #undef HAVE_STRUCT_RTENTRY_RT_DST */
+/* #undef HAVE_STRUCT_RTENTRY_RT_UNIT */
+/* #undef HAVE_STRUCT_RTENTRY_RT_USE */
+/* #undef HAVE_STRUCT_RTENTRY_RT_REFCNT */
+/* #undef HAVE_STRUCT_RTENTRY_RT_HASH */
+
+/* ifnet structure tests */
+/* #undef HAVE_STRUCT_IFNET_IF_BAUDRATE */
+/* #undef HAVE_STRUCT_IFNET_IF_BAUDRATE_IFS_VALUE */
+/* #undef HAVE_STRUCT_IFNET_IF_SPEED */
+/* #undef HAVE_STRUCT_IFNET_IF_TYPE */
+/* #undef HAVE_STRUCT_IFNET_IF_IMCASTS */
+/* #undef HAVE_STRUCT_IFNET_IF_IQDROPS */
+/* #undef HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_SEC */
+/* #undef HAVE_STRUCT_IFNET_IF_NOPROTO */
+/* #undef HAVE_STRUCT_IFNET_IF_OMCASTS */
+/* #undef HAVE_STRUCT_IFNET_IF_XNAME */
+/* #undef HAVE_STRUCT_IFNET_IF_OBYTES */
+/* #undef HAVE_STRUCT_IFNET_IF_IBYTES */
+/* #undef HAVE_STRUCT_IFNET_IF_ADDRLIST */
+
+/* tcpstat.tcps_rcvmemdrop */
+/* #undef HAVE_STRUCT_TCPSTAT_TCPS_RCVMEMDROP */
+
+/* udpstat.udps_discard */
+/* #undef HAVE_STRUCT_UDPSTAT_UDPS_DISCARD */
+
+/* udpstat.udps_discard */
+/* #undef HAVE_STRUCT_UDPSTAT_UDPS_NOPORT */
+
+/* udpstat.udps_discard */
+/* #undef HAVE_STRUCT_UDPSTAT_UDPS_NOPORTBCAST */
+
+/* udpstat.udps_discard */
+/* #undef HAVE_STRUCT_UDPSTAT_UDPS_FULLSOCK */
+
+/* arphd.at_next */
+/* #undef HAVE_STRUCT_ARPHD_AT_NEXT */
+
+/* ifaddr.ifa_next */
+/* #undef HAVE_STRUCT_IFADDR_IFA_NEXT */
+
+/* ifnet.if_mtu */
+/* #undef HAVE_STRUCT_IFNET_IF_MTU */
+
+/* swdevt.sw_nblksenabled */
+/* #undef HAVE_STRUCT_SWDEVT_SW_NBLKSENABLED */
+
+/* nlist.n_value */
+/* #undef HAVE_STRUCT_NLIST_N_VALUE */
+
+/* ipstat structure tests */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_CANTFORWARD */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_CANTFRAG */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_DELIVERED */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_FRAGDROPPED */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_FRAGTIMEOUT */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_LOCALOUT */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_NOPROTO */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_NOROUTE */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_ODROPPED */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_OFRAGMENTS */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_REASSEMBLED */
+
+/* vfsstat.f_frsize */
+/* #undef HAVE_STRUCT_STATVFS_F_FRSIZE */
+
+/* vfsstat.f_files */
+/* #undef HAVE_STRUCT_STATVFS_F_FILES */
+
+/* statfs inode structure tests*/
+/* #undef HAVE_STRUCT_STATFS_F_FILES */
+/* #undef HAVE_STRUCT_STATFS_F_FFREE */
+/* #undef HAVE_STRUCT_STATFS_F_FAVAIL */
+
+/* des_ks_struct.weak_key */
+/* #undef HAVE_STRUCT_DES_KS_STRUCT_WEAK_KEY */
+
+/* ifnet needs to have _KERNEL defined */
+/* #undef IFNET_NEEDS_KERNEL */
+
+/* sysctl works to get boottime, etc... */
+/* #undef NETSNMP_CAN_USE_SYSCTL */
+
+/* type check for in_addr_t */
+/* #undef in_addr_t */
+
+/* define if SIOCGIFADDR exists in sys/ioctl.h */
+/* #undef SYS_IOCTL_H_HAS_SIOCGIFADDR */
+
+/* Mib-2 tree Info */
+/* These are the system information variables. */
+
+#define NETSNMP_VERS_DESC "unknown" /* overridden at run time */
+#define NETSNMP_SYS_NAME "unknown" /* overridden at run time */
+
+/* comment out the second define to turn off functionality for any of
+ these: (See README for details) */
+
+/* proc PROCESSNAME [MAX] [MIN] */
+#define NETSNMP_PROCMIBNUM 2
+
+/* exec/shell NAME COMMAND */
+#define NETSNMP_SHELLMIBNUM 8
+
+/* swap MIN */
+#define NETSNMP_MEMMIBNUM 4
+
+/* disk DISK MINSIZE */
+#define NETSNMP_DISKMIBNUM 9
+
+/* load 1 5 15 */
+#define NETSNMP_LOADAVEMIBNUM 10
+
+/* which version are you using? This mibloc will tell you */
+#define NETSNMP_VERSIONMIBNUM 100
+
+/* Reports errors the agent runs into */
+/* (typically its "can't fork, no mem" problems) */
+#define NETSNMP_ERRORMIBNUM 101
+
+/* The sub id of EXTENSIBLEMIB returned to queries of
+ .iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0 */
+#define NETSNMP_AGENTID 250
+
+/* This ID is returned after the NETSNMP_AGENTID above. IE, the resulting
+ value returned by a query to sysObjectID is
+ EXTENSIBLEMIB.NETSNMP_AGENTID.???, where ??? is defined below by OSTYPE */
+
+#define NETSNMP_HPUX9ID 1
+#define NETSNMP_SUNOS4ID 2
+#define NETSNMP_SOLARISID 3
+#define NETSNMP_OSFID 4
+#define NETSNMP_ULTRIXID 5
+#define NETSNMP_HPUX10ID 6
+#define NETSNMP_NETBSD1ID 7
+#define NETSNMP_FREEBSDID 8
+#define NETSNMP_IRIXID 9
+#define NETSNMP_LINUXID 10
+#define NETSNMP_BSDIID 11
+#define NETSNMP_OPENBSDID 12
+#define NETSNMP_WIN32ID 13
+#define NETSNMP_HPUX11ID 14
+#define NETSNMP_UNKNOWNID 255
+
+#ifdef hpux9
+#define OSTYPE NETSNMP_HPUX9ID
+#endif
+#ifdef hpux10
+#define OSTYPE NETSNMP_HPUX10ID
+#endif
+#ifdef hpux11
+#define OSTYPE NETSNMP_HPUX11ID
+#endif
+#ifdef sunos4
+#define OSTYPE NETSNMP_SUNOS4ID
+#endif
+#ifdef solaris2
+#define OSTYPE NETSNMP_SOLARISID
+#endif
+#if defined(osf3) || defined(osf4) || defined(osf5)
+#define OSTYPE NETSNMP_OSFID
+#endif
+#ifdef ultrix4
+#define OSTYPE NETSNMP_ULTRIXID
+#endif
+#ifdef netbsd1
+#define OSTYPE NETSNMP_NETBSD1ID
+#endif
+#if defined(__FreeBSD__)
+#define OSTYPE NETSNMP_FREEBSDID
+#endif
+#if defined(irix6) || defined(irix5)
+#define OSTYPE NETSNMP_IRIXID
+#endif
+#ifdef linux
+#define OSTYPE NETSNMP_LINUXID
+#endif
+#if defined(bsdi2) || defined(bsdi3) || defined(bsdi4)
+#define OSTYPE NETSNMP_BSDIID
+#endif
+#ifdef openbsd2
+#define OSTYPE NETSNMP_OPENBSDID
+#endif
+#ifdef WIN32
+#define OSTYPE NETSNMP_WIN32ID
+#endif
+/* unknown */
+#ifndef OSTYPE
+#define OSTYPE NETSNMP_UNKNOWNID
+#endif
+
+/* The enterprise number has been assigned by the IANA group. */
+/* Optionally, this may point to the location in the tree your */
+/* company/organization has been allocated. */
+/* The assigned enterprise number for the NET_SNMP MIB modules. */
+#define NETSNMP_ENTERPRISE_OID 8072
+#define NETSNMP_ENTERPRISE_MIB 1,3,6,1,4,1,8072
+#define NETSNMP_ENTERPRISE_DOT_MIB 1.3.6.1.4.1.8072
+#define NETSNMP_ENTERPRISE_DOT_MIB_LENGTH 7
+
+/* The assigned enterprise number for sysObjectID. */
+#define NETSNMP_SYSTEM_MIB 1,3,6,1,4,1,8072,3,2,OSTYPE
+#define NETSNMP_SYSTEM_DOT_MIB 1.3.6.1.4.1.8072.3.2.OSTYPE
+#define NETSNMP_SYSTEM_DOT_MIB_LENGTH 10
+
+/* The assigned enterprise number for notifications. */
+#define NETSNMP_NOTIFICATION_MIB 1,3,6,1,4,1,8072,4
+#define NETSNMP_NOTIFICATION_DOT_MIB 1.3.6.1.4.1.8072.4
+#define NETSNMP_NOTIFICATION_DOT_MIB_LENGTH 8
+
+/* this is the location of the ucdavis mib tree. It shouldn't be
+ changed, as the places it is used are expected to be constant
+ values or are directly tied to the UCD-SNMP-MIB. */
+#define NETSNMP_UCDAVIS_OID 2021
+#define NETSNMP_UCDAVIS_MIB 1,3,6,1,4,1,2021
+#define NETSNMP_UCDAVIS_DOT_MIB 1.3.6.1.4.1.2021
+#define NETSNMP_UCDAVIS_DOT_MIB_LENGTH 7
+
+/* this is the location of the net-snmp mib tree. It shouldn't be
+ changed, as the places it is used are expected to be constant
+ values or are directly tied to the UCD-SNMP-MIB. */
+#define NETSNMP_OID 8072
+#define NETSNMP_MIB 1,3,6,1,4,1,8072
+#define NETSNMP_DOT_MIB 1.3.6.1.4.1.8072
+#define NETSNMP_DOT_MIB_LENGTH 7
+
+/* how long to wait (seconds) for error querys before reseting the error trap.*/
+#define NETSNMP_ERRORTIMELENGTH 600
+
+/* Exec command to fix PROC problems */
+/* %s will be replaced by the process name in error */
+
+/* #define NETSNMP_PROCFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
+
+/* Exec command to fix EXEC problems */
+/* %s will be replaced by the exec/script name in error */
+
+/* #define NETSNMP_EXECFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
+
+/* Should exec output Cashing be used (speeds up things greatly), and
+ if so, After how many seconds should the cache re-newed? Note:
+ Don't define CASHETIME to disable cashing completely */
+
+#define NETSNMP_EXCACHETIME 30
+#define NETSNMP_CACHEFILE ".snmp-exec-cache"
+#define NETSNMP_MAXCACHESIZE (200*80) /* roughly 200 lines max */
+
+#define MAXDISKS 50 /* can't scan more than this number */
+
+/* misc defaults */
+
+/* default of 100 meg minimum if the minimum size is not specified in
+ the config file */
+#define NETSNMP_DEFDISKMINIMUMSPACE 100000
+
+#define NETSNMP_DEFMAXLOADAVE 12.0 /* default maximum load average before error */
+
+/* Because of sleep(1)s, this will also be time to wait (in seconds) for exec
+ to finish */
+#define NETSNMP_MAXREADCOUNT 100 /* max times to loop reading output from execs. */
+
+/* The original CMU code had this hardcoded as = 1 */
+#define NETSNMP_SNMPBLOCK 1 /* Set if snmpgets should block and never timeout */
+
+/* How long to wait before restarting the agent after a snmpset to
+ EXTENSIBLEMIB.NETSNMP_VERSIONMIBNUM.VERRESTARTAGENT. This is
+ necessary to finish the snmpset reply before restarting. */
+#define NETSNMP_RESTARTSLEEP 5
+
+/* Number of community strings to store */
+#define NETSNMP_NUM_COMMUNITIES 5
+
+/* UNdefine to allow specifying zero-length community string */
+/* #define NETSNMP_NO_ZEROLENGTH_COMMUNITY 1 */
+
+#define NETSNMP_LASTFIELD -1 /* internal define */
+
+/* configure options specified */
+#define NETSNMP_CONFIGURE_OPTIONS ""
+
+/* got socklen_t? */
+#ifdef HAVE_WIN32_PLATFORM_SDK
+#define HAVE_SOCKLEN_T 1
+#endif
+
+/* got in_addr_t? */
+/* #undef HAVE_IN_ADDR_T */
+
+#ifdef __MINGW32__
+/* got ssize_t? */
+#define HAVE_SSIZE_T
+#endif
+
+/* If you have openssl 0.9.7 or above, you likely have AES support. */
+/* #undef NETSNMP_USE_OPENSSL */
+
+#ifdef NETSNMP_USE_OPENSSL
+
+/* Define to 1 if you have the <openssl/dh.h> header file. */
+#define HAVE_OPENSSL_DH_H 1
+
+/* Define to 1 if you have the <openssl/aes.h> header file. */
+#define HAVE_OPENSSL_AES_H 1
+
+/* Define to 1 if you have the `EVP_MD_CTX_create' function. */
+#define HAVE_EVP_MD_CTX_CREATE 1
+
+/* Define to 1 if you have the `EVP_MD_CTX_destroy' function. */
+#define HAVE_EVP_MD_CTX_DESTROY 1
+
+/* Define to 1 if you have the `AES_cfb128_encrypt' function. */
+#define HAVE_AES_CFB128_ENCRYPT 1
+
+#if defined(HAVE_OPENSSL_AES_H) && defined(HAVE_AES_CFB128_ENCRYPT)
+#define HAVE_AES 1
+#endif
+
+#else /* ! NETSNMP_USE_OPENSSL */
+
+/* define if you are using the MD5 code ...*/
+#define NETSNMP_USE_INTERNAL_MD5 1
+
+#endif /* ! NETSNMP_USE_OPENSSL */
+
+
+/* define random functions */
+
+#ifndef HAVE_RANDOM
+#ifdef HAVE_LRAND48
+#define random lrand48
+#define srandom(s) srand48(s)
+#else
+#ifdef HAVE_RAND
+#define random rand
+#define srandom(s) srand(s)
+#endif
+#endif
+#endif
+
+/* define signal if DNE */
+
+#ifndef HAVE_SIGNAL
+#ifdef HAVE_SIGSET
+#define signal(a,b) sigset(a,b)
+#endif
+#endif
+
+/* define if you have librpm and libdb */
+/* #undef HAVE_LIBDB */
+/* #undef HAVE_LIBRPM */
+
+/* define if you have pkginfo */
+/* #undef HAVE_PKGINFO */
+
+/* define if you have gethostbyname */
+#define HAVE_GETHOSTBYNAME 1
+
+/* define if you have gethostbyaddr */
+#define HAVE_GETHOSTBYADDR 1
+
+/* printing system */
+/* #undef HAVE_LPSTAT */
+/* #undef LPSTAT_PATH */
+/* #undef HAVE_PRINTCAP */
+
+/* Pluggable transports. */
+
+/* This is defined if support for the UDP/IP transport domain is
+ available. */
+#define NETSNMP_TRANSPORT_UDP_DOMAIN 1
+
+/* This is defined if support for the "callback" transport domain is
+ available. */
+#define NETSNMP_TRANSPORT_CALLBACK_DOMAIN 1
+
+/* This is defined if support for the TCP/IP transport domain is
+ available. */
+#define NETSNMP_TRANSPORT_TCP_DOMAIN 1
+
+/* This is defined if support for the Unix transport domain
+ (a.k.a. "local IPC") is available. */
+/* #undef NETSNMP_TRANSPORT_UNIX_DOMAIN */
+
+/* This is defined if support for the AAL5 PVC transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN */
+
+/* This is defined if support for the IPX transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_IPX_DOMAIN */
+
+/* XXX do not modify. change the NETSNMP_ENABLE_IPV6 define instead */
+/* This is defined if support for the UDP/IPv6 transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN */
+
+/* XXX do not modify. change the NETSNMP_ENABLE_IPV6 define instead */
+/* This is defined if support for the TCP/IPv6 transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN */
+
+/* This is defined if support for the TLS transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_TLSBASE_DOMAIN */
+
+/* This is defined if support for the Alias transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_ALIAS_DOMAIN */
+
+/* This is defined if support for the SSH transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_SSH_DOMAIN */
+
+/* This is defined if support for the DTLS/UDP transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN */
+
+/* This is defined if support for the TLS/TCP transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_TLSTCP_DOMAIN */
+
+/* This is defined if support for stdin/out transport domain is available. */
+/* #undef NETSNMP_TRANSPORT_STD_DOMAIN */
+
+/* This is defined if support for the IPv4Base transport domain is available. */
+#define NETSNMP_TRANSPORT_IPV4BASE_DOMAIN 1
+
+/* define this if the USM security module is available */
+#define NETSNMP_SECMOD_USM 1
+
+/* define this if the KSM (kerberos based snmp) security module is available */
+/* #undef NETSNMP_SECMOD_KSM */
+
+/* define this if we're using the new MIT crypto API */
+/* #undef NETSNMP_USE_KERBEROS_MIT */
+
+/* define if you want to build with reentrant/threaded code (incomplete)*/
+/* #undef NETSNMP_REENTRANT */
+
+/* on aix, if you have perfstat */
+/* #undef HAVE_PERFSTAT */
+
+/* Not-to-be-compiled macros for use by configure only */
+#define config_require(x)
+#define config_version_require(x)
+#define config_warning(x)
+#define config_error(x)
+#define config_exclude(x)
+#define config_arch_require(x,y)
+#define config_parse_dot_conf(w,x,y,z)
+#define config_add_mib(x)
+#define config_belongs_in(x)
+
+#if defined (WIN32)
+#define ENV_SEPARATOR ";"
+#define ENV_SEPARATOR_CHAR ';'
+#else
+#define ENV_SEPARATOR ":"
+#define ENV_SEPARATOR_CHAR ':'
+#endif
+
+/*
+ * this must be before the system/machine includes, to allow them to
+ * override and turn off inlining. To do so, they should do the
+ * following:
+ *
+ * #undef NETSNMP_ENABLE_INLINE
+ * #define NETSNMP_ENABLE_INLINE 0
+ *
+ * A user having problems with their compiler can also turn off
+ * the use of inline by defining NETSNMP_NO_INLINE via their cflags:
+ *
+ * -DNETSNMP_NO_INLINE
+ *
+ * Header and source files should only test against NETSNMP_USE_INLINE:
+ *
+ * #ifdef NETSNMP_USE_INLINE
+ * NETSNMP_INLINE function(int parm) { return parm -1; }
+ * #endif
+ *
+ * Functions which should be static, regardless of whether or not inline
+ * is available or enabled should use the NETSNMP_STATIC_INLINE macro,
+ * like so:
+ *
+ * NETSNMP_STATIC_INLINE function(int parm) { return parm -1; }
+ *
+ * NOT like this:
+ *
+ * static NETSNMP_INLINE function(int parm) { return parm -1; }
+ *
+ */
+/*
+ * Win32 needs extern for inline function declarations in headers.
+ * See MS tech note Q123768:
+ * http://support.microsoft.com/default.aspx?scid=kb;EN-US;123768
+ */
+#define NETSNMP_INLINE extern inline
+#define NETSNMP_STATIC_INLINE static inline
+#define NETSNMP_ENABLE_INLINE 1
+
+#if notused
+#include NETSNMP_SYSTEM_INCLUDE_FILE
+#include NETSNMP_MACHINE_INCLUDE_FILE
+#endif
+
+#if NETSNMP_ENABLE_INLINE && !defined(NETSNMP_NO_INLINE)
+# define NETSNMP_USE_INLINE 1
+#else
+# undef NETSNMP_INLINE
+# define NETSNMP_INLINE
+# undef NETSNMP_STATIC_INLINE
+# define NETSNMP_STATIC_INLINE static
+#endif
+
+#ifdef WIN32
+
+#ifndef __MINGW32__
+typedef unsigned short mode_t;
+#endif
+#ifndef HAVE_STDINT_H
+typedef unsigned char uint8_t;
+typedef char int8_t;
+typedef unsigned __int16 uint16_t;
+typedef __int16 int16_t;
+typedef unsigned __int32 uint32_t;
+typedef __int32 int32_t;
+typedef unsigned __int64 uint64_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uintmax_t;
+typedef __int64 intmax_t;
+#else /* HAVE_STDINT_H */
+#include <stdint.h>
+#endif /* HAVE_STDINT_H */
+
+
+/* (u)intptr_t should only be needed for MSVC 6 32-bit. */
+/* SDK has it for 64-bit and newer MSVC should also have it in stddef.h. */
+#ifndef _INTPTR_T_DEFINED
+#ifdef _M_X64
+typedef __int64 intptr_t;
+#else
+typedef int intptr_t;
+#endif
+#define _INTPTR_T_DEFINED
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#ifdef _M_X64
+typedef unsigned __int64 uintptr_t;
+#else
+typedef unsigned int uintptr_t;
+#endif
+#define _UINTPTR_T_DEFINED
+#endif
+
+#ifndef __cplusplus
+enum {
+ netsnmp_compile_time_uintptr_t_size_check
+ = sizeof(struct netsnmp_compile_time_uintptr_t_size_check_s { int:-!(sizeof(uintptr_t) == sizeof(void*)); })
+};
+#endif
+
+/* Define if you have the closesocket function. */
+#define HAVE_CLOSESOCKET 1
+
+/* Define if you have raise() instead of alarm() */
+#define HAVE_RAISE 1
+
+/* define to 1 if you do not want to set global snmp_errno */
+#define DONT_SHARE_ERROR_WITH_OTHER_THREADS 1
+
+/* Defining vsnprintf is not necessary for MSVC 2008 or later */
+#if defined(_MSC_VER) && _MSC_VER < 1500
+#define vsnprintf _vsnprintf
+#endif
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER < 1600
+#define EADDRINUSE WSAEADDRINUSE
+#endif
+
+/* Define NETSNMP_USE_DLL when building or using netsnmp.DLL */
+/* #undef NETSNMP_USE_DLL */
+
+#if defined(NETSNMP_DLL) && !defined(NETSNMP_USE_DLL)
+#error NETSNMP_USE_DLL must be defined when building libsnmp as a DLL.
+#endif
+
+/*
+ * DLL decoration, if used at all, must be consistent.
+ * This is why NETSNMP_IMPORT is really an export decoration
+ * when it is encountered in a header file that is included
+ * during the compilation of a library source file.
+ * NETSNMP_DLL is set by the MSVC libsnmp_dll project
+ * in order to signal that the library sources are being compiled.
+ * Not defining NETSNMP_USE_DLL ignores the preceding, and renders
+ * the NETSNMP_IMPORT definitions harmless.
+ */
+
+#ifdef NETSNMP_USE_DLL
+ #ifdef NETSNMP_DLL
+ #if defined(_MSC_VER)
+ #define NETSNMP_IMPORT __declspec(dllexport)
+ #endif
+ #else
+ #if defined(_MSC_VER)
+ #define NETSNMP_IMPORT __declspec(dllimport)
+ #endif
+ #endif /* NETSNMP_DLL */
+#endif /* NETSNMP_USE_DLL */
+
+/* MSVC OpenSSL linker settings. */
+#if defined(_MSC_VER)
+# if defined(NETSNMP_USE_OPENSSL)
+# ifdef _DLL
+# ifdef _DEBUG
+# pragma comment(lib, "libeay32MDd.lib")
+# else
+# pragma comment(lib, "libeay32MD.lib")
+# endif
+# else
+# ifdef _DEBUG
+# pragma comment(lib, "libeay32MTd.lib")
+# else
+# pragma comment(lib, "libeay32MT.lib")
+# endif
+# endif
+# pragma comment(lib, "gdi32.lib")
+# pragma comment(lib, "user32.lib")
+# endif
+#endif
+
+#endif /* WIN32 */
+
+#ifndef NETSNMP_IMPORT
+# define NETSNMP_IMPORT extern
+#endif
+
+#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(DONT_USE_NLIST) && !defined(NETSNMP_NO_KMEM_USAGE)
+#define NETSNMP_CAN_USE_NLIST
+#endif
+
+#if HAVE_DMALLOC_H
+#define DMALLOC_FUNC_CHECK
+#endif
+
+/* #undef NETSNMP_ENABLE_LOCAL_SMUX */
+
+/* define if agentx transport is to use domain sockets only */
+/* #undef NETSNMP_AGENTX_DOM_SOCK_ONLY */
+
+#ifndef LOG_DAEMON
+#define LOG_DAEMON (3<<3) /* system daemons */
+#endif
+
+#if UCD_COMPATIBLE
+/* old and in the way */
+#define EXTENSIBLEMIB NETSNMP_UCDAVIS_MIB
+#endif
+
+#ifdef _MSC_VER
+/* Windows Vista and higher have inet_ntop but older Windows does not.
+ * We'll use the Net-SNMP version instead. */
+#undef HAVE_INET_NTOP
+#undef HAVE_INET_PTON
+
+/* IPv6 transports */
+#ifdef NETSNMP_ENABLE_IPV6
+ #define NETSNMP_TRANSPORT_TCPIPV6_DOMAIN 1
+ #define NETSNMP_TRANSPORT_UDPIPV6_DOMAIN 1
+ #define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1
+#else
+ #undef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+ #undef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+#endif
+#endif
+
+/*
+ * Although if_nametoindex() is available on Windows Vista, Windows Server
+ * 2008 and later in iphlpapi.dll, do not link with if_nametoindex() such
+ * that the Net-SNMP executable can be started on earlier Windows versions.
+ */
+#undef HAVE_IF_NAMETOINDEX
+
+#ifndef NI_MAXHOST
+#define NI_MAXHOST 1025
+#endif
+
+/* Define to 1 if you have the `strtoull' function. */
+/* #undef HAVE_STRTOULL */
+
+/*
+ * Module configuration and control starts here.
+ *
+ * Some of the defines herein are used to control
+ * groups of modules. The ones that have "CFG"
+ * are used especially to control the include files
+ * seen in {agent,mib}_module_includes.h, and the init entries
+ * which are invoked in {agent,mib}_module_inits.h.
+ *
+ * To disable a group, uncomment the associated define.
+ */
+
+/* CFG Define if compiling with the ucd_snmp module files. */
+#define USING_UCD_SNMP_MODULE 1
+
+/* CFG Define if compiling with the agentx module files. */
+#define USING_AGENTX_MODULE 1
+
+/* CFG Define if compiling with the host module files. */
+/* #undef USING_HOST_MODULE */
+
+/* CFG Define if compiling with the Rmon module files. */
+/* #undef USING_RMON_MODULE */
+
+/* CFG Define if compiling with the disman/event-mib module files. */
+#define USING_DISMAN_EVENT_MIB_MODULE 1
+
+/* CFG Define if compiling with the smux module files. */
+/* #undef USING_SMUX_MODULE */
+
+/* Define if compiling with the winExtDLL module. */
+/* #undef USING_WINEXTDLL_MODULE */
+
+/*
+ * Module configuration and control ends here.
+ */
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+
+/* Timeout in milliseconds for Win32 function WaitForSingleObject.
+ Used by agent pass. */
+#define NETSNMP_TIMEOUT_WAITFORSINGLEOBJECT 5000
+
+#ifdef HAVE_WIN32_PLATFORM_SDK
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+#endif
+
+/* Size prefix to use to printf a uint32_t */
+#define NETSNMP_PRI32 ""
+
+#ifdef _MSC_VER
+#ifdef _WIN64
+#define NETSNMP_PRIz "I64"
+#else
+#define NETSNMP_PRIz ""
+#endif
+#endif
+
+#endif /* NET_SNMP_CONFIG_H */
+
diff --git a/win32/net-snmp/net-snmp-config.h.in b/win32/net-snmp/net-snmp-config.h.in
new file mode 100644
index 0000000..5215865
--- /dev/null
+++ b/win32/net-snmp/net-snmp-config.h.in
@@ -0,0 +1,1811 @@
+/* include/net-snmp/net-snmp-config.h.in. Generated from configure.in by autoheader. */
+/* modified by hand with care. */
+
+#ifndef NET_SNMP_CONFIG_H
+#define NET_SNMP_CONFIG_H
+
+/* _MSC_VER values
+ 1600 = 10.0 (2010)
+ 1500 = 9.0 (2008)
+ 1400 = 8.0 (2005)
+ 1310 = 7.1 (2003)
+ 1300 = 7.0 (2002)
+ 1200 = 6.0
+*/
+
+#ifdef _MSC_VER
+/* Disable warning 4018: signed/unsigned mismatch. */
+#pragma warning (disable: 4018)
+#endif
+
+/* Automatically set by Windows perl Configure script.
+ * When compiling with the MSVC workspace, this must be set manually.
+ * See the PACKAGE_VERSION variable in Unix /configure script
+*/
+#ifndef PACKAGE_VERSION
+#define PACKAGE_VERSION "unknown"
+#endif
+
+/* Define HAVE_WIN32_PLATFORM_SDK if you have:
+ * Microsoft Visual Studio MSVC 6.0 and the Platform SDK (PSDK)
+ * Microsoft Visual Studio.Net 2002
+ * Microsoft Visual Studio.Net 2003
+ */
+/* #undef HAVE_WIN32_PLATFORM_SDK */
+
+/* Define NETSNMP_ENABLE_IPV6 to enable IPv6. IPv6 is only available on
+ * Windows XP and higher. */
+/* #undef NETSNMP_ENABLE_IPV6 */
+
+/* Only use Windows API functions available on Windows 2000 SP4 or later.
+ * We need at least SP1 for some IPv6 defines in ws2ipdef.h
+ */
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x501 /*_WIN32_WINNT_WIN2K*/
+#else
+#if _WIN32_WINNT < 0x501
+#error _WIN32_WINNT is too low - it should be set to at least 0x501.
+#endif
+#endif
+
+#define INSTALL_BASE "c:/usr"
+
+/* config.h: a general config file */
+
+/* Default (SNMP) version number for the tools to use */
+#define NETSNMP_DEFAULT_SNMP_VERSION 3
+
+/* don't change these values! */
+#define NETSNMP_SNMPV1 0xAAAA /* readable by anyone */
+#define NETSNMP_SNMPV2ANY 0xA000 /* V2 Any type (includes NoAuth) */
+#define NETSNMP_SNMPV2AUTH 0x8000 /* V2 Authenticated requests only */
+
+/* default list of mibs to load */
+
+#define NETSNMP_DEFAULT_MIBS "IP-MIB;IF-MIB;TCP-MIB;UDP-MIB;HOST-RESOURCES-MIB;SNMPv2-MIB;RFC1213-MIB;NOTIFICATION-LOG-MIB;UCD-SNMP-MIB;UCD-DEMO-MIB;SNMP-TARGET-MIB;NET-SNMP-AGENT-MIB;DISMAN-EVENT-MIB;SNMP-VIEW-BASED-ACM-MIB;SNMP-COMMUNITY-MIB;SNMP-FRAMEWORK-MIB;SNMP-MPD-MIB;SNMP-USER-BASED-SM-MIB;SNMP-NOTIFICATION-MIB;SNMPv2-TM"
+
+/* default location to look for mibs to load using the above tokens
+ and/or those in the MIBS envrionment variable*/
+#define NETSNMP_DEFAULT_MIBDIRS INSTALL_BASE ## "/share/snmp/mibs"
+
+/* default mib files to load, specified by path. */
+/* #undef NETSNMP_DEFAULT_MIBFILES */
+
+/* should we compile to use special opaque types: float, double,
+ counter64, i64, ui64, union? */
+#define NETSNMP_WITH_OPAQUE_SPECIAL_TYPES 1
+
+/* comment the next line if you are compiling with libsnmp.h
+ and are not using the UC-Davis SNMP library. */
+#define UCD_SNMP_LIBRARY 1
+
+/* define if you want to compile support for both authentication and
+ privacy support. */
+#define NETSNMP_ENABLE_SCAPI_AUTHPRIV 1
+
+/* define if you are using the MD5 code ...*/
+/* #undef NETSNMP_USE_INTERNAL_MD5 */
+
+/* define if you are using the codeS11 library ...*/
+/* #undef NETSNMP_USE_PKCS11 */
+
+/* add in recent CMU library extensions (not complete) */
+/* #undef CMU_COMPATIBLE */
+
+/* add in recent resource lock functions (not complete) */
+/* #undef NETSNMP_REENTRANT */
+
+/* debugging stuff */
+/* if defined, we optimize the code to exclude all debugging calls. */
+/* #undef NETSNMP_NO_DEBUGGING */
+/* ignore the -D flag and always print debugging information */
+#define NETSNMP_ALWAYS_DEBUG 0
+
+/* reverse encoding BER packets is both faster and more efficient in space. */
+#define NETSNMP_USE_REVERSE_ASNENCODING 1
+#define NETSNMP_DEFAULT_ASNENCODING_DIRECTION 1 /* 1 = reverse, 0 = forwards */
+
+/* NETSNMP_PERSISTENT_DIRECTORY: If defined, the library is capabile of saving
+ persisant information to this directory in the form of configuration
+ lines: NETSNMP_PERSISTENT_DIRECTORY/NAME.persistent.conf */
+#define NETSNMP_PERSISTENT_DIRECTORY INSTALL_BASE ## "/snmp/persist"
+
+/* NETSNMP_PERSISTENT_MASK: the umask permissions to set up persistent files with */
+/* #undef NETSNMP_PERSISTENT_MASK -- no win32 umask */
+
+/* NETSNMP_AGENT_DIRECTORY_MODE: the mode the agents should use to create
+ directories with. Since the data stored here is probably sensitive, it
+ probably should be read-only by root/administrator. */
+#define NETSNMP_AGENT_DIRECTORY_MODE 0700
+
+/* NETSNMP_MAX_PERSISTENT_BACKUPS:
+ * The maximum number of persistent backups the library will try to
+ * read from the persistent cache directory. If an application fails to
+ * close down successfully more than this number of times, data will be lost.
+ */
+#define NETSNMP_MAX_PERSISTENT_BACKUPS 10
+
+
+/* define if you are embedding perl in the main agent */
+/* #undef NETSNMP_EMBEDDED_PERL */
+
+#if notused
+/* define the system type include file here */
+#define NETSNMP_SYSTEM_INCLUDE_FILE <net-snmp/system/generic.h>
+
+/* define the machine (cpu) type include file here */
+#define NETSNMP_MACHINE_INCLUDE_FILE <net-snmp/machine/generic.h>
+#endif
+
+/* SNMPLIBDIR contains important files */
+
+#define SNMPLIBPATH INSTALL_BASE ## "/lib"
+#define SNMPSHAREPATH INSTALL_BASE ## "/share/snmp"
+#define SNMPCONFPATH INSTALL_BASE ## "/etc/snmp"
+#define SNMPDLMODPATH INSTALL_BASE ## "/lib/dlmod"
+
+/* NETSNMP_LOGFILE: If defined it closes stdout/err/in and opens this in out/err's
+ place. (stdin is closed so that sh scripts won't wait for it) */
+/* #undef NETSNMP_LOGFILE */
+
+/* default system contact */
+#define NETSNMP_SYS_CONTACT "unknown"
+
+/* system location */
+#define NETSNMP_SYS_LOC "unknown"
+
+/* Use libwrap to handle allow/deny hosts? */
+/* #undef NETSNMP_USE_LIBWRAP */
+
+/* Use dmalloc to do malloc debugging? */
+/* #undef HAVE_DMALLOC_H */
+
+/* location of UNIX kernel */
+#define KERNEL_LOC "unknown"
+
+/* location of mount table list */
+#define ETC_MNTTAB "unknown"
+
+/* location of swap device (ok if not found) */
+/* #undef DMEM_LOC */
+
+/* Command to generate ps output, the final column must be the process
+ name withOUT arguments */
+#define PSCMD "/bin/ps"
+
+/* Where is the uname command */
+#define UNAMEPROG "/bin/uname"
+
+/* pattern for temporary file names */
+#define NETSNMP_TEMP_FILE_PATTERN INSTALL_BASE ## "/temp/snmpdXXXXXX"
+
+/* testing code sections. */
+/* #undef NETSNMP_ENABLE_TESTING_CODE */
+
+/* If you don't have root access don't exit upon kmem errors */
+/* #undef NETSNMP_NO_ROOT_ACCESS */
+
+/* If we don't want to use kmem. */
+/* #undef NETSNMP_NO_KMEM_USAGE */
+
+/* If you don't want the agent to report on variables it doesn't have data for */
+#define NETSNMP_NO_DUMMY_VALUES 1
+
+/* Define if statfs takes 2 args and the second argument has
+ type struct fs_data. [Ultrix] */
+/* #undef STAT_STATFS_FS_DATA */
+
+/* Define if the TCP timer constants in <netinet/tcp_timer.h>
+ depend on the integer variable `hz'. [FreeBSD 4.x] */
+/* #undef TCPTV_NEEDS_HZ */
+
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define to 1 if using `alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Define if DES encryption should not be supported */
+/* #undef NETSNMP_DISABLE_DES */
+
+/* Define if MD5 authentication should not be supported */
+/* #undef NETSNMP_DISABLE_MD5 */
+
+/* Define if mib loading and parsing code should not be included */
+/* #undef NETSNMP_DISABLE_MIB_LOADING */
+
+/* Define if SNMPv1 code should not be included */
+/* #undef NETSNMP_DISABLE_SNMPV1 */
+
+/* Define if SNMPv2c code should not be included */
+/* #undef NETSNMP_DISABLE_SNMPV2C */
+
+/* Define to 1 if you have the `AES_cfb128_encrypt' function. */
+/* #undef HAVE_AES_CFB128_ENCRYPT */
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+/* #undef HAVE_ALLOCA */
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+/* #undef HAVE_ARPA_INET_H */
+
+/* Define to 1 if you have the <asm/page.h> header file. */
+/* #undef HAVE_ASM_PAGE_H */
+
+/* Define to 1 if you have the `cgetnext' function. */
+/* #undef HAVE_CGETNEXT */
+
+/* Define to 1 if you have the <crtdbg.h> header file. */
+#define HAVE_CRTDBG_H 1
+
+/* Define to 1 if you have the <direct.h> header file. */
+#define HAVE_DIRECT_H 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_DIRENT_H */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the `dlopen' function. */
+/* #undef HAVE_DLOPEN */
+
+/* Define to 1 if you have the <err.h> header file. */
+/* #undef HAVE_ERR_H */
+
+/* Define to 1 if you have the `eval_pv' function. */
+/* #undef HAVE_EVAL_PV */
+
+/* Define to 1 if you have the `execv' function. */
+/* #undef HAVE_EXECV */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `fork' function. */
+/* #undef HAVE_FORK */
+
+/* Define to 1 if you have the <fstab.h> header file. */
+/* #undef HAVE_FSTAB_H */
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+/* #undef HAVE_GETADDRINFO */
+
+/* Define to 1 if you have the `getdtablesize' function. */
+/* #undef HAVE_GETDTABLESIZE */
+
+/* Define to 1 if you have the `getfsstat' function. */
+/* #undef HAVE_GETFSSTAT */
+
+/* Define to 1 if you have the `getgrnam' function. */
+/* #undef HAVE_GETGRNAM */
+
+/* Define to 1 if you have the `gethostname' function. */
+#define HAVE_GETHOSTNAME 1
+
+/* Define to 1 if you have the `getipnodebyname' function. */
+/* #undef HAVE_GETIPNODEBYNAME */
+
+/* Define to 1 if you have the `getloadavg' function. */
+/* #undef HAVE_GETLOADAVG */
+
+/* Define to 1 if you have the `getmntent' function. */
+/* #undef HAVE_GETMNTENT */
+
+/* Define to 1 if you have the <getopt.h> header file. */
+/* #undef HAVE_GETOPT_H */
+
+/* Define to 1 if you have the `getpagesize' function. */
+/* #undef HAVE_GETPAGESIZE */
+
+/* Define to 1 if you have the `getpid' function. */
+#define HAVE_GETPID 1
+
+/* Define to 1 if you have the `getpwnam' function. */
+/* #undef HAVE_GETPWNAM */
+
+/* Define to 1 if you have the `gettimeofday' function. */
+/* #undef HAVE_GETTIMEOFDAY */
+
+/* Define to 1 if you have the <grp.h> header file. */
+/* #undef HAVE_GRP_H */
+
+/* Define to 1 if you have the `if_freenameindex' function. */
+/* #undef HAVE_IF_FREENAMEINDEX */
+
+/* Define to 1 if you have the `if_nameindex' function. */
+/* #undef HAVE_IF_NAMEINDEX */
+
+/* Define to 1 if you have the <inet/mib2.h> header file. */
+/* #undef HAVE_INET_MIB2_H */
+
+#ifdef HAVE_WIN32_PLATFORM_SDK
+/* Define to 1 if you have the <iphlpapi.h> header file. */
+#define HAVE_IPHLPAPI_H
+#endif
+
+/* Define to 1 if the system has the type `int32_t'. */
+#define HAVE_INT32_T 1
+
+/* define if you have type uint32_t */
+#define HAVE_UINT32_T 1
+
+/* define if you have type u_int32_t */
+#undef HAVE_U_INT32_T
+
+/* define if you have type int64_t */
+#define HAVE_INT64_T 1
+
+/* define if you have type uint64_t */
+#define HAVE_UINT64_T 1
+
+/* define if you have type u_int64_t */
+#undef HAVE_U_INT64_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Define to 1 if you have the <ioctls.h> header file. */
+/* #undef HAVE_IOCTLS_H */
+
+/* Define to 1 if you have the <io.h> header file. */
+#define HAVE_IO_H 1
+
+/* Define to 1 if you have the `knlist' function. */
+/* #undef HAVE_KNLIST */
+
+/* Define to 1 if you have the <kstat.h> header file. */
+/* #undef HAVE_KSTAT_H */
+
+/* Define to 1 if you have the `kvm_getprocs' function. */
+/* #undef HAVE_KVM_GETPROCS */
+
+/* Define to 1 if you have the <kvm.h> header file. */
+/* #undef HAVE_KVM_H */
+
+/* Define to 1 if you have the `kvm_openfiles' function. */
+/* #undef HAVE_KVM_OPENFILES */
+
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+/* #undef HAVE_LIBCRYPTO */
+
+/* Define to 1 if you have the `efence' library (-lefence). */
+/* #undef HAVE_LIBEFENCE */
+
+/* Define to 1 if you have the `elf' library (-lelf). */
+/* #undef HAVE_LIBELF */
+
+/* Define to 1 if you have the `kstat' library (-lkstat). */
+/* #undef HAVE_LIBKSTAT */
+
+/* Define to 1 if you have the `m' library (-lm). */
+/* #undef HAVE_LIBM */
+
+/* Define to 1 if you have the `mld' library (-lmld). */
+/* #undef HAVE_LIBMLD */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the <libperfstat.h> header file. */
+/* #undef HAVE_LIBPERFSTAT_H */
+
+/* Define to 1 if you have the `pkcs11' library (-lpkcs11). */
+/* #undef HAVE_LIBPKCS11 */
+
+/* Define to 1 if you have the `RSAglue' library (-lRSAglue). */
+/* #undef HAVE_LIBRSAGLUE */
+
+/* Define to 1 if you have the `rsaref' library (-lrsaref). */
+/* #undef HAVE_LIBRSAREF */
+
+/* Define to 1 if you have the `sensors' library (-lsensors). */
+/* #undef HAVE_LIBSENSORS */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <linux/hdreg.h> header file. */
+/* #undef HAVE_LINUX_HDREG_H */
+
+/* Define to 1 if you have the <linux/tasks.h> header file. */
+/* #undef HAVE_LINUX_TASKS_H */
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if you have the `lrand48' function. */
+/* #undef HAVE_LRAND48 */
+
+/* Define to 1 if you have the <machine/param.h> header file. */
+/* #undef HAVE_MACHINE_PARAM_H */
+
+/* Define to 1 if you have the <machine/pte.h> header file. */
+/* #undef HAVE_MACHINE_PTE_H */
+
+/* Define to 1 if you have the <machine/types.h> header file. */
+/* #undef HAVE_MACHINE_TYPES_H */
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mkstemp' function. */
+/* #undef HAVE_MKSTEMP */
+
+/* Define to 1 if you have the `mktime' function. */
+/* #undef HAVE_MKTIME */
+
+/* Define to 1 if you have the <mntent.h> header file. */
+/* #undef HAVE_MNTENT_H */
+
+/* Define to 1 if you have the <mtab.h> header file. */
+/* #undef HAVE_MTAB_H */
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <netdb.h> header file. */
+/* #undef HAVE_NETDB_H */
+
+/* Define to 1 if you have the <netinet6/in6_pcb.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_IN6_PCB_H */
+
+/* Define to 1 if you have the <netinet6/in6_var.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_IN6_VAR_H */
+
+/* Define to 1 if you have the <netinet6/ip6_var.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_IP6_VAR_H */
+
+/* Define to 1 if you have the <netinet6/nd6.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_ND6_H */
+
+/* Define to 1 if you have the <netinet6/tcp6_fsm.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_TCP6_FSM_H */
+
+/* Define to 1 if you have the <netinet6/tcp6.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_TCP6_H */
+
+/* Define to 1 if you have the <netinet6/tcp6_timer.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_TCP6_TIMER_H */
+
+/* Define to 1 if you have the <netinet6/tcp6_var.h> header file. */
+/* #undef HAVE_NETNETSNMP_ENABLE_IPV6_TCP6_VAR_H */
+
+/* Define to 1 if you have the <netinet/icmp_var.h> header file. */
+/* #undef HAVE_NETINET_ICMP_VAR_H */
+
+/* Define to 1 if you have the <netinet/if_ether.h> header file. */
+/* #undef HAVE_NETINET_IF_ETHER_H */
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+/* #undef HAVE_NETINET_IN_H */
+
+/* Define to 1 if you have the <netinet/in_systm.h> header file. */
+/* #undef HAVE_NETINET_IN_SYSTM_H */
+
+/* Define to 1 if you have the <netinet/in_var.h> header file. */
+/* #undef HAVE_NETINET_IN_VAR_H */
+
+/* Define to 1 if you have the <netinet/ip6.h> header file. */
+/* #undef HAVE_NETINET_IP6_H */
+
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+/* #undef HAVE_NETINET_IP_H */
+
+/* Define to 1 if you have the <netinet/ip_icmp.h> header file. */
+/* #undef HAVE_NETINET_IP_ICMP_H */
+
+/* Define to 1 if you have the <netinet/icmp6.h> header file. */
+/* #undef HAVE_NETINET_ICMP6_H */
+
+/* Define to 1 if you have the <netinet/ip_var.h> header file. */
+/* #undef HAVE_NETINET_IP_VAR_H */
+
+/* Define to 1 if you have the <netinet/tcpip.h> header file. */
+/* #undef HAVE_NETINET_TCPIP_H */
+
+/* Define to 1 if you have the <netinet/tcp_fsm.h> header file. */
+/* #undef HAVE_NETINET_TCP_FSM_H */
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+/* #undef HAVE_NETINET_TCP_H */
+
+/* Define to 1 if you have the <netinet/tcp_timer.h> header file. */
+/* #undef HAVE_NETINET_TCP_TIMER_H */
+
+/* Define to 1 if you have the <netinet/tcp_var.h> header file. */
+/* #undef HAVE_NETINET_TCP_VAR_H */
+
+/* Define to 1 if you have the <netinet/udp.h> header file. */
+/* #undef HAVE_NETINET_UDP_H */
+
+/* Define to 1 if you have the <netinet/udp_var.h> header file. */
+/* #undef HAVE_NETINET_UDP_VAR_H */
+
+/* Define to 1 if you have the <netipx/ipx.h> header file. */
+/* #undef HAVE_NETIPX_IPX_H */
+
+/* Define to 1 if you have the <net/if_dl.h> header file. */
+/* #undef HAVE_NET_IF_DL_H */
+
+/* Define to 1 if you have the <net/if.h> header file. */
+/* #undef HAVE_NET_IF_H */
+
+/* Define to 1 if you have the <net/if_mib.h> header file. */
+/* #undef HAVE_NET_IF_MIB_H */
+
+/* Define to 1 if you have the <net/if_types.h> header file. */
+/* #undef HAVE_NET_IF_TYPES_H */
+
+/* Define to 1 if you have the <net/if_var.h> header file. */
+/* #undef HAVE_NET_IF_VAR_H */
+
+/* Define to 1 if you have the <net/route.h> header file. */
+/* #undef HAVE_NET_ROUTE_H */
+
+/* Define to 1 if you have the `nlist' function. */
+/* #undef HAVE_NLIST */
+
+/* Define to 1 if you have the <nlist.h> header file. */
+/* #undef HAVE_NLIST_H */
+
+/* Define to 1 if you have the <openssl/aes.h> header file. */
+/* #undef HAVE_OPENSSL_AES_H */
+
+/* Define to 1 if you have the <openssl/des.h> header file. */
+/* #undef HAVE_OPENSSL_DES_H */
+
+/* Define to 1 if you have the <openssl/dh.h> header file. */
+/* #undef HAVE_OPENSSL_DH_H */
+
+/* Define to 1 if you have the <openssl/evp.h> header file. */
+/* #undef HAVE_OPENSSL_EVP_H */
+
+/* Define to 1 if you have the <openssl/hmac.h> header file. */
+/* #undef HAVE_OPENSSL_HMAC_H */
+
+/* Define to 1 if you have the <osreldate.h> header file. */
+/* #undef HAVE_OSRELDATE_H */
+
+/* Define to 1 if you have the <pkginfo.h> header file. */
+/* #undef HAVE_PKGINFO_H */
+
+/* Define to 1 if you have the <pkglocs.h> header file. */
+/* #undef HAVE_PKGLOCS_H */
+
+/* Define if you have <process.h> header file. (Win32-getpid) */
+#define HAVE_PROCESS_H 1
+
+/* Define to 1 if you have the <pthread.h> header file. */
+/* #undef HAVE_PTHREAD_H */
+
+/* Define to 1 if you have the <pwd.h> header file. */
+/* #undef HAVE_PWD_H */
+
+/* Define to 1 if you have the `rand' function. */
+#define HAVE_RAND 1
+
+/* Define to 1 if you have the `random' function. */
+#define HAVE_RAND 1
+
+/* Define to 1 if you have the `regcomp' function. */
+/* #undef HAVE_REGCOMP */
+
+/* Define to 1 if you have the <regex.h> header file. */
+/* #undef HAVE_REGEX_H */
+
+/* Define to 1 if you have the `rpmGetPath' function. */
+/* #undef HAVE_RPMGETPATH */
+
+/* Define to 1 if you have the <rpmio.h> header file. */
+/* #undef HAVE_RPMIO_H */
+
+/* Define to 1 if you have the <rpm/rpmio.h> header file. */
+/* #undef HAVE_RPM_RPMIO_H */
+
+/* Define to 1 if you have the <search.h> header file. */
+#define HAVE_SEARCH_H 1
+
+/* Define to 1 if you have the <security/cryptoki.h> header file. */
+/* #undef HAVE_SECURITY_CRYPTOKI_H */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef HAVE_SELECT */
+
+/* Define to 1 if you have the `setenv' function. */
+/* #undef HAVE_SETENV */
+
+/* Define to 1 if you have the `setgid' function. */
+/* #undef HAVE_SETGID */
+
+/* Define to 1 if you have the `setgroups' function. */
+/* #undef HAVE_SETGROUPS */
+
+/* Define to 1 if you have the `setitimer' function. */
+/* #undef HAVE_SETITIMER */
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `setmntent' function. */
+/* #undef HAVE_SETMNTENT */
+
+/* Define to 1 if you have the `setsid' function. */
+/* #undef HAVE_SETSID */
+
+/* Define to 1 if you have the `setuid' function. */
+/* #undef HAVE_SETUID */
+
+/* Define to 1 if you have the <sgtty.h> header file. */
+/* #undef HAVE_SGTTY_H */
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef HAVE_SIGACTION */
+
+/* Define to 1 if you have the `sigalrm' function. */
+/* #undef HAVE_SIGALRM */
+
+/* Define to 1 if you have the `sigblock' function. */
+/* #undef HAVE_SIGBLOCK */
+
+/* Define to 1 if you have the `sighold' function. */
+/* #undef HAVE_SIGHOLD */
+
+/* Define to 1 if you have the `signal' function. */
+/* #undef HAVE_SIGNAL */
+
+/* Define to 1 if you have the `sigset' function. */
+/* #undef HAVE_SIGSET */
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if you have the `statfs' function. */
+/* #undef HAVE_STATFS */
+
+/* Define to 1 if you have the `statvfs' function. */
+/* #undef HAVE_STATVFS */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_STDINT_H 1
+#endif
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `stime' function. */
+/* #undef HAVE_STIME */
+
+/* Define to 1 if you have the `strcasestr' function. */
+/* #undef HAVE_STRCASESTR */
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+/* #undef HAVE_STRINGS_H */
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef HAVE_STRLCPY */
+
+/* Define to 1 if you have the `strncasecmp' function. */
+/* #undef HAVE_STRNCASECMP */
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
+/* Define to 1 if you have the <syslog.h> header file. */
+/* #undef HAVE_SYSLOG_H */
+
+/* Define to 1 if you have the `system' function. */
+#define HAVE_SYSTEM 1
+
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+/* #undef HAVE_SYS_CDEFS_H */
+
+/* Define to 1 if you have the <sys/conf.h> header file. */
+/* #undef HAVE_SYS_CONF_H */
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/diskio.h> header file. */
+/* #undef HAVE_SYS_DISKIO_H */
+
+/* Define to 1 if you have the <sys/dkio.h> header file. */
+/* #undef HAVE_SYS_DKIO_H */
+
+/* Define to 1 if you have the <sys/dmap.h> header file. */
+/* #undef HAVE_SYS_DMAP_H */
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+/* #undef HAVE_SYS_FILE_H */
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+/* #undef HAVE_SYS_FILIO_H */
+
+/* Define to 1 if you have the <sys/fixpoint.h> header file. */
+/* #undef HAVE_SYS_FIXPOINT_H */
+
+/* Define to 1 if you have the <sys/fs.h> header file. */
+/* #undef HAVE_SYS_FS_H */
+
+/* Define to 1 if you have the <sys/hashing.h> header file. */
+/* #undef HAVE_SYS_HASHING_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/loadavg.h> header file. */
+/* #undef HAVE_SYS_LOADAVG_H */
+
+/* Define to 1 if you have the <sys/mbuf.h> header file. */
+/* #undef HAVE_SYS_MBUF_H */
+
+/* Define to 1 if you have the <sys/mntent.h> header file. */
+/* #undef HAVE_SYS_MNTENT_H */
+
+/* Define to 1 if you have the <sys/mnttab.h> header file. */
+/* #undef HAVE_SYS_MNTTAB_H */
+
+/* Define to 1 if you have the <sys/mount.h> header file. */
+/* #undef HAVE_SYS_MOUNT_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+/* #undef HAVE_SYS_PARAM_H */
+
+/* Define to 1 if you have the <sys/pool.h> header file. */
+/* #undef HAVE_SYS_POOL_H */
+
+/* Define to 1 if you have the <sys/proc.h> header file. */
+/* #undef HAVE_SYS_PROC_H */
+
+/* Define to 1 if you have the <sys/protosw.h> header file. */
+/* #undef HAVE_SYS_PROTOSW_H */
+
+/* Define to 1 if you have the <sys/pstat.h> header file. */
+/* #undef HAVE_SYS_PSTAT_H */
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+/* #undef HAVE_SYS_QUEUE_H */
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/socketvar.h> header file. */
+/* #undef HAVE_SYS_SOCKETVAR_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+/* #undef HAVE_SYS_SOCKIO_H */
+
+/* Define to 1 if you have the <sys/statfs.h> header file. */
+/* #undef HAVE_SYS_STATFS_H */
+
+/* Define to 1 if you have the <sys/statvfs.h> header file. */
+/* #undef HAVE_SYS_STATVFS_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/stream.h> header file. */
+/* #undef HAVE_SYS_STREAM_H */
+
+/* Define to 1 if you have the <sys/swap.h> header file. */
+/* #undef HAVE_SYS_SWAP_H */
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+/* #undef HAVE_SYS_SYSCTL_H */
+
+/* Define to 1 if you have the <sys/sysmp.h> header file. */
+/* #undef HAVE_SYS_SYSMP_H */
+
+/* Define to 1 if you have the <sys/tcpipstats.h> header file. */
+/* #undef HAVE_SYS_TCPIPSTATS_H */
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+/* #undef HAVE_SYS_TIME_H */
+
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#define HAVE_SYS_TIMEB_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+/* #undef HAVE_SYS_UN_H */
+
+/* Define to 1 if you have the <sys/user.h> header file. */
+/* #undef HAVE_SYS_USER_H */
+
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+/* #undef HAVE_SYS_UTSNAME_H */
+
+/* Define to 1 if you have the <sys/vfs.h> header file. */
+/* #undef HAVE_SYS_VFS_H */
+
+/* Define to 1 if you have the <sys/vmmac.h> header file. */
+/* #undef HAVE_SYS_VMMAC_H */
+
+/* Define to 1 if you have the <sys/vmmeter.h> header file. */
+/* #undef HAVE_SYS_VMMETER_H */
+
+/* Define to 1 if you have the <sys/vmparam.h> header file. */
+/* #undef HAVE_SYS_VMPARAM_H */
+
+/* Define to 1 if you have the <sys/vmsystm.h> header file. */
+/* #undef HAVE_SYS_VMSYSTM_H */
+
+/* Define to 1 if you have the <sys/vm.h> header file. */
+/* #undef HAVE_SYS_VM_H */
+
+/* Define to 1 if you have the <sys/vnode.h> header file. */
+/* #undef HAVE_SYS_VNODE_H */
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to 1 if you have the `tcgetattr' function. */
+/* #undef HAVE_TCGETATTR */
+
+/* Define to 1 if you have the <ufs/ffs/fs.h> header file. */
+/* #undef HAVE_UFS_FFS_FS_H */
+
+/* Define to 1 if you have the <ufs/fs.h> header file. */
+/* #undef HAVE_UFS_FS_H */
+
+/* Define to 1 if you have the <ufs/ufs/dinode.h> header file. */
+/* #undef HAVE_UFS_UFS_DINODE_H */
+
+/* Define to 1 if you have the <ufs/ufs/inode.h> header file. */
+/* #undef HAVE_UFS_UFS_INODE_H */
+
+/* Define to 1 if you have the <ufs/ufs/quota.h> header file. */
+/* #undef HAVE_UFS_UFS_QUOTA_H */
+
+/* Define to 1 if you have the `uname' function. */
+/* #undef HAVE_UNAME */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if you have the `usleep' function. */
+/* #undef HAVE_USLEEP */
+
+/* Define to 1 if you have the <utmpx.h> header file. */
+/* #undef HAVE_UTMPX_H */
+
+/* Define to 1 if you have the <utsname.h> header file. */
+/* #undef HAVE_UTSNAME_H */
+
+/* Define to 1 if you have the <uvm/uvm_extern.h> header file. */
+/* #undef HAVE_UVM_UVM_EXTERN_H */
+
+/* Define to 1 if you have the <uvm/uvm_param.h> header file. */
+/* #undef HAVE_UVM_UVM_PARAM_H */
+
+/* Define to 1 if you have the <vm/swap_pager.h> header file. */
+/* #undef HAVE_VM_SWAP_PAGER_H */
+
+/* Define to 1 if you have the <vm/vm_extern.h> header file. */
+/* #undef HAVE_VM_VM_EXTERN_H */
+
+/* Define to 1 if you have the <vm/vm.h> header file. */
+/* #undef HAVE_VM_VM_H */
+
+/* Define to 1 if you have the <vm/vm_param.h> header file. */
+/* #undef HAVE_VM_VM_PARAM_H */
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the <winsock.h> header file. */
+#define HAVE_WINSOCK_H 1
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#define HAVE_WINSOCK2_H 1
+
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#define HAVE_WS2TCPIP_H 1
+
+/* Define to 1 if you have the <xti.h> header file. */
+/* #undef HAVE_XTI_H */
+
+/* Define to the address where bug reports for this package should be sent. */
+/* #undef PACKAGE_BUGREPORT */
+
+/* Define to the full name of this package. */
+#ifndef PACKAGE_NAME
+#define PACKAGE_NAME "Net-SNMP"
+#endif
+
+/* Define to the full name and version of this package. */
+/* #undef PACKAGE_STRING */
+
+/* Define to the one symbol short name of this package. */
+#ifndef PACKAGE_TARNAME
+#define PACKAGE_TARNAME "net-snmp"
+#endif
+
+/* Define to the version of this package. */
+/* #undef PACKAGE_VERSION */
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of a `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of a `intmax_t', as computed by sizeof. */
+#define SIZEOF_INTMAX_T 8
+
+/* The size of a `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+/* #undef TIME_WITH_SYS_TIME */
+
+/* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+/* # undef _ALL_SOURCE */
+#endif
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
+#define inline __inline
+
+/* Define to `long' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef pid_t */
+
+/* define if you have getdevs() */
+/* #undef HAVE_GETDEVS */
+
+/* define if you have devstat_getdevs() */
+/* #undef HAVE_DEVSTAT_GETDEVS */
+
+/* define if you have <netinet/in_pcb.h> */
+/* #undef HAVE_NETINET_IN_PCB_H */
+
+/* define if you have <sys/disklabel.h> */
+/* #undef HAVE_SYS_DISKLABEL_H */
+
+/* define if you are using linux and /proc/net/dev has the compressed
+ field, which exists in linux kernels 2.2 and greater. */
+/* #undef PROC_NET_DEV_HAS_COMPRESSED */
+
+/* define rtentry to ortentry on SYSV machines (alphas) */
+#define RTENTRY rtentry;
+
+/* Use BSD 4.4 routing table entries? */
+/* #undef RTENTRY_4_4 */
+
+/* Does struct sigaction have a sa_sigaction field? */
+/* #undef HAVE_STRUCT_SIGACTION_SA_SIGACTION */
+
+/* Does struct sockaddr have a sa_len field? */
+/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
+
+/* Does struct sockaddr have a sa_family2 field? */
+/* #undef HAVE_STRUCT_SOCKADDR_SA_UNION_SA_GENERIC_SA_FAMILY2 */
+
+/* Does struct in6_addr have a s6_un.sa6_ladd field? */
+/* #undef HAVE_STRUCT_IN6_ADDR_S6_UN_SA6_LADDR */
+
+/* msghdr.msg_control */
+/* #undef HAVE_STRUCT_MSGHDR_MSG_CONTROL */
+
+/* msghdr.msg_flags */
+/* #undef HAVE_STRUCT_MSGHDR_MSG_FLAGS */
+
+/* rtentry structure tests */
+/* #undef RTENTRY_RT_NEXT */
+/* #undef HAVE_STRUCT_RTENTRY_RT_DST */
+/* #undef HAVE_STRUCT_RTENTRY_RT_UNIT */
+/* #undef HAVE_STRUCT_RTENTRY_RT_USE */
+/* #undef HAVE_STRUCT_RTENTRY_RT_REFCNT */
+/* #undef HAVE_STRUCT_RTENTRY_RT_HASH */
+
+/* ifnet structure tests */
+/* #undef HAVE_STRUCT_IFNET_IF_BAUDRATE */
+/* #undef HAVE_STRUCT_IFNET_IF_BAUDRATE_IFS_VALUE */
+/* #undef HAVE_STRUCT_IFNET_IF_SPEED */
+/* #undef HAVE_STRUCT_IFNET_IF_TYPE */
+/* #undef HAVE_STRUCT_IFNET_IF_IMCASTS */
+/* #undef HAVE_STRUCT_IFNET_IF_IQDROPS */
+/* #undef HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_SEC */
+/* #undef HAVE_STRUCT_IFNET_IF_NOPROTO */
+/* #undef HAVE_STRUCT_IFNET_IF_OMCASTS */
+/* #undef HAVE_STRUCT_IFNET_IF_XNAME */
+/* #undef HAVE_STRUCT_IFNET_IF_OBYTES */
+/* #undef HAVE_STRUCT_IFNET_IF_IBYTES */
+/* #undef HAVE_STRUCT_IFNET_IF_ADDRLIST */
+
+/* tcpstat.tcps_rcvmemdrop */
+/* #undef HAVE_STRUCT_TCPSTAT_TCPS_RCVMEMDROP */
+
+/* udpstat.udps_discard */
+/* #undef HAVE_STRUCT_UDPSTAT_UDPS_DISCARD */
+
+/* udpstat.udps_discard */
+/* #undef HAVE_STRUCT_UDPSTAT_UDPS_NOPORT */
+
+/* udpstat.udps_discard */
+/* #undef HAVE_STRUCT_UDPSTAT_UDPS_NOPORTBCAST */
+
+/* udpstat.udps_discard */
+/* #undef HAVE_STRUCT_UDPSTAT_UDPS_FULLSOCK */
+
+/* arphd.at_next */
+/* #undef HAVE_STRUCT_ARPHD_AT_NEXT */
+
+/* ifaddr.ifa_next */
+/* #undef HAVE_STRUCT_IFADDR_IFA_NEXT */
+
+/* ifnet.if_mtu */
+/* #undef HAVE_STRUCT_IFNET_IF_MTU */
+
+/* swdevt.sw_nblksenabled */
+/* #undef HAVE_STRUCT_SWDEVT_SW_NBLKSENABLED */
+
+/* nlist.n_value */
+/* #undef HAVE_STRUCT_NLIST_N_VALUE */
+
+/* ipstat structure tests */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_CANTFORWARD */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_CANTFRAG */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_DELIVERED */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_FRAGDROPPED */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_FRAGTIMEOUT */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_LOCALOUT */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_NOPROTO */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_NOROUTE */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_ODROPPED */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_OFRAGMENTS */
+/* #undef HAVE_STRUCT_IPSTAT_IPS_REASSEMBLED */
+
+/* vfsstat.f_frsize */
+/* #undef HAVE_STRUCT_STATVFS_F_FRSIZE */
+
+/* vfsstat.f_files */
+/* #undef HAVE_STRUCT_STATVFS_F_FILES */
+
+/* statfs inode structure tests*/
+/* #undef HAVE_STRUCT_STATFS_F_FILES */
+/* #undef HAVE_STRUCT_STATFS_F_FFREE */
+/* #undef HAVE_STRUCT_STATFS_F_FAVAIL */
+
+/* des_ks_struct.weak_key */
+/* #undef HAVE_STRUCT_DES_KS_STRUCT_WEAK_KEY */
+
+/* ifnet needs to have _KERNEL defined */
+/* #undef IFNET_NEEDS_KERNEL */
+
+/* sysctl works to get boottime, etc... */
+/* #undef NETSNMP_CAN_USE_SYSCTL */
+
+/* type check for in_addr_t */
+/* #undef in_addr_t */
+
+/* define if SIOCGIFADDR exists in sys/ioctl.h */
+/* #undef SYS_IOCTL_H_HAS_SIOCGIFADDR */
+
+/* Mib-2 tree Info */
+/* These are the system information variables. */
+
+#define NETSNMP_VERS_DESC "unknown" /* overridden at run time */
+#define NETSNMP_SYS_NAME "unknown" /* overridden at run time */
+
+/* comment out the second define to turn off functionality for any of
+ these: (See README for details) */
+
+/* proc PROCESSNAME [MAX] [MIN] */
+#define NETSNMP_PROCMIBNUM 2
+
+/* exec/shell NAME COMMAND */
+#define NETSNMP_SHELLMIBNUM 8
+
+/* swap MIN */
+#define NETSNMP_MEMMIBNUM 4
+
+/* disk DISK MINSIZE */
+#define NETSNMP_DISKMIBNUM 9
+
+/* load 1 5 15 */
+#define NETSNMP_LOADAVEMIBNUM 10
+
+/* which version are you using? This mibloc will tell you */
+#define NETSNMP_VERSIONMIBNUM 100
+
+/* Reports errors the agent runs into */
+/* (typically its "can't fork, no mem" problems) */
+#define NETSNMP_ERRORMIBNUM 101
+
+/* The sub id of EXTENSIBLEMIB returned to queries of
+ .iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0 */
+#define NETSNMP_AGENTID 250
+
+/* This ID is returned after the NETSNMP_AGENTID above. IE, the resulting
+ value returned by a query to sysObjectID is
+ EXTENSIBLEMIB.NETSNMP_AGENTID.???, where ??? is defined below by OSTYPE */
+
+#define NETSNMP_HPUX9ID 1
+#define NETSNMP_SUNOS4ID 2
+#define NETSNMP_SOLARISID 3
+#define NETSNMP_OSFID 4
+#define NETSNMP_ULTRIXID 5
+#define NETSNMP_HPUX10ID 6
+#define NETSNMP_NETBSD1ID 7
+#define NETSNMP_FREEBSDID 8
+#define NETSNMP_IRIXID 9
+#define NETSNMP_LINUXID 10
+#define NETSNMP_BSDIID 11
+#define NETSNMP_OPENBSDID 12
+#define NETSNMP_WIN32ID 13
+#define NETSNMP_HPUX11ID 14
+#define NETSNMP_UNKNOWNID 255
+
+#ifdef hpux9
+#define OSTYPE NETSNMP_HPUX9ID
+#endif
+#ifdef hpux10
+#define OSTYPE NETSNMP_HPUX10ID
+#endif
+#ifdef hpux11
+#define OSTYPE NETSNMP_HPUX11ID
+#endif
+#ifdef sunos4
+#define OSTYPE NETSNMP_SUNOS4ID
+#endif
+#ifdef solaris2
+#define OSTYPE NETSNMP_SOLARISID
+#endif
+#if defined(osf3) || defined(osf4) || defined(osf5)
+#define OSTYPE NETSNMP_OSFID
+#endif
+#ifdef ultrix4
+#define OSTYPE NETSNMP_ULTRIXID
+#endif
+#ifdef netbsd1
+#define OSTYPE NETSNMP_NETBSD1ID
+#endif
+#if defined(__FreeBSD__)
+#define OSTYPE NETSNMP_FREEBSDID
+#endif
+#if defined(irix6) || defined(irix5)
+#define OSTYPE NETSNMP_IRIXID
+#endif
+#ifdef linux
+#define OSTYPE NETSNMP_LINUXID
+#endif
+#if defined(bsdi2) || defined(bsdi3) || defined(bsdi4)
+#define OSTYPE NETSNMP_BSDIID
+#endif
+#ifdef openbsd2
+#define OSTYPE NETSNMP_OPENBSDID
+#endif
+#ifdef WIN32
+#define OSTYPE NETSNMP_WIN32ID
+#endif
+/* unknown */
+#ifndef OSTYPE
+#define OSTYPE NETSNMP_UNKNOWNID
+#endif
+
+/* The enterprise number has been assigned by the IANA group. */
+/* Optionally, this may point to the location in the tree your */
+/* company/organization has been allocated. */
+/* The assigned enterprise number for the NET_SNMP MIB modules. */
+#define NETSNMP_ENTERPRISE_OID 8072
+#define NETSNMP_ENTERPRISE_MIB 1,3,6,1,4,1,8072
+#define NETSNMP_ENTERPRISE_DOT_MIB 1.3.6.1.4.1.8072
+#define NETSNMP_ENTERPRISE_DOT_MIB_LENGTH 7
+
+/* The assigned enterprise number for sysObjectID. */
+#define NETSNMP_SYSTEM_MIB 1,3,6,1,4,1,8072,3,2,OSTYPE
+#define NETSNMP_SYSTEM_DOT_MIB 1.3.6.1.4.1.8072.3.2.OSTYPE
+#define NETSNMP_SYSTEM_DOT_MIB_LENGTH 10
+
+/* The assigned enterprise number for notifications. */
+#define NETSNMP_NOTIFICATION_MIB 1,3,6,1,4,1,8072,4
+#define NETSNMP_NOTIFICATION_DOT_MIB 1.3.6.1.4.1.8072.4
+#define NETSNMP_NOTIFICATION_DOT_MIB_LENGTH 8
+
+/* this is the location of the ucdavis mib tree. It shouldn't be
+ changed, as the places it is used are expected to be constant
+ values or are directly tied to the UCD-SNMP-MIB. */
+#define NETSNMP_UCDAVIS_OID 2021
+#define NETSNMP_UCDAVIS_MIB 1,3,6,1,4,1,2021
+#define NETSNMP_UCDAVIS_DOT_MIB 1.3.6.1.4.1.2021
+#define NETSNMP_UCDAVIS_DOT_MIB_LENGTH 7
+
+/* this is the location of the net-snmp mib tree. It shouldn't be
+ changed, as the places it is used are expected to be constant
+ values or are directly tied to the UCD-SNMP-MIB. */
+#define NETSNMP_OID 8072
+#define NETSNMP_MIB 1,3,6,1,4,1,8072
+#define NETSNMP_DOT_MIB 1.3.6.1.4.1.8072
+#define NETSNMP_DOT_MIB_LENGTH 7
+
+/* how long to wait (seconds) for error querys before reseting the error trap.*/
+#define NETSNMP_ERRORTIMELENGTH 600
+
+/* Exec command to fix PROC problems */
+/* %s will be replaced by the process name in error */
+
+/* #define NETSNMP_PROCFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
+
+/* Exec command to fix EXEC problems */
+/* %s will be replaced by the exec/script name in error */
+
+/* #define NETSNMP_EXECFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
+
+/* Should exec output Cashing be used (speeds up things greatly), and
+ if so, After how many seconds should the cache re-newed? Note:
+ Don't define CASHETIME to disable cashing completely */
+
+#define NETSNMP_EXCACHETIME 30
+#define NETSNMP_CACHEFILE ".snmp-exec-cache"
+#define NETSNMP_MAXCACHESIZE (200*80) /* roughly 200 lines max */
+
+#define MAXDISKS 50 /* can't scan more than this number */
+
+/* misc defaults */
+
+/* default of 100 meg minimum if the minimum size is not specified in
+ the config file */
+#define NETSNMP_DEFDISKMINIMUMSPACE 100000
+
+#define NETSNMP_DEFMAXLOADAVE 12.0 /* default maximum load average before error */
+
+/* Because of sleep(1)s, this will also be time to wait (in seconds) for exec
+ to finish */
+#define NETSNMP_MAXREADCOUNT 100 /* max times to loop reading output from execs. */
+
+/* The original CMU code had this hardcoded as = 1 */
+#define NETSNMP_SNMPBLOCK 1 /* Set if snmpgets should block and never timeout */
+
+/* How long to wait before restarting the agent after a snmpset to
+ EXTENSIBLEMIB.NETSNMP_VERSIONMIBNUM.VERRESTARTAGENT. This is
+ necessary to finish the snmpset reply before restarting. */
+#define NETSNMP_RESTARTSLEEP 5
+
+/* Number of community strings to store */
+#define NETSNMP_NUM_COMMUNITIES 5
+
+/* UNdefine to allow specifying zero-length community string */
+/* #define NETSNMP_NO_ZEROLENGTH_COMMUNITY 1 */
+
+#define NETSNMP_LASTFIELD -1 /* internal define */
+
+/* configure options specified */
+#define NETSNMP_CONFIGURE_OPTIONS ""
+
+/* got socklen_t? */
+#ifdef HAVE_WIN32_PLATFORM_SDK
+#define HAVE_SOCKLEN_T 1
+#endif
+
+/* got in_addr_t? */
+/* #undef HAVE_IN_ADDR_T */
+
+#ifdef __MINGW32__
+/* got ssize_t? */
+#define HAVE_SSIZE_T
+#endif
+
+/* If you have openssl 0.9.7 or above, you likely have AES support. */
+/* #undef NETSNMP_USE_OPENSSL */
+
+#ifdef NETSNMP_USE_OPENSSL
+
+/* Define to 1 if you have the <openssl/dh.h> header file. */
+#define HAVE_OPENSSL_DH_H 1
+
+/* Define to 1 if you have the <openssl/aes.h> header file. */
+#define HAVE_OPENSSL_AES_H 1
+
+/* Define to 1 if you have the `EVP_MD_CTX_create' function. */
+#define HAVE_EVP_MD_CTX_CREATE 1
+
+/* Define to 1 if you have the `EVP_MD_CTX_destroy' function. */
+#define HAVE_EVP_MD_CTX_DESTROY 1
+
+/* Define to 1 if you have the `AES_cfb128_encrypt' function. */
+#define HAVE_AES_CFB128_ENCRYPT 1
+
+#if defined(HAVE_OPENSSL_AES_H) && defined(HAVE_AES_CFB128_ENCRYPT)
+#define HAVE_AES 1
+#endif
+
+#else /* ! NETSNMP_USE_OPENSSL */
+
+/* define if you are using the MD5 code ...*/
+#define NETSNMP_USE_INTERNAL_MD5 1
+
+#endif /* ! NETSNMP_USE_OPENSSL */
+
+
+/* define random functions */
+
+#ifndef HAVE_RANDOM
+#ifdef HAVE_LRAND48
+#define random lrand48
+#define srandom(s) srand48(s)
+#else
+#ifdef HAVE_RAND
+#define random rand
+#define srandom(s) srand(s)
+#endif
+#endif
+#endif
+
+/* define signal if DNE */
+
+#ifndef HAVE_SIGNAL
+#ifdef HAVE_SIGSET
+#define signal(a,b) sigset(a,b)
+#endif
+#endif
+
+/* define if you have librpm and libdb */
+/* #undef HAVE_LIBDB */
+/* #undef HAVE_LIBRPM */
+
+/* define if you have pkginfo */
+/* #undef HAVE_PKGINFO */
+
+/* define if you have gethostbyname */
+#define HAVE_GETHOSTBYNAME 1
+
+/* define if you have gethostbyaddr */
+#define HAVE_GETHOSTBYADDR 1
+
+/* printing system */
+/* #undef HAVE_LPSTAT */
+/* #undef LPSTAT_PATH */
+/* #undef HAVE_PRINTCAP */
+
+/* Pluggable transports. */
+
+/* This is defined if support for the UDP/IP transport domain is
+ available. */
+#define NETSNMP_TRANSPORT_UDP_DOMAIN 1
+
+/* This is defined if support for the "callback" transport domain is
+ available. */
+#define NETSNMP_TRANSPORT_CALLBACK_DOMAIN 1
+
+/* This is defined if support for the TCP/IP transport domain is
+ available. */
+#define NETSNMP_TRANSPORT_TCP_DOMAIN 1
+
+/* This is defined if support for the Unix transport domain
+ (a.k.a. "local IPC") is available. */
+/* #undef NETSNMP_TRANSPORT_UNIX_DOMAIN */
+
+/* This is defined if support for the AAL5 PVC transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN */
+
+/* This is defined if support for the IPX transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_IPX_DOMAIN */
+
+/* XXX do not modify. change the NETSNMP_ENABLE_IPV6 define instead */
+/* This is defined if support for the UDP/IPv6 transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN */
+
+/* XXX do not modify. change the NETSNMP_ENABLE_IPV6 define instead */
+/* This is defined if support for the TCP/IPv6 transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN */
+
+/* This is defined if support for the TLS transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_TLSBASE_DOMAIN */
+
+/* This is defined if support for the Alias transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_ALIAS_DOMAIN */
+
+/* This is defined if support for the SSH transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_SSH_DOMAIN */
+
+/* This is defined if support for the DTLS/UDP transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN */
+
+/* This is defined if support for the TLS/TCP transport domain is
+ available. */
+/* #undef NETSNMP_TRANSPORT_TLSTCP_DOMAIN */
+
+/* This is defined if support for stdin/out transport domain is available. */
+/* #undef NETSNMP_TRANSPORT_STD_DOMAIN */
+
+/* This is defined if support for the IPv4Base transport domain is available. */
+#define NETSNMP_TRANSPORT_IPV4BASE_DOMAIN 1
+
+/* define this if the USM security module is available */
+#define NETSNMP_SECMOD_USM 1
+
+/* define this if the KSM (kerberos based snmp) security module is available */
+/* #undef NETSNMP_SECMOD_KSM */
+
+/* define this if we're using the new MIT crypto API */
+/* #undef NETSNMP_USE_KERBEROS_MIT */
+
+/* define if you want to build with reentrant/threaded code (incomplete)*/
+/* #undef NETSNMP_REENTRANT */
+
+/* on aix, if you have perfstat */
+/* #undef HAVE_PERFSTAT */
+
+/* Not-to-be-compiled macros for use by configure only */
+#define config_require(x)
+#define config_version_require(x)
+#define config_warning(x)
+#define config_error(x)
+#define config_exclude(x)
+#define config_arch_require(x,y)
+#define config_parse_dot_conf(w,x,y,z)
+#define config_add_mib(x)
+#define config_belongs_in(x)
+
+#if defined (WIN32)
+#define ENV_SEPARATOR ";"
+#define ENV_SEPARATOR_CHAR ';'
+#else
+#define ENV_SEPARATOR ":"
+#define ENV_SEPARATOR_CHAR ':'
+#endif
+
+/*
+ * this must be before the system/machine includes, to allow them to
+ * override and turn off inlining. To do so, they should do the
+ * following:
+ *
+ * #undef NETSNMP_ENABLE_INLINE
+ * #define NETSNMP_ENABLE_INLINE 0
+ *
+ * A user having problems with their compiler can also turn off
+ * the use of inline by defining NETSNMP_NO_INLINE via their cflags:
+ *
+ * -DNETSNMP_NO_INLINE
+ *
+ * Header and source files should only test against NETSNMP_USE_INLINE:
+ *
+ * #ifdef NETSNMP_USE_INLINE
+ * NETSNMP_INLINE function(int parm) { return parm -1; }
+ * #endif
+ *
+ * Functions which should be static, regardless of whether or not inline
+ * is available or enabled should use the NETSNMP_STATIC_INLINE macro,
+ * like so:
+ *
+ * NETSNMP_STATIC_INLINE function(int parm) { return parm -1; }
+ *
+ * NOT like this:
+ *
+ * static NETSNMP_INLINE function(int parm) { return parm -1; }
+ *
+ */
+/*
+ * Win32 needs extern for inline function declarations in headers.
+ * See MS tech note Q123768:
+ * http://support.microsoft.com/default.aspx?scid=kb;EN-US;123768
+ */
+#define NETSNMP_INLINE extern inline
+#define NETSNMP_STATIC_INLINE static inline
+#define NETSNMP_ENABLE_INLINE 1
+
+#if notused
+#include NETSNMP_SYSTEM_INCLUDE_FILE
+#include NETSNMP_MACHINE_INCLUDE_FILE
+#endif
+
+#if NETSNMP_ENABLE_INLINE && !defined(NETSNMP_NO_INLINE)
+# define NETSNMP_USE_INLINE 1
+#else
+# undef NETSNMP_INLINE
+# define NETSNMP_INLINE
+# undef NETSNMP_STATIC_INLINE
+# define NETSNMP_STATIC_INLINE static
+#endif
+
+#ifdef WIN32
+
+#ifndef __MINGW32__
+typedef unsigned short mode_t;
+#endif
+#ifndef HAVE_STDINT_H
+typedef unsigned char uint8_t;
+typedef char int8_t;
+typedef unsigned __int16 uint16_t;
+typedef __int16 int16_t;
+typedef unsigned __int32 uint32_t;
+typedef __int32 int32_t;
+typedef unsigned __int64 uint64_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uintmax_t;
+typedef __int64 intmax_t;
+#else /* HAVE_STDINT_H */
+#include <stdint.h>
+#endif /* HAVE_STDINT_H */
+
+
+/* (u)intptr_t should only be needed for MSVC 6 32-bit. */
+/* SDK has it for 64-bit and newer MSVC should also have it in stddef.h. */
+#ifndef _INTPTR_T_DEFINED
+#ifdef _M_X64
+typedef __int64 intptr_t;
+#else
+typedef int intptr_t;
+#endif
+#define _INTPTR_T_DEFINED
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#ifdef _M_X64
+typedef unsigned __int64 uintptr_t;
+#else
+typedef unsigned int uintptr_t;
+#endif
+#define _UINTPTR_T_DEFINED
+#endif
+
+#ifndef __cplusplus
+enum {
+ netsnmp_compile_time_uintptr_t_size_check
+ = sizeof(struct netsnmp_compile_time_uintptr_t_size_check_s { int:-!(sizeof(uintptr_t) == sizeof(void*)); })
+};
+#endif
+
+/* Define if you have the closesocket function. */
+#define HAVE_CLOSESOCKET 1
+
+/* Define if you have raise() instead of alarm() */
+#define HAVE_RAISE 1
+
+/* define to 1 if you do not want to set global snmp_errno */
+#define DONT_SHARE_ERROR_WITH_OTHER_THREADS 1
+
+/* Defining vsnprintf is not necessary for MSVC 2008 or later */
+#if defined(_MSC_VER) && _MSC_VER < 1500
+#define vsnprintf _vsnprintf
+#endif
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER < 1600
+#define EADDRINUSE WSAEADDRINUSE
+#endif
+
+/* Define NETSNMP_USE_DLL when building or using netsnmp.DLL */
+/* #undef NETSNMP_USE_DLL */
+
+#if defined(NETSNMP_DLL) && !defined(NETSNMP_USE_DLL)
+#error NETSNMP_USE_DLL must be defined when building libsnmp as a DLL.
+#endif
+
+/*
+ * DLL decoration, if used at all, must be consistent.
+ * This is why NETSNMP_IMPORT is really an export decoration
+ * when it is encountered in a header file that is included
+ * during the compilation of a library source file.
+ * NETSNMP_DLL is set by the MSVC libsnmp_dll project
+ * in order to signal that the library sources are being compiled.
+ * Not defining NETSNMP_USE_DLL ignores the preceding, and renders
+ * the NETSNMP_IMPORT definitions harmless.
+ */
+
+#ifdef NETSNMP_USE_DLL
+ #ifdef NETSNMP_DLL
+ #if defined(_MSC_VER)
+ #define NETSNMP_IMPORT __declspec(dllexport)
+ #endif
+ #else
+ #if defined(_MSC_VER)
+ #define NETSNMP_IMPORT __declspec(dllimport)
+ #endif
+ #endif /* NETSNMP_DLL */
+#endif /* NETSNMP_USE_DLL */
+
+/* MSVC OpenSSL linker settings. */
+#if defined(_MSC_VER)
+# if defined(NETSNMP_USE_OPENSSL)
+# ifdef _DLL
+# ifdef _DEBUG
+# pragma comment(lib, "libeay32MDd.lib")
+# else
+# pragma comment(lib, "libeay32MD.lib")
+# endif
+# else
+# ifdef _DEBUG
+# pragma comment(lib, "libeay32MTd.lib")
+# else
+# pragma comment(lib, "libeay32MT.lib")
+# endif
+# endif
+# pragma comment(lib, "gdi32.lib")
+# pragma comment(lib, "user32.lib")
+# endif
+#endif
+
+#endif /* WIN32 */
+
+#ifndef NETSNMP_IMPORT
+# define NETSNMP_IMPORT extern
+#endif
+
+#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(DONT_USE_NLIST) && !defined(NETSNMP_NO_KMEM_USAGE)
+#define NETSNMP_CAN_USE_NLIST
+#endif
+
+#if HAVE_DMALLOC_H
+#define DMALLOC_FUNC_CHECK
+#endif
+
+/* #undef NETSNMP_ENABLE_LOCAL_SMUX */
+
+/* define if agentx transport is to use domain sockets only */
+/* #undef NETSNMP_AGENTX_DOM_SOCK_ONLY */
+
+#ifndef LOG_DAEMON
+#define LOG_DAEMON (3<<3) /* system daemons */
+#endif
+
+#if UCD_COMPATIBLE
+/* old and in the way */
+#define EXTENSIBLEMIB NETSNMP_UCDAVIS_MIB
+#endif
+
+#ifdef _MSC_VER
+/* Windows Vista and higher have inet_ntop but older Windows does not.
+ * We'll use the Net-SNMP version instead. */
+#undef HAVE_INET_NTOP
+#undef HAVE_INET_PTON
+
+/* IPv6 transports */
+#ifdef NETSNMP_ENABLE_IPV6
+ #define NETSNMP_TRANSPORT_TCPIPV6_DOMAIN 1
+ #define NETSNMP_TRANSPORT_UDPIPV6_DOMAIN 1
+ #define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1
+#else
+ #undef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+ #undef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+#endif
+#endif
+
+/*
+ * Although if_nametoindex() is available on Windows Vista, Windows Server
+ * 2008 and later in iphlpapi.dll, do not link with if_nametoindex() such
+ * that the Net-SNMP executable can be started on earlier Windows versions.
+ */
+#undef HAVE_IF_NAMETOINDEX
+
+#ifndef NI_MAXHOST
+#define NI_MAXHOST 1025
+#endif
+
+/* Define to 1 if you have the `strtoull' function. */
+/* #undef HAVE_STRTOULL */
+
+/*
+ * Module configuration and control starts here.
+ *
+ * Some of the defines herein are used to control
+ * groups of modules. The ones that have "CFG"
+ * are used especially to control the include files
+ * seen in {agent,mib}_module_includes.h, and the init entries
+ * which are invoked in {agent,mib}_module_inits.h.
+ *
+ * To disable a group, uncomment the associated define.
+ */
+
+/* CFG Define if compiling with the ucd_snmp module files. */
+#define USING_UCD_SNMP_MODULE 1
+
+/* CFG Define if compiling with the agentx module files. */
+#define USING_AGENTX_MODULE 1
+
+/* CFG Define if compiling with the host module files. */
+/* #undef USING_HOST_MODULE */
+
+/* CFG Define if compiling with the Rmon module files. */
+/* #undef USING_RMON_MODULE */
+
+/* CFG Define if compiling with the disman/event-mib module files. */
+#define USING_DISMAN_EVENT_MIB_MODULE 1
+
+/* CFG Define if compiling with the smux module files. */
+/* #undef USING_SMUX_MODULE */
+
+/* Define if compiling with the winExtDLL module. */
+/* #undef USING_WINEXTDLL_MODULE */
+
+/*
+ * Module configuration and control ends here.
+ */
+#define UDP_ADDRESSES_IN_HOST_ORDER 1
+
+/* Timeout in milliseconds for Win32 function WaitForSingleObject.
+ Used by agent pass. */
+#define NETSNMP_TIMEOUT_WAITFORSINGLEOBJECT 5000
+
+#ifdef HAVE_WIN32_PLATFORM_SDK
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+#endif
+
+/* Size prefix to use to printf a uint32_t */
+#define NETSNMP_PRI32 ""
+
+#ifdef _MSC_VER
+#ifdef _WIN64
+#define NETSNMP_PRIz "I64"
+#else
+#define NETSNMP_PRIz ""
+#endif
+#endif
+
+#endif /* NET_SNMP_CONFIG_H */
+
diff --git a/win32/netsnmpmibs/Makefile.in b/win32/netsnmpmibs/Makefile.in
new file mode 100644
index 0000000..44d0203
--- /dev/null
+++ b/win32/netsnmpmibs/Makefile.in
@@ -0,0 +1,665 @@
+PROGNAME=
+CFG=
+OUTDIR=
+INTDIR=
+SDK=
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+ALL : "..\lib\$(OUTDIR)\$(PROGNAME).lib"
+
+"..\lib\$(OUTDIR)" :
+ if not exist "..\lib\$(OUTDIR)/$(NULL)" mkdir "..\lib\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+!IF "$(CFG)" == "release"
+CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+!ELSEIF "$(CFG)" == "debug"
+CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\lib\$(OUTDIR)\$(PROGNAME).lib"
+LIB32_OBJS1= \
+ "$(INTDIR)\setSerialNo.obj" \
+ "$(INTDIR)\snmp_mib.obj" \
+ "$(INTDIR)\sysORTable.obj" \
+ "$(INTDIR)\system_mib.obj" \
+ "$(INTDIR)\updates.obj" \
+ "$(INTDIR)\vacm_context.obj" \
+ "$(INTDIR)\vacm_conf.obj" \
+ "$(INTDIR)\vacm_vars.obj" \
+ "$(INTDIR)\mteEvent.obj" \
+ "$(INTDIR)\mteEventConf.obj" \
+ "$(INTDIR)\mteEventNotificationTable.obj" \
+ "$(INTDIR)\mteEventSetTable.obj" \
+ "$(INTDIR)\mteEventTable.obj" \
+ "$(INTDIR)\mteObjects.obj" \
+ "$(INTDIR)\mteObjectsConf.obj" \
+ "$(INTDIR)\mteObjectsTable.obj" \
+ "$(INTDIR)\mteScalars.obj" \
+ "$(INTDIR)\mteTriggerBooleanTable.obj" \
+ "$(INTDIR)\mteTrigger.obj" \
+ "$(INTDIR)\mteTriggerConf.obj" \
+ "$(INTDIR)\mteTriggerDeltaTable.obj" \
+ "$(INTDIR)\mteTriggerExistenceTable.obj" \
+ "$(INTDIR)\mteTriggerTable.obj" \
+ "$(INTDIR)\mteTriggerThresholdTable.obj" \
+ "$(INTDIR)\example.obj" \
+ "$(INTDIR)\ucdDemoPublic.obj" \
+ "$(INTDIR)\errormib.obj" \
+ "$(INTDIR)\extensible.obj" \
+ "$(INTDIR)\file.obj"
+LIB32_OBJS2= \
+ "$(INTDIR)\loadave.obj" \
+ "$(INTDIR)\pass.obj" \
+ "$(INTDIR)\pass_common.obj" \
+ "$(INTDIR)\pass_persist.obj" \
+ "$(INTDIR)\proc.obj" \
+ "$(INTDIR)\proxy.obj" \
+ "$(INTDIR)\versioninfo.obj" \
+ "$(INTDIR)\snmpEngine.obj" \
+ "$(INTDIR)\snmpMPDStats.obj" \
+ "$(INTDIR)\usmConf.obj" \
+ "$(INTDIR)\usmStats.obj" \
+ "$(INTDIR)\usmUser.obj" \
+ "$(INTDIR)\snmpNotifyFilterProfileTable.obj" \
+ "$(INTDIR)\snmpNotifyFilterTable.obj" \
+ "$(INTDIR)\snmpNotifyFilterTable_data_access.obj" \
+ "$(INTDIR)\snmpNotifyFilterTable_interface.obj" \
+ "$(INTDIR)\snmpNotifyTable.obj" \
+ "$(INTDIR)\snmpTargetAddrEntry.obj" \
+ "$(INTDIR)\snmpTargetParamsEntry.obj" \
+ "$(INTDIR)\target.obj" \
+ "$(INTDIR)\target_counters.obj" \
+ "$(INTDIR)\agentx_config.obj" \
+ "$(INTDIR)\client.obj" \
+ "$(INTDIR)\master.obj" \
+ "$(INTDIR)\master_admin.obj" \
+ "$(INTDIR)\protocol.obj" \
+ "$(INTDIR)\subagent.obj" \
+ "$(INTDIR)\extend.obj" \
+ "$(INTDIR)\nsCache.obj" \
+ "$(INTDIR)\nsDebug.obj" \
+ "$(INTDIR)\nsLogging.obj" \
+ "$(INTDIR)\nsModuleTable.obj" \
+ "$(INTDIR)\nsTransactionTable.obj" \
+ "$(INTDIR)\execute.obj" \
+ "$(INTDIR)\iquery.obj" \
+ "$(INTDIR)\override.obj" \
+ "$(INTDIR)\header_generic.obj" \
+ "$(INTDIR)\header_simple_table.obj" \
+ "$(INTDIR)\header_complex.obj" \
+ "$(INTDIR)\mib_modules.obj" \
+ "$(INTDIR)\util_funcs.obj" \
+ "$(INTDIR)\Exit.obj" \
+ "$(INTDIR)\restart.obj" \
+ "$(INTDIR)\smux.obj"
+!IF "$(SDK)" == "true"
+LIB32_OBJS3= \
+ "$(INTDIR)\at.obj" \
+ "$(INTDIR)\icmp.obj" \
+ "$(INTDIR)\interfaces.obj" \
+ "$(INTDIR)\ip.obj" \
+ "$(INTDIR)\ipAddr.obj" \
+ "$(INTDIR)\notification_log.obj" \
+ "$(INTDIR)\route_write.obj" \
+ "$(INTDIR)\tcp.obj" \
+ "$(INTDIR)\tcpTable.obj" \
+ "$(INTDIR)\udp.obj" \
+ "$(INTDIR)\udpTable.obj" \
+ "$(INTDIR)\var_route.obj" \
+ "$(INTDIR)\winExtDLL.obj"
+!ENDIF
+LIB32_OBJS=$(LIB32_OBJS1) $(LIB32_OBJS2) $(LIB32_OBJS3)
+
+CLEAN :
+ -@for %f in ($(LIB32_OBJS1)) do erase %%f
+ -@for %f in ($(LIB32_OBJS2)) do erase %%f
+ -@for %f in ($(LIB32_OBJS3)) do erase %%f
+ -@erase "..\lib\$(OUTDIR)\$(PROGNAME).lib"
+
+"..\lib\$(OUTDIR)\$(PROGNAME).lib" : "..\lib\$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("$(PROGNAME).dep")
+!INCLUDE "$(PROGNAME).dep"
+!ELSE
+!MESSAGE Warning: cannot find "$(PROGNAME).dep"
+!ENDIF
+!ENDIF
+
+
+!IF "$(CFG)" == "release" || "$(CFG)" == "debug"
+SOURCE=..\..\agent\mibgroup\mibII\setSerialNo.c
+
+"$(INTDIR)\setSerialNo.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\snmp_mib.c
+
+"$(INTDIR)\snmp_mib.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\sysORTable.c
+
+"$(INTDIR)\sysORTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\system_mib.c
+
+"$(INTDIR)\system_mib.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\updates.c
+
+"$(INTDIR)\updates.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\vacm_context.c
+
+"$(INTDIR)\vacm_context.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\vacm_conf.c
+
+"$(INTDIR)\vacm_conf.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\vacm_vars.c
+
+"$(INTDIR)\vacm_vars.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEvent.c
+
+"$(INTDIR)\mteEvent.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEventConf.c
+
+"$(INTDIR)\mteEventConf.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEventNotificationTable.c
+
+"$(INTDIR)\mteEventNotificationTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEventSetTable.c
+
+"$(INTDIR)\mteEventSetTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEventTable.c
+
+"$(INTDIR)\mteEventTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteObjects.c
+
+"$(INTDIR)\mteObjects.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteObjectsConf.c
+
+"$(INTDIR)\mteObjectsConf.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteObjectsTable.c
+
+"$(INTDIR)\mteObjectsTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteScalars.c
+
+"$(INTDIR)\mteScalars.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerBooleanTable.c
+
+"$(INTDIR)\mteTriggerBooleanTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTrigger.c
+
+"$(INTDIR)\mteTrigger.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerConf.c
+
+"$(INTDIR)\mteTriggerConf.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerDeltaTable.c
+
+"$(INTDIR)\mteTriggerDeltaTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerExistenceTable.c
+
+"$(INTDIR)\mteTriggerExistenceTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerTable.c
+
+"$(INTDIR)\mteTriggerTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerThresholdTable.c
+
+"$(INTDIR)\mteTriggerThresholdTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\examples\example.c
+
+"$(INTDIR)\example.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\examples\ucdDemoPublic.c
+
+"$(INTDIR)\ucdDemoPublic.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\errormib.c"
+
+"$(INTDIR)\errormib.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\extensible.c"
+
+"$(INTDIR)\extensible.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\file.c"
+
+"$(INTDIR)\file.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\loadave.c"
+
+"$(INTDIR)\loadave.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\pass.c"
+
+"$(INTDIR)\pass.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\pass_common.c"
+
+"$(INTDIR)\pass_common.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\pass_persist.c"
+
+"$(INTDIR)\pass_persist.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\proc.c"
+
+"$(INTDIR)\proc.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\proxy.c"
+
+"$(INTDIR)\proxy.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\versioninfo.c"
+
+"$(INTDIR)\versioninfo.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\snmpv3\snmpEngine.c
+
+"$(INTDIR)\snmpEngine.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\snmpv3\snmpMPDStats.c
+
+"$(INTDIR)\snmpMPDStats.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\snmpv3\usmConf.c
+
+"$(INTDIR)\usmConf.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\snmpv3\usmStats.c
+
+"$(INTDIR)\usmStats.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\snmpv3\usmUser.c
+
+"$(INTDIR)\usmUser.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\notification\snmpNotifyFilterProfileTable.c
+
+"$(INTDIR)\snmpNotifyFilterProfileTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE="..\..\agent\mibgroup\notification-log-mib\notification_log.c"
+
+"$(INTDIR)\notification_log.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\snmp-notification-mib\snmpNotifyFilterTable\snmpNotifyFilterTable.c
+
+"$(INTDIR)\snmpNotifyFilterTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\snmp-notification-mib\snmpNotifyFilterTable\snmpNotifyFilterTable_data_access.c
+
+"$(INTDIR)\snmpNotifyFilterTable_data_access.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\snmp-notification-mib\snmpNotifyFilterTable\snmpNotifyFilterTable_interface.c
+
+"$(INTDIR)\snmpNotifyFilterTable_interface.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\notification\snmpNotifyTable.c
+
+"$(INTDIR)\snmpNotifyTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\target\snmpTargetAddrEntry.c
+
+"$(INTDIR)\snmpTargetAddrEntry.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\target\snmpTargetParamsEntry.c
+
+"$(INTDIR)\snmpTargetParamsEntry.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\target\target.c
+
+"$(INTDIR)\target.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\target\target_counters.c
+
+"$(INTDIR)\target_counters.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agentx\agentx_config.c
+
+"$(INTDIR)\agentx_config.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agentx\client.c
+
+"$(INTDIR)\client.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agentx\master.c
+
+"$(INTDIR)\master.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agentx\master_admin.c
+
+"$(INTDIR)\master_admin.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agentx\protocol.c
+
+"$(INTDIR)\protocol.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agentx\subagent.c
+
+"$(INTDIR)\subagent.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agent\extend.c
+
+"$(INTDIR)\extend.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agent\nsCache.c
+
+"$(INTDIR)\nsCache.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agent\nsDebug.c
+
+"$(INTDIR)\nsDebug.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agent\nsLogging.c
+
+"$(INTDIR)\nsLogging.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agent\nsModuleTable.c
+
+"$(INTDIR)\nsModuleTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\agent\nsTransactionTable.c
+
+"$(INTDIR)\nsTransactionTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\utilities\execute.c
+
+"$(INTDIR)\execute.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\utilities\iquery.c
+
+"$(INTDIR)\iquery.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\utilities\override.c
+
+"$(INTDIR)\override.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\util_funcs\header_generic.c
+
+"$(INTDIR)\header_generic.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\util_funcs\header_simple_table.c
+
+"$(INTDIR)\header_simple_table.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\header_complex.c
+
+"$(INTDIR)\header_complex.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mib_modules.c
+
+"$(INTDIR)\mib_modules.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\util_funcs.c
+
+"$(INTDIR)\util_funcs.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\util_funcs\Exit.c
+
+"$(INTDIR)\Exit.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\util_funcs\restart.c
+
+"$(INTDIR)\restart.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\smux\smux.c
+
+"$(INTDIR)\smux.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\winExtDLL.c
+"$(INTDIR)\winExtDLL.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\at.c
+"$(INTDIR)\at.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\icmp.c
+"$(INTDIR)\icmp.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\interfaces.c
+"$(INTDIR)\interfaces.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\ip.c
+"$(INTDIR)\ip.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\ipAddr.c
+"$(INTDIR)\ipAddr.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\route_write.c
+"$(INTDIR)\route_write.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\tcp.c
+"$(INTDIR)\tcp.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\tcpTable.c
+"$(INTDIR)\tcpTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\udp.c
+"$(INTDIR)\udp.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\udpTable.c
+"$(INTDIR)\udpTable.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\mibgroup\mibII\var_route.c
+"$(INTDIR)\var_route.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
diff --git a/win32/netsnmpmibs/netsnmpmibs.dsp b/win32/netsnmpmibs/netsnmpmibs.dsp
new file mode 100644
index 0000000..9034eed
--- /dev/null
+++ b/win32/netsnmpmibs/netsnmpmibs.dsp
@@ -0,0 +1,480 @@
+# Microsoft Developer Studio Project File - Name="netsnmpmibs" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=netsnmpmibs - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "netsnmpmibs.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "netsnmpmibs.mak" CFG="netsnmpmibs - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "netsnmpmibs - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "netsnmpmibs - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "netsnmpmibs - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "../lib/release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"../lib/release/netsnmpmibs.lib"
+
+!ELSEIF "$(CFG)" == "netsnmpmibs - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "../lib/debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"../lib/debug/netsnmpmibs.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "netsnmpmibs - Win32 Release"
+# Name "netsnmpmibs - Win32 Debug"
+# Begin Group "mibII"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\at.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\icmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\interfaces.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\ip.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\ipAddr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\route_write.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\setSerialNo.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\snmp_mib.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\sysORTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\system_mib.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\tcp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\tcpTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\udp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\udpTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\updates.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\vacm_conf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\vacm_context.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\vacm_vars.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\mibII\var_route.c
+# End Source File
+# End Group
+# Begin Group "disman"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEvent.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEventConf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEventNotificationTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEventSetTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteEventTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteObjects.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteObjectsConf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteObjectsTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteScalars.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerBooleanTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTrigger.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerConf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerDeltaTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerExistenceTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\disman\event\mteTriggerThresholdTable.c
+# End Source File
+# End Group
+# Begin Group "examples"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\examples\example.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\examples\ucdDemoPublic.c
+# End Source File
+# End Group
+# Begin Group "ucd-snmp"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\errormib.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\extensible.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\file.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\loadave.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\pass.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\pass_common.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\pass_persist.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\proc.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\proxy.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\ucd-snmp\versioninfo.c"
+# End Source File
+# End Group
+# Begin Group "snmpv3"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\snmpv3\snmpEngine.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\snmpv3\snmpMPDStats.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\snmpv3\usmConf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\snmpv3\usmStats.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\snmpv3\usmUser.c
+# End Source File
+# End Group
+# Begin Group "notification"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\notification-log-mib\notification_log.c"
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\notification\snmpNotifyFilterProfileTable.c
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\snmp-notification-mib\snmpNotifyFilterTable\snmpNotifyFilterTable.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\snmp-notification-mib\snmpNotifyFilterTable\snmpNotifyFilterTable_data_access.c"
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\agent\mibgroup\snmp-notification-mib\snmpNotifyFilterTable\snmpNotifyFilterTable_interface.c"
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\notification\snmpNotifyTable.c
+# End Source File
+# End Group
+# Begin Group "target"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\target\snmpTargetAddrEntry.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\target\snmpTargetParamsEntry.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\target\target.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\target\target_counters.c
+# End Source File
+# End Group
+# Begin Group "agentx"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agentx\agentx_config.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agentx\client.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agentx\master.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agentx\master_admin.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agentx\protocol.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agentx\subagent.c
+# End Source File
+# End Group
+# Begin Group "agent"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agent\extend.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agent\nsCache.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agent\nsDebug.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agent\nsLogging.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agent\nsModuleTable.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\agent\nsTransactionTable.c
+# End Source File
+# End Group
+# Begin Group "utilities"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\utilities\execute.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\util_funcs\Exit.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\header_complex.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\util_funcs\header_generic.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\util_funcs\header_simple_table.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\utilities\iquery.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mib_modules.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\utilities\override.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\util_funcs\restart.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\util_funcs.c
+# End Source File
+# End Group
+# Begin Group "winExtDLL"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\winExtDLL.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\winExtDLL.h
+# End Source File
+# End Group
+# Begin Group "smux"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\agent\mibgroup\smux\smux.c
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/win32/nmakeperl.bat b/win32/nmakeperl.bat
new file mode 100755
index 0000000..d380453
--- /dev/null
+++ b/win32/nmakeperl.bat
@@ -0,0 +1,59 @@
+@echo off
+REM
+REM build Net-SNMP Perl module using nmake
+REM
+
+REM INSTALL_BASE must point to the directory ABOVE the library files.
+REM Generally follows what is the install-net-snmp.bat setting.
+
+set INSTALL_BASE="c:\usr"
+
+if "%1" == "-?" goto help
+if "%1" == "/?" goto help
+if "%1" == "-h" goto help
+if "%1" == "/h" goto help
+if "%1" == "-help" goto help
+if "%1" == "/help" goto help
+goto start
+
+:help
+echo .
+echo This script will compile the Net-SNMP Perl modules. Net-SNMP must
+echo already be installed.
+echo .
+echo The current install base is %INSTALL_BASE%.
+echo This must match the directory that Net-SNMP has been installed in.
+echo .
+echo To change the installation directory, modify the INSTALL_BASE variable
+echo inside this script.
+echo .
+echo Run this script from the base of the source directory, NOT the win32
+echo directory.
+echo .
+goto end
+
+:start
+
+echo Remember to run this script from the base of the source directory.
+
+cd perl
+
+REM choose the installed location...
+perl Makefile.PL CAPI=TRUE -NET-SNMP-PATH=%INSTALL_BASE%
+
+REM Or, if the libraries have been built, look back in the build directory.
+REM perl Makefile.PL CAPI=TRUE -NET-SNMP-IN-SOURCE=TRUE
+
+echo Make the Perl SNMP modules.
+nmake /nologo > nmake.out
+echo If errors are seen stop here and review perl\nmake.out.
+pause
+
+echo Test the Perl SNMP modules.
+nmake /nologo test > nmaketest.out 2>&1
+echo If no errors are seen, review test results in perl\nmaketest.out.
+
+cd ..
+
+:end
+
diff --git a/win32/snmpbulkget/snmpbulkget.dsp b/win32/snmpbulkget/snmpbulkget.dsp
new file mode 100644
index 0000000..39599db
--- /dev/null
+++ b/win32/snmpbulkget/snmpbulkget.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpbulkget" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpbulkget - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpbulkget.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpbulkget.mak" CFG="snmpbulkget - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpbulkget - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpbulkget - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpbulkget - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpbulkget.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpbulkget - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpbulkget.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpbulkget - Win32 Release"
+# Name "snmpbulkget - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpbulkget.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpbulkwalk/snmpbulkwalk.dsp b/win32/snmpbulkwalk/snmpbulkwalk.dsp
new file mode 100644
index 0000000..91e94d3
--- /dev/null
+++ b/win32/snmpbulkwalk/snmpbulkwalk.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpbulkwalk" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpbulkwalk - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpbulkwalk.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpbulkwalk.mak" CFG="snmpbulkwalk - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpbulkwalk - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpbulkwalk - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpbulkwalk - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpbulkwalk.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpbulkwalk - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpbulkwalk.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpbulkwalk - Win32 Release"
+# Name "snmpbulkwalk - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpbulkwalk.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpd/Makefile.in b/win32/snmpd/Makefile.in
new file mode 100644
index 0000000..652dd80
--- /dev/null
+++ b/win32/snmpd/Makefile.in
@@ -0,0 +1,124 @@
+PROGNAME=
+CFG=
+OUTDIR=
+INTDIR=
+SDK=
+SSL=
+LINKTYPE=
+
+# Set to 1 to allow the building using the DLL version of SNMPLIB.
+ALLOW_DLL=1
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+ALL : "..\bin\$(OUTDIR)\snmpd.exe" "$(INTDIR)"
+
+
+"..\bin\$(OUTDIR)" :
+ if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+!IF "$(CFG)" == "release"
+CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\winservice.res" /d "NDEBUG"
+!ELSE
+CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\winservice.res" /d "_DEBUG"
+!ENDIF
+
+!IF "$(LINKTYPE)" == "dynamic"
+CPP_PROJ=$(CPP_PROJ) /D "NMAKE_NETSNMP_USE_DLL"
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+LINK32=link.exe
+LINK32_FLAGS=netsnmp.lib netsnmpagent.lib netsnmpmibs.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /out:"..\bin\$(OUTDIR)/snmpd.exe" /libpath:"../lib/$(OUTDIR)"
+!IF "$(CFG)" == "release"
+LINK32_FLAGS=$(LINK32_FLAGS) /debug /pdb:"../bin/$(OUTDIR)/snmpd.pdb"
+!ELSE
+LINK32_FLAGS=$(LINK32_FLAGS) /debug /incremental:no /pdb:"../bin/$(OUTDIR)/snmpd.pdb" /pdbtype:sept
+!ENDIF
+LINK32_OBJS= \
+ "$(INTDIR)\auto_nlist.obj" \
+ "$(INTDIR)\kernel.obj" \
+ "$(INTDIR)\snmpd.obj" \
+ "$(INTDIR)\winservice.obj" \
+ "$(INTDIR)\winservice.res"
+
+CLEAN :
+ -@for %f in ($(LINK32_OBJS)) do erase %%f
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest"
+
+"..\bin\$(OUTDIR)\$(PROGNAME).exe" : "..\bin\$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+!IF "$(LINKTYPE)" == "static" || "$(ALLOW_DLL)" == "1"
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ if exist "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" \
+ mt.exe -manifest "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" -outputresource:"..\bin\$(OUTDIR)\$(PROGNAME).exe";1
+!ELSE # Linktype check
+ -@echo .
+ -@echo Aborting build. Applications can not be built using --linktype=dynamic
+ -@echo .
+!ENDIF
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("snmpd.dep")
+!INCLUDE "snmpd.dep"
+!ELSE
+!MESSAGE Warning: cannot find "snmpd.dep"
+!ENDIF
+!ENDIF
+
+
+SOURCE=..\..\agent\auto_nlist.c
+
+"$(INTDIR)\auto_nlist.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\kernel.c
+
+"$(INTDIR)\kernel.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\agent\snmpd.c
+
+"$(INTDIR)\snmpd.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\winservice.c
+
+"$(INTDIR)\winservice.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\snmplib\winservice.rc
+
+"$(INTDIR)\winservice.res" : $(SOURCE) "$(INTDIR)"
+ $(RSC) $(RSC_PROJ) /i "..\..\snmplib" $(SOURCE)
diff --git a/win32/snmpd/snmpd.dsp b/win32/snmpd/snmpd.dsp
new file mode 100644
index 0000000..45e2cad
--- /dev/null
+++ b/win32/snmpd/snmpd.dsp
@@ -0,0 +1,134 @@
+# Microsoft Developer Studio Project File - Name="snmpd" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpd - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpd.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpd.mak" CFG="snmpd - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpd - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpd - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpd - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpd.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpd - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpd.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpd - Win32 Release"
+# Name "snmpd - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\agent\auto_nlist.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\kernel.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\snmpd.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\winservice.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\winservice.rc
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\agent\auto_nlist.h"
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\autonlist.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\kernel.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\agent\snmpd.h
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\include\net-snmp\library\winservice.h"
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/win32/snmpdelta/snmpdelta.dsp b/win32/snmpdelta/snmpdelta.dsp
new file mode 100644
index 0000000..7f5a5d3
--- /dev/null
+++ b/win32/snmpdelta/snmpdelta.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpdelta" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpdelta - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpdelta.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpdelta.mak" CFG="snmpdelta - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpdelta - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpdelta - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpdelta - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpdelta.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpdelta - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpdelta.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpdelta - Win32 Release"
+# Name "snmpdelta - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpdelta.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpdf/snmpdf.dsp b/win32/snmpdf/snmpdf.dsp
new file mode 100644
index 0000000..e2e4b94
--- /dev/null
+++ b/win32/snmpdf/snmpdf.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpdf" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpdf - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpdf.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpdf.mak" CFG="snmpdf - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpdf - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpdf - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpdf - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpdf.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpdf - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpdf.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpdf - Win32 Release"
+# Name "snmpdf - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpdf.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpget/snmpget.dsp b/win32/snmpget/snmpget.dsp
new file mode 100644
index 0000000..0603232
--- /dev/null
+++ b/win32/snmpget/snmpget.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpget" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpget - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpget.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpget.mak" CFG="snmpget - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpget - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpget - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpget - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpget.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpget - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpget.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpget - Win32 Release"
+# Name "snmpget - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpget.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpgetnext/snmpgetnext.dsp b/win32/snmpgetnext/snmpgetnext.dsp
new file mode 100644
index 0000000..cb63c84
--- /dev/null
+++ b/win32/snmpgetnext/snmpgetnext.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpgetnext" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpgetnext - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpgetnext.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpgetnext.mak" CFG="snmpgetnext - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpgetnext - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpgetnext - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpgetnext - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpgetnext.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpgetnext - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpgetnext.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpgetnext - Win32 Release"
+# Name "snmpgetnext - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpgetnext.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpnetstat/Makefile.in b/win32/snmpnetstat/Makefile.in
new file mode 100644
index 0000000..e27d97d
--- /dev/null
+++ b/win32/snmpnetstat/Makefile.in
@@ -0,0 +1,360 @@
+PROGNAME=
+CFG=
+OUTDIR=
+INTDIR=
+SSL=
+LINKTYPE=
+
+# Set to 1 to allow the building using the DLL version of SNMPLIB.
+ALLOW_DLL=1
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+!IF "$(CFG)" == "release"
+
+ALL : "..\bin\$(OUTDIR)\$(PROGNAME).exe" "$(INTDIR)"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\if.obj"
+ -@erase "$(INTDIR)\inet.obj"
+ -@erase "$(INTDIR)\inet6.obj"
+ -@erase "$(INTDIR)\main.obj"
+ -@erase "$(INTDIR)\route.obj"
+ -@erase "$(INTDIR)\ffs.obj"
+ -@erase "$(INTDIR)\vc??.idb"
+ -@erase "$(INTDIR)\winstub.obj"
+ -@erase "$(INTDIR)\$(PROGNAME).pch"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest"
+
+"..\bin\$(OUTDIR)" :
+ if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+
+!IF "$(LINKTYPE)" == "dynamic"
+CPP_PROJ=$(CPP_PROJ) /D "NMAKE_NETSNMP_USE_DLL"
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\$(PROGNAME).bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=netsnmp.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:"../bin/$(OUTDIR)/$(PROGNAME).pdb" /debug /out:"../bin/$(OUTDIR)/$(PROGNAME).exe" /libpath:"../lib/release"
+LINK32_OBJS= \
+ "$(INTDIR)\if.obj" \
+ "$(INTDIR)\inet.obj" \
+ "$(INTDIR)\inet6.obj" \
+ "$(INTDIR)\main.obj" \
+ "$(INTDIR)\route.obj" \
+ "$(INTDIR)\ffs.obj" \
+ "$(INTDIR)\winstub.obj"
+
+"..\bin\$(OUTDIR)\$(PROGNAME).exe" : "..\bin\$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+!IF "$(LINKTYPE)" == "static" || "$(ALLOW_DLL)" == "1"
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ if exist "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" \
+ mt.exe -manifest "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" -outputresource:"..\bin\$(OUTDIR)\$(PROGNAME).exe";1
+!ELSE # Linktype check
+ -@echo .
+ -@echo Aborting build. Applications can not be built using --linktype=dynamic
+ -@echo .
+!ENDIF
+
+!ELSEIF "$(CFG)" == "debug"
+
+ALL : "..\bin\$(OUTDIR)\$(PROGNAME).exe" "$(INTDIR)\$(PROGNAME).bsc" "$(INTDIR)"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\if.obj"
+ -@erase "$(INTDIR)\if.sbr"
+ -@erase "$(INTDIR)\inet.obj"
+ -@erase "$(INTDIR)\inet.sbr"
+ -@erase "$(INTDIR)\inet6.obj"
+ -@erase "$(INTDIR)\inet6.sbr"
+ -@erase "$(INTDIR)\main.obj"
+ -@erase "$(INTDIR)\main.sbr"
+ -@erase "$(INTDIR)\route.obj"
+ -@erase "$(INTDIR)\route.sbr"
+ -@erase "$(INTDIR)\ffs.obj"
+ -@erase "$(INTDIR)\ffs.sbr"
+ -@erase "$(INTDIR)\vc??.idb"
+ -@erase "$(INTDIR)\vc??.pdb"
+ -@erase "$(INTDIR)\winstub.obj"
+ -@erase "$(INTDIR)\winstub.sbr"
+ -@erase "$(INTDIR)\$(PROGNAME).pch"
+ -@erase "$(INTDIR)\$(PROGNAME).bsc"
+ -@erase "$(INTDIR)\$(PROGNAME).pdb"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest"
+
+"..\bin\$(OUTDIR)" :
+ if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+
+!IF "$(LINKTYPE)" == "dynamic"
+CPP_PROJ=$(CPP_PROJ) /D "NMAKE_NETSNMP_USE_DLL"
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\$(PROGNAME).bsc"
+BSC32_SBRS= \
+ "$(INTDIR)\if.sbr" \
+ "$(INTDIR)\inet.sbr" \
+ "$(INTDIR)\inet6.sbr" \
+ "$(INTDIR)\main.sbr" \
+ "$(INTDIR)\route.sbr" \
+ "$(INTDIR)\ffs.sbr" \
+ "$(INTDIR)\winstub.sbr"
+
+"$(INTDIR)\$(PROGNAME).bsc" : "..\bin\$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=netsnmp.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /pdb:"../bin/$(OUTDIR)/$(PROGNAME).pdb" /debug /out:"..\bin\$(OUTDIR)/$(PROGNAME).exe" /pdbtype:sept /libpath:"../lib/debug"
+LINK32_OBJS= \
+ "$(INTDIR)\if.obj" \
+ "$(INTDIR)\inet.obj" \
+ "$(INTDIR)\inet6.obj" \
+ "$(INTDIR)\main.obj" \
+ "$(INTDIR)\route.obj" \
+ "$(INTDIR)\ffs.obj" \
+ "$(INTDIR)\winstub.obj"
+
+"..\bin\$(OUTDIR)\$(PROGNAME).exe" : "..\bin\$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+!IF "$(LINKTYPE)" == "static" || "$(ALLOW_DLL)" == "1"
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ if exist "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" \
+ mt.exe -manifest "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" -outputresource:"..\bin\$(OUTDIR)\$(PROGNAME).exe";1
+!ELSE # Linktype check
+ -@echo .
+ -@echo Aborting build. Applications can not be built using --linktype=dynamic
+ -@echo .
+!ENDIF
+
+!ENDIF
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("$(PROGNAME).dep")
+!INCLUDE "$(PROGNAME).dep"
+!ELSE
+!MESSAGE Warning: cannot find "$(PROGNAME).dep"
+!ENDIF
+!ENDIF
+
+
+!IF "$(CFG)" == "release" || "$(CFG)" == "debug"
+SOURCE=..\..\apps\$(PROGNAME)\if.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\if.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\if.obj" "$(INTDIR)\if.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\apps\$(PROGNAME)\inet.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\inet.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\inet.obj" "$(INTDIR)\inet.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\apps\$(PROGNAME)\inet6.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\inet6.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\inet6.obj" "$(INTDIR)\inet6.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\apps\$(PROGNAME)\main.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\main.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\main.obj" "$(INTDIR)\main.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\apps\$(PROGNAME)\route.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\route.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\route.obj" "$(INTDIR)\route.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\apps\$(PROGNAME)\ffs.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\ffs.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\ffs.obj" "$(INTDIR)\ffs.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\apps\$(PROGNAME)\winstub.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\winstub.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\winstub.obj" "$(INTDIR)\winstub.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+
+!ENDIF
+
diff --git a/win32/snmpnetstat/snmpnetstat.dsp b/win32/snmpnetstat/snmpnetstat.dsp
new file mode 100644
index 0000000..35dd7e8
--- /dev/null
+++ b/win32/snmpnetstat/snmpnetstat.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="snmpnetstat" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpnetstat - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpnetstat.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpnetstat.mak" CFG="snmpnetstat - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpnetstat - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpnetstat - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpnetstat - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpnetstat.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpnetstat - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpnetstat.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpnetstat - Win32 Release"
+# Name "snmpnetstat - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpnetstat\if.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmpnetstat\inet.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmpnetstat\inet6.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmpnetstat\main.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmpnetstat\route.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmpnetstat\ffs.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmpnetstat\winstub.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpset/snmpset.dsp b/win32/snmpset/snmpset.dsp
new file mode 100644
index 0000000..ad0f509
--- /dev/null
+++ b/win32/snmpset/snmpset.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpset" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpset - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpset.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpset.mak" CFG="snmpset - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpset - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpset - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpset - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpset.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpset - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpset.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpset - Win32 Release"
+# Name "snmpset - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpset.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpsm_init.h b/win32/snmpsm_init.h
new file mode 100644
index 0000000..c8a410b
--- /dev/null
+++ b/win32/snmpsm_init.h
@@ -0,0 +1 @@
+init_usm();
diff --git a/win32/snmpsm_shutdown.h b/win32/snmpsm_shutdown.h
new file mode 100644
index 0000000..0e0c551
--- /dev/null
+++ b/win32/snmpsm_shutdown.h
@@ -0,0 +1 @@
+shutdown_usm();
diff --git a/win32/snmpstatus/snmpstatus.dsp b/win32/snmpstatus/snmpstatus.dsp
new file mode 100644
index 0000000..e6a4100
--- /dev/null
+++ b/win32/snmpstatus/snmpstatus.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpstatus" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpstatus - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpstatus.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpstatus.mak" CFG="snmpstatus - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpstatus - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpstatus - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpstatus - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpstatus.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpstatus - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpstatus.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpstatus - Win32 Release"
+# Name "snmpstatus - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpstatus.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmptable/snmptable.dsp b/win32/snmptable/snmptable.dsp
new file mode 100644
index 0000000..1dfc138
--- /dev/null
+++ b/win32/snmptable/snmptable.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmptable" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmptable - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmptable.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmptable.mak" CFG="snmptable - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmptable - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmptable - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmptable - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmptable.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmptable - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmptable.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmptable - Win32 Release"
+# Name "snmptable - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmptable.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmptest/snmptest.dsp b/win32/snmptest/snmptest.dsp
new file mode 100644
index 0000000..89c08e9
--- /dev/null
+++ b/win32/snmptest/snmptest.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmptest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmptest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmptest.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmptest.mak" CFG="snmptest - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmptest - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmptest - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmptest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmptest.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmptest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmptest.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmptest - Win32 Release"
+# Name "snmptest - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmptest.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmptranslate/snmptranslate.dsp b/win32/snmptranslate/snmptranslate.dsp
new file mode 100644
index 0000000..c3eca02
--- /dev/null
+++ b/win32/snmptranslate/snmptranslate.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmptranslate" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmptranslate - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmptranslate.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmptranslate.mak" CFG="snmptranslate - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmptranslate - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmptranslate - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmptranslate - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmptranslate.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmptranslate - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmptranslate.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmptranslate - Win32 Release"
+# Name "snmptranslate - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmptranslate.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmptrap/snmptrap.dsp b/win32/snmptrap/snmptrap.dsp
new file mode 100644
index 0000000..c34ffd8
--- /dev/null
+++ b/win32/snmptrap/snmptrap.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmptrap" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmptrap - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmptrap.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmptrap.mak" CFG="snmptrap - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmptrap - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmptrap - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmptrap - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmptrap.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmptrap - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmptrap.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmptrap - Win32 Release"
+# Name "snmptrap - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmptrap.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmptrapd/Makefile.in b/win32/snmptrapd/Makefile.in
new file mode 100644
index 0000000..dc4fe50
--- /dev/null
+++ b/win32/snmptrapd/Makefile.in
@@ -0,0 +1,295 @@
+PROGNAME=
+CFG=
+OUTDIR=
+INTDIR=
+SSL=
+LINKTYPE=
+
+# Set to 1 to allow the building using the DLL version of SNMPLIB.
+ALLOW_DLL=1
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+!IF "$(CFG)" == "release"
+
+ALL : "..\bin\$(OUTDIR)\$(PROGNAME).exe" "$(INTDIR)"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\winservice.obj"
+ -@erase "$(INTDIR)\winservice.res"
+ -@erase "$(INTDIR)\$(PROGNAME).obj"
+ -@erase "$(INTDIR)\vc??.idb"
+ -@erase "$(INTDIR)\$(PROGNAME).pch"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest"
+
+"..\bin\$(OUTDIR)" :
+ if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+
+!IF "$(LINKTYPE)" == "dynamic"
+CPP_PROJ=$(CPP_PROJ) /D "NMAKE_NETSNMP_USE_DLL"
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\winservice.res" /d "NDEBUG"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\$(PROGNAME).bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=netsnmp.lib netsnmpagent.lib netsnmpmibs.lib netsnmptrapd.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:"../bin/$(OUTDIR)/$(PROGNAME).pdb" /debug /out:"..\bin\$(OUTDIR)/$(PROGNAME).exe" /libpath:"../lib/release"
+LINK32_OBJS= \
+ "$(INTDIR)\$(PROGNAME).obj" \
+ "$(INTDIR)\winservice.obj" \
+ "$(INTDIR)\winservice.res"
+
+"..\bin\$(OUTDIR)\$(PROGNAME).exe" : "..\bin\$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+!IF "$(LINKTYPE)" == "static" || "$(ALLOW_DLL)" == "1"
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ if exist "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" \
+ mt.exe -manifest "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" -outputresource:"..\bin\$(OUTDIR)\$(PROGNAME).exe";1
+!ELSE # Linktype check
+ -@echo .
+ -@echo Aborting build. Applications can not be built using --linktype=dynamic
+ -@echo .
+!ENDIF
+
+!ELSEIF "$(CFG)" == "debug"
+
+ALL : "..\bin\$(OUTDIR)\$(PROGNAME).exe" "$(INTDIR)\$(PROGNAME).bsc" "$(INTDIR)"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\winservice.obj"
+ -@erase "$(INTDIR)\winservice.res"
+ -@erase "$(INTDIR)\winservice.sbr"
+ -@erase "$(INTDIR)\$(PROGNAME).obj"
+ -@erase "$(INTDIR)\$(PROGNAME).sbr"
+ -@erase "$(INTDIR)\vc??.idb"
+ -@erase "$(INTDIR)\vc??.pdb"
+ -@erase "$(INTDIR)\$(PROGNAME).pch"
+ -@erase "$(INTDIR)\$(PROGNAME).bsc"
+ -@erase "$(INTDIR)\$(PROGNAME).pdb"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe"
+ -@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest"
+
+"..\bin\$(OUTDIR)" :
+ if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c
+
+!IF "$(LINKTYPE)" == "dynamic"
+CPP_PROJ=$(CPP_PROJ) /D "NMAKE_NETSNMP_USE_DLL"
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\winservice.res" /d "_DEBUG"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\$(PROGNAME).bsc"
+BSC32_SBRS= \
+ "$(INTDIR)\$(PROGNAME).sbr" \
+ "$(INTDIR)\winservice.sbr"
+
+"$(INTDIR)\$(PROGNAME).bsc" : "..\bin\$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=netsnmp.lib netsnmpagent.lib netsnmpmibs.lib netsnmptrapd.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /pdb:"../bin/$(OUTDIR)/$(PROGNAME).pdb" /debug /out:"..\bin\$(OUTDIR)/$(PROGNAME).exe" /pdbtype:sept /libpath:"../lib/debug"
+LINK32_OBJS= \
+ "$(INTDIR)\$(PROGNAME).obj" \
+ "$(INTDIR)\winservice.obj" \
+ "$(INTDIR)\winservice.res"
+
+"..\bin\$(OUTDIR)\$(PROGNAME).exe" : "..\bin\$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+!IF "$(LINKTYPE)" == "static" || "$(ALLOW_DLL)" == "1"
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ if exist "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" \
+ mt.exe -manifest "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" -outputresource:"..\bin\$(OUTDIR)\$(PROGNAME).exe";1
+!ELSE # Linktype check
+ -@echo .
+ -@echo Aborting build. Applications can not be built using --linktype=dynamic
+ -@echo .
+!ENDIF
+
+!ENDIF
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("$(PROGNAME).dep")
+!INCLUDE "$(PROGNAME).dep"
+!ELSE
+!MESSAGE Warning: cannot find "$(PROGNAME).dep"
+!ENDIF
+!ENDIF
+
+
+SOURCE=..\..\apps\$(PROGNAME).c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\$(PROGNAME).obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\$(PROGNAME).obj" "$(INTDIR)\$(PROGNAME).sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\apps\$(PROGNAME)_handlers.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\$(PROGNAME)_handlers.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\$(PROGNAME)_handlers.obj" "$(INTDIR)\$(PROGNAME)_handlers.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\apps\$(PROGNAME)_log.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\$(PROGNAME)_log.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\$(PROGNAME)_log.obj" "$(INTDIR)\$(PROGNAME)_log.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\snmplib\winservice.c
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\winservice.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\winservice.obj" "$(INTDIR)\winservice.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\..\snmplib\winservice.rc
+
+!IF "$(CFG)" == "release"
+
+
+"$(INTDIR)\winservice.res" : $(SOURCE) "$(INTDIR)"
+ $(RSC) /l 0x409 /fo"$(INTDIR)\winservice.res" /i "..\..\snmplib" /d "NDEBUG" $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "debug"
+
+
+"$(INTDIR)\winservice.res" : $(SOURCE) "$(INTDIR)"
+ $(RSC) /l 0x409 /fo"$(INTDIR)\winservice.res" /i "..\..\snmplib" /d "_DEBUG" $(SOURCE)
+
+
+!ENDIF
diff --git a/win32/snmptrapd/snmptrapd.dsp b/win32/snmptrapd/snmptrapd.dsp
new file mode 100644
index 0000000..9f49389
--- /dev/null
+++ b/win32/snmptrapd/snmptrapd.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="snmptrapd" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmptrapd - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmptrapd.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmptrapd.mak" CFG="snmptrapd - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmptrapd - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmptrapd - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmptrapd - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent\mibgroup" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmptrapd.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmptrapd - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent\mibgroup" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmptrapd.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmptrapd - Win32 Release"
+# Name "snmptrapd - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmptrapd.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\apps\snmptrapd_handlers.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\winservice.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\snmplib\winservice.rc
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpusm/snmpusm.dsp b/win32/snmpusm/snmpusm.dsp
new file mode 100644
index 0000000..a1c0124
--- /dev/null
+++ b/win32/snmpusm/snmpusm.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpusm" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpusm - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpusm.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpusm.mak" CFG="snmpusm - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpusm - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpusm - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpusm - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpusm.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpusm - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpusm.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpusm - Win32 Release"
+# Name "snmpusm - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpusm.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpv3-security-includes.h b/win32/snmpv3-security-includes.h
new file mode 100644
index 0000000..c763cf8
--- /dev/null
+++ b/win32/snmpv3-security-includes.h
@@ -0,0 +1 @@
+#include <net-snmp/library/snmpusm.h>
diff --git a/win32/snmpvacm/snmpvacm.dsp b/win32/snmpvacm/snmpvacm.dsp
new file mode 100644
index 0000000..2fd53fd
--- /dev/null
+++ b/win32/snmpvacm/snmpvacm.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpvacm" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpvacm - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpvacm.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpvacm.mak" CFG="snmpvacm - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpvacm - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpvacm - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpvacm - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpvacm.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpvacm - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpvacm.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpvacm - Win32 Release"
+# Name "snmpvacm - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpvacm.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/snmpwalk/snmpwalk.dsp b/win32/snmpwalk/snmpwalk.dsp
new file mode 100644
index 0000000..67598f1
--- /dev/null
+++ b/win32/snmpwalk/snmpwalk.dsp
@@ -0,0 +1,90 @@
+# Microsoft Developer Studio Project File - Name="snmpwalk" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=snmpwalk - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "snmpwalk.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "snmpwalk.mak" CFG="snmpwalk - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "snmpwalk - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "snmpwalk - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "snmpwalk - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../bin/release/snmpwalk.exe" /libpath:"../lib/release"
+
+!ELSEIF "$(CFG)" == "snmpwalk - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../bin/debug/snmpwalk.exe" /pdbtype:sept /libpath:"../lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "snmpwalk - Win32 Release"
+# Name "snmpwalk - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\apps\snmpwalk.c
+# End Source File
+# End Target
+# End Project
diff --git a/win32/transports/snmp_transport_inits.h b/win32/transports/snmp_transport_inits.h
new file mode 100644
index 0000000..2fa0301
--- /dev/null
+++ b/win32/transports/snmp_transport_inits.h
@@ -0,0 +1,15 @@
+#ifdef NETSNMP_TRANSPORT_UDP_DOMAIN
+netsnmp_udp_ctor();
+#endif
+#ifdef NETSNMP_TRANSPORT_TCP_DOMAIN
+netsnmp_tcp_ctor();
+#endif
+#ifdef NETSNMP_TRANSPORT_ALIAS_DOMAIN
+netsnmp_alias_ctor();
+#endif
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+netsnmp_udpipv6_ctor();
+#endif
+#ifdef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+netsnmp_tcpipv6_ctor();
+#endif
diff --git a/win32/win32.dsw b/win32/win32.dsw
new file mode 100644
index 0000000..5ad1ab0
--- /dev/null
+++ b/win32/win32.dsw
@@ -0,0 +1,374 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "libagent"=".\libagent\libagent.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "netsnmpmibs"=".\netsnmpmibs\netsnmpmibs.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "libsnmp"=".\libsnmp\libsnmp.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "libnetsnmptrapd"=".\libnetsnmptrapd\libnetsnmptrapd.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "encode_keychange"=".\encode_keychange\encode_keychange.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpbulkget"=".\snmpbulkget\snmpbulkget.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpbulkwalk"=".\snmpbulkwalk\snmpbulkwalk.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpd"=".\snmpd\snmpd.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libagent
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name netsnmpmibs
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpdelta"=".\snmpdelta\snmpdelta.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpdf"=".\snmpdf\snmpdf.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpget"=".\snmpget\snmpget.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpgetnext"=".\snmpgetnext\snmpgetnext.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpnetstat"=".\snmpnetstat\snmpnetstat.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpset"=".\snmpset\snmpset.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpstatus"=".\snmpstatus\snmpstatus.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptable"=".\snmptable\snmptable.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptest"=".\snmptest\snmptest.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptranslate"=".\snmptranslate\snmptranslate.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptrap"=".\snmptrap\snmptrap.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptrapd"=".\snmptrapd\snmptrapd.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libagent
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libnetsnmptrapd
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name netsnmpmibs
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpusm"=".\snmpusm\snmpusm.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpvacm"=".\snmpvacm\snmpvacm.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpwalk"=".\snmpwalk\snmpwalk.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/win32/win32dll.dsw b/win32/win32dll.dsw
new file mode 100755
index 0000000..fc24f5a
--- /dev/null
+++ b/win32/win32dll.dsw
@@ -0,0 +1,374 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "encode_keychange"=".\encode_keychange\encode_keychange.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "libagent"=".\libagent\libagent.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "libnetsnmptrapd"=".\libnetsnmptrapd\libnetsnmptrapd.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "libsnmp_dll"=".\libsnmp_dll\libsnmp_dll.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "netsnmpmibs"=".\netsnmpmibs\netsnmpmibs.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpbulkget"=".\snmpbulkget\snmpbulkget.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpbulkwalk"=".\snmpbulkwalk\snmpbulkwalk.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpd"=".\snmpd\snmpd.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libagent
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name netsnmpmibs
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpdelta"=".\snmpdelta\snmpdelta.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpdf"=".\snmpdf\snmpdf.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpget"=".\snmpget\snmpget.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpgetnext"=".\snmpgetnext\snmpgetnext.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpnetstat"=".\snmpnetstat\snmpnetstat.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpset"=".\snmpset\snmpset.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpstatus"=".\snmpstatus\snmpstatus.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptable"=".\snmptable\snmptable.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptest"=".\snmptest\snmptest.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptranslate"=".\snmptranslate\snmptranslate.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptrap"=".\snmptrap\snmptrap.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmptrapd"=".\snmptrapd\snmptrapd.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libagent
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libnetsnmptrapd
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name netsnmpmibs
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpusm"=".\snmpusm\snmpusm.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpvacm"=".\snmpvacm\snmpvacm.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "snmpwalk"=".\snmpwalk\snmpwalk.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libsnmp_dll
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+